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