From aebb7810007bc168c80073422a6e797e8ec2e112 Mon Sep 17 00:00:00 2001 From: zombieJ Date: Sun, 31 Mar 2019 14:01:24 +0800 Subject: [PATCH] Table style update. Move sort button after title (#15758) * update style of sort icon * update snapshot * micro adjust * little offset of arrow --- .../__snapshots__/components.test.js.snap | 252 ++- .../__tests__/__snapshots__/demo.test.js.snap | 18 +- .../__tests__/__snapshots__/demo.test.js.snap | 18 +- .../__snapshots__/index.test.js.snap | 792 ++++++- components/table/Table.tsx | 15 +- .../__snapshots__/Table.filter.test.js.snap | 9 +- .../Table.pagination.test.js.snap | 18 +- .../Table.rowSelection.test.js.snap | 83 +- .../__snapshots__/Table.sorter.test.js.snap | 84 +- .../__snapshots__/Table.test.js.snap | 36 +- .../__tests__/__snapshots__/demo.test.js.snap | 1914 ++++++++++++----- .../__snapshots__/empty.test.js.snap | 342 ++- components/table/style/index.less | 68 +- 13 files changed, 2802 insertions(+), 847 deletions(-) diff --git a/components/config-provider/__tests__/__snapshots__/components.test.js.snap b/components/config-provider/__tests__/__snapshots__/components.test.js.snap index 7a4a2e2497..cc1740a684 100644 --- a/components/config-provider/__tests__/__snapshots__/components.test.js.snap +++ b/components/config-provider/__tests__/__snapshots__/components.test.js.snap @@ -11420,48 +11420,56 @@ exports[`ConfigProvider components Table configProvider 1`] = `
- Name -
- + +
- - - - + + - - - -
+ + +
+
- Name -
- + +
- - - - + + - - - -
+ +
+
+ - Name -
- + +
- - - - + + - - - -
+ +
+
+
- Name + + Name + +
- Age + + Age + +
diff --git a/components/locale-provider/__tests__/__snapshots__/demo.test.js.snap b/components/locale-provider/__tests__/__snapshots__/demo.test.js.snap index a1c5de08ae..28b3f50426 100644 --- a/components/locale-provider/__tests__/__snapshots__/demo.test.js.snap +++ b/components/locale-provider/__tests__/__snapshots__/demo.test.js.snap @@ -1757,7 +1757,14 @@ exports[`renders ./components/locale-provider/demo/all.md correctly 1`] = ` class="ant-table-column-has-actions ant-table-column-has-filters" >
- Name + + Name + +
- Age + + Age + +
diff --git a/components/locale-provider/__tests__/__snapshots__/index.test.js.snap b/components/locale-provider/__tests__/__snapshots__/index.test.js.snap index d1415fbe06..ab12e03a6e 100644 --- a/components/locale-provider/__tests__/__snapshots__/index.test.js.snap +++ b/components/locale-provider/__tests__/__snapshots__/index.test.js.snap @@ -7391,7 +7391,14 @@ exports[`Locale Provider should display the text as ar 1`] = ` class="ant-table-column-has-actions ant-table-column-has-filters" >
- Name + + Name + +
- Age + + Age + +
@@ -12458,7 +12472,14 @@ exports[`Locale Provider should display the text as bg 1`] = ` class="ant-table-column-has-actions ant-table-column-has-filters" >
- Name + + Name + +
- Age + + Age + +
@@ -17525,7 +17553,14 @@ exports[`Locale Provider should display the text as ca 1`] = ` class="ant-table-column-has-actions ant-table-column-has-filters" >
- Name + + Name + +
- Age + + Age + +
@@ -22592,7 +22634,14 @@ exports[`Locale Provider should display the text as cs 1`] = ` class="ant-table-column-has-actions ant-table-column-has-filters" >
- Name + + Name + +
- Age + + Age + +
@@ -27659,7 +27715,14 @@ exports[`Locale Provider should display the text as da 1`] = ` class="ant-table-column-has-actions ant-table-column-has-filters" >
- Name + + Name + +
- Age + + Age + +
@@ -32726,7 +32796,14 @@ exports[`Locale Provider should display the text as de 1`] = ` class="ant-table-column-has-actions ant-table-column-has-filters" >
- Name + + Name + +
- Age + + Age + +
@@ -37793,7 +37877,14 @@ exports[`Locale Provider should display the text as el 1`] = ` class="ant-table-column-has-actions ant-table-column-has-filters" >
- Name + + Name + +
- Age + + Age + +
@@ -42860,7 +42958,14 @@ exports[`Locale Provider should display the text as en 1`] = ` class="ant-table-column-has-actions ant-table-column-has-filters" >
- Name + + Name + +
- Age + + Age + +
@@ -47927,7 +48039,14 @@ exports[`Locale Provider should display the text as en-gb 1`] = ` class="ant-table-column-has-actions ant-table-column-has-filters" >
- Name + + Name + +
- Age + + Age + +
@@ -52994,7 +53120,14 @@ exports[`Locale Provider should display the text as es 1`] = ` class="ant-table-column-has-actions ant-table-column-has-filters" >
- Name + + Name + +
- Age + + Age + +
@@ -58061,7 +58201,14 @@ exports[`Locale Provider should display the text as et 1`] = ` class="ant-table-column-has-actions ant-table-column-has-filters" >
- Name + + Name + +
- Age + + Age + +
@@ -63128,7 +63282,14 @@ exports[`Locale Provider should display the text as fa 1`] = ` class="ant-table-column-has-actions ant-table-column-has-filters" >
- Name + + Name + +
- Age + + Age + +
@@ -68195,7 +68363,14 @@ exports[`Locale Provider should display the text as fi 1`] = ` class="ant-table-column-has-actions ant-table-column-has-filters" >
- Name + + Name + +
- Age + + Age + +
@@ -73262,7 +73444,14 @@ exports[`Locale Provider should display the text as fr 1`] = ` class="ant-table-column-has-actions ant-table-column-has-filters" >
- Name + + Name + +
- Age + + Age + +
@@ -78329,7 +78525,14 @@ exports[`Locale Provider should display the text as fr 2`] = ` class="ant-table-column-has-actions ant-table-column-has-filters" >
- Name + + Name + +
- Age + + Age + +
@@ -83396,7 +83606,14 @@ exports[`Locale Provider should display the text as he 1`] = ` class="ant-table-column-has-actions ant-table-column-has-filters" >
- Name + + Name + +
- Age + + Age + +
@@ -88463,7 +88687,14 @@ exports[`Locale Provider should display the text as hi 1`] = ` class="ant-table-column-has-actions ant-table-column-has-filters" >
- Name + + Name + +
- Age + + Age + +
@@ -93530,7 +93768,14 @@ exports[`Locale Provider should display the text as hu 1`] = ` class="ant-table-column-has-actions ant-table-column-has-filters" >
- Name + + Name + +
- Age + + Age + +
@@ -98597,7 +98849,14 @@ exports[`Locale Provider should display the text as id 1`] = ` class="ant-table-column-has-actions ant-table-column-has-filters" >
- Name + + Name + +
- Age + + Age + +
@@ -103664,7 +103930,14 @@ exports[`Locale Provider should display the text as is 1`] = ` class="ant-table-column-has-actions ant-table-column-has-filters" >
- Name + + Name + +
- Age + + Age + +
@@ -108731,7 +109011,14 @@ exports[`Locale Provider should display the text as it 1`] = ` class="ant-table-column-has-actions ant-table-column-has-filters" >
- Name + + Name + +
- Age + + Age + +
@@ -113798,7 +114092,14 @@ exports[`Locale Provider should display the text as ja 1`] = ` class="ant-table-column-has-actions ant-table-column-has-filters" >
- Name + + Name + +
- Age + + Age + +
@@ -118865,7 +119173,14 @@ exports[`Locale Provider should display the text as kn 1`] = ` class="ant-table-column-has-actions ant-table-column-has-filters" >
- Name + + Name + +
- Age + + Age + +
@@ -123932,7 +124254,14 @@ exports[`Locale Provider should display the text as ko 1`] = ` class="ant-table-column-has-actions ant-table-column-has-filters" >
- Name + + Name + +
- Age + + Age + +
@@ -128999,7 +129335,14 @@ exports[`Locale Provider should display the text as ku-iq 1`] = ` class="ant-table-column-has-actions ant-table-column-has-filters" >
- Name + + Name + +
- Age + + Age + +
@@ -134066,7 +134416,14 @@ exports[`Locale Provider should display the text as mn-mn 1`] = ` class="ant-table-column-has-actions ant-table-column-has-filters" >
- Name + + Name + +
- Age + + Age + +
@@ -139133,7 +139497,14 @@ exports[`Locale Provider should display the text as nb 1`] = ` class="ant-table-column-has-actions ant-table-column-has-filters" >
- Name + + Name + +
- Age + + Age + +
@@ -144200,7 +144578,14 @@ exports[`Locale Provider should display the text as ne-np 1`] = ` class="ant-table-column-has-actions ant-table-column-has-filters" >
- Name + + Name + +
- Age + + Age + +
@@ -149267,7 +149659,14 @@ exports[`Locale Provider should display the text as nl 1`] = ` class="ant-table-column-has-actions ant-table-column-has-filters" >
- Name + + Name + +
- Age + + Age + +
@@ -154334,7 +154740,14 @@ exports[`Locale Provider should display the text as nl-be 1`] = ` class="ant-table-column-has-actions ant-table-column-has-filters" >
- Name + + Name + +
- Age + + Age + +
@@ -159401,7 +159821,14 @@ exports[`Locale Provider should display the text as pl 1`] = ` class="ant-table-column-has-actions ant-table-column-has-filters" >
- Name + + Name + +
- Age + + Age + +
@@ -164468,7 +164902,14 @@ exports[`Locale Provider should display the text as pt 1`] = ` class="ant-table-column-has-actions ant-table-column-has-filters" >
- Name + + Name + +
- Age + + Age + +
@@ -169535,7 +169983,14 @@ exports[`Locale Provider should display the text as pt-br 1`] = ` class="ant-table-column-has-actions ant-table-column-has-filters" >
- Name + + Name + +
- Age + + Age + +
@@ -174602,7 +175064,14 @@ exports[`Locale Provider should display the text as ru 1`] = ` class="ant-table-column-has-actions ant-table-column-has-filters" >
- Name + + Name + +
- Age + + Age + +
@@ -179669,7 +180145,14 @@ exports[`Locale Provider should display the text as sk 1`] = ` class="ant-table-column-has-actions ant-table-column-has-filters" >
- Name + + Name + +
- Age + + Age + +
@@ -184736,7 +185226,14 @@ exports[`Locale Provider should display the text as sl 1`] = ` class="ant-table-column-has-actions ant-table-column-has-filters" >
- Name + + Name + +
- Age + + Age + +
@@ -189803,7 +190307,14 @@ exports[`Locale Provider should display the text as sr 1`] = ` class="ant-table-column-has-actions ant-table-column-has-filters" >
- Name + + Name + +
- Age + + Age + +
@@ -194870,7 +195388,14 @@ exports[`Locale Provider should display the text as sv 1`] = ` class="ant-table-column-has-actions ant-table-column-has-filters" >
- Name + + Name + +
- Age + + Age + +
@@ -199937,7 +200469,14 @@ exports[`Locale Provider should display the text as th 1`] = ` class="ant-table-column-has-actions ant-table-column-has-filters" >
- Name + + Name + +
- Age + + Age + +
@@ -205004,7 +205550,14 @@ exports[`Locale Provider should display the text as tr 1`] = ` class="ant-table-column-has-actions ant-table-column-has-filters" >
- Name + + Name + +
- Age + + Age + +
@@ -210071,7 +210631,14 @@ exports[`Locale Provider should display the text as uk 1`] = ` class="ant-table-column-has-actions ant-table-column-has-filters" >
- Name + + Name + +
- Age + + Age + +
@@ -215138,7 +215712,14 @@ exports[`Locale Provider should display the text as vi 1`] = ` class="ant-table-column-has-actions ant-table-column-has-filters" >
- Name + + Name + +
- Age + + Age + +
@@ -220205,7 +220793,14 @@ exports[`Locale Provider should display the text as zh-cn 1`] = ` class="ant-table-column-has-actions ant-table-column-has-filters" >
- Name + + Name + +
- Age + + Age + +
@@ -225272,7 +225874,14 @@ exports[`Locale Provider should display the text as zh-tw 1`] = ` class="ant-table-column-has-actions ant-table-column-has-filters" >
- Name + + Name + +
- Age + + Age + +
diff --git a/components/table/Table.tsx b/components/table/Table.tsx index 11d62e9845..f5ed8f3d19 100755 --- a/components/table/Table.tsx +++ b/components/table/Table.tsx @@ -884,7 +884,14 @@ export default class Table extends React.Component, TableState< ); sortButton = ( -
+
{ascend} {descend}
@@ -919,8 +926,10 @@ export default class Table extends React.Component, TableState< }), title: [
- {this.renderColumnTitle(column.title)} - {sortButton} + + {this.renderColumnTitle(column.title)} + + {sortButton}
, filterDropdown, ], diff --git a/components/table/__tests__/__snapshots__/Table.filter.test.js.snap b/components/table/__tests__/__snapshots__/Table.filter.test.js.snap index 9f1632f780..4e87f6d5f2 100644 --- a/components/table/__tests__/__snapshots__/Table.filter.test.js.snap +++ b/components/table/__tests__/__snapshots__/Table.filter.test.js.snap @@ -97,7 +97,14 @@ exports[`Table.filter renders filter correctly 1`] = ` class="ant-table-column-has-actions ant-table-column-has-filters" >
- Name + + Name + +
- Name + + Name + +
@@ -210,7 +217,14 @@ exports[`Table.pagination renders pagination correctly 1`] = ` class="" >
- Name + + Name + +
diff --git a/components/table/__tests__/__snapshots__/Table.rowSelection.test.js.snap b/components/table/__tests__/__snapshots__/Table.rowSelection.test.js.snap index b3a5fe8e1a..2aab8ebcc3 100644 --- a/components/table/__tests__/__snapshots__/Table.rowSelection.test.js.snap +++ b/components/table/__tests__/__snapshots__/Table.rowSelection.test.js.snap @@ -39,32 +39,46 @@ exports[`Table.rowSelection fix selection column on the left 1`] = ` class="ant-table-fixed-columns-in-body ant-table-selection-column" >
-
- -
+ class="ant-checkbox" + > + + + + +
+ +
- Name + + Name + +
@@ -242,25 +256,32 @@ exports[`Table.rowSelection fix selection column on the left 1`] = ` class="ant-table-selection-column" >
-
- -
+ class="ant-checkbox" + > + + + + +
+ + diff --git a/components/table/__tests__/__snapshots__/Table.sorter.test.js.snap b/components/table/__tests__/__snapshots__/Table.sorter.test.js.snap index c984b7fcf2..6e065bb600 100644 --- a/components/table/__tests__/__snapshots__/Table.sorter.test.js.snap +++ b/components/table/__tests__/__snapshots__/Table.sorter.test.js.snap @@ -11,48 +11,56 @@ exports[`Table.sorter renders sorter icon correctly 1`] = `
- Name -
- + +
- - - - + + - - - -
+ +
+
+
diff --git a/components/table/__tests__/__snapshots__/Table.test.js.snap b/components/table/__tests__/__snapshots__/Table.test.js.snap index 9571f57a29..164c4e16ee 100644 --- a/components/table/__tests__/__snapshots__/Table.test.js.snap +++ b/components/table/__tests__/__snapshots__/Table.test.js.snap @@ -36,7 +36,14 @@ exports[`Table renders JSX correctly 1`] = ` colspan="2" >
- Name + + Name + +
- Age + + Age + +
@@ -53,14 +67,28 @@ exports[`Table renders JSX correctly 1`] = ` class="" >
- First Name + + First Name + +
- Last Name + + Last Name + +
diff --git a/components/table/__tests__/__snapshots__/demo.test.js.snap b/components/table/__tests__/__snapshots__/demo.test.js.snap index d2dc5daf12..ebfdada48b 100755 --- a/components/table/__tests__/__snapshots__/demo.test.js.snap +++ b/components/table/__tests__/__snapshots__/demo.test.js.snap @@ -41,55 +41,70 @@ exports[`renders ./components/table/demo/ajax.md correctly 1`] = `
- Name -
- + +
- - - - + + - - - -
+ +
+
+
- Gender + + Gender + +
- Email + + Email + +
@@ -191,35 +213,70 @@ exports[`renders ./components/table/demo/basic.md correctly 1`] = ` class="" >
- Name + + Name + +
- Age + + Age + +
- Address + + Address + +
- Tags + + Tags + +
- Action + + Action + +
@@ -531,21 +588,42 @@ exports[`renders ./components/table/demo/bordered.md correctly 1`] = ` class="" >
- Name + + Name + +
- Cash Assets + + Cash Assets + +
- Address + + Address + +
@@ -759,14 +837,28 @@ exports[`renders ./components/table/demo/colspan-rowspan.md correctly 1`] = ` class="" >
- Name + + Name + +
- Age + + Age + +
- Home phone + + Home phone + +
- Address + + Address + +
@@ -1075,7 +1181,14 @@ exports[`renders ./components/table/demo/custom-filter-panel.md correctly 1`] = class="ant-table-column-has-actions ant-table-column-has-filters" >
- Name + + Name + +
- Age + + Age + +
- Address + + Address + +
- Name + + Name + +
- Age + + Age + +
- Address + + Address + +
@@ -2206,53 +2354,88 @@ exports[`renders ./components/table/demo/dynamic-settings.md correctly 1`] = ` class="ant-table-selection-column" >
-
- -
+ class="ant-checkbox" + > + + + + +
+ +
- Name + + Name + +
- Age + + Age + +
- Address + + Address + +
- Action + + Action + +
@@ -3374,28 +3557,56 @@ exports[`renders ./components/table/demo/edit-cell.md correctly 1`] = ` class="" >
- name + + name + +
- age + + age + +
- address + + address + +
- operation + + operation + +
@@ -3602,28 +3813,56 @@ exports[`renders ./components/table/demo/edit-row.md correctly 1`] = ` class="" >
- name + + name + +
- age + + age + +
- address + + address + +
- operation + + operation + +
@@ -4168,28 +4407,56 @@ exports[`renders ./components/table/demo/expand.md correctly 1`] = ` class="" >
- Name + + Name + +
- Age + + Age + +
- Address + + Address + +
- Action + + Action + +
@@ -4427,46 +4694,74 @@ exports[`renders ./components/table/demo/expand-children.md correctly 1`] = ` class="ant-table-selection-column" >
-
- -
+ class="ant-checkbox" + > + + + + +
+
+
- Name + + Name + +
- Age + + Age + +
- Address + + Address + +
@@ -4704,77 +4999,154 @@ exports[`renders ./components/table/demo/fixed-columns.md correctly 1`] = ` class="ant-table-fixed-columns-in-body" >
- Full Name + + Full Name + +
- Age + + Age + +
- Column 1 + + Column 1 + +
- Column 2 + + Column 2 + +
- Column 3 + + Column 3 + +
- Column 4 + + Column 4 + +
- Column 5 + + Column 5 + +
- Column 6 + + Column 6 + +
- Column 7 + + Column 7 + +
- Column 8 + + Column 8 + +
- Action + + Action + +
@@ -4951,14 +5323,28 @@ exports[`renders ./components/table/demo/fixed-columns.md correctly 1`] = ` class="" >
- Full Name + + Full Name + +
- Age + + Age + +
@@ -5035,7 +5421,14 @@ exports[`renders ./components/table/demo/fixed-columns.md correctly 1`] = ` class="" >
- Action + + Action + +
@@ -5220,77 +5613,154 @@ exports[`renders ./components/table/demo/fixed-columns-header.md correctly 1`] = class="ant-table-fixed-columns-in-body" >
- Full Name + + Full Name + +
- Age + + Age + +
- Column 1 + + Column 1 + +
- Column 2 + + Column 2 + +
- Column 3 + + Column 3 + +
- Column 4 + + Column 4 + +
- Column 5 + + Column 5 + +
- Column 6 + + Column 6 + +
- Column 7 + + Column 7 + +
- Column 8 + + Column 8 + +
- Action + + Action + +
@@ -6050,14 +6520,28 @@ exports[`renders ./components/table/demo/fixed-columns-header.md correctly 1`] = class="" >
- Full Name + + Full Name + +
- Age + + Age + +
@@ -6303,7 +6787,14 @@ exports[`renders ./components/table/demo/fixed-columns-header.md correctly 1`] = class="" >
- Action + + Action + +
@@ -6676,21 +7167,42 @@ exports[`renders ./components/table/demo/fixed-header.md correctly 1`] = ` class="" >
- Name + + Name + +
- Age + + Age + +
- Address + + Address + +
@@ -8064,7 +8576,14 @@ exports[`renders ./components/table/demo/grouping-columns.md correctly 1`] = ` rowspan="4" >
- Name + + Name + +
- Other + + Other + +
- Company + + Company + +
- Gender + + Gender + +
@@ -8120,48 +8660,56 @@ exports[`renders ./components/table/demo/grouping-columns.md correctly 1`] = `
- Age -
- + +
- - - - + + - - - -
+ +
+
+
- Address + + Address + +
- Company Address + + Company Address + +
- Company Name + + Company Name + +
@@ -8195,7 +8764,14 @@ exports[`renders ./components/table/demo/grouping-columns.md correctly 1`] = ` rowspan="2" >
- Street + + Street + +
- Block + + Block + +
@@ -8212,14 +8795,28 @@ exports[`renders ./components/table/demo/grouping-columns.md correctly 1`] = ` class="" >
- Building + + Building + +
- Door No. + + Door No. + +
@@ -8776,7 +9373,14 @@ exports[`renders ./components/table/demo/grouping-columns.md correctly 1`] = ` rowspan="4" >
- Name + + Name + +
- Gender + + Gender + +
@@ -9318,30 +9929,38 @@ exports[`renders ./components/table/demo/head.md correctly 1`] = `
- Name -
- + +
- - -
+ +
+
+
- Age -
- + +
- - - - + + - - - -
+ +
+
+
- Address -
- + +
- - - - + + - - - -
+ +
+
+
- Name + + Name + +
- Age + + Age + +
- Address + + Address + +
- Tags + + Tags + +
- Action + + Action + +
@@ -9745,14 +10415,28 @@ exports[`renders ./components/table/demo/jsx.md correctly 1`] = ` class="" >
- First Name + + First Name + +
- Last Name + + Last Name + +
@@ -10074,49 +10758,98 @@ exports[`renders ./components/table/demo/nested-table.md correctly 1`] = ` class="" >
- Name + + Name + +
- Platform + + Platform + +
- Version + + Version + +
- Upgraded + + Upgraded + +
- Creator + + Creator + +
- Date + + Date + +
- Action + + Action + +
@@ -10423,48 +11156,56 @@ exports[`renders ./components/table/demo/reset-filter.md correctly 1`] = `
- Name -
- + +
- - - - + + - - - -
+ +
+
+
- Age -
- + +
- - - - + + - - - -
+ +
+
+ - Address -
- + +
- - - - + + - - - -
+ +
+
+
- Date + + Date + +
- Amount + + Amount + +
- Type + + Type + +
- Note + + Note + +
- Action + + Action + +
@@ -11118,46 +11910,74 @@ exports[`renders ./components/table/demo/row-selection.md correctly 1`] = ` class="ant-table-selection-column" >
-
- -
+ class="ant-checkbox" + > + + + + +
+
+
- Name + + Name + +
- Age + + Age + +
- Address + + Address + +
@@ -11501,46 +12321,74 @@ exports[`renders ./components/table/demo/row-selection-and-operation.md correctl class="ant-table-selection-column" >
-
- -
+ class="ant-checkbox" + > + + + + +
+
+
- Name + + Name + +
- Age + + Age + +
- Address + + Address + +
@@ -12154,68 +13002,96 @@ exports[`renders ./components/table/demo/row-selection-custom.md correctly 1`] = class="ant-table-selection-column ant-table-selection-column-custom" >
-
-
- - - + + + +
+ + + +
-
+ +
- Name + + Name + +
- Age + + Age + +
- Address + + Address + +
@@ -12829,21 +13705,42 @@ exports[`renders ./components/table/demo/size.md correctly 1`] = ` class="" >
- Name + + Name + +
- Age + + Age + +
- Address + + Address + +
@@ -13038,21 +13935,42 @@ exports[`renders ./components/table/demo/size.md correctly 1`] = ` class="" >
- Name + + Name + +
- Age + + Age + +
- Address + + Address + +
diff --git a/components/table/__tests__/__snapshots__/empty.test.js.snap b/components/table/__tests__/__snapshots__/empty.test.js.snap index 743d9ea0f1..c503331294 100644 --- a/components/table/__tests__/__snapshots__/empty.test.js.snap +++ b/components/table/__tests__/__snapshots__/empty.test.js.snap @@ -40,56 +40,112 @@ exports[`Table renders empty table 1`] = ` class="" >
- Column 1 + + Column 1 + +
- Column 2 + + Column 2 + +
- Column 3 + + Column 3 + +
- Column 4 + + Column 4 + +
- Column 5 + + Column 5 + +
- Column 6 + + Column 6 + +
- Column 7 + + Column 7 + +
- Column 8 + + Column 8 + +
@@ -167,56 +223,112 @@ exports[`Table renders empty table with custom emptyText 1`] = ` class="" >
- Column 1 + + Column 1 + +
- Column 2 + + Column 2 + +
- Column 3 + + Column 3 + +
- Column 4 + + Column 4 + +
- Column 5 + + Column 5 + +
- Column 6 + + Column 6 + +
- Column 7 + + Column 7 + +
- Column 8 + + Column 8 + +
@@ -290,77 +402,154 @@ exports[`Table renders empty table with fixed columns 1`] = ` class="ant-table-fixed-columns-in-body" >
- Full Name + + Full Name + +
- Age + + Age + +
- Column 1 + + Column 1 + +
- Column 2 + + Column 2 + +
- Column 3 + + Column 3 + +
- Column 4 + + Column 4 + +
- Column 5 + + Column 5 + +
- Column 6 + + Column 6 + +
- Column 7 + + Column 7 + +
- Column 8 + + Column 8 + +
- Action + + Action + +
@@ -421,14 +610,28 @@ exports[`Table renders empty table with fixed columns 1`] = ` class="" >
- Full Name + + Full Name + +
- Age + + Age + +
@@ -466,7 +669,14 @@ exports[`Table renders empty table with fixed columns 1`] = ` class="" >
- Action + + Action + +
@@ -547,56 +757,112 @@ exports[`Table renders empty table without emptyText when loading 1`] = ` class="" >
- Column 1 + + Column 1 + +
- Column 2 + + Column 2 + +
- Column 3 + + Column 3 + +
- Column 4 + + Column 4 + +
- Column 5 + + Column 5 + +
- Column 6 + + Column 6 + +
- Column 7 + + Column 7 + +
- Column 8 + + Column 8 + +
diff --git a/components/table/style/index.less b/components/table/style/index.less index 3bb44cf259..ddcb9f4278 100644 --- a/components/table/style/index.less +++ b/components/table/style/index.less @@ -69,30 +69,43 @@ } .@{table-prefix-cls}-column-sorter { - position: absolute; - top: 50%; - right: 6px; - width: 14px; - height: @font-size-lg + 1px; - margin-top: -(@font-size-lg + 1px) / 2; - color: @table-header-icon-color; - text-align: center; - transition: all 0.3s; + display: table-cell; + vertical-align: middle; - &-up, - &-down { - .iconfont-size-under-12px(11px); - display: block; - height: 4px; - line-height: 4px; + .@{table-prefix-cls}-column-sorter-inner { + height: 1em; + margin-top: 0.35em; + margin-left: 0.57142857em; + color: @table-header-icon-color; + line-height: 1em; + text-align: center; transition: all 0.3s; - &.on { - color: @primary-color; - } - } - &-down { - margin-top: 4px; + .@{table-prefix-cls}-column-sorter-up, + .@{table-prefix-cls}-column-sorter-down { + .iconfont-size-under-12px(11px); + display: block; + height: 1em; + line-height: 1em; + transition: all 0.3s; + &.on { + color: @primary-color; + } + } + + &-full { + margin-top: -0.15em; + + .@{table-prefix-cls}-column-sorter-up, + .@{table-prefix-cls}-column-sorter-down { + height: 0.5em; + line-height: 0.5em; + } + + .@{table-prefix-cls}-column-sorter-down { + margin-top: 0.125em; + } + } } } @@ -110,7 +123,7 @@ background: @table-header-filter-active-bg; } } - // Very complicated styles logic but neccessary + // Very complicated styles logic but necessary &:hover { .@{iconfont-css-prefix}-filter, .@{table-prefix-cls}-filter-icon { @@ -154,6 +167,13 @@ } .@{table-prefix-cls}-column-sorters { + display: table; + + > .@{table-prefix-cls}-column-title { + display: table-cell; + vertical-align: middle; + } + > *:not(.@{table-prefix-cls}-column-sorter) { position: relative; } @@ -172,10 +192,6 @@ } } - &.@{table-prefix-cls}-column-has-filters .@{table-prefix-cls}-column-sorter { - right: 28px + 6px; - } - &.@{table-prefix-cls}-column-has-sorters { user-select: none; }