tntd 2.8.0-beta.15 → 2.8.0-beta.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/modal/style/modal.less +1 -1
- package/es/table/style/index.less +47 -23
- package/es/table/style_/index.js +10 -0
- package/es/table/style_/index.js.map +1 -0
- package/es/table/style_antd/index.js +10 -0
- package/es/table/style_antd/index.js.map +1 -0
- package/es/table/table.less +5 -5
- package/es/table/table.stories.js +413 -2
- package/es/table/table.stories.js.map +1 -1
- package/es/table-container/index.less +10 -10
- package/lib/modal/style/modal.less +1 -1
- package/lib/table/style/index.less +47 -23
- package/lib/table/style_/index.d.ts +9 -0
- package/lib/table/style_/index.d.ts.map +1 -0
- package/lib/table/style_/index.js +10 -0
- package/lib/table/style_/index.js.map +1 -0
- package/lib/table/style_antd/index.d.ts +9 -0
- package/lib/table/style_antd/index.d.ts.map +1 -0
- package/lib/table/style_antd/index.js +10 -0
- package/lib/table/style_antd/index.js.map +1 -0
- package/lib/table/table.less +5 -5
- package/lib/table/table.stories.d.ts +106 -29
- package/lib/table/table.stories.d.ts.map +1 -1
- package/lib/table/table.stories.js +426 -3
- package/lib/table/table.stories.js.map +1 -1
- package/lib/table-container/index.less +10 -10
- package/package.json +2 -2
|
@@ -258,12 +258,11 @@
|
|
|
258
258
|
}
|
|
259
259
|
|
|
260
260
|
&-footer {
|
|
261
|
-
position: relative;
|
|
261
|
+
// position: relative;
|
|
262
262
|
padding: @table-padding-vertical @table-padding-horizontal;
|
|
263
263
|
color: @table-footer-color;
|
|
264
264
|
background: @table-footer-bg;
|
|
265
265
|
border-top: @border-width-base @border-style-base @border-color-split;
|
|
266
|
-
border-radius: 0 0 @table-border-radius-base @table-border-radius-base;
|
|
267
266
|
&::before {
|
|
268
267
|
position: absolute;
|
|
269
268
|
top: -1px;
|
|
@@ -275,26 +274,25 @@
|
|
|
275
274
|
}
|
|
276
275
|
}
|
|
277
276
|
|
|
278
|
-
&.@{table-prefix-cls}-bordered &-footer {
|
|
279
|
-
|
|
280
|
-
}
|
|
277
|
+
// &.@{table-prefix-cls}-bordered &-footer {
|
|
278
|
+
// border: @border-width-base @border-style-base @border-color-split;
|
|
279
|
+
// }
|
|
281
280
|
|
|
282
281
|
&-title {
|
|
283
|
-
position: relative;
|
|
284
|
-
top: 1px;
|
|
282
|
+
// position: relative;
|
|
283
|
+
// top: 1px;
|
|
285
284
|
padding: @table-padding-vertical 0;
|
|
286
|
-
border-radius: @table-border-radius-base @table-border-radius-base 0 0;
|
|
287
285
|
}
|
|
288
286
|
|
|
289
287
|
&.@{table-prefix-cls}-bordered &-title {
|
|
290
288
|
padding-right: @table-padding-horizontal;
|
|
291
289
|
padding-left: @table-padding-horizontal;
|
|
292
|
-
border: @border-width-base @border-style-base @border-color-split;
|
|
290
|
+
border-bottom: @border-width-base @border-style-base @border-color-split;
|
|
293
291
|
}
|
|
294
292
|
|
|
295
293
|
&-title + &-content {
|
|
296
|
-
position: relative;
|
|
297
|
-
border-radius: @table-border-radius-base @table-border-radius-base 0 0;
|
|
294
|
+
// position: relative;
|
|
295
|
+
// border-radius: @table-border-radius-base @table-border-radius-base 0 0;
|
|
298
296
|
|
|
299
297
|
.@{table-prefix-cls}-bordered & {
|
|
300
298
|
&,
|
|
@@ -375,19 +373,23 @@
|
|
|
375
373
|
}
|
|
376
374
|
|
|
377
375
|
&-bordered {
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
.@{table-prefix-cls}-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
376
|
+
border: @border-width-base @border-style-base @border-color-split;
|
|
377
|
+
border-radius: @border-radius-base;
|
|
378
|
+
overflow: hidden;
|
|
379
|
+
// .@{table-prefix-cls}-header > table,
|
|
380
|
+
// .@{table-prefix-cls}-body > table,
|
|
381
|
+
// .@{table-prefix-cls}-fixed-left table,
|
|
382
|
+
// .@{table-prefix-cls}-fixed-right table {
|
|
383
|
+
// border: @border-width-base @border-style-base @border-color-split;
|
|
384
|
+
// border-right: 0;
|
|
385
|
+
// border-bottom: 0;
|
|
386
|
+
// }
|
|
386
387
|
|
|
387
388
|
&.@{table-prefix-cls}-empty {
|
|
388
389
|
.@{table-prefix-cls}-placeholder {
|
|
389
|
-
border-right: @border-width-base @border-style-base @border-color-split;
|
|
390
|
-
border-left: @border-width-base @border-style-base @border-color-split;
|
|
390
|
+
// border-right: @border-width-base @border-style-base @border-color-split;
|
|
391
|
+
// border-left: @border-width-base @border-style-base @border-color-split;
|
|
392
|
+
border-bottom: 0;
|
|
391
393
|
}
|
|
392
394
|
}
|
|
393
395
|
|
|
@@ -414,6 +416,27 @@
|
|
|
414
416
|
.@{table-prefix-cls}-thead > tr > th,
|
|
415
417
|
.@{table-prefix-cls}-tbody > tr > td {
|
|
416
418
|
border-right: @border-width-base @border-style-base @border-color-split;
|
|
419
|
+
&:last-child {
|
|
420
|
+
border-right: 0;
|
|
421
|
+
}
|
|
422
|
+
}
|
|
423
|
+
.@{table-prefix-cls}-fixed-left {
|
|
424
|
+
.@{table-prefix-cls}-thead > tr > th,
|
|
425
|
+
.@{table-prefix-cls}-tbody > tr > td {
|
|
426
|
+
&:last-child {
|
|
427
|
+
border-right: @border-width-base @border-style-base @border-color-split;
|
|
428
|
+
}
|
|
429
|
+
}
|
|
430
|
+
}
|
|
431
|
+
.@{table-prefix-cls}-content:has(.@{table-prefix-cls}-fixed-right) .@{table-prefix-cls}-scroll {
|
|
432
|
+
.@{table-prefix-cls}-thead > tr > th {
|
|
433
|
+
&:last-child {
|
|
434
|
+
border-right: @border-width-base @border-style-base @border-color-split;
|
|
435
|
+
}
|
|
436
|
+
}
|
|
437
|
+
}
|
|
438
|
+
.@{table-prefix-cls}-tbody > tr:last-child > td {
|
|
439
|
+
border-bottom: 0;
|
|
417
440
|
}
|
|
418
441
|
}
|
|
419
442
|
|
|
@@ -428,7 +451,7 @@
|
|
|
428
451
|
background: @component-background;
|
|
429
452
|
border-top: @border-width-base @border-style-base @border-color-split;
|
|
430
453
|
border-bottom: @border-width-base @border-style-base @border-color-split;
|
|
431
|
-
border-radius: 0 0 @border-radius-base @border-radius-base;
|
|
454
|
+
// border-radius: 0 0 @border-radius-base @border-radius-base;
|
|
432
455
|
}
|
|
433
456
|
|
|
434
457
|
&-pagination.@{ant-prefix}-pagination {
|
|
@@ -604,7 +627,8 @@
|
|
|
604
627
|
}
|
|
605
628
|
|
|
606
629
|
td > .@{table-prefix-cls}-wrapper {
|
|
607
|
-
margin: -@table-padding-vertical -@table-padding-horizontal
|
|
630
|
+
margin: -@table-padding-vertical -@table-padding-horizontal
|
|
631
|
+
calc(-@table-padding-vertical - 1px);
|
|
608
632
|
}
|
|
609
633
|
}
|
|
610
634
|
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import '../../style/index.less';
|
|
2
|
+
import './index.less';
|
|
3
|
+
// style dependencies
|
|
4
|
+
// deps-lint-skip: menu
|
|
5
|
+
import '../../empty/style';
|
|
6
|
+
import '../../radio/style';
|
|
7
|
+
import '../../checkbox/style';
|
|
8
|
+
import '../../dropdown/style';
|
|
9
|
+
import '../../spin/style';
|
|
10
|
+
import '../../pagination/style';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/table/style_/index.tsx"],"names":[],"mappings":"AAAA,OAAO,wBAAwB,CAAA;AAC/B,OAAO,cAAc,CAAA;AAErB,qBAAqB;AACrB,uBAAuB;AACvB,OAAO,mBAAmB,CAAA;AAC1B,OAAO,mBAAmB,CAAA;AAC1B,OAAO,sBAAsB,CAAA;AAC7B,OAAO,sBAAsB,CAAA;AAC7B,OAAO,kBAAkB,CAAA;AACzB,OAAO,wBAAwB,CAAA","sourcesContent":["import '../../style/index.less'\nimport './index.less'\n\n// style dependencies\n// deps-lint-skip: menu\nimport '../../empty/style'\nimport '../../radio/style'\nimport '../../checkbox/style'\nimport '../../dropdown/style'\nimport '../../spin/style'\nimport '../../pagination/style'\n"]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import '../../style/index.less';
|
|
2
|
+
import './index.less';
|
|
3
|
+
// style dependencies
|
|
4
|
+
// deps-lint-skip: menu
|
|
5
|
+
import '../../empty/style';
|
|
6
|
+
import '../../radio/style';
|
|
7
|
+
import '../../checkbox/style';
|
|
8
|
+
import '../../dropdown/style';
|
|
9
|
+
import '../../spin/style';
|
|
10
|
+
import '../../pagination/style';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/table/style_antd/index.tsx"],"names":[],"mappings":"AAAA,OAAO,wBAAwB,CAAC;AAChC,OAAO,cAAc,CAAC;AAEtB,qBAAqB;AACrB,uBAAuB;AACvB,OAAO,mBAAmB,CAAC;AAC3B,OAAO,mBAAmB,CAAC;AAC3B,OAAO,sBAAsB,CAAC;AAC9B,OAAO,sBAAsB,CAAC;AAC9B,OAAO,kBAAkB,CAAC;AAC1B,OAAO,wBAAwB,CAAC","sourcesContent":["import '../../style/index.less';\nimport './index.less';\n\n// style dependencies\n// deps-lint-skip: menu\nimport '../../empty/style';\nimport '../../radio/style';\nimport '../../checkbox/style';\nimport '../../dropdown/style';\nimport '../../spin/style';\nimport '../../pagination/style';\n"]}
|
package/es/table/table.less
CHANGED
|
@@ -3,9 +3,8 @@
|
|
|
3
3
|
@spin-prefix-cls: ~'@{ant-prefix}-spin';
|
|
4
4
|
@table-borderless-shadow: 0 0 14px rgba(0, 0, 0, 0.08);
|
|
5
5
|
|
|
6
|
-
|
|
7
6
|
// .@{table-prefix-cls} {
|
|
8
|
-
.tnt-table-wrapper{
|
|
7
|
+
.tnt-table-wrapper {
|
|
9
8
|
background-color: @white;
|
|
10
9
|
border-radius: @border-radius-base;
|
|
11
10
|
|
|
@@ -30,9 +29,9 @@
|
|
|
30
29
|
}
|
|
31
30
|
|
|
32
31
|
&.@{table-prefix-cls}-hide-cell-borders {
|
|
33
|
-
.@{table-prefix-cls}-thead > tr > th
|
|
34
|
-
.@{table-prefix-cls}-tbody > tr > td
|
|
35
|
-
border-right: none;
|
|
32
|
+
.@{table-prefix-cls}-thead > tr > th,
|
|
33
|
+
.@{table-prefix-cls}-tbody > tr > td {
|
|
34
|
+
border-right: none !important;
|
|
36
35
|
}
|
|
37
36
|
}
|
|
38
37
|
|
|
@@ -68,6 +67,7 @@
|
|
|
68
67
|
.@{table-prefix-cls}-placeholder {
|
|
69
68
|
padding-top: @table-padding-horizontal;
|
|
70
69
|
padding-bottom: @table-padding-horizontal;
|
|
70
|
+
border-bottom: 0;
|
|
71
71
|
}
|
|
72
72
|
|
|
73
73
|
// customize the loading of table
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import Tag from '../tag';
|
|
3
|
-
import { Table } from '
|
|
3
|
+
import { Table } from '.';
|
|
4
4
|
const {
|
|
5
5
|
Column,
|
|
6
6
|
ColumnGroup
|
|
@@ -160,4 +160,415 @@ ColumnFilter.args = {
|
|
|
160
160
|
showTotal: (total, range) => `${range[0]}-${range[1]} of ${total} items`
|
|
161
161
|
},
|
|
162
162
|
loading: false
|
|
163
|
-
};
|
|
163
|
+
};
|
|
164
|
+
export const All = () => {
|
|
165
|
+
const dataSource = [{
|
|
166
|
+
key: '1',
|
|
167
|
+
name: '胡彦斌',
|
|
168
|
+
age: 32,
|
|
169
|
+
address: '西湖区湖底公园1号'
|
|
170
|
+
}, {
|
|
171
|
+
key: '2',
|
|
172
|
+
name: '胡彦祖',
|
|
173
|
+
age: 42,
|
|
174
|
+
address: '西湖区湖底公园1号'
|
|
175
|
+
}];
|
|
176
|
+
const dataSource2 = [{
|
|
177
|
+
key: 1,
|
|
178
|
+
name: 'John Brown sr.',
|
|
179
|
+
age: 60,
|
|
180
|
+
address: 'New York No. 1 Lake Park',
|
|
181
|
+
children: [{
|
|
182
|
+
key: 11,
|
|
183
|
+
name: 'John Brown',
|
|
184
|
+
age: 42,
|
|
185
|
+
address: 'New York No. 2 Lake Park'
|
|
186
|
+
}, {
|
|
187
|
+
key: 12,
|
|
188
|
+
name: 'John Brown jr.',
|
|
189
|
+
age: 30,
|
|
190
|
+
address: 'New York No. 3 Lake Park',
|
|
191
|
+
children: [{
|
|
192
|
+
key: 121,
|
|
193
|
+
name: 'Jimmy Brown',
|
|
194
|
+
age: 16,
|
|
195
|
+
address: 'New York No. 3 Lake Park'
|
|
196
|
+
}]
|
|
197
|
+
}, {
|
|
198
|
+
key: 13,
|
|
199
|
+
name: 'Jim Green sr.',
|
|
200
|
+
age: 72,
|
|
201
|
+
address: 'London No. 1 Lake Park',
|
|
202
|
+
children: [{
|
|
203
|
+
key: 131,
|
|
204
|
+
name: 'Jim Green',
|
|
205
|
+
age: 42,
|
|
206
|
+
address: 'London No. 2 Lake Park',
|
|
207
|
+
children: [{
|
|
208
|
+
key: 1311,
|
|
209
|
+
name: 'Jim Green jr.',
|
|
210
|
+
age: 25,
|
|
211
|
+
address: 'London No. 3 Lake Park'
|
|
212
|
+
}, {
|
|
213
|
+
key: 1312,
|
|
214
|
+
name: 'Jimmy Green sr.',
|
|
215
|
+
age: 18,
|
|
216
|
+
address: 'London No. 4 Lake Park'
|
|
217
|
+
}]
|
|
218
|
+
}]
|
|
219
|
+
}]
|
|
220
|
+
}, {
|
|
221
|
+
key: 2,
|
|
222
|
+
name: 'Joe Black',
|
|
223
|
+
age: 32,
|
|
224
|
+
address: 'Sidney No. 1 Lake Park'
|
|
225
|
+
}];
|
|
226
|
+
const dataSource3 = [];
|
|
227
|
+
for (let i = 0; i < 100; i++) {
|
|
228
|
+
dataSource3.push({
|
|
229
|
+
key: i,
|
|
230
|
+
name: `Edward King ${i}`,
|
|
231
|
+
age: 32,
|
|
232
|
+
address: `London, Park Lane no. ${i}`
|
|
233
|
+
});
|
|
234
|
+
}
|
|
235
|
+
const columns = [{
|
|
236
|
+
title: '姓名',
|
|
237
|
+
dataIndex: 'name',
|
|
238
|
+
key: 'name'
|
|
239
|
+
}, {
|
|
240
|
+
title: '年龄',
|
|
241
|
+
dataIndex: 'age',
|
|
242
|
+
key: 'age'
|
|
243
|
+
}, {
|
|
244
|
+
title: '住址',
|
|
245
|
+
dataIndex: 'address',
|
|
246
|
+
key: 'address'
|
|
247
|
+
}];
|
|
248
|
+
// const columns2 = [
|
|
249
|
+
// {
|
|
250
|
+
// title: 'Full Name',
|
|
251
|
+
// width: 100,
|
|
252
|
+
// dataIndex: 'name',
|
|
253
|
+
// key: 'name',
|
|
254
|
+
// fixed: 'left',
|
|
255
|
+
// },
|
|
256
|
+
// {
|
|
257
|
+
// title: 'Age',
|
|
258
|
+
// width: 100,
|
|
259
|
+
// dataIndex: 'age',
|
|
260
|
+
// key: 'age',
|
|
261
|
+
// fixed: 'left',
|
|
262
|
+
// },
|
|
263
|
+
// { title: 'Column 1', dataIndex: 'address', key: '1' },
|
|
264
|
+
// { title: 'Column 2', dataIndex: 'address', key: '2' },
|
|
265
|
+
// { title: 'Column 3', dataIndex: 'address', key: '3' },
|
|
266
|
+
// { title: 'Column 4', dataIndex: 'address', key: '4' },
|
|
267
|
+
// { title: 'Column 5', dataIndex: 'address', key: '5' },
|
|
268
|
+
// { title: 'Column 6', dataIndex: 'address', key: '6' },
|
|
269
|
+
// { title: 'Column 7', dataIndex: 'address', key: '7' },
|
|
270
|
+
// { title: 'Column 8', dataIndex: 'address', key: '8' },
|
|
271
|
+
// {
|
|
272
|
+
// title: 'Action',
|
|
273
|
+
// key: 'operation',
|
|
274
|
+
// fixed: 'right',
|
|
275
|
+
// width: 100,
|
|
276
|
+
// render: () => <a>action</a>,
|
|
277
|
+
// },
|
|
278
|
+
// ]
|
|
279
|
+
const columns1 = [{
|
|
280
|
+
title: 'Full Name',
|
|
281
|
+
width: 120,
|
|
282
|
+
dataIndex: 'name',
|
|
283
|
+
key: 'name'
|
|
284
|
+
}, {
|
|
285
|
+
title: 'Age',
|
|
286
|
+
width: 100,
|
|
287
|
+
dataIndex: 'age',
|
|
288
|
+
key: 'age'
|
|
289
|
+
}, {
|
|
290
|
+
title: 'Column 1',
|
|
291
|
+
dataIndex: 'address',
|
|
292
|
+
key: '1',
|
|
293
|
+
width: 150
|
|
294
|
+
}, {
|
|
295
|
+
title: 'Column 2',
|
|
296
|
+
dataIndex: 'address',
|
|
297
|
+
key: '2',
|
|
298
|
+
width: 150
|
|
299
|
+
}, {
|
|
300
|
+
title: 'Column 3',
|
|
301
|
+
dataIndex: 'address',
|
|
302
|
+
key: '3',
|
|
303
|
+
width: 150
|
|
304
|
+
}, {
|
|
305
|
+
title: 'Column 4',
|
|
306
|
+
dataIndex: 'address',
|
|
307
|
+
key: '4',
|
|
308
|
+
width: 150
|
|
309
|
+
}, {
|
|
310
|
+
title: 'Column 5',
|
|
311
|
+
dataIndex: 'address',
|
|
312
|
+
key: '5',
|
|
313
|
+
width: 150
|
|
314
|
+
}, {
|
|
315
|
+
title: 'Column 6',
|
|
316
|
+
dataIndex: 'address',
|
|
317
|
+
key: '6',
|
|
318
|
+
width: 150
|
|
319
|
+
}, {
|
|
320
|
+
title: 'Column 7',
|
|
321
|
+
dataIndex: 'address',
|
|
322
|
+
key: '7',
|
|
323
|
+
width: 150
|
|
324
|
+
}, {
|
|
325
|
+
title: 'Column 8',
|
|
326
|
+
dataIndex: 'address',
|
|
327
|
+
key: '8',
|
|
328
|
+
width: 150
|
|
329
|
+
}, {
|
|
330
|
+
title: 'Action',
|
|
331
|
+
key: 'operation',
|
|
332
|
+
width: 200,
|
|
333
|
+
render: () => React.createElement("a", null, "action")
|
|
334
|
+
}];
|
|
335
|
+
const columns2 = [{
|
|
336
|
+
title: 'Full Name',
|
|
337
|
+
width: 120,
|
|
338
|
+
dataIndex: 'name',
|
|
339
|
+
key: 'name',
|
|
340
|
+
fixed: 'left'
|
|
341
|
+
}, {
|
|
342
|
+
title: 'Age',
|
|
343
|
+
width: 100,
|
|
344
|
+
dataIndex: 'age',
|
|
345
|
+
key: 'age',
|
|
346
|
+
fixed: 'left'
|
|
347
|
+
}, {
|
|
348
|
+
title: 'Column 1',
|
|
349
|
+
dataIndex: 'address',
|
|
350
|
+
key: '1',
|
|
351
|
+
width: 150
|
|
352
|
+
}, {
|
|
353
|
+
title: 'Column 2',
|
|
354
|
+
dataIndex: 'address',
|
|
355
|
+
key: '2',
|
|
356
|
+
width: 150
|
|
357
|
+
}, {
|
|
358
|
+
title: 'Column 3',
|
|
359
|
+
dataIndex: 'address',
|
|
360
|
+
key: '3',
|
|
361
|
+
width: 150
|
|
362
|
+
}, {
|
|
363
|
+
title: 'Column 4',
|
|
364
|
+
dataIndex: 'address',
|
|
365
|
+
key: '4',
|
|
366
|
+
width: 150
|
|
367
|
+
}, {
|
|
368
|
+
title: 'Column 5',
|
|
369
|
+
dataIndex: 'address',
|
|
370
|
+
key: '5',
|
|
371
|
+
width: 150
|
|
372
|
+
}, {
|
|
373
|
+
title: 'Column 6',
|
|
374
|
+
dataIndex: 'address',
|
|
375
|
+
key: '6',
|
|
376
|
+
width: 150
|
|
377
|
+
}, {
|
|
378
|
+
title: 'Column 7',
|
|
379
|
+
dataIndex: 'address',
|
|
380
|
+
key: '7',
|
|
381
|
+
width: 150
|
|
382
|
+
}, {
|
|
383
|
+
title: 'Column 8',
|
|
384
|
+
dataIndex: 'address',
|
|
385
|
+
key: '8',
|
|
386
|
+
width: 150
|
|
387
|
+
}, {
|
|
388
|
+
title: 'Action',
|
|
389
|
+
key: 'operation',
|
|
390
|
+
width: 200,
|
|
391
|
+
render: () => React.createElement("a", null, "action")
|
|
392
|
+
}];
|
|
393
|
+
const columns3 = [{
|
|
394
|
+
title: 'Full Name',
|
|
395
|
+
width: 120,
|
|
396
|
+
dataIndex: 'name',
|
|
397
|
+
key: 'name'
|
|
398
|
+
}, {
|
|
399
|
+
title: 'Age',
|
|
400
|
+
width: 100,
|
|
401
|
+
dataIndex: 'age',
|
|
402
|
+
key: 'age'
|
|
403
|
+
}, {
|
|
404
|
+
title: 'Column 1',
|
|
405
|
+
dataIndex: 'address',
|
|
406
|
+
key: '1',
|
|
407
|
+
width: 150
|
|
408
|
+
}, {
|
|
409
|
+
title: 'Column 2',
|
|
410
|
+
dataIndex: 'address',
|
|
411
|
+
key: '2',
|
|
412
|
+
width: 150
|
|
413
|
+
}, {
|
|
414
|
+
title: 'Column 3',
|
|
415
|
+
dataIndex: 'address',
|
|
416
|
+
key: '3',
|
|
417
|
+
width: 150
|
|
418
|
+
}, {
|
|
419
|
+
title: 'Column 4',
|
|
420
|
+
dataIndex: 'address',
|
|
421
|
+
key: '4',
|
|
422
|
+
width: 150
|
|
423
|
+
}, {
|
|
424
|
+
title: 'Column 5',
|
|
425
|
+
dataIndex: 'address',
|
|
426
|
+
key: '5',
|
|
427
|
+
width: 150
|
|
428
|
+
}, {
|
|
429
|
+
title: 'Column 6',
|
|
430
|
+
dataIndex: 'address',
|
|
431
|
+
key: '6',
|
|
432
|
+
width: 150
|
|
433
|
+
}, {
|
|
434
|
+
title: 'Column 7',
|
|
435
|
+
dataIndex: 'address',
|
|
436
|
+
key: '7',
|
|
437
|
+
width: 150
|
|
438
|
+
}, {
|
|
439
|
+
title: 'Column 8',
|
|
440
|
+
dataIndex: 'address',
|
|
441
|
+
key: '8',
|
|
442
|
+
width: 150
|
|
443
|
+
}, {
|
|
444
|
+
title: 'Action',
|
|
445
|
+
key: 'operation',
|
|
446
|
+
fixed: 'right',
|
|
447
|
+
width: 200,
|
|
448
|
+
render: () => React.createElement("a", null, "action")
|
|
449
|
+
}];
|
|
450
|
+
const columns4 = [{
|
|
451
|
+
title: 'Full Name',
|
|
452
|
+
width: 120,
|
|
453
|
+
dataIndex: 'name',
|
|
454
|
+
key: 'name',
|
|
455
|
+
fixed: 'left'
|
|
456
|
+
}, {
|
|
457
|
+
title: 'Age',
|
|
458
|
+
width: 100,
|
|
459
|
+
dataIndex: 'age',
|
|
460
|
+
key: 'age',
|
|
461
|
+
fixed: 'left'
|
|
462
|
+
}, {
|
|
463
|
+
title: 'Column 1',
|
|
464
|
+
dataIndex: 'address',
|
|
465
|
+
key: '1',
|
|
466
|
+
width: 150
|
|
467
|
+
}, {
|
|
468
|
+
title: 'Column 2',
|
|
469
|
+
dataIndex: 'address',
|
|
470
|
+
key: '2',
|
|
471
|
+
width: 150
|
|
472
|
+
}, {
|
|
473
|
+
title: 'Column 3',
|
|
474
|
+
dataIndex: 'address',
|
|
475
|
+
key: '3',
|
|
476
|
+
width: 150
|
|
477
|
+
}, {
|
|
478
|
+
title: 'Column 4',
|
|
479
|
+
dataIndex: 'address',
|
|
480
|
+
key: '4',
|
|
481
|
+
width: 150
|
|
482
|
+
}, {
|
|
483
|
+
title: 'Column 5',
|
|
484
|
+
dataIndex: 'address',
|
|
485
|
+
key: '5',
|
|
486
|
+
width: 150
|
|
487
|
+
}, {
|
|
488
|
+
title: 'Column 6',
|
|
489
|
+
dataIndex: 'address',
|
|
490
|
+
key: '6',
|
|
491
|
+
width: 150
|
|
492
|
+
}, {
|
|
493
|
+
title: 'Column 7',
|
|
494
|
+
dataIndex: 'address',
|
|
495
|
+
key: '7',
|
|
496
|
+
width: 150
|
|
497
|
+
}, {
|
|
498
|
+
title: 'Column 8',
|
|
499
|
+
dataIndex: 'address',
|
|
500
|
+
key: '8',
|
|
501
|
+
width: 150
|
|
502
|
+
}, {
|
|
503
|
+
title: 'Action',
|
|
504
|
+
key: 'operation',
|
|
505
|
+
fixed: 'right',
|
|
506
|
+
width: 200,
|
|
507
|
+
render: () => React.createElement("a", null, "action")
|
|
508
|
+
}];
|
|
509
|
+
const style = {
|
|
510
|
+
marginBottom: 20
|
|
511
|
+
};
|
|
512
|
+
const propsMap = {
|
|
513
|
+
bordered: [true, false],
|
|
514
|
+
// bordered: [true],
|
|
515
|
+
showCellBorders: [true, false],
|
|
516
|
+
// showCellBorders: [true],
|
|
517
|
+
striped: [true, false],
|
|
518
|
+
shadowed: [true, false],
|
|
519
|
+
// scroll: [{ x: 1600 }, { y: 240 }, { x: 1600, y: 300 }],
|
|
520
|
+
scroll: [{
|
|
521
|
+
x: 1600
|
|
522
|
+
}, {
|
|
523
|
+
x: 1600,
|
|
524
|
+
y: 300
|
|
525
|
+
}],
|
|
526
|
+
columns: [columns1, columns2, columns3, columns4],
|
|
527
|
+
// size: ['default', 'middle', 'small'],
|
|
528
|
+
size: ['default'],
|
|
529
|
+
dataSource: [dataSource3, []]
|
|
530
|
+
// dataSource: [[]],
|
|
531
|
+
};
|
|
532
|
+
const propsList = Object.keys(propsMap).reduce((arr, key) => {
|
|
533
|
+
const data = propsMap[key];
|
|
534
|
+
if (arr.length === 0) {
|
|
535
|
+
return data.map(value => ({
|
|
536
|
+
[key]: value
|
|
537
|
+
}));
|
|
538
|
+
} else {
|
|
539
|
+
let back = [];
|
|
540
|
+
for (let i = 0; i < data.length; i++) {
|
|
541
|
+
const value = data[i];
|
|
542
|
+
for (let j = 0; j < arr.length; j++) {
|
|
543
|
+
const item = arr[j];
|
|
544
|
+
back.push(Object.assign(Object.assign({}, item), {
|
|
545
|
+
[key]: value
|
|
546
|
+
}));
|
|
547
|
+
}
|
|
548
|
+
}
|
|
549
|
+
return back;
|
|
550
|
+
}
|
|
551
|
+
}, []);
|
|
552
|
+
return React.createElement("div", {
|
|
553
|
+
style: {
|
|
554
|
+
background: '#fff',
|
|
555
|
+
padding: 20
|
|
556
|
+
}
|
|
557
|
+
}, propsList.map((props, i) => React.createElement(Table, Object.assign({}, props, {
|
|
558
|
+
key: i,
|
|
559
|
+
style: style,
|
|
560
|
+
pagination: {
|
|
561
|
+
pageSize: 5
|
|
562
|
+
}
|
|
563
|
+
}))));
|
|
564
|
+
};
|
|
565
|
+
All.args = {};
|
|
566
|
+
/*
|
|
567
|
+
bordered 边框 2
|
|
568
|
+
striped 斑马线 2
|
|
569
|
+
shadowed 阴影 2
|
|
570
|
+
showCellBorders 单元格边框 2
|
|
571
|
+
scroll 滚动 3
|
|
572
|
+
fixed 是否固定 3
|
|
573
|
+
size: 3
|
|
574
|
+
*/
|