Compare commits

...

603 Commits
3.4.2 ... 3.7.2

Author SHA1 Message Date
Wei Zhu
ee1c726447 Bump 3.7.2 2018-07-25 17:43:39 +08:00
Wei Zhu
548c694c40 Add 3.7.2 changelog (#11455) 2018-07-25 17:42:31 +08:00
zombiej
f5652f8e57 make title & label as optional props in treeSelect 2018-07-25 17:06:44 +08:00
Wei Zhu
9f76f1c276 chore: add tests for b9992f4 2018-07-25 16:31:18 +08:00
Wei Zhu
b9992f4a08 fix: DatePicker can not change year/month when under control
React 16.4 call getDerivedStateFromProps on every render

close #11447
close #11440
close #11439
close #11416
close #11405
2018-07-25 15:42:48 +08:00
JribiBelhassen
36f396f86f Change label in TreeData interface to title, since label is deprecated (#11442) 2018-07-25 10:53:18 +08:00
afc163
fbf1a35249 Fix extra scrollbar style of Modal.confirm in Firefox, close #11432 2018-07-24 16:27:21 +08:00
Wei Zhu
611f6e1f8f chore: remove circleci cache 2018-07-24 12:13:03 +08:00
Andrzej Dybionka
968371b22a fix: table onChange event is fired every time when close filterDropdown
Close #11164
2018-07-24 12:02:01 +08:00
Will
e91f67b87c Update index.zh-CN.md (#11427)
First of all, thank you for your contribution! :-)

Please makes sure that these checkboxes are checked before submitting your PR, thank you!

* [ ] Make sure that you propose PR to right branch: bugfix for `master`, feature for latest active branch `feature-x.x`.
* [ ] Make sure that you follow antd's [code convention](https://github.com/ant-design/ant-design/wiki/Code-convention-for-antd).
* [ ] Run `npm run lint` and fix those errors before submitting in order to keep consistent code style.
* [ ] Rebase before creating a PR to keep commit history clear.
* [ ] Add some descriptions and refer relative issues for you PR.

Extra checklist:

**if** *isBugFix* **:**

  * [ ] Make sure that you add at least one unit test for the bug which you had fixed.

**elif** *isNewFeature* **:**

  * [ ] Update API docs for the component.
  * [ ] Update/Add demo to demonstrate new feature.
  * [ ] Update TypeScript definition for the component.
  * [ ] Add unit tests for the feature.
2018-07-24 11:29:30 +08:00
zongzi531
e29a88b704 fix: badge type error. 2018-07-24 00:01:26 +08:00
Wei Zhu
0f503b50f7 chore: update circleci 2018-07-23 20:47:21 +08:00
afc163
6cb6f5c83e Fix select menu item radius style 2018-07-23 19:01:30 +08:00
Wei Zhu
67145a777e chore: fix job name 2018-07-23 18:25:18 +08:00
Wei Zhu
4c5d66228d chore: persist whole workspace 2018-07-23 18:23:55 +08:00
Wei Zhu
cc02ebf9d4 chore: dry circleci config 2018-07-23 18:20:55 +08:00
Wei Zhu
522b70e698 chore: tweak circleci 2018-07-23 18:01:59 +08:00
Wei Zhu
61284e2c9a chore: fix install react on circleci 2018-07-23 17:36:13 +08:00
Wei Zhu
691a98d25b Tweak circleci config 2018-07-23 17:34:16 +08:00
Wei Zhu
b95d8aedd2 introduce circle ci 2018-07-23 17:27:43 +08:00
Wei Zhu
91a7318999 test: fix react mock 2018-07-23 16:58:29 +08:00
Wei Zhu
435d793d60 test: fix React.createContext mock 2018-07-23 16:34:01 +08:00
Wei Zhu
c25e8de736 test: mock React.createRef 2018-07-23 16:12:36 +08:00
Wei Zhu
d87899784b Update .travis.yml 2018-07-23 15:50:39 +08:00
zombiej
6503bace42 move change log Drawer to first line 2018-07-23 15:33:50 +08:00
afc163
1c5f8f1901 update snapshots 2018-07-23 15:21:28 +08:00
afc163
66940db794 upgrade some devDeps 2018-07-23 15:18:22 +08:00
afc163
827da01e05 Fix badge url 2018-07-23 15:10:43 +08:00
afc163
101fdc7241 Fix InputNumber overlap in fixed columns table
close #11408

ref #6289
2018-07-23 15:10:43 +08:00
zombiej
0337b69893 update change log 2018-07-23 14:57:17 +08:00
Ed Moore
cd5cbafdf0 Fix types for Radio Group 2018-07-23 14:33:47 +08:00
zombiej
007c7d0ef7 adjust change log 2018-07-23 11:31:51 +08:00
Eager
c3e50c268d fix(Tooltip): fix text overflow the Tooltip 2018-07-22 15:52:02 +08:00
Eager Wei
c1daf5bad2 删除手误 2018-07-22 15:52:02 +08:00
Eager Wei
a29a0ff78d Update .codecov.yml 2018-07-22 15:52:02 +08:00
Amumu
f728fbe5ab getDerivedStateFromProp return null if not change
A valid state object (or null) must be returned. You have returned undefined.
2018-07-22 11:59:40 +08:00
hongxuWei
f796618a15 Fix the style of horizontal menu on dark theme 2018-07-22 11:58:33 +08:00
陈帅
d0c684e925 add wrapClassName and multi-level-drawer test 2018-07-22 11:55:46 +08:00
陈帅
cb961cdf01 remove snap in destroyOnClose test 2018-07-22 11:55:46 +08:00
陈帅
608f631b64 test: Perfect test 2018-07-22 11:55:46 +08:00
jljsj33
2cd863929a update drawer test 2018-07-22 11:55:46 +08:00
陈帅
57a2fc667e test: change moment to render 2018-07-22 11:55:46 +08:00
陈帅
88981fef22 style: Adjust the edge shadow 2018-07-22 11:55:46 +08:00
jljsj33
881cef5abf update drawer 2018-07-22 11:55:46 +08:00
zombiej
8c7dfe45c6 Bump 3.7.1 & update change log 2018-07-21 23:36:28 +08:00
tangjinzhou
430381f28f fix: ButtonGroup style bug when have disabled button #9296 (#11321)
* fix: ButtonGroup style bug when have disabled button #9296

* Update mixin.less
2018-07-21 22:11:57 +08:00
偏右
60c2860e09 Update package.json 2018-07-21 17:12:28 +08:00
afc163
6be189aa0f site: styling API Tables 2018-07-21 15:00:20 +08:00
afc163
18d85141e1 site: update document title in home page
Tribute to material-ui.com and 😉
2018-07-21 13:18:23 +08:00
Jake Richards
b4e0c48ed5 Strengthen Mention Component typings 2018-07-21 12:32:36 +08:00
偏右
2756d587d7 Update index.en-US.md 2018-07-20 23:22:40 +08:00
afc163
37ba3bcd7c fix rc-drawer version for strange ci fail 2018-07-20 19:48:26 +08:00
afc163
7dd5270831 fix snapshots 2018-07-20 19:37:42 +08:00
afc163
d441c815a9 fix snapshots 2018-07-20 18:17:18 +08:00
Fred-Shan
c045b79e62 Update index.zh-CN.md
there are two "theme" in the table
2018-07-20 17:38:33 +08:00
zombiej
2ad0bc0395 close #11380. Fix desciption of auto complete 2018-07-20 17:02:52 +08:00
afc163
361b94fb0f improve README.md 2018-07-20 14:05:59 +08:00
afc163
e2b9e5d832 update warning message 2018-07-20 12:10:43 +08:00
Wei Zhu
f22353cd2b Use npm package for offline-plugin
tnpm don't support git dependency
2018-07-20 11:53:49 +08:00
zombiej
ecc2293229 fix #11368. Clean outline style of treeSelect 2018-07-20 11:03:02 +08:00
zombiej
ed7630053e fix #11366. action trigger expand also trigger the onExpand 2018-07-20 10:50:20 +08:00
Leo Yin
96d8fc45f1 Fix edit-row.md 2018-07-19 11:28:44 +08:00
रोहन मल्होत्रा
12b99970f3 Migrated to new lifecycle method for datepiceker (#10309)
…picker

First of all, thank you for your contribution! :-)

Please makes sure that these checkboxes are checked before submitting your PR, thank you!

* [x] Make sure that you propose PR to right branch: bugfix for `master`, feature for latest active branch `feature-x.x`.
* [x] Make sure that you follow antd's [code convention](https://github.com/ant-design/ant-design/wiki/Code-convention-for-antd).
* [x] Run `npm run lint` and fix those errors before submitting in order to keep consistent code style.
* [x] Rebase before creating a PR to keep commit history clear.
* [x] Add some descriptions and refer relative issues for you PR.

Extra checklist:

**if** *isBugFix* **:**

no
**elif** *isNewFeature* **:**

#9792
2018-07-19 11:26:47 +08:00
Bryan Berger
1d924300e7 add @message-notice-content-padding var to <Message /> 2018-07-18 22:17:12 +08:00
baozefeng
825d770254 bugfix: Chinese doc website date-picker demo link go to English website 2018-07-18 20:07:22 +08:00
afc163
782abe7bb6 demo: fix select showSearch demo placeholder, close #11325 2018-07-18 15:57:34 +08:00
陈帅
e7242f4924 fix #11307 Prop destroyOnClose prevents the closing animation of drawer 2018-07-18 15:53:06 +08:00
Wang Riwu
a2c4b03d45 add notification.open to API docs (#11281) 2018-07-18 14:55:47 +08:00
afc163
f7db1788df improve changelog 2018-07-18 12:46:24 +08:00
Jonathan Chen
fc7c64ce06 Docs: Fix spelling (#11316) 2018-07-18 09:43:40 +08:00
Daniel Zhang
308cb046e4 Add onMouseEnter and onMouseLeave to SelectProps (#11314) 2018-07-18 00:06:27 +08:00
Wei Zhu
c696757793 Revert "fix test"
This reverts commit f1570c01ea.

Follow f1570c01ea
2018-07-17 22:22:16 +08:00
Wei Zhu
e6c4c6667d Revert rc-menu upgrade
Revert "use default hover trigger for horizontal menu demo"

This reverts commit 159b09342d.

Revert "upgrade menu@7.2.0"

This reverts commit d4c9a1deea.

Revert "feat: prevent horizontal menu items wrapping"

This reverts commit 5c7f9feecb.
2018-07-17 21:59:16 +08:00
Eager Wei
9c792d52a8 fix table onChange pagination type (#11291)
Update interface.tsx TableProps onChange
2018-07-17 17:56:24 +08:00
陈帅
705e57f7e8 change drawer z-index to @zindex-modal 2018-07-17 17:34:20 +08:00
afc163
57c072d1b8 Fix dark menu small style issue, close #11299 2018-07-17 15:29:23 +08:00
Lyndon001
a0f5044189 Update visual.md 2018-07-17 14:09:36 +08:00
afc163
2cacfe78ea Fix switch overflow in certain situation, close #9928 2018-07-16 19:47:28 +08:00
afc163
152cae4d9f Fix Card tabs disable attribute, close #11212 2018-07-16 19:18:50 +08:00
tangjinzhou
14e0cc0161 fix: anchorLink href update 2018-07-16 17:31:32 +08:00
Wei Zhu
d2c34e32a1 fix: uniform divider font-size
close #11227
2018-07-16 16:48:42 +08:00
Hanz Luo
11f0f14cb2 Remove scrollbar on confirm Modal title 2018-07-16 10:44:14 +08:00
陈帅
f337d2f4e4 doc: Delete strange strings and adjust document description 2018-07-15 13:19:23 +08:00
付引
31b2517261 mport -> import 2018-07-15 12:54:23 +08:00
陈帅
1f15df4f14 Merge branch 'feature-3.7.0' 2018-07-15 09:27:34 +08:00
陈帅
a5723386ed Bump 3.7.0 2018-07-15 08:49:31 +08:00
陈帅
6872131321 add 3.7.0 changelog 2018-07-15 08:46:53 +08:00
picodoth
159b09342d use default hover trigger for horizontal menu demo 2018-07-15 08:41:06 +08:00
picodoth
d4c9a1deea upgrade menu@7.2.0 2018-07-15 08:41:06 +08:00
dependabot[bot]
ee6ef28ec6 Update bisheng requirement to ^0.29.0
Updates the requirements on [bisheng](https://github.com/benjycui/bisheng) to permit the latest version.
- [Release notes](https://github.com/benjycui/bisheng/releases)
- [Commits](https://github.com/benjycui/bisheng/commits/bisheng@0.29.0)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-07-14 23:56:49 +08:00
david.lv
6fe9ca201e Update index.less
spell check 'compatibile'->'compatible'
2018-07-14 23:45:35 +08:00
picodoth
f1570c01ea fix test 2018-07-14 13:05:36 +08:00
picodoth
5c7f9feecb feat: prevent horizontal menu items wrapping 2018-07-14 13:05:36 +08:00
陈帅
125d0df3e0 Merge branch 'master' into feature-3.7.0 2018-07-14 12:15:00 +08:00
陈帅
0ee58eb3d4 lint:fix eslint error 2018-07-13 22:23:12 +08:00
陈帅
2cffe4f858 optimization: Fix problems found in review 2018-07-13 22:23:12 +08:00
陈帅
9ad0114102 fix eslint error 2018-07-13 22:23:12 +08:00
陈帅
01f2dee77b up rc-drawer version 2018-07-13 22:23:12 +08:00
陈帅
dba4b8c3c9 use context to implement multiple drawers 2018-07-13 22:23:12 +08:00
陈帅
441b90e488 Fix the naming problem 2018-07-13 22:23:12 +08:00
陈帅
50271732b1 add multi-level-drawer 2018-07-13 22:23:12 +08:00
陈帅
06d5ff6bbe up rc-drawer vesion to 1.5.1 2018-07-13 22:23:12 +08:00
陈帅
007c8dfc91 delete toogerHotjar function 2018-07-13 22:23:12 +08:00
陈帅
c8217e0bad Fixing style errors caused by too low height 2018-07-13 22:23:12 +08:00
陈帅
78e8ab55b5 adjust demos 2018-07-13 22:23:12 +08:00
陈帅
0f2be7308b Modify documents and adjust demos 2018-07-13 22:23:12 +08:00
陈帅
2be8248552 up rc-drawer version 2018-07-13 22:23:12 +08:00
陈帅
b91a367b4f Modify drawer description 2018-07-13 22:23:12 +08:00
陈帅
cc59ef4cbf In accordance with design patterns 2018-07-13 22:23:12 +08:00
陈帅
186e69cea3 edit new doc 2018-07-13 22:23:12 +08:00
陈帅
0f22cd69c3 test support react15 2018-07-13 22:23:12 +08:00
陈帅
2e3d131d74 update snapshots 2018-07-13 22:23:12 +08:00
陈帅
c863b2d758 fix drawer lint 2018-07-13 22:23:12 +08:00
陈帅
65e73c5f3b edit test script 2018-07-13 22:23:12 +08:00
陈帅
ce4624c69a edit test script 2018-07-13 22:23:12 +08:00
陈帅
510dad58bf edit doc and dom 2018-07-13 22:23:12 +08:00
陈帅
1f25b1042b delete some test 2018-07-13 22:23:12 +08:00
陈帅
115f518985 add 100% test 2018-07-13 22:23:12 +08:00
陈帅
172759177f perfect drawer doc 2018-07-13 22:23:12 +08:00
陈帅
e8394eca6f add drawer test 2018-07-13 22:23:12 +08:00
陈帅
d2856392b6 fix site build error 2018-07-13 22:23:12 +08:00
qixian.cs@outlook.com
9e12476f68 Optimize code and documentation 2018-07-13 22:23:12 +08:00
picodoth
1f3d6584ff update en docs 2018-07-13 22:23:12 +08:00
jim
7801f2459c change null to undefined 2018-07-13 22:23:12 +08:00
jim
68da7f2078 delete util import 2018-07-13 22:23:12 +08:00
jim
306389273a Improve documentation 2018-07-13 22:23:12 +08:00
jim
73674f53c3 change rc-drawer-meun to rc-drawer 2018-07-13 22:23:12 +08:00
jim
ab8a05605a change rc-drawer-menu version 2018-07-13 22:23:12 +08:00
jim
bc76ae51ac add two demo 2018-07-13 22:23:12 +08:00
jim
8c476ada26 up rc-drawer-menu version 2018-07-13 22:23:12 +08:00
jim
7757926666 Perfect api 2018-07-13 22:23:12 +08:00
jim
af5cde61d1 canonical style 2018-07-13 22:23:12 +08:00
jim
fee00e3841 add open animation 2018-07-13 22:23:12 +08:00
jim
86655c0ebc update test snap 2018-07-13 22:23:12 +08:00
jim
de5b89a612 remove top and bottom less 2018-07-13 22:23:12 +08:00
jim
8c3386f00c remove handle and fix typo 2018-07-13 22:23:12 +08:00
jim
61a7731270 simple demo 2018-07-13 22:23:12 +08:00
jim
cbbe4035e2 add bodyStyle api 2018-07-13 22:23:12 +08:00
jim
42de00137f change api doc 2018-07-13 22:23:12 +08:00
jim
13393d8987 add doc 2018-07-13 22:23:12 +08:00
陈帅
4ed787296b lint:lock eslint-plugin-jsx-a11y to 6.0.2 2018-07-13 12:23:04 +08:00
Wei Zhu
bccd871eca chore: cache node_modules too 2018-07-13 11:16:53 +08:00
afc163
e1e6523452 Fix border radius when avatar has custom size 2018-07-13 10:36:01 +08:00
Wei Zhu
5732b6e2b2 chore: cache $HOME/.npm 2018-07-12 16:48:46 +08:00
Wei Zhu
c380186e79 fix: table custom components not change 2018-07-12 16:42:15 +08:00
afc163
0e3b67e999 Fix Timeline dot not working with Tooltip, close #11250 2018-07-12 11:35:50 +08:00
afc163
0b50a75093 update snapshot 2018-07-11 23:35:02 +08:00
afc163
db4a5edf8e correct typo: filedNames => fieldNames 2018-07-11 23:35:02 +08:00
afc163
8eb8c686ce Merge branch 'master' into feature-3.7.0 2018-07-11 22:21:01 +08:00
Wei Zhu
44ea5b2998 cache node_modules on ci 2018-07-11 20:13:36 +08:00
afc163
00afce3a4b Improve design of RangePicker presets link 2018-07-11 20:09:58 +08:00
Zhiqiang Gong
722b24b813 add disabled prop (#11188)
First of all, thank you for your contribution! :-)

Please makes sure that these checkboxes are checked before submitting your PR, thank you!

* [x] Make sure that you propose PR to right branch: bugfix for `master`, feature for latest active branch `feature-x.x`.
* [x] Make sure that you follow antd's [code convention](https://github.com/ant-design/ant-design/wiki/Code-convention-for-antd).
* [x] Run `npm run lint` and fix those errors before submitting in order to keep consistent code style.
* [x] Rebase before creating a PR to keep commit history clear.
* [x] Add some descriptions and refer relative issues for you PR.

Extra checklist:

**if** *isBugFix* **:**

  * [x] Make sure that you add at least one unit test for the bug which you had fixed.

**elif** *isNewFeature* **:**

  * [ ] Update API docs for the component.
  * [ ] Update/Add demo to demonstrate new feature.
  * [ ] Update TypeScript definition for the component.
  * [ ] Add unit tests for the feature.

tslint检测时报错
类型“IntrinsicAttributes & IntrinsicClassAttributes<Tree> & Readonly<{ children?: ReactNode; }> & Read...”上不存在属性“disabled”。
2018-07-11 19:39:41 +08:00
Wei Zhu
2d5949f31d test: use render for snapshot 2018-07-11 19:35:57 +08:00
Gao Jiangmiao
690804d310 Revert yarn command in use-in-typescript.md 2018-07-11 19:15:32 +08:00
Gao Jiangmiao
46add091ca Fix typo in in use-in-typescript.md 2018-07-11 19:15:32 +08:00
Wei Zhu
4b045fc43f Revert "docs: update moment locale usage"
This reverts commit 89228118af.

The original purpose to import locale from src is that some projects
adding `jsnext:main` to the `resolve.mainFields` config of webpack which leads
webpack load moment from `src/moment.js`. But import from `locale`
should works for most projects.
2018-07-11 15:17:15 +08:00
mofelee
e3ef74c3e7 fix "Cannot find module './locale'" bug 2018-07-11 14:39:06 +08:00
Wei Zhu
ea42973ace mock React.createContext 2018-07-11 11:16:37 +08:00
Wei Zhu
47884320ef docs: remove only 2018-07-11 10:36:24 +08:00
英布
e47b82d22a Update dva related links for English docs
Update dva related links for English docs
2018-07-10 23:12:58 +08:00
英布
9f1c8bc184 dva 相关外链更新到 dva 官网
理解 dva 的 [8 个概念]、查看 [dva 知识地图] 的链接都404了,顺便更新到 dva 官网去
2018-07-10 23:12:58 +08:00
Wei Zhu
af49a1806b docs: rewrite editable demo 2018-07-10 21:11:50 +08:00
陈帅
b3f4e5e3da bugfix: fixed #11152 silder trigger no white theme 2018-07-10 21:06:22 +08:00
Daewoong Moon
52d736a0ee Added missing ko_KR locale 2018-07-10 20:58:30 +08:00
zhenbao.xy
779abfaf9f fix the relation between @alert-text-color & @text-color 2018-07-10 20:58:12 +08:00
Wei Zhu
435558b63e fix: Layout.Sider string width
Close #11211
2018-07-10 12:29:20 +08:00
zhuyue
77af31da7d Merge branch master into feature-3.7.0 2018-07-10 11:49:57 +08:00
zhuyue
591e00edc1 Bump 3.6.6 2018-07-10 11:24:59 +08:00
诸岳
6a405463d1 Add the changelog of 3.6.6 (#11192) 2018-07-10 11:21:43 +08:00
zombiej
903f3f6770 fix test case in react 15 2018-07-04 20:23:46 +08:00
zombiej
1c31efe392 add rc-trigger in package.json to avoid test mock failed 2018-07-04 14:31:35 +08:00
afc163
6d7ac58550 Fix header overflow style of empty table in Firefox, close #11135 2018-07-04 12:09:28 +08:00
Andre Perunicic
31c07d8372 Update customize-theme.zh-CN.md with link to antd-scss-theme-plugin article
This article describes how to install the use the `antd-scss-theme-plugin` for Webpack, and how doing so allows you to: 1) customize Ant Design's variables from an SCSS theme file, 2) use compiled Ant Design variables in other SCSS theme files in your project, and 3) enable hot-reloading of Ant Design styles.
2018-07-04 10:38:14 +08:00
Andre Perunicic
5980cf957a Update customize-theme.en-US.md with link to antd-scss-theme-plugin article
This article describes how to install the use the `antd-scss-theme-plugin` for Webpack, and how doing so allows you to: 1) customize Ant Design's variables from an SCSS theme file, 2) use compiled Ant Design variables in other SCSS theme files in your project, and 3) enable hot-reloading of Ant Design styles.
2018-07-04 10:38:14 +08:00
afc163
0c4d356e54 Merge branch 'master' into feature-3.7.0 2018-07-03 19:54:48 +08:00
afc163
cde8bc8361 Selected value in Cascader should be gray when focus search input 2018-07-03 15:46:12 +08:00
afc163
4aabc53744 Fix InputNumber handler background
https://gw.alipayobjects.com/zos/rmsportal/QDxJpiArMgQJCLhmVvEZ.png
2018-07-03 15:35:56 +08:00
afc163
60ebb434c1 Fix form controls align issue in IE11
close #9827
close #11133
2018-07-03 14:04:46 +08:00
偏右
8607c58abc Update README.md 2018-07-03 00:10:14 +08:00
Wei Zhu
d4c95e6f18 docs: remove obsolete snapshot and fix custom filter demo 2018-07-02 21:41:14 +08:00
愚道
004561ba1f fix style in range select 2018-07-02 19:51:58 +08:00
愚道
450a3142ee fix: fix datepicker selected item style, close #9529 2018-07-02 19:51:58 +08:00
Wei Zhu
0f2fea2d78 docs: rewrite custom filter demo with filterDropdown function 2018-07-02 19:42:27 +08:00
Wei Zhu
1af4392ae9 feat: filterIcon can be a function 2018-07-02 19:42:27 +08:00
Christian Vadalà
59cc3a8b6c feat: adds ability to override filter renderer without migrate to a fully controlled component 2018-07-02 19:42:27 +08:00
偏右
ee1f450e04 Update use-with-create-react-app.en-US.md 2018-07-02 17:56:16 +08:00
agent-z
8c156afb39 Update use-with-create-react-app.zh-CN.md 2018-07-02 17:55:37 +08:00
valleykid
915a64feae docs: some words are improper 2018-07-02 13:55:25 +08:00
zombiej
fb96c9db35 update treeSelect doc 2018-07-02 12:27:16 +08:00
valleykid
7123a6da59 bump 3.6.5 2018-07-02 12:16:15 +08:00
afc163
5fe25d9c23 site: fix collapse all button and import it, close #11113 2018-07-01 12:13:46 +08:00
afc163
a516358298 Fix wired Transfer repaint problem in IE or Edge
close #9697

https://stackoverflow.com/q/27947912/3040605
2018-06-30 22:22:09 +08:00
afc163
a3e245731b code style 2018-06-30 21:56:41 +08:00
afc163
553901dfb8 Fix card background overflow when zoom in chrome, close #9085 2018-06-30 21:13:22 +08:00
afc163
7d038d1aee revert 4d5d3c142e 2018-06-30 19:05:09 +08:00
afc163
e906117731 use eslint-tinker back in devDeps 2018-06-30 18:52:48 +08:00
Aditya Padhi
fcc055b390 Update index.en-US.md
Updated to document by adding  a property "destroyInactivePanel" which lets the user know about it behavior.
2018-06-30 18:51:32 +08:00
afc163
763d32ac68 Fix tslint 2018-06-30 18:49:43 +08:00
zombiej
567eaf9ff4 close #10990. Update rc-tree-select 2018-06-30 15:15:13 +08:00
Harshit Mehrotra
47621acb6c Fixed a typo
from was misspelled as form
2018-06-30 15:13:00 +08:00
zombiej
6ff7dd8fb9 close #10996. Update selectTree doc. 2018-06-29 17:22:40 +08:00
afc163
ddfe8ad48a Adapt Table sorter icon style to @font-size-base
https://gw.alipayobjects.com/zos/rmsportal/jKlytqFbAeMQGXaCYWdR.png

  =>

https://gw.alipayobjects.com/zos/rmsportal/InvEbivRsIcAQBuoEsJI.png
2018-06-29 15:33:57 +08:00
afc163
4d5d3c142e fix fileList in onChange when uid is 0, close #11089 2018-06-29 13:57:47 +08:00
zelongc
27c3093487 Typo fix in the upload component demo.
Change 'reponse' to 'response'.
2018-06-29 12:47:01 +08:00
Wei Zhu
fd06baa9d7 use fork version of offline-plugin 2018-06-29 12:22:26 +08:00
afc163
d88a8f6920 docs: Add instruction about validateFields arguments, close #11084 2018-06-29 11:57:26 +08:00
dependabot[bot]
31014e94ba Update react-virtualized requirement to ~9.20.0 (#11031)
Updates the requirements on [react-virtualized](https://github.com/bvaughn/react-virtualized) to permit the latest version.
- [Release notes](https://github.com/bvaughn/react-virtualized/releases)
- [Changelog](https://github.com/bvaughn/react-virtualized/blob/master/CHANGELOG.md)
- [Commits](https://github.com/bvaughn/react-virtualized/commits/9.20.0)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-06-29 10:23:42 +08:00
Yury Kozyrev
cde2a6b6f0 Add missing showArrow option in types 2018-06-28 22:50:07 +08:00
zombiej
4cf18eaae8 update rc-tree-select to 2.0.1 2018-06-28 20:00:35 +08:00
zombiej
11dba9c305 update snapshot 2018-06-28 17:12:16 +08:00
afc163
3eee357bfb Add buttonStyle(outline|solid) for RadioGroup 2018-06-28 15:01:03 +08:00
afc163
f2e22e702e Merge branch 'master' into feature-3.7.0 2018-06-28 14:22:41 +08:00
afc163
c55fabc7b4 docs: improve radio API documentation 2018-06-28 14:18:23 +08:00
afc163
60e3cfa37a Add buttonStyle for RadioGroup 2018-06-28 14:01:05 +08:00
afc163
01233b15c5 Merge branch 'master' into feature-3.7.0 2018-06-27 20:33:47 +08:00
afc163
33c5d3b330 fix test 2018-06-27 20:33:32 +08:00
afc163
5554b75bc1 Merge branch 'master' into feature-3.7.0 2018-06-27 19:50:26 +08:00
afc163
0ea8047546 test: update table snapshots 2018-06-27 19:49:58 +08:00
afc163
817ee3e9e1 Merge branch 'master' into feature-3.7.0 2018-06-27 19:26:51 +08:00
afc163
1010a4fe19 test: update table snapshots 2018-06-27 18:57:04 +08:00
afc163
46735a9f6b fix lint 2018-06-27 18:41:02 +08:00
hanpei
63b4dc5157 Update index.zh-CN.md
个人认为
排版(typegraphy)和布局(layout)并不是一个概念,去掉排版二字,和前半句felx布局相一致
2018-06-27 17:52:05 +08:00
Tomáš Szabo
bf5b6ae1f3 Fix incompatible type error for Table[size] prop 2018-06-27 17:51:48 +08:00
涌谷(刘旭恒)
babbbdd4e5 Add custom local support in pagination component. 2018-06-27 16:18:59 +08:00
afc163
0981ef06a4 fix demo lint 2018-06-27 16:14:47 +08:00
afc163
56020cda39 Merge branch 'master' into feature-3.7.0 2018-06-27 16:14:14 +08:00
afc163
009ed08580 upgrade eslint-config-airbnb 2018-06-27 16:09:58 +08:00
afc163
6a0b4f1d27 upgrade travis node version 2018-06-27 14:46:10 +08:00
afc163
50475e8063 fix README.md 2018-06-27 11:37:07 +08:00
afc163
e2b359e9c3 Move max-width to ant-tooltip
so that it can be override by overlayStyle.maxWidth
2018-06-27 11:26:19 +08:00
zombiej
0d09dbafdd close #11035. Adjust select mirror top css to avoid to long string 2018-06-26 14:52:48 +08:00
byzyk
1850699588 docs(collapse): add accordion, add bordered 2018-06-25 21:32:07 +08:00
afc163
c8a1442e38 Add event as second argument of onSearch
close #11015
2018-06-25 20:35:05 +08:00
dependabot[bot]
8931591734 Update eslint requirement to ^5.0.0
Updates the requirements on [eslint](https://github.com/eslint/eslint) to permit the latest version.
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/master/CHANGELOG.md)
- [Commits](https://github.com/eslint/eslint/commits/v5.0.0)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-06-25 19:20:26 +08:00
afc163
c9be66f8e7 Merge branch 'master' into feature-3.7.0 2018-06-25 16:53:54 +08:00
Matt Lein
9523a1b528 back out package updates 2018-06-25 16:53:04 +08:00
Matt Lein
bcef7ca32e get data-*, aria-*, and role attributes 2018-06-25 16:53:04 +08:00
Matt Lein
77fcbca04d pass data-* aria-* and role props 2018-06-25 16:53:04 +08:00
Matt Lein
04c0013e58 back out package updates 2018-06-25 16:53:04 +08:00
Matt Lein
e63f9d4beb Pass data and aria props to the date picker input.
Pass data and aria props to the alert div.
add wrapProps to ModalProps
2018-06-25 16:53:04 +08:00
Matt Lein
f0b684de6a get data-*, aria-*, and role attributes 2018-06-25 16:53:04 +08:00
Matt Lein
20348614d5 Alert - pass data-* attributes to alert div 2018-06-25 16:53:04 +08:00
Wei Zhu
354cc7303e docs: remove combobox 2018-06-25 16:52:51 +08:00
Wei Zhu
6de4b00815 Rename mode name 2018-06-25 16:52:51 +08:00
Wei Zhu
5eaa03b4ea Update snapshot 2018-06-25 16:52:51 +08:00
Wei Zhu
53046a454a Deprecate combobox mode of Select 2018-06-25 16:52:51 +08:00
dependabot[bot]
f80961b946 Update babel-eslint requirement to 8.2.5
Updates the requirements on [babel-eslint](https://github.com/babel/babel-eslint) to permit the latest version.
- [Release notes](https://github.com/babel/babel-eslint/releases)
- [Commits](https://github.com/babel/babel-eslint/commits/v8.2.5)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-06-25 16:38:49 +08:00
Wei Zhu
b374297ca6 Merge branch 'master' into feature-3.7.0 2018-06-25 11:44:35 +08:00
Wei Zhu
aa580beb8b docs: sort api table 2018-06-24 17:09:18 +08:00
Wei Zhu
2d2aceb9d3 docs: document AutoComplete onFocus and onBlur 2018-06-24 17:05:19 +08:00
pbrink231
5302400e62 added onBlur & onFocus functions to properties (#10920)
These can be called just like onChange as a property in the autocomplete but are not documented right now.
2018-06-24 16:56:28 +08:00
愚指导
d11d44e413 Bump 3.6.4 and fix some lint issue. 2018-06-23 16:35:42 +08:00
愚道
653ec40b30 update test snapshot 2018-06-23 11:31:42 +08:00
afc163
fc224525da chore: demo doc format 2018-06-22 23:36:53 +08:00
afc163
71846acaa1 Fix Dropdown non-boolean attribute warning
ref #7798
2018-06-22 23:33:06 +08:00
afc163
9f16d066af Fix lint problems from eslint-config-airbnb@17 2018-06-22 21:05:13 +08:00
Randy
a614a525c4 fix #10822 (#10955)
Add `okButtonProps` and `cancelButtonProps` props to ok button and cancel button
2018-06-22 19:56:41 +08:00
afc163
7fc1483fe1 Fix style of RangePicker with preset ranges, close #10986 2018-06-22 12:13:25 +08:00
Thomas Billicsich
ff70654ffe Removed redundant dot accesses in example
The `current` variable is defined on the top of the method.
2018-06-22 10:27:27 +08:00
Wei Zhu
3fb478e743 Update Tree types 2018-06-21 14:38:44 +08:00
muzea
126bb42ddd remove deprecated prop 2018-06-21 13:49:00 +08:00
muzea
2ce3ffd6f4 fix punctuation 2018-06-21 13:49:00 +08:00
muzea
904fd0a358 form add how to get wrappedComponent's ref 2018-06-21 13:49:00 +08:00
afc163
68a110afa3 should use primary color for steps 2018-06-20 20:51:24 +08:00
zombiej
ac9368298f miss ? for TreeNode className prop 2018-06-20 17:41:12 +08:00
zombiej
17da353575 close #10950. Add className in TreeNode prop 2018-06-20 09:47:24 +08:00
Wei Zhu
b7879e909f docs: use title instead of key
Address #10949
2018-06-19 17:30:06 +08:00
afc163
e7fa6ca7eb Merge branch 'master' into feature-3.7.0 2018-06-19 15:31:53 +08:00
afc163
7fe027bfcf fix stylelint problem 2018-06-19 15:30:20 +08:00
dependabot[bot]
dd3490e4ef Update stylelint requirement to 9.3.0
Updates the requirements on [stylelint](https://github.com/stylelint/stylelint) to permit the latest version.
- [Release notes](https://github.com/stylelint/stylelint/releases)
- [Changelog](https://github.com/stylelint/stylelint/blob/master/CHANGELOG.md)
- [Commits](https://github.com/stylelint/stylelint/commits/9.3.0)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-06-19 15:28:42 +08:00
afc163
d6ee287924 bump 3.6.3 2018-06-19 15:15:11 +08:00
afc163
919e25d6d9 english changelog 2018-06-19 15:14:21 +08:00
afc163
39b4ff438f more changes 2018-06-19 15:14:21 +08:00
afc163
be8520de3c Add changelog for 3.6.3 2018-06-19 15:14:21 +08:00
afc163
8e8b991ba7 demo: fix table rowKey warning 2018-06-19 10:37:37 +08:00
afc163
b1d60f5ce1 Fix filterIcon className of Table, close #10937 2018-06-19 10:26:44 +08:00
愚道
5903fdb19f fix: Affix does not refix on offset prop changes 2018-06-19 10:04:15 +08:00
Alberto Gimeno
4b5d54671a Update App.tsx example to fix tslint errors
There were a few tslint errors and also the extension of the file name was `.js` instead of `.tsx`
2018-06-19 10:03:39 +08:00
Wei Zhu
5ab265a009 Fix small size fixed column table border
Close #9754
2018-06-15 17:40:32 +08:00
afc163
c540ceb8eb Fix fixed element in spin
close #10196
2018-06-15 14:09:51 +08:00
sliwey
450a497412 fix: upload preview can't show image when the image file use uppercase extension
1.fix: upload preview can't show image when the image file use uppercase extension.
	2.improve: remove unnecessary escape character.
2018-06-15 13:52:14 +08:00
afc163
4bf9114ee9 Merge branch 'master' into feature-3.7.0 2018-06-15 11:32:11 +08:00
afc163
a9c8998aea Merge branch 'feature-3.7.0' of github.com:ant-design/ant-design into feature-3.7.0 2018-06-15 11:31:53 +08:00
Wei Zhu
c96805254f More tests 2018-06-15 11:14:15 +08:00
Wei Zhu
7958860c95 Add snapshot 2018-06-15 11:14:15 +08:00
Wei Zhu
1c2385de98 Add polyfill 2018-06-15 11:14:15 +08:00
Wei Zhu
4ac0277813 Add Tag[visible] 2018-06-15 11:14:15 +08:00
ryannz
a5ff8e5de0 fix(AutoComplete): add missing backfill prop in type 2018-06-15 10:29:12 +08:00
hehe
07e06709f8 docs: fix typo 2018-06-15 10:25:17 +08:00
Zheeeng
980e2b1427 Update button signature (#10877) 2018-06-14 10:53:14 +08:00
afc163
713a0bcdc5 update snapshot 2018-06-13 20:21:52 +08:00
afc163
37ec04b21a Fix InputNumber style when zoom to 90% or below
close #10562
2018-06-13 17:31:26 +08:00
afc163
c403bd9738 Merge branch 'feature-3.7.0' of github.com:ant-design/ant-design into feature-3.7.0 2018-06-13 11:05:55 +08:00
dependabot[bot]
01460c0297 Update rc-tween-one requirement to ^2.0.1
Updates the requirements on [rc-tween-one](https://github.com/react-component/tween-one) to permit the latest version.
- [Release notes](https://github.com/react-component/tween-one/releases)
- [Changelog](https://github.com/react-component/tween-one/blob/master/HISTORY.md)
- [Commits](https://github.com/react-component/tween-one/commits/2.0.1)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-06-12 22:33:14 +08:00
zombiej
16e42601d6 auto position mode when contextMenu 2018-06-12 22:07:02 +08:00
afc163
637f30e6e3 Merge branch 'master' into feature-3.7.0 2018-06-12 19:38:30 +08:00
Lyndon001
f44584845b Update work-with-us.zh-CN.md 2018-06-12 17:22:16 +08:00
Lyndon001
f883a6f351 Update work-with-us.zh-CN.md 2018-06-12 17:20:55 +08:00
afc163
b3ed289904 chore: fix arrow position in Firefox 2018-06-12 16:27:46 +08:00
afc163
fd96967c87 upgrade rc-upload to 2.5
- support `directory` close #7315
- action can be a function return Promise
2018-06-12 16:07:06 +08:00
afc163
99d6e4c96c Merge branch 'master' into feature-3.7.0 2018-06-12 15:34:51 +08:00
Zheeeng
f36c6195b8 Fix typo (#10878)
First of all, thank you for your contribution! :-)

Please makes sure that these checkboxes are checked before submitting your PR, thank you!

* [x] Make sure that you propose PR to right branch: bugfix for `master`, feature for latest active branch `feature-x.x`.
* [x] Make sure that you follow antd's [code convention](https://github.com/ant-design/ant-design/wiki/Code-convention-for-antd).
* [x] Run `npm run lint` and fix those errors before submitting in order to keep consistent code style.
* [x] Rebase before creating a PR to keep commit history clear.
* [ ] Add some descriptions and refer relative issues for you PR.

Extra checklist:

**if** *isBugFix* **:**

  * [ ] Make sure that you add at least one unit test for the bug which you had fixed.

**elif** *isNewFeature* **:**

  * [ ] Update API docs for the component.
  * [ ] Update/Add demo to demonstrate new feature.
  * [ ] Update TypeScript definition for the component.
  * [ ] Add unit tests for the feature.
2018-06-12 14:36:08 +08:00
Sebastian Busch
ee0a7ce3bb Form: add missing type definition for form create option validateMessages
(Docs for validateMessages had been added in rev 16133aac65 )
2018-06-12 14:32:08 +08:00
Sebastian Busch
619b0ed628 add type definition for missing third parameter "allFields" to onFieldsChange (introduced
(_Implementation_ of this parameter had been added in 16133aac65 )
2018-06-12 14:32:08 +08:00
Wei Zhu
99cad890ef Fix Tree types, TreeNode is a ComponentClass
Close #10868
2018-06-12 10:57:19 +08:00
Yuxuan Huo
9aea9ddf58 expose input box-shadow h and v offset in theme variables 2018-06-11 20:20:24 +08:00
afc163
7e2ba7e6d3 site: fix code demo icon style in IE 2018-06-10 23:03:07 +08:00
Wei Zhu
c3769e3b96 Bump 3.6.2 2018-06-10 12:04:00 +08:00
Wei Zhu
f597c32aa6 Add 3.6.2 changelog (#10856) 2018-06-10 11:53:50 +08:00
Wei Zhu
4d6f8e96b9 Improve AutoComplete types
close #10619
2018-06-09 16:01:18 +08:00
dependabot[bot]
ae6de361e2 Update eslint-plugin-react requirement to 7.9.1 (#10760)
Updates the requirements on [eslint-plugin-react](https://github.com/yannickcr/eslint-plugin-react) to permit the latest version.
<details>
<summary>Release notes</summary>

*Sourced from [eslint-plugin-react's releases](https://github.com/yannickcr/eslint-plugin-react/releases).*

> ## v7.9.1
> Nothing was fixed; this is a republish with some updated deps. ([#1804](https://github-redirect.dependabot.com/yannickcr/eslint-plugin-react/issues/1804) [**ljharb**](https://github.com/ljharb))
</details>
<details>
<summary>Changelog</summary>

*Sourced from [eslint-plugin-react's changelog](https://github.com/yannickcr/eslint-plugin-react/blob/master/CHANGELOG.md).*

> ## [7.9.1] - 2018-06-03
> * Nothing was fixed; this is a republish with some updated deps. ([#1804][] [**ljharb**](https://github.com/ljharb))
> 
> [#1804]: https://github-redirect.dependabot.com/yannickcr/eslint-plugin-react/issues/1804
> 
> ## [7.9.0] - 2018-06-03
> ### Added
> * Add [`jsx-props-no-multi-spaces`][] rule ([#1755][] [**ThiefMaster**](https://github.com/ThiefMaster))
> * Add `first` option to [`jsx-indent-props`][] ([#398][] [**ThiefMaster**](https://github.com/ThiefMaster))
> * Add `enforceDynamicLinks` option to [`jsx-no-target-blank`][] ([#1737][] [**kenearley**](https://github.com/kenearley))
> 
> ### Fixed
> * Fix static lifecycle methods validation in [`sort-comp`][] ([#1793][] [**lynxtaa**](https://github.com/lynxtaa))
> * Fix crash in [`no-typos`][] when encountering anonymous react imports ([#1796][] [**jsg2021**](https://github.com/jsg2021))
> * Fix ESLint 3 support ([#1779][])
> 
> ### Changed
> * Documentation improvements ([#1794][] [**lencioni**](https://github.com/lencioni))
> * Update Travis CI configuration to test on multiple ESLint verions
> 
> [7.9.0]: https://github.com/yannickcr/eslint-plugin-react/compare/v7.8.2...v7.9.0
> [#1755]: https://github-redirect.dependabot.com/yannickcr/eslint-plugin-react/pull/1755
> [#398]: https://github-redirect.dependabot.com/yannickcr/eslint-plugin-react/issues/398
> [#1737]: https://github-redirect.dependabot.com/yannickcr/eslint-plugin-react/issues/1737
> [#1793]: https://github-redirect.dependabot.com/yannickcr/eslint-plugin-react/issues/1793
> [#1796]: https://github-redirect.dependabot.com/yannickcr/eslint-plugin-react/pull/1796
> [#1779]: https://github-redirect.dependabot.com/yannickcr/eslint-plugin-react/issues/1779
> [#1794]: https://github-redirect.dependabot.com/yannickcr/eslint-plugin-react/pull/1794
> 
> ## [7.8.2] - 2018-05-13
> ### Fixed
> * Fix crash in [`boolean-prop-naming`][] when encountering a required shape prop type ([#1791][] [**pcorpet**](https://github.com/pcorpet))
> 
> [7.8.2]: https://github.com/yannickcr/eslint-plugin-react/compare/v7.8.1...v7.8.2
> [#1791]: https://github-redirect.dependabot.com/yannickcr/eslint-plugin-react/issues/1791
> 
> ## [7.8.1] - 2018-05-12
> ### Fixed
> * Fix crash in [`no-deprecated`][] when encountering a class constructor ([#1785][] [**taddei**](https://github.com/taddei))
> 
> [7.8.1]: https://github.com/yannickcr/eslint-plugin-react/compare/v7.8.0...v7.8.1
> [#1785]: https://github-redirect.dependabot.com/yannickcr/eslint-plugin-react/issues/1785
> 
> ## [7.8.0] - 2018-05-11
> ### Added
> * Add support for fragments to [`react-in-jsx-scope`][] ([#1758][])
> * Add support for Flow generic PropType to [`require-default-props`][] ([#1724][] [**Miziak**](https://github.com/Miziak))
> * Add component whitelist option to [`forbid-component-props`][] ([#1732][] [**ThiefMaster**](https://github.com/ThiefMaster))
> * Add support for React 16.3 lifecycle methods to [`no-unused-prop-types`][] ([#1681][] [**bvaughn**](https://github.com/bvaughn))
> * Add support for React 16.3 lifecycle methods to [`sort-comp`][] ([#1767][] [**joe-denea**](https://github.com/joe-denea))
></table> ... (truncated)
</details>
<details>
<summary>Commits</summary>

- See full diff in [compare view](https://github.com/yannickcr/eslint-plugin-react/commits/v7.9.1)
</details>
<br />

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot ignore this [patch|minor|major] version` will close this PR and stop Dependabot creating any more for this minor/major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
- `@dependabot use (this|these) label[s]` will set the current labels as the default for future PRs for this repo and language
- `@dependabot use (this|these) reviewer[s]` will set the current reviewers as the default for future PRs for this repo and language
- `@dependabot use (this|these) assignee[s]` will set the current assignees as the default for future PRs for this repo and language

Additionally, you can set the following in your Dependabot [dashboard](https://app.dependabot.com):
- Update frequency (including time of day and day of week)
- Automerge options (never/patch/minor, and dev/runtime dependencies)
- Pull request limits (per update run and/or open at any time)
- Out-of-range updates (receive only lockfile updates, if desired)
- Security updates (receive only security updates, if desired)

Finally, you can contact us by mentioning @dependabot.

</details>
2018-06-09 14:51:15 +08:00
Wei Zhu
1a9456f03a Add boolean to CheckboxValueType
Close #10677
2018-06-09 14:39:42 +08:00
Wei Zhu
05c5115991 site: fix lint 2018-06-08 23:21:25 +08:00
bLue
8e26b6823a Fix spin delay issue if mounts with spinning=true (#10727)
* Fix spin delay issue if mounts with spinning=true

* Add test for spin delay issue

* Update spin lifecycle method
2018-06-08 23:13:47 +08:00
Wei Zhu
5174801b95 Revert "Upgrade react-dnd"
This reverts commit 71d2a991ed.
2018-06-08 19:01:54 +08:00
Wei Zhu
ac0b4bacc5 Revert "Update snapshot"
This reverts commit e7cd474894.
2018-06-08 19:01:34 +08:00
Wei Zhu
e7cd474894 Update snapshot 2018-06-08 18:13:51 +08:00
陈帅
789b54905c fix #10842 Badge status does not change with themes 2018-06-08 17:59:31 +08:00
Wei Zhu
71d2a991ed Upgrade react-dnd 2018-06-08 17:22:55 +08:00
picodoth
8610eb054f docs: remove changlog info for 3.6.1 2018-06-08 16:58:08 +08:00
zombiej
c488aca05e close #10666 #10821.Update tree support loadedKeys 2018-06-08 16:55:17 +08:00
afc163
f2fddff3fd upgrade rc-table to 16.2
close #10392
close #10379
close #10828
2018-06-08 16:32:04 +08:00
afc163
89f3b253a4 Merge branch 'master' into feature-3.7.0 2018-06-08 16:22:15 +08:00
afc163
71d3af310a Fix missing border in Button.Group
https://gw.alipayobjects.com/zos/rmsportal/hKuBQeoCgjruYXCGnrDt.png
2018-06-08 15:08:04 +08:00
Wei Zhu
89228118af docs: update moment locale usage 2018-06-08 12:22:22 +08:00
Kirill Alexander Khalitov
0ca1a990be Makes TreeNode component more type safe
Makes TreeNode component more type safe
2018-06-08 10:32:00 +08:00
Kirill Alexander Khalitov
74755fef99 Fix #10838
Fix [#10838](https://github.com/ant-design/ant-design/issues/10838)
2018-06-08 10:32:00 +08:00
Wei Zhu
396f81dbab Update cases.zh-CN.md 2018-06-07 11:58:16 +08:00
Wei Zhu
a4a3b5e12d Update cases.en-US.md 2018-06-07 11:57:11 +08:00
陈帅
2025a10a06 avatar img add "alt" prop (#10798) 2018-06-07 11:36:16 +08:00
zombiej
78adc05973 close #10745, move dropdownMatchSelectWidth into AbstractSelectProps 2018-06-07 10:24:12 +08:00
zombiej
b524e1fe7e adjust defaultProps def 2018-06-07 00:33:52 +08:00
jim
e51b043737 Merge branch 'master' into feature-3.7.0 2018-06-06 21:22:39 +08:00
zombiej
8444ad209d close #10786, spin icon css for adjust font size 2018-06-06 19:53:50 +08:00
zombieJ
4b360b5139 Spin support setDefaultIndicator (#10815)
* Add `setDefaultIndicator` in Spin
* Update doc

ref: https://github.com/ant-design/ant-design/issues/10787
2018-06-06 19:32:30 +08:00
afc163
77ad1e457b Fix progress demo 2018-06-06 17:40:47 +08:00
zombiej
8f449861cf fix progress test case & dropdown support alignPoint 2018-06-06 17:36:24 +08:00
杨小事er
ad52250256 fix(calendar): fix fullcalendar content 2px overflow 2018-06-06 16:59:42 +08:00
afc163
68b207e186 support Progress[strokeColor], close #10725 2018-06-06 16:18:00 +08:00
picodoth
8e60a591fd feat: provide default margin for dropdown menu item icon 2018-06-06 15:14:07 +08:00
Junbin Huang
e1ba74e5fc fix: still keep order when upload fails (#10794) 2018-06-06 12:13:06 +08:00
afc163
6602df16e6 Fix extra border style in Button.Group 2018-06-06 11:33:13 +08:00
afc163
17b158c091 Fix CheckboxAll status when remove data and selectedKeys
close #10629
2018-06-05 20:45:19 +08:00
Wei Zhu
c2d94ad84d Don't cache badge since they don't allow cor 2018-06-04 16:24:49 +08:00
Wei Zhu
57a01e1b9f Update offline-plugin 2018-06-04 15:00:43 +08:00
zombieJ
a825ed4e66 Directory Tree (#10139)
Support DirTree. close #7749
2018-06-04 11:20:17 +08:00
wangshantao
cdc571b17e 图片描述与内容不符 (#10755) 2018-06-04 10:41:47 +08:00
Junbin Huang
d69610a17f docs: update changelog for 3.6.1 (#10753) 2018-06-04 00:02:32 +08:00
Lyndon001
e13c1a678d Update introduce.zh-CN.md 2018-06-03 22:58:59 +08:00
afc163
248dbc2429 docs: update checkbox api 2018-06-03 16:28:20 +08:00
nuintun
ff24f1a978 Layout.Sider add onBreakpoint porp support (#10750)
* Layout.Sider add onBreakpoint porp support

* Add onBreakpoint zh-CN doc

* Add onBreakpoint en-US doc

* Add demo test for Layout.Sider onBreakpoint

* Add Layout.Sider onBreakpoint test cases
2018-06-03 13:03:20 +08:00
Junbin Huang
37d5f895d2 docs: clean up changelog (#10746) 2018-06-03 00:49:51 +08:00
picodoth
70ca0281ed 3.6.1 2018-06-02 20:41:59 +08:00
Junbin Huang
bbf5cb75c3 chore: update typescript@~2.9.1 (#10748) 2018-06-02 20:12:09 +08:00
Junbin Huang
30eacdfb1b chore: fix lint (#10747) 2018-06-02 18:49:39 +08:00
picodoth
f8314a6b1e docs: add author link correctly in changelog 2018-06-02 16:16:26 +08:00
picodoth
0ea890a0a4 docs: fix changelog typo 2018-06-02 16:02:43 +08:00
picodoth
0fdd13e5d6 chore: update change log for 3.6.0 2018-06-02 15:52:52 +08:00
picodoth
15637c885b 3.6.0 2018-06-02 15:52:52 +08:00
Jack Works
163ec46cbb Fix #9859, #9858 (#10294)
First of all, thank you for your contribution! :-)

Please makes sure that these checkboxes are checked before submitting your PR, thank you!

* [x] Make sure that you propose PR to right branch: bugfix for `master`, feature for latest active branch `feature-x.x`.
* [x] Make sure that you follow antd's [code convention](https://github.com/ant-design/ant-design/wiki/Code-convention-for-antd).
* [x] Run `npm run lint` and fix those errors before submitting in order to keep consistent code style.
* [x] Rebase before creating a PR to keep commit history clear.
* [x] Add some descriptions and refer relative issues for you PR.

Extra checklist:

**if** *isBugFix* **:**

  * [-] Make sure that you add at least one unit test for the bug which you had fixed.
2018-06-02 15:49:11 +08:00
Wei Zhu
2b5abd6dec Use forked offline-plugin 2018-06-02 14:20:03 +08:00
picodoth
e25323882a Merge branch 'feature-3.6.0' 2018-06-02 13:36:05 +08:00
afc163
e124cabc5b update badge snapshot test 2018-06-02 13:18:25 +08:00
Wei Zhu
7149d1fdff Add offline support (#10738)
* site: add offline support

* test update

* Revert "test update"

This reverts commit e1cb2fba80.

* use reduce
2018-06-02 12:46:09 +08:00
hank
5be1b9c33c Fix issue #8666 (#10739)
* fix issue #8666

* add issue #8666 test
2018-06-01 18:09:11 +08:00
Karol Majewski
7c273912fd Fix #10729 (#10730)
* Lift the requirement of the omitted keys being of string type

* Remove unused Diff mapped type
2018-06-01 16:58:15 +08:00
Wei Zhu
87163dfcd6 tests: mock xhr request
Close #10342
2018-05-31 22:37:09 +08:00
Wei Zhu
05251682f1 Remove window reference 2018-05-30 18:13:22 +08:00
Wei Zhu
31be3717ad Upgrade react-dnd 2018-05-30 17:56:56 +08:00
zombiej
ca7ed4c07d clean up 3.5.5 since warning 4.0.1 already fixed 2018-05-30 17:12:18 +08:00
dependabot[bot]
64a29dfd1a Update warning requirement to ~4.0.1
Updates the requirements on [warning](https://github.com/BerkeleyTrue/warning) to permit the latest version.
- [Release notes](https://github.com/BerkeleyTrue/warning/releases)
- [Changelog](https://github.com/BerkeleyTrue/warning/blob/master/CHANGELOG.md)
- [Commits](https://github.com/BerkeleyTrue/warning/commits/v4.0.1)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-05-30 15:18:58 +08:00
afc163
b5c5f0b5d4 update snapshot 2018-05-29 23:50:49 +08:00
Wu Haotian
4f91fe61bf add z-index for fixed header demo
#10693
2018-05-29 23:49:09 +08:00
Eduardo Ludi
7f16ded760 Updates test for Transfer (removes snapshot) 2018-05-29 17:54:31 +08:00
Eduardo Ludi
9bc98b6471 Adds some tests for Transfer custom styles. 2018-05-29 17:54:31 +08:00
Eduardo Ludi
e8351b8104 Adds style prop to Transfer operation. 2018-05-29 17:54:31 +08:00
Eduardo Ludi
6d610de157 Adds support for custom styles in Transfer and Transfer operation. 2018-05-29 17:54:31 +08:00
Oleg Kuzava
be7f540fba Fix breakpoint for mobile view 2018-05-29 14:05:40 +08:00
afc163
814ee7365a tweak popover arrow style detail 2018-05-28 23:29:04 +08:00
afc163
5fd4139661 Fix Affix offsetBottom not working, close #10674 2018-05-28 17:49:11 +08:00
zombiej
e14928b4f9 update doc 2018-05-28 17:09:49 +08:00
zombiej
19a04e52f4 update change log 2018-05-28 15:34:04 +08:00
afc163
21ca50fca1 Merge branch 'master' into feature-3.6.0 2018-05-28 14:41:02 +08:00
afc163
38f94990f8 Merge branch 'feature-3.6.0' of github.com:ant-design/ant-design into feature-3.6.0 2018-05-28 14:40:58 +08:00
zombiej
d18f100721 Bump 3.5.5 2018-05-28 14:37:57 +08:00
Wu Haotian
b10e7c4e82 downgrade warning to 3.0.0 2018-05-28 14:00:29 +08:00
zombiej
9552f80cde update change-log 2018-05-27 10:39:03 +08:00
zombiej
ad0108dfd5 bump 3.5.4, update change log 2018-05-26 23:59:18 +08:00
zombiej
a6e2037c06 update test case 2018-05-26 23:18:18 +08:00
afc163
ac4a9086a0 test: press enter to search 2018-05-26 17:03:07 +08:00
afc163
12d0aedeca docs: make markdown format 2018-05-26 16:57:52 +08:00
afc163
36ffe7e1dc Search icon could be clicked, close #10634 2018-05-26 16:52:33 +08:00
Eric Celeste
b86f4eeaad improve english 2018-05-26 13:26:11 +08:00
afc163
3ceb619b92 Fix and optimize table demo, close #10639 2018-05-26 00:54:30 +08:00
clinyong
baa78bfa5f Change default word-break to break-word 2018-05-26 00:22:03 +08:00
afc163
8c2f99fd3e test alert 2018-05-25 21:56:57 +08:00
afc163
50057739bf Add test cases for Anchor 2018-05-25 21:43:21 +08:00
afc163
3a445f3e75 more test cases 2018-05-25 21:43:21 +08:00
afc163
be13326a1b Fix typo 2018-05-25 21:43:21 +08:00
afc163
93b14da4a6 improve test code 2018-05-25 21:43:21 +08:00
afc163
21db29bd53 Add test cases for Badge 2018-05-25 21:43:21 +08:00
afc163
d58c0780f9 test Popconfirm 2018-05-25 21:43:21 +08:00
afc163
042c014a38 test => it 2018-05-25 21:43:21 +08:00
afc163
aff9d8fc62 fix lint 2018-05-25 21:43:21 +08:00
afc163
b7b12b657c test: test carousel 2018-05-25 21:43:21 +08:00
afc163
0feaf95629 Fix breadcrumb test case 2018-05-25 21:43:21 +08:00
afc163
076540c83e test: breadcrumd work with react-router 2018-05-25 21:43:21 +08:00
afc163
3db0610d52 Add test case for Cascader 2018-05-25 21:43:21 +08:00
afc163
7222944347 test babel-plugin-import warning 2018-05-25 21:43:21 +08:00
afc163
322ebf0039 fix badge snapshot 2018-05-25 21:43:21 +08:00
Jinxuan Zhu
c2519e776b Add promise-like interface (#10470)
* Add promise-like interface

* Keep hide interface

* Shorten

* Test Promise

* Update document

* Update demo: 2.5 second is insignificant with the default 3s hiding

* Update demo: then  interface

* Fix line break

* Chainable

* Thenable demo

* Thenable test

* Fix tsc error

* Fix tsc error

* Better document

* Revert change in loading.md

* Change snapshot
2018-05-25 20:41:07 +08:00
Winter Zhong
33b604f7a8 Fix issue #10635 Parent element set text-align break Spin (#10643)
* fix the issue when settingthe  parent ele text-align center, the spin is on the right

* put the display in the proper place
2018-05-25 20:40:17 +08:00
dependabot[bot]
4c101275a5 Update jest requirement to ^23.0.0 (#10653)
Updates the requirements on [jest](https://github.com/facebook/jest) to permit the latest version.
- [Release notes](https://github.com/facebook/jest/releases)
- [Changelog](https://github.com/facebook/jest/blob/master/CHANGELOG.md)
- [Commits](https://github.com/facebook/jest/commits/v23.0.0)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-05-25 16:31:51 +08:00
dependabot[bot]
4c1b2369d7 Update warning requirement to ~4.0.0 (#10654)
Updates the requirements on [warning](https://github.com/BerkeleyTrue/warning) to permit the latest version.
- [Release notes](https://github.com/BerkeleyTrue/warning/releases)
- [Changelog](https://github.com/BerkeleyTrue/warning/blob/master/CHANGELOG.md)
- [Commits](https://github.com/BerkeleyTrue/warning/commits/v4.0.0)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-05-25 16:31:34 +08:00
afc163
cbff10db15 test: update snapshots 2018-05-25 14:25:26 +08:00
afc163
b7cf33d1eb Fix test case temporarily 2018-05-24 21:45:40 +08:00
afc163
b828a599fb Fix test case temporarily 2018-05-24 21:40:56 +08:00
Rongjian Zhang
f3869270ae Fix #10142: Add theme props to Layout.Sider (#10631)
* Fix #10142: Add `theme` props to `Layout.Sider`

* Update documentation of Layout.Sider for new theme props

* Fix snapshot tests

* Add unit test for sider theme
2018-05-23 23:46:28 +08:00
afc163
2989e8dba0 docs: update API 2018-05-23 22:36:06 +08:00
afc163
6d8df2ac25 test: improve affix test case 2018-05-23 21:03:32 +08:00
Dmitry Snegirev
fd96b4a784 Added missing prop firstActiveValue in Select component (#10636) 2018-05-23 19:13:11 +08:00
jim
af8f4dc5c3 Merge branch 'master' into feature-3.6.0 2018-05-23 16:34:59 +08:00
afc163
8da79f4b34 Badge[status] should work with Tooltip
close #10626
2018-05-23 13:11:49 +08:00
afc163
247d78990e demo: improve editable row demo 2018-05-23 11:32:23 +08:00
Douglas Mason
acb56281f8 fix: update "from" to "form" in code example (#10628)
update `save` method parameter from `from` to `form` in code example
2018-05-23 10:55:20 +08:00
afc163
fafd83cadc Fix mention test case in react 15 2018-05-22 23:29:09 +08:00
afc163
7e96ae1a6a add jest.runAllTimers 2018-05-22 23:29:09 +08:00
afc163
3c381c6dd1 fix test case skip 2018-05-22 23:29:09 +08:00
afc163
292a91a777 Add test cases for Mention 2018-05-22 23:29:09 +08:00
afc163
89ed0dcb35 fix autoUpdateProgress percent and add test case 2018-05-22 23:29:09 +08:00
afc163
77301c378f skip mention test when test dist file 2018-05-22 23:29:09 +08:00
afc163
22d2f9eb01 update snapshot 2018-05-22 23:29:09 +08:00
afc163
3078819535 jest mock generateRandomKey for ssr test
facebook/draft-js#702
2018-05-22 23:29:09 +08:00
afc163
6471e5d4f0 write snapshot files 2018-05-22 23:29:09 +08:00
afc163
1e585135aa Try test mention to see what the problem is 2018-05-22 23:29:09 +08:00
Shun
6057821f39 Change order of loader option in docs (#10627) 2018-05-22 23:08:44 +08:00
Ivan Trofimov
33c58a8ef6 Update ru_RU.tsx (#10616)
* Update locale-provider ru_RU and tests

* Update locale-provider ru_RU and tests: patch-2
2018-05-22 16:31:12 +08:00
paranoidjk
b09e03d82a doc(Input): fix wrong desc about input size in form. 2018-05-22 06:50:14 +00:00
偏右
a2e0e40caa [WIP] Use raf to replace getRequestAnimationFrame (#10614)
* use raf to replace getRequestAnimationFrame

* remove isCssAnimationSupported
2018-05-22 13:01:28 +08:00
dependabot[bot]
f409df8d84 Update react-virtualized requirement to ~9.19.0 (#10552)
Updates the requirements on [react-virtualized](https://github.com/bvaughn/react-virtualized) to permit the latest version.
- [Release notes](https://github.com/bvaughn/react-virtualized/releases)
- [Changelog](https://github.com/bvaughn/react-virtualized/blob/master/CHANGELOG.md)
- [Commits](https://github.com/bvaughn/react-virtualized/commits/9.19.0)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-05-22 11:26:32 +08:00
afc163
a148bc7b79 doc: update dependencies check badages 2018-05-22 11:26:12 +08:00
Walter Barbagallo
4077ffb58c Enhanced InputNumber props with HTMLInputElement attributes. (#10608)
* Enhanced InputNumber props with HTMLInputElement attributes.

It is possibile to use additional props supported by the inner input
element:

```
const inputEl = <InputNumber autoFocus />
```

Before this commit the type checker did not recognize the `autoFocus`
prop.

Some attributes must be omitted because they conflict with props
defined on `InputNumberProps` interface

* Renamed type

Probably they conflicts with a reserved name?
@see https://travis-ci.org/ant-design/ant-design/jobs/381668406
> components/input-number/index.tsx(9,93): error TS4022: 'extends' clause of exported interface 'InputNumberProps' has or is using private name 'OmitAttributes'.

* Replace InputNumber onKeyDown typing with the typed one.

Extending HTMLInputElement attributes the `onKeyDown` props now have a
better typing.

For example before this commit accessing to the event `key` attribute resulted
in a type error.
@see https://reactjs.org/docs/events.html#keyboard-events

* Exporting type OmitAttrs on InputNumber component.

This is an attempt to solve the ci error:
> components/input-number/index.tsx(9,93): error TS4022: 'extends' clause of exported
> interface 'InputNumberProps' has or is using private name 'OmitAttrs'.

@see https://travis-ci.org/ant-design/ant-design/jobs/381678316
2018-05-22 10:46:20 +08:00
Ezekiel Keator
bb4bc61556 Added missing API documentation (#10611)
* Added missing API documentation

Added missing Divider API documentation.

* Corrected styling

Corrected styling on dash to match other documentation pages.
2018-05-22 10:46:01 +08:00
afc163
0fc5a0ece5 site: add alt to images 2018-05-21 23:47:22 +08:00
afc163
6458280cb3 site: add alt to images 2018-05-21 23:42:57 +08:00
afc163
0f73b5d3f7 site: upgrade analytics code 2018-05-21 23:27:26 +08:00
afc163
14beee1fe1 site: add baidu tongji 2018-05-21 22:58:12 +08:00
dependabot[bot]
e0312f65ee Update stylelint requirement to 9.2.1 (#10553)
Updates the requirements on [stylelint](https://github.com/stylelint/stylelint) to permit the latest version.
- [Release notes](https://github.com/stylelint/stylelint/releases)
- [Changelog](https://github.com/stylelint/stylelint/blob/master/CHANGELOG.md)
- [Commits](https://github.com/stylelint/stylelint/commits/9.2.1)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-05-21 22:33:53 +08:00
Zheeeng
389c7c4f10 DRY the styles writing for maintenance (#10220) 2018-05-21 21:53:20 +08:00
Zheeeng
59fe98a194 Add position config for List pagination (#10581) 2018-05-21 21:52:18 +08:00
Jamie.LiuMJ
2955600642 fix clearfix (#10563) 2018-05-21 21:52:15 +08:00
sosohime
d4ed303bcd doc: Update DatePicker document about locale (#10598) 2018-05-21 21:51:39 +08:00
Wei Zhu
ff458a2c3f Improve Input type definitions
Close #10166
2018-05-21 21:31:59 +08:00
zombiej
06ffd9ca04 Adjust Tree icon vertical-align, fix #10603 2018-05-21 21:24:16 +08:00
afc163
251d882101 fix dropdown any type 2018-05-21 21:02:03 +08:00
afc163
129baddc44 Remove some typescript any types of cascader 2018-05-21 20:35:14 +08:00
afc163
968488a2fa fix: Cascader showSearch not working bug, close #10599 2018-05-21 18:07:56 +08:00
afc163
00d710cef0 demo: fix select demo order 2018-05-21 17:07:39 +08:00
afc163
ddc242a9cb Merge branch 'master' into feature-3.6.0 2018-05-21 16:11:57 +08:00
jim
d6a554823f Rollback ci modification 2018-05-20 21:38:29 +08:00
jim
fd1d9661c0 update snap fix ci 2018-05-20 15:49:56 +08:00
jim
07b24f4edd fix doc 2018-05-20 14:57:52 +08:00
jim
dbd2bd1866 release 3.5.3 2018-05-20 14:57:52 +08:00
Zheeeng
8b420c41bb Fix typo (#10582)
* Fix typo: splited -> separated

* Fix typo: splited -> separated
2018-05-20 00:50:19 +08:00
方剑成
96d53aefb8 Remove redundant icons (#10583) 2018-05-20 00:49:48 +08:00
afc163
8e2f72ffe0 tweak dropdown menu item padding 2018-05-19 20:34:19 +08:00
afc163
29229ebee7 fix: input onDoubleClick type, close #10518 2018-05-19 20:01:47 +08:00
afc163
e1ad91119a change deps badges 2018-05-18 23:59:42 +08:00
dependabot[bot]
76bf36a79b Update eslint-plugin-react requirement to 7.8.2 (#10493)
Updates the requirements on [eslint-plugin-react](https://github.com/yannickcr/eslint-plugin-react) to permit the latest version.
- [Release notes](https://github.com/yannickcr/eslint-plugin-react/releases)
- [Changelog](https://github.com/yannickcr/eslint-plugin-react/blob/master/CHANGELOG.md)
- [Commits](https://github.com/yannickcr/eslint-plugin-react/commits/v7.8.2)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-05-18 23:43:37 +08:00
Wei Zhu
aa87fcb01e Update snapshot 2018-05-18 18:53:26 +08:00
Wei Zhu
1ed9fed2cf Improve Button and Tag types 2018-05-18 18:22:33 +08:00
afc163
7c4f6e8b2a fix: Revert checkbox z-index
fix #10480

ref #10452

reverted for #10385
2018-05-18 15:36:54 +08:00
Zohaib Ijaz
df7ef9a833 site: Repalced generateColorLess script with antd-theme-generator
* Repalced generateColorLess script with antd-theme-generator which allows to dynamically change theme for all color variables

* Updated antd-theme-generator version

* Updated Ant styles directory path
2018-05-18 12:01:32 +08:00
afc163
9b17a943f5 site: use correct locale for component 2018-05-18 11:34:26 +08:00
qhxin
7404b7f36c fix Affix/index.tsx while offsetTop === 0 and offsetBottom is numberic (#10566)
* Update index.tsx

Fix: if offsetTop === 0, it will get undefined, if offsetBottom is type of number, offsetMode will be { top: false, ... }

* Update index.tsx
2018-05-18 10:18:19 +08:00
Walter Barbagallo
963120f702 Improved Form component typings (#10564)
* Improved Form component typings

With this fix you can use HTMLFormElement attributes on Form component
without getting TypeScript errors.

For example this code does not longer produce error for the additional
`autoComplete` prop:

```
const myForm = (
  <Form autoComplete="off">
    ...
  </Form>
)
```

* Fix onBlur / onChange typings with Input component

This improvement fix a typing issue incompatibility with
`react-final-form`
The incompatibility involve [this
line](https://github.com/final-form/react-final-form/blob/v3.4.2/src/index.d.ts#L20)
where the handler argument is a more specific SyntheticEvent
2018-05-17 23:45:13 +08:00
Wei Zhu
b7d508e166 Fix Row gutter type 2018-05-17 21:47:09 +08:00
afc163
cafeb8e3eb fix button group split border color 2018-05-17 21:36:05 +08:00
afc163
99dca86904 update button disable demo 2018-05-17 21:23:36 +08:00
afc163
09d5e36cfa style: fix hightlight link color in menu item 2018-05-17 21:17:20 +08:00
afc163
6e0865f691 fix less compile error 2018-05-17 17:20:47 +08:00
afc163
eb17aae25c Fix less import error again 2018-05-17 15:21:31 +08:00
afc163
593435ce65 fix import path 2018-05-17 14:39:33 +08:00
afc163
c4f58e7027 fix import path 2018-05-17 11:04:14 +08:00
afc163
b76910f63f fix typo 2018-05-16 11:49:35 +08:00
afc163
12d3046687 style: unify the less vars naming 2018-05-15 17:02:01 +08:00
afc163
d5d0501ac7 site: change footer ui 2018-05-15 12:40:15 +08:00
Wei Zhu
c7c85e3d5d docs: Revert unexpected modify 2018-05-15 12:11:21 +08:00
Wei Zhu
78af67a057 docs: fix table custom search panel demo
close #10494
2018-05-15 11:58:02 +08:00
Reed Sun
604584931e fix text error (#10510)
回掉 => 回调
2018-05-15 11:22:29 +08:00
afc163
77e21d33ea site: fix link 2018-05-14 21:25:38 +08:00
afc163
bdb4483ef5 site: add kitchen link in footer 2018-05-14 19:52:51 +08:00
Andreas Cederström
97c2d58d15 remove bundle size warning in test env (#10363) 2018-05-14 17:13:27 +08:00
Winter Zhong
f09c799bba add the border-right-width to fix the Input.Group component covered box-shadow effect (#10492) 2018-05-14 17:11:11 +08:00
afc163
bc8353729c site: add kitchen homepage 2018-05-14 13:58:54 +08:00
Wei Zhu
bf03d954d4 docs: Fix indent 2018-05-14 12:29:04 +08:00
Xiping.wang
413479a5b9 修改案例title值,原title值容易产生误导
修改案例title值,原title值容易产生误导
2018-05-14 12:08:50 +08:00
afc163
5e0b8df412 site: fix button align of home page 2018-05-14 00:07:39 +08:00
afc163
3413774ae5 update changelog 2018-05-14 00:06:06 +08:00
valleykid
41b9a79edb release 3.5.2 2018-05-13 22:51:50 +08:00
afc163
35b751da15 site: better responsive 2018-05-12 14:02:34 +08:00
afc163
f3545ccdc7 Merge branch 'master' into feature-3.6.0 2018-05-12 13:49:33 +08:00
Oleg Kuzava
71abb96de7 Allow to use any CSS units for layout width (#10479)
* Allow to use any CSS units for layout width

* Fix ts issues

* Fix parseFloat type check

* add tests for width in Sider

* clean up
2018-05-12 02:30:33 +08:00
dependabot[bot]
dd7fb9d351 Update unified requirement to ^7.0.0 (#10474)
Updates the requirements on [unified](https://github.com/unifiedjs/unified) to permit the latest version.
- [Release notes](https://github.com/unifiedjs/unified/releases)
- [Commits](https://github.com/unifiedjs/unified/commits/7.0.0)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-05-11 16:02:36 +08:00
tangjinzhou
4adf0b2571 docs: add vue-antd-ui link (#10463) 2018-05-10 23:56:22 +08:00
jiang
9e01b24272 fix 10445 (#10457)
* fix 10445

* re help anim timing

* refactor

* use this.helpShow

* is show no set state

* remove state.helpShow
2018-05-10 21:48:11 +08:00
jiang
1b8030ec59 Update customize-theme.zh-CN.md 2018-05-10 19:56:38 +08:00
jiang
2747aa341d Update customize-theme.en-US.md 2018-05-10 19:56:18 +08:00
picodoth
030c745e1b fix: checkbox trigger twice
regression introduced from d93cfde
2018-05-10 19:04:37 +08:00
Christopher Deutsch
dd0d4214d1 Omit 'ref' from ButtonProps otherwise typing conflicts occur. (#10426)
Fixes #10405
2018-05-10 11:21:07 +08:00
afc163
6eef4d0a42 chore: code style 2018-05-10 11:01:58 +08:00
afc163
6e6b1ccdec chore: code style 2018-05-10 10:59:33 +08:00
Jinxuan Zhu
832c524b32 Use local tslint config; simplify editor configuration (#10450) 2018-05-10 00:36:19 +08:00
afc163
bc4143f8a3 Fix Cascader displayRender z-index issue, close #10433 2018-05-09 18:16:08 +08:00
afc163
be31f17bca Change Dropdown.Button default icon to ellipsis 2018-05-09 18:01:07 +08:00
Lyndon001
dcb75a789d Update work-with-us.zh-CN.md 2018-05-09 17:56:19 +08:00
afc163
ffc182f4eb release 3.5.1 2018-05-09 16:35:18 +08:00
afc163
fbf09e86af site: show version info in home page 2018-05-09 10:45:45 +08:00
Xiaoming
7f2159e928 Message doc update & change variable statement (#10420)
* eslint disallow use of chained assignment expressions

eslint disallow use of chained assignment expressions

* revert

* message-doc-update

1.If a variable is never reassigned, using the const declaration is
better.
2.Defaultvalue’s type must be ‘number’ depend on type
2018-05-08 21:59:28 +08:00
Wei Zhu
04ee8526ab Revert "Fix table scroll x (#9704)"
This reverts commit 0d9dcb1714.
2018-05-08 16:23:10 +08:00
konakona
6c0d6d302a Add feature: can use type ReactNode for message of rules (#10136) (#10395)
* Add feature: can use type ReactNode for message of rules (#10136)

* fix: Replace React.Fragment to span

* Add unit test for Form (Not passed)

* fix: unit test of Form

* fix: unit test of Form & remove demo

* fix: update unit test for Form

* Refine code for Form

* Add error check for getHelpMessage
2018-05-08 14:00:00 +08:00
konakona
06f205874f Add missing semicolon (#10410)
* Add missing semicolon

* Remove semicolon for custom-typings.d.ts
2018-05-08 13:03:27 +08:00
afc163
20495dd5ba Fix monospaced number font weight issue
http://codesandbox.io/s/w705jk5wz7
2018-05-07 21:19:16 +08:00
陈帅
d5c5219111 new edit Table demo (#10119)
* new edit Table demo

* fix test error

* fix ci

* typo

* Skip edit-row test for React 15

* Set column width

* Update snapshot
2018-05-07 20:50:43 +08:00
afc163
5e99a93930 Fix collapse focused style 2018-05-07 17:57:49 +08:00
Zohaib Ijaz
bd81877cf8 #10007: Dynamic/Runtime Theme (#10384)
- Added links  to related articles
2018-05-07 16:12:28 +08:00
Wei Zhu
8a6d9b92b7 Improve table types
Fix #10374
2018-05-07 12:32:26 +08:00
afc163
d93cfdef09 clean up unnecessary z-index
close #9840

close #10385
2018-05-06 21:50:50 +08:00
afc163
e86f17186b Fix select test snapshot 2018-05-06 14:58:05 +08:00
afc163
6d91a3eb4a Fix select arrow overlap bug, close #10383
introduced by #10092, this commit also fix #10092
2018-05-06 14:54:27 +08:00
afc163
d95379cfa5 Fix broken style of Input with addons, close #10371 2018-05-05 19:50:48 +08:00
afc163
dbde26e560 docs: add disabled prop doc for Button, close #10373 2018-05-05 13:18:50 +08:00
Karol Majewski
1479726932 Use exact type for Breadcrumb.Item (#10372)
Using "any" breaks the build for TSLint users having the "no-unsafe-any" rule enabled.

See https://palantir.github.io/tslint/rules/no-unsafe-any/
2018-05-05 00:47:44 +08:00
愚指导
9368e2df87 Bump 3.5.0 (#10297) 2018-05-04 18:15:28 +08:00
Zheeeng
7f8cb838e3 Remove the side effects in render method (#10357) 2018-05-04 17:37:31 +08:00
愚指导
0f7794946f upgrade rc-cascader to 1.13.0 for support filedNames (#10365) 2018-05-04 17:27:34 +08:00
Christian
f4b8a58480 fixes #10289 and #10209: lost of user selection on table data updates (#10332)
* fixes #10289 and #10209: lost of user selection on table data updates

* adds shallowequal check
2018-05-04 14:51:15 +08:00
Wu Haotian
6019245365 fix(button): use React.HTMLProps for button's props (#10229) 2018-05-04 14:48:41 +08:00
Wei Zhu
3fd9397174 Keep text align center
Fix prev commit
2018-05-04 14:33:06 +08:00
Wei Zhu
f1e38a1573 Fix table merged header cell border
Fix #10359
2018-05-04 14:30:21 +08:00
愚道
013df45a70 merge https://github.com/ant-design/ant-design/pull/10306 from feature-3.5.0 2018-05-03 16:58:50 +08:00
afc163
5ee4d20e2a should still have padding when card which set padding to 0 is loading 2018-05-03 15:17:04 +08:00
afc163
c9017b6c6c release 3.4.5 2018-05-03 14:27:37 +08:00
Michael Wang
05e702a2b4 Remove useless characters in doc (#10340) 2018-05-03 11:52:50 +08:00
paranoidjk
8e166915a9 fix(Select): value tsd (#10336) 2018-05-03 11:28:30 +08:00
Xiaoming
9c6fef0604 treeSelect doc (#10302)
TreeSelect implement Tree as popup panel which use title as the display
text.
To follow the Select definition (label as display text), TreeSelect
internal convert the prop label into title to the Tree component (but
will follow if title is set).
ref:
https://github.com/react-component/tree-select/blob/master/src/Select.js
x#L44
2018-05-03 11:26:59 +08:00
paranoidjk
b6f8ab89c7 Fix: Form tsd (#10324)
* Fix(form): wrappedComponentRef interface

- ref: https://github.com/react-component/form/blob/master/src/createBaseForm.js#L499

* refactor: use ts conditional type

* fix: merge

* Revert "refactor: use ts conditional type"

This reverts commit ab3035da83.
2018-05-02 18:24:51 +08:00
Wei Zhu
56e3384c6b Revert "MenuItem: avoid rendering Tooltip unless necessary (#9636)"
This reverts commit 0754845aff.

Conditional rendering will break the transition animation,
since React will create new DOM node when inlineCollapsed changges.

Fix https://github.com/react-component/menu/issues/139
2018-05-02 14:49:20 +08:00
afc163
b5a52d26f2 fix snapshot 2018-05-02 14:28:16 +08:00
afc163
70a42545e3 fix fileToObject, close #10319 2018-05-02 13:56:54 +08:00
afc163
fb38e55cc0 more test about button text 2018-05-01 19:36:11 +08:00
afc163
c7471a4653 tweak insert space logic of loading button 2018-05-01 19:33:38 +08:00
afc163
726f0466bc menu should be unfocusable defaultly 2018-05-01 18:53:44 +08:00
Wei Zhu
a4261f9344 Only lock issues 2018-05-01 18:32:48 +08:00
Wei Zhu
0616b05583 Add lock threads robot 2018-05-01 13:56:25 +08:00
afc163
d0c3752a4e we can remove @types/node now 2018-05-01 13:49:37 +08:00
Daniel Gomez
3a5fce7256 Fix UploadFile's lastModifiedDate property name (#10315) 2018-05-01 00:11:18 +08:00
afc163
74e36325a2 site: tweak style 2018-04-29 23:02:07 +08:00
Junbin Huang
3a3d550b54 chore: upgrade menu (#10305)
* chore: upgrade menu and select

* Add test case for coverage percent
2018-04-29 23:01:58 +08:00
Ash Kumar
013932e6d3 Feature: (Issue 10213): Column 'sorter' function is passed 'sortOrder' as param (#10306)
* Table Column's sorter prop can now be provided a fn to which 'sortOrder' is passed as param

* head.md: added documentation for new use of 'sorter' prop function
2018-04-29 22:08:28 +08:00
Benjy Cui
cd6ad64cab chore: remove advertisement for yuque (#10299) 2018-04-29 10:42:45 +08:00
afc163
81dd432e31 update select demo 2018-04-28 23:56:38 +08:00
afc163
4535e9d4f1 Fix Select extra space taken up when arrow disabled
close #10092
2018-04-28 23:38:05 +08:00
偏右
4956dd8042 Release 3.4.4 (#10296)
* add `lib/**/style/*` as sideEffects (#10217)

* Fix upload onChange arg type when beforeUpload return false, close #10293

* 3.4.4

* Fix ts error temporarily, DefinitelyTyped/DefinitelyTyped#25342
2018-04-28 15:36:19 +08:00
guifu
548d8c9c51 chore: update menu to ~6.3.0 2018-04-28 14:12:37 +08:00
愚道
8b64882562 Merge branch 'master' of github.com:ant-design/ant-design 2018-04-28 11:10:54 +08:00
愚道
6682a56922 fix snapshot ci 2018-04-28 11:09:15 +08:00
afc163
e97977b891 Fix upload onChange arg type when beforeUpload return false, close #10293 2018-04-28 11:06:32 +08:00
愚道
b45146486a merge feature-3.5.0 2018-04-28 11:04:10 +08:00
afc163
8b02a21d36 site: valid primary color range 2018-04-27 22:09:49 +08:00
afc163
be43e56835 site: fix color tool, close #10265 2018-04-27 21:23:51 +08:00
afc163
7f8f89cbff doc: Add mode and onPanelChange in API document, close #9785 2018-04-27 20:17:39 +08:00
Thiebaud Thomas
a1e186b8a3 Fix type for placeholder in select component (#10282) 2018-04-27 18:22:10 +08:00
afc163
3d079af7cd Fix Input.Group align issue in Form, close #10281 2018-04-27 15:57:27 +08:00
afc163
1f6107e94a Fix naming convention, close #10275 2018-04-27 13:21:51 +08:00
afc163
e40c2a7f45 Fix notification icon hover color, close #10272 2018-04-27 10:48:40 +08:00
afc163
d9053a2526 Tweak sort position again 2018-04-26 16:15:04 +08:00
afc163
4b1857d587 fix spin loading 2018-04-26 16:06:18 +08:00
Marcela Bomfim
b1c41c665e Fix typo (#10250)
Fix typo
2018-04-25 21:59:14 +08:00
afc163
c85758fd01 Fix spin container interaction, close #10227 2018-04-25 14:55:16 +08:00
afc163
52c8f34a73 Fix radio border radius 2018-04-25 11:08:21 +08:00
Wu Haotian
4ea20e696c fix(form): fix typing for Form.onValuesChange (#10231) 2018-04-24 23:33:58 +08:00
afc163
a268dc8d62 Fix dashed Divider, close #10216 2018-04-24 20:17:48 +08:00
Wu Haotian
262ed8eec3 add lib/**/style/* as sideEffects (#10217) 2018-04-24 14:03:32 +08:00
Samuel Gaus
4bc28ac471 Update jsx.md (#10203)
Made it clear that you can't use components other than Column or ColumnGroup as children to Table.
2018-04-23 21:57:43 +08:00
愚指导
4101d182e0 Bump 3.4.3 (#10198) 2018-04-23 17:23:35 +08:00
薛定谔的猫
14dbcb95ed fix: sideEffects: false cause css file not bundled (fixes #10190) (#10197) 2018-04-23 17:08:24 +08:00
dependabot[bot]
14fa376dff Update majo requirement to ^0.6.2 (#10195)
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/commits/v0.6.2)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-04-23 16:00:37 +08:00
Zheeeng
6a3e6f55cf Fix typo (#10193) 2018-04-23 16:00:24 +08:00
Wei Zhu
fa5491a390 Add @babel/types@7.0.0-beta.44 as devDependencies 2018-04-23 15:03:17 +08:00
Zheeeng
4ad5985df7 Prefer using 'truthy' over 'falsyless' (#10191) 2018-04-23 11:23:25 +08:00
Jiabin Peng
bb720aaab9 Fix menu item's clickable region in dark theme (#10187)
* remove redundant style for submenu

* Fix menu item's clickable region in dark theme
2018-04-23 00:31:36 +08:00
afc163
8ab4aeb9c4 site: fix ad flush 2018-04-22 22:37:58 +08:00
Benjy Cui
e444dc5e39 chore: add ad for yuque (#10182) 2018-04-22 18:58:40 +08:00
afc163
b9d94971e4 Add successPercent as Progress[format] argument, close #10096 2018-04-22 14:00:49 +08:00
niko
d50ec436d5 List integrate pagination functional fixed: #9303 (#10135) 2018-04-20 15:41:40 +08:00
Jin ZHANG
e1c74eb799 add maxCount config to message (#10169) 2018-04-20 15:40:43 +08:00
Zheeeng
d016471638 Feature 3.5.0 time line reverse api (#10057)
* Add reverse api for TimeLine

* Update TimeLine test snapshot

* Add specifications for reverse api and pending api
2018-04-20 11:23:37 +08:00
Yevhen Hryhorevskyi
754c94c447 Bump up rc-notification version to 3.1.0 (#10161)
Bump up `rc-notification` version to 3.1.0 that supports notification update by key
2018-04-19 21:18:09 +08:00
davidhatten
74d1c5e6b6 Add collapse styles to default.less (#9943)
* push collapse styling into overridable defaults

* Changes to ensure backwards compatibiliy, switch bg-color to be based on default style

* change background-color to bg in style names

* simplify and consolodate content-padding

* I figured out why the styling is split across content and box like that

The collapse/show animation doesn't work right without the padding set up across the two elements like this. From an end-user point of view, I think this is the easiest thing.

* pushing all padding styling on to the box instead of the content, keeping var name the same because the end user doesn't need to know the difference

* Pushing header-bg-color back up to the top of the component heirarchy

* shorten content padding
2018-04-19 11:36:53 +08:00
afc163
04a5cc2a8b Merge branch 'master' into feature-3.5.0 2018-04-15 19:52:24 +08:00
诸岳
b52053051c Input.Search should disable enter button when disabled prop is true (#10051)
* Input Search should disable enter button when disabled prop is true, close #10040

* test: Add test case for commit bd21722
2018-04-15 13:14:26 +08:00
Ludwig Bäcklund
74d81c2d07 Add title prop to Badge that shows when hovering it 2018-04-12 11:53:32 +08:00
705 changed files with 16667 additions and 4378 deletions

221
.circleci/config.yml Normal file
View File

@@ -0,0 +1,221 @@
version: 2
references:
container_config: &container_config
docker:
- image: circleci/node:8
working_directory: ~/ant-design
attach_workspace: &attach_workspace
attach_workspace:
at: ~/ant-design
install_react: &install_react
run: REACT=15 ./scripts/install-react.sh
react_15: &react_15
environment:
REACT: 15
react_16: &react_16
environment:
REACT: 16
jobs:
setup:
<<: *container_config
steps:
- checkout
- run: node -v
- run: npm -v
- run: npm install
- run:
command: |
set +eo
npm ls
true
- persist_to_workspace:
root: ~/ant-design
paths:
- node_modules
dist:
<<: *container_config
steps:
- checkout
- *attach_workspace
- run: npm run dist
- run: node ./tests/dekko/dist.test.js
- persist_to_workspace:
root: ~/ant-design
paths:
- dist
compile:
<<: *container_config
steps:
- checkout
- *attach_workspace
- run: npm run compile
- run: node ./tests/dekko/lib.test.js
- persist_to_workspace:
root: ~/ant-design
paths:
- lib
- es
lint:
<<: *container_config
steps:
- checkout
- *attach_workspace
- run: npm run lint
test_dist:
<<: *container_config
<<: *react_16
steps:
- checkout
- *attach_workspace
- run:
command: npm test -- -w 2
environment:
LIB_DIR: dist
test_lib:
<<: *container_config
<<: *react_16
steps:
- checkout
- *attach_workspace
- run:
command: npm test -- -w 2
environment:
LIB_DIR: lib
test_es:
<<: *container_config
<<: *react_16
steps:
- checkout
- *attach_workspace
- run:
command: npm test -- -w 2
environment:
LIB_DIR: es
test_dom:
<<: *container_config
<<: *react_16
steps:
- checkout
- *attach_workspace
- run: npm test -- -w 2 --coverage
- run: bash <(curl -s https://codecov.io/bash)
test_node:
<<: *container_config
<<: *react_16
steps:
- checkout
- *attach_workspace
- run: npm run test-node -- -w 2
test_dist_15:
<<: *container_config
<<: *react_15
steps:
- checkout
- *attach_workspace
- *install_react
- run:
command: npm test -- -w 2 -u
environment:
LIB_DIR: dist
test_lib_15:
<<: *container_config
<<: *react_15
steps:
- checkout
- *attach_workspace
- *install_react
- run:
command: npm test -- -w 2 -u
environment:
LIB_DIR: lib
test_es_15:
<<: *container_config
<<: *react_15
steps:
- checkout
- *attach_workspace
- *install_react
- run:
command: npm test -- -w 2 -u
environment:
LIB_DIR: es
test_dom_15:
<<: *container_config
<<: *react_15
steps:
- checkout
- *attach_workspace
- *install_react
- run: npm test -- -w 2 -u
test_node_15:
<<: *container_config
<<: *react_15
steps:
- checkout
- *attach_workspace
- *install_react
- run: npm run test-node -- -w 2 -u
workflows:
version: 2
build-test:
jobs:
- setup
- dist:
requires:
- setup
- compile:
requires:
- setup
- lint:
requires:
- setup
- test_dist:
requires:
- dist
- test_lib:
requires:
- compile
- test_es:
requires:
- compile
- test_dom:
requires:
- setup
- test_node:
requires:
- setup
- test_dist_15:
requires:
- dist
- test_lib_15:
requires:
- compile
- test_es_15:
requires:
- compile
- test_dom_15:
requires:
- setup
- test_node_15:
requires:
- setup

View File

@@ -8,13 +8,6 @@ const eslintrc = {
es6: true,
},
parser: 'babel-eslint',
parserOptions: {
ecmaVersion: 6,
ecmaFeatures: {
jsx: true,
experimentalObjectRestSpread: true,
},
},
plugins: [
'markdown',
'react',
@@ -26,6 +19,8 @@ const eslintrc = {
'react/sort-comp': 0,
'react/prop-types': 0,
'react/jsx-first-prop-new-line': 0,
'react/jsx-one-expression-per-line': 0,
'react/forbid-prop-types': 0,
'react/jsx-filename-extension': [1, { extensions: ['.js', '.jsx', '.md'] }],
'import/extensions': 0,
'import/no-unresolved': 0,
@@ -63,6 +58,8 @@ if (process.env.RUN_ENV === 'DEMO') {
'eol-last': 0,
'no-script-url': 0,
'prefer-rest-params': 0,
'react/no-access-state-in-setstate': 0,
'react/destructuring-assignment': 0,
'react/no-multi-comp': 0,
'react/prefer-stateless-function': 0,
'jsx-a11y/href-no-hash': 0,

14
.github/lock.yml vendored Normal file
View File

@@ -0,0 +1,14 @@
# Configuration for lock-threads - https://github.com/dessant/lock-threads
# Number of days of inactivity before a closed issue or pull request is locked
daysUntilLock: 365
# Comment to post before locking. Set to `false` to disable
lockComment: >
This thread has been automatically locked because it has not had recent
activity. Please open a new issue for related bugs and link to relevant
comments in this thread.
# Issues or pull requests with these labels will not be locked
# exemptLabels:
# - no-locking
# Limit to only `issues` or `pulls`
only: issues

View File

@@ -5,20 +5,24 @@ language: node_js
node_js:
- 8
cache:
directories:
- $HOME/.npm
matrix:
fast_finish: true
include:
- env: TEST_TYPE=lint
- env: REACT=16 TEST_TYPE=test:dist
- env: REACT=16 TEST_TYPE=test:lib
- env: REACT=16 TEST_TYPE=test:es
- env: REACT=16 TEST_TYPE=test:dom
- env: REACT=16 TEST_TYPE=test:node
- env: REACT=15 TEST_TYPE=test:dist
- env: REACT=15 TEST_TYPE=test:lib
- env: REACT=15 TEST_TYPE=test:es
- env: REACT=15 TEST_TYPE=test:dom
- env: REACT=15 TEST_TYPE=test:node
- env: TEST_TYPE=lint
- env: REACT=16 TEST_TYPE=test:dist
- env: REACT=16 TEST_TYPE=test:lib
- env: REACT=16 TEST_TYPE=test:es
- env: REACT=16 TEST_TYPE=test:dom
- env: REACT=16 TEST_TYPE=test:node
- env: REACT=15 TEST_TYPE=test:dist
- env: REACT=15 TEST_TYPE=test:lib
- env: REACT=15 TEST_TYPE=test:es
- env: REACT=15 TEST_TYPE=test:dom
- env: REACT=15 TEST_TYPE=test:node
before_script:
- scripts/install-react.sh

View File

@@ -15,6 +15,281 @@ timeline: true
---
## 3.7.2
`2018-07-25`
- DatePicker
- 🐞 **Fix issue resulting in year and month can not be changed in control mode.** [b9992f4](https://github.com/ant-design/ant-design/commit/b9992f4a08574efb47b6e6cd80eb1e888b9a1ede)
- 🐞 Fix warning of `getDerivedStateFromProp`. [#11398](https://github.com/ant-design/ant-design/pull/11398) [@yoyo837](https://github.com/yoyo837)
- Drawer
- 🐞 Fix close animation when setting `destroyOnClose`. [#11307](https://github.com/ant-design/ant-design/issues/11307)
- 🐞 Fix display issue when using a `vw` value as `width`. [#11326](https://github.com/ant-design/ant-design/issues/11326)
- 🐞 Fix `wrapClassName` now working.
- 🐞 Fix text overflow of Tooltip. [#11402](https://github.com/ant-design/ant-design/pull/11402) [@weidapao](https://github.com/weidapao)
- 🐞 Fix style issue of dark theme Menu in Layout.Header. [#11400](https://github.com/ant-design/ant-design/pull/11400) [@hongxuWei](https://github.com/hongxuWei)
- 🐞 Fix the arrow buttons of InputNumber showing wrong positon in a fixed table. [#11408](https://github.com/ant-design/ant-design/issues/11408)
- 🐞 Fix issue resulting in Select.Option shows wrong border radius in Select.OptGroup. [6cb6f5c](https://github.com/ant-design/ant-design/commit/6cb6f5c83ed634e67d5b5d0816d11aa0788a74d8)
- 🐞 Fix issue resulting in `onChange` was trigged twice when click the filter icon of Table. [#11164](https://github.com/ant-design/ant-design/issues/11164) [@adybionka](https://github.com/adybionka)
- 🐞 Fix issue resulting title of Model.confirm shows scrollbar on Firefox. [#11432](https://github.com/ant-design/ant-design/issues/11432)
- TypeScript
- 🐞 Fix type definition of Radio.Group. [#11409](https://github.com/ant-design/ant-design/pull/11409) [@eddiemoore](https://github.com/eddiemoore)
- 🐞 Fix type definition of TreeSelect. [#11442](https://github.com/ant-design/ant-design/pull/11442) [@JribiBelhassen](https://github.com/JribiBelhassen)
- 🐞 Fix type definition of Badge. [#11421](https://github.com/ant-design/ant-design/pull/11421) [@zongzi531](https://github.com/zongzi531)
## 3.7.1
`2018-07-21`
- 🐞 Fix popup content can't display in Drawer component.[#11304](https://github.com/ant-design/ant-design/issues/11304)
- 🐞 Card using `tabList` support `disabled` prop.[#11212](https://github.com/ant-design/ant-design/issues/11212)
- 🐞 Fix Link of Anchor not sync when `href` update.[#11287](https://github.com/ant-design/ant-design/pull/11287/files) [@tangjinzhou](https://github.com/tangjinzhou)
- 🐞 Fix Menu component style.[#11299](https://github.com/ant-design/ant-design/issues/11299)
- 🐞 Fix Drawer component don't have animation when `destroyOnClose` is set.[#11307](https://github.com/ant-design/ant-design/issues/11307)
- 🐞 Fix DirectoryTree can't expand when `expandedKeys` is in control.[#11366](https://github.com/ant-design/ant-design/issues/11366)
- 🐞 Fix Button with Tooltip under ButtonGroup style issue when Button is `disabled`.[11321](https://github.com/ant-design/ant-design/pull/11321) [@tangjinzhou](https://github.com/tangjinzhou)
## 3.7.0
3.7.0 is a heavy update that brings a lot of exciting changes and new features.
Here are some highlights ✨:
- 🌟 Add drawer component : [Drawer](https://ant.design/components/drawer-cn/). [#10791](https://github.com/ant-design/ant-design/pull/10791)
- 🌟 Add `Tree.DirectoryTree` component as the built-in directory tree. [#7749](https://github.com/ant-design/ant-design/issues/7749)
Component Fixes / Enhancements:
- Upgrade `rc-tree-select` to `2.0.5` for TreeSelect, refactored to fix the logic of the check.
- 🌟 Add `autoClearSearchValue` prop to clear the value of search input when multiple select is selected or deselected. [10996](https://github.com/ant-design/ant-design/issues/10996)
- 🌟 Add `searchValue` prop to set the value of search input. [6ff7dd8](https://github.com/ant-design/ant-design/commit/6ff7dd8fb953f079ee51ee638aaf4d832d0e10bf#diff-1e8e47abbdbe6e12d009aa61619ab22f)
- 🌟 Add `maxTagCount` prop to set the max count of visible tags. [fb96c9d](https://github.com/ant-design/ant-design/commit/fb96c9db351e44a202f64f780470c6319a8a9626)
- 🌟 Add `maxTagPlaceholder` prop to set the content when the tag is hidden. [fb96c9d](https://github.com/ant-design/ant-design/commit/fb96c9db351e44a202f64f780470c6319a8a9626)
- 🌟 Search input now supports case sensitive search. [#10990](https://github.com/ant-design/ant-design/issues/10990)
- 🗑 Remove `label` prop and use `title` prop instead in the `treeData`.
- Upgrade `rc-upload` to `2.5.0` for Upload.
- 🌟 Add `directory` prop to support folder uploading. [#7315](https://github.com/ant-design/ant-design/issues/7315)
- 🌟 `action` prop supports to be the a function which returns a Promise object. [fd96967](https://github.com/ant-design/ant-design/commit/fd96967c872600b79bb608e9ddf9f8c38814a704)
- Dropdown
- 🌟 Provide default margin for icon in the menu item. [8e60a59](https://github.com/ant-design/ant-design/commit/8e60a591fd24f644de4f67d69c2210e9270be9cc)
- 🌟 Be able to adjust the menu position for the trigger mode of `contextMenu` automatically. [16e4260](https://github.com/ant-design/ant-design/commit/16e42601d6772fc0830ee237a1e751a38a118676)
- Upgrade `rc-table` to `6.2.2` for Table. [f2fddff](https://github.com/ant-design/ant-design/commit/f2fddff3fd0d6b36e8e6d8ee06bfcbcc85ead4f0)
- 🌟 Add `expanded` as the fourth param of `expandedRowRender` prop to get the expanded state of current row. [#10379](https://github.com/ant-design/ant-design/issues/10379)
- 🌟 Add the ability to override the filter menu without the fully controlled component. [59cc3a8](https://github.com/ant-design/ant-design/commit/59cc3a8b6c643f7206feedf2dc2c7154296ba3e3) [@chrvadala](https://github.com/chrvadala)
- 🌟 `filterIcon` prop supports to be a render function which returns ReactNode. [1af4392](https://github.com/ant-design/ant-design/commit/1af4392ae9fbdaa6fcfbf2f0de5413100ef4a84a)
- 🐞 Fix the row dislocation problem when the column is fixed. [#10392](https://github.com/ant-design/ant-design/issues/10392)
- 🌟 Allow to pass `data-*`, `aria-*` and `role-*` props to the inner for Alert. [f0b684d](https://github.com/ant-design/ant-design/commit/f0b684de6a7c422f0de56e1ef72aeb35ab25a858)
- 🌟 Add `alt` prop for Avatar to set the text when the image is unable to display. [#10798](https://github.com/ant-design/ant-design/pull/10798)
- 🌟 Allow to pass `data-*`, `aria-*` and `role-*` props to the inner Input for DatePicker. [e63f9d4](https://github.com/ant-design/ant-design/commit/e63f9d4beb440de92c0b0ce8e6e83f7e24fef792)
- 🌟 Add `event` object as the second param of `onSearch` prop for Input.Search. [#11015](https://github.com/ant-design/ant-design/issues/11015)
- 🌟 Add `onBreakPoint` prop for Layout.Sider to be the callback function when breakpoint is triggered. [#10750](https://github.com/ant-design/ant-design/pull/10750) [@nuintun](https://github.com/nuintun)
- 🌟 Add `okButtonProps` prop to set the props of ok button and add `cancelButtonProps` prop to set the props of cancal button for Modal. [#10955](https://github.com/ant-design/ant-design/pull/10955) [@djyde](https://github.com/djyde)
- 🌟 Add `strokeColor` prop to set the color of progress bar for Progress. [#10725](https://github.com/ant-design/ant-design/issues/10725)
- 🌟 Add `buttonStyle` prop whose optional value is `outline` or `solid` to set the Radio.Group style. [60e3cfa](https://github.com/ant-design/ant-design/commit/60e3cfa37ac0dae3a895e74c1fe5351c54536a07#diff-c2ee8b5a368a121e9d2cc2661212045d)
- 🌟 Add `setDefaultIndicator` static function to set global indicator for Spin. [#10787](https://github.com/ant-design/ant-design/issues/10787)
- 🌟 Add `visible` prop to set the visibility for `Tag`. [4ac0277](https://github.com/ant-design/ant-design/commit/4ac027781372dda08a5458bc73836fbc14dfe51f)
- Upgrade `rc-tree` to `1.12.0` for Tree
- 🌟 Add `loadedKeys` prop to set the loaded nodes, which usually works with loadData prop. [#10666](https://github.com/ant-design/ant-design/issues/10666)
- 🌟 Add `onLoad` prop to be the callback function when all the nodes are loaded. [c488aca](https://github.com/ant-design/ant-design/commit/c488aca05e11d942d77c1b6bff45d12bbb1a2bd6)
- 🗑 Deprecate `combobox` value for `Select[mode]` and please replace it with `AutoComplete`. [53046a4](https://github.com/ant-design/ant-design/commit/53046a454ad83ca03dc313e63f56474ed1173002)
- 🐞 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
`2018-07-07`
- 🐞 Fix the style of the selected day for `DatePicker`. [#6146](https://github.com/ant-design/ant-design/issues/6146) [#9529](https://github.com/ant-design/ant-design/issues/9529)
- 🐞 Fix the style of the selected day for `DatePicker.RangePicker`. [004561b](https://github.com/ant-design/ant-design/commit/004561ba1f3b894dc164225e9e27b0a90679d15c)
- 🐞 Fix the alignment style wrapped by `Form.Item` for `Cascader`. [#9827](https://github.com/ant-design/ant-design/issues/9827) [#11133](https://github.com/ant-design/ant-design/issues/11133)
- 🐞 Fix the background style of the `handler` for `InputNumber`. [4aabc53](https://github.com/ant-design/ant-design/commit/4aabc5374497359e13a958ef81ae4569db6164a7)
- 🐞 Fix the header overflow in `FireFox` when the data is empty for `Table`. [#11135](https://github.com/ant-design/ant-design/issues/11135)
## 3.6.5
`2018-07-02`
- 🐞 Fixed wired `Transfer` repaint problem in IE or Edge. [#9697](https://github.com/ant-design/ant-design/issues/9697)
- 🐞 Fixed `Card` background overflow when zoom in chrome. [#9085](https://github.com/ant-design/ant-design/issues/9085)
- TypeScript
- 🐞 Fixed `Table` incompatible type `size`. [bf5b6ae1](https://github.com/ant-design/ant-design/commit/bf5b6ae1f3b5da4629a7d10a2d1764eaa3fbbb04)
- 🐞 Fixed `Select` missing showArrow option in types. [cde2a6b6](https://github.com/ant-design/ant-design/commit/cde2a6b6f011a5b3a367b3f58731def547bc98d8)
- 🐞 Add custom local support in `Pagination`. [babbbdd4](https://github.com/ant-design/ant-design/commit/babbbdd4e5c33ca050f8ee08969185c8d3269b4c)
- 🐞 Move max-width to ant-tooltip, so that it can be override by overlayStyle.maxWidth. [e2b359e9](https://github.com/ant-design/ant-design/commit/e2b359e9c3dae067eeba37a886f7896474c87e31)
- 🐞 Adjust `Select` mirror style to avoid to long string. [#11035](https://github.com/ant-design/ant-design/issues/11035)
## 3.6.4
`2018-06-23`
- 🐞 Fixed `Steps` theme `@process-icon-color`. [#10973](https://github.com/ant-design/ant-design/issues/10973)
- 🐞 Fixed style of RangePicker with preset ranges. [#10986](https://github.com/ant-design/ant-design/issues/10986)
- 🐞 Fixed `Dropdown` non-boolean attribute warning. [#7798](https://github.com/ant-design/ant-design/issues/7798)
- TypeScript
- 🌟 Add `Tree` prop `className` definition. [#10950](https://github.com/ant-design/ant-design/issues/10950)
- 🌟 Add `Tree` prop `selectable` definition. [3fb478e](https://github.com/ant-design/ant-design/commit/3fb478e743f3bad23dc300f501df11e5423468ba)
## 3.6.3
`2018-06-17`
- 🐞 Fixed that capitalized extension of Upload image url couldn't be recognaized. [#10928](https://github.com/ant-design/ant-design/pull/10928) [@sliwey](https://github.com/sliwey)
- 🐞 Fixed missing border of InputNumber when browser is zoomed in. [#10562](https://github.com/ant-design/ant-design/issues/10562)
- 🐞 Fixed that fixed element inside Spin cannot be fixed. [#10196](https://github.com/ant-design/ant-design/issues/10196)
- 🐞 Fixed broken border style of small table. [#9754](https://github.com/ant-design/ant-design/issues/9754)
- 🐞 Fixed missing `className` prop of Table's `filterIcon`. [#10937](https://github.com/ant-design/ant-design/issues/10937)
- 🐞 Fixed that Affix `offsetTop` and `offsetBottom` cannot be updated. [#10874](https://github.com/ant-design/ant-design/issues/10874)
- TypeScript
- 🐞 Fixed TreeSelect `TS2339` error. [#10868](https://github.com/ant-design/ant-design/issues/10868)
- 🌟 Added Form arguments definitions of `validateMessages` and `onFieldsChange`.
- 🌟 Improved Button prop definitions. [#10877](https://github.com/ant-design/ant-design/pull/10877) [@zheeeng](https://github.com/zheeeng)
- 🌟 Added `backfill` prop for AutoComplete. [#10909](https://github.com/ant-design/ant-design/pull/10909) [@zhanba](https://github.com/zhanba)
## 3.6.2
`2018-06-09`
- 🐞 Fix the wrong status of check all checkbox in Table when data change. [#10629](https://github.com/ant-design/ant-design/issues/10629)
- 🐞 Fix border style of Button.Group.
- 🐞 Fix file list being reversed when `beforeUpload` returns `false` in Upload component. [#10681](https://github.com/ant-design/ant-design/issues/10681)
- 🐞 Fix overflow of cell content in Calendar. [#10808](https://github.com/ant-design/ant-design/pull/10808) [@Yangzhedi](https://github.com/ant-design/Yangzhedi)
- 🐞 Fix the processing color of Badge not follows the `primary-color`.
- Spin
- 🐞 Fix custom icon does not follow the value of `size`. [#10786](https://github.com/ant-design/ant-design/issues/10786)
- 🐞 Fix no `delay` issue when sets `spinning` to `true` as default.[#10727](https://github.com/ant-design/ant-design/pull/10727) [@dreamerblue](https://github.com/dreamerblue)
- TypeScript
- 🐞 Fix Menu type definition. [#10773](https://github.com/ant-design/ant-design/issues/10773)
- 🐞 Fix AutoComplete type definition. [#10745](https://github.com/ant-design/ant-design/issues/10745) [#10619](https://github.com/ant-design/ant-design/issues/10619)
- 🐞 Fix Tree type definition. [#10841](https://github.com/ant-design/ant-design/pull/10841) [@Voronar](https://github.com/Voronar)
- 🐞 Fix Checkbox.Group definition. [#10677](https://github.com/ant-design/ant-design/pull/10677)
## 3.6.0
`2018-06-02`
* 🌟 `Form`'s error message now can be customized with ReactNode. [#10136](https://github.com/ant-design/ant-design/issues/10136) [@lovekonakona](https://github.com/lovekonakona)
* 🌟 `List` support customized configuration for position of pagination. [#10581](https://github.com/ant-design/ant-design/pull/10581) [@zheeeng](https://github.com/zheeeng)
* 🌟 `Layout.Sider` now can be configured with `light` or `dark` theme. [#10142](https://github.com/ant-design/ant-design/issues/10142) [@pd4d10](https://github.com/pd4d10)
* 🌟 Ant Design official site now supports offline mode. [#10625](https://github.com/ant-design/ant-design/issues/10625)
* 🌟 `Transfer` adding `style` and `operationStyle` props for further customization. [@eduludi](https://github.com/eduludi)
* 🌟 `Message` adds a promisfied interface to handle callback. [#10421](https://github.com/ant-design/ant-design/issues/10421) [@zhujinxuan](https://github.com/zhujinxuan)
* 🐞 Fix compilation issue with typescript@v2.9.1 . [#10729](https://github.com/ant-design/ant-design/issues/10729) [@karol-majewski](https://github.com/karol-majewski)
* 🐞 Fix a bug in `Menu` where outer menu item not highlighting while inner item is selected. [#8666](https://github.com/ant-design/ant-design/issues/8666) [@stonehank](https://github.com/stonehank)
* 🐞 Affix `offsetBottom` not working. [#10674](https://github.com/ant-design/ant-design/issues/10674)
## 3.5.4
`2018-05-26`
- 🐞 Fix `showSearch` on `Cascader` not working.[968488a2](https://github.com/ant-design/ant-design/commit/968488a2fac9bcb16bee9f0c248f49bca00dbec6)
- 🐞 `Badge[status]` support `Tooltip`.[#10626](https://github.com/ant-design/ant-design/issues/10626)
- 🐞 Fix `text-align` on parent element affects `Spin`.[#10643](https://github.com/ant-design/ant-design/pull/10643) [@wmzhong](https://github.com/wmzhong)
- 💄 `Table` break line style change from `break-all` to `break-word`.[#10655](https://github.com/ant-design/ant-design/pull/10655) [@clinyong](https://github.com/clinyong)
- 🌟 When `Search` not define `enterButton`, click search icon will trigger `onSearch`. [36ffe7e1](https://github.com/ant-design/ant-design/commit/36ffe7e1dc9d9473c8c68168ab79b7a03a604702)
## 3.5.3
`2018-05-20`
- 🐞 Fix `Affix` with offsetTop === 0, value becomes `undefined` problem [#10566](https://github.com/ant-design/ant-design/pull/10566)
- 🐞 Fixed issue with shaded `Input.Group` component shadows[#10230](https://github.com/ant-design/ant-design/issues/10230)
- 🐞 Fixed issue where the `Transfer` component checkbox event fired twice [#10480](https://github.com/ant-design/ant-design/issues/10480)
- 💄 Unifying the name of the variable [12d3046](https://github.com/ant-design/ant-design/commit/12d3046687a0dcdb51fece08dd2bea64f185cc40)
- 💄 Fine-tuned the style of `Dropdown` [8e2f72f](https://github.com/ant-design/ant-design/commit/8e2f72ffe0eb300f5997296726b02246bf990c8f)
- 💄 The components of the Chinese document will now be demonstrated using Chinese language packages. [9b17a94](https://github.com/ant-design/ant-design/commit/9b17a943f5d57d40d65041b7b0c247add09d2851)
- 💄 The main theme switch was changed to `antd-theme-generato`, thanks to the work of [@mzohaibqc](https://github.com/mzohaibqc).
- TypeScript
- 🐞 Fixed an issue with the type of gutter attribute in `Row` [b7d508e](https://github.com/ant-design/ant-design/commit/b7d508e1662bf20a0cacbe6440a2ce31a65a8a59)
- 💄 Improved the `Form` component type [#10564](https://github.com/ant-design/ant-design/pull/10564)
- 💄 Improved the `Button` and `Tag` types[1ed9fed](https://github.com/ant-design/ant-design/commit/1ed9fed2cf1c99b947359fafb101b2e58213cb48)
## 3.5.2
`2018-05-13`
- 🐞 Fixed `Table` filter doesn't work when click checkbox. [#10452](https://github.com/ant-design/ant-design/issues/10452)
- 🐞 Fixed `Cascader` displayRender z-index issue. [#10433](https://github.com/ant-design/ant-design/issues/10433)
- 🐞 Fixed `Button` Types of property 'ref' are incompatible. [#10405](https://github.com/ant-design/ant-design/issues/10405)
- 🐞 Fixed the height of `Form` item when checks position is dithered. [#10445](https://github.com/ant-design/ant-design/issues/10445)
- 🌟 Allow to use any CSS units for `Layout` width. [#10479](https://github.com/ant-design/ant-design/pull/10479)
## 3.5.1
`2018-05-09`
- 🐞 Fixed broken style of Input.Group under Form. [#10371](https://github.com/ant-design/ant-design/issues/10371)
- 🐞 Fixed overlay style of Select. [#10383](https://github.com/ant-design/ant-design/issues/10383)
- 🐞 Remove focused style of Collapse.
- 🐞 Remove unnecessary `z-index` of Input.Group and Checkbox. [#9840](https://github.com/ant-design/ant-design/issues/9840) [#10385](https://github.com/ant-design/ant-design/issues/10385)
- 🐞 Fixed that monospaced font family can't be bold.
- Table
- 💄 Rewrited the editable table demo. [#10119](https://github.com/ant-design/ant-design/pull/10119)
- 🐞 Fixed that table column overlay each other. [#9822](https://github.com/ant-design/ant-design/issues/9822)
- TypeScript
- 🐞 Fixed Breadcrumb.Item type. [#10372](https://github.com/ant-design/ant-design/pull/10372) [@karol-majewski](https://github.com/karol-majewski)
- 🐞 Fixed Table `rowSelection` type。[#10374](https://github.com/ant-design/ant-design/issues/10374)
## 3.5.0
`2018-05-04`
- 🌟 Add `title` prop to `Badge` that shows when hovering it. [74d81c2](https://github.com/ant-design/ant-design/commit/74d81c2d078a3c84b3e44cbfbdd99b8f479ea71d) [@ludwigbacklund](https://github.com/ludwigbacklund)
- 🌟 Add `successPercent` as `Progress[format]` argument. [#10096](https://github.com/ant-design/ant-design/issues/10096)
- 🌟 Update `rc-notification` to 3.1.0 so that `Notification` support set `maxCount`. [#10161](https://github.com/ant-design/ant-design/pull/10161) [@jzhangs](https://github.com/jzhangs)
- 🌟 Update `rc-cascader` to 1.13.0 so that `Cascader` support set `filedNames`. [react-component/cascader#23](https://github.com/react-component/cascader/pull/23) [@405go](https://github.com/405go)
- 🌟 Add ability to update `Notification` props by key. [react-component/notification#40](https://github.com/react-component/notification/pull/40) [@yevhen-hryhorevskyi](https://github.com/yevhen-hryhorevskyi)
- 🌟 `List` support pagination by default. [#10135](https://github.com/ant-design/ant-design/pull/10135)
- Table
- 🌟 Column `sorter` function is passed `sortOrder` as param. [#10306](https://github.com/ant-design/ant-design/pull/10306) [@kumarashwin](https://github.com/kumarashwin)
- 🐞 Fix merged header cell border. [#10359](https://github.com/ant-design/ant-design/issues/10359)
- 🐞 Fix lost of user selection on data updates. [#10332](https://github.com/ant-design/ant-design/pull/10332) [@chrvadala](https://github.com/chrvadala)
- Menu upgrade `rc-menu` to `7.x` [#10305](https://github.com/ant-design/ant-design/pull/10305)
- 🌟 Better aria-* attributes support. [react-component/menu#137](https://github.com/react-component/menu/pull/137)
- 🌟 Improve Menu performance by avoiding unnecessary updates. [react-component/menu#133](https://github.com/react-component/menu/pull/133)
- 🌟 Support passing props through to MenuItem list item. [react-component/menu#135](https://github.com/react-component/menu/pull/135)
- 🐞 Minor key shortcut bug fixes. [react-component/menu#132](https://github.com/react-component/menu/pull/132)
- Collapse
- 🌟 Support custom `Collapse` styles with less. [#9943](https://github.com/ant-design/ant-design/pull/9943) [@davidhatten](https://github.com/davidhatten)
- 🌟 Update `rc-collapse` to 1.9.0 to add `Collapse` keyboard support. [react-component/collapse#84](https://github.com/react-component/collapse/pull/84/) [@kossel](https://github.com/kossel)
- Select
- 🐞 Fix type for `placeholder`. [#10282](https://github.com/ant-design/ant-design/pull/10282) [@thomasthiebaud](https://github.com/thomasthiebaud)
- 🐞 Fix extra space taken up when arrow disabled. [#10296](https://github.com/ant-design/ant-design/pull/10296)
- 🐞 Fix property `value` typescript type. [#10336](https://github.com/ant-design/ant-design/pull/10336) [@paranoidjk](https://github.com/paranoidjk)
- Input
- 🐞 Fix `Input.Search` not disable enter button when disabled prop is true. [#10040](https://github.com/ant-design/ant-design/issues/10040)
- 🐞 Fix `Input.Group` align issue in Form. [#10281](https://github.com/ant-design/ant-design/issues/10281)
- Form
- 🐞 Fix typing for `Form.onValuesChange`. [#10231](https://github.com/ant-design/ant-design/pull/10231) [@whtsky](https://github.com/whtsky)
- 🐞 Fix typescript interface `ComponentDecorator`. [#10324](https://github.com/ant-design/ant-design/pull/10324) [@paranoidjk](https://github.com/paranoidjk)
- 🐞 Fix dashed `Divider`. [#10216](https://github.com/ant-design/ant-design/issues/10216)
- 🐞 Fix `Spin` container interaction. [#10227](https://github.com/ant-design/ant-design/issues/10227)
- 🐞 Fix `Notification` icon hover color. [#10272](https://github.com/ant-design/ant-design/issues/10272)
- 🐞 Fix `Upload` property `lastModifiedDate` name. [#10315](https://github.com/ant-design/ant-design/pull/10315) [@danielg2002](https://github.com/danielg2002)
- 🐞 Fix `Button` props type, use `React.HTMLProps`. [#10229](https://github.com/ant-design/ant-design/pull/10229) [@whtsky](https://github.com/whtsky)
- 🐞 Fix less var naming convention. [#10275](https://github.com/ant-design/ant-design/issues/10275)
## 3.4.5
`2018-05-03`
- 🐞 Fix file object is empty and file name not showing in Upload. [#10319](https://github.com/ant-design/ant-design/issues/10319)
## 3.4.4
`2018-04-28`
- 🐞 Fix that Upload file in`onChange({ file })` is not a File instance introduced in `3.4.2`. [#10293](https://github.com/ant-design/ant-design/issues/10293)
- 🐞 Fix style lose bug when use tree shaking in webpack@4. [#10217](https://github.com/ant-design/ant-design/pull/10217) [@whtsky](https://github.com/whtsky)
## 3.4.3
`2018-04-23`
- 🐞 Fix style lose bug when use tree shaking in webpack@4. [#10197](https://github.com/ant-design/ant-design/pull/10197) [@Aladdin-ADD](https://github.com/Aladdin-ADD)
- 🐞 Fix `Menu` item's clickable region in dark theme. [#10187](https://github.com/ant-design/ant-design/pull/10187) [@dgeibi ](https://github.com/dgeibi )
## 3.4.2
`2018-04-22`
@@ -356,7 +631,7 @@ Happy 2018 !~ 2018 2018 2018 coming!~~~
`2017-12-04`
Learn more in the [Ant Design 3.0 announcement post](https://medium.com/ant-design/announcing-ant-design-3-0-70e3e65eca0c)!
Learn more in the [Ant Design 3.0 announcement post](https://medium.com/ant-design/announcing-ant-design-3-0-70e3e65eca0c).
### Major Changes
@@ -374,7 +649,7 @@ Learn more in the [Ant Design 3.0 announcement post](https://medium.com/ant-desi
We provide a [migration tool](https://github.com/ant-design/antd-migration-helper) to help you find deprecated usages in your codebase.
- Card's `noHovering` has been renamed to `hoverable`and its default value now is `true`.
- Card's `noHovering` has been renamed to `hoverable`, and its default value now is `true`.
- Added new Grid breakpoints. [#7230](https://github.com/ant-design/ant-design/pull/7230)
- Form `getFieldDecorator`'s `exclusive` option has been removeed.
- Added `Form.createFormField`, and you must use it to wrap field data returned in `option.mapPropsToFields`:
@@ -434,7 +709,7 @@ We provide a [migration tool](https://github.com/ant-design/antd-migration-helpe
- 🌟 Input.Search added new `enterButton` prop to allow setting custom search button.[#7596](https://github.com/ant-design/ant-design/issues/7596)
- 🌟 Mention added new `placement` prop to allow setting the popup direction.
- 🌟 Carousel added new `next()`, `prev()`, `goTo(slideNumber)` methods to allow controlling slides programmatically.
- 🌟 Button added link supportButton with `href` prop will render to `<a>`. [#8343](https://github.com/ant-design/ant-design/pull/8343)
- 🌟 Button added link support, Button with `href` prop will render to `<a>`. [#8343](https://github.com/ant-design/ant-design/pull/8343)
- 🌟 Steps was refactored, first rendering won't flash. [#6010](https://github.com/ant-design/ant-design/issues/6010)
- 🌟 Switch added new `loading` prop to show a loading status.
- Menu
@@ -453,7 +728,7 @@ We provide a [migration tool](https://github.com/ant-design/antd-migration-helpe
- 🌟 Added new `inner` type. [Demo](https://ant.design/components/card/#components-card-demo-inner)。
- 🌟 Added `cover`, `actions` and a new `Meta` component. [Demo](https://ant.design/components/card/#components-card-demo-meta)。
- DatePicker
- 🌟 Added `mode` and `onPanelChange`to allow controlling the panel mode. [Demo](https://ant.design/components/date-picker/#components-date-picker-demo-mode)。
- 🌟 Added `mode` and `onPanelChange`, to allow controlling the panel mode. [Demo](https://ant.design/components/date-picker/#components-date-picker-demo-mode)。
- 🌟 Added `WeekPicker` component. [Demo](https://ant.design/components/date-picker/#components-date-picker-demo-basic)
- 🌟 Added new `dateRender` prop to allow customizing date cell.
- TimePicker
@@ -487,7 +762,7 @@ We provide a [migration tool](https://github.com/ant-design/antd-migration-helpe
- 🌟 Added `column[defaultSortOrder]` to allow setting default sort order. [#8111](https://github.com/ant-design/ant-design/pull/8111) [@megawac](https://github.com/megawac)
- 🌟 Added `rowSelection[fixed]` to allow fixing the selection column.。
- 🙅 Deprecated `getBodyWrapper`, please use `components` instead.
- 🙅 Deprecated `onRowClick``onRowDoubleClick`, `onRowContextMenu`, `onRowMouseEnter`, `onRowMouseLeave`, please use `onRow` instead.
- 🙅 Deprecated `onRowClick`, `onRowDoubleClick`, `onRowContextMenu`, `onRowMouseEnter`, `onRowMouseLeave`, please use `onRow` instead.
```javascript
<Table onRow={(record) => ({
onClick: () => {},

View File

@@ -15,6 +15,284 @@ timeline: true
---
## 3.7.2
`2018-07-25`
- DatePicker
- 🐞 **修复在受控模式下不能切换年月的问题。**[b9992f4](https://github.com/ant-design/ant-design/commit/b9992f4a08574efb47b6e6cd80eb1e888b9a1ede)
- 🐞 修复在 `getDerivedStateFromProp` 的警告。[#11398](https://github.com/ant-design/ant-design/pull/11398) [@yoyo837](https://github.com/yoyo837)
- Drawer
- 🐞 修复使用 `destroyOnClose` 时没有关闭动画的问题。[#11307](https://github.com/ant-design/ant-design/issues/11307)
- 🐞 修复 `width``vw` 为单位时的显示错误。[#11326](https://github.com/ant-design/ant-design/issues/11326)
- 🐞 修复 `wrapClassName` 属性无效的问题。
- 🐞 修复 Tooltip 文字溢出的问题。[#11402](https://github.com/ant-design/ant-design/pull/11402) [@weidapao](https://github.com/weidapao)
- 🐞 修复 Menu 在 `theme``dark` 是在 Layout.Header 里的样式问题。[#11400](https://github.com/ant-design/ant-design/pull/11400) [@hongxuWei](https://github.com/hongxuWei)
- 🐞 修复 InputNumber 的箭头按钮在使用了固定列的 Table 里显示错位的问题。[#11408](https://github.com/ant-design/ant-design/issues/11408)
- 🐞 修复 Select 使用分组时 Option 的圆角显示错误。[6cb6f5c](https://github.com/ant-design/ant-design/commit/6cb6f5c83ed634e67d5b5d0816d11aa0788a74d8)
- 🐞 修复 Table 第一次点击过滤按钮的时候 `onChange` 会被触发两次的问题。[#11164](https://github.com/ant-design/ant-design/issues/11164) [@adybionka](https://github.com/adybionka)
- 🐞 修复 Model.confirm 的标题在 Firefox 下会显示滚动条的问题。[#11432](https://github.com/ant-design/ant-design/issues/11432)
- TypeScript
- 🐞 修复 Radio.Group 类型定义。[#11409](https://github.com/ant-design/ant-design/pull/11409) [@eddiemoore](https://github.com/eddiemoore)
- 🐞 修复 TreeSelect 类型定义。[#11442](https://github.com/ant-design/ant-design/pull/11442) [@JribiBelhassen](https://github.com/JribiBelhassen)
- 🐞 修复 Badge 类型定义。[#11421](https://github.com/ant-design/ant-design/pull/11421) [@zongzi531](https://github.com/zongzi531)
## 3.7.1
`2018-07-21`
- 🐞 修复 Drawer 内无法显示弹层组件的问题。[#11304](https://github.com/ant-design/ant-design/issues/11304)
- 🐞 带页签的卡片页签支持 disabled 属性。[#11212](https://github.com/ant-design/ant-design/issues/11212)
- 🐞 修复锚点链接组件 href 改变不更新的问题。 [#11287](https://github.com/ant-design/ant-design/pull/11287/files) [@tangjinzhou](https://github.com/tangjinzhou)
- 🐞 修复 Menu 样式细节问题。[#11299](https://github.com/ant-design/ant-design/issues/11299)
- 🐞 修复 Drawer 组件设置 `destroyOnClose` 后关闭动画消失。[#11307](https://github.com/ant-design/ant-design/issues/11307)
- 🐞 修复 DirectoryTree 在 `expandedKeys` 属性可控时点击无法展开的问题。[#11366](https://github.com/ant-design/ant-design/issues/11366)
- 🐞 修复 ButtonGroup 中使用 Tooltip 的 Button 在 `disabled` 时样式不正确的问题。[11321](https://github.com/ant-design/ant-design/pull/11321) [@tangjinzhou](https://github.com/tangjinzhou)
## 3.7.0
3.7.0 是一个重磅更新,带来了很多激动人心的变化和新特性。
以下是一些亮点✨:
- 🔥 增加抽屉组件 : [`Drawer`](https://ant.design/components/drawer-cn/) [#10791](https://github.com/ant-design/ant-design/pull/10791)
- 🔥 新增 `Tree.DirectoryTree` 组件,作为内置的目录树。[#7749](https://github.com/ant-design/ant-design/issues/7749)
组件修复/功能增强:
- TreeSelect 组件升级 `rc-tree-select``2.0.5`,进行了重构,修复了 check 的逻辑。
- 🌟 新增 `autoClearSearchValue` 属性,当多选模式下值被选择,用于自动清空搜索框。[10996](https://github.com/ant-design/ant-design/issues/10996)
- 🌟 新增 `searchValue` 属性,用于设置搜索框的值。[6ff7dd8](https://github.com/ant-design/ant-design/commit/6ff7dd8fb953f079ee51ee638aaf4d832d0e10bf#diff-1e8e47abbdbe6e12d009aa61619ab22f)
- 🌟 新增 `maxTagCount` 属性,用于设置显示标签的最大数量。[fb96c9d](https://github.com/ant-design/ant-design/commit/fb96c9db351e44a202f64f780470c6319a8a9626)
- 🌟 新增 `maxTagPlaceholder` 属性,用于设置标签隐藏时显示的内容。[fb96c9d](https://github.com/ant-design/ant-design/commit/fb96c9db351e44a202f64f780470c6319a8a9626)
- 🌟 搜索框支持大小写敏感。[#10990](https://github.com/ant-design/ant-design/issues/10990)
- 🗑 `treeData` 数据格式中的 `label` 属性被废弃,使用 `title` 属性代替。
- Upload 组件升级 `rc-upload``2.5.0`
- 🌟 新增 `directory` 属性,支持上传一个文件夹。[#7315](https://github.com/ant-design/ant-design/issues/7315)
- 🌟 `action` 属性支持作为一个返回 `Promise` 对象的函数,使用更加灵活。[fd96967](https://github.com/ant-design/ant-design/commit/fd96967c872600b79bb608e9ddf9f8c38814a704)
- Dropdown 增加新特性,可以做为右键菜单来使用。
- 🌟 给菜单项的 icon 提供默认的外间距样式。[8e60a59](https://github.com/ant-design/ant-design/commit/8e60a591fd24f644de4f67d69c2210e9270be9cc)
- 🌟 触发方式为 `contextMenu` 时自动调整菜单的位置。[16e4260](https://github.com/ant-design/ant-design/commit/16e42601d6772fc0830ee237a1e751a38a118676)
- Table 组件升级 `rc-table``6.2.2`。 [f2fddff](https://github.com/ant-design/ant-design/commit/f2fddff3fd0d6b36e8e6d8ee06bfcbcc85ead4f0)
- 🌟 新增 `expanded` 作为 `expandedRowRender` 属性函数的第四个参数,用于获取当前行是否展开。[#10379](https://github.com/ant-design/ant-design/issues/10379)
- 🌟 新增无须使用完全受控组件也能覆盖筛选菜单的能力。[59cc3a8](https://github.com/ant-design/ant-design/commit/59cc3a8b6c643f7206feedf2dc2c7154296ba3e3) [@chrvadala](https://github.com/chrvadala)
- 🌟 `filterIcon` 属性支持作为一个返回 `ReactNode` 的函数。[1af4392](https://github.com/ant-design/ant-design/commit/1af4392ae9fbdaa6fcfbf2f0de5413100ef4a84a)
- 🐞 修复在固定列时导致的行错位的问题。[#10392](https://github.com/ant-design/ant-design/issues/10392)
- 🐞 修复在组件中使用 `combobox` 模式的 `Select` 导致的重影问题。[#10828](https://github.com/ant-design/ant-design/issues/10828)
- 🐞 修复 components 属性值不能变化的问题。[c380186](https://github.com/ant-design/ant-design/commit/c380186e794a7735ae91e992f25a313158ee4984)
- 🗑 Select 组件废弃了 `combobox` 模式,请使用 `AutoComplete` 组件代替。[53046a4](https://github.com/ant-design/ant-design/commit/53046a454ad83ca03dc313e63f56474ed1173002)
- 🌟 Alert 组件允许传递 `data-*``aria-*``role-*` 属性到组件内部。[f0b684d](https://github.com/ant-design/ant-design/commit/f0b684de6a7c422f0de56e1ef72aeb35ab25a858)
- 🌟 Avatar 组件新增 `alt` 属性,用于设置图像无法显示时的替代文本。[#10798](https://github.com/ant-design/ant-design/pull/10798)
- 🌟 DatePicker 组件允许传递 `data-*``aria-*``role-*` 属性到组件内部的 `Input`。[e63f9d4](https://github.com/ant-design/ant-design/commit/e63f9d4beb440de92c0b0ce8e6e83f7e24fef792)
- 🌟 Input.Search 组件新增 `event` 事件对象作为 `onSearch` 属性函数的第二个参数。[#11015](https://github.com/ant-design/ant-design/issues/11015)
- 🌟 Layout.Sider 组件新增 `onBreakPoint` 属性,用作响应式布局的断点触发时的回调函数。[#10750](https://github.com/ant-design/ant-design/pull/10750) [@nuintun](https://github.com/nuintun)
- 🌟 Modal 组件新增 `okButtonProps``cancelButtonProps` 属性,分别用于设置 `取消` 按钮和 `确定` 按钮的属性。[#10955](https://github.com/ant-design/ant-design/pull/10955) [@djyde](https://github.com/djyde)
- 🌟 Progress 组件新增 `strokeColor` 属性,用于设置进度条的颜色。[#10725](https://github.com/ant-design/ant-design/issues/10725)
- 🌟 Radio.Group 组件新增 `buttonStyle` 属性 (可选值 `outline | solid`),用于设置 `RadioButton` 的风格样式。[60e3cfa](https://github.com/ant-design/ant-design/commit/60e3cfa37ac0dae3a895e74c1fe5351c54536a07#diff-c2ee8b5a368a121e9d2cc2661212045d)
- 🌟 Spin 组件新增 `setDefaultIndicator` 静态方法,用于设置全局的加载指示符。[#10787](https://github.com/ant-design/ant-design/issues/10787)
- 🌟 Tag 组件新增 `visible` 属性,用于设置是否显示标签。[4ac0277](https://github.com/ant-design/ant-design/commit/4ac027781372dda08a5458bc73836fbc14dfe51f)
- 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)
## 3.6.6
`2018-07-07`
- 🐞 修复 `DatePicker` 组件被选中日期的样式问题。[#6146](https://github.com/ant-design/ant-design/issues/6146) [#9529](https://github.com/ant-design/ant-design/issues/9529)
- 🐞 修复 `DatePicker.RangePicker` 组件中被选中日期的样式问题。[004561b](https://github.com/ant-design/ant-design/commit/004561ba1f3b894dc164225e9e27b0a90679d15c)
- 🐞 修复 `Cascader` 组件在 `Form.Item` 下的对齐问题。[#9827](https://github.com/ant-design/ant-design/issues/9827) [#11133](https://github.com/ant-design/ant-design/issues/11133)
- 🐞 修复 `InputNumber` 组件的 `handler` 的背景样式问题。[4aabc53](https://github.com/ant-design/ant-design/commit/4aabc5374497359e13a958ef81ae4569db6164a7)
- 🐞 修复 `Table` 组件在 `FireFox` 浏览器下数据为空时的头部溢出的样式问题。[#11135](https://github.com/ant-design/ant-design/issues/11135)
## 3.6.5
`2018-07-02`
- 🐞 修复 `Transfer` 组件的文本 "Not Found" 在 IE 或 Edge 浏览器上显示异常。[#9697](https://github.com/ant-design/ant-design/issues/9697)
- 🐞 修复 Chrome 在缩放模式下,`Card` 组件的边框被标题的背景色覆盖。[#9085](https://github.com/ant-design/ant-design/issues/9085)
- TypeScript
- 🐞 修复 `Table` 不兼容的类型 `size`。[bf5b6ae1](https://github.com/ant-design/ant-design/commit/bf5b6ae1f3b5da4629a7d10a2d1764eaa3fbbb04)
- 🐞 修复 `Select` 组件的 `showArrow` 类型定义。[cde2a6b6](https://github.com/ant-design/ant-design/commit/cde2a6b6f011a5b3a367b3f58731def547bc98d8)
- 🐞 修复 Pagination 全局 locale 设置不能被组件 locale 覆盖的问题。[babbbdd4](https://github.com/ant-design/ant-design/commit/babbbdd4e5c33ca050f8ee08969185c8d3269b4c)
- 🐞 修复 `Tooltip` 组件的 `max-width` 样式,使 `overlayStyle.maxWidth` 可覆盖。[e2b359e9](https://github.com/ant-design/ant-design/commit/e2b359e9c3dae067eeba37a886f7896474c87e31)
- 🐞 修复 `Select` 组件的样式,避免过长文本的溢出。[#11035](https://github.com/ant-design/ant-design/issues/11035)
## 3.6.4
`2018-06-23`
- 🐞 修复 `Steps` 组件的 `@process-icon-color` 样式定义。[#10973](https://github.com/ant-design/ant-design/issues/10973)
- 🐞 修复 `RangePicker` 组件使用预置范围时的样式问题。[#10986]
(https://github.com/ant-design/ant-design/issues/10986)
- 🐞 修复 `Dropdown` 组件可能报出的 `non-boolean attribute` 的警告。[#7798](https://github.com/ant-design/ant-design/issues/7798)
- TypeScript
- 🌟 给 `Tree` 组件添加 `className` 的定义。[#10950](https://github.com/ant-design/ant-design/issues/10950)
- 🌟 给 `Tree` 组件添加 `selectable` 的定义。[3fb478e](https://github.com/ant-design/ant-design/commit/3fb478e743f3bad23dc300f501df11e5423468ba)
## 3.6.3
`2018-06-17`
- 🐞 修复 Upload 图片文件后缀名为大写时无法正确识别的问题。[#10928](https://github.com/ant-design/ant-design/pull/10928) [@sliwey](https://github.com/sliwey)
- 🐞 修复 InputNumber 在浏览器缩放时边框样式丢失的问题。[#10562](https://github.com/ant-design/ant-design/issues/10562)
- 🐞 修复 Spin 内使用 `position: fixed` 的元素无法固定的问题。[#10196](https://github.com/ant-design/ant-design/issues/10196)
- 🐞 修复小号表格下固定列的边框样式问题。[#9754](https://github.com/ant-design/ant-design/issues/9754)
- 🐞 修复 Table `filterIcon``className` 属性失效的问题。[#10937](https://github.com/ant-design/ant-design/issues/10937)
- 🐞 修复 Affix 的 `offsetTop``offsetBottom` 无法动态修改的问题。[#10874](https://github.com/ant-design/ant-design/issues/10874)
- TypeScript
- 🐞 修复 TreeSelect `TS2339` 错误。[#10868](https://github.com/ant-design/ant-design/issues/10868)
- 🌟 补充 Form 的 `validateMessages``onFieldsChange` 参数的定义。
- 🌟 优化 Button 的属性定义。[#10877](https://github.com/ant-design/ant-design/pull/10877) [@zheeeng](https://github.com/zheeeng)
- 🌟 补充 AutoComplete 的 `backfill` 属性定义。[#10909](https://github.com/ant-design/ant-design/pull/10909) [@zhanba](https://github.com/zhanba)
## 3.6.2
`2018-06-09`
- 🐞 修复 Table 数据变化时全选勾选框状态显示不正确的问题。[#10629](https://github.com/ant-design/ant-design/issues/10629)
- 🐞 修复 Button.Group 中使用 disabled 按钮时缺失边框。
- 🐞 修复 Upload 中 `beforeUpload` 返回 `false` 时,文件列表排序会被反转的问题。[#10681](https://github.com/ant-design/ant-design/issues/10681)
- 🐞 修复 Calendar 表格中内容溢出的问题。[#10808](https://github.com/ant-design/ant-design/pull/10808) [@Yangzhedi](https://github.com/ant-design/Yangzhedi)
- Spin
- 🐞 修复使用图标时不能按照 `size` 正确显示大小的问题。[#10786](https://github.com/ant-design/ant-design/issues/10786)
- 🐞 修复默认旋转时 `delay` 不生效的问题。[#10727](https://github.com/ant-design/ant-design/pull/10727) [@dreamerblue](https://github.com/dreamerblue)
- 修复 Badge 的状态色不跟主题色变化的问题。
- TypeScript
- 🐞 修复 Menu 类型定义。[#10773](https://github.com/ant-design/ant-design/issues/10773)
- 🐞 修复 AutoComplete 类型定义。[#10745](https://github.com/ant-design/ant-design/issues/10745) [#10619](https://github.com/ant-design/ant-design/issues/10619)
- 🐞 修复 Tree 类型定义。[#10841](https://github.com/ant-design/ant-design/pull/10841) [@Voronar](https://github.com/Voronar)
- 🐞 修复 Checkbox.Group 的类型定义。[#10677](https://github.com/ant-design/ant-design/pull/10677)
## 3.6.0
`2018-06-02`
* 🌟 `Form` 表单错误信息展示支持传入 ReactNode。 [#10136](https://github.com/ant-design/ant-design/issues/10136) [@lovekonakona](https://github.com/lovekonakona)
* 🌟 `List` 组件支持指定分页器的位置。 [#10581](https://github.com/ant-design/ant-design/pull/10581) [@zheeeng](https://github.com/zheeeng)
* 🌟 `Layout.Sider` 支持 dark/light 主题定制。 [#10142](https://github.com/ant-design/ant-design/issues/10142) [@pd4d10](https://github.com/pd4d10)
* 🌟 支持 Ant Design 站点的离线模式。 [#10625](https://github.com/ant-design/ant-design/issues/10625)
* 🌟 `Transfer` 新增 `style` 以及 `operationStyle` 属性配置样式。 [@eduludi](https://github.com/eduludi)
* 🌟 `Message` 增加 promise 化的回调接口。 [#10421](https://github.com/ant-design/ant-design/issues/10421) [@zhujinxuan](https://github.com/zhujinxuan)
* 🐞 修复编译时 typescript v2.9.1兼容性问题。 [#10729](https://github.com/ant-design/ant-design/issues/10729) [@karol-majewski](https://github.com/karol-majewski)
* 🐞 修复 `Menu` 嵌套超过两层时选中最里层后对应最外层没有亮起问题。 [#8666](https://github.com/ant-design/ant-design/issues/8666) [@stonehank](https://github.com/stonehank)
* 🐞 修复 `Affix` 组件 offsetBottom 无效问题。 [#10674](https://github.com/ant-design/ant-design/issues/10674)
## 3.5.4
`2018-05-26`
- 🐞 修复 `Cascader``showSearch` 无效问题。[968488a2](https://github.com/ant-design/ant-design/commit/968488a2fac9bcb16bee9f0c248f49bca00dbec6)
- 🐞 使 `Badge[status]` 支持 `Tooltip`。[#10626](https://github.com/ant-design/ant-design/issues/10626)
- 🐞 修复父元素使用 `text-align` 会影响 `Spin` 的问题。[#10643](https://github.com/ant-design/ant-design/pull/10643) [@wmzhong](https://github.com/wmzhong)
- 💄 `Table` 换行从 `break-all` 改为 `break-word`。[#10655](https://github.com/ant-design/ant-design/pull/10655) [@clinyong](https://github.com/clinyong)
- 🌟 `Search` 在未定义 `enterButton` 时,点击搜索图标将触发 `onSearch`。 [36ffe7e1](https://github.com/ant-design/ant-design/commit/36ffe7e1dc9d9473c8c68168ab79b7a03a604702)
## 3.5.3
`2018-05-20`
- 🐞 修复了 `Affix``offsetTop === 0`,值将变为 `undefined` 的问题 [#10566](https://github.com/ant-design/ant-design/pull/10566)
- 🐞 修复了 `Menu` item 中的高亮链接颜色问题 [09d5e36](https://github.com/ant-design/ant-design/commit/09d5e36cfa27e371a7b4d4e68276a279698ea901)
- 🐞 修复了 `Input.Group` 组件阴影被遮盖的问题 [#10230](https://github.com/ant-design/ant-design/issues/10230)
- 🐞 修复了 `Transfer` 组件 checkbox 事件触发两次的问题 [`#10480`](https://github.com/ant-design/ant-design/issues/10480)
- 💄 统一 less 的变量命名 [12d3046](https://github.com/ant-design/ant-design/commit/12d3046687a0dcdb51fece08dd2bea64f185cc40)
- 💄 微调了 `Dropdown` 的样式 [8e2f72f](https://github.com/ant-design/ant-design/commit/8e2f72ffe0eb300f5997296726b02246bf990c8f)
- 💄 现在中文文档的组件会用中文语言包进行演示。[9b17a94](https://github.com/ant-design/ant-design/commit/9b17a943f5d57d40d65041b7b0c247add09d2851)
- 💄 主站主题切换 修改为 `antd-theme-generato` ,感谢 [@mzohaibqc](https://github.com/mzohaibqc) 的工作.
- TypeScript
- 🐞 修复了 `Row` 中 gutter 属性的类型问题 [b7d508e](https://github.com/ant-design/ant-design/commit/b7d508e1662bf20a0cacbe6440a2ce31a65a8a59)
- 💄 改进了 `Form` 组件类型 [#10564](https://github.com/ant-design/ant-design/pull/10564)
- 💄 改进了 `Button``Tag` 类型 [1ed9fed](https://github.com/ant-design/ant-design/commit/1ed9fed2cf1c99b947359fafb101b2e58213cb48)
## 3.5.2
`2018-05-13`
- 🐞 修复 `Table` 过滤器和 `Transfer` 复选框无法点击的问题。[#10452](https://github.com/ant-design/ant-design/issues/10452)
- 🐞 修复 `Cascader` `displayRender` 里的链接无法点击的问题。[#10433](https://github.com/ant-design/ant-design/issues/10433)
- 🐞 修复 `Button` ref 不兼容问题。[#10405](https://github.com/ant-design/ant-design/issues/10405)
- 🐞 修复 `Form` 表单项校验位置高度时出现抖动问题。[#10445](https://github.com/ant-design/ant-design/issues/10445)
- 🌟 设置 `Layout` 宽度时,允许使用任何的 CSS 单位。 [#10479](https://github.com/ant-design/ant-design/pull/10479)
## 3.5.1
`2018-05-09`
- 🐞 修复 Input.Group 在 Form 下样式错位的问题。[#10371](https://github.com/ant-design/ant-design/issues/10371)
- 🐞 修复 Select 箭头和内容重叠的问题。[#10383](https://github.com/ant-design/ant-design/issues/10383)
- 🐞 移除 Collapse 点击时的 focus 样式。
- 🐞 移除 Input.Group 和 Checkbox 不必要的 `z-index`。[#9840](https://github.com/ant-design/ant-design/issues/9840) [#10385](https://github.com/ant-design/ant-design/issues/10385)
- 🐞 修复一个数字等宽字体没有加粗的问题。
- Table
- 💄 重写了可编辑表格的演示。[#10119](https://github.com/ant-design/ant-design/pull/10119)
- 🐞 修复一个表格列内容互相重叠的问题。[#9822](https://github.com/ant-design/ant-design/issues/9822)
- TypeScript
- 🐞 调整 Breadcrumb.Item 的类型。[#10372](https://github.com/ant-design/ant-design/pull/10372) [@karol-majewski](https://github.com/karol-majewski)
- 🐞 修复 Table 的 `rowSelection` 的类型。[#10374](https://github.com/ant-design/ant-design/issues/10374)
## 3.5.0
`2018-05-04`
- 🌟 组件 `Badge` 新增 `title` 属性支持鼠标 hover 的时候显示。[74d81c2](https://github.com/ant-design/ant-design/commit/74d81c2d078a3c84b3e44cbfbdd99b8f479ea71d) [@ludwigbacklund](https://github.com/ludwigbacklund)
- 🌟 添加 `successPercent``Progress[format]` 的参数。[#10096](https://github.com/ant-design/ant-design/issues/10096)
- 🌟 更新 `rc-notification` 到 3.1.0 来支持组件 `Notification``maxCount` 属性。[#10161](https://github.com/ant-design/ant-design/pull/10161) [@jzhangs](https://github.com/jzhangs)
- 🌟 更新 `rc-cascader` 到 1.13.0 来支持组件 `Cascader``filedNames` 属性。[react-component/cascader#23](https://github.com/react-component/cascader/pull/23) [@405go](https://github.com/405go)
- 🌟 组件 `Notification` 支持通过 key 更新通知属性。 [react-component/notification#40](https://github.com/react-component/notification/pull/40) [@yevhen-hryhorevskyi](https://github.com/yevhen-hryhorevskyi)
- 🌟 组件 `List` 支持内置的翻页功能。[#10135](https://github.com/ant-design/ant-design/pull/10135)
- Table
- 🌟 新增 `sortOrder` 参数传递给列配置中的 `sorter` 方法。[#10306](https://github.com/ant-design/ant-design/pull/10306) [@kumarashwin](https://github.com/kumarashwin)
- 🐞 修复头部单元格的边框样式问题。[#10359](https://github.com/ant-design/ant-design/issues/10359)
- 🐞 修复当数据变化时用户选择项丢失的问题。[#10332](https://github.com/ant-design/ant-design/pull/10332) [@chrvadala](https://github.com/chrvadala)
- `Menu` 升级 `rc-menu``7.x` [#10305](https://github.com/ant-design/ant-design/pull/10305)
- 🌟 更好的 aria-* 属性支持。[react-component/menu#137](https://github.com/react-component/menu/pull/137)
- 🌟 一些内部优化提升组件性能。[react-component/menu#133](https://github.com/react-component/menu/pull/133)
- 🌟 支持将属性传递到菜单项中。[react-component/menu#135](https://github.com/react-component/menu/pull/135)
- 🐞 修复一些快捷键的问题。[react-component/menu#132](https://github.com/react-component/menu/pull/132)
- Collapse
- 🌟 更新 `rc-collapse` 到 1.9.0 优化键盘支持。[react-component/collapse#84](https://github.com/react-component/collapse/pull/84/) [@kossel](https://github.com/kossel)
- 🌟 支持通过 less 定义组件 `Collapse` 的样式。[#9943](https://github.com/ant-design/ant-design/pull/9943) [@davidhatten](https://github.com/davidhatten)
- Select
- 🐞 修复 `placeholder` 的 ts 类型问题。[#10282](https://github.com/ant-design/ant-design/pull/10282) [@thomasthiebaud](https://github.com/thomasthiebaud)
- 🐞 修复不显示箭头时多余的空白。[#10296](https://github.com/ant-design/ant-design/pull/10296)
- 🐞 修复属性 `value` 的 typescript 类型错误。[#10336](https://github.com/ant-design/ant-design/pull/10336) [@paranoidjk](https://github.com/paranoidjk)
- Input
- 🐞 修复 `Input.Search` 当 disabled 为 true 时按钮没有被禁用的问题。[#10040](https://github.com/ant-design/ant-design/issues/10040)
- 🐞 修复 `Input.Group` 在表单中对齐的问题。[#10281](https://github.com/ant-design/ant-design/issues/10281)
- Form
- 🐞 修复 `Form.onValuesChange` 的 ts 类型错误。[#10231](https://github.com/ant-design/ant-design/pull/10231) [@whtsky](https://github.com/whtsky)
- 🐞 修复 `ComponentDecorator` typescript 定义的错误。[#10324](https://github.com/ant-design/ant-design/pull/10324) [@paranoidjk](https://github.com/paranoidjk)
- 🐞 修复 `Divider` 为 dashed 时的样式问题。[#10216](https://github.com/ant-design/ant-design/issues/10216)
- 🐞 修复 `Spin` 覆盖层的展示问题。[#10227](https://github.com/ant-design/ant-design/issues/10227)
- 🐞 修复 `Notification` 鼠标 hover 是图标的颜色问题。[#10272](https://github.com/ant-design/ant-design/issues/10272)
- 🐞 修复 `Upload` 组件属性 `lastModifiedDate` 的拼写错误。[#10315](https://github.com/ant-design/ant-design/pull/10315) [@danielg2002](https://github.com/danielg2002)
- 🐞 修复 `Button` 的属性类型,使用 `React.HTMLProps`。[#10229](https://github.com/ant-design/ant-design/pull/10229) [@whtsky](https://github.com/whtsky)
- 🐞 修复 less 命名约定不一致的问题。 [#10275](https://github.com/ant-design/ant-design/issues/10275)
## 3.4.5
`2018-05-03`
- 🐞 修复 Upload 上传文件名不展示file 对象属性为空)的问题。[#10319](https://github.com/ant-design/ant-design/issues/10319)
## 3.4.4
`2018-04-28`
- 🐞 修复 3.4.2 中引入的 Upload 中 onChange 参数 `{ file }` file 不是 File 实例的问题。[#10293](https://github.com/ant-design/ant-design/issues/10293)
- 🐞 修复 webpack@4 下使用 Tree Shaking 样式丢失的问题。[#10217](https://github.com/ant-design/ant-design/pull/10217) [@whtsky](https://github.com/whtsky)
## 3.4.3
`2018-04-23`
- 🐞 修复了 webpack@4 下使用 Tree Shaking 样式丢失的问题。[#10197](https://github.com/ant-design/ant-design/pull/10197) [@Aladdin-ADD](https://github.com/Aladdin-ADD)
- 🐞 修复 `Menu` 组件在 `dark` 主题下点击区域的问题。[#10187](https://github.com/ant-design/ant-design/pull/10187) [@dgeibi](https://github.com/dgeibi)
## 3.4.2
`2018-04-22`
@@ -289,7 +567,7 @@ timeline: true
- 🐞 修复 Table 在设置 `size=small` 的情况下出现多余 padding 的问题。[#8724](https://github.com/ant-design/ant-design/issues/8724)
- 🐞 修复 Checkbox.Group 在 Form 中和 label 的对齐问题。[#8739](https://github.com/ant-design/ant-design/issues/8739)
- 🐞 修复 Affix 组件出现滚动条的问题。[#8606](https://github.com/ant-design/ant-design/issues/8606)
- 🐞 修复组件 List "No Data" 和加载动画重叠的问题. [#8647](https://github.com/ant-design/ant-design/issues/8647)
- 🐞 修复组件 List "No Data" 和加载动画重叠的问题[#8647](https://github.com/ant-design/ant-design/issues/8647)
- 🌟 为 Input 添加 onKeyUp。[#8705](https://github.com/ant-design/ant-design/issues/8705) [@delesseps](https://github.com/delesseps)
- 🌟 折叠面板 Collapse 添加 `showArrow` 来支持隐藏箭头。[#8536](https://github.com/ant-design/ant-design/pull/8536) [@apieceofbart](https://github.com/apieceofbart)
- 🌟 评分 Rate 组件添加 `allowClear`,支持再次点击后重置。[#8627](https://github.com/ant-design/ant-design/issues/8627)
@@ -357,11 +635,11 @@ timeline: true
`2017-12-04`
更多内容见 [Ant Design 3.0 发布公告](https://medium.com/ant-design/announcing-ant-design-3-0-70e3e65eca0c)
更多内容见 [Ant Design 3.0 发布公告](https://medium.com/ant-design/announcing-ant-design-3-0-70e3e65eca0c)
### 主要变化
- 全新的[色彩系统](https://ant.design/docs/spec/colors-cn#Color-Palettes),组件主色由 `#108EE9` 改为 `#1890FF`』,新主色我们称之为『拂晓蓝』。
- 全新的[色彩系统](https://ant.design/docs/spec/colors-cn#Color-Palettes),组件主色由『`#108EE9`』改为『`#1890FF`』,新主色我们称之为『拂晓蓝』。
- 全新的视觉样式和组件尺寸,更现代更美观。
- 基础字体大小由 `12px` 增大到 `14px`
- 默认语言由中文改为英文。
@@ -373,6 +651,8 @@ timeline: true
### 不兼容改动
> 如果你从 2.x 升级到 3.x建议直接升级到 3.x 的最新版本。
此版本有部分不兼容的改动,升级时确保修改相应的使用代码。另外由于人肉查找代码中的废弃用法过于低效,所以我们提供了 [antd-migration-helper](https://github.com/ant-design/antd-migration-helper) 用于扫描代码中的废弃用法。
- Card 的 `noHovering` 属性重命名为 `hoverable`,且默认值改为 `true`
@@ -419,7 +699,7 @@ timeline: true
- Form 下的表单控件不再默认为 `size="large"`。
- `Input.Search` 默认的 🔍 图标只作为装饰,不再响应用户交互。需要添加可交互按钮请使用 `enterButton`。
- UMD 版本的 `dist/antd.js` 不再包含 moment使用的时候需要自己引入 moment。
- UMD 版本的 `dist/antd.js` 不再包含 moment使用的时候需要自己引入 moment。
```diff
<html>
<head>
@@ -444,7 +724,7 @@ timeline: true
- 🌟 Row 的 `gutter` 属性新增响应式断点的支持,可以使用诸如 `gutter={{ sm: 16, lg: 32 }}` 的设置。
- 🌟 Spin 新增 `indicator` 属性,用于设置自定义的加载指示符。 [#7977](https://github.com/ant-design/ant-design/pull/7977) [@kossel](https://github.com/ant-design/ant-design/pull/7977)
- 🌟 Input.Search 新增 `enterButton` 用于设置自定义的搜索图标。[#7596](https://github.com/ant-design/ant-design/issues/7596)
- 🌟 Mention 新增 `placement`, 用于设置下拉框的弹出方向。
- 🌟 Mention 新增 `placement`用于设置下拉框的弹出方向。
- 🌟 Carousel 新增 `next()`、`prev()`、`goTo(slideNumber)` 方法,用于控制面板展示。
- 🌟 Button 新增链接支持,当提供 `href` 时会自动渲染为 `<a>`。[#8343](https://github.com/ant-design/ant-design/pull/8343)
- 🌟 Steps 进行了重构,首次渲染的时候不会再闪烁。 [#6010](https://github.com/ant-design/ant-design/issues/6010)

View File

@@ -8,7 +8,8 @@
[![](https://img.shields.io/travis/ant-design/ant-design.svg?style=flat-square)](https://travis-ci.org/ant-design/ant-design)
[![Codecov](https://img.shields.io/codecov/c/github/ant-design/ant-design/master.svg?style=flat-square)](https://codecov.io/gh/ant-design/ant-design/branch/master)
[![Dependency Status](https://img.shields.io/gemnasium/react-component/trigger.svg?style=flat-square)](https://gemnasium.com/ant-design/ant-design)
[![Dependencies](https://img.shields.io/david/ant-design/ant-design.svg)](https://david-dm.org/ant-design/ant-design)
[![DevDependencies](https://img.shields.io/david/dev/ant-design/ant-design.svg)](https://david-dm.org/ant-design/ant-design?type=dev)
[![npm package](https://img.shields.io/npm/v/antd.svg?style=flat-square)](https://www.npmjs.org/package/antd)
[![NPM downloads](http://img.shields.io/npm/dm/antd.svg?style=flat-square)](http://www.npmtrends.com/antd)
@@ -33,6 +34,10 @@
* 支持服务端渲染。
* [Electron](http://electron.atom.io/)
| [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/edge/edge_48x48.png" alt="IE / Edge" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)</br>IE / Edge | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/firefox/firefox_48x48.png" alt="Firefox" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)</br>Firefox | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/chrome/chrome_48x48.png" alt="Chrome" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)</br>Chrome | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/safari/safari_48x48.png" alt="Safari" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)</br>Safari | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/opera/opera_48x48.png" alt="Opera" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)</br>Opera | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/electron/electron_48x48.png" alt="Electron" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)</br>Electron |
| --------- | --------- | --------- | --------- | --------- | --------- |
| IE9, IE10, IE11, Edge| last 2 versions| last 2 versions| last 2 versions| last 2 versions| last 2 versions
## 参与共建 [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](http://makeapullrequest.com)
请参考[贡献指南](https://ant.design/docs/react/contributing-cn).
@@ -93,7 +98,7 @@ $ npm install
$ npm start
```
打开浏览器访问 http://127.0.0.1:8001 ,更多本地开发文档参见: https://github.com/ant-design/ant-design/wiki/Development
打开浏览器访问 http://127.0.0.1:8001 ,更多[本地开发文档](https://github.com/ant-design/ant-design/wiki/Development)
## 如何贡献

View File

@@ -6,9 +6,10 @@
# Ant Design
[![](https://img.shields.io/travis/ant-design/ant-design.svg?style=flat-square)](https://travis-ci.org/ant-design/ant-design)
[![](https://img.shields.io/travis/ant-design/ant-design/master.svg?style=flat-square)](https://travis-ci.org/ant-design/ant-design)
[![Codecov](https://img.shields.io/codecov/c/github/ant-design/ant-design/master.svg?style=flat-square)](https://codecov.io/gh/ant-design/ant-design/branch/master)
[![Dependency Status](https://img.shields.io/gemnasium/react-component/trigger.svg?style=flat-square)](https://gemnasium.com/ant-design/ant-design)
[![Dependencies](https://img.shields.io/david/ant-design/ant-design.svg)](https://david-dm.org/ant-design/ant-design)
[![DevDependencies](https://img.shields.io/david/dev/ant-design/ant-design.svg)](https://david-dm.org/ant-design/ant-design?type=dev)
[![npm package](https://img.shields.io/npm/v/antd.svg?style=flat-square)](https://www.npmjs.org/package/antd)
[![NPM downloads](http://img.shields.io/npm/dm/antd.svg?style=flat-square)](http://www.npmtrends.com/antd)
@@ -37,6 +38,10 @@ An enterprise-class UI design language and React-based implementation.
* Server-side Rendering
* [Electron](http://electron.atom.io/)
| [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/edge/edge_48x48.png" alt="IE / Edge" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)</br>IE / Edge | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/firefox/firefox_48x48.png" alt="Firefox" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)</br>Firefox | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/chrome/chrome_48x48.png" alt="Chrome" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)</br>Chrome | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/safari/safari_48x48.png" alt="Safari" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)</br>Safari | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/opera/opera_48x48.png" alt="Opera" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)</br>Opera | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/electron/electron_48x48.png" alt="Electron" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)</br>Electron |
| --------- | --------- | --------- | --------- | --------- | --------- |
| IE9, IE10, IE11, Edge| last 2 versions| last 2 versions| last 2 versions| last 2 versions| last 2 versions
## Let's build a better antd together [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](http://makeapullrequest.com)
Read our [contributing guide](https://ant.design/docs/react/contributing).
@@ -66,7 +71,6 @@ Or [import components on demand](https://ant.design/docs/react/getting-started#I
See [Use in TypeScript](https://ant.design/docs/react/use-in-typescript)
## Internationalization
See [i18n](http://ant.design/docs/react/i18n).
@@ -97,7 +101,7 @@ $ npm install
$ npm start
```
Open your browser and visit http://127.0.0.1:8001 , see more at https://github.com/ant-design/ant-design/wiki/Development .
Open your browser and visit http://127.0.0.1:8001 , see more at [Development](https://github.com/ant-design/ant-design/wiki/Development).
## Contributing

View File

@@ -21,6 +21,7 @@ Array [
"DatePicker",
"Divider",
"Dropdown",
"Drawer",
"Form",
"Icon",
"Input",

View File

@@ -1,12 +1,18 @@
const OLD_NODE_ENV = process.env.NODE_ENV;
process.env.NODE_ENV = 'development';
const warnSpy = jest.spyOn(console, 'warn').mockImplementation(() => {});
const antd = require('..');
describe('antd', () => {
afterAll(() => {
process.env.NODE_ENV = OLD_NODE_ENV;
});
it('exports modules correctly', () => {
expect(Object.keys(antd)).toMatchSnapshot();
});
it('should hint when import all components', () => {
it('should hint when import all components in dev mode', () => {
expect(warnSpy).toBeCalledWith(
'You are using a whole package of antd, please use https://www.npmjs.com/package/babel-plugin-import to reduce app bundle size.'
);

View File

@@ -1,4 +1,5 @@
import throttleByAnimationFrame from '../throttleByAnimationFrame';
import getDataOrAriaProps from '../getDataOrAriaProps';
describe('Test utils function', () => {
beforeAll(() => {
@@ -32,4 +33,55 @@ describe('Test utils function', () => {
jest.runAllTimers();
expect(callback).not.toBeCalled();
});
describe('getDataOrAriaProps', () => {
it('returns all data-* properties from an object', () => {
const props = {
onClick: () => {},
isOpen: true,
'data-test': 'test-id',
'data-id': 1234,
};
const results = getDataOrAriaProps(props);
expect(results).toEqual({
'data-test': 'test-id',
'data-id': 1234,
});
});
it('does not return data-__ properties from an object', () => {
const props = {
onClick: () => {},
isOpen: true,
'data-__test': 'test-id',
'data-__id': 1234,
};
const results = getDataOrAriaProps(props);
expect(results).toEqual({});
});
it('returns all aria-* properties from an object', () => {
const props = {
onClick: () => {},
isOpen: true,
'aria-labelledby': 'label-id',
'aria-label': 'some-label',
};
const results = getDataOrAriaProps(props);
expect(results).toEqual({
'aria-labelledby': 'label-id',
'aria-label': 'some-label',
});
});
it('returns role property from an object', () => {
const props = {
onClick: () => {},
isOpen: true,
role: 'search',
};
const results = getDataOrAriaProps(props);
expect(results).toEqual({ role: 'search' });
});
});
});

View File

@@ -0,0 +1,11 @@
export default function getDataOrAriaProps(props: any) {
return Object.keys(props).reduce((prev: any, key: string) => {
if (
(key.substr(0, 5) === 'data-' || key.substr(0, 5) === 'aria-' || key === 'role') &&
key.substr(0, 7) !== 'data-__'
) {
prev[key] = props[key];
}
return prev;
}, {});
}

View File

@@ -1,46 +0,0 @@
const availablePrefixs = ['moz', 'ms', 'webkit'];
function requestAnimationFramePolyfill() {
let lastTime = 0;
return function(callback: (n: number) => void) {
const currTime = new Date().getTime();
const timeToCall = Math.max(0, 16 - (currTime - lastTime));
const id = window.setTimeout(function() { callback(currTime + timeToCall); }, timeToCall);
lastTime = currTime + timeToCall;
return id;
};
}
export default function getRequestAnimationFrame() {
if (typeof window === 'undefined') {
return () => {};
}
if (window.requestAnimationFrame) {
// https://github.com/vuejs/vue/issues/4465
return window.requestAnimationFrame.bind(window);
}
const prefix = availablePrefixs.filter(key => `${key}RequestAnimationFrame` in window)[0];
return prefix
? (window as any)[`${prefix}RequestAnimationFrame`]
: requestAnimationFramePolyfill();
}
export function cancelRequestAnimationFrame(id: number) {
if (typeof window === 'undefined') {
return null;
}
if (window.cancelAnimationFrame) {
return window.cancelAnimationFrame(id);
}
const prefix = availablePrefixs.filter(key =>
`${key}CancelAnimationFrame` in window || `${key}CancelRequestAnimationFrame` in window,
)[0];
return prefix ?
(
(window as any)[`${prefix}CancelAnimationFrame`] ||
(window as any)[`${prefix}CancelRequestAnimationFrame`]
).call(this, id) : clearTimeout(id);
}

View File

@@ -1,24 +0,0 @@
let animation: boolean;
function isCssAnimationSupported() {
if (animation !== undefined) {
return animation;
}
const domPrefixes = 'Webkit Moz O ms Khtml'.split(' ');
const elm = document.createElement('div');
if (elm.style.animationName !== undefined) {
animation = true;
}
if (animation !== undefined) {
for (let i = 0; i < domPrefixes.length; i++) {
if ((elm.style as any)[`${domPrefixes[i]}AnimationName`] !== undefined) {
animation = true;
break;
}
}
}
animation = animation || false;
return animation;
}
export default isCssAnimationSupported;

View File

@@ -0,0 +1,5 @@
const isNumeric = (value: any): boolean => {
return !isNaN(parseFloat(value)) && isFinite(value);
};
export default isNumeric;

View File

@@ -1,7 +1,5 @@
import cssAnimation from 'css-animation';
import getRequestAnimationFrame, { cancelRequestAnimationFrame } from './getRequestAnimationFrame';
const reqAnimFrame = getRequestAnimationFrame();
import raf from 'raf';
function animate(node: HTMLElement, show: boolean, done: () => void) {
let height: number;
@@ -19,16 +17,16 @@ function animate(node: HTMLElement, show: boolean, done: () => void) {
},
active() {
if (requestAnimationFrameId) {
cancelRequestAnimationFrame(requestAnimationFrameId);
raf.cancel(requestAnimationFrameId);
}
requestAnimationFrameId = reqAnimFrame(() => {
requestAnimationFrameId = raf(() => {
node.style.height = `${show ? height : 0}px`;
node.style.opacity = show ? '1' : '0';
});
},
end() {
if (requestAnimationFrameId) {
cancelRequestAnimationFrame(requestAnimationFrameId);
raf.cancel(requestAnimationFrameId);
}
node.style.height = '';
node.style.opacity = '';

View File

@@ -1,6 +1,4 @@
import getRequestAnimationFrame, { cancelRequestAnimationFrame } from '../_util/getRequestAnimationFrame';
const reqAnimFrame = getRequestAnimationFrame();
import raf from 'raf';
export default function throttleByAnimationFrame(fn: (...args: any[]) => void) {
let requestId: number | null;
@@ -12,11 +10,11 @@ export default function throttleByAnimationFrame(fn: (...args: any[]) => void) {
const throttled = (...args: any[]) => {
if (requestId == null) {
requestId = reqAnimFrame(later(args));
requestId = raf(later(args));
}
};
(throttled as any).cancel = () => cancelRequestAnimationFrame(requestId!);
(throttled as any).cancel = () => raf.cancel(requestId!);
return throttled;
}

View File

@@ -1,3 +1 @@
export type Diff<T extends string, U extends string> = ({ [P in T]: P } &
{ [P in U]: never } & { [x: string]: never })[T];
export type Omit<T, K extends keyof T> = Pick<T, Diff<keyof T, K>>;
export type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>;

View File

@@ -7,14 +7,15 @@ const events = {};
class AffixMounter extends React.Component {
componentDidMount() {
this.container.scrollTop = 100;
this.container.addEventListener = jest.fn().mockImplementation((event, cb) => {
events[event] = cb;
});
}
getTarget = () => {
return this.container;
}
render() {
return (
<div
@@ -34,8 +35,9 @@ class AffixMounter extends React.Component {
<Affix
target={() => this.container}
ref={ele => this.affix = ele}
{...this.props}
>
<Button type="primary" >
<Button type="primary">
Fixed at the top of container
</Button>
</Affix>
@@ -46,6 +48,8 @@ class AffixMounter extends React.Component {
}
describe('Affix Render', () => {
let wrapper;
beforeAll(() => {
jest.useFakeTimers();
});
@@ -54,23 +58,63 @@ describe('Affix Render', () => {
jest.useRealTimers();
});
it('Anchor render perfectly', () => {
document.body.innerHTML = '<div id="mounter" />';
const wrapper = mount(<AffixMounter />, { attachTo: document.getElementById('mounter') });
jest.runAllTimers();
const scrollTo = (top) => {
wrapper.instance().affix.fixedNode.parentNode.getBoundingClientRect = jest.fn(() => {
return {
bottom: 100, height: 28, left: 0, right: 0, top: -50, width: 195,
bottom: 100, height: 28, left: 0, right: 0, top: 50 - top, width: 195,
};
});
wrapper.instance().container.scrollTop = top;
events.scroll({
type: 'scroll',
});
jest.runAllTimers();
};
it('Anchor render perfectly', () => {
document.body.innerHTML = '<div id="mounter" />';
wrapper = mount(<AffixMounter />, { attachTo: document.getElementById('mounter') });
jest.runAllTimers();
scrollTo(0);
expect(wrapper.instance().affix.state.affixStyle).toBe(null);
scrollTo(100);
expect(wrapper.instance().affix.state.affixStyle).not.toBe(null);
scrollTo(0);
expect(wrapper.instance().affix.state.affixStyle).toBe(null);
});
it('support offsetBottom', () => {
document.body.innerHTML = '<div id="mounter" />';
wrapper = mount(<AffixMounter offsetBottom={0} />, { attachTo: document.getElementById('mounter') });
jest.runAllTimers();
scrollTo(0);
expect(wrapper.instance().affix.state.affixStyle).not.toBe(null);
scrollTo(100);
expect(wrapper.instance().affix.state.affixStyle).toBe(null);
scrollTo(0);
expect(wrapper.instance().affix.state.affixStyle).not.toBe(null);
});
it('updatePosition when offsetTop changed', () => {
document.body.innerHTML = '<div id="mounter" />';
wrapper = mount(<AffixMounter offsetTop={0} />, { attachTo: document.getElementById('mounter') });
jest.runAllTimers();
scrollTo(100);
expect(wrapper.instance().affix.state.affixStyle.top).toBe(0);
wrapper.setProps({
offsetTop: 10,
});
jest.runAllTimers();
expect(wrapper.instance().affix.state.affixStyle.top).toBe(10);
});
});

View File

@@ -16,16 +16,44 @@ The simplest usage.
````jsx
import { Affix, Button } from 'antd';
ReactDOM.render(
<div>
<Affix>
<Button type="primary">Affix top</Button>
</Affix>
<br />
<Affix offsetBottom={0}>
<Button type="primary">Affix bottom</Button>
</Affix>
</div>,
mountNode
);
class Demo extends React.Component {
state = {
top: 10,
bottom: 10,
}
render() {
return (
<div>
<Affix offsetTop={this.state.top}>
<Button
type="primary"
onClick={() => {
this.setState({
top: this.state.top + 10,
});
}}
>
Affix top
</Button>
</Affix>
<br />
<Affix offsetBottom={this.state.bottom}>
<Button
type="primary"
onClick={() => {
this.setState({
bottom: this.state.bottom + 10,
});
}}
>
Affix bottom
</Button>
</Affix>
</div>
);
}
}
ReactDOM.render(<Demo />, mountNode);
````

View File

@@ -38,8 +38,7 @@ function getOffset(element: HTMLElement, target: HTMLElement | Window | null) {
function noop() {}
function getDefaultTarget() {
return typeof window !== 'undefined' ?
window : null;
return typeof window !== 'undefined' ? window : null;
}
// Affix
@@ -145,7 +144,9 @@ export default class Affix extends React.Component<AffixProps, AffixState> {
const targetNode = target();
// Backwards support
offsetTop = offsetTop || offset;
// Fix: if offsetTop === 0, it will get undefined,
// if offsetBottom is type of number, offsetMode will be { top: false, ... }
offsetTop = typeof offsetTop === 'undefined' ? offset : offsetTop;
const scrollTop = getScroll(targetNode, true);
const affixNode = ReactDOM.findDOMNode(this) as HTMLElement;
const elemOffset = getOffset(affixNode, targetNode);
@@ -232,6 +233,12 @@ export default class Affix extends React.Component<AffixProps, AffixState> {
// Mock Event object.
this.updatePosition({});
}
if (
this.props.offsetTop !== nextProps.offsetTop ||
this.props.offsetBottom !== nextProps.offsetBottom
) {
this.updatePosition({});
}
}
componentWillUnmount() {

View File

@@ -0,0 +1,58 @@
import React from 'react';
import { mount } from 'enzyme';
import Alert from '..';
describe('Alert', () => {
beforeAll(() => {
jest.useFakeTimers();
});
afterAll(() => {
jest.useRealTimers();
});
it('could be closed', () => {
const onClose = jest.fn();
const afterClose = jest.fn();
const wrapper = mount(
<Alert
message="Warning Text Warning Text Warning TextW arning Text Warning Text Warning TextWarning Text"
type="warning"
closable
onClose={onClose}
afterClose={afterClose}
/>
);
wrapper.find('.ant-alert-close-icon').simulate('click');
expect(onClose).toBeCalled();
jest.runAllTimers();
expect(afterClose).toBeCalled();
});
describe('data and aria props', () => {
it('sets data attributes on input', () => {
const wrapper = mount(
<Alert data-test="test-id" data-id="12345" />
);
const input = wrapper.find('.ant-alert').getDOMNode();
expect(input.getAttribute('data-test')).toBe('test-id');
expect(input.getAttribute('data-id')).toBe('12345');
});
it('sets aria attributes on input', () => {
const wrapper = mount(
<Alert aria-describedby="some-label" />
);
const input = wrapper.find('.ant-alert').getDOMNode();
expect(input.getAttribute('aria-describedby')).toBe('some-label');
});
it('sets role attribute on input', () => {
const wrapper = mount(
<Alert role="status" />
);
const input = wrapper.find('.ant-alert').getDOMNode();
expect(input.getAttribute('role')).toBe('status');
});
});
});

View File

@@ -26,6 +26,6 @@ ReactDOM.render(
<Alert showIcon={false} message="Warning text without icon" banner />
<br />
<Alert type="error" message="Error text" banner />
</div>
, mountNode);
</div>,
mountNode);
````

View File

@@ -17,8 +17,8 @@ The simplest usage for short messages.
import { Alert } from 'antd';
ReactDOM.render(
<Alert message="Success Text" type="success" />
, mountNode);
<Alert message="Success Text" type="success" />,
mountNode);
````
<style>

View File

@@ -35,6 +35,6 @@ ReactDOM.render(
closable
onClose={onClose}
/>
</div>
, mountNode);
</div>,
mountNode);
````

View File

@@ -17,6 +17,6 @@ Replace the default icon with customized text.
import { Alert } from 'antd';
ReactDOM.render(
<Alert message="Info Text" type="info" closeText="Close Now" />
, mountNode);
<Alert message="Info Text" type="info" closeText="Close Now" />,
mountNode);
````

View File

@@ -38,6 +38,6 @@ ReactDOM.render(
description="Error Description Error Description Error Description Error Description"
type="error"
/>
</div>
, mountNode);
</div>,
mountNode);
````

View File

@@ -46,6 +46,6 @@ ReactDOM.render(
type="error"
showIcon
/>
</div>
, mountNode);
</div>,
mountNode);
````

View File

@@ -20,9 +20,11 @@ class App extends React.Component {
state = {
visible: true,
}
handleClose = () => {
this.setState({ visible: false });
}
render() {
return (
<div>
@@ -43,6 +45,6 @@ class App extends React.Component {
}
ReactDOM.render(
<App />
, mountNode);
<App />,
mountNode);
````

View File

@@ -22,6 +22,6 @@ ReactDOM.render(
<Alert message="Info Text" type="info" />
<Alert message="Warning Text" type="warning" />
<Alert message="Error Text" type="error" />
</div>
, mountNode);
</div>,
mountNode);
````

View File

@@ -20,8 +20,8 @@ Alert component for feedback.
| closable | Whether Alert can be closed | boolean | - |
| closeText | Close text to show | string\|ReactNode | - |
| description | Additional content of Alert | string\|ReactNode | - |
| iconType | Icon type, effective when `showIcon` is `true` | string | - |
| message | Content of Alert | string\|ReactNode | - |
| showIcon | Whether to show icon | boolean | false, in `banner` mode default is true |
| iconType | Icon type, effective when `showIcon` is `true` | string | - |
| type | Type of Alert styles, options: `success`, `info`, `warning`, `error` | string | `info`, in `banner` mode default is `warning` |
| onClose | Callback when Alert is closed | (e: MouseEvent) => void | - |

View File

@@ -3,6 +3,7 @@ import * as ReactDOM from 'react-dom';
import Animate from 'rc-animate';
import Icon from '../icon';
import classNames from 'classnames';
import getDataOrAriaProps from '../_util/getDataOrAriaProps';
function noop() { }
@@ -114,6 +115,8 @@ export default class Alert extends React.Component<AlertProps, any> {
</a>
) : null;
const dataOrAriaProps = getDataOrAriaProps(this.props);
return this.state.closed ? null : (
<Animate
component=""
@@ -121,7 +124,7 @@ export default class Alert extends React.Component<AlertProps, any> {
transitionName={`${prefixCls}-slide-up`}
onEnd={this.animationEnd}
>
<div data-show={this.state.closing} className={alertCls} style={style}>
<div data-show={this.state.closing} className={alertCls} style={style} {...dataOrAriaProps}>
{showIcon ? <Icon className={`${prefixCls}-icon`} type={iconType} /> : null}
<span className={`${prefixCls}-message`}>{message}</span>
<span className={`${prefixCls}-description`}>{description}</span>

View File

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

View File

@@ -5,6 +5,7 @@
@alert-message-color: @heading-color;
@alert-text-color: @text-color;
@alert-close-color: @text-color-secondary;
.@{alert-prefix-cls} {
.reset-component;
@@ -70,7 +71,7 @@
cursor: pointer;
.@{iconfont-css-prefix}-cross {
color: @text-color-secondary;
color: @alert-close-color;
transition: color .3s;
&:hover {
color: #404040;
@@ -87,7 +88,7 @@
padding: 15px 15px 15px 64px;
position: relative;
border-radius: @border-radius-base;
color: @text-color;
color: @alert-text-color;
line-height: @line-height-base;
}

View File

@@ -6,7 +6,7 @@ import addEventListener from 'rc-util/lib/Dom/addEventListener';
import Affix from '../affix';
import AnchorLink from './AnchorLink';
import getScroll from '../_util/getScroll';
import getRequestAnimationFrame from '../_util/getRequestAnimationFrame';
import raf from 'raf';
function getDefaultContainer() {
return window;
@@ -43,7 +43,6 @@ function easeInOutCubic(t: number, b: number, c: number, d: number) {
return cc / 2 * ((t -= 2) * t * t + 2) + b;
}
const reqAnimFrame = getRequestAnimationFrame();
const sharpMatcherRegx = /#([^#]+)$/;
function scrollTo(href: string, offsetTop = 0, getContainer: () => AnchorContainer, callback = () => { }) {
const container = getContainer();
@@ -67,12 +66,12 @@ function scrollTo(href: string, offsetTop = 0, getContainer: () => AnchorContain
(container as HTMLElement).scrollTop = nextScrollTop;
}
if (time < 450) {
reqAnimFrame(frameFunc);
raf(frameFunc);
} else {
callback();
}
};
reqAnimFrame(frameFunc);
raf(frameFunc);
history.pushState(null, '', href);
}

View File

@@ -27,6 +27,14 @@ export default class AnchorLink extends React.Component<AnchorLinkProps, any> {
this.context.antAnchor.registerLink(this.props.href);
}
componentWillReceiveProps(nextProps: AnchorLinkProps) {
const { href } = nextProps;
if (this.props.href !== href) {
this.context.antAnchor.unregisterLink(this.props.href);
this.context.antAnchor.registerLink(href);
}
}
componentWillUnmount() {
this.context.antAnchor.unregisterLink(this.props.href);
}

View File

@@ -28,7 +28,7 @@ describe('Anchor Render', () => {
expect(wrapper.instance().state.activeLink).toBe('http://www.example.com/#API');
});
it('Anchor render perfectly for complete href - scoll', () => {
it('Anchor render perfectly for complete href - scroll', () => {
let root = document.getElementById('root');
if (!root) {
root = document.createElement('div', { id: 'root' });
@@ -45,7 +45,8 @@ describe('Anchor Render', () => {
expect(wrapper.instance().state.activeLink).toBe('http://www.example.com/#API');
});
it('Anchor render perfectly for complete href - scollTo', () => {
it('Anchor render perfectly for complete href - scrollTo', async () => {
const scrollToSpy = jest.spyOn(window, 'scrollTo');
let root = document.getElementById('root');
if (!root) {
root = document.createElement('div', { id: 'root' });
@@ -60,5 +61,49 @@ describe('Anchor Render', () => {
);
wrapper.instance().handleScrollTo('##API');
expect(wrapper.instance().state.activeLink).toBe('##API');
expect(scrollToSpy).not.toHaveBeenCalled();
await new Promise(resolve => setTimeout(resolve, 50));
expect(scrollToSpy).toHaveBeenCalled();
expect(wrapper.instance().animating).toBe(true);
await new Promise(resolve => setTimeout(resolve, 500));
expect(wrapper.instance().animating).toBe(false);
});
it('should remove listener when unmount', async () => {
const wrapper = mount(
<Anchor>
<Link href="#API" title="API" />
</Anchor>
);
const removeListenerSpy = jest.spyOn(wrapper.instance().scrollEvent, 'remove');
wrapper.unmount();
expect(removeListenerSpy).toHaveBeenCalled();
});
it('should unregister link when unmount children', async () => {
const wrapper = mount(
<Anchor>
<Link href="#API" title="API" />
</Anchor>
);
expect(wrapper.instance().links).toEqual(['#API']);
wrapper.setProps({ children: null });
expect(wrapper.instance().links).toEqual([]);
});
it('should update links when link href update', async () => {
let anchorInstance = null;
function AnchorUpdate({ href }) {
return (
<Anchor ref={c => anchorInstance = c}>
<Link href={href} title="API" />
</Anchor>
);
}
const wrapper = mount(<AnchorUpdate href="#API" />);
expect(anchorInstance.links).toEqual(['#API']);
wrapper.setProps({ href: '#API_1' });
expect(anchorInstance.links).toEqual(['#API_1']);
});
});

View File

@@ -15,6 +15,7 @@ The simplest usage.
```jsx
import { Anchor } from 'antd';
const { Link } = Anchor;
ReactDOM.render(
@@ -25,8 +26,8 @@ ReactDOM.render(
<Link href="#Anchor-Props" title="Anchor Props" />
<Link href="#Link-Props" title="Link Props" />
</Link>
</Anchor>
, mountNode);
</Anchor>,
mountNode);
```
<style>

View File

@@ -15,6 +15,7 @@ Do not change state when page is scrolling.
```jsx
import { Anchor } from 'antd';
const { Link } = Anchor;
ReactDOM.render(
@@ -25,6 +26,6 @@ ReactDOM.render(
<Link href="#Anchor-Props" title="Anchor Props" />
<Link href="#Link-Props" title="Link Props" />
</Link>
</Anchor>
, mountNode);
</Anchor>,
mountNode);
```

View File

@@ -19,7 +19,7 @@ For displaying anchor hyperlinks on page and jumping between them.
| -------- | ----------- | ---- | ------- |
| affix | Fixed mode of Anchor | boolean | true |
| bounds | Bounding distance of anchor area | number | 5(px) |
| getContainer | Scrolling container | () => HTMLElement | () => window |
| 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 |

View File

@@ -19,7 +19,7 @@ exports[`renders ./components/auto-complete/demo/basic.md correctly 1`] = `
<div
class="ant-select-selection__placeholder"
style="display:block;user-select:none;-webkit-user-select:none"
unselectable="unselectable"
unselectable="on"
>
input here
</div>
@@ -47,7 +47,7 @@ exports[`renders ./components/auto-complete/demo/basic.md correctly 1`] = `
<span
class="ant-select-arrow"
style="user-select:none;-webkit-user-select:none"
unselectable="unselectable"
unselectable="on"
>
<b />
</span>
@@ -78,7 +78,7 @@ exports[`renders ./components/auto-complete/demo/certain-category.md correctly 1
<div
class="ant-select-selection__placeholder"
style="display:block;user-select:none;-webkit-user-select:none"
unselectable="unselectable"
unselectable="on"
>
input here
</div>
@@ -117,7 +117,7 @@ exports[`renders ./components/auto-complete/demo/certain-category.md correctly 1
<span
class="ant-select-arrow"
style="user-select:none;-webkit-user-select:none"
unselectable="unselectable"
unselectable="on"
>
<b />
</span>
@@ -166,7 +166,7 @@ exports[`renders ./components/auto-complete/demo/custom.md correctly 1`] = `
<span
class="ant-select-arrow"
style="user-select:none;-webkit-user-select:none"
unselectable="unselectable"
unselectable="on"
>
<b />
</span>
@@ -193,7 +193,7 @@ exports[`renders ./components/auto-complete/demo/non-case-sensitive.md correctly
<div
class="ant-select-selection__placeholder"
style="display:block;user-select:none;-webkit-user-select:none"
unselectable="unselectable"
unselectable="on"
>
try to type \`b\`
</div>
@@ -221,7 +221,7 @@ exports[`renders ./components/auto-complete/demo/non-case-sensitive.md correctly
<span
class="ant-select-arrow"
style="user-select:none;-webkit-user-select:none"
unselectable="unselectable"
unselectable="on"
>
<b />
</span>
@@ -248,7 +248,7 @@ exports[`renders ./components/auto-complete/demo/options.md correctly 1`] = `
<div
class="ant-select-selection__placeholder"
style="display:block;user-select:none;-webkit-user-select:none"
unselectable="unselectable"
unselectable="on"
>
input here
</div>
@@ -276,7 +276,7 @@ exports[`renders ./components/auto-complete/demo/options.md correctly 1`] = `
<span
class="ant-select-arrow"
style="user-select:none;-webkit-user-select:none"
unselectable="unselectable"
unselectable="on"
>
<b />
</span>
@@ -307,7 +307,7 @@ exports[`renders ./components/auto-complete/demo/uncertain-category.md correctly
<div
class="ant-select-selection__placeholder"
style="display:block;user-select:none;-webkit-user-select:none"
unselectable="unselectable"
unselectable="on"
>
input here
</div>
@@ -351,7 +351,7 @@ exports[`renders ./components/auto-complete/demo/uncertain-category.md correctly
<span
class="ant-select-arrow"
style="user-select:none;-webkit-user-select:none"
unselectable="unselectable"
unselectable="on"
>
<b />
</span>

View File

@@ -16,6 +16,7 @@ Basic Usage, set datasource of autocomplete with `dataSource` property.
````jsx
import { Icon, Input, AutoComplete } from 'antd';
const Option = AutoComplete.Option;
const OptGroup = AutoComplete.OptGroup;

View File

@@ -15,6 +15,7 @@ Customize Input Component
````jsx
import { AutoComplete, Input } from 'antd';
const { TextArea } = Input;
function onSelect(value) {

View File

@@ -16,6 +16,7 @@ Basic Usage, set datasource of autocomplete with `dataSource` property.
````jsx
import { Icon, Button, Input, AutoComplete } from 'antd';
const Option = AutoComplete.Option;
function onSelect(value) {

View File

@@ -33,7 +33,9 @@ const dataSource = ['12345', '23456', '34567'];
| 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) | - |

View File

@@ -6,7 +6,11 @@ import Input from '../input';
import InputElement from './InputElement';
export interface DataSourceItemObject { value: string; text: string; }
export type DataSourceItemType = string | DataSourceItemObject;
export type DataSourceItemType =
string |
DataSourceItemObject |
React.ReactElement<OptionProps> |
React.ReactElement<OptGroupProps>;
export interface AutoCompleteInputProps {
onChange?: React.FormEventHandler<any>;
@@ -22,6 +26,7 @@ export interface AutoCompleteProps extends AbstractSelectProps {
value?: SelectValue;
defaultValue?: SelectValue;
dataSource?: DataSourceItemType[];
backfill?: boolean;
optionLabelProp?: string;
onChange?: (value: SelectValue) => void;
onSelect?: (value: SelectValue, option: Object) => any;
@@ -116,7 +121,7 @@ export default class AutoComplete extends React.Component<AutoCompleteProps, {}>
<Select
{...this.props}
className={cls}
mode="combobox"
mode={Select.SECRET_COMBOBOX_MODE_DO_NOT_USE}
optionLabelProp={optionLabelProp}
getInputElement={this.getInputElement}
notFoundContent={notFoundContent}

View File

@@ -34,7 +34,9 @@ const dataSource = ['12345', '23456', '34567'];
| 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) | 无 |

View File

@@ -24,6 +24,6 @@ ReactDOM.render(
<span>
<Badge dot><Avatar shape="square" icon="user" /></Badge>
</span>
</div>
, mountNode);
</div>,
mountNode);
````

View File

@@ -28,8 +28,8 @@ ReactDOM.render(
<Avatar shape="square" icon="user" />
<Avatar shape="square" size="small" icon="user" />
</div>
</div>
, mountNode);
</div>,
mountNode);
````
<style>

View File

@@ -27,6 +27,7 @@ class Autoset extends React.Component {
color: colorList[0],
};
}
changeUser = () => {
const index = UserList.indexOf(this.state.user);
this.setState({
@@ -34,6 +35,7 @@ class Autoset extends React.Component {
color: index < colorList.length - 1 ? colorList[index + 1] : colorList[0],
});
}
render() {
return (
<div>
@@ -48,6 +50,6 @@ class Autoset extends React.Component {
}
}
ReactDOM.render(<Autoset />
, mountNode);
ReactDOM.render(<Autoset />,
mountNode);
````

View File

@@ -24,8 +24,8 @@ ReactDOM.render(
<Avatar src="https://zos.alipayobjects.com/rmsportal/ODTLcjxAfvqbxHnVXCYX.png" />
<Avatar style={{ color: '#f56a00', backgroundColor: '#fde3cf' }}>U</Avatar>
<Avatar style={{ backgroundColor: '#87d068' }} icon="user" />
</div>
, mountNode);
</div>,
mountNode);
````
<style>

View File

@@ -14,3 +14,4 @@ Avatars can be used to represent people or objects. It supports images, `Icon`s,
| shape | the shape of avatar | `circle` \| `square` | `circle` |
| size | the size of the avatar | `large` \| `small` \| `default` | `default` |
| src | the address of the image for an image avatar | string | - |
| alt | This attribute defines the alternative text describing the image | string | - |

View File

@@ -16,6 +16,7 @@ export interface AvatarProps {
prefixCls?: string;
className?: string;
children?: any;
alt?: string;
}
export interface AvatarState {
@@ -75,7 +76,7 @@ export default class Avatar extends React.Component<AvatarProps, AvatarState> {
render() {
const {
prefixCls, shape, size, src, icon, className, ...others,
prefixCls, shape, size, src, icon, className, alt, ...others
} = this.props;
const sizeCls = classNames({
@@ -95,6 +96,7 @@ export default class Avatar extends React.Component<AvatarProps, AvatarState> {
<img
src={src}
onError={this.handleImgLoadError}
alt={alt}
/>
);
} else if (icon) {

View File

@@ -15,3 +15,4 @@ title: Avatar
| shape | 指定头像的形状 | Enum{ 'circle', 'square' } | `circle` |
| size | 设置头像的大小 | Enum{ 'large', 'small', 'default' } | `default` |
| src | 图片类头像的资源地址 | string | - |
| alt | 图像无法显示时的替代文本 | string | - |

View File

@@ -43,7 +43,7 @@
width: @size;
height: @size;
line-height: @size;
border-radius: @size / 2;
border-radius: 50%;
& > * {
line-height: @size;

View File

@@ -4,9 +4,7 @@ import addEventListener from 'rc-util/lib/Dom/addEventListener';
import classNames from 'classnames';
import omit from 'omit.js';
import getScroll from '../_util/getScroll';
import getRequestAnimationFrame from '../_util/getRequestAnimationFrame';
const reqAnimFrame = getRequestAnimationFrame();
import raf from 'raf';
const easeInOutCubic = (t: number, b: number, c: number, d: number) => {
const cc = c - b;
@@ -64,10 +62,10 @@ export default class BackTop extends React.Component<BackTopProps, any> {
const time = timestamp - startTime;
this.setScrollTop(easeInOutCubic(time, scrollTop, 0, 450));
if (time < 450) {
reqAnimFrame(frameFunc);
raf(frameFunc);
}
};
reqAnimFrame(frameFunc);
raf(frameFunc);
(this.props.onClick || noop)(e);
}

View File

@@ -3,7 +3,7 @@ import { createElement, Component } from 'react';
import omit from 'omit.js';
import classNames from 'classnames';
function getNumberArray(num: string | number | undefined) {
function getNumberArray(num: string | number | undefined | null) {
return num ?
num.toString()
.split('')
@@ -14,16 +14,16 @@ function getNumberArray(num: string | number | undefined) {
export interface ScrollNumberProps {
prefixCls?: string;
className?: string;
count?: string | number;
count?: string | number | null;
component?: string;
onAnimated?: Function;
style?: React.CSSProperties;
title?: string | number;
title?: string | number | null;
}
export interface ScrollNumberState {
animateStarted?: boolean;
count?: string | number;
count?: string | number | null;
}
export default class ScrollNumber extends Component<ScrollNumberProps, ScrollNumberState> {

View File

@@ -1617,3 +1617,177 @@ exports[`renders ./components/badge/demo/status.md correctly 1`] = `
</span>
</div>
`;
exports[`renders ./components/badge/demo/title.md correctly 1`] = `
<div>
<span
class="ant-badge"
>
<a
class="head-example"
href="#"
/>
<sup
class="ant-scroll-number ant-badge-count"
data-show="true"
title="Custom hover text"
>
<span
class="ant-scroll-number-only"
style="transition:none;-ms-transform:translateY(-1500%);-webkit-transform:translateY(-1500%);transform:translateY(-1500%)"
>
<p
class=""
>
0
</p>
<p
class=""
>
1
</p>
<p
class=""
>
2
</p>
<p
class=""
>
3
</p>
<p
class=""
>
4
</p>
<p
class=""
>
5
</p>
<p
class=""
>
6
</p>
<p
class=""
>
7
</p>
<p
class=""
>
8
</p>
<p
class=""
>
9
</p>
<p
class=""
>
0
</p>
<p
class=""
>
1
</p>
<p
class=""
>
2
</p>
<p
class=""
>
3
</p>
<p
class=""
>
4
</p>
<p
class="current"
>
5
</p>
<p
class=""
>
6
</p>
<p
class=""
>
7
</p>
<p
class=""
>
8
</p>
<p
class=""
>
9
</p>
<p
class=""
>
0
</p>
<p
class=""
>
1
</p>
<p
class=""
>
2
</p>
<p
class=""
>
3
</p>
<p
class=""
>
4
</p>
<p
class=""
>
5
</p>
<p
class=""
>
6
</p>
<p
class=""
>
7
</p>
<p
class=""
>
8
</p>
<p
class=""
>
9
</p>
</span>
</sup>
</span>
</div>
`;

File diff suppressed because it is too large Load Diff

View File

@@ -1,14 +1,65 @@
import React from 'react';
import { mount } from 'enzyme';
import { mount, render } from 'enzyme';
import Badge from '../index';
import Tooltip from '../../tooltip';
describe('Badge', () => {
test('badge dot not scaling count > 9', () => {
beforeEach(() => {
jest.useFakeTimers();
});
afterEach(() => {
jest.useRealTimers();
});
it('badge dot not scaling count > 9', () => {
const badge = mount(<Badge count={10} dot />);
expect(badge.find('.ant-card-multiple-words').length).toBe(0);
});
test('badge dot not showing count == 0', () => {
it('badge dot not showing count == 0', () => {
const badge = mount(<Badge count={0} dot />);
expect(badge.find('.ant-badge-dot').length).toBe(0);
});
it('should have an overriden title attribute', () => {
const badge = mount(<Badge count={10} title="Custom title" />);
expect(badge.find('.ant-scroll-number').getDOMNode().attributes.getNamedItem('title').value).toEqual('Custom title');
});
// https://github.com/ant-design/ant-design/issues/10626
it('should be composable with Tooltip', () => {
const wrapper = mount(
<Tooltip title="Fix the error">
<Badge status="error" />
</Tooltip>
);
wrapper.find('Badge').simulate('mouseenter');
jest.runAllTimers();
expect(wrapper.instance().tooltip.props.visible).toBe(true);
});
it('should render when count is changed', () => {
const wrapper = mount(<Badge count={9} />);
wrapper.setProps({ count: 10 });
jest.runAllTimers();
expect(wrapper).toMatchSnapshot();
wrapper.setProps({ count: 11 });
jest.runAllTimers();
expect(wrapper).toMatchSnapshot();
wrapper.setProps({ count: 11 });
jest.runAllTimers();
expect(wrapper).toMatchSnapshot();
wrapper.setProps({ count: 10 });
jest.runAllTimers();
expect(wrapper).toMatchSnapshot();
jest.runAllTimers();
wrapper.setProps({ count: 9 });
expect(wrapper).toMatchSnapshot();
});
it('should be compatible with borderColor style', () => {
const wrapper = render(<Badge count={4} style={{ backgroundColor: '#fff', color: '#999', borderColor: '#d9d9d9' }} />);
expect(wrapper).toMatchSnapshot();
});
});

View File

@@ -24,8 +24,8 @@ ReactDOM.render(
<Badge count={0} showZero>
<a href="#" className="head-example" />
</Badge>
</div>
, mountNode);
</div>,
mountNode);
````
<style>

View File

@@ -15,6 +15,7 @@ The count will be animated as it changes.
````jsx
import { Badge, Button, Icon, Switch } from 'antd';
const ButtonGroup = Button.Group;
class Demo extends React.Component {

View File

@@ -28,8 +28,8 @@ ReactDOM.render(
<Badge dot>
<a href="#">Link something</a>
</Badge>
</div>
, mountNode);
</div>,
mountNode);
````
<style>

View File

@@ -21,6 +21,6 @@ ReactDOM.render(
<Badge count={5}>
<span className="head-example" />
</Badge>
</a>
, mountNode);
</a>,
mountNode);
````

View File

@@ -23,6 +23,6 @@ ReactDOM.render(
<Badge count={25} />
<Badge count={4} style={{ backgroundColor: '#fff', color: '#999', boxShadow: '0 0 0 1px #d9d9d9 inset' }} />
<Badge count={109} style={{ backgroundColor: '#52c41a' }} />
</div>
, mountNode);
</div>,
mountNode);
````

View File

@@ -30,6 +30,6 @@ ReactDOM.render(
<Badge count={1000} overflowCount={999}>
<a href="#" className="head-example" />
</Badge>
</div>
, mountNode);
</div>,
mountNode);
````

View File

@@ -33,6 +33,6 @@ ReactDOM.render(
<Badge status="processing" text="Processing" />
<br />
<Badge status="warning" text="Warning" />
</div>
, mountNode);
</div>,
mountNode);
````

View File

@@ -0,0 +1,39 @@
---
order: 7
title:
zh-CN: 自定义标题
en-US: Title
---
## zh-CN
设置鼠标放在状态点上时显示的文字
## en-US
The badge will display `title` when hovered over, instead of `count`.
````jsx
import { Badge } from 'antd';
ReactDOM.render(
<div>
<Badge count={5} title="Custom hover text">
<a href="#" className="head-example" />
</Badge>
</div>,
mountNode);
````
<style>
.ant-badge:not(.ant-badge-status) {
margin-right: 20px;
}
.head-example {
width: 42px;
height: 42px;
border-radius: 4px;
background: #eee;
display: inline-block;
}
</style>

View File

@@ -31,3 +31,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` |

View File

@@ -8,7 +8,7 @@ export { ScrollNumberProps } from './ScrollNumber';
export interface BadgeProps {
/** Number to show in badge */
count?: number | string;
count?: number | string | null;
showZero?: boolean;
/** Max count to show */
overflowCount?: number;
@@ -21,6 +21,7 @@ export interface BadgeProps {
status?: 'success' | 'processing' | 'default' | 'error' | 'warning';
text?: string;
offset?: [number | string, number | string];
title?: string;
}
export default class Badge extends React.Component<BadgeProps, any> {
@@ -57,7 +58,8 @@ export default class Badge extends React.Component<BadgeProps, any> {
status,
text,
offset,
...restProps,
title,
...restProps
} = this.props;
let displayCount = (count as number) > (overflowCount as number) ? `${overflowCount}+` : count;
const isZero = displayCount === '0' || displayCount === 0;
@@ -90,7 +92,7 @@ export default class Badge extends React.Component<BadgeProps, any> {
// <Badge status="success" />
if (!children && status) {
return (
<span className={badgeCls} style={styleWithOffset}>
<span {...restProps} className={badgeCls} style={styleWithOffset}>
<span className={statusCls} />
<span className={`${prefixCls}-status-text`}>{text}</span>
</span>
@@ -103,8 +105,9 @@ export default class Badge extends React.Component<BadgeProps, any> {
data-show={!hidden}
className={scrollNumberCls}
count={displayCount}
title={count}
title={title || count}
style={styleWithOffset}
key="scrollNumber"
/>
);

View File

@@ -25,10 +25,11 @@ title: Badge
| 参数 | 说明 | 类型 | 默认值 |
| --- | --- | --- | --- |
| count | 展示的数字,大于 overflowCount 时显示为 `${overflowCount}+`,为 0 时隐藏 | number\|ReactNode | |
| count | 展示的数字,大于 overflowCount 时显示为 `${overflowCount}+`,为 0 时隐藏 | number\|ReactNode | |
| dot | 不展示数字,只有一个小红点 | boolean | false |
| offset | 设置状态点的位置偏移,格式为 `[x, y]` | `[number, number]` | - |
| overflowCount | 展示封顶的数字值 | number | 99 |
| showZero | 当数值为 0 时,是否展示 Badge | boolean | false |
| status | 设置 Badge 为状态点 | Enum{ 'success', 'processing, 'default', 'error', 'warning' } | '' |
| text | 在设置了 `status` 的前提下有效,设置状态点的文本 | string | '' |
| title | 设置鼠标放在状态点上时显示的文字 | string | `count` |

View File

@@ -41,7 +41,7 @@ function defaultItemRender(route: Route, params: any, routes: Route[], paths: st
}
export default class Breadcrumb extends React.Component<BreadcrumbProps, any> {
static Item: any;
static Item: typeof BreadcrumbItem;
static defaultProps = {
prefixCls: 'ant-breadcrumb',

View File

@@ -0,0 +1,170 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`react router react router 3 1`] = `
<Breadcrumb
params={
Object {
"id": 1,
}
}
prefixCls="ant-breadcrumb"
routes={
Array [
Object {
"breadcrumbName": "Home",
"childRoutes": Array [
Object {
"breadcrumbName": "Application List",
"childRoutes": Array [
Object {
"breadcrumbName": "Application:id",
"childRoutes": Array [
Object {
"breadcrumbName": "Detail",
"name": "detail",
"path": "detail",
},
],
"name": "app",
"path": ":id",
},
],
"name": "apps",
"path": "apps",
},
],
"name": "home",
"path": "/",
},
Object {
"breadcrumbName": "Application List",
"childRoutes": Array [
Object {
"breadcrumbName": "Application:id",
"childRoutes": Array [
Object {
"breadcrumbName": "Detail",
"name": "detail",
"path": "detail",
},
],
"name": "app",
"path": ":id",
},
],
"name": "apps",
"path": "apps",
},
Object {
"breadcrumbName": "Application:id",
"childRoutes": Array [
Object {
"breadcrumbName": "Detail",
"name": "detail",
"path": "detail",
},
],
"name": "app",
"path": ":id",
},
Object {
"breadcrumbName": "Detail",
"name": "detail",
"path": "detail",
},
]
}
separator="/"
>
<div
className="ant-breadcrumb"
>
<BreadcrumbItem
key="Home"
prefixCls="ant-breadcrumb"
separator="/"
>
<span>
<span
className="ant-breadcrumb-link"
>
<a
href="#/"
>
Home
</a>
</span>
<span
className="ant-breadcrumb-separator"
>
/
</span>
</span>
</BreadcrumbItem>
<BreadcrumbItem
key="Application List"
prefixCls="ant-breadcrumb"
separator="/"
>
<span>
<span
className="ant-breadcrumb-link"
>
<a
href="#/apps"
>
Application List
</a>
</span>
<span
className="ant-breadcrumb-separator"
>
/
</span>
</span>
</BreadcrumbItem>
<BreadcrumbItem
key="Application:id"
prefixCls="ant-breadcrumb"
separator="/"
>
<span>
<span
className="ant-breadcrumb-link"
>
<a
href="#/apps/1"
>
Application1
</a>
</span>
<span
className="ant-breadcrumb-separator"
>
/
</span>
</span>
</BreadcrumbItem>
<BreadcrumbItem
key="Detail"
prefixCls="ant-breadcrumb"
separator="/"
>
<span>
<span
className="ant-breadcrumb-link"
>
<span>
Detail
</span>
</span>
<span
className="ant-breadcrumb-separator"
>
/
</span>
</span>
</BreadcrumbItem>
</div>
</Breadcrumb>
`;

View File

@@ -0,0 +1,150 @@
import React from 'react';
import { Route, Switch, Link, withRouter, MemoryRouter } from 'react-router-dom';
import { mount } from 'enzyme';
import Breadcrumb from '../index';
const Apps = () => (
<ul className="app-list">
<li>
<Link to="/apps/1">Application1</Link><Link to="/apps/1/detail">Detail</Link>
</li>
<li>
<Link to="/apps/2">Application2</Link><Link to="/apps/2/detail">Detail</Link>
</li>
</ul>
);
const breadcrumbNameMap = {
'/apps': 'Application List',
'/apps/1': 'Application1',
'/apps/2': 'Application2',
'/apps/1/detail': 'Detail',
'/apps/2/detail': 'Detail',
};
const Home = withRouter((props) => {
const { location, history } = props;
const pathSnippets = location.pathname.split('/').filter(i => i);
const extraBreadcrumbItems = pathSnippets.map((_, index) => {
const url = `/${pathSnippets.slice(0, index + 1).join('/')}`;
return (
<Breadcrumb.Item key={url}>
<Link to={url}>
{breadcrumbNameMap[url]}
</Link>
</Breadcrumb.Item>
);
});
const breadcrumbItems = [(
<Breadcrumb.Item key="home">
<Link to="/">Home</Link>
</Breadcrumb.Item>
)].concat(extraBreadcrumbItems);
return (
<div className="demo">
<div className="demo-nav">
<a onClick={() => history.push('/')}>Home</a>
<a onClick={() => history.push('/apps')}>Application List</a>
</div>
<Switch>
<Route path="/apps" component={Apps} />
<Route render={() => <span>Home Page</span>} />
</Switch>
<Breadcrumb>
{breadcrumbItems}
</Breadcrumb>
</div>
);
});
describe('react router', () => {
beforeAll(() => {
jest.useFakeTimers();
});
afterAll(() => {
jest.useRealTimers();
});
// https://github.com/airbnb/enzyme/issues/875
it('react router 4', () => {
const wrapper = mount(
<MemoryRouter initialEntries={['/']} initialIndex={0}>
<Home />
</MemoryRouter>
);
expect(wrapper.find('BreadcrumbItem').length).toBe(1);
expect(wrapper.find('BreadcrumbItem .ant-breadcrumb-link').at(0).text()).toBe('Home');
wrapper.find('.demo-nav a').at(1).simulate('click');
expect(wrapper.find('BreadcrumbItem').length).toBe(2);
expect(wrapper.find('BreadcrumbItem .ant-breadcrumb-link').at(1).text()).toBe('Application List');
});
it('react router 3', () => {
const routes = [{
name: 'home',
breadcrumbName: 'Home',
path: '/',
childRoutes: [
{
name: 'apps',
breadcrumbName: 'Application List',
path: 'apps',
childRoutes: [
{
name: 'app',
breadcrumbName: 'Application:id',
path: ':id',
childRoutes: [
{
name: 'detail',
breadcrumbName: 'Detail',
path: 'detail',
},
],
},
],
},
],
},
{
name: 'apps',
breadcrumbName: 'Application List',
path: 'apps',
childRoutes: [
{
name: 'app',
breadcrumbName: 'Application:id',
path: ':id',
childRoutes: [
{
name: 'detail',
breadcrumbName: 'Detail',
path: 'detail',
},
],
},
],
},
{
name: 'app',
breadcrumbName: 'Application:id',
path: ':id',
childRoutes: [
{
name: 'detail',
breadcrumbName: 'Detail',
path: 'detail',
},
],
},
{
name: 'detail',
breadcrumbName: 'Detail',
path: 'detail',
}];
const wrapper = mount(
<Breadcrumb routes={routes} params={{ id: 1 }} />
);
expect(wrapper).toMatchSnapshot();
});
});

View File

@@ -22,6 +22,6 @@ ReactDOM.render(
<Breadcrumb.Item><a href="">Application Center</a></Breadcrumb.Item>
<Breadcrumb.Item><a href="">Application List</a></Breadcrumb.Item>
<Breadcrumb.Item>An Application</Breadcrumb.Item>
</Breadcrumb>
, mountNode);
</Breadcrumb>,
mountNode);
````

View File

@@ -76,8 +76,8 @@ const Home = withRouter((props) => {
ReactDOM.render(
<Router>
<Home />
</Router>
, mountNode);
</Router>,
mountNode);
````
````css

View File

@@ -51,8 +51,8 @@ ReactDOM.render(
</Route>
</Route>
</Route>
</Router>
, mountNode);
</Router>,
mountNode);
````
````css

View File

@@ -22,6 +22,6 @@ ReactDOM.render(
<Breadcrumb.Item href="">Application Center</Breadcrumb.Item>
<Breadcrumb.Item href="">Application List</Breadcrumb.Item>
<Breadcrumb.Item>An Application</Breadcrumb.Item>
</Breadcrumb>
, mountNode);
</Breadcrumb>,
mountNode);
````

View File

@@ -28,6 +28,6 @@ ReactDOM.render(
<Breadcrumb.Item>
Application
</Breadcrumb.Item>
</Breadcrumb>
, mountNode);
</Breadcrumb>,
mountNode);
````

View File

@@ -211,24 +211,6 @@ exports[`renders ./components/button/demo/disabled.md correctly 1`] = `
</span>
</button>
<br />
<button
class="ant-btn ant-btn-background-ghost"
type="button"
>
<span>
Ghost
</span>
</button>
<button
class="ant-btn ant-btn-background-ghost"
disabled=""
type="button"
>
<span>
Ghost(disabled)
</span>
</button>
<br />
<button
class="ant-btn ant-btn-dashed"
type="button"
@@ -246,6 +228,27 @@ exports[`renders ./components/button/demo/disabled.md correctly 1`] = `
Dashed(disabled)
</span>
</button>
<div
style="padding:8px 8px 0 8px;background:rgb(190, 200, 200)"
>
<button
class="ant-btn ant-btn-background-ghost"
type="button"
>
<span>
Ghost
</span>
</button>
<button
class="ant-btn ant-btn-background-ghost"
disabled=""
type="button"
>
<span>
Ghost(disabled)
</span>
</button>
</div>
</div>
`;
@@ -469,7 +472,7 @@ exports[`renders ./components/button/demo/multiple.md correctly 1`] = `
exports[`renders ./components/button/demo/size.md correctly 1`] = `
<div>
<div
class="ant-radio-group"
class="ant-radio-group ant-radio-group-outline"
>
<label
class="ant-radio-button-wrapper ant-radio-button-wrapper-checked"

View File

@@ -66,6 +66,48 @@ exports[`Button renders Chinese characters correctly 3`] = `
</button>
`;
exports[`Button renders Chinese characters correctly 4`] = `
<button
class="ant-btn"
type="button"
>
<i
class="anticon anticon-search"
/>
<span>
按钮
</span>
</button>
`;
exports[`Button renders Chinese characters correctly 5`] = `
<button
class="ant-btn ant-btn-loading"
type="button"
>
<i
class="anticon anticon-spin anticon-loading"
/>
<span>
按钮
</span>
</button>
`;
exports[`Button renders Chinese characters correctly 6`] = `
<button
class="ant-btn ant-btn-loading"
type="button"
>
<i
class="anticon anticon-spin anticon-loading"
/>
<span>
按 钮
</span>
</button>
`;
exports[`Button renders correctly 1`] = `
<button
class="ant-btn"

View File

@@ -26,10 +26,25 @@ describe('Button', () => {
<Button><Icon type="search" />按钮</Button>
);
expect(wrapper2).toMatchSnapshot();
// should not insert space when there is icon
const wrapper3 = render(
<Button icon="search">按钮</Button>
);
expect(wrapper3).toMatchSnapshot();
// should not insert space when there is icon while loading
const wrapper4 = render(
<Button icon="search" loading>按钮</Button>
);
expect(wrapper4).toMatchSnapshot();
// should insert space while loading
const wrapper5 = render(
<Button loading>按钮</Button>
);
expect(wrapper5).toMatchSnapshot();
});
it('renders Chinese characters correctly in HOC', () => {
const Text = props => <span>{props.children}</span>;
const Text = ({ children }) => <span>{children}</span>;
const wrapper = mount(
<Button><Text>按钮</Text></Button>
);
@@ -46,7 +61,7 @@ describe('Button', () => {
expect(wrapper.find('.ant-btn').hasClass('ant-btn-two-chinese-chars')).toBe(true);
});
it('have static perperty for type detecting', () => {
it('have static property for type detecting', () => {
const wrapper = mount(
<Button>Button Text</Button>
);
@@ -59,11 +74,14 @@ describe('Button', () => {
state = {
loading: false,
};
enterLoading = () => {
this.setState({ loading: true });
}
render() {
return <Button loading={this.state.loading} onClick={this.enterLoading}>Button</Button>;
const { loading } = this.state;
return <Button loading={loading} onClick={this.enterLoading}>Button</Button>;
}
}
const wrapper = mount(
@@ -79,11 +97,14 @@ describe('Button', () => {
state = {
loading: false,
};
enterLoading = () => {
this.setState({ loading: { delay: 1000 } });
}
render() {
return <Button loading={this.state.loading} onClick={this.enterLoading}>Button</Button>;
const { loading } = this.state;
return <Button loading={loading} onClick={this.enterLoading}>Button</Button>;
}
}
const wrapper = mount(

View File

@@ -2,7 +2,6 @@ import * as React from 'react';
import { findDOMNode } from 'react-dom';
import PropTypes from 'prop-types';
import classNames from 'classnames';
import omit from 'omit.js';
import Icon from '../icon';
import Group from './button-group';
@@ -37,30 +36,32 @@ function insertSpace(child: React.ReactChild, needInserted: boolean) {
export type ButtonType = 'default' | 'primary' | 'ghost' | 'dashed' | 'danger';
export type ButtonShape = 'circle' | 'circle-outline';
export type ButtonSize = 'small' | 'default' | 'large';
export type ButtonHTMLType = 'submit' | 'button' | 'reset';
export interface ButtonProps {
export interface BaseButtonProps {
type?: ButtonType;
htmlType?: string;
icon?: string;
shape?: ButtonShape;
size?: ButtonSize;
onClick?: React.FormEventHandler<any>;
onMouseUp?: React.FormEventHandler<any>;
onMouseDown?: React.FormEventHandler<any>;
onKeyPress?: React.KeyboardEventHandler<any>;
onKeyDown?: React.KeyboardEventHandler<any>;
tabIndex?: number;
loading?: boolean | { delay?: number };
disabled?: boolean;
style?: React.CSSProperties;
prefixCls?: string;
className?: string;
ghost?: boolean;
target?: string;
href?: string;
download?: string;
}
export type AnchorButtonProps = {
href: string;
target?: string;
onClick?: React.MouseEventHandler<HTMLAnchorElement>;
} & BaseButtonProps & React.AnchorHTMLAttributes<HTMLAnchorElement>;
export type NativeButtonProps = {
htmlType?: ButtonHTMLType;
onClick?: React.MouseEventHandler<HTMLButtonElement>;
} & BaseButtonProps & React.ButtonHTMLAttributes<HTMLButtonElement>;
export type ButtonProps = AnchorButtonProps | NativeButtonProps;
export default class Button extends React.Component<ButtonProps, any> {
static Group: typeof Group;
static __ANT_BUTTON = true;
@@ -143,7 +144,7 @@ export default class Button extends React.Component<ButtonProps, any> {
}
}
handleClick = (e: React.MouseEvent<HTMLButtonElement>) => {
handleClick: React.MouseEventHandler<HTMLButtonElement | HTMLAnchorElement> = e => {
// Add click effect
this.setState({ clicked: true });
clearTimeout(this.timeout);
@@ -151,19 +152,18 @@ export default class Button extends React.Component<ButtonProps, any> {
const onClick = this.props.onClick;
if (onClick) {
onClick(e);
(onClick as React.MouseEventHandler<HTMLButtonElement | HTMLAnchorElement>)(e);
}
}
isNeedInserted() {
const { loading, icon, children } = this.props;
const iconType = loading ? 'loading' : icon;
return React.Children.count(children) === 1 && (!iconType || iconType === 'loading');
const { icon, children } = this.props;
return React.Children.count(children) === 1 && !icon;
}
render() {
const {
type, shape, size, className, htmlType, children, icon, prefixCls, ghost, ...others,
type, shape, size, className, children, icon, prefixCls, ghost, loading: _loadingProp, ...rest
} = this.props;
const { loading, clicked, hasTwoCNChar } = this.state;
@@ -181,8 +181,6 @@ export default class Button extends React.Component<ButtonProps, any> {
break;
}
const ComponentProp = others.href ? 'a' : 'button';
const classes = classNames(prefixCls, className, {
[`${prefixCls}-${type}`]: type,
[`${prefixCls}-${shape}`]: shape,
@@ -199,15 +197,30 @@ export default class Button extends React.Component<ButtonProps, any> {
const kids = (children || children === 0)
? React.Children.map(children, child => insertSpace(child, this.isNeedInserted())) : null;
return (
<ComponentProp
{...omit(others, ['loading'])}
type={others.href ? undefined : (htmlType || 'button')}
className={classes}
onClick={this.handleClick}
>
{iconNode}{kids}
</ComponentProp>
);
if ('href' in rest) {
return (
<a
{...rest}
className={classes}
onClick={this.handleClick}
>
{iconNode}{kids}
</a>
);
} else {
// React does not recognize the `htmlType` prop on a DOM element. Here we pick it out of `rest`.
const { htmlType, ...otherProps } = rest;
return (
<button
{...otherProps}
type={htmlType || 'button'}
className={classes}
onClick={this.handleClick}
>
{iconNode}{kids}
</button>
);
}
}
}

View File

@@ -26,6 +26,6 @@ ReactDOM.render(
<Button>Default</Button>
<Button type="dashed">Dashed</Button>
<Button type="danger">Danger</Button>
</div>
, mountNode);
</div>,
mountNode);
````

View File

@@ -19,6 +19,7 @@ The `size` can be set to `large`, `small` or left unset resulting in a default s
````jsx
import { Button, Icon } from 'antd';
const ButtonGroup = Button.Group;
ReactDOM.render(

View File

@@ -24,11 +24,12 @@ ReactDOM.render(
<Button>Default</Button>
<Button disabled>Default(disabled)</Button>
<br />
<Button ghost>Ghost</Button>
<Button ghost disabled>Ghost(disabled)</Button>
<br />
<Button type="dashed">Dashed</Button>
<Button type="dashed" disabled>Dashed(disabled)</Button>
<div style={{ padding: '8px 8px 0 8px', background: 'rgb(190, 200, 200)' }}>
<Button ghost>Ghost</Button>
<Button ghost disabled>Ghost(disabled)</Button>
</div>
</div>,
mountNode
);

View File

@@ -22,6 +22,6 @@ ReactDOM.render(
<Button ghost>Default</Button>
<Button type="dashed" ghost>Dashed</Button>
<Button type="danger" ghost>danger</Button>
</div>
, mountNode);
</div>,
mountNode);
````

View File

@@ -16,6 +16,7 @@ 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` |

View File

@@ -19,6 +19,7 @@ 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` |

View File

@@ -4,7 +4,7 @@
@btn-prefix-cls: ~"@{ant-prefix}-btn";
// for compatibile
// for compatible
@btn-ghost-color: @text-color;
@btn-ghost-bg: transparent;
@btn-ghost-border: @border-color-base;

View File

@@ -109,7 +109,8 @@
.button-group-base(@btnClassName) {
position: relative;
display: inline-block;
> .@{btnClassName} {
> .@{btnClassName},
> span > .@{btnClassName} {
position: relative;
line-height: @btn-height-base - 2px;
@@ -126,13 +127,15 @@
}
// size
&-lg > .@{btnClassName} {
.button-size(@btn-height-lg; @btn-padding-lg; @btn-font-size-lg; @btn-border-radius-base);
&-lg > .@{btnClassName},
&-lg > span > .@{btnClassName} {
.button-size(@btn-height-lg; @btn-padding-lg; @btn-font-size-lg; 0);
line-height: @btn-height-lg - 2px;
}
&-sm > .@{btnClassName} {
.button-size(@btn-height-sm; @btn-padding-sm; @font-size-base; @btn-border-radius-sm);
&-sm > .@{btnClassName},
&-sm > span > .@{btnClassName} {
.button-size(@btn-height-sm; @btn-padding-sm; @font-size-base; 0);
line-height: @btn-height-sm - 2px;
> .@{iconfont-css-prefix} {
font-size: @font-size-base;
@@ -250,12 +253,17 @@
.@{btnClassName} + &,
span + .@{btnClassName},
.@{btnClassName} + span,
> span + span,
& + .@{btnClassName},
& + & {
margin-left: -1px;
}
.@{btnClassName}:not(:first-child):not(:last-child) {
.@{btnClassName}-primary + .@{btnClassName}:not(.@{btnClassName}-primary):not([disabled]) {
border-left-color: transparent;
}
.@{btnClassName} {
border-radius: 0;
}
@@ -263,17 +271,42 @@
> span:first-child > .@{btnClassName} {
margin-left: 0;
}
> .@{btnClassName}:only-child {
border-radius: @btn-border-radius-base;
}
> span:only-child > .@{btnClassName} {
border-radius: @btn-border-radius-base;
}
> .@{btnClassName}:first-child:not(:last-child),
> span:first-child:not(:last-child) > .@{btnClassName} {
border-bottom-right-radius: 0;
border-top-right-radius: 0;
border-bottom-left-radius: @btn-border-radius-base;
border-top-left-radius: @btn-border-radius-base;
}
> .@{btnClassName}:last-child:not(:first-child),
> span:last-child:not(:first-child) > .@{btnClassName} {
border-bottom-left-radius: 0;
border-top-left-radius: 0;
border-bottom-right-radius: @btn-border-radius-base;
border-top-right-radius: @btn-border-radius-base;
}
&-sm {
> .@{btnClassName}:only-child {
border-radius: @btn-border-radius-sm;
}
> span:only-child > .@{btnClassName} {
border-radius: @btn-border-radius-sm;
}
> .@{btnClassName}:first-child:not(:last-child),
> span:first-child:not(:last-child) > .@{btnClassName} {
border-bottom-left-radius: @btn-border-radius-sm;
border-top-left-radius: @btn-border-radius-sm;
}
> .@{btnClassName}:last-child:not(:first-child),
> span:last-child:not(:first-child) > .@{btnClassName} {
border-bottom-right-radius: @btn-border-radius-sm;
border-top-right-radius: @btn-border-radius-sm;
}
}
& > & {

View File

@@ -33,7 +33,7 @@ exports[`renders ./components/calendar/demo/basic.md correctly 1`] = `
<span
class="ant-select-arrow"
style="user-select:none;-webkit-user-select:none"
unselectable="unselectable"
unselectable="on"
>
<b />
</span>
@@ -65,14 +65,14 @@ exports[`renders ./components/calendar/demo/basic.md correctly 1`] = `
<span
class="ant-select-arrow"
style="user-select:none;-webkit-user-select:none"
unselectable="unselectable"
unselectable="on"
>
<b />
</span>
</div>
</div>
<div
class="ant-radio-group ant-radio-group-default"
class="ant-radio-group ant-radio-group-outline ant-radio-group-default"
>
<label
class="ant-radio-button-wrapper ant-radio-button-wrapper-checked"
@@ -236,7 +236,7 @@ exports[`renders ./components/calendar/demo/basic.md correctly 1`] = `
</div>
</td>
<td
class="ant-fullcalendar-cell ant-fullcalendar-last-month-cell"
class="ant-fullcalendar-cell ant-fullcalendar-last-month-cell ant-fullcalendar-last-day-of-month"
role="gridcell"
title="October 31, 2016"
>
@@ -796,7 +796,7 @@ exports[`renders ./components/calendar/demo/basic.md correctly 1`] = `
</div>
</td>
<td
class="ant-fullcalendar-cell"
class="ant-fullcalendar-cell ant-fullcalendar-last-day-of-month"
role="gridcell"
title="November 30, 2016"
>
@@ -1042,7 +1042,7 @@ exports[`renders ./components/calendar/demo/card.md correctly 1`] = `
<span
class="ant-select-arrow"
style="user-select:none;-webkit-user-select:none"
unselectable="unselectable"
unselectable="on"
>
<b />
</span>
@@ -1074,14 +1074,14 @@ exports[`renders ./components/calendar/demo/card.md correctly 1`] = `
<span
class="ant-select-arrow"
style="user-select:none;-webkit-user-select:none"
unselectable="unselectable"
unselectable="on"
>
<b />
</span>
</div>
</div>
<div
class="ant-radio-group ant-radio-group-small"
class="ant-radio-group ant-radio-group-outline ant-radio-group-small"
>
<label
class="ant-radio-button-wrapper ant-radio-button-wrapper-checked"
@@ -1245,7 +1245,7 @@ exports[`renders ./components/calendar/demo/card.md correctly 1`] = `
</div>
</td>
<td
class="ant-fullcalendar-cell ant-fullcalendar-last-month-cell"
class="ant-fullcalendar-cell ant-fullcalendar-last-month-cell ant-fullcalendar-last-day-of-month"
role="gridcell"
title="October 31, 2016"
>
@@ -1805,7 +1805,7 @@ exports[`renders ./components/calendar/demo/card.md correctly 1`] = `
</div>
</td>
<td
class="ant-fullcalendar-cell"
class="ant-fullcalendar-cell ant-fullcalendar-last-day-of-month"
role="gridcell"
title="November 30, 2016"
>
@@ -2049,7 +2049,7 @@ exports[`renders ./components/calendar/demo/notice-calendar.md correctly 1`] = `
<span
class="ant-select-arrow"
style="user-select:none;-webkit-user-select:none"
unselectable="unselectable"
unselectable="on"
>
<b />
</span>
@@ -2081,14 +2081,14 @@ exports[`renders ./components/calendar/demo/notice-calendar.md correctly 1`] = `
<span
class="ant-select-arrow"
style="user-select:none;-webkit-user-select:none"
unselectable="unselectable"
unselectable="on"
>
<b />
</span>
</div>
</div>
<div
class="ant-radio-group ant-radio-group-default"
class="ant-radio-group ant-radio-group-outline ant-radio-group-default"
>
<label
class="ant-radio-button-wrapper ant-radio-button-wrapper-checked"
@@ -2256,7 +2256,7 @@ exports[`renders ./components/calendar/demo/notice-calendar.md correctly 1`] = `
</div>
</td>
<td
class="ant-fullcalendar-cell ant-fullcalendar-last-month-cell"
class="ant-fullcalendar-cell ant-fullcalendar-last-month-cell ant-fullcalendar-last-day-of-month"
role="gridcell"
title="October 31, 2016"
>
@@ -3093,7 +3093,7 @@ exports[`renders ./components/calendar/demo/notice-calendar.md correctly 1`] = `
</div>
</td>
<td
class="ant-fullcalendar-cell"
class="ant-fullcalendar-cell ant-fullcalendar-last-day-of-month"
role="gridcell"
title="November 30, 2016"
>
@@ -3466,7 +3466,7 @@ exports[`renders ./components/calendar/demo/select.md correctly 1`] = `
<span
class="ant-select-arrow"
style="user-select:none;-webkit-user-select:none"
unselectable="unselectable"
unselectable="on"
>
<b />
</span>
@@ -3498,14 +3498,14 @@ exports[`renders ./components/calendar/demo/select.md correctly 1`] = `
<span
class="ant-select-arrow"
style="user-select:none;-webkit-user-select:none"
unselectable="unselectable"
unselectable="on"
>
<b />
</span>
</div>
</div>
<div
class="ant-radio-group ant-radio-group-default"
class="ant-radio-group ant-radio-group-outline ant-radio-group-default"
>
<label
class="ant-radio-button-wrapper ant-radio-button-wrapper-checked"
@@ -4211,7 +4211,7 @@ exports[`renders ./components/calendar/demo/select.md correctly 1`] = `
</div>
</td>
<td
class="ant-fullcalendar-cell"
class="ant-fullcalendar-cell ant-fullcalendar-last-day-of-month"
role="gridcell"
title="January 31, 2017"
>

View File

@@ -21,6 +21,6 @@ function onPanelChange(value, mode) {
}
ReactDOM.render(
<Calendar onPanelChange={onPanelChange} />
, mountNode);
<Calendar onPanelChange={onPanelChange} />,
mountNode);
````

View File

@@ -23,6 +23,6 @@ function onPanelChange(value, mode) {
ReactDOM.render(
<div style={{ width: 300, border: '1px solid #d9d9d9', borderRadius: 4 }}>
<Calendar fullscreen={false} onPanelChange={onPanelChange} />
</div>
, mountNode);
</div>,
mountNode);
````

View File

@@ -76,8 +76,8 @@ function monthCellRender(value) {
}
ReactDOM.render(
<Calendar dateCellRender={dateCellRender} monthCellRender={monthCellRender} />
, mountNode);
<Calendar dateCellRender={dateCellRender} monthCellRender={monthCellRender} />,
mountNode);
````
````css

View File

@@ -22,15 +22,18 @@ class App extends React.Component {
value: moment('2017-01-25'),
selectedValue: moment('2017-01-25'),
}
onSelect = (value) => {
this.setState({
value,
selectedValue: value,
});
}
onPanelChange = (value) => {
this.setState({ value });
}
render() {
const { value, selectedValue } = this.state;
return (

View File

@@ -235,7 +235,7 @@
}
&-fullscreen &-content {
height: 90px;
height: 88px;
overflow-y: auto;
position: static;
width: auto;

View File

@@ -0,0 +1,152 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`Card should still have padding when card which set padding to 0 is loading 1`] = `
<div
class="ant-card ant-card-loading ant-card-bordered"
>
<div
class="ant-card-body"
style="padding: 0px;"
>
<div
class="ant-card-loading-content"
style="padding: 24px;"
>
<div
class="ant-row"
style="margin-left: -4px; margin-right: -4px;"
>
<div
class="ant-col-22"
style="padding-left: 4px; padding-right: 4px;"
>
<div
class="ant-card-loading-block"
/>
</div>
</div>
<div
class="ant-row"
style="margin-left: -4px; margin-right: -4px;"
>
<div
class="ant-col-8"
style="padding-left: 4px; padding-right: 4px;"
>
<div
class="ant-card-loading-block"
/>
</div>
<div
class="ant-col-15"
style="padding-left: 4px; padding-right: 4px;"
>
<div
class="ant-card-loading-block"
/>
</div>
</div>
<div
class="ant-row"
style="margin-left: -4px; margin-right: -4px;"
>
<div
class="ant-col-6"
style="padding-left: 4px; padding-right: 4px;"
>
<div
class="ant-card-loading-block"
/>
</div>
<div
class="ant-col-18"
style="padding-left: 4px; padding-right: 4px;"
>
<div
class="ant-card-loading-block"
/>
</div>
</div>
<div
class="ant-row"
style="margin-left: -4px; margin-right: -4px;"
>
<div
class="ant-col-13"
style="padding-left: 4px; padding-right: 4px;"
>
<div
class="ant-card-loading-block"
/>
</div>
<div
class="ant-col-9"
style="padding-left: 4px; padding-right: 4px;"
>
<div
class="ant-card-loading-block"
/>
</div>
</div>
<div
class="ant-row"
style="margin-left: -4px; margin-right: -4px;"
>
<div
class="ant-col-4"
style="padding-left: 4px; padding-right: 4px;"
>
<div
class="ant-card-loading-block"
/>
</div>
<div
class="ant-col-3"
style="padding-left: 4px; padding-right: 4px;"
>
<div
class="ant-card-loading-block"
/>
</div>
<div
class="ant-col-16"
style="padding-left: 4px; padding-right: 4px;"
>
<div
class="ant-card-loading-block"
/>
</div>
</div>
<div
class="ant-row"
style="margin-left: -4px; margin-right: -4px;"
>
<div
class="ant-col-8"
style="padding-left: 4px; padding-right: 4px;"
>
<div
class="ant-card-loading-block"
/>
</div>
<div
class="ant-col-6"
style="padding-left: 4px; padding-right: 4px;"
>
<div
class="ant-card-loading-block"
/>
</div>
<div
class="ant-col-8"
style="padding-left: 4px; padding-right: 4px;"
>
<div
class="ant-card-loading-block"
/>
</div>
</div>
</div>
</div>
</div>
`;

View File

@@ -34,4 +34,9 @@ describe('Card', () => {
wrapper.update();
expect(wrapper.find('.ant-card-wider-padding').length).toBe(0);
});
it('should still have padding when card which set padding to 0 is loading', () => {
const wrapper = mount(<Card loading bodyStyle={{ padding: 0 }}>xxx</Card>);
expect(wrapper.render()).toMatchSnapshot();
});
});

View File

@@ -21,8 +21,8 @@ ReactDOM.render(
<p>Card content</p>
<p>Card content</p>
<p>Card content</p>
</Card>
, mountNode);
</Card>,
mountNode);
````
<style>

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