From 140adc601576389b2d7c459c32bb42bbb926c5d8 Mon Sep 17 00:00:00 2001 From: afc163 Date: Sun, 6 Oct 2019 14:18:23 +0800 Subject: [PATCH 01/28] :up: upgrade bisheng-plugin-antd --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 0c09ad4a4fd2..2f247160ae1b 100644 --- a/package.json +++ b/package.json @@ -162,7 +162,7 @@ "babel-eslint": "^10.0.1", "babel-plugin-add-react-displayname": "^0.0.5", "bisheng": "^1.3.1-alpha.0", - "bisheng-plugin-antd": "^1.0.2", + "bisheng-plugin-antd": "^1.3.1", "bisheng-plugin-description": "^0.1.4", "bisheng-plugin-react": "^1.0.0", "bisheng-plugin-toc": "^0.4.4", From f04c8a61eb715006fae8c286f03785486d049353 Mon Sep 17 00:00:00 2001 From: afc163 Date: Sun, 6 Oct 2019 14:27:04 +0800 Subject: [PATCH 02/28] :lipstick: improve buttons style in home page --- site/theme/static/responsive.less | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/site/theme/static/responsive.less b/site/theme/static/responsive.less index 3328a60ad96a..3cab7f7e98ff 100644 --- a/site/theme/static/responsive.less +++ b/site/theme/static/responsive.less @@ -207,7 +207,7 @@ .text-wrapper { min-height: 200px; margin-top: 48px; - padding: 0 16px; + padding: 0; h1 { display: none; } @@ -221,6 +221,11 @@ min-width: 100%; white-space: nowrap; text-align: center; + + .banner-btn { + padding: 0 20px; + font-size: 14px; + } } } } From b0c90f4b06584c178172344e9800afabce32b16c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BA=8C=E8=B4=A7=E6=9C=BA=E5=99=A8=E4=BA=BA?= Date: Tue, 8 Oct 2019 10:17:08 +0800 Subject: [PATCH 03/28] fix: description demo update (#19113) --- .../descriptions/__tests__/__snapshots__/demo.test.js.snap | 4 ++-- components/descriptions/demo/vertical-border.md | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/components/descriptions/__tests__/__snapshots__/demo.test.js.snap b/components/descriptions/__tests__/__snapshots__/demo.test.js.snap index e4058197be7e..34ce57cb88f2 100644 --- a/components/descriptions/__tests__/__snapshots__/demo.test.js.snap +++ b/components/descriptions/__tests__/__snapshots__/demo.test.js.snap @@ -904,7 +904,7 @@ exports[`renders ./components/descriptions/demo/vertical-border.md correctly 1`] Usage Time @@ -920,7 +920,7 @@ exports[`renders ./components/descriptions/demo/vertical-border.md correctly 1`] 2019-04-24 18:00:00 diff --git a/components/descriptions/demo/vertical-border.md b/components/descriptions/demo/vertical-border.md index cd38cdee0f50..4f0a061736db 100644 --- a/components/descriptions/demo/vertical-border.md +++ b/components/descriptions/demo/vertical-border.md @@ -22,7 +22,7 @@ ReactDOM.render( Prepaid YES 2018-04-24 18:00:00 - + 2019-04-24 18:00:00 From 7922090eaa36c726cc6525bcf9521c32569819b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BA=8C=E8=B4=A7=E6=9C=BA=E5=99=A8=E4=BA=BA?= Date: Tue, 8 Oct 2019 14:45:17 +0800 Subject: [PATCH 04/28] fix: TreeShaking (#19115) --- components/config-provider/context.ts | 30 ++++++++++++++++++++++++ components/config-provider/index.tsx | 33 +++------------------------ 2 files changed, 33 insertions(+), 30 deletions(-) create mode 100644 components/config-provider/context.ts diff --git a/components/config-provider/context.ts b/components/config-provider/context.ts new file mode 100644 index 000000000000..37f2426cccd0 --- /dev/null +++ b/components/config-provider/context.ts @@ -0,0 +1,30 @@ +import createReactContext from '@ant-design/create-react-context'; +import defaultRenderEmpty, { RenderEmptyHandler } from './renderEmpty'; +import { Locale } from '../locale-provider'; + +export interface CSPConfig { + nonce?: string; +} + +export interface ConfigConsumerProps { + getPopupContainer?: (triggerNode: HTMLElement) => HTMLElement; + rootPrefixCls?: string; + getPrefixCls: (suffixCls: string, customizePrefixCls?: string) => string; + renderEmpty: RenderEmptyHandler; + csp?: CSPConfig; + autoInsertSpaceInButton?: boolean; + locale?: Locale; +} + +export const ConfigContext = createReactContext({ + // We provide a default function for Context without provider + getPrefixCls: (suffixCls: string, customizePrefixCls?: string) => { + if (customizePrefixCls) return customizePrefixCls; + + return `ant-${suffixCls}`; + }, + + renderEmpty: defaultRenderEmpty, +}); + +export const ConfigConsumer = ConfigContext.Consumer; diff --git a/components/config-provider/index.tsx b/components/config-provider/index.tsx index 721f68a49c6d..92a30c37fd06 100644 --- a/components/config-provider/index.tsx +++ b/components/config-provider/index.tsx @@ -2,27 +2,13 @@ // SFC has specified a displayName, but not worked. /* eslint-disable react/display-name */ import * as React from 'react'; -import createReactContext from '@ant-design/create-react-context'; -import defaultRenderEmpty, { RenderEmptyHandler } from './renderEmpty'; +import { RenderEmptyHandler } from './renderEmpty'; import LocaleProvider, { Locale, ANT_MARK } from '../locale-provider'; import LocaleReceiver from '../locale-provider/LocaleReceiver'; +import { ConfigConsumer, ConfigContext, CSPConfig, ConfigConsumerProps } from './context'; -export { RenderEmptyHandler }; - -export interface CSPConfig { - nonce?: string; -} - -export interface ConfigConsumerProps { - getPopupContainer?: (triggerNode: HTMLElement) => HTMLElement; - rootPrefixCls?: string; - getPrefixCls: (suffixCls: string, customizePrefixCls?: string) => string; - renderEmpty: RenderEmptyHandler; - csp?: CSPConfig; - autoInsertSpaceInButton?: boolean; - locale?: Locale; -} +export { RenderEmptyHandler, ConfigConsumer, CSPConfig, ConfigConsumerProps }; export const configConsumerProps = [ 'getPopupContainer', @@ -44,19 +30,6 @@ export interface ConfigProviderProps { locale?: Locale; } -const ConfigContext = createReactContext({ - // We provide a default function for Context without provider - getPrefixCls: (suffixCls: string, customizePrefixCls?: string) => { - if (customizePrefixCls) return customizePrefixCls; - - return `ant-${suffixCls}`; - }, - - renderEmpty: defaultRenderEmpty, -}); - -export const ConfigConsumer = ConfigContext.Consumer; - class ConfigProvider extends React.Component { getPrefixCls = (suffixCls: string, customizePrefixCls?: string) => { const { prefixCls = 'ant' } = this.props; From 4aa81e576c06cd0e4e869ddbcd351cc8bcb48582 Mon Sep 17 00:00:00 2001 From: Leon Koole Date: Tue, 8 Oct 2019 16:06:50 +0200 Subject: [PATCH 05/28] Clear up confusing language about dataSource keys --- components/table/index.en-US.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/components/table/index.en-US.md b/components/table/index.en-US.md index b4048fd9e555..613a30eb4795 100644 --- a/components/table/index.en-US.md +++ b/components/table/index.en-US.md @@ -229,12 +229,12 @@ class NameColumn extends Table.Column {} ## Note -According to [React documentation](https://facebook.github.io/react/docs/lists-and-keys.html#keys), every child in array should be assigned a unique key. The values inside `dataSource` and `columns` should follow this in Table, and `dataSource[i].key` would be treated as key value default for `dataSource`. - -If `dataSource[i].key` is not provided, then you should specify the primary key of dataSource value via `rowKey`. If not, warnings like above will show in browser console. +According to the [React documentation](https://facebook.github.io/react/docs/lists-and-keys.html#keys), every child in an array should be assigned a unique key. The values inside the Table's `dataSource` and `columns` should follow this rule. By default, `dataSource[i].key` will be treated as the key value for `dataSource`. ![console warning](https://os.alipayobjects.com/rmsportal/luLdLvhPOiRpyss.png) +If `dataSource[i].key` is not provided, then you should specify the primary key of dataSource value via `rowKey`, as shown below. If not, warnings like the one above will show in browser console. + ```jsx // primary key is uid return ; From 41bbcfe1806978e60b49021e215d34f6ebe46c85 Mon Sep 17 00:00:00 2001 From: shao Date: Wed, 9 Oct 2019 13:52:28 +0800 Subject: [PATCH 06/28] docs: probably better phrased as Table component --- components/table/index.zh-CN.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/components/table/index.zh-CN.md b/components/table/index.zh-CN.md index 3ad0d6f7335d..68940288ece7 100644 --- a/components/table/index.zh-CN.md +++ b/components/table/index.zh-CN.md @@ -141,7 +141,7 @@ const columns = [ | sorter | 排序函数,本地排序使用一个函数(参考 [Array.sort](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort) 的 compareFunction),需要服务端排序可设为 true | Function\|boolean | - | | | sortOrder | 排序的受控属性,外界可用此控制列的排序,可设置为 `'ascend'` `'descend'` `false` | boolean\|string | - | | | sortDirections | 支持的排序方式,取值为 `'ascend'` `'descend'` | Array | `['ascend', 'descend']` | 3.15.2 | -| title | 列头显示文字(函数用法 `3.10.0` 后支持) | ReactNode\|({ sortOrder, filters }) => ReactNode | - | | +| title | 列头显示文字(函数用法 `3.10.0` 后支持) | ReactNode\|({ sortOrder, filters }) => ReactNode | - | | | width | 列宽度([指定了也不生效?](https://github.com/ant-design/ant-design/issues/13825#issuecomment-449889241)) | string\|number | - | | | onCell | 设置单元格属性 | Function(record, rowIndex) | - | | | onFilter | 本地模式下,确定筛选的运行函数 | Function | - | | @@ -233,12 +233,12 @@ class NameColumn extends Table.Column {} ## 注意 -按照 [React 的规范](https://facebook.github.io/react/docs/lists-and-keys.html#keys),所有的组件数组必须绑定 key。在 Table 中,`dataSource` 和 `columns` 里的数据值都需要指定 `key` 值。对于 `dataSource` 默认将每列数据的 `key` 属性作为唯一的标识。 - -如果你的数据没有这个属性,务必使用 `rowKey` 来指定数据列的主键。若没有指定,控制台会出现以下的提示,表格组件也会出现各类奇怪的错误。 +按照 [React 的规范](https://zh-hans.reactjs.org/docs/lists-and-keys.html#keys),所有的数组组件必须绑定 `key`。在 Table 中,`dataSource` 和 `columns` 里的数据值都需要指定 `key` 值。对于 `dataSource` 默认将每列数据的 `key` 属性作为唯一的标识。 ![控制台警告](https://os.alipayobjects.com/rmsportal/luLdLvhPOiRpyss.png) +如果 `dataSource[i].key` 没有提供,你应该使用 `rowKey` 来指定 `dataSource` 的主键,如下所示。若没有指定,控制台会出现以上的提示,表格组件也会出现各类奇怪的错误。 + ```jsx // 比如你的数据主键是 uid return
; From 535d4afc2d468f366c5ed993a969e01c3812bcec Mon Sep 17 00:00:00 2001 From: afc163 Date: Wed, 9 Oct 2019 20:57:00 +0800 Subject: [PATCH 07/28] :memo: improve site details --- site/theme/en-US.js | 2 +- site/theme/template/Layout/Footer.jsx | 5 ++--- site/theme/template/Layout/index.jsx | 5 +++++ 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/site/theme/en-US.js b/site/theme/en-US.js index 2f65b65f6aba..3d57c64fd045 100644 --- a/site/theme/en-US.js +++ b/site/theme/en-US.js @@ -93,7 +93,7 @@ module.exports = { 'app.footer.fengdie.slogan': 'Mobile web app builder', 'app.footer.zhihu': 'Ant Design Blog', 'app.footer.zhihu.xtech': 'Experience Cloud Blog', - 'app.footer.seeconf': 'Seeking Experience & Engineering Conference', + 'app.footer.seeconf': 'Experience Tech Conference', 'app.footer.xtech': 'Ant Financial Experience Tech', 'app.footer.xtech.slogan': 'Experience The Beauty', 'app.publish.title': 'antd@3.0.0 has been released! 🎉 🎉 🎉', diff --git a/site/theme/template/Layout/Footer.jsx b/site/theme/template/Layout/Footer.jsx index 60a9171cca63..10c7d7099ebf 100644 --- a/site/theme/template/Layout/Footer.jsx +++ b/site/theme/template/Layout/Footer.jsx @@ -142,7 +142,7 @@ class Footer extends React.Component { icon: , title: 'SEE Conf', description: , - url: 'http://zhuanlan.zhihu.com/xtech', + url: 'https://seeconf.antfin.com/', openExternal: true, }, { @@ -402,8 +402,7 @@ class Footer extends React.Component { bottom={ <> Made with by - {/* eslint-disable-next-line react/jsx-curly-brace-presence */} - {' '} + {/* eslint-disable-next-line react/jsx-curly-brace-presence */}{' '} diff --git a/site/theme/template/Layout/index.jsx b/site/theme/template/Layout/index.jsx index f8db7b17b976..b8049850c109 100644 --- a/site/theme/template/Layout/index.jsx +++ b/site/theme/template/Layout/index.jsx @@ -123,6 +123,11 @@ export default class Layout extends React.Component { {title} + From 75d97c8bf10a8594008830526cd4f56c078613c1 Mon Sep 17 00:00:00 2001 From: afc163 Date: Wed, 9 Oct 2019 21:20:20 +0800 Subject: [PATCH 08/28] :memo: update apple touch icon --- site/theme/template/Layout/index.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/site/theme/template/Layout/index.jsx b/site/theme/template/Layout/index.jsx index b8049850c109..9c188496d3fe 100644 --- a/site/theme/template/Layout/index.jsx +++ b/site/theme/template/Layout/index.jsx @@ -126,7 +126,7 @@ export default class Layout extends React.Component { From 36a7621bb37e620bba400ee3e3ff02e7c6ed3bb6 Mon Sep 17 00:00:00 2001 From: Rodrigo Ehlers Date: Wed, 9 Oct 2019 15:52:26 +0200 Subject: [PATCH 09/28] add clear-icon click --- components/input/index.en-US.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/input/index.en-US.md b/components/input/index.en-US.md index cb6e2608171a..a361f5b0198d 100644 --- a/components/input/index.en-US.md +++ b/components/input/index.en-US.md @@ -55,7 +55,7 @@ The rest of the props of `Input.TextArea` are the same as the original [textarea | Property | Description | Type | Default | Version | | --- | --- | --- | --- | --- | | enterButton | to show an enter button after input. This prop is conflict with addon. | boolean\|ReactNode | false | | -| onSearch | The callback function that is triggered when you click on the search-icon or press Enter key. | function(value, event) | | | +| onSearch | The callback function triggered when you click on the search-icon, the clear-icon or press the Enter key. | function(value, event) | | | Supports all props of `Input`. From ba971b295bf9d9592cb02222197e361946357509 Mon Sep 17 00:00:00 2001 From: kermolaev Date: Wed, 9 Oct 2019 11:37:24 +0300 Subject: [PATCH 10/28] There was icon wrapper on 100% width in ie11. https://caniuse.com/#feat=css-initial-value --- components/collapse/style/index.less | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/collapse/style/index.less b/components/collapse/style/index.less index 47d016cc2dcd..066403e04ccd 100644 --- a/components/collapse/style/index.less +++ b/components/collapse/style/index.less @@ -70,7 +70,7 @@ .@{collapse-prefix-cls}-arrow { right: @padding-md; - left: initial; + left: auto; } } } From 0674bb974f04ada3fa46ab8e05e8ead816a7a1b2 Mon Sep 17 00:00:00 2001 From: Jason Kurian Date: Wed, 9 Oct 2019 22:20:40 -0400 Subject: [PATCH 11/28] docs: document drawer default height (#19144) --- components/drawer/index.en-US.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/drawer/index.en-US.md b/components/drawer/index.en-US.md index 47b5a7a74c8a..3b779d850243 100644 --- a/components/drawer/index.en-US.md +++ b/components/drawer/index.en-US.md @@ -30,7 +30,7 @@ A Drawer is a panel that is typically overlaid on top of a page and slides in fr | title | The title for Drawer. | string\|ReactNode | - | 3.7.0 | | visible | Whether the Drawer dialog is visible or not. | boolean | false | 3.7.0 | | width | Width of the Drawer dialog. | string\|number | 256 | 3.7.0 | -| height | placement is `top` or `bottom`, height of the Drawer dialog. | string\|number | - | 3.9.0 | +| height | placement is `top` or `bottom`, height of the Drawer dialog. | string\|number | 256 | 3.9.0 | | className | The class name of the container of the Drawer dialog. | string | - | 3.8.0 | | zIndex | The `z-index` of the Drawer. | Number | 1000 | 3.7.0 | | placement | The placement of the Drawer. | 'top' \| 'right' \| 'bottom' \| 'left' | 'right' | 3.7.0 | From 16572711a3f0d62d8acb24a682a167ed0c89e895 Mon Sep 17 00:00:00 2001 From: afc163 Date: Thu, 10 Oct 2019 10:47:05 +0800 Subject: [PATCH 12/28] :memo: update apple-touch-icon-precomposed --- site/theme/template/Layout/index.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/site/theme/template/Layout/index.jsx b/site/theme/template/Layout/index.jsx index 9c188496d3fe..4db17ff2aca7 100644 --- a/site/theme/template/Layout/index.jsx +++ b/site/theme/template/Layout/index.jsx @@ -126,7 +126,7 @@ export default class Layout extends React.Component { From d8526f43f68bf8171a22cd52fc7209921e0f4840 Mon Sep 17 00:00:00 2001 From: vaytsel Date: Wed, 9 Oct 2019 18:59:27 +0300 Subject: [PATCH 13/28] Update theme.md --- components/menu/demo/theme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/menu/demo/theme.md b/components/menu/demo/theme.md index 99cbab4fb36c..397b3354a099 100755 --- a/components/menu/demo/theme.md +++ b/components/menu/demo/theme.md @@ -75,7 +75,7 @@ class Sider extends React.Component { title={ - Navigtion Two + Navigation Two } > From d582ba351b6bfdf22d4521015971937275643ac3 Mon Sep 17 00:00:00 2001 From: afc163 Date: Thu, 10 Oct 2019 11:10:05 +0800 Subject: [PATCH 14/28] :white_check_mark: update snapshot --- components/menu/__tests__/__snapshots__/demo.test.js.snap | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/menu/__tests__/__snapshots__/demo.test.js.snap b/components/menu/__tests__/__snapshots__/demo.test.js.snap index 57e14ccd7aa1..8f2eb9d44969 100644 --- a/components/menu/__tests__/__snapshots__/demo.test.js.snap +++ b/components/menu/__tests__/__snapshots__/demo.test.js.snap @@ -1124,7 +1124,7 @@ exports[`renders ./components/menu/demo/theme.md correctly 1`] = ` - Navigtion Two + Navigation Two Date: Thu, 10 Oct 2019 22:04:03 +0800 Subject: [PATCH 15/28] docs: link related issue of form initialValue option --- components/form/index.en-US.md | 2 +- components/form/index.zh-CN.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/components/form/index.en-US.md b/components/form/index.en-US.md index 725fa47d26cd..f3c59864ae70 100644 --- a/components/form/index.en-US.md +++ b/components/form/index.en-US.md @@ -177,7 +177,7 @@ If you use `react@<15.3.0`, then, you can't use `getFieldDecorator` in stateless | id | The unique identifier is required. support [nested fields format](https://github.com/react-component/form/pull/48). | string | | | | options.getValueFromEvent | Specify how to get value from event or other onChange arguments | function(..args) | [reference](https://github.com/react-component/form#option-object) | | | options.getValueProps | Get the component props according to field value. | function(value): any | [reference](https://github.com/react-component/form#option-object) | 3.9.0 | -| options.initialValue | You can specify initial value, type, optional value of children node. (Note: Because `Form` will test equality with `===` internally, we recommend to use variable as `initialValue`, instead of literal) | | n/a | | +| options.initialValue | You can specify initial value, type, optional value of children node. ([Note: Because `Form` will test equality with `===` internally, we recommend to use variable as `initialValue`, instead of literal](https://github.com/ant-design/ant-design/issues/4093)) | | n/a | | | options.normalize | Normalize value to form component, [a select-all example](https://codepen.io/afc163/pen/JJVXzG?editors=001) | function(value, prevValue, allValues): any | - | | | options.preserve | Keep the field even if field removed | boolean | - | 3.12.0 | | options.rules | Includes validation rules. Please refer to "Validation Rules" part for details. | object\[] | n/a | | diff --git a/components/form/index.zh-CN.md b/components/form/index.zh-CN.md index fd6e88d1ca42..ca307248135a 100644 --- a/components/form/index.zh-CN.md +++ b/components/form/index.zh-CN.md @@ -179,7 +179,7 @@ validateFields(['field1', 'field2'], options, (errors, values) => { | --- | --- | --- | --- | --- | | id | 必填输入控件唯一标志。支持嵌套式的[写法](https://github.com/react-component/form/pull/48)。 | string | | | | options.getValueFromEvent | 可以把 onChange 的参数(如 event)转化为控件的值 | function(..args) | [reference](https://github.com/react-component/form#option-object) | | -| options.initialValue | 子节点的初始值,类型、可选值均由子节点决定(注意:由于内部校验时使用 `===` 判断是否变化,建议使用变量缓存所需设置的值而非直接使用字面量)) | | | | +| options.initialValue | 子节点的初始值,类型、可选值均由子节点决定([注意:由于内部校验时使用 `===` 判断是否变化,建议使用变量缓存所需设置的值而非直接使用字面量](https://github.com/ant-design/ant-design/issues/4093)) | | | | | options.normalize | 转换默认的 value 给控件,[一个选择全部的例子](https://codepen.io/afc163/pen/JJVXzG?editors=001) | function(value, prevValue, allValues): any | - | | | options.preserve | 即便字段不再使用,也保留该字段的值 | boolean | - | 3.12.0 | | options.rules | 校验规则,参考下方文档 | object\[] | | | From 3ac716d808bb9815c555650d1a4dab7d93b8ea01 Mon Sep 17 00:00:00 2001 From: Gabriele Petrioli Date: Fri, 11 Oct 2019 05:23:41 +0300 Subject: [PATCH 16/28] fix: keep className given to expandIcon in Collapse component (#19160) --- components/collapse/Collapse.tsx | 7 ++++--- components/collapse/__tests__/index.test.js | 16 ++++++++++++++++ 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/components/collapse/Collapse.tsx b/components/collapse/Collapse.tsx index 35eb6761151d..73e55b722dbf 100644 --- a/components/collapse/Collapse.tsx +++ b/components/collapse/Collapse.tsx @@ -45,14 +45,15 @@ export default class Collapse extends React.Component { renderExpandIcon = (panelProps: PanelProps = {}, prefixCls: string) => { const { expandIcon } = this.props; - const icon = expandIcon ? ( + const icon = (expandIcon ? ( expandIcon(panelProps) ) : ( - ); + )) as React.ReactNode; + return React.isValidElement(icon) ? React.cloneElement(icon as any, { - className: `${prefixCls}-arrow`, + className: classNames(icon.props.className, `${prefixCls}-arrow`), }) : icon; }; diff --git a/components/collapse/__tests__/index.test.js b/components/collapse/__tests__/index.test.js index 35a065e9f8f8..d2c5104721ce 100644 --- a/components/collapse/__tests__/index.test.js +++ b/components/collapse/__tests__/index.test.js @@ -27,6 +27,22 @@ describe('Collapse', () => { expect(wrapper.render()).toMatchSnapshot(); }); + it('should keep the className of the expandIcon', () => { + const wrapper = mount( + ( + + )} + > + + , + ); + + expect(wrapper.find('.custom-expandicon-classname').exists()).toBe(true); + }); + it('should render extra node of panel', () => { const wrapper = mount( From fb5d709ccdd8d1164b7b59982ea5ab9b9848c4c4 Mon Sep 17 00:00:00 2001 From: afc163 Date: Fri, 11 Oct 2019 12:21:29 +0800 Subject: [PATCH 17/28] :memo: fix scaffold.ant.design link typo --- site/theme/template/Layout/Footer.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/site/theme/template/Layout/Footer.jsx b/site/theme/template/Layout/Footer.jsx index 10c7d7099ebf..f83076060b10 100644 --- a/site/theme/template/Layout/Footer.jsx +++ b/site/theme/template/Layout/Footer.jsx @@ -73,7 +73,7 @@ class Footer extends React.Component { { title: 'Scaffolds', description: , - url: 'https://scaffolds.ant.design', + url: 'https://scaffold.ant.design', openExternal: true, }, { From 6ab74d9d7eb4060c50816a4a4503448d4bfc5f2b Mon Sep 17 00:00:00 2001 From: ycjcl868 <45808948@qq.com> Date: Fri, 11 Oct 2019 18:01:09 +0800 Subject: [PATCH 18/28] :memo: Umi UI cases --- docs/spec/cases.en-US.md | 8 ++++++++ docs/spec/cases.zh-CN.md | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/docs/spec/cases.en-US.md b/docs/spec/cases.en-US.md index 363d0353c071..dd7fa7fd0371 100644 --- a/docs/spec/cases.en-US.md +++ b/docs/spec/cases.en-US.md @@ -12,6 +12,14 @@ Currently, there are many products and sites using Ant Design. If your solutions --- +### Umi UI + +The local R&D workbench for Umi projects, code based, visualization function as an aid, further improve project development efficiency. + +[More](https://umijs.org/zh/guide/umi-ui.html#%E2%9C%A8-%E7%89%B9%E6%80%A7) + +![Umi UI](https://gw.alipayobjects.com/zos/antfincdn/xKamcZ2HPE/75aa218c-8b52-4d1c-980f-b7ec4c29d0c6.png) + ### Ant Financial Technology Cloud-oriented financial services, used by financial institutions that benefit from customized business cloud computing services. It assists financial institutions to upgrade to a new financial restructuring, promotion of capacity platforms, data and technology. diff --git a/docs/spec/cases.zh-CN.md b/docs/spec/cases.zh-CN.md index bad2ecc40fb4..f0273291983b 100644 --- a/docs/spec/cases.zh-CN.md +++ b/docs/spec/cases.zh-CN.md @@ -10,6 +10,14 @@ Ant Design 目前在外部也有许多产品实践,如果你的公司和产品 ## 最佳实践 +### Umi UI + +umi 项目的本地研发工作台,本地研发工作台。以代码为基础、可视化功能作为辅助,进一步提升项目研发效率。 + +[了解更多](https://umijs.org/zh/guide/umi-ui.html#%E2%9C%A8-%E7%89%B9%E6%80%A7) + +![Umi UI](https://gw.alipayobjects.com/zos/antfincdn/xKamcZ2HPE/75aa218c-8b52-4d1c-980f-b7ec4c29d0c6.png) + ### 蚂蚁金融科技 金融云是面向金融机构深度定制的行业云计算服务;助力金融机构向新金融转型升级,推动平台、数据和技术方面的能力全面对外开放。 From 9cbc090a9aefa2de5911663f7a2b74e25d036b5e Mon Sep 17 00:00:00 2001 From: ycjcl868 <45808948@qq.com> Date: Fri, 11 Oct 2019 18:03:52 +0800 Subject: [PATCH 19/28] :memo: en docs --- docs/spec/cases.en-US.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/spec/cases.en-US.md b/docs/spec/cases.en-US.md index dd7fa7fd0371..44d4ad5dba4f 100644 --- a/docs/spec/cases.en-US.md +++ b/docs/spec/cases.en-US.md @@ -16,7 +16,7 @@ Currently, there are many products and sites using Ant Design. If your solutions The local R&D workbench for Umi projects, code based, visualization function as an aid, further improve project development efficiency. -[More](https://umijs.org/zh/guide/umi-ui.html#%E2%9C%A8-%E7%89%B9%E6%80%A7) +[More](https://umijs.org/guide/umi-ui.html#%E2%9C%A8-%E7%89%B9%E6%80%A7) ![Umi UI](https://gw.alipayobjects.com/zos/antfincdn/xKamcZ2HPE/75aa218c-8b52-4d1c-980f-b7ec4c29d0c6.png) From e43b808cc44fe6738a5ed3bbed76f3bc533d00cf Mon Sep 17 00:00:00 2001 From: ycjcl868 <45808948@qq.com> Date: Fri, 11 Oct 2019 18:22:36 +0800 Subject: [PATCH 20/28] chore: docs cases Umi UI image compress --- docs/spec/cases.en-US.md | 2 +- docs/spec/cases.zh-CN.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/spec/cases.en-US.md b/docs/spec/cases.en-US.md index 44d4ad5dba4f..08244b245964 100644 --- a/docs/spec/cases.en-US.md +++ b/docs/spec/cases.en-US.md @@ -18,7 +18,7 @@ The local R&D workbench for Umi projects, code based, visualization function as [More](https://umijs.org/guide/umi-ui.html#%E2%9C%A8-%E7%89%B9%E6%80%A7) -![Umi UI](https://gw.alipayobjects.com/zos/antfincdn/xKamcZ2HPE/75aa218c-8b52-4d1c-980f-b7ec4c29d0c6.png) +![Umi UI](https://gw.alipayobjects.com/zos/antfincdn/Xyns37N5nY/6591859e-7c16-48f5-852f-7817803425e9.png) ### Ant Financial Technology diff --git a/docs/spec/cases.zh-CN.md b/docs/spec/cases.zh-CN.md index f0273291983b..5343bdd35637 100644 --- a/docs/spec/cases.zh-CN.md +++ b/docs/spec/cases.zh-CN.md @@ -16,7 +16,7 @@ umi 项目的本地研发工作台,本地研发工作台。以代码为基础 [了解更多](https://umijs.org/zh/guide/umi-ui.html#%E2%9C%A8-%E7%89%B9%E6%80%A7) -![Umi UI](https://gw.alipayobjects.com/zos/antfincdn/xKamcZ2HPE/75aa218c-8b52-4d1c-980f-b7ec4c29d0c6.png) +![Umi UI](https://gw.alipayobjects.com/zos/antfincdn/Xyns37N5nY/6591859e-7c16-48f5-852f-7817803425e9.png) ### 蚂蚁金融科技 From 311a6c091774e69f057ebeee47a35db8a2343775 Mon Sep 17 00:00:00 2001 From: Liming Jin Date: Fri, 11 Oct 2019 18:12:28 +0800 Subject: [PATCH 21/28] fix: replace autosize with autoSize --- components/input/TextArea.tsx | 21 +++++++++++++------ .../__tests__/__snapshots__/demo.test.js.snap | 2 +- components/input/__tests__/index.test.js | 2 +- components/input/demo/autosize-textarea.md | 10 ++++----- components/input/demo/textarea-resize.md | 4 ++-- components/input/index.en-US.md | 2 +- components/input/index.zh-CN.md | 2 +- components/typography/Editable.tsx | 2 +- 8 files changed, 27 insertions(+), 18 deletions(-) diff --git a/components/input/TextArea.tsx b/components/input/TextArea.tsx index 830830e0fd11..23fe3d5f7cd1 100644 --- a/components/input/TextArea.tsx +++ b/components/input/TextArea.tsx @@ -6,6 +6,7 @@ import ResizeObserver from 'rc-resize-observer'; import calculateNodeHeight from './calculateNodeHeight'; import { ConfigConsumer, ConfigConsumerProps } from '../config-provider'; import raf from '../_util/raf'; +import warning from '../_util/warning'; export interface AutoSizeType { minRows?: number; @@ -16,7 +17,9 @@ export type HTMLTextareaProps = React.TextareaHTMLAttributes; } @@ -84,11 +87,11 @@ class TextArea extends React.Component { }; resizeTextarea = () => { - const { autosize } = this.props; - if (!autosize || !this.textAreaRef) { + const autoSize = this.props.autoSize || this.props.autosize; + if (!autoSize || !this.textAreaRef) { return; } - const { minRows, maxRows } = autosize as AutoSizeType; + const { minRows, maxRows } = autoSize as AutoSizeType; const textareaStyles = calculateNodeHeight(this.textAreaRef, false, minRows, maxRows); this.setState({ textareaStyles, resizing: true }, () => { raf.cancel(this.resizeFrameId); @@ -108,14 +111,20 @@ class TextArea extends React.Component { renderTextArea = ({ getPrefixCls }: ConfigConsumerProps) => { const { textareaStyles, resizing } = this.state; - const { prefixCls: customizePrefixCls, className, disabled, autosize } = this.props; + const { prefixCls: customizePrefixCls, className, disabled, autoSize, autosize } = this.props; const { ...props } = this.props; - const otherProps = omit(props, ['prefixCls', 'onPressEnter', 'autosize']); + const otherProps = omit(props, ['prefixCls', 'onPressEnter', 'autoSize', 'autosize']); const prefixCls = getPrefixCls('input', customizePrefixCls); const cls = classNames(prefixCls, className, { [`${prefixCls}-disabled`]: disabled, }); + warning( + autosize === undefined, + 'Input.TextArea', + 'autosize is deprecated, please use autoSize instead.', + ); + const style = { ...props.style, ...textareaStyles, @@ -127,7 +136,7 @@ class TextArea extends React.Component { otherProps.value = otherProps.value || ''; } return ( - + `; diff --git a/components/input/__tests__/index.test.js b/components/input/__tests__/index.test.js index 8af8c199f7e9..581737b5f3ec 100644 --- a/components/input/__tests__/index.test.js +++ b/components/input/__tests__/index.test.js @@ -74,7 +74,7 @@ describe('TextArea', () => { }); it('should auto calculate height according to content length', () => { - const wrapper = mount(