From ddb0ac46ba7b5ccc04f496523938d87484489191 Mon Sep 17 00:00:00 2001 From: afc163 Date: Wed, 1 Apr 2020 18:52:37 +0800 Subject: [PATCH 01/21] fix: :bug: Table unchanged filter should not trigger onChange ref https://github.com/ant-design/ant-design/issues/22819#issuecomment-607171024 --- .../table/__tests__/Table.filter.test.js | 73 +++++++++++-------- .../table/hooks/useFilter/FilterDropdown.tsx | 5 ++ 2 files changed, 46 insertions(+), 32 deletions(-) diff --git a/components/table/__tests__/Table.filter.test.js b/components/table/__tests__/Table.filter.test.js index 2ce930e478..bd5b772d8f 100644 --- a/components/table/__tests__/Table.filter.test.js +++ b/components/table/__tests__/Table.filter.test.js @@ -11,12 +11,7 @@ import ConfigProvider from '../../config-provider'; const nativeEvent = { nativeEvent: { stopImmediatePropagation: () => {} } }; function getDropdownWrapper(wrapper) { - return mount( - wrapper - .find('Trigger') - .instance() - .getComponent(), - ); + return mount(wrapper.find('Trigger').instance().getComponent()); } describe('Table.filter', () => { @@ -213,7 +208,10 @@ describe('Table.filter', () => { expect(wrapper.find('FilterDropdown').props().filterState.filteredKeys).toBeFalsy(); wrapper.find('FilterDropdown').find('input[type="checkbox"]').first().simulate('click'); - wrapper.find('FilterDropdown').find('.ant-table-filter-dropdown-btns .ant-btn-primary').simulate('click'); + wrapper + .find('FilterDropdown') + .find('.ant-table-filter-dropdown-btns .ant-btn-primary') + .simulate('click'); expect(wrapper.find('FilterDropdown').props().filterState.filteredKeys).toEqual(['boy']); wrapper.setProps({ dataSource: [...data, { key: 999, name: 'Chris' }] }); expect(wrapper.find('FilterDropdown').props().filterState.filteredKeys).toEqual(['boy']); @@ -342,7 +340,10 @@ describe('Table.filter', () => { const wrapper = mount(createTable({ onChange: handleChange })); wrapper.find('.ant-dropdown-trigger').first().simulate('click'); wrapper.find('FilterDropdown').find('MenuItem').first().simulate('click'); - wrapper.find('FilterDropdown').find('.ant-table-filter-dropdown-btns .ant-btn-primary').simulate('click'); + wrapper + .find('FilterDropdown') + .find('.ant-table-filter-dropdown-btns .ant-btn-primary') + .simulate('click'); expect(handleChange).toHaveBeenCalledWith( {}, { name: ['boy'] }, @@ -358,12 +359,15 @@ describe('Table.filter', () => { const wrapper = mount(createTable({ pagination: { onChange: onPaginationChange } })); wrapper.find('.ant-dropdown-trigger').first().simulate('click'); wrapper.find('FilterDropdown').find('MenuItem').first().simulate('click'); - wrapper.find('FilterDropdown').find('.ant-table-filter-dropdown-btns .ant-btn-primary').simulate('click'); + wrapper + .find('FilterDropdown') + .find('.ant-table-filter-dropdown-btns .ant-btn-primary') + .simulate('click'); expect(onPaginationChange).toHaveBeenCalledWith(1, 10); }); - it('should not fire change event on close filterDropdown without changing anything', () => { + it('should not fire change event when close filterDropdown without changing anything', () => { const handleChange = jest.fn(); const wrapper = mount(createTable({ onChange: handleChange })); @@ -373,6 +377,26 @@ describe('Table.filter', () => { expect(handleChange).not.toHaveBeenCalled(); }); + it('should not fire change event when close a filtered filterDropdown without changing anything', () => { + const handleChange = jest.fn(); + const wrapper = mount( + createTable({ + onChange: handleChange, + columns: [ + { + ...column, + defaultFilteredValue: ['boy', 'designer'], + }, + ], + }), + ); + + wrapper.find('.ant-dropdown-trigger').first().simulate('click'); + wrapper.find('.ant-table-filter-dropdown-btns .ant-btn-primary').simulate('click'); + + expect(handleChange).not.toHaveBeenCalled(); + }); + it('three levels menu', () => { const filters = [ { text: 'Upper', value: 'Upper' }, @@ -410,29 +434,17 @@ describe('Table.filter', () => { let dropdownWrapper = getDropdownWrapper(wrapper); expect(renderedNames(wrapper)).toEqual(['Jack', 'Lucy', 'Tom', 'Jerry']); // select - dropdownWrapper - .find('.ant-dropdown-menu-submenu-title') - .at(0) - .simulate('mouseEnter'); + dropdownWrapper.find('.ant-dropdown-menu-submenu-title').at(0).simulate('mouseEnter'); jest.runAllTimers(); dropdownWrapper = getDropdownWrapper(wrapper); - dropdownWrapper - .find('.ant-dropdown-menu-submenu-title') - .at(1) - .simulate('mouseEnter'); + dropdownWrapper.find('.ant-dropdown-menu-submenu-title').at(1).simulate('mouseEnter'); jest.runAllTimers(); dropdownWrapper = getDropdownWrapper(wrapper); - dropdownWrapper - .find('MenuItem') - .last() - .simulate('click'); + dropdownWrapper.find('MenuItem').last().simulate('click'); dropdownWrapper.find('.ant-table-filter-dropdown-btns .ant-btn-primary').simulate('click'); wrapper.update(); expect(renderedNames(wrapper)).toEqual(['Jack']); - dropdownWrapper - .find('MenuItem') - .last() - .simulate('click'); + dropdownWrapper.find('MenuItem').last().simulate('click'); jest.useRealTimers(); }); @@ -1060,12 +1072,9 @@ describe('Table.filter', () => { expect(wrapper.find('.ant-table-filter-dropdown-btns .ant-btn-primary').text()).toEqual( 'Bamboo', ); - expect( - wrapper - .find('.ant-table-filter-dropdown-btns .ant-btn-link') - .last() - .text(), - ).toEqual('Reset'); + expect(wrapper.find('.ant-table-filter-dropdown-btns .ant-btn-link').last().text()).toEqual( + 'Reset', + ); }); it('filtered should work', () => { diff --git a/components/table/hooks/useFilter/FilterDropdown.tsx b/components/table/hooks/useFilter/FilterDropdown.tsx index 0f45c33ff1..2140ac90f4 100644 --- a/components/table/hooks/useFilter/FilterDropdown.tsx +++ b/components/table/hooks/useFilter/FilterDropdown.tsx @@ -1,5 +1,6 @@ import * as React from 'react'; import classNames from 'classnames'; +import isEqual from 'lodash/isEqual'; import FilterFilled from '@ant-design/icons/FilterFilled'; import Button from '../../../button'; import Menu from '../../../menu'; @@ -131,6 +132,10 @@ function FilterDropdown(props: FilterDropdownProps) { return null; } + if (isEqual(mergedKeys, filterState?.filteredKeys)) { + return null; + } + triggerFilter({ column, key: columnKey, From c38324e863fcf4ff0e6ce75aeabe2c2b7cadc7cc Mon Sep 17 00:00:00 2001 From: afc163 Date: Wed, 1 Apr 2020 18:59:41 +0800 Subject: [PATCH 02/21] docs: :book: Add FAQ about table filter logic --- components/table/index.en-US.md | 22 ++++++++++++++-------- components/table/index.zh-CN.md | 22 ++++++++++++++-------- 2 files changed, 28 insertions(+), 16 deletions(-) diff --git a/components/table/index.en-US.md b/components/table/index.en-US.md index 5899f7c0b7..b89d7d4be6 100644 --- a/components/table/index.en-US.md +++ b/components/table/index.en-US.md @@ -92,14 +92,14 @@ Same as `onRow` `onHeaderRow` `onCell` `onHeaderCell` { return { - onClick: (event) => {}, // click row - onDoubleClick: (event) => {}, // double click row - onContextMenu: (event) => {}, // right button click row - onMouseEnter: (event) => {}, // mouse enter row - onMouseLeave: (event) => {}, // mouse leave row + onClick: event => {}, // click row + onDoubleClick: event => {}, // double click row + onContextMenu: event => {}, // right button click row + onMouseEnter: event => {}, // mouse enter row + onMouseLeave: event => {}, // mouse leave row }; }} - onHeaderRow={(column) => { + onHeaderRow={column => { return { onClick: () => {}, // click header row }; @@ -265,7 +265,7 @@ If `dataSource[i].key` is not provided, then you should specify the primary key // primary key is uid return
; // or -return
record.uid} />; +return
record.uid} />; ``` ## Migrate to v4 @@ -276,6 +276,12 @@ Besides, the breaking change is changing `dataIndex` from nest string path like ## FAQ -### How to hide pagination when single page or not data +### How to hide pagination when single page or not data? You can set `hideOnSinglePage` with `pagination` prop. + +### Table will return to first page when filter data. + +Table total page count usually reduce after filter data, we defaultly return to first page in case of current page is out of filtered results. + +You may need to keep current page after filtering when fetch data from remote service, please check [this demo](https://codesandbox.io/s/yuanchengjiazaishuju-ant-design-demo-7y2uf) as workaround. diff --git a/components/table/index.zh-CN.md b/components/table/index.zh-CN.md index 98fe79085c..0caf237131 100644 --- a/components/table/index.zh-CN.md +++ b/components/table/index.zh-CN.md @@ -95,16 +95,16 @@ const columns = [ ```jsx
{ + onRow={record => { return { - onClick: (event) => {}, // 点击行 - onDoubleClick: (event) => {}, - onContextMenu: (event) => {}, - onMouseEnter: (event) => {}, // 鼠标移入行 - onMouseLeave: (event) => {}, + onClick: event => {}, // 点击行 + onDoubleClick: event => {}, + onContextMenu: event => {}, + onMouseEnter: event => {}, // 鼠标移入行 + onMouseLeave: event => {}, }; }} - onHeaderRow={(column) => { + onHeaderRow={column => { return { onClick: () => {}, // 点击表头行 }; @@ -269,7 +269,7 @@ class NameColumn extends Table.Column {} // 比如你的数据主键是 uid return
; // 或 -return
record.uid} />; +return
record.uid} />; ``` ## 从 v3 升级到 v4 @@ -283,3 +283,9 @@ Table 移除了在 v3 中废弃的 `onRowClick`、`onRowDoubleClick`、`onRowMou ### 如何在没有数据或只有一页数据时隐藏分页栏 你可以设置 `pagination` 的 `hideOnSinglePage` 属性为 `true`。 + +### 表格过滤时会回到第一页? + + 前端过滤时通常条目总数会减少,从而导致总页数小于筛选前的当前页数,为了防止当前页面没有数据,我们默认会返回第一页。 + +如果你在使用远程分页,很可能需要保持当前页面,你可以参照这个 [受控例子](https://codesandbox.io/s/yuanchengjiazaishuju-ant-design-demo-7y2uf) 控制当前页面不变。 From f2a3ef5926a2d87740106460d15d0d09c4b24998 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: Wed, 1 Apr 2020 20:57:35 +0800 Subject: [PATCH 03/21] fix: Table expanded logic (#22832) * update rc-table deps * fix style mapping * snapshot --- .../__tests__/Table.rowSelection.test.js | 3 + .../Table.rowSelection.test.js.snap | 54 +++++++- .../__tests__/__snapshots__/demo.test.js.snap | 8 +- .../__snapshots__/empty.test.js.snap | 117 ++++++++++++------ components/table/__tests__/empty.test.js | 4 +- components/table/style/bordered.less | 2 +- package.json | 2 +- 7 files changed, 141 insertions(+), 49 deletions(-) diff --git a/components/table/__tests__/Table.rowSelection.test.js b/components/table/__tests__/Table.rowSelection.test.js index d506fe55e0..2c70a211a5 100644 --- a/components/table/__tests__/Table.rowSelection.test.js +++ b/components/table/__tests__/Table.rowSelection.test.js @@ -429,6 +429,7 @@ describe('Table.rowSelection', () => { const wrapper = render( createTable({ rowSelection: { fixed: true }, + scroll: { x: 903 }, }), ); @@ -444,6 +445,7 @@ describe('Table.rowSelection', () => { }, }, rowSelection: { fixed: true }, + scroll: { x: 903 }, }), ); @@ -461,6 +463,7 @@ describe('Table.rowSelection', () => { fixed: 'left', }, ], + scroll: { x: 903 }, }), ); diff --git a/components/table/__tests__/__snapshots__/Table.rowSelection.test.js.snap b/components/table/__tests__/__snapshots__/Table.rowSelection.test.js.snap index fdaed4b68b..eacf3cffbf 100644 --- a/components/table/__tests__/__snapshots__/Table.rowSelection.test.js.snap +++ b/components/table/__tests__/__snapshots__/Table.rowSelection.test.js.snap @@ -11,16 +11,17 @@ exports[`Table.rowSelection fix expand on th left when selection column fixed on class="ant-spin-container" >
+ +
+ +
+ +
+ + @@ -345,50 +385,55 @@ exports[`Table renders empty table with fixed columns 1`] = ` colspan="11" >
- - - - - + + + + - - + +
+

+ No Data +

-

- No Data -

diff --git a/components/table/__tests__/empty.test.js b/components/table/__tests__/empty.test.js index 7ea6ccf2ad..1e584613a3 100644 --- a/components/table/__tests__/empty.test.js +++ b/components/table/__tests__/empty.test.js @@ -51,7 +51,9 @@ describe('Table', () => { }); it('renders empty table with fixed columns', () => { - const wrapper = render(
); + const wrapper = render( +
, + ); expect(wrapper).toMatchSnapshot(); }); diff --git a/components/table/style/bordered.less b/components/table/style/bordered.less index 27b04f5f4e..ace820eb2b 100644 --- a/components/table/style/bordered.less +++ b/components/table/style/bordered.less @@ -53,7 +53,7 @@ } } - &.@{table-prefix-cls}-fixed-column { + &.@{table-prefix-cls}-scroll-horizontal { tr.@{table-prefix-cls}-expanded-row, tr.@{table-prefix-cls}-placeholder { > td { diff --git a/package.json b/package.json index d76ada198a..a3043efb39 100644 --- a/package.json +++ b/package.json @@ -127,7 +127,7 @@ "rc-slider": "~9.2.3", "rc-steps": "~3.5.0", "rc-switch": "~1.9.0", - "rc-table": "~7.3.0", + "rc-table": "~7.4.2", "rc-tabs": "~10.1.1", "rc-tooltip": "~4.0.2", "rc-tree": "~3.1.0", From 3f8dbc500fd31b631a10bbacceaee07bf61df02a Mon Sep 17 00:00:00 2001 From: kaoding <41830859@qq.com> Date: Wed, 1 Apr 2020 21:06:24 +0800 Subject: [PATCH 04/21] =?UTF-8?q?style:=20=F0=9F=92=84=20@info-color=20sho?= =?UTF-8?q?uld=20be=20@primary-color=20defaultly?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit revert #5442 --- components/style/themes/default.less | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/style/themes/default.less b/components/style/themes/default.less index 69c68cbd94..51b569c4bb 100644 --- a/components/style/themes/default.less +++ b/components/style/themes/default.less @@ -11,7 +11,7 @@ // -------- Colors ----------- @primary-color: @blue-6; -@info-color: @blue-6; +@info-color: @primary-color; @success-color: @green-6; @processing-color: @blue-6; @error-color: @red-5; From 9aa61b78e18af9549a155517e691b9e430cd03f6 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: Wed, 1 Apr 2020 22:19:32 +0800 Subject: [PATCH 05/21] support undefined remove filter icon (#22833) --- components/table/__tests__/Table.filter.test.js | 12 ++++++++++++ components/table/hooks/useFilter/index.tsx | 4 ++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/components/table/__tests__/Table.filter.test.js b/components/table/__tests__/Table.filter.test.js index bd5b772d8f..b08a863e10 100644 --- a/components/table/__tests__/Table.filter.test.js +++ b/components/table/__tests__/Table.filter.test.js @@ -57,6 +57,18 @@ describe('Table.filter', () => { return wrapper.find('BodyRow').map(row => row.props().record.name); } + it('not show filter icon when undefined', () => { + const noFilterColumn = { ...column, filters: undefined }; + delete noFilterColumn.onFilter; + const wrapper = mount( + createTable({ + columns: [noFilterColumn], + }), + ); + + expect(wrapper.find('.ant-table-filter-column')).toHaveLength(0); + }); + it('renders filter correctly', () => { const wrapper = mount(createTable()); diff --git a/components/table/hooks/useFilter/index.tsx b/components/table/hooks/useFilter/index.tsx index 7ff606a3a4..f56cf42c8f 100644 --- a/components/table/hooks/useFilter/index.tsx +++ b/components/table/hooks/useFilter/index.tsx @@ -31,7 +31,7 @@ function collectFilterStates( if ('children' in column) { filterStates = [...filterStates, ...collectFilterStates(column.children, init, columnPos)]; - } else if ('filters' in column || 'filterDropdown' in column || 'onFilter' in column) { + } else if (column.filters || 'filterDropdown' in column || 'onFilter' in column) { if ('filteredValue' in column) { // Controlled filterStates.push({ @@ -70,7 +70,7 @@ function injectFilter( const columnPos = getColumnPos(index, pos); const { filterMultiple = true } = column as ColumnType; - if ('filters' in column || 'filterDropdown' in column) { + if (column.filters || 'filterDropdown' in column) { const columnKey = getColumnKey(column, columnPos); const filterState = filterStates.find(({ key }) => columnKey === key); From 4bd488bfbe49a4330342e447fcabaf693f68b49a 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: Wed, 1 Apr 2020 23:31:22 +0800 Subject: [PATCH 06/21] fix align logic (#22836) --- .../typography/__tests__/__snapshots__/demo.test.js.snap | 9 +++++++++ components/typography/demo/ellipsis-debug.md | 4 ++++ components/typography/style/index.less | 5 +++++ 3 files changed, 18 insertions(+) diff --git a/components/typography/__tests__/__snapshots__/demo.test.js.snap b/components/typography/__tests__/__snapshots__/demo.test.js.snap index df5eb2ee25..4dace21b47 100644 --- a/components/typography/__tests__/__snapshots__/demo.test.js.snap +++ b/components/typography/__tests__/__snapshots__/demo.test.js.snap @@ -275,6 +275,15 @@ exports[`renders ./components/typography/demo/ellipsis-debug.md correctly 1`] = case. Bnt Design, a design language for background applications, is refined by Ant UED Team. Cnt Design, a design language for background applications, is refined by Ant UED Team. Dnt Design, a design language for background applications, is refined by Ant UED Team. Ent Design, a design language for background applications, is refined by Ant UED Team. +

+ 2333 + + 2333 + + 2333 +

`; diff --git a/components/typography/demo/ellipsis-debug.md b/components/typography/demo/ellipsis-debug.md index e44bd9370f..f1ddf9b7ed 100644 --- a/components/typography/demo/ellipsis-debug.md +++ b/components/typography/demo/ellipsis-debug.md @@ -63,6 +63,10 @@ class Demo extends React.Component { Hello World )} + +

+ 233323332333 +

); } diff --git a/components/typography/style/index.less b/components/typography/style/index.less index 14a65d82d4..4a1a1131ab 100644 --- a/components/typography/style/index.less +++ b/components/typography/style/index.less @@ -192,6 +192,11 @@ overflow: hidden; white-space: nowrap; text-overflow: ellipsis; + + // https://blog.csdn.net/iefreer/article/details/50421025 + span& { + vertical-align: bottom; + } } &-ellipsis-multiple-line { From 7bea8b92cccf436634e2d93863dcda5cabd17a55 Mon Sep 17 00:00:00 2001 From: myeunhyuk <39618466+myeunhyuk@users.noreply.github.com> Date: Thu, 2 Apr 2020 11:41:56 +0800 Subject: [PATCH 07/21] Update visualization-page.md (#22842) --- docs/spec/visualization-page.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/spec/visualization-page.md b/docs/spec/visualization-page.md index aadbeb3da9..001f8d3d26 100644 --- a/docs/spec/visualization-page.md +++ b/docs/spec/visualization-page.md @@ -169,7 +169,7 @@ title: #### 选择正确的色板 - + ## 延伸阅读 From c956de52ad342b22fc4aa6a81622f62ccd9b8c4a Mon Sep 17 00:00:00 2001 From: xrkffgg Date: Thu, 2 Apr 2020 11:42:15 +0800 Subject: [PATCH 08/21] style: fix menu rtl (#22841) --- components/menu/style/rtl.less | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/components/menu/style/rtl.less b/components/menu/style/rtl.less index d57a5c731a..4a17972689 100644 --- a/components/menu/style/rtl.less +++ b/components/menu/style/rtl.less @@ -4,6 +4,10 @@ @menu-prefix-cls: ~'@{ant-prefix}-menu'; .@{menu-prefix-cls} { + &-rtl { + direction: rtl; + } + &-item-group-title { .@{menu-prefix-cls}-rtl & { text-align: right; From aa119bd13ce3bc2f855381bd3c09a7a1ef35f953 Mon Sep 17 00:00:00 2001 From: Matt Foxx Date: Wed, 1 Apr 2020 23:47:50 -0400 Subject: [PATCH 09/21] docs: specify minimum less version (#22834) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore: specify minimum less version * Apply suggestions from code review Co-authored-by: 偏右 --- docs/react/use-with-create-react-app.en-US.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/react/use-with-create-react-app.en-US.md b/docs/react/use-with-create-react-app.en-US.md index b15eeebd37..817702398c 100644 --- a/docs/react/use-with-create-react-app.en-US.md +++ b/docs/react/use-with-create-react-app.en-US.md @@ -203,6 +203,8 @@ We have built-in dark theme and compact theme in antd, you can reference to [Use > You could also try [craco](https://github.com/sharegate/craco) and [craco-antd](https://github.com/FormAPI/craco-antd) to customize create-react-app webpack config same as customize-cra does. +> Note: It is recommended to use the latest version of `less`, or a minimum version greater than `3.1.0`. + ## Replace momentjs to Day.js You can use [antd-dayjs-webpack-plugin](https://github.com/ant-design/antd-dayjs-webpack-plugin) plugin to replace momentjs to Day.js to reduce bundle size dramatically. From 73bc95e718ca0f354facda2a95bae928d02e90d4 Mon Sep 17 00:00:00 2001 From: zombiej Date: Thu, 2 Apr 2020 12:03:36 +0800 Subject: [PATCH 10/21] docs: Update visual design doc --- docs/spec/visual.zh-CN.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/spec/visual.zh-CN.md b/docs/spec/visual.zh-CN.md index f943cff1c7..4a7b4aa668 100644 --- a/docs/spec/visual.zh-CN.md +++ b/docs/spec/visual.zh-CN.md @@ -70,7 +70,7 @@ title: 可视化 ### 色板 - + AntV 提供了一套默认的图表颜色,包括颜色的用法, From 2fa2f768f9e5295f974d64e308ddffa620242698 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=81=8F=E5=8F=B3?= Date: Thu, 2 Apr 2020 12:06:45 +0800 Subject: [PATCH 11/21] =?UTF-8?q?docs:=20=F0=9F=93=96=20tip=20for=20TypeSc?= =?UTF-8?q?ript=20version=20(#22845)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * docs: :book: tip for TypeScript version https://github.com/ant-design/ant-design/issues/22776#issuecomment-607600851 * Update use-in-typescript.en-US.md --- docs/react/use-in-typescript.en-US.md | 2 ++ docs/react/use-in-typescript.zh-CN.md | 2 ++ 2 files changed, 4 insertions(+) diff --git a/docs/react/use-in-typescript.en-US.md b/docs/react/use-in-typescript.en-US.md index 0404efaad1..a06718502e 100644 --- a/docs/react/use-in-typescript.en-US.md +++ b/docs/react/use-in-typescript.en-US.md @@ -5,6 +5,8 @@ title: Use in TypeScript Let's create a TypeScript project by using `create-react-app`, then import `antd` step by step. +> We build `antd` based on latest stable version of TypeScript (`>=3.8.4`), please make sure your project dependency matches it. + --- ## Install and Initialization diff --git a/docs/react/use-in-typescript.zh-CN.md b/docs/react/use-in-typescript.zh-CN.md index b33705b4b9..2af25a4054 100644 --- a/docs/react/use-in-typescript.zh-CN.md +++ b/docs/react/use-in-typescript.zh-CN.md @@ -5,6 +5,8 @@ title: 在 TypeScript 中使用 使用 `create-react-app` 一步步地创建一个 TypeScript 项目,并引入 antd。 +> `antd` 基于最新稳定版本的 TypeScript(`>=3.8.4`),请确保项目中使用匹配的版本。 + --- ## 安装和初始化 From b174f98c6cef923f802c61072cd87ef8fc4a3cd7 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: Thu, 2 Apr 2020 15:05:31 +0800 Subject: [PATCH 12/21] chore: Adjust range picker style (#22847) * adjust rangepicker style * update snapshot * fix lint * add aria label --- .../__snapshots__/components.test.js.snap | 15 +- .../__tests__/__snapshots__/demo.test.js.snap | 125 ++++----- .../__snapshots__/mount.test.js.snap | 5 +- components/date-picker/generatePicker.tsx | 2 +- components/date-picker/style/index.less | 38 ++- .../__tests__/__snapshots__/demo.test.js.snap | 10 +- .../__tests__/__snapshots__/demo.test.js.snap | 5 +- .../__snapshots__/index.test.js.snap | 260 +++++++----------- .../__tests__/__snapshots__/demo.test.js.snap | 5 +- 9 files changed, 203 insertions(+), 262 deletions(-) diff --git a/components/config-provider/__tests__/__snapshots__/components.test.js.snap b/components/config-provider/__tests__/__snapshots__/components.test.js.snap index ffef332b46..c3b665906d 100644 --- a/components/config-provider/__tests__/__snapshots__/components.test.js.snap +++ b/components/config-provider/__tests__/__snapshots__/components.test.js.snap @@ -6088,10 +6088,9 @@ exports[`ConfigProvider components DatePicker RangePicker configProvider 1`] = ` class="config-picker-range-separator" > - → - + />
- → - + />
- → - + />
- → - + />
- → - + />
- → - + />
- → - + />
- → - + />
- → - + />
- → - + />
- → - + />
- → - + />
- → - + />
- → - + />
- → - + />
- → - + />
- → - + />
- → - + />
- → - + />
- → - + />
- → - + />
- → - + />
- → - + />
- → - + />
- → - + />
- → - + />
- → - + />
- → - + />
- → - + />
(generateConfig: GenerateConfig) { return ( - separator={} + separator={} ref={this.pickerRef} placeholder={getRangePlaceholder(picker, locale)} suffixIcon={picker === 'time' ? : } diff --git a/components/date-picker/style/index.less b/components/date-picker/style/index.less index 222e35013f..de72a43278 100644 --- a/components/date-picker/style/index.less +++ b/components/date-picker/style/index.less @@ -126,15 +126,35 @@ } &-separator { + position: relative; display: inline-block; - align-self: center; - width: 2em; + width: 1em; height: @font-size-lg; - color: @disabled-color; - font-size: @font-size-lg; - line-height: @font-size-lg; - text-align: center; + vertical-align: top; cursor: default; + + &::before, + &::after { + position: absolute; + border-top: 1px solid #979797; + content: ''; + } + + &::before { + top: 50%; + left: 0.1em; + width: 0.8em; + } + + &::after { + top: 50%; + right: 0.11em; + width: 0.8em; + width: 0.3em; + transform: rotate(45deg); + transform-origin: 100% 100%; + } + .@{picker-prefix-cls}-range-separator & { .@{picker-prefix-cls}-disabled & { cursor: not-allowed; @@ -174,6 +194,12 @@ opacity: 1; } } + + &-separator { + align-items: center; + padding: 0 @padding-xs; + line-height: 1; + } } // ======================= Dropdown ======================= diff --git a/components/form/__tests__/__snapshots__/demo.test.js.snap b/components/form/__tests__/__snapshots__/demo.test.js.snap index f5ea9f8fd2..eba1c41ea2 100644 --- a/components/form/__tests__/__snapshots__/demo.test.js.snap +++ b/components/form/__tests__/__snapshots__/demo.test.js.snap @@ -3552,10 +3552,9 @@ exports[`renders ./components/form/demo/time-related-controls.md correctly 1`] = class="ant-picker-range-separator" > - → - + />
- → - + />
- → - + />
- → - + />
- → - + />
- → - + />
- → - + />
- → - + />
- → - + />
- → - + />
- → - + />
- → - + />
- → - + />
- → - + />
- → - + />
- → - + />
- → - + />
- → - + />
- → - + />
- → - + />
- → - + />
- → - + />
- → - + />
- → - + />
- → - + />
- → - + />
- → - + />
- → - + />
- → - + />
- → - + />
- → - + />
- → - + />
- → - + />
- → - + />
- → - + />
- → - + />
- → - + />
- → - + />
- → - + />
- → - + />
- → - + />
- → - + />
- → - + />
- → - + />
- → - + />
- → - + />
- → - + />
- → - + />
- → - + />
- → - + />
- → - + />
- → - + />
- → - + />
- → - + />
- → - + />
- → - + />
Date: Thu, 2 Apr 2020 15:46:07 +0800 Subject: [PATCH 13/21] refactor: Refactor picker generate to multiple files (#22850) * move single picker out * move generateRangePicker out * fix compile --- components/date-picker/generatePicker.tsx | 380 ------------------ .../generatePicker/generateRangePicker.tsx | 116 ++++++ .../generatePicker/generateSinglePicker.tsx | 155 +++++++ .../date-picker/generatePicker/index.tsx | 152 +++++++ 4 files changed, 423 insertions(+), 380 deletions(-) delete mode 100644 components/date-picker/generatePicker.tsx create mode 100644 components/date-picker/generatePicker/generateRangePicker.tsx create mode 100644 components/date-picker/generatePicker/generateSinglePicker.tsx create mode 100644 components/date-picker/generatePicker/index.tsx diff --git a/components/date-picker/generatePicker.tsx b/components/date-picker/generatePicker.tsx deleted file mode 100644 index 60853d1ea6..0000000000 --- a/components/date-picker/generatePicker.tsx +++ /dev/null @@ -1,380 +0,0 @@ -import * as React from 'react'; -import classNames from 'classnames'; -import RCPicker, { RangePicker as RCRangePicker } from 'rc-picker'; -import { GenerateConfig } from 'rc-picker/lib/generate/index'; -import { - PickerBaseProps as RCPickerBaseProps, - PickerDateProps as RCPickerDateProps, - PickerTimeProps as RCPickerTimeProps, -} from 'rc-picker/lib/Picker'; -import { SharedTimeProps } from 'rc-picker/lib/panels/TimePanel'; -import { - RangePickerBaseProps as RCRangePickerBaseProps, - RangePickerDateProps as RCRangePickerDateProps, - RangePickerTimeProps as RCRangePickerTimeProps, -} from 'rc-picker/lib/RangePicker'; -import { PickerMode, Locale as RcPickerLocale } from 'rc-picker/lib/interface'; -import CalendarOutlined from '@ant-design/icons/CalendarOutlined'; -import ClockCircleOutlined from '@ant-design/icons/ClockCircleOutlined'; -import CloseCircleFilled from '@ant-design/icons/CloseCircleFilled'; -import { ConfigContext, ConfigConsumerProps } from '../config-provider'; -import LocaleReceiver from '../locale-provider/LocaleReceiver'; -import enUS from './locale/en_US'; -import { getPlaceholder, getRangePlaceholder } from './util'; -import PickerButton from './PickerButton'; -import PickerTag from './PickerTag'; -import SizeContext, { SizeType } from '../config-provider/SizeContext'; -import { TimePickerLocale } from '../time-picker'; - -const Components = { button: PickerButton, rangeItem: PickerTag }; - -function toArray(list: T | T[]): T[] { - if (!list) { - return []; - } - return Array.isArray(list) ? list : [list]; -} - -function getTimeProps( - props: { format?: string; picker?: PickerMode } & SharedTimeProps, -) { - const { format, picker, showHour, showMinute, showSecond, use12Hours } = props; - - const firstFormat = toArray(format)[0]; - const showTimeObj: SharedTimeProps = { ...props }; - - if (firstFormat) { - if (!firstFormat.includes('s') && showSecond === undefined) { - showTimeObj.showSecond = false; - } - if (!firstFormat.includes('m') && showMinute === undefined) { - showTimeObj.showMinute = false; - } - if (!firstFormat.includes('H') && !firstFormat.includes('h') && showHour === undefined) { - showTimeObj.showHour = false; - } - - if ((firstFormat.includes('a') || firstFormat.includes('A')) && use12Hours === undefined) { - showTimeObj.use12Hours = true; - } - } - - if (picker === 'time') { - return showTimeObj; - } - - return { - showTime: showTimeObj, - }; -} - -type InjectDefaultProps = Omit< - Props, - | 'locale' - | 'generateConfig' - | 'prevIcon' - | 'nextIcon' - | 'superPrevIcon' - | 'superNextIcon' - | 'hideHeader' - | 'components' -> & { - locale?: PickerLocale; - size?: SizeType; - bordered?: boolean; -}; - -export type PickerLocale = { - lang: RcPickerLocale & AdditionalPickerLocaleLangProps; - timePickerLocale: TimePickerLocale; -} & AdditionalPickerLocaleProps; - -export type AdditionalPickerLocaleProps = { - dateFormat?: string; - dateTimeFormat?: string; - weekFormat?: string; - monthFormat?: string; -}; - -export type AdditionalPickerLocaleLangProps = { - placeholder: string; - yearPlaceholder?: string; - quarterPlaceholder?: string; - monthPlaceholder?: string; - weekPlaceholder?: string; - rangeYearPlaceholder?: [string, string]; - rangeMonthPlaceholder?: [string, string]; - rangeWeekPlaceholder?: [string, string]; - rangePlaceholder?: [string, string]; -}; - -// Picker Props -export type PickerBaseProps = InjectDefaultProps>; -export type PickerDateProps = InjectDefaultProps>; -export type PickerTimeProps = InjectDefaultProps>; - -export type PickerProps = - | PickerBaseProps - | PickerDateProps - | PickerTimeProps; - -// Range Picker Props -export type RangePickerBaseProps = InjectDefaultProps>; -export type RangePickerDateProps = InjectDefaultProps>; -export type RangePickerTimeProps = InjectDefaultProps>; - -export type RangePickerProps = - | RangePickerBaseProps - | RangePickerDateProps - | RangePickerTimeProps; - -function generatePicker(generateConfig: GenerateConfig) { - // =========================== Picker =========================== - type DatePickerProps = PickerProps; - - function getPicker( - picker?: PickerMode, - displayName?: string, - ) { - class Picker extends React.Component { - static contextType = ConfigContext; - - static displayName: string; - - context: ConfigConsumerProps; - - pickerRef = React.createRef>(); - - focus = () => { - if (this.pickerRef.current) { - this.pickerRef.current.focus(); - } - }; - - blur = () => { - if (this.pickerRef.current) { - this.pickerRef.current.blur(); - } - }; - - getDefaultLocale = () => { - const { locale } = this.props; - const result = { - ...enUS, - ...locale, - }; - result.lang = { - ...result.lang, - ...((locale || {}) as PickerLocale).lang, - }; - return result; - }; - - renderPicker = (locale: PickerLocale) => { - const { getPrefixCls, direction } = this.context; - const { - prefixCls: customizePrefixCls, - className, - size: customizeSize, - bordered = true, - ...restProps - } = this.props; - const { format, showTime } = this.props as any; - const prefixCls = getPrefixCls('picker', customizePrefixCls); - - const additionalProps = { - showToday: true, - }; - - let additionalOverrideProps: any = {}; - if (picker) { - additionalOverrideProps.picker = picker; - } - const mergedPicker = picker || this.props.picker; - - additionalOverrideProps = { - ...additionalOverrideProps, - ...(showTime ? getTimeProps({ format, picker: mergedPicker, ...showTime }) : {}), - ...(mergedPicker === 'time' - ? getTimeProps({ format, ...this.props, picker: mergedPicker }) - : {}), - }; - - return ( - - {size => { - const mergedSize = customizeSize || size; - - return ( - - ref={this.pickerRef} - placeholder={getPlaceholder(mergedPicker, locale)} - suffixIcon={ - mergedPicker === 'time' ? : - } - clearIcon={} - allowClear - transitionName="slide-up" - {...additionalProps} - {...restProps} - {...additionalOverrideProps} - locale={locale!.lang} - className={classNames(className, { - [`${prefixCls}-${mergedSize}`]: mergedSize, - [`${prefixCls}-borderless`]: !bordered, - })} - prefixCls={prefixCls} - generateConfig={generateConfig} - prevIcon={} - nextIcon={} - superPrevIcon={} - superNextIcon={} - components={Components} - direction={direction} - /> - ); - }} - - ); - }; - - render() { - return ( - - {this.renderPicker} - - ); - } - } - - if (displayName) { - Picker.displayName = displayName; - } - - return Picker as React.ComponentClass; - } - - const DatePicker = getPicker(); - const WeekPicker = getPicker, 'picker'>>('week', 'WeekPicker'); - const MonthPicker = getPicker, 'picker'>>('month', 'MonthPicker'); - const YearPicker = getPicker, 'picker'>>('year', 'YearPicker'); - const TimePicker = getPicker, 'picker'>>('time', 'TimePicker'); - - // ======================== Range Picker ======================== - class RangePicker extends React.Component> { - static contextType = ConfigContext; - - context: ConfigConsumerProps; - - pickerRef = React.createRef>(); - - focus = () => { - if (this.pickerRef.current) { - this.pickerRef.current.focus(); - } - }; - - blur = () => { - if (this.pickerRef.current) { - this.pickerRef.current.blur(); - } - }; - - getDefaultLocale = () => { - const { locale } = this.props; - const result = { - ...enUS, - ...locale, - }; - result.lang = { - ...result.lang, - ...((locale || {}) as PickerLocale).lang, - }; - return result; - }; - - renderPicker = (locale: PickerLocale) => { - const { getPrefixCls, direction } = this.context; - const { - prefixCls: customizePrefixCls, - className, - size: customizeSize, - bordered = true, - ...restProps - } = this.props; - const { format, showTime, picker } = this.props as any; - const prefixCls = getPrefixCls('picker', customizePrefixCls); - - let additionalOverrideProps: any = {}; - - additionalOverrideProps = { - ...additionalOverrideProps, - ...(showTime ? getTimeProps({ format, picker, ...showTime }) : {}), - ...(picker === 'time' ? getTimeProps({ format, ...this.props, picker }) : {}), - }; - - return ( - - {size => { - const mergedSize = customizeSize || size; - - return ( - - separator={} - ref={this.pickerRef} - placeholder={getRangePlaceholder(picker, locale)} - suffixIcon={picker === 'time' ? : } - clearIcon={} - allowClear - transitionName="slide-up" - {...restProps} - className={classNames(className, { - [`${prefixCls}-${mergedSize}`]: mergedSize, - [`${prefixCls}-borderless`]: !bordered, - })} - {...additionalOverrideProps} - locale={locale!.lang} - prefixCls={prefixCls} - generateConfig={generateConfig} - prevIcon={} - nextIcon={} - superPrevIcon={} - superNextIcon={} - components={Components} - direction={direction} - /> - ); - }} - - ); - }; - - render() { - return ( - - {this.renderPicker} - - ); - } - } - - // =========================== Export =========================== - type MergedDatePicker = typeof DatePicker & { - WeekPicker: typeof WeekPicker; - MonthPicker: typeof MonthPicker; - YearPicker: typeof YearPicker; - RangePicker: React.ComponentClass>; - TimePicker: typeof TimePicker; - }; - - const MergedDatePicker = DatePicker as MergedDatePicker; - MergedDatePicker.WeekPicker = WeekPicker; - MergedDatePicker.MonthPicker = MonthPicker; - MergedDatePicker.YearPicker = YearPicker; - MergedDatePicker.RangePicker = RangePicker; - MergedDatePicker.TimePicker = TimePicker; - - return MergedDatePicker; -} - -export default generatePicker; diff --git a/components/date-picker/generatePicker/generateRangePicker.tsx b/components/date-picker/generatePicker/generateRangePicker.tsx new file mode 100644 index 0000000000..99ce021133 --- /dev/null +++ b/components/date-picker/generatePicker/generateRangePicker.tsx @@ -0,0 +1,116 @@ +import * as React from 'react'; +import classNames from 'classnames'; +import CalendarOutlined from '@ant-design/icons/CalendarOutlined'; +import ClockCircleOutlined from '@ant-design/icons/ClockCircleOutlined'; +import CloseCircleFilled from '@ant-design/icons/CloseCircleFilled'; +import { RangePicker as RCRangePicker } from 'rc-picker'; +import { GenerateConfig } from 'rc-picker/lib/generate/index'; +import enUS from '../locale/en_US'; +import { ConfigContext, ConfigConsumerProps } from '../../config-provider'; +import SizeContext from '../../config-provider/SizeContext'; +import LocaleReceiver from '../../locale-provider/LocaleReceiver'; +import { getRangePlaceholder } from '../util'; +import { RangePickerProps, PickerLocale, getTimeProps, Components } from '.'; + +export default function generateRangePicker( + generateConfig: GenerateConfig, +): React.ComponentClass> { + class RangePicker extends React.Component> { + static contextType = ConfigContext; + + context: ConfigConsumerProps; + + pickerRef = React.createRef>(); + + focus = () => { + if (this.pickerRef.current) { + this.pickerRef.current.focus(); + } + }; + + blur = () => { + if (this.pickerRef.current) { + this.pickerRef.current.blur(); + } + }; + + getDefaultLocale = () => { + const { locale } = this.props; + const result = { + ...enUS, + ...locale, + }; + result.lang = { + ...result.lang, + ...((locale || {}) as PickerLocale).lang, + }; + return result; + }; + + renderPicker = (locale: PickerLocale) => { + const { getPrefixCls, direction } = this.context; + const { + prefixCls: customizePrefixCls, + className, + size: customizeSize, + bordered = true, + ...restProps + } = this.props; + const { format, showTime, picker } = this.props as any; + const prefixCls = getPrefixCls('picker', customizePrefixCls); + + let additionalOverrideProps: any = {}; + + additionalOverrideProps = { + ...additionalOverrideProps, + ...(showTime ? getTimeProps({ format, picker, ...showTime }) : {}), + ...(picker === 'time' ? getTimeProps({ format, ...this.props, picker }) : {}), + }; + + return ( + + {size => { + const mergedSize = customizeSize || size; + + return ( + + separator={} + ref={this.pickerRef} + placeholder={getRangePlaceholder(picker, locale)} + suffixIcon={picker === 'time' ? : } + clearIcon={} + allowClear + transitionName="slide-up" + {...restProps} + className={classNames(className, { + [`${prefixCls}-${mergedSize}`]: mergedSize, + [`${prefixCls}-borderless`]: !bordered, + })} + {...additionalOverrideProps} + locale={locale!.lang} + prefixCls={prefixCls} + generateConfig={generateConfig} + prevIcon={} + nextIcon={} + superPrevIcon={} + superNextIcon={} + components={Components} + direction={direction} + /> + ); + }} + + ); + }; + + render() { + return ( + + {this.renderPicker} + + ); + } + } + + return RangePicker; +} diff --git a/components/date-picker/generatePicker/generateSinglePicker.tsx b/components/date-picker/generatePicker/generateSinglePicker.tsx new file mode 100644 index 0000000000..3c28fe4d23 --- /dev/null +++ b/components/date-picker/generatePicker/generateSinglePicker.tsx @@ -0,0 +1,155 @@ +import * as React from 'react'; +import classNames from 'classnames'; +import CalendarOutlined from '@ant-design/icons/CalendarOutlined'; +import ClockCircleOutlined from '@ant-design/icons/ClockCircleOutlined'; +import CloseCircleFilled from '@ant-design/icons/CloseCircleFilled'; +import RCPicker from 'rc-picker'; +import { PickerMode } from 'rc-picker/lib/interface'; +import { GenerateConfig } from 'rc-picker/lib/generate/index'; +import enUS from '../locale/en_US'; +import { getPlaceholder } from '../util'; +import { ConfigContext, ConfigConsumerProps } from '../../config-provider'; +import LocaleReceiver from '../../locale-provider/LocaleReceiver'; +import SizeContext from '../../config-provider/SizeContext'; +import { + PickerProps, + PickerLocale, + PickerDateProps, + PickerTimeProps, + getTimeProps, + Components, +} from '.'; + +export default function generatePicker(generateConfig: GenerateConfig) { + type DatePickerProps = PickerProps; + + function getPicker( + picker?: PickerMode, + displayName?: string, + ) { + class Picker extends React.Component { + static contextType = ConfigContext; + + static displayName: string; + + context: ConfigConsumerProps; + + pickerRef = React.createRef>(); + + focus = () => { + if (this.pickerRef.current) { + this.pickerRef.current.focus(); + } + }; + + blur = () => { + if (this.pickerRef.current) { + this.pickerRef.current.blur(); + } + }; + + getDefaultLocale = () => { + const { locale } = this.props; + const result = { + ...enUS, + ...locale, + }; + result.lang = { + ...result.lang, + ...((locale || {}) as PickerLocale).lang, + }; + return result; + }; + + renderPicker = (locale: PickerLocale) => { + const { getPrefixCls, direction } = this.context; + const { + prefixCls: customizePrefixCls, + className, + size: customizeSize, + bordered = true, + ...restProps + } = this.props; + const { format, showTime } = this.props as any; + const prefixCls = getPrefixCls('picker', customizePrefixCls); + + const additionalProps = { + showToday: true, + }; + + let additionalOverrideProps: any = {}; + if (picker) { + additionalOverrideProps.picker = picker; + } + const mergedPicker = picker || this.props.picker; + + additionalOverrideProps = { + ...additionalOverrideProps, + ...(showTime ? getTimeProps({ format, picker: mergedPicker, ...showTime }) : {}), + ...(mergedPicker === 'time' + ? getTimeProps({ format, ...this.props, picker: mergedPicker }) + : {}), + }; + + return ( + + {size => { + const mergedSize = customizeSize || size; + + return ( + + ref={this.pickerRef} + placeholder={getPlaceholder(mergedPicker, locale)} + suffixIcon={ + mergedPicker === 'time' ? : + } + clearIcon={} + allowClear + transitionName="slide-up" + {...additionalProps} + {...restProps} + {...additionalOverrideProps} + locale={locale!.lang} + className={classNames(className, { + [`${prefixCls}-${mergedSize}`]: mergedSize, + [`${prefixCls}-borderless`]: !bordered, + })} + prefixCls={prefixCls} + generateConfig={generateConfig} + prevIcon={} + nextIcon={} + superPrevIcon={} + superNextIcon={} + components={Components} + direction={direction} + /> + ); + }} + + ); + }; + + render() { + return ( + + {this.renderPicker} + + ); + } + } + + if (displayName) { + Picker.displayName = displayName; + } + + return Picker as React.ComponentClass; + } + + const DatePicker = getPicker(); + const WeekPicker = getPicker, 'picker'>>('week', 'WeekPicker'); + const MonthPicker = getPicker, 'picker'>>('month', 'MonthPicker'); + const YearPicker = getPicker, 'picker'>>('year', 'YearPicker'); + const TimePicker = getPicker, 'picker'>>('time', 'TimePicker'); + + return { DatePicker, WeekPicker, MonthPicker, YearPicker, TimePicker }; +} diff --git a/components/date-picker/generatePicker/index.tsx b/components/date-picker/generatePicker/index.tsx new file mode 100644 index 0000000000..3496b08c57 --- /dev/null +++ b/components/date-picker/generatePicker/index.tsx @@ -0,0 +1,152 @@ +import * as React from 'react'; +import { GenerateConfig } from 'rc-picker/lib/generate/index'; +import { + PickerBaseProps as RCPickerBaseProps, + PickerDateProps as RCPickerDateProps, + PickerTimeProps as RCPickerTimeProps, +} from 'rc-picker/lib/Picker'; +import { SharedTimeProps } from 'rc-picker/lib/panels/TimePanel'; +import { + RangePickerBaseProps as RCRangePickerBaseProps, + RangePickerDateProps as RCRangePickerDateProps, + RangePickerTimeProps as RCRangePickerTimeProps, +} from 'rc-picker/lib/RangePicker'; +import { PickerMode, Locale as RcPickerLocale } from 'rc-picker/lib/interface'; +import { SizeType } from '../../config-provider/SizeContext'; +import PickerButton from '../PickerButton'; +import PickerTag from '../PickerTag'; +import { TimePickerLocale } from '../../time-picker'; +import generateSinglePicker from './generateSinglePicker'; +import generateRangePicker from './generateRangePicker'; + +export const Components = { button: PickerButton, rangeItem: PickerTag }; + +function toArray(list: T | T[]): T[] { + if (!list) { + return []; + } + return Array.isArray(list) ? list : [list]; +} + +export function getTimeProps( + props: { format?: string; picker?: PickerMode } & SharedTimeProps, +) { + const { format, picker, showHour, showMinute, showSecond, use12Hours } = props; + + const firstFormat = toArray(format)[0]; + const showTimeObj: SharedTimeProps = { ...props }; + + if (firstFormat) { + if (!firstFormat.includes('s') && showSecond === undefined) { + showTimeObj.showSecond = false; + } + if (!firstFormat.includes('m') && showMinute === undefined) { + showTimeObj.showMinute = false; + } + if (!firstFormat.includes('H') && !firstFormat.includes('h') && showHour === undefined) { + showTimeObj.showHour = false; + } + + if ((firstFormat.includes('a') || firstFormat.includes('A')) && use12Hours === undefined) { + showTimeObj.use12Hours = true; + } + } + + if (picker === 'time') { + return showTimeObj; + } + + return { + showTime: showTimeObj, + }; +} + +type InjectDefaultProps = Omit< + Props, + | 'locale' + | 'generateConfig' + | 'prevIcon' + | 'nextIcon' + | 'superPrevIcon' + | 'superNextIcon' + | 'hideHeader' + | 'components' +> & { + locale?: PickerLocale; + size?: SizeType; + bordered?: boolean; +}; + +export type PickerLocale = { + lang: RcPickerLocale & AdditionalPickerLocaleLangProps; + timePickerLocale: TimePickerLocale; +} & AdditionalPickerLocaleProps; + +export type AdditionalPickerLocaleProps = { + dateFormat?: string; + dateTimeFormat?: string; + weekFormat?: string; + monthFormat?: string; +}; + +export type AdditionalPickerLocaleLangProps = { + placeholder: string; + yearPlaceholder?: string; + quarterPlaceholder?: string; + monthPlaceholder?: string; + weekPlaceholder?: string; + rangeYearPlaceholder?: [string, string]; + rangeMonthPlaceholder?: [string, string]; + rangeWeekPlaceholder?: [string, string]; + rangePlaceholder?: [string, string]; +}; + +// Picker Props +export type PickerBaseProps = InjectDefaultProps>; +export type PickerDateProps = InjectDefaultProps>; +export type PickerTimeProps = InjectDefaultProps>; + +export type PickerProps = + | PickerBaseProps + | PickerDateProps + | PickerTimeProps; + +// Range Picker Props +export type RangePickerBaseProps = InjectDefaultProps>; +export type RangePickerDateProps = InjectDefaultProps>; +export type RangePickerTimeProps = InjectDefaultProps>; + +export type RangePickerProps = + | RangePickerBaseProps + | RangePickerDateProps + | RangePickerTimeProps; + +function generatePicker(generateConfig: GenerateConfig) { + // =========================== Picker =========================== + const { DatePicker, WeekPicker, MonthPicker, YearPicker, TimePicker } = generateSinglePicker( + generateConfig, + ); + + // ======================== Range Picker ======================== + const RangePicker = generateRangePicker(generateConfig); + + // =========================== Export =========================== + type MergedDatePicker = typeof DatePicker & { + WeekPicker: typeof WeekPicker; + MonthPicker: typeof MonthPicker; + YearPicker: typeof YearPicker; + RangePicker: React.ComponentClass>; + TimePicker: typeof TimePicker; + }; + + const MergedDatePicker = DatePicker as MergedDatePicker; + MergedDatePicker.WeekPicker = WeekPicker; + MergedDatePicker.MonthPicker = MonthPicker; + MergedDatePicker.YearPicker = YearPicker; + MergedDatePicker.RangePicker = RangePicker; + MergedDatePicker.TimePicker = TimePicker; + + return MergedDatePicker; +} + +export default generatePicker; From 11f8d7758bbeede47121e79e3f85b2f49de8102b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=81=8F=E5=8F=B3?= Date: Thu, 2 Apr 2020 16:10:41 +0800 Subject: [PATCH 14/21] =?UTF-8?q?chore:=20=F0=9F=A4=96=20auto=20push=20gh-?= =?UTF-8?q?pages=20to=20gitee=20(#22846)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index a3043efb39..93ebaf5dc9 100644 --- a/package.json +++ b/package.json @@ -51,8 +51,8 @@ "bundlesize": "bundlesize", "check-commit": "node ./scripts/check-commit.js", "compile": "antd-tools run compile", - "predeploy": "antd-tools run clean && npm run site && cp netlify.toml CNAME _site && cp -r .circleci/ _site && npm run site:test", - "deploy": "bisheng gh-pages --push-only", + "predeploy": "antd-tools run clean && npm run site && cp netlify.toml CNAME _site && cp -r .circleci/ .github/ _site && npm run site:test", + "deploy": "bisheng gh-pages --push-only --dotfiles", "deploy:china-mirror": "git checkout gh-pages && git pull origin gh-pages && git push git@gitee.com:ant-design/ant-design.git gh-pages", "dist": "antd-tools run dist", "lint": "npm run lint:tsc && npm run lint:script && npm run lint:demo && npm run lint:style && npm run lint:deps", @@ -164,7 +164,7 @@ "antd-theme-generator": "^1.1.6", "babel-eslint": "^10.0.1", "babel-plugin-add-react-displayname": "^0.0.5", - "bisheng": "^1.4.6", + "bisheng": "^1.5.1", "bisheng-plugin-description": "^0.1.4", "bisheng-plugin-react": "^1.1.0", "bisheng-plugin-toc": "^0.4.4", From de827d7eb7ab7fbefbe66793c13e0b7af1b68229 Mon Sep 17 00:00:00 2001 From: Hanjun Kim Date: Thu, 2 Apr 2020 18:47:39 +0900 Subject: [PATCH 15/21] fix typo (#22856) `bellow` -> `below` --- components/form/index.en-US.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/form/index.en-US.md b/components/form/index.en-US.md index bff512333c..8ec4d16ef7 100644 --- a/components/form/index.en-US.md +++ b/components/form/index.en-US.md @@ -84,7 +84,7 @@ Form field component for data bidirectional binding, validation, layout, and so | normalize | Normalize value to form component | (value, prevValue, prevValues) => any | - | | required | Whether provided or not, it will be generated by the validation rule | boolean | false | | rules | Rules for field validation. Click [here](#components-form-demo-basic) to see an example | [Rule](#Rule)[] | - | -| shouldUpdate | Custom field update logic. See [bellow](#shouldUpdate) | boolean \| (prevValue, curValue) => boolean | false | +| shouldUpdate | Custom field update logic. See [below](#shouldUpdate) | boolean \| (prevValue, curValue) => boolean | false | | trigger | When to collect the value of children node | string | onChange | | validateFirst | Whether stop validate on first rule of error for this field | boolean | false | | validateStatus | The validation status. If not provided, it will be generated by validation rule. options: 'success' 'warning' 'error' 'validating' | string | - | From b28b2007bea6f960c713528d594ca97abf3a571b 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: Thu, 2 Apr 2020 18:53:49 +0800 Subject: [PATCH 16/21] fix: Center not work in Table (#22858) * fix: Center not work in Table * update snapshot * fix test case --- .../__snapshots__/components.test.js.snap | 270 +++-- .../table/__tests__/Table.sorter.test.js | 19 +- .../__snapshots__/Table.sorter.test.js.snap | 180 +-- .../__tests__/__snapshots__/demo.test.js.snap | 1042 +++++++++-------- components/table/hooks/useSorter.tsx | 4 +- components/table/style/index.less | 8 +- 6 files changed, 798 insertions(+), 725 deletions(-) diff --git a/components/config-provider/__tests__/__snapshots__/components.test.js.snap b/components/config-provider/__tests__/__snapshots__/components.test.js.snap index c3b665906d..4516550e00 100644 --- a/components/config-provider/__tests__/__snapshots__/components.test.js.snap +++ b/components/config-provider/__tests__/__snapshots__/components.test.js.snap @@ -11629,59 +11629,63 @@ exports[`ConfigProvider components Table configProvider 1`] = ` class="config-table-filter-column-title" >
- - Name - - + + Name + - - - - + + - - + + - +
- - Name - - + + Name + - - - - + + - - + + - +
- - Name - - + + Name + - - - - + + - - + + - +
{ jest.useFakeTimers(); const wrapper = mount(createTable({})); // default show sorter tooltip - wrapper.find('.ant-table-column-sorters').simulate('mouseenter'); + wrapper.find('.ant-table-column-sorters-with-tooltip').simulate('mouseenter'); jest.runAllTimers(); wrapper.update(); expect(wrapper.find('.ant-tooltip-open').length).toBeTruthy(); - wrapper.find('.ant-table-column-sorters').simulate('mouseout'); + wrapper.find('.ant-table-column-sorters-with-tooltip').simulate('mouseout'); + // set table props showSorterTooltip is false wrapper.setProps({ showSorterTooltip: false }); - wrapper.find('.ant-table-column-sorters').simulate('mouseenter'); + expect(wrapper.find('.ant-table-column-sorters-with-tooltip')).toHaveLength(0); jest.runAllTimers(); wrapper.update(); - expect(wrapper.find('.ant-tooltip-open').length).toBeFalsy(); - wrapper.find('.ant-table-column-sorters').simulate('mouseout'); + expect(wrapper.find('.ant-tooltip-open')).toHaveLength(0); // set table props showSorterTooltip is false, column showSorterTooltip is true wrapper.setProps({ showSorterTooltip: false, columns: [{ ...column, showSorterTooltip: true }], }); - wrapper.find('.ant-table-column-sorters').simulate('mouseenter'); + wrapper.find('.ant-table-column-sorters-with-tooltip').simulate('mouseenter'); jest.runAllTimers(); wrapper.update(); expect(wrapper.find('.ant-tooltip-open').length).toBeTruthy(); - wrapper.find('.ant-table-column-sorters').simulate('mouseout'); + wrapper.find('.ant-table-column-sorters-with-tooltip').simulate('mouseout'); // set table props showSorterTooltip is true, column showSorterTooltip is false wrapper.setProps({ showSorterTooltip: true, columns: [{ ...column, showSorterTooltip: false }], }); - wrapper.find('.ant-table-column-sorters').simulate('mouseenter'); + expect(wrapper.find('.ant-table-column-sorters-with-tooltip')).toHaveLength(0); jest.runAllTimers(); wrapper.update(); - expect(wrapper.find('.ant-tooltip-open').length).toBeFalsy(); - wrapper.find('.ant-table-column-sorters').simulate('mouseout'); + expect(wrapper.find('.ant-tooltip-open')).toHaveLength(0); }); it('works with grouping columns in controlled mode', () => { diff --git a/components/table/__tests__/__snapshots__/Table.sorter.test.js.snap b/components/table/__tests__/__snapshots__/Table.sorter.test.js.snap index 8be89d35ef..b1c37ca2e2 100644 --- a/components/table/__tests__/__snapshots__/Table.sorter.test.js.snap +++ b/components/table/__tests__/__snapshots__/Table.sorter.test.js.snap @@ -9,59 +9,63 @@ exports[`Table.sorter renders sorter icon correctly 1`] = ` class="ant-table-cell ant-table-column-has-sorters" >
- - Name - - + + Name + - - - - + + - - + + - +
@@ -99,59 +103,63 @@ exports[`Table.sorter should support defaultOrder in Column 1`] = ` class="ant-table-cell ant-table-column-sort ant-table-column-has-sorters" >
- - Age - - + + Age + - - - - + + - - + + - +
diff --git a/components/table/__tests__/__snapshots__/demo.test.js.snap b/components/table/__tests__/__snapshots__/demo.test.js.snap index 1563aac018..a0ad4d0c57 100644 --- a/components/table/__tests__/__snapshots__/demo.test.js.snap +++ b/components/table/__tests__/__snapshots__/demo.test.js.snap @@ -38,59 +38,63 @@ exports[`renders ./components/table/demo/ajax.md correctly 1`] = ` class="ant-table-cell ant-table-column-has-sorters" >
- - Name - - + + Name + - - - - + + - - + + - +
@@ -10580,59 +10612,63 @@ exports[`renders ./components/table/demo/reset-filter.md correctly 1`] = ` class="ant-table-filter-column-title" >
- - Name - - + + Name + - - - - + + - - + + - +
- - Age - - + + Age + - - - - + + - - + + - +
- - - + + - - + + - - + + - - + + - - + + +
- - Age - - + + Age + - - - - + + - - + + - +
- - Name - - + + Name + - + + - +
- - Age - - + + Age + - - - - + + - - + + - +
- - Address - - + + Address + - - - - + + - - + + - +
- - Chinese Score - - + + Chinese Score + - - - - + + - - + + - +
- - Math Score - - + + Math Score + - - - - + + - - + + - +
- - English Score - - + + English Score + - - - - + + - - + + - +
- - Address - - + + Address + - - - - + + - - + + - +
- - Amount - - + + Amount + - - - - + + - - + + - +
( ); return showSorterTooltip ? ( - {renderSortTitle} + +
{renderSortTitle}
+
) : ( renderSortTitle ); diff --git a/components/table/style/index.less b/components/table/style/index.less index fe49a9f7b6..4e577a91ba 100644 --- a/components/table/style/index.less +++ b/components/table/style/index.less @@ -199,10 +199,14 @@ background: @table-body-sort-bg; } + &-column-sorters-with-tooltip { + display: inline-block; + width: 100%; + } + &-column-sorters { display: inline-flex; align-items: center; - width: 100%; padding: @table-padding-vertical @table-padding-horizontal; } @@ -361,7 +365,7 @@ top: 0; right: -10px; cursor: pointer; - transition: all .3s; + transition: all 0.3s; .@{iconfont-css-prefix} { .iconfont-size-under-12px(10px); From 14cd2dc434328ef7240974edbe3c002ec602e386 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: Thu, 2 Apr 2020 22:22:34 +0800 Subject: [PATCH 17/21] adjust nest table logic (#22868) --- components/table/style/index.less | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/components/table/style/index.less b/components/table/style/index.less index 4e577a91ba..71fff4d5e5 100644 --- a/components/table/style/index.less +++ b/components/table/style/index.less @@ -124,20 +124,22 @@ } // ========================= Nest Table =========================== - .@{table-prefix-cls} { - margin: -@table-padding-vertical -@table-padding-horizontal -@table-padding-vertical (@table-padding-horizontal + - ceil(@font-size-sm * 1.4)); + .@{table-prefix-cls}-wrapper:only-child { + .@{table-prefix-cls} { + margin: -@table-padding-vertical -@table-padding-horizontal -@table-padding-vertical (@table-padding-horizontal + + ceil(@font-size-sm * 1.4)); - td { - background: transparent; - } + td { + background: transparent; + } - &-tbody > tr:last-child > td { - border-bottom: 0; + &-tbody > tr:last-child > td { + border-bottom: 0; - &:first-child, - &:last-child { - border-radius: 0; + &:first-child, + &:last-child { + border-radius: 0; + } } } } From 7c39adab6a6d00f2443935f102309339d31b2aee Mon Sep 17 00:00:00 2001 From: xrkffgg Date: Fri, 3 Apr 2020 09:47:39 +0800 Subject: [PATCH 18/21] docs: add create-react-app cn (#22869) --- docs/react/use-with-create-react-app.en-US.md | 2 +- docs/react/use-with-create-react-app.zh-CN.md | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/docs/react/use-with-create-react-app.en-US.md b/docs/react/use-with-create-react-app.en-US.md index 817702398c..eabcbca669 100644 --- a/docs/react/use-with-create-react-app.en-US.md +++ b/docs/react/use-with-create-react-app.en-US.md @@ -203,7 +203,7 @@ We have built-in dark theme and compact theme in antd, you can reference to [Use > You could also try [craco](https://github.com/sharegate/craco) and [craco-antd](https://github.com/FormAPI/craco-antd) to customize create-react-app webpack config same as customize-cra does. -> Note: It is recommended to use the latest version of `less`, or a minimum version greater than `3.1.0`. +> Note: It is recommended to use the latest version of `less`, or a minimum version greater than `3.0.1`. ## Replace momentjs to Day.js diff --git a/docs/react/use-with-create-react-app.zh-CN.md b/docs/react/use-with-create-react-app.zh-CN.md index 46a10bee94..3b97bce8f5 100644 --- a/docs/react/use-with-create-react-app.zh-CN.md +++ b/docs/react/use-with-create-react-app.zh-CN.md @@ -201,6 +201,10 @@ module.exports = override( antd 内建了深色主题和紧凑主题,你可以参照 [使用暗色主题和紧凑主题](/docs/react/customize-theme#使用暗色主题和紧凑主题) 进行接入。 +> 同样,你可以使用 [craco](https://github.com/sharegate/craco) 和 [craco-antd](https://github.com/FormAPI/craco-antd) 来自定义 create-react-app 的 webpack 配置,类似于 customize-cra。 + +> 注意:建议使用最新版本的 `less`,或不低于 `3.0.1`。 + ## 使用 Day.js 替换 momentjs 优化打包大小 你可以使用 [antd-dayjs-webpack-plugin](https://github.com/ant-design/antd-dayjs-webpack-plugin) 插件用 Day.js 替换 momentjs 来大幅减小打包大小。 From 63a332a454a2a898e0d473043f35a4554963ebc8 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Fri, 3 Apr 2020 11:11:30 +0800 Subject: [PATCH 19/21] chore(deps-dev): bump chalk from 3.0.0 to 4.0.0 (#22863) Bumps [chalk](https://github.com/chalk/chalk) from 3.0.0 to 4.0.0. - [Release notes](https://github.com/chalk/chalk/releases) - [Commits](https://github.com/chalk/chalk/compare/v3.0.0...v4.0.0) Signed-off-by: dependabot-preview[bot] Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 93ebaf5dc9..4ea5832f2f 100644 --- a/package.json +++ b/package.json @@ -169,7 +169,7 @@ "bisheng-plugin-react": "^1.1.0", "bisheng-plugin-toc": "^0.4.4", "bundlesize": "^0.18.0", - "chalk": "^3.0.0", + "chalk": "^4.0.0", "cheerio": "^1.0.0-rc.3", "concurrently": "^5.0.2", "cross-env": "^7.0.0", From 3b77e610fec16419771e203950d997271afa1c7d Mon Sep 17 00:00:00 2001 From: zombiej Date: Fri, 3 Apr 2020 12:19:41 +0800 Subject: [PATCH 20/21] chore: Update snapshot --- .../__snapshots__/index.test.js.snap | 54 +- .../__snapshots__/DatePicker.test.js.snap | 40 +- .../__snapshots__/other.test.js.snap | 110 +- .../__snapshots__/index.test.js.snap | 10740 ++++++++-------- 4 files changed, 5472 insertions(+), 5472 deletions(-) diff --git a/components/calendar/__tests__/__snapshots__/index.test.js.snap b/components/calendar/__tests__/__snapshots__/index.test.js.snap index f44849344c..2f1bbdf3ae 100644 --- a/components/calendar/__tests__/__snapshots__/index.test.js.snap +++ b/components/calendar/__tests__/__snapshots__/index.test.js.snap @@ -207,23 +207,6 @@ exports[`Calendar Calendar should support locale 1`] = `
-
-
- 30 -
-
-
-
+
+
+ 11 +
+
+
+
diff --git a/components/date-picker/__tests__/__snapshots__/DatePicker.test.js.snap b/components/date-picker/__tests__/__snapshots__/DatePicker.test.js.snap index c99930605c..75ac1e1540 100644 --- a/components/date-picker/__tests__/__snapshots__/DatePicker.test.js.snap +++ b/components/date-picker/__tests__/__snapshots__/DatePicker.test.js.snap @@ -769,16 +769,6 @@ Array [ - -
- 26 -
- - - + + - - + + - - + + - - + + - - + + + +
+ 6 +
+ diff --git a/components/date-picker/__tests__/__snapshots__/other.test.js.snap b/components/date-picker/__tests__/__snapshots__/other.test.js.snap index 3468d69da6..393441c213 100644 --- a/components/date-picker/__tests__/__snapshots__/other.test.js.snap +++ b/components/date-picker/__tests__/__snapshots__/other.test.js.snap @@ -304,6 +304,16 @@ exports[`MonthPicker and WeekPicker render WeekPicker 1`] = ` > 1 + +
+ 26 +
+ + + + + 2 + - - - - 2 - + + + + 3 + - - - - 3 - + + + + 4 + - - - - 4 - + + + + 5 + - - - - 5 - + + + + 6 + - - - - 6 - - -
- 6 -
- diff --git a/components/locale-provider/__tests__/__snapshots__/index.test.js.snap b/components/locale-provider/__tests__/__snapshots__/index.test.js.snap index 589913291d..6ee5f60ae9 100644 --- a/components/locale-provider/__tests__/__snapshots__/index.test.js.snap +++ b/components/locale-provider/__tests__/__snapshots__/index.test.js.snap @@ -171,16 +171,6 @@ exports[`Locale Provider set moment locale when locale changes 1`] = ` - -
- 27 -
- - - + + - - + + - - + + - - + + - - + + + +
+ 8 +
+ @@ -793,16 +793,6 @@ exports[`Locale Provider set moment locale when locale changes 2`] = ` - -
- 27 -
- - - + + - - + + - - + + - - + + - - + + + +
+ 8 +
+ @@ -2244,6 +2244,16 @@ exports[`Locale Provider should display the text as ar 1`] = ` + +
+ 26 +
+ + + - - + + - - + + - - + + - - + + - - - -
- 7 -
- @@ -4279,6 +4279,16 @@ exports[`Locale Provider should display the text as ar 1`] = ` + +
+ 26 +
+ + + - - + + - - + + - - + + - - + + - - - -
- 7 -
- @@ -4815,6 +4815,16 @@ exports[`Locale Provider should display the text as ar 1`] = ` + +
+ 30 +
+ + + - - + + - - + + - - + + - - + + - - - -
- 11 -
- @@ -5847,6 +5847,23 @@ exports[`Locale Provider should display the text as ar 1`] = ` + +
+
+ 26 +
+
+
+
+ + - - + + - - + + - - + + - - + + - - - -
-
- 07 -
-
-
- @@ -7204,16 +7204,6 @@ exports[`Locale Provider should display the text as az 1`] = ` - -
- 27 -
- - - + + - - + + - - + + - - + + - - + + + +
+ 8 +
+ @@ -9239,16 +9239,6 @@ exports[`Locale Provider should display the text as az 1`] = ` - -
- 27 -
- - - + + - - + + - - + + - - + + - - + + + +
+ 8 +
+ @@ -9775,6 +9775,66 @@ exports[`Locale Provider should display the text as az 1`] = ` + +
+ 25 +
+ + +
+ 26 +
+ + +
+ 27 +
+ + +
+ 28 +
+ + +
+ 29 +
+ + +
+ 30 +
+ + + - - + + - - + + - - + + - - + + - - - -
- 6 -
- - -
- 7 -
- - -
- 8 -
- - -
- 9 -
- - -
- 10 -
- - -
- 11 -
- @@ -10807,23 +10807,6 @@ exports[`Locale Provider should display the text as az 1`] = ` - -
-
- 27 -
-
-
-
- -
+ + - - + + - - + + - - + + - - + + + +
+
+ 08 +
+
+
+ @@ -12164,16 +12164,6 @@ exports[`Locale Provider should display the text as bg 1`] = ` - -
- 27 -
- - - + + - - + + - - + + - - + + - - + + + +
+ 8 +
+ @@ -14199,16 +14199,6 @@ exports[`Locale Provider should display the text as bg 1`] = ` - -
- 27 -
- - - + + - - + + - - + + - - + + - - + + + +
+ 8 +
+ @@ -14735,6 +14735,66 @@ exports[`Locale Provider should display the text as bg 1`] = ` + +
+ 25 +
+ + +
+ 26 +
+ + +
+ 27 +
+ + +
+ 28 +
+ + +
+ 29 +
+ + +
+ 30 +
+ + + - - + + - - + + - - + + - - + + - - - -
- 6 -
- - -
- 7 -
- - -
- 8 -
- - -
- 9 -
- - -
- 10 -
- - -
- 11 -
- @@ -15767,23 +15767,6 @@ exports[`Locale Provider should display the text as bg 1`] = ` - -
-
- 27 -
-
-
-
- -
+ + - - + + - - + + - - + + - - + + + +
+
+ 08 +
+
+
+ @@ -17124,16 +17124,6 @@ exports[`Locale Provider should display the text as ca 1`] = ` - -
- 27 -
- - - + + - - + + - - + + - - + + - - + + + +
+ 8 +
+ @@ -19159,16 +19159,6 @@ exports[`Locale Provider should display the text as ca 1`] = ` - -
- 27 -
- - - + + - - + + - - + + - - + + - - + + + +
+ 8 +
+ @@ -19695,6 +19695,66 @@ exports[`Locale Provider should display the text as ca 1`] = ` + +
+ 25 +
+ + +
+ 26 +
+ + +
+ 27 +
+ + +
+ 28 +
+ + +
+ 29 +
+ + +
+ 30 +
+ + + - - + + - - + + - - + + - - + + - - - -
- 6 -
- - -
- 7 -
- - -
- 8 -
- - -
- 9 -
- - -
- 10 -
- - -
- 11 -
- @@ -20727,23 +20727,6 @@ exports[`Locale Provider should display the text as ca 1`] = ` - -
-
- 27 -
-
-
-
- -
+ + - - + + - - + + - - + + - - + + + +
+
+ 08 +
+
+
+ @@ -22084,16 +22084,6 @@ exports[`Locale Provider should display the text as cs 1`] = ` - -
- 27 -
- - - + + - - + + - - + + - - + + - - + + + +
+ 8 +
+ @@ -24119,16 +24119,6 @@ exports[`Locale Provider should display the text as cs 1`] = ` - -
- 27 -
- - - + + - - + + - - + + - - + + - - + + + +
+ 8 +
+ @@ -24655,6 +24655,66 @@ exports[`Locale Provider should display the text as cs 1`] = ` + +
+ 25 +
+ + +
+ 26 +
+ + +
+ 27 +
+ + +
+ 28 +
+ + +
+ 29 +
+ + +
+ 30 +
+ + + - - + + - - + + - - + + - - + + - - - -
- 6 -
- - -
- 7 -
- - -
- 8 -
- - -
- 9 -
- - -
- 10 -
- - -
- 11 -
- @@ -25687,23 +25687,6 @@ exports[`Locale Provider should display the text as cs 1`] = ` - -
-
- 27 -
-
-
-
- -
+ + - - + + - - + + - - + + - - + + + +
+
+ 08 +
+
+
+ @@ -27044,16 +27044,6 @@ exports[`Locale Provider should display the text as da 1`] = ` - -
- 27 -
- - - + + - - + + - - + + - - + + - - + + + +
+ 8 +
+ @@ -29079,16 +29079,6 @@ exports[`Locale Provider should display the text as da 1`] = ` - -
- 27 -
- - - + + - - + + - - + + - - + + - - + + + +
+ 8 +
+ @@ -29615,6 +29615,66 @@ exports[`Locale Provider should display the text as da 1`] = ` + +
+ 25 +
+ + +
+ 26 +
+ + +
+ 27 +
+ + +
+ 28 +
+ + +
+ 29 +
+ + +
+ 30 +
+ + + - - + + - - + + - - + + - - + + - - - -
- 6 -
- - -
- 7 -
- - -
- 8 -
- - -
- 9 -
- - -
- 10 -
- - -
- 11 -
- @@ -30647,23 +30647,6 @@ exports[`Locale Provider should display the text as da 1`] = ` - -
-
- 27 -
-
-
-
- -
+ + - - + + - - + + - - + + - - + + + +
+
+ 08 +
+
+
+ @@ -32004,16 +32004,6 @@ exports[`Locale Provider should display the text as de 1`] = ` - -
- 27 -
- - - + + - - + + - - + + - - + + - - + + + +
+ 8 +
+ @@ -34039,16 +34039,6 @@ exports[`Locale Provider should display the text as de 1`] = ` - -
- 27 -
- - - + + - - + + - - + + - - + + - - + + + +
+ 8 +
+ @@ -34575,6 +34575,66 @@ exports[`Locale Provider should display the text as de 1`] = ` + +
+ 25 +
+ + +
+ 26 +
+ + +
+ 27 +
+ + +
+ 28 +
+ + +
+ 29 +
+ + +
+ 30 +
+ + + - - + + - - + + - - + + - - + + - - - -
- 6 -
- - -
- 7 -
- - -
- 8 -
- - -
- 9 -
- - -
- 10 -
- - -
- 11 -
- @@ -35607,23 +35607,6 @@ exports[`Locale Provider should display the text as de 1`] = ` - -
-
- 27 -
-
-
-
- -
+ + - - + + - - + + - - + + - - + + + +
+
+ 08 +
+
+
+ @@ -36964,16 +36964,6 @@ exports[`Locale Provider should display the text as el 1`] = ` - -
- 27 -
- - - + + - - + + - - + + - - + + - - + + + +
+ 8 +
+ @@ -38999,16 +38999,6 @@ exports[`Locale Provider should display the text as el 1`] = ` - -
- 27 -
- - - + + - - + + - - + + - - + + - - + + + +
+ 8 +
+ @@ -39535,6 +39535,66 @@ exports[`Locale Provider should display the text as el 1`] = ` + +
+ 25 +
+ + +
+ 26 +
+ + +
+ 27 +
+ + +
+ 28 +
+ + +
+ 29 +
+ + +
+ 30 +
+ + + - - + + - - + + - - + + - - + + - - - -
- 6 -
- - -
- 7 -
- - -
- 8 -
- - -
- 9 -
- - -
- 10 -
- - -
- 11 -
- @@ -40567,23 +40567,6 @@ exports[`Locale Provider should display the text as el 1`] = ` - -
-
- 27 -
-
-
-
- -
+ + - - + + - - + + - - + + - - + + + +
+
+ 08 +
+
+
+ @@ -46884,16 +46884,6 @@ exports[`Locale Provider should display the text as en-gb 1`] = ` - -
- 27 -
- - - + + - - + + - - + + - - + + - - + + + +
+ 8 +
+ @@ -48919,16 +48919,6 @@ exports[`Locale Provider should display the text as en-gb 1`] = ` - -
- 27 -
- - - + + - - + + - - + + - - + + - - + + + +
+ 8 +
+ @@ -49455,6 +49455,66 @@ exports[`Locale Provider should display the text as en-gb 1`] = ` + +
+ 25 +
+ + +
+ 26 +
+ + +
+ 27 +
+ + +
+ 28 +
+ + +
+ 29 +
+ + +
+ 30 +
+ + + - - + + - - + + - - + + - - + + - - - -
- 6 -
- - -
- 7 -
- - -
- 8 -
- - -
- 9 -
- - -
- 10 -
- - -
- 11 -
- @@ -50487,23 +50487,6 @@ exports[`Locale Provider should display the text as en-gb 1`] = ` - -
-
- 27 -
-
-
-
- -
+ + - - + + - - + + - - + + - - + + + +
+
+ 08 +
+
+
+ @@ -51844,16 +51844,6 @@ exports[`Locale Provider should display the text as es 1`] = ` - -
- 27 -
- - - + + - - + + - - + + - - + + - - + + + +
+ 8 +
+ @@ -53879,16 +53879,6 @@ exports[`Locale Provider should display the text as es 1`] = ` - -
- 27 -
- - - + + - - + + - - + + - - + + - - + + + +
+ 8 +
+ @@ -54415,6 +54415,66 @@ exports[`Locale Provider should display the text as es 1`] = ` + +
+ 25 +
+ + +
+ 26 +
+ + +
+ 27 +
+ + +
+ 28 +
+ + +
+ 29 +
+ + +
+ 30 +
+ + + - - + + - - + + - - + + - - + + - - - -
- 6 -
- - -
- 7 -
- - -
- 8 -
- - -
- 9 -
- - -
- 10 -
- - -
- 11 -
- @@ -55447,23 +55447,6 @@ exports[`Locale Provider should display the text as es 1`] = ` - -
-
- 27 -
-
-
-
- -
+ + - - + + - - + + - - + + - - + + + +
+
+ 08 +
+
+
+ @@ -56804,16 +56804,6 @@ exports[`Locale Provider should display the text as et 1`] = ` - -
- 27 -
- - - + + - - + + - - + + - - + + - - + + + +
+ 8 +
+ @@ -58839,16 +58839,6 @@ exports[`Locale Provider should display the text as et 1`] = ` - -
- 27 -
- - - + + - - + + - - + + - - + + - - + + + +
+ 8 +
+ @@ -59375,6 +59375,66 @@ exports[`Locale Provider should display the text as et 1`] = ` + +
+ 25 +
+ + +
+ 26 +
+ + +
+ 27 +
+ + +
+ 28 +
+ + +
+ 29 +
+ + +
+ 30 +
+ + + - - + + - - + + - - + + - - + + - - - -
- 6 -
- - -
- 7 -
- - -
- 8 -
- - -
- 9 -
- - -
- 10 -
- - -
- 11 -
- @@ -60407,23 +60407,6 @@ exports[`Locale Provider should display the text as et 1`] = ` - -
-
- 27 -
-
-
-
- -
+ + - - + + - - + + - - + + - - + + + +
+
+ 08 +
+
+
+ @@ -61764,6 +61764,16 @@ exports[`Locale Provider should display the text as fa 1`] = ` + +
+ 26 +
+ + + - - + + - - + + - - + + - - + + - - - -
- 7 -
- @@ -63799,6 +63799,16 @@ exports[`Locale Provider should display the text as fa 1`] = ` + +
+ 26 +
+ + + - - + + - - + + - - + + - - + + - - - -
- 7 -
- @@ -64335,6 +64335,16 @@ exports[`Locale Provider should display the text as fa 1`] = ` + +
+ 30 +
+ + + - - + + - - + + - - + + - - + + - - - -
- 11 -
- @@ -65367,6 +65367,23 @@ exports[`Locale Provider should display the text as fa 1`] = ` + +
+
+ 26 +
+
+
+
+ +
- - + + - - + + - - + + - - + + - - - -
-
- 07 -
-
-
- @@ -66724,16 +66724,6 @@ exports[`Locale Provider should display the text as fi 1`] = ` - -
- 27 -
- - - + + - - + + - - + + - - + + - - + + + +
+ 8 +
+ @@ -68759,16 +68759,6 @@ exports[`Locale Provider should display the text as fi 1`] = ` - -
- 27 -
- - - + + - - + + - - + + - - + + - - + + + +
+ 8 +
+ @@ -69295,6 +69295,66 @@ exports[`Locale Provider should display the text as fi 1`] = ` + +
+ 25 +
+ + +
+ 26 +
+ + +
+ 27 +
+ + +
+ 28 +
+ + +
+ 29 +
+ + +
+ 30 +
+ + + - - + + - - + + - - + + - - + + - - - -
- 6 -
- - -
- 7 -
- - -
- 8 -
- - -
- 9 -
- - -
- 10 -
- - -
- 11 -
- @@ -70327,23 +70327,6 @@ exports[`Locale Provider should display the text as fi 1`] = ` - -
-
- 27 -
-
-
-
- -
+ + - - + + - - + + - - + + - - + + + +
+
+ 08 +
+
+
+ @@ -71684,16 +71684,6 @@ exports[`Locale Provider should display the text as fr 1`] = ` - -
- 27 -
- - - + + - - + + - - + + - - + + - - + + + +
+ 8 +
+ @@ -73719,16 +73719,6 @@ exports[`Locale Provider should display the text as fr 1`] = ` - -
- 27 -
- - - + + - - + + - - + + - - + + - - + + + +
+ 8 +
+ @@ -74255,6 +74255,66 @@ exports[`Locale Provider should display the text as fr 1`] = ` + +
+ 25 +
+ + +
+ 26 +
+ + +
+ 27 +
+ + +
+ 28 +
+ + +
+ 29 +
+ + +
+ 30 +
+ + + - - + + - - + + - - + + - - + + - - - -
- 6 -
- - -
- 7 -
- - -
- 8 -
- - -
- 9 -
- - -
- 10 -
- - -
- 11 -
- @@ -75287,23 +75287,6 @@ exports[`Locale Provider should display the text as fr 1`] = ` - -
-
- 27 -
-
-
-
- -
+ + - - + + - - + + - - + + - - + + + +
+
+ 08 +
+
+
+ @@ -76644,16 +76644,6 @@ exports[`Locale Provider should display the text as fr 2`] = ` - -
- 27 -
- - - + + - - + + - - + + - - + + - - + + + +
+ 8 +
+ @@ -78679,16 +78679,6 @@ exports[`Locale Provider should display the text as fr 2`] = ` - -
- 27 -
- - - + + - - + + - - + + - - + + - - + + + +
+ 8 +
+ @@ -79215,6 +79215,66 @@ exports[`Locale Provider should display the text as fr 2`] = ` + +
+ 25 +
+ + +
+ 26 +
+ + +
+ 27 +
+ + +
+ 28 +
+ + +
+ 29 +
+ + +
+ 30 +
+ + + - - + + - - + + - - + + - - + + - - - -
- 6 -
- - -
- 7 -
- - -
- 8 -
- - -
- 9 -
- - -
- 10 -
- - -
- 11 -
- @@ -80247,23 +80247,6 @@ exports[`Locale Provider should display the text as fr 2`] = ` - -
-
- 27 -
-
-
-
- -
+ + - - + + - - + + - - + + - - + + + +
+
+ 08 +
+
+
+ @@ -91524,16 +91524,6 @@ exports[`Locale Provider should display the text as hr 1`] = ` - -
- 27 -
- - - + + - - + + - - + + - - + + - - + + + +
+ 8 +
+ @@ -93559,16 +93559,6 @@ exports[`Locale Provider should display the text as hr 1`] = ` - -
- 27 -
- - - + + - - + + - - + + - - + + - - + + + +
+ 8 +
+ @@ -94095,6 +94095,66 @@ exports[`Locale Provider should display the text as hr 1`] = ` + +
+ 25 +
+ + +
+ 26 +
+ + +
+ 27 +
+ + +
+ 28 +
+ + +
+ 29 +
+ + +
+ 30 +
+ + + - - + + - - + + - - + + - - + + - - - -
- 6 -
- - -
- 7 -
- - -
- 8 -
- - -
- 9 -
- - -
- 10 -
- - -
- 11 -
- @@ -95127,23 +95127,6 @@ exports[`Locale Provider should display the text as hr 1`] = ` - -
-
- 27 -
-
-
-
- -
+ + - - + + - - + + - - + + - - + + + +
+
+ 08 +
+
+
+ @@ -96484,16 +96484,6 @@ exports[`Locale Provider should display the text as hu 1`] = ` - -
- 27 -
- - - + + - - + + - - + + - - + + - - + + + +
+ 8 +
+ @@ -98519,16 +98519,6 @@ exports[`Locale Provider should display the text as hu 1`] = ` - -
- 27 -
- - - + + - - + + - - + + - - + + - - + + + +
+ 8 +
+ @@ -99055,6 +99055,66 @@ exports[`Locale Provider should display the text as hu 1`] = ` + +
+ 25 +
+ + +
+ 26 +
+ + +
+ 27 +
+ + +
+ 28 +
+ + +
+ 29 +
+ + +
+ 30 +
+ + + - - + + - - + + - - + + - - + + - - - -
- 6 -
- - -
- 7 -
- - -
- 8 -
- - -
- 9 -
- - -
- 10 -
- - -
- 11 -
- @@ -100087,23 +100087,6 @@ exports[`Locale Provider should display the text as hu 1`] = ` - -
-
- 27 -
-
-
-
- -
+ + - - + + - - + + - - + + - - + + + +
+
+ 08 +
+
+
+ @@ -101444,16 +101444,6 @@ exports[`Locale Provider should display the text as hy-am 1`] = ` - -
- 27 -
- - - + + - - + + - - + + - - + + - - + + + +
+ 8 +
+ @@ -103479,16 +103479,6 @@ exports[`Locale Provider should display the text as hy-am 1`] = ` - -
- 27 -
- - - + + - - + + - - + + - - + + - - + + + +
+ 8 +
+ @@ -104015,6 +104015,66 @@ exports[`Locale Provider should display the text as hy-am 1`] = ` + +
+ 25 +
+ + +
+ 26 +
+ + +
+ 27 +
+ + +
+ 28 +
+ + +
+ 29 +
+ + +
+ 30 +
+ + + - - + + - - + + - - + + - - + + - - - -
- 6 -
- - -
- 7 -
- - -
- 8 -
- - -
- 9 -
- - -
- 10 -
- - -
- 11 -
- @@ -105047,23 +105047,6 @@ exports[`Locale Provider should display the text as hy-am 1`] = ` - -
-
- 27 -
-
-
-
- -
+ + - - + + - - + + - - + + - - + + + +
+
+ 08 +
+
+
+ @@ -106404,16 +106404,6 @@ exports[`Locale Provider should display the text as id 1`] = ` - -
- 27 -
- - - + + - - + + - - + + - - + + - - + + + +
+ 8 +
+ @@ -108439,16 +108439,6 @@ exports[`Locale Provider should display the text as id 1`] = ` - -
- 27 -
- - - + + - - + + - - + + - - + + - - + + + +
+ 8 +
+ @@ -108975,6 +108975,66 @@ exports[`Locale Provider should display the text as id 1`] = ` + +
+ 25 +
+ + +
+ 26 +
+ + +
+ 27 +
+ + +
+ 28 +
+ + +
+ 29 +
+ + +
+ 30 +
+ + + - - + + - - + + - - + + - - + + - - - -
- 6 -
- - -
- 7 -
- - -
- 8 -
- - -
- 9 -
- - -
- 10 -
- - -
- 11 -
- @@ -110007,23 +110007,6 @@ exports[`Locale Provider should display the text as id 1`] = ` - -
-
- 27 -
-
-
-
- -
+ + - - + + - - + + - - + + - - + + + +
+
+ 08 +
+
+
+ @@ -111364,16 +111364,6 @@ exports[`Locale Provider should display the text as is 1`] = ` - -
- 27 -
- - - + + - - + + - - + + - - + + - - + + + +
+ 8 +
+ @@ -113399,16 +113399,6 @@ exports[`Locale Provider should display the text as is 1`] = ` - -
- 27 -
- - - + + - - + + - - + + - - + + - - + + + +
+ 8 +
+ @@ -113935,6 +113935,66 @@ exports[`Locale Provider should display the text as is 1`] = ` + +
+ 25 +
+ + +
+ 26 +
+ + +
+ 27 +
+ + +
+ 28 +
+ + +
+ 29 +
+ + +
+ 30 +
+ + + - - + + - - + + - - + + - - + + - - - -
- 6 -
- - -
- 7 -
- - -
- 8 -
- - -
- 9 -
- - -
- 10 -
- - -
- 11 -
- @@ -114967,23 +114967,6 @@ exports[`Locale Provider should display the text as is 1`] = ` - -
-
- 27 -
-
-
-
- -
+ + - - + + - - + + - - + + - - + + + +
+
+ 08 +
+
+
+ @@ -116324,16 +116324,6 @@ exports[`Locale Provider should display the text as it 1`] = ` - -
- 27 -
- - - + + - - + + - - + + - - + + - - + + + +
+ 8 +
+ @@ -118359,16 +118359,6 @@ exports[`Locale Provider should display the text as it 1`] = ` - -
- 27 -
- - - + + - - + + - - + + - - + + - - + + + +
+ 8 +
+ @@ -118895,6 +118895,66 @@ exports[`Locale Provider should display the text as it 1`] = ` + +
+ 25 +
+ + +
+ 26 +
+ + +
+ 27 +
+ + +
+ 28 +
+ + +
+ 29 +
+ + +
+ 30 +
+ + + - - + + - - + + - - + + - - + + - - - -
- 6 -
- - -
- 7 -
- - -
- 8 -
- - -
- 9 -
- - -
- 10 -
- - -
- 11 -
- @@ -119927,23 +119927,6 @@ exports[`Locale Provider should display the text as it 1`] = ` - -
-
- 27 -
-
-
-
- -
+ + - - + + - - + + - - + + - - + + + +
+
+ 08 +
+
+
+ @@ -136164,6 +136164,16 @@ exports[`Locale Provider should display the text as ku-iq 1`] = ` + +
+ 26 +
+ + + - - + + - - + + - - + + - - + + - - - -
- 7 -
- @@ -138199,6 +138199,16 @@ exports[`Locale Provider should display the text as ku-iq 1`] = ` + +
+ 26 +
+ + + - - + + - - + + - - + + - - + + - - - -
- 7 -
- @@ -138735,6 +138735,16 @@ exports[`Locale Provider should display the text as ku-iq 1`] = ` + +
+ 30 +
+ + + - - + + - - + + - - + + - - + + - - - -
- 11 -
- @@ -139767,6 +139767,23 @@ exports[`Locale Provider should display the text as ku-iq 1`] = ` + +
+
+ 26 +
+
+
+
+ +
- - + + - - + + - - + + - - + + - - - -
-
- 07 -
-
-
- @@ -141124,16 +141124,6 @@ exports[`Locale Provider should display the text as lv 1`] = ` - -
- 27 -
- - - + + - - + + - - + + - - + + - - + + + +
+ 8 +
+ @@ -143159,16 +143159,6 @@ exports[`Locale Provider should display the text as lv 1`] = ` - -
- 27 -
- - - + + - - + + - - + + - - + + - - + + + +
+ 8 +
+ @@ -143695,6 +143695,66 @@ exports[`Locale Provider should display the text as lv 1`] = ` + +
+ 25 +
+ + +
+ 26 +
+ + +
+ 27 +
+ + +
+ 28 +
+ + +
+ 29 +
+ + +
+ 30 +
+ + + - - + + - - + + - - + + - - + + - - - -
- 6 -
- - -
- 7 -
- - -
- 8 -
- - -
- 9 -
- - -
- 10 -
- - -
- 11 -
- @@ -144727,23 +144727,6 @@ exports[`Locale Provider should display the text as lv 1`] = ` - -
-
- 27 -
-
-
-
- -
+ + - - + + - - + + - - + + - - + + + +
+
+ 08 +
+
+
+ @@ -146084,16 +146084,6 @@ exports[`Locale Provider should display the text as mk 1`] = ` - -
- 27 -
- - - + + - - + + - - + + - - + + - - + + + +
+ 8 +
+ @@ -148119,16 +148119,6 @@ exports[`Locale Provider should display the text as mk 1`] = ` - -
- 27 -
- - - + + - - + + - - + + - - + + - - + + + +
+ 8 +
+ @@ -148655,6 +148655,66 @@ exports[`Locale Provider should display the text as mk 1`] = ` + +
+ 25 +
+ + +
+ 26 +
+ + +
+ 27 +
+ + +
+ 28 +
+ + +
+ 29 +
+ + +
+ 30 +
+ + + - - + + - - + + - - + + - - + + - - - -
- 6 -
- - -
- 7 -
- - -
- 8 -
- - -
- 9 -
- - -
- 10 -
- - -
- 11 -
- @@ -149687,23 +149687,6 @@ exports[`Locale Provider should display the text as mk 1`] = ` - -
-
- 27 -
-
-
-
- -
+ + - - + + - - + + - - + + - - + + + +
+
+ 08 +
+
+
+ @@ -156004,16 +156004,6 @@ exports[`Locale Provider should display the text as ms-my 1`] = ` - -
- 27 -
- - - + + - - + + - - + + - - + + - - + + + +
+ 8 +
+ @@ -158039,16 +158039,6 @@ exports[`Locale Provider should display the text as ms-my 1`] = ` - -
- 27 -
- - - + + - - + + - - + + - - + + - - + + + +
+ 8 +
+ @@ -158575,6 +158575,66 @@ exports[`Locale Provider should display the text as ms-my 1`] = ` + +
+ 25 +
+ + +
+ 26 +
+ + +
+ 27 +
+ + +
+ 28 +
+ + +
+ 29 +
+ + +
+ 30 +
+ + + - - + + - - + + - - + + - - + + - - - -
- 6 -
- - -
- 7 -
- - -
- 8 -
- - -
- 9 -
- - -
- 10 -
- - -
- 11 -
- @@ -159607,23 +159607,6 @@ exports[`Locale Provider should display the text as ms-my 1`] = ` - -
-
- 27 -
-
-
-
- -
+ + - - + + - - + + - - + + - - + + + +
+
+ 08 +
+
+
+ @@ -160964,16 +160964,6 @@ exports[`Locale Provider should display the text as nb 1`] = ` - -
- 27 -
- - - + + - - + + - - + + - - + + - - + + + +
+ 8 +
+ @@ -162999,16 +162999,6 @@ exports[`Locale Provider should display the text as nb 1`] = ` - -
- 27 -
- - - + + - - + + - - + + - - + + - - + + + +
+ 8 +
+ @@ -163535,6 +163535,66 @@ exports[`Locale Provider should display the text as nb 1`] = ` + +
+ 25 +
+ + +
+ 26 +
+ + +
+ 27 +
+ + +
+ 28 +
+ + +
+ 29 +
+ + +
+ 30 +
+ + + - - + + - - + + - - + + - - + + - - - -
- 6 -
- - -
- 7 -
- - -
- 8 -
- - -
- 9 -
- - -
- 10 -
- - -
- 11 -
- @@ -164567,23 +164567,6 @@ exports[`Locale Provider should display the text as nb 1`] = ` - -
-
- 27 -
-
-
-
- -
+ + - - + + - - + + - - + + - - + + + +
+
+ 08 +
+
+
+ @@ -170884,16 +170884,6 @@ exports[`Locale Provider should display the text as nl 1`] = ` - -
- 27 -
- - - + + - - + + - - + + - - + + - - + + + +
+ 8 +
+ @@ -172919,16 +172919,6 @@ exports[`Locale Provider should display the text as nl 1`] = ` - -
- 27 -
- - - + + - - + + - - + + - - + + - - + + + +
+ 8 +
+ @@ -173455,6 +173455,66 @@ exports[`Locale Provider should display the text as nl 1`] = ` + +
+ 25 +
+ + +
+ 26 +
+ + +
+ 27 +
+ + +
+ 28 +
+ + +
+ 29 +
+ + +
+ 30 +
+ + + - - + + - - + + - - + + - - + + - - - -
- 6 -
- - -
- 7 -
- - -
- 8 -
- - -
- 9 -
- - -
- 10 -
- - -
- 11 -
- @@ -174487,23 +174487,6 @@ exports[`Locale Provider should display the text as nl 1`] = ` - -
-
- 27 -
-
-
-
- -
+ + - - + + - - + + - - + + - - + + + +
+
+ 08 +
+
+
+ @@ -175844,16 +175844,6 @@ exports[`Locale Provider should display the text as nl-be 1`] = ` - -
- 27 -
- - - + + - - + + - - + + - - + + - - + + + +
+ 8 +
+ @@ -177879,16 +177879,6 @@ exports[`Locale Provider should display the text as nl-be 1`] = ` - -
- 27 -
- - - + + - - + + - - + + - - + + - - + + + +
+ 8 +
+ @@ -178415,6 +178415,66 @@ exports[`Locale Provider should display the text as nl-be 1`] = ` + +
+ 25 +
+ + +
+ 26 +
+ + +
+ 27 +
+ + +
+ 28 +
+ + +
+ 29 +
+ + +
+ 30 +
+ + + - - + + - - + + - - + + - - + + - - - -
- 6 -
- - -
- 7 -
- - -
- 8 -
- - -
- 9 -
- - -
- 10 -
- - -
- 11 -
- @@ -179447,23 +179447,6 @@ exports[`Locale Provider should display the text as nl-be 1`] = ` - -
-
- 27 -
-
-
-
- -
+ + - - + + - - + + - - + + - - + + + +
+
+ 08 +
+
+
+ @@ -180804,16 +180804,6 @@ exports[`Locale Provider should display the text as pl 1`] = ` - -
- 27 -
- - - + + - - + + - - + + - - + + - - + + + +
+ 8 +
+ @@ -182839,16 +182839,6 @@ exports[`Locale Provider should display the text as pl 1`] = ` - -
- 27 -
- - - + + - - + + - - + + - - + + - - + + + +
+ 8 +
+ @@ -183375,6 +183375,66 @@ exports[`Locale Provider should display the text as pl 1`] = ` + +
+ 25 +
+ + +
+ 26 +
+ + +
+ 27 +
+ + +
+ 28 +
+ + +
+ 29 +
+ + +
+ 30 +
+ + + - - + + - - + + - - + + - - + + - - - -
- 6 -
- - -
- 7 -
- - -
- 8 -
- - -
- 9 -
- - -
- 10 -
- - -
- 11 -
- @@ -184407,23 +184407,6 @@ exports[`Locale Provider should display the text as pl 1`] = ` - -
-
- 27 -
-
-
-
- -
+ + - - + + - - + + - - + + - - + + + +
+
+ 08 +
+
+
+ @@ -185764,16 +185764,6 @@ exports[`Locale Provider should display the text as pt 1`] = ` - -
- 27 -
- - - + + - - + + - - + + - - + + - - + + + +
+ 8 +
+ @@ -187799,16 +187799,6 @@ exports[`Locale Provider should display the text as pt 1`] = ` - -
- 27 -
- - - + + - - + + - - + + - - + + - - + + + +
+ 8 +
+ @@ -188335,6 +188335,66 @@ exports[`Locale Provider should display the text as pt 1`] = ` + +
+ 25 +
+ + +
+ 26 +
+ + +
+ 27 +
+ + +
+ 28 +
+ + +
+ 29 +
+ + +
+ 30 +
+ + + - - + + - - + + - - + + - - + + - - - -
- 6 -
- - -
- 7 -
- - -
- 8 -
- - -
- 9 -
- - -
- 10 -
- - -
- 11 -
- @@ -189367,23 +189367,6 @@ exports[`Locale Provider should display the text as pt 1`] = ` - -
-
- 27 -
-
-
-
- -
+ + - - + + - - + + - - + + - - + + + +
+
+ 08 +
+
+
+ @@ -195684,16 +195684,6 @@ exports[`Locale Provider should display the text as ro 1`] = ` - -
- 27 -
- - - + + - - + + - - + + - - + + - - + + + +
+ 8 +
+ @@ -197719,16 +197719,6 @@ exports[`Locale Provider should display the text as ro 1`] = ` - -
- 27 -
- - - + + - - + + - - + + - - + + - - + + + +
+ 8 +
+ @@ -198255,6 +198255,66 @@ exports[`Locale Provider should display the text as ro 1`] = ` + +
+ 25 +
+ + +
+ 26 +
+ + +
+ 27 +
+ + +
+ 28 +
+ + +
+ 29 +
+ + +
+ 30 +
+ + + - - + + - - + + - - + + - - + + - - - -
- 6 -
- - -
- 7 -
- - -
- 8 -
- - -
- 9 -
- - -
- 10 -
- - -
- 11 -
- @@ -199287,23 +199287,6 @@ exports[`Locale Provider should display the text as ro 1`] = ` - -
-
- 27 -
-
-
-
- -
+ + - - + + - - + + - - + + - - + + + +
+
+ 08 +
+
+
+ @@ -200644,16 +200644,6 @@ exports[`Locale Provider should display the text as ru 1`] = ` - -
- 27 -
- - - + + - - + + - - + + - - + + - - + + + +
+ 8 +
+ @@ -202679,16 +202679,6 @@ exports[`Locale Provider should display the text as ru 1`] = ` - -
- 27 -
- - - + + - - + + - - + + - - + + - - + + + +
+ 8 +
+ @@ -203215,6 +203215,66 @@ exports[`Locale Provider should display the text as ru 1`] = ` + +
+ 25 +
+ + +
+ 26 +
+ + +
+ 27 +
+ + +
+ 28 +
+ + +
+ 29 +
+ + +
+ 30 +
+ + + - - + + - - + + - - + + - - + + - - - -
- 6 -
- - -
- 7 -
- - -
- 8 -
- - -
- 9 -
- - -
- 10 -
- - -
- 11 -
- @@ -204247,23 +204247,6 @@ exports[`Locale Provider should display the text as ru 1`] = ` - -
-
- 27 -
-
-
-
- -
+ + - - + + - - + + - - + + - - + + + +
+
+ 08 +
+
+
+ @@ -205604,16 +205604,6 @@ exports[`Locale Provider should display the text as sk 1`] = ` - -
- 27 -
- - - + + - - + + - - + + - - + + - - + + + +
+ 8 +
+ @@ -207639,16 +207639,6 @@ exports[`Locale Provider should display the text as sk 1`] = ` - -
- 27 -
- - - + + - - + + - - + + - - + + - - + + + +
+ 8 +
+ @@ -208175,6 +208175,66 @@ exports[`Locale Provider should display the text as sk 1`] = ` + +
+ 25 +
+ + +
+ 26 +
+ + +
+ 27 +
+ + +
+ 28 +
+ + +
+ 29 +
+ + +
+ 30 +
+ + + - - + + - - + + - - + + - - + + - - - -
- 6 -
- - -
- 7 -
- - -
- 8 -
- - -
- 9 -
- - -
- 10 -
- - -
- 11 -
- @@ -209207,23 +209207,6 @@ exports[`Locale Provider should display the text as sk 1`] = ` - -
-
- 27 -
-
-
-
- -
+ + - - + + - - + + - - + + - - + + + +
+
+ 08 +
+
+
+ @@ -210564,16 +210564,6 @@ exports[`Locale Provider should display the text as sl 1`] = ` - -
- 27 -
- - - + + - - + + - - + + - - + + - - + + + +
+ 8 +
+ @@ -212599,16 +212599,6 @@ exports[`Locale Provider should display the text as sl 1`] = ` - -
- 27 -
- - - + + - - + + - - + + - - + + - - + + + +
+ 8 +
+ @@ -213135,6 +213135,66 @@ exports[`Locale Provider should display the text as sl 1`] = ` + +
+ 25 +
+ + +
+ 26 +
+ + +
+ 27 +
+ + +
+ 28 +
+ + +
+ 29 +
+ + +
+ 30 +
+ + + - - + + - - + + - - + + - - + + - - - -
- 6 -
- - -
- 7 -
- - -
- 8 -
- - -
- 9 -
- - -
- 10 -
- - -
- 11 -
- @@ -214167,23 +214167,6 @@ exports[`Locale Provider should display the text as sl 1`] = ` - -
-
- 27 -
-
-
-
- -
+ + - - + + - - + + - - + + - - + + + +
+
+ 08 +
+
+
+ @@ -215524,16 +215524,6 @@ exports[`Locale Provider should display the text as sr 1`] = ` - -
- 27 -
- - - + + - - + + - - + + - - + + - - + + + +
+ 8 +
+ @@ -217559,16 +217559,6 @@ exports[`Locale Provider should display the text as sr 1`] = ` - -
- 27 -
- - - + + - - + + - - + + - - + + - - + + + +
+ 8 +
+ @@ -218095,6 +218095,66 @@ exports[`Locale Provider should display the text as sr 1`] = ` + +
+ 25 +
+ + +
+ 26 +
+ + +
+ 27 +
+ + +
+ 28 +
+ + +
+ 29 +
+ + +
+ 30 +
+ + + - - + + - - + + - - + + - - + + - - - -
- 6 -
- - -
- 7 -
- - -
- 8 -
- - -
- 9 -
- - -
- 10 -
- - -
- 11 -
- @@ -219127,23 +219127,6 @@ exports[`Locale Provider should display the text as sr 1`] = ` - -
-
- 27 -
-
-
-
- -
+ + - - + + - - + + - - + + - - + + + +
+
+ 08 +
+
+
+ @@ -220484,16 +220484,6 @@ exports[`Locale Provider should display the text as sv 1`] = ` - -
- 27 -
- - - + + - - + + - - + + - - + + - - + + + +
+ 8 +
+ @@ -222519,16 +222519,6 @@ exports[`Locale Provider should display the text as sv 1`] = ` - -
- 27 -
- - - + + - - + + - - + + - - + + - - + + + +
+ 8 +
+ @@ -223055,6 +223055,66 @@ exports[`Locale Provider should display the text as sv 1`] = ` + +
+ 25 +
+ + +
+ 26 +
+ + +
+ 27 +
+ + +
+ 28 +
+ + +
+ 29 +
+ + +
+ 30 +
+ + + - - + + - - + + - - + + - - + + - - - -
- 6 -
- - -
- 7 -
- - -
- 8 -
- - -
- 9 -
- - -
- 10 -
- - -
- 11 -
- @@ -224087,23 +224087,6 @@ exports[`Locale Provider should display the text as sv 1`] = ` - -
-
- 27 -
-
-
-
- -
+ + - - + + - - + + - - + + - - + + + +
+
+ 08 +
+
+
+ @@ -235364,16 +235364,6 @@ exports[`Locale Provider should display the text as tr 1`] = ` - -
- 27 -
- - - + + - - + + - - + + - - + + - - + + + +
+ 8 +
+ @@ -237399,16 +237399,6 @@ exports[`Locale Provider should display the text as tr 1`] = ` - -
- 27 -
- - - + + - - + + - - + + - - + + - - + + + +
+ 8 +
+ @@ -237935,6 +237935,66 @@ exports[`Locale Provider should display the text as tr 1`] = ` + +
+ 25 +
+ + +
+ 26 +
+ + +
+ 27 +
+ + +
+ 28 +
+ + +
+ 29 +
+ + +
+ 30 +
+ + + - - + + - - + + - - + + - - + + - - - -
- 6 -
- - -
- 7 -
- - -
- 8 -
- - -
- 9 -
- - -
- 10 -
- - -
- 11 -
- @@ -238967,23 +238967,6 @@ exports[`Locale Provider should display the text as tr 1`] = ` - -
-
- 27 -
-
-
-
- -
+ + - - + + - - + + - - + + - - + + + +
+
+ 08 +
+
+
+ @@ -240324,16 +240324,6 @@ exports[`Locale Provider should display the text as uk 1`] = ` - -
- 27 -
- - - + + - - + + - - + + - - + + - - + + + +
+ 8 +
+ @@ -242359,16 +242359,6 @@ exports[`Locale Provider should display the text as uk 1`] = ` - -
- 27 -
- - - + + - - + + - - + + - - + + - - + + + +
+ 8 +
+ @@ -242895,6 +242895,66 @@ exports[`Locale Provider should display the text as uk 1`] = ` + +
+ 25 +
+ + +
+ 26 +
+ + +
+ 27 +
+ + +
+ 28 +
+ + +
+ 29 +
+ + +
+ 30 +
+ + + - - + + - - + + - - + + - - + + - - - -
- 6 -
- - -
- 7 -
- - -
- 8 -
- - -
- 9 -
- - -
- 10 -
- - -
- 11 -
- @@ -243927,23 +243927,6 @@ exports[`Locale Provider should display the text as uk 1`] = ` - -
-
- 27 -
-
-
-
- -
+ + - - + + - - + + - - + + - - + + + +
+
+ 08 +
+
+
+ @@ -245284,16 +245284,6 @@ exports[`Locale Provider should display the text as vi 1`] = ` - -
- 27 -
- - - + + - - + + - - + + - - + + - - + + + +
+ 8 +
+ @@ -247319,16 +247319,6 @@ exports[`Locale Provider should display the text as vi 1`] = ` - -
- 27 -
- - - + + - - + + - - + + - - + + - - + + + +
+ 8 +
+ @@ -247855,6 +247855,66 @@ exports[`Locale Provider should display the text as vi 1`] = ` + +
+ 25 +
+ + +
+ 26 +
+ + +
+ 27 +
+ + +
+ 28 +
+ + +
+ 29 +
+ + +
+ 30 +
+ + + - - + + - - + + - - + + - - + + - - - -
- 6 -
- - -
- 7 -
- - -
- 8 -
- - -
- 9 -
- - -
- 10 -
- - -
- 11 -
- @@ -248887,23 +248887,6 @@ exports[`Locale Provider should display the text as vi 1`] = ` - -
-
- 27 -
-
-
-
- -
+ + - - + + - - + + - - + + - - + + + +
+
+ 08 +
+
+
+ @@ -250244,16 +250244,6 @@ exports[`Locale Provider should display the text as zh-cn 1`] = ` - -
- 27 -
- - - + + - - + + - - + + - - + + - - + + + +
+ 8 +
+ @@ -252279,16 +252279,6 @@ exports[`Locale Provider should display the text as zh-cn 1`] = ` - -
- 27 -
- - - + + - - + + - - + + - - + + - - + + + +
+ 8 +
+ @@ -252815,6 +252815,66 @@ exports[`Locale Provider should display the text as zh-cn 1`] = ` + +
+ 25 +
+ + +
+ 26 +
+ + +
+ 27 +
+ + +
+ 28 +
+ + +
+ 29 +
+ + +
+ 30 +
+ + + - - + + - - + + - - + + - - + + - - - -
- 6 -
- - -
- 7 -
- - -
- 8 -
- - -
- 9 -
- - -
- 10 -
- - -
- 11 -
- @@ -253847,23 +253847,6 @@ exports[`Locale Provider should display the text as zh-cn 1`] = ` - -
-
- 27 -
-
-
-
- -
+ + - - + + - - + + - - + + - - + + + +
+
+ 08 +
+
+
+ From 1e5c5271463d1f56a113d731ad92183b1d01b14d 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: Fri, 3 Apr 2020 13:42:57 +0800 Subject: [PATCH 21/21] fix: Table header columns size with filter or sorter (#22872) * fix size columns * update snapshot * more test code * patch * force ci * fix hover small style * adjust less --- .../__tests__/__snapshots__/demo.test.js.snap | 242 +++++++++++++++--- components/table/demo/dynamic-settings.md | 19 +- components/table/style/index.less | 11 + components/table/style/size.less | 22 +- 4 files changed, 251 insertions(+), 43 deletions(-) diff --git a/components/table/__tests__/__snapshots__/demo.test.js.snap b/components/table/__tests__/__snapshots__/demo.test.js.snap index a0ad4d0c57..9de2e34ed4 100644 --- a/components/table/__tests__/__snapshots__/demo.test.js.snap +++ b/components/table/__tests__/__snapshots__/demo.test.js.snap @@ -2311,19 +2311,211 @@ exports[`renders ./components/table/demo/dynamic-settings.md correctly 1`] = ` Name - Age +
+
+ + Age + + + + + + + + + + + +
+
- Address +
+ + Address + + + + + + + + +
- Action +
+ +
+
+ + Action + + + + + + + + + + + +
+
+
+ + + + + + + +
@@ -2365,9 +2557,7 @@ exports[`renders ./components/table/demo/dynamic-settings.md correctly 1`] = ` - - John Brown - + John Brown - - John Brown - + John Brown - - John Brown - + John Brown - - John Brown - + John Brown - - John Brown - + John Brown - - John Brown - + John Brown - - John Brown - + John Brown - - John Brown - + John Brown - - John Brown - + John Brown - - John Brown - + John Brown {text}, }, { title: 'Age', dataIndex: 'age', - key: 'age', + sorter: (a, b) => a.age - b.age, }, { title: 'Address', dataIndex: 'address', - key: 'address', + filters: [ + { + text: 'London', + value: 'London', + }, + { + text: 'New York', + value: 'New York', + }, + ], + onFilter: (value, record) => record.address.indexOf(value) === 0, }, { title: 'Action', key: 'action', + sorter: true, + filters: [], + onFilter: () => {}, render: () => ( Delete diff --git a/components/table/style/index.less b/components/table/style/index.less index 71fff4d5e5..07d396ccab 100644 --- a/components/table/style/index.less +++ b/components/table/style/index.less @@ -255,6 +255,17 @@ padding: @table-padding-vertical 2.3em @table-padding-vertical @table-padding-horizontal; } + // Remove padding when sorter also provided + &-thead tr th.@{table-prefix-cls}-column-has-sorters { + .@{table-prefix-cls}-filter-column { + margin: 0; + } + + .@{table-prefix-cls}-filter-column-title { + padding: 0 2.3em 0 0; + } + } + &-filter-trigger-container { position: absolute; top: 0; diff --git a/components/table/style/size.less b/components/table/style/size.less index 1eb911a3a6..b32d24c0e3 100644 --- a/components/table/style/size.less +++ b/components/table/style/size.less @@ -1,7 +1,7 @@ @import './index'; .table-size(@size, @padding-vertical, @padding-horizontal) { - .@{table-prefix-cls}.@{table-prefix-cls}-@{size} { + .@{table-prefix-cls}-@{size} { .@{table-prefix-cls}-title, .@{table-prefix-cls}-footer, .@{table-prefix-cls}-thead > tr > th, @@ -9,8 +9,22 @@ padding: @padding-vertical @padding-horizontal; } - .@{table-prefix-cls}-filter-column { - margin: -@padding-vertical -@padding-horizontal; + .@{table-prefix-cls}-thead { + th.@{table-prefix-cls}-column-has-sorters { + padding: 0; + } + + .@{table-prefix-cls}-filter-column { + margin: -@padding-vertical -@padding-horizontal; + } + + .@{table-prefix-cls}-filter-column-title { + padding: @padding-vertical 2.3em @padding-vertical @padding-horizontal; + } + + .@{table-prefix-cls}-column-sorters { + padding: @padding-vertical @padding-horizontal; + } } .@{table-prefix-cls}-expanded-row-fixed { @@ -29,7 +43,7 @@ // ================================================================ .table-size(~'small', @table-padding-vertical-sm, @table-padding-horizontal-sm); -.@{table-prefix-cls}.@{table-prefix-cls}-small { +.@{table-prefix-cls}-small { .@{table-prefix-cls}-thead > tr > th { background-color: @table-header-bg-sm; }