From b093d9d8b0d866e403ef30f2f7f606176fca5fdc Mon Sep 17 00:00:00 2001 From: Andrey G Date: Mon, 20 Mar 2017 14:02:39 +0300 Subject: [PATCH 01/55] *updates for RU locale (#5406) --- components/locale-provider/ru_RU.tsx | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/components/locale-provider/ru_RU.tsx b/components/locale-provider/ru_RU.tsx index 2d194a3eb..d0b52c015 100644 --- a/components/locale-provider/ru_RU.tsx +++ b/components/locale-provider/ru_RU.tsx @@ -22,6 +22,8 @@ export default { filterConfirm: 'OK', filterReset: 'Сбросить', emptyText: 'Нет данных', + selectAll: 'Выбрать всё', + selectInvert: 'Инвертировать выбор', }, Modal: { okText: 'OK', @@ -41,4 +43,10 @@ export default { Select: { notFoundContent: 'Ничего не найдено', }, + Upload: { + uploading: 'Закачиваю...', + removeFile: 'Удалить файл', + uploadError: 'Ошибка при закачке', + previewFile: 'Предпросмотр файл', + }, }; From 847515be3d6ce0da444e40abdc8f0762c7332279 Mon Sep 17 00:00:00 2001 From: afc163 Date: Tue, 21 Mar 2017 12:02:24 +0800 Subject: [PATCH 02/55] use latest eslint-plugin-react --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 0e42d99d2..ab95e817b 100644 --- a/package.json +++ b/package.json @@ -107,7 +107,7 @@ "eslint-plugin-import": "^2.1.0", "eslint-plugin-jsx-a11y": "^3.0.2", "eslint-plugin-markdown": "1.0.0-beta.4", - "eslint-plugin-react": "6.10.0", + "eslint-plugin-react": "^6.10.3", "eslint-tinker": "^0.4.0", "fetch-jsonp": "^1.0.3", "glob": "^7.1.1", From 93ec71ea58256eef44354fc643384e9c2502bf26 Mon Sep 17 00:00:00 2001 From: afc163 Date: Tue, 21 Mar 2017 15:21:40 +0800 Subject: [PATCH 03/55] fix whitespace required, close #5418 --- components/form/demo/register.md | 2 +- components/form/index.en-US.md | 1 + components/form/index.zh-CN.md | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/components/form/demo/register.md b/components/form/demo/register.md index 51666495b..3cce0d3eb 100644 --- a/components/form/demo/register.md +++ b/components/form/demo/register.md @@ -164,7 +164,7 @@ class RegistrationForm extends React.Component { hasFeedback > {getFieldDecorator('nickname', { - rules: [{ required: true, message: 'Please input your nickname!' }], + rules: [{ required: true, message: 'Please input your nickname!', whitespace: true }], })( )} diff --git a/components/form/index.en-US.md b/components/form/index.en-US.md index 04c060107..5e443a4f6 100644 --- a/components/form/index.en-US.md +++ b/components/form/index.en-US.md @@ -133,6 +133,7 @@ Property | Description | Type | Default Value message | validation error message | string | - type | built-in validation type, [available options](https://github.com/yiminghe/async-validator#type) | string | 'string' required | indicates whether field is required | boolean | `false` +whitespace | treat required fields that only contain whitespace as errors | boolean | `false` len | validate an exact length of a field | number | - min | validate a min length of a field | number | - max | validate a max length of a field | number | - diff --git a/components/form/index.zh-CN.md b/components/form/index.zh-CN.md index aa6bb1419..c28929757 100644 --- a/components/form/index.zh-CN.md +++ b/components/form/index.zh-CN.md @@ -134,6 +134,7 @@ CustomizedForm = Form.create({})(CustomizedForm); message | 校验文案 | string | - type | 内建校验类型,[可选项](https://github.com/yiminghe/async-validator#type) | string | 'string' required | 是否必选 | boolean | `false` +whitespace | 必选时,空格是否会被视为错误 | boolean | `false` len | 字段长度 | number | - min | 最小长度 | number | - max | 最大长度 | number | - From e5fff4fad68acea2125c7f6d1f40d0eb6603e9ad Mon Sep 17 00:00:00 2001 From: Conway Anderson Date: Tue, 21 Mar 2017 00:39:37 -0700 Subject: [PATCH 04/55] Clarity update for customize-theme.en-US.md (#5411) First attempt at making the docs for the recommended form of theme customization more specific. The goal is to make this section more accessible to beginners. --- docs/react/customize-theme.en-US.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/react/customize-theme.en-US.md b/docs/react/customize-theme.en-US.md index 187ab5cc0..52461cb96 100644 --- a/docs/react/customize-theme.en-US.md +++ b/docs/react/customize-theme.en-US.md @@ -39,8 +39,9 @@ This approach is available only when using [antd-init](https://github.com/ant-de Note: -- Importing style from less files is necessary. Please specify `style` option of `babel-plugin-import` to be `true`. -- You should write `theme` field in [.roadhogrc](https://github.com/dvajs/dva-example-user-dashboard/commit/d6da33b3a6e18eb7f003752a4b00b5a660747c31) rather then `package.json` when using `dva-cli@0.7.0+`. +- Importing style from less files is necessary. Here's an example if you're using the `antd-demo` from [getting started](/docs/react/getting-started): in `index.js`, replace `import './index.css'` with `import 'antd/dist/antd.less'` +- Please specify the `style` option of `babel-plugin-import` to be `true`, instead of `css`. This is required for importing the `less` version of antd. This can be done in `webpack.config.js`. +- When using `dva-cli@0.7.0+`, you should add the `theme` block to [.roadhogrc](https://github.com/dvajs/dva-example-user-dashboard/commit/d6da33b3a6e18eb7f003752a4b00b5a660747c31) instead of `package.json`. - If you want to override `@icon-url`, the quotes must be contained in value like `"@icon-url": "'your-icon-font-path'"` ([A fix sample](https://github.com/visvadw/dvajs-user-dashboard/pull/2)). ### 2) Overriding Less variables (alternative way) From 351737a1aa84ddbbfdd85348d336e7e6e2a937c2 Mon Sep 17 00:00:00 2001 From: afc163 Date: Tue, 21 Mar 2017 15:55:14 +0800 Subject: [PATCH 05/55] update customize docs --- docs/react/customize-theme.en-US.md | 5 +++-- docs/react/customize-theme.zh-CN.md | 3 +++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/docs/react/customize-theme.en-US.md b/docs/react/customize-theme.en-US.md index 52461cb96..41d9cd9f5 100644 --- a/docs/react/customize-theme.en-US.md +++ b/docs/react/customize-theme.en-US.md @@ -39,8 +39,9 @@ This approach is available only when using [antd-init](https://github.com/ant-de Note: -- Importing style from less files is necessary. Here's an example if you're using the `antd-demo` from [getting started](/docs/react/getting-started): in `index.js`, replace `import './index.css'` with `import 'antd/dist/antd.less'` -- Please specify the `style` option of `babel-plugin-import` to be `true`, instead of `css`. This is required for importing the `less` version of antd. This can be done in `webpack.config.js`. +- Importing style from less files is necessary. + - If you import styles by specifying the `style` option of [babel-plugin-import](https://github.com/ant-design/babel-plugin-import), change it from `'css'` to `true`, which will importing the `less` version of antd. + - If you import styles from `'antd/dist/antd.css'`, change it to `antd/dist/antd.less`. - When using `dva-cli@0.7.0+`, you should add the `theme` block to [.roadhogrc](https://github.com/dvajs/dva-example-user-dashboard/commit/d6da33b3a6e18eb7f003752a4b00b5a660747c31) instead of `package.json`. - If you want to override `@icon-url`, the quotes must be contained in value like `"@icon-url": "'your-icon-font-path'"` ([A fix sample](https://github.com/visvadw/dvajs-user-dashboard/pull/2)). diff --git a/docs/react/customize-theme.zh-CN.md b/docs/react/customize-theme.zh-CN.md index 5a155827a..e4539310b 100644 --- a/docs/react/customize-theme.zh-CN.md +++ b/docs/react/customize-theme.zh-CN.md @@ -42,6 +42,9 @@ antd 的样式使用了 [Less](http://lesscss.org/) 作为开发语言,并定 注意: +- 样式必须加载 less 格式。 + - 如果你在使用 babel-plugin-import 的 `style` 配置来引入样式,需要将配置值从 `'css'` 改为 `true`,这样会引入 less 文件。 + - 如果你是通过 `'antd/dist/antd.css'` 引入样式的,改为 `antd/dist/antd.less`。 - 样式必须加载 less 格式。如果您使用了 `babel-plugin-import`,请将 style 属性配置为 `true`。 - `dva-cli@0.7.0+` 的 `theme` 属性需要写在 [.roadhogrc](https://github.com/dvajs/dva-example-user-dashboard/commit/d6da33b3a6e18eb7f003752a4b00b5a660747c31) 文件里。 - 如果要覆盖 `@icon-url` 变量,内容需要包括引号 `"@icon-url": "'your-icon-font-path'"`([修正示例](https://github.com/visvadw/dvajs-user-dashboard/pull/2))。 From d5be2581c50458ccd2155c0da9a4edb64db79a6c Mon Sep 17 00:00:00 2001 From: afc163 Date: Tue, 21 Mar 2017 15:59:31 +0800 Subject: [PATCH 06/55] update customize docs --- docs/react/customize-theme.zh-CN.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/react/customize-theme.zh-CN.md b/docs/react/customize-theme.zh-CN.md index e4539310b..0144c11ca 100644 --- a/docs/react/customize-theme.zh-CN.md +++ b/docs/react/customize-theme.zh-CN.md @@ -43,7 +43,7 @@ antd 的样式使用了 [Less](http://lesscss.org/) 作为开发语言,并定 注意: - 样式必须加载 less 格式。 - - 如果你在使用 babel-plugin-import 的 `style` 配置来引入样式,需要将配置值从 `'css'` 改为 `true`,这样会引入 less 文件。 + - 如果你在使用 [babel-plugin-import](https://github.com/ant-design/babel-plugin-import) 的 `style` 配置来引入样式,需要将配置值从 `'css'` 改为 `true`,这样会引入 less 文件。 - 如果你是通过 `'antd/dist/antd.css'` 引入样式的,改为 `antd/dist/antd.less`。 - 样式必须加载 less 格式。如果您使用了 `babel-plugin-import`,请将 style 属性配置为 `true`。 - `dva-cli@0.7.0+` 的 `theme` 属性需要写在 [.roadhogrc](https://github.com/dvajs/dva-example-user-dashboard/commit/d6da33b3a6e18eb7f003752a4b00b5a660747c31) 文件里。 From fd7b5bdcf4beeb9b1639809b1159fcee88963092 Mon Sep 17 00:00:00 2001 From: afc163 Date: Tue, 21 Mar 2017 16:31:45 +0800 Subject: [PATCH 07/55] Fix Table selectAll behavious inside Popover, close #5407 --- components/table/SelectionCheckboxAll.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/components/table/SelectionCheckboxAll.tsx b/components/table/SelectionCheckboxAll.tsx index aa5298f32..b5efc92da 100644 --- a/components/table/SelectionCheckboxAll.tsx +++ b/components/table/SelectionCheckboxAll.tsx @@ -176,7 +176,10 @@ export default class SelectionCheckboxAll extends React.Component - + trigger.parentNode as HTMLElement} + >
From 322e9efdc9db28bd92230fc690f1fdf5a72cf7cd Mon Sep 17 00:00:00 2001 From: afc163 Date: Tue, 21 Mar 2017 16:35:31 +0800 Subject: [PATCH 08/55] Fix getPopupContainer ts type --- components/cascader/index.tsx | 2 +- components/date-picker/index.tsx | 2 +- components/dropdown/dropdown.tsx | 2 +- components/mention/index.tsx | 2 +- components/select/index.tsx | 2 +- components/time-picker/index.tsx | 2 +- components/tooltip/index.tsx | 6 +++--- components/tree-select/interface.tsx | 2 +- 8 files changed, 10 insertions(+), 10 deletions(-) diff --git a/components/cascader/index.tsx b/components/cascader/index.tsx index 60048dd9c..e34dc6aa2 100644 --- a/components/cascader/index.tsx +++ b/components/cascader/index.tsx @@ -60,7 +60,7 @@ export interface CascaderProps { onPopupVisibleChange?: (popupVisible: boolean) => void; prefixCls?: string; inputPrefixCls?: string; - getPopupContainer?: (triggerNode: Element) => HTMLElement; + getPopupContainer?: (triggerNode?: HTMLElement) => HTMLElement; } function highlightKeyword(str: string, keyword: string, prefixCls: string) { diff --git a/components/date-picker/index.tsx b/components/date-picker/index.tsx index 3d03cd761..7fdee1dcb 100755 --- a/components/date-picker/index.tsx +++ b/components/date-picker/index.tsx @@ -19,7 +19,7 @@ export interface PickerProps { popupStyle?: React.CSSProperties; locale?: any; size?: 'large' | 'small' | 'default'; - getCalendarContainer?: (trigger: any) => React.ReactNode; + getCalendarContainer?: (triggerNode?: HTMLElement) => HTMLElement; open?: boolean; onOpenChange?: (status: boolean) => void; disabledDate?: (current: moment.Moment) => boolean; diff --git a/components/dropdown/dropdown.tsx b/components/dropdown/dropdown.tsx index 84ddd7ae6..fb4bff359 100644 --- a/components/dropdown/dropdown.tsx +++ b/components/dropdown/dropdown.tsx @@ -9,7 +9,7 @@ export interface DropDownProps { onVisibleChange?: (visible?: boolean) => void; visible?: boolean; align?: Object; - getPopupContainer?: () => HTMLElement; + getPopupContainer?: (triggerNode?: HTMLElement) => HTMLElement; prefixCls?: string; placement?: 'topLeft' | 'topCenter' | 'topRight' | 'bottomLeft' | 'bottomCenter' | 'bottomRight'; } diff --git a/components/mention/index.tsx b/components/mention/index.tsx index 16645c2e2..29a2dd8f5 100644 --- a/components/mention/index.tsx +++ b/components/mention/index.tsx @@ -19,7 +19,7 @@ export interface MentionProps { multiLines?: Boolean; prefix?: string; placeholder?: string; - getSuggestionContainer?: Function; + getSuggestionContainer?: (triggerNode?: HTMLElement) => HTMLElement; onFocus?: Function; onBlur?: Function; } diff --git a/components/select/index.tsx b/components/select/index.tsx index c96ab6ce2..44cd08b0d 100755 --- a/components/select/index.tsx +++ b/components/select/index.tsx @@ -35,7 +35,7 @@ export interface SelectProps extends AbstractSelectProps { optionFilterProp?: string; defaultActiveFirstOption?: boolean; labelInValue?: boolean; - getPopupContainer?: (triggerNode: React.ReactNode) => React.ReactNode | HTMLElement; + getPopupContainer?: (triggerNode?: HTMLElement) => HTMLElement; dropdownStyle?: React.CSSProperties; dropdownMenuStyle?: React.CSSProperties; onChange?: (value: SelectValue) => void; diff --git a/components/time-picker/index.tsx b/components/time-picker/index.tsx index dd0a029b4..160a0926d 100644 --- a/components/time-picker/index.tsx +++ b/components/time-picker/index.tsx @@ -20,7 +20,7 @@ export interface TimePickerProps { disabledMinutes?: (selectedHour: number) => number[]; disabledSeconds?: (selectedHour: number, selectedMinute: number) => number[]; style?: React.CSSProperties; - getPopupContainer?: (trigger: any) => any; + getPopupContainer?: (triggerNode: HTMLElement) => HTMLElement; addon?: Function; } diff --git a/components/tooltip/index.tsx b/components/tooltip/index.tsx index edb0c1f53..6756cc377 100644 --- a/components/tooltip/index.tsx +++ b/components/tooltip/index.tsx @@ -24,9 +24,9 @@ export interface AbstractTooltipProps { trigger?: 'hover' | 'focus' | 'click'; openClassName?: string; arrowPointAtCenter?: boolean; - // getTooltipContainer had been rename to getPopupDomNode - getTooltipContainer?: (triggerNode: Element) => HTMLElement; - getPopupContainer?: (triggerNode: Element) => HTMLElement; + // getTooltipContainer had been rename to getPopupContainer + getTooltipContainer?: (triggerNode?: HTMLElement) => HTMLElement; + getPopupContainer?: (triggerNode?: HTMLElement) => HTMLElement; children?: React.ReactElement; } diff --git a/components/tree-select/interface.tsx b/components/tree-select/interface.tsx index 7db3b39d7..e4778d277 100644 --- a/components/tree-select/interface.tsx +++ b/components/tree-select/interface.tsx @@ -39,5 +39,5 @@ export interface TreeSelectProps { notFoundContent?: React.ReactNode; labelInValue?: boolean; treeCheckStrictly?: boolean; - getPopupContainer?: (triggerNode: React.ReactNode) => HTMLElement; + getPopupContainer?: (triggerNode?: HTMLElement) => HTMLElement; } From 48b9055605fc2747636eaccbea438304fe6eb718 Mon Sep 17 00:00:00 2001 From: afc163 Date: Tue, 21 Mar 2017 19:16:50 +0800 Subject: [PATCH 09/55] fix carousel demo --- components/carousel/demo/basic.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/carousel/demo/basic.md b/components/carousel/demo/basic.md index 935826133..6ca1741c1 100644 --- a/components/carousel/demo/basic.md +++ b/components/carousel/demo/basic.md @@ -31,7 +31,7 @@ ReactDOM.render( ```` ````css -// For demo +/* For demo */ .ant-carousel .slick-slide { text-align: center; height: 160px; From 610452ea8dba6197d7fc626588fa7cbe1b5107ba Mon Sep 17 00:00:00 2001 From: afc163 Date: Wed, 22 Mar 2017 11:17:37 +0800 Subject: [PATCH 10/55] update recommendation list --- docs/react/recommendation.en-US.md | 4 +++- docs/react/recommendation.zh-CN.md | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/docs/react/recommendation.en-US.md b/docs/react/recommendation.en-US.md index 5282b041c..c7bb2b882 100644 --- a/docs/react/recommendation.en-US.md +++ b/docs/react/recommendation.en-US.md @@ -9,7 +9,7 @@ Category | Recommanded Components ---------|----------------------- Router | [react-router](https://github.com/ReactTraining/react-router) Layout | [react-blocks](http://whoisandie.github.io/react-blocks/) -Drag and drop | [react-dnd](https://github.com/gaearon/react-dnd) +Drag and drop | [react-dnd](https://github.com/gaearon/react-dnd) [react-draggable](https://github.com/mzabriskie/react-draggable) Code Editor | [react-codemirror](https://github.com/JedWatson/react-codemirror) Rich Text Editor | [react-quill](https://github.com/zenoamaro/react-quill) [react-draft-wysiwyg](https://github.com/jpuri/react-draft-wysiwyg) Color Picker | [rc-color-picker](https://github.com/react-component/color-picker) [react-color](http://casesandberg.github.io/react-color/) @@ -20,6 +20,8 @@ Icons | [react-fa](https://github.com/andreypopp/react-fa) [react-icons](https:/ QR Code | [qrcode.react](https://github.com/zpao/qrcode.react) Charts | [g2-react](https://github.com/antvis/g2-react) [recharts](https://github.com/recharts/recharts/) [victory](https://github.com/FormidableLabs/victory) 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)