Merge branch 'master' into feature-for-resolve-conflict

* master: (45 commits)
  Add type definitions for Steps.Step (#14468)
  add select check to fix edge wave issue (#14469)
  Fix for Pagination ellipsis misalignment (#14473)
  change sentry id
   Add sentry in ant.design
  💄 New Sketch resources!
  fix transfer ref (#14441)
  Add onMouseEnter and onMouseLeave for Menu Item (#14454)
  update snapshot (#14467)
  📝 beautify code style in documentation (#14457)
  Updating type: TreeSelectProps.getPopupContainer (#14443)
  change error version
  3.12.4 changelog (#14436)
  Format
  Fix the bug that radio onchange will be ovrride by radioGroup onchange (#14364)
  docs: updated doc for create-react-app
  fix prefixCls of empty go to div (#14404)
  update snapshot (#14406)
  add radius on table-placeholder to fix table small size border clip (#14398)
  fix style of Input.Search with enterButton (#14397)
  ...
This commit is contained in:
afc163 2019-01-22 17:34:10 +08:00
commit d3d5a3e18d
No known key found for this signature in database
GPG Key ID: 738F973FCE5C6B48
48 changed files with 759 additions and 888 deletions

View File

@ -15,38 +15,63 @@ timeline: true
---
## 3.12.4
`2019-01-19`
- 🌟 Update the "Use in creact-react-app" document to be compatible with upgraded creact-react-app and react-scripts-rewired. [#14385](https://github.com/ant-design/ant-design/pull/14385)
- 💄 Fix using autoprefixer 9.4.5 in postcss (webpack) will throw an error `Replace text-decoration-skip: ink to text-decoration-skip-ink: auto, because spec had been changed`. [#14312](https://github.com/ant-design/ant-design/pull/14312)
- 💄 Fix InputNumber style not correct in MenuItem. [#14373](https://github.com/ant-design/ant-design/pull/14373)
- 💄 Fix Input.Search with enterButton style issue. [#14397](https://github.com/ant-design/ant-design/pull/14397)
- 💄 Fix Slider focus style. [9202509](https://github.com/ant-design/ant-design/commit/92025095032a05b2bc347218b523ffd42f75a607)
- 🐞 Fix the problem that the `prefixCls` property is passed to the `Empty` . [#14404](https://github.com/ant-design/ant-design/pull/14404)
- 🐞 Fix the problem that Radio `onChange` will be override by RadioGroup `onChange`.[#14364](https://github.com/ant-design/ant-design/pull/14364)
## 3.12.3
`2019-01-13`
- 🐞 Reverted [#14157](https://github.com/ant-design/ant-design/pull/14157) to fix Input `prefix` and `suffix` missing problem. [#14310](https://github.com/ant-design/ant-design/issues/14310)
- 🐞 Fixed Empty `image` TypeScript type to ReactNode. [#14308](https://github.com/ant-design/ant-design/issues/14308) [@chunlea](https://github.com/chunlea)
## 3.12.2
`2019-01-12`
- 🐞 Fix the ineffectiveness of `className` prop for Anchor.Link. [#14248](https://github.com/ant-design/ant-design/pull/14248)
- 🐞 Fix the incompatibility of float number for Badge. [#14195](https://github.com/ant-design/ant-design/pull/14195) [@ztplz](https://github.com/ztplz)
- 🐞 Fix the auto focus when popup layer is `open` still for DatePicker. [#14092](https://github.com/ant-design/ant-design/pull/14092) [@Yangzhedi](https://github.com/Yangzhedi)
- Drawer
- 🐞 Fix the empty header when `title` is null for Drawer. [#14264](https://github.com/ant-design/ant-design/pull/14264) [@ztplz](https://github.com/ztplz)
- 🐞 Fix the ineffectiveness of `bodyStyle` prop for Drawer. [#14294](https://github.com/ant-design/ant-design/pull/14294) [@ztplz](https://github.com/ztplz)
- 🐞 Fix the empty header when `title` is null for Drawer. [#14264](https://github.com/ant-design/ant-design/pull/14264) [@ztplz](https://github.com/ztplz)
- 🐞 Fix the ineffectiveness of `bodyStyle` prop for Drawer. [#14294](https://github.com/ant-design/ant-design/pull/14294) [@ztplz](https://github.com/ztplz)
- 🐞 Fix label for verticle Form cannot be wrapped. [#14135](https://github.com/ant-design/ant-design/pull/14135) [@ranbena](https://github.com/ranbena)
- 🐞 Fix the wrong position for Modal.confirm in small screen. [#14279](https://github.com/ant-design/ant-design/issues/14279)
- Radio
- 🐞 Fix the wrong style for Radio.Button when it is disabled and selected. [#14165](https://github.com/ant-design/ant-design/issues/14165)
- 💄 Improve the style for focused Radio. [#14186](https://github.com/ant-design/ant-design/issues/14186)
- 🐞 Fix the wrong style for Radio.Button when it is disabled and selected. [#14165](https://github.com/ant-design/ant-design/issues/14165)
- 💄 Improve the style for focused Radio. [#14186](https://github.com/ant-design/ant-design/issues/14186)
- 🐞 Fix the empty style for Select. [#14204](https://github.com/ant-design/ant-design/issues/14204)
- 💄 Simplify the implementation of Spin to improve performance. [#14100](https://github.com/ant-design/ant-design/issues/14100)
- Table
- 🐞 Fix the unexpected appearance of sorter `title` for Table. [#14168](https://github.com/ant-design/ant-design/issues/14168)
- 🐞 Fix the unexpected sorter trigger when click `filterDropdown` for Table. [#14238](https://github.com/ant-design/ant-design/issues/14238)
- 🐞 Fix the unexpected appearance of sorter `title` for Table. [#14168](https://github.com/ant-design/ant-design/issues/14168)
- 🐞 Fix the unexpected sorter trigger when click `filterDropdown` for Table. [#14238](https://github.com/ant-design/ant-design/issues/14238)
- 🐞 Fix the unexpected call of `afterClose` for Tage when visible changes from false to true. [#14200](https://github.com/ant-design/ant-design/pull/14200) [@tangjinzhou](https://github.com/tangjinzhou)
- TypeScript
- 🐞 Fix the TypeScript definition lack of `forceRender` for Modal. [#14160](https://github.com/ant-design/ant-design/issues/14160)
- 🐞 Fix the TypeScript definition of `sortDirections` for `TableProps``TypeScript` 类型定义中 属性必选的问题。[#14182](https://github.com/ant-design/ant-design/pull/14182)
- 🐞 Fix the wrong TypeScript definition of `locale` for Table. [#14245](https://github.com/ant-design/ant-design/pull/14245) [@LeezQ](https://github.com/LeezQ)
- 🐞 Fix the TypeScript definition not extending from native `div` element for List.Item. [#14171](https://github.com/ant-design/ant-design/issues/14171)
- 🐞 Fix the TypeScript definition lack of `forceRender` for Modal. [#14160](https://github.com/ant-design/ant-design/issues/14160)
- 🐞 Fix the TypeScript definition of `sortDirections` for `TableProps``TypeScript` 类型定义中 属性必选的问题。[#14182](https://github.com/ant-design/ant-design/pull/14182)
- 🐞 Fix the wrong TypeScript definition of `locale` for Table. [#14245](https://github.com/ant-design/ant-design/pull/14245) [@LeezQ](https://github.com/LeezQ)
- 🐞 Fix the TypeScript definition not extending from native `div` element for List.Item. [#14171](https://github.com/ant-design/ant-design/issues/14171)
- 🌟 Add new `Less` variables, including `@btn-shadow`, `@btn-primary-shadow` and `@btn-text-shadow`. [#14172](https://github.com/ant-design/ant-design/issues/14172)
## 3.12.1
`2019-01-06`
- 🐞 Fixed build error caused by importing svg.
## 3.12.0
`2019-01-06`
- 🎉 New component [Empty](https://ant.design/components/empty/), and improved empty data style of all components! [13651](https://github.com/ant-design/ant-design/pull/13651)
- 🎉 Hindi locale added (hi_IN). [#13776](https://github.com/ant-design/ant-design/pull/13759) [@gurungrahul2](https://github.com/aashutoshrathi)
- 🎉 Kannada locale added (kn_IN). [#13776](https://github.com/ant-design/ant-design/pull/13776) [@gurungrahul2](https://github.com/gurungrahul2)
@ -542,8 +567,8 @@ In addition, our **Ant Design Pro 2.0.0** version has also been released simulta
- 🐞 Fix the flash style for Drawer. [#11813](https://github.com/ant-design/ant-design/issues/11813)
- 🐞 Fix the border style for compact Input.Group with `prefix` or `suffix`. [#11863](https://github.com/ant-design/ant-design/issues/11863)
- Menu
- 🐞 Fix the gap style between SubMenu and that Menu disappears when hovering over the tap. [#11725](https://github.com/ant-design/ant-design/issues/11725)
- 🐞 Fix the displayed error when ItemGroup wraps the first SubMenu and the Menu is collapsed. [a52370](https://github.com/ant-design/ant-design/commit/a523706625bd695f44401579d980089292089dda) [@ohhoney1](https://github.com/ohhoney1)
- 🐞 Fix the gap style between SubMenu and that Menu disappears when hovering over the tap. [#11725](https://github.com/ant-design/ant-design/issues/11725)
- 🐞 Fix the displayed error when ItemGroup wraps the first SubMenu and the Menu is collapsed. [a52370](https://github.com/ant-design/ant-design/commit/a523706625bd695f44401579d980089292089dda) [@ohhoney1](https://github.com/ohhoney1)
- 🐞 Fix that overlong `description` is cut off for Steps. [#11864](https://github.com/ant-design/ant-design/issues/11864)
- 🐞 Fix that the word maybe break in overlong `title` for Tooltip. [#11722](https://github.com/ant-design/ant-design/issues/11722)
- 🐞 Fix that `custom prop` of TreeNode cannot be accepted for Tree. [#11423](https://github.com/ant-design/ant-design/issues/11423)

View File

@ -15,38 +15,62 @@ timeline: true
---
## 3.12.4
`2019-01-19`
- 🌟 更新《在 creact-react-app 中使用》文档以兼容升级后的 creact-react-app 和 react-scripts-rewired。[#14385](https://github.com/ant-design/ant-design/pull/14385)
- 💄 修复在 postcsswebpack中使用 autoprefixer 9.4.5 会抛出错误 `Replace text-decoration-skip: ink to text-decoration-skip-ink: auto, because spec had been changed` 的问题。[#14312](https://github.com/ant-design/ant-design/pull/14312)
- 💄 修复 InputNumber 在 MenuItem 中样式不正确的问题。[#14373](https://github.com/ant-design/ant-design/pull/14373)
- 💄 修复 Input.Search 使用 `enterButton` 时的样式问题。[#14397](https://github.com/ant-design/ant-design/pull/14397)
- 💄 修复 Slider focus 时的样式错误。[9202509](https://github.com/ant-design/ant-design/commit/92025095032a05b2bc347218b523ffd42f75a607)
- 🐞 修复 `prefixCls` 属性被传递到了 Empty 元素上的问题。[#14404](https://github.com/ant-design/ant-design/pull/14404)
- 🐞 修复 RadioGroup `onChange` 将覆盖 Radio `onChange` 的问题。[#14364](https://github.com/ant-design/ant-design/pull/14364)
## 3.12.3
`2019-01-13`
- 🐞 回滚 [#14157](https://github.com/ant-design/ant-design/pull/14157) 修复 Input `prefix``suffix` 丢失的问题。[#14310](https://github.com/ant-design/ant-design/issues/14310)
- 🐞 修复 Empty 的 `image` 属性的 TypeScript 定义。[#14308](https://github.com/ant-design/ant-design/issues/14308) [@chunlea](https://github.com/chunlea)
## 3.12.2
`2019-01-12`
- 🐞 修复 Anchor.Link 组件不支持 `className` 属性的问题。[#14248](https://github.com/ant-design/ant-design/pull/14248)
- 🐞 修复 Badge 组件浮点数展示错误的问题。[#14195](https://github.com/ant-design/ant-design/pull/14195) [@ztplz](https://github.com/ztplz)
- 🐞 修复 DatePicker 组件在弹层展开时依然会获取焦点的问题。[#14092](https://github.com/ant-design/ant-design/pull/14092) [@Yangzhedi](https://github.com/Yangzhedi)
- Drawer
- 🐞 修复 Drawer 组件未设置 `title` 时显示空白头的问题。[#14264](https://github.com/ant-design/ant-design/pull/14264) [@ztplz](https://github.com/ztplz)
- 🐞 修复 Drawer 组件不支持 `bodyStyle` 属性的问题。[#14294](https://github.com/ant-design/ant-design/pull/14294) [@ztplz](https://github.com/ztplz)
- 🐞 修复 Drawer 组件未设置 `title` 时显示空白头的问题。[#14264](https://github.com/ant-design/ant-design/pull/14264) [@ztplz](https://github.com/ztplz)
- 🐞 修复 Drawer 组件不支持 `bodyStyle` 属性的问题。[#14294](https://github.com/ant-design/ant-design/pull/14294) [@ztplz](https://github.com/ztplz)
- 🐞 修复 Form 组件垂直布局时标签文本无法自动换行的问题。[#14135](https://github.com/ant-design/ant-design/pull/14135) [@ranbena](https://github.com/ranbena)
- 🐞 修复 Modal.confirm 组件在小屏幕下位置错误的问题。[#14279](https://github.com/ant-design/ant-design/issues/14279)
- Radio
- 🐞 修复 Radio 组件在禁选和选中状态下样式不正确的问题。[#14165](https://github.com/ant-design/ant-design/issues/14165)
- 💄 优化 Radio 组件在获取焦点时的样式。[#14186](https://github.com/ant-design/ant-design/issues/14186)
- 🐞 修复 Radio 组件在禁选和选中状态下样式不正确的问题。[#14165](https://github.com/ant-design/ant-design/issues/14165)
- 💄 优化 Radio 组件在获取焦点时的样式。[#14186](https://github.com/ant-design/ant-design/issues/14186)
- 🐞 修复 Select 组件空数据样式缺失的问题。[#14204](https://github.com/ant-design/ant-design/issues/14204)
- 💄 简化 Spin 组件实现以优化运行性能。[#14100](https://github.com/ant-design/ant-design/issues/14100)
- Table
- 🐞 修复 Table 组件表头列的排序 `title` 遮挡 Tooltip 的问题。[#14168](https://github.com/ant-design/ant-design/issues/14168)
- 🐞 修复 Table 组件点击自定义筛选菜单会触发排序的问题。[#14238](https://github.com/ant-design/ant-design/issues/14238)
- 🐞 修复 Table 组件表头列的排序 `title` 遮挡 Tooltip 的问题。[#14168](https://github.com/ant-design/ant-design/issues/14168)
- 🐞 修复 Table 组件点击自定义筛选菜单会触发排序的问题。[#14238](https://github.com/ant-design/ant-design/issues/14238)
- 🐞 修复 Tag 组件从隐藏到可见时会调用 `afterClose` 属性函数的问题。[#14200](https://github.com/ant-design/ant-design/pull/14200) [@tangjinzhou](https://github.com/tangjinzhou)
- 🌟 新增 `@btn-shadow`、`@btn-primary-shadow` 和 `@btn-text-shadow` 样式变量。[#14172](https://github.com/ant-design/ant-design/issues/14172)
- TypeScript
- 🐞 修复 Modal 组件的 TypeScript 类型定义缺少 `forceRender` 属性的问题。[#14160](https://github.com/ant-design/ant-design/issues/14160)
- 🐞 修复 Table 组件的 `TypeScript` 类型定义中 `sortDirections` 属性必选的问题。[#14182](https://github.com/ant-design/ant-design/pull/14182)
- 🐞 修复 Table 组件的 `locale` 属性的 TypeScript 类型定义错误的问题。[#14245](https://github.com/ant-design/ant-design/pull/14245) [@LeezQ](https://github.com/LeezQ)
- 🐞 修复 List.Item 组件的 TypeScript 类型定义不支持原生 div 元素属性的问题。[#14171](https://github.com/ant-design/ant-design/issues/14171)
- 🐞 修复 Modal 组件的 TypeScript 类型定义缺少 `forceRender` 属性的问题。[#14160](https://github.com/ant-design/ant-design/issues/14160)
- 🐞 修复 Table 组件的 `TypeScript` 类型定义中 `sortDirections` 属性必选的问题。[#14182](https://github.com/ant-design/ant-design/pull/14182)
- 🐞 修复 Table 组件的 `locale` 属性的 TypeScript 类型定义错误的问题。[#14245](https://github.com/ant-design/ant-design/pull/14245) [@LeezQ](https://github.com/LeezQ)
- 🐞 修复 List.Item 组件的 TypeScript 类型定义不支持原生 div 元素属性的问题。[#14171](https://github.com/ant-design/ant-design/issues/14171)
## 3.12.1
`2019-01-06`
- 🐞 修复引用 svg 导致的构建错误。
## 3.12.0
`2019-01-06`
- 🎉 新的组件 [Empty](https://ant.design/components/empty/),同时优化了各个组件的空数据状态样式![13651](https://github.com/ant-design/ant-design/pull/13651)
- 🎉 添加新的国际化资源北印度语kn_IN和坎那达语kn_IN。[#13776](https://github.com/ant-design/ant-design/pull/13759) [@gurungrahul2](https://github.com/aashutoshrathi) [#13776](https://github.com/ant-design/ant-design/pull/13776) [@gurungrahul2](https://github.com/gurungrahul2)
- 🌟 新增 Icon `eye-invisible`。[b8630b3](https://github.com/ant-design/ant-design/commit/b8630b34556e58af31f51fb42d1299725ddd8219)
@ -84,7 +108,7 @@ timeline: true
- 🐞 修复 WeekPicker 不支持 `dateRender` 的问题。[#13957](https://github.com/ant-design/ant-design/issues/13957)
- 🐞 修复禁用按钮在 DatePicker 面板中的样式问题。[#14098](https://github.com/ant-design/ant-design/pull/14098)
- 🌟 在所有模式中支持 `renderExtraFooter` 属性。[#13813](https://github.com/ant-design/ant-design/pull/13813) [@elfman](https://github.com/elfman)
- 🐞 修复月份选择器在开始年份和结束年份相等时的显示问题。 [#14049](https://github.com/ant-design/ant-design/pull/14049) [@meihuanyu](https://github.com/meihuanyu)
- 🐞 修复月份选择器在开始年份和结束年份相等时的显示问题。[#14049](https://github.com/ant-design/ant-design/pull/14049) [@meihuanyu](https://github.com/meihuanyu)
- TimePicker
- 🌟 TimePicker 添加新的属性 `popupStyle``onAmPmChange`。[833c181](https://github.com/ant-design/ant-design/commit/833c18192247f265b4004afa11a054846c7ba662)
- 🐞 修复 TimePicker 在跟 Input.Group 一起使用时图标会消失的问题。[#13797](https://github.com/ant-design/ant-design/pull/13797) [@mraiguo](https://github.com/ant-design/ant-design/pull/13797)
@ -99,7 +123,7 @@ timeline: true
- 🐞 修复 Popover 上方的 border 在某些 IE9 下不显示的问题。[#14064](https://github.com/ant-design/ant-design/issues/14064) [@gyh9457](https://github.com/gyh9457)
- 🐞 修复 Radio 组件在 Chrome 下的样式问题。[#3699](https://github.com/ant-design/ant-design/issues/3699)
- 🐞 修复 Steps 组件在 IE9 下的样式问题。[#14001](https://github.com/ant-design/ant-design/issues/14001)
- 🐞 修复嵌套的 TimeLine 最后一条线丢失的问题。 [#14108](https://github.com/ant-design/ant-design/pull/14110)
- 🐞 修复嵌套的 TimeLine 最后一条线丢失的问题。[#14108](https://github.com/ant-design/ant-design/pull/14110)
- 🐞 修复 Spin 组件初始设置 `delay` 属性后不显示的问题。[#14100](https://github.com/ant-design/ant-design/issues/14100)
- Badge
- 🐞 修复当 `count` 是一个 ReactNode 时动画跳动的问题。[#13800](https://github.com/ant-design/ant-design/issues/13800)
@ -160,7 +184,7 @@ timeline: true
- TypeScript
- ⚡️ 完善 Table 的 `ColumnProps` 定义,增强对 `dataIndex` 的校验。[#13605](https://github.com/ant-design/ant-design/pull/13605) [@bondBo](https://github.com/bondBo)
- ⚡️ 完善 Table 的 `TableRowSelection.onChange` 参数泛型定义。[#13761](https://github.com/ant-design/ant-design/issues/13761) [@hahabazinga](https://github.com/hahabazinga)
- 🐞 修复 LocaleProvider 的 `children` 类型。 [#12974](https://github.com/ant-design/ant-design/issues/12974)
- 🐞 修复 LocaleProvider 的 `children` 类型。[#12974](https://github.com/ant-design/ant-design/issues/12974)
- 🐞 修复 RangePicker 的 `onOk` 的参数类型。[#13650](https://github.com/ant-design/ant-design/pull/13650) [@iugo](https://github.com/iugo)
- 🐞 修正 Comment `author` 属性的类型为 ReactNode。[#13670](https://github.com/ant-design/ant-design/pull/13670) [@reichjustin](https://github.com/reichjustin)
- 🐞 修复 Select `dropdownProps` 的参数定义。[#13617](https://github.com/ant-design/ant-design/pull/13617) [@SylvanasGone](https://github.com/SylvanasGone)
@ -226,7 +250,7 @@ timeline: true
- Select 组件升级 `rc-select``8.6.0`
- 🌟 增加 `removeIcon`、`clearIcon`、`menuItemSelectedIcon` 属性,用于自定义删除、清空、选中的图标。[#12958](https://github.com/ant-design/ant-design/pull/12958) [@kimochg](https://github.com/kimochg)
- 🌟 增加 `dropdownRender` 属性, 用于自定义下拉框内容。[#10831](https://github.com/ant-design/ant-design/issues/10831)
- 🌟 增加 `loading` 属性, 用于展示加载中状态。 [#11225](https://github.com/ant-design/ant-design/issues/11225)
- 🌟 增加 `loading` 属性, 用于展示加载中状态。[#11225](https://github.com/ant-design/ant-design/issues/11225)
- 💄 Menu.Item 组件增加 `title` 属性,用于在收缩时展示的悬浮标题。[#12952](https://github.com/ant-design/ant-design/pull/12952)
- Cascader 升级 `rc-calendar``9.8.0`
- 🌟 支持多种时间格式。[#437](https://github.com/react-component/calendar/pull/437) [@onlyann](https://github.com/onlyann)
@ -264,7 +288,7 @@ timeline: true
`2018-11-11`
- 🐞 修复一个 Button `line-height` 的笔误。 [74aeace](https://github.com/ant-design/ant-design/commit/74aeaceaa88034b8cb669efb8aa3b6de41ff6f9d)
- 🐞 修复一个 Button `line-height` 的笔误。[74aeace](https://github.com/ant-design/ant-design/commit/74aeaceaa88034b8cb669efb8aa3b6de41ff6f9d)
## 3.10.6
@ -276,7 +300,7 @@ timeline: true
`2018-11-09`
- 🎉 发布 [Landing 模板集](https://landing.ant.design)
- 🎉 发布 [首页模板集](https://landing.ant.design)
- 📖 发布 Ant Design [新版 Sketch 模版文件](https://github.com/ant-design/ant-design/releases/download/resource/Ant.Design.Components.Beta.3.10.5.sketch)。
- Button
- 🐞 修复在小尺寸的 `Button.Group` 中没有垂直对齐的问题。[#12972](https://github.com/ant-design/ant-design/issues/12972)
@ -519,7 +543,7 @@ timeline: true
- 🐞 修复在 Card 的 `headStyle` 中设置 fontSize 不生效的问题。[#11995](https://github.com/ant-design/ant-design/issues/11995)
- 🐞 修复了 Button 组件波浪动画混淆的问题。[#11985](https://github.com/ant-design/ant-design/issues/11985)
- 🐞 修复了 Modal.confirm 设置 `centered` 属性无效的问题。[#11969](https://github.com/ant-design/ant-design/issues/11969)
- 🐞 修复了在 Input.Group 的 `compact` 模式下设置第二个 Input 的前后缀会造成右边框消失的问题。 [#11965](https://github.com/ant-design/ant-design/pull/11965)
- 🐞 修复了在 Input.Group 的 `compact` 模式下设置第二个 Input 的前后缀会造成右边框消失的问题。[#11965](https://github.com/ant-design/ant-design/pull/11965)
- 🐞 修复 Upload 组件上传图片较多时可能会造成图片错位的问题。[#11183](https://github.com/ant-design/ant-design/issues/11183)
- 🐞 修复 MonthPicker `renderExtraFooter` 失效的问题。[#8184](https://github.com/ant-design/ant-design/issues/8184)
@ -542,8 +566,8 @@ timeline: true
- 🐞 修复 Drawer 组件在多层状态下切换出现的背景闪烁的问题。[#11813](https://github.com/ant-design/ant-design/issues/11813)
- 🐞 修复带有前缀或后缀的 Input.Group 组件在紧凑模式下右边框宽度过宽的问题。[#11863](https://github.com/ant-design/ant-design/issues/11863)
- Menu
- 🐞 修复子菜单之间存在间隙导致鼠标 hover 时菜单消失的问题。[#11725](https://github.com/ant-design/ant-design/issues/11725)
- 🐞 修复当分组菜单包含了第一个菜单项,并且在菜单收起时出现错误的问题。[a52370](https://github.com/ant-design/ant-design/commit/a523706625bd695f44401579d980089292089dda) [@ohhoney1](https://github.com/ohhoney1)
- 🐞 修复子菜单之间存在间隙导致鼠标 hover 时菜单消失的问题。[#11725](https://github.com/ant-design/ant-design/issues/11725)
- 🐞 修复当分组菜单包含了第一个菜单项,并且在菜单收起时出现错误的问题。[a52370](https://github.com/ant-design/ant-design/commit/a523706625bd695f44401579d980089292089dda) [@ohhoney1](https://github.com/ohhoney1)
- 🐞 修复 Steps 组件中过长的 `description` 会被截断,无法完整展示的问题。[#11864](https://github.com/ant-design/ant-design/issues/11864)
- 🐞 修复 Tooltip 组件在 `title` 过长时会将单词拆分到两行的问题。[#11722](https://github.com/ant-design/ant-design/issues/11722)
- 🐞 修复 Tree 组件中的树节点无法接收自定义属性的问题。[#11423](https://github.com/ant-design/ant-design/issues/11423)
@ -558,7 +582,7 @@ timeline: true
- 🐞 修复 Badge 组件在子元素为 `display:block` 时的样式问题。[#84119d8](https://github.com/ant-design/ant-design/commit/84119d8959d55edf535a9cac5ff532e61b6ee698)
- Drawer
- 🐞 修复 Drawer 组件不兼容 IE10 和 IE9 的问题。[#11583](https://github.com/ant-design/ant-design/issues/11583)
- 🐞 修复 Drawer 组件在移动设备上无法垂直滚动的问题。 [#11443](https://github.com/ant-design/ant-design/issues/11443)
- 🐞 修复 Drawer 组件在移动设备上无法垂直滚动的问题。[#11443](https://github.com/ant-design/ant-design/issues/11443)
- TypeScript
- 🐞 修复 TreeNode 组件缺少的 `selectable` 属性定义。[#11604](https://github.com/ant-design/ant-design/issues/11604) [@apieceofbart](https://github.com/apieceofbart)
- 🐞 修复 Input 组件缺失 `autosize` 属性的类型错误。[#11697](https://github.com/ant-design/ant-design/issues/11697)
@ -659,7 +683,7 @@ timeline: true
- 🐞 修复 Drawer 内无法显示弹层组件的问题。[#11304](https://github.com/ant-design/ant-design/issues/11304)
- 🐞 带页签的卡片页签支持 disabled 属性。[#11212](https://github.com/ant-design/ant-design/issues/11212)
- 🐞 修复锚点链接组件 href 改变不更新的问题。 [#11287](https://github.com/ant-design/ant-design/pull/11287/files) [@tangjinzhou](https://github.com/tangjinzhou)
- 🐞 修复锚点链接组件 href 改变不更新的问题。[#11287](https://github.com/ant-design/ant-design/pull/11287/files) [@tangjinzhou](https://github.com/tangjinzhou)
- 🐞 修复 Menu 样式细节问题。[#11299](https://github.com/ant-design/ant-design/issues/11299)
- 🐞 修复 Drawer 组件设置 `destroyOnClose` 后关闭动画消失。[#11307](https://github.com/ant-design/ant-design/issues/11307)
- 🐞 修复 DirectoryTree 在 `expandedKeys` 属性可控时点击无法展开的问题。[#11366](https://github.com/ant-design/ant-design/issues/11366)
@ -710,8 +734,8 @@ timeline: true
- 🌟 新增 `loadedKeys` 属性,用于设置已经加载的节点,需要配合 `loadData` 使用。[#10666](https://github.com/ant-design/ant-design/issues/10666)
- 🌟 新增 `onLoad` 属性,作为节点加载完毕时的回调函数。[c488aca](https://github.com/ant-design/ant-design/commit/c488aca05e11d942d77c1b6bff45d12bbb1a2bd6)
- 🌟 增加 `okButtonDisabled` and `cancelButtonDisabled` 属性用于禁用确定和取消按钮。[#10955](https://github.com/ant-design/ant-design/pull/10955)
- 🌟 Cascader 新增 fieldNames 并废弃拼写错误的 filedNames。 [#10896](https://github.com/ant-design/ant-design/issues/10896)
- 🐞 修复时间轴不能与`Tooltip`一起使用的问题。 [0e3b67e](https://github.com/ant-design/ant-design/commit/0e3b67e9999d867cc304f3be61a8a042a2ab92ee)
- 🌟 Cascader 新增 fieldNames 并废弃拼写错误的 filedNames。[#10896](https://github.com/ant-design/ant-design/issues/10896)
- 🐞 修复时间轴不能与`Tooltip`一起使用的问题。[0e3b67e](https://github.com/ant-design/ant-design/commit/0e3b67e9999d867cc304f3be61a8a042a2ab92ee)
- 🐞 修复当 Avatar 自定义大小时,圆角不改变的问题。[e1e6523](https://github.com/ant-design/ant-design/commit/e1e6523452286ba56f20b73abad762a58ea7d7bc)
## 3.6.6
@ -786,15 +810,15 @@ timeline: true
`2018-06-02`
* 🌟 `Form` 表单错误信息展示支持传入 ReactNode。 [#10136](https://github.com/ant-design/ant-design/issues/10136) [@lovekonakona](https://github.com/lovekonakona)
* 🌟 `List` 组件支持指定分页器的位置。 [#10581](https://github.com/ant-design/ant-design/pull/10581) [@zheeeng](https://github.com/zheeeng)
* 🌟 `Layout.Sider` 支持 dark/light 主题定制。 [#10142](https://github.com/ant-design/ant-design/issues/10142) [@pd4d10](https://github.com/pd4d10)
* 🌟 支持 Ant Design 站点的离线模式。 [#10625](https://github.com/ant-design/ant-design/issues/10625)
* 🌟 `Transfer` 新增 `style` 以及 `operationStyle` 属性配置样式。 [@eduludi](https://github.com/eduludi)
* 🌟 `Message` 增加 promise 化的回调接口。 [#10421](https://github.com/ant-design/ant-design/issues/10421) [@zhujinxuan](https://github.com/zhujinxuan)
* 🐞 修复编译时 typescript v2.9.1兼容性问题。 [#10729](https://github.com/ant-design/ant-design/issues/10729) [@karol-majewski](https://github.com/karol-majewski)
* 🐞 修复 `Menu` 嵌套超过两层时选中最里层后对应最外层没有亮起问题。 [#8666](https://github.com/ant-design/ant-design/issues/8666) [@stonehank](https://github.com/stonehank)
* 🐞 修复 `Affix` 组件 offsetBottom 无效问题。 [#10674](https://github.com/ant-design/ant-design/issues/10674)
* 🌟 `Form` 表单错误信息展示支持传入 ReactNode。[#10136](https://github.com/ant-design/ant-design/issues/10136) [@lovekonakona](https://github.com/lovekonakona)
* 🌟 `List` 组件支持指定分页器的位置。[#10581](https://github.com/ant-design/ant-design/pull/10581) [@zheeeng](https://github.com/zheeeng)
* 🌟 `Layout.Sider` 支持 dark/light 主题定制。[#10142](https://github.com/ant-design/ant-design/issues/10142) [@pd4d10](https://github.com/pd4d10)
* 🌟 支持 Ant Design 站点的离线模式。[#10625](https://github.com/ant-design/ant-design/issues/10625)
* 🌟 `Transfer` 新增 `style` 以及 `operationStyle` 属性配置样式。[@eduludi](https://github.com/eduludi)
* 🌟 `Message` 增加 promise 化的回调接口。[#10421](https://github.com/ant-design/ant-design/issues/10421) [@zhujinxuan](https://github.com/zhujinxuan)
* 🐞 修复编译时 typescript v2.9.1兼容性问题。[#10729](https://github.com/ant-design/ant-design/issues/10729) [@karol-majewski](https://github.com/karol-majewski)
* 🐞 修复 `Menu` 嵌套超过两层时选中最里层后对应最外层没有亮起问题。[#8666](https://github.com/ant-design/ant-design/issues/8666) [@stonehank](https://github.com/stonehank)
* 🐞 修复 `Affix` 组件 offsetBottom 无效问题。[#10674](https://github.com/ant-design/ant-design/issues/10674)
## 3.5.4
@ -831,7 +855,7 @@ timeline: true
- 🐞 修复 `Cascader` `displayRender` 里的链接无法点击的问题。[#10433](https://github.com/ant-design/ant-design/issues/10433)
- 🐞 修复 `Button` ref 不兼容问题。[#10405](https://github.com/ant-design/ant-design/issues/10405)
- 🐞 修复 `Form` 表单项校验位置高度时出现抖动问题。[#10445](https://github.com/ant-design/ant-design/issues/10445)
- 🌟 设置 `Layout` 宽度时,允许使用任何的 CSS 单位。 [#10479](https://github.com/ant-design/ant-design/pull/10479)
- 🌟 设置 `Layout` 宽度时,允许使用任何的 CSS 单位。[#10479](https://github.com/ant-design/ant-design/pull/10479)
## 3.5.1
@ -857,7 +881,7 @@ timeline: true
- 🌟 添加 `successPercent``Progress[format]` 的参数。[#10096](https://github.com/ant-design/ant-design/issues/10096)
- 🌟 更新 `rc-notification` 到 3.1.0 来支持组件 `Notification``maxCount` 属性。[#10161](https://github.com/ant-design/ant-design/pull/10161) [@jzhangs](https://github.com/jzhangs)
- 🌟 更新 `rc-cascader` 到 1.13.0 来支持组件 `Cascader``filedNames` 属性。[react-component/cascader#23](https://github.com/react-component/cascader/pull/23) [@405go](https://github.com/405go)
- 🌟 组件 `Notification` 支持通过 key 更新通知属性。 [react-component/notification#40](https://github.com/react-component/notification/pull/40) [@yevhen-hryhorevskyi](https://github.com/yevhen-hryhorevskyi)
- 🌟 组件 `Notification` 支持通过 key 更新通知属性。[react-component/notification#40](https://github.com/react-component/notification/pull/40) [@yevhen-hryhorevskyi](https://github.com/yevhen-hryhorevskyi)
- 🌟 组件 `List` 支持内置的翻页功能。[#10135](https://github.com/ant-design/ant-design/pull/10135)
- Table
- 🌟 新增 `sortOrder` 参数传递给列配置中的 `sorter` 方法。[#10306](https://github.com/ant-design/ant-design/pull/10306) [@kumarashwin](https://github.com/kumarashwin)
@ -886,7 +910,7 @@ timeline: true
- 🐞 修复 `Notification` 鼠标 hover 是图标的颜色问题。[#10272](https://github.com/ant-design/ant-design/issues/10272)
- 🐞 修复 `Upload` 组件属性 `lastModifiedDate` 的拼写错误。[#10315](https://github.com/ant-design/ant-design/pull/10315) [@danielg2002](https://github.com/danielg2002)
- 🐞 修复 `Button` 的属性类型,使用 `React.HTMLProps`。[#10229](https://github.com/ant-design/ant-design/pull/10229) [@whtsky](https://github.com/whtsky)
- 🐞 修复 less 命名约定不一致的问题。 [#10275](https://github.com/ant-design/ant-design/issues/10275)
- 🐞 修复 less 命名约定不一致的问题。[#10275](https://github.com/ant-design/ant-design/issues/10275)
## 3.4.5
@ -954,7 +978,7 @@ timeline: true
- 🌟 Anchor 新增 `getContainer` 用于指定内容滚动的容器。
- 🌟 Table 新增 less 变量 `@table-expanded-row-bg`。[#9789](https://github.com/ant-design/ant-design/pull/9789)
- 🐞 修复一处 less 语法错误。[#9832](https://github.com/ant-design/ant-design/pull/9832) [@jojoLockLock](https://github.com/jojoLockLock)
- 🐞 修复 LocaleProvider 中 moment.locale 调用报错的问题。 [#9853](https://github.com/ant-design/ant-design/pull/9853)
- 🐞 修复 LocaleProvider 中 moment.locale 调用报错的问题。[#9853](https://github.com/ant-design/ant-design/pull/9853)
- 🐞 修复 WeekPicker 的 style 属性不生效的问题。[#9848](https://github.com/ant-design/ant-design/issues/9848)
- 🐞 修复 Layout.Sider 的 TypeScript 定义。[#9885](https://github.com/ant-design/ant-design/pull/9885) [@zachguo](https://github.com/zachguo)
- 💄 优化了 Modal 中超长内容的显示。[#9592](https://github.com/ant-design/ant-design/pull/9592)
@ -970,11 +994,11 @@ timeline: true
`2018-03-24`
- 🐞 `Carousel`: 升级 `react-slick` 版本以修复宽度计算错误。 [#3659](https://github.com/ant-design/ant-design/issues/3659)
- 💄 `Rate`: 调整 `disabled` 样式。 [#9747](https://github.com/ant-design/ant-design/issues/9747)
- 💄 `Modal`: 调整 `confirm-modal` 样式以修复 content 内使用栅格会错位的问题。 [#9374](https://github.com/ant-design/ant-design/issues/9374)
- 🐞 `Carousel`: 升级 `react-slick` 版本以修复宽度计算错误。[#3659](https://github.com/ant-design/ant-design/issues/3659)
- 💄 `Rate`: 调整 `disabled` 样式。[#9747](https://github.com/ant-design/ant-design/issues/9747)
- 💄 `Modal`: 调整 `confirm-modal` 样式以修复 content 内使用栅格会错位的问题。[#9374](https://github.com/ant-design/ant-design/issues/9374)
- 💄 `Menu`: 调整样式以修复鼠标事件范围。[#9666](https://github.com/ant-design/ant-design/pull/9666) [@dgeibi](https://github.com/dgeibi)
- 🐞 `Upload`: 修复 `beforeUpload``file` 类型错误。 [#9775](https://github.com/ant-design/ant-design/issues/9775)
- 🐞 `Upload`: 修复 `beforeUpload``file` 类型错误。[#9775](https://github.com/ant-design/ant-design/issues/9775)
- 🐞 `Button`: 修复文本改变时,空格插入没有重新计算 [4502ad8](https://github.com/ant-design/ant-design/commit/4502ad8376e536c450fa4f27d2a5855be5a153e7)
## 3.3.1
@ -982,12 +1006,12 @@ timeline: true
`2018-03-18`
- 💄 调整 danger Button 的 `focus` 样式。
- 🐞 修复 enterButton 的值为 button 元素时显示错误的问题。 [#9639](https://github.com/ant-design/ant-design/issues/9639)
- 🐞 修复 Table 中的 `column.title` 的缺少 key 的问题。 [#9658](https://github.com/ant-design/ant-design/issues/9658) [@terence55](https://github.com/terence55)
- 🐞 修复 enterButton 的值为 button 元素时显示错误的问题。[#9639](https://github.com/ant-design/ant-design/issues/9639)
- 🐞 修复 Table 中的 `column.title` 的缺少 key 的问题。[#9658](https://github.com/ant-design/ant-design/issues/9658) [@terence55](https://github.com/terence55)
- 🐞 修复 `scroll: { x: true }``.ant-table-scroll table`宽度为 `auto`的情况下不工作的问题。[#9704](https://github.com/ant-design/ant-design/pull/9704)
- 🐞 修复表单校验文字消失的时候输入框会抖一下的问题。 [#8831](https://github.com/ant-design/ant-design/issues/8831)
- 🐞 修复表单校验文字消失的时候输入框会抖一下的问题。[#8831](https://github.com/ant-design/ant-design/issues/8831)
- 🐞 修复 `TimePicker` 里的 isMoment 调用在 parcel 里会报错的问题。[85c78e4](https://github.com/ant-design/ant-design/commit/85c78e49a91737c2841dc42621db21ca248b62b4)
- 💄 调整 Table 的圆角样式。 [#9674](https://github.com/ant-design/ant-design/pull/9674)
- 💄 调整 Table 的圆角样式。[#9674](https://github.com/ant-design/ant-design/pull/9674)
## 3.3.0
@ -1020,25 +1044,25 @@ timeline: true
`2018-03-02`
- 🐞 修复组件 `Select` 中的 `onPopupScroll` 属性的 ts 定义。 [#9475](https://github.com/ant-design/ant-design/pull/9475) [@twobin](https://github.com/twobin)
- 🐞 修复 `Table` 过滤条件下拉选择框的问题。 [#9209](https://github.com/ant-design/ant-design/issues/9209)
- 🐞 修复 `Timeline` 自定义头部样式在 Chrome 下的显示问题。 [#9429](https://github.com/ant-design/ant-design/pull/9429) [@vthinkxie](https://github.com/vthinkxie)
- 🐞 修复 `Select` 下拉窗口的边框显示问题。 [82092c1](https://github.com/ant-design/ant-design/commit/82092c154ac1fa7ff2f89e1adbdf0aaf22e3ff53)
- 🐞 修复对 less 3 的兼容性问题。 [#7850](https://github.com/ant-design/ant-design/issues/7850)
- 🐞 修复 `DatePicker.WeekPicker` 年份问题。 [#9463](https://github.com/ant-design/ant-design/issues/9463)
- 🐞 修复 `Button.Group` 在 Chrome 下的定位对齐问题。 [#9457](https://github.com/ant-design/ant-design/issues/9457)
- 🐞 修复组件 `Select` 中的 `onPopupScroll` 属性的 ts 定义。[#9475](https://github.com/ant-design/ant-design/pull/9475) [@twobin](https://github.com/twobin)
- 🐞 修复 `Table` 过滤条件下拉选择框的问题。[#9209](https://github.com/ant-design/ant-design/issues/9209)
- 🐞 修复 `Timeline` 自定义头部样式在 Chrome 下的显示问题。[#9429](https://github.com/ant-design/ant-design/pull/9429) [@vthinkxie](https://github.com/vthinkxie)
- 🐞 修复 `Select` 下拉窗口的边框显示问题。[82092c1](https://github.com/ant-design/ant-design/commit/82092c154ac1fa7ff2f89e1adbdf0aaf22e3ff53)
- 🐞 修复对 less 3 的兼容性问题。[#7850](https://github.com/ant-design/ant-design/issues/7850)
- 🐞 修复 `DatePicker.WeekPicker` 年份问题。[#9463](https://github.com/ant-design/ant-design/issues/9463)
- 🐞 修复 `Button.Group` 在 Chrome 下的定位对齐问题。[#9457](https://github.com/ant-design/ant-design/issues/9457)
## 3.2.2
`2018-02-24`
- 🌟 添加 `Pagination` 字体变量。 [#9351](https://github.com/ant-design/ant-design/issues/9351)
- 🌟 添加 `Badge` 字重变量。 [#9352](https://github.com/ant-design/ant-design/issues/9352)
- 🐞 修复 `Table` 当自定义 `loading.indicator`不显示emptyText。 [#9355](https://github.com/ant-design/ant-design/issues/9355)
- 🌟 添加 `Pagination` 字体变量。[#9351](https://github.com/ant-design/ant-design/issues/9351)
- 🌟 添加 `Badge` 字重变量。[#9352](https://github.com/ant-design/ant-design/issues/9352)
- 🐞 修复 `Table` 当自定义 `loading.indicator`不显示emptyText。[#9355](https://github.com/ant-design/ant-design/issues/9355)
- 🐞 修复 `Form.create` 。[#9331](https://github.com/ant-design/ant-design/issues/9331)
- 🐞 回滚 `Table``column.dataIndex` 的 TypeScript 定义。 [#9393](https://github.com/ant-design/ant-design/issues/9393)
- 🐞 修复 `Layout` 中 sider 高度不足时,最后一个菜单无法显示。 [#9398](https://github.com/ant-design/ant-design/issues/9398) [@MJ111](https://github.com/MJ111)
- 🐞 修复 `Badge` dot 模式问题。 [#9359](https://github.com/ant-design/ant-design/issues/9359) [@khayalan-mathew](https://github.com/khayalan-mathew)
- 🐞 回滚 `Table``column.dataIndex` 的 TypeScript 定义。[#9393](https://github.com/ant-design/ant-design/issues/9393)
- 🐞 修复 `Layout` 中 sider 高度不足时,最后一个菜单无法显示。[#9398](https://github.com/ant-design/ant-design/issues/9398) [@MJ111](https://github.com/MJ111)
- 🐞 修复 `Badge` dot 模式问题。[#9359](https://github.com/ant-design/ant-design/issues/9359) [@khayalan-mathew](https://github.com/khayalan-mathew)
## 3.2.1
@ -1149,7 +1173,7 @@ timeline: true
- 🐞 修复 Table 和 List 中由于 Spin 导致的滚动条。[#8799](https://github.com/ant-design/ant-design/issues/8799)
- 🐞 修复不能传方法给 Table[emptyText] 的问题。[#8871](https://github.com/ant-design/ant-design/issues/8871)
- 🐞 修复 Dropdown[transitionName] 不生效的问题。
- 🐞 修复 Input 中输入数字时字体会发生变化的问题。 [#8636](https://github.com/ant-design/ant-design/issues/8636)
- 🐞 修复 Input 中输入数字时字体会发生变化的问题。[#8636](https://github.com/ant-design/ant-design/issues/8636)
- 🐞 修复 import 多个 locale 文件后日期文本显示错误的问题。[#8785](https://github.com/ant-design/ant-design/pull/8785)
- 🐞 修复 dist/antd-with-locales.js 中的 locale 会多一个 default 字段的问题。[#8881](https://github.com/ant-design/ant-design/issues/8881)
- 🐞 修复 TypeScript 定义 [4cc29bc](https://github.com/ant-design/ant-design/commit/4cc29bc11cf7c019c63a25693adff3dbb58b41c3) [693e734](https://github.com/ant-design/ant-design/commit/693e734a82b5e1faf25b025127afca67e75f9c88) [67e956d](https://github.com/ant-design/ant-design/commit/67e956dddd040f63b2a59b8b619123bbb0065780) [ecd4177](https://github.com/ant-design/ant-design/commit/ecd4177638da1eac3a3750fe5ad68b9309865542) [33119ec](https://github.com/ant-design/ant-design/commit/33119ec535e7b819541d4753464871988b37dd6f) [88e0c9b](https://github.com/ant-design/ant-design/commit/88e0c9b436f196def62e737ea72e105aba4b5d4e)
@ -1342,12 +1366,12 @@ timeline: true
- 🌟 Tabs 新增 `size="large"`
- 🌟 Row 的 `gutter` 属性新增响应式断点的支持,可以使用诸如 `gutter={{ sm: 16, lg: 32 }}` 的设置。
- 🌟 Spin 新增 `indicator` 属性,用于设置自定义的加载指示符。 [#7977](https://github.com/ant-design/ant-design/pull/7977) [@kossel](https://github.com/ant-design/ant-design/pull/7977)
- 🌟 Spin 新增 `indicator` 属性,用于设置自定义的加载指示符。[#7977](https://github.com/ant-design/ant-design/pull/7977) [@kossel](https://github.com/ant-design/ant-design/pull/7977)
- 🌟 Input.Search 新增 `enterButton` 用于设置自定义的搜索图标。[#7596](https://github.com/ant-design/ant-design/issues/7596)
- 🌟 Mention 新增 `placement`,用于设置下拉框的弹出方向。
- 🌟 Carousel 新增 `next()`、`prev()`、`goTo(slideNumber)` 方法,用于控制面板展示。
- 🌟 Button 新增链接支持,当提供 `href` 时会自动渲染为 `<a>`。[#8343](https://github.com/ant-design/ant-design/pull/8343)
- 🌟 Steps 进行了重构,首次渲染的时候不会再闪烁。 [#6010](https://github.com/ant-design/ant-design/issues/6010)
- 🌟 Steps 进行了重构,首次渲染的时候不会再闪烁。[#6010](https://github.com/ant-design/ant-design/issues/6010)
- 🌟 Switch 新增 `loading` 属性,用于表现加载中的状态。
- Menu
- 🌟 我们使用了 [rc-trigger](https://github.com/react-component/trigger) 重构了菜单以支持延迟加载和窗口边缘浮层自适应方向。

View File

@ -1,4 +1,4 @@
const isNumeric = <T extends number>(value: any): value is T => {
const isNumeric = (value: any): boolean => {
return !isNaN(parseFloat(value)) && isFinite(value);
};

View File

@ -1,6 +1,6 @@
import warning from 'warning';
const warned: { [msg: string]: boolean } = {};
const warned: Record<string, boolean> = {};
export default (valid: boolean, message: string): void => {
if (!valid && !warned[message]) {
warning(false, message);

View File

@ -43,7 +43,6 @@ export default class Wave extends React.Component<{ insertExtraNode?: boolean }>
const extraNode = this.extraNode;
extraNode.className = 'ant-click-animating-node';
const attributeName = this.getAttributeName();
node.removeAttribute(attributeName);
node.setAttribute(attributeName, 'true');
// Not white or transparnt or grey
styleForPesudo = styleForPesudo || document.createElement('style');
@ -61,7 +60,7 @@ export default class Wave extends React.Component<{ insertExtraNode?: boolean }>
}
extraNode.style.borderColor = waveColor;
styleForPesudo.innerHTML = `[ant-click-animating-without-extra-node]:after { border-color: ${waveColor}; }`;
styleForPesudo.innerHTML = `[ant-click-animating-without-extra-node="true"]:after { border-color: ${waveColor}; }`;
if (!document.body.contains(styleForPesudo)) {
document.body.appendChild(styleForPesudo);
}
@ -122,7 +121,7 @@ export default class Wave extends React.Component<{ insertExtraNode?: boolean }>
}
const { insertExtraNode } = this.props;
const attributeName = this.getAttributeName();
node.removeAttribute(attributeName);
node.setAttribute(attributeName, 'false'); // edge has bug on `removeAttribute` #14466
this.removeExtraStyleNode();
if (insertExtraNode && this.extraNode && node.contains(this.extraNode)) {
node.removeChild(this.extraNode);

View File

@ -15498,9 +15498,6 @@ exports[`ConfigProvider components Transfer configProvider 1`] = `
<div
class="config-transfer-list-body"
>
<ul
class="config-transfer-list-content"
/>
<div
class="config-transfer-list-body-not-found"
>
@ -15611,9 +15608,6 @@ exports[`ConfigProvider components Transfer configProvider 1`] = `
<div
class="config-transfer-list-body"
>
<ul
class="config-transfer-list-content"
/>
<div
class="config-transfer-list-body-not-found"
>
@ -15679,9 +15673,6 @@ exports[`ConfigProvider components Transfer normal 1`] = `
<div
class="ant-transfer-list-body"
>
<ul
class="ant-transfer-list-content"
/>
<div
class="ant-transfer-list-body-not-found"
>
@ -15792,9 +15783,6 @@ exports[`ConfigProvider components Transfer normal 1`] = `
<div
class="ant-transfer-list-body"
>
<ul
class="ant-transfer-list-content"
/>
<div
class="ant-transfer-list-body-not-found"
>
@ -15860,9 +15848,6 @@ exports[`ConfigProvider components Transfer prefixCls 1`] = `
<div
class="prefix-Transfer-list-body"
>
<ul
class="prefix-Transfer-list-content"
/>
<div
class="prefix-Transfer-list-body-not-found"
>
@ -15973,9 +15958,6 @@ exports[`ConfigProvider components Transfer prefixCls 1`] = `
<div
class="prefix-Transfer-list-body"
>
<ul
class="prefix-Transfer-list-content"
/>
<div
class="prefix-Transfer-list-body-not-found"
>

View File

@ -2,7 +2,7 @@ import * as React from 'react';
import * as PropTypes from 'prop-types';
import RcDrawer from 'rc-drawer';
import createReactContext, { Context } from 'create-react-context';
import warning from 'warning';
import warning from '../_util/warning';
import classNames from 'classnames';
import Icon from '../icon';
import { withConfigConsumer, ConfigConsumerProps } from '../config-provider';

View File

@ -209,9 +209,6 @@ exports[`renders ./components/empty/demo/config-provider.md correctly 1`] = `
<div
class="ant-transfer-list-body"
>
<ul
class="ant-transfer-list-content"
/>
<div
class="ant-transfer-list-body-not-found"
>
@ -322,9 +319,6 @@ exports[`renders ./components/empty/demo/config-provider.md correctly 1`] = `
<div
class="ant-transfer-list-body"
>
<ul
class="ant-transfer-list-content"
/>
<div
class="ant-transfer-list-body-not-found"
>

View File

@ -11,7 +11,7 @@ export interface EmptyProps {
prefixCls?: string;
className?: string;
style?: React.CSSProperties;
image?: string;
image?: React.ReactNode;
description?: React.ReactNode;
children?: React.ReactNode;
}
@ -19,8 +19,15 @@ export interface EmptyProps {
const Empty: React.SFC<EmptyProps> = (props: EmptyProps) => (
<ConfigConsumer>
{({ getPrefixCls }: ConfigConsumerProps) => {
const { className, image, description, children, ...restProps } = props;
const prefixCls = getPrefixCls('empty', props.prefixCls);
const {
className,
prefixCls: customizePrefixCls,
image,
description,
children,
...restProps
} = props;
const prefixCls = getPrefixCls('empty', customizePrefixCls);
return (
<LocaleReceiver componentName="Empty">

View File

@ -43,7 +43,6 @@
width: 12px;
height: 12px;
transition: all 0.1s linear;
.iconfont-size-under-12px(7px);
right: 4px;
color: @text-color-secondary;
}
@ -109,6 +108,18 @@
opacity: 0;
border-radius: 0 @border-radius-base @border-radius-base 0;
transition: opacity 0.24s linear 0.1s;
// Fix input number inside Menu makes icon too large
// We arise the selector priority by nest selector here
// https://github.com/ant-design/ant-design/issues/14367
.@{input-number-prefix-cls}-handler {
.@{input-number-prefix-cls}-handler-up-inner,
.@{input-number-prefix-cls}-handler-down-inner {
.iconfont-size-under-12px(7px);
min-width: auto;
margin-right: 0;
}
}
}
&-handler-wrap:hover &-handler {

View File

@ -24,6 +24,7 @@ const SIZING_STYLE = [
'font-family',
'font-weight',
'font-size',
'font-variant',
'text-rendering',
'text-transform',
'width',

View File

@ -1,8 +1,8 @@
---
order: 4
title:
zh-CN: 搜索框
en-US: Search box
zh-CN: 搜索框
en-US: Search box
---
## zh-CN

View File

@ -350,9 +350,6 @@
&:hover .@{inputClass}:not(.@{inputClass}-disabled) {
.hover();
}
&:hover .@{inputClass}-suffix {
opacity: 1;
}
.@{inputClass} {
position: relative;
@ -363,17 +360,12 @@
position: absolute;
top: 50%;
z-index: 2;
opacity: 0;
transform: translateY(-50%);
line-height: 0;
color: @input-color;
transition: color 0.3s ease, opacity 0.15s ease;
:not(.anticon) {
line-height: @line-height-base;
}
&:hover {
color: @text-color-secondary;
}
}
.@{inputClass}-prefix {

View File

@ -27,11 +27,24 @@
}
}
&.@{search-prefix}-enter-button > .@{ant-prefix}-input {
padding-right: 46px;
}
&.@{search-prefix}-enter-button {
display: table;
&.@{search-prefix}-enter-button > .@{ant-prefix}-input-suffix {
right: 0;
> * {
display: table-cell;
}
> .@{ant-prefix}-input {
.input;
width: 100%;
border-top-right-radius: 0;
border-bottom-right-radius: 0;
border-right: 0;
}
> .@{ant-prefix}-input-suffix {
position: static;
transform: none;
}
}
}

View File

@ -509,9 +509,6 @@ exports[`renders ./components/locale-provider/demo/all.md correctly 1`] = `
</span>
</div>
</div>
<ul
class="ant-transfer-list-content"
/>
<div
class="ant-transfer-list-body-not-found"
>
@ -656,9 +653,6 @@ exports[`renders ./components/locale-provider/demo/all.md correctly 1`] = `
</span>
</div>
</div>
<ul
class="ant-transfer-list-content"
/>
<div
class="ant-transfer-list-body-not-found"
>

View File

@ -12,6 +12,8 @@ interface MenuItemProps {
children?: React.ReactNode;
className?: string;
onClick?: (param: ClickParam) => void;
onMouseEnter?: (event: string, e: MouseEvent) => void;
onMouseLeave?: (event: string, e: MouseEvent) => void;
}
class MenuItem extends React.Component<MenuItemProps, any> {

View File

@ -109,6 +109,7 @@
position: absolute;
display: block;
letter-spacing: 2px;
text-indent: 0.13em;
color: @disabled-color;
text-align: center;
opacity: 1;

View File

@ -68,6 +68,37 @@ describe('Radio', () => {
expect(onChange.mock.calls.length).toBe(2);
});
it('both of radio and radioGroup will trigger onchange event when they exists', () => {
const onChange = jest.fn();
const onChangeRadioGroup = jest.fn();
const wrapper = mount(
<RadioGroup onChange={onChangeRadioGroup}>
<Radio value="A" onChange={onChange}>
A
</Radio>
<Radio value="B" onChange={onChange}>
B
</Radio>
<Radio value="C" onChange={onChange}>
C
</Radio>
</RadioGroup>,
);
const radios = wrapper.find('input');
// uncontrolled component
wrapper.setState({ value: 'B' });
radios.at(0).simulate('change');
expect(onChange.mock.calls.length).toBe(1);
expect(onChangeRadioGroup.mock.calls.length).toBe(1);
// controlled component
wrapper.setProps({ value: 'A' });
radios.at(1).simulate('change');
expect(onChange.mock.calls.length).toBe(2);
});
it("won't fire change events when value not changes", () => {
const onChange = jest.fn();

View File

@ -95,6 +95,7 @@ class RadioGroup extends React.Component<RadioGroupProps, RadioGroupState> {
onChange(ev);
}
};
renderGroup = ({ getPrefixCls }: ConfigConsumerProps) => {
const props = this.props;
const { prefixCls: customizePrefixCls, className = '', options, buttonStyle } = props;

View File

@ -5,7 +5,7 @@ import classNames from 'classnames';
import shallowEqual from 'shallowequal';
import RadioGroup from './group';
import RadioButton from './radioButton';
import { RadioProps, RadioGroupContext } from './interface';
import { RadioProps, RadioChangeEvent, RadioGroupContext } from './interface';
import { ConfigConsumer, ConfigConsumerProps } from '../config-provider';
export default class Radio extends React.Component<RadioProps, {}> {
@ -44,6 +44,16 @@ export default class Radio extends React.Component<RadioProps, {}> {
this.rcCheckbox = node;
};
onChange = (e: RadioChangeEvent) => {
if (this.props.onChange) {
this.props.onChange(e);
}
if (this.context.radioGroup && this.context.radioGroup.onChange) {
this.context.radioGroup.onChange(e);
}
};
renderRadio = ({ getPrefixCls }: ConfigConsumerProps) => {
const { props, context } = this;
const { prefixCls: customizePrefixCls, className, children, style, ...restProps } = props;
@ -52,7 +62,7 @@ export default class Radio extends React.Component<RadioProps, {}> {
const radioProps: RadioProps = { ...restProps };
if (radioGroup) {
radioProps.name = radioGroup.name;
radioProps.onChange = radioGroup.onChange;
radioProps.onChange = this.onChange;
radioProps.checked = props.value === radioGroup.value;
radioProps.disabled = props.disabled || radioGroup.disabled;
}

View File

@ -4,7 +4,7 @@ import RcSelect, { Option, OptGroup } from 'rc-select';
import classNames from 'classnames';
import { ConfigConsumer, ConfigConsumerProps, RenderEmptyHandler } from '../config-provider';
import omit from 'omit.js';
import warning from 'warning';
import warning from '../_util/warning';
import Icon from '../icon';
import { tuple } from '../_util/type';
@ -31,7 +31,7 @@ export interface AbstractSelectProps {
dropdownMenuStyle?: React.CSSProperties;
dropdownMatchSelectWidth?: boolean;
onSearch?: (value: string) => any;
getPopupContainer?: (triggerNode: Element) => HTMLElement;
getPopupContainer?: (triggerNode?: Element) => HTMLElement;
filterOption?: boolean | ((inputValue: string, option: React.ReactElement<OptionProps>) => any);
id?: string;
defaultOpen?: boolean;

View File

@ -18,8 +18,15 @@ export interface StepsProps {
style?: React.CSSProperties;
}
export interface StepProps {
description?: React.ReactNode;
icon?: React.ReactNode;
status?: 'wait' | 'process' | 'finish' | 'error';
title?: React.ReactNode;
}
export default class Steps extends React.Component<StepsProps, any> {
static Step = RcSteps.Step;
static Step = RcSteps.Step as React.ClassicComponentClass<StepProps>;
static defaultProps = {
current: 0,

View File

@ -238,7 +238,7 @@ a {
&:focus {
text-decoration: underline;
text-decoration-skip: ink;
text-decoration-skip-ink: auto;
}
&:hover {

View File

@ -4,12 +4,12 @@
}
}
[ant-click-animating],
[ant-click-animating-without-extra-node] {
[ant-click-animating='true'],
[ant-click-animating-without-extra-node='true'] {
position: relative;
}
[ant-click-animating-without-extra-node]:after,
[ant-click-animating-without-extra-node='true']:after,
.ant-click-animating-node {
content: '';
position: absolute;

View File

@ -509,7 +509,7 @@
@slider-handle-color: @primary-3;
@slider-handle-color-hover: @primary-4;
@slider-handle-color-focus: tint(@primary-color, 20%);
@slider-handle-color-focus-shadow: tint(@primary-color, 50%);
@slider-handle-color-focus-shadow: fade(@primary-color, 20%);
@slider-handle-color-tooltip-open: @primary-color;
@slider-dot-border-color: @border-color-split;
@slider-dot-border-color-active: tint(@primary-color, 50%);

View File

@ -36,7 +36,7 @@ export interface ColumnProps<T> {
fixed?: boolean | ('left' | 'right');
filterIcon?: React.ReactNode | ((filtered: boolean) => React.ReactNode);
filteredValue?: any[];
sortOrder?: SortOrder;
sortOrder?: SortOrder | boolean;
children?: ColumnProps<T>[];
onCellClick?: (record: T, event: any) => void;
onCell?: (record: T, rowIndex: number) => any;
@ -115,6 +115,11 @@ export interface ExpandIconProps<T> {
expandable: boolean;
onExpand: (record: T, event: MouseEvent) => void;
}
export interface TableCurrentDataSource<T> {
currentDataSource: T[];
}
export interface TableProps<T> {
prefixCls?: string;
dropdownPrefixCls?: string;
@ -145,6 +150,7 @@ export interface TableProps<T> {
pagination: PaginationConfig,
filters: Record<keyof T, string[]>,
sorter: SorterResult<T>,
extra: TableCurrentDataSource<T>,
) => void;
loading?: boolean | SpinProps;
locale?: TableLocale;

View File

@ -388,6 +388,7 @@
position: relative;
padding: @table-padding-vertical @table-padding-horizontal;
background: @component-background;
border-radius: @border-radius-base;
border-bottom: @border-width-base @border-style-base @border-color-split;
text-align: center;
font-size: @font-size-base;

View File

@ -74,9 +74,6 @@ exports[`renders ./components/transfer/demo/advanced.md correctly 1`] = `
</span>
</div>
</div>
<ul
class="ant-transfer-list-content"
/>
<div
class="ant-transfer-list-body-not-found"
>
@ -241,9 +238,6 @@ exports[`renders ./components/transfer/demo/advanced.md correctly 1`] = `
</span>
</div>
</div>
<ul
class="ant-transfer-list-content"
/>
<div
class="ant-transfer-list-body-not-found"
>
@ -563,9 +557,6 @@ exports[`renders ./components/transfer/demo/custom-item.md correctly 1`] = `
<div
class="ant-transfer-list-body"
>
<ul
class="ant-transfer-list-content"
/>
<div
class="ant-transfer-list-body-not-found"
>
@ -677,9 +668,6 @@ exports[`renders ./components/transfer/demo/custom-item.md correctly 1`] = `
<div
class="ant-transfer-list-body"
>
<ul
class="ant-transfer-list-content"
/>
<div
class="ant-transfer-list-body-not-found"
>
@ -745,9 +733,6 @@ exports[`renders ./components/transfer/demo/large-data.md correctly 1`] = `
<div
class="ant-transfer-list-body"
>
<ul
class="ant-transfer-list-content"
/>
<div
class="ant-transfer-list-body-not-found"
>
@ -858,9 +843,6 @@ exports[`renders ./components/transfer/demo/large-data.md correctly 1`] = `
<div
class="ant-transfer-list-body"
>
<ul
class="ant-transfer-list-content"
/>
<div
class="ant-transfer-list-body-not-found"
>
@ -960,9 +942,6 @@ exports[`renders ./components/transfer/demo/search.md correctly 1`] = `
</span>
</div>
</div>
<ul
class="ant-transfer-list-content"
/>
<div
class="ant-transfer-list-body-not-found"
>
@ -1107,9 +1086,6 @@ exports[`renders ./components/transfer/demo/search.md correctly 1`] = `
</span>
</div>
</div>
<ul
class="ant-transfer-list-content"
/>
<div
class="ant-transfer-list-body-not-found"
>

View File

@ -221,15 +221,17 @@ export default class TransferList extends React.Component<TransferListProps, any
)}
>
{search}
<Animate
component="ul"
componentProps={{ onScroll }}
className={`${prefixCls}-content`}
transitionName={this.state.mounted ? `${prefixCls}-content-item-highlight` : ''}
transitionLeave={false}
>
{showItems}
</Animate>
{!searchNotFound && (
<Animate
component="ul"
componentProps={{ onScroll }}
className={`${prefixCls}-content`}
transitionName={this.state.mounted ? `${prefixCls}-content-item-highlight` : ''}
transitionLeave={false}
>
{showItems}
</Animate>
)}
{searchNotFound}
</div>
);
@ -240,7 +242,6 @@ export default class TransferList extends React.Component<TransferListProps, any
const checkedAll = checkStatus === 'all';
const checkAllCheckbox = (
<Checkbox
ref="checkbox"
disabled={disabled}
checked={checkedAll}
indeterminate={checkStatus === 'part'}

View File

@ -50,7 +50,6 @@ export default class Search extends React.Component<TransferSearchProps, any> {
placeholder={placeholder}
className={prefixCls}
value={value}
ref="input"
onChange={this.handleChange}
disabled={disabled}
/>

View File

@ -128,8 +128,12 @@
position: absolute;
top: 50%;
width: 100%;
margin-top: -10px;
transform: translateY(-50%);
// with filter should offset the search box height
.@{transfer-prefix-cls}-list-body-with-search & {
margin-top: @input-height-base / 2;
}
}
&-footer {

View File

@ -34,7 +34,7 @@ export interface TreeSelectProps extends AbstractSelectProps {
defaultValue?: string | number | Array<any>;
dropdownStyle?: React.CSSProperties;
filterTreeNode?: (inputValue: string, treeNode: any) => boolean | boolean;
getPopupContainer?: (triggerNode: Element) => HTMLElement;
getPopupContainer?: (triggerNode?: Element) => HTMLElement;
labelInValue?: boolean;
loadData?: (node: any) => void;
maxTagCount?: number;

View File

@ -49,6 +49,7 @@ class Upload extends React.Component<UploadProps, UploadState> {
}
recentUploadStatus: boolean | PromiseLike<any>;
progressTimer: any;
private upload: any;
@ -161,10 +162,14 @@ class Upload extends React.Component<UploadProps, UploadState> {
handleRemove(file: UploadFile) {
const { onRemove } = this.props;
const { status } = file;
file.status = 'removed'; // eslint-disable-line
Promise.resolve(typeof onRemove === 'function' ? onRemove(file) : onRemove).then(ret => {
// Prevent removing file
if (ret === false) {
file.status = status;
return;
}
@ -180,7 +185,7 @@ class Upload extends React.Component<UploadProps, UploadState> {
handleManualRemove = (file: UploadFile) => {
this.upload.abort(file);
file.status = 'removed'; // eslint-disable-line
this.handleRemove(file);
};
@ -215,7 +220,8 @@ class Upload extends React.Component<UploadProps, UploadState> {
),
});
return false;
} else if (result && (result as PromiseLike<any>).then) {
}
if (result && (result as PromiseLike<any>).then) {
return result;
}
return true;

View File

@ -319,4 +319,32 @@ describe('Upload', () => {
expect(linkNode.props().download).toBe('image');
expect(linkNode.props().rel).toBe('noopener');
});
it('should not stop remove when return value of onRemove is false', done => {
const mockRemove = jest.fn(() => false);
const props = {
onRemove: mockRemove,
fileList: [
{
uid: '-1',
name: 'foo.png',
status: 'done',
url: 'http://www.baidu.com/xxx.png',
},
],
};
const wrapper = mount(<Upload {...props} />);
wrapper.find('div.ant-upload-list-item i.anticon-close').simulate('click');
setImmediate(() => {
wrapper.update();
expect(mockRemove).toBeCalled();
expect(props.fileList).toHaveLength(1);
expect(props.fileList[0].status).toBe('done');
done();
});
});
});

View File

@ -101,10 +101,10 @@ For instance, we actually import all styles of components in the project which m
Now we need to customize the default webpack config. We can achieve that by using [react-app-rewired](https://github.com/timarney/react-app-rewired) which is one of create-react-app's custom config solutions.
Import react-app-rewired and modify the `scripts` field in package.json.
Import react-app-rewired and modify the `scripts` field in package.json. Due to new `react-app-rewired@2.x` versions, you have to install customize-cra along with react-app-rewired.
```
$ yarn add react-app-rewired
$ yarn add react-app-rewired customize-cra
```
```diff
@ -137,15 +137,19 @@ $ yarn add babel-plugin-import
```
```diff
+ const { injectBabelPlugin } = require('react-app-rewired');
+ const { override, fixBabelImports } = require('customize-cra');
module.exports = function override(config, env) {
+ config = injectBabelPlugin(
+ ['import', { libraryName: 'antd', libraryDirectory: 'es', style: 'css' }],
+ config,
+ );
return config;
};
- module.exports = function override(config, env) {
- // do stuff with the webpack config...
- return config;
- };
+ module.exports = override(
+ fixBabelImports('import', {
+ libraryName: 'antd',
+ libraryDirectory: 'es',
+ style: 'css',
+ }),
+ );
```
Remove the `@import '~antd/dist/antd.css';` statement added before because `babel-plugin-import` will import styles and import components like below:
@ -174,28 +178,28 @@ Then reboot with `yarn start` and visit the demo page, you should not find any [
### Customize Theme
According to the [Customize Theme documentation](/docs/react/customize-theme), to customize the theme, we need to modify `less` variables with tools such as [less-loader](https://github.com/webpack/less-loader). We can also use [react-app-rewire-less](http://npmjs.com/react-app-rewire-less) to achieve this. Import it and modify `config-overrides.js` like below.
According to the [Customize Theme documentation](/docs/react/customize-theme), to customize the theme, we need to modify `less` variables with tools such as [less-loader](https://github.com/webpack/less-loader). We can also use [addLessLoader](https://github.com/arackaf/customize-cra#addlessloaderloaderoptions) to achieve this. Import it and modify `config-overrides.js` like below.
```bash
$ yarn add react-app-rewire-less
$ yarn add less
$ yarn add --dev less-loader
```
```diff
const { injectBabelPlugin } = require('react-app-rewired');
+ const rewireLess = require('react-app-rewire-less');
- const { override, fixBabelImports } = require('customize-cra');
+ const { override, fixBabelImports, addLessLoader } = require('customize-cra');
module.exports = function override(config, env) {
config = injectBabelPlugin(
- ['import', { libraryName: 'antd', libraryDirectory: 'es', style: 'css' }],
+ ['import', { libraryName: 'antd', libraryDirectory: 'es', style: true }], // change importing css to less
config,
);
+ config = rewireLess.withLoaderOptions({
+ modifyVars: { "@primary-color": "#1DA57A" },
+ javascriptEnabled: true,
+ })(config, env);
return config;
};
module.exports = override(
fixBabelImports('import', {
libraryName: 'antd',
libraryDirectory: 'es',
style: true,
}),
+ addLessLoader({
+ javascriptEnabled: true,
+ modifyVars: { '@primary-color': '#1DA57A' },
+ }),
);
```
We use `modifyVars` option of [less-loader](https://github.com/webpack/less-loader#less-options) here, you can see a green button rendered on the page after rebooting the start server.

View File

@ -96,12 +96,12 @@ export default App;
我们现在已经把组件成功运行起来了,但是在实际开发过程中还有很多问题,例如上面的例子实际上加载了全部的 antd 组件的样式(对前端性能是个隐患)。
此时我们需要对 create-react-app 的默认配置进行自定义,这里我们使用 [react-app-rewired](https://github.com/timarney/react-app-rewired) (一个对 create-react-app 进行自定义配置的社区解决方案)。
此时我们需要对 create-react-app 的默认配置进行自定义,这里我们使用 [react-app-rewired](https://github.com/timarney/react-app-rewired) (一个对 create-react-app 进行自定义配置的社区解决方案)。由于新的 `react-app-rewired@2.x` 版本的关系,你必须安装 customize-cra 以及 react-app-rewired 。
引入 react-app-rewired 并修改 package.json 里的启动配置。
```
$ yarn add react-app-rewired
$ yarn add react-app-rewired customize-cra
```
```diff
@ -134,15 +134,19 @@ $ yarn add babel-plugin-import
```
```diff
+ const { injectBabelPlugin } = require('react-app-rewired');
+ const { override, fixBabelImports } = require('customize-cra');
module.exports = function override(config, env) {
+ config = injectBabelPlugin(
+ ['import', { libraryName: 'antd', libraryDirectory: 'es', style: 'css' }],
+ config,
+ );
return config;
};
- module.exports = function override(config, env) {
- // do stuff with the webpack config...
- return config;
- };
+ module.exports = override(
+ fixBabelImports('import', {
+ libraryName: 'antd',
+ libraryDirectory: 'es',
+ style: 'css',
+ }),
+ );
```
然后移除前面在 `src/App.css` 里全量添加的 `@import '~antd/dist/antd.css';` 样式代码,并且按下面的格式引入模块。
@ -171,28 +175,28 @@ $ yarn add babel-plugin-import
### 自定义主题
按照 [配置主题](/docs/react/customize-theme) 的要求,自定义主题需要用到 less 变量覆盖功能。我们可以引入 react-app-rewire 的 less 插件 [react-app-rewire-less](http://npmjs.com/react-app-rewire-less) 来帮助加载 less 样式,同时修改 `config-overrides.js` 文件。
按照 [配置主题](/docs/react/customize-theme) 的要求,自定义主题需要用到 less 变量覆盖功能。我们可以引入 `customize-cra` 中提供的 less 相关的函数 [addLessLoader](https://github.com/arackaf/customize-cra#addlessloaderloaderoptions) 来帮助加载 less 样式,同时修改 `config-overrides.js` 文件。
```bash
$ yarn add react-app-rewire-less
$ yarn add less
$ yarn add --dev less-loader
```
```diff
const { injectBabelPlugin } = require('react-app-rewired');
+ const rewireLess = require('react-app-rewire-less');
- const { override, fixBabelImports } = require('customize-cra');
+ const { override, fixBabelImports, addLessLoader } = require('customize-cra');
module.exports = function override(config, env) {
config = injectBabelPlugin(
- ['import', { libraryName: 'antd', libraryDirectory: 'es', style: 'css' }],
+ ['import', { libraryName: 'antd', libraryDirectory: 'es', style: true }], // change importing css to less
config,
);
+ config = rewireLess.withLoaderOptions({
+ modifyVars: { "@primary-color": "#1DA57A" },
+ javascriptEnabled: true,
+ })(config, env);
return config;
};
module.exports = override(
fixBabelImports('import', {
libraryName: 'antd',
libraryDirectory: 'es',
style: true,
}),
+ addLessLoader({
+ javascriptEnabled: true,
+ modifyVars: { '@primary-color': '#1DA57A' },
+ }),
);
```
这里利用了 [less-loader](https://github.com/webpack/less-loader#less-options) 的 `modifyVars` 来进行主题配置,

View File

@ -7,36 +7,25 @@ title: Resources
Please find below some of the design resources and tools about Ant Design that we consider valuable. More of this is still being collected.
<div class="resource-cards">
<a target="_blank" href="https://github.com/ant-design/ant-design/releases/download/resource/Ant.Design.Components.Beta.3.10.5.sketch" class="resource-card">
<a target="_blank" href="https://github.com/ant-design/ant-design/releases/download/resource/Ant.Design.Components.3.12.0.sketch" class="resource-card">
<div class="resource-card-icon">
<img width="65" src="https://gw.alipayobjects.com/zos/rmsportal/pKfDZnzocrbAOSzDQOQq.png">
</div>
<div class="resource-card-content">
<span class="resource-card-title">
RENEW Symbols
<span class="resource-card-hot-badge">BETA</span>
RENEW Sketch Symbols
<span class="resource-card-hot-badge">NEW</span>
</span>
<span class="resource-card-description">Sketch Symbols for Desktop</span>
</div>
</a>
<a target="_blank" href="https://github.com/ant-design/ant-design/releases/download/resource/Ant.Design.3.0.Components.sketch" class="resource-card">
<div class="resource-card-icon">
<img width="65" src="https://gw.alipayobjects.com/zos/rmsportal/pKfDZnzocrbAOSzDQOQq.png">
</div>
<div class="resource-card-content">
<span class="resource-card-title">
Sketch Symbols
</span>
<span class="resource-card-description">Sketch Symbols File for Desktop</span>
</div>
</a>
<a target="_blank" href="https://landing.ant.design/docs/download" class="resource-card">
<div class="resource-card-icon">
<img width="65" src="https://gw.alipayobjects.com/zos/rmsportal/EAHlyTmYeDtTkZIPbUnP.svg">
</div>
<div class="resource-card-content">
<span class="resource-card-title">
Ant Design Landing
Ant Design Landing
<span class="resource-card-hot-badge">NEW</span>
</span>
<span class="resource-card-description">Landing Templates</span>

View File

@ -9,25 +9,14 @@ title: 设计资源
- 新版本 Sketch Symbols 组件反馈地址:[🦜 反馈地址](https://www.yuque.com/kitchen/topics/51)
<div class="resource-cards">
<a target="_blank" href="https://github.com/ant-design/ant-design/releases/download/resource/Ant.Design.Components.Beta.3.10.5.sketch" class="resource-card">
<a target="_blank" href="https://github.com/ant-design/ant-design/releases/download/resource/Ant.Design.Components.3.12.0.sketch" class="resource-card">
<div class="resource-card-icon">
<img width="65" src="https://gw.alipayobjects.com/zos/rmsportal/pKfDZnzocrbAOSzDQOQq.png">
</div>
<div class="resource-card-content">
<span class="resource-card-title">
新 Sketch Symbols 组件
<span class="resource-card-hot-badge">BETA</span>
</span>
<span class="resource-card-description">桌面组件 Sketch 模板包</span>
</div>
</a>
<a target="_blank" href="https://github.com/ant-design/ant-design/releases/download/resource/Ant.Design.3.0.Components.sketch" class="resource-card">
<div class="resource-card-icon">
<img width="65" src="https://gw.alipayobjects.com/zos/rmsportal/pKfDZnzocrbAOSzDQOQq.png">
</div>
<div class="resource-card-content">
<span class="resource-card-title">
Sketch Symbols 组件
全新 Sketch 组件包
<span class="resource-card-hot-badge">NEW</span>
</span>
<span class="resource-card-description">桌面组件 Sketch 模板包</span>
</div>
@ -77,10 +66,10 @@ title: 设计资源
</div>
<div class="resource-card-content">
<span class="resource-card-title">
Ant Design Landing
Ant Design Landing
<span class="resource-card-hot-badge">NEW</span>
</span>
<span class="resource-card-description">Landing 模板集</span>
<span class="resource-card-description">首页模板集</span>
</div>
</a>
<a target="_blank" href="http://ux.ant.design" class="resource-card">

View File

@ -1,6 +1,6 @@
{
"name": "antd",
"version": "3.12.2",
"version": "3.12.4",
"title": "Ant Design",
"description": "An enterprise-class UI design language and React-based implementation",
"homepage": "http://ant.design/",
@ -92,12 +92,14 @@
},
"devDependencies": {
"@ant-design/colors": "^2.0.0",
"@sentry/browser": "^4.5.2",
"@types/classnames": "^2.2.6",
"@types/prop-types": "^15.5.6",
"@types/react": "~16.7.13",
"@types/react-dom": "^16.0.11",
"@types/react-intl": "^2.3.14",
"@types/react-slick": "^0.23.2",
"@types/warning": "^3.0.0",
"@yesmeck/offline-plugin": "^5.0.5",
"ansi-styles": "^3.2.1",
"antd-theme-generator": "^1.1.4",
@ -155,7 +157,7 @@
"react-document-title": "^2.0.3",
"react-dom": "^16.5.2",
"react-github-button": "^0.1.11",
"react-highlight-words": "^0.15.0",
"react-highlight-words": "^0.16.0",
"react-infinite-scroller": "^1.2.1",
"react-intl": "^2.7.0",
"react-resizable": "^1.7.5",

View File

@ -18,7 +18,7 @@ a {
transition: color 0.3s ease;
&:focus {
text-decoration: underline;
text-decoration-skip: ink;
text-decoration-skip-ink: auto;
}
}

View File

@ -1,6 +1,6 @@
@import './colors';
@padding-space: 144px;
@padding-space: 24px;
footer {
clear: both;

View File

@ -78,7 +78,6 @@
<div id="react-content">
{{ content | safe }}
</div>
<script src="{{ root }}common.js"></script>
<script src="{{ root }}index.js"></script>
<!-- Global Site Tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-72788897-1"></script>

View File

@ -0,0 +1,31 @@
import React, { Component } from 'react';
import * as Sentry from '@sentry/browser';
Sentry.init({
dsn: 'https://41977dd48e5b4da2aa3600ccbe7dda6d@sentry.io/1375756',
});
export default class SentryBoundary extends Component {
state = { error: null };
componentDidCatch(error, errorInfo) {
this.setState({ error });
Sentry.withScope(scope => {
Object.keys(errorInfo).forEach(key => {
scope.setExtra(key, errorInfo[key]);
});
Sentry.captureException(error);
});
}
render() {
const { children } = this.props;
const { error } = this.state;
if (error) {
// render fallback UI
return <a onClick={() => Sentry.showReportDialog()}>Report feedback</a>;
}
// when there's not an error, render children untouched
return children;
}
}

View File

@ -7,6 +7,7 @@ import 'moment/locale/zh-cn';
import { LocaleProvider } from 'antd';
import zhCN from 'antd/lib/locale-provider/zh_CN';
import Header from './Header';
import SentryBoundary from './SentryBoundary';
import enLocale from '../../en-US';
import cnLocale from '../../zh-CN';
import * as utils from '../utils';
@ -95,14 +96,16 @@ export default class Layout extends React.Component {
const { appLocale } = this.state;
return (
<IntlProvider locale={appLocale.locale} messages={appLocale.messages}>
<LocaleProvider locale={appLocale.locale === 'zh-CN' ? zhCN : null}>
<div className="page-wrapper">
<Header {...restProps} />
{children}
</div>
</LocaleProvider>
</IntlProvider>
<SentryBoundary>
<IntlProvider locale={appLocale.locale} messages={appLocale.messages}>
<LocaleProvider locale={appLocale.locale === 'zh-CN' ? zhCN : null}>
<div className="page-wrapper">
<Header {...restProps} />
{children}
</div>
</LocaleProvider>
</IntlProvider>
</SentryBoundary>
);
}
}

View File

@ -52,7 +52,7 @@ module.exports = {
'app.footer.chinamirror': '国内镜像站点 🇨🇳',
'app.footer.primary-color-changed': '修改主题色成功!',
'app.footer.kitchen': 'Sketch 工具集',
'app.footer.landing': 'Landing 模板集',
'app.footer.landing': '首页模板集',
'app.footer.scaffold': '脚手架',
'app.footer.scaffolds': '脚手架市场',
'app.footer.dev-tools': '开发工具',

View File

@ -2,6 +2,7 @@
"compilerOptions": {
"strictNullChecks": true,
"moduleResolution": "node",
"esModuleInterop": true,
"experimentalDecorators": true,
"jsx": "preserve",
"noUnusedParameters": true,

View File

@ -14,8 +14,6 @@ declare module 'rc-util*';
declare module 'shallowequal';
declare module 'warning';
declare module 'css-animation*';
declare module 'rc-select';