Compare commits

..

487 Commits

Author SHA1 Message Date
afc163
1a505e8fb0 Merge branch 'master' of github.com:ant-design/ant-design 2017-09-30 00:04:50 +08:00
Jeffrey Carl Faden
9ab9e62308 Add inputPrefixCls for Search component (#7770) 2017-09-30 00:04:19 +08:00
afc163
819e55e968 update snap 2017-09-29 23:10:27 +08:00
afc163
22860b9e87 2.13.4 2017-09-29 22:40:43 +08:00
偏右
44da4049f6 Changelog for 2.13.4 (#7785)
* changelog for 2.13.4

* emojis

* Add english changelog

* emojis
2017-09-29 21:47:01 +08:00
niko
9dc4102cdd fix: should trigger onChange before beforeUpload 2017-09-29 03:52:16 -05:00
Graeme Yeates
47e3cedf86 Minor fixes for select and form en docs (#7769)
* Fix headers on form validateFields [ci skip]

* Include default as an option for select sizes [ci skip]
2017-09-29 10:54:37 +08:00
ddcat1115
3b6dc3f3c4 revert wrong code removing fd40643c2d 2017-09-28 17:28:49 +08:00
Wei Zhu
9b68ce020c docs: fix table 2017-09-28 14:26:01 +08:00
Amorites
e17c8e093e Update index.zh-CN.md (#7755) 2017-09-27 21:15:05 +08:00
afc163
caec11c03a Fix snapshot 2017-09-27 20:21:28 +08:00
afc163
ca255cc547 Tweak AutoComplete input line height 2017-09-27 20:13:01 +08:00
jayberg
4acadc47b5 Avoid circular reference with infinite children (#7742)
Because {element} is a child of <InputElement>, we get a circular reference when also adding "element.props" to <InputElement>, as <InputElement> will be cloned to <{element}> within InputElement.tsx. As a consequence, we get an infinitive circular loop of Element->Props->Children->Element->Props->Children->Element->Props->Children->…

React seems to detect and automatically fix this infinitive loop. But when using the smaller and faster Inferno as a replacement library of React, we get a "RangeError: Maximum call stack size exceeded".

This commit fixes this bug by not attaching {...element.props} to <InputElement>.

All tests did pass and I did not notice any changes in the behaviour of the AutoComplete component. But now, AutoComplete works also with Inferno and not only with React.
2017-09-27 20:09:04 +08:00
afc163
d7eca4e151 Fix table's filter dropdown style 2017-09-27 20:03:26 +08:00
delesseps
a8cab96c13 Add maxLength attribute to Input (#7744) 2017-09-27 09:57:23 +08:00
778758944
4e726fdfd7 修复disabledTime interface定义错误 (#7740) 2017-09-26 16:11:28 +08:00
afc163
9f017bc5ae Fix mention error style 2017-09-25 22:53:11 +08:00
afc163
ccf507b603 update mention demos 2017-09-25 22:42:07 +08:00
afc163
f545e52ec5 Fix dropdown menu group title style 2017-09-25 21:28:00 +08:00
afc163
8026020dd4 Fix column sorter icons style 2017-09-25 21:24:43 +08:00
afc163
463a5db9ba Fix transfer checkbox padding 2017-09-25 20:03:04 +08:00
thegatheringstorm
10f6907da4 Fix: Upload Use object destructuring instead of creating temporary references for onRemove. (#7726) 2017-09-25 18:15:36 +08:00
afc163
3118e2898e Fix broken small pagination via #7634's fix 2017-09-25 16:59:56 +08:00
Miaow
6c38ca62c6 update get started doc port (#7729) 2017-09-25 16:59:40 +08:00
偏右
14b44c880e Update utils.jsx 2017-09-25 14:15:06 +08:00
afc163
8bff515287 Merge branch 'master' of github.com:ant-design/ant-design 2017-09-25 11:13:09 +08:00
afc163
fd40643c2d Remove unused code 2017-09-25 11:12:59 +08:00
Guan Yu Pan (Jacky)
c30c156c56 upgrade rc-animate to 2.4.1 (#7724) 2017-09-25 11:06:25 +08:00
Benjy Cui
f433382180 site: fix tnpm run deploy 2017-09-25 10:39:45 +08:00
Wei Zhu
e672f41e1e Use promise 2017-09-25 10:00:19 +08:00
afc163
29c262ab36 Remove iview and atui from antd implementations 2017-09-23 19:59:04 +08:00
afc163
6ded879619 update changelog 2017-09-23 19:28:40 +08:00
Zheeeng
d8c1bdb3ab Fix: setting 'heigh: 100%' on Sider and the wrapped element can't take the desired effects (#7716) 2017-09-23 18:33:26 +08:00
afc163
89a6aa96ed Tweak input placeholder color, close #7365 2017-09-23 18:21:33 +08:00
afc163
df1b1f5a47 Add @checkbox-size, close #7368 2017-09-23 18:18:47 +08:00
afc163
dd22bae0fc Fix button loading style with icon, close #7709 2017-09-23 16:08:30 +08:00
Sanjay Kumar
1dc4e45bce Bugfix: Handle defaultSearchChange when suggestions contain ‘Nav’ items (#7701) 2017-09-22 23:51:59 -05:00
afc163
8b1a4f80a9 Fix TreeSelect extra input text, close #7703 2017-09-23 12:11:17 +08:00
afc163
91bbcd6f2c Fix broken anchor, close #7712 2017-09-23 12:06:23 +08:00
Aske Ertmann
27b8e39666 Make iconfont usable standalone (#7713)
Similar to motion.less, import all dependencies needed to generate iconfont.less by itself.
2017-09-23 12:01:21 +08:00
afc163
7cfd9b2bcb Remove extra update 2017-09-22 21:47:28 +08:00
afc163
c66062edb4 Fix input compact style 2017-09-22 20:35:30 +08:00
afc163
776beaee05 Fix cursor height in safari 2017-09-22 20:17:04 +08:00
Benjy Cui
bdecb4ebd9 bump 2.13.3 2017-09-22 17:49:16 +08:00
Benjy Cui
9ec8f66c4d docs: add changelog for 2.13.3 (#7702) 2017-09-22 04:47:45 -05:00
afc163
c2e9abddc7 Fix Card extra postion when no title 2017-09-22 15:28:27 +08:00
Benjy Cui
e8f61f11ef site: update config syntax 2017-09-22 14:00:04 +08:00
delesseps
c419a1ddef Remove autoComplete restriction to allow more complex auto-filling behaviour (#7699) 2017-09-22 13:35:26 +08:00
Marco Afonso
81435e2798 feat: add Portuguese locale (#7449)
* Add pt_PT Locale

* Adding pt_PT Locale (fix comma)

* Adding pt_PT Locale to docs

* Add pt_PT locale to tests

* Update imports for rc-pagination and rc-calendar

* Add pt_PT Locale

* Adding pt_PT Locale (fix comma)

* Adding pt_PT Locale to docs

* Add pt_PT locale to tests

* Update imports for rc-pagination and rc-calendar

* Add pt_PT to tests
2017-09-21 21:02:01 -05:00
Kirill Stiopin
49080aa01d fix: update for Dutch locale-provider: added missing translations (#7694) 2017-09-21 20:57:52 -05:00
afc163
17044043dc fix conflict 2017-09-21 21:08:57 +08:00
afc163
3d1914f45b Fix valid selector error of form, close #7693 2017-09-21 21:07:21 +08:00
afc163
5d7ef9d889 fix site 2017-09-21 19:03:38 +08:00
paranoidjk
38b889f00c chore: fix site net check img 2017-09-21 18:26:31 +08:00
afc163
27e4f1b658 Fix Tree showLine style 2017-09-21 18:15:10 +08:00
afc163
7c8e55f0db docs: update i18n 2017-09-21 16:50:47 +08:00
afc163
d21e500fab Add some doc for global reset styles, #4331 2017-09-21 16:44:49 +08:00
afc163
afce275d25 refactor code style 2017-09-21 14:16:01 +08:00
Yang Bin
39993fc749 docs: modify "tar bar" to "tab bar" in table Tab API (#7683) 2017-09-20 21:06:53 -05:00
Meow-z
e165b8a705 fix: model (#7675)
add confirmLoading in async model state.
2017-09-20 09:22:53 -05:00
afc163
635a0548de Tweak input compact layout, close #7662 2017-09-20 16:46:37 +08:00
afc163
30abcdf992 Fix table head height, close #7663 2017-09-20 15:42:31 +08:00
偏右
0ffccf8b0f Provide a debug way of preact compatibility (#7670)
* try preact

* Add start:preact to scripts

* fix webpack.config.js
2017-09-20 14:57:48 +08:00
afc163
8904b50720 update changelog 2017-09-19 22:19:58 +08:00
Benjy Cui
f46a87d3e0 fix: should use fixedNode's height to reset placeholder, close: #2349 2017-09-19 16:31:37 +08:00
afc163
5b6b36f5d6 Add map components to recommended list 2017-09-19 11:10:24 +08:00
feng zhi hao
58fd54e978 fix: Table not trigger custom selection onSelect when hideDefaultSelections is true (#7653) 2017-09-18 20:56:19 -05:00
hauwa123
acd3a8f4d2 docs: update Timeline english doc (#7652)
Fixed typos
2017-09-19 00:46:09 +08:00
Wei Zhu
ed2303a5da Change primary color in browser (#7516) 2017-09-18 17:31:48 +08:00
Kaien Liao
b2aea45b4f fix: Checkbox props definition (#7649), close: #7650 2017-09-18 15:40:25 +08:00
Benjy Cui
bd19b0892c docs: add missing Tabs.TabPane[forceRender], ref: #6459 2017-09-18 11:05:43 +08:00
Khalifa Lame
5a8bd0f6d8 docs: update Tooltip english doc (#7642)
Fixed typos.
2017-09-18 10:28:22 +08:00
Khalifa Lame
f3c35941ec docs: update Table english doc (#7643)
Fixed typos.
2017-09-18 10:28:05 +08:00
Khalifa Lame
a3d4b753b9 docs: update Tab english doc (#7644)
Fixed typos.
2017-09-18 10:27:49 +08:00
Khalifa Lame
fab83990c2 docs: update Tag english doc (#7645)
Fixed typos.
2017-09-18 10:27:35 +08:00
afc163
43d14f8517 upgrade rc-slider, improve accessibility 2017-09-17 17:42:24 +08:00
爱but的苍蝇
644891f8f6 add Table scroll typings (#7640) 2017-09-17 15:44:01 +08:00
afc163
c5f56b9db3 optimize TextArea autosize animation 2017-09-17 13:48:16 +08:00
nikogu
b651579c1b update version 2.13.2 2017-09-17 01:15:41 +08:00
nikogu
95245c21a7 bump 2.13.2 2017-09-17 00:56:30 +08:00
Shubham Kanodia
989b2e2041 Added react and react-dom as peerDeps (#7592)
* Added react and react-dom as peerDeps

* Added react ~0.14.0 as a valid peerDependency
2017-09-16 23:44:20 +08:00
afc163
30c437c83e Fix simple pagination style, close #7634 2017-09-16 13:20:35 +08:00
Khalifa Lame
429a9714d5 Update Avatar English doc (#7627)
fixed typos.
2017-09-16 11:29:51 +08:00
Khalifa Lame
81e3429955 Update Badge English doc (#7628)
* Update Badge English doc

Fixed typos.

* Update index.en-US.md

Reverted some changes after studying the component.
2017-09-16 11:29:38 +08:00
Khalifa Lame
05fbdd0959 Update Calendar English doc (#7629)
Fixed typos.
2017-09-16 11:29:05 +08:00
Khalifa Lame
a4637526b9 Update Card English doc (#7630)
Fixed typos.
2017-09-16 11:28:18 +08:00
Khalifa Lame
11c0683baa Update Carousel English doc (#7631)
Fixed typos.
2017-09-16 11:27:46 +08:00
Khalifa Lame
eb663f0084 Update Collapse English doc (#7632)
Fixed typos.
2017-09-16 11:27:15 +08:00
Khalifa Lame
fdfb4ba843 Update Popover English doc (#7633)
Fixed typos.
2017-09-16 11:26:22 +08:00
afc163
ea2c113530 Fix zIndex types, ref #7624 2017-09-15 22:51:03 +08:00
afc163
11a6cd51a2 Fix zIndex types, close #7622 2017-09-15 21:41:32 +08:00
afc163
5f938a6818 update template.html 2017-09-15 21:40:13 +08:00
afc163
641f1ddeeb Add link 2017-09-15 21:37:17 +08:00
afc163
f36bc02ac3 Add next.js demo link 2017-09-15 21:14:29 +08:00
afc163
6236641c74 Fix broken collapsed MenuGroup, close #7109 2017-09-15 20:37:11 +08:00
Wei Zhu
250c7a9c68 Revert "Mock rc-trigger"
This reverts commit 9d2c91598b.
2017-09-15 16:42:25 +08:00
Wei Zhu
9d2c91598b Mock rc-trigger
Ref #5522
2017-09-15 16:14:26 +08:00
afc163
9df6e06d70 fix lint 2017-09-15 11:14:22 +08:00
afc163
5ac468167d Fix title and extra content position of narrow card
close #7604
2017-09-15 10:57:08 +08:00
afc163
b36df9da2b update tree controlled demo 2017-09-15 10:57:07 +08:00
Wei Zhu
6acf6fc643 Use snapshot test for grid 2017-09-15 10:56:00 +08:00
Wei Zhu
2437ca419e Use snapshot test 2017-09-15 10:50:45 +08:00
afc163
eb62c44564 Fix #7587 2017-09-15 09:55:00 +08:00
afc163
9e319990d2 update snapshot 2017-09-14 18:09:30 +08:00
afc163
ae87b663bf Tweak tree demo 2017-09-13 22:18:44 +08:00
afc163
89ce2254af Improve tree node loading icon position, close #7584 2017-09-13 22:17:13 +08:00
afc163
77d64971e5 Refactor tree loadData demo 2017-09-13 22:06:53 +08:00
afc163
461470ebc6 fix demo snapshot 2017-09-13 19:43:05 +08:00
afc163
9b715f0b90 Fix form demo, close #7547 2017-09-13 18:03:56 +08:00
Mitchell Demler
298a60f13b chore: add validateFirst to fieldDecorator options (#7573) 2017-09-13 14:49:59 +08:00
afc163
f321596e04 Revert empty style of table
ref #7142

close https://github.com/react-component/table/issues/163
2017-09-13 14:26:02 +08:00
偏右
e57cf5ff80 Update README.md 2017-09-12 19:00:09 +08:00
jljsj
aea18c3627 add padding !important, restore menu retraction animate
Conflicts:
	components/menu/style/index.less
2017-09-12 16:51:17 +08:00
Wei Zhu
2a4adeef46 Upgrade antd-tools 2017-09-12 11:51:43 +08:00
Bilal Sirazitdinov
5bb45279bb chore: GetFieldDecoratorOptions missing property - normalize (#7562) 2017-09-12 09:08:47 +08:00
afc163
9f484f9bf0 react-codemirror => react-codemirror2 2017-09-11 16:24:09 +08:00
afc163
bb2c2036ba update button size demo 2017-09-11 15:29:23 +08:00
Wei Zhu
1cdf0d9141 Fix issue link 2017-09-11 14:39:38 +08:00
Benjy Cui
eddd1db3e9 site: fix config, ref: a73d0504 2017-09-11 13:55:00 +08:00
Wei Zhu
c2031f701c Document Select[firstActiveValue] 2017-09-11 12:00:15 +08:00
Wei Zhu
8369557322 Add remove warning comment (#7510) 2017-09-11 11:58:38 +08:00
afc163
33a71eb8fb Fix #7555 2017-09-11 11:46:09 +08:00
Wei Zhu
a5b20dcb82 Add missing Select[firstActiveValue] changelog 2017-09-11 11:31:26 +08:00
Khalifa Lame
ed84626f01 docs: update Popconfirm English doc (#7541)
Fixed typos.
2017-09-11 11:08:53 +08:00
Khalifa Lame
aa3458deb6 docs: update Notification English doc (#7539)
Fixed numerous typos and inconsistencies.
2017-09-11 11:08:34 +08:00
Khalifa Lame
b381f1f5ec docs: update Modal English doc (#7537)
Fixed several typos.
2017-09-11 11:08:18 +08:00
Khalifa Lame
643b32d0d3 Update Progress English doc (#7540)
Fixed minor typos.
2017-09-11 10:13:21 +08:00
ddcat1115
d5b6cc70cd 2.13.1 CHANGELOG 2017-09-11 00:02:05 +08:00
Khalifa Lame
b475ac55f6 Update Spin English doc (#7542)
Fixed some typos.
2017-09-10 21:49:37 +08:00
Khalifa Lame
594dce8f87 Update Message English doc (#7538)
Fixed typos.
2017-09-10 21:47:02 +08:00
Khalifa Lame
ac95d1aea4 Update Alert English doc (#7536)
Minor edits.
2017-09-10 21:40:07 +08:00
Xiaohan Lee
d490a027bb Docs: update docs for Table's undocumented apis (#7525)
* onRowMouseEnter
* onRowMouseLeave
2017-09-10 21:38:25 +08:00
ddcat1115
66a89df91f fix #7475 (#7535) 2017-09-10 13:50:21 +08:00
afc163
b216a44b28 Fix Slider typings, close #7532 2017-09-10 02:32:00 +08:00
afc163
37c8c4ed30 Fix @link-hover-decoration not working, close #7531 2017-09-09 13:58:18 +08:00
afc163
35fc427630 Fix inlineCollapsed menu when submenu is opened
close #7524

close #7514

ref #7063
2017-09-09 00:58:15 +08:00
afc163
2feef3358c Fix transfer lazy doc, close #7520 2017-09-09 00:00:24 +08:00
afc163
dbc4e684df Make popover title height more flexible 2017-09-08 16:47:04 +08:00
afc163
e77108c775 site: update page background 2017-09-08 13:44:52 +08:00
afc163
fb8fec6d3a site: remove font smoothing style 2017-09-08 13:36:10 +08:00
Benjy Cui
30745da52e docs: update typo, close: #7427 2017-09-08 10:12:34 +08:00
Khalifa Lame
a2eb54b1ae docs: update Dropdown English doc (#7442)
Fixed typos
2017-09-08 10:09:11 +08:00
chencheng (云谦)
e1efb82dcb docs: update Practical Projects for dva@2 (#7505) 2017-09-08 09:51:31 +08:00
Khalifa Lame
421feb1c84 docs: update Pagination English doc (#7494)
Fixed typos.
2017-09-08 09:45:56 +08:00
Khalifa Lame
fa1547df84 docs: update Menu English doc (#7465)
* Update Menu English doc

Fixed typos.

* Update Menu English doc

Accidentally replaced noop with none in previous commit. Now reverted.
2017-09-08 09:45:01 +08:00
Khalifa Lame
224e65fc27 docs: update Breadcrumb English doc (#7490)
Fixed minor typos.
2017-09-08 09:43:43 +08:00
Khalifa Lame
1746e1f0d7 docs: update Grid English doc (#7487)
Fixed several typos.
2017-09-08 09:42:08 +08:00
Khalifa Lame
0a583afc5c docs: update Affix English doc (#7488)
Fixed minor typos.
2017-09-08 09:40:40 +08:00
afc163
072d860f8a Fix empty style of small table with fixed columns
close #7509
2017-09-07 21:08:05 +08:00
WingGao
ace985afce Update upload/interface.tsx (#7507)
`response` should be `any`
2017-09-07 15:12:13 +08:00
afc163
b8f6185abc Fix simple pagination style, close #7500 2017-09-06 21:44:26 +08:00
afc163
c7d6ce5d3f Fix Card.Grid broken style
https://gw.alipayobjects.com/zos/rmsportal/ZHuiCHkDSxOZZmZSbmXD.png
2017-09-06 21:14:16 +08:00
afc163
bceed31da4 update form demo snap 2017-09-06 20:18:48 +08:00
afc163
94283b730f Fix validateStatus styles of some Form Controls, close #7498 2017-09-06 20:17:20 +08:00
afc163
16b2cc044e validating status should has feedback icon always, #7498 2017-09-06 19:58:04 +08:00
afc163
7d619dfbd7 update snapshot for #7495 2017-09-06 19:39:46 +08:00
afc163
121898001d update snapshot 2017-09-06 14:28:20 +08:00
afc163
e9a592a9c8 Fix inlineCollpasd and openKeys issue 2017-09-06 14:14:34 +08:00
afc163
786f5cd7e0 improve side current menu demo 2017-09-06 13:59:44 +08:00
afc163
696b4252a8 tweak collpse animation easing 2017-09-06 13:46:45 +08:00
Benjy Cui
59193ef34a Revert "Patch 1 (#7471)"
This reverts commit 9667ec17bd.
2017-09-06 09:46:58 +08:00
paranoidjk
a73d0504ca site: dev use uncompressed bundle. close #7383 (#7472) 2017-09-06 09:19:35 +08:00
kuang
9667ec17bd Patch 1 (#7471)
* default value error 

f10a2abbd8/src/Modal.tsx (L53)

* default value error
2017-09-05 19:07:57 +08:00
Khalifa Lame
f48cf1df90 docs: update Steps English doc (#7463)
Added code tags to string values.
2017-09-05 16:50:27 +08:00
Khalifa Lame
112aaed5fb docs: update Layout English doc (#7461)
Fixed typos.
2017-09-05 16:48:23 +08:00
afc163
8cc1943b77 test: update snap 2017-09-05 15:58:49 +08:00
afc163
cb1e0bfe8e Fix table empty data scroll style
close #7457
2017-09-05 15:57:34 +08:00
afc163
6654a4220d Fix submenu hover style 2017-09-05 11:31:00 +08:00
Khalifa Lame
8551b706cf Update Card English doc (#7440)
Fixed typo
2017-09-04 21:02:03 +08:00
Khalifa Lame
ec2322a906 Update Icon English doc (#7441)
Fixed small typo.
2017-09-04 21:01:48 +08:00
Khalifa Lame
5510d12ce8 docs: update Input English doc (#7439)
Fixed some typos
2017-09-04 15:24:08 +08:00
Khalifa Lame
8271b5d069 docs: update Button English doc (#7438)
Fixed some typos. Added ghost button type.
2017-09-04 15:23:42 +08:00
Wei Zhu
c651c7a04f Fix typo 2017-09-04 14:30:27 +08:00
afc163
6cb3ae46a2 site: update color picker position 2017-09-04 12:24:40 +08:00
afc163
24e2af63f2 site: update footer style 2017-09-04 11:55:45 +08:00
Khalifa Lame
99a998afb5 docs: update Table english doc (#7432)
Fixed numerous typos
2017-09-04 10:47:37 +08:00
Wei Zhu
319fa7c82d Bump 2.13.0 2017-09-03 22:55:41 +08:00
Wei Zhu
35229e55b1 Update snapshot for 9423609 2017-09-03 22:38:21 +08:00
Wei Zhu
156c933235 Add 2.13.0 changelog (#7418) 2017-09-03 22:16:54 +08:00
Wei Zhu
471da70c1e site: Add a primary color change button (#7401) 2017-09-03 22:15:33 +08:00
afc163
9423609243 Tweak collapse style 2017-09-03 18:24:22 +08:00
afc163
07dfac18f7 Tweak table small border style 2017-09-01 18:30:47 +08:00
afc163
7b56d7248f Fix conditional rendering of Timeline.Item, ref #6530 2017-09-01 17:06:30 +08:00
afc163
668cec2f9e Fix FormItem focus behavious, close #7351 2017-09-01 15:17:04 +08:00
Wei Zhu
1547b889b7 Revert "Add support for table default sort order" (#7414) 2017-09-01 14:40:29 +08:00
Wei Zhu
bac4d04844 docs: typo 2017-09-01 11:35:30 +08:00
Wei Zhu
ad3e49e397 docs: Add backfill to AutoComplete 2017-09-01 11:33:11 +08:00
afc163
882ae31199 Fix menu inlineCollapsed under uncontrolled Sider, close #7409 2017-09-01 10:38:53 +08:00
LeezQ
6954c3506c docs: add typescript demo (#7330)
* feat: add typescript demo

add form typescript demo code

* Update index.zh-CN.md

* add TypeScript demo code

add TypeScript demo code

* Update index.en-US.md

* Update index.zh-CN.md

* Update index.en-US.md
2017-09-01 10:36:31 +08:00
afc163
a204c0afa2 restore default cursor, close #7410 2017-09-01 10:04:25 +08:00
Ricardo Raphael Joson
bedfb180a8 Update index.en-US.md (#7403) 2017-08-31 17:13:28 +08:00
偏右
81f16cb2e0 Merge pull request #7400 from ant-design/feature-2.13
Feature 2.13
2017-08-31 16:02:04 +08:00
afc163
d8aef384d3 fix doc 2017-08-31 15:50:46 +08:00
afc163
a3e723648b upgrade react-slick to 0.15.0 2017-08-31 12:20:10 +08:00
Manweill
dc1d0af64e 官网首页的搜索框,当按下键盘s的时候,会获取焦点 (#7267)
* 官方首页的搜索框,当按下键盘s的时候,会获取焦点

* use AutoComplete

* 移除 this.state.focused

* bugfix
2017-08-31 11:47:53 +08:00
afc163
a0a1bff7fe Use real count as badge title 2017-08-31 10:55:25 +08:00
afc163
843d82f6bd fix demo sanpshot 2017-08-30 14:24:47 +08:00
afc163
90c1dfc5c0 fix demo sanpshot 2017-08-30 14:22:18 +08:00
afc163
9547fe5bc4 fix demo sanpshot 2017-08-30 14:21:20 +08:00
afc163
81048aafb2 Improve itemRender of Pagination 2017-08-30 14:03:37 +08:00
afc163
96dd7132e8 Merge branch 'master' into feature-2.13 2017-08-30 13:22:38 +08:00
afc163
56b6fc38d7 fix sider layout min height 2017-08-29 23:58:27 +08:00
afc163
3ceda311b6 menu cannot be selectable in dropdown defaultly 2017-08-29 19:55:09 +08:00
afc163
7fed87f835 doc: fix undocumented selectable prop of Menu 2017-08-29 19:45:13 +08:00
John Nguyen
6c509f9712 adds selectable prop to typescript file (#7384) 2017-08-29 19:42:55 +08:00
afc163
c23afb05d0 Fix test case 2017-08-29 19:41:59 +08:00
afc163
fe09eec9aa improve empty cell style 2017-08-29 17:55:50 +08:00
afc163
2bedd6b0e6 Improve spin transition delay 2017-08-29 16:39:29 +08:00
afc163
a5733f5de3 Fix RangePicker text overlap 2017-08-29 15:08:06 +08:00
John Nguyen
3b6ea67115 adds className to DropDown component" (#7378) 2017-08-29 13:27:38 +08:00
Leo
fc8f533e67 fix ts checking (#7355)
* add title prop to Option component(for ts checking)

* fix Checkbox onChange type
2017-08-29 08:58:51 +08:00
XBTop1!
a5b0848efe doc: add disableCheckbox property for TreeSelect (#7370) 2017-08-29 08:35:49 +08:00
afc163
bc3a285e64 update changelog 2017-08-28 00:49:49 +08:00
afc163
1e48ec0c6a Merge branch 'master' into feature-2.13 2017-08-27 19:31:09 +08:00
afc163
eb21c93d3d fix changelog 2017-08-27 19:25:04 +08:00
afc163
62cbe9e064 fix changelog 2017-08-27 19:21:17 +08:00
afc163
65c86e60ce fix hash jump again 2017-08-27 19:03:36 +08:00
偏右
156ce90a8e 2.12.8 (#7346)
* 2.12.8

* use emoji
2017-08-27 18:57:24 +08:00
afc163
a94e3ab3e0 Add test case for empty table 2017-08-27 17:30:29 +08:00
afc163
6527f9cdb0 More elegant empty style for fixed-columns Table
close #7298

close #7142
2017-08-27 17:30:29 +08:00
偏右
742999ff28 Fix matchMedia not present in jest test (#7344)
close #6560

close #3308

close #7341
2017-08-27 16:53:36 +08:00
afc163
d84452e8b8 Fix snapshot generate, close #7318 2017-08-27 16:07:07 +08:00
偏右
a7200c906c Add hideDefaultSelections (#7342)
close #7295
2017-08-27 15:44:22 +08:00
afc163
7e2d456453 Fix ci 2017-08-27 14:43:23 +08:00
afc163
53ffc83d23 Fix snapshot 2017-08-27 14:10:29 +08:00
afc163
ef8beaffde Merge from master 2017-08-25 22:51:14 +08:00
afc163
d9ef06496d typo 2017-08-25 22:50:19 +08:00
偏右
e0699597ca Use create-react-app without ejecting (#7276) 2017-08-25 22:14:34 +08:00
afc163
21f375b7d7 update TreeSelect doc 2017-08-25 17:20:43 +08:00
ddcat1115
83a02a6050 fix demo (#7327) 2017-08-25 16:37:00 +08:00
afc163
6dade37aec update doc 2017-08-25 14:54:54 +08:00
Peter
275bdaef1a Update recommendation.zh-CN.md (#7310) 2017-08-25 12:04:13 +08:00
kdepp
c9b3a50519 doc: optimize compatibility part (#7322) 2017-08-25 10:41:37 +08:00
afc163
3d322a7c04 Tweak tooltip background and fix basic demo 2017-08-25 10:11:22 +08:00
afc163
0d26b4c972 doc: update Upload API description 2017-08-24 18:37:26 +08:00
XuMM_12
35bc4726a9 Fix Checkbox Group disabled status (#7266) (#7296) 2017-08-24 12:56:25 +08:00
afc163
d0d6e10894 Fix node test again 2017-08-24 10:19:13 +08:00
afc163
c355eae6d1 Fix node test 2017-08-24 10:05:55 +08:00
afc163
61aac68028 doc: remove new key way 2017-08-24 09:44:17 +08:00
afc163
44319bec11 active the selected item should be highlighted 2017-08-23 18:16:52 +08:00
afc163
ef43be1c67 remove incompatiable jsdom version 2017-08-23 17:08:45 +08:00
Ziluo
f04f340fa1 doc:update link of react-blocks (#7299) 2017-08-23 16:36:07 +08:00
Ziluo
fc884242d8 doc:update link of react-blocks (#7299) 2017-08-23 16:34:15 +08:00
afc163
036aeb333d fix jsdom in devDeps 2017-08-23 16:31:15 +08:00
afc163
72f7232929 Add test cases for Card and Breadcrumb 2017-08-23 16:29:56 +08:00
afc163
8bdad3d418 update less code style 2017-08-23 13:57:01 +08:00
afc163
640fcc51e8 upgrade rc-pagination, no new API for antd 2017-08-23 13:46:55 +08:00
Tao
62b72d6c51 modify 参数 to 方法 (#7294)
* modify `参数` to `方法`

* modify `Property` to `Method`

* dummy copy-paste
2017-08-23 13:25:44 +08:00
afc163
ac5bdc6983 doc: update select description 2017-08-23 13:17:43 +08:00
Benjy Cui
2268418a97 docs: add docs for validateFields, close: ##7287 2017-08-23 11:13:01 +08:00
afc163
a51a37cbd8 tweak detail of inline collapse menu 2017-08-22 18:37:08 +08:00
afc163
1fdce5db28 Fix tabs snapshots 2017-08-21 21:02:09 +08:00
afc163
50bdbbda40 Add multiple demo for TreeSelect 2017-08-21 18:08:41 +08:00
Benjy Cui
55f58cf59f bump 2.12.7 2017-08-21 10:00:00 +08:00
Benjy Cui
789e45fd52 docs: add change log for 2.12.7 (#7254) 2017-08-21 09:58:02 +08:00
afc163
84e561b237 Fix removing wrong item when uid is 0, close #7269 2017-08-20 15:39:25 +08:00
山客
ac07dcefb0 Update Table Document (#7268)
Fix syntax errors(markdown table).
2017-08-20 15:15:38 +08:00
afc163
d4171badfd Merge from master 2017-08-19 12:40:40 +08:00
afc163
ff7ba0fb6f upgrade antd-tools and use next over beta, ant-design/antd-tools#57 2017-08-19 12:26:25 +08:00
afc163
fcb935b101 improve form doc 2017-08-19 12:12:57 +08:00
lihqi
6624805ad4 Update index.en-US.md (#7259) 2017-08-18 19:19:10 +08:00
lihqi
5bf94956e4 Update index.zh-CN.md (#7258) 2017-08-18 19:19:02 +08:00
Wei Zhu
7b1df54523 Config jest transform ignore path 2017-08-18 18:47:47 +08:00
afc163
f56e1a7de7 Fix InputNumber id ts type, close #7257 2017-08-18 18:17:06 +08:00
Wei Zhu
145ed77c00 fix: form type (#7245) 2017-08-18 17:21:18 +08:00
Benjy Cui
723da5e164 test: fix CI 2017-08-18 17:20:07 +08:00
Benjy Cui
f089d1852d chore: remove useless deps, and close: #4451 2017-08-18 15:00:21 +08:00
afc163
f77c38bddf fix snap 2017-08-18 12:17:07 +08:00
afc163
7b8090d279 upgrade antd-tools 2017-08-18 12:10:53 +08:00
afc163
e00bfdc150 Make Input with addons same default width 100% with Input 2017-08-18 12:09:17 +08:00
afc163
988e12f54b tweak some font weight 2017-08-17 22:10:40 +08:00
afc163
187e9dd85c tweak step number font 2017-08-17 21:51:25 +08:00
afc163
b216597cfd Fix card grid bug 2017-08-17 17:20:28 +08:00
LeezQ
d329d191dd docs: interface define error (#7241)
fix: interface Properties should be separated by semicolons
2017-08-17 16:24:18 +08:00
lvren
a93cb09e15 将sider收起时的宽度变量放到themes中控制 (#7238) 2017-08-17 16:09:04 +08:00
Benjy Cui
e061ada71a test: fix CI 2017-08-17 15:33:26 +08:00
Benjy Cui
9abce572a4 fix: notification.xxx shoud not affect defualtPlacement, close: #5895 2017-08-17 15:23:47 +08:00
Benjy Cui
26d746bd8f fix: should support child.ref in AutoComplete, close: #6814 (#7237) 2017-08-17 13:09:18 +08:00
afc163
f9273bc95a remove repeat hash jump 2017-08-17 11:51:14 +08:00
afc163
01d4acb7a9 Attach more events for Affix display 2017-08-17 11:45:46 +08:00
afc163
fe3af14273 Remove exported SelectPropTypes and fix undefined exports, close #7222 2017-08-17 09:57:23 +08:00
Ramsés Moreno
20ea524ef1 fix: corrections in the Spanish locale (#7234)
* Corrections in the Spanish locale. In Spanish, the only uppercase letter in a sentece is the first letter and not in every word. Some othe minor changes.

* Corrections in the Spanish locale. In Spanish, the only uppercase letter in a sentece is the first letter and not in every word. Some othe minor changes.
2017-08-17 09:36:52 +08:00
afc163
ea92bbf371 fix snap 2017-08-16 22:04:16 +08:00
afc163
f61f811432 Fix sider width transition in IE11
close #6349
2017-08-16 21:46:09 +08:00
afc163
70e10dee59 Fix transition width of sider trigger 2017-08-16 21:46:09 +08:00
jiang
7a5e11c799 fix: tabs show scroll anim and tag anim ease (#7218)
* fix: tabs show scroll anim and tag anim ease

* update snapshot
2017-08-16 21:05:52 +08:00
Benjy Cui
e0bf1cefe7 fix: disabled of Dropdown, ref: #7102 2017-08-16 17:56:07 +08:00
Benjy Cui
1f652bfe4c fix: event.target of Button's click event, close: #7034 2017-08-16 17:43:56 +08:00
Benjy Cui
bee3c43e7a fix: Timeline with only one child should work, close: #7214 2017-08-16 17:31:53 +08:00
afc163
ad6dbcb9c6 Fix button in DatePicker 2017-08-16 15:38:12 +08:00
afc163
53640c3f18 update menu API doc 2017-08-16 14:27:22 +08:00
afc163
33f37debd7 tweak site style 2017-08-16 10:49:54 +08:00
afc163
8e744545ff code style 2017-08-16 10:38:37 +08:00
afc163
f0c6350e0e update select demo 2017-08-16 10:38:03 +08:00
afc163
cf3c0aac43 Fix focused style of disabled Pagination button 2017-08-16 09:54:10 +08:00
afc163
d3ec477f8f Add NG-ZORRO links 2017-08-15 23:00:06 +08:00
afc163
8dfb44ba72 update card snapshot 2017-08-15 22:36:48 +08:00
afc163
f46112d385 refactor card extra style 2017-08-15 22:34:48 +08:00
afc163
5443e79329 improve code expand style 2017-08-15 21:00:31 +08:00
afc163
59b11f3b48 Tweak button insert space logic 2017-08-15 20:08:00 +08:00
afc163
48f7d22929 site: improve code collapse icon design 2017-08-15 17:20:47 +08:00
afc163
1f6bcf963f tweak progress initial style 2017-08-15 16:48:49 +08:00
afc163
749b6e7242 Tweak table sorter style 2017-08-15 15:14:02 +08:00
afc163
dc209c20f9 upgrade rc component version 2017-08-15 14:41:28 +08:00
Benjy Cui
87c8c7ad67 site: fix toc background color, close: #7199 2017-08-15 09:56:43 +08:00
Stefan Paunovic
7d8c7d72b7 feat: add sr_RS locale (Serbian) (#7201) 2017-08-15 09:24:30 +08:00
afc163
57e3be2c32 Fix select popupContainer in site header 2017-08-14 22:57:45 +08:00
Piper Chester
4b38dbd669 README: fix grammatical errors (#7208) 2017-08-14 22:25:12 +08:00
Mitchell Demler
293d63910a Fix type definition for Card Component. (#7196)
React.Component requires two parameters. The second parameter (State) is now optional in a more recent version of @types/react however upgrading to this has several major/breaking changes elsewhere. I would prefer to explicitly define State as `{}` in this case.
2017-08-14 09:44:44 +08:00
comerc
e92ef95f74 Add cra-ts-antd (#7195) 2017-08-14 09:44:25 +08:00
afc163
f6d349731c Fix innerSlider of react-slick, close #7191 2017-08-13 14:52:29 +08:00
LongYinan
f58b1075ac docs: recommend ts-import-plugin in README (#7189) 2017-08-12 17:07:59 +08:00
afc163
32497c35fe update changelog 2017-08-12 14:01:01 +08:00
Zheeeng
754966991b Rename File interface to UploadFile (#7183)
* Fix doc missing info

* Rename File interface to UploadFile
2017-08-12 13:56:57 +08:00
Mars Wong
1e80254059 doc: add missing API for Cascader (#7187) 2017-08-12 13:56:42 +08:00
nikogu
7d49cc18a9 Merge branch 'master' into feature-2.13 2017-08-12 11:16:33 +08:00
Eden Wang
e633f91c27 Disabled Dropdown is showing Menu on hover (#7102)
* disabled dropdown is showing menu on hover

* fix cr error

* update snap

* update document
2017-08-11 23:55:36 +08:00
nikogu
258b3d170c fixed changelog grammar 2017-08-11 23:52:58 +08:00
nikogu
d5d69d4063 optimize changelog lasttime 2017-08-11 23:28:45 +08:00
nikogu
47aa36fb06 optimize changelog 2017-08-11 23:26:29 +08:00
nikogu
1fb7bd7205 fixed changelog grammar again 2017-08-11 22:38:11 +08:00
nikogu
e30116f4bd fixed changelog grammar 2017-08-11 22:30:42 +08:00
nikogu
9a7c369af6 bump 2.12.6 2017-08-11 22:18:16 +08:00
afc163
11f9459738 update snapshot 2017-08-11 22:14:16 +08:00
afc163
1651015688 fix card doc, ref #7185 2017-08-11 20:21:16 +08:00
afc163
592653c2ad fix card type tabs className, close #7185 2017-08-11 19:59:55 +08:00
afc163
711703b91e update bootstrap 3 link 2017-08-11 19:08:09 +08:00
Xiaohan Lee
c23c0a6b16 Update docs for Table.render and Upload.onChange (#7180)
* Docs: fix invalid link in docs of Table.render

* Docs: add link for "onChange" in docs of Upload.onChange
2017-08-11 17:05:58 +08:00
afc163
f689ede0fa The collapse trigger of Sider should be fixed and upon menus
close #7161
2017-08-11 16:10:17 +08:00
Zhang Zhi
30e4fa8a8d Remove Button's redundent code (#7176) 2017-08-11 15:06:35 +08:00
Zheeeng
fdc8d357ef Fix doc missing info (#7175) 2017-08-11 12:39:26 +08:00
afc163
c79592cf05 Fix select demo 2017-08-11 10:44:13 +08:00
afc163
af9dc73eef Fix collapse arrow position in IE9/10/11 2017-08-11 10:32:16 +08:00
Zheeeng
d6dde83247 Fix typo (#7170) 2017-08-11 09:30:19 +08:00
afc163
d98d7a451c Add @tag-font-size 2017-08-10 21:45:19 +08:00
afc163
9f75694c75 Fix link 2017-08-10 16:25:52 +08:00
afc163
9bcde59001 Add @form-feedback-icon-size 2017-08-10 11:34:08 +08:00
afc163
43751c9930 revert eb3c274, close #7162 2017-08-10 10:54:02 +08:00
afc163
1f18c93d7f Fix empty table scrollbar, close #7142 2017-08-09 21:55:38 +08:00
Vemund Santi
b69a6886d7 Locale/nb-NO (#7122)
* locale: Add Norwegian Bokmål locales to Ant Design

* Add Vemund Santi to authors.

* docs: add Norwegian to list of i18n language examples

* test: add tests for Norwegian Bokmål

* Update dependencies. Use locales from rc-pagination.
2017-08-09 20:36:01 +08:00
afc163
47c5de29f3 tweak range picker style 2017-08-09 16:21:18 +08:00
偏右
eb3c274e01 Fix extra space in RangePicker
https://gw.alipayobjects.com/zos/rmsportal/sTMIijZIrTkBDaGrEXmI.png
2017-08-09 15:33:30 +08:00
Randy
df934445c0 add a generic type for FormCreateOption (#7119) 2017-08-09 12:59:31 +08:00
Benjy Cui
87bfe2df87 fix: wrappedComponentRef should work, close: #6545 2017-08-09 10:27:34 +08:00
afc163
3001ca4114 typo 2017-08-08 21:22:09 +08:00
afc163
02c5616250 Update Card demo 2017-08-08 21:21:49 +08:00
afc163
807b573bff Collapse the border or Card.Grid 2017-08-08 21:13:29 +08:00
afc163
b687a32044 Fix safari input text align, close #7135 2017-08-08 20:27:05 +08:00
afc163
a329d3d39b Fix file.response type checking, ref #6818 2017-08-08 17:18:55 +08:00
afc163
8892d85e33 use @font-size-base for Badge[text] 2017-08-08 14:23:50 +08:00
afc163
500b222556 Fix stretched layout by content
523b4360d2 (commitcomment-23527573)
2017-08-08 13:38:10 +08:00
afc163
d339e628ed Fix upload default error message, close #6818 2017-08-08 13:34:24 +08:00
afc163
a033e576fd doc: upgrade node version 2017-08-08 10:43:45 +08:00
Benjy Cui
02daedd67b docs: add missing doc for Form, close: #6959 2017-08-08 10:10:47 +08:00
afc163
53d279eb77 Add antizer 2017-08-07 22:14:48 +08:00
afc163
acf58de807 2.12.5 2017-08-07 21:29:24 +08:00
afc163
4c52ccaff9 Fix Dropdown menu width, close #7124 2017-08-07 21:27:08 +08:00
afc163
4f73a23a10 typo 2017-08-07 17:59:47 +08:00
afc163
29b5f433f8 Fix step title background 2017-08-07 16:11:43 +08:00
afc163
5a33774238 Fix ~ mis-position bug 2017-08-07 15:35:05 +08:00
Dmitry Bolotin
ba0d2598fe Object cloning in flatArray performed only if object has childrenName field. (#7072) 2017-08-07 15:33:18 +08:00
afc163
e3b6430a4b Fix InputNumber border, close #7117 2017-08-07 14:16:28 +08:00
afc163
3570458c31 Fix undefined SelectPropTypes 2017-08-07 11:35:22 +08:00
Yiming
a22a011c49 修改错别字 (#7110)
反应 应为 反映
2017-08-07 10:44:47 +08:00
Michalis Macheras
94d46e4c01 add el_GR locale (Greek) (#6928)
Update index.test.js

Syntactic error corrected
2017-08-07 10:41:38 +08:00
Randy
e4c5ab9c69 Radiogroup with name (#7009)
* Add a name property for RadioGroup

* Add document for RadioGroup's name property

* Add test case for RadioGroup name property
2017-08-07 10:41:38 +08:00
Benjy Cui
456cea652b docs: add zIndex to docs of Modal, ref: 2aa3437 2017-08-07 10:41:38 +08:00
Alex Chao
3727ea2c33 feat: Modal.confirm supports zIndex prop #6722 (#6880)
* Modal.confirm supports zIndex prop #6722

* Fix filename

* Fix the zIndex missing in ModalFuncProps interface
2017-08-07 10:41:38 +08:00
mkermani144
a9430e6748 Add fa_IR to i18n docs 2017-08-07 10:40:34 +08:00
mkermani144
e8ef77b963 Add fa_IR locale 2017-08-07 10:40:34 +08:00
Graeme Yeates
d21523ef8c Use classNames to set ant-column-sort Table attribute 2017-08-07 10:40:34 +08:00
Graeme Yeates
75a6a562a0 Update table head.md snapshot 2017-08-07 10:40:34 +08:00
Graeme Yeates
40e94945d9 Add support for table default sort order (#6449) 2017-08-07 10:40:34 +08:00
yociduo
8016cccd18 rollback basic demo from popconfirm 2017-08-07 10:40:34 +08:00
yociduo
fa0e90f577 remove cancel type 2017-08-07 10:40:34 +08:00
yociduo
528a7645ca remove cancel text 2017-08-07 10:40:33 +08:00
Eden Wang
a5a1458148 add missing trailing commna 2017-08-07 10:40:33 +08:00
Eden Wang
8f1dd9ccda add missing trailing comma 2017-08-07 10:40:33 +08:00
Eden Wang
ee176347ac fix ci compile error 2017-08-07 10:40:33 +08:00
Eden Wang
f7b918add3 update confirm demo 2017-08-07 10:40:33 +08:00
Eden Wang
c712d072eb update okType and cancelType for api docs 2017-08-07 10:40:33 +08:00
Eden Wang
f2b987aaa9 update custom type for modal components 2017-08-07 10:40:32 +08:00
Eden Wang
f5ade936e1 add button type for ok and cancel in popconfirm 2017-08-07 10:40:32 +08:00
乐仪
c8eec8c56f bump 2.12.4 2017-08-06 20:21:57 +08:00
Troy Thompson
18c6860296 Adds onFocus and onBlur to Select properties. (#7082) 2017-08-06 16:45:10 +08:00
Mars Wong
e9b3c36866 fix: correct Notification interface (#7073) (#7088) 2017-08-06 13:29:11 +08:00
乐仪
1dd3e001c5 Update Modal doc, relevant:https://github.com/ant-design/ant-design/pull/7085 2017-08-06 12:44:15 +08:00
tim-soft
fdb943e887 Fix formatter (#7098)
The replace function can only work on a string, this little tweak will make the formatter not crash the page when the value is changed.
2017-08-06 11:57:56 +08:00
Ivan Radeljic
1651682020 Update modal documentation (#7085)
Add another way to destroy state on close modal
2017-08-06 00:04:25 +08:00
偏右
cb8f6a6ef5 Fix tabs extra content (#7090)
* Fix tabBarExtraContent style in vertical tabs

close #6578

* update snap

* fix rc-tabs
2017-08-05 23:01:28 +08:00
afc163
2fdc4ec1e6 doc: update some words 2017-08-04 22:28:22 +08:00
afc163
bcda84141e fix stylelint 2017-08-04 22:25:30 +08:00
afc163
b3979885e4 fix demo snapshot 2017-08-04 21:29:30 +08:00
Tom Gao
9e54bebf33 fix: when menuitem is seleted, but submenu is not seleted (#7042) 2017-08-04 21:24:59 +08:00
D & R
4bfd076cb8 fix: InputGroup demo (#7089) 2017-08-04 21:23:34 +08:00
afc163
6a17efcbf1 upgrade some devDeps and fix stylelint 2017-08-04 18:01:40 +08:00
Zach Guo
da8c82a6e4 translate patterns/list (#7056) 2017-08-04 17:42:14 +08:00
Tengjiao Cai
6e2ace3ba8 Update CollapsePanelProps -> onChange function (#7084)
parameter key should be either an array of string(general) or string(accordion mode), right?
2017-08-04 17:00:36 +08:00
Benjy Cui
4880b6ec16 fix: should not throw error when select after clear, close: #7077 2017-08-04 16:50:05 +08:00
afc163
59e219e138 Fix notification type, close #7073 2017-08-04 16:44:42 +08:00
afc163
5da1403bc0 Fix inlineCollapsed in controlled mode
ref #7063
2017-08-04 16:23:52 +08:00
afc163
1856fbe0df fix noHovering API typo, close #7078 2017-08-04 14:15:17 +08:00
Xiaohan Lee
bb195ee95f Docs: update docs for Dropdown.Button (#7071)
* add "size" api document
2017-08-04 09:42:32 +08:00
afc163
6748221ed3 tweak time-picker style 2017-08-03 22:08:14 +08:00
afc163
0f63c7186e Fix input outline covered by addon again 2017-08-03 21:48:26 +08:00
afc163
483491d0d8 treak input style for text align 2017-08-03 21:45:56 +08:00
afc163
981573037a Add mobile components sketch template 2017-08-03 20:10:43 +08:00
afc163
a0026a5923 Fix dropdown button mis-align, close #7070 2017-08-03 16:16:37 +08:00
ddcat1115
63c3c7c88f fix missing icon (#7064) 2017-08-03 15:52:31 +08:00
afc163
0a9a3887b5 Fix Invalid calling object in IE
with eval-source-map mode of webpack-dev-server

close #7060

ref https://github.com/vuejs/vue/issues/4465
2017-08-03 10:58:55 +08:00
afc163
50b9839bb3 Fix input outline covered by addon 2017-08-02 21:37:15 +08:00
afc163
8618a387da tweak date-picker style 2017-08-02 21:15:03 +08:00
afc163
bb7c580e4b Fix loading card padding 2017-08-02 21:15:02 +08:00
Randy
ecc18ef3a6 remove rc-util declaration (#7043) 2017-08-02 15:08:55 +08:00
afc163
414d3d3a64 Fix showTotal definition, close #7054 2017-08-02 13:03:56 +08:00
afc163
fb70e9d70b code style 2017-08-02 13:02:01 +08:00
afc163
746990b84d tweak alert style, make it adaptive 2017-08-01 22:18:57 +08:00
afc163
4962d19462 tweak steps style 2017-08-01 21:50:38 +08:00
afc163
0cf3600e25 refactor step title style again 2017-08-01 18:34:02 +08:00
Ruslan P
0cdcdfba7b Update picture-style.md (#7051) 2017-08-01 18:22:55 +08:00
afc163
0eefa85b04 refactor step title style 2017-08-01 18:08:08 +08:00
jiang
1a93536a26 fix #7048 (#7050) 2017-08-01 17:41:03 +08:00
jiang
f1110f2bc5 sync menu and layout-sider animate time (#7047) 2017-08-01 17:36:53 +08:00
afc163
eb69e0a0f8 Fix scroll bar flash in TextArea[autosize] 2017-08-01 16:37:57 +08:00
Flynn
8e8c0b4db3 update docoument for #7026 (#7039) 2017-08-01 11:26:18 +08:00
afc163
e8fc686dcf site: add logo for stackoverflow and segmentfault 2017-07-31 21:50:49 +08:00
Randy
b5ad05bc06 fix Card children type (#7030) 2017-07-31 20:29:56 +08:00
afc163
a88f8fcc21 fix badge demo 2017-07-31 18:03:16 +08:00
afc163
330e1f7a4b Fix badge title, close #7024 2017-07-31 18:01:45 +08:00
afc163
8f98ae80bd Tweak CheckableTag style 2017-07-31 17:47:54 +08:00
afc163
2fe4ac1a30 update document for #7023 2017-07-31 16:55:05 +08:00
afc163
50466ed281 Fix ok button style 2017-07-31 16:12:41 +08:00
Amorites
29d2a756b0 site: place 'search...' at the bottom of the search options (#7021) (#7022) 2017-07-31 13:54:31 +08:00
Wei Zhu
401519ec6f Fix types 2017-07-31 01:50:46 +08:00
Wei Zhu
12bf17b166 Bump version 2017-07-31 01:26:28 +08:00
Wei Zhu
3ae966f158 Add 2.12.3 changelog (#7010) 2017-07-31 00:50:34 +08:00
Randy
b2556b4cd5 remove any type in Avatar (#7016) 2017-07-31 00:43:33 +08:00
Randy
35ae41f618 remove any type in Tag (#7015) 2017-07-31 00:42:25 +08:00
Wei Zhu
bef7db465e Revert "Revert "Revert "feat: upgrade rc-slider, support keyboard accessibility"""
This reverts commit 0b8b0d2deb.
2017-07-30 16:07:41 +08:00
Wei Zhu
0b8b0d2deb Revert "Revert "feat: upgrade rc-slider, support keyboard accessibility""
This reverts commit 551807cd91.
2017-07-30 16:06:53 +08:00
Wei Zhu
551807cd91 Revert "feat: upgrade rc-slider, support keyboard accessibility"
This reverts commit ef339a32ac.
2017-07-30 16:05:37 +08:00
afc163
a6037d66c0 Fix button align issue, close #7001 2017-07-30 14:00:32 +08:00
Randy
859761eea7 fix lint error (#7006) 2017-07-30 13:30:12 +08:00
afc163
541a992a56 Add warning for tree-select props 2017-07-29 14:50:11 +08:00
afc163
d00871acdd upgrade snapshot 2017-07-29 14:20:48 +08:00
SHEN Lin
58ec298ded Translation pattern form (#6944)
* 60% finish for translation of form

* finish form translation

* finish form translation and delete form.md

* modified translation

* modify title
2017-07-29 14:17:45 +08:00
Randy
99e4cd6aec add rc-util declaration to custom-typings (#6935) 2017-07-29 14:17:02 +08:00
afc163
b54a70bc8e fix ummount issue, #6976 2017-07-29 14:16:27 +08:00
Neekey
6eff4bd02a check this.container exists updating WiderPadding (#6976)
before doing updating wider padding for Card, always check if the container exists first.
2017-07-29 14:12:53 +08:00
Aleck Landgraf
d6a0b1bd3e [checkbox][docs] fixes doc table extra column cell (#6995) 2017-07-29 14:01:30 +08:00
paranoidjk
ef339a32ac feat: upgrade rc-slider, support keyboard accessibility
https://github.com/react-component/slider/pull/282
2017-07-28 14:02:45 +08:00
afc163
4d5eb5a92f Fix indeterminate checkbox disabled style 2017-07-28 13:10:02 +08:00
afc163
69775dea68 fix grid card padding implementation 2017-07-28 12:50:57 +08:00
Benjy Cui
fff756ff5f deps: upgrade rc-tree 2017-07-28 11:38:39 +08:00
paranoidjk
bcb82a518b feat: upgrade rc-calendar. 2017-07-28 11:18:40 +08:00
Benjy Cui
c63c8b6c04 test: update snapshot 2017-07-28 09:59:30 +08:00
jiang
24f58c20e1 fix menu-anim (#6955)
* fix menu-anim

* fix menu-anim

* update

* remove space

* fix test

* Improve code style

* submeu-title use color transition

* sync motion-collapse time

* snyc padding
2017-07-27 19:43:45 +08:00
afc163
abb2763a66 chore: collapse style 2017-07-27 19:43:40 +08:00
Benjy Cui
7582ab7481 test: update snapshot 2017-07-27 17:51:07 +08:00
Benjy Cui
455ea58b10 deps: upgrade rc-tree 2017-07-27 16:43:11 +08:00
afc163
e1a46cc419 Add less variables for wider card padding, resolve #6973 2017-07-27 12:05:58 +08:00
Wei Zhu
90511c3261 docs: use indexOf instead of search
fix #6962
2017-07-26 13:24:58 +08:00
Benjy Cui
8e496966cf docs: update docs for Form 2017-07-26 09:04:01 +08:00
afc163
dc8be3fcfd Tweak icon position of DatePicker 2017-07-25 19:45:58 +08:00
afc163
acc0c5a216 Add instruction about dropdown menu item highlighted style 2017-07-25 18:00:33 +08:00
afc163
144c67f054 Fix dropdown menu position bug 2017-07-25 17:56:45 +08:00
Benjy Cui
ad92793a47 fix: events shuould work when element appear, close: #6949 2017-07-25 16:56:49 +08:00
afc163
d90e1b2a9e Fix extra ... in firefox 2017-07-25 14:15:13 +08:00
偏右
54eadefeca Merge pull request #6948 from newswim/master
Escape "|" character in Pagination documentation
2017-07-25 11:43:17 +08:00
Dan Minshew
8e2d65298a Escape "|" character 2017-07-24 22:12:46 -05:00
Dan Minshew
e0ab15907f Escape pipe operator in function signature 2017-07-24 22:03:11 -05:00
afc163
4f85be834c Tweak menu text align again 2017-07-25 10:31:05 +08:00
偏右
fa12a715e0 Merge pull request #6945 from confiks/master
Upgrade create-react-class to 15.6.0
2017-07-25 09:29:29 +08:00
Confiks
e93d24021f Upgrade create-react-class to 15.6.0 2017-07-25 01:53:53 +02:00
Zach Guo
9e6bc99816 Translate documentation for Navigation, both Pattern and Guideline (#6911) 2017-07-25 07:45:54 +08:00
Pierre Neter
0c0fc38be6 docs: just need one title like other documents (#6930) 2017-07-24 10:16:13 +08:00
Benjy Cui
f648edacdb docs: explain what it n, close: #6934 2017-07-24 10:12:16 +08:00
Benjy Cui
2ba3a84331 fix: getDefaultTarget only be called in browser, close: #6926 2017-07-24 09:58:56 +08:00
偏右
547745271e Merge pull request #6932 from pierreneter/docs/spec/update
Update Guidelines
2017-07-24 09:37:59 +08:00
Benjy Cui
d2aca99190 refactor: simplify TextArea's code 2017-07-24 09:36:27 +08:00
偏右
499ab69f65 Merge pull request #6929 from pierreneter/patch-1
Remove help translate line
2017-07-24 09:31:53 +08:00
偏右
199d9433d5 Merge pull request #6933 from huzzbuzz/patch-1
update message/index.zh-CN.md
2017-07-24 09:31:08 +08:00
huzzbuzz
568963e894 update duration value from 1.5 to 3
update duration value from 1.5 to 3
2017-07-24 08:28:15 +08:00
Pierre Neter
5c2b03dbfc Update Guidelines
Signed-off-by: Pierre Neter <pierreneter@gmail.com>
2017-07-24 03:15:07 +07:00
Pierre Neter
55d2511608 Remove help translate line 2017-07-24 01:40:21 +07:00
偏右
94e4ddb032 Merge pull request #6925 from djyde/enable-noImplicitAny-Card
remove `any` from Card component #5627
2017-07-22 21:48:10 +08:00
Randy
d28b8f3591 remove any type from Card component #5627 2017-07-22 21:12:55 +08:00
342 changed files with 6100 additions and 2128 deletions

View File

@@ -1,5 +1,6 @@
components/**/*.js
components/**/*.jsx
components/*/__tests__/type.tsx
!.eslintrc.js
!components/*/__tests__/*
!components/*/__tests__/**/*.js
!components/*/demo/*

1
.gitignore vendored
View File

@@ -36,3 +36,4 @@ components/**/*.js
components/**/*.jsx
!components/**/__tests__/*.js
!components/**/__tests__/*.js.snap
/.history

View File

@@ -2,13 +2,9 @@ const libDir = process.env.LIB_DIR;
const transformIgnorePatterns = [
'/dist/',
'/node_modules/reqwest',
'node_modules\/[^/]+?\/(?!(es|node_modules)\/)', // Ignore modules without es dir
];
if (libDir !== 'es') {
transformIgnorePatterns.push('/node_modules/');
}
module.exports = {
setupFiles: [
'./tests/setup.js',
@@ -30,9 +26,9 @@ module.exports = {
'node',
],
transform: {
'\\.tsx?$': './node_modules/typescript-babel-jest',
'\\.js$': './node_modules/babel-jest',
'\\.md$': './node_modules/antd-demo-jest',
'\\.tsx?$': './node_modules/antd-tools/lib/jest/codePreprocessor',
'\\.js$': './node_modules/antd-tools/lib/jest/codePreprocessor',
'\\.md$': './node_modules/antd-tools/lib/jest/demoPreprocessor',
},
testRegex: libDir === 'dist' ? 'demo\\.test\\.js$' : '.*\\.test\\.js$',
collectCoverageFrom: [
@@ -40,6 +36,7 @@ module.exports = {
'!components/*/style/index.tsx',
'!components/style/index.tsx',
'!components/*/locale/index.tsx',
'!components/*/__tests__/**/type.tsx',
],
transformIgnorePatterns,
snapshotSerializers: [

View File

@@ -9,9 +9,9 @@ module.exports = {
'md',
],
transform: {
'\\.tsx?$': './node_modules/typescript-babel-jest',
'\\.js$': './node_modules/babel-jest',
'\\.md$': './node_modules/antd-demo-jest',
'\\.tsx?$': './node_modules/antd-tools/lib/jest/codePreprocessor',
'\\.js$': './node_modules/antd-tools/lib/jest/codePreprocessor',
'\\.md$': './node_modules/antd-tools/lib/jest/demoPreprocessor',
},
testRegex: 'demo\\.test\\.js$',
testEnvironment: 'node',

View File

@@ -1,10 +1,7 @@
{
"extends": "stylelint-config-standard",
"rules": {
"at-rule-empty-line-before": null,
"at-rule-name-space-after": null,
"comment-empty-line-before": null,
"declaration-bang-space-before": null,
"declaration-empty-line-before": null,
"function-comma-newline-after": null,
"function-name-case": null,

View File

@@ -141,6 +141,7 @@ Tino D <ginodeis@gmail.com>
Tyler <chaotyler@gmail.com>
Vadim Macagon <vadim.macagon@gmail.com>
Valentin Vichnal <valentin@vichnal.com>
Vemund Santi <veund@santi.no>
Vincent Zhang <vxzhong@qq.com>
Walter Barbagallo <turbometalskater@gmail.com>
Warren Seymour <warren@fountainhead.tech>

View File

@@ -17,6 +17,209 @@ If you want to read change logs before `2.0.0`, please visit [GitHub](https://gi
---
## 2.13.4
`2017-09-29`
- 🐞 Fix missing Pagination `size="small"` style.
- 🐞 Fix Anchor missing padding. [#7712](https://github.com/ant-design/ant-design/issues/7712)
- 🐞 Fix TreeSelect extra select below search input. [#7703](https://github.com/ant-design/ant-design/issues/7703)
- 🐞 Fix the jumping problem of Form validate text. [#7730](https://github.com/ant-design/ant-design/issues/7730)
- 🐞 Fix Button Group loading style. [#7709](https://github.com/ant-design/ant-design/issues/7709)
- 🐞 Fix blur placeholder text color. [#7365](https://github.com/ant-design/ant-design/issues/7365)
- 🐞 Fix Mention `suggestion.toLowerCase is not a function` error. [#7696](https://github.com/ant-design/ant-design/issues/7696) [@kappa-gooner](https://github.com/kappa-gooner)
- 🐞 Fix a children height problem of Layout.Sider. [#7716](https://github.com/ant-design/ant-design/pull/7716) [@zheeeng](https://github.com/zheeeng)
- 🐞 Fix Dropdown menu group style.
- 🐞 Fix Table filter icon and dropdown style.
- 🐞 Fix a AutoComplete circular reference bug in Inferno. [#7742](https://github.com/ant-design/ant-design/pull/7742) [@menberg](https://github.com/menberg)
- 🐞 Fix Upload cannot upload file when using `beforeUpload`. [#7762](https://github.com/ant-design/ant-design/issues/7762) [#6983](https://github.com/ant-design/ant-design/issues/6983)
- TypeScript
- 🐞 Fix Input `maxLength` definite. [#7744](https://github.com/ant-design/ant-design/pull/7744) [@delesseps](https://github.com/delesseps)
- 🐞 Fix `disabledTime` definite of DatePicker. [#7740](https://github.com/ant-design/ant-design/pull/7740) [@778758944](https://github.com/778758944)
## 2.13.3
`2017-09-22`
- 🐞 Fix Affix scrolling bug when document's height minus viewport's height is smaller than the height of children of Affix. [#2349](https://github.com/ant-design/ant-design/issues/2349)
- 🐞 Fix broken style of header of Card when `Card[title]` is void and `Card[extra]` is set. [f46112d#commitcomment-24480417](https://github.com/ant-design/ant-design/commit/f46112d38561c89780eb44ecbba82347d2b912da#commitcomment-24480417)
- 🐞 Fix TypeScript definition of `Checkbox[children]`. [#7650](https://github.com/ant-design/ant-design/issues/7650) [@liaokaien](https://github.com/liaokaien)
- 🐞 Fix error when set nested name in `getFieldDecorator` and then click the label of `Form.Item`. [#7693](https://github.com/ant-design/ant-design/issues/7693)
- Input
- 🐞 Fix broken style of `Input.Group[compat]` when it has `Select` as its children. [#7662](https://github.com/ant-design/ant-design/issues/7662)
- 🐞 Fix TypeScript definition of `Input[autoComplete]`. [#7699](https://github.com/ant-design/ant-design/pull/7699) [@delesseps](https://github.com/delesseps)
- LocaleProvider
- 🇵🇹 Support Portuguese. [#7449](https://github.com/ant-design/ant-design/pull/7449) [@taviroquai](https://github.com/taviroquai)
- 🐞 Fix missing translations in Dutch locale. [#7694](https://github.com/ant-design/ant-design/pull/7694) [@kstiopin](https://github.com/kstiopin)
- Table
- 🐞 Fix height of table header when `rowSelection` is set. [#7663](https://github.com/ant-design/ant-design/issues/7663)
- 🐞 Fix bug that click on first two options will not trigger event when `rowSelection.hideDefaultselections` is set. [#7626](https://github.com/ant-design/ant-design/issues/7626) [@infeng](https://github.com/infeng)
- 🐞 Fix TypeScript definition of `Table[scroll]`. [#7640](https://github.com/ant-design/ant-design/pull/7640) [@BlackGanglion](https://github.com/BlackGanglion)
## 2.13.2
`2017-09-15`
- 🐞 Fix title and extra content position of narrow Card. [#7604](https://github.com/ant-design/ant-design/issues/7604)
- 🐞 Fix inlineCollapsed style of MenuItemGroup. [#7109](https://github.com/ant-design/ant-design/issues/7109)
- 🐞 Revert [#7142](https://github.com/ant-design/ant-design/issues/7142) to fix empty data style of Table.
- 🐞 Fix Form `getFieldDecoratorOptions` missing types of `normalize` and `validateFirst`. [#7552](https://github.com/ant-design/ant-design/issues/7552) [@meteor91](https://github.com/meteor91) [@mitchelldemler](https://github.com/mitchelldemler)
- 🐞 Fix Modal `zIndex` type. [#7624](https://github.com/ant-design/ant-design/issues/7624)
- 🌟 Improve tree node loading icon position. [#7584](https://github.com/ant-design/ant-design/issues/7584)
- 🌟 Update a lot of components's English doc. [@khalibloo](https://github.com/khalibloo)
## 2.13.1
`2017-09-10`
- 🐞 Fix Card.Grid broken style. [commit/c7d6ce](https://github.com/ant-design/ant-design/commit/c7d6ce5d3f7bfae1f2252d702fb1bdf04fdc80cb)
- 🐞 Fix Cascader overlaping text. [#7475](https://github.com/ant-design/ant-design/issues/7475)
- 🐞 Fix simple mode Pagination prev and next button missing. [#7500](https://github.com/ant-design/ant-design/issues/7500)
- 🐞 Fix Slider typings. [#7532](https://github.com/ant-design/ant-design/issues/7532)
- Table
- 🐞 Fix empty data scroll style. [#7457](https://github.com/ant-design/ant-design/issues/7457) [#7468](https://github.com/ant-design/ant-design/issues/7468) [#7470](https://github.com/ant-design/ant-design/issues/7470) [#7509](https://github.com/ant-design/ant-design/issues/7509)
- 🌟 Make supplement for API docs. [#7525](https://github.com/ant-design/ant-design/pull/7525) [@hansnow](https://github.com/hansnow)
- 🐞 Fix Upload typings. [#7507](https://github.com/ant-design/ant-design/pull/7507) [@WingGao](https://github.com/WingGao)
- 🐞 Fix inlineCollapsed Menu when Submenu is opened. [#7514](https://github.com/ant-design/ant-design/issues/7514)
- 🐞 Fix validateStatus styles of some Form Controls. [#7498](https://github.com/ant-design/ant-design/issues/7498)
- 🐞 Fix @link-hover-decoration not working. [#7531](https://github.com/ant-design/ant-design/issues/7531)
- 🌟 Optimize the English documentation of some components. [@khalibloo](https://github.com/khalibloo)
## 2.13.0
`2017-09-01`
- 🌟 Add `okType` and `cancelType` prop to Popconfirm and Modal and it's related methods. [#6848](https://github.com/ant-design/ant-design/pull/6848) [@yociduo](https://github.com/yociduo)
- 🌟 Add `zIndex` prop to Modal and it's relatedt methos. [#6880](https://github.com/ant-design/ant-design/pull/6880) [@Alex1990](https://github.com/Alex1990)
- 🌟 Add `name` prop to RadioGroup. [#7009](https://github.com/ant-design/ant-design/pull/7009) [@djyde](https://github.com/djyde)
- 🌟 Add `hideDefaultSelections` props to Table. [#7295](https://github.com/ant-design/ant-design/issues/7295)
- Dropdown
- 🌟 Add `disabled` prop. [#7102](https://github.com/ant-design/ant-design/pull/7102) [@yociduo](https://github.com/yociduo)
- 🌟 Menu can not be selected defaultly now.
- 🌟 Add a third parameter `originalElement` to Pagination's `itemRender`.
- 🌟 Add `backfill` prop to AutoComplete, items are selected by keyborad will be backfilled to the search input. [#5764](https://github.com/ant-design/ant-design/issues/5764)
- 🌟 Add `firstActiveValue` prop to Select to allow specify active item when open select first time. [#6318](https://github.com/ant-design/ant-design/issues/6318) [@L-x-C](https://github.com/ant-design/ant-design/issues/6318)
- LocaleProvider
- 🌟 Add Persian. [#6878](https://github.com/ant-design/ant-design/pull/6878) [@mkermani144](https://github.com/mkermani144)
- 🌟 Add Greek. [#6928](https://github.com/ant-design/ant-design/pull/6928) [@michmach](https://github.com/michmach)
- 🌟 Add Norwegian. [#7122](https://github.com/ant-design/ant-design/pull/7122) [@santi](https://github.com/santi)
- 🌟 Add Serbian. [#7201](https://github.com/ant-design/ant-design/pull/7201) [@paunovic-stefan](https://github.com/paunovic-stefan)
- 🐞 Fix Menu's title can not be hidden when collapsing Sider. [#7409](https://github.com/ant-design/ant-design/issues/7409)
- 🐞 Fix some TypeScript type definitions [#7355](https://github.com/ant-design/ant-design/pull/7355) [#7378](https://github.com/ant-design/ant-design/pull/7378) [#7384](https://github.com/ant-design/ant-design/pull/7384)
- 🐞 Fix some components can not use conditional rendering. [#6530](https://github.com/ant-design/ant-design/issues/6530)
- Website
- 🌟 Add a shortcut `s` to focus the search input.
- 🌟 Add a color picker to the footer to change primary color and preview lively.
## 2.12.8
`2017-08-27`
- 📖 Rewrite the [Use in create-react-app](/docs/react/use-with-create-react-app) documentation without ejecting. [#7276](https://github.com/ant-design/ant-design/pull/7276)
- 🌟 Better empty data style for fixed-columns Table. [#7298](https://github.com/ant-design/ant-design/issues/7298)
- 🐞 Fix `disabled` logic of CheckboxGroup and Checkbox. [#7266](https://github.com/ant-design/ant-design/issues/7266) [@dilidili](https://github.com/dilidili)
- 🐞 Fix errors of rendering Spin and Carousel in react-snapshot or other jsdom environment. [#3308](https://github.com/ant-design/ant-design/issues/3308) [#7318](https://github.com/ant-design/ant-design/issues/7318)
- 🐞 Fix some details of Select, Tooltip and Menu.
## 2.12.7
`2017-08-21`
- antd of Angular@4.0, [ng-zorro-antd](https://ng.ant.design) is open sourcing.
- Affix supports more scenes. [01d4acb](https://github.com/ant-design/ant-design/commit/01d4acb7a9b030be3552b4ca19b4e899dc2bb7c7)
- Fix that AutoComplete children ref doesn't work. [#6814](https://github.com/ant-design/ant-design/issues/6814)
- Button
- Improve the logic to insert space in Chinese characters. [59b11f3](https://github.com/ant-design/ant-design/commit/59b11f3b480d43cb32fb24e351cb4c4dd569243c)
- Fix that `event.target` of click is not `button`. [#7034](https://github.com/ant-design/ant-design/issues/7034)
- Fix that Carousel's `innerSlider` doesn't exist. [#7191](https://github.com/ant-design/ant-design/issues/7191)
- Fix the style of button in DatePicker. [ad6dbcb](https://github.com/ant-design/ant-design/commit/ad6dbcb9c6dac407a38f2391d3e5fa1d8ae1cfab)
- Fix TypeScript definition of Form.[#7245](https://github.com/ant-design/ant-design/pull/7245)
- Fix TypeScript definition of InputNumber. [#7257](https://github.com/ant-design/ant-design/issues/7257)
- Fix missing collapse animation of `Layout.Sider` in IE11. [#6349](https://github.com/ant-design/ant-design/issues/6349)
- Fix typo of Spanish locale of LocaleProvider. [#7234](https://github.com/ant-design/ant-design/pull/7234) [@ramsesmoreno](https://github.com/ramsesmoreno)
- Fix that notification's default placement should not be overrided. [#5895](https://github.com/ant-design/ant-design/issues/5895)
- Fix disabled style of button in Pagination. [cf3c0aa](https://github.com/ant-design/ant-design/commit/cf3c0aac43e2825bfd85ca3b8abbf4742e504260)
- Fix that wrong exports of Select which cause webpack build error. [#7222](https://github.com/ant-design/ant-design/issues/7222)
- Fix that Tabs should show arrow buttons while resize its container. [#7231](https://github.com/ant-design/ant-design/issues/7231) [#7210](https://github.com/ant-design/ant-design/issues/7210)
- Fix style of Timeline which has only one `Timeline.Item`. [#7214](https://github.com/ant-design/ant-design/issues/7214)
- Fix wrong behavior of Upload when uid is 0. [#7269](https://github.com/ant-design/ant-design/issues/7269)
## 2.12.6
`2017-08-11`
- Fix Collapse arrow position in IE9/10/11. [af9dc73](https://github.com/ant-design/ant-design/commit/af9dc73eef2aac3e68fdfc99f9231153437f5068)
- Fix empty Table scrollBar's position. [#7142](https://github.com/ant-design/ant-design/issues/7142)
- Fix RangePicker Input's style of height. [47c5de2](https://github.com/ant-design/ant-design/commit/47c5de29f370a77fc19a6a8eda8ac57476f312a6)
- Card
- Improve Card.Grid style of collapse border. [807b573](https://github.com/ant-design/ant-design/commit/807b573bff43bc71115afeb086f565561807a32d)
- Fix the `no-animation` type's className. [#7185](https://github.com/ant-design/ant-design/issues/7185)
- Fix Input Safari text align. [#7135](https://github.com/ant-design/ant-design/issues/7135)
- Layout
- Fix stretched layout by content. [500b222](https://github.com/ant-design/ant-design/commit/500b2225567f03397d9faec5f4e60a8f35fc4d28)
- Fix the collapse trigger's position. [f689ede](https://github.com/ant-design/ant-design/commit/f689ede0fa836dd0d99f4e4d96e0c43d0ff19742)
- Fix Upload doesn't handle some error scenarios which response is not a string. [#6818](https://github.com/ant-design/ant-design/issues/6818)
- Form
- Add `validateFirst` prop of docs. [#6959](https://github.com/ant-design/ant-design/issues/6959)
- Fix `wrappedComponentRef`. [#6545](https://github.com/ant-design/ant-design/issues/6545)
- Add FormCreateOption's generic type. [#7119](https://github.com/ant-design/ant-design/pull/7119) [@djyde](https://github.com/djyde)
- Fix `square` font size to `@form-feedback-icon-size`. [9bcde59](https://github.com/ant-design/ant-design/commit/9bcde590015855a12fdee851cf4e4836d0195cd7)
## 2.12.5
`2017-08-07`
- Fix the `SelectPropTypes not found` issue under es mode. [#7123](https://github.com/ant-design/ant-design/issues/7123)
- Fix Row no wrap issue. [4f73a23](https://github.com/ant-design/ant-design/commit/4f73a23a103733a3c148bb04013493a042f90a8f)
- Fix broken style of InputNumber and RangePicker. [#7117](https://github.com/ant-design/ant-design/issues/7117) [#7126](https://github.com/ant-design/ant-design/issues/7126)
## 2.12.4
`2017-08-06`
- Fix Affix throw invalid calling object in IE. [#7060](https://github.com/ant-design/ant-design/issues/7060)
- Make optimization for title display behavior of Badge. [#7024](https://github.com/ant-design/ant-design/issues/7024)
- Card
- Fix `noHovering` API typo. [#7078](https://github.com/ant-design/ant-design/issues/7078)
- Fix `children` type definitions. [pull/7030](https://github.com/ant-design/ant-design/pull/7030) [@djyde](https://github.com/djyde)
- Fix Collapse `onChange` parameter type definitions. [pull/7084](https://github.com/ant-design/ant-design/pull/7084) [@davidctj](https://github.com/davidctj)
- Dropdown
- Fix Dropdown.Button align issue. [#7070](https://github.com/ant-design/ant-design/issues/7070)
- Add `size` prop for docs. [pull/7071](https://github.com/ant-design/ant-design/pull/7071) [@hansnow](https://github.com/hansnow)
- Input
- Fix outline covered by addon. [commit/0f63c7](https://github.com/ant-design/ant-design/commit/0f63c7186ef3a5db36c01df9d9ebde9d5b3871ef)
- Fix InputGroup demo. [pull/7089](https://github.com/ant-design/ant-design/pull/7089) [@jdz321](https://github.com/jdz321)
- Fix InputNumber Formatter demo issue. [pull/7098](https://github.com/ant-design/ant-design/pull/7098) [@tim-soft](https://github.com/tim-soft)
- Menu
- Fix abnormal performance of inlineCollapsed Menu. [#7048](https://github.com/ant-design/ant-design/issues/7048) [#7063](https://github.com/ant-design/ant-design/issues/7063)
- Fix SubMenu can't be highlighted if its children are selected. [pull/7042](https://github.com/ant-design/ant-design/pull/7042) [@atomgao](https://github.com/atomgao)
- Fix notification `type` type definitions. [#7073](https://github.com/ant-design/ant-design/issues/7073) [@marswong](https://github.com/marswong)
- Fix Pagination `showTotal` type definitions. [#7054](https://github.com/ant-design/ant-design/issues/7054)
- Fix RangePicker throw error after clear. [#7077](https://github.com/ant-design/ant-design/issues/7077)
- Adds `onFocus` and `onBlur` type definitions for Select. [pull/7082](https://github.com/ant-design/ant-design/pull/7082) [@troynt](https://github.com/troynt)
- Fix Tabs `tabBarExtraContent` style issue in vertical mode. Upgrade rc-tabs to 9.0.2, refactor the dom structure of TabBar `extraContent`. [#6578](https://github.com/ant-design/ant-design/issues/6578)
- Fix missing icon issue for TreeSelect. [#7020](https://github.com/ant-design/ant-design/issues/7020)
- Fix `error TS7016: Could not find a declaration file for module 'rc-util/lib/Dom/addEventListener'`. [#7033](https://github.com/ant-design/ant-design/issues/7033) [@djyde](https://github.com/djyde)
- Translate patterns/list. [list](https://ant.design/docs/pattern/list) [@zachguo](https://github.com/zachguo)
## 2.12.3
`2017-07-30`
- Fix indeterminate Checkbox style when it's disabled.
- Fix Card `this.container` may not exists issue. [#6976](https://github.com/ant-design/ant-design/pull/6976) [@neekey](https://github.com/neekey)
- Fix Button align issue when set base font to `14px`. [#7001](https://github.com/ant-design/ant-design/issues/7001)
- Dropdown
- Fix Menu can be multiple cicked. [#6314](https://github.com/ant-design/ant-design/issues/6314)
- Fix Menu dispears if it's hovered before it's shown. [#6949](https://github.com/ant-design/ant-design/issues/6949)
- Fix align issue.
- Fix Grid Card padding.
- Improve Menu animation.[#6955](https://github.com/ant-design/ant-design/pull/6955)
- Twrak DatePicker icon position.
- Add new less variables.[e1a46cc](https://github.com/ant-design/ant-design/commit/e1a46cc419fb4975ae1782ba793b378c8e584057)
- Fix some issues of TypeScript definitions.
## 2.12.2
`2017-07-22`
@@ -68,7 +271,7 @@ If you want to read change logs before `2.0.0`, please visit [GitHub](https://gi
- Add Input.Textarea, Input[type='textArea'] will be deprecated. [pull/6138](https://github.com/ant-design/ant-design/pull/6138)
- LocaleProvider supporting Thai. [pull/6721](https://github.com/ant-design/ant-design/pull/6721) [@koobitor](https://github.com/koobitor)
- Mention support `focus` function. [#6135](https://github.com/ant-design/ant-design/issues/6135)
- Menu[mode='inline'] could be collapsed, and use `context` to pass `collapsed` prop from Layout.Sider to Menu, don't need customized css code anymore. [pull/6686](https://github.com/ant-design/ant-design/pull/6686)
- Menu inline mode could be collapsed by `inlineCollapsed`, and use `context` to pass `collapsed` prop from Layout.Sider to Menu, don't need customized css code anymore. [pull/6686](https://github.com/ant-design/ant-design/pull/6686)
- Add Pagination `itemRender`, now you can customize the structure of page number. [25a603](https://github.com/ant-design/ant-design/commit/25a60322e5c6649522fb9f0d34919eba0ccb1f65)
- Add Tooltip `autoAdjustOverflow` prop, now the auto adjust feature can be disabled. [pull/6661](https://github.com/ant-design/ant-design/pull/6661) [@jdz321](https://github.com/jdz321)
- Fix errors in docs of Avatar. [pull/6711](https://github.com/ant-design/ant-design/pull/6711) [@llaski](https://github.com/llaski)
@@ -83,7 +286,7 @@ If you want to read change logs before `2.0.0`, please visit [GitHub](https://gi
- Fix Select overflow issue. [#6621](https://github.com/ant-design/ant-design/issues/6621)
- Slider
- Improve styles. [#6665](https://github.com/ant-design/ant-design/issues/6665)
- Upgrade rc-slider to 8.2.0, add `dotStyle``activeDotStyle` props. [rc-slider/pull/292](https://github.com/react-component/slider/pull/292)
- Upgrade rc-slider to 8.2.0, add `dotStyle`, `activeDotStyle` props. [rc-slider/pull/292](https://github.com/react-component/slider/pull/292)
- Fix Spin z-index issue. [#6759](https://github.com/ant-design/ant-design/issues/6759)
- Fix nested Steps style issue. [#6754](https://github.com/ant-design/ant-design/issues/6754)
- Table
@@ -92,7 +295,7 @@ If you want to read change logs before `2.0.0`, please visit [GitHub](https://gi
- Make supplement for `loading` docs. [pull/6763](https://github.com/ant-design/ant-design/pull/6763) [@hansnow](https://github.com/hansnow)
- Upgrade rc-table to 5.4.0, support `onRowMouseEnter` and `onRowMouseLeave`. [rc-table/0db582](https://github.com/react-component/table/commit/0db582a75dfa119715eb4db8a59eacfca744c5a0)
- Improve TimePicker format support. [950c32](https://github.com/ant-design/ant-design/commit/950c321b25091ef31b130b83674478974590d7f3)
- Make style improvement or tweaking for many components, includes [Checkbox](https://ant.design/components/checkbox/)[Radio](https://ant.design/components/radio/)[Tabs](https://ant.design/components/tabs/)[Card](https://ant.design/components/card/) and etc.
- Make style improvement or tweaking for many components, includes [Checkbox](https://ant.design/components/checkbox/), [Radio](https://ant.design/components/radio/), [Tabs](https://ant.design/components/tabs/), [Card](https://ant.design/components/card/) and etc.
- Now you can open demo in codepen. [#5140](https://github.com/ant-design/ant-design/issues/5140)
## 2.11.2
@@ -484,7 +687,7 @@ If you want to read change logs before `2.0.0`, please visit [GitHub](https://gi
- Fix that `Cannot find module '../../package.json'` error. [#4935](https://github.com/ant-design/ant-design/issues/4935)
- Fix definitions of Table, RangePicker and Upload.
- Fix lack of event argument for Modal `onOk` `afterClose` and Popconfirm `onConfirm` `onCancel`. [#4787](https://github.com/ant-design/ant-design/issues/4787)
- Improve animation of Menu[inline] and Collapse.
- Improve animation of Menu inline mode and Collapse.
- Improve Checkbox and Radio vertical align style.
- Table
- Fix misplace header when fix column. [#4936](https://github.com/ant-design/ant-design/issues/4936)
@@ -608,7 +811,7 @@ If you want to read change logs before `2.0.0`, please visit [GitHub](https://gi
* Fixed Badge misplace issue when browser zoom above 100%. [#4747](https://github.com/ant-design/ant-design/issues/4747) [#4290](https://github.com/ant-design/ant-design/issues/4290)
* Fixed a mis-align issue of fixed header Table. [#4750](https://github.com/ant-design/ant-design/issues/4750)
* Fixed Table scrolling lag issue in IE. [#4522](https://github.com/ant-design/ant-design/issues/4522)
* Add icon aliases: `addfile` => `file-add``addfolder` => `folder-open`, and the old type names are still working. [#4758](https://github.com/ant-design/ant-design/issues/4758)
* Add icon aliases: `addfile` => `file-add`, `addfolder` => `folder-open`, and the old type names are still working. [#4758](https://github.com/ant-design/ant-design/issues/4758)
## 2.6.4

View File

@@ -17,6 +17,208 @@ timeline: true
---
## 2.13.4
`2017-09-29`
- 🐞 修复 Pagination 小号样式失效的问题。
- 🐞 修复 Anchor 的样式错位。[#7712](https://github.com/ant-design/ant-design/issues/7712)
- 🐞 修复 TreeSelect 搜索框下多余文字的问题。[#7703](https://github.com/ant-design/ant-design/issues/7703)
- 🐞 修复 Form 校验文字跳动的问题。[#7730](https://github.com/ant-design/ant-design/issues/7730)
- 🐞 修复各类型 Button Group 的 loading 样式。 [#7709](https://github.com/ant-design/ant-design/issues/7709)
- 🐞 修复 placeholder 文本在某些情况下无法看清的问题。[#7365](https://github.com/ant-design/ant-design/issues/7365)
- 🐞 修复一个 Mention 的 `suggestion.toLowerCase is not a function` 报错问题。 [#7696](https://github.com/ant-design/ant-design/issues/7696) [@kappa-gooner](https://github.com/kappa-gooner)
- 🐞 修复一个 Layout.Sider 子元素的高度问题。[#7716](https://github.com/ant-design/ant-design/pull/7716) [@zheeeng](https://github.com/zheeeng)
- 🐞 修复 Dropdown 菜单分组的样式。
- 🐞 修复 Table 筛选图标和菜单样式错位。
- 🐞 修复一个 AutoComplete 在 Inferno 下循环引用的问题。[#7742](https://github.com/ant-design/ant-design/pull/7742) [@menberg](https://github.com/menberg)
- 🐞 修复 Upload 使用 `beforeUpload` 验证文件类型失败后无法再次上传的问题。[#7762](https://github.com/ant-design/ant-design/issues/7762) [#6983](https://github.com/ant-design/ant-design/issues/6983)
- TypeScript
- 🐞 修复 Input 的 `maxLength` 定义。[#7744](https://github.com/ant-design/ant-design/pull/7744) [@delesseps](https://github.com/delesseps)
- 🐞 修复 DatePicker 等组件的 `disabledTime` 的返回值定义。[#7740](https://github.com/ant-design/ant-design/pull/7740) [@778758944](https://github.com/778758944)
## 2.13.3
`2017-09-22`
- 🐞 修复 Affix 在内容与视口高度差小于 children 高度时触发的滚动抖动问题。[#2349](https://github.com/ant-design/ant-design/issues/2349)
- 🐞 修复 `Card[title]` 为空且设置 `Card[extra]` 时样式错乱的问题。[f46112d#commitcomment-24480417](https://github.com/ant-design/ant-design/commit/f46112d38561c89780eb44ecbba82347d2b912da#commitcomment-24480417)
- 🐞 修复 `Checkbox[children]` TypeScript definition。[#7650](https://github.com/ant-design/ant-design/issues/7650) [@liaokaien](https://github.com/liaokaien)
- 🐞 修复 `getFieldDecorator` 内使用嵌套 id 后点击 `Form.Item` label 报错的问题。[#7693](https://github.com/ant-design/ant-design/issues/7693)
- Input
- 🐞 修复 `Input.Group[compat]` 内嵌 `Select` 等控件时的样式问题。[#7662](https://github.com/ant-design/ant-design/issues/7662)
- 🐞 优化 `Input[autoComplete]` TypeScript 定义。[#7699](https://github.com/ant-design/ant-design/pull/7699) [@delesseps](https://github.com/delesseps)
- LocaleProvider
- 🇵🇹 新增葡萄牙语。[#7449](https://github.com/ant-design/ant-design/pull/7449) [@taviroquai](https://github.com/taviroquai)
- 🐞 修复荷兰语 locale 缺少文案的问题。[#7694](https://github.com/ant-design/ant-design/pull/7694) [@kstiopin](https://github.com/kstiopin)
- Table
- 🐞 修复 `rowSelection` 导致的表头高度问题。[#7663](https://github.com/ant-design/ant-design/issues/7663)
- 🐞 修复使用 `rowSelection.hideDefaultselections` 时导致自定义选项点击没反应的问题。[#7626](https://github.com/ant-design/ant-design/issues/7626) [@infeng](https://github.com/infeng)
- 🐞 优化 `Table[scroll]` TypeScript definition。[#7640](https://github.com/ant-design/ant-design/pull/7640) [@BlackGanglion](https://github.com/BlackGanglion)
## 2.13.2
`2017-09-15`
- 🐞 修复了 Card Extra 内容过多样式错乱的问题。[#7604](https://github.com/ant-design/ant-design/issues/7604)
- 🐞 修复了分组 Menu 收缩时的错位问题。[#7109](https://github.com/ant-design/ant-design/issues/7109)
- 🐞 回滚 [#7142](https://github.com/ant-design/ant-design/issues/7142) 里对固定列表格空数据的样式优化,修复带来的一系列样式问题。
- 🐞 修复了 Form `getFieldDecoratorOptions` 缺失 `normalize` 以及 `validateFirst` 属性定义的问题。[#7552](https://github.com/ant-design/ant-design/issues/7552) [@meteor91](https://github.com/meteor91) [@mitchelldemler](https://github.com/mitchelldemler)
- 🐞 修复了 Modal 的 `zIndex` 属性定义。[#7624](https://github.com/ant-design/ant-design/issues/7624)
- 🌟 优化了 Tree 加载中图标的显示位置。[#7584](https://github.com/ant-design/ant-design/issues/7584)
- 🌟 优化了大量组件的英文文档。[@khalibloo](https://github.com/khalibloo)
## 2.13.1
`2017-09-10`
- 🐞 修复了 Card.Grid 的样式问题。[commit/c7d6ce](https://github.com/ant-design/ant-design/commit/c7d6ce5d3f7bfae1f2252d702fb1bdf04fdc80cb)
- 🐞 修复了 Cascader 指针图标与文字重叠的问题。[#7475](https://github.com/ant-design/ant-design/issues/7475)
- 🐞 修复了 Pagination 在简洁模式下前后按钮未展示的问题。[#7500](https://github.com/ant-design/ant-design/issues/7500)
- 🐞 修复了 Slider 的 type 定义。[#7532](https://github.com/ant-design/ant-design/issues/7532)
- Table
- 🐞 修复了在空数据情况下包含固定列时的一些样式问题。[#7457](https://github.com/ant-design/ant-design/issues/7457) [#7468](https://github.com/ant-design/ant-design/issues/7468) [#7470](https://github.com/ant-design/ant-design/issues/7470) [#7509](https://github.com/ant-design/ant-design/issues/7509)
- 🌟 补充了 API 文档。[#7525](https://github.com/ant-design/ant-design/pull/7525) [@hansnow](https://github.com/hansnow)
- 🐞 修复了 Upload 的 type 定义。 [#7507](https://github.com/ant-design/ant-design/pull/7507) [@WingGao](https://github.com/WingGao)
- 🐞 修复了 Submenu 展开时 inlineCollapsed Menu 的样式问题。[#7514](https://github.com/ant-design/ant-design/issues/7514)
- 🐞 修复了一些表单控件的校验样式问题。[#7498](https://github.com/ant-design/ant-design/issues/7498)
- 🐞 修复了 @link-hover-decoration 无效的问题。[#7531](https://github.com/ant-design/ant-design/issues/7531)
- 🌟 优化了部分组件的英文文档。[@khalibloo](https://github.com/khalibloo)
## 2.13.0
`2017-09-01`
- 🌟 Popconfirm 和 Modal 及其相关方法新增 `okType``cancelType` 用以指定按钮类型。[#6848](https://github.com/ant-design/ant-design/pull/6848) [@yociduo](https://github.com/yociduo)
- 🌟 Modal 及其相关方法新增 `zIndex`。[#6880](https://github.com/ant-design/ant-design/pull/6880) [@Alex1990](https://github.com/Alex1990)
- 🌟 RadioGroup 新增 `name` 属性。[#7009](https://github.com/ant-design/ant-design/pull/7009) [@djyde](https://github.com/djyde)
- 🌟 Table 新增 `hideDefaultSelections` 属性。[#7295](https://github.com/ant-design/ant-design/issues/7295)
- Dropdown
- 🌟 新增 `disabled` 属性。[#7102](https://github.com/ant-design/ant-design/pull/7102) [@yociduo](https://github.com/yociduo)
- 🌟 Menu 默认调整为不能选中。
- 🌟 Pagination 的 `itemRender` 新增第三个参数 `originalElement`
- 🌟 AutoComplete 新增 `backfill` 属性,键盘选择时能回填选中项到输入框中。[#5764](https://github.com/ant-design/ant-design/issues/5764)
- 🌟 Select 新增 `firstActiveValue` 属性,允许指定首次打开时默认选中的项。[#6318](https://github.com/ant-design/ant-design/issues/6318) [@L-x-C](https://github.com/ant-design/ant-design/issues/6318)
- LocaleProvider
- 🌟 新增波斯语。[#6878](https://github.com/ant-design/ant-design/pull/6878) [@mkermani144](https://github.com/mkermani144)
- 🌟 新增希腊语。[#6928](https://github.com/ant-design/ant-design/pull/6928) [@michmach](https://github.com/michmach)
- 🌟 新增挪威语。[#7122](https://github.com/ant-design/ant-design/pull/7122) [@santi](https://github.com/santi)
- 🌟 新增塞尔维亚语。[#7201](https://github.com/ant-design/ant-design/pull/7201) [@paunovic-stefan](https://github.com/paunovic-stefan)
- 🐞 修复 Sider 隐藏时 Menu 的标题不会隐藏的问题。[#7409](https://github.com/ant-design/ant-design/issues/7409)
- 🐞 修复 TypeScript 定义 [#7355](https://github.com/ant-design/ant-design/pull/7355) [#7378](https://github.com/ant-design/ant-design/pull/7378) [#7384](https://github.com/ant-design/ant-design/pull/7384)
- 🐞 修复一些组件不能使用条件渲染的问题。[#6530](https://github.com/ant-design/ant-design/issues/6530)
- 网站
- 🌟 新增快捷键 `s` 聚焦搜索框。
- 🌟 页脚新增主色修改预览功能。
## 2.12.8
`2017-08-27`
- 📖 重写了 [《在 create-react-app 中使用》](/docs/react/use-with-create-react-app) 文档,现在不再需要 eject。[#7276](https://github.com/ant-design/ant-design/pull/7276)
- 🌟 优化了固定列的空表格样式。[#7298](https://github.com/ant-design/ant-design/issues/7298)
- 🐞 修复了 CheckboxGroup 和 Checkbox 的 `disabled` 属性逻辑。[#7266](https://github.com/ant-design/ant-design/issues/7266) [@dilidili](https://github.com/dilidili)
- 🐞 修复在 react-snapshot 或 jsdom 环境下测试 Spin 和 Carousel 时报错的问题。[#3308](https://github.com/ant-design/ant-design/issues/3308) [#7318](https://github.com/ant-design/ant-design/issues/7318)
- 🐞 修复 Select、Tooltip、Menu 的一些细节样式问题。
## 2.12.7
`2017-08-21`
- Angular@4.0 版 antd [ng-zorro-antd](https://ng.ant.design) 开源。
- 优化 Affix 支持的场景。[01d4acb](https://github.com/ant-design/ant-design/commit/01d4acb7a9b030be3552b4ca19b4e899dc2bb7c7)
- 修复 AutoComplete children ref 失效的问题。[#6814](https://github.com/ant-design/ant-design/issues/6814)
- Button
- 优化自动在中文字符中间插入空格的逻辑。[59b11f3](https://github.com/ant-design/ant-design/commit/59b11f3b480d43cb32fb24e351cb4c4dd569243c)
- 修复点击事件的 `event.target` 不是 button 的问题。[#7034](https://github.com/ant-design/ant-design/issues/7034)
- 修复 Carousel 的 `innerSlider` 引用问题。[#7191](https://github.com/ant-design/ant-design/issues/7191)
- 修复 DatePicker 中的按钮样式。[ad6dbcb](https://github.com/ant-design/ant-design/commit/ad6dbcb9c6dac407a38f2391d3e5fa1d8ae1cfab)
- 修复 Form TypeScript definition。[#7245](https://github.com/ant-design/ant-design/pull/7245)
- 修复 InputNumber 的 TypeScript definition。[#7257](https://github.com/ant-design/ant-design/issues/7257)
- 修复 `Layout.Sider` 在 IE11 下没有折叠动画的问题。[#6349](https://github.com/ant-design/ant-design/issues/6349)
- 修复 LocaleProvider 西班牙语的拼写问题。[#7234](https://github.com/ant-design/ant-design/pull/7234) [@ramsesmoreno](https://github.com/ramsesmoreno)
- 修复 notification 默认 placement 会被覆盖的问题。[#5895](https://github.com/ant-design/ant-design/issues/5895)
- 修复 Pagination 按钮的 disabled 样式。[cf3c0aa](https://github.com/ant-design/ant-design/commit/cf3c0aac43e2825bfd85ca3b8abbf4742e504260)
- 修复 Select exports 导致的 webpack 构建错误的问题。[#7222](https://github.com/ant-design/ant-design/issues/7222)
- 修复 Tabs 在父容器宽度动态变化时切换按钮没有出现的问题。[#7231](https://github.com/ant-design/ant-design/issues/7231) [#7210](https://github.com/ant-design/ant-design/issues/7210)
- 修复 Timeline 在只有一个 `Timeline.Item` 时的样式问题。[#7214](https://github.com/ant-design/ant-design/issues/7214)
- 修复 Upload 在 uid 为 0 时的错误行为。[#7269](https://github.com/ant-design/ant-design/issues/7269)
## 2.12.6
`2017-08-11`
- 修复了在 IE9/10/11 下 Collapse 的箭头位置不正确的问题。[af9dc73](https://github.com/ant-design/ant-design/commit/af9dc73eef2aac3e68fdfc99f9231153437f5068)
- 修复了 Table 为空表格时滚动条展示位置不正确的问题。[#7142](https://github.com/ant-design/ant-design/issues/7142)
- 修复了 RangePicker Input 的高度。[47c5de2](https://github.com/ant-design/ant-design/commit/47c5de29f370a77fc19a6a8eda8ac57476f312a6)
- Card
- 优化了 Card.Grid 边框覆盖的样式。[807b573](https://github.com/ant-design/ant-design/commit/807b573bff43bc71115afeb086f565561807a32d)
- 修复了对应 `no-animation` 类型的 className。[#7185](https://github.com/ant-design/ant-design/issues/7185)
- 修复了 Input Safari 下文本对齐的问题。[#7135](https://github.com/ant-design/ant-design/issues/7135)
- Layout
- 修复了组件的拉伸展示问题。[500b222](https://github.com/ant-design/ant-design/commit/500b2225567f03397d9faec5f4e60a8f35fc4d28)
- 修复了折叠箭头的位置。[f689ede](https://github.com/ant-design/ant-design/commit/f689ede0fa836dd0d99f4e4d96e0c43d0ff19742)
- 修复了 Upload 的 response 不是 string 的情况下没有处理错误提示信息的问题。[#6818](https://github.com/ant-design/ant-design/issues/6818)
- Form
- 补充了文档中缺少的 `validateFirst` 属性描述。[#6959](https://github.com/ant-design/ant-design/issues/6959)
- 修复了 `wrappedComponentRef`。[#6545](https://github.com/ant-design/ant-design/issues/6545)
- 补充了 FormCreateOption 的 `generic type`。[#7119](https://github.com/ant-design/ant-design/pull/7119) [@djyde](https://github.com/djyde)
- 修改了 `square` 的字体大小为 `@form-feedback-icon-size`。[9bcde59](https://github.com/ant-design/ant-design/commit/9bcde590015855a12fdee851cf4e4836d0195cd7)
## 2.12.5
`2017-08-07`
- 修复 ES 模式下`SelectPropTypes not found` 的问题。[#7123](https://github.com/ant-design/ant-design/issues/7123)
- 修复 Row 在 flex 模式下元素不换行的问题。[4f73a23](https://github.com/ant-design/ant-design/commit/4f73a23a103733a3c148bb04013493a042f90a8f)
- 修复 InputNumber 和 RangePicker 的样式问题。[#7117](https://github.com/ant-design/ant-design/issues/7117) [#7126](https://github.com/ant-design/ant-design/issues/7126)
## 2.12.4
`2017-08-06`
- 修复了 Affix 在 IE 下调用对象无效的报错。[#7060](https://github.com/ant-design/ant-design/issues/7060)
- 对 Badge 默认 title 的出现条件进行了优化。[#7024](https://github.com/ant-design/ant-design/issues/7024)
- Card
- 修改了文档中 `onHovering` 属性的错误描述。[#7078](https://github.com/ant-design/ant-design/issues/7078)
- 修复了 `children` 的类型定义。[pull/7030](https://github.com/ant-design/ant-design/pull/7030) [@djyde](https://github.com/djyde)
- 修复了 Collapse `onChange` 属性参数的类型定义。[pull/7084](https://github.com/ant-design/ant-design/pull/7084) [@davidctj](https://github.com/davidctj)
- Dropdown
- 修复了 Dropdown.Button 的对齐问题。[#7070](https://github.com/ant-design/ant-design/issues/7070)
- 补充了文档中缺失的 `size` 属性。[pull/7071](https://github.com/ant-design/ant-design/pull/7071) [@hansnow](https://github.com/hansnow)
- Input
- 修复了 outline 被 addon 遮盖的问题。[commit/0f63c7](https://github.com/ant-design/ant-design/commit/0f63c7186ef3a5db36c01df9d9ebde9d5b3871ef)
- 修复了 InputGroup 的示例问题。[pull/7089](https://github.com/ant-design/ant-design/pull/7089) [@jdz321](https://github.com/jdz321)
- 修复了 InputNumber 格式化示例的报错问题。[pull/7098](https://github.com/ant-design/ant-design/pull/7098) [@tim-soft](https://github.com/tim-soft)
- Menu
- 修复了 Menu 折叠并缩起时的不正常表现。[#7048](https://github.com/ant-design/ant-design/issues/7048) [#7063](https://github.com/ant-design/ant-design/issues/7063)
- 修复了子菜单被选中时 SubMenu 没有高亮的问题。[pull/7042](https://github.com/ant-design/ant-design/pull/7042) [@atomgao](https://github.com/atomgao)
- 修复了 notification `type` 的类型定义。[#7073](https://github.com/ant-design/ant-design/issues/7073) [@marswong](https://github.com/marswong)
- 修复了 Pagination `showTotal` 的类型定义。[#7054](https://github.com/ant-design/ant-design/issues/7054)
- 修复了 RangePicker 在清空后的报错问题。[#7077](https://github.com/ant-design/ant-design/issues/7077)
- 补充了 Select 缺失的 `onFocus` `onBlur` 类型定义。[pull/7082](https://github.com/ant-design/ant-design/pull/7082) [@troynt](https://github.com/troynt)
- 修复了 Tabs 垂直模式下 `tabBarExtraContent` 样式错乱的问题。rc-tabs 升级到 9.0.2,对 TabBar 的 `extraContent` 的结构进行了重构。[#6578](https://github.com/ant-design/ant-design/issues/6578)
- 修复了 TreeSelect 图标不能正常展示的问题。[#7020](https://github.com/ant-design/ant-design/issues/7020)
- 修复了 `error TS7016: Could not find a declaration file for module 'rc-util/lib/Dom/addEventListener'` 的报错。[#7033](https://github.com/ant-design/ant-design/issues/7033) [@djyde](https://github.com/djyde)
- 完成了『模式-列表』的文档翻译。[list](https://ant.design/docs/pattern/list) [@zachguo](https://github.com/zachguo)
## 2.12.3
`2017-07-30`
- 修复 Checkbox 半选状态禁用时的样式。
- 修复 Card 会出现 `this.container` 不存在的问题。[#6976](https://github.com/ant-design/ant-design/pull/6976) [@neekey](https://github.com/neekey)
- 修复基础字体改为 `14px` 时 Button 的对齐问题。[#7001](https://github.com/ant-design/ant-design/issues/7001)
- 修复 Grid Card 的内边距。
- Dropdown
- 修复菜单可能被多次点击的问题。[#6314](https://github.com/ant-design/ant-design/issues/6314)
- 修复在菜单显示前 hover 会导致菜单消失的问题。[#6949](https://github.com/ant-design/ant-design/issues/6949)
- 修复菜单的错位问题。
- 改进了 Menu 的动画效果。[#6955](https://github.com/ant-design/ant-design/pull/6955)
- 调整了 DatePicker 中图标的位置。
- 新增 less 变量。[e1a46cc](https://github.com/ant-design/ant-design/commit/e1a46cc419fb4975ae1782ba793b378c8e584057)
- 修复了一些 TypeScript 定义问题。
## 2.12.2
`2017-07-22`
@@ -68,7 +270,7 @@ timeline: true
- 新增 Input.TextArea原 Input[type='textArea'] 将被废弃。[pull/6138](https://github.com/ant-design/ant-design/pull/6138)
- LocaleProvider 新增泰语支持。[pull/6721](https://github.com/ant-design/ant-design/pull/6721) [@koobitor](https://github.com/koobitor)
- Mention 支持 `focus` 方法。[#6135](https://github.com/ant-design/ant-design/issues/6135)
- Menu[mode='inline'] 支持缩起/展开,同时 Layout.Sider 使用 `context` 向 Menu 传递 `collapsed` 属性,无需再自己定制样式。[pull/6686](https://github.com/ant-design/ant-design/pull/6686)
- Menu `inline` 模式下支持用 `inlineCollapsed` 属性缩起/展开,同时 Layout.Sider 使用 `context` 向 Menu 传递 `collapsed` 属性,无需再自己定制样式。[pull/6686](https://github.com/ant-design/ant-design/pull/6686)
- 新增 Pagination `itemRender` 属性,用于自定义页码的结构。[25a603](https://github.com/ant-design/ant-design/commit/25a60322e5c6649522fb9f0d34919eba0ccb1f65)
- 新增 Tooltip `autoAdjustOverflow` 属性,支持关闭自动调整位置的功能。[pull/6661](https://github.com/ant-design/ant-design/pull/6661) [@jdz321](https://github.com/jdz321)
- 修复了 Avatar 错误的文档。[pull/6711](https://github.com/ant-design/ant-design/pull/6711) [@llaski](https://github.com/llaski)
@@ -483,7 +685,7 @@ timeline: true
- 修复 `Cannot find module '../../package.json'` 的问题。[#4935](https://github.com/ant-design/ant-design/issues/4935)
- 补充了 Table、RangePicker 和 Upload 的部分属性定义。
- 修复了 Modal `onOk` `afterClose` 和 Popconfirm `onConfirm` `onCancel` 缺少点击 event 参数的问题。 [#4787](https://github.com/ant-design/ant-design/issues/4787)
- 优化 Menu[inline] 和 Collapse 的折叠动画效果。
- 优化 Menu inline 模式和 Collapse 的折叠动画效果。
- 优化了 Checkbox 和 Radio 的垂直对齐样式。
- Table
- 修复固定列时列头样式错位的问题。[#4936](https://github.com/ant-design/ant-design/issues/4936)

View File

@@ -56,7 +56,7 @@ ReactDOM.render(<DatePicker />, mountNode);
import 'antd/dist/antd.css'; // or 'antd/dist/antd.less'
```
按需加载可通过此写法 `import DatePicker from 'antd/lib/date-picker'` 或使用插件 [babel-plugin-import](https://github.com/ant-design/babel-plugin-import)。
按需加载可通过此写法 `import DatePicker from 'antd/lib/date-picker'` 或使用 Babel 插件 [babel-plugin-import](https://github.com/ant-design/babel-plugin-import),或使用 TypeScript 插件 [ts-import-plugin](https://github.com/Brooooooklyn/ts-import-plugin)
## TypeScript

View File

@@ -35,7 +35,7 @@ An enterprise-class UI design language and React-based implementation.
## Let's build a better antd together [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](http://makeapullrequest.com)
`antd` is an open source project, improvements are welcomed. If you are interested in contributing to `antd`, you can watch this repository, join in [discussion](https://github.com/ant-design/ant-design/issues?q=is%3Aopen+is%3Aissue+label%3ADiscussion), or try to implement some [features which have been accepted](https://github.com/ant-design/ant-design/issues?q=is%3Aopen+is%3Aissue+label%3A%22PR+welcome%22). Actually, there are [many ways](https://opensource.guide/how-to-contribute/) to contribute. And we are always happy to [offer collaborator permission](https://github.com/ant-design/ant-design/issues/3222) for some active contributors.
`antd` is an open source project; improvements are welcomed. If you are interested in contributing to `antd`, you can watch this repository, join in [discussion](https://github.com/ant-design/ant-design/issues?q=is%3Aopen+is%3Aissue+label%3ADiscussion), or try to implement some [features which have been accepted](https://github.com/ant-design/ant-design/issues?q=is%3Aopen+is%3Aissue+label%3A%22PR+welcome%22). Actually, there are [many ways](https://opensource.guide/how-to-contribute/) to contribute. And we are always happy to [offer collaborator permission](https://github.com/ant-design/ant-design/issues/3222) for some active contributors.
## Install
@@ -58,7 +58,15 @@ import 'antd/dist/antd.css'; // or 'antd/dist/antd.less'
### Use modularized antd
- Use [babel-plugin-import](https://github.com/ant-design/babel-plugin-import) (Recommended)
- Manually import
```jsx
import DatePicker from 'antd/lib/date-picker'; // for js
import 'antd/lib/date-picker/style/css'; // for css
// import 'antd/lib/date-picker/style'; // that will import less
```
- Use [babel-plugin-import](https://github.com/ant-design/babel-plugin-import)
```js
// .babelrc or babel-loader option
@@ -76,14 +84,6 @@ import 'antd/dist/antd.css'; // or 'antd/dist/antd.less'
import { DatePicker } from 'antd';
```
- Manually import
```jsx
import DatePicker from 'antd/lib/date-picker'; // for js
import 'antd/lib/date-picker/style/css'; // for css
// import 'antd/lib/date-picker/style'; // that will import less
```
### TypeScript
```js
@@ -101,6 +101,19 @@ import 'antd/dist/antd.css'; // or 'antd/dist/antd.less'
> - set `allowSyntheticDefaultImports` to prevent `error TS1192: Module 'react' has no default export`.
> - Don't use @types/antd, antd provide a built-in ts definition already.
#### Use [ts-import-plugin](https://github.com/Brooooooklyn/ts-import-plugin) with modularized antd
```js
{
loader: "ts-loader", // or awesome-typescript-loader
options {
getCustomTransformers: () => ({
before: [ tsImportPluginFactory({ libraryName: "antd", style: "css" }) ]
})
}
}
```
## Internationalization
See [i18n](http://ant.design/docs/react/i18n).
@@ -135,4 +148,4 @@ Open your browser and visit http://127.0.0.1:8001 , see more at https://github.c
## Contributing
We welcome all contributions, please read our [CONTRIBUTING.md](https://github.com/ant-design/ant-design/blob/master/.github/CONTRIBUTING.md) first. You can submit any ideas as [pull requests](https://github.com/ant-design/ant-design/pulls) or as [GitHub issues](https://github.com/ant-design/ant-design/issues). If you'd like to improve code, check out the [Development Instructions](https://github.com/ant-design/ant-design/wiki/Development) and have a good time! :)
We welcome all contributions. Please read our [CONTRIBUTING.md](https://github.com/ant-design/ant-design/blob/master/.github/CONTRIBUTING.md) first. You can submit any ideas as [pull requests](https://github.com/ant-design/ant-design/pulls) or as [GitHub issues](https://github.com/ant-design/ant-design/issues). If you'd like to improve code, check out the [Development Instructions](https://github.com/ant-design/ant-design/wiki/Development) and have a good time! :)

View File

@@ -16,7 +16,8 @@ export default function getRequestAnimationFrame() {
return () => {};
}
if (window.requestAnimationFrame) {
return window.requestAnimationFrame;
// https://github.com/vuejs/vue/issues/4465
return window.requestAnimationFrame.bind(window);
}
const prefix = availablePrefixs.filter(key => `${key}RequestAnimationFrame` in window)[0];

View File

@@ -4,7 +4,7 @@ type: Navigation
title: Affix
---
Make an element sticky to viewport.
Make an element stick to viewport.
## When To Use
@@ -19,7 +19,7 @@ Please note that Affix should not cover other content on the page, especially wh
| offsetTop | Pixels to offset from top when calculating position of scroll | number | 0 |
| offsetBottom | Pixels to offset from bottom when calculating position of scroll | number | - |
| target | specifies the scrollable area dom node | () => HTMLElement | () => window |
| onChange | Callback when affix state is changed | Function(affixed) | - |
| onChange | Callback for when affix state is changed | Function(affixed) | - |
**Note:** Children of `Affix` can not be `position: absolute`, but you can set `Affix` as `position: absolute`:

View File

@@ -73,6 +73,18 @@ export default class Affix extends React.Component<AffixProps, any> {
fixedNode: HTMLElement;
};
events = [
'resize',
'scroll',
'touchstart',
'touchmove',
'touchend',
'pageshow',
'load',
];
eventHandlers = {};
constructor(props) {
super(props);
this.state = {
@@ -150,7 +162,7 @@ export default class Affix extends React.Component<AffixProps, any> {
});
this.setPlaceholderStyle({
width,
height: affixNode.offsetHeight,
height: elemSize.height,
});
} else if (
scrollTop < elemOffset.top + elemSize.height + (offsetBottom as number) - targetInnerHeight &&
@@ -167,7 +179,7 @@ export default class Affix extends React.Component<AffixProps, any> {
});
this.setPlaceholderStyle({
width,
height: affixNode.offsetHeight,
height: elemOffset.height,
});
} else {
const { affixStyle } = this.state;
@@ -190,7 +202,7 @@ export default class Affix extends React.Component<AffixProps, any> {
componentWillReceiveProps(nextProps) {
if (this.props.target !== nextProps.target) {
this.clearScrollEventListeners();
this.clearEventListeners();
this.setTargetEventListeners(nextProps.target);
// Mock Event object.
@@ -199,7 +211,7 @@ export default class Affix extends React.Component<AffixProps, any> {
}
componentWillUnmount() {
this.clearScrollEventListeners();
this.clearEventListeners();
clearTimeout(this.timeout);
(this.updatePosition as any).cancel();
}
@@ -209,15 +221,18 @@ export default class Affix extends React.Component<AffixProps, any> {
if (!target) {
return;
}
this.clearScrollEventListeners();
this.scrollEvent = addEventListener(target, 'scroll', this.updatePosition);
this.resizeEvent = addEventListener(target, 'resize', this.updatePosition);
this.clearEventListeners();
this.events.forEach(eventName => {
this.eventHandlers[eventName] = addEventListener(target, eventName, this.updatePosition);
});
}
clearScrollEventListeners() {
['scrollEvent', 'resizeEvent'].forEach((name) => {
if (this[name]) {
this[name].remove();
clearEventListeners() {
this.events.forEach(eventName => {
const handler = this.eventHandlers[eventName];
if (handler && handler.remove) {
handler.remove();
}
});
}

View File

@@ -8,18 +8,18 @@ Alert component for feedback.
## When To Use
- When you need to show alert messages for users.
- When you need to show alert messages to users.
- When you need a persistent static container which is closable by user actions.
## API
| Property | Description | Type | Default |
|----------- |--------------------------------------------------------- | ---------- |-------|
| type | Type of Alert styles, options:`success`, `info`, `warning`, `error` | string | `info`, in `banner` mode it's `warning` |
| type | Type of Alert styles, options: `success`, `info`, `warning`, `error` | string | `info`, in `banner` mode default is `warning` |
| closable | Whether Alert can be closed | boolean | - |
| closeText | Close text to show | string\|ReactNode | - |
| message | Content of Alert | string\|ReactNode | - |
| description | Additional content of Alert | string\|ReactNode | - |
| onClose | Callback when close Alert | Function | - |
| showIcon | Whether to show icon | boolean | false, in `banner` mode it's true |
| onClose | Callback when Alert is closed | Function | - |
| showIcon | Whether to show icon | boolean | false, in `banner` mode default is true |
| banner | Whether to show as banner | boolean | false |

View File

@@ -11,7 +11,7 @@
border-radius: @border-radius-base;
color: @alert-text-color;
font-size: @font-size-base;
line-height: @font-size-base + 4px;
line-height: @line-height-base;
&&-no-icon {
padding: 8px 48px 8px 16px;
@@ -19,7 +19,7 @@
&-icon {
font-size: @font-size-lg;
top: 9.5px;
top: 8px + @font-size-base * @line-height-base / 2 - @font-size-lg / 2;
left: 16px;
position: absolute;
}

View File

@@ -9,7 +9,7 @@ import getScroll from '../_util/getScroll';
import getRequestAnimationFrame from '../_util/getRequestAnimationFrame';
function getDefaultTarget() {
return typeof window !== 'undefined' ? window : null;
return window;
}
function getOffsetTop(element: HTMLElement): number {

View File

@@ -1,57 +1,50 @@
@import "../../style/themes/default";
.@{ant-prefix} {
&-anchor {
position: relative;
&-wrapper {
background-color: @component-background;
}
.@{ant-prefix}-anchor {
position: relative;
&-wrapper {
background-color: @component-background;
}
&-ink {
position: absolute;
&-ink {
position: absolute;
height: 100%;
left: 0;
top: 0;
&:before {
content: ' ';
position: relative;
width: 2px;
height: 100%;
left: 0;
top: 0;
&:before {
content: ' ';
position: relative;
width: 2px;
height: 100%;
display: block;
background-color: @border-color-split;
margin: 0 auto;
}
&-ball {
display: none;
position: absolute;
width: 9px;
height: 9px;
border-radius: 9px;
border: 3px solid @primary-color;
background-color: @component-background;
left: 50%;
transition: top .3s ease-in-out;
transform: translateX(-50%);
&.visible {
display: inline-block;
}
}
display: block;
background-color: @border-color-split;
margin: 0 auto;
}
&.fixed &-ink &-ink-ball {
&-ball {
display: none;
position: absolute;
width: 9px;
height: 9px;
border-radius: 9px;
border: 3px solid @primary-color;
background-color: @component-background;
left: 50%;
transition: top .3s ease-in-out;
transform: translateX(-50%);
&.visible {
display: inline-block;
}
}
}
&-anchor-link {
&.fixed &-ink &-ink-ball {
display: none;
}
&-link {
padding: 8px 0 8px 18px;
line-height: 1;
& & {
padding-top: 6px;
padding-bottom: 6px;
}
&-title {
display: block;
position: relative;
@@ -61,18 +54,19 @@
overflow: hidden;
text-overflow: ellipsis;
margin-bottom: 8px;
}
&-title:only-child {
margin-bottom: 0;
&:only-child {
margin-bottom: 0;
}
}
&-active > &-title {
color: @primary-color;
}
}
& > & {
font-size: @font-size-base;
}
&-link &-link {
padding-top: 6px;
padding-bottom: 6px;
}
}

View File

@@ -10,10 +10,17 @@ export default class InputElement extends React.Component<any, any> {
blur = () => {
this.ele.blur ? this.ele.blur() : (findDOMNode(this.ele) as HTMLInputElement).blur();
}
saveRef = (ele: HTMLInputElement) => {
this.ele = ele;
const childRef = this.props.children.ref;
if (typeof childRef === 'function') {
childRef(ele);
}
}
render() {
return React.cloneElement(this.props.children, {
...this.props,
ref: ele => this.ele = (ele as HTMLInputElement),
ref: this.saveRef,
}, null);
}
}

View File

@@ -17,4 +17,14 @@ describe('AutoComplete with Custom Input Element Render', () => {
// should not filter data source defaultly
expect(dropdownWrapper.find('MenuItem').length).toBe(3);
});
it('child.ref should work', () => {
const mockRef = jest.fn();
mount(
<AutoComplete dataSource={[]}>
<input ref={mockRef} />
</AutoComplete>
);
expect(mockRef).toHaveBeenCalled();
});
});

View File

@@ -34,3 +34,4 @@ const dataSource = ['12345', '23456', '34567'];
| children (for customize input element) | customize input element | HTMLInputElement / HTMLTextAreaElement / React.ReactElement<InputProps> | `<Input />` |
| optionLabelProp | Which prop value of option will render as content of select. | string | `children` |
| filterOption | If true, filter options by input, if function, filter options against it. The function will receive two arguments, `inputValue` and `option`, if the function returns `true`, the option will be included in the filtered set; Otherwise, it will be excluded. | boolean or function(inputValue, option) | true |
| backfill | backfill selected item the input when using keyboard | boolean | false |

View File

@@ -52,7 +52,7 @@ export default class AutoComplete extends React.Component<AutoCompleteProps, any
const element = children && React.isValidElement(children) && children.type !== Option ?
React.Children.only(this.props.children) : <Input />;
return (
<InputElement {...element.props}>{element}</InputElement>
<InputElement>{element}</InputElement>
);
}

View File

@@ -35,3 +35,4 @@ const dataSource = ['12345', '23456', '34567'];
| children (自定义输入框) | 自定义输入框 | HTMLInputElement / HTMLTextAreaElement / React.ReactElement<InputProps> | `<Input />` |
| optionLabelProp | 回填到选择框的 Option 的属性值,默认是 Option 的子元素。比如在子元素需要高亮效果时,此值可以设为 `value`。 | string | `children` |
| filterOption | 是否根据输入项进行筛选。当其为一个函数时,会接收 `inputValue` `option` 两个参数,当 `option` 符合筛选条件时,应返回 `true`,反之则返回 `false`。 | boolean or function(inputValue, option) | true |
| backfill | 使用键盘选择选项的时候把选中项回填到输入框中 | boolean | false |

View File

@@ -33,6 +33,12 @@
.@{input-prefix-cls} {
background: transparent;
border-width: @border-width-base;
line-height: @line-height-base;
&:focus,
&:hover {
.hover;
}
}
&-lg {
@@ -52,13 +58,5 @@
.input-sm();
}
}
.@{input-prefix-cls} {
border-width: @border-width-base;
&:focus,
&:hover {
.hover;
}
}
}
}

View File

@@ -7,7 +7,6 @@ exports[`renders ./components/avatar/demo/badge.md correctly 1`] = `
>
<span
class="ant-badge"
title="1"
>
<span
class="ant-avatar ant-avatar-square ant-avatar-icon"
@@ -19,6 +18,7 @@ exports[`renders ./components/avatar/demo/badge.md correctly 1`] = `
<sup
class="ant-scroll-number ant-badge-count"
data-show="true"
title="1"
>
<span
class="ant-scroll-number-only"

View File

@@ -4,13 +4,13 @@ type: Data Display
title: Avatar
---
Avatars can be used to represent people or object, which supports image, antd-Icon, or letter.
Avatars can be used to represent people or objects. It supports images, `Icon`s, or letters.
## API
| Property | Description | Type | Default |
|----------- |--------------------------------------------------------- | ---------- |-------|
| shape | to set the shape of avatar | Enum{ 'circle', 'square' } | `circle` |
| size | to set the size of avatar | Enum{ 'large', 'small', 'default' } | `default` |
| src | the address of a image avatar | string | - |
| icon | the icon type of a icon avatar, see `Icon` Component | string | - |
| 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 | - |
| icon | the `Icon` type for an icon avatar, see `Icon` Component | string | - |

View File

@@ -18,7 +18,12 @@ export interface AvatarProps {
children?: any;
}
export default class Avatar extends React.Component<AvatarProps, any> {
export interface AvatarState {
scale: number;
isImgExist: boolean;
}
export default class Avatar extends React.Component<AvatarProps, AvatarState> {
static defaultProps = {
prefixCls: 'ant-avatar',
shape: 'circle',
@@ -27,7 +32,7 @@ export default class Avatar extends React.Component<AvatarProps, any> {
private avatarChildren: any;
constructor(props) {
constructor(props: AvatarProps) {
super(props);
this.state = {
scale: 1,
@@ -39,7 +44,7 @@ export default class Avatar extends React.Component<AvatarProps, any> {
this.setScale();
}
componentDidUpdate(prevProps, prevState) {
componentDidUpdate(prevProps: AvatarProps, prevState: AvatarState) {
if (prevProps.children !== this.props.children
|| (prevState.scale !== this.state.scale && this.state.scale === 1)) {
this.setScale();

View File

@@ -22,8 +22,7 @@ const easeInOutCubic = (t: number, b: number, c: number, d: number) => {
function noop() { }
function getDefaultTarget() {
return typeof window !== 'undefined' ?
window : null;
return window;
}
export interface BackTopProps {
@@ -50,7 +49,8 @@ export default class BackTop extends React.Component<BackTopProps, any> {
}
getCurrentScrollTop = () => {
const targetNode = (this.props.target || getDefaultTarget)();
const getTarget = this.props.target || getDefaultTarget;
const targetNode = getTarget();
if (targetNode === window) {
return window.pageYOffset || document.body.scrollTop || document.documentElement.scrollTop;
}
@@ -73,7 +73,8 @@ export default class BackTop extends React.Component<BackTopProps, any> {
}
setScrollTop(value: number) {
const targetNode = (this.props.target || getDefaultTarget)();
const getTarget = this.props.target || getDefaultTarget;
const targetNode = getTarget();
if (targetNode === window) {
document.body.scrollTop = value;
document.documentElement.scrollTop = value;
@@ -91,8 +92,9 @@ export default class BackTop extends React.Component<BackTopProps, any> {
}
componentDidMount() {
const getTarget = this.props.target || getDefaultTarget;
this.scrollEvent = addEventListener(getTarget(), 'scroll', this.handleScroll);
this.handleScroll();
this.scrollEvent = addEventListener((this.props.target || getDefaultTarget)(), 'scroll', this.handleScroll);
}
componentWillUnmount() {

View File

@@ -18,6 +18,7 @@ export interface ScrollNumberProps {
component?: string;
onAnimated?: Function;
style?: React.CSSProperties;
title?: string | number;
}
export default class ScrollNumber extends Component<ScrollNumberProps, any> {
@@ -119,7 +120,7 @@ export default class ScrollNumber extends Component<ScrollNumberProps, any> {
}
render() {
const { prefixCls, className, style, component = 'sup' } = this.props;
const { prefixCls, className, style, title, component = 'sup' } = this.props;
// fix https://fb.me/react-unknown-prop
const restProps = omit(this.props, [
'count',
@@ -129,10 +130,8 @@ export default class ScrollNumber extends Component<ScrollNumberProps, any> {
]);
const newProps = {
...restProps,
className: classNames({
[`${prefixCls}`]: !!prefixCls,
[`${className}`]: !!className,
}),
className: classNames(prefixCls, className),
title: title as string,
};
// allow specify the border
// mock border-color by box-shadow for compatible with old usage:

View File

@@ -4,7 +4,6 @@ exports[`renders ./components/badge/demo/basic.md correctly 1`] = `
<div>
<span
class="ant-badge"
title="5"
>
<a
class="head-example"
@@ -13,6 +12,7 @@ exports[`renders ./components/badge/demo/basic.md correctly 1`] = `
<sup
class="ant-scroll-number ant-badge-count"
data-show="true"
title="5"
>
<span
class="ant-scroll-number-only"
@@ -173,7 +173,6 @@ exports[`renders ./components/badge/demo/basic.md correctly 1`] = `
</span>
<span
class="ant-badge"
title="0"
>
<a
class="head-example"
@@ -182,6 +181,7 @@ exports[`renders ./components/badge/demo/basic.md correctly 1`] = `
<sup
class="ant-scroll-number ant-badge-count"
data-show="true"
title="0"
>
0
</sup>
@@ -194,7 +194,6 @@ exports[`renders ./components/badge/demo/change.md correctly 1`] = `
<div>
<span
class="ant-badge"
title="5"
>
<a
class="head-example"
@@ -203,6 +202,7 @@ exports[`renders ./components/badge/demo/change.md correctly 1`] = `
<sup
class="ant-scroll-number ant-badge-count"
data-show="true"
title="5"
>
<span
class="ant-scroll-number-only"
@@ -398,7 +398,8 @@ exports[`renders ./components/badge/demo/change.md correctly 1`] = `
/>
</span>
<span
class="ant-switch"
checked=""
class="ant-switch ant-switch-checked"
tabindex="0"
>
<span
@@ -444,7 +445,6 @@ exports[`renders ./components/badge/demo/link.md correctly 1`] = `
>
<span
class="ant-badge"
title="5"
>
<span
class="head-example"
@@ -452,6 +452,7 @@ exports[`renders ./components/badge/demo/link.md correctly 1`] = `
<sup
class="ant-scroll-number ant-badge-count"
data-show="true"
title="5"
>
<span
class="ant-scroll-number-only"
@@ -617,11 +618,11 @@ exports[`renders ./components/badge/demo/no-wrapper.md correctly 1`] = `
<div>
<span
class="ant-badge ant-badge-not-a-wrapper"
title="25"
>
<sup
class="ant-scroll-number ant-badge-count"
data-show="true"
title="25"
>
<span
class="ant-scroll-number-only"
@@ -937,12 +938,12 @@ exports[`renders ./components/badge/demo/no-wrapper.md correctly 1`] = `
</span>
<span
class="ant-badge ant-badge-not-a-wrapper"
title="4"
>
<sup
class="ant-scroll-number ant-badge-count"
data-show="true"
style="background-color:#fff;color:#999;box-shadow:0 0 0 1px #d9d9d9 inset;"
title="4"
>
<span
class="ant-scroll-number-only"
@@ -1103,12 +1104,12 @@ exports[`renders ./components/badge/demo/no-wrapper.md correctly 1`] = `
</span>
<span
class="ant-badge ant-badge-not-a-wrapper"
title="109"
>
<sup
class="ant-scroll-number ant-badge-count"
data-show="true"
style="background-color:#87d068;"
title="109"
>
99+
</sup>
@@ -1120,7 +1121,6 @@ exports[`renders ./components/badge/demo/overflow.md correctly 1`] = `
<div>
<span
class="ant-badge"
title="99"
>
<a
class="head-example"
@@ -1129,6 +1129,7 @@ exports[`renders ./components/badge/demo/overflow.md correctly 1`] = `
<sup
class="ant-scroll-number ant-badge-count"
data-show="true"
title="99"
>
<span
class="ant-scroll-number-only"
@@ -1444,7 +1445,6 @@ exports[`renders ./components/badge/demo/overflow.md correctly 1`] = `
</span>
<span
class="ant-badge"
title="100"
>
<a
class="head-example"
@@ -1453,13 +1453,13 @@ exports[`renders ./components/badge/demo/overflow.md correctly 1`] = `
<sup
class="ant-scroll-number ant-badge-count"
data-show="true"
title="100"
>
99+
</sup>
</span>
<span
class="ant-badge"
title="99"
>
<a
class="head-example"
@@ -1468,13 +1468,13 @@ exports[`renders ./components/badge/demo/overflow.md correctly 1`] = `
<sup
class="ant-scroll-number ant-badge-count"
data-show="true"
title="99"
>
10+
</sup>
</span>
<span
class="ant-badge"
title="1000"
>
<a
class="head-example"
@@ -1483,6 +1483,7 @@ exports[`renders ./components/badge/demo/overflow.md correctly 1`] = `
<sup
class="ant-scroll-number ant-badge-count"
data-show="true"
title="1000"
>
999+
</sup>

View File

@@ -60,7 +60,7 @@ class Demo extends React.Component {
<Badge dot={this.state.show}>
<a href="#" className="head-example" />
</Badge>
<Switch onChange={this.onChange} />
<Switch onChange={this.onChange} checked={this.state.show} />
</div>
</div>
);

View File

@@ -4,11 +4,11 @@ type: Data Display
title: Badge
---
Small numerical value or status descriptors for UI elements.
Small numerical value or status descriptor for UI elements.
## When To Use
Badge normally appears in proximity to notification or head picture with eye-catching appeal, typically displaying unread messages count.
Badge normally appears in proximity to notifications or user avatars with eye-catching appeal, typically displaying unread messages count.
## API
@@ -27,7 +27,7 @@ Badge normally appears in proximity to notification or head picture with eye-cat
|----------------|-------------------------|------------|---------|
| count | Number to show in badge | number | |
| overflowCount | Max count to show | number | 99 |
| showZero | Whether to show badge when `count` is zero | boolean | false |
| dot | Whether to show red dot without number | boolean | false |
| status | Set Badge as a status dot | Enum{ 'success', 'processing, 'default', 'error', 'warning' } | '' |
| text | If `status` is set, `text` is to set the text of status dot | string | '' |
| showZero | Whether to show badge when `count` is zero | boolean | `false` |
| dot | Whether to display a red dot instead of `count` | 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 | `''` |

View File

@@ -95,6 +95,7 @@ export default class Badge extends React.Component<BadgeProps, any> {
data-show={!hidden}
className={scrollNumberCls}
count={displayCount}
title={count}
style={style}
/>
);
@@ -104,7 +105,7 @@ export default class Badge extends React.Component<BadgeProps, any> {
);
return (
<span {...restProps} className={badgeCls} title={count as string}>
<span {...restProps} className={badgeCls}>
{children}
<Animate
component=""

View File

@@ -83,7 +83,7 @@
}
&-text {
color: @text-color;
font-size: @badge-font-size;
font-size: @font-size-base;
margin-left: 8px;
}
}
@@ -103,7 +103,7 @@
top: auto;
display: block;
position: relative;
transform: none!important;
transform: none !important;
}
}

View File

@@ -14,7 +14,7 @@ describe('Breadcrumb', () => {
});
// https://github.com/airbnb/enzyme/issues/875
xit('warns on non-Breadcrumb.Item children', () => {
it('warns on non-Breadcrumb.Item children', () => {
const MyCom = () => <div>foo</div>;
mount(
<Breadcrumb>

View File

@@ -18,15 +18,15 @@ A breadcrumb displays the current location within a hierarchy. It allows going b
| Property | Description | Type | Optional | Default |
|-----------|-----------------------------------|-----------------|---------|--------|
| routes | The routing stack information of router | object[] | | - |
| params | Routing parameter | object | | - |
| separator | Custom separator | string\|ReactNode | | '/' |
| params | Routing parameters | object | | - |
| separator | Custom separator | string\|ReactNode | | `/` |
| itemRender | Custom item renderer | (route, params, routes, paths) => ReactNode | | - |
> `linkRender` and `nameRender` were removed after `antd@2.0`, please use `itemRender` instead.
### Use with browserHistory
The link of Breadcrumb item contain `#` defaultly, you can use `itemRender` to make `browserHistory` Link.
The link of Breadcrumb item targets `#` by default, you can use `itemRender` to make a `browserHistory` Link.
```jsx
import { Link } from 'react-router';

View File

@@ -15,7 +15,7 @@
}
& > span:last-child {
font-weight: bold;
font-weight: 500;
color: @text-color;
}

View File

@@ -480,12 +480,13 @@ exports[`renders ./components/button/demo/size.md correctly 1`] = `
class="ant-radio-group"
>
<label
class="ant-radio-button-wrapper"
class="ant-radio-button-wrapper ant-radio-button-wrapper-checked"
>
<span
class="ant-radio-button"
class="ant-radio-button ant-radio-button-checked"
>
<input
checked=""
class="ant-radio-button-input"
type="radio"
/>
@@ -498,13 +499,12 @@ exports[`renders ./components/button/demo/size.md correctly 1`] = `
</span>
</label>
<label
class="ant-radio-button-wrapper ant-radio-button-wrapper-checked"
class="ant-radio-button-wrapper"
>
<span
class="ant-radio-button ant-radio-button-checked"
class="ant-radio-button"
>
<input
checked=""
class="ant-radio-button-input"
type="radio"
/>
@@ -538,7 +538,40 @@ exports[`renders ./components/button/demo/size.md correctly 1`] = `
<br />
<br />
<button
class="ant-btn ant-btn-primary ant-btn-circle ant-btn-icon-only"
class="ant-btn ant-btn-primary ant-btn-lg"
type="button"
>
<span>
Primary
</span>
</button>
<button
class="ant-btn ant-btn-lg"
type="button"
>
<span>
Normal
</span>
</button>
<button
class="ant-btn ant-btn-dashed ant-btn-lg"
type="button"
>
<span>
Dashed
</span>
</button>
<button
class="ant-btn ant-btn-danger ant-btn-lg"
type="button"
>
<span>
Danger
</span>
</button>
<br />
<button
class="ant-btn ant-btn-primary ant-btn-circle ant-btn-lg ant-btn-icon-only"
type="button"
>
<i
@@ -546,7 +579,7 @@ exports[`renders ./components/button/demo/size.md correctly 1`] = `
/>
</button>
<button
class="ant-btn ant-btn-primary"
class="ant-btn ant-btn-primary ant-btn-lg"
type="button"
>
<i
@@ -556,17 +589,9 @@ exports[`renders ./components/button/demo/size.md correctly 1`] = `
Download
</span>
</button>
<button
class="ant-btn ant-btn-primary"
type="button"
>
<span>
Normal
</span>
</button>
<br />
<div
class="ant-btn-group"
class="ant-btn-group ant-btn-group-lg"
>
<button
class="ant-btn ant-btn-primary"

View File

@@ -122,13 +122,6 @@ export default class Button extends React.Component<ButtonProps, any> {
}
}
// Handle auto focus when click button in Chrome
handleMouseUp = (e: React.MouseEvent<HTMLButtonElement>) => {
if (this.props.onMouseUp) {
this.props.onMouseUp(e);
}
}
render() {
const {
type, shape, size = '', className, htmlType, children, icon, prefixCls, ghost, ...others,
@@ -153,7 +146,7 @@ export default class Button extends React.Component<ButtonProps, any> {
[`${prefixCls}-${type}`]: type,
[`${prefixCls}-${shape}`]: shape,
[`${prefixCls}-${sizeCls}`]: sizeCls,
[`${prefixCls}-icon-only`]: !children && icon && !loading,
[`${prefixCls}-icon-only`]: !children && icon,
[`${prefixCls}-loading`]: loading,
[`${prefixCls}-clicked`]: clicked,
[`${prefixCls}-background-ghost`]: ghost,
@@ -161,7 +154,7 @@ export default class Button extends React.Component<ButtonProps, any> {
const iconType = loading ? 'loading' : icon;
const iconNode = iconType ? <Icon type={iconType} /> : null;
const needInserted = React.Children.count(children) === 1 && !iconType;
const needInserted = React.Children.count(children) === 1 && (!iconType || iconType === 'loading');
const kids = React.Children.map(children, child => insertSpace(child, needInserted));
return (
@@ -169,7 +162,6 @@ export default class Button extends React.Component<ButtonProps, any> {
{...omit(others, ['loading', 'clicked'])}
type={htmlType || 'button'}
className={classes}
onMouseUp={this.handleMouseUp}
onClick={this.handleClick}
>
{iconNode}{kids}

View File

@@ -22,7 +22,7 @@ import { Button, Radio, Icon } from 'antd';
class ButtonSize extends React.Component {
state = {
size: 'default',
size: 'large',
};
handleSizeChange = (e) => {
@@ -39,9 +39,13 @@ class ButtonSize extends React.Component {
<Radio.Button value="small">Small</Radio.Button>
</Radio.Group>
<br /><br />
<Button type="primary" size={size}>Primary</Button>
<Button size={size}>Normal</Button>
<Button type="dashed" size={size}>Dashed</Button>
<Button type="danger" size={size}>Danger</Button>
<br />
<Button type="primary" shape="circle" icon="download" size={size} />
<Button type="primary" icon="download" size={size}>Download</Button>
<Button type="primary" size={size}>Normal</Button>
<br />
<Button.Group size={size}>
<Button type="primary">

View File

@@ -16,14 +16,14 @@ To get a customized button, just set `type`/`shape`/`size`/`loading`/`disabled`.
Property | Description | Type | Default
-----|-----|-----|------
type | can be set to `primary` `dashed` `danger`(added in 2.7) or omitted | string | 'default'
htmlType | to set the original `type` of `button`, see: [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#attr-type) | string | `button`
type | can be set to `primary` `ghost` `dashed` `danger`(added in 2.7) or omitted (meaning `default`) | string | `default`
htmlType | set the original html `type` of `button`, see: [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#attr-type) | string | `button`
icon | set the icon of button, see: Icon component | string | -
shape | can be set to `circle` or omitted | string | -
size | can be set to `small` `large` or omitted | string | `default`
loading | to set the loading status of button | boolean \| { delay: number } | `false`
loading | set the loading status of button | boolean \| { delay: number } | false
onClick | set the handler to handle `click` event | function | -
ghost | make background transparent and invert text and border color, added in 2.7 | boolean | false
ghost | make background transparent and invert text and border colors, added in 2.7 | boolean | false
`<Button>Hello world!</Button>` will be rendered into `<button>Hello world!</button>`, and all the properties which are not listed above will be transferred to the `<button>` tag.

View File

@@ -5,9 +5,9 @@
@btn-prefix-cls: ~"@{ant-prefix}-btn";
// for compatibile
@btn-ghost-color : @text-color;
@btn-ghost-bg : transparent;
@btn-ghost-border : @border-color-base;
@btn-ghost-color: @text-color;
@btn-ghost-bg: transparent;
@btn-ghost-border: @border-color-base;
// Button styles
// -----------------------------
@@ -15,6 +15,13 @@
.btn;
.btn-default;
// Make sure that the target of Button's click event always be `button`
// Ref: https://github.com/ant-design/ant-design/issues/7034
> i,
> span {
pointer-events: none;
}
&-primary {
.btn-primary;
@@ -86,7 +93,7 @@
display: block;
}
&&-loading:not(&-circle):not(&-circle-outline) {
&&-loading:not(&-circle):not(&-circle-outline):not(&-icon-only) {
padding-left: 29px;
pointer-events: none;
position: relative;
@@ -95,7 +102,7 @@
}
}
&-sm&-loading:not(&-circle):not(&-circle-outline) {
&-sm&-loading:not(&-circle):not(&-circle-outline):not(&-icon-only) {
padding-left: 24px;
.@{iconfont-css-prefix} {
margin-left: -17px;
@@ -142,7 +149,7 @@
}
&-background-ghost {
background: transparent!important;
background: transparent !important;
border-color: #fff;
color: #fff;
}

View File

@@ -147,7 +147,7 @@
background-image: none;
border: @border-width-base @border-style-base transparent;
white-space: nowrap;
line-height: @line-height-base;
line-height: 1.15; // https://github.com/ant-design/ant-design/issues/7070
.button-size(@btn-height-base; @btn-padding-base; @font-size-base; @btn-border-radius-base);
user-select: none;
transition: all .3s @ease-in-out;

View File

@@ -9,11 +9,11 @@ Container for displaying data in calendar form.
## When To Use
When data is in the form of date, such as schedule, timetable, prices calendar, Lunar calendar. This component also supports Year/Month switch.
When data is in the form of dates, such as schedules, timetables, prices calendar, lunar calendar. This component also supports Year/Month switch.
## API
**Note:** Part of locale of Calendar is read from value. So, please set the locale of moment correctly.
**Note:** Part of the Calendar's locale is read from `value`. So, please set the locale of `moment` correctly.
```jsx
import moment from 'moment';
@@ -32,15 +32,15 @@ moment.locale('zh-cn');
| Property | Description | Type | Default |
|--------------|----------------|----------|--------------|
| value | set date | [moment](http://momentjs.com/) | current date |
| defaultValue | set default date | [moment](http://momentjs.com/) | default date |
| mode | can be set to month or year | string | month |
| fullscreen | to set whether full-screen display | boolean | true |
| dateCellRender | to set the way of renderer the date cell, the returned content will be appended to the cell | function(date: moment): ReactNode | - |
| monthCellRender | to set the way of renderer the month cell, the returned content will be appended to the cell | function(date: moment): ReactNode | - |
| dateFullCellRender | to set the way of renderer the date cell,the returned content will override the cell | function(date: moment): ReactNode | - |
| monthFullCellRender | to set the way of renderer the month cell,the returned content will override the cell | function(date: moment): ReactNode | - |
| locale | set locale | object | [default](https://github.com/ant-design/ant-design/blob/master/components/date-picker/locale/example.json) |
| onPanelChange| callback when panel change | function(date: moment, mode: string) | - |
| onSelect | callback when select date | function(date: moment | - |
| disabledDate | specify the date that cannot be selected | (currentDate: moment) => boolean | |
| value | The current selected date | [moment](http://momentjs.com/) | current date |
| defaultValue | The date selected by default | [moment](http://momentjs.com/) | default date |
| mode | The display mode of the calendar | `month` \| `year` | `month` |
| fullscreen | Whether to display in full-screen | boolean | `true` |
| dateCellRender | Customize the display of the date cell, the returned content will be appended to the cell | function(date: moment): ReactNode | - |
| monthCellRender | Customize the display of the month cell, the returned content will be appended to the cell | function(date: moment): ReactNode | - |
| dateFullCellRender | Customize the display of the date cell, the returned content will override the cell | function(date: moment): ReactNode | - |
| monthFullCellRender | Customize the display of the month cell, the returned content will override the cell | function(date: moment): ReactNode | - |
| locale | The calendar's locale | object | [default](https://github.com/ant-design/ant-design/blob/master/components/date-picker/locale/example.json) |
| onPanelChange| Callback for when panel changes | function(date: moment, mode: string) | - |
| onSelect | Callback for when a date is selected | function(date: moment | - |
| disabledDate | Function that specifies the dates that cannot be selected | (currentDate: moment) => boolean | - |

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -8,20 +8,20 @@ exports[`renders ./components/card/demo/basic.md correctly 1`] = `
<div
class="ant-card-head"
>
<h3
<div
class="ant-card-head-title"
>
Card title
</h3>
</div>
<div
class="ant-card-extra"
>
<a
href="#"
</div>
<div
class="ant-card-extra"
>
More
</a>
<a
href="#"
>
More
</a>
</div>
</div>
<div
class="ant-card-body"
@@ -50,11 +50,11 @@ exports[`renders ./components/card/demo/border-less.md correctly 1`] = `
<div
class="ant-card-head"
>
<h3
<div
class="ant-card-head-title"
>
Card title
</h3>
</div>
</div>
<div
class="ant-card-body"
@@ -80,57 +80,56 @@ exports[`renders ./components/card/demo/grid-card.md correctly 1`] = `
<div
class="ant-card-head"
>
<h3
<div
class="ant-card-head-title"
>
卡片标题
</h3>
Card Title
</div>
</div>
<div
class="ant-card-body"
style="padding:0;"
>
<div
class="ant-card-grid"
style="width:25%;text-align:center;"
>
卡片内容
Content
</div>
<div
class="ant-card-grid"
style="width:25%;text-align:center;"
>
卡片内容
Content
</div>
<div
class="ant-card-grid"
style="width:25%;text-align:center;"
>
卡片内容
Content
</div>
<div
class="ant-card-grid"
style="width:25%;text-align:center;"
>
卡片内容
Content
</div>
<div
class="ant-card-grid"
style="width:25%;text-align:center;"
>
卡片内容
Content
</div>
<div
class="ant-card-grid"
style="width:25%;text-align:center;"
>
卡片内容
Content
</div>
<div
class="ant-card-grid"
style="width:25%;text-align:center;"
>
卡片内容
Content
</div>
</div>
</div>
@@ -154,11 +153,11 @@ exports[`renders ./components/card/demo/in-column.md correctly 1`] = `
<div
class="ant-card-head"
>
<h3
<div
class="ant-card-head-title"
>
Card title
</h3>
</div>
</div>
<div
class="ant-card-body"
@@ -177,11 +176,11 @@ exports[`renders ./components/card/demo/in-column.md correctly 1`] = `
<div
class="ant-card-head"
>
<h3
<div
class="ant-card-head-title"
>
Card title
</h3>
</div>
</div>
<div
class="ant-card-body"
@@ -200,11 +199,11 @@ exports[`renders ./components/card/demo/in-column.md correctly 1`] = `
<div
class="ant-card-head"
>
<h3
<div
class="ant-card-head-title"
>
Card title
</h3>
</div>
</div>
<div
class="ant-card-body"
@@ -225,16 +224,18 @@ exports[`renders ./components/card/demo/loading.md correctly 1`] = `
<div
class="ant-card-head"
>
<h3
<div
class="ant-card-head-title"
>
Card title
</h3>
</div>
</div>
<div
class="ant-card-body"
>
<div>
<div
class="ant-card-loading-content"
>
<p
class="ant-card-loading-block"
style="width:94%;"

View File

@@ -0,0 +1,28 @@
import React from 'react';
import { mount } from 'enzyme';
import Card from '../index';
const delay = timeout => new Promise(resolve => setTimeout(resolve, timeout));
const testMethod = typeof window !== 'undefined' ? it : xit;
describe('Card', () => {
function fakeResizeWindowTo(wrapper, width) {
Object.defineProperties(wrapper.node.container, {
offsetWidth: {
get() { return width; },
configurable: true,
},
});
window.resizeTo(width);
}
testMethod('resize card will trigger different padding', async () => {
const wrapper = mount(<Card title="xxx">xxx</Card>);
fakeResizeWindowTo(wrapper, 1000);
await delay(0);
expect(wrapper.hasClass('ant-card-wider-padding')).toBe(true);
fakeResizeWindowTo(wrapper, 800);
await delay(0);
expect(wrapper.hasClass('ant-card-wider-padding')).toBe(false);
});
});

View File

@@ -22,14 +22,14 @@ const gridStyle = {
};
ReactDOM.render(
<Card title="卡片标题" noHovering bodyStyle={{ padding: 0 }}>
<Card.Grid style={gridStyle}>卡片内容</Card.Grid>
<Card.Grid style={gridStyle}>卡片内容</Card.Grid>
<Card.Grid style={gridStyle}>卡片内容</Card.Grid>
<Card.Grid style={gridStyle}>卡片内容</Card.Grid>
<Card.Grid style={gridStyle}>卡片内容</Card.Grid>
<Card.Grid style={gridStyle}>卡片内容</Card.Grid>
<Card.Grid style={gridStyle}>卡片内容</Card.Grid>
<Card title="Card Title" noHovering>
<Card.Grid style={gridStyle}>Content</Card.Grid>
<Card.Grid style={gridStyle}>Content</Card.Grid>
<Card.Grid style={gridStyle}>Content</Card.Grid>
<Card.Grid style={gridStyle}>Content</Card.Grid>
<Card.Grid style={gridStyle}>Content</Card.Grid>
<Card.Grid style={gridStyle}>Content</Card.Grid>
<Card.Grid style={gridStyle}>Content</Card.Grid>
</Card>
, mountNode);
````

View File

@@ -5,11 +5,11 @@ title: Card
cols: 1
---
Simple rectangular container
Simple rectangular container.
## When To Use
A card can be used to display content related to a single subject. The content can consist of multiple elements of varying type and size.
A card can be used to display content related to a single subject. The content can consist of multiple elements of varying types and sizes.
## API
@@ -23,10 +23,10 @@ A card can be used to display content related to a single subject. The content c
|----------|----------------|----------|--------------|
| title | Card title | string\|ReactNode | - |
| extra | Content to render in the top-right corner of the card | string\|ReactNode | - |
| bordered | Toggles rendering of the border around the card | boolean | true |
| bordered | Toggles rendering of the border around the card | boolean | `true` |
| bodyStyle | Inline style to apply to the card content | object | - |
| noHovering | Whether to be hovering when mouse over | boolean | true |
| loading | Shows a loading indicator while the contents of the card are being fetched | boolean | false |
| noHovering | Whether to disable hover effect on mouse over | boolean | `false` |
| loading | Shows a loading indicator while the contents of the card are being fetched | boolean | `false` |
### Card.Grid

View File

@@ -13,14 +13,14 @@ export interface CardProps {
style?: React.CSSProperties;
loading?: boolean;
noHovering?: boolean;
children?: any;
children?: React.ReactNode;
id?: string;
className?: string;
}
export default class Card extends Component<CardProps, any> {
export default class Card extends Component<CardProps, {}> {
static Grid: typeof Grid = Grid;
container: any;
container: HTMLDivElement;
resizeEvent: any;
updateWiderPaddingCalled: boolean;
state = {
@@ -34,9 +34,13 @@ export default class Card extends Component<CardProps, any> {
if (this.resizeEvent) {
this.resizeEvent.remove();
}
(this.updateWiderPadding as any).cancel();
}
@throttleByAnimationFrameDecorator()
updateWiderPadding() {
if (!this.container) {
return;
}
// 936 is a magic card width pixer number indicated by designer
const WIDTH_BOUDARY_PX = 936;
if (this.container.offsetWidth >= WIDTH_BOUDARY_PX && !this.state.widerPadding) {
@@ -50,12 +54,12 @@ export default class Card extends Component<CardProps, any> {
});
}
}
saveRef = (node) => {
saveRef = (node: HTMLDivElement) => {
this.container = node;
}
isContainGrid() {
let containGrid;
Children.forEach(this.props.children, (element: any) => {
Children.forEach(this.props.children, (element: JSX.Element) => {
if (element && element.type && element.type === Grid) {
containGrid = true;
}
@@ -80,7 +84,7 @@ export default class Card extends Component<CardProps, any> {
if (loading) {
children = (
<div>
<div className={`${prefixCls}-loading-content`}>
<p className={`${prefixCls}-loading-block`} style={{ width: '94%' }} />
<p>
<span className={`${prefixCls}-loading-block`} style={{ width: '28%' }} />
@@ -104,16 +108,11 @@ export default class Card extends Component<CardProps, any> {
}
let head;
if (!title) {
head = null;
} else {
head = typeof title === 'string' ? (
if (title || extra) {
head = (
<div className={`${prefixCls}-head`}>
<h3 className={`${prefixCls}-head-title`}>{title}</h3>
</div>
) : (
<div className={`${prefixCls}-head`}>
<div className={`${prefixCls}-head-title`}>{title}</div>
{title ? <div className={`${prefixCls}-head-title`}>{title}</div> : null}
{extra ? <div className={`${prefixCls}-extra`}>{extra}</div> : null}
</div>
);
}
@@ -121,7 +120,6 @@ export default class Card extends Component<CardProps, any> {
return (
<div {...others} className={classString} ref={this.saveRef}>
{head}
{extra ? <div className={`${prefixCls}-extra`}>{extra}</div> : null}
<div className={`${prefixCls}-body`} style={bodyStyle}>{children}</div>
</div>
);

View File

@@ -26,7 +26,7 @@ cols: 1
| extra | 卡片右上角的操作区域 | string\|ReactNode | - |
| bordered | 是否有边框 | boolean | true |
| bodyStyle | 内容区域自定义样式 | object | - |
| noHovering | 鼠标移过时是否浮起 | boolean | true |
| noHovering | 取消鼠标移过浮起 | boolean | false |
| loading | 当卡片内容还在加载中时,可以用 loading 展示一个占位 | boolean | false |
### Card.Grid

View File

@@ -2,6 +2,8 @@
@import "../../style/mixins/index";
@card-prefix-cls: ~"@{ant-prefix}-card";
@card-padding-base: 24px;
@card-padding-wider: 32px;
.@{card-prefix-cls} {
background: @component-background;
@@ -24,34 +26,44 @@
line-height: @card-head-height;
background: @card-head-background;
border-bottom: @border-width-base @border-style-base @border-color-split;
padding: 0 24px;
padding: 0 @card-padding-base;
border-radius: @border-radius-sm @border-radius-sm 0 0;
.clearfix;
margin-bottom: -1px; // Fix card grid overflow bug: https://gw.alipayobjects.com/zos/rmsportal/XonYxBikwpgbqIQBeuhk.png
display: flex;
&-title {
font-size: @font-size-lg;
display: inline-block;
text-overflow: ellipsis;
width: 100%;
max-width: 100%;
overflow: hidden;
white-space: nowrap;
color: @card-head-color;
font-weight: 500;
display: inline-block;
flex: 1;
}
}
&-extra {
position: absolute;
right: 24px;
top: 14px;
float: right;
text-align: right;
// https://stackoverflow.com/a/22429853/3040605
margin-left: auto;
}
&-body {
padding: 24px;
padding: @card-padding-base;
.clearfix;
}
&-loading &-body {
user-select: none;
padding: 0;
}
&-loading-content {
padding: @card-padding-base;
}
&-loading-block {
@@ -65,16 +77,17 @@
}
&-contain-grid &-body {
margin: -0.5px;
margin: -1px 0 0 -1px;
padding: 0;
}
&-grid {
border-radius: 0;
border: 0;
box-shadow: 0 0 0 0.5px @border-color-split, 0 0 0 0.5px @border-color-split inset;
box-shadow: 1px 0 0 0 @border-color-split, 0 1px 0 0 @border-color-split, 1px 1px 0 0 @border-color-split, 1px 0 0 0 @border-color-split inset, 0 1px 0 0 @border-color-split inset;
width: 33.33%;
float: left;
padding: 24px;
padding: @card-padding-base;
transition: all .3s;
&:hover {
position: relative;
@@ -84,15 +97,15 @@
}
&-wider-padding &-head {
padding: 0 32px;
padding: 0 @card-padding-wider;
}
&-wider-padding &-body {
padding: 24px 32px;
padding: @card-padding-base @card-padding-wider;
}
&-wider-padding &-extra {
right: 32px;
right: @card-padding-wider;
}
&-padding-transition &-head,

View File

@@ -62,7 +62,7 @@ exports[`renders ./components/carousel/demo/autoplay.md correctly 1`] = `
</h3>
</div>
<div
class="slick-slide slick-active slick-cloned"
class="slick-slide slick-cloned"
data-index="4"
>
<h3>
@@ -137,7 +137,7 @@ exports[`renders ./components/carousel/demo/basic.md correctly 1`] = `
</h3>
</div>
<div
class="slick-slide slick-active slick-cloned"
class="slick-slide slick-cloned"
data-index="4"
>
<h3>
@@ -271,7 +271,7 @@ exports[`renders ./components/carousel/demo/vertical.md correctly 1`] = `
</h3>
</div>
<div
class="slick-slide slick-active slick-cloned"
class="slick-slide slick-cloned"
data-index="4"
>
<h3>

View File

@@ -0,0 +1,13 @@
import React from 'react';
import { mount } from 'enzyme';
import Carousel from '..';
describe('Carousel', () => {
it('should has innerSlider', () => {
const wrapper = mount(<Carousel><div /></Carousel>);
const innerSlider = wrapper.node.innerSlider;
const innerSliderFromRefs = wrapper.node.refs.slick.innerSlider;
expect(innerSlider).toBe(innerSliderFromRefs);
expect(typeof innerSlider.slickNext).toBe('function');
});
});

View File

@@ -9,19 +9,19 @@ A carousel component. Scales with its container.
## When To Use
- When there is a group of content on the same level.
- When there is insufficient content space, it can be used to save space in the form of a resolving door.
- When there is insufficient content space, it can be used to save space in the form of a revolving door.
- Commonly used for a group of pictures/cards.
## API
| Property | Description | Type | Default |
|------------------|----------------------------------------------|----------|---------------------------------|
| effect | Animation effect, either `scrollx` or `fade` | string | scrollx |
| dots | Whether to show the dots at the bottom of the gallery | boolean | true |
| vertical | Whether to use a vertical display | boolean | false |
| autoplay | Whether to scroll automatically | boolean | false |
| easing | Transition name | string | linear |
| beforeChange | Callback function called before the current index changes | function(from, to) |
| afterChange | Callback function called after the current index changes | function(current) |
| effect | Transition effect | `scrollx` \| `fade` | `scrollx` |
| dots | Whether to show the dots at the bottom of the gallery | boolean | `true` |
| vertical | Whether to use a vertical display | boolean | `false` |
| autoplay | Whether to scroll automatically | boolean | `false` |
| easing | Transition interpolation function name | string | `linear` |
| beforeChange | Callback function called before the current index changes | function(from, to) | - |
| afterChange | Callback function called after the current index changes | function(current) | - |
For more info on the parameters, refer to the https://github.com/akiran/react-slick

View File

@@ -1,7 +1,8 @@
// matchMedia polyfill for
// https://github.com/WickyNilliams/enquire.js/issues/82
import React from 'react';
import debounce from 'lodash.debounce';
// matchMedia polyfill for
// https://github.com/WickyNilliams/enquire.js/issues/82
if (typeof window !== 'undefined') {
const matchMediaPolyfill = (mediaQuery: string): MediaQueryList => {
return {
@@ -15,9 +16,11 @@ if (typeof window !== 'undefined') {
};
window.matchMedia = window.matchMedia || matchMediaPolyfill;
}
import SlickCarousel from 'react-slick';
import React from 'react';
// Use require over import (will be lifted up)
// make sure matchMedia polyfill run before require('react-slick')
// Fix https://github.com/ant-design/ant-design/issues/6560
// Fix https://github.com/ant-design/ant-design/issues/3308
const SlickCarousel = require('react-slick').default;
export type CarouselEffect = 'scrollx' | 'fade';
// Carousel
@@ -75,6 +78,8 @@ export default class Carousel extends React.Component<CarouselProps, any> {
slick: any,
};
innerSlider: any;
constructor() {
super();
this.onWindowResized = debounce(this.onWindowResized, 500, {
@@ -87,6 +92,9 @@ export default class Carousel extends React.Component<CarouselProps, any> {
if (autoplay) {
window.addEventListener('resize', this.onWindowResized);
}
const { slick } = this.refs;
// https://github.com/ant-design/ant-design/issues/7191
this.innerSlider = slick && slick.innerSlider;
}
componentWillUnmount() {

View File

@@ -22,7 +22,7 @@ subtitle: 走马灯
| vertical | 垂直显示 | boolean | false |
| autoplay | 是否自动切换 | boolean | false |
| easing | 动画效果 | string | linear |
| beforeChange | 切换面板的回调 | function(from, to) | 无
| afterChange | 切换面板的回调 | function(current) | 无
| beforeChange | 切换面板的回调 | function(from, to) | 无 |
| afterChange | 切换面板的回调 | function(current) | 无 |
更多参数可参考https://github.com/akiran/react-slick

View File

@@ -25,6 +25,7 @@ Cascade selection box.
| defaultValue | initial selected value | [CascaderOptionType](https://git.io/vMMoK)[] |[] |
| value | selected value | [CascaderOptionType](https://git.io/vMMoK)[] | - |
| onChange | callback when finishing cascader select | `(value, selectedOptions) => void` | - |
| onPopupVisibleChange | callback when popup shown or hidden | `(value) => void` | - |
| displayRender | render function of displaying selected options | `(label, selectedOptions) => ReactNode` | `label => label.join(' / ')` |
| style | additional style | string | - |
| className | additional css class | string | - |

View File

@@ -26,6 +26,7 @@ subtitle: 级联选择
| defaultValue | 默认的选中项 | [CascaderOptionType](https://git.io/vMMoK)[] |[] |
| value | 指定选中项 | [CascaderOptionType](https://git.io/vMMoK)[] | - |
| onChange | 选择完成后的回调 | `(value, selectedOptions) => void` | - |
| onPopupVisibleChange | 显示/隐藏浮层的回调 | `(value) => void` | - |
| displayRender | 选择后展示的渲染函数 | `(label, selectedOptions) => ReactNode` | `label => label.join(' / ')` |
| style | 自定义样式 | string | - |
| className | 自定义类名 | string | - |

View File

@@ -10,7 +10,7 @@
&-input.@{ant-prefix}-input {
// Add important to fix https://github.com/ant-design/ant-design/issues/5078
// because input.less will compile after cascader.less
background-color: transparent!important;
background-color: transparent !important;
cursor: pointer;
width: 100%;
display: block;
@@ -174,11 +174,12 @@
&,
&:hover {
background: @background-color-base;
font-weight: bold;
font-weight: 600;
}
}
&-expand {
position: relative;
padding-right: 24px;
&:after {
.iconfont-font("\e61f");
.iconfont-size-under-12px(8px);

View File

@@ -12,11 +12,12 @@ export interface AbstractCheckboxProps {
checked?: boolean;
style?: React.CSSProperties;
disabled?: boolean;
onChange?: React.FormEventHandler<any>;
onChange?: React.ChangeEventHandler<HTMLInputElement>;
onMouseEnter?: React.MouseEventHandler<any>;
onMouseLeave?: React.MouseEventHandler<any>;
value?: any;
name?: string;
children?: React.ReactNode;
}
export interface CheckboxProps extends AbstractCheckboxProps {
@@ -57,7 +58,7 @@ export default class Checkbox extends React.Component<CheckboxProps, any> {
if (checkboxGroup) {
checkboxProps.onChange = () => checkboxGroup.toggleOption({ label: children, value: props.value });
checkboxProps.checked = checkboxGroup.value.indexOf(props.value) !== -1;
checkboxProps.disabled = 'disabled' in props ? props.disabled : checkboxGroup.disabled;
checkboxProps.disabled = props.disabled || checkboxGroup.disabled;
}
const classString = classNames(className, {
[`${prefixCls}-wrapper`]: true,

View File

@@ -363,10 +363,11 @@ exports[`renders ./components/checkbox/demo/group.md correctly 1`] = `
class="ant-checkbox-group-item ant-checkbox-wrapper"
>
<span
class="ant-checkbox"
class="ant-checkbox ant-checkbox-disabled"
>
<input
class="ant-checkbox-input"
disabled=""
type="checkbox"
/>
<span

View File

@@ -0,0 +1,23 @@
import React from 'react';
import { shallow } from 'enzyme';
import Checkbox from '..';
describe('Checkbox', () => {
it('responses hover events', () => {
const onMouseEnter = jest.fn();
const onMouseLeave = jest.fn();
const wrapper = shallow(
<Checkbox
onMouseEnter={onMouseEnter}
onMouseLeave={onMouseLeave}
/>
);
wrapper.simulate('mouseenter');
expect(onMouseEnter).toHaveBeenCalled();
wrapper.simulate('mouseleave');
expect(onMouseLeave).toHaveBeenCalled();
});
});

View File

@@ -0,0 +1,54 @@
import React from 'react';
import { mount } from 'enzyme';
import Checkbox from '../index';
describe('CheckboxGroup', () => {
it('should work basically', () => {
const onChange = jest.fn();
const wrapper = mount(
<Checkbox.Group options={['Apple', 'Pear', 'Orange']} onChange={onChange} />
);
wrapper.find('.ant-checkbox-input').at(0).simulate('change');
expect(onChange).toBeCalledWith(['Apple']);
wrapper.find('.ant-checkbox-input').at(1).simulate('change');
expect(onChange).toBeCalledWith(['Apple', 'Pear']);
wrapper.find('.ant-checkbox-input').at(2).simulate('change');
expect(onChange).toBeCalledWith(['Apple', 'Pear', 'Orange']);
wrapper.find('.ant-checkbox-input').at(1).simulate('change');
expect(onChange).toBeCalledWith(['Apple', 'Orange']);
});
it('does not trigger onChange callback of both Checkbox and CheckboxGroup when CheckboxGroup is disabled', () => {
const onChangeGroup = jest.fn();
const options = [
{ label: 'Apple', value: 'Apple' },
{ label: 'Pear', value: 'Pear' },
];
const groupWrapper = mount(
<Checkbox.Group options={options} onChange={onChangeGroup} disabled />
);
groupWrapper.find('.ant-checkbox-input').at(0).simulate('change');
expect(onChangeGroup).not.toBeCalled();
groupWrapper.find('.ant-checkbox-input').at(1).simulate('change');
expect(onChangeGroup).not.toBeCalled();
});
it('does not prevent onChange callback from Checkbox when CheckboxGroup is not disabled', () => {
const onChangeGroup = jest.fn();
const options = [
{ label: 'Apple', value: 'Apple' },
{ label: 'Orange', value: 'Orange', disabled: true },
];
const groupWrapper = mount(
<Checkbox.Group options={options} onChange={onChangeGroup} />
);
groupWrapper.find('.ant-checkbox-input').at(0).simulate('change');
expect(onChangeGroup).toBeCalledWith(['Apple']);
groupWrapper.find('.ant-checkbox-input').at(1).simulate('change');
expect(onChangeGroup).toBeCalledWith(['Apple']);
});
});

View File

@@ -1,38 +0,0 @@
import React from 'react';
import { shallow, mount } from 'enzyme';
import Checkbox from '..';
describe('Checkbox', () => {
it('responses hover events', () => {
const onMouseEnter = jest.fn();
const onMouseLeave = jest.fn();
const wrapper = shallow(
<Checkbox
onMouseEnter={onMouseEnter}
onMouseLeave={onMouseLeave}
/>
);
wrapper.simulate('mouseenter');
expect(onMouseEnter).toHaveBeenCalled();
wrapper.simulate('mouseleave');
expect(onMouseLeave).toHaveBeenCalled();
});
it('CheckGroup should work', () => {
const onChange = jest.fn();
const wrapper = mount(
<Checkbox.Group options={['Apple', 'Pear', 'Orange']} onChange={onChange} />
);
wrapper.find('.ant-checkbox-input').at(0).simulate('change');
expect(onChange).toBeCalledWith(['Apple']);
wrapper.find('.ant-checkbox-input').at(1).simulate('change');
expect(onChange).toBeCalledWith(['Apple', 'Pear']);
wrapper.find('.ant-checkbox-input').at(2).simulate('change');
expect(onChange).toBeCalledWith(['Apple', 'Pear', 'Orange']);
wrapper.find('.ant-checkbox-input').at(1).simulate('change');
expect(onChange).toBeCalledWith(['Apple', 'Orange']);
});
});

View File

@@ -20,7 +20,7 @@ Checkbox.
| checked | Specifies whether the checkbox is selected. | boolean | false |
| defaultChecked | Specifies the initial state: whether or not the checkbox is selected. | boolean | false |
| onChange | The callback function that is triggered when the state changes. | Function(e:Event) | - |
| disabled | Disable checkbox | boolean | | false|
| disabled | Disable checkbox | boolean | false|
### Checkbox Group
@@ -30,4 +30,4 @@ Checkbox.
| value | Used for setting the currently selected value. | string[] | [] |
| options | Specifies options | string[] | [] |
| onChange | The callback function that is triggered when the state changes. | Function(checkedValue) | - |
| disabled | Disable all checkboxes | boolean | | false |
| disabled | Disable all checkboxes | boolean | false |

View File

@@ -42,21 +42,23 @@
top: 0;
left: 0;
display: block;
width: 14px;
height: 14px;
width: @checkbox-size;
height: @checkbox-size;
border: @border-width-base @border-style-base @border-color-base;
border-radius: @border-radius-sm;
background-color: #fff;
transition: all .3s;
&:after {
@check-width: (@checkbox-size / 14) * 5px;
@check-height: (@checkbox-size / 14) * 8px;
transform: rotate(45deg) scale(0);
position: absolute;
left: 4px;
top: 1px;
left: (@checkbox-size - @check-width) / 2 - 0.5px * (@checkbox-size / 14);
top: (@checkbox-size - @check-height) / 2 - 2px * (@checkbox-size / 14);
display: table;
width: 5px;
height: 8px;
width: @check-width;
height: @check-height;
border: 2px solid #fff;
border-top: 0;
border-left: 0;
@@ -81,24 +83,26 @@
// 半选状态
.@{checkbox-prefix-cls}-indeterminate .@{checkbox-inner-prefix-cls}:after {
@indeterminate-width: (@checkbox-size / 14) * 8px;
@indeterminate-height: (@checkbox-size / 14) * 1px;
content: ' ';
transform: scale(1);
position: absolute;
left: 2px;
top: 5px;
width: 8px;
height: 1px;
left: (@checkbox-size - 2 - @indeterminate-width) / 2;
top: (@checkbox-size - 3 - @indeterminate-height) / 2;
width: @indeterminate-width;
height: @indeterminate-height;
}
.@{checkbox-prefix-cls}-indeterminate.@{checkbox-prefix-cls}-disabled .@{checkbox-inner-prefix-cls}:after {
border-color: @disabled-color;
}
// 选中状态
.@{checkbox-prefix-cls}-checked .@{checkbox-inner-prefix-cls}:after {
transform: rotate(45deg) scale(1);
position: absolute;
left: 4px;
top: 1px;
display: table;
width: 5px;
height: 8px;
border: 2px solid #fff;
border-top: 0;
border-left: 0;
@@ -129,7 +133,7 @@
}
.@{checkbox-inner-prefix-cls} {
border-color: @border-color-base!important;
border-color: @border-color-base !important;
background-color: @input-disabled-bg;
&:after {
animation-name: none;
@@ -147,8 +151,8 @@
cursor: pointer;
font-size: @font-size-base;
display: inline-block;
&:not(:last-child) {
margin-right: 8px;
& + & {
margin-left: 8px;
}
}

View File

@@ -8,7 +8,7 @@ export interface CollapseProps {
defaultActiveKey?: Array<string>;
/** 手风琴效果 */
accordion?: boolean;
onChange?: (key: string) => void;
onChange?: (key: string | string[]) => void;
style?: React.CSSProperties;
className?: string;
bordered?: boolean;

View File

@@ -185,7 +185,7 @@ exports[`renders ./components/collapse/demo/custom.md correctly 1`] = `
>
<div
class="ant-collapse-item ant-collapse-item-active"
style="background:#f7f7f7;border-radius:4px;margin-bottom:24px;border:0;"
style="background:#f7f7f7;border-radius:4px;margin-bottom:24px;border:0;overflow:hidden;"
>
<div
aria-expanded="true"
@@ -216,7 +216,7 @@ exports[`renders ./components/collapse/demo/custom.md correctly 1`] = `
</div>
<div
class="ant-collapse-item"
style="background:#f7f7f7;border-radius:4px;margin-bottom:24px;border:0;"
style="background:#f7f7f7;border-radius:4px;margin-bottom:24px;border:0;overflow:hidden;"
>
<div
aria-expanded="false"
@@ -231,7 +231,7 @@ exports[`renders ./components/collapse/demo/custom.md correctly 1`] = `
</div>
<div
class="ant-collapse-item"
style="background:#f7f7f7;border-radius:4px;margin-bottom:24px;border:0;"
style="background:#f7f7f7;border-radius:4px;margin-bottom:24px;border:0;overflow:hidden;"
>
<div
aria-expanded="false"

View File

@@ -28,6 +28,7 @@ const customPanelStyle = {
borderRadius: 4,
marginBottom: 24,
border: 0,
overflow: 'hidden',
};
ReactDOM.render(

View File

@@ -18,14 +18,14 @@ A content area which can be collapsed and expanded.
| Property | Description | Type | Default |
|----------|----------------|----------|--------------|
| activeKey | key of the active panel | string[]\|string | No default value. In `accordion` mode, it's the key of the first panel. |
| defaultActiveKey | key of the initialized active panel | string | - |
| onChange | a callback function, which can be executed when you switch the panels | Function | - |
| activeKey | Key of the active panel | string[]\|string | No default value. In `accordion` mode, it's the key of the first panel. |
| defaultActiveKey | Key of the initial active panel | string | - |
| onChange | Callback function executed when active panel is changed | Function | - |
### Collapse.Panel
| Property | Description | Type | Default |
|----------|----------------|----------|--------------|
| key | corresponds to the `activeKey` | string | - |
| header | title of the panel | string\|ReactNode | - |
| disabled | users cannot change opening status of a disabled panel | boolean | false |
| key | Unique key identifying the panel from among its siblings | string | - |
| header | Title of the panel | string\|ReactNode | - |
| disabled | If `true`, panel cannot be opened or closed | boolean | `false` |

View File

@@ -21,6 +21,14 @@
& > &-item {
border-bottom: @border-width-base @border-style-base @border-color-base;
&:last-child {
&,
& > .@{collapse-prefix-cls}-header {
border-radius: 0 0 @border-radius-base @border-radius-base;
}
}
> .@{collapse-prefix-cls}-header {
line-height: 22px;
padding: 8px 0 8px 32px;
@@ -37,14 +45,10 @@
display: inline-block;
font-weight: bold;
line-height: 40px;
vertical-align: middle;
vertical-align: top;
transition: transform 0.24s;
top: 0;
left: 16px;
/* stylelint-disable declaration-block-no-duplicate-properties */
top: ~"16px \9";
left: ~"0 \9";
/* stylelint-enable declaration-block-no-duplicate-properties */
&:before {
content: "\E61F";
}
@@ -89,6 +93,11 @@
border: 0;
}
&-borderless > &-item:last-child,
&-borderless > &-item:last-child &-header {
border-radius: 0;
}
&-borderless > &-item-active {
border: 0;
}
@@ -114,7 +123,7 @@
}
}
& > &-item > .@{collapse-prefix-cls}-header:active {
& > &-item:not(&-item-disabled) > .@{collapse-prefix-cls}-header:active {
background-color: @collapse-active-bg;
}
}

View File

@@ -10,7 +10,7 @@ import { getLocaleCode } from '../_util/getLocale';
import warning from '../_util/warning';
function getShowDateFromValue(value: moment.Moment[]): moment.Moment[] | undefined {
const [ start, end ] = value;
const [start, end] = value;
// value could be an empty array, then we should not reset showDate
if (!start && !end) {
return;
@@ -24,7 +24,9 @@ function formatValue(value: moment.Moment | undefined, format: string): string {
}
function pickerValueAdapter(value?: moment.Moment | moment.Moment[]): moment.Moment[] | undefined {
if (!value) { return; }
if (!value) {
return;
}
if (Array.isArray(value)) {
return value;
}
@@ -97,7 +99,10 @@ export default class RangePicker extends React.Component<any, any> {
handleChange = (value: moment.Moment[]) => {
const props = this.props;
if (!('value' in props)) {
this.setState({ value, showDate: getShowDateFromValue(value) });
this.setState(({ showDate }) => ({
value,
showDate: getShowDateFromValue(value) || showDate,
}));
}
props.onChange(value, [
formatValue(value[0], props.format),

View File

@@ -75,4 +75,21 @@ describe('RangePicker', () => {
expect(() => rangeCalendarWrapper.find('.ant-calendar-cell').at(15).simulate('click').simulate('click'))
.not.toThrow();
});
// issue: https://github.com/ant-design/ant-design/issues/7077
it('should not throw error when select after clear', () => {
const wrapper = mount(
<RangePicker
getCalendarContainer={trigger => trigger}
open
/>
);
let rangeCalendarWrapper = mount(wrapper.find('Trigger').node.getComponent());
rangeCalendarWrapper.find('.ant-calendar-cell').at(15).simulate('click').simulate('click');
wrapper.find('.ant-calendar-picker-clear').simulate('click');
wrapper.find('.ant-calendar-picker-input').simulate('click');
rangeCalendarWrapper = mount(wrapper.find('Trigger').node.getComponent());
expect(() => rangeCalendarWrapper.find('.ant-calendar-cell').at(15).simulate('click').simulate('click'))
.not.toThrow();
});
});

View File

@@ -40,9 +40,9 @@ export interface DatePickerProps extends PickerProps, SinglePickerProps {
open?: boolean;
toggleOpen?: (e: {open: boolean}) => void;
disabledTime?: (current: moment.Moment) => {
disabledHours?: () => [number, number],
disabledMinutes?: () => [number, number],
disabledSeconds?: () => [number, number],
disabledHours?: () => number[],
disabledMinutes?: () => number[],
disabledSeconds?: () => number[],
};
onOpenChange?: (status: boolean) => void;
onOk?: (selectedTime: moment.Moment) => void;
@@ -69,9 +69,9 @@ export interface RangePickerProps extends PickerProps {
};
placeholder?: [string, string];
disabledTime?: (current: moment.Moment, type: string) => {
disabledHours?: () => [number, number],
disabledMinutes?: () => [number, number],
disabledSeconds?: () => [number, number],
disabledHours?: () => number[],
disabledMinutes?: () => number[],
disabledSeconds?: () => number[],
};
}

View File

@@ -0,0 +1,19 @@
import CalendarLocale from 'rc-calendar/lib/locale/el_GR';
import TimePickerLocale from '../../time-picker/locale/el_GR';
// Merge into a locale object
const locale = {
lang: {
placeholder: 'Επιλέξτε ημερομηνία',
rangePlaceholder: ['Αρχική ημερομηνία', 'Τελική ημερομηνία'],
...CalendarLocale,
},
timePickerLocale: {
...TimePickerLocale,
},
};
// All settings at:
// https://github.com/ant-design/ant-design/issues/424
export default locale;

View File

@@ -0,0 +1,19 @@
import CalendarLocale from 'rc-calendar/lib/locale/fa_IR';
import TimePickerLocale from '../../time-picker/locale/fa_IR';
// Merge into a locale object
const locale = {
lang: {
placeholder: 'انتخاب تاریخ',
rangePlaceholder: ['تاریخ شروع', 'تاریخ پایان'],
...CalendarLocale,
},
timePickerLocale: {
...TimePickerLocale,
},
};
// All settings at:
// https://github.com/ant-design/ant-design/blob/master/components/date-picker/locale/example.json
export default locale;

View File

@@ -0,0 +1,19 @@
import CalendarLocale from 'rc-calendar/lib/locale/nb_NO';
import TimePickerLocale from '../../time-picker/locale/nb_NO';
// Merge into a locale object
const locale = {
lang: {
placeholder: 'Velg dato',
rangePlaceholder: ['Startdato', 'Sluttdato'],
...CalendarLocale,
},
timePickerLocale: {
...TimePickerLocale,
},
};
// All settings at:
// https://github.com/ant-design/ant-design/blob/master/components/date-picker/locale/example.json
export default locale;

View File

@@ -0,0 +1,46 @@
import CalendarLocale from 'rc-calendar/lib/locale/pt_PT';
import TimePickerLocale from '../../time-picker/locale/pt_PT';
// Merge into a locale object
const locale = {
lang: {
...CalendarLocale,
placeholder: 'Data',
rangePlaceholder: ['Data inicial', 'Data final'],
today: 'Hoje',
now: 'Agora',
backToToday: 'Hoje',
ok: 'Ok',
clear: 'Limpar',
month: 'Mês',
year: 'Ano',
timeSelect: 'Hora',
dateSelect: 'Selecionar data',
monthSelect: 'Selecionar mês',
yearSelect: 'Selecionar ano',
decadeSelect: 'Selecionar década',
yearFormat: 'YYYY',
dateFormat: 'D/M/YYYY',
dayFormat: 'D',
dateTimeFormat: 'D/M/YYYY HH:mm:ss',
monthFormat: 'MMMM',
monthBeforeYear: false,
previousMonth: 'Mês anterior (PageUp)',
nextMonth: 'Mês seguinte (PageDown)',
previousYear: 'Ano anterior (Control + left)',
nextYear: 'Ano seguinte (Control + right)',
previousDecade: 'Última década',
nextDecade: 'Próxima década',
previousCentury: 'Último século',
nextCentury: 'Próximo século',
},
timePickerLocale: {
...TimePickerLocale,
placeholder: 'Hora',
},
};
// All settings at:
// https://github.com/ant-design/ant-design/blob/master/components/date-picker/locale/example.json
export default locale;

View File

@@ -0,0 +1,19 @@
import CalendarLocale from 'rc-calendar/lib/locale/sr_RS';
import TimePickerLocale from '../../time-picker/locale/sr_RS';
// Merge into a locale object
const locale = {
lang: {
placeholder: 'Izaberite datum',
rangePlaceholder: ['Početni datum', 'Krajnji datum'],
...CalendarLocale,
},
timePickerLocale: {
...TimePickerLocale,
},
};
// All settings at:
// https://github.com/ant-design/ant-design/blob/master/components/date-picker/locale/example.json
export default locale;

View File

@@ -110,6 +110,7 @@
height: 22px;
color: @input-color;
background: @input-bg;
.placeholder;
}
&-week-number {
@@ -320,6 +321,7 @@
.btn;
.btn-primary;
.button-size(@btn-height-sm; @btn-padding-sm; @font-size-base; @border-radius-base);
line-height: @btn-height-sm - 2px;
&-disabled {
.button-color(@btn-disable-color; @btn-disable-bg; @btn-disable-border);

View File

@@ -51,10 +51,9 @@
right: 8px;
top: 50%;
margin-top: -7px;
line-height: 1em;
line-height: 14px;
font-size: @font-size-base;
transition: all .3s;
cursor: pointer;
user-select: none;
}
@@ -64,6 +63,7 @@
color: @disabled-color;
background: @input-bg;
pointer-events: none;
cursor: pointer;
&:hover {
color: @text-color-secondary;
}
@@ -83,7 +83,6 @@
color: @text-color-secondary;
display: inline-block;
line-height: 1;
vertical-align: bottom;
}
}
}

View File

@@ -3,7 +3,7 @@
.@{calendar-prefix-cls}-range-picker-input {
background-color: transparent;
border: 0;
height: 100%;
height: 99%;
outline: 0;
width: 43%;
text-align: center;
@@ -17,9 +17,10 @@
.@{calendar-prefix-cls}-range-picker-separator {
color: @text-color-secondary;
position: absolute;
top: 50%;
margin-top: -10px;
width: 8px;
display: inline-block;
line-height: 18px;
vertical-align: top;
}
.@{calendar-prefix-cls}-range {

View File

@@ -49,7 +49,6 @@ exports[`renders ./components/dropdown/demo/dropdown-button.md correctly 1`] = `
</button>
<button
class="ant-btn ant-dropdown-trigger ant-btn-default"
disabled=""
type="button"
>
<i

View File

@@ -10,9 +10,11 @@ export interface DropDownProps {
style?: React.CSSProperties;
onVisibleChange?: (visible?: boolean) => void;
visible?: boolean;
disabled?: boolean;
align?: Object;
getPopupContainer?: (triggerNode: Element) => HTMLElement;
prefixCls?: string;
className?: string;
placement?: 'topLeft' | 'topCenter' | 'topRight' | 'bottomLeft' | 'bottomCenter' | 'bottomRight';
}
@@ -43,17 +45,24 @@ export default class Dropdown extends React.Component<DropDownProps, any> {
}
render() {
const { children, prefixCls, overlay } = this.props;
const { children, prefixCls, overlay, trigger, disabled } = this.props;
const dropdownTrigger = cloneElement(children as any, {
className: classNames((children as any).props.className, `${prefixCls}-trigger`),
disabled,
});
// menu cannot be selectable in dropdown defaultly
const overlayProps = overlay && (overlay as any).props;
const selectable = (overlayProps && 'selectable' in overlayProps)
? overlayProps.selectable : false;
const fixedModeOverlay = cloneElement(overlay as any, {
mode: 'vertical',
selectable,
});
return (
<RcDropdown
transitionName={this.getTransitionName()}
{...this.props}
transitionName={this.getTransitionName()}
trigger={disabled ? [] : trigger}
overlay={fixedModeOverlay}
>
{dropdownTrigger}

View File

@@ -16,25 +16,30 @@ If there are too many operations to display, you can wrap them in a `Dropdown`.
| Property | Description | Type | Default |
|--------------|----------------|----------|--------------|
| trigger | the trigger mode which can execute the drop-down action | Array<'click'\|'hover'> | ['hover'] |
| trigger | the trigger mode which executes the drop-down action | Array<`click`\|`hover`> | [`hover`] |
| overlay | the dropdown menu | [Menu](/components/menu) | - |
| getPopupContainer | to set the container of the dropdown menu. The default is to create a `div` element in `body`, you can reset it to the scrolling area and make a relative reposition. [example](http://codepen.io/anon/pen/xVBOVQ?editors=001) | Function(triggerNode) | () => document.body |
| visible | determine whether the dropdown menu is visible | boolean | - |
| onVisibleChange | a callback function takes an argument: `visible`, can be executed when the visible state is changing | Function(visible) | - |
| visible | whether the dropdown menu is visible | boolean | - |
| disabled| whether the dropdown menu is disabled| boolean | - |
| onVisibleChange | a callback function takes an argument: `visible`, is executed when the visible state is changed | Function(visible) | - |
| placement | placement of pop menu: `bottomLeft` `bottomCenter` `bottomRight` `topLeft` `topCenter` `topRight` | String | `bottomLeft` |
You can get the menu list by `antd.Menu`, and set a callback function `onSelect` for it if you need. The menu items and the dividers are also available, by using `antd.Menu.Item` and `antd.Menu.Divider` respectively.
You can get the menu list by `antd.Menu`, and set a callback function `onSelect` for it if you need. The menu items and the dividers are also available, by using `Menu.Item` and `Menu.Divider` respectively.
> Warning: You must set a unique `key` for `Menu.Item`.
> Menu of Dropdown is unselectable by default, you can make it selectable via `<Menu selectable>`.
### Dropdown.Button
| Property | Description | Type | Default |
|--------------|----------------|----------|--------------|
| type | type of the button, the same as [Button](/components/button) | string | 'default' |
| type | type of the button, the same as [Button](/components/button) | string | `default` |
| size | size of the button, the same as [Button](/components/button) | string | `default` |
| onClick | a callback function, the same as [Button](/components/button), which will be executed when you click the button on the left | Function | - |
| trigger | the trigger mode which can execute the drop-down action | Array<'click'\|'hover'> | ['hover'] |
| trigger | the trigger mode which executes the drop-down action | Array<'click'\|`hover`> | [`hover`] |
| overlay | the dropdown menu | [Menu](/components/menu) | - |
| visible | determine whether the dropdown menu is visible | boolean | - |
| onVisibleChange | a callback function takes an argument: `visible`, can be executed when the visible state is changing | Function | - |
| visible | whether the dropdown menu is visible | boolean | - |
| disabled | whether the dropdown menu is disabled| boolean | - |
| onVisibleChange | a callback function takes an argument: `visible`, is executed when the visible state is changed | Function | - |
| placement | placement of pop menu: `bottomLeft` `bottomCenter` `bottomRight` `topLeft` `topCenter` `topRight` | String | `bottomLeft` |

View File

@@ -21,21 +21,26 @@ title: Dropdown
| overlay | 菜单 | [Menu](/components/menu) | - |
| getPopupContainer | 菜单渲染父节点。默认渲染到 body 上,如果你遇到菜单滚动定位问题,试试修改为滚动的区域,并相对其定位。[示例](http://codepen.io/anon/pen/xVBOVQ?editors=001) | Function(triggerNode) | () => document.body |
| visible | 菜单是否显示 | boolean | - |
| disabled | 菜单是否禁用 | boolean | - |
| onVisibleChange | 菜单显示状态改变时调用,参数为 visible | Function(visible) | - |
| placement | 菜单弹出位置:`bottomLeft` `bottomCenter` `bottomRight` `topLeft` `topCenter` `topRight` | String | `bottomLeft` |
菜单可由 `antd.Menu` 取得,可设置 `onSelect` 回调,菜单还包括菜单项 `antd.Menu.Item`,分割线 `antd.Menu.Divider`
菜单可由 `antd.Menu` 取得,可设置 `onSelect` 回调,菜单还包括菜单项 `Menu.Item`,分割线 `Menu.Divider`
> 注意: Menu.Item 必须设置唯一的 key 属性。
> Dropdown 下的 Menu 默认不可选中。如果需要菜单可选中,可以指定 `<Menu selectable>`.
### Dropdown.Button
| 参数 | 说明 | 类型 | 默认值 |
|-------------|------------------|--------------------|--------------|
| type | 按钮类型,和 [Button](/components/button/) 一致 | string | 'default' |
| size | 按钮大小,和 [Button](/components/button/) 一致 | string | 'default' |
| onClick | 点击左侧按钮的回调,和 [Button](/components/button/) 一致 | Function | - |
| trigger | 触发下拉的行为 | Array<'click'\|'hover'> | ['hover'] |
| overlay | 菜单 | [Menu](/components/menu/) | - |
| visible | 菜单是否显示 | boolean | - |
| disabled | 菜单是否禁用 | boolean | - |
| onVisibleChange | 菜单显示状态改变时调用,参数为 visible | Function | - |
| placement | 菜单弹出位置:`bottomLeft` `bottomCenter` `bottomRight` `topLeft` `topCenter` `topRight` | String | `bottomLeft` |

View File

@@ -48,6 +48,12 @@
box-shadow: @box-shadow-base;
background-clip: padding-box;
&-item-group-title {
color: @text-color-secondary;
padding: 6px 8px;
transition: all .3s;
}
&-item,
&-submenu-title {
padding: 7px 8px;

View File

@@ -9,10 +9,10 @@ import warning from '../_util/warning';
import FormItem from './FormItem';
import { FIELD_META_PROP } from './constants';
export interface FormCreateOption {
onFieldsChange?: (props: any, fields: Array<any>) => void;
onValuesChange?: (props: any, values: any) => void;
mapPropsToFields?: (props: any) => void;
export interface FormCreateOption<T> {
onFieldsChange?: (props: T, fields: Array<any>) => void;
onValuesChange?: (props: T, values: any) => void;
mapPropsToFields?: (props: T) => void;
withRef?: boolean;
}
@@ -71,6 +71,10 @@ export type GetFieldDecoratorOptions = {
rules?: ValidationRule[];
/** 是否和其他控件互斥,特别用于 Radio 单选控件 */
exclusive?: boolean;
/** Normalize value to form component */
normalize?: (value: any, prevValue: any, allValues: any) => any;
/** Whether stop validate on first rule of error for this field. */
validateFirst?: boolean;
};
// function create
@@ -110,9 +114,14 @@ export interface FormComponentProps {
form: WrappedFormUtils;
}
// https://github.com/DefinitelyTyped/DefinitelyTyped/issues/9951
export type Diff<T extends string, U extends string> =
({ [P in T]: P } & { [P in U]: never } & { [x: string]: never })[T];
export type Omit<T, K extends keyof T> = Pick<T, Diff<keyof T, K>>;
export interface ComponentDecorator<TOwnProps> {
(component: React.ComponentClass<FormComponentProps & TOwnProps>): React.ComponentClass<TOwnProps>;
<P extends FormComponentProps>(
component: React.ComponentClass<P>,
): React.ComponentClass<Omit<P, keyof FormComponentProps> & TOwnProps>;
}
export default class Form extends React.Component<FormProps, any> {
@@ -139,7 +148,7 @@ export default class Form extends React.Component<FormProps, any> {
static Item = FormItem;
static create = function<TOwnProps>(options?: FormCreateOption): ComponentDecorator<TOwnProps> {
static create = function<TOwnProps>(options: FormCreateOption<TOwnProps> = {}): ComponentDecorator<TOwnProps> {
const formWrapper = createDOMForm({
fieldNameProp: 'id',
...options,
@@ -174,8 +183,10 @@ export default class Form extends React.Component<FormProps, any> {
this.props.form.getFieldProps = this.deprecatedGetFieldProps;
const withRef: any = {};
if (options && options.withRef) {
if (options.withRef) {
withRef.ref = 'formWrappedComponent';
} else if (this.props.wrappedComponentRef) {
withRef.ref = this.props.wrappedComponentRef;
}
return <Component {...this.props} {...withRef} />;
},

View File

@@ -1,4 +1,5 @@
import React from 'react';
import { findDOMNode } from 'react-dom';
import PropTypes from 'prop-types';
import classNames from 'classnames';
import PureRenderMixin from 'rc-util/lib/PureRenderMixin';
@@ -168,7 +169,7 @@ export default class FormItem extends React.Component<FormItemProps, any> {
if (validateStatus) {
classes = classNames(
{
'has-feedback': props.hasFeedback,
'has-feedback': props.hasFeedback || validateStatus === 'validating',
'has-success': validateStatus === 'success',
'has-warning': validateStatus === 'warning',
'has-error': validateStatus === 'error',
@@ -212,6 +213,23 @@ export default class FormItem extends React.Component<FormItemProps, any> {
return false;
}
// Resolve duplicated ids bug between different forms
// https://github.com/ant-design/ant-design/issues/7351
onLabelClick = (e) => {
const id = this.props.id || this.getId();
if (!id) {
return;
}
const controls = document.querySelectorAll(`[id="${id}"]`);
if (controls.length !== 1) {
e.preventDefault();
const control = findDOMNode(this).querySelector(`[id="${id}"]`) as HTMLElement;
if (control && control.focus) {
control.focus();
}
}
}
renderLabel() {
const { prefixCls, label, labelCol, colon, id } = this.props;
const context = this.context;
@@ -239,6 +257,7 @@ export default class FormItem extends React.Component<FormItemProps, any> {
htmlFor={id || this.getId()}
className={labelClassName}
title={typeof label === 'string' ? label : ''}
onClick={this.onLabelClick}
>
{labelChildren}
</label>

View File

@@ -827,7 +827,7 @@ exports[`renders ./components/form/demo/global-state.md correctly 1`] = `
data-__meta="[object Object]"
id="username"
type="text"
value="BENJYCUI"
value="benjycui"
/>
</div>
</div>
@@ -2085,6 +2085,7 @@ exports[`renders ./components/form/demo/validate-other.md correctly 1`] = `
class="ant-select-search__field__wrap"
>
<input
autocomplete="off"
class="ant-select-search__field"
id="select-multiple"
value=""
@@ -2167,6 +2168,7 @@ exports[`renders ./components/form/demo/validate-other.md correctly 1`] = `
id="input-number"
max="10"
min="1"
step="1"
value="3"
/>
</div>
@@ -2278,6 +2280,7 @@ exports[`renders ./components/form/demo/validate-other.md correctly 1`] = `
class="ant-slider-handle"
role="slider"
style="left:0%;"
tabindex="0"
/>
<div
class="ant-slider-mark"
@@ -2771,8 +2774,185 @@ exports[`renders ./components/form/demo/validate-static.md correctly 1`] = `
</div>
</div>
</div>
<div
class="ant-row ant-form-item"
>
<div
class="ant-form-item-label ant-col-xs-24 ant-col-sm-5"
>
<label
class=""
title="Success"
>
Success
</label>
</div>
<div
class="ant-form-item-control-wrapper ant-col-xs-24 ant-col-sm-12"
>
<div
class="ant-form-item-control has-feedback has-success"
>
<span
class="ant-calendar-picker"
style="width:100%;"
>
<div>
<input
class="ant-calendar-picker-input ant-input ant-input-lg"
placeholder="请选择日期"
readonly=""
value=""
/>
<span
class="ant-calendar-picker-icon"
/>
</div>
</span>
</div>
</div>
</div>
<div
class="ant-row ant-form-item"
>
<div
class="ant-form-item-label ant-col-xs-24 ant-col-sm-5"
>
<label
class=""
title="Warning"
>
Warning
</label>
</div>
<div
class="ant-form-item-control-wrapper ant-col-xs-24 ant-col-sm-12"
>
<div
class="ant-form-item-control has-feedback has-warning"
>
<span
class="ant-time-picker ant-time-picker-large"
style="width:100%;"
>
<input
class="ant-time-picker-input"
placeholder="请选择时间"
readonly=""
type="text"
value=""
/>
<span
class="ant-time-picker-icon"
/>
</span>
</div>
</div>
</div>
<div
class="ant-row ant-form-item"
>
<div
class="ant-form-item-label ant-col-xs-24 ant-col-sm-5"
>
<label
class=""
title="Error"
>
Error
</label>
</div>
<div
class="ant-form-item-control-wrapper ant-col-xs-24 ant-col-sm-12"
>
<div
class="ant-form-item-control has-feedback has-error"
>
<div
class="ant-select-lg ant-select ant-select-enabled"
>
<div
aria-autocomplete="list"
aria-expanded="false"
aria-haspopup="true"
class="ant-select-selection
ant-select-selection--single"
role="combobox"
tabindex="0"
>
<div
class="ant-select-selection__rendered"
>
<div
class="ant-select-selection-selected-value"
style="display:block;opacity:1;"
title="Option 1"
>
Option 1
</div>
</div>
<span
class="ant-select-arrow"
style="user-select:none;-webkit-user-select:none;"
unselectable="unselectable"
>
<b />
</span>
</div>
</div>
</div>
</div>
</div>
<div
class="ant-row ant-form-item ant-form-item-with-help"
>
<div
class="ant-form-item-label ant-col-xs-24 ant-col-sm-5"
>
<label
class=""
title="Validating"
>
Validating
</label>
</div>
<div
class="ant-form-item-control-wrapper ant-col-xs-24 ant-col-sm-12"
>
<div
class="ant-form-item-control has-feedback is-validating"
>
<span
class="ant-cascader-picker"
tabindex="0"
>
<span
class="ant-cascader-picker-label"
/>
<input
autocomplete="off"
class="ant-input ant-cascader-input ant-input-lg"
readonly=""
type="text"
value=""
/>
<i
class="anticon anticon-cross-circle ant-cascader-picker-clear"
/>
<i
class="anticon anticon-down ant-cascader-picker-arrow"
/>
</span>
<div
class="ant-form-explain"
>
The information is being validated...
</div>
</div>
</div>
</div>
<div
class="ant-row ant-form-item"
>
<div
class="ant-form-item-label ant-col-xs-24 ant-col-sm-5"
@@ -2785,13 +2965,13 @@ exports[`renders ./components/form/demo/validate-static.md correctly 1`] = `
</label>
</div>
<div
class="ant-form-item-control-wrapper ant-col-xs-24 ant-col-sm-19"
class="ant-form-item-control-wrapper ant-col-xs-24 ant-col-sm-12"
>
<div
class="ant-form-item-control "
>
<div
class="ant-col-6"
class="ant-col-11"
>
<div
class="ant-row ant-form-item ant-form-item-with-help"
@@ -2827,16 +3007,16 @@ exports[`renders ./components/form/demo/validate-static.md correctly 1`] = `
</div>
</div>
<div
class="ant-col-1"
class="ant-col-2"
>
<p
class="ant-form-split"
<span
style="display:inline-block;width:100%;text-align:center;"
>
-
</p>
</span>
</div>
<div
class="ant-col-6"
class="ant-col-11"
>
<div
class="ant-row ant-form-item"
@@ -2866,9 +3046,76 @@ exports[`renders ./components/form/demo/validate-static.md correctly 1`] = `
</div>
</div>
</div>
</div>
</div>
</div>
<div
class="ant-row ant-form-item"
>
<div
class="ant-form-item-label ant-col-xs-24 ant-col-sm-5"
>
<label
class=""
title="Success"
>
Success
</label>
</div>
<div
class="ant-form-item-control-wrapper ant-col-xs-24 ant-col-sm-12"
>
<div
class="ant-form-item-control has-feedback has-success"
>
<div
class="ant-form-explain"
/>
class="ant-input-number ant-input-number-lg"
style="width:100%;"
>
<div
class="ant-input-number-handler-wrap"
>
<span
aria-disabled="false"
aria-label="Increase Value"
class="ant-input-number-handler ant-input-number-handler-up "
role="button"
unselectable="unselectable"
>
<span
class="ant-input-number-handler-up-inner"
unselectable="unselectable"
/>
</span>
<span
aria-disabled="false"
aria-label="Decrease Value"
class="ant-input-number-handler ant-input-number-handler-down "
role="button"
unselectable="unselectable"
>
<span
class="ant-input-number-handler-down-inner"
unselectable="unselectable"
/>
</span>
</div>
<div
aria-valuemax="9007199254740991"
aria-valuemin="-9007199254740991"
class="ant-input-number-input-wrap"
role="spinbutton"
>
<input
autocomplete="off"
class="ant-input-number-input"
max="9007199254740991"
min="-9007199254740991"
step="1"
value=""
/>
</div>
</div>
</div>
</div>
</div>
@@ -2941,6 +3188,7 @@ exports[`renders ./components/form/demo/without-form-create.md correctly 1`] = `
class="ant-input-number-input"
max="12"
min="8"
step="1"
value="11"
/>
</div>

View File

@@ -50,4 +50,43 @@ describe('Form', () => {
expect(wrapper.find('.ant-form-item-control-wrapper').length).toBe(2);
expect(wrapper.find('.ant-form-item-control-wrapper.ant-col-14').length).toBe(1);
});
// https://github.com/ant-design/ant-design/issues/7351
it('focus correct input when click label', () => {
const Form1 = Form.create()(({ form }) => (
<Form>
<Form.Item label="label 1">
{form.getFieldDecorator('test')(<input />)}
</Form.Item>
</Form>
));
const Form2 = Form.create()(({ form }) => (
<Form>
<Form.Item label="label 2">
{form.getFieldDecorator('test2')(<input />)}
</Form.Item>
</Form>
));
const wrapper = mount(<div><Form1 /><Form2 /></div>);
wrapper.find('Form label').at(0).simulate('click');
expect(wrapper.find('Form input').at(0).node).toBe(document.activeElement);
wrapper.find('Form label').at(1).simulate('click');
expect(wrapper.find('Form input').at(1).node).toBe(document.activeElement);
});
// https://github.com/ant-design/ant-design/issues/7693
it('should not throw error when is not a valid id', () => {
const Form1 = Form.create()(({ form }) => (
<Form>
<Form.Item label="label 1">
{form.getFieldDecorator('member[0].name.firstname')(<input />)}
</Form.Item>
</Form>
));
const wrapper = mount(<Form1 />);
expect(() => {
wrapper.find('Form label').at(0).simulate('click');
}).not.toThrow();
expect(wrapper.find('Form input').at(0).node).toBe(document.activeElement);
});
});

View File

@@ -0,0 +1,36 @@
/* tslint:disable */
import React from 'react';
import Form, { FormComponentProps } from '../Form';
// test Form.create on component without own props
class WithoutOwnProps extends React.Component<any, any> {
state = {
foo: 'bar',
};
render() {
return <div>foo</div>;
}
}
const WithoutOwnPropsForm = Form.create()(WithoutOwnProps);
<WithoutOwnPropsForm />;
// test Form.create on component with own props
interface WithOwnPropsProps extends FormComponentProps {
name: string;
}
class WithOwnProps extends React.Component<WithOwnPropsProps, any> {
state = {
foo: 'bar',
};
render() {
return <div>foo</div>;
}
}
const WithOwnPropsForm = Form.create()(WithOwnProps);
<WithOwnPropsForm name="foo" />;

View File

@@ -25,7 +25,7 @@ const CustomizedForm = Form.create({
return {
username: {
...props.username,
value: props.username.value.toUpperCase(),
value: props.username.value,
},
};
},

View File

@@ -22,8 +22,9 @@ We provide properties like `validateStatus` `help` `hasFeedback` to customize yo
3. `help`: display validate message.
````jsx
import { Form, Input, DatePicker, Col } from 'antd';
import { Form, Input, DatePicker, Col, TimePicker, Select, Cascader, InputNumber } from 'antd';
const FormItem = Form.Item;
const Option = Select.Option;
const formItemLayout = {
labelCol: {
@@ -94,31 +95,75 @@ ReactDOM.render(
</FormItem>
<FormItem
label="inline"
labelCol={{
xs: { span: 24 },
sm: { span: 5 },
}}
wrapperCol={{
xs: { span: 24 },
sm: { span: 19 },
}}
help
{...formItemLayout}
label="Success"
hasFeedback
validateStatus="success"
>
<Col span={6}>
<DatePicker style={{ width: '100%' }} />
</FormItem>
<FormItem
{...formItemLayout}
label="Warning"
hasFeedback
validateStatus="warning"
>
<TimePicker style={{ width: '100%' }} />
</FormItem>
<FormItem
{...formItemLayout}
label="Error"
hasFeedback
validateStatus="error"
>
<Select defaultValue="1">
<Option value="1">Option 1</Option>
<Option value="2">Option 2</Option>
<Option value="3">Option 3</Option>
</Select>
</FormItem>
<FormItem
{...formItemLayout}
label="Validating"
hasFeedback
validateStatus="validating"
help="The information is being validated..."
>
<Cascader defaultValue={['1']} options={[]} />
</FormItem>
<FormItem
label="inline"
{...formItemLayout}
>
<Col span={11}>
<FormItem validateStatus="error" help="Please select the correct date">
<DatePicker />
</FormItem>
</Col>
<Col span={1}>
<p className="ant-form-split">-</p>
<Col span={2}>
<span style={{ display: 'inline-block', width: '100%', textAlign: 'center' }}>
-
</span>
</Col>
<Col span={6}>
<Col span={11}>
<FormItem>
<DatePicker />
</FormItem>
</Col>
</FormItem>
<FormItem
{...formItemLayout}
label="Success"
hasFeedback
validateStatus="success"
>
<InputNumber style={{ width: '100%' }} />
</FormItem>
</Form>
, mountNode);
````

View File

@@ -59,14 +59,14 @@ The following `options` are available:
| Property | Description | Type |
|-----------|------------------------------------------|------------|
| onFieldsChange | Specify a function that will be called when the value a `Form.Item` gets changed. Usage example: saving the field's value to Redux store. | Function(props, fields) |
| mapPropsToFields | Convert props to corresponding field value. Usage example: reading the values from Redux store. | Function(props): Object{ fieldName: Object{ value } } |
| mapPropsToFields | Convert props to field value. Usage example: reading the values from Redux store. | Function(props): Object{ fieldName: Object{ value } } |
| onValuesChange | A handler while value of any field is changed | (props, values) => void |
If the form has been decorated by `Form.create` then it has `this.props.form` property. `this.props.form` provides some APIs as follows:
> Note: Before using `getFieldsValue` `getFieldValue` `setFieldsValue` and so on, please make sure that corresponding field had been registered with `getFieldDecorator`.
| Property | Description | Type |
| Method | Description | Type |
|-----------|------------------------------------------|------------|
| getFieldsValue | Get the specified fields' values. If you don't specify a parameter, you will get all fields' values. | Function([fieldNames: string[]]) |
| getFieldValue | Get the value of a field. | Function(fieldName: string) |
@@ -83,17 +83,28 @@ If the form has been decorated by `Form.create` then it has `this.props.form` pr
| resetFields | Reset the specified fields' value(to `initialValue`) and status. If you don't specify a parameter, all the fields will be reset. | Function([names: string[]]) |
| getFieldDecorator | Two-way binding for form, please read below for details. | |
### this.props.form.validateFields/validateFieldsAndScroll([fieldNames: string[]], [options: object], callback: Function(errors, values))
| Method | Description | Type | Default |
|-----|-----|------|-------|
| options.first | If `true`, every field will stop validation at first failed rule | boolean | false |
| options.firstFields | Those fields will stop validation at first failed rule | String[] | [] |
| options.force | Should validate validated field again when `validateTrigger` is been triggered again | boolean | false |
| options.scroll | Config scroll behavior of `validateFieldsAndScroll`, more: [dom-scroll-into-view's config](https://github.com/yiminghe/dom-scroll-into-view#function-parameter) | Object | {} |
### this.props.form.getFieldDecorator(id, options)
After wrapped by `getFieldDecorator`, `value`(or other property defined by `valuePropName`) `onChange`(or other property defined by `trigger`) props will be added to form controlsthe flow of form data will be handled by Form which will cause:
1. You don't need to use `onChange` to collect data, but you still can listen to `onChange`(and so on) events.
1. You shouldn't to use `onChange` to collect data, but you still can listen to `onChange`(and so on) events.
2. You can not set value of form control via `value` `defaultValue` prop, and you should set default value with `initialValue` in `getFieldDecorator` instead.
3. You don't need to call `setState` manually, please use `this.props.form.setFieldsValue` to change value programmatically.
3. You shouldn't to call `setState` manually, please use `this.props.form.setFieldsValue` to change value programmatically.
#### Special attention
If you use `react@<15.3.0`, then, you can't use `getFieldDecorator` in stateless component: https://github.com/facebook/react/pull/6534
1. `getFieldDecorator` can not be used to decorate stateless component.
1. If you use `react@<15.3.0`, then, you can't use `getFieldDecorator` in stateless component: https://github.com/facebook/react/pull/6534
#### getFieldDecorator(id, options) parameters
@@ -106,6 +117,7 @@ If you use `react@<15.3.0`, then, you can't use `getFieldDecorator` in stateless
| options.getValueFromEvent | Specify how to get value from event or other onChange arguments | function(..args) | [reference](https://github.com/react-component/form#option-object) |
| options.validateTrigger | When to validate the value of children node. | string\|string[] | 'onChange' |
| options.rules | Includes validation rules. Please refer to "Validation Rules" part for details. | object[] | n/a |
| options.validateFirst | Whether stop validate on first rule of error for this field. | boolean | false |
| options.exclusive | Whether it is exclusive with other controls, particularly for Radio. | boolean | false |
| options.normalize | Normalize value to form component, [a select-all example](https://codepen.io/afc163/pen/JJVXzG?editors=001) | function(value, prevValue, allValues): any | - |
@@ -152,3 +164,20 @@ See more advanced usage at [async-validator](https://github.com/yiminghe/async-v
max-width: 540px;
}
</style>
## Using in TypeScript
```jsx
import { Form } from 'antd';
import { FormComponentProps } from 'antd/lib/form/Form';
interface UserFormProps extends FormComponentProps {
age: number;
name: string;
}
class UserForm extends React.Component<UserFormProps, any> {
}

View File

@@ -61,14 +61,14 @@ CustomizedForm = Form.create({})(CustomizedForm);
| 参数 | 说明 | 类型 |
|-----------|------------------------------------------|------------|
| onFieldsChange | 当 `Form.Item` 子节点的值发生改变时触发,可以把对应的值转存到 Redux store | Function(props, fields) |
| mapPropsToFields | 把 props 转为对应的值,可用于把 Redux store 中的值读出 | Function(props): Object{ fieldName: Object{ value } } |
| mapPropsToFields | 把父组件的属性映射到表单项上(可用于把 Redux store 中的值读出 | Function(props): Object{ fieldName: Object{ value } } |
| onValuesChange | 任一表单域的值发生改变时的回调 | (props, values) => void |
经过 `Form.create` 包装的组件将会自带 `this.props.form` 属性,`this.props.form` 提供的 API 如下:
> 注意:使用 `getFieldsValue` `getFieldValue` `setFieldsValue` 等时,应确保对应的 field 已经用 `getFieldDecorator` 注册过了。
| 参数 | 说明 | 类型 |
| 方法      | 说明                                     | 类型       |
|-----------|------------------------------------------|------------|
| getFieldsValue | 获取一组输入控件的值,如不传入参数,则获取全部组件的值 | Function([fieldNames: string[]]) |
| getFieldValue | 获取一个输入控件的值 | Function(fieldName: string) |
@@ -84,17 +84,27 @@ CustomizedForm = Form.create({})(CustomizedForm);
| resetFields | 重置一组输入控件的值(为 `initialValue`)与状态,如不传入参数,则重置所有组件 | Function([names: string[]]) |
| getFieldDecorator | 用于和表单进行双向绑定,详见下方描述 | |
### this.props.form.validateFields/validateFieldsAndScroll([fieldNames: string[]], [options: object], callback: Function(errors, values))
| 参数 | 说明 | 类型 | 默认值 |
|-----|-----|------|-------|
| options.first | 若为 true则每一表单域的都会在碰到第一个失败了的校验规则后停止校验 | boolean | false |
| options.firstFields | 指定表单域会在碰到第一个失败了的校验规则后停止校验 | String[] | [] |
| options.force | 对已经校验过的表单域,在 validateTrigger 再次被触发时是否再次校验 | boolean | false |
| options.scroll | 定义 validateFieldsAndScroll 的滚动行为,详细配置见 [dom-scroll-into-view config](https://github.com/yiminghe/dom-scroll-into-view#function-parameter) | Object | {} |
### this.props.form.getFieldDecorator(id, options)
经过 `getFieldDecorator` 包装的控件,表单控件会自动添加 `value`(或 `valuePropName` 指定的其他属性) `onChange`(或 `trigger` 指定的其他属性),数据同步将被 Form 接管,这会导致以下结果:
1. 你不再需要用 `onChange` 来做同步,但还是可以继续监听 `onChange` 等事件。
1.**不再需要也不应该**`onChange` 来做同步,但还是可以继续监听 `onChange` 等事件。
2. 你不能用控件的 `value` `defaultValue` 等属性来设置表单域的值,默认值可以用 `getFieldDecorator` 里的 `initialValue`
3. 你不需要`setState`,可以使用 `this.props.form.setFieldsValue` 来动态改变表单值。
3. 你不应该`setState`,可以使用 `this.props.form.setFieldsValue` 来动态改变表单值。
#### 特别注意
如果使用的是 `react@<15.3.0`,则 `getFieldDecorator` 调用不能位于纯函数组件中: https://github.com/facebook/react/pull/6534
1. `getFieldDecorator` 不能用于装饰纯函数组件。
1. 如果使用的是 `react@<15.3.0`,则 `getFieldDecorator` 调用不能位于纯函数组件中: https://github.com/facebook/react/pull/6534
#### getFieldDecorator(id, options) 参数
@@ -107,6 +117,7 @@ CustomizedForm = Form.create({})(CustomizedForm);
| options.getValueFromEvent | 可以把 onChange 的参数(如 event转化为控件的值 | function(..args) | [reference](https://github.com/react-component/form#option-object) |
| options.validateTrigger | 校验子节点值的时机 | string\|string[] | 'onChange' |
| options.rules | 校验规则,参考下方文档 | object[] | |
| options.validateFirst | 当某一规则校验不通过时,是否停止剩下的规则的校验 | boolean | false |
| options.exclusive | 是否和其他控件互斥,特别用于 Radio 单选控件 | boolean | false |
| options.normalize | 转换默认的 value 给控件,[一个选择全部的例子](https://codepen.io/afc163/pen/JJVXzG?editors=001) | function(value, prevValue, allValues): any | - |
@@ -153,3 +164,19 @@ validator | 自定义校验(注意,[callback 必须被调用](https://github
max-width: 540px;
}
</style>
## 在 TypeScript 中使用
```jsx
import { Form } from 'antd';
import { FormComponentProps } from 'antd/lib/form/Form';
interface UserFormProps extends FormComponentProps {
age: number;
name: string;
}
class UserForm extends React.Component<UserFormProps, any> {
}

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