From df1b1f5a473c7c5587690caa07b56a829218b277 Mon Sep 17 00:00:00 2001 From: afc163 Date: Sat, 23 Sep 2017 18:18:47 +0800 Subject: [PATCH 1/7] Add @checkbox-size, close #7368 --- components/checkbox/style/mixin.less | 28 ++++++++++++++-------------- components/style/themes/default.less | 7 +++++-- 2 files changed, 19 insertions(+), 16 deletions(-) diff --git a/components/checkbox/style/mixin.less b/components/checkbox/style/mixin.less index b8759b4dd9..90019d74a2 100644 --- a/components/checkbox/style/mixin.less +++ b/components/checkbox/style/mixin.less @@ -42,21 +42,23 @@ top: 0; left: 0; display: block; - width: 14px; - height: 14px; + width: @checkbox-size; + height: @checkbox-size; border: @border-width-base @border-style-base @border-color-base; border-radius: @border-radius-sm; background-color: #fff; transition: all .3s; &:after { + @check-width: (@checkbox-size / 14) * 5px; + @check-height: (@checkbox-size / 14) * 8px; transform: rotate(45deg) scale(0); position: absolute; - left: 4px; - top: 1px; + left: (@checkbox-size - @check-width) / 2 - 0.5px * (@checkbox-size / 14); + top: (@checkbox-size - @check-height) / 2 - 2px * (@checkbox-size / 14); display: table; - width: 5px; - height: 8px; + width: @check-width; + height: @check-height; border: 2px solid #fff; border-top: 0; border-left: 0; @@ -81,13 +83,15 @@ // 半选状态 .@{checkbox-prefix-cls}-indeterminate .@{checkbox-inner-prefix-cls}:after { + @indeterminate-width: (@checkbox-size / 14) * 8px; + @indeterminate-height: (@checkbox-size / 14) * 1px; content: ' '; transform: scale(1); position: absolute; - left: 2px; - top: 5px; - width: 8px; - height: 1px; + left: (@checkbox-size - 2 - @indeterminate-width) / 2; + top: (@checkbox-size - 3 - @indeterminate-height) / 2; + width: @indeterminate-width; + height: @indeterminate-height; } .@{checkbox-prefix-cls}-indeterminate.@{checkbox-prefix-cls}-disabled .@{checkbox-inner-prefix-cls}:after { @@ -98,11 +102,7 @@ .@{checkbox-prefix-cls}-checked .@{checkbox-inner-prefix-cls}:after { transform: rotate(45deg) scale(1); position: absolute; - left: 4px; - top: 1px; display: table; - width: 5px; - height: 8px; border: 2px solid #fff; border-top: 0; border-left: 0; diff --git a/components/style/themes/default.less b/components/style/themes/default.less index bf1d3ce8d6..6bfe7c540a 100644 --- a/components/style/themes/default.less +++ b/components/style/themes/default.less @@ -142,9 +142,12 @@ @btn-group-border : @primary-7; +// Checkbox +@checkbox-size : 14px; + // Radio buttons -@radio-button-bg : @btn-default-bg; -@radio-button-color : @btn-default-color; +@radio-button-bg : @btn-default-bg; +@radio-button-color : @btn-default-color; // Media queries breakpoints // Extra small screen / phone From 89a6aa96eda893ab2ad2b66fd0b0bee1ed5e21bc Mon Sep 17 00:00:00 2001 From: afc163 Date: Sat, 23 Sep 2017 18:21:33 +0800 Subject: [PATCH 2/7] Tweak input placeholder color, close #7365 --- components/style/themes/default.less | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/style/themes/default.less b/components/style/themes/default.less index 6bfe7c540a..cbcc54a690 100644 --- a/components/style/themes/default.less +++ b/components/style/themes/default.less @@ -226,7 +226,7 @@ @input-padding-vertical-base : 4px; @input-padding-vertical-sm : 1px; @input-padding-vertical-lg : 6px; -@input-placeholder-color : @disabled-color; +@input-placeholder-color : hsv(0, 0, 75%); @input-color : @text-color; @input-border-color : @border-color-base; @input-bg : #fff; From d8c1bdb3ab122ac75326c7fb8a9dec273e1d7b5b Mon Sep 17 00:00:00 2001 From: Zheeeng Date: Sat, 23 Sep 2017 18:33:26 +0800 Subject: [PATCH 3/7] Fix: setting 'heigh: 100%' on Sider and the wrapped element can't take the desired effects (#7716) --- components/layout/style/index.less | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/components/layout/style/index.less b/components/layout/style/index.less index 7304a330a5..4a4edc664a 100644 --- a/components/layout/style/index.less +++ b/components/layout/style/index.less @@ -47,6 +47,10 @@ /* fix firefox can't set width smaller than content on flex item */ min-width: 0; + &-children { + height: 100%; + } + &-has-trigger { padding-bottom: @layout-trigger-height; } From 6ded879619bea33da8ff433e973aa2382b470637 Mon Sep 17 00:00:00 2001 From: afc163 Date: Sat, 23 Sep 2017 19:28:14 +0800 Subject: [PATCH 4/7] update changelog --- CHANGELOG.en-US.md | 4 ++-- CHANGELOG.zh-CN.md | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.en-US.md b/CHANGELOG.en-US.md index fc3fcfb514..e37b91adea 100644 --- a/CHANGELOG.en-US.md +++ b/CHANGELOG.en-US.md @@ -251,7 +251,7 @@ If you want to read change logs before `2.0.0`, please visit [GitHub](https://gi - Add Input.Textarea, Input[type='textArea'] will be deprecated. [pull/6138](https://github.com/ant-design/ant-design/pull/6138) - LocaleProvider supporting Thai. [pull/6721](https://github.com/ant-design/ant-design/pull/6721) [@koobitor](https://github.com/koobitor) - Mention support `focus` function. [#6135](https://github.com/ant-design/ant-design/issues/6135) -- Menu[mode='inline'] could be collapsed, and use `context` to pass `collapsed` prop from Layout.Sider to Menu, don't need customized css code anymore. [pull/6686](https://github.com/ant-design/ant-design/pull/6686) +- Menu inline mode could be collapsed by `inlineCollapsed`, and use `context` to pass `collapsed` prop from Layout.Sider to Menu, don't need customized css code anymore. [pull/6686](https://github.com/ant-design/ant-design/pull/6686) - Add Pagination `itemRender`, now you can customize the structure of page number. [25a603](https://github.com/ant-design/ant-design/commit/25a60322e5c6649522fb9f0d34919eba0ccb1f65) - Add Tooltip `autoAdjustOverflow` prop, now the auto adjust feature can be disabled. [pull/6661](https://github.com/ant-design/ant-design/pull/6661) [@jdz321](https://github.com/jdz321) - Fix errors in docs of Avatar. [pull/6711](https://github.com/ant-design/ant-design/pull/6711) [@llaski](https://github.com/llaski) @@ -667,7 +667,7 @@ If you want to read change logs before `2.0.0`, please visit [GitHub](https://gi - Fix that `Cannot find module '../../package.json'` error. [#4935](https://github.com/ant-design/ant-design/issues/4935) - Fix definitions of Table, RangePicker and Upload. - Fix lack of event argument for Modal `onOk` `afterClose` and Popconfirm `onConfirm` `onCancel`. [#4787](https://github.com/ant-design/ant-design/issues/4787) -- Improve animation of Menu[inline] and Collapse. +- Improve animation of Menu inline mode and Collapse. - Improve Checkbox and Radio vertical align style. - Table - Fix misplace header when fix column. [#4936](https://github.com/ant-design/ant-design/issues/4936) diff --git a/CHANGELOG.zh-CN.md b/CHANGELOG.zh-CN.md index d4f9f62fce..eb008d6c91 100644 --- a/CHANGELOG.zh-CN.md +++ b/CHANGELOG.zh-CN.md @@ -250,7 +250,7 @@ timeline: true - 新增 Input.TextArea,原 Input[type='textArea'] 将被废弃。[pull/6138](https://github.com/ant-design/ant-design/pull/6138) - LocaleProvider 新增泰语支持。[pull/6721](https://github.com/ant-design/ant-design/pull/6721) [@koobitor](https://github.com/koobitor) - Mention 支持 `focus` 方法。[#6135](https://github.com/ant-design/ant-design/issues/6135) -- Menu[mode='inline'] 支持缩起/展开,同时 Layout.Sider 使用 `context` 向 Menu 传递 `collapsed` 属性,无需再自己定制样式。[pull/6686](https://github.com/ant-design/ant-design/pull/6686) +- Menu `inline` 模式下支持用 `inlineCollapsed` 属性缩起/展开,同时 Layout.Sider 使用 `context` 向 Menu 传递 `collapsed` 属性,无需再自己定制样式。[pull/6686](https://github.com/ant-design/ant-design/pull/6686) - 新增 Pagination `itemRender` 属性,用于自定义页码的结构。[25a603](https://github.com/ant-design/ant-design/commit/25a60322e5c6649522fb9f0d34919eba0ccb1f65) - 新增 Tooltip `autoAdjustOverflow` 属性,支持关闭自动调整位置的功能。[pull/6661](https://github.com/ant-design/ant-design/pull/6661) [@jdz321](https://github.com/jdz321) - 修复了 Avatar 错误的文档。[pull/6711](https://github.com/ant-design/ant-design/pull/6711) [@llaski](https://github.com/llaski) @@ -665,7 +665,7 @@ timeline: true - 修复 `Cannot find module '../../package.json'` 的问题。[#4935](https://github.com/ant-design/ant-design/issues/4935) - 补充了 Table、RangePicker 和 Upload 的部分属性定义。 - 修复了 Modal `onOk` `afterClose` 和 Popconfirm `onConfirm` `onCancel` 缺少点击 event 参数的问题。 [#4787](https://github.com/ant-design/ant-design/issues/4787) -- 优化 Menu[inline] 和 Collapse 的折叠动画效果。 +- 优化 Menu inline 模式和 Collapse 的折叠动画效果。 - 优化了 Checkbox 和 Radio 的垂直对齐样式。 - Table - 修复固定列时列头样式错位的问题。[#4936](https://github.com/ant-design/ant-design/issues/4936) From 29c262ab365a15e4a9663677cae14121000fba8d Mon Sep 17 00:00:00 2001 From: afc163 Date: Sat, 23 Sep 2017 19:59:04 +0800 Subject: [PATCH 5/7] Remove iview and atui from antd implementations --- docs/spec/introduce.en-US.md | 2 -- docs/spec/introduce.zh-CN.md | 2 -- 2 files changed, 4 deletions(-) diff --git a/docs/spec/introduce.en-US.md b/docs/spec/introduce.en-US.md index f9e0df2b47..2e1c7e4591 100644 --- a/docs/spec/introduce.en-US.md +++ b/docs/spec/introduce.en-US.md @@ -27,9 +27,7 @@ We supply a series of design principles, practical patterns and high quality des - [Ant Design of React](/docs/react/introduce) (official implementation) - -- - -- - - diff --git a/docs/spec/introduce.zh-CN.md b/docs/spec/introduce.zh-CN.md index 8c957f5235..7b082b70f0 100644 --- a/docs/spec/introduce.zh-CN.md +++ b/docs/spec/introduce.zh-CN.md @@ -27,9 +27,7 @@ Ant Design 是一个致力于提升『用户』和『设计者』使用体验的 - [Ant Design of React](/docs/react/introduce)(官方实现) - -- - -- - - From e672f41e1e026b6a5064e6a32f676e641d7db31f Mon Sep 17 00:00:00 2001 From: Wei Zhu Date: Mon, 25 Sep 2017 10:00:19 +0800 Subject: [PATCH 6/7] Use promise --- scripts/generateColorLess.js | 50 +++++++++++++++++------------------- 1 file changed, 23 insertions(+), 27 deletions(-) diff --git a/scripts/generateColorLess.js b/scripts/generateColorLess.js index 0dcad3ac11..35ba563fe9 100644 --- a/scripts/generateColorLess.js +++ b/scripts/generateColorLess.js @@ -49,28 +49,26 @@ const reducePlugin = postcss.plugin('reducePlugin', () => { }; }); -async function generateCss() { - const antd = path.resolve(__dirname, '../'); - const entry = path.join(antd, 'components/style/index.less'); - let content = fs.readFileSync(entry).toString(); - const styles = glob.sync(path.join(antd, 'components/*/style/index.less')); - content += '\n'; - styles.forEach((style) => { - content += `@import "${style}";\n`; - }); - content += `@import "${path.join(antd, 'site/theme/static/index.less')}";\n`; - fs.writeFileSync('/tmp/style.less', content); +const antd = path.resolve(__dirname, '../'); +const entry = path.join(antd, 'components/style/index.less'); +let content = fs.readFileSync(entry).toString(); +const styles = glob.sync(path.join(antd, 'components/*/style/index.less')); +content += '\n'; +styles.forEach((style) => { + content += `@import "${style}";\n`; +}); +content += `@import "${path.join(antd, 'site/theme/static/index.less')}";\n`; +fs.writeFileSync('/tmp/style.less', content); - let result = (await less.render.call(less, content, { - paths: [path.join(antd, 'components/style')], - })).css; - - result = (await postcss([ +less.render.call(less, content, { + paths: [path.join(antd, 'components/style')], +}).then(({ css }) => { + return postcss([ reducePlugin, - ]).process(result, { parser: less.parser, from: entry })).css; - + ]).process(css, { parser: less.parser, from: entry }); +}).then(({ css }) => { Object.keys(COLOR_MAP).forEach((key) => { - result = result.replace(new RegExp(key, 'g'), COLOR_MAP[key]); + css = css.replace(new RegExp(key, 'g'), COLOR_MAP[key]); }); const bezierEasing = fs.readFileSync(path.join(antd, 'components/style/color/bezierEasing.less')).toString(); @@ -80,16 +78,14 @@ async function generateCss() { .replace('@import "bezierEasing";', '') .replace('@import "tinyColor";', ''); - result = `${colorPalette}\n${result}`; - result = `${tinyColor}\n${result}`; - result = `${bezierEasing}\n${result}`; - result = `@primary-color: #108ee9;\n${result}`; + css = `${colorPalette}\n${css}`; + css = `${tinyColor}\n${css}`; + css = `${bezierEasing}\n${css}`; + css = `@primary-color: #108ee9;\n${css}`; const siteDir = path.resolve(__dirname, '../_site'); if (!fs.existsSync(siteDir)) { fs.mkdirSync(siteDir); } - fs.writeFileSync(path.resolve(__dirname, '../_site/color.less'), result); -} - -generateCss(); + fs.writeFileSync(path.resolve(__dirname, '../_site/color.less'), css); +}); From f43338218043b4c3ba66b0a67c2c470f489de7c6 Mon Sep 17 00:00:00 2001 From: Benjy Cui Date: Mon, 25 Sep 2017 10:39:45 +0800 Subject: [PATCH 7/7] site: fix tnpm run deploy --- site/bisheng.config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/site/bisheng.config.js b/site/bisheng.config.js index a246e69b56..9fef7cba94 100644 --- a/site/bisheng.config.js +++ b/site/bisheng.config.js @@ -74,7 +74,7 @@ module.exports = { 'create-react-class': 'preact-compat/lib/create-react-class', 'react-router': 'react-router', }); - } else { + } else if (isDev) { config.externals = Object.assign({}, config.externals, { react: 'React', 'react-dom': 'ReactDOM',