From 4cc69cdd3fef406ff8cc9558d39866cde4cea1f5 Mon Sep 17 00:00:00 2001 From: Yuwei Ba Date: Thu, 26 Nov 2015 12:17:19 +0800 Subject: [PATCH 01/36] Upgrade rc-pagination to 1.3.0. --- components/pagination/demo/basic.md | 2 +- components/pagination/demo/changer.md | 2 +- components/pagination/demo/jump.md | 2 +- components/pagination/demo/locale.md | 4 ++-- components/pagination/demo/mini.md | 2 +- components/pagination/demo/more.md | 2 +- components/pagination/demo/simple.md | 2 +- components/pagination/demo/uncontrolled.md | 15 +++++++++++++++ package.json | 2 +- 9 files changed, 24 insertions(+), 9 deletions(-) create mode 100644 components/pagination/demo/uncontrolled.md diff --git a/components/pagination/demo/basic.md b/components/pagination/demo/basic.md index 809c312796..06b4ebd9c7 100644 --- a/components/pagination/demo/basic.md +++ b/components/pagination/demo/basic.md @@ -14,6 +14,6 @@ function onChange(page) { } ReactDOM.render( - , + , document.getElementById('components-pagination-demo-basic')); ```` diff --git a/components/pagination/demo/changer.md b/components/pagination/demo/changer.md index bcb9026b08..4a9c2e944f 100644 --- a/components/pagination/demo/changer.md +++ b/components/pagination/demo/changer.md @@ -18,6 +18,6 @@ function onShowSizeChange(current, pageSize) { } ReactDOM.render( - , + , document.getElementById('components-pagination-demo-changer')); ```` diff --git a/components/pagination/demo/jump.md b/components/pagination/demo/jump.md index 24882baddb..b58f7f9ca7 100644 --- a/components/pagination/demo/jump.md +++ b/components/pagination/demo/jump.md @@ -14,6 +14,6 @@ function onChange(page) { } ReactDOM.render( - , + , document.getElementById('components-pagination-demo-jump')); ```` diff --git a/components/pagination/demo/locale.md b/components/pagination/demo/locale.md index 36ac87c882..4d185ff654 100644 --- a/components/pagination/demo/locale.md +++ b/components/pagination/demo/locale.md @@ -1,6 +1,6 @@ # 国际化 -- order: 6 +- order: 7 通过 `locale` 配置时区、语言等, 默认支持 en_US, zh_CN @@ -15,6 +15,6 @@ function onChange(page) { } ReactDOM.render( - , + , document.getElementById('components-pagination-demo-locale')); ```` diff --git a/components/pagination/demo/mini.md b/components/pagination/demo/mini.md index e540c16cc8..208053ad5b 100644 --- a/components/pagination/demo/mini.md +++ b/components/pagination/demo/mini.md @@ -14,6 +14,6 @@ function onChange(page) { } ReactDOM.render( - , + , document.getElementById('components-pagination-demo-mini')); ```` diff --git a/components/pagination/demo/more.md b/components/pagination/demo/more.md index 5c3f2839a0..62a91e7c2b 100644 --- a/components/pagination/demo/more.md +++ b/components/pagination/demo/more.md @@ -14,6 +14,6 @@ function onChange(page) { } ReactDOM.render( - , + , document.getElementById('components-pagination-demo-more')); ```` diff --git a/components/pagination/demo/simple.md b/components/pagination/demo/simple.md index cef03f3026..5b91630dec 100644 --- a/components/pagination/demo/simple.md +++ b/components/pagination/demo/simple.md @@ -14,6 +14,6 @@ function onChange(page) { } ReactDOM.render( - , + , document.getElementById('components-pagination-demo-simple')); ```` diff --git a/components/pagination/demo/uncontrolled.md b/components/pagination/demo/uncontrolled.md new file mode 100644 index 0000000000..ec71dec5f1 --- /dev/null +++ b/components/pagination/demo/uncontrolled.md @@ -0,0 +1,15 @@ +# 简洁 + +- order: 8 + +不受控制的页码。 + +--- + +````jsx +import { Pagination } from 'antd'; + +ReactDOM.render( + , +document.getElementById('components-pagination-demo-uncontrolled')); +```` diff --git a/package.json b/package.json index 199af4d5c6..606a9c44f5 100644 --- a/package.json +++ b/package.json @@ -48,7 +48,7 @@ "rc-input-number": "~2.4.1", "rc-menu": "~4.8.1", "rc-notification": "~1.3.0", - "rc-pagination": "~1.2.1", + "rc-pagination": "~1.3.0", "rc-progress": "~1.0.4", "rc-queue-anim": "~0.11.2", "rc-radio": "~2.0.0", From 3cd55c905b0f2696861ff9c7d8e66e1ee35c12c5 Mon Sep 17 00:00:00 2001 From: afc163 Date: Thu, 26 Nov 2015 14:57:40 +0800 Subject: [PATCH 02/36] update rc-table version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 199af4d5c6..b890902727 100644 --- a/package.json +++ b/package.json @@ -56,7 +56,7 @@ "rc-slider": "~3.1.2", "rc-steps": "~1.4.1", "rc-switch": "~1.3.1", - "rc-table": "~3.6.1", + "rc-table": "~3.6.2", "rc-tabs": "~5.5.0", "rc-time-picker": "~0.7.1", "rc-tooltip": "~3.2.0", From 8a1736c1d0081e3d4595cec0ad596e3666826589 Mon Sep 17 00:00:00 2001 From: afc163 Date: Thu, 26 Nov 2015 15:23:04 +0800 Subject: [PATCH 03/36] remove .lesslintrc --- .lesslintrc | 6 ------ 1 file changed, 6 deletions(-) delete mode 100644 .lesslintrc diff --git a/.lesslintrc b/.lesslintrc deleted file mode 100644 index db9004bc8b..0000000000 --- a/.lesslintrc +++ /dev/null @@ -1,6 +0,0 @@ -{ - "import": false, - "require-newline": false, - "leading-zero": false, - "single-comment": false -} From 83f176f2f6292ebb14b39c9ea1e820193682b2d8 Mon Sep 17 00:00:00 2001 From: Yuwei Ba Date: Thu, 26 Nov 2015 17:15:18 +0800 Subject: [PATCH 04/36] Update demo. --- components/pagination/demo/basic.md | 6 +---- components/pagination/demo/changer.md | 6 +---- components/pagination/demo/jump.md | 6 +---- components/pagination/demo/locale.md | 6 +---- components/pagination/demo/mini.md | 6 +---- components/pagination/demo/more.md | 6 +---- components/pagination/demo/simple.md | 6 +---- components/pagination/demo/uncontrolled.md | 26 ++++++++++++++++++---- 8 files changed, 29 insertions(+), 39 deletions(-) diff --git a/components/pagination/demo/basic.md b/components/pagination/demo/basic.md index 06b4ebd9c7..e99d942366 100644 --- a/components/pagination/demo/basic.md +++ b/components/pagination/demo/basic.md @@ -9,11 +9,7 @@ ````jsx import { Pagination } from 'antd'; -function onChange(page) { - console.log(page); -} - ReactDOM.render( - , + , document.getElementById('components-pagination-demo-basic')); ```` diff --git a/components/pagination/demo/changer.md b/components/pagination/demo/changer.md index 4a9c2e944f..29544db5ce 100644 --- a/components/pagination/demo/changer.md +++ b/components/pagination/demo/changer.md @@ -9,15 +9,11 @@ ````jsx import { Pagination } from 'antd'; -function onChange(page) { - console.log(page); -} - function onShowSizeChange(current, pageSize) { console.log(current, pageSize); } ReactDOM.render( - , + , document.getElementById('components-pagination-demo-changer')); ```` diff --git a/components/pagination/demo/jump.md b/components/pagination/demo/jump.md index b58f7f9ca7..7961acd82c 100644 --- a/components/pagination/demo/jump.md +++ b/components/pagination/demo/jump.md @@ -9,11 +9,7 @@ ````jsx import { Pagination } from 'antd'; -function onChange(page) { - console.log(page); -} - ReactDOM.render( - , + , document.getElementById('components-pagination-demo-jump')); ```` diff --git a/components/pagination/demo/locale.md b/components/pagination/demo/locale.md index 4d185ff654..edb15f56e4 100644 --- a/components/pagination/demo/locale.md +++ b/components/pagination/demo/locale.md @@ -10,11 +10,7 @@ import { Pagination } from 'antd'; import enUS from 'antd/lib/pagination/locale/en_US'; -function onChange(page) { - console.log(page); -} - ReactDOM.render( - , + , document.getElementById('components-pagination-demo-locale')); ```` diff --git a/components/pagination/demo/mini.md b/components/pagination/demo/mini.md index 208053ad5b..8b1b693a06 100644 --- a/components/pagination/demo/mini.md +++ b/components/pagination/demo/mini.md @@ -9,11 +9,7 @@ ````jsx import { Pagination } from 'antd'; -function onChange(page) { - console.log(page); -} - ReactDOM.render( - , + , document.getElementById('components-pagination-demo-mini')); ```` diff --git a/components/pagination/demo/more.md b/components/pagination/demo/more.md index 62a91e7c2b..8ac0d91c7f 100644 --- a/components/pagination/demo/more.md +++ b/components/pagination/demo/more.md @@ -9,11 +9,7 @@ ````jsx import { Pagination } from 'antd'; -function onChange(page) { - console.log(page); -} - ReactDOM.render( - , + , document.getElementById('components-pagination-demo-more')); ```` diff --git a/components/pagination/demo/simple.md b/components/pagination/demo/simple.md index 5b91630dec..6f1a08f05b 100644 --- a/components/pagination/demo/simple.md +++ b/components/pagination/demo/simple.md @@ -9,11 +9,7 @@ ````jsx import { Pagination } from 'antd'; -function onChange(page) { - console.log(page); -} - ReactDOM.render( - , + , document.getElementById('components-pagination-demo-simple')); ```` diff --git a/components/pagination/demo/uncontrolled.md b/components/pagination/demo/uncontrolled.md index ec71dec5f1..a8187100cc 100644 --- a/components/pagination/demo/uncontrolled.md +++ b/components/pagination/demo/uncontrolled.md @@ -1,15 +1,33 @@ -# 简洁 +# 受控 - order: 8 -不受控制的页码。 +受控制的页码。 --- ````jsx import { Pagination } from 'antd'; +let Container = React.createClass({ + getInitialState() { + return { + current: 3 + }; + }, + onChange(page) { + console.log(page); + this.setState({ + current: page + }); + }, + render() { + return ; + } +}); + ReactDOM.render( - , -document.getElementById('components-pagination-demo-uncontrolled')); +, +document.getElementById('components-pagination-demo-aaa')); ```` + From 849f080999705d04c71c49f4abce95968aaf09f4 Mon Sep 17 00:00:00 2001 From: Yuwei Ba Date: Thu, 26 Nov 2015 18:28:04 +0800 Subject: [PATCH 05/36] Upgrade dependency. --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 606a9c44f5..662edcf8f1 100644 --- a/package.json +++ b/package.json @@ -48,7 +48,7 @@ "rc-input-number": "~2.4.1", "rc-menu": "~4.8.1", "rc-notification": "~1.3.0", - "rc-pagination": "~1.3.0", + "rc-pagination": "~1.3.2", "rc-progress": "~1.0.4", "rc-queue-anim": "~0.11.2", "rc-radio": "~2.0.0", From 8d36dc6fe5d7e4ecb004279168ceeb64c3b4aa4d Mon Sep 17 00:00:00 2001 From: afc163 Date: Thu, 26 Nov 2015 19:32:55 +0800 Subject: [PATCH 06/36] Add simple lesshint support --- .lesshintrc | 12 ++++ package.json | 6 +- style/components/alert.less | 3 +- style/components/badge.less | 7 ++- style/components/button.less | 6 +- style/components/calendar.less | 8 ++- style/components/carousel/slick-theme.less | 8 ++- style/components/collapse.less | 20 +++---- style/components/datepicker/Calendar.less | 9 ++- style/components/datepicker/DecadePanel.less | 5 +- style/components/datepicker/YearPanel.less | 5 +- style/components/dialog.less | 4 +- style/components/dialog/Dialog.less | 2 +- style/components/form.less | 27 +++++---- style/components/inputNumber.less | 33 ++++++----- style/components/menu.less | 23 +++++--- style/components/message.less | 2 +- style/components/notification.less | 58 ++++++++++---------- style/components/pagination.less | 28 ++++++---- style/components/popover.less | 16 ++++-- style/components/progress.less | 2 +- style/components/radio.less | 2 +- style/components/select.less | 13 +++-- style/components/slider.less | 6 +- style/components/spin.less | 10 +++- style/components/steps.less | 6 +- style/components/switch.less | 28 ++++------ style/components/table.less | 25 +++++---- style/components/tabs.less | 11 ++-- style/components/timepicker/Select.less | 2 +- style/components/tooltip.less | 16 ++++-- style/components/tree.less | 2 +- style/components/typography.less | 3 +- style/components/upload.less | 26 ++++----- style/core/base.less | 4 +- style/core/index.less | 3 +- style/core/motion.less | 6 +- style/core/motion/fade.less | 3 +- style/core/motion/move.less | 3 +- style/core/motion/other.less | 3 +- style/core/motion/slide.less | 3 +- style/core/motion/swing.less | 9 ++- style/core/motion/zoom.less | 3 +- style/mixins/button.less | 2 +- style/mixins/form.less | 3 +- style/mixins/input.less | 2 +- style/mixins/vendor-prefixes.less | 12 +++- 47 files changed, 293 insertions(+), 197 deletions(-) create mode 100644 .lesshintrc diff --git a/.lesshintrc b/.lesshintrc new file mode 100644 index 0000000000..3aeecaf82e --- /dev/null +++ b/.lesshintrc @@ -0,0 +1,12 @@ +{ + "propertyOrdering": false, + "hexLength": "short", + "stringQuotes": false, + "decimalZero": false, + "importantRule": false, + "zeroUnit": "no_unit", + "qualifyingElement": false, + "duplicateProperty": false, + "importPath": false, + "finalNewline": false +} diff --git a/package.json b/package.json index b890902727..583c85b2e1 100644 --- a/package.json +++ b/package.json @@ -84,6 +84,7 @@ "eslint": "^1.1.0", "eslint-config-airbnb": "^1.0.0", "eslint-plugin-babel": "^2.1.1", + "eslint-plugin-markdown": "git+https://github.com/ant-design/eslint-plugin-markdown.git", "eslint-plugin-react": "^3.3.1", "expect.js": "~0.3.1", "extract-text-webpack-plugin": "^0.9.1", @@ -93,6 +94,7 @@ "json-loader": "^0.5.1", "less": "~2.5.3", "less-loader": "^2.2.0", + "lesshint": "git+https://github.com/ant-design/lesshint.git", "lodash": "^3.10.0", "nico-jsx": "~0.6.0", "pre-commit": "1.x", @@ -100,7 +102,6 @@ "react-addons-test-utils": "~0.14.2", "react-dom": "~0.14.2", "react-router": "~1.0.0", - "eslint-plugin-markdown": "git+https://github.com/ant-design/eslint-plugin-markdown.git", "webpack": "^1.10.1", "webpack-babel-jest": "^1.0.0", "webpack-dev-middleware": "^1.2.0" @@ -111,8 +112,9 @@ "clean": "rm -rf _site dist", "deploy": "rm -rf node_modules && node scripts/install.js && npm run just-deploy", "just-deploy": "npm run clean && webpack --config webpack.deploy.config.js && webpack --config webpack.antd.config.js && NODE_ENV=PRODUCTION nico build && node scripts/deploy.js", - "lint": "eslint components test index.js --ext '.js,.jsx' && npm run mdlint", + "lint": "eslint components test index.js --ext '.js,.jsx' && npm run mdlint && npm run lesshint", "mdlint": "eslint components/*/demo/*.md --ext '.md' --global 'React,ReactDOM' --rule 'no-console: 0'", + "lesshint": "lesshint style/ -e 'style/+(core|mixins)/+(base|iconfont|normalize|layouts|compatibility|grid).less'", "test": "npm run lint && webpack && npm run jest", "jest": "jest", "pub": "sh ./scripts/publish.sh", diff --git a/style/components/alert.less b/style/components/alert.less index 423b77e73c..098ed93648 100644 --- a/style/components/alert.less +++ b/style/components/alert.less @@ -55,7 +55,8 @@ } } - &-close-icon, &-with-description-close-icon { + &-close-icon, + &-with-description-close-icon { font-size: 12px; position: absolute; right: 8px; diff --git a/style/components/badge.less b/style/components/badge.less index 51ac45855f..cdcbd861f6 100644 --- a/style/components/badge.less +++ b/style/components/badge.less @@ -24,7 +24,8 @@ z-index: 10; font-family: tahoma; box-shadow: 0 0 0 1px #fff; - a, a:hover { + a, + a:hover { color: #fff; } } @@ -63,9 +64,9 @@ a .@{badge-prefix-cls} { } } -.@{number-prefix-cls}{ +.@{number-prefix-cls} { overflow: hidden; - &-only{ + &-only { display: inline-block; transition: transform .3s @ease-in-out; } diff --git a/style/components/button.less b/style/components/button.less index 79c9ec9204..5995a585ca 100644 --- a/style/components/button.less +++ b/style/components/button.less @@ -34,7 +34,8 @@ .btn-ghost; } - &-circle, &-circle-outline { + &-circle, + &-circle-outline { .btn-circle(@btn-prefix-cls); } @@ -79,7 +80,8 @@ } // To ensure that a space will be placed between character and `Icon`. - > .@{iconfont-css-prefix} + span, > span + .@{iconfont-css-prefix} { + > .@{iconfont-css-prefix} + span, + > span + .@{iconfont-css-prefix} { margin-left: 0.5em; } } diff --git a/style/components/calendar.less b/style/components/calendar.less index 8e21b94add..2a5cd92181 100644 --- a/style/components/calendar.less +++ b/style/components/calendar.less @@ -47,8 +47,10 @@ height: 246px; } - table, td, th, td { - border: none; + table, + th, + td { + border: 0; } td { @@ -150,7 +152,7 @@ } &-fullscreen { - border-top: none; + border-top: 0; } &-fullscreen &-table { diff --git a/style/components/carousel/slick-theme.less b/style/components/carousel/slick-theme.less index fcb5557412..c963854aaf 100644 --- a/style/components/carousel/slick-theme.less +++ b/style/components/carousel/slick-theme.less @@ -16,9 +16,10 @@ top: 50%; margin-top: -10px; padding: 0; - border: none; + border: 0; outline: none; - &:hover, &:focus { + &:hover, + &:focus { outline: none; background: transparent; color: transparent; @@ -79,7 +80,8 @@ color: transparent; padding: 5px; cursor: pointer; - &:hover, &:focus { + &:hover, + &:focus { outline: none; &:before { opacity: 1; diff --git a/style/components/collapse.less b/style/components/collapse.less index 0630b5534a..ee4e3362b2 100644 --- a/style/components/collapse.less +++ b/style/components/collapse.less @@ -1,12 +1,10 @@ @collapse-prefix-cls: ant-collapse; -#arrow { - .close() { - .iconfont-size-under-12px(7px, 270deg); - } - .open() { - .iconfont-size-under-12px(7px, 360deg); - } +.collapse-close() { + .iconfont-size-under-12px(7px, 270deg); +} +.collapse-open() { + .iconfont-size-under-12px(7px, 360deg); } .@{collapse-prefix-cls} { @@ -17,7 +15,7 @@ & > &-item { border-top: 1px solid #d9d9d9; &:first-child { - border-top: none; + border-top: 0; } > .@{collapse-prefix-cls}-header { @@ -29,7 +27,7 @@ position: relative; .arrow { - #arrow > .close(); + .collapse-close(); .iconfont-mixin(); position: absolute; color: #666; @@ -44,7 +42,7 @@ top: ~"16px \9"; left: ~"0 \9"; &:before { - content:"\e611"; + content: "\e611"; } } } @@ -80,7 +78,7 @@ & > &-item > &-header[aria-expanded="true"] { .arrow { - #arrow > .open(); + .collapse-open(); } } } diff --git a/style/components/datepicker/Calendar.less b/style/components/datepicker/Calendar.less index fab776734b..22ce55c1b9 100644 --- a/style/components/datepicker/Calendar.less +++ b/style/components/datepicker/Calendar.less @@ -115,8 +115,10 @@ width: 100%; } - table, td, th, td { - border: none; + table, + th, + td { + border: 0; } &-calendar-table { @@ -206,7 +208,8 @@ border-bottom-right-radius: 4px; } - &-last-month-cell &-date, &-next-month-btn-day &-date { + &-last-month-cell &-date, + &-next-month-btn-day &-date { color: #bbb; } diff --git a/style/components/datepicker/DecadePanel.less b/style/components/datepicker/DecadePanel.less index f2b6e3a345..f873876fd6 100644 --- a/style/components/datepicker/DecadePanel.less +++ b/style/components/datepicker/DecadePanel.less @@ -57,8 +57,9 @@ } } -.@{calendar-prefix-cls}-decade-panel-last-century-cell, .@{calendar-prefix-cls}-decade-panel-next-century-cell { - .@{calendar-prefix-cls}-decade-panel-decade{ +.@{calendar-prefix-cls}-decade-panel-last-century-cell, +.@{calendar-prefix-cls}-decade-panel-next-century-cell { + .@{calendar-prefix-cls}-decade-panel-decade { user-select: none; -webkit-user-select: none; } diff --git a/style/components/datepicker/YearPanel.less b/style/components/datepicker/YearPanel.less index 3ed7be2add..2c59554592 100644 --- a/style/components/datepicker/YearPanel.less +++ b/style/components/datepicker/YearPanel.less @@ -57,8 +57,9 @@ } } -.@{calendar-prefix-cls}-year-panel-last-decade-cell, .@{calendar-prefix-cls}-year-panel-next-decade-cell { - .@{calendar-prefix-cls}-year-panel-year{ +.@{calendar-prefix-cls}-year-panel-last-decade-cell, +.@{calendar-prefix-cls}-year-panel-next-decade-cell { + .@{calendar-prefix-cls}-year-panel-year { user-select: none; -webkit-user-select: none; } diff --git a/style/components/dialog.less b/style/components/dialog.less index 9a9c66f7a1..92b2cb6dcb 100644 --- a/style/components/dialog.less +++ b/style/components/dialog.less @@ -1,7 +1,7 @@ @dialog-prefix-cls: ant-modal; -@import "./dialog/Dialog.less"; -@import "./dialog/Mask.less"; +@import "./dialog/Dialog"; +@import "./dialog/Mask"; .@{dialog-prefix-cls} { &-header { diff --git a/style/components/dialog/Dialog.less b/style/components/dialog/Dialog.less index f505302f1e..1fd0f970d2 100644 --- a/style/components/dialog/Dialog.less +++ b/style/components/dialog/Dialog.less @@ -25,7 +25,7 @@ &-content { position: relative; background-color: #fff; - border: none; + border: 0; border-radius: @border-radius-base; background-clip: padding-box; outline: 0; diff --git a/style/components/form.less b/style/components/form.less index 6122c29f37..be5a3b3f53 100644 --- a/style/components/form.less +++ b/style/components/form.less @@ -86,7 +86,8 @@ input[type="checkbox"] { } } -.@{css-prefix}form-text, .@{css-prefix}form-split { +.@{css-prefix}form-text, +.@{css-prefix}form-split { margin: 0!important; padding-top: 7px; padding-bottom: 7px; @@ -243,7 +244,8 @@ form { } } -.@{css-prefix}form-horizontal, .@{css-prefix}form-inline { +.@{css-prefix}form-horizontal, +.@{css-prefix}form-inline { label { padding-top: 7px; padding-bottom: 7px; @@ -255,7 +257,10 @@ form { } // Validation state -.has-success, .has-warning, .has-error, .is-validating { +.has-success, +.has-warning, +.has-error, +.is-validating { &.has-feedback:after { position: absolute; bottom: 0; @@ -382,36 +387,36 @@ form { .is-validating { &.has-feedback:after { display: inline-block; - .animation(loadingCircle 1s infinite linear ); - content:"\e6a1"; + .animation(loadingCircle 1s infinite linear); + content: "\e6a1"; } } // need there different zoom animation // otherwise won't trigger anim @keyframes diffZoomIn1 { - 0%{ + 0% { transform: scale(0); } - 100%{ + 100% { transform: scale(1); } } @keyframes diffZoomIn2 { - 0%{ + 0% { transform: scale(0); } - 100%{ + 100% { transform: scale(1); } } @keyframes diffZoomIn3 { - 0%{ + 0% { transform: scale(0); } - 100%{ + 100% { transform: scale(1); } } diff --git a/style/components/inputNumber.less b/style/components/inputNumber.less index 105e3e217b..6b8759550a 100644 --- a/style/components/inputNumber.less +++ b/style/components/inputNumber.less @@ -3,6 +3,16 @@ @import "../mixins/iconfont"; @import "../mixins/input"; +.handler-disabled() { + opacity: 0.72; + color: #ccc !important; + cursor: default; + &:hover { + color: #ccc; + cursor: default; + } +} + .@{input-number-prefix-cls} { .input(); margin: 0; @@ -12,7 +22,7 @@ height: 28px; display: inline-block; vertical-align: middle; - border: 1px solid #D9D9D9; + border: 1px solid #d9d9d9; border-radius: @border-radius-base; overflow: hidden; width: 90px; @@ -36,7 +46,8 @@ } } - &-handler-up-inner, &-handler-down-inner { + &-handler-up-inner, + &-handler-down-inner { .iconfont-mixin(); line-height: 12px; user-select: none; @@ -149,7 +160,7 @@ &-handler-wrap { float: right; - border-left: 1px solid #D9D9D9; + border-left: 1px solid #d9d9d9; width: 22px; height: 28px; position: relative; @@ -179,7 +190,7 @@ } &-handler-down { - border-top: 1px solid #D9D9D9; + border-top: 1px solid #d9d9d9; top: -1px; cursor: pointer; &-inner { @@ -194,17 +205,9 @@ } } - .handler-disabled() { - opacity: 0.72; - color: #ccc !important; - cursor: default; - &:hover { - color: #ccc; - cursor: default; - } - } - - &-handler-down-disabled, &-handler-up-disabled, &-disabled { + &-handler-down-disabled, + &-handler-up-disabled, + &-disabled { .@{input-number-prefix-cls}-handler-down-inner, .@{input-number-prefix-cls}-handler-up-inner { .handler-disabled(); diff --git a/style/components/menu.less b/style/components/menu.less index 7a452ba196..6793ebd4a3 100644 --- a/style/components/menu.less +++ b/style/components/menu.less @@ -35,7 +35,6 @@ transition: all 0.3s ease; } - &-item-active, &-submenu-title:hover { background-color: tint(@primary-color, 90%); @@ -98,7 +97,8 @@ white-space: nowrap; // Disabled state sets text to gray and nukes hover/tab effects - &.@{menu-prefix-cls}-item-disabled, &.@{menu-prefix-cls}-submenu-disabled { + &.@{menu-prefix-cls}-item-disabled, + &.@{menu-prefix-cls}-submenu-disabled { color: #999 !important; } } @@ -166,7 +166,7 @@ } &-horizontal { - border: none; + border: 0; border-bottom: 1px solid #e9e9e9; box-shadow: none; z-index: 0; @@ -191,7 +191,8 @@ &:hover { color: @primary-color; } - &:before, &:after { + &:before, + &:after { position: absolute; background-color: transparent; width: 20px; @@ -212,8 +213,10 @@ } } - &-vertical, &-inline { - & > .@{menu-prefix-cls}-item, & > .@{menu-prefix-cls}-submenu > .@{menu-prefix-cls}-submenu-title { + &-vertical, + &-inline { + & > .@{menu-prefix-cls}-item, + & > .@{menu-prefix-cls}-submenu > .@{menu-prefix-cls}-submenu-title { padding: 0px 16px 0 28px; font-size: 12px; line-height: 42px; @@ -224,7 +227,8 @@ &-vertical&-sub { padding: 0; transform-origin: 0 0; - & > .@{menu-prefix-cls}-item, & > .@{menu-prefix-cls}-submenu { + & > .@{menu-prefix-cls}-item, + & > .@{menu-prefix-cls}-submenu { transform-origin: 0 0; } } @@ -236,10 +240,11 @@ &-sub&-inline { padding: 0; - border: none; + border: 0; box-shadow: none; border-radius: 0; - & > .@{menu-prefix-cls}-item, & > .@{menu-prefix-cls}-submenu > .@{menu-prefix-cls}-submenu-title { + & > .@{menu-prefix-cls}-item, + & > .@{menu-prefix-cls}-submenu > .@{menu-prefix-cls}-submenu-title { line-height: 42px; height: 42px; list-style-type: disc; diff --git a/style/components/message.less b/style/components/message.less index 81d9c34b39..6cc9ed528d 100644 --- a/style/components/message.less +++ b/style/components/message.less @@ -34,7 +34,7 @@ } &-info.anticon, - &-loading.anticon { + &-loading.anticon { color: @primary-color; } diff --git a/style/components/notification.less b/style/components/notification.less index b8a8b71931..66aeaca1a4 100644 --- a/style/components/notification.less +++ b/style/components/notification.less @@ -90,13 +90,14 @@ } } - .notification-fade-effect() { + .notification-fade-effect { animation-duration: 0.3s; animation-fill-mode: both; animation-timing-function: @ease-in-out; } - &-fade-enter,&-fade-appear { + &-fade-enter, + &-fade-appear { opacity: 0; .notification-fade-effect(); animation-play-state: paused; @@ -107,7 +108,8 @@ animation-play-state: paused; } - &-fade-enter&-fade-enter-active, &-fade-appear&-fade-appear-active { + &-fade-enter&-fade-enter-active, + &-fade-appear&-fade-appear-active { animation-name: NotificationFadeIn; animation-play-state: running; } @@ -116,32 +118,32 @@ animation-name: NotificationFadeOut; animation-play-state: running; } +} - @keyframes NotificationFadeIn { - 0% { - opacity: 0; - left: @notice-width; - } - 100% { - left: 0; - opacity: 1; - } +@keyframes NotificationFadeIn { + 0% { + opacity: 0; + left: @notice-width; } - - @keyframes NotificationFadeOut { - 0% { - opacity: 1; - margin-bottom: @notice-margin-bottom; - padding-top: @notice-padding; - padding-bottom: @notice-padding; - max-height: 150px; - } - 100% { - opacity: 0; - margin-bottom: 0; - padding-top: 0; - padding-bottom: 0; - max-height: 0; - } + 100% { + left: 0; + opacity: 1; + } +} + +@keyframes NotificationFadeOut { + 0% { + opacity: 1; + margin-bottom: @notice-margin-bottom; + padding-top: @notice-padding; + padding-bottom: @notice-padding; + max-height: 150px; + } + 100% { + opacity: 0; + margin-bottom: 0; + padding-top: 0; + padding-bottom: 0; + max-height: 0; } } diff --git a/style/components/pagination.less b/style/components/pagination.less index ec6d797c97..d0236e34af 100644 --- a/style/components/pagination.less +++ b/style/components/pagination.less @@ -52,8 +52,8 @@ } } - &-jump-prev, &-jump-next { - + &-jump-prev, + &-jump-next { &:after { content: "•••"; display: block; @@ -89,10 +89,15 @@ } } - &-prev, &-jump-prev, &-jump-next { + &-prev, + &-jump-prev, + &-jump-next { margin-right: 8px; } - &-prev, &-next, &-jump-prev, &-jump-next { + &-prev, + &-next, + &-jump-prev, + &-jump-next { font-family: Arial; cursor: pointer; color: #666; @@ -107,7 +112,8 @@ display: inline-block; } - &-prev, &-next { + &-prev, + &-next { border: 1px solid #d9d9d9; a { @@ -192,8 +198,9 @@ } } - &-simple &-prev, &-simple &-next { - border: none; + &-simple &-prev, + &-simple &-next { + border: 0; height: 24px; line-height: 24px; margin: 0; @@ -227,7 +234,7 @@ .@{pagination-prefix-cls} { &.mini &-item { - border: none; + border: 0; margin: 0; min-width: 20px; height: 20px; @@ -240,7 +247,7 @@ min-width: 20px; height: 20px; line-height: 20px; - border: none; + border: 0; a { &:after { @@ -250,7 +257,8 @@ } } - &.mini &-jump-prev, &.mini &-jump-next { + &.mini &-jump-prev, + &.mini &-jump-next { height: 20px; line-height: 20px; } diff --git a/style/components/popover.less b/style/components/popover.less index 697afe88c2..ab91fb0210 100644 --- a/style/components/popover.less +++ b/style/components/popover.less @@ -52,22 +52,30 @@ } // Offset the popover to account for the popover arrow - &-placement-top, &-placement-topLeft, &-placement-topRight { + &-placement-top, + &-placement-topLeft, + &-placement-topRight { margin-top: -@popover-arrow-width; padding-bottom: @popover-distance; } - &-placement-right, &-placement-rightTop, &-placement-rightBottom { + &-placement-right, + &-placement-rightTop, + &-placement-rightBottom { margin-left: @popover-arrow-width; padding-left: @popover-distance; } - &-placement-bottom, &-placement-bottomLeft, &-placement-bottomRight { + &-placement-bottom, + &-placement-bottomLeft, + &-placement-bottomRight { margin-top: @popover-arrow-width; padding-top: @popover-distance; } - &-placement-left, &-placement-leftTop, &-placement-leftBottom { + &-placement-left, + &-placement-leftTop, + &-placement-leftBottom { margin-left: -@popover-arrow-width; padding-right: @popover-distance; } diff --git a/style/components/progress.less b/style/components/progress.less index 62ad1af7f9..cdae4ab0fa 100644 --- a/style/components/progress.less +++ b/style/components/progress.less @@ -21,7 +21,7 @@ &-line-inner { display: inline-block; width: 100%; - background-color: #E9E9E9; + background-color: #e9e9e9; border-radius: 100px; } &-line-bg { diff --git a/style/components/radio.less b/style/components/radio.less index 2ff5bbcbd4..0bbef428f3 100644 --- a/style/components/radio.less +++ b/style/components/radio.less @@ -215,7 +215,7 @@ &-disabled.@{radio-prefix-cls}-button-checked { color: #fff; background-color: #ccc; - box-shadow: -1px 0px 0px 0px #CCC; + box-shadow: -1px 0px 0px 0px #ccc; border-color: #ccc; } } diff --git a/style/components/select.less b/style/components/select.less index 53ce016fc1..93f34caa7e 100644 --- a/style/components/select.less +++ b/style/components/select.less @@ -21,7 +21,7 @@ right: -1px; padding-right: 14px; color: @primary-color; - transform: scale(0.75) + transform: scale(0.75); } } @@ -86,7 +86,8 @@ } &-disabled &-selection { - &:hover, &:active { + &:hover, + &:active { border-color: #d9d9d9; } } @@ -190,7 +191,7 @@ } .@{select-prefix-cls}-search__field { - border: none; + border: 0; font-size: 100%; background: transparent; outline: 0; @@ -407,7 +408,8 @@ border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; } - &:hover, &-active { + &:hover, + &-active { background-color: tint(@primary-color, 90%) !important; } @@ -433,7 +435,8 @@ } } - &-container-open, &-open { + &-container-open, + &-open { .@{select-prefix-cls}-dropdown { display: block; } diff --git a/style/components/slider.less b/style/components/slider.less index 940fcb8d7a..34f8a3e9e3 100644 --- a/style/components/slider.less +++ b/style/components/slider.less @@ -126,13 +126,15 @@ background-color: @slider-disabled-color !important; } - .@{slider-prefix-cls}-handle, .@{slider-prefix-cls}-dot { + .@{slider-prefix-cls}-handle, + .@{slider-prefix-cls}-dot { border-color: @slider-disabled-color!important; background-color: #fff; cursor: not-allowed; } - .@{slider-prefix-cls}-mark-text, .@{slider-prefix-cls}-dot { + .@{slider-prefix-cls}-mark-text, + .@{slider-prefix-cls}-dot { cursor: not-allowed!important; } } diff --git a/style/components/spin.less b/style/components/spin.less index 0fa06e49ed..874658459e 100644 --- a/style/components/spin.less +++ b/style/components/spin.less @@ -83,8 +83,14 @@ // pulse @keyframes antSpinPulse { - 0%, 80%, 100% { opacity: 0; } - 40% { opacity: 1; } + 0%, + 80%, + 100% { + opacity: 0; + } + 40% { + opacity: 1; + } } @media all and (-ms-high-contrast: none), (-ms-high-contrast: active) { diff --git a/style/components/steps.less b/style/components/steps.less index 464c837f1b..ab8df68ce7 100644 --- a/style/components/steps.less +++ b/style/components/steps.less @@ -104,7 +104,8 @@ } } - .@{steps-prefix-cls}-head, .@{steps-prefix-cls}-main { + .@{steps-prefix-cls}-head, + .@{steps-prefix-cls}-main { position: relative; display: inline-block; vertical-align: top; @@ -222,7 +223,8 @@ } } - &.@{steps-prefix-cls}-small .@{steps-prefix-cls}-item.@{steps-prefix-cls}-custom .@{steps-prefix-cls}-head-inner, .@{steps-prefix-cls}-item.@{steps-prefix-cls}-custom .@{steps-prefix-cls}-head-inner { + &.@{steps-prefix-cls}-small .@{steps-prefix-cls}-item.@{steps-prefix-cls}-custom .@{steps-prefix-cls}-head-inner, + .@{steps-prefix-cls}-item.@{steps-prefix-cls}-custom .@{steps-prefix-cls}-head-inner { width: inherit; height: inherit; line-height: inherit; diff --git a/style/components/switch.less b/style/components/switch.less index 128fd26c3c..c118dafc9a 100644 --- a/style/components/switch.less +++ b/style/components/switch.less @@ -2,7 +2,7 @@ @switch-duration:.3s; -.@{switch-prefix-cls}{ +.@{switch-prefix-cls} { position: relative; display: inline-block; box-sizing: border-box; @@ -18,18 +18,18 @@ user-select: none; &-inner { - color:#fff; + color: #fff; font-size: 12px; position: absolute; left: 24px; } - &:after{ + &:after { position: absolute; width: 18px; height: 18px; left: 2px; - top:1px; + top: 1px; border-radius: 100%; background-color: #fff; content: " "; @@ -37,37 +37,31 @@ transition: left @switch-duration @ease-in-out-circ; } - &:hover:after{ - } - - &-checked{ + &-checked { border: 1px solid @primary-color; background-color: @primary-color; .@{switch-prefix-cls}-inner { - left:6px; + left: 6px; } - &:after{ + &:after { left: 22px; } } - &-disabled{ + &-disabled { cursor: no-drop; background: #f4f4f4; - border-color:#f4f4f4; + border-color: #f4f4f4; - &:after{ + &:after { background: #ccc; cursor: no-drop; } - &:hover:after{ - } - &-inner { - color:#ccc; + color: #ccc; } } } diff --git a/style/components/table.less b/style/components/table.less index 2b70639615..70d59a0900 100644 --- a/style/components/table.less +++ b/style/components/table.less @@ -64,10 +64,11 @@ } th.@{table-prefix-cls}-column-sort { - background: #EAEAEA; + background: #eaeaea; } - th, td { + th, + td { padding: 16px 8px; } @@ -156,11 +157,11 @@ &.@{table-prefix-cls}-bordered { table { - border: 1px solid #E9E9E9; + border: 1px solid #e9e9e9; } th { - border-bottom: 1px solid #E9E9E9; + border-bottom: 1px solid #e9e9e9; } tr:last-child { @@ -169,8 +170,9 @@ } } - th, td { - border-right: 1px solid #E9E9E9; + th, + td { + border-right: 1px solid #e9e9e9; &:last-child { border-right: 0; } @@ -192,7 +194,7 @@ text-align: center; font-size: 12px; color: #999; - border-bottom: 1px solid #E9E9E9; + border-bottom: 1px solid #e9e9e9; position: absolute; top: 50px; left: 0; @@ -249,7 +251,7 @@ height: 18px; text-align: center; line-height: 15px; - border: 1px solid #E9E9E9; + border: 1px solid #e9e9e9; user-select: none; background: #fff; &-cell { @@ -258,15 +260,16 @@ } &-expanded:after { - content: '-' + content: '-'; } &-collapsed:after { - content: '+' + content: '+'; } } tr&-expanded-row { - &, &:hover { + &, + &:hover { background: #fbfbfb; } } diff --git a/style/components/tabs.less b/style/components/tabs.less index 2a2ec153bd..9364ca96d6 100644 --- a/style/components/tabs.less +++ b/style/components/tabs.less @@ -49,7 +49,8 @@ padding-right: 32px; } - &-tab-prev, &-tab-next { + &-tab-prev, + &-tab-next { user-select: none; z-index: 2; margin-right: -2px; @@ -58,7 +59,7 @@ height: 100%; line-height: 32px; cursor: pointer; - border: none; + border: 0; background-color: transparent; position: absolute; text-align: center; @@ -134,7 +135,8 @@ list-style: none; float: left; - &:before, &:after { + &:before, + &:after { display: table; content: " "; } @@ -144,7 +146,8 @@ } div.@{tab-prefix-cls}-tab-active { - > .@{tab-prefix-cls}-tab-inner, > .@{tab-prefix-cls}-tab-inner:hover { + > .@{tab-prefix-cls}-tab-inner, + > .@{tab-prefix-cls}-tab-inner:hover { color: tint(@primary-color, 20%); cursor: pointer; text-decoration: none; diff --git a/style/components/timepicker/Select.less b/style/components/timepicker/Select.less index b7c8dd0991..5dc8884c58 100644 --- a/style/components/timepicker/Select.less +++ b/style/components/timepicker/Select.less @@ -1,6 +1,6 @@ .@{timepicker-prefix-cls}-select { float: left; - overflow-y:auto; + overflow-y: auto; font-size: 12px; border: 1px solid #e9e9e9; border-width: 0 1px; diff --git a/style/components/tooltip.less b/style/components/tooltip.less index 055ea16225..3e50141c01 100644 --- a/style/components/tooltip.less +++ b/style/components/tooltip.less @@ -38,16 +38,24 @@ display: none; } - &-placement-top, &-placement-topLeft, &-placement-topRight { + &-placement-top, + &-placement-topLeft, + &-placement-topRight { padding: @tooltip-arrow-width 0 @tooltip-distance 0; } - &-placement-right, &-placement-rightTop, &-placement-rightBottom { + &-placement-right, + &-placement-rightTop, + &-placement-rightBottom { padding: 0 @tooltip-arrow-width 0 @tooltip-distance; } - &-placement-bottom, &-placement-bottomLeft, &-placement-bottomRight { + &-placement-bottom, + &-placement-bottomLeft, + &-placement-bottomRight { padding: @tooltip-distance 0 @tooltip-arrow-width 0; } - &-placement-left, &-placement-leftTop, &-placement-leftBottom { + &-placement-left, + &-placement-leftTop, + &-placement-leftBottom { padding: 0 @tooltip-distance 0 @tooltip-arrow-width; } } diff --git a/style/components/tree.less b/style/components/tree.less index 043f05ae7d..fdcb714fcf 100644 --- a/style/components/tree.less +++ b/style/components/tree.less @@ -64,7 +64,7 @@ font-family: 'anticon'; font-weight: bold; .animation(loadingCircle 1s infinite linear); - margin-top:8px; + margin-top: 8px; } } &.@{tree-prefix-cls}-switcher { diff --git a/style/components/typography.less b/style/components/typography.less index d0a56dbdf0..24f8c4b965 100644 --- a/style/components/typography.less +++ b/style/components/typography.less @@ -1,3 +1,4 @@ //== Typography -//** Headings: h1 h2 h3 h4 h5 h6 \ No newline at end of file +//** Headings: h1 h2 h3 h4 h5 h6 + diff --git a/style/components/upload.less b/style/components/upload.less index ad7701f733..8f05a74b20 100644 --- a/style/components/upload.less +++ b/style/components/upload.less @@ -7,7 +7,7 @@ width: 100%; } - input[type=file] { + input[type="file"] { cursor: pointer; } @@ -141,18 +141,18 @@ .@{upload-prefix-cls}-margin-top-leave { animation: uploadMarginTopOut .3s @ease-in-out-circ; } +} - @keyframes uploadMarginTopIn { - from { - margin-top: -25px; - opacity: 0; - } - } - - @keyframes uploadMarginTopOut { - to { - margin-top: -25px; - opacity: 0; - } +@keyframes uploadMarginTopIn { + from { + margin-top: -25px; + opacity: 0; + } +} + +@keyframes uploadMarginTopOut { + to { + margin-top: -25px; + opacity: 0; } } diff --git a/style/core/base.less b/style/core/base.less index ff39560df3..b678c43e88 100644 --- a/style/core/base.less +++ b/style/core/base.less @@ -25,8 +25,8 @@ body { // unify the setting of elements's margin and padding for browsers body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,code,form,fieldset,legend,input,textarea,p,blockquote,th,td,hr,button,article,aside,details,figcaption,figure,footer,header,hgroup,menu,nav,section { - margin:0; - padding:0; + margin: 0; + padding: 0; } // Reset fonts for relevant elements diff --git a/style/core/index.less b/style/core/index.less index 420149eeb4..87150d0541 100644 --- a/style/core/index.less +++ b/style/core/index.less @@ -2,4 +2,5 @@ @import "color"; @import "iconfont"; @import "layouts"; -@import "motion"; \ No newline at end of file +@import "motion"; + diff --git a/style/core/motion.less b/style/core/motion.less index f3f8d01762..91234e17ed 100644 --- a/style/core/motion.less +++ b/style/core/motion.less @@ -4,7 +4,8 @@ } .make-motion(@className, @keyframeName) { - .@{className}-enter, .@{className}-appear { + .@{className}-enter, + .@{className}-appear { .motion-common(); animation-play-state: paused; } @@ -12,7 +13,8 @@ .motion-common(); animation-play-state: paused; } - .@{className}-enter.@{className}-enter-active, .@{className}-appear.@{className}-appear-active { + .@{className}-enter.@{className}-enter-active, + .@{className}-appear.@{className}-appear-active { animation-name: ~"@{keyframeName}In"; animation-play-state: running; } diff --git a/style/core/motion/fade.less b/style/core/motion/fade.less index 8a5cfb6861..b5fe6df37e 100644 --- a/style/core/motion/fade.less +++ b/style/core/motion/fade.less @@ -1,6 +1,7 @@ .fade-motion(@className, @keyframeName) { .make-motion(@className, @keyframeName); - .@{className}-enter, .@{className}-appear { + .@{className}-enter, + .@{className}-appear { opacity: 0; animation-timing-function: linear; } diff --git a/style/core/motion/move.less b/style/core/motion/move.less index dae559bafc..2eed39bfc1 100644 --- a/style/core/motion/move.less +++ b/style/core/motion/move.less @@ -1,6 +1,7 @@ .move-motion(@className, @keyframeName) { .make-motion(@className, @keyframeName); - .@{className}-enter, .@{className}-appear { + .@{className}-enter, + .@{className}-appear { opacity: 0; animation-timing-function: @ease-out-circ; } diff --git a/style/core/motion/other.less b/style/core/motion/other.less index 670442f126..837b7a12b9 100644 --- a/style/core/motion/other.less +++ b/style/core/motion/other.less @@ -7,4 +7,5 @@ transform-origin: 50% 50%; transform: rotate(360deg); } -} \ No newline at end of file +} + diff --git a/style/core/motion/slide.less b/style/core/motion/slide.less index 097494f334..216cff0840 100644 --- a/style/core/motion/slide.less +++ b/style/core/motion/slide.less @@ -1,6 +1,7 @@ .slide-motion(@className, @keyframeName) { .make-motion(@className, @keyframeName); - .@{className}-enter, .@{className}-appear { + .@{className}-enter, + .@{className}-appear { opacity: 0; animation-timing-function: @ease-out-quint; } diff --git a/style/core/motion/swing.less b/style/core/motion/swing.less index 2b6f0ffaaf..d91514dc87 100644 --- a/style/core/motion/swing.less +++ b/style/core/motion/swing.less @@ -1,9 +1,11 @@ .swing-motion(@className, @keyframeName) { - .@{className}-enter, .@{className}-appear { + .@{className}-enter, + .@{className}-appear { .motion-common(); animation-play-state: paused; } - .@{className}-enter.@{className}-enter-active, .@{className}-appear.@{className}-appear-active { + .@{className}-enter.@{className}-enter-active, + .@{className}-appear.@{className}-appear-active { animation-name: ~"@{keyframeName}In"; animation-play-state: running; } @@ -12,7 +14,8 @@ .swing-motion(swing, antSwing); @keyframes antSwingIn { - 0%, 100% { + 0%, + 100% { transform: translateX(0px); } 20% { diff --git a/style/core/motion/zoom.less b/style/core/motion/zoom.less index 24227f5cba..dcde703c8c 100644 --- a/style/core/motion/zoom.less +++ b/style/core/motion/zoom.less @@ -1,6 +1,7 @@ .zoom-motion(@className, @keyframeName) { .make-motion(@className, @keyframeName); - .@{className}-enter, .@{className}-appear { + .@{className}-enter, + .@{className}-appear { transform: scale(0); // need this by yiminghe animation-timing-function: @ease-out-circ; } diff --git a/style/mixins/button.less b/style/mixins/button.less index f5a8d37527..2019a9b444 100644 --- a/style/mixins/button.less +++ b/style/mixins/button.less @@ -110,7 +110,7 @@ } &.disabled, - &[disabled]{ + &[disabled] { cursor: @cursor-disabled; } diff --git a/style/mixins/form.less b/style/mixins/form.less index 464b75d6bb..41e5ccfb00 100644 --- a/style/mixins/form.less +++ b/style/mixins/form.less @@ -1,5 +1,6 @@ .form-control-validation(@text-color: @input-color; @border-color: @input-border-color; @background-color: @input-bg) { - .@{css-prefix}form-explain, .@{css-prefix}form-split { + .@{css-prefix}form-explain, + .@{css-prefix}form-split { color: @text-color; } // 输入框的不同校验状态 diff --git a/style/mixins/input.less b/style/mixins/input.less index 022339bf34..f313820175 100644 --- a/style/mixins/input.less +++ b/style/mixins/input.less @@ -18,7 +18,7 @@ } // == when hoverd -.hover(@color: @input-hover-border-color ) { +.hover(@color: @input-hover-border-color) { border-color: tint(@color, 20%); } diff --git a/style/mixins/vendor-prefixes.less b/style/mixins/vendor-prefixes.less index 6551827519..51b2e4122a 100644 --- a/style/mixins/vendor-prefixes.less +++ b/style/mixins/vendor-prefixes.less @@ -54,7 +54,7 @@ // Prevent browsers from flickering when using CSS 3D transforms. // Default value is `visible`, but can be changed to `hidden` -.backface-visibility(@visibility){ +.backface-visibility(@visibility) { -webkit-backface-visibility: @visibility; -moz-backface-visibility: @visibility; backface-visibility: @visibility; @@ -104,8 +104,14 @@ color: @color; opacity: 1; // Override Firefox's unusual default opacity; see https://github.com/twbs/bootstrap/pull/11526 } - &:-ms-input-placeholder { color: @color; } // Internet Explorer 10+ - &::-webkit-input-placeholder { color: @color; } // Safari and Chrome + // Internet Explorer 10+ + &:-ms-input-placeholder { + color: @color; + } + // Safari and Chrome + &::-webkit-input-placeholder { + color: @color; + } } // Transformations From 2802643c12450614735ee23c37df41f37b38d9e5 Mon Sep 17 00:00:00 2001 From: afc163 Date: Thu, 26 Nov 2015 19:51:03 +0800 Subject: [PATCH 07/36] fix demo --- components/pagination/demo/uncontrolled.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/pagination/demo/uncontrolled.md b/components/pagination/demo/uncontrolled.md index a8187100cc..15c33c952e 100644 --- a/components/pagination/demo/uncontrolled.md +++ b/components/pagination/demo/uncontrolled.md @@ -28,6 +28,6 @@ let Container = React.createClass({ ReactDOM.render( , -document.getElementById('components-pagination-demo-aaa')); +document.getElementById('components-pagination-demo-uncontrolled')); ```` From 5b4aa4cd55b5b02e8bf27388d68bda6da72d24d5 Mon Sep 17 00:00:00 2001 From: afc163 Date: Thu, 26 Nov 2015 19:52:25 +0800 Subject: [PATCH 08/36] update API --- components/pagination/index.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/components/pagination/index.md b/components/pagination/index.md index 13db48135a..b4c62886c1 100644 --- a/components/pagination/index.md +++ b/components/pagination/index.md @@ -21,7 +21,8 @@ | 参数 | 说明 | 类型 | 默认值 | |------------------|------------------------------------|----------|----------------| -| current | 当前页数 | Number | 1 | +| current | 当前页数 | Number | 无 | +| defaultCurrent | 默认的当前页数 | Number | 1 | | total | 数据总数 | Number | 0 | | pageSize | 每页条数 | Number | 10 | | onChange | 页码改变的回调,参数是改变后的页码 | Function | noop | From 82addcccc1d01df5bff78a06a9224952abfc3f56 Mon Sep 17 00:00:00 2001 From: afc163 Date: Thu, 26 Nov 2015 22:18:14 +0800 Subject: [PATCH 09/36] update date and time picker demo --- components/datepicker/demo/time.md | 63 ++++++++++++++++------------- components/timepicker/demo/basic.md | 8 ++-- 2 files changed, 41 insertions(+), 30 deletions(-) diff --git a/components/datepicker/demo/time.md b/components/datepicker/demo/time.md index fe9474087b..b525f9614b 100644 --- a/components/datepicker/demo/time.md +++ b/components/datepicker/demo/time.md @@ -9,35 +9,44 @@ ````jsx import { Datepicker, Timepicker } from 'antd'; -let result = new Date(); -let selectdDate, selectdTime; -function handleChange(from, value) { - if (!value) { - if (from === 'date') { - selectdDate = false; - } else { - selectdTime = false; +const DateTimePicker = React.createClass({ + handleChange(from, value) { + this.result = this.result || new Date(); + if (!value) { + if (from === 'date') { + this.selectedDate = false; + } else { + this.selectedTime = false; + } + return; } - return; - } - if (from === 'date') { - result.setFullYear(value.getFullYear()); - result.setMonth(value.getMonth()); - result.setDate(value.getDate()); - selectdDate = true; - } else { - result.setHours(value.getHours()); - result.setMinutes(value.getMinutes()); - result.setSeconds(value.getSeconds()); - selectdTime = true; - } - if (selectdDate && selectdTime) { - console.log('选择结果是:' + result); + if (from === 'date') { + this.result.setFullYear(value.getFullYear()); + this.result.setMonth(value.getMonth()); + this.result.setDate(value.getDate()); + this.selectedDate = true; + } else { + this.result.setHours(value.getHours()); + this.result.setMinutes(value.getMinutes()); + this.result.setSeconds(value.getSeconds()); + this.selectedTime = true; + } + if (this.selectedDate && this.selectedTime) { + this.props.onSelect(this.result); + } + }, + render() { + return
+ + +
; } +}); + +function onSelect(value) { + console.log('选择了时间:', value); } -ReactDOM.render(
- - -
, document.getElementById('components-datepicker-demo-time')); +ReactDOM.render( +, document.getElementById('components-datepicker-demo-time')); ```` diff --git a/components/timepicker/demo/basic.md b/components/timepicker/demo/basic.md index b1b77d953e..dd1256f82c 100644 --- a/components/timepicker/demo/basic.md +++ b/components/timepicker/demo/basic.md @@ -10,9 +10,11 @@ import { Timepicker } from 'antd'; function onChange(time) { - console.log(time.toLocaleTimeString('zh-CN', { - hour12: false - })); + if (time) { + console.log(time.toLocaleTimeString('zh-CN', { + hour12: false + })); + } } ReactDOM.render( From 3992678141ed38343a0d89cf5a9545fe582f2a00 Mon Sep 17 00:00:00 2001 From: afc163 Date: Thu, 26 Nov 2015 23:30:20 +0800 Subject: [PATCH 10/36] update ajax demo, controll current page outside --- components/table/demo/ajax.md | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/components/table/demo/ajax.md b/components/table/demo/ajax.md index 341b026c0d..21d69d0eff 100644 --- a/components/table/demo/ajax.md +++ b/components/table/demo/ajax.md @@ -64,25 +64,36 @@ const dataSource = new Table.DataSource({ const Test = React.createClass({ getInitialState() { return { - dataSource: null + dataSource: null, + pagination: { + onChange: this.hanlePageChange + } }; }, + hanlePageChange(page) { + // 使用受控属性 current,方便外部设置页数 + const pagination = this.state.pagination; + pagination.current = page; + this.setState({ pagination }); + }, refresh() { + // 回到第一页 + const pagination = this.state.pagination; + pagination.current = 1; this.setState({ dataSource: dataSource.clone() }); }, changeAndRefresh() { + // 回到第一页 + const pagination = this.state.pagination; + pagination.current = 1; // 可以修改原来的 dataSource 再发请求 this.setState({ dataSource: dataSource.clone({ - data: { - city: 'hz' - } + data: { city: 'hz' } }), - pagination: { - current: 1 - } + pagination, }); }, render() { From 123741a623f9f687082eee3296cd07382a027950 Mon Sep 17 00:00:00 2001 From: afc163 Date: Thu, 26 Nov 2015 23:30:55 +0800 Subject: [PATCH 11/36] update version --- CHANGELOG.md | 8 ++++++++ package.json | 6 +++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 846de7331a..fdbac13b6b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,14 @@ --- +## 0.10.3 `2015-11-26` + +- 默认引入 `antd/lib/index.css`,和 0.9.x 保持一致,方便第三方引用。引用 less 文件进行变量配置的可自行 `import 'antd/style/index.less'`。[#593](https://github.com/ant-design/ant-design/issues/593) +- 升级 Pagination,增加 defaultCurrent 属性,修正原来的 current 为完全受控属性。 +- Pagination 的改动也修复了 Table 切换数据源后回到[第一页的例子](http://ant.design/components/table/#demo-ajax)。 +- 对演示和样式代码增加了 lint 检查。 + + ## 0.10.2 `2015-11-25` - Slider 新增 `tipFormatter` 用于格式化 Tooltip 的内容。 diff --git a/package.json b/package.json index 51c0898f70..12ad9ba6b0 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "antd", - "version": "0.10.2", - "stableVersion": "0.10.2", + "version": "0.10.3", + "stableVersion": "0.10.3", "title": "Ant Design", "description": "一个 UI 设计语言", "homepage": "http://ant.design/", @@ -48,7 +48,7 @@ "rc-input-number": "~2.4.1", "rc-menu": "~4.8.1", "rc-notification": "~1.3.0", - "rc-pagination": "~1.3.2", + "rc-pagination": "~1.3.3", "rc-progress": "~1.0.4", "rc-queue-anim": "~0.11.2", "rc-radio": "~2.0.0", From beaa01d4ef4671c79876dc7ace30296dcab446df Mon Sep 17 00:00:00 2001 From: afc163 Date: Fri, 27 Nov 2015 01:00:27 +0800 Subject: [PATCH 12/36] upgrade rc-pagination to 1.3.5 --- components/pagination/demo/{uncontrolled.md => controlled.md} | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) rename components/pagination/demo/{uncontrolled.md => controlled.md} (86%) diff --git a/components/pagination/demo/uncontrolled.md b/components/pagination/demo/controlled.md similarity index 86% rename from components/pagination/demo/uncontrolled.md rename to components/pagination/demo/controlled.md index 15c33c952e..2396acdd4c 100644 --- a/components/pagination/demo/uncontrolled.md +++ b/components/pagination/demo/controlled.md @@ -28,6 +28,6 @@ let Container = React.createClass({ ReactDOM.render( , -document.getElementById('components-pagination-demo-uncontrolled')); +document.getElementById('components-pagination-demo-controlled')); ```` diff --git a/package.json b/package.json index 12ad9ba6b0..a061ec805c 100644 --- a/package.json +++ b/package.json @@ -48,7 +48,7 @@ "rc-input-number": "~2.4.1", "rc-menu": "~4.8.1", "rc-notification": "~1.3.0", - "rc-pagination": "~1.3.3", + "rc-pagination": "~1.3.5", "rc-progress": "~1.0.4", "rc-queue-anim": "~0.11.2", "rc-radio": "~2.0.0", From d45e9e510bbd5fef7b2116c0f8be4ac05fbed958 Mon Sep 17 00:00:00 2001 From: afc163 Date: Fri, 27 Nov 2015 11:33:43 +0800 Subject: [PATCH 13/36] update CHANGELOG --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fdbac13b6b..935d48dfdf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,7 +7,7 @@ ## 0.10.3 `2015-11-26` - 默认引入 `antd/lib/index.css`,和 0.9.x 保持一致,方便第三方引用。引用 less 文件进行变量配置的可自行 `import 'antd/style/index.less'`。[#593](https://github.com/ant-design/ant-design/issues/593) -- 升级 Pagination,增加 defaultCurrent 属性,修正原来的 current 为完全受控属性。 +- 升级 Pagination,增加 `defaultCurrent` 属性,修正原来的 `current` 为[完全受控属性](https://facebook.github.io/react/docs/forms.html#controlled-components)。 - Pagination 的改动也修复了 Table 切换数据源后回到[第一页的例子](http://ant.design/components/table/#demo-ajax)。 - 对演示和样式代码增加了 lint 检查。 From 1d5e119d26b7d7ef648b739ca2d490c90f8eda7a Mon Sep 17 00:00:00 2001 From: afc163 Date: Fri, 27 Nov 2015 12:03:44 +0800 Subject: [PATCH 14/36] Remove empty less files --- style/components/index.less | 1 - style/components/typography.less | 4 ---- style/core/color.less | 0 style/core/index.less | 1 - 4 files changed, 6 deletions(-) delete mode 100644 style/components/typography.less delete mode 100644 style/core/color.less diff --git a/style/components/index.less b/style/components/index.less index 5b0b8d25c5..071848ddb1 100644 --- a/style/components/index.less +++ b/style/components/index.less @@ -17,7 +17,6 @@ @import "steps"; @import "breadcrumb"; @import "inputNumber"; -@import "typography"; @import "checkbox"; @import "collapse"; @import "message"; diff --git a/style/components/typography.less b/style/components/typography.less deleted file mode 100644 index 24f8c4b965..0000000000 --- a/style/components/typography.less +++ /dev/null @@ -1,4 +0,0 @@ -//== Typography - -//** Headings: h1 h2 h3 h4 h5 h6 - diff --git a/style/core/color.less b/style/core/color.less deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/style/core/index.less b/style/core/index.less index 87150d0541..81fcf66537 100644 --- a/style/core/index.less +++ b/style/core/index.less @@ -1,5 +1,4 @@ @import "base"; -@import "color"; @import "iconfont"; @import "layouts"; @import "motion"; From 820d9d788037da9474a0e9c5e990dd2991137dac Mon Sep 17 00:00:00 2001 From: afc163 Date: Fri, 27 Nov 2015 12:08:57 +0800 Subject: [PATCH 15/36] fix demo lint --- components/tree/demo/special.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/components/tree/demo/special.md b/components/tree/demo/special.md index d6892c7b2b..9046e6400e 100644 --- a/components/tree/demo/special.md +++ b/components/tree/demo/special.md @@ -2,7 +2,7 @@ - order: 2 -受控组件,外部传入参数,控制树对象节点 +受控组件,外部传入参数,控制树对象节点。 --- @@ -64,5 +64,4 @@ class TreeDemo extends React.Component { } ReactDOM.render(, document.getElementById('components-tree-demo-special')); - ```` From eb828f0eba60f6e15a7a88c94345f25dbf10862f Mon Sep 17 00:00:00 2001 From: afc163 Date: Fri, 27 Nov 2015 14:29:03 +0800 Subject: [PATCH 16/36] Fix disabled props in RadioGroup, closes #603 --- components/radio/demo/radiobutton.md | 2 +- components/radio/group.jsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/components/radio/demo/radiobutton.md b/components/radio/demo/radiobutton.md index 18d7b207bc..04c1ef5194 100644 --- a/components/radio/demo/radiobutton.md +++ b/components/radio/demo/radiobutton.md @@ -19,7 +19,7 @@ ReactDOM.render(
杭州 - 上海 + 上海 北京 成都 diff --git a/components/radio/group.jsx b/components/radio/group.jsx index 640ad73f95..bb29baeae5 100644 --- a/components/radio/group.jsx +++ b/components/radio/group.jsx @@ -42,7 +42,7 @@ export default React.createClass({ {...radio.props} onChange={this.onRadioChange} checked={this.state.value === radio.props.value} - disabled={this.props.disabled} + disabled={radio.props.disabled || this.props.disabled} />; } return radio; From 9e82dee23bb10d80ea0887f57a28a6c746c6b931 Mon Sep 17 00:00:00 2001 From: afc163 Date: Fri, 27 Nov 2015 14:54:25 +0800 Subject: [PATCH 17/36] Add rowKey tip in document --- components/table/index.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/components/table/index.md b/components/table/index.md index 3f1b67cad4..f63471d8b8 100644 --- a/components/table/index.md +++ b/components/table/index.md @@ -101,3 +101,16 @@ var dataSource = new Table.DataSource({ | resolve | 获得数据的解析函数,接收参数为远程数据返回的 result | Function | | | | getPagination | 和后台接口返回的分页数据进行适配的函数,返回值会传给表格中的分页器 | Function | | | | getParams | 和后台接口接收的参数进行适配,返回值会作为请求的参数发送 | Function | | 无 | + +## 注意 + +按照 React 的规范,所有的组件数组必须绑定 key。在 Table 中,默认将每列数据的 `key` 属性作为唯一的标识。 +如果你的数据没有这个属性,你需要使用 `rowKey` 来指定数据列的主键。 + +```jsx +const rowKey = function(record) { + return record.uid; // 比如你的数据主键是 uid +}; + +return ; +``` From 7c0c2cd18c305303134d98d477e090c2cb68b0c9 Mon Sep 17 00:00:00 2001 From: afc163 Date: Fri, 27 Nov 2015 15:08:56 +0800 Subject: [PATCH 18/36] Add rowKey tip in document --- components/table/index.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/components/table/index.md b/components/table/index.md index f63471d8b8..4bd8c64588 100644 --- a/components/table/index.md +++ b/components/table/index.md @@ -104,8 +104,11 @@ var dataSource = new Table.DataSource({ ## 注意 -按照 React 的规范,所有的组件数组必须绑定 key。在 Table 中,默认将每列数据的 `key` 属性作为唯一的标识。 -如果你的数据没有这个属性,你需要使用 `rowKey` 来指定数据列的主键。 +按照 React 的[规范](http://facebook.github.io/react/docs/multiple-components.html#dynamic-children),所有的组件数组必须绑定 key。在 Table 中,默认将每列数据的 `key` 属性作为唯一的标识。 + +如果你的数据没有这个属性,务必使用 `rowKey` 来指定数据列的主键。若没有指定,控制台会出现以下的提示,表格组件也会出现各类奇怪的错误。 + +![](https://os.alipayobjects.com/rmsportal/luLdLvhPOiRpyss.png) ```jsx const rowKey = function(record) { From 6898eb19e561f5352c030ce718a85dc17d47b8ab Mon Sep 17 00:00:00 2001 From: afc163 Date: Fri, 27 Nov 2015 15:10:08 +0800 Subject: [PATCH 19/36] update style.css --- site/static/style.css | 1 + 1 file changed, 1 insertion(+) diff --git a/site/static/style.css b/site/static/style.css index e2b98e03f0..58fcd99319 100644 --- a/site/static/style.css +++ b/site/static/style.css @@ -509,6 +509,7 @@ footer ul li > a { .markdown img { vertical-align: middle; + max-width: 100%; } .markdown h1 { From 562697423b1139eb324c1dceb051c143f4870ed7 Mon Sep 17 00:00:00 2001 From: afc163 Date: Fri, 27 Nov 2015 15:43:15 +0800 Subject: [PATCH 20/36] Add media-match to polyfil --- docs/getting-started.md | 2 +- site/templates/layout.html | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/getting-started.md b/docs/getting-started.md index 5ba8ccaeb3..6d38e5e850 100644 --- a/docs/getting-started.md +++ b/docs/getting-started.md @@ -116,7 +116,7 @@ Ant Design React 支持所有的现代浏览器和 IE8+。 - + diff --git a/site/templates/layout.html b/site/templates/layout.html index dc4a460f4c..af27021de0 100644 --- a/site/templates/layout.html +++ b/site/templates/layout.html @@ -18,7 +18,7 @@ - + - {% block scripts %}{% endblock %} From b1f066ec2a48713c2105cb5f7e6edb654525c04f Mon Sep 17 00:00:00 2001 From: afc163 Date: Sun, 29 Nov 2015 00:35:49 +0800 Subject: [PATCH 27/36] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index dab9a40fe9..88ef068f0b 100644 --- a/README.md +++ b/README.md @@ -43,7 +43,7 @@ Normal browsers and Internet Explorer 8+. ## Links - [Home page](http://ant.design/) -- [Documentation and Components](http://ant.design/docs/introduce) +- [Documentation and React Components](http://ant.design/docs/introduce) - [Components](http://ant.design/components/) - [Build/Debug tools](https://github.com/ant-design/antd-bin) - [Roadmap](https://github.com/ant-design/ant-design/issues/9) From df101a72ec6b0f883d2e3cf4045edb60679c933e Mon Sep 17 00:00:00 2001 From: afc163 Date: Sun, 29 Nov 2015 00:37:11 +0800 Subject: [PATCH 28/36] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 88ef068f0b..a12e36cec4 100644 --- a/README.md +++ b/README.md @@ -43,12 +43,12 @@ Normal browsers and Internet Explorer 8+. ## Links - [Home page](http://ant.design/) -- [Documentation and React Components](http://ant.design/docs/introduce) +- [React UI library](http://ant.design/docs/introduce) - [Components](http://ant.design/components/) - [Build/Debug tools](https://github.com/ant-design/antd-bin) - [Roadmap](https://github.com/ant-design/ant-design/issues/9) - [ChangeLog](CHANGELOG.md) -- [React modules](http://react-component.github.io/) +- [React components](http://react-component.github.io/) - [React style guide](https://github.com/react-component/react-component.github.io/blob/master/docs/en-US/component-code-style.md) - [React component design guide](https://github.com/react-component/react-component.github.io/blob/master/docs/en-US/component-design.md) - [Developer Instruction](https://github.com/ant-design/ant-design/wiki/%E7%BD%91%E7%AB%99%E5%92%8C%E7%BB%84%E4%BB%B6%E5%BC%80%E5%8F%91%E8%AF%B4%E6%98%8E) From 519e8cfed26fab4c68df74364de75feaa267064d Mon Sep 17 00:00:00 2001 From: afc163 Date: Sun, 29 Nov 2015 00:37:34 +0800 Subject: [PATCH 29/36] Update README.md --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index a12e36cec4..cb83687af7 100644 --- a/README.md +++ b/README.md @@ -44,7 +44,6 @@ Normal browsers and Internet Explorer 8+. - [Home page](http://ant.design/) - [React UI library](http://ant.design/docs/introduce) -- [Components](http://ant.design/components/) - [Build/Debug tools](https://github.com/ant-design/antd-bin) - [Roadmap](https://github.com/ant-design/ant-design/issues/9) - [ChangeLog](CHANGELOG.md) From 7a6a8149e6226206693e8d321abecb86bc8d8976 Mon Sep 17 00:00:00 2001 From: afc163 Date: Sun, 29 Nov 2015 00:38:13 +0800 Subject: [PATCH 30/36] Update README-zh_CN.md --- README-zh_CN.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README-zh_CN.md b/README-zh_CN.md index 403438b4c0..b5d2d544e6 100644 --- a/README-zh_CN.md +++ b/README-zh_CN.md @@ -47,11 +47,11 @@ npm install antd ## 链接 - [首页](http://ant.design/) -- [文档和组件](http://ant.design/docs/introduce) +- [React UI 库](http://ant.design/docs/introduce) - [构建调试工具](https://github.com/ant-design/antd-bin) - [开发计划](https://github.com/ant-design/ant-design/issues/9) - [修改记录](CHANGELOG.md) -- [React 模块](http://react-component.github.io/) +- [React 组件](http://react-component.github.io/) - [React 代码规范](https://github.com/react-component/react-component.github.io/blob/master/docs/zh-cn/component-code-style.md) - [组件设计原则](https://github.com/react-component/react-component.github.io/blob/master/docs/zh-cn/component-design.md) - [网站和组件开发说明](https://github.com/ant-design/ant-design/wiki/%E7%BD%91%E7%AB%99%E5%92%8C%E7%BB%84%E4%BB%B6%E5%BC%80%E5%8F%91%E8%AF%B4%E6%98%8E) From 7cd8fb042fa17cd5a55e9d76b265720ab1fedfe1 Mon Sep 17 00:00:00 2001 From: afc163 Date: Sun, 29 Nov 2015 16:54:20 +0800 Subject: [PATCH 31/36] fix tree demo --- components/tree/demo/special.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/tree/demo/special.md b/components/tree/demo/special.md index 9046e6400e..d26ca19811 100644 --- a/components/tree/demo/special.md +++ b/components/tree/demo/special.md @@ -50,7 +50,7 @@ class TreeDemo extends React.Component { - test + sss}/> From f99bbf5c2e5258cd700445acc9644f7061a91bb8 Mon Sep 17 00:00:00 2001 From: yiminghe Date: Mon, 30 Nov 2015 14:41:01 +0800 Subject: [PATCH 32/36] add month picker --- components/datepicker/demo/month-picker.md | 15 +++++++++++ components/datepicker/index.jsx | 6 ++--- scripts/demo.js | 31 ++++++++++++++++------ 3 files changed, 41 insertions(+), 11 deletions(-) create mode 100644 components/datepicker/demo/month-picker.md diff --git a/components/datepicker/demo/month-picker.md b/components/datepicker/demo/month-picker.md new file mode 100644 index 0000000000..47e72827be --- /dev/null +++ b/components/datepicker/demo/month-picker.md @@ -0,0 +1,15 @@ +# 月选择器 + +- order: 9 + +使用 MonthPicker 实现月选择器. + +--- + +````jsx +import { Datepicker } from 'antd'; +const MonthPicker = Datepicker.MonthPicker; +ReactDOM.render( + +, document.getElementById('components-datepicker-demo-month-picker')); +```` diff --git a/components/datepicker/index.jsx b/components/datepicker/index.jsx index 3cbc77446f..d0ca23241e 100644 --- a/components/datepicker/index.jsx +++ b/components/datepicker/index.jsx @@ -8,11 +8,11 @@ import CalendarLocale from 'rc-calendar/lib/locale/zh_CN'; import DateTimeFormat from 'gregorian-calendar-format'; import objectAssign from 'object-assign'; -function createPicker(TheCalendar) { +function createPicker(TheCalendar, defaultFormat) { return React.createClass({ getDefaultProps() { return { - format: 'yyyy-MM-dd', + format: defaultFormat || 'yyyy-MM-dd', transitionName: 'slide-up', popupStyle: {}, onSelect: null, // 向前兼容 @@ -154,7 +154,7 @@ function createPicker(TheCalendar) { } const AntDatePicker = createPicker(Calendar); -const AntMonthPicker = createPicker(MonthCalendar); +const AntMonthPicker = createPicker(MonthCalendar, 'yyyy-MM'); const AntCalendar = React.createClass({ getDefaultProps() { diff --git a/scripts/demo.js b/scripts/demo.js index 82c91e8d9b..d2a4d5d16a 100644 --- a/scripts/demo.js +++ b/scripts/demo.js @@ -1,10 +1,25 @@ -window.require = function(path) { - if (path in window) { - return window[path]; - } else { - throw 'There should not have modules here: ' + path; - } +function capitalizeFirstLetter(string) { + return string.charAt(0).toUpperCase() + string.slice(1); +} + +window.require = function (path) { + var result = window; + var namespaces = path.split('/'); + namespaces.forEach(function (key, i) { + if (i === 2) { + key = capitalizeFirstLetter(key); + } + if (key !== 'lib') { + if (result[key]) { + result = result[key]; + } else { + throw 'There should not have modules here: ' + path; + } + } + }); + return result; }; + window['css-animation'] = require('css-animation'); window['react-router'] = require('react-router'); window.Clip = require('./clip'); @@ -101,7 +116,7 @@ InstantClickChangeFns.push(function () { ReactDOM.render( - , document.getElementById('versions-select')); + , document.getElementById('versions-select')); }); window.BrowserDemo = React.createClass({ @@ -114,7 +129,7 @@ window.BrowserDemo = React.createClass({
- +
{this.props.children} From 3cc00cb8344dd02a3bba72a69db31b2098bd1e50 Mon Sep 17 00:00:00 2001 From: afc163 Date: Mon, 30 Nov 2015 15:03:23 +0800 Subject: [PATCH 33/36] fix filter link position --- style/components/table.less | 1 + 1 file changed, 1 insertion(+) diff --git a/style/components/table.less b/style/components/table.less index 70d59a0900..e24197a22c 100644 --- a/style/components/table.less +++ b/style/components/table.less @@ -238,6 +238,7 @@ } &.clear { float: right; + margin-right: -32px; } } } From cad92a5b496d4dee579b4cb4900e824ec8c6d9fe Mon Sep 17 00:00:00 2001 From: afc163 Date: Mon, 30 Nov 2015 15:22:17 +0800 Subject: [PATCH 34/36] bump 0.10.4 --- CHANGELOG.md | 10 +++++++++- package.json | 4 ++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 935d48dfdf..fa7d8af6c4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,9 +4,17 @@ --- +## 0.10.4 `2015-11-30` + +- 将 media-match 加入默认的 polyfil 文件中。[5626974](https://github.com/ant-design/ant-design/commit/562697423b1139eb324c1dceb051c143f4870ed7) +- 修复了 [MonthPicker](http://ant.design/components/datepicker/#demo-month-picker) 报错问题,并增加了相关演示。 +- 修复 RadioGroup 中的 Radio/RadioButton 无法单独设置 disabled 的问题。[#603](https://github.com/ant-design/ant-design/issues/603) +- 修复今天是不可选日期时的一个展示问题。[#606](https://github.com/ant-design/ant-design/issues/606) + + ## 0.10.3 `2015-11-26` -- 默认引入 `antd/lib/index.css`,和 0.9.x 保持一致,方便第三方引用。引用 less 文件进行变量配置的可自行 `import 'antd/style/index.less'`。[#593](https://github.com/ant-design/ant-design/issues/593) +- 和 0.9.x 保持一致默认引入 `antd/lib/index.css`(而非 less 文件),方便第三方引用。引用 less 文件进行变量配置的可自行 `import 'antd/style/index.less'`。[#593](https://github.com/ant-design/ant-design/issues/593) - 升级 Pagination,增加 `defaultCurrent` 属性,修正原来的 `current` 为[完全受控属性](https://facebook.github.io/react/docs/forms.html#controlled-components)。 - Pagination 的改动也修复了 Table 切换数据源后回到[第一页的例子](http://ant.design/components/table/#demo-ajax)。 - 对演示和样式代码增加了 lint 检查。 diff --git a/package.json b/package.json index a061ec805c..b702b326eb 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "antd", - "version": "0.10.3", - "stableVersion": "0.10.3", + "version": "0.10.4", + "stableVersion": "0.10.4", "title": "Ant Design", "description": "一个 UI 设计语言", "homepage": "http://ant.design/", From 0790d06e62cfd147f5323bdc3bcfb50fc421d7a2 Mon Sep 17 00:00:00 2001 From: afc163 Date: Mon, 30 Nov 2015 15:33:41 +0800 Subject: [PATCH 35/36] typo --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fa7d8af6c4..fcccc016b2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,7 +6,7 @@ ## 0.10.4 `2015-11-30` -- 将 media-match 加入默认的 polyfil 文件中。[5626974](https://github.com/ant-design/ant-design/commit/562697423b1139eb324c1dceb051c143f4870ed7) +- 将 media-match 加入默认的 polyfill 文件中。[5626974](https://github.com/ant-design/ant-design/commit/562697423b1139eb324c1dceb051c143f4870ed7) - 修复了 [MonthPicker](http://ant.design/components/datepicker/#demo-month-picker) 报错问题,并增加了相关演示。 - 修复 RadioGroup 中的 Radio/RadioButton 无法单独设置 disabled 的问题。[#603](https://github.com/ant-design/ant-design/issues/603) - 修复今天是不可选日期时的一个展示问题。[#606](https://github.com/ant-design/ant-design/issues/606) From 454ba1b8d59d997b958b198c499a752c9bf1f2e4 Mon Sep 17 00:00:00 2001 From: Benjy Cui Date: Mon, 30 Nov 2015 17:09:16 +0800 Subject: [PATCH 36/36] docs: update getting-started.md --- docs/getting-started.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/getting-started.md b/docs/getting-started.md index 6d38e5e850..188bdb2da2 100644 --- a/docs/getting-started.md +++ b/docs/getting-started.md @@ -21,6 +21,8 @@ Ant Design React 致力于提供给程序员**愉悦**的开发体验。 ### 1. 安装命令行工具 +> 使用 `antd-init` 前,务必确认 [Node.js](https://nodejs.org/en/) 已经升级到 v4.x 或以上。 + ```bash $ npm install antd-init -g ```