vgapp 1.4.8 → 1.5.0

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 (86) hide show
  1. package/README.md +24 -2
  2. package/app/modules/base-module.js +14 -2
  3. package/app/modules/module-fn.js +5 -4
  4. package/app/modules/vgalert/js/vgalert.js +21 -1
  5. package/app/modules/vgalert/scss/vgalert.scss +48 -0
  6. package/app/modules/vgdropdown/js/vgdropdown.js +58 -27
  7. package/app/modules/vgfilepreview/js/renderers/video-modal.js +5 -1
  8. package/app/modules/vgfilepreview/js/renderers/video.js +6 -1
  9. package/app/modules/vgfilepreview/js/vgfilepreview.js +5 -1
  10. package/app/modules/vgfiles/js/base.js +29 -15
  11. package/app/modules/vgfiles/js/droppable.js +37 -31
  12. package/app/modules/vgfiles/js/vgfiles.js +10 -4
  13. package/app/modules/vgfiles/scss/_mixins.scss +12 -2
  14. package/app/modules/vgfiles/scss/_variables.scss +3 -1
  15. package/app/modules/vgfiles/scss/vgfiles.scss +55 -10
  16. package/app/modules/vgformsender/js/vgformsender.js +5 -2
  17. package/app/modules/vgloadmore/js/vgloadmore.js +35 -7
  18. package/app/modules/vgnestable/js/vgnestable.js +140 -0
  19. package/app/modules/vgnestable/scss/_variables.scss +16 -9
  20. package/app/modules/vgnestable/scss/vgnestable.scss +35 -2
  21. package/app/modules/vgtable/index.js +3 -0
  22. package/app/modules/vgtable/js/_columns.js +567 -0
  23. package/app/modules/vgtable/js/_expandable.js +242 -0
  24. package/app/modules/vgtable/js/_filters.js +264 -0
  25. package/app/modules/vgtable/js/_fixed-columns.js +249 -0
  26. package/app/modules/vgtable/js/_i18n.js +75 -0
  27. package/app/modules/vgtable/js/_options.js +428 -0
  28. package/app/modules/vgtable/js/_pagination.js +491 -0
  29. package/app/modules/vgtable/js/_panning.js +124 -0
  30. package/app/modules/vgtable/js/_params-groups.js +21 -0
  31. package/app/modules/vgtable/js/_remote.js +395 -0
  32. package/app/modules/vgtable/js/_row-reorder.js +268 -0
  33. package/app/modules/vgtable/js/_search.js +134 -0
  34. package/app/modules/vgtable/js/_selection.js +113 -0
  35. package/app/modules/vgtable/js/_skeleton.js +123 -0
  36. package/app/modules/vgtable/js/_sorting.js +340 -0
  37. package/app/modules/vgtable/js/_states.js +143 -0
  38. package/app/modules/vgtable/js/_sticky-header.js +218 -0
  39. package/app/modules/vgtable/js/_url-state.js +178 -0
  40. package/app/modules/vgtable/js/vgtable.js +1444 -0
  41. package/app/modules/vgtable/readme.md +922 -0
  42. package/app/modules/vgtable/scss/_columns.scss +52 -0
  43. package/app/modules/vgtable/scss/_expandable.scss +54 -0
  44. package/app/modules/vgtable/scss/_fixed-columns.scss +117 -0
  45. package/app/modules/vgtable/scss/_pagination.scss +191 -0
  46. package/app/modules/vgtable/scss/_row-reorder.scss +45 -0
  47. package/app/modules/vgtable/scss/_skeleton.scss +65 -0
  48. package/app/modules/vgtable/scss/_sorting.scss +89 -0
  49. package/app/modules/vgtable/scss/_states.scss +70 -0
  50. package/app/modules/vgtable/scss/_sticky-header.scss +127 -0
  51. package/app/modules/vgtable/scss/_variables.scss +296 -0
  52. package/app/modules/vgtable/scss/vgtable.scss +206 -0
  53. package/app/utils/js/components/placement.js +64 -10
  54. package/app/vgapp.js +3 -3
  55. package/build/vgapp.css +1 -1
  56. package/build/vgapp.css.map +1 -1
  57. package/build/vgapp.js +1 -1
  58. package/build/vgapp.js.map +1 -1
  59. package/index.js +1 -1
  60. package/index.scss +3 -3
  61. package/package.json +4 -4
  62. package/app/modules/vgdynamictable/index.js +0 -4
  63. package/app/modules/vgdynamictable/js/editable.js +0 -438
  64. package/app/modules/vgdynamictable/js/expandable.js +0 -248
  65. package/app/modules/vgdynamictable/js/filters.js +0 -450
  66. package/app/modules/vgdynamictable/js/fixed.js +0 -566
  67. package/app/modules/vgdynamictable/js/options.js +0 -650
  68. package/app/modules/vgdynamictable/js/pagination.js +0 -623
  69. package/app/modules/vgdynamictable/js/search.js +0 -82
  70. package/app/modules/vgdynamictable/js/skeleton.js +0 -144
  71. package/app/modules/vgdynamictable/js/sortable.js +0 -442
  72. package/app/modules/vgdynamictable/js/summary-footer.js +0 -284
  73. package/app/modules/vgdynamictable/js/table-remote.js +0 -821
  74. package/app/modules/vgdynamictable/js/table-state.js +0 -243
  75. package/app/modules/vgdynamictable/js/table-url-state.js +0 -444
  76. package/app/modules/vgdynamictable/js/utils/common.js +0 -48
  77. package/app/modules/vgdynamictable/js/vgdynamictable.js +0 -3870
  78. package/app/modules/vgdynamictable/js/viewport.js +0 -322
  79. package/app/modules/vgdynamictable/readme.md +0 -251
  80. package/app/modules/vgdynamictable/scss/_actions.scss +0 -196
  81. package/app/modules/vgdynamictable/scss/_pagination.scss +0 -186
  82. package/app/modules/vgdynamictable/scss/_skeleton.scss +0 -63
  83. package/app/modules/vgdynamictable/scss/_sortable.scss +0 -66
  84. package/app/modules/vgdynamictable/scss/_table.scss +0 -137
  85. package/app/modules/vgdynamictable/scss/_variables.scss +0 -138
  86. package/app/modules/vgdynamictable/scss/vgdynamictable.scss +0 -264
@@ -0,0 +1,127 @@
1
+ @mixin wrapper-styles {
2
+ &--sticky-container,
3
+ &--sticky-page {
4
+ overflow: visible;
5
+ }
6
+ }
7
+
8
+ @mixin container-styles {
9
+ &--scrollbar {
10
+ .vg-table-header__table thead > tr:first-child > th:last-child {
11
+ border-start-end-radius: 0;
12
+ }
13
+
14
+ .vg-table-body > .vg-table tbody:last-child > tr:last-child > :last-child {
15
+ border-end-end-radius: 0;
16
+ }
17
+ }
18
+
19
+ &--sticky-container,
20
+ &--sticky-page {
21
+ --vg-table-sticky-inner-radius: max(0px, calc(var(--vg-table-sticky-radius) - var(--vg-table-sticky-border-width)));
22
+ border: var(--vg-table-sticky-border-width) var(--vg-table-sticky-border-style) var(--vg-table-sticky-border-color);
23
+ border-radius: var(--vg-table-sticky-radius);
24
+ background: var(--vg-table-sticky-bg);
25
+
26
+ .vg-table-header,
27
+ .vg-table-body {
28
+ width: 100%;
29
+ }
30
+
31
+ .vg-table-header {
32
+ position: relative;
33
+ z-index: var(--vg-table-sticky-z-index);
34
+ overflow: hidden;
35
+ background: var(--vg-table-thead-bg);
36
+ border-start-start-radius: var(--vg-table-sticky-inner-radius);
37
+ border-start-end-radius: var(--vg-table-sticky-inner-radius);
38
+
39
+ &--scrollbar::after {
40
+ content: "";
41
+ position: absolute;
42
+ z-index: 5;
43
+ inset-block: 0;
44
+ inset-inline-end: 0;
45
+ width: var(--vg-table-sticky-scrollbar-width);
46
+ box-sizing: border-box;
47
+ border-bottom: var(--vg-table-sticky-border-width) var(--vg-table-sticky-border-style) var(--vg-table-sticky-border-color);
48
+ background: var(--vg-table-fixed-header-bg, var(--vg-table-thead-bg));
49
+ pointer-events: none;
50
+ }
51
+ }
52
+
53
+ .vg-table-body {
54
+ position: relative;
55
+ z-index: 0;
56
+ }
57
+
58
+ .vg-table-header__table,
59
+ .vg-table-body > .vg-table {
60
+ width: 100%;
61
+ min-width: 100%;
62
+ table-layout: fixed;
63
+ overflow: visible;
64
+ border: 0;
65
+ border-radius: 0;
66
+ }
67
+
68
+ .vg-table-header__table {
69
+ thead > tr:first-child > th:first-child {
70
+ border-start-start-radius: var(--vg-table-sticky-edge-start-radius, var(--vg-table-sticky-inner-radius));
71
+ }
72
+
73
+ thead > tr:first-child > th:last-child {
74
+ border-start-end-radius: var(--vg-table-sticky-edge-end-radius, var(--vg-table-sticky-inner-radius));
75
+ }
76
+ }
77
+
78
+ .vg-table-body > .vg-table tbody:last-child > tr:last-child {
79
+ > :first-child {
80
+ border-end-start-radius: var(--vg-table-sticky-edge-start-radius, var(--vg-table-sticky-inner-radius));
81
+ }
82
+
83
+ > :last-child {
84
+ border-end-end-radius: var(--vg-table-sticky-edge-end-radius, var(--vg-table-sticky-inner-radius));
85
+ }
86
+ }
87
+ }
88
+
89
+ &--sticky-container {
90
+ overflow: hidden;
91
+
92
+ .vg-table-body {
93
+ max-height: var(--vg-table-sticky-max-height);
94
+ overflow: auto;
95
+ }
96
+ }
97
+
98
+ &--sticky-page {
99
+ overflow: visible;
100
+
101
+ .vg-table-header {
102
+ position: sticky;
103
+ top: var(--vg-table-sticky-top);
104
+ z-index: var(--vg-table-sticky-z-index);
105
+ box-shadow: var(--vg-table-sticky-shadow);
106
+
107
+ &.is-stuck {
108
+ border-start-start-radius: 0;
109
+ border-start-end-radius: 0;
110
+
111
+ .vg-table-header__table thead > tr:first-child {
112
+ > th:first-child {
113
+ border-start-start-radius: 0;
114
+ }
115
+
116
+ > th:last-child {
117
+ border-start-end-radius: 0;
118
+ }
119
+ }
120
+ }
121
+ }
122
+
123
+ .vg-table-body {
124
+ overflow: auto;
125
+ }
126
+ }
127
+ }
@@ -0,0 +1,296 @@
1
+ @use "sass:map";
2
+ @use "../../../utils/scss/theme" as vg-theme;
3
+ @use "../../../utils/scss" as vg;
4
+
5
+ // Базовые свойства таблицы: границы, выравнивание текста и общая скорость переходов.
6
+ // Формирует переменные --vg-table-*.
7
+ $table-prop: (
8
+ border-style: solid,
9
+ thead-text-align: left,
10
+ tbody-text-align: left,
11
+ transition: vg.$transition-base
12
+ );
13
+
14
+ // Обёртка адаптивной таблицы: независимые граница, радиус и фон контейнера.
15
+ // По умолчанию оформление обнулено; формирует переменные --vg-table-wrapper-*.
16
+ $table-wrapper: (
17
+ border-width: 0,
18
+ border-style: solid,
19
+ border-color: transparent,
20
+ radius: 0,
21
+ bg: transparent
22
+ ) !default;
23
+
24
+ // Обязательный scroll-контейнер владеет внешней рамкой: она остаётся на месте
25
+ // при горизонтальной прокрутке широкой таблицы.
26
+ $table-container: (
27
+ border-width: 1px,
28
+ border-style: var(--vg-table-border-style),
29
+ border-color: var(--vg-table-border-color),
30
+ radius: vg.$border-radius,
31
+ bg: var(--vg-table-bg)
32
+ ) !default;
33
+
34
+ // Общие значения границы и радиуса, переиспользуемые всеми размерными вариантами.
35
+ $table-size-base: (
36
+ border-width: 1px,
37
+ radius: vg.$border-radius
38
+ ) !default;
39
+
40
+ // Размеры таблицы xs–xl: отступы ячеек, шрифт, граница и радиус.
41
+ // md используется обычным .vg-table, остальные значения — модификаторами .vg-table-{size}.
42
+ $table-sizing: (
43
+ xs: (
44
+ cell-padding-block: .375rem,
45
+ cell-padding-inline: .5rem,
46
+ font-size: .75rem,
47
+ border-width: map.get($table-size-base, border-width),
48
+ radius: map.get($table-size-base, radius)
49
+ ),
50
+ sm: (
51
+ cell-padding-block: .625rem,
52
+ cell-padding-inline: .75rem,
53
+ font-size: .8125rem,
54
+ border-width: map.get($table-size-base, border-width),
55
+ radius: map.get($table-size-base, radius)
56
+ ),
57
+ md: (
58
+ cell-padding-block: 1rem,
59
+ cell-padding-inline: 1rem,
60
+ font-size: 1rem,
61
+ border-width: map.get($table-size-base, border-width),
62
+ radius: map.get($table-size-base, radius)
63
+ ),
64
+ lg: (
65
+ cell-padding-block: 1.25rem,
66
+ cell-padding-inline: 1.25rem,
67
+ font-size: 1.0625rem,
68
+ border-width: map.get($table-size-base, border-width),
69
+ radius: map.get($table-size-base, radius)
70
+ ),
71
+ xl: (
72
+ cell-padding-block: 1.5rem,
73
+ cell-padding-inline: 1.5rem,
74
+ font-size: 1.125rem,
75
+ border-width: map.get($table-size-base, border-width),
76
+ radius: map.get($table-size-base, radius)
77
+ )
78
+ ) !default;
79
+
80
+ // Локальная сортировка: зона заголовка, шевроны, focus-состояние и подсветка колонки.
81
+ // Формирует переменные --vg-table-sort-*.
82
+ $table-sort: (
83
+ padding-inline-end: calc(var(--vg-table-cell-padding-inline) + 1.25rem),
84
+ multiple-padding-inline-end: calc(var(--vg-table-cell-padding-inline) + 2.5rem),
85
+ cursor: pointer,
86
+ user-select: none,
87
+ controls-position: absolute,
88
+ controls-inset-inline-end: .75rem,
89
+ controls-top: 50%,
90
+ controls-display: flex,
91
+ controls-flex-direction: column,
92
+ controls-gap: .12rem,
93
+ controls-transform: translateY(-50%),
94
+ controls-pointer-events: none,
95
+ controls-hidden-opacity: 0,
96
+ controls-visible-opacity: 1,
97
+ controls-transition: opacity var(--vg-table-transition),
98
+ priority-position: absolute,
99
+ priority-inset-inline-end: calc(100% + .35rem),
100
+ priority-top: 50%,
101
+ priority-transform: translateY(-50%),
102
+ priority-min-width: 1rem,
103
+ priority-height: 1rem,
104
+ priority-padding-inline: .2rem,
105
+ priority-radius: 999px,
106
+ priority-bg: var(--vg-table-thead-text),
107
+ priority-color: var(--vg-table-thead-bg),
108
+ priority-font-size: .625rem,
109
+ priority-font-weight: 700,
110
+ chevron-display: block,
111
+ chevron-width: .4rem,
112
+ chevron-height: .4rem,
113
+ chevron-border-width: 1.5px,
114
+ chevron-border-style: solid,
115
+ chevron-border-color: currentColor,
116
+ chevron-opacity: .25,
117
+ chevron-transition: opacity var(--vg-table-transition),
118
+ chevron-asc-transform: rotate(225deg),
119
+ chevron-desc-transform: rotate(45deg),
120
+ chevron-active-opacity: 1,
121
+ column-background: rgba(0, 0, 0, .025),
122
+ focus-outline: 2px solid currentColor,
123
+ focus-outline-offset: -2px
124
+ ) !default;
125
+
126
+ // Управление колонками: resize-handle и состояния нативного drag-and-drop.
127
+ // Формирует переменные --vg-table-columns-*.
128
+ $table-columns: (
129
+ resize-z-index: 9,
130
+ resize-hit-area: .75rem,
131
+ resize-line-inset: .4rem,
132
+ resize-line-width: 2px,
133
+ resize-line-color: var(--vg-primary),
134
+ drag-opacity: .55,
135
+ drag-outline-width: 2px,
136
+ drag-outline-color: var(--vg-primary)
137
+ ) !default;
138
+
139
+ // Перестановка строк: размер handle, drag-индикатор, focus и недоступное состояние.
140
+ // Формирует переменные --vg-table-row-reorder-*.
141
+ $table-row-reorder: (
142
+ handle-size: 2rem,
143
+ indicator-width: 2px,
144
+ indicator-color: var(--vg-primary),
145
+ drag-opacity: .5,
146
+ disabled-opacity: .4,
147
+ focus-outline: 2px solid currentColor,
148
+ focus-outline-offset: 2px
149
+ ) !default;
150
+
151
+ // Shift-перетаскивание адаптивной таблицы: курсор и запрет выделения текста.
152
+ // Формирует переменные --vg-table-pan-*.
153
+ $table-pan: (
154
+ cursor: grabbing,
155
+ user-select: none
156
+ ) !default;
157
+
158
+ // Sticky-заголовок: высота внутреннего viewport, верхний отступ, слой и визуальный разделитель.
159
+ // Формирует переменные --vg-table-sticky-*.
160
+ $table-sticky: (
161
+ max-height: 24rem,
162
+ top: 0px,
163
+ z-index: 3,
164
+ shadow: 0 1px 0 var(--vg-table-border-color),
165
+ border-width: map.get($table-size-base, border-width),
166
+ border-style: var(--vg-table-border-style),
167
+ border-color: var(--vg-table-border-color),
168
+ radius: map.get($table-size-base, radius),
169
+ bg: var(--vg-table-bg)
170
+ ) !default;
171
+
172
+ // Фиксированные колонки: уровни настоящих sticky-ячеек и синхронная краевая тень без transform.
173
+ // Формирует переменные --vg-table-fixed-*.
174
+ $table-fixed: (
175
+ z-index: 5,
176
+ header-z-index: 7,
177
+ radius: map.get($table-size-base, radius),
178
+ cell-bg: var(--vg-table-bg),
179
+ header-bg: var(--vg-table-thead-bg),
180
+ shadow-size: 1rem,
181
+ shadow-blur: .5rem,
182
+ shadow-spread: .5rem,
183
+ shadow-color: rgba(0, 0, 0, .15)
184
+ ) !default;
185
+
186
+ // Skeleton Remote-загрузки: геометрия строки, shimmer-анимация и нейтральные цвета.
187
+ // Формирует переменные --vg-table-skeleton-*.
188
+ $table-skeleton: (
189
+ padding-block: var(--vg-table-cell-padding-block),
190
+ padding-inline: var(--vg-table-cell-padding-inline),
191
+ content-height: 1.25em,
192
+ line-height: .625rem,
193
+ radius: 999px,
194
+ duration: 1.2s,
195
+ row-bg: color-mix(in srgb, var(--vg-table-bg) 50%, transparent),
196
+ border-color: var(--vg-table-border-color),
197
+ gradient-1: var(--vg-table-border-color),
198
+ gradient-2: var(--vg-table-thead-bg),
199
+ glow: color-mix(in srgb, var(--vg-table-bg) 55%, transparent)
200
+ ) !default;
201
+
202
+ // Empty, filtered-empty и error: геометрия, иконка и кнопки восстановления.
203
+ // Формирует переменные --vg-table-state-*.
204
+ $table-state: (
205
+ padding-block: 2rem,
206
+ padding-inline: var(--vg-table-cell-padding-inline),
207
+ min-height: 10rem,
208
+ gap: .75rem,
209
+ bg: var(--vg-table-bg),
210
+ text: var(--vg-table-thead-text),
211
+ font-size: .9375rem,
212
+ font-weight: 500,
213
+ icon-size: 2.5rem,
214
+ icon-border-width: 2px,
215
+ icon-color: var(--vg-table-thead-text),
216
+ icon-opacity: .35,
217
+ action-padding-block: .375rem,
218
+ action-padding-inline: .75rem,
219
+ action-border-width: 1px,
220
+ action-border-color: var(--vg-table-border-color),
221
+ action-radius: var(--vg-table-radius),
222
+ action-bg: var(--vg-table-bg),
223
+ action-bg-hover: var(--vg-table-thead-bg),
224
+ action-text: var(--vg-primary)
225
+ ) !default;
226
+
227
+ // Выбор строк: курсор, фон выбранной строки и цвет её границы.
228
+ // Формирует переменные --vg-table-selection-*.
229
+ $table-selection: (
230
+ row-cursor: pointer,
231
+ row-background: color-mix(in srgb, var(--vg-primary) 8%, transparent),
232
+ row-background-hovered: color-mix(in srgb, var(--vg-primary) 12%, transparent),
233
+ row-border-selected: color-mix(in srgb, var(--vg-primary) 20%, transparent)
234
+ ) !default;
235
+
236
+ // Многоуровневые строки: отступ уровня, размеры и состояния кнопки плюс/минус.
237
+ // Формирует переменные --vg-table-expandable-*.
238
+ $table-expandable: (
239
+ indent: 1.5rem,
240
+ toggle-size: 1.25rem,
241
+ toggle-margin-inline-end: .5rem,
242
+ toggle-border-width: 1px,
243
+ toggle-border-style: solid,
244
+ toggle-border-color: var(--vg-table-border-color),
245
+ toggle-radius: .25rem,
246
+ toggle-bg: var(--vg-table-bg),
247
+ toggle-color: currentColor,
248
+ toggle-icon-size: .625rem,
249
+ toggle-icon-width: 1px,
250
+ toggle-focus-outline: 2px solid currentColor,
251
+ toggle-focus-outline-offset: 2px
252
+ ) !default;
253
+
254
+ // Локальная и серверная пагинация: размеры контролов, dropdown, шевроны, подписи и состояния кнопок.
255
+ // Формирует переменные --vg-table-pagination-*.
256
+ $table-pagination: (
257
+ padding-block: .75rem,
258
+ padding-inline: 1rem,
259
+ gap: .75rem,
260
+ control-gap: .5rem,
261
+ control-size: 2rem,
262
+ border-width: 1px,
263
+ border-style: solid,
264
+ border-color: var(--vg-table-border-color),
265
+ chevron-size: 1rem,
266
+ chevron-stroke-width: 1.8,
267
+ control-padding-inline: .625rem,
268
+ button-padding-inline: .625rem,
269
+ radius: vg.$border-radius,
270
+ quick-width: 5rem,
271
+ size-width: 9rem,
272
+ size-dropdown-width: 10.5rem,
273
+ font-size: .875rem,
274
+ heading-color: var(--vg-table-pagination-text),
275
+ heading-font-size: .875rem,
276
+ heading-font-weight: 400,
277
+ heading-line-height: 1.25,
278
+ disabled-opacity: .45,
279
+ text: rgba(0, 0, 0, .88),
280
+ active-bg: var(--vg-primary),
281
+ active-text: #ffffff,
282
+ option-hover-bg: rgba(0, 0, 0, .04)
283
+ ) !default;
284
+
285
+ // Основная цветовая схема таблицы: фон, заголовок, разделители и состояния строк.
286
+ // Формирует цветовые переменные --vg-table-*.
287
+ $table-colors: (
288
+ border-color: #f0f0f0,
289
+ bg: #ffffff,
290
+ thead-bg: #fafafa,
291
+ thead-text: rgba(0, 0, 0, .88),
292
+ thead-spliter: #f0f0f0,
293
+ tbody-bg: transparent,
294
+ tbody-bg-hovered: #fafafa,
295
+ tbody-bg-striped: #fafafa
296
+ );
@@ -0,0 +1,206 @@
1
+ /**
2
+ *--------------------------------------------------------------------------
3
+ * Модуль: VGTable
4
+ * Автор: Vegas DEV
5
+ * Лицензия: смотри LICENSE
6
+ *--------------------------------------------------------------------------
7
+ **/
8
+ @use "../../../utils/scss" as vg;
9
+ @use "../../../utils/scss/theme" as vg-theme;
10
+ @use "sass:map";
11
+ @forward "variables";
12
+
13
+ @use "variables" as table;
14
+ @use "sorting" as table-sorting;
15
+ @use "columns" as table-columns;
16
+ @use "row-reorder" as table-row-reorder;
17
+ @use "pagination" as table-pagination;
18
+ @use "expandable" as table-expandable;
19
+ @use "sticky-header" as table-sticky-header;
20
+ @use "fixed-columns" as table-fixed-columns;
21
+ @use "skeleton" as table-skeleton;
22
+ @use "states" as table-states;
23
+
24
+ .vg-table-wrapper {
25
+ @include vg.mix-vars('table', table.$table-prop);
26
+ @include vg.mix-vars('table-wrapper', table.$table-wrapper);
27
+ @include vg.mix-vars('table-container', table.$table-container);
28
+ @include vg.mix-vars('table-sort', table.$table-sort);
29
+ @include vg.mix-vars('table-columns', table.$table-columns);
30
+ @include vg.mix-vars('table-row-reorder', table.$table-row-reorder);
31
+ @include vg.mix-vars('table-pan', table.$table-pan);
32
+ @include vg.mix-vars('table-selection', table.$table-selection);
33
+ @include vg.mix-vars('table-expandable', table.$table-expandable);
34
+ @include vg.mix-vars('table-pagination', table.$table-pagination);
35
+ @include vg.mix-vars('table-sticky', table.$table-sticky);
36
+ @include vg.mix-vars('table-fixed', table.$table-fixed);
37
+ @include vg.mix-vars('table-state', table.$table-state);
38
+ @include vg.mix-vars('table', table.$table-colors);
39
+ position: relative;
40
+ overflow: visible;
41
+ border: var(--vg-table-wrapper-border-width) var(--vg-table-wrapper-border-style) var(--vg-table-wrapper-border-color);
42
+ border-radius: var(--vg-table-wrapper-radius);
43
+ background: var(--vg-table-wrapper-bg);
44
+
45
+ // Подключение стилей пагинации
46
+ @include table-pagination.styles;
47
+ @include table-columns.styles;
48
+ @include table-row-reorder.styles;
49
+
50
+ &.is-panning {
51
+ cursor: var(--vg-table-pan-cursor);
52
+ user-select: var(--vg-table-pan-user-select);
53
+
54
+ .vg-table tr {
55
+ transition: none;
56
+ }
57
+
58
+ .vg-table,
59
+ .vg-table * {
60
+ cursor: inherit;
61
+ }
62
+ }
63
+
64
+ .vg-table {
65
+ @include vg.mix-vars('table', map.get(table.$table-sizing, md));
66
+ @include vg.mix-vars('table-skeleton', table.$table-skeleton);
67
+ border: 0;
68
+ border-radius: 0;
69
+ background: var(--vg-table-bg);
70
+ width: 100%;
71
+ border-collapse: separate;
72
+ border-spacing: 0;
73
+ overflow: visible;
74
+ font-size: var(--vg-table-font-size);
75
+
76
+ @each $size, $values in table.$table-sizing {
77
+ &-#{$size} {
78
+ @include vg.mix-vars('table', $values);
79
+ }
80
+ }
81
+
82
+ tr {
83
+ > th {
84
+ background-color: var(--vg-table-thead-bg);
85
+ color: var(--vg-table-thead-text);
86
+ padding: var(--vg-table-cell-padding-block) var(--vg-table-cell-padding-inline);
87
+ text-align: var(--vg-table-thead-text-align);
88
+ border-bottom: var(--vg-table-border-width) var(--vg-table-border-style) var(--vg-table-border-color);
89
+ position: relative;
90
+ }
91
+
92
+ > td {
93
+ padding: var(--vg-table-cell-padding-block) var(--vg-table-cell-padding-inline);
94
+ text-align: var(--vg-table-tbody-text-align);
95
+ }
96
+ }
97
+
98
+ thead {
99
+ tr > th {
100
+ &:before {
101
+ content: "";
102
+ background-color: var(--vg-table-thead-spliter);
103
+ width: 1px;
104
+ height: 1.6em;
105
+ position: absolute;
106
+ inset-inline-end: 0;
107
+ top: 50%;
108
+ transform: translateY(-50%);
109
+ }
110
+
111
+ &:last-child {
112
+ &:before {
113
+ display: none;
114
+ }
115
+ }
116
+ }
117
+ }
118
+
119
+ // Подключение стилей сортировки
120
+ @include table-sorting.styles;
121
+
122
+ // Подключение многоуровневых строк
123
+ @include table-expandable.styles;
124
+
125
+ // Skeleton Remote-загрузки
126
+ @include table-skeleton.styles;
127
+
128
+ // Empty, filtered-empty и error.
129
+ @include table-states.styles;
130
+
131
+ tbody {
132
+ tr {
133
+ transition: var(--vg-table-transition);
134
+ background-color: var(--vg-table-tbody-bg);
135
+
136
+ td {
137
+ border-bottom: var(--vg-table-border-width) var(--vg-table-border-style) var(--vg-table-border-color);
138
+ }
139
+
140
+ &:last-child {
141
+ td {
142
+ border-bottom: none;
143
+ }
144
+ }
145
+ }
146
+ }
147
+
148
+ // Эффект при наведении
149
+ &-hovered {
150
+ tbody {
151
+ tr:hover {
152
+ background-color: var(--vg-table-tbody-bg-hovered);
153
+ }
154
+ }
155
+ }
156
+
157
+ // Чередование фона строк
158
+ &-striped {
159
+ tbody {
160
+ tr:nth-child(even) {
161
+ background-color: var(--vg-table-tbody-bg-striped);
162
+ }
163
+ }
164
+ }
165
+
166
+ // Выборка строк
167
+ &.vg-table-selection-click {
168
+ tbody tr {
169
+ cursor: var(--vg-table-selection-row-cursor);
170
+ }
171
+ }
172
+
173
+ tbody tr.vg-table-row-selected {
174
+ background-color: var(--vg-table-selection-row-background);
175
+
176
+ > td {
177
+ border-bottom-color: var(--vg-table-selection-row-border-selected);
178
+ }
179
+
180
+ &:hover {
181
+ background-color: var(--vg-table-selection-row-background-hovered);
182
+ }
183
+ }
184
+
185
+ }
186
+
187
+ // В Fixed Header wrapper остаётся внешним layout-контейнером без overflow.
188
+ @include table-sticky-header.wrapper-styles;
189
+
190
+ // Настоящие sticky-ячейки и краевые тени Fixed Columns.
191
+ @include table-fixed-columns.styles;
192
+ }
193
+
194
+ .vg-table-wrapper > .vg-table-container {
195
+ // Защита от глобальных селекторов вида [class*="container-"] в приложении.
196
+ padding-inline: 0;
197
+ position: relative;
198
+ overflow-x: auto;
199
+ box-sizing: border-box;
200
+ border: var(--vg-table-container-border-width) var(--vg-table-container-border-style) var(--vg-table-container-border-color);
201
+ border-radius: var(--vg-table-container-radius);
202
+ background: var(--vg-table-container-bg);
203
+
204
+ // Fixed Header расширяет общий scroll-контейнер слоями header/body.
205
+ @include table-sticky-header.container-styles;
206
+ }