stk-table-vue 0.6.9 → 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,555 +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
- &.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
- /*最大宽度不超过列宽*/
492
- display: inline-flex;
493
- align-items: center;
494
- }
495
-
496
- .table-header-title {
497
- overflow: hidden;
498
- // align-self: flex-start;
499
- }
500
-
501
- .table-header-sorter {
502
- flex-shrink: 0;
503
- margin-left: 4px;
504
- width: 16px;
505
- height: 16px;
506
- display: none;
507
-
508
- .arrow-up,
509
- .arrow-down {
510
- fill: var(--sort-arrow-color);
511
- }
512
- }
513
-
514
- .table-header-resizer {
515
- position: absolute;
516
- top: 0;
517
- bottom: 0;
518
- cursor: col-resize;
519
- width: var(--resize-handle-width);
520
-
521
- &.left {
522
- left: 0;
523
- }
524
-
525
- &.right {
526
- right: 0;
527
- }
528
- }
529
-
530
- /* td inherit tr bgc*/
531
- .highlight-row {
532
- animation: stk-table-dim var(--highlight-duration);
533
- /* 必须分开写,否则var(step(x))不兼容旧浏览器*/
534
- animation-timing-function: var(--highlight-timing-function);
535
- }
536
-
537
- .stk-table-no-data {
538
- background-color: var(--table-bgc);
539
- line-height: var(--row-height);
540
- text-align: center;
541
- font-size: 14px;
542
- position: sticky;
543
- left: 0px;
544
- border-right: var(--border-width) solid var(--border-color);
545
- border-bottom: var(--border-width) solid var(--border-color);
546
- display: flex;
547
- flex-direction: column;
548
- align-items: center;
549
- justify-content: center;
550
-
551
- &.no-data-full {
552
- flex: 1;
553
- }
554
- }
555
- }
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
+ }