In Progress
This is a description.
diff --git a/components/table/__tests__/__snapshots__/Table.filter.test.js.snap b/components/table/__tests__/__snapshots__/Table.filter.test.js.snap
index c11397bdb..470e79331 100644
--- a/components/table/__tests__/__snapshots__/Table.filter.test.js.snap
+++ b/components/table/__tests__/__snapshots__/Table.filter.test.js.snap
@@ -15,19 +15,19 @@ exports[`Table.filter renders filter correctly 1`] = `
-
+
Jack |
-
+
Lucy |
-
+
Tom |
-
+
Jerry |
diff --git a/components/table/__tests__/__snapshots__/Table.pagination.test.js.snap b/components/table/__tests__/__snapshots__/Table.pagination.test.js.snap
index dd38bd2ec..37a05d7e9 100644
--- a/components/table/__tests__/__snapshots__/Table.pagination.test.js.snap
+++ b/components/table/__tests__/__snapshots__/Table.pagination.test.js.snap
@@ -5,11 +5,11 @@ exports[`Table.pagination renders pagination correctly 1`] = `
-
+
Jack |
-
+
Lucy |
diff --git a/components/table/__tests__/__snapshots__/Table.rowSelection.test.js.snap b/components/table/__tests__/__snapshots__/Table.rowSelection.test.js.snap
index 328af729d..9c95ca0f8 100644
--- a/components/table/__tests__/__snapshots__/Table.rowSelection.test.js.snap
+++ b/components/table/__tests__/__snapshots__/Table.rowSelection.test.js.snap
@@ -6,22 +6,22 @@ exports[`Table.rowSelection fix selection column on the left 1`] = `
-
+
|
Jack |
-
+
|
Lucy |
-
+
|
Tom |
-
+
|
Jerry |
@@ -45,16 +45,16 @@ exports[`Table.rowSelection fix selection column on the left 1`] = `
-
+
|
-
+
|
-
+
|
-
+
|
diff --git a/components/table/__tests__/__snapshots__/Table.test.js.snap b/components/table/__tests__/__snapshots__/Table.test.js.snap
index c358775e6..9626aa172 100644
--- a/components/table/__tests__/__snapshots__/Table.test.js.snap
+++ b/components/table/__tests__/__snapshots__/Table.test.js.snap
@@ -10,13 +10,13 @@ exports[`Table renders JSX correctly 1`] = `
-
+
John |
Brown |
32 |
-
+
Jim |
Green |
diff --git a/components/table/__tests__/__snapshots__/demo.test.js.snap b/components/table/__tests__/__snapshots__/demo.test.js.snap
index 1db204cbc..66fce33cf 100644
--- a/components/table/__tests__/__snapshots__/demo.test.js.snap
+++ b/components/table/__tests__/__snapshots__/demo.test.js.snap
@@ -62,7 +62,7 @@ exports[`renders ./components/table/demo/basic.md correctly 1`] = `
-
+
John Brown |
32 |
@@ -71,7 +71,7 @@ exports[`renders ./components/table/demo/basic.md correctly 1`] = `
Invite 一 John Brown Delete
More actions |
-
+
Jim Green |
42 |
@@ -80,7 +80,7 @@ exports[`renders ./components/table/demo/basic.md correctly 1`] = `
Invite 一 Jim Green Delete
More actions |
-
+
Joe Black |
32 |
@@ -130,19 +130,19 @@ exports[`renders ./components/table/demo/bordered.md correctly 1`] = `
-
+
John Brown |
¥300,000.00 |
New York No. 1 Lake Park |
-
+
Jim Green |
¥1,256,000.00 |
London No. 1 Lake Park |
-
+
Joe Black |
¥120,000.00 |
@@ -192,7 +192,7 @@ exports[`renders ./components/table/demo/colspan-rowspan.md correctly 1`] = `
-
+
John Brown |
32 |
@@ -200,7 +200,7 @@ exports[`renders ./components/table/demo/colspan-rowspan.md correctly 1`] = `
18889898989 |
New York No. 1 Lake Park |
-
+
Jim Green |
42 |
@@ -208,7 +208,7 @@ exports[`renders ./components/table/demo/colspan-rowspan.md correctly 1`] = `
18889898888 |
London No. 1 Lake Park |
-
+
Joe Black |
32 |
@@ -216,7 +216,7 @@ exports[`renders ./components/table/demo/colspan-rowspan.md correctly 1`] = `
18900010002 |
Sidney No. 1 Lake Park |
-
+
Jim Red |
18 |
@@ -224,7 +224,7 @@ exports[`renders ./components/table/demo/colspan-rowspan.md correctly 1`] = `
18900010002 |
London No. 2 Lake Park |
-
+
Jake White |
@@ -270,25 +270,25 @@ exports[`renders ./components/table/demo/custom-filter-panel.md correctly 1`] =
-
+
John Brown |
32 |
New York No. 1 Lake Park |
-
+
Joe Black |
42 |
London No. 1 Lake Park |
-
+
Jim Green |
32 |
Sidney No. 1 Lake Park |
-
+
Jim Red |
32 |
@@ -335,7 +335,7 @@ exports[`renders ./components/table/demo/edit-cell.md correctly 1`] = `
-
+
@@ -348,7 +348,7 @@ exports[`renders ./components/table/demo/edit-cell.md correctly 1`] = `
London, Park Lane no. 0 |
Delete |
|
-
+
@@ -402,7 +402,7 @@ exports[`renders ./components/table/demo/edit-row.md correctly 1`] = `
|
-
+
Edrward 0
@@ -417,7 +417,7 @@ exports[`renders ./components/table/demo/edit-row.md correctly 1`] = `
|
-
+
Edrward 1
@@ -432,7 +432,7 @@ exports[`renders ./components/table/demo/edit-row.md correctly 1`] = `
|
-
+
Edrward 2
@@ -447,7 +447,7 @@ exports[`renders ./components/table/demo/edit-row.md correctly 1`] = `
|
-
+
Edrward 3
@@ -462,7 +462,7 @@ exports[`renders ./components/table/demo/edit-row.md correctly 1`] = `
|
-
+
Edrward 4
@@ -477,7 +477,7 @@ exports[`renders ./components/table/demo/edit-row.md correctly 1`] = `
|
-
+
Edrward 5
@@ -492,7 +492,7 @@ exports[`renders ./components/table/demo/edit-row.md correctly 1`] = `
|
-
+
Edrward 6
@@ -507,7 +507,7 @@ exports[`renders ./components/table/demo/edit-row.md correctly 1`] = `
|
-
+
Edrward 7
@@ -522,7 +522,7 @@ exports[`renders ./components/table/demo/edit-row.md correctly 1`] = `
|
-
+
Edrward 8
@@ -537,7 +537,7 @@ exports[`renders ./components/table/demo/edit-row.md correctly 1`] = `
|
-
+
Edrward 9
@@ -600,7 +600,7 @@ exports[`renders ./components/table/demo/expand.md correctly 1`] = `
|
-
+
|
John Brown |
32 |
@@ -608,7 +608,7 @@ exports[`renders ./components/table/demo/expand.md correctly 1`] = `
Delete |
-
+
|
Jim Green |
42 |
@@ -616,7 +616,7 @@ exports[`renders ./components/table/demo/expand.md correctly 1`] = `
Delete |
-
+
|
Joe Black |
32 |
@@ -665,7 +665,7 @@ exports[`renders ./components/table/demo/expand-children.md correctly 1`] = `
-
+
|
John Brown sr. |
60 |
@@ -678,7 +678,7 @@ exports[`renders ./components/table/demo/expand-children.md correctly 1`] = `
-
+
|
Joe Black |
32 |
@@ -739,7 +739,7 @@ exports[`renders ./components/table/demo/fixed-columns.md correctly 1`] = `
-
+
John Brown |
32 |
@@ -753,7 +753,7 @@ exports[`renders ./components/table/demo/fixed-columns.md correctly 1`] = `
New York Park |
action |
-
+
Jim Green |
40 |
@@ -787,12 +787,12 @@ exports[`renders ./components/table/demo/fixed-columns.md correctly 1`] = `
-
+
John Brown |
32 |
-
+
Jim Green |
40 |
@@ -816,10 +816,10 @@ exports[`renders ./components/table/demo/fixed-columns.md correctly 1`] = `
-
+
action |
-
+
action |
@@ -895,7 +895,7 @@ exports[`renders ./components/table/demo/fixed-columns-header.md correctly 1`] =
-
+
Edrward 0 |
32 |
@@ -909,7 +909,7 @@ exports[`renders ./components/table/demo/fixed-columns-header.md correctly 1`] =
London Park no. 0 |
action |
-
+
Edrward 1 |
32 |
@@ -923,7 +923,7 @@ exports[`renders ./components/table/demo/fixed-columns-header.md correctly 1`] =
London Park no. 1 |
action |
-
+
Edrward 2 |
32 |
@@ -937,7 +937,7 @@ exports[`renders ./components/table/demo/fixed-columns-header.md correctly 1`] =
London Park no. 2 |
action |
-
+
Edrward 3 |
32 |
@@ -951,7 +951,7 @@ exports[`renders ./components/table/demo/fixed-columns-header.md correctly 1`] =
London Park no. 3 |
action |
-
+
Edrward 4 |
32 |
@@ -965,7 +965,7 @@ exports[`renders ./components/table/demo/fixed-columns-header.md correctly 1`] =
London Park no. 4 |
action |
-
+
Edrward 5 |
32 |
@@ -979,7 +979,7 @@ exports[`renders ./components/table/demo/fixed-columns-header.md correctly 1`] =
London Park no. 5 |
action |
-
+
Edrward 6 |
32 |
@@ -993,7 +993,7 @@ exports[`renders ./components/table/demo/fixed-columns-header.md correctly 1`] =
London Park no. 6 |
action |
-
+
Edrward 7 |
32 |
@@ -1007,7 +1007,7 @@ exports[`renders ./components/table/demo/fixed-columns-header.md correctly 1`] =
London Park no. 7 |
action |
-
+
Edrward 8 |
32 |
@@ -1021,7 +1021,7 @@ exports[`renders ./components/table/demo/fixed-columns-header.md correctly 1`] =
London Park no. 8 |
action |
-
+
Edrward 9 |
32 |
@@ -1062,52 +1062,52 @@ exports[`renders ./components/table/demo/fixed-columns-header.md correctly 1`] =
-
+
Edrward 0 |
32 |
-
+
Edrward 1 |
32 |
-
+
Edrward 2 |
32 |
-
+
Edrward 3 |
32 |
-
+
Edrward 4 |
32 |
-
+
Edrward 5 |
32 |
-
+
Edrward 6 |
32 |
-
+
Edrward 7 |
32 |
-
+
Edrward 8 |
32 |
-
+
Edrward 9 |
32 |
@@ -1137,34 +1137,34 @@ exports[`renders ./components/table/demo/fixed-columns-header.md correctly 1`] =
-
+
action |
-
+
action |
-
+
action |
-
+
action |
-
+
action |
-
+
action |
-
+
action |
-
+
action |
-
+
action |
-
+
action |
@@ -1222,301 +1222,301 @@ exports[`renders ./components/table/demo/fixed-header.md correctly 1`] = `
-
+
Edward King 0 |
32 |
London, Park Lane no. 0 |
-
+
Edward King 1 |
32 |
London, Park Lane no. 1 |
-
+
Edward King 2 |
32 |
London, Park Lane no. 2 |
-
+
Edward King 3 |
32 |
London, Park Lane no. 3 |
-
+
Edward King 4 |
32 |
London, Park Lane no. 4 |
-
+
Edward King 5 |
32 |
London, Park Lane no. 5 |
-
+
Edward King 6 |
32 |
London, Park Lane no. 6 |
-
+
Edward King 7 |
32 |
London, Park Lane no. 7 |
-
+
Edward King 8 |
32 |
London, Park Lane no. 8 |
-
+
Edward King 9 |
32 |
London, Park Lane no. 9 |
-
+
Edward King 10 |
32 |
London, Park Lane no. 10 |
-
+
Edward King 11 |
32 |
London, Park Lane no. 11 |
-
+
Edward King 12 |
32 |
London, Park Lane no. 12 |
-
+
Edward King 13 |
32 |
London, Park Lane no. 13 |
-
+
Edward King 14 |
32 |
London, Park Lane no. 14 |
-
+
Edward King 15 |
32 |
London, Park Lane no. 15 |
-
+
Edward King 16 |
32 |
London, Park Lane no. 16 |
-
+
Edward King 17 |
32 |
London, Park Lane no. 17 |
-
+
Edward King 18 |
32 |
London, Park Lane no. 18 |
-
+
Edward King 19 |
32 |
London, Park Lane no. 19 |
-
+
Edward King 20 |
32 |
London, Park Lane no. 20 |
-
+
Edward King 21 |
32 |
London, Park Lane no. 21 |
-
+
Edward King 22 |
32 |
London, Park Lane no. 22 |
-
+
Edward King 23 |
32 |
London, Park Lane no. 23 |
-
+
Edward King 24 |
32 |
London, Park Lane no. 24 |
-
+
Edward King 25 |
32 |
London, Park Lane no. 25 |
-
+
Edward King 26 |
32 |
London, Park Lane no. 26 |
-
+
Edward King 27 |
32 |
London, Park Lane no. 27 |
-
+
Edward King 28 |
32 |
London, Park Lane no. 28 |
-
+
Edward King 29 |
32 |
London, Park Lane no. 29 |
-
+
Edward King 30 |
32 |
London, Park Lane no. 30 |
-
+
Edward King 31 |
32 |
London, Park Lane no. 31 |
-
+
Edward King 32 |
32 |
London, Park Lane no. 32 |
-
+
Edward King 33 |
32 |
London, Park Lane no. 33 |
-
+
Edward King 34 |
32 |
London, Park Lane no. 34 |
-
+
Edward King 35 |
32 |
London, Park Lane no. 35 |
-
+
Edward King 36 |
32 |
London, Park Lane no. 36 |
-
+
Edward King 37 |
32 |
London, Park Lane no. 37 |
-
+
Edward King 38 |
32 |
London, Park Lane no. 38 |
-
+
Edward King 39 |
32 |
London, Park Lane no. 39 |
-
+
Edward King 40 |
32 |
London, Park Lane no. 40 |
-
+
Edward King 41 |
32 |
London, Park Lane no. 41 |
-
+
Edward King 42 |
32 |
London, Park Lane no. 42 |
-
+
Edward King 43 |
32 |
London, Park Lane no. 43 |
-
+
Edward King 44 |
32 |
London, Park Lane no. 44 |
-
+
Edward King 45 |
32 |
London, Park Lane no. 45 |
-
+
Edward King 46 |
32 |
London, Park Lane no. 46 |
-
+
Edward King 47 |
32 |
London, Park Lane no. 47 |
-
+
Edward King 48 |
32 |
London, Park Lane no. 48 |
-
+
Edward King 49 |
32 |
@@ -1597,7 +1597,7 @@ exports[`renders ./components/table/demo/grouping-columns.md correctly 1`] = `
-
+
John Brown |
1 |
@@ -1608,7 +1608,7 @@ exports[`renders ./components/table/demo/grouping-columns.md correctly 1`] = `
SoftLake Co |
M |
-
+
John Brown |
2 |
@@ -1619,7 +1619,7 @@ exports[`renders ./components/table/demo/grouping-columns.md correctly 1`] = `
SoftLake Co |
M |
-
+
John Brown |
3 |
@@ -1630,7 +1630,7 @@ exports[`renders ./components/table/demo/grouping-columns.md correctly 1`] = `
SoftLake Co |
M |
-
+
John Brown |
4 |
@@ -1641,7 +1641,7 @@ exports[`renders ./components/table/demo/grouping-columns.md correctly 1`] = `
SoftLake Co |
M |
-
+
John Brown |
5 |
@@ -1652,7 +1652,7 @@ exports[`renders ./components/table/demo/grouping-columns.md correctly 1`] = `
SoftLake Co |
M |
-
+
John Brown |
6 |
@@ -1663,7 +1663,7 @@ exports[`renders ./components/table/demo/grouping-columns.md correctly 1`] = `
SoftLake Co |
M |
-
+
John Brown |
7 |
@@ -1674,7 +1674,7 @@ exports[`renders ./components/table/demo/grouping-columns.md correctly 1`] = `
SoftLake Co |
M |
-
+
John Brown |
8 |
@@ -1685,7 +1685,7 @@ exports[`renders ./components/table/demo/grouping-columns.md correctly 1`] = `
SoftLake Co |
M |
-
+
John Brown |
9 |
@@ -1696,7 +1696,7 @@ exports[`renders ./components/table/demo/grouping-columns.md correctly 1`] = `
SoftLake Co |
M |
-
+
John Brown |
10 |
@@ -1731,43 +1731,43 @@ exports[`renders ./components/table/demo/grouping-columns.md correctly 1`] = `
-
+
John Brown |
-
+
John Brown |
-
+
John Brown |
-
+
John Brown |
-
+
John Brown |
-
+
John Brown |
-
+
John Brown |
-
+
John Brown |
-
+
John Brown |
-
+
John Brown |
@@ -1796,34 +1796,34 @@ exports[`renders ./components/table/demo/grouping-columns.md correctly 1`] = `
-
+
M |
-
+
M |
-
+
M |
-
+
M |
-
+
M |
-
+
M |
-
+
M |
-
+
M |
-
+
M |
-
+
M |
@@ -1875,25 +1875,25 @@ exports[`renders ./components/table/demo/head.md correctly 1`] = `
-
+
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 |
@@ -1947,7 +1947,7 @@ exports[`renders ./components/table/demo/nested-table.md correctly 1`] = `
-
+
|
Screem |
iOS |
@@ -1958,7 +1958,7 @@ exports[`renders ./components/table/demo/nested-table.md correctly 1`] = `
Publish |
-
+
|
Screem |
iOS |
@@ -1969,7 +1969,7 @@ exports[`renders ./components/table/demo/nested-table.md correctly 1`] = `
Publish |
-
+
|
Screem |
iOS |
@@ -2023,25 +2023,25 @@ exports[`renders ./components/table/demo/reset-filter.md correctly 1`] = `
-
+
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 |
@@ -2089,28 +2089,28 @@ exports[`renders ./components/table/demo/row-selection.md correctly 1`] = `
-
+
|
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 |
-
+
|
Disabled User |
@@ -2160,70 +2160,70 @@ exports[`renders ./components/table/demo/row-selection-and-operation.md correctl
-
+
|
Edward King 0 |
32 |
London, Park Lane no. 0 |
-
+
|
Edward King 1 |
32 |
London, Park Lane no. 1 |
-
+
|
Edward King 2 |
32 |
London, Park Lane no. 2 |
-
+
|
Edward King 3 |
32 |
London, Park Lane no. 3 |
-
+
|
Edward King 4 |
32 |
London, Park Lane no. 4 |
-
+
|
Edward King 5 |
32 |
London, Park Lane no. 5 |
-
+
|
Edward King 6 |
32 |
London, Park Lane no. 6 |
-
+
|
Edward King 7 |
32 |
London, Park Lane no. 7 |
-
+
|
Edward King 8 |
32 |
London, Park Lane no. 8 |
-
+
|
Edward King 9 |
@@ -2277,70 +2277,70 @@ exports[`renders ./components/table/demo/row-selection-custom.md correctly 1`] =
-
+
|
Edward King 0 |
32 |
London, Park Lane no. 0 |
-
+
|
Edward King 1 |
32 |
London, Park Lane no. 1 |
-
+
|
Edward King 2 |
32 |
London, Park Lane no. 2 |
-
+
|
Edward King 3 |
32 |
London, Park Lane no. 3 |
-
+
|
Edward King 4 |
32 |
London, Park Lane no. 4 |
-
+
|
Edward King 5 |
32 |
London, Park Lane no. 5 |
-
+
|
Edward King 6 |
32 |
London, Park Lane no. 6 |
-
+
|
Edward King 7 |
32 |
London, Park Lane no. 7 |
-
+
|
Edward King 8 |
32 |
London, Park Lane no. 8 |
-
+
|
Edward King 9 |
@@ -2391,19 +2391,19 @@ exports[`renders ./components/table/demo/size.md correctly 1`] = `
-
+
John Brown |
32 |
New York No. 1 Lake Park |
-
+
Jim Green |
42 |
London No. 1 Lake Park |
-
+
Joe Black |
32 |
@@ -2445,19 +2445,19 @@ exports[`renders ./components/table/demo/size.md correctly 1`] = `
-
+
John Brown |
32 |
New York No. 1 Lake Park |
-
+
Jim Green |
42 |
London No. 1 Lake Park |
-
+
Joe Black |
32 |
@@ -2511,7 +2511,7 @@ exports[`renders ./components/table/demo/template.md correctly 1`] = `
-
+
John |
Brown |
@@ -2520,7 +2520,7 @@ exports[`renders ./components/table/demo/template.md correctly 1`] = `
nice developer |
Action 一 John Delete |
-
+
Jim |
Green |
@@ -2529,7 +2529,7 @@ exports[`renders ./components/table/demo/template.md correctly 1`] = `
loser |
Action 一 Jim Delete |
-
+
Joe |
Black |
diff --git a/components/vc-table/demo/expandIcon.js b/components/vc-table/demo/expandIcon.js
new file mode 100644
index 000000000..142d8a771
--- /dev/null
+++ b/components/vc-table/demo/expandIcon.js
@@ -0,0 +1,55 @@
+/* eslint-disable no-console,func-names,react/no-multi-comp */
+import Table from '../index'
+import '../assets/index.less'
+
+const data = [
+ { key: 0, a: '123' },
+ { key: 1, a: 'cdd', b: 'edd' },
+ { key: 2, a: '1333', c: 'eee', d: 2 },
+]
+
+const columns = [
+ { title: 'title 1', dataIndex: 'a', key: 'a', width: 100 },
+ { title: 'title 2', dataIndex: 'b', key: 'b', width: 100 },
+ { title: 'title 3', dataIndex: 'c', key: 'c', width: 200 },
+]
+export default {
+ methods: {
+ CustomExpandIcon (props) {
+ let text
+ if (props.expanded) {
+ text = ⇧ collapse
+ } else {
+ text = ⇩ expand
+ }
+ return (
+ props.onExpand(props.record, e)}
+ style={{ color: 'blue', cursor: 'pointer' }}
+ >{text}
+ )
+ },
+ onExpand (expanded, record) {
+ console.log('onExpand', expanded, record)
+ },
+ },
+ render () {
+ return (
+
+
expandIcon
+
+
extra: {record.a}
}
+ onExpand={this.onExpand}
+ expandIcon={this.CustomExpandIcon}
+ expandIconAsCell
+ data={data}
+ />
+
+
+ )
+ },
+}
+
diff --git a/components/vc-table/demo/rowAndCellClick.js b/components/vc-table/demo/rowAndCellClick.js
index 66654c6ec..c079e216a 100644
--- a/components/vc-table/demo/rowAndCellClick.js
+++ b/components/vc-table/demo/rowAndCellClick.js
@@ -80,10 +80,10 @@ export default {
customRender: (text) => (
{text} (Trigger Cell Click)
),
- customCell: (record) => ({
+ customCell: (record, index) => ({
on: {
click (e) {
- console.log('Click cell', record, e.target)
+ console.log('Click cell', ` row ${index}`, record, e.target)
},
},
}),
diff --git a/components/vc-table/index.js b/components/vc-table/index.js
index 0b3e58caa..4c63ad528 100644
--- a/components/vc-table/index.js
+++ b/components/vc-table/index.js
@@ -1,4 +1,4 @@
-// base rc-table 6.2.9
+// base rc-table 6.4.0
import T from './src/Table'
import Column from './src/Column'
import ColumnGroup from './src/ColumnGroup'
diff --git a/components/vc-table/src/ExpandableRow.jsx b/components/vc-table/src/ExpandableRow.jsx
index 4a2acdf86..25ae2167a 100644
--- a/components/vc-table/src/ExpandableRow.jsx
+++ b/components/vc-table/src/ExpandableRow.jsx
@@ -25,6 +25,7 @@ const ExpandableRow = {
expandIconColumnIndex: PropTypes.number,
childrenColumnName: PropTypes.string,
expandedRowRender: PropTypes.func,
+ expandIcon: PropTypes.func,
// onExpandedChange: PropTypes.func.isRequired,
// onRowClick: PropTypes.func,
// children: PropTypes.func.isRequired,
@@ -60,8 +61,17 @@ const ExpandableRow = {
},
renderExpandIcon () {
- const { prefixCls, expanded, record, needIndentSpaced } = this
-
+ const { prefixCls, expanded, record, needIndentSpaced, expandIcon } = this
+ if (expandIcon) {
+ return expandIcon({
+ prefixCls,
+ expanded,
+ record,
+ needIndentSpaced,
+ expandable: this.expandable,
+ onExpand: this.handleExpandChange,
+ })
+ }
return (
({
defaultExpandedRowKeys: PropTypes.array,
expandIconColumnIndex: PropTypes.number,
expandedRowRender: PropTypes.func,
+ expandIcon: PropTypes.func,
childrenColumnName: PropTypes.string,
indentSize: PropTypes.number,
// onExpand: PropTypes.func,
diff --git a/components/vc-table/src/Table.jsx b/components/vc-table/src/Table.jsx
index 220923f95..6ea23c03d 100644
--- a/components/vc-table/src/Table.jsx
+++ b/components/vc-table/src/Table.jsx
@@ -63,6 +63,7 @@ export default {
childrenColumnName: PropTypes.string,
indentSize: PropTypes.number,
expandRowByClick: PropTypes.bool,
+ expandIcon: PropTypes.func,
}, {
data: [],
useFixedHeader: false,
@@ -175,6 +176,13 @@ export default {
window, 'resize', this.debouncedWindowResize
)
}
+ // https://github.com/ant-design/ant-design/issues/11635
+ if (this.ref_headTable) {
+ this.ref_headTable.scrollLeft = 0
+ }
+ if (this.ref_bodyTable) {
+ this.ref_bodyTable.scrollLeft = 0
+ }
})
},
diff --git a/components/vc-table/src/TableCell.jsx b/components/vc-table/src/TableCell.jsx
index 17dca47f4..514c12c5f 100644
--- a/components/vc-table/src/TableCell.jsx
+++ b/components/vc-table/src/TableCell.jsx
@@ -75,7 +75,7 @@ export default {
}
if (column.customCell) {
- tdProps = mergeProps(tdProps, column.customCell(record))
+ tdProps = mergeProps(tdProps, column.customCell(record, index))
}
// Fix https://github.com/ant-design/ant-design/issues/1202
diff --git a/components/vc-table/src/TableHeader.jsx b/components/vc-table/src/TableHeader.jsx
index 2a1471158..7a375f989 100644
--- a/components/vc-table/src/TableHeader.jsx
+++ b/components/vc-table/src/TableHeader.jsx
@@ -64,6 +64,7 @@ export default {
{
rows.map((row, index) => (
cell.column), index)
@@ -43,6 +45,9 @@ const TableHeaderRow = {
if (column.align) {
headerCellProps.style = { ...customProps.style, textAlign: column.align }
+ headerCellProps.class = classNames(customProps.cls, column.class, column.className, {
+ [`${prefixCls}-align-${column.align}`]: !!column.align,
+ })
}
if (typeof HeaderCell === 'function') {
diff --git a/components/vc-table/src/TableRow.jsx b/components/vc-table/src/TableRow.jsx
index 6286da8be..db7576188 100644
--- a/components/vc-table/src/TableRow.jsx
+++ b/components/vc-table/src/TableRow.jsx
@@ -1,3 +1,4 @@
+import classNames from 'classnames'
import PropTypes from '../../_util/vue-types'
import { connect } from '../../_util/store'
import TableCell from './TableCell'
@@ -229,11 +230,8 @@ const TableRow = {
)
}
- const rowClassName =
- `${prefixCls} ${className} ${prefixCls}-level-${indent}`.trim()
+ const { class: customClass, className: customClassName, style: customStyle, ...rowProps } = customRow(record, index) || {}
- const rowProps = customRow(record, index)
- const customStyle = rowProps ? rowProps.style : {}
let style = { height: typeof height === 'number' ? `${height}px` : height }
if (!visible) {
@@ -241,6 +239,13 @@ const TableRow = {
}
style = { ...style, ...customStyle }
+ const rowClassName = classNames(
+ prefixCls,
+ className,
+ `${prefixCls}-level-${indent}`,
+ customClassName,
+ customClass
+ )
const bodyRowProps = mergeProps({
on: {
click: this.onRowClick,