Merge branch 'master' into antd-3.0

This commit is contained in:
afc163 2017-09-25 10:54:49 +08:00
commit 6507aefd8e
9 changed files with 52 additions and 53 deletions

View File

@ -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) - 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) - 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) - 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 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) - 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) - 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 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 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) - 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. - Improve Checkbox and Radio vertical align style.
- Table - Table
- Fix misplace header when fix column. [#4936](https://github.com/ant-design/ant-design/issues/4936) - Fix misplace header when fix column. [#4936](https://github.com/ant-design/ant-design/issues/4936)

View File

@ -250,7 +250,7 @@ timeline: true
- 新增 Input.TextArea原 Input[type='textArea'] 将被废弃。[pull/6138](https://github.com/ant-design/ant-design/pull/6138) - 新增 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) - 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) - 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) - 新增 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) - 新增 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) - 修复了 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) - 修复 `Cannot find module '../../package.json'` 的问题。[#4935](https://github.com/ant-design/ant-design/issues/4935)
- 补充了 Table、RangePicker 和 Upload 的部分属性定义。 - 补充了 Table、RangePicker 和 Upload 的部分属性定义。
- 修复了 Modal `onOk` `afterClose` 和 Popconfirm `onConfirm` `onCancel` 缺少点击 event 参数的问题。 [#4787](https://github.com/ant-design/ant-design/issues/4787) - 修复了 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 的垂直对齐样式。 - 优化了 Checkbox 和 Radio 的垂直对齐样式。
- Table - Table
- 修复固定列时列头样式错位的问题。[#4936](https://github.com/ant-design/ant-design/issues/4936) - 修复固定列时列头样式错位的问题。[#4936](https://github.com/ant-design/ant-design/issues/4936)

View File

@ -44,21 +44,23 @@
top: 0; top: 0;
left: 0; left: 0;
display: block; display: block;
width: 14px; width: @checkbox-size;
height: 14px; height: @checkbox-size;
border: @border-width-base @border-style-base @border-color-base; border: @border-width-base @border-style-base @border-color-base;
border-radius: @border-radius-sm; border-radius: @border-radius-sm;
background-color: #fff; background-color: #fff;
transition: all .3s; transition: all .3s;
&:after { &:after {
@check-width: (@checkbox-size / 14) * 5px;
@check-height: (@checkbox-size / 14) * 8px;
transform: rotate(45deg) scale(0); transform: rotate(45deg) scale(0);
position: absolute; position: absolute;
left: 4px; left: (@checkbox-size - @check-width) / 2 - 0.5px * (@checkbox-size / 14);
top: 1px; top: (@checkbox-size - @check-height) / 2 - 2px * (@checkbox-size / 14);
display: table; display: table;
width: 5px; width: @check-width;
height: 8px; height: @check-height;
border: 2px solid #fff; border: 2px solid #fff;
border-top: 0; border-top: 0;
border-left: 0; border-left: 0;
@ -83,13 +85,15 @@
// 半选状态 // 半选状态
.@{checkbox-prefix-cls}-indeterminate .@{checkbox-inner-prefix-cls}:after { .@{checkbox-prefix-cls}-indeterminate .@{checkbox-inner-prefix-cls}:after {
@indeterminate-width: (@checkbox-size / 14) * 8px;
@indeterminate-height: (@checkbox-size / 14) * 1px;
content: ' '; content: ' ';
transform: scale(1); transform: scale(1);
position: absolute; position: absolute;
left: 2px; left: (@checkbox-size - 2 - @indeterminate-width) / 2;
top: 5px; top: (@checkbox-size - 3 - @indeterminate-height) / 2;
width: 8px; width: @indeterminate-width;
height: 1px; height: @indeterminate-height;
} }
.@{checkbox-prefix-cls}-indeterminate.@{checkbox-prefix-cls}-disabled .@{checkbox-inner-prefix-cls}:after { .@{checkbox-prefix-cls}-indeterminate.@{checkbox-prefix-cls}-disabled .@{checkbox-inner-prefix-cls}:after {
@ -100,11 +104,7 @@
.@{checkbox-prefix-cls}-checked .@{checkbox-inner-prefix-cls}:after { .@{checkbox-prefix-cls}-checked .@{checkbox-inner-prefix-cls}:after {
transform: rotate(45deg) scale(1); transform: rotate(45deg) scale(1);
position: absolute; position: absolute;
left: 4px;
top: 1px;
display: table; display: table;
width: 5px;
height: 8px;
border: 2px solid #fff; border: 2px solid #fff;
border-top: 0; border-top: 0;
border-left: 0; border-left: 0;

View File

@ -52,6 +52,10 @@
/* fix firefox can't set width smaller than content on flex item */ /* fix firefox can't set width smaller than content on flex item */
min-width: 0; min-width: 0;
&-children {
height: 100%;
}
&-has-trigger { &-has-trigger {
padding-bottom: @layout-trigger-height; padding-bottom: @layout-trigger-height;
} }

View File

@ -142,6 +142,9 @@
@btn-group-border : @primary-7; @btn-group-border : @primary-7;
// Checkbox
@checkbox-size : 14px;
// Radio buttons // Radio buttons
@radio-button-bg : @btn-default-bg; @radio-button-bg : @btn-default-bg;
@radio-button-color : @btn-default-color; @radio-button-color : @btn-default-color;
@ -228,7 +231,7 @@
@input-padding-vertical-base : 4px; @input-padding-vertical-base : 4px;
@input-padding-vertical-sm : 1px; @input-padding-vertical-sm : 1px;
@input-padding-vertical-lg : 6px; @input-padding-vertical-lg : 6px;
@input-placeholder-color : @disabled-color; @input-placeholder-color : hsv(0, 0, 75%);
@input-color : @text-color; @input-color : @text-color;
@input-border-color : @border-color-base; @input-border-color : @border-color-base;
@input-bg : #fff; @input-bg : #fff;

View File

@ -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) - [Ant Design of React](/docs/react/introduce) (official implementation)
- <div class="outside-link"><a href="http://ng.ant.design" target="_blank">NG-ZORRO - Ant Design of Angular</a></div> - <div class="outside-link"><a href="http://ng.ant.design" target="_blank">NG-ZORRO - Ant Design of Angular</a></div>
- <div class="outside-link"><a href="https://github.com/iview/iview/" target="_blank">iView (vue)</a></div>
- <div class="outside-link"><a href="https://github.com/FE-Driver/vue-beauty" target="_blank">vue-beauty</a></div> - <div class="outside-link"><a href="https://github.com/FE-Driver/vue-beauty" target="_blank">vue-beauty</a></div>
- <div class="outside-link"><a href="https://github.com/aliqin/atui" target="_blank">ATUI (vue)</a></div>
- <div class="outside-link"><a href="https://github.com/priornix/antizer" target="_blank">antizer (ClojureScript)</a></div> - <div class="outside-link"><a href="https://github.com/priornix/antizer" target="_blank">antizer (ClojureScript)</a></div>
- <div class="outside-link"><a href="https://github.com/idcos/antd-ember" target="_blank">antd-ember</a></div> - <div class="outside-link"><a href="https://github.com/idcos/antd-ember" target="_blank">antd-ember</a></div>

View File

@ -27,9 +27,7 @@ Ant Design 是一个致力于提升『用户』和『设计者』使用体验的
- [Ant Design of React](/docs/react/introduce)(官方实现) - [Ant Design of React](/docs/react/introduce)(官方实现)
- <div class="outside-link"><a href="http://ng.ant.design" target="_blank">NG-ZORRO - Ant Design of Angular</a></div> - <div class="outside-link"><a href="http://ng.ant.design" target="_blank">NG-ZORRO - Ant Design of Angular</a></div>
- <div class="outside-link"><a href="https://github.com/iview/iview/" target="_blank">iView (vue)</a></div>
- <div class="outside-link"><a href="https://github.com/FE-Driver/vue-beauty" target="_blank">vue-beauty</a></div> - <div class="outside-link"><a href="https://github.com/FE-Driver/vue-beauty" target="_blank">vue-beauty</a></div>
- <div class="outside-link"><a href="https://github.com/aliqin/atui" target="_blank">ATUI (vue)</a></div>
- <div class="outside-link"><a href="https://github.com/priornix/antizer" target="_blank">antizer (ClojureScript)</a></div> - <div class="outside-link"><a href="https://github.com/priornix/antizer" target="_blank">antizer (ClojureScript)</a></div>
- <div class="outside-link"><a href="https://github.com/idcos/antd-ember" target="_blank">antd-ember</a></div> - <div class="outside-link"><a href="https://github.com/idcos/antd-ember" target="_blank">antd-ember</a></div>

View File

@ -49,28 +49,26 @@ const reducePlugin = postcss.plugin('reducePlugin', () => {
}; };
}); });
async function generateCss() { const antd = path.resolve(__dirname, '../');
const antd = path.resolve(__dirname, '../'); const entry = path.join(antd, 'components/style/index.less');
const entry = path.join(antd, 'components/style/index.less'); let content = fs.readFileSync(entry).toString();
let content = fs.readFileSync(entry).toString(); const styles = glob.sync(path.join(antd, 'components/*/style/index.less'));
const styles = glob.sync(path.join(antd, 'components/*/style/index.less')); content += '\n';
content += '\n'; styles.forEach((style) => {
styles.forEach((style) => {
content += `@import "${style}";\n`; content += `@import "${style}";\n`;
}); });
content += `@import "${path.join(antd, 'site/theme/static/index.less')}";\n`; content += `@import "${path.join(antd, 'site/theme/static/index.less')}";\n`;
fs.writeFileSync('/tmp/style.less', content); fs.writeFileSync('/tmp/style.less', content);
let result = (await less.render.call(less, content, { less.render.call(less, content, {
paths: [path.join(antd, 'components/style')], paths: [path.join(antd, 'components/style')],
})).css; }).then(({ css }) => {
return postcss([
result = (await postcss([
reducePlugin, reducePlugin,
]).process(result, { parser: less.parser, from: entry })).css; ]).process(css, { parser: less.parser, from: entry });
}).then(({ css }) => {
Object.keys(COLOR_MAP).forEach((key) => { 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(); 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 "bezierEasing";', '')
.replace('@import "tinyColor";', ''); .replace('@import "tinyColor";', '');
result = `${colorPalette}\n${result}`; css = `${colorPalette}\n${css}`;
result = `${tinyColor}\n${result}`; css = `${tinyColor}\n${css}`;
result = `${bezierEasing}\n${result}`; css = `${bezierEasing}\n${css}`;
result = `@primary-color: #108ee9;\n${result}`; css = `@primary-color: #108ee9;\n${css}`;
const siteDir = path.resolve(__dirname, '../_site'); const siteDir = path.resolve(__dirname, '../_site');
if (!fs.existsSync(siteDir)) { if (!fs.existsSync(siteDir)) {
fs.mkdirSync(siteDir); fs.mkdirSync(siteDir);
} }
fs.writeFileSync(path.resolve(__dirname, '../_site/color.less'), result); fs.writeFileSync(path.resolve(__dirname, '../_site/color.less'), css);
} });
generateCss();

View File

@ -74,7 +74,7 @@ module.exports = {
'create-react-class': 'preact-compat/lib/create-react-class', 'create-react-class': 'preact-compat/lib/create-react-class',
'react-router': 'react-router', 'react-router': 'react-router',
}); });
} else { } else if (isDev) {
config.externals = Object.assign({}, config.externals, { config.externals = Object.assign({}, config.externals, {
react: 'React', react: 'React',
'react-dom': 'ReactDOM', 'react-dom': 'ReactDOM',