From 251ae1737643ce2fe8d9e31c71e50721e38493cb Mon Sep 17 00:00:00 2001 From: afc163 Date: Wed, 4 Sep 2019 18:12:57 +0800 Subject: [PATCH] :clapper: Add tableLyout and ellipsis in Table demo --- .../__tests__/__snapshots__/demo.test.js.snap | 1013 +++++++++-------- components/table/demo/dynamic-settings.md | 132 ++- components/table/style/index.less | 1 - 3 files changed, 628 insertions(+), 518 deletions(-) diff --git a/components/table/__tests__/__snapshots__/demo.test.js.snap b/components/table/__tests__/__snapshots__/demo.test.js.snap index 03f41fc79c..6c45c8f154 100755 --- a/components/table/__tests__/__snapshots__/demo.test.js.snap +++ b/components/table/__tests__/__snapshots__/demo.test.js.snap @@ -1795,538 +1795,639 @@ exports[`renders ./components/table/demo/drag-sorting.md correctly 1`] = ` exports[`renders ./components/table/demo/dynamic-settings.md correctly 1`] = `
-
-
-
- -
-
-
- - - -
-
+ Bordered +
- -
-
-
- - - -
+ + +
+
+
-
- -
-
-
- - - -
-
+ loading +
- -
-
-
- - - -
+ + +
+
+
-
- -
-
-
- - - -
-
+ Title +
- -
-
-
- - - -
+ + +
+
+
-
- -
-
-
- - - -
-
+ Column Header +
- -
-
-
- - - -
+ + +
+
+
-
- -
-
-
- - - -
-
+ Footer +
- -
-
-
- -
+ + +
+
+
+
+
+ +
+
+
+ + + +
+
+
+
+
+ +
+
+
+ + + +
+
+
+
+
+ +
+
+
+ + + +
+
+
+
+
+ +
+
+
+ + + +
+
+
+
+
+ +
+
+
+ + + +
+
+
+
+
+ +
+
+
+ +
+
-
-
+ class="ant-radio-button-inner" + /> + + + Small + + +
+
+
+
+
+ +
- -
-
-
- -
- - + - - -
-
-
+ class="ant-radio-button-inner" + /> + + + Fixed + + +
+
- -
+ +
+
+ +
+
+
+ +
+ + + + +
+
+
+
+
+
@@ -2355,16 +2456,10 @@ exports[`renders ./components/table/demo/dynamic-settings.md correctly 1`] = ` - - - + + + {text}, }, { title: 'Age', dataIndex: 'age', key: 'age', - width: 70, }, { title: 'Address', @@ -40,7 +36,6 @@ const columns = [ { title: 'Action', key: 'action', - width: 360, render: (text, record) => ( Action δΈ€ {record.name} @@ -86,6 +81,7 @@ class Demo extends React.Component { rowSelection: {}, scroll: undefined, hasData: true, + tableLayout: undefined, }; handleToggle = prop => enable => { @@ -96,10 +92,18 @@ class Demo extends React.Component { this.setState({ size: e.target.value }); }; + handleTableLayoutChange = e => { + this.setState({ tableLayout: e.target.value }); + }; + handleExpandChange = enable => { this.setState({ expandedRowRender: enable ? expandedRowRender : undefined }); }; + handleEllipsisChange = enable => { + this.setState({ ellipsis: enable }); + }; + handleTitleChange = enable => { this.setState({ title: enable ? title : undefined }); }; @@ -135,56 +139,71 @@ class Demo extends React.Component { const { state } = this; return (
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Default - Middle - Small - - - - - Top - Bottom - Both - None - - -
-
- + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Default + Middle + Small + + + + + Unset + Fixed + + + + + Top + Bottom + Both + None + + + +
({ ...item, ellipsis: state. ellipsis }))} + dataSource={state.hasData ? data : null} + /> ); } @@ -194,9 +213,6 @@ ReactDOM.render(, mountNode); ```