stk-table-vue 0.6.8 → 0.6.10

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.
@@ -1,557 +1,553 @@
1
- /**高亮渐暗 */
2
- @keyframes stk-table-dim {
3
- from {
4
- background-color: var(--highlight-color);
5
- }
6
- }
7
-
8
- .stk-table {
9
- /* contain: strict;*/
10
- --row-height: 28px;
11
- --header-row-height: var(--row-height);
12
- --cell-padding-y: 0;
13
- --cell-padding-x: 8px;
14
- --resize-handle-width: 4px;
15
- --border-color: #e8e8f4;
16
- --border-width: 1px;
17
- --td-bgc: #fff;
18
- --td-hover-color: #71a2fd;
19
- --td-active-color: #386ccc;
20
- --th-bgc: #fafafc;
21
- --th-color: #272841;
22
- --tr-active-bgc: rgb(230, 247, 255);
23
- --tr-hover-bgc: rgba(230, 247, 255, 0.7);
24
- --bg-border-top: linear-gradient(180deg, var(--border-color) var(--border-width), transparent var(--border-width));
25
- --bg-border-right: linear-gradient(270deg, var(--border-color) var(--border-width), transparent var(--border-width));
26
- --bg-border-bottom: linear-gradient(0deg, var(--border-color) var(--border-width), transparent var(--border-width));
27
- --bg-border-left: linear-gradient(90deg, var(--border-color) var(--border-width), transparent var(--border-width));
28
- --highlight-color: #71a2fd;
29
- --highlight-duration: 2s;
30
- --highlight-timing-function: linear;
31
- /* 斑马纹颜色*/
32
- --stripe-bgc: #fafafc;
33
-
34
- --sort-arrow-color: #757699;
35
- --sort-arrow-hover-color: #8f90b5;
36
- --sort-arrow-active-color: #1b63d9;
37
- --sort-arrow-active-sub-color: #cbcbe1;
38
- /** 列宽拖动指示器颜色 */
39
- --col-resize-indicator-color: #87879c;
40
-
41
- /** 固定列阴影颜色 */
42
- --fixed-col-shadow-color-from: rgba(0, 0, 0, 0.1);
43
- --fixed-col-shadow-color-to: rgba(0, 0, 0, 0);
44
-
45
- /** 拖动行hover背景 */
46
- --drag-handle-hover-color: #d0d1e0;
47
-
48
- position: relative;
49
- overflow: auto;
50
- display: flex;
51
- flex-direction: column;
52
- box-sizing: border-box;
53
-
54
- /**深色模式 */
55
- &.dark {
56
- --th-bgc: #202029;
57
- --th-color: #C0C0D1;
58
- --td-bgc: #1b1b24;
59
- --td-hover-color: #70a6ff;
60
- --td-active-color: #386ccc;
61
- --border-color: #292933;
62
- --tr-active-bgc: #283f63;
63
- --tr-hover-bgc: #1a2b46;
64
- --table-bgc: #1b1b24;
65
- /* 不能用rgba,因为固定列时,会变成半透明*/
66
- --highlight-color: #1e4c99;
67
-
68
- --stripe-bgc: #202029;
69
-
70
- --sort-arrow-color: #5d6064;
71
- --sort-arrow-hover-color: #727782;
72
- --sort-arrow-active-color: #d0d1d2;
73
- --sort-arrow-active-sub-color: #5d6064;
74
-
75
- --col-resize-indicator-color: #5d6064;
76
-
77
- --fixed-col-shadow-color-from: rgba(135, 135, 156, 0.1);
78
- --fixed-col-shadow-color-to: rgba(135, 135, 156, 0);
79
-
80
- --drag-handle-hover-color: #5d6064;
81
-
82
- /* background-color: var(--table-bgc); */
83
- /* ⭐这里加background-color会导致表格出滚动白屏*/
84
- color: #d1d1e0;
85
- }
86
-
87
-
88
- &.headless {
89
- &.border {
90
- border-top: 1px solid var(--border-color);
91
- background-image: var(--bg-border-right), var(--bg-border-bottom);
92
- }
93
- }
94
-
95
- /* 调整列宽的话,表格宽度应当自适应 */
96
- &.col-resizable {
97
- .stk-table-main {
98
- width: fit-content;
99
- min-width: min-content;
100
- }
101
- }
102
-
103
- /** 调整列宽的时候不要触发th事件。否则会导致触发表头点击排序 */
104
- &.is-col-resizing {
105
- th {
106
- pointer-events: none;
107
- }
108
- }
109
-
110
- &.border {
111
- /**
112
- * border-left: 此方案用于减少cell 中border-left 的css选择。同时利于多级表头border-left问题。利于横向滚动border-left
113
- * - box-shadow inset 方案不生效,且占用属性。
114
- * - outline 方案绘制在图形外
115
- * - 绝对定位元素。需要根据滚动条位置动态计算。不合适。
116
- * - sticky 定位方案需要占用位置。高度为0。
117
- */
118
- border-left: 1px solid var(--border-color);
119
- /* 下面border用于表格内容不满高度时,绘制表格边界线 */
120
- background-image: var(--bg-border-top), var(--bg-border-right), var(--bg-border-bottom);
121
-
122
- th,
123
- td {
124
- background-image: var(--bg-border-right), var(--bg-border-bottom);
125
- }
126
-
127
- thead tr:first-child th {
128
- background-image: var(--bg-border-top), var(--bg-border-right), var(--bg-border-bottom);
129
- }
130
- }
131
-
132
- &.border-h {
133
- border-left: none;
134
- --bg-border-right: linear-gradient(transparent, transparent);
135
- --bg-border-left: linear-gradient(transparent, transparent);
136
- }
137
-
138
- &.border-v {
139
- --bg-border-bottom: linear-gradient(transparent, transparent);
140
- --bg-border-top: linear-gradient(transparent, transparent);
141
- }
142
-
143
-
144
-
145
- &.border-body-v {
146
- tbody {
147
- --bg-border-bottom: linear-gradient(transparent, transparent);
148
- }
149
- }
150
-
151
- /* 斑马纹*/
152
- &.stripe {
153
- &:not(.vt-on) .stk-tbody-main tr:nth-child(even) {
154
- background-color: var(--stripe-bgc);
155
- }
156
-
157
- &.vt-on .stk-tbody-main tr:nth-child(odd) {
158
- background-color: var(--stripe-bgc);
159
- }
160
-
161
- &.row-hover .stk-tbody-main tr:hover {
162
- background-color: var(--tr-hover-bgc);
163
- }
164
-
165
- &.row-active .stk-tbody-main tr.active {
166
- background-color: var(--tr-active-bgc);
167
- }
168
- }
169
-
170
-
171
- /** more weight for custom row background*/
172
- &.row-hover .stk-tbody-main tr:hover {
173
- background-color: var(--tr-hover-bgc);
174
- }
175
-
176
-
177
- &.row-active .stk-tbody-main tr.active {
178
- background-color: var(--tr-active-bgc);
179
- }
180
-
181
- /* 单元格悬浮 */
182
- &.cell-hover tbody td:hover {
183
- box-shadow: inset 0 0 0 2px var(--td-hover-color);
184
- }
185
-
186
- /* 单元格高亮 */
187
- &.cell-active tbody td.active {
188
- box-shadow: inset 0 0 0 2px var(--td-active-color);
189
- }
190
-
191
- /* td 溢出*/
192
- &.text-overflow {
193
- .table-cell-wrapper {
194
- white-space: nowrap;
195
- overflow: hidden;
196
- text-overflow: ellipsis;
197
- }
198
- }
199
-
200
- /* th 溢出*/
201
- &.header-text-overflow {
202
- .table-header-cell-wrapper {
203
- white-space: nowrap;
204
- overflow: hidden;
205
- }
206
-
207
- .table-header-title {
208
- text-overflow: ellipsis;
209
- overflow: hidden;
210
- }
211
- }
212
-
213
- /**虚拟滚动模式 */
214
- &.virtual {
215
-
216
- /* 为不影响布局,表头行高要定死*/
217
- .table-header-cell-wrapper {
218
- overflow: hidden;
219
- max-height: calc(var(--header-row-height) * var(--row-span, 1));
220
-
221
- .table-header-title {
222
- max-height: inherit;
223
- }
224
- }
225
-
226
- tbody td {
227
- height: var(--row-height);
228
-
229
- .table-cell-wrapper {
230
- max-height: var(--row-height);
231
- overflow: hidden;
232
- }
233
- }
234
-
235
- .padding-top-tr td {
236
- height: 0;
237
- }
238
-
239
- .expand-cell .table-cell-wrapper {
240
- white-space: nowrap;
241
- }
242
-
243
- // .expanded-row .table-cell-wrapper{
244
- // overflow: auto;
245
- // }
246
- }
247
-
248
- &.auto-row-height {
249
-
250
- tbody td {
251
- height: unset;
252
-
253
- .table-cell-wrapper {
254
- max-height: unset;
255
- overflow: initial;
256
- }
257
- }
258
-
259
- }
260
-
261
- &.fixed-relative-mode {
262
- th {
263
- position: relative;
264
- }
265
-
266
- .fixed-cell--active {
267
- position: relative;
268
- }
269
- }
270
-
271
- th,
272
- td {
273
- font-size: 14px;
274
- box-sizing: border-box;
275
- padding: var(--cell-padding-y) var(--cell-padding-x);
276
- }
277
-
278
- th {
279
- color: var(--th-color);
280
- background-color: inherit;
281
- /**
282
- * 保证向上滚动时,表头不被遮挡。
283
- * z-index:2 为防止固定列阴影重叠。
284
- */
285
- z-index: 2;
286
- position: sticky;
287
-
288
- &.sortable {
289
- cursor: pointer;
290
- }
291
-
292
- &:not(.sorter-desc):not(.sorter-asc):hover .table-header-sorter {
293
- .arrow-up {
294
- fill: var(--sort-arrow-hover-color);
295
- }
296
-
297
- .arrow-down {
298
- fill: var(--sort-arrow-hover-color);
299
- }
300
- }
301
-
302
- &.sorter-desc .table-header-sorter {
303
- display: inline;
304
-
305
- .arrow-up {
306
- fill: var(--sort-arrow-active-sub-color);
307
- }
308
-
309
- .arrow-down {
310
- fill: var(--sort-arrow-active-color);
311
- }
312
- }
313
-
314
- &.sorter-asc .table-header-sorter {
315
- display: inline;
316
-
317
- .arrow-up {
318
- fill: var(--sort-arrow-active-color);
319
- }
320
-
321
- .arrow-down {
322
- fill: var(--sort-arrow-active-sub-color);
323
- }
324
- }
325
-
326
- }
327
-
328
- thead tr {
329
- background-color: var(--th-bgc);
330
- height: var(--header-row-height);
331
- }
332
-
333
-
334
- tbody tr {
335
- background-color: var(--td-bgc);
336
- height: var(--row-height);
337
- }
338
-
339
-
340
- .vt-x-left,
341
- .vt-x-right {
342
- padding: 0;
343
- background: none;
344
- pointer-events: none;
345
- }
346
-
347
-
348
- /** 列宽调整指示器 */
349
- .column-resize-indicator {
350
- width: 0;
351
- height: 100%;
352
- border-left: 2px solid var(--col-resize-indicator-color);
353
- position: absolute;
354
- z-index: 10;
355
- display: none;
356
- pointer-events: none;
357
- }
358
-
359
- .stk-table-main {
360
- border-spacing: 0;
361
- border-collapse: separate;
362
- width: fit-content;
363
- /* 不加会导致width 超过100%时为100%,行hover高亮会断开*/
364
- min-width: 100%;
365
-
366
- &.fixed-mode {
367
- table-layout: fixed;
368
- min-width: min-content;
369
- }
370
- }
371
-
372
- .fixed-cell {
373
- background-color: inherit;
374
- /* 防止横向滚动后透明*/
375
- }
376
-
377
- .highlight-cell {
378
- animation: stk-table-dim var(--highlight-duration);
379
- animation-timing-function: var(--highlight-timing-function);
380
- /* 必须分开些,否则var(step(x))不兼容旧浏览器*/
381
- }
382
-
383
- .seq-column {
384
- text-align: center;
385
- }
386
-
387
- .expand-cell {
388
- cursor: pointer;
389
-
390
- .expanded-cell-wrapper {
391
- &::before {
392
- content: '';
393
- display: inline-block;
394
- margin: 0 2px;
395
- width: 0;
396
- height: 0;
397
- border-left: 5px solid #757699;
398
- border-top: 4px solid transparent;
399
- border-bottom: 4px solid transparent;
400
- transition: transform 0.2s ease;
401
- }
402
-
403
- >span {
404
- margin-left: var(--cell-padding-x)
405
- }
406
- }
407
-
408
- &.expanded {
409
- .table-cell-wrapper::before {
410
- transform: rotate(90deg);
411
- }
412
- }
413
- }
414
-
415
- .drag-row-cell {
416
- .table-cell-wrapper {
417
- display: inline-flex;
418
- align-items: center;
419
- }
420
-
421
- .drag-row-handle {
422
- cursor: grab;
423
- border-radius: 4px;
424
-
425
- &:hover {
426
- background-color: var(--drag-handle-hover-color);
427
- }
428
-
429
- &:active {
430
- cursor: grabbing;
431
- }
432
-
433
- >svg {
434
- vertical-align: -2px;
435
- }
436
- }
437
- }
438
-
439
- .tr-dragging {
440
- opacity: .5;
441
- }
442
-
443
- .tr-dragging-over {
444
- background-color: var(--tr-hover-bgc);
445
- }
446
-
447
- /*固定列阴影-左*/
448
- .fixed-cell--left {
449
- --shadow-rotate: 90deg;
450
-
451
- &.fixed-cell--shadow::after {
452
- right: -10px;
453
- }
454
- }
455
-
456
- /*固定列阴影-右*/
457
- .fixed-cell--right {
458
- --shadow-rotate: -90deg;
459
-
460
- &.fixed-cell--shadow::after {
461
- left: -10px;
462
- }
463
- }
464
-
465
- /*固定列阴影*/
466
- .fixed-cell--shadow::after {
467
- content: '';
468
- width: 10px;
469
- height: 100%;
470
- top: 0px;
471
- position: absolute;
472
- pointer-events: none;
473
- background-image: linear-gradient(var(--shadow-rotate), var(--fixed-col-shadow-color-from), var(--fixed-col-shadow-color-to)),
474
- }
475
-
476
- .fixed-cell--active {
477
- position: sticky;
478
- }
479
-
480
- th.fixed-cell--active {
481
- z-index: 3;
482
- }
483
-
484
- td.fixed-cell--active {
485
- z-index: 1;
486
- }
487
-
488
- .table-header-cell-wrapper {
489
- max-width: 100%;
490
- /*最大宽度不超过列宽*/
491
- display: inline-flex;
492
- align-items: center;
493
- }
494
-
495
- .table-header-title {
496
- overflow: hidden;
497
- // align-self: flex-start;
498
- }
499
-
500
- .table-header-sorter {
501
- flex-shrink: 0;
502
- margin-left: 4px;
503
- width: 16px;
504
- height: 16px;
505
- display: none;
506
-
507
- .arrow-up,
508
- .arrow-down {
509
- fill: var(--sort-arrow-color);
510
- }
511
- }
512
-
513
- .table-header-resizer {
514
- position: absolute;
515
- top: 0;
516
- bottom: 0;
517
- cursor: col-resize;
518
- width: var(--resize-handle-width);
519
-
520
- &.left {
521
- left: 0;
522
- }
523
-
524
- &.right {
525
- right: 0;
526
- }
527
- }
528
-
529
- /* td inherit tr bgc*/
530
- .highlight-row {
531
- animation: stk-table-dim var(--highlight-duration);
532
- /* 必须分开写,否则var(step(x))不兼容旧浏览器*/
533
- animation-timing-function: var(--highlight-timing-function);
534
- }
535
-
536
- .stk-table-no-data {
537
- background-color: var(--table-bgc);
538
- line-height: var(--row-height);
539
- text-align: center;
540
- font-size: 14px;
541
- position: sticky;
542
- left: 0px;
543
- border-right: var(--border-width) solid var(--border-color);
544
- border-bottom: var(--border-width) solid var(--border-color);
545
- display: flex;
546
- flex-direction: column;
547
- align-items: center;
548
- justify-content: center;
549
-
550
- &.no-data-full {
551
- flex: 1;
552
- }
553
- }
554
-
555
-
556
-
557
- }
1
+ /**高亮渐暗 */
2
+ @keyframes stk-table-dim {
3
+ from {
4
+ background-color: var(--highlight-color);
5
+ }
6
+ }
7
+
8
+ .stk-table {
9
+ /* contain: strict;*/
10
+ --row-height: 28px;
11
+ --header-row-height: var(--row-height);
12
+ --cell-padding-y: 0;
13
+ --cell-padding-x: 8px;
14
+ --resize-handle-width: 4px;
15
+ --border-color: #e8e8f4;
16
+ --border-width: 1px;
17
+ --td-bgc: #fff;
18
+ --td-hover-color: #71a2fd;
19
+ --td-active-color: #386ccc;
20
+ --th-bgc: #f1f1f9;
21
+ --th-color: #272841;
22
+ --tr-active-bgc: rgb(230, 247, 255);
23
+ --tr-hover-bgc: rgba(230, 247, 255, 0.7);
24
+ --bg-border-top: linear-gradient(180deg, var(--border-color) var(--border-width), transparent var(--border-width));
25
+ --bg-border-right: linear-gradient(270deg, var(--border-color) var(--border-width), transparent var(--border-width));
26
+ --bg-border-bottom: linear-gradient(0deg, var(--border-color) var(--border-width), transparent var(--border-width));
27
+ --bg-border-left: linear-gradient(90deg, var(--border-color) var(--border-width), transparent var(--border-width));
28
+ --highlight-color: #71a2fd;
29
+ --highlight-duration: 2s;
30
+ --highlight-timing-function: linear;
31
+ /* 斑马纹颜色*/
32
+ --stripe-bgc: #fafafc;
33
+
34
+ --sort-arrow-color: #757699;
35
+ --sort-arrow-hover-color: #8f90b5;
36
+ --sort-arrow-active-color: #1b63d9;
37
+ --sort-arrow-active-sub-color: #cbcbe1;
38
+ /** 列宽拖动指示器颜色 */
39
+ --col-resize-indicator-color: #87879c;
40
+
41
+ /** 固定列阴影颜色 */
42
+ --fixed-col-shadow-color-from: rgba(0, 0, 0, 0.1);
43
+ --fixed-col-shadow-color-to: rgba(0, 0, 0, 0);
44
+
45
+ /** 拖动行hover背景 */
46
+ --drag-handle-hover-color: #d0d1e0;
47
+
48
+ position: relative;
49
+ overflow: auto;
50
+ display: flex;
51
+ flex-direction: column;
52
+ box-sizing: border-box;
53
+
54
+ /**深色模式 */
55
+ &.dark {
56
+ --th-bgc: #202029;
57
+ --th-color: #c0c0d1;
58
+ --td-bgc: #1b1b24;
59
+ --td-hover-color: #70a6ff;
60
+ --td-active-color: #386ccc;
61
+ --border-color: #292933;
62
+ --tr-active-bgc: #283f63;
63
+ --tr-hover-bgc: #1a2b46;
64
+ --table-bgc: #1b1b24;
65
+ /* 不能用rgba,因为固定列时,会变成半透明*/
66
+ --highlight-color: #1e4c99;
67
+
68
+ --stripe-bgc: #202029;
69
+
70
+ --sort-arrow-color: #5d6064;
71
+ --sort-arrow-hover-color: #727782;
72
+ --sort-arrow-active-color: #d0d1d2;
73
+ --sort-arrow-active-sub-color: #5d6064;
74
+
75
+ --col-resize-indicator-color: #5d6064;
76
+
77
+ --fixed-col-shadow-color-from: rgba(135, 135, 156, 0.1);
78
+ --fixed-col-shadow-color-to: rgba(135, 135, 156, 0);
79
+
80
+ --drag-handle-hover-color: #5d6064;
81
+
82
+ /* background-color: var(--table-bgc); */
83
+ /* ⭐这里加background-color会导致表格出滚动白屏*/
84
+ color: #d1d1e0;
85
+ }
86
+
87
+ &.headless {
88
+ &.border {
89
+ border-top: 1px solid var(--border-color);
90
+ background-image: var(--bg-border-right), var(--bg-border-bottom);
91
+ }
92
+ }
93
+
94
+ /* 调整列宽的话,表格宽度应当自适应 */
95
+ &.col-resizable {
96
+ .stk-table-main {
97
+ width: fit-content;
98
+ min-width: min-content;
99
+ }
100
+ }
101
+
102
+ /** 调整列宽的时候不要触发th事件。否则会导致触发表头点击排序 */
103
+ &.is-col-resizing {
104
+ th {
105
+ pointer-events: none;
106
+ }
107
+ }
108
+
109
+ &.border {
110
+ /**
111
+ * border-left: 此方案用于减少cell 中border-left 的css选择。同时利于多级表头border-left问题。利于横向滚动border-left
112
+ * - box-shadow inset 方案不生效,且占用属性。
113
+ * - outline 方案绘制在图形外
114
+ * - 绝对定位元素。需要根据滚动条位置动态计算。不合适。
115
+ * - sticky 定位方案需要占用位置。高度为0。
116
+ */
117
+ border-left: 1px solid var(--border-color);
118
+ /* 下面border用于表格内容不满高度时,绘制表格边界线 */
119
+ background-image: var(--bg-border-top), var(--bg-border-right), var(--bg-border-bottom);
120
+
121
+ th,
122
+ td {
123
+ background-image: var(--bg-border-right), var(--bg-border-bottom);
124
+ }
125
+
126
+ thead tr:first-child th {
127
+ background-image: var(--bg-border-top), var(--bg-border-right), var(--bg-border-bottom);
128
+ }
129
+ }
130
+
131
+ &.border-h {
132
+ border-left: none;
133
+ --bg-border-right: linear-gradient(transparent, transparent);
134
+ --bg-border-left: linear-gradient(transparent, transparent);
135
+ }
136
+
137
+ &.border-v {
138
+ --bg-border-bottom: linear-gradient(transparent, transparent);
139
+ --bg-border-top: linear-gradient(transparent, transparent);
140
+ }
141
+
142
+ &.border-body-v {
143
+ tbody {
144
+ --bg-border-bottom: linear-gradient(transparent, transparent);
145
+ }
146
+ }
147
+
148
+ /* 斑马纹*/
149
+ &.stripe {
150
+ &:not(.vt-on) .stk-tbody-main tr:nth-child(even) {
151
+ background-color: var(--stripe-bgc);
152
+ }
153
+
154
+ &.vt-on .stk-tbody-main tr:nth-child(odd) {
155
+ background-color: var(--stripe-bgc);
156
+ }
157
+
158
+ &.row-hover .stk-tbody-main tr:hover {
159
+ background-color: var(--tr-hover-bgc);
160
+ }
161
+
162
+ &.row-active .stk-tbody-main tr.active {
163
+ background-color: var(--tr-active-bgc);
164
+ }
165
+ }
166
+
167
+ /** more weight for custom row background*/
168
+ &.row-hover .stk-tbody-main tr:hover {
169
+ background-color: var(--tr-hover-bgc);
170
+ }
171
+
172
+ &.row-active .stk-tbody-main tr.active {
173
+ background-color: var(--tr-active-bgc);
174
+ }
175
+
176
+ /* 单元格悬浮 */
177
+ &.cell-hover tbody td:hover {
178
+ box-shadow: inset 0 0 0 2px var(--td-hover-color);
179
+ }
180
+
181
+ /* 单元格高亮 */
182
+ &.cell-active tbody td.active {
183
+ box-shadow: inset 0 0 0 2px var(--td-active-color);
184
+ }
185
+
186
+ /* td 溢出*/
187
+ &.text-overflow {
188
+ .table-cell-wrapper {
189
+ white-space: nowrap;
190
+ overflow: hidden;
191
+ text-overflow: ellipsis;
192
+ }
193
+ }
194
+
195
+ /* th 溢出*/
196
+ &.header-text-overflow {
197
+ .table-header-cell-wrapper {
198
+ white-space: nowrap;
199
+ overflow: hidden;
200
+ }
201
+
202
+ .table-header-title {
203
+ text-overflow: ellipsis;
204
+ overflow: hidden;
205
+ }
206
+ }
207
+
208
+ /**虚拟滚动模式 */
209
+ &.virtual {
210
+ /* 为不影响布局,表头行高要定死*/
211
+ .table-header-cell-wrapper {
212
+ overflow: hidden;
213
+ max-height: calc(var(--header-row-height) * var(--row-span, 1));
214
+
215
+ .table-header-title {
216
+ max-height: inherit;
217
+ }
218
+ }
219
+
220
+ tbody td {
221
+ height: var(--row-height);
222
+
223
+ .table-cell-wrapper {
224
+ max-height: var(--row-height);
225
+ overflow: hidden;
226
+ }
227
+ }
228
+
229
+ .padding-top-tr td {
230
+ height: 0;
231
+ }
232
+
233
+ .expand-cell .table-cell-wrapper {
234
+ white-space: nowrap;
235
+ }
236
+
237
+ // .expanded-row .table-cell-wrapper{
238
+ // overflow: auto;
239
+ // }
240
+ }
241
+
242
+ &.auto-row-height {
243
+ tbody td {
244
+ height: unset;
245
+
246
+ .table-cell-wrapper {
247
+ max-height: unset;
248
+ overflow: initial;
249
+ }
250
+ }
251
+ }
252
+
253
+ &.fixed-relative-mode {
254
+ th {
255
+ position: relative;
256
+ }
257
+
258
+ .fixed-cell--active {
259
+ position: relative;
260
+ }
261
+ }
262
+
263
+ &.scroll-row-by-row {
264
+ .stk-table-main {
265
+ position: sticky;
266
+ top: 0;
267
+ }
268
+ }
269
+
270
+ .row-by-row-table-height {
271
+ width: 1px;
272
+ position: absolute;
273
+ left: 0;
274
+ }
275
+
276
+ th,
277
+ td {
278
+ font-size: 14px;
279
+ box-sizing: border-box;
280
+ padding: var(--cell-padding-y) var(--cell-padding-x);
281
+ }
282
+
283
+ th {
284
+ color: var(--th-color);
285
+ background-color: inherit;
286
+ /**
287
+ * 保证向上滚动时,表头不被遮挡。
288
+ * z-index:2 为防止固定列阴影重叠。
289
+ */
290
+ z-index: 2;
291
+ position: sticky;
292
+
293
+ &.sortable {
294
+ cursor: pointer;
295
+ }
296
+
297
+ &:not(.sorter-desc):not(.sorter-asc):hover .table-header-sorter {
298
+ .arrow-up {
299
+ fill: var(--sort-arrow-hover-color);
300
+ }
301
+
302
+ .arrow-down {
303
+ fill: var(--sort-arrow-hover-color);
304
+ }
305
+ }
306
+
307
+ &.sorter-desc .table-header-sorter {
308
+ display: inline;
309
+
310
+ .arrow-up {
311
+ fill: var(--sort-arrow-active-sub-color);
312
+ }
313
+
314
+ .arrow-down {
315
+ fill: var(--sort-arrow-active-color);
316
+ }
317
+ }
318
+
319
+ &.sorter-asc .table-header-sorter {
320
+ display: inline;
321
+
322
+ .arrow-up {
323
+ fill: var(--sort-arrow-active-color);
324
+ }
325
+
326
+ .arrow-down {
327
+ fill: var(--sort-arrow-active-sub-color);
328
+ }
329
+ }
330
+ }
331
+
332
+ thead tr {
333
+ background-color: var(--th-bgc);
334
+ height: var(--header-row-height);
335
+ }
336
+
337
+ tbody tr {
338
+ background-color: var(--td-bgc);
339
+ height: var(--row-height);
340
+ }
341
+
342
+ .vt-x-left,
343
+ .vt-x-right {
344
+ padding: 0;
345
+ background: none;
346
+ pointer-events: none;
347
+ }
348
+
349
+ /** 列宽调整指示器 */
350
+ .column-resize-indicator {
351
+ width: 0;
352
+ height: 100%;
353
+ border-left: 2px solid var(--col-resize-indicator-color);
354
+ position: absolute;
355
+ z-index: 10;
356
+ display: none;
357
+ pointer-events: none;
358
+ }
359
+
360
+ .stk-table-main {
361
+ border-spacing: 0;
362
+ border-collapse: separate;
363
+ width: fit-content;
364
+ /* 不加会导致width 超过100%时为100%,行hover高亮会断开*/
365
+ min-width: 100%;
366
+
367
+ &.fixed-mode {
368
+ table-layout: fixed;
369
+ min-width: min-content;
370
+ }
371
+ }
372
+
373
+ .fixed-cell {
374
+ background-color: inherit;
375
+ /* 防止横向滚动后透明*/
376
+ }
377
+
378
+ .highlight-cell {
379
+ animation: stk-table-dim var(--highlight-duration);
380
+ animation-timing-function: var(--highlight-timing-function);
381
+ /* 必须分开些,否则var(step(x))不兼容旧浏览器*/
382
+ }
383
+
384
+ .seq-column {
385
+ text-align: center;
386
+ }
387
+
388
+ .expand-cell {
389
+ cursor: pointer;
390
+
391
+ .expanded-cell-wrapper {
392
+ &::before {
393
+ content: '';
394
+ display: inline-block;
395
+ margin: 0 2px;
396
+ width: 0;
397
+ height: 0;
398
+ border-left: 5px solid #757699;
399
+ border-top: 4px solid transparent;
400
+ border-bottom: 4px solid transparent;
401
+ transition: transform 0.2s ease;
402
+ }
403
+
404
+ > span {
405
+ margin-left: var(--cell-padding-x);
406
+ }
407
+ }
408
+
409
+ &.expanded {
410
+ .table-cell-wrapper::before {
411
+ transform: rotate(90deg);
412
+ }
413
+ }
414
+ }
415
+
416
+ .drag-row-cell {
417
+ .table-cell-wrapper {
418
+ display: inline-flex;
419
+ align-items: center;
420
+ }
421
+
422
+ .drag-row-handle {
423
+ cursor: grab;
424
+ border-radius: 4px;
425
+
426
+ &:hover {
427
+ background-color: var(--drag-handle-hover-color);
428
+ }
429
+
430
+ &:active {
431
+ cursor: grabbing;
432
+ }
433
+
434
+ > svg {
435
+ vertical-align: -2px;
436
+ }
437
+ }
438
+ }
439
+
440
+ .tr-dragging {
441
+ opacity: 0.5;
442
+ }
443
+
444
+ .tr-dragging-over {
445
+ background-color: var(--tr-hover-bgc);
446
+ }
447
+
448
+ /*固定列阴影-左*/
449
+ .fixed-cell--left {
450
+ --shadow-rotate: 90deg;
451
+
452
+ &.fixed-cell--shadow::after {
453
+ right: -10px;
454
+ }
455
+ }
456
+
457
+ /*固定列阴影-右*/
458
+ .fixed-cell--right {
459
+ --shadow-rotate: -90deg;
460
+
461
+ &.fixed-cell--shadow::after {
462
+ left: -10px;
463
+ }
464
+ }
465
+
466
+ /*固定列阴影*/
467
+ .fixed-cell--shadow::after {
468
+ content: '';
469
+ width: 10px;
470
+ height: 100%;
471
+ top: 0px;
472
+ position: absolute;
473
+ pointer-events: none;
474
+ background-image: linear-gradient(var(--shadow-rotate), var(--fixed-col-shadow-color-from), var(--fixed-col-shadow-color-to));
475
+ }
476
+
477
+ .fixed-cell--active {
478
+ position: sticky;
479
+ }
480
+
481
+ th.fixed-cell--active {
482
+ z-index: 3;
483
+ }
484
+
485
+ td.fixed-cell--active {
486
+ z-index: 1;
487
+ }
488
+
489
+ .table-header-cell-wrapper {
490
+ max-width: 100%;
491
+ display: inline-flex;
492
+ align-items: center;
493
+ }
494
+
495
+ .table-header-title {
496
+ overflow: hidden;
497
+ }
498
+
499
+ .table-header-sorter {
500
+ flex-shrink: 0;
501
+ margin-left: 4px;
502
+ width: 16px;
503
+ height: 16px;
504
+ display: none;
505
+
506
+ .arrow-up,
507
+ .arrow-down {
508
+ fill: var(--sort-arrow-color);
509
+ }
510
+ }
511
+
512
+ .table-header-resizer {
513
+ position: absolute;
514
+ top: 0;
515
+ bottom: 0;
516
+ cursor: col-resize;
517
+ width: var(--resize-handle-width);
518
+
519
+ &.left {
520
+ left: 0;
521
+ }
522
+
523
+ &.right {
524
+ right: 0;
525
+ }
526
+ }
527
+
528
+ /* td inherit tr bgc*/
529
+ .highlight-row {
530
+ animation: stk-table-dim var(--highlight-duration);
531
+ /* 必须分开写,否则var(step(x))不兼容旧浏览器*/
532
+ animation-timing-function: var(--highlight-timing-function);
533
+ }
534
+
535
+ .stk-table-no-data {
536
+ background-color: var(--table-bgc);
537
+ line-height: var(--row-height);
538
+ text-align: center;
539
+ font-size: 14px;
540
+ position: sticky;
541
+ left: 0px;
542
+ border-right: var(--border-width) solid var(--border-color);
543
+ border-bottom: var(--border-width) solid var(--border-color);
544
+ display: flex;
545
+ flex-direction: column;
546
+ align-items: center;
547
+ justify-content: center;
548
+
549
+ &.no-data-full {
550
+ flex: 1;
551
+ }
552
+ }
553
+ }