Compare commits

..

43 Commits

Author SHA1 Message Date
afc163
1a505e8fb0 Merge branch 'master' of github.com:ant-design/ant-design 2017-09-30 00:04:50 +08:00
Jeffrey Carl Faden
9ab9e62308 Add inputPrefixCls for Search component (#7770) 2017-09-30 00:04:19 +08:00
afc163
819e55e968 update snap 2017-09-29 23:10:27 +08:00
afc163
22860b9e87 2.13.4 2017-09-29 22:40:43 +08:00
偏右
44da4049f6 Changelog for 2.13.4 (#7785)
* changelog for 2.13.4

* emojis

* Add english changelog

* emojis
2017-09-29 21:47:01 +08:00
niko
9dc4102cdd fix: should trigger onChange before beforeUpload 2017-09-29 03:52:16 -05:00
Graeme Yeates
47e3cedf86 Minor fixes for select and form en docs (#7769)
* Fix headers on form validateFields [ci skip]

* Include default as an option for select sizes [ci skip]
2017-09-29 10:54:37 +08:00
ddcat1115
3b6dc3f3c4 revert wrong code removing fd40643c2d 2017-09-28 17:28:49 +08:00
Wei Zhu
9b68ce020c docs: fix table 2017-09-28 14:26:01 +08:00
Amorites
e17c8e093e Update index.zh-CN.md (#7755) 2017-09-27 21:15:05 +08:00
afc163
caec11c03a Fix snapshot 2017-09-27 20:21:28 +08:00
afc163
ca255cc547 Tweak AutoComplete input line height 2017-09-27 20:13:01 +08:00
jayberg
4acadc47b5 Avoid circular reference with infinite children (#7742)
Because {element} is a child of <InputElement>, we get a circular reference when also adding "element.props" to <InputElement>, as <InputElement> will be cloned to <{element}> within InputElement.tsx. As a consequence, we get an infinitive circular loop of Element->Props->Children->Element->Props->Children->Element->Props->Children->…

React seems to detect and automatically fix this infinitive loop. But when using the smaller and faster Inferno as a replacement library of React, we get a "RangeError: Maximum call stack size exceeded".

This commit fixes this bug by not attaching {...element.props} to <InputElement>.

All tests did pass and I did not notice any changes in the behaviour of the AutoComplete component. But now, AutoComplete works also with Inferno and not only with React.
2017-09-27 20:09:04 +08:00
afc163
d7eca4e151 Fix table's filter dropdown style 2017-09-27 20:03:26 +08:00
delesseps
a8cab96c13 Add maxLength attribute to Input (#7744) 2017-09-27 09:57:23 +08:00
778758944
4e726fdfd7 修复disabledTime interface定义错误 (#7740) 2017-09-26 16:11:28 +08:00
afc163
9f017bc5ae Fix mention error style 2017-09-25 22:53:11 +08:00
afc163
ccf507b603 update mention demos 2017-09-25 22:42:07 +08:00
afc163
f545e52ec5 Fix dropdown menu group title style 2017-09-25 21:28:00 +08:00
afc163
8026020dd4 Fix column sorter icons style 2017-09-25 21:24:43 +08:00
afc163
463a5db9ba Fix transfer checkbox padding 2017-09-25 20:03:04 +08:00
thegatheringstorm
10f6907da4 Fix: Upload Use object destructuring instead of creating temporary references for onRemove. (#7726) 2017-09-25 18:15:36 +08:00
afc163
3118e2898e Fix broken small pagination via #7634's fix 2017-09-25 16:59:56 +08:00
Miaow
6c38ca62c6 update get started doc port (#7729) 2017-09-25 16:59:40 +08:00
偏右
14b44c880e Update utils.jsx 2017-09-25 14:15:06 +08:00
afc163
8bff515287 Merge branch 'master' of github.com:ant-design/ant-design 2017-09-25 11:13:09 +08:00
afc163
fd40643c2d Remove unused code 2017-09-25 11:12:59 +08:00
Guan Yu Pan (Jacky)
c30c156c56 upgrade rc-animate to 2.4.1 (#7724) 2017-09-25 11:06:25 +08:00
Benjy Cui
f433382180 site: fix tnpm run deploy 2017-09-25 10:39:45 +08:00
Wei Zhu
e672f41e1e Use promise 2017-09-25 10:00:19 +08:00
afc163
29c262ab36 Remove iview and atui from antd implementations 2017-09-23 19:59:04 +08:00
afc163
6ded879619 update changelog 2017-09-23 19:28:40 +08:00
Zheeeng
d8c1bdb3ab Fix: setting 'heigh: 100%' on Sider and the wrapped element can't take the desired effects (#7716) 2017-09-23 18:33:26 +08:00
afc163
89a6aa96ed Tweak input placeholder color, close #7365 2017-09-23 18:21:33 +08:00
afc163
df1b1f5a47 Add @checkbox-size, close #7368 2017-09-23 18:18:47 +08:00
afc163
dd22bae0fc Fix button loading style with icon, close #7709 2017-09-23 16:08:30 +08:00
Sanjay Kumar
1dc4e45bce Bugfix: Handle defaultSearchChange when suggestions contain ‘Nav’ items (#7701) 2017-09-22 23:51:59 -05:00
afc163
8b1a4f80a9 Fix TreeSelect extra input text, close #7703 2017-09-23 12:11:17 +08:00
afc163
91bbcd6f2c Fix broken anchor, close #7712 2017-09-23 12:06:23 +08:00
Aske Ertmann
27b8e39666 Make iconfont usable standalone (#7713)
Similar to motion.less, import all dependencies needed to generate iconfont.less by itself.
2017-09-23 12:01:21 +08:00
afc163
7cfd9b2bcb Remove extra update 2017-09-22 21:47:28 +08:00
afc163
c66062edb4 Fix input compact style 2017-09-22 20:35:30 +08:00
afc163
776beaee05 Fix cursor height in safari 2017-09-22 20:17:04 +08:00
49 changed files with 277 additions and 155 deletions

View File

@@ -17,24 +17,44 @@ If you want to read change logs before `2.0.0`, please visit [GitHub](https://gi
---
## 2.13.4
`2017-09-29`
- 🐞 Fix missing Pagination `size="small"` style.
- 🐞 Fix Anchor missing padding. [#7712](https://github.com/ant-design/ant-design/issues/7712)
- 🐞 Fix TreeSelect extra select below search input. [#7703](https://github.com/ant-design/ant-design/issues/7703)
- 🐞 Fix the jumping problem of Form validate text. [#7730](https://github.com/ant-design/ant-design/issues/7730)
- 🐞 Fix Button Group loading style. [#7709](https://github.com/ant-design/ant-design/issues/7709)
- 🐞 Fix blur placeholder text color. [#7365](https://github.com/ant-design/ant-design/issues/7365)
- 🐞 Fix Mention `suggestion.toLowerCase is not a function` error. [#7696](https://github.com/ant-design/ant-design/issues/7696) [@kappa-gooner](https://github.com/kappa-gooner)
- 🐞 Fix a children height problem of Layout.Sider. [#7716](https://github.com/ant-design/ant-design/pull/7716) [@zheeeng](https://github.com/zheeeng)
- 🐞 Fix Dropdown menu group style.
- 🐞 Fix Table filter icon and dropdown style.
- 🐞 Fix a AutoComplete circular reference bug in Inferno. [#7742](https://github.com/ant-design/ant-design/pull/7742) [@menberg](https://github.com/menberg)
- 🐞 Fix Upload cannot upload file when using `beforeUpload`. [#7762](https://github.com/ant-design/ant-design/issues/7762) [#6983](https://github.com/ant-design/ant-design/issues/6983)
- TypeScript
- 🐞 Fix Input `maxLength` definite. [#7744](https://github.com/ant-design/ant-design/pull/7744) [@delesseps](https://github.com/delesseps)
- 🐞 Fix `disabledTime` definite of DatePicker. [#7740](https://github.com/ant-design/ant-design/pull/7740) [@778758944](https://github.com/778758944)
## 2.13.3
`2017-09-22`
- Fix Affix scrolling bug when document's height minus viewport's height is smaller than the height of children of Affix. [#2349](https://github.com/ant-design/ant-design/issues/2349)
- Fix broken style of header of Card when `Card[title]` is void and `Card[extra]` is set. [f46112d#commitcomment-24480417](https://github.com/ant-design/ant-design/commit/f46112d38561c89780eb44ecbba82347d2b912da#commitcomment-24480417)
- Fix TypeScript definition of `Checkbox[children]`. [#7650](https://github.com/ant-design/ant-design/issues/7650) [@liaokaien](https://github.com/liaokaien)
- Fix error when set nested name in `getFieldDecorator` and then click the label of `Form.Item`. [#7693](https://github.com/ant-design/ant-design/issues/7693)
- 🐞 Fix Affix scrolling bug when document's height minus viewport's height is smaller than the height of children of Affix. [#2349](https://github.com/ant-design/ant-design/issues/2349)
- 🐞 Fix broken style of header of Card when `Card[title]` is void and `Card[extra]` is set. [f46112d#commitcomment-24480417](https://github.com/ant-design/ant-design/commit/f46112d38561c89780eb44ecbba82347d2b912da#commitcomment-24480417)
- 🐞 Fix TypeScript definition of `Checkbox[children]`. [#7650](https://github.com/ant-design/ant-design/issues/7650) [@liaokaien](https://github.com/liaokaien)
- 🐞 Fix error when set nested name in `getFieldDecorator` and then click the label of `Form.Item`. [#7693](https://github.com/ant-design/ant-design/issues/7693)
- Input
- Fix broken style of `Input.Group[compat]` when it has `Select` as its children. [#7662](https://github.com/ant-design/ant-design/issues/7662)
- Fix TypeScript definition of `Input[autoComplete]`. [#7699](https://github.com/ant-design/ant-design/pull/7699) [@delesseps](https://github.com/delesseps)
- 🐞 Fix broken style of `Input.Group[compat]` when it has `Select` as its children. [#7662](https://github.com/ant-design/ant-design/issues/7662)
- 🐞 Fix TypeScript definition of `Input[autoComplete]`. [#7699](https://github.com/ant-design/ant-design/pull/7699) [@delesseps](https://github.com/delesseps)
- LocaleProvider
- Support Portuguese. [#7449](https://github.com/ant-design/ant-design/pull/7449) [@taviroquai](https://github.com/taviroquai)
- Fix missing translations in Dutch locale. [#7694](https://github.com/ant-design/ant-design/pull/7694) [@kstiopin](https://github.com/kstiopin)
- 🇵🇹 Support Portuguese. [#7449](https://github.com/ant-design/ant-design/pull/7449) [@taviroquai](https://github.com/taviroquai)
- 🐞 Fix missing translations in Dutch locale. [#7694](https://github.com/ant-design/ant-design/pull/7694) [@kstiopin](https://github.com/kstiopin)
- Table
- Fix height of table header when `rowSelection` is set. [#7663](https://github.com/ant-design/ant-design/issues/7663)
- Fix bug that click on first two options will not trigger event when `rowSelection.hideDefaultselections` is set. [#7626](https://github.com/ant-design/ant-design/issues/7626) [@infeng](https://github.com/infeng)
- Fix TypeScript definition of `Table[scroll]`. [#7640](https://github.com/ant-design/ant-design/pull/7640) [@BlackGanglion](https://github.com/BlackGanglion)
- 🐞 Fix height of table header when `rowSelection` is set. [#7663](https://github.com/ant-design/ant-design/issues/7663)
- 🐞 Fix bug that click on first two options will not trigger event when `rowSelection.hideDefaultselections` is set. [#7626](https://github.com/ant-design/ant-design/issues/7626) [@infeng](https://github.com/infeng)
- 🐞 Fix TypeScript definition of `Table[scroll]`. [#7640](https://github.com/ant-design/ant-design/pull/7640) [@BlackGanglion](https://github.com/BlackGanglion)
## 2.13.2
@@ -251,7 +271,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 +687,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)

View File

@@ -17,24 +17,44 @@ timeline: true
---
## 2.13.4
`2017-09-29`
- 🐞 修复 Pagination 小号样式失效的问题。
- 🐞 修复 Anchor 的样式错位。[#7712](https://github.com/ant-design/ant-design/issues/7712)
- 🐞 修复 TreeSelect 搜索框下多余文字的问题。[#7703](https://github.com/ant-design/ant-design/issues/7703)
- 🐞 修复 Form 校验文字跳动的问题。[#7730](https://github.com/ant-design/ant-design/issues/7730)
- 🐞 修复各类型 Button Group 的 loading 样式。 [#7709](https://github.com/ant-design/ant-design/issues/7709)
- 🐞 修复 placeholder 文本在某些情况下无法看清的问题。[#7365](https://github.com/ant-design/ant-design/issues/7365)
- 🐞 修复一个 Mention 的 `suggestion.toLowerCase is not a function` 报错问题。 [#7696](https://github.com/ant-design/ant-design/issues/7696) [@kappa-gooner](https://github.com/kappa-gooner)
- 🐞 修复一个 Layout.Sider 子元素的高度问题。[#7716](https://github.com/ant-design/ant-design/pull/7716) [@zheeeng](https://github.com/zheeeng)
- 🐞 修复 Dropdown 菜单分组的样式。
- 🐞 修复 Table 筛选图标和菜单样式错位。
- 🐞 修复一个 AutoComplete 在 Inferno 下循环引用的问题。[#7742](https://github.com/ant-design/ant-design/pull/7742) [@menberg](https://github.com/menberg)
- 🐞 修复 Upload 使用 `beforeUpload` 验证文件类型失败后无法再次上传的问题。[#7762](https://github.com/ant-design/ant-design/issues/7762) [#6983](https://github.com/ant-design/ant-design/issues/6983)
- TypeScript
- 🐞 修复 Input 的 `maxLength` 定义。[#7744](https://github.com/ant-design/ant-design/pull/7744) [@delesseps](https://github.com/delesseps)
- 🐞 修复 DatePicker 等组件的 `disabledTime` 的返回值定义。[#7740](https://github.com/ant-design/ant-design/pull/7740) [@778758944](https://github.com/778758944)
## 2.13.3
`2017-09-22`
- 修复 Affix 在内容与视口高度差小于 children 高度时触发的滚动抖动问题。[#2349](https://github.com/ant-design/ant-design/issues/2349)
- 修复 `Card[title]` 为空且设置 `Card[extra]` 时样式错乱的问题。[f46112d#commitcomment-24480417](https://github.com/ant-design/ant-design/commit/f46112d38561c89780eb44ecbba82347d2b912da#commitcomment-24480417)
- 修复 `Checkbox[children]` TypeScript definition。[#7650](https://github.com/ant-design/ant-design/issues/7650) [@liaokaien](https://github.com/liaokaien)
- 修复 `getFieldDecorator` 内使用嵌套 id 后点击 `Form.Item` label 报错的问题。[#7693](https://github.com/ant-design/ant-design/issues/7693)
- 🐞 修复 Affix 在内容与视口高度差小于 children 高度时触发的滚动抖动问题。[#2349](https://github.com/ant-design/ant-design/issues/2349)
- 🐞 修复 `Card[title]` 为空且设置 `Card[extra]` 时样式错乱的问题。[f46112d#commitcomment-24480417](https://github.com/ant-design/ant-design/commit/f46112d38561c89780eb44ecbba82347d2b912da#commitcomment-24480417)
- 🐞 修复 `Checkbox[children]` TypeScript definition。[#7650](https://github.com/ant-design/ant-design/issues/7650) [@liaokaien](https://github.com/liaokaien)
- 🐞 修复 `getFieldDecorator` 内使用嵌套 id 后点击 `Form.Item` label 报错的问题。[#7693](https://github.com/ant-design/ant-design/issues/7693)
- Input
- 修复 `Input.Group[compat]` 内嵌 `Select` 等控件时的样式问题。[#7662](https://github.com/ant-design/ant-design/issues/7662)
- 优化 `Input[autoComplete]` TypeScript 定义。[#7699](https://github.com/ant-design/ant-design/pull/7699) [@delesseps](https://github.com/delesseps)
- 🐞 修复 `Input.Group[compat]` 内嵌 `Select` 等控件时的样式问题。[#7662](https://github.com/ant-design/ant-design/issues/7662)
- 🐞 优化 `Input[autoComplete]` TypeScript 定义。[#7699](https://github.com/ant-design/ant-design/pull/7699) [@delesseps](https://github.com/delesseps)
- LocaleProvider
- 新增葡萄牙语。[#7449](https://github.com/ant-design/ant-design/pull/7449) [@taviroquai](https://github.com/taviroquai)
- 修复荷兰语 locale 缺少文案的问题。[#7694](https://github.com/ant-design/ant-design/pull/7694) [@kstiopin](https://github.com/kstiopin)
- 🇵🇹 新增葡萄牙语。[#7449](https://github.com/ant-design/ant-design/pull/7449) [@taviroquai](https://github.com/taviroquai)
- 🐞 修复荷兰语 locale 缺少文案的问题。[#7694](https://github.com/ant-design/ant-design/pull/7694) [@kstiopin](https://github.com/kstiopin)
- Table
- 修复 `rowSelection` 导致的表头高度问题。[#7663](https://github.com/ant-design/ant-design/issues/7663)
- 修复使用 `rowSelection.hideDefaultselections` 时导致自定义选项点击没反应的问题。[#7626](https://github.com/ant-design/ant-design/issues/7626) [@infeng](https://github.com/infeng)
- 优化 `Table[scroll]` TypeScript definition。[#7640](https://github.com/ant-design/ant-design/pull/7640) [@BlackGanglion](https://github.com/BlackGanglion)
- 🐞 修复 `rowSelection` 导致的表头高度问题。[#7663](https://github.com/ant-design/ant-design/issues/7663)
- 🐞 修复使用 `rowSelection.hideDefaultselections` 时导致自定义选项点击没反应的问题。[#7626](https://github.com/ant-design/ant-design/issues/7626) [@infeng](https://github.com/infeng)
- 🐞 优化 `Table[scroll]` TypeScript definition。[#7640](https://github.com/ant-design/ant-design/pull/7640) [@BlackGanglion](https://github.com/BlackGanglion)
## 2.13.2
@@ -250,7 +270,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 +685,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)

View File

@@ -41,7 +41,7 @@
display: none;
}
&-anchor-link {
&-link {
padding: 8px 0 8px 18px;
line-height: 1;
@@ -65,7 +65,7 @@
}
}
&-anchor-link &-anchor-link {
&-link &-link {
padding-top: 6px;
padding-bottom: 6px;
}

View File

@@ -52,7 +52,7 @@ export default class AutoComplete extends React.Component<AutoCompleteProps, any
const element = children && React.isValidElement(children) && children.type !== Option ?
React.Children.only(this.props.children) : <Input />;
return (
<InputElement {...element.props}>{element}</InputElement>
<InputElement>{element}</InputElement>
);
}

View File

@@ -33,6 +33,12 @@
.@{input-prefix-cls} {
background: transparent;
border-width: @border-width-base;
line-height: @line-height-base;
&:focus,
&:hover {
.hover;
}
}
&-lg {
@@ -52,13 +58,5 @@
.input-sm();
}
}
.@{input-prefix-cls} {
border-width: @border-width-base;
&:focus,
&:hover {
.hover;
}
}
}
}

View File

@@ -146,7 +146,7 @@ export default class Button extends React.Component<ButtonProps, any> {
[`${prefixCls}-${type}`]: type,
[`${prefixCls}-${shape}`]: shape,
[`${prefixCls}-${sizeCls}`]: sizeCls,
[`${prefixCls}-icon-only`]: !children && icon && !loading,
[`${prefixCls}-icon-only`]: !children && icon,
[`${prefixCls}-loading`]: loading,
[`${prefixCls}-clicked`]: clicked,
[`${prefixCls}-background-ghost`]: ghost,

View File

@@ -93,7 +93,7 @@
display: block;
}
&&-loading:not(&-circle):not(&-circle-outline) {
&&-loading:not(&-circle):not(&-circle-outline):not(&-icon-only) {
padding-left: 29px;
pointer-events: none;
position: relative;
@@ -102,7 +102,7 @@
}
}
&-sm&-loading:not(&-circle):not(&-circle-outline) {
&-sm&-loading:not(&-circle):not(&-circle-outline):not(&-icon-only) {
padding-left: 24px;
.@{iconfont-css-prefix} {
margin-left: -17px;

View File

@@ -21,7 +21,7 @@ A carousel component. Scales with its container.
| vertical | Whether to use a vertical display | boolean | `false` |
| autoplay | Whether to scroll automatically | boolean | `false` |
| easing | Transition interpolation function name | string | `linear` |
| beforeChange | Callback function called before the current index changes | function(from, to) |
| afterChange | Callback function called after the current index changes | function(current) |
| beforeChange | Callback function called before the current index changes | function(from, to) | - |
| afterChange | Callback function called after the current index changes | function(current) | - |
For more info on the parameters, refer to the https://github.com/akiran/react-slick

View File

@@ -22,7 +22,7 @@ subtitle: 走马灯
| vertical | 垂直显示 | boolean | false |
| autoplay | 是否自动切换 | boolean | false |
| easing | 动画效果 | string | linear |
| beforeChange | 切换面板的回调 | function(from, to) | 无
| afterChange | 切换面板的回调 | function(current) | 无
| beforeChange | 切换面板的回调 | function(from, to) | 无 |
| afterChange | 切换面板的回调 | function(current) | 无 |
更多参数可参考https://github.com/akiran/react-slick

View File

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

View File

@@ -40,9 +40,9 @@ export interface DatePickerProps extends PickerProps, SinglePickerProps {
open?: boolean;
toggleOpen?: (e: {open: boolean}) => void;
disabledTime?: (current: moment.Moment) => {
disabledHours?: () => [number, number],
disabledMinutes?: () => [number, number],
disabledSeconds?: () => [number, number],
disabledHours?: () => number[],
disabledMinutes?: () => number[],
disabledSeconds?: () => number[],
};
onOpenChange?: (status: boolean) => void;
onOk?: (selectedTime: moment.Moment) => void;
@@ -69,9 +69,9 @@ export interface RangePickerProps extends PickerProps {
};
placeholder?: [string, string];
disabledTime?: (current: moment.Moment, type: string) => {
disabledHours?: () => [number, number],
disabledMinutes?: () => [number, number],
disabledSeconds?: () => [number, number],
disabledHours?: () => number[],
disabledMinutes?: () => number[],
disabledSeconds?: () => number[],
};
}

View File

@@ -48,6 +48,12 @@
box-shadow: @box-shadow-base;
background-clip: padding-box;
&-item-group-title {
color: @text-color-secondary;
padding: 6px 8px;
transition: all .3s;
}
&-item,
&-submenu-title {
padding: 7px 8px;

View File

@@ -2,7 +2,6 @@ import React from 'react';
import { findDOMNode } from 'react-dom';
import PropTypes from 'prop-types';
import classNames from 'classnames';
import Animate from 'rc-animate';
import PureRenderMixin from 'rc-util/lib/PureRenderMixin';
import Row from '../grid/row';
import Col, { ColProps } from '../grid/col';
@@ -126,15 +125,11 @@ export default class FormItem extends React.Component<FormItemProps, any> {
renderHelp() {
const prefixCls = this.props.prefixCls;
const help = this.getHelpMsg();
const children = help ? (
<div className={`${prefixCls}-explain`} key="help">
{help}
</div>
) : null;
return (
<Animate transitionName="show-help" component="" transitionAppear key="help">
{children}
</Animate>);
return help ? (
<div className={`${prefixCls}-explain`} key="help">
{help}
</div>
) : null;
}
renderExtra() {

View File

@@ -85,7 +85,7 @@ If the form has been decorated by `Form.create` then it has `this.props.form` pr
### this.props.form.validateFields/validateFieldsAndScroll([fieldNames: string[]], [options: object], callback: Function(errors, values))
| 参数 | 说明 | 类型 | 默认值 |
| Method | Description | Type | Default |
|-----|-----|------|-------|
| options.first | If `true`, every field will stop validation at first failed rule | boolean | false |
| options.firstFields | Those fields will stop validation at first failed rule | String[] | [] |

View File

@@ -491,7 +491,7 @@ form {
border-color: @error-color;
}
}
&.@{ant-prefix}-mention-active .@{ant-prefix}-mention-editor,
&.@{ant-prefix}-mention-active:not([disabled]) .@{ant-prefix}-mention-editor,
.@{ant-prefix}-mention-editor:not([disabled]):focus {
.active(@error-color);
}

View File

@@ -27,6 +27,7 @@ export interface InputProps extends AbstractInputProps {
id?: number | string;
name?: string;
size?: 'large' | 'default' | 'small';
maxLength?: string;
disabled?: boolean;
readOnly?: boolean;
addonBefore?: React.ReactNode;
@@ -62,6 +63,7 @@ export default class Input extends Component<InputProps, any> {
PropTypes.number,
]),
size: PropTypes.oneOf(['small', 'default', 'large']),
maxLength: PropTypes.string,
disabled: PropTypes.bool,
value: PropTypes.any,
defaultValue: PropTypes.any,

View File

@@ -4,11 +4,13 @@ import Input, { InputProps } from './Input';
import Icon from '../icon';
export interface SearchProps extends InputProps {
inputPrefixCls?: string;
onSearch?: (value: string) => any;
}
export default class Search extends React.Component<SearchProps, any> {
static defaultProps = {
inputPrefixCls: 'ant-input',
prefixCls: 'ant-input-search',
};
input: any;
@@ -20,7 +22,7 @@ export default class Search extends React.Component<SearchProps, any> {
this.input.focus();
}
render() {
const { className, prefixCls, ...others } = this.props;
const { className, inputPrefixCls, prefixCls, ...others } = this.props;
delete (others as any).onSearch;
const searchSuffix = (
<Icon
@@ -34,6 +36,7 @@ export default class Search extends React.Component<SearchProps, any> {
onPressEnter={this.onSearch}
{...others}
className={classNames(prefixCls, className)}
prefixCls={inputPrefixCls}
suffix={searchSuffix}
ref={node => this.input = node}
/>

View File

@@ -1,5 +1,22 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`Input should support maxLength 1`] = `
<Input
disabled={false}
maxLength="3"
prefixCls="ant-input"
type="text"
>
<input
className="ant-input"
disabled={false}
maxLength="3"
onKeyDown={[Function]}
type="text"
/>
</Input>
`;
exports[`TextArea should support disabled 1`] = `
<TextArea
disabled={true}
@@ -14,3 +31,18 @@ exports[`TextArea should support disabled 1`] = `
/>
</TextArea>
`;
exports[`TextArea should support maxLength 1`] = `
<TextArea
maxLength="10"
prefixCls="ant-input"
>
<textarea
className="ant-input"
maxLength="10"
onChange={[Function]}
onKeyDown={[Function]}
style={Object {}}
/>
</TextArea>
`;

View File

@@ -7,6 +7,15 @@ const { TextArea } = Input;
const delay = timeout => new Promise(resolve => setTimeout(resolve, timeout));
describe('Input', () => {
it('should support maxLength', async () => {
const wrapper = mount(
<Input maxLength="3" />
);
expect(wrapper).toMatchSnapshot();
});
});
describe('TextArea', () => {
it('should auto calculate height according to content length', async () => {
const wrapper = mount(
@@ -27,6 +36,13 @@ describe('TextArea', () => {
);
expect(wrapper).toMatchSnapshot();
});
it('should support maxLength', async () => {
const wrapper = mount(
<TextArea maxLength="10" />
);
expect(wrapper).toMatchSnapshot();
});
});
describe('As Form Control', () => {

View File

@@ -251,7 +251,7 @@
}
&&-compact {
display: inline-block;
display: block;
.clearfix;
& > * {

View File

@@ -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;
}

View File

@@ -43,7 +43,7 @@ class AsyncMention extends React.Component {
const { suggestions, loading } = this.state;
return (
<Mention
style={{ width: '100%', height: 100 }}
style={{ width: '100%' }}
loading={loading}
suggestions={suggestions}
onSearchChange={this.onSearchChange}

View File

@@ -53,7 +53,7 @@ class CustomNavMention extends React.Component {
const { suggestions } = this.state;
return (
<Mention
style={{ width: '100%', height: 100 }}
style={{ width: '100%' }}
suggestions={suggestions}
onSearchChange={this.onSearchChange}
/>

View File

@@ -27,7 +27,7 @@ function onSelect(suggestion) {
ReactDOM.render(
<Mention
style={{ width: '100%', height: 100 }}
style={{ width: '100%' }}
onChange={onChange}
defaultValue={toContentState('@afc163')}
suggestions={['afc163', 'benjycui', 'yiminghe', 'RaoHai', '中文', 'にほんご']}

View File

@@ -65,7 +65,6 @@ class App extends React.Component {
})(
<Mention
suggestions={['afc163', 'benjycui', 'yiminghe', 'RaoHai', '中文', 'にほんご']}
style={{ height: 60 }}
/>
)}
</FormItem>

View File

@@ -55,7 +55,7 @@ class CustomNavMention extends React.Component {
return (
<Mention
placeholder="@someone"
style={{ width: '100%', height: 100 }}
style={{ width: '100%' }}
suggestions={suggestions}
onSearchChange={this.onSearchChange}
onSelect={onSelect}

View File

@@ -45,7 +45,7 @@ class App extends React.Component {
render() {
return (
<Mention
style={{ width: '100%', height: 100 }}
style={{ width: '100%' }}
onChange={onChange}
placeholder="input @ to mention people, # to mention tag"
prefix={['@', '#']}

View File

@@ -32,7 +32,7 @@ class PopoverContainer extends React.Component {
render() {
const mention = (
<Mention
style={{ width: '100%', height: 100 }}
style={{ width: '100%' }}
onChange={onChange}
defaultValue={toContentState('@afc163')}
suggestions={['afc163', 'benjycui', 'yiminghe', 'RaoHai', '中文', 'にほんご']}

View File

@@ -80,7 +80,14 @@ export default class Mention extends React.Component<MentionProps, MentionState>
defaultSearchChange(value: String): void {
const searchValue = value.toLowerCase();
const filteredSuggestions = (this.props.suggestions || []).filter(
suggestion => suggestion.toLowerCase().indexOf(searchValue) !== -1,
suggestion => {
if (suggestion.type && suggestion.type === Nav) {
return suggestion.props.value ?
suggestion.props.value.toLowerCase().indexOf(searchValue) !== -1
: true;
}
return suggestion.toLowerCase().indexOf(searchValue) !== -1;
},
);
this.setState({
suggestions: filteredSuggestions,

View File

@@ -36,7 +36,7 @@ subtitle: 导航菜单
| openKeys | 当前展开的 SubMenu 菜单项 key 数组 | string[] | |
| defaultOpenKeys | 初始展开的 SubMenu 菜单项 key 数组 | | |
| onOpenChange | SubMenu 展开/关闭的回调 | function(openKeys: string[]) | noop |
| onSelect | 被选中时调 | function({ item, key, selectedKeys }) | 无 |
| onSelect | 被选中时调 | function({ item, key, selectedKeys }) | 无   |
| onDeselect | 取消选中时调用,仅在 multiple 生效 | function({ item, key, selectedKeys }) | - |
| onClick | 点击 MenuItem 调用此函数 | function({ item, key, keyPath }) | - |
| style | 根节点样式 | object | |

View File

@@ -250,6 +250,7 @@
&-simple &-simple-pager {
display: inline-block;
margin-right: 8px;
height: 24px;
input {
margin-right: 8px;
@@ -259,7 +260,7 @@
border: @border-width-base @border-style-base @border-color-base;
outline: none;
padding: 0 6px;
height: 24px;
height: 100%;
text-align: center;
transition: border-color .3s;
@@ -270,8 +271,9 @@
}
}
.@{pagination-prefix-cls}:not(.@{pagination-prefix-cls}-simple) {
&.mini &-total-text {
.@{pagination-prefix-cls} {
&.mini &-total-text,
&.mini &-simple-pager {
height: 20px;
line-height: 20px;
}

View File

@@ -42,7 +42,7 @@ Select component to select value from options.
| dropdownMatchSelectWidth | Whether dropdown's with is same with select. | boolean | true |
| optionFilterProp | Which prop value of option will be used for filter if filterOption is true | string | value |
| optionLabelProp | Which prop value of option will render as content of select. | string | `children` |
| size | Size of Select input. `large` `small` | string | default |
| size | Size of Select input. `default` `large` `small` | string | default |
| showSearch | Whether show search input in single mode.| boolean | false |
| disabled | Whether disabled select | boolean | false |
| defaultActiveFirstOption | Whether active first option by default | boolean | true |

View File

@@ -235,6 +235,14 @@
left: 8px;
}
&-search__field__mirror {
position: absolute;
top: 0;
left: -9999px;
white-space: pre;
pointer-events: none;
}
&-search--inline {
position: absolute;
height: 100%;
@@ -258,14 +266,7 @@
background: transparent;
outline: 0;
border-radius: @border-radius-base;
}
.@{select-prefix-cls}-search__field__mirror {
position: absolute;
top: 0;
left: -9999px;
white-space: pre;
pointer-events: none;
line-height: 1;
}
> i {

View File

@@ -1,5 +1,7 @@
@import '../themes/default';
@import "../mixins/iconfont";
// font-face
// @icon-url 字体源文件的地址
@font-face {
font-family: 'anticon';
src: url('@{icon-url}.eot'); /* IE9*/

View File

@@ -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
@@ -223,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;

View File

@@ -3574,7 +3574,7 @@ exports[`renders ./components/table/demo/fixed-columns.md correctly 1`] = `
>
<div
class="ant-table-body"
style="overflow-x:auto;"
style="overflow-x:auto;-webkit-transform:translate3d (0, 0, 0);"
>
<table
class="ant-table-fixed"
@@ -3828,6 +3828,7 @@ exports[`renders ./components/table/demo/fixed-columns.md correctly 1`] = `
>
<div
class="ant-table-body-outer"
style="-webkit-transform:translate3d (0, 0, 0);"
>
<div
class="ant-table-body-inner"
@@ -3912,6 +3913,7 @@ exports[`renders ./components/table/demo/fixed-columns.md correctly 1`] = `
>
<div
class="ant-table-body-outer"
style="-webkit-transform:translate3d (0, 0, 0);"
>
<div
class="ant-table-body-inner"
@@ -4158,7 +4160,7 @@ exports[`renders ./components/table/demo/fixed-columns-header.md correctly 1`] =
</div>
<div
class="ant-table-body"
style="overflow-x:auto;max-height:300px;overflow-y:scroll;"
style="overflow-x:auto;-webkit-transform:translate3d (0, 0, 0);max-height:300px;overflow-y:scroll;"
>
<table
class="ant-table-fixed"
@@ -4915,6 +4917,7 @@ exports[`renders ./components/table/demo/fixed-columns-header.md correctly 1`] =
</div>
<div
class="ant-table-body-outer"
style="-webkit-transform:translate3d (0, 0, 0);"
>
<div
class="ant-table-body-inner"
@@ -5150,6 +5153,7 @@ exports[`renders ./components/table/demo/fixed-columns-header.md correctly 1`] =
</div>
<div
class="ant-table-body-outer"
style="-webkit-transform:translate3d (0, 0, 0);"
>
<div
class="ant-table-body-inner"
@@ -6864,7 +6868,7 @@ exports[`renders ./components/table/demo/grouping-columns.md correctly 1`] = `
</div>
<div
class="ant-table-body"
style="overflow-x:auto;max-height:240px;overflow-y:scroll;"
style="overflow-x:auto;-webkit-transform:translate3d (0, 0, 0);max-height:240px;overflow-y:scroll;"
>
<table
class="ant-table-fixed"
@@ -7415,6 +7419,7 @@ exports[`renders ./components/table/demo/grouping-columns.md correctly 1`] = `
</div>
<div
class="ant-table-body-outer"
style="-webkit-transform:translate3d (0, 0, 0);"
>
<div
class="ant-table-body-inner"
@@ -7598,6 +7603,7 @@ exports[`renders ./components/table/demo/grouping-columns.md correctly 1`] = `
</div>
<div
class="ant-table-body-outer"
style="-webkit-transform:translate3d (0, 0, 0);"
>
<div
class="ant-table-body-inner"

View File

@@ -375,6 +375,7 @@ exports[`Table renders empty table with fixed columns 1`] = `
>
<div
class="ant-table-body-outer"
style="-webkit-transform:translate3d (0, 0, 0);"
>
<div
class="ant-table-body-inner"
@@ -422,6 +423,7 @@ exports[`Table renders empty table with fixed columns 1`] = `
>
<div
class="ant-table-body-outer"
style="-webkit-transform:translate3d (0, 0, 0);"
>
<div
class="ant-table-body-inner"

View File

@@ -298,7 +298,6 @@
margin-left: 4px;
display: inline-block;
width: 14px;
height: 1em;
vertical-align: middle;
text-align: center;
@@ -307,6 +306,7 @@
line-height: 4px;
display: block;
width: 14px;
height: 6px;
cursor: pointer;
&:hover .@{iconfont-css-prefix} {
color: @text-color;
@@ -462,7 +462,7 @@
}
&-item > label + span {
padding: 0;
padding-right: 0;
}
&-sub {

View File

@@ -4,7 +4,7 @@ exports[`renders ./components/tree/demo/basic.md correctly 1`] = `
<ul
class="ant-tree"
role="tree-node"
unselectable="true"
unselectable="on"
>
<li
class=""
@@ -176,7 +176,7 @@ exports[`renders ./components/tree/demo/basic-controlled.md correctly 1`] = `
<ul
class="ant-tree"
role="tree-node"
unselectable="true"
unselectable="on"
>
<li
class=""
@@ -488,7 +488,7 @@ exports[`renders ./components/tree/demo/customized-icon.md correctly 1`] = `
<ul
class="ant-tree ant-tree-show-line"
role="tree-node"
unselectable="true"
unselectable="on"
>
<li
class=""
@@ -652,7 +652,7 @@ exports[`renders ./components/tree/demo/draggable.md correctly 1`] = `
<ul
class="ant-tree draggable-tree"
role="tree-node"
unselectable="true"
unselectable="on"
>
<li
class=""
@@ -842,7 +842,7 @@ exports[`renders ./components/tree/demo/dynamic.md correctly 1`] = `
<ul
class="ant-tree"
role="tree-node"
unselectable="true"
unselectable="on"
>
<li
class=""
@@ -902,7 +902,7 @@ exports[`renders ./components/tree/demo/line.md correctly 1`] = `
<ul
class="ant-tree ant-tree-show-line"
role="tree-node"
unselectable="true"
unselectable="on"
>
<li
class=""
@@ -1058,7 +1058,7 @@ exports[`renders ./components/tree/demo/search.md correctly 1`] = `
<ul
class="ant-tree"
role="tree-node"
unselectable="true"
unselectable="on"
>
<li
class=""

View File

@@ -218,6 +218,17 @@ export default class Upload extends React.Component<UploadProps, any> {
});
}
beforeUpload = (file, fileList) => {
if (this.props.beforeUpload && !this.props.beforeUpload(file, fileList)) {
this.onChange({
file,
fileList,
});
return false;
}
return true;
}
clearProgressTimer() {
clearInterval(this.progressTimer);
}
@@ -234,6 +245,7 @@ export default class Upload extends React.Component<UploadProps, any> {
onProgress: this.onProgress,
onSuccess: this.onSuccess,
...this.props,
beforeUpload: this.beforeUpload,
};
delete rcUploadProps.className;

View File

@@ -26,7 +26,7 @@ export default class UploadList extends React.Component<UploadListProps, any> {
};
handleClose = (file: UploadFile) => {
const onRemove = this.props.onRemove;
const { onRemove } = this.props;
if (onRemove) {
onRemove(file);
}

View File

@@ -94,7 +94,7 @@ ReactDOM.render(<App />, document.getElementById('root'));
### 4. Development & Debugging
Run your project and visit http://127.0.0.1:8000
Run your project and visit http://127.0.0.1:8001
```bash
$ npm start

View File

@@ -93,7 +93,7 @@ ReactDOM.render(<App />, document.getElementById('root'));
### 4. 开发调试
一键启动调试,访问 http://127.0.0.1:8000 查看效果。
一键启动调试,访问 http://127.0.0.1:8001 查看效果。
```bash
$ npm start

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)
- <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/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/idcos/antd-ember" target="_blank">antd-ember</a></div>

View File

@@ -27,9 +27,7 @@ Ant Design 是一个致力于提升『用户』和『设计者』使用体验的
- [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="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/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/idcos/antd-ember" target="_blank">antd-ember</a></div>

View File

@@ -1,6 +1,6 @@
{
"name": "antd",
"version": "2.13.3",
"version": "2.13.4",
"title": "Ant Design",
"description": "An enterprise-class UI design language and React-based implementation",
"homepage": "http://ant.design/",
@@ -49,7 +49,7 @@
"moment": "^2.18.1",
"omit.js": "^1.0.0",
"prop-types": "^15.5.7",
"rc-animate": "^2.3.6",
"rc-animate": "^2.4.1",
"rc-calendar": "~9.0.0",
"rc-cascader": "~0.11.3",
"rc-checkbox": "~2.0.3",

View File

@@ -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);
});

View File

@@ -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',

View File

@@ -37,7 +37,7 @@ export function getLocalizedPathname(path, zhCN) {
export function ping(callback) {
// eslint-disable-next-line
const url = 'https://private-a' + 'lipay' + 'objects.com/alip' + 'ay-rmsdeploy-image/rmsportal/RKuAiriJqrUhyqW.png';
const url = 'https://private-a' + 'lipay' + 'objects.alip' + 'ay.com/alip' + 'ay-rmsdeploy-image/rmsportal/RKuAiriJqrUhyqW.png';
const img = new Image();
let done;
const finish = (status) => {