Compare commits

...

446 Commits

Author SHA1 Message Date
Wei Zhu
358aa84fef Bump 2.13.12 2018-02-26 20:01:00 +08:00
Wei Zhu
6f716d1003 Add 2.13.12 change log 2018-02-26 20:00:36 +08:00
Wei Zhu
739c6ead54 Lock @types/react and @types/react-dom version 2018-02-26 19:46:55 +08:00
Wei Zhu
a7255ee885 Fix #8885 2018-02-26 19:21:24 +08:00
junjing.zhang
06ff0d44db fix lint fail - use babel-eslint-8.0.2 2018-01-03 19:06:37 +08:00
junjing.zhang
e96b0fc768 fix components/collapse test fail 2018-01-03 19:06:37 +08:00
junjing.zhang
8489fedb4c anchor scroll supports complete href link - test
anchor scroll supports complete href link, e.g. http://www.example.com/#id, not just #id
2018-01-03 19:06:37 +08:00
junjing.zhang
adf98d3c19 anchor scroll supports complete href link
anchor scroll supports complete href link, e.g. http://www.example.com/#id, not just #id
2018-01-03 19:06:37 +08:00
afc163
ba87b45903 Fix snapshot for moment@2.20 2017-12-17 18:57:10 +08:00
afc163
1e8830637f Fix submenu popup issue when specified unexisted defaultOpenKeys
close #8475
2017-12-17 18:54:31 +08:00
nikogu
2275195e15 bump 2.13.11 2017-12-02 17:47:19 +08:00
niko
dcf9d4c294 2.13.11 changelog (#8403) 2017-12-02 17:38:41 +08:00
Mathew
6f37caefe7 Update de_DE.tsx to support Upload component (#8394)
- Added german translations
2017-12-01 10:30:31 +08:00
Nathan Griffin
51b6e4904a Adding missing type properties (#8395) 2017-12-01 10:29:48 +08:00
Sam Maxwell
378084376a update moment package number (#8388) 2017-11-30 20:06:00 +08:00
Benjy Cui
57dcc78989 fix: should not override default footer, close: #8379 2017-11-30 17:24:51 +08:00
Wei Zhu
179528af50 Don't change fileList when beforeUpload returns false (#8299)
Close #8036
2017-11-29 20:28:19 +08:00
ddcat1115
91fc059c9d fix input with addon(in form) vertical align issue (#8325) 2017-11-29 11:20:38 +08:00
afc163
c08e486e1a Fix typo 2017-11-28 19:02:16 +08:00
afc163
72741db902 Fix margin of nested FormItem, close #8320 2017-11-27 22:14:15 +08:00
Cody Chan
086ecec310 docs(transfer): append description for render property (#8335) 2017-11-27 20:48:16 +08:00
afc163
bf70d30a60 no prevent label click default behavior 2017-11-27 11:02:47 +08:00
afc163
9a49a5c775 revert 61968b91 2017-11-27 11:01:06 +08:00
afc163
539cca5cc4 update snapshot 2017-11-27 10:53:54 +08:00
afc163
7604495ab4 Fix RadioGroup id props 2017-11-27 10:49:17 +08:00
afc163
61968b91cf Fix link in form item label 2017-11-27 10:43:35 +08:00
afc163
892de0c609 update translation word 2017-11-27 00:09:59 +08:00
Wei Zhu
8e907cebde Fix tree draggable demo
Close #8246
2017-11-24 15:29:36 +08:00
ddcat1115
0865824b61 fix buttonSize type
close #8304
2017-11-24 14:46:55 +08:00
Maximilian Meyer
6707824611 Update due to typo (#8288)
TYPO
2017-11-22 19:06:24 +08:00
潘晓升
8b2d7e3982 Update index.tsx (#8280)
add the “style” property for declare file
2017-11-22 14:46:40 +08:00
Wei Zhu
58fa1885fd docs: flay badge 2017-11-22 14:18:47 +08:00
afc163
669b3c5b2e update doc, close #8272 2017-11-22 10:50:39 +08:00
slientcloud
499b81f79d fix(tooltip): support defaultVisible for tooltip, close #8257 (#8258) 2017-11-21 15:53:03 +08:00
afc163
1e1baf01f6 remove react extenals 2017-11-21 15:49:17 +08:00
Nokecy
08d27b92ee inputNumber 添加onKeyDown属性声明 (#8253) 2017-11-21 11:15:38 +08:00
afc163
6db2630e90 site: fix code demo box style in IE11 2017-11-21 11:12:20 +08:00
afc163
9dd858cc62 Fix selector priority, close #8245 2017-11-21 10:19:11 +08:00
Wei Zhu
814f9a72de Set work-break explicitly form progress text 2017-11-20 14:59:13 +08:00
Wei Zhu
c37b1e8425 site: exclude palatte color
fix #8161
2017-11-20 12:25:45 +08:00
Wei Zhu
9fb590fe9d Stick eslint-plugin-react to 7.4.0
https://github.com/yannickcr/eslint-plugin-react/issues/1543
2017-11-19 14:25:17 +08:00
afc163
5cca35cab9 update doc 2017-11-18 13:53:57 +08:00
David Tsai
b3b3ee043e Update Select component documentation (#8229)
Providing clarity through reworking the description(s) on usage.
2017-11-18 13:13:55 +08:00
afc163
32d96e366b Refator to allow set color of Rate easily
now we can use `<Rate style={{ color: '#00c' }}>`

close #8197
2017-11-18 01:10:46 +08:00
afc163
b77e7ed554 Fix extra 0.5px height in chrome
close #8220
2017-11-17 12:13:07 +08:00
afc163
46d1296045 Fix async test cases 2017-11-16 17:12:36 +08:00
afc163
9a9196ca10 Fix doc 2017-11-15 17:02:49 +08:00
afc163
11a3ce4cc6 multiple emails 2017-11-15 17:01:19 +08:00
afc163
9b552087cd Fix tag test case 2017-11-15 15:00:29 +08:00
afc163
1117de7c6f site: fix version select width 2017-11-15 13:32:13 +08:00
afc163
e0be248847 Add antue 2017-11-14 23:05:51 +08:00
afc163
4535800fa3 update 2017-11-14 22:42:47 +08:00
偏右
716c49c55f Update work-with-us.md 2017-11-13 15:48:19 +08:00
Wei Zhu
645be586f3 Run jest.useFakeTimers in beforeAll 2017-11-13 10:46:54 +08:00
Benjy Cui
16133aac65 docs: add validateMessage for createForm, close: #965 2017-11-13 10:36:16 +08:00
Arnaud Benhamdine
5402dfe66e Improve changelog english wording (#8173) 2017-11-12 19:17:15 +08:00
afc163
65b5769abd bump 2.13.10 2017-11-12 15:22:12 +08:00
afc163
cad769af91 No more __ANT_LAYOUT_SIDER in favor of #8077 2017-11-12 15:22:02 +08:00
afc163
2ecb52cd7c Add emoji for changelog 2017-11-12 15:02:15 +08:00
Wei Zhu
0c7ce9db17 Use props
Related #7706
2017-11-10 09:48:07 +08:00
Zach Guo
c1ce2cd82c docs: fix pattern/form invalid tag error (#8159) 2017-11-10 09:35:27 +08:00
afc163
54188b8e97 Reset timer in test 2017-11-09 20:33:25 +08:00
afc163
148e5bd887 Fix super argument 2017-11-09 20:17:03 +08:00
afc163
ea185fe288 Fix code style 2017-11-09 20:14:51 +08:00
afc163
0eca38ba2f Add has sider test case, ref #8077 2017-11-09 20:13:59 +08:00
Yasin Uslu
b3e1192482 Detect Sider even if it's not first child of layout (#8077)
* Fix typo in layout

* Detect Sider even if it's not first child of layout
2017-11-09 20:04:34 +08:00
afc163
d30e398859 Fix upload.test.js 2017-11-09 19:34:48 +08:00
Lyndon001
dd531b8428 Update work-with-us.md 2017-11-09 03:36:55 -06:00
afc163
1b45a2c005 update footer 2017-11-09 16:53:05 +08:00
afc163
9ffd545b24 fix order 2017-11-09 16:50:29 +08:00
afc163
23033cb9c1 Add work-with-us 2017-11-09 16:49:04 +08:00
chaofeis
c168a92f18 docs: add missing key prop for controlled tag demo (#1) (#8147) 2017-11-08 23:46:24 -06:00
afc163
72aa5e0763 Fix input group align bug in Chrome 62
close ant-design/ant-design-pro#139
2017-11-08 19:53:03 +08:00
D & R
10ab3f5187 fix flattenTree in Cascader (#8130) (#8136) 2017-11-08 15:56:58 +08:00
afc163
00227e8688 test node 8 in travis 2017-11-08 15:47:12 +08:00
afc163
198d033e21 upgrade @types/react to 16 2017-11-08 15:42:57 +08:00
afc163
4790f84657 Fix AutoComplete and Input affix style conflict, close #8081 2017-11-08 15:11:57 +08:00
afc163
2d17d8a768 refactor edit-row demo, close #8026 2017-11-07 21:03:14 +08:00
Wei Zhu
e5a57ff60a Improve Select type definition
Close #8128
2017-11-07 17:33:09 +08:00
afc163
b740d86bbf update feedback.md 2017-11-07 14:58:36 +08:00
afc163
ac96bad478 Improve demo details and update snapshot 2017-11-06 21:14:40 +08:00
Benjy Cui
6bedfb6a5c bump 2.13.9 2017-11-06 10:18:53 +08:00
Benjy Cui
be38298f8e docs: add changelog for 2.13.9 (#8105) 2017-11-05 20:16:46 -06:00
Benjy Cui
ffe36725d6 docs: remove duplicated APIs 2017-11-06 10:01:39 +08:00
afc163
32b2c21145 site: fix header button style 2017-11-03 15:29:25 +08:00
afc163
5fc64a8433 Add emoji-mart into recommandation 2017-11-03 15:07:42 +08:00
Benjy Cui
de0493d82b docs: translate, ref: #8100 2017-11-03 15:02:26 +08:00
Josué
c00a2aabe2 docs: add missed time picker props (#8100)
* Add missed time-picker props

* Update time picker docs for missed props
2017-11-03 01:55:06 -05:00
afc163
59db56e953 Fix popupVisible of Cascader not working, close #8088 2017-11-03 13:03:54 +08:00
Kyle Kelley
43864988e3 correct spelling of progress (#8101)
`@process-default-color` --> `@progress-default-color`
2017-11-03 09:43:02 +08:00
David Schneider
a5c3a6c930 In SliderProps type definition, replace void types with null. (#8102)
With TypeScript compiler option ‘strictNullChecks’ enabled, the value `null` cannot be assigned to type `void`. This means, for instance, that it’s impossible to pass a `null` value for prop `step`. I don’t expect that substituting `null` for `void` in these type definitions should cause anyone difficulty; because these are optional props, a consumer of this component should be able to pass `null` or `undefined` safely, whether or not the compiler is using strict null checks.
2017-11-03 09:40:56 +08:00
afc163
1af37103f3 use ghost 2017-11-02 11:18:32 +08:00
Andreas Cederström
a3610603bf Upgrade documentation of use with create-react-app (#8085)
https://github.com/timarney/react-app-rewired have new compose protocol.

Check: https://github.com/timarney/react-app-rewired/tree/master/packages/react-app-rewire-less
2017-11-01 18:53:20 +08:00
afc163
bf82b4c49b Fix suffix of Input.Search
close #7970
2017-11-01 12:12:16 +08:00
afc163
9583bb4c85 Add Ant Design Pro 2017-11-01 10:50:27 +08:00
afc163
36df1c5f83 site: target should be _blank 2017-10-31 21:58:41 +08:00
afc163
cc305209c0 Fix badge in header 2017-10-31 18:07:37 +08:00
afc163
3e7ade8d4e Fix link color 2017-10-31 17:51:35 +08:00
afc163
2075b056f7 Fix link color 2017-10-31 17:44:44 +08:00
afc163
ace590273a Add pro link 2017-10-31 16:32:09 +08:00
afc163
7c3a483190 Fix input checkbox or radio disappeared, ref #7974 2017-10-30 13:19:53 +08:00
翁润雨
f64e24af8c add the 'selectable' attribute (#8048) 2017-10-28 19:39:33 +08:00
nikogu
4166474d07 bump 2.13.8 - change version 2017-10-28 18:52:06 +08:00
niko
9bb216ea19 2.13.8 change log review (#8041)
bump 2.13.8
2017-10-28 05:34:10 -05:00
afc163
dcde9e7b60 Remove modao 2017-10-28 17:03:56 +08:00
afc163
a666a59eb0 Add china mirror link in footer 2017-10-28 00:09:55 +08:00
vgeyi
8bde0c0fee Rewrite the MenuItem to handle ref for react 16 (#8037)
* ReWrite MenuItem to remove ref warning for react 16

* unified coding style

* add removing semicolon
2017-10-27 07:21:34 -05:00
nikogu
9696739a36 update Menu snapshots 2017-10-27 18:24:07 +08:00
nikogu
c664d843fb fixed: https://github.com/ant-design/ant-design/issues/8040 2017-10-27 17:40:31 +08:00
afc163
3c4cc688a1 Fix install warning, close #8030 2017-10-27 10:02:08 +08:00
afc163
ad9809ec2e Fix extra padding of loading Card when it is too wide 2017-10-26 19:20:12 +08:00
Wei Zhu
5660e81541 Remove debug code 2017-10-25 17:43:09 +08:00
Kiho · Cham
9ecce8d90f missing the array first element xs (#8010) 2017-10-25 00:58:10 -05:00
Wei Zhu
36227a10db docs: sort api table 2017-10-25 10:25:44 +08:00
Wei Zhu
caeaba68fc Merge pull request #7896 from monkindey/antd_api_sort_base_master
doc: sort api following some rule
2017-10-25 10:22:46 +08:00
Wei Zhu
f28d0d4d82 docs: Document onRowContextMenu
close #7820
2017-10-25 10:00:44 +08:00
For177
6d68d5d8fc Update index.zh-CN.md (#8002) 2017-10-24 04:31:12 -05:00
monkindey
a22bcec4e7 add size props group sorting 2017-10-24 14:34:58 +08:00
monkindey
fe19a9b124 rerun api-sort script 2017-10-24 11:22:57 +08:00
monkindey
990d9c6192 format the conflicted table markdown 2017-10-24 11:21:04 +08:00
monkindey
7d26fb10e0 correct the conflict 2017-10-24 11:21:04 +08:00
monkindey
2a92b7a9fa feat: add sort api table script 2017-10-24 11:21:04 +08:00
monkindey
ea926fecaf also resolve conflicted file 2017-10-24 11:20:45 +08:00
monkindey
0bc5936b23 resolve conflicted files 2017-10-24 11:16:48 +08:00
Eric Thomas
4a3602b536 docs:Fix spelling of difference (#7995) 2017-10-23 21:20:57 -05:00
afc163
3c1b4da51e Fix autoprefix warning 2017-10-23 20:53:59 +08:00
Wei Zhu
f03af93b86 Optimize ci scripts 2017-10-23 16:32:42 +08:00
Wei Zhu
d829f6c008 docs: expandedRowRender can not be boolean 2017-10-23 11:21:05 +08:00
Benjy Cui
ff5d05129f docs: translate 1599686 2017-10-23 10:37:31 +08:00
kossel
1599686fc2 docs: update docs for Modal, close #7840 (#7952) 2017-10-22 21:35:47 -05:00
afc163
65ee579480 update footer links 2017-10-23 10:08:12 +08:00
朮厃
8e1cb081db Remove the inner shadow on iOS inputs. (#7974) 2017-10-23 10:05:53 +08:00
ddcat1115
6d94fa0efe update travis node version 2017-10-23 10:01:13 +08:00
ddcat1115
4cfb34ee4f try to fix ci 2017-10-23 00:08:47 +08:00
ddcat1115
c9bc8d7095 fix Upload ci 2017-10-22 23:36:27 +08:00
ddcat1115
1f57cf4e51 version 2.13.7 2017-10-22 17:44:23 +08:00
ddcat1115
12819130ec fix Table filter can't show after remove fixed setting. (#7962)
* fix Table filter can't show after remove fixed setting.
close #7909

* improve
2017-10-22 02:54:12 -05:00
afc163
8e09745def Fix #7969 2017-10-22 15:23:34 +08:00
afc163
86da4a95ce Fix lint 2017-10-21 20:06:12 +08:00
afc163
7286e6d0d0 Fix extra margin in sider Layout
which is a margin collaspe problem

close #7967

ref: https://stackoverflow.com/a/33132624/3040605
2017-10-21 15:12:56 +08:00
syssam
f8b7aad53d less variable @form-vertical-label-padding, @form-vertical-label-margin, @input-padding-horizontal-base, @input-padding-horizontal-sm, @input-padding-horizontal-lg (#7886) (#7919) 2017-10-20 15:11:44 +08:00
afc163
3d6b142621 fix notification ci 2017-10-20 15:10:53 +08:00
Stephen Esser
88ed97b63d doc: Fix spelling mistake in Select demo (#7932) 2017-10-20 14:54:57 +08:00
afc163
3bc8f1ce5a Tweak form nested form style 2017-10-20 11:35:05 +08:00
vgeyi
d64ab68adb Cascade add prefixCls for child Input (#7945) 2017-10-19 21:55:06 -05:00
Zhang Zhi
7bc6aad1fd Update button code to make it more clearer (#7929)
* remove unnecessary default value of 'size' prop

* `clicked` should be a state
2017-10-19 21:52:06 -05:00
memoryza
cf397a27f0 update Breadcrumb readme (#7947)
* update Breadcrumb readme

* update english
2017-10-19 22:36:49 +08:00
ddcat1115
712637907d fix #7930 2017-10-18 23:52:54 +08:00
afc163
f33b1a279a update style 2017-10-18 19:45:41 +08:00
Nekron
5017234381 doc: fix spelling mistakes in dropdown demo (#7912) 2017-10-17 11:20:33 -05:00
afc163
e7eb8693b6 Fix snap 2017-10-17 21:32:01 +08:00
afc163
c2e91d3b22 update some demo 2017-10-17 21:03:23 +08:00
afc163
43d8c6ad37 Fix input height in AutoComplete 2017-10-17 15:19:38 +08:00
Benjy Cui
7841386fcd fix: should close panel when click presetted ranges, close: #7747 2017-10-17 13:57:39 +08:00
afc163
f26217b36f Tweak checkbox margin 2017-10-17 11:06:25 +08:00
afc163
fda3f6ddcd doc: fix expandedRowRender type, close #7901 2017-10-16 21:22:16 +08:00
henryv0
2356333c54 Updates Pattern docs (English) (#7902)
* Makes grammatical and typo fixes to the React Docs.

* Fixes some spelling and grammar in Pattern docs.

* Fixes merge conflict. Updates Pattern docs.
2017-10-16 21:17:42 +08:00
afc163
2a34866e83 update layout demo 2017-10-16 20:39:53 +08:00
Wei Zhu
e6b1ba6a28 Mock requests 2017-10-15 17:34:03 +08:00
vgeyi
0a6475cb0d Badge add scrollNumberPrefixCls (#7882)
* badge add scrollNumberPrefixCls

* badge add scrollNumberPrefixCls
2017-10-14 14:29:18 +08:00
Mário Gonçalves
d4a5606b92 Fix description value (#7877)
Double quote on description value was causing a rendering error
2017-10-12 22:03:19 +08:00
afc163
d650c1bf50 use bisheng 0.25 for react 15 2017-10-12 20:05:35 +08:00
afc163
73c9be2f40 bump 2.13.6 2017-10-12 14:52:39 +08:00
偏右
43362de756 Fix beforeUpload will stop uploading when return (#7870)
value is undefined

it should be same as rc-upload
2017-10-12 14:48:35 +08:00
偏右
b77cc6392e Improve upload status test case (#7869)
* Add some companies

* test: generate snapshot in upload onChange

* change action

* upgrade travis node version

* fix ci
2017-10-12 14:09:17 +08:00
Arnaud Benhamdine
2799b73d21 docs: improve changelog wording (#7863) 2017-10-11 20:15:07 -05:00
Alexander Suevalov
35b2c5e58f Adding missing optional Upload property to LocaleProviderProps (#7862) 2017-10-11 07:13:39 -05:00
Wei Zhu
3c0103f8c5 Bump 2.13.5 2017-10-11 20:11:19 +08:00
Wei Zhu
09b1d4ffa0 2.13.5 Changelog (#7861) 2017-10-11 07:10:22 -05:00
afc163
627e94fa5a upgrade some devDependencies 2017-10-11 18:20:05 +08:00
afc163
3f54dbd3d2 document dropdown menu 2017-10-11 17:42:36 +08:00
afc163
43659752d2 Fix hasFeedback icon overlap
close #7854
2017-10-11 10:37:45 +08:00
偏右
2b7a60224b Fix upload ci (#7849)
* Fix upload test case

* update delay time for uploading status
2017-10-10 21:48:21 +08:00
afc163
5a5bb9c3a0 Fix upload snapshot 2017-10-10 19:54:05 +08:00
afc163
b437233467 Fix upload picture loading style 2017-10-10 16:23:25 +08:00
afc163
c3f1d0bba6 Add test case for upload 2017-10-10 15:59:13 +08:00
Wei Zhu
0d572c72a9 Add test for 9a5894c
9a5894c46e
2017-10-10 14:45:18 +08:00
afc163
712451acf7 Fix codepen demo 2017-10-10 11:35:50 +08:00
Bastian Sieker
d4c75d43a1 Fix notification ArgsProps typing (#7834)
* Fix notification ArgsProps typing

close #7832

* Improve notification ArgsProps typing

see #7832

* Improve notification ArgsProps typing

see #7832
2017-10-09 19:58:30 +08:00
afc163
9a5894c46e data should be call when beforeUpload promise resolved, close #7833 2017-10-09 19:41:52 +08:00
Wei Zhu
2fb304e270 Ignore package-lock.json 2017-10-09 19:19:47 +08:00
afc163
73a4873e78 Fix focused cascader error style 2017-10-09 13:46:56 +08:00
afc163
942ea41b02 update snapshot for new jest 2017-10-09 13:32:11 +08:00
afc163
475e4ff23d upgrade eslint-config-airbnb 2017-10-09 13:27:35 +08:00
ravirambles
8ccd02139c update row to remove implicit any (#7803) 2017-10-08 22:14:31 +08:00
afc163
a4a0816e5a code indent 2017-10-08 17:58:42 +08:00
afc163
cf788d7b4d Fix TransferProps targetKeys inside Form decorator, close #7807 2017-10-08 15:25:13 +08:00
afc163
95c72958ca Fix AutoCompelete layout, close #7800 2017-10-08 15:22:24 +08:00
afc163
31d0c3a49d Fix @link-hover-decoration, close #7821 & #7531 2017-10-07 15:31:25 +08:00
afc163
cf6dfac206 Fix codepen demo for react 15 compatibility, close #7808 2017-10-06 16:15:29 +08:00
Graeme Yeates
2e2acb5be9 Support customizing layout footer background (#7818) 2017-10-06 16:09:33 +08:00
Ffloriel
873c85cec8 Add missing disabled property (#7805)
- add missing disabled property on the switch documentation page
2017-10-06 16:09:19 +08:00
afc163
eb4659c409 typo 2017-10-06 16:08:56 +08:00
henryv0
ac33baf940 Makes grammatical and typo fixes to the React Docs. (#7819) 2017-10-06 16:08:03 +08:00
Remo Zumsteg
40b18343c7 Add missing forceRender to TabPaneProps (#7801) 2017-10-03 11:02:45 +08:00
OuYancey
88220df0fb docs: update render result in Button (#7802) 2017-10-03 11:02:35 +08:00
Ffloriel
6d4e531775 form typo (#7794)
- remove to from 'shouldn't to use' and 'shouldn't to call'
2017-10-01 19:37:37 +08:00
afc163
185b3b1e9a Fix FormItem error with react-hot-loader, close #7775 2017-10-01 13:29:17 +08:00
afc163
76a972e062 Fix AutoComplete snapshot 2017-09-30 21:22:11 +08:00
afc163
76a30a7686 Fix props passing of AutoComplete, ref #7742 2017-09-30 21:17:49 +08:00
Wenchao Hu
084d4e6d49 修正错别字 (#7774) 2017-09-30 11:06:22 +08:00
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
偏右
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
ef8beaffde Merge from master 2017-08-25 22:51:14 +08:00
Ziluo
fc884242d8 doc:update link of react-blocks (#7299) 2017-08-23 16:34:15 +08:00
afc163
d4171badfd Merge from master 2017-08-19 12:40:40 +08:00
Benjy Cui
e0bf1cefe7 fix: disabled of Dropdown, ref: #7102 2017-08-16 17:56:07 +08:00
Stefan Paunovic
7d8c7d72b7 feat: add sr_RS locale (Serbian) (#7201) 2017-08-15 09:24:30 +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
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
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
384 changed files with 7677 additions and 4047 deletions

View File

@@ -30,6 +30,7 @@ const eslintrc = {
'import/extensions': 0,
'import/no-unresolved': 0,
'import/no-extraneous-dependencies': 0,
'prefer-destructuring': 0,
'no-param-reassign': 0,
'no-return-assign': 0,
'max-len': 0,
@@ -38,8 +39,13 @@ const eslintrc = {
'react/require-extension': 0,
'jsx-a11y/no-static-element-interactions': 0,
'jsx-a11y/anchor-has-content': 0,
'jsx-a11y/click-events-have-key-events': 0,
'jsx-a11y/anchor-is-valid': 0,
'react/no-danger': 0,
'comma-dangle': ['error', 'always-multiline'],
'function-paren-newline': 0,
'object-curly-newline': 0,
'no-restricted-globals': 0,
},
};
@@ -51,6 +57,7 @@ if (process.env.RUN_ENV === 'DEMO') {
};
Object.assign(eslintrc.rules, {
indent: 0,
'no-console': 0,
'no-plusplus': 0,
'eol-last': 0,

1
.gitignore vendored
View File

@@ -32,6 +32,7 @@ config/base.yaml
/.vscode/
/coverage
yarn.lock
package-lock.json
components/**/*.js
components/**/*.jsx
!components/**/__tests__/*.js

View File

@@ -3,13 +3,14 @@ sudo: false
language: node_js
node_js:
- "6"
- 8
env:
matrix:
- TEST_TYPE=lint
- TEST_TYPE=dist
- TEST_TYPE=compile
- TEST_TYPE=test:dist
- TEST_TYPE=test:lib
- TEST_TYPE=test:es
- TEST_TYPE=test:dom
- TEST_TYPE=test:node
@@ -17,18 +18,18 @@ script:
- |
if [ "$TEST_TYPE" = lint ]; then
npm run lint
elif [ "$TEST_TYPE" = dist ]; then
elif [ "$TEST_TYPE" = test:dist ]; then
npm run dist && \
node ./tests/dekko/dist.test.js && \
LIB_DIR=dist npm test -- --coverage -w 2
elif [ "$TEST_TYPE" = compile ]; then
npm run dist && \
LIB_DIR=dist npm test -- -w 2
elif [ "$TEST_TYPE" = test:lib ]; then
npm run compile && \
node ./tests/dekko/lib.test.js && \
LIB_DIR=es npm test -- --coverage -w 2 && \
LIB_DIR=lib npm test -- --coverage -w 2
LIB_DIR=lib npm test -- -w 2
elif [ "$TEST_TYPE" = test:es ]; then
npm run compile && \
LIB_DIR=es npm test -- -w 2
elif [ "$TEST_TYPE" = test:dom ]; then
npm run dist && \
npm test -- --coverage -w 2 && \
bash <(curl -s https://codecov.io/bash)
elif [ "$TEST_TYPE" = test:node ]; then

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,190 @@ If you want to read change logs before `2.0.0`, please visit [GitHub](https://gi
---
## 2.13.12
`2018-02-26`
- 🐞 Fix issue resulting in SubMenu can not been shown correctly when `defaultOpenKeys` includes nonexistent key. [#8475](https://github.com/ant-design/ant-design/issues/8475)
- 🐞 Fix issue resulting in DatePicker's value can not been controlled correctly. [#8885](https://github.com/ant-design/ant-design/issues/8885)
## 2.13.11
`2017-12-01`
- 📝 Improve support of TypeScript. [#8394](https://github.com/ant-design/ant-design/pull/8394) [#8395](https://github.com/ant-design/ant-design/pull/8395) [@burdell](https://github.com/burdell) [@khayalan-mathew](https://github.com/khayalan-mathew)
- 🐞 Fixed Tooltip missing `defaultVisible` property. [#8257](https://github.com/ant-design/ant-design/issues/8257)
- 🐞 Fixed Modal `footer` property is overwrited when customing this property. [#8379](https://github.com/ant-design/ant-design/issues/8379)
- 🐞 Fixed `fileList` shown incorrect when `beforeUpload` of Upload return `false`. [#8036](https://github.com/ant-design/ant-design/issues/8036)
- 🐞 Fixed vertical align of Form.Item's feedback shown incorrect when Input `size` property is `default\small`. [#8243](https://github.com/ant-design/ant-design/issues/8243)
- 🐞 Fixed nested Form.Item style incorrect. [#8320](https://github.com/ant-design/ant-design/issues/8320)
- 🐞 Fixed Form.Item height are different between Chrome with Safari. [#8220](https://github.com/ant-design/ant-design/issues/8220)
- 🐞 Fixed links where inside Form.Item's label are unavailable to click. [bf70d30](https://github.com/ant-design/ant-design/commit/bf70d30a60595916a38671f384ed17cbd0c4ba5d)
- 🐞 Fixed Progress word wrap. [#8239](https://github.com/ant-design/ant-design/issues/8239)
## 2.13.10
`2017-11-12`
- 📝 Add documentation of [Work with Us](http://ant.design/docs/resource/work-with-us).
- 📝 Refactor edit row demo of Table. [#8026](https://github.com/ant-design/ant-design/issues/8026)
- 🌟 Improve detection of Layout.Sider, now we can compose and nest the Sider without specifying `__ANT_LAYOUT_SIDER` attribute. [#8077](https://github.com/ant-design/ant-design/pull/8077/) [@yasinuslu](https://github.com/yasinuslu)
- 🐞 Fix align issue of `Input.Group` in Chrome 62. [ant-design/ant-design-pro#139](https://github.com/ant-design/ant-design-pro/issues/139)
- 🐞 Fix Cascader search not working when option.children is `[]`. [#8130](https://github.com/ant-design/ant-design/issues/8130) [@jdz321](https://github.com/jdz321)
- 🐞 Fix broken padding of AutoComponent caused by style order conflict with Input. [#8081](https://github.com/ant-design/ant-design/issues/8081)
- 🐞 Fix Upload constructor error in IE9. [#7706](https://github.com/ant-design/ant-design/issues/7706)
- 🐞 Fix Select filterOption's TypeScript definition. [#8128](https://github.com/ant-design/ant-design/issues/8128)
## 2.13.9
`2017-11-06`
- 🌟 Published [Ant Design Pro](https://pro.ant.design/).
- 🐞 Fix that `Cascader[popupVisible]` doesn't work. [#8088](https://github.com/ant-design/ant-design/issues/8088)
- 🐞 Fix that native `input[type=checkbox|radio]` invisible issue. [7c3a483](https://github.com/ant-design/ant-design/commit/7c3a48319074a800c89935e728904933d503ee86)
- 🐞 Fix that `Input.Search[suffix]` doesn't work. [#7970](https://github.com/ant-design/ant-design/issues/7970)
- 🐞 Fix TypeScript definitions of Slider. [#8102](https://github.com/ant-design/ant-design/pull/8102) [@davschne](https://github.com/davschne)
## 2.13.8
`2017-10-27`
- 🌟 Add a mirror site in China: [http://ant-design.gitee.io](http://ant-design.gitee.io)
- 🐞 Fix `ref warning` of Menu in React 16. [#8037](https://github.com/ant-design/ant-design/pull/8037) [@vgeyi](https://github.com/vgeyi)
- 🐞 Fix extra padding of loading Card when it is too wide. [ad9809ec](https://github.com/ant-design/ant-design/commit/ad9809ec2e29275c9348537b04584dcfdc96659a)
- 📝 Add sorted API to enhance readability of docs. [#7896](https://github.com/ant-design/ant-design/pull/7896)[@monkindey](https://github.com/monkindey)
- 📝 Improve Modal docs of how to setting styles. [#7840](https://github.com/ant-design/ant-design/issues/7840) [@kossel](https://github.com/kossel)
- 🐞 Fix the inner shadow of Input on IOS. [#7974](https://github.com/ant-design/ant-design/pull/7974) [@cnahliu](https://github.com/cnahliu)
## 2.13.7
`2017-10-22`
- 🐞 Fix input height in AutoComplete. [#7918](https://github.com/ant-design/ant-design/issues/7918)
- 🐞 Fix Cascader `inputPrefixCls` can not be fully effective. [#7945](https://github.com/ant-design/ant-design/pull/7945) [@vgeyi](https://github.com/vgeyi)
- 🐞 Fix extra margin in sider Layout. [#7967](https://github.com/ant-design/ant-design/issues/7967)
- 🐞 Fix RangePicker can not close panel when click presetted ranges. [#7747](https://github.com/ant-design/ant-design/issues/7747)
- Table
- 🐞 Fix Radio can not be centered in Table column. [#7969](https://github.com/ant-design/ant-design/issues/7969)
- 🐞 Fix Table filter can't show after remove fixed setting. [#7909](https://github.com/ant-design/ant-design/issues/7909)
- 🌟 Add `scrollNumberPrefixCls` prop for Badge. [#7882](https://github.com/ant-design/ant-design/pull/7882) [@vgeyi](https://github.com/vgeyi)
- 🌟 Add some less variables. [#7886](https://github.com/ant-design/ant-design/issues/7886) [@syssam](https://github.com/syssam)
## 2.13.6
`2017-10-12`
- 🐞 Fix issue that `beforeUpload` will stop uploading when return undefined. [#7870](https://github.com/ant-design/ant-design/issues/7870)
## 2.13.5
`2017-10-11`
- 🐞 Fix issue resulting in FormItem throws error when use with reac-hot-loader. [#7775](https://github.com/ant-design/ant-design/issues/7775)
- 🐞 Fix not working less variable `@link-hover-decoration`. [#7821](https://github.com/ant-design/ant-design/issues/7821)
- 🐞 Fix issue resulting in Upload's `beforeUpload` method not returning promise properly. [#7833](https://github.com/ant-design/ant-design/issues/7833)
- 🐞 Fix issue resulting in Input.Search's search icon being covered with Form's feedback icon. [#7854](https://github.com/ant-design/ant-design/issues/7854)
- AutoComplete
- 🐞 Fix circular reference with infinite children [#7742](https://github.com/ant-design/ant-design/pull/7742) [@menberg](https://github.com/ant-design/ant-design/pull/7742)
- 🐞 Fix style when use with TextArea. [#7801](https://github.com/ant-design/ant-design/issues/7800)
- 🌟 Improve TypeScript definition. [cf788d7](https://github.com/ant-design/ant-design/commit/cf788d7b4dda58f61da91086ccfe0c67872fc709) [d4c75d43](https://github.com/ant-design/ant-design/commit/d4c75d43a1824d36583d9d8f9b209a4b9526a3af)
- 🌟 Add new less variable. [2e2acb5](https://github.com/ant-design/ant-design/commit/2e2acb5be9a171f217f2a1a143b34b2624b49b06)
## 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`
@@ -25,7 +209,6 @@ If you want to read change logs before `2.0.0`, please visit [GitHub](https://gi
- 🌟 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)
![](https://gw.alipayobjects.com/zos/rmsportal/kpxITHnXvsLlMTqEKgUm.gif)
- 🐞 Fix some details of Select, Tooltip and Menu.
## 2.12.7
@@ -177,7 +360,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)
@@ -593,7 +776,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)
@@ -1210,8 +1393,8 @@ The following change will throw some warnings in the console and it will still w
```diff
{
- "plugins": [["antd", { style: "css" }]]
+ "plugins": [["import", { libraryName: "antd", style: "css" }]]
- "plugins": [["antd", { "style": "css" }]]
+ "plugins": [["import", { "libraryName": "antd", "style": "css" }]]
}
```

View File

@@ -17,15 +17,197 @@ timeline: true
---
## 2.13.12
`2018-02-26`
- 🐞 修复 Menu 的 `defaultOpenKeys` 包含不存在的 key 时,子菜单不能正确显示的问题。 [#8475](https://github.com/ant-design/ant-design/issues/8475)
- 🐞 修复 DatePicker 的值不能正确受控的问题。[#8885](https://github.com/ant-design/ant-design/issues/8885)
## 2.13.11
`2017-12-01`
- 📝 完善组件对 TypeScript 的支持。[#8394](https://github.com/ant-design/ant-design/pull/8394) [#8395](https://github.com/ant-design/ant-design/pull/8395) [@burdell](https://github.com/burdell) [@khayalan-mathew](https://github.com/khayalan-mathew)
- 🐞 修复了 Tooltip 不支持 `defaultVisible` 属性的问题。[#8257](https://github.com/ant-design/ant-design/issues/8257)
- 🐞 修复了 Modal 组件在传入自定义 `footer` 的时候默认 `footer` 被覆盖的问题。[#8379](https://github.com/ant-design/ant-design/issues/8379)
- 🐞 修复了 Upload 组件在 `beforeUpload` 中返回 `false` 时,修改 `fileList` 导致上传列表展示不正常的问题。[#8036](https://github.com/ant-design/ant-design/issues/8036)
- 🐞 修复了 Form 表单的信息回显在当 Input 组件 `size` 属性为 `default\small` 时没有对齐的问题。[#8243](https://github.com/ant-design/ant-design/issues/8243)
- 🐞 修复了 Form.Item 在互相嵌套时样式异常的问题。[#8320](https://github.com/ant-design/ant-design/issues/8320)
- 🐞 修复了 Form.Item 在 Chrome 和 Safari 下高度不一致的问题。 [#8220](https://github.com/ant-design/ant-design/issues/8220)
- 🐞 修复了 Form.Item 在部分情况下 label 内链接无法点击的问题。 [bf70d30](https://github.com/ant-design/ant-design/commit/bf70d30a60595916a38671f384ed17cbd0c4ba5d)
- 🐞 修复了 Progress 对于折行的场景兼容性问题。[#8239](https://github.com/ant-design/ant-design/issues/8239)
## 2.13.10
`2017-11-12`
- 📝 添加 [招聘](http://ant.design/docs/resource/work-with-us-cn) 页面。
- 📝 重构了可编辑表格的演示代码。[#8026](https://github.com/ant-design/ant-design/issues/8026)
- 🌟 优化了 Layout.Sider 的探测方式,现在支持 Sider 随意内嵌和组合(不再需要指定 `__ANT_LAYOUT_SIDER` 属性)。[#8077](https://github.com/ant-design/ant-design/pull/8077/) [@yasinuslu](https://github.com/yasinuslu)
- 🐞 修复 Chrome 62 下 Input.Group 内 Select 和 Input 的对齐问题。[ant-design/ant-design-pro#139](https://github.com/ant-design/ant-design-pro/issues/139)
- 🐞 修复 Cascader 搜索在 options 内 children 为空数组时工作不正常的问题。[#8130](https://github.com/ant-design/ant-design/issues/8130) [@jdz321](https://github.com/jdz321)
- 🐞 修复一个 AutoComponent 和 Input 样式优先级导致错位的问题。[#8081](https://github.com/ant-design/ant-design/issues/8081)
- 🐞 修复 IE9 下 Upload 初始化时报错的问题。[#7706](https://github.com/ant-design/ant-design/issues/7706)
- 🐞 修复 Select 的 filterOption 参数的 TypeScript 定义。[#8128](https://github.com/ant-design/ant-design/issues/8128)
## 2.13.9
`2017-11-06`
- 🌟 发布 [Ant Design Pro](https://pro.ant.design/)。
- 🐞 修复 `Cascader[popupVisible]` 失效问题。[#8088](https://github.com/ant-design/ant-design/issues/8088)
- 🐞 修复原生 `input[type=checkbox|radio]` 看不到的问题。[7c3a483](https://github.com/ant-design/ant-design/commit/7c3a48319074a800c89935e728904933d503ee86)
- 🐞 修复 `Input.Search[suffix]` 失效的问题。[#7970](https://github.com/ant-design/ant-design/issues/7970)
- 🐞 修复 Slider TypeScript 定义问题。[#8102](https://github.com/ant-design/ant-design/pull/8102) [@davschne](https://github.com/davschne)
## 2.13.8
`2017-10-27`
- 🌟 新增国内镜像文档站点:[http://ant-design.gitee.io](http://ant-design.gitee.io)
- 🐞 修复了 Menu 在 React 16 下 `ref warning` 的问题。[#8037](https://github.com/ant-design/ant-design/pull/8037) [@vgeyi](https://github.com/vgeyi)
- 🐞 修复了 Card 在比较宽的时候 `loading` 样式的问题。[ad9809ec](https://github.com/ant-design/ant-design/commit/ad9809ec2e29275c9348537b04584dcfdc96659a)
- 📝 引入了 API 展示排序规则,增强文档易读性。[#7896](https://github.com/ant-design/ant-design/pull/7896)[@monkindey](https://github.com/monkindey)
- 📝 优化了 Modal 设置样式的文档。[#7840](https://github.com/ant-design/ant-design/issues/7840) [@kossel](https://github.com/kossel)
- 🐞 修复了 IOS 下 Input 有内阴影的样式问题。[#7974](https://github.com/ant-design/ant-design/pull/7974) [@cnahliu](https://github.com/cnahliu)
## 2.13.7
`2017-10-22`
- 🐞 修复了 AutoComplete 的 input 高度。 [#7918](https://github.com/ant-design/ant-design/issues/7918)
- 🐞 修复了 Cascader `inputPrefixCls` 不能完全生效的问题。[#7945](https://github.com/ant-design/ant-design/pull/7945) [@vgeyi](https://github.com/vgeyi)
- 🐞 修复了有侧边栏的 Layout 存在多余外边距的问题。[#7967](https://github.com/ant-design/ant-design/issues/7967)
- 🐞 修复了 RangePicker 在选中预设范围时间时不能关闭选择面板的问题。[#7747](https://github.com/ant-design/ant-design/issues/7747)
- Table
- 🐞 修复了 Table 列中 Radio 选择框无法居中的问题。[#7969](https://github.com/ant-design/ant-design/issues/7969)
- 🐞 修复了去掉 `fixed` 属性设置后 Table 列无法进行筛选的问题。[#7909](https://github.com/ant-design/ant-design/issues/7909)
- 🌟 Badge 新增 `scrollNumberPrefixCls` 属性。[#7882](https://github.com/ant-design/ant-design/pull/7882) [@vgeyi](https://github.com/vgeyi)
- 🌟 补充了一些 less 变量。[#7886](https://github.com/ant-design/ant-design/issues/7886) [@syssam](https://github.com/syssam)
## 2.13.6
`2017-10-12`
- 🐞 修复 `beforeUpload` 未指定返回值时会阻止上传的问题。[#7870](https://github.com/ant-design/ant-design/issues/7870)
## 2.13.5
`2017-10-11`
- 🐞 修复 FormItem 不能跟 reac-hot-loader 一起使用的问题。[#7775](https://github.com/ant-design/ant-design/issues/7775)
- 🐞 修复 less 变量 `@link-hover-decoration` 没按预期工作的问题。[#7821](https://github.com/ant-design/ant-design/issues/7821)
- 🐞 修复 Uploade 的 `beforeUpload` 没返回 promise 的问题。[#7833](https://github.com/ant-design/ant-design/issues/7833)
- 🐞 修复 Input.Search 的搜索图标会被 Form 的验证图标遮住的问题。[#7854](https://github.com/ant-design/ant-design/issues/7854)
- AutoComplete
- 🐞 修复循环引用问题。[#7742](https://github.com/ant-design/ant-design/pull/7742) [@menberg](https://github.com/ant-design/ant-design/pull/7742)
- 🐞 修复使用 TextArea 并拖动输入框大小时的样式错乱问题。[#7801](https://github.com/ant-design/ant-design/issues/7800)
- 🌟 改进一些 TypeScript 定义。[cf788d7](https://github.com/ant-design/ant-design/commit/cf788d7b4dda58f61da91086ccfe0c67872fc709) [d4c75d43](https://github.com/ant-design/ant-design/commit/d4c75d43a1824d36583d9d8f9b209a4b9526a3af)
- 🌟 新增 less 变量 [2e2acb5](https://github.com/ant-design/ant-design/commit/2e2acb5be9a171f217f2a1a143b34b2624b49b06)
## 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)
- 🌟 优化了固定列的空表格样式。[#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)
![](https://gw.alipayobjects.com/zos/rmsportal/kpxITHnXvsLlMTqEKgUm.gif)
- 🐞 修复 Select、Tooltip、Menu 的一些细节样式问题。
## 2.12.7
@@ -177,7 +359,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)
@@ -592,7 +774,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)
@@ -1226,8 +1408,8 @@ timeline: true
```diff
{
- "plugins": [["antd", { style: "css" }]]
+ "plugins": [["import", { libraryName: "antd", style: "css" }]]
- "plugins": [["antd", { "style": "css" }]]
+ "plugins": [["import", { "libraryName": "antd", "style": "css" }]]
}
```

View File

@@ -81,11 +81,10 @@ import 'antd/dist/antd.css'; // or 'antd/dist/antd.less'
## 链接
- [首页](http://ant.design/index-cn)
- [UI 组件库](http://ant.design/docs/react/introduce-cn)
- [首页](http://ant.design/)
- [组件库](http://ant.design/docs/react/introduce)
- [Ant Design Pro](http://pro.ant.design/)
- [更新日志](CHANGELOG.en-US.md)
- [官方脚手架](https://github.com/dvajs/dva-cli)
- [开发工具文档](http://ant-tool.github.io/)
- [脚手架市场](http://scaffold.ant.design)
- [React 底层基础组件](http://react-component.github.io/)
- [移动端组件](http://mobile.ant.design)

View File

@@ -58,13 +58,21 @@ 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
{
"plugins": [
["import", { libraryName: "antd", style: "css" }] // `style: true` for less
["import", { "libraryName": "antd", "style": "css" }] // `style: true` for less
]
}
```
@@ -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
@@ -121,10 +121,9 @@ See [i18n](http://ant.design/docs/react/i18n).
## Links
- [Home page](http://ant.design/)
- [UI library](http://ant.design/docs/react/introduce)
- [Components](http://ant.design/docs/react/introduce)
- [Ant Design Pro](http://pro.ant.design/)
- [Change Log](CHANGELOG.en-US.md)
- [Official Scaffold Tool](https://github.com/dvajs/dva-cli/)
- [Development Tool](http://ant-tool.github.io/)
- [Scaffold Market](http://scaffold.ant.design)
- [rc-components](http://react-component.github.io/)
- [Mobile UI](http://mobile.ant.design)

View File

@@ -1,8 +1,14 @@
import throttleByAnimationFrame from '../throttleByAnimationFrame';
jest.useFakeTimers();
describe('Test utils function', () => {
beforeAll(() => {
jest.useFakeTimers();
});
afterAll(() => {
jest.useRealTimers();
});
it('throttle function should work', () => {
const callback = jest.fn();
const throttled = throttleByAnimationFrame(callback);

View File

@@ -3,8 +3,6 @@ import { mount } from 'enzyme';
import Affix from '..';
import Button from '../../button';
jest.useFakeTimers();
const events = {};
class AffixMounter extends React.Component {
@@ -18,34 +16,44 @@ class AffixMounter extends React.Component {
return this.container;
}
render() {
return (<div
style={{
height: 100,
overflowY: 'scroll',
}}
ref={(node) => { this.container = node; }}
>
return (
<div
className="background"
style={{
paddingTop: 60,
height: 300,
height: 100,
overflowY: 'scroll',
}}
ref={(node) => { this.container = node; }}
>
<Affix
target={() => this.container}
ref={ele => this.affix = ele}
<div
className="background"
style={{
paddingTop: 60,
height: 300,
}}
>
<Button type="primary" >
Fixed at the top of container
</Button>
</Affix>
<Affix
target={() => this.container}
ref={ele => this.affix = ele}
>
<Button type="primary" >
Fixed at the top of container
</Button>
</Affix>
</div>
</div>
</div>);
);
}
}
describe('Affix Render', () => {
beforeAll(() => {
jest.useFakeTimers();
});
afterAll(() => {
jest.useRealTimers();
});
it('Anchor render perfectly', () => {
document.body.innerHTML = '<div id="mounter" />';

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
@@ -14,12 +14,12 @@ Please note that Affix should not cover other content on the page, especially wh
## API
| Property | Description | Type | Default |
|--------------|-----------------------|----------|--------------|
| offsetTop | Pixels to offset from top when calculating position of scroll | number | 0 |
| Property | Description | Type | Default |
| -------- | ----------- | ---- | ------- |
| offsetBottom | Pixels to offset from bottom when calculating position of scroll | number | - |
| offsetTop | Pixels to offset from top when calculating position of scroll | number | 0 |
| target | specifies the scrollable area dom node | () => HTMLElement | () => window |
| onChange | Callback 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

@@ -162,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 &&
@@ -179,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;

View File

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

View File

@@ -20,17 +20,21 @@ const onClose = function (e) {
console.log(e, 'I was closed.');
};
ReactDOM.render(<div>
<Alert message="Warning Text Warning Text Warning TextW arning Text Warning Text Warning TextWarning Text"
type="warning"
closable
onClose={onClose}
/>
<Alert message="Error Text"
description="Error Description Error Description Error Description Error Description Error Description Error Description"
type="error"
closable
onClose={onClose}
/>
</div>, mountNode);
ReactDOM.render(
<div>
<Alert
message="Warning Text Warning Text Warning TextW arning Text Warning Text Warning TextWarning Text"
type="warning"
closable
onClose={onClose}
/>
<Alert
message="Error Text"
description="Error Description Error Description Error Description Error Description Error Description Error Description"
type="error"
closable
onClose={onClose}
/>
</div>
, mountNode);
````

View File

@@ -16,26 +16,28 @@ Additional description for alert message.
````jsx
import { Alert } from 'antd';
ReactDOM.render(<div>
<Alert
message="Success Text"
description="Success Description Success Description Success Description"
type="success"
/>
<Alert
message="Info Text"
description="Info Description Info Description Info Description Info Description"
type="info"
/>
<Alert
message="Warning Text"
description="Warning Description Warning Description Warning Description Warning Description"
type="warning"
/>
<Alert
message="Error Text"
description="Error Description Error Description Error Description Error Description"
type="error"
/>
</div>, mountNode);
ReactDOM.render(
<div>
<Alert
message="Success Text"
description="Success Description Success Description Success Description"
type="success"
/>
<Alert
message="Info Text"
description="Info Description Info Description Info Description Info Description"
type="info"
/>
<Alert
message="Warning Text"
description="Warning Description Warning Description Warning Description Warning Description"
type="warning"
/>
<Alert
message="Error Text"
description="Error Description Error Description Error Description Error Description"
type="error"
/>
</div>
, mountNode);
````

View File

@@ -16,34 +16,36 @@ Decent icon make information more clear and more friendly.
````jsx
import { Alert } from 'antd';
ReactDOM.render(<div>
<Alert message="Success Tips" type="success" showIcon />
<Alert message="Informational Notes" type="info" showIcon />
<Alert message="Warning" type="warning" showIcon />
<Alert message="Error" type="error" showIcon />
<Alert
message="success tips"
description="Detailed description and advices about successful copywriting."
type="success"
showIcon
/>
<Alert
message="Informational Notes"
description="Additional description and informations about copywriting."
type="info"
showIcon
/>
<Alert
message="Warning"
description="This is a warning notice about copywriting."
type="warning"
showIcon
/>
<Alert
message="Error"
description="This is an error message about copywriting."
type="error"
showIcon
/>
</div>, mountNode);
ReactDOM.render(
<div>
<Alert message="Success Tips" type="success" showIcon />
<Alert message="Informational Notes" type="info" showIcon />
<Alert message="Warning" type="warning" showIcon />
<Alert message="Error" type="error" showIcon />
<Alert
message="success tips"
description="Detailed description and advices about successful copywriting."
type="success"
showIcon
/>
<Alert
message="Informational Notes"
description="Additional description and informations about copywriting."
type="info"
showIcon
/>
<Alert
message="Warning"
description="This is a warning notice about copywriting."
type="warning"
showIcon
/>
<Alert
message="Error"
description="This is an error message about copywriting."
type="error"
showIcon
/>
</div>
, mountNode);
````

View File

@@ -16,10 +16,12 @@ There are 4 types of Alert: `success`, `info`, `warning`, `error`.
````jsx
import { Alert } from 'antd';
ReactDOM.render(<div>
<Alert message="Success Text" type="success" />
<Alert message="Info Text" type="info" />
<Alert message="Warning Text" type="warning" />
<Alert message="Error Text" type="error" />
</div>, mountNode);
ReactDOM.render(
<div>
<Alert message="Success Text" type="success" />
<Alert message="Info Text" type="info" />
<Alert message="Warning Text" type="warning" />
<Alert message="Error Text" type="error" />
</div>
, mountNode);
````

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` |
| closable | Whether Alert can be closed | boolean | - |
| closeText | Close text to show | string\|ReactNode | - |
| message | Content of Alert | string\|ReactNode | - |
| Property | Description | Type | Default |
| -------- | ----------- | ---- | ------- |
| banner | Whether to show as banner | boolean | false |
| closable | Whether Alert can be closed | boolean | - |
| closeText | Close text to show | string\|ReactNode | - |
| description | Additional content of Alert | string\|ReactNode | - |
| onClose | Callback when close Alert | Function | - |
| showIcon | Whether to show icon | boolean | false, in `banner` mode it's true |
| banner | Whether to show as banner | boolean | false |
| message | Content of Alert | string\|ReactNode | - |
| showIcon | Whether to show icon | boolean | false, in `banner` mode default is true |
| type | Type of Alert styles, options: `success`, `info`, `warning`, `error` | string | `info`, in `banner` mode default is `warning` |
| onClose | Callback when Alert is closed | Function | - |

View File

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

View File

@@ -42,9 +42,12 @@ function easeInOutCubic(t: number, b: number, c: number, d: number) {
}
const reqAnimFrame = getRequestAnimationFrame();
const sharpMatcherRegx = /#([^#]+)$/;
function scrollTo(href: string, offsetTop = 0, target, callback = () => { }) {
const scrollTop = getScroll(target(), true);
const targetElement = document.getElementById(href.substring(1));
const sharpLinkMatch = sharpMatcherRegx.exec(href);
if (!sharpLinkMatch) { return; }
const targetElement = document.getElementById(sharpLinkMatch[1]);
if (!targetElement) {
return;
}
@@ -174,7 +177,9 @@ export default class Anchor extends React.Component<AnchorProps, any> {
const linkSections: Array<Section> = [];
this.links.forEach(link => {
const target = document.getElementById(link.substring(1));
const sharpLinkMatch = sharpMatcherRegx.exec(link.toString());
if (!sharpLinkMatch) { return; }
const target = document.getElementById(sharpLinkMatch[1]);
if (target && getOffsetTop(target) < offsetTop + bounds) {
const top = getOffsetTop(target);
linkSections.push({

View File

@@ -17,4 +17,48 @@ describe('Anchor Render', () => {
wrapper.node.handleScroll();
expect(wrapper.node.state).not.toBe(null);
});
it('Anchor render perfectly for complete href - click', () => {
const wrapper = mount(
<Anchor>
<Link href="http://www.example.com/#API" title="API" />
</Anchor>
);
wrapper.find('a[href="http://www.example.com/#API"]').simulate('click');
expect(wrapper.node.state.activeLink).toBe('http://www.example.com/#API');
});
it('Anchor render perfectly for complete href - scoll', () => {
let root = document.getElementById('root');
if (!root) {
root = document.createElement('div', { id: 'root' });
root.id = 'root';
document.body.appendChild(root);
}
mount(<div id="API">Hello</div>, { attachTo: root });
const wrapper = mount(
<Anchor>
<Link href="http://www.example.com/#API" title="API" />
</Anchor>
);
wrapper.node.handleScroll();
expect(wrapper.node.state.activeLink).toBe('http://www.example.com/#API');
});
it('Anchor render perfectly for complete href - scollTo', () => {
let root = document.getElementById('root');
if (!root) {
root = document.createElement('div', { id: 'root' });
root.id = 'root';
document.body.appendChild(root);
}
mount(<div id="API">Hello</div>, { attachTo: root });
const wrapper = mount(
<Anchor>
<Link href="##API" title="API" />
</Anchor>
);
wrapper.node.handleScrollTo('##API');
expect(wrapper.node.state.activeLink).toBe('##API');
});
});

View File

@@ -15,17 +15,17 @@ For displaying anchor hyperlinks on page and jumping between them.
### Anchor Props
| Property | Description | Type | Default |
|--------------|-----------------------|----------|--------------|
| 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 | - |
| bounds | Bounding distance of anchor area | number | 5(px) |
| Property | Description | Type | Default |
| -------- | ----------- | ---- | ------- |
| affix | Fixed mode of Anchor | boolean | false |
| bounds | Bounding distance of anchor area | number | 5(px) |
| offsetBottom | Pixels to offset from bottom when calculating position of scroll | number | - |
| offsetTop | Pixels to offset from top when calculating position of scroll | number | 0 |
| showInkInFixed | Whether show ink-balls in Fixed mode | boolean | false |
### Link Props
| Property | Description | Type | Default |
|-------------|----------------|--------------------|--------------|
| href | target of hyperlink | string | |
| title | content of hyperlink | string\|ReactNode | |
| Property | Description | Type | Default |
| -------- | ----------- | ---- | ------- |
| href | target of hyperlink | string | |
| title | content of hyperlink | string\|ReactNode | |

View File

@@ -16,17 +16,17 @@ title: Anchor
### Anchor Props
| 成员 | 说明 | 类型 | 默认值 |
|-------------|----------------|--------------------|--------------|
| offsetTop | 距离窗口顶部达到指定偏移量后触发 | number | |
| offsetBottom | 距离窗口底部达到指定偏移量后触发 | number | |
| bounds | 锚点区域边界 | number | 5(px) |
| 成员 | 说明 | 类型 | 默认值 |
| --- | --- | --- | --- |
| affix | 固定模式 | boolean | false |
| bounds | 锚点区域边界 | number | 5(px) |
| offsetBottom | 距离窗口底部达到指定偏移量后触发 | number | |
| offsetTop | 距离窗口顶部达到指定偏移量后触发 | number | |
| showInkInFixed | 固定模式是否显示小圆点 | boolean | false |
### Link Props
| 成员 | 说明 | 类型 | 默认值 |
|-------------|----------------|--------------------|--------------|
| href | 锚点链接 | string | |
| title | 文字内容 | string\|ReactNode | |
| 成员 | 说明 | 类型 | 默认值 |
| --- | --- | --- | --- |
| href | 锚点链接 | string | |
| title | 文字内容 | string\|ReactNode | |

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

@@ -1,59 +1,5 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`renders ./components/auto-complete/demo/antd.md correctly 1`] = `
<div
class="ant-select-show-search ant-select-auto-complete ant-select ant-select-combobox ant-select-enabled"
style="width:200px;height:50px;"
>
<div
aria-autocomplete="list"
aria-expanded="false"
aria-haspopup="true"
class="ant-select-selection
ant-select-selection--single"
role="combobox"
>
<div
class="ant-select-selection__rendered"
>
<div
class="ant-select-selection__placeholder"
style="display:block;user-select:none;-webkit-user-select:none;"
unselectable="unselectable"
>
input here
</div>
<ul>
<li
class="ant-select-search ant-select-search--inline"
>
<div
class="ant-select-search__field__wrap"
>
<textarea
class="ant-input ant-select-search__field"
style="height:50px;"
/>
<span
class="ant-select-search__field__mirror"
>
 
</span>
</div>
</li>
</ul>
</div>
<span
class="ant-select-arrow"
style="user-select:none;-webkit-user-select:none;"
unselectable="unselectable"
>
<b />
</span>
</div>
</div>
`;
exports[`renders ./components/auto-complete/demo/basic.md correctly 1`] = `
<div
class="ant-select-show-search ant-select-auto-complete ant-select ant-select-combobox ant-select-enabled"
@@ -64,7 +10,7 @@ exports[`renders ./components/auto-complete/demo/basic.md correctly 1`] = `
aria-expanded="false"
aria-haspopup="true"
class="ant-select-selection
ant-select-selection--single"
ant-select-selection--single"
role="combobox"
>
<div
@@ -123,7 +69,7 @@ exports[`renders ./components/auto-complete/demo/certain-category.md correctly 1
aria-expanded="false"
aria-haspopup="true"
class="ant-select-selection
ant-select-selection--single"
ant-select-selection--single"
role="combobox"
>
<div
@@ -180,6 +126,54 @@ exports[`renders ./components/auto-complete/demo/certain-category.md correctly 1
</div>
`;
exports[`renders ./components/auto-complete/demo/custom.md correctly 1`] = `
<div
class="ant-select-show-search ant-select-auto-complete ant-select ant-select-combobox ant-select-enabled"
style="width:200px;"
>
<div
aria-autocomplete="list"
aria-expanded="false"
aria-haspopup="true"
class="ant-select-selection
ant-select-selection--single"
role="combobox"
>
<div
class="ant-select-selection__rendered"
>
<ul>
<li
class="ant-select-search ant-select-search--inline"
>
<div
class="ant-select-search__field__wrap"
>
<textarea
class="ant-input custom ant-select-search__field"
placeholder="input here"
style="height:50px;"
/>
<span
class="ant-select-search__field__mirror"
>
 
</span>
</div>
</li>
</ul>
</div>
<span
class="ant-select-arrow"
style="user-select:none;-webkit-user-select:none;"
unselectable="unselectable"
>
<b />
</span>
</div>
</div>
`;
exports[`renders ./components/auto-complete/demo/non-case-sensitive.md correctly 1`] = `
<div
class="ant-select-show-search ant-select-auto-complete ant-select ant-select-combobox ant-select-enabled"
@@ -190,7 +184,7 @@ exports[`renders ./components/auto-complete/demo/non-case-sensitive.md correctly
aria-expanded="false"
aria-haspopup="true"
class="ant-select-selection
ant-select-selection--single"
ant-select-selection--single"
role="combobox"
>
<div
@@ -245,7 +239,7 @@ exports[`renders ./components/auto-complete/demo/options.md correctly 1`] = `
aria-expanded="false"
aria-haspopup="true"
class="ant-select-selection
ant-select-selection--single"
ant-select-selection--single"
role="combobox"
>
<div
@@ -304,7 +298,7 @@ exports[`renders ./components/auto-complete/demo/uncertain-category.md correctly
aria-expanded="false"
aria-haspopup="true"
class="ant-select-selection
ant-select-selection--single"
ant-select-selection--single"
role="combobox"
>
<div

View File

@@ -45,12 +45,16 @@ class Complete extends React.Component {
return (
<AutoComplete
dataSource={dataSource}
style={{ width: 200, height: 50 }}
style={{ width: 200 }}
onSelect={onSelect}
onSearch={this.handleSearch}
placeholder="input here"
>
<TextArea onKeyPress={this.handleKeyPress} style={{ height: 50 }} />
<TextArea
placeholder="input here"
className="custom"
style={{ height: 50 }}
onKeyPress={this.handleKeyPress}
/>
</AutoComplete>
);
}

View File

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

View File

@@ -51,8 +51,11 @@ export default class AutoComplete extends React.Component<AutoCompleteProps, any
const { children } = this.props;
const element = children && React.isValidElement(children) && children.type !== Option ?
React.Children.only(this.props.children) : <Input />;
const elementProps = { ...element.props };
// https://github.com/ant-design/ant-design/pull/7742
delete elementProps.children;
return (
<InputElement {...element.props}>{element}</InputElement>
<InputElement {...elementProps}>{element}</InputElement>
);
}

View File

@@ -19,19 +19,20 @@ const dataSource = ['12345', '23456', '34567'];
<AutoComplete dataSource={dataSource} />
```
| 参数 | 说明 | 类型 | 默认值 |
|----------------|----------------------------------|------------|---------|
| dataSource | 自动完成的数据源 | [DataSourceItemType](https://git.io/vMMKF)[] | |
| value | 指定当前选中的条目 | string\|string[]\|{ key: string, label: string\|ReactNode }\|Array<{ key: string, label: string\|ReactNode }> | 无 |
| defaultValue | 指定默认选中的条目 | string\|string[]\|{ key: string, label: string\|ReactNode }\|Array<{ key: string, label: string\|ReactNode}> | 无 |
| allowClear | 支持清除, 单选模式有效 | boolean | false |
| onChange | 选中 option或 input 的 value 变化时,调用此函数 | function(value) | |
| onSelect | 被选中时调用,参数为选中项的 value 值 | function(value, option) | 无 |
| onSearch | 搜索补全项的时候调用 | function(value) | 无 |
| 参数 | 说明 | 类型 | 默认值 |
| --- | --- | --- | --- |
| allowClear | 支持清除, 单选模式有效 | boolean | false |
| backfill | 使用键盘选择选项的时候把选中项回填到输入框中 | boolean | false |
| children (自动完成的数据源) | 自动完成的数据源 | React.ReactElement<OptionProps> / Array&lt;React.ReactElement<OptionProps>> | - |
| children (自定义输入框) | 自定义输入框 | HTMLInputElement / HTMLTextAreaElement / React.ReactElement<InputProps> | `<Input />` |
| dataSource | 自动完成的数据源 | [DataSourceItemType](https://git.io/vMMKF)\[] | |
| defaultActiveFirstOption | 是否默认高亮第一个选项。 | boolean | true |
| defaultValue | 指定默认选中的条目 | string\|string\[]\|{ key: string, label: string\|ReactNode }\|Array&lt;{ key: string, label: string\|ReactNode}> | 无 |
| disabled | 是否禁用 | boolean | false |
| defaultActiveFirstOption | 是否默认高亮第一个选项。 | boolean | true
| placeholder | 输入框提示 | string | - |
| children (自动完成的数据源) | 自动完成的数据源 | React.ReactElement<OptionProps> / Array<React.ReactElement<OptionProps>> | - |
| children (自定义输入框) | 自定义输入框 | HTMLInputElement / HTMLTextAreaElement / React.ReactElement<InputProps> | `<Input />` |
| filterOption | 是否根据输入项进行筛选。当其为一个函数时,会接收 `inputValue` `option` 两个参数,当 `option` 符合筛选条件时,应返回 `true`,反之则返回 `false`。 | boolean or function(inputValue, option) | true |
| optionLabelProp | 回填到选择框的 Option 的属性值,默认是 Option 的子元素。比如在子元素需要高亮效果时,此值可以设为 `value`。 | string | `children` |
| filterOption | 是否根据输入项进行筛选。当其为一个函数时,会接收 `inputValue` `option` 两个参数,当 `option` 符合筛选条件时,应返回 `true`,反之则返回 `false`。 | boolean or function(inputValue, option) | true |
| placeholder | 输入框提示 | string | - |
| value | 指定当前选中的条目 | string\|string\[]\|{ key: string, label: string\|ReactNode }\|Array&lt;{ key: string, label: string\|ReactNode }> | 无 |
| onChange | 选中 option或 input 的 value 变化时,调用此函数 | function(value) | 无 |
| onSearch | 搜索补全项的时候调用 | function(value) | 无 |
| onSelect | 被选中时调用,参数为选中项的 value 值 | function(value, option) | 无 |

View File

@@ -19,12 +19,22 @@
line-height: @input-height-base;
}
&__placeholder {
margin-left: (@input-padding-horizontal + 1px);
margin-right: (@input-padding-horizontal + 1px);
margin-left: (@input-padding-horizontal-base + 1px);
margin-right: (@input-padding-horizontal-base + 1px);
}
&--single {
height: auto;
}
}
}
// Fix https://github.com/ant-design/ant-design/issues/7800
.@{select-prefix-cls}-search--inline {
position: static;
float: left;
}
&-allow-clear {
.@{select-prefix-cls}-selection:hover .@{select-prefix-cls}-selection__rendered {
margin-right: 0 !important;
@@ -33,6 +43,13 @@
.@{input-prefix-cls} {
background: transparent;
border-width: @border-width-base;
line-height: @line-height-base;
height: @input-height-base;
&:focus,
&:hover {
.hover;
}
}
&-lg {
@@ -40,7 +57,9 @@
line-height: @input-height-lg;
}
.@{input-prefix-cls} {
.input-lg();
padding-top: @input-padding-vertical-lg;
padding-bottom: @input-padding-vertical-lg;
height: @input-height-lg;
}
}
@@ -49,15 +68,9 @@
line-height: @input-height-sm;
}
.@{input-prefix-cls} {
.input-sm();
}
}
.@{input-prefix-cls} {
border-width: @border-width-base;
&:focus,
&:hover {
.hover;
padding-top: @input-padding-vertical-sm;
padding-bottom: @input-padding-vertical-sm;
height: @input-height-sm;
}
}
}

View File

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

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 | - |
| Property | Description | Type | Default |
| -------- | ----------- | ---- | ------- |
| icon | the `Icon` type for an icon avatar, see `Icon` Component | string | - |
| shape | the shape of avatar | `circle` \| `square` | `circle` |
| size | the size of the avatar | `large` \| `small` \| `default` | `default` |
| src | the address of the image for an image avatar | string | - |

View File

@@ -9,9 +9,9 @@ title: Avatar
## API
| 参数 | 说明 | 类型 | 默认值 |
|----------- |--------------------------------------------------------- | ---------- | ------- |
| shape | 指定头像的形状 | Enum{ 'circle', 'square' } | `circle` |
| size | 设置头像的大小 | Enum{ 'large', 'small', 'default' } | `default` |
| src | 图片类头像的资源地址 | string | - |
| icon | 设置头像的图标类型,参考 `Icon` 组件 | string | - |
| 参数 | 说明 | 类型 | 默认值 |
| --- | --- | --- | --- |
| icon | 设置头像的图标类型,参考 `Icon` 组件 | string | - |
| shape | 指定头像的形状 | Enum{ 'circle', 'square' } | `circle` |
| size | 设置头像的大小 | Enum{ 'large', 'small', 'default' } | `default` |
| src | 图片类头像的资源地址 | string | - |

View File

@@ -28,6 +28,7 @@
& > img {
width: 100%;
height: 100%;
display: block;
}
}

View File

@@ -2,17 +2,23 @@ import React from 'react';
import { mount } from 'enzyme';
import BackTop from '..';
const delay = timeout => new Promise(resolve => setTimeout(resolve, timeout));
describe('BackTop', () => {
it('should scroll to top after click it', async () => {
beforeAll(() => {
jest.useFakeTimers();
});
afterAll(() => {
jest.useRealTimers();
});
it('should scroll to top after click it', () => {
const wrapper = mount(<BackTop visibilityHeight={-1} />);
document.documentElement.scrollTop = 400;
// trigger scroll manually
wrapper.node.handleScroll();
await delay(500);
jest.runAllTimers();
wrapper.find('.ant-back-top').simulate('click');
await delay(500);
jest.runAllTimers();
expect(Math.round(document.documentElement.scrollTop)).toBe(0);
});
});

View File

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

View File

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

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, count, 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,11 +130,8 @@ export default class ScrollNumber extends Component<ScrollNumberProps, any> {
]);
const newProps = {
...restProps,
className: classNames({
[`${prefixCls}`]: !!prefixCls,
[`${className}`]: !!className,
}),
title: count as string,
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

@@ -395,7 +395,6 @@ exports[`renders ./components/badge/demo/change.md correctly 1`] = `
<sup
class="ant-scroll-number ant-badge-dot"
data-show="true"
title=""
/>
</span>
<span
@@ -422,7 +421,6 @@ exports[`renders ./components/badge/demo/dot.md correctly 1`] = `
<sup
class="ant-scroll-number ant-badge-dot"
data-show="true"
title=""
/>
</span>
<span
@@ -436,7 +434,6 @@ exports[`renders ./components/badge/demo/dot.md correctly 1`] = `
<sup
class="ant-scroll-number ant-badge-dot"
data-show="true"
title=""
/>
</span>
</div>
@@ -1112,7 +1109,7 @@ exports[`renders ./components/badge/demo/no-wrapper.md correctly 1`] = `
class="ant-scroll-number ant-badge-count"
data-show="true"
style="background-color:#87d068;"
title="99+"
title="109"
>
99+
</sup>
@@ -1456,7 +1453,7 @@ exports[`renders ./components/badge/demo/overflow.md correctly 1`] = `
<sup
class="ant-scroll-number ant-badge-count"
data-show="true"
title="99+"
title="100"
>
99+
</sup>
@@ -1471,7 +1468,7 @@ exports[`renders ./components/badge/demo/overflow.md correctly 1`] = `
<sup
class="ant-scroll-number ant-badge-count"
data-show="true"
title="10+"
title="99"
>
10+
</sup>
@@ -1486,7 +1483,7 @@ exports[`renders ./components/badge/demo/overflow.md correctly 1`] = `
<sup
class="ant-scroll-number ant-badge-count"
data-show="true"
title="999+"
title="1000"
>
999+
</sup>

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
@@ -18,16 +18,15 @@ Badge normally appears in proximity to notification or head picture with eye-cat
</Badge>
```
```jsx
<Badge count={5} />
```
| Property | Description | Type | Default |
|----------------|-------------------------|------------|---------|
| 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 | '' |
| Property | Description | Type | Default |
| -------- | ----------- | ---- | ------- |
| count | Number to show in badge | number | |
| dot | Whether to display a red dot instead of `count` | boolean | `false` |
| overflowCount | Max count to show | number | 99 |
| showZero | Whether to show badge when `count` is zero | boolean | `false` |
| status | Set Badge as a status dot | `success` \| `processing` \| `default` \| `error` \| `warning` | `''` |
| text | If `status` is set, `text` sets the display text of the status `dot` | string | `''` |

View File

@@ -15,6 +15,7 @@ export interface BadgeProps {
dot?: boolean;
style?: React.CSSProperties;
prefixCls?: string;
scrollNumberPrefixCls?: string;
className?: string;
status?: 'success' | 'processing' | 'default' | 'error' | 'warning';
text?: string;
@@ -23,6 +24,7 @@ export interface BadgeProps {
export default class Badge extends React.Component<BadgeProps, any> {
static defaultProps = {
prefixCls: 'ant-badge',
scrollNumberPrefixCls: 'ant-scroll-number',
count: null,
showZero: false,
dot: false,
@@ -44,6 +46,7 @@ export default class Badge extends React.Component<BadgeProps, any> {
count,
showZero,
prefixCls,
scrollNumberPrefixCls,
overflowCount,
className,
style,
@@ -92,9 +95,11 @@ export default class Badge extends React.Component<BadgeProps, any> {
const scrollNumber = hidden ? null : (
<ScrollNumber
prefixCls={scrollNumberPrefixCls}
data-show={!hidden}
className={scrollNumberCls}
count={displayCount}
title={count}
style={style}
/>
);

View File

@@ -19,16 +19,15 @@ title: Badge
</Badge>
```
```jsx
<Badge count={5} />
```
| 参数 | 说明 | 类型 | 默认值 |
|----------------|----------------------------------|------------|---------|
| count | 展示的数字,大于 overflowCount 时显示为 `${overflowCount}+`,为 0 时隐藏 | number | |
| overflowCount | 展示封顶的数字值 | number | 99 |
| showZero | 当数值为 0 时,是否展示 Badge | boolean | false |
| dot | 不展示数字,只有一个小红点 | boolean | false |
| status | 设置 Badge 为状态点 | Enum{ 'success', 'processing, 'default', 'error', 'warning' } | '' |
| text | 在设置了 `status` 的前提下有效,设置状态点的文本 | string | '' |
| 参数 | 说明 | 类型 | 默认值 |
| --- | --- | --- | --- |
| count | 展示的数字,大于 overflowCount 时显示为 `${overflowCount}+`,为 0 时隐藏 | number | |
| dot | 展示数字,只有一个小红点 | boolean | false |
| overflowCount | 展示封顶的数字值 | number | 99 |
| showZero | 当数值为 0 时,是否展示 Badge | boolean | false |
| status | 设置 Badge 为状态点 | Enum{ 'success', 'processing, 'default', 'error', 'warning' } | '' |
| text | 在设置了 `status` 的前提下有效,设置状态点的文本 | string | '' |

View File

@@ -15,26 +15,36 @@ A breadcrumb displays the current location within a hierarchy. It allows going b
## API
| Property | Description | Type | Optional | Default |
|-----------|-----------------------------------|-----------------|---------|--------|
| routes | The routing stack information of router | object[] | | - |
| params | Routing parameter | object | | - |
| separator | Custom separator | string\|ReactNode | | '/' |
| itemRender | Custom item renderer | (route, params, routes, paths) => ReactNode | | - |
| Property | Description | Type | Optional | Default |
| -------- | ----------- | ---- | -------- | ------- |
| itemRender | Custom item renderer | (route, params, routes, paths) => ReactNode | | - |
| params | Routing parameters | object | | - |
| routes | The routing stack information of router | object\[] | | - |
| separator | Custom separator | string\|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';
const routes = [{
path: 'index',
 breadcrumbName: 'home'
}, {
path: 'first',
breadcrumbName: 'first'
}, {
path: 'second',
breadcrumbName: 'second'
}];
function itemRender(route, params, routes, paths) {
const last = routes.indexOf(route) === routes.length - 1;
return last ? <span>{route.breadcrumbName}</span> : <Link to={paths.join('/')}>{route.breadcrumbName}</Link>;
}
return <Breadcrumb itemRender={itemRender} />;
return <Breadcrumb itemRender={itemRender} routes={routes} />;
```

View File

@@ -15,12 +15,12 @@ title: Breadcrumb
## API
| 参数 | 说明 | 类型 | 可选值 | 默认值 |
|-----------|-----------------------------------|-----------------|---------|--------|
| routes | router 的路由栈信息 | object[] | | - |
| params | 路由的参数 | object | | - |
| separator | 分隔符自定义 | string\|ReactNode | | '/' |
| itemRender | 自定义链接函数,和 react-router 配置使用 | (route, params, routes, paths) => ReactNode | | - |
| 参数 | 说明 | 类型 | 可选值 | 默认值 |
| --- | --- | --- | --- | --- |
| itemRender | 自定义链接函数,和 react-router 配置使用 | (route, params, routes, paths) => ReactNode | | - |
| params | 路由的参数 | object | | - |
| routes | router 的路由栈信息 | object\[] | | - |
| separator | 分隔符自定义 | string\|ReactNode | | '/' |
> 2.0 之后,`linkRender` 和 `nameRender` 被移除,请使用 `itemRender` 来代替。
@@ -31,10 +31,20 @@ title: Breadcrumb
```jsx
import { Link } from 'react-router';
const routes = [{
path: 'index',
breadcrumbName: '首页'
}, {
path: 'first',
breadcrumbName: '一级面包屑'
}, {
path: 'second',
breadcrumbName: '当前页面'
}];
function itemRender(route, params, routes, paths) {
const last = routes.indexOf(route) === routes.length - 1;
return last ? <span>{route.breadcrumbName}</span> : <Link to={paths.join('/')}>{route.breadcrumbName}</Link>;
}
return <Breadcrumb itemRender={itemRender} />;
return <Breadcrumb itemRender={itemRender} routes={routes}/>;
```

View File

@@ -54,7 +54,7 @@ exports[`renders ./components/button/demo/button-group.md correctly 1`] = `
</span>
</button>
<button
class="ant-btn ant-btn-primary"
class="ant-btn"
type="button"
>
<span>
@@ -97,7 +97,7 @@ exports[`renders ./components/button/demo/button-group.md correctly 1`] = `
class="ant-btn-group"
>
<button
class="ant-btn ant-btn-primary"
class="ant-btn"
type="button"
>
<span>
@@ -115,14 +115,6 @@ exports[`renders ./components/button/demo/button-group.md correctly 1`] = `
<button
class="ant-btn"
type="button"
>
<span>
M
</span>
</button>
<button
class="ant-btn ant-btn-dashed"
type="button"
>
<span>
R
@@ -465,7 +457,7 @@ exports[`renders ./components/button/demo/multiple.md correctly 1`] = `
type="button"
>
<span>
more
Actions
</span>
<i
class="anticon anticon-down"
@@ -480,12 +472,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 +491,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 +530,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 +571,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 +581,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

@@ -11,7 +11,7 @@ export interface ButtonGroupProps {
}
const ButtonGroup: React.SFC<ButtonGroupProps> = (props) => {
const { prefixCls = 'ant-btn-group', size = '', className, ...others } = props;
const { prefixCls = 'ant-btn-group', size, className, ...others } = props;
// large => lg
// small => sm

View File

@@ -35,7 +35,7 @@ function insertSpace(child: React.ReactChild, needInserted: boolean) {
export type ButtonType = 'primary' | 'ghost' | 'dashed' | 'danger';
export type ButtonShape = 'circle' | 'circle-outline';
export type ButtonSize = 'small' | 'large';
export type ButtonSize = 'small' | 'default' | 'large';
export interface ButtonProps {
type?: ButtonType;
@@ -61,7 +61,6 @@ export default class Button extends React.Component<ButtonProps, any> {
static defaultProps = {
prefixCls: 'ant-btn',
loading: false,
clicked: false,
ghost: false,
};
@@ -83,6 +82,7 @@ export default class Button extends React.Component<ButtonProps, any> {
super(props);
this.state = {
loading: props.loading,
clicked: false,
};
}
@@ -124,7 +124,7 @@ export default class Button extends React.Component<ButtonProps, any> {
render() {
const {
type, shape, size = '', className, htmlType, children, icon, prefixCls, ghost, ...others,
type, shape, size, className, htmlType, children, icon, prefixCls, ghost, ...others,
} = this.props;
const { loading, clicked } = this.state;
@@ -146,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,
@@ -159,7 +159,7 @@ export default class Button extends React.Component<ButtonProps, any> {
return (
<button
{...omit(others, ['loading', 'clicked'])}
{...omit(others, ['loading'])}
type={htmlType || 'button'}
className={classes}
onClick={this.handleClick}

View File

@@ -26,7 +26,7 @@ ReactDOM.render(
<h4>Basic</h4>
<ButtonGroup>
<Button>Cancel</Button>
<Button type="primary">OK</Button>
<Button>OK</Button>
</ButtonGroup>
<ButtonGroup>
<Button disabled>L</Button>
@@ -34,10 +34,9 @@ ReactDOM.render(
<Button disabled>R</Button>
</ButtonGroup>
<ButtonGroup>
<Button type="primary">L</Button>
<Button>L</Button>
<Button>M</Button>
<Button>M</Button>
<Button type="dashed">R</Button>
<Button>R</Button>
</ButtonGroup>
<h4>With Icon</h4>

View File

@@ -35,7 +35,7 @@ ReactDOM.render(
<Button>secondary</Button>
<Dropdown overlay={menu}>
<Button>
more <Icon type="down" />
Actions <Icon type="down" />
</Button>
</Dropdown>
</div>,

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

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

View File

@@ -17,18 +17,18 @@ subtitle: 按钮
按钮的属性说明如下:
属性 | 说明 | 类型 | 默认值
-----|-----|-----|------
type | 设置按钮类型,可选值为 `primary` `dashed` `danger`(版本 2.7 中增加) 或者不设 | string | -
htmlType | 设置 `button` 原生的 `type` 值,可选值请参考 [HTML 标准](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#attr-type) | string | `button`
icon | 设置按钮的图标类型 | string | -
shape | 设置按钮形状,可选值为 `circle` 或者不设 | string | -
size | 设置按钮大小,可选值为 `small` `large` 或者不设 | string | `default`
loading | 设置按钮载入状态 | boolean \| { delay: number } | `false`
onClick | `click` 事件的 handler | function | -
ghost | 幽灵属性,使按钮背景透明,版本 2.7 中增加 | boolean | false
| 属性 | 说明 | 类型 | 默认值 |
| --- | --- | --- | --- |
| ghost | 幽灵属性,使按钮背景透明,版本 2.7 中增加 | boolean | false |
| htmlType | 设置 `button` 原生的 `type` 值,可选值请参考 [HTML 标准](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#attr-type) | string | `button` |
| icon | 设置按钮的图标类型 | string | - |
| loading | 设置按钮载入状态 | boolean \| { delay: number } | `false` |
| shape | 设置按钮形状,可选值为 `circle` 或者不设 | string | - |
| size | 设置按钮大小,可选值为 `small` `large` 或者不设 | string | `default` |
| type | 设置按钮类型,可选值为 `primary` `dashed` `danger`(版本 2.7 中增加) 或者不设 | string | - |
| onClick | `click` 事件的 handler | function | - |
`<Button>Hello world!</Button>` 最终会被渲染为 `<button>Hello world!</button>`,并且除了上表中的属性,其它属性都会直接传到 `<button></button>`
`<Button>Hello world!</Button>` 最终会被渲染为 `<button><span>Hello world!</span></button>`,并且除了上表中的属性,其它属性都会直接传到 `<button></button>`
<style>
[id^="components-button-demo-"] .ant-btn {

View File

@@ -93,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;
@@ -102,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;

File diff suppressed because it is too large Load Diff

View File

@@ -68,10 +68,12 @@ function getMonthData(value) {
function monthCellRender(value) {
const num = getMonthData(value);
return num ? <div className="notes-month">
<section>{num}</section>
<span>Backlog number</span>
</div> : null;
return num ? (
<div className="notes-month">
<section>{num}</section>
<span>Backlog number</span>
</div>
) : null;
}
ReactDOM.render(

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';
@@ -30,17 +30,17 @@ 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 | 无 |
| Property | Description | Type | Default |
| -------- | ----------- | ---- | ------- |
| dateCellRender | Customize the display of the date cell, the returned content will be appended to the cell | function(date: moment): ReactNode | - |
| dateFullCellRender | Customize the display of the date cell, the returned content will override the cell | function(date: moment): ReactNode | - |
| defaultValue | The date selected by default | [moment](http://momentjs.com/) | default date |
| disabledDate | Function that specifies the dates that cannot be selected | (currentDate: moment) => boolean | - |
| fullscreen | Whether to display in full-screen | boolean | `true` |
| locale | The calendar's locale | object | [default](https://github.com/ant-design/ant-design/blob/master/components/date-picker/locale/example.json) |
| mode | The display mode of the calendar | `month` \| `year` | `month` |
| monthCellRender | Customize the display of the month cell, the returned content will be appended to the cell | function(date: moment): ReactNode | - |
| monthFullCellRender | Customize the display of the month cell, the returned content will override the cell | function(date: moment): ReactNode | - |
| value | The current selected date | [moment](http://momentjs.com/) | current date |
| onPanelChange | Callback for when panel changes | function(date: moment, mode: string) | - |
| onSelect | Callback for when a date is selected | function(date: moment | - |

View File

@@ -12,7 +12,6 @@ title: Calendar
当数据是日期或按照日期划分时,例如日程、课表、价格日历等,农历等。目前支持年/月切换。
## API
**注意:**Calendar 部分 locale 是从 value 中读取,所以请先正确设置 moment 的 locale。
@@ -32,17 +31,17 @@ moment.locale('zh-cn');
/>
```
| 参数 | 说明 | 类型 | 默认值 |
|--------------|----------------|----------|--------------|
| value | 展示日期 | [moment](http://momentjs.com/) | 当前日期 |
| defaultValue | 默认展示的日期 | [moment](http://momentjs.com/) | 默认日期 |
| mode | 初始模式,`month/year` | string | month |
| fullscreen | 是否全屏显示 | boolean | true |
| dateCellRender | 自定义渲染日期单元格,返回内容会被追加到单元格| function(date: moment): ReactNode | 无 |
| monthCellRender | 自定义渲染月单元格,返回内容会被追加到单元格 | function(date: moment): ReactNode | 无 |
| dateFullCellRender | 自定义渲染日期单元格,返回内容覆盖单元格| function(date: moment): ReactNode | 无 |
| monthFullCellRender | 自定义渲染月单元格,返回内容覆盖单元格 | function(date: moment): ReactNode | 无 |
| locale | 国际化配置 | object | [默认配置](https://github.com/ant-design/ant-design/blob/master/components/date-picker/locale/example.json) |
| onPanelChange| 日期面板变化回调 | function(date: moment, mode: string) | 无 |
| onSelect | 点击选择日期回调 | function(date: moment | 无 |
| 参数 | 说明 | 类型 | 默认值 |
| --- | --- | --- | --- |
| dateCellRender | 自定义渲染日期单元格,返回内容会被追加到单元格 | function(date: moment): ReactNode | 无 |
| dateFullCellRender | 自定义渲染日期单元格,返回内容覆盖单元格 | function(date: moment): ReactNode | 无 |
| defaultValue | 默认展示的日期 | [moment](http://momentjs.com/) | 默认日期 |
| disabledDate | 不可选择的日期 | (currentDate: moment) => boolean | 无 |
| fullscreen | 是否全屏显示 | boolean | true |
| locale | 国际化配置 | object | [默认配置](https://github.com/ant-design/ant-design/blob/master/components/date-picker/locale/example.json) |
| mode | 初始模式,`month/year` | string | month |
| monthCellRender | 自定义渲染月单元格,返回内容会被追加到单元格 | function(date: moment): ReactNode | 无 |
| monthFullCellRender | 自定义渲染月单元格,返回内容覆盖单元格 | function(date: moment): ReactNode | 无 |
| value | 展示日期 | [moment](http://momentjs.com/) | 当前日期 |
| onPanelChange | 日期面板变化回调 | function(date: moment, mode: string) | 无 |
| onSelect | 点击选择日期回调 | function(date: moment | 无 |

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

@@ -2,10 +2,17 @@ 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', () => {
beforeAll(() => {
jest.useFakeTimers();
});
afterAll(() => {
jest.useRealTimers();
});
function fakeResizeWindowTo(wrapper, width) {
Object.defineProperties(wrapper.node.container, {
offsetWidth: {
@@ -16,13 +23,13 @@ describe('Card', () => {
window.resizeTo(width);
}
testMethod('resize card will trigger different padding', async () => {
testMethod('resize card will trigger different padding', () => {
const wrapper = mount(<Card title="xxx">xxx</Card>);
fakeResizeWindowTo(wrapper, 1000);
await delay(0);
jest.runAllTimers();
expect(wrapper.hasClass('ant-card-wider-padding')).toBe(true);
fakeResizeWindowTo(wrapper, 800);
await delay(0);
jest.runAllTimers();
expect(wrapper.hasClass('ant-card-wider-padding')).toBe(false);
});
});

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
@@ -19,18 +19,18 @@ A card can be used to display content related to a single subject. The content c
### Card
| Property | Description | Type | Default |
|----------|----------------|----------|--------------|
| 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 |
| bodyStyle | Inline style to apply to the card content | object | - |
| noHovering | Whether to be disable hovering when mouse over | boolean | false |
| loading | Shows a loading indicator while the contents of the card are being fetched | boolean | false |
| Property | Description | Type | Default |
| -------- | ----------- | ---- | ------- |
| bodyStyle | Inline style to apply to the card content | object | - |
| bordered | Toggles rendering of the border around the card | boolean | `true` |
| extra | Content to render in the top-right corner of the card | string\|ReactNode | - |
| 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` |
| title | Card title | string\|ReactNode | - |
### Card.Grid
Property | Description | Type | Default
---------|-------------|------|---------
className | className of container | string | -
style | style object of container | object | -
| Property | Description | Type | Default |
| -------- | ----------- | ---- | ------- |
| className | className of container | string | - |
| style | style object of container | object | - |

View File

@@ -20,18 +20,18 @@ cols: 1
### Card
| 参数 | 说明 | 类型 | 默认值 |
|----------|----------------|----------|--------------|
| title | 卡片标题 | string\|ReactNode | - |
| extra | 卡片右上角的操作区域 | string\|ReactNode | - |
| bordered | 是否有边框 | boolean | true |
| bodyStyle | 内容区域自定义样式 | object | - |
| 参数 | 说明 | 类型 | 默认值 |
| --- | --- | --- | --- |
| bodyStyle | 内容区域自定义样式 | object | - |
| bordered | 是否有边框 | boolean | true |
| extra | 卡片右上角的操作区域 | string\|ReactNode | - |
| loading | 当卡片内容还在加载中时,可以用 loading 展示一个占位 | boolean | false |
| noHovering | 取消鼠标移过浮起 | boolean | false |
| loading | 卡片内容还在加载中时,可以用 loading 展示一个占位 | boolean | false |
| title | 卡片标题 | string\|ReactNode | - |
### Card.Grid
Property | Description | Type | Default
---------|-------------|------|---------
className | 网格容器类名 | string | -
style | 定义网格容器类名的样式 | object | -
| Property | Description | Type | Default |
| -------- | ----------- | ---- | ------- |
| className | 网格容器类名 | string | - |
| style | 定义网格容器类名的样式 | object | - |

View File

@@ -14,7 +14,7 @@
&:not(&-no-hovering):hover {
box-shadow: @box-shadow-base;
border-color: transparent;
border-color: @shadow-color;
}
&-bordered {
@@ -30,6 +30,7 @@
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;
@@ -39,12 +40,16 @@
white-space: nowrap;
color: @card-head-color;
font-weight: 500;
float: left;
display: inline-block;
flex: 1;
}
}
&-extra {
float: right;
text-align: right;
// https://stackoverflow.com/a/22429853/3040605
margin-left: auto;
}
&-body {
@@ -52,25 +57,6 @@
.clearfix;
}
&-loading &-body {
user-select: none;
padding: 0;
}
&-loading-content {
padding: @card-padding-base;
}
&-loading-block {
display: inline-block;
margin: 5px 1% 0;
height: 14px;
border-radius: @border-radius-sm;
background: linear-gradient(90deg, rgba(207, 216, 220, .2), rgba(207, 216, 220, .4), rgba(207, 216, 220, .2));
animation: card-loading 1.4s ease infinite;
background-size: 600% 600%;
}
&-contain-grid &-body {
margin: -1px 0 0 -1px;
padding: 0;
@@ -111,6 +97,25 @@
&-padding-transition &-extra {
transition: right .3s;
}
&-loading &-body {
user-select: none;
padding: 0;
}
&-loading-content {
padding: @card-padding-base;
}
&-loading-block {
display: inline-block;
margin: 5px 1% 0;
height: 14px;
border-radius: @border-radius-sm;
background: linear-gradient(90deg, rgba(207, 216, 220, .2), rgba(207, 216, 220, .4), rgba(207, 216, 220, .2));
animation: card-loading 1.4s ease infinite;
background-size: 600% 600%;
}
}
@keyframes card-loading {

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

@@ -5,7 +5,7 @@ import Carousel from '..';
describe('Carousel', () => {
it('should has innerSlider', () => {
const wrapper = mount(<Carousel><div /></Carousel>);
const innerSlider = wrapper.node.innerSlider;
const { innerSlider } = wrapper.node;
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) |
| Property | Description | Type | Default |
| -------- | ----------- | ---- | ------- |
| afterChange | Callback function called after the current index changes | function(current) | - |
| autoplay | Whether to scroll automatically | boolean | `false` |
| beforeChange | Callback function called before the current index changes | function(from, to) | - |
| dots | Whether to show the dots at the bottom of the gallery | boolean | `true` |
| easing | Transition interpolation function name | string | `linear` |
| effect | Transition effect | `scrollx` \| `fade` | `scrollx` |
| vertical | Whether to use a vertical display | boolean | `false` |
For more info on the parameters, refer to the https://github.com/akiran/react-slick
For more info on the parameters, refer to the <https://github.com/akiran/react-slick>

View File

@@ -80,8 +80,8 @@ export default class Carousel extends React.Component<CarouselProps, any> {
innerSlider: any;
constructor() {
super();
constructor(props) {
super(props);
this.onWindowResized = debounce(this.onWindowResized, 500, {
leading: false,
});

View File

@@ -15,14 +15,14 @@ subtitle: 走马灯
## API
| 参数 | 说明 | 类型 | 默认值 |
|------------------|----------------------------------------------|----------|---------------------------------|
| effect | 动画效果函数,可取 scrollx, fade | string | scrollx |
| dots | 是否显示面板指示点 | boolean | true |
| vertical | 垂直显示 | boolean | false |
| autoplay | 是否自动切换 | boolean | false |
| easing | 动画效果 | string | linear |
| beforeChange | 切换面板的回调 | function(from, to) | 无
| afterChange | 切换面板的回调 | function(current) | 无
| 参数 | 说明 | 类型 | 默认值 |
| --- | --- | --- | --- |
| afterChange | 切换面板的回调 | function(current) | 无 |
| autoplay | 是否自动切换 | boolean | false |
| beforeChange | 切换面板的回调 | function(from, to) | 无 |
| dots | 是否显示面板指示点 | boolean | true |
| easing | 动画效果 | string | linear |
| effect | 动画效果函数,可取 scrollx, fade | string | scrollx |
| vertical | 垂直显示 | boolean | false |
更多参数可参考https://github.com/akiran/react-slick
更多参数可参考:<https://github.com/akiran/react-slick>

View File

@@ -32,14 +32,10 @@ const options = [{
class LazyOptions extends React.Component {
state = {
inputValue: '',
options,
};
onChange = (value, selectedOptions) => {
console.log(value, selectedOptions);
this.setState({
inputValue: selectedOptions.map(o => o.label).join(', '),
});
}
loadData = (selectedOptions) => {
const targetOption = selectedOptions[selectedOptions.length - 1];

View File

@@ -6,7 +6,6 @@ title: Cascader
Cascade selection box.
## When To Use
- When you need to select from a set of associated data set. Such as province/city/district, company level, things classification.
@@ -20,36 +19,37 @@ Cascade selection box.
```
| Property | Description | Type | Default |
|------|------|------|--------|
| options | data options of cascade | object | - |
| 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 | - |
| -------- | ----------- | ---- | ------- |
| allowClear | whether allow clear | boolean | true |
| changeOnSelect | change value on each selection if set to true, see above demo for details | boolean | false |
| className | additional css class | string | - |
| defaultValue | initial selected value | [CascaderOptionType](https://git.io/vMMoK)\[] | \[] |
| disabled | whether disabled select | boolean | false |
| displayRender | render function of displaying selected options | `(label, selectedOptions) => ReactNode` | `label => label.join(' / ')` |
| expandTrigger | expand current item when click or hover, one of 'click' 'hover' | string | 'click' |
| getPopupContainer | Parent Node which the selector should be rendered to. Default to `body`. When position issues happen, try to modify it into scrollable content and position it relative.[example](https://codepen.io/afc163/pen/zEjNOy?editors=0010) | Function(triggerNode) | () => document.body |
| loadData | To load option lazily, and it cannot work with `showSearch` | `(selectedOptions) => void` | - |
| notFoundContent | Specify content to show when no result matches. | string | 'Not Found' |
| options | data options of cascade | object | - |
| placeholder | input placeholder | string | 'Please select' |
| popupClassName | additional className of popup overlay | string | - |
| popupPlacement | use preset popup align config from builtinPlacements`bottomLeft` `bottomRight` `topLeft` `topRight` | string | `bottomLeft` |
| placeholder | input placeholder | string | 'Please select' |
| size | input size, one of `large` `default` `small` | string | `default` |
| disabled | whether disabled select | boolean | false |
| allowClear | whether allow clear | boolean | true |
| expandTrigger | expand current item when click or hover, one of 'click' 'hover' | string | 'click' |
| changeOnSelect | change value on each selection if set to true, see above demo for details | boolean | false |
| showSearch | Whether show search input in single mode. | boolean\|object | false |
| notFoundContent | Specify content to show when no result matches. | string | 'Not Found' |
| loadData | To load option lazily, and it cannot work with `showSearch` | `(selectedOptions) => void` | - |
| getPopupContainer | Parent Node which the selector should be rendered to. Default to `body`. When position issues happen, try to modify it into scrollable content and position it relative.[example](http://codepen.io/anon/pen/xVBOVQ?editors=001) | Function(triggerNode) | () => document.body |
| size | input size, one of `large` `default` `small` | string | `default` |
| style | additional style | string | - |
| 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` | - |
| popupVisible | set visible of cascader popup | boolean | - |
Fields in `showSearch`:
| Property | Description | Type | Default |
|----------|-------------|------|---------|
| filter | The function will receive two arguments, inputValue and option, if the function returns true, the option will be included in the filtered set; Otherwise, it will be excluded. | `function(inputValue, path): boolean` | |
| render | Used to render filtered options. | `function(inputValue, path): ReactNode` | |
| sort | Used to sort filtered options. | `function(a, b, inputValue)` | |
| matchInputWidth | Whether the width of result list equals to input's | boolean | |
| -------- | ----------- | ---- | ------- |
| filter | The function will receive two arguments, inputValue and option, if the function returns true, the option will be included in the filtered set; Otherwise, it will be excluded. | `function(inputValue, path): boolean` | |
| matchInputWidth | Whether the width of result list equals to input's | boolean | |
| render | Used to render filtered options. | `function(inputValue, path): ReactNode` | |
| sort | Used to sort filtered options. | `function(a, b, inputValue)` | |
<style>
.ant-cascader-picker {

View File

@@ -120,7 +120,7 @@ export default class Cascader extends React.Component<CascaderProps, any> {
value: props.value || props.defaultValue || [],
inputValue: '',
inputFocused: false,
popupVisible: false,
popupVisible: props.popupVisible,
flattenOptions: props.showSearch && this.flattenTree(props.options, props.changeOnSelect),
};
}
@@ -129,6 +129,9 @@ export default class Cascader extends React.Component<CascaderProps, any> {
if ('value' in nextProps) {
this.setState({ value: nextProps.value || [] });
}
if ('popupVisible' in nextProps) {
this.setState({ popupVisible: nextProps.popupVisible });
}
if (nextProps.showSearch && this.props.options !== nextProps.options) {
this.setState({ flattenOptions: this.flattenTree(nextProps.options, nextProps.changeOnSelect) });
}
@@ -146,11 +149,13 @@ export default class Cascader extends React.Component<CascaderProps, any> {
}
handlePopupVisibleChange = (popupVisible) => {
this.setState({
popupVisible,
inputFocused: popupVisible,
inputValue: popupVisible ? this.state.inputValue : '',
});
if (!('popupVisible' in this.props)) {
this.setState({
popupVisible,
inputFocused: popupVisible,
inputValue: popupVisible ? this.state.inputValue : '',
});
}
const onPopupVisibleChange = this.props.onPopupVisibleChange;
if (onPopupVisibleChange) {
@@ -208,7 +213,7 @@ export default class Cascader extends React.Component<CascaderProps, any> {
e.stopPropagation();
if (!this.state.inputValue) {
this.setValue([]);
this.setState({ popupVisible: false });
this.handlePopupVisibleChange(false);
} else {
this.setState({ inputValue: '' });
}
@@ -218,7 +223,7 @@ export default class Cascader extends React.Component<CascaderProps, any> {
let flattenOptions: any = [];
options.forEach((option) => {
const path = ancestor.concat(option);
if (changeOnSelect || !option.children) {
if (changeOnSelect || !option.children || !option.children.length) {
flattenOptions.push(path);
}
if (option.children) {
@@ -336,6 +341,7 @@ export default class Cascader extends React.Component<CascaderProps, any> {
<Input
{...inputProps}
ref="input"
prefixCls={inputPrefixCls}
placeholder={value && value.length > 0 ? undefined : placeholder}
className={`${prefixCls}-input ${sizeCls}`}
value={state.inputValue}

View File

@@ -7,7 +7,6 @@ subtitle: 级联选择
级联选择框。
## 何时使用
- 需要从一组相关联的数据集合进行选择,例如省市区,公司层级,事物分类等。
@@ -21,36 +20,37 @@ subtitle: 级联选择
```
| 参数 | 说明 | 类型 | 默认值 |
|------|------|------|--------|
| options | 可选项数据源 | object | - |
| 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 | - |
| --- | --- | --- | --- |
| allowClear | 是否支持清除 | boolean | true |
| changeOnSelect | 当此项为 true 时,点选每级菜单选项值都会发生变化,具体见上面的演示 | boolean | false |
| className | 自定义类名 | string | - |
| defaultValue | 默认的选中项 | [CascaderOptionType](https://git.io/vMMoK)\[] | \[] |
| disabled | 禁用 | boolean | false |
| displayRender | 选择后展示的渲染函数 | `(label, selectedOptions) => ReactNode` | `label => label.join(' / ')` |
| expandTrigger | 次级菜单的展开方式,可选 'click' 和 'hover' | string | 'click' |
| getPopupContainer | 菜单渲染父节点。默认渲染到 body 上,如果你遇到菜单滚动定位问题,试试修改为滚动的区域,并相对其定位。[示例](https://codepen.io/afc163/pen/zEjNOy?editors=0010) | Function(triggerNode) | () => document.body |
| loadData | 用于动态加载选项,无法与 `showSearch` 一起使用 | `(selectedOptions) => void` | - |
| notFoundContent | 当下拉列表为空时显示的内容 | string | 'Not Found' |
| options | 可选项数据源 | object | - |
| placeholder | 输入框占位文本 | string | '请选择' |
| popupClassName | 自定义浮层类名 | string | - |
| popupPlacement | 浮层预设位置:`bottomLeft` `bottomRight` `topLeft` `topRight` | Enum | `bottomLeft` |
| placeholder | 输入框占位文本 | string | '请选择' |
| size | 输入框大小,可选 `large` `default` `small` | string | `default` |
| disabled | 禁用 | boolean | false |
| allowClear | 是否支持清除 | boolean | true |
| expandTrigger | 次级菜单的展开方式,可选 'click' 和 'hover' | string | 'click' |
| changeOnSelect | 当此项为 true 时,点选每级菜单选项值都会发生变化,具体见上面的演示 | boolean | false |
| showSearch | 在选择框中显示搜索框 | boolean | false |
| notFoundContent | 当下拉列表为空时显示的内容 | string | 'Not Found' |
| loadData | 用于动态加载选项,无法与 `showSearch` 一起使用 | `(selectedOptions) => void` | - |
| getPopupContainer | 菜单渲染父节点。默认渲染到 body 上,如果你遇到菜单滚动定位问题,试试修改为滚动的区域,并相对其定位。[示例](http://codepen.io/anon/pen/xVBOVQ?editors=001) | Function(triggerNode) | () => document.body |
| size | 输入框大小,可选 `large` `default` `small` | string | `default` |
| style | 自定义样式 | string | - |
| value | 指定选中项 | [CascaderOptionType](https://git.io/vMMoK)\[] | - |
| onChange | 选择完成后的回调 | `(value, selectedOptions) => void` | - |
| onPopupVisibleChange | 显示/隐藏浮层的回调 | `(value) => void` | - |
| popupVisible | 控制浮层显隐 | boolean | - |
`showSearch` 为对象时,其中的字段:
| 参数 | 说明 | 类型 | 默认值 |
|------|------|------|--------|
| filter | 接收 `inputValue` `path` 两个参数,当 `path` 符合筛选条件时,应返回 true反之则返回 false。 | `function(inputValue, path): boolean` | |
| render | 用于渲染 filter 后的选项 | `function(inputValue, path): ReactNode` | |
| sort | 用于排序 filter 后的选项 | `function(a, b, inputValue)` | |
| matchInputWidth | 搜索结果列表是否与输入框同宽 | boolean | |
| --- | --- | --- | --- |
| filter | 接收 `inputValue` `path` 两个参数,当 `path` 符合筛选条件时,应返回 true反之则返回 false。 | `function(inputValue, path): boolean` | |
| matchInputWidth | 搜索结果列表是否与输入框同宽 | boolean | |
| render | 用于渲染 filter 后的选项 | `function(inputValue, path): ReactNode` | |
| sort | 用于排序 filter 后的选项 | `function(a, b, inputValue)` | |
<style>
.ant-cascader-picker {

View File

@@ -179,6 +179,7 @@
}
&-expand {
position: relative;
padding-right: 24px;
&:after {
.iconfont-font("\e61f");
.iconfont-size-under-12px(8px);

View File

@@ -12,12 +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.ReactChild;
children?: React.ReactNode;
}
export interface CheckboxProps extends AbstractCheckboxProps {

View File

@@ -15,19 +15,19 @@ Checkbox.
### Checkbox
| Property | Description | Type | Default |
|----------|------------------|----------|--------|
| Property | Description | Type | Default |
| -------- | ----------- | ---- | ------- |
| checked | Specifies whether the checkbox is selected. | boolean | false |
| defaultChecked | Specifies the initial state: whether or not the checkbox is selected. | boolean | false |
| disabled | Disable checkbox | boolean | false |
| onChange | The callback function that is triggered when the state changes. | Function(e:Event) | - |
| disabled | Disable checkbox | boolean | false|
### Checkbox Group
| Property | Description | Type | Default |
|----------|------------------|----------|--------|
| defaultValue | Default selected value | string[] | [] |
| 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) | - |
| Property | Description | Type | Default |
| -------- | ----------- | ---- | ------- |
| defaultValue | Default selected value | string\[] | \[] |
| disabled | Disable all checkboxes | boolean | false |
| options | Specifies options | string\[] | \[] |
| value | Used for setting the currently selected value. | string\[] | \[] |
| onChange | The callback function that is triggered when the state changes. | Function(checkedValue) | - |

View File

@@ -16,18 +16,18 @@ title: Checkbox
### Checkbox
| 参数 | 说明 | 类型 | 默认值 |
|----------|------------------|----------|--------|
| checked | 指定当前是否选中 | boolean | false |
| 参数 | 说明 | 类型 | 默认值 |
| --- | --- | --- | --- |
| checked | 指定当前是否选中 | boolean | false |
| defaultChecked | 初始是否选中 | boolean | false |
| onChange | 变化时回调函数 | Function(e:Event) | - |
| indeterminate | 设置 indeterminate 状态,只负责样式控制 | boolean | false |
| onChange | 变化时回调函数 | Function(e:Event) | - |
### Checkbox Group
| 参数 | 说明 | 类型 | 默认值 |
|----------|------------------|----------|--------|
| defaultValue | 默认选中的选项 | string[] | [] |
| value | 指定选中的选项| string[] | [] |
| options | 指定选项 | string[] | [] |
| 参数 | 说明 | 类型 | 默认值 |
| --- | --- | --- | --- |
| defaultValue | 默认选中的选项 | string\[] | \[] |
| options | 指定选项 | string\[] | \[] |
| value | 指定选中的选项 | string\[] | \[] |
| onChange | 变化时回调函数 | Function(checkedValue) | - |

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,13 +83,15 @@
// 半选状态
.@{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 {
@@ -98,11 +102,7 @@
.@{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;
@@ -151,8 +151,8 @@
cursor: pointer;
font-size: @font-size-base;
display: inline-block;
&:not(:last-child) {
margin-right: 8px;
& + & {
margin-left: 8px;
}
}
@@ -166,6 +166,13 @@
font-size: @font-size-base;
&-item {
display: inline-block;
margin-right: 8px;
&:last-child {
margin-right: 0;
}
}
&-item + &-item {
margin-left: 0;
}
}

View File

@@ -6,6 +6,7 @@ exports[`renders ./components/collapse/demo/accordion.md correctly 1`] = `
>
<div
class="ant-collapse-item"
role="tablist"
>
<div
aria-expanded="false"
@@ -20,6 +21,7 @@ exports[`renders ./components/collapse/demo/accordion.md correctly 1`] = `
</div>
<div
class="ant-collapse-item"
role="tablist"
>
<div
aria-expanded="false"
@@ -34,6 +36,7 @@ exports[`renders ./components/collapse/demo/accordion.md correctly 1`] = `
</div>
<div
class="ant-collapse-item"
role="tablist"
>
<div
aria-expanded="false"
@@ -55,6 +58,7 @@ exports[`renders ./components/collapse/demo/basic.md correctly 1`] = `
>
<div
class="ant-collapse-item ant-collapse-item-active"
role="tablist"
>
<div
aria-expanded="true"
@@ -75,16 +79,17 @@ exports[`renders ./components/collapse/demo/basic.md correctly 1`] = `
>
<p>
A dog is a type of domesticated animal.
Known for its loyalty and faithfulness,
it can be found as a welcome guest in many households across the world.
A dog is a type of domesticated animal.
Known for its loyalty and faithfulness,
it can be found as a welcome guest in many households across the world.
</p>
</div>
</div>
</div>
<div
class="ant-collapse-item"
role="tablist"
>
<div
aria-expanded="false"
@@ -99,6 +104,7 @@ exports[`renders ./components/collapse/demo/basic.md correctly 1`] = `
</div>
<div
class="ant-collapse-item ant-collapse-item-disabled"
role="tablist"
>
<div
aria-expanded="false"
@@ -120,6 +126,7 @@ exports[`renders ./components/collapse/demo/borderless.md correctly 1`] = `
>
<div
class="ant-collapse-item ant-collapse-item-active"
role="tablist"
>
<div
aria-expanded="true"
@@ -140,16 +147,17 @@ exports[`renders ./components/collapse/demo/borderless.md correctly 1`] = `
>
<p>
A dog is a type of domesticated animal.
Known for its loyalty and faithfulness,
it can be found as a welcome guest in many households across the world.
A dog is a type of domesticated animal.
Known for its loyalty and faithfulness,
it can be found as a welcome guest in many households across the world.
</p>
</div>
</div>
</div>
<div
class="ant-collapse-item"
role="tablist"
>
<div
aria-expanded="false"
@@ -164,6 +172,7 @@ exports[`renders ./components/collapse/demo/borderless.md correctly 1`] = `
</div>
<div
class="ant-collapse-item"
role="tablist"
>
<div
aria-expanded="false"
@@ -185,7 +194,8 @@ 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;"
role="tablist"
style="background:#f7f7f7;border-radius:4px;margin-bottom:24px;border:0;overflow:hidden;"
>
<div
aria-expanded="true"
@@ -206,17 +216,18 @@ exports[`renders ./components/collapse/demo/custom.md correctly 1`] = `
>
<p>
A dog is a type of domesticated animal.
Known for its loyalty and faithfulness,
it can be found as a welcome guest in many households across the world.
A dog is a type of domesticated animal.
Known for its loyalty and faithfulness,
it can be found as a welcome guest in many households across the world.
</p>
</div>
</div>
</div>
<div
class="ant-collapse-item"
style="background:#f7f7f7;border-radius:4px;margin-bottom:24px;border:0;"
role="tablist"
style="background:#f7f7f7;border-radius:4px;margin-bottom:24px;border:0;overflow:hidden;"
>
<div
aria-expanded="false"
@@ -231,7 +242,8 @@ 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;"
role="tablist"
style="background:#f7f7f7;border-radius:4px;margin-bottom:24px;border:0;overflow:hidden;"
>
<div
aria-expanded="false"
@@ -253,6 +265,7 @@ exports[`renders ./components/collapse/demo/mix.md correctly 1`] = `
>
<div
class="ant-collapse-item"
role="tablist"
>
<div
aria-expanded="false"
@@ -267,6 +280,7 @@ exports[`renders ./components/collapse/demo/mix.md correctly 1`] = `
</div>
<div
class="ant-collapse-item"
role="tablist"
>
<div
aria-expanded="false"
@@ -281,6 +295,7 @@ exports[`renders ./components/collapse/demo/mix.md correctly 1`] = `
</div>
<div
class="ant-collapse-item"
role="tablist"
>
<div
aria-expanded="false"

View File

@@ -1,6 +1,6 @@
---
order: 1
title:
title:
zh-CN: 手风琴
en-US: Accordion
---
@@ -25,13 +25,13 @@ const text = `
ReactDOM.render(
<Collapse accordion>
<Panel header={'This is panel header 1'} key="1">
<Panel header="This is panel header 1" key="1">
<p>{text}</p>
</Panel>
<Panel header={'This is panel header 2'} key="2">
<Panel header="This is panel header 2" key="2">
<p>{text}</p>
</Panel>
<Panel header={'This is panel header 3'} key="3">
<Panel header="This is panel header 3" key="3">
<p>{text}</p>
</Panel>
</Collapse>

View File

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

View File

@@ -29,17 +29,17 @@ const text = `
ReactDOM.render(
<Collapse onChange={callback}>
<Panel header={'This is panel header 1'} key="1">
<Panel header="This is panel header 1" key="1">
<Collapse defaultActiveKey="1">
<Panel header={'This is panel nest panel'} key="1">
<Panel header="This is panel nest panel" key="1">
<p>{text}</p>
</Panel>
</Collapse>
</Panel>
<Panel header={'This is panel header 2'} key="2">
<Panel header="This is panel header 2" key="2">
<p>{text}</p>
</Panel>
<Panel header={'This is panel header 3'} key="3">
<Panel header="This is panel header 3" key="3">
<p>{text}</p>
</Panel>
</Collapse>

View File

@@ -16,16 +16,16 @@ A content area which can be collapsed and expanded.
### Collapse
| 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 | - |
| 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 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 |
| Property | Description | Type | Default |
| -------- | ----------- | ---- | ------- |
| disabled | If `true`, panel cannot be opened or closed | boolean | `false` |
| header | Title of the panel | string\|ReactNode | - |
| key | Unique key identifying the panel from among its siblings | string | - |

View File

@@ -17,17 +17,16 @@ cols: 1
### Collapse
| 参数 | 说明 | 类型 | 默认值 |
|------------------|----------------------------------------------|----------|---------------------------------|
| activeKey | 当前激活 tab 面板的 key| string[]\|string | 默认无accordion模式下默认第一个元素|
| defaultActiveKey | 初始化选中面板的 key | string | 无 |
| onChange | 切换面板的回调 | Function | 无 |
| 参数 | 说明 | 类型 | 默认值 |
| --- | --- | --- | --- |
| activeKey | 当前激活 tab 面板的 key | string\[]\|string | 默认无accordion模式下默认第一个元素 |
| defaultActiveKey | 初始化选中面板的 key | string | 无 |
| onChange | 切换面板的回调 | Function | 无 |
### Collapse.Panel
| 参数 | 说明 | 类型 | 默认值 |
|------|------------------|-------------------------|--------|
| key | 对应 activeKey | string | 无 |
| header | 面板头内容 | string\|ReactNode | 无 |
| 参数 | 说明 | 类型 | 默认值 |
| --- | --- | --- | --- |
| disabled | 禁用后的面板展开与否将无法通过用户交互改变 | boolean | false |
| header | 面板头内容 | string\|ReactNode | 无 |
| key | 对应 activeKey | string | 无 |

View File

@@ -45,7 +45,7 @@
display: inline-block;
font-weight: bold;
line-height: 40px;
vertical-align: middle;
vertical-align: top;
transition: transform 0.24s;
top: 0;
left: 16px;
@@ -93,6 +93,11 @@
border: 0;
}
&-borderless > &-item:last-child,
&-borderless > &-item:last-child &-header {
border-radius: 0;
}
&-borderless > &-item-active {
border: 0;
}

View File

@@ -111,7 +111,9 @@ export default class RangePicker extends React.Component<any, any> {
}
handleOpenChange = (open) => {
this.setState({ open });
if (!('open' in this.props)) {
this.setState({ open });
}
const { onOpenChange } = this.props;
if (onOpenChange) {
@@ -123,9 +125,9 @@ export default class RangePicker extends React.Component<any, any> {
handleHoverChange = hoverValue => this.setState({ hoverValue });
setValue(value) {
setValue(value, hidePanel?) {
this.handleChange(value);
if (!this.props.showTime) {
if ((hidePanel || !this.props.showTime) && !('open' in this.props)) {
this.setState({ open: false });
}
}
@@ -145,7 +147,7 @@ export default class RangePicker extends React.Component<any, any> {
return (
<a
key={range}
onClick={() => this.setValue(value)}
onClick={() => this.setValue(value, true)}
onMouseEnter={() => this.setState({ hoverValue: value })}
onMouseLeave={this.clearHoverValue}
>

View File

@@ -37,6 +37,7 @@ export default function createPicker(TheCalendar): any {
}
this.state = {
value,
showDate: value,
};
}
@@ -44,6 +45,7 @@ export default function createPicker(TheCalendar): any {
if ('value' in nextProps) {
this.setState({
value: nextProps.value,
showDate: nextProps.value,
});
}
}
@@ -66,13 +68,20 @@ export default function createPicker(TheCalendar): any {
handleChange = (value) => {
const props = this.props;
if (!('value' in props)) {
this.setState({ value });
this.setState({
value,
showDate: value,
});
}
props.onChange(value, (value && value.format(props.format)) || '');
}
handleCalendarChange = (value: moment.Moment) => {
this.setState({ showDate: value });
}
render() {
const { value } = this.state;
const { value, showDate } = this.state;
const props = omit(this.props, ['onChange']);
const { prefixCls, locale } = props;
@@ -116,6 +125,8 @@ export default function createPicker(TheCalendar): any {
showToday={props.showToday}
monthCellContentRender={props.monthCellContentRender}
renderFooter={this.renderFooter}
onChange={this.handleCalendarChange}
value={showDate}
/>
);
@@ -156,13 +167,14 @@ export default function createPicker(TheCalendar): any {
...props.style,
...pickerStyle,
};
return (
<span className={classNames(props.className, props.pickerClass)} style={style}>
<RcDatePicker
{...props}
{...pickerChangeHandler}
calendar={calendar}
value={pickerValue}
value={value}
prefixCls={`${prefixCls}-picker-container`}
style={props.popupStyle}
>

View File

@@ -14,9 +14,9 @@ By clicking the input box, you can select a date from a popup calendar.
There are three kinds of picker:
* DatePicker
* MonthPicker
* RangePicker
- DatePicker
- MonthPicker
- RangePicker
**Note:** Part of locale of DatePicker, MonthPicker, RangePicker is read from value. So, please set the locale of moment correctly.
@@ -34,59 +34,59 @@ moment.locale('zh-cn');
The following APIs are shared by DatePicker, MonthPicker, RangePicker.
| Property | Description | Type | Default |
|--------------|----------------|----------|--------------|
| allowClear | Whether to show clear button | boolean | true |
| disabled | determine whether the DatePicker is disabled | boolean | false |
| Property | Description | Type | Default |
| -------- | ----------- | ---- | ------- |
| allowClear | Whether to show clear button | boolean | true |
| className | picker className | string | '' |
| style | to customize the style of the input box | object | {} |
| popupStyle | to customize the style of the popup calendar | object | {} |
| size | determine the size of the input box, the height of `large` and `small`, are 32px and 22px respectively, while default size is 28px | string | - |
| locale | localization configuration | object | [default](https://github.com/ant-design/ant-design/blob/master/components/date-picker/locale/example.json) |
| disabledDate | specify the date that cannot be selected | (currentDate: moment) => boolean | - |
| disabled | determine whether the DatePicker is disabled | boolean | false |
| disabledDate | specify the date that cannot be selected | (currentDate: moment) => boolean | - |
| getCalendarContainer | to set the container of the floating layer, while the default is to create a `div` element in `body` | function(trigger) | - |
| locale | localization configuration | object | [default](https://github.com/ant-design/ant-design/blob/master/components/date-picker/locale/example.json) |
| open | open state of picker | boolean | - |
| onOpenChange | a callback function, can be executed whether the popup calendar is popped up or closed | function(status) | - |
| placeholder | placeholder of date input | string\|RangePicker[] | - |
| placeholder | placeholder of date input | string\|RangePicker\[] | - |
| popupStyle | to customize the style of the popup calendar | object | {} |
| size | determine the size of the input box, the height of `large` and `small`, are 32px and 22px respectively, while default size is 28px | string | - |
| style | to customize the style of the input box | object | {} |
| onOpenChange | a callback function, can be executed whether the popup calendar is popped up or closed | function(status) | - |
### DatePicker
| Property | Description | Type | Default |
|--------------|----------------|----------|--------------|
| value | to set date | [moment](http://momentjs.com/) | - |
| defaultValue | to set default date | [moment](http://momentjs.com/) | - |
| format | to set the date format, refer to [moment.js](http://momentjs.com/) | string | "YYYY-MM-DD" |
| onChange | a callback function, can be executed when the selected time is changing | function(date: moment, dateString: string) | - |
| showTime | to provide an additional time selection | object\|boolean | [TimePicker Options](/components/time-picker/#API) |
| showTime.defaultValue | to set default time of selected date, [demo](https://ant.design/components/date-picker/#components-date-picker-demo-disabled-date) | [moment](http://momentjs.com/) | moment() |
| showToday | whether to show "Today" button | boolean | true |
| Property | Description | Type | Default |
| -------- | ----------- | ---- | ------- |
| defaultValue | to set default date | [moment](http://momentjs.com/) | - |
| disabledTime | to specify the time that cannot be selected | function(date) | - |
| onOk | callback when click ok button | function() | - |
| format | to set the date format, refer to [moment.js](http://momentjs.com/) | string | "YYYY-MM-DD" |
| renderExtraFooter | render extra footer in panel | () => React.ReactNode | - |
| showTime | to provide an additional time selection | object\|boolean | [TimePicker Options](/components/time-picker/#API) |
| showTime.defaultValue | to set default time of selected date, [demo](https://ant.design/components/date-picker/#components-date-picker-demo-disabled-date) | [moment](http://momentjs.com/) | moment() |
| showToday | whether to show "Today" button | boolean | true |
| value | to set date | [moment](http://momentjs.com/) | - |
| onChange | a callback function, can be executed when the selected time is changing | function(date: moment, dateString: string) | - |
| onOk | callback when click ok button | function() | - |
### MonthPicker
| Property | Description | Type | Default |
|--------------|----------------|----------|--------------|
| value | to set date | [moment](http://momentjs.com/) | - |
| defaultValue | to set default date | [moment](http://momentjs.com/) | - |
| format | to set the date format, refer to [moment.js](http://momentjs.com/) | string | "YYYY-MM" |
| onChange | a callback function, can be executed when the selected time is changing | function(date: moment, dateString: string) | - |
| Property | Description | Type | Default |
| -------- | ----------- | ---- | ------- |
| defaultValue | to set default date | [moment](http://momentjs.com/) | - |
| format | to set the date format, refer to [moment.js](http://momentjs.com/) | string | "YYYY-MM" |
| monthCellContentRender | Custom month cell content render method | function(date, locale): ReactNode | - |
| value | to set date | [moment](http://momentjs.com/) | - |
| onChange | a callback function, can be executed when the selected time is changing | function(date: moment, dateString: string) | - |
### RangePicker
| Property | Description | Type | Default |
|--------------|----------------|----------|--------------|
| value | to set date | [[moment](http://momentjs.com/), [moment](http://momentjs.com/)] | - |
| defaultValue | to set default date | [[moment](http://momentjs.com/), [moment](http://momentjs.com/)] | - |
| format | to set the date format | string | "YYYY-MM-DD HH:mm:ss" |
| onChange | a callback function, can be executed when the selected time is changing | function(dates: [moment, moment], dateStrings: [string, string]) | - |
| showTime | to provide an additional time selection | object\|boolean | [TimePicker Options](/components/time-picker/#API) |
| showTime.defaultValue | to set default time of selected date, [demo](https://ant.design/components/date-picker/#components-date-picker-demo-disabled-date) | [moment](http://momentjs.com/)[] | [moment(), moment()] |
| Property | Description | Type | Default |
| -------- | ----------- | ---- | ------- |
| defaultValue | to set default date | \[[moment](http://momentjs.com/), [moment](http://momentjs.com/)] | - |
| disabledTime | to specify the time that cannot be selected | function(dates: [moment, moment], partial: `'start'|'end'`) | - |
| ranges | preseted ranges for quick selection | { [range: string]: [moment](http://momentjs.com/)[] } | - |
| format | to set the date format | string | "YYYY-MM-DD HH:mm:ss" |
| ranges | preseted ranges for quick selection | { [range: string]&#x3A; [moment](http://momentjs.com/)\[] } | - |
| renderExtraFooter | render extra footer in panel | () => React.ReactNode | - |
| showTime | to provide an additional time selection | object\|boolean | [TimePicker Options](/components/time-picker/#API) |
| showTime.defaultValue | to set default time of selected date, [demo](https://ant.design/components/date-picker/#components-date-picker-demo-disabled-date) | [moment](http://momentjs.com/)\[] | [moment(), moment()] |
| value | to set date | \[[moment](http://momentjs.com/), [moment](http://momentjs.com/)] | - |
| onChange | a callback function, can be executed when the selected time is changing | function(dates: [moment, moment], dateStrings: [string, string]) | - |
| onOk | callback when click ok button | function() | - |
<style>

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

@@ -15,9 +15,9 @@ subtitle: 日期选择框
日期类组件包括以下三种形式。
* DatePicker
* MonthPicker
* RangePicker
- DatePicker
- MonthPicker
- RangePicker
**注意:**DatePicker、MonthPicker、RangePicker 部分 locale 是从 value 中读取,所以请先正确设置 moment 的 locale。
@@ -35,59 +35,59 @@ moment.locale('zh-cn');
以下 API 为 DatePicker、MonthPicker、RangePicker 共享的 API。
| 参数 | 说明 | 类型 | 默认值 |
|--------------|----------------|----------|--------------|
| allowClear | 是否显示清除按钮 | boolean | true |
| disabled | 禁用 | boolean | false |
| className | 选择器 className | string | '' |
| style | 自定义输入框样式 | object | {} |
| popupStyle | 格外的弹出日历样式 | object | {} |
| size | 输入框大小,`large` 高度为 32px`small` 为 22px默认是 28px | string | 无 |
| locale | 国际化配置 | object | [默认配置](https://github.com/ant-design/ant-design/blob/master/components/date-picker/locale/example.json) |
| disabledDate | 不可选择的日期 | (currentDate: moment) => boolean | 无 |
| 参数 | 说明 | 类型 | 默认值 |
| --- | --- | --- | --- |
| allowClear | 是否显示清除按钮 | boolean | true |
| className | 选择器 className | string | '' |
| disabled | 禁用 | boolean | false |
| disabledDate | 不可选择的日期 | (currentDate: moment) => boolean | 无 |
| getCalendarContainer | 定义浮层的容器,默认为 body 上新建 div | function(trigger) | 无 |
| locale | 国际化配置 | object | [默认配置](https://github.com/ant-design/ant-design/blob/master/components/date-picker/locale/example.json) |
| open | 控制弹层是否展开 | boolean | - |
| onOpenChange | 弹出日历和关闭日历的回调 | function(status) | |
| placeholder | 输入框提示文字 | string\|RangePicker[] | - |
| placeholder | 输入框提示文字 | string\|RangePicker\[] | - |
| popupStyle | 格外的弹出日历样式 | object | {} |
| size | 输入框大小,`large` 高度为 32px`small` 为 22px默认是 28px | string | 无 |
| style | 自定义输入框样式 | object | {} |
| onOpenChange | 弹出日历和关闭日历的回调 | function(status) | 无 |
### DatePicker
| 参数 | 说明 | 类型 | 默认值 |
|--------------|----------------|----------|--------------|
| value | 日期 | [moment](http://momentjs.com/) | 无 |
| defaultValue | 默认日期 | [moment](http://momentjs.com/) | 无 |
| format | 展示的日期格式,配置参考 [moment.js](http://momentjs.com/) | string | "YYYY-MM-DD" |
| onChange | 时间发生变化的回调 | function(date: moment, dateString: string) | 无 |
| showTime | 增加时间选择功能 | Object\|boolean | [TimePicker Options](/components/time-picker/#API) |
| showTime.defaultValue | 设置用户选择日期时默认的时分秒,[例子](https://ant.design/components/date-picker/#components-date-picker-demo-disabled-date) | [moment](http://momentjs.com/) | moment() |
| showToday | 是否展示“今天”按钮 | boolean | true |
| 参数 | 说明 | 类型 | 默认值 |
| --- | --- | --- | --- |
| defaultValue | 默认日期 | [moment](http://momentjs.com/) | 无 |
| disabledTime | 不可选择的时间 | function(date) | 无 |
| onOk | 点击确定按钮的回调 | function() | - |
| format | 展示的日期格式,配置参考 [moment.js](http://momentjs.com/) | string | "YYYY-MM-DD" |
| renderExtraFooter | 在面板中添加额外的页脚 | () => React.ReactNode | - |
| showTime | 增加时间选择功能 | Object\|boolean | [TimePicker Options](/components/time-picker/#API) |
| showTime.defaultValue | 设置用户选择日期时默认的时分秒,[例子](https://ant.design/components/date-picker/#components-date-picker-demo-disabled-date) | [moment](http://momentjs.com/) | moment() |
| showToday | 是否展示“今天”按钮 | boolean | true |
| value | 日期 | [moment](http://momentjs.com/) | 无 |
| onChange | 时间发生变化的回调 | function(date: moment, dateString: string) | 无 |
| onOk | 点击确定按钮的回调 | function() | - |
### MonthPicker
| 参数 | 说明 | 类型 | 默认值 |
|--------------|----------------|----------|--------------|
| value | 日期 | [moment](http://momentjs.com/) | 无 |
| defaultValue | 默认日期 | [moment](http://momentjs.com/) | 无 |
| format | 展示的日期格式,配置参考 [moment.js](http://momentjs.com/) | string | "YYYY-MM" |
| onChange | 时间发生变化的回调,发生在用户选择时间时 | function(date: moment, dateString: string) | - |
| 参数 | 说明 | 类型 | 默认值 |
| --- | --- | --- | --- |
| defaultValue | 默认日期 | [moment](http://momentjs.com/) | 无 |
| format | 展示的日期格式,配置参考 [moment.js](http://momentjs.com/) | string | "YYYY-MM" |
| monthCellContentRender | 自定义的月份内容渲染方法 | function(date, locale): ReactNode | - |
| value | 日期 | [moment](http://momentjs.com/) | 无 |
| onChange | 时间发生变化的回调,发生在用户选择时间时 | function(date: moment, dateString: string) | - |
### RangePicker
| 参数 | 说明 | 类型 | 默认值 |
|--------------|----------------|----------|--------------|
| value | 日期 | [moment](http://momentjs.com/)[] | 无 |
| defaultValue | 默认日期 | [moment](http://momentjs.com/)[] | 无 |
| format | 展示的日期格式 | string | "YYYY-MM-DD HH:mm:ss" |
| onChange | 时间发生变化的回调,发生在用户选择时间时 | function(dates: [moment, moment], dateStrings: [string, string]) | 无 |
| showTime | 增加时间选择功能 | Object\|boolean | [TimePicker Options](/components/time-picker/#API) |
| showTime.defaultValue | 设置用户选择日期时默认的时分秒,[例子](https://ant.design/components/date-picker/#components-date-picker-demo-disabled-date) | [moment](http://momentjs.com/)[] | [moment(), moment()] |
| 参数 | 说明 | 类型 | 默认值 |
| --- | --- | --- | --- |
| defaultValue | 默认日期 | [moment](http://momentjs.com/)\[] | 无 |
| disabledTime | 不可选择的时间 | function(dates: [moment, moment], partial: `'start'|'end'`) | 无 |
| ranges       | 预设时间范围快捷选择 | { [range: string]: [moment](http://momentjs.com/)[] } | 无 |
| format | 展示的日期格式 | string | "YYYY-MM-DD HH:mm:ss" |
| ranges       | 预设时间范围快捷选择 | { [range: string]&#x3A; [moment](http://momentjs.com/)\[] } | 无 |
| renderExtraFooter | 在面板中添加额外的页脚 | () => React.ReactNode | - |
| showTime | 增加时间选择功能 | Object\|boolean | [TimePicker Options](/components/time-picker/#API) |
| showTime.defaultValue | 设置用户选择日期时默认的时分秒,[例子](https://ant.design/components/date-picker/#components-date-picker-demo-disabled-date) | [moment](http://momentjs.com/)\[] | [moment(), moment()] |
| value | 日期 | [moment](http://momentjs.com/)\[] | 无 |
| onChange | 时间发生变化的回调,发生在用户选择时间时 | function(dates: [moment, moment], dateStrings: [string, string]) | 无 |
| onOk | 点击确定按钮的回调 | function() | - |
<style>

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

@@ -17,11 +17,10 @@
.@{calendar-prefix-cls}-range-picker-separator {
color: @text-color-secondary;
position: absolute;
top: 50%;
margin-top: -10px;
line-height: 20px;
height: 20px;
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
@@ -175,15 +174,13 @@ exports[`renders ./components/dropdown/demo/sub-menu.md correctly 1`] = `
`;
exports[`renders ./components/dropdown/demo/trigger.md correctly 1`] = `
<div>
<a
class="ant-dropdown-link ant-dropdown-trigger"
href="#"
>
Click me
<i
class="anticon anticon-down"
/>
</a>
</div>
<a
class="ant-dropdown-link ant-dropdown-trigger"
href="#"
>
Click me
<i
class="anticon anticon-down"
/>
</a>
`;

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