From bae278ff008593a969daba4d1237a10b1870564b Mon Sep 17 00:00:00 2001 From: shao Date: Wed, 11 Sep 2019 20:37:50 +0800 Subject: [PATCH 1/4] feat(Input.Search): add loading prop --- components/input/Search.tsx | 30 ++++- components/input/__tests__/Search.test.js | 7 ++ .../__snapshots__/Search.test.js.snap | 79 ++++++++++++ .../__tests__/__snapshots__/demo.test.js.snap | 112 ++++++++++++++++++ components/input/demo/search-input-loading.md | 68 +++++++++++ components/input/index.en-US.md | 1 + components/input/index.zh-CN.md | 1 + 7 files changed, 295 insertions(+), 3 deletions(-) create mode 100644 components/input/demo/search-input-loading.md diff --git a/components/input/Search.tsx b/components/input/Search.tsx index 5872e76eb13a..b84414efd62e 100644 --- a/components/input/Search.tsx +++ b/components/input/Search.tsx @@ -12,6 +12,7 @@ export interface SearchProps extends InputProps { event?: React.MouseEvent | React.KeyboardEvent, ) => void; enterButton?: boolean | React.ReactNode; + loading?: boolean; } export default class Search extends React.Component { @@ -41,8 +42,26 @@ export default class Search extends React.Component { this.input.blur(); } + renderLoading = (prefixCls: string) => { + const { enterButton, size } = this.props; + + if (enterButton) { + return ( + + ); + } + return ; + }; + renderSuffix = (prefixCls: string) => { - const { suffix, enterButton } = this.props; + const { suffix, enterButton, loading } = this.props; + + if (loading && !enterButton) { + return this.renderLoading(prefixCls); + } + if (enterButton) return suffix; const node = ( @@ -68,10 +87,15 @@ export default class Search extends React.Component { }; renderAddonAfter = (prefixCls: string) => { - const { enterButton, size, disabled, addonAfter } = this.props; - if (!enterButton) return addonAfter; + const { enterButton, size, disabled, addonAfter, loading } = this.props; const btnClassName = `${prefixCls}-button`; + if (loading && enterButton) { + return this.renderLoading(prefixCls); + } + + if (!enterButton) return addonAfter; + let button: React.ReactNode; const enterButtonAsElement = enterButton as React.ReactElement; if (enterButtonAsElement.type === Button || enterButtonAsElement.type === 'button') { diff --git a/components/input/__tests__/Search.test.js b/components/input/__tests__/Search.test.js index 26c14fbe8a08..059becc815ff 100644 --- a/components/input/__tests__/Search.test.js +++ b/components/input/__tests__/Search.test.js @@ -137,4 +137,11 @@ describe('Input.Search', () => { expect(wrapper.render()).toMatchSnapshot(); expect(wrapperWithEnterButton.render()).toMatchSnapshot(); }); + + it('should support loading', () => { + const wrapper = mount(); + const wrapperWithEnterButton = mount(); + expect(wrapper.render()).toMatchSnapshot(); + expect(wrapperWithEnterButton.render()).toMatchSnapshot(); + }); }); diff --git a/components/input/__tests__/__snapshots__/Search.test.js.snap b/components/input/__tests__/__snapshots__/Search.test.js.snap index c62aa59ca724..a5ec6ef6d071 100644 --- a/components/input/__tests__/__snapshots__/Search.test.js.snap +++ b/components/input/__tests__/__snapshots__/Search.test.js.snap @@ -150,3 +150,82 @@ exports[`Input.Search should support custom button 1`] = ` `; + +exports[`Input.Search should support loading 1`] = ` + + + + + + + + +`; + +exports[`Input.Search should support loading 2`] = ` + + + + + + + + +`; diff --git a/components/input/__tests__/__snapshots__/demo.test.js.snap b/components/input/__tests__/__snapshots__/demo.test.js.snap index 8fbb4080829b..8a5d81f9a9ea 100644 --- a/components/input/__tests__/__snapshots__/demo.test.js.snap +++ b/components/input/__tests__/__snapshots__/demo.test.js.snap @@ -1811,6 +1811,118 @@ exports[`renders ./components/input/demo/search-input.md correctly 1`] = ` `; +exports[`renders ./components/input/demo/search-input-loading.md correctly 1`] = ` +
+ + + + + + + + +
+
+ + + + + + + + +
+
+ + + + + + + + +
+`; + exports[`renders ./components/input/demo/size.md correctly 1`] = `
{ + this.setState({ + loading: true, + }); + setTimeout(() => { + this.setState({ + loading: false, + }); + }, 2000); + }; + + render() { + return ( +
+ +
+
+ +
+
+ +
+ ); + } +} + +ReactDOM.render(, mountNode); +``` diff --git a/components/input/index.en-US.md b/components/input/index.en-US.md index cb6e2608171a..5a784d735486 100644 --- a/components/input/index.en-US.md +++ b/components/input/index.en-US.md @@ -56,6 +56,7 @@ The rest of the props of `Input.TextArea` are the same as the original [textarea | --- | --- | --- | --- | --- | | enterButton | to show an enter button after input. This prop is conflict with addon. | boolean\|ReactNode | false | | | onSearch | The callback function that is triggered when you click on the search-icon or press Enter key. | function(value, event) | | | +| onSearch | Search box with loading. | boolean | | | Supports all props of `Input`. diff --git a/components/input/index.zh-CN.md b/components/input/index.zh-CN.md index 320368fb2e95..358fd7e93d7c 100644 --- a/components/input/index.zh-CN.md +++ b/components/input/index.zh-CN.md @@ -55,6 +55,7 @@ Input 的其他属性和 React 自带的 [input](https://facebook.github.io/reac | --- | --- | --- | --- | --- | | enterButton | 是否有确认按钮,可设为按钮文字。该属性会与 addon 冲突。 | boolean\|ReactNode | false | | | onSearch | 点击搜索或按下回车键时的回调 | function(value, event) | | | +| loading | 搜索 loading | boolean | | | 其余属性和 Input 一致。 From b477829cb372b58c9de922acda0c052d4c4a4c10 Mon Sep 17 00:00:00 2001 From: shao Date: Thu, 12 Sep 2019 10:18:30 +0800 Subject: [PATCH 2/4] fix: review change --- components/input/Search.tsx | 2 +- components/input/index.en-US.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/components/input/Search.tsx b/components/input/Search.tsx index b84414efd62e..e1cac8e3e6a7 100644 --- a/components/input/Search.tsx +++ b/components/input/Search.tsx @@ -11,7 +11,7 @@ export interface SearchProps extends InputProps { value: string, event?: React.MouseEvent | React.KeyboardEvent, ) => void; - enterButton?: boolean | React.ReactNode; + enterButton?: React.ReactNode; loading?: boolean; } diff --git a/components/input/index.en-US.md b/components/input/index.en-US.md index 5a784d735486..e3762fa3c1ad 100644 --- a/components/input/index.en-US.md +++ b/components/input/index.en-US.md @@ -56,7 +56,7 @@ The rest of the props of `Input.TextArea` are the same as the original [textarea | --- | --- | --- | --- | --- | | enterButton | to show an enter button after input. This prop is conflict with addon. | boolean\|ReactNode | false | | | onSearch | The callback function that is triggered when you click on the search-icon or press Enter key. | function(value, event) | | | -| onSearch | Search box with loading. | boolean | | | +| loading | Search box with loading. | boolean | | | Supports all props of `Input`. From c4c6f54331284dedbf89624d9e5e5fb8198f3c47 Mon Sep 17 00:00:00 2001 From: shaodahong Date: Thu, 12 Sep 2019 19:21:17 +0800 Subject: [PATCH 3/4] optimize input search loading prop doc --- components/input/Search.tsx | 4 +- .../__tests__/__snapshots__/demo.test.js.snap | 91 +++++++++++++++---- components/input/demo/search-input-loading.md | 44 +++------ components/input/style/search-input.less | 1 - 4 files changed, 84 insertions(+), 56 deletions(-) diff --git a/components/input/Search.tsx b/components/input/Search.tsx index e1cac8e3e6a7..4bc0b8b85c69 100644 --- a/components/input/Search.tsx +++ b/components/input/Search.tsx @@ -59,7 +59,7 @@ export default class Search extends React.Component { const { suffix, enterButton, loading } = this.props; if (loading && !enterButton) { - return this.renderLoading(prefixCls); + return [suffix, this.renderLoading(prefixCls)]; } if (enterButton) return suffix; @@ -91,7 +91,7 @@ export default class Search extends React.Component { const btnClassName = `${prefixCls}-button`; if (loading && enterButton) { - return this.renderLoading(prefixCls); + return [this.renderLoading(prefixCls), addonAfter]; } if (!enterButton) return addonAfter; diff --git a/components/input/__tests__/__snapshots__/demo.test.js.snap b/components/input/__tests__/__snapshots__/demo.test.js.snap index 8a5d81f9a9ea..39dffdc90dce 100644 --- a/components/input/__tests__/__snapshots__/demo.test.js.snap +++ b/components/input/__tests__/__snapshots__/demo.test.js.snap @@ -1815,11 +1815,10 @@ exports[`renders ./components/input/demo/search-input-loading.md correctly 1`] =
@@ -1827,22 +1826,57 @@ exports[`renders ./components/input/demo/search-input-loading.md correctly 1`] = class="ant-input-suffix" > + + + +
+
+ + + + suffix + + @@ -1858,7 +1892,7 @@ exports[`renders ./components/input/demo/search-input-loading.md correctly 1`] = > @@ -1870,21 +1904,21 @@ exports[`renders ./components/input/demo/search-input-loading.md correctly 1`] = type="button" > @@ -1902,7 +1936,7 @@ exports[`renders ./components/input/demo/search-input-loading.md correctly 1`] = > @@ -1913,10 +1947,27 @@ exports[`renders ./components/input/demo/search-input-loading.md correctly 1`] = class="ant-btn ant-input-search-button ant-btn-primary" type="button" > - - Search - + + + + addonAfter diff --git a/components/input/demo/search-input-loading.md b/components/input/demo/search-input-loading.md index 2275e1d25139..5dc3418fd3c7 100644 --- a/components/input/demo/search-input-loading.md +++ b/components/input/demo/search-input-loading.md @@ -7,11 +7,11 @@ title: ## zh-CN -搜索框 loading +用于 `onSearch` 的时候展示 `loading`。 ## en-US -search loading when onSearch +Search loading when onSearch. ```jsx import { Input } from 'antd'; @@ -19,45 +19,23 @@ import { Input } from 'antd'; const { Search } = Input; class InputSearch extends React.Component { - state = { - loading: false, - }; - - onSearch = () => { - this.setState({ - loading: true, - }); - setTimeout(() => { - this.setState({ - loading: false, - }); - }, 2000); - }; - render() { return (
- +

- + +
+
+

); diff --git a/components/input/style/search-input.less b/components/input/style/search-input.less index 9d6f8490040c..62217f626574 100644 --- a/components/input/style/search-input.less +++ b/components/input/style/search-input.less @@ -26,7 +26,6 @@ border: 0; .@{search-prefix}-button { - width: 100%; border-top-left-radius: 0; border-bottom-left-radius: 0; } From 93477a4d7b5f03b342d97aad88fab50be3284078 Mon Sep 17 00:00:00 2001 From: shaodahong Date: Thu, 12 Sep 2019 20:04:19 +0800 Subject: [PATCH 4/4] fix: ci fail and onSearch disabled when loading --- components/input/Search.tsx | 5 +- components/input/demo/search-input-loading.md | 45 +- .../__tests__/__snapshots__/demo.test.js.snap | 880 +++++++++--------- .../__snapshots__/empty.test.js.snap | 12 +- 4 files changed, 470 insertions(+), 472 deletions(-) diff --git a/components/input/Search.tsx b/components/input/Search.tsx index 4bc0b8b85c69..5c9deb77433a 100644 --- a/components/input/Search.tsx +++ b/components/input/Search.tsx @@ -27,7 +27,10 @@ export default class Search extends React.Component { }; onSearch = (e: React.MouseEvent | React.KeyboardEvent) => { - const { onSearch } = this.props; + const { onSearch, loading } = this.props; + + if (loading) return; + if (onSearch) { onSearch(this.input.input.value, e); } diff --git a/components/input/demo/search-input-loading.md b/components/input/demo/search-input-loading.md index 5dc3418fd3c7..b89989e163b0 100644 --- a/components/input/demo/search-input-loading.md +++ b/components/input/demo/search-input-loading.md @@ -18,29 +18,24 @@ import { Input } from 'antd'; const { Search } = Input; -class InputSearch extends React.Component { - render() { - return ( -
- -
-
- -
-
- -
-
- -
- ); - } -} - -ReactDOM.render(, mountNode); +ReactDOM.render( +
+ +
+
+ +
+
+ +
+
+ +
, + mountNode, +); ``` diff --git a/components/table/__tests__/__snapshots__/demo.test.js.snap b/components/table/__tests__/__snapshots__/demo.test.js.snap index 6c45c8f154ab..6fe57dc16860 100755 --- a/components/table/__tests__/__snapshots__/demo.test.js.snap +++ b/components/table/__tests__/__snapshots__/demo.test.js.snap @@ -36,7 +36,7 @@ exports[`renders ./components/table/demo/ajax.md correctly 1`] = ` >
Edrward 0 32 London Park no. 0 @@ -4056,17 +4056,17 @@ exports[`renders ./components/table/demo/edit-row.md correctly 1`] = ` data-row-key="1" > Edrward 1 32 London Park no. 1 @@ -4083,17 +4083,17 @@ exports[`renders ./components/table/demo/edit-row.md correctly 1`] = ` data-row-key="2" > Edrward 2 32 London Park no. 2 @@ -4110,17 +4110,17 @@ exports[`renders ./components/table/demo/edit-row.md correctly 1`] = ` data-row-key="3" > Edrward 3 32 London Park no. 3 @@ -4137,17 +4137,17 @@ exports[`renders ./components/table/demo/edit-row.md correctly 1`] = ` data-row-key="4" > Edrward 4 32 London Park no. 4 @@ -4164,17 +4164,17 @@ exports[`renders ./components/table/demo/edit-row.md correctly 1`] = ` data-row-key="5" > Edrward 5 32 London Park no. 5 @@ -4191,17 +4191,17 @@ exports[`renders ./components/table/demo/edit-row.md correctly 1`] = ` data-row-key="6" > Edrward 6 32 London Park no. 6 @@ -4218,17 +4218,17 @@ exports[`renders ./components/table/demo/edit-row.md correctly 1`] = ` data-row-key="7" > Edrward 7 32 London Park no. 7 @@ -4245,17 +4245,17 @@ exports[`renders ./components/table/demo/edit-row.md correctly 1`] = ` data-row-key="8" > Edrward 8 32 London Park no. 8 @@ -4272,17 +4272,17 @@ exports[`renders ./components/table/demo/edit-row.md correctly 1`] = ` data-row-key="9" > Edrward 9 32 London Park no. 9 @@ -4499,7 +4499,7 @@ exports[`renders ./components/table/demo/ellipsis.md correctly 1`] = ` > John Brown 32 @@ -4653,14 +4653,14 @@ exports[`renders ./components/table/demo/ellipsis.md correctly 1`] = ` data-row-key="2" > Jim Green 42 @@ -4690,14 +4690,14 @@ exports[`renders ./components/table/demo/ellipsis.md correctly 1`] = ` data-row-key="3" > Joe Black 32 @@ -5207,7 +5207,7 @@ exports[`renders ./components/table/demo/expand-children.md correctly 1`] = ` 60 New York No. 1 Lake Park @@ -5336,12 +5336,12 @@ exports[`renders ./components/table/demo/expand-children.md correctly 1`] = ` Joe Black 32 Sidney No. 1 Lake Park @@ -5480,7 +5480,7 @@ exports[`renders ./components/table/demo/fixed-columns.md correctly 1`] = ` > John Brown 32 @@ -5737,7 +5737,7 @@ exports[`renders ./components/table/demo/fixed-columns.md correctly 1`] = ` New York Park action @@ -5749,12 +5749,12 @@ exports[`renders ./components/table/demo/fixed-columns.md correctly 1`] = ` data-row-key="2" > Jim Green 40 @@ -5799,7 +5799,7 @@ exports[`renders ./components/table/demo/fixed-columns.md correctly 1`] = ` London Park action @@ -5836,7 +5836,7 @@ exports[`renders ./components/table/demo/fixed-columns.md correctly 1`] = ` > John Brown 32 @@ -5896,12 +5896,12 @@ exports[`renders ./components/table/demo/fixed-columns.md correctly 1`] = ` data-row-key="2" > Jim Green 40 @@ -5934,7 +5934,7 @@ exports[`renders ./components/table/demo/fixed-columns.md correctly 1`] = ` > action @@ -5973,7 +5973,7 @@ exports[`renders ./components/table/demo/fixed-columns.md correctly 1`] = ` data-row-key="2" > action @@ -6128,7 +6128,7 @@ exports[`renders ./components/table/demo/fixed-columns-header.md correctly 1`] = > Edrward 0 32 London Park no. 0 London Park no. 0 London Park no. 0 London Park no. 0 London Park no. 0 London Park no. 0 London Park no. 0 @@ -6429,7 +6429,7 @@ exports[`renders ./components/table/demo/fixed-columns-header.md correctly 1`] = London Park no. 0 action @@ -6441,47 +6441,47 @@ exports[`renders ./components/table/demo/fixed-columns-header.md correctly 1`] = data-row-key="1" > Edrward 1 32 London Park no. 1 London Park no. 1 London Park no. 1 London Park no. 1 London Park no. 1 London Park no. 1 London Park no. 1 @@ -6491,7 +6491,7 @@ exports[`renders ./components/table/demo/fixed-columns-header.md correctly 1`] = London Park no. 1 action @@ -6503,47 +6503,47 @@ exports[`renders ./components/table/demo/fixed-columns-header.md correctly 1`] = data-row-key="2" > Edrward 2 32 London Park no. 2 London Park no. 2 London Park no. 2 London Park no. 2 London Park no. 2 London Park no. 2 London Park no. 2 @@ -6553,7 +6553,7 @@ exports[`renders ./components/table/demo/fixed-columns-header.md correctly 1`] = London Park no. 2 action @@ -6565,47 +6565,47 @@ exports[`renders ./components/table/demo/fixed-columns-header.md correctly 1`] = data-row-key="3" > Edrward 3 32 London Park no. 3 London Park no. 3 London Park no. 3 London Park no. 3 London Park no. 3 London Park no. 3 London Park no. 3 @@ -6615,7 +6615,7 @@ exports[`renders ./components/table/demo/fixed-columns-header.md correctly 1`] = London Park no. 3 action @@ -6627,47 +6627,47 @@ exports[`renders ./components/table/demo/fixed-columns-header.md correctly 1`] = data-row-key="4" > Edrward 4 32 London Park no. 4 London Park no. 4 London Park no. 4 London Park no. 4 London Park no. 4 London Park no. 4 London Park no. 4 @@ -6677,7 +6677,7 @@ exports[`renders ./components/table/demo/fixed-columns-header.md correctly 1`] = London Park no. 4 action @@ -6689,47 +6689,47 @@ exports[`renders ./components/table/demo/fixed-columns-header.md correctly 1`] = data-row-key="5" > Edrward 5 32 London Park no. 5 London Park no. 5 London Park no. 5 London Park no. 5 London Park no. 5 London Park no. 5 London Park no. 5 @@ -6739,7 +6739,7 @@ exports[`renders ./components/table/demo/fixed-columns-header.md correctly 1`] = London Park no. 5 action @@ -6751,47 +6751,47 @@ exports[`renders ./components/table/demo/fixed-columns-header.md correctly 1`] = data-row-key="6" > Edrward 6 32 London Park no. 6 London Park no. 6 London Park no. 6 London Park no. 6 London Park no. 6 London Park no. 6 London Park no. 6 @@ -6801,7 +6801,7 @@ exports[`renders ./components/table/demo/fixed-columns-header.md correctly 1`] = London Park no. 6 action @@ -6813,47 +6813,47 @@ exports[`renders ./components/table/demo/fixed-columns-header.md correctly 1`] = data-row-key="7" > Edrward 7 32 London Park no. 7 London Park no. 7 London Park no. 7 London Park no. 7 London Park no. 7 London Park no. 7 London Park no. 7 @@ -6863,7 +6863,7 @@ exports[`renders ./components/table/demo/fixed-columns-header.md correctly 1`] = London Park no. 7 action @@ -6875,47 +6875,47 @@ exports[`renders ./components/table/demo/fixed-columns-header.md correctly 1`] = data-row-key="8" > Edrward 8 32 London Park no. 8 London Park no. 8 London Park no. 8 London Park no. 8 London Park no. 8 London Park no. 8 London Park no. 8 @@ -6925,7 +6925,7 @@ exports[`renders ./components/table/demo/fixed-columns-header.md correctly 1`] = London Park no. 8 action @@ -6937,47 +6937,47 @@ exports[`renders ./components/table/demo/fixed-columns-header.md correctly 1`] = data-row-key="9" > Edrward 9 32 London Park no. 9 London Park no. 9 London Park no. 9 London Park no. 9 London Park no. 9 London Park no. 9 London Park no. 9 @@ -6987,7 +6987,7 @@ exports[`renders ./components/table/demo/fixed-columns-header.md correctly 1`] = London Park no. 9 action @@ -7020,7 +7020,7 @@ exports[`renders ./components/table/demo/fixed-columns-header.md correctly 1`] = > Edrward 0 32 @@ -7101,12 +7101,12 @@ exports[`renders ./components/table/demo/fixed-columns-header.md correctly 1`] = data-row-key="1" > Edrward 1 32 @@ -7116,12 +7116,12 @@ exports[`renders ./components/table/demo/fixed-columns-header.md correctly 1`] = data-row-key="2" > Edrward 2 32 @@ -7131,12 +7131,12 @@ exports[`renders ./components/table/demo/fixed-columns-header.md correctly 1`] = data-row-key="3" > Edrward 3 32 @@ -7146,12 +7146,12 @@ exports[`renders ./components/table/demo/fixed-columns-header.md correctly 1`] = data-row-key="4" > Edrward 4 32 @@ -7161,12 +7161,12 @@ exports[`renders ./components/table/demo/fixed-columns-header.md correctly 1`] = data-row-key="5" > Edrward 5 32 @@ -7176,12 +7176,12 @@ exports[`renders ./components/table/demo/fixed-columns-header.md correctly 1`] = data-row-key="6" > Edrward 6 32 @@ -7191,12 +7191,12 @@ exports[`renders ./components/table/demo/fixed-columns-header.md correctly 1`] = data-row-key="7" > Edrward 7 32 @@ -7206,12 +7206,12 @@ exports[`renders ./components/table/demo/fixed-columns-header.md correctly 1`] = data-row-key="8" > Edrward 8 32 @@ -7221,12 +7221,12 @@ exports[`renders ./components/table/demo/fixed-columns-header.md correctly 1`] = data-row-key="9" > Edrward 9 32 @@ -7255,7 +7255,7 @@ exports[`renders ./components/table/demo/fixed-columns-header.md correctly 1`] = > action @@ -7312,7 +7312,7 @@ exports[`renders ./components/table/demo/fixed-columns-header.md correctly 1`] = data-row-key="1" > action @@ -7324,7 +7324,7 @@ exports[`renders ./components/table/demo/fixed-columns-header.md correctly 1`] = data-row-key="2" > action @@ -7336,7 +7336,7 @@ exports[`renders ./components/table/demo/fixed-columns-header.md correctly 1`] = data-row-key="3" > action @@ -7348,7 +7348,7 @@ exports[`renders ./components/table/demo/fixed-columns-header.md correctly 1`] = data-row-key="4" > action @@ -7360,7 +7360,7 @@ exports[`renders ./components/table/demo/fixed-columns-header.md correctly 1`] = data-row-key="5" > action @@ -7372,7 +7372,7 @@ exports[`renders ./components/table/demo/fixed-columns-header.md correctly 1`] = data-row-key="6" > action @@ -7384,7 +7384,7 @@ exports[`renders ./components/table/demo/fixed-columns-header.md correctly 1`] = data-row-key="7" > action @@ -7396,7 +7396,7 @@ exports[`renders ./components/table/demo/fixed-columns-header.md correctly 1`] = data-row-key="8" > action @@ -7408,7 +7408,7 @@ exports[`renders ./components/table/demo/fixed-columns-header.md correctly 1`] = data-row-key="9" > action @@ -7622,7 +7622,7 @@ exports[`renders ./components/table/demo/fixed-header.md correctly 1`] = ` > Edward King 0 32 @@ -7724,12 +7724,12 @@ exports[`renders ./components/table/demo/fixed-header.md correctly 1`] = ` data-row-key="1" > Edward King 1 32 @@ -7744,12 +7744,12 @@ exports[`renders ./components/table/demo/fixed-header.md correctly 1`] = ` data-row-key="2" > Edward King 2 32 @@ -7764,12 +7764,12 @@ exports[`renders ./components/table/demo/fixed-header.md correctly 1`] = ` data-row-key="3" > Edward King 3 32 @@ -7784,12 +7784,12 @@ exports[`renders ./components/table/demo/fixed-header.md correctly 1`] = ` data-row-key="4" > Edward King 4 32 @@ -7804,12 +7804,12 @@ exports[`renders ./components/table/demo/fixed-header.md correctly 1`] = ` data-row-key="5" > Edward King 5 32 @@ -7824,12 +7824,12 @@ exports[`renders ./components/table/demo/fixed-header.md correctly 1`] = ` data-row-key="6" > Edward King 6 32 @@ -7844,12 +7844,12 @@ exports[`renders ./components/table/demo/fixed-header.md correctly 1`] = ` data-row-key="7" > Edward King 7 32 @@ -7864,12 +7864,12 @@ exports[`renders ./components/table/demo/fixed-header.md correctly 1`] = ` data-row-key="8" > Edward King 8 32 @@ -7884,12 +7884,12 @@ exports[`renders ./components/table/demo/fixed-header.md correctly 1`] = ` data-row-key="9" > Edward King 9 32 @@ -7904,12 +7904,12 @@ exports[`renders ./components/table/demo/fixed-header.md correctly 1`] = ` data-row-key="10" > Edward King 10 32 @@ -7924,12 +7924,12 @@ exports[`renders ./components/table/demo/fixed-header.md correctly 1`] = ` data-row-key="11" > Edward King 11 32 @@ -7944,12 +7944,12 @@ exports[`renders ./components/table/demo/fixed-header.md correctly 1`] = ` data-row-key="12" > Edward King 12 32 @@ -7964,12 +7964,12 @@ exports[`renders ./components/table/demo/fixed-header.md correctly 1`] = ` data-row-key="13" > Edward King 13 32 @@ -7984,12 +7984,12 @@ exports[`renders ./components/table/demo/fixed-header.md correctly 1`] = ` data-row-key="14" > Edward King 14 32 @@ -8004,12 +8004,12 @@ exports[`renders ./components/table/demo/fixed-header.md correctly 1`] = ` data-row-key="15" > Edward King 15 32 @@ -8024,12 +8024,12 @@ exports[`renders ./components/table/demo/fixed-header.md correctly 1`] = ` data-row-key="16" > Edward King 16 32 @@ -8044,12 +8044,12 @@ exports[`renders ./components/table/demo/fixed-header.md correctly 1`] = ` data-row-key="17" > Edward King 17 32 @@ -8064,12 +8064,12 @@ exports[`renders ./components/table/demo/fixed-header.md correctly 1`] = ` data-row-key="18" > Edward King 18 32 @@ -8084,12 +8084,12 @@ exports[`renders ./components/table/demo/fixed-header.md correctly 1`] = ` data-row-key="19" > Edward King 19 32 @@ -8104,12 +8104,12 @@ exports[`renders ./components/table/demo/fixed-header.md correctly 1`] = ` data-row-key="20" > Edward King 20 32 @@ -8124,12 +8124,12 @@ exports[`renders ./components/table/demo/fixed-header.md correctly 1`] = ` data-row-key="21" > Edward King 21 32 @@ -8144,12 +8144,12 @@ exports[`renders ./components/table/demo/fixed-header.md correctly 1`] = ` data-row-key="22" > Edward King 22 32 @@ -8164,12 +8164,12 @@ exports[`renders ./components/table/demo/fixed-header.md correctly 1`] = ` data-row-key="23" > Edward King 23 32 @@ -8184,12 +8184,12 @@ exports[`renders ./components/table/demo/fixed-header.md correctly 1`] = ` data-row-key="24" > Edward King 24 32 @@ -8204,12 +8204,12 @@ exports[`renders ./components/table/demo/fixed-header.md correctly 1`] = ` data-row-key="25" > Edward King 25 32 @@ -8224,12 +8224,12 @@ exports[`renders ./components/table/demo/fixed-header.md correctly 1`] = ` data-row-key="26" > Edward King 26 32 @@ -8244,12 +8244,12 @@ exports[`renders ./components/table/demo/fixed-header.md correctly 1`] = ` data-row-key="27" > Edward King 27 32 @@ -8264,12 +8264,12 @@ exports[`renders ./components/table/demo/fixed-header.md correctly 1`] = ` data-row-key="28" > Edward King 28 32 @@ -8284,12 +8284,12 @@ exports[`renders ./components/table/demo/fixed-header.md correctly 1`] = ` data-row-key="29" > Edward King 29 32 @@ -8304,12 +8304,12 @@ exports[`renders ./components/table/demo/fixed-header.md correctly 1`] = ` data-row-key="30" > Edward King 30 32 @@ -8324,12 +8324,12 @@ exports[`renders ./components/table/demo/fixed-header.md correctly 1`] = ` data-row-key="31" > Edward King 31 32 @@ -8344,12 +8344,12 @@ exports[`renders ./components/table/demo/fixed-header.md correctly 1`] = ` data-row-key="32" > Edward King 32 32 @@ -8364,12 +8364,12 @@ exports[`renders ./components/table/demo/fixed-header.md correctly 1`] = ` data-row-key="33" > Edward King 33 32 @@ -8384,12 +8384,12 @@ exports[`renders ./components/table/demo/fixed-header.md correctly 1`] = ` data-row-key="34" > Edward King 34 32 @@ -8404,12 +8404,12 @@ exports[`renders ./components/table/demo/fixed-header.md correctly 1`] = ` data-row-key="35" > Edward King 35 32 @@ -8424,12 +8424,12 @@ exports[`renders ./components/table/demo/fixed-header.md correctly 1`] = ` data-row-key="36" > Edward King 36 32 @@ -8444,12 +8444,12 @@ exports[`renders ./components/table/demo/fixed-header.md correctly 1`] = ` data-row-key="37" > Edward King 37 32 @@ -8464,12 +8464,12 @@ exports[`renders ./components/table/demo/fixed-header.md correctly 1`] = ` data-row-key="38" > Edward King 38 32 @@ -8484,12 +8484,12 @@ exports[`renders ./components/table/demo/fixed-header.md correctly 1`] = ` data-row-key="39" > Edward King 39 32 @@ -8504,12 +8504,12 @@ exports[`renders ./components/table/demo/fixed-header.md correctly 1`] = ` data-row-key="40" > Edward King 40 32 @@ -8524,12 +8524,12 @@ exports[`renders ./components/table/demo/fixed-header.md correctly 1`] = ` data-row-key="41" > Edward King 41 32 @@ -8544,12 +8544,12 @@ exports[`renders ./components/table/demo/fixed-header.md correctly 1`] = ` data-row-key="42" > Edward King 42 32 @@ -8564,12 +8564,12 @@ exports[`renders ./components/table/demo/fixed-header.md correctly 1`] = ` data-row-key="43" > Edward King 43 32 @@ -8584,12 +8584,12 @@ exports[`renders ./components/table/demo/fixed-header.md correctly 1`] = ` data-row-key="44" > Edward King 44 32 @@ -8604,12 +8604,12 @@ exports[`renders ./components/table/demo/fixed-header.md correctly 1`] = ` data-row-key="45" > Edward King 45 32 @@ -8624,12 +8624,12 @@ exports[`renders ./components/table/demo/fixed-header.md correctly 1`] = ` data-row-key="46" > Edward King 46 32 @@ -8644,12 +8644,12 @@ exports[`renders ./components/table/demo/fixed-header.md correctly 1`] = ` data-row-key="47" > Edward King 47 32 @@ -8664,12 +8664,12 @@ exports[`renders ./components/table/demo/fixed-header.md correctly 1`] = ` data-row-key="48" > Edward King 48 32 @@ -8684,12 +8684,12 @@ exports[`renders ./components/table/demo/fixed-header.md correctly 1`] = ` data-row-key="49" > Edward King 49 32 @@ -8847,7 +8847,7 @@ exports[`renders ./components/table/demo/grouping-columns.md correctly 1`] = ` > John Brown 1 Lake Park C 2035 Lake Street 42 @@ -9225,7 +9225,7 @@ exports[`renders ./components/table/demo/grouping-columns.md correctly 1`] = ` SoftLake Co M @@ -9235,32 +9235,32 @@ exports[`renders ./components/table/demo/grouping-columns.md correctly 1`] = ` data-row-key="1" > John Brown 2 Lake Park C 2035 Lake Street 42 @@ -9270,7 +9270,7 @@ exports[`renders ./components/table/demo/grouping-columns.md correctly 1`] = ` SoftLake Co M @@ -9280,32 +9280,32 @@ exports[`renders ./components/table/demo/grouping-columns.md correctly 1`] = ` data-row-key="2" > John Brown 3 Lake Park C 2035 Lake Street 42 @@ -9315,7 +9315,7 @@ exports[`renders ./components/table/demo/grouping-columns.md correctly 1`] = ` SoftLake Co M @@ -9325,32 +9325,32 @@ exports[`renders ./components/table/demo/grouping-columns.md correctly 1`] = ` data-row-key="3" > John Brown 4 Lake Park C 2035 Lake Street 42 @@ -9360,7 +9360,7 @@ exports[`renders ./components/table/demo/grouping-columns.md correctly 1`] = ` SoftLake Co M @@ -9370,32 +9370,32 @@ exports[`renders ./components/table/demo/grouping-columns.md correctly 1`] = ` data-row-key="4" > John Brown 5 Lake Park C 2035 Lake Street 42 @@ -9405,7 +9405,7 @@ exports[`renders ./components/table/demo/grouping-columns.md correctly 1`] = ` SoftLake Co M @@ -9415,32 +9415,32 @@ exports[`renders ./components/table/demo/grouping-columns.md correctly 1`] = ` data-row-key="5" > John Brown 6 Lake Park C 2035 Lake Street 42 @@ -9450,7 +9450,7 @@ exports[`renders ./components/table/demo/grouping-columns.md correctly 1`] = ` SoftLake Co M @@ -9460,32 +9460,32 @@ exports[`renders ./components/table/demo/grouping-columns.md correctly 1`] = ` data-row-key="6" > John Brown 7 Lake Park C 2035 Lake Street 42 @@ -9495,7 +9495,7 @@ exports[`renders ./components/table/demo/grouping-columns.md correctly 1`] = ` SoftLake Co M @@ -9505,32 +9505,32 @@ exports[`renders ./components/table/demo/grouping-columns.md correctly 1`] = ` data-row-key="7" > John Brown 8 Lake Park C 2035 Lake Street 42 @@ -9540,7 +9540,7 @@ exports[`renders ./components/table/demo/grouping-columns.md correctly 1`] = ` SoftLake Co M @@ -9550,32 +9550,32 @@ exports[`renders ./components/table/demo/grouping-columns.md correctly 1`] = ` data-row-key="8" > John Brown 9 Lake Park C 2035 Lake Street 42 @@ -9585,7 +9585,7 @@ exports[`renders ./components/table/demo/grouping-columns.md correctly 1`] = ` SoftLake Co M @@ -9595,32 +9595,32 @@ exports[`renders ./components/table/demo/grouping-columns.md correctly 1`] = ` data-row-key="9" > John Brown 10 Lake Park C 2035 Lake Street 42 @@ -9630,7 +9630,7 @@ exports[`renders ./components/table/demo/grouping-columns.md correctly 1`] = ` SoftLake Co M @@ -9658,7 +9658,7 @@ exports[`renders ./components/table/demo/grouping-columns.md correctly 1`] = ` > John Brown @@ -9735,7 +9735,7 @@ exports[`renders ./components/table/demo/grouping-columns.md correctly 1`] = ` data-row-key="1" > John Brown @@ -9745,7 +9745,7 @@ exports[`renders ./components/table/demo/grouping-columns.md correctly 1`] = ` data-row-key="2" > John Brown @@ -9755,7 +9755,7 @@ exports[`renders ./components/table/demo/grouping-columns.md correctly 1`] = ` data-row-key="3" > John Brown @@ -9765,7 +9765,7 @@ exports[`renders ./components/table/demo/grouping-columns.md correctly 1`] = ` data-row-key="4" > John Brown @@ -9775,7 +9775,7 @@ exports[`renders ./components/table/demo/grouping-columns.md correctly 1`] = ` data-row-key="5" > John Brown @@ -9785,7 +9785,7 @@ exports[`renders ./components/table/demo/grouping-columns.md correctly 1`] = ` data-row-key="6" > John Brown @@ -9795,7 +9795,7 @@ exports[`renders ./components/table/demo/grouping-columns.md correctly 1`] = ` data-row-key="7" > John Brown @@ -9805,7 +9805,7 @@ exports[`renders ./components/table/demo/grouping-columns.md correctly 1`] = ` data-row-key="8" > John Brown @@ -9815,7 +9815,7 @@ exports[`renders ./components/table/demo/grouping-columns.md correctly 1`] = ` data-row-key="9" > John Brown @@ -9844,7 +9844,7 @@ exports[`renders ./components/table/demo/grouping-columns.md correctly 1`] = ` > M @@ -9900,7 +9900,7 @@ exports[`renders ./components/table/demo/grouping-columns.md correctly 1`] = ` data-row-key="1" > M @@ -9910,7 +9910,7 @@ exports[`renders ./components/table/demo/grouping-columns.md correctly 1`] = ` data-row-key="2" > M @@ -9920,7 +9920,7 @@ exports[`renders ./components/table/demo/grouping-columns.md correctly 1`] = ` data-row-key="3" > M @@ -9930,7 +9930,7 @@ exports[`renders ./components/table/demo/grouping-columns.md correctly 1`] = ` data-row-key="4" > M @@ -9940,7 +9940,7 @@ exports[`renders ./components/table/demo/grouping-columns.md correctly 1`] = ` data-row-key="5" > M @@ -9950,7 +9950,7 @@ exports[`renders ./components/table/demo/grouping-columns.md correctly 1`] = ` data-row-key="6" > M @@ -9960,7 +9960,7 @@ exports[`renders ./components/table/demo/grouping-columns.md correctly 1`] = ` data-row-key="7" > M @@ -9970,7 +9970,7 @@ exports[`renders ./components/table/demo/grouping-columns.md correctly 1`] = ` data-row-key="8" > M @@ -9980,7 +9980,7 @@ exports[`renders ./components/table/demo/grouping-columns.md correctly 1`] = ` data-row-key="9" > M @@ -11902,7 +11902,7 @@ exports[`renders ./components/table/demo/resizable-column.md correctly 1`] = ` > 2018-02-11 120 income transfer @@ -12049,22 +12049,22 @@ exports[`renders ./components/table/demo/resizable-column.md correctly 1`] = ` data-row-key="1" > 2018-03-11 243 income transfer @@ -12081,22 +12081,22 @@ exports[`renders ./components/table/demo/resizable-column.md correctly 1`] = ` data-row-key="2" > 2018-04-11 98 income transfer diff --git a/components/table/__tests__/__snapshots__/empty.test.js.snap b/components/table/__tests__/__snapshots__/empty.test.js.snap index 5ea5d8c18dbf..7c83756948c2 100644 --- a/components/table/__tests__/__snapshots__/empty.test.js.snap +++ b/components/table/__tests__/__snapshots__/empty.test.js.snap @@ -491,7 +491,7 @@ exports[`Table renders empty table with fixed columns 1`] = ` >