Compare commits

...

635 Commits

Author SHA1 Message Date
zombieJ
5a128c40a9 docs: add changelog (#17902) 2019-07-26 00:18:20 +08:00
zombieJ
24bfcacc38 fix: Upload can not click in Form.Item (#17897) 2019-07-25 23:53:54 +08:00
信鑫-King
3e62dafbfe Release 3.20.6 (#17861)
Release 3.20.6
2019-07-25 00:44:16 +08:00
ycjcl868
eb6307f9cf 📝 changelog 2019-07-25 00:15:33 +08:00
ycjcl868
f7d7d58815 fix: readme 2019-07-25 00:12:55 +08:00
ycjcl868
5752fb5955 fix: lazy 2019-07-24 21:59:41 +08:00
ycjcl868
d7ab9c4958 📝 en changelog 2019-07-24 21:16:46 +08:00
ycjcl868
1a183dd986 fix: docs changelog cn 2019-07-24 21:04:46 +08:00
ycjcl868
902a813cab 📝 zh-CN changelog 2019-07-24 20:58:14 +08:00
偏右
e6874e48c9 Merge pull request #17857 from ant-design/fix-safari-style
fix: TimePicker safari weird render bug
2019-07-24 19:32:45 +08:00
afc163
be030d2387 🐛 Fix TimePicker safari render bug
close #17842
2019-07-24 19:28:09 +08:00
偏右
d933e5e9cf Merge pull request #17846 from ant-design/fix-table-filter-dropdown
fix: table filter dropdown trigger onChange on some situation
2019-07-24 16:28:07 +08:00
afc163
ce7ab240cf 🐛 Fix Table filterDropdown always trigger onChange
close #17833
2019-07-24 16:06:51 +08:00
afc163
22179f3511 💄 code style optimizaiton 2019-07-24 15:40:07 +08:00
zombieJ
bce3696ec0 fix count escape (#17841) 2019-07-24 15:07:10 +08:00
Ray Booysen
d4164f6c33 Update faq.en-US.md (#17832)
Some small language changes to make it easier to read.
2019-07-24 10:51:33 +08:00
偏右
bc2d24646e 💄 correct @input-hover-border-color (#17820)
https://github.com/ant-design/ant-design/pull/17784#issuecomment-514069999
2019-07-23 15:06:25 +08:00
afc163
ec744c93da 📝 fix cra documentation link 2019-07-23 15:05:37 +08:00
zombieJ
6e9b37aa70 pretter Line progress style (#17819) 2019-07-23 14:42:30 +08:00
偏右
cd63ff4b70 Merge pull request #17818 from Jiang-Xuan/patch-1
completing the Chinese document for Select component
2019-07-23 13:47:34 +08:00
蒋璇
20237b4033 Update index.zh-CN.md 2019-07-23 13:37:08 +08:00
ShiCheng
5acc2a40fc fix Result extra is not centered (#17786) 2019-07-23 11:30:14 +08:00
afc163
17b27c978e 📝 Remove Breadcrumb.Item separator doc
close #17812
2019-07-23 11:13:59 +08:00
偏右
340ec3a7ef Merge pull request #17808 from mtadams007/bugfix/alert-message-color
fix: make alert message attribute affect message even without description
2019-07-23 11:09:48 +08:00
Michael Adams
a8c6d22931 make alert message attribute affect message even without description 2019-07-22 17:34:49 -04:00
偏右
5ded0aef96 Merge pull request #17805 from phthhieu/fix_circular
fix: circular dependency in Menu
2019-07-22 21:37:40 +08:00
Hieu Pham
53ce81690e Fix circular dependency in Menu
https://github.com/ant-design/ant-design/issues/17803

Co-authored-by: Hau Dao <hau.vdao@gmail.com>
2019-07-22 20:15:48 +07:00
afc163
78496da6ef fix snapshot 2019-07-22 19:28:11 +08:00
afc163
518bf8c929 fix snapshot 2019-07-22 19:22:51 +08:00
afc163
5742ae221c improve upload list layout style 2019-07-22 19:22:51 +08:00
veveue
913d19113f fix upLoadList style 2019-07-22 19:22:51 +08:00
Aleksandr Chernokondratenko
4f781a1769 Long placeholders truncate (#17797) 2019-07-22 19:21:33 +08:00
afc163
18c05189cf 💄 Remove Table demo use select hack css
close #17455

bc2de929e7/specs/draggable.spec.jsx (L374)
2019-07-22 18:53:58 +08:00
Bhavesh Chowdhury
03a6950204 Update download.en-US.md (#17792) 2019-07-22 18:20:34 +08:00
mraiguo
ebe9097689 fix: DatePicker date order (#17694)
* Fix selected time order #17346

* add test case
2019-07-22 17:07:13 +08:00
zombieJ
271b08192e fix: Transfer change dataSource will re-fresh lazy render (#17783)
* fix lazy load logic

* opt

* clean up

* clean when udpate
2019-07-22 15:52:09 +08:00
偏右
8a60bf0ced Merge pull request #17784 from ant-design/style-date-picker-hover-border
style: DatePicker hover style less variable
2019-07-22 15:13:46 +08:00
afc163
9ef1cd70b6 💄 fix DatePicker hover style less variable 2019-07-22 15:09:43 +08:00
偏右
e59efdb0cb Merge pull request #17775 from ant-design/fix-radio-button-style
fix: Radio.Button disabled item style
2019-07-22 13:44:53 +08:00
afc163
d43ff9d37a 🐛 Fix Radio.Button disabled item style
close #17736
2019-07-22 10:47:49 +08:00
ye4241
30a0a4d9e6 Update electron official website; (#17767) 2019-07-21 18:51:46 +08:00
Stanley Thijssen
427d0435b7 style: Remove right-margin of last item in Rate component (#17764)
* Removed right margin from last rating star

* Updated demo file to be inline with other demo that makes use of text

* Updated snapshot
2019-07-21 13:01:27 +08:00
Stanley Thijssen
69ef27709c fix: Styling issue where all spans next to a checkbox wrapper get a padding (#17761)
* fix styling issue

* Added padding for span only when there is a checkbox in front of it

* Fixed last small styling issue where span and checkboxes didnt have any padding

* Updated snapshots with new class
2019-07-20 22:20:02 +08:00
偏右
b8485ca744 🐛 Fix Input line height in IE (#17759)
close #17753
2019-07-20 20:01:51 +08:00
Stanley Thijssen
5a32990874 fix: Styling issue where all spans next to a checkbox wrapper get a padding (#17752)
* fix styling issue

* Added padding for span only when there is a checkbox in front of it
2019-07-20 19:57:52 +08:00
afc163
06eb86c360 📝 Add offcial themes in documentation 2019-07-20 17:17:53 +08:00
偏右
29e4d2f3eb Merge pull request #17756 from ant-design/fix-cascader
fix: Cascader broken when option children is null
2019-07-20 12:25:08 +08:00
afc163
93e41ed593 🐛 Fix Cascader broken when option children is null
close #17735
2019-07-20 12:24:17 +08:00
afc163
32f1e333ca 📝 Fix pull request link in changelog
close #17755
2019-07-20 11:37:33 +08:00
偏右
ca5d765eba Merge pull request #17748 from yoyo837/fix-col
fix: All .ant-col sets the min-height
2019-07-20 11:25:08 +08:00
Wei Zhu
3ad39bb13a Merge pull request #17751 from ant-design/github-workflow
Add deploy workflow
2019-07-19 21:42:19 +08:00
Meck Zhu
287010d5a6 Add deploy workflow 2019-07-19 21:35:51 +08:00
yoyo837
1d607d7019 all ant-col min-height setting 2019-07-19 20:34:12 +08:00
afc163
d6e14efa56 📝 update changelog 2019-07-19 19:11:51 +08:00
afc163
bf2abd122e 3.20.5 2019-07-19 17:53:13 +08:00
偏右
896e4e8fad Merge pull request #17743 from ant-design/fix-danger-ghost-button
fix: Button danger style when type is ghost
2019-07-19 17:50:26 +08:00
偏右
3f2e1b10e5 Merge pull request #17708 from cottom/chore/remove-extra-disabled
chore: remove unnecessary disable default props
2019-07-19 17:47:11 +08:00
afc163
3c771b3b23 🐛 Fix Button danger style when type is ghost
close #17742
2019-07-19 17:35:04 +08:00
wenhong
77d8c92a16 chore: remove unnecessary disable default props 2019-07-19 17:05:29 +08:00
zombieJ
e83566b2e0 docs: update changelog (#17739)
* update changelog

* use img
2019-07-19 16:35:25 +08:00
afc163
bc8cb6e990 📝 fix changelog markdown style 2019-07-19 14:11:26 +08:00
偏右
a3d3f88c4a Merge pull request #17733 from kdnk/update-lodash
Update lodash
2019-07-19 13:24:41 +08:00
Kodai Nakamura
8d0ce71a20 Update lodash 2019-07-19 13:34:47 +09:00
偏右
4465c038b2 Merge pull request #17728 from ant-design/fix-pagination-style
💄 pagiation item hovering without underline
2019-07-19 10:54:47 +08:00
偏右
5192440eb6 Merge pull request #17719 from ReganL/patch-1
Fixed typo in use-with-create-react-app.en-US.md
2019-07-19 10:52:17 +08:00
afc163
b7b1bcfc90 💄 pagiation item hovering without underline 2019-07-19 10:50:56 +08:00
Regan Langford
f0c5f7ec00 Fixed typo in use-with-create-react-app.en-US.md
Minor typo in the eject application section, have corrected and made the sentence slightly more descriptive.
2019-07-18 13:10:01 +02:00
zombieJ
cdcbb54393 fix dekko test (#17707) 2019-07-18 15:13:23 +08:00
偏右
d032784dd2 Merge pull request #17705 from lhx6538665/patch-4
style: expand card action click area
2019-07-18 14:33:58 +08:00
刘宏玺
28d70f57fc 让card的action更容易点击 2019-07-18 13:49:43 +08:00
偏右
57c9c1f4e1 Merge pull request #17697 from ant-design/improve-less-variables
style: Improve less variables
2019-07-17 23:06:50 +08:00
偏右
f5e318ac98 Merge pull request #17698 from ant-design/drawer-multi-unmount
fix: delete drawer in child and re-render, no push started
2019-07-17 21:26:38 +08:00
jljsj
bc39c158ab add test 2019-07-17 20:41:53 +08:00
jljsj
d4c90d4a3b fix: delete drawer in child and re-render, no push started 2019-07-17 20:05:39 +08:00
afc163
a9a24d0d39 📝 Add components count in component page 2019-07-17 19:52:21 +08:00
偏右
85ee1e485f Merge pull request #17600 from ant-design/merge-portal
fix: unified modal and drawer protal and fix overflow conflict
2019-07-17 19:28:19 +08:00
afc163
37784bc8a2 fix snapshot 2019-07-17 19:04:40 +08:00
afc163
c15c0fc199 🔧 Add less variables for Tabs[type="card"] 2019-07-17 18:58:30 +08:00
afc163
b09d59e9fe 🔧 Add less variables for Timeline 2019-07-17 18:43:10 +08:00
afc163
6d76292b29 🔧 Add less var @progress-radius 2019-07-17 18:28:02 +08:00
afc163
2ad61d6ceb 🔧 Add less variables for Slider handler 2019-07-17 18:04:13 +08:00
afc163
2add8007be code style improve 2019-07-17 17:57:50 +08:00
afc163
75ba74c23d 💄 should use @border-radius-sm 2019-07-17 17:51:26 +08:00
afc163
3a3cf47472 💄 Optimize danger Button design 2019-07-17 17:48:10 +08:00
偏右
248a0b6d59 Merge pull request #17696 from JonathanLee-LX/master
docs: correct form documentation
2019-07-17 17:30:42 +08:00
偏右
6e4a8632f5 Merge pull request #17695 from lhx6538665/patch-3
汉化api标题
2019-07-17 17:25:22 +08:00
Jonathan Lee
9e6cb56ef7 docs: correct form documentation 2019-07-17 17:23:42 +08:00
刘宏玺
ffcf7fec4e 汉化api标题 2019-07-17 17:23:39 +08:00
偏右
ac3c0520c8 Merge pull request #17692 from lhx6538665/patch-2
汉化api标题
2019-07-17 16:24:18 +08:00
刘宏玺
8ad41c02cd 汉化api标题 2019-07-17 16:00:32 +08:00
偏右
4e2ca5bd3e Merge pull request #17659 from billfeller/master
feat(Empty): description prop support false value to remove description node
2019-07-17 13:41:28 +08:00
wadezhan
6b877dce93 fix: last order 2019-07-17 11:49:47 +08:00
偏右
6c67de4b98 Merge pull request #17675 from ztplz/tabbar
fix: Correct renderTabBar type
2019-07-17 11:31:45 +08:00
偏右
ce52bf34b7 Merge pull request #17677 from binyellow/feat-anchor
feat: Re-bind scroll events when components change, add test cases
2019-07-17 11:30:50 +08:00
wadezhan
b808eddcb4 fix: ci fail 2019-07-17 11:30:38 +08:00
jiang
d0c636fa50 Merge branch 'master' into merge-portal 2019-07-17 11:14:46 +08:00
zombiej
56166f6901 chore: fix docs only mark of affix 2019-07-17 11:11:55 +08:00
wadezhan
66876623c7 fix: ci fail 2019-07-17 11:04:30 +08:00
偏右
d2060ac372 Merge pull request #17678 from ant-design/affix
fix: Adjust measure logic
2019-07-17 10:16:28 +08:00
zombiej
6b422814de fix lint 2019-07-16 23:50:21 +08:00
wadezhan
e403947127 feat(Empty): description prop support false value to remove description node 2019-07-16 22:44:18 +08:00
wadezhan
fab98738f4 feat(Empty): description prop support false value to remove description node 2019-07-16 22:32:36 +08:00
wadezhan
9d437d39f9 feat(Empty): description prop support undefined/null value to remove description node 2019-07-16 22:11:30 +08:00
wadezhan
5df766fb5b feat(Empty): description prop support undefined/null value to remove description node 2019-07-16 22:06:58 +08:00
wadezz
dbc8d4b83b Merge pull request #3 from ant-design/master
merge: ant-design/master
2019-07-16 21:43:08 +08:00
zombiej
a9dbee97f0 fix container 2019-07-16 20:48:03 +08:00
黄斌
aa663e149d feat: Re-bind scroll events when components change, add test cases 2019-07-16 19:19:11 +08:00
偏右
e907e1408f Merge pull request #17676 from lixiaoyang1992/form-pr
feat(Form): upgrade setFieldsValue function declaration
2019-07-16 18:21:37 +08:00
lixiaoyang1992
4e804bd466 feat(Form): upgrade setFieldsValue function declaration 2019-07-16 18:04:52 +08:00
ztplz
2762f40394 Correct renderTabBar type 2019-07-16 17:32:55 +08:00
偏右
546c97e09f Merge pull request #17673 from lhx6538665/patch-2
修改api的样式错误
2019-07-16 17:24:50 +08:00
刘宏玺
cd9c3d7327 修改api的样式错误 2019-07-16 17:23:20 +08:00
afc163
6e795d6f79 📝 update PULL_REQUEST_TEMPLATE 2019-07-16 11:56:58 +08:00
偏右
aa0a0de0ca Merge pull request #17657 from ant-design/fix-set-state-warning
fix: Cannot update during an existing state transition
2019-07-16 11:51:29 +08:00
zombieJ
e40239a0eb update rc-select deps (#17664) 2019-07-16 11:50:14 +08:00
afc163
67e027a41c 🐛 Fix Cannot update during an existing state transition
close #17147
2019-07-16 11:25:35 +08:00
wadezhan
c6730d419a feat: Empty description support false value 2019-07-15 23:37:49 +08:00
wadezhan
61dc08f9c7 feat: Empty description support false value 2019-07-15 23:24:20 +08:00
wadezz
ac962a5bce Merge pull request #2 from ant-design/master
merge: ant-design/master
2019-07-15 23:05:36 +08:00
zombieJ
bed07392fd update snapshot (#17656) 2019-07-15 19:32:46 +08:00
偏右
b44a075ccc Merge pull request #17641 from ant-design/fix-firefox-border
fix: Table border radius missing in Firefox
2019-07-15 18:53:11 +08:00
zombiej
edacc50543 not hide scroll line when multiple lines 2019-07-15 17:59:29 +08:00
Meck Zhu
3f7eb97cbf docs: Use more proper word 2019-07-15 16:34:51 +08:00
Ivan
9fdf41740d Extend MenuItemProps from HTMLAttributes<HTMLLIElement> (#17629) 2019-07-15 15:43:11 +08:00
Meck Zhu
f4095ef5d5 Fix css properties orders 2019-07-15 15:32:08 +08:00
Meck Zhu
188cd35fb1 Bump 3.20.3 2019-07-15 15:18:22 +08:00
Wei Zhu
735c04aff0 Add 3.20.3 changelog (#17646)
Add 3.20.3 changelog
2019-07-15 15:17:48 +08:00
Meck Zhu
437defccb3 Add 3.20.3 changelog 2019-07-15 15:10:13 +08:00
Wei Zhu
5b7c922594 Revert #17508 (#17639)
* Revert "fix: Style property orders"

This reverts commit 54a992c359.

* Revert "fix: optimize Input presuffix style(#17414)"

This reverts commit 9691d2bee1.
2019-07-15 15:04:51 +08:00
jljsj
b5632d6eef fix react 15 test 2019-07-15 14:33:56 +08:00
jljsj
786bde9ca1 update modal and drawer protal 2019-07-15 14:33:56 +08:00
afc163
e8dabedb76 🐛 Fix Table border radius missing in Firefox
close #17611

ref https://github.com/ant-design/ant-design/pull/12263#discussion_r303193443
2019-07-15 14:23:00 +08:00
afc163
491e38838b fix snapshot 2019-07-15 13:43:36 +08:00
偏右
138abc847e Merge pull request #17633 from Willworkgogogo/patch-1
Update 404.md
2019-07-15 13:35:41 +08:00
Will
20fa17b8b1 Update 404.md 2019-07-15 10:43:28 +08:00
诸岳
aec0eb9f93 Bump 3.20.2 2019-07-13 17:02:13 +08:00
诸岳
54a992c359 fix: Style property orders 2019-07-13 16:55:18 +08:00
诸岳
5e79e51944 docs: Add the changelog of 3.20.2 (#17621) 2019-07-13 15:57:18 +08:00
binyellow
9afe726a6f perf: setState only when activeKey changed (#17620) 2019-07-13 10:43:35 +08:00
Tomáš Hylský
6c9b1779aa Fix Collapse Panel key type. (#17557) 2019-07-13 10:31:56 +08:00
诸岳
8798198113 fix(test): Jest with ES Modules of react-dnd (#17607) 2019-07-13 10:29:47 +08:00
Piotr Monwid-Olechnowicz
e49707c0aa Update responsive.md (#17586)
Fix prop typo. `border` -> `bordered`
2019-07-12 10:42:09 +08:00
偏右
aa70ae0dcc Merge pull request #17525 from ant-design/dependabot/npm_and_yarn/babel/plugin-transform-typescript-approx-7.5.1
Update @babel/plugin-transform-typescript requirement from ~7.4.5 to ~7.5.1
2019-07-11 23:40:10 +08:00
偏右
44aa1bd15f Merge pull request #17592 from pengtikui/master
docs: fix typo
2019-07-11 23:39:21 +08:00
偏右
ade577a9f9 Merge pull request #17596 from LilyWakana/issue17569
fix: button loading style(#17569)
2019-07-11 23:38:40 +08:00
riho
001384a65b fix: button loading style(#17569) 2019-07-11 20:38:40 +08:00
pengtikui
e17e3253a0 docs: fix typo 2019-07-11 18:20:06 +08:00
偏右
a46eb8ea30 Update package.json 2019-07-11 17:23:03 +08:00
偏右
3ed4128fa7 Merge pull request #17589 from yongdamsh/patch-1
Update the markup example in API section of menu.md
2019-07-11 17:21:33 +08:00
Sanghyeon Lee
430117288d docs: fix tag name in the API example 2019-07-11 18:09:00 +09:00
Sanghyeon Lee
559682df23 docs: fix tag name in the API example 2019-07-11 18:06:37 +09:00
偏右
756ded9540 Merge pull request #17583 from ant-design/fix-cascader-style
fix: 💄 Optimize Cascader input style
2019-07-11 14:23:49 +08:00
MuYu
fb0b4f0fc9 docs: show version Number features were added (#17373)
* docs: add api first appearance

* docs: fix auto-complete doc

* docs: replace Version Added with Version

* docs: date picker common method

* docs: date picker common method

* docs: tree

* docs: remove meaningless 3.0.0
2019-07-11 14:14:33 +08:00
偏右
72f531dce8 💄 Optimize Cascader input style
avoid to overclap arrow

close #17582
2019-07-11 14:09:55 +08:00
偏右
79bff3ff61 Merge pull request #17581 from MrHeer/fix-#17555
fix: Typescript definition of CascaderOptionType missing some fields #17555
2019-07-11 12:28:59 +08:00
MrHeer
7e4e5a8866 Fix: Typescript definition of CascaderOptionType missing some fields #17555 2019-07-11 12:05:43 +08:00
M Mitchell
4e629da9ab fix: Should allow inline style for Descriptions component, close #17533 (#17558) 2019-07-10 10:01:31 +08:00
Tom Xu
d52b85fcc4 Fix TypeScript type of Descriptions title, close #17534 (#17559) 2019-07-10 09:56:46 +08:00
zombieJ
56a961cb2b fix: Align cascader loading style & update doc (#17550) 2019-07-09 19:10:36 +08:00
诸岳
85d81e7e3e fix(Cascader): Should show not found content when options.length is 0, close #17513 (#17538) 2019-07-09 16:29:42 +08:00
vagusX
e335a214f6 fix: props#locale description in Transfer (#17545) 2019-07-09 16:17:30 +08:00
偏右
905b38fbf2 Merge pull request #17540 from ant-design/revert-17517-revert-icon-entry
Revert "chore: use none-dist icons entry"
2019-07-09 11:36:19 +08:00
偏右
189ad71d32 Revert "chore: use none-dist icons entry" 2019-07-09 11:33:03 +08:00
偏右
3432ac7401 Merge pull request #17517 from ant-design/revert-icon-entry
chore: use none-dist icons entry
2019-07-08 21:01:48 +08:00
afc163
390807605e 🔧 use none-dist icons entry 2019-07-08 20:46:19 +08:00
偏右
2023e86f8f Merge pull request #17508 from LilyWakana/issue17414
fix: optimize Input presuffix style(#17414)
2019-07-08 19:34:29 +08:00
偏右
041eb1ac94 Merge pull request #17526 from ztplz/cas
Improve code style
2019-07-08 17:47:23 +08:00
ztplz
a614b54c28 Improve code style 2019-07-08 17:42:36 +08:00
dependabot-preview[bot]
9fb6e78279 Update @babel/plugin-transform-typescript requirement
Updates the requirements on [@babel/plugin-transform-typescript](https://github.com/babel/babel) to permit the latest version.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/master/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/compare/v7.4.5...v7.5.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-07-08 08:57:25 +00:00
zombieJ
4a1d68c87f chore: Add warn of value not provided in Cascader (#17511)
* add warn of `value` not provided

* adjust desc & logic
2019-07-08 10:57:34 +08:00
偏右
4f288489ec Merge pull request #17505 from barakplasma/master
fix: typo in console.error
2019-07-08 10:22:15 +08:00
riho
9691d2bee1 fix: optimize Input presuffix style(#17414) 2019-07-07 22:24:37 +08:00
Michael Salaverry
76db651080 fix: typo in console.error 2019-07-07 17:08:46 +03:00
Yu
bc6c0f1460 chore: changelog for 3.20.1 (#17499) 2019-07-07 13:57:28 +08:00
偏右
1d2bc0792b fix: some tabs style (#17500)
* 🐛 Fix Tabs disabled tab style

close #17468

* 🐛 Fix Tabs next icon right 2px bug

close #17477
2019-07-07 12:04:40 +08:00
afc163
47b85c9d8b lock @babel/plugin-transform-typescript to ~7.4.5 2019-07-07 11:16:51 +08:00
afc163
4d1fe60093 lock @babel/plugin-transform-typescript again
7.5.1 still has bug

https://github.com/babel/babel/issues/10156#issuecomment-508924725
2019-07-07 11:11:41 +08:00
afc163
e9b370d0c0 📝 Add documentation for LocaleProvider and List
close #17399
2019-07-06 23:40:03 +08:00
偏右
0f6b8c8059 🆙 upgrade react-dnd 2019-07-06 22:25:21 +08:00
偏右
b9ffa8a720 Merge pull request #17502 from ant-design/fix/fix-switch-type
fix: fix type of SwitchProps
2019-07-06 22:18:05 +08:00
DiamondYuan
6b7ad105c6 fix: fix type of SwitchProps 2019-07-06 22:16:17 +08:00
偏右
c484fdf0e9 Remove @babel/plugin-transform-typescript dep
https://github.com/babel/babel/pull/10167
2019-07-06 22:14:01 +08:00
偏右
5375bf00d3 Merge pull request #17480 from ant-design/change-date-picker-arrow
fix: 💄 change DatePicker arrow style
2019-07-05 15:07:35 +08:00
zombieJ
a517a9e01b chore: Lock @babel/plugin-transform-typescript version (#17486)
* lock @babel/plugin-transform-typescript

* pined 7.4.x
2019-07-05 14:27:57 +08:00
afc163
6498cbb283 💄 change another arrow style 2019-07-04 23:50:32 +08:00
jiang
a1298463be rm drawer config consumer props (#17390)
* rm drawer config consumer props

* Update index.tsx
2019-07-04 20:53:55 +08:00
陈帅
1fc1710582 doc: split demos (#17415)
* split demos

close #17396

* snapshot updated

* split all demo

* fix lint error

* better code style

* change complex to error

* sort demos
2019-07-04 15:14:13 +08:00
偏右
b1e63be9e3 fix: icon typo (#17458)
* 🐛 Fix icon typo

close #17448

*  update snapshots

*  add test case
2019-07-04 15:00:42 +08:00
偏右
859bba58f8 Merge pull request #17447 from ant-design/fix-time-picker-style
style: 💄 optimize TimePicker focus style
2019-07-04 00:02:51 +08:00
afc163
efadb09569 💄 Optimize TimePicker focus style
close #17440
2019-07-03 23:25:04 +08:00
偏右
1dff6bf3b5 Merge pull request #17433 from ant-design/omit-loading
fix: Omit AutoComplete loading type
2019-07-03 17:09:58 +08:00
afc163
0d35b1e3e3 🐛 Omit AutoComplete loading type
close #17432
2019-07-03 16:55:36 +08:00
偏右
73d173da04 Merge pull request #17421 from justjavac/master
fix: DatePicker's input box is obscured on safari
2019-07-03 13:48:16 +08:00
迷渡
f78fc1c757 fix: DatePicker's input box is obscured on safari 2019-07-03 10:15:45 +08:00
偏右
6429172ba3 Merge pull request #17412 from ant-design/fix-form-onSubmit-type
fix: Form onSubmit type
2019-07-02 22:20:59 +08:00
陈帅
8a9d16be07 fix gh-pages ci running problem (#17382) 2019-07-02 19:42:47 +08:00
afc163
32132c58cf 🐛 Fix Form onSubmit type
close #17400
2019-07-02 19:03:23 +08:00
陈帅
f096b89828 Merge pull request #17389 from ant-design/fix-className-undefined
fix: fix classname is undefined
2019-07-02 14:45:27 +08:00
陈帅
2c4976bbdb remove background-color 2019-07-02 14:21:47 +08:00
afc163
2ef8d77c3d 📝 update changelog 2019-07-02 14:18:28 +08:00
偏右
e9adb452d0 Update package.json 2019-07-02 13:15:34 +08:00
陈帅
439b85f8d2 fix style pollution problem 2019-07-01 19:26:57 +08:00
zombieJ
b5143df1a4 fix: Upload preview should work with Blob (#17392)
* fix: Upload preview should work with Blob

* rm only
2019-07-01 17:52:37 +08:00
陈帅
9b8ccc4ee7 add className test 2019-07-01 15:28:02 +08:00
陈帅
00bcb6928e remove spaces 2019-07-01 15:22:29 +08:00
陈帅
89a8df1d41 fix classname is undefined 2019-07-01 15:11:37 +08:00
afc163
d87bff6203 📝 update links 2019-07-01 11:05:17 +08:00
陈帅
3faae975fa fix result error (#17385) 2019-07-01 10:57:39 +08:00
陈帅
d942f173f9 Merge pull request #17378 from eldarAkay/patch-1
fix typo
2019-07-01 00:14:36 +08:00
陈帅
92d4799e5a doc: fix changelog
我总不至于连一行 log 都写错把! 不用预览了!!!! 还真写错了

close #17380
2019-07-01 00:12:57 +08:00
陈帅
0ea9779ac3 publish 3.20.0 2019-06-30 22:37:00 +08:00
陈帅
bbb1690293 add 3.20.0 changelog (#17365)
* add 3.20.0 changelog

* fix typo

* fix typo

* change image

* change image

* beter img code style

* Add Result changlog
2019-06-30 22:26:54 +08:00
陈帅
4d5dae078f Merge pull request #17377 from ant-design/fix-test
chore: update test case
2019-06-30 22:00:26 +08:00
Eldar Mustafaiev
fa539507da fix typo 2019-06-30 16:20:57 +03:00
陈帅
859be320fb Merge pull request #17376 from ant-design/feature
merge Feather into master
2019-06-30 20:45:12 +08:00
zombiej
be33ebfa08 update test case 2019-06-30 20:31:14 +08:00
陈帅
4972383c3c feat: New Components Result (#17244)
* New Components Result

antd 又变大了一点

* fix review warning

remove classname "view"

The class name of status hits the outermost layer

* rm fragment

* fix build error

* update snapshot

* add PRESENTED_SVG_DEFAULT

* fix doc

* fix lint

* fix compile error

* fix review warning

* fix react15 error

* add new demo

* remove not required code

* updated snapshot

* api some empty

* change svg to image
2019-06-30 20:15:44 +08:00
zombieJ
a5f495692e fix: Tooltip not work correctly on disabled Switch (#17372)
* add tooltip of Switch

* clean up

* updat snapshot
2019-06-30 00:29:48 +08:00
zombiej
12c577d386 docs: Update menuItemSelectedIcon desc of Select
close #17360
2019-06-29 22:53:16 +08:00
陈帅
319b11d388 Merge pull request #17364 from ant-design/feature
merge Feature into master
2019-06-29 13:25:47 +08:00
陈帅
8eceb04d62 update snap
issue in #17280 and #17330
2019-06-29 00:39:53 +08:00
陈帅
722b39ec16 Merge branch 'master' into feature 2019-06-28 21:55:15 +08:00
偏右
f557cf8de1 Merge pull request #17355 from NsNe/develop
docs(Table): update description of hideDefaultSelections
2019-06-28 21:51:21 +08:00
偏右
95c0a4e7c5 Merge pull request #17321 from ant-design/optimize-pageHeader-className-naming
chore: Optimize PageHeader className naming
2019-06-28 21:15:30 +08:00
王林涛
b5d629a8a3 docs(Table): update description of hideDefaultSelections 2019-06-28 16:23:20 +08:00
偏右
c3a3db385c Merge pull request #17345 from hengkx/fix-17267
docs: Tree treeData
2019-06-28 13:59:33 +08:00
偏右
a8f68d7a5d Merge pull request #17350 from ant-design/clean-up-scripts
chore: move scripts to antd-tools
2019-06-28 13:59:15 +08:00
偏右
b5d16a6bd1 Merge pull request #17342 from yoyo837/checkbox-onchange-sort
fix: CheckboxGroup onChange 值保持选项的顺序
2019-06-28 13:44:49 +08:00
偏右
2e5096d09b Merge pull request #17351 from ant-design/fix-small-table-header-background
fix: small table header background
2019-06-28 13:40:32 +08:00
afc163
10a3a7f7ae 🐛 Fix small table header background
revert #14539

it should be white in our design spec
2019-06-28 13:39:02 +08:00
afc163
10a6d1be8c 🔧 move scripts to antd-tools 2019-06-28 12:18:34 +08:00
yoyo837
612bf82c34 add test case 2019-06-28 11:11:27 +08:00
偏右
92f18f32f5 Merge pull request #17347 from ant-design/fix-mentions-height
fix(Mentions): Incorrect line-height from .input() style
2019-06-28 10:51:01 +08:00
偏右
e8e7f2d18a Merge pull request #17336 from susiwen8/#17329
Add missing info in documents
2019-06-28 10:50:45 +08:00
susiwen
06eba00e0b Add FAQ link 2019-06-28 10:44:20 +08:00
yoyo837
50f6b9c903 update 2019-06-28 10:31:40 +08:00
诸岳
9c9365ce00 fix(Mentions): Incorrect line-height from .input() style 2019-06-28 10:28:43 +08:00
yoyo837
c8d5243b97 sort 2019-06-28 10:26:55 +08:00
偏右
f2954e6ca8 Merge branch 'master' into #17329 2019-06-28 10:15:51 +08:00
yoyo837
660ebbd58f fix values 2019-06-28 10:00:12 +08:00
susiwen
b710f47996 Add missing FAQ site 2019-06-28 08:50:50 +08:00
hengkx
0130cbfa16 fix Tree treeData 2019-06-28 03:28:00 +08:00
陈帅
bdfcc912c0 fix style warning 2019-06-27 23:33:27 +08:00
偏右
c3915157cb Merge pull request #17331 from ant-design/improve-swicth-types
chore: Extract SwitchChangeEventHandler and SwitchSize
2019-06-27 23:01:59 +08:00
偏右
05feaeb83c Merge pull request #17316 from ant-design/key-drawer
fix: add maskClosable is false ESC close
2019-06-27 23:01:35 +08:00
偏右
e1b8deb41d Merge pull request #17330 from hengkx/feature-desciption
feat: Descriptions add vertical layout
2019-06-27 23:01:03 +08:00
偏右
b0fb5336fe Merge pull request #17337 from kairi1227/master
fix: Descriptions组件不设置label的显示问题
2019-06-27 21:54:23 +08:00
偏右
d74c590f17 Update index.zh-CN.md 2019-06-27 21:51:43 +08:00
yoyo837
32bb62be15 CheckboxGroup onChange 值保持选项的顺序 2019-06-27 18:54:34 +08:00
zombiej
30e653b21b chore: Update netfly config 2019-06-27 18:50:45 +08:00
xuqiang
657550118e fixed #17290 2019-06-27 16:18:25 +08:00
xuqiang
543262295a fixed https://github.com/ant-design/ant-design/issues/17290 2019-06-27 16:06:34 +08:00
susiwen
85e483921b Add missing info in documents 2019-06-27 15:46:00 +08:00
Meck Zhu
4463d24660 docs: Remove predix I from interface 2019-06-27 14:17:08 +08:00
hengkx
61318a1856 update descriptions snapshots 2019-06-27 14:16:21 +08:00
hengkx
0245d41873 fix Description vertical borderd 2019-06-27 13:54:56 +08:00
hengkx
584713bc62 fix Desciption doc 2019-06-27 13:47:28 +08:00
Meck Zhu
87afda5623 Extract SwitchChangeEventHandler and SwitchSize
With this change, we can define change handler more convenience:

Before:

```javascript
const handleChange = (checked: boolean, event: MouseEvent) => {
  ...
}
```

After:

```javascript
const handleChange: SwitchChangeEventHandler = (checked, event) => {
  ...
}
```
2019-06-27 12:26:09 +08:00
hengkx
2a9da95a92 feat: Descriptions add vertical layout 2019-06-27 11:29:33 +08:00
偏右
080842bbf9 🐛 unlock react-router version back
https://github.com/ReactTraining/react-router/issues/6811#issuecomment-505894103
2019-06-27 00:14:36 +08:00
偏右
6d26675947 Merge pull request #17315 from hengkx/feature-circle-gradient
feat: progress circle add support gradient
2019-06-27 00:09:31 +08:00
偏右
000757d74a Merge pull request #17311 from ant-design/jljsj33-patch-1
chore: Update rc-drawer version to fix afterVisibleChange issue
2019-06-27 00:09:04 +08:00
偏右
b1d6767732 Merge pull request #17318 from ant-design/fix-mentions-placeholder
[Mentions] style: Fix placeholder color
2019-06-27 00:08:20 +08:00
afc163
c6a1837075 🆙 upgrade eslint-config-prettier 2019-06-26 19:24:05 +08:00
afc163
862cecfd63 💄 Better className of PageHeader 2019-06-26 19:16:06 +08:00
zombieJ
6d0cf1de01 rm useless style (#17319) 2019-06-26 18:38:27 +08:00
hengkx
c1a21724c1 Progress merge demo 2019-06-26 18:13:45 +08:00
诸岳
171e838f43 style: Fix placeholder color for Mentions, close #17317 2019-06-26 18:02:49 +08:00
jljsj
dae1ab923a fix drawer test 2019-06-26 17:43:15 +08:00
hengkx
2a42432c10 Progress Circle support gradient 2019-06-26 17:31:54 +08:00
jiang
ba08d48c80 Update package.json 2019-06-26 16:35:52 +08:00
偏右
94072ad5ea fix: Descriptions.Item not support className (#17280)
* 🐛 Fix Desciptions.Item not support className

close #17276

* refactor descriptions styles implementation

* use `th` as label elements in bordered situation

*  update snapshots
2019-06-26 16:05:46 +08:00
zombieJ
fed8e85edb Merge pull request #17305 from ant-design/master-to-merge
Master master into feature
2019-06-26 15:21:36 +08:00
afc163
d3db99f882 resolve conflict and merge feature branch 2019-06-26 14:30:42 +08:00
zombiej
b2261bbfc7 chore: lock react-router version 2019-06-26 14:07:13 +08:00
偏右
ec416a8644 Merge pull request #17300 from toshi1127/fix-issue17288
fix: size fields in Skeleton AvatarProps to accept numbers
2019-06-26 11:21:27 +08:00
toshi1127
7a0da03907 fix SkeletonAvatarProps's size to accept number 2019-06-26 03:42:42 +09:00
Mateusz Wierzbicki
ec03971100 docs: update design resource page (#17289)
I've added card for the UI kit for Figma that we spoke about via Twitter.
2019-06-25 17:09:59 +08:00
afc163
795e6a5e0a fix eslint errors 2019-06-25 12:09:13 +08:00
偏右
868cd6197b 💄 Fix Tooltip arrow shadow (#17264)
close #17259

same as #13935
2019-06-25 11:15:33 +08:00
偏右
25f913f07a Merge pull request #17262 from ant-design/fix-test
test: fix jest timer warning
2019-06-24 13:21:30 +08:00
afc163
ec7c99998a 🎬 fix react-dnd depracated usage 2019-06-24 13:20:08 +08:00
afc163
8f861a35ac fix jest timer warning 2019-06-24 12:23:17 +08:00
afc163
3eb713071d 3.19.8 2019-06-24 12:02:51 +08:00
偏右
f6121aa1cc Merge pull request #17249 from ant-design/revert-form-type
fix: revert `unknown` to `any`
2019-06-24 12:02:19 +08:00
afc163
3f8589cff3 chore: code style 2019-06-24 11:49:55 +08:00
afc163
c0bd255822 lock eslint-plugin-react for yannickcr/eslint-plugin-react#2319 2019-06-24 11:46:02 +08:00
afc163
57c28def68 revert unknown to any 2019-06-24 11:29:58 +08:00
afc163
936fea5769 🐛 Fix onRow return types
https://github.com/ant-design/ant-design/issues/17245#issuecomment-504807714
2019-06-24 11:13:55 +08:00
偏右
d5be7ce2e0 Update FUNDING.yml 2019-06-23 16:45:57 +08:00
afc163
4c84c41da0 🐛 Revert Form type unknown to any
close #17245
2019-06-23 15:27:06 +08:00
偏右
4875d2d39b Merge pull request #17236 from ant-design/upgrade-eslint
chore: upgrade eslint to 6.0
2019-06-22 15:46:48 +08:00
偏右
40a38ff91a Merge pull request #17239 from babbarankit/patch-2
Update SubMenu.tsx
2019-06-22 15:46:30 +08:00
偏右
71f3e3683c Merge pull request #17237 from babbarankit/patch-1
Tabs props missing prop
2019-06-22 15:46:23 +08:00
Ankit Babbar
0bb7f60708 Update SubMenu.tsx
popupOffset prop is missing in SubMenu
2019-06-22 12:23:51 +05:30
Ankit Babbar
26e427ca7d Tabs props missing prop
Added Missing prop 'destroyInactiveTabPane' in Tabs
2019-06-22 12:19:15 +05:30
afc163
13deeb2ab9 🆙 upgrade eslint to 6.0 2019-06-22 13:24:34 +08:00
偏右
a3fb511df6 Merge pull request #17227 from ant-design/changelog-3.19.7
docs: release 3.19.7
2019-06-21 23:16:48 +08:00
afc163
af090dc621 📝 3.19.6 English changelog 2019-06-21 23:06:54 +08:00
afc163
9b6fbfcb36 docs: upgrade about npm create umi 2019-06-21 22:56:45 +08:00
afc163
6b83865a50 📝 Release 3.19.7 2019-06-21 22:56:45 +08:00
偏右
606ed90de1 Merge pull request #17229 from ant-design/adjust-modal-padding-bottom
fix: Modal 24px bottom area not trigger mask click
2019-06-21 22:42:09 +08:00
偏右
0de4bd899d Merge pull request #17228 from ant-design/fix-sider-z-index
fix: Layout sider trigger z-index too low
2019-06-21 22:41:58 +08:00
偏右
ce04af83da Merge pull request #17063 from wonderjar/master
fix: prop headerRender should be optional for component Calendar
2019-06-21 18:02:28 +08:00
afc163
ad39a9450d 🐛 Fix Layout.Sider‘s zero-width trigger z-index
close #17160
2019-06-21 17:57:40 +08:00
afc163
0ea94b9d68 🐛 Fix Modal 24px bottom area not trigger mask click
close #17226
2019-06-21 17:52:28 +08:00
偏右
a4d7593ef2 Merge pull request #17120 from Zzzen/master
refactor: eliminate `any` type in exported interfaces.#14044
2019-06-21 17:38:56 +08:00
偏右
0a7432ee75 Merge pull request #17209 from ant-design/pageheader-show-all-breadcrumb
fix: Fix single Breadcrumb not show on PageHeader
2019-06-21 17:38:26 +08:00
afc163
6ffef83939 fix polyfill.min.js 2019-06-21 17:11:00 +08:00
偏右
5c909e3413 Merge pull request #17223 from ant-design/fix-table-scrollbar-in-IE
fix: Table scrollbar style in IE
2019-06-21 15:39:43 +08:00
afc163
bdfd877f3a 🐛 Fix a Table scrollbar style in IE
when customize line-height of empty table

close #17175
2019-06-21 15:20:01 +08:00
Andrew Shini
07c85ea21f fix: Clone only valid react child elements (#17207)
* Clone child only if it exists

child can be void | null | boolean | string | number | element.

* Add test
2019-06-21 13:49:01 +08:00
afc163
d65fdac58a use polyfill service 2019-06-21 12:29:05 +08:00
偏右
dac5201c80 Merge pull request #17215 from ant-design/docs
docs: update progress docs to mark only line support active
2019-06-21 11:31:41 +08:00
zombiej
e08534e6c4 update docs 2019-06-21 11:08:35 +08:00
偏右
0a8a8a6974 Merge pull request #17211 from ant-design/docs-button
docs: add documentation about button autoInsertSpaceInButton
2019-06-21 10:44:22 +08:00
afc163
b1d8425384 📝 document about autoInsertSpaceInButton 2019-06-21 00:31:48 +08:00
afc163
c3d3b10cab 📝 Improve docs about tree shaking 2019-06-21 00:16:25 +08:00
陈帅
7e548e4de7 add new test
when breadcrumb lenght=1, pageHeader should have breadcrumb
2019-06-20 19:45:13 +08:00
陈帅
ee21b1c210 fix #17046, breadcrumbs will always show 2019-06-20 19:31:59 +08:00
zombieJ
e2732eea1e add fix css (#17198) 2019-06-20 15:32:53 +08:00
zombiej
817df6f295 remove text-mask from recommand 2019-06-20 12:02:13 +08:00
偏右
0dd2389737 Merge pull request #17191 from yoyo837/update-table-resizable-demo
使操纵杆右侧半边也可以操作
2019-06-20 11:57:49 +08:00
yoyo837
f0ed471709 使操纵杆右侧半边也可以操作 2019-06-20 11:45:28 +08:00
偏右
5203d24d04 Merge pull request #17177 from wtzeng1/master
fix(Doc): remove useless option in API Doc for row-selection-custom Table
2019-06-19 22:15:23 +08:00
wtzeng1
ee1b5975e4 fix(Doc): remove useless option in API Doc for Table component 2019-06-19 21:34:01 +08:00
偏右
a30dd26052 🆙 upgrade rc-progress to 2.4.0 (#17168) 2019-06-19 19:41:37 +08:00
陈帅
82b85709be style: run lint-fix (#17172) 2019-06-19 19:09:08 +08:00
陈帅
d0799fb983 Merge branch 'master' into feature 2019-06-19 18:16:22 +08:00
zombieJ
5f816ba41a docs: 3.19.6 changelog (#17166)
* 3.19.6 changelog

* update
2019-06-19 12:16:54 +08:00
zombieJ
dc4102d879 reset line-height of TextArea & Picker (#17165) 2019-06-19 11:23:21 +08:00
偏右
a676f37505 Merge pull request #17161 from shaderzak/patch-1
Fix English translation
2019-06-18 22:18:20 +08:00
Sevak
baac048eeb Fix English translation 2019-06-18 13:08:36 +02:00
zombieJ
b77dbd331d fix: Table crash when filter dynamic change (#17141)
* update test case

* fix: Table change filter should not crash

* rm focus test
2019-06-17 18:50:38 +08:00
zombieJ
ebdc7041f7 fix: Nest Card extra position not correct (#17140)
* fix: Nest Card extra position not correct

* add missing mark
2019-06-17 18:07:22 +08:00
zombieJ
cfe4de58d6 update modal doc (#17137) 2019-06-17 15:57:48 +08:00
zombieJ
7f43ac564b update changelog (#17133) 2019-06-17 13:47:31 +08:00
zombieJ
b4025176d1 fix modal not support configProvider (#17132) 2019-06-17 12:47:31 +08:00
zombieJ
dc1572cff1 fix style (#17126) 2019-06-17 12:24:08 +08:00
zombieJ
e0bfcab869 chore: Fix react-dnd CI (#17130)
* adjust jest ignore

* add node test

* update es
2019-06-17 12:00:52 +08:00
Zzzen
f1ee189bd2 eliminate any type in exported interfaces.#14044 2019-06-16 20:51:47 +08:00
陈帅
ae26f76d94 fix ts lint warning (#17049) 2019-06-16 20:30:59 +08:00
afc163
3b9b9870d0 🆙 upgrade devDeps 2019-06-16 18:43:34 +08:00
偏右
30ac0a0bcd Merge pull request #17118 from ant-design/fix-lgtm-errors
refactor: Fix lgtm errors
2019-06-16 18:39:46 +08:00
afc163
e3565ac110 🚨 Fix lgtm errors
https://lgtm.com/projects/g/ant-design/ant-design/alerts/?mode=list
2019-06-16 17:41:25 +08:00
偏右
6c60092d95 Merge pull request #17119 from ant-design/upgrade-eslint-config-prettier
chore: upgrade eslint-config-prettier version
2019-06-16 17:40:33 +08:00
afc163
1c46e3193f 🆙 upgrade eslint-config-prettier version 2019-06-16 17:27:09 +08:00
Meck Zhu
6ac0ed79c2 Bump 3.19.4 2019-06-16 16:38:40 +08:00
Wei Zhu
7b50f19379 Add 3.19.4 changelog (#17115)
Add 3.19.4 changelog
2019-06-16 16:27:48 +08:00
Meck Zhu
d10f550bdb Add 3.19.4 changelog 2019-06-16 16:26:24 +08:00
afc163
8efc0ff5e1 🚨 Fix eslint 2019-06-15 23:51:30 +08:00
偏右
cb4a86ae29 Merge pull request #17114 from ant-design/fix17109
fix: PageHeader back icon pointers is not always clickable problem
2019-06-15 22:06:13 +08:00
偏右
5296623814 Merge pull request #17113 from ant-design/fix-divider-style
style: Make Divider style customization easier
2019-06-15 22:06:10 +08:00
陈帅
4373ef1463 fix #17109 ,fix pointers is not always a clickable problem 2019-06-15 21:50:01 +08:00
afc163
7c2846b458 💄 Make Divider style customization easier
close #17084
2019-06-15 20:28:43 +08:00
偏右
e8e81e2c66 Merge pull request #17108 from Enfield1/fix_ru_locale
fix: Add missing russian translations
2019-06-15 12:26:30 +08:00
Dmitry Tikhomirov
6a5f2e9917 Add missing russian translations 2019-06-14 15:06:46 +03:00
偏右
6a10951f26 Merge pull request #17099 from ant-design/improve-time-picker-accessibility
feat: Improve time picker accessibility
2019-06-14 16:37:35 +08:00
偏右
8ac202401e Merge branch 'feature' into improve-time-picker-accessibility 2019-06-14 16:37:16 +08:00
偏右
f5382c1cee Merge pull request #17103 from ant-design/feature-to-resolve-conflict-with-master
Feature to resolve conflict with master
2019-06-14 16:33:56 +08:00
afc163
be3226b757 Merge master into feature 2019-06-14 16:20:29 +08:00
偏右
65eb713fe8 Merge pull request #17100 from ant-design/fix-input-align
fix: Input not align with other components in Chrome
2019-06-14 15:45:26 +08:00
afc163
3606d15c2f 🐛 Fix Input not align with other components in Chrome
close #17082
2019-06-14 15:28:49 +08:00
afc163
a62a3e95d3 ⌨️ Improve TimePicker accessibility 2019-06-14 14:51:28 +08:00
偏右
edcd2caada Merge pull request #17098 from JohnsenZhou/patch-1
Update index.zh-CN.md
2019-06-14 14:30:28 +08:00
Johnsen
2efa79b4eb Update index.zh-CN.md
add getPopupContainer props
2019-06-14 14:13:06 +08:00
偏右
df23f0d1b5 Merge pull request #17092 from 3b3ziz/master
fix: Fixing date formats for Arabic-Egypt locale
2019-06-14 10:39:34 +08:00
Ahmad Abdelaziz
482491ae87 Fixing date formats for Arabic-Egypt locale 2019-06-13 18:03:23 +02:00
Michael Adams
a85b449d6f fix: remove margin for collapse arrow (#17009)
* remove margin for collapse arrow

* change translateY to -21px in collapse

* remove line-height to center arrow
2019-06-13 11:29:20 +08:00
偏右
73ffe06178 Merge pull request #17070 from maximest-pierre/Fix/grammar-message-other
Fix grammar on message documentation
2019-06-13 10:12:03 +08:00
maximest-pierre
67b28c36f0 Fix grammar on message documentation 2019-06-12 14:42:48 -04:00
偏右
1a34dcde8d Merge pull request #17066 from ant-design/optimize-table-style
style: optimize bordered table header scrollbar style
2019-06-12 19:56:12 +08:00
afc163
6d2ad5c324 💄 optimize bordered table header scrollbar style
continue after #17065
2019-06-12 19:39:28 +08:00
偏右
1f6b86f37a Merge pull request #17065 from ant-design/fix-table-scrollbar-border
style: adjust bordered table header scrollbar style
2019-06-12 18:15:35 +08:00
afc163
52905e1b39 💄 adjust bordered table header scrollbar style 2019-06-12 18:12:11 +08:00
jiang.an
180ed017f8 fix: prop headerRender should be optional for component Calendar 2019-06-12 17:46:21 +08:00
偏右
798d050352 Merge pull request #17057 from cnlon/fix/button-docs
fix: add link type to Button's doc
2019-06-12 14:24:05 +08:00
lon
3c2c7c60c5 fix: add link button to basic demo of button docs 2019-06-12 13:58:13 +08:00
zombieJ
4911bee059 use calc to fix tree line (#17055) 2019-06-12 12:20:32 +08:00
afc163
b585751e49 update snapshots 2019-06-12 11:44:44 +08:00
偏右
ac815621b1 Merge pull request #17045 from ant-design/fix-doc-image
docs: fix image in feedback spec documentation
2019-06-11 16:28:52 +08:00
afc163
e88e2d1862 📝 Fix image in feedback spec documentation 2019-06-11 16:27:17 +08:00
afc163
9b3c0d3fa5 update snapshots 2019-06-11 14:45:04 +08:00
偏右
5e297a3d38 Merge pull request #17042 from SamKirkland/AutoComplete-translate
chore: Translate remainder of Typography & AutoComplete
2019-06-11 13:32:50 +08:00
偏右
2818ddec41 Merge pull request #17041 from SamKirkland/comment-component-font-size
style: less variables for comment component font-size
2019-06-11 13:32:18 +08:00
Sam Kirkland
740eb7fda9 Update uncertain-category.md 2019-06-11 00:08:52 -05:00
Sam Kirkland
219636f592 Update certain-category.md 2019-06-11 00:07:58 -05:00
Sam Kirkland
7b3f0554bc Update default.less 2019-06-10 23:58:42 -05:00
Sam Kirkland
594555087f Update index.less 2019-06-10 23:57:27 -05:00
偏右
1b20b3b49b Merge pull request #17039 from ant-design/style-submenu-selected
style: Keep submenu selected style
2019-06-11 12:18:46 +08:00
afc163
20e6bed8a1 💄 Keep submenu selected style 2019-06-11 12:00:52 +08:00
zombieJ
61d3041a07 update calendar (#17038) 2019-06-11 11:04:29 +08:00
偏右
ef7f1a92f3 Merge pull request #17031 from alxkosov/collapse_panel_customize_border-radius
feat: Border-radius customization for Collapse Panel
2019-06-10 21:07:06 +08:00
Alexander.Kosov
51b9c4698c Border-radius customization for Collapse Panel 2019-06-10 14:32:10 +03:00
偏右
1fe768ecda Merge pull request #17028 from ant-design/dependabot/npm_and_yarn/majo-tw-0.8.0
⬆️ Update majo requirement from ^0.7.1 to ^0.8.0
2019-06-10 19:09:01 +08:00
偏右
77d8bc0613 Merge pull request #17029 from ant-design/fix-page-header-extra-style
fix(PageHeader): abnormal margin issue of PageHeader extra
2019-06-10 19:08:04 +08:00
afc163
4aced89c67 🐛 Fix margin issue of PageHeader extra continually 2019-06-10 19:06:24 +08:00
dependabot-preview[bot]
28eea42a0b ⬆️ Update majo requirement from ^0.7.1 to ^0.8.0
Updates the requirements on [majo](https://github.com/egoist/majo) to permit the latest version.
- [Release notes](https://github.com/egoist/majo/releases)
- [Commits](https://github.com/egoist/majo/compare/v0.7.1...v0.8.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-06-10 10:53:56 +00:00
偏右
1340ba8261 Merge pull request #17026 from ant-design/fix-page-header-extra-style
fix(PageHeader): abnormal margin issue of PageHeader extra
2019-06-10 18:40:41 +08:00
afc163
16ed7273dd 🐛 Fix margin issue of PageHeader extra
close #17025
2019-06-10 18:22:36 +08:00
zombieJ
e67270cd59 fix: Table with sort should reset to first page (#17020)
* sort reset pagination

* add test case
2019-06-10 11:59:46 +08:00
ikobe
8c417e6cbf chore: update package.json 2019-06-10 10:12:11 +08:00
啸生
b0b533a44d docs: 3.19.3 change-log (#16998) 2019-06-10 10:04:41 +08:00
偏右
05d84555d8 Update colors.zh-CN.md 2019-06-08 18:34:16 +08:00
偏右
393f4b4a21 Fix typo 2019-06-08 18:33:35 +08:00
偏右
5168a5d23c Merge pull request #16996 from alxkosov/add_vars_to_customization_dropdown
feat: added three variables to allow customization of the dropdown list
2019-06-08 15:01:42 +08:00
Alexander.Kosov
b075b9eedd added three variables to allow customization of the dropdown list 2019-06-07 15:04:59 +03:00
偏右
28d822ead8 Merge pull request #17005 from ant-design/fix-snapshot
fix: Fix test snapshots
2019-06-07 18:20:02 +08:00
afc163
e5e22e2f9a Fix test snapshots 2019-06-07 18:18:29 +08:00
偏右
928e3e9a8c Merge pull request #16741 from gadzillllla/patch-1
add missing prop in documentation
2019-06-07 18:07:23 +08:00
偏右
6e5d79cb4e Merge pull request #16961 from zjffun/patch-2
docs: Add width attr to the table's grouping columns demo
2019-06-07 18:06:19 +08:00
偏右
77d1563a64 Merge pull request #17002 from morellan/fix-es-locale
Add missing spanish translations
2019-06-07 18:05:26 +08:00
偏右
c8a9ca62e3 Merge pull request #16985 from lhyt/feature_disabled_prop_popconfirm
feat(popconfirm): add disabled in popconfirm
2019-06-07 18:04:44 +08:00
偏右
5174ac7395 Merge pull request #16965 from ant-design/darkTheme
Dark theme
2019-06-07 18:04:38 +08:00
偏右
0d6c819b36 Merge pull request #17000 from alxkosov/Add_variable_to_stylize_background_of_input_in_error_state
Add attribute background to stylize the one of the input in the validation
2019-06-07 18:03:53 +08:00
偏右
e46888247d Merge pull request #17003 from Jarvis1010/master
Export TextProps and update english in error
2019-06-07 18:02:01 +08:00
Jarvis1010
09435b21cc Export TextProps and update english in error 2019-06-06 22:30:47 -06:00
Matias Orellana
758f7b0e3e Add missing spanish translations 2019-06-06 17:58:09 -04:00
Alexander.Kosov
97f2b7b0d9 Add a variable to stylize the background of the input in the validation error state 2019-06-06 14:18:31 +03:00
偏右
c9205f916c Merge pull request #16988 from ant-design/fix-divider
fix: Divider `orientation="center"` style
2019-06-06 10:43:39 +08:00
lhyt
c83d8706b3 test: update snapshots 2019-06-06 01:47:20 +08:00
lhyt
b2f0a97a2c test: update snapshots 2019-06-06 01:02:40 +08:00
afc163
e2d119dd0e 🐛 Fix Divider orientation="center" style
close #16987
2019-06-06 00:40:30 +08:00
偏右
88737c0573 Merge pull request #16984 from ant-design/faq-about-date-picker-mode
docs: Add FAQ for DatePicker/RangePicker mode prop usage
2019-06-05 22:32:37 +08:00
afc163
014d32001c fix packtracker exclude_assets 2019-06-05 22:18:45 +08:00
afc163
6295cb4597 📝 Add FAQ for DatePicker/RangePicker mode prop usage 2019-06-05 22:03:17 +08:00
afc163
6e80b275a5 Fix ci 2019-06-05 21:50:51 +08:00
偏右
9991d9a9c0 Merge pull request #16977 from ztplz/auto
Suppress autoprefixer warning
2019-06-05 21:48:50 +08:00
lhyt
10d4a9f955 feat(popconfirm): add disabled in popconfirm 2019-06-05 20:33:00 +08:00
陈帅
0cf07667a5 less variable should be extended 2019-06-05 19:13:25 +08:00
陈帅
6dd6e6512a add new less var 2019-06-05 19:13:25 +08:00
ztplz
d14768d12c Suppress autoprefixer warning 2019-06-05 17:10:04 +08:00
afc163
2db4081f67 🔧 ignore other files for packtracker 2019-06-05 15:47:24 +08:00
偏右
994d940d82 Merge pull request #16971 from ant-design/upgrade-deps
chore:  🆙 upgrade all deps to latest version
2019-06-05 15:03:52 +08:00
afc163
14dc252b04 🆙 fix for typescript@3.5 2019-06-05 14:41:36 +08:00
afc163
e93ceb622e 🆙 upgrade all deps to latest version 2019-06-05 14:41:36 +08:00
偏右
f59c3a017c Merge pull request #16973 from ant-design/upgrade-snaphost
chore: update snapshots
2019-06-05 14:40:49 +08:00
afc163
e8ab26b641 update snapshots 2019-06-05 14:39:19 +08:00
偏右
c6e56e642d Merge pull request #16934 from ant-design/fix-table-scroll-bar
fix: abnormal scrollbar in Chrome
2019-06-05 11:18:27 +08:00
zombieJ
3547887e75 fix: Table miss border-raidus in Firefox (#16957)
* Revert "Merge pull request #16174 from ant-design/fix-table-chrome"

This reverts commit 686c1fc346, reversing
changes made to 924afc2706.

* firefox only

* add comment
2019-06-05 10:17:41 +08:00
zjf
9c1691b8a3 rebase 2019-06-04 23:41:32 +08:00
偏右
e873cd33af Merge pull request #16958 from ant-design/tweak-autocomplete-style
💄 use marginRight remind developer
2019-06-04 20:38:04 +08:00
ycjcl868
fa391b3ca3 fix: test ci 2019-06-04 19:59:39 +08:00
ycjcl868
ff680a5376 💄 use marginRight remind developer 2019-06-04 19:46:01 +08:00
偏右
4a793846f5 Merge pull request #15224 from long-zhuge/bugfix
Add fault-tolerant processing for rowSelection.getCheckboxProps
2019-06-04 18:59:57 +08:00
偏右
9fdc408cd0 Merge branch 'master' into bugfix 2019-06-04 18:59:20 +08:00
afc163
7a484dda71 📝 fix size toc overflow style 2019-06-04 18:53:54 +08:00
偏右
d9a5ee06eb Merge pull request #16950 from ant-design/fix-fixed-table-extra-scroll-bar
fix(Table): Hide header extra scrollbar control
2019-06-04 17:10:07 +08:00
afc163
f1c43c16b7 update snapshots 2019-06-04 16:58:00 +08:00
afc163
b1f81045c6 💄 Fix scrollbar border bottom 2019-06-04 16:18:25 +08:00
afc163
1d1339e302 update snapshots 2019-06-04 16:11:01 +08:00
afc163
553487e006 🐛 Fix Table header extra scrollbar control
close #4637
close #14211

https://github.com/react-component/table/pull/333
2019-06-04 15:52:32 +08:00
偏右
c2b1384377 Merge pull request #16885 from haianweifeng/fix-breadcrumb
fix(Breadcrumb): when route.children exist, the path of children is wrong
2019-06-03 20:21:30 +08:00
afc163
eb063d58fa 🐛 Fix abnormal scrollbar in Chrome
when rowSelection and title work together

close #16912
2019-06-03 16:46:31 +08:00
haianweifeng
c6ea0aa3d7 Update Breadcrumb.tsx 2019-06-03 16:36:07 +08:00
偏右
6d2a5df1e6 fix: Breadcrumb validateDOMNesting warning (#16929)
* 🐛 Fix Breadcrumb validateDOMNesting warning

```
Warning: validateDOMNesting(...): <a> cannot appear as a descendant of <a>.
    in a (created by Context.Consumer)
    in span (created by Context.Consumer)
    in a (created by Context.Consumer)
    in Trigger (created by Dropdown)
    in Dropdown (created by Context.Consumer)
    in Dropdown (created by Context.Consumer)
    in span (created by Context.Consumer)
    in BreadcrumbItem (created by Context.Consumer)
    in div (created by Context.Consumer)
    in Breadcrumb (created by TestBreadcrumb)
    in TestBreadcrumb
```

*  update snapshots
2019-06-03 16:13:15 +08:00
zombieJ
e55a254589 update version (#16928) 2019-06-03 15:39:31 +08:00
zombieJ
a6ef4ca6a2 fix: Hide Spinner of InputNumber when type is number (#16926)
* fix: Hide Spinner of InputNumber when type is number

* Firefox not obedient
2019-06-03 13:44:27 +08:00
jljsj
7382e41b17 add keyboard to API, rm propTypes and use instanceof KeyboardEvent 2019-06-03 11:50:32 +08:00
zombieJ
10fec945e5 fix: Transfer render Empty when customize without data (#16925) 2019-06-03 11:44:26 +08:00
alxkosov
fb6d629e7b Added 2 variables to flexibly control the background of the table cells (#16843) 2019-06-03 10:05:37 +08:00
偏右
8b1985bc9b Merge pull request #16921 from ant-design/packtracker
test: Add packtracker
2019-06-02 20:23:01 +08:00
偏右
5a7b38b1d2 Merge pull request #16922 from ztplz/type
Remove useless type
2019-06-02 20:20:33 +08:00
ztplz
bd0479b30b Remove useless type 2019-06-02 20:16:02 +08:00
afc163
ce4b71c71f 🔧 Add packtracker 2019-06-02 20:09:27 +08:00
偏右
18d3dee71c Merge pull request #16851 from ant-design/fix/uploadFile-type-again
fix: fix type of action and RcFile
2019-06-02 19:49:37 +08:00
偏右
7c0fd87b2b Merge pull request #16918 from oakslab/master
fix: cascader unable to enter space during search #16871
2019-06-02 19:41:04 +08:00
Juraj Carnogursky
24ee1634f0 🐛 fixes #16871 Cascader - Space during search 2019-06-01 23:40:49 +02:00
ycjcl868
86bc28161c release: 3.19.2 2019-06-01 23:59:15 +08:00
信鑫-King
0489ad7dea 3.19.2 changelog doc (#16917)
3.19.2 changelog doc
2019-06-01 23:29:00 +08:00
ycjcl868
fd45cee489 📝 changelog 2019-06-01 23:27:54 +08:00
信鑫-King
9ec41b1cb8 Merge pull request #16916 from ant-design/doc-changelog
3.19.2 changelog
2019-06-01 23:25:26 +08:00
信鑫-King
438df8367d 📝 changelog 2019-06-01 23:24:45 +08:00
信鑫-King
d795bf4105 doc: changelog 3.19.2 (#16915)
doc: changelog 3.19.2
2019-06-01 23:22:59 +08:00
ycjcl868
f92b77705c doc: changelog 2019-06-01 22:51:27 +08:00
ycjcl868
1ffa7ba4f9 doc: format 2019-06-01 15:45:05 +08:00
ycjcl868
0dd2f5a533 doc: changelog 2019-06-01 15:42:07 +08:00
ycjcl868
522c817cd2 doc: changelog 2019-06-01 15:34:56 +08:00
ycjcl868
96ca08bd81 doc: changelog 2019-06-01 15:34:08 +08:00
ycjcl868
4eecc68d9d doc: changelog 2019-06-01 15:33:42 +08:00
ycjcl868
b6f755095c tweak: order changelog 2019-06-01 15:32:34 +08:00
ycjcl868
87a2d9f7c0 doc: changelog 2019-06-01 15:31:28 +08:00
ycjcl868
4c07822eab doc: changelog 3.19.2 2019-06-01 15:23:13 +08:00
偏右
19ae35f21a Merge pull request #16908 from ant-design/dependabot/npm_and_yarn/ansi-styles-tw-4.0.0
Update ansi-styles requirement from ^3.2.1 to ^4.0.0
2019-05-31 18:39:28 +08:00
dependabot-preview[bot]
3806d81f83 Update ansi-styles requirement from ^3.2.1 to ^4.0.0
Updates the requirements on [ansi-styles](https://github.com/chalk/ansi-styles) to permit the latest version.
- [Release notes](https://github.com/chalk/ansi-styles/releases)
- [Commits](https://github.com/chalk/ansi-styles/compare/v3.2.1...v4.0.0)
2019-05-31 09:14:21 +00:00
jljsj
9ec4aaa9f4 add maskClosable is false ESC close 2019-05-31 15:33:58 +08:00
zombieJ
364e1624ea add antd pro 4.0 badge (#16894) 2019-05-31 10:48:00 +08:00
偏右
c6f991d5af Merge pull request #16890 from MrHeer/fix-#16856
fix: use @error-color & @warning-color instead of @text-color-danger & @text-color-warning #16856
2019-05-31 00:02:41 +08:00
haianweifeng
eee76be930 fix Breadcrumb.tsx
对于子路径是否为空进行判断
2019-05-30 22:59:01 +08:00
MrHeer
239c472c38 fix: use @error-color & @warning-color instead of @text-color-danger & @text-color-warning #16856 2019-05-30 19:21:08 +08:00
haianweifeng
1fac84b222 fix Breadcrumb.tsx
getPath() 参数赋默认值
2019-05-30 17:28:19 +08:00
haianweifeng
3122f3b86b 修复Breadcrumb.tsx 中处理route.children 路径不对
<Menu.Item key={child.breadcrumbName || child.path}>
                {itemRender(child, params, routes, [...paths, this.getPath(child.path, params)])}
</Menu.Item>
itemRender(...args) 中路径应该到拼接当前child.path
2019-05-30 17:06:59 +08:00
偏右
96f172fcc3 Merge pull request #16877 from ant-design/master
chore: feature merge master branch
2019-05-30 14:07:06 +08:00
偏右
abb8692b59 Merge pull request #16869 from aiham/fix/remove-unused-modal-button-disabled-props
fix: remove invalid Modal prop defaults
2019-05-30 11:02:33 +08:00
Aiham Hammami
e3638f2806 Remove okButtonDisabled/cancelButtonDisabled never used prop defs
- Also remove them from the CHANGELOG because they were never actually
implemented, the prop was renamed to okButtonProps/cancelButtonProps
within PR #10955 but these prop defs were left behind and ended up
incorrectly included in the CHANGELOG.
2019-05-29 12:58:29 -04:00
偏右
6e72441085 Merge pull request #16863 from ant-design/dependabot/npm_and_yarn/xhr2-tw-0.2.0
Update xhr2 requirement from ^0.1.4 to ^0.2.0
2019-05-29 17:35:28 +08:00
dependabot-preview[bot]
3344921723 Update xhr2 requirement from ^0.1.4 to ^0.2.0
Updates the requirements on [xhr2](https://github.com/pwnall/node-xhr2) to permit the latest version.
- [Release notes](https://github.com/pwnall/node-xhr2/releases)
- [Commits](https://github.com/pwnall/node-xhr2/compare/v0.1.4...0.2.0)
2019-05-29 09:20:57 +00:00
DiamondYuan
c7bc6b743c fix: fix type of action in UploadProps 2019-05-29 13:53:33 +08:00
DiamondYuan
fa5d5e0a96 fix: fix type of RcFile 2019-05-29 13:52:35 +08:00
DiamondYuan
81da6e90d4 fix: add webkitRelativePath (#16850) 2019-05-29 10:56:04 +08:00
偏右
4f234f5b65 Merge pull request #16846 from JonathanLee-LX/master
add semicolon
2019-05-29 10:30:18 +08:00
芝华塔尼欧
0204a22515 Merge branch 'master' into master 2019-05-29 09:31:51 +08:00
Jonathan Lee
45e2274e25 add semicolon 2019-05-29 00:09:38 +08:00
芝华塔尼欧
eb6d846d55 add onChange prop type definition to Steps (#16845) 2019-05-28 23:28:57 +08:00
Jonathan Lee
27691d49f0 add onChange prop type definition to Steps 2019-05-28 23:03:21 +08:00
偏右
d39daf9750 Merge pull request #16835 from ant-design/export-TypographyProps
chore: export TypographyProps
2019-05-28 16:29:13 +08:00
afc163
5a7434c5d6 export TypographyProps
close #15190
2019-05-28 16:06:10 +08:00
偏右
7460088e9b Merge pull request #16829 from levkovich2806/patch-1
Update index.en-US.md
2019-05-27 23:51:21 +08:00
Sergey Levkovich
7304daf4fa Update index.en-US.md 2019-05-27 18:45:47 +03:00
偏右
c77b8ed817 Merge pull request #16828 from ant-design/improve-demo-code-style
chore: 💄 Optimize examples code style
2019-05-27 22:28:49 +08:00
afc163
13379aa0d8 💄 Optimize examples code style 2019-05-27 22:04:17 +08:00
偏右
85303f57d6 Merge pull request #16827 from ant-design/fix/menu-ts
typescript: adding forceSubmenuRender as MenuProps
2019-05-27 21:34:27 +08:00
picodoth
620755d893 typescript: adding forceSubmenuRender as MenuProps 2019-05-27 21:30:43 +08:00
zombieJ
93887e1380 chore: Add warning if use inlineCollapsed under Sider (#16826) 2019-05-27 20:53:43 +08:00
Jason Chung
9b05885363 fix(Transfer): set state on an unmounted component (#16822) 2019-05-27 20:43:29 +08:00
偏右
ba95f0ef09 Merge pull request #16824 from ant-design/add-some-test-cases
test: Add more test cases
2019-05-27 20:38:01 +08:00
偏右
eb9be9ef56 Update util.test.js 2019-05-27 20:24:53 +08:00
zombieJ
c386d49b63 fix: Tabs card vertical support scroll (#16825) 2019-05-27 19:57:14 +08:00
afc163
17ab75b8d9 Add test case for TransButton 2019-05-27 19:13:49 +08:00
zombieJ
35d23edd01 docs: 3.19.1 change-log (#16820)
* update changelog

* add missing one
2019-05-27 17:34:48 +08:00
偏右
79a6b70e6a 🐛 Fix typo name icons, add warning and update docs (#16818)
close #13007
close #16810

deps: ant-design/ant-design-icons#63
2019-05-27 17:04:02 +08:00
ztplz
d6c926d536 Fix typescript compile error (#16816) 2019-05-27 17:03:39 +08:00
zombieJ
29ec272635 fix: Descriptions warning should work as expect (#16819)
* fix warning

* add MockDate
2019-05-27 16:41:56 +08:00
zombieJ
6853402e00 fix: Select ts define (#16817) 2019-05-27 16:17:43 +08:00
zombieJ
008136ece1 fix: Tooltip not hidden when menu is in control mode (#16812) 2019-05-27 15:22:26 +08:00
zombieJ
c5aaeb80fc fix: mentions ts definition update (#16814)
* fix mentions ts definition

* adjust logic of Mentions
2019-05-27 14:43:15 +08:00
zombieJ
b5f2ea771d docs: 3.19.0 changelog (#16796)
* add changelog

* add #16535

* update

* add missing changelog

* add #16801 changelog

* adjust description

* more desc

* more info

* change logo
2019-05-26 14:43:39 +08:00
偏右
81e69370b4 💄 Correct Statistic font color (#16801)
close #15514
2019-05-26 14:23:48 +08:00
偏右
fecff0dc12 Merge pull request #16799 from attacking/master
给上传组件添加disabled状态的cursor样式
2019-05-26 14:00:03 +08:00
zombieJ
a3e19cecba Merge pull request #16798 from ant-design/feature-merge-master
chore: Feature merge master
2019-05-26 13:57:48 +08:00
偏右
60ee01f37e Merge pull request #16797 from ant-design/fix-input-number-parser-type
fix: Input parser type
2019-05-26 13:30:16 +08:00
zombiej
3493cc1406 merge master 2019-05-26 13:18:51 +08:00
ztplz
9793e30969 Fix the problem that the Slider's Tooltip is in the incorrect position when use modal (#16717)
* Fix incorrect position of tooltip when use slider

* Remove useless comment

* Reduce code

* Update

*  getTooltipPopupContainer default to body

* Public Slider's ref

* Add docs

* Update docs
2019-05-26 13:13:12 +08:00
mingyan.yu
1eb46ebaac feat: add disable style to upload component 2019-05-26 13:12:28 +08:00
Alberto Marchetti
28b14c9c0d Allow users to define where tooltips should appear on slider marks (#16641) 2019-05-26 13:11:13 +08:00
Harut
982871522b feat: New calendar apis, headerRender method (#16535)
* added new calendar api, renderHeader now we can customize calendar header

* fixed typo for tests

* error handling for renderHeader

* covering all cases with tests

* fixed tests and change console error to warning

* fixed feedbacks and code optimization

* cleanup callback function arguments

* removed unused changes

* fixed tests

* added extra classes

* fixed some comments

* tying to fix test for remote

* tying to fix test for remote in my local machin it works fine

* tying to fix test for remote in my local machin it works fine

* tying to fix test for remote in my local machin it works fine

* updated test snapshots

* fixed comment

* fixed linting

* fixed some texts

* added header for CN and added argument types

* removed extra row
2019-05-26 13:09:06 +08:00
afc163
35e235923e 🐛 Fix Input parser type
close #15226
2019-05-26 13:07:27 +08:00
zombieJ
6af96e748f Merge pull request #16794 from ant-design/feature
chore: Merge feature into master
2019-05-26 12:01:30 +08:00
zombieJ
0952696a8c Merge pull request #16793 from ant-design/master
chore: Merge master into feature
2019-05-26 11:03:35 +08:00
Marcel Jackwerth
56ff8728d2 Remove ancient prop types (#16705)
* Remove ancient Modal.propTypes.align and Progress.propTypes.size

* Remove linkRender and nameRender from Breadcrumb
2019-05-26 10:41:02 +08:00
damon.chen
f5f32f651f update getPopupContainer (#16778)
since select/index.d.ts requires getPopupContainer={triggerNode => HTMLElement} but parentNode actually is not HTMLElement.
2019-05-26 10:35:59 +08:00
Kimmo Saari
cd6f5ff3f1 Locale (feat #16752): Added Latvian localization (#16780) 2019-05-26 10:02:40 +08:00
zombieJ
155642d14a feat: Steps support clickable (#16773)
* support clickable

* update snapshot

* update desc
2019-05-25 21:01:21 +08:00
偏右
a0fd13486a Merge pull request #16786 from Veveue/master
fix: upload disabled remove
2019-05-25 18:48:44 +08:00
veveue
59e2f072c2 upload disabled remove 2019-05-25 16:34:38 +08:00
afc163
53ae3e887c 📝 Add opencollective link 2019-05-25 13:53:53 +08:00
偏右
a82296f4f0 Create FUNDING.yml 2019-05-25 13:48:31 +08:00
偏右
06c03c88c8 Merge pull request #16782 from ant-design/fix-cascader-custom-item
fix: 🐛 Fix Cascader displayRender not interactive
2019-05-24 19:05:50 +08:00
afc163
c102ef7551 🐛 Fix Cascader displayRender not interactive
close #16738 and #10433

this bug had been fixed in bc4143f before, but it was broken by #12407

here we change another method to fix #12395
2019-05-24 18:49:36 +08:00
偏右
56f060252b Merge pull request #16777 from ant-design/fix-upload-demo
docs: update preview demo
2019-05-24 16:48:54 +08:00
zombiej
a9b5acfba9 update preview demo 2019-05-24 16:36:09 +08:00
偏右
2a3918e462 Merge pull request #16775 from ant-design/doc-antd-colors
docs: 📝 Add Programmatic Usage of antd colors
2019-05-24 16:31:44 +08:00
afc163
2a50ff3f4e 📝 Add Programmatic Usage of antd colors 2019-05-24 16:29:47 +08:00
zombieJ
5ab2783ff0 adjust Carousel children change goto Logic (#16756) 2019-05-23 23:08:03 +08:00
kpogodin
8263ea74fe Update index.en-US.md
add missing prop `showTitle` in documentation of Pagination
2019-05-22 19:38:24 +04:00
陈帅
3e32364dc0 New component Descriptions (#14645)
* add new component: DescriptionList

* add warning message

* docs: fix doc typo

* feat: implement the size attribute

* docs: fix doc typo

* refactor: use new name Descriptions

* test: snapshots updated

* feat: support react15

* style: fix code style warring

* style: better var name

* style: better code style

* style: merge css class

* feat: add responsive config

* fix: fix error title

* style: use @border-radius-base

* update snapshot

* feat: set default column

* test: add test script

* style: fix property defaultProps is useless error

* style: more robust code

* style: fix codereview warning

* style: fix review warning

* use responsiveObserveserve

* fix review warning

* bug: add childrenArray copy,prevent changes to incoming parameters

* fix dom error

* fix typo

* fix test

* don't use this

* snapshot updated

* prettier md

* remove descriptions md text

* new rendering method

* doc :add dot

* style: add right border
2019-05-22 23:22:09 +08:00
偏右
7884ea72f0 Merge pull request #16737 from ant-design/add-select-optionLabelProp-demo
docs: Add select optionLabelProp demo
2019-05-22 20:01:49 +08:00
afc163
42376c7d78 💄 fix emoji lint problem
https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/accessible-emoji.md
2019-05-22 19:41:59 +08:00
afc163
44bce091a2 update snapshots 2019-05-22 19:34:32 +08:00
afc163
3c22f86823 🎬 Add example for Select `optionLabelProp prop, #16709 2019-05-22 19:33:03 +08:00
偏右
633fd7142d Merge pull request #16694 from ant-design/upgrade-drawer
feat: support pressing ESC to close drawer
2019-05-22 16:59:09 +08:00
afc163
9d12c82f90 🆙 rc-drawer 1.9.3 2019-05-22 14:54:28 +08:00
偏右
b155395dce Merge pull request #16727 from ant-design/chore-doc
chore: some documents style
2019-05-22 14:45:12 +08:00
afc163
d772fada7b 📝 update customize theme 2019-05-22 14:44:18 +08:00
afc163
701ab7aab0 💄 chore some documents style 2019-05-22 12:36:43 +08:00
偏右
e2de625df6 Merge pull request #16718 from ant-design/renovate/logrocket-1.x
Update dependency logrocket to v1
2019-05-22 10:17:34 +08:00
Renovate Bot
5ccdfd9a62 Update dependency logrocket to v1 2019-05-21 16:25:07 +00:00
偏右
55bd82d6b9 Merge pull request #16716 from christophehurpeau/patch-2
fix: Upload prop action: fix typings
2019-05-22 00:13:24 +08:00
偏右
263a3e77dd Merge pull request #16570 from christophehurpeau/patch-1
fix: Upload prop onRemove: allow Promise as return type
2019-05-22 00:13:02 +08:00
Christophe Hurpeau
acaae5c850 Upload prop onRemove: fix action
d0cf0eecee (api)
2019-05-21 16:00:25 +02:00
偏右
8a91c94c4c Merge pull request #16712 from yoyo837/fix-16706
fix shouldComponentUpdate
2019-05-21 17:56:09 +08:00
yoyo837
d9ede1b4a5 fix shouldComponentUpdate 2019-05-21 17:51:53 +08:00
jljsj
d6bc4afe29 update config-provider test 2019-05-21 13:45:42 +08:00
jljsj
2a2209395f update drawer version 2019-05-21 12:05:13 +08:00
afc163
149f2c8172 💄 improve code style of Drawer 2019-05-21 11:29:01 +08:00
afc163
6eb197e8a2 update snapshots 2019-05-21 11:13:27 +08:00
afc163
9f21fe87c6 🆙 support ESC to close drawer 2019-05-21 11:03:25 +08:00
偏右
a1e593b7e7 Merge pull request #16684 from ant-design/fix-divider-style
fix horizontal divider style
2019-05-21 10:38:31 +08:00
偏右
f2c0593bf8 Merge pull request #16681 from gotjoshua/patch-1
Refined translation of St.Exupery quote
2019-05-21 10:05:55 +08:00
信鑫-King
4a05444d7b fix horizontal divider style 2019-05-20 23:25:32 +08:00
gotjoshua
b90cd5f4a2 Refined translation of St.Exupery quote
including link to quote site
2019-05-20 14:33:48 +01:00
偏右
2cc232aa15 Update renovate.json 2019-05-20 21:20:18 +08:00
偏右
d80af03aa5 Merge pull request #16675 from ant-design/renovate/configure
Configure Renovate
2019-05-20 19:28:11 +08:00
Renovate Bot
48c1d7806d Add renovate.json 2019-05-20 11:25:07 +00:00
诸岳
7a728daca9 Merge branch 'master' into feature 2019-05-20 13:29:34 +08:00
诸岳
6e7c5a95d2 Merge branch 'master' of github.com:ant-design/ant-design 2019-05-20 12:44:47 +08:00
诸岳
95044af3e3 Fix stylelint errors 2019-05-20 12:21:47 +08:00
zombiej
a4054bffe7 prettier md files 2019-05-20 11:46:00 +08:00
zombiej
eea2272f34 fix form typescript doc 2019-05-20 11:43:17 +08:00
诸岳
3048f672dd Bump 3.18.2 2019-05-20 11:25:13 +08:00
诸岳
e6586c914c docs: Add the changelog of 3.18.2 (#16666) 2019-05-20 11:23:53 +08:00
偏右
6e59e7767f Merge pull request #16646 from ant-design/fix-cascader-style
style: unified Cascader selected style with Select
2019-05-17 14:16:05 +08:00
afc163
1c918b0921 💄 unified Cascader selected style with Select 2019-05-17 14:09:56 +08:00
zombieJ
ecb2eb6ede feat: Add Mentions component (#16532)
* init

* first demo

* support empty

* add loading support

* add form sample

* update form sample

* omit value & defaultValue

* add 2 rest demo

* placement support

* update docs

* fix test

* update docs

* add test case

* fix lint

* follow textarea style

* update docs style
2019-05-17 12:05:03 +08:00
zombieJ
1517fcbbd6 fix space missing in button (#16551) 2019-05-17 12:04:47 +08:00
偏右
947e8e5d7d Merge pull request #16643 from ant-design/drawer-close-resume-animate
fix close animation
2019-05-17 11:35:53 +08:00
jiang
aff1dc2d3a Update drawer.less 2019-05-17 11:31:43 +08:00
jiang
1e406dbaf0 fix close animation 2019-05-17 11:27:17 +08:00
偏右
0c1b062c11 Merge pull request #16638 from eruca/master
fix: Tree.onDragEnter function parameter
2019-05-17 10:48:11 +08:00
偏右
e0f8aed814 == to ===
close #16640
2019-05-17 10:28:22 +08:00
ztplz
1872f51f94 Format (#16639) 2019-05-16 23:32:16 +08:00
ztplz
a3e8fe3dc8 Fix docs (#16637) 2019-05-16 23:20:45 +08:00
eruca
7cb4a11290 onDragEnter的函数定义缺少一个expandedKeys:string[]?
官方的示例里有expandedKeys, 可是typescript定义里没有,所以扩展一下
2019-05-16 22:33:15 +08:00
ztplz
9308f19314 Fix incorrect tree type (#16624) 2019-05-16 20:45:04 +08:00
zombieJ
c39ca23b7d update icons logic (#16623) 2019-05-16 17:47:50 +08:00
偏右
e0fae5dacf Merge pull request #16615 from gxvv/master
chore: Fix affix navigator lost current class after click hashtag anchor.
2019-05-16 16:33:52 +08:00
偏右
80f4bacf0d Merge pull request #16621 from zytjs/patch-2
Update index.zh-CN.md
2019-05-16 16:05:27 +08:00
zytjs
e5d64b14e6 Update index.zh-CN.md 2019-05-16 16:03:15 +08:00
偏右
40836c2440 Merge pull request #16616 from ant-design/fix-selectedRows-bug
fix: 🐞 Fix selectedRows missing when there is childrenColumnName in Table
2019-05-16 15:10:48 +08:00
偏右
5e3293cac8 Merge pull request #16619 from ant-design/optimize-pr-template
docs: Change changelog format in PR template
2019-05-16 15:10:21 +08:00
afc163
f320ba5cfe 📝 Change changelog template 2019-05-16 15:09:17 +08:00
afc163
c4128c0d14 🐛 Fix selectedRows missing when there is childrenColumnName in Table
close #16614
2019-05-16 14:50:24 +08:00
gxvv
c642c87c68 :green_heart:🚨 Fix ci broken and remove linter error. 2019-05-16 14:45:17 +08:00
gxvv
8539cf6879 🐛 Fix scroll to initial anchor on page load and scroll to top on router change.
chore: Use destroy replace disable.
2019-05-16 14:19:15 +08:00
gxvv
5b8867439a 🐛 Fix scrollama not working after unnecessary update. 2019-05-16 14:18:53 +08:00
gxvv
09f79c9dac 📝 Complete translation. 2019-05-16 13:37:20 +08:00
偏右
88364399e3 Merge pull request #16597 from zytjs/patch-1
Update use-in-typescript.zh-CN.md
2019-05-15 16:07:18 +08:00
zytjs
5a3a93230c Update use-in-typescript.zh-CN.md 2019-05-15 15:12:11 +08:00
SylvanasGone
a19a500970 fix(Form): improve method onFieldsChange params type defs (#16577) 2019-05-15 12:24:33 +08:00
zombieJ
c598b364dd fix: Update List ts definition (#16594) 2019-05-15 11:12:55 +08:00
zombieJ
5621b7b9f7 fix: Call Carousel force update when children lenght changed (#16592) 2019-05-15 00:39:09 +08:00
偏右
d576c4bc85 Merge pull request #16586 from ant-design/fix-table-snapshot
test:  Fix snapshots
2019-05-14 16:27:25 +08:00
afc163
be75d125b6 Fix snapshots 2019-05-14 16:26:21 +08:00
偏右
aa70d1441b Merge pull request #16584 from sbusch/fix-form-item-with-help-negative-margin
Prevent negative margin-bottom for form items with help (e.g. validation errors)
2019-05-14 16:17:34 +08:00
Sebastian Busch
8c9b6ec653 prevent negative margin-bottom for form-item-with-help
without this, value can become negative. this caused following fieldset to float
to the right of the field with validation errors

(cherry picked from commit 43da8a5a835904270a6ccf48859d7bd6d91e04cd)
2019-05-14 09:52:46 +02:00
afc163
5313777681 💄 Improve Table demo color style 2019-05-14 12:16:13 +08:00
Christophe Hurpeau
2d986ba2c2 Upload prop onRemove: allow Promise as return type 2019-05-13 17:59:40 +02:00
zombieJ
6379999012 use 1em instead of fix size (#16569) 2019-05-13 19:58:13 +08:00
dependabot[bot]
3033b50108 chore(deps): update rc-calendar requirement from ~9.12.1 to ~9.13.3 (#16555)
Updates the requirements on [rc-calendar](https://github.com/react-component/calendar) to permit the latest version.
- [Release notes](https://github.com/react-component/calendar/releases)
- [Changelog](https://github.com/react-component/calendar/blob/master/HISTORY.md)
- [Commits](https://github.com/react-component/calendar/compare/9.12.1...9.13.3)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-05-13 19:11:53 +08:00
Gin-X
7cdcc7cc2f fix children's type of interface Route (#16550) 2019-05-13 17:54:18 +08:00
zombieJ
1635a1b018 Merge pull request #16567 from ant-design/master
chore: feature merge master
2019-05-13 17:46:54 +08:00
偏右
557c5c9348 Merge pull request #16564 from ant-design/afc163-patch-1
Update package.json
2019-05-13 17:28:04 +08:00
偏右
eb93c1db3e Update package.json 2019-05-13 16:57:09 +08:00
wadezz
5668b16a61 Merge pull request #1 from ant-design/master
merge
2019-04-06 20:47:47 +08:00
chenlong
fc88005c9c Add fault-tolerant processing for rowSelection.getCheckboxProps 2019-03-06 13:58:04 +08:00
549 changed files with 24121 additions and 5288 deletions

8
.github/FUNDING.yml vendored Normal file
View File

@@ -0,0 +1,8 @@
# These are supported funding model platforms
github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
open_collective: ant-design
patreon: ant_design
ko_fi: # Replace with a single Ko-fi username
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
custom: # Replace with a single custom sponsorship URL

View File

@@ -21,20 +21,18 @@ Please makes sure that these form are filled before submitting your pull request
- [ ] Branch merge
- [ ] Other (about what?)
### 👻 What's the background?
### 🔗 Related issue link
<!--
1. Describe the source of requirement, like related issue link.
2. Describe the problem and the scenario.
-->
### 💡 Solution
### 💡 Background and solution
<!--
1. How to fix the problem, and list final API implementation and usage sample if that is an new feature.
1. Describe the problem and the scenario.
2. GIF or snapshot should be provided if includes UI/interactive modification.
3. How to fix the problem, and list final API implementation and usage sample if that is an new feature.
-->
### 📝 Changelog
@@ -43,8 +41,10 @@ Please makes sure that these form are filled before submitting your pull request
Describe changes from userside, and list all potential break changes or other risks.
--->
- English Changelog:
- Chinese Changelog (optional):
| Language | Changelog |
| ---------- | --------- |
| 🇺🇸 English | |
| 🇨🇳 Chinese | |
### ☑️ Self Check before Merge

View File

@@ -21,20 +21,18 @@
- [ ] 分支合并
- [ ] 其他改动(是关于什么的改动?)
### 👻 需求背景
### 🔗 相关 Issue
<!--
1. 描述相关需求的来源,如相关的 issue 讨论链接。
2. 要解决的具体问题。
-->
### 💡 解决方案和最终实现是?
### 💡 需求背景和解决方案
<!--
1. 列出最终的 API 实现和用法
2. 涉及UI/交互变动需要有截图或 GIF。
1. 要解决的具体问题
2. 列出最终的 API 实现和用法。
3. 涉及UI/交互变动需要有截图或 GIF。
-->
### 📝 更新日志怎么写?
@@ -43,7 +41,10 @@
> 从用户角度描述具体变化,以及可能的 breaking change 和其他风险?
-->
- 英文:
| 语言 | 更新描述 |
| ------- | -------- |
| 🇺🇸 英文 | |
| 🇨🇳 中文 | |
- 中文(可选):

14
.github/main.workflow vendored Normal file
View File

@@ -0,0 +1,14 @@
workflow "Deploy website" {
on = "release"
resolves = ["Deploy"]
}
action "Deploy" {
uses = "docker://node:10"
runs = [
"sh",
"-c",
"git remote set-url origin https://${DEPLOY_TOKEN}@github.com/ant-design/ant-design.git && npm install && npm run deploy"
],
secrets = ["DEPLOY_TOKEN"]
}

View File

@@ -10,6 +10,14 @@ module.exports = {
setupFiles: ['./tests/setup.js'],
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'md'],
modulePathIgnorePatterns: ['/_site/'],
moduleNameMapper: {
'^dnd-core$': 'dnd-core/dist/cjs',
'^react-dnd$': 'react-dnd/dist/cjs',
'^react-dnd-html5-backend$': 'react-dnd-html5-backend/dist/cjs',
'^react-dnd-touch-backend$': 'react-dnd-touch-backend/dist/cjs',
'^react-dnd-test-backend$': 'react-dnd-test-backend/dist/cjs',
'^react-dnd-test-utils$': 'react-dnd-test-utils/dist/cjs',
},
testPathIgnorePatterns: ['/node_modules/', 'dekko', 'node'],
transform: {
'\\.tsx?$': './node_modules/antd-tools/lib/jest/codePreprocessor',

View File

@@ -1,7 +1,10 @@
const { moduleNameMapper, transformIgnorePatterns } = require('./.jest');
// jest config for server render environment
module.exports = {
setupFiles: ['./tests/setup.js'],
moduleFileExtensions: ['ts', 'tsx', 'js', 'md'],
moduleNameMapper,
transform: {
'\\.tsx?$': './node_modules/antd-tools/lib/jest/codePreprocessor',
'\\.js$': './node_modules/antd-tools/lib/jest/codePreprocessor',
@@ -10,6 +13,7 @@ module.exports = {
},
testRegex: 'demo\\.test\\.js$',
testEnvironment: 'node',
transformIgnorePatterns,
snapshotSerializers: ['enzyme-to-json/serializer'],
globals: {
'ts-jest': {

View File

@@ -1,5 +0,0 @@
const config = {
plugins: ['remark-preset-lint-recommended', ['remark-lint-list-item-indent', 'space']],
};
module.exports = config;

View File

@@ -15,6 +15,278 @@ timeline: true
---
## 3.20.7
- 🐞 Fix Upload can not click in Form.Item. [#17897](https://github.com/ant-design/ant-design/pull/17897)
## 3.20.6
`2019-07-24`
- 🐞 Fix Col miss the place when its height is 0. [#17748](https://github.com/ant-design/ant-design/pull/17748) [@yoyo837](https://github.com/yoyo837)
- 🐞 Fix Cascader was broken when `options`'s `children` is `null`. [#17756](https://github.com/ant-design/ant-design/pull/17756)
- 🐞 Fix Checkbox padding where all spans align left. [#17752](https://github.com/ant-design/ant-design/pull/17752) [#17761](https://github.com/ant-design/ant-design/pull/17761) [@inovux](https://github.com/inovux)
- 🐞 Fix Input line height style bug in IE. [#17759](https://github.com/ant-design/ant-design/pull/17759)
- 🐞 Fix last item of Rate has additional margin. [#17764](https://github.com/ant-design/ant-design/pull/17764) [@inovux](https://github.com/inovux)
- 🐞 Fix Radio.Button disabled item border style. [#17775](https://github.com/ant-design/ant-design/pull/17775)
- 🐞 Fix DatePicker `@input-hover-border-color` variables not working. [#17784](https://github.com/ant-design/ant-design/pull/17784)
- 🐞 Fix Transfer not re-render list when `dataSource` with `lazy`. [#17783](https://github.com/ant-design/ant-design/pull/17783)
- 🐞 Fix RangePicker `defaultValue` startTime later than endTime. [#17694](https://github.com/ant-design/ant-design/pull/17694) [@mraiguo](https://github.com/mraiguo)
- 💄 Tweak long `placeholder` truncate style. [#17797](https://github.com/ant-design/ant-design/pull/17797) [@Kapiroska](https://github.com/Kapiroska)
- 🐞 Fix Menu circular dependencies. [#17805](https://github.com/ant-design/ant-design/pull/17805) [@phthhieu](https://github.com/phthhieu)
- 🐞 Fix Alert `message` style. [#17808](https://github.com/ant-design/ant-design/pull/17808) [@mtadams007](https://github.com/mtadams007)
- 🐞 Fix Result `extra` is not centered. [#17786](https://github.com/ant-design/ant-design/pull/17786) [@nnecec](https://github.com/nnecec)
- 🐞 Fix Progress with mini `value` not keeps bar radius round. [#17819](https://github.com/ant-design/ant-design/pull/17819)
- 🐞 Fix Statistic.Countdown `format` not escaping characters in square brackets. [#17841](https://github.com/ant-design/ant-design/pull/17841)
- 🐞 Fix Table custom `filterDropdown` always triggering `onChange` in some situations. [#17846](https://github.com/ant-design/ant-design/pull/17846)
- 🐞 Fix TimePicker weird render bug in Safari. [#17857](https://github.com/ant-design/ant-design/pull/17857)
## 3.20.5
`2019-07-19`
- 🐞 Fix `<Button type="danger" ghost />` broken style. [#17743](https://github.com/ant-design/ant-design/pull/17743)
## 3.20.4
`2019-07-19`
- 🐞 Fix multiple level Drawer with falsy `mask`, parent Drawer can not collapse after removing sub component. [#17698](https://github.com/ant-design/ant-design/pull/17698)
- 🐞 Fix Table border radius missing in Firefox. [#17641](https://github.com/ant-design/ant-design/pull/17641)
- 🐞 Fix Menu throw warning `Cannot update during an existing state transition`. [#17657](https://github.com/ant-design/ant-design/pull/17657)
- 🐞 Fix Affix not resize when container size changed. [#17678](https://github.com/ant-design/ant-design/pull/17678)
- 🐞 Fix Anchor not update bind element when `getContainer` changed. [#17677](https://github.com/ant-design/ant-design/pull/17677)
- 🐞 Fix window scroll issue when using Modal and Drawer same time. [#17600](https://github.com/ant-design/ant-design/pull/17600)
- 🌟 Empty `description` supports `false`. [#17659](https://github.com/ant-design/ant-design/pull/17659) [@billfeller](https://github.com/billfeller)
- 💄 Remove Pagination element underline style to avoid polluted by global style. [#17728](https://github.com/ant-design/ant-design/pull/17728)
- 💄 Extends Card action click area. [#17705](https://github.com/ant-design/ant-design/pull/17705) [@lhx6538665](https://github.com/lhx6538665)
- 💄 Tweak less variables and UI to improve style customization. [#17705](https://github.com/ant-design/ant-design/pull/17705)
- Optimize danger Button UI design.
<img width="103" class="markdown-inline-image" alt="image" src="https://user-images.githubusercontent.com/507615/61370809-e37aa480-a8c5-11e9-98b3-51ce06dfba24.png">
- Fix `@border-radius-sm` not working for Slider, TreeSelect.
- Added some less variables for Progress, Tabs, Slider and Timeline.
- TypeScript
- 💄 Improve type definition of Form. [#17676](https://github.com/ant-design/ant-design/pull/17676) [@lixiaoyang1992](https://github.com/lixiaoyang1992)
- 💄 Improve type definition of Tabs. [#17675](https://github.com/ant-design/ant-design/pull/17675)
## 3.20.3
`2019-07-15`
- 🚨 Revert change of Input suffix style in [#17508](https://github.com/ant-design/ant-design/pull/17508), since it introduced other problems
## 3.20.2
`2019-07-13`
- 📖 Add version description for every features. [#17373](https://github.com/ant-design/ant-design/pull/17373) [@muzea](https://github.com/muzea)
- 🐞 Fix Button transition style when loading. [#17596](https://github.com/ant-design/ant-design/pull/17596) [@LilyWakana](https://github.com/LilyWakana)
- Cascader
- 🐞 Fix not display `notFoundContent` when options.length is 0. [#17538](https://github.com/ant-design/ant-design/pull/17538)
- 🐞 Fix option's loading not aligned when `isLeaf` is true. [#17550](https://github.com/ant-design/ant-design/pull/17550)
- 🐞 Fix over-length text covered by arrow. [#17583](https://github.com/ant-design/ant-design/pull/17583)
- 🐞 Fix Input style when suffix and clear icon exist both. [#17508](https://github.com/ant-design/ant-design/pull/17508) [@LilyWakana](https://github.com/LilyWakana)
- TypeScript
- 💄 Improve type definition of Cascader's option. [#17581](https://github.com/ant-design/ant-design/pull/17581) [@MrHeer](https://github.com/MrHeer)
- 🐞 Fix type definition of Descriptions.title. [#17559](https://github.com/ant-design/ant-design/pull/17559)
- 🐞 Fix type definition of Collapse.activeKey, Collapse.defaultActiveKey and CollapsePanel.key. [#17557](https://github.com/ant-design/ant-design/pull/17557) [@thylsky](https://github.com/thylsky)
## 3.20.1
- 💄 Optimize TimePicker focus style. [#17447](https://github.com/ant-design/ant-design/pull/17447)
- 💄 Optimize DatePicker arrow style for resolve messy when not use utf-8. [#17480](https://github.com/ant-design/ant-design/pull/17480)
- 🐞 Remove useless props which Drawer pass to rc-drawer for avoid error. [#17390](https://github.com/ant-design/ant-design/pull/17390)
- 🐞 Fix Tabs disabled tab and next icon style. [#17500](https://github.com/ant-design/ant-design/pull/17500)
- 🐞 Fix Result's problem that the `className` is empty and the class name is wrong. [#17389](https://github.com/ant-design/ant-design/pull/17389)
- 🐞 Fix DatePicker's input box is obscured on safari. [#17421](https://github.com/ant-design/ant-design/pull/17421)
- 🐞 Fix typo icon name `colum-height` to `column-height`. [#17458](https://github.com/ant-design/ant-design/pull/17458)
- TypeScript
- 🐞 Fix Form `onSubmit` type. [#17412](https://github.com/ant-design/ant-design/pull/17412)
- 🐞 Fix omit AutoComplete `loading` type. [#17433](https://github.com/ant-design/ant-design/pull/17433)
- 🐞 Fix Switch `onClick` type. [#17502](https://github.com/ant-design/ant-design/pull/17502) [@DiamondYuan](https://github.com/DiamondYuan)
## 3.20.0
- 🔥🔥🔥 Add [Result](https://ant.design/components/result) Used to feed back the results of a series of operational tasks.
- 🔥 Descriptions support vertical layout. [#17330](https://github.com/ant-design/ant-design/pull/17330) [@hengkx](https://github.com/hengkx)
- 🔥 Progress.Circle support gradient line color. [#17315](https://github.com/ant-design/ant-design/pull/17315) [@hengkx](https://github.com/hengkx)
<img class="markdown-inline-image" src="https://gw.alipayobjects.com/zos/antfincdn/WogwW6kA4O/method-draw-image.svg" alt="Progress">
- 🔥 Optimize PageHeader className naming. [#17321](https://github.com/ant-design/ant-design/pull/17321)
- 🐞 Drawer fixes `maskCloseble` to false, keyboard ESC closes invalid. [#17316](https://github.com/ant-design/ant-design/pull/17316)
- 🐞 Fixed an issue where Drawer closes not calling `afterVisibleChange` in Edge. [#17311](https://github.com/ant-design/ant-design/pull/17311)
- 🌟 Drawer adds `keyboard` to allow opening and closing of responses to keyboard events. [#17316](https://github.com/ant-design/ant-design/pull/17316)
- 🌟 Popconfirm adds the `disabled` props to control whether the click child element pops up. [#16985](https://github.com/ant-design/ant-design/pull/16985) [@lhyt](https://github.com/lhyt)
- ⌨️ Improve TimePicker accessibility. [#17099](https://github.com/ant-design/ant-design/pull/17099)
- 💄 Fix Tooltip arrow shadow style. [#17264](https://github.com/ant-design/ant-design/pull/17264)
- 🐞 Fix Descriptions.Item not support `className`. [#17280](https://github.com/ant-design/ant-design/pull/17280)
- 🐞 Fixing Descriptions.Item does not set a label and will also display the `:` question. [#17337](https://github.com/ant-design/ant-design/pull/17337)
- 🐞 Fixed the incorrect color of the `placeholder` of the Mentions. [#17317](https://github.com/ant-design/ant-design/pull/17317)
- 🐞 Fixed incorrect line-height for Mentions. [#17347](https://github.com/ant-design/ant-design/pull/17347)
- 💄 Fixed small Table header background to white according to design spec. [#17351](https://github.com/ant-design/ant-design/pull/17351)
- 🌟 The CheckboxGroup`onChange` value keeps the order of the options. [#17342](https://github.com/ant-design/ant-design/pull/17342) [@yoyo837](https://github.com/yoyo837)
- 🐞 Fix Tooltip not work correctly on disabled Switch. [#17372](https://github.com/ant-design/ant-design/pull/17372)
- 💄 Add variables [#16843](https://github.com/ant-design/ant-design/pull/16843) [#17031](https://github.com/ant-design/ant-design/pull/17031) [#16996](https://github.com/ant-design/ant-design/pull/16996) [@alxkosov](https://github.com/alxkosov):
- `@dropdown-line-height`
- `@dropdown-font-size`
- `@dropdown-vertical-padding`
- `@collapse-panel-border-radius`
- `@table-body-selected-sort-bg`
- `@table-selected-row-hover-bg`
- TypeScript
- 🌟 Improve the type definition of the Switch. [#17331](https://github.com/ant-design/ant-design/pull/17331)
- 🐞 Skeleton AvatarProps `size` supports number. [#17331](https://github.com/ant-design/ant-design/pull/17331)
- 📝 Updated several documents. [#17336](https://github.com/ant-design/ant-design/pull/17336) [#17345](https://github.com/ant-design/ant-design/pull/17345) [#17355](https://github.com/ant-design/ant-design/pull/17355)
## 3.19.8
`2019-06-24`
- 🐞 Revert `unknown` to `any` for now to avoid introducing tones of errors in one time. [#17249](https://github.com/ant-design/ant-design/issues/17249)
## 3.19.7
`2019-06-21`
- 🐞 Fix Descriptions throw error when contains falsy child. [#17207](https://github.com/ant-design/ant-design/pull/17207) [@superandrew213](http://github.com/superandrew213)
- 🐞 Fix a scrollbar style problem of empty Table in IE. [#17223](https://github.com/ant-design/ant-design/pull/17223)
- 🐞 Fix single Breadcrumb not showing on PageHeader. [#17209](https://github.com/ant-design/ant-design/pull/17209)
- 🐞 Fix Modal that 24px botton area cannot trigger mask click event. [#17229](https://github.com/ant-design/ant-design/pull/17229)
- 🐞 Fix Layout Siders zero-width trigger `z-index` bug. [#17228](https://github.com/ant-design/ant-design/pull/17228)
- TypeScript
- ⚡️ Use the `unknown` type in typescript 3.0 to improve defintions. [#14044](https://github.com/ant-design/ant-design/issues/14044) [@Zzzen](http://github.com/Zzzen)
- 🐞 Fix Calendar `headerRender` should be optional. [#17063](https://github.com/ant-design/ant-design/pull/17063) [@wonderjar](http://github.com/wonderjar)
## 3.19.6
`2019-06-19`
- 🐞 Fix nest Card `extra` position not correct. [#17140](https://github.com/ant-design/ant-design/pull/17140)
- 🐞 Fix Table crash while `filter` dynamic change. [#17141](https://github.com/ant-design/ant-design/pull/17141)
- 🐞 Fix TextArea & DatePicker separator position too low and align issue. [#17165](https://github.com/ant-design/ant-design/pull/17165)
## 3.19.5
`2019-06-17`
- 🐞 Fix RangerPicker input style not align. [#17126](https://github.com/ant-design/ant-design/issues/17126)
- 🐞 Fix `getPopupContainer` of ConfigProvider not works on Modal. [#17132](https://github.com/ant-design/ant-design/issues/17132)
- TypeScript
- 🐞 Fix Descriptions.Item definition. [#17049](https://github.com/ant-design/ant-design/pull/17049)
## 3.19.4
`2019-06-16`
- PageHeader
- 🐞 Fix abnormal margin issue of PageHeader `extra`. [#17025](https://github.com/ant-design/ant-design/issues/17025)
- 🐞 Fix the `onBack` button displays a pointer that is not always clickable. [#17114](https://github.com/ant-design/ant-design/pull/17114)
- 🐞 Fix Table with sort not back to first page. [#16978](https://github.com/ant-design/ant-design/issues/16978)
- 🐞 Fix Menu.SubMenu with selected item should have active style. [#17039](https://github.com/ant-design/ant-design/pull/17039)
- 🐞 Fix Tree with showLine animation shake. [#17055](https://github.com/ant-design/ant-design/pull/17055)
- 🐞 Fix Collapse's redundant scrollbar. [#17009](https://github.com/ant-design/ant-design/pull/17009) [#mtadams007](https://github.com/mtadams007)
- 🐞 Fixing date formats for Arabic-Egypt locale. [#17092](https://github.com/ant-design/ant-design/pull/17092) [#3b3ziz](https://github.com/3b3ziz)
- 🐞 Fix Input not align with other components in Chrome. [#17082](https://github.com/ant-design/ant-design/issues/17082)
- 💄 Adjust bordered table header scrollbar style. [#17065](https://github.com/ant-design/ant-design/pull/17065)
- 🌟 Make Divider style customization easier. [#17113](https://github.com/ant-design/ant-design/pull/17113)
- 🇷🇺 Add missing Russian translations. [#17108](https://github.com/ant-design/ant-design/pull/17108) [#Enfield1](https://github.com/Enfield1)
- 🌟 Add new less variables [#17041](https://github.com/ant-design/ant-design/pull/17041) [#SamKirkland](https://github.com/SamKirkland)
- `@comment-font-size-base`
- `@comment-font-size-sm`
## 3.19.3
`2019-06-06`
- 📝 Add FAQ for DatePicker/RangePicker with `mode` cannot be selected. [#16984](https://github.com/ant-design/ant-design/pull/16984)
- 🐞 Fix Breadcrumb validateDOMNesting warning. [#16929](https://github.com/ant-design/ant-design/pull/16929)
- 🐞 Fix Breadcrumb path error when `children` is selected. [#16885](https://github.com/ant-design/ant-design/pull/16885) [@haianweifeng](https://github.com/haianweifeng)
- 🐞 Fix InputNumber with `number` type display native spinner. [#16926](https://github.com/ant-design/ant-design/pull/16926)
- 🐞 Fix Transfer render Empty when customize without data. [#16925](https://github.com/ant-design/ant-design/pull/16925)
- 🐞 **Fix Table header extra vertical scrollbar problem.** [#16950](https://github.com/ant-design/ant-design/pull/16950)
- 🐞 Fix Table miss `border-radius` in Firefox. [#16957](https://github.com/ant-design/ant-design/pull/16957)
- 🐞 Fix Table error when `rowSelection.getCheckboxProps()` has no return value. [#15224](https://github.com/ant-design/ant-design/pull/15224)
- 🐞 Fix Table abnormal scrollbar in Chrome when using `title` and `rowSelection`. [#16934](https://github.com/ant-design/ant-design/pull/16934)
- 🐞 Fix Divider `orientation="center"` style. [#16988](https://github.com/ant-design/ant-design/pull/16988)
- 🐞 Fix Cascader error when type space. [#16918](https://github.com/ant-design/ant-design/pull/16918) [@Durisvk](https://github.com/Durisvk)
- 🐞 Fix missing spanish translations. [#17002](https://github.com/ant-design/ant-design/pull/17002) [@morellan](https://github.com/morellan)
- TypeScript
- 🐞 Fix Upload `RcFile` definition. [#16851](https://github.com/ant-design/ant-design/pull/16851)
- ⚡️ Export `TextProps` type in Typography. [#17003](https://github.com/ant-design/ant-design/pull/17003) [@Jarvis1010](https://github.com/Jarvis1010)
## 3.19.2
`2019-06-01`
- 🐞 Fix Tabs vertical card mode not scrollable. [#16825](https://github.com/ant-design/ant-design/pull/16825)
- 🐞 Fix Transfer warn `setStart` on an unmounted component. [#16822](https://github.com/ant-design/ant-design/pull/16822) [@shiningjason](https://github.com/shiningjason)
- 💄 Using less variables `@error-color`, `@warning-color` instead of `@text-color-danger`, `@text-color-warning`. [#16890](https://github.com/ant-design/ant-design/pull/16890) [@MrHeer](https://github.com/MrHeer)
- 💄 Add warning if Menu use `inlineCollapsed` under Sider. [#16826](https://github.com/ant-design/ant-design/pull/16826)
- TypeScript
- ⚡️ Add `forceSubmenuRender` into MenuProps. [#16827](https://github.com/ant-design/ant-design/pull/16827)
- ⚡️ Export `TypographyProps` type. [#16835](https://github.com/ant-design/ant-design/pull/16835)
- ⚡️ Add `onChange` prop type definition to Steps. [#16845](https://github.com/ant-design/ant-design/pull/16845) [@JonathanLee-LX](https://github.com/JonathanLee-LX)
- ⚡️ Add `webkitRelativePath` prop type definition to Upload. [#16850](https://github.com/ant-design/ant-design/pull/16850) [@DiamondYuan](https://github.com/DiamondYuan)
## 3.19.1
`2019-05-27`
- 🐞 Fix Tooltip not hidden when Menu collapsed in control mode. [#16812](https://github.com/ant-design/ant-design/pull/16812)
- 🐞 Fix Description warning with column count not correct. [#16819](https://github.com/ant-design/ant-design/pull/16819)
- 🐞 Correct typo icon names `canlendar` / `interation` to `calendar` / `interaction`. [#16818](https://github.com/ant-design/ant-design/pull/16818)
- TypeScript
- ⚡️ Fix Mentions definition. [#16814](https://github.com/ant-design/ant-design/pull/16814)
- ⚡️ Update Select `onSelect` & `onDeselect` prop definition. [#16817](https://github.com/ant-design/ant-design/pull/16817)
## 3.19.0
`2019-05-26`
- New Components:
- 🔥🔥🔥 [Mentions](https://ant.design/components/mentions-cn/) Provides Mentions component and origin Mention marked as deprecated.
- 🔥🔥🔥 [Descriptions](https://ant.design/components/descriptions-cn/) Display multiple read-only fields in groups.
- 🇱🇻 Add Latvian localization support. [#16780](https://github.com/ant-design/ant-design/pull/16780) [@kirbo](https://github.com/kirbo)
- 🌟 Drawer support close by press `ESC`. [#16694](https://github.com/ant-design/ant-design/pull/16694)
- 🌟 Steps support click to switch. [#16773](https://github.com/ant-design/ant-design/pull/16773)
- 🌟 Calendar support `headerRender` to customize header。[#16535](https://github.com/ant-design/ant-design/pull/16535) [@abgaryanharutyun](https://github.com/abgaryanharutyun)
- 🌟 Slider support `tooltipPlacement` to set tooltip position. [#16641](https://github.com/ant-design/ant-design/pull/16641) [@cmaster11](https://github.com/cmaster11)
- 🌟 Slider support `getTooltipPopupContainer` to customize tooltip container. [#16717](https://github.com/ant-design/ant-design/pull/16717)
- 🐞 Fix PageHeader horizontal divider style. [#16684](https://github.com/ant-design/ant-design/pull/16684)
- 🐞 Fix Carousel `initialSlide` not work when `children` count change. [#16756](https://github.com/ant-design/ant-design/pull/16756)
- 🐞 Fix Cascader `displayRender` not interactive. [#16782](https://github.com/ant-design/ant-design/pull/16782)
- 🐞 Fix Upload list still can be removed when `disabled`. [#16786](https://github.com/ant-design/ant-design/pull/16786)
- 💄 Update Upload `disabled` cursor style. [#16799](https://github.com/ant-design/ant-design/pull/16799) [@attacking](https://github.com/attacking)
- 💄 Correct Statistic font color. [#16801](https://github.com/ant-design/ant-design/pull/16801)
- TypeScript
- ⚡️ Update Upload `action` prop definition. [#16716](https://github.com/ant-design/ant-design/pull/16716) [@christophehurpeau](https://github.com/christophehurpeau)
- ⚡️ Update Upload `onRemove` prop definition. [#16570](https://github.com/ant-design/ant-design/pull/16570) [@christophehurpeau](https://github.com/christophehurpeau)
- ⚡️ Update Select `getPopupContainer` prop definition. [#16778](https://github.com/ant-design/ant-design/pull/16778) [@chj-damon](https://github.com/chj-damon)
- ⚡️ Update InputNumber `parse` prop definition. [#16797](https://github.com/ant-design/ant-design/pull/16797)
- ⚡️ Remove useless props definition. [#16705](https://github.com/ant-design/ant-design/pull/16705) [@sirlantis](https://github.com/sirlantis)
## 3.18.2
`2019-05-20`
- 🐞 Fix space missing for Button with mixed content. [#15342](https://github.com/ant-design/ant-design/issues/15342)
- 🐞 Fix active status missing for Carousel when `children` is changed. [#16583](https://github.com/ant-design/ant-design/issues/16583)
- 🐞 Fix panel not close when DatePicker is `blur` by upgrading `rc-calendar` requirement to version `9.13.3`. [#16588](https://github.com/ant-design/ant-design/issues/16588)
- 🐞 Fix style disorder for Form.Item with `help` prop and `margin-bottom` is negative. [#16584](https://github.com/ant-design/ant-design/pull/16584) [@sbusch](https://github.com/sbusch)
- 🐞 Fix Spin not align when set `font-size` style. [#15206](https://github.com/ant-design/ant-design/issues/15206)
- 🐞 Fix `selectedRows` missing when there is `childrenColumnName` in Table. [#16614](https://github.com/ant-design/ant-design/issues/16614)
- TypeScript
- ⚡️ Improve the definition of `children` prop for Breadcrumb. [#16550](https://github.com/ant-design/ant-design/pull/16550) [@Gin-X](https://github.com/Gin-X)
- ⚡️ Improve the definition of `onFieldsChange` params for Form. [#16577](https://github.com/ant-design/ant-design/pull/16577) [@SylvanasGone](https://github.com/SylvanasGone)
- ⚡️ Improve the definition of `dataSource` and `renderItem` for List. [#16587](https://github.com/ant-design/ant-design/issues/16587)
- ⚡️ Improve the definition of `onDragEnter` params for Tree. [#16638](https://github.com/ant-design/ant-design/pull/16638) [@eruca](https://github.com/eruca)
- ⚡️ Improve the definition of `event` for Tree。[#16624](https://github.com/ant-design/ant-design/pull/16624) [@ztplz](https://github.com/ztplz)
## 3.18.1
`2019-05-13`
@@ -1169,7 +1441,6 @@ Component Fixes / Enhancements:
- 🐞 Cascader adds `fieldNames` and discards the misspelled `filedNames`. [#10896](https://github.com/ant-design/ant-design/issues/10896)
- 🐞 Fix Timeline dot not working with Tooltip. [0e3b67e](https://github.com/ant-design/ant-design/commit/0e3b67e9999d867cc304f3be61a8a042a2ab92ee)
- 🐞 Fix border radius when avatar has custom size. [e1e6523](https://github.com/ant-design/ant-design/commit/e1e6523452286ba56f20b73abad762a58ea7d7bc)
- 🌟 Add `okButtonDisabled` and `cancelButtonDisabled` props to disable ok button and cancel button. [#10955](https://github.com/ant-design/ant-design/pull/10955)
## 3.6.6

View File

@@ -15,6 +15,278 @@ timeline: true
---
## 3.20.7
- 🐞 修复 Upload 在 Form.Item 中无法点击的问题。[#17897](https://github.com/ant-design/ant-design/pull/17897)
## 3.20.6
`2019-07-24`
- 🐞 修复 Col 在高度为 0 时的占位问题。 [#17748](https://github.com/ant-design/ant-design/pull/17748) [@yoyo837](https://github.com/yoyo837)
- 🐞 修复 Cascader `options``children``null` 时报错的问题。[#17756](https://github.com/ant-design/ant-design/pull/17756)
- 🐞 修复 Checkbox 左对齐的内边距问题。[#17752](https://github.com/ant-design/ant-design/pull/17752) [#17761](https://github.com/ant-design/ant-design/pull/17761) [@inovux](https://github.com/inovux)
- 🐞 修复 Input 在 IE 下错位的问题。[#17759](https://github.com/ant-design/ant-design/pull/17759)
- 🐞 修复最后一个 Rate 有额外边距的问题。[#17764](https://github.com/ant-design/ant-design/pull/17764) [@inovux](https://github.com/inovux)
- 🐞 修复 Radio.Button 失效项的边框样式问题。[#17775](https://github.com/ant-design/ant-design/pull/17775)
- 🐞 修复 DatePicker `@input-hover-border-color` 变量不生效的问题。[#17784](https://github.com/ant-design/ant-design/pull/17784)
- 🐞 修复 Transfer 在 `lazy` 时更新数据不触发重新渲染的问题。[#17783](https://github.com/ant-design/ant-design/pull/17783)
- 🐞 修复 RangePicker `defaultValue` 中开始时间可大于结束时间的问题。[#17694](https://github.com/ant-design/ant-design/pull/17694) [@mraiguo](https://github.com/mraiguo)
- 💄 优化 `placeholder` 文字过长时的截断样式兼容性问题。[#17797](https://github.com/ant-design/ant-design/pull/17797) [@Kapiroska](https://github.com/Kapiroska)
- 🐞 修复 Menu 循环依赖的问题。[#17805](https://github.com/ant-design/ant-design/pull/17805) [@phthhieu](https://github.com/phthhieu)
- 🐞 修复 Alert `message` 样式问题。[#17808](https://github.com/ant-design/ant-design/pull/17808) [@mtadams007](https://github.com/mtadams007)
- 🐞 修复 Result `extra` 部分不居中的问题。[#17786](https://github.com/ant-design/ant-design/pull/17786) [@nnecec](https://github.com/nnecec)
- 🐞 修复 Progress 在 `value` 较小时,左边条不够圆的问题。[#17819](https://github.com/ant-design/ant-design/pull/17819)
- 🐞 修复 Statistic.Countdown `format` 不支持方括号保留字符串的问题。[#17841](https://github.com/ant-design/ant-design/pull/17841)
- 🐞 修复 Table 自定义 `filterDropdown` 在某些情况下消失时总是触发 `onChange` 的问题。[#17846](https://github.com/ant-design/ant-design/pull/17846)
- 🐞 修复 TimePicker 在 Safari 下的滚动条渲染问题。[#17857](https://github.com/ant-design/ant-design/pull/17857)
## 3.20.5
`2019-07-19`
- 🐞 修复 `<Button type="danger" ghost />` 样式问题。[#17743](https://github.com/ant-design/ant-design/pull/17743)
## 3.20.4
`2019-07-19`
- 🐞 修复多层级 Drawer 的 `mask` 为 false 时,卸载子级组件后父抽屉不收回的问题。[#17698](https://github.com/ant-design/ant-design/pull/17698)
- 🐞 修复 Table 圆角样式在 Firefox 下丢失的问题。[#17641](https://github.com/ant-design/ant-design/pull/17641)
- 🐞 修复 Menu 抛出 `Cannot update during an existing state transition` 警告的问题。[#17657](https://github.com/ant-design/ant-design/pull/17657)
- 🐞 修复 Affix 容器变化时尺寸不变的问题。[#17678](https://github.com/ant-design/ant-design/pull/17678)
- 🐞 修复 Anchor 监听元素不随着 `getContainer` 变化的问题。[#17677](https://github.com/ant-design/ant-design/pull/17677)
- 🐞 修复 Modal 和 Drawer 同时使用导致的窗体滚动条冲突的问题。[#17600](https://github.com/ant-design/ant-design/pull/17600)
- 🌟 Empty `description` 支持 `false`。 [#17659](https://github.com/ant-design/ant-design/pull/17659) [@billfeller](https://github.com/billfeller)
- 💄 去除 Pagination 元素下划线以防止被全局样式污染。[#17728](https://github.com/ant-design/ant-design/pull/17728)
- 💄 拓展 Card action 可点击区域。[#17705](https://github.com/ant-design/ant-design/pull/17705) [@lhx6538665](https://github.com/lhx6538665)
- 💄 对 Less 变量进行了一波调整,以适应更多细节风格定制。[#17697](https://github.com/ant-design/ant-design/pull/17697)
- 调整危险按钮样式。
<img width="103" class="markdown-inline-image" alt="image" src="https://user-images.githubusercontent.com/507615/61370809-e37aa480-a8c5-11e9-98b3-51ce06dfba24.png">
- 修复 `@border-radius-sm` 对 Slider、TreeSelect 不生效的问题。
- Progress、Tabs、Slider、Timeline 组件补充 less 变量。
- TypeScript
- 💄 完善 Form 的类型定义。[#17676](https://github.com/ant-design/ant-design/pull/17676) [@lixiaoyang1992](https://github.com/lixiaoyang1992)
- 💄 完善 Tabs 的类型定义。[#17675](https://github.com/ant-design/ant-design/pull/17675)
## 3.20.3
`2019-07-15`
- 🚨 回滚 [#17508](https://github.com/ant-design/ant-design/pull/17508) 中对 Input 后缀样式的修改,因其导致了其他更多问题。
## 3.20.2
`2019-07-13`
- 📖 文档中增加对组件新特性的版本说明。[#17373](https://github.com/ant-design/ant-design/pull/17373) [@muzea](https://github.com/muzea)
- 🐞 修复 Button 组件的 loading 样式问题。[#17596](https://github.com/ant-design/ant-design/pull/17596) [@LilyWakana](https://github.com/LilyWakana)
- Cascader
- 🐞 修复 options 为空时不展示空内容的问题。[#17538](https://github.com/ant-design/ant-design/pull/17538)
- 🐞 修复 option 的 isLeaf 为 true 时 loading 样式没有对齐的问题。[#17550](https://github.com/ant-design/ant-design/pull/17550)
- 🐞 修复文本过长被箭头遮挡的问题。[#17583](https://github.com/ant-design/ant-design/pull/17583)
- 🐞 修复 Input 组件存在多个后缀图标时的样式错乱问题。[#17508](https://github.com/ant-design/ant-design/pull/17508) [@LilyWakana](https://github.com/LilyWakana)
- TypeScript
- 💄 完善 Cascader 的 `option` 类型定义。[#17581](https://github.com/ant-design/ant-design/pull/17581) [@MrHeer](https://github.com/MrHeer)
- 🐞 修复 Descriptions 的 `title` 类型定义。[#17559](https://github.com/ant-design/ant-design/pull/17559)
- 🐞 修复 Collapse 的 activeKey、defaultActiveKey 以及 Collapse.Panel 的 key 类型定义。[#17557](https://github.com/ant-design/ant-design/pull/17557) [@thylsky](https://github.com/thylsky)
## 3.20.1
- 💄 优化 TimePicker 聚焦状态的样式。[#17447](https://github.com/ant-design/ant-design/pull/17447)
- 💄 优化 DatePicker 箭头样式,解决非 utf-8 编码下箭头样式乱码的问题。[#17480](https://github.com/ant-design/ant-design/pull/17480)
- 🐞 删除 Drawer 中传给 rc-drawer 的不必要的属性避免报错。[#17390](https://github.com/ant-design/ant-design/pull/17390)
- 🐞 修复 Tabs 当前失效页签样式以及切换图标错位 2px 的问题。[#17500](https://github.com/ant-design/ant-design/pull/17500)
- 🐞 修复 Result 组件 `className` 为空造成类名错误的问题。[#17389](https://github.com/ant-design/ant-design/pull/17389)
- 🐞 修复 safari 浏览器 DatePicker 组件输入框被遮挡的问题。[#17421](https://github.com/ant-design/ant-design/pull/17421)
- 🐞 修复图标名 `colum-height``column-height`。[#17458](https://github.com/ant-design/ant-design/pull/17458)
- TypeScript
- 🐞 修复 Form `onSubmit` TypeScript 定义。[#17412](https://github.com/ant-design/ant-design/pull/17412)
- 🐞 修复 AutoComplete 多余的 `loading` 属性 TypeScript 定义。[#17433](https://github.com/ant-design/ant-design/pull/17433)
- 🐞 修复 Switch 的 `onClick` 的 TypeScript 定义。[#17502](https://github.com/ant-design/ant-design/pull/17502) [@DiamondYuan](https://github.com/DiamondYuan)
## 3.20.0
- 🔥🔥🔥 新增 [Result](https://ant.design/components/result) 用于反馈一系列操作任务的处理结果。
- 🔥 Descriptions 支持垂直布局。[#17330](https://github.com/ant-design/ant-design/pull/17330) [@hengkx](https://github.com/hengkx)
- 🔥 优化 PageHeader 的 `className` 定义。[#17321](https://github.com/ant-design/ant-design/pull/17321)
- 🔥 Progress.Circle 支持渐变色。[#17315](https://github.com/ant-design/ant-design/pull/17315) [@hengkx](https://github.com/hengkx)
<img class="markdown-inline-image" src="https://gw.alipayobjects.com/zos/antfincdn/WogwW6kA4O/method-draw-image.svg" alt="Progress">
- 🐞 Drawer 修复 `maskCloseble` 为 false键盘 ESC 关闭无效的问题。[#17316](https://github.com/ant-design/ant-design/pull/17316)
- 🐞 修复在 Edge 下 Drawer 关闭后没有调用 `afterVisibleChange` 的问题。[#17311](https://github.com/ant-design/ant-design/pull/17311)
- 🌟 Drawer 新增 `keyboard`,允许打开关闭对键盘事件的响应。[#17316](https://github.com/ant-design/ant-design/pull/17316)
- 🌟 Popconfirm 增加 `disabled` props用于控制点击子元素是否弹出。[#16985](https://github.com/ant-design/ant-design/pull/16985) [@lhyt](https://github.com/lhyt)
- ⌨️ 改进 TimePicker 可访问性。[#17099](https://github.com/ant-design/ant-design/pull/17099)
- 💄 修复 Tooltip 箭头阴影样式。[#17264](https://github.com/ant-design/ant-design/pull/17264)
- 🐞 修复 Descriptions.Item 不支持 `className` 的问题。[#17280](https://github.com/ant-design/ant-design/pull/17280)
- 🐞 修复 Descriptions.Item 不设置 label也会显示 `:` 的问题。[#17337](https://github.com/ant-design/ant-design/pull/17337)
- 🐞 修复 Mentions 组件的 `placeholder` 颜色不正确的问题。[#17317](https://github.com/ant-design/ant-design/pull/17317)
- 🐞 修复 Mentions 组件的行高不正确的问题。[#17347](https://github.com/ant-design/ant-design/pull/17347)
- 💄 按照设计规范修复小号 Table 的背景色。[#17351](https://github.com/ant-design/ant-design/pull/17351)
- 🌟 CheckboxGroup `onChange` 值保持选项的顺序。[#17342](https://github.com/ant-design/ant-design/pull/17342) [@yoyo837](https://github.com/yoyo837)
- 🐞 修复 Tooltip 在 disabled Switch 中工作不正确的问题。[#17372](https://github.com/ant-design/ant-design/pull/17372)
- 💄 增加 less 变量 [#16843](https://github.com/ant-design/ant-design/pull/16843) [#17031](https://github.com/ant-design/ant-design/pull/17031) [#16996](https://github.com/ant-design/ant-design/pull/16996) [@alxkosov](https://github.com/alxkosov)
- `@dropdown-line-height`
- `@dropdown-font-size`
- `@dropdown-vertical-padding`
- `@collapse-panel-border-radius`
- `@table-body-selected-sort-bg`
- `@table-selected-row-hover-bg`
- TypeScript
- 🌟 改进 Switch 的类型定义。[#17331](https://github.com/ant-design/ant-design/pull/17331)
- 🐞 Skeleton AvatarProps `size` 支持 number。[#17331](https://github.com/ant-design/ant-design/pull/17331)
- 📝 更新了几处文档。[#17336](https://github.com/ant-design/ant-design/pull/17336) [#17345](https://github.com/ant-design/ant-design/pull/17345) [#17355](https://github.com/ant-design/ant-design/pull/17355)
## 3.19.8
`2019-06-24`
- 🐞 回滚 `unknown``any` 避免一次性引入大量 TS 错误。[#17249](https://github.com/ant-design/ant-design/issues/17249)
## 3.19.7
`2019-06-21`
- 🐞 修复 Descriptions 内无法嵌套空值的问题。[#17207](https://github.com/ant-design/ant-design/pull/17207) [@superandrew213](http://github.com/superandrew213)
- 🐞 修复 Table 空数据表格在 IE 下的一个滚动条样式问题。[#17223](https://github.com/ant-design/ant-design/pull/17223)
- 🐞 修复单个 Breadcrumb 未在 PageHeader 上显示的问题。[#17209](https://github.com/ant-design/ant-design/pull/17209)
- 🐞 修复 Modal 底部 24px 像素遮罩区域无法触发关闭弹窗行为。[#17229](https://github.com/ant-design/ant-design/pull/17229)
- 🐞 修复 Layout Sider 的展开按钮 `z-index` 太低的问题。[#17228](https://github.com/ant-design/ant-design/pull/17228)
- TypeScript
- ⚡️ 使用 `unknown` 代替 `any` 优化 TypeScript 定义。[#14044](https://github.com/ant-design/ant-design/issues/14044) [@Zzzen](http://github.com/Zzzen)
- 🐞 修复 Calendar `headerRender` 属性为可选。[#17063](https://github.com/ant-design/ant-design/pull/17063) [@wonderjar](http://github.com/wonderjar)
## 3.19.6
`2019-06-19`
- 🐞 修复嵌套 Card `extra` 位置不正确的问题。[#17140](https://github.com/ant-design/ant-design/pull/17140)
- 🐞 修复 Table 动态改变 `filter` 时报错的问题。[#17141](https://github.com/ant-design/ant-design/pull/17141)
- 🐞 修复 TextArea 和 RangePicker 分隔符位置偏下和对齐的问题。[#17165](https://github.com/ant-design/ant-design/pull/17165)
## 3.19.5
`2019-06-17`
- 🐞 修复 RangerPicker 输入框内容没有对齐的问题。[#17126](https://github.com/ant-design/ant-design/issues/17126)
- 🐞 修复 ConfigProvider 的 `getPopupContainer` 对 Modal 无效的问题。[#17132](https://github.com/ant-design/ant-design/issues/17132)
- TypeScript
- 🐞 修复 Descriptions.Item 的类型定义。[#17049](https://github.com/ant-design/ant-design/pull/17049)
## 3.19.4
`2019-06-16`
- PageHeader
- 🐞 修复 `extra` 的一个元素边距问题。[#17025](https://github.com/ant-design/ant-design/issues/17025)
- 🐞 修复手型鼠标指针并不总是可点击的问题。[#17114](https://github.com/ant-design/ant-design/pull/17114)
- 🐞 修复 Table 数据排序后不会回到第一页的问题。[#16978](https://github.com/ant-design/ant-design/issues/16978)
- 🐞 修复 Menu 选项的子菜单选中并收起时没有高亮的问题。[#17039](https://github.com/ant-design/ant-design/pull/17039)
- 🐞 修复 Tree 使用 `showLine` 时动画抖动的问题。[#17055](https://github.com/ant-design/ant-design/pull/17055)
- 🐞 修复 Collapse 会出现多余滚动条的问题。[#17009](https://github.com/ant-design/ant-design/pull/17009) [#mtadams007](https://github.com/mtadams007)
- 🐞 修复 DatePicker 阿拉伯语的时间格式。[#17092](https://github.com/ant-design/ant-design/pull/17092) [#3b3ziz](https://github.com/3b3ziz)
- 🐞 修复 Input 与其他组件不对齐的问题。[#17082](https://github.com/ant-design/ant-design/issues/17082)
- 💄 优化带边框 Table 的滚动条样式细节。[#17065](https://github.com/ant-design/ant-design/pull/17065)
- 🌟 优化 Divider 实现方式以方便样式定制。[#17113](https://github.com/ant-design/ant-design/pull/17113)
- 🇷🇺 新增部分俄语翻译。[#17108](https://github.com/ant-design/ant-design/pull/17108) [#Enfield1](https://github.com/Enfield1)
- 🌟 新增 less 变量 [#17041](https://github.com/ant-design/ant-design/pull/17041) [#SamKirkland](https://github.com/SamKirkland)
- `@comment-font-size-base`
- `@comment-font-size-sm`
## 3.19.3
`2019-06-06`
- 📝 增加 DatePicker/RangePicker 指定 `mode` 后无法选择的文档说明。[#16984](https://github.com/ant-design/ant-design/pull/16984)
- 🐞 修复 Breadcrumb 的 `validateDOMNesting` 警告信息。[#16929](https://github.com/ant-design/ant-design/pull/16929)
- 🐞 修复 Breadcrumb 选中子路由时浏览器路径问题。[#16885](https://github.com/ant-design/ant-design/pull/16885) [@haianweifeng](https://github.com/haianweifeng)
- 🐞 修复 InputNumber 设置 `number` 类型时会展示原生按钮的问题。[#16926](https://github.com/ant-design/ant-design/pull/16926)
- 🐞 修复 Transfer 在自定义列表为空时展示 Empty 样式。[#16925](https://github.com/ant-design/ant-design/pull/16925)
- 🐞 **修复 Table 头部多余的垂直滚动条样式。**[#16950](https://github.com/ant-design/ant-design/pull/16950)
- 🐞 修复 Table 的 `rowSelection.getCheckboxProps()` 在没有返回值时报错的问题。[#15224](https://github.com/ant-design/ant-design/pull/15224)
- 🐞 修复 Firefox 的 Table 丢失 `border-radius` 样式问题。[#16957](https://github.com/ant-design/ant-design/pull/16957)
- 🐞 修复 Table 当 `title``rowSelection` 同时指定时在 Chrome 下滚动条异常的问题。[#16934](https://github.com/ant-design/ant-design/pull/16934)
- 🐞 修复 Divider `orientation="center"` 时样式错位的问题。[#16988](https://github.com/ant-design/ant-design/pull/16988)
- 🐞 修复 Cascader 搜索时不支持空格输入的问题。[#16918](https://github.com/ant-design/ant-design/pull/16918) [@Durisvk](https://github.com/Durisvk)
- 🐞 修复部分组件的西班牙语言翻译。[#17002](https://github.com/ant-design/ant-design/pull/17002) [@morellan](https://github.com/morellan)
- TypeScript
- 🐞 修复 Upload 的 `RcFile` 类型定义。[#16851](https://github.com/ant-design/ant-design/pull/16851)
- ⚡️ 导出 Typography 中 `TextProps` 的类型定义。[#17003](https://github.com/ant-design/ant-design/pull/17003) [@Jarvis1010](https://github.com/Jarvis1010)
## 3.19.2
`2019-06-01`
- 🐞 修复 Tabs 在垂直卡片模式下标签不能滚动的问题。[#16825](https://github.com/ant-design/ant-design/pull/16825)
- 🐞 修复 Transfer 组件在 unmount 时 `setState` 警告。[#16822](https://github.com/ant-design/ant-design/pull/16822) [@shiningjason](https://github.com/shiningjason)
- 💄 使用 Less 变量 `@error-color``@warning-color` 代替 `@text-color-danger``@text-color-warning`。[#16890](https://github.com/ant-design/ant-design/pull/16890) [@MrHeer](https://github.com/MrHeer)
- 💄 增加在 Sider 内 Menu 使用 `inlineCollapsed` 时的提示信息。[#16826](https://github.com/ant-design/ant-design/pull/16826)
- TypeScript
- ⚡️ 增加 Menu 中 `forceSubMenuRender` 类型定义。[#16827](https://github.com/ant-design/ant-design/pull/16827)
- ⚡️ 导出 Typography 类型定义。[#16835](https://github.com/ant-design/ant-design/pull/16835)
- ⚡️ 增加 Steps 中的 `onChange` 类型定义。[#16845](https://github.com/ant-design/ant-design/pull/16845) [@JonathanLee-LX](https://github.com/JonathanLee-LX)
- ⚡️ 增加 Upload 中 `webkitRelativePath` 类型定义。[#16850](https://github.com/ant-design/ant-design/pull/16850) [@DiamondYuan](https://github.com/DiamondYuan)
## 3.19.1
`2019-05-27`
- 🐞 修复 Menu 在受控模式下收起 Tooltip 不消失的问题。[#16812](https://github.com/ant-design/ant-design/pull/16812)
- 🐞 修复 Descriptions 排列警告信息逻辑错误的问题。[#16819](https://github.com/ant-design/ant-design/pull/16819)
- 🐞 修复图标 `canlendar``interation` 为正确的拼写 `calendar``interaction`。[#16818](https://github.com/ant-design/ant-design/pull/16818)
- TypeScript
- ⚡️ 修复 Mentions 定义。[#16814](https://github.com/ant-design/ant-design/pull/16814)
- ⚡️ 完善 Select 中 `onSelect``onDeselect` 属性的定义。[#16817](https://github.com/ant-design/ant-design/pull/16817)
## 3.19.0
`2019-05-26`
- 本月新增组件:
- 🔥🔥🔥 [Mentions](https://ant.design/components/mentions-cn/) 新增提及组件并废弃原有 Mention 组件。
- 🔥🔥🔥 [Descriptions](https://ant.design/components/descriptions-cn/) 成组展示多个只读字段。
- 🇱🇻 新增拉脱维亚语支持。[#16780](https://github.com/ant-design/ant-design/pull/16780) [@kirbo](https://github.com/kirbo)
- 🌟 Drawer 支持 `ESC` 关闭。[#16694](https://github.com/ant-design/ant-design/pull/16694)
- 🌟 Steps 支持点击切换功能。[#16773](https://github.com/ant-design/ant-design/pull/16773)
- 🌟 Calendar 支持 `headerRender` 以自定义头部。[#16535](https://github.com/ant-design/ant-design/pull/16535) [@abgaryanharutyun](https://github.com/abgaryanharutyun)
- 🌟 Slider 支持 `tooltipPlacement` 以定义提示所在位置。[#16641](https://github.com/ant-design/ant-design/pull/16641) [@cmaster11](https://github.com/cmaster11)
- 🌟 Slider 支持 `getTooltipPopupContainer` 以允许自定义提示所在容器。[#16717](https://github.com/ant-design/ant-design/pull/16717)
- 🐞 修复 PageHeader 中水平分割线样式问题。[#16684](https://github.com/ant-design/ant-design/pull/16684)
- 🐞 修复 Carousel `initialSlide``children` 数量变化时无效的问题。[#16756](https://github.com/ant-design/ant-design/pull/16756)
- 🐞 修复 Cascader 自定义渲染时元素无法交互的问题。[#16782](https://github.com/ant-design/ant-design/pull/16782)
- 🐞 修复 Upload 列表在 `disabled` 时仍然可以移除的问题。[#16786](https://github.com/ant-design/ant-design/pull/16786)
- 💄 增加 Upload `disabled` 状态下鼠标样式。[#16799](https://github.com/ant-design/ant-design/pull/16799) [@attacking](https://github.com/attacking)
- 💄 修正 Statistic 的字体颜色。[#16801](https://github.com/ant-design/ant-design/pull/16801)
- TypeScript
- ⚡️ 完善 Upload 中 `action` 属性的定义。[#16716](https://github.com/ant-design/ant-design/pull/16716) [@christophehurpeau](https://github.com/christophehurpeau)
- ⚡️ 完善 Upload 中 `onRemove` 属性的定义。[#16570](https://github.com/ant-design/ant-design/pull/16570) [@christophehurpeau](https://github.com/christophehurpeau)
- ⚡️ 完善 Select 中 `getPopupContainer` 属性的定义。[#16778](https://github.com/ant-design/ant-design/pull/16778) [@chj-damon](https://github.com/chj-damon)
- ⚡️ 完善 InputNumber 中 `parser` 属性的定义。[#16797](https://github.com/ant-design/ant-design/pull/16797)
- ⚡️ 移除已经失效的属性定义。[#16705](https://github.com/ant-design/ant-design/pull/16705) [@sirlantis](https://github.com/sirlantis)
## 3.18.2
`2019-05-20`
- 🐞 修复 Button 组件中插入文本时空格丢失的问题。[#15342](https://github.com/ant-design/ant-design/issues/15342)
- 🐞 修复 Carousel 组件的 `children` 数量变化时,面板指示点的选中状态不正常的问题。[#16583](https://github.com/ant-design/ant-design/issues/16583)
- 🐞 升级 `rc-calendar` 依赖到 `9.13.3` 版本,以修复 DatePicker 组件在失去焦点时面板不会关闭的问题。[#16588](https://github.com/ant-design/ant-design/issues/16588)
- 🐞 修复 Form.Item 组件带有 `help` 信息,并且 `margin-bottom` 为负数时,导致之后的元素样式错乱的问题。[#16584](https://github.com/ant-design/ant-design/pull/16584) [@sbusch](https://github.com/sbusch)
- 🐞 修复 Spin 组件在设置 `font-size` 样式时没有水平居中的问题。[#15206](https://github.com/ant-design/ant-design/issues/15206)
- 🐞 修复 Table 组件指定 `childrenColumnName` 时,`selectedRows` 参数为空的问题。[#16614](https://github.com/ant-design/ant-design/issues/16614)
- TypeScript
- ⚡️ 完善 Breadcrumb 中 `children` 属性的定义。[#16550](https://github.com/ant-design/ant-design/pull/16550) [@Gin-X](https://github.com/Gin-X)
- ⚡️ 完善 Form 中 `onFieldsChange` 函数的参数定义。[#16577](https://github.com/ant-design/ant-design/pull/16577) [@SylvanasGone](https://github.com/SylvanasGone)
- ⚡️ 完善 List 中 `dataSource``renderItem` 属性的定义。[#16587](https://github.com/ant-design/ant-design/issues/16587)
- ⚡️ 完善 Tree 中 `onDragEnter` 函数的参数定义。[#16638](https://github.com/ant-design/ant-design/pull/16638) [@eruca](https://github.com/eruca)
- ⚡️ 完善 Tree 中 event 属性的定义。[#16624](https://github.com/ant-design/ant-design/pull/16624) [@ztplz](https://github.com/ztplz)
## 3.18.1
`2019-05-13`
@@ -142,14 +414,14 @@ timeline: true
- 🐞 修复 List 分页无法改变每页条数。[#15871](https://github.com/ant-design/ant-design/pull/15871)
- 🐞 修复 RangePicker 结束时间不可输入。[#15866](https://github.com/ant-design/ant-design/pull/15866)
- 📝 站点 [Icon](https://ant.design/components/icon-cn/) 支持图标搜索。[#15867](https://github.com/ant-design/ant-design/pull/15867) [@DiamondYuan](https://github.com/DiamondYuan)
- 🐞 修复 TimePicker `locale` 属性无效的问题。 [#15837](https://github.com/ant-design/ant-design/pull/15837)
- 🐞 修复 TimePicker `locale` 属性无效的问题。[#15837](https://github.com/ant-design/ant-design/pull/15837)
- 🐞 修复 Steps 同时使用 `progressDot``size="small"` 时的样式错乱问题。[#15856](https://github.com/ant-design/ant-design/pull/15856)
- 🐞 修复 Affix 的内容高度改变时,位置不更新的问题。 [#15899](https://github.com/ant-design/ant-design/pull/15899)
- 🐞 修复 Affix 的内容高度改变时,位置不更新的问题。[#15899](https://github.com/ant-design/ant-design/pull/15899)
- Table
- 🐞 修复 Table 使用排序时,表头设置 `align: right` 失效的问题。[#15895](https://github.com/ant-design/ant-design/pull/15895)
- 🐞 修复 Table 筛选使用 string 以外类型的展示问题。 [#15817](https://github.com/ant-design/ant-design/pull/15817)
- 🐞 修复 Table 筛选使用 string 以外类型的展示问题。[#15817](https://github.com/ant-design/ant-design/pull/15817)
- 🐞 修复 Badge `count` 为负数时的显示问题。[#15810](https://github.com/ant-design/ant-design/pull/15810)
- 💄 优化 `Empty.PRESENTED_IMAGE_SIMPLE` 的默认样式。 [#15841](https://github.com/ant-design/ant-design/pull/15841)
- 💄 优化 `Empty.PRESENTED_IMAGE_SIMPLE` 的默认样式。[#15841](https://github.com/ant-design/ant-design/pull/15841)
- 🌟 新增 less 变量 `@html-selector` 用于支持主题前缀。[#15613](https://github.com/ant-design/ant-design/pull/15613) [@krokofant](https://github.com/krokofant)
- TypeScript
- 🐞 修复 Table `columnGroup` 定义。[fc45d](https://github.com/ant-design/ant-design/commit/fc45d7003efab225298bbc7ac740df40d34872d1)
@@ -223,7 +495,7 @@ timeline: true
`2019-03-17`
- 🌟 补充了 less 变量 `@pagination-item-bg-active``@icon-color` [#15302](https://github.com/ant-design/ant-design/pull/15302) [#15345](https://github.com/ant-design/ant-design/pull/15345)
- 🌟 补充了 less 变量 `@pagination-item-bg-active``@icon-color`。[#15302](https://github.com/ant-design/ant-design/pull/15302) [#15345](https://github.com/ant-design/ant-design/pull/15345)
- 🐞 修复引入 PageHeader 导致 tree-shaking 失效的问题。[#15354](https://github.com/ant-design/ant-design/pull/15354)
- List
- 🐞 修复 List 的一些样式问题。[#15328](https://github.com/ant-design/ant-design/pull/15328)
@@ -275,8 +547,8 @@ timeline: true
`2019-03-04`
- 🌟 PageHeader 支持 `className` prop。 [#15159](https://github.com/ant-design/ant-design/pull/15159)
- 🐞 修复 Form 输出警告信息的问题。 [#15160](https://github.com/ant-design/ant-design/pull/15160)
- 🌟 PageHeader 支持 `className` prop。[#15159](https://github.com/ant-design/ant-design/pull/15159)
- 🐞 修复 Form 输出警告信息的问题。[#15160](https://github.com/ant-design/ant-design/pull/15160)
- 🐞 修复 ConfigProvider 中 getPopupContainer 对于 DatePicker 无效的问题。[#15156](https://github.com/ant-design/ant-design/pull/15156)
- 🐞 修复 Collapse `extra` 位置错误的问题。[#15176](https://github.com/ant-design/ant-design/pull/15176)
@@ -361,7 +633,7 @@ timeline: true
- 🐞 修复 `pagination``true` 时报错的问题。
- 🐞 修复过滤下拉框会被遮挡的问题。[#11730](https://github.com/ant-design/ant-design/issues/11730)
- TypeScript 类型
- 🐞 修复 Checkbox 缺少的 `onClick` 类型。 [#14762](https://github.com/ant-design/ant-design/pull/14762) [@Frezc](https://github.com/Frezc)
- 🐞 修复 Checkbox 缺少的 `onClick` 类型。[#14762](https://github.com/ant-design/ant-design/pull/14762) [@Frezc](https://github.com/Frezc)
- 🐞 修复 Menu 缺少的 `onTitleMouseEnter``onTitleMouseLeave` 类型。[#14737](https://github.com/ant-design/ant-design/pull/14737) [#GabeMedrash](https://github.com/ant-design/ant-design/pull/14737)
## 3.13.2
@@ -685,8 +957,8 @@ timeline: true
- 🌟 onCell 方法增加 `index` 参数。[#222](https://github.com/react-component/table/pull/222) [@yoyo837](https://github.com/yoyo837)
- Select 组件升级 `rc-select``8.6.0`
- 🌟 增加 `removeIcon``clearIcon``menuItemSelectedIcon` 属性,用于自定义删除、清空、选中的图标。[#12958](https://github.com/ant-design/ant-design/pull/12958) [@kimochg](https://github.com/kimochg)
- 🌟 增加 `dropdownRender` 属性, 用于自定义下拉框内容。[#10831](https://github.com/ant-design/ant-design/issues/10831)
- 🌟 增加 `loading` 属性, 用于展示加载中状态。[#11225](https://github.com/ant-design/ant-design/issues/11225)
- 🌟 增加 `dropdownRender` 属性,用于自定义下拉框内容。[#10831](https://github.com/ant-design/ant-design/issues/10831)
- 🌟 增加 `loading` 属性,用于展示加载中状态。[#11225](https://github.com/ant-design/ant-design/issues/11225)
- 💄 Menu.Item 组件增加 `title` 属性,用于在收缩时展示的悬浮标题。[#12952](https://github.com/ant-design/ant-design/pull/12952)
- Cascader 升级 `rc-calendar``9.8.0`
- 🌟 支持多种时间格式。[#437](https://github.com/react-component/calendar/pull/437) [@onlyann](https://github.com/onlyann)
@@ -950,7 +1222,7 @@ timeline: true
在开学之际我们带来了久违的 `3.9.0` 的更新。多个重量级的新特性和大量修复,使 Ant Design 的能力显著提升。
- 🔥🔥🔥 在 `3.9.0` 版本中,我们重绘了所有的图标,新增了两大类,超过 90 个新图标,并且为每个图标增加了多种风格。为此我们重写了 Icon 组件,使用 `SVG` 替换了 `fontface` 图标,增加了多个特性,可以快速的使用新的图标和风格。 ![](https://gw.alipayobjects.com/zos/rmsportal/CVDHuodLwcDeyQBDoUIZ.png)
- 🔥🔥🔥 在 `3.9.0` 版本中,我们重绘了所有的图标,新增了两大类,超过 90 个新图标,并且为每个图标增加了多种风格。为此我们重写了 Icon 组件,使用 `SVG` 替换了 `fontface` 图标,增加了多个特性,可以快速的使用新的图标和风格。![](https://gw.alipayobjects.com/zos/rmsportal/CVDHuodLwcDeyQBDoUIZ.png)
- 💄 使用 `SVG` 图标替换了 `css` 字体图标,[可以看这里的讨论了解 svg 的优势](https://github.com/ant-design/ant-design/issues/10353)。
- 💄 提供了三套图标风格线性、实色和双色图标,默认为线性风格。
- 🌟 新增了 **编辑类****数据类** 两个新类别。
@@ -1168,7 +1440,6 @@ timeline: true
- Tree 组件升级 `rc-tree``1.12.0`
- 🌟 新增 `loadedKeys` 属性,用于设置已经加载的节点,需要配合 `loadData` 使用。[#10666](https://github.com/ant-design/ant-design/issues/10666)
- 🌟 新增 `onLoad` 属性,作为节点加载完毕时的回调函数。[c488aca](https://github.com/ant-design/ant-design/commit/c488aca05e11d942d77c1b6bff45d12bbb1a2bd6)
- 🌟 增加 `okButtonDisabled` and `cancelButtonDisabled` 属性用于禁用确定和取消按钮。[#10955](https://github.com/ant-design/ant-design/pull/10955)
- 🌟 Cascader 新增 fieldNames 并废弃拼写错误的 filedNames。[#10896](https://github.com/ant-design/ant-design/issues/10896)
- 🐞 修复时间轴不能与`Tooltip`一起使用的问题。[0e3b67e](https://github.com/ant-design/ant-design/commit/0e3b67e9999d867cc304f3be61a8a042a2ab92ee)
- 🐞 修复当 Avatar 自定义大小时,圆角不改变的问题。[e1e6523](https://github.com/ant-design/ant-design/commit/e1e6523452286ba56f20b73abad762a58ea7d7bc)
@@ -1791,8 +2062,8 @@ timeline: true
### 以下在 2.x 中废弃的特性被移除
- 🗑 移除了 DatePicker.Calendar 请直接使用 Calendar 组件。
- 🗑 移除了 DatePicker 的 `toggleOpen` 属性, 请使用 `onOpenChange` 代替。
- 🗑 移除了 DatePicker.Calendar请直接使用 Calendar 组件。
- 🗑 移除了 DatePicker 的 `toggleOpen` 属性,请使用 `onOpenChange` 代替。
- 🗑 移除了 Form 的 `inline`、`horizontal`、`vertical` 属性,请使用 `layout` 代替。
- 🗑 移除了 Select 的 `multiple`、`tags`、`combobox` 属性,请使用 `mode` 代替。
- 🗑 移除了 Input 对 `type='textarea'` 的支持,请直接使用 `Input.TextArea` 组件。

View File

@@ -80,6 +80,11 @@ import 'antd/dist/antd.css'; // or 'antd/dist/antd.less'
- [更新日志](CHANGELOG.en-US.md)
- [React 底层基础组件](http://react-component.github.io/)
- [移动端组件](http://mobile.ant.design)
- [Ant Design 图标](https://github.com/ant-design/ant-design-icons)
- [Ant Design 色彩](https://github.com/ant-design/ant-design-colors)
- [Ant Design Pro 布局组件](https://github.com/ant-design/ant-design-pro-layout)
- [Ant Design Pro 区块集](https://github.com/ant-design/pro-blocks)
- [Dark Theme](https://github.com/ant-design/ant-design-dark-theme)
- [首页模板集](https://landing.ant.design)
- [动效](https://motion.ant.design)
- [脚手架市场](http://scaffold.ant.design)

View File

@@ -80,6 +80,11 @@ See [i18n](http://ant.design/docs/react/i18n).
- [Change Log](CHANGELOG.en-US.md)
- [rc-components](http://react-component.github.io/)
- [Mobile UI](http://mobile.ant.design)
- [Ant Design Icons](https://github.com/ant-design/ant-design-icons)
- [Ant Design Colors](https://github.com/ant-design/ant-design-colors)
- [Ant Design Pro Layout](https://github.com/ant-design/ant-design-pro-layout)
- [Ant Design Pro Blocks](https://github.com/ant-design/pro-blocks)
- [Dark Theme](https://github.com/ant-design/ant-design-dark-theme)
- [Landing Pages](https://landing.ant.design)
- [Motion](https://motion.ant.design)
- [Scaffold Market](http://scaffold.ant.design)

View File

@@ -21,6 +21,7 @@ Array [
"Comment",
"ConfigProvider",
"DatePicker",
"Descriptions",
"Divider",
"Dropdown",
"Drawer",
@@ -34,6 +35,7 @@ Array [
"LocaleProvider",
"message",
"Menu",
"Mentions",
"Modal",
"Statistic",
"notification",
@@ -44,6 +46,7 @@ Array [
"Progress",
"Radio",
"Rate",
"Result",
"Row",
"Select",
"Skeleton",

View File

@@ -1,11 +1,14 @@
import raf from 'raf';
import React from 'react';
import { mount } from 'enzyme';
import KeyCode from 'rc-util/lib/KeyCode';
import delayRaf from '../raf';
import throttleByAnimationFrame from '../throttleByAnimationFrame';
import getDataOrAriaProps from '../getDataOrAriaProps';
import triggerEvent from '../triggerEvent';
import Wave from '../wave';
import TransButton from '../transButton';
import openAnimation from '../openAnimation';
describe('Test utils function', () => {
beforeAll(() => {
@@ -163,5 +166,58 @@ describe('Test utils function', () => {
).instance();
expect(wrapper.bindAnimationEvent()).toBe(undefined);
});
it('should not throw when click it', () => {
expect(() => {
const wrapper = mount(
<Wave>
<div />
</Wave>,
);
wrapper.simulate('click');
}).not.toThrow();
});
it('should not throw when no children', () => {
if (process.env.REACT === '15') {
return;
}
expect(() => mount(<Wave />)).not.toThrow();
});
});
describe('TransButton', () => {
it('can be focus/blur', () => {
const wrapper = mount(<TransButton>TransButton</TransButton>);
expect(typeof wrapper.instance().focus).toBe('function');
expect(typeof wrapper.instance().blur).toBe('function');
});
it('should trigger onClick when press enter', () => {
const onClick = jest.fn();
const preventDefault = jest.fn();
const wrapper = mount(<TransButton onClick={onClick}>TransButton</TransButton>);
wrapper.simulate('keyUp', { keyCode: KeyCode.ENTER });
expect(onClick).toHaveBeenCalled();
wrapper.simulate('keyDown', { keyCode: KeyCode.ENTER, preventDefault });
expect(preventDefault).toHaveBeenCalled();
});
});
describe('openAnimation', () => {
it('should support openAnimation', () => {
const done = jest.fn();
const domNode = document.createElement('div');
expect(typeof openAnimation.enter).toBe('function');
expect(typeof openAnimation.leave).toBe('function');
expect(typeof openAnimation.appear).toBe('function');
const appear = openAnimation.appear(domNode, done);
const enter = openAnimation.enter(domNode, done);
const leave = openAnimation.leave(domNode, done);
expect(typeof appear.stop).toBe('function');
expect(typeof enter.stop).toBe('function');
expect(typeof leave.stop).toBe('function');
expect(done).toHaveBeenCalled();
});
});
});

View File

@@ -1,4 +1,5 @@
// https://github.com/moment/moment/issues/3650
// since we are using ts 3.5.1, it should be safe to remove.
export default function interopDefault(m: any) {
return m.default || m;
}

View File

@@ -0,0 +1,101 @@
// matchMedia polyfill for
// https://github.com/WickyNilliams/enquire.js/issues/82
let enquire: any;
if (typeof window !== 'undefined') {
const matchMediaPolyfill = (mediaQuery: string) => {
return {
media: mediaQuery,
matches: false,
addListener() {},
removeListener() {},
};
};
window.matchMedia = window.matchMedia || matchMediaPolyfill;
enquire = require('enquire.js');
}
export type Breakpoint = 'xxl' | 'xl' | 'lg' | 'md' | 'sm' | 'xs';
export type BreakpointMap = Partial<Record<Breakpoint, string>>;
export const responsiveArray: Breakpoint[] = ['xxl', 'xl', 'lg', 'md', 'sm', 'xs'];
export const responsiveMap: BreakpointMap = {
xs: '(max-width: 575px)',
sm: '(min-width: 576px)',
md: '(min-width: 768px)',
lg: '(min-width: 992px)',
xl: '(min-width: 1200px)',
xxl: '(min-width: 1600px)',
};
type SubscribeFunc = (screens: BreakpointMap) => void;
let subscribers: Array<{
token: string;
func: SubscribeFunc;
}> = [];
let subUid = -1;
let screens = {};
const responsiveObserve = {
dispatch(pointMap: BreakpointMap) {
screens = pointMap;
if (subscribers.length < 1) {
return false;
}
subscribers.forEach(item => {
item.func(screens);
});
return true;
},
subscribe(func: SubscribeFunc) {
if (subscribers.length === 0) {
this.register();
}
const token = (++subUid).toString();
subscribers.push({
token: token,
func: func,
});
func(screens);
return token;
},
unsubscribe(token: string) {
subscribers = subscribers.filter(item => item.token !== token);
if (subscribers.length === 0) {
this.unregister();
}
},
unregister() {
Object.keys(responsiveMap).map((screen: Breakpoint) =>
enquire.unregister(responsiveMap[screen]),
);
},
register() {
Object.keys(responsiveMap).map((screen: Breakpoint) =>
enquire.register(responsiveMap[screen], {
match: () => {
const pointMap = {
...screens,
[screen]: true,
};
this.dispatch(pointMap);
},
unmatch: () => {
const pointMap = {
...screens,
[screen]: false,
};
this.dispatch(pointMap);
},
// Keep a empty destory to avoid triggering unmatch when unregister
destroy() {},
}),
);
},
};
export default responsiveObserve;

View File

@@ -158,7 +158,7 @@ export default class Wave extends React.Component<{ insertExtraNode?: boolean }>
componentDidMount() {
const node = findDOMNode(this) as HTMLElement;
if (node.nodeType !== 1) {
if (!node || node.nodeType !== 1) {
return;
}
this.instance = this.bindAnimationEvent(node);

View File

@@ -162,29 +162,37 @@ describe('Affix Render', () => {
});
});
it('updatePosition when size changed', () => {
document.body.innerHTML = '<div id="mounter" />';
describe('updatePosition when size changed', () => {
function test(name, index) {
it(name, () => {
document.body.innerHTML = '<div id="mounter" />';
const updateCalled = jest.fn();
wrapper = mount(<AffixMounter offsetBottom={0} onTestUpdatePosition={updateCalled} />, {
attachTo: document.getElementById('mounter'),
});
const updateCalled = jest.fn();
wrapper = mount(<AffixMounter offsetBottom={0} onTestUpdatePosition={updateCalled} />, {
attachTo: document.getElementById('mounter'),
});
jest.runAllTimers();
jest.runAllTimers();
movePlaceholder(300);
expect(wrapper.instance().affix.state.affixStyle).toBeTruthy();
jest.runAllTimers();
wrapper.update();
movePlaceholder(300);
expect(wrapper.instance().affix.state.affixStyle).toBeTruthy();
jest.runAllTimers();
wrapper.update();
// Mock trigger resize
updateCalled.mockReset();
wrapper
.find('ReactResizeObserver')
.instance()
.onResize();
jest.runAllTimers();
// Mock trigger resize
updateCalled.mockReset();
wrapper
.find('ReactResizeObserver')
.at(index)
.instance()
.onResize();
jest.runAllTimers();
expect(updateCalled).toHaveBeenCalled();
expect(updateCalled).toHaveBeenCalled();
});
}
test('inner', 0);
test('outer', 1);
});
});

View File

@@ -34,6 +34,37 @@ exports[`renders ./components/affix/demo/basic.md correctly 1`] = `
</div>
`;
exports[`renders ./components/affix/demo/debug.md correctly 1`] = `
<div
style="height:10000px"
>
<div>
Top
</div>
<div>
<div
class=""
>
<div
style="background:red"
>
<button
class="ant-btn ant-btn-primary"
type="button"
>
<span>
Affix top
</span>
</button>
</div>
</div>
</div>
<div>
Bottom
</div>
</div>
`;
exports[`renders ./components/affix/demo/on-change.md correctly 1`] = `
<div>
<div

View File

@@ -0,0 +1,50 @@
---
order: 99
title:
zh-CN: 调试
en-US: Debug
debug: true
---
## zh-CN
DEBUG
## en-US
DEBUG
```jsx
import { Affix, Button } from 'antd';
class Demo extends React.Component {
state = {
top: 10,
};
render() {
return (
<div style={{ height: 10000 }}>
<div>Top</div>
<Affix offsetTop={this.state.top}>
<div style={{ background: 'red' }}>
<Button
type="primary"
onClick={() => {
this.setState({
top: this.state.top + 10,
});
}}
>
Affix top
</Button>
</div>
</Affix>
<div>Bottom</div>
</div>
);
}
}
ReactDOM.render(<Demo />, mountNode);
```

View File

@@ -14,12 +14,12 @@ Please note that Affix should not cover other content on the page, especially wh
## API
| Property | Description | Type | Default |
| --- | --- | --- | --- |
| offsetBottom | Pixels to offset from bottom when calculating position of scroll | number | - |
| offsetTop | Pixels to offset from top when calculating position of scroll | number | 0 |
| target | specifies the scrollable area dom node | () => HTMLElement | () => window |
| onChange | Callback for when affix state is changed | Function(affixed) | - |
| Property | Description | Type | Default | Version |
| --- | --- | --- | --- | --- |
| offsetBottom | Pixels to offset from bottom when calculating position of scroll | number | - | |
| offsetTop | Pixels to offset from top when calculating position of scroll | number | 0 | |
| target | specifies the scrollable area dom node | () => HTMLElement | () => window | |
| onChange | Callback for when affix state is changed | Function(affixed) | - | |
**Note:** Children of `Affix` can not be `position: absolute`, but you can set `Affix` as `position: absolute`:

View File

@@ -256,8 +256,8 @@ class Affix extends React.Component<AffixProps, AffixState> {
// =================== Render ===================
renderAffix = ({ getPrefixCls }: ConfigConsumerProps) => {
const { affixStyle, placeholderStyle, status } = this.state;
const { prefixCls, style, children } = this.props;
const { affixStyle, placeholderStyle } = this.state;
const { prefixCls, children } = this.props;
const className = classNames({
[getPrefixCls('affix', prefixCls)]: affixStyle,
});
@@ -267,16 +267,26 @@ class Affix extends React.Component<AffixProps, AffixState> {
if (process.env.NODE_ENV === 'test') {
props = omit(props, ['onTestUpdatePosition']);
}
const mergedPlaceholderStyle = {
...(status === AffixStatus.None ? placeholderStyle : null),
...style,
};
return (
<div {...props} style={mergedPlaceholderStyle} ref={this.savePlaceholderNode}>
<div className={className} ref={this.saveFixedNode} style={this.state.affixStyle}>
<ResizeObserver onResize={this.updatePosition}>{children}</ResizeObserver>
<ResizeObserver
onResize={() => {
this.updatePosition();
}}
>
<div {...props} ref={this.savePlaceholderNode}>
{affixStyle && <div style={placeholderStyle} aria-hidden="true" />}
<div className={className} ref={this.saveFixedNode} style={affixStyle}>
<ResizeObserver
onResize={() => {
this.updatePosition();
}}
>
{children}
</ResizeObserver>
</div>
</div>
</div>
</ResizeObserver>
);
};

View File

@@ -15,12 +15,12 @@ title: Affix
## API
| 成员 | 说明 | 类型 | 默认值 |
| --- | --- | --- | --- |
| offsetBottom | 距离窗口底部达到指定偏移量后触发 | number | |
| offsetTop | 距离窗口顶部达到指定偏移量后触发 | number | |
| target | 设置 `Affix` 需要监听其滚动事件的元素,值为一个返回对应 DOM 元素的函数 | () => HTMLElement | () => window |
| onChange | 固定状态改变时触发的回调函数 | Function(affixed) | 无 |
| 成员 | 说明 | 类型 | 默认值 | 版本 |
| --- | --- | --- | --- | --- |
| offsetBottom | 距离窗口底部达到指定偏移量后触发 | number | | |
| offsetTop | 距离窗口顶部达到指定偏移量后触发 | number | | |
| target | 设置 `Affix` 需要监听其滚动事件的元素,值为一个返回对应 DOM 元素的函数 | () => HTMLElement | () => window | |
| onChange | 固定状态改变时触发的回调函数 | Function(affixed) | 无 | |
**注意:**`Affix` 内的元素不要使用绝对定位,如需要绝对定位的效果,可以直接设置 `Affix` 为绝对定位:

View File

@@ -13,15 +13,15 @@ Alert component for feedback.
## API
| Property | Description | Type | Default |
| --- | --- | --- | --- |
| afterClose | Called when close animation is finished | () => void | - |
| banner | Whether to show as banner | boolean | false |
| closable | Whether Alert can be closed | boolean | - |
| closeText | Close text to show | string\|ReactNode | - |
| description | Additional content of Alert | string\|ReactNode | - |
| icon | Custom icon, effective when `showIcon` is `true` | ReactNode | - |
| message | Content of Alert | string\|ReactNode | - |
| showIcon | Whether to show icon | boolean | false, in `banner` mode default is true |
| type | Type of Alert styles, options: `success`, `info`, `warning`, `error` | string | `info`, in `banner` mode default is `warning` |
| onClose | Callback when Alert is closed | (e: MouseEvent) => void | - |
| Property | Description | Type | Default | Version |
| --- | --- | --- | --- | --- |
| afterClose | Called when close animation is finished | () => void | - | 3.3.1 |
| banner | Whether to show as banner | boolean | false | |
| closable | Whether Alert can be closed | boolean | - | |
| closeText | Close text to show | string\|ReactNode | - | |
| description | Additional content of Alert | string\|ReactNode | - | |
| icon | Custom icon, effective when `showIcon` is `true` | ReactNode | - | 3.10.0 |
| message | Content of Alert | string\|ReactNode | - | |
| showIcon | Whether to show icon | boolean | false, in `banner` mode default is true | |
| type | Type of Alert styles, options: `success`, `info`, `warning`, `error` | string | `info`, in `banner` mode default is `warning` | |
| onClose | Callback when Alert is closed | (e: MouseEvent) => void | - | |

View File

@@ -14,15 +14,15 @@ title: Alert
## API
| 参数 | 说明 | 类型 | 默认值 |
| --- | --- | --- | --- |
| afterClose | 关闭动画结束后触发的回调函数 | () => void | - |
| banner | 是否用作顶部公告 | boolean | false |
| closable | 默认不显示关闭按钮 | boolean | 无 |
| closeText | 自定义关闭按钮 | string\|ReactNode | 无 |
| description | 警告提示的辅助性文字介绍 | string\|ReactNode | 无 |
| icon | 自定义图标,`showIcon``true` 时有效 | ReactNode | - |
| message | 警告提示内容 | string\|ReactNode | 无 |
| showIcon | 是否显示辅助图标 | boolean | false`banner` 模式下默认值为 true |
| type | 指定警告提示的样式,有四种选择 `success``info``warning``error` | string | `info``banner` 模式下默认值为 `warning` |
| onClose | 关闭时触发的回调函数 | (e: MouseEvent) => void | 无 |
| 参数 | 说明 | 类型 | 默认值 | 版本 |
| --- | --- | --- | --- | --- |
| afterClose | 关闭动画结束后触发的回调函数 | () => void | - | 3.3.1 |
| banner | 是否用作顶部公告 | boolean | false | |
| closable | 默认不显示关闭按钮 | boolean | 无 | |
| closeText | 自定义关闭按钮 | string\|ReactNode | 无 | |
| description | 警告提示的辅助性文字介绍 | string\|ReactNode | 无 | |
| icon | 自定义图标,`showIcon``true` 时有效 | ReactNode | - | 3.10.0 |
| message | 警告提示内容 | string\|ReactNode | 无 | |
| showIcon | 是否显示辅助图标 | boolean | false`banner` 模式下默认值为 true | |
| type | 指定警告提示的样式,有四种选择 `success``info``warning``error` | string | `info``banner` 模式下默认值为 `warning` | |
| onClose | 关闭时触发的回调函数 | (e: MouseEvent) => void | 无 | |

View File

@@ -124,6 +124,10 @@
font-size: @font-size-lg;
}
&-message {
color: @alert-message-color;
}
&-with-description &-description {
display: block;
}

View File

@@ -145,6 +145,8 @@ export default class Anchor extends React.Component<AnchorProps, AnchorState> {
};
private inkNode: HTMLSpanElement;
// scroll scope's container
private scrollContainer: HTMLElement | Window;
private links: string[] = [];
private scrollEvent: any;
@@ -174,7 +176,8 @@ export default class Anchor extends React.Component<AnchorProps, AnchorState> {
componentDidMount() {
const { getContainer } = this.props as AnchorDefaultProps;
this.scrollEvent = addEventListener(getContainer(), 'scroll', this.handleScroll);
this.scrollContainer = getContainer();
this.scrollEvent = addEventListener(this.scrollContainer, 'scroll', this.handleScroll);
this.handleScroll();
}
@@ -185,6 +188,16 @@ export default class Anchor extends React.Component<AnchorProps, AnchorState> {
}
componentDidUpdate() {
if (this.scrollEvent) {
const { getContainer } = this.props as AnchorDefaultProps;
const currentContainer = getContainer();
if (this.scrollContainer !== currentContainer) {
this.scrollContainer = currentContainer;
this.scrollEvent.remove();
this.scrollEvent = addEventListener(this.scrollContainer, 'scroll', this.handleScroll);
this.handleScroll();
}
}
this.updateInk();
}
@@ -192,10 +205,14 @@ export default class Anchor extends React.Component<AnchorProps, AnchorState> {
if (this.animating) {
return;
}
const { activeLink } = this.state;
const { offsetTop, bounds } = this.props;
this.setState({
activeLink: this.getCurrentAnchor(offsetTop, bounds),
});
const currentActiveLink = this.getCurrentAnchor(offsetTop, bounds);
if (activeLink !== currentActiveLink) {
this.setState({
activeLink: currentActiveLink,
});
}
};
handleScrollTo = (link: string) => {

View File

@@ -9,7 +9,7 @@ export interface AnchorLinkProps {
prefixCls?: string;
href: string;
title: React.ReactNode;
children?: any;
children?: React.ReactNode;
className?: string;
}

View File

@@ -4,6 +4,8 @@ import Anchor from '..';
const { Link } = Anchor;
const delay = timeout => new Promise(resolve => setTimeout(resolve, timeout));
describe('Anchor Render', () => {
it('Anchor render perfectly', () => {
const wrapper = mount(
@@ -62,7 +64,7 @@ describe('Anchor Render', () => {
wrapper.instance().handleScrollTo('##API');
expect(wrapper.instance().state.activeLink).toBe('##API');
expect(scrollToSpy).not.toHaveBeenCalled();
await new Promise(resolve => setTimeout(resolve, 1000));
await delay(1000);
expect(scrollToSpy).toHaveBeenCalled();
});
@@ -130,4 +132,116 @@ describe('Anchor Render', () => {
expect(event).not.toBe(undefined);
expect(link).toEqual({ href, title });
});
it('Different function returns the same DOM', async () => {
let root = document.getElementById('root');
if (!root) {
root = document.createElement('div', { id: 'root' });
root.id = 'root';
document.body.appendChild(root);
}
mount(<div id="API">Hello</div>, { attachTo: root });
const getContainerA = () => {
return document.getElementById('API');
};
const getContainerB = () => {
return document.getElementById('API');
};
const wrapper = mount(
<Anchor getContainer={getContainerA}>
<Link href="#API" title="API" />
</Anchor>,
);
const removeListenerSpy = jest.spyOn(wrapper.instance().scrollEvent, 'remove');
await delay(1000);
wrapper.setProps({ getContainer: getContainerB });
expect(removeListenerSpy).not.toHaveBeenCalled();
});
it('Different function returns different DOM', async () => {
let root = document.getElementById('root');
if (!root) {
root = document.createElement('div', { id: 'root' });
root.id = 'root';
document.body.appendChild(root);
}
mount(
<div>
<div id="API1">Hello</div>
<div id="API2">World</div>
</div>,
{ attachTo: root },
);
const getContainerA = () => {
return document.getElementById('API1');
};
const getContainerB = () => {
return document.getElementById('API2');
};
const wrapper = mount(
<Anchor getContainer={getContainerA}>
<Link href="#API1" title="API1" />
<Link href="#API2" title="API2" />
</Anchor>,
);
const removeListenerSpy = jest.spyOn(wrapper.instance().scrollEvent, 'remove');
expect(removeListenerSpy).not.toHaveBeenCalled();
await delay(1000);
wrapper.setProps({ getContainer: getContainerB });
expect(removeListenerSpy).toHaveBeenCalled();
});
it('Same function returns the same DOM', () => {
let root = document.getElementById('root');
if (!root) {
root = document.createElement('div', { id: 'root' });
root.id = 'root';
document.body.appendChild(root);
}
mount(<div id="API">Hello</div>, { attachTo: root });
const getContainer = () => document.getElementById('API');
const wrapper = mount(
<Anchor getContainer={getContainer}>
<Link href="#API" title="API" />
</Anchor>,
);
wrapper.find('a[href="#API"]').simulate('click');
wrapper.instance().handleScroll();
expect(wrapper.instance().state).not.toBe(null);
});
it('Same function returns different DOM', async () => {
let root = document.getElementById('root');
if (!root) {
root = document.createElement('div', { id: 'root' });
root.id = 'root';
document.body.appendChild(root);
}
mount(
<div>
<div id="API1">Hello</div>
<div id="API2">World</div>
</div>,
{ attachTo: root },
);
const holdContainer = {
container: document.getElementById('API1'),
};
const getContainer = () => {
return holdContainer.container;
};
const wrapper = mount(
<Anchor getContainer={getContainer}>
<Link href="#API1" title="API1" />
<Link href="#API2" title="API2" />
</Anchor>,
);
const removeListenerSpy = jest.spyOn(wrapper.instance().scrollEvent, 'remove');
expect(removeListenerSpy).not.toHaveBeenCalled();
await delay(1000);
holdContainer.container = document.getElementById('API2');
wrapper.setProps({ 'data-only-trigger-re-render': true });
expect(removeListenerSpy).toHaveBeenCalled();
});
});

View File

@@ -15,19 +15,19 @@ For displaying anchor hyperlinks on page and jumping between them.
### Anchor Props
| Property | Description | Type | Default |
| --- | --- | --- | --- |
| affix | Fixed mode of Anchor | boolean | true |
| bounds | Bounding distance of anchor area | number | 5(px) |
| getContainer | Scrolling container | () => HTMLElement | () => window |
| offsetBottom | Pixels to offset from bottom when calculating position of scroll | number | - |
| offsetTop | Pixels to offset from top when calculating position of scroll | number | 0 |
| showInkInFixed | Whether show ink-balls in Fixed mode | boolean | false |
| onClick | set the handler to handle `click` event | Function(e: Event, link: Object) | - |
| Property | Description | Type | Default | Version |
| --- | --- | --- | --- | --- |
| affix | Fixed mode of Anchor | boolean | true | |
| bounds | Bounding distance of anchor area | number | 5(px) | |
| getContainer | Scrolling container | () => HTMLElement | () => window | 3.4.0 |
| offsetBottom | Pixels to offset from bottom when calculating position of scroll | number | - | |
| offsetTop | Pixels to offset from top when calculating position of scroll | number | 0 | |
| showInkInFixed | Whether show ink-balls in Fixed mode | boolean | false | |
| onClick | set the handler to handle `click` event | Function(e: Event, link: Object) | - | 3.9.0 |
### Link Props
| Property | Description | Type | Default |
| -------- | -------------------- | ----------------- | ------- |
| href | target of hyperlink | string | |
| title | content of hyperlink | string\|ReactNode | |
| Property | Description | Type | Default | Version |
| -------- | -------------------- | ----------------- | ------- | ------- |
| href | target of hyperlink | string | | |
| title | content of hyperlink | string\|ReactNode | | |

View File

@@ -16,19 +16,19 @@ title: Anchor
### Anchor Props
| 成员 | 说明 | 类型 | 默认值 |
| --- | --- | --- | --- |
| affix | 固定模式 | boolean | true |
| bounds | 锚点区域边界 | number | 5(px) |
| getContainer | 指定滚动的容器 | () => HTMLElement | () => window |
| offsetBottom | 距离窗口底部达到指定偏移量后触发 | number | |
| offsetTop | 距离窗口顶部达到指定偏移量后触发 | number | |
| showInkInFixed | 固定模式是否显示小圆点 | boolean | false |
| onClick | `click` 事件的 handler | Function(e: Event, link: Object) | - |
| 成员 | 说明 | 类型 | 默认值 | 版本 |
| --- | --- | --- | --- | --- |
| affix | 固定模式 | boolean | true | |
| bounds | 锚点区域边界 | number | 5(px) | |
| getContainer | 指定滚动的容器 | () => HTMLElement | () => window | 3.4.0 |
| offsetBottom | 距离窗口底部达到指定偏移量后触发 | number | | |
| offsetTop | 距离窗口顶部达到指定偏移量后触发 | number | | |
| showInkInFixed | 固定模式是否显示小圆点 | boolean | false | |
| onClick | `click` 事件的 handler | Function(e: Event, link: Object) | - | 3.9.0 |
### Link Props
| 成员 | 说明 | 类型 | 默认值 |
| ----- | -------- | ----------------- | ------ |
| href | 锚点链接 | string | |
| title | 文字内容 | string\|ReactNode | |
| 成员 | 说明 | 类型 | 默认值 | 版本 |
| ----- | -------- | ----------------- | ------ | ---- |
| href | 锚点链接 | string | | |
| title | 文字内容 | string\|ReactNode | | |

View File

@@ -443,6 +443,7 @@ exports[`renders ./components/auto-complete/demo/uncertain-category.md correctly
>
<button
class="ant-btn search-btn ant-btn-primary ant-btn-lg"
style="margin-right:-12px"
type="button"
>
<i

View File

@@ -16,12 +16,11 @@ Demonstration of [Lookup Patterns: Certain Category](https://ant.design/docs/spe
```jsx
import { Icon, Input, AutoComplete } from 'antd';
const Option = AutoComplete.Option;
const OptGroup = AutoComplete.OptGroup;
const { Option, OptGroup } = AutoComplete;
const dataSource = [
{
title: '话题',
title: 'Libraries',
children: [
{
title: 'AntDesign',
@@ -34,23 +33,23 @@ const dataSource = [
],
},
{
title: '问题',
title: 'Solutions',
children: [
{
title: 'AntDesign UI 有多好',
title: 'AntDesign UI',
count: 60100,
},
{
title: 'AntDesign 是啥',
title: 'AntDesign',
count: 30010,
},
],
},
{
title: '文章',
title: 'Articles',
children: [
{
title: 'AntDesign 是一个设计语言',
title: 'AntDesign design language',
count: 100000,
},
],
@@ -67,7 +66,7 @@ function renderTitle(title) {
target="_blank"
rel="noopener noreferrer"
>
更多
more
</a>
</span>
);
@@ -79,7 +78,7 @@ const options = dataSource
{group.children.map(opt => (
<Option key={opt.title} value={opt.title}>
{opt.title}
<span className="certain-search-item-count">{opt.count} 关注</span>
<span className="certain-search-item-count">{opt.count} people</span>
</Option>
))}
</OptGroup>
@@ -87,7 +86,7 @@ const options = dataSource
.concat([
<Option disabled key="all" className="show-all">
<a href="https://www.google.com/search?q=antd" target="_blank" rel="noopener noreferrer">
查看所有结果
View all results
</a>
</Option>,
]);

View File

@@ -16,7 +16,7 @@ You could pass `AutoComplete.Option` as children of `AutoComplete`, instead of u
```jsx
import { AutoComplete } from 'antd';
const Option = AutoComplete.Option;
const { Option } = AutoComplete;
class Complete extends React.Component {
state = {

View File

@@ -16,7 +16,7 @@ Demonstration of [Lookup Patterns: Uncertain Category](https://ant.design/docs/s
```jsx
import { Icon, Button, Input, AutoComplete } from 'antd';
const Option = AutoComplete.Option;
const { Option } = AutoComplete;
function onSelect(value) {
console.log('onSelect', value);
@@ -42,7 +42,7 @@ function renderOption(item) {
<Option key={item.category} text={item.category}>
<div className="global-search-item">
<span className="global-search-item-desc">
{item.query}
Found {item.query} on
<a
href={`https://s.taobao.com/search?q=${item.query}`}
target="_blank"
@@ -50,9 +50,8 @@ function renderOption(item) {
>
{item.category}
</a>
区块中
</span>
<span className="global-search-item-count"> {item.count} 个结果</span>
<span className="global-search-item-count">{item.count} results</span>
</div>
</Option>
);
@@ -85,7 +84,12 @@ class Complete extends React.Component {
>
<Input
suffix={
<Button className="search-btn" size="large" type="primary">
<Button
className="search-btn"
style={{ marginRight: -12 }}
size="large"
type="primary"
>
<Icon type="search" />
</Button>
}
@@ -116,10 +120,6 @@ ReactDOM.render(<Complete />, mountNode);
padding-right: 62px;
}
.global-search.ant-select-auto-complete .ant-input-affix-wrapper .ant-input-suffix {
right: 0;
}
.global-search.ant-select-auto-complete .ant-input-affix-wrapper .ant-input-suffix button {
border-top-left-radius: 0;
border-bottom-left-radius: 0;

View File

@@ -18,33 +18,33 @@ const dataSource = ['12345', '23456', '34567'];
<AutoComplete dataSource={dataSource} />;
```
| Property | Description | Type | Default |
| --- | --- | --- | --- |
| allowClear | Show clear button, effective in multiple mode only. | boolean | false |
| autoFocus | get focus when component mounted | boolean | false |
| backfill | backfill selected item the input when using keyboard | boolean | false |
| children (for customize input element) | customize input element | HTMLInputElement / HTMLTextAreaElement / React.ReactElement<InputProps> | `<Input />` |
| children (for dataSource) | Data source for autocomplet | React.ReactElement<OptionProps> / Array&lt;React.ReactElement<OptionProps>> | - |
| dataSource | Data source for autocomplete | [DataSourceItemType](https://git.io/vMMKF)\[] | |
| defaultActiveFirstOption | Whether active first option by default | boolean | true |
| defaultValue | Initial selected option. | string\|string\[]\| - |
| disabled | Whether disabled select | boolean | false |
| filterOption | If true, filter options by input, if function, filter options against it. The function will receive two arguments, `inputValue` and `option`, if the function returns `true`, the option will be included in the filtered set; Otherwise, it will be excluded. | boolean or function(inputValue, option) | true |
| optionLabelProp | Which prop value of option will render as content of select. | string | `children` |
| placeholder | placeholder of input | string | - |
| value | selected option | string\|string\[]\|{ key: string, label: string\|ReactNode }\|Array&lt;{ key: string, label: string\|ReactNode }> | - |
| onBlur | Called when leaving the component. | function() | - |
| onChange | Called when select an option or input value change, or value of input is changed | function(value) | - |
| onFocus | Called when entering the component | function() | - |
| onSearch | Called when searching items. | function(value) | - |
| onSelect | Called when a option is selected. param is option's value and option instance. | function(value, option) | - |
| defaultOpen | Initial open state of dropdown | boolean | - |
| open | Controlled open state of dropdown | boolean | - |
| onDropdownVisibleChange | Call when dropdown open | function(open) | - |
| Property | Description | Type | Default | Version |
| --- | --- | --- | --- | --- |
| allowClear | Show clear button, effective in multiple mode only. | boolean | false | |
| autoFocus | get focus when component mounted | boolean | false | |
| backfill | backfill selected item the input when using keyboard | boolean | false | |
| children (for customize input element) | customize input element | HTMLInputElement / HTMLTextAreaElement / React.ReactElement<InputProps> | `<Input />` | |
| children (for dataSource) | Data source for autocomplete | React.ReactElement<OptionProps> / Array&lt;React.ReactElement<OptionProps>> | - | |
| dataSource | Data source for autocomplete | [DataSourceItemType](https://git.io/vMMKF)\[] | - | |
| defaultActiveFirstOption | Whether active first option by default | boolean | true | |
| defaultValue | Initial selected option. | string\|string\[] | - | |
| disabled | Whether disabled select | boolean | false | |
| filterOption | If true, filter options by input, if function, filter options against it. The function will receive two arguments, `inputValue` and `option`, if the function returns `true`, the option will be included in the filtered set; Otherwise, it will be excluded. | boolean or function(inputValue, option) | true | |
| optionLabelProp | Which prop value of option will render as content of select. | string | `children` | |
| placeholder | placeholder of input | string | - | |
| value | selected option | string\|string\[]\|{ key: string, label: string\|ReactNode }\|Array&lt;{ key: string, label: string\|ReactNode }> | - | |
| onBlur | Called when leaving the component. | function() | - | 3.6.5 |
| onChange | Called when select an option or input value change, or value of input is changed | function(value) | - | |
| onFocus | Called when entering the component | function() | - | 3.6.5 |
| onSearch | Called when searching items. | function(value) | - | |
| onSelect | Called when a option is selected. param is option's value and option instance. | function(value, option) | - | |
| defaultOpen | Initial open state of dropdown | boolean | - | 3.9.3 |
| open | Controlled open state of dropdown | boolean | - | 3.9.3 |
| onDropdownVisibleChange | Call when dropdown open | function(open) | - | 3.9.3 |
## Methods
| Name | Description |
| ------- | ------------ |
| blur() | remove focus |
| focus() | get focus |
| Name | Description | Version |
| ------- | ------------ | ------- |
| blur() | remove focus | |
| focus() | get focus | |

View File

@@ -5,6 +5,7 @@ import InputElement from './InputElement';
import Input, { InputProps } from '../input';
import Select, { AbstractSelectProps, SelectValue, OptionProps, OptGroupProps } from '../select';
import { ConfigConsumer, ConfigConsumerProps } from '../config-provider';
import { Omit } from '../_util/type';
export interface DataSourceItemObject {
value: string;
@@ -26,7 +27,7 @@ export type ValidInputElement =
| HTMLTextAreaElement
| React.ReactElement<AutoCompleteInputProps>;
export interface AutoCompleteProps extends AbstractSelectProps {
export interface AutoCompleteProps extends Omit<AbstractSelectProps, 'loading'> {
value?: SelectValue;
defaultValue?: SelectValue;
dataSource?: DataSourceItemType[];

View File

@@ -19,33 +19,34 @@ const dataSource = ['12345', '23456', '34567'];
<AutoComplete dataSource={dataSource} />;
```
| 参数 | 说明 | 类型 | 默认值 |
| --- | --- | --- | --- |
| allowClear | 支持清除, 单选模式有效 | boolean | false |
| autoFocus | 自动获取焦点 | boolean | false |
| backfill | 使用键盘选择选项的时候把选中项回填到输入框中 | boolean | false |
| children (自动完成的数据源) | 自动完成的数据源 | React.ReactElement<OptionProps> / Array&lt;React.ReactElement<OptionProps>> | - |
| children (自定义输入框) | 自定义输入框 | HTMLInputElement / HTMLTextAreaElement / React.ReactElement<InputProps> | `<Input />` |
| dataSource | 自动完成的数据源 | [DataSourceItemType](https://git.io/vMMKF)\[] | |
| defaultActiveFirstOption | 是否默认高亮第一个选项。 | boolean | true |
| defaultValue | 指定默认选中的条目 | string\|string\[]\| 无 |
| disabled | 是否禁用 | boolean | false |
| filterOption | 是否根据输入项进行筛选。当其为一个函数时,会接收 `inputValue` `option` 两个参数,当 `option` 符合筛选条件时,应返回 `true`,反之则返回 `false`。 | boolean or function(inputValue, option) | true |
| optionLabelProp | 回填到选择框的 Option 的属性值,默认是 Option 的子元素。比如在子元素需要高亮效果时,此值可以设为 `value`。 | string | `children` |
| placeholder | 输入框提示 | string | - |
| value | 指定当前选中的条目 | string\|string\[]\|{ key: string, label: string\|ReactNode }\|Array&lt;{ key: string, label: string\|ReactNode }> | |
| onBlur | 失去焦点时的回调 | function() | - |
| onChange | 选中 option或 input 的 value 变化时,调用此函数 | function(value) | 无 |
| onFocus | 获得焦点时的回调 | function() | - |
| onSearch | 搜索补全项的时候调用 | function(value) | 无 |
| onSelect | 被选中时调用,参数为选中项的 value 值 | function(value, option) | 无 |
| defaultOpen | 是否默认展开下拉菜单 | boolean | - |
| open | 是否展开下拉菜单 | boolean | - |
| onDropdownVisibleChange | 展开下拉菜单的回调 | function(open) | - |
| 参数 | 说明 | 类型 | 默认值 | 版本 |
| --- | --- | --- | --- | --- |
| allowClear | 支持清除, 单选模式有效 | boolean | false | |
| autoFocus | 自动获取焦点 | boolean | false | |
| backfill | 使用键盘选择选项的时候把选中项回填到输入框中 | boolean | false | |
| children (自动完成的数据源) | 自动完成的数据源 | React.ReactElement<OptionProps> / Array&lt;React.ReactElement<OptionProps>> | - | | |
| children (自定义输入框) | 自定义输入框 | HTMLInputElement / HTMLTextAreaElement / React.ReactElement<InputProps> | `<Input />` | @todo.muyu |
| dataSource | 自动完成的数据源 | [DataSourceItemType](https://git.io/vMMKF)\[] | | |
| defaultActiveFirstOption | 是否默认高亮第一个选项。 | boolean | true | |
| defaultValue | 指定默认选中的条目 | string\|string\[]\| 无 | |
| disabled | 是否禁用 | boolean | false | |
| filterOption | 是否根据输入项进行筛选。当其为一个函数时,会接收 `inputValue` `option` 两个参数,当 `option` 符合筛选条件时,应返回 `true`,反之则返回 `false`。 | boolean or function(inputValue, option) | true | |
| getPopupContainer | 菜单渲染父节点。默认渲染到 body 上,如果你遇到菜单滚动定位问题,试试修改为滚动的区域,并相对其定位。[示例](https://codesandbox.io/s/4j168r7jw0) | Function(triggerNode) | () => document.body | 3.19.4 |
| optionLabelProp | 回填到选择框的 Option 的属性值,默认是 Option 的子元素。比如在子元素需要高亮效果时,此值可以设为 `value`。 | string | `children` | |
| placeholder | 输入框提示 | string | - | |
| value | 指定当前选中的条目 | string\|string\[]\|{ key: string, label: string\|ReactNode }\|Array&lt;{ key: string, label: string\|ReactNode }> | 无 | |
| onBlur | 失去焦点时的回调 | function() | - | 3.6.5 |
| onChange | 选中 option或 input 的 value 变化时,调用此函数 | function(value) | 无 | |
| onFocus | 获得焦点时的回调 | function() | - | 3.6.5 |
| onSearch | 搜索补全项的时候调用 | function(value) | 无 | |
| onSelect | 被选中时调用,参数为选中项的 value 值 | function(value, option) | 无 | |
| defaultOpen | 是否默认展开下拉菜单 | boolean | - | 3.9.3 |
| open | 是否展开下拉菜单 | boolean | - | 3.9.3 |
| onDropdownVisibleChange | 展开下拉菜单的回调 | function(open) | - | 3.9.3 |
## 方法
| 名称 | 描述 |
| ------- | -------- |
| blur() | 移除焦点 |
| focus() | 获取焦点 |
| 名称 | 描述 | 版本 |
| ------- | -------- | ---- |
| blur() | 移除焦点 | |
| focus() | 获取焦点 | |

View File

@@ -8,12 +8,12 @@ Avatars can be used to represent people or objects. It supports images, `Icon`s,
## API
| Property | Description | Type | Default |
| --- | --- | --- | --- |
| icon | the `Icon` type for an icon avatar, see `Icon` Component | string | - |
| shape | the shape of avatar | `circle` \| `square` | `circle` |
| size | the size of the avatar | number \| string: `large` `small` `default` | `default` |
| src | the address of the image for an image avatar | string | - |
| srcSet | a list of sources to use for different screen resolutions | string | - |
| alt | This attribute defines the alternative text describing the image | string | - |
| onError | handler when img load error, return false to prevent default fallback behavior | () => boolean | - |
| Property | Description | Type | Default | Version |
| --- | --- | --- | --- | --- |
| icon | the `Icon` type for an icon avatar, see `Icon` Component | string | - | |
| shape | the shape of avatar | `circle` \| `square` | `circle` | |
| size | the size of the avatar | number \| string: `large` `small` `default` | `default` | |
| src | the address of the image for an image avatar | string | - | |
| srcSet | a list of sources to use for different screen resolutions | string | - | 3.11.0 |
| alt | This attribute defines the alternative text describing the image | string | - | 3.7.0 |
| onError | handler when img load error, return false to prevent default fallback behavior | () => boolean | - | 3.8.0 |

View File

@@ -20,7 +20,7 @@ export interface AvatarProps {
style?: React.CSSProperties;
prefixCls?: string;
className?: string;
children?: any;
children?: React.ReactNode;
alt?: string;
/* callback when img load error */
/* return false to prevent Avatar show default fallback behavior, then you can do fallback by your self*/

View File

@@ -13,12 +13,12 @@ title: Avatar
## API
| 参数 | 说明 | 类型 | 默认值 |
| --- | --- | --- | --- |
| icon | 设置头像的图标类型,参考 `Icon` 组件 | string | - |
| shape | 指定头像的形状 | Enum{ 'circle', 'square' } | `circle` |
| size | 设置头像的大小 | number \| Enum{ 'large', 'small', 'default' } | `default` |
| src | 图片类头像的资源地址 | string | - |
| srcSet | 设置图片类头像响应式资源地址 | string | - |
| alt | 图像无法显示时的替代文本 | string | - |
| onError | 图片加载失败的事件,返回 false 会关闭组件默认的 fallback 行为 | () => boolean | - |
| 参数 | 说明 | 类型 | 默认值 | 版本 |
| --- | --- | --- | --- | --- |
| icon | 设置头像的图标类型,参考 `Icon` 组件 | string | - | |
| shape | 指定头像的形状 | Enum{ 'circle', 'square' } | `circle` | |
| size | 设置头像的大小 | number \| Enum{ 'large', 'small', 'default' } | `default` | |
| src | 图片类头像的资源地址 | string | - | |
| srcSet | 设置图片类头像响应式资源地址 | string | - | 3.11.0 |
| alt | 图像无法显示时的替代文本 | string | - | 3.7.0 |
| onError | 图片加载失败的事件,返回 false 会关闭组件默认的 fallback 行为 | () => boolean | - | 3.8.0 |

View File

@@ -17,8 +17,8 @@ title: BackTop
>
> If you decide to use custom styles, please note the size limit: no more than `40px * 40px`.
| Property | Description | Type | Default |
| --- | --- | --- | --- |
| target | specifies the scrollable area dom node | () => HTMLElement | () => window |
| visibilityHeight | the `BackTop` button will not show until the scroll height reaches this value | number | 400 |
| onClick | a callback function, which can be executed when you click the button | Function | - |
| Property | Description | Type | Default | Version |
| --- | --- | --- | --- | --- |
| target | specifies the scrollable area dom node | () => HTMLElement | () => window | |
| visibilityHeight | the `BackTop` button will not show until the scroll height reaches this value | number | 400 | |
| onClick | a callback function, which can be executed when you click the button | Function | - | |

View File

@@ -25,7 +25,7 @@ function getDefaultTarget() {
export interface BackTopProps {
visibilityHeight?: number;
onClick?: React.MouseEventHandler<any>;
onClick?: React.MouseEventHandler<HTMLElement>;
target?: () => HTMLElement | Window;
prefixCls?: string;
className?: string;

View File

@@ -18,8 +18,8 @@ title: BackTop
>
> 自定义样式宽高不大于 40px \* 40px。
| 参数 | 说明 | 类型 | 默认值 |
| --- | --- | --- | --- |
| target | 设置需要监听其滚动事件的元素,值为一个返回对应 DOM 元素的函数 | Function | () => window |
| visibilityHeight | 滚动高度达到此参数值才出现 `BackTop` | number | 400 |
| onClick | 点击按钮的回调函数 | Function | - |
| 参数 | 说明 | 类型 | 默认值 | 版本 |
| --- | --- | --- | --- | --- |
| target | 设置需要监听其滚动事件的元素,值为一个返回对应 DOM 元素的函数 | Function | () => window | |
| visibilityHeight | 滚动高度达到此参数值才出现 `BackTop` | number | 400 | |
| onClick | 点击按钮的回调函数 | Function | - | |

View File

@@ -22,7 +22,7 @@ export interface ScrollNumberProps {
prefixCls?: string;
className?: string;
count?: string | number | null;
displayComponent?: React.ReactElement<any>;
displayComponent?: React.ReactElement<HTMLElement>;
component?: string;
onAnimated?: Function;
style?: React.CSSProperties;
@@ -89,22 +89,24 @@ class ScrollNumber extends Component<ScrollNumberProps, ScrollNumberState> {
componentDidUpdate(_: any, prevState: ScrollNumberState) {
this.lastCount = prevState.count;
const { animateStarted } = this.state;
const { onAnimated } = this.props;
if (animateStarted) {
this.setState(
{
(__, props) => ({
animateStarted: false,
count: this.props.count,
},
() => {
if (onAnimated) {
onAnimated();
}
},
count: props.count,
}),
this.onAnimated,
);
}
}
onAnimated = () => {
const { onAnimated } = this.props;
if (onAnimated) {
onAnimated();
}
};
renderNumberList(position: number) {
const childrenToReturn: React.ReactElement<any>[] = [];
for (let i = 0; i < 30; i++) {

View File

@@ -32,4 +32,4 @@ Badge normally appears in proximity to notifications or user avatars with eye-ca
| showZero | Whether to show badge when `count` is zero | boolean | `false` | |
| status | Set Badge as a status dot | `success` \| `processing` \| `default` \| `error` \| `warning` | `''` | |
| text | If `status` is set, `text` sets the display text of the status `dot` | string | `''` | |
| title | Text to show when hovering over the badge | string | `count` | |
| title | Text to show when hovering over the badge | string | `count` | 3.5.0 |

View File

@@ -33,4 +33,4 @@ title: Badge
| showZero | 当数值为 0 时,是否展示 Badge | boolean | false | |
| status | 设置 Badge 为状态点 | Enum{ 'success', 'processing, 'default', 'error', 'warning' } | '' | |
| text | 在设置了 `status` 的前提下有效,设置状态点的文本 | string | '' | |
| title | 设置鼠标放在状态点上时显示的文字 | string | `count` | |
| title | 设置鼠标放在状态点上时显示的文字 | string | `count` | 3.5.0 |

View File

@@ -11,7 +11,7 @@ import { Omit } from '../_util/type';
export interface Route {
path: string;
breadcrumbName: string;
children: Omit<Route, 'children'>[];
children?: Omit<Route, 'children'>[];
}
export interface BreadcrumbProps {
@@ -20,9 +20,9 @@ export interface BreadcrumbProps {
params?: any;
separator?: React.ReactNode;
itemRender?: (
route: any,
route: Route,
params: any,
routes: Array<any>,
routes: Array<Route>,
paths: Array<string>,
) => React.ReactNode;
style?: React.CSSProperties;
@@ -59,8 +59,6 @@ export default class Breadcrumb extends React.Component<BreadcrumbProps, any> {
separator: PropTypes.node,
routes: PropTypes.array,
params: PropTypes.object,
linkRender: PropTypes.func,
nameRender: PropTypes.func,
};
componentDidMount() {
@@ -72,6 +70,24 @@ export default class Breadcrumb extends React.Component<BreadcrumbProps, any> {
'see: https://u.ant.design/item-render.',
);
}
getPath = (path: string, params: any) => {
path = (path || '').replace(/^\//, '');
Object.keys(params).forEach(key => {
path = path.replace(`:${key}`, params[key]);
});
return path;
};
addChildPath = (paths: string[], childPath: string = '', params: any) => {
const originalPaths = [...paths];
const path = this.getPath(childPath, params);
if (path) {
originalPaths.push(path);
}
return originalPaths;
};
genForRoutes = ({
routes = [],
params = {},
@@ -80,11 +96,7 @@ export default class Breadcrumb extends React.Component<BreadcrumbProps, any> {
}: BreadcrumbProps) => {
const paths: string[] = [];
return routes.map(route => {
route.path = route.path || '';
let path = route.path.replace(/^\//, '');
Object.keys(params).forEach(key => {
path = path.replace(`:${key}`, params[key]);
});
const path = this.getPath(route.path, params);
if (path) {
paths.push(path);
@@ -96,7 +108,7 @@ export default class Breadcrumb extends React.Component<BreadcrumbProps, any> {
<Menu>
{route.children.map(child => (
<Menu.Item key={child.breadcrumbName || child.path}>
{itemRender(child, params, routes, paths)}
{itemRender(child, params, routes, this.addChildPath(paths, child.path, params))}
</Menu.Item>
))}
</Menu>

View File

@@ -71,10 +71,10 @@ export default class BreadcrumbItem extends React.Component<BreadcrumbItemProps,
if (overlay) {
return (
<DropDown overlay={overlay} placement="bottomCenter">
<a className={`${prefixCls}-overlay-link`}>
<span className={`${prefixCls}-overlay-link`}>
{breadcrumbItem}
<Icon type="down" />
</a>
</span>
</DropDown>
);
}

View File

@@ -71,42 +71,43 @@ exports[`Breadcrumb should render a menu 1`] = `
</span>
</span>
<span>
<a
<span
class="ant-breadcrumb-overlay-link ant-dropdown-trigger"
>
<span
class="ant-breadcrumb-link"
/>
</a>
<a
href="#/index/first"
>
<a
href="#/index/first"
>
first
</a>
</span>
<i
aria-label="icon: down"
class="anticon anticon-down"
>
<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-breadcrumb-separator"
>
first
</a>
</span>
<i
aria-label="icon: down"
class="anticon anticon-down"
>
<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
class="ant-breadcrumb-separator"
>
/
/
</span>
</span>
<span>
<span

View File

@@ -64,89 +64,88 @@ exports[`renders ./components/breadcrumb/demo/basic.md correctly 1`] = `
`;
exports[`renders ./components/breadcrumb/demo/overlay.md correctly 1`] = `
<div>
<div
class="ant-breadcrumb"
>
<span>
<span
class="ant-breadcrumb-link"
>
Ant Design
</span>
<span
class="ant-breadcrumb-separator"
>
/
</span>
<div
class="ant-breadcrumb"
>
<span>
<span
class="ant-breadcrumb-link"
>
Ant Design
</span>
<span>
<span
class="ant-breadcrumb-separator"
>
/
</span>
</span>
<span>
<span
class="ant-breadcrumb-link"
>
<a
href=""
>
Component
</a>
</span>
<span
class="ant-breadcrumb-separator"
>
/
</span>
</span>
<span>
<span
class="ant-breadcrumb-overlay-link ant-dropdown-trigger"
>
<span
class="ant-breadcrumb-link"
>
<a
href=""
>
Component
General
</a>
</span>
<span
class="ant-breadcrumb-separator"
<i
aria-label="icon: down"
class="anticon anticon-down"
>
/
</span>
<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>
<a
class="ant-breadcrumb-overlay-link ant-dropdown-trigger"
>
<span
class="ant-breadcrumb-link"
/>
</a>
<a
href=""
>
General
</a>
</span>
<i
aria-label="icon: down"
class="anticon anticon-down"
>
<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
class="ant-breadcrumb-separator"
>
/
</span>
<span>
<span
class="ant-breadcrumb-link"
>
Button
</span>
<span
class="ant-breadcrumb-separator"
>
/
</span>
</span>
<span>
<span
class="ant-breadcrumb-link"
>
Button
</span>
</div>
<span
class="ant-breadcrumb-separator"
>
/
</span>
</span>
</div>
`;

View File

@@ -37,18 +37,16 @@ const menu = (
);
ReactDOM.render(
<div>
<Breadcrumb>
<Breadcrumb.Item>Ant Design</Breadcrumb.Item>
<Breadcrumb.Item>
<a href="">Component</a>
</Breadcrumb.Item>
<Breadcrumb.Item overlay={menu}>
<a href="">General</a>
</Breadcrumb.Item>
<Breadcrumb.Item>Button</Breadcrumb.Item>
</Breadcrumb>
</div>,
<Breadcrumb>
<Breadcrumb.Item>Ant Design</Breadcrumb.Item>
<Breadcrumb.Item>
<a href="">Component</a>
</Breadcrumb.Item>
<Breadcrumb.Item overlay={menu}>
<a href="">General</a>
</Breadcrumb.Item>
<Breadcrumb.Item>Button</Breadcrumb.Item>
</Breadcrumb>,
mountNode,
);
```

View File

@@ -15,12 +15,12 @@ A breadcrumb displays the current location within a hierarchy. It allows going b
## API
| Property | Description | Type | Optional | Default |
| --- | --- | --- | --- | --- |
| itemRender | Custom item renderer | (route, params, routes, paths) => ReactNode | | - |
| params | Routing parameters | object | | - |
| routes | The routing stack information of router | [routes\[\]](#routes) | | - |
| separator | Custom separator | string\|ReactNode | | `/` |
| Property | Description | Type | Optional | Default | Version |
| --- | --- | --- | --- | --- | --- |
| itemRender | Custom item renderer | (route, params, routes, paths) => ReactNode | | - | |
| params | Routing parameters | object | | - | |
| routes | The routing stack information of router | [routes\[\]](#routes) | | - | |
| separator | Custom separator | string\|ReactNode | | `/` | |
### Use with browserHistory

View File

@@ -17,21 +17,20 @@ title: Breadcrumb
### Breadcrumb
| 参数 | 说明 | 类型 | 默认值 |
| --- | --- | --- | --- |
| itemRender | 自定义链接函数,和 react-router 配置使用 | (route, params, routes, paths) => ReactNode | - |
| params | 路由的参数 | object | - |
| routes | router 的路由栈信息 | [routes\[\]](#routes) | - |
| separator | 分隔符自定义 | string\|ReactNode | '/' |
| 参数 | 说明 | 类型 | 默认值 | 版本 |
| --- | --- | --- | --- | --- |
| itemRender | 自定义链接函数,和 react-router 配置使用 | (route, params, routes, paths) => ReactNode | - | 3.17.0 |
| params | 路由的参数 | object | - | 3.17.0 |
| routes | router 的路由栈信息 | [routes\[\]](#routes) | - | 3.17.0 |
| separator | 分隔符自定义 | string\|ReactNode | '/' | 3.17.0 |
### Breadcrumb.Item
| 参数 | 参数 | 类型 | 默认值 |
| --------- | -------------- | -------------------------------------- | ------ |
| href | 链接的目的地 | string | - |
| separator | 自定义的分隔符 | string\|ReactNode | '/' |
| overlay | 下来菜单的内容 | [Menu](/components/menu) \| () => Menu | - |
| onClick | 单击事件 | (e:MouseEventHandler)=>void | - |
| 参数 | 参数 | 类型 | 默认值 | 版本 |
| ------- | -------------- | -------------------------------------- | ------ | ------ |
| href | 链接的目的地 | string | - | 3.17.0 |
| overlay | 下拉菜单的内容 | [Menu](/components/menu) \| () => Menu | - | 3.17.0 |
| onClick | 单击事件 | (e:MouseEvent)=>void | - | 3.17.0 |
### routes

View File

@@ -211,6 +211,17 @@ exports[`Button should has click wave effect 1`] = `
</button>
`;
exports[`Button should merge text if children using variable 1`] = `
<button
class="ant-btn"
type="button"
>
<span>
This is a test 1
</span>
</button>
`;
exports[`Button should not render as link button when href is undefined 1`] = `
<button
class="ant-btn ant-btn-primary"

View File

@@ -157,4 +157,15 @@ describe('Button', () => {
);
expect(wrapper.render()).toMatchSnapshot();
});
// https://github.com/ant-design/ant-design/issues/15342
it('should merge text if children using variable', () => {
const wrapper = mount(
<Button>
This {'is'} a test {1}
</Button>,
);
expect(wrapper.render()).toMatchSnapshot();
});
});

View File

@@ -15,6 +15,29 @@ function isString(str: any) {
return typeof str === 'string';
}
function spaceChildren(children: React.ReactNode, needInserted: boolean) {
let isPrevChildPure: boolean = false;
const childList: React.ReactNode[] = [];
React.Children.forEach(children, child => {
const type = typeof child;
const isCurrentChildPure = type === 'string' || type === 'number';
if (isPrevChildPure && isCurrentChildPure) {
const lastIndex = childList.length - 1;
const lastChild = childList[lastIndex];
childList[lastIndex] = `${lastChild}${child}`;
} else {
childList.push(child);
}
isPrevChildPure = isCurrentChildPure;
});
// Pass to React.Children.map to auto fill key
return React.Children.map(childList, child =>
insertSpace(child as React.ReactChild, needInserted),
);
}
// Insert one space between two chinese characters automatically.
function insertSpace(child: React.ReactChild, needInserted: boolean) {
// Check the child if is undefined or null.
@@ -68,15 +91,15 @@ export interface BaseButtonProps {
export type AnchorButtonProps = {
href: string;
target?: string;
onClick?: React.MouseEventHandler<any>;
onClick?: React.MouseEventHandler<HTMLElement>;
} & BaseButtonProps &
Omit<React.AnchorHTMLAttributes<any>, 'type'>;
Omit<React.AnchorHTMLAttributes<any>, 'type' | 'onClick'>;
export type NativeButtonProps = {
htmlType?: ButtonHTMLType;
onClick?: React.MouseEventHandler<any>;
onClick?: React.MouseEventHandler<HTMLElement>;
} & BaseButtonProps &
Omit<React.ButtonHTMLAttributes<any>, 'type'>;
Omit<React.ButtonHTMLAttributes<any>, 'type' | 'onClick'>;
export type ButtonProps = Partial<AnchorButtonProps & NativeButtonProps>;
@@ -243,9 +266,7 @@ class Button extends React.Component<ButtonProps, ButtonState> {
const iconNode = iconType ? <Icon type={iconType} /> : null;
const kids =
children || children === 0
? React.Children.map(children, child =>
insertSpace(child as React.ReactChild, this.isNeedInserted() && autoInsertSpace),
)
? spaceChildren(children, this.isNeedInserted() && autoInsertSpace)
: null;
const linkButtonRestProps = omit(rest as AnchorButtonProps, ['htmlType']);
@@ -268,7 +289,7 @@ class Button extends React.Component<ButtonProps, ButtonState> {
const buttonNode = (
<button
{...otherProps as NativeButtonProps}
{...(otherProps as NativeButtonProps)}
type={htmlType}
className={classes}
onClick={this.handleClick}

View File

@@ -7,11 +7,11 @@ title:
## zh-CN
按钮有种类型:主按钮、次按钮、虚线按钮、危险按钮。主按钮在同一个操作区域最多出现一次。
按钮有种类型:主按钮、次按钮、虚线按钮、危险按钮和链接按钮。主按钮在同一个操作区域最多出现一次。
## en-US
There are `primary` button, `default` button, `dashed` button and `danger` button in antd.
There are `primary` button, `default` button, `dashed` button, `danger` button and `link` button in antd.
```jsx
import { Button } from 'antd';

View File

@@ -30,7 +30,7 @@ class ButtonSize extends React.Component {
};
render() {
const size = this.state.size;
const { size } = this.state;
return (
<div>
<Radio.Group value={size} onChange={this.handleSizeChange}>

View File

@@ -14,32 +14,30 @@ A button means an operation (or a series of operations). Clicking a button will
To get a customized button, just set `type`/`shape`/`size`/`loading`/`disabled`.
| Property | Description | Type | Default |
| --- | --- | --- | --- |
| disabled | disabled state of button | boolean | `false` |
| ghost | make background transparent and invert text and border colors, added in 2.7 | boolean | `false` |
| href | redirect url of link button | string | - |
| htmlType | set the original html `type` of `button`, see: [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#attr-type) | string | `button` |
| icon | set the icon of button, see: Icon component | string | - |
| loading | set the loading status of button | boolean \| { delay: number } | `false` |
| shape | can be set to `circle`, `round` or omitted | string | - |
| size | can be set to `small` `large` or omitted | string | `default` |
| target | same as target attribute of a, works when href is specified | string | - |
| type | can be set to `primary` `ghost` `dashed` `danger` `link`(added in 3.17) or omitted (meaning `default`) | string | `default` |
| onClick | set the handler to handle `click` event | (event) => void | - |
| block | option to fit button width to its parent width | boolean | `false` |
| Property | Description | Type | Default | Version |
| --- | --- | --- | --- | --- |
| disabled | disabled state of button | boolean | `false` | 3.5.1 |
| ghost | make background transparent and invert text and border colors, added in 2.7 | boolean | `false` | |
| href | redirect url of link button | string | - | |
| htmlType | set the original html `type` of `button`, see: [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#attr-type) | string | `button` | |
| icon | set the icon of button, see: Icon component | string | - | |
| loading | set the loading status of button | boolean \| { delay: number } | `false` | |
| shape | can be set to `circle`, `round` or omitted | string | - | |
| size | can be set to `small` `large` or omitted | string | `default` | |
| target | same as target attribute of a, works when href is specified | string | - | |
| type | can be set to `primary` `ghost` `dashed` `danger` `link`(added in 3.17) or omitted (meaning `default`) | string | `default` | |
| onClick | set the handler to handle `click` event | (event) => void | - | |
| block | option to fit button width to its parent width | boolean | `false` | 3.8.0 |
It accepts all props which native button support.
`<Button>Hello world!</Button>` will be rendered into `<button><span>Hello world!</span></button>`, and all the properties which are not listed above will be transferred to the `<button>` tag.
`<Button href="http://example.com">Hello world!</Button>` will be rendered into `<a href="http://example.com"><span>Hello world!</span></a>`.
## FAQ
### How to remove space between 2 chinese characters
### How to remove space between 2 chinese characters?
Use [ConfigProvider](/components/config-provider/#API) to set `autoInsertSpaceInButton` as `false`.
Following Ant Design specification, we will add one space between if Button contains two chinese characters only. If you don't need that, you can use [ConfigProvider](/components/config-provider/#API) to set `autoInsertSpaceInButton` as `false`.
![](https://gw.alipayobjects.com/zos/antfincdn/Hz5HL9gsT4/f29f170d-b78d-4d2b-aa71-0da6a9ead4d9.png)
<style>
[id^=components-button-demo-] .ant-btn {

View File

@@ -17,32 +17,30 @@ subtitle: 按钮
按钮的属性说明如下:
| 属性 | 说明 | 类型 | 默认值 |
| --- | --- | --- | --- |
| disabled | 按钮失效状态 | boolean | `false` |
| ghost | 幽灵属性,使按钮背景透明,版本 2.7 中增加 | boolean | false |
| href | 点击跳转的地址,指定此属性 button 的行为和 a 链接一致 | string | - |
| htmlType | 设置 `button` 原生的 `type` 值,可选值请参考 [HTML 标准](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#attr-type) | string | `button` |
| icon | 设置按钮的图标类型 | string | - |
| loading | 设置按钮载入状态 | boolean \| { delay: number } | `false` |
| shape | 设置按钮形状,可选值为 `circle``round` 或者不设 | string | - |
| size | 设置按钮大小,可选值为 `small` `large` 或者不设 | string | `default` |
| target | 相当于 a 链接的 target 属性href 存在时生效 | string | - |
| type | 设置按钮类型,可选值为 `primary` `dashed` `danger` `link`(3.17 中增加) 或者不设 | string | - |
| onClick | 点击按钮时的回调 | (event) => void | - |
| block | 将按钮宽度调整为其父宽度的选项 | boolean | `false` |
| 属性 | 说明 | 类型 | 默认值 | 版本 |
| --- | --- | --- | --- | --- |
| disabled | 按钮失效状态 | boolean | `false` | 3.5.1 |
| ghost | 幽灵属性,使按钮背景透明,版本 2.7 中增加 | boolean | false | |
| href | 点击跳转的地址,指定此属性 button 的行为和 a 链接一致 | string | - | |
| htmlType | 设置 `button` 原生的 `type` 值,可选值请参考 [HTML 标准](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#attr-type) | string | `button` | |
| icon | 设置按钮的图标类型 | string | - | |
| loading | 设置按钮载入状态 | boolean \| { delay: number } | `false` | |
| shape | 设置按钮形状,可选值为 `circle``round` 或者不设 | string | - | |
| size | 设置按钮大小,可选值为 `small` `large` 或者不设 | string | `default` | |
| target | 相当于 a 链接的 target 属性href 存在时生效 | string | - | |
| type | 设置按钮类型,可选值为 `primary` `dashed` `danger` `link`(3.17 中增加) 或者不设 | string | - | |
| onClick | 点击按钮时的回调 | (event) => void | - | |
| block | 将按钮宽度调整为其父宽度的选项 | boolean | `false` | 3.8.0 |
支持原生 button 的其他所有属性。
`<Button>Hello world!</Button>` 最终会被渲染为 `<button><span>Hello world!</span></button>`,并且除了上表中的属性,其它属性都会直接传到原生 button 上。
`<Button href="http://example.com">Hello world!</Button>` 则会渲染为 `<a href="http://example.com"><span>Hello world!</span></a>`
## FAQ
### 如何移除 2 个汉字之间的空格
### 如何移除个汉字之间的空格
设置 [ConfigProvider](/components/config-provider/#API) 的 `autoInsertSpaceInButton``false`
根据 Ant Design 设计规范要求,我们会在按钮内只有两个汉字时自动添加空格,如果你不需要这个特性,可以设置 [ConfigProvider](/components/config-provider/#API) 的 `autoInsertSpaceInButton``false`
![](https://gw.alipayobjects.com/zos/antfincdn/Hz5HL9gsT4/f29f170d-b78d-4d2b-aa71-0da6a9ead4d9.png)
<style>
[id^="components-button-demo-"] .ant-btn {

View File

@@ -24,6 +24,7 @@
> i,
> span {
display: inline-block;
transition: margin-left 0.3s @ease-in-out;
pointer-events: none;
}
@@ -166,7 +167,7 @@
}
&-background-ghost&-danger {
.button-variant-ghost(@btn-danger-color);
.button-variant-ghost(@btn-danger-border);
}
&-background-ghost&-link {

View File

@@ -66,26 +66,6 @@
}
.button-disabled();
}
.button-variant-danger(@color; @background; @border) {
.button-color(@color; @background; @border);
&:hover {
.button-color(
@btn-primary-color; ~`colorPalette('@{color}', 5) `; ~`colorPalette('@{color}', 5) `
);
}
&:focus {
.button-color(
~`colorPalette('@{color}', 5) `; @component-background; ~`colorPalette('@{color}', 5) `
);
}
&:active,
&.active {
.button-color(
@btn-primary-color; ~`colorPalette('@{color}', 7) `; ~`colorPalette('@{color}', 7) `
);
}
.button-disabled();
}
.button-variant-ghost(@color; @border: @color) {
.button-color(@color; transparent; @border);
text-shadow: none;
@@ -230,7 +210,7 @@
}
// danger button style
.btn-danger() {
.button-variant-danger(@btn-danger-color, @btn-danger-bg, @btn-danger-border);
.button-variant-primary(@btn-danger-color, @btn-danger-bg);
}
// link button style
.btn-link() {

View File

@@ -3,7 +3,16 @@ import * as moment from 'moment';
import Select from '../select';
import { Group, Button, RadioChangeEvent } from '../radio';
import { ConfigConsumer, ConfigConsumerProps } from '../config-provider';
const Option = Select.Option;
const { Option } = Select;
export interface RenderHeader {
value: moment.Moment;
onChange?: (value: moment.Moment) => void;
type: string;
onTypeChange: (type: string) => void;
}
export type HeaderRender = (headerRender: RenderHeader) => React.ReactNode;
export interface HeaderProps {
prefixCls?: string;
@@ -14,8 +23,9 @@ export interface HeaderProps {
type?: string;
onValueChange?: (value: moment.Moment) => void;
onTypeChange?: (type: string) => void;
value: any;
value: moment.Moment;
validRange?: [moment.Moment, moment.Moment];
headerRender?: HeaderRender;
}
export default class Header extends React.Component<HeaderProps, any> {
@@ -79,6 +89,7 @@ export default class Header extends React.Component<HeaderProps, any> {
start = rangeStart.get('month');
}
}
for (let index = start; index < end; index++) {
options.push(<Option key={`${index}`}>{months[index]}</Option>);
}
@@ -128,10 +139,14 @@ export default class Header extends React.Component<HeaderProps, any> {
}
};
onTypeChange = (e: RadioChangeEvent) => {
onInternalTypeChange = (e: RadioChangeEvent) => {
this.onTypeChange(e.target.value as string);
};
onTypeChange = (type: string) => {
const onTypeChange = this.props.onTypeChange;
if (onTypeChange) {
onTypeChange(e.target.value);
onTypeChange(type);
}
};
@@ -139,26 +154,53 @@ export default class Header extends React.Component<HeaderProps, any> {
this.calenderHeaderNode = node;
};
renderHeader = ({ getPrefixCls }: ConfigConsumerProps) => {
const { prefixCls: customizePrefixCls, type, value, locale, fullscreen } = this.props;
getMonthYearSelections = (getPrefixCls: ConfigConsumerProps['getPrefixCls']) => {
const { prefixCls: customizePrefixCls, type, value } = this.props;
const prefixCls = getPrefixCls('fullcalendar', customizePrefixCls);
const yearSelect = this.getYearSelectElement(prefixCls, value.year());
const monthSelect =
const yearReactNode = this.getYearSelectElement(prefixCls, value.year());
const monthReactNode =
type === 'month'
? this.getMonthSelectElement(prefixCls, value.month(), this.getMonthsLocale(value))
: null;
return {
yearReactNode,
monthReactNode,
};
};
getTypeSwitch = () => {
const { locale, type, fullscreen } = this.props;
const size = fullscreen ? 'default' : 'small';
const typeSwitch = (
<Group onChange={this.onTypeChange} value={type} size={size}>
return (
<Group onChange={this.onInternalTypeChange} value={type} size={size}>
<Button value="month">{locale.month}</Button>
<Button value="year">{locale.year}</Button>
</Group>
);
};
return (
headerRenderCustom = (headerRender: HeaderRender): React.ReactNode => {
const { type, onValueChange, value } = this.props;
return headerRender({
value,
type: type || 'month',
onChange: onValueChange,
onTypeChange: this.onTypeChange,
});
};
renderHeader = ({ getPrefixCls }: ConfigConsumerProps) => {
const { prefixCls, headerRender } = this.props;
const typeSwitch = this.getTypeSwitch();
const { yearReactNode, monthReactNode } = this.getMonthYearSelections(getPrefixCls);
return headerRender ? (
this.headerRenderCustom(headerRender)
) : (
<div className={`${prefixCls}-header`} ref={this.getCalenderHeaderNode}>
{yearSelect}
{monthSelect}
{yearReactNode}
{monthReactNode}
{typeSwitch}
</div>
);

File diff suppressed because it is too large Load Diff

View File

@@ -4,6 +4,9 @@ import { mount } from 'enzyme';
import MockDate from 'mockdate';
import Calendar from '..';
import Header from '../Header';
import Select from '../../select';
import Group from '../../radio/group';
import Button from '../../radio/radioButton';
describe('Calendar', () => {
it('Calendar should be selectable', () => {
@@ -256,4 +259,107 @@ describe('Calendar', () => {
.simulate('change');
expect(onTypeChange).toHaveBeenCalledWith('year');
});
it('headerRender should work correctly', () => {
const onMonthChange = jest.fn();
const onYearChange = jest.fn();
const onTypeChange = jest.fn();
const headerRender = jest.fn(({ value }) => {
const year = value.year();
const options = [];
for (let i = year - 100; i < year + 100; i += 1) {
options.push(
<Select.Option className="year-item" key={i} value={i}>
{i}
</Select.Option>,
);
}
return (
<Select
size="small"
dropdownMatchSelectWidth={false}
className="my-year-select"
onChange={onYearChange}
value={String(year)}
>
{options}
</Select>
);
});
const wrapperWithYear = mount(<Calendar fullscreen={false} headerRender={headerRender} />);
wrapperWithYear.find('.ant-select').simulate('click');
wrapperWithYear.update();
wrapperWithYear
.find('.year-item')
.last()
.simulate('click');
expect(onYearChange).toHaveBeenCalled();
const headerRenderWithMonth = jest.fn(({ value }) => {
const start = 0;
const end = 12;
const monthOptions = [];
const current = value.clone();
const localeData = value.localeData();
const months = [];
for (let i = 0; i < 12; i += 1) {
current.month(i);
months.push(localeData.monthsShort(current));
}
for (let index = start; index < end; index += 1) {
monthOptions.push(
<Select.Option className="month-item" key={`${index}`}>
{months[index]}
</Select.Option>,
);
}
const month = value.month();
return (
<Select
size="small"
dropdownMatchSelectWidth={false}
value={String(month)}
className="my-mont-select"
onChange={onMonthChange}
>
{monthOptions}
</Select>
);
});
const wrapperWithMonth = mount(
<Calendar fullscreen={false} headerRender={headerRenderWithMonth} />,
);
wrapperWithMonth.find('.ant-select').simulate('click');
wrapperWithMonth.update();
wrapperWithMonth
.find('.month-item')
.last()
.simulate('click');
expect(onMonthChange).toHaveBeenCalled();
const headerRenderWithTypeChange = jest.fn(({ type }) => {
return (
<Group size="small" onChange={onTypeChange} value={type}>
<Button value="month">Month</Button>
<Button value="year">Year</Button>
</Group>
);
});
const wrapperWithTypeChange = mount(
<Calendar fullscreen={false} headerRender={headerRenderWithTypeChange} />,
);
wrapperWithTypeChange
.find('.ant-radio-button-input')
.last()
.simulate('change');
expect(onTypeChange).toHaveBeenCalled();
});
});

View File

@@ -0,0 +1,107 @@
---
order: 4
title:
zh-CN: 自定义头部
en-US: Customize Header
---
## zh-CN
自定义日历头部内容。
## en-US
Customize Calendar header content.
```jsx
import { Calendar, Select, Radio, Col, Row } from 'antd';
const { Group, Button } = Radio;
function onPanelChange(value, mode) {
console.log(value, mode);
}
ReactDOM.render(
<div style={{ width: 300, border: '1px solid #d9d9d9', borderRadius: 4 }}>
<Calendar
fullscreen={false}
headerRender={({ value, type, onChange, onTypeChange }) => {
const start = 0;
const end = 12;
const monthOptions = [];
const current = value.clone();
const localeData = value.localeData();
const months = [];
for (let i = 0; i < 12; i++) {
current.month(i);
months.push(localeData.monthsShort(current));
}
for (let index = start; index < end; index++) {
monthOptions.push(
<Select.Option className="month-item" key={`${index}`}>
{months[index]}
</Select.Option>,
);
}
const month = value.month();
const year = value.year();
const options = [];
for (let i = year - 10; i < year + 10; i += 1) {
options.push(
<Select.Option key={i} value={i} className="year-item">
{i}
</Select.Option>,
);
}
return (
<div style={{ padding: 10 }}>
<div style={{ marginBottom: '10px' }}>Custom header </div>
<Row type="flex" justify="space-between">
<Col>
<Group size="small" onChange={e => onTypeChange(e.target.value)} value={type}>
<Button value="month">Month</Button>
<Button value="year">Year</Button>
</Group>
</Col>
<Col>
<Select
size="small"
dropdownMatchSelectWidth={false}
className="my-year-select"
onChange={newYear => {
const now = value.clone().year(newYear);
onChange(now);
}}
value={String(year)}
>
{options}
</Select>
</Col>
<Col>
<Select
size="small"
dropdownMatchSelectWidth={false}
value={String(month)}
onChange={selectedMonth => {
const newValue = value.clone();
newValue.month(parseInt(selectedMonth, 10));
onChange(newValue);
}}
>
{monthOptions}
</Select>
</Col>
</Row>
</div>
);
}}
onPanelChange={onPanelChange}
/>
</div>,
mountNode,
);
```

View File

@@ -29,19 +29,20 @@ When data is in the form of dates, such as schedules, timetables, prices calenda
/>
```
| Property | Description | Type | Default |
| --- | --- | --- | --- |
| dateCellRender | Customize the display of the date cell, the returned content will be appended to the cell | function(date: moment): ReactNode | - |
| dateFullCellRender | Customize the display of the date cell, the returned content will override the cell | function(date: moment): ReactNode | - |
| defaultValue | The date selected by default | [moment](http://momentjs.com/) | default date |
| disabledDate | Function that specifies the dates that cannot be selected | (currentDate: moment) => boolean | - |
| fullscreen | Whether to display in full-screen | boolean | `true` |
| locale | The calendar's locale | object | [default](https://github.com/ant-design/ant-design/blob/master/components/date-picker/locale/example.json) |
| mode | The display mode of the calendar | `month` \| `year` | `month` |
| monthCellRender | Customize the display of the month cell, the returned content will be appended to the cell | function(date: moment): ReactNode | - |
| monthFullCellRender | Customize the display of the month cell, the returned content will override the cell | function(date: moment): ReactNode | - |
| validRange | to set valid range | \[[moment](http://momentjs.com/), [moment](http://momentjs.com/)] | - |
| value | The current selected date | [moment](http://momentjs.com/) | current date |
| onPanelChange | Callback for when panel changes | function(date: moment, mode: string) | - |
| onSelect | Callback for when a date is selected | function(date: moment | - |
| onChange | Callback for when date changes | function(date: moment | - |
| Property | Description | Type | Default | Version |
| --- | --- | --- | --- | --- |
| dateCellRender | Customize the display of the date cell, the returned content will be appended to the cell | function(date: moment): ReactNode | - | |
| dateFullCellRender | Customize the display of the date cell, the returned content will override the cell | function(date: moment): ReactNode | - | |
| defaultValue | The date selected by default | [moment](http://momentjs.com/) | default date | |
| disabledDate | Function that specifies the dates that cannot be selected | (currentDate: moment) => boolean | - | |
| fullscreen | Whether to display in full-screen | boolean | `true` | |
| locale | The calendar's locale | object | [default](https://github.com/ant-design/ant-design/blob/master/components/date-picker/locale/example.json) | |
| mode | The display mode of the calendar | `month` \| `year` | `month` | |
| monthCellRender | Customize the display of the month cell, the returned content will be appended to the cell | function(date: moment): ReactNode | - | |
| monthFullCellRender | Customize the display of the month cell, the returned content will override the cell | function(date: moment): ReactNode | - | |
| validRange | to set valid range | \[[moment](http://momentjs.com/), [moment](http://momentjs.com/)] | - | 3.3.0 |
| value | The current selected date | [moment](http://momentjs.com/) | current date | |
| onPanelChange | Callback for when panel changes | function(date: moment, mode: string) | - | |
| onSelect | Callback for when a date is selected | function(date: moment | - | |
| onChange | Callback for when date changes | function(date: moment | - | 3.8.0 |
| headerRender | render custom header in panel | function(object:{value: moment, type: string, onChange: f(), onTypeChange: f()}) | - | 3.19.0 |

View File

@@ -2,7 +2,7 @@ import * as React from 'react';
import * as PropTypes from 'prop-types';
import * as moment from 'moment';
import FullCalendar from 'rc-calendar/lib/FullCalendar';
import Header from './Header';
import Header, { HeaderRender } from './Header';
import enUS from './locale/en_US';
import LocaleReceiver from '../locale-provider/LocaleReceiver';
import { ConfigConsumer, ConfigConsumerProps } from '../config-provider';
@@ -23,7 +23,6 @@ function zerofixed(v: number) {
}
export type CalendarMode = 'month' | 'year';
export interface CalendarProps {
prefixCls?: string;
className?: string;
@@ -42,6 +41,7 @@ export interface CalendarProps {
onChange?: (date?: moment.Moment) => void;
disabledDate?: (current: moment.Moment) => boolean;
validRange?: [moment.Moment, moment.Moment];
headerRender?: HeaderRender;
}
export interface CalendarState {
@@ -72,6 +72,7 @@ class Calendar extends React.Component<CalendarProps, CalendarState> {
value: PropTypes.object as PropTypes.Requireable<moment.Moment>,
onSelect: PropTypes.func,
onChange: PropTypes.func,
headerRender: PropTypes.func,
};
static getDerivedStateFromProps(nextProps: CalendarProps) {
@@ -205,6 +206,7 @@ class Calendar extends React.Component<CalendarProps, CalendarState> {
style,
className,
fullscreen,
headerRender,
dateFullCellRender,
monthFullCellRender,
} = props;
@@ -237,6 +239,7 @@ class Calendar extends React.Component<CalendarProps, CalendarState> {
<Header
fullscreen={fullscreen}
type={mode}
headerRender={headerRender}
value={value}
locale={locale.lang}
prefixCls={prefixCls}

View File

@@ -30,19 +30,20 @@ title: Calendar
/>
```
| 参数 | 说明 | 类型 | 默认值 |
| --- | --- | --- | --- |
| dateCellRender | 自定义渲染日期单元格,返回内容会被追加到单元格 | function(date: moment): ReactNode | 无 |
| dateFullCellRender | 自定义渲染日期单元格,返回内容覆盖单元格 | function(date: moment): ReactNode | 无 |
| defaultValue | 默认展示的日期 | [moment](http://momentjs.com/) | 默认日期 |
| disabledDate | 不可选择的日期 | (currentDate: moment) => boolean | 无 |
| fullscreen | 是否全屏显示 | boolean | true |
| locale | 国际化配置 | object | [默认配置](https://github.com/ant-design/ant-design/blob/master/components/date-picker/locale/example.json) |
| mode | 初始模式,`month/year` | string | month |
| monthCellRender | 自定义渲染月单元格,返回内容会被追加到单元格 | function(date: moment): ReactNode | 无 |
| monthFullCellRender | 自定义渲染月单元格,返回内容覆盖单元格 | function(date: moment): ReactNode | 无 |
| validRange | 设置可以显示的日期 | \[[moment](http://momentjs.com/), [moment](http://momentjs.com/)] | 无 |
| value | 展示日期 | [moment](http://momentjs.com/) | 当前日期 |
| onPanelChange | 日期面板变化回调 | function(date: moment, mode: string) | 无 |
| onSelect | 点击选择日期回调 | function(date: moment | 无 |
| onChange | 日期变化回调 | function(date: moment | 无 |
| 参数 | 说明 | 类型 | 默认值 | 版本 |
| --- | --- | --- | --- | --- |
| dateCellRender | 自定义渲染日期单元格,返回内容会被追加到单元格 | function(date: moment): ReactNode | 无 | |
| dateFullCellRender | 自定义渲染日期单元格,返回内容覆盖单元格 | function(date: moment): ReactNode | 无 | |
| defaultValue | 默认展示的日期 | [moment](http://momentjs.com/) | 默认日期 | |
| disabledDate | 不可选择的日期 | (currentDate: moment) => boolean | 无 | |
| fullscreen | 是否全屏显示 | boolean | true | |
| locale | 国际化配置 | object | [默认配置](https://github.com/ant-design/ant-design/blob/master/components/date-picker/locale/example.json) | |
| mode | 初始模式,`month/year` | string | month | |
| monthCellRender | 自定义渲染月单元格,返回内容会被追加到单元格 | function(date: moment): ReactNode | 无 | |
| monthFullCellRender | 自定义渲染月单元格,返回内容覆盖单元格 | function(date: moment): ReactNode | 无 | |
| validRange | 设置可以显示的日期 | \[[moment](http://momentjs.com/), [moment](http://momentjs.com/)] | 无 | 3.3.0 |
| value | 展示日期 | [moment](http://momentjs.com/) | 当前日期 | |
| onPanelChange | 日期面板变化回调 | function(date: moment, mode: string) | 无 | |
| onSelect | 点击选择日期回调 | function(date: moment | 无 | |
| onChange | 日期变化回调 | function(date: moment | 无 | 3.8.0 |
| headerRender | 自定义头部内容 | function(object:{value: moment, type: string, onChange: f(), onTypeChange: f()}) | 无 | 3.19.0 |

View File

@@ -0,0 +1,2 @@
import lv_LV from '../../date-picker/locale/lv_LV';
export default lv_LV;

View File

@@ -19,37 +19,37 @@ A card can be used to display content related to a single subject. The content c
### Card
| Property | Description | Type | Default |
| --- | --- | --- | --- |
| actions | The action list, shows at the bottom of the Card. | Array&lt;ReactNode> | - |
| activeTabKey | Current TabPane's key | string | - |
| headStyle | Inline style to apply to the card head | object | - |
| bodyStyle | Inline style to apply to the card content | object | - |
| bordered | Toggles rendering of the border around the card | boolean | `true` |
| cover | Card cover | ReactNode | - |
| defaultActiveTabKey | Initial active TabPane's key, if `activeTabKey` is not set. | string | - |
| extra | Content to render in the top-right corner of the card | string\|ReactNode | - |
| 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&lt;{key: string, tab: ReactNode}> | - |
| size | Size of card | `default` \| `small` | `default` |
| title | Card title | string\|ReactNode | - |
| type | Card style type, can be set to `inner` or not set | string | - |
| onTabChange | Callback when tab is switched | (key) => void | - |
| Property | Description | Type | Default | Version |
| --- | --- | --- | --- | --- |
| actions | The action list, shows at the bottom of the Card. | Array&lt;ReactNode> | - | |
| activeTabKey | Current TabPane's key | string | - | 3.3.0 |
| headStyle | Inline style to apply to the card head | object | - | 3.8.0 |
| bodyStyle | Inline style to apply to the card content | object | - | |
| bordered | Toggles rendering of the border around the card | boolean | `true` | |
| cover | Card cover | ReactNode | - | |
| defaultActiveTabKey | Initial active TabPane's key, if `activeTabKey` is not set. | string | - | 3.3.0 |
| extra | Content to render in the top-right corner of the card | string\|ReactNode | - | |
| 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&lt;{key: string, tab: ReactNode}> | - | |
| 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 | - | |
| onTabChange | Callback when tab is switched | (key) => void | - | |
### Card.Grid
| Property | Description | Type | Default |
| --------- | ------------------------- | ------ | ------- |
| className | className of container | string | - |
| style | style object of container | object | - |
| Property | Description | Type | Default | Version |
| --------- | ------------------------- | ------ | ------- | ------- |
| className | className of container | string | - | |
| style | style object of container | object | - | |
### Card.Meta
| Property | Description | Type | Default |
| ----------- | ------------------------- | --------- | ------- |
| avatar | avatar or icon | ReactNode | - |
| className | className of container | string | - |
| description | description content | ReactNode | - |
| style | style object of container | object | - |
| title | title content | ReactNode | - |
| Property | Description | Type | Default | Version |
| ----------- | ------------------------- | --------- | ------- | ------- |
| avatar | avatar or icon | ReactNode | - | |
| className | className of container | string | - | |
| description | description content | ReactNode | - | |
| style | style object of container | object | - | |
| title | title content | ReactNode | - | |

View File

@@ -20,37 +20,37 @@ cols: 1
### Card
| 参数 | 说明 | 类型 | 默认值 |
| --- | --- | --- | --- |
| actions | 卡片操作组,位置在卡片底部 | Array&lt;ReactNode> | - |
| activeTabKey | 当前激活页签的 key | string | - |
| headStyle | 自定义标题区域样式 | object | - |
| bodyStyle | 内容区域自定义样式 | object | - |
| bordered | 是否有边框 | boolean | true |
| cover | 卡片封面 | ReactNode | - |
| defaultActiveTabKey | 初始化选中页签的 key如果没有设置 activeTabKey | string | 第一个页签 |
| extra | 卡片右上角的操作区域 | string\|ReactNode | - |
| hoverable | 鼠标移过时可浮起 | boolean | false |
| loading | 当卡片内容还在加载中时,可以用 loading 展示一个占位 | boolean | false |
| tabList | 页签标题列表 | Array&lt;{key: string, tab: ReactNode}> | - |
| size | card 的尺寸 | `default` \| `small` | `default` |
| title | 卡片标题 | string\|ReactNode | - |
| type | 卡片类型,可设置为 `inner` 或 不设置 | string | - |
| onTabChange | 页签切换的回调 | (key) => void | - |
| 参数 | 说明 | 类型 | 默认值 | 版本 |
| --- | --- | --- | --- | --- |
| actions | 卡片操作组,位置在卡片底部 | Array&lt;ReactNode> | - | |
| activeTabKey | 当前激活页签的 key | string | - | 3.3.0 |
| headStyle | 自定义标题区域样式 | object | - | 3.8.0 |
| bodyStyle | 内容区域自定义样式 | object | - | |
| bordered | 是否有边框 | boolean | true | |
| cover | 卡片封面 | ReactNode | - | |
| defaultActiveTabKey | 初始化选中页签的 key如果没有设置 activeTabKey | string | 第一个页签 | 3.3.0 |
| extra | 卡片右上角的操作区域 | string\|ReactNode | - | |
| hoverable | 鼠标移过时可浮起 | boolean | false | |
| loading | 当卡片内容还在加载中时,可以用 loading 展示一个占位 | boolean | false | |
| tabList | 页签标题列表 | Array&lt;{key: string, tab: ReactNode}> | - | |
| size | card 的尺寸 | `default` \| `small` | `default` | 3.12.0 |
| title | 卡片标题 | string\|ReactNode | - | |
| type | 卡片类型,可设置为 `inner` 或 不设置 | string | - | |
| onTabChange | 页签切换的回调 | (key) => void | - | |
### Card.Grid
| Property | Description | Type | Default |
| --------- | ---------------------- | ------ | ------- |
| className | 网格容器类名 | string | - |
| style | 定义网格容器类名的样式 | object | - |
| 参数 | 说明 | 类型 | 默认值 | 版本 |
| --------- | ---------------------- | ------ | ------- | ---- |
| className | 网格容器类名 | string | - | |
| style | 定义网格容器类名的样式 | object | - | |
### Card.Meta
| Property | Description | Type | Default |
| ----------- | ------------------ | --------- | ------- |
| avatar | 头像/图标 | ReactNode | - |
| className | 容器类名 | string | - |
| description | 描述内容 | ReactNode | - |
| style | 定义容器类名的样式 | object | - |
| title | 标题内容 | ReactNode | - |
| 参数 | 说明 | 类型 | 默认值 | 版本 |
| ----------- | ------------------ | --------- | ------- | ---- |
| avatar | 头像/图标 | ReactNode | - | |
| className | 容器类名 | string | - | |
| description | 描述内容 | ReactNode | - | |
| style | 定义容器类名的样式 | object | - | |
| title | 标题内容 | ReactNode | - | |

View File

@@ -109,7 +109,7 @@
padding-bottom: 0;
}
&-contain-tabs &-extra {
&-contain-tabs > &-head &-extra {
padding-bottom: 0;
}
@@ -139,7 +139,7 @@
& > span {
position: relative;
display: inline-block;
display: block;
min-width: 32px;
font-size: 14px;
line-height: 22px;
@@ -155,7 +155,8 @@
line-height: 22px;
}
a {
a,
i {
display: inline-block;
width: 100%;
color: @text-color-secondary;
@@ -163,6 +164,7 @@
&:hover {
color: @primary-color;
transition: color 0.3s;
}
}
}

View File

@@ -3,11 +3,11 @@ import { mount } from 'enzyme';
import Carousel from '..';
describe('Carousel', () => {
beforeAll(() => {
beforeEach(() => {
jest.useFakeTimers();
});
afterAll(() => {
afterEach(() => {
jest.useRealTimers();
});
@@ -105,4 +105,29 @@ describe('Carousel', () => {
);
warnSpy.mockRestore();
});
describe('should active when children change', () => {
it('should active', () => {
const wrapper = mount(<Carousel />);
wrapper.setProps({
children: <div />,
});
wrapper.update();
expect(wrapper.find('.slick-active').length).toBeTruthy();
});
it('should keep initialSlide', () => {
const wrapper = mount(<Carousel initialSlide={1} />);
wrapper.setProps({
children: [<div key="1" />, <div key="2" />, <div key="3" />],
});
wrapper.update();
expect(
wrapper
.find('.slick-dots li')
.at(1)
.hasClass('slick-active'),
).toBeTruthy();
});
});
});

View File

@@ -26,10 +26,10 @@ A carousel component. Scales with its container.
## Methods
| Name | Description |
| --- | --- |
| goTo(slideNumber, dontAnimate) | Go to slide index, if dontAnimate=true, it happens without animation |
| next() | Change current slide to next slide |
| prev() | Change current slide to previous slide |
| Name | Description | Version |
| --- | --- | --- |
| goTo(slideNumber, dontAnimate) | Go to slide index, if dontAnimate=true, it happens without animation | 3.9.3 |
| next() | Change current slide to next slide | |
| prev() | Change current slide to previous slide | |
For more info on the parameters, refer to the <https://github.com/akiran/react-slick>

View File

@@ -33,6 +33,7 @@ export interface CarouselProps extends Settings {
prefixCls?: string;
slickGoTo?: number;
dotPosition?: DotPosition;
children?: React.ReactNode;
}
export default class Carousel extends React.Component<CarouselProps, {}> {
@@ -70,6 +71,12 @@ export default class Carousel extends React.Component<CarouselProps, {}> {
this.innerSlider = this.slick && this.slick.innerSlider;
}
componentDidUpdate(prevProps: CarouselProps) {
if (React.Children.count(this.props.children) !== React.Children.count(prevProps.children)) {
this.goTo(this.props.initialSlide || 0, false);
}
}
componentWillUnmount() {
const { autoplay } = this.props;
if (autoplay) {

View File

@@ -17,20 +17,20 @@ subtitle: 走马灯
| 参数 | 说明 | 类型 | 默认值 | 版本 |
| --- | --- | --- | --- | --- |
| afterChange | 切换面板的回调 | function(current) | 无 | |
| autoplay | 是否自动切换 | boolean | false | |
| beforeChange | 切换面板的回调 | function(from, to) | 无 | |
| dotPosition | 面板指示点位置,可选 `top` `bottom` `left` `right` | string | bottom | 3.17.0 |
| dots | 是否显示面板指示点 | boolean | true | |
| easing | 动画效果 | string | linear | |
| effect | 动画效果函数,可取 scrollx, fade | string | scrollx | |
| afterChange | 切换面板的回调 | function(current) | 无 | | |
| autoplay | 是否自动切换 | boolean | false | | |
| beforeChange | 切换面板的回调 | function(from, to) | 无 | | |
| dotPosition | 面板指示点位置,可选 `top` `bottom` `left` `right` | string | bottom | 3.17.0 | 3.17.0 |
| dots | 是否显示面板指示点 | boolean | true | | |
| easing | 动画效果 | string | linear | | |
| effect | 动画效果函数,可取 scrollx, fade | string | scrollx | | |
## 方法
| 名称 | 描述 |
| ------------------------------ | ------------------------------------------------- |
| goTo(slideNumber, dontAnimate) | 切换到指定面板, dontAnimate = true 时,不使用动画 |
| next() | 切换到下一面板 |
| prev() | 切换到上一面板 |
| goTo(slideNumber, dontAnimate) | 切换到指定面板, dontAnimate = true 时,不使用动画 | 3.9.3 |
| next() | 切换到下一面板 | |
| prev() | 切换到上一面板 | |
更多参数可参考:<https://github.com/akiran/react-slick>

View File

@@ -1256,6 +1256,299 @@ exports[`Cascader should render not found content 1`] = `
</Popup>
`;
exports[`Cascader should show not found content when options.length is 0 1`] = `
<Popup
action={
Array [
"click",
]
}
align={
Object {
"offset": Array [
0,
4,
],
"overflow": Object {
"adjustX": 1,
"adjustY": 1,
},
"points": Array [
"tl",
"bl",
],
}
}
className=""
destroyPopupOnHide={false}
getClassNameFromAlign={[Function]}
getRootDomNode={[Function]}
mask={false}
onAlign={[Function]}
onMouseDown={[Function]}
onTouchStart={[Function]}
prefixCls="ant-cascader-menus"
style={Object {}}
transitionName="slide-up"
visible={true}
>
<div>
<Animate
animation={Object {}}
component=""
componentProps={Object {}}
exclusive={true}
onAppear={[Function]}
onEnd={[Function]}
onEnter={[Function]}
onLeave={[Function]}
showProp="xVisible"
transitionAppear={true}
transitionEnter={true}
transitionLeave={true}
transitionName="slide-up"
>
<AnimateChild
animation={Object {}}
key="popup"
transitionAppear={true}
transitionEnter={true}
transitionLeave={true}
transitionName="slide-up"
>
<Align
align={
Object {
"offset": Array [
0,
4,
],
"overflow": Object {
"adjustX": 1,
"adjustY": 1,
},
"points": Array [
"tl",
"bl",
],
}
}
childrenProps={
Object {
"visible": "xVisible",
}
}
disabled={false}
key="popup"
monitorBufferTime={50}
monitorWindowResize={true}
onAlign={[Function]}
target={[Function]}
xVisible={true}
>
<PopupInner
className="ant-cascader-menus ant-cascader-menus-placement-bottomLeft "
hiddenClassName="ant-cascader-menus-hidden"
onMouseDown={[Function]}
onTouchStart={[Function]}
prefixCls="ant-cascader-menus"
style={Object {}}
visible={true}
>
<div
className="ant-cascader-menus ant-cascader-menus-placement-bottomLeft "
onMouseDown={[Function]}
onTouchStart={[Function]}
style={Object {}}
>
<LazyRenderBox
className="ant-cascader-menus-content"
visible={true}
>
<Menus
activeValue={Array []}
allowClear={true}
builtinPlacements={
Object {
"bottomLeft": Object {
"offset": Array [
0,
4,
],
"overflow": Object {
"adjustX": 1,
"adjustY": 1,
},
"points": Array [
"tl",
"bl",
],
},
"bottomRight": Object {
"offset": Array [
0,
4,
],
"overflow": Object {
"adjustX": 1,
"adjustY": 1,
},
"points": Array [
"tr",
"br",
],
},
"topLeft": Object {
"offset": Array [
0,
-4,
],
"overflow": Object {
"adjustX": 1,
"adjustY": 1,
},
"points": Array [
"bl",
"tl",
],
},
"topRight": Object {
"offset": Array [
0,
-4,
],
"overflow": Object {
"adjustX": 1,
"adjustY": 1,
},
"points": Array [
"br",
"tr",
],
},
}
}
defaultFieldNames={
Object {
"children": "children",
"label": "label",
"value": "value",
}
}
disabled={false}
dropdownMenuColumnStyle={
Object {
"height": "auto",
"width": 0,
}
}
expandIcon={
<Icon
type="right"
/>
}
expandTrigger="click"
fieldNames={
Object {
"children": "children",
"label": "label",
"value": "value",
}
}
loadingIcon={
<span
className="ant-cascader-menu-item-loading-icon"
>
<Icon
spin={true}
type="redo"
/>
</span>
}
onChange={[Function]}
onItemDoubleClick={[Function]}
onPopupVisibleChange={[Function]}
onSelect={[Function]}
options={
Array [
Object {
"disabled": true,
"label": <Context.Consumer>
[Function]
</Context.Consumer>,
"value": "ANT_CASCADER_NOT_FOUND",
},
]
}
placeholder="Please select"
popupClassName=""
popupPlacement="bottomLeft"
popupVisible={true}
prefixCls="ant-cascader"
transitionName="slide-up"
value={Array []}
visible={true}
>
<div>
<ul
className="ant-cascader-menu"
key="0"
style={
Object {
"height": "auto",
"width": 0,
}
}
>
<li
className="ant-cascader-menu-item ant-cascader-menu-item-disabled"
key="ANT_CASCADER_NOT_FOUND"
onClick={[Function]}
onDoubleClick={[Function]}
onMouseDown={[Function]}
role="menuitem"
title=""
>
<OriginEmpty
className="ant-empty-small"
image="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNjQiIGhlaWdodD0iNDEiIHZpZXdCb3g9IjAgMCA2NCA0MSIgIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CiAgPGcgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMCAxKSIgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj4KICAgIDxlbGxpcHNlIGZpbGw9IiNGNUY1RjUiIGN4PSIzMiIgY3k9IjMzIiByeD0iMzIiIHJ5PSI3Ii8+CiAgICA8ZyBmaWxsLXJ1bGU9Im5vbnplcm8iIHN0cm9rZT0iI0Q5RDlEOSI+CiAgICAgIDxwYXRoIGQ9Ik01NSAxMi43Nkw0NC44NTQgMS4yNThDNDQuMzY3LjQ3NCA0My42NTYgMCA0Mi45MDcgMEgyMS4wOTNjLS43NDkgMC0xLjQ2LjQ3NC0xLjk0NyAxLjI1N0w5IDEyLjc2MVYyMmg0NnYtOS4yNHoiLz4KICAgICAgPHBhdGggZD0iTTQxLjYxMyAxNS45MzFjMC0xLjYwNS45OTQtMi45MyAyLjIyNy0yLjkzMUg1NXYxOC4xMzdDNTUgMzMuMjYgNTMuNjggMzUgNTIuMDUgMzVoLTQwLjFDMTAuMzIgMzUgOSAzMy4yNTkgOSAzMS4xMzdWMTNoMTEuMTZjMS4yMzMgMCAyLjIyNyAxLjMyMyAyLjIyNyAyLjkyOHYuMDIyYzAgMS42MDUgMS4wMDUgMi45MDEgMi4yMzcgMi45MDFoMTQuNzUyYzEuMjMyIDAgMi4yMzctMS4zMDggMi4yMzctMi45MTN2LS4wMDd6IiBmaWxsPSIjRkFGQUZBIi8+CiAgICA8L2c+CiAgPC9nPgo8L3N2Zz4K"
>
<LocaleReceiver
componentName="Empty"
>
<div
className="ant-empty ant-empty-normal ant-empty-small"
>
<div
className="ant-empty-image"
>
<img
alt="No Data"
src="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNjQiIGhlaWdodD0iNDEiIHZpZXdCb3g9IjAgMCA2NCA0MSIgIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CiAgPGcgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMCAxKSIgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj4KICAgIDxlbGxpcHNlIGZpbGw9IiNGNUY1RjUiIGN4PSIzMiIgY3k9IjMzIiByeD0iMzIiIHJ5PSI3Ii8+CiAgICA8ZyBmaWxsLXJ1bGU9Im5vbnplcm8iIHN0cm9rZT0iI0Q5RDlEOSI+CiAgICAgIDxwYXRoIGQ9Ik01NSAxMi43Nkw0NC44NTQgMS4yNThDNDQuMzY3LjQ3NCA0My42NTYgMCA0Mi45MDcgMEgyMS4wOTNjLS43NDkgMC0xLjQ2LjQ3NC0xLjk0NyAxLjI1N0w5IDEyLjc2MVYyMmg0NnYtOS4yNHoiLz4KICAgICAgPHBhdGggZD0iTTQxLjYxMyAxNS45MzFjMC0xLjYwNS45OTQtMi45MyAyLjIyNy0yLjkzMUg1NXYxOC4xMzdDNTUgMzMuMjYgNTMuNjggMzUgNTIuMDUgMzVoLTQwLjFDMTAuMzIgMzUgOSAzMy4yNTkgOSAzMS4xMzdWMTNoMTEuMTZjMS4yMzMgMCAyLjIyNyAxLjMyMyAyLjIyNyAyLjkyOHYuMDIyYzAgMS42MDUgMS4wMDUgMi45MDEgMi4yMzcgMi45MDFoMTQuNzUyYzEuMjMyIDAgMi4yMzctMS4zMDggMi4yMzctMi45MTN2LS4wMDd6IiBmaWxsPSIjRkFGQUZBIi8+CiAgICA8L2c+CiAgPC9nPgo8L3N2Zz4K"
/>
</div>
<p
className="ant-empty-description"
>
No Data
</p>
</div>
</LocaleReceiver>
</OriginEmpty>
</li>
</ul>
</div>
</Menus>
</LazyRenderBox>
</div>
</PopupInner>
</Align>
</AnimateChild>
</Animate>
</div>
</Popup>
`;
exports[`Cascader support controlled mode 1`] = `
<span
class="ant-cascader-picker"

View File

@@ -398,6 +398,19 @@ describe('Cascader', () => {
errorSpy.mockReset();
});
it('should show not found content when options.length is 0', () => {
const customerOptions = [];
const wrapper = mount(<Cascader options={customerOptions} />);
wrapper.find('input').simulate('click');
const popupWrapper = mount(
wrapper
.find('Trigger')
.instance()
.getComponent(),
);
expect(popupWrapper).toMatchSnapshot();
});
describe('limit filtered item count', () => {
const errorSpy = jest.spyOn(console, 'error').mockImplementation(() => {});
@@ -429,4 +442,33 @@ describe('Cascader', () => {
);
});
});
it('should warning if not find `value` in `options`', () => {
const errorSpy = jest.spyOn(console, 'error').mockImplementation(() => {});
mount(<Cascader options={[{ label: 'a', value: 'a', children: [{ label: 'b' }] }]} />);
expect(errorSpy).toHaveBeenCalledWith(
'Warning: [antd: Cascader] Not found `value` in `options`.',
);
errorSpy.mockRestore();
});
// https://github.com/ant-design/ant-design/issues/17690
it('should not breaks when children is null', () => {
const optionsWithChildrenNull = [
{
value: 'zhejiang',
label: 'Zhejiang',
children: [
{
value: 'hangzhou',
label: 'Hangzhou',
children: null,
},
],
},
];
expect(() => {
mount(<Cascader options={optionsWithChildrenNull} />);
}).not.toThrow();
});
});

View File

@@ -14,53 +14,64 @@ Cascade selection box.
## API
```html
<Cascader options="{options}" onChange="{onChange}" />
```jsx
<Cascader options={options} onChange={onChange} />
```
| Property | Description | Type | Default |
| --- | --- | --- | --- |
| allowClear | whether allow clear | boolean | true |
| autoFocus | get focus when component mounted | boolean | false |
| changeOnSelect | change value on each selection if set to true, see above demo for details | boolean | false |
| className | additional css class | string | - |
| defaultValue | initial selected value | string\[] | \[] |
| disabled | whether disabled select | boolean | false |
| displayRender | render function of displaying selected options | `(label, selectedOptions) => ReactNode` | `label => label.join(' / ')` |
| expandTrigger | expand current item when click or hover, one of 'click' 'hover' | string | 'click' |
| fieldNames | custom field name for label and value and children (before 3.7.0 it calls `filedNames` which is typo) | object | `{ label: 'label', value: 'value', children: 'children' }` |
| getPopupContainer | Parent Node which the selector should be rendered to. Default to `body`. When position issues happen, try to modify it into scrollable content and position it relative.[example](https://codepen.io/afc163/pen/zEjNOy?editors=0010) | Function(triggerNode) | () => document.body |
| loadData | To load option lazily, and it cannot work with `showSearch` | `(selectedOptions) => void` | - |
| notFoundContent | Specify content to show when no result matches. | string | 'Not Found' |
| options | data options of cascade | object | - |
| placeholder | input placeholder | string | 'Please select' |
| popupClassName | additional className of popup overlay | string | - |
| popupPlacement | use preset popup align config from builtinPlacements`bottomLeft` `bottomRight` `topLeft` `topRight` | string | `bottomLeft` |
| popupVisible | set visible of cascader popup | boolean | - |
| showSearch | Whether show search input in single mode. | boolean\|object | false |
| size | input size, one of `large` `default` `small` | string | `default` |
| style | additional style | string | - |
| suffixIcon | The custom suffix icon | ReactNode | - |
| value | selected value | string\[] | - |
| onChange | callback when finishing cascader select | `(value, selectedOptions) => void` | - |
| onPopupVisibleChange | callback when popup shown or hidden | `(value) => void` | - |
| Property | Description | Type | Default | Version |
| --- | --- | --- | --- | --- |
| allowClear | whether allow clear | boolean | true | |
| autoFocus | get focus when component mounted | boolean | false | |
| changeOnSelect | change value on each selection if set to true, see above demo for details | boolean | false | |
| className | additional css class | string | - | |
| defaultValue | initial selected value | string\[] | \[] | |
| disabled | whether disabled select | boolean | false | |
| displayRender | render function of displaying selected options | `(label, selectedOptions) => ReactNode` | `label => label.join(' / ')` | |
| expandTrigger | expand current item when click or hover, one of 'click' 'hover' | string | 'click' | |
| fieldNames | custom field name for label and value and children (before 3.7.0 it calls `filedNames` which is typo) | object | `{ label: 'label', value: 'value', children: 'children' }` | 3.7.0 |
| getPopupContainer | Parent Node which the selector should be rendered to. Default to `body`. When position issues happen, try to modify it into scrollable content and position it relative.[example](https://codepen.io/afc163/pen/zEjNOy?editors=0010) | Function(triggerNode) | () => document.body | |
| loadData | To load option lazily, and it cannot work with `showSearch` | `(selectedOptions) => void` | - | |
| notFoundContent | Specify content to show when no result matches. | string | 'Not Found' | |
| options | data options of cascade | [Option](#Option)[] | - | |
| placeholder | input placeholder | string | 'Please select' | |
| popupClassName | additional className of popup overlay | string | - | |
| popupPlacement | use preset popup align config from builtinPlacements`bottomLeft` `bottomRight` `topLeft` `topRight` | string | `bottomLeft` | |
| popupVisible | set visible of cascader popup | boolean | - | |
| showSearch | Whether show search input in single mode. | boolean\|object | false | |
| size | input size, one of `large` `default` `small` | string | `default` | |
| style | additional style | string | - | |
| suffixIcon | The custom suffix icon | ReactNode | - | 3.10.0 |
| value | selected value | string\[] | - | |
| onChange | callback when finishing cascader select | `(value, selectedOptions) => void` | - | |
| onPopupVisibleChange | callback when popup shown or hidden | `(value) => void` | - | |
Fields in `showSearch`:
| Property | Description | Type | Default |
| --- | --- | --- | --- |
| filter | The function will receive two arguments, inputValue and option, if the function returns true, the option will be included in the filtered set; Otherwise, it will be excluded. | `function(inputValue, path): boolean` | |
| limit | Set the count of filtered items | number \| false | 50 |
| matchInputWidth | Whether the width of result list equals to input's | boolean | |
| render | Used to render filtered options. | `function(inputValue, path): ReactNode` | |
| sort | Used to sort filtered options. | `function(a, b, inputValue)` | |
| Property | Description | Type | Default | Version |
| --- | --- | --- | --- | --- |
| filter | The function will receive two arguments, inputValue and option, if the function returns true, the option will be included in the filtered set; Otherwise, it will be excluded. | `function(inputValue, path): boolean` | | |
| limit | Set the count of filtered items | number \| false | 50 | 3.11.0 |
| matchInputWidth | Whether the width of result list equals to input's | boolean | | |
| render | Used to render filtered options. | `function(inputValue, path): ReactNode` | | |
| sort | Used to sort filtered options. | `function(a, b, inputValue)` | | |
### Option
```typescript
interface Option {
value: string;
label?: React.ReactNode;
disabled?: boolean;
children?: Option[];
}
```
## Methods
| Name | Description |
| ------- | ------------ |
| blur() | remove focus |
| focus() | get focus |
| Name | Description | Version |
| ------- | ------------ | ------- |
| blur() | remove focus | |
| focus() | get focus | |
<style>
.ant-cascader-picker {

View File

@@ -15,6 +15,8 @@ export interface CascaderOptionType {
value?: string;
label?: React.ReactNode;
disabled?: boolean;
isLeaf?: boolean;
loading?: boolean;
children?: Array<CascaderOptionType>;
[key: string]: any;
}
@@ -204,6 +206,14 @@ function flattenTree(
const defaultDisplayRender = (label: string[]) => label.join(' / ');
function warningValueNotExist(list: CascaderOptionType[], fieldNames: FieldNamesType = {}) {
(list || []).forEach(item => {
const valueFieldName = fieldNames.value || 'value';
warning(valueFieldName in item, 'Cascader', 'Not found `value` in `options`.');
warningValueNotExist(item[fieldNames.children || 'children'], fieldNames);
});
}
class Cascader extends React.Component<CascaderProps, CascaderState> {
static defaultProps = {
placeholder: 'Please select',
@@ -229,6 +239,10 @@ class Cascader extends React.Component<CascaderProps, CascaderState> {
newState.flattenOptions = flattenTree(nextProps.options, nextProps);
}
if (process.env.NODE_ENV !== 'production' && nextProps.options) {
warningValueNotExist(nextProps.options, getFieldNames(nextProps));
}
return newState;
}
@@ -292,7 +306,8 @@ class Cascader extends React.Component<CascaderProps, CascaderState> {
};
handleKeyDown = (e: React.KeyboardEvent<HTMLInputElement>) => {
if (e.keyCode === KeyCode.BACKSPACE) {
// SPACE => https://github.com/ant-design/ant-design/issues/16871
if (e.keyCode === KeyCode.BACKSPACE || e.keyCode === KeyCode.SPACE) {
e.stopPropagation();
}
};
@@ -423,6 +438,7 @@ class Cascader extends React.Component<CascaderProps, CascaderState> {
allowClear,
showSearch = false,
suffixIcon,
notFoundContent,
...otherProps
} = props;
@@ -480,8 +496,19 @@ class Cascader extends React.Component<CascaderProps, CascaderState> {
]);
let options = props.options;
if (state.inputValue) {
options = this.generateFilteredOptions(prefixCls, renderEmpty);
if (options.length > 0) {
if (state.inputValue) {
options = this.generateFilteredOptions(prefixCls, renderEmpty);
}
} else {
const names: FilledFieldNamesType = getFilledFieldNames(this.props);
options = [
{
[names.label]: notFoundContent || renderEmpty('Cascader'),
[names.value]: 'ANT_CASCADER_NOT_FOUND',
disabled: true,
},
];
}
// Dropdown menu should keep previous status until it is fully closed.
if (!state.popupVisible) {
@@ -499,7 +526,7 @@ class Cascader extends React.Component<CascaderProps, CascaderState> {
// The default value of `matchInputWidth` is `true`
const resultListMatchInputWidth =
(showSearch as ShowSearchType).matchInputWidth === false ? false : true;
if (resultListMatchInputWidth && state.inputValue && this.input) {
if (resultListMatchInputWidth && (state.inputValue || isNotFound) && this.input) {
dropdownMenuColumnStyle.width = this.input.input.offsetWidth;
}

View File

@@ -15,53 +15,64 @@ subtitle: 级联选择
## API
```html
<Cascader options="{options}" onChange="{onChange}" />
```jsx
<Cascader options={options} onChange={onChange} />
```
| 参数 | 说明 | 类型 | 默认值 |
| --- | --- | --- | --- |
| allowClear | 是否支持清除 | boolean | true |
| autoFocus | 自动获取焦点 | boolean | false |
| changeOnSelect | 当此项为 true 时,点选每级菜单选项值都会发生变化,具体见上面的演示 | boolean | false |
| className | 自定义类名 | string | - |
| defaultValue | 默认的选中项 | string\[] | \[] |
| disabled | 禁用 | boolean | false |
| displayRender | 选择后展示的渲染函数 | `(label, selectedOptions) => ReactNode` | `label => label.join(' / ')` |
| expandTrigger | 次级菜单的展开方式,可选 'click' 和 'hover' | string | 'click' |
| fieldNames | 自定义 options 中 label name children 的字段注意3.7.0 之前的版本为 `filedNames` | object | `{ label: 'label', value: 'value', children: 'children' }` |
| getPopupContainer | 菜单渲染父节点。默认渲染到 body 上,如果你遇到菜单滚动定位问题,试试修改为滚动的区域,并相对其定位。[示例](https://codepen.io/afc163/pen/zEjNOy?editors=0010) | Function(triggerNode) | () => document.body |
| loadData | 用于动态加载选项,无法与 `showSearch` 一起使用 | `(selectedOptions) => void` | - |
| notFoundContent | 当下拉列表为空时显示的内容 | string | 'Not Found' |
| options | 可选项数据源 | object | - |
| placeholder | 输入框占位文本 | string | '请选择' |
| popupClassName | 自定义浮层类名 | string | - |
| popupPlacement | 浮层预设位置:`bottomLeft` `bottomRight` `topLeft` `topRight` | Enum | `bottomLeft` |
| popupVisible | 控制浮层显隐 | boolean | - |
| showSearch | 在选择框中显示搜索框 | boolean | false |
| size | 输入框大小,可选 `large` `default` `small` | string | `default` |
| style | 自定义样式 | string | - |
| suffixIcon | 自定义的选择框后缀图标 | ReactNode | - |
| value | 指定选中项 | string\[] | - |
| onChange | 选择完成后的回调 | `(value, selectedOptions) => void` | - |
| onPopupVisibleChange | 显示/隐藏浮层的回调 | `(value) => void` | - |
| 参数 | 说明 | 类型 | 默认值 | 版本 |
| --- | --- | --- | --- | --- |
| allowClear | 是否支持清除 | boolean | true | |
| autoFocus | 自动获取焦点 | boolean | false | |
| changeOnSelect | 当此项为 true 时,点选每级菜单选项值都会发生变化,具体见上面的演示 | boolean | false | |
| className | 自定义类名 | string | - | |
| defaultValue | 默认的选中项 | string\[] | \[] | |
| disabled | 禁用 | boolean | false | |
| displayRender | 选择后展示的渲染函数 | `(label, selectedOptions) => ReactNode` | `label => label.join(' / ')` | |
| expandTrigger | 次级菜单的展开方式,可选 'click' 和 'hover' | string | 'click' | |
| fieldNames | 自定义 options 中 label name children 的字段注意3.7.0 之前的版本为 `filedNames` | object | `{ label: 'label', value: 'value', children: 'children' }` | 3.7.0 |
| getPopupContainer | 菜单渲染父节点。默认渲染到 body 上,如果你遇到菜单滚动定位问题,试试修改为滚动的区域,并相对其定位。[示例](https://codepen.io/afc163/pen/zEjNOy?editors=0010) | Function(triggerNode) | () => document.body | |
| loadData | 用于动态加载选项,无法与 `showSearch` 一起使用 | `(selectedOptions) => void` | - | |
| notFoundContent | 当下拉列表为空时显示的内容 | string | 'Not Found' | |
| options | 可选项数据源 | [Option](#Option)[] | - | |
| placeholder | 输入框占位文本 | string | '请选择' | |
| popupClassName | 自定义浮层类名 | string | - | |
| popupPlacement | 浮层预设位置:`bottomLeft` `bottomRight` `topLeft` `topRight` | Enum | `bottomLeft` | |
| popupVisible | 控制浮层显隐 | boolean | - | |
| showSearch | 在选择框中显示搜索框 | boolean | false | |
| size | 输入框大小,可选 `large` `default` `small` | string | `default` | |
| style | 自定义样式 | string | - | |
| suffixIcon | 自定义的选择框后缀图标 | ReactNode | - | 3.10.0 |
| value | 指定选中项 | string\[] | - | |
| onChange | 选择完成后的回调 | `(value, selectedOptions) => void` | - | |
| onPopupVisibleChange | 显示/隐藏浮层的回调 | `(value) => void` | - | |
`showSearch` 为对象时,其中的字段:
| 参数 | 说明 | 类型 | 默认值 |
| --- | --- | --- | --- |
| filter | 接收 `inputValue` `path` 两个参数,当 `path` 符合筛选条件时,应返回 true反之则返回 false。 | `function(inputValue, path): boolean` | |
| limit | 搜索结果展示数量 | number \| false | 50 |
| matchInputWidth | 搜索结果列表是否与输入框同宽 | boolean | |
| render | 用于渲染 filter 后的选项 | `function(inputValue, path): ReactNode` | |
| sort | 用于排序 filter 后的选项 | `function(a, b, inputValue)` | |
| 参数 | 说明 | 类型 | 默认值 | 版本 |
| --- | --- | --- | --- | --- |
| filter | 接收 `inputValue` `path` 两个参数,当 `path` 符合筛选条件时,应返回 true反之则返回 false。 | `function(inputValue, path): boolean` | | |
| limit | 搜索结果展示数量 | number \| false | 50 | 3.11.0 |
| matchInputWidth | 搜索结果列表是否与输入框同宽 | boolean | | |
| render | 用于渲染 filter 后的选项 | `function(inputValue, path): ReactNode` | | |
| sort | 用于排序 filter 后的选项 | `function(a, b, inputValue)` | | |
### Option
```typescript
interface Option {
value: string;
label?: React.ReactNode;
disabled?: boolean;
children?: Option[];
}
```
## 方法
| 名称 | 描述 |
| ------- | -------- |
| blur() | 移除焦点 |
| focus() | 获取焦点 |
| 名称 | 描述 | 版本 |
| ------- | -------- | ---- |
| blur() | 移除焦点 | |
| focus() | 获取焦点 | |
<style>
.ant-cascader-picker {

View File

@@ -8,8 +8,11 @@
.reset-component;
&-input.@{ant-prefix}-input {
position: relative;
// Keep it static for https://github.com/ant-design/ant-design/issues/16738
position: static;
width: 100%;
// https://github.com/ant-design/ant-design/issues/17582
padding-right: 24px;
// Add important to fix https://github.com/ant-design/ant-design/issues/5078
// because input.less will compile after cascader.less
background-color: transparent !important;
@@ -59,7 +62,7 @@
width: 100%;
height: 20px;
margin-top: -10px;
padding: 0 @control-padding-horizontal;
padding: 0 20px 0 @control-padding-horizontal;
overflow: hidden;
line-height: 20px;
white-space: nowrap;
@@ -109,6 +112,11 @@
}
}
// https://github.com/ant-design/ant-design/pull/12407#issuecomment-424657810
&-picker-label:hover + &-input {
.hover;
}
&-picker-small &-picker-clear,
&-picker-small &-picker-arrow {
right: @control-padding-horizontal-sm;
@@ -195,8 +203,8 @@
&-active:not(&-disabled) {
&,
&:hover {
font-weight: 600;
background: @background-color-base;
font-weight: @select-item-selected-font-weight;
background-color: @background-color-light;
}
}
&-expand {
@@ -205,7 +213,7 @@
}
&-expand &-expand-icon,
&-expand &-loading-icon {
&-loading-icon {
.iconfont-size-under-12px(10px);
position: absolute;

View File

@@ -15,11 +15,11 @@ export interface AbstractCheckboxProps<T> {
style?: React.CSSProperties;
disabled?: boolean;
onChange?: (e: T) => void;
onClick?: React.MouseEventHandler<any>;
onMouseEnter?: React.MouseEventHandler<any>;
onMouseLeave?: React.MouseEventHandler<any>;
onKeyPress?: React.KeyboardEventHandler<any>;
onKeyDown?: React.KeyboardEventHandler<any>;
onClick?: React.MouseEventHandler<HTMLElement>;
onMouseEnter?: React.MouseEventHandler<HTMLElement>;
onMouseLeave?: React.MouseEventHandler<HTMLElement>;
onKeyPress?: React.KeyboardEventHandler<HTMLElement>;
onKeyDown?: React.KeyboardEventHandler<HTMLElement>;
value?: any;
tabIndex?: number;
name?: string;

View File

@@ -136,7 +136,16 @@ class CheckboxGroup extends React.Component<CheckboxGroupProps, CheckboxGroupSta
}
const onChange = this.props.onChange;
if (onChange) {
onChange(value.filter(val => registeredValues.indexOf(val) !== -1));
const options = this.getOptions();
onChange(
value
.filter(val => registeredValues.indexOf(val) !== -1)
.sort((a, b) => {
const indexA = options.findIndex(opt => opt.value === a);
const indexB = options.findIndex(opt => opt.value === b);
return indexA - indexB;
}),
);
}
};

View File

@@ -133,4 +133,38 @@ describe('CheckboxGroup', () => {
expect(onChange).toHaveBeenCalledWith([2]);
});
// https://github.com/ant-design/ant-design/issues/17297
it('onChange should keep the order of the original values', () => {
const onChange = jest.fn();
const wrapper = mount(
<Checkbox.Group onChange={onChange}>
<Checkbox key={1} value={1} />
<Checkbox key={2} value={2} />
<Checkbox key={3} value={3} />
<Checkbox key={4} value={4} />
</Checkbox.Group>,
);
wrapper
.find('.ant-checkbox-input')
.at(0)
.simulate('change');
expect(onChange).toHaveBeenCalledWith([1]);
wrapper
.find('.ant-checkbox-input')
.at(1)
.simulate('change');
expect(onChange).toHaveBeenCalledWith([1, 2]);
wrapper
.find('.ant-checkbox-input')
.at(0)
.simulate('change');
expect(onChange).toHaveBeenCalledWith([2]);
wrapper
.find('.ant-checkbox-input')
.at(0)
.simulate('change');
expect(onChange).toHaveBeenCalledWith([1, 2]);
});
});

View File

@@ -16,8 +16,6 @@ Generate a group of checkboxes from an array.
```jsx
import { Checkbox } from 'antd';
const CheckboxGroup = Checkbox.Group;
function onChange(checkedValues) {
console.log('checked = ', checkedValues);
}
@@ -36,13 +34,13 @@ const optionsWithDisabled = [
ReactDOM.render(
<div>
<CheckboxGroup options={plainOptions} defaultValue={['Apple']} onChange={onChange} />
<Checkbox.Group options={plainOptions} defaultValue={['Apple']} onChange={onChange} />
<br />
<br />
<CheckboxGroup options={options} defaultValue={['Pear']} onChange={onChange} />
<Checkbox.Group options={options} defaultValue={['Pear']} onChange={onChange} />
<br />
<br />
<CheckboxGroup
<Checkbox.Group
options={optionsWithDisabled}
disabled
defaultValue={['Apple']}

View File

@@ -17,31 +17,31 @@ Checkbox component.
#### Checkbox
| Property | Description | Type | Default |
| --- | --- | --- | --- |
| autoFocus | get focus when component mounted | boolean | false |
| checked | Specifies whether the checkbox is selected. | boolean | false |
| defaultChecked | Specifies the initial state: whether or not the checkbox is selected. | boolean | false |
| disabled | Disable checkbox | boolean | false |
| indeterminate | indeterminate checked state of checkbox | boolean | false |
| onChange | The callback function that is triggered when the state changes. | Function(e:Event) | - |
| Property | Description | Type | Default | Version |
| --- | --- | --- | --- | --- |
| autoFocus | get focus when component mounted | boolean | false | 3.6.2 |
| checked | Specifies whether the checkbox is selected. | boolean | false | 3.6.2 |
| defaultChecked | Specifies the initial state: whether or not the checkbox is selected. | boolean | false | 3.6.2 |
| disabled | Disable checkbox | boolean | false | 3.6.2 |
| indeterminate | indeterminate checked state of checkbox | boolean | false | 3.6.2 |
| onChange | The callback function that is triggered when the state changes. | Function(e:Event) | - | 3.6.2 |
#### Checkbox Group
| Property | Description | Type | Default |
| --- | --- | --- | --- |
| defaultValue | Default selected value | string\[] | \[] |
| disabled | Disable all checkboxes | boolean | false |
| name | The `name` property of all `input[type="checkbox"]` children | string | - |
| options | Specifies options | string\[] | \[] |
| value | Used for setting the currently selected value. | string\[] | \[] |
| onChange | The callback function that is triggered when the state changes. | Function(checkedValue) | - |
| Property | Description | Type | Default | Version |
| --- | --- | --- | --- | --- |
| defaultValue | Default selected value | string\[] | \[] | 3.6.2 |
| disabled | Disable all checkboxes | boolean | false | 3.6.2 |
| name | The `name` property of all `input[type="checkbox"]` children | string | - | 3.16.0 |
| options | Specifies options | string\[] | \[] | 3.6.2 |
| value | Used for setting the currently selected value. | string\[] | \[] | 3.6.2 |
| onChange | The callback function that is triggered when the state changes. | Function(checkedValue) | - | 3.6.2 |
### Methods
#### Checkbox
| Name | Description |
| ------- | ------------ |
| blur() | remove focus |
| focus() | get focus |
| Name | Description | Version |
| ------- | ------------ | ------- |
| blur() | remove focus | 3.6.2 |
| focus() | get focus | 3.6.2 |

View File

@@ -18,31 +18,31 @@ title: Checkbox
#### Checkbox
| 参数 | 说明 | 类型 | 默认值 |
| -------------- | --------------------------------------- | ----------------- | ------ |
| autoFocus | 自动获取焦点 | boolean | false |
| checked | 指定当前是否选中 | boolean | false |
| defaultChecked | 初始是否选中 | boolean | false |
| disabled | 失效状态 | boolean | false |
| indeterminate | 设置 indeterminate 状态,只负责样式控制 | boolean | false |
| onChange | 变化时回调函数 | Function(e:Event) | - |
| 参数 | 说明 | 类型 | 默认值 | 版本 |
| -------------- | --------------------------------------- | ----------------- | ------ | ----- |
| autoFocus | 自动获取焦点 | boolean | false | 3.6.2 |
| checked | 指定当前是否选中 | boolean | false | 3.6.2 |
| defaultChecked | 初始是否选中 | boolean | false | 3.6.2 |
| disabled | 失效状态 | boolean | false | 3.6.2 |
| indeterminate | 设置 indeterminate 状态,只负责样式控制 | boolean | false | 3.6.2 |
| onChange | 变化时回调函数 | Function(e:Event) | - | 3.6.2 |
#### Checkbox Group
| 参数 | 说明 | 类型 | 默认值 |
| --- | --- | --- | --- |
| defaultValue | 默认选中的选项 | string\[] | \[] |
| disabled | 整组失效 | boolean | false |
| name | CheckboxGroup 下所有 `input[type="checkbox"]``name` 属性 | string | - |
| options | 指定可选项 | string\[] | \[] |
| value | 指定选中的选项 | string\[] | \[] |
| onChange | 变化时回调函数 | Function(checkedValue) | - |
| 参数 | 说明 | 类型 | 默认值 | 版本 |
| --- | --- | --- | --- | --- |
| defaultValue | 默认选中的选项 | string\[] | \[] | 3.6.2 |
| disabled | 整组失效 | boolean | false | 3.6.2 |
| name | CheckboxGroup 下所有 `input[type="checkbox"]``name` 属性 | string | - | 3.16.0 |
| options | 指定可选项 | string\[] | \[] | 3.6.2 |
| value | 指定选中的选项 | string\[] | \[] | 3.6.2 |
| onChange | 变化时回调函数 | Function(checkedValue) | - | 3.6.2 |
### 方法
#### Checkbox
| 名称 | 描述 |
| ------- | -------- |
| blur() | 移除焦点 |
| focus() | 获取焦点 |
| 名称 | 描述 | 版本 |
| ------- | -------- | ----- |
| blur() | 移除焦点 | 3.6.2 |
| focus() | 获取焦点 | 3.6.2 |

View File

@@ -150,7 +150,6 @@
}
}
.@{checkbox-prefix-cls}-wrapper + span,
.@{checkbox-prefix-cls} + span {
padding-right: 8px;
padding-left: 8px;
@@ -175,7 +174,7 @@
// 半选状态
.@{checkbox-prefix-cls}-indeterminate {
.@{checkbox-inner-prefix-cls} {
background-color: #fff;
background-color: @component-background;
border-color: @border-color-base;
}
.@{checkbox-inner-prefix-cls}::after {

View File

@@ -9,8 +9,8 @@ import animation from '../_util/openAnimation';
export type ExpandIconPosition = 'left' | 'right';
export interface CollapseProps {
activeKey?: Array<string> | string;
defaultActiveKey?: Array<string>;
activeKey?: Array<string | number> | string | number;
defaultActiveKey?: Array<string | number> | string | number;
/** 手风琴效果 */
accordion?: boolean;
destroyInactivePanel?: boolean;
@@ -19,7 +19,7 @@ export interface CollapseProps {
className?: string;
bordered?: boolean;
prefixCls?: string;
expandIcon?: (panelProps: any) => React.ReactNode;
expandIcon?: (panelProps: PanelProps) => React.ReactNode;
expandIconPosition?: ExpandIconPosition;
}

View File

@@ -4,7 +4,7 @@ import classNames from 'classnames';
import { ConfigConsumer, ConfigConsumerProps } from '../config-provider';
export interface CollapsePanelProps {
key: string;
key: string | number;
header: React.ReactNode;
disabled?: boolean;
className?: string;

View File

@@ -16,7 +16,7 @@ In accordion mode, only one panel can be expanded at a time.
```jsx
import { Collapse } from 'antd';
const Panel = Collapse.Panel;
const { Panel } = Collapse;
const text = `
A dog is a type of domesticated animal.

View File

@@ -16,7 +16,7 @@ By default, any number of panels can be expanded at a time. The first panel is e
```jsx
import { Collapse } from 'antd';
const Panel = Collapse.Panel;
const { Panel } = Collapse;
function callback(key) {
console.log(key);

View File

@@ -16,7 +16,7 @@ A borderless style of Collapse.
```jsx
import { Collapse } from 'antd';
const Panel = Collapse.Panel;
const { Panel } = Collapse;
const text = (
<p style={{ paddingLeft: 24 }}>

View File

@@ -16,7 +16,7 @@ Customize the background, border, margin styles and icon for each panel.
```jsx
import { Collapse, Icon } from 'antd';
const Panel = Collapse.Panel;
const { Panel } = Collapse;
const text = `
A dog is a type of domesticated animal.

View File

@@ -16,7 +16,7 @@ title:
```jsx
import { Collapse } from 'antd';
const Panel = Collapse.Panel;
const { Panel } = Collapse;
function callback(key) {
console.log(key);

View File

@@ -16,7 +16,7 @@ You can hide the arrow icon by passing `showArrow={false}` to `CollapsePanel` co
```jsx
import { Collapse } from 'antd';
const Panel = Collapse.Panel;
const { Panel } = Collapse;
function callback(key) {
console.log(key);

View File

@@ -18,22 +18,22 @@ A content area which can be collapsed and expanded.
| Property | Description | Type | Default | Version |
| --- | --- | --- | --- | --- |
| activeKey | Key of the active panel | string\[]\|string | No default value. In `accordion` mode, it's the key of the first panel. | |
| defaultActiveKey | Key of the initial active panel | string | - | |
| bordered | Toggles rendering of the border around the collapse block | boolean | `true` | |
| accordion | If `true`, `Collapse` renders as `Accordion` | boolean | `false` | |
| activeKey | Key of the active panel | string\[]\|string\| number\[]\|number | No default value. In `accordion` mode, it's the key of the first panel. | |
| defaultActiveKey | Key of the initial active panel | string\[]\|string\| number\[]\|number | - | |
| bordered | Toggles rendering of the border around the collapse block | boolean | `true` | 3.6.5 |
| accordion | If `true`, `Collapse` renders as `Accordion` | boolean | `false` | 3.6.5 |
| onChange | Callback function executed when active panel is changed | Function | - | |
| expandIcon | allow to customize collapse icon | (panelProps) => ReactNode | - | |
| expandIcon | allow to customize collapse icon | (panelProps) => ReactNode | - | 3.13.0 |
| expandIconPosition | Set expand icon position: `left`, `right` | `left` | - | 3.17.0 |
| destroyInactivePanel | Destroy Inactive Panel | boolean | `false` | |
| destroyInactivePanel | Destroy Inactive Panel | boolean | `false` | 3.6.5 |
### Collapse.Panel
| Property | Description | Type | Default |
| --- | --- | --- | --- |
| disabled | If `true`, panel cannot be opened or closed | boolean | `false` |
| forceRender | Forced render of content on panel, instead of lazy rending after clicking on header | boolean | `false` |
| header | Title of the panel | string\|ReactNode | - |
| key | Unique key identifying the panel from among its siblings | string | - |
| showArrow | If `false`, panel will not show arrow icon | boolean | `true` |
| extra | extra element in the corner | ReactNode | - |
| Property | Description | Type | Default | Version |
| --- | --- | --- | --- | --- |
| disabled | If `true`, panel cannot be opened or closed | boolean | `false` | |
| forceRender | Forced render of content on panel, instead of lazy rending after clicking on header | boolean | `false` | 3.2.0 |
| header | Title of the panel | string\|ReactNode | - | |
| key | Unique key identifying the panel from among its siblings | string\|number | - | |
| showArrow | If `false`, panel will not show arrow icon | boolean | `true` | 3.1.0 |
| extra | extra element in the corner | ReactNode | - | 3.14.0 |

View File

@@ -19,22 +19,22 @@ cols: 1
| 参数 | 说明 | 类型 | 默认值 | 版本 |
| --- | --- | --- | --- | --- |
| activeKey | 当前激活 tab 面板的 key | string\[]\|string | 默认无accordion 模式下默认第一个元素 | |
| defaultActiveKey | 初始化选中面板的 key | string | 无 | |
| bordered | 带边框风格的折叠面板 | boolean | `true` | |
| accordion | 手风琴模式 | boolean | `false` | |
| activeKey | 当前激活 tab 面板的 key | string\[]\|string\| number\[]\|number | 默认无accordion 模式下默认第一个元素 | |
| defaultActiveKey | 初始化选中面板的 key | string\[]\|string\| number\[]\|number | 无 | |
| bordered | 带边框风格的折叠面板 | boolean | `true` | 3.13.0 |
| accordion | 手风琴模式 | boolean | `false` | 3.13.0 |
| onChange | 切换面板的回调 | Function | 无 | |
| expandIcon | 自定义切换图标 | (panelProps) => ReactNode | - | |
| expandIcon | 自定义切换图标 | (panelProps) => ReactNode | - | 3.13.0 |
| expandIconPosition | 设置图标位置: `left`, `right` | `left` | - | 3.17.0 |
| destroyInactivePanel | 销毁折叠隐藏的面板 | boolean | `false` | |
| destroyInactivePanel | 销毁折叠隐藏的面板 | boolean | `false` | 3.13.0 |
### Collapse.Panel
| 参数 | 说明 | 类型 | 默认值 |
| ----------- | ------------------------------------------ | ----------------- | ------ |
| disabled | 禁用后的面板展开与否将无法通过用户交互改变 | boolean | false |
| forceRender | 被隐藏时是否渲染 DOM 结构 | boolean | false |
| header | 面板头内容 | string\|ReactNode | 无 |
| key | 对应 activeKey | string | 无 |
| showArrow | 是否展示当前面板上的箭头 | boolean | `true` |
| extra | 自定义渲染每个面板右上角的内容 | ReactNode | - |
| 参数 | 说明 | 类型 | 默认值 | 版本 |
| ----------- | ------------------------------------------ | ----------------- | ------ | ------ |
| disabled | 禁用后的面板展开与否将无法通过用户交互改变 | boolean | false | |
| forceRender | 被隐藏时是否渲染 DOM 结构 | boolean | false | 3.2.0 |
| header | 面板头内容 | string\|ReactNode | 无 | |
| key | 对应 activeKey | string\|number | 无 | |
| showArrow | 是否展示当前面板上的箭头 | boolean | `true` | 3.13.0 |
| extra | 自定义渲染每个面板右上角的内容 | ReactNode | - | 3.14.0 |

Some files were not shown because too many files have changed in this diff Show More