mirror of
https://github.com/ant-design/ant-design.git
synced 2026-02-09 10:59:19 +08:00
Compare commits
103 Commits
chore/scri
...
3.26.18
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9838fc5843 | ||
|
|
b30ebb78b9 | ||
|
|
37e9c6b111 | ||
|
|
8e00e59f56 | ||
|
|
285068c533 | ||
|
|
8256b3cb89 | ||
|
|
9504f5b418 | ||
|
|
88d3f34e57 | ||
|
|
97f4bab57f | ||
|
|
fa899ff64f | ||
|
|
30c702b34b | ||
|
|
0b00640ab4 | ||
|
|
44d344844c | ||
|
|
aa971b6459 | ||
|
|
29b98ea63a | ||
|
|
d3e6fd8090 | ||
|
|
79821db32d | ||
|
|
5eee566fff | ||
|
|
90da05750c | ||
|
|
e2b9e40d9d | ||
|
|
226bce705a | ||
|
|
df2425652c | ||
|
|
4751d109e3 | ||
|
|
2c8107c8bd | ||
|
|
56870dd7b3 | ||
|
|
e94133a20b | ||
|
|
50f1605acc | ||
|
|
96f22840d9 | ||
|
|
6f78142360 | ||
|
|
b30832cda1 | ||
|
|
c23ea0c5e6 | ||
|
|
0c1f181957 | ||
|
|
44d74415bc | ||
|
|
1c302163af | ||
|
|
4d0ac007ed | ||
|
|
282c792224 | ||
|
|
ba2ef53089 | ||
|
|
0792ac8762 | ||
|
|
aabf60586d | ||
|
|
f52003261f | ||
|
|
b0146a20cb | ||
|
|
68b948b088 | ||
|
|
bece43062b | ||
|
|
2e8205b01b | ||
|
|
b81e3e9af0 | ||
|
|
045059f604 | ||
|
|
a473770836 | ||
|
|
92b7902f4b | ||
|
|
9ee1a903a3 | ||
|
|
5e7a31d71f | ||
|
|
27c9c086b6 | ||
|
|
046f394c88 | ||
|
|
2ae5efa29f | ||
|
|
e85ec40c9a | ||
|
|
bb335bcc78 | ||
|
|
26dd6f70af | ||
|
|
91a5947ef2 | ||
|
|
be19e4e65f | ||
|
|
ef7bb3763e | ||
|
|
ac740d74fb | ||
|
|
e35663065c | ||
|
|
4c52401fd1 | ||
|
|
7c96796872 | ||
|
|
ac63d26f88 | ||
|
|
b22ef2280c | ||
|
|
831f0fcb5e | ||
|
|
4db7cbcf43 | ||
|
|
dd16a24426 | ||
|
|
f692e7ee34 | ||
|
|
fd553c9ba0 | ||
|
|
1b23971fd6 | ||
|
|
04ef6a8bce | ||
|
|
703a4b1011 | ||
|
|
a1c733ad07 | ||
|
|
9918140695 | ||
|
|
87cbe0168f | ||
|
|
eea0b028c9 | ||
|
|
88bed67368 | ||
|
|
f7e7ce9d4f | ||
|
|
ae7666f8fa | ||
|
|
3fb7325a21 | ||
|
|
59c29a400d | ||
|
|
d3102bb2db | ||
|
|
e036e4c9a3 | ||
|
|
da3540bd59 | ||
|
|
bba87d4125 | ||
|
|
6de8522894 | ||
|
|
674074ce93 | ||
|
|
c68f4463d3 | ||
|
|
a96a95ccb8 | ||
|
|
b112378de3 | ||
|
|
db4bec92be | ||
|
|
b6fc0168db | ||
|
|
92fe411961 | ||
|
|
ab29ecb377 | ||
|
|
23d5a856c0 | ||
|
|
6e4fa95d0f | ||
|
|
2753ce91c9 | ||
|
|
057f5b8526 | ||
|
|
d3eea22097 | ||
|
|
da2f54a18a | ||
|
|
e5dd231aaa | ||
|
|
c6eafe8380 |
@@ -67,4 +67,5 @@ module.exports = {
|
||||
dist: {
|
||||
finalize: finalizeDist,
|
||||
},
|
||||
tag: 'previous',
|
||||
};
|
||||
|
||||
30
.github/workflows/deploy-site.yml
vendored
30
.github/workflows/deploy-site.yml
vendored
@@ -1,30 +0,0 @@
|
||||
name: Deploy website
|
||||
on:
|
||||
release:
|
||||
types: [published]
|
||||
branches:
|
||||
- master
|
||||
|
||||
jobs:
|
||||
build-and-deploy:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: checkout
|
||||
uses: actions/checkout@master
|
||||
|
||||
- name: install
|
||||
run: npm install
|
||||
|
||||
- name: build
|
||||
run: npm run predeploy
|
||||
|
||||
- name: deploy
|
||||
uses: peaceiris/actions-gh-pages@v2
|
||||
env:
|
||||
ACTIONS_DEPLOY_KEY: ${{ secrets.ACTIONS_DEPLOY_KEY }}
|
||||
# PERSONAL_TOKEN: ${{ secrets.PERSONAL_TOKEN }}
|
||||
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
PUBLISH_BRANCH: gh-pages
|
||||
PUBLISH_DIR: ./_site
|
||||
with:
|
||||
emptyCommits: false
|
||||
@@ -15,6 +15,116 @@ timeline: true
|
||||
|
||||
---
|
||||
|
||||
## 3.26.18
|
||||
|
||||
`2020-06-14`
|
||||
|
||||
- 🐞 Fix Tree `AntTreeNodeProps.children` type. [#24429](https://github.com/ant-design/ant-design/pull/24429) [@fireairforce](https://github.com/fireairforce)
|
||||
- 🇮🇪 Add Irish(ga_IE) locale. [#24849](https://github.com/ant-design/ant-design/pull/24849) [@AbhijeetGaware](https://github.com/AbhijeetGaware)
|
||||
|
||||
## 3.26.17
|
||||
|
||||
`2020-05-16`
|
||||
|
||||
- 🐞 Avoid disabled Upload.Dragger being triggered by clicking Form `label`. [#24202](https://github.com/ant-design/ant-design/pull/24202)
|
||||
- 🐞 Fix Tabs cannot be displayed in Safair. [#23151](https://github.com/ant-design/ant-design/pull/23151)
|
||||
- 🐞 Fix Form.Item control icon shaking when `hasFeedback` is not set. [#23924](https://github.com/ant-design/ant-design/pull/23924)
|
||||
- 🐞 Fix `loading` Button using Badge style. [#23691](https://github.com/ant-design/ant-design/pull/23691)
|
||||
|
||||
## 3.26.16
|
||||
|
||||
`2020-04-26`
|
||||
|
||||
- 🐞 Fix Carousel tabbed Radio/Checkbox to non-active slide. [#23380](https://github.com/ant-design/ant-design/pull/23380)
|
||||
- 🐞 Fix Table filter menu no height when less version is `2.x`. [#23272](https://github.com/ant-design/ant-design/pull/23272)
|
||||
|
||||
## 3.26.15
|
||||
|
||||
`2020-04-03`
|
||||
|
||||
- 🐞 Fix Affix throws `React warning of state update on unmounted component`. [#22790](https://github.com/ant-design/ant-design/pull/22790)
|
||||
- 🐞 Fix Table `column.filtered` not working. [#22597](https://github.com/ant-design/ant-design/pull/22597)
|
||||
- 🐞 Fix Select Input style with `multiple` mode in Safari. [#22586](https://github.com/ant-design/ant-design/pull/22586) [@iicdii](https://github.com/iicdii)
|
||||
|
||||
## 3.26.14
|
||||
|
||||
`2020-03-23`
|
||||
|
||||
- 🐞 Fix Descriptions cannot fit to small container width. [#22407](https://github.com/ant-design/ant-design/pull/22407)
|
||||
- 🐞 Fix TextArea `autoSize` don't scroll bottom in Firefox. [#22014](https://github.com/ant-design/ant-design/pull/22014)
|
||||
- 🐞 Fix TextArea style get warning in `react@16.13`. [#21703](https://github.com/ant-design/ant-design/pull/21703)
|
||||
- Typescript
|
||||
- Adjust Popconfirm `onConfirm` `onCancel` event definition. [#22438](https://github.com/ant-design/ant-design/pull/22438) [@nicu-chiciuc](https://github.com/nicu-chiciuc)
|
||||
|
||||
## 3.26.13
|
||||
|
||||
`2020-03-07`
|
||||
|
||||
- 🐞 Fix Result `status` cannot assigned to `string` or `number` type. [#21691](https://github.com/ant-design/ant-design/pull/21691)
|
||||
- 🐞 Fix Badge animation when switch between 10 and 11. [#21887](https://github.com/ant-design/ant-design/pull/21887) [@wendellhu95](https://github.com/wendellhu95)
|
||||
- 🐞 Fix DatePicker disabled icon cursor style. [#21655](https://github.com/ant-design/ant-design/pull/21655) [@jhoneybee](https://github.com/jhoneybee)
|
||||
- 🐞 Fix Grid multiple Rows `margin` overlapping. [#21518](https://github.com/ant-design/ant-design/pull/21518) [@felipeptcho](https://github.com/felipeptcho)
|
||||
- 🐞 Fix Table filter menu max height with many items. [#21602](https://github.com/ant-design/ant-design/pull/21602)
|
||||
|
||||
## 3.26.12
|
||||
|
||||
`2020-02-24`
|
||||
|
||||
- 🐞 Fix Input with `readOnly` still clearable by `allowClear`. [#21492](https://github.com/ant-design/ant-design/pull/21492)
|
||||
- 🐞 Fix Upload won't showing download icon defaultly. [#21496](https://github.com/ant-design/ant-design/pull/21496)
|
||||
- ⚡️ Improve Button render performance. [#21217](https://github.com/ant-design/ant-design/pull/21217)
|
||||
|
||||
## 3.26.11
|
||||
|
||||
`2020-02-17`
|
||||
|
||||
- 🐞 Rollback misc `clearfix` style to breaks flex layout (mainly affect Row, Form, Layout style). [#21406](https://github.com/ant-design/ant-design/pull/21406)
|
||||
|
||||
## 3.26.10
|
||||
|
||||
`2020-02-16`
|
||||
|
||||
- 🐞 Fix Input.Group inside `<Form layout="vertical" >` 1px bug. [#20685](https://github.com/ant-design/ant-design/pull/20685)
|
||||
- 🐞 Fix Badge `color` not working when contains children. [#21333](https://github.com/ant-design/ant-design/pull/21333)
|
||||
- 🐞 Fix Alert close button extra `padding`. [#21325](https://github.com/ant-design/ant-design/pull/21325)
|
||||
- 🐞 Fix Affix throws `Cannot read property getBoundingClientRect in mobile device`. [#21350](https://github.com/ant-design/ant-design/pull/21350)
|
||||
- 💄 Tweak Steps 1px align issue. [#21306](https://github.com/ant-design/ant-design/pull/21306)
|
||||
- 💄 Fix Row component affect next element style issue. [#21310](https://github.com/ant-design/ant-design/pull/21310)
|
||||
- Typescript
|
||||
- 🔷 Revert [#21250](https://github.com/ant-design/ant-design/pull/21250) Type Definition Update.[#21356](https://github.com/ant-design/ant-design/pull/21356)
|
||||
|
||||
## 3.26.9
|
||||
|
||||
`2020-02-08`
|
||||
|
||||
- 🐞 Fix Badge that count is not align when wrapped by Typography. [#21237](https://github.com/ant-design/ant-design/pull/21237)
|
||||
- 🐞 Fix Steps that icon is not align when `size="small"` and `labelPlacement="vertical"`. [#21258](https://github.com/ant-design/ant-design/pull/21258)
|
||||
- 🐞 Fix Typography not focus at the end of textarea when `editable` is true. [#21268](https://github.com/ant-design/ant-design/pull/21268)
|
||||
- TypeScript
|
||||
- 💄 Improve type definition of validation rule's type for Form. [#21250](https://github.com/ant-design/ant-design/pull/21250) [@hansololai](https://github.com/hansololai)
|
||||
- 🐞 Fix type definition of `event` for Tree. [#21200](https://github.com/ant-design/ant-design/pull/21200) [@Jirka-Lhotka](https://github.com/Jirka-Lhotka)
|
||||
|
||||
## 3.26.8
|
||||
|
||||
`2020-02-03`
|
||||
|
||||
- 🐞 Fix Tooltip hidden when `title` is `0`. [#20894](https://github.com/ant-design/ant-design/pull/20894)
|
||||
- 🐞 Fix List `actions` inconsistent position. [#20897](https://github.com/ant-design/ant-design/pull/20897)
|
||||
- 🐞 Fix Card `font-size` of `actions` not in less theme variables. [#21106](https://github.com/ant-design/ant-design/pull/21106)
|
||||
- 🐞 Fix Layout components `displayName`. [#21124](https://github.com/ant-design/ant-design/pull/21124)
|
||||
- 🐞 Fix Modal.confirm `okButtonProps` and `cancelButtonProps` interface. [#21165](https://github.com/ant-design/ant-design/pull/21165)
|
||||
|
||||
## 3.26.7
|
||||
|
||||
`2020-01-13`
|
||||
|
||||
- 💄 Optimize Table fixed columns blank problem in some case. [#20821](https://github.com/ant-design/ant-design/pull/20821) [@AshoneA](https://github.com/AshoneA)
|
||||
- 🐞 Fix Tree `switcherIcon` shown in leaf node problem. [#20753](https://github.com/ant-design/ant-design/pull/20753)
|
||||
- 🐞 Fix Badge `z-index` higher than Table fixed columns. [#20751](https://github.com/ant-design/ant-design/pull/20751)
|
||||
- 🐞 Fix Cascader search bug when `fieldNames` is existed and label/value share same name. [#20720](https://github.com/ant-design/ant-design/pull/20720)
|
||||
- 🐞 Fix Collapse background color with wrong less variable. [#20718](https://github.com/ant-design/ant-design/pull/20718) [@kuitos](https://github.com/kuitos)
|
||||
- 🐞 Fix Input.Group inside `<Form layout="vertical" >` 1px bug. [#20685](https://github.com/ant-design/ant-design/pull/20685)
|
||||
|
||||
## 3.26.6
|
||||
|
||||
`2020-01-03`
|
||||
@@ -2593,7 +2703,7 @@ We provide a [migration tool](https://github.com/ant-design/antd-migration-helpe
|
||||
- 🙅 Deprecated `onRowClick`, `onRowDoubleClick`, `onRowContextMenu`, `onRowMouseEnter`, `onRowMouseLeave`, please use `onRow` instead.
|
||||
```javascript
|
||||
<Table
|
||||
onRow={record => ({
|
||||
onRow={(record) => ({
|
||||
onClick: () => {},
|
||||
onDoubleClick: () => {},
|
||||
onContextMenu: () => {},
|
||||
|
||||
@@ -15,6 +15,116 @@ timeline: true
|
||||
|
||||
---
|
||||
|
||||
## 3.26.18
|
||||
|
||||
`2020-06-14`
|
||||
|
||||
- 🐞 修正了 Tree `AntTreeNodeProps.children` 的类型。[#24429](https://github.com/ant-design/ant-design/pull/24429) [@fireairforce](https://github.com/fireairforce)
|
||||
- 🇮🇪 添加爱尔兰语国际化支持。[#24849](https://github.com/ant-design/ant-design/pull/24849) [@AbhijeetGaware](https://github.com/AbhijeetGaware)
|
||||
|
||||
## 3.26.17
|
||||
|
||||
`2020-05-16`
|
||||
|
||||
- 🐞 修复 Upload.Dragger 禁用时依然会被 Form `label` 触发的问题。[#24202](https://github.com/ant-design/ant-design/pull/24202)
|
||||
- 🐞 修复 Tabs 开启动画时 Safair 下无法显示的问题。[#23151](https://github.com/ant-design/ant-design/pull/23151)
|
||||
- 🐞 修复 Form.Item 不设置 `hasFeedback` 时校验图标闪动问题。[#23924](https://github.com/ant-design/ant-design/pull/23924)
|
||||
- 🐞 修复 `loading` Button 使用 Badge 时的样式问题。[#23691](https://github.com/ant-design/ant-design/pull/23691)
|
||||
|
||||
## 3.26.16
|
||||
|
||||
`2020-04-26`
|
||||
|
||||
- 🐞 修复 Carousel 键盘切换到非活跃 slide 上的 Radio/Checkbox 的问题。[#23380](https://github.com/ant-design/ant-design/pull/23380)
|
||||
- 🐞 修复 Table 筛选菜单在 less 版本为 `2.x` 时不显示的问题。[#23272](https://github.com/ant-design/ant-design/pull/23272)
|
||||
|
||||
## 3.26.15
|
||||
|
||||
`2020-04-03`
|
||||
|
||||
- 🐞 修复 Affix 抛出 `React state update on unmounted component` 警告的问题。[#22790](https://github.com/ant-design/ant-design/pull/22790)
|
||||
- 🐞 修复 Table `column.filtered` 失效的问题。[#22597](https://github.com/ant-design/ant-design/pull/22597)
|
||||
- 🐞 修复 Select `multiple` 模式下,Input 在 Safari 浏览器的样式问题。[#22586](https://github.com/ant-design/ant-design/pull/22586) [@iicdii](https://github.com/iicdii)
|
||||
|
||||
## 3.26.14
|
||||
|
||||
`2020-03-23`
|
||||
|
||||
- 🐞 修复 Descriptions 在小尺寸下无法自适应的问题。[#22407](https://github.com/ant-design/ant-design/pull/22407)
|
||||
- 🐞 修复 TextArea `autoSize` 时在 Firefox 下不会自动滚动到底的问题。[#22014](https://github.com/ant-design/ant-design/pull/22014)
|
||||
- 🐞 修复 TextArea 样式在 `react@16.13` 下会报警告的问题。[#21703](https://github.com/ant-design/ant-design/pull/21703)
|
||||
- Typescript
|
||||
- 调整 Popconfirm `onConfirm` `onCancel` 事件类型定义。[#22438](https://github.com/ant-design/ant-design/pull/22438) [@nicu-chiciuc](https://github.com/nicu-chiciuc)
|
||||
|
||||
## 3.26.13
|
||||
|
||||
`2020-03-07`
|
||||
|
||||
- 🐞 修复 Result `status` 属性不能赋值 `string` 或者 `number` 类型的问题。[#21691](https://github.com/ant-design/ant-design/pull/21691)
|
||||
- 🐞 修复 Badge 数字在 10 和 11 切换时的动画错误。[#21887](https://github.com/ant-design/ant-design/pull/21887) [@wendellhu95](https://github.com/wendellhu95)
|
||||
- 🐞 修复 DatePicker 日历图标在禁用时的手型。[#21655](https://github.com/ant-design/ant-design/pull/21655) [@jhoneybee](https://github.com/jhoneybee)
|
||||
- 🐞 修复 Grid 多个 Row 之间的边距叠加问题。[#21518](https://github.com/ant-design/ant-design/pull/21518) [@felipeptcho](https://github.com/felipeptcho)
|
||||
- 🐞 修复 Table 筛选菜单高度溢出屏幕的问题。[#21602](https://github.com/ant-design/ant-design/pull/21602)
|
||||
|
||||
## 3.26.12
|
||||
|
||||
`2020-02-24`
|
||||
|
||||
- 🐞 修复 Input 在设置 `readOnly` 时 `allowClear` 仍然可以清除的问题。[#21492](https://github.com/ant-design/ant-design/pull/21492)
|
||||
- 🐞 修复 Upload 列表默认情况下不展现下载按钮。[#21496](https://github.com/ant-design/ant-design/pull/21496)
|
||||
- ⚡️ 提升 Button 渲染性能。[#21217](https://github.com/ant-design/ant-design/pull/21217)
|
||||
|
||||
## 3.26.11
|
||||
|
||||
`2020-02-17`
|
||||
|
||||
- 🐞 回滚原子样式 `clearfix` 以修复破坏 flex 布局的问题(主要影响 Row、Form、Layout 等布局问题)。[#21406](https://github.com/ant-design/ant-design/pull/21406)
|
||||
|
||||
## 3.26.10
|
||||
|
||||
`2020-02-16`
|
||||
|
||||
- 🐞 修复 `<Form layout="vertical" >` 内 Input.Group 偏上一像素的问题。[#20685](https://github.com/ant-design/ant-design/pull/20685)
|
||||
- 🐞 修复 Badge 包裹模式下 `color` 属性失效的问题。[#21333](https://github.com/ant-design/ant-design/pull/21333)
|
||||
- 🐞 修复 Alert 关闭按钮额外的 `padding`。[#21325](https://github.com/ant-design/ant-design/pull/21325)
|
||||
- 🐞 修复 Affix 在移动设备下抛错 `Cannot read property getBoundingClientRect` 的问题。[#21350](https://github.com/ant-design/ant-design/pull/21350)
|
||||
- 💄 微调 Steps 文本 1px 使其居中对齐。[#21306](https://github.com/ant-design/ant-design/pull/21306)
|
||||
- 💄 修复 Row 组件影响下一个元素样式问题。[#21310](https://github.com/ant-design/ant-design/pull/21310)
|
||||
- Typescript
|
||||
- 🔷 回滚 [#21250](https://github.com/ant-design/ant-design/pull/21250) 的类型定义更新。[#21356](https://github.com/ant-design/ant-design/pull/21356)
|
||||
|
||||
## 3.26.9
|
||||
|
||||
`2020-02-08`
|
||||
|
||||
- 🐞 修复 Badge 在 Typography 下数字错位的问题。[#21237](https://github.com/ant-design/ant-design/pull/21237)
|
||||
- 🐞 修复 Steps 在 `size="small"` 和 `labelPlacement="vertical"` 时图标没有对齐的问题。[#21258](https://github.com/ant-design/ant-design/pull/21258)
|
||||
- 🐞 修复 Typography 在可编辑状态时光标没有在输入框末位的问题。[#21268](https://github.com/ant-design/ant-design/pull/21268)
|
||||
- TypeScript
|
||||
- 💄 完善 Form 中校验规则类型的类型定义。[#21250](https://github.com/ant-design/ant-design/pull/21250) [@hansololai](https://github.com/hansololai)
|
||||
- 🐞 修复 Tree 中事件类型定义不正确的问题。[#21200](https://github.com/ant-design/ant-design/pull/21200) [@Jirka-Lhotka](https://github.com/Jirka-Lhotka)
|
||||
|
||||
## 3.26.8
|
||||
|
||||
`2020-02-03`
|
||||
|
||||
- 🐞 修复 Tooltip `title` 为 `0` 时没有显示的问题。[#20894](https://github.com/ant-design/ant-design/pull/20894)
|
||||
- 🐞 修复 List `actions` 位置不在右边的问题。[#20897](https://github.com/ant-design/ant-design/pull/20897)
|
||||
- 🐞 修复 Card `actions` 字体大小不受 less 变量影响的问题。[#21106](https://github.com/ant-design/ant-design/pull/21106)
|
||||
- 🐞 修正 Layout 各组件的 `displayName`。[#21124](https://github.com/ant-design/ant-design/pull/21124)
|
||||
- 🐞 优化 Modal.confirm 的 `okButtonProps` 和 `cancelButtonProps` 的 TypeScript 类型。[#21165](https://github.com/ant-design/ant-design/pull/21165)
|
||||
|
||||
## 3.26.7
|
||||
|
||||
`2020-01-13`
|
||||
|
||||
- 💄 优化 Table 固定列在某些情况下出现空白间隔的问题。[#20821](https://github.com/ant-design/ant-design/pull/20821) [@AshoneA](https://github.com/AshoneA)
|
||||
- 🐞 修复 Tree `switcherIcon` 在叶子节点上展示的问题。[#20753](https://github.com/ant-design/ant-design/pull/20753)
|
||||
- 🐞 修复 Badge 在 Table 固定列中穿透的问题。[#20751](https://github.com/ant-design/ant-design/pull/20751)
|
||||
- 🐞 修复 Cascader `fieldNames` 中 label 和 value 共用一个值时搜索功能失效的问题。[#20720](https://github.com/ant-design/ant-design/pull/20720)
|
||||
- 🐞 修复 Collapse 背景使用错误的 less 变量。[#20718](https://github.com/ant-design/ant-design/pull/20718) [@kuitos](https://github.com/kuitos)
|
||||
- 🐞 修复 `<Form layout="vertical" >` 内 Input.Group 偏上一像素的问题。[#20685](https://github.com/ant-design/ant-design/pull/20685)
|
||||
|
||||
## 3.26.6
|
||||
|
||||
`2020-01-03`
|
||||
@@ -2609,7 +2719,7 @@ timeline: true
|
||||
- 🙅 废弃以下属性 `onRowClick`,`onRowDoubleClick`、`onRowContextMenu`、`onRowMouseEnter`、`onRowMouseLeave`,请使用 `onRow` 代替。
|
||||
```javascript
|
||||
<Table
|
||||
onRow={record => ({
|
||||
onRow={(record) => ({
|
||||
onClick: () => {},
|
||||
onDoubleClick: () => {},
|
||||
onContextMenu: () => {},
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
|
||||
An enterprise-class UI design language and React UI library.
|
||||
|
||||
[](https://circleci.com/gh/ant-design/ant-design)  [](https://codecov.io/gh/ant-design/ant-design/branch/master) [](https://www.npmjs.com/package/antd) [](https://www.npmjs.com/package/antd) [](http://npmjs.com/antd)
|
||||
[](https://circleci.com/gh/ant-design/ant-design)  [](https://codecov.io/gh/ant-design/ant-design/branch/master) [](https://www.npmjs.com/package/antd) [](http://npmjs.com/antd)
|
||||
|
||||
[](https://david-dm.org/ant-design/ant-design) [](https://david-dm.org/ant-design/ant-design?type=dev) [](https://lgtm.com/projects/g/ant-design/ant-design/alerts/) [](https://app.fossa.io/projects/git%2Bgithub.com%2Fant-design%2Fant-design?ref=badge_shield) [](https://github.com/ant-design/ant-design/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22)
|
||||
|
||||
|
||||
@@ -116,6 +116,8 @@ class Affix extends React.Component<AffixProps, AffixState> {
|
||||
clearTimeout(this.timeout);
|
||||
removeObserveTarget(this);
|
||||
(this.updatePosition as any).cancel();
|
||||
// https://github.com/ant-design/ant-design/issues/22683
|
||||
(this.lazyUpdatePosition as any).cancel();
|
||||
}
|
||||
|
||||
getOffsetTop = () => {
|
||||
@@ -239,7 +241,7 @@ class Affix extends React.Component<AffixProps, AffixState> {
|
||||
const offsetBottom = this.getOffsetBottom();
|
||||
|
||||
const targetNode = target();
|
||||
if (targetNode) {
|
||||
if (targetNode && this.placeholderNode) {
|
||||
const targetRect = getTargetRect(targetNode);
|
||||
const placeholderReact = getTargetRect(this.placeholderNode);
|
||||
const fixedTop = getFixedTop(placeholderReact, targetRect, offsetTop);
|
||||
|
||||
@@ -72,6 +72,7 @@
|
||||
position: absolute;
|
||||
top: 8px;
|
||||
right: 16px;
|
||||
padding: 0;
|
||||
overflow: hidden;
|
||||
font-size: @font-size-sm;
|
||||
line-height: 22px;
|
||||
|
||||
@@ -35,6 +35,7 @@ describe('AutoComplete children could be focus', () => {
|
||||
.focus();
|
||||
jest.runAllTimers();
|
||||
expect(handleFocus).toHaveBeenCalled();
|
||||
wrapper.unmount();
|
||||
});
|
||||
|
||||
it('blur() and onBlur', () => {
|
||||
@@ -51,6 +52,7 @@ describe('AutoComplete children could be focus', () => {
|
||||
.blur();
|
||||
jest.runAllTimers();
|
||||
expect(handleBlur).toHaveBeenCalled();
|
||||
wrapper.unmount();
|
||||
});
|
||||
|
||||
it('child.ref should work', () => {
|
||||
@@ -67,7 +69,11 @@ describe('AutoComplete children could be focus', () => {
|
||||
let inputRef;
|
||||
mount(
|
||||
<AutoComplete dataSource={[]}>
|
||||
<input ref={node => { inputRef = node; }} />
|
||||
<input
|
||||
ref={node => {
|
||||
inputRef = node;
|
||||
}}
|
||||
/>
|
||||
</AutoComplete>,
|
||||
);
|
||||
expect(typeof inputRef.focus).toBe('function');
|
||||
|
||||
@@ -41,152 +41,152 @@ exports[`renders ./components/avatar/demo/badge.md correctly 1`] = `
|
||||
style="transition:none;-ms-transform:translateY(-1100%);-webkit-transform:translateY(-1100%);transform:translateY(-1100%)"
|
||||
>
|
||||
<p
|
||||
class=""
|
||||
class="ant-scroll-number-only-unit"
|
||||
>
|
||||
0
|
||||
</p>
|
||||
<p
|
||||
class=""
|
||||
class="ant-scroll-number-only-unit"
|
||||
>
|
||||
1
|
||||
</p>
|
||||
<p
|
||||
class=""
|
||||
class="ant-scroll-number-only-unit"
|
||||
>
|
||||
2
|
||||
</p>
|
||||
<p
|
||||
class=""
|
||||
class="ant-scroll-number-only-unit"
|
||||
>
|
||||
3
|
||||
</p>
|
||||
<p
|
||||
class=""
|
||||
class="ant-scroll-number-only-unit"
|
||||
>
|
||||
4
|
||||
</p>
|
||||
<p
|
||||
class=""
|
||||
class="ant-scroll-number-only-unit"
|
||||
>
|
||||
5
|
||||
</p>
|
||||
<p
|
||||
class=""
|
||||
class="ant-scroll-number-only-unit"
|
||||
>
|
||||
6
|
||||
</p>
|
||||
<p
|
||||
class=""
|
||||
class="ant-scroll-number-only-unit"
|
||||
>
|
||||
7
|
||||
</p>
|
||||
<p
|
||||
class=""
|
||||
class="ant-scroll-number-only-unit"
|
||||
>
|
||||
8
|
||||
</p>
|
||||
<p
|
||||
class=""
|
||||
class="ant-scroll-number-only-unit"
|
||||
>
|
||||
9
|
||||
</p>
|
||||
<p
|
||||
class=""
|
||||
class="ant-scroll-number-only-unit"
|
||||
>
|
||||
0
|
||||
</p>
|
||||
<p
|
||||
class="current"
|
||||
class="ant-scroll-number-only-unit current"
|
||||
>
|
||||
1
|
||||
</p>
|
||||
<p
|
||||
class=""
|
||||
class="ant-scroll-number-only-unit"
|
||||
>
|
||||
2
|
||||
</p>
|
||||
<p
|
||||
class=""
|
||||
class="ant-scroll-number-only-unit"
|
||||
>
|
||||
3
|
||||
</p>
|
||||
<p
|
||||
class=""
|
||||
class="ant-scroll-number-only-unit"
|
||||
>
|
||||
4
|
||||
</p>
|
||||
<p
|
||||
class=""
|
||||
class="ant-scroll-number-only-unit"
|
||||
>
|
||||
5
|
||||
</p>
|
||||
<p
|
||||
class=""
|
||||
class="ant-scroll-number-only-unit"
|
||||
>
|
||||
6
|
||||
</p>
|
||||
<p
|
||||
class=""
|
||||
class="ant-scroll-number-only-unit"
|
||||
>
|
||||
7
|
||||
</p>
|
||||
<p
|
||||
class=""
|
||||
class="ant-scroll-number-only-unit"
|
||||
>
|
||||
8
|
||||
</p>
|
||||
<p
|
||||
class=""
|
||||
class="ant-scroll-number-only-unit"
|
||||
>
|
||||
9
|
||||
</p>
|
||||
<p
|
||||
class=""
|
||||
class="ant-scroll-number-only-unit"
|
||||
>
|
||||
0
|
||||
</p>
|
||||
<p
|
||||
class=""
|
||||
class="ant-scroll-number-only-unit"
|
||||
>
|
||||
1
|
||||
</p>
|
||||
<p
|
||||
class=""
|
||||
class="ant-scroll-number-only-unit"
|
||||
>
|
||||
2
|
||||
</p>
|
||||
<p
|
||||
class=""
|
||||
class="ant-scroll-number-only-unit"
|
||||
>
|
||||
3
|
||||
</p>
|
||||
<p
|
||||
class=""
|
||||
class="ant-scroll-number-only-unit"
|
||||
>
|
||||
4
|
||||
</p>
|
||||
<p
|
||||
class=""
|
||||
class="ant-scroll-number-only-unit"
|
||||
>
|
||||
5
|
||||
</p>
|
||||
<p
|
||||
class=""
|
||||
class="ant-scroll-number-only-unit"
|
||||
>
|
||||
6
|
||||
</p>
|
||||
<p
|
||||
class=""
|
||||
class="ant-scroll-number-only-unit"
|
||||
>
|
||||
7
|
||||
</p>
|
||||
<p
|
||||
class=""
|
||||
class="ant-scroll-number-only-unit"
|
||||
>
|
||||
8
|
||||
</p>
|
||||
<p
|
||||
class=""
|
||||
class="ant-scroll-number-only-unit"
|
||||
>
|
||||
9
|
||||
</p>
|
||||
|
||||
@@ -17,12 +17,16 @@ function getNumberArray(num: string | number | undefined | null) {
|
||||
: [];
|
||||
}
|
||||
|
||||
function renderNumberList(position: number) {
|
||||
function renderNumberList(position: number, className: string) {
|
||||
const childrenToReturn: React.ReactElement<any>[] = [];
|
||||
for (let i = 0; i < 30; i++) {
|
||||
const currentClassName = position === i ? 'current' : '';
|
||||
childrenToReturn.push(
|
||||
<p key={i.toString()} className={currentClassName}>
|
||||
<p
|
||||
key={i.toString()}
|
||||
className={classNames(className, {
|
||||
current: position === i,
|
||||
})}
|
||||
>
|
||||
{i % 10}
|
||||
</p>,
|
||||
);
|
||||
@@ -67,6 +71,8 @@ class ScrollNumber extends React.Component<ScrollNumberProps, ScrollNumberState>
|
||||
|
||||
lastCount?: string | number | null;
|
||||
|
||||
private timeout?: number;
|
||||
|
||||
constructor(props: ScrollNumberProps) {
|
||||
super(props);
|
||||
this.state = {
|
||||
@@ -79,17 +85,26 @@ class ScrollNumber extends React.Component<ScrollNumberProps, ScrollNumberState>
|
||||
this.lastCount = prevState.count;
|
||||
const { animateStarted } = this.state;
|
||||
if (animateStarted) {
|
||||
// eslint-disable-next-line react/no-did-update-set-state
|
||||
this.setState(
|
||||
(__, props) => ({
|
||||
animateStarted: false,
|
||||
count: props.count,
|
||||
}),
|
||||
this.onAnimated,
|
||||
);
|
||||
this.clearTimeout();
|
||||
// Let browser has time to reset the scroller before actually
|
||||
// performing the transition.
|
||||
this.timeout = setTimeout(() => {
|
||||
// eslint-disable-next-line react/no-did-update-set-state
|
||||
this.setState(
|
||||
(__, props) => ({
|
||||
animateStarted: false,
|
||||
count: props.count,
|
||||
}),
|
||||
this.onAnimated,
|
||||
);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
componentWillUnmount() {
|
||||
this.clearTimeout();
|
||||
}
|
||||
|
||||
getPositionByNum(num: number, i: number) {
|
||||
const { count } = this.state;
|
||||
const currentCount = Math.abs(Number(count));
|
||||
@@ -138,7 +153,7 @@ class ScrollNumber extends React.Component<ScrollNumberProps, ScrollNumberState>
|
||||
},
|
||||
key: i,
|
||||
},
|
||||
renderNumberList(position),
|
||||
renderNumberList(position, `${prefixCls}-only-unit`),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -206,6 +221,13 @@ class ScrollNumber extends React.Component<ScrollNumberProps, ScrollNumberState>
|
||||
render() {
|
||||
return <ConfigConsumer>{this.renderScrollNumber}</ConfigConsumer>;
|
||||
}
|
||||
|
||||
private clearTimeout(): void {
|
||||
if (this.timeout) {
|
||||
clearTimeout(this.timeout);
|
||||
this.timeout = undefined;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
polyfill(ScrollNumber);
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -25,6 +25,7 @@ describe('Badge', () => {
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
wrapper = mount(<Badge count="3.5" />);
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
expect(() => wrapper.unmount()).not.toThrow();
|
||||
});
|
||||
|
||||
it('badge dot not showing count == 0', () => {
|
||||
@@ -111,4 +112,22 @@ describe('Badge', () => {
|
||||
);
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
});
|
||||
|
||||
// https://github.com/ant-design/ant-design/issues/21331
|
||||
it('render Badge status/color when contains children', () => {
|
||||
const wrapper = render(
|
||||
<div>
|
||||
<Badge count={5} status="success">
|
||||
<a />
|
||||
</Badge>
|
||||
<Badge count={5} color="blue">
|
||||
<a />
|
||||
</Badge>
|
||||
<Badge count={5} color="#08c">
|
||||
<a />
|
||||
</Badge>
|
||||
</div>,
|
||||
);
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
})
|
||||
});
|
||||
|
||||
@@ -136,7 +136,7 @@ export default class Badge extends React.Component<BadgeProps, any> {
|
||||
}
|
||||
|
||||
renderBadgeNumber(prefixCls: string, scrollNumberPrefixCls: string) {
|
||||
const { status, count } = this.props;
|
||||
const { status, count, color } = this.props;
|
||||
|
||||
const displayCount = this.getDispayCount();
|
||||
const isDot = this.isDot();
|
||||
@@ -147,9 +147,16 @@ export default class Badge extends React.Component<BadgeProps, any> {
|
||||
[`${prefixCls}-count`]: !isDot,
|
||||
[`${prefixCls}-multiple-words`]:
|
||||
!isDot && count && count.toString && count.toString().length > 1,
|
||||
[`${prefixCls}-status-${status}`]: this.hasStatus(),
|
||||
[`${prefixCls}-status-${status}`]: !!status,
|
||||
[`${prefixCls}-status-${color}`]: isPresetColor(color),
|
||||
});
|
||||
|
||||
let statusStyle: React.CSSProperties | undefined = this.getStyleWithOffset();
|
||||
if (color && !isPresetColor(color)) {
|
||||
statusStyle = statusStyle || {};
|
||||
statusStyle.background = color;
|
||||
}
|
||||
|
||||
return hidden ? null : (
|
||||
<ScrollNumber
|
||||
prefixCls={scrollNumberPrefixCls}
|
||||
@@ -158,7 +165,7 @@ export default class Badge extends React.Component<BadgeProps, any> {
|
||||
count={displayCount}
|
||||
displayComponent={this.renderDispayComponent()} // <Badge status="success" count={<Icon type="xxx" />}></Badge>
|
||||
title={this.getScrollNumberTitle()}
|
||||
style={this.getStyleWithOffset()}
|
||||
style={statusStyle}
|
||||
key="scrollNumber"
|
||||
/>
|
||||
);
|
||||
|
||||
@@ -13,7 +13,6 @@
|
||||
line-height: 1;
|
||||
|
||||
&-count {
|
||||
z-index: @zindex-badge;
|
||||
min-width: @badge-height;
|
||||
height: @badge-height;
|
||||
padding: 0 6px;
|
||||
@@ -37,7 +36,6 @@
|
||||
}
|
||||
|
||||
&-dot {
|
||||
z-index: @zindex-badge;
|
||||
width: @badge-dot-size;
|
||||
height: @badge-dot-size;
|
||||
background: @highlight-color;
|
||||
@@ -51,6 +49,7 @@
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
z-index: @zindex-badge;
|
||||
transform: translate(50%, -50%);
|
||||
transform-origin: 100% 0%;
|
||||
}
|
||||
@@ -159,7 +158,7 @@
|
||||
display: inline-block;
|
||||
height: @badge-height;
|
||||
transition: all 0.3s @ease-in-out;
|
||||
> p {
|
||||
> p.@{number-prefix-cls}-only-unit {
|
||||
height: @badge-height;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
@@ -194,7 +194,7 @@ class Button extends React.Component<ButtonProps, ButtonState> {
|
||||
if (!this.buttonNode) {
|
||||
return;
|
||||
}
|
||||
const buttonText = this.buttonNode.textContent || this.buttonNode.innerText;
|
||||
const buttonText = this.buttonNode.textContent;
|
||||
if (this.isNeedInserted() && isTwoCNChar(buttonText)) {
|
||||
if (!this.state.hasTwoCNChar) {
|
||||
this.setState({
|
||||
|
||||
3
components/calendar/locale/ga_IE.tsx
Normal file
3
components/calendar/locale/ga_IE.tsx
Normal file
@@ -0,0 +1,3 @@
|
||||
import ga_IE from '../../date-picker/locale/ga_IE';
|
||||
|
||||
export default ga_IE;
|
||||
@@ -32,7 +32,7 @@ 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}> | - | |
|
||||
| tabBarExtraContent | Extra content in tab bar | React.ReactNode | - | |
|
||||
| tabBarExtraContent | Extra content in tab bar | React.ReactNode | - | 3.23.0 |
|
||||
| size | Size of card | `default` \| `small` | `default` | 3.12.0 |
|
||||
| title | Card title | string\|ReactNode | - | |
|
||||
| type | Card style type, can be set to `inner` or not set | string | - | |
|
||||
|
||||
@@ -33,7 +33,7 @@ cols: 1
|
||||
| hoverable | 鼠标移过时可浮起 | boolean | false | |
|
||||
| loading | 当卡片内容还在加载中时,可以用 loading 展示一个占位 | boolean | false | |
|
||||
| tabList | 页签标题列表 | Array<{key: string, tab: ReactNode}> | - | |
|
||||
| tabBarExtraContent | tab bar 上额外的元素 | React.ReactNode | 无 | |
|
||||
| tabBarExtraContent | tab bar 上额外的元素 | React.ReactNode | 无 | 3.23.0 |
|
||||
| size | card 的尺寸 | `default` \| `small` | `default` | 3.12.0 |
|
||||
| title | 卡片标题 | string\|ReactNode | - | |
|
||||
| type | 卡片类型,可设置为 `inner` 或 不设置 | string | - | |
|
||||
|
||||
@@ -144,7 +144,7 @@
|
||||
position: relative;
|
||||
display: block;
|
||||
min-width: 32px;
|
||||
font-size: 14px;
|
||||
font-size: @font-size-base;
|
||||
line-height: 22px;
|
||||
cursor: pointer;
|
||||
|
||||
|
||||
@@ -31,8 +31,19 @@
|
||||
.slick-slide {
|
||||
pointer-events: none;
|
||||
|
||||
// https://github.com/ant-design/ant-design/issues/23294
|
||||
input.@{ant-prefix}-radio-input,
|
||||
input.@{ant-prefix}-checkbox-input {
|
||||
visibility: hidden;
|
||||
}
|
||||
|
||||
&.slick-active {
|
||||
pointer-events: auto;
|
||||
|
||||
input.@{ant-prefix}-radio-input,
|
||||
input.@{ant-prefix}-checkbox-input {
|
||||
visibility: visible;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -839,6 +839,7 @@ exports[`Cascader should highlight keyword and filter when search in Cascader 1`
|
||||
Object {
|
||||
"__IS_FILTERED_OPTION": true,
|
||||
"disabled": false,
|
||||
"isEmptyNode": true,
|
||||
"label": Array [
|
||||
"Jiangsu",
|
||||
Array [
|
||||
@@ -891,6 +892,7 @@ exports[`Cascader should highlight keyword and filter when search in Cascader 1`
|
||||
Object {
|
||||
"__IS_FILTERED_OPTION": true,
|
||||
"disabled": false,
|
||||
"isEmptyNode": true,
|
||||
"label": Array [
|
||||
"Zhejiang",
|
||||
Array [
|
||||
@@ -1025,6 +1027,49 @@ exports[`Cascader should highlight keyword and filter when search in Cascader 1`
|
||||
</Popup>
|
||||
`;
|
||||
|
||||
exports[`Cascader should highlight keyword and filter when search in Cascader with same field name of label and value 1`] = `
|
||||
<div>
|
||||
<div
|
||||
class="ant-cascader-menus ant-cascader-menus-placement-bottomLeft slide-up-appear"
|
||||
style="left: -999px; top: -995px;"
|
||||
>
|
||||
<div>
|
||||
<ul
|
||||
class="ant-cascader-menu"
|
||||
style="width: 0px;"
|
||||
>
|
||||
<li
|
||||
class="ant-cascader-menu-item"
|
||||
role="menuitem"
|
||||
title=""
|
||||
>
|
||||
Zhejiang / Hang
|
||||
<span
|
||||
class="ant-cascader-menu-item-keyword"
|
||||
>
|
||||
z
|
||||
</span>
|
||||
hou / West Lake
|
||||
</li>
|
||||
<li
|
||||
class="ant-cascader-menu-item ant-cascader-menu-item-disabled"
|
||||
role="menuitem"
|
||||
title=""
|
||||
>
|
||||
Zhejiang / Hang
|
||||
<span
|
||||
class="ant-cascader-menu-item-keyword"
|
||||
>
|
||||
z
|
||||
</span>
|
||||
hou / Xia Sha
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
`;
|
||||
|
||||
exports[`Cascader should render not found content 1`] = `
|
||||
<Popup
|
||||
action={
|
||||
@@ -1242,6 +1287,7 @@ exports[`Cascader should render not found content 1`] = `
|
||||
Array [
|
||||
Object {
|
||||
"disabled": true,
|
||||
"isEmptyNode": true,
|
||||
"label": <Context.Consumer>
|
||||
[Function]
|
||||
</Context.Consumer>,
|
||||
@@ -1569,6 +1615,7 @@ exports[`Cascader should show not found content when options.length is 0 1`] = `
|
||||
Array [
|
||||
Object {
|
||||
"disabled": true,
|
||||
"isEmptyNode": true,
|
||||
"label": <Context.Consumer>
|
||||
[Function]
|
||||
</Context.Consumer>,
|
||||
|
||||
@@ -205,6 +205,52 @@ describe('Cascader', () => {
|
||||
expect(popupWrapper).toMatchSnapshot();
|
||||
});
|
||||
|
||||
it('should highlight keyword and filter when search in Cascader with same field name of label and value', () => {
|
||||
const customOptions = [
|
||||
{
|
||||
name: 'Zhejiang',
|
||||
value: 'Zhejiang',
|
||||
children: [
|
||||
{
|
||||
name: 'Hangzhou',
|
||||
value: 'Hangzhou',
|
||||
children: [
|
||||
{
|
||||
name: 'West Lake',
|
||||
value: 'West Lake',
|
||||
},
|
||||
{
|
||||
name: 'Xia Sha',
|
||||
value: 'Xia Sha',
|
||||
disabled: true,
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
];
|
||||
function customFilter(inputValue, path) {
|
||||
return path.some(option => option.name.toLowerCase().indexOf(inputValue.toLowerCase()) > -1);
|
||||
}
|
||||
const wrapper = mount(
|
||||
<Cascader
|
||||
options={customOptions}
|
||||
fieldNames={{ label: 'name', value: 'name' }}
|
||||
showSearch={{ filter: customFilter }}
|
||||
/>,
|
||||
);
|
||||
wrapper.find('input').simulate('click');
|
||||
wrapper.find('input').simulate('change', { target: { value: 'z' } });
|
||||
expect(wrapper.state('inputValue')).toBe('z');
|
||||
const popupWrapper = mount(
|
||||
wrapper
|
||||
.find('Trigger')
|
||||
.instance()
|
||||
.getComponent(),
|
||||
);
|
||||
expect(popupWrapper.render()).toMatchSnapshot();
|
||||
});
|
||||
|
||||
it('should render not found content', () => {
|
||||
const wrapper = mount(<Cascader options={options} showSearch={{ filter }} />);
|
||||
wrapper.find('input').simulate('click');
|
||||
|
||||
@@ -397,17 +397,19 @@ class Cascader extends React.Component<CascaderProps, CascaderState> {
|
||||
return {
|
||||
__IS_FILTERED_OPTION: true,
|
||||
path,
|
||||
[names.label]: render(inputValue, path, prefixCls, names),
|
||||
[names.value]: path.map((o: CascaderOptionType) => o[names.value]),
|
||||
[names.label]: render(inputValue, path, prefixCls, names),
|
||||
disabled: path.some((o: CascaderOptionType) => !!o.disabled),
|
||||
isEmptyNode: true,
|
||||
} as CascaderOptionType;
|
||||
});
|
||||
}
|
||||
return [
|
||||
{
|
||||
[names.label]: notFoundContent || renderEmpty('Cascader'),
|
||||
[names.value]: 'ANT_CASCADER_NOT_FOUND',
|
||||
[names.label]: notFoundContent || renderEmpty('Cascader'),
|
||||
disabled: true,
|
||||
isEmptyNode: true,
|
||||
},
|
||||
];
|
||||
}
|
||||
@@ -503,9 +505,10 @@ class Cascader extends React.Component<CascaderProps, CascaderState> {
|
||||
} else {
|
||||
options = [
|
||||
{
|
||||
[names.label]: notFoundContent || renderEmpty('Cascader'),
|
||||
[names.value]: 'ANT_CASCADER_NOT_FOUND',
|
||||
[names.label]: notFoundContent || renderEmpty('Cascader'),
|
||||
disabled: true,
|
||||
isEmptyNode: true,
|
||||
},
|
||||
];
|
||||
}
|
||||
@@ -517,8 +520,7 @@ class Cascader extends React.Component<CascaderProps, CascaderState> {
|
||||
}
|
||||
|
||||
const dropdownMenuColumnStyle: { width?: number; height?: string } = {};
|
||||
const isNotFound =
|
||||
(options || []).length === 1 && options[0][names.value] === 'ANT_CASCADER_NOT_FOUND';
|
||||
const isNotFound = (options || []).length === 1 && options[0].isEmptyNode;
|
||||
if (isNotFound) {
|
||||
dropdownMenuColumnStyle.height = 'auto'; // Height of one row.
|
||||
}
|
||||
|
||||
@@ -102,7 +102,7 @@
|
||||
}
|
||||
|
||||
&-borderless {
|
||||
background-color: @component-background;
|
||||
background-color: @collapse-header-bg;
|
||||
border: 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -445,152 +445,152 @@ exports[`ConfigProvider components Badge configProvider 1`] = `
|
||||
style="transition:none;-ms-transform:translateY(-1500%);-webkit-transform:translateY(-1500%);transform:translateY(-1500%)"
|
||||
>
|
||||
<p
|
||||
class=""
|
||||
class="config-scroll-number-only-unit"
|
||||
>
|
||||
0
|
||||
</p>
|
||||
<p
|
||||
class=""
|
||||
class="config-scroll-number-only-unit"
|
||||
>
|
||||
1
|
||||
</p>
|
||||
<p
|
||||
class=""
|
||||
class="config-scroll-number-only-unit"
|
||||
>
|
||||
2
|
||||
</p>
|
||||
<p
|
||||
class=""
|
||||
class="config-scroll-number-only-unit"
|
||||
>
|
||||
3
|
||||
</p>
|
||||
<p
|
||||
class=""
|
||||
class="config-scroll-number-only-unit"
|
||||
>
|
||||
4
|
||||
</p>
|
||||
<p
|
||||
class=""
|
||||
class="config-scroll-number-only-unit"
|
||||
>
|
||||
5
|
||||
</p>
|
||||
<p
|
||||
class=""
|
||||
class="config-scroll-number-only-unit"
|
||||
>
|
||||
6
|
||||
</p>
|
||||
<p
|
||||
class=""
|
||||
class="config-scroll-number-only-unit"
|
||||
>
|
||||
7
|
||||
</p>
|
||||
<p
|
||||
class=""
|
||||
class="config-scroll-number-only-unit"
|
||||
>
|
||||
8
|
||||
</p>
|
||||
<p
|
||||
class=""
|
||||
class="config-scroll-number-only-unit"
|
||||
>
|
||||
9
|
||||
</p>
|
||||
<p
|
||||
class=""
|
||||
class="config-scroll-number-only-unit"
|
||||
>
|
||||
0
|
||||
</p>
|
||||
<p
|
||||
class=""
|
||||
class="config-scroll-number-only-unit"
|
||||
>
|
||||
1
|
||||
</p>
|
||||
<p
|
||||
class=""
|
||||
class="config-scroll-number-only-unit"
|
||||
>
|
||||
2
|
||||
</p>
|
||||
<p
|
||||
class=""
|
||||
class="config-scroll-number-only-unit"
|
||||
>
|
||||
3
|
||||
</p>
|
||||
<p
|
||||
class=""
|
||||
class="config-scroll-number-only-unit"
|
||||
>
|
||||
4
|
||||
</p>
|
||||
<p
|
||||
class="current"
|
||||
class="config-scroll-number-only-unit current"
|
||||
>
|
||||
5
|
||||
</p>
|
||||
<p
|
||||
class=""
|
||||
class="config-scroll-number-only-unit"
|
||||
>
|
||||
6
|
||||
</p>
|
||||
<p
|
||||
class=""
|
||||
class="config-scroll-number-only-unit"
|
||||
>
|
||||
7
|
||||
</p>
|
||||
<p
|
||||
class=""
|
||||
class="config-scroll-number-only-unit"
|
||||
>
|
||||
8
|
||||
</p>
|
||||
<p
|
||||
class=""
|
||||
class="config-scroll-number-only-unit"
|
||||
>
|
||||
9
|
||||
</p>
|
||||
<p
|
||||
class=""
|
||||
class="config-scroll-number-only-unit"
|
||||
>
|
||||
0
|
||||
</p>
|
||||
<p
|
||||
class=""
|
||||
class="config-scroll-number-only-unit"
|
||||
>
|
||||
1
|
||||
</p>
|
||||
<p
|
||||
class=""
|
||||
class="config-scroll-number-only-unit"
|
||||
>
|
||||
2
|
||||
</p>
|
||||
<p
|
||||
class=""
|
||||
class="config-scroll-number-only-unit"
|
||||
>
|
||||
3
|
||||
</p>
|
||||
<p
|
||||
class=""
|
||||
class="config-scroll-number-only-unit"
|
||||
>
|
||||
4
|
||||
</p>
|
||||
<p
|
||||
class=""
|
||||
class="config-scroll-number-only-unit"
|
||||
>
|
||||
5
|
||||
</p>
|
||||
<p
|
||||
class=""
|
||||
class="config-scroll-number-only-unit"
|
||||
>
|
||||
6
|
||||
</p>
|
||||
<p
|
||||
class=""
|
||||
class="config-scroll-number-only-unit"
|
||||
>
|
||||
7
|
||||
</p>
|
||||
<p
|
||||
class=""
|
||||
class="config-scroll-number-only-unit"
|
||||
>
|
||||
8
|
||||
</p>
|
||||
<p
|
||||
class=""
|
||||
class="config-scroll-number-only-unit"
|
||||
>
|
||||
9
|
||||
</p>
|
||||
@@ -625,152 +625,152 @@ exports[`ConfigProvider components Badge normal 1`] = `
|
||||
style="transition:none;-ms-transform:translateY(-1500%);-webkit-transform:translateY(-1500%);transform:translateY(-1500%)"
|
||||
>
|
||||
<p
|
||||
class=""
|
||||
class="ant-scroll-number-only-unit"
|
||||
>
|
||||
0
|
||||
</p>
|
||||
<p
|
||||
class=""
|
||||
class="ant-scroll-number-only-unit"
|
||||
>
|
||||
1
|
||||
</p>
|
||||
<p
|
||||
class=""
|
||||
class="ant-scroll-number-only-unit"
|
||||
>
|
||||
2
|
||||
</p>
|
||||
<p
|
||||
class=""
|
||||
class="ant-scroll-number-only-unit"
|
||||
>
|
||||
3
|
||||
</p>
|
||||
<p
|
||||
class=""
|
||||
class="ant-scroll-number-only-unit"
|
||||
>
|
||||
4
|
||||
</p>
|
||||
<p
|
||||
class=""
|
||||
class="ant-scroll-number-only-unit"
|
||||
>
|
||||
5
|
||||
</p>
|
||||
<p
|
||||
class=""
|
||||
class="ant-scroll-number-only-unit"
|
||||
>
|
||||
6
|
||||
</p>
|
||||
<p
|
||||
class=""
|
||||
class="ant-scroll-number-only-unit"
|
||||
>
|
||||
7
|
||||
</p>
|
||||
<p
|
||||
class=""
|
||||
class="ant-scroll-number-only-unit"
|
||||
>
|
||||
8
|
||||
</p>
|
||||
<p
|
||||
class=""
|
||||
class="ant-scroll-number-only-unit"
|
||||
>
|
||||
9
|
||||
</p>
|
||||
<p
|
||||
class=""
|
||||
class="ant-scroll-number-only-unit"
|
||||
>
|
||||
0
|
||||
</p>
|
||||
<p
|
||||
class=""
|
||||
class="ant-scroll-number-only-unit"
|
||||
>
|
||||
1
|
||||
</p>
|
||||
<p
|
||||
class=""
|
||||
class="ant-scroll-number-only-unit"
|
||||
>
|
||||
2
|
||||
</p>
|
||||
<p
|
||||
class=""
|
||||
class="ant-scroll-number-only-unit"
|
||||
>
|
||||
3
|
||||
</p>
|
||||
<p
|
||||
class=""
|
||||
class="ant-scroll-number-only-unit"
|
||||
>
|
||||
4
|
||||
</p>
|
||||
<p
|
||||
class="current"
|
||||
class="ant-scroll-number-only-unit current"
|
||||
>
|
||||
5
|
||||
</p>
|
||||
<p
|
||||
class=""
|
||||
class="ant-scroll-number-only-unit"
|
||||
>
|
||||
6
|
||||
</p>
|
||||
<p
|
||||
class=""
|
||||
class="ant-scroll-number-only-unit"
|
||||
>
|
||||
7
|
||||
</p>
|
||||
<p
|
||||
class=""
|
||||
class="ant-scroll-number-only-unit"
|
||||
>
|
||||
8
|
||||
</p>
|
||||
<p
|
||||
class=""
|
||||
class="ant-scroll-number-only-unit"
|
||||
>
|
||||
9
|
||||
</p>
|
||||
<p
|
||||
class=""
|
||||
class="ant-scroll-number-only-unit"
|
||||
>
|
||||
0
|
||||
</p>
|
||||
<p
|
||||
class=""
|
||||
class="ant-scroll-number-only-unit"
|
||||
>
|
||||
1
|
||||
</p>
|
||||
<p
|
||||
class=""
|
||||
class="ant-scroll-number-only-unit"
|
||||
>
|
||||
2
|
||||
</p>
|
||||
<p
|
||||
class=""
|
||||
class="ant-scroll-number-only-unit"
|
||||
>
|
||||
3
|
||||
</p>
|
||||
<p
|
||||
class=""
|
||||
class="ant-scroll-number-only-unit"
|
||||
>
|
||||
4
|
||||
</p>
|
||||
<p
|
||||
class=""
|
||||
class="ant-scroll-number-only-unit"
|
||||
>
|
||||
5
|
||||
</p>
|
||||
<p
|
||||
class=""
|
||||
class="ant-scroll-number-only-unit"
|
||||
>
|
||||
6
|
||||
</p>
|
||||
<p
|
||||
class=""
|
||||
class="ant-scroll-number-only-unit"
|
||||
>
|
||||
7
|
||||
</p>
|
||||
<p
|
||||
class=""
|
||||
class="ant-scroll-number-only-unit"
|
||||
>
|
||||
8
|
||||
</p>
|
||||
<p
|
||||
class=""
|
||||
class="ant-scroll-number-only-unit"
|
||||
>
|
||||
9
|
||||
</p>
|
||||
@@ -805,152 +805,152 @@ exports[`ConfigProvider components Badge prefixCls 1`] = `
|
||||
style="transition:none;-ms-transform:translateY(-1500%);-webkit-transform:translateY(-1500%);transform:translateY(-1500%)"
|
||||
>
|
||||
<p
|
||||
class=""
|
||||
class="prefix-scroll-number-only-unit"
|
||||
>
|
||||
0
|
||||
</p>
|
||||
<p
|
||||
class=""
|
||||
class="prefix-scroll-number-only-unit"
|
||||
>
|
||||
1
|
||||
</p>
|
||||
<p
|
||||
class=""
|
||||
class="prefix-scroll-number-only-unit"
|
||||
>
|
||||
2
|
||||
</p>
|
||||
<p
|
||||
class=""
|
||||
class="prefix-scroll-number-only-unit"
|
||||
>
|
||||
3
|
||||
</p>
|
||||
<p
|
||||
class=""
|
||||
class="prefix-scroll-number-only-unit"
|
||||
>
|
||||
4
|
||||
</p>
|
||||
<p
|
||||
class=""
|
||||
class="prefix-scroll-number-only-unit"
|
||||
>
|
||||
5
|
||||
</p>
|
||||
<p
|
||||
class=""
|
||||
class="prefix-scroll-number-only-unit"
|
||||
>
|
||||
6
|
||||
</p>
|
||||
<p
|
||||
class=""
|
||||
class="prefix-scroll-number-only-unit"
|
||||
>
|
||||
7
|
||||
</p>
|
||||
<p
|
||||
class=""
|
||||
class="prefix-scroll-number-only-unit"
|
||||
>
|
||||
8
|
||||
</p>
|
||||
<p
|
||||
class=""
|
||||
class="prefix-scroll-number-only-unit"
|
||||
>
|
||||
9
|
||||
</p>
|
||||
<p
|
||||
class=""
|
||||
class="prefix-scroll-number-only-unit"
|
||||
>
|
||||
0
|
||||
</p>
|
||||
<p
|
||||
class=""
|
||||
class="prefix-scroll-number-only-unit"
|
||||
>
|
||||
1
|
||||
</p>
|
||||
<p
|
||||
class=""
|
||||
class="prefix-scroll-number-only-unit"
|
||||
>
|
||||
2
|
||||
</p>
|
||||
<p
|
||||
class=""
|
||||
class="prefix-scroll-number-only-unit"
|
||||
>
|
||||
3
|
||||
</p>
|
||||
<p
|
||||
class=""
|
||||
class="prefix-scroll-number-only-unit"
|
||||
>
|
||||
4
|
||||
</p>
|
||||
<p
|
||||
class="current"
|
||||
class="prefix-scroll-number-only-unit current"
|
||||
>
|
||||
5
|
||||
</p>
|
||||
<p
|
||||
class=""
|
||||
class="prefix-scroll-number-only-unit"
|
||||
>
|
||||
6
|
||||
</p>
|
||||
<p
|
||||
class=""
|
||||
class="prefix-scroll-number-only-unit"
|
||||
>
|
||||
7
|
||||
</p>
|
||||
<p
|
||||
class=""
|
||||
class="prefix-scroll-number-only-unit"
|
||||
>
|
||||
8
|
||||
</p>
|
||||
<p
|
||||
class=""
|
||||
class="prefix-scroll-number-only-unit"
|
||||
>
|
||||
9
|
||||
</p>
|
||||
<p
|
||||
class=""
|
||||
class="prefix-scroll-number-only-unit"
|
||||
>
|
||||
0
|
||||
</p>
|
||||
<p
|
||||
class=""
|
||||
class="prefix-scroll-number-only-unit"
|
||||
>
|
||||
1
|
||||
</p>
|
||||
<p
|
||||
class=""
|
||||
class="prefix-scroll-number-only-unit"
|
||||
>
|
||||
2
|
||||
</p>
|
||||
<p
|
||||
class=""
|
||||
class="prefix-scroll-number-only-unit"
|
||||
>
|
||||
3
|
||||
</p>
|
||||
<p
|
||||
class=""
|
||||
class="prefix-scroll-number-only-unit"
|
||||
>
|
||||
4
|
||||
</p>
|
||||
<p
|
||||
class=""
|
||||
class="prefix-scroll-number-only-unit"
|
||||
>
|
||||
5
|
||||
</p>
|
||||
<p
|
||||
class=""
|
||||
class="prefix-scroll-number-only-unit"
|
||||
>
|
||||
6
|
||||
</p>
|
||||
<p
|
||||
class=""
|
||||
class="prefix-scroll-number-only-unit"
|
||||
>
|
||||
7
|
||||
</p>
|
||||
<p
|
||||
class=""
|
||||
class="prefix-scroll-number-only-unit"
|
||||
>
|
||||
8
|
||||
</p>
|
||||
<p
|
||||
class=""
|
||||
class="prefix-scroll-number-only-unit"
|
||||
>
|
||||
9
|
||||
</p>
|
||||
@@ -8171,7 +8171,7 @@ exports[`ConfigProvider components Modal configProvider 1`] = `
|
||||
>
|
||||
<div
|
||||
aria-hidden="true"
|
||||
style="width:0;height:0;overflow:hidden"
|
||||
style="width:0;height:0;overflow:hidden;outline:none"
|
||||
tabindex="0"
|
||||
/>
|
||||
<div
|
||||
@@ -8236,7 +8236,7 @@ exports[`ConfigProvider components Modal configProvider 1`] = `
|
||||
</div>
|
||||
<div
|
||||
aria-hidden="true"
|
||||
style="width:0;height:0;overflow:hidden"
|
||||
style="width:0;height:0;overflow:hidden;outline:none"
|
||||
tabindex="0"
|
||||
/>
|
||||
</div>
|
||||
@@ -8265,7 +8265,7 @@ exports[`ConfigProvider components Modal normal 1`] = `
|
||||
>
|
||||
<div
|
||||
aria-hidden="true"
|
||||
style="width:0;height:0;overflow:hidden"
|
||||
style="width:0;height:0;overflow:hidden;outline:none"
|
||||
tabindex="0"
|
||||
/>
|
||||
<div
|
||||
@@ -8330,7 +8330,7 @@ exports[`ConfigProvider components Modal normal 1`] = `
|
||||
</div>
|
||||
<div
|
||||
aria-hidden="true"
|
||||
style="width:0;height:0;overflow:hidden"
|
||||
style="width:0;height:0;overflow:hidden;outline:none"
|
||||
tabindex="0"
|
||||
/>
|
||||
</div>
|
||||
@@ -8359,7 +8359,7 @@ exports[`ConfigProvider components Modal prefixCls 1`] = `
|
||||
>
|
||||
<div
|
||||
aria-hidden="true"
|
||||
style="width:0;height:0;overflow:hidden"
|
||||
style="width:0;height:0;overflow:hidden;outline:none"
|
||||
tabindex="0"
|
||||
/>
|
||||
<div
|
||||
@@ -8424,7 +8424,7 @@ exports[`ConfigProvider components Modal prefixCls 1`] = `
|
||||
</div>
|
||||
<div
|
||||
aria-hidden="true"
|
||||
style="width:0;height:0;overflow:hidden"
|
||||
style="width:0;height:0;overflow:hidden;outline:none"
|
||||
tabindex="0"
|
||||
/>
|
||||
</div>
|
||||
@@ -17396,7 +17396,7 @@ exports[`ConfigProvider components Upload configProvider 1`] = `
|
||||
</svg>
|
||||
</i>
|
||||
<span
|
||||
class="config-upload-list-item-name config-upload-list-item-name-icon-count-2"
|
||||
class="config-upload-list-item-name config-upload-list-item-name-icon-count-1"
|
||||
title="xxx.png"
|
||||
>
|
||||
xxx.png
|
||||
@@ -17404,31 +17404,6 @@ exports[`ConfigProvider components Upload configProvider 1`] = `
|
||||
<span
|
||||
class="config-upload-list-item-card-actions "
|
||||
>
|
||||
<a
|
||||
title="Download file"
|
||||
>
|
||||
<i
|
||||
aria-label="icon: download"
|
||||
class="anticon anticon-download"
|
||||
tabindex="-1"
|
||||
title="Download file"
|
||||
>
|
||||
<svg
|
||||
aria-hidden="true"
|
||||
class=""
|
||||
data-icon="download"
|
||||
fill="currentColor"
|
||||
focusable="false"
|
||||
height="1em"
|
||||
viewBox="64 64 896 896"
|
||||
width="1em"
|
||||
>
|
||||
<path
|
||||
d="M505.7 661a8 8 0 0 0 12.6 0l112-141.7c4.1-5.2.4-12.9-6.3-12.9h-74.1V168c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v338.3H400c-6.7 0-10.4 7.7-6.3 12.9l112 141.8zM878 626h-60c-4.4 0-8 3.6-8 8v154H214V634c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v198c0 17.7 14.3 32 32 32h684c17.7 0 32-14.3 32-32V634c0-4.4-3.6-8-8-8z"
|
||||
/>
|
||||
</svg>
|
||||
</i>
|
||||
</a>
|
||||
<a
|
||||
title="Remove file"
|
||||
>
|
||||
@@ -17505,7 +17480,7 @@ exports[`ConfigProvider components Upload normal 1`] = `
|
||||
</svg>
|
||||
</i>
|
||||
<span
|
||||
class="ant-upload-list-item-name ant-upload-list-item-name-icon-count-2"
|
||||
class="ant-upload-list-item-name ant-upload-list-item-name-icon-count-1"
|
||||
title="xxx.png"
|
||||
>
|
||||
xxx.png
|
||||
@@ -17513,31 +17488,6 @@ exports[`ConfigProvider components Upload normal 1`] = `
|
||||
<span
|
||||
class="ant-upload-list-item-card-actions "
|
||||
>
|
||||
<a
|
||||
title="Download file"
|
||||
>
|
||||
<i
|
||||
aria-label="icon: download"
|
||||
class="anticon anticon-download"
|
||||
tabindex="-1"
|
||||
title="Download file"
|
||||
>
|
||||
<svg
|
||||
aria-hidden="true"
|
||||
class=""
|
||||
data-icon="download"
|
||||
fill="currentColor"
|
||||
focusable="false"
|
||||
height="1em"
|
||||
viewBox="64 64 896 896"
|
||||
width="1em"
|
||||
>
|
||||
<path
|
||||
d="M505.7 661a8 8 0 0 0 12.6 0l112-141.7c4.1-5.2.4-12.9-6.3-12.9h-74.1V168c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v338.3H400c-6.7 0-10.4 7.7-6.3 12.9l112 141.8zM878 626h-60c-4.4 0-8 3.6-8 8v154H214V634c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v198c0 17.7 14.3 32 32 32h684c17.7 0 32-14.3 32-32V634c0-4.4-3.6-8-8-8z"
|
||||
/>
|
||||
</svg>
|
||||
</i>
|
||||
</a>
|
||||
<a
|
||||
title="Remove file"
|
||||
>
|
||||
@@ -17614,7 +17564,7 @@ exports[`ConfigProvider components Upload prefixCls 1`] = `
|
||||
</svg>
|
||||
</i>
|
||||
<span
|
||||
class="ant-upload-list-item-name ant-upload-list-item-name-icon-count-2"
|
||||
class="ant-upload-list-item-name ant-upload-list-item-name-icon-count-1"
|
||||
title="xxx.png"
|
||||
>
|
||||
xxx.png
|
||||
@@ -17622,31 +17572,6 @@ exports[`ConfigProvider components Upload prefixCls 1`] = `
|
||||
<span
|
||||
class="ant-upload-list-item-card-actions "
|
||||
>
|
||||
<a
|
||||
title="Download file"
|
||||
>
|
||||
<i
|
||||
aria-label="icon: download"
|
||||
class="anticon anticon-download"
|
||||
tabindex="-1"
|
||||
title="Download file"
|
||||
>
|
||||
<svg
|
||||
aria-hidden="true"
|
||||
class=""
|
||||
data-icon="download"
|
||||
fill="currentColor"
|
||||
focusable="false"
|
||||
height="1em"
|
||||
viewBox="64 64 896 896"
|
||||
width="1em"
|
||||
>
|
||||
<path
|
||||
d="M505.7 661a8 8 0 0 0 12.6 0l112-141.7c4.1-5.2.4-12.9-6.3-12.9h-74.1V168c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v338.3H400c-6.7 0-10.4 7.7-6.3 12.9l112 141.8zM878 626h-60c-4.4 0-8 3.6-8 8v154H214V634c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v198c0 17.7 14.3 32 32 32h684c17.7 0 32-14.3 32-32V634c0-4.4-3.6-8-8-8z"
|
||||
/>
|
||||
</svg>
|
||||
</i>
|
||||
</a>
|
||||
<a
|
||||
title="Remove file"
|
||||
>
|
||||
|
||||
@@ -18,22 +18,24 @@ describe('DatePicker', () => {
|
||||
});
|
||||
|
||||
it('should focus trigger input after select date in DatePicker', () => {
|
||||
const wrapper = mount(<DatePicker />);
|
||||
const wrapper = mount(<DatePicker />, { attachTo: document.body });
|
||||
openPanel(wrapper);
|
||||
selectDate(wrapper, moment('2016-11-23'));
|
||||
expect(wrapper.find('.ant-calendar-picker-input').getDOMNode()).toBe(document.activeElement);
|
||||
wrapper.unmount();
|
||||
});
|
||||
|
||||
it('should focus trigger input after select date in RangePicker', () => {
|
||||
const wrapper = mount(<RangePicker />);
|
||||
const wrapper = mount(<RangePicker />, { attachTo: document.body });
|
||||
openPanel(wrapper);
|
||||
selectDate(wrapper, moment('2016-11-23'), 0);
|
||||
selectDate(wrapper, moment('2016-11-28'), 1);
|
||||
expect(wrapper.find('.ant-calendar-picker').getDOMNode()).toBe(document.activeElement);
|
||||
wrapper.unmount();
|
||||
});
|
||||
|
||||
it('should focus trigger input after select date in MonthPicker', () => {
|
||||
const wrapper = mount(<MonthPicker />);
|
||||
const wrapper = mount(<MonthPicker />, { attachTo: document.body });
|
||||
openPanel(wrapper);
|
||||
wrapper
|
||||
.find('.ant-calendar-month-panel-month')
|
||||
@@ -44,46 +46,52 @@ describe('DatePicker', () => {
|
||||
.at(6)
|
||||
.hasClass('ant-calendar-month-panel-selected-cell');
|
||||
expect(wrapper.find('.ant-calendar-picker-input').getDOMNode()).toBe(document.activeElement);
|
||||
wrapper.unmount();
|
||||
});
|
||||
|
||||
it('should focus trigger input after select date in WeekPicker', () => {
|
||||
const wrapper = mount(<WeekPicker />);
|
||||
const wrapper = mount(<WeekPicker />, { attachTo: document.body });
|
||||
openPanel(wrapper);
|
||||
selectDate(wrapper, moment('2016-11-23'));
|
||||
expect(wrapper.find('.ant-calendar-picker-input').getDOMNode()).toBe(document.activeElement);
|
||||
wrapper.unmount();
|
||||
});
|
||||
|
||||
it('should not auto focus trigger input when open prop is true in DatePicker', () => {
|
||||
const wrapper = mount(<DatePicker open />);
|
||||
const wrapper = mount(<DatePicker open />, { attachTo: document.body });
|
||||
const wrapperInput = mount(<Input />);
|
||||
wrapperInput.instance().select();
|
||||
expect(wrapper.find('.ant-calendar-picker-input').getDOMNode()).not.toBe(
|
||||
document.activeElement,
|
||||
);
|
||||
wrapper.unmount();
|
||||
});
|
||||
|
||||
it('should not auto focus trigger input when open prop is true in RangePicker', () => {
|
||||
const wrapper = mount(<RangePicker open />);
|
||||
const wrapper = mount(<RangePicker open />, { attachTo: document.body });
|
||||
const wrapperInput = mount(<Input />);
|
||||
wrapperInput.instance().select();
|
||||
expect(wrapper.find('.ant-calendar-picker').getDOMNode()).not.toBe(document.activeElement);
|
||||
wrapper.unmount();
|
||||
});
|
||||
|
||||
it('should not auto focus trigger input when open prop is true in WeekPicker', () => {
|
||||
const wrapper = mount(<WeekPicker open />);
|
||||
const wrapper = mount(<WeekPicker open />, { attachTo: document.body });
|
||||
const wrapperInput = mount(<Input />);
|
||||
wrapperInput.instance().select();
|
||||
expect(wrapper.find('.ant-calendar-picker-input').getDOMNode()).not.toBe(
|
||||
document.activeElement,
|
||||
);
|
||||
wrapper.unmount();
|
||||
});
|
||||
|
||||
it('should not auto focus trigger input when open prop is true in MonthPicker', () => {
|
||||
const wrapper = mount(<MonthPicker open />);
|
||||
const wrapper = mount(<MonthPicker open />, { attachTo: document.body });
|
||||
const wrapperInput = mount(<Input />);
|
||||
wrapperInput.instance().select();
|
||||
expect(wrapper.find('.ant-calendar-picker-input').getDOMNode()).not.toBe(
|
||||
document.activeElement,
|
||||
);
|
||||
wrapper.unmount();
|
||||
});
|
||||
});
|
||||
|
||||
@@ -75,7 +75,9 @@ describe('DatePicker with showTime', () => {
|
||||
});
|
||||
|
||||
it('should have correct className when use12Hours is true', () => {
|
||||
const wrapper = mount(<DatePicker showTime={{ use12Hours: true }} open />);
|
||||
const wrapper = mount(
|
||||
<DatePicker defaultValue={moment()} showTime={{ use12Hours: true }} open />,
|
||||
);
|
||||
const calendarWrapper = mount(
|
||||
wrapper
|
||||
.find('Trigger')
|
||||
|
||||
@@ -127,7 +127,7 @@ The following APIs are shared by DatePicker, MonthPicker, RangePicker, WeekPicke
|
||||
| showTime | to provide an additional time selection | object\|boolean | [TimePicker Options](/components/time-picker/#API) | |
|
||||
| showTime.defaultValue | to set default time of selected date, [demo](#components-date-picker-demo-disabled-date) | [moment](http://momentjs.com/)\[] | \[moment(), moment()] | |
|
||||
| value | to set date | \[[moment](http://momentjs.com/), [moment](http://momentjs.com/)] | - | |
|
||||
| onCalendarChange | a callback function, can be executed when the start time or the end time of the range is changing | function(dates: \[moment, moment], dateStrings: \[string, string]) | - | 3.10.9 |
|
||||
| onCalendarChange | a callback function, can be executed when the start time or the end time of the range is changing | function(dates: \[moment, moment]) | - | 3.0.0 |
|
||||
| onChange | a callback function, can be executed when the selected time is changing | function(dates: \[moment, moment], dateStrings: \[string, string]) | - | |
|
||||
| onOk | callback when click ok button | function(dates: [moment](http://momentjs.com/)\[]) | - | |
|
||||
|
||||
|
||||
@@ -129,7 +129,7 @@ moment.locale('zh-cn');
|
||||
| showTime | 增加时间选择功能 | Object\|boolean | [TimePicker Options](/components/time-picker/#API) | |
|
||||
| showTime.defaultValue | 设置用户选择日期时默认的时分秒,[例子](#components-date-picker-demo-disabled-date) | [moment](http://momentjs.com/)\[] | \[moment(), moment()] | |
|
||||
| value | 日期 | [moment](http://momentjs.com/)\[] | 无 | |
|
||||
| onCalendarChange | 待选日期发生变化的回调 | function(dates: \[moment, moment\], dateStrings: \[string, string\]) | 无 | |
|
||||
| onCalendarChange | 待选日期发生变化的回调 | function(dates: \[moment, moment\]) | 无 | 3.0.0 |
|
||||
| onChange | 日期范围发生变化的回调 | function(dates: \[moment, moment\], dateStrings: \[string, string\]) | 无 | |
|
||||
| onOk | 点击确定按钮的回调 | function(dates: [moment](http://momentjs.com/)\[]) | - | |
|
||||
|
||||
|
||||
19
components/date-picker/locale/ga_IE.tsx
Normal file
19
components/date-picker/locale/ga_IE.tsx
Normal file
@@ -0,0 +1,19 @@
|
||||
import CalendarLocale from 'rc-calendar/lib/locale/ga_IE';
|
||||
import TimePickerLocale from '../../time-picker/locale/ga_IE';
|
||||
|
||||
// Merge into a locale object
|
||||
const locale = {
|
||||
lang: {
|
||||
placeholder: 'Select date',
|
||||
rangePlaceholder: ['Start date', 'End date'],
|
||||
...CalendarLocale,
|
||||
},
|
||||
timePickerLocale: {
|
||||
...TimePickerLocale,
|
||||
},
|
||||
};
|
||||
|
||||
// All settings at:
|
||||
// https://github.com/ant-design/ant-design/blob/master/components/date-picker/locale/example.json
|
||||
|
||||
export default locale;
|
||||
@@ -102,6 +102,10 @@
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
.@{ant-prefix}-input-disabled + &-icon {
|
||||
cursor: not-allowed;
|
||||
}
|
||||
|
||||
&-small &-clear,
|
||||
&-small &-icon {
|
||||
right: @control-padding-horizontal-sm;
|
||||
|
||||
@@ -41,7 +41,6 @@
|
||||
font-weight: normal;
|
||||
font-size: @font-size-base;
|
||||
line-height: @line-height-base;
|
||||
white-space: nowrap;
|
||||
|
||||
&::after {
|
||||
position: relative;
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
exports[`renders ./components/dropdown/demo/basic.md correctly 1`] = `
|
||||
<a
|
||||
class="ant-dropdown-link ant-dropdown-trigger"
|
||||
href="#"
|
||||
>
|
||||
Hover me
|
||||
<i
|
||||
@@ -184,7 +183,6 @@ exports[`renders ./components/dropdown/demo/dropdown-button.md correctly 1`] = `
|
||||
exports[`renders ./components/dropdown/demo/event.md correctly 1`] = `
|
||||
<a
|
||||
class="ant-dropdown-link ant-dropdown-trigger"
|
||||
href="#"
|
||||
>
|
||||
Hover me, Click menu item
|
||||
<i
|
||||
@@ -212,7 +210,6 @@ exports[`renders ./components/dropdown/demo/event.md correctly 1`] = `
|
||||
exports[`renders ./components/dropdown/demo/item.md correctly 1`] = `
|
||||
<a
|
||||
class="ant-dropdown-link ant-dropdown-trigger"
|
||||
href="#"
|
||||
>
|
||||
Hover me
|
||||
<i
|
||||
@@ -240,7 +237,6 @@ exports[`renders ./components/dropdown/demo/item.md correctly 1`] = `
|
||||
exports[`renders ./components/dropdown/demo/menu-full.md correctly 1`] = `
|
||||
<a
|
||||
class="ant-dropdown-link ant-dropdown-trigger"
|
||||
href="#"
|
||||
>
|
||||
Hover to check menu style
|
||||
<i
|
||||
@@ -268,7 +264,6 @@ exports[`renders ./components/dropdown/demo/menu-full.md correctly 1`] = `
|
||||
exports[`renders ./components/dropdown/demo/overlay-visible.md correctly 1`] = `
|
||||
<a
|
||||
class="ant-dropdown-link ant-dropdown-trigger"
|
||||
href="#"
|
||||
>
|
||||
Hover me
|
||||
<i
|
||||
@@ -350,7 +345,6 @@ exports[`renders ./components/dropdown/demo/placement.md correctly 1`] = `
|
||||
exports[`renders ./components/dropdown/demo/sub-menu.md correctly 1`] = `
|
||||
<a
|
||||
class="ant-dropdown-link ant-dropdown-trigger"
|
||||
href="#"
|
||||
>
|
||||
Cascading menu
|
||||
<i
|
||||
@@ -378,7 +372,6 @@ exports[`renders ./components/dropdown/demo/sub-menu.md correctly 1`] = `
|
||||
exports[`renders ./components/dropdown/demo/trigger.md correctly 1`] = `
|
||||
<a
|
||||
class="ant-dropdown-link ant-dropdown-trigger"
|
||||
href="#"
|
||||
>
|
||||
Click me
|
||||
<i
|
||||
|
||||
@@ -38,7 +38,7 @@ const menu = (
|
||||
|
||||
ReactDOM.render(
|
||||
<Dropdown overlay={menu}>
|
||||
<a className="ant-dropdown-link" href="#">
|
||||
<a className="ant-dropdown-link" onClick={e => e.preventDefault()}>
|
||||
Hover me <Icon type="down" />
|
||||
</a>
|
||||
</Dropdown>,
|
||||
|
||||
@@ -30,7 +30,7 @@ const menu = (
|
||||
|
||||
ReactDOM.render(
|
||||
<Dropdown overlay={menu}>
|
||||
<a className="ant-dropdown-link" href="#">
|
||||
<a className="ant-dropdown-link" onClick={e => e.preventDefault()}>
|
||||
Hover me, Click menu item <Icon type="down" />
|
||||
</a>
|
||||
</Dropdown>,
|
||||
|
||||
@@ -37,7 +37,7 @@ const menu = (
|
||||
|
||||
ReactDOM.render(
|
||||
<Dropdown overlay={menu}>
|
||||
<a className="ant-dropdown-link" href="#">
|
||||
<a className="ant-dropdown-link" onClick={e => e.preventDefault()}>
|
||||
Hover me <Icon type="down" />
|
||||
</a>
|
||||
</Dropdown>,
|
||||
|
||||
@@ -82,7 +82,7 @@ const menu = (
|
||||
|
||||
ReactDOM.render(
|
||||
<Dropdown overlay={menu}>
|
||||
<a className="ant-dropdown-link" href="#">
|
||||
<a className="ant-dropdown-link" onClick={e => e.preventDefault()}>
|
||||
Hover to check menu style <Icon type="down" />
|
||||
</a>
|
||||
</Dropdown>,
|
||||
|
||||
@@ -45,7 +45,7 @@ class OverlayVisible extends React.Component {
|
||||
onVisibleChange={this.handleVisibleChange}
|
||||
visible={this.state.visible}
|
||||
>
|
||||
<a className="ant-dropdown-link" href="#">
|
||||
<a className="ant-dropdown-link" onClick={e => e.preventDefault()}>
|
||||
Hover me <Icon type="down" />
|
||||
</a>
|
||||
</Dropdown>
|
||||
|
||||
@@ -35,7 +35,7 @@ const menu = (
|
||||
|
||||
ReactDOM.render(
|
||||
<Dropdown overlay={menu}>
|
||||
<a className="ant-dropdown-link" href="#">
|
||||
<a className="ant-dropdown-link" onClick={e => e.preventDefault()}>
|
||||
Cascading menu <Icon type="down" />
|
||||
</a>
|
||||
</Dropdown>,
|
||||
|
||||
@@ -31,7 +31,7 @@ const menu = (
|
||||
|
||||
ReactDOM.render(
|
||||
<Dropdown overlay={menu} trigger={['click']}>
|
||||
<a className="ant-dropdown-link" href="#">
|
||||
<a className="ant-dropdown-link" onClick={e => e.preventDefault()}>
|
||||
Click me <Icon type="down" />
|
||||
</a>
|
||||
</Dropdown>,
|
||||
|
||||
@@ -257,7 +257,7 @@ export default class FormItem extends React.Component<FormItemProps, any> {
|
||||
let classes = `${prefixCls}-item-control`;
|
||||
if (validateStatus) {
|
||||
classes = classNames(`${prefixCls}-item-control`, {
|
||||
'has-feedback': props.hasFeedback || validateStatus === 'validating',
|
||||
'has-feedback': validateStatus && props.hasFeedback,
|
||||
'has-success': validateStatus === 'success',
|
||||
'has-warning': validateStatus === 'warning',
|
||||
'has-error': validateStatus === 'error',
|
||||
|
||||
@@ -26,3 +26,161 @@ exports[`Form Form.Item should support data-*、aria-* and custom attribute 1`]
|
||||
</div>
|
||||
</form>
|
||||
`;
|
||||
|
||||
exports[`Form FormItem FormItem: generate snapshot when validates fields 1`] = `
|
||||
<form
|
||||
class="ant-form ant-form-horizontal"
|
||||
>
|
||||
<div
|
||||
class="ant-row ant-form-item"
|
||||
>
|
||||
<div
|
||||
class="ant-col ant-form-item-control-wrapper"
|
||||
>
|
||||
<div
|
||||
class="ant-form-item-control"
|
||||
>
|
||||
<span
|
||||
class="ant-form-item-children"
|
||||
>
|
||||
<span
|
||||
class="ant-input-affix-wrapper"
|
||||
>
|
||||
<input
|
||||
class="ant-input"
|
||||
data-__field="[object Object]"
|
||||
data-__meta="[object Object]"
|
||||
id="test"
|
||||
type="text"
|
||||
value=""
|
||||
/>
|
||||
<span
|
||||
class="ant-input-suffix"
|
||||
/>
|
||||
</span>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
`;
|
||||
|
||||
exports[`Form FormItem FormItem: generate snapshot when validates fields 2`] = `
|
||||
<form
|
||||
class="ant-form ant-form-horizontal"
|
||||
>
|
||||
<div
|
||||
class="ant-row ant-form-item"
|
||||
>
|
||||
<div
|
||||
class="ant-col ant-form-item-control-wrapper"
|
||||
>
|
||||
<div
|
||||
class="ant-form-item-control is-validating"
|
||||
>
|
||||
<span
|
||||
class="ant-form-item-children"
|
||||
>
|
||||
<span
|
||||
class="ant-input-affix-wrapper"
|
||||
>
|
||||
<input
|
||||
class="ant-input"
|
||||
data-__field="[object Object]"
|
||||
data-__meta="[object Object]"
|
||||
id="test"
|
||||
type="text"
|
||||
value="test"
|
||||
/>
|
||||
<span
|
||||
class="ant-input-suffix"
|
||||
>
|
||||
<i
|
||||
aria-label="icon: close-circle"
|
||||
class="anticon anticon-close-circle ant-input-clear-icon"
|
||||
role="button"
|
||||
tabindex="-1"
|
||||
>
|
||||
<svg
|
||||
aria-hidden="true"
|
||||
class=""
|
||||
data-icon="close-circle"
|
||||
fill="currentColor"
|
||||
focusable="false"
|
||||
height="1em"
|
||||
viewBox="64 64 896 896"
|
||||
width="1em"
|
||||
>
|
||||
<path
|
||||
d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm165.4 618.2l-66-.3L512 563.4l-99.3 118.4-66.1.3c-4.4 0-8-3.5-8-8 0-1.9.7-3.7 1.9-5.2l130.1-155L340.5 359a8.32 8.32 0 0 1-1.9-5.2c0-4.4 3.6-8 8-8l66.1.3L512 464.6l99.3-118.4 66-.3c4.4 0 8 3.5 8 8 0 1.9-.7 3.7-1.9 5.2L553.5 514l130 155c1.2 1.5 1.9 3.3 1.9 5.2 0 4.4-3.6 8-8 8z"
|
||||
/>
|
||||
</svg>
|
||||
</i>
|
||||
</span>
|
||||
</span>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
`;
|
||||
|
||||
exports[`Form FormItem FormItem: generate snapshot when validates fields 3`] = `
|
||||
<form
|
||||
class="ant-form ant-form-horizontal"
|
||||
>
|
||||
<div
|
||||
class="ant-row ant-form-item"
|
||||
>
|
||||
<div
|
||||
class="ant-col ant-form-item-control-wrapper"
|
||||
>
|
||||
<div
|
||||
class="ant-form-item-control has-success"
|
||||
>
|
||||
<span
|
||||
class="ant-form-item-children"
|
||||
>
|
||||
<span
|
||||
class="ant-input-affix-wrapper"
|
||||
>
|
||||
<input
|
||||
class="ant-input"
|
||||
data-__field="[object Object]"
|
||||
data-__meta="[object Object]"
|
||||
id="test"
|
||||
type="text"
|
||||
value="test"
|
||||
/>
|
||||
<span
|
||||
class="ant-input-suffix"
|
||||
>
|
||||
<i
|
||||
aria-label="icon: close-circle"
|
||||
class="anticon anticon-close-circle ant-input-clear-icon"
|
||||
role="button"
|
||||
tabindex="-1"
|
||||
>
|
||||
<svg
|
||||
aria-hidden="true"
|
||||
class=""
|
||||
data-icon="close-circle"
|
||||
fill="currentColor"
|
||||
focusable="false"
|
||||
height="1em"
|
||||
viewBox="64 64 896 896"
|
||||
width="1em"
|
||||
>
|
||||
<path
|
||||
d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm165.4 618.2l-66-.3L512 563.4l-99.3 118.4-66.1.3c-4.4 0-8-3.5-8-8 0-1.9.7-3.7 1.9-5.2l130.1-155L340.5 359a8.32 8.32 0 0 1-1.9-5.2c0-4.4 3.6-8 8-8l66.1.3L512 464.6l99.3-118.4 66-.3c4.4 0 8 3.5 8 8 0 1.9-.7 3.7-1.9 5.2L553.5 514l130 155c1.2 1.5 1.9 3.3 1.9 5.2 0 4.4-3.6 8-8 8z"
|
||||
/>
|
||||
</svg>
|
||||
</i>
|
||||
</span>
|
||||
</span>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
`;
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
import React from 'react';
|
||||
import { mount, render } from 'enzyme';
|
||||
import Form from '..';
|
||||
import Input from '../../input';
|
||||
import mountTest from '../../../tests/shared/mountTest';
|
||||
import './type.test';
|
||||
|
||||
@@ -58,4 +59,35 @@ describe('Form', () => {
|
||||
expect(form).toBeInstanceOf(TestForm);
|
||||
});
|
||||
});
|
||||
|
||||
describe('FormItem', () => {
|
||||
it('FormItem: generate snapshot when validates fields', async done => {
|
||||
let wrapper;
|
||||
const TestForm = props => (
|
||||
<Form>
|
||||
<Form.Item>
|
||||
{props.form.getFieldDecorator('test', {
|
||||
rules: [
|
||||
{
|
||||
validator: (rule, value, callback) => {
|
||||
setTimeout(() => {
|
||||
callback();
|
||||
expect(wrapper.render()).toMatchSnapshot(); // after validate
|
||||
done();
|
||||
}, 100);
|
||||
},
|
||||
},
|
||||
],
|
||||
})(<Input allowClear />)}
|
||||
</Form.Item>
|
||||
</Form>
|
||||
);
|
||||
const Wrapped = Form.create()(TestForm);
|
||||
wrapper = mount(<Wrapped />);
|
||||
expect(wrapper.render()).toMatchSnapshot(); // before validate
|
||||
wrapper.find('.ant-input').simulate('change', { target: { value: 'test' } });
|
||||
await new Promise(resolve => setTimeout(resolve, 0));
|
||||
expect(wrapper.render()).toMatchSnapshot(); // validating
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -176,6 +176,7 @@ describe('Form', () => {
|
||||
<Form1 />
|
||||
<Form2 />
|
||||
</div>,
|
||||
{ attachTo: document.body },
|
||||
);
|
||||
wrapper
|
||||
.find('Form label')
|
||||
@@ -197,6 +198,7 @@ describe('Form', () => {
|
||||
.at(1)
|
||||
.getDOMNode(),
|
||||
).toBe(document.activeElement);
|
||||
wrapper.unmount();
|
||||
});
|
||||
|
||||
// https://github.com/ant-design/ant-design/issues/7693
|
||||
@@ -208,7 +210,7 @@ describe('Form', () => {
|
||||
</Form.Item>
|
||||
</Form>
|
||||
));
|
||||
const wrapper = mount(<Form1 />);
|
||||
const wrapper = mount(<Form1 />, { attachTo: document.body });
|
||||
expect(() => {
|
||||
wrapper
|
||||
.find('Form label')
|
||||
@@ -221,6 +223,7 @@ describe('Form', () => {
|
||||
.at(0)
|
||||
.getDOMNode(),
|
||||
).toBe(document.activeElement);
|
||||
wrapper.unmount();
|
||||
});
|
||||
|
||||
it('should `labelAlign` work in FormItem', () => {
|
||||
|
||||
@@ -262,11 +262,18 @@ form {
|
||||
// fix input with addon position. https://github.com/ant-design/ant-design/issues/8243
|
||||
:not(.@{ant-prefix}-input-group-wrapper) > .@{ant-prefix}-input-group,
|
||||
.@{ant-prefix}-input-group-wrapper {
|
||||
position: relative;
|
||||
top: -1px;
|
||||
display: inline-block;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
// https://github.com/ant-design/ant-design/issues/20616
|
||||
&:not(.@{form-prefix-cls}-vertical) {
|
||||
:not(.@{ant-prefix}-input-group-wrapper) > .@{ant-prefix}-input-group,
|
||||
.@{ant-prefix}-input-group-wrapper {
|
||||
position: relative;
|
||||
top: -1px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Form layout
|
||||
|
||||
@@ -10,6 +10,10 @@
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.@{ant-prefix}-row + .@{ant-prefix}-row::before {
|
||||
clear: both;
|
||||
}
|
||||
|
||||
.@{ant-prefix}-row-flex {
|
||||
display: flex;
|
||||
flex-flow: row wrap;
|
||||
|
||||
@@ -16,7 +16,7 @@ export function hasPrefixSuffix(props: InputProps | ClearableInputProps) {
|
||||
*/
|
||||
interface BasicProps {
|
||||
prefixCls: string;
|
||||
inputType: (typeof ClearableInputType)[number];
|
||||
inputType: typeof ClearableInputType[number];
|
||||
value?: any;
|
||||
defaultValue?: any;
|
||||
allowClear?: boolean;
|
||||
@@ -25,13 +25,14 @@ interface BasicProps {
|
||||
className?: string;
|
||||
style?: object;
|
||||
disabled?: boolean;
|
||||
readOnly?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* This props only for input.
|
||||
*/
|
||||
interface ClearableInputProps extends BasicProps {
|
||||
size?: (typeof InputSizes)[number];
|
||||
size?: typeof InputSizes[number];
|
||||
suffix?: React.ReactNode;
|
||||
prefix?: React.ReactNode;
|
||||
addonBefore?: React.ReactNode;
|
||||
@@ -40,8 +41,15 @@ interface ClearableInputProps extends BasicProps {
|
||||
|
||||
class ClearableLabeledInput extends React.Component<ClearableInputProps> {
|
||||
renderClearIcon(prefixCls: string) {
|
||||
const { allowClear, value, disabled, inputType, handleReset } = this.props;
|
||||
if (!allowClear || disabled || value === undefined || value === null || value === '') {
|
||||
const { allowClear, value, disabled, readOnly, inputType, handleReset } = this.props;
|
||||
if (
|
||||
!allowClear ||
|
||||
disabled ||
|
||||
readOnly ||
|
||||
value === undefined ||
|
||||
value === null ||
|
||||
value === ''
|
||||
) {
|
||||
return null;
|
||||
}
|
||||
const className =
|
||||
|
||||
@@ -65,6 +65,7 @@ class ResizableTextArea extends React.Component<TextAreaProps, TextAreaState> {
|
||||
raf.cancel(this.resizeFrameId);
|
||||
this.resizeFrameId = raf(() => {
|
||||
this.setState({ resizing: false });
|
||||
this.fixFirefoxAutoScroll();
|
||||
});
|
||||
});
|
||||
};
|
||||
@@ -74,6 +75,21 @@ class ResizableTextArea extends React.Component<TextAreaProps, TextAreaState> {
|
||||
raf.cancel(this.resizeFrameId);
|
||||
}
|
||||
|
||||
// https://github.com/ant-design/ant-design/issues/21870
|
||||
fixFirefoxAutoScroll() {
|
||||
try {
|
||||
if (document.activeElement === this.textArea) {
|
||||
const currentStart = this.textArea.selectionStart;
|
||||
const currentEnd = this.textArea.selectionEnd;
|
||||
this.textArea.setSelectionRange(currentStart, currentEnd);
|
||||
}
|
||||
} catch (e) {
|
||||
// Fix error in Chrome:
|
||||
// Failed to read the 'selectionStart' property from 'HTMLInputElement'
|
||||
// http://stackoverflow.com/q/21177489/3040605
|
||||
}
|
||||
}
|
||||
|
||||
renderTextArea = () => {
|
||||
const { prefixCls, autoSize, autosize, className, disabled } = this.props;
|
||||
const { textareaStyles, resizing } = this.state;
|
||||
@@ -101,7 +117,7 @@ class ResizableTextArea extends React.Component<TextAreaProps, TextAreaState> {
|
||||
const style = {
|
||||
...this.props.style,
|
||||
...textareaStyles,
|
||||
...(resizing ? { overflow: 'hidden' } : null),
|
||||
...(resizing ? { overflowX: 'hidden', overflowY: 'hidden' } : null),
|
||||
};
|
||||
return (
|
||||
<ResizeObserver onResize={this.resizeOnNextFrame} disabled={!(autoSize || autosize)}>
|
||||
|
||||
@@ -49,7 +49,9 @@ describe('Input.Password', () => {
|
||||
});
|
||||
|
||||
it('should keep focus state', () => {
|
||||
const wrapper = mount(<Input.Password defaultValue="111" autoFocus />);
|
||||
const wrapper = mount(<Input.Password defaultValue="111" autoFocus />, {
|
||||
attachTo: document.body,
|
||||
});
|
||||
expect(document.activeElement).toBe(
|
||||
wrapper
|
||||
.find('input')
|
||||
|
||||
@@ -47,7 +47,7 @@ describe('Input', () => {
|
||||
expect(errorSpy).not.toHaveBeenCalled();
|
||||
});
|
||||
it('trigger warning', () => {
|
||||
const wrapper = mount(<Input />);
|
||||
const wrapper = mount(<Input />, { attachTo: document.body });
|
||||
wrapper
|
||||
.find('input')
|
||||
.instance()
|
||||
@@ -58,6 +58,7 @@ describe('Input', () => {
|
||||
expect(errorSpy).toHaveBeenCalledWith(
|
||||
'Warning: [antd: Input] When Input is focused, dynamic add or remove prefix / suffix will make it lose focus caused by dom structure change. Read more: https://ant.design/components/input/#FAQ',
|
||||
);
|
||||
wrapper.unmount();
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -299,7 +300,7 @@ describe('Input allowClear', () => {
|
||||
});
|
||||
|
||||
it('should focus input after clear', () => {
|
||||
const wrapper = mount(<Input allowClear defaultValue="111" />);
|
||||
const wrapper = mount(<Input allowClear defaultValue="111" />, { attachTo: document.body });
|
||||
wrapper
|
||||
.find('.ant-input-clear-icon')
|
||||
.at(0)
|
||||
@@ -310,11 +311,14 @@ describe('Input allowClear', () => {
|
||||
.at(0)
|
||||
.getDOMNode(),
|
||||
);
|
||||
wrapper.unmount();
|
||||
});
|
||||
|
||||
it('should not support allowClear when it is disabled', () => {
|
||||
const wrapper = mount(<Input allowClear defaultValue="111" disabled />);
|
||||
expect(wrapper.find('.ant-input-clear-icon').length).toBe(0);
|
||||
['disabled', 'readOnly'].forEach(prop => {
|
||||
it(`should not support allowClear when it is ${prop}`, () => {
|
||||
const wrapper = mount(<Input allowClear defaultValue="111" {...{ [prop]: true }} />);
|
||||
expect(wrapper.find('.ant-input-clear-icon').length).toBe(0);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -397,7 +401,7 @@ describe('TextArea allowClear', () => {
|
||||
});
|
||||
|
||||
it('should focus textarea after clear', () => {
|
||||
const wrapper = mount(<TextArea allowClear defaultValue="111" />);
|
||||
const wrapper = mount(<TextArea allowClear defaultValue="111" />, { attachTo: document.body });
|
||||
wrapper
|
||||
.find('.ant-input-textarea-clear-icon')
|
||||
.at(0)
|
||||
@@ -408,6 +412,7 @@ describe('TextArea allowClear', () => {
|
||||
.at(0)
|
||||
.getDOMNode(),
|
||||
);
|
||||
wrapper.unmount();
|
||||
});
|
||||
|
||||
it('should not support allowClear when it is disabled', () => {
|
||||
|
||||
@@ -35,7 +35,7 @@ function formatNumber(value) {
|
||||
class NumericInput extends React.Component {
|
||||
onChange = e => {
|
||||
const { value } = e.target;
|
||||
const reg = /^-?(0|[1-9][0-9]*)(\.[0-9]*)?$/;
|
||||
const reg = /^-?[0-9]*(\.[0-9]*)?$/;
|
||||
if ((!isNaN(value) && reg.test(value)) || value === '' || value === '-') {
|
||||
this.props.onChange(value);
|
||||
}
|
||||
@@ -44,9 +44,11 @@ class NumericInput extends React.Component {
|
||||
// '.' at the end or only '-' in the input box.
|
||||
onBlur = () => {
|
||||
const { value, onBlur, onChange } = this.props;
|
||||
let valueTemp = value;
|
||||
if (value.charAt(value.length - 1) === '.' || value === '-') {
|
||||
onChange(value.slice(0, -1));
|
||||
valueTemp = value.slice(0, -1);
|
||||
}
|
||||
onChange(valueTemp.replace(/0*(\d+)/, '$1'));
|
||||
if (onBlur) {
|
||||
onBlur();
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@ import { ConfigConsumer, ConfigConsumerProps } from '../config-provider';
|
||||
export interface GeneratorProps {
|
||||
suffixCls: string;
|
||||
tagName: 'header' | 'footer' | 'main' | 'section';
|
||||
displayName: string;
|
||||
}
|
||||
export interface BasicProps extends React.HTMLAttributes<HTMLDivElement> {
|
||||
prefixCls?: string;
|
||||
@@ -30,9 +31,11 @@ interface BasicPropsWithTagName extends BasicProps {
|
||||
tagName: 'header' | 'footer' | 'main' | 'section';
|
||||
}
|
||||
|
||||
function generator({ suffixCls, tagName }: GeneratorProps) {
|
||||
function generator({ suffixCls, tagName, displayName }: GeneratorProps) {
|
||||
return (BasicComponent: any) => {
|
||||
return class Adapter extends React.Component<BasicProps, any> {
|
||||
static displayName: string = displayName;
|
||||
|
||||
static Header: any;
|
||||
|
||||
static Footer: any;
|
||||
@@ -108,21 +111,25 @@ const Layout: React.ComponentClass<BasicProps> & {
|
||||
} = generator({
|
||||
suffixCls: 'layout',
|
||||
tagName: 'section',
|
||||
displayName: 'Layout',
|
||||
})(BasicLayout);
|
||||
|
||||
const Header = generator({
|
||||
suffixCls: 'layout-header',
|
||||
tagName: 'header',
|
||||
displayName: 'Header',
|
||||
})(Basic);
|
||||
|
||||
const Footer = generator({
|
||||
suffixCls: 'layout-footer',
|
||||
tagName: 'footer',
|
||||
displayName: 'Footer',
|
||||
})(Basic);
|
||||
|
||||
const Content = generator({
|
||||
suffixCls: 'layout-content',
|
||||
tagName: 'main',
|
||||
displayName: 'Content',
|
||||
})(Basic);
|
||||
|
||||
Layout.Header = Header;
|
||||
|
||||
@@ -72,7 +72,7 @@ export default class Item extends React.Component<ListItemProps, any> {
|
||||
|
||||
context: any;
|
||||
|
||||
isItemContainsTextNode() {
|
||||
isItemContainsTextNodeAndNotSingular() {
|
||||
const { children } = this.props;
|
||||
let result;
|
||||
React.Children.forEach(children, (element: React.ReactElement<any>) => {
|
||||
@@ -80,7 +80,7 @@ export default class Item extends React.Component<ListItemProps, any> {
|
||||
result = true;
|
||||
}
|
||||
});
|
||||
return result;
|
||||
return result && React.Children.count(children) > 1;
|
||||
}
|
||||
|
||||
isFlexMode() {
|
||||
@@ -89,7 +89,7 @@ export default class Item extends React.Component<ListItemProps, any> {
|
||||
if (itemLayout === 'vertical') {
|
||||
return !!extra;
|
||||
}
|
||||
return !this.isItemContainsTextNode();
|
||||
return !this.isItemContainsTextNodeAndNotSingular();
|
||||
}
|
||||
|
||||
renderItem = ({ getPrefixCls }: ConfigConsumerProps) => {
|
||||
|
||||
@@ -763,27 +763,27 @@ exports[`renders ./components/list/demo/simple.md correctly 1`] = `
|
||||
class="ant-list-items"
|
||||
>
|
||||
<li
|
||||
class="ant-list-item ant-list-item-no-flex"
|
||||
class="ant-list-item"
|
||||
>
|
||||
Racing car sprays burning fuel into crowd.
|
||||
</li>
|
||||
<li
|
||||
class="ant-list-item ant-list-item-no-flex"
|
||||
class="ant-list-item"
|
||||
>
|
||||
Japanese princess to wed commoner.
|
||||
</li>
|
||||
<li
|
||||
class="ant-list-item ant-list-item-no-flex"
|
||||
class="ant-list-item"
|
||||
>
|
||||
Australian walks 100km after outback crash.
|
||||
</li>
|
||||
<li
|
||||
class="ant-list-item ant-list-item-no-flex"
|
||||
class="ant-list-item"
|
||||
>
|
||||
Man charged over missing wedding girl.
|
||||
</li>
|
||||
<li
|
||||
class="ant-list-item ant-list-item-no-flex"
|
||||
class="ant-list-item"
|
||||
>
|
||||
Los Angeles battles huge wildfires.
|
||||
</li>
|
||||
@@ -823,27 +823,27 @@ exports[`renders ./components/list/demo/simple.md correctly 1`] = `
|
||||
class="ant-list-items"
|
||||
>
|
||||
<li
|
||||
class="ant-list-item ant-list-item-no-flex"
|
||||
class="ant-list-item"
|
||||
>
|
||||
Racing car sprays burning fuel into crowd.
|
||||
</li>
|
||||
<li
|
||||
class="ant-list-item ant-list-item-no-flex"
|
||||
class="ant-list-item"
|
||||
>
|
||||
Japanese princess to wed commoner.
|
||||
</li>
|
||||
<li
|
||||
class="ant-list-item ant-list-item-no-flex"
|
||||
class="ant-list-item"
|
||||
>
|
||||
Australian walks 100km after outback crash.
|
||||
</li>
|
||||
<li
|
||||
class="ant-list-item ant-list-item-no-flex"
|
||||
class="ant-list-item"
|
||||
>
|
||||
Man charged over missing wedding girl.
|
||||
</li>
|
||||
<li
|
||||
class="ant-list-item ant-list-item-no-flex"
|
||||
class="ant-list-item"
|
||||
>
|
||||
Los Angeles battles huge wildfires.
|
||||
</li>
|
||||
|
||||
@@ -52,6 +52,7 @@
|
||||
&-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: @list-item-padding;
|
||||
|
||||
&-content {
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -17,6 +17,7 @@ import {
|
||||
Select,
|
||||
Transfer,
|
||||
} from '../..';
|
||||
import gaIE from '../ga_IE';
|
||||
import arEG from '../ar_EG';
|
||||
import bgBG from '../bg_BG';
|
||||
import caES from '../ca_ES';
|
||||
@@ -70,6 +71,7 @@ import zhCN from '../zh_CN';
|
||||
import zhTW from '../zh_TW';
|
||||
|
||||
const locales = [
|
||||
gaIE,
|
||||
arEG,
|
||||
bgBG,
|
||||
caES,
|
||||
|
||||
3
components/locale-provider/ga_IE.tsx
Normal file
3
components/locale-provider/ga_IE.tsx
Normal file
@@ -0,0 +1,3 @@
|
||||
import locale from '../locale/ga_IE';
|
||||
|
||||
export default locale;
|
||||
43
components/locale/ga_IE.tsx
Normal file
43
components/locale/ga_IE.tsx
Normal file
@@ -0,0 +1,43 @@
|
||||
import Pagination from 'rc-pagination/lib/locale/ga_IE';
|
||||
import DatePicker from '../date-picker/locale/ga_IE';
|
||||
import TimePicker from '../time-picker/locale/ga_IE';
|
||||
import Calendar from '../calendar/locale/ga_IE';
|
||||
|
||||
export default {
|
||||
locale: 'ga_IE',
|
||||
Pagination,
|
||||
DatePicker,
|
||||
TimePicker,
|
||||
Calendar,
|
||||
Table: {
|
||||
filterTitle: 'Scagaire roghchlár',
|
||||
filterConfirm: 'Ceart go leor',
|
||||
filterReset: 'Athshocraigh',
|
||||
selectAll: 'Roghnaigh an leathanach reatha',
|
||||
selectInvert: 'Inbhéartaigh an leathanach reatha',
|
||||
},
|
||||
Modal: {
|
||||
okText: 'Ceart go leor',
|
||||
cancelText: 'Cealaigh',
|
||||
justOkText: 'Ceart go leor',
|
||||
},
|
||||
Popconfirm: {
|
||||
okText: 'Ceart go leor',
|
||||
cancelText: 'Cealaigh',
|
||||
},
|
||||
Transfer: {
|
||||
searchPlaceholder: 'Cuardaigh anseo',
|
||||
itemUnit: 'mír',
|
||||
itemsUnit: 'míreanna',
|
||||
},
|
||||
Upload: {
|
||||
uploading: 'Uaslódáil ...',
|
||||
removeFile: 'Bain comhad',
|
||||
uploadError: 'Earráid uaslódáil',
|
||||
previewFile: 'Comhad réamhamhairc',
|
||||
downloadFile: 'Íoslódáil an comhad',
|
||||
},
|
||||
Empty: {
|
||||
description: 'Gan aon sonraí',
|
||||
},
|
||||
};
|
||||
@@ -1,14 +1,14 @@
|
||||
import * as React from 'react';
|
||||
import * as ReactDOM from 'react-dom';
|
||||
import Button from '../button';
|
||||
import { ButtonType, NativeButtonProps } from '../button/button';
|
||||
import { ButtonType, ButtonProps } from '../button/button';
|
||||
|
||||
export interface ActionButtonProps {
|
||||
type?: ButtonType;
|
||||
actionFn?: (...args: any[]) => any | PromiseLike<any>;
|
||||
closeModal: Function;
|
||||
autoFocus?: boolean;
|
||||
buttonProps?: NativeButtonProps;
|
||||
buttonProps?: ButtonProps;
|
||||
}
|
||||
|
||||
export interface ActionButtonState {
|
||||
|
||||
@@ -6,7 +6,7 @@ import addEventListener from 'rc-util/lib/Dom/addEventListener';
|
||||
import { getConfirmLocale } from './locale';
|
||||
import Icon from '../icon';
|
||||
import Button from '../button';
|
||||
import { ButtonType, NativeButtonProps } from '../button/button';
|
||||
import { ButtonType, ButtonProps } from '../button/button';
|
||||
import LocaleReceiver from '../locale-provider/LocaleReceiver';
|
||||
import { ConfigConsumer, ConfigConsumerProps } from '../config-provider';
|
||||
|
||||
@@ -60,8 +60,8 @@ export interface ModalProps {
|
||||
maskClosable?: boolean;
|
||||
/** 强制渲染 Modal */
|
||||
forceRender?: boolean;
|
||||
okButtonProps?: NativeButtonProps;
|
||||
cancelButtonProps?: NativeButtonProps;
|
||||
okButtonProps?: ButtonProps;
|
||||
cancelButtonProps?: ButtonProps;
|
||||
destroyOnClose?: boolean;
|
||||
style?: React.CSSProperties;
|
||||
wrapClassName?: string;
|
||||
@@ -90,11 +90,10 @@ export interface ModalFuncProps {
|
||||
// TODO: find out exact types
|
||||
onOk?: (...args: any[]) => any;
|
||||
onCancel?: (...args: any[]) => any;
|
||||
okButtonProps?: NativeButtonProps;
|
||||
cancelButtonProps?: NativeButtonProps;
|
||||
okButtonProps?: ButtonProps;
|
||||
cancelButtonProps?: ButtonProps;
|
||||
centered?: boolean;
|
||||
width?: string | number;
|
||||
iconClassName?: string;
|
||||
okText?: React.ReactNode;
|
||||
okType?: ButtonType;
|
||||
cancelText?: React.ReactNode;
|
||||
|
||||
@@ -22,7 +22,7 @@ exports[`Modal render correctly 1`] = `
|
||||
>
|
||||
<div
|
||||
aria-hidden="true"
|
||||
style="width: 0px; height: 0px; overflow: hidden;"
|
||||
style="width: 0px; height: 0px; overflow: hidden; outline: none;"
|
||||
tabindex="0"
|
||||
/>
|
||||
<div
|
||||
@@ -87,7 +87,7 @@ exports[`Modal render correctly 1`] = `
|
||||
</div>
|
||||
<div
|
||||
aria-hidden="true"
|
||||
style="width: 0px; height: 0px; overflow: hidden;"
|
||||
style="width: 0px; height: 0px; overflow: hidden; outline: none;"
|
||||
tabindex="0"
|
||||
/>
|
||||
</div>
|
||||
@@ -120,7 +120,7 @@ exports[`Modal render without footer 1`] = `
|
||||
>
|
||||
<div
|
||||
aria-hidden="true"
|
||||
style="width: 0px; height: 0px; overflow: hidden;"
|
||||
style="width: 0px; height: 0px; overflow: hidden; outline: none;"
|
||||
tabindex="0"
|
||||
/>
|
||||
<div
|
||||
@@ -163,7 +163,7 @@ exports[`Modal render without footer 1`] = `
|
||||
</div>
|
||||
<div
|
||||
aria-hidden="true"
|
||||
style="width: 0px; height: 0px; overflow: hidden;"
|
||||
style="width: 0px; height: 0px; overflow: hidden; outline: none;"
|
||||
tabindex="0"
|
||||
/>
|
||||
</div>
|
||||
@@ -193,7 +193,7 @@ exports[`Modal support closeIcon 1`] = `
|
||||
>
|
||||
<div
|
||||
aria-hidden="true"
|
||||
style="width: 0px; height: 0px; overflow: hidden;"
|
||||
style="width: 0px; height: 0px; overflow: hidden; outline: none;"
|
||||
tabindex="0"
|
||||
/>
|
||||
<div
|
||||
@@ -240,7 +240,7 @@ exports[`Modal support closeIcon 1`] = `
|
||||
</div>
|
||||
<div
|
||||
aria-hidden="true"
|
||||
style="width: 0px; height: 0px; overflow: hidden;"
|
||||
style="width: 0px; height: 0px; overflow: hidden; outline: none;"
|
||||
tabindex="0"
|
||||
/>
|
||||
</div>
|
||||
|
||||
@@ -11,8 +11,8 @@ import { ConfigConsumer, ConfigConsumerProps } from '../config-provider';
|
||||
export interface PopconfirmProps extends AbstractTooltipProps {
|
||||
title: React.ReactNode;
|
||||
disabled?: boolean;
|
||||
onConfirm?: (e?: React.MouseEvent<HTMLElement>) => void;
|
||||
onCancel?: (e?: React.MouseEvent<HTMLElement>) => void;
|
||||
onConfirm?: (event: React.MouseEvent<HTMLElement>) => void;
|
||||
onCancel?: (event: React.MouseEvent<HTMLElement>) => void;
|
||||
okText?: React.ReactNode;
|
||||
okType?: ButtonType;
|
||||
cancelText?: React.ReactNode;
|
||||
|
||||
@@ -30,6 +30,7 @@ exports[`renders ./components/progress/demo/circle.md correctly 1`] = `
|
||||
a 47,47 0 1 1 0,94
|
||||
a 47,47 0 1 1 0,-94"
|
||||
fill-opacity="0"
|
||||
opacity="1"
|
||||
stroke=""
|
||||
stroke-linecap="round"
|
||||
stroke-width="6"
|
||||
@@ -72,6 +73,7 @@ exports[`renders ./components/progress/demo/circle.md correctly 1`] = `
|
||||
a 47,47 0 1 1 0,94
|
||||
a 47,47 0 1 1 0,-94"
|
||||
fill-opacity="0"
|
||||
opacity="1"
|
||||
stroke=""
|
||||
stroke-linecap="round"
|
||||
stroke-width="6"
|
||||
@@ -131,6 +133,7 @@ exports[`renders ./components/progress/demo/circle.md correctly 1`] = `
|
||||
a 47,47 0 1 1 0,94
|
||||
a 47,47 0 1 1 0,-94"
|
||||
fill-opacity="0"
|
||||
opacity="1"
|
||||
stroke=""
|
||||
stroke-linecap="round"
|
||||
stroke-width="6"
|
||||
@@ -195,9 +198,10 @@ exports[`renders ./components/progress/demo/circle-dynamic.md correctly 1`] = `
|
||||
a 47,47 0 1 1 0,94
|
||||
a 47,47 0 1 1 0,-94"
|
||||
fill-opacity="0"
|
||||
opacity="0"
|
||||
stroke=""
|
||||
stroke-linecap="round"
|
||||
stroke-width="0"
|
||||
stroke-width="6"
|
||||
style="stroke:#108ee9;stroke-dasharray:0px 295.3097094374406px;stroke-dashoffset:-0px;transition:stroke-dashoffset .3s ease 0s, stroke-dasharray .3s ease 0s, stroke .3s, stroke-width .06s ease .3s"
|
||||
/>
|
||||
</svg>
|
||||
@@ -297,6 +301,7 @@ exports[`renders ./components/progress/demo/circle-mini.md correctly 1`] = `
|
||||
a 47,47 0 1 1 0,94
|
||||
a 47,47 0 1 1 0,-94"
|
||||
fill-opacity="0"
|
||||
opacity="1"
|
||||
stroke=""
|
||||
stroke-linecap="round"
|
||||
stroke-width="6"
|
||||
@@ -339,6 +344,7 @@ exports[`renders ./components/progress/demo/circle-mini.md correctly 1`] = `
|
||||
a 47,47 0 1 1 0,94
|
||||
a 47,47 0 1 1 0,-94"
|
||||
fill-opacity="0"
|
||||
opacity="1"
|
||||
stroke=""
|
||||
stroke-linecap="round"
|
||||
stroke-width="6"
|
||||
@@ -398,6 +404,7 @@ exports[`renders ./components/progress/demo/circle-mini.md correctly 1`] = `
|
||||
a 47,47 0 1 1 0,94
|
||||
a 47,47 0 1 1 0,-94"
|
||||
fill-opacity="0"
|
||||
opacity="1"
|
||||
stroke=""
|
||||
stroke-linecap="round"
|
||||
stroke-width="6"
|
||||
@@ -461,6 +468,7 @@ exports[`renders ./components/progress/demo/dashboard.md correctly 1`] = `
|
||||
a 47,47 0 1 1 0,-94
|
||||
a 47,47 0 1 1 0,94"
|
||||
fill-opacity="0"
|
||||
opacity="1"
|
||||
stroke=""
|
||||
stroke-linecap="round"
|
||||
stroke-width="6"
|
||||
@@ -591,6 +599,7 @@ exports[`renders ./components/progress/demo/format.md correctly 1`] = `
|
||||
a 47,47 0 1 1 0,94
|
||||
a 47,47 0 1 1 0,-94"
|
||||
fill-opacity="0"
|
||||
opacity="1"
|
||||
stroke=""
|
||||
stroke-linecap="round"
|
||||
stroke-width="6"
|
||||
@@ -633,6 +642,7 @@ exports[`renders ./components/progress/demo/format.md correctly 1`] = `
|
||||
a 47,47 0 1 1 0,94
|
||||
a 47,47 0 1 1 0,-94"
|
||||
fill-opacity="0"
|
||||
opacity="1"
|
||||
stroke=""
|
||||
stroke-linecap="round"
|
||||
stroke-width="6"
|
||||
@@ -746,6 +756,7 @@ exports[`renders ./components/progress/demo/gradient-line.md correctly 1`] = `
|
||||
a 47,47 0 1 1 0,94
|
||||
a 47,47 0 1 1 0,-94"
|
||||
fill-opacity="0"
|
||||
opacity="1"
|
||||
stroke="url(#ant-progress-gradient-10)"
|
||||
stroke-linecap="round"
|
||||
stroke-width="6"
|
||||
@@ -806,6 +817,7 @@ exports[`renders ./components/progress/demo/gradient-line.md correctly 1`] = `
|
||||
a 47,47 0 1 1 0,94
|
||||
a 47,47 0 1 1 0,-94"
|
||||
fill-opacity="0"
|
||||
opacity="1"
|
||||
stroke="url(#ant-progress-gradient-11)"
|
||||
stroke-linecap="round"
|
||||
stroke-width="6"
|
||||
@@ -1184,6 +1196,7 @@ exports[`renders ./components/progress/demo/linecap.md correctly 1`] = `
|
||||
a 47,47 0 1 1 0,94
|
||||
a 47,47 0 1 1 0,-94"
|
||||
fill-opacity="0"
|
||||
opacity="1"
|
||||
stroke=""
|
||||
stroke-linecap="square"
|
||||
stroke-width="6"
|
||||
@@ -1226,6 +1239,7 @@ exports[`renders ./components/progress/demo/linecap.md correctly 1`] = `
|
||||
a 47,47 0 1 1 0,-94
|
||||
a 47,47 0 1 1 0,94"
|
||||
fill-opacity="0"
|
||||
opacity="1"
|
||||
stroke=""
|
||||
stroke-linecap="square"
|
||||
stroke-width="6"
|
||||
@@ -1301,6 +1315,7 @@ exports[`renders ./components/progress/demo/segment.md correctly 1`] = `
|
||||
a 47,47 0 1 1 0,94
|
||||
a 47,47 0 1 1 0,-94"
|
||||
fill-opacity="0"
|
||||
opacity="1"
|
||||
stroke=""
|
||||
stroke-linecap="round"
|
||||
stroke-width="6"
|
||||
@@ -1312,6 +1327,7 @@ exports[`renders ./components/progress/demo/segment.md correctly 1`] = `
|
||||
a 47,47 0 1 1 0,94
|
||||
a 47,47 0 1 1 0,-94"
|
||||
fill-opacity="0"
|
||||
opacity="1"
|
||||
stroke=""
|
||||
stroke-linecap="round"
|
||||
stroke-width="6"
|
||||
@@ -1354,6 +1370,7 @@ exports[`renders ./components/progress/demo/segment.md correctly 1`] = `
|
||||
a 47,47 0 1 1 0,-94
|
||||
a 47,47 0 1 1 0,94"
|
||||
fill-opacity="0"
|
||||
opacity="1"
|
||||
stroke=""
|
||||
stroke-linecap="round"
|
||||
stroke-width="6"
|
||||
@@ -1365,6 +1382,7 @@ exports[`renders ./components/progress/demo/segment.md correctly 1`] = `
|
||||
a 47,47 0 1 1 0,-94
|
||||
a 47,47 0 1 1 0,94"
|
||||
fill-opacity="0"
|
||||
opacity="1"
|
||||
stroke=""
|
||||
stroke-linecap="round"
|
||||
stroke-width="6"
|
||||
|
||||
@@ -233,6 +233,7 @@ exports[`Progress render strokeColor 1`] = `
|
||||
a 47,47 0 1 1 0,94
|
||||
a 47,47 0 1 1 0,-94"
|
||||
fill-opacity="0"
|
||||
opacity="1"
|
||||
stroke=""
|
||||
stroke-linecap="round"
|
||||
stroke-width="6"
|
||||
|
||||
23
components/result/__tests__/type.test.tsx
Normal file
23
components/result/__tests__/type.test.tsx
Normal file
@@ -0,0 +1,23 @@
|
||||
import * as React from 'react';
|
||||
import Result from '..';
|
||||
|
||||
describe('Result.typescript', () => {
|
||||
it('status', () => {
|
||||
const result = (
|
||||
<>
|
||||
<Result
|
||||
status="404"
|
||||
title="404"
|
||||
subTitle="Sorry, the page you visited does not exist."
|
||||
/>
|
||||
<Result
|
||||
status={404}
|
||||
title="404"
|
||||
subTitle="Sorry, the page you visited does not exist."
|
||||
/>
|
||||
</>
|
||||
);
|
||||
|
||||
expect(result).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@@ -19,7 +19,7 @@ export const ExceptionMap = {
|
||||
'403': unauthorized,
|
||||
};
|
||||
|
||||
export type ExceptionStatusType = keyof typeof ExceptionMap;
|
||||
export type ExceptionStatusType = 403 | 404 | 500 | '403' | '404' | '500';
|
||||
export type ResultStatusType = ExceptionStatusType | keyof typeof IconMap;
|
||||
|
||||
export interface ResultProps {
|
||||
@@ -46,7 +46,7 @@ const ExceptionStatus = Object.keys(ExceptionMap);
|
||||
const renderIcon = (prefixCls: string, { status, icon }: ResultProps) => {
|
||||
const className = classnames(`${prefixCls}-icon`);
|
||||
|
||||
if (ExceptionStatus.includes(status as ResultStatusType)) {
|
||||
if (ExceptionStatus.includes(`${status}`)) {
|
||||
const SVGComponent = ExceptionMap[status as ExceptionStatusType];
|
||||
return (
|
||||
<div className={`${className} ${prefixCls}-image`}>
|
||||
|
||||
@@ -98,4 +98,4 @@ Select component to select value from options.
|
||||
|
||||
### The dropdown is closed when click `dropdownRender` area?
|
||||
|
||||
See the [dropdownRender example](/components/select/#components-select-demo-custom-dropdown-menu).
|
||||
See the instruction in [dropdownRender example](#components-select-demo-custom-dropdown-menu).
|
||||
|
||||
@@ -101,4 +101,4 @@ title: Select
|
||||
|
||||
### 点击 `dropdownRender` 里的内容浮层关闭怎么办?
|
||||
|
||||
看下 [dropdownRender 例子](/components/select-cn/#components-select-demo-custom-dropdown-menu) 里的说明。
|
||||
看下 [dropdownRender 例子](#components-select-demo-custom-dropdown-menu) 里的说明。
|
||||
|
||||
@@ -310,6 +310,7 @@
|
||||
.@{select-prefix-cls}-search__field {
|
||||
width: 0.75em;
|
||||
max-width: 100%;
|
||||
padding: 1px;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -469,7 +470,7 @@
|
||||
&-menu {
|
||||
max-height: 250px;
|
||||
margin-bottom: 0;
|
||||
padding: @select-dropdown-edge-child-vertical-padding 0; //Change
|
||||
padding: @select-dropdown-edge-child-vertical-padding 0; //Change
|
||||
padding-left: 0; // Override default ul/ol
|
||||
overflow: auto;
|
||||
list-style: none;
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
&.@{steps-prefix-cls}-small:not(.@{steps-prefix-cls}-dot) {
|
||||
.@{steps-prefix-cls}-item {
|
||||
&-icon {
|
||||
margin-left: 40px;
|
||||
margin-left: 46px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -265,10 +265,10 @@
|
||||
@layout-trigger-color-light: @text-color;
|
||||
|
||||
// z-index list, order by `z-index`
|
||||
@zindex-table-fixed: auto;
|
||||
@zindex-badge: 1;
|
||||
@zindex-table-fixed: 1;
|
||||
@zindex-affix: 10;
|
||||
@zindex-back-top: 10;
|
||||
@zindex-badge: 10;
|
||||
@zindex-picker-panel: 10;
|
||||
@zindex-popup-close: 10;
|
||||
@zindex-modal: 1000;
|
||||
|
||||
@@ -11868,7 +11868,6 @@ exports[`renders ./components/table/demo/resizable-column.md correctly 1`] = `
|
||||
</span>
|
||||
<span
|
||||
class="react-resizable-handle react-resizable-handle-se"
|
||||
style="touch-action:none"
|
||||
/>
|
||||
</th>
|
||||
<th
|
||||
@@ -11890,7 +11889,6 @@ exports[`renders ./components/table/demo/resizable-column.md correctly 1`] = `
|
||||
</span>
|
||||
<span
|
||||
class="react-resizable-handle react-resizable-handle-se"
|
||||
style="touch-action:none"
|
||||
/>
|
||||
</th>
|
||||
<th
|
||||
@@ -11912,7 +11910,6 @@ exports[`renders ./components/table/demo/resizable-column.md correctly 1`] = `
|
||||
</span>
|
||||
<span
|
||||
class="react-resizable-handle react-resizable-handle-se"
|
||||
style="touch-action:none"
|
||||
/>
|
||||
</th>
|
||||
<th
|
||||
@@ -11934,7 +11931,6 @@ exports[`renders ./components/table/demo/resizable-column.md correctly 1`] = `
|
||||
</span>
|
||||
<span
|
||||
class="react-resizable-handle react-resizable-handle-se"
|
||||
style="touch-action:none"
|
||||
/>
|
||||
</th>
|
||||
<th
|
||||
|
||||
@@ -206,7 +206,7 @@ class FilterMenu<T> extends React.Component<FilterMenuProps<T>, FilterMenuState<
|
||||
}
|
||||
|
||||
const dropdownIconClass = classNames({
|
||||
[`${prefixCls}-selected`]: filtered,
|
||||
[`${prefixCls}-selected`]: 'filtered' in column ? column.filtered : filtered,
|
||||
[`${prefixCls}-open`]: this.getDropdownVisible(),
|
||||
});
|
||||
|
||||
|
||||
@@ -71,6 +71,7 @@ const columns = [
|
||||
| expandedRowRender | Expanded container render for each row | Function(record, index, indent, expanded):ReactNode | - | |
|
||||
| expandIcon | Customize row expand Icon. Ref [example](http://react-component.github.io/table/examples/expandIcon.html) | Function(props):ReactNode | - | 3.11.3 |
|
||||
| expandRowByClick | Whether to expand row by clicking anywhere in the whole row | boolean | `false` | 3.0.1 |
|
||||
| expandIconColumnIndex | The index of `expandIcon` which column will be inserted when `expandIconAsCell` is false | 0 | |
|
||||
| footer | Table footer renderer | Function(currentPageData) | | |
|
||||
| indentSize | Indent size in pixels of tree data | number | 15 | |
|
||||
| loading | Loading status of table | boolean\|[object](https://ant.design/components/spin-cn/#API) ([more](https://github.com/ant-design/ant-design/issues/4544#issuecomment-271533135)) | `false` | |
|
||||
|
||||
@@ -76,6 +76,7 @@ const columns = [
|
||||
| expandedRowRender | 额外的展开行 | Function(record, index, indent, expanded):ReactNode | - | |
|
||||
| expandIcon | 自定义展开图标,参考[示例](http://react-component.github.io/table/examples/expandIcon.html) | Function(props):ReactNode | - | 3.11.3 |
|
||||
| expandRowByClick | 通过点击行来展开子行 | boolean | `false` | 3.0.1 |
|
||||
| expandIconColumnIndex | 展开的图标显示在哪一列,如果没有 `rowSelection`,默认显示在第一列,否则显示在选择框后面 | `number` | |
|
||||
| footer | 表格尾部 | Function(currentPageData) | | |
|
||||
| indentSize | 展示树形数据时,每层缩进的宽度,以 px 为单位 | number | 15 | |
|
||||
| loading | 页面是否加载中 | boolean\|[object](https://ant.design/components/spin-cn/#API) ([更多](https://github.com/ant-design/ant-design/issues/4544#issuecomment-271533135)) | false | |
|
||||
|
||||
@@ -56,6 +56,7 @@ export interface ColumnProps<T> {
|
||||
fixed?: boolean | typeof ColumnFixedPlacements[number];
|
||||
filterIcon?: React.ReactNode | ((filtered: boolean) => React.ReactNode);
|
||||
filteredValue?: any[] | null;
|
||||
filtered?: boolean;
|
||||
defaultFilteredValue?: any[];
|
||||
sortOrder?: SortOrder | boolean;
|
||||
children?: ColumnProps<T>[];
|
||||
|
||||
@@ -75,7 +75,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
.@{table-prefix-cls}-filter-selected.@{iconfont-css-prefix}-filter {
|
||||
.@{table-prefix-cls}-filter-selected.@{iconfont-css-prefix} {
|
||||
color: @primary-color;
|
||||
}
|
||||
|
||||
@@ -445,16 +445,14 @@
|
||||
box-shadow: @box-shadow-base;
|
||||
|
||||
.@{ant-prefix}-dropdown-menu {
|
||||
// https://github.com/ant-design/ant-design/issues/4916
|
||||
// https://github.com/ant-design/ant-design/issues/19542
|
||||
max-height: ~'calc(100vh - 130px)';
|
||||
overflow-x: hidden;
|
||||
border: 0;
|
||||
border-radius: @border-radius-base @border-radius-base 0 0;
|
||||
box-shadow: none;
|
||||
|
||||
// https://github.com/ant-design/ant-design/issues/4916
|
||||
&-without-submenu {
|
||||
max-height: 400px;
|
||||
overflow-x: hidden;
|
||||
}
|
||||
|
||||
&-item > label + span {
|
||||
padding-right: 0;
|
||||
}
|
||||
@@ -623,7 +621,10 @@
|
||||
// https://github.com/ant-design/ant-design/issues/14545
|
||||
// https://github.com/ant-design/ant-design/issues/19491
|
||||
.@{table-prefix-cls}-fixed-columns-in-body:not([colspan]) {
|
||||
visibility: hidden;
|
||||
color: transparent;
|
||||
& > * {
|
||||
visibility: hidden;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -721,7 +722,7 @@
|
||||
table {
|
||||
border-radius: @table-border-radius-base 0 0 0;
|
||||
}
|
||||
.ant-table-thead > tr > th:last-child {
|
||||
.@{table-prefix-cls}-thead > tr > th:last-child {
|
||||
border-top-right-radius: 0;
|
||||
}
|
||||
}
|
||||
@@ -739,7 +740,7 @@
|
||||
color: transparent;
|
||||
pointer-events: none;
|
||||
}
|
||||
.ant-table-thead > tr > th:first-child {
|
||||
.@{table-prefix-cls}-thead > tr > th:first-child {
|
||||
border-top-left-radius: 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -255,10 +255,10 @@
|
||||
.@{tab-prefix-cls}-top-content,
|
||||
.@{tab-prefix-cls}-bottom-content {
|
||||
width: 100%;
|
||||
|
||||
> .@{tab-prefix-cls}-tabpane {
|
||||
flex-shrink: 0;
|
||||
width: 100%;
|
||||
-webkit-backface-visibility: hidden;
|
||||
opacity: 1;
|
||||
transition: opacity 0.45s;
|
||||
}
|
||||
|
||||
@@ -442,11 +442,11 @@ exports[`renders ./components/tag/demo/controlled.md correctly 1`] = `
|
||||
|
||||
exports[`renders ./components/tag/demo/hot-tags.md correctly 1`] = `
|
||||
<div>
|
||||
<h6
|
||||
style="margin-right:8px;display:inline"
|
||||
<span
|
||||
style="margin-right:8px"
|
||||
>
|
||||
Categories:
|
||||
</h6>
|
||||
</span>
|
||||
<span
|
||||
class="ant-tag ant-tag-checkable"
|
||||
>
|
||||
|
||||
@@ -36,7 +36,7 @@ class HotTags extends React.Component {
|
||||
const { selectedTags } = this.state;
|
||||
return (
|
||||
<div>
|
||||
<h6 style={{ marginRight: 8, display: 'inline' }}>Categories:</h6>
|
||||
<span style={{ marginRight: 8 }}>Categories:</span>
|
||||
{tagsFromServer.map(tag => (
|
||||
<CheckableTag
|
||||
key={tag}
|
||||
|
||||
5
components/time-picker/locale/ga_IE.tsx
Normal file
5
components/time-picker/locale/ga_IE.tsx
Normal file
@@ -0,0 +1,5 @@
|
||||
const locale = {
|
||||
placeholder: 'Roghnaigh am',
|
||||
};
|
||||
|
||||
export default locale;
|
||||
@@ -13,6 +13,7 @@ export interface TimelineProps {
|
||||
style?: React.CSSProperties;
|
||||
reverse?: boolean;
|
||||
mode?: 'left' | 'alternate' | 'right';
|
||||
children?: React.ReactNode;
|
||||
}
|
||||
|
||||
export default class Timeline extends React.Component<TimelineProps, any> {
|
||||
|
||||
@@ -11,6 +11,7 @@ export interface TimeLineItemProps {
|
||||
pending?: boolean;
|
||||
position?: string;
|
||||
style?: React.CSSProperties;
|
||||
children?: React.ReactNode;
|
||||
}
|
||||
|
||||
const TimelineItem: React.SFC<TimeLineItemProps> = props => (
|
||||
|
||||
@@ -241,4 +241,14 @@ describe('Tooltip', () => {
|
||||
expect(onVisibleChange).toHaveBeenCalledWith(false);
|
||||
expect(wrapper.instance().tooltip.props.visible).toBe(false);
|
||||
});
|
||||
|
||||
// https://github.com/ant-design/ant-design/issues/20891
|
||||
it('should display zero', async () => {
|
||||
const wrapper = mount(
|
||||
<Tooltip title={0} visible>
|
||||
<div />
|
||||
</Tooltip>,
|
||||
);
|
||||
expect(wrapper.find('.ant-tooltip-inner').getDOMNode().innerHTML).toBe('0');
|
||||
});
|
||||
});
|
||||
|
||||
@@ -226,7 +226,15 @@ class Tooltip extends React.Component<TooltipProps, any> {
|
||||
|
||||
isNoTitle() {
|
||||
const { title, overlay } = this.props;
|
||||
return !title && !overlay; // overlay for old version compatibility
|
||||
return !title && !overlay && title !== 0; // overlay for old version compatibility
|
||||
}
|
||||
|
||||
getOverlay() {
|
||||
const { title, overlay } = this.props;
|
||||
if (title === 0) {
|
||||
return title;
|
||||
}
|
||||
return overlay || title || '';
|
||||
}
|
||||
|
||||
renderTooltip = ({
|
||||
@@ -236,8 +244,6 @@ class Tooltip extends React.Component<TooltipProps, any> {
|
||||
const { props, state } = this;
|
||||
const {
|
||||
prefixCls: customizePrefixCls,
|
||||
title,
|
||||
overlay,
|
||||
openClassName,
|
||||
getPopupContainer,
|
||||
getTooltipContainer,
|
||||
@@ -266,7 +272,7 @@ class Tooltip extends React.Component<TooltipProps, any> {
|
||||
getTooltipContainer={getPopupContainer || getTooltipContainer || getContextPopupContainer}
|
||||
ref={this.saveTooltip}
|
||||
builtinPlacements={this.getPlacements()}
|
||||
overlay={overlay || title || ''}
|
||||
overlay={this.getOverlay()}
|
||||
visible={visible}
|
||||
onVisibleChange={this.onVisibleChange}
|
||||
onPopupAlign={this.onPopupAlign}
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
import React from 'react';
|
||||
import { mount } from 'enzyme';
|
||||
import TreeSelect, { TreeNode } from '..';
|
||||
import focusTest from '../../../tests/shared/focusTest';
|
||||
import mountTest from '../../../tests/shared/mountTest';
|
||||
|
||||
describe('TreeSelect', () => {
|
||||
focusTest(TreeSelect);
|
||||
mountTest(TreeSelect);
|
||||
|
||||
describe('showSearch', () => {
|
||||
|
||||
@@ -41,7 +41,7 @@ export interface AntTreeNodeProps {
|
||||
selected?: boolean;
|
||||
selectable?: boolean;
|
||||
icon?: ((treeNode: AntdTreeNodeAttribute) => React.ReactNode) | React.ReactNode;
|
||||
children?: React.ReactNode;
|
||||
children?: React.ReactElement[];
|
||||
[customProp: string]: any;
|
||||
}
|
||||
|
||||
@@ -70,7 +70,7 @@ export interface AntTreeNodeExpandedEvent extends AntTreeNodeBaseEvent {
|
||||
|
||||
export interface AntTreeNodeMouseEvent {
|
||||
node: AntTreeNode;
|
||||
event: React.MouseEvent<HTMLElement>;
|
||||
event: React.DragEvent<HTMLElement>;
|
||||
}
|
||||
|
||||
export interface AntTreeNodeDragEnterEvent extends AntTreeNodeMouseEvent {
|
||||
@@ -194,15 +194,15 @@ export default class Tree extends React.Component<TreeProps, any> {
|
||||
if (loading) {
|
||||
return <Icon type="loading" className={`${prefixCls}-switcher-loading-icon`} />;
|
||||
}
|
||||
if (isLeaf) {
|
||||
return showLine ? <Icon type="file" className={`${prefixCls}-switcher-line-icon`} /> : null;
|
||||
}
|
||||
const switcherCls = `${prefixCls}-switcher-icon`;
|
||||
if (switcherIcon) {
|
||||
return React.cloneElement(switcherIcon, {
|
||||
className: classNames(switcherIcon.props.className || '', switcherCls),
|
||||
});
|
||||
}
|
||||
if (isLeaf) {
|
||||
return showLine ? <Icon type="file" className={`${prefixCls}-switcher-line-icon`} /> : null;
|
||||
}
|
||||
return showLine ? (
|
||||
<Icon
|
||||
type={expanded ? 'minus-square' : 'plus-square'}
|
||||
|
||||
@@ -725,27 +725,7 @@ exports[`renders ./components/tree/demo/customized-icon.md correctly 1`] = `
|
||||
>
|
||||
<span
|
||||
class="ant-tree-switcher ant-tree-switcher-noop"
|
||||
>
|
||||
<i
|
||||
aria-label="icon: down"
|
||||
class="anticon anticon-down ant-tree-switcher-icon"
|
||||
>
|
||||
<svg
|
||||
aria-hidden="true"
|
||||
class=""
|
||||
data-icon="down"
|
||||
fill="currentColor"
|
||||
focusable="false"
|
||||
height="1em"
|
||||
viewBox="64 64 896 896"
|
||||
width="1em"
|
||||
>
|
||||
<path
|
||||
d="M884 256h-75c-5.1 0-9.9 2.5-12.9 6.6L512 654.2 227.9 262.6c-3-4.1-7.8-6.6-12.9-6.6h-75c-6.5 0-10.3 7.4-6.5 12.7l352.6 486.1c12.8 17.6 39 17.6 51.7 0l352.6-486.1c3.9-5.3.1-12.7-6.4-12.7z"
|
||||
/>
|
||||
</svg>
|
||||
</i>
|
||||
</span>
|
||||
/>
|
||||
<span
|
||||
class="ant-tree-node-content-wrapper ant-tree-node-content-wrapper-normal ant-tree-node-selected"
|
||||
title="leaf"
|
||||
@@ -786,27 +766,7 @@ exports[`renders ./components/tree/demo/customized-icon.md correctly 1`] = `
|
||||
>
|
||||
<span
|
||||
class="ant-tree-switcher ant-tree-switcher-noop"
|
||||
>
|
||||
<i
|
||||
aria-label="icon: down"
|
||||
class="anticon anticon-down ant-tree-switcher-icon"
|
||||
>
|
||||
<svg
|
||||
aria-hidden="true"
|
||||
class=""
|
||||
data-icon="down"
|
||||
fill="currentColor"
|
||||
focusable="false"
|
||||
height="1em"
|
||||
viewBox="64 64 896 896"
|
||||
width="1em"
|
||||
>
|
||||
<path
|
||||
d="M884 256h-75c-5.1 0-9.9 2.5-12.9 6.6L512 654.2 227.9 262.6c-3-4.1-7.8-6.6-12.9-6.6h-75c-6.5 0-10.3 7.4-6.5 12.7l352.6 486.1c12.8 17.6 39 17.6 51.7 0l352.6-486.1c3.9-5.3.1-12.7-6.4-12.7z"
|
||||
/>
|
||||
</svg>
|
||||
</i>
|
||||
</span>
|
||||
/>
|
||||
<span
|
||||
class="ant-tree-node-content-wrapper ant-tree-node-content-wrapper-normal"
|
||||
title="leaf"
|
||||
@@ -2249,13 +2209,13 @@ exports[`renders ./components/tree/demo/switcher-icon.md correctly 1`] = `
|
||||
class="ant-tree-switcher ant-tree-switcher-noop"
|
||||
>
|
||||
<i
|
||||
aria-label="icon: down"
|
||||
class="anticon anticon-down ant-tree-switcher-icon"
|
||||
aria-label="icon: file"
|
||||
class="anticon anticon-file ant-tree-switcher-line-icon"
|
||||
>
|
||||
<svg
|
||||
aria-hidden="true"
|
||||
class=""
|
||||
data-icon="down"
|
||||
data-icon="file"
|
||||
fill="currentColor"
|
||||
focusable="false"
|
||||
height="1em"
|
||||
@@ -2263,7 +2223,7 @@ exports[`renders ./components/tree/demo/switcher-icon.md correctly 1`] = `
|
||||
width="1em"
|
||||
>
|
||||
<path
|
||||
d="M884 256h-75c-5.1 0-9.9 2.5-12.9 6.6L512 654.2 227.9 262.6c-3-4.1-7.8-6.6-12.9-6.6h-75c-6.5 0-10.3 7.4-6.5 12.7l352.6 486.1c12.8 17.6 39 17.6 51.7 0l352.6-486.1c3.9-5.3.1-12.7-6.4-12.7z"
|
||||
d="M854.6 288.6L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM790.2 326H602V137.8L790.2 326zm1.8 562H232V136h302v216a42 42 0 0 0 42 42h216v494z"
|
||||
/>
|
||||
</svg>
|
||||
</i>
|
||||
@@ -2287,13 +2247,13 @@ exports[`renders ./components/tree/demo/switcher-icon.md correctly 1`] = `
|
||||
class="ant-tree-switcher ant-tree-switcher-noop"
|
||||
>
|
||||
<i
|
||||
aria-label="icon: down"
|
||||
class="anticon anticon-down ant-tree-switcher-icon"
|
||||
aria-label="icon: file"
|
||||
class="anticon anticon-file ant-tree-switcher-line-icon"
|
||||
>
|
||||
<svg
|
||||
aria-hidden="true"
|
||||
class=""
|
||||
data-icon="down"
|
||||
data-icon="file"
|
||||
fill="currentColor"
|
||||
focusable="false"
|
||||
height="1em"
|
||||
@@ -2301,7 +2261,7 @@ exports[`renders ./components/tree/demo/switcher-icon.md correctly 1`] = `
|
||||
width="1em"
|
||||
>
|
||||
<path
|
||||
d="M884 256h-75c-5.1 0-9.9 2.5-12.9 6.6L512 654.2 227.9 262.6c-3-4.1-7.8-6.6-12.9-6.6h-75c-6.5 0-10.3 7.4-6.5 12.7l352.6 486.1c12.8 17.6 39 17.6 51.7 0l352.6-486.1c3.9-5.3.1-12.7-6.4-12.7z"
|
||||
d="M854.6 288.6L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM790.2 326H602V137.8L790.2 326zm1.8 562H232V136h302v216a42 42 0 0 0 42 42h216v494z"
|
||||
/>
|
||||
</svg>
|
||||
</i>
|
||||
@@ -2325,13 +2285,13 @@ exports[`renders ./components/tree/demo/switcher-icon.md correctly 1`] = `
|
||||
class="ant-tree-switcher ant-tree-switcher-noop"
|
||||
>
|
||||
<i
|
||||
aria-label="icon: down"
|
||||
class="anticon anticon-down ant-tree-switcher-icon"
|
||||
aria-label="icon: file"
|
||||
class="anticon anticon-file ant-tree-switcher-line-icon"
|
||||
>
|
||||
<svg
|
||||
aria-hidden="true"
|
||||
class=""
|
||||
data-icon="down"
|
||||
data-icon="file"
|
||||
fill="currentColor"
|
||||
focusable="false"
|
||||
height="1em"
|
||||
@@ -2339,7 +2299,7 @@ exports[`renders ./components/tree/demo/switcher-icon.md correctly 1`] = `
|
||||
width="1em"
|
||||
>
|
||||
<path
|
||||
d="M884 256h-75c-5.1 0-9.9 2.5-12.9 6.6L512 654.2 227.9 262.6c-3-4.1-7.8-6.6-12.9-6.6h-75c-6.5 0-10.3 7.4-6.5 12.7l352.6 486.1c12.8 17.6 39 17.6 51.7 0l352.6-486.1c3.9-5.3.1-12.7-6.4-12.7z"
|
||||
d="M854.6 288.6L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM790.2 326H602V137.8L790.2 326zm1.8 562H232V136h302v216a42 42 0 0 0 42 42h216v494z"
|
||||
/>
|
||||
</svg>
|
||||
</i>
|
||||
|
||||
@@ -30,4 +30,16 @@ describe('Tree', () => {
|
||||
);
|
||||
expect(wrapper.render()).toMatchSnapshot();
|
||||
});
|
||||
|
||||
it('switcherIcon in Tree should not render at leaf nodes', () => {
|
||||
const wrapper = mount(
|
||||
<Tree switcherIcon={<i className="switcherIcon" />} defaultExpandAll>
|
||||
<TreeNode icon="icon">
|
||||
<TreeNode id="node1" title="node1" icon="icon" key="0-0-2" />
|
||||
<TreeNode id="node2" title="node2" key="0-0-3" />
|
||||
</TreeNode>
|
||||
</Tree>,
|
||||
);
|
||||
expect(wrapper.find('.switcherIcon').length).toBe(1);
|
||||
});
|
||||
});
|
||||
|
||||
13
components/tree/__tests__/type.test.tsx
Normal file
13
components/tree/__tests__/type.test.tsx
Normal file
@@ -0,0 +1,13 @@
|
||||
/* eslint-disable */
|
||||
import * as React from 'react';
|
||||
import { AntTreeNodeProps } from '../Tree';
|
||||
|
||||
describe('Tree TypeScript Test', async () => {
|
||||
it('AntTreeNodeProps', () => {
|
||||
const tree: AntTreeNodeProps = {
|
||||
children: [React.createElement('h1')],
|
||||
};
|
||||
|
||||
expect(tree).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@@ -92,4 +92,4 @@ Before `3.4.0`: The number of treeNodes can be very large, but when `checkable=t
|
||||
|
||||
### How to hide file icon when use showLine?
|
||||
|
||||
File icon realize by using switcherIcon. You can overwrite the style to hide it: https://codesandbox.io/s/883vo47xp8
|
||||
File icon realize by using switcherIcon. You can overwrite the style to hide it: https://codesandbox.io/s/long-moon-go9e2
|
||||
|
||||
@@ -93,4 +93,4 @@ subtitle: 树形控件
|
||||
|
||||
### 在 showLine 时,如何隐藏子节点图标?
|
||||
|
||||
文件图标通过 switcherIcon 来实现,如果不需要你可以覆盖对应的样式:https://codesandbox.io/s/883vo47xp8
|
||||
文件图标通过 switcherIcon 来实现,如果不需要你可以覆盖对应的样式:https://codesandbox.io/s/long-moon-go9e2
|
||||
|
||||
@@ -46,8 +46,11 @@ class Editable extends React.Component<EditableProps, EditableState> {
|
||||
};
|
||||
|
||||
componentDidMount() {
|
||||
if (this.textarea) {
|
||||
this.textarea.focus();
|
||||
if (this.textarea && this.textarea.resizableTextArea) {
|
||||
const { textArea } = this.textarea.resizableTextArea;
|
||||
textArea.focus();
|
||||
const { length } = textArea.value;
|
||||
textArea.setSelectionRange(length, length);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -241,6 +241,17 @@ describe('Typography', () => {
|
||||
wrapper.find('TextArea').simulate('blur');
|
||||
});
|
||||
});
|
||||
|
||||
it('should focus at the end of textarea', () => {
|
||||
const wrapper = mount(<Paragraph editable>content</Paragraph>);
|
||||
wrapper
|
||||
.find('.ant-typography-edit')
|
||||
.first()
|
||||
.simulate('click');
|
||||
const textareaNode = wrapper.find('textarea').getDOMNode();
|
||||
expect(textareaNode.selectionStart).toBe(7);
|
||||
expect(textareaNode.selectionEnd).toBe(7);
|
||||
});
|
||||
});
|
||||
|
||||
it('warning if use setContentRef', () => {
|
||||
|
||||
@@ -9,7 +9,7 @@ export type DraggerProps = UploadProps & { height?: number };
|
||||
// eslint-disable-next-line react/prefer-stateless-function
|
||||
export default class Dragger extends React.Component<DraggerProps, any> {
|
||||
render() {
|
||||
const { props } = this;
|
||||
return <Upload {...props} type="drag" style={{ ...props.style, height: props.height }} />;
|
||||
const { style, height, ...restProps } = this.props;
|
||||
return <Upload {...restProps} type="drag" style={{ ...style, height }} />;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -163,7 +163,7 @@ class Upload extends React.Component<UploadProps, UploadState> {
|
||||
const { onRemove } = this.props;
|
||||
const { fileList } = this.state;
|
||||
|
||||
Promise.resolve(typeof onRemove === 'function' ? onRemove(file) : onRemove).then(ret => {
|
||||
Promise.resolve(typeof onRemove === 'function' ? onRemove(file) : onRemove).then((ret) => {
|
||||
// Prevent removing file
|
||||
if (ret === false) {
|
||||
return;
|
||||
@@ -301,6 +301,14 @@ class Upload extends React.Component<UploadProps, UploadState> {
|
||||
delete rcUploadProps.className;
|
||||
delete rcUploadProps.style;
|
||||
|
||||
// Remove id to avoid open by label when trigger is hidden
|
||||
// !children: https://github.com/ant-design/ant-design/issues/14298
|
||||
// disabled: https://github.com/ant-design/ant-design/issues/16478
|
||||
// https://github.com/ant-design/ant-design/issues/24197
|
||||
if (!children || disabled) {
|
||||
delete rcUploadProps.id;
|
||||
}
|
||||
|
||||
const uploadList = showUploadList ? (
|
||||
<LocaleReceiver componentName="Upload" defaultLocale={defaultLocale.Upload}>
|
||||
{this.renderUploadList}
|
||||
@@ -312,7 +320,7 @@ class Upload extends React.Component<UploadProps, UploadState> {
|
||||
prefixCls,
|
||||
{
|
||||
[`${prefixCls}-drag`]: true,
|
||||
[`${prefixCls}-drag-uploading`]: fileList.some(file => file.status === 'uploading'),
|
||||
[`${prefixCls}-drag-uploading`]: fileList.some((file) => file.status === 'uploading'),
|
||||
[`${prefixCls}-drag-hover`]: dragState === 'dragover',
|
||||
[`${prefixCls}-disabled`]: disabled,
|
||||
},
|
||||
@@ -342,13 +350,6 @@ class Upload extends React.Component<UploadProps, UploadState> {
|
||||
[`${prefixCls}-disabled`]: disabled,
|
||||
});
|
||||
|
||||
// Remove id to avoid open by label when trigger is hidden
|
||||
// https://github.com/ant-design/ant-design/issues/14298
|
||||
// https://github.com/ant-design/ant-design/issues/16478
|
||||
if (!children || disabled) {
|
||||
delete rcUploadProps.id;
|
||||
}
|
||||
|
||||
const uploadButton = (
|
||||
<div className={uploadButtonCls} style={children ? undefined : { display: 'none' }}>
|
||||
<RcUpload {...rcUploadProps} ref={this.saveUpload} />
|
||||
|
||||
@@ -16,7 +16,7 @@ export default class UploadList extends React.Component<UploadListProps, any> {
|
||||
showInfo: false,
|
||||
},
|
||||
showRemoveIcon: true,
|
||||
showDownloadIcon: true,
|
||||
showDownloadIcon: false,
|
||||
showPreviewIcon: true,
|
||||
previewFile: previewImage,
|
||||
};
|
||||
|
||||
@@ -64,7 +64,7 @@ exports[`renders ./components/upload/demo/defaultFileList.md correctly 1`] = `
|
||||
</svg>
|
||||
</i>
|
||||
<a
|
||||
class="ant-upload-list-item-name ant-upload-list-item-name-icon-count-2"
|
||||
class="ant-upload-list-item-name ant-upload-list-item-name-icon-count-1"
|
||||
href="http://www.baidu.com/xxx.png"
|
||||
rel="noopener noreferrer"
|
||||
target="_blank"
|
||||
@@ -75,31 +75,6 @@ exports[`renders ./components/upload/demo/defaultFileList.md correctly 1`] = `
|
||||
<span
|
||||
class="ant-upload-list-item-card-actions "
|
||||
>
|
||||
<a
|
||||
title="Download file"
|
||||
>
|
||||
<i
|
||||
aria-label="icon: download"
|
||||
class="anticon anticon-download"
|
||||
tabindex="-1"
|
||||
title="Download file"
|
||||
>
|
||||
<svg
|
||||
aria-hidden="true"
|
||||
class=""
|
||||
data-icon="download"
|
||||
fill="currentColor"
|
||||
focusable="false"
|
||||
height="1em"
|
||||
viewBox="64 64 896 896"
|
||||
width="1em"
|
||||
>
|
||||
<path
|
||||
d="M505.7 661a8 8 0 0 0 12.6 0l112-141.7c4.1-5.2.4-12.9-6.3-12.9h-74.1V168c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v338.3H400c-6.7 0-10.4 7.7-6.3 12.9l112 141.8zM878 626h-60c-4.4 0-8 3.6-8 8v154H214V634c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v198c0 17.7 14.3 32 32 32h684c17.7 0 32-14.3 32-32V634c0-4.4-3.6-8-8-8z"
|
||||
/>
|
||||
</svg>
|
||||
</i>
|
||||
</a>
|
||||
<a
|
||||
title="Remove file"
|
||||
>
|
||||
@@ -162,7 +137,7 @@ exports[`renders ./components/upload/demo/defaultFileList.md correctly 1`] = `
|
||||
</svg>
|
||||
</i>
|
||||
<a
|
||||
class="ant-upload-list-item-name ant-upload-list-item-name-icon-count-2"
|
||||
class="ant-upload-list-item-name ant-upload-list-item-name-icon-count-1"
|
||||
href="http://www.baidu.com/yyy.png"
|
||||
rel="noopener noreferrer"
|
||||
target="_blank"
|
||||
@@ -173,31 +148,6 @@ exports[`renders ./components/upload/demo/defaultFileList.md correctly 1`] = `
|
||||
<span
|
||||
class="ant-upload-list-item-card-actions "
|
||||
>
|
||||
<a
|
||||
title="Download file"
|
||||
>
|
||||
<i
|
||||
aria-label="icon: download"
|
||||
class="anticon anticon-download"
|
||||
tabindex="-1"
|
||||
title="Download file"
|
||||
>
|
||||
<svg
|
||||
aria-hidden="true"
|
||||
class=""
|
||||
data-icon="download"
|
||||
fill="currentColor"
|
||||
focusable="false"
|
||||
height="1em"
|
||||
viewBox="64 64 896 896"
|
||||
width="1em"
|
||||
>
|
||||
<path
|
||||
d="M505.7 661a8 8 0 0 0 12.6 0l112-141.7c4.1-5.2.4-12.9-6.3-12.9h-74.1V168c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v338.3H400c-6.7 0-10.4 7.7-6.3 12.9l112 141.8zM878 626h-60c-4.4 0-8 3.6-8 8v154H214V634c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v198c0 17.7 14.3 32 32 32h684c17.7 0 32-14.3 32-32V634c0-4.4-3.6-8-8-8z"
|
||||
/>
|
||||
</svg>
|
||||
</i>
|
||||
</a>
|
||||
<a
|
||||
title="Remove file"
|
||||
>
|
||||
@@ -369,7 +319,7 @@ exports[`renders ./components/upload/demo/fileList.md correctly 1`] = `
|
||||
</svg>
|
||||
</i>
|
||||
<a
|
||||
class="ant-upload-list-item-name ant-upload-list-item-name-icon-count-2"
|
||||
class="ant-upload-list-item-name ant-upload-list-item-name-icon-count-1"
|
||||
href="http://www.baidu.com/xxx.png"
|
||||
rel="noopener noreferrer"
|
||||
target="_blank"
|
||||
@@ -380,31 +330,6 @@ exports[`renders ./components/upload/demo/fileList.md correctly 1`] = `
|
||||
<span
|
||||
class="ant-upload-list-item-card-actions "
|
||||
>
|
||||
<a
|
||||
title="Download file"
|
||||
>
|
||||
<i
|
||||
aria-label="icon: download"
|
||||
class="anticon anticon-download"
|
||||
tabindex="-1"
|
||||
title="Download file"
|
||||
>
|
||||
<svg
|
||||
aria-hidden="true"
|
||||
class=""
|
||||
data-icon="download"
|
||||
fill="currentColor"
|
||||
focusable="false"
|
||||
height="1em"
|
||||
viewBox="64 64 896 896"
|
||||
width="1em"
|
||||
>
|
||||
<path
|
||||
d="M505.7 661a8 8 0 0 0 12.6 0l112-141.7c4.1-5.2.4-12.9-6.3-12.9h-74.1V168c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v338.3H400c-6.7 0-10.4 7.7-6.3 12.9l112 141.8zM878 626h-60c-4.4 0-8 3.6-8 8v154H214V634c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v198c0 17.7 14.3 32 32 32h684c17.7 0 32-14.3 32-32V634c0-4.4-3.6-8-8-8z"
|
||||
/>
|
||||
</svg>
|
||||
</i>
|
||||
</a>
|
||||
<a
|
||||
title="Remove file"
|
||||
>
|
||||
@@ -474,7 +399,7 @@ exports[`renders ./components/upload/demo/picture-card.md correctly 1`] = `
|
||||
/>
|
||||
</a>
|
||||
<a
|
||||
class="ant-upload-list-item-name ant-upload-list-item-name-icon-count-2"
|
||||
class="ant-upload-list-item-name ant-upload-list-item-name-icon-count-1"
|
||||
href="https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png"
|
||||
rel="noopener noreferrer"
|
||||
target="_blank"
|
||||
@@ -513,27 +438,6 @@ exports[`renders ./components/upload/demo/picture-card.md correctly 1`] = `
|
||||
</svg>
|
||||
</i>
|
||||
</a>
|
||||
<i
|
||||
aria-label="icon: download"
|
||||
class="anticon anticon-download"
|
||||
tabindex="-1"
|
||||
title="Download file"
|
||||
>
|
||||
<svg
|
||||
aria-hidden="true"
|
||||
class=""
|
||||
data-icon="download"
|
||||
fill="currentColor"
|
||||
focusable="false"
|
||||
height="1em"
|
||||
viewBox="64 64 896 896"
|
||||
width="1em"
|
||||
>
|
||||
<path
|
||||
d="M505.7 661a8 8 0 0 0 12.6 0l112-141.7c4.1-5.2.4-12.9-6.3-12.9h-74.1V168c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v338.3H400c-6.7 0-10.4 7.7-6.3 12.9l112 141.8zM878 626h-60c-4.4 0-8 3.6-8 8v154H214V634c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v198c0 17.7 14.3 32 32 32h684c17.7 0 32-14.3 32-32V634c0-4.4-3.6-8-8-8z"
|
||||
/>
|
||||
</svg>
|
||||
</i>
|
||||
<i
|
||||
aria-label="icon: delete"
|
||||
class="anticon anticon-delete"
|
||||
@@ -583,7 +487,7 @@ exports[`renders ./components/upload/demo/picture-card.md correctly 1`] = `
|
||||
/>
|
||||
</a>
|
||||
<a
|
||||
class="ant-upload-list-item-name ant-upload-list-item-name-icon-count-2"
|
||||
class="ant-upload-list-item-name ant-upload-list-item-name-icon-count-1"
|
||||
href="https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png"
|
||||
rel="noopener noreferrer"
|
||||
target="_blank"
|
||||
@@ -622,27 +526,6 @@ exports[`renders ./components/upload/demo/picture-card.md correctly 1`] = `
|
||||
</svg>
|
||||
</i>
|
||||
</a>
|
||||
<i
|
||||
aria-label="icon: download"
|
||||
class="anticon anticon-download"
|
||||
tabindex="-1"
|
||||
title="Download file"
|
||||
>
|
||||
<svg
|
||||
aria-hidden="true"
|
||||
class=""
|
||||
data-icon="download"
|
||||
fill="currentColor"
|
||||
focusable="false"
|
||||
height="1em"
|
||||
viewBox="64 64 896 896"
|
||||
width="1em"
|
||||
>
|
||||
<path
|
||||
d="M505.7 661a8 8 0 0 0 12.6 0l112-141.7c4.1-5.2.4-12.9-6.3-12.9h-74.1V168c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v338.3H400c-6.7 0-10.4 7.7-6.3 12.9l112 141.8zM878 626h-60c-4.4 0-8 3.6-8 8v154H214V634c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v198c0 17.7 14.3 32 32 32h684c17.7 0 32-14.3 32-32V634c0-4.4-3.6-8-8-8z"
|
||||
/>
|
||||
</svg>
|
||||
</i>
|
||||
<i
|
||||
aria-label="icon: delete"
|
||||
class="anticon anticon-delete"
|
||||
@@ -692,7 +575,7 @@ exports[`renders ./components/upload/demo/picture-card.md correctly 1`] = `
|
||||
/>
|
||||
</a>
|
||||
<a
|
||||
class="ant-upload-list-item-name ant-upload-list-item-name-icon-count-2"
|
||||
class="ant-upload-list-item-name ant-upload-list-item-name-icon-count-1"
|
||||
href="https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png"
|
||||
rel="noopener noreferrer"
|
||||
target="_blank"
|
||||
@@ -731,27 +614,6 @@ exports[`renders ./components/upload/demo/picture-card.md correctly 1`] = `
|
||||
</svg>
|
||||
</i>
|
||||
</a>
|
||||
<i
|
||||
aria-label="icon: download"
|
||||
class="anticon anticon-download"
|
||||
tabindex="-1"
|
||||
title="Download file"
|
||||
>
|
||||
<svg
|
||||
aria-hidden="true"
|
||||
class=""
|
||||
data-icon="download"
|
||||
fill="currentColor"
|
||||
focusable="false"
|
||||
height="1em"
|
||||
viewBox="64 64 896 896"
|
||||
width="1em"
|
||||
>
|
||||
<path
|
||||
d="M505.7 661a8 8 0 0 0 12.6 0l112-141.7c4.1-5.2.4-12.9-6.3-12.9h-74.1V168c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v338.3H400c-6.7 0-10.4 7.7-6.3 12.9l112 141.8zM878 626h-60c-4.4 0-8 3.6-8 8v154H214V634c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v198c0 17.7 14.3 32 32 32h684c17.7 0 32-14.3 32-32V634c0-4.4-3.6-8-8-8z"
|
||||
/>
|
||||
</svg>
|
||||
</i>
|
||||
<i
|
||||
aria-label="icon: delete"
|
||||
class="anticon anticon-delete"
|
||||
@@ -801,7 +663,7 @@ exports[`renders ./components/upload/demo/picture-card.md correctly 1`] = `
|
||||
/>
|
||||
</a>
|
||||
<a
|
||||
class="ant-upload-list-item-name ant-upload-list-item-name-icon-count-2"
|
||||
class="ant-upload-list-item-name ant-upload-list-item-name-icon-count-1"
|
||||
href="https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png"
|
||||
rel="noopener noreferrer"
|
||||
target="_blank"
|
||||
@@ -840,27 +702,6 @@ exports[`renders ./components/upload/demo/picture-card.md correctly 1`] = `
|
||||
</svg>
|
||||
</i>
|
||||
</a>
|
||||
<i
|
||||
aria-label="icon: download"
|
||||
class="anticon anticon-download"
|
||||
tabindex="-1"
|
||||
title="Download file"
|
||||
>
|
||||
<svg
|
||||
aria-hidden="true"
|
||||
class=""
|
||||
data-icon="download"
|
||||
fill="currentColor"
|
||||
focusable="false"
|
||||
height="1em"
|
||||
viewBox="64 64 896 896"
|
||||
width="1em"
|
||||
>
|
||||
<path
|
||||
d="M505.7 661a8 8 0 0 0 12.6 0l112-141.7c4.1-5.2.4-12.9-6.3-12.9h-74.1V168c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v338.3H400c-6.7 0-10.4 7.7-6.3 12.9l112 141.8zM878 626h-60c-4.4 0-8 3.6-8 8v154H214V634c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v198c0 17.7 14.3 32 32 32h684c17.7 0 32-14.3 32-32V634c0-4.4-3.6-8-8-8z"
|
||||
/>
|
||||
</svg>
|
||||
</i>
|
||||
<i
|
||||
aria-label="icon: delete"
|
||||
class="anticon anticon-delete"
|
||||
@@ -1036,7 +877,7 @@ exports[`renders ./components/upload/demo/picture-style.md correctly 1`] = `
|
||||
/>
|
||||
</a>
|
||||
<a
|
||||
class="ant-upload-list-item-name ant-upload-list-item-name-icon-count-2"
|
||||
class="ant-upload-list-item-name ant-upload-list-item-name-icon-count-1"
|
||||
href="https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png"
|
||||
rel="noopener noreferrer"
|
||||
target="_blank"
|
||||
@@ -1047,31 +888,6 @@ exports[`renders ./components/upload/demo/picture-style.md correctly 1`] = `
|
||||
<span
|
||||
class="ant-upload-list-item-card-actions picture"
|
||||
>
|
||||
<a
|
||||
title="Download file"
|
||||
>
|
||||
<i
|
||||
aria-label="icon: download"
|
||||
class="anticon anticon-download"
|
||||
tabindex="-1"
|
||||
title="Download file"
|
||||
>
|
||||
<svg
|
||||
aria-hidden="true"
|
||||
class=""
|
||||
data-icon="download"
|
||||
fill="currentColor"
|
||||
focusable="false"
|
||||
height="1em"
|
||||
viewBox="64 64 896 896"
|
||||
width="1em"
|
||||
>
|
||||
<path
|
||||
d="M505.7 661a8 8 0 0 0 12.6 0l112-141.7c4.1-5.2.4-12.9-6.3-12.9h-74.1V168c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v338.3H400c-6.7 0-10.4 7.7-6.3 12.9l112 141.8zM878 626h-60c-4.4 0-8 3.6-8 8v154H214V634c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v198c0 17.7 14.3 32 32 32h684c17.7 0 32-14.3 32-32V634c0-4.4-3.6-8-8-8z"
|
||||
/>
|
||||
</svg>
|
||||
</i>
|
||||
</a>
|
||||
<a
|
||||
title="Remove file"
|
||||
>
|
||||
@@ -1225,7 +1041,7 @@ exports[`renders ./components/upload/demo/picture-style.md correctly 1`] = `
|
||||
/>
|
||||
</a>
|
||||
<a
|
||||
class="ant-upload-list-item-name ant-upload-list-item-name-icon-count-2"
|
||||
class="ant-upload-list-item-name ant-upload-list-item-name-icon-count-1"
|
||||
href="https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png"
|
||||
rel="noopener noreferrer"
|
||||
target="_blank"
|
||||
@@ -1236,31 +1052,6 @@ exports[`renders ./components/upload/demo/picture-style.md correctly 1`] = `
|
||||
<span
|
||||
class="ant-upload-list-item-card-actions picture"
|
||||
>
|
||||
<a
|
||||
title="Download file"
|
||||
>
|
||||
<i
|
||||
aria-label="icon: download"
|
||||
class="anticon anticon-download"
|
||||
tabindex="-1"
|
||||
title="Download file"
|
||||
>
|
||||
<svg
|
||||
aria-hidden="true"
|
||||
class=""
|
||||
data-icon="download"
|
||||
fill="currentColor"
|
||||
focusable="false"
|
||||
height="1em"
|
||||
viewBox="64 64 896 896"
|
||||
width="1em"
|
||||
>
|
||||
<path
|
||||
d="M505.7 661a8 8 0 0 0 12.6 0l112-141.7c4.1-5.2.4-12.9-6.3-12.9h-74.1V168c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v338.3H400c-6.7 0-10.4 7.7-6.3 12.9l112 141.8zM878 626h-60c-4.4 0-8 3.6-8 8v154H214V634c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v198c0 17.7 14.3 32 32 32h684c17.7 0 32-14.3 32-32V634c0-4.4-3.6-8-8-8z"
|
||||
/>
|
||||
</svg>
|
||||
</i>
|
||||
</a>
|
||||
<a
|
||||
title="Remove file"
|
||||
>
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user