tntd 3.0.0-beta.14 → 3.0.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.
@@ -276,12 +276,11 @@
276
276
  }
277
277
 
278
278
  &-footer {
279
- position: relative;
279
+ // position: relative;
280
280
  padding: @table-padding-vertical @table-padding-horizontal;
281
281
  color: @table-footer-color;
282
282
  background: @table-footer-bg;
283
283
  border-top: @border-width-base @border-style-base @border-color-split;
284
- border-radius: 0 0 @table-border-radius-base @table-border-radius-base;
285
284
  &::before {
286
285
  position: absolute;
287
286
  top: -1px;
@@ -293,26 +292,25 @@
293
292
  }
294
293
  }
295
294
 
296
- &.@{table-prefix-cls}-bordered &-footer {
297
- border: @border-width-base @border-style-base @border-color-split;
298
- }
295
+ // &.@{table-prefix-cls}-bordered &-footer {
296
+ // border: @border-width-base @border-style-base @border-color-split;
297
+ // }
299
298
 
300
299
  &-title {
301
- position: relative;
302
- top: 1px;
300
+ // position: relative;
301
+ // top: 1px;
303
302
  padding: @table-padding-vertical 0;
304
- border-radius: @table-border-radius-base @table-border-radius-base 0 0;
305
303
  }
306
304
 
307
305
  &.@{table-prefix-cls}-bordered &-title {
308
306
  padding-right: @table-padding-horizontal;
309
307
  padding-left: @table-padding-horizontal;
310
- border: @border-width-base @border-style-base @border-color-split;
308
+ border-bottom: @border-width-base @border-style-base @border-color-split;
311
309
  }
312
310
 
313
311
  &-title + &-content {
314
- position: relative;
315
- border-radius: @table-border-radius-base @table-border-radius-base 0 0;
312
+ // position: relative;
313
+ // border-radius: @table-border-radius-base @table-border-radius-base 0 0;
316
314
 
317
315
  .@{table-prefix-cls}-bordered & {
318
316
  &,
@@ -397,41 +395,26 @@
397
395
  }
398
396
 
399
397
  &-bordered {
400
- .@{table-prefix-cls}-header > table,
401
- .@{table-prefix-cls}-body > table,
402
- .@{table-prefix-cls}-fixed-left table,
403
- .@{table-prefix-cls}-fixed-right table {
404
- border: @border-width-base @border-style-base @border-color-split;
405
- }
406
-
407
- .@{table-prefix-cls}-fixed-left table {
408
- .@{table-prefix-cls}-hide-cell-borders & {
409
- border-right: 0;
410
- }
411
- }
412
-
413
- .@{table-prefix-cls}-fixed-right table {
414
- .@{table-prefix-cls}-hide-cell-borders & {
415
- border-left: 0;
416
- }
417
- }
418
-
419
- .@{table-prefix-cls}-body > table {
420
- border-radius: @border-radius-base;
421
- }
398
+ border: @border-width-base @border-style-base @border-color-split;
399
+ border-radius: @border-radius-base;
400
+ overflow: hidden;
401
+ // .@{table-prefix-cls}-header > table,
402
+ // .@{table-prefix-cls}-body > table,
403
+ // .@{table-prefix-cls}-fixed-left table,
404
+ // .@{table-prefix-cls}-fixed-right table {
405
+ // border: @border-width-base @border-style-base @border-color-split;
406
+ // border-right: 0;
407
+ // border-bottom: 0;
408
+ // }
422
409
 
423
410
  &.@{table-prefix-cls}-empty {
424
411
  .@{table-prefix-cls}-body > table {
425
412
  border-radius: @border-radius-base @border-radius-base 0 0;
426
413
  }
427
414
  .@{table-prefix-cls}-placeholder {
428
- border: @border-width-base @border-style-base @border-color-split;
429
- border-top: none;
430
- border-radius: 0 0 @border-radius-base @border-radius-base;
431
- .@{table-prefix-cls}-has-footer & {
432
- border-bottom: none;
433
- border-radius: 0;
434
- }
415
+ // border-right: @border-width-base @border-style-base @border-color-split;
416
+ // border-left: @border-width-base @border-style-base @border-color-split;
417
+ border-bottom: 0;
435
418
  }
436
419
  }
437
420
 
@@ -459,24 +442,27 @@
459
442
  .@{table-prefix-cls}-tbody > tr > td {
460
443
  border-right: @border-width-base @border-style-base @border-color-split;
461
444
  &:last-child {
462
- border-right: none;
445
+ border-right: 0;
463
446
  }
464
447
  }
465
- .@{table-prefix-cls}-tbody > tr:last-child {
466
- & > td {
467
- border-bottom: none;
468
- &:first-child {
469
- border-bottom-left-radius: @border-radius-base;
448
+ .@{table-prefix-cls}-fixed-left {
449
+ .@{table-prefix-cls}-thead > tr > th,
450
+ .@{table-prefix-cls}-tbody > tr > td {
451
+ &:last-child {
452
+ border-right: @border-width-base @border-style-base @border-color-split;
470
453
  }
471
454
  }
472
455
  }
473
-
474
- .@{table-prefix-cls}-tbody > tr:last-child > td:last-child {
475
- border-bottom-right-radius: @border-radius-base;
476
- .@{table-prefix-cls}-has-footer & {
477
- border-bottom-right-radius: 0;
456
+ .@{table-prefix-cls}-content:has(.@{table-prefix-cls}-fixed-right) .@{table-prefix-cls}-scroll {
457
+ .@{table-prefix-cls}-thead > tr > th {
458
+ &:last-child {
459
+ border-right: @border-width-base @border-style-base @border-color-split;
460
+ }
478
461
  }
479
462
  }
463
+ .@{table-prefix-cls}-tbody > tr:last-child > td {
464
+ border-bottom: 0;
465
+ }
480
466
  }
481
467
 
482
468
  &-placeholder {
@@ -488,12 +474,9 @@
488
474
  font-size: @font-size-base;
489
475
  text-align: center;
490
476
  background: @component-background;
491
- // border-top: @border-width-base @border-style-base @border-color-split;
492
- // border-bottom: @border-width-base @border-style-base @border-color-split;
493
- border-radius: @border-radius-base;
494
- .@{table-prefix-cls}-has-footer & {
495
- border-radius: 0;
496
- }
477
+ border-top: @border-width-base @border-style-base @border-color-split;
478
+ border-bottom: @border-width-base @border-style-base @border-color-split;
479
+ // border-radius: 0 0 @border-radius-base @border-radius-base;
497
480
  }
498
481
 
499
482
  &-pagination.@{ant-prefix}-pagination {
@@ -24,9 +24,9 @@
24
24
  .@{table-prefix-cls}-small {
25
25
  border: none;
26
26
 
27
- > .ant-table-content .ant-table-row:last-child td {
27
+ // > .ant-table-content .ant-table-row:last-child td {
28
28
  // border-bottom: @border-width-base @border-style-base @border-color-split;
29
- }
29
+ // }
30
30
  }
31
31
  }
32
32
 
@@ -52,9 +52,9 @@
52
52
  }
53
53
 
54
54
  &.@{table-prefix-cls}-hide-cell-borders {
55
- .@{table-prefix-cls}-thead > tr > th:not(:last-child),
56
- .@{table-prefix-cls}-tbody > tr > td:not(:last-child) {
57
- border-right: none;
55
+ .@{table-prefix-cls}-thead > tr > th,
56
+ .@{table-prefix-cls}-tbody > tr > td {
57
+ border-right: none !important;
58
58
  }
59
59
  }
60
60
  &.@{table-prefix-cls}-hide-cell-borders {
@@ -97,6 +97,7 @@
97
97
  .@{table-prefix-cls}-placeholder {
98
98
  padding-top: @table-padding-horizontal;
99
99
  padding-bottom: @table-padding-horizontal;
100
+ border-bottom: 0;
100
101
  }
101
102
 
102
103
  // 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
+ */