stk-table-vue 1.2.4 → 1.2.6

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.
Files changed (68) hide show
  1. package/README.md +194 -194
  2. package/lib/{Dropdown-D_9cB0rD.js → Dropdown-BAANgg_5.js} +2 -2
  3. package/lib/{StkTable-CVcmlZi9.js → StkTable-CGcxwpdb.js} +22 -6
  4. package/lib/src/StkTable/StkTable.vue.d.ts +18 -4
  5. package/lib/src/StkTable/types/index.d.ts +4 -1
  6. package/lib/src/StkTable/useVirtualScroll.d.ts +6 -1
  7. package/lib/stk-table-vue.js +3 -3
  8. package/lib/style.css +1 -1
  9. package/package.json +93 -93
  10. package/src/StkTable/StkTable.vue +2362 -2338
  11. package/src/StkTable/components/DragHandle.vue +9 -9
  12. package/src/StkTable/components/SortIcon.vue +6 -6
  13. package/src/StkTable/components/TreeNodeCell.vue +19 -19
  14. package/src/StkTable/components/TriangleIcon.vue +3 -3
  15. package/src/StkTable/const.ts +50 -50
  16. package/src/StkTable/custom-cells/ChangeCell/ChangeCell.less +34 -34
  17. package/src/StkTable/custom-cells/ChangeCell/createChangeCell.ts +90 -90
  18. package/src/StkTable/custom-cells/ChangeCell/index.ts +4 -4
  19. package/src/StkTable/custom-cells/CheckboxCell/CheckboxCell.less +14 -14
  20. package/src/StkTable/custom-cells/CheckboxCell/CheckboxCell.vue +56 -56
  21. package/src/StkTable/custom-cells/CheckboxCell/createCheckboxCell.ts +146 -146
  22. package/src/StkTable/custom-cells/CheckboxCell/index.ts +5 -5
  23. package/src/StkTable/custom-cells/FilterCell/Dropdown/index.ts +16 -16
  24. package/src/StkTable/custom-cells/FilterCell/Dropdown/index.vue +186 -186
  25. package/src/StkTable/custom-cells/FilterCell/Filter.less +118 -118
  26. package/src/StkTable/custom-cells/FilterCell/Filter.vue +66 -66
  27. package/src/StkTable/custom-cells/FilterCell/createFilterCell.ts +120 -120
  28. package/src/StkTable/custom-cells/FilterCell/index.ts +6 -6
  29. package/src/StkTable/custom-cells/FilterCell/types.ts +43 -43
  30. package/src/StkTable/custom-cells/NumberCell/createNumberCell.ts +43 -43
  31. package/src/StkTable/custom-cells/NumberCell/index.ts +2 -2
  32. package/src/StkTable/custom-cells/utils/formatNumber.ts +137 -137
  33. package/src/StkTable/features/const.ts +1 -1
  34. package/src/StkTable/features/index.ts +1 -1
  35. package/src/StkTable/features/useAreaSelection.ts +1240 -1239
  36. package/src/StkTable/index.ts +20 -20
  37. package/src/StkTable/mergeCellsCache.ts +69 -69
  38. package/src/StkTable/registerFeature.ts +40 -40
  39. package/src/StkTable/style.less +791 -791
  40. package/src/StkTable/types/highlightDimOptions.ts +28 -28
  41. package/src/StkTable/types/index.ts +503 -500
  42. package/src/StkTable/useAutoResize.ts +87 -87
  43. package/src/StkTable/useColResize.ts +202 -202
  44. package/src/StkTable/useFixedCol.ts +168 -168
  45. package/src/StkTable/useFixedStyle.ts +75 -75
  46. package/src/StkTable/useGetFixedColPosition.ts +63 -63
  47. package/src/StkTable/useHighlight.ts +270 -270
  48. package/src/StkTable/useIndexResolver.ts +29 -29
  49. package/src/StkTable/useKeyboardArrowScroll.ts +114 -114
  50. package/src/StkTable/useMaxRowSpan.ts +60 -60
  51. package/src/StkTable/useMergeCells.ts +541 -541
  52. package/src/StkTable/useRowExpand.ts +81 -81
  53. package/src/StkTable/useScrollRowByRow.ts +96 -96
  54. package/src/StkTable/useScrollbar.ts +177 -177
  55. package/src/StkTable/useSorter.ts +267 -267
  56. package/src/StkTable/useTableColumns.ts +142 -142
  57. package/src/StkTable/useThDrag.ts +94 -94
  58. package/src/StkTable/useTrDrag.ts +100 -100
  59. package/src/StkTable/useTree.ts +253 -253
  60. package/src/StkTable/useVirtualScroll.ts +1032 -1025
  61. package/src/StkTable/useWheeling.ts +23 -23
  62. package/src/StkTable/utils/constRefUtils.ts +29 -29
  63. package/src/StkTable/utils/index.ts +331 -331
  64. package/src/StkTable/utils/rowHeightFenwickTree.ts +74 -74
  65. package/src/StkTable/utils/useTriggerRef.ts +33 -33
  66. package/src/VirtualTree.vue +622 -622
  67. package/src/VirtualTreeSelect.vue +367 -367
  68. package/src/vite-env.d.ts +10 -10
@@ -1,791 +1,791 @@
1
- /**高亮渐暗 */
2
- @keyframes stk-table-dim {
3
- from {
4
- background-color: var(--highlight-color);
5
- }
6
- }
7
-
8
- .stk-table {
9
- --row-height: 28px;
10
- --header-row-height: var(--row-height);
11
- --footer-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: hsl(207, 90%, 70%);
19
- --td-active-color: hsl(207, 90%, 54%);
20
- --th-bgc: #f1f1f9;
21
- --tf-bgc: #f1f1f9;
22
- --th-color: #272841;
23
- --tr-active-bgc: rgb(230, 247, 255);
24
- --tr-hover-bgc: #e6f7ff;
25
- --bg-border-top: linear-gradient(180deg, var(--border-color) var(--border-width), transparent var(--border-width));
26
- --bg-border-right: linear-gradient(270deg, var(--border-color) var(--border-width), transparent var(--border-width));
27
- --bg-border-bottom: linear-gradient(0deg, var(--border-color) var(--border-width), transparent var(--border-width));
28
- --bg-border-left: linear-gradient(90deg, var(--border-color) var(--border-width), transparent var(--border-width));
29
- --highlight-color: #71a2fd;
30
- --highlight-duration: 2s;
31
- --highlight-timing-function: linear;
32
- /* 斑马纹颜色*/
33
- --stripe-bgc: #fafafc;
34
-
35
- --sort-arrow-color: #757699;
36
- --sort-arrow-hover-color: #8f90b5;
37
- --sort-arrow-active-color: #1b63d9;
38
- --sort-arrow-active-sub-color: #cbcbe1;
39
-
40
- --fold-icon-color: #757699;
41
- --fold-icon-hover-color: #8f90b5;
42
- /** 列宽拖动指示器颜色 */
43
- --col-resize-indicator-color: #87879c;
44
-
45
- /** 固定列阴影颜色 */
46
- --fixed-col-shadow-color-from: rgba(0, 0, 0, 0.1);
47
- --fixed-col-shadow-color-to: rgba(0, 0, 0, 0);
48
-
49
- /** 拖动行hover背景 */
50
- --drag-handle-hover-color: #d0d1e0;
51
-
52
- /** 自定义滚动条颜色 */
53
- --sb-thumb-color: #c1c1d7;
54
- --sb-thumb-hover-color: #a8a8c1;
55
-
56
- /** 单元格选区 */
57
- --cs-bgc: #d3eafd;
58
- --cs-bc: #2196f3;
59
- /** 行拖拽选区 */
60
- --rs-bgc: #e8f3ff;
61
- --rs-bc: #2a7ee4;
62
-
63
-
64
- // contain: layout paint size;
65
- position: relative;
66
- overflow: auto;
67
- will-change: scroll-position;
68
- display: flex;
69
- flex-direction: column;
70
- box-sizing: border-box;
71
- outline: none;
72
-
73
- &:hover .stk-sb-thumb {
74
- opacity: 0.7;
75
- }
76
-
77
- /**深色模式 */
78
- &.dark {
79
- --th-bgc: #202029;
80
- --tf-bgc: #202029;
81
- --th-color: #c0c0d1;
82
- --td-bgc: #1b1b24;
83
- --td-hover-color: hsl(219, 59%, 60%);
84
- --td-active-color: hsl(219, 59%, 51%);
85
- --border-color: #292933;
86
- --tr-active-bgc: #283f63;
87
- --tr-hover-bgc: #1a2b46;
88
- --table-bgc: #1b1b24;
89
- /* 不能用rgba,因为固定列时,会变成半透明*/
90
- --highlight-color: #1e4c99;
91
-
92
- --stripe-bgc: #202029;
93
-
94
- --sort-arrow-color: #5d6064;
95
- --sort-arrow-hover-color: #727782;
96
- --sort-arrow-active-color: #d0d1d2;
97
- --sort-arrow-active-sub-color: #5d6064;
98
-
99
- --fold-icon-color: #5d6064;
100
- --fold-icon-hover-color: #727782;
101
-
102
- --col-resize-indicator-color: #5d6064;
103
-
104
- --fixed-col-shadow-color-from: rgba(135, 135, 156, 0.1);
105
- --fixed-col-shadow-color-to: rgba(135, 135, 156, 0);
106
-
107
- --drag-handle-hover-color: #5d6064;
108
-
109
- --sb-thumb-color: rgba(93, 96, 100, 0.9);
110
- --sb-thumb-hover-color: rgb(114, 119, 130);
111
-
112
- --cs-bgc: #2a3f6b;
113
- --cs-bc: #386ccc;
114
- --rs-bgc: #223555;
115
- --rs-bc: #4b8ef0;
116
-
117
- /* background-color: var(--table-bgc); */
118
- /* ⭐这里加background-color会导致表格出滚动白屏*/
119
- color: #d1d1e0;
120
-
121
- td[data-cs-s] {
122
- background-blend-mode: normal;
123
- }
124
- }
125
-
126
- &.scrollbar-on {
127
- overflow: hidden;
128
- // scrollbar-width: none;
129
- // &::-webkit-scrollbar{
130
- // display: none;
131
- // }
132
- }
133
-
134
- /** 移动端禁用自定义滚动条,恢复原生触摸滚动 */
135
- @media (hover: none) and (pointer: coarse) {
136
- &.scrollbar-on {
137
- overflow: auto;
138
- }
139
-
140
- .stk-sb-thumb {
141
- display: none !important;
142
- }
143
- }
144
-
145
- &.headless {
146
- &.bordered {
147
- border-top: 1px solid var(--border-color);
148
- background-image: var(--bg-border-right), var(--bg-border-bottom);
149
- }
150
- }
151
-
152
- /* 调整列宽的话,表格宽度应当自适应 */
153
- &.col-resizable {
154
- .stk-table-main {
155
- width: fit-content;
156
- min-width: min-content;
157
- flex: none;
158
- }
159
- }
160
-
161
- /** 调整列宽的时候不要触发th事件。否则会导致触发表头点击排序 */
162
- &.is-col-resizing {
163
- th {
164
- pointer-events: none;
165
- }
166
- }
167
-
168
- &.bordered {
169
- /**
170
- * border-left: 此方案用于减少cell 中border-left 的css选择。同时利于多级表头border-left问题。利于横向滚动border-left
171
- * - box-shadow inset 方案不生效,且占用属性。
172
- * - outline 方案绘制在图形外
173
- * - 绝对定位元素。需要根据滚动条位置动态计算。不合适。
174
- * - sticky 定位方案需要占用位置。高度为0。
175
- */
176
- border-left: var(--border-width) solid var(--border-color);
177
- /* 下面border用于表格内容不满高度时,绘制表格边界线 */
178
- background-image: var(--bg-border-top), var(--bg-border-right), var(--bg-border-bottom);
179
-
180
- th,
181
- td {
182
- background-image: var(--bg-border-right), var(--bg-border-bottom);
183
- }
184
-
185
- thead tr:first-child th {
186
- background-image: var(--bg-border-top), var(--bg-border-right), var(--bg-border-bottom);
187
- }
188
-
189
- /**
190
- * 单元格的左边框由左侧相邻单元格的 border-right 提供。
191
- * 右固定列吸附遮挡内容后,与左侧单元格不再相邻,因此需要自行绘制 border-left。
192
- */
193
- th.fixed-cell--border-left,
194
- td.fixed-cell--border-left {
195
- background-image: var(--bg-border-left), var(--bg-border-right), var(--bg-border-bottom);
196
- }
197
-
198
- thead tr:first-child th.fixed-cell--border-left {
199
- background-image: var(--bg-border-left), var(--bg-border-top), var(--bg-border-right), var(--bg-border-bottom);
200
- }
201
- }
202
-
203
- &.bordered-h {
204
- border-left: none;
205
- --bg-border-right: linear-gradient(transparent, transparent);
206
- --bg-border-left: linear-gradient(transparent, transparent);
207
- }
208
-
209
- &.bordered-v {
210
- --bg-border-bottom: linear-gradient(transparent, transparent);
211
- --bg-border-top: linear-gradient(transparent, transparent);
212
- }
213
-
214
- &.bordered-body-v {
215
- tbody {
216
- --bg-border-bottom: linear-gradient(transparent, transparent);
217
- }
218
- }
219
-
220
- &.bordered-body-h {
221
- tbody {
222
- --bg-border-right: linear-gradient(transparent, transparent);
223
- --bg-border-left: linear-gradient(transparent, transparent);
224
- }
225
- }
226
-
227
- &.stripe {
228
- &:not(.vt-on) .stk-tbody-main tr:nth-child(even) {
229
- background-color: var(--stripe-bgc);
230
- }
231
-
232
- &.vt-on .stk-tbody-main tr:nth-child(odd) {
233
- background-color: var(--stripe-bgc);
234
- }
235
-
236
- &.area-selection .stk-tbody-main tr[data-rs-s] {
237
- background-color: var(--rs-bgc);
238
- }
239
-
240
- &.row-hover .stk-tbody-main tr:hover {
241
- background-color: var(--tr-hover-bgc);
242
- }
243
-
244
- &.row-active .stk-tbody-main tr.active {
245
- background-color: var(--tr-active-bgc);
246
- }
247
- }
248
-
249
- /** more weight for custom row background*/
250
- &.row-hover .stk-tbody-main tr:hover {
251
- background-color: var(--tr-hover-bgc);
252
- }
253
-
254
- &.row-active .stk-tbody-main tr.active {
255
- background-color: var(--tr-active-bgc);
256
- }
257
-
258
- .stk-tbody-main tr[data-rs-s] {
259
- background-color: var(--rs-bgc);
260
- }
261
-
262
- .stk-tbody-main tr.row-range-start td {
263
- box-shadow: inset 0 2px 0 0 var(--rs-bc);
264
- }
265
-
266
- .stk-tbody-main tr.row-range-end td {
267
- box-shadow: inset 0 -2px 0 0 var(--rs-bc);
268
- }
269
-
270
- /* 单元格悬浮 */
271
- &.cell-hover tbody td:hover {
272
- box-shadow: inset 0 0 0 2px var(--td-hover-color);
273
- }
274
-
275
- /* 单元格高亮 */
276
- &.cell-active tbody td.active {
277
- box-shadow: inset 0 0 0 2px var(--td-active-color);
278
- }
279
-
280
- /* 单元格拖选中禁止选中文字 */
281
- &.is-area-selecting {
282
- user-select: none;
283
- }
284
-
285
- &.is-row-drag-selecting {
286
- user-select: none;
287
- }
288
-
289
- /* td 溢出*/
290
- &.text-overflow {
291
- .table-cell-wrapper {
292
- white-space: nowrap;
293
- overflow: hidden;
294
- text-overflow: ellipsis;
295
- outline: none;
296
- }
297
- }
298
-
299
- /* th 溢出*/
300
- &.header-text-overflow {
301
- .table-header-cell-wrapper {
302
- white-space: nowrap;
303
- overflow: hidden;
304
- }
305
-
306
- .table-header-title {
307
- text-overflow: ellipsis;
308
- overflow: hidden;
309
- }
310
- }
311
-
312
- /**虚拟滚动模式 */
313
- &.virtual {
314
-
315
- /* 为不影响布局,表头行高要定死*/
316
- .table-header-cell-wrapper {
317
- overflow: hidden;
318
- max-height: calc(var(--header-row-height) * var(--row-span, 1));
319
-
320
- .table-header-title {
321
- max-height: inherit;
322
- }
323
- }
324
-
325
- tbody td {
326
- height: var(--row-height);
327
-
328
- .table-cell-wrapper {
329
- max-height: var(--row-height);
330
- overflow: hidden;
331
- }
332
- }
333
-
334
- .padding-top-tr td {
335
- height: 0;
336
- }
337
-
338
- .expand-cell .table-cell-wrapper {
339
- white-space: nowrap;
340
- }
341
-
342
- // .expanded-row .table-cell-wrapper{
343
- // overflow: auto;
344
- // }
345
- }
346
-
347
- &.auto-row-height {
348
- tbody td {
349
- height: unset;
350
-
351
- .table-cell-wrapper {
352
- max-height: unset;
353
- overflow: initial;
354
- }
355
- }
356
- }
357
-
358
- &.fixed-relative-mode {
359
- th {
360
- position: relative;
361
- }
362
-
363
- .fixed-cell--active {
364
- position: relative;
365
- }
366
- }
367
-
368
- &.scroll-row-by-row {
369
- .stk-table-scroll-container {
370
- position: sticky;
371
- top: 0;
372
- }
373
- }
374
-
375
- &.exp-scroll-y {
376
- .stk-tbody-main {
377
- will-change: transform;
378
- }
379
- }
380
-
381
- .row-by-row-table-height {
382
- width: 1px;
383
- flex-shrink: 0;
384
- position: absolute;
385
- left: 0;
386
- top: 0;
387
- }
388
-
389
- th,
390
- td {
391
- font-size: 14px;
392
- box-sizing: border-box;
393
- padding: var(--cell-padding-y) var(--cell-padding-x);
394
- width: var(--cw);
395
- min-width: var(--cw);
396
- max-width: var(--cw);
397
- }
398
-
399
- th {
400
- color: var(--th-color);
401
- background-color: inherit;
402
- /**
403
- * 保证向上滚动时,表头不被遮挡。
404
- * z-index:2 为防止固定列阴影重叠。
405
- */
406
- z-index: 2;
407
- position: sticky;
408
- top: 0;
409
-
410
- &.sortable {
411
- cursor: pointer;
412
- }
413
-
414
- &:not(.sorter-desc):not(.sorter-asc):hover .table-header-sorter {
415
- .arrow-up {
416
- fill: var(--sort-arrow-hover-color);
417
- }
418
-
419
- .arrow-down {
420
- fill: var(--sort-arrow-hover-color);
421
- }
422
- }
423
-
424
- &.sorter-desc .table-header-sorter {
425
- display: inline;
426
-
427
- .arrow-up {
428
- fill: var(--sort-arrow-active-sub-color);
429
- }
430
-
431
- .arrow-down {
432
- fill: var(--sort-arrow-active-color);
433
- }
434
- }
435
-
436
- &.sorter-asc .table-header-sorter {
437
- display: inline;
438
-
439
- .arrow-up {
440
- fill: var(--sort-arrow-active-color);
441
- }
442
-
443
- .arrow-down {
444
- fill: var(--sort-arrow-active-sub-color);
445
- }
446
- }
447
- }
448
-
449
- thead tr {
450
- background-color: var(--th-bgc);
451
- height: var(--header-row-height);
452
- }
453
-
454
- .stk-footer {
455
- position: sticky;
456
- bottom: 0;
457
- z-index: 2;
458
- tr {
459
- background-color: var(--tf-bgc);
460
- height: var(--footer-row-height);
461
- td {
462
- background-color: inherit;
463
- }
464
- }
465
- }
466
-
467
- tbody tr {
468
- background-color: var(--td-bgc);
469
- height: var(--row-height);
470
- }
471
-
472
- .text-l {
473
- text-align: left;
474
- }
475
-
476
- .text-c {
477
- text-align: center;
478
- }
479
-
480
- .text-r {
481
- text-align: right;
482
- }
483
-
484
- .vt-x-left,
485
- .vt-x-right,
486
- .vt-x-spacer {
487
- background-image:none !important;
488
- padding: 0 !important;
489
- }
490
-
491
- /** 列宽调整指示器 */
492
- .column-resize-indicator {
493
- width: 0;
494
- height: 100%;
495
- border-left: 2px solid var(--col-resize-indicator-color);
496
- position: absolute;
497
- z-index: 10;
498
- display: none;
499
- pointer-events: none;
500
- }
501
-
502
- .stk-table-main {
503
- border-spacing: 0;
504
- border-collapse: separate;
505
- flex: 1;
506
-
507
- &.fixed-mode {
508
- table-layout: fixed;
509
- flex: none;
510
- }
511
- }
512
-
513
- .table-cell-wrapper {
514
- outline: none;
515
- }
516
-
517
- .fixed-cell {
518
- background-color: inherit;
519
- }
520
-
521
- /* 单元格选区 - 使用 inset box-shadow 实现边框,不占用内部空间 */
522
- /* 通过 data-* 属性(而非 class)应用,避免 Vue 对合并单元格 className 的重新 patch 抹掉选区样式 */
523
- td[data-cs-s] {
524
- background-blend-mode: multiply;
525
- background-color: var(--cs-bgc);
526
- box-shadow:
527
- inset 0 var(--cs-t, 0) 0 0 var(--cs-bc),
528
- inset 0 var(--cs-b, 0) 0 0 var(--cs-bc),
529
- inset var(--cs-l, 0) 0 0 0 var(--cs-bc),
530
- inset var(--cs-r, 0) 0 0 0 var(--cs-bc);
531
- }
532
-
533
- td[data-cs-t] {
534
- --cs-t: 2px;
535
- }
536
-
537
- /* 选中的合并单元格在 hover/active 时,选区背景优先于 hover/active 背景 */
538
- /* 合并单元格的 td 会被动态添加 cell-hover/cell-active class,与 td[data-cs-s] 同详细度, */
539
- /* 会因源码顺序覆盖选区背景;此处提高详细度确保选区背景不被覆盖 */
540
- td[data-cs-s].cell-hover,
541
- td[data-cs-s].cell-active {
542
- background-color: var(--cs-bgc);
543
- }
544
-
545
- td[data-cs-b] {
546
- --cs-b: -2px;
547
- }
548
-
549
- td[data-cs-l] {
550
- --cs-l: 2px;
551
- }
552
-
553
- td[data-cs-r] {
554
- --cs-r: -2px;
555
- }
556
-
557
- .highlight-cell {
558
- animation-name: stk-table-dim;
559
- animation-duration: var(--highlight-duration);
560
- animation-timing-function: var(--highlight-timing-function);
561
- /* 必须分开写,否则var(step(x))不兼容旧浏览器*/
562
- }
563
-
564
- .stk-table-scroll-container {
565
- display: flex;
566
- }
567
-
568
- .seq-column {
569
- text-align: center;
570
- }
571
-
572
- .drag-row-cell {
573
- .table-cell-wrapper {
574
- display: inline-flex;
575
- align-items: center;
576
- vertical-align: middle;
577
- }
578
- }
579
-
580
- .drag-row-handle {
581
- cursor: grab;
582
- border-radius: 4px;
583
-
584
- &:hover {
585
- background-color: var(--drag-handle-hover-color);
586
- }
587
-
588
- &:active {
589
- cursor: grabbing;
590
- }
591
-
592
- >svg {
593
- vertical-align: -2px;
594
- }
595
- }
596
-
597
- .tr-dragging {
598
- opacity: 0.5;
599
- }
600
-
601
- .tr-dragging-over {
602
- background-color: var(--tr-hover-bgc);
603
- }
604
-
605
- /*固定列阴影-左*/
606
- .fixed-cell--left {
607
- --shadow-rotate: 90deg;
608
-
609
- &.fixed-cell--shadow::after {
610
- right: -10px;
611
- }
612
- }
613
-
614
- /*固定列阴影-右*/
615
- .fixed-cell--right {
616
- --shadow-rotate: -90deg;
617
-
618
- &.fixed-cell--shadow::after {
619
- left: -10px;
620
- }
621
- }
622
-
623
- /*固定列阴影*/
624
- .fixed-cell--shadow::after {
625
- content: '';
626
- width: 10px;
627
- height: 100%;
628
- top: 0px;
629
- position: absolute;
630
- pointer-events: none;
631
- background-image: linear-gradient(var(--shadow-rotate), var(--fixed-col-shadow-color-from), var(--fixed-col-shadow-color-to));
632
- }
633
-
634
- .fixed-cell--active {
635
- position: sticky;
636
- }
637
-
638
- th.fixed-cell--active {
639
- z-index: 3;
640
- }
641
-
642
- td.fixed-cell--active {
643
- z-index: 1;
644
- }
645
-
646
- tfoot td.fixed-cell--active,
647
- .stk-footer td.fixed-cell--active {
648
- z-index: 2;
649
- }
650
-
651
- .table-header-cell-wrapper {
652
- max-width: 100%;
653
- display: inline-flex;
654
- align-items: center;
655
- }
656
-
657
- .table-header-title {
658
- overflow: hidden;
659
- }
660
-
661
- .table-header-sorter {
662
- flex-shrink: 0;
663
- margin-left: 4px;
664
- width: 16px;
665
- height: 16px;
666
- display: none;
667
-
668
- .arrow-up,
669
- .arrow-down {
670
- fill: var(--sort-arrow-color);
671
- }
672
- }
673
-
674
- .table-header-resizer {
675
- position: absolute;
676
- top: 0;
677
- bottom: 0;
678
- cursor: col-resize;
679
- width: var(--resize-handle-width);
680
-
681
- &.left {
682
- left: 0;
683
- }
684
-
685
- &.right {
686
- right: 0;
687
- }
688
- }
689
-
690
- /* td inherit tr bgc*/
691
- .highlight-row {
692
- animation-name: stk-table-dim;
693
- animation-duration: var(--highlight-duration);
694
- /* 必须分开写,否则var(step(x))不兼容旧浏览器*/
695
- animation-timing-function: var(--highlight-timing-function);
696
- }
697
-
698
- .stk-table-no-data {
699
- background-color: var(--table-bgc);
700
- line-height: var(--row-height);
701
- text-align: center;
702
- font-size: 14px;
703
- position: sticky;
704
- left: 0px;
705
- border-right: var(--border-width) solid var(--border-color);
706
- border-bottom: var(--border-width) solid var(--border-color);
707
- display: flex;
708
- flex-direction: column;
709
- align-items: center;
710
- justify-content: center;
711
-
712
- &.no-data-full {
713
- flex: 1;
714
- }
715
- }
716
-
717
- .expanded,
718
- .tree-expanded {
719
- .stk-fold-icon::before {
720
- transform: rotate(90deg);
721
- }
722
- }
723
-
724
- .stk-fold-icon {
725
- display: inline-flex;
726
- width: 16px;
727
- height: 16px;
728
- cursor: pointer;
729
- align-items: center;
730
-
731
- &::before {
732
- content: '';
733
- display: block;
734
- margin: 0 2px;
735
- width: 0;
736
- height: 0;
737
- border-left: 5px solid var(--fold-icon-color);
738
- border-top: 4px solid transparent;
739
- border-bottom: 4px solid transparent;
740
- transition: transform 0.2s ease;
741
- }
742
-
743
- &:hover::before {
744
- border-left: 5px solid var(--fold-icon-hover-color);
745
- }
746
- }
747
-
748
- td.cell-hover {
749
- background-color: var(--tr-hover-bgc);
750
- }
751
-
752
- td.cell-active {
753
- background-color: var(--tr-active-bgc);
754
- }
755
-
756
- .stk-sb-thumb {
757
- z-index: 100;
758
- position: sticky;
759
- background-color: var(--sb-thumb-color);
760
- transition: opacity 0.5s ease;
761
- user-select: none;
762
- opacity: 0;
763
- flex-shrink: 0;
764
- will-change: transform;
765
-
766
- &:hover {
767
- background-color: var(--sb-thumb-hover-color);
768
- }
769
-
770
- &:active {
771
- opacity: 1;
772
- background-color: var(--sb-thumb-hover-color);
773
- }
774
-
775
- &.vertical {
776
- margin-left: auto;
777
- top: 0;
778
- right: 0;
779
- border-radius: calc(var(--sb-width) / 2);
780
- width: var(--sb-width);
781
- }
782
-
783
- &.horizontal {
784
- margin-top: auto;
785
- bottom: 0;
786
- left: 0;
787
- border-radius: calc(var(--sb-height) / 2);
788
- height: var(--sb-height);
789
- }
790
- }
791
- }
1
+ /**高亮渐暗 */
2
+ @keyframes stk-table-dim {
3
+ from {
4
+ background-color: var(--highlight-color);
5
+ }
6
+ }
7
+
8
+ .stk-table {
9
+ --row-height: 28px;
10
+ --header-row-height: var(--row-height);
11
+ --footer-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: hsl(207, 90%, 70%);
19
+ --td-active-color: hsl(207, 90%, 54%);
20
+ --th-bgc: #f1f1f9;
21
+ --tf-bgc: #f1f1f9;
22
+ --th-color: #272841;
23
+ --tr-active-bgc: rgb(230, 247, 255);
24
+ --tr-hover-bgc: #e6f7ff;
25
+ --bg-border-top: linear-gradient(180deg, var(--border-color) var(--border-width), transparent var(--border-width));
26
+ --bg-border-right: linear-gradient(270deg, var(--border-color) var(--border-width), transparent var(--border-width));
27
+ --bg-border-bottom: linear-gradient(0deg, var(--border-color) var(--border-width), transparent var(--border-width));
28
+ --bg-border-left: linear-gradient(90deg, var(--border-color) var(--border-width), transparent var(--border-width));
29
+ --highlight-color: #71a2fd;
30
+ --highlight-duration: 2s;
31
+ --highlight-timing-function: linear;
32
+ /* 斑马纹颜色*/
33
+ --stripe-bgc: #fafafc;
34
+
35
+ --sort-arrow-color: #757699;
36
+ --sort-arrow-hover-color: #8f90b5;
37
+ --sort-arrow-active-color: #1b63d9;
38
+ --sort-arrow-active-sub-color: #cbcbe1;
39
+
40
+ --fold-icon-color: #757699;
41
+ --fold-icon-hover-color: #8f90b5;
42
+ /** 列宽拖动指示器颜色 */
43
+ --col-resize-indicator-color: #87879c;
44
+
45
+ /** 固定列阴影颜色 */
46
+ --fixed-col-shadow-color-from: rgba(0, 0, 0, 0.1);
47
+ --fixed-col-shadow-color-to: rgba(0, 0, 0, 0);
48
+
49
+ /** 拖动行hover背景 */
50
+ --drag-handle-hover-color: #d0d1e0;
51
+
52
+ /** 自定义滚动条颜色 */
53
+ --sb-thumb-color: #c1c1d7;
54
+ --sb-thumb-hover-color: #a8a8c1;
55
+
56
+ /** 单元格选区 */
57
+ --cs-bgc: #d3eafd;
58
+ --cs-bc: #2196f3;
59
+ /** 行拖拽选区 */
60
+ --rs-bgc: #e8f3ff;
61
+ --rs-bc: #2a7ee4;
62
+
63
+
64
+ // contain: layout paint size;
65
+ position: relative;
66
+ overflow: auto;
67
+ will-change: scroll-position;
68
+ display: flex;
69
+ flex-direction: column;
70
+ box-sizing: border-box;
71
+ outline: none;
72
+
73
+ &:hover .stk-sb-thumb {
74
+ opacity: 0.7;
75
+ }
76
+
77
+ /**深色模式 */
78
+ &.dark {
79
+ --th-bgc: #202029;
80
+ --tf-bgc: #202029;
81
+ --th-color: #c0c0d1;
82
+ --td-bgc: #1b1b24;
83
+ --td-hover-color: hsl(219, 59%, 60%);
84
+ --td-active-color: hsl(219, 59%, 51%);
85
+ --border-color: #292933;
86
+ --tr-active-bgc: #283f63;
87
+ --tr-hover-bgc: #1a2b46;
88
+ --table-bgc: #1b1b24;
89
+ /* 不能用rgba,因为固定列时,会变成半透明*/
90
+ --highlight-color: #1e4c99;
91
+
92
+ --stripe-bgc: #202029;
93
+
94
+ --sort-arrow-color: #5d6064;
95
+ --sort-arrow-hover-color: #727782;
96
+ --sort-arrow-active-color: #d0d1d2;
97
+ --sort-arrow-active-sub-color: #5d6064;
98
+
99
+ --fold-icon-color: #5d6064;
100
+ --fold-icon-hover-color: #727782;
101
+
102
+ --col-resize-indicator-color: #5d6064;
103
+
104
+ --fixed-col-shadow-color-from: rgba(135, 135, 156, 0.1);
105
+ --fixed-col-shadow-color-to: rgba(135, 135, 156, 0);
106
+
107
+ --drag-handle-hover-color: #5d6064;
108
+
109
+ --sb-thumb-color: rgba(93, 96, 100, 0.9);
110
+ --sb-thumb-hover-color: rgb(114, 119, 130);
111
+
112
+ --cs-bgc: #2a3f6b;
113
+ --cs-bc: #386ccc;
114
+ --rs-bgc: #223555;
115
+ --rs-bc: #4b8ef0;
116
+
117
+ /* background-color: var(--table-bgc); */
118
+ /* ⭐这里加background-color会导致表格出滚动白屏*/
119
+ color: #d1d1e0;
120
+
121
+ td[data-cs-s] {
122
+ background-blend-mode: normal;
123
+ }
124
+ }
125
+
126
+ &.scrollbar-on {
127
+ overflow: hidden;
128
+ // scrollbar-width: none;
129
+ // &::-webkit-scrollbar{
130
+ // display: none;
131
+ // }
132
+ }
133
+
134
+ /** 移动端禁用自定义滚动条,恢复原生触摸滚动 */
135
+ @media (hover: none) and (pointer: coarse) {
136
+ &.scrollbar-on {
137
+ overflow: auto;
138
+ }
139
+
140
+ .stk-sb-thumb {
141
+ display: none !important;
142
+ }
143
+ }
144
+
145
+ &.headless {
146
+ &.bordered {
147
+ border-top: 1px solid var(--border-color);
148
+ background-image: var(--bg-border-right), var(--bg-border-bottom);
149
+ }
150
+ }
151
+
152
+ /* 调整列宽的话,表格宽度应当自适应 */
153
+ &.col-resizable {
154
+ .stk-table-main {
155
+ width: fit-content;
156
+ min-width: min-content;
157
+ flex: none;
158
+ }
159
+ }
160
+
161
+ /** 调整列宽的时候不要触发th事件。否则会导致触发表头点击排序 */
162
+ &.is-col-resizing {
163
+ th {
164
+ pointer-events: none;
165
+ }
166
+ }
167
+
168
+ &.bordered {
169
+ /**
170
+ * border-left: 此方案用于减少cell 中border-left 的css选择。同时利于多级表头border-left问题。利于横向滚动border-left
171
+ * - box-shadow inset 方案不生效,且占用属性。
172
+ * - outline 方案绘制在图形外
173
+ * - 绝对定位元素。需要根据滚动条位置动态计算。不合适。
174
+ * - sticky 定位方案需要占用位置。高度为0。
175
+ */
176
+ border-left: var(--border-width) solid var(--border-color);
177
+ /* 下面border用于表格内容不满高度时,绘制表格边界线 */
178
+ background-image: var(--bg-border-top), var(--bg-border-right), var(--bg-border-bottom);
179
+
180
+ th,
181
+ td {
182
+ background-image: var(--bg-border-right), var(--bg-border-bottom);
183
+ }
184
+
185
+ thead tr:first-child th {
186
+ background-image: var(--bg-border-top), var(--bg-border-right), var(--bg-border-bottom);
187
+ }
188
+
189
+ /**
190
+ * 单元格的左边框由左侧相邻单元格的 border-right 提供。
191
+ * 右固定列吸附遮挡内容后,与左侧单元格不再相邻,因此需要自行绘制 border-left。
192
+ */
193
+ th.fixed-cell--border-left,
194
+ td.fixed-cell--border-left {
195
+ background-image: var(--bg-border-left), var(--bg-border-right), var(--bg-border-bottom);
196
+ }
197
+
198
+ thead tr:first-child th.fixed-cell--border-left {
199
+ background-image: var(--bg-border-left), var(--bg-border-top), var(--bg-border-right), var(--bg-border-bottom);
200
+ }
201
+ }
202
+
203
+ &.bordered-h {
204
+ border-left: none;
205
+ --bg-border-right: linear-gradient(transparent, transparent);
206
+ --bg-border-left: linear-gradient(transparent, transparent);
207
+ }
208
+
209
+ &.bordered-v {
210
+ --bg-border-bottom: linear-gradient(transparent, transparent);
211
+ --bg-border-top: linear-gradient(transparent, transparent);
212
+ }
213
+
214
+ &.bordered-body-v {
215
+ tbody {
216
+ --bg-border-bottom: linear-gradient(transparent, transparent);
217
+ }
218
+ }
219
+
220
+ &.bordered-body-h {
221
+ tbody {
222
+ --bg-border-right: linear-gradient(transparent, transparent);
223
+ --bg-border-left: linear-gradient(transparent, transparent);
224
+ }
225
+ }
226
+
227
+ &.stripe {
228
+ &:not(.vt-on) .stk-tbody-main tr:nth-child(even) {
229
+ background-color: var(--stripe-bgc);
230
+ }
231
+
232
+ &.vt-on .stk-tbody-main tr:nth-child(odd) {
233
+ background-color: var(--stripe-bgc);
234
+ }
235
+
236
+ &.area-selection .stk-tbody-main tr[data-rs-s] {
237
+ background-color: var(--rs-bgc);
238
+ }
239
+
240
+ &.row-hover .stk-tbody-main tr:hover {
241
+ background-color: var(--tr-hover-bgc);
242
+ }
243
+
244
+ &.row-active .stk-tbody-main tr.active {
245
+ background-color: var(--tr-active-bgc);
246
+ }
247
+ }
248
+
249
+ /** more weight for custom row background*/
250
+ &.row-hover .stk-tbody-main tr:hover {
251
+ background-color: var(--tr-hover-bgc);
252
+ }
253
+
254
+ &.row-active .stk-tbody-main tr.active {
255
+ background-color: var(--tr-active-bgc);
256
+ }
257
+
258
+ .stk-tbody-main tr[data-rs-s] {
259
+ background-color: var(--rs-bgc);
260
+ }
261
+
262
+ .stk-tbody-main tr.row-range-start td {
263
+ box-shadow: inset 0 2px 0 0 var(--rs-bc);
264
+ }
265
+
266
+ .stk-tbody-main tr.row-range-end td {
267
+ box-shadow: inset 0 -2px 0 0 var(--rs-bc);
268
+ }
269
+
270
+ /* 单元格悬浮 */
271
+ &.cell-hover tbody td:hover {
272
+ box-shadow: inset 0 0 0 2px var(--td-hover-color);
273
+ }
274
+
275
+ /* 单元格高亮 */
276
+ &.cell-active tbody td.active {
277
+ box-shadow: inset 0 0 0 2px var(--td-active-color);
278
+ }
279
+
280
+ /* 单元格拖选中禁止选中文字 */
281
+ &.is-area-selecting {
282
+ user-select: none;
283
+ }
284
+
285
+ &.is-row-drag-selecting {
286
+ user-select: none;
287
+ }
288
+
289
+ /* td 溢出*/
290
+ &.text-overflow {
291
+ .table-cell-wrapper {
292
+ white-space: nowrap;
293
+ overflow: hidden;
294
+ text-overflow: ellipsis;
295
+ outline: none;
296
+ }
297
+ }
298
+
299
+ /* th 溢出*/
300
+ &.header-text-overflow {
301
+ .table-header-cell-wrapper {
302
+ white-space: nowrap;
303
+ overflow: hidden;
304
+ }
305
+
306
+ .table-header-title {
307
+ text-overflow: ellipsis;
308
+ overflow: hidden;
309
+ }
310
+ }
311
+
312
+ /**虚拟滚动模式 */
313
+ &.virtual {
314
+
315
+ /* 为不影响布局,表头行高要定死*/
316
+ .table-header-cell-wrapper {
317
+ overflow: hidden;
318
+ max-height: calc(var(--header-row-height) * var(--row-span, 1));
319
+
320
+ .table-header-title {
321
+ max-height: inherit;
322
+ }
323
+ }
324
+
325
+ tbody td {
326
+ height: var(--row-height);
327
+
328
+ .table-cell-wrapper {
329
+ max-height: var(--row-height);
330
+ overflow: hidden;
331
+ }
332
+ }
333
+
334
+ .padding-top-tr td {
335
+ height: 0;
336
+ }
337
+
338
+ .expand-cell .table-cell-wrapper {
339
+ white-space: nowrap;
340
+ }
341
+
342
+ // .expanded-row .table-cell-wrapper{
343
+ // overflow: auto;
344
+ // }
345
+ }
346
+
347
+ &.auto-row-height {
348
+ tbody td {
349
+ height: unset;
350
+
351
+ .table-cell-wrapper {
352
+ max-height: unset;
353
+ overflow: initial;
354
+ }
355
+ }
356
+ }
357
+
358
+ &.fixed-relative-mode {
359
+ th {
360
+ position: relative;
361
+ }
362
+
363
+ .fixed-cell--active {
364
+ position: relative;
365
+ }
366
+ }
367
+
368
+ &.scroll-row-by-row {
369
+ .stk-table-scroll-container {
370
+ position: sticky;
371
+ top: 0;
372
+ }
373
+ }
374
+
375
+ &.exp-scroll-y {
376
+ .stk-tbody-main {
377
+ will-change: transform;
378
+ }
379
+ }
380
+
381
+ .row-by-row-table-height {
382
+ width: 1px;
383
+ flex-shrink: 0;
384
+ position: absolute;
385
+ left: 0;
386
+ top: 0;
387
+ }
388
+
389
+ th,
390
+ td {
391
+ font-size: 14px;
392
+ box-sizing: border-box;
393
+ padding: var(--cell-padding-y) var(--cell-padding-x);
394
+ width: var(--cw);
395
+ min-width: var(--cw);
396
+ max-width: var(--cw);
397
+ }
398
+
399
+ th {
400
+ color: var(--th-color);
401
+ background-color: inherit;
402
+ /**
403
+ * 保证向上滚动时,表头不被遮挡。
404
+ * z-index:2 为防止固定列阴影重叠。
405
+ */
406
+ z-index: 2;
407
+ position: sticky;
408
+ top: 0;
409
+
410
+ &.sortable {
411
+ cursor: pointer;
412
+ }
413
+
414
+ &:not(.sorter-desc):not(.sorter-asc):hover .table-header-sorter {
415
+ .arrow-up {
416
+ fill: var(--sort-arrow-hover-color);
417
+ }
418
+
419
+ .arrow-down {
420
+ fill: var(--sort-arrow-hover-color);
421
+ }
422
+ }
423
+
424
+ &.sorter-desc .table-header-sorter {
425
+ display: inline;
426
+
427
+ .arrow-up {
428
+ fill: var(--sort-arrow-active-sub-color);
429
+ }
430
+
431
+ .arrow-down {
432
+ fill: var(--sort-arrow-active-color);
433
+ }
434
+ }
435
+
436
+ &.sorter-asc .table-header-sorter {
437
+ display: inline;
438
+
439
+ .arrow-up {
440
+ fill: var(--sort-arrow-active-color);
441
+ }
442
+
443
+ .arrow-down {
444
+ fill: var(--sort-arrow-active-sub-color);
445
+ }
446
+ }
447
+ }
448
+
449
+ thead tr {
450
+ background-color: var(--th-bgc);
451
+ height: var(--header-row-height);
452
+ }
453
+
454
+ .stk-footer {
455
+ position: sticky;
456
+ bottom: 0;
457
+ z-index: 2;
458
+ tr {
459
+ background-color: var(--tf-bgc);
460
+ height: var(--footer-row-height);
461
+ td {
462
+ background-color: inherit;
463
+ }
464
+ }
465
+ }
466
+
467
+ tbody tr {
468
+ background-color: var(--td-bgc);
469
+ height: var(--row-height);
470
+ }
471
+
472
+ .text-l {
473
+ text-align: left;
474
+ }
475
+
476
+ .text-c {
477
+ text-align: center;
478
+ }
479
+
480
+ .text-r {
481
+ text-align: right;
482
+ }
483
+
484
+ .vt-x-left,
485
+ .vt-x-right,
486
+ .vt-x-spacer {
487
+ background-image:none !important;
488
+ padding: 0 !important;
489
+ }
490
+
491
+ /** 列宽调整指示器 */
492
+ .column-resize-indicator {
493
+ width: 0;
494
+ height: 100%;
495
+ border-left: 2px solid var(--col-resize-indicator-color);
496
+ position: absolute;
497
+ z-index: 10;
498
+ display: none;
499
+ pointer-events: none;
500
+ }
501
+
502
+ .stk-table-main {
503
+ border-spacing: 0;
504
+ border-collapse: separate;
505
+ flex: 1;
506
+
507
+ &.fixed-mode {
508
+ table-layout: fixed;
509
+ flex: none;
510
+ }
511
+ }
512
+
513
+ .table-cell-wrapper {
514
+ outline: none;
515
+ }
516
+
517
+ .fixed-cell {
518
+ background-color: inherit;
519
+ }
520
+
521
+ /* 单元格选区 - 使用 inset box-shadow 实现边框,不占用内部空间 */
522
+ /* 通过 data-* 属性(而非 class)应用,避免 Vue 对合并单元格 className 的重新 patch 抹掉选区样式 */
523
+ td[data-cs-s] {
524
+ background-blend-mode: multiply;
525
+ background-color: var(--cs-bgc);
526
+ box-shadow:
527
+ inset 0 var(--cs-t, 0) 0 0 var(--cs-bc),
528
+ inset 0 var(--cs-b, 0) 0 0 var(--cs-bc),
529
+ inset var(--cs-l, 0) 0 0 0 var(--cs-bc),
530
+ inset var(--cs-r, 0) 0 0 0 var(--cs-bc);
531
+ }
532
+
533
+ td[data-cs-t] {
534
+ --cs-t: 2px;
535
+ }
536
+
537
+ /* 选中的合并单元格在 hover/active 时,选区背景优先于 hover/active 背景 */
538
+ /* 合并单元格的 td 会被动态添加 cell-hover/cell-active class,与 td[data-cs-s] 同详细度, */
539
+ /* 会因源码顺序覆盖选区背景;此处提高详细度确保选区背景不被覆盖 */
540
+ td[data-cs-s].cell-hover,
541
+ td[data-cs-s].cell-active {
542
+ background-color: var(--cs-bgc);
543
+ }
544
+
545
+ td[data-cs-b] {
546
+ --cs-b: -2px;
547
+ }
548
+
549
+ td[data-cs-l] {
550
+ --cs-l: 2px;
551
+ }
552
+
553
+ td[data-cs-r] {
554
+ --cs-r: -2px;
555
+ }
556
+
557
+ .highlight-cell {
558
+ animation-name: stk-table-dim;
559
+ animation-duration: var(--highlight-duration);
560
+ animation-timing-function: var(--highlight-timing-function);
561
+ /* 必须分开写,否则var(step(x))不兼容旧浏览器*/
562
+ }
563
+
564
+ .stk-table-scroll-container {
565
+ display: flex;
566
+ }
567
+
568
+ .seq-column {
569
+ text-align: center;
570
+ }
571
+
572
+ .drag-row-cell {
573
+ .table-cell-wrapper {
574
+ display: inline-flex;
575
+ align-items: center;
576
+ vertical-align: middle;
577
+ }
578
+ }
579
+
580
+ .drag-row-handle {
581
+ cursor: grab;
582
+ border-radius: 4px;
583
+
584
+ &:hover {
585
+ background-color: var(--drag-handle-hover-color);
586
+ }
587
+
588
+ &:active {
589
+ cursor: grabbing;
590
+ }
591
+
592
+ >svg {
593
+ vertical-align: -2px;
594
+ }
595
+ }
596
+
597
+ .tr-dragging {
598
+ opacity: 0.5;
599
+ }
600
+
601
+ .tr-dragging-over {
602
+ background-color: var(--tr-hover-bgc);
603
+ }
604
+
605
+ /*固定列阴影-左*/
606
+ .fixed-cell--left {
607
+ --shadow-rotate: 90deg;
608
+
609
+ &.fixed-cell--shadow::after {
610
+ right: -10px;
611
+ }
612
+ }
613
+
614
+ /*固定列阴影-右*/
615
+ .fixed-cell--right {
616
+ --shadow-rotate: -90deg;
617
+
618
+ &.fixed-cell--shadow::after {
619
+ left: -10px;
620
+ }
621
+ }
622
+
623
+ /*固定列阴影*/
624
+ .fixed-cell--shadow::after {
625
+ content: '';
626
+ width: 10px;
627
+ height: 100%;
628
+ top: 0px;
629
+ position: absolute;
630
+ pointer-events: none;
631
+ background-image: linear-gradient(var(--shadow-rotate), var(--fixed-col-shadow-color-from), var(--fixed-col-shadow-color-to));
632
+ }
633
+
634
+ .fixed-cell--active {
635
+ position: sticky;
636
+ }
637
+
638
+ th.fixed-cell--active {
639
+ z-index: 3;
640
+ }
641
+
642
+ td.fixed-cell--active {
643
+ z-index: 1;
644
+ }
645
+
646
+ tfoot td.fixed-cell--active,
647
+ .stk-footer td.fixed-cell--active {
648
+ z-index: 2;
649
+ }
650
+
651
+ .table-header-cell-wrapper {
652
+ max-width: 100%;
653
+ display: inline-flex;
654
+ align-items: center;
655
+ }
656
+
657
+ .table-header-title {
658
+ overflow: hidden;
659
+ }
660
+
661
+ .table-header-sorter {
662
+ flex-shrink: 0;
663
+ margin-left: 4px;
664
+ width: 16px;
665
+ height: 16px;
666
+ display: none;
667
+
668
+ .arrow-up,
669
+ .arrow-down {
670
+ fill: var(--sort-arrow-color);
671
+ }
672
+ }
673
+
674
+ .table-header-resizer {
675
+ position: absolute;
676
+ top: 0;
677
+ bottom: 0;
678
+ cursor: col-resize;
679
+ width: var(--resize-handle-width);
680
+
681
+ &.left {
682
+ left: 0;
683
+ }
684
+
685
+ &.right {
686
+ right: 0;
687
+ }
688
+ }
689
+
690
+ /* td inherit tr bgc*/
691
+ .highlight-row {
692
+ animation-name: stk-table-dim;
693
+ animation-duration: var(--highlight-duration);
694
+ /* 必须分开写,否则var(step(x))不兼容旧浏览器*/
695
+ animation-timing-function: var(--highlight-timing-function);
696
+ }
697
+
698
+ .stk-table-no-data {
699
+ background-color: var(--table-bgc);
700
+ line-height: var(--row-height);
701
+ text-align: center;
702
+ font-size: 14px;
703
+ position: sticky;
704
+ left: 0px;
705
+ border-right: var(--border-width) solid var(--border-color);
706
+ border-bottom: var(--border-width) solid var(--border-color);
707
+ display: flex;
708
+ flex-direction: column;
709
+ align-items: center;
710
+ justify-content: center;
711
+
712
+ &.no-data-full {
713
+ flex: 1;
714
+ }
715
+ }
716
+
717
+ .expanded,
718
+ .tree-expanded {
719
+ .stk-fold-icon::before {
720
+ transform: rotate(90deg);
721
+ }
722
+ }
723
+
724
+ .stk-fold-icon {
725
+ display: inline-flex;
726
+ width: 16px;
727
+ height: 16px;
728
+ cursor: pointer;
729
+ align-items: center;
730
+
731
+ &::before {
732
+ content: '';
733
+ display: block;
734
+ margin: 0 2px;
735
+ width: 0;
736
+ height: 0;
737
+ border-left: 5px solid var(--fold-icon-color);
738
+ border-top: 4px solid transparent;
739
+ border-bottom: 4px solid transparent;
740
+ transition: transform 0.2s ease;
741
+ }
742
+
743
+ &:hover::before {
744
+ border-left: 5px solid var(--fold-icon-hover-color);
745
+ }
746
+ }
747
+
748
+ td.cell-hover {
749
+ background-color: var(--tr-hover-bgc);
750
+ }
751
+
752
+ td.cell-active {
753
+ background-color: var(--tr-active-bgc);
754
+ }
755
+
756
+ .stk-sb-thumb {
757
+ z-index: 100;
758
+ position: sticky;
759
+ background-color: var(--sb-thumb-color);
760
+ transition: opacity 0.5s ease;
761
+ user-select: none;
762
+ opacity: 0;
763
+ flex-shrink: 0;
764
+ will-change: transform;
765
+
766
+ &:hover {
767
+ background-color: var(--sb-thumb-hover-color);
768
+ }
769
+
770
+ &:active {
771
+ opacity: 1;
772
+ background-color: var(--sb-thumb-hover-color);
773
+ }
774
+
775
+ &.vertical {
776
+ margin-left: auto;
777
+ top: 0;
778
+ right: 0;
779
+ border-radius: calc(var(--sb-width) / 2);
780
+ width: var(--sb-width);
781
+ }
782
+
783
+ &.horizontal {
784
+ margin-top: auto;
785
+ bottom: 0;
786
+ left: 0;
787
+ border-radius: calc(var(--sb-height) / 2);
788
+ height: var(--sb-height);
789
+ }
790
+ }
791
+ }