mirror of
https://github.com/ant-design/ant-design.git
synced 2026-02-09 10:59:19 +08:00
Compare commits
148 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
463c3b0906 | ||
|
|
a0f9150b20 | ||
|
|
5766c5e15b | ||
|
|
869d572c6e | ||
|
|
3bca8f3055 | ||
|
|
62c9dee43e | ||
|
|
decb6d8390 | ||
|
|
ed70ba694e | ||
|
|
40e7e0c193 | ||
|
|
398788b2c9 | ||
|
|
c5fc656ec8 | ||
|
|
30fe88d4bd | ||
|
|
b6d7151486 | ||
|
|
7f5f09ff47 | ||
|
|
71f65a0be8 | ||
|
|
2aed46012e | ||
|
|
fe4d294c64 | ||
|
|
ae78a4bbec | ||
|
|
528c6fa1e0 | ||
|
|
6998f66eb5 | ||
|
|
5157b7b8a2 | ||
|
|
f61967b496 | ||
|
|
b1bcf842d7 | ||
|
|
e142bce0a0 | ||
|
|
473872af66 | ||
|
|
f78e0098fa | ||
|
|
43e4622ef8 | ||
|
|
e071002fae | ||
|
|
1259d703c7 | ||
|
|
d40d59ab68 | ||
|
|
468a7629e7 | ||
|
|
59b7195c06 | ||
|
|
15e69d09ca | ||
|
|
324e07fbf0 | ||
|
|
2f427e172a | ||
|
|
442673a934 | ||
|
|
8226ede38e | ||
|
|
cc06f0f7a5 | ||
|
|
518c424ca4 | ||
|
|
26934b37c8 | ||
|
|
8466028b5a | ||
|
|
69b154f9a9 | ||
|
|
56e4ce099d | ||
|
|
c7dd7cbbc4 | ||
|
|
9073237e70 | ||
|
|
c611fe74c0 | ||
|
|
d250f35cf3 | ||
|
|
765beb7570 | ||
|
|
c0e9a22fa9 | ||
|
|
3793412e6d | ||
|
|
5839c852a4 | ||
|
|
b2bb35b13d | ||
|
|
192c6bbb38 | ||
|
|
af8e54f1d6 | ||
|
|
a2018e7c44 | ||
|
|
d0c58946ee | ||
|
|
d40a3408c6 | ||
|
|
cdfbb6a3bd | ||
|
|
fd147deb75 | ||
|
|
2fe64d429a | ||
|
|
5e7bff8b5e | ||
|
|
98f938798d | ||
|
|
a4fea8f22c | ||
|
|
7d3573d471 | ||
|
|
ae2990e241 | ||
|
|
2548a4bcf9 | ||
|
|
d816879e78 | ||
|
|
c51f041ebc | ||
|
|
f24e41806d | ||
|
|
1b3118e1dc | ||
|
|
9634bea391 | ||
|
|
8a6b76acde | ||
|
|
bea95bf77c | ||
|
|
23e7716137 | ||
|
|
755b3e9043 | ||
|
|
aa9b7a4e4d | ||
|
|
82092c154a | ||
|
|
40e354c373 | ||
|
|
5df04e6827 | ||
|
|
54242e968f | ||
|
|
d4a5d2c188 | ||
|
|
e6a5c9be9e | ||
|
|
07a0a1f336 | ||
|
|
eab4fdfe95 | ||
|
|
86ab00fbbd | ||
|
|
c28d6f1624 | ||
|
|
947cee4475 | ||
|
|
feaf238dfa | ||
|
|
f1fd85780e | ||
|
|
dc439bd7c3 | ||
|
|
2c95ea0e5e | ||
|
|
aeeebab9d9 | ||
|
|
a6ffd332fa | ||
|
|
97b09b393b | ||
|
|
a438b9b33f | ||
|
|
7d5db31e67 | ||
|
|
053396810b | ||
|
|
676635abde | ||
|
|
c92cf5b778 | ||
|
|
2a1612b0c2 | ||
|
|
1d1ea1ac59 | ||
|
|
b574e8ee14 | ||
|
|
0e9743e78a | ||
|
|
4107a4bd8e | ||
|
|
ba236419be | ||
|
|
5294a69296 | ||
|
|
ec399ba27f | ||
|
|
d31612f2de | ||
|
|
c04377e541 | ||
|
|
626ebf2063 | ||
|
|
220d28d3e4 | ||
|
|
0e591ef01c | ||
|
|
e8fa1f168b | ||
|
|
e3f115dd3d | ||
|
|
1ae7da3878 | ||
|
|
d72a6dd7b9 | ||
|
|
2aaef6564d | ||
|
|
4a69446be1 | ||
|
|
f27bc6bd9d | ||
|
|
fff5680743 | ||
|
|
5accd6367a | ||
|
|
2909e5f651 | ||
|
|
b5f88c0005 | ||
|
|
0df2efccd0 | ||
|
|
240289ed73 | ||
|
|
50863acb1b | ||
|
|
1e92ff8efd | ||
|
|
3ffe718476 | ||
|
|
44063967a1 | ||
|
|
2411bdb7b7 | ||
|
|
3b6cd56820 | ||
|
|
7d3ff69e12 | ||
|
|
7b4abe7568 | ||
|
|
dc7d9de4cd | ||
|
|
70f3afeda0 | ||
|
|
6577616be2 | ||
|
|
875024cd1e | ||
|
|
3ed3a078e1 | ||
|
|
f8e996ee8e | ||
|
|
a8f1c35dcb | ||
|
|
a5f29f06a5 | ||
|
|
e992682aa8 | ||
|
|
33e2ef0f8d | ||
|
|
f1bd8d0d11 | ||
|
|
7c062bb118 | ||
|
|
59b18b4c26 | ||
|
|
ca6a8d13bd | ||
|
|
c725cbe791 |
2
.github/ISSUE_TEMPLATE.md
vendored
2
.github/ISSUE_TEMPLATE.md
vendored
@@ -12,4 +12,6 @@ If your issue was not created using the app above, it will be closed immediately
|
||||
http://new-issue.ant.design
|
||||
|
||||
不是用上面的链接创建的 issue 会被立即关闭。
|
||||
|
||||
两会期间,如果遇到官网无法访问,可以先使用代理访问或者访问国内镜像 http://ant-design.gitee.io
|
||||
-->
|
||||
|
||||
1
.jest.js
1
.jest.js
@@ -43,7 +43,6 @@ module.exports = {
|
||||
snapshotSerializers: [
|
||||
'enzyme-to-json/serializer',
|
||||
],
|
||||
mapCoverage: true,
|
||||
globals: {
|
||||
'ts-jest': {
|
||||
tsConfigFile: './tsconfig.test.json',
|
||||
|
||||
@@ -15,14 +15,89 @@ timeline: true
|
||||
|
||||
---
|
||||
|
||||
# 3.2.0
|
||||
## 3.3.0
|
||||
|
||||
`2018-03-12`
|
||||
|
||||
- 🌟 Add `afterClose` prop for `Alert` to achieve smooth unmount. [#9448](https://github.com/ant-design/ant-design/pull/9448) [@Hughen](https://github.com/Hughen)
|
||||
- 🌟 Add `validRange` prop for `Calendar` to set the date range. [71f65a0](https://github.com/ant-design/ant-design/commit/71f65a0be8e72a67f334c57e79ae3ff5fb640630) [@Rohanhacker](https://github.com/Rohanhacker)
|
||||
- 🌟 Add `defaultActiveTabKey` prop for `Card` to initial TabPane's active key. [30fe88d](https://github.com/ant-design/ant-design/commit/30fe88d4bdcec765bf92ca32a755d9646b36978e) [@u3u](https://github.com/u3u)
|
||||
- `DatePicker`
|
||||
- 🌟 Add `dropdownClassName` prop to set the className of popup calendar. [#7211](https://github.com/ant-design/ant-design/issues/7211)
|
||||
- 🐞 Fix the error of resolving `moment` object. [#9539](https://github.com/ant-design/ant-design/pull/9539)
|
||||
- 🐞 Fix uncorrect import of `turkish(tr_TR)` locale file. [#9373](https://github.com/ant-design/ant-design/issues/9373)
|
||||
- 🌟 Add `orientation` prop for `Divider` to set the alignment of text in divider. [#9275](https://github.com/ant-design/ant-design/pull/9275) [@jrvboesch](https://github.com/jrvboesch)
|
||||
- 🌟 Add `keyboard` prop for `Modal` to set whether Modal could be closed by `Esc` key. [#8818](https://github.com/ant-design/ant-design/issues/8818)
|
||||
- 🌟 Improve the TypeScript definition of `event` param in `onChange` prop for `Radio` and `Checkbox`. [#9574](https://github.com/ant-design/ant-design/issues/9574)
|
||||
- `Table`
|
||||
- 🌟 Add `position` prop in `pagination` prop to set the position of pagination. [#9357](https://github.com/ant-design/ant-design/pull/9357) [@kanweiwei](https://github.com/kanweiwei)
|
||||
- 🌟 Add event param of `onSelect` prop in `rowSelection` prop. [#9376](https://github.com/ant-design/ant-design/pull/9376) [@kanweiwei](https://github.com/kanweiwei)
|
||||
- 🌟 Add `columnWidth` prop in `rowSelection` prop to set the column width of selection. [#9474](https://github.com/ant-design/ant-design/pull/9474) [@SimpleFrontend](https://github.com/SimpleFrontend)
|
||||
- 🐞 Fix border radius issue in `Chrome` for `Table`. [af8e54f](https://github.com/ant-design/ant-design/commit/af8e54f1d6ac2891892e39b153cbe3e998370f61)
|
||||
- 🌟 Add `pendingDot` prop for `Timeline` to set icon of ghost node. [#9546](https://github.com/ant-design/ant-design/pull/9546) [@SimpleFrontend](https://github.com/SimpleFrontend)
|
||||
- 🌟 Add `inputReadOnly` prop for `TimePicker` to set if it's read only. [4a69446](https://github.com/ant-design/ant-design/commit/4a69446be155c1c176b18cb2c31459f999aa5d5e) [@JesperWe](https://github.com/JesperWe)
|
||||
- 🌟 Add `dropdownClassName` prop for `TreeSelect`. [69b154f](https://github.com/ant-design/ant-design/commit/69b154f9a9cfa5f2d89a82b6ed730d4d8793de73) [56e4ce0](https://github.com/ant-design/ant-design/commit/56e4ce099d950601538d72243563021e8083776b)
|
||||
- 🌟 Improve the preview for `Upload` when uploading the file of non-image format. [#9621](https://github.com/ant-design/ant-design/pull/9621) [@zswang](https://github.com/zswang)
|
||||
- 🐞 Fix `successPercent` prop that cannot decide the success status for `Progress`. [#9382](https://github.com/ant-design/ant-design/issues/9382)
|
||||
- 🐞 Fix font size for `Tabs`. [#9509](https://github.com/ant-design/ant-design/pull/9509)
|
||||
- 🐞 Fix that disabled parent node cannot spread for `Tree` and `TreeSelect`. [#9539](https://github.com/ant-design/ant-design/pull/9539)
|
||||
|
||||
## 3.2.3
|
||||
|
||||
`2018-03-02`
|
||||
|
||||
- 🐞 Fix props `onPopupScroll` ts define in `Select`. [#9475](https://github.com/ant-design/ant-design/pull/9475) [@twobin](https://github.com/twobin)
|
||||
- 🐞 Fix `Table` filter dropdown menu popup container. [#9209](https://github.com/ant-design/ant-design/issues/9209)
|
||||
- 🐞 Fix `Timeline` head custom style error in chrome. [#9429](https://github.com/ant-design/ant-design/pull/9429) [@vthinkxie](https://github.com/vthinkxie)
|
||||
- 🐞 Fix `Select` dropdown border. [82092c1](https://github.com/ant-design/ant-design/commit/82092c154ac1fa7ff2f89e1adbdf0aaf22e3ff53)
|
||||
- 🐞 Fix compatibility with less 3. [#7850](https://github.com/ant-design/ant-design/issues/7850)
|
||||
- 🐞 Fix `DatePicker.WeekPicker` year. [#9463](https://github.com/ant-design/ant-design/issues/9463)
|
||||
- 🐞 Fix `Button.Group` align issue in chrome. [#9457](https://github.com/ant-design/ant-design/issues/9457)
|
||||
|
||||
## 3.2.2
|
||||
|
||||
`2018-02-24`
|
||||
|
||||
- 🌟 Add font-family variable for `Pagination`. [#9351](https://github.com/ant-design/ant-design/issues/9351)
|
||||
- 🌟 Add font-weight variable for `Badge`. [#9352](https://github.com/ant-design/ant-design/issues/9352)
|
||||
- 🐞 Fix table custom spin indicator. [#9355](https://github.com/ant-design/ant-design/issues/9355)
|
||||
- 🐞 Fix `Form.create`. [#9331](https://github.com/ant-design/ant-design/issues/9331)
|
||||
- 🐞 Revert typescript definition of `column.dataIndex`. [#9393](https://github.com/ant-design/ant-design/issues/9393)
|
||||
- 🐞 Fix last menu item in Sider could be blocked by collapse trigger. [#9398](https://github.com/ant-design/ant-design/issues/9398) [@MJ111](https://github.com/MJ111)
|
||||
- 🐞 Fix badge works wrong in dot mode. [#9359](https://github.com/ant-design/ant-design/issues/9359) [@khayalan-mathew](https://github.com/khayalan-mathew)
|
||||
|
||||
## 3.2.1
|
||||
|
||||
`2018-02-11`
|
||||
|
||||
- 🌟 Add icons of some famous products. [c04377e5](https://github.com/ant-design/ant-design/commit/c04377e5413d344b37c34ceac6fee456933fa516)
|
||||
- Mention
|
||||
- 🌟 `multiLines` mode will support autosize.
|
||||
- 🐞 Fix paste not working when `placeholder` is specified. [#9215](https://github.com/ant-design/ant-design/issues/9215)
|
||||
- Table
|
||||
- 🐞 Fix padding of middle size table. [#9319](https://github.com/ant-design/ant-design/issues/9319)
|
||||
- 🐞 Fix border bug of small size table. [#8980](https://github.com/ant-design/ant-design/issues/8980)
|
||||
- 🐞 Fix overflow issue of sort icon interactive area. [#8979](https://github.com/ant-design/ant-design/issues/8979)
|
||||
- 🌟 Improve typescript definition of `column.dataIndex`. [#9298](https://github.com/ant-design/ant-design/pull/9298) [@clinyong](https://github.com/clinyong)
|
||||
- Select
|
||||
- 🐞 Fix wrong scroll position when navigating active item with keyboard. [#9276](https://github.com/ant-design/ant-design/issues/9276)
|
||||
- 🐞 Fix arrow position in IE11.
|
||||
- 🐞 Fix issue that file item showing `uploading` when Upload `beforeUpload` return false. [#8020](https://github.com/ant-design/ant-design/issues/8020)
|
||||
- 🐞 Fix misplace of feedback icon of `vertical` layout Form. [#9153](https://github.com/ant-design/ant-design/issues/9153)
|
||||
- 🐞 Fix loading style missing of empty childen Card. [#9258](https://github.com/ant-design/ant-design/issues/9258)
|
||||
- 🐞 Fix background color of Avatar when image source is not existe. [#9278](https://github.com/ant-design/ant-design/pull/9278) [@andriijas](https://github.com/andriijas)
|
||||
- 🐞 Fix RangePicker `Cannot read property 'locale' of undefined` error when select end date. [#9267](https://github.com/ant-design/ant-design/issues/9267)
|
||||
- 🐞 Fix style problem when using disabled button with Tooltip inside ButtonGroup. [#9296](https://github.com/ant-design/ant-design/issues/9296) [#9296](https://github.com/ant-design/ant-design/issues/9296)
|
||||
- 🐞 Fix z-index of Dropdown's submenu. [#9218](https://github.com/ant-design/ant-design/issues/9218)
|
||||
|
||||
## 3.2.0
|
||||
|
||||
`2018-02-04`
|
||||
|
||||
- 🌟 Add new `tabBarGutter` prop to Tab to allow setting gutter between tabs. [#8644](https://github.com/ant-design/ant-design/pull/8644) [@lixiaoyang1992](https://github.com/lixiaoyang1992)
|
||||
- 🌟 Add new `hasSider` prop to Layout to avoid render error when server rendering. [#8937](https://github.com/ant-design/ant-design/issues/8937)
|
||||
- 🌟 Add new `successPercent` to Progess to alow showing two phases. [Demo](https://ant.design/components/progress/#components-progress-demo-segment)
|
||||
- 🌟 Add new `iconType` prop to Alert to allow settting type of icon. [#8811](https://github.com/ant-design/ant-design/pull/8811) [@minwe](https://github.com/ant-design/ant-design/pull/8811)
|
||||
- 🌟 Add new `successPercent` to Progress to allow showing two phases. [Demo](https://ant.design/components/progress/#components-progress-demo-segment)
|
||||
- 🌟 Add new `iconType` prop to Alert to allow settting icon type. [#8811](https://github.com/ant-design/ant-design/pull/8811) [@minwe](https://github.com/ant-design/ant-design/pull/8811)
|
||||
- 🌟 Add `id` prop to DatePicker. [#8598](https://github.com/ant-design/ant-design/pull/8598) [@mgrdevport](https://github.com/mgrdevport)
|
||||
- 🌟 Add new `forceRender` prop to Collapse to allow rendering hide panel. [#9192](https://github.com/ant-design/ant-design/pull/9192) [#Pyroboomka](https://github.com/ant-design/ant-design/pull/9192) [@paulcmason](https://github.com/react-component/collapse/pull/82)
|
||||
- RangePicker
|
||||
|
||||
@@ -15,6 +15,81 @@ timeline: true
|
||||
|
||||
---
|
||||
|
||||
## 3.3.0
|
||||
|
||||
`2018-03-12`
|
||||
|
||||
- 🌟 `Alert` 组件新增 `afterClose` 属性,用于实现更流畅的关闭效果。[#9448](https://github.com/ant-design/ant-design/pull/9448) [@Hughen](https://github.com/Hughen)
|
||||
- 🌟 `Calendar` 组件新增 `validRange` 属性,用于设置显示的时间范围。[71f65a0](https://github.com/ant-design/ant-design/commit/71f65a0be8e72a67f334c57e79ae3ff5fb640630) [@Rohanhacker](https://github.com/Rohanhacker)
|
||||
- 🌟 `Card` 组件新增 `defaultActiveTabKey` 属性,用于初始化选中面板的 key。[30fe88d](https://github.com/ant-design/ant-design/commit/30fe88d4bdcec765bf92ca32a755d9646b36978e) [@u3u](https://github.com/u3u)
|
||||
- `DatePicker`
|
||||
- 🌟 新增 `dropdownClassName` 属性,用于设置弹出日历的 className。[#7211](https://github.com/ant-design/ant-design/issues/7211)
|
||||
- 🐞 修复解析 `moment` 对象出错的问题。[#9539](https://github.com/ant-design/ant-design/pull/9539)
|
||||
- 🐞 修复引入土耳其语 `tr_TR` 文件的问题。[#9373](https://github.com/ant-design/ant-design/issues/9373)
|
||||
- 🌟 `Divider` 组件新增 `orientation` 属性,用于设置分割线内文本的对齐方式。[#9275](https://github.com/ant-design/ant-design/pull/9275) [@jrvboesch](https://github.com/jrvboesch)
|
||||
- 🌟 `Modal` 组件新增 `keyboard` 属性,用于设置按下 `Esc` 键是否可以关闭 `Modal`。[#8818](https://github.com/ant-design/ant-design/issues/8818)
|
||||
- 🌟 优化 `Radio` 和 `Checkbox` 组件 `onChange` 属性中的事件参数的 `TypeScript` 类型定义的问题。[#9574](https://github.com/ant-design/ant-design/issues/9574)
|
||||
- `Table`
|
||||
- 🌟 新增 `pagination` 属性的配置项 `position`,用于设置分页的显示位置。[#9357](https://github.com/ant-design/ant-design/pull/9357) [@kanweiwei](https://github.com/kanweiwei)
|
||||
- 🌟 新增 `rowSelection` 属性的配置项 `onSelect` 回调函数的事件参数。[#9376](https://github.com/ant-design/ant-design/pull/9376) [@kanweiwei](https://github.com/kanweiwei)
|
||||
- 🌟 新增 `rowSelection` 属性的配置项 `columnWidth`,用于设置选择框的列宽。[#9474](https://github.com/ant-design/ant-design/pull/9474) [@SimpleFrontend](https://github.com/SimpleFrontend)
|
||||
- 🐞 修复 `Table` 组件在 `Chrome` 下圆角边框样式的问题。[af8e54f](https://github.com/ant-design/ant-design/commit/af8e54f1d6ac2891892e39b153cbe3e998370f61)
|
||||
- 🌟 `Timeline` 组件新增 `pendingDot` 属性,用于设置幽灵节点的图标。[#9546](https://github.com/ant-design/ant-design/pull/9546) [@SimpleFrontend](https://github.com/SimpleFrontend)
|
||||
- 🌟 `TimePicker` 组件新增 `inputReadOnly` 属性,用于设置组件是否只读。[4a69446](https://github.com/ant-design/ant-design/commit/4a69446be155c1c176b18cb2c31459f999aa5d5e) [@JesperWe](https://github.com/JesperWe)
|
||||
- 🌟 `TreeSelect` 组件新增 `dropdownClassName` 属性。[69b154f](https://github.com/ant-design/ant-design/commit/69b154f9a9cfa5f2d89a82b6ed730d4d8793de73) [56e4ce0](https://github.com/ant-design/ant-design/commit/56e4ce099d950601538d72243563021e8083776b)
|
||||
- 🌟 优化 `Upload` 组件在上传非图片格式文件时的预览效果。[#9621](https://github.com/ant-design/ant-design/pull/9621) [@zswang](https://github.com/zswang)
|
||||
- 🐞 修复 `Progress` 组件的 `successPercent` 属性无法决定组件是否处于 `success` 状态的问题。[#9382](https://github.com/ant-design/ant-design/issues/9382)
|
||||
- 🐞 修复 `Tabs` 组件字体尺寸的问题。[#9509](https://github.com/ant-design/ant-design/pull/9509)
|
||||
- 🐞 修复 `Tree` 和 `TreeSelect` 组件的父节点在 `disabled` 状态下无法展开的问题。[#9539](https://github.com/ant-design/ant-design/pull/9539)
|
||||
|
||||
## 3.2.3
|
||||
|
||||
`2018-03-02`
|
||||
|
||||
- 🐞 修复组件 `Select` 中的 `onPopupScroll` 属性的 ts 定义。 [#9475](https://github.com/ant-design/ant-design/pull/9475) [@twobin](https://github.com/twobin)
|
||||
- 🐞 修复 `Table` 过滤条件下拉选择框的问题。 [#9209](https://github.com/ant-design/ant-design/issues/9209)
|
||||
- 🐞 修复 `Timeline` 自定义头部样式在 Chrome 下的显示问题。 [#9429](https://github.com/ant-design/ant-design/pull/9429) [@vthinkxie](https://github.com/vthinkxie)
|
||||
- 🐞 修复 `Select` 下拉窗口的边框显示问题。 [82092c1](https://github.com/ant-design/ant-design/commit/82092c154ac1fa7ff2f89e1adbdf0aaf22e3ff53)
|
||||
- 🐞 修复对 less 3 的兼容性问题。 [#7850](https://github.com/ant-design/ant-design/issues/7850)
|
||||
- 🐞 修复 `DatePicker.WeekPicker` 年份问题。 [#9463](https://github.com/ant-design/ant-design/issues/9463)
|
||||
- 🐞 修复 `Button.Group` 在 Chrome 下的定位对齐问题。 [#9457](https://github.com/ant-design/ant-design/issues/9457)
|
||||
|
||||
## 3.2.2
|
||||
|
||||
`2018-02-24`
|
||||
|
||||
- 🌟 添加 `Pagination` 字体变量。 [#9351](https://github.com/ant-design/ant-design/issues/9351)
|
||||
- 🌟 添加 `Badge` 字重变量。 [#9352](https://github.com/ant-design/ant-design/issues/9352)
|
||||
- 🐞 修复 `Table` 当自定义 `loading.indicator` 时,不显示emptyText。 [#9355](https://github.com/ant-design/ant-design/issues/9355)
|
||||
- 🐞 修复 `Form.create` 。 [#9331](https://github.com/ant-design/ant-design/issues/9331)
|
||||
- 🐞 回滚 `Table` 中 `column.dataIndex` 的 TypeScript 定义。 [#9393](https://github.com/ant-design/ant-design/issues/9393)
|
||||
- 🐞 修复 `Layout` 中 sider 高度不足时,最后一个菜单无法显示。 [#9398](https://github.com/ant-design/ant-design/issues/9398) [@MJ111](https://github.com/MJ111)
|
||||
- 🐞 修复 `Badge` dot 模式问题。 [#9359](https://github.com/ant-design/ant-design/issues/9359) [@khayalan-mathew](https://github.com/khayalan-mathew)
|
||||
|
||||
## 3.2.1
|
||||
|
||||
`2018-02-11`
|
||||
|
||||
- 🌟 新增了部分著名产品的图标。[c04377e5](https://github.com/ant-design/ant-design/commit/c04377e5413d344b37c34ceac6fee456933fa516)
|
||||
- Mention
|
||||
- 🌟 现在 `multiLines` 模式的高度将默认自适应内容。
|
||||
- 🐞 修复指定了 `placeholder` 时无法粘贴内容的问题。[#9215](https://github.com/ant-design/ant-design/issues/9215)
|
||||
- Table
|
||||
- 🐞 修复中号表格的 padding。[#9319](https://github.com/ant-design/ant-design/issues/9319)
|
||||
- 🐞 修复小号表格的边框错位问题。[#8980](https://github.com/ant-design/ant-design/issues/8980)
|
||||
- 🐞 修复排序图标点击区域溢出表头的问题。[#8979](https://github.com/ant-design/ant-design/issues/8979)
|
||||
- 🌟 优化了 `column.dataIndex` 的 TypeScript 定义。[#9298](https://github.com/ant-design/ant-design/pull/9298) [@clinyong](https://github.com/clinyong)
|
||||
- Select
|
||||
- 🐞 修复使用键盘导航时,滚动条不会自动定位的问题。[#9276](https://github.com/ant-design/ant-design/issues/9276)
|
||||
- 🐞 修复在 IE11 下的箭头位置。
|
||||
- 🐞 修复 Upload `beforeUpload` 返回 `false` 时,上传文件仍然显示 `uploading` 以及文件列表被替换的问题。[#8020](https://github.com/ant-design/ant-design/issues/8020)
|
||||
- 🐞 修复 `vertical` 布局的 Form 下反馈图标错位的问题。[#9153](https://github.com/ant-design/ant-design/issues/9153)
|
||||
- 🐞 修复 Card 没有子节点时 `loading` 样式不生效的问题。[#9258](https://github.com/ant-design/ant-design/issues/9258)
|
||||
- 🐞 修复 Avatar 的图片不存在时的背景色。[#9278](https://github.com/ant-design/ant-design/pull/9278) [@andriijas](https://github.com/andriijas)
|
||||
- 🐞 修复 RangePicker 选择结束时间时报 `Cannot read property 'locale' of undefined` 的问题。[#9267](https://github.com/ant-design/ant-design/issues/9267)
|
||||
- 🐞 修复 ButtonGroup 内使用了失效按钮和 Tooltip 时样式错位的问题。[#9296](https://github.com/ant-design/ant-design/issues/9296) [#9296](https://github.com/ant-design/ant-design/issues/9296)
|
||||
- 🐞 修复 Dropdown 的子菜单被遮挡的问题。[#9218](https://github.com/ant-design/ant-design/issues/9218)
|
||||
|
||||
## 3.2.0
|
||||
|
||||
`2018-02-04`
|
||||
@@ -355,7 +430,7 @@ timeline: true
|
||||
```
|
||||
- Select
|
||||
- 🌟 默认和多选模式下 Option 的值允许使用 number。
|
||||
- 🌟 新增 `maxTagCount 和 `maxTagPlaceholder`,用与设置最多可显示的选中项。
|
||||
- 🌟 新增 `maxTagCount 和 `maxTagPlaceholder`,用于设置最多可显示的选中项。
|
||||
- 🌟 新增 `showAction`,用于设置出发下拉框打开的事件。
|
||||
- 🌟 新增 `onMouseEnter` 和 `onMouseLeave` 事件回调。
|
||||
- LocaleProvider
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
[](https://gemnasium.com/ant-design/ant-design)
|
||||
|
||||
[](https://www.npmjs.org/package/antd)
|
||||
[](https://npmjs.org/package/antd)
|
||||
[](https://npmcharts.com/compare/antd?minimal=true)
|
||||
[](http://isitmaintained.com/project/ant-design/ant-design "Percentage of issues still open")
|
||||
[](https://gitter.im/ant-design/ant-design-english?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge) (English)
|
||||
[](https://gitter.im/ant-design/ant-design?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)(中文)
|
||||
@@ -26,10 +26,10 @@ An enterprise-class UI design language and React-based implementation.
|
||||
|
||||
## Features
|
||||
|
||||
- An enterprise-class UI design language for web applications.
|
||||
- An enterprise-class UI design system for desktop applications.
|
||||
- A set of high-quality React components out of the box.
|
||||
- Written in TypeScript with complete define types.
|
||||
- A npm + webpack + [dva](https://github.com/dvajs/dva) front-end development workflow.
|
||||
- Written in TypeScript with predictable static types.
|
||||
- Work with great development and design resources and tools.
|
||||
|
||||
## Environment Support
|
||||
|
||||
@@ -92,6 +92,7 @@ See [i18n](http://ant.design/docs/react/i18n).
|
||||
|
||||
```bash
|
||||
$ git clone git@github.com:ant-design/ant-design.git
|
||||
$ cd ant-design
|
||||
$ npm install
|
||||
$ npm start
|
||||
```
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
// https://github.com/moment/moment/issues/3650
|
||||
export default function callMoment(moment: any, ...args: any[]) {
|
||||
return (moment.default || moment)(...args);
|
||||
}
|
||||
4
components/_util/interopDefault.ts
Normal file
4
components/_util/interopDefault.ts
Normal file
@@ -0,0 +1,4 @@
|
||||
// https://github.com/moment/moment/issues/3650
|
||||
export default function interopDefault(m: any) {
|
||||
return m.default || m;
|
||||
}
|
||||
@@ -2,7 +2,7 @@ import getRequestAnimationFrame, { cancelRequestAnimationFrame } from '../_util/
|
||||
|
||||
const reqAnimFrame = getRequestAnimationFrame();
|
||||
|
||||
export default function throttleByAnimationFrame(fn: () => void) {
|
||||
export default function throttleByAnimationFrame(fn: (...args: any[]) => void) {
|
||||
let requestId: number | null;
|
||||
|
||||
const later = (args: any[]) => () => {
|
||||
|
||||
@@ -366,6 +366,34 @@ exports[`renders ./components/alert/demo/icon.md correctly 1`] = `
|
||||
</div>
|
||||
`;
|
||||
|
||||
exports[`renders ./components/alert/demo/smooth-closed.md correctly 1`] = `
|
||||
<div>
|
||||
<div
|
||||
class="ant-alert ant-alert-success ant-alert-no-icon"
|
||||
data-show="true"
|
||||
>
|
||||
<span
|
||||
class="ant-alert-message"
|
||||
>
|
||||
Alert Message Text
|
||||
</span>
|
||||
<span
|
||||
class="ant-alert-description"
|
||||
/>
|
||||
<a
|
||||
class="ant-alert-close-icon"
|
||||
>
|
||||
<i
|
||||
class="anticon anticon-cross"
|
||||
/>
|
||||
</a>
|
||||
</div>
|
||||
<p>
|
||||
placeholder text here
|
||||
</p>
|
||||
</div>
|
||||
`;
|
||||
|
||||
exports[`renders ./components/alert/demo/style.md correctly 1`] = `
|
||||
<div>
|
||||
<div
|
||||
|
||||
48
components/alert/demo/smooth-closed.md
Normal file
48
components/alert/demo/smooth-closed.md
Normal file
@@ -0,0 +1,48 @@
|
||||
---
|
||||
order: 7
|
||||
title:
|
||||
zh-CN: 平滑地卸载
|
||||
en-US: Smoothly Unmount
|
||||
---
|
||||
|
||||
## zh-CN
|
||||
|
||||
平滑、自然的卸载提示
|
||||
|
||||
## en-US
|
||||
|
||||
Smoothly and unaffectedly unmount Alert.
|
||||
|
||||
````jsx
|
||||
import { Alert } from 'antd';
|
||||
|
||||
class App extends React.Component {
|
||||
state = {
|
||||
visiable: true,
|
||||
}
|
||||
handleClose = () => {
|
||||
this.setState({ visiable: false });
|
||||
}
|
||||
render() {
|
||||
return (
|
||||
<div>
|
||||
{
|
||||
this.state.visiable ? (
|
||||
<Alert
|
||||
message="Alert Message Text"
|
||||
type="success"
|
||||
closable
|
||||
afterClose={this.handleClose}
|
||||
/>
|
||||
) : null
|
||||
}
|
||||
<p>placeholder text here</p>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
ReactDOM.render(
|
||||
<App />
|
||||
, mountNode);
|
||||
````
|
||||
@@ -21,6 +21,8 @@ export interface AlertProps {
|
||||
description?: React.ReactNode;
|
||||
/** Callback when close Alert */
|
||||
onClose?: React.MouseEventHandler<HTMLAnchorElement>;
|
||||
/** Trigger when animation ending of Alert */
|
||||
afterClose?: Function;
|
||||
/** Whether to show icon */
|
||||
showIcon?: boolean;
|
||||
iconType?: string;
|
||||
@@ -56,6 +58,7 @@ export default class Alert extends React.Component<AlertProps, any> {
|
||||
closed: true,
|
||||
closing: true,
|
||||
});
|
||||
(this.props.afterClose || noop)();
|
||||
}
|
||||
render() {
|
||||
let {
|
||||
|
||||
@@ -83,7 +83,7 @@ export default class Avatar extends React.Component<AvatarProps, AvatarState> {
|
||||
|
||||
const classString = classNames(prefixCls, className, sizeCls, {
|
||||
[`${prefixCls}-${shape}`]: shape,
|
||||
[`${prefixCls}-image`]: src,
|
||||
[`${prefixCls}-image`]: src && this.state.isImgExist,
|
||||
[`${prefixCls}-icon`]: icon,
|
||||
});
|
||||
|
||||
|
||||
@@ -19,6 +19,6 @@ describe('BackTop', () => {
|
||||
jest.runAllTimers();
|
||||
wrapper.find('.ant-back-top').simulate('click');
|
||||
jest.runAllTimers();
|
||||
expect(Math.round(document.documentElement.scrollTop)).toBe(0);
|
||||
expect(Math.abs(Math.round(document.documentElement.scrollTop))).toBe(0);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -423,6 +423,13 @@ exports[`renders ./components/badge/demo/dot.md correctly 1`] = `
|
||||
data-show="true"
|
||||
/>
|
||||
</span>
|
||||
<span
|
||||
class="ant-badge"
|
||||
>
|
||||
<i
|
||||
class="anticon anticon-notification"
|
||||
/>
|
||||
</span>
|
||||
<span
|
||||
class="ant-badge"
|
||||
>
|
||||
|
||||
14
components/badge/__tests__/index.test.js
Normal file
14
components/badge/__tests__/index.test.js
Normal file
@@ -0,0 +1,14 @@
|
||||
import React from 'react';
|
||||
import { mount } from 'enzyme';
|
||||
import Badge from '../index';
|
||||
|
||||
describe('Badge', () => {
|
||||
test('badge dot not scaling count > 9', () => {
|
||||
const badge = mount(<Badge count={10} dot />);
|
||||
expect(badge.find('.ant-card-multiple-words').length).toBe(0);
|
||||
});
|
||||
test('badge dot not showing count == 0', () => {
|
||||
const badge = mount(<Badge count={0} dot />);
|
||||
expect(badge.find('.ant-badge-dot').length).toBe(0);
|
||||
});
|
||||
});
|
||||
@@ -12,6 +12,7 @@ title:
|
||||
## en-US
|
||||
|
||||
This will simply display a red badge, without a specific count.
|
||||
If count equals 0, it won't display the dot.
|
||||
|
||||
````jsx
|
||||
import { Badge, Icon } from 'antd';
|
||||
@@ -21,6 +22,9 @@ ReactDOM.render(
|
||||
<Badge dot>
|
||||
<Icon type="notification" />
|
||||
</Badge>
|
||||
<Badge count={0} dot>
|
||||
<Icon type="notification" />
|
||||
</Badge>
|
||||
<Badge dot>
|
||||
<a href="#">Link something</a>
|
||||
</Badge>
|
||||
|
||||
@@ -26,7 +26,7 @@ Badge normally appears in proximity to notifications or user avatars with eye-ca
|
||||
| -------- | ----------- | ---- | ------- |
|
||||
| count | Number to show in badge | number\|ReactNode | |
|
||||
| dot | Whether to display a red dot instead of `count` | boolean | `false` |
|
||||
| offset | set offset of the badge dot, like [x, y] | [number, number] | - |
|
||||
| offset | set offset of the badge dot, like`[x, y]` | `[number, number]` | - |
|
||||
| overflowCount | Max count to show | number | 99 |
|
||||
| showZero | Whether to show badge when `count` is zero | boolean | `false` |
|
||||
| status | Set Badge as a status dot | `success` \| `processing` \| `default` \| `error` \| `warning` | `''` |
|
||||
|
||||
@@ -59,14 +59,13 @@ export default class Badge extends React.Component<BadgeProps, any> {
|
||||
offset,
|
||||
...restProps,
|
||||
} = this.props;
|
||||
const isDot = dot || status;
|
||||
let displayCount = (count as number) > (overflowCount as number) ? `${overflowCount}+` : count;
|
||||
const isZero = displayCount === '0' || displayCount === 0;
|
||||
const isDot = (dot && !isZero) || status;
|
||||
// dot mode don't need count
|
||||
if (isDot) {
|
||||
displayCount = '';
|
||||
}
|
||||
|
||||
const isZero = displayCount === '0' || displayCount === 0;
|
||||
const isEmpty = displayCount === null || displayCount === undefined || displayCount === '';
|
||||
const hidden = (isEmpty || (isZero && !showZero)) && !isDot;
|
||||
const statusCls = classNames({
|
||||
@@ -76,7 +75,7 @@ export default class Badge extends React.Component<BadgeProps, any> {
|
||||
const scrollNumberCls = classNames({
|
||||
[`${prefixCls}-dot`]: isDot,
|
||||
[`${prefixCls}-count`]: !isDot,
|
||||
[`${prefixCls}-multiple-words`]: count && count.toString && count.toString().length > 1,
|
||||
[`${prefixCls}-multiple-words`]: !isDot && count && count.toString && count.toString().length > 1,
|
||||
[`${prefixCls}-status-${status}`]: !!status,
|
||||
});
|
||||
const badgeCls = classNames(className, prefixCls, {
|
||||
|
||||
@@ -27,7 +27,7 @@ title: Badge
|
||||
| --- | --- | --- | --- |
|
||||
| count | 展示的数字,大于 overflowCount 时显示为 `${overflowCount}+`,为 0 时隐藏 | number\|ReactNode | |
|
||||
| dot | 不展示数字,只有一个小红点 | boolean | false |
|
||||
| offset | 设置状态点的位置偏移,格式为 [x, y] | [number, number] | - |
|
||||
| offset | 设置状态点的位置偏移,格式为 `[x, y]` | `[number, number]` | - |
|
||||
| overflowCount | 展示封顶的数字值 | number | 99 |
|
||||
| showZero | 当数值为 0 时,是否展示 Badge | boolean | false |
|
||||
| status | 设置 Badge 为状态点 | Enum{ 'success', 'processing, 'default', 'error', 'warning' } | '' |
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
text-align: center;
|
||||
padding: 0 6px;
|
||||
font-size: @badge-font-size;
|
||||
font-weight: @badge-font-weight;
|
||||
white-space: nowrap;
|
||||
transform-origin: -10% center;
|
||||
box-shadow: 0 0 0 1px #fff;
|
||||
|
||||
@@ -47,6 +47,8 @@ export interface ButtonProps {
|
||||
onClick?: React.FormEventHandler<any>;
|
||||
onMouseUp?: React.FormEventHandler<any>;
|
||||
onMouseDown?: React.FormEventHandler<any>;
|
||||
onKeyPress?: React.KeyboardEventHandler<any>;
|
||||
onKeyDown?: React.KeyboardEventHandler<any>;
|
||||
tabIndex?: number;
|
||||
loading?: boolean | { delay?: number };
|
||||
disabled?: boolean;
|
||||
|
||||
@@ -36,7 +36,8 @@ To get a customized button, just set `type`/`shape`/`size`/`loading`/`disabled`.
|
||||
margin-right: 8px;
|
||||
margin-bottom: 12px;
|
||||
}
|
||||
[id^=components-button-demo-] .ant-btn-group > .ant-btn {
|
||||
[id^=components-button-demo-] .ant-btn-group > .ant-btn,
|
||||
[id^=components-button-demo-] .ant-btn-group > span > .ant-btn {
|
||||
margin-right: 0;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -108,6 +108,7 @@
|
||||
display: inline-block;
|
||||
> .@{btnClassName} {
|
||||
position: relative;
|
||||
line-height: @btn-height-base - 2px;
|
||||
|
||||
&:hover,
|
||||
&:focus,
|
||||
@@ -124,10 +125,12 @@
|
||||
// size
|
||||
&-lg > .@{btnClassName} {
|
||||
.button-size(@btn-height-lg; @btn-padding-lg; @btn-font-size-lg; @btn-border-radius-base);
|
||||
line-height: @btn-height-lg - 2px;
|
||||
}
|
||||
|
||||
&-sm > .@{btnClassName} {
|
||||
.button-size(@btn-height-sm; @btn-padding-sm; @font-size-base; @btn-border-radius-sm);
|
||||
line-height: @btn-height-sm - 2px;
|
||||
> .@{iconfont-css-prefix} {
|
||||
font-size: @font-size-base;
|
||||
}
|
||||
@@ -198,7 +201,7 @@
|
||||
&:focus,
|
||||
&:active,
|
||||
&.active {
|
||||
background: #fff;
|
||||
background: @btn-default-bg;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -241,6 +244,8 @@
|
||||
|
||||
.@{btnClassName} + .@{btnClassName},
|
||||
.@{btnClassName} + &,
|
||||
span + .@{btnClassName},
|
||||
.@{btnClassName} + span,
|
||||
& + .@{btnClassName},
|
||||
& + & {
|
||||
margin-left: -1px;
|
||||
@@ -250,15 +255,19 @@
|
||||
border-radius: 0;
|
||||
}
|
||||
|
||||
> .@{btnClassName}:first-child {
|
||||
> .@{btnClassName}:first-child,
|
||||
> span:first-child > .@{btnClassName} {
|
||||
margin-left: 0;
|
||||
&:not(:last-child) {
|
||||
border-bottom-right-radius: 0;
|
||||
border-top-right-radius: 0;
|
||||
}
|
||||
}
|
||||
|
||||
> .@{btnClassName}:last-child:not(:first-child) {
|
||||
> .@{btnClassName}:first-child:not(:last-child),
|
||||
> span:first-child:not(:last-child) > .@{btnClassName} {
|
||||
border-bottom-right-radius: 0;
|
||||
border-top-right-radius: 0;
|
||||
}
|
||||
|
||||
> .@{btnClassName}:last-child:not(:first-child),
|
||||
> span:last-child:not(:first-child) > .@{btnClassName} {
|
||||
border-bottom-left-radius: 0;
|
||||
border-top-left-radius: 0;
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@ import * as React from 'react';
|
||||
import * as moment from 'moment';
|
||||
import { PREFIX_CLS } from './Constants';
|
||||
import Select from '../select';
|
||||
import { Group, Button } from '../radio';
|
||||
import { Group, Button, RadioChangeEvent } from '../radio';
|
||||
const Option = Select.Option;
|
||||
|
||||
export interface HeaderProps {
|
||||
@@ -15,6 +15,7 @@ export interface HeaderProps {
|
||||
onValueChange?: (value: moment.Moment) => void;
|
||||
onTypeChange?: (type: string) => void;
|
||||
value: any;
|
||||
validRange ?: [moment.Moment, moment.Moment];
|
||||
}
|
||||
|
||||
export default class Header extends React.Component<HeaderProps, any> {
|
||||
@@ -27,11 +28,21 @@ export default class Header extends React.Component<HeaderProps, any> {
|
||||
private calenderHeaderNode: HTMLDivElement;
|
||||
|
||||
getYearSelectElement(year: number) {
|
||||
const { yearSelectOffset, yearSelectTotal, locale, prefixCls, fullscreen } = this.props;
|
||||
const start = year - (yearSelectOffset as number);
|
||||
const end = start + (yearSelectTotal as number);
|
||||
const {
|
||||
yearSelectOffset,
|
||||
yearSelectTotal,
|
||||
locale,
|
||||
prefixCls,
|
||||
fullscreen,
|
||||
validRange,
|
||||
} = this.props;
|
||||
let start = year - (yearSelectOffset as number);
|
||||
let end = start + (yearSelectTotal as number);
|
||||
if (validRange) {
|
||||
start = validRange[0].get('year');
|
||||
end = validRange[1].get('year') + 1;
|
||||
}
|
||||
const suffix = locale.year === '年' ? '年' : '';
|
||||
|
||||
const options: React.ReactElement<any>[] = [];
|
||||
for (let index = start; index < end; index++) {
|
||||
options.push(<Option key={`${index}`}>{index + suffix}</Option>);
|
||||
@@ -63,13 +74,22 @@ export default class Header extends React.Component<HeaderProps, any> {
|
||||
|
||||
getMonthSelectElement(month: number, months: number[]) {
|
||||
const props = this.props;
|
||||
const { prefixCls, fullscreen } = props;
|
||||
const { prefixCls, fullscreen, validRange, value } = props;
|
||||
const options: React.ReactElement<any>[] = [];
|
||||
|
||||
for (let index = 0; index < 12; index++) {
|
||||
let start = 0;
|
||||
let end = 12;
|
||||
if (validRange) {
|
||||
const [rangeStart, rangeEnd] = validRange;
|
||||
const currentYear = value.get('year');
|
||||
if (rangeEnd.get('year') === currentYear) {
|
||||
end = rangeEnd.get('month') + 1;
|
||||
} else {
|
||||
start = rangeStart.get('month');
|
||||
}
|
||||
}
|
||||
for (let index = start; index < end; index++) {
|
||||
options.push(<Option key={`${index}`}>{months[index]}</Option>);
|
||||
}
|
||||
|
||||
return (
|
||||
<Select
|
||||
size={fullscreen ? 'default' : 'small'}
|
||||
@@ -85,8 +105,21 @@ export default class Header extends React.Component<HeaderProps, any> {
|
||||
}
|
||||
|
||||
onYearChange = (year: string) => {
|
||||
const newValue = this.props.value.clone();
|
||||
const { value, validRange } = this.props;
|
||||
const newValue = value.clone();
|
||||
newValue.year(parseInt(year, 10));
|
||||
// switch the month so that it remains within range when year changes
|
||||
if (validRange) {
|
||||
const [ start, end ] = validRange;
|
||||
const newYear = newValue.get('year');
|
||||
const newMonth = newValue.get('month');
|
||||
if (newYear === end.get('year') && newMonth > end.get('month')) {
|
||||
newValue.month(end.get('month'));
|
||||
}
|
||||
if (newYear === start.get('year') && newMonth < start.get('month')) {
|
||||
newValue.month(start.get('month'));
|
||||
}
|
||||
}
|
||||
|
||||
const onValueChange = this.props.onValueChange;
|
||||
if (onValueChange) {
|
||||
@@ -103,7 +136,7 @@ export default class Header extends React.Component<HeaderProps, any> {
|
||||
}
|
||||
}
|
||||
|
||||
onTypeChange = (e: React.ChangeEvent<HTMLInputElement>) => {
|
||||
onTypeChange = (e: RadioChangeEvent) => {
|
||||
const onTypeChange = this.props.onTypeChange;
|
||||
if (onTypeChange) {
|
||||
onTypeChange(e.target.value);
|
||||
|
||||
@@ -15,6 +15,66 @@ describe('Calendar', () => {
|
||||
expect(Moment.isMoment(value)).toBe(true);
|
||||
});
|
||||
|
||||
it('only Valid range should be selectable', () => {
|
||||
const onSelect = jest.fn();
|
||||
const validRange = [Moment('2018-02-02'), Moment('2018-02-18')];
|
||||
const wrapper = mount(
|
||||
<Calendar onSelect={onSelect} validRange={validRange} defaultValue={Moment('2018-02-02')} />
|
||||
);
|
||||
wrapper.find('[title="February 1, 2018"]').at(0).simulate('click');
|
||||
wrapper.find('[title="February 2, 2018"]').at(0).simulate('click');
|
||||
expect(onSelect.mock.calls.length).toBe(1);
|
||||
});
|
||||
|
||||
it('dates other than in valid range should be disabled', () => {
|
||||
const onSelect = jest.fn();
|
||||
const validRange = [Moment('2018-02-02'), Moment('2018-02-18')];
|
||||
const wrapper = mount(
|
||||
<Calendar onSelect={onSelect} validRange={validRange} defaultValue={Moment('2018-02-02')} />
|
||||
);
|
||||
wrapper.find('[title="February 20, 2018"]').at(0).simulate('click');
|
||||
const elem = wrapper.find('[title="February 20, 2018"]').hasClass('ant-fullcalendar-disabled-cell');
|
||||
expect(elem).toEqual(true);
|
||||
expect(onSelect.mock.calls.length).toBe(0);
|
||||
});
|
||||
|
||||
it('months other than in valid range should be disabled', () => {
|
||||
const onSelect = jest.fn();
|
||||
const validRange = [Moment('2018-02-02'), Moment('2018-05-18')];
|
||||
const wrapper = mount(
|
||||
<Calendar onSelect={onSelect} validRange={validRange} defaultValue={Moment('2018-02-02')} mode="year" />
|
||||
);
|
||||
expect(wrapper.find('[title="Jan"]').at(0).hasClass('ant-fullcalendar-month-panel-cell-disabled')).toBe(true);
|
||||
expect(wrapper.find('[title="Feb"]').at(0).hasClass('ant-fullcalendar-month-panel-cell-disabled')).toBe(false);
|
||||
expect(wrapper.find('[title="Jun"]').at(0).hasClass('ant-fullcalendar-month-panel-cell-disabled')).toBe(true);
|
||||
wrapper.find('[title="Jan"]').at(0).simulate('click');
|
||||
wrapper.find('[title="Mar"]').at(0).simulate('click');
|
||||
expect(onSelect.mock.calls.length).toBe(1);
|
||||
});
|
||||
|
||||
it('months other than in valid range should not be shown in header', () => {
|
||||
const validRange = [Moment('2017-02-02'), Moment('2018-05-18')];
|
||||
const wrapper = mount(
|
||||
<Calendar validRange={validRange} />
|
||||
);
|
||||
wrapper.find('.ant-fullcalendar-year-select').hostNodes().simulate('click');
|
||||
wrapper.find('.ant-select-dropdown-menu-item').first().simulate('click');
|
||||
wrapper.find('.ant-fullcalendar-month-select').hostNodes().simulate('click');
|
||||
// 2 years and 11 months
|
||||
expect(wrapper.find('.ant-select-dropdown-menu-item').length).toBe(13);
|
||||
});
|
||||
|
||||
it('getDateRange should returns a disabledDate function', () => {
|
||||
const validRange = [Moment('2018-02-02'), Moment('2018-05-18')];
|
||||
const wrapper = mount(
|
||||
<Calendar validRange={validRange} defaultValue={Moment('2018-02-02')} />
|
||||
);
|
||||
const instance = wrapper.instance();
|
||||
const disabledDate = instance.getDateRange(validRange);
|
||||
expect(disabledDate(Moment('2018-06-02'))).toBe(true);
|
||||
expect(disabledDate(Moment('2018-04-02'))).toBe(false);
|
||||
});
|
||||
|
||||
it('Calendar should change mode by prop', () => {
|
||||
const monthMode = 'month';
|
||||
const yearMode = 'year';
|
||||
|
||||
@@ -40,6 +40,7 @@ When data is in the form of dates, such as schedules, timetables, prices calenda
|
||||
| mode | The display mode of the calendar | `month` \| `year` | `month` |
|
||||
| monthCellRender | Customize the display of the month cell, the returned content will be appended to the cell | function(date: moment): ReactNode | - |
|
||||
| monthFullCellRender | Customize the display of the month cell, the returned content will override the cell | function(date: moment): ReactNode | - |
|
||||
| validRange | to set valid range | \[[moment](http://momentjs.com/), [moment](http://momentjs.com/)] | - |
|
||||
| value | The current selected date | [moment](http://momentjs.com/) | current date |
|
||||
| onPanelChange | Callback for when panel changes | function(date: moment, mode: string) | - |
|
||||
| onSelect | Callback for when a date is selected | function(date: moment) | - |
|
||||
|
||||
@@ -5,7 +5,7 @@ import FullCalendar from 'rc-calendar/lib/FullCalendar';
|
||||
import LocaleReceiver from '../locale-provider/LocaleReceiver';
|
||||
import { PREFIX_CLS } from './Constants';
|
||||
import Header from './Header';
|
||||
import callMoment from '../_util/callMoment';
|
||||
import interopDefault from '../_util/interopDefault';
|
||||
import enUS from './locale/en_US';
|
||||
|
||||
export { HeaderProps } from './Header';
|
||||
@@ -37,6 +37,7 @@ export interface CalendarProps {
|
||||
onPanelChange?: (date?: moment.Moment, mode?: CalendarMode) => void;
|
||||
onSelect?: (date?: moment.Moment) => void;
|
||||
disabledDate?: (current: moment.Moment) => boolean;
|
||||
validRange ?: [moment.Moment, moment.Moment];
|
||||
}
|
||||
|
||||
export interface CalendarState {
|
||||
@@ -72,8 +73,8 @@ export default class Calendar extends React.Component<CalendarProps, CalendarSta
|
||||
constructor(props: CalendarProps) {
|
||||
super(props);
|
||||
|
||||
const value = props.value || props.defaultValue || callMoment(moment);
|
||||
if (!moment.isMoment(value)) {
|
||||
const value = props.value || props.defaultValue || interopDefault(moment)();
|
||||
if (!interopDefault(moment).isMoment(value)) {
|
||||
throw new Error(
|
||||
'The value/defaultValue of Calendar must be a moment object after `antd@2.0`, ' +
|
||||
'see: https://u.ant.design/calendar-value',
|
||||
@@ -166,6 +167,21 @@ export default class Calendar extends React.Component<CalendarProps, CalendarSta
|
||||
this.setValue(value, 'select');
|
||||
}
|
||||
|
||||
getDateRange = (
|
||||
validRange: [moment.Moment, moment.Moment],
|
||||
disabledDate?: (current: moment.Moment) => boolean,
|
||||
) => (current: moment.Moment) => {
|
||||
if (!current) {
|
||||
return false;
|
||||
}
|
||||
const [ startDate, endDate ] = validRange;
|
||||
const inRange = !current.isBetween(startDate, endDate, 'days', '[]');
|
||||
if (disabledDate) {
|
||||
return (disabledDate(current) || inRange);
|
||||
}
|
||||
return inRange;
|
||||
}
|
||||
|
||||
renderCalendar = (locale: any, localeCode: string) => {
|
||||
const { state, props } = this;
|
||||
const { value, mode } = state;
|
||||
@@ -183,6 +199,12 @@ export default class Calendar extends React.Component<CalendarProps, CalendarSta
|
||||
const monthCellRender = monthFullCellRender || this.monthCellRender;
|
||||
const dateCellRender = dateFullCellRender || this.dateCellRender;
|
||||
|
||||
let disabledDate = props.disabledDate;
|
||||
|
||||
if (props.validRange) {
|
||||
disabledDate = this.getDateRange(props.validRange, disabledDate);
|
||||
}
|
||||
|
||||
return (
|
||||
<div className={cls} style={style}>
|
||||
<Header
|
||||
@@ -193,9 +215,11 @@ export default class Calendar extends React.Component<CalendarProps, CalendarSta
|
||||
prefixCls={prefixCls}
|
||||
onTypeChange={this.onHeaderTypeChange}
|
||||
onValueChange={this.onHeaderValueChange}
|
||||
validRange={props.validRange}
|
||||
/>
|
||||
<FullCalendar
|
||||
{...props}
|
||||
disabledDate={disabledDate}
|
||||
Select={noop}
|
||||
locale={locale.lang}
|
||||
type={type}
|
||||
|
||||
@@ -41,6 +41,7 @@ title: Calendar
|
||||
| mode | 初始模式,`month/year` | string | month |
|
||||
| monthCellRender | 自定义渲染月单元格,返回内容会被追加到单元格 | function(date: moment): ReactNode | 无 |
|
||||
| monthFullCellRender | 自定义渲染月单元格,返回内容覆盖单元格 | function(date: moment): ReactNode | 无 |
|
||||
| validRange | 设置可以显示的日期 | \[[moment](http://momentjs.com/), [moment](http://momentjs.com/)] | 无 |
|
||||
| value | 展示日期 | [moment](http://momentjs.com/) | 当前日期 |
|
||||
| onPanelChange | 日期面板变化回调 | function(date: moment, mode: string) | 无 |
|
||||
| onSelect | 点击选择日期回调 | function(date: moment) | 无 |
|
||||
|
||||
@@ -616,8 +616,8 @@ exports[`renders ./components/card/demo/tabs.md correctly 1`] = `
|
||||
/>
|
||||
<div
|
||||
aria-disabled="false"
|
||||
aria-selected="true"
|
||||
class="ant-tabs-tab-active ant-tabs-tab"
|
||||
aria-selected="false"
|
||||
class=" ant-tabs-tab"
|
||||
role="tab"
|
||||
>
|
||||
tab1
|
||||
@@ -637,11 +637,11 @@ exports[`renders ./components/card/demo/tabs.md correctly 1`] = `
|
||||
</div>
|
||||
<div
|
||||
class="ant-tabs-content ant-tabs-content-animated"
|
||||
style="margin-left:0%"
|
||||
style="display:none"
|
||||
>
|
||||
<div
|
||||
aria-hidden="false"
|
||||
class="ant-tabs-tabpane ant-tabs-tabpane-active"
|
||||
aria-hidden="true"
|
||||
class="ant-tabs-tabpane ant-tabs-tabpane-inactive"
|
||||
role="tabpanel"
|
||||
/>
|
||||
<div
|
||||
@@ -713,16 +713,16 @@ exports[`renders ./components/card/demo/tabs.md correctly 1`] = `
|
||||
/>
|
||||
<div
|
||||
aria-disabled="false"
|
||||
aria-selected="true"
|
||||
class="ant-tabs-tab-active ant-tabs-tab"
|
||||
aria-selected="false"
|
||||
class=" ant-tabs-tab"
|
||||
role="tab"
|
||||
>
|
||||
article
|
||||
</div>
|
||||
<div
|
||||
aria-disabled="false"
|
||||
aria-selected="false"
|
||||
class=" ant-tabs-tab"
|
||||
aria-selected="true"
|
||||
class="ant-tabs-tab-active ant-tabs-tab"
|
||||
role="tab"
|
||||
>
|
||||
app
|
||||
@@ -742,18 +742,18 @@ exports[`renders ./components/card/demo/tabs.md correctly 1`] = `
|
||||
</div>
|
||||
<div
|
||||
class="ant-tabs-content ant-tabs-content-animated"
|
||||
style="margin-left:0%"
|
||||
style="margin-left:-100%"
|
||||
>
|
||||
<div
|
||||
aria-hidden="false"
|
||||
class="ant-tabs-tabpane ant-tabs-tabpane-active"
|
||||
role="tabpanel"
|
||||
/>
|
||||
<div
|
||||
aria-hidden="true"
|
||||
class="ant-tabs-tabpane ant-tabs-tabpane-inactive"
|
||||
role="tabpanel"
|
||||
/>
|
||||
<div
|
||||
aria-hidden="false"
|
||||
class="ant-tabs-tabpane ant-tabs-tabpane-active"
|
||||
role="tabpanel"
|
||||
/>
|
||||
<div
|
||||
aria-hidden="true"
|
||||
class="ant-tabs-tabpane ant-tabs-tabpane-inactive"
|
||||
@@ -766,7 +766,7 @@ exports[`renders ./components/card/demo/tabs.md correctly 1`] = `
|
||||
class="ant-card-body"
|
||||
>
|
||||
<p>
|
||||
article content
|
||||
app content
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -49,7 +49,7 @@ const contentListNoTitle = {
|
||||
class TabsCard extends React.Component {
|
||||
state = {
|
||||
key: 'tab1',
|
||||
noTitleKey: 'article',
|
||||
noTitleKey: 'app',
|
||||
}
|
||||
onTabChange = (key, type) => {
|
||||
console.log(key, type);
|
||||
@@ -71,6 +71,7 @@ class TabsCard extends React.Component {
|
||||
<Card
|
||||
style={{ width: '100%' }}
|
||||
tabList={tabListNoTitle}
|
||||
activeTabKey={this.state.noTitleKey}
|
||||
onTabChange={(key) => { this.onTabChange(key, 'noTitleKey'); }}
|
||||
>
|
||||
{contentListNoTitle[this.state.noTitleKey]}
|
||||
|
||||
@@ -29,6 +29,8 @@ A card can be used to display content related to a single subject. The content c
|
||||
| hoverable | Lift up when hovering card | boolean | false |
|
||||
| loading | Shows a loading indicator while the contents of the card are being fetched | boolean | false |
|
||||
| tabList | List of TabPane's head. | Array<{key: string, tab: ReactNode}> | - |
|
||||
| activeTabKey | Current TabPane's key | string | - |
|
||||
| defaultActiveTabKey | Initial active TabPane's key, if `activeTabKey` is not set. | string | - |
|
||||
| title | Card title | string\|ReactNode | - |
|
||||
| type | Card style type, can be set to `inner` or not set | string | - |
|
||||
| onTabChange | Callback when tab is switched | (key) => void | - |
|
||||
|
||||
@@ -36,6 +36,8 @@ export interface CardProps {
|
||||
actions?: Array<React.ReactNode>;
|
||||
tabList?: CardTabListType[];
|
||||
onTabChange?: (key: string) => void;
|
||||
activeTabKey?: string;
|
||||
defaultActiveTabKey?: string;
|
||||
}
|
||||
|
||||
export default class Card extends React.Component<CardProps, {}> {
|
||||
@@ -123,7 +125,7 @@ export default class Card extends React.Component<CardProps, {}> {
|
||||
render() {
|
||||
const {
|
||||
prefixCls = 'ant-card', className, extra, bodyStyle, noHovering, hoverable, title, loading,
|
||||
bordered = true, type, cover, actions, tabList, children, ...others,
|
||||
bordered = true, type, cover, actions, tabList, children, activeTabKey, defaultActiveTabKey, ...others,
|
||||
} = this.props;
|
||||
|
||||
const classString = classNames(prefixCls, className, {
|
||||
@@ -160,9 +162,21 @@ export default class Card extends React.Component<CardProps, {}> {
|
||||
</div>
|
||||
);
|
||||
|
||||
const hasActiveTabKey = activeTabKey !== undefined;
|
||||
const extraProps = {
|
||||
[hasActiveTabKey ? 'activeKey' : 'defaultActiveKey']: hasActiveTabKey
|
||||
? activeTabKey
|
||||
: defaultActiveTabKey,
|
||||
};
|
||||
|
||||
let head;
|
||||
const tabs = tabList && tabList.length ? (
|
||||
<Tabs className={`${prefixCls}-head-tabs`} size="large" onChange={this.onTabChange}>
|
||||
<Tabs
|
||||
{...extraProps}
|
||||
className={`${prefixCls}-head-tabs`}
|
||||
size="large"
|
||||
onChange={this.onTabChange}
|
||||
>
|
||||
{tabList.map(item => <Tabs.TabPane tab={item.tab} key={item.key} />)}
|
||||
</Tabs>
|
||||
) : null;
|
||||
@@ -192,7 +206,7 @@ export default class Card extends React.Component<CardProps, {}> {
|
||||
<div {...divProps} className={classString} ref={this.saveRef}>
|
||||
{head}
|
||||
{coverDom}
|
||||
{children ? body : null}
|
||||
{body}
|
||||
{actionDom}
|
||||
</div>
|
||||
);
|
||||
|
||||
@@ -30,6 +30,8 @@ cols: 1
|
||||
| hoverable | 鼠标移过时可浮起 | boolean | false |
|
||||
| loading | 当卡片内容还在加载中时,可以用 loading 展示一个占位 | boolean | false |
|
||||
| tabList | 页签标题列表 | Array<{key: string, tab: ReactNode}> | - |
|
||||
| activeTabKey | 当前激活页签的 key | string | - |
|
||||
| defaultActiveTabKey | 初始化选中页签的 key,如果没有设置 activeTabKey | string | 第一个页签 |
|
||||
| title | 卡片标题 | string\|ReactNode | - |
|
||||
| type | 卡片类型,可设置为 `inner` 或 不设置 | string | - |
|
||||
| onTabChange | 页签切换的回调 | (key) => void | - |
|
||||
|
||||
@@ -16,13 +16,14 @@ exports[`renders ./components/carousel/demo/autoplay.md correctly 1`] = `
|
||||
<div
|
||||
class="slick-slide slick-cloned"
|
||||
data-index="-1"
|
||||
tabindex="-1"
|
||||
>
|
||||
<h3>
|
||||
4
|
||||
</h3>
|
||||
</div>
|
||||
<div
|
||||
class="slick-slide slick-active slick-cloned"
|
||||
class="slick-slide slick-active slick-cloned slick-current"
|
||||
data-index="0"
|
||||
style="outline:none"
|
||||
tabindex="-1"
|
||||
@@ -64,6 +65,7 @@ exports[`renders ./components/carousel/demo/autoplay.md correctly 1`] = `
|
||||
<div
|
||||
class="slick-slide slick-cloned"
|
||||
data-index="4"
|
||||
tabindex="-1"
|
||||
>
|
||||
<h3>
|
||||
1
|
||||
@@ -72,6 +74,7 @@ exports[`renders ./components/carousel/demo/autoplay.md correctly 1`] = `
|
||||
<div
|
||||
class="slick-slide slick-cloned"
|
||||
data-index="5"
|
||||
tabindex="-1"
|
||||
>
|
||||
<h3>
|
||||
2
|
||||
@@ -80,6 +83,7 @@ exports[`renders ./components/carousel/demo/autoplay.md correctly 1`] = `
|
||||
<div
|
||||
class="slick-slide slick-cloned"
|
||||
data-index="6"
|
||||
tabindex="-1"
|
||||
>
|
||||
<h3>
|
||||
3
|
||||
@@ -88,6 +92,7 @@ exports[`renders ./components/carousel/demo/autoplay.md correctly 1`] = `
|
||||
<div
|
||||
class="slick-slide slick-cloned"
|
||||
data-index="7"
|
||||
tabindex="-1"
|
||||
>
|
||||
<h3>
|
||||
4
|
||||
@@ -115,13 +120,14 @@ exports[`renders ./components/carousel/demo/basic.md correctly 1`] = `
|
||||
<div
|
||||
class="slick-slide slick-cloned"
|
||||
data-index="-1"
|
||||
tabindex="-1"
|
||||
>
|
||||
<h3>
|
||||
4
|
||||
</h3>
|
||||
</div>
|
||||
<div
|
||||
class="slick-slide slick-active slick-cloned"
|
||||
class="slick-slide slick-active slick-cloned slick-current"
|
||||
data-index="0"
|
||||
style="outline:none"
|
||||
tabindex="-1"
|
||||
@@ -163,6 +169,7 @@ exports[`renders ./components/carousel/demo/basic.md correctly 1`] = `
|
||||
<div
|
||||
class="slick-slide slick-cloned"
|
||||
data-index="4"
|
||||
tabindex="-1"
|
||||
>
|
||||
<h3>
|
||||
1
|
||||
@@ -171,6 +178,7 @@ exports[`renders ./components/carousel/demo/basic.md correctly 1`] = `
|
||||
<div
|
||||
class="slick-slide slick-cloned"
|
||||
data-index="5"
|
||||
tabindex="-1"
|
||||
>
|
||||
<h3>
|
||||
2
|
||||
@@ -179,6 +187,7 @@ exports[`renders ./components/carousel/demo/basic.md correctly 1`] = `
|
||||
<div
|
||||
class="slick-slide slick-cloned"
|
||||
data-index="6"
|
||||
tabindex="-1"
|
||||
>
|
||||
<h3>
|
||||
3
|
||||
@@ -187,6 +196,7 @@ exports[`renders ./components/carousel/demo/basic.md correctly 1`] = `
|
||||
<div
|
||||
class="slick-slide slick-cloned"
|
||||
data-index="7"
|
||||
tabindex="-1"
|
||||
>
|
||||
<h3>
|
||||
4
|
||||
@@ -212,9 +222,9 @@ exports[`renders ./components/carousel/demo/fade.md correctly 1`] = `
|
||||
class="slick-track"
|
||||
>
|
||||
<div
|
||||
class="slick-slide slick-active slick-cloned"
|
||||
class="slick-slide slick-active slick-cloned slick-current"
|
||||
data-index="0"
|
||||
style="outline:none;position:relative;left:0;opacity:1;transition:opacity 500ms ease;-webkit-transition:opacity 500ms ease"
|
||||
style="outline:none;position:relative;left:0;opacity:1;transition:opacity 500ms ease, visibility 500ms ease;-webkit-transition:opacity 500ms ease, visibility 500ms ease"
|
||||
tabindex="-1"
|
||||
>
|
||||
<h3>
|
||||
@@ -224,7 +234,7 @@ exports[`renders ./components/carousel/demo/fade.md correctly 1`] = `
|
||||
<div
|
||||
class="slick-slide slick-cloned"
|
||||
data-index="1"
|
||||
style="outline:none;position:relative;left:0;opacity:0;transition:opacity 500ms ease;-webkit-transition:opacity 500ms ease"
|
||||
style="outline:none;position:relative;left:0;opacity:0;transition:opacity 500ms ease, visibility 500ms ease;-webkit-transition:opacity 500ms ease, visibility 500ms ease"
|
||||
tabindex="-1"
|
||||
>
|
||||
<h3>
|
||||
@@ -234,7 +244,7 @@ exports[`renders ./components/carousel/demo/fade.md correctly 1`] = `
|
||||
<div
|
||||
class="slick-slide slick-cloned"
|
||||
data-index="2"
|
||||
style="outline:none;position:relative;left:0;opacity:0;transition:opacity 500ms ease;-webkit-transition:opacity 500ms ease"
|
||||
style="outline:none;position:relative;left:0;opacity:0;transition:opacity 500ms ease, visibility 500ms ease;-webkit-transition:opacity 500ms ease, visibility 500ms ease"
|
||||
tabindex="-1"
|
||||
>
|
||||
<h3>
|
||||
@@ -244,7 +254,7 @@ exports[`renders ./components/carousel/demo/fade.md correctly 1`] = `
|
||||
<div
|
||||
class="slick-slide slick-cloned"
|
||||
data-index="3"
|
||||
style="outline:none;position:relative;left:0;opacity:0;transition:opacity 500ms ease;-webkit-transition:opacity 500ms ease"
|
||||
style="outline:none;position:relative;left:0;opacity:0;transition:opacity 500ms ease, visibility 500ms ease;-webkit-transition:opacity 500ms ease, visibility 500ms ease"
|
||||
tabindex="-1"
|
||||
>
|
||||
<h3>
|
||||
@@ -273,13 +283,14 @@ exports[`renders ./components/carousel/demo/vertical.md correctly 1`] = `
|
||||
<div
|
||||
class="slick-slide slick-cloned"
|
||||
data-index="-1"
|
||||
tabindex="-1"
|
||||
>
|
||||
<h3>
|
||||
4
|
||||
</h3>
|
||||
</div>
|
||||
<div
|
||||
class="slick-slide slick-active slick-cloned"
|
||||
class="slick-slide slick-active slick-cloned slick-current"
|
||||
data-index="0"
|
||||
style="outline:none"
|
||||
tabindex="-1"
|
||||
@@ -321,6 +332,7 @@ exports[`renders ./components/carousel/demo/vertical.md correctly 1`] = `
|
||||
<div
|
||||
class="slick-slide slick-cloned"
|
||||
data-index="4"
|
||||
tabindex="-1"
|
||||
>
|
||||
<h3>
|
||||
1
|
||||
@@ -329,6 +341,7 @@ exports[`renders ./components/carousel/demo/vertical.md correctly 1`] = `
|
||||
<div
|
||||
class="slick-slide slick-cloned"
|
||||
data-index="5"
|
||||
tabindex="-1"
|
||||
>
|
||||
<h3>
|
||||
2
|
||||
@@ -337,6 +350,7 @@ exports[`renders ./components/carousel/demo/vertical.md correctly 1`] = `
|
||||
<div
|
||||
class="slick-slide slick-cloned"
|
||||
data-index="6"
|
||||
tabindex="-1"
|
||||
>
|
||||
<h3>
|
||||
3
|
||||
@@ -345,6 +359,7 @@ exports[`renders ./components/carousel/demo/vertical.md correctly 1`] = `
|
||||
<div
|
||||
class="slick-slide slick-cloned"
|
||||
data-index="7"
|
||||
tabindex="-1"
|
||||
>
|
||||
<h3>
|
||||
4
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import * as React from 'react';
|
||||
import debounce from 'lodash.debounce';
|
||||
import debounce from 'lodash/debounce';
|
||||
|
||||
// matchMedia polyfill for
|
||||
// https://github.com/WickyNilliams/enquire.js/issues/82
|
||||
|
||||
@@ -52,12 +52,16 @@ function onChange(value, selectedOptions) {
|
||||
console.log(value, selectedOptions);
|
||||
}
|
||||
|
||||
function filter(inputValue, path) {
|
||||
return (path.some(option => (option.label).toLowerCase().indexOf(inputValue.toLowerCase()) > -1));
|
||||
}
|
||||
|
||||
ReactDOM.render(
|
||||
<Cascader
|
||||
options={options}
|
||||
onChange={onChange}
|
||||
placeholder="Please select"
|
||||
showSearch
|
||||
showSearch={{ filter }}
|
||||
/>,
|
||||
mountNode
|
||||
);
|
||||
|
||||
@@ -5,26 +5,39 @@ import RcCheckbox from 'rc-checkbox';
|
||||
import shallowEqual from 'shallowequal';
|
||||
import CheckboxGroup, { CheckboxGroupContext } from './Group';
|
||||
|
||||
export interface AbstractCheckboxProps {
|
||||
export interface AbstractCheckboxProps<T> {
|
||||
prefixCls?: string;
|
||||
className?: string;
|
||||
defaultChecked?: boolean;
|
||||
checked?: boolean;
|
||||
style?: React.CSSProperties;
|
||||
disabled?: boolean;
|
||||
onChange?: React.ChangeEventHandler<HTMLInputElement>;
|
||||
onChange?: (e: T) => void;
|
||||
onMouseEnter?: React.MouseEventHandler<any>;
|
||||
onMouseLeave?: React.MouseEventHandler<any>;
|
||||
onKeyPress?: React.KeyboardEventHandler<any>;
|
||||
onKeyDown?: React.KeyboardEventHandler<any>;
|
||||
value?: any;
|
||||
tabIndex?: number;
|
||||
name?: string;
|
||||
children?: React.ReactNode;
|
||||
}
|
||||
|
||||
export interface CheckboxProps extends AbstractCheckboxProps {
|
||||
export interface CheckboxProps extends AbstractCheckboxProps<CheckboxChangeEvent> {
|
||||
indeterminate?: boolean;
|
||||
}
|
||||
|
||||
export interface CheckboxChangeEventTarget extends CheckboxProps {
|
||||
checked: boolean;
|
||||
}
|
||||
|
||||
export interface CheckboxChangeEvent {
|
||||
target: CheckboxChangeEventTarget;
|
||||
stopPropagation: () => void;
|
||||
preventDefault: () => void;
|
||||
nativeEvent: MouseEvent;
|
||||
}
|
||||
|
||||
export default class Checkbox extends React.Component<CheckboxProps, {}> {
|
||||
static Group: typeof CheckboxGroup;
|
||||
static defaultProps = {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import Checkbox from './Checkbox';
|
||||
import Group from './Group';
|
||||
|
||||
export { CheckboxProps } from './Checkbox';
|
||||
export { CheckboxProps, CheckboxChangeEvent } from './Checkbox';
|
||||
export { CheckboxGroupProps, CheckboxOptionType } from './Group';
|
||||
|
||||
Checkbox.Group = Group;
|
||||
|
||||
@@ -6,7 +6,7 @@ import RcDatePicker from 'rc-calendar/lib/Picker';
|
||||
import classNames from 'classnames';
|
||||
import Icon from '../icon';
|
||||
import warning from '../_util/warning';
|
||||
import callMoment from '../_util/callMoment';
|
||||
import interopDefault from '../_util/interopDefault';
|
||||
import { RangePickerValue, RangePickerPresetRange } from './interface';
|
||||
|
||||
export interface RangePickerState {
|
||||
@@ -75,8 +75,8 @@ export default class RangePicker extends React.Component<any, RangePickerState>
|
||||
super(props);
|
||||
const value = props.value || props.defaultValue || [];
|
||||
if (
|
||||
value[0] && !moment.isMoment(value[0]) ||
|
||||
value[1] && !moment.isMoment(value[1])
|
||||
value[0] && !interopDefault(moment).isMoment(value[0]) ||
|
||||
value[1] && !interopDefault(moment).isMoment(value[1])
|
||||
) {
|
||||
throw new Error(
|
||||
'The value/defaultValue of RangePicker must be a moment object array after `antd@2.0`, ' +
|
||||
@@ -86,7 +86,7 @@ export default class RangePicker extends React.Component<any, RangePickerState>
|
||||
const pickerValue = !value || isEmptyArray(value) ? props.defaultPickerValue : value;
|
||||
this.state = {
|
||||
value,
|
||||
showDate: pickerValueAdapter(pickerValue || callMoment(moment)),
|
||||
showDate: pickerValueAdapter(pickerValue || interopDefault(moment)()),
|
||||
open: props.open,
|
||||
hoverValue: [],
|
||||
};
|
||||
@@ -157,6 +157,9 @@ export default class RangePicker extends React.Component<any, RangePickerState>
|
||||
}
|
||||
|
||||
handleCalendarInputSelect = (value: RangePickerValue) => {
|
||||
if (!value[0]) {
|
||||
return;
|
||||
}
|
||||
this.setState(({ showDate }) => ({
|
||||
value,
|
||||
showDate: getShowDateFromValue(value) || showDate,
|
||||
|
||||
@@ -4,6 +4,7 @@ import Calendar from 'rc-calendar';
|
||||
import RcDatePicker from 'rc-calendar/lib/Picker';
|
||||
import classNames from 'classnames';
|
||||
import Icon from '../icon';
|
||||
import interopDefault from '../_util/interopDefault';
|
||||
|
||||
function formatValue(value: moment.Moment | null, format: string): string {
|
||||
return (value && value.format(format)) || '';
|
||||
@@ -11,7 +12,7 @@ function formatValue(value: moment.Moment | null, format: string): string {
|
||||
|
||||
export default class WeekPicker extends React.Component<any, any> {
|
||||
static defaultProps = {
|
||||
format: 'YYYY-wo',
|
||||
format: 'gggg-wo',
|
||||
allowClear: true,
|
||||
};
|
||||
|
||||
@@ -20,7 +21,7 @@ export default class WeekPicker extends React.Component<any, any> {
|
||||
constructor(props: any) {
|
||||
super(props);
|
||||
const value = props.value || props.defaultValue;
|
||||
if (value && !moment.isMoment(value)) {
|
||||
if (value && !interopDefault(moment).isMoment(value)) {
|
||||
throw new Error(
|
||||
'The value/defaultValue of DatePicker or MonthPicker must be ' +
|
||||
'a moment object after `antd@2.0`, see: https://u.ant.design/date-picker-value',
|
||||
|
||||
@@ -17,7 +17,7 @@ describe('DatePicker', () => {
|
||||
focusTest(DatePicker);
|
||||
|
||||
beforeEach(() => {
|
||||
MockDate.set(new Date('2016-11-22').getTime() + (new Date().getTimezoneOffset() * 60 * 1000));
|
||||
MockDate.set(new Date('2016-11-22'));
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
|
||||
@@ -3,6 +3,7 @@ import { mount, render } from 'enzyme';
|
||||
import moment from 'moment';
|
||||
import DatePicker from '../';
|
||||
import { setMockDate, resetMockDate } from '../../../tests/utils';
|
||||
import { selectDate } from './utils';
|
||||
import focusTest from '../../../tests/shared/focusTest';
|
||||
|
||||
const { RangePicker } = DatePicker;
|
||||
@@ -202,4 +203,16 @@ describe('RangePicker', () => {
|
||||
wrapper.find('.ant-calendar-range-quick-selector a').simulate('click');
|
||||
expect(handleOk).toBeCalledWith(range);
|
||||
});
|
||||
|
||||
// https://github.com/ant-design/ant-design/issues/9267
|
||||
it('invali end date not throw error', () => {
|
||||
const wrapper = mount(<RangePicker />);
|
||||
wrapper.find('.ant-calendar-picker-input').simulate('click');
|
||||
selectDate(wrapper, moment('2017-09-18'), 0);
|
||||
selectDate(wrapper, moment('2017-10-18'), 1);
|
||||
wrapper.find('.ant-calendar-picker-input').simulate('click');
|
||||
expect(() =>
|
||||
wrapper.find('.ant-calendar-input').at(1).simulate('change', { target: { value: '2016-01-01' } })
|
||||
).not.toThrow();
|
||||
});
|
||||
});
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/* eslint-disable import/prefer-default-export */
|
||||
export function selectDate(wrapper, date, index) {
|
||||
let calendar = wrapper;
|
||||
if (index) {
|
||||
calendar = wrapper.find('.ant-calendar-range-part')[index];
|
||||
if (index !== undefined) {
|
||||
calendar = wrapper.find('.ant-calendar-range-part').at(index);
|
||||
}
|
||||
calendar.find({ title: date.format('LL'), role: 'gridcell' }).simulate('click');
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ import classNames from 'classnames';
|
||||
import omit from 'omit.js';
|
||||
import Icon from '../icon';
|
||||
import warning from '../_util/warning';
|
||||
import callMoment from '../_util/callMoment';
|
||||
import interopDefault from '../_util/interopDefault';
|
||||
|
||||
export interface PickerProps {
|
||||
value?: moment.Moment;
|
||||
@@ -26,7 +26,7 @@ export default function createPicker(TheCalendar: React.ComponentClass): any {
|
||||
constructor(props: any) {
|
||||
super(props);
|
||||
const value = props.value || props.defaultValue;
|
||||
if (value && !moment.isMoment(value)) {
|
||||
if (value && !interopDefault(moment).isMoment(value)) {
|
||||
throw new Error(
|
||||
'The value/defaultValue of DatePicker or MonthPicker must be ' +
|
||||
'a moment object after `antd@2.0`, see: https://u.ant.design/date-picker-value',
|
||||
@@ -132,7 +132,7 @@ export default function createPicker(TheCalendar: React.ComponentClass): any {
|
||||
disabledTime={disabledTime}
|
||||
locale={locale.lang}
|
||||
timePicker={props.timePicker}
|
||||
defaultValue={props.defaultPickerValue || callMoment(moment)}
|
||||
defaultValue={props.defaultPickerValue || interopDefault(moment)()}
|
||||
dateInputPlaceholder={placeholder}
|
||||
prefixCls={prefixCls}
|
||||
className={calendarClassName}
|
||||
|
||||
@@ -47,6 +47,7 @@ The following APIs are shared by DatePicker, MonthPicker, RangePicker, WeekPicke
|
||||
| open | open state of picker | boolean | - |
|
||||
| placeholder | placeholder of date input | string\|RangePicker\[] | - |
|
||||
| popupStyle | to customize the style of the popup calendar | object | {} |
|
||||
| dropdownClassName | to customize the className of the popup calendar | string | - |
|
||||
| size | determine the size of the input box, the height of `large` and `small`, are 40px and 24px respectively, while default size is 32px | string | - |
|
||||
| style | to customize the style of the input box | object | {} |
|
||||
| onOpenChange | a callback function, can be executed whether the popup calendar is popped up or closed | function(status) | - |
|
||||
|
||||
@@ -14,7 +14,7 @@ const MonthPicker = wrapPicker(createPicker(MonthCalendar), 'YYYY-MM');
|
||||
Object.assign(DatePicker, {
|
||||
RangePicker: wrapPicker(RangePicker),
|
||||
MonthPicker,
|
||||
WeekPicker: wrapPicker(WeekPicker, 'YYYY-wo'),
|
||||
WeekPicker: wrapPicker(WeekPicker, 'gggg-wo'),
|
||||
});
|
||||
|
||||
export default DatePicker as DatePickerDecorator;
|
||||
|
||||
@@ -47,7 +47,8 @@ subtitle: 日期选择框
|
||||
| locale | 国际化配置 | object | [默认配置](https://github.com/ant-design/ant-design/blob/master/components/date-picker/locale/example.json) |
|
||||
| open | 控制弹层是否展开 | boolean | - |
|
||||
| placeholder | 输入框提示文字 | string\|RangePicker\[] | - |
|
||||
| popupStyle | 格外的弹出日历样式 | object | {} |
|
||||
| popupStyle | 额外的弹出日历样式 | object | {} |
|
||||
| dropdownClassName | 额外的弹出日历 className | string | - |
|
||||
| size | 输入框大小,`large` 高度为 40px,`small` 为 24px,默认是 32px | string | 无 |
|
||||
| style | 自定义输入框样式 | object | {} |
|
||||
| onOpenChange | 弹出日历和关闭日历的回调 | function(status) | 无 |
|
||||
|
||||
@@ -12,6 +12,7 @@ export interface PickerProps {
|
||||
className?: string;
|
||||
style?: React.CSSProperties;
|
||||
popupStyle?: React.CSSProperties;
|
||||
dropdownClassName?: string;
|
||||
locale?: any;
|
||||
size?: 'large' | 'small' | 'default';
|
||||
getCalendarContainer?: (triggerNode: Element) => HTMLElement;
|
||||
@@ -78,7 +79,7 @@ export interface RangePickerProps extends PickerProps {
|
||||
onPanelChange?: (value?: RangePickerValue, mode?: string | string[]) => void;
|
||||
}
|
||||
|
||||
export interface WeexPickerProps extends PickerProps, SinglePickerProps {
|
||||
export interface WeekPickerProps extends PickerProps, SinglePickerProps {
|
||||
className?: string;
|
||||
placeholder?: string;
|
||||
}
|
||||
@@ -86,5 +87,5 @@ export interface WeexPickerProps extends PickerProps, SinglePickerProps {
|
||||
export interface DatePickerDecorator extends React.ClassicComponentClass<DatePickerProps> {
|
||||
RangePicker: React.ClassicComponentClass<RangePickerProps>;
|
||||
MonthPicker: React.ClassicComponentClass<MonthPickerProps>;
|
||||
WeekPicker: React.ClassicComponentClass<WeexPickerProps>;
|
||||
WeekPicker: React.ClassicComponentClass<WeekPickerProps>;
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import CalendarLocale from 'rc-calendar/lib/locale/en_US';
|
||||
import CalendarLocale from 'rc-calendar/lib/locale/tr_TR';
|
||||
import TimePickerLocale from '../../time-picker/locale/tr_TR';
|
||||
|
||||
// Merge into a locale object
|
||||
|
||||
@@ -126,7 +126,6 @@
|
||||
.@{calendar-prefix-cls}-footer {
|
||||
position: relative;
|
||||
height: auto;
|
||||
line-height: auto;
|
||||
|
||||
&-btn {
|
||||
text-align: right;
|
||||
|
||||
@@ -29,6 +29,30 @@ exports[`renders ./components/divider/demo/horizontal.md correctly 1`] = `
|
||||
<p>
|
||||
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed nonne merninisti licere mihi ista probare, quae sunt a te dicta? Refert tamen, quo modo.
|
||||
</p>
|
||||
<div
|
||||
class="ant-divider ant-divider-horizontal ant-divider-with-text-left"
|
||||
>
|
||||
<span
|
||||
class="ant-divider-inner-text"
|
||||
>
|
||||
With Text
|
||||
</span>
|
||||
</div>
|
||||
<p>
|
||||
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed nonne merninisti licere mihi ista probare, quae sunt a te dicta? Refert tamen, quo modo.
|
||||
</p>
|
||||
<div
|
||||
class="ant-divider ant-divider-horizontal ant-divider-with-text-right"
|
||||
>
|
||||
<span
|
||||
class="ant-divider-inner-text"
|
||||
>
|
||||
With Text
|
||||
</span>
|
||||
</div>
|
||||
<p>
|
||||
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed nonne merninisti licere mihi ista probare, quae sunt a te dicta? Refert tamen, quo modo.
|
||||
</p>
|
||||
</div>
|
||||
`;
|
||||
|
||||
|
||||
@@ -25,6 +25,10 @@ ReactDOM.render(
|
||||
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed nonne merninisti licere mihi ista probare, quae sunt a te dicta? Refert tamen, quo modo.</p>
|
||||
<Divider dashed />
|
||||
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed nonne merninisti licere mihi ista probare, quae sunt a te dicta? Refert tamen, quo modo.</p>
|
||||
<Divider orientation="left">With Text</Divider>
|
||||
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed nonne merninisti licere mihi ista probare, quae sunt a te dicta? Refert tamen, quo modo.</p>
|
||||
<Divider orientation="right">With Text</Divider>
|
||||
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed nonne merninisti licere mihi ista probare, quae sunt a te dicta? Refert tamen, quo modo.</p>
|
||||
</div>
|
||||
, mountNode);
|
||||
````
|
||||
|
||||
@@ -18,5 +18,6 @@ A divider line separates different content.
|
||||
|
||||
| Property | Description | Type | Default |
|
||||
| -------- | ----------- | ---- | ------- |
|
||||
| dashed | whether line is dasded | Boolean | false |
|
||||
| dashed | whether line is dashed | Boolean | false |
|
||||
| type | direction type of divider | enum: `horizontal` `vertical` | `horizontal` |
|
||||
| orientation | this is optional, if not set it will have the text in the center | enum: `left` `right` | `center` |
|
||||
|
||||
@@ -4,6 +4,7 @@ import classNames from 'classnames';
|
||||
export interface DividerProps {
|
||||
prefixCls?: string;
|
||||
type?: 'horizontal' | 'vertical';
|
||||
orientation?: 'left' | 'right';
|
||||
className?: string;
|
||||
children?: React.ReactNode;
|
||||
dashed?: boolean;
|
||||
@@ -13,14 +14,16 @@ export interface DividerProps {
|
||||
export default function Divider({
|
||||
prefixCls = 'ant',
|
||||
type = 'horizontal',
|
||||
orientation = '',
|
||||
className,
|
||||
children,
|
||||
dashed,
|
||||
...restProps,
|
||||
}: DividerProps) {
|
||||
const orientationPrefix = (orientation.length > 0) ? '-' + orientation : orientation;
|
||||
const classString = classNames(
|
||||
className, `${prefixCls}-divider`, `${prefixCls}-divider-${type}`, {
|
||||
[`${prefixCls}-divider-with-text`]: children,
|
||||
[`${prefixCls}-divider-with-text${orientationPrefix}`]: children,
|
||||
[`${prefixCls}-divider-dashed`]: !!dashed,
|
||||
});
|
||||
return (
|
||||
|
||||
@@ -44,17 +44,81 @@
|
||||
transform: translateY(50%);
|
||||
}
|
||||
}
|
||||
|
||||
&-inner-text {
|
||||
display: inline-block;
|
||||
padding: 0 24px;
|
||||
}
|
||||
&-horizontal&-with-text-left {
|
||||
display: table;
|
||||
white-space: nowrap;
|
||||
text-align: center;
|
||||
background: transparent;
|
||||
font-weight: 500;
|
||||
color: @heading-color;
|
||||
font-size: @font-size-base;
|
||||
margin: 16px 0;
|
||||
|
||||
&:before {
|
||||
content: '';
|
||||
display: table-cell;
|
||||
position: relative;
|
||||
top: 50%;
|
||||
width: 5%;
|
||||
border-top: 1px solid @border-color-split;
|
||||
transform: translateY(50%);
|
||||
}
|
||||
&:after {
|
||||
content: '';
|
||||
display: table-cell;
|
||||
position: relative;
|
||||
top: 50%;
|
||||
width: 95%;
|
||||
border-top: 1px solid @border-color-split;
|
||||
transform: translateY(50%);
|
||||
}
|
||||
&-inner-text {
|
||||
display: inline-block;
|
||||
padding: 0 10px;
|
||||
}
|
||||
}
|
||||
|
||||
&-horizontal&-with-text-right {
|
||||
display: table;
|
||||
white-space: nowrap;
|
||||
text-align: center;
|
||||
background: transparent;
|
||||
font-weight: 500;
|
||||
color: @heading-color;
|
||||
font-size: @font-size-base;
|
||||
margin: 16px 0;
|
||||
|
||||
&:before {
|
||||
content: '';
|
||||
display: table-cell;
|
||||
position: relative;
|
||||
top: 50%;
|
||||
width: 95%;
|
||||
border-top: 1px solid @border-color-split;
|
||||
transform: translateY(50%);
|
||||
}
|
||||
&:after {
|
||||
content: '';
|
||||
display: table-cell;
|
||||
position: relative;
|
||||
top: 50%;
|
||||
width: 5%;
|
||||
border-top: 1px solid @border-color-split;
|
||||
transform: translateY(50%);
|
||||
}
|
||||
&-inner-text {
|
||||
display: inline-block;
|
||||
padding: 0 10px;
|
||||
}
|
||||
}
|
||||
&-dashed {
|
||||
background: none;
|
||||
border-top: 1px dashed @border-color-split;
|
||||
}
|
||||
|
||||
&-horizontal&-with-text&-dashed {
|
||||
border-top: 0;
|
||||
&:before,
|
||||
|
||||
@@ -54,6 +54,7 @@
|
||||
|
||||
&-submenu-popup {
|
||||
position: absolute;
|
||||
z-index: @zindex-dropdown;
|
||||
}
|
||||
|
||||
&-item,
|
||||
|
||||
@@ -117,10 +117,10 @@ export type Diff<T extends string, U extends string> =
|
||||
({ [P in T]: P } & { [P in U]: never } & { [x: string]: never })[T];
|
||||
export type Omit<T, K extends keyof T> = Pick<T, Diff<keyof T, K>>;
|
||||
|
||||
export interface ComponentDecorator<TOwnProps> {
|
||||
export interface ComponentDecorator {
|
||||
<P extends FormComponentProps>(
|
||||
component: React.ComponentClass<P> | React.SFC<P>,
|
||||
): React.ComponentClass<Omit<P, keyof FormComponentProps> & TOwnProps>;
|
||||
): React.ComponentClass<Omit<P, keyof FormComponentProps>>;
|
||||
}
|
||||
|
||||
export default class Form extends React.Component<FormProps, any> {
|
||||
@@ -149,7 +149,7 @@ export default class Form extends React.Component<FormProps, any> {
|
||||
|
||||
static createFormField = createFormField;
|
||||
|
||||
static create = function<TOwnProps>(options: FormCreateOption<TOwnProps> = {}): ComponentDecorator<TOwnProps> {
|
||||
static create = function<TOwnProps>(options: FormCreateOption<TOwnProps> = {}): ComponentDecorator {
|
||||
return createDOMForm({
|
||||
fieldNameProp: 'id',
|
||||
...options,
|
||||
|
||||
@@ -186,7 +186,8 @@ export default class FormItem extends React.Component<FormItemProps, any> {
|
||||
}
|
||||
return (
|
||||
<div className={classes}>
|
||||
{c1}{c2}{c3}
|
||||
<span className={`${this.props.prefixCls}-item-children`}>{c1}</span>
|
||||
{c2}{c3}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,6 +1,6 @@
|
||||
/* tslint:disable */
|
||||
import * as React from 'react';
|
||||
import Form, { FormComponentProps } from '../Form';
|
||||
import Form, { FormComponentProps, FormCreateOption } from '../Form';
|
||||
|
||||
// test Form.create on component without own props
|
||||
class WithoutOwnProps extends React.Component<any, any> {
|
||||
@@ -34,3 +34,28 @@ class WithOwnProps extends React.Component<WithOwnPropsProps, any> {
|
||||
const WithOwnPropsForm = Form.create()(WithOwnProps);
|
||||
|
||||
<WithOwnPropsForm name="foo" />;
|
||||
|
||||
// test Form.create with options
|
||||
interface WithCreateOptionsProps extends FormComponentProps {
|
||||
username: string;
|
||||
}
|
||||
|
||||
class WithCreateOptions extends React.Component<WithCreateOptionsProps, {}> {
|
||||
render() {
|
||||
return <div>foo</div>;
|
||||
}
|
||||
}
|
||||
|
||||
const mapPropsToFields = (props: WithCreateOptionsProps) => {
|
||||
const { username } = props;
|
||||
|
||||
return {
|
||||
username: Form.createFormField({ value: username })
|
||||
};
|
||||
};
|
||||
|
||||
const formOptions: FormCreateOption<WithCreateOptionsProps> = { mapPropsToFields };
|
||||
|
||||
const WithCreateOptionsForm = Form.create(formOptions)(WithCreateOptions);
|
||||
|
||||
<WithCreateOptionsForm username="foo" />
|
||||
|
||||
@@ -60,7 +60,7 @@ class RegistrationForm extends React.Component {
|
||||
const value = e.target.value;
|
||||
this.setState({ confirmDirty: this.state.confirmDirty || !!value });
|
||||
}
|
||||
checkPassword = (rule, value, callback) => {
|
||||
compareToFirstPassword = (rule, value, callback) => {
|
||||
const form = this.props.form;
|
||||
if (value && value !== form.getFieldValue('password')) {
|
||||
callback('Two passwords that you enter is inconsistent!');
|
||||
@@ -68,14 +68,13 @@ class RegistrationForm extends React.Component {
|
||||
callback();
|
||||
}
|
||||
}
|
||||
checkConfirm = (rule, value, callback) => {
|
||||
validateToNextPassword = (rule, value, callback) => {
|
||||
const form = this.props.form;
|
||||
if (value && this.state.confirmDirty) {
|
||||
form.validateFields(['confirm'], { force: true });
|
||||
}
|
||||
callback();
|
||||
}
|
||||
|
||||
handleWebsiteChange = (value) => {
|
||||
let autoCompleteResult;
|
||||
if (!value) {
|
||||
@@ -85,7 +84,6 @@ class RegistrationForm extends React.Component {
|
||||
}
|
||||
this.setState({ autoCompleteResult });
|
||||
}
|
||||
|
||||
render() {
|
||||
const { getFieldDecorator } = this.props.form;
|
||||
const { autoCompleteResult } = this.state;
|
||||
@@ -149,7 +147,7 @@ class RegistrationForm extends React.Component {
|
||||
rules: [{
|
||||
required: true, message: 'Please input your password!',
|
||||
}, {
|
||||
validator: this.checkConfirm,
|
||||
validator: this.validateToNextPassword,
|
||||
}],
|
||||
})(
|
||||
<Input type="password" />
|
||||
@@ -163,7 +161,7 @@ class RegistrationForm extends React.Component {
|
||||
rules: [{
|
||||
required: true, message: 'Please confirm your password!',
|
||||
}, {
|
||||
validator: this.checkPassword,
|
||||
validator: this.compareToFirstPassword,
|
||||
}],
|
||||
})(
|
||||
<Input type="password" onBlur={this.handleConfirmBlur} />
|
||||
|
||||
@@ -87,6 +87,10 @@ input[type="checkbox"] {
|
||||
.clearfix;
|
||||
}
|
||||
|
||||
&-children {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
&-with-help {
|
||||
margin-bottom: @form-item-margin-bottom - @font-size-base * @line-height-base - @form-help-margin-top;
|
||||
transition: none;
|
||||
@@ -233,8 +237,8 @@ form {
|
||||
margin-left: 0;
|
||||
}
|
||||
|
||||
.@{ant-prefix}-input-number {
|
||||
margin-right: 8px;
|
||||
.@{ant-prefix}-input-number + .@{form-prefix-cls}-text {
|
||||
margin-left: 8px;
|
||||
}
|
||||
|
||||
.@{ant-prefix}-select,
|
||||
@@ -396,15 +400,16 @@ form {
|
||||
.has-warning,
|
||||
.has-error,
|
||||
.is-validating {
|
||||
&.has-feedback:after {
|
||||
&.has-feedback .@{form-prefix-cls}-item-children:after {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
top: 50%;
|
||||
right: 0;
|
||||
visibility: visible;
|
||||
pointer-events: none;
|
||||
width: @form-component-height;
|
||||
height: @form-component-max-height;
|
||||
line-height: @form-component-max-height;
|
||||
height: 20px;
|
||||
line-height: 20px;
|
||||
margin-top: -10px;
|
||||
text-align: center;
|
||||
font-size: @form-feedback-icon-size;
|
||||
animation: zoomIn .3s @ease-out-back;
|
||||
@@ -414,7 +419,7 @@ form {
|
||||
}
|
||||
|
||||
.has-success {
|
||||
&.has-feedback:after {
|
||||
&.has-feedback .@{form-prefix-cls}-item-children:after {
|
||||
animation-name: diffZoomIn1 !important;
|
||||
content: '\e630';
|
||||
color: @success-color;
|
||||
@@ -424,7 +429,7 @@ form {
|
||||
.has-warning {
|
||||
.form-control-validation(@warning-color; @warning-color;);
|
||||
|
||||
&.has-feedback:after {
|
||||
&.has-feedback .@{form-prefix-cls}-item-children:after {
|
||||
content: '\e62c';
|
||||
color: @warning-color;
|
||||
animation-name: diffZoomIn3 !important;
|
||||
@@ -471,7 +476,7 @@ form {
|
||||
.has-error {
|
||||
.form-control-validation(@error-color; @error-color;);
|
||||
|
||||
&.has-feedback:after {
|
||||
&.has-feedback .@{form-prefix-cls}-item-children:after {
|
||||
content: '\e62e';
|
||||
color: @error-color;
|
||||
animation-name: diffZoomIn2 !important;
|
||||
@@ -541,7 +546,7 @@ form {
|
||||
}
|
||||
|
||||
.is-validating {
|
||||
&.has-feedback:after {
|
||||
&.has-feedback .@{form-prefix-cls}-item-children:after {
|
||||
display: inline-block;
|
||||
animation: loadingCircle 1s infinite linear;
|
||||
content: "\e64d";
|
||||
|
||||
@@ -480,7 +480,7 @@ exports[`renders ./components/grid/demo/playground.md correctly 1`] = `
|
||||
/>
|
||||
<div
|
||||
class="ant-slider-track"
|
||||
style="visibility:visible;left:0%;width:20%"
|
||||
style="left:0%;width:20%"
|
||||
/>
|
||||
<div
|
||||
class="ant-slider-step"
|
||||
@@ -578,7 +578,7 @@ exports[`renders ./components/grid/demo/playground.md correctly 1`] = `
|
||||
/>
|
||||
<div
|
||||
class="ant-slider-track"
|
||||
style="visibility:visible;left:0%;width:40%"
|
||||
style="left:0%;width:40%"
|
||||
/>
|
||||
<div
|
||||
class="ant-slider-step"
|
||||
|
||||
@@ -13,8 +13,7 @@ export interface ColSize {
|
||||
pull?: number;
|
||||
}
|
||||
|
||||
export interface ColProps {
|
||||
className?: string;
|
||||
export interface ColProps extends React.HTMLAttributes<HTMLDivElement> {
|
||||
span?: number;
|
||||
order?: number;
|
||||
offset?: number;
|
||||
@@ -27,7 +26,6 @@ export interface ColProps {
|
||||
xl?: number | ColSize;
|
||||
xxl?: number | ColSize;
|
||||
prefixCls?: string;
|
||||
style?: React.CSSProperties;
|
||||
}
|
||||
|
||||
export default class Col extends React.Component<ColProps, {}> {
|
||||
|
||||
@@ -31,13 +31,11 @@ export type BreakpointMap = {
|
||||
xxl?: string
|
||||
};
|
||||
|
||||
export interface RowProps {
|
||||
className?: string;
|
||||
export interface RowProps extends React.HTMLAttributes<HTMLDivElement> {
|
||||
gutter?: number | BreakpointMap;
|
||||
type?: 'flex';
|
||||
align?: 'top' | 'middle' | 'bottom';
|
||||
justify?: 'start' | 'end' | 'center' | 'space-around' | 'space-between';
|
||||
style?: React.CSSProperties;
|
||||
prefixCls?: string;
|
||||
}
|
||||
|
||||
|
||||
@@ -177,7 +177,7 @@ exports[`renders ./components/input/demo/group.md correctly 1`] = `
|
||||
class="ant-input-group ant-input-group-lg"
|
||||
>
|
||||
<div
|
||||
class="ant-col-4"
|
||||
class="ant-col-5"
|
||||
>
|
||||
<input
|
||||
class="ant-input"
|
||||
|
||||
@@ -63,7 +63,7 @@ class CompactDemo extends React.Component {
|
||||
return (
|
||||
<div>
|
||||
<InputGroup size="large">
|
||||
<Col span={4}>
|
||||
<Col span={5}>
|
||||
<Input defaultValue="0571" />
|
||||
</Col>
|
||||
<Col span={8}>
|
||||
|
||||
@@ -31,10 +31,8 @@ const dimensionMap = {
|
||||
|
||||
export type CollapseType = 'clickTrigger' | 'responsive';
|
||||
|
||||
export interface SiderProps {
|
||||
style?: React.CSSProperties;
|
||||
export interface SiderProps extends React.HTMLAttributes<HTMLDivElement> {
|
||||
prefixCls?: string;
|
||||
className?: string;
|
||||
collapsible?: boolean;
|
||||
collapsed?: boolean;
|
||||
defaultCollapsed?: boolean;
|
||||
@@ -212,7 +210,7 @@ export default class Sider extends React.Component<SiderProps, SliderState> {
|
||||
};
|
||||
const siderCls = classNames(className, prefixCls, {
|
||||
[`${prefixCls}-collapsed`]: !!this.state.collapsed,
|
||||
[`${prefixCls}-has-trigger`]: !!trigger,
|
||||
[`${prefixCls}-has-trigger`]: collapsible && trigger !== null && !zeroWidthTrigger,
|
||||
[`${prefixCls}-below`]: !!this.state.below,
|
||||
[`${prefixCls}-zero-width`]: siderWidth === 0 || siderWidth === '0' || siderWidth === '0px',
|
||||
});
|
||||
|
||||
@@ -688,7 +688,7 @@ exports[`renders ./components/layout/demo/side.md correctly 1`] = `
|
||||
style="min-height:100vh"
|
||||
>
|
||||
<div
|
||||
class="ant-layout-sider"
|
||||
class="ant-layout-sider ant-layout-sider-has-trigger"
|
||||
style="flex:0 0 200px;max-width:200px;min-width:200px;width:200px"
|
||||
>
|
||||
<div
|
||||
|
||||
@@ -24,4 +24,14 @@ describe('Layout', () => {
|
||||
);
|
||||
expect(wrapper.find('.ant-layout').hasClass('ant-layout-has-sider')).toBe(true);
|
||||
});
|
||||
|
||||
it('detect ant-layout-sider-has-trigger class in sider when ant-layout-sider-trigger div tag exists', async () => {
|
||||
const wrapper = mount(
|
||||
<Layout>
|
||||
<div><Sider collapsible>Sider</Sider></div>
|
||||
<Content>Content</Content>
|
||||
</Layout>
|
||||
);
|
||||
expect(wrapper.find('.ant-layout-sider').hasClass('ant-layout-sider-has-trigger')).toBe(true);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -27,7 +27,7 @@ The first level navigation is inclined left near a logo, and the secondary menu
|
||||
|
||||
## Visualization rules
|
||||
|
||||
Style of a navigation should conform to the its level.
|
||||
Style of a navigation should conform to its level.
|
||||
|
||||
- **Emphasis by colorblock**
|
||||
|
||||
@@ -43,7 +43,7 @@ The first level navigation is inclined left near a logo, and the secondary menu
|
||||
|
||||
- **Enlarge the size of the font**
|
||||
|
||||
`12px`、`14px` is a standard font size of navigations,`14px` is used for the first and the second level of the navigation. You can choose a approprigate font size in terms of the level of your navigation.
|
||||
`12px`、`14px` is a standard font size of navigations,`14px` is used for the first and the second level of the navigation. You can choose a appropriate font size in terms of the level of your navigation.
|
||||
|
||||
## Component Overview
|
||||
|
||||
|
||||
@@ -3,10 +3,8 @@ import PropTypes from 'prop-types';
|
||||
import classNames from 'classnames';
|
||||
import { SiderProps } from './Sider';
|
||||
|
||||
export interface BasicProps {
|
||||
style?: React.CSSProperties;
|
||||
export interface BasicProps extends React.HTMLAttributes<HTMLDivElement> {
|
||||
prefixCls?: string;
|
||||
className?: string;
|
||||
hasSider?: boolean;
|
||||
}
|
||||
|
||||
|
||||
@@ -364,7 +364,7 @@ exports[`renders ./components/list/demo/infinite-virtualized-load.md correctly 1
|
||||
class="ant-spin"
|
||||
>
|
||||
<span
|
||||
class="ant-spin-dot"
|
||||
class="ant-spin-dot ant-spin-dot-spin"
|
||||
>
|
||||
<i />
|
||||
<i />
|
||||
@@ -389,7 +389,7 @@ exports[`renders ./components/list/demo/loadmore.md correctly 1`] = `
|
||||
class="ant-spin ant-spin-spinning"
|
||||
>
|
||||
<span
|
||||
class="ant-spin-dot"
|
||||
class="ant-spin-dot ant-spin-dot-spin"
|
||||
>
|
||||
<i />
|
||||
<i />
|
||||
|
||||
@@ -1506,7 +1506,7 @@ exports[`renders ./components/locale-provider/demo/all.md correctly 1`] = `
|
||||
>
|
||||
<tr>
|
||||
<th
|
||||
class=""
|
||||
class="ant-table-column-has-filters"
|
||||
>
|
||||
<span>
|
||||
Name
|
||||
|
||||
@@ -5703,6 +5703,7 @@ exports[`Locale Provider should display the text as ar 1`] = `
|
||||
<input
|
||||
class="ant-checkbox-input"
|
||||
type="checkbox"
|
||||
value="on"
|
||||
/>
|
||||
<span
|
||||
class="ant-checkbox-inner"
|
||||
@@ -5789,6 +5790,7 @@ exports[`Locale Provider should display the text as ar 1`] = `
|
||||
<input
|
||||
class="ant-checkbox-input"
|
||||
type="checkbox"
|
||||
value="on"
|
||||
/>
|
||||
<span
|
||||
class="ant-checkbox-inner"
|
||||
@@ -6869,7 +6871,7 @@ exports[`Locale Provider should display the text as ar 1`] = `
|
||||
>
|
||||
<tr>
|
||||
<th
|
||||
class=""
|
||||
class="ant-table-column-has-filters"
|
||||
>
|
||||
<span>
|
||||
Name
|
||||
@@ -10299,6 +10301,7 @@ exports[`Locale Provider should display the text as bg 1`] = `
|
||||
<input
|
||||
class="ant-checkbox-input"
|
||||
type="checkbox"
|
||||
value="on"
|
||||
/>
|
||||
<span
|
||||
class="ant-checkbox-inner"
|
||||
@@ -10385,6 +10388,7 @@ exports[`Locale Provider should display the text as bg 1`] = `
|
||||
<input
|
||||
class="ant-checkbox-input"
|
||||
type="checkbox"
|
||||
value="on"
|
||||
/>
|
||||
<span
|
||||
class="ant-checkbox-inner"
|
||||
@@ -11465,7 +11469,7 @@ exports[`Locale Provider should display the text as bg 1`] = `
|
||||
>
|
||||
<tr>
|
||||
<th
|
||||
class=""
|
||||
class="ant-table-column-has-filters"
|
||||
>
|
||||
<span>
|
||||
Name
|
||||
@@ -14895,6 +14899,7 @@ exports[`Locale Provider should display the text as ca 1`] = `
|
||||
<input
|
||||
class="ant-checkbox-input"
|
||||
type="checkbox"
|
||||
value="on"
|
||||
/>
|
||||
<span
|
||||
class="ant-checkbox-inner"
|
||||
@@ -14981,6 +14986,7 @@ exports[`Locale Provider should display the text as ca 1`] = `
|
||||
<input
|
||||
class="ant-checkbox-input"
|
||||
type="checkbox"
|
||||
value="on"
|
||||
/>
|
||||
<span
|
||||
class="ant-checkbox-inner"
|
||||
@@ -16061,7 +16067,7 @@ exports[`Locale Provider should display the text as ca 1`] = `
|
||||
>
|
||||
<tr>
|
||||
<th
|
||||
class=""
|
||||
class="ant-table-column-has-filters"
|
||||
>
|
||||
<span>
|
||||
Name
|
||||
@@ -19491,6 +19497,7 @@ exports[`Locale Provider should display the text as cs 1`] = `
|
||||
<input
|
||||
class="ant-checkbox-input"
|
||||
type="checkbox"
|
||||
value="on"
|
||||
/>
|
||||
<span
|
||||
class="ant-checkbox-inner"
|
||||
@@ -19577,6 +19584,7 @@ exports[`Locale Provider should display the text as cs 1`] = `
|
||||
<input
|
||||
class="ant-checkbox-input"
|
||||
type="checkbox"
|
||||
value="on"
|
||||
/>
|
||||
<span
|
||||
class="ant-checkbox-inner"
|
||||
@@ -20657,7 +20665,7 @@ exports[`Locale Provider should display the text as cs 1`] = `
|
||||
>
|
||||
<tr>
|
||||
<th
|
||||
class=""
|
||||
class="ant-table-column-has-filters"
|
||||
>
|
||||
<span>
|
||||
Name
|
||||
@@ -24087,6 +24095,7 @@ exports[`Locale Provider should display the text as de 1`] = `
|
||||
<input
|
||||
class="ant-checkbox-input"
|
||||
type="checkbox"
|
||||
value="on"
|
||||
/>
|
||||
<span
|
||||
class="ant-checkbox-inner"
|
||||
@@ -24173,6 +24182,7 @@ exports[`Locale Provider should display the text as de 1`] = `
|
||||
<input
|
||||
class="ant-checkbox-input"
|
||||
type="checkbox"
|
||||
value="on"
|
||||
/>
|
||||
<span
|
||||
class="ant-checkbox-inner"
|
||||
@@ -25253,7 +25263,7 @@ exports[`Locale Provider should display the text as de 1`] = `
|
||||
>
|
||||
<tr>
|
||||
<th
|
||||
class=""
|
||||
class="ant-table-column-has-filters"
|
||||
>
|
||||
<span>
|
||||
Name
|
||||
@@ -28683,6 +28693,7 @@ exports[`Locale Provider should display the text as el 1`] = `
|
||||
<input
|
||||
class="ant-checkbox-input"
|
||||
type="checkbox"
|
||||
value="on"
|
||||
/>
|
||||
<span
|
||||
class="ant-checkbox-inner"
|
||||
@@ -28769,6 +28780,7 @@ exports[`Locale Provider should display the text as el 1`] = `
|
||||
<input
|
||||
class="ant-checkbox-input"
|
||||
type="checkbox"
|
||||
value="on"
|
||||
/>
|
||||
<span
|
||||
class="ant-checkbox-inner"
|
||||
@@ -29849,7 +29861,7 @@ exports[`Locale Provider should display the text as el 1`] = `
|
||||
>
|
||||
<tr>
|
||||
<th
|
||||
class=""
|
||||
class="ant-table-column-has-filters"
|
||||
>
|
||||
<span>
|
||||
Name
|
||||
@@ -33279,6 +33291,7 @@ exports[`Locale Provider should display the text as en 1`] = `
|
||||
<input
|
||||
class="ant-checkbox-input"
|
||||
type="checkbox"
|
||||
value="on"
|
||||
/>
|
||||
<span
|
||||
class="ant-checkbox-inner"
|
||||
@@ -33365,6 +33378,7 @@ exports[`Locale Provider should display the text as en 1`] = `
|
||||
<input
|
||||
class="ant-checkbox-input"
|
||||
type="checkbox"
|
||||
value="on"
|
||||
/>
|
||||
<span
|
||||
class="ant-checkbox-inner"
|
||||
@@ -34445,7 +34459,7 @@ exports[`Locale Provider should display the text as en 1`] = `
|
||||
>
|
||||
<tr>
|
||||
<th
|
||||
class=""
|
||||
class="ant-table-column-has-filters"
|
||||
>
|
||||
<span>
|
||||
Name
|
||||
@@ -37875,6 +37889,7 @@ exports[`Locale Provider should display the text as en-gb 1`] = `
|
||||
<input
|
||||
class="ant-checkbox-input"
|
||||
type="checkbox"
|
||||
value="on"
|
||||
/>
|
||||
<span
|
||||
class="ant-checkbox-inner"
|
||||
@@ -37961,6 +37976,7 @@ exports[`Locale Provider should display the text as en-gb 1`] = `
|
||||
<input
|
||||
class="ant-checkbox-input"
|
||||
type="checkbox"
|
||||
value="on"
|
||||
/>
|
||||
<span
|
||||
class="ant-checkbox-inner"
|
||||
@@ -39041,7 +39057,7 @@ exports[`Locale Provider should display the text as en-gb 1`] = `
|
||||
>
|
||||
<tr>
|
||||
<th
|
||||
class=""
|
||||
class="ant-table-column-has-filters"
|
||||
>
|
||||
<span>
|
||||
Name
|
||||
@@ -42471,6 +42487,7 @@ exports[`Locale Provider should display the text as es 1`] = `
|
||||
<input
|
||||
class="ant-checkbox-input"
|
||||
type="checkbox"
|
||||
value="on"
|
||||
/>
|
||||
<span
|
||||
class="ant-checkbox-inner"
|
||||
@@ -42557,6 +42574,7 @@ exports[`Locale Provider should display the text as es 1`] = `
|
||||
<input
|
||||
class="ant-checkbox-input"
|
||||
type="checkbox"
|
||||
value="on"
|
||||
/>
|
||||
<span
|
||||
class="ant-checkbox-inner"
|
||||
@@ -43637,7 +43655,7 @@ exports[`Locale Provider should display the text as es 1`] = `
|
||||
>
|
||||
<tr>
|
||||
<th
|
||||
class=""
|
||||
class="ant-table-column-has-filters"
|
||||
>
|
||||
<span>
|
||||
Name
|
||||
@@ -47067,6 +47085,7 @@ exports[`Locale Provider should display the text as et 1`] = `
|
||||
<input
|
||||
class="ant-checkbox-input"
|
||||
type="checkbox"
|
||||
value="on"
|
||||
/>
|
||||
<span
|
||||
class="ant-checkbox-inner"
|
||||
@@ -47153,6 +47172,7 @@ exports[`Locale Provider should display the text as et 1`] = `
|
||||
<input
|
||||
class="ant-checkbox-input"
|
||||
type="checkbox"
|
||||
value="on"
|
||||
/>
|
||||
<span
|
||||
class="ant-checkbox-inner"
|
||||
@@ -48233,7 +48253,7 @@ exports[`Locale Provider should display the text as et 1`] = `
|
||||
>
|
||||
<tr>
|
||||
<th
|
||||
class=""
|
||||
class="ant-table-column-has-filters"
|
||||
>
|
||||
<span>
|
||||
Name
|
||||
@@ -51663,6 +51683,7 @@ exports[`Locale Provider should display the text as fa 1`] = `
|
||||
<input
|
||||
class="ant-checkbox-input"
|
||||
type="checkbox"
|
||||
value="on"
|
||||
/>
|
||||
<span
|
||||
class="ant-checkbox-inner"
|
||||
@@ -51749,6 +51770,7 @@ exports[`Locale Provider should display the text as fa 1`] = `
|
||||
<input
|
||||
class="ant-checkbox-input"
|
||||
type="checkbox"
|
||||
value="on"
|
||||
/>
|
||||
<span
|
||||
class="ant-checkbox-inner"
|
||||
@@ -52829,7 +52851,7 @@ exports[`Locale Provider should display the text as fa 1`] = `
|
||||
>
|
||||
<tr>
|
||||
<th
|
||||
class=""
|
||||
class="ant-table-column-has-filters"
|
||||
>
|
||||
<span>
|
||||
Name
|
||||
@@ -56259,6 +56281,7 @@ exports[`Locale Provider should display the text as fi 1`] = `
|
||||
<input
|
||||
class="ant-checkbox-input"
|
||||
type="checkbox"
|
||||
value="on"
|
||||
/>
|
||||
<span
|
||||
class="ant-checkbox-inner"
|
||||
@@ -56345,6 +56368,7 @@ exports[`Locale Provider should display the text as fi 1`] = `
|
||||
<input
|
||||
class="ant-checkbox-input"
|
||||
type="checkbox"
|
||||
value="on"
|
||||
/>
|
||||
<span
|
||||
class="ant-checkbox-inner"
|
||||
@@ -57425,7 +57449,7 @@ exports[`Locale Provider should display the text as fi 1`] = `
|
||||
>
|
||||
<tr>
|
||||
<th
|
||||
class=""
|
||||
class="ant-table-column-has-filters"
|
||||
>
|
||||
<span>
|
||||
Name
|
||||
@@ -60855,6 +60879,7 @@ exports[`Locale Provider should display the text as fr 1`] = `
|
||||
<input
|
||||
class="ant-checkbox-input"
|
||||
type="checkbox"
|
||||
value="on"
|
||||
/>
|
||||
<span
|
||||
class="ant-checkbox-inner"
|
||||
@@ -60941,6 +60966,7 @@ exports[`Locale Provider should display the text as fr 1`] = `
|
||||
<input
|
||||
class="ant-checkbox-input"
|
||||
type="checkbox"
|
||||
value="on"
|
||||
/>
|
||||
<span
|
||||
class="ant-checkbox-inner"
|
||||
@@ -62021,7 +62047,7 @@ exports[`Locale Provider should display the text as fr 1`] = `
|
||||
>
|
||||
<tr>
|
||||
<th
|
||||
class=""
|
||||
class="ant-table-column-has-filters"
|
||||
>
|
||||
<span>
|
||||
Name
|
||||
@@ -65451,6 +65477,7 @@ exports[`Locale Provider should display the text as fr 2`] = `
|
||||
<input
|
||||
class="ant-checkbox-input"
|
||||
type="checkbox"
|
||||
value="on"
|
||||
/>
|
||||
<span
|
||||
class="ant-checkbox-inner"
|
||||
@@ -65537,6 +65564,7 @@ exports[`Locale Provider should display the text as fr 2`] = `
|
||||
<input
|
||||
class="ant-checkbox-input"
|
||||
type="checkbox"
|
||||
value="on"
|
||||
/>
|
||||
<span
|
||||
class="ant-checkbox-inner"
|
||||
@@ -66617,7 +66645,7 @@ exports[`Locale Provider should display the text as fr 2`] = `
|
||||
>
|
||||
<tr>
|
||||
<th
|
||||
class=""
|
||||
class="ant-table-column-has-filters"
|
||||
>
|
||||
<span>
|
||||
Name
|
||||
@@ -70047,6 +70075,7 @@ exports[`Locale Provider should display the text as is 1`] = `
|
||||
<input
|
||||
class="ant-checkbox-input"
|
||||
type="checkbox"
|
||||
value="on"
|
||||
/>
|
||||
<span
|
||||
class="ant-checkbox-inner"
|
||||
@@ -70133,6 +70162,7 @@ exports[`Locale Provider should display the text as is 1`] = `
|
||||
<input
|
||||
class="ant-checkbox-input"
|
||||
type="checkbox"
|
||||
value="on"
|
||||
/>
|
||||
<span
|
||||
class="ant-checkbox-inner"
|
||||
@@ -71213,7 +71243,7 @@ exports[`Locale Provider should display the text as is 1`] = `
|
||||
>
|
||||
<tr>
|
||||
<th
|
||||
class=""
|
||||
class="ant-table-column-has-filters"
|
||||
>
|
||||
<span>
|
||||
Name
|
||||
@@ -74643,6 +74673,7 @@ exports[`Locale Provider should display the text as it 1`] = `
|
||||
<input
|
||||
class="ant-checkbox-input"
|
||||
type="checkbox"
|
||||
value="on"
|
||||
/>
|
||||
<span
|
||||
class="ant-checkbox-inner"
|
||||
@@ -74729,6 +74760,7 @@ exports[`Locale Provider should display the text as it 1`] = `
|
||||
<input
|
||||
class="ant-checkbox-input"
|
||||
type="checkbox"
|
||||
value="on"
|
||||
/>
|
||||
<span
|
||||
class="ant-checkbox-inner"
|
||||
@@ -75809,7 +75841,7 @@ exports[`Locale Provider should display the text as it 1`] = `
|
||||
>
|
||||
<tr>
|
||||
<th
|
||||
class=""
|
||||
class="ant-table-column-has-filters"
|
||||
>
|
||||
<span>
|
||||
Name
|
||||
@@ -79239,6 +79271,7 @@ exports[`Locale Provider should display the text as ja 1`] = `
|
||||
<input
|
||||
class="ant-checkbox-input"
|
||||
type="checkbox"
|
||||
value="on"
|
||||
/>
|
||||
<span
|
||||
class="ant-checkbox-inner"
|
||||
@@ -79325,6 +79358,7 @@ exports[`Locale Provider should display the text as ja 1`] = `
|
||||
<input
|
||||
class="ant-checkbox-input"
|
||||
type="checkbox"
|
||||
value="on"
|
||||
/>
|
||||
<span
|
||||
class="ant-checkbox-inner"
|
||||
@@ -80405,7 +80439,7 @@ exports[`Locale Provider should display the text as ja 1`] = `
|
||||
>
|
||||
<tr>
|
||||
<th
|
||||
class=""
|
||||
class="ant-table-column-has-filters"
|
||||
>
|
||||
<span>
|
||||
Name
|
||||
@@ -83835,6 +83869,7 @@ exports[`Locale Provider should display the text as ko 1`] = `
|
||||
<input
|
||||
class="ant-checkbox-input"
|
||||
type="checkbox"
|
||||
value="on"
|
||||
/>
|
||||
<span
|
||||
class="ant-checkbox-inner"
|
||||
@@ -83921,6 +83956,7 @@ exports[`Locale Provider should display the text as ko 1`] = `
|
||||
<input
|
||||
class="ant-checkbox-input"
|
||||
type="checkbox"
|
||||
value="on"
|
||||
/>
|
||||
<span
|
||||
class="ant-checkbox-inner"
|
||||
@@ -85001,7 +85037,7 @@ exports[`Locale Provider should display the text as ko 1`] = `
|
||||
>
|
||||
<tr>
|
||||
<th
|
||||
class=""
|
||||
class="ant-table-column-has-filters"
|
||||
>
|
||||
<span>
|
||||
Name
|
||||
@@ -88431,6 +88467,7 @@ exports[`Locale Provider should display the text as ku-iq 1`] = `
|
||||
<input
|
||||
class="ant-checkbox-input"
|
||||
type="checkbox"
|
||||
value="on"
|
||||
/>
|
||||
<span
|
||||
class="ant-checkbox-inner"
|
||||
@@ -88517,6 +88554,7 @@ exports[`Locale Provider should display the text as ku-iq 1`] = `
|
||||
<input
|
||||
class="ant-checkbox-input"
|
||||
type="checkbox"
|
||||
value="on"
|
||||
/>
|
||||
<span
|
||||
class="ant-checkbox-inner"
|
||||
@@ -89597,7 +89635,7 @@ exports[`Locale Provider should display the text as ku-iq 1`] = `
|
||||
>
|
||||
<tr>
|
||||
<th
|
||||
class=""
|
||||
class="ant-table-column-has-filters"
|
||||
>
|
||||
<span>
|
||||
Name
|
||||
@@ -93027,6 +93065,7 @@ exports[`Locale Provider should display the text as nb 1`] = `
|
||||
<input
|
||||
class="ant-checkbox-input"
|
||||
type="checkbox"
|
||||
value="on"
|
||||
/>
|
||||
<span
|
||||
class="ant-checkbox-inner"
|
||||
@@ -93113,6 +93152,7 @@ exports[`Locale Provider should display the text as nb 1`] = `
|
||||
<input
|
||||
class="ant-checkbox-input"
|
||||
type="checkbox"
|
||||
value="on"
|
||||
/>
|
||||
<span
|
||||
class="ant-checkbox-inner"
|
||||
@@ -94193,7 +94233,7 @@ exports[`Locale Provider should display the text as nb 1`] = `
|
||||
>
|
||||
<tr>
|
||||
<th
|
||||
class=""
|
||||
class="ant-table-column-has-filters"
|
||||
>
|
||||
<span>
|
||||
Name
|
||||
@@ -97623,6 +97663,7 @@ exports[`Locale Provider should display the text as nl 1`] = `
|
||||
<input
|
||||
class="ant-checkbox-input"
|
||||
type="checkbox"
|
||||
value="on"
|
||||
/>
|
||||
<span
|
||||
class="ant-checkbox-inner"
|
||||
@@ -97709,6 +97750,7 @@ exports[`Locale Provider should display the text as nl 1`] = `
|
||||
<input
|
||||
class="ant-checkbox-input"
|
||||
type="checkbox"
|
||||
value="on"
|
||||
/>
|
||||
<span
|
||||
class="ant-checkbox-inner"
|
||||
@@ -98789,7 +98831,7 @@ exports[`Locale Provider should display the text as nl 1`] = `
|
||||
>
|
||||
<tr>
|
||||
<th
|
||||
class=""
|
||||
class="ant-table-column-has-filters"
|
||||
>
|
||||
<span>
|
||||
Name
|
||||
@@ -102219,6 +102261,7 @@ exports[`Locale Provider should display the text as nl-be 1`] = `
|
||||
<input
|
||||
class="ant-checkbox-input"
|
||||
type="checkbox"
|
||||
value="on"
|
||||
/>
|
||||
<span
|
||||
class="ant-checkbox-inner"
|
||||
@@ -102305,6 +102348,7 @@ exports[`Locale Provider should display the text as nl-be 1`] = `
|
||||
<input
|
||||
class="ant-checkbox-input"
|
||||
type="checkbox"
|
||||
value="on"
|
||||
/>
|
||||
<span
|
||||
class="ant-checkbox-inner"
|
||||
@@ -103385,7 +103429,7 @@ exports[`Locale Provider should display the text as nl-be 1`] = `
|
||||
>
|
||||
<tr>
|
||||
<th
|
||||
class=""
|
||||
class="ant-table-column-has-filters"
|
||||
>
|
||||
<span>
|
||||
Name
|
||||
@@ -106815,6 +106859,7 @@ exports[`Locale Provider should display the text as pl 1`] = `
|
||||
<input
|
||||
class="ant-checkbox-input"
|
||||
type="checkbox"
|
||||
value="on"
|
||||
/>
|
||||
<span
|
||||
class="ant-checkbox-inner"
|
||||
@@ -106901,6 +106946,7 @@ exports[`Locale Provider should display the text as pl 1`] = `
|
||||
<input
|
||||
class="ant-checkbox-input"
|
||||
type="checkbox"
|
||||
value="on"
|
||||
/>
|
||||
<span
|
||||
class="ant-checkbox-inner"
|
||||
@@ -107981,7 +108027,7 @@ exports[`Locale Provider should display the text as pl 1`] = `
|
||||
>
|
||||
<tr>
|
||||
<th
|
||||
class=""
|
||||
class="ant-table-column-has-filters"
|
||||
>
|
||||
<span>
|
||||
Name
|
||||
@@ -111411,6 +111457,7 @@ exports[`Locale Provider should display the text as pt 1`] = `
|
||||
<input
|
||||
class="ant-checkbox-input"
|
||||
type="checkbox"
|
||||
value="on"
|
||||
/>
|
||||
<span
|
||||
class="ant-checkbox-inner"
|
||||
@@ -111497,6 +111544,7 @@ exports[`Locale Provider should display the text as pt 1`] = `
|
||||
<input
|
||||
class="ant-checkbox-input"
|
||||
type="checkbox"
|
||||
value="on"
|
||||
/>
|
||||
<span
|
||||
class="ant-checkbox-inner"
|
||||
@@ -112577,7 +112625,7 @@ exports[`Locale Provider should display the text as pt 1`] = `
|
||||
>
|
||||
<tr>
|
||||
<th
|
||||
class=""
|
||||
class="ant-table-column-has-filters"
|
||||
>
|
||||
<span>
|
||||
Name
|
||||
@@ -116007,6 +116055,7 @@ exports[`Locale Provider should display the text as pt-br 1`] = `
|
||||
<input
|
||||
class="ant-checkbox-input"
|
||||
type="checkbox"
|
||||
value="on"
|
||||
/>
|
||||
<span
|
||||
class="ant-checkbox-inner"
|
||||
@@ -116093,6 +116142,7 @@ exports[`Locale Provider should display the text as pt-br 1`] = `
|
||||
<input
|
||||
class="ant-checkbox-input"
|
||||
type="checkbox"
|
||||
value="on"
|
||||
/>
|
||||
<span
|
||||
class="ant-checkbox-inner"
|
||||
@@ -117173,7 +117223,7 @@ exports[`Locale Provider should display the text as pt-br 1`] = `
|
||||
>
|
||||
<tr>
|
||||
<th
|
||||
class=""
|
||||
class="ant-table-column-has-filters"
|
||||
>
|
||||
<span>
|
||||
Name
|
||||
@@ -120603,6 +120653,7 @@ exports[`Locale Provider should display the text as ru 1`] = `
|
||||
<input
|
||||
class="ant-checkbox-input"
|
||||
type="checkbox"
|
||||
value="on"
|
||||
/>
|
||||
<span
|
||||
class="ant-checkbox-inner"
|
||||
@@ -120689,6 +120740,7 @@ exports[`Locale Provider should display the text as ru 1`] = `
|
||||
<input
|
||||
class="ant-checkbox-input"
|
||||
type="checkbox"
|
||||
value="on"
|
||||
/>
|
||||
<span
|
||||
class="ant-checkbox-inner"
|
||||
@@ -121769,7 +121821,7 @@ exports[`Locale Provider should display the text as ru 1`] = `
|
||||
>
|
||||
<tr>
|
||||
<th
|
||||
class=""
|
||||
class="ant-table-column-has-filters"
|
||||
>
|
||||
<span>
|
||||
Name
|
||||
@@ -125199,6 +125251,7 @@ exports[`Locale Provider should display the text as sk 1`] = `
|
||||
<input
|
||||
class="ant-checkbox-input"
|
||||
type="checkbox"
|
||||
value="on"
|
||||
/>
|
||||
<span
|
||||
class="ant-checkbox-inner"
|
||||
@@ -125285,6 +125338,7 @@ exports[`Locale Provider should display the text as sk 1`] = `
|
||||
<input
|
||||
class="ant-checkbox-input"
|
||||
type="checkbox"
|
||||
value="on"
|
||||
/>
|
||||
<span
|
||||
class="ant-checkbox-inner"
|
||||
@@ -126365,7 +126419,7 @@ exports[`Locale Provider should display the text as sk 1`] = `
|
||||
>
|
||||
<tr>
|
||||
<th
|
||||
class=""
|
||||
class="ant-table-column-has-filters"
|
||||
>
|
||||
<span>
|
||||
Name
|
||||
@@ -129795,6 +129849,7 @@ exports[`Locale Provider should display the text as sr 1`] = `
|
||||
<input
|
||||
class="ant-checkbox-input"
|
||||
type="checkbox"
|
||||
value="on"
|
||||
/>
|
||||
<span
|
||||
class="ant-checkbox-inner"
|
||||
@@ -129881,6 +129936,7 @@ exports[`Locale Provider should display the text as sr 1`] = `
|
||||
<input
|
||||
class="ant-checkbox-input"
|
||||
type="checkbox"
|
||||
value="on"
|
||||
/>
|
||||
<span
|
||||
class="ant-checkbox-inner"
|
||||
@@ -130961,7 +131017,7 @@ exports[`Locale Provider should display the text as sr 1`] = `
|
||||
>
|
||||
<tr>
|
||||
<th
|
||||
class=""
|
||||
class="ant-table-column-has-filters"
|
||||
>
|
||||
<span>
|
||||
Name
|
||||
@@ -134391,6 +134447,7 @@ exports[`Locale Provider should display the text as sv 1`] = `
|
||||
<input
|
||||
class="ant-checkbox-input"
|
||||
type="checkbox"
|
||||
value="on"
|
||||
/>
|
||||
<span
|
||||
class="ant-checkbox-inner"
|
||||
@@ -134477,6 +134534,7 @@ exports[`Locale Provider should display the text as sv 1`] = `
|
||||
<input
|
||||
class="ant-checkbox-input"
|
||||
type="checkbox"
|
||||
value="on"
|
||||
/>
|
||||
<span
|
||||
class="ant-checkbox-inner"
|
||||
@@ -135557,7 +135615,7 @@ exports[`Locale Provider should display the text as sv 1`] = `
|
||||
>
|
||||
<tr>
|
||||
<th
|
||||
class=""
|
||||
class="ant-table-column-has-filters"
|
||||
>
|
||||
<span>
|
||||
Name
|
||||
@@ -138987,6 +139045,7 @@ exports[`Locale Provider should display the text as th 1`] = `
|
||||
<input
|
||||
class="ant-checkbox-input"
|
||||
type="checkbox"
|
||||
value="on"
|
||||
/>
|
||||
<span
|
||||
class="ant-checkbox-inner"
|
||||
@@ -139073,6 +139132,7 @@ exports[`Locale Provider should display the text as th 1`] = `
|
||||
<input
|
||||
class="ant-checkbox-input"
|
||||
type="checkbox"
|
||||
value="on"
|
||||
/>
|
||||
<span
|
||||
class="ant-checkbox-inner"
|
||||
@@ -140153,7 +140213,7 @@ exports[`Locale Provider should display the text as th 1`] = `
|
||||
>
|
||||
<tr>
|
||||
<th
|
||||
class=""
|
||||
class="ant-table-column-has-filters"
|
||||
>
|
||||
<span>
|
||||
Name
|
||||
@@ -140459,7 +140519,7 @@ exports[`Locale Provider should display the text as tr 1`] = `
|
||||
<a
|
||||
class="ant-calendar-clear-btn"
|
||||
role="button"
|
||||
title="Clear"
|
||||
title="Temizle"
|
||||
/>
|
||||
</div>
|
||||
<div
|
||||
@@ -140474,12 +140534,12 @@ exports[`Locale Provider should display the text as tr 1`] = `
|
||||
<a
|
||||
class="ant-calendar-prev-year-btn"
|
||||
role="button"
|
||||
title="Last year (Control + left)"
|
||||
title="Önceki Yıl (Control + Sol)"
|
||||
/>
|
||||
<a
|
||||
class="ant-calendar-prev-month-btn"
|
||||
role="button"
|
||||
title="Previous month (PageUp)"
|
||||
title="Önceki Ay (PageUp)"
|
||||
/>
|
||||
<span
|
||||
class="ant-calendar-my-select"
|
||||
@@ -140487,25 +140547,25 @@ exports[`Locale Provider should display the text as tr 1`] = `
|
||||
<a
|
||||
class="ant-calendar-month-select"
|
||||
role="button"
|
||||
title="Choose a month"
|
||||
title="Ay Seç"
|
||||
>
|
||||
Eyl
|
||||
</a>
|
||||
<a
|
||||
class="ant-calendar-year-select"
|
||||
role="button"
|
||||
title="Choose a year"
|
||||
title="Yıl Seç"
|
||||
>
|
||||
2017
|
||||
</a>
|
||||
</span>
|
||||
<a
|
||||
class="ant-calendar-next-month-btn"
|
||||
title="Next month (PageDown)"
|
||||
title="Sonraki Ay (PageDown)"
|
||||
/>
|
||||
<a
|
||||
class="ant-calendar-next-year-btn"
|
||||
title="Next year (Control + right)"
|
||||
title="Sonraki Yıl (Control + Sağ)"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
@@ -141193,7 +141253,7 @@ exports[`Locale Provider should display the text as tr 1`] = `
|
||||
role="button"
|
||||
title="18 Eylül 2017"
|
||||
>
|
||||
Today
|
||||
Bugün
|
||||
</a>
|
||||
</span>
|
||||
</div>
|
||||
@@ -142059,12 +142119,12 @@ exports[`Locale Provider should display the text as tr 1`] = `
|
||||
<a
|
||||
class="ant-calendar-prev-year-btn"
|
||||
role="button"
|
||||
title="Last year (Control + left)"
|
||||
title="Önceki Yıl (Control + Sol)"
|
||||
/>
|
||||
<a
|
||||
class="ant-calendar-prev-month-btn"
|
||||
role="button"
|
||||
title="Previous month (PageUp)"
|
||||
title="Önceki Ay (PageUp)"
|
||||
/>
|
||||
<span
|
||||
class="ant-calendar-my-select"
|
||||
@@ -142072,14 +142132,14 @@ exports[`Locale Provider should display the text as tr 1`] = `
|
||||
<a
|
||||
class="ant-calendar-month-select"
|
||||
role="button"
|
||||
title="Choose a month"
|
||||
title="Ay Seç"
|
||||
>
|
||||
Eyl
|
||||
</a>
|
||||
<a
|
||||
class="ant-calendar-year-select"
|
||||
role="button"
|
||||
title="Choose a year"
|
||||
title="Yıl Seç"
|
||||
>
|
||||
2017
|
||||
</a>
|
||||
@@ -142797,25 +142857,25 @@ exports[`Locale Provider should display the text as tr 1`] = `
|
||||
<a
|
||||
class="ant-calendar-month-select"
|
||||
role="button"
|
||||
title="Choose a month"
|
||||
title="Ay Seç"
|
||||
>
|
||||
Eki
|
||||
</a>
|
||||
<a
|
||||
class="ant-calendar-year-select"
|
||||
role="button"
|
||||
title="Choose a year"
|
||||
title="Yıl Seç"
|
||||
>
|
||||
2017
|
||||
</a>
|
||||
</span>
|
||||
<a
|
||||
class="ant-calendar-next-month-btn"
|
||||
title="Next month (PageDown)"
|
||||
title="Sonraki Ay (PageDown)"
|
||||
/>
|
||||
<a
|
||||
class="ant-calendar-next-year-btn"
|
||||
title="Next year (Control + right)"
|
||||
title="Sonraki Yıl (Control + Sağ)"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
@@ -143583,6 +143643,7 @@ exports[`Locale Provider should display the text as tr 1`] = `
|
||||
<input
|
||||
class="ant-checkbox-input"
|
||||
type="checkbox"
|
||||
value="on"
|
||||
/>
|
||||
<span
|
||||
class="ant-checkbox-inner"
|
||||
@@ -143669,6 +143730,7 @@ exports[`Locale Provider should display the text as tr 1`] = `
|
||||
<input
|
||||
class="ant-checkbox-input"
|
||||
type="checkbox"
|
||||
value="on"
|
||||
/>
|
||||
<span
|
||||
class="ant-checkbox-inner"
|
||||
@@ -143806,7 +143868,7 @@ exports[`Locale Provider should display the text as tr 1`] = `
|
||||
/>
|
||||
</span>
|
||||
<span>
|
||||
Month
|
||||
Ay
|
||||
</span>
|
||||
</label>
|
||||
<label
|
||||
@@ -143825,7 +143887,7 @@ exports[`Locale Provider should display the text as tr 1`] = `
|
||||
/>
|
||||
</span>
|
||||
<span>
|
||||
Year
|
||||
Yıl
|
||||
</span>
|
||||
</label>
|
||||
</div>
|
||||
@@ -144749,7 +144811,7 @@ exports[`Locale Provider should display the text as tr 1`] = `
|
||||
>
|
||||
<tr>
|
||||
<th
|
||||
class=""
|
||||
class="ant-table-column-has-filters"
|
||||
>
|
||||
<span>
|
||||
Name
|
||||
@@ -148179,6 +148241,7 @@ exports[`Locale Provider should display the text as uk 1`] = `
|
||||
<input
|
||||
class="ant-checkbox-input"
|
||||
type="checkbox"
|
||||
value="on"
|
||||
/>
|
||||
<span
|
||||
class="ant-checkbox-inner"
|
||||
@@ -148265,6 +148328,7 @@ exports[`Locale Provider should display the text as uk 1`] = `
|
||||
<input
|
||||
class="ant-checkbox-input"
|
||||
type="checkbox"
|
||||
value="on"
|
||||
/>
|
||||
<span
|
||||
class="ant-checkbox-inner"
|
||||
@@ -149345,7 +149409,7 @@ exports[`Locale Provider should display the text as uk 1`] = `
|
||||
>
|
||||
<tr>
|
||||
<th
|
||||
class=""
|
||||
class="ant-table-column-has-filters"
|
||||
>
|
||||
<span>
|
||||
Name
|
||||
@@ -152775,6 +152839,7 @@ exports[`Locale Provider should display the text as vi 1`] = `
|
||||
<input
|
||||
class="ant-checkbox-input"
|
||||
type="checkbox"
|
||||
value="on"
|
||||
/>
|
||||
<span
|
||||
class="ant-checkbox-inner"
|
||||
@@ -152861,6 +152926,7 @@ exports[`Locale Provider should display the text as vi 1`] = `
|
||||
<input
|
||||
class="ant-checkbox-input"
|
||||
type="checkbox"
|
||||
value="on"
|
||||
/>
|
||||
<span
|
||||
class="ant-checkbox-inner"
|
||||
@@ -153941,7 +154007,7 @@ exports[`Locale Provider should display the text as vi 1`] = `
|
||||
>
|
||||
<tr>
|
||||
<th
|
||||
class=""
|
||||
class="ant-table-column-has-filters"
|
||||
>
|
||||
<span>
|
||||
Name
|
||||
@@ -157371,6 +157437,7 @@ exports[`Locale Provider should display the text as zh-cn 1`] = `
|
||||
<input
|
||||
class="ant-checkbox-input"
|
||||
type="checkbox"
|
||||
value="on"
|
||||
/>
|
||||
<span
|
||||
class="ant-checkbox-inner"
|
||||
@@ -157457,6 +157524,7 @@ exports[`Locale Provider should display the text as zh-cn 1`] = `
|
||||
<input
|
||||
class="ant-checkbox-input"
|
||||
type="checkbox"
|
||||
value="on"
|
||||
/>
|
||||
<span
|
||||
class="ant-checkbox-inner"
|
||||
@@ -158537,7 +158605,7 @@ exports[`Locale Provider should display the text as zh-cn 1`] = `
|
||||
>
|
||||
<tr>
|
||||
<th
|
||||
class=""
|
||||
class="ant-table-column-has-filters"
|
||||
>
|
||||
<span>
|
||||
Name
|
||||
@@ -161967,6 +162035,7 @@ exports[`Locale Provider should display the text as zh-tw 1`] = `
|
||||
<input
|
||||
class="ant-checkbox-input"
|
||||
type="checkbox"
|
||||
value="on"
|
||||
/>
|
||||
<span
|
||||
class="ant-checkbox-inner"
|
||||
@@ -162053,6 +162122,7 @@ exports[`Locale Provider should display the text as zh-tw 1`] = `
|
||||
<input
|
||||
class="ant-checkbox-input"
|
||||
type="checkbox"
|
||||
value="on"
|
||||
/>
|
||||
<span
|
||||
class="ant-checkbox-inner"
|
||||
@@ -163133,7 +163203,7 @@ exports[`Locale Provider should display the text as zh-tw 1`] = `
|
||||
>
|
||||
<tr>
|
||||
<th
|
||||
class=""
|
||||
class="ant-table-column-has-filters"
|
||||
>
|
||||
<span>
|
||||
Name
|
||||
|
||||
@@ -87,7 +87,7 @@ const App = () => (
|
||||
|
||||
describe('Locale Provider', () => {
|
||||
beforeAll(() => {
|
||||
MockDate.set(moment('2017-09-18T03:30:07.795Z').valueOf() + (new Date().getTimezoneOffset() * 60 * 1000));
|
||||
MockDate.set(moment('2017-09-18T03:30:07.795'));
|
||||
});
|
||||
|
||||
afterAll(() => {
|
||||
|
||||
@@ -29,9 +29,15 @@ class PopoverContainer extends React.Component {
|
||||
getSuggestionContainer = () => {
|
||||
return this.popover.getPopupDomNode();
|
||||
}
|
||||
visibleChange = (visible) => {
|
||||
if (visible && this.mention) {
|
||||
this.mention.focus();
|
||||
}
|
||||
}
|
||||
render() {
|
||||
const mention = (
|
||||
<Mention
|
||||
ref={ele => this.mention = ele}
|
||||
style={{ width: '100%' }}
|
||||
onChange={onChange}
|
||||
defaultValue={toContentState('@afc163')}
|
||||
@@ -41,7 +47,13 @@ class PopoverContainer extends React.Component {
|
||||
/>
|
||||
);
|
||||
return (
|
||||
<Popover trigger="click" content={mention} title="Title" ref={popover => this.popover = popover}>
|
||||
<Popover
|
||||
trigger="click"
|
||||
content={mention}
|
||||
title="Title"
|
||||
ref={popover => this.popover = popover}
|
||||
onVisibleChange={this.visibleChange}
|
||||
>
|
||||
<Button type="primary">Click Me</Button>
|
||||
</Popover>
|
||||
);
|
||||
|
||||
@@ -4,7 +4,7 @@ type: Data Entry
|
||||
title: Mention
|
||||
---
|
||||
|
||||
Mention component。
|
||||
Mention component.
|
||||
|
||||
## When To Use
|
||||
|
||||
|
||||
@@ -111,7 +111,7 @@ export default class Mention extends React.Component<MentionProps, MentionState>
|
||||
}
|
||||
}
|
||||
focus = () => {
|
||||
this.mentionEle._editor.focus();
|
||||
this.mentionEle._editor.focusEditor();
|
||||
}
|
||||
mentionRef = (ele: any) => {
|
||||
this.mentionEle = ele;
|
||||
|
||||
@@ -13,6 +13,8 @@
|
||||
|
||||
.@{mention-prefix-cls}-editor {
|
||||
.input;
|
||||
min-height: @input-height-base;
|
||||
height: auto; // To override height in .input mixin
|
||||
line-height: @line-height-base;
|
||||
padding: 0;
|
||||
display: block;
|
||||
@@ -29,6 +31,7 @@
|
||||
}
|
||||
.public-DraftEditorPlaceholder-root {
|
||||
position: absolute;
|
||||
pointer-events: none;
|
||||
.public-DraftEditorPlaceholder-inner {
|
||||
color: @input-placeholder-color;
|
||||
opacity: 1;
|
||||
|
||||
@@ -7,6 +7,7 @@ let defaultTop: number;
|
||||
let messageInstance: any;
|
||||
let key = 1;
|
||||
let prefixCls = 'ant-message';
|
||||
let transitionName = 'move-up';
|
||||
let getContainer: () => HTMLElement;
|
||||
|
||||
function getMessageInstance(callback: (i: any) => void) {
|
||||
@@ -16,7 +17,7 @@ function getMessageInstance(callback: (i: any) => void) {
|
||||
}
|
||||
Notification.newInstance({
|
||||
prefixCls,
|
||||
transitionName: 'move-up',
|
||||
transitionName,
|
||||
style: { top: defaultTop }, // 覆盖原来的样式
|
||||
getContainer,
|
||||
}, (instance: any) => {
|
||||
@@ -81,6 +82,7 @@ export interface ConfigOptions {
|
||||
duration?: number;
|
||||
prefixCls?: string;
|
||||
getContainer?: () => HTMLElement;
|
||||
transitionName?: string;
|
||||
}
|
||||
|
||||
export default {
|
||||
@@ -117,6 +119,10 @@ export default {
|
||||
if (options.getContainer !== undefined) {
|
||||
getContainer = options.getContainer;
|
||||
}
|
||||
if (options.transitionName !== undefined) {
|
||||
transitionName = options.transitionName;
|
||||
messageInstance = null; // delete messageInstance for new transitionName
|
||||
}
|
||||
},
|
||||
destroy() {
|
||||
if (messageInstance) {
|
||||
|
||||
@@ -47,6 +47,7 @@ export interface ModalProps {
|
||||
bodyStyle?: React.CSSProperties;
|
||||
maskStyle?: React.CSSProperties;
|
||||
mask?: boolean;
|
||||
keyboard?: boolean;
|
||||
}
|
||||
|
||||
export interface ModalFuncProps {
|
||||
@@ -68,6 +69,7 @@ export interface ModalFuncProps {
|
||||
okCancel?: boolean;
|
||||
style?: React.CSSProperties;
|
||||
type?: string;
|
||||
keyboard?: boolean;
|
||||
}
|
||||
|
||||
export type ModalFunc = (props: ModalFuncProps) => {
|
||||
|
||||
@@ -14,7 +14,7 @@ interface ConfirmDialogProps extends ModalFuncProps {
|
||||
const IS_REACT_16 = !!ReactDOM.createPortal;
|
||||
|
||||
const ConfirmDialog = (props: ConfirmDialogProps) => {
|
||||
const { onCancel, onOk, close, zIndex, afterClose, visible } = props;
|
||||
const { onCancel, onOk, close, zIndex, afterClose, visible, keyboard } = props;
|
||||
const iconType = props.iconType || 'question-circle';
|
||||
const okType = props.okType || 'primary';
|
||||
const prefixCls = props.prefixCls || 'ant-confirm';
|
||||
@@ -55,6 +55,7 @@ const ConfirmDialog = (props: ConfirmDialogProps) => {
|
||||
width={width}
|
||||
zIndex={zIndex}
|
||||
afterClose={afterClose}
|
||||
keyboard={keyboard}
|
||||
>
|
||||
<div className={`${prefixCls}-body-wrapper`}>
|
||||
<div className={`${prefixCls}-body`}>
|
||||
|
||||
@@ -45,7 +45,7 @@
|
||||
border: @border-width-base @border-style-base @border-color-base;
|
||||
background-color: @component-background;
|
||||
margin-right: 8px;
|
||||
font-family: Arial;
|
||||
font-family: @pagination-font-family;
|
||||
outline: 0;
|
||||
|
||||
a {
|
||||
@@ -134,7 +134,7 @@
|
||||
&-next,
|
||||
&-jump-prev,
|
||||
&-jump-next {
|
||||
font-family: Arial;
|
||||
font-family: @pagination-font-family;
|
||||
cursor: pointer;
|
||||
color: @text-color;
|
||||
border-radius: @border-radius-base;
|
||||
|
||||
13
components/progress/__tests__/index.test.js
Normal file
13
components/progress/__tests__/index.test.js
Normal file
@@ -0,0 +1,13 @@
|
||||
import React from 'react';
|
||||
import { mount } from 'enzyme';
|
||||
import Progress from '..';
|
||||
|
||||
describe('Progress', () => {
|
||||
it('successPercent should decide the progress status when it exists', async () => {
|
||||
const wrapper = mount(<Progress percent={100} successPercent={50} />);
|
||||
expect(wrapper.find('.ant-progress-status-success')).toHaveLength(0);
|
||||
|
||||
wrapper.setProps({ percent: 50, successPercent: 100 });
|
||||
expect(wrapper.find('.ant-progress-status-success')).toHaveLength(1);
|
||||
});
|
||||
});
|
||||
@@ -60,8 +60,8 @@ export default class Progress extends React.Component<ProgressProps, {}> {
|
||||
prefixCls, className, percent = 0, status, format, trailColor, size, successPercent,
|
||||
type, strokeWidth, width, showInfo, gapDegree = 0, gapPosition, ...restProps,
|
||||
} = props;
|
||||
const progressStatus = parseInt(percent.toString(), 10) >= 100 && !('status' in props) ?
|
||||
'success' : (status || 'normal');
|
||||
const progressStatus = parseInt((successPercent ? successPercent.toString() : percent.toString()), 10) >= 100 &&
|
||||
!('status' in props) ? 'success' : (status || 'normal');
|
||||
let progressInfo;
|
||||
let progress;
|
||||
const textFormatter = format || (percentNumber => `${percentNumber}%`);
|
||||
|
||||
@@ -3,7 +3,7 @@ import PropTypes from 'prop-types';
|
||||
import classNames from 'classnames';
|
||||
import shallowEqual from 'shallowequal';
|
||||
import Radio from './radio';
|
||||
import { RadioGroupProps, RadioGroupState } from './interface';
|
||||
import { RadioGroupProps, RadioGroupState, RadioChangeEvent } from './interface';
|
||||
|
||||
function getCheckedValue(children: React.ReactNode) {
|
||||
let value = null;
|
||||
@@ -73,7 +73,7 @@ export default class RadioGroup extends React.Component<RadioGroupProps, RadioGr
|
||||
!shallowEqual(this.state, nextState);
|
||||
}
|
||||
|
||||
onRadioChange = (ev: React.ChangeEvent<HTMLInputElement>) => {
|
||||
onRadioChange = (ev: RadioChangeEvent) => {
|
||||
const lastValue = this.state.value;
|
||||
const { value } = ev.target;
|
||||
if (!('value' in this.props)) {
|
||||
|
||||
@@ -5,7 +5,7 @@ import { AbstractCheckboxProps } from '../checkbox/Checkbox';
|
||||
export interface RadioGroupProps extends AbstractCheckboxGroupProps {
|
||||
defaultValue?: any;
|
||||
value?: any;
|
||||
onChange?: React.ChangeEventHandler<HTMLInputElement>;
|
||||
onChange?: (e: RadioChangeEvent) => void;
|
||||
size?: 'large' | 'default' | 'small';
|
||||
onMouseEnter?: React.MouseEventHandler<HTMLDivElement>;
|
||||
onMouseLeave?: React.MouseEventHandler<HTMLDivElement>;
|
||||
@@ -27,4 +27,15 @@ export interface RadioGroupContext {
|
||||
};
|
||||
}
|
||||
|
||||
export type RadioProps = AbstractCheckboxProps;
|
||||
export type RadioProps = AbstractCheckboxProps<RadioChangeEvent>;
|
||||
|
||||
export interface RadioChangeEventTarget extends RadioProps {
|
||||
checked: boolean;
|
||||
}
|
||||
|
||||
export interface RadioChangeEvent {
|
||||
target: RadioChangeEventTarget;
|
||||
stopPropagation: () => void;
|
||||
preventDefault: () => void;
|
||||
nativeEvent: MouseEvent;
|
||||
}
|
||||
|
||||
@@ -2,8 +2,9 @@ import * as React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import { AbstractCheckboxProps } from '../checkbox/Checkbox';
|
||||
import Radio from './radio';
|
||||
import { RadioChangeEvent } from './interface';
|
||||
|
||||
export type RadioButtonProps = AbstractCheckboxProps;
|
||||
export type RadioButtonProps = AbstractCheckboxProps<RadioChangeEvent>;
|
||||
|
||||
export default class RadioButton extends React.Component<RadioButtonProps, any> {
|
||||
static defaultProps = {
|
||||
|
||||
@@ -15,7 +15,7 @@ A complete multiple select sample with remote search, debounce fetch, ajax callb
|
||||
|
||||
````jsx
|
||||
import { Select, Spin } from 'antd';
|
||||
import debounce from 'lodash.debounce';
|
||||
import debounce from 'lodash/debounce';
|
||||
const Option = Select.Option;
|
||||
|
||||
class UserRemoteSelect extends React.Component {
|
||||
|
||||
@@ -37,12 +37,13 @@ Select component to select value from options.
|
||||
| labelInValue | whether to embed label in value, turn the format of value from `string` to `{key: string, label: ReactNode}` | boolean | false |
|
||||
| maxTagCount | Max tag count to show | number | - |
|
||||
| maxTagPlaceholder | Placeholder for not showing tags | ReactNode/function(omittedValues) | - |
|
||||
| mode | Set mode of Select (Support after 2.9) | 'multiple' \| 'tags' \| 'combobox' | - |
|
||||
| mode | Set mode of Select (Support after 2.9) | 'default' \| 'multiple' \| 'tags' \| 'combobox' | 'default' |
|
||||
| notFoundContent | Specify content to show when no result matches.. | string | 'Not Found' |
|
||||
| optionFilterProp | Which prop value of option will be used for filter if filterOption is true | string | value |
|
||||
| optionLabelProp | Which prop value of option will render as content of select. | string | `children` |
|
||||
| placeholder | Placeholder of select | string\|ReactNode | - |
|
||||
| showSearch | Whether show search input in single mode. | boolean | false |
|
||||
| showArrow | Whether to show the drop-down arrow | boolean | true |
|
||||
| size | Size of Select input. `default` `large` `small` | string | default |
|
||||
| tokenSeparators | Separator used to tokenize on tag/multiple mode | string\[] | |
|
||||
| value | Current selected option. | string\|number\|string\[]\|number\[] | - |
|
||||
|
||||
@@ -38,11 +38,12 @@ export interface SelectProps extends AbstractSelectProps {
|
||||
defaultValue?: SelectValue;
|
||||
mode?: 'default' | 'multiple' | 'tags' | 'combobox';
|
||||
optionLabelProp?: string;
|
||||
onChange?: (value: SelectValue) => void;
|
||||
onSelect?: (value: SelectValue, option: Object) => any;
|
||||
onChange?: (value: SelectValue, option: React.ReactElement<any> | React.ReactElement<any>[]) => void;
|
||||
onSelect?: (value: SelectValue, option: React.ReactElement<any>) => any;
|
||||
onDeselect?: (value: SelectValue) => any;
|
||||
onBlur?: () => any;
|
||||
onFocus?: () => any;
|
||||
onPopupScroll?: () => any;
|
||||
onInputKeyDown?: (e: React.KeyboardEvent<HTMLInputElement>) => void;
|
||||
maxTagCount?: number;
|
||||
maxTagPlaceholder?: React.ReactNode | ((omittedValues: SelectValue[]) => React.ReactNode);
|
||||
|
||||
@@ -46,6 +46,7 @@ title: Select
|
||||
| optionLabelProp | 回填到选择框的 Option 的属性值,默认是 Option 的子元素。比如在子元素需要高亮效果时,此值可以设为 `value`。 | string | `children` (combobox 模式下为 `value`) |
|
||||
| placeholder | 选择框默认文字 | string | - |
|
||||
| showSearch | 使单选模式可搜索 | boolean | false |
|
||||
| showArrow | 是否显示下拉小箭头 | boolean | true |
|
||||
| size | 选择框大小,可选 `large` `small` | string | default |
|
||||
| tags | 可以把随意输入的条目作为 tag,输入项不需要与下拉选项匹配(2.9 之后废弃,请使用 `mode`) | boolean | false |
|
||||
| tokenSeparators | 在 tags 和 multiple 模式下自动分词的分隔符 | string\[] | |
|
||||
|
||||
@@ -58,10 +58,10 @@
|
||||
top: 50%;
|
||||
right: @control-padding-horizontal - 1px;
|
||||
line-height: 1;
|
||||
transform: translateY(-50%);
|
||||
margin-top: -@font-size-sm / 2;
|
||||
transform-origin: 50% 50%;
|
||||
color: @disabled-color;
|
||||
font-size: 12px;
|
||||
font-size: @font-size-sm;
|
||||
|
||||
* {
|
||||
display: none;
|
||||
@@ -69,7 +69,7 @@
|
||||
|
||||
&:before {
|
||||
content: '\e61d';
|
||||
transition: transform 0.2s ease;
|
||||
transition: transform .3s;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -376,11 +376,8 @@
|
||||
}
|
||||
|
||||
&-open {
|
||||
.@{select-prefix-cls}-arrow {
|
||||
-ms-transform: rotate(180deg);
|
||||
&:before {
|
||||
transform: rotate(180deg);
|
||||
}
|
||||
.@{select-prefix-cls}-arrow:before {
|
||||
transform: rotate(180deg);
|
||||
}
|
||||
.@{select-prefix-cls}-selection {
|
||||
.active();
|
||||
@@ -456,6 +453,7 @@
|
||||
padding-left: 0; // Override default ul/ol
|
||||
list-style: none;
|
||||
max-height: 250px;
|
||||
overflow: auto;
|
||||
|
||||
&-item-group-list {
|
||||
margin: 0;
|
||||
@@ -491,6 +489,14 @@
|
||||
background-color: @item-hover-bg;
|
||||
}
|
||||
|
||||
&:first-child {
|
||||
border-radius: @border-radius-base @border-radius-base 0 0;
|
||||
}
|
||||
|
||||
&:last-child {
|
||||
border-radius: 0 0 @border-radius-base @border-radius-base;
|
||||
}
|
||||
|
||||
&-disabled {
|
||||
color: @disabled-color;
|
||||
cursor: not-allowed;
|
||||
|
||||
@@ -10,7 +10,7 @@ exports[`renders ./components/slider/demo/basic.md correctly 1`] = `
|
||||
/>
|
||||
<div
|
||||
class="ant-slider-track"
|
||||
style="visibility:visible;left:0%;width:30%"
|
||||
style="left:0%;width:30%"
|
||||
/>
|
||||
<div
|
||||
class="ant-slider-step"
|
||||
@@ -37,7 +37,7 @@ exports[`renders ./components/slider/demo/basic.md correctly 1`] = `
|
||||
/>
|
||||
<div
|
||||
class="ant-slider-track ant-slider-track-1"
|
||||
style="visibility:visible;left:20%;width:30%"
|
||||
style="left:20%;width:30%"
|
||||
/>
|
||||
<div
|
||||
class="ant-slider-step"
|
||||
@@ -88,7 +88,7 @@ exports[`renders ./components/slider/demo/event.md correctly 1`] = `
|
||||
/>
|
||||
<div
|
||||
class="ant-slider-track"
|
||||
style="visibility:visible;left:0%;width:30%"
|
||||
style="left:0%;width:30%"
|
||||
/>
|
||||
<div
|
||||
class="ant-slider-step"
|
||||
@@ -115,7 +115,7 @@ exports[`renders ./components/slider/demo/event.md correctly 1`] = `
|
||||
/>
|
||||
<div
|
||||
class="ant-slider-track ant-slider-track-1"
|
||||
style="visibility:visible;left:20%;width:30%"
|
||||
style="left:20%;width:30%"
|
||||
/>
|
||||
<div
|
||||
class="ant-slider-step"
|
||||
@@ -163,7 +163,7 @@ exports[`renders ./components/slider/demo/icon-slider.md correctly 1`] = `
|
||||
/>
|
||||
<div
|
||||
class="ant-slider-track"
|
||||
style="visibility:visible;left:0%;width:0%"
|
||||
style="left:0%;width:0%"
|
||||
/>
|
||||
<div
|
||||
class="ant-slider-step"
|
||||
@@ -205,7 +205,7 @@ exports[`renders ./components/slider/demo/input-number.md correctly 1`] = `
|
||||
/>
|
||||
<div
|
||||
class="ant-slider-track"
|
||||
style="visibility:visible;left:0%;width:0%"
|
||||
style="left:0%;width:0%"
|
||||
/>
|
||||
<div
|
||||
class="ant-slider-step"
|
||||
@@ -293,7 +293,7 @@ exports[`renders ./components/slider/demo/input-number.md correctly 1`] = `
|
||||
/>
|
||||
<div
|
||||
class="ant-slider-track"
|
||||
style="visibility:visible;left:0%;width:0%"
|
||||
style="left:0%;width:0%"
|
||||
/>
|
||||
<div
|
||||
class="ant-slider-step"
|
||||
@@ -383,7 +383,7 @@ exports[`renders ./components/slider/demo/mark.md correctly 1`] = `
|
||||
/>
|
||||
<div
|
||||
class="ant-slider-track"
|
||||
style="visibility:visible;left:0%;width:37%"
|
||||
style="left:0%;width:37%"
|
||||
/>
|
||||
<div
|
||||
class="ant-slider-step"
|
||||
@@ -454,7 +454,7 @@ exports[`renders ./components/slider/demo/mark.md correctly 1`] = `
|
||||
/>
|
||||
<div
|
||||
class="ant-slider-track ant-slider-track-1"
|
||||
style="visibility:visible;left:26%;width:11%"
|
||||
style="left:26%;width:11%"
|
||||
/>
|
||||
<div
|
||||
class="ant-slider-step"
|
||||
@@ -536,10 +536,6 @@ exports[`renders ./components/slider/demo/mark.md correctly 1`] = `
|
||||
<div
|
||||
class="ant-slider-rail"
|
||||
/>
|
||||
<div
|
||||
class="ant-slider-track"
|
||||
style="visibility:hidden;left:0%;width:37%"
|
||||
/>
|
||||
<div
|
||||
class="ant-slider-step"
|
||||
>
|
||||
@@ -612,7 +608,7 @@ exports[`renders ./components/slider/demo/mark.md correctly 1`] = `
|
||||
/>
|
||||
<div
|
||||
class="ant-slider-track"
|
||||
style="visibility:visible;left:0%;width:37%"
|
||||
style="left:0%;width:37%"
|
||||
/>
|
||||
<div
|
||||
class="ant-slider-step"
|
||||
@@ -686,7 +682,7 @@ exports[`renders ./components/slider/demo/mark.md correctly 1`] = `
|
||||
/>
|
||||
<div
|
||||
class="ant-slider-track"
|
||||
style="visibility:visible;left:0%;width:37%"
|
||||
style="left:0%;width:37%"
|
||||
/>
|
||||
<div
|
||||
class="ant-slider-step"
|
||||
@@ -762,7 +758,7 @@ exports[`renders ./components/slider/demo/tip-formatter.md correctly 1`] = `
|
||||
/>
|
||||
<div
|
||||
class="ant-slider-track"
|
||||
style="visibility:visible;left:0%;width:0%"
|
||||
style="left:0%;width:0%"
|
||||
/>
|
||||
<div
|
||||
class="ant-slider-step"
|
||||
@@ -789,7 +785,7 @@ exports[`renders ./components/slider/demo/tip-formatter.md correctly 1`] = `
|
||||
/>
|
||||
<div
|
||||
class="ant-slider-track"
|
||||
style="visibility:visible;left:0%;width:0%"
|
||||
style="left:0%;width:0%"
|
||||
/>
|
||||
<div
|
||||
class="ant-slider-step"
|
||||
@@ -826,7 +822,7 @@ exports[`renders ./components/slider/demo/vertical.md correctly 1`] = `
|
||||
/>
|
||||
<div
|
||||
class="ant-slider-track"
|
||||
style="visibility:visible;bottom:0%;height:30%"
|
||||
style="bottom:0%;height:30%"
|
||||
/>
|
||||
<div
|
||||
class="ant-slider-step"
|
||||
@@ -857,7 +853,7 @@ exports[`renders ./components/slider/demo/vertical.md correctly 1`] = `
|
||||
/>
|
||||
<div
|
||||
class="ant-slider-track ant-slider-track-1"
|
||||
style="visibility:visible;bottom:20%;height:30%"
|
||||
style="bottom:20%;height:30%"
|
||||
/>
|
||||
<div
|
||||
class="ant-slider-step"
|
||||
@@ -898,7 +894,7 @@ exports[`renders ./components/slider/demo/vertical.md correctly 1`] = `
|
||||
/>
|
||||
<div
|
||||
class="ant-slider-track ant-slider-track-1"
|
||||
style="visibility:visible;bottom:26%;height:11%"
|
||||
style="bottom:26%;height:11%"
|
||||
/>
|
||||
<div
|
||||
class="ant-slider-step"
|
||||
|
||||
@@ -5,7 +5,7 @@ exports[`renders ./components/spin/demo/basic.md correctly 1`] = `
|
||||
class="ant-spin ant-spin-spinning"
|
||||
>
|
||||
<span
|
||||
class="ant-spin-dot"
|
||||
class="ant-spin-dot ant-spin-dot-spin"
|
||||
>
|
||||
<i />
|
||||
<i />
|
||||
@@ -20,7 +20,7 @@ exports[`renders ./components/spin/demo/custom-indicator.md correctly 1`] = `
|
||||
class="ant-spin ant-spin-spinning"
|
||||
>
|
||||
<i
|
||||
class="anticon anticon-spin anticon-loading"
|
||||
class="anticon anticon-spin anticon-loading ant-spin-dot"
|
||||
style="font-size:24px"
|
||||
/>
|
||||
</div>
|
||||
@@ -75,7 +75,7 @@ exports[`renders ./components/spin/demo/inside.md correctly 1`] = `
|
||||
class="ant-spin ant-spin-spinning"
|
||||
>
|
||||
<span
|
||||
class="ant-spin-dot"
|
||||
class="ant-spin-dot ant-spin-dot-spin"
|
||||
>
|
||||
<i />
|
||||
<i />
|
||||
@@ -133,7 +133,7 @@ exports[`renders ./components/spin/demo/size.md correctly 1`] = `
|
||||
class="ant-spin ant-spin-sm ant-spin-spinning"
|
||||
>
|
||||
<span
|
||||
class="ant-spin-dot"
|
||||
class="ant-spin-dot ant-spin-dot-spin"
|
||||
>
|
||||
<i />
|
||||
<i />
|
||||
@@ -145,7 +145,7 @@ exports[`renders ./components/spin/demo/size.md correctly 1`] = `
|
||||
class="ant-spin ant-spin-spinning"
|
||||
>
|
||||
<span
|
||||
class="ant-spin-dot"
|
||||
class="ant-spin-dot ant-spin-dot-spin"
|
||||
>
|
||||
<i />
|
||||
<i />
|
||||
@@ -157,7 +157,7 @@ exports[`renders ./components/spin/demo/size.md correctly 1`] = `
|
||||
class="ant-spin ant-spin-lg ant-spin-spinning"
|
||||
>
|
||||
<span
|
||||
class="ant-spin-dot"
|
||||
class="ant-spin-dot ant-spin-dot-spin"
|
||||
>
|
||||
<i />
|
||||
<i />
|
||||
@@ -177,7 +177,7 @@ exports[`renders ./components/spin/demo/tip.md correctly 1`] = `
|
||||
class="ant-spin ant-spin-spinning ant-spin-show-text"
|
||||
>
|
||||
<span
|
||||
class="ant-spin-dot"
|
||||
class="ant-spin-dot ant-spin-dot-spin"
|
||||
>
|
||||
<i />
|
||||
<i />
|
||||
|
||||
11
components/spin/__tests__/__snapshots__/index.test.js.snap
Normal file
11
components/spin/__tests__/__snapshots__/index.test.js.snap
Normal file
@@ -0,0 +1,11 @@
|
||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`Spin should render custom indicator when it's set 1`] = `
|
||||
<div
|
||||
class="ant-spin ant-spin-spinning"
|
||||
>
|
||||
<div
|
||||
class="custom-indicator ant-spin-dot"
|
||||
/>
|
||||
</div>
|
||||
`;
|
||||
@@ -1,5 +1,5 @@
|
||||
import React from 'react';
|
||||
import { shallow } from 'enzyme';
|
||||
import { shallow, render } from 'enzyme';
|
||||
import Spin from '..';
|
||||
|
||||
describe('Spin', () => {
|
||||
@@ -15,9 +15,9 @@ describe('Spin', () => {
|
||||
|
||||
it('should render custom indicator when it\'s set', () => {
|
||||
const customIndicator = <div className="custom-indicator" />;
|
||||
const wrapper = shallow(
|
||||
const wrapper = render(
|
||||
<Spin indicator={customIndicator} />
|
||||
);
|
||||
expect(wrapper.contains(customIndicator)).toEqual(true);
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
});
|
||||
});
|
||||
|
||||
@@ -15,7 +15,7 @@ When part of the page is waiting for asynchronous data or during a rendering pro
|
||||
| Property | Description | Type | Default Value |
|
||||
| -------- | ----------- | ---- | ------------- |
|
||||
| delay | specifies a delay in milliseconds for loading state (prevent flush) | number (milliseconds) | - |
|
||||
| indicator | React node of the spinning indicator | ReactNode | - |
|
||||
| indicator | React node of the spinning indicator | ReactElement | - |
|
||||
| size | size of Spin, options: `small`, `default` and `large` | string | `default` |
|
||||
| spinning | whether Spin is spinning | boolean | true |
|
||||
| tip | customize description content when Spin has children | string | - |
|
||||
|
||||
@@ -5,6 +5,8 @@ import Animate from 'rc-animate';
|
||||
import isCssAnimationSupported from '../_util/isCssAnimationSupported';
|
||||
import omit from 'omit.js';
|
||||
|
||||
export type SpinIndicator = React.ReactElement<any>;
|
||||
|
||||
export interface SpinProps {
|
||||
prefixCls?: string;
|
||||
className?: string;
|
||||
@@ -14,7 +16,7 @@ export interface SpinProps {
|
||||
tip?: string;
|
||||
delay?: number;
|
||||
wrapperClassName?: string;
|
||||
indicator?: React.ReactNode;
|
||||
indicator?: SpinIndicator;
|
||||
}
|
||||
|
||||
export interface SpinState {
|
||||
@@ -96,8 +98,27 @@ export default class Spin extends React.Component<SpinProps, SpinState> {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
renderIndicator() {
|
||||
const { prefixCls, indicator } = this.props;
|
||||
const dotClassName = `${prefixCls}-dot`;
|
||||
if (React.isValidElement(indicator)) {
|
||||
return React.cloneElement((indicator as SpinIndicator), {
|
||||
className: classNames((indicator as SpinIndicator).props.className, dotClassName),
|
||||
});
|
||||
}
|
||||
return (
|
||||
<span className={classNames(dotClassName, `${prefixCls}-dot-spin`)}>
|
||||
<i />
|
||||
<i />
|
||||
<i />
|
||||
<i />
|
||||
</span>
|
||||
);
|
||||
}
|
||||
|
||||
render() {
|
||||
const { className, size, prefixCls, tip, wrapperClassName, indicator, ...restProps } = this.props;
|
||||
const { className, size, prefixCls, tip, wrapperClassName, ...restProps } = this.props;
|
||||
const { spinning, notCssAnimationSupported } = this.state;
|
||||
|
||||
const spinClassName = classNames(prefixCls, {
|
||||
@@ -111,20 +132,12 @@ export default class Spin extends React.Component<SpinProps, SpinState> {
|
||||
const divProps = omit(restProps, [
|
||||
'spinning',
|
||||
'delay',
|
||||
'indicator',
|
||||
]);
|
||||
|
||||
const spinIndicator = indicator ? indicator : (
|
||||
<span className={`${prefixCls}-dot`}>
|
||||
<i />
|
||||
<i />
|
||||
<i />
|
||||
<i />
|
||||
</span>
|
||||
);
|
||||
|
||||
const spinElement = (
|
||||
<div {...divProps} className={spinClassName} >
|
||||
{spinIndicator}
|
||||
{this.renderIndicator()}
|
||||
{tip ? <div className={`${prefixCls}-text`}>{tip}</div> : null}
|
||||
</div>
|
||||
);
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user