diff --git a/CHANGELOG.en-US.md b/CHANGELOG.en-US.md index b76cab86fd..66792d068a 100644 --- a/CHANGELOG.en-US.md +++ b/CHANGELOG.en-US.md @@ -15,6 +15,41 @@ timeline: true --- +## 3.11.2 + +`2018-12-10` + +- 🐞 Fixed Table `Cannot read property 'children' of undefined` error when customize `column.title` as ReactNode. [#13542](https://github.com/ant-design/ant-design/issues/13542) [@geraldchen890806](https://github.com/geraldchen890806) +- 🐞 Fixed another border problem of Button when customized less variable `@border-width-base`. [#13534](https://github.com/ant-design/ant-design/issues/13534) [@morenyang](https://github.com/morenyang) +- 🐞 Fixed Upload don't support resolve `Blob` object when `beforeUpload` returns a Promise. [#13528](https://github.com/ant-design/ant-design/pull/13528/) [@huanz](https://github.com/huanz) +- https://github.com/ant-design/ant-design/pull/13536 +- 🐞 Fixed two props of Dropdown TypeScript definitions. [#13536](https://github.com/ant-design/ant-design/pull/13536) [@wangxingkang](https://github.com/wangxingkang) + +## 3.11.1 + +`2018-12-08` + +- 🐞 Fixed the issue where the Avatar icon could not be centered vertically. [#13408](https://github.com/ant-design/ant-design/issues/13408) +- 🐞 Fixed the border problem of Button when customized less variable `@border-width-base`. [#13413](https://github.com/ant-design/ant-design/issues/13413) [@morenyang](https://github.com/morenyang) +- 🐞 Fixed Commnet does not correctly display line breaks. [#13429](https://github.com/ant-design/ant-design/issues/13429) +- 🐞 Fixed the issue that when the Alert is in `closable`, the icon will be covered by the text. [#13440](https://github.com/ant-design/ant-design/issues/13440) +- Button + - 🐞 Fixed the issue that when the `href` property is `undefined`, the Button will also be rendered as a anchor. [#13337](https://github.com/ant-design/ant-design/issues/13337) + - 🐞 Fixed the issue that Edge throws an error when setting the `loading` property. [#13216](https://github.com/ant-design/ant-design/issues/13216) +- Dropdown + - 🐞 Fixed the issue that causes the icon in the Button to display smaller. [#13442](https://github.com/ant-design/ant-design/issues/13442) + - 🐞 Fixed the gap between the drop-down menu and the trigger element causes the drop-down menu to close. [#10481](https://github.com/ant-design/ant-design/issues/10481) +- Table + - 🐞 Fixed the use of filter causes an inconsistency between `selectedRowKeys` and `selectedRows` in `onChange`. [#11384](https://github.com/ant-design/ant-design/issues/11384) + - 💄 Optimize the display of the title when the mouse hovers over the sortable header. [#13312](https://github.com/ant-design/ant-design/issues/13312) +- DatePicker + - 🐞 Fixed the issue where the component lost focus after selecting the date. [#12475](https://github.com/ant-design/ant-design/issues/12475) + - 🐞 Fixed the issue that cause Safari to unresponsive. [#13424](https://github.com/ant-design/ant-design/issues/13424) + - 🐞 Fixed the issue where WeekPicker's date selection box was not aligned with the input box. +- 🐞 Fixed the blur method of the Slider. [#13439](https://github.com/ant-design/ant-design/issues/13439) +- 🐞 Fixed Cascader's i18n issues. [#13486](https://github.com/ant-design/ant-design/issues/13486) +- 🐞 Fix some TypeScript definitions. [#13390](https://github.com/ant-design/ant-design/pull/13390) [#13488](https://github.com/ant-design/ant-design/pull/13488) [#13420](https://github.com/ant-design/ant-design/issues/13420) + ## 3.11.0 `2018-12-02` @@ -1076,12 +1111,15 @@ Learn more in the [Ant Design 3.0 announcement post](https://medium.com/ant-desi - New [Divider](https://ant.design/components/divider/) component. - 30 New [icons](https://ant.design/components/icon/). +### ⚠️ Read it before migration + +- We suggest you upgrade to latest 3.x version directly. +- Some APIs may be deprecated in other 3.x versions which don't described below, please pay attention to warning in browser console and upgrade them. +- We strongly suggest upgrade react to 16 or newest for better support and performance, which could be conduct via [React 16 upgrading](https://reactjs.org/blog/2017/09/26/react-v16.0.html#upgrading). +- Then you can migrate to antd@3 by following `Breaking Changes` section. + ### Breaking Changes -> We suggest you upgrade to latest 3.x version directly. - -> Some APIs may be deprecated in other 3.x versions which don't described below, please pay attention to warning in browser console and upgrade them. - We provide a [migration tool](https://github.com/ant-design/antd-migration-helper) to help you find deprecated usages in your codebase. - Card's `noHovering` has been renamed to `hoverable`, and its default value now is `true`. diff --git a/CHANGELOG.zh-CN.md b/CHANGELOG.zh-CN.md index 142bce7384..5f38447cc5 100644 --- a/CHANGELOG.zh-CN.md +++ b/CHANGELOG.zh-CN.md @@ -15,6 +15,41 @@ timeline: true --- +## 3.11.2 + +`2018-12-10` + +- 🐞 修复 Table 使用自定义列头时报 `Cannot read property 'children' of undefined` 的问题。[#13542](https://github.com/ant-design/ant-design/issues/13542) [@geraldchen890806](https://github.com/geraldchen890806) +- 🐞 修复另一个 Input 在自定义了 less 变量 `@border-width-base` 时的边框问题。[#13534](https://github.com/ant-design/ant-design/pull/13534) [@morenyang](https://github.com/morenyang) +- 🐞 修复 Upload 的 `beforeUpload` 方法返回 Promise 时不支持 resolve `Blob` 对象的问题。[#13528](https://github.com/ant-design/ant-design/pull/13528/) [@huanz](https://github.com/huanz) +- https://github.com/ant-design/ant-design/pull/13536 +- 🐞 修复 Dropdown 两个属性的 TypeScript 定义。[#13536](https://github.com/ant-design/ant-design/pull/13536) [@wangxingkang](https://github.com/wangxingkang) + +## 3.11.1 + +`2018-12-08` + +- 🐞 修复 Avatar 图标不能垂直居中的问题。[#13408](https://github.com/ant-design/ant-design/issues/13408) +- 🐞 修复 Input 在自定义了 less 变量 `@border-width-base` 时的边框问题。[#13413](https://github.com/ant-design/ant-design/issues/13413) [@morenyang](https://github.com/morenyang) +- 🐞 修复 Commnet 组件不能正确显示换行的问题。[#13429](https://github.com/ant-design/ant-design/issues/13429) +- 🐞 修复 Alert 在 `closable` 时,关闭图标会被文字遮挡的问题。[#13440](https://github.com/ant-design/ant-design/issues/13440) +- Button + - 🐞 修复 `href` 属性为 `undefined` 时,Button 也会被渲染为 a 标签的问题。[#13337](https://github.com/ant-design/ant-design/issues/13337) + - 🐞 修复设置 `loading` 属性时在 Edge 下会报错的问题。[#13216](https://github.com/ant-design/ant-design/issues/13216) +- Dropdown + - 🐞 修复会导致 Button 中的图标显示变小的问题。[#13442](https://github.com/ant-design/ant-design/issues/13442) + - 🐞 修复下拉菜单跟触发元素之间的孔隙会导致下拉菜单关闭的问题。[#10481](https://github.com/ant-design/ant-design/issues/10481) +- Table + - 🐞 修复使用 filter 会导致 `onChange` 中 `selectedRowKeys` 和 `selectedRows` 不一致的问题。[#11384](https://github.com/ant-design/ant-design/issues/11384) + - 💄 优化鼠标悬停在可排序的表头上时 title 的显示。[#13312](https://github.com/ant-design/ant-design/issues/13312) +- DatePicker + - 🐞 修复选择日期后,组件会失去焦点的问题。[#12475](https://github.com/ant-design/ant-design/issues/12475) + - 🐞 修复会导致 Safari 假死的问题。[#13424](https://github.com/ant-design/ant-design/issues/13424) + - 🐞 修复 WeekPicker 的日期选择框跟输入框不对齐的问题。 +- 🐞 修复 Slider 的 blur 方法。[#13439](https://github.com/ant-design/ant-design/issues/13439) +- 🐞 修复 Cascader 的国际化问题。[#13486](https://github.com/ant-design/ant-design/issues/13486) +- 🐞 修复一些组件 TypeScript 定义。[#13390](https://github.com/ant-design/ant-design/pull/13390) [#13488](https://github.com/ant-design/ant-design/pull/13488) [#13420](https://github.com/ant-design/ant-design/issues/13420) + ## 3.11.0 `2018-12-02` @@ -1079,12 +1114,15 @@ timeline: true - 新的 [Divider](https://ant.design/components/divider-cn/) 组件。 - 新增 30 个[图标](https://ant.design/components/icon-cn/)。 +### ⚠️ 升级必读 + +- 如果你从 2.x 升级到 3.x,建议直接升级到 3.x 的最新版本。 +- 3.x 后续的版本可能已经废弃了一些下面没有提到的改动,请参考控制台的警告提示相应升级。 +- 建议同时升级 React 到 16 或更新版本,以获得更好的性能和更完善的支持,升级方式见 [官方发布文档](https://reactjs.org/blog/2017/09/26/react-v16.0.html#upgrading)。 +- 最后请参照下面的不兼容改动进行升级。 + ### 不兼容改动 -> 如果你从 2.x 升级到 3.x,建议直接升级到 3.x 的最新版本。 - -> 3.x 后续的版本可能已经废弃了一些下面没有提到的改动,请参考控制台的警告提示相应升级。 - 此版本有部分不兼容的改动,升级时确保修改相应的使用代码。另外由于人肉查找代码中的废弃用法过于低效,所以我们提供了 [antd-migration-helper](https://github.com/ant-design/antd-migration-helper) 用于扫描代码中的废弃用法。 - Card 的 `noHovering` 属性重命名为 `hoverable`,且默认值改为 `true`。 diff --git a/README-zh_CN.md b/README-zh_CN.md index 80ec081b66..a4ebb97684 100644 --- a/README-zh_CN.md +++ b/README-zh_CN.md @@ -109,6 +109,8 @@ $ npm start > 强烈推荐阅读 [《提问的智慧》](https://github.com/ryanhanwu/How-To-Ask-Questions-The-Smart-Way)、[《如何向开源社区提问题》](https://github.com/seajs/seajs/issues/545) 和 [《如何有效地报告 Bug》](http://www.chiark.greenend.org.uk/%7Esgtatham/bugs-cn.html)、[《如何向开源项目提交无法解答的问题》](https://zhuanlan.zhihu.com/p/25795393),更好的问题更容易获得帮助。 +[![Let's fund issues in this repository](https://issuehunt.io/static/embed/issuehunt-button-v1.svg)](https://issuehunt.io/repos/34526884) + ## 社区互助 如果您在使用的过程中碰到问题,可以通过下面几个途径寻求帮助,同时我们也鼓励资深用户通过下面的途径给新人提供帮助。 diff --git a/README.md b/README.md index 2ae8213a41..ea615ac2e0 100644 --- a/README.md +++ b/README.md @@ -107,3 +107,5 @@ Open your browser and visit http://127.0.0.1:8001 , see more at [Development](ht Read our [contributing guide](https://ant.design/docs/react/contributing) and let's build a better antd together. We welcome all contributions. Please read our [CONTRIBUTING.md](https://github.com/ant-design/ant-design/blob/master/.github/CONTRIBUTING.md) first. You can submit any ideas as [pull requests](https://github.com/ant-design/ant-design/pulls) or as [GitHub issues](https://github.com/ant-design/ant-design/issues). If you'd like to improve code, check out the [Development Instructions](https://github.com/ant-design/ant-design/wiki/Development) and have a good time! :) + +[![Let's fund issues in this repository](https://issuehunt.io/static/embed/issuehunt-button-v1.svg)](https://issuehunt.io/repos/34526884) diff --git a/components/auto-complete/index.tsx b/components/auto-complete/index.tsx index 17cb97f48e..2c540858a9 100755 --- a/components/auto-complete/index.tsx +++ b/components/auto-complete/index.tsx @@ -2,7 +2,7 @@ import * as React from 'react'; import { Option, OptGroup } from 'rc-select'; import classNames from 'classnames'; import InputElement from './InputElement'; -import Input from '../input'; +import Input, { InputProps } from '../input'; import Select, { AbstractSelectProps, SelectValue, OptionProps, OptGroupProps } from '../select'; import { ConfigConsumer, ConfigConsumerProps } from '../config-provider'; @@ -39,6 +39,7 @@ export interface AutoCompleteProps extends AbstractSelectProps { onFocus?: () => void; children?: | ValidInputElement + | React.ReactElement | React.ReactElement | Array>; } diff --git a/components/cascader/index.tsx b/components/cascader/index.tsx index d9b60a0fb5..2678bcf845 100644 --- a/components/cascader/index.tsx +++ b/components/cascader/index.tsx @@ -7,6 +7,7 @@ import KeyCode from 'rc-util/lib/KeyCode'; import Input from '../input'; import Icon from '../icon'; import { ConfigConsumer, ConfigConsumerProps } from '../config-provider'; +import LocaleReceiver from '../locale-provider/LocaleReceiver'; import warning from '../_util/warning'; export interface CascaderOptionType { @@ -14,7 +15,6 @@ export interface CascaderOptionType { label?: React.ReactNode; disabled?: boolean; children?: Array; - [key: string]: any; } @@ -105,6 +105,10 @@ export interface CascaderState { flattenOptions: CascaderOptionType[][] | undefined; } +interface CascaderLocale { + placeholder?: string; +} + // We limit the filtered item count by default const defaultLimit = 50; @@ -391,16 +395,16 @@ export default class Cascader extends React.Component { + renderCascader = ( + { getPopupContainer: getContextPopupContainer, getPrefixCls }: ConfigConsumerProps, + locale: CascaderLocale, + ) => { const { props, state } = this; const { prefixCls: customizePrefixCls, inputPrefixCls: customizeInputPrefixCls, children, - placeholder, + placeholder = locale.placeholder, size, disabled, className, @@ -410,6 +414,7 @@ export default class Cascader extends React.Component{this.renderCascader}; + return ( + + {(configArgument: ConfigConsumerProps) => ( + {locale => this.renderCascader(configArgument, locale)} + )} + + ); } } diff --git a/components/drawer/__tests__/__snapshots__/demo.test.js.snap b/components/drawer/__tests__/__snapshots__/demo.test.js.snap new file mode 100644 index 0000000000..11ce0b03c6 --- /dev/null +++ b/components/drawer/__tests__/__snapshots__/demo.test.js.snap @@ -0,0 +1,261 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`renders ./components/drawer/demo/basic-right.md correctly 1`] = ` +
+ +
+`; + +exports[`renders ./components/drawer/demo/form-in-drawer.md correctly 1`] = ` +
+ +
+`; + +exports[`renders ./components/drawer/demo/multi-level-drawer.md correctly 1`] = ` +
+ +
+`; + +exports[`renders ./components/drawer/demo/placement.md correctly 1`] = ` +
+
+ + + + +
+ +
+`; + +exports[`renders ./components/drawer/demo/user-profile.md correctly 1`] = ` +
+
+
+
+
+
+
+ + + +
+
+

+ + Lily + +

+
+ Progresser AFX +
+
+
+ +
+
+
+
+ + + +
+
+

+ + Lily + +

+
+ Progresser AFX +
+
+
+ +
+
+
+
+
+`; diff --git a/components/drawer/__tests__/demo.test.js b/components/drawer/__tests__/demo.test.js new file mode 100644 index 0000000000..1aaa525fff --- /dev/null +++ b/components/drawer/__tests__/demo.test.js @@ -0,0 +1,3 @@ +import demoTest from '../../../tests/shared/demoTest'; + +demoTest('drawer'); diff --git a/components/drawer/demo/from-drawer.md b/components/drawer/demo/form-in-drawer.md similarity index 82% rename from components/drawer/demo/from-drawer.md rename to components/drawer/demo/form-in-drawer.md index 2e1054e51a..f5ef324c28 100644 --- a/components/drawer/demo/from-drawer.md +++ b/components/drawer/demo/form-in-drawer.md @@ -1,21 +1,21 @@ --- order: 3 title: - zh-CN: 对象编辑 - en-US: Edit item in drawer + zh-CN: 抽屉表单 + en-US: Submit form in drawer --- ## zh-CN -用于承载编辑相关操作,需要点击关闭按钮关闭。 +在抽屉中使用表单。 ## en-US -A drawer containing an editable form which needs to be collapsed by clicking the close button. +Use form in drawer with submit button. ```jsx import { - Drawer, Form, Button, Col, Row, Input, Select, DatePicker, + Drawer, Form, Button, Col, Row, Input, Select, DatePicker, Icon, } from 'antd'; const { Option } = Select; @@ -40,19 +40,17 @@ class DrawerForm extends React.Component { return (
@@ -60,20 +58,20 @@ class DrawerForm extends React.Component { {getFieldDecorator('name', { - rules: [{ required: true, message: 'please enter user name' }], - })()} + rules: [{ required: true, message: 'Please enter user name' }], + })()} {getFieldDecorator('url', { - rules: [{ required: true, message: 'please enter url' }], + rules: [{ required: true, message: 'Please enter url' }], })( )} @@ -149,25 +147,21 @@ class DrawerForm extends React.Component {
- - +
diff --git a/components/drawer/index.en-US.md b/components/drawer/index.en-US.md index 0e56e94dfd..a9d0cf66d0 100644 --- a/components/drawer/index.en-US.md +++ b/components/drawer/index.en-US.md @@ -21,7 +21,7 @@ A Drawer is a panel that is typically overlaid on top of a page and slides in fr | --- | --- | --- | --- | | closable | Whether a close (x) button is visible on top right of the Drawer dialog or not. | boolean | true | | destroyOnClose | Whether to unmount child components on closing drawer or not. | boolean | false | -| getContainer | Return the mounted node for Drawer. | HTMLElement \| `() => HTMLElement` \| selectors  | 'body' | +| getContainer | Return the mounted node for Drawer. | HTMLElement \| `() => HTMLElement` \| Selectors | 'body' | | mask | Whether to show mask or not. | Boolean | true | | maskClosable | Clicking on the mask (area outside the Drawer) to close the Drawer or not. | boolean | true | | maskStyle | Style for Drawer's mask element. | object | {} | diff --git a/components/drawer/index.zh-CN.md b/components/drawer/index.zh-CN.md index 3e4eb1ffb1..6d720a1e64 100644 --- a/components/drawer/index.zh-CN.md +++ b/components/drawer/index.zh-CN.md @@ -20,7 +20,7 @@ title: Drawer | --- | --- | --- | --- | | closable | 是否显示右上角的关闭按钮 | boolean | true | | destroyOnClose | 关闭时销毁 Drawer 里的子元素 | boolean | false | -| getContainer | 指定 Drawer 挂载的 HTML 节点 | HTMLElement \| `() => HTMLElement` \| selectors  | 'body' | +| getContainer | 指定 Drawer 挂载的 HTML 节点 | HTMLElement \| `() => HTMLElement` \| Selectors | 'body' | | maskClosable | 点击蒙层是否允许关闭 | boolean | true | | mask | 是否展示遮罩 | Boolean | true | | maskStyle | 遮罩样式 | object | {} | diff --git a/components/dropdown/dropdown.tsx b/components/dropdown/dropdown.tsx index 17a9a0ddfa..edaa74a0bb 100644 --- a/components/dropdown/dropdown.tsx +++ b/components/dropdown/dropdown.tsx @@ -18,6 +18,8 @@ export interface DropDownProps { className?: string; transitionName?: string; placement?: 'topLeft' | 'topCenter' | 'topRight' | 'bottomLeft' | 'bottomCenter' | 'bottomRight'; + overlayClassName?: string; + overlayStyle?: React.CSSProperties; forceRender?: boolean; mouseEnterDelay?: number; mouseLeaveDelay?: number; diff --git a/components/input/style/mixin.less b/components/input/style/mixin.less index 465c6beea4..21a3c42602 100644 --- a/components/input/style/mixin.less +++ b/components/input/style/mixin.less @@ -304,7 +304,7 @@ & > .@{ant-prefix}-mention-wrapper .@{ant-prefix}-mention-editor, & > .@{ant-prefix}-time-picker .@{ant-prefix}-time-picker-input { border-radius: 0; - border-right-width: 1px; + border-right-width: @border-width-base; border-right-color: transparent; &:hover { .hover(); @@ -335,7 +335,7 @@ & > .@{ant-prefix}-time-picker:last-child .@{ant-prefix}-time-picker-input { border-top-right-radius: @border-radius-base; border-bottom-right-radius: @border-radius-base; - border-right-width: 1px; + border-right-width: @border-width-base; border-right-color: @input-border-color; &:hover { .hover(); diff --git a/components/locale-provider/LocaleReceiver.tsx b/components/locale-provider/LocaleReceiver.tsx index 5b12bc658b..ff1133090d 100644 --- a/components/locale-provider/LocaleReceiver.tsx +++ b/components/locale-provider/LocaleReceiver.tsx @@ -1,17 +1,26 @@ import * as React from 'react'; import * as PropTypes from 'prop-types'; +import defaultLocaleData from './default'; export interface LocaleReceiverProps { - componentName: string; - defaultLocale: object | Function; + componentName?: string; + defaultLocale?: object | Function; children: (locale: object, localeCode?: string) => React.ReactElement; } +interface LocaleInterface { + [key: string]: any; +} + export interface LocaleReceiverContext { - antLocale?: { [key: string]: any }; + antLocale?: LocaleInterface; } export default class LocaleReceiver extends React.Component { + static defaultProps = { + componentName: 'global', + }; + static contextTypes = { antLocale: PropTypes.object, }; @@ -20,10 +29,12 @@ export default class LocaleReceiver extends React.Component getLocale() { const { componentName, defaultLocale } = this.props; + const locale: object | Function = + defaultLocale || (defaultLocaleData as LocaleInterface)[componentName || 'global']; const { antLocale } = this.context; - const localeFromContext = antLocale && antLocale[componentName]; + const localeFromContext = componentName && antLocale ? antLocale[componentName] : {}; return { - ...(typeof defaultLocale === 'function' ? defaultLocale() : defaultLocale), + ...(typeof locale === 'function' ? locale() : locale), ...(localeFromContext || {}), }; } @@ -33,7 +44,7 @@ export default class LocaleReceiver extends React.Component const localeCode = antLocale && antLocale.locale; // Had use LocaleProvide but didn't set locale if (antLocale && antLocale.exist && !localeCode) { - return 'en-us'; + return defaultLocaleData.locale; } return localeCode; } diff --git a/components/locale-provider/__tests__/__snapshots__/index.test.js.snap b/components/locale-provider/__tests__/__snapshots__/index.test.js.snap index bb97ad2977..7b74a9bb62 100644 --- a/components/locale-provider/__tests__/__snapshots__/index.test.js.snap +++ b/components/locale-provider/__tests__/__snapshots__/index.test.js.snap @@ -110192,14 +110192,14 @@ exports[`Locale Provider should display the text as ku-iq 1`] = ` role="button" title="Meh hilbijêre" > - 9월 + ئەیلوول - 2017 + ٢٠١٧ - 일 + ش - 월 + ی - 화 + د - 수 + س - 목 + چ - 금 + پ - 토 + ه @@ -110313,7 +110313,20 @@ exports[`Locale Provider should display the text as ku-iq 1`] = ` +
+ 26 +
+ +
- -
- 2 -
- +
+ 2 +
+ +
- -
- 9 -
- +
+ 9 +
+ +
- -
- 16 -
- +
+ 16 +
+ +
- -
- 23 -
- +
+ 23 +
+ +
+ +
- -
- -
- 7 -
- @@ -110894,7 +110894,7 @@ exports[`Locale Provider should display the text as ku-iq 1`] = ` Îro @@ -111831,14 +111831,14 @@ exports[`Locale Provider should display the text as ku-iq 1`] = ` role="button" title="Meh hilbijêre" > - 9월 + ئەیلوول - 2017 + ٢٠١٧
@@ -111858,78 +111858,78 @@ exports[`Locale Provider should display the text as ku-iq 1`] = ` - 일 + ش - 월 + ی - 화 + د - 수 + س - 목 + چ - 금 + پ - 토 + ه @@ -111944,7 +111944,20 @@ exports[`Locale Provider should display the text as ku-iq 1`] = ` +
+ 26 +
+ +
- -
- 2 -
- +
+ 2 +
+ +
- -
- 9 -
- +
+ 9 +
+ +
- -
- 16 -
- +
+ 16 +
+ +
- -
- 23 -
- +
+ 23 +
+ +
+ +
- -
- -
- 7 -
- @@ -112556,14 +112556,14 @@ exports[`Locale Provider should display the text as ku-iq 1`] = ` role="button" title="Meh hilbijêre" > - 10월 + تشرینی یەكەم - 2017 + ٢٠١٧ - 일 + ش - 월 + ی - 화 + د - 수 + س - 목 + چ - 금 + پ - 토 + ه @@ -112674,10 +112674,23 @@ exports[`Locale Provider should display the text as ku-iq 1`] = ` class="" role="row" > + +
+ 30 +
+
- -
- 7 -
- +
+ 7 +
+ +
- -
- 14 -
- +
+ 14 +
+ +
- -
- 21 -
- +
+ 21 +
+ +
- -
- 28 -
- +
+ 28 +
+ +
- -
- 4 -
- +
+ 4 +
+ +
- -
- 11 -
- @@ -113622,9 +113622,9 @@ exports[`Locale Provider should display the text as ku-iq 1`] = `
- 9월 + ئەیلوول
- 일 + ش - 월 + ی - 화 + د - 수 + س - 목 + چ - 금 + پ - 토 + ه @@ -113800,7 +113800,25 @@ exports[`Locale Provider should display the text as ku-iq 1`] = ` +
+
+ 26 +
+
+
+ +
+ +
- -
+ +
- -
+ +
- -
+ +
- -
+ +
- -
- -
-
- 07 -
-
-
- diff --git a/components/locale-provider/default.tsx b/components/locale-provider/default.tsx index 6cf8d338f5..e9c9925a67 100644 --- a/components/locale-provider/default.tsx +++ b/components/locale-provider/default.tsx @@ -9,6 +9,10 @@ export default { DatePicker, TimePicker, Calendar, + // locales for all comoponents + global: { + placeholder: 'Please select', + }, Table: { filterTitle: 'Filter menu', filterConfirm: 'OK', diff --git a/components/locale-provider/index.tsx b/components/locale-provider/index.tsx index 820e010183..3a0ba28bb0 100644 --- a/components/locale-provider/index.tsx +++ b/components/locale-provider/index.tsx @@ -20,7 +20,7 @@ export interface Locale { export interface LocaleProviderProps { locale: Locale; - children?: React.ReactElement; + children?: React.ReactNode; } function setMomentLocale(locale: Locale) { diff --git a/components/locale-provider/zh_CN.tsx b/components/locale-provider/zh_CN.tsx index a2cc8d6e01..de5d4dd8ad 100644 --- a/components/locale-provider/zh_CN.tsx +++ b/components/locale-provider/zh_CN.tsx @@ -9,6 +9,10 @@ export default { DatePicker, TimePicker, Calendar, + // locales for all comoponents + global: { + placeholder: '请选择', + }, Table: { filterTitle: '筛选', filterConfirm: '确定', diff --git a/components/menu/MenuItem.tsx b/components/menu/MenuItem.tsx index 44ddb77fde..b4fe822245 100644 --- a/components/menu/MenuItem.tsx +++ b/components/menu/MenuItem.tsx @@ -21,6 +21,7 @@ class MenuItem extends React.Component { static isMenuItem = 1; context: any; private menuItem: any; + onKeyDown = (e: React.MouseEvent) => { this.menuItem.onKeyDown(e); }; diff --git a/components/menu/SubMenu.tsx b/components/menu/SubMenu.tsx index 8eaa42e023..b168c07aa9 100644 --- a/components/menu/SubMenu.tsx +++ b/components/menu/SubMenu.tsx @@ -11,6 +11,7 @@ class SubMenu extends React.Component { static isSubMenu = 1; context: any; private subMenu: any; + onKeyDown = (e: React.MouseEvent) => { this.subMenu.onKeyDown(e); }; diff --git a/components/select/__tests__/__snapshots__/demo.test.js.snap b/components/select/__tests__/__snapshots__/demo.test.js.snap index dd95f4e0f3..eac74828b3 100644 --- a/components/select/__tests__/__snapshots__/demo.test.js.snap +++ b/components/select/__tests__/__snapshots__/demo.test.js.snap @@ -355,6 +355,55 @@ exports[`renders ./components/select/demo/custom-dropdown-menu.md correctly 1`]
`; +exports[`renders ./components/select/demo/hide-selected.md correctly 1`] = ` +
+ +
+`; + exports[`renders ./components/select/demo/label-in-value.md correctly 1`] = `
{ + this.setState({ selectedItems }); + }; + + render() { + const { selectedItems } = this.state; + const filteredOptions = OPTIONS.filter(o => !selectedItems.includes(o)); + return ( + + ); + } +} + +ReactDOM.render(, mountNode); +```` diff --git a/components/steps/index.en-US.md b/components/steps/index.en-US.md index 0842ad1b57..e236f6aae7 100644 --- a/components/steps/index.en-US.md +++ b/components/steps/index.en-US.md @@ -27,6 +27,7 @@ The whole of the step bar. | Property | Description | Type | Default | | -------- | ----------- | ---- | ------- | +| className | additional class to Steps | string | - | | current | to set the current step, counting from 0. You can overwrite this state by using `status` of `Step` | number | 0 | | direction | to specify the direction of the step bar, `horizontal` or `vertical` | string | `horizontal` | | labelPlacement | place title and description with `horizontal` or `vertical` direction | string | `horizontal` | diff --git a/components/steps/index.tsx b/components/steps/index.tsx index 07bfee0197..a2d871e5f2 100644 --- a/components/steps/index.tsx +++ b/components/steps/index.tsx @@ -7,6 +7,7 @@ import { ConfigConsumer, ConfigConsumerProps } from '../config-provider'; export interface StepsProps { prefixCls?: string; iconPrefix?: string; + className?: string; current?: number; initial?: number; labelPlacement?: 'horizontal' | 'vertical'; diff --git a/components/steps/index.zh-CN.md b/components/steps/index.zh-CN.md index 42bf8aade1..7df5b45ef0 100644 --- a/components/steps/index.zh-CN.md +++ b/components/steps/index.zh-CN.md @@ -28,6 +28,7 @@ title: Steps | 参数 | 说明 | 类型 | 默认值 | | --- | --- | --- | --- | +| className | 步骤条类名 | string | - | | current | 指定当前步骤,从 0 开始记数。在子 Step 元素中,可以通过 `status` 属性覆盖状态 | number | 0 | | direction | 指定步骤条方向。目前支持水平(`horizontal`)和竖直(`vertical`)两种方向 | string | horizontal | | labelPlacement | 指定标签放置位置,默认水平放图标右侧,可选 `vertical` 放图标下方 | string | `horizontal` | diff --git a/components/style/themes/default.less b/components/style/themes/default.less index bd6818cd37..c235ea66c9 100644 --- a/components/style/themes/default.less +++ b/components/style/themes/default.less @@ -49,6 +49,7 @@ @heading-color-dark : fade(@white, 100%); @text-color-dark : fade(@white, 85%); @text-color-secondary-dark: fade(@white, 65%); + @font-variant-base : tabular-nums; @font-size-base : 14px; @font-size-lg : @font-size-base + 2px; @@ -119,9 +120,7 @@ @disabled-color-dark : fade(#fff, 35%); // Shadow -@shadow-color : fade(@black, 15%); @shadow-color-inverse : @component-background; -@box-shadow-base : @shadow-1-down; @shadow-1-up : 0 -2px 8px @shadow-color; @shadow-1-down : 0 2px 8px @shadow-color; @shadow-1-left : -2px 0 8px @shadow-color; @@ -289,8 +288,6 @@ //** Tooltip text color @tooltip-color: #fff; //** Tooltip background color -@tooltip-bg: fade(@black, 75%); -//** Tooltip arrow width @tooltip-arrow-width: 5px; //** Tooltip distance with trigger @tooltip-distance: @tooltip-arrow-width - 1px + 4px; @@ -405,11 +402,7 @@ @card-padding-base: 24px; @card-padding-wider: 32px; @card-actions-background: @background-color-light; -@card-shadow: 0 2px 8px fade(@black, 9%); @card-background: #cfd8dc; - -// Comment -// --- @comment-padding-base: 16px 0; @comment-nest-indent: 44px; @comment-author-name-color: @text-color-secondary; @@ -495,7 +488,7 @@ @slider-handle-color-tooltip-open: @primary-color; @slider-dot-border-color: @border-color-split; @slider-dot-border-color-active: tint(@primary-color, 50%); -@slider-disabled-color: @disabled-color; + @slider-disabled-background-color: @component-background; // Tree diff --git a/components/table/Table.tsx b/components/table/Table.tsx index 3c79c198ee..d5bc2a4cf2 100755 --- a/components/table/Table.tsx +++ b/components/table/Table.tsx @@ -891,8 +891,8 @@ export default class Table extends React.Component, TableState< } if (!(title instanceof Function) && typeof title !== 'string' && typeof title !== 'number') { const props = title.props; - const { children } = props; if (props && props.children) { + const { children } = props; return this.getColumnTitle(children, props); } } else { diff --git a/components/table/style/index.less b/components/table/style/index.less index f628cf30d9..40f3245205 100644 --- a/components/table/style/index.less +++ b/components/table/style/index.less @@ -410,6 +410,7 @@ background: @component-background; border-radius: @border-radius-base; box-shadow: @box-shadow-base; + position: relative; .@{ant-prefix}-dropdown-menu { border: 0; diff --git a/components/transfer/index.en-US.md b/components/transfer/index.en-US.md index cd455455a5..c9ac0b1a07 100644 --- a/components/transfer/index.en-US.md +++ b/components/transfer/index.en-US.md @@ -28,7 +28,7 @@ One or more elements can be selected from either column, one click on the proper | lazy | property of [react-lazy-load](https://github.com/loktar00/react-lazy-load) for lazy rendering items. Turn off it by set to `false`. | object\|boolean | `{ height: 32, offset: 32 }` | | listStyle | A custom CSS style used for rendering the transfer columns. | object | | | locale | i18n text including filter, empty text, item unit, etc | object | `{ itemUnit: 'item', itemsUnit: 'items', notFoundContent: 'The list is empty', searchPlaceholder: 'Search here' }` | -| operations | A set of operations that are sorted from bottom to top. | string\[] | ['>', '<'] | +| operations | A set of operations that are sorted from top to bottom. | string\[] | ['>', '<'] | | operationStyle | A custom CSS style used for rendering the operations column. | object | | | render | The function to generate the item shown on a column. Based on an record (element of the dataSource array), this function should return a React element which is generated from that record. Also, it can return a plain object with `value` and `label`, `label` is a React element and `value` is for title | Function(record) | | | selectedKeys | A set of keys of selected items. | string\[] | \[] | diff --git a/components/transfer/index.zh-CN.md b/components/transfer/index.zh-CN.md index 4a7be47f91..a5bc210cbb 100644 --- a/components/transfer/index.zh-CN.md +++ b/components/transfer/index.zh-CN.md @@ -30,7 +30,7 @@ title: Transfer | lazy | Transfer 使用了 [react-lazy-load](https://github.com/loktar00/react-lazy-load) 优化性能,这里可以设置相关参数。设为 `false` 可以关闭懒加载。 | object\|boolean | `{ height: 32, offset: 32 }` | | listStyle | 两个穿梭框的自定义样式 | object | | | locale | 各种语言 | object | `{ itemUnit: '项', itemsUnit: '项', notFoundContent: '列表为空', searchPlaceholder: '请输入搜索内容' }` | -| operations | 操作文案集合,顺序从下至上 | string\[] | ['>', '<'] | +| operations | 操作文案集合,顺序从上至下 | string\[] | ['>', '<'] | | render | 每行数据渲染函数,该函数的入参为 `dataSource` 中的项,返回值为 ReactElement。或者返回一个普通对象,其中 `label` 字段为 ReactElement,`value` 字段为 title | Function(record) | | | selectedKeys | 设置哪些项应该被选中 | string\[] | \[] | | showSearch | 是否显示搜索框 | boolean | false | diff --git a/components/upload/UploadList.tsx b/components/upload/UploadList.tsx index 5d3ba27e50..12b50043d8 100644 --- a/components/upload/UploadList.tsx +++ b/components/upload/UploadList.tsx @@ -9,7 +9,7 @@ import { ConfigConsumer, ConfigConsumerProps } from '../config-provider'; const imageTypes: string[] = ['image', 'webp', 'png', 'svg', 'gif', 'jpg', 'jpeg', 'bmp']; // https://developer.mozilla.org/en-US/docs/Web/API/FileReader/readAsDataURL -const previewFile = (file: File, callback: Function) => { +const previewFile = (file: File | Blob, callback: Function) => { if (file.type && !imageTypes.includes(file.type)) { callback(''); } diff --git a/components/upload/__tests__/upload.test.js b/components/upload/__tests__/upload.test.js index c3fdbf68e5..b8ecd2bf2b 100644 --- a/components/upload/__tests__/upload.test.js +++ b/components/upload/__tests__/upload.test.js @@ -56,6 +56,41 @@ describe('Upload', () => { }); }); + it('upload promise return file in beforeUpload', done => { + const data = jest.fn(); + const props = { + action: 'http://upload.com', + beforeUpload: file => + new Promise(resolve => + setTimeout(() => { + const result = file; + result.name = 'test.png'; + resolve(result); + }, 100), + ), + data, + onChange: ({ file }) => { + if (file.status !== 'uploading') { + expect(data).toBeCalled(); + expect(file.name).toEqual('test.png'); + done(); + } + }, + }; + + const wrapper = mount( + + + , + ); + + wrapper.find('input').simulate('change', { + target: { + files: [{ file: 'foo.png' }], + }, + }); + }); + it('should not stop upload when return value of beforeUpload is false', done => { const fileList = [ { diff --git a/components/upload/index.en-US.md b/components/upload/index.en-US.md index 2e0cae8ce8..4bd57fa824 100644 --- a/components/upload/index.en-US.md +++ b/components/upload/index.en-US.md @@ -20,7 +20,7 @@ Uploading is the process of publishing information (web pages, text, pictures, v | Property | Description | Type | Default | | -------- | ----------- | ---- | ------- | -| accept | File types that can be accepted. See [input accept Attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#attr-accept) | string | - | +| accept | File types that can be accepted. See [input accept Attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file#accept) | string | - | | action | Uploading URL | string\|(file) => `Promise` | - | | directory | support upload whole directory ([caniuse](https://caniuse.com/#feat=input-file-directory)) | boolean | false | | beforeUpload | Hook function which will be executed before uploading. Uploading will be stopped with `false` or a rejected Promise returned. **Warning:this function is not supported in IE9**。 | (file, fileList) => `boolean | Promise` | - | diff --git a/components/upload/index.zh-CN.md b/components/upload/index.zh-CN.md index 0ad9638dfa..032d56379a 100644 --- a/components/upload/index.zh-CN.md +++ b/components/upload/index.zh-CN.md @@ -21,10 +21,10 @@ title: Upload | 参数 | 说明 | 类型 | 默认值 | | --- | --- | --- | --- | -| accept | 接受上传的文件类型, 详见 [input accept Attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#attr-accept) | string | 无 | +| accept | 接受上传的文件类型, 详见 [input accept Attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file#accept) | string | 无 | | action | 上传的地址 | string\|(file) => `Promise` | 无 | | directory | 支持上传文件夹([caniuse](https://caniuse.com/#feat=input-file-directory))| boolean | false | -| beforeUpload | 上传文件之前的钩子,参数为上传的文件,若返回 `false` 则停止上传。支持返回一个 Promise 对象,Promise 对象 reject 时则停止上传,resolve 时开始上传。**注意:IE9 不支持该方法**。 | (file, fileList) => `boolean | Promise` | 无 | +| beforeUpload | 上传文件之前的钩子,参数为上传的文件,若返回 `false` 则停止上传。支持返回一个 Promise 对象,Promise 对象 reject 时则停止上传,resolve 时开始上传( resolve 传入 `File` 或 `Blob` 对象则上传 resolve 传入对象)。**注意:IE9 不支持该方法**。 | (file, fileList) => `boolean | Promise` | 无 | | customRequest | 通过覆盖默认的上传行为,可以自定义自己的上传实现 | Function | 无 | | data | 上传所需参数或返回上传参数的方法 | object\|(file) => object | 无 | | defaultFileList | 默认已经上传的文件列表 | object\[] | 无 | diff --git a/docs/react/faq.en-US.md b/docs/react/faq.en-US.md index f5defad938..f65755544d 100644 --- a/docs/react/faq.en-US.md +++ b/docs/react/faq.en-US.md @@ -49,7 +49,7 @@ Try [babel-plugin-import](https://github.com/ant-design/babel-plugin-import), or ```jsx import Menu from 'antd/lib/menu'; -import 'antd/lib/button/style/css'; +import 'antd/lib/menu/style/css'; ``` or (ES6 way with tree shaking): diff --git a/docs/react/faq.zh-CN.md b/docs/react/faq.zh-CN.md index 06b773109a..a047578613 100644 --- a/docs/react/faq.zh-CN.md +++ b/docs/react/faq.zh-CN.md @@ -49,7 +49,7 @@ https://ant.design/components/select/#Select-props ```jsx import Menu from 'antd/lib/menu'; -import 'antd/lib/button/style/css'; +import 'antd/lib/menu/style/css'; ``` 或者(ES6 支持的 tree shaking 方式): diff --git a/docs/react/recommendation.en-US.md b/docs/react/recommendation.en-US.md index a1bc5ddfce..d6b2a3564e 100644 --- a/docs/react/recommendation.en-US.md +++ b/docs/react/recommendation.en-US.md @@ -24,7 +24,7 @@ Top Progress Bar | [nprogress](https://github.com/rstacruz/nprogress) i18n | [react-intl](https://github.com/yahoo/react-intl) Code highlight | [react-syntax-highlighter](https://github.com/conorhastings/react-syntax-highlighter) Markdown renderer | [react-markdown](http://rexxars.github.io/react-markdown/) -Infinite Scroll | [react-virtualized](https://github.com/bvaughn/react-virtualized) +Infinite Scroll | [react-virtualized](https://github.com/bvaughn/react-virtualized) [antd-table-infinity](https://github.com/Leonard-Li777/antd-table-infinity) Map | [react-google-maps](https://github.com/tomchentw/react-google-maps) [google-map-react](https://github.com/istarkov/google-map-react) [react-amap](https://github.com/ElemeFE/react-amap) Context Menu | [react-contextmenu](https://github.com/vkbansal/react-contextmenu/) [react-contexify](https://github.com/fkhadra/react-contexify) Emoji | [emoji-mart](https://github.com/missive/emoji-mart) diff --git a/docs/react/recommendation.zh-CN.md b/docs/react/recommendation.zh-CN.md index 7133eac413..f6c051b927 100644 --- a/docs/react/recommendation.zh-CN.md +++ b/docs/react/recommendation.zh-CN.md @@ -24,7 +24,7 @@ title: 社区精选组件 应用国际化 | [react-intl](https://github.com/yahoo/react-intl) 代码高亮 | [react-syntax-highlighter](https://github.com/conorhastings/react-syntax-highlighter) Markdown 渲染 | [react-markdown](http://rexxars.github.io/react-markdown/) -无限滚动 | [react-virtualized](https://github.com/bvaughn/react-virtualized) +无限滚动 | [react-virtualized](https://github.com/bvaughn/react-virtualized) [antd-table-infinity](https://github.com/Leonard-Li777/antd-table-infinity) 地图 | [react-google-maps](https://github.com/tomchentw/react-google-maps) [google-map-react](https://github.com/istarkov/google-map-react) [react-amap 高德](https://github.com/ElemeFE/react-amap) 右键菜单 | [react-contextmenu](https://github.com/vkbansal/react-contextmenu/) [react-contexify](https://github.com/fkhadra/react-contexify) Emoji | [emoji-mart](https://github.com/missive/emoji-mart) diff --git a/package.json b/package.json index efe4fec053..f079fe7383 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "antd", - "version": "3.11.0", + "version": "3.11.2", "title": "Ant Design", "description": "An enterprise-class UI design language and React-based implementation", "homepage": "http://ant.design/", @@ -94,21 +94,21 @@ "devDependencies": { "@types/classnames": "^2.2.6", "@types/prop-types": "^15.5.6", - "@types/react": "~16.7.11", - "@types/react-dom": "^16.0.8", - "@types/react-intl": "^2.3.11", + "@types/react": "~16.7.13", + "@types/react-dom": "^16.0.11", + "@types/react-intl": "^2.3.14", "@types/react-slick": "^0.23.2", "@yesmeck/offline-plugin": "^5.0.5", "ansi-styles": "^3.2.1", "ant-design-palettes": "^1.1.3", "antd-theme-generator": "^1.1.4", - "antd-tools": "^5.2.2", + "antd-tools": "^6.3.0", "babel-cli": "^6.26.0", "babel-eslint": "^10.0.1", - "bisheng": "^0.28.4", + "bisheng": "^1.0.0", "bisheng-plugin-antd": "^0.17.0", "bisheng-plugin-description": "^0.1.4", - "bisheng-plugin-react": "^0.6.3", + "bisheng-plugin-react": "^1.0.0", "bisheng-plugin-toc": "^0.4.4", "commander": "^2.18.0", "core-js": "^2.5.7", @@ -151,8 +151,8 @@ "react": "^16.5.2", "react-color": "^2.14.1", "react-copy-to-clipboard": "^5.0.1", - "react-dnd": "^6.0.0", - "react-dnd-html5-backend": "^6.0.0", + "react-dnd": "^7.0.2", + "react-dnd-html5-backend": "^7.0.2", "react-document-title": "^2.0.3", "react-dom": "^16.5.2", "react-github-button": "^0.1.11", @@ -173,7 +173,7 @@ "stylelint": "~9.6.0", "stylelint-config-prettier": "^4.0.0", "stylelint-config-standard": "^18.2.0", - "typescript": "~3.1.1", + "typescript": "~3.2.2", "unified": "^7.0.0", "xhr-mock": "^2.4.1", "xhr2": "^0.1.4" @@ -217,24 +217,27 @@ "lint-staged": { "components/**/*.tsx": [ "npm run lint-staged:ts", - "node ./scripts/lint-prettier.js" + "node ./scripts/pre-prettier.js", + "git add" ], "{tests,site,scripts,components}/**/*.{js,jsx}": [ "npm run lint-staged:es", - "node ./scripts/lint-prettier.js" + "node ./scripts/pre-prettier.js", + "git add" ], "{site,components}/**/*.less": [ "stylelint --syntax less", - "node ./scripts/lint-prettier.js" + "node ./scripts/pre-prettier.js", + "git add" ], "components/*/demo/*.md": [ - "npm run lint-staged:demo", - "node ./scripts/lint-prettier.js" + "npm run lint-staged:demo" ] }, "sideEffects": [ "dist/*", "es/**/style/*", - "lib/**/style/*" + "lib/**/style/*", + "*.less" ] } diff --git a/scripts/pre-prettier.js b/scripts/pre-prettier.js new file mode 100644 index 0000000000..d7bd4c4baf --- /dev/null +++ b/scripts/pre-prettier.js @@ -0,0 +1,47 @@ +/** + * copy to https://github.com/facebook/react/blob/master/scripts/prettier/index.js + * prettier api doc https://prettier.io/docs/en/api.html + *----------*****-------------- + * pre commit prettier file + *----------*****-------------- + */ + +const prettier = require('prettier'); +const fs = require('fs'); + +const prettierConfigPath = require.resolve('../.prettierrc'); + +const files = process.argv.slice(2); + +let didError = false; + +files.forEach(file => { + const options = prettier.resolveConfig.sync(file, { + config: prettierConfigPath, + }); + try { + const fileInfo = prettier.getFileInfo.sync(file); + if (fileInfo.ignored) { + return; + } + const input = fs.readFileSync(file, 'utf8'); + const withParserOptions = { + ...options, + parser: fileInfo.inferredParser, + }; + const output = prettier.format(input, withParserOptions); + if (output !== input) { + fs.writeFileSync(file, output, 'utf8'); + // eslint-disable-next-line no-console + console.log(`\x1b[34m ${file} is prettier`); + } + } catch (e) { + didError = true; + } +}); + +if (didError) { + process.exit(1); +} +// eslint-disable-next-line no-console +console.log('\x1b[32m prettier success!'); diff --git a/site/bisheng.config.js b/site/bisheng.config.js index 259df026a7..17cf4b2106 100644 --- a/site/bisheng.config.js +++ b/site/bisheng.config.js @@ -83,6 +83,9 @@ module.exports = { doraConfig: { verbose: true, }, + lessConfig: { + javascriptEnabled: true, + }, webpackConfig(config) { // eslint-disable-next-line config.resolve.alias = { diff --git a/webpack.config.js b/webpack.config.js index 0a0f01ffa9..08d3c36c2d 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -1,8 +1,9 @@ /* eslint no-param-reassign: 0 */ // This config is for building dist files -const webpack = require('webpack'); // eslint-disable-line const getWebpackConfig = require('antd-tools/lib/getWebpackConfig'); +const { webpack } = getWebpackConfig; + // noParse still leave `require('./locale' + name)` in dist files // ignore is better: http://stackoverflow.com/q/25384360 function ignoreMomentLocale(webpackConfig) {