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 | |
|---|---|---|---|
|
|
738eb28505 | ||
|
|
5ab1c4ce53 | ||
|
|
c3df0bc688 | ||
|
|
51d1f27a76 | ||
|
|
d7086ce193 | ||
|
|
c74ef5d40a | ||
|
|
4502ad8376 | ||
|
|
07d6988f0d | ||
|
|
ba7b7d0d6b | ||
|
|
ec6f370d8d | ||
|
|
caf497d08f | ||
|
|
9413f20ef6 | ||
|
|
454567dee4 | ||
|
|
827746efd7 | ||
|
|
ee0bf41672 | ||
|
|
6c77d336d9 | ||
|
|
eb338425fe | ||
|
|
64cbf0910a | ||
|
|
aadba9b0e3 | ||
|
|
f8f52b09be | ||
|
|
82711504a4 | ||
|
|
edbbaac5f9 | ||
|
|
1c0b5ed21e | ||
|
|
98356e87ff | ||
|
|
3dcab8767a | ||
|
|
a1d1ca4dc6 | ||
|
|
b880549d59 | ||
|
|
8b922bcfb1 | ||
|
|
04ff6ed768 | ||
|
|
a915a29a0d | ||
|
|
29cb526cd7 | ||
|
|
a0e161ccdd | ||
|
|
0d9dcb1714 | ||
|
|
381b88e9b0 | ||
|
|
411181e6ec | ||
|
|
50aae9408e | ||
|
|
540b31fd02 | ||
|
|
fef1ba1ff3 | ||
|
|
606475c767 | ||
|
|
9d7d70becd | ||
|
|
554dec3bab | ||
|
|
7392bf4590 | ||
|
|
8db3b1f46f | ||
|
|
43d7be5478 | ||
|
|
4458f3dde1 | ||
|
|
76994bd772 | ||
|
|
37506b238f | ||
|
|
aa97310421 | ||
|
|
eb2290a87f | ||
|
|
0754845aff | ||
|
|
0070628fa8 | ||
|
|
85c78e49a9 | ||
|
|
8b1d0224cb | ||
|
|
d3c57f09ea | ||
|
|
f402e87fe0 | ||
|
|
4f1f5fd152 | ||
|
|
b28b394bf8 | ||
|
|
66c3108565 | ||
|
|
fc99a6a436 | ||
|
|
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 | ||
|
|
220d28d3e4 | ||
|
|
0e591ef01c | ||
|
|
e8fa1f168b | ||
|
|
2aaef6564d | ||
|
|
4a69446be1 | ||
|
|
0df2efccd0 | ||
|
|
50863acb1b |
@@ -63,6 +63,7 @@ if (process.env.RUN_ENV === 'DEMO') {
|
||||
'eol-last': 0,
|
||||
'prefer-rest-params': 0,
|
||||
'react/no-multi-comp': 0,
|
||||
'react/prefer-stateless-function': 0,
|
||||
'jsx-a11y/href-no-hash': 0,
|
||||
'import/newline-after-import': 0,
|
||||
});
|
||||
|
||||
4
.github/ISSUE_TEMPLATE.md
vendored
4
.github/ISSUE_TEMPLATE.md
vendored
@@ -1,3 +1,7 @@
|
||||
<!--
|
||||
两会期间,如果遇到官网无法访问,请使用代理或者访问国内镜像 http://ant-design.gitee.io
|
||||
-->
|
||||
|
||||
<!--
|
||||
IMPORTANT: Please use the following link to create a new issue:
|
||||
|
||||
|
||||
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,6 +15,73 @@ timeline: true
|
||||
|
||||
---
|
||||
|
||||
## 3.3.3
|
||||
|
||||
`2018-03-25`
|
||||
|
||||
- Revert Upload `file` type change in previous version which causes breaking change.
|
||||
|
||||
## 3.3.2
|
||||
|
||||
`2018-03-24`
|
||||
|
||||
- 🐞 `Carousel`: Upgrade `react-slick` version to fix width calculation. [#3659](https://github.com/ant-design/ant-design/issues/3659)
|
||||
- 💄 `Rate`: Adjust `disabled` style. [#9747](https://github.com/ant-design/ant-design/issues/9747)
|
||||
- 💄 `Modal`: Adjust `confirm-modal` style to fix multiple line display issue. [#9374](https://github.com/ant-design/ant-design/issues/9374)
|
||||
- 💄 `Menu`: Adjust style to fix mouse trigger event region. [#9666](https://github.com/ant-design/ant-design/pull/9666) [@dgeibi](https://github.com/dgeibi)
|
||||
- 🐞 `Upload`: Fix type of `file` on `beforeUpload` function. [#9775](https://github.com/ant-design/ant-design/issues/9775)
|
||||
- 🐞 `Button`: Fix `two-chinese-words` space not re-calculate when text changed. [4502ad8](https://github.com/ant-design/ant-design/commit/4502ad8376e536c450fa4f27d2a5855be5a153e7)
|
||||
|
||||
## 3.3.1
|
||||
|
||||
`2018-03-18`
|
||||
|
||||
- 💄 Tweak danger button focus style.
|
||||
- 🐞 Fix a show error when the value of enterButton is a button element. [#9639](https://github.com/ant-design/ant-design/issues/9639)
|
||||
- 🐞 Fix missing key of `column.title` in Table .[#9658](https://github.com/ant-design/ant-design/issues/9658) [@terence55](https://github.com/terence55)
|
||||
- 🐞 Fix `scroll: { x: true }` not working if `.ant-table-scroll table` width is `auto`. [#9704](https://github.com/ant-design/ant-design/pull/9704)
|
||||
- 🐞 Fix when the helper message disappears, the input box will shake. [#8831](https://github.com/ant-design/ant-design/issues/8831)
|
||||
- 🐞 Fix isMoment call in `TimePicker` will report error in parcel. [85c78e4](https://github.com/ant-design/ant-design/commit/85c78e49a91737c2841dc42621db21ca248b62b4)
|
||||
- 🐞 Tweak `Table` border radius. [#9674](https://github.com/ant-design/ant-design/pull/9674)
|
||||
## 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`
|
||||
|
||||
@@ -15,6 +15,72 @@ timeline: true
|
||||
|
||||
---
|
||||
|
||||
`2018-03-25`
|
||||
|
||||
- 回退上个版本 Upload 中 `file` 类型的修改。
|
||||
|
||||
## 3.3.2
|
||||
|
||||
`2018-03-24`
|
||||
|
||||
- 🐞 `Carousel`: 升级 `react-slick` 版本以修复宽度计算错误。 [#3659](https://github.com/ant-design/ant-design/issues/3659)
|
||||
- 💄 `Rate`: 调整 `disabled` 样式。 [#9747](https://github.com/ant-design/ant-design/issues/9747)
|
||||
- 💄 `Modal`: 调整 `confirm-modal` 样式以修复标题多行展示问题。 [#9374](https://github.com/ant-design/ant-design/issues/9374)
|
||||
- 💄 `Menu`: 调整样式以修复鼠标事件范围。[#9666](https://github.com/ant-design/ant-design/pull/9666) [@dgeibi](https://github.com/dgeibi)
|
||||
- 🐞 `Upload`: 修复 `beforeUpload` 的 `file` 类型错误。 [#9775](https://github.com/ant-design/ant-design/issues/9775)
|
||||
- 🐞 `Button`: 修复文本改变时,空格插入没有重新计算 [4502ad8](https://github.com/ant-design/ant-design/commit/4502ad8376e536c450fa4f27d2a5855be5a153e7)
|
||||
|
||||
## 3.3.1
|
||||
|
||||
`2018-03-18`
|
||||
|
||||
- 💄 调整 danger Button 的 `focus` 样式。
|
||||
- 🐞 修复 enterButton 的值为 button 元素时显示错误的问题。 [#9639](https://github.com/ant-design/ant-design/issues/9639)
|
||||
- 🐞 修复 Table 中的 `column.title` 的缺少 key 的问题。 [#9658](https://github.com/ant-design/ant-design/issues/9658) [@terence55](https://github.com/terence55)
|
||||
- 🐞 修复 `scroll: { x: true }` 在 `.ant-table-scroll table`宽度为 `auto`的情况下不工作的问题。[#9704](https://github.com/ant-design/ant-design/pull/9704)
|
||||
- 🐞 修复表单校验文字消失的时候输入框会抖一下的问题。 [#8831](https://github.com/ant-design/ant-design/issues/8831)
|
||||
- 🐞 修复 `TimePicker` 里的 isMoment 调用在 parcel 里会报错的问题。[85c78e4](https://github.com/ant-design/ant-design/commit/85c78e49a91737c2841dc42621db21ca248b62b4)
|
||||
- 💄 调整 Table 的圆角样式。 [#9674](https://github.com/ant-design/ant-design/pull/9674)
|
||||
|
||||
## 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`
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
[](https://gemnasium.com/ant-design/ant-design)
|
||||
|
||||
[](https://www.npmjs.org/package/antd)
|
||||
[](https://npmjs.org/package/antd)
|
||||
[](http://www.npmtrends.com/antd)
|
||||
[](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)(中文)
|
||||
@@ -25,7 +25,7 @@
|
||||
- 提炼自企业级中后台产品的交互语言和视觉风格。
|
||||
- 开箱即用的高质量 React 组件。
|
||||
- 使用 TypeScript 构建,提供完整的类型定义文件。
|
||||
- 基于 npm + webpack + [dva](https://github.com/dvajs/dva) 的企业级开发框架。
|
||||
- 全链路开发和设计工具体系。
|
||||
|
||||
## 支持环境
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
[](https://gemnasium.com/ant-design/ant-design)
|
||||
|
||||
[](https://www.npmjs.org/package/antd)
|
||||
[](https://npmjs.org/package/antd)
|
||||
[](http://www.npmtrends.com/antd)
|
||||
[](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.
|
||||
- The whole package of development and design resources and tools.
|
||||
|
||||
## Environment Support
|
||||
|
||||
|
||||
@@ -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[]) => () => {
|
||||
|
||||
@@ -95,6 +95,7 @@ export default class Affix extends React.Component<AffixProps, AffixState> {
|
||||
};
|
||||
|
||||
private fixedNode: HTMLElement;
|
||||
private placeholderNode: HTMLElement;
|
||||
|
||||
setAffixStyle(e: any, affixStyle: React.CSSProperties | null) {
|
||||
const { onChange = noop, target = getDefaultTarget } = this.props;
|
||||
@@ -123,6 +124,21 @@ export default class Affix extends React.Component<AffixProps, AffixState> {
|
||||
this.setState({ placeholderStyle: placeholderStyle as React.CSSProperties });
|
||||
}
|
||||
|
||||
syncPlaceholderStyle(e: any) {
|
||||
const { affixStyle } = this.state;
|
||||
if (!affixStyle) {
|
||||
return;
|
||||
}
|
||||
this.placeholderNode.style.cssText = '';
|
||||
this.setAffixStyle(e, {
|
||||
...affixStyle,
|
||||
width: this.placeholderNode.offsetWidth,
|
||||
});
|
||||
this.setPlaceholderStyle({
|
||||
width: this.placeholderNode.offsetWidth,
|
||||
});
|
||||
}
|
||||
|
||||
@throttleByAnimationFrameDecorator()
|
||||
updatePosition(e: any) {
|
||||
let { offsetTop, offsetBottom, offset, target = getDefaultTarget } = this.props;
|
||||
@@ -194,6 +210,10 @@ export default class Affix extends React.Component<AffixProps, AffixState> {
|
||||
}
|
||||
this.setPlaceholderStyle(null);
|
||||
}
|
||||
|
||||
if (e.type === 'resize') {
|
||||
this.syncPlaceholderStyle(e);
|
||||
}
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
@@ -245,6 +265,10 @@ export default class Affix extends React.Component<AffixProps, AffixState> {
|
||||
this.fixedNode = node;
|
||||
}
|
||||
|
||||
savePlaceholderNode = (node: HTMLDivElement) => {
|
||||
this.placeholderNode = node;
|
||||
}
|
||||
|
||||
render() {
|
||||
const className = classNames({
|
||||
[this.props.prefixCls || 'ant-affix']: this.state.affixStyle,
|
||||
@@ -253,7 +277,7 @@ export default class Affix extends React.Component<AffixProps, AffixState> {
|
||||
const props = omit(this.props, ['prefixCls', 'offsetTop', 'offsetBottom', 'target', 'onChange']);
|
||||
const placeholderStyle = { ...this.state.placeholderStyle, ...this.props.style };
|
||||
return (
|
||||
<div {...props} style={placeholderStyle}>
|
||||
<div {...props} style={placeholderStyle} ref={this.savePlaceholderNode}>
|
||||
<div className={className} ref={this.saveFixedNode} style={this.state.affixStyle}>
|
||||
{this.props.children}
|
||||
</div>
|
||||
|
||||
@@ -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);
|
||||
````
|
||||
@@ -15,6 +15,7 @@ Alert component for feedback.
|
||||
|
||||
| Property | Description | Type | Default |
|
||||
| -------- | ----------- | ---- | ------- |
|
||||
| afterClose | Called when close animation is finished | () => void | - |
|
||||
| banner | Whether to show as banner | boolean | false |
|
||||
| closable | Whether Alert can be closed | boolean | - |
|
||||
| closeText | Close text to show | string\|ReactNode | - |
|
||||
@@ -23,4 +24,4 @@ Alert component for feedback.
|
||||
| showIcon | Whether to show icon | boolean | false, in `banner` mode default is true |
|
||||
| iconType | Icon type, effective when `showIcon` is `true` | string | - |
|
||||
| type | Type of Alert styles, options: `success`, `info`, `warning`, `error` | string | `info`, in `banner` mode default is `warning` |
|
||||
| onClose | Callback when Alert is closed | Function | - |
|
||||
| onClose | Callback when Alert is closed | (e: MouseEvent) => void | - |
|
||||
|
||||
@@ -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?: () => void;
|
||||
/** 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 {
|
||||
|
||||
@@ -16,6 +16,7 @@ title: Alert
|
||||
|
||||
| 参数 | 说明 | 类型 | 默认值 |
|
||||
| --- | --- | --- | --- |
|
||||
| afterClose | 关闭动画结束后的回掉 | () => void | - |
|
||||
| banner | 是否用作顶部公告 | boolean | false |
|
||||
| closable | 默认不显示关闭按钮 | boolean | 无 |
|
||||
| closeText | 自定义关闭按钮 | string\|ReactNode | 无 |
|
||||
@@ -24,4 +25,4 @@ title: Alert
|
||||
| showIcon | 是否显示辅助图标 | boolean | false,`banner` 模式下默认值为 true |
|
||||
| iconType | 自定义图标类型,`showIcon` 为 `true` 时有效 | string | - |
|
||||
| type | 指定警告提示的样式,有四种选择 `success`、`info`、`warning`、`error` | string | `info`,`banner` 模式下默认值为 `warning` |
|
||||
| onClose | 关闭时触发的回调函数 | Function | 无 |
|
||||
| onClose | 关闭时触发的回调函数 | (e: MouseEvent) => void | 无 |
|
||||
|
||||
@@ -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);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -113,7 +113,10 @@
|
||||
top: auto;
|
||||
display: block;
|
||||
position: relative;
|
||||
transform: none !important;
|
||||
}
|
||||
|
||||
&-not-a-wrapper .@{badge-prefix-cls}-count {
|
||||
transform: none;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -28,6 +28,24 @@ describe('Button', () => {
|
||||
expect(wrapper2).toMatchSnapshot();
|
||||
});
|
||||
|
||||
it('renders Chinese characters correctly in HOC', () => {
|
||||
const Text = props => <span>{props.children}</span>;
|
||||
const wrapper = mount(
|
||||
<Button><Text>按钮</Text></Button>
|
||||
);
|
||||
expect(wrapper.find('.ant-btn').hasClass('ant-btn-two-chinese-chars')).toBe(true);
|
||||
wrapper.setProps({
|
||||
children: <Text>大按钮</Text>,
|
||||
});
|
||||
wrapper.update();
|
||||
expect(wrapper.find('.ant-btn').hasClass('ant-btn-two-chinese-chars')).toBe(false);
|
||||
wrapper.setProps({
|
||||
children: <Text>按钮</Text>,
|
||||
});
|
||||
wrapper.update();
|
||||
expect(wrapper.find('.ant-btn').hasClass('ant-btn-two-chinese-chars')).toBe(true);
|
||||
});
|
||||
|
||||
it('have static perperty for type detecting', () => {
|
||||
const wrapper = mount(
|
||||
<Button>Button Text</Button>
|
||||
|
||||
@@ -95,13 +95,7 @@ export default class Button extends React.Component<ButtonProps, any> {
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
// Fix for HOC usage like <FormatMessage />
|
||||
const buttonText = (findDOMNode(this) as HTMLElement).innerText;
|
||||
if (this.isNeedInserted() && isTwoCNChar(buttonText)) {
|
||||
this.setState({
|
||||
hasTwoCNChar: true,
|
||||
});
|
||||
}
|
||||
this.fixTwoCNChar();
|
||||
}
|
||||
|
||||
componentWillReceiveProps(nextProps: ButtonProps) {
|
||||
@@ -119,6 +113,10 @@ export default class Button extends React.Component<ButtonProps, any> {
|
||||
}
|
||||
}
|
||||
|
||||
componentDidUpdate() {
|
||||
this.fixTwoCNChar();
|
||||
}
|
||||
|
||||
componentWillUnmount() {
|
||||
if (this.timeout) {
|
||||
clearTimeout(this.timeout);
|
||||
@@ -128,6 +126,23 @@ export default class Button extends React.Component<ButtonProps, any> {
|
||||
}
|
||||
}
|
||||
|
||||
fixTwoCNChar() {
|
||||
// Fix for HOC usage like <FormatMessage />
|
||||
const node = (findDOMNode(this) as HTMLElement);
|
||||
const buttonText = node.textContent || node.innerText;
|
||||
if (this.isNeedInserted() && isTwoCNChar(buttonText)) {
|
||||
if (!this.state.hasTwoCNChar) {
|
||||
this.setState({
|
||||
hasTwoCNChar: true,
|
||||
});
|
||||
}
|
||||
} else if (this.state.hasTwoCNChar) {
|
||||
this.setState({
|
||||
hasTwoCNChar: false,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
handleClick = (e: React.MouseEvent<HTMLButtonElement>) => {
|
||||
// Add click effect
|
||||
this.setState({ clicked: true });
|
||||
|
||||
@@ -54,11 +54,14 @@
|
||||
.button-variant-danger(@color; @background; @border) {
|
||||
.button-color(@color; @background; @border);
|
||||
|
||||
&:hover,
|
||||
&:focus {
|
||||
&:hover {
|
||||
.button-color(@btn-primary-color; ~`colorPalette("@{color}", 5)`; ~`colorPalette("@{color}", 5)`);
|
||||
}
|
||||
|
||||
&:focus {
|
||||
.button-color(~`colorPalette("@{color}", 5)`; #fff; ~`colorPalette("@{color}", 5)`);
|
||||
}
|
||||
|
||||
&:active,
|
||||
&.active {
|
||||
.button-color(@btn-primary-color; ~`colorPalette("@{color}", 7)`; ~`colorPalette("@{color}", 7)`);
|
||||
@@ -108,6 +111,7 @@
|
||||
display: inline-block;
|
||||
> .@{btnClassName} {
|
||||
position: relative;
|
||||
line-height: @btn-height-base - 2px;
|
||||
|
||||
&:hover,
|
||||
&:focus,
|
||||
@@ -124,10 +128,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;
|
||||
}
|
||||
@@ -199,6 +205,7 @@
|
||||
&:active,
|
||||
&.active {
|
||||
background: @btn-default-bg;
|
||||
text-decoration: none;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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 | - |
|
||||
|
||||
@@ -6,6 +6,7 @@ exports[`renders ./components/carousel/demo/autoplay.md correctly 1`] = `
|
||||
>
|
||||
<div
|
||||
class="slick-initialized slick-slider"
|
||||
dir="ltr"
|
||||
>
|
||||
<div
|
||||
class="slick-list"
|
||||
@@ -16,13 +17,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 +66,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 +75,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 +84,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 +93,7 @@ exports[`renders ./components/carousel/demo/autoplay.md correctly 1`] = `
|
||||
<div
|
||||
class="slick-slide slick-cloned"
|
||||
data-index="7"
|
||||
tabindex="-1"
|
||||
>
|
||||
<h3>
|
||||
4
|
||||
@@ -105,6 +111,7 @@ exports[`renders ./components/carousel/demo/basic.md correctly 1`] = `
|
||||
>
|
||||
<div
|
||||
class="slick-initialized slick-slider"
|
||||
dir="ltr"
|
||||
>
|
||||
<div
|
||||
class="slick-list"
|
||||
@@ -115,13 +122,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 +171,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 +180,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 +189,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 +198,7 @@ exports[`renders ./components/carousel/demo/basic.md correctly 1`] = `
|
||||
<div
|
||||
class="slick-slide slick-cloned"
|
||||
data-index="7"
|
||||
tabindex="-1"
|
||||
>
|
||||
<h3>
|
||||
4
|
||||
@@ -204,6 +216,7 @@ exports[`renders ./components/carousel/demo/fade.md correctly 1`] = `
|
||||
>
|
||||
<div
|
||||
class="slick-initialized slick-slider"
|
||||
dir="ltr"
|
||||
>
|
||||
<div
|
||||
class="slick-list"
|
||||
@@ -212,9 +225,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 +237,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 +247,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 +257,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>
|
||||
@@ -263,6 +276,7 @@ exports[`renders ./components/carousel/demo/vertical.md correctly 1`] = `
|
||||
>
|
||||
<div
|
||||
class="slick-initialized slick-slider slick-vertical"
|
||||
dir="ltr"
|
||||
>
|
||||
<div
|
||||
class="slick-list"
|
||||
@@ -273,13 +287,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 +336,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 +345,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 +354,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 +363,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
|
||||
|
||||
@@ -214,3 +214,29 @@ exports[`Cascader popup correctly with defaultValue 1`] = `
|
||||
</div>
|
||||
</div>
|
||||
`;
|
||||
|
||||
exports[`Cascader support controlled mode 1`] = `
|
||||
<span
|
||||
class="ant-cascader-picker"
|
||||
tabindex="0"
|
||||
>
|
||||
<span
|
||||
class="ant-cascader-picker-label"
|
||||
>
|
||||
Zhejiang / Hangzhou / West Lake
|
||||
</span>
|
||||
<input
|
||||
autocomplete="off"
|
||||
class="ant-input ant-cascader-input "
|
||||
readonly=""
|
||||
type="text"
|
||||
value=""
|
||||
/>
|
||||
<i
|
||||
class="anticon anticon-cross-circle ant-cascader-picker-clear"
|
||||
/>
|
||||
<i
|
||||
class="anticon anticon-down ant-cascader-picker-arrow"
|
||||
/>
|
||||
</span>
|
||||
`;
|
||||
|
||||
@@ -46,6 +46,16 @@ describe('Cascader', () => {
|
||||
expect(render(wrapper.find('Trigger').instance().getComponent())).toMatchSnapshot();
|
||||
});
|
||||
|
||||
it('support controlled mode', () => {
|
||||
const wrapper = mount(
|
||||
<Cascader options={options} />
|
||||
);
|
||||
wrapper.setProps({
|
||||
value: ['zhejiang', 'hangzhou', 'xihu'],
|
||||
});
|
||||
expect(wrapper.render()).toMatchSnapshot();
|
||||
});
|
||||
|
||||
it('popup correctly with defaultValue', () => {
|
||||
const wrapper = mount(
|
||||
<Cascader options={options} defaultValue={['zhejiang', 'hangzhou']} />
|
||||
|
||||
@@ -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,14 +5,14 @@ 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>;
|
||||
@@ -23,10 +23,21 @@ export interface AbstractCheckboxProps {
|
||||
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: [],
|
||||
};
|
||||
|
||||
@@ -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(moment('2016-11-22'));
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -56,6 +56,8 @@ export default class FormItem extends React.Component<FormItemProps, any> {
|
||||
|
||||
context: FormItemContext;
|
||||
|
||||
state = { helpShow: false };
|
||||
|
||||
componentDidMount() {
|
||||
warning(
|
||||
this.getControls(this.props.children, true).length <= 1,
|
||||
@@ -89,7 +91,7 @@ export default class FormItem extends React.Component<FormItemProps, any> {
|
||||
|
||||
const child = childrenArray[i] as React.ReactElement<any>;
|
||||
if (child.type &&
|
||||
(child.type as any === FormItem || (child.type as any).displayName === 'FormItem')) {
|
||||
(child.type as any === FormItem || (child.type as any).displayName === 'FormItem')) {
|
||||
continue;
|
||||
}
|
||||
if (!child.props) {
|
||||
@@ -126,6 +128,10 @@ export default class FormItem extends React.Component<FormItemProps, any> {
|
||||
return this.getChildProp(FIELD_DATA_PROP);
|
||||
}
|
||||
|
||||
onHelpAnimEnd = (_key: string, helpShow: boolean) => {
|
||||
this.setState({ helpShow });
|
||||
}
|
||||
|
||||
renderHelp() {
|
||||
const prefixCls = this.props.prefixCls;
|
||||
const help = this.getHelpMsg();
|
||||
@@ -135,7 +141,13 @@ export default class FormItem extends React.Component<FormItemProps, any> {
|
||||
</div>
|
||||
) : null;
|
||||
return (
|
||||
<Animate transitionName="show-help" component="" transitionAppear key="help">
|
||||
<Animate
|
||||
transitionName="show-help"
|
||||
component=""
|
||||
transitionAppear
|
||||
key="help"
|
||||
onEnd={this.onHelpAnimEnd}
|
||||
>
|
||||
{children}
|
||||
</Animate>
|
||||
);
|
||||
@@ -298,7 +310,7 @@ export default class FormItem extends React.Component<FormItemProps, any> {
|
||||
const style = props.style;
|
||||
const itemClassName = {
|
||||
[`${prefixCls}-item`]: true,
|
||||
[`${prefixCls}-item-with-help`]: !!this.getHelpMsg(),
|
||||
[`${prefixCls}-item-with-help`]: !!this.getHelpMsg() || this.state.helpShow,
|
||||
[`${prefixCls}-item-no-colon`]: !props.colon,
|
||||
[`${props.className}`]: !!props.className,
|
||||
};
|
||||
|
||||
@@ -2503,7 +2503,7 @@ exports[`renders ./components/form/demo/validate-other.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"
|
||||
|
||||
@@ -107,8 +107,8 @@ ReactDOM.render(
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.ant-advanced-search-form .ant-form-item-label {
|
||||
overflow: visible;
|
||||
.ant-advanced-search-form .ant-form-item-control-wrapper {
|
||||
flex: 1;
|
||||
}
|
||||
````
|
||||
|
||||
|
||||
@@ -18,41 +18,43 @@ import { Button, Modal, Form, Input, Radio } from 'antd';
|
||||
const FormItem = Form.Item;
|
||||
|
||||
const CollectionCreateForm = Form.create()(
|
||||
(props) => {
|
||||
const { visible, onCancel, onCreate, form } = props;
|
||||
const { getFieldDecorator } = form;
|
||||
return (
|
||||
<Modal
|
||||
visible={visible}
|
||||
title="Create a new collection"
|
||||
okText="Create"
|
||||
onCancel={onCancel}
|
||||
onOk={onCreate}
|
||||
>
|
||||
<Form layout="vertical">
|
||||
<FormItem label="Title">
|
||||
{getFieldDecorator('title', {
|
||||
rules: [{ required: true, message: 'Please input the title of collection!' }],
|
||||
})(
|
||||
<Input />
|
||||
)}
|
||||
</FormItem>
|
||||
<FormItem label="Description">
|
||||
{getFieldDecorator('description')(<Input type="textarea" />)}
|
||||
</FormItem>
|
||||
<FormItem className="collection-create-form_last-form-item">
|
||||
{getFieldDecorator('modifier', {
|
||||
initialValue: 'public',
|
||||
})(
|
||||
<Radio.Group>
|
||||
<Radio value="public">Public</Radio>
|
||||
<Radio value="private">Private</Radio>
|
||||
</Radio.Group>
|
||||
)}
|
||||
</FormItem>
|
||||
</Form>
|
||||
</Modal>
|
||||
);
|
||||
class extends React.Component {
|
||||
render() {
|
||||
const { visible, onCancel, onCreate, form } = this.props;
|
||||
const { getFieldDecorator } = form;
|
||||
return (
|
||||
<Modal
|
||||
visible={visible}
|
||||
title="Create a new collection"
|
||||
okText="Create"
|
||||
onCancel={onCancel}
|
||||
onOk={onCreate}
|
||||
>
|
||||
<Form layout="vertical">
|
||||
<FormItem label="Title">
|
||||
{getFieldDecorator('title', {
|
||||
rules: [{ required: true, message: 'Please input the title of collection!' }],
|
||||
})(
|
||||
<Input />
|
||||
)}
|
||||
</FormItem>
|
||||
<FormItem label="Description">
|
||||
{getFieldDecorator('description')(<Input type="textarea" />)}
|
||||
</FormItem>
|
||||
<FormItem className="collection-create-form_last-form-item">
|
||||
{getFieldDecorator('modifier', {
|
||||
initialValue: 'public',
|
||||
})(
|
||||
<Radio.Group>
|
||||
<Radio value="public">Public</Radio>
|
||||
<Radio value="private">Private</Radio>
|
||||
</Radio.Group>
|
||||
)}
|
||||
</FormItem>
|
||||
</Form>
|
||||
</Modal>
|
||||
);
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
@@ -67,7 +69,7 @@ class CollectionsPage extends React.Component {
|
||||
this.setState({ visible: false });
|
||||
}
|
||||
handleCreate = () => {
|
||||
const form = this.form;
|
||||
const form = this.formRef.props.form;
|
||||
form.validateFields((err, values) => {
|
||||
if (err) {
|
||||
return;
|
||||
@@ -78,15 +80,15 @@ class CollectionsPage extends React.Component {
|
||||
this.setState({ visible: false });
|
||||
});
|
||||
}
|
||||
saveFormRef = (form) => {
|
||||
this.form = form;
|
||||
saveFormRef = (formRef) => {
|
||||
this.formRef = formRef;
|
||||
}
|
||||
render() {
|
||||
return (
|
||||
<div>
|
||||
<Button type="primary" onClick={this.showModal}>New Collection</Button>
|
||||
<CollectionCreateForm
|
||||
ref={this.saveFormRef}
|
||||
wrappedComponentRef={this.saveFormRef}
|
||||
visible={this.state.visible}
|
||||
onCancel={this.handleCancel}
|
||||
onCreate={this.handleCreate}
|
||||
|
||||
@@ -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} />
|
||||
|
||||
@@ -73,7 +73,6 @@ input[type="checkbox"] {
|
||||
.reset-component;
|
||||
margin-bottom: @form-item-margin-bottom;
|
||||
vertical-align: top;
|
||||
transition: margin .15s steps(1);
|
||||
|
||||
// nested FormItem
|
||||
&-control > &:last-child,
|
||||
@@ -93,7 +92,6 @@ input[type="checkbox"] {
|
||||
|
||||
&-with-help {
|
||||
margin-bottom: @form-item-margin-bottom - @font-size-base * @line-height-base - @form-help-margin-top;
|
||||
transition: none;
|
||||
}
|
||||
|
||||
&-label {
|
||||
@@ -375,7 +373,7 @@ form {
|
||||
margin-bottom: 24px;
|
||||
}
|
||||
|
||||
> div {
|
||||
> .@{form-prefix-cls}-item-control-wrapper, > .@{form-prefix-cls}-item-label {
|
||||
display: inline-block;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
4
components/input-number/__tests__/index.test.js
Normal file
4
components/input-number/__tests__/index.test.js
Normal file
@@ -0,0 +1,4 @@
|
||||
import InputNumber from '..';
|
||||
import focusTest from '../../../tests/shared/focusTest';
|
||||
|
||||
focusTest(InputNumber);
|
||||
@@ -39,21 +39,38 @@ export default class Search extends React.Component<SearchProps, any> {
|
||||
this.input = node;
|
||||
}
|
||||
|
||||
getButtonOrIcon() {
|
||||
const { enterButton, prefixCls, size } = this.props;
|
||||
if (!enterButton) {
|
||||
return <Icon className={`${prefixCls}-icon`} type="search" key="searchIcon" />;
|
||||
}
|
||||
const enterButtonAsElement = enterButton as React.ReactElement<any>;
|
||||
if (enterButtonAsElement.type === Button || enterButtonAsElement.type === 'button') {
|
||||
return React.cloneElement(enterButtonAsElement, enterButtonAsElement.type === Button ? {
|
||||
className: `${prefixCls}-button`,
|
||||
size,
|
||||
onClick: this.onSearch,
|
||||
} : {
|
||||
onClick: this.onSearch,
|
||||
});
|
||||
}
|
||||
return (
|
||||
<Button
|
||||
className={`${prefixCls}-button`}
|
||||
type="primary"
|
||||
size={size}
|
||||
onClick={this.onSearch}
|
||||
key="enterButton"
|
||||
>
|
||||
{enterButton === true ? <Icon type="search" /> : enterButton}
|
||||
</Button>
|
||||
);
|
||||
}
|
||||
|
||||
render() {
|
||||
const { className, prefixCls, inputPrefixCls, size, enterButton, suffix, ...others } = this.props;
|
||||
const { className, prefixCls, inputPrefixCls, size, suffix, enterButton, ...others } = this.props;
|
||||
delete (others as any).onSearch;
|
||||
const buttonOrIcon = enterButton
|
||||
? (
|
||||
<Button
|
||||
className={`${prefixCls}-button`}
|
||||
type="primary"
|
||||
size={size}
|
||||
onClick={this.onSearch}
|
||||
key="enterButton"
|
||||
>
|
||||
{enterButton === true ? <Icon type="search" /> : enterButton}
|
||||
</Button>
|
||||
) : <Icon className={`${prefixCls}-icon`} type="search" key="searchIcon" />;
|
||||
const buttonOrIcon = this.getButtonOrIcon();
|
||||
const searchSuffix = suffix ? [suffix, buttonOrIcon] : buttonOrIcon;
|
||||
const inputClassName = classNames(prefixCls, className, {
|
||||
[`${prefixCls}-enter-button`]: !!enterButton,
|
||||
|
||||
@@ -1,6 +1,23 @@
|
||||
import React from 'react';
|
||||
import { mount } from 'enzyme';
|
||||
import Search from '../Search';
|
||||
import Button from '../../button';
|
||||
import focusTest from '../../../tests/shared/focusTest';
|
||||
|
||||
describe('Input.Search', () => {
|
||||
focusTest(Search);
|
||||
|
||||
it('should support custom button', () => {
|
||||
const wrapper = mount(
|
||||
<Search enterButton={<button>ok</button>} />
|
||||
);
|
||||
expect(wrapper.render()).toMatchSnapshot();
|
||||
});
|
||||
|
||||
it('should support custom Button', () => {
|
||||
const wrapper = mount(
|
||||
<Search enterButton={<Button>ok</Button>} />
|
||||
);
|
||||
expect(wrapper.render()).toMatchSnapshot();
|
||||
});
|
||||
});
|
||||
|
||||
42
components/input/__tests__/__snapshots__/Search.test.js.snap
Normal file
42
components/input/__tests__/__snapshots__/Search.test.js.snap
Normal file
@@ -0,0 +1,42 @@
|
||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`Input.Search should support custom Button 1`] = `
|
||||
<span
|
||||
class="ant-input-search ant-input-search-enter-button ant-input-affix-wrapper"
|
||||
>
|
||||
<input
|
||||
class="ant-input"
|
||||
type="text"
|
||||
/>
|
||||
<span
|
||||
class="ant-input-suffix"
|
||||
>
|
||||
<button
|
||||
class="ant-btn ant-input-search-button"
|
||||
type="button"
|
||||
>
|
||||
<span>
|
||||
ok
|
||||
</span>
|
||||
</button>
|
||||
</span>
|
||||
</span>
|
||||
`;
|
||||
|
||||
exports[`Input.Search should support custom button 1`] = `
|
||||
<span
|
||||
class="ant-input-search ant-input-search-enter-button ant-input-affix-wrapper"
|
||||
>
|
||||
<input
|
||||
class="ant-input"
|
||||
type="text"
|
||||
/>
|
||||
<span
|
||||
class="ant-input-suffix"
|
||||
>
|
||||
<button>
|
||||
ok
|
||||
</button>
|
||||
</span>
|
||||
</span>
|
||||
`;
|
||||
@@ -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}>
|
||||
|
||||
@@ -327,6 +327,9 @@
|
||||
z-index: 2;
|
||||
line-height: 0;
|
||||
color: @input-color;
|
||||
:not(.anticon) {
|
||||
line-height: @line-height-base;
|
||||
}
|
||||
}
|
||||
|
||||
.@{inputClass}-prefix {
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -1396,7 +1396,6 @@ exports[`renders ./components/list/demo/vertical.md correctly 1`] = `
|
||||
<li
|
||||
aria-disabled="true"
|
||||
class="ant-pagination-disabled ant-pagination-prev"
|
||||
tabindex="0"
|
||||
title="Previous Page"
|
||||
>
|
||||
<a
|
||||
@@ -1415,7 +1414,6 @@ exports[`renders ./components/list/demo/vertical.md correctly 1`] = `
|
||||
<li
|
||||
aria-disabled="true"
|
||||
class="ant-pagination-disabled ant-pagination-next"
|
||||
tabindex="0"
|
||||
title="Next Page"
|
||||
>
|
||||
<a
|
||||
|
||||
@@ -66,7 +66,6 @@ exports[`renders ./components/locale-provider/demo/all.md correctly 1`] = `
|
||||
<li
|
||||
aria-disabled="true"
|
||||
class="ant-pagination-disabled ant-pagination-prev"
|
||||
tabindex="0"
|
||||
title="Previous Page"
|
||||
>
|
||||
<a
|
||||
@@ -1554,7 +1553,6 @@ exports[`renders ./components/locale-provider/demo/basic.md correctly 1`] = `
|
||||
<li
|
||||
aria-disabled="true"
|
||||
class="ant-pagination-disabled ant-pagination-prev"
|
||||
tabindex="0"
|
||||
title="Previous Page"
|
||||
>
|
||||
<a
|
||||
|
||||
@@ -2394,7 +2394,6 @@ exports[`Locale Provider should display the text as ar 1`] = `
|
||||
<li
|
||||
aria-disabled="true"
|
||||
class="ant-pagination-disabled ant-pagination-prev"
|
||||
tabindex="0"
|
||||
title="الصفحة السابقة"
|
||||
>
|
||||
<a
|
||||
@@ -5703,6 +5702,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 +5789,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"
|
||||
@@ -6990,7 +6991,6 @@ exports[`Locale Provider should display the text as bg 1`] = `
|
||||
<li
|
||||
aria-disabled="true"
|
||||
class="ant-pagination-disabled ant-pagination-prev"
|
||||
tabindex="0"
|
||||
title="Предишна страница"
|
||||
>
|
||||
<a
|
||||
@@ -10299,6 +10299,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 +10386,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"
|
||||
@@ -11586,7 +11588,6 @@ exports[`Locale Provider should display the text as ca 1`] = `
|
||||
<li
|
||||
aria-disabled="true"
|
||||
class="ant-pagination-disabled ant-pagination-prev"
|
||||
tabindex="0"
|
||||
title="Pàgina prèvia"
|
||||
>
|
||||
<a
|
||||
@@ -14895,6 +14896,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 +14983,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"
|
||||
@@ -16182,7 +16185,6 @@ exports[`Locale Provider should display the text as cs 1`] = `
|
||||
<li
|
||||
aria-disabled="true"
|
||||
class="ant-pagination-disabled ant-pagination-prev"
|
||||
tabindex="0"
|
||||
title="Předchozí strana"
|
||||
>
|
||||
<a
|
||||
@@ -19491,6 +19493,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 +19580,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"
|
||||
@@ -20778,7 +20782,6 @@ exports[`Locale Provider should display the text as de 1`] = `
|
||||
<li
|
||||
aria-disabled="true"
|
||||
class="ant-pagination-disabled ant-pagination-prev"
|
||||
tabindex="0"
|
||||
title="Vorherige Seite"
|
||||
>
|
||||
<a
|
||||
@@ -24087,6 +24090,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 +24177,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"
|
||||
@@ -25374,7 +25379,6 @@ exports[`Locale Provider should display the text as el 1`] = `
|
||||
<li
|
||||
aria-disabled="true"
|
||||
class="ant-pagination-disabled ant-pagination-prev"
|
||||
tabindex="0"
|
||||
title="Προηγούμενη Σελίδα"
|
||||
>
|
||||
<a
|
||||
@@ -28683,6 +28687,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 +28774,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"
|
||||
@@ -29970,7 +29976,6 @@ exports[`Locale Provider should display the text as en 1`] = `
|
||||
<li
|
||||
aria-disabled="true"
|
||||
class="ant-pagination-disabled ant-pagination-prev"
|
||||
tabindex="0"
|
||||
title="Previous Page"
|
||||
>
|
||||
<a
|
||||
@@ -33279,6 +33284,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 +33371,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"
|
||||
@@ -34566,7 +34573,6 @@ exports[`Locale Provider should display the text as en-gb 1`] = `
|
||||
<li
|
||||
aria-disabled="true"
|
||||
class="ant-pagination-disabled ant-pagination-prev"
|
||||
tabindex="0"
|
||||
title="Previous Page"
|
||||
>
|
||||
<a
|
||||
@@ -37875,6 +37881,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 +37968,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"
|
||||
@@ -39162,7 +39170,6 @@ exports[`Locale Provider should display the text as es 1`] = `
|
||||
<li
|
||||
aria-disabled="true"
|
||||
class="ant-pagination-disabled ant-pagination-prev"
|
||||
tabindex="0"
|
||||
title="Página anterior"
|
||||
>
|
||||
<a
|
||||
@@ -42471,6 +42478,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 +42565,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"
|
||||
@@ -43758,7 +43767,6 @@ exports[`Locale Provider should display the text as et 1`] = `
|
||||
<li
|
||||
aria-disabled="true"
|
||||
class="ant-pagination-disabled ant-pagination-prev"
|
||||
tabindex="0"
|
||||
title="Eelmine leht"
|
||||
>
|
||||
<a
|
||||
@@ -47067,6 +47075,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 +47162,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"
|
||||
@@ -48354,7 +48364,6 @@ exports[`Locale Provider should display the text as fa 1`] = `
|
||||
<li
|
||||
aria-disabled="true"
|
||||
class="ant-pagination-disabled ant-pagination-prev"
|
||||
tabindex="0"
|
||||
title="صفحه قبلی"
|
||||
>
|
||||
<a
|
||||
@@ -51663,6 +51672,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 +51759,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"
|
||||
@@ -52950,7 +52961,6 @@ exports[`Locale Provider should display the text as fi 1`] = `
|
||||
<li
|
||||
aria-disabled="true"
|
||||
class="ant-pagination-disabled ant-pagination-prev"
|
||||
tabindex="0"
|
||||
title="Edellinen sivu"
|
||||
>
|
||||
<a
|
||||
@@ -56259,6 +56269,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 +56356,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"
|
||||
@@ -57546,7 +57558,6 @@ exports[`Locale Provider should display the text as fr 1`] = `
|
||||
<li
|
||||
aria-disabled="true"
|
||||
class="ant-pagination-disabled ant-pagination-prev"
|
||||
tabindex="0"
|
||||
title="Page précédente"
|
||||
>
|
||||
<a
|
||||
@@ -60855,6 +60866,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 +60953,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"
|
||||
@@ -62142,7 +62155,6 @@ exports[`Locale Provider should display the text as fr 2`] = `
|
||||
<li
|
||||
aria-disabled="true"
|
||||
class="ant-pagination-disabled ant-pagination-prev"
|
||||
tabindex="0"
|
||||
title="Page précédente"
|
||||
>
|
||||
<a
|
||||
@@ -65451,6 +65463,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 +65550,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"
|
||||
@@ -66738,7 +66752,6 @@ exports[`Locale Provider should display the text as is 1`] = `
|
||||
<li
|
||||
aria-disabled="true"
|
||||
class="ant-pagination-disabled ant-pagination-prev"
|
||||
tabindex="0"
|
||||
title="Fyrri síða"
|
||||
>
|
||||
<a
|
||||
@@ -70047,6 +70060,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 +70147,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"
|
||||
@@ -71334,7 +71349,6 @@ exports[`Locale Provider should display the text as it 1`] = `
|
||||
<li
|
||||
aria-disabled="true"
|
||||
class="ant-pagination-disabled ant-pagination-prev"
|
||||
tabindex="0"
|
||||
title="Pagina precedente"
|
||||
>
|
||||
<a
|
||||
@@ -74643,6 +74657,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 +74744,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"
|
||||
@@ -75930,7 +75946,6 @@ exports[`Locale Provider should display the text as ja 1`] = `
|
||||
<li
|
||||
aria-disabled="true"
|
||||
class="ant-pagination-disabled ant-pagination-prev"
|
||||
tabindex="0"
|
||||
title="前のページ"
|
||||
>
|
||||
<a
|
||||
@@ -79239,6 +79254,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 +79341,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"
|
||||
@@ -80526,7 +80543,6 @@ exports[`Locale Provider should display the text as ko 1`] = `
|
||||
<li
|
||||
aria-disabled="true"
|
||||
class="ant-pagination-disabled ant-pagination-prev"
|
||||
tabindex="0"
|
||||
title="이전 페이지"
|
||||
>
|
||||
<a
|
||||
@@ -83835,6 +83851,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 +83938,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"
|
||||
@@ -85122,7 +85140,6 @@ exports[`Locale Provider should display the text as ku-iq 1`] = `
|
||||
<li
|
||||
aria-disabled="true"
|
||||
class="ant-pagination-disabled ant-pagination-prev"
|
||||
tabindex="0"
|
||||
title="Rûpelê Pêş"
|
||||
>
|
||||
<a
|
||||
@@ -88431,6 +88448,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 +88535,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"
|
||||
@@ -89718,7 +89737,6 @@ exports[`Locale Provider should display the text as nb 1`] = `
|
||||
<li
|
||||
aria-disabled="true"
|
||||
class="ant-pagination-disabled ant-pagination-prev"
|
||||
tabindex="0"
|
||||
title="Forrige side"
|
||||
>
|
||||
<a
|
||||
@@ -93027,6 +93045,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 +93132,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"
|
||||
@@ -94314,7 +94334,6 @@ exports[`Locale Provider should display the text as nl 1`] = `
|
||||
<li
|
||||
aria-disabled="true"
|
||||
class="ant-pagination-disabled ant-pagination-prev"
|
||||
tabindex="0"
|
||||
title="Vorige pagina"
|
||||
>
|
||||
<a
|
||||
@@ -97623,6 +97642,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 +97729,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"
|
||||
@@ -98910,7 +98931,6 @@ exports[`Locale Provider should display the text as nl-be 1`] = `
|
||||
<li
|
||||
aria-disabled="true"
|
||||
class="ant-pagination-disabled ant-pagination-prev"
|
||||
tabindex="0"
|
||||
title="Vorige pagina"
|
||||
>
|
||||
<a
|
||||
@@ -102219,6 +102239,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 +102326,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"
|
||||
@@ -103506,7 +103528,6 @@ exports[`Locale Provider should display the text as pl 1`] = `
|
||||
<li
|
||||
aria-disabled="true"
|
||||
class="ant-pagination-disabled ant-pagination-prev"
|
||||
tabindex="0"
|
||||
title="Poprzednia strona"
|
||||
>
|
||||
<a
|
||||
@@ -106815,6 +106836,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 +106923,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"
|
||||
@@ -108102,7 +108125,6 @@ exports[`Locale Provider should display the text as pt 1`] = `
|
||||
<li
|
||||
aria-disabled="true"
|
||||
class="ant-pagination-disabled ant-pagination-prev"
|
||||
tabindex="0"
|
||||
title="Página Anterior"
|
||||
>
|
||||
<a
|
||||
@@ -111411,6 +111433,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 +111520,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"
|
||||
@@ -112698,7 +112722,6 @@ exports[`Locale Provider should display the text as pt-br 1`] = `
|
||||
<li
|
||||
aria-disabled="true"
|
||||
class="ant-pagination-disabled ant-pagination-prev"
|
||||
tabindex="0"
|
||||
title="Página anterior"
|
||||
>
|
||||
<a
|
||||
@@ -116007,6 +116030,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 +116117,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"
|
||||
@@ -117294,7 +117319,6 @@ exports[`Locale Provider should display the text as ru 1`] = `
|
||||
<li
|
||||
aria-disabled="true"
|
||||
class="ant-pagination-disabled ant-pagination-prev"
|
||||
tabindex="0"
|
||||
title="Назад"
|
||||
>
|
||||
<a
|
||||
@@ -120603,6 +120627,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 +120714,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"
|
||||
@@ -121890,7 +121916,6 @@ exports[`Locale Provider should display the text as sk 1`] = `
|
||||
<li
|
||||
aria-disabled="true"
|
||||
class="ant-pagination-disabled ant-pagination-prev"
|
||||
tabindex="0"
|
||||
title="Predchádzajúca strana"
|
||||
>
|
||||
<a
|
||||
@@ -125199,6 +125224,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 +125311,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"
|
||||
@@ -126486,7 +126513,6 @@ exports[`Locale Provider should display the text as sr 1`] = `
|
||||
<li
|
||||
aria-disabled="true"
|
||||
class="ant-pagination-disabled ant-pagination-prev"
|
||||
tabindex="0"
|
||||
title="Prethodna strana"
|
||||
>
|
||||
<a
|
||||
@@ -129795,6 +129821,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 +129908,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"
|
||||
@@ -131082,7 +131110,6 @@ exports[`Locale Provider should display the text as sv 1`] = `
|
||||
<li
|
||||
aria-disabled="true"
|
||||
class="ant-pagination-disabled ant-pagination-prev"
|
||||
tabindex="0"
|
||||
title="Föreg sida"
|
||||
>
|
||||
<a
|
||||
@@ -134391,6 +134418,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 +134505,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"
|
||||
@@ -135678,7 +135707,6 @@ exports[`Locale Provider should display the text as th 1`] = `
|
||||
<li
|
||||
aria-disabled="true"
|
||||
class="ant-pagination-disabled ant-pagination-prev"
|
||||
tabindex="0"
|
||||
title="หน้าก่อนหน้า"
|
||||
>
|
||||
<a
|
||||
@@ -138987,6 +139015,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 +139102,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"
|
||||
@@ -140274,8 +140304,7 @@ exports[`Locale Provider should display the text as tr 1`] = `
|
||||
<li
|
||||
aria-disabled="true"
|
||||
class="ant-pagination-disabled ant-pagination-prev"
|
||||
tabindex="0"
|
||||
title="Previous Page"
|
||||
title="Önceki Sayfa"
|
||||
>
|
||||
<a
|
||||
class="ant-pagination-item-link"
|
||||
@@ -140330,7 +140359,7 @@ exports[`Locale Provider should display the text as tr 1`] = `
|
||||
aria-disabled="false"
|
||||
class=" ant-pagination-next"
|
||||
tabindex="0"
|
||||
title="Next Page"
|
||||
title="Sonraki Sayfa"
|
||||
>
|
||||
<a
|
||||
class="ant-pagination-item-link"
|
||||
@@ -140357,9 +140386,9 @@ exports[`Locale Provider should display the text as tr 1`] = `
|
||||
<div
|
||||
class="ant-select-selection-selected-value"
|
||||
style="display: block; opacity: 1;"
|
||||
title="10 / page"
|
||||
title="10 / sayfa"
|
||||
>
|
||||
10 / page
|
||||
10 / sayfa
|
||||
</div>
|
||||
</div>
|
||||
<span
|
||||
@@ -140459,7 +140488,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 +140503,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 +140516,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 +141222,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 +142088,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 +142101,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 +142826,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 +143612,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 +143699,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 +143837,7 @@ exports[`Locale Provider should display the text as tr 1`] = `
|
||||
/>
|
||||
</span>
|
||||
<span>
|
||||
Month
|
||||
Ay
|
||||
</span>
|
||||
</label>
|
||||
<label
|
||||
@@ -143825,7 +143856,7 @@ exports[`Locale Provider should display the text as tr 1`] = `
|
||||
/>
|
||||
</span>
|
||||
<span>
|
||||
Year
|
||||
Yıl
|
||||
</span>
|
||||
</label>
|
||||
</div>
|
||||
@@ -144870,7 +144901,6 @@ exports[`Locale Provider should display the text as uk 1`] = `
|
||||
<li
|
||||
aria-disabled="true"
|
||||
class="ant-pagination-disabled ant-pagination-prev"
|
||||
tabindex="0"
|
||||
title="Попередня сторінка"
|
||||
>
|
||||
<a
|
||||
@@ -148179,6 +148209,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 +148296,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"
|
||||
@@ -149466,7 +149498,6 @@ exports[`Locale Provider should display the text as vi 1`] = `
|
||||
<li
|
||||
aria-disabled="true"
|
||||
class="ant-pagination-disabled ant-pagination-prev"
|
||||
tabindex="0"
|
||||
title="Trang Trước"
|
||||
>
|
||||
<a
|
||||
@@ -152775,6 +152806,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 +152893,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"
|
||||
@@ -154062,7 +154095,6 @@ exports[`Locale Provider should display the text as zh-cn 1`] = `
|
||||
<li
|
||||
aria-disabled="true"
|
||||
class="ant-pagination-disabled ant-pagination-prev"
|
||||
tabindex="0"
|
||||
title="上一页"
|
||||
>
|
||||
<a
|
||||
@@ -157371,6 +157403,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 +157490,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"
|
||||
@@ -158658,7 +158692,6 @@ exports[`Locale Provider should display the text as zh-tw 1`] = `
|
||||
<li
|
||||
aria-disabled="true"
|
||||
class="ant-pagination-disabled ant-pagination-prev"
|
||||
tabindex="0"
|
||||
title="上一頁"
|
||||
>
|
||||
<a
|
||||
@@ -161967,6 +162000,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 +162087,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"
|
||||
|
||||
@@ -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(() => {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import Pagination from 'rc-pagination/lib/locale/en_US';
|
||||
import Pagination from 'rc-pagination/lib/locale/tr_TR';
|
||||
import DatePicker from '../date-picker/locale/tr_TR';
|
||||
import TimePicker from '../time-picker/locale/tr_TR';
|
||||
import Calendar from '../calendar/locale/tr_TR';
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -18,13 +18,17 @@ class MenuItem extends React.Component<any, any> {
|
||||
render() {
|
||||
const { inlineCollapsed } = this.context;
|
||||
const props = this.props;
|
||||
return <Tooltip
|
||||
title={inlineCollapsed && props.level === 1 ? props.children : ''}
|
||||
placement="right"
|
||||
overlayClassName={`${props.rootPrefixCls}-inline-collapsed-tooltip`}
|
||||
>
|
||||
<Item {...props} ref={this.saveMenuItem} />
|
||||
</Tooltip>;
|
||||
const item = <Item {...props} ref={this.saveMenuItem} />;
|
||||
if (inlineCollapsed && props.level === 1) {
|
||||
return <Tooltip
|
||||
title={props.children}
|
||||
placement="right"
|
||||
overlayClassName={`${props.rootPrefixCls}-inline-collapsed-tooltip`}
|
||||
>
|
||||
{item}
|
||||
</Tooltip>;
|
||||
}
|
||||
return item;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -63,8 +63,6 @@
|
||||
&:before {
|
||||
position: absolute;
|
||||
background-color: transparent;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
top: 0;
|
||||
left: 0;
|
||||
bottom: 0;
|
||||
@@ -286,6 +284,9 @@
|
||||
&:hover {
|
||||
color: @menu-highlight-color;
|
||||
}
|
||||
&:before {
|
||||
bottom: -2px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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`}>
|
||||
|
||||
@@ -25,6 +25,10 @@
|
||||
font-weight: 500;
|
||||
font-size: @font-size-lg;
|
||||
line-height: 22px;
|
||||
display: block;
|
||||
// create BFC to avoid
|
||||
// https://user-images.githubusercontent.com/507615/37702510-ba844e06-2d2d-11e8-9b67-8e19be57f445.png
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
.@{confirm-prefix-cls}-content {
|
||||
@@ -38,7 +42,6 @@
|
||||
font-size: 22px;
|
||||
margin-right: 16px;
|
||||
float: left;
|
||||
min-height: 48px;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -8,7 +8,6 @@ exports[`renders ./components/pagination/demo/basic.md correctly 1`] = `
|
||||
<li
|
||||
aria-disabled="true"
|
||||
class="ant-pagination-disabled ant-pagination-prev"
|
||||
tabindex="0"
|
||||
title="Previous Page"
|
||||
>
|
||||
<a
|
||||
@@ -281,7 +280,6 @@ exports[`renders ./components/pagination/demo/itemRender.md correctly 1`] = `
|
||||
<li
|
||||
aria-disabled="true"
|
||||
class="ant-pagination-disabled ant-pagination-prev"
|
||||
tabindex="0"
|
||||
title="Previous Page"
|
||||
>
|
||||
<a>
|
||||
@@ -477,7 +475,6 @@ exports[`renders ./components/pagination/demo/mini.md correctly 1`] = `
|
||||
<li
|
||||
aria-disabled="true"
|
||||
class="ant-pagination-disabled ant-pagination-prev"
|
||||
tabindex="0"
|
||||
title="Previous Page"
|
||||
>
|
||||
<a
|
||||
@@ -547,7 +544,6 @@ exports[`renders ./components/pagination/demo/mini.md correctly 1`] = `
|
||||
<li
|
||||
aria-disabled="true"
|
||||
class="ant-pagination-disabled ant-pagination-prev"
|
||||
tabindex="0"
|
||||
title="Previous Page"
|
||||
>
|
||||
<a
|
||||
@@ -667,7 +663,6 @@ exports[`renders ./components/pagination/demo/mini.md correctly 1`] = `
|
||||
<li
|
||||
aria-disabled="true"
|
||||
class="ant-pagination-disabled ant-pagination-prev"
|
||||
tabindex="0"
|
||||
title="Previous Page"
|
||||
>
|
||||
<a
|
||||
@@ -899,7 +894,6 @@ exports[`renders ./components/pagination/demo/total.md correctly 1`] = `
|
||||
<li
|
||||
aria-disabled="true"
|
||||
class="ant-pagination-disabled ant-pagination-prev"
|
||||
tabindex="0"
|
||||
title="Previous Page"
|
||||
>
|
||||
<a
|
||||
@@ -975,7 +969,6 @@ exports[`renders ./components/pagination/demo/total.md correctly 1`] = `
|
||||
<li
|
||||
aria-disabled="true"
|
||||
class="ant-pagination-disabled ant-pagination-prev"
|
||||
tabindex="0"
|
||||
title="Previous Page"
|
||||
>
|
||||
<a
|
||||
|
||||
@@ -66,7 +66,7 @@
|
||||
|
||||
&-active {
|
||||
border-color: @primary-color;
|
||||
font-weight: 500;
|
||||
font-weight: @pagination-font-weight-active;
|
||||
|
||||
a {
|
||||
color: @primary-color;
|
||||
|
||||
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 @@
|
||||
outline: none;
|
||||
|
||||
&-disabled &-star {
|
||||
cursor: not-allowed;
|
||||
cursor: default;
|
||||
&:hover {
|
||||
transform: scale(1);
|
||||
}
|
||||
|
||||
@@ -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,10 +37,10 @@ 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` |
|
||||
| optionLabelProp | Which prop value of option will render as content of select. | string | `value` for `combobox`, `children` for other modes |
|
||||
| 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 |
|
||||
|
||||
@@ -43,6 +43,7 @@ export interface SelectProps extends AbstractSelectProps {
|
||||
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);
|
||||
|
||||
@@ -489,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"
|
||||
|
||||
43
components/slider/__tests__/__snapshots__/index.test.js.snap
Normal file
43
components/slider/__tests__/__snapshots__/index.test.js.snap
Normal file
@@ -0,0 +1,43 @@
|
||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`Slider should show tooltip when hovering slider handler 1`] = `
|
||||
<div>
|
||||
<div
|
||||
class="ant-tooltip ant-tooltip-placement-top "
|
||||
>
|
||||
<div
|
||||
class="ant-tooltip-content"
|
||||
>
|
||||
<div
|
||||
class="ant-tooltip-arrow"
|
||||
/>
|
||||
<div
|
||||
class="ant-tooltip-inner"
|
||||
>
|
||||
30
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
`;
|
||||
|
||||
exports[`Slider should show tooltip when hovering slider handler 2`] = `
|
||||
<div>
|
||||
<div
|
||||
class="ant-tooltip ant-tooltip-placement-top ant-tooltip-hidden"
|
||||
>
|
||||
<div
|
||||
class="ant-tooltip-content"
|
||||
>
|
||||
<div
|
||||
class="ant-tooltip-arrow"
|
||||
/>
|
||||
<div
|
||||
class="ant-tooltip-inner"
|
||||
>
|
||||
30
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
`;
|
||||
15
components/slider/__tests__/index.test.js
Normal file
15
components/slider/__tests__/index.test.js
Normal file
@@ -0,0 +1,15 @@
|
||||
import React from 'react';
|
||||
import { render, mount } from 'enzyme';
|
||||
import Slider from '..';
|
||||
|
||||
describe('Slider', () => {
|
||||
it('should show tooltip when hovering slider handler', () => {
|
||||
const wrapper = mount(
|
||||
<Slider defaultValue={30} />
|
||||
);
|
||||
wrapper.find('.ant-slider-handle').at(0).simulate('mouseEnter');
|
||||
expect(render(wrapper.find('Trigger').instance().getComponent())).toMatchSnapshot();
|
||||
wrapper.find('.ant-slider-handle').at(0).simulate('mouseLeave');
|
||||
expect(render(wrapper.find('Trigger').instance().getComponent())).toMatchSnapshot();
|
||||
});
|
||||
});
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user