Compare commits

..

822 Commits

Author SHA1 Message Date
afc163
bd8016f236 changelog for 2.2.1 2016-11-02 13:38:37 +08:00
afc163
137de1aebf Fix controlled DatePicker[showTime] not working, close #3665 2016-11-02 13:34:52 +08:00
Benjy Cui
463b9800a4 fix: should check undefined value, close: #3665 2016-11-02 13:34:42 +08:00
Benjy Cui
3ea914721d bump 2.2.0 2016-10-28 18:31:44 +08:00
Benjy Cui
0a962b19ad docs: add change log for 2.2.0 (#3640) 2016-10-28 18:30:17 +08:00
afc163
3add760d42 Merge branch 'master' of github.com:ant-design/ant-design 2016-10-28 18:15:01 +08:00
afc163
c05df5ffd1 Add some new icons 2016-10-28 17:54:22 +08:00
afc163
393e51cab6 Add hover style for Slider handler 2016-10-28 17:42:33 +08:00
偏右
836a058c57 Update ISSUE_TEMPLATE.md 2016-10-28 16:49:36 +08:00
afc163
842b6636a3 support Alert[style] and Alert[className] 2016-10-28 16:42:26 +08:00
Benjy Cui
a3ec948dcd css: the style should follow design 2016-10-28 15:18:29 +08:00
Benjy Cui
d70ff98f9f fix: large size should be set by JS, not CSS, close: #3630 2016-10-28 14:25:09 +08:00
Benjy Cui
6bd75f2666 fix: dropdown menu should not show while disabled, close: #3535 2016-10-28 14:07:46 +08:00
Wei Zhu
f8d2aeefc3 refactor: Replace react-addons-pure-render-mixin with rc-util/lib/PureRenderMixin (#3627) 2016-10-28 13:56:23 +08:00
Benjy Cui
52e3511192 docs: add demo for using time-related in form, close: #3610 2016-10-28 11:30:25 +08:00
ddcat1115
9d218860b5 修复firefox下无数据且固定表头时ant-table-body占高度的问题 (#3632) 2016-10-28 11:14:37 +08:00
Wei Zhu
d3bb55b825 Merge pull request #3628 from ant-design/feat-allowClear
feat: add DatePicker[allowClear], close: #3618
2016-10-28 10:59:07 +08:00
Benjy Cui
d57827f87c fix: empty string should be treat as inexisting, close: #3613 2016-10-28 10:50:55 +08:00
Benjy Cui
eeb6ab5a01 docs: update docs for DatePicker and so on 2016-10-28 10:32:09 +08:00
Benjy Cui
f7e480ad53 feat: add DatePicker[allowClear], close: #3618 2016-10-28 10:10:02 +08:00
偏右
b240494dd5 typo 2016-10-27 21:20:28 +08:00
Benjy Cui
55e9e83be0 Revert "feat: 给message组件添加stack全局配置 #3543 (#3548)"
This reverts commit 818deacfee.
2016-10-27 17:39:46 +08:00
Benjy Cui
ca2e9c6dc2 Revert "fix: should cache correctly"
This reverts commit 75423ed4b1.
2016-10-27 17:39:28 +08:00
Benjy Cui
7860d74725 docs: update advance search form demo, ref: #3558 2016-10-27 17:14:53 +08:00
偏右
0e3d40e6d9 Update ISSUE_TEMPLATE.md 2016-10-27 13:17:09 +08:00
Benjy Cui
55c22a7232 fix: style bug in slider 2016-10-27 11:57:46 +08:00
Benjy Cui
835dc2fb52 docs: update form in modal demo, ref: #3594 2016-10-27 11:44:45 +08:00
afc163
2026449976 fix some props missing documentation 2016-10-27 11:10:19 +08:00
Benjy Cui
6bf99c1819 docs: update advanced search demo, ref: #3594 2016-10-27 10:26:12 +08:00
Benjy Cui
6cd841ef31 docs: add demo for registration, ref: #3594 2016-10-27 09:45:53 +08:00
feng zhi hao
90fbd4da51 types: add datasource generics type in Table (#3603) 2016-10-26 18:26:26 +08:00
Wei Zhu
a62c958a15 Hide inactive pane by set opacity to 0, fix #3304 (#3604) 2016-10-26 18:24:53 +08:00
Benjy Cui
7b76906924 docs: add normal login form, ref: #3594 2016-10-26 17:15:30 +08:00
Benjy Cui
3c49a90980 docs: update demo, ref: #3594 2016-10-26 16:42:57 +08:00
afc163
0f503101af Merge branch 'master' of github.com:ant-design/ant-design 2016-10-26 16:27:58 +08:00
afc163
527949df04 Fix Button and Input vertical-align bug 2016-10-26 16:27:01 +08:00
Benjy Cui
f599a24228 docs: update demo style 2016-10-26 15:33:45 +08:00
afc163
55efef3220 Add Icon[type="bulb"] 2016-10-26 14:26:57 +08:00
Benjy Cui
75423ed4b1 fix: should cache correctly 2016-10-26 11:05:00 +08:00
yeliex
818deacfee feat: 给message组件添加stack全局配置 #3543 (#3548) 2016-10-26 09:33:44 +08:00
Benjy Cui
fed19bbcb5 fix: TimePicker[format] should have default value 2016-10-26 09:25:42 +08:00
Marius Ileana
84c4139023 table / index.en-US.md - small updates (#3584)
small typo and updates
2016-10-25 21:10:31 +08:00
陆离
d051d94af4 feat: RangePicker disabledTime (#3568)
* RangePicker disabledTime

* update API document of RangePicker
2016-10-25 17:39:17 +08:00
Benjy Cui
a3388aa840 chore: upgrade node version in CI 2016-10-25 14:45:23 +08:00
Cody Chan
9d2b48b511 docs: Fix 404 error (#3552) 2016-10-24 18:42:18 +08:00
Benjy Cui
b8fb60079c test: fix test case 2016-10-24 17:02:03 +08:00
Benjy Cui
e9111a855f refactor: remove propTypes in private components 2016-10-24 16:51:53 +08:00
Benjy Cui
08e21e0a2f refactor: close: #3490 2016-10-24 16:30:38 +08:00
Benjy Cui
4878258f6c refactor: ref: #3490 2016-10-24 12:04:26 +08:00
afc163
1da5490ab8 Fix badge initial position jump bug 2016-10-24 11:48:25 +08:00
afc163
ba227bbe54 fix Select[onSearch] overflow scroll 2016-10-24 11:34:50 +08:00
afc163
12e1735255 fix badge[style] 2016-10-24 11:34:12 +08:00
afc163
84b70ac140 fix key={0} in demo, close #3546 2016-10-24 11:06:31 +08:00
afc163
8a7d59241d Merge branch 'master' of github.com:ant-design/ant-design 2016-10-22 17:35:40 +08:00
afc163
831533d139 update doc 2016-10-22 17:29:00 +08:00
ddcat1115
23331e8594 Menu 样式调整 (#3533) 2016-10-22 13:30:59 +08:00
afc163
915f343de3 update select check style 2016-10-21 20:21:40 +08:00
afc163
49256c59c9 Merge branch 'master' of github.com:ant-design/ant-design 2016-10-21 20:20:03 +08:00
afc163
3bb4b6ea7c fix icon spin style, close #3536 2016-10-21 20:18:47 +08:00
Benjy Cui
66f6de79ce refactor: Alert, Backtop, AutoComplete 2016-10-21 18:02:37 +08:00
Benjy Cui
8268bfdd9e refactor: udpate Affix to work with strictNullCheck 2016-10-21 17:44:34 +08:00
Benjy Cui
0c848a5cd2 style: make clickable larger to improve UX 2016-10-21 16:46:30 +08:00
feng zhi hao
0257e02e65 optimize declaration (#3531) 2016-10-21 16:27:26 +08:00
afc163
355f82231c fix select style 2016-10-21 15:36:07 +08:00
Benjy Cui
6343e6b763 docs: update demo 2016-10-21 15:18:13 +08:00
Benjy Cui
1ed434a695 fix: should support Input[addon] in Form[inline], close: #3524 2016-10-21 15:04:55 +08:00
afc163
af3c1aac96 update switch animation ease 2016-10-21 13:09:29 +08:00
afc163
7a115c6c4b fix switch line-height 2016-10-21 12:22:20 +08:00
afc163
9e322ea445 remove unused demo 2016-10-21 12:20:14 +08:00
afc163
1700ae6078 better way to fix #3523 2016-10-21 12:19:34 +08:00
afc163
1be129fa50 Merge branch 'master' of github.com:ant-design/ant-design 2016-10-21 11:46:12 +08:00
afc163
a0c96783c0 fix DatePicker align 2016-10-21 11:45:57 +08:00
Benjy Cui
0aca663092 fix: should throw warning only once, ref: #3491 2016-10-21 11:17:59 +08:00
ddcat1115
7483254df6 Switch 宽度自适应 inner 内容 (#3516) 2016-10-21 11:09:24 +08:00
afc163
ea6a84d9cf fix DatePicker[showTime] onChange, close #3523 2016-10-20 22:11:55 +08:00
afc163
1e5264bad7 fix tslint 2016-10-20 22:10:46 +08:00
afc163
f262f1ab99 update CHANGELOG 2016-10-20 21:43:44 +08:00
afc163
d12cb17804 Fix broken TreeSelect[showSearch] style, close #3520 2016-10-20 21:28:50 +08:00
afc163
4fe28ec298 fix markdown style 2016-10-20 21:00:36 +08:00
yiminghe
9178108906 optimize d.ts 2016-10-20 20:12:46 +08:00
yiminghe
c2d3f16dfb update tslint 2016-10-20 19:19:16 +08:00
Benjy Cui
3112b0d7ca site: support debug mode for demo, close: #3506 2016-10-20 17:45:38 +08:00
Benjy Cui
d5edcb9ef0 feat: support deep-level form control, close: #3212 (#3491) 2016-10-20 16:24:48 +08:00
Benjy Cui
a9fff1be5b docs: update links 2016-10-20 14:49:51 +08:00
Benjy Cui
5d4d9f5cea style: update code style 2016-10-20 14:48:13 +08:00
afc163
97bc13426f fix overflow selected value in Select (#3481) 2016-10-20 14:18:07 +08:00
陆离
05c6d09eab docs: add controllerd sample (#3504)
* add controllerd sample

* lint
2016-10-20 13:51:44 +08:00
afc163
58d98a7802 add Cascader[getPopupContainer] to document, #1503 2016-10-20 12:18:53 +08:00
afc163
7a6b21d02b Merge branch 'master' of github.com:ant-design/ant-design 2016-10-20 12:04:53 +08:00
afc163
d38c5a43da fix about #3481 2016-10-20 11:59:38 +08:00
Benjy Cui
dc78317688 docs: update docs of table, close: #3469 2016-10-20 11:33:53 +08:00
Benjy Cui
3c99097bc8 fix: allow override fileNameProp, close: #3497 2016-10-20 11:28:05 +08:00
afc163
2482b4b760 not limit min-width of Popover without title 2016-10-20 11:23:30 +08:00
afc163
0b29ee6fee continue fix for #3481, also fix multiple select large and small size style 2016-10-19 20:32:14 +08:00
yiminghe
8afe3965c1 upgrade ts 2.0 2016-10-19 17:52:23 +08:00
Benjy Cui
5179ffbbe1 site: support demo[only] 2016-10-19 17:39:25 +08:00
afc163
140997b033 Merge branch 'master' of github.com:ant-design/ant-design 2016-10-19 14:28:38 +08:00
afc163
ff5d9f6029 Fix select vertical-align and refactor its style, close #3481 2016-10-19 14:27:38 +08:00
zilong
6ceef46129 docs: update doc for Table (#3483)
* update Table en doc: fix header content mismatched

* update doc for Table: add description for props related to expand behavior
2016-10-19 14:06:36 +08:00
Benjy Cui
f747f10676 docs: update link and add tags 2016-10-19 14:04:46 +08:00
Benjy Cui
f8b46ad06a docs: update recommended way to ask questions, close: #2320 2016-10-19 12:19:30 +08:00
afc163
9fe859a31f typo #3473 2016-10-19 11:29:14 +08:00
Benjy Cui
39cf0899f5 fix: DatePicker should be vertical-align: middle, close: #3481 2016-10-19 11:22:10 +08:00
Benjy Cui
f52dcbfb37 chore: add warning for invalid usage, close: #3475 2016-10-19 09:45:46 +08:00
afc163
be02817433 fix RadioButton style inside FormItem 2016-10-18 22:26:57 +08:00
afc163
55c2223366 update form docs, #3473 2016-10-18 21:12:52 +08:00
afc163
a223c7bdba Merge branch 'master' of github.com:ant-design/ant-design 2016-10-18 18:20:11 +08:00
afc163
d0a6fa47a9 Fix cascader defaultValue typo, close #3470 2016-10-18 18:19:13 +08:00
afc163
6f8f7de69e update code style 2016-10-18 18:10:41 +08:00
feng zhi hao
6bcd489c50 chore: optimize DatePicker`s declaration (#3468) 2016-10-18 15:20:26 +08:00
Benjy Cui
9ac21d010b docs: add demo for show image in-place, close: #3319 2016-10-18 15:16:25 +08:00
yiminghe
58e0228e86 optimize getFieldProps warning 2016-10-18 12:22:26 +08:00
Benjy Cui
13d48aa1e5 site: show locale in url, close: #3456 2016-10-18 12:04:09 +08:00
Albert Zheng
23dd825afd 【Please review】Fixes for supporting TypeScript 2.0.3 (#3439)
* Fixes for supporting TypeScript 2.0.3

* Fixes for supporting TypeScript 2.0.3. Issue is #3358
2016-10-18 11:55:00 +08:00
Benjy Cui
c082e1b1d1 site: extract common code as utility function 2016-10-18 11:18:25 +08:00
kvetoslavnovak
9ed9fb053a docs: Transfer - heading not wide enough for English (#3466) 2016-10-18 09:45:37 +08:00
afc163
2fe4590887 update site markdown style 2016-10-18 00:18:03 +08:00
afc163
512796b7fe update table demo doc 2016-10-17 20:52:27 +08:00
afc163
806df6e912 update table fixed demos 2016-10-17 20:43:00 +08:00
C
b38d1afe5f Update package.json (#3454) 2016-10-17 11:53:49 +08:00
Benjy Cui
71772260da docs: add link for dora 2016-10-17 09:42:21 +08:00
Benjy Cui
62d2687d6d docs: update README to review easier 2016-10-17 09:37:55 +08:00
Peter Dave Hello
2a12545694 docs: Add CDNJS version badge in readme (#3447) 2016-10-17 09:34:36 +08:00
edgji
6851c8ce3e deps: update rc-upload to latest (#3450) 2016-10-17 09:33:02 +08:00
afc163
0920efb87f update changelog 2016-10-16 16:21:56 +08:00
Benjy Cui
bf1241d793 bump 2.1.0 2016-10-16 16:16:33 +08:00
kvetoslavnovak
91f0923ee9 Typo, references (#3444) 2016-10-16 14:18:45 +08:00
afc163
c14030869a Improve doc about compatibility 2016-10-15 17:26:39 +08:00
afc163
8165ae6dee Merge branch 'master' of github.com:ant-design/ant-design 2016-10-15 17:08:28 +08:00
afc163
6900c556b1 refactor build webpack config file 2016-10-15 17:04:30 +08:00
kvetoslavnovak
63948af275 Rate demo - Eng. translation correction (#3440) 2016-10-15 15:54:59 +08:00
afc163
db4e50308f fix demo typo 2016-10-15 15:34:09 +08:00
Wei Zhu
0e013fe485 Set height of inavtive TabPane to zero fix #3377 (#3437) 2016-10-15 15:33:41 +08:00
afc163
38cec5fd11 Fix TreeSelect placeholder not work in demo, close #3433
不用写到 changelog 里,只是 demo 的问题
2016-10-15 15:28:55 +08:00
afc163
3169d45246 change demos order 2016-10-14 21:45:48 +08:00
afc163
e520998166 Fix popover card arrow border 2016-10-14 21:43:59 +08:00
kayw
b2734eda66 fix: direct use "dist/antd" cause server rendering error (#3436) 2016-10-14 20:21:46 +08:00
afc163
0982e8999c update changelog for 2.0 2016-10-14 18:48:19 +08:00
afc163
316958d8b0 Merge branch 'master' of github.com:ant-design/ant-design 2016-10-14 16:17:40 +08:00
afc163
4ef54a6edb adjust tree style 2016-10-14 16:17:26 +08:00
Benjy Cui
8008447846 docs: add change log for 2.1.0 (#3427) 2016-10-14 15:53:49 +08:00
afc163
c196f37239 patch for fixing #3413 2016-10-14 15:47:08 +08:00
afc163
d92a24d477 Improve overlay border design 2016-10-14 15:40:39 +08:00
Wei Zhu
6c0c495177 fix: backTop target (#3399)
fix: BackTop target
2016-10-14 15:26:22 +08:00
xiaofan2406
10afe1372f flexible Card title wrapper (#3416) 2016-10-14 14:41:21 +08:00
afc163
98c15a5113 update changelog 2016-10-14 12:10:14 +08:00
afc163
c4665a78e2 remove strange margin-right of DatePicker confirm button in safari 2016-10-14 11:39:21 +08:00
afc163
ea6537b47a improve select doc 2016-10-14 11:31:24 +08:00
afc163
953538d4e9 Merge branch 'master' of github.com:ant-design/ant-design 2016-10-14 11:30:09 +08:00
afc163
00dd1d5f07 improve select doc 2016-10-14 11:29:45 +08:00
Benjy Cui
9e61fdd5d1 site: document title should be localized, close: #3424 2016-10-14 09:55:12 +08:00
Benjy Cui
8eb2eaf288 docs: update change log, ref: #3423 2016-10-14 09:17:55 +08:00
偏右
62a53e75b8 refactor: Downsize some style code (#3421)
* remove fieldset disabled style

* improve button style mixins
2016-10-14 09:12:10 +08:00
afc163
28765d4811 Fix large and small button's border-radius less vars 2016-10-13 21:12:05 +08:00
zuiidea
c86a6d0f50 Update CHANGELOG.zh-CN.md (#3423)
新增 2.x 不兼容改动,”Popover 移除 overlay ,请使用 content。“
2016-10-13 20:19:58 +08:00
Benjy Cui
e7e22602ef docs: update change log 2016-10-13 18:04:21 +08:00
Benjy Cui
d0d7a04b18 docs: update change log, close: #3347 2016-10-13 17:53:10 +08:00
Benjy Cui
40ea091a97 site: fix re-render for live demo, close: #3333 2016-10-13 16:52:24 +08:00
偏右
4f77a2e5f5 Fix back top ssr (#3418)
* improve code style

* move getRequestAnimationFrame to util

* Fix ssr problem in BackTop, close #3343
2016-10-13 16:26:15 +08:00
Benjy Cui
0981dd46c7 fix: should not import less file firectly 2016-10-13 16:19:16 +08:00
Wei Zhu
26921cf234 fix: Pass format to Calendar (#3407) 2016-10-13 16:13:05 +08:00
afc163
d217c72529 Fix Select onSearch width style bug, close #3413 2016-10-13 15:54:25 +08:00
陆离
24a68a8961 fix again: Datepicker 触发两次 onChange (#3417)
* fix again

* fix lint
2016-10-13 14:48:09 +08:00
kvetoslavnovak
f3cbbc02e9 Site introduction page in line with GitHub one (#3404) 2016-10-13 12:27:29 +08:00
afc163
6dd222a8a4 Refactor code of status Badge 2016-10-12 19:42:10 +08:00
afc163
a11206f7ad Merge branch 'master' of github.com:ant-design/ant-design 2016-10-12 11:50:53 +08:00
afc163
4936bc3735 close autoComplete in Cascader, close #3350 2016-10-12 11:49:55 +08:00
陆离
2232c6b647 fix (#3391) 2016-10-12 11:47:34 +08:00
afc163
b5446d632a Remove wrong dropdownStyle imported by #3344, close #3386 2016-10-12 11:19:01 +08:00
kvetoslavnovak
c9258fc483 Form controls - Eng. correction (#3381) 2016-10-12 11:04:59 +08:00
kvetoslavnovak
1dad6653c4 Mix - Eng. correction (#3382) 2016-10-12 11:04:52 +08:00
kvetoslavnovak
0eb080bf49 Select Basic usage - Eng. correction (#3383) 2016-10-12 11:04:45 +08:00
kvetoslavnovak
b700e7ea06 Three Select - Eng. correction (#3384) 2016-10-12 11:04:40 +08:00
kvetoslavnovak
ef2c2b114e Select Option Group - Eng. correction (#3385) 2016-10-12 11:04:32 +08:00
kvetoslavnovak
125331a023 Form validation - Translazion correction (#3387) 2016-10-12 11:03:49 +08:00
afc163
741eb732f0 fix lesshint 2016-10-11 20:00:25 +08:00
afc163
889548b1b6 Add shadow to Modal 2016-10-11 19:59:52 +08:00
afc163
e0a986ed71 Update upload document 2016-10-11 15:23:18 +08:00
kvetoslavnovak
38962e19f2 Code example radio style - English translation (#3367)
Residual translation
2016-10-11 11:03:22 +08:00
afc163
d409065319 Merge branch 'master' of github.com:ant-design/ant-design 2016-10-10 22:51:31 +08:00
afc163
7b42951f37 update demo style 2016-10-10 22:51:03 +08:00
feng zhi hao
4b9db4ff87 improve props interface in InputNumber and Table (#3360) 2016-10-10 22:38:47 +08:00
kvetoslavnovak
7a33a66f50 Manual import of style - Use modularized antd (#3342)
As mentioned in antd FAQ https://github.com/ant-design/ant-design/wiki/FAQ#i-just-want-to-use-menubuttonetc-but-it-seems-that-i-have-to-import-the-whole-antd-and-its-style
2016-10-10 22:38:39 +08:00
kvetoslavnovak
4ade308737 Menu theme demo switch style, closes #3327 (#3341) 2016-10-10 22:38:20 +08:00
ddcat1115
c6e1d6febc 修复Table 带边框相关的样式问题 (#3340)
close #3301
2016-10-10 22:38:15 +08:00
偏右
8bf99b7773 Fix Upload onRemove and style (#3331)
* fix onRemove prevent origin behavious, close #3317

* remove onPreview if

* improve upload render props code style

* Fix upload trigger click area, close #3316
2016-10-10 22:38:11 +08:00
afc163
0f81470b49 import site version redirect 2016-10-10 21:04:20 +08:00
afc163
193cc3fa17 fix demo style 2016-10-10 20:56:17 +08:00
afc163
aa6d86c9ed Merge branch 'master' of github.com:ant-design/ant-design 2016-10-10 19:41:49 +08:00
afc163
0d8267c71c fix lint 2016-10-10 19:40:53 +08:00
Catalin Miron
0b38ced351 Update card-top (#3356)
Fix typo
2016-10-10 16:21:41 +08:00
Catalin Miron
114d78a1a6 Update card.md (#3355)
Fix typo
2016-10-10 16:21:04 +08:00
afc163
3ac6532577 Fix Select notFoundContent
close #3345

also close #3344
2016-10-09 22:55:50 +08:00
afc163
bd952af661 fix lint 2016-10-09 22:55:20 +08:00
afc163
07ee1fd734 Merge branch 'master' of github.com:ant-design/ant-design 2016-10-09 17:46:58 +08:00
afc163
11cff6aec6 fix site 2016-10-09 17:46:40 +08:00
Benjy Cui
dd844b0347 feat: supports Tabs[animated], close: #3324 (#3326) 2016-10-09 14:26:41 +08:00
Junyu Zhan
4e8ba65828 Fix a typo (#3334)
just to get myself into the contributor list
2016-10-09 10:56:02 +08:00
afc163
e6900ec0ec Merge branch 'master' of github.com:ant-design/ant-design 2016-10-08 16:13:31 +08:00
afc163
d063ed4dca not leave require locale in dist files, close #3204 2016-10-08 16:12:19 +08:00
kvetoslavnovak
7156956685 Table - basic - English translation (#3325)
* Table - basic - English translation

Correction, to same as in line with other examplets

* Update basic.md

* Update basic.md
2016-10-08 15:45:42 +08:00
Benjy Cui
358308ce87 docs: fix docs 2016-10-08 15:20:37 +08:00
偏右
795df0ea96 feat: Add icon[spin], close #2363 (#3322) 2016-10-08 15:09:56 +08:00
kvetoslavnovak
2aba5ea582 docs: Transfer[title] should follow LocaleProvider (#3264)
* Transfer - lists labels - English Translation

* Update index.en-US.md

* Update index.en-US.md

* Update index.en-US.md
2016-10-08 15:05:07 +08:00
kvetoslavnovak
cc6946b714 Pagination - Total - English correction (#3286)
* Pagination - Total - English correction

* Update total.md
2016-10-08 11:45:39 +08:00
陆离
1ad99cb095 feat: Exposing onSelect API of AutoComplete Component (#3320) 2016-10-08 11:20:53 +08:00
Benjy Cui
a987e34f6f fix: Transfer[title] should follow LocaleProvider, ref: #3264 (#3318) 2016-10-08 10:42:13 +08:00
kvetoslavnovak
73bf9fc327 docs: Pagination - Mini size - English correction (#3287)
* Pagination - Mini size - English correction

* Update mini.md
2016-10-08 08:49:08 +08:00
afc163
e74b4699e0 Merge branch 'master' of github.com:ant-design/ant-design 2016-10-07 21:10:47 +08:00
afc163
81410f5b0c update doc links 2016-10-07 21:10:05 +08:00
afc163
950c641016 adjust site style 2016-10-07 20:41:51 +08:00
Benjy Cui
6efadb7988 docs: update docs for AutoComplete, ref: #3295 2016-10-07 20:22:46 +08:00
afc163
dccc4ced95 Export @animation-duration-* to default theme 2016-10-07 18:29:55 +08:00
afc163
fc52934c12 Faster animation for Tooltip 2016-10-07 18:18:23 +08:00
afc163
66891a7cc0 update demo text 2016-10-07 18:00:48 +08:00
afc163
6edac76abb prolong delay animation click time 2016-10-07 18:00:40 +08:00
afc163
2969f9d1e5 Improve confirm Modal style detail 2016-10-07 17:59:00 +08:00
afc163
1566011720 continue to fix #3312 & #3307 2016-10-07 16:04:11 +08:00
afc163
f1d0223b66 Fix conflict less var, fix #3312 2016-10-07 15:41:11 +08:00
afc163
c5d221e55a Simplify TimePicker english placeholder 2016-10-07 15:38:33 +08:00
afc163
1ddc4371eb fix typo 2016-10-07 15:33:04 +08:00
afc163
36058f7173 Fix arrowPointAtCenter not work in Popconfirm 2016-10-07 15:30:05 +08:00
afc163
6df2100a5c update some demos 2016-10-07 15:20:10 +08:00
afc163
d940bd9567 Move Popover less variables to theme/default.less 2016-10-07 14:56:11 +08:00
afc163
8dcb9b6a22 Adjust Tooltip less variables 2016-10-07 14:50:53 +08:00
afc163
fd76b0cc6c fix long label overflow style 2016-10-07 14:34:25 +08:00
afc163
847e40eac0 Adjust site layout 2016-10-07 14:33:08 +08:00
afc163
f39687d69a Merge branch 'master' of github.com:ant-design/ant-design 2016-10-07 00:40:49 +08:00
afc163
f15d62e189 adjust transfer button style 2016-10-06 19:10:01 +08:00
kvetoslavnovak
dded174ece Tabs - Card - Typo correction (#3289) 2016-10-06 18:57:40 +08:00
kvetoslavnovak
fc0b8e5431 Tabs - Custom Trigger - Typo correction (#3290) 2016-10-06 18:57:34 +08:00
kvetoslavnovak
70fa956301 Tabs - Container of Card - Typo trigger (#3291) 2016-10-06 18:57:25 +08:00
kvetoslavnovak
e5fab55d6b Tabs - Basic - Typo correction (#3292) 2016-10-06 18:56:57 +08:00
afc163
20a310aa07 Merge branch 'master' of github.com:ant-design/ant-design 2016-10-06 18:54:50 +08:00
afc163
58d7741709 http => https, close #3303 2016-10-06 18:54:28 +08:00
afc163
1ef72deadb update Changelog 2016-10-06 18:50:17 +08:00
Danny Hoower Antonio Viasus Avila
502d0f4f29 Adding Spanish Support - LocaleProvider - Spanish Translation (#3285)
* Spanish support Intld

* Update es_ES.js
2016-10-06 18:00:35 +08:00
Andrey G
5982aacacb Update ru_RU.tsx (#3306) 2016-10-06 11:39:56 +08:00
Benjy Cui
64079f181a docs: update demos text 2016-10-02 08:55:40 +08:00
kvetoslavnovak
b3729806ef docs: Table - Fixed header - English Translation (#3278) 2016-10-02 08:47:42 +08:00
kvetoslavnovak
e1b1f7f374 docs: Calendar - Demo of notice - English Translation (#3266) 2016-10-02 08:47:34 +08:00
kvetoslavnovak
c2fb8f30a1 docs: Table - ajax - English Translation (#3270) 2016-10-02 08:47:13 +08:00
kvetoslavnovak
8128a94b71 docs: Table - Fixed Columns and Header - English Trans. (#3280) 2016-10-02 08:46:19 +08:00
kvetoslavnovak
d3667b8a58 docs: Table - Selection&operation - English Translation (#3267)
* Table - Selection&operation - English Translation

* Table - Selection&operation - English Translation

* Update row-selection-and-operation.md

* Update row-selection-and-operation.md
2016-10-02 08:41:53 +08:00
kvetoslavnovak
1ff8a020d1 docs: Table - Pagination - English Translation (#3268) 2016-10-02 08:41:41 +08:00
kvetoslavnovak
bf105e64c9 docs: Calendar Custom Render - English Translation (#3265) 2016-10-02 08:40:34 +08:00
kvetoslavnovak
e76f604e25 docs: Table - Filter and sorter - English Translation (#3269) 2016-10-02 08:39:23 +08:00
kvetoslavnovak
a7b9266e10 docs: Table - size - English Translation (#3272) 2016-10-02 08:38:54 +08:00
kvetoslavnovak
27a53b5c6c docs: Table - No pagination - English Translation (#3271) 2016-10-02 08:38:34 +08:00
kvetoslavnovak
142227d3fa docs: Table - border, title and footer - English Trans. (#3273) 2016-10-02 08:38:16 +08:00
kvetoslavnovak
c0ee38b173 docs: Table - Expandable Row - English Translation (#3274) 2016-10-02 08:37:51 +08:00
kvetoslavnovak
5373f52d27 docs: Table - Loading - English Translation (#3276) 2016-10-02 08:37:14 +08:00
kvetoslavnovak
2e4e159ed8 docs: Table - colSpan and rowSpan - English Translation (#3275) 2016-10-02 08:36:10 +08:00
kvetoslavnovak
e246b99849 docs: Table - Tree data - English Translation (#3277) 2016-10-02 08:35:06 +08:00
kvetoslavnovak
54994bf136 docs: Table - Fixed columns - English Translation (#3279) 2016-10-02 08:32:27 +08:00
kvetoslavnovak
74ae8f4283 docs: Table - Grouping table head - English Translation (#3281)
* Table - Grouping table head - English Translation

* Update grouping-columns.md
2016-10-02 08:32:04 +08:00
Benjy Cui
61910bc2cb fix: SSR for Affix and BackTop, close: #3283 2016-10-02 08:21:10 +08:00
Benjy Cui
cd84cee399 docs: fix update publish date 2016-10-01 08:34:00 +08:00
Benjy Cui
d9e6e5bc15 bump 2.0.1 2016-10-01 08:29:06 +08:00
Benjy Cui
27649dd8d8 fix: should generate style/css for LocaleProvider, close: #3255 2016-10-01 08:27:07 +08:00
kvetoslavnovak
bfb063e525 docs: Timeline Custom - English Translation (#3263) 2016-10-01 08:04:27 +08:00
kvetoslavnovak
a3fb631ece docs: Timeline Last node - English Translation (#3262) 2016-10-01 08:04:13 +08:00
kvetoslavnovak
79f2829584 docs: Timeline Color - English Translation (#3261) 2016-10-01 08:03:50 +08:00
kvetoslavnovak
7e4efe57b9 docs: Timeline Basic - English Translation (#3260) 2016-10-01 08:03:36 +08:00
kvetoslavnovak
e9ba1e83c7 docs: Table Basic usage - English Translation (#3256) 2016-10-01 08:03:20 +08:00
kvetoslavnovak
7a40f8f200 docs: Table selection - English Translation (#3257) 2016-10-01 08:02:18 +08:00
kvetoslavnovak
5d914d6ba3 docs: Reset filters and sorters - English Translation (#3259) 2016-10-01 08:02:01 +08:00
kvetoslavnovak
94f2d08978 docs: Table Checkbox props - English Translation (#3258) 2016-10-01 08:01:18 +08:00
Benjy Cui
2ddc2fc583 docs: add change log for 2.0.1 (#3254) 2016-10-01 00:17:35 +08:00
Benjy Cui
5705f72fb8 fix: make sure en|ru locale import after zh-CN (#3246)
* fix: make sure en|ru locale import after zh-CN

* refactor: simplify code
2016-10-01 00:17:31 +08:00
Benjy Cui
e4ed800b61 docs: should not jump to other website 2016-09-30 18:13:22 +08:00
Benjy Cui
9c83538621 fix: should work with getFieldDecorator (#3251) 2016-09-30 17:45:58 +08:00
ddcat1115
96e71a4147 fix: 修复 Spin 垂直居中问题 close #3097 (#3214) 2016-09-30 17:44:55 +08:00
Benjy Cui
06e4eaa7d5 fix: progress demo and trailWidth 2016-09-30 15:21:03 +08:00
Shawn Sit
a932a4ac08 docs: translated controlled demo (#3220)
* translated controlled demo

* fixs: misspell &  shorter label
2016-09-30 14:56:53 +08:00
afc163
e555335568 Merge branch 'master' of github.com:ant-design/ant-design 2016-09-30 14:26:03 +08:00
afc163
36e50ed794 Improve Layout demo style
learn from https://www.iviewui.com/components/layout
2016-09-30 14:24:41 +08:00
Benjy Cui
9de4c7f436 site: remove italic to improve Chinese readability 2016-09-30 13:55:50 +08:00
afc163
73986289b7 Merge branch 'master' of github.com:ant-design/ant-design 2016-09-30 13:53:52 +08:00
Benjy Cui
1e0c034353 Fix cascader (#3243)
* docs: update demo

* fix: should show input value
2016-09-30 13:37:36 +08:00
Shawn Sit
4548b9521f update customized validation demo (#3242) 2016-09-30 12:11:13 +08:00
afc163
4284e77d29 fix docs/spec/layout document title 2016-09-30 11:51:36 +08:00
afc163
b63d620625 Merge branch 'master' of github.com:ant-design/ant-design 2016-09-30 11:31:40 +08:00
afc163
466aea3ea5 fix some components style detail 2016-09-30 11:30:51 +08:00
陆离
3513cf7a1f Mention fix (#3240)
* placeholder style fix

* add onSelect callback
2016-09-30 11:26:27 +08:00
Benjy Cui
0265cf0cb1 docs: update links 2016-09-30 10:34:27 +08:00
feng zhi hao
b501a79d91 docs: update README (#3238) 2016-09-30 09:51:55 +08:00
kvetoslavnovak
c8b741283e docs: Step Error status - Translation Correction (#3235) 2016-09-30 09:49:28 +08:00
kvetoslavnovak
2ecb039e09 docs: Step Vertical MiniVersion - Translation Correction (#3234) 2016-09-30 09:49:17 +08:00
kvetoslavnovak
b98b2d92bf docs: Step Vertical - Translation Correction (#3233) 2016-09-30 09:49:05 +08:00
kvetoslavnovak
fe59d8a7f3 docs: translation correction (#3232) 2016-09-30 09:48:54 +08:00
afc163
a0b5b3f346 Merge branch 'master' of github.com:ant-design/ant-design 2016-09-29 23:14:57 +08:00
afc163
4283fde035 update code collapse style 2016-09-29 23:14:19 +08:00
yiminghe
172142bcef Merge pull request #3203 from jinouwuque/master
add moment dependecy in the package.json
2016-09-29 20:38:19 +08:00
Benjy Cui
9685d06f45 fix: should test if window exist, close: #3216 2016-09-29 18:00:23 +08:00
Benjy Cui
1e65cac784 feat: Steps.Step[icon] support React.ReactNode, close: #3159 2016-09-29 16:12:43 +08:00
Benjy Cui
539bb33fe5 fix: should allow ref to react-slick, close: #3164 2016-09-29 15:50:45 +08:00
afc163
2519677daa Merge branch 'master' of github.com:ant-design/ant-design 2016-09-29 15:47:10 +08:00
afc163
c0b0d493de update site 2016-09-29 15:46:29 +08:00
Benjy Cui
a40a8e914f docs: add ref for upload, close: #3171 2016-09-29 15:37:32 +08:00
Benjy Cui
0c90e73fa8 fix: add missing domain.. 2016-09-29 15:11:59 +08:00
Benjy Cui
2d383067ce docs: should remove domain, close: #3215 2016-09-29 15:08:57 +08:00
afc163
6c7cce486b Merge branch 'master' of github.com:ant-design/ant-design 2016-09-29 14:47:35 +08:00
afc163
526c346fc0 update README 2016-09-29 14:42:38 +08:00
Benjy Cui
76d43e8d1b docs: update demo 2016-09-29 14:36:18 +08:00
afc163
22b7ab84fc http => https 2016-09-29 14:32:15 +08:00
afc163
afce4c5645 Merge branch 'master' of github.com:ant-design/ant-design 2016-09-29 14:25:04 +08:00
afc163
743f3a0dfe remove eslint warning 2016-09-29 14:22:27 +08:00
afc163
8948398b6f use fonts.googleapis.cnpmjs.org 2016-09-29 14:17:42 +08:00
Shawn Sit
1d71e98dbf docs: translated popover demos (#3211) 2016-09-29 13:43:55 +08:00
afc163
ce894a60ae update changelog for getFieldDecorator 2016-09-29 13:43:04 +08:00
afc163
2875d024f9 fix range picker style 2016-09-29 12:20:21 +08:00
afc163
a6131e65f5 Merge branch 'master' of github.com:ant-design/ant-design 2016-09-29 12:16:01 +08:00
afc163
b13a5b0507 update changelog words 2016-09-29 12:13:36 +08:00
Shawn Sit
8b46cfaf99 docs: translated dropdown demos (#3208) 2016-09-29 11:51:24 +08:00
afc163
c93ef7663c update resource page style 2016-09-29 11:42:39 +08:00
Shawn Sit
d2b7c4f2ec docs: Translation popconfirm (#3205)
* doc translation

* translation enhancement

* translate demos
2016-09-29 11:27:59 +08:00
thewei
8b7d013116 Update index.tsx (#3206)
fixed Upload export name
2016-09-29 11:23:37 +08:00
afc163
d90bf42fd5 update site font 2016-09-29 11:21:19 +08:00
Shawn Sit
122e223c0b docs: translate books name and links (#3202) 2016-09-29 10:34:20 +08:00
jinouwuque
6b793ca7b4 add momoent dependecy in the package.json
Otherwise, under babel-plugin-import support, datapicker will report error.
2016-09-28 22:14:30 -04:00
plandem
152ba8bcea docs: update CHANGELOG.en-US.md (#3198) 2016-09-29 09:33:47 +08:00
plandem
a2b939646a docs: update CHANGELOG.zh-CN.md (#3199) 2016-09-29 09:33:28 +08:00
ImJoeHs
ea5386994d fix table filter type (#3193)
* fix table filter type

* 'fix'

* update
2016-09-28 19:56:12 +08:00
afc163
1b906407d3 Merge branch 'master' of github.com:ant-design/ant-design 2016-09-28 19:23:05 +08:00
afc163
6088b48dca fix links 2016-09-28 19:22:52 +08:00
yiminghe
f059b9b125 Merge pull request #3188 from Brooooooklyn/style
style: clean export codes
2016-09-28 18:42:20 +08:00
afc163
2a7444745b update CHANGELOG format 2016-09-28 18:17:12 +08:00
feng zhi hao
c0527f8b66 chore: complete declaration in Tabs and Select (#3183) 2016-09-28 16:58:14 +08:00
Benjy Cui
92fb8f266f docs: add docs for Mention[prefix], close: #3184 2016-09-28 16:56:01 +08:00
LongYinan
5cf81a96e4 style: clean export codes 2016-09-28 16:53:02 +08:00
afc163
6982235894 Merge branch 'master' of github.com:ant-design/ant-design 2016-09-28 15:07:15 +08:00
afc163
19fdb2696b update fonts url 2016-09-28 15:05:04 +08:00
Benjy Cui
793bca755f docs: update change log details 2016-09-28 14:17:51 +08:00
Benjy Cui
79a5189415 chore: update deploy scripts 2016-09-28 14:08:22 +08:00
Benjy Cui
986c745177 docs: update README.md 2016-09-28 13:54:32 +08:00
afc163
bf87c8a930 Merge branch 'master' of github.com:ant-design/ant-design 2016-09-28 13:49:52 +08:00
Benjy Cui
73683fa3ff release 2.0.0 2016-09-28 13:45:31 +08:00
Benjy Cui
630bf741d5 docs: add change log for 2.0, close: #3020 (#3087) 2016-09-28 13:43:32 +08:00
afc163
1a9fef5d2a reinforcement button clicked animation 2016-09-28 00:13:00 +08:00
afc163
178311a393 IE8 => IE9 2016-09-28 00:07:31 +08:00
偏右
d788cb9f83 Delete CNAME
for nginx proxy in aliyun
2016-09-27 16:43:17 +08:00
Benjy Cui
1c55ed0dc0 bump 2.0.0-beta.13 2016-09-27 13:48:22 +08:00
Benjy Cui
545d4ff384 Merge branch '1.x-stable' 2016-09-27 13:46:44 +08:00
Benjy Cui
d8e9fff5ba deps: upgrade dependencies, close: #3161 (#3162)
* deps: upgrade dependencies, close: #3161

* css: update style for DatePicker[showTime]
2016-09-27 13:42:30 +08:00
广彬-梁
a7ba9004e1 fix: record key bug (#3166) 2016-09-27 13:41:57 +08:00
偏右
51da9c637c test: fix jest test for typescript (#3169)
* fix jest test for typescript

* fix components detect tc

* remove console
2016-09-27 13:40:34 +08:00
feng zhi hao
bb22f7864b fix: improve declaration (#3167)
* improve declaration

* remove id props in row
2016-09-27 12:04:01 +08:00
Benjy Cui
87753482bf style: update code style to please lint, close: #2811 2016-09-27 10:06:34 +08:00
Benjy Cui
c819fe280e docs: update links 2016-09-26 16:52:06 +08:00
afc163
eb104fe123 update implementation links 2016-09-26 13:47:35 +08:00
afc163
b2c91fb521 update implementation links 2016-09-26 13:42:18 +08:00
afc163
4edab23c8c Merge branch 'master' of github.com:ant-design/ant-design 2016-09-26 12:28:28 +08:00
afc163
bd3434de30 fix home link 2016-09-26 12:28:10 +08:00
Benjy Cui
d68c3c655c site: update menu 2016-09-26 12:18:19 +08:00
Benjy Cui
b43d40d47b docs: translate category for specification 2016-09-26 11:08:27 +08:00
Benjy Cui
4bf80a2e26 bump 2.0.0-beta.12 2016-09-26 10:26:58 +08:00
Benjy Cui
0375f104a3 chore: fix warning message 2016-09-26 10:26:04 +08:00
Benjy Cui
4663995f69 fix: should follow the targetKeys' order, close: #3152 2016-09-26 10:24:18 +08:00
Benjy Cui
feb7a88c09 fix: should generate style/css for BackTop, close: #3153 2016-09-26 10:13:15 +08:00
Benjy Cui
2b90ab8464 docs: fix typo, ref: #3146 2016-09-23 15:35:17 +08:00
afc163
6745f469bb update Home introduce 2016-09-23 15:03:23 +08:00
Benjy Cui
28d5b49f9e site: update details 2016-09-23 10:14:57 +08:00
kvetoslavnovak
a9afd5cd17 docs: Mention Basic Use - English translation (#3137) 2016-09-23 09:41:04 +08:00
kvetoslavnovak
069b5963db docs: Mention Controlled Mode - English translation (#3136) 2016-09-23 09:40:47 +08:00
kvetoslavnovak
2ccda65957 docs: Mention Icon Image - English translation (#3135) 2016-09-23 09:40:32 +08:00
kvetoslavnovak
150d4e6dbb docs: Mention Customize Suggestion - English translation (#3134) 2016-09-23 09:39:56 +08:00
kvetoslavnovak
b5a0ad0a67 docs: Mention Asynchronous loading - English translation (#3133) 2016-09-23 09:39:35 +08:00
kvetoslavnovak
ff42c08ebe docs: Switch the menu type - English Translation (#3132) 2016-09-23 09:38:57 +08:00
kvetoslavnovak
892b815c4a docs: Menu Themes - English Translation (#3131) 2016-09-23 09:38:40 +08:00
kvetoslavnovak
533ae0393b docs: Vertical menu - English translation (#3130) 2016-09-23 09:38:12 +08:00
kvetoslavnovak
9c2b346950 docs: Open current submenu only - English translation (#3129) 2016-09-23 09:37:53 +08:00
kvetoslavnovak
5753f14b85 docs: Vertical menu with children - English translation (#3128) 2016-09-23 09:37:31 +08:00
Benjy Cui
713393616e bump 2.0.0-beta.11 2016-09-22 17:11:28 +08:00
afc163
c0c00fbcd0 Fix strange button style bug in chrome 53, close #3031 2016-09-22 15:47:19 +08:00
Benjy Cui
2bc2ccc9c4 feat: AutoComplete.Option should be children, close: #3106 (#3120) 2016-09-22 14:40:34 +08:00
Benjy Cui
10b24ed77c fix: should pass className to Wrapper, close: #3119 2016-09-22 14:36:22 +08:00
Benjy Cui
50e978de53 fix: should show all the uploaded files, close: #3113 (#3117) 2016-09-22 11:54:36 +08:00
kvetoslavnovak
afefa3fc31 docs: English translation (#3114) 2016-09-22 10:42:23 +08:00
kvetoslavnovak
1fa710a911 docs: Top Navigation Example - English translation (#3116) 2016-09-22 10:40:42 +08:00
Benjy Cui
949907231b docs: udpate demo detail, close: #3111 2016-09-22 10:09:22 +08:00
afc163
44372760a1 update form demo style 2016-09-21 22:27:26 +08:00
afc163
1bd39692e9 adjust error message margin style in FormItem 2016-09-21 22:26:53 +08:00
afc163
33b8b3345b Merge branch "1.x-stable" 2016-09-21 22:01:54 +08:00
Benjy Cui
2c45e8ab35 chore: add 1x.ant.design 2016-09-21 17:29:04 +08:00
Benjy Cui
c1d71acfc7 docs: update demos of AutoComplete, close: #3106 2016-09-21 17:14:58 +08:00
Benjy Cui
247757f63f css: fix RangePicker's style 2016-09-21 16:43:09 +08:00
Benjy Cui
34fa1f2521 docs: fix breadcrumb demo 2016-09-21 16:42:32 +08:00
Benjy Cui
60914bb5c7 deps: upgrade antd-tools to work with babel-plugin-import 2016-09-21 14:25:27 +08:00
Benjy Cui
59cac0721d docs: translate titles of pattern 2016-09-21 14:03:22 +08:00
Benjy Cui
bd7e9f00c0 style: update code style 2016-09-21 11:54:53 +08:00
Benjy Cui
3f67fd3f9f docs: update docs details 2016-09-21 11:28:38 +08:00
Marius Ileana
4139dc3c8a docs: BackTop - demos - english translation (#3081)
* BackTop - basic demo - english translation

* BackTop - custom demo - english translation

* BackTop - basic demo - english translation - fix

* BackTop - custom demo - english translation - fix
2016-09-21 09:33:27 +08:00
feng zhi hao
a4be70334d chore: fix some error declaration (#3099) 2016-09-21 09:27:58 +08:00
chencheng (云谦)
9d9185127c docs: rename babel-plugin-antd to babel-plugin-import (#3089) 2016-09-20 17:17:49 +08:00
Benjy Cui
e521009670 site: fix 404, close: #3098 2016-09-20 16:48:34 +08:00
ddcat1115
602000f1a1 feat: Table suport indeterminate checkbox (#3074)
* Table suport indeterminate checkbox

* Table support indeterminate Checkbox
2016-09-20 15:29:31 +08:00
Benjy Cui
f04b65b25e fix: should pass style to upload correctly, close: #3072 2016-09-20 15:11:30 +08:00
Benjy Cui
e9d65904a1 site: add shouldComponentUpdate form Demo.jsx, close: #3090 2016-09-20 15:01:25 +08:00
Benjy Cui
9b99c3886d fix: spin should mask content, close: #3091 2016-09-20 14:51:43 +08:00
ddcat1115
3958eb4771 fix #3076 (#3086)
fix demolint
2016-09-20 13:49:38 +08:00
afc163
69cdf22b42 Allow indicate expandIconColumnIndex in Table, close #3055 2016-09-20 13:16:58 +08:00
马金花儿
3d187d00a1 feat: 为Modal组件的confirm、success、error、warning、info 子组件增加快捷键,模仿原生体验。 (#3061)
* Add hotkey for Modal.confirm

* Optimize

* 重构快捷键逻辑

* 根据CR 进一步优化逻辑

* timeoutId 改为非强制

* Update confirm.tsx

* 使用 onCancel 回调代替 onClose,并修改 onCancel 注释。

* 修改注释
2016-09-20 08:58:20 +08:00
sorrycc
e8fdcc9b8a fix(docs): typo 2016-09-19 21:53:00 +08:00
yiminghe
a131cab0c7 Merge pull request #3066 from ant-design/antd-init@2
Introduce dva with practical projects and play demo antd-init@2
2016-09-19 20:39:55 +08:00
Benjy Cui
d6b48adc5d bump 2.0.0-beta.10 2016-09-19 17:55:45 +08:00
Benjy Cui
31615c9793 feat: support disabled item for Transfer, close: #3038 (#3044)
* feat: support disabled item for Transfer, close: #3038

* refactor: Transfer
2016-09-19 17:52:20 +08:00
afc163
41266f6374 Merge branch 'master' of github.com:ant-design/ant-design 2016-09-19 17:43:01 +08:00
afc163
4a756405d4 Add two less variables 2016-09-19 17:42:47 +08:00
feng zhi hao
2cf5dc0046 chore: improve declaration (#3078) 2016-09-19 17:35:17 +08:00
Benjy Cui
3701d9a558 bump 2.0.0-beta.9 2016-09-19 17:15:41 +08:00
Benjy Cui
1100acd26e docs: fix AutoComplete demo, close: #3077 2016-09-19 17:08:18 +08:00
Benjy Cui
b08a17d986 fix: add .clearfix 2016-09-19 16:57:00 +08:00
afc163
7233b9a908 Fix #3075 and #2876 2016-09-19 16:16:13 +08:00
afc163
e4ecb88220 fix InputNumber long text overflow style, close #3075 2016-09-19 16:01:57 +08:00
Benjy Cui
a67614766c bump 2.0.0-beta.8 2016-09-19 15:24:57 +08:00
Benjy Cui
d1b9db9f97 fix: should use rc-calendar@7.1.0 2016-09-19 15:23:49 +08:00
Benjy Cui
469d24599f fix: should support Dropdown.Button[disabled], close: #3070 2016-09-19 11:42:03 +08:00
Benjy Cui
029dcf983e site: fix sidebar 2016-09-19 11:23:41 +08:00
afc163
3d8c63b821 Merge branch 'master' of github.com:ant-design/ant-design 2016-09-19 11:08:00 +08:00
afc163
701425250f fix demo markdown 2016-09-19 11:01:58 +08:00
Benjy Cui
370a6bde52 fix: should export type 2016-09-19 10:22:52 +08:00
Benjy Cui
a8fce6a4f1 bump 2.0.0-beta.7 2016-09-19 10:17:53 +08:00
feng zhi hao
cad2d19be2 fix: complete loss declaration (#3068)
* complete loss declaration

* fix error in ts-lint

* fix Icon name error
2016-09-19 10:17:07 +08:00
afc163
9a7b644295 Merge branch 'master' of github.com:ant-design/ant-design 2016-09-19 00:41:09 +08:00
afc163
f4c3c32382 Merge branch '1.x-stable' 2016-09-19 00:40:20 +08:00
sorrycc
681576d2c4 docs: upgrade Getting Started with antd-init@2 2016-09-18 17:47:58 +08:00
sorrycc
e6c406a4b7 docs: add Practical Projects 2016-09-18 17:39:11 +08:00
Benjy Cui
2dce9e67fb docs: fix docs of Menu 2016-09-18 15:59:43 +08:00
Shawn Sit
7ce12fe36a doc: demo translation enhancement (#3033)
* doc enhancement

* keep chinese simplified demo
2016-09-18 14:30:37 +08:00
Benjy Cui
b27dfca108 site: translate the tips of EditButton, close: #3060 2016-09-18 14:27:41 +08:00
afc163
483b9e4888 Fix hover bounce style in DatePicker time panel 2016-09-18 14:21:45 +08:00
afc163
bb325b5982 update iconfont download url 2016-09-18 14:15:53 +08:00
afc163
98d4145531 update translation 2016-09-18 14:04:21 +08:00
afc163
481c42a200 fix footer link 2016-09-18 14:02:22 +08:00
afc163
697b6c7b19 update upload demos 2016-09-18 11:08:54 +08:00
Benjy Cui
d644a01f89 feat: add Transfer[onSelectChange], close: #2968 (#2984) 2016-09-18 10:44:22 +08:00
Benjy Cui
64645e5046 bump 2.0.0-beta.6 2016-09-18 10:22:00 +08:00
Benjy Cui
af7635a73c fix: should work with rc-form, close: #3046 2016-09-18 10:20:35 +08:00
Benjy Cui
672ebecf47 deps: upgrade dependencies (#3017)
* deps: upgrade dependencies

* fix: backward compatibility

* fix: replace cross with close
2016-09-18 10:12:21 +08:00
偏右
354759cb17 Redesigned icons (#3041)
* redesigned icons

* change iconfont content

* use same icons

* fix missing icons

* improve icon size
2016-09-18 09:54:47 +08:00
Benjy Cui
6ec6ec8af1 bump 2.0.0-beta.5 2016-09-18 09:48:58 +08:00
Benjy Cui
0703782cf5 site: fix home banner 2016-09-18 09:44:58 +08:00
Shawn Sit
7d9ac4219a docs: Translation resource (#3032)
* translated reference

* translated docs of resources

* fixs: misspell

* resources doc enhancement
2016-09-18 09:28:28 +08:00
Marius Ileana
691a4d5766 docs: English translation of tab's position demo (#3050)
Just a small update of a label.
2016-09-18 09:26:39 +08:00
Marius Ileana
837ec0cb07 docs: Spin, Progress - demos - english translation (#3051)
* spin demos translation

* Progress demo translation
2016-09-18 09:24:49 +08:00
Marius Ileana
3d25f65c2b docs: Badge - demos - english translation (#3058) 2016-09-18 09:06:31 +08:00
afc163
6d2e0b80eb fix notifiaction duration, close #3049 2016-09-16 14:40:34 +08:00
afc163
01161ab8cd Add title for toc items 2016-09-15 01:42:45 +08:00
afc163
9042e139b3 Remove some unused code 2016-09-15 01:38:32 +08:00
afc163
9e5061acdc Merge branch "1.x-stable" 2016-09-15 01:25:28 +08:00
Benjy Cui
1a3f37e348 bump 2.0.0-beta.4 2016-09-14 17:54:22 +08:00
Benjy Cui
59093a6586 fix: should pass prefixCls correctly 2016-09-14 16:59:45 +08:00
afc163
73a6bfb055 Merge branch 'master' of github.com:ant-design/ant-design 2016-09-14 16:29:53 +08:00
马斯特
a25ec29fb8 refactor: 保证所有的tsx和less都正确使用prefix (#3024)
* refactor: extract prefix cls as less variable

* refactor: apply ant icon prefix cls in less files

* refactor: all components support prefixCls props
2016-09-14 16:18:33 +08:00
feng zhi hao
7a7395329b chore: 完善Form组件的声明 (#3043) 2016-09-14 16:07:28 +08:00
afc163
bbe6606dc3 fix demo 2016-09-14 14:49:12 +08:00
Benjy Cui
d8c6eccaea docs: update demo of slider 2016-09-14 14:45:01 +08:00
Benjy Cui
2a57a4af27 fix: css of DatePicker 2016-09-14 14:22:27 +08:00
Benjy Cui
648476de70 site: css split plugin should work with livereload 2016-09-14 14:21:13 +08:00
Benjy Cui
5b5b691879 docs: update demo 2016-09-14 13:52:54 +08:00
Benjy Cui
451ea82a91 bump 2.0.0-beta.3 2016-09-14 12:53:04 +08:00
Benjy Cui
c754a3d3d4 chore: add warning for breaking changes 2016-09-14 11:42:06 +08:00
Benjy Cui
37e8474714 fix: withRef should work, close: #2843 (#2992) 2016-09-14 10:25:44 +08:00
Benjy Cui
cbfc181fa4 fix: should not wrap upload list 2016-09-14 10:21:26 +08:00
Benjy Cui
31a0bed13c docs: update demo of Tooltip 2016-09-14 10:20:42 +08:00
Marius Ileana
39a11f00a0 docs: upload, alert, tooltip - translations of remaining demos (#3035)
* upload - translations of two remaining demos

* alert & tooltip - remaining demo translations

* Prompt typo
2016-09-14 09:52:14 +08:00
Benjy Cui
7459be26aa docs: update docs about timezone, ref: #3020 2016-09-14 09:42:16 +08:00
afc163
36c3be20b7 Merge branch 'master' of github.com:ant-design/ant-design 2016-09-13 23:03:00 +08:00
afc163
03b22e5e8c update issue template 2016-09-13 23:02:34 +08:00
jiang
656ab0e3f3 feat: add back to top animation (#3021)
* add back to top animation

* update currentScrollTop

* use date now
2016-09-13 17:10:08 +08:00
Benjy Cui
8db2b79505 chore: fix compile errors 2016-09-13 15:31:29 +08:00
Benjy Cui
cda671fead site: fix site in IE9, WTF 2016-09-13 14:47:05 +08:00
Benjy Cui
58745edecf docs: update 2016-09-13 11:51:34 +08:00
Benjy Cui
969cbed2ca docs: update demo of Badge 2016-09-13 10:27:16 +08:00
Benjy Cui
7156083c7a bump 2.0.0-beta.2 2016-09-12 17:58:57 +08:00
Benjy Cui
e5a0e13d70 fix: message && notification should be lowercase 2016-09-12 17:55:26 +08:00
Marius Ileana
a94ccc4421 docs: Translation (and review) of docs/practice section (#2998)
* translation (and review) of docs/practice secion

* included the corrections of benjycui and afc

comments/corrections included.
2016-09-12 15:44:42 +08:00
Benjy Cui
43d75abb3a docs: update docs of spec 2016-09-12 10:37:17 +08:00
Marius Ileana
71683f0cf6 docs: radio/demo/disable.md - English translation (#3006)
English translation of labels
2016-09-12 10:10:43 +08:00
Marius Ileana
a8cc57cd13 docs: select/demo/coordinate.md - English translation (#3011)
English translation of labels/data
2016-09-12 10:10:27 +08:00
Marius Ileana
bde1711597 docs: select/demo/combobox.md - English translation (#3010)
English translation of labels and comments
2016-09-12 10:10:07 +08:00
Marius Ileana
ced5c9a9ed docs: select/demo/search.md - English translation (#3009)
English translation of labels.
2016-09-12 10:09:22 +08:00
Marius Ileana
8e7fc057e6 docs: radio/demo/size.md - English translation (#3008)
English translation of labels.
2016-09-12 10:09:03 +08:00
Marius Ileana
df856b9d9a docs: radio/demo/radiobutton.md - English translation (#3007)
English translation of labels
2016-09-12 10:08:40 +08:00
Marius Ileana
00ac554e41 docs/react/install.en-US.md - small typo update (#3004) 2016-09-11 21:23:57 +08:00
Marius Ileana
23d68cad19 input/demo/basic.md - placeholder translated (#3005)
placeholder value translated to english.
2016-09-11 21:22:53 +08:00
kvetoslavnovak
10709251ec #1471 (#3000)
#1471
2016-09-11 00:30:08 +08:00
Shawn Sit
57cdbe1a6b docs: translated cascader demo (#2997) 2016-09-10 18:23:24 +08:00
Benjy Cui
25cb3e2d30 docs: update demo to catch errors, close: #2912 2016-09-10 18:14:23 +08:00
Shawn Sit
9777c7d065 docs: translate demo (#2996) 2016-09-10 18:00:51 +08:00
Benjy Cui
ab11f5e092 bump 2.0.0-beta.1 2016-09-10 17:35:37 +08:00
Benjy Cui
1dac1370de deps: replace obejct.omit with omit.js, close: #2988 (#2994) 2016-09-10 17:17:55 +08:00
Benjy Cui
44d5fc6fd2 fix: both of undefined and null means no input, close: #2959 2016-09-10 14:28:40 +08:00
afc163
2bd05aeb2b Merge branch 'master' of github.com:ant-design/ant-design 2016-09-10 14:23:00 +08:00
afc163
3c2757a5be update nav english 2016-09-10 14:22:40 +08:00
afc163
e34d5c57c5 update font-family 2016-09-10 14:19:46 +08:00
Shawn Sit
374328bca9 docs: fix misspelled (#2990) 2016-09-10 14:17:11 +08:00
Shawn Sit
280698f793 docs: translated cascade custom trigger demo (#2991) 2016-09-10 14:16:13 +08:00
afc163
f10c7bbfda update markdown style 2016-09-10 14:13:56 +08:00
afc163
0e1be22785 Merge branch 'master' of github.com:ant-design/ant-design 2016-09-10 14:11:10 +08:00
afc163
d2effd165b update icon doc 2016-09-10 14:00:57 +08:00
afc163
0e6f677ff9 Fix doc headings 2016-09-10 13:43:30 +08:00
Benjy Cui
17cadbb3fa docs: update docs of Affix 2016-09-10 12:45:33 +08:00
Benjy Cui
9ac4e6ea44 site: fix language detect function 2016-09-10 11:21:00 +08:00
afc163
c79826ea83 remove jsx file 2016-09-10 11:19:10 +08:00
afc163
0612251647 fix eslint warning, eslint/eslint#4828 2016-09-10 11:18:07 +08:00
afc163
5c7cf8d746 Merge branch 'master' of github.com:ant-design/ant-design 2016-09-10 11:11:44 +08:00
afc163
2f308b0f99 update font-family 2016-09-10 11:10:47 +08:00
偏右
4be7fb3b98 Update introduce.en-US.md 2016-09-10 11:01:59 +08:00
Benjy Cui
090fb16c77 docs: update the doc of Form, ref: #2985 2016-09-10 10:05:26 +08:00
npmcdn-to-unpkg-bot
e645e3a8fa Replace npmcdn.com with unpkg.com (#2987) 2016-09-09 21:07:05 +08:00
Benjy Cui
8f980b4af9 bump 2.0.0-beta.0 2016-09-09 16:02:20 +08:00
yiminghe
78af105d97 fix index 2016-09-09 15:52:02 +08:00
yiminghe
bb2d4f6b92 fix index 2016-09-09 15:52:02 +08:00
ddcat1115
41a7f51e12 docs: update Upload en doc (#2982)
refer to https://github.com/ant-design/ant-design/issues/2892
2016-09-09 14:45:07 +08:00
Benjy Cui
caf218ce4b chore: integrate typings dir 2016-09-09 14:37:44 +08:00
Benjy Cui
14fb2c78ba chore: remove deprecated code (#2920)
* chore: remove deprecated code

* chore: add warning for Breadcrumb
2016-09-09 13:55:46 +08:00
Benjy Cui
77a45f0b00 deps: upgrade rc-table (#2958)
* feat: remove Table columns paging, close: #2883

* css: add style for table multi-header

* feat: multi-header supports fitler & sorter and so on

* feat: multi-heaader works with Table[scroll.y]

* feat: multi-header should works with Table[scroll.x]

* style: update code style to please lint
2016-09-09 13:55:41 +08:00
Benjy Cui
4026221d45 deps: hello moment (#2887)
* deps: upgrade TimePicker

* deps: upgrade DatePicker

* deps: upgrade Calendar

* fix: moment should work with LocaleProvider

* feat: update API of TimePicker

* feat: update Calendar's APIs

* feat: update DatePicker's APIs

* doc: update demo

* revert: add dateString and timeString and so on

* feat: add Calendar[defaultValue]

* feat: add defaultPickerValue

* docs: update docs about date picker

* feat: set moment locale to zh-cn automatically
2016-09-09 13:55:21 +08:00
yiminghe
4b9d63d08d add promise polyfill 2016-09-08 20:38:08 +08:00
Benjy Cui
76ce445576 site: fix start button 2016-09-08 17:48:55 +08:00
Benjy Cui
b7e6b1ba51 site: show lang button 2016-09-08 17:36:08 +08:00
afc163
bf96362cea Merge branch 'master' of github.com:ant-design/ant-design 2016-09-08 17:05:14 +08:00
afc163
3bfe9f0dbd renew AUTHORS.txt 2016-09-08 17:04:31 +08:00
Benjy Cui
cb367f3f35 site: update site details 2016-09-08 16:53:50 +08:00
ddcat1115
5dffb63484 feat: checkbox add indeterminate (#2905) 2016-09-08 15:54:04 +08:00
afc163
bab669d17d Merge branch "1.x-stable" 2016-09-08 15:17:39 +08:00
afc163
b7fc663b7f Merge branch 'master' of github.com:ant-design/ant-design 2016-09-08 11:15:45 +08:00
afc163
903bb1aa82 fix lesshint 2016-09-08 11:14:39 +08:00
yiminghe
aaee7986bd update site config 2016-09-08 11:09:15 +08:00
tianli.zhao
9be6901794 fix issue 2929:Menu 设置成 theme=dark 后,链接点击无效 (#2931) 2016-09-03 00:43:33 +08:00
Andrew Murray
0d00c5fb6c docs: Fixed typos (#2921) 2016-09-01 18:12:12 +08:00
afc163
5f8b176c69 Merge branch 'master' of github.com:ant-design/ant-design 2016-09-01 14:39:15 +08:00
afc163
1dd810ebcb update doc 2016-09-01 14:25:05 +08:00
Benjy Cui
570b0bfe3b site: translation of home and footer (#2855) 2016-09-01 11:53:55 +08:00
Benjy Cui
5a4ebe535f deps: update rc-form and form's docs (#2873) 2016-09-01 11:48:38 +08:00
Benjy Cui
6030e6abef fix: upgrade rc-menu to close: #2701 (#2836) 2016-09-01 11:26:07 +08:00
Benjy Cui
92ab804815 feat: Cascader[showSearch] (#2776)
* feat: implement Cascader[showSearch] basicly

* feat: optimize Cascader[showSearch]

* feat: clear for input value

* feat: complete Cascader[showSearchf]

* docs: add docs for Cascader[search]

* fix: review

* fix: add key

* style: update code style to please lint

* refactor: update according to review

* docs: update docs
2016-09-01 11:08:41 +08:00
Shawn Sit
04e8f062c7 translated doc of affix target demo (#2817)
* translated doc of affix target demo

* fixs: misspell

* enhancement
2016-09-01 11:04:34 +08:00
afc163
b798a228e6 Add less variables about outline 2016-08-31 17:04:24 +08:00
afc163
123b2c1728 Add some translation 2016-08-31 15:02:08 +08:00
afc163
497ff0cabb Merge branch "1.x-stable" 2016-08-31 15:00:13 +08:00
afc163
e0eb9ae162 Merge branch "1.x-stable" 2016-08-29 21:02:59 +08:00
afc163
a7874cd2a2 change linkRender and nameRender to a simpler itemRender, close #2871 2016-08-29 16:52:35 +08:00
Benjy Cui
33939312e9 docs: fix demos 2016-08-29 14:46:31 +08:00
Benjy Cui
34974923b8 docs: remove dead code in demo 2016-08-29 14:38:57 +08:00
afc163
ced097577f fix deprecated lint warning 2016-08-28 17:52:14 +08:00
afc163
d91441d362 Merge branch 'master' of github.com:ant-design/ant-design 2016-08-28 17:47:48 +08:00
afc163
b6222f7c22 fix lints 2016-08-28 17:47:06 +08:00
afc163
59d7a7ee2d Support customize the icon for Notification 2016-08-28 17:45:27 +08:00
afc163
f76a6bf107 Improve Alert and notification style 2016-08-28 17:16:43 +08:00
Benjy Cui
4bfe8cbeb1 chore: update index.js, close: #1846 (#2838) 2016-08-26 15:38:29 +08:00
Benjy Cui
cc92f36c3d docs: update title 2016-08-26 15:19:40 +08:00
Benjy Cui
b2349facab docs: fix docs' format 2016-08-26 15:07:46 +08:00
Winsky
6e94e7b7a4 [docs] translate menu,popover,popconfirm (#2713) 2016-08-26 14:42:41 +08:00
Benjy Cui
50c4367a15 docs: update docs for Form.Item, close: #2835 2016-08-25 13:54:53 +08:00
DengYun
43d17eeb3a 补充Table组件缺少的columns的属性类型定义 (#2833)
* 补充Table组件缺少的columns的属性类型定义

* `columns` is required.
2016-08-25 10:58:10 +08:00
hellowenqi
a25b8b0658 docs: Translation upload (#2770) 2016-08-25 09:46:19 +08:00
Benjy Cui
577fae8f0c chore: delete index.d.ts 2016-08-25 09:40:21 +08:00
afc163
50478936f0 Merge branch 'master' of github.com:ant-design/ant-design 2016-08-24 17:57:33 +08:00
afc163
c0005f5645 Add typings to devDeps 2016-08-24 17:56:02 +08:00
Benjy Cui
a6d7cc0035 style: update code style to please lint 2016-08-24 16:56:29 +08:00
afc163
363f610d8b Fix tsc errors beside DatePicker 2016-08-24 16:09:55 +08:00
afc163
cce5cb4021 Remove deprecated components: QueueAnim & Validation 2016-08-24 12:08:31 +08:00
Benjy Cui
0ec8c7ba86 docs: fix demoe' format, close: #2822 2016-08-24 10:33:25 +08:00
afc163
77949bb9e3 upgrade eslint-config, close #2811 2016-08-23 21:00:35 +08:00
afc163
ca906a0f9d Merge branch "1.x-stable" 2016-08-23 18:16:19 +08:00
Jerry Bendy
cb56defea3 Spin animate with tips (#2801)
* Spin 组件在显示 tip 时同时显示动画

* remove tip text when not exists
2016-08-23 16:17:32 +08:00
Shawn Sit
2e0424d3b2 Translation tab title (#2815)
* translated doc of tab title

* fixs: misspell

* fixs: misspell

* remove full stop
2016-08-23 14:15:34 +08:00
Shawn Sit
b85d158fd0 docs: Translation tag (#2795) 2016-08-23 09:37:10 +08:00
Benjy Cui
5dcce12c2c fix: some tsc errors (#2804) 2016-08-22 17:26:14 +08:00
Benjy Cui
5d39bd9c54 fix: resolve merge conflict 2016-08-22 17:18:26 +08:00
Benjy Cui
e6280a7ea6 Merge branch '1.x-stable' 2016-08-22 17:05:37 +08:00
Benjy Cui
18eea7f1ad docs: update input demos' format 2016-08-22 10:27:43 +08:00
Marius Ileana
52f7bf8ba5 docs: Translation of Input component and its demos. (#2789) 2016-08-22 09:53:39 +08:00
Marius Ileana
75741854c9 input-number / index.en-US.md - small update (#2790)
Small update on the API section.
2016-08-21 00:20:42 +08:00
afc163
1df025f204 Add tsc into lint 2016-08-20 18:04:22 +08:00
Benjy Cui
ff19dcc1fc feat: add Badge[status, text], close: #2715 (#2780)
* feat: add Badge[status, text], close: #2715

* feat: optimize Badge[status, text]
2016-08-20 17:43:46 +08:00
ryangun
bc651a207c docs: Translation icon (#2706) 2016-08-20 11:58:31 +08:00
Benjy Cui
3411765ce9 Refactor ts (#2760)
* refactor: add interface form Calendar

* refactor: add interface for layout

* refactor: add interface for DatePicker

* refactor: add interface for Icon

* refactor: add interface for InputNumber

* refactor: add interface for Input
2016-08-19 17:11:06 +08:00
Benjy Cui
4e0ae95e1e chore: export form's interface 2016-08-19 16:53:27 +08:00
陆离
ff765002fa refactor: rewrite form and dropdown in ts (#2683) 2016-08-19 16:43:32 +08:00
Benjy Cui
2c0ed57e5a docs: fix InputNumber demos' format 2016-08-18 15:59:07 +08:00
ryangun
0723b9664c docs: the translation of Input-number (#2707) 2016-08-18 15:46:11 +08:00
Benjy Cui
f21033c316 docs: tranlsation of Checkbox (#2740) 2016-08-18 11:22:55 +08:00
然则
5d36e7e03f fix #2748 2016-08-17 17:12:40 +08:00
Gray Choi
3e5015e351 docs: translate notification (#2731) 2016-08-17 11:07:02 +08:00
afc163
36293e2ccb fix tslint 2016-08-16 18:12:56 +08:00
afc163
10e1b8b269 Fix some ts errors 2016-08-16 18:07:37 +08:00
afc163
24d2973c32 Merge branch "1.x-stable" 2016-08-16 17:54:59 +08:00
ddcat1115
3bdd8212ec refactor: Ts rewrite patination notification modal menu (#2699) 2016-08-15 12:00:05 +08:00
Benjy Cui
63941ae665 docs: fix table demo format 2016-08-15 08:07:03 +08:00
偏右
0b3186696c docs: Translate table (#2594) 2016-08-15 07:54:01 +08:00
Benjy Cui
8dd31d0bb2 fix: buttons of Modal.xxx should be disabled, close: #2684 (#2687) 2016-08-14 15:19:47 +08:00
Marius Ileana
bb0a30d926 docs: table/demo/reset-filter - A little more meaningful filter (#2700) 2016-08-13 09:06:32 +08:00
afc163
da6b65f7f0 Merge 1.x-stable 2016-08-12 14:47:01 +08:00
Eddie Xie
dc62976b39 docs: Fix typos (#2694) 2016-08-12 14:16:59 +08:00
Benjy Cui
978b9f98e7 refactor: table ts (#2664)
* refactor: table ts

* fix: should pass context to onChange correctly
2016-08-11 15:38:03 +08:00
Benjy Cui
2ed192db52 docs: fix demo style 2016-08-11 11:47:28 +08:00
Gray Choi
5c2087311f docs: translate modal (#2634) 2016-08-11 11:41:06 +08:00
然则
be553af441 fix #2657 2016-08-10 14:49:58 +08:00
Benjy Cui
d3d6faf2f3 refactor: ts radio, ref: #2639 2016-08-10 10:26:42 +08:00
Benjy Cui
77e47c5807 refactor: add interface (#2638) 2016-08-10 09:46:56 +08:00
ddcat1115
e0d02b1990 refactor: ts Progress (#2640) 2016-08-09 15:04:02 +08:00
afc163
08c4f82947 Merge branch 'master' of github.com:ant-design/ant-design 2016-08-08 17:48:31 +08:00
afc163
a67b72237d fix typings.json 2016-08-08 17:47:23 +08:00
Marius Ileana
725ca31939 docs: Small correction (#2637) 2016-08-08 15:43:21 +08:00
afc163
175438ec8c fix tslint 2016-08-08 15:00:35 +08:00
afc163
7e77489c8e Fix ts errors in Transfer 2016-08-08 14:42:29 +08:00
afc163
b200f8a2d8 Merge 1.x-stable 2016-08-08 14:12:02 +08:00
Benjy Cui
ca5fe46611 docs: fix demo 2016-08-08 10:57:11 +08:00
The Rock
dc0fc80709 docs(translation): translation for layout (#2635) 2016-08-08 10:40:02 +08:00
Benjy Cui
e051d03623 docs: translation of getting-started and introduce (#2627) 2016-08-08 10:32:22 +08:00
然则
db0ac02321 fix show arrow when there is no children #2616 2016-08-07 20:38:20 +08:00
ddcat1115
c9e26ecab9 docs: treeSelect translation (#2582) 2016-08-05 11:47:31 +08:00
陆离
b946d71026 Merge pull request #2600 from ddcat1115/Alert-banner
banner型 Alert
2016-08-05 11:34:25 +08:00
Benjy Cui
4cf04c5799 docs: update form demo 2016-08-05 11:28:34 +08:00
Marius Ileana
6bb29a1774 docs: Review of form / demo / advanced-search-form.md (#2574) 2016-08-05 11:25:39 +08:00
陆离
776e594c1b Merge pull request #2618 from ant-design/feat-vertical-form
feat: Form[vertical], close: #2449
2016-08-04 19:02:20 +08:00
Benjy Cui
7d9585377e feat: Form[vertical], close: #2449 2016-08-04 17:45:15 +08:00
afc163
3bae249170 Merge branch 'master' of github.com:ant-design/ant-design 2016-08-04 14:23:07 +08:00
afc163
bb68245b7f Merge 1.x-stable 2016-08-04 14:06:09 +08:00
Benjy Cui
37a3861c65 docs: sync, ref: #2607 2016-08-04 09:45:50 +08:00
Marius Ileana
c8f2793ec3 docs: Review of transfer / index.en-US.md (#2607) 2016-08-04 09:33:04 +08:00
Marius Ileana
05ba63bccc docs: Review of transfer / demo / advanced.md (#2608) 2016-08-04 09:25:07 +08:00
Benjy Cui
95c353de63 docs: sync, ref: #2609 2016-08-04 09:23:10 +08:00
Marius Ileana
77940b77f0 docs: Review of transfer / demo / basic.md (#2609) 2016-08-04 09:13:36 +08:00
afc163
0da1aeff75 Merge branch '1.x-stable' 2016-08-03 20:00:38 +08:00
ddcat1115
21b67a330d banner型 Alert 2016-08-03 14:55:30 +08:00
afc163
77fa03240b Merge branch '1.x-stable' 2016-08-03 11:43:43 +08:00
Benjy Cui
5b5439208c docs: update docs for Form, ref: #2591 2016-08-03 10:55:15 +08:00
Shawn Sit
c04ba5b39b docs: Traslation tabs (#2587) 2016-08-03 10:39:20 +08:00
lixiaochou077
6f620b0e91 docs: translate transfer (#2586) 2016-08-03 10:10:13 +08:00
ddcat1115
ef84f8d408 refactor: ts LocaleProvider (#2548) 2016-08-02 16:10:26 +08:00
lixiaochou077
9cec8af5f7 docs: translation tooltip (#2577) 2016-08-02 16:06:46 +08:00
陆离
536de74b62 Merge pull request #2569 from ant-design/typescript-tree-select-and-upload
Add types for tree-select and upload
2016-08-02 14:24:53 +08:00
afc163
da6d511567 Merge branch '1.x-stable' 2016-08-02 12:03:11 +08:00
Benjy Cui
eaebebf425 docs: fix docs 2016-08-02 09:34:04 +08:00
Marius Ileana
23e5912384 docs: Review (#2573)
Please excuse any mistake. I just discovered this library the other day, I felt in love with it and I really like to contribute. :-)
2016-08-02 09:32:50 +08:00
Marius Ileana
be181a7cc7 docs: review of form / demo / form-in-modal.md (#2575) 2016-08-02 09:25:14 +08:00
Marius Ileana
40498e7f01 chore: small typo to form / Form.tsx (#2576) 2016-08-02 09:24:15 +08:00
afc163
25b3517cc3 Add types for tree-select and upload (#1846) 2016-08-01 16:35:01 +08:00
afc163
aa10729d1e fix module types 2016-08-01 14:30:22 +08:00
afc163
0fcaeb5280 Merge branch 'master' of github.com:ant-design/ant-design 2016-08-01 13:31:07 +08:00
afc163
4f18cf0658 fix types 2016-08-01 13:30:13 +08:00
yiminghe
7edb997af0 upgrade tools 2016-08-01 12:52:34 +08:00
Benjy Cui
7f1222f271 docs: translate specification (#2377) 2016-07-31 10:17:07 +08:00
Benjy Cui
e5e7a9ac33 docs: update documentation of form 2016-07-31 10:01:58 +08:00
Gray Choi
d07b73fec0 docs: translation of form (#2555) 2016-07-31 09:53:51 +08:00
afc163
57f08259db Merge 1.x-stable 2016-07-30 14:36:49 +08:00
ddcat1115
a3a999441e refactor: ts message (#2544) 2016-07-29 16:32:12 +08:00
ddcat1115
89efcb903a ts popover (#2542) 2016-07-29 14:45:06 +08:00
afc163
10a0709b3a update dragger demo 2016-07-29 14:40:19 +08:00
afc163
877239bfe5 fix Unused import 2016-07-29 14:06:27 +08:00
afc163
37880beedb Merge branch 'master' of github.com:ant-design/ant-design 2016-07-29 13:58:41 +08:00
afc163
71d74c30c1 Merge 1.x-stable 2016-07-29 13:57:54 +08:00
Benjy Cui
d60051dac2 docs: fix typo 2016-07-29 13:47:14 +08:00
Vadim Macagon
70f16295bd docs: Improve English docs for the Card component (#2537) 2016-07-29 13:43:48 +08:00
ddcat1115
a242a4bdf3 docs: pagination translation (#2533) 2016-07-29 10:15:31 +08:00
ddcat1115
634e836e8d docs: LocaleProvider translation (#2532) 2016-07-29 10:13:59 +08:00
afc163
2af8f6f95c Merge branch 'master' of github.com:ant-design/ant-design 2016-07-27 12:59:09 +08:00
afc163
4614258a66 upgrade typings 2016-07-27 12:58:32 +08:00
Benjy Cui
54ad570475 site: refactor, simplify code 2016-07-26 17:40:40 +08:00
afc163
b79fd5a540 Merge branch 'master' of github.com:ant-design/ant-design 2016-07-26 16:24:16 +08:00
afc163
88e8f693c8 Add custom typings 2016-07-26 16:21:07 +08:00
afc163
b8c64f8b6c Merge branch 'master' of github.com:ant-design/ant-design 2016-07-26 22:30:40 +08:00
afc163
0eeca99f02 Merge 1.x-stable 2016-07-26 22:20:33 +08:00
ddcat1115
479c15bb58 docs: progress-translation (#2499) 2016-07-26 15:42:04 +08:00
Benjy Cui
0d5b75429f site: upgrade bisheng 2016-07-26 15:24:48 +08:00
lixiaochou077
039b064529 docs: translation timepicker (#2491) 2016-07-26 11:03:44 +08:00
ddcat1115
87a159b18f docs: Switch-translation (#2489) 2016-07-26 09:17:46 +08:00
Benjy Cui
331b2fdf73 chore: fix 2016-07-25 17:54:09 +08:00
陆离
552fa228ee feat: AutoComplete (#2490) 2016-07-25 17:46:45 +08:00
陆离
0f6a8e2ff7 feat: debounce before spinning => debounce after spinning (#2486) 2016-07-25 16:31:59 +08:00
Benjy Cui
11660c128b docs: update demo, close: #1872 2016-07-25 16:08:18 +08:00
warmhug
408027b95d add tree's tips 2016-07-25 12:15:59 +08:00
warmhug
bc5f5d5ba4 add tree's tips 2016-07-25 12:08:43 +08:00
afc163
f3f952e40f fix tslint 2016-07-25 11:39:54 +08:00
afc163
81db618964 Merge branch 'master' of github.com:ant-design/ant-design 2016-07-25 11:36:12 +08:00
afc163
7a52a6fafe Fix context types 2016-07-25 11:35:51 +08:00
Benjy Cui
2dffa172a4 site: fix meaningless anchor 2016-07-25 11:30:42 +08:00
afc163
3543cdc1cf Merge branch 'master' of github.com:ant-design/ant-design 2016-07-25 11:28:56 +08:00
ddcat1115
a396e3779a Ts rewrite popconfirm (#2472)
* Popconfirm rewrite

* fix`
2016-07-25 11:28:43 +08:00
afc163
45c0a6e38f blank line 2016-07-25 11:28:19 +08:00
陆离
f5725e3c89 fix issues in #2441 (#2460) 2016-07-24 15:21:07 +08:00
afc163
7d0c8329ba Merge branch '1.x-stable' 2016-07-24 15:08:04 +08:00
afc163
1b001c7672 Merge 1.x-stable 2016-07-24 15:07:50 +08:00
afc163
32ab285886 Merge branch '1.x-stable' 2016-07-24 13:49:42 +08:00
Benjy Cui
8cb18090ba deps: update bisheng-plugin-react 2016-07-22 09:55:35 +08:00
afc163
2a54161e51 fix eslint 2016-07-21 21:19:37 +08:00
afc163
a72d9ec381 Merge 2016-07-21 18:10:13 +08:00
afc163
7e9838849b upgrade eslintrc 2016-07-21 17:33:18 +08:00
afc163
398b8ac708 typo 2016-07-21 15:53:33 +08:00
afc163
497cc1f65a improve FormItem colon (#2311) 2016-07-21 15:51:37 +08:00
afc163
a30f0090b9 update metion doc 2016-07-21 15:41:40 +08:00
afc163
57a34d8f5d fix metion styles 2016-07-21 15:40:13 +08:00
afc163
aa8e02326a update metion docs 2016-07-21 15:23:04 +08:00
afc163
92d127d8a5 Fix DatePicker style 2016-07-21 15:20:01 +08:00
afc163
5eb52885d6 @background-color-base 2016-07-21 15:02:24 +08:00
afc163
1138b69c6d Merge branch 'master' of github.com:ant-design/ant-design 2016-07-21 14:40:11 +08:00
afc163
db4cbabf0c Merge 2016-07-21 14:39:28 +08:00
陆离
4ad8b2f96c Merge pull request #2441 from RaoHai/MentionComponent
Mention component fix
2016-07-21 14:37:29 +08:00
afc163
42d34a5db3 Merge branch '1.x-stable' 2016-07-21 14:34:37 +08:00
Benjy Cui
5bee7d2088 docs: fix translation 2016-07-21 10:15:00 +08:00
却痕
e202c7d2b3 docs: translation of Rate && Radio (#2440) 2016-07-21 10:10:04 +08:00
Leon Shi
3d070b8d85 docs: translate Cascader's documentation to English (#2433) 2016-07-21 10:09:01 +08:00
ddcat1115
2b20ac0456 docs: steps translation (#2430) 2016-07-21 10:07:30 +08:00
Gray Choi
b0bf2a5c0e docs: translate tree component (#2395) 2016-07-21 09:52:39 +08:00
陆离
49e164d09d docs: translation of Spin and Slider (#2378) 2016-07-21 09:51:04 +08:00
RaoHai
910d4ff111 version fix 2016-07-20 19:01:11 +08:00
RaoHai
1ccfad13f7 Mention Component fix
- 现在只输入一个 @ 符号,dropdown 也会弹出。
 - 输入框失去焦点后,dropdown 会消失。
 - 添加受控模式示例
 - 添加 `getMentions(editorState: EditorState): Array<String>` Api,
   可以获取当前提到的人。
 - 添加了校验样式
 - 其他样式修正
2016-07-20 19:01:11 +08:00
yiminghe
12b531efb3 Merge pull request #2416 from RaoHai/improvementOfDatePicker
DatePicker 组件优化
2016-07-20 11:17:35 +08:00
yiminghe
6158b39335 Merge pull request #2259 from RaoHai/MentionComponent
Mention Component
2016-07-20 11:17:19 +08:00
afc163
ea61aa3cab upload code style 2016-07-19 20:28:56 +08:00
yiminghe
b140856836 add class 2016-07-19 19:08:59 +08:00
RaoHai
8c739abeb5 style lint 2016-07-19 16:00:19 +08:00
RaoHai
7dd4a019d5 DatePicker 组件优化
+ DatePicker showTime: 面板上的日期展示输入框统一为一个,格式和外面的输入框同步,并且支持手动修改。
 面板上的 TimePicker
 + DatePicker showTime: 输入框不再展示,改造为『选择时间』,点击后不再展开浮层,直接盖住日期区域。
 + RangePicker showTime : 只选中开始日期,“确定”和“选择时间”灰置。 如未选择日期直接选择时间,开始日期和结束日期默认选中当天。
 + RangePicker showTime : 点击框外和确定均为确定操作。
 + RangePicker showTime : 在时间页面,开始时间的默认状态为当前时间,结束时间的默认状态跟随开始时间。
 + RangePicker showTime : 开始时间的选择范围没有限制,结束时间的选择范围必须大于等于开始时间。
 + RangePicker showTime : 当开始时间选择了结束时间之后的时间(发生冲突),结束时间则自动切换到与开始时间相同的时间。
2016-07-19 16:00:19 +08:00
yiminghe
3342aae9f3 upgrade 2016-07-19 15:46:00 +08:00
afc163
6e673b8b44 fix spec color 2016-07-19 14:40:56 +08:00
RaoHai
3095f58be8 export toEditorState of Mention 2016-07-19 13:39:05 +08:00
RaoHai
3fe36f4584 export toString of Mention 2016-07-19 12:31:03 +08:00
RaoHai
23df8f7504 tslint fix 2016-07-18 17:58:55 +08:00
RaoHai
69da207f3c support value props and controllred mode 2016-07-18 16:58:52 +08:00
RaoHai
f547a97020 lesslint fix 2016-07-18 16:58:52 +08:00
RaoHai
595938f5f2 Mention Component 2016-07-18 16:58:52 +08:00
RaoHai
aea176e045 rc-editor-mention version 2016-07-18 16:58:52 +08:00
RaoHai
8e3d2b823a improvement after review 2016-07-18 16:58:52 +08:00
RaoHai
1fd4837d25 lesslint fix 2016-07-18 16:58:52 +08:00
RaoHai
01fabac77a Mention Component 2016-07-18 16:58:52 +08:00
afc163
f0995bd1e3 Merge 1.x-stable 2016-07-15 16:42:58 +08:00
afc163
d7defe458b blank line 2016-07-15 12:37:53 +08:00
yiminghe
91037fa78f Merge pull request #2385 from ant-design/add-typings
Add typings
2016-07-15 11:42:30 +08:00
Infinity
5fa89f280a 为TimePicker增加定制anchor的API (#2390) 2016-07-15 11:11:55 +08:00
afc163
730dbc72f7 Add typings 2016-07-14 18:15:59 +08:00
afc163
2e4d09c68e Fix types 2016-07-13 18:04:38 +08:00
afc163
2e41e35cc6 Fix more tslint problems 2016-07-13 17:22:23 +08:00
afc163
aee2b2c5ad Merge branch '1.x-stable' 2016-07-13 16:26:27 +08:00
afc163
900b9b2f99 update package.json 2016-07-13 12:22:34 +08:00
偏右
de359d2cf7 fix tslint problems (#2360) 2016-07-13 11:14:24 +08:00
afc163
5e5bd6af9e Merge branch '1.x-stable' 2016-07-12 21:36:23 +08:00
afc163
ce7e7c77f0 Fix ts error in Affix (#1846) 2016-07-12 16:07:12 +08:00
afc163
4954f5d733 Merge branch '1.x-stable' 2016-07-12 13:59:58 +08:00
yiminghe
df158ae502 upgrade antd-tools 2016-07-11 15:53:35 +08:00
ezpub
dce99bc259 fix cascader input value error (#2338)
`value` prop on `input` should not be null. Consider using the empty string to clear the component or `undefined` for uncontrolled components.
2016-07-11 14:58:15 +08:00
afc163
6dad2b2987 Merge branch '1.x-stable' 2016-07-11 14:57:38 +08:00
yiminghe
0eabfbef62 Merge branch 'bang88-typings' 2016-07-11 13:05:03 +08:00
yiminghe
d855460eee merge 2016-07-11 13:03:22 +08:00
Benjy Cui
6ee3da59c1 fix: badge scrollnumber 2016-07-11 11:50:34 +08:00
偏右
bb03c89ebf docs: translate badge to english (#2269) 2016-07-11 11:45:42 +08:00
ddcat1115
3c1a9c6939 docs: backTop tranlation (#2244) 2016-07-11 11:40:20 +08:00
Benjy Cui
0fccbd4b1d docs: fix format 2016-07-10 09:14:14 +08:00
偏右
1cf55c2b16 docs: translate affix to english (#1471) (#2219) 2016-07-10 08:56:02 +08:00
陆离
b2ff1dcc75 docs: i18n of Select (#1899) 2016-07-10 08:55:43 +08:00
afc163
158b594526 Merge branch '1.x-stable' 2016-07-09 17:46:11 +08:00
afc163
64b2381759 Merge 1.x-stable 2016-07-09 17:43:31 +08:00
afc163
b9793662ac Merge branch 'master' of github.com:ant-design/ant-design 2016-07-09 16:04:27 +08:00
afc163
28c470cb37 Merge 1.x-stable 2016-07-09 16:03:47 +08:00
yeliex
147e06a837 Add colon props to Form (#2311) 2016-07-09 15:10:07 +08:00
bang
9677a06f38 update tag 2016-07-09 11:00:07 +08:00
bang
414de809ea update tooltip 2016-07-09 10:54:21 +08:00
bang
724ce80b5e update timeline 2016-07-09 10:53:40 +08:00
bang
00710328b1 update timepicker 2016-07-09 10:52:58 +08:00
bang
c36cf9e07e update tag 2016-07-09 10:52:16 +08:00
bang
817bfe9681 update tabs 2016-07-09 10:50:51 +08:00
afc163
94fe25f1b3 Merge 1.x-stable 2016-07-08 17:31:03 +08:00
afc163
f675b636cd Merge 1.x-stable 2016-07-08 16:34:02 +08:00
yiminghe
94706f1d2c fix ts 2016-07-07 20:25:03 +08:00
yiminghe
38d4031987 Merge pull request #2246 from GrayChoi/master
rewrite in typescript
2016-07-07 20:09:09 +08:00
afc163
d68d42f69b Merge 1.x-stable 2016-07-07 17:26:16 +08:00
yiminghe
3d9ae9833e fix form warning 2016-07-07 16:59:47 +08:00
afc163
9ed2a5e803 Merge branch 'master' of github.com:ant-design/ant-design 2016-07-07 15:13:46 +08:00
afc163
487b40815f Merge 1.x-stable 2016-07-07 15:13:01 +08:00
yiminghe
2e9cb53d12 Merge pull request #2277 from rrandom/patch-2
typo in tooltip demo
2016-07-07 12:23:44 +08:00
yiminghe
8c7016c8f9 Merge pull request #2221 from RaoHai/rewriteCheckboxInTs
Rewrite Checkbox in typescript
2016-07-07 12:23:14 +08:00
Rrrandom
fe92f4dc85 typo in tooltip demo 2016-07-06 14:00:09 +08:00
afc163
15f1826889 Merge branch '1.x-stable' 2016-07-05 15:59:56 +08:00
afc163
aac35a8757 Merge branch '1.x-stable' 2016-07-05 15:49:36 +08:00
afc163
4e0956f3e3 should use assign in ts 2016-07-05 10:46:00 +08:00
afc163
d280cba481 Merge 1.x-stable 2016-07-04 15:19:35 +08:00
Benjy Cui
0a73886a9c docs: update demo 2016-07-04 12:13:29 +08:00
Benjy Cui
df2f672dd9 fix: add missing ant-row 2016-07-04 11:29:56 +08:00
ddcat1115
6f526036ed docs: collapse-translation (#2216) 2016-07-04 10:51:50 +08:00
偏右
cdcc10f93d docs: translate Alert document to english (#1471) (#2210) 2016-07-04 10:49:26 +08:00
lixiaochou077
6a616de767 docs: add translation for timeline (#2190) 2016-07-04 10:49:04 +08:00
ddcat1115
1cec962d74 docs: Dropdown-translation (#2136) 2016-07-04 10:48:21 +08:00
Benjy Cui
0869e2959a docs: translate message 2016-07-04 10:44:55 +08:00
Gray Choi
3a36d65c5e rewrite in typescript
#1846

- [x] Carousel
- [x] Cascader
- [x] Transfer
- [x] Tree

-Tree
-checkable is boolean type, instead of assigning a ReactElement to it,
I use Ternary Operators.
2016-07-01 22:03:51 +09:00
Gray Choi
fb9a6963a3 rewrite in typescript
#1846

- [x] Carousel
- [x] Cascader
- [x] Transfer
- [x] Tree

-Tree
 -checkable is boolean type, instead of assigning a ReactElement to it,
I use Ternary Operators.
2016-07-01 21:52:17 +09:00
RaoHai
18f35047ec Rewrite Checkbox in typescript
+ add return type of splitObject
 + rewrite `import React from 'react'` to `import * as React from 'react'`
 + rewrite Checkbox in typescript
2016-06-30 10:05:29 +08:00
Gray Choi
86ae2bda30 Merge remote-tracking branch 'ant-design/master' 2016-06-29 22:28:02 +09:00
warmhug
9eda0a65d1 correct display error 2016-06-29 18:01:52 +08:00
afc163
9bf8c81ec8 fix icon.tsx 2016-06-28 22:22:42 +08:00
afc163
ce654fe282 disable jest temporarily 2016-06-28 22:15:53 +08:00
afc163
11283d01a3 Merge 1.x-stable 2016-06-28 22:14:53 +08:00
Mr.Tone
85141db724 Transfer 组件在render后,马上unmount会报setState错误 (#2206)
* Transfer 组件在render后,马上unmount会报setState错误

如题

* _t => timer
2016-06-28 20:01:02 +08:00
afc163
21fb73d4f2 Merge branch '1.x-stable' 2016-06-28 18:46:23 +08:00
afc163
dfd6e1adce Update ISSUE_TEMPLATE.md 2016-06-27 19:34:35 +08:00
afc163
95351bfffa Merge branch '1.x-stable' 2016-06-27 19:31:38 +08:00
afc163
ef4c1a4749 Merge branch '1.x-stable' 2016-06-27 17:58:16 +08:00
afc163
4ae2455557 Merge branch 'master' of github.com:ant-design/ant-design 2016-06-27 14:38:22 +08:00
afc163
a24634f3ec Merge 1.x-stable 2016-06-27 14:36:19 +08:00
bang88
38b18eef2d refactor(Tooltip): rewrite Tooltip 2016-06-27 00:18:52 +07:00
bang88
d737e7f073 refactor(Timeline): rewrite Timeline 2016-06-27 00:14:50 +07:00
bang88
466e90da3f refactor(TimePicker): rewrite TimePicker 2016-06-27 00:05:32 +07:00
bang88
c198beef85 refactor(Tag): rewrite Tag 2016-06-26 23:57:13 +07:00
bang88
893eec74dd refactor(Tabs): rewrite tabs 2016-06-26 23:03:40 +07:00
yiminghe
a3fc8b052f Merge pull request #2167 from RaoHai/rewriteCollapseInTs
rewrite collapse in typescript
2016-06-24 22:42:31 +08:00
RaoHai
3c4dec27db rewrite collapse in typescript 2016-06-24 15:20:48 +08:00
afc163
619ceffd7e fix createPicker.tsx 2016-06-24 14:43:46 +08:00
afc163
2ffa087aa1 Merge branch '1.x-stable' 2016-06-24 14:33:37 +08:00
afc163
cc4cab5b1e Merge 1.x-stable 2016-06-23 23:11:14 +08:00
yiminghe
be95d3fc23 fix split 2016-06-23 10:57:52 +08:00
afc163
695c26c859 Merge 1.x-stable 2016-06-22 22:56:55 +08:00
afc163
7e25e414f8 fix tc 2016-06-22 18:10:31 +08:00
afc163
419c56ee9e fix tc 2016-06-22 17:30:04 +08:00
yiminghe
7828e373c8 add tslint 2016-06-22 16:42:34 +08:00
yiminghe
8e264f9cc1 preserve for ts 2016-06-22 16:14:47 +08:00
afc163
b2948c8b96 Merge 1.x-stable 2016-06-22 14:33:43 +08:00
yiminghe
f844bc32ee fix dist 2016-06-22 13:31:04 +08:00
yiminghe
9d59add2fe fix dist 2016-06-22 13:29:46 +08:00
yiminghe
9a0d751f94 refactor to typescript 2016-06-22 13:19:48 +08:00
770 changed files with 17721 additions and 10473 deletions

View File

@@ -1,5 +1,3 @@
'use strict';
const eslintrc = {
extends: ['eslint-config-airbnb'],
env: {
@@ -24,18 +22,24 @@ const eslintrc = {
],
rules: {
'func-names': 0,
'prefer-const': 0,
'arrow-body-style': 0,
'react/sort-comp': 0,
'react/prop-types': 0,
'react/jsx-first-prop-new-line': 0,
'react/jsx-filename-extension': [1, { extensions: ['.js', '.jsx', '.md'] }],
'import/no-unresolved': 0,
'import/no-extraneous-dependencies': 0,
'no-param-reassign': 0,
'no-return-assign': 0,
'max-len': 0,
'consistent-return': 0,
'no-redeclare': 0,
}
'react/require-extension': 0,
'react/jsx-indent': 0,
'jsx-a11y/no-static-element-interactions': 0,
'jsx-a11y/anchor-has-content': 0,
'react/no-danger': 0,
},
};
if (process.env.RUN_ENV === 'DEMO') {
@@ -47,10 +51,13 @@ if (process.env.RUN_ENV === 'DEMO') {
Object.assign(eslintrc.rules, {
'no-console': 0,
'no-plusplus': 0,
'eol-last': 0,
'prefer-rest-params': 0,
'react/no-multi-comp': 0,
'react/prefer-es6-class': 0,
'jsx-a11y/href-no-hash': 0,
'import/newline-after-import': 0,
});
}

View File

@@ -1,26 +1,34 @@
<!-- Issue Template For Chinese Users -->
<!-- Issue Template -->
<!-- 请按照下列格式报告问题,务必提供复现步骤,否则恕难解决,感谢您的支持。-->
<!--
antd 的用法咨询,建议通过以下渠道,官方 issues 目前没有足够精力提供此类咨询服务:
#### 本地环境
1. [Stack Overflow](http://stackoverflow.com/questions/tagged/antd)
2. [Segment Fault](https://segmentfault.com/t/antd)(中文)
3. [Gitter](https://gitter.im/ant-design/ant-design)
如果是报告 bug请按照下列格式书写并务必提供复现步骤否则恕难解决感谢您的支持。
-->
#### 发生问题的环境是:
<!-- 务必提供 -->
- antd 版本:
- 操作系统及其版本
- 操作系统及其版本:
- 浏览器及其版本:
#### 做了什么?
#### 做了什么?请提供尽可能详细的重现步骤。
<!-- 引入 antd 了 Button -->
<!-- 如:引入 antd 了 Button -->
#### 期待的结果是
#### 期待的结果是:
<!-- 像官网一样正常显示 -->
<!-- 如:像官网一样正常显示 -->
#### 实际上的结果
#### 实际上的结果是:
<!-- 缺少样式 -->
<!-- 如:样式错位了,最好提供截图 -->
#### 可重现的在线演示

5
.gitignore vendored
View File

@@ -15,6 +15,7 @@ Thumbs.db
*.swp
*.swo
*.log
*.json.gzip
node_modules/
.buildpath
.settings
@@ -26,4 +27,6 @@ dist
/lib
elasticsearch-*
config/base.yaml
typings
components/**/*.js
components/**/*.jsx
/.vscode/

View File

@@ -3,4 +3,4 @@ sudo: false
language: node_js
node_js:
- "5"
- "6"

View File

@@ -1,3 +1,4 @@
Andrew Murray <radarhere@gmail.com>
Benjy Cui <benjytrys@gmail.com>
Bernie <bernie.wangbj@gmail.com>
Bozhao <yubz86@gmail.com>
@@ -6,25 +7,40 @@ Bruno Maia <bruno.mm.maia@gmail.com>
Cam Song <neosoyn@gmail.com>
Cee Cirno <i@cee.moe>
Daqi Song <dqaria@gmail.com>
DengYun <tdzl2003@gmail.com>
Eddie Xie <oeddyo@gmail.com>
Emma <sima.zhang1990@gmail.com>
Eric <84263800@qq.com>
Eward Song <eward.song@gmail.com>
Gray Choi <gray.choi.1988@gmail.com>
Guan Hao <raptium@gmail.com>
Haibin Yu <haibin.yu@oceanwing.com>
Hanai <ihanai1991@gmail.com>
Infinity <305870677@qq.com>
James <james@schoolshape.com>
Jerry Bendy <jerry@icewingcc.com>
KgTong <kgtong1992@gmail.com>
Leon Shi <superRaytin@163.com>
Leon Shi <superRaytin@gmail.com>
Liu Yang <zation1@gmail.com>
MG12 <wuzhao.mail@gmail.com>
Ma Tianxiao <matx2215@outlook.com>
Marius Ileana <visvadw@gmail.com>
Marshall Chen <Juniors.fei@gmail.com>
Mr.Tone <vector@malubei.com>
Neverland <chenjiahan@buaa.edu.cn>
Pyiner <lijiuyang1992@gmail.com>
Qiaosen Huang <joesonw@gmail.com>
RaoHai <surgesoft@gmail.com>
Rrrandom <emanonhere@gmail.com>
Sean Lin <sean@ejoy.com>
Sebastian Blade <blade254353074@hotmail.com>
Shawn Sit <xueqingxiao@gmail.com>
ShiTengFei <shitengfei@goyoo.com>
SimaQ <sima.zhang1990@gmail.com>
The Rock <zhoguoxin@126.com>
Vadim Macagon <vadim.macagon@gmail.com>
Vincent Zhang <vxzhong@qq.com>
Wei Zhu <yesmeck@gmail.com>
Yuwei Ba <i@xiaoba.me>
Zap <a124116186@qq.com>
@@ -33,44 +49,59 @@ bang <sqibang@gmail.com>
bang88 <sqibang@gmail.com>
chencheng (云谦) <sorrycc@gmail.com>
ddcat1115 <ddcat1115@gmail.com>
detailyang <detailyang@gmail.com>
devqin <devqin@gmail.com>
djorkaeff <djorkae55@gmail.com>
ecofe <150641329@qq.com>
elrrrrrrr <elrrrrrrr@gmail.com>
ezpub <ez.foro@gmail.com>
feng zhi hao <fzhihao@outlook.com>
fengmk2 <m@fengmk2.com>
genie <genie88@163.com>
haoxin <coderhaoxin@outlook.com>
hi-caicai <hi@cai-cai.me>
ioldfish <fish.wangl@gmail.com>
jasonslyvia <jasonslyvia@gmail.com>
jiang <155259966@qq.com>
kagawagao <kingsongao1221@gmail.com>
kaifei <150641329@qq.com>
kasinooya <kasinooya@gmail.com>
leon.shi <superRaytin@163.com>
lgmcolin <gengmin.lgm@gmail.com>
lgmcolin <lgmcolin@gmail.com>
lixiaochou077 <qi.liqi07@gmail.com>
lizhaocai <lzc09008@gmail.com>
muzuiget <muzuiget@gmail.com>
pizn <pizner@gmail.com>
plandem <plandem@gmail.com>
popomore <sakura9515@gmail.com>
qubaoming <qubaoming@didichuxing.com>
ryangun <ryangun@foxmail.com>
shelwin <wxfans@gmail.com>
shouyong <enlangs@163.com>
simaQ <sima.zhang1990@gmail.com>
snadn <snadn@snadn.cn>
sorrycc <sorrycc@gmail.com>
swindme <swindme@163.com>
tianli.zhao <275287902@qq.com>
tom <caolvchong@gmail.com>
ustccjw <317713370@qq.com>
warmhug <hualei5280@gmail.com>
wizawu <wizawu@gmail.com>
yeliex <yeliex@yeliex.com>
yiminghe <yiminghe@gmail.com>
yubozhao <yubz86@gmail.com>
yuche <i@yuche.me>
z <haig8@msn.com>
zack <zxyah@126.com>
zhangpc <zhangpc@tenxcloud.com>
zhaocai <lzc09008@gmail.com>
zhujun24 <zhujun87654321@gmail.com>
zilong <jzlxiaohei@163.com>
zinkey <yaya@uloveit.com.cn>
低位 <zhujun87654321@gmail.com>
偏右 <afc163@gmail.com>
白羊座小葛 <abeyuhang@gmail.com>
逸达 <dqaria@gmail.com>
陆离 <surgesoft@gmail.com>
低位 <zhujun87654321@gmail.com>
闲耘™ <hotoo.cn@gmail.com>
白羊座小葛 <abeyuhang@gmail.com>

248
CHANGELOG.en-US.md Normal file
View File

@@ -0,0 +1,248 @@
---
order: 3
title: Change Log
toc: false
timeline: true
---
If you want to read change logs before `2.0.0`, please visit [GitHub](https://github.com/ant-design/ant-design/releases?after=2.0.0).
---
## 2.2.1
`2016-11-02`
* Fix controlled DatePicker[showTime] not working bug. [#3665](https://github.com/ant-design/ant-design/issues/3665)
## 2.2.0
`2016-10-28`
* Supports TypeScript@2.0. [@AlbertZheng](https://github.com/AlbertZheng) [#3358](https://github.com/ant-design/ant-design/issues/3358)
* Not rely on specific version of React now. [#3627](https://github.com/ant-design/ant-design/pull/3627)
* Alert supports `className` `style`.
* DatePicker & MonthPicker & RangePicker allow developers to set whether to show the clear button. [#3618](https://github.com/ant-design/ant-design/issues/3618)
* Form.Item can generate `validateStatus` & `help` for nested form control automatically. [#3212](https://github.com/ant-design/ant-design/issues/3212)
* RangePicker can set some hours or minutes or seconds to be not selectable. [#](https://ant.design/components/date-picker/#components-date-picker-demo-disabled-date)
* Switch
* The width of Switch will resize automatically, according to `checkedChildren/unCheckedChildren`. [#3380](https://github.com/ant-design/ant-design/issues/3380)
* Improve the switch animation.
* Upload can [customized request](https://github.com/react-component/upload#customrequest) now. [@edgji](https://github.com/edgji)
* Icon
* New icons `bulb` `select` `like-o` `dislike-o`.
* Adjust existing icons `loading` `like` `dislike`.
* Improve the TypeScript definition of Card & DatePicker & Icon & Table. [@infeng](https://github.com/infeng) [3468](https://github.com/ant-design/ant-design/pull/3468) [#3603](https://github.com/ant-design/ant-design/pull/3603) [#3531](https://github.com/ant-design/ant-design/pull/3531)
* Fix Cascader `defaultValue` should work. [#3470](https://github.com/ant-design/ant-design/issues/3470)
* Fix the alignment of Button & Input & DatePicker & Select. [#3481](https://github.com/ant-design/ant-design/issues/3481)
* DatePicker
* Fix wrong timing of triggering `onChange` while `DatePicker[showTime]` is set. [#3523](https://github.com/ant-design/ant-design/issues/3523)
* Fix `Dropdown.Button[disabled]` doesn't works for behaviour. [#3535](https://github.com/ant-design/ant-design/issues/3535)
* Menu
* Fix errors in SSR, thanks to [@xpcode](https://github.com/xpcode) to find the solution. [#2061](https://github.com/ant-design/ant-design/issues/2061) [#2406](https://github.com/ant-design/ant-design/issues/2406) [#3293](https://github.com/ant-design/ant-design/issues/3293)
* Fix children don't support `null`. [#3599](https://github.com/ant-design/ant-design/issues/3599)
* Fix loading status animation for message.[#3536](https://github.com/ant-design/ant-design/issues/3536)
* Form
* Fix style issue while using `Form[inline]` and `Input[addonBefore|addonAfter]` together. [#3524](https://github.com/ant-design/ant-design/issues/3524)
* Fix style issue for Radio.Button in Form.Item.
* Fix style issue for search button in Form.Item. [#3630](https://github.com/ant-design/ant-design/issues/3630)
* Fix Form.Item should not treat no user input as validate success. [#3613](https://github.com/ant-design/ant-design/issues/3613)
* Should not limit the min width of Popover while `Popover[title]` is not set.
* Table
* Fix style of fixed header of Table while `dataSource` is empty.[#3567](https://github.com/ant-design/ant-design/issues/3567)
* Fix Table will overlap SubMenu while `dataSource` is empty. [#3521](https://github.com/ant-design/ant-design/issues/3521)
* Tabs
* Height of header of `Tabs[type="card|editable-card"]` should follow design.
* Fix height of TabPane should follow height of its content. [#3304](https://github.com/ant-design/ant-design/issues/3304)
* Fix style of `TreeSelect[showSearch]`. [#3520](https://github.com/ant-design/ant-design/issues/3520)
## 2.1.0
`2016-10-16`
- Supports spinning Icon.
- Tabs's switch animation could be disabled now. [#3324](https://github.com/ant-design/ant-design/issues/3324)
- Add Spanish localization for LocaleProvider. @Danjavia
- Update Russian localization for LocaleProvider. @plandem
- Add `onSelect` event for AutoComplete.
- Improve style of Modal.
- Improve animation of Tooltip.
- Improve style of Transfer's buttons.
- Improve style of Tree.
- Fix some less variables.
- Fix errors while import the whole antd in SSR.
- Fix errors while render Affix and BackTop on server. [#3283](https://github.com/ant-design/ant-design/issues/3283) [#3343](https://github.com/ant-design/ant-design/issues/3343)
- Fix conflicts between Cascader search mode and browser's autocomplete behaviour. [#3350](https://github.com/ant-design/ant-design/issues/3350)
- Fix bug that `h3` cannot be the value of Card[title]. [#3388](https://github.com/ant-design/ant-design/issues/3388)
- DatePicker
- Fix bug that `onChange` will be trigger twice when `showTime` is set. [#3376](https://github.com/ant-design/ant-design/issues/3376)
- Fix differences between overlay's and trigger's date format. [#3405](https://github.com/ant-design/ant-design/issues/3405) [#3298](https://github.com/ant-design/ant-design/issues/3298)
- Fix style conflicts with TimePicker. [#3312](https://github.com/ant-design/ant-design/issues/3312) [#3307](https://github.com/ant-design/ant-design/issues/3307)
- Fix overflow issue for Form.Item label.
- Fix that Icon should not show border in Safari.
- Fix infinite loop while inc/dec InputNubmer with keyboard. [#3239](https://github.com/ant-design/ant-design/issues/3239)
- Fix the style of the arrow of Popover.
- Fix bug Popover and Popconfirm `arrowPointAtCenter` doesn't work.
- Select
- Fix bug that styles of Select are imported twice. [#3332](https://github.com/ant-design/ant-design/issues/3332)
- Fix bug `notFoundContent` cannot be set as `''`. [#3345](https://github.com/ant-design/ant-design/issues/3345)
- Fix the unstable width of table cell with Select[showSearch]. [#3413](https://github.com/ant-design/ant-design/issues/3413)
- Fix style conflicts while use `border` & `title` & `footer` of Table at the same time. [#3301](https://github.com/ant-design/ant-design/issues/3301)
- Fix that the height of TabPane doesn't follow height of content. [#3377](https://github.com/ant-design/ant-design/issues/3377)
- Fix bug Transfer[titles] is not under the control of LocaleProvider. [#3264](https://github.com/ant-design/ant-design/pull/3264)
- Upload
- Fix bug users' `onRemove` will override default behaviour. [#3317](https://github.com/ant-design/ant-design/issues/3317)
- Fix style for `listType='picture-card'`.[#3316](https://github.com/ant-design/ant-design/issues/3316)
- Fix bug that moment locales is not found while built. [#3204](https://github.com/ant-design/ant-design/issues/3204) [#3411](https://github.com/ant-design/ant-design/issues/3411)
## 2.0.1
`2016-10-01`
- Fix developers cannot call methods of react-slick. [#3164](https://github.com/ant-design/ant-design/issues/3164)
- Fix Steps.Step[icon] should support React.ReactNode. [#3159](https://github.com/ant-design/ant-design/issues/3159)
- Fix server-side render for Affix. [#3216](https://github.com/ant-design/ant-design/issues/3216)
- Fix Mention should supoort `onSelect` `placeholder`. [#3236](https://github.com/ant-design/ant-design/issues/3236) [#3226](https://github.com/ant-design/ant-design/issues/3226)
- Fix Transfer cannot work with `getFieldDecorator`.
- Fix LocaleProvider doesn't work for time-related components.
- Fix Cascader doesn't show search text in search mode.
- Fix the animation & text Spin should be placed in vertical middle.
- Fix styles of RangePicker Modal Tag Progress.
## 2.0.0
`2016-09-28`
After four months, `antd@2.0.0` is published. We had refactored code and improve functionalities and details of existing components. What's more, we provide English version of the documentation. The antd community help us a lot in developing `antd@2.0.0`.
If you meet any problem while you try to upgrade from `antd@1.0.0`, feel free to [create issues on GitHub](https://github.com/ant-design/ant-design/issues).
### 2.x Major changes
* Refactor components with TypeScript, and provide **`.d.ts` files which are officially supported**. Thanks to all the developers that contributed to [#1846](https://github.com/ant-design/ant-design/issues/1846) and @infeng.
* **Translate the documentation into English**, and we are going to provide both of Chinese and English versions of the documentation in the future. Thanks to all the translators and reviewers that contributed to [#1471](https://github.com/ant-design/ant-design/issues/1471).
* DatePicker, TimePicker, Calendar and other components that are designed to select time **are refactored to replace [gregorian-calendar](github.com/yiminghe/gregorian-calendar) with [moment](http://momentjs.com/)**.
* All the [icons](http://ant.design/components/icon/) are re-designed.
* New component [Mention](http://ant.design/components/mention/).
* New component [AutoComplete](http://ant.design/components/auto-complete/).
* The `getFieldProps` of Form is replaced with `getFieldDecorator` which will warn developers if they make mistakes. Related discussion [#1533](https://github.com/ant-design/ant-design/issues/1533).
* Table supports [grouping columns](http://ant.design/components/table/#components-table-demo-grouping-columns). @yesmeck
* Removed components and features which are deprecated in `antd@1.x`, such as QueueAnim, Validation, Form.ValueMixin, Progress.Line, Progress.Circle, Popover[overlay] and Slider[marks] will not support array any more.
### 2.x Breaking changes
There are some breaking changes in `antd@2.0.0`, and you need to modify your code to work with it.
* `value` and `defaultValue` of all the time-related components will not support type `String/Date`, please use [moment](http://momentjs.com/):
```diff
- <TimePicker defaultValue="12:08:23" />
+ <TimePicker defaultValue={moment('12:08:23', 'HH:mm:ss')} />
- <DatePicker defaultValue="2015/01/01" />
+ <DatePicker defaultValue={moment('2015/01/01', 'YYYY/MM/DD')} />
- <Calendar defaultValue={new Date('2010-10-10')} />
+ <Calendar defaultValue={moment('2010-10-10', 'YYYY-MM-DD')} />
```
* Parameters of type `Date/GregorianCalendar` of functions such as `onChange` and `onPanelChange`, plus other callback functions had been changed to type moment. Please consult [APIs of gregorian-calendar](https://github.com/yiminghe/gregorian-calendar) and [APIs of moment](http://momentjs.com/docs/), and update your code accordingly. And you can consult this [commit](https://github.com/ant-design/ant-design/commit/5a4ebe535f0353089b30ac331bc4fb7877963371) to see how to upate.
Because the return value of `JSON.stringy(date: moment)` will lost time zone, we should use `.format` to convert date to string first, see related issue [#3082](https://github.com/ant-design/ant-design/issues/3082) for details:
```js
handleSubmit() {
const values = this.props.form.getFieldsValue();
values.date = values.date.format('YYYY-MM-DD HH:mm:ss'); // or other format
const data = JSON.stringify(values);
// send data to server
}
```
* For the value of time-related components becomes an instance of `moment`, you should replace `type: 'date'` with `type: 'object'` in form validation.
* The `format` of time-related components is changed from [gregorian-calendar-format](https://github.com/yiminghe/gregorian-calendar-format#api) to [moment format](http://momentjs.com/docs/#/parsing/string-format/) now, for instance the format `yyyy-MM-dd` should change to `YYYY-MM-DD`.
* `linkRender` and `nameRender` of Breadcrumb are removed, please use `itemRender`.
* `onClose` and `onOpen` of Menu are removed, please use `onOpenChange`. As being totally different, please check [this demo](http://beta.ant.design/components/menu/#components-menu-demo-sider-current) first.
* Paging columns of Table were removed, please use [fixed columns](http://ant.design/components/table/#components-table-demo-fixed-columns).
* `Popover[overlay]` is removed, please use `Popover[content]` instead.
The following change will throw some warnings in the console and it will still work, but we recommend to update your code.
* `getFieldProps` of Form is deprecated, please use `getFieldDecorator`:
```diff
- <Input placeholder="text" {...getFieldProps('userName', { ... })} />
+ {getFieldDecorator('userName', { ... })(
+ <Input placeholder="text" />
+ )}
```
Look up to [#1533](https://github.com/ant-design/ant-design/issues/1533) for related discussion.
* `toggleOpen` of DatePicker is deprecated, please use `onOpenChange`:
```diff
- handleToggleOpen({ open }) {
+ handleOpenChange(open) {
...
}
```
### 2.x Bug fixes
* Dropdown.Button[disabled] should work. [#3070](https://github.com/ant-design/ant-design/issues/3070)
* `option.withRef` of Form.create should work. [#2843](https://github.com/ant-design/ant-design/issues/2843)
* Fix slow response of expanding sub menu in Menu[inline] mode. [#2701](https://github.com/ant-design/ant-design/issues/2701)
* The button of Modal.confirm(and so on) should not be clickable while it is closed asynchronously. [#2684](https://github.com/ant-design/ant-design/issues/2684)
* `format` of DatePicker[showTime] should work. [#3123](https://github.com/ant-design/ant-design/issues/3123)
* Fix Table[dataSource] treat key whose value is `0` as inexisting. [#3166](https://github.com/ant-design/ant-design/pull/3166) @noonnightstorm
* Tree.Node should not show arrow if it has no child nodes. [#2616](https://github.com/ant-design/ant-design/issues/2616)
* Fix cursor style of arrows that are hidden of Tree.Node. [#2748](https://github.com/ant-design/ant-design/issues/2748)
### 2.x Other improvements
* Alert supports [`banner` mode](http://ant.design/components/alert/#components-alert-demo-banner).
* BackTop will scroll to top with animation.
* Badge supports [status dot mode](http://ant.design/components/badge/#components-badge-demo-status).
* Cascader supports [searching options directly](http://ant.design/components/cascader/#components-cascader-demo-search).
* Checkbox supports [indeterminate mode](http://ant.design/components/checkbox/#components-checkbox-demo-check-all).
* Form supports [vertical layout](http://ant.design/components/form/#components-form-demo-validate-customized).
* InputNumber supports long press to increase/decrease number. [#](http://ant.design/components/input-number/#components-input-number-demo-basic)
* notification supports [customized icon](http://ant.design/components/notification/#components-notification-demo-custom-icon).
* Spin allows [customized tips and animation work together](http://ant.design/components/spin/#components-spin-demo-tip). @jerrybendy
* Transfer can handle event while options are checked/unchecked. [#](http://ant.design/components/transfer/#components-transfer-demo-basic)
* Transfer can determine [whether an option is checkable](http://ant.design/components/transfer/#components-transfer-demo-basic).
* Improve style of Alert and notification.
* Modal.confirm(and so on) can be closed by keyboard. @Dafrok
* Improve the user experience of [selecting time in DatePicker](http://ant.design/components/date-picker/#components-date-picker-demo-time).
* Improve the status changed animation of [Spin](http://ant.design/components/spin/#components-spin-demo-nested ).
* Update [font-family](https://github.com/ant-design/ant-design/commit/2f308b0f995cfcb2a3c8feb1e35ffd3f0bf93cfc).
### 2.x Workflow
* [AntD Library](http://library.ant.design/) a collection of Axure files which includes components and patterns that follow Ant Design Specification.
* Rename `babel-plugin-antd` to [`babel-plugin-import`](https://github.com/ant-design/babel-plugin-import), and this means that `babel-plugin-import` becomes an common load-on-demand solution and not just for `antd`.
Please update `package.json`:
```diff
{
"devDependencies": {
- "babel-plugin-antd": "^0.x.x",
+ "babel-plugin-import": "^1.0.0",
}
}
```
And update your babel config in `.babelrc` or other place:
```diff
{
- "plugins": [["antd", { style: "css" }]]
+ "plugins": [["import", { libraryName: "antd", style: "css" }]]
}
```
* [dva@1.0.0](https://github.com/dvajs/dva) is published and it is officially recommended framework [in real world](http://ant.design/docs/react/practical-projects).
* The officially recommended scaffold is [dva-cli](https://github.com/dvajs/dva-cli) now, the old `antd-init` is just for studying and demo.
## 1.0.0
Visit [GitHub](https://github.com/ant-design/ant-design/releases?after=2.0.0) to read change logs from `0.x` to `1.x`。

View File

@@ -9,6 +9,239 @@ timeline: true
---
## 2.2.1
`2016-11-02`
* 修复 Form 中 DatePicker[showTime](受控)无法使用的问题。[#3665](https://github.com/ant-design/ant-design/issues/3665)
## 2.2.0
`2016-10-28`
* 支持 TypeScript@2.0。[@AlbertZheng](https://github.com/AlbertZheng) [#3358](https://github.com/ant-design/ant-design/issues/3358)
* 不再强依赖于 React 特定版本。[#3627](https://github.com/ant-design/ant-design/pull/3627)
* Alert 支持 `className` `style` 属性。
* DatePicker MonthPicker RangePicker 现在允许设置是否显示清除按钮。[#3618](https://github.com/ant-design/ant-design/issues/3618)
* Form.Item 现在可以感知深层嵌套的表单域,以自动为其生成错误信息和状态。[#3212](https://github.com/ant-design/ant-design/issues/3212)
* RangePicker 现在可以设置不可选的时间。[#](https://ant.design/components/date-picker/#components-date-picker-demo-disabled-date)
* Switch
* 宽度现在会随着 `checkedChildren/unCheckedChildren` 自动调整。[#3380](https://github.com/ant-design/ant-design/issues/3380)
* 优化切换动画。
* Upload 现在可以 [自定义上传方式](https://github.com/react-component/upload#customrequest)。[@edgji](https://github.com/edgji)
* Icon
* 新增 `bulb` `select` `like-o` `dislike-o`
* 调整 `loading` `like` `dislike`
* 优化 Card DatePicker Icon Table 的 TypeScript 定义。[@infeng](https://github.com/infeng) [3468](https://github.com/ant-design/ant-design/pull/3468) [#3603](https://github.com/ant-design/ant-design/pull/3603) [#3531](https://github.com/ant-design/ant-design/pull/3531)
* 修复 Cascader `defaultValue` 失效的问题。[#3470](https://github.com/ant-design/ant-design/issues/3470)
* 修复在一行内同时使用 Button Input DatePicker Select 时对齐的问题。[#3481](https://github.com/ant-design/ant-design/issues/3481)
* DatePicker
* 修复设置 `DatePicker[showTime]``onChange` 事件触发时机问题。[#3523](https://github.com/ant-design/ant-design/issues/3523)
* 修复 Dropdown.Button disabled 后仍然响应操作的问题。[#3535](https://github.com/ant-design/ant-design/issues/3535)
* Menu
* 修复服务端渲染问题,感谢 [@xpcode](https://github.com/xpcode) 定位问题。[#2061](https://github.com/ant-design/ant-design/issues/2061) [#2406](https://github.com/ant-design/ant-design/issues/2406) [#3293](https://github.com/ant-design/ant-design/issues/3293)
* 修复 children 不能为 `null` 的问题。[#3599](https://github.com/ant-design/ant-design/issues/3599)
* 修复 message 加载状态无动画的问题。[#3536](https://github.com/ant-design/ant-design/issues/3536)
* Form
* 修复 `Form[inline]``Input[addonBefore|addonAfter]` 一起使用时的样式问题。[#3524](https://github.com/ant-design/ant-design/issues/3524)
* 修复 Form.Item 内 Radio.Button 样式问题。
* 修复 Form.Item 内搜索按钮的样式问题。[#3630](https://github.com/ant-design/ant-design/issues/3630)
* 修复用户无输入时 Form.Item 识别为校验成功的问题。[#3613](https://github.com/ant-design/ant-design/issues/3613)
* 当 `Popover[title]` 没有设置时,不再限制 Popover 的最小宽度。
* Table
* 修复固定表头在没有数据情况下的样式问题。[#3567](https://github.com/ant-design/ant-design/issues/3567)
* 修复无数据时会覆盖 SubMenu 的问题。[#3521](https://github.com/ant-design/ant-design/issues/3521)
* Tabs
* 修复卡片叶签头部高度与设计稿不一致的问题。
* 修复 TabPane 的高度会被同级 TabPane 撑高的问题。[#3304](https://github.com/ant-design/ant-design/issues/3304)
* 修复 `TreeSelect[showSearch]` 样式问题。[#3520](https://github.com/ant-design/ant-design/issues/3520)
## 2.1.0
`2016-10-16`
- Icon 现在支持旋转动画。
- Tabs 现在可以禁用切换动画。[#3324](https://github.com/ant-design/ant-design/issues/3324)
- 新增西班牙语的 localization 支持。@Danjavia
- 更新俄语的 localization 文案。@plandem
- 新增 AutoComplete[onSelect] 回调。
- 优化 Modal 样式细节。
- 优化 Tooltip 动画。
- 优化 Transfer 按钮的样式。
- 优化 Tree 的样式细节。
- 整理和修复了部分 less 变量。
- 修复服务端渲染时全量引入 antd 报错的问题。
- 修复 Affix 与 BackTop 的服务端渲染问题。[#3283](https://github.com/ant-design/ant-design/issues/3283) [#3343](https://github.com/ant-design/ant-design/issues/3343)
- 修复 Card[title] 内无法使用 `h3` 之类的标签的问题。[#3388](https://github.com/ant-design/ant-design/issues/3388)
- 修复 Cascader 搜索模式与浏览器自动完成有冲突的问题。[#3350](https://github.com/ant-design/ant-design/issues/3350)
- DatePicker
- 修复设置 `showTime` 后,`onChange` 重复触发的问题。[#3376](https://github.com/ant-design/ant-design/issues/3376)
- 修复浮层与 Trigger 日期格式不一致的问题。[#3405](https://github.com/ant-design/ant-design/issues/3405) [#3298](https://github.com/ant-design/ant-design/issues/3298)
- 修复与 TimePicker 样式冲突问题。[#3312](https://github.com/ant-design/ant-design/issues/3312) [#3307](https://github.com/ant-design/ant-design/issues/3307)
- 修复 Form.Item 标签文案过长溢出的问题。
- 修复 Icon 在 Safari 下会出现边框的问题。
- 修复 InputNubmer 键盘事件死循环问题。[#3239](https://github.com/ant-design/ant-design/issues/3239)
- 修复 Popover 箭头样式问题。
- 修复 Popover 和 Popconfirm 的 `arrowPointAtCenter` 无效的问题。
- Select
- 修复样式重复引入的问题。[#3376](https://github.com/ant-design/ant-design/issues/3376)
- 修复 `notFoundContent` 无法置空的问题。[#3345](https://github.com/ant-design/ant-design/issues/3345)
- 修复 Table 内使用 Select[showSearch] 后宽度会跳动的问题。[#3413](https://github.com/ant-design/ant-design/issues/3413)
- 修复 Table 边框线与页头页脚冲突的问题。[#3301](https://github.com/ant-design/ant-design/issues/3301)
- 修复 TabPane 高度不随内容变化的问题。[#3377](https://github.com/ant-design/ant-design/issues/3377)
- 修复 Transfer[titles] 不受 LocaleProvider 控制的问题。[#3264](https://github.com/ant-design/ant-design/pull/3264)
- Upload
- 修复用户自定义 `onRemove` 事件会覆盖默认行为的问题。[#3317](https://github.com/ant-design/ant-design/issues/3317)
- 修复图片卡片样式问题。[#3316](https://github.com/ant-design/ant-design/issues/3316)
- 修复项目构建时 moment locales 找不到的问题。[#3204](https://github.com/ant-design/ant-design/issues/3204) [#3411](https://github.com/ant-design/ant-design/issues/3411)
## 2.0.1
`2016-10-01`
- 修复无法调用 react-slick 方法的问题。[#3164](https://github.com/ant-design/ant-design/issues/3164)
- 修复 Steps.Step[icon] 不支持 React.ReactNode 的问题。[#3159](https://github.com/ant-design/ant-design/issues/3159)
- 修复 Affix 不支持服务端渲染的问题。[#3216](https://github.com/ant-design/ant-design/issues/3216)
- 修复 Mention 不支持 `onSelect` `placeholder` 的问题。[#3236](https://github.com/ant-design/ant-design/issues/3236) [#3226](https://github.com/ant-design/ant-design/issues/3226)
- 修复 Transfer 与 `getFieldDecorator` 一起使用时的报错问题。
- 修复 LocaleProvider 对时间组件无效的问题。
- 修复 Cascader 搜索模式搜索文字显示不了的问题。
- 修复 Spin 动画与文案整体不垂直居中的问题。
- 修复 RangePicker Modal Tag Progress 等组件样式问题。
## 2.0.0
`2016-09-28`
很高兴的通知各位,经过四个月时间的紧密开发,`antd@2.0.0` 终于发布了。这个版本我们重构了底层代码,持续完善现有组件功能和优化细节,并提供了英文版的文档,其中很多都来自社区的贡献,无法一一感谢,欢迎各位持续关注和鞭策。在升级过程中遇到任何问题,请及时 [反馈给我们](https://github.com/ant-design/ant-design/issues)。
### 2.x 主要变化
* 开发语言改为 TypeScript提供 **官方支持的 `.d.ts` 文件**,感谢 [#1846](https://github.com/ant-design/ant-design/issues/1846) 中所有参与到这次重构的人以及后期 @infeng 对其的完善。
* **新增英文文档** 以后将同时提供中英双语文档,感谢 [#1471](https://github.com/ant-design/ant-design/issues/1471) 里所有参与到翻译和审阅工作中的人。
* 时间类组件 DatePicker、TimePicker、Calendar 等的底层 **使用 [moment](http://momentjs.com/) 替换 [gregorian-calendar](github.com/yiminghe/gregorian-calendar)**
* 全新设计的 [图标](http://ant.design/components/icon/)。
* 新增提及组件 [Mention](http://ant.design/components/mention/)。
* 新增自动完成组件 [AutoComplete](http://ant.design/components/auto-complete/)。
* Form 新增 `getFieldDecorator` 作为 `getFieldProps` 的替代,对于不正确的使用方式 `getFieldDecorator` 会给出提示,可以降低踩坑的概率。相关讨论见 [#1533](https://github.com/ant-design/ant-design/issues/1533)。
* Table 支持 [表头分组](http://ant.design/components/table/#components-table-demo-grouping-columns)。@yesmeck
* 完全移除 `antd@1.x` 中已经废弃的 QueueAnim、Validation、Form.ValueMixin、Progress.Line、Progress.Circle、Popover[overlay] 及 Slider[marks] 对数组的支持。
### 2.x 不兼容改动
此版本有部分不兼容的改动,升级时确保修改相应的使用代码。
* 时间类组件的 `value``defaultValue` 不再支持 `String/Date` 类型,请使用 [moment](http://momentjs.com/)。
```diff
- <TimePicker defaultValue="12:08:23" />
+ <TimePicker defaultValue={moment('12:08:23', 'HH:mm:ss')} />
- <DatePicker defaultValue="2015/01/01" />
+ <DatePicker defaultValue={moment('2015/01/01', 'YYYY/MM/DD')} />
- <Calendar defaultValue={new Date('2010-10-10')} />
+ <Calendar defaultValue={moment('2010-10-10', 'YYYY-MM-DD')} />
```
* 时间类组件的 `onChange``onPanelChange` 及其他回调函数中为 `Date/GregorianCalendar` 类型的参数,均修改为 moment 类型,两者 API 有所不同,但功能基本一致,请对照 [moment 的 API 文档](http://momentjs.com/docs/) 和 [gregorian-calendar 的文档](https://github.com/yiminghe/gregorian-calendar) 进行修改。你也可以参考这个 [commit](https://github.com/ant-design/ant-design/commit/5a4ebe535f0353089b30ac331bc4fb7877963371) 来进行修改。
由于 `JSON.stringy(date: moment)` 返回的值会丢失时区设置,所以要先使用 `.format` 把日期转成字符串,相关 issue 见 [#3082](https://github.com/ant-design/ant-design/issues/3082)
```js
handleSubmit() {
const values = this.props.form.getFieldsValue();
values.date = values.date.format('YYYY-MM-DD HH:mm:ss'); // 或其它格式
const data = JSON.stringify(values);
// 发送 data 到服务器
}
```
* 时间类组件与表单校验一起使用时,`type: 'date'` 改为 `type: 'object'`
* 时间类组件的 `format` 属性也发生了变化,从 [gregorian-calendar-format 的格式](https://github.com/yiminghe/gregorian-calendar-format#api) 变化为与 [moment 的格式](http://momentjs.com/docs/#/parsing/string-format/),例如原来的 `yyyy-MM-dd` 将变为 `YYYY-MM-DD`
* Breadcrumb 移除 `linkRender``nameRender`,请使用 `itemRender`
* Menu 移除 `onClose` `onOpen`,请使用 `onOpenChange`。API 差异较大,请先研究 [demo](http://beta.ant.design/components/menu/#components-menu-demo-sider-current)。
* Table 移除列分页功能,请使用 [固定列](http://ant.design/components/table/#components-table-demo-fixed-columns)。
* Popover 移除 `overlay` ,请使用 `content`
以下变化升级后旧代码仍然能正常运行,但是控制台会出现警告提示,建议按提示进行修改。
* Form 废弃 `getFieldProps`,请使用 `getFieldDecorator`
```diff
- <Input placeholder="text" {...getFieldProps('userName', { ... })} />
+ {getFieldDecorator('userName', { ... })(
+ <Input placeholder="text" />
+ )}
```
相关讨论可以看 [#1533](https://github.com/ant-design/ant-design/issues/1533)。
* DatePicker 废弃 `toggleOpen`,请使用 `onOpenChange`
```diff
- handleToggleOpen({ open }) {
+ handleOpenChange(open) {
...
}
```
### 2.x Bug 修复
* 修复 Dropdown.Button `disabled` 属性无效的问题。[#3070](https://github.com/ant-design/ant-design/issues/3070)
* 修复 Form.create `withRef` 选项失效的问题。[#2843](https://github.com/ant-design/ant-design/issues/2843)
* 修复 Menu inline 模式下子菜单展开的问题。[#2701](https://github.com/ant-design/ant-design/issues/2701)
* 修复 Modal.confirm 之类的弹窗在异步调用时按钮仍可点击的问题。[#2684](https://github.com/ant-design/ant-design/issues/2684)
* 修复 DatePicker[showTime] 参数中的 `format` 失效的问题。[#3123](https://github.com/ant-design/ant-design/issues/3123)
* 修复 Table[dataSource] 中的项的 key 为 `0` 时识别错误的问题。[#3166](https://github.com/ant-design/ant-design/pull/3166) @noonnightstorm
* 修复 Tree.Node 无子节点时仍然显示箭头的问题。[#2616](https://github.com/ant-design/ant-design/issues/2616)
* 修复 Tree.Node 箭头隐藏后鼠标 hover 上去光标仍会发生变化的问题。[#2748](https://github.com/ant-design/ant-design/issues/2748)
### 2.x 其他改进
* Alert 新增 [`banner` 模式](http://ant.design/components/alert/#components-alert-demo-banner)。
* BackTop 增加回到顶部的动画效果。
* Badge 新增 [状态点模式](http://ant.design/components/badge/#components-badge-demo-status)。
* Cascader 新增 [搜索功能](http://ant.design/components/cascader/#components-cascader-demo-search)。
* Checkbox 新增 [indeterminate 状态](http://ant.design/components/checkbox/#components-checkbox-demo-check-all)。
* Form 新增 [垂直布局](http://ant.design/components/form/#components-form-demo-validate-customized)。
* InputNumber 现在支持长按。[#](http://ant.design/components/input-number/#components-input-number-demo-basic)
* notification 支持 [自定义 icon](http://ant.design/components/notification/#components-notification-demo-custom-icon)。
* Spin 现在允许 [自定义文案与动画共存](http://ant.design/components/spin/#components-spin-demo-tip)。@jerrybendy
* Transfer 现在可以监听用户选择了哪些选项。[#](http://ant.design/components/transfer/#components-transfer-demo-basic)
* Transfer 现在可以定义哪些选项是 [不可选择的](http://ant.design/components/transfer/#components-transfer-demo-basic)。
* 优化 Alert 和 notification 的样式。
* 优化 Modal.confirm 之类的弹窗的键盘交互。@Dafrok
* 优化 [DatePicker 的时间选择](http://ant.design/components/date-picker/#components-date-picker-demo-time) 交互。
* 优化 [Spin 状态切换](http://ant.design/components/spin/#components-spin-demo-nested ) 时的效果。
* 更新 [font-family](https://github.com/ant-design/ant-design/commit/2f308b0f995cfcb2a3c8feb1e35ffd3f0bf93cfc)。
### 2.x 相关工具发布
* 新增配套网站 [AntD Library](http://library.ant.design/),提供遵循 Ant Design 设计规范的组件、模式等的 Axure 资源。
* `babel-plugin-antd` 更名为 [babel-plugin-import](https://github.com/ant-design/babel-plugin-import),标志着该插件将作为一个通用的按需加载方案存在,而不再是 `antd` 专有。
请更新 `package.json`
```diff
{
"devDependencies": {
- "babel-plugin-antd": "^0.x.x",
+ "babel-plugin-import": "^1.0.0",
}
}
```
同时更新 `.babelrc` 或你在其它地方对其的配置:
```diff
{
- "plugins": [["antd", { style: "css" }]]
+ "plugins": [["import", { libraryName: "antd", style: "css" }]]
}
```
* [dva@1.0.0](https://github.com/dvajs/dva) 也已经发布,并推荐 [在实战项目中使用](http://ant.design/docs/react/practical-projects)。
* 脚手架工具推荐使用 [dva-cli](https://github.com/dvajs/dva-cli),原来的 `antd-init` 以后仅会用于学习以及 demo。
## 1.11.2
`2016-09-26`

1
CNAME
View File

@@ -1 +0,0 @@
ant.design

View File

@@ -4,7 +4,13 @@
</a>
</p>
# Ant Design [![](https://img.shields.io/travis/ant-design/ant-design.svg?style=flat-square)](https://travis-ci.org/ant-design/ant-design) [![npm package](https://img.shields.io/npm/v/antd.svg?style=flat-square)](https://www.npmjs.org/package/antd) [![NPM downloads](http://img.shields.io/npm/dm/antd.svg?style=flat-square)](https://npmjs.org/package/antd) [![Dependency Status](https://david-dm.org/ant-design/ant-design.svg?style=flat-square)](https://david-dm.org/ant-design/ant-design) [![Join the chat at https://gitter.im/ant-design/ant-design](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/ant-design/ant-design?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
# Ant Design
[![](https://img.shields.io/travis/ant-design/ant-design.svg?style=flat-square)](https://travis-ci.org/ant-design/ant-design)
[![npm package](https://img.shields.io/npm/v/antd.svg?style=flat-square)](https://www.npmjs.org/package/antd)
[![NPM downloads](http://img.shields.io/npm/dm/antd.svg?style=flat-square)](https://npmjs.org/package/antd)
[![CDNJS](https://img.shields.io/cdnjs/v/antd.svg?style=flat-square)](https://cdnjs.com/libraries/antd)
[![Dependency Status](https://david-dm.org/ant-design/ant-design.svg?style=flat-square)](https://david-dm.org/ant-design/ant-design)
[![Join the chat at https://gitter.im/ant-design/ant-design](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/ant-design/ant-design?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
一套企业级的 UI 设计语言和 React 实现。
@@ -12,7 +18,8 @@
- 提炼和服务企业级中后台产品的交互语言和视觉风格。
- [React Component](http://react-component.github.io/badgeboard/) 基础上精心封装的高质量 UI 组件。
- 基于 npm + webpack + babel 的工作流,支持 ES2015 和 TypeScript
- 使用 TypeScript 构建,提供完整的类型定义文件
- 基于 npm + webpack + babel + [dora](https://github.com/dora-js/dora) + [dva](https://github.com/dvajs/dva) 的企业级业务开发框架。
## 安装
@@ -33,27 +40,34 @@ ReactDOM.render(<DatePicker />, mountNode);
import 'antd/dist/antd.css'; // or 'antd/dist/antd.less'
```
按需加载可通过此写法 `import DatePicker from 'antd/lib/date-picker'` 或使用插件 [babel-plugin-antd](https://github.com/ant-design/babel-plugin-antd)。
按需加载可通过此写法 `import DatePicker from 'antd/lib/date-picker'` 或使用插件 [babel-plugin-import](https://github.com/ant-design/babel-plugin-import)。
## 浏览器支持
现代浏览器和 IE8 及以上。
现代浏览器和 IE9 及以上。
> [IE8 issues](https://github.com/xcatliu/react-ie8)
## TypeScript
```js
///<reference path='./node_modules/antd/type-definitions/antd.d.ts'/>
...
tsconfig.json
```
{
"compilerOptions": {
"moduleResolution": "node",
"jsx": "preserve",
"allowSyntheticDefaultImports": true
}
}
```
## 链接
- [首页](http://ant.design/)
- [React 实现](http://ant.design/#/docs/react/introduce)
- [修改记录](CHANGELOG.md)
- [React 实现](http://ant.design/docs/react/introduce)
- [修改记录](CHANGELOG.zh-CN.md)
- [开发脚手架](https://github.com/ant-design/antd-init/)
- [开发工具文档](http://ant-tool.github.io/)
- [React 基础组件](http://react-component.github.io/)
@@ -67,7 +81,6 @@ import 'antd/dist/antd.css'; // or 'antd/dist/antd.less'
- [CodePen 模板](http://codepen.io/benjycui/pen/KgPZrE?editors=001)
- [Awesome Ant Design](https://github.com/websemantics/awesome-ant-design)
## 如何贡献
我们欢迎任何形式的贡献,有任何建议或意见您可以进行 [Pull Request](https://github.com/ant-design/ant-design/pulls),或者给我们 [提问](https://github.com/ant-design/ant-design/issues)。

View File

@@ -4,19 +4,22 @@
</a>
</p>
# Ant Design [![](https://img.shields.io/travis/ant-design/ant-design.svg?style=flat-square)](https://travis-ci.org/ant-design/ant-design) [![npm package](https://img.shields.io/npm/v/antd.svg?style=flat-square)](https://www.npmjs.org/package/antd) [![NPM downloads](http://img.shields.io/npm/dm/antd.svg?style=flat-square)](https://npmjs.org/package/antd) [![Dependency Status](https://david-dm.org/ant-design/ant-design.svg?style=flat-square)](https://david-dm.org/ant-design/ant-design) [![Join the chat at https://gitter.im/ant-design/ant-design](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/ant-design/ant-design?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
# Ant Design
[![](https://img.shields.io/travis/ant-design/ant-design.svg?style=flat-square)](https://travis-ci.org/ant-design/ant-design)
[![npm package](https://img.shields.io/npm/v/antd.svg?style=flat-square)](https://www.npmjs.org/package/antd)
[![NPM downloads](http://img.shields.io/npm/dm/antd.svg?style=flat-square)](https://npmjs.org/package/antd)
[![CDNJS](https://img.shields.io/cdnjs/v/antd.svg?style=flat-square)](https://cdnjs.com/libraries/antd)
[![Dependency Status](https://david-dm.org/ant-design/ant-design.svg?style=flat-square)](https://david-dm.org/ant-design/ant-design)
[![Join the chat at https://gitter.im/ant-design/ant-design](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/ant-design/ant-design?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
An enterprise-class UI design language and React-based implementation.
## :loudspeaker: Document Translation Recruitment
We are now working on translate components document to English, and we need some translator and reviewer. https://github.com/ant-design/ant-design/issues/1471
## Features
- An enterprise-class design language and high quality UI.
- Graceful UI components out of the box, base on [React Component](http://react-component.github.io/badgeboard/).
- A npm + webpack + babel + dora [workflow](http://ant-tool.github.io/index.html).
- Writen in TypeScript with complete define types.
- A npm + webpack + babel + [dora](https://github.com/dora-js/dora) + [dva](https://github.com/dvajs/dva) development framework.
## Install
@@ -41,19 +44,19 @@ import 'antd/dist/antd.css'; // or 'antd/dist/antd.less'
### Use modularized antd
- Use [babel-plugin-antd](https://github.com/ant-design/babel-plugin-antd) (Recommended)
- Use [babel-plugin-import](https://github.com/ant-design/babel-plugin-import) (Recommended)
```js
// .babelrc
{
"plugins": [["antd", { style: "css" }]]
"plugins": [["import", { libraryName: "antd", style: "css" }]]
}
```
Then you can import components from antd directly.
```jsx
// import js and css modularly, parsed by babel-plugin-antd
// import js and css modularly, parsed by babel-plugin-import
import { DatePicker } from 'antd';
```
@@ -61,12 +64,13 @@ import 'antd/dist/antd.css'; // or 'antd/dist/antd.less'
```jsx
import DatePicker from 'antd/lib/date-picker'; // just for js
import 'antd/lib/date-picker/style/css'; // with style
```
## Browser Support
Normal browsers and Internet Explorer 8+.
Normal browsers and Internet Explorer 9+.
> [IE8 issues](https://github.com/xcatliu/react-ie8)
@@ -78,7 +82,8 @@ tsconfig.json
{
"compilerOptions": {
"moduleResolution": "node",
"jsx": "preserve"
"jsx": "preserve",
"allowSyntheticDefaultImports": true
}
}
```
@@ -86,8 +91,8 @@ tsconfig.json
## Links
- [Home page](http://ant.design/)
- [React UI page](http://ant.design/#/docs/react/introduce)
- [ChangeLog](CHANGELOG.md)
- [UI library](http://ant.design/docs/react/introduce)
- [ChangeLog](CHANGELOG.en-US.md)
- [Scaffold tool](https://github.com/ant-design/antd-init/)
- [Development tool](http://ant-tool.github.io/)
- [React components](http://react-component.github.io/)

View File

@@ -0,0 +1,10 @@
import assign from 'object-assign';
export default function getLocale(props, context, componentName, getDefaultLocale) {
const locale = context && context.antLocale && context.antLocale[componentName] ?
context.antLocale[componentName] : getDefaultLocale();
const result = assign({}, locale, props.locale);
result.lang = assign({}, locale.lang, props.locale.lang);
return result;
}

View File

@@ -0,0 +1,12 @@
export default function getRequestAnimationFrame() {
if (typeof window === 'undefined') {
return () => {};
}
if (window.requestAnimationFrame) {
return window.requestAnimationFrame;
}
const prefix = ['moz', 'ms', 'webkit'].filter(key => `${key}RequestAnimationFrame` in window)[0];
return prefix
? window[`${prefix}RequestAnimationFrame`]
: callback => setTimeout(callback, 1000 / 60);
}

View File

@@ -0,0 +1,17 @@
export default function getScroll(target, top): number {
if (typeof window === 'undefined') {
return 0;
}
const prop = top ? 'pageYOffset' : 'pageXOffset';
const method = top ? 'scrollTop' : 'scrollLeft';
const isWindow = target === window;
let ret = isWindow ? target[prop] : target[method];
// ie6,7,8 standard mode
if (isWindow && typeof ret !== 'number') {
ret = window.document.documentElement[method];
}
return ret;
}

View File

@@ -0,0 +1,12 @@
export default function splitObject(obj, parts): Array<any> {
const left = {};
const right = {};
Object.keys(obj).forEach((k) => {
if (parts.indexOf(k) !== -1) {
left[k] = obj[k];
} else {
right[k] = obj[k];
}
});
return [left, right];
}

View File

@@ -1,16 +1,24 @@
---
order: 0
title: 基本
title:
zh-CN: 基本
en-US: Basic
---
## zh-CN
最简单的用法。
## en-US
The simplest usage.
````jsx
import { Affix, Button } from 'antd';
ReactDOM.render(
<Affix>
<Button type="primary">固定在顶部</Button>
<Button type="primary">Affix top</Button>
</Affix>
, mountNode);
````

View File

@@ -1,16 +1,24 @@
---
order: 2
title: 下方固定
title:
zh-CN: 下方固定
en-US: Bottom
---
固定在屏幕下方
## zh-CN
固定在屏幕下方。
## en-US
Affix to bottom.
````jsx
import { Affix, Button } from 'antd';
ReactDOM.render(
<Affix offsetBottom={20}>
<Button type="primary">固定在距离底部 20px 的位置</Button>
<Button type="primary">20px to affix bottom</Button>
</Affix>
, mountNode);
````

View File

@@ -1,16 +1,24 @@
---
order: 1
title: 偏移
title:
zh-CN: 偏移
en-US: Offset
---
## zh-CN
达到一定的偏移量才触发。
## en-US
Affix element according to offset value.
````jsx
import { Affix, Button } from 'antd';
ReactDOM.render(
<Affix offsetTop={75}>
<Button type="primary">固定在距离顶部 75px 的位置</Button>
<Button type="primary">75px to affix top</Button>
</Affix>
, mountNode);
````

View File

@@ -1,16 +1,24 @@
---
order: 3
title: 固定状态改变的回调
title:
zh-CN: 固定状态改变的回调
en-US: Callback
---
## zh-CN
可以获得是否固定的状态。
## en-US
Callback with affixed state.
````jsx
import { Affix, Button } from 'antd';
ReactDOM.render(
<Affix offsetTop={120} onChange={affixed => console.log(affixed)}>
<Button>固定在距离顶部 120px 的位置</Button>
<Button>120px to affix top</Button>
</Affix>
, mountNode);
````

View File

@@ -1,10 +1,18 @@
---
order: 4
title: 参考对象
title:
zh-CN: 滚动容器
en-US: Container to scroll.
---
## zh-CN
`target` 设置 `Affix` 需要监听其滚动事件的元素,默认为 `window`
## en-US
Set a `target` for 'Affix', which is listen to scroll event of target element (default is `window`).
````jsx
import { Affix, Button } from 'antd';
@@ -17,7 +25,7 @@ const Demo = () => {
<br />
<br />
<Affix target={() => document.getElementById('affix-target')} offsetTop={20}>
<Button type="primary">固定在容器顶部</Button>
<Button type="primary">Fixed at the top of container</Button>
</Affix>
</div>
</div>

View File

@@ -0,0 +1,29 @@
---
category: Components
type: Other
title: Affix
---
Make an element sticky to viewport.
## When To Use
When user browses a long web page, some content need to sticky to viewport. It is common for menus and actions.
Please note that Affix should not cover other content in page, especially when the size of viewport is small.
## API
| 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 | - |
| onChange | Callback when affix state is changed | Function(affixed) | - |
**Note:** Children of `Affix` can not be `position: absolute`, but you can set `Affix` as `position: absolute`:
```jsx
<Affix style={{ position: 'absolute', top: y, left: x}}>
...
</Affix>
```

View File

@@ -2,30 +2,17 @@ import React from 'react';
import ReactDOM from 'react-dom';
import addEventListener from 'rc-util/lib/Dom/addEventListener';
import classNames from 'classnames';
import warning from 'warning';
import shallowequal from 'shallowequal';
import omit from 'omit.js';
import getScroll from '../_util/getScroll';
function getScroll(target, top) {
const prop = top ? 'pageYOffset' : 'pageXOffset';
const method = top ? 'scrollTop' : 'scrollLeft';
const isWindow = target === window;
let ret = isWindow ? target[prop] : target[method];
// ie6,7,8 standard mode
if (isWindow && typeof ret !== 'number') {
ret = window.document.documentElement[method];
}
return ret;
}
function getTargetRect(target) {
function getTargetRect(target): ClientRect {
return target !== window ?
target.getBoundingClientRect() :
{ top: 0, left: 0, bottom: 0 };
}
function getOffset(element, target) {
function getOffset(element: HTMLElement, target) {
const elemRect = element.getBoundingClientRect();
const targetRect = getTargetRect(target);
@@ -44,19 +31,42 @@ function getOffset(element, target) {
};
}
export default class Affix extends React.Component {
function noop() {}
function getDefaultTarget() {
return typeof window !== 'undefined' ?
window : null;
};
// Affix
export interface AffixProps {
/**
*
*/
offsetTop?: number;
offset?: number;
/** 距离窗口底部达到指定偏移量后触发 */
offsetBottom?: number;
style?: React.CSSProperties;
/** 固定状态改变时触发的回调函数 */
onChange?: (affixed?: boolean) => void;
/** 设置 Affix 需要监听其滚动事件的元素,值为一个返回对应 DOM 元素的函数 */
target?: () => Window | HTMLElement;
prefixCls?: string;
}
export default class Affix extends React.Component<AffixProps, any> {
static propTypes = {
offsetTop: React.PropTypes.number,
offsetBottom: React.PropTypes.number,
target: React.PropTypes.func,
}
};
static defaultProps = {
target() {
return window;
},
onChange() {},
}
scrollEvent: any;
resizeEvent: any;
refs: {
fixedNode: HTMLElement;
};
constructor(props) {
super(props);
@@ -67,7 +77,7 @@ export default class Affix extends React.Component {
}
setAffixStyle(e, affixStyle) {
const { onChange, target } = this.props;
const { onChange = noop, target = getDefaultTarget } = this.props;
const originalAffixStyle = this.state.affixStyle;
const isWindow = target() === window;
if (e.type === 'scroll' && originalAffixStyle && affixStyle && isWindow) {
@@ -97,19 +107,23 @@ export default class Affix extends React.Component {
}
updatePosition = (e) => {
let { offsetTop, offsetBottom, offset, target } = this.props;
let { offsetTop, offsetBottom, offset, target = getDefaultTarget } = this.props;
const targetNode = target();
// Backwards support
offsetTop = offsetTop || offset;
const scrollTop = getScroll(targetNode, true);
const elemOffset = getOffset(ReactDOM.findDOMNode(this), targetNode);
const affixNode = ReactDOM.findDOMNode(this) as HTMLElement;
const elemOffset = getOffset(affixNode, targetNode);
const elemSize = {
width: this.refs.fixedNode.offsetWidth,
height: this.refs.fixedNode.offsetHeight,
};
const offsetMode = {};
const offsetMode = {
top: false,
bottom: false,
};
// Default to `offsetTop=0`.
if (typeof offsetTop !== 'number' && typeof offsetBottom !== 'number') {
offsetMode.top = true;
@@ -120,18 +134,19 @@ export default class Affix extends React.Component {
}
const targetRect = getTargetRect(targetNode);
const targetInnerHeight = targetNode.innerHeight || targetNode.clientHeight;
const targetInnerHeight =
(targetNode as Window).innerHeight || (targetNode as HTMLElement).clientHeight;
if (scrollTop > elemOffset.top - offsetTop && offsetMode.top) {
// Fixed Top
this.setAffixStyle(e, {
position: 'fixed',
top: targetRect.top + offsetTop,
left: targetRect.left + elemOffset.left,
width: ReactDOM.findDOMNode(this).offsetWidth,
width: affixNode.offsetWidth,
});
this.setPlaceholderStyle(e, {
width: ReactDOM.findDOMNode(this).offsetWidth,
height: ReactDOM.findDOMNode(this).offsetHeight,
width: affixNode.offsetWidth,
height: affixNode.offsetHeight,
});
} else if (
scrollTop < elemOffset.top + elemSize.height + offsetBottom - targetInnerHeight &&
@@ -143,11 +158,11 @@ export default class Affix extends React.Component {
position: 'fixed',
bottom: targetBottomOffet + offsetBottom,
left: targetRect.left + elemOffset.left,
width: ReactDOM.findDOMNode(this).offsetWidth,
width: affixNode.offsetWidth,
});
this.setPlaceholderStyle(e, {
width: ReactDOM.findDOMNode(this).offsetWidth,
height: ReactDOM.findDOMNode(this).offsetHeight,
width: affixNode.offsetWidth,
height: affixNode.offsetHeight,
});
} else {
this.setAffixStyle(e, null);
@@ -156,9 +171,7 @@ export default class Affix extends React.Component {
}
componentDidMount() {
warning(!('offset' in this.props), '`offset` prop of Affix is deprecated, use `offsetTop` instead.');
const target = this.props.target;
const target = this.props.target || getDefaultTarget;
this.setTargetEventListeners(target);
}
@@ -192,13 +205,10 @@ export default class Affix extends React.Component {
render() {
const className = classNames({
'ant-affix': this.state.affixStyle,
[this.props.prefixCls || 'ant-affix']: this.state.affixStyle,
});
const props = { ...this.props };
delete props.offsetTop;
delete props.offsetBottom;
delete props.target;
const props = omit(this.props, ['prefixCls', 'offsetTop', 'offsetBottom', 'target']);
return (
<div {...props} style={this.state.placeholderStyle}>

View File

@@ -1,8 +1,8 @@
---
category: Components
chinese: 固钉
subtitle: 固钉
type: Other
english: Affix
title: Affix
---
将页面元素钉在可视范围。
@@ -15,10 +15,17 @@ english: Affix
## API
| 成员 | 说明 | 类型 | 默认值 |
|-------------|----------------|--------------------|--------------|
| offsetTop | 距离窗口顶部达到指定偏移量后触发 | Number | |
| offsetBottom | 距离窗口底部达到指定偏移量后触发 | Number | |
| target | 设置 `Affix` 需要监听其滚动事件的元素,值为一个返回对应 DOM 元素的函数 | Function | () => window |
| onChange | 固定状态改变时触发的回调函数 | Function | 无 |
| onChange | 固定状态改变时触发的回调函数 | Function(affixed) | 无 |
**注意:**`Affix` 内的元素不要使用绝对定位,如需要绝对定位的效果,可以直接设置 `Affix` 为绝对定位:
```jsx
<Affix style={{ position: 'absolute', top: y, left: x}}>
...
</Affix>
```

View File

@@ -1,6 +1,6 @@
@import "../../style/themes/default";
.ant-affix {
.@{ant-prefix}-affix {
position: fixed;
z-index: @zindex-affix;
}

View File

@@ -0,0 +1,26 @@
---
order: 6
title:
zh-CN: 顶部公告
en-US: Banner
---
## zh-CN
用作顶部公告时,默认有图标,`type` 为 'warning',并有特殊样式。
## en-US
When `Alert` is used as banner, it has particular style, Icon and `type`(warning) are specified by default.
````jsx
import { Alert } from 'antd';
ReactDOM.render(
<div>
<Alert message="Warning text" banner />
<br />
<Alert message="Very long warning text warning text text text text text text text" banner closable />
</div>
, mountNode);
````

View File

@@ -1,13 +1,22 @@
---
order: 0
title: 基本
title:
zh-CN: 基本
en-US: Basic
---
## zh-CN
最简单的用法,适用于简短的警告提示。
## en-US
The simplest usage for short messages.
````jsx
import { Alert } from 'antd';
ReactDOM.render(<Alert message="成功提示的文案" type="success" />
ReactDOM.render(
<Alert message="Success Text" type="success" />
, mountNode);
````

View File

@@ -1,25 +1,33 @@
---
order: 2
title: 可关闭的警告提示
title:
zh-CN: 可关闭的警告提示
en-US: Closable
---
## zh-CN
显示关闭按钮,点击可关闭警告提示。
## en-US
To show close button.
````jsx
import { Alert } from 'antd';
const onClose = function (e) {
console.log(e, '我要被关闭啦!');
console.log(e, 'I was closed.');
};
ReactDOM.render(<div>
<Alert message="警告提示的文案"
<Alert message="Warning Text Warning Text Warning TextW arning Text Warning Text Warning TextWarning Text"
type="warning"
closable
onClose={onClose}
/>
<Alert message="错误提示的文案"
description="错误提示的辅助性文字介绍错误提示的辅助性文字介绍错误提示的辅助性文字介绍错误提示的辅助性文字介绍错误提示的辅助性文字介绍错误提示的辅助性文字介绍"
<Alert message="Error Text"
description="Error Description Error Description Error Description Error Description Error Description Error Description"
type="error"
closable
onClose={onClose}

View File

@@ -1,14 +1,22 @@
---
order: 5
title: 自定义关闭
title:
zh-CN: 自定义关闭
en-US: Customized Close Text
---
## zh-CN
可以自定义关闭,自定义的文字会替换原先的关闭 `Icon`
## en-US
Replace the default icon with customized text.
````jsx
import { Alert } from 'antd';
ReactDOM.render(
<Alert message="消息提示的文案" type="info" closeText="不再提醒" />
<Alert message="Info Text" type="info" closeText="Close Now" />
, mountNode);
````

View File

@@ -1,30 +1,40 @@
---
order: 3
title: 含有辅助性文字介绍
title:
zh-CN: 含有辅助性文字介绍
en-US: Description
---
## zh-CN
含有辅助性文字介绍的警告提示。
## en-US
Additional description for alert message.
````jsx
import { Alert } from 'antd';
ReactDOM.render(<div>
<Alert message="成功提示的文案"
description="成功提示的辅助性文字介绍成功提示的辅助性文字介绍成功提示的辅助性文字介绍成功提示的辅助性文字介绍"
<Alert
message="Success Text"
description="Success Description Success Description Success Description"
type="success"
/>
<Alert message="消息提示的文案"
description="消息提示的辅助性文字介绍消息提示的辅助性文字介绍消息提示的辅助性文字介绍"
<Alert
message="Info Text"
description="Info Description Info Description Info Description Info Description"
type="info"
/>
<Alert
message="警告提示的文案"
description="警告提示的辅助性文字介绍警告提示的辅助性文字介绍"
message="Warning Text"
description="Warning Description Warning Description Warning Description Warning Description"
type="warning"
/>
<Alert
message="错误提示的文案"
description="错误提示的辅助性文字介绍错误提示的辅助性文字介绍错误提示的辅助性文字介绍错误提示的辅助性文字介绍错误提示的辅助性文字介绍错误提示的辅助性文字介绍"
message="Error Text"
description="Error Description Error Description Error Description Error Description"
type="error"
/>
</div>, mountNode);

View File

@@ -1,37 +1,47 @@
---
order: 4
title: 图标
title:
zh-CN: 图标
en-US: Icon
---
## zh-CN
可口的图标让信息类型更加醒目。
## en-US
Decent icon make information more clear and more friendly.
````jsx
import { Alert } from 'antd';
ReactDOM.render(<div>
<Alert message="成功提示的文案" type="success" showIcon />
<Alert message="消息提示的文案" type="info" showIcon />
<Alert message="警告提示的文案" type="warning" showIcon />
<Alert message="错误提示的文案" type="error" showIcon />
<Alert message="成功提示的文案"
description="成功提示的辅助性文字介绍成功提示的辅助性文字介绍成功提示的辅助性文字介绍成功提示的辅助性文字介绍"
<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="消息提示的文案"
description="消息提示的辅助性文字介绍消息提示的辅助性文字介绍消息提示的辅助性文字介绍"
<Alert
message="Informational Notes"
description="Additional description and informations about copywriting."
type="info"
showIcon
/>
<Alert
message="警告提示的文案"
description="警告提示的辅助性文字介绍警告提示的辅助性文字介绍"
message="Warning"
description="This is a warning notice about copywriting."
type="warning"
showIcon
/>
<Alert
message="错误提示的文案"
description="错误提示的辅助性文字介绍错误提示的辅助性文字介绍错误提示的辅助性文字介绍错误提示的辅助性文字介绍错误提示的辅助性文字介绍错误提示的辅助性文字介绍"
message="Error"
description="This is an error message about copywriting."
type="error"
showIcon
/>

View File

@@ -1,17 +1,25 @@
---
order: 1
title: 四种样式
title:
zh-CN: 四种样式
en-US: More types
---
## zh-CN
共有四种样式 `success``info``warning``error`
## en-US
There are 4 types of Alert: `success`, `info`, `warning`, `error`.
````jsx
import { Alert } from 'antd';
ReactDOM.render(<div>
<Alert message="成功提示的文案" type="success" />
<Alert message="消息提示的文案" type="info" />
<Alert message="警告提示的文案" type="warning" />
<Alert message="错误提示的文案" type="error" />
<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

@@ -0,0 +1,25 @@
---
category: Components
type: Views
title: Alert
---
Alert component for feedback.
## When To Use
- When you need to show alert messages for users.
- When you need a persist static container, and closable by user actions.
## API
| Property | Description | Type | Default |
|----------- |--------------------------------------------------------- | ---------- |-------|
| type | Type of Alert styles, options:`success`, `info`, `warning`, `error` | String | `info` |
| closable | Whether Alert can be closed | Boolean | - |
| closeText | Close text to show | React.Node | - |
| message | Content of Alert | React.Node | - |
| description | Additional content of Alert | React.Node | - |
| onClose | Callback when close Alert | Function | - |
| showIcon | Whether to show icon | Boolean | false |
| banner | Whether to show as banner | Boolean | false |

View File

@@ -1,25 +0,0 @@
---
category: Components
chinese: 警告提示
type: Views
english: Alert
---
警告提示,展现需要关注的信息。
## 何时使用
- 当某个页面需要向用户显示警告的信息时。
- 非浮层的静态展现形式,始终展现,不会自动消失,用户可以点击关闭。
## API
| 参数 | 说明 | 类型 | 默认值 |
|----------- |--------------------------------------------------------- | ---------- |-------|
| type | 必选参数,指定警告提示的样式,有四种选择 `success``info``warning``error` | String | `info` |
| closable | 可选参数,默认不显示关闭按钮 | Boolean | 无 |
| closeText | 可选参数,自定义关闭按钮 | React.Node | 无 |
| message | 必选参数,警告提示内容 | React.Node | 无 |
| description | 可选参数,警告提示的辅助性文字介绍 | React.Node | 无 |
| onClose | 可选参数,关闭时触发的回调函数 | Function | 无 |
| showIcon | 可选参数,是否显示辅助图标 | Boolean | false |

View File

@@ -4,13 +4,35 @@ import Animate from 'rc-animate';
import Icon from '../icon';
import classNames from 'classnames';
export default class Alert extends React.Component {
function noop() {}
export interface AlertProps {
/**
* Type of Alert styles, options:`success`, `info`, `warning`, `error`
*/
type?: 'success' | 'info' | 'warning' | 'error';
/** Whether Alert can be closed */
closable?: boolean;
/** Close text to show */
closeText?: React.ReactNode;
/** Content of Alert */
message: React.ReactNode;
/** Additional content of Alert */
description?: React.ReactNode;
/** Callback when close Alert */
onClose?: React.MouseEventHandler<any>;
/** Whether to show icon */
showIcon?: boolean;
style?: React.CSSProperties;
prefixCls?: string;
className?: string;
banner?: boolean;
}
export default class Alert extends React.Component<AlertProps, any> {
static defaultProps = {
prefixCls: 'ant-alert',
showIcon: false,
onClose() {},
type: 'info',
}
};
constructor(props) {
super(props);
this.state = {
@@ -20,7 +42,7 @@ export default class Alert extends React.Component {
}
handleClose = (e) => {
e.preventDefault();
let dom = ReactDOM.findDOMNode(this);
let dom = ReactDOM.findDOMNode(this) as HTMLElement;
dom.style.height = `${dom.offsetHeight}px`;
// Magic code
// 重复一次后才能正确设置 height
@@ -29,7 +51,7 @@ export default class Alert extends React.Component {
this.setState({
closing: false,
});
this.props.onClose(e);
(this.props.onClose || noop)(e);
}
animationEnd = () => {
this.setState({
@@ -39,9 +61,15 @@ export default class Alert extends React.Component {
}
render() {
let {
closable, description, type, prefixCls, message, closeText, showIcon,
closable, description, type, prefixCls = 'ant-alert', message, closeText, showIcon, banner,
className = '', style,
} = this.props;
// banner模式默认有 Icon
showIcon = showIcon || banner;
// banner模式默认为警告
type = banner ? 'warning' : type;
let iconType = '';
switch (type) {
case 'success':
@@ -71,6 +99,8 @@ export default class Alert extends React.Component {
[`${prefixCls}-close`]: !this.state.closing,
[`${prefixCls}-with-description`]: !!description,
[`${prefixCls}-no-icon`]: !showIcon,
[`${prefixCls}-banner`]: !!banner,
[className]: !!className,
});
// closeable when closeText is assigned
@@ -79,13 +109,14 @@ export default class Alert extends React.Component {
}
return this.state.closed ? null : (
<Animate component=""
<Animate
component=""
showProp="data-show"
transitionName={`${prefixCls}-slide-up`}
onEnd={this.animationEnd}
>
<div data-show={this.state.closing} className={alertCls}>
{showIcon ? <Icon className="ant-alert-icon" type={iconType} /> : null}
<div data-show={this.state.closing} className={alertCls} style={style}>
{showIcon ? <Icon className={`${prefixCls}-icon`} type={iconType} /> : null}
<span className={`${prefixCls}-message`}>{message}</span>
<span className={`${prefixCls}-description`}>{description}</span>
{closable ? <a onClick={this.handleClose} className={`${prefixCls}-close-icon`}>

View File

@@ -0,0 +1,27 @@
---
category: Components
subtitle: 警告提示
type: Views
title: Alert
---
警告提示,展现需要关注的信息。
## 何时使用
- 当某个页面需要向用户显示警告的信息时。
- 非浮层的静态展现形式,始终展现,不会自动消失,用户可以点击关闭。
## API
| 参数 | 说明 | 类型 | 默认值 |
|----------- |--------------------------------------------------------- | ---------- |-------|
| type | 指定警告提示的样式,有四种选择 `success``info``warning``error` | String | `info` |
| closable | 默认不显示关闭按钮 | Boolean | 无 |
| closeText | 自定义关闭按钮 | React.Node | 无 |
| message | 警告提示内容 | React.Node | 无 |
| description | 警告提示的辅助性文字介绍 | React.Node | 无 |
| onClose | 关闭时触发的回调函数 | Function | 无 |
| showIcon | 是否显示辅助图标 | Boolean | false |
| banner | 是否用作顶部公告 | Boolean | false |

View File

@@ -1,26 +1,29 @@
@import "../../style/themes/default";
@alert-prefix-cls: ant-alert;
@alert-prefix-cls: ~"@{ant-prefix}-alert";
.@{alert-prefix-cls} {
position: relative;
padding: 8px 8px 8px 16px;
padding: 8px 48px 8px 38px;
border-radius: @border-radius-base;
color: @text-color;
font-size: 12px;
font-size: @font-size-base;
line-height: 16px;
margin-bottom: 10px;
&&-no-icon {
padding: 8px 48px 8px 16px;
}
&-icon {
margin-right: 8px;
font-size: 14px;
top: 1px;
position: relative;
top: 9px;
left: 16px;
position: absolute;
}
&-description {
font-size: 12px;
color: @legend-color;
font-size: @font-size-base;
line-height: 21px;
display: none;
}
@@ -58,21 +61,20 @@
}
&-close-icon {
font-size: 12px;
font-size: @font-size-base;
position: absolute;
right: 16px;
top: 50%;
margin-top: -6px;
top: 10px;
height: 12px;
line-height: 12px;
overflow: hidden;
cursor: pointer;
.anticon-cross {
.@{iconfont-css-prefix}-cross {
color: @legend-color;
transition: color .3s ease;
&:hover {
color: #444;
color: #404040;
}
}
}
@@ -83,7 +85,7 @@
}
&-with-description {
padding: 16px 16px 16px 69px;
padding: 16px 16px 16px 60px;
position: relative;
border-radius: @border-radius-base;
margin-bottom: 10px;
@@ -97,24 +99,24 @@
&-with-description &-icon {
position: absolute;
top: 50%;
left: 24px;
margin-top: -15px;
font-size: 29px;
top: 16px;
left: 20px;
font-size: 24px;
}
&-with-description &-close-icon {
position: absolute;
top: 17px;
top: 16px;
right: 16px;
cursor: pointer;
font-size: 12px;
font-size: @font-size-base;
}
&-with-description &-message {
font-size: 14px;
color: @text-color;
color: @heading-color;
display: block;
margin-bottom: 4px;
}
&-with-description &-description {
@@ -134,6 +136,12 @@
animation: antAlertSlideUpOut .3s @ease-in-out-circ;
animation-fill-mode: both;
}
&-banner {
border-radius: 0;
border: 0;
margin-bottom: 0;
}
}
@keyframes antAlertSlideUpIn {

View File

@@ -0,0 +1,52 @@
---
order: 0
title:
zh-CN: 基本使用
en-US: Basic Usage
---
## zh-CN
基本使用。通过 dataSource 设置自动完成的数据源
## en-US
Basic Usage, set datasource of autocomplete with `dataSource` property.
````jsx
import { AutoComplete } from 'antd';
function onSelect(value) {
console.log('onSelect', value);
}
const Complete = React.createClass({
getInitialState() {
return {
dataSource: [],
};
},
handleChange(value) {
this.setState({
dataSource: !value ? [] : [
value,
value + value,
value + value + value,
],
});
},
render() {
const { dataSource } = this.state;
return (
<AutoComplete
dataSource={dataSource}
style={{ width: 200 }}
onSelect={onSelect}
onChange={this.handleChange}
/>
);
},
});
ReactDOM.render(<Complete />, mountNode);
````

View File

@@ -0,0 +1,53 @@
---
order: 2
title:
zh-CN: 自定义选项
en-US: Customized
---
## zh-CN
也可以直接传 `AutoComplete.Option` 作为 `AutoComplete``children`,而非使用 `dataSource`
## en-US
You could pass `AutoComplete.Option` as children of `AutoComplete`, instead of using `dataSource`
````jsx
import { AutoComplete } from 'antd';
const Option = AutoComplete.Option;
const Complete = React.createClass({
getInitialState() {
return {
result: [],
};
},
handleChange(value) {
let result;
if (!value || value.indexOf('@') >= 0) {
result = [];
} else {
result = ['gmail.com', '163.com', 'qq.com'].map(domain => `${value}@${domain}`);
}
this.setState({ result });
},
render() {
const { result } = this.state;
const children = result.map((email) => {
return <Option key={email}>{email}</Option>;
});
return (
<AutoComplete
style={{ width: 200 }}
onChange={this.handleChange}
>
{children}
</AutoComplete>
);
},
});
ReactDOM.render(<Complete />, mountNode);
````

View File

@@ -0,0 +1,30 @@
---
category: Components
type: Form Controls
cols: 1
title: AutoComplete
---
Autocomplete function of input field.
## When To Use
When need to use autocomplete function.
## API
```jsx
const dataSource = ['12345', '23456', '34567'];
<AutoComplete dataSource={dataSource} />
```
| Property | Description | Type | Default |
|----------------|----------------------------------|------------|--------|
| dataSource | Data source for autocomplete | Array | |
| value | selected option | String/Array<String>/{key: String, label: React.Node}/Array<{key, label}> | - |
| defaultValue | Initial selected option. | string/Array<String> | - |
| 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) | - |
| disabled | Whether disabled select | boolean | false |

View File

@@ -0,0 +1,84 @@
import React from 'react';
import Select, { OptionProps, OptGroupProps } from '../select';
import { Option, OptGroup } from 'rc-select';
import classNames from 'classnames';
export interface SelectedValue {
key: string;
label: React.ReactNode;
}
export interface DataSourceItemObject { value: string; text: string; };
export type DataSourceItemType = string | DataSourceItemObject;
export interface AutoCompleteProps {
size?: 'large' | 'small' | 'default';
className?: string;
notFoundContent?: Element;
dataSource: DataSourceItemType[];
prefixCls?: string;
transitionName?: string;
optionLabelProp?: string;
choiceTransitionName?: string;
showSearch?: boolean;
defaultValue?: string | Array<any> | SelectedValue | Array<SelectedValue>;
value?: string | Array<any> | SelectedValue | Array<SelectedValue>;
allowClear?: boolean;
onChange?: (value: string | Array<any> | SelectedValue | Array<SelectedValue>) => void;
disabled?: boolean;
}
export default class AutoComplete extends React.Component<AutoCompleteProps, any> {
static Option = Option as React.ClassicComponentClass<OptionProps>;
static OptGroup = OptGroup as React.ClassicComponentClass<OptGroupProps>;
static defaultProps = {
prefixCls: 'ant-select',
transitionName: 'slide-up',
optionLabelProp: 'children',
choiceTransitionName: 'zoom',
showSearch: false,
};
static contextTypes = {
antLocale: React.PropTypes.object,
};
render() {
let {
size, className = '', notFoundContent, prefixCls, optionLabelProp, dataSource, children,
} = this.props;
const cls = classNames({
[`${prefixCls}-lg`]: size === 'large',
[`${prefixCls}-sm`]: size === 'small',
[className]: !!className,
[`${prefixCls}-show-search`]: true,
});
const options = children || (dataSource ? dataSource.map((item) => {
switch (typeof item) {
case 'string':
return <Option key={item}>{item}</Option>;
case 'object':
return (
<Option key={(item as DataSourceItemObject).value}>
{(item as DataSourceItemObject).text}
</Option>
);
default:
throw new Error('AutoComplete[dataSource] only supports type `string[] | Object[]`.');
}
}) : []);
return (
<Select {...this.props}
className={cls}
optionLabelProp={optionLabelProp}
combobox
notFoundContent={notFoundContent} >
{options}
</Select>
);
}
}

View File

@@ -0,0 +1,31 @@
---
category: Components
subtitle: 自动完成
type: Form Controls
cols: 1
title: AutoComplete
---
输入框自动完成功能。
## 何时使用
需要自动完成时。
## API
```jsx
const dataSource = ['12345', '23456', '34567'];
<AutoComplete dataSource={dataSource} />
```
| 参数 | 说明 | 类型 | 默认值 |
|----------------|----------------------------------|------------|---------|
| dataSource | 自动完成的数据源 | Array | |
| value | 指定当前选中的条目 | String/Array<String>/{key: String, label: React.Node}/Array<{key, label}> | 无 |
| defaultValue | 指定默认选中的条目 | String/Array<String>/{key: String, label: React.Node}/Array<{key, label}> | 无 |
| allowClear | 支持清除, 单选模式有效 | boolean | false |
| onChange | 选中 option或 input 的 value 变化时,调用此函数 | function(value) | 无 |
| onSelect | 被选中时调用,参数为选中项的 value 值 | function(value, option) | 无 |
| disabled | 是否禁用 | boolean | false |

View File

@@ -0,0 +1,4 @@
import '../../style/index.less';
import './index.less';
import '../../select/style';

View File

@@ -1,17 +1,25 @@
---
order: 0
title: 基本
title:
zh-CN: 基本
en-US: Basic
---
## zh-CN
最简单的用法。
## en-US
The most basic usage.
````jsx
import { BackTop } from 'antd';
ReactDOM.render(
<div>
<BackTop />
向下滚动后,见右下角灰色按钮
Scroll down to see the bottom right gray button.
</div>
, mountNode);
````

View File

@@ -1,10 +1,19 @@
---
order: 1
title: 自定义样式
title:
zh-CN: 自定义样式
en-US: Custom style
---
## zh-CN
可以自定义回到顶部按钮的样式,限制宽高:`40px * 40px`
## en-US
You can customize the style of the button, just note the size limit: no more than `40px * 40px`.
````jsx
import { BackTop } from 'antd';
@@ -24,7 +33,7 @@ ReactDOM.render(
<BackTop style={{ bottom: 100 }}>
<div style={style}>UP</div>
</BackTop>
向下滚动后,见右下角蓝色按钮
Scroll down to see the bottom right blue button.
</div>
, mountNode);
````

View File

@@ -0,0 +1,25 @@
---
category: Components
type: Other
title: BackTop
---
`BackTop` makes it easy to go back to the top of the page.
## When To Use
- When the page content is very long.
- When you need to go back to the top very frequently in order to view the contents.
## 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 | -

View File

@@ -1,114 +0,0 @@
import React from 'react';
import Animate from 'rc-animate';
import Icon from '../icon';
import addEventListener from 'rc-util/lib/Dom/addEventListener';
import classNames from 'classnames';
import omit from 'object.omit';
function getScroll(target, top) {
if (typeof window === 'undefined') {
return 0;
}
const prop = top ? 'pageYOffset' : 'pageXOffset';
const method = top ? 'scrollTop' : 'scrollLeft';
const isWindow = target === window;
let ret = isWindow ? target[prop] : target[method];
// ie6,7,8 standard mode
if (isWindow && typeof ret !== 'number') {
ret = window.document.documentElement[method];
}
return ret;
}
export default class BackTop extends React.Component {
static propTypes = {
visibilityHeight: React.PropTypes.number,
target: React.PropTypes.func,
}
static defaultProps = {
onClick() {},
visibilityHeight: 400,
target() {
return window;
},
prefixCls: 'ant-back-top',
}
constructor(props) {
super(props);
const scrollTop = getScroll(props.target(), true);
this.state = {
visible: scrollTop > props.visibilityHeight,
};
}
scrollToTop = (e) => {
if (e) e.preventDefault();
this.setScrollTop(0);
this.props.onClick(e);
}
setScrollTop(value) {
const targetNode = this.props.target();
if (targetNode === window) {
document.body.scrollTop = value;
document.documentElement.scrollTop = value;
} else {
targetNode.scrollTop = value;
}
}
handleScroll = () => {
const { visibilityHeight, target } = this.props;
const scrollTop = getScroll(target(), true);
this.setState({
visible: scrollTop > visibilityHeight,
});
}
componentDidMount() {
this.scrollEvent = addEventListener(this.props.target(), 'scroll', this.handleScroll);
}
componentWillUnmount() {
if (this.scrollEvent) {
this.scrollEvent.remove();
}
}
render() {
const { prefixCls, className, children, ...otherProps } = this.props;
const classString = classNames({
[prefixCls]: true,
[className]: !!className,
});
const defaultElement = (
<div className={`${prefixCls}-content`}>
<Icon className={`${prefixCls}-icon`} type="to-top" />
</div>
);
// fix https://fb.me/react-unknown-prop
const divProps = omit(otherProps, [
'visibilityHeight',
]);
return (
<Animate component="" transitionName="fade">
{
this.state.visible ?
<div {...divProps} className={classString} onClick={this.scrollToTop}>
{children || defaultElement}
</div>
: null
}
</Animate>
);
}
}

133
components/back-top/index.tsx Executable file
View File

@@ -0,0 +1,133 @@
import React from 'react';
import Animate from 'rc-animate';
import addEventListener from 'rc-util/lib/Dom/addEventListener';
import classNames from 'classnames';
import omit from 'omit.js';
import Icon from '../icon';
import getScroll from '../_util/getScroll';
import getRequestAnimationFrame from '../_util/getRequestAnimationFrame';
const reqAnimFrame = getRequestAnimationFrame();
const currentScrollTop = () => {
return window.pageYOffset || document.body.scrollTop || document.documentElement.scrollTop;
};
const easeInOutCubic = (t, b, c, d) => {
const cc = c - b;
t /= d / 2;
if (t < 1) {
return cc / 2 * t * t * t + b;
} else {
return cc / 2 * ((t -= 2) * t * t + 2) + b;
}
};
function noop() {}
function getDefaultTarget() {
return typeof window !== 'undefined' ?
window : null;
}
export interface BackTopProps {
visibilityHeight?: number;
onClick?: React.MouseEventHandler<any>;
target?: () => HTMLElement | Window;
prefixCls?: string;
className?: string;
style?: React.CSSProperties;
}
export default class BackTop extends React.Component<BackTopProps, any> {
static defaultProps = {
visibilityHeight: 400,
};
scrollEvent: any;
constructor(props) {
super(props);
this.state = {
visible: false,
};
}
scrollToTop = (e) => {
const scrollTop = currentScrollTop();
const startTime = Date.now();
const frameFunc = () => {
const timestamp = Date.now();
const time = timestamp - startTime;
this.setScrollTop(easeInOutCubic(time, scrollTop, 0, 450));
if (time < 450) {
reqAnimFrame(frameFunc);
}
};
reqAnimFrame(frameFunc);
(this.props.onClick || noop)(e);
}
setScrollTop(value) {
const targetNode = (this.props.target || getDefaultTarget)();
if (targetNode === window) {
document.body.scrollTop = value;
document.documentElement.scrollTop = value;
} else {
(targetNode as HTMLElement).scrollTop = value;
}
}
handleScroll = () => {
const { visibilityHeight, target = getDefaultTarget } = this.props;
const scrollTop = getScroll(target(), true);
this.setState({
visible: scrollTop > visibilityHeight,
});
}
componentDidMount() {
this.handleScroll();
this.scrollEvent = addEventListener((this.props.target || getDefaultTarget)(), 'scroll', this.handleScroll);
}
componentWillUnmount() {
if (this.scrollEvent) {
this.scrollEvent.remove();
}
}
render() {
const { prefixCls = 'ant-back-top', className = '', children } = this.props;
const classString = classNames({
[prefixCls]: true,
[className]: !!className,
});
const defaultElement = (
<div className={`${prefixCls}-content`}>
<Icon className={`${prefixCls}-icon`} type="to-top" />
</div>
);
// fix https://fb.me/react-unknown-prop
const divProps = omit(this.props, [
'prefixCls',
'className',
'children',
'visibilityHeight',
]);
return (
<Animate component="" transitionName="fade">
{
this.state.visible ?
<div {...divProps} className={classString} onClick={this.scrollToTop}>
{children || defaultElement}
</div>
: null
}
</Animate>
);
}
}

View File

@@ -1,8 +1,8 @@
---
category: Components
chinese: 回到顶部
type: Other
english: BackTop
subtitle: 回到顶部
title: BackTop
---
返回页面顶部的操作按钮。
@@ -15,6 +15,7 @@ english: BackTop
## API
> 有默认样式,距离底部 `50px`,可覆盖。
> 自定义样式宽高不大于 40px * 40px。
| 参数 | 说明 | 类型 | 默认值 |

View File

@@ -1,6 +1,6 @@
@import "../../style/themes/default";
@backtop-prefix-cls: ant-back-top;
@backtop-prefix-cls: ~"@{ant-prefix}-back-top";
.@{backtop-prefix-cls} {
z-index: @zindex-back-top;

View File

@@ -1,7 +1,9 @@
import React, { createElement } from 'react';
import { findDOMNode } from 'react-dom';
import React from 'react';
import { createElement, Component } from 'react';
import {findDOMNode} from 'react-dom';
import isCssAnimationSupported from '../_util/isCssAnimationSupported';
import omit from 'object.omit';
import assign from 'object-assign';
import omit from 'omit.js';
function getNumberArray(num) {
return num ?
@@ -11,24 +13,26 @@ function getNumberArray(num) {
.map(i => Number(i)) : [];
}
export default class ScrollNumber extends React.Component {
export interface ScrollNumberProps {
prefixCls?: string;
className?: string;
count?: string | number;
component?: string;
onAnimated?: Function;
height?: number;
style: React.CSSProperties;
}
export default class ScrollNumber extends Component<ScrollNumberProps, any> {
static defaultProps = {
prefixCls: 'ant-scroll-number',
count: null,
component: 'sup',
onAnimated() {},
onAnimated() {
},
height: 18,
}
};
static propTypes = {
count: React.PropTypes.oneOfType([
React.PropTypes.string,
React.PropTypes.number,
]),
component: React.PropTypes.string,
onAnimated: React.PropTypes.func,
height: React.PropTypes.number,
}
lastCount: any;
constructor(props) {
super(props);
@@ -80,7 +84,10 @@ export default class ScrollNumber extends React.Component {
animateStarted: false,
count: nextProps.count,
}, () => {
this.props.onAnimated();
const onAnimated = this.props.onAnimated;
if (onAnimated) {
onAnimated();
}
});
}, 5);
});
@@ -88,10 +95,10 @@ export default class ScrollNumber extends React.Component {
}
renderNumberList(position) {
const childrenToReturn = [];
const childrenToReturn: React.ReactElement<any>[] = [];
for (let i = 0; i < 30; i++) {
const currentClassName = (position === i) ? 'current' : null;
childrenToReturn.push(<p key={i} className={currentClassName}>{i % 10}</p>);
const currentClassName = (position === i) ? 'current' : '';
childrenToReturn.push(<p key={i.toString()} className={currentClassName}>{i % 10}</p>);
}
return childrenToReturn;
}
@@ -123,18 +130,17 @@ export default class ScrollNumber extends React.Component {
}
render() {
const { component, prefixCls, className, ...otherProps } = this.props;
// fix https://fb.me/react-unknown-prop
const restProps = omit(otherProps, [
const props = assign({}, omit(this.props, [
'count',
'onAnimated',
]);
const props = {
...restProps,
className: `${prefixCls} ${className}`,
};
'component',
'prefixCls',
]), {
className: `${this.props.prefixCls} ${this.props.className}`,
});
return createElement(
component,
this.props.component || 'sup',
props,
this.renderNumberElement()
);

View File

@@ -1,19 +1,27 @@
---
order: 1
title: 大数字
title:
zh-CN: 大数字
en-US: Overflowed count
---
## zh-CN
超过 99 的会显示为 `99+`
## en-US
`99+` is displayed when count is larger than `99`.
````jsx
import { Badge } from 'antd';
ReactDOM.render(<div>
<Badge count={99}>
<a href="#" className="head-example"></a>
<a href="#" className="head-example" />
</Badge>
<Badge count={200}>
<a href="#" className="head-example"></a>
<a href="#" className="head-example" />
</Badge>
</div>, mountNode);
````

View File

@@ -1,22 +1,30 @@
---
order: 0
title: 基本
title:
zh-CN: 基本
en-US: Basic
---
## zh-CN
简单的徽章展示。
## en-US
Simplest Usage.
````jsx
import { Badge } from 'antd';
ReactDOM.render(
<Badge count={5}>
<a href="#" className="head-example"></a>
<a href="#" className="head-example" />
</Badge>
, mountNode);
````
````css
.ant-badge {
.ant-badge:not(.ant-badge-status) {
margin-right: 16px;
}
.head-example {

View File

@@ -1,10 +1,18 @@
---
order: 4
title: 动态
title:
zh-CN: 动态
en-US: Dynamic
---
## zh-CN
展示动态变化的效果。
## en-US
The count will be animated as it changes.
````jsx
import { Badge, Button, Icon } from 'antd';
const ButtonGroup = Button.Group;
@@ -36,10 +44,10 @@ const Test = React.createClass({
return (
<div>
<Badge count={this.state.count}>
<a href="#" className="head-example"></a>
<a href="#" className="head-example" />
</Badge>
<Badge dot={this.state.show}>
<a href="#" className="head-example"></a>
<a href="#" className="head-example" />
</Badge>
<div style={{ marginTop: 10 }}>
<ButtonGroup>
@@ -51,7 +59,7 @@ const Test = React.createClass({
</Button>
</ButtonGroup>
<Button type="ghost" onClick={this.onClick} style={{ marginLeft: 8 }}>
切换红点显隐
Switch state
</Button>
</div>
</div>

View File

@@ -1,10 +1,18 @@
---
order: 3
title: 讨嫌的小红点
title:
zh-CN: 讨嫌的小红点
en-US: Red badge
---
## zh-CN
没有具体的数字。
## en-US
This will simply display a red badge, without a specific count.
````jsx
import { Badge, Icon } from 'antd';
@@ -13,7 +21,7 @@ ReactDOM.render(<div>
<Icon type="notification" />
</Badge>
<Badge dot>
<a href="#">一个链接</a>
<a href="#">Link something</a>
</Badge>
</div>, mountNode);
````

View File

@@ -1,17 +1,25 @@
---
order: 2
title: 可点击
title:
zh-CN: 可点击
en-US: Clickable
---
## zh-CN
用 a 标签进行包裹即可。
## en-US
The badge can be wrapped with `a` tag to make it linkable.
````jsx
import { Badge } from 'antd';
ReactDOM.render(
<a href="#">
<Badge count={5}>
<span className="head-example"></span>
<span className="head-example" />
</Badge>
</a>
, mountNode);

View File

@@ -1,12 +1,20 @@
---
order: 0
title: 独立使用
title:
zh-CN: 独立使用
en-US: Standalone
---
## zh-CN
不包裹任何元素即是独立使用,可自定样式展现。
> 在右上角的 badge 则限定为红色。
## en-US
Used in standalone when children is empty.
````jsx
import { Badge } from 'antd';

View File

@@ -1,19 +1,27 @@
---
order: 6
title: 封顶数字
title:
zh-CN: 封顶数字
en-US: Customized overflow count
---
## zh-CN
超过 `overflowCount` 的会显示为 `${overflowCount}+`
## en-US
`${overflowCount}+` is displayed when count is larger than `overflowCount`.
````jsx
import { Badge } from 'antd';
ReactDOM.render(<div>
<Badge count={99} overflowCount={10}>
<a href="#" className="head-example"></a>
<a href="#" className="head-example" />
</Badge>
<Badge count={1000} overflowCount={999}>
<a href="#" className="head-example"></a>
<a href="#" className="head-example" />
</Badge>
</div>, mountNode);
````

View File

@@ -0,0 +1,38 @@
---
order: 7
title:
zh-CN: 状态点
en-US: Status
---
## zh-CN
用于表示状态的小圆点。
## en-US
Standalone badge with status.
````jsx
import { Badge } from 'antd';
ReactDOM.render(
<div>
<Badge status="success" />
<Badge status="error" />
<Badge status="default" />
<Badge status="processing" />
<Badge status="warning" />
<br />
<Badge status="success" text="Success" />
<br />
<Badge status="error" text="Error" />
<br />
<Badge status="default" text="Default" />
<br />
<Badge status="processing" text="Processing" />
<br />
<Badge status="warning" text="Warning" />
</div>
, mountNode);
````

View File

@@ -0,0 +1,32 @@
---
category: Components
type: Views
title: Badge
---
Small numerical value or status descriptors 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.
## API
```jsx
<Badge count={5}>
<a href="#" className="head-example" />
</Badge>
```
```jsx
<Badge count={5} />
```
| Property | Description | Type | Default |
|----------------|-------------------------|------------|---------|
| count | Number to show in badge | Number | |
| overflowCount | Max count to show | Number | 99 |
| 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 | '' |

View File

@@ -1,64 +0,0 @@
import React from 'react';
import Animate from 'rc-animate';
import ScrollNumber from './ScrollNumber';
import classNames from 'classnames';
export default class Badge extends React.Component {
static defaultProps = {
prefixCls: 'ant-badge',
count: null,
dot: false,
overflowCount: 99,
}
static propTypes = {
count: React.PropTypes.oneOfType([
React.PropTypes.string,
React.PropTypes.number,
]),
dot: React.PropTypes.bool,
overflowCount: React.PropTypes.number,
}
render() {
let { count, prefixCls, overflowCount, className, style, children, dot, ...restProps } = this.props;
count = count > overflowCount ? `${overflowCount}+` : count;
// dot mode don't need count
if (dot) {
count = '';
}
// null undefined "" "0" 0
const hidden = (!count || count === '0') && !dot;
const scrollNumberCls = prefixCls + (dot ? '-dot' : '-count');
const badgeCls = classNames({
[className]: !!className,
[prefixCls]: true,
[`${prefixCls}-not-a-wrapper`]: !children,
});
return (
<span className={badgeCls} title={count} style={null} {...restProps}>
{children}
<Animate
component=""
showProp="data-show"
transitionName={`${prefixCls}-zoom`}
transitionAppear
>
{
hidden ? null :
<ScrollNumber
data-show={!hidden}
className={scrollNumberCls}
count={count}
style={style}
/>
}
</Animate>
</span>
);
}
}

112
components/badge/index.tsx Normal file
View File

@@ -0,0 +1,112 @@
import React from 'react';
import Animate from 'rc-animate';
import ScrollNumber from './ScrollNumber';
import classNames from 'classnames';
import warning from 'warning';
import splitObject from '../_util/splitObject';
export interface BadgeProps {
/** Number to show in badge */
count: number | string;
/** Max count to show */
overflowCount?: number;
/** whether to show red dot without number */
dot?: boolean;
style?: React.CSSProperties;
prefixCls?: string;
className?: string;
status?: 'success' | 'processing' | 'default' | 'error' | 'warning';
text?: string;
}
export default class Badge extends React.Component<BadgeProps, any> {
static defaultProps = {
prefixCls: 'ant-badge',
count: null,
dot: false,
overflowCount: 99,
};
static propTypes = {
count: React.PropTypes.oneOfType([
React.PropTypes.string,
React.PropTypes.number,
]),
dot: React.PropTypes.bool,
overflowCount: React.PropTypes.number,
};
render() {
let [{
count, prefixCls, overflowCount, className, style, children, dot, status, text,
}, restProps] = splitObject(
this.props,
['count', 'prefixCls', 'overflowCount', 'className', 'style', 'children', 'dot', 'status', 'text']
);
const isDot = dot || status;
count = count > overflowCount ? `${overflowCount}+` : count;
// dot mode don't need count
if (isDot) {
count = '';
}
// null undefined "" "0" 0
const hidden = (!count || count === '0') && !isDot;
const scrollNumberCls = classNames({
[`${prefixCls}-dot`]: isDot,
[`${prefixCls}-count`]: !isDot,
});
const badgeCls = classNames({
[className]: !!className,
[prefixCls]: true,
[`${prefixCls}-status`]: !!status,
[`${prefixCls}-not-a-wrapper`]: !children,
});
warning(
!(children && status),
'`Badge[children]` and `Badge[status]` cannot be used at the same time.'
);
// <Badge status="success" />
if (!children && status) {
const statusCls = classNames({
[`${prefixCls}-status-dot`]: !!status,
[`${prefixCls}-status-${status}`]: true,
});
return (
<span className={badgeCls}>
<span className={statusCls} />
<span className={`${prefixCls}-status-text`}>{text}</span>
</span>
);
}
return (
<span {...restProps} className={badgeCls} title={count}>
{children}
<Animate
component=""
showProp="data-show"
transitionName={`${prefixCls}-zoom`}
transitionAppear
>
{
hidden ? null :
<ScrollNumber
data-show={!hidden}
className={scrollNumberCls}
count={count}
style={style}
/>
}
</Animate>
{
hidden || !text ? null :
<span className={`${prefixCls}-status-text`}>{text}</span>
}
</span>
);
}
}

View File

@@ -1,8 +1,8 @@
---
category: Components
chinese: 徽标数
subtitle: 徽标数
type: Views
english: Badge
title: Badge
---
图标右上角的圆形徽标数字。
@@ -15,7 +15,7 @@ english: Badge
```jsx
<Badge count={5}>
<a href="#" className="head-example"></a>
<a href="#" className="head-example" />
</Badge>
```
@@ -28,4 +28,6 @@ english: Badge
|----------------|----------------------------------|------------|---------|--------|
| count | 展示的数字,大于 overflowCount 时显示为 `${overflowCount}+`,为 0 时隐藏 | Number | | |
| overflowCount | 展示封顶的数字值 | Number | | 99 |
| dot | 不展示数字,只有一个小红点 | boolean | | false |
| dot | 不展示数字,只有一个小红点 | Boolean | | false |
| status | 设置 Badge 为状态点 | Enum | 'success'、'processing'、'default'、'error'、'warning' | '' |
| text | 在设置了 `status` 的前提下有效,设置状态点的文本 | String | | '' |

View File

@@ -1,7 +1,7 @@
@import "../../style/themes/default";
@badge-prefix-cls: ant-badge;
@number-prefix-cls: ant-scroll-number;
@badge-prefix-cls: ~"@{ant-prefix}-badge";
@number-prefix-cls: ~"@{ant-prefix}-scroll-number";
.@{badge-prefix-cls} {
position: relative;
@@ -47,6 +47,39 @@
box-shadow: 0 0 0 1px #fff;
}
&-status {
line-height: inherit;
vertical-align: baseline;
&-dot {
width: 8px;
height: 8px;
display: inline-block;
border-radius: 50%;
}
&-success {
background-color: @success-color;
}
&-processing {
background-color: @primary-color;
animation: antStatusProcessing 1.2s infinite ease-in-out;
}
&-default {
background-color: @normal-color;
}
&-error {
background-color: @error-color;
}
&-warning {
background-color: @warning-color;
}
&-text {
color: @text-color;
font-size: @font-size-base;
margin-left: 8px;
}
}
&-zoom-appear,
&-zoom-enter {
animation: antZoomBadgeIn .3s @ease-out-back;
@@ -62,7 +95,17 @@
top: auto;
display: block;
position: relative;
transform: translateX(0);
transform: none!important;
}
}
@keyframes antStatusProcessing {
0%,
100% {
opacity: 1;
}
50% {
opacity: 0;
}
}

View File

@@ -1,72 +0,0 @@
import React, { cloneElement } from 'react';
import BreadcrumbItem from './BreadcrumbItem';
const defaultNameRender = (breadcrumbName, route, params) => {
if (!breadcrumbName) {
return null;
}
const paramsKeys = Object.keys(params).join('|');
const name = breadcrumbName.replace(
new RegExp(`:(${paramsKeys})`, 'g'),
(replacement, key) => params[key] || replacement
);
return <span>{name}</span>;
};
export default class Breadcrumb extends React.Component {
static defaultProps = {
prefixCls: 'ant-breadcrumb',
separator: '/',
linkRender: (href, name) => <a href={`#${href}`}>{name}</a>,
nameRender: defaultNameRender,
}
static propTypes = {
prefixCls: React.PropTypes.string,
separator: React.PropTypes.oneOfType([
React.PropTypes.string,
React.PropTypes.element,
]),
routes: React.PropTypes.array,
params: React.PropTypes.object,
linkRender: React.PropTypes.func,
nameRender: React.PropTypes.func,
}
render() {
let crumbs;
const { separator, prefixCls, routes, params, children, linkRender, nameRender } = this.props;
if (routes && routes.length > 0) {
const paths = [];
const lastPath = routes.length - 1;
crumbs = routes.map((route, i) => {
route.path = route.path || '';
let path = route.path.replace(/^\//, '');
Object.keys(params).forEach(key => {
path = path.replace(`:${key}`, params[key]);
});
if (path) {
paths.push(path);
}
const name = nameRender(route.breadcrumbName, route, params);
if (name) {
const link = (i === lastPath) ? name : linkRender(`/${paths.join('/')}`, name, paths);
return <BreadcrumbItem separator={separator} key={route.breadcrumbName || i}>{link}</BreadcrumbItem>;
}
return null;
});
} else {
crumbs = React.Children.map(children, (element, index) => {
return cloneElement(element, {
separator,
key: index,
});
});
}
return (
<div className={prefixCls}>
{crumbs}
</div>
);
}
}

View File

@@ -0,0 +1,101 @@
import React from 'react';
import { cloneElement } from 'react';
import warning from 'warning';
import BreadcrumbItem from './BreadcrumbItem';
export interface BreadcrumbProps {
prefixCls?: string;
routes?: Array<any>;
params?: Object;
separator?: string | React.ReactNode;
itemRender?: (route: any, params: any, routes: Array<any>, paths: Array<string>) => React.ReactNode;
style?: React.CSSProperties;
};
function getBreadcrumbName(route, params) {
if (!route.breadcrumbName) {
return null;
}
const paramsKeys = Object.keys(params).join('|');
const name = route.breadcrumbName.replace(
new RegExp(`:(${paramsKeys})`, 'g'),
(replacement, key) => params[key] || replacement
);
return name;
}
function defaultItemRender(route, params, routes, paths) {
const isLastItem = routes.indexOf(route) === routes.length - 1;
const name = getBreadcrumbName(route, params);
return isLastItem
? <span>{name}</span>
: <a href={`#/${paths.join('/')}`}>{name}</a>;
}
export default class Breadcrumb extends React.Component<BreadcrumbProps, any> {
static Item: any;
static defaultProps = {
prefixCls: 'ant-breadcrumb',
separator: '/',
};
static propTypes = {
prefixCls: React.PropTypes.string,
separator: React.PropTypes.oneOfType([
React.PropTypes.string,
React.PropTypes.element,
]),
routes: React.PropTypes.array,
params: React.PropTypes.object,
linkRender: React.PropTypes.func,
nameRender: React.PropTypes.func,
};
constructor(props) {
super();
warning(
!('linkRender' in props || 'nameRender' in props),
'`linkRender` and `nameRender` are removed, please use `itemRender` instead.'
);
}
render() {
let crumbs;
const { separator, prefixCls, routes, params = {}, children, itemRender = defaultItemRender } = this.props;
if (routes && routes.length > 0) {
const paths: string[] = [];
crumbs = routes.map((route) => {
route.path = route.path || '';
let path: string = route.path.replace(/^\//, '');
Object.keys(params).forEach(key => {
path = path.replace(`:${key}`, params[key]);
});
if (path) {
paths.push(path);
}
if (route.breadcrumbName) {
return (
<BreadcrumbItem separator={separator} key={route.breadcrumbName}>
{itemRender(route, params, routes, paths)}
</BreadcrumbItem>
);
}
return null;
});
} else if (children) {
crumbs = React.Children.map(children, (element: any, index) => {
return cloneElement(element, {
separator,
key: index,
});
});
}
return (
<div className={prefixCls}>
{crumbs}
</div>
);
}
}

View File

@@ -1,10 +1,16 @@
import React from 'react';
import splitObject from '../_util/splitObject';
export default class BreadcrumbItem extends React.Component {
export interface BreadcrumbItemProps {
separator?: React.ReactNode;
href?: string;
}
export default class BreadcrumbItem extends React.Component<BreadcrumbItemProps, any> {
static defaultProps = {
prefixCls: 'ant-breadcrumb',
separator: '/',
}
};
static propTypes = {
prefixCls: React.PropTypes.string,
@@ -13,10 +19,12 @@ export default class BreadcrumbItem extends React.Component {
React.PropTypes.element,
]),
href: React.PropTypes.string,
}
};
render() {
const { prefixCls, separator, children, ...restProps } = this.props;
const [{ prefixCls, separator, children }, restProps] = splitObject(
this.props, ['prefixCls', 'separator', 'children']
);
let link;
if ('href' in this.props) {
link = <a className={`${prefixCls}-link`} {...restProps}>{children}</a>;

View File

@@ -29,7 +29,7 @@ const Apps = () => (
</ul>
);
const Home = (props) => (
const Home = props => (
<div>
<div className="demo-nav">
<Link to="/">Home</Link>

View File

@@ -6,7 +6,7 @@ title: Breadcrumb
A breadcrumb displays the current location within a hierarchy. It allows going back to states higher up within the hierarchy.
## When to use
## When To Use
- When the system has more than two layers in a hierarchy.
- When you need to inform the user of where they are.
@@ -28,5 +28,6 @@ A breadcrumb displays the current location within a hierarchy. It allows going b
| routes | The routing stack information of router | Array | | - |
| params | Routing parameter | Object | | - |
| separator | Custom separator | String or Element | | '/' |
| linkRender | Custom link functionand react-router configuration | Function(href, name) | | - |
| nameRender | Custom link functionand react-router configuration | Function(name) | | - |
| itemRender | Custom item renderer | (route, params, routes, paths) => React.ReactNode | | - |
> `linkRender` and `nameRender` were removed after `antd@2.0`, please use `itemRender` instead.

View File

@@ -1,8 +1,8 @@
---
category: Components
chinese: 面包屑
subtitle: 面包屑
type: Navigation
english: Breadcrumb
title: Breadcrumb
---
显示当前页面在系统层级结构中的位置,并能向上返回。
@@ -29,5 +29,6 @@ english: Breadcrumb
| routes | router 的路由栈信息 | Array | | - |
| params | 路由的参数 | Object | | - |
| separator | 分隔符自定义 | String or Element | | '/' |
| linkRender | 自定义链接函数,和 react-router 配置使用 | Function(href, name, paths) | | - |
| nameRender | 自定义文字函数,和 react-router 配置使用 | Function(breadcrumbName, route, params) | | - |
| itemRender | 自定义链接函数,和 react-router 配置使用 | (route, params, routes, paths) => React.ReactNode | | - |
> 2.0 之后,`linkRender` 和 `nameRender` 被移除,请使用 `itemRender` 来代替。

View File

@@ -1,6 +1,6 @@
@import "../../style/themes/default";
@breadcrumb-prefix-cls: ant-breadcrumb;
@breadcrumb-prefix-cls: ~"@{ant-prefix}-breadcrumb";
.@{breadcrumb-prefix-cls} {
color: #999;
@@ -29,7 +29,7 @@
}
&-link {
> .anticon + span {
> .@{iconfont-css-prefix} + span {
margin-left: 4px;
}
}

View File

@@ -1,27 +0,0 @@
import React from 'react';
import classNames from 'classnames';
const prefix = 'ant-btn-group-';
export default function ButtonGroup(props) {
const { size, className, ...others } = props;
// large => lg
// small => sm
const sizeCls = ({
large: 'lg',
small: 'sm',
})[size] || '';
const classes = classNames({
'ant-btn-group': true,
[prefix + sizeCls]: sizeCls,
[className]: className,
});
return <div {...others} className={classes} />;
}
ButtonGroup.propTypes = {
size: React.PropTypes.oneOf(['large', 'default', 'small']),
};

View File

@@ -0,0 +1,32 @@
import React from 'react';
import classNames from 'classnames';
import splitObject from '../_util/splitObject';
export type ButtonSize = 'small' | 'large'
export interface ButtonGroupProps {
size?: ButtonSize;
style?: React.CSSProperties;
className?: string;
prefixCls?: string;
}
export default function ButtonGroup(props: ButtonGroupProps) {
const [{ prefixCls = 'ant-btn-group', size, className }, others] =
splitObject(props, ['prefixCls', 'size', 'className']);
// large => lg
// small => sm
const sizeCls = ({
large: 'lg',
small: 'sm',
})[size] || '';
const classes = classNames({
[prefixCls]: true,
[`${prefixCls}-${sizeCls}`]: sizeCls,
[className]: className,
});
return <div {...others} className={classes} />;
}

View File

@@ -2,7 +2,7 @@ import React from 'react';
import classNames from 'classnames';
import { findDOMNode } from 'react-dom';
import Icon from '../icon';
import splitObject from '../_util/splitObject';
const rxTwoCNChar = /^[\u4e00-\u9fa5]{2}$/;
const isTwoCNChar = rxTwoCNChar.test.bind(rxTwoCNChar);
function isString(str) {
@@ -24,12 +24,32 @@ function insertSpace(child) {
return child;
}
export default class Button extends React.Component {
export type ButtonType = 'primary' | 'ghost' | 'dashed'
export type ButtonShape = 'circle' | 'circle-outline'
export type ButtonSize = 'small' | 'large'
export interface ButtonProps {
type?: ButtonType;
htmlType?: string;
icon?: string;
shape?: ButtonShape;
size?: ButtonSize;
onClick?: React.FormEventHandler<any>;
onMouseUp?: React.FormEventHandler<any>;
loading?: boolean;
disabled?: boolean;
style?: React.CSSProperties;
prefixCls?: string;
className?: string;
}
export default class Button extends React.Component<ButtonProps, any> {
static Group: any;
static defaultProps = {
prefixCls: 'ant-btn',
onClick() {},
loading: false,
}
};
static propTypes = {
type: React.PropTypes.string,
@@ -40,7 +60,10 @@ export default class Button extends React.Component {
loading: React.PropTypes.bool,
className: React.PropTypes.string,
icon: React.PropTypes.string,
}
};
timeout: any;
clickedTimeout: any;
componentWillUnmount() {
if (this.clickedTimeout) {
@@ -55,7 +78,7 @@ export default class Button extends React.Component {
button.className = button.className.replace(` ${this.props.prefixCls}-clicked`, '');
}
handleClick = (...args) => {
handleClick = (e) => {
// Add click effect
const buttonNode = findDOMNode(this);
this.clearButton(buttonNode);
@@ -63,12 +86,15 @@ export default class Button extends React.Component {
clearTimeout(this.timeout);
this.timeout = setTimeout(() => this.clearButton(buttonNode), 500);
this.props.onClick(...args);
const onClick = this.props.onClick;
if (onClick) {
onClick(e);
}
}
// Handle auto focus when click button in Chrome
handleMouseUp = (e) => {
findDOMNode(this).blur();
(findDOMNode(this) as HTMLElement).blur();
if (this.props.onMouseUp) {
this.props.onMouseUp(e);
}
@@ -76,7 +102,8 @@ export default class Button extends React.Component {
render() {
const props = this.props;
const { type, shape, size, className, htmlType, children, icon, loading, prefixCls, ...others } = props;
const [{ type, shape, size, className, htmlType, children, icon, loading, prefixCls }, others] = splitObject(props,
['type', 'shape', 'size', 'className', 'htmlType', 'children', 'icon', 'loading', 'prefixCls']);
// large => lg
// small => sm

View File

@@ -23,7 +23,7 @@ import { Button } from 'antd';
ReactDOM.render(
<div>
<Button type="primary" shape="circle" icon="search" />
<Button type="primary" icon="search">搜索</Button>
<Button type="primary" icon="search">Search</Button>
<br />
<Button type="ghost" shape="circle-outline" icon="search" />
<Button type="ghost" icon="search">Search</Button>

View File

@@ -2,7 +2,7 @@
@import "../../style/mixins/index";
@import "./mixin";
@btn-prefix-cls: ant-btn;
@btn-prefix-cls: ~"@{ant-prefix}-btn";
// Button styles
// -----------------------------
@@ -69,7 +69,7 @@
padding-left: 29px;
pointer-events: none;
position: relative;
.anticon {
.@{iconfont-css-prefix} {
margin-left: -14px;
transition: all .3s @ease-in-out;
}
@@ -80,7 +80,7 @@
&-sm&-loading {
padding-left: 24px;
.anticon {
.@{iconfont-css-prefix} {
margin-left: -17px;
}
}
@@ -110,7 +110,7 @@
border-radius: inherit;
border: 0 solid @primary-color;
opacity: 0.4;
animation: buttonEffect 0.32s ease forwards;
animation: buttonEffect 0.36s ease-out forwards;
display: block;
}
}
@@ -118,10 +118,10 @@
@keyframes buttonEffect {
to {
opacity: 0;
top: -5px;
left: -5px;
bottom: -5px;
right: -5px;
border-width: 5px;
top: -6px;
left: -6px;
bottom: -6px;
right: -6px;
border-width: 6px;
}
}

View File

@@ -6,21 +6,9 @@
border-radius: @border-radius;
}
.button-variant(@color; @background; @border) {
.button-color(@color; @background; @border);
&:hover,
&:focus {
.button-color(tint(@color, 20%); tint(@background, 20%); tint(@border, 20%));
}
&:active,
&.active {
.button-color(shade(@color, 5%); shade(@background, 5%); shade(@background, 5%));
}
.button-disabled() {
&.disabled,
&[disabled],
fieldset[disabled] & {
&[disabled] {
&,
&:hover,
&:focus,
@@ -31,6 +19,38 @@
}
}
.button-variant-primary(@color; @background) {
.button-color(@color; @background; @background);
&:hover,
&:focus {
.button-color(@color; tint(@background, 20%); tint(@background, 20%));
}
&:active,
&.active {
.button-color(@color; shade(@background, 5%); shade(@background, 5%));
}
.button-disabled();
}
.button-variant-other(@color; @background; @border) {
.button-color(@color; @background; @border);
&:hover,
&:focus {
.button-color(tint(@primary-color, 20%); @background; tint(@primary-color, 20%));
}
&:active,
&.active {
.button-color(shade(@primary-color, 5%); @background; shade(@primary-color, 5%));
}
.button-disabled();
}
.button-color(@color; @background; @border) {
color: @color;
background-color: @background;
@@ -57,7 +77,6 @@
vertical-align: middle;
> .@{btnClassName} {
position: relative;
float: left;
&:hover,
&:focus,
&:active,
@@ -68,11 +87,11 @@
// size
&-lg > .@{btnClassName} {
.button-size(@btn-padding-lg; @btn-font-size-lg; @border-radius-base);
.button-size(@btn-padding-lg; @btn-font-size-lg; @btn-border-radius-base);
}
&-sm > .@{btnClassName} {
.button-size(@btn-padding-sm; @font-size-base; @border-radius-sm);
.button-size(@btn-padding-sm; @font-size-base; @btn-border-radius-sm);
> .@{iconfont-css-prefix} {
font-size: @font-size-base;
}
@@ -86,15 +105,13 @@
margin-bottom: 0;
font-weight: @btn-font-weight;
text-align: center;
vertical-align: middle;
touch-action: manipulation;
cursor: pointer;
background-image: none;
border: 1px solid transparent;
// outline: none;
white-space: nowrap;
line-height: @line-height-base;
.button-size(@btn-padding-base; @font-size-base; @border-radius-base);
.button-size(@btn-padding-base; @font-size-base; @btn-border-radius-base);
user-select: none;
transition: all .3s @ease-in-out;
position: relative;
@@ -127,67 +144,39 @@
}
&-lg {
.button-size(@btn-padding-lg; @btn-font-size-lg; @border-radius-base);
.button-size(@btn-padding-lg; @btn-font-size-lg; @btn-border-radius-base);
}
&-sm {
.button-size(@btn-padding-sm; @font-size-base; @border-radius-sm);
.button-size(@btn-padding-sm; @font-size-base; @btn-border-radius-sm);
}
}
// primary button style
.btn-primary() {
.button-variant(@btn-primary-color; @btn-primary-bg; @primary-color);
&:hover,
&:focus,
&:active,
&.active {
color: @btn-primary-color;
}
.button-variant-primary(@btn-primary-color; @btn-primary-bg);
}
// default button style
.btn-default() {
.button-variant(@btn-default-color; @btn-default-bg; @btn-default-border);
.button-variant-other(@btn-default-color; @btn-default-bg; @btn-default-border);
&:hover,
&:focus {
.button-color(tint(@primary-color, 20%); white; tint(@primary-color, 20%));
}
&:focus,
&:active,
&.active {
.button-color(shade(@primary-color, 5%); white; shade(@primary-color, 5%));
background: #fff;
}
}
// ghost button style
.btn-ghost() {
.button-variant(@btn-ghost-color, @btn-ghost-bg, @btn-ghost-border);
&:hover,
&:focus {
.button-color(tint(@primary-color, 20%); @btn-ghost-bg; tint(@primary-color, 20%));
}
&:active,
&.active {
.button-color(shade(@primary-color, 5%); @btn-ghost-bg; shade(@primary-color, 5%));
}
.button-variant-other(@btn-ghost-color, @btn-ghost-bg, @btn-ghost-border);
}
// ghost button style
.btn-dashed() {
.button-variant(@btn-ghost-color, @btn-ghost-bg, @btn-ghost-border);
.button-variant-other(@btn-ghost-color, @btn-ghost-bg, @btn-ghost-border);
border-style: dashed;
&:hover,
&:focus {
.button-color(tint(@primary-color, 20%); @btn-ghost-bg; tint(@primary-color, 20%));
}
&:active,
&.active {
.button-color(shade(@primary-color, 5%); @btn-ghost-bg; shade(@primary-color, 5%));
}
}
// circle button: the content only contains icon

View File

@@ -1,32 +1,28 @@
import React, { PropTypes } from 'react';
import React from 'react';
import moment from 'moment';
import { PREFIX_CLS } from './Constants';
import Select from '../select';
import { Group, Button } from '../radio';
const Option = Select.Option;
function noop() {}
export interface HeaderProps {
prefixCls?: string;
locale?: any;
fullscreen?: boolean;
yearSelectOffset?: number;
yearSelectTotal?: number;
type?: string;
onValueChange?: (value) => void;
onTypeChange?: (type: string) => void;
value: any;
}
export default class Header extends React.Component {
export default class Header extends React.Component<HeaderProps, any> {
static defaultProps = {
prefixCls: `${PREFIX_CLS}-header`,
yearSelectOffset: 10,
yearSelectTotal: 20,
onValueChange: noop,
onTypeChange: noop,
}
static propTypes = {
value: PropTypes.object,
locale: PropTypes.object,
yearSelectOffset: PropTypes.number,
yearSelectTotal: PropTypes.number,
onValueChange: PropTypes.func,
onTypeChange: PropTypes.func,
prefixCls: PropTypes.string,
selectPrefixCls: PropTypes.string,
type: PropTypes.string,
fullscreen: PropTypes.bool,
}
};
getYearSelectElement(year) {
const { yearSelectOffset, yearSelectTotal, locale, prefixCls, fullscreen } = this.props;
@@ -34,13 +30,13 @@ export default class Header extends React.Component {
const end = start + yearSelectTotal;
const suffix = locale.year === '年' ? '年' : '';
const options = [];
const options: React.ReactElement<any>[] = [];
for (let index = start; index < end; index++) {
options.push(<Option key={`${index}`}>{index + suffix}</Option>);
}
return (
<Select
size={fullscreen ? null : 'small'}
size={fullscreen ? 'default' : 'small'}
dropdownMatchSelectWidth={false}
className={`${prefixCls}-year-select`}
onChange={this.onYearChange}
@@ -51,11 +47,21 @@ export default class Header extends React.Component {
);
}
getMonthSelectElement(month) {
getMonthsLocale(value: moment.Moment) {
const current = value.clone();
const localeData = value.localeData();
const months: any[] = [];
for (let i = 0; i < 12; i++) {
current.month(i);
months.push(localeData.monthsShort(current));
}
return months;
}
getMonthSelectElement(month, months) {
const props = this.props;
const months = props.locale.format.months;
const { prefixCls, fullscreen } = props;
const options = [];
const options: React.ReactElement<any>[] = [];
for (let index = 0; index < 12; index++) {
options.push(<Option key={`${index}`}>{months[index]}</Option>);
@@ -63,7 +69,7 @@ export default class Header extends React.Component {
return (
<Select
size={fullscreen ? null : 'small'}
size={fullscreen ? 'default' : 'small'}
dropdownMatchSelectWidth={false}
className={`${prefixCls}-month-select`}
value={String(month)}
@@ -76,25 +82,36 @@ export default class Header extends React.Component {
onYearChange = (year) => {
const newValue = this.props.value.clone();
newValue.setYear(parseInt(year, 10));
this.props.onValueChange(newValue);
newValue.year(parseInt(year, 10));
const onValueChange = this.props.onValueChange;
if (onValueChange) {
onValueChange(newValue);
}
}
onMonthChange = (month) => {
const newValue = this.props.value.clone();
newValue.setMonth(parseInt(month, 10));
this.props.onValueChange(newValue);
newValue.month(parseInt(month, 10));
const onValueChange = this.props.onValueChange;
if (onValueChange) {
onValueChange(newValue);
}
}
onTypeChange = (e) => {
this.props.onTypeChange(e.target.value);
const onTypeChange = this.props.onTypeChange;
if (onTypeChange) {
onTypeChange(e.target.value);
}
}
render() {
const { type, value, prefixCls, locale, fullscreen } = this.props;
const yearSelect = this.getYearSelectElement(value.getYear());
const monthSelect = type === 'date' ? this.getMonthSelectElement(value.getMonth()) : null;
const size = fullscreen ? 'default' : 'small';
const yearSelect = this.getYearSelectElement(value.year());
const monthSelect = type === 'date' ?
this.getMonthSelectElement(value.month(), this.getMonthsLocale(value)) : null;
const size = (fullscreen ? 'default' : 'small') as any;
const typeSwitch = (
<Group onChange={this.onTypeChange} value={type} size={size}>
<Button value="date">{locale.month}</Button>

View File

@@ -1,6 +1,6 @@
---
order: 0
title:
title:
zh-CN: 基本
en-US: Basic
---

View File

@@ -1,6 +1,6 @@
---
order: 1
title:
title:
zh-CN: 自定义渲染
en-US: Custom Render
---
@@ -15,17 +15,18 @@ This component can be rendered by using `dateCellRender` and `monthCellRender` w
````jsx
import { Calendar } from 'antd';
import moment from 'moment';
function dateCellRender(value) {
return <div>自定义日数据 {value.getDayOfMonth()}</div>;
return <div>Custom date {value.date()}</div>;
}
function monthCellRender(value) {
return <div>自定义月数据 {value.getMonth()}</div>;
return <div>Custom monthly {value.month()}</div>;
}
ReactDOM.render(
<Calendar defaultValue={new Date('2010-10-10')}
<Calendar defaultValue={moment('2010-10-10', 'YYYY-MM-DD')}
dateCellRender={dateCellRender} monthCellRender={monthCellRender}
/>
, mountNode);

View File

@@ -7,21 +7,24 @@ title:
## zh-CN
通过 `locale` 配置时区、语言, 默认支持 en_US, zh_CN
通过 `locale` 配置语言, 默认支持 en_US, zh_CN
## en-US
To set the properties like time zone, language and etc. en_US, zh_CN are supported by default.
To set the language. en_US, zh_CN are supported by default.
````jsx
import { Calendar } from 'antd';
import enUS from 'antd/lib/calendar/locale/en_US';
import moment from 'moment';
// It's recommended to set moment locale globally, otherwise, you need to set it by `value` or `defaultValue`
// moment.locale('en');
function onPanelChange(value, mode) {
console.log(value, mode);
}
ReactDOM.render(
<Calendar onPanelChange={onPanelChange} locale={enUS} />
<Calendar defaultValue={moment().locale('en')} onPanelChange={onPanelChange} locale={enUS} />
, mountNode);
````

View File

@@ -18,26 +18,26 @@ import { Calendar } from 'antd';
function getListData(value) {
let listData;
switch (value.getDayOfMonth()) {
switch (value.date()) {
case 8:
listData = [
{ type: 'warning', content: '这里是警告事项.' },
{ type: 'normal', content: '这里是普通事项.' },
{ type: 'warning', content: 'This is warning event.' },
{ type: 'normal', content: 'This is usual event.' },
]; break;
case 10:
listData = [
{ type: 'warning', content: '这里是警告事项.' },
{ type: 'normal', content: '这里是普通事项.' },
{ type: 'error', content: '这里是错误事项.' },
{ type: 'warning', content: 'This is warning event.' },
{ type: 'normal', content: 'This is usual event.' },
{ type: 'error', content: 'This is error event.' },
]; break;
case 15:
listData = [
{ type: 'warning', content: '这里是警告事项.' },
{ type: 'normal', content: '这里是普通事项好长啊。。....' },
{ type: 'error', content: '这里是错误事项.' },
{ type: 'error', content: '这里是错误事项.' },
{ type: 'error', content: '这里是错误事项.' },
{ type: 'error', content: '这里是错误事项.' },
{ type: 'warning', content: 'This is warning event' },
{ type: 'normal', content: 'This is very long usual event。。....' },
{ type: 'error', content: 'This is error event.' },
{ type: 'error', content: 'This is error event.' },
{ type: 'error', content: 'This is error event.' },
{ type: 'error', content: 'This is error event.' },
]; break;
default:
}
@@ -61,16 +61,16 @@ function dateCellRender(value) {
}
function getMonthData(value) {
if (value.getMonth() === 8) {
if (value.month() === 8) {
return 1394;
}
}
function monthCellRender(value) {
let num = getMonthData(value);
const num = getMonthData(value);
return num ? <div className="notes-month">
<section>{num}</section>
<span>待办事项数</span>
<span>Backlog number</span>
</div> : null;
}

View File

@@ -5,9 +5,9 @@ cols: 1
title: Calendar
---
When to use container for displaying data in calendar form.
When To Use container for displaying data in calendar form.
## When to use
## 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.
@@ -23,11 +23,11 @@ When data is in the form of date, such as schedule, timetable, prices calendar,
| Property | Description | Type | Default |
|--------------|----------------|----------|--------------|
| value | set date | Date | current date |
| defaultValue | set default date | Date | current date |
| 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 | bool | true |
| dateCellRender | to set the way of renderer the date cell| function([GregorianCalendar](https://github.com/yiminghe/gregorian-calendar/))| - |
| monthCellRender | to set the way of renderer the month cell | function([GregorianCalendar](https://github.com/yiminghe/gregorian-calendar/)) | - |
| locale | set locale | object | [defualt](https://github.com/ant-design/ant-design/issues/424) |
| onPanelChange| the callback when panel change | function(date, mode) | - |
| fullscreen | to set whether full-screen display | boolean | true |
| dateCellRender | to set the way of renderer the date cell | function(date: moment): ReactNode | - |
| monthCellRender | to set the way of renderer the month cell | function(date: moment): ReactNode | - |
| locale | set locale | Object | [defualt](https://github.com/ant-design/ant-design/issues/424) |
| onPanelChange| the callback when panel change | function(date: moment, mode: string) | - |

View File

@@ -1,27 +1,48 @@
import React, { PropTypes } from 'react';
import GregorianCalendar from 'gregorian-calendar';
import defaultLocale from './locale/zh_CN';
import React from 'react';
import { PropTypes } from 'react';
import moment from 'moment';
import FullCalendar from 'rc-calendar/lib/FullCalendar';
import { PREFIX_CLS } from './Constants';
import Header from './Header';
import getLocale from '../_util/getLocale';
declare const require: Function;
function noop() { return null; }
function zerofixed(v) {
if (v < 10) return `0${v}`;
if (v < 10) {
return `0${v}`;
}
return `${v}`;
}
export default class Calendar extends React.Component {
export interface CalendarContext {
antLocale?: {
Calendar?: any
};
}
export interface CalendarProps {
prefixCls?: string;
className?: string;
value?: moment.Moment;
defaultValue?: moment.Moment;
mode?: 'month' | 'year';
fullscreen?: boolean;
dateCellRender?: (date: moment.Moment) => React.ReactNode;
monthCellRender?: (date: moment.Moment) => React.ReactNode;
locale?: any;
style?: React.CSSProperties;
onPanelChange?: (date: moment.Moment, mode: string) => void;
}
export default class Calendar extends React.Component<CalendarProps, any> {
static defaultProps = {
monthCellRender: noop,
dateCellRender: noop,
locale: {},
fullscreen: true,
prefixCls: PREFIX_CLS,
onPanelChange: noop,
mode: 'month',
}
};
static propTypes = {
monthCellRender: PropTypes.func,
@@ -32,72 +53,54 @@ export default class Calendar extends React.Component {
className: PropTypes.string,
style: PropTypes.object,
onPanelChange: PropTypes.func,
value: PropTypes.instanceOf(Date),
}
value: PropTypes.object,
};
static contextTypes = {
antLocale: PropTypes.object,
}
};
context: CalendarContext;
constructor(props) {
super(props);
this.state = {
value: this.parseDateFromValue(props.value || new Date()),
value: props.value || props.defaultValue || moment(),
mode: props.mode,
};
}
parseDateFromValue(value) {
const date = new GregorianCalendar(this.getLocale());
date.setTime(+value);
return date;
}
componentWillReceiveProps(nextProps) {
if ('value' in nextProps) {
this.setState({
value: this.parseDateFromValue(nextProps.value),
value: nextProps.value,
});
}
}
getLocale = () => {
const props = this.props;
let locale = defaultLocale;
const context = this.context;
if (context && context.antLocale && context.antLocale.Calendar) {
locale = context.antLocale.Calendar;
}
// 统一合并为完整的 Locale
const result = { ...locale, ...props.locale };
result.lang = { ...locale.lang, ...props.locale.lang };
return result;
}
monthCellRender = (value, locale) => {
const prefixCls = this.props.prefixCls;
const month = value.getMonth();
monthCellRender = (value) => {
const { prefixCls, monthCellRender = noop as Function } = this.props;
return (
<div className={`${prefixCls}-month`}>
<div className={`${prefixCls}-value`}>
{locale.format.shortMonths[month]}
{value.localeData().monthsShort(value)}
</div>
<div className={`${prefixCls}-content`}>
{this.props.monthCellRender(value)}
{monthCellRender(value)}
</div>
</div>
);
}
dateCellRender = (value) => {
const prefixCls = this.props.prefixCls;
const { prefixCls, dateCellRender = noop as Function } = this.props;
return (
<div className={`${prefixCls}-date`}>
<div className={`${prefixCls}-value`}>
{zerofixed(value.getDayOfMonth())}
{zerofixed(value.date())}
</div>
<div className={`${prefixCls}-content`}>
{this.props.dateCellRender(value)}
{dateCellRender(value)}
</div>
</div>
);
@@ -107,14 +110,20 @@ export default class Calendar extends React.Component {
if (!('value' in this.props) && this.state.value !== value) {
this.setState({ value });
}
this.props.onPanelChange(value, this.state.mode);
const onPanelChange = this.props.onPanelChange;
if (onPanelChange) {
onPanelChange(value, this.state.mode);
}
}
setType = (type) => {
const mode = (type === 'date') ? 'month' : 'year';
if (this.state.mode !== mode) {
this.setState({ mode });
this.props.onPanelChange(this.state.value, mode);
const onPanelChange = this.props.onPanelChange;
if (onPanelChange) {
onPanelChange(this.state.value, mode);
}
}
}
@@ -123,7 +132,10 @@ export default class Calendar extends React.Component {
const { value, mode } = this.state;
const { prefixCls, style, className, fullscreen } = props;
const type = (mode === 'year') ? 'month' : 'date';
const locale = this.getLocale();
const locale = getLocale(
props, this.context, 'Calendar',
() => require('./locale/zh_CN')
);
let cls = className || '';
if (fullscreen) {

View File

@@ -1,9 +1,9 @@
---
category: Components
type: Views
chinese: 日历
subtitle: 日历
cols: 1
english: Calendar
title: Calendar
---
按照日历形式展示数据的容器。
@@ -25,11 +25,11 @@ english: Calendar
| 参数 | 说明 | 类型 | 默认值 |
|--------------|----------------|----------|--------------|
| value | 展示日期 | Date | 当前日期 |
| defaultValue | 默认展示日期 | Date | 当前日期 |
| value | 展示日期 | [moment](http://momentjs.com/) | 当前日期 |
| defaultValue | 默认展示日期 | [moment](http://momentjs.com/) | 默认日期 |
| mode | 初始模式,`month/year` | string | month |
| fullscreen | 是否全屏显示 | bool | true |
| dateCellRender | 自定义渲染日期单元格| function([GregorianCalendar](https://github.com/yiminghe/gregorian-calendar/))| 无 |
| monthCellRender | 自定义渲染月单元格 | function([GregorianCalendar](https://github.com/yiminghe/gregorian-calendar/)) | 无 |
| locale | 国际化配置 | object | [默认配置](https://github.com/ant-design/ant-design/issues/424) |
| onPanelChange| 日期面板变化回调 | function(date, mode) | 无 |
| fullscreen | 是否全屏显示 | boolean | true |
| dateCellRender | 自定义渲染日期单元格| function(date: moment): ReactNode | 无 |
| monthCellRender | 自定义渲染月单元格 | function(date: moment): ReactNode | 无 |
| locale | 国际化配置 | Object | [默认配置](https://github.com/ant-design/ant-design/issues/424) |
| onPanelChange| 日期面板变化回调 | function(date: moment, mode: string) | 无 |

View File

@@ -1 +0,0 @@
module.exports = require('../../date-picker/locale/en_US');

View File

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

View File

@@ -1 +0,0 @@
module.exports = require('../../date-picker/locale/ru_RU');

View File

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

View File

@@ -1 +0,0 @@
module.exports = require('../../date-picker/locale/zh_CN');

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