From 687e65d04b0d51460401c67a07de995f6bfdb191 Mon Sep 17 00:00:00 2001 From: wangxueliang Date: Sun, 29 Mar 2020 23:54:24 +0800 Subject: [PATCH] feat: update table icon --- components/table/SelectionCheckboxAll.jsx | 4 +- components/table/Table.jsx | 10 +- .../__snapshots__/Table.filter.test.js.snap | 4 +- .../Table.pagination.test.js.snap | 10 +- .../Table.rowSelection.test.js.snap | 10 +- .../__snapshots__/Table.sorter.test.js.snap | 2 +- .../__snapshots__/Table.test.js.snap | 10 +- .../__tests__/__snapshots__/demo.test.js.snap | 488 ++++++++---------- components/table/filterDropdown.jsx | 6 +- 9 files changed, 233 insertions(+), 311 deletions(-) diff --git a/components/table/SelectionCheckboxAll.jsx b/components/table/SelectionCheckboxAll.jsx index dbe4db0f0..7a8dd2074 100644 --- a/components/table/SelectionCheckboxAll.jsx +++ b/components/table/SelectionCheckboxAll.jsx @@ -1,7 +1,7 @@ +import DownOutlined from '@ant-design/icons-vue/DownOutlined'; import Checkbox from '../checkbox'; import Dropdown from '../dropdown'; import Menu from '../menu'; -import Icon from '../icon'; import classNames from 'classnames'; import { SelectionCheckboxAllProps } from './interface'; import BaseMixin from '../_util/BaseMixin'; @@ -210,7 +210,7 @@ export default {
- +
) : null; diff --git a/components/table/Table.jsx b/components/table/Table.jsx index 4fa86790d..3e7a54254 100755 --- a/components/table/Table.jsx +++ b/components/table/Table.jsx @@ -1,3 +1,5 @@ +import CaretUpFilled from '@ant-design/icons-vue/CaretUpFilled'; +import CaretDownFilled from '@ant-design/icons-vue/CaretDownFilled'; import VcTable, { INTERNAL_COL_DEFINE } from '../vc-table'; import classNames from 'classnames'; import shallowEqual from 'shallowequal'; @@ -1070,19 +1072,15 @@ export default { const isAscend = isSortColumn && sortOrder === 'ascend'; const isDescend = isSortColumn && sortOrder === 'descend'; const ascend = sortDirections.indexOf('ascend') !== -1 && ( - ); const descend = sortDirections.indexOf('descend') !== -1 && ( - ); diff --git a/components/table/__tests__/__snapshots__/Table.filter.test.js.snap b/components/table/__tests__/__snapshots__/Table.filter.test.js.snap index 5eca072e5..f029104dd 100644 --- a/components/table/__tests__/__snapshots__/Table.filter.test.js.snap +++ b/components/table/__tests__/__snapshots__/Table.filter.test.js.snap @@ -25,9 +25,7 @@ exports[`Table.filter renders filter correctly 1`] = `
Name -
+ diff --git a/components/table/__tests__/__snapshots__/Table.pagination.test.js.snap b/components/table/__tests__/__snapshots__/Table.pagination.test.js.snap index 220a1bb7e..3557b5d73 100644 --- a/components/table/__tests__/__snapshots__/Table.pagination.test.js.snap +++ b/components/table/__tests__/__snapshots__/Table.pagination.test.js.snap @@ -31,14 +31,12 @@ exports[`Table.pagination renders pagination correctly 1`] = ` diff --git a/components/table/__tests__/__snapshots__/Table.rowSelection.test.js.snap b/components/table/__tests__/__snapshots__/Table.rowSelection.test.js.snap index e639893a0..a1021c7fb 100644 --- a/components/table/__tests__/__snapshots__/Table.rowSelection.test.js.snap +++ b/components/table/__tests__/__snapshots__/Table.rowSelection.test.js.snap @@ -80,13 +80,11 @@ exports[`Table.rowSelection fix selection column on the left 1`] = ` diff --git a/components/table/__tests__/__snapshots__/Table.sorter.test.js.snap b/components/table/__tests__/__snapshots__/Table.sorter.test.js.snap index b09dc3d5a..3c98b5bb4 100644 --- a/components/table/__tests__/__snapshots__/Table.sorter.test.js.snap +++ b/components/table/__tests__/__snapshots__/Table.sorter.test.js.snap @@ -3,7 +3,7 @@ exports[`Table.sorter renders sorter icon correctly 1`] = ` -
Name
+
Name
`; diff --git a/components/table/__tests__/__snapshots__/Table.test.js.snap b/components/table/__tests__/__snapshots__/Table.test.js.snap index bb610c839..1354c4dc0 100644 --- a/components/table/__tests__/__snapshots__/Table.test.js.snap +++ b/components/table/__tests__/__snapshots__/Table.test.js.snap @@ -36,13 +36,11 @@ exports[`Table align column should not override cell style 1`] = ` diff --git a/components/table/__tests__/__snapshots__/demo.test.js.snap b/components/table/__tests__/__snapshots__/demo.test.js.snap index 03ac30ff9..750081437 100644 --- a/components/table/__tests__/__snapshots__/demo.test.js.snap +++ b/components/table/__tests__/__snapshots__/demo.test.js.snap @@ -16,38 +16,37 @@ exports[`renders ./antdv-demo/docs/table/demo/ajax.md correctly 1`] = ` -
Name
-
-
Gender -
-
Email -
- - - - - -
-
-
- - - - - - +
Name
+
+
+
Gender +
+
Email +
+ + + + +
+
+
+
+ + + + + -
-

No Data

-
+ +
+

No Data

+ `; exports[`renders ./antdv-demo/docs/table/demo/basic.md correctly 1`] = ` @@ -68,7 +67,7 @@ exports[`renders ./antdv-demo/docs/table/demo/basic.md correctly 1`] = ` -
Name +
Name
Age
@@ -90,7 +89,7 @@ exports[`renders ./antdv-demo/docs/table/demo/basic.md correctly 1`] = ` DEVELOPER - Invite 一 John Brown Delete More actions + Invite 一 John Brown Delete More actions Jim Green @@ -99,7 +98,7 @@ exports[`renders ./antdv-demo/docs/table/demo/basic.md correctly 1`] = ` LOSER - Invite 一 Jim Green Delete More actions + Invite 一 Jim Green Delete More actions Joe Black @@ -110,7 +109,7 @@ exports[`renders ./antdv-demo/docs/table/demo/basic.md correctly 1`] = ` TEACHER - Invite 一 Joe Black Delete More actions + Invite 一 Joe Black Delete More actions @@ -118,13 +117,11 @@ exports[`renders ./antdv-demo/docs/table/demo/basic.md correctly 1`] = `
@@ -184,13 +181,11 @@ exports[`renders ./antdv-demo/docs/table/demo/bordered.md correctly 1`] = ` @@ -268,13 +263,11 @@ exports[`renders ./antdv-demo/docs/table/demo/colspan-rowspan.md correctly 1`] = @@ -299,17 +292,11 @@ exports[`renders ./antdv-demo/docs/table/demo/custom-filter-panel.md correctly 1
Name -
+
Age -
+
Address -
+ @@ -339,13 +326,11 @@ exports[`renders ./antdv-demo/docs/table/demo/custom-filter-panel.md correctly 1 @@ -387,9 +372,7 @@ exports[`renders ./antdv-demo/docs/table/demo/edit-cell.md correctly 1`] = `
Edward King 0 -
+
32 @@ -401,9 +384,7 @@ exports[`renders ./antdv-demo/docs/table/demo/edit-cell.md correctly 1`] = `
Edward King 1 -
+
32 @@ -416,13 +397,11 @@ exports[`renders ./antdv-demo/docs/table/demo/edit-cell.md correctly 1`] = ` @@ -605,23 +584,20 @@ exports[`renders ./antdv-demo/docs/table/demo/edit-row.md correctly 1`] = ` @@ -693,13 +669,11 @@ exports[`renders ./antdv-demo/docs/table/demo/ellipsis.md correctly 1`] = ` @@ -773,13 +747,11 @@ exports[`renders ./antdv-demo/docs/table/demo/expand.md correctly 1`] = ` @@ -842,13 +814,11 @@ exports[`renders ./antdv-demo/docs/table/demo/expand-children.md correctly 1`] = @@ -992,13 +962,11 @@ exports[`renders ./antdv-demo/docs/table/demo/fixed-columns.md correctly 1`] = ` @@ -1331,23 +1299,20 @@ exports[`renders ./antdv-demo/docs/table/demo/fixed-columns-header.md correctly @@ -1646,14 +1611,12 @@ exports[`renders ./antdv-demo/docs/table/demo/fixed-header.md correctly 1`] = ` @@ -1683,9 +1646,7 @@ exports[`renders ./antdv-demo/docs/table/demo/grouping-columns.md correctly 1`]
Name -
+
Other
Company @@ -1694,12 +1655,12 @@ exports[`renders ./antdv-demo/docs/table/demo/grouping-columns.md correctly 1`]
-
Age
-
-
Address +
Age
+
-
Company Address +
Address
+
Company Address
Company Name
@@ -1839,9 +1800,7 @@ exports[`renders ./antdv-demo/docs/table/demo/grouping-columns.md correctly 1`]
Name -
+
@@ -1947,23 +1906,20 @@ exports[`renders ./antdv-demo/docs/table/demo/grouping-columns.md correctly 1`]
@@ -1987,52 +1943,49 @@ exports[`renders ./antdv-demo/docs/table/demo/head.md correctly 1`] = ` -
Name
-
-
Age
-
-
Address
-
- - - - - Jim Green - 42 - London No. 1 Lake Park - - - John Brown - 32 - New York No. 1 Lake Park - - - Joe Black - 32 - Sidney No. 1 Lake Park - - - Jim Red - 32 - London No. 2 Lake Park - - - - - +
Name
+
+
+
Age
+
+
+
Address
+
+
+ + + + + Jim Green + 42 + London No. 1 Lake Park + + + John Brown + 32 + New York No. 1 Lake Park + + + Joe Black + 32 + Sidney No. 1 Lake Park + + + Jim Red + 32 + London No. 2 Lake Park + + + + + @@ -2123,13 +2076,11 @@ exports[`renders ./antdv-demo/docs/table/demo/nested-table.md correctly 1`] = ` @@ -2155,54 +2106,51 @@ exports[`renders ./antdv-demo/docs/table/demo/reset-filter.md correctly 1`] = ` -
Name
-
-
Age
-
-
Address
-
- - - - - John Brown - 32 - New York No. 1 Lake Park - - - Jim Green - 42 - London No. 1 Lake Park - - - Joe Black - 32 - Sidney No. 1 Lake Park - - - Jim Red - 32 - London No. 2 Lake Park - - - - - - - +
Name
+
+
+
Age
+
+
+
Address
+
+
+ + + + + John Brown + 32 + New York No. 1 Lake Park + + + Jim Green + 42 + London No. 1 Lake Park + + + Joe Black + 32 + Sidney No. 1 Lake Park + + + Jim Red + 32 + London No. 2 Lake Park + + + + + + + @@ -2268,13 +2216,11 @@ exports[`renders ./antdv-demo/docs/table/demo/row-selection.md correctly 1`] = ` @@ -2379,17 +2325,15 @@ exports[`renders ./antdv-demo/docs/table/demo/row-selection-and-operation.md cor @@ -2416,9 +2360,7 @@ exports[`renders ./antdv-demo/docs/table/demo/row-selection-custom.md correctly
-
+
Name @@ -2496,17 +2438,15 @@ exports[`renders ./antdv-demo/docs/table/demo/row-selection-custom.md correctly
@@ -2562,13 +2502,11 @@ exports[`renders ./antdv-demo/docs/table/demo/size.md correctly 1`] = ` @@ -2620,13 +2558,11 @@ exports[`renders ./antdv-demo/docs/table/demo/size.md correctly 1`] = ` @@ -2702,13 +2638,11 @@ exports[`renders ./antdv-demo/docs/table/demo/template.md correctly 1`] = ` diff --git a/components/table/filterDropdown.jsx b/components/table/filterDropdown.jsx index d3454a9dc..d6d4921cb 100755 --- a/components/table/filterDropdown.jsx +++ b/components/table/filterDropdown.jsx @@ -1,9 +1,9 @@ +import FilterFilled from '@ant-design/icons-vue/FilterFilled'; import Menu, { SubMenu, Item as MenuItem } from '../vc-menu'; import closest from 'dom-closest'; import classNames from 'classnames'; import shallowequal from 'shallowequal'; import Dropdown from '../dropdown'; -import Icon from '../icon'; import Checkbox from '../checkbox'; import Radio from '../radio'; import FilterDropdownMenuWrapper from './FilterDropdownMenuWrapper'; @@ -221,10 +221,8 @@ export default { }); if (!filterIcon) { return ( -