@svgrid/grid 2.1.0 → 2.1.2

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 (64) hide show
  1. package/dist/FlexRender.svelte +96 -96
  2. package/dist/GridFooter.svelte +178 -178
  3. package/dist/SvGrid.css +2377 -2377
  4. package/dist/SvGrid.svelte +2764 -2764
  5. package/dist/SvGridBoard.svelte +2281 -2281
  6. package/dist/SvGridDropdown.svelte +666 -666
  7. package/dist/cdn/svgrid.js +2 -2
  8. package/dist/cdn/svgrid.svelte-external.js +2 -2
  9. package/package.json +92 -92
  10. package/src/FlexRender.svelte +96 -96
  11. package/src/GridFooter.svelte +178 -178
  12. package/src/SvGrid.controller.svelte.ts +2553 -2553
  13. package/src/SvGrid.css +2377 -2377
  14. package/src/SvGrid.svelte +2764 -2764
  15. package/src/SvGrid.types.ts +944 -944
  16. package/src/SvGridBoard.svelte +2281 -2281
  17. package/src/SvGridDropdown.svelte +666 -666
  18. package/src/a11y.contract.test.ts +49 -49
  19. package/src/a11y.test.ts +59 -59
  20. package/src/a11y.ts +61 -61
  21. package/src/build-api.ts +798 -798
  22. package/src/cell-formatting.ts +169 -169
  23. package/src/cell-render.ts +469 -469
  24. package/src/collaboration.test.ts +104 -104
  25. package/src/collaboration.ts +167 -167
  26. package/src/core.performance.test.ts +30 -30
  27. package/src/core.ts +1111 -1111
  28. package/src/createGrid.svelte.ts +42 -42
  29. package/src/createGrid.test.ts +10 -10
  30. package/src/createGridState.svelte.ts +17 -17
  31. package/src/editing.test.ts +859 -859
  32. package/src/editing.ts +675 -675
  33. package/src/export-data-api.test.ts +126 -126
  34. package/src/export-format.test.ts +107 -107
  35. package/src/export-format.ts +598 -598
  36. package/src/flex-render.ts +3 -3
  37. package/src/index.ts +463 -463
  38. package/src/keyboard.test.ts +59 -59
  39. package/src/keyboard.ts +97 -97
  40. package/src/menus.ts +582 -582
  41. package/src/merge-objects.ts +48 -48
  42. package/src/render-component.ts +28 -28
  43. package/src/selection.test.ts +754 -754
  44. package/src/selection.ts +600 -600
  45. package/src/server-data-source.test.ts +289 -289
  46. package/src/server-data-source.ts +413 -413
  47. package/src/sparkline.test.ts +68 -68
  48. package/src/sparkline.ts +169 -169
  49. package/src/spreadsheet.test.ts +489 -489
  50. package/src/spreadsheet.ts +304 -304
  51. package/src/static-functions.ts +11 -11
  52. package/src/subscribe.ts +38 -38
  53. package/src/svgrid-wrapper.types.ts +439 -439
  54. package/src/svgrid.behavior.test.ts +706 -706
  55. package/src/svgrid.features.test.ts +157 -157
  56. package/src/svgrid.new-features.wrapper.test.ts +251 -251
  57. package/src/svgrid.wrapper.test.ts +40 -40
  58. package/src/themes/index.ts +159 -159
  59. package/src/virtualization/column-virtualizer.test.ts +27 -27
  60. package/src/virtualization/column-virtualizer.ts +30 -30
  61. package/src/virtualization/svelte-virtualizer.svelte.ts +26 -26
  62. package/src/virtualization/types.ts +30 -30
  63. package/src/virtualization/virtualizer.test.ts +47 -47
  64. package/src/virtualization/virtualizer.ts +296 -296
package/src/SvGrid.css CHANGED
@@ -1,2377 +1,2377 @@
1
- /*
2
- * SvGrid component styles. Extracted from SvGrid.svelte's <style> block so the
3
- * component file stays focused on logic + markup. These are plain (global) CSS
4
- * rules - every selector is a unique .sv-grid-* class that maps to a real class
5
- * on the grid's elements, so behaviour is identical to the former scoped block.
6
- * Imported for its side effect by SvGrid.svelte; the WC build inlines it and
7
- * app bundlers include it via the import.
8
- */
9
- /* Root wrapper: holds the shell + pager + any overlays (find, tooltips
10
- * pinned to the root). Position-relative so absolutely-positioned
11
- * overlays (the find-in-grid toolbar) anchor to the grid, not the
12
- * viewport. */
13
- .sv-grid-root {
14
- position: relative;
15
- font-family: var(--sg-font, inherit);
16
- }
17
- .sv-grid-sr-only {
18
- position: absolute;
19
- width: 1px;
20
- height: 1px;
21
- overflow: hidden;
22
- clip: rect(0 0 0 0);
23
- white-space: nowrap;
24
- }
25
- .sv-grid-loading-overlay {
26
- position: absolute;
27
- inset: 0;
28
- z-index: 18;
29
- pointer-events: auto;
30
- background: color-mix(in srgb, var(--sg-bg, #fff) 35%, transparent);
31
- }
32
- /* Indeterminate top progress bar - the "something is happening" signal
33
- that keeps the current rows visible underneath (no flash). */
34
- .sv-grid-loading-bar {
35
- position: absolute;
36
- top: 0;
37
- left: 0;
38
- right: 0;
39
- height: 3px;
40
- overflow: hidden;
41
- background: color-mix(in srgb, var(--sg-accent, #2563eb) 18%, transparent);
42
- }
43
- .sv-grid-loading-bar::before {
44
- content: '';
45
- position: absolute;
46
- inset: 0;
47
- width: 40%;
48
- background: var(--sg-accent, #2563eb);
49
- animation: sv-grid-loading-slide 1.1s ease-in-out infinite;
50
- }
51
- @keyframes sv-grid-loading-slide {
52
- 0% { transform: translateX(-100%); }
53
- 100% { transform: translateX(350%); }
54
- }
55
- /* First-load skeleton: shimmer placeholder rows under the header. */
56
- .sv-grid-skeleton {
57
- position: absolute;
58
- top: var(--sg-thead-h, 40px);
59
- left: 0;
60
- right: 0;
61
- padding: 0;
62
- overflow: hidden;
63
- }
64
- .sv-grid-skeleton-row {
65
- display: flex;
66
- height: var(--sg-pinned-row-h, 36px);
67
- align-items: center;
68
- border-bottom: 1px solid var(--sg-border, #e2e8f0);
69
- }
70
- .sv-grid-skeleton-cell {
71
- flex-shrink: 0;
72
- padding: 0 12px;
73
- box-sizing: border-box;
74
- }
75
- .sv-grid-skeleton-bar {
76
- display: block;
77
- height: 10px;
78
- width: 70%;
79
- border-radius: 4px;
80
- background: linear-gradient(
81
- 90deg,
82
- color-mix(in srgb, var(--sg-muted, #94a3b8) 18%, transparent) 25%,
83
- color-mix(in srgb, var(--sg-muted, #94a3b8) 32%, transparent) 50%,
84
- color-mix(in srgb, var(--sg-muted, #94a3b8) 18%, transparent) 75%
85
- );
86
- background-size: 200% 100%;
87
- animation: sv-grid-shimmer 1.3s linear infinite;
88
- }
89
- @keyframes sv-grid-shimmer {
90
- 0% { background-position: 200% 0; }
91
- 100% { background-position: -200% 0; }
92
- }
93
-
94
- /* Grid toolbar strip above the shell - hosts the tool-panel trigger (and is a
95
- natural home for future grid-level actions). */
96
- .sv-grid-toolbar {
97
- display: flex;
98
- align-items: center;
99
- gap: 8px;
100
- padding: 6px 2px;
101
- }
102
- .sv-grid-toolbar-btn {
103
- display: inline-flex;
104
- align-items: center;
105
- gap: 6px;
106
- padding: 6px 12px;
107
- border: 1px solid var(--sg-border, #e2e8f0);
108
- border-radius: var(--sg-radius, 6px);
109
- background: var(--sg-bg, #fff);
110
- color: var(--sg-fg, #0f172a);
111
- font-size: 12.5px;
112
- font-weight: 600;
113
- cursor: pointer;
114
- transition: background-color 120ms ease, color 120ms ease, border-color 120ms ease;
115
- }
116
- .sv-grid-toolbar-btn:hover {
117
- border-color: var(--sg-accent, #2563eb);
118
- color: var(--sg-accent, #2563eb);
119
- }
120
- .sv-grid-toolbar-btn.is-active {
121
- background: var(--sg-accent, #2563eb);
122
- border-color: var(--sg-accent, #2563eb);
123
- color: #fff;
124
- }
125
- .sv-grid-tool-panel {
126
- position: absolute;
127
- top: 0;
128
- right: 0;
129
- bottom: 0;
130
- /* Above the grid's sticky header (z-index 30) and custom scrollbars (z ~900)
131
- so the docked panel fully overlays the grid instead of the header/right
132
- columns bleeding through its top-right. Ties the menu layer (901) but the
133
- menus render later in the DOM, so a column menu opened over the panel still
134
- wins. */
135
- z-index: 901;
136
- width: 250px;
137
- display: flex;
138
- flex-direction: column;
139
- background: var(--sg-bg, #fff);
140
- border-left: 1px solid var(--sg-border, #e2e8f0);
141
- box-shadow: -8px 0 24px rgba(0, 0, 0, 0.12);
142
- }
143
- .sv-grid-tool-panel-head {
144
- display: flex;
145
- align-items: center;
146
- justify-content: space-between;
147
- padding: 8px 12px;
148
- font-size: 12px;
149
- font-weight: 700;
150
- text-transform: uppercase;
151
- letter-spacing: 0.05em;
152
- color: var(--sg-muted, #64748b);
153
- border-bottom: 1px solid var(--sg-border, #e2e8f0);
154
- }
155
- .sv-grid-tool-panel-close {
156
- border: 0;
157
- background: transparent;
158
- color: var(--sg-muted, #64748b);
159
- font-size: 14px;
160
- cursor: pointer;
161
- }
162
- .sv-grid-tool-panel-list {
163
- list-style: none;
164
- margin: 0;
165
- padding: 6px;
166
- overflow-y: auto;
167
- flex: 1;
168
- }
169
- .sv-grid-tool-panel-item {
170
- display: flex;
171
- align-items: center;
172
- justify-content: space-between;
173
- gap: 6px;
174
- padding: 3px 6px;
175
- border-radius: 5px;
176
- }
177
- .sv-grid-tool-panel-item:hover {
178
- background: var(--sg-row-hover-bg, rgba(148, 163, 184, 0.1));
179
- }
180
- .sv-grid-tool-panel-vis {
181
- display: flex;
182
- align-items: center;
183
- gap: 8px;
184
- flex: 1;
185
- min-width: 0;
186
- font-size: 13px;
187
- color: var(--sg-fg, #0f172a);
188
- cursor: pointer;
189
- }
190
- .sv-grid-tool-panel-vis input {
191
- accent-color: var(--sg-accent, #2563eb);
192
- }
193
- .sv-grid-tool-panel-name {
194
- overflow: hidden;
195
- text-overflow: ellipsis;
196
- white-space: nowrap;
197
- }
198
- .sv-grid-tool-panel-actions {
199
- display: inline-flex;
200
- gap: 2px;
201
- flex-shrink: 0;
202
- }
203
- .sv-grid-tool-panel-btn {
204
- width: 22px;
205
- height: 22px;
206
- border: 0;
207
- border-radius: 4px;
208
- background: transparent;
209
- color: var(--sg-muted, #64748b);
210
- font-size: 13px;
211
- cursor: pointer;
212
- }
213
- .sv-grid-tool-panel-btn:hover:not(:disabled) {
214
- background: var(--sg-row-hover-bg, rgba(148, 163, 184, 0.18));
215
- color: var(--sg-fg, #0f172a);
216
- }
217
- .sv-grid-tool-panel-btn.is-active {
218
- color: var(--sg-accent, #2563eb);
219
- }
220
- .sv-grid-tool-panel-btn:disabled {
221
- opacity: 0.35;
222
- cursor: default;
223
- }
224
- /* Tool-panel tab bar (Columns | Filters) */
225
- .sv-grid-tool-panel-tabs {
226
- display: flex;
227
- gap: 2px;
228
- padding: 6px 6px 0;
229
- border-bottom: 1px solid var(--sg-border, #e2e8f0);
230
- }
231
- .sv-grid-tool-panel-tab {
232
- flex: 1;
233
- padding: 6px 8px;
234
- border: 0;
235
- border-bottom: 2px solid transparent;
236
- background: transparent;
237
- color: var(--sg-muted, #64748b);
238
- font-size: 12px;
239
- font-weight: 600;
240
- cursor: pointer;
241
- }
242
- .sv-grid-tool-panel-tab:hover {
243
- color: var(--sg-fg, #0f172a);
244
- }
245
- .sv-grid-tool-panel-tab.is-active {
246
- color: var(--sg-accent, #2563eb);
247
- border-bottom-color: var(--sg-accent, #2563eb);
248
- }
249
- /* Filters tab: one control block per filterable column */
250
- .sv-grid-tool-panel-filters {
251
- padding: 6px;
252
- overflow-y: auto;
253
- flex: 1;
254
- display: flex;
255
- flex-direction: column;
256
- gap: 8px;
257
- }
258
- .sv-grid-tp-filter {
259
- display: flex;
260
- flex-direction: column;
261
- gap: 4px;
262
- padding: 6px;
263
- border: 1px solid var(--sg-border, #e2e8f0);
264
- border-radius: 6px;
265
- }
266
- .sv-grid-tp-filter.is-filtered {
267
- border-color: var(--sg-accent, #2563eb);
268
- }
269
- .sv-grid-tp-filter-head {
270
- display: flex;
271
- align-items: center;
272
- justify-content: space-between;
273
- }
274
- .sv-grid-tp-filter-name {
275
- font-size: 12px;
276
- font-weight: 600;
277
- color: var(--sg-fg, #0f172a);
278
- }
279
- .sv-grid-tp-filter-clear {
280
- border: 0;
281
- background: transparent;
282
- color: var(--sg-muted, #64748b);
283
- font-size: 11px;
284
- cursor: pointer;
285
- padding: 0 2px;
286
- }
287
- .sv-grid-tp-filter-clear:hover {
288
- color: var(--sg-accent, #2563eb);
289
- }
290
- .sv-grid-tp-filter-op,
291
- .sv-grid-tp-filter-input {
292
- width: 100%;
293
- box-sizing: border-box;
294
- padding: 4px 6px;
295
- font-size: 12px;
296
- border: 1px solid var(--sg-border, #e2e8f0);
297
- border-radius: 5px;
298
- background: var(--sg-bg, #fff);
299
- color: var(--sg-fg, #0f172a);
300
- }
301
- /* Root wrapper fill mode: only takes effect when consumer passes
302
- * containerHeight='100%'. The shell becomes a flex item that expands
303
- * while the pager keeps its natural height. */
304
- .sv-grid-root-fill {
305
- display: flex;
306
- flex-direction: column;
307
- height: 100%;
308
- min-height: 0;
309
- }
310
- .sv-grid-root-fill > .sv-grid-shell {
311
- flex: 1 1 0;
312
- min-height: 0;
313
- height: auto !important;
314
- }
315
-
316
- .sv-grid-shell {
317
- position: relative;
318
- border-bottom: 1px solid var(--sg-border, #cbd5e1);
319
- }
320
-
321
- .sv-grid-table {
322
- table-layout: fixed;
323
- border-collapse: separate;
324
- border-spacing: 0;
325
- }
326
-
327
- .sv-grid-table:focus {
328
- outline: none;
329
- }
330
-
331
- .sv-grid-column,
332
- .sv-grid-cell {
333
- box-sizing: border-box;
334
- overflow: hidden;
335
- text-overflow: ellipsis;
336
- white-space: nowrap;
337
- background: var(--sg-bg, #fff);
338
- color: var(--sg-fg, #0f172a);
339
- user-select: none;
340
- /* Grid lines ship with the grid so it looks complete out of the box - no
341
- host stylesheet required. Only right + bottom per cell (border-spacing is
342
- 0), so adjacent cells share a single 1px line rather than doubling. */
343
- border-right: 1px solid var(--sg-border, #e2e8f0);
344
- border-bottom: 1px solid var(--sg-border, #e2e8f0);
345
- }
346
- /* The last cell / column in each row drops its right border so the grid's
347
- right edge stays clean (the shell provides the outer frame). */
348
- .sv-grid-table tr > :last-child.sv-grid-column,
349
- .sv-grid-table tr > :last-child.sv-grid-cell {
350
- border-right: 0;
351
- }
352
- /* Row hover tint - opt-in via `enableRowHover` (off by default; the class is
353
- present unless the grid opts in). Uses `background-color` (not the shorthand)
354
- so it never resets the fill-marquee `background-image`, and skips selected
355
- cells so the selection stays visible under a hovered row. */
356
- .sv-grid-table:not(.sv-grid-no-row-hover)
357
- tbody tr:hover > .sv-grid-cell:not([data-selected-range="true"]) {
358
- background-color: var(--sg-row-hover-bg, #eef2ff);
359
- }
360
- /* Only the active cell + the cell hosting the fill handle become a
361
- positioning context (so the absolutely-positioned handle anchors
362
- to the cell box). Adding `position: relative` to EVERY cell paints
363
- each one as its own layout box and noticeably slows vertical
364
- scroll on dense grids - keep it scoped. Sticky / pinned cells are
365
- already positioning contexts via `position: sticky`. */
366
- .sv-grid-cell-active,
367
- .sv-grid-cell-has-fill-handle {
368
- position: relative;
369
- }
370
- /* The cell that owns the fill handle gets overflow: visible so the
371
- handle isn't clipped - chip cells in particular pack pills right up
372
- to the cell edges, and with overflow: hidden the handle's hover
373
- scale-up + the handle itself could be partially eaten by them. */
374
- .sv-grid-cell-has-fill-handle {
375
- overflow: visible;
376
- }
377
-
378
- /* Full-width expandable detail row (props.isDetailRow / renderDetailRow).
379
- Overrides the normal single-line cell clamps so the panel spans every
380
- column and grows to its natural height. Pair with virtualization={false}
381
- so the variable height isn't fought by the fixed-row-height virtualizer.
382
- These rules sit AFTER `.sv-grid-cell` so they win at equal specificity. */
383
- .sv-grid-detail-row {
384
- height: auto !important;
385
- }
386
- .sv-grid-detail-cell {
387
- overflow: visible;
388
- text-overflow: clip;
389
- white-space: normal;
390
- height: auto;
391
- padding: 0;
392
- background: var(--sg-bg, #fff);
393
- user-select: text;
394
- }
395
-
396
- /* Pinned columns read as "frozen" via three layered cues:
397
- 1. A distinct tint (slightly stronger than the header) so the
398
- pinned strip is visible even before you scroll.
399
- 2. A solid 1px divider on the inside edge (toward the scrollable
400
- middle) and a soft drop shadow extending into the scroll area.
401
- 3. A thin accent stripe on the outermost edge that turns on when
402
- the grid scrolls past the pin - a familiar Excel-style cue.
403
- The shadow direction flips based on which side is pinned so it
404
- always points toward the scrollable middle. */
405
- .sv-grid-cell[data-pinned="left"],
406
- .sv-grid-column[data-pinned="left"] {
407
- background: var(--sg-pinned-bg, color-mix(in oklab, var(--sg-header-bg, #f1f5f9) 92%, var(--sg-accent, #2563eb) 8%));
408
- box-shadow:
409
- inset -1px 0 0 var(--sg-pinned-divider, var(--sg-border, #cbd5e1)),
410
- 8px 0 12px -6px rgba(15, 23, 42, 0.22);
411
- }
412
- .sv-grid-cell[data-pinned="right"],
413
- .sv-grid-column[data-pinned="right"] {
414
- background: var(--sg-pinned-bg, color-mix(in oklab, var(--sg-header-bg, #f1f5f9) 92%, var(--sg-accent, #2563eb) 8%));
415
- box-shadow:
416
- inset 1px 0 0 var(--sg-pinned-divider, var(--sg-border, #cbd5e1)),
417
- -8px 0 12px -6px rgba(15, 23, 42, 0.22);
418
- }
419
- /* Header row pinned cells get a slightly darker variant + bolder font
420
- so the frozen header itself reads as part of the grid chrome. */
421
- .sv-grid-head .sv-grid-column[data-pinned="left"],
422
- .sv-grid-head .sv-grid-column[data-pinned="right"] {
423
- background: var(--sg-pinned-header-bg, color-mix(in oklab, var(--sg-header-bg, #f1f5f9) 86%, var(--sg-accent, #2563eb) 14%));
424
- font-weight: 600;
425
- }
426
- /* Zebra striping, opt-in via the `zebraRows` prop (which adds
427
- `.sv-grid-row-alt` to alternating DATA rows only - pinned, group,
428
- detail, and summary rows never get the class, so they keep a single
429
- background). This rule sits before `.sv-grid-row-selected` /
430
- `:hover` so those states paint over the stripe. */
431
- .sv-grid-row-alt > .sv-grid-cell {
432
- background: var(--sg-row-alt-bg, #f8fafc);
433
- }
434
- /* Zebra rows: keep the pinned tint visible (don't let the row-alt
435
- background bleed through) by re-painting the pinned cells. */
436
- .sv-grid-row-alt > .sv-grid-cell[data-pinned] {
437
- background: var(--sg-pinned-bg, color-mix(in oklab, var(--sg-header-bg, #f1f5f9) 92%, var(--sg-accent, #2563eb) 8%));
438
- }
439
- /* When the row is selected, keep the pinned tint but layer the
440
- selection color over it so the row still reads as selected. */
441
- .sv-grid-row-selected > .sv-grid-cell[data-pinned] {
442
- background:
443
- linear-gradient(
444
- color-mix(in srgb, var(--sg-selection-bg, #dbeafe) 65%, transparent),
445
- color-mix(in srgb, var(--sg-selection-bg, #dbeafe) 65%, transparent)
446
- ),
447
- var(--sg-pinned-bg, color-mix(in oklab, var(--sg-header-bg, #f1f5f9) 92%, var(--sg-accent, #2563eb) 8%));
448
- }
449
- /* Hovered row keeps the pinned tint distinguishable from the hover. Selected
450
- cells are excluded so the selection stays visible under hover. */
451
- .sv-grid-table:not(.sv-grid-no-row-hover)
452
- .sv-grid-row:hover > .sv-grid-cell[data-pinned]:not([data-selected-range="true"]) {
453
- background:
454
- linear-gradient(
455
- color-mix(in srgb, var(--sg-row-hover-bg, #eef2ff) 55%, transparent),
456
- color-mix(in srgb, var(--sg-row-hover-bg, #eef2ff) 55%, transparent)
457
- ),
458
- var(--sg-pinned-bg, color-mix(in oklab, var(--sg-header-bg, #f1f5f9) 92%, var(--sg-accent, #2563eb) 8%));
459
- }
460
-
461
- .sv-grid-column {
462
- position: relative;
463
- }
464
-
465
- /* Column alignment via data-align attribute (see getColumnAlign helper).
466
- * For body cells text-align is enough; for headers the label lives inside
467
- * a flex container so we adjust justify-content on the sort button.
468
- * Padding is biased to the aligned side: left-aligned text gets a 7px
469
- * left gap; right-aligned numbers/dates get a 7px right gap. */
470
- .sv-grid-cell[data-align="left"],
471
- .sv-grid-column[data-align="left"] {
472
- padding-left: var(--sg-cell-px, 7px);
473
- }
474
- .sv-grid-cell[data-align="right"] {
475
- text-align: right;
476
- padding-right: var(--sg-cell-px, 7px);
477
- }
478
- .sv-grid-cell[data-align="center"] {
479
- text-align: center;
480
- }
481
- .sv-grid-column[data-align="right"] {
482
- padding-right: var(--sg-cell-px, 7px);
483
- }
484
- .sv-grid-column[data-align="right"] .sv-grid-header-sort {
485
- justify-content: flex-end;
486
- }
487
- /* The custom vertical scrollbar overlays the right 16px of the viewport
488
- (absolute, z-index 40). Nudge the last column's right-aligned content in by
489
- that width when the scrollbar is visible, so numbers/values aren't hidden
490
- underneath it. Left/center content already clears the right edge. */
491
- .sv-grid-has-vscroll .sv-grid-table tr > :last-child.sv-grid-cell[data-align="right"],
492
- .sv-grid-has-vscroll .sv-grid-table tr > :last-child.sv-grid-column[data-align="right"] {
493
- padding-right: calc(var(--sg-cell-px, 7px) + 16px);
494
- }
495
- .sv-grid-column[data-align="center"] .sv-grid-header-sort {
496
- justify-content: center;
497
- }
498
-
499
- .sv-grid-resize-handle {
500
- position: absolute;
501
- top: 0;
502
- right: 0;
503
- width: 5px;
504
- height: 100%;
505
- cursor: col-resize;
506
- user-select: none;
507
- z-index: 2;
508
- transition: background-color 100ms ease;
509
- }
510
-
511
- /* An accent center pill (rather than tinting the whole strip): faint on column
512
- hover, bright when the handle itself is hovered or while dragging. */
513
- .sv-grid-resize-handle::after {
514
- content: "";
515
- position: absolute;
516
- inset: 0;
517
- margin: auto 2px;
518
- width: 2px;
519
- background: var(--sg-fg, #0f172a);
520
- opacity: 0;
521
- border-radius: 1px;
522
- transition: background-color 100ms ease, opacity 100ms ease;
523
- }
524
- .sv-grid-column:hover .sv-grid-resize-handle::after {
525
- opacity: 0.3;
526
- }
527
- .sv-grid-column:hover .sv-grid-resize-handle:hover::after,
528
- .sv-grid-resize-handle.is-resizing::after {
529
- background: var(--sg-accent, #2563eb);
530
- opacity: 1;
531
- }
532
-
533
- /* Row resize handle (counterpart of the column resize handle). Lives
534
- at the bottom of the row-header gutter cell; the consumer opts in
535
- by attaching the `rowResize` action and setting
536
- `cellClass: 'sv-row-gutter'` on the row-header column. */
537
- .sv-grid-row-resize-handle {
538
- /* Geometry + interactivity are also set inline by the rowResize
539
- action so the strip works even if this stylesheet hasn't been
540
- parsed yet. This rule only owns the hover/active tint. */
541
- transition: background-color 100ms ease;
542
- }
543
- .sv-grid-row-resize-handle:hover,
544
- .sv-grid-row-resize-handle.is-resizing {
545
- background: color-mix(in srgb, var(--sg-accent, #0b63f3) 30%, transparent);
546
- }
547
-
548
- .sv-grid-head {
549
- position: sticky;
550
- top: 0;
551
- /* Above pinned body cells (z-index 30 via cellPinStyle). Without
552
- this, when a row scrolls partially behind the sticky header,
553
- its pinned cells (left + right) paint OVER the header while the
554
- middle non-pinned cells are correctly hidden behind it, leaving
555
- "floating" symbol / pnl cells at the top of the viewport. */
556
- z-index: 35;
557
- background: var(--sg-header-bg, #f5f7fb);
558
- }
559
- /* Column-header cells take the header background (and header foreground)
560
- so the header row paints as a solid band rather than body-colored
561
- cells over the sticky header strip. Together with the row-number
562
- gutter below - which uses the same --sg-header-bg - the column headers
563
- and row headers read as one continuous header chrome. */
564
- .sv-grid-head .sv-grid-column {
565
- background: var(--sg-header-bg, #f5f7fb);
566
- /* Header typography is themeable so each design-system preset can match
567
- its real grid header (e.g. Excel bold, Atlassian uppercase + subtle,
568
- shadcn medium + muted). The label/sort-button inherit these. */
569
- color: var(--sg-header-label-color, var(--sg-header-fg, var(--sg-fg, #0f172a)));
570
- font-weight: var(--sg-header-weight, 600);
571
- font-size: var(--sg-header-size, inherit);
572
- text-transform: var(--sg-header-transform, none);
573
- letter-spacing: var(--sg-header-tracking, normal);
574
- }
575
-
576
- /* Header drag-to-reorder. The `draggable` attribute is only set
577
- * when `enableColumnReorder` is true, so the cursor and drop
578
- * indicators only show in that mode. */
579
- .sv-grid-column[draggable="true"] { cursor: grab; }
580
- .sv-grid-column[draggable="true"]:active { cursor: grabbing; }
581
- .sv-grid-column.is-dragging { opacity: 0.55; }
582
- .sv-grid-column.is-drag-target-before,
583
- .sv-grid-column.is-drag-target-after {
584
- position: relative;
585
- }
586
- .sv-grid-column.is-drag-target-before::before,
587
- .sv-grid-column.is-drag-target-after::after {
588
- content: "";
589
- position: absolute; top: 4px; bottom: 4px; width: 3px;
590
- background: linear-gradient(180deg, #6366f1, #8b5cf6);
591
- border-radius: 2px;
592
- box-shadow: 0 0 6px #6366f1;
593
- pointer-events: none;
594
- z-index: 7;
595
- animation: sg-drop-pulse 700ms ease-in-out infinite alternate;
596
- }
597
- .sv-grid-column.is-drag-target-before::before { left: -2px; }
598
- .sv-grid-column.is-drag-target-after::after { right: -2px; }
599
- @keyframes sg-drop-pulse { from { opacity: 0.55; } to { opacity: 1; } }
600
-
601
- /* Managed row dragging ----------------------------------------------------- */
602
- /* The whole row is the drag source; the row-number cell shows a grip so the
603
- * affordance is discoverable. Pair `rowDragManaged` with `showRowNumbers` for
604
- * the grip; without row numbers the grab cursor still hints it. */
605
- .sv-grid-row-draggable { cursor: grab; }
606
- .sv-grid-row-draggable:active { cursor: grabbing; }
607
- .sv-grid-row-draggable .sv-grid-row-number-cell {
608
- position: relative;
609
- padding-left: 14px;
610
- }
611
- .sv-grid-row-draggable .sv-grid-row-number-cell::before {
612
- content: "\2807"; /* braille grip glyph */
613
- position: absolute;
614
- left: 3px;
615
- top: 50%;
616
- transform: translateY(-50%);
617
- font-size: 13px;
618
- line-height: 1;
619
- color: var(--sg-muted, #94a3b8);
620
- opacity: 0.4;
621
- transition: opacity 120ms ease;
622
- pointer-events: none;
623
- }
624
- .sv-grid-row-draggable:hover .sv-grid-row-number-cell::before { opacity: 1; }
625
-
626
- /* Default highlight for an external drop zone (use:rowDropZone) while a
627
- matching row is dragged over it. Consumers can override the class. */
628
- .sv-grid-row-dropzone-over {
629
- outline: 2px dashed var(--sg-accent, #6366f1);
630
- outline-offset: -2px;
631
- background: color-mix(in srgb, var(--sg-accent, #6366f1) 10%, transparent);
632
- }
633
-
634
- /* Drop indicator: a glowing line on the row's top (before) or bottom (after)
635
- * edge. Painted on the cells so it spans the full row across table layouts. */
636
- .sv-grid-row-drop-before > td {
637
- box-shadow: inset 0 2px 0 0 var(--sg-accent, #6366f1);
638
- }
639
- .sv-grid-row-drop-after > td {
640
- box-shadow: inset 0 -2px 0 0 var(--sg-accent, #6366f1);
641
- }
642
-
643
- /* Pinned rows (top / bottom). Each cell sticks individually so the
644
- * row tracks scroll on every browser. Top rows stick below the sticky
645
- * thead via --sg-thead-h; bottom rows stick to the bottom of the
646
- * scroll container. Tinted background distinguishes them from
647
- * regular rows. */
648
- .sv-grid-pinned-row td {
649
- position: sticky;
650
- z-index: 4;
651
- background: var(--sg-pinned-bg, color-mix(in oklab, var(--sg-header-bg, #f1f5f9) 92%, var(--sg-accent, #2563eb) 8%));
652
- border-bottom: 1px solid var(--sg-pinned-border, color-mix(in oklab, var(--sg-accent, #2563eb) 24%, transparent));
653
- font-weight: 600;
654
- }
655
- .sv-grid-pinned-row-top td { top: var(--sg-thead-h, 36px); }
656
- .sv-grid-pinned-row-bottom td { bottom: 0; border-top: 1px solid var(--sg-pinned-border, color-mix(in oklab, var(--sg-accent, #2563eb) 24%, transparent)); }
657
- /* Stack multiple pinned-top rows: row 1 stops at thead, row 2 stops
658
- * at thead + 36px, etc. The component itself sets --sg-pinned-top-h
659
- * to the current pinned-top stack height via $effect. */
660
- .sv-grid-pinned-row-top[data-pinned-index="1"] td { top: calc(var(--sg-thead-h, 36px) + var(--sg-pinned-row-h, 32px)); }
661
- .sv-grid-pinned-row-top[data-pinned-index="2"] td { top: calc(var(--sg-thead-h, 36px) + var(--sg-pinned-row-h, 32px) * 2); }
662
- .sv-grid-pinned-row-top[data-pinned-index="3"] td { top: calc(var(--sg-thead-h, 36px) + var(--sg-pinned-row-h, 32px) * 3); }
663
- .sv-grid-pinned-row-bottom[data-pinned-index="1"] td { bottom: var(--sg-pinned-row-h, 32px); }
664
- .sv-grid-pinned-row-bottom[data-pinned-index="2"] td { bottom: calc(var(--sg-pinned-row-h, 32px) * 2); }
665
- .sv-grid-pinned-row-bottom[data-pinned-index="3"] td { bottom: calc(var(--sg-pinned-row-h, 32px) * 3); }
666
- /* Sticky-left columns keep their left position; just override their
667
- * z so they sit above non-pinned pinned-row cells. */
668
- .sv-grid-pinned-row td[data-pinned] { z-index: 5; }
669
-
670
- /* Group header rows for multi-level (pivot-style) headers. Sits above
671
- * the standard leaf header row when the column tree has nesting. */
672
- .sv-grid-group-header-row {
673
- background: var(--sg-header-bg, #eef2f8);
674
- }
675
- .sv-grid-group-header-cell {
676
- box-sizing: border-box;
677
- border-bottom: 1px solid var(--sg-border, #d8dee9);
678
- border-right: 1px solid var(--sg-border, #e2e8f0);
679
- text-align: center;
680
- padding: 4px 8px;
681
- font-weight: 700;
682
- font-size: 11.5px;
683
- color: var(--sg-header-fg, #475569);
684
- text-transform: uppercase;
685
- letter-spacing: 0.04em;
686
- }
687
- .sv-grid-group-header-placeholder {
688
- background: transparent;
689
- border-right-color: transparent;
690
- }
691
- .sv-grid-group-header-label {
692
- display: inline-block;
693
- max-width: 100%;
694
- overflow: hidden;
695
- text-overflow: ellipsis;
696
- white-space: nowrap;
697
- }
698
- /* Collapse toggle on a collapsible column group header. */
699
- .sv-grid-group-toggle {
700
- display: inline-flex;
701
- align-items: center;
702
- gap: 5px;
703
- max-width: 100%;
704
- border: 0;
705
- background: transparent;
706
- color: inherit;
707
- font: inherit;
708
- letter-spacing: inherit;
709
- text-transform: inherit;
710
- cursor: pointer;
711
- padding: 2px 6px;
712
- border-radius: 5px;
713
- }
714
- .sv-grid-group-toggle:hover {
715
- background: color-mix(in srgb, var(--sg-accent, #2563eb) 12%, transparent);
716
- color: var(--sg-accent, #2563eb);
717
- }
718
- .sv-grid-group-caret {
719
- flex-shrink: 0;
720
- transition: transform 140ms ease;
721
- }
722
- /* Collapsed: point the caret right (like a closed disclosure). */
723
- .sv-grid-group-toggle.is-collapsed .sv-grid-group-caret {
724
- transform: rotate(-90deg);
725
- }
726
-
727
- .sv-grid-foot {
728
- position: sticky;
729
- bottom: 0;
730
- z-index: 6;
731
- background: var(--sg-header-bg, #f5f7fb);
732
- }
733
-
734
- /* Responsive (narrow) mode: smooth momentum touch panning, and let touch
735
- gestures pan the grid freely (the wheel-trap contain stays for pointer). */
736
- .sv-grid-container.sv-grid-narrow {
737
- -webkit-overflow-scrolling: touch;
738
- scroll-behavior: auto;
739
- }
740
-
741
- .sv-grid-container {
742
- scrollbar-width: auto;
743
- -ms-overflow-style: auto;
744
- /* Trap wheel scroll inside the grid. Without this, hitting the top
745
- * or bottom edge of the grid lets the wheel event chain to the
746
- * outer page (or any scrollable ancestor), so what feels like one
747
- * wheel notch keeps scrolling something else - the "starts and
748
- * doesn't stop" symptom. `contain` cancels the chained scroll
749
- * but still bounces normally inside the grid. */
750
- overscroll-behavior: contain;
751
- /* Disable scroll anchoring. The virtualizer changes the top-spacer
752
- * height every time the visible row window slides - modern browsers
753
- * (default `overflow-anchor: auto`) react by quietly adjusting
754
- * `scrollTop` to keep the visible content stable. That adjustment
755
- * fires another `scroll` event, which fires `onBodyScroll`, which
756
- * re-runs the virtualizer, which shifts the spacer again, which
757
- * adjusts `scrollTop` again - a self-sustaining loop that
758
- * presents as "the grid keeps scrolling after the wheel stops."
759
- * Turning anchoring off lets the virtualizer own the scroll
760
- * position outright. */
761
- overflow-anchor: none;
762
- /* Tell the browser that the sticky thead occupies the top
763
- `--sg-thead-h` pixels of the scroll container. `scrollIntoView`
764
- and friends use this to avoid scrolling a row underneath the
765
- sticky header - critical for Excel-style keyboard nav. */
766
- scroll-padding-top: var(--sg-thead-h, 36px);
767
- }
768
-
769
- .sv-grid-container.sv-grid-container-custom-scrollbars {
770
- scrollbar-width: none;
771
- -ms-overflow-style: none;
772
- }
773
-
774
- .sv-grid-container.sv-grid-container-custom-scrollbars::-webkit-scrollbar {
775
- display: none;
776
- }
777
-
778
- .sv-grid-scrollbar {
779
- position: absolute;
780
- /* Above pinned columns (z-index 30 via cellPinStyle) so a frozen
781
- left/right column never paints over the custom scrollbar - that
782
- was the bug behind "vertical scrollbar hidden under the frozen
783
- column" in grids with a pinned column at the right edge. */
784
- z-index: 40;
785
- }
786
-
787
- /* Scrollbars anchor to the inline-end edge so RTL flips them to the
788
- * left automatically. `inset-inline-end` resolves to `right` in LTR
789
- * and `left` in RTL, no manual override needed. */
790
- .sv-grid-scrollbar-vertical {
791
- top: 0;
792
- inset-inline-end: 0;
793
- width: 16px;
794
- height: calc(100% - 16px);
795
- }
796
-
797
- .sv-grid-scrollbar-corner {
798
- position: absolute;
799
- top: 0;
800
- inset-inline-end: 0;
801
- width: 16px;
802
- background: var(--sg-header-bg, #f5f7fb);
803
- border-bottom: 1px solid rgba(15, 23, 42, 0.08);
804
- /* Above pinned header cells (z-index 30) so the gap above the
805
- vertical scrollbar stays clean over a frozen column. */
806
- z-index: 41;
807
- pointer-events: none;
808
- }
809
-
810
- .sv-grid-scrollbar-corner-br {
811
- position: absolute;
812
- inset-inline-end: 0;
813
- bottom: 0;
814
- width: 16px;
815
- height: 16px;
816
- background: var(--sg-header-bg, #eef2f8);
817
- box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.05);
818
- z-index: 42;
819
- pointer-events: none;
820
- }
821
-
822
- .sv-grid-scrollbar-horizontal {
823
- inset-inline-start: 0;
824
- bottom: 0;
825
- width: calc(100% - 16px);
826
- height: 16px;
827
- }
828
-
829
- .sv-grid-selection-column,
830
- .sv-grid-selection-cell {
831
- text-align: center;
832
- padding-inline: 6px;
833
- position: sticky;
834
- z-index: 4;
835
- }
836
-
837
- /* Row-number column: sticks to the left edge of the scroll viewport. */
838
- .sv-grid-row-number-column,
839
- .sv-grid-row-number-cell {
840
- text-align: right;
841
- padding-inline: 8px;
842
- position: sticky;
843
- left: 0;
844
- z-index: 4;
845
- /* Match the column-header band so the row-number gutter and the column
846
- headers form one continuous header chrome. */
847
- background: var(--sg-header-bg, #f5f7fb);
848
- color: var(--sg-muted, #64748b);
849
- font-variant-numeric: tabular-nums;
850
- }
851
- .sv-grid-row-number-head {
852
- color: inherit;
853
- }
854
-
855
- .sv-grid-filter-row-control {
856
- display: flex;
857
- flex-direction: row;
858
- align-items: center;
859
- gap: 4px;
860
- }
861
-
862
- .sv-grid-filter-operator {
863
- flex: 2 1 0;
864
- min-width: 0;
865
- box-sizing: border-box;
866
- }
867
-
868
- .sv-grid-filter-value {
869
- flex: 3 1 0;
870
- min-width: 0;
871
- box-sizing: border-box;
872
- }
873
-
874
- /* Brief glow used when the user clicks the funnel icon while the grid
875
- is in row-filter mode - draws attention to where the input is so
876
- the click isn't a no-op. */
877
- .sv-grid-filter-value.sv-grid-filter-value-pulse {
878
- animation: sv-grid-filter-pulse 700ms ease-out;
879
- }
880
- @keyframes sv-grid-filter-pulse {
881
- 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--sg-accent, #0b63f3) 55%, transparent); }
882
- 70% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--sg-accent, #0b63f3) 0%, transparent); }
883
- 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--sg-accent, #0b63f3) 0%, transparent); }
884
- }
885
-
886
- .sv-grid-checkbox {
887
- position: relative;
888
- display: inline-flex;
889
- align-items: center;
890
- justify-content: center;
891
- width: 16px;
892
- height: 16px;
893
- margin: 0 auto;
894
- border: 1px solid var(--sg-input-border, #8794a8);
895
- border-radius: 4px;
896
- background: var(--sg-input-bg, #fff);
897
- color: var(--sg-accent, #0b63f3);
898
- cursor: pointer;
899
- transition:
900
- border-color 120ms ease,
901
- background-color 120ms ease;
902
- }
903
-
904
- /* Full-row editor: inline editors shown for every editable cell of a row
905
- in full-row edit. Fill the cell so the row reads as a form line. */
906
- .sv-grid-fr-editor {
907
- width: 100%;
908
- box-sizing: border-box;
909
- }
910
- select.sv-grid-fr-editor {
911
- height: 100%;
912
- min-height: 26px;
913
- }
914
- .sv-grid-fr-checkbox {
915
- width: 16px;
916
- height: 16px;
917
- accent-color: var(--sg-accent, #3b82f6);
918
- cursor: pointer;
919
- }
920
-
921
- /* Color editor - native HTML color input filling the cell so the
922
- swatch is clickable across the whole cell area, not just the tiny
923
- OS default size. */
924
- .sv-grid-cell-editor-color {
925
- width: 100%;
926
- height: 100%;
927
- padding: 2px;
928
- border: 0;
929
- background: transparent;
930
- cursor: pointer;
931
- }
932
- .sv-grid-cell-editor-color::-webkit-color-swatch-wrapper { padding: 0; }
933
- .sv-grid-cell-editor-color::-webkit-color-swatch { border: 0; border-radius: 4px; }
934
- .sv-grid-cell-editor-color::-moz-color-swatch { border: 0; border-radius: 4px; }
935
-
936
- /* Rating editor - 5 clickable stars + clear button. Renders inline
937
- in the cell when editorType="rating"; the readonly view renders a
938
- filled-star count via the default text path (or a snippet cell). */
939
- .sv-grid-rating-editor {
940
- display: inline-flex;
941
- align-items: center;
942
- gap: 1px;
943
- height: 100%;
944
- }
945
- .sv-grid-rating-star {
946
- border: 0; background: transparent; cursor: pointer;
947
- color: var(--sg-rating-empty, #cbd5e1);
948
- font-size: 18px; line-height: 1;
949
- padding: 0 1px;
950
- transition: color 80ms ease, transform 80ms ease;
951
- }
952
- .sv-grid-rating-star-on { color: var(--sg-rating-on, #f59e0b); }
953
- .sv-grid-rating-star:hover { color: var(--sg-rating-hover, #fbbf24); transform: scale(1.12); }
954
- .sv-grid-rating-clear {
955
- margin-left: 4px;
956
- border: 0; background: transparent;
957
- color: var(--sg-muted, #94a3b8);
958
- cursor: pointer; font-size: 14px;
959
- }
960
- .sv-grid-rating-clear:hover { color: var(--sg-fg, #0f172a); }
961
-
962
- .sv-grid-checkbox[aria-checked="true"],
963
- .sv-grid-checkbox[aria-checked="mixed"] {
964
- border-color: var(--sg-accent, #2563eb);
965
- background: var(--sg-accent, #2563eb);
966
- color: var(--sg-on-accent, #fff);
967
- }
968
-
969
- .sv-grid-checkbox[aria-checked="true"]::after {
970
- content: "";
971
- width: 5px;
972
- height: 9px;
973
- border-right: 2px solid currentColor;
974
- border-bottom: 2px solid currentColor;
975
- transform: rotate(40deg) translate(-1px, -1px);
976
- }
977
-
978
- .sv-grid-checkbox[aria-checked="mixed"]::after {
979
- content: "";
980
- width: 8px;
981
- height: 2px;
982
- border-radius: 1px;
983
- background: currentColor;
984
- }
985
-
986
- .sv-grid-checkbox:focus-visible {
987
- outline: 2px solid var(--sg-accent, #0b63f3);
988
- outline-offset: 1px;
989
- }
990
-
991
- .sv-grid-checkbox-readonly {
992
- cursor: default;
993
- pointer-events: none;
994
- }
995
-
996
- /* Built-in cell flash (ColumnDef `cellFlash`). Theme-tinted fade; consumers
997
- can pass their own class (e.g. up/down colouring) via `cellFlash.className`. */
998
- @keyframes sv-grid-cell-flash-kf {
999
- 0% { background-color: var(--sg-cell-flash, color-mix(in oklab, var(--sg-accent, #3b82f6) 42%, transparent)); }
1000
- 100% { background-color: transparent; }
1001
- }
1002
- .sv-grid-cell-flash {
1003
- animation: sv-grid-cell-flash-kf 0.7s ease-out;
1004
- }
1005
- @media (prefers-reduced-motion: reduce) {
1006
- .sv-grid-cell-flash { animation: none; }
1007
- }
1008
-
1009
- .sv-grid-cell-active,
1010
- .sv-grid-cell-editing {
1011
- position: relative;
1012
- /* High enough to sit above pinned-column stacking contexts (z=4) so the
1013
- list/chips popover overlays adjacent cells instead of being clipped. */
1014
- z-index: 20;
1015
- /* `box-shadow: inset` is bound to the cell's own box, so the ring
1016
- clips cleanly with the cell when it's partially scrolled out of
1017
- view (and shows up consistently at the right edge of a virtualized
1018
- window). The previous `outline + outline-offset: -2px` rendered at
1019
- the wrong position on clipped cells in some browsers - it's drawn
1020
- outside the layout box, so the negative offset's effect was
1021
- inconsistent at scroll boundaries. */
1022
- box-shadow: inset 0 0 0 2px var(--sg-accent, #0b63f3);
1023
- outline: none;
1024
- /* Let list/chips popouts extend past the cell box (default cells have
1025
- overflow: hidden so the chips picker would otherwise be clipped). */
1026
- overflow: visible;
1027
- }
1028
-
1029
- /* Excel-style fill handle: a 7×7 blue square anchored to the bottom-
1030
- right corner of the active cell or selection range. The parent
1031
- `.sv-grid-cell` is `position: relative` (sticky cells override
1032
- that with sticky - which is also a positioning context), so the
1033
- handle anchors to the cell box. */
1034
- /* Excel-style per-cell note indicator. A small triangle in the top-
1035
- * right corner that, when hovered, shows the note tooltip. The
1036
- * triangle IS the hot-zone (12×12 square clipped to a triangle via
1037
- * border tricks); a transparent invisible square on top widens the
1038
- * hit target a little so it's not painful to hit. */
1039
- .sv-grid-cell-note-corner {
1040
- position: absolute;
1041
- top: 0; right: 0;
1042
- width: 12px; height: 12px;
1043
- /* Triangle: 0,0 → 12,0 → 12,12 */
1044
- background:
1045
- linear-gradient(45deg, transparent 50%, var(--sg-note-corner, #f59e0b) 50%);
1046
- cursor: help;
1047
- z-index: 6;
1048
- }
1049
- /* Slightly larger invisible hit area so users don't have to land on
1050
- a 6×6 pixel triangle. */
1051
- .sv-grid-cell-note-corner::before {
1052
- content: '';
1053
- position: absolute;
1054
- inset: -3px -3px 0 0;
1055
- }
1056
-
1057
- .sv-grid-fill-handle {
1058
- position: absolute;
1059
- /* Sit fully INSIDE the cell box so `overflow: hidden` doesn't clip
1060
- most of the handle. Previously the handle stuck 3px outside the
1061
- cell and the visible 4×4 corner was nearly unclickable - especially
1062
- on chip cells where pills filled the bottom edge. */
1063
- bottom: 0;
1064
- right: 0;
1065
- width: 9px;
1066
- height: 9px;
1067
- background: var(--sg-accent, #0b63f3);
1068
- border: 1px solid var(--sg-bg, #ffffff);
1069
- box-sizing: border-box;
1070
- cursor: crosshair;
1071
- z-index: 15;
1072
- touch-action: none;
1073
- }
1074
- .sv-grid-fill-handle:hover {
1075
- transform: scale(1.3);
1076
- transform-origin: bottom right;
1077
- }
1078
-
1079
- /* Excel-style fill-handle drag marquee: ONE thin dashed rectangle around the
1080
- whole target range (source + fill-into area), not a thick per-cell border or
1081
- fill tint. Drawn as four background-image layers on the boundary cells - no
1082
- `border`, so it paints on the compositor with zero reflow while dragging.
1083
- `--sg-fill-marquee` overrides the colour (defaults to a theme-aware grey). */
1084
- /* Step 1 (LOW specificity): default every edge layer to `none`, then light up
1085
- the edges this cell sits on. These are custom properties, which the
1086
- `background:` shorthands on selected / zebra cells do NOT reset - so they can
1087
- safely live at low specificity and just compete with each other by source
1088
- order (gradient rules come after the defaults, so they win). */
1089
- .sv-grid-cell[data-fill-top="true"],
1090
- .sv-grid-cell[data-fill-bottom="true"],
1091
- .sv-grid-cell[data-fill-left="true"],
1092
- .sv-grid-cell[data-fill-right="true"] {
1093
- --sv-fill-top: none;
1094
- --sv-fill-bottom: none;
1095
- --sv-fill-left: none;
1096
- --sv-fill-right: none;
1097
- /* Match the selection colour (the grid accent) by default. */
1098
- --sv-fill-color: var(--sg-fill-marquee, var(--sg-accent, #2563eb));
1099
- }
1100
- .sv-grid-cell[data-fill-top="true"] {
1101
- --sv-fill-top: repeating-linear-gradient(to right, var(--sv-fill-color) 0 3px, transparent 3px 6px);
1102
- }
1103
- .sv-grid-cell[data-fill-bottom="true"] {
1104
- --sv-fill-bottom: repeating-linear-gradient(to right, var(--sv-fill-color) 0 3px, transparent 3px 6px);
1105
- }
1106
- .sv-grid-cell[data-fill-left="true"] {
1107
- --sv-fill-left: repeating-linear-gradient(to bottom, var(--sv-fill-color) 0 3px, transparent 3px 6px);
1108
- }
1109
- .sv-grid-cell[data-fill-right="true"] {
1110
- --sv-fill-right: repeating-linear-gradient(to bottom, var(--sv-fill-color) 0 3px, transparent 3px 6px);
1111
- }
1112
- /* Step 2 (HIGH specificity, `.sv-grid-table` prefix): compose the resolved edge
1113
- layers into `background-image` so it beats the `background:` shorthands on
1114
- selected / zebra / hover cells (which would otherwise reset background-image).
1115
- The cell keeps its background-COLOR; this only adds the dashed lines on top. */
1116
- .sv-grid-table .sv-grid-cell[data-fill-top="true"],
1117
- .sv-grid-table .sv-grid-cell[data-fill-bottom="true"],
1118
- .sv-grid-table .sv-grid-cell[data-fill-left="true"],
1119
- .sv-grid-table .sv-grid-cell[data-fill-right="true"] {
1120
- background-image: var(--sv-fill-top), var(--sv-fill-bottom),
1121
- var(--sv-fill-left), var(--sv-fill-right);
1122
- background-repeat: no-repeat;
1123
- background-size: 100% 2px, 100% 2px, 2px 100%, 2px 100%;
1124
- background-position: top left, bottom left, top left, top right;
1125
- }
1126
-
1127
- .sv-grid-cell-editing {
1128
- padding: 0;
1129
- }
1130
-
1131
- /* The four CSS variables let us compose a single box-shadow that draws the
1132
- selection rectangle outline only on the cells that sit on its edges. */
1133
- .sv-grid-cell[data-selected-range="true"] {
1134
- background: var(--sg-selection-bg, #eef4ff);
1135
- --sv-range-top: 0 0 0 transparent;
1136
- --sv-range-bottom: 0 0 0 transparent;
1137
- --sv-range-left: 0 0 0 transparent;
1138
- --sv-range-right: 0 0 0 transparent;
1139
- box-shadow: var(--sv-range-top), var(--sv-range-bottom),
1140
- var(--sv-range-left), var(--sv-range-right);
1141
- }
1142
-
1143
- /* Selection-range edges as inset box-shadows. We tried `border-*: 2px
1144
- solid` to dodge the 1px-notch artifact at cell boundaries, but
1145
- border width changes force a full table reflow on every selection
1146
- change - catastrophic during keyboard nav (every arrow key pressed
1147
- re-flows ~30 visible rows + their neighbours under border-collapse).
1148
- Box-shadow inset paints on the compositor only - no reflow. */
1149
- .sv-grid-cell[data-range-top="true"] {
1150
- --sv-range-top: inset 0 2px 0 var(--sg-accent, #0b63f3);
1151
- }
1152
- .sv-grid-cell[data-range-bottom="true"] {
1153
- --sv-range-bottom: inset 0 -2px 0 var(--sg-accent, #0b63f3);
1154
- }
1155
- .sv-grid-cell[data-range-left="true"] {
1156
- --sv-range-left: inset 2px 0 0 var(--sg-accent, #0b63f3);
1157
- }
1158
- .sv-grid-cell[data-range-right="true"] {
1159
- --sv-range-right: inset -2px 0 0 var(--sg-accent, #0b63f3);
1160
- }
1161
-
1162
- /* Lift edge cells above their neighbours so the inset shadow renders
1163
- above adjacent cells' (collapsed) borders rather than under them. */
1164
- .sv-grid-cell[data-range-top="true"],
1165
- .sv-grid-cell[data-range-bottom="true"],
1166
- .sv-grid-cell[data-range-left="true"],
1167
- .sv-grid-cell[data-range-right="true"],
1168
- .sv-grid-cell.sv-merge-edge-right,
1169
- .sv-grid-cell.sv-merge-edge-bottom {
1170
- position: relative;
1171
- z-index: 3;
1172
- }
1173
-
1174
- /* Inherited selection-range edges from `spreadsheetLayout` merges.
1175
- Same inset-shadow technique - no layout impact when toggling. */
1176
- .sv-grid-cell.sv-merge-edge-right {
1177
- box-shadow: inset -2px 0 0 var(--sg-accent, #0b63f3);
1178
- }
1179
- .sv-grid-cell.sv-merge-edge-bottom {
1180
- box-shadow: inset 0 -2px 0 var(--sg-accent, #0b63f3);
1181
- }
1182
- .sv-grid-cell.sv-merge-in-range {
1183
- background: var(--sg-selection-bg, #eef4ff);
1184
- }
1185
-
1186
- .sv-grid-cell-editor {
1187
- position: absolute;
1188
- inset: 0;
1189
- width: 100%;
1190
- height: 100%;
1191
- border: 0;
1192
- outline: none;
1193
- background: var(--sg-input-bg, #fff);
1194
- box-sizing: border-box;
1195
- font: inherit;
1196
- color: inherit;
1197
- padding: 0 8px;
1198
- }
1199
-
1200
- /* Base look for the filter inputs (header filter row, per-column filter, the
1201
- global search box, and the menu's search / condition inputs). The inline cell
1202
- editor is styled separately - it's borderless and fills its cell. Shipping
1203
- this with the grid means filters look like real inputs with no host
1204
- stylesheet. */
1205
- .sv-grid-column-filter,
1206
- .sv-grid-filter-value,
1207
- .sv-grid-global-filter input,
1208
- .sv-grid-menu-search,
1209
- .sv-grid-menu-condition-value {
1210
- background: var(--sg-input-bg, #fff);
1211
- color: var(--sg-fg, #0f172a);
1212
- border: 1px solid var(--sg-input-border, #cbd5e1);
1213
- border-radius: 5px;
1214
- padding: 0 8px;
1215
- box-sizing: border-box;
1216
- font: inherit;
1217
- }
1218
- .sv-grid-column-filter {
1219
- height: 28px;
1220
- width: 100%;
1221
- font-size: 0.8125rem;
1222
- }
1223
- .sv-grid-column-filter::placeholder,
1224
- .sv-grid-filter-value::placeholder,
1225
- .sv-grid-menu-search::placeholder,
1226
- .sv-grid-global-filter input::placeholder,
1227
- .sv-grid-cell-editor::placeholder {
1228
- color: var(--sg-muted, #64748b);
1229
- opacity: 0.7;
1230
- }
1231
-
1232
- /* Calm, theme-aware focus (a soft box-shadow rather than a hard outline). */
1233
- .sv-grid-global-filter input:focus,
1234
- .sv-grid-filter-value:focus,
1235
- .sv-grid-column-filter:focus,
1236
- .sv-grid-menu-search:focus,
1237
- .sv-grid-menu-condition-value:focus,
1238
- .sv-grid-menu-operator:focus,
1239
- .sv-grid-cell-editor:focus {
1240
- outline: none;
1241
- border-color: var(--sg-accent, #2563eb);
1242
- box-shadow: 0 0 0 2px color-mix(in srgb, var(--sg-accent, #2563eb) 30%, transparent);
1243
- }
1244
-
1245
- .sv-grid-cell-editor-number,
1246
- .sv-grid-cell-editor-date,
1247
- .sv-grid-cell-editor-datetime {
1248
- width: 100%;
1249
- height: 100%;
1250
- }
1251
-
1252
- /* List editor: native <select>. For multi-select it grows into a
1253
- small popup-style listbox that hangs over the cell. */
1254
- .sv-grid-cell-editor-list {
1255
- width: 100%;
1256
- height: 100%;
1257
- appearance: auto;
1258
- font: inherit;
1259
- color: inherit;
1260
- background: var(--sg-input-bg, #fff);
1261
- border: 0;
1262
- padding: 0 6px;
1263
- box-sizing: border-box;
1264
- }
1265
- .sv-grid-cell-editor-list[multiple] {
1266
- position: absolute;
1267
- top: 0;
1268
- left: 0;
1269
- right: 0;
1270
- height: auto;
1271
- min-height: 100%;
1272
- max-height: 220px;
1273
- z-index: 5;
1274
- padding: 4px;
1275
- border: 1px solid var(--sg-accent, #0b63f3);
1276
- background: var(--sg-input-bg, #fff);
1277
- box-shadow: 0 8px 24px rgba(15, 23, 42, 0.18);
1278
- }
1279
-
1280
- /* Free-form chips editor (multi-value cell with removable tokens).
1281
- Absolutely positioned so it can grow downward past the row without
1282
- pushing other rows. Theme-aware background + accent border + drop
1283
- shadow so it reads as a popout above the next row, not as part of
1284
- it. The cell's outer outline is suppressed for this editor - this
1285
- popout already provides its own border. */
1286
- .sv-grid-cell-editor-chips {
1287
- position: absolute;
1288
- top: -1px;
1289
- left: -1px;
1290
- right: -1px;
1291
- min-height: calc(100% + 2px);
1292
- background: var(--sg-header-bg, var(--sg-bg, #ffffff));
1293
- color: var(--sg-fg, #0f172a);
1294
- padding: 4px 6px;
1295
- box-sizing: border-box;
1296
- z-index: 1000;
1297
- overflow: visible;
1298
- display: flex;
1299
- align-items: flex-start;
1300
- border: 1px solid var(--sg-accent, #2563eb);
1301
- border-radius: var(--sg-radius, 6px);
1302
- box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45);
1303
- }
1304
- /* When the chips editor is mounted, the parent .sv-grid-cell-editing
1305
- no longer needs its own outline - the popout already shows one. */
1306
- .sv-grid-cell-editing:has(.sv-grid-cell-editor-chips) {
1307
- outline: none;
1308
- }
1309
- .sv-grid-chips-row {
1310
- display: flex;
1311
- flex-wrap: wrap;
1312
- align-items: center;
1313
- gap: 4px;
1314
- width: 100%;
1315
- }
1316
- .sv-grid-chip-input {
1317
- flex: 1 1 80px;
1318
- min-width: 60px;
1319
- border: 0;
1320
- outline: none;
1321
- background: transparent;
1322
- font: inherit;
1323
- color: inherit;
1324
- padding: 2px 4px;
1325
- }
1326
- .sv-grid-chip-picker {
1327
- flex: 1 1 100px;
1328
- min-width: 80px;
1329
- font: inherit;
1330
- color: inherit;
1331
- background: var(--sg-bg, #fff);
1332
- border: 1px solid rgba(15, 23, 42, 0.15);
1333
- border-radius: 4px;
1334
- padding: 2px 4px;
1335
- }
1336
- .sv-grid-chip-commit {
1337
- font-size: 11px;
1338
- text-transform: uppercase;
1339
- letter-spacing: 0.04em;
1340
- color: #fff;
1341
- background: var(--sg-accent, #0b63f3);
1342
- border: 0;
1343
- border-radius: 4px;
1344
- padding: 3px 8px;
1345
- cursor: pointer;
1346
- }
1347
- .sv-grid-chip-commit:hover {
1348
- filter: brightness(1.1);
1349
- }
1350
-
1351
- /* Chip badge - used both in readonly cell display and inside the
1352
- chips editor. Subtle neutral chrome, scales to the row's font size.
1353
- Readonly chip rows stay on one line (the parent <td> has
1354
- overflow: hidden, so overflowing chips get clipped - widen the
1355
- column or open the editor to see all). */
1356
- .sv-grid-chips-display {
1357
- display: inline-flex;
1358
- flex-wrap: nowrap;
1359
- align-items: center;
1360
- gap: 4px;
1361
- max-width: 100%;
1362
- vertical-align: middle;
1363
- }
1364
- .sv-grid-sparkline {
1365
- display: inline-block;
1366
- vertical-align: middle;
1367
- overflow: visible;
1368
- }
1369
- /* Conditional formatting overlays - behind the cell text. */
1370
- .sv-grid-cf-bg {
1371
- position: absolute;
1372
- inset: 0;
1373
- z-index: 0;
1374
- pointer-events: none;
1375
- }
1376
- .sv-grid-cf-bar {
1377
- position: absolute;
1378
- left: 0;
1379
- top: 0;
1380
- bottom: 0;
1381
- z-index: 0;
1382
- opacity: 0.85;
1383
- border-radius: 0 2px 2px 0;
1384
- pointer-events: none;
1385
- }
1386
- .sv-grid-cell-cf {
1387
- position: relative;
1388
- }
1389
- /* Declarative cell validation (column `validate` hook). Invalid cells get a
1390
- * soft red wash and a red inset ring - Handsontable's `htInvalid` look. The
1391
- * value keeps rendering as-is; the message (if any) shows as the tooltip. */
1392
- .sv-grid-cell-invalid {
1393
- background-color: var(--sg-invalid-bg, rgba(239, 68, 68, 0.14)) !important;
1394
- box-shadow: inset 0 0 0 1px var(--sg-invalid-border, rgba(239, 68, 68, 0.45));
1395
- color: var(--sg-invalid-fg, #b91c1c);
1396
- }
1397
- .sv-grid-cell-invalid.sv-grid-cell-active {
1398
- box-shadow: inset 0 0 0 2px var(--sg-invalid-border, rgba(239, 68, 68, 0.7));
1399
- }
1400
- .sv-grid-status-bar {
1401
- display: flex;
1402
- flex-wrap: wrap;
1403
- align-items: center;
1404
- gap: 18px;
1405
- padding: 6px 14px;
1406
- font-size: 12px;
1407
- color: var(--sg-fg);
1408
- background: var(--sg-header-bg, #f1f5f9);
1409
- border: 1px solid var(--sg-border, #e2e8f0);
1410
- border-top: 0;
1411
- flex-shrink: 0;
1412
- }
1413
- .sv-grid-status-item {
1414
- font-variant-numeric: tabular-nums;
1415
- font-weight: 600;
1416
- }
1417
- .sv-grid-status-label {
1418
- color: var(--sg-muted, #64748b);
1419
- font-weight: 400;
1420
- margin-right: 5px;
1421
- }
1422
- .sv-grid-cf-content {
1423
- position: relative;
1424
- z-index: 1;
1425
- }
1426
- .sv-grid-cf-icon {
1427
- margin-right: 5px;
1428
- font-size: 0.95em;
1429
- }
1430
- .sv-grid-chip {
1431
- display: inline-flex;
1432
- align-items: center;
1433
- gap: 4px;
1434
- padding: 2px 8px;
1435
- font-size: 0.85em;
1436
- line-height: 1.4;
1437
- background: color-mix(in srgb, var(--sg-accent, #2563eb) 18%, transparent);
1438
- color: var(--sg-fg, inherit);
1439
- border-radius: 999px;
1440
- border: 1px solid
1441
- color-mix(in srgb, var(--sg-accent, #2563eb) 35%, transparent);
1442
- white-space: nowrap;
1443
- }
1444
- .sv-grid-chip-removable {
1445
- padding-right: 2px;
1446
- }
1447
- .sv-grid-chip-remove {
1448
- display: inline-flex;
1449
- align-items: center;
1450
- justify-content: center;
1451
- width: 16px;
1452
- height: 16px;
1453
- border: 0;
1454
- border-radius: 999px;
1455
- background: color-mix(in srgb, var(--sg-fg, #0f172a) 18%, transparent);
1456
- color: inherit;
1457
- font-size: 12px;
1458
- line-height: 1;
1459
- cursor: pointer;
1460
- padding: 0;
1461
- }
1462
- .sv-grid-chip-remove:hover {
1463
- background: rgba(220, 38, 38, 0.7);
1464
- color: #fff;
1465
- }
1466
-
1467
- .sv-grid-icon {
1468
- width: 1em;
1469
- height: 1em;
1470
- display: block;
1471
- flex: none;
1472
- }
1473
-
1474
- .sv-grid-header-cell {
1475
- display: flex;
1476
- align-items: center;
1477
- gap: 2px;
1478
- width: 100%;
1479
- min-width: 0;
1480
- /* Themeable header height. Defaults to auto (content-driven); presets
1481
- can set a taller header (e.g. Material's roomy data-table header).
1482
- The component measures the rendered header height for sticky offsets,
1483
- so this propagates to --sg-thead-h automatically. */
1484
- min-height: var(--sg-header-min-height, auto);
1485
- }
1486
-
1487
- .sv-grid-header-sort {
1488
- display: flex;
1489
- align-items: center;
1490
- gap: 4px;
1491
- flex: 1 1 auto;
1492
- min-width: 0;
1493
- padding: 2px;
1494
- border: 0;
1495
- background: transparent;
1496
- font: inherit;
1497
- color: inherit;
1498
- text-align: left;
1499
- cursor: pointer;
1500
- }
1501
-
1502
- /* Custom (function-valued) header rendering. Behaves like the sort
1503
- button but is a div so the consumer's snippet can contain its own
1504
- interactive elements (menu buttons, dropdowns, etc) - button-in-
1505
- button DOM is invalid. */
1506
- .sv-grid-header-custom {
1507
- display: flex;
1508
- align-items: center;
1509
- gap: 4px;
1510
- flex: 1 1 auto;
1511
- min-width: 0;
1512
- padding: 2px;
1513
- text-align: left;
1514
- cursor: pointer;
1515
- outline: none;
1516
- }
1517
-
1518
- .sv-grid-header-label {
1519
- /* min-width:0 lets this flex item shrink below its text width so a long
1520
- label truncates to a single line with an ellipsis instead of overflowing
1521
- or forcing the header taller. flex:0 1 auto keeps the sort icon snug to
1522
- the label rather than pushed to the far edge. */
1523
- flex: 0 1 auto;
1524
- min-width: 0;
1525
- overflow: hidden;
1526
- text-overflow: ellipsis;
1527
- white-space: nowrap;
1528
- }
1529
-
1530
- .sv-grid-header-icon {
1531
- display: inline-flex;
1532
- flex: none;
1533
- font-size: 13px;
1534
- color: var(--sg-muted, #5b6b85);
1535
- }
1536
-
1537
- .sv-grid-header-icon-hint {
1538
- opacity: 0;
1539
- transition: opacity 120ms ease;
1540
- }
1541
-
1542
- .sv-grid-column:hover .sv-grid-header-icon-hint {
1543
- opacity: 0.4;
1544
- }
1545
-
1546
- .sv-grid-header-icon-flag {
1547
- color: var(--sg-accent, #0b63f3);
1548
- }
1549
-
1550
- .sv-grid-col-menu-btn {
1551
- display: inline-flex;
1552
- align-items: center;
1553
- justify-content: center;
1554
- flex: none;
1555
- /* Collapse to zero width when invisible so a non-hovered column
1556
- has no dead space at the right; the funnel (when an active
1557
- filter is on) can then sit flush against the right edge.
1558
- Hover / focus / open expand it back to 22px. */
1559
- width: 0;
1560
- height: 22px;
1561
- padding: 0;
1562
- border: 0;
1563
- border-radius: 4px;
1564
- background: transparent;
1565
- color: var(--sg-muted, #5b6b85);
1566
- font-size: 15px;
1567
- cursor: pointer;
1568
- opacity: 0;
1569
- pointer-events: none;
1570
- overflow: hidden;
1571
- transition:
1572
- width 140ms ease,
1573
- opacity 140ms ease,
1574
- background-color 120ms ease;
1575
- }
1576
-
1577
- .sv-grid-column:hover .sv-grid-col-menu-btn,
1578
- .sv-grid-col-menu-btn.is-open,
1579
- .sv-grid-col-menu-btn:focus-visible {
1580
- width: 22px;
1581
- opacity: 1;
1582
- pointer-events: auto;
1583
- }
1584
-
1585
- /* The funnel filter button is a sibling .sv-grid-col-menu-btn that
1586
- ALSO carries .sv-grid-col-filter-btn. When the column has an
1587
- active filter (.is-active) the funnel stays visible at full size
1588
- even when the column isn't hovered - so users can see at a glance
1589
- which columns are filtered. Because the 3-dot menu still collapses
1590
- to width: 0 in that state, the funnel ends up flush against the
1591
- right edge. On hover, the menu expands back to 22px and pushes the
1592
- funnel left naturally. */
1593
- .sv-grid-col-filter-btn.is-active {
1594
- width: 22px;
1595
- opacity: 1;
1596
- pointer-events: auto;
1597
- }
1598
-
1599
- .sv-grid-col-menu-btn:hover,
1600
- .sv-grid-col-menu-btn.is-open {
1601
- background: var(--sg-row-hover-bg, #e2e8f3);
1602
- }
1603
-
1604
- .sv-grid-filter-operator-btn {
1605
- display: inline-flex;
1606
- align-items: center;
1607
- gap: 2px;
1608
- flex: none;
1609
- height: 24px;
1610
- padding: 0 4px;
1611
- border: 1px solid var(--sg-input-border, #cbd5e1);
1612
- border-radius: 4px;
1613
- background: var(--sg-input-bg, #fff);
1614
- color: var(--sg-fg, #334155);
1615
- font-size: 13px;
1616
- cursor: pointer;
1617
- }
1618
-
1619
- .sv-grid-filter-operator-btn.is-open {
1620
- border-color: var(--sg-accent, #0b63f3);
1621
- }
1622
-
1623
- .sv-grid-caret {
1624
- display: inline-flex;
1625
- font-size: 9px;
1626
- color: var(--sg-muted, #94a3b8);
1627
- }
1628
-
1629
- .sv-grid-menu-backdrop {
1630
- position: fixed;
1631
- inset: 0;
1632
- z-index: 900;
1633
- background: transparent;
1634
- }
1635
-
1636
- .sv-grid-menu {
1637
- position: fixed;
1638
- z-index: 901;
1639
- max-height: calc(100vh - 24px);
1640
- overflow: auto;
1641
- padding: 4px;
1642
- background: var(--sg-bg, #fff);
1643
- border: 1px solid var(--sg-border, #d6dee9);
1644
- border-radius: 8px;
1645
- box-shadow: 0 12px 28px rgba(15, 23, 42, 0.18);
1646
- font-size: 13px;
1647
- color: var(--sg-fg, #1f2937);
1648
- }
1649
-
1650
- .sv-grid-column-menu {
1651
- width: 260px;
1652
- }
1653
- /* Column-menu tab bar (General / Filter / Columns). */
1654
- .sv-grid-menu-tabs {
1655
- display: flex;
1656
- gap: 2px;
1657
- margin: -2px -2px 4px;
1658
- padding: 2px 2px 0;
1659
- border-bottom: 1px solid var(--sg-border, #e2e8f0);
1660
- }
1661
- .sv-grid-menu-tab {
1662
- flex: 1;
1663
- padding: 6px 6px;
1664
- border: 0;
1665
- border-bottom: 2px solid transparent;
1666
- background: transparent;
1667
- color: var(--sg-muted, #64748b);
1668
- font-size: 12px;
1669
- font-weight: 600;
1670
- cursor: pointer;
1671
- }
1672
- .sv-grid-menu-tab:hover {
1673
- color: var(--sg-fg, #0f172a);
1674
- }
1675
- .sv-grid-menu-tab.is-active {
1676
- color: var(--sg-accent, #2563eb);
1677
- border-bottom-color: var(--sg-accent, #2563eb);
1678
- }
1679
-
1680
- .sv-grid-operator-menu {
1681
- width: 184px;
1682
- }
1683
-
1684
- .sv-grid-context-menu {
1685
- min-width: 180px;
1686
- }
1687
-
1688
- .sv-grid-comment-editor {
1689
- width: 240px;
1690
- padding: 8px;
1691
- }
1692
- .sv-grid-comment-textarea {
1693
- width: 100%;
1694
- resize: vertical;
1695
- min-height: 60px;
1696
- padding: 6px 8px;
1697
- border: 1px solid var(--sg-input-border, #cbd5e1);
1698
- border-radius: 4px;
1699
- background: var(--sg-input-bg, #fff);
1700
- color: var(--sg-fg, #0f172a);
1701
- font: inherit;
1702
- font-size: 13px;
1703
- outline: none;
1704
- }
1705
- .sv-grid-comment-textarea:focus {
1706
- border-color: var(--sg-accent, #6366f1);
1707
- }
1708
- .sv-grid-comment-actions {
1709
- display: flex;
1710
- align-items: center;
1711
- gap: 6px;
1712
- margin-top: 8px;
1713
- }
1714
- .sv-grid-comment-spacer {
1715
- flex: 1 1 auto;
1716
- }
1717
- .sv-grid-comment-actions button {
1718
- padding: 4px 10px;
1719
- border-radius: 4px;
1720
- border: 1px solid var(--sg-border, #cbd5e1);
1721
- background: var(--sg-bg, #fff);
1722
- color: var(--sg-fg, #1f2937);
1723
- font: inherit;
1724
- font-size: 12px;
1725
- cursor: pointer;
1726
- }
1727
- .sv-grid-comment-save {
1728
- border-color: var(--sg-accent, #6366f1) !important;
1729
- background: var(--sg-accent, #6366f1) !important;
1730
- color: #fff !important;
1731
- }
1732
- .sv-grid-comment-remove {
1733
- color: var(--sg-danger, #dc2626) !important;
1734
- }
1735
-
1736
- .sv-grid-menu-item {
1737
- display: flex;
1738
- align-items: center;
1739
- gap: 8px;
1740
- width: 100%;
1741
- padding: 7px 10px;
1742
- border: 0;
1743
- border-radius: 5px;
1744
- background: transparent;
1745
- color: inherit;
1746
- font: inherit;
1747
- text-align: left;
1748
- cursor: pointer;
1749
- }
1750
-
1751
- .sv-grid-menu-item:hover {
1752
- background: var(--sg-row-hover-bg, #eef2f8);
1753
- }
1754
-
1755
- .sv-grid-menu-item[aria-checked="true"] {
1756
- background: var(--sg-selection-bg, #eaf2ff);
1757
- color: var(--sg-accent, #0b63f3);
1758
- }
1759
-
1760
- .sv-grid-menu-sep {
1761
- height: 1px;
1762
- margin: 4px 6px;
1763
- background: var(--sg-border, #e6ebf2);
1764
- }
1765
-
1766
- .sv-grid-menu-filter {
1767
- padding: 4px 6px 6px;
1768
- }
1769
-
1770
- .sv-grid-menu-filter-head {
1771
- display: flex;
1772
- align-items: center;
1773
- gap: 6px;
1774
- padding: 2px 0 6px;
1775
- font-weight: 600;
1776
- color: var(--sg-muted, #475569);
1777
- }
1778
-
1779
- .sv-grid-menu-search {
1780
- width: 100%;
1781
- height: 28px;
1782
- box-sizing: border-box;
1783
- margin-bottom: 6px;
1784
- padding: 0 8px;
1785
- border: 1px solid var(--sg-input-border, #cbd5e1);
1786
- border-radius: 5px;
1787
- font: inherit;
1788
- }
1789
-
1790
- .sv-grid-menu-filter-row {
1791
- display: flex;
1792
- gap: 4px;
1793
- margin-bottom: 6px;
1794
- }
1795
-
1796
- .sv-grid-menu-operator-group {
1797
- display: flex;
1798
- gap: 2px;
1799
- margin-bottom: 6px;
1800
- }
1801
-
1802
- .sv-grid-menu-operator-btn {
1803
- flex: 1 1 0;
1804
- display: inline-flex;
1805
- align-items: center;
1806
- justify-content: center;
1807
- height: 28px;
1808
- padding: 0;
1809
- border: 1px solid var(--sg-input-border, #cbd5e1);
1810
- border-radius: 4px;
1811
- background: var(--sg-input-bg, #fff);
1812
- color: var(--sg-fg, #475569);
1813
- cursor: pointer;
1814
- transition:
1815
- background-color 100ms ease,
1816
- color 100ms ease,
1817
- border-color 100ms ease;
1818
- }
1819
-
1820
- .sv-grid-menu-operator-btn:hover {
1821
- background: var(--sg-row-hover-bg, #eef2f8);
1822
- }
1823
-
1824
- .sv-grid-menu-operator-btn.is-active {
1825
- background: var(--sg-accent, #0b63f3);
1826
- border-color: var(--sg-accent, #0b63f3);
1827
- color: #fff;
1828
- }
1829
-
1830
- .sv-grid-menu-condition-value {
1831
- flex: 1 1 0;
1832
- min-width: 0;
1833
- height: 28px;
1834
- box-sizing: border-box;
1835
- padding: 0 8px;
1836
- border: 1px solid var(--sg-input-border, #cbd5e1);
1837
- border-radius: 5px;
1838
- font: inherit;
1839
- }
1840
-
1841
- /* Multi-condition filter: AND/OR join toggle + add-condition button. */
1842
- .sv-grid-menu-add-cond {
1843
- align-self: flex-start;
1844
- margin-top: 2px;
1845
- padding: 3px 8px;
1846
- font-size: 11.5px;
1847
- font-weight: 600;
1848
- color: var(--sg-accent, #3b82f6);
1849
- background: transparent;
1850
- border: 1px dashed var(--sg-border, #cbd5e1);
1851
- border-radius: 5px;
1852
- cursor: pointer;
1853
- }
1854
- .sv-grid-menu-add-cond:hover {
1855
- background: color-mix(in oklab, var(--sg-accent, #3b82f6) 8%, transparent);
1856
- border-style: solid;
1857
- }
1858
- .sv-grid-menu-join {
1859
- display: inline-flex;
1860
- align-items: center;
1861
- gap: 2px;
1862
- margin: 2px 0;
1863
- }
1864
- .sv-grid-menu-join button {
1865
- padding: 2px 10px;
1866
- font-size: 11px;
1867
- font-weight: 700;
1868
- color: var(--sg-muted, #64748b);
1869
- background: transparent;
1870
- border: 1px solid var(--sg-border, #cbd5e1);
1871
- cursor: pointer;
1872
- }
1873
- .sv-grid-menu-join button:first-child { border-radius: 5px 0 0 5px; }
1874
- .sv-grid-menu-join button:nth-child(2) { border-radius: 0; border-left: 0; }
1875
- .sv-grid-menu-join button.is-on {
1876
- background: var(--sg-accent, #3b82f6);
1877
- color: #fff;
1878
- border-color: var(--sg-accent, #3b82f6);
1879
- }
1880
- .sv-grid-menu-join-x {
1881
- margin-left: auto;
1882
- border-radius: 5px !important;
1883
- font-size: 14px;
1884
- line-height: 1;
1885
- padding: 2px 7px !important;
1886
- }
1887
-
1888
- .sv-grid-facet-list {
1889
- max-height: 200px;
1890
- overflow: auto;
1891
- border: 1px solid var(--sg-border, #eaeef4);
1892
- border-radius: 5px;
1893
- }
1894
-
1895
- .sv-grid-facet {
1896
- display: flex;
1897
- align-items: center;
1898
- gap: 8px;
1899
- padding: 4px 8px;
1900
- cursor: pointer;
1901
- }
1902
-
1903
- .sv-grid-facet:hover {
1904
- background: var(--sg-row-hover-bg, #f4f6fa);
1905
- }
1906
-
1907
- .sv-grid-facet-all {
1908
- border-bottom: 1px solid var(--sg-border, #eaeef4);
1909
- font-weight: 600;
1910
- }
1911
-
1912
- .sv-grid-facet input {
1913
- flex: none;
1914
- }
1915
-
1916
- .sv-grid-facet-label {
1917
- overflow: hidden;
1918
- text-overflow: ellipsis;
1919
- white-space: nowrap;
1920
- }
1921
-
1922
- .sv-grid-facet-empty,
1923
- .sv-grid-facet-note {
1924
- padding: 6px 8px;
1925
- color: var(--sg-muted, #94a3b8);
1926
- font-size: 12px;
1927
- }
1928
-
1929
- .sv-grid-menu-actions {
1930
- display: flex;
1931
- justify-content: flex-end;
1932
- gap: 6px;
1933
- padding-top: 8px;
1934
- }
1935
-
1936
- .sv-grid-menu-btn {
1937
- padding: 5px 10px;
1938
- border: 1px solid var(--sg-input-border, #cbd5e1);
1939
- border-radius: 5px;
1940
- background: var(--sg-input-bg, #fff);
1941
- color: var(--sg-fg, #334155);
1942
- font: inherit;
1943
- cursor: pointer;
1944
- }
1945
-
1946
- .sv-grid-menu-btn-primary {
1947
- background: var(--sg-accent, #0b63f3);
1948
- border-color: var(--sg-accent, #0b63f3);
1949
- color: #fff;
1950
- }
1951
-
1952
- .sv-grid-menu-item:disabled,
1953
- .sv-grid-menu-btn:disabled {
1954
- opacity: 0.4;
1955
- cursor: default;
1956
- }
1957
-
1958
- .sv-grid-menu-item:disabled:hover {
1959
- background: transparent;
1960
- }
1961
-
1962
- .sv-grid-group-row > .sv-grid-cell {
1963
- background: var(--sg-header-bg, #eef2f8);
1964
- font-weight: 600;
1965
- cursor: pointer;
1966
- }
1967
-
1968
- .sv-grid-row-selected > .sv-grid-cell {
1969
- background: var(--sg-selection-bg, #eaf2ff);
1970
- }
1971
-
1972
- .sv-grid-group-cell {
1973
- padding: 0 12px;
1974
- }
1975
-
1976
- .sv-grid-group-content {
1977
- display: inline-flex;
1978
- align-items: center;
1979
- gap: 6px;
1980
- }
1981
-
1982
- .sv-grid-group-toggle {
1983
- border: 0;
1984
- background: transparent;
1985
- padding: 0 4px 0 0;
1986
- font-size: 11px;
1987
- line-height: 1;
1988
- color: var(--sg-fg, #334155);
1989
- cursor: pointer;
1990
- }
1991
-
1992
- .sv-grid-group-count {
1993
- margin-left: 6px;
1994
- font-weight: 400;
1995
- font-size: 12px;
1996
- color: var(--sg-muted, #64748b);
1997
- }
1998
- .sv-grid-group-agg {
1999
- margin-left: 10px;
2000
- font-size: 12px;
2001
- font-weight: 600;
2002
- color: var(--sg-fg);
2003
- white-space: nowrap;
2004
- }
2005
- .sv-grid-group-agg-label {
2006
- font-weight: 400;
2007
- color: var(--sg-muted, #64748b);
2008
- margin-right: 4px;
2009
- }
2010
- .sv-grid-group-agg-label::after {
2011
- content: ":";
2012
- }
2013
-
2014
- .sv-grid-group-child-indent {
2015
- display: inline-block;
2016
- width: 18px;
2017
- }
2018
-
2019
- /* ---- Custom hover tooltip (column .tooltip + cell notes) ---- */
2020
- .sv-grid-tooltip {
2021
- position: fixed;
2022
- z-index: 10000;
2023
- max-width: 280px;
2024
- padding: 8px 10px;
2025
- background: #0f172a;
2026
- color: #f1f5f9;
2027
- border-radius: var(--sg-radius, 6px);
2028
- font-size: 12px;
2029
- line-height: 1.45;
2030
- box-shadow: 0 8px 24px rgba(15, 23, 42, 0.28);
2031
- pointer-events: none;
2032
- white-space: pre-wrap;
2033
- word-wrap: break-word;
2034
- }
2035
- [data-theme="dark"] .sv-grid-tooltip { background: #f1f5f9; color: #0f172a; }
2036
-
2037
- /* ---- Textarea editor ---- */
2038
- .sv-grid-cell-editor-textarea {
2039
- width: 100%;
2040
- min-height: 80px;
2041
- padding: 6px 8px;
2042
- border: 1px solid var(--sg-accent, #6366f1);
2043
- background: var(--sg-bg, #fff);
2044
- color: var(--sg-fg, #0f172a);
2045
- border-radius: 4px;
2046
- font-family: inherit;
2047
- font-size: 13px;
2048
- line-height: 1.4;
2049
- resize: vertical;
2050
- outline: none;
2051
- box-shadow: var(--sg-focus-ring, 0 0 0 2px rgba(99, 102, 241, 0.40));
2052
- }
2053
-
2054
- .sv-grid-autocomplete {
2055
- position: relative;
2056
- width: 100%;
2057
- }
2058
- .sv-grid-autocomplete-list {
2059
- position: absolute;
2060
- left: 0;
2061
- right: 0;
2062
- top: 100%;
2063
- z-index: 30;
2064
- max-height: 220px;
2065
- overflow: auto;
2066
- margin-top: 2px;
2067
- padding: 4px;
2068
- background: var(--sg-bg, #fff);
2069
- border: 1px solid var(--sg-border, #d6dee9);
2070
- border-radius: var(--sg-radius, 6px);
2071
- box-shadow: 0 12px 28px rgba(15, 23, 42, 0.18);
2072
- }
2073
- .sv-grid-autocomplete-option {
2074
- display: block;
2075
- width: 100%;
2076
- text-align: left;
2077
- padding: 5px 8px;
2078
- border: 0;
2079
- border-radius: 4px;
2080
- background: transparent;
2081
- color: var(--sg-fg, #1f2937);
2082
- font: inherit;
2083
- font-size: 13px;
2084
- cursor: pointer;
2085
- white-space: nowrap;
2086
- overflow: hidden;
2087
- text-overflow: ellipsis;
2088
- }
2089
- .sv-grid-autocomplete-option:hover,
2090
- .sv-grid-autocomplete-option[aria-selected="true"] {
2091
- background: var(--sg-row-hover-bg, rgba(99, 102, 241, 0.10));
2092
- }
2093
-
2094
- /* ---- Find-in-grid overlay ---- */
2095
- .sv-grid-find {
2096
- position: absolute;
2097
- top: 8px; right: 8px;
2098
- z-index: 60;
2099
- display: inline-flex; align-items: center; gap: 4px;
2100
- padding: 6px 8px;
2101
- background: var(--sg-bg, #fff);
2102
- color: var(--sg-fg, #0f172a);
2103
- border: 1px solid var(--sg-border, #cbd5e1);
2104
- border-radius: 8px;
2105
- box-shadow: 0 10px 25px rgba(15, 23, 42, 0.18);
2106
- min-width: 280px;
2107
- }
2108
- .sv-grid-find-icon {
2109
- width: 14px; height: 14px;
2110
- color: var(--sg-muted, #94a3b8);
2111
- flex: none;
2112
- margin-left: 2px;
2113
- }
2114
- .sv-grid-find-input {
2115
- flex: 1; min-width: 0;
2116
- border: 0; outline: none;
2117
- background: transparent;
2118
- color: inherit;
2119
- font-size: 13px;
2120
- padding: 2px 6px;
2121
- }
2122
- .sv-grid-find-input::placeholder { color: var(--sg-muted, #94a3b8); }
2123
- .sv-grid-find-count {
2124
- font-size: 11px;
2125
- color: var(--sg-muted, #64748b);
2126
- font-variant-numeric: tabular-nums;
2127
- padding: 0 4px;
2128
- white-space: nowrap;
2129
- }
2130
- .sv-grid-find-step, .sv-grid-find-close {
2131
- display: inline-flex; align-items: center; justify-content: center;
2132
- width: 22px; height: 22px;
2133
- background: transparent;
2134
- border: 0;
2135
- color: var(--sg-muted, #64748b);
2136
- border-radius: 4px;
2137
- cursor: pointer;
2138
- font-size: 12px;
2139
- }
2140
- .sv-grid-find-step:hover:not(:disabled),
2141
- .sv-grid-find-close:hover {
2142
- background: var(--sg-row-hover-bg, rgba(148, 163, 184, 0.12));
2143
- color: var(--sg-fg, #0f172a);
2144
- }
2145
- .sv-grid-find-step:disabled { opacity: 0.30; cursor: default; }
2146
-
2147
- /* ---- Pagination footer (GridFooter.svelte) ------------------------------
2148
- Ships with the grid so the pager is styled out of the box - previously this
2149
- lived only in the examples' host stylesheet, leaving bare consumers with an
2150
- unstyled pager. Uses --sg-* tokens with fallbacks like the rest of the theme. */
2151
- .sv-grid-pagination {
2152
- display: flex;
2153
- align-items: center;
2154
- justify-content: flex-end;
2155
- gap: 24px;
2156
- padding: 12px 16px;
2157
- margin-top: 0;
2158
- border: 1px solid var(--sg-border, #e2e8f0);
2159
- border-top: 0;
2160
- border-radius: 0 0 var(--sg-radius, 6px) var(--sg-radius, 6px);
2161
- background: var(--sg-header-bg, #f1f5f9);
2162
- color: var(--sg-fg, #0f172a);
2163
- font-size: 13px;
2164
- }
2165
- /* Top-positioned pager: rounded + bordered on the top edge instead. */
2166
- .sv-grid-pagination-top {
2167
- border-top: 1px solid var(--sg-border, #e2e8f0);
2168
- border-bottom: 0;
2169
- border-radius: var(--sg-radius, 6px) var(--sg-radius, 6px) 0 0;
2170
- }
2171
- .sv-grid-pagination-pagesize {
2172
- display: inline-flex;
2173
- align-items: center;
2174
- gap: 8px;
2175
- color: var(--sg-muted, #64748b);
2176
- }
2177
- .sv-grid-pagination-pagesize-dd {
2178
- position: relative;
2179
- height: 28px;
2180
- min-width: 62px;
2181
- border: 1px solid var(--sg-input-border, #cbd5e1);
2182
- border-radius: 5px;
2183
- background: var(--sg-input-bg, #fff);
2184
- }
2185
- .sv-grid-pagination-pagesize-dd .sv-grid-dropdown,
2186
- .sv-grid-pagination-pagesize-dd .sv-grid-dropdown-trigger {
2187
- background: transparent;
2188
- border-radius: 5px;
2189
- font-size: 13px;
2190
- color: var(--sg-fg, #0f172a);
2191
- }
2192
- .sv-grid-pagination-pagesize-dd:focus-within {
2193
- border-color: var(--sg-accent, #2563eb);
2194
- box-shadow: 0 0 0 2px color-mix(in srgb, var(--sg-accent, #2563eb) 30%, transparent);
2195
- }
2196
- .sv-grid-pagination-range {
2197
- color: var(--sg-fg, #0f172a);
2198
- }
2199
- .sv-grid-pagination-nav {
2200
- display: inline-flex;
2201
- align-items: center;
2202
- gap: 4px;
2203
- }
2204
- .sv-grid-pagination-btn {
2205
- display: inline-flex;
2206
- align-items: center;
2207
- justify-content: center;
2208
- width: 28px;
2209
- height: 28px;
2210
- padding: 0;
2211
- border: 0;
2212
- border-radius: 5px;
2213
- background: transparent;
2214
- color: var(--sg-fg, #0f172a);
2215
- font: inherit;
2216
- font-size: 16px;
2217
- cursor: pointer;
2218
- transition: background-color 100ms ease, color 100ms ease;
2219
- }
2220
- .sv-grid-pagination-btn:hover:not(:disabled) {
2221
- background: var(--sg-input-bg, #fff);
2222
- color: var(--sg-accent, #2563eb);
2223
- }
2224
- .sv-grid-pagination-btn:disabled {
2225
- color: var(--sg-muted, #64748b);
2226
- opacity: 0.4;
2227
- cursor: default;
2228
- }
2229
- .sv-grid-pagination-label {
2230
- margin: 0 8px;
2231
- color: var(--sg-fg, #0f172a);
2232
- }
2233
-
2234
- /* ---- Menu / filter chrome completeness -----------------------------------
2235
- These styles previously lived only in the examples' host stylesheet. Shipping
2236
- them here means the column menu, filter/choose-columns popovers, facet
2237
- checklist, operator select, filter buttons, and the scrollbar corner are
2238
- fully themed out of the box for any consumer - all via --sg-* tokens. */
2239
-
2240
- /* Hide the scrollbar corner when its scrollbar is absent. */
2241
- .sv-grid-no-scroll .sv-grid-scrollbar-corner,
2242
- .sv-grid-no-scroll .sv-grid-scrollbar {
2243
- display: none;
2244
- }
2245
- /* Scrollbar corner divider uses the theme border token. */
2246
- .sv-grid-scrollbar-corner,
2247
- .sv-grid-scrollbar-corner-br {
2248
- border-bottom-color: var(--sg-border, #e2e8f0);
2249
- }
2250
-
2251
- /* Filter operator <select> (the dropdown that replaced the radio group). */
2252
- .sv-grid-menu-operator-select {
2253
- width: 100%;
2254
- height: 28px;
2255
- padding: 0 22px 0 8px;
2256
- margin-bottom: 6px;
2257
- border: 1px solid var(--sg-input-border, #cbd5e1);
2258
- border-radius: 5px;
2259
- background: var(--sg-input-bg, #fff);
2260
- color: var(--sg-fg, #0f172a);
2261
- font: inherit;
2262
- font-size: 13px;
2263
- cursor: pointer;
2264
- appearance: none;
2265
- -webkit-appearance: none;
2266
- background-image: linear-gradient(45deg, transparent 50%, currentColor 50%),
2267
- linear-gradient(135deg, currentColor 50%, transparent 50%);
2268
- background-position: calc(100% - 12px) 12px, calc(100% - 8px) 12px;
2269
- background-size: 4px 4px, 4px 4px;
2270
- background-repeat: no-repeat;
2271
- }
2272
- .sv-grid-menu-operator-select:focus {
2273
- outline: none;
2274
- border-color: var(--sg-accent, #2563eb);
2275
- box-shadow: 0 0 0 2px color-mix(in srgb, var(--sg-accent, #2563eb) 40%, transparent);
2276
- }
2277
- /* Operator toggle button (active) uses the on-accent token. */
2278
- .sv-grid-menu-operator-btn.is-active {
2279
- color: var(--sg-on-accent, #fff);
2280
- }
2281
-
2282
- /* Filter-only + choose-columns popover widths. */
2283
- .sv-grid-filter-menu {
2284
- width: 260px;
2285
- }
2286
- .sv-grid-choose-columns-menu {
2287
- width: 240px;
2288
- }
2289
- .sv-grid-choose-columns-menu .sv-grid-facet-list {
2290
- max-height: 280px;
2291
- }
2292
-
2293
- /* Native checkboxes in the facet list pick up the theme accent. */
2294
- .sv-grid-facet input[type="checkbox"] {
2295
- accent-color: var(--sg-accent, #2563eb);
2296
- width: 14px;
2297
- height: 14px;
2298
- cursor: pointer;
2299
- }
2300
-
2301
- /* Submenu right-chevron on the "Choose columns" item. */
2302
- .sv-grid-menu-item-chevron {
2303
- margin-left: auto;
2304
- transform: rotate(-90deg);
2305
- opacity: 0.55;
2306
- }
2307
- .sv-grid-menu-item.is-open .sv-grid-menu-item-chevron {
2308
- opacity: 1;
2309
- }
2310
-
2311
- /* Magnifier prefix on the menu's search input. */
2312
- .sv-grid-menu-search {
2313
- padding-left: 28px;
2314
- background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='6'/%3E%3Cpath d='M20 20l-4.5-4.5'/%3E%3C/svg%3E");
2315
- background-position: 8px center;
2316
- background-repeat: no-repeat;
2317
- background-size: 14px 14px;
2318
- }
2319
-
2320
- /* Filter menu vertical rhythm. */
2321
- .sv-grid-menu-filter > * + * {
2322
- margin-top: 6px;
2323
- }
2324
-
2325
- /* Column-header filter (funnel) button tints accent when a filter is active. */
2326
- .sv-grid-col-filter-btn.is-active {
2327
- color: var(--sg-accent, #2563eb);
2328
- }
2329
-
2330
- /* Row-number gutter: neutralize the right border so it fuses with the header. */
2331
- .sv-grid-row-number-column,
2332
- .sv-grid-row-number-cell {
2333
- border-right-color: var(--sg-header-bg, #f1f5f9);
2334
- }
2335
-
2336
- /* Group row label colour. */
2337
- .sv-grid-group-row > .sv-grid-cell {
2338
- color: var(--sg-header-fg, #0f172a);
2339
- }
2340
-
2341
- /* Filter-row operator button: soften when idle, accent border on hover/open. */
2342
- .sv-grid-filter-operator-btn {
2343
- opacity: 0.85;
2344
- }
2345
- .sv-grid-filter-operator-btn:hover {
2346
- opacity: 1;
2347
- border-color: var(--sg-accent, #2563eb);
2348
- }
2349
- .sv-grid-filter-operator-btn.is-open {
2350
- opacity: 1;
2351
- }
2352
-
2353
- /* Kanban board mode search box (board.searchable) */
2354
- .sv-grid-board-search {
2355
- display: flex;
2356
- align-items: center;
2357
- gap: 6px;
2358
- margin-bottom: 8px;
2359
- padding: 5px 9px;
2360
- border: 1px solid var(--sg-border, #e4e7ec);
2361
- border-radius: var(--sg-radius, 8px);
2362
- background: var(--sg-bg, #fff);
2363
- color: color-mix(in srgb, var(--sg-fg, #101828) 55%, transparent);
2364
- max-width: 280px;
2365
- }
2366
- .sv-grid-board-search:focus-within {
2367
- border-color: var(--sg-accent, #3b82f6);
2368
- }
2369
- .sv-grid-board-search input {
2370
- flex: 1 1 auto;
2371
- border: 0;
2372
- outline: none;
2373
- background: transparent;
2374
- font: inherit;
2375
- font-size: 0.82rem;
2376
- color: var(--sg-fg, #101828);
2377
- }
1
+ /*
2
+ * SvGrid component styles. Extracted from SvGrid.svelte's <style> block so the
3
+ * component file stays focused on logic + markup. These are plain (global) CSS
4
+ * rules - every selector is a unique .sv-grid-* class that maps to a real class
5
+ * on the grid's elements, so behaviour is identical to the former scoped block.
6
+ * Imported for its side effect by SvGrid.svelte; the WC build inlines it and
7
+ * app bundlers include it via the import.
8
+ */
9
+ /* Root wrapper: holds the shell + pager + any overlays (find, tooltips
10
+ * pinned to the root). Position-relative so absolutely-positioned
11
+ * overlays (the find-in-grid toolbar) anchor to the grid, not the
12
+ * viewport. */
13
+ .sv-grid-root {
14
+ position: relative;
15
+ font-family: var(--sg-font, inherit);
16
+ }
17
+ .sv-grid-sr-only {
18
+ position: absolute;
19
+ width: 1px;
20
+ height: 1px;
21
+ overflow: hidden;
22
+ clip: rect(0 0 0 0);
23
+ white-space: nowrap;
24
+ }
25
+ .sv-grid-loading-overlay {
26
+ position: absolute;
27
+ inset: 0;
28
+ z-index: 18;
29
+ pointer-events: auto;
30
+ background: color-mix(in srgb, var(--sg-bg, #fff) 35%, transparent);
31
+ }
32
+ /* Indeterminate top progress bar - the "something is happening" signal
33
+ that keeps the current rows visible underneath (no flash). */
34
+ .sv-grid-loading-bar {
35
+ position: absolute;
36
+ top: 0;
37
+ left: 0;
38
+ right: 0;
39
+ height: 3px;
40
+ overflow: hidden;
41
+ background: color-mix(in srgb, var(--sg-accent, #2563eb) 18%, transparent);
42
+ }
43
+ .sv-grid-loading-bar::before {
44
+ content: '';
45
+ position: absolute;
46
+ inset: 0;
47
+ width: 40%;
48
+ background: var(--sg-accent, #2563eb);
49
+ animation: sv-grid-loading-slide 1.1s ease-in-out infinite;
50
+ }
51
+ @keyframes sv-grid-loading-slide {
52
+ 0% { transform: translateX(-100%); }
53
+ 100% { transform: translateX(350%); }
54
+ }
55
+ /* First-load skeleton: shimmer placeholder rows under the header. */
56
+ .sv-grid-skeleton {
57
+ position: absolute;
58
+ top: var(--sg-thead-h, 40px);
59
+ left: 0;
60
+ right: 0;
61
+ padding: 0;
62
+ overflow: hidden;
63
+ }
64
+ .sv-grid-skeleton-row {
65
+ display: flex;
66
+ height: var(--sg-pinned-row-h, 36px);
67
+ align-items: center;
68
+ border-bottom: 1px solid var(--sg-border, #e2e8f0);
69
+ }
70
+ .sv-grid-skeleton-cell {
71
+ flex-shrink: 0;
72
+ padding: 0 12px;
73
+ box-sizing: border-box;
74
+ }
75
+ .sv-grid-skeleton-bar {
76
+ display: block;
77
+ height: 10px;
78
+ width: 70%;
79
+ border-radius: 4px;
80
+ background: linear-gradient(
81
+ 90deg,
82
+ color-mix(in srgb, var(--sg-muted, #94a3b8) 18%, transparent) 25%,
83
+ color-mix(in srgb, var(--sg-muted, #94a3b8) 32%, transparent) 50%,
84
+ color-mix(in srgb, var(--sg-muted, #94a3b8) 18%, transparent) 75%
85
+ );
86
+ background-size: 200% 100%;
87
+ animation: sv-grid-shimmer 1.3s linear infinite;
88
+ }
89
+ @keyframes sv-grid-shimmer {
90
+ 0% { background-position: 200% 0; }
91
+ 100% { background-position: -200% 0; }
92
+ }
93
+
94
+ /* Grid toolbar strip above the shell - hosts the tool-panel trigger (and is a
95
+ natural home for future grid-level actions). */
96
+ .sv-grid-toolbar {
97
+ display: flex;
98
+ align-items: center;
99
+ gap: 8px;
100
+ padding: 6px 2px;
101
+ }
102
+ .sv-grid-toolbar-btn {
103
+ display: inline-flex;
104
+ align-items: center;
105
+ gap: 6px;
106
+ padding: 6px 12px;
107
+ border: 1px solid var(--sg-border, #e2e8f0);
108
+ border-radius: var(--sg-radius, 6px);
109
+ background: var(--sg-bg, #fff);
110
+ color: var(--sg-fg, #0f172a);
111
+ font-size: 12.5px;
112
+ font-weight: 600;
113
+ cursor: pointer;
114
+ transition: background-color 120ms ease, color 120ms ease, border-color 120ms ease;
115
+ }
116
+ .sv-grid-toolbar-btn:hover {
117
+ border-color: var(--sg-accent, #2563eb);
118
+ color: var(--sg-accent, #2563eb);
119
+ }
120
+ .sv-grid-toolbar-btn.is-active {
121
+ background: var(--sg-accent, #2563eb);
122
+ border-color: var(--sg-accent, #2563eb);
123
+ color: #fff;
124
+ }
125
+ .sv-grid-tool-panel {
126
+ position: absolute;
127
+ top: 0;
128
+ right: 0;
129
+ bottom: 0;
130
+ /* Above the grid's sticky header (z-index 30) and custom scrollbars (z ~900)
131
+ so the docked panel fully overlays the grid instead of the header/right
132
+ columns bleeding through its top-right. Ties the menu layer (901) but the
133
+ menus render later in the DOM, so a column menu opened over the panel still
134
+ wins. */
135
+ z-index: 901;
136
+ width: 250px;
137
+ display: flex;
138
+ flex-direction: column;
139
+ background: var(--sg-bg, #fff);
140
+ border-left: 1px solid var(--sg-border, #e2e8f0);
141
+ box-shadow: -8px 0 24px rgba(0, 0, 0, 0.12);
142
+ }
143
+ .sv-grid-tool-panel-head {
144
+ display: flex;
145
+ align-items: center;
146
+ justify-content: space-between;
147
+ padding: 8px 12px;
148
+ font-size: 12px;
149
+ font-weight: 700;
150
+ text-transform: uppercase;
151
+ letter-spacing: 0.05em;
152
+ color: var(--sg-muted, #64748b);
153
+ border-bottom: 1px solid var(--sg-border, #e2e8f0);
154
+ }
155
+ .sv-grid-tool-panel-close {
156
+ border: 0;
157
+ background: transparent;
158
+ color: var(--sg-muted, #64748b);
159
+ font-size: 14px;
160
+ cursor: pointer;
161
+ }
162
+ .sv-grid-tool-panel-list {
163
+ list-style: none;
164
+ margin: 0;
165
+ padding: 6px;
166
+ overflow-y: auto;
167
+ flex: 1;
168
+ }
169
+ .sv-grid-tool-panel-item {
170
+ display: flex;
171
+ align-items: center;
172
+ justify-content: space-between;
173
+ gap: 6px;
174
+ padding: 3px 6px;
175
+ border-radius: 5px;
176
+ }
177
+ .sv-grid-tool-panel-item:hover {
178
+ background: var(--sg-row-hover-bg, rgba(148, 163, 184, 0.1));
179
+ }
180
+ .sv-grid-tool-panel-vis {
181
+ display: flex;
182
+ align-items: center;
183
+ gap: 8px;
184
+ flex: 1;
185
+ min-width: 0;
186
+ font-size: 13px;
187
+ color: var(--sg-fg, #0f172a);
188
+ cursor: pointer;
189
+ }
190
+ .sv-grid-tool-panel-vis input {
191
+ accent-color: var(--sg-accent, #2563eb);
192
+ }
193
+ .sv-grid-tool-panel-name {
194
+ overflow: hidden;
195
+ text-overflow: ellipsis;
196
+ white-space: nowrap;
197
+ }
198
+ .sv-grid-tool-panel-actions {
199
+ display: inline-flex;
200
+ gap: 2px;
201
+ flex-shrink: 0;
202
+ }
203
+ .sv-grid-tool-panel-btn {
204
+ width: 22px;
205
+ height: 22px;
206
+ border: 0;
207
+ border-radius: 4px;
208
+ background: transparent;
209
+ color: var(--sg-muted, #64748b);
210
+ font-size: 13px;
211
+ cursor: pointer;
212
+ }
213
+ .sv-grid-tool-panel-btn:hover:not(:disabled) {
214
+ background: var(--sg-row-hover-bg, rgba(148, 163, 184, 0.18));
215
+ color: var(--sg-fg, #0f172a);
216
+ }
217
+ .sv-grid-tool-panel-btn.is-active {
218
+ color: var(--sg-accent, #2563eb);
219
+ }
220
+ .sv-grid-tool-panel-btn:disabled {
221
+ opacity: 0.35;
222
+ cursor: default;
223
+ }
224
+ /* Tool-panel tab bar (Columns | Filters) */
225
+ .sv-grid-tool-panel-tabs {
226
+ display: flex;
227
+ gap: 2px;
228
+ padding: 6px 6px 0;
229
+ border-bottom: 1px solid var(--sg-border, #e2e8f0);
230
+ }
231
+ .sv-grid-tool-panel-tab {
232
+ flex: 1;
233
+ padding: 6px 8px;
234
+ border: 0;
235
+ border-bottom: 2px solid transparent;
236
+ background: transparent;
237
+ color: var(--sg-muted, #64748b);
238
+ font-size: 12px;
239
+ font-weight: 600;
240
+ cursor: pointer;
241
+ }
242
+ .sv-grid-tool-panel-tab:hover {
243
+ color: var(--sg-fg, #0f172a);
244
+ }
245
+ .sv-grid-tool-panel-tab.is-active {
246
+ color: var(--sg-accent, #2563eb);
247
+ border-bottom-color: var(--sg-accent, #2563eb);
248
+ }
249
+ /* Filters tab: one control block per filterable column */
250
+ .sv-grid-tool-panel-filters {
251
+ padding: 6px;
252
+ overflow-y: auto;
253
+ flex: 1;
254
+ display: flex;
255
+ flex-direction: column;
256
+ gap: 8px;
257
+ }
258
+ .sv-grid-tp-filter {
259
+ display: flex;
260
+ flex-direction: column;
261
+ gap: 4px;
262
+ padding: 6px;
263
+ border: 1px solid var(--sg-border, #e2e8f0);
264
+ border-radius: 6px;
265
+ }
266
+ .sv-grid-tp-filter.is-filtered {
267
+ border-color: var(--sg-accent, #2563eb);
268
+ }
269
+ .sv-grid-tp-filter-head {
270
+ display: flex;
271
+ align-items: center;
272
+ justify-content: space-between;
273
+ }
274
+ .sv-grid-tp-filter-name {
275
+ font-size: 12px;
276
+ font-weight: 600;
277
+ color: var(--sg-fg, #0f172a);
278
+ }
279
+ .sv-grid-tp-filter-clear {
280
+ border: 0;
281
+ background: transparent;
282
+ color: var(--sg-muted, #64748b);
283
+ font-size: 11px;
284
+ cursor: pointer;
285
+ padding: 0 2px;
286
+ }
287
+ .sv-grid-tp-filter-clear:hover {
288
+ color: var(--sg-accent, #2563eb);
289
+ }
290
+ .sv-grid-tp-filter-op,
291
+ .sv-grid-tp-filter-input {
292
+ width: 100%;
293
+ box-sizing: border-box;
294
+ padding: 4px 6px;
295
+ font-size: 12px;
296
+ border: 1px solid var(--sg-border, #e2e8f0);
297
+ border-radius: 5px;
298
+ background: var(--sg-bg, #fff);
299
+ color: var(--sg-fg, #0f172a);
300
+ }
301
+ /* Root wrapper fill mode: only takes effect when consumer passes
302
+ * containerHeight='100%'. The shell becomes a flex item that expands
303
+ * while the pager keeps its natural height. */
304
+ .sv-grid-root-fill {
305
+ display: flex;
306
+ flex-direction: column;
307
+ height: 100%;
308
+ min-height: 0;
309
+ }
310
+ .sv-grid-root-fill > .sv-grid-shell {
311
+ flex: 1 1 0;
312
+ min-height: 0;
313
+ height: auto !important;
314
+ }
315
+
316
+ .sv-grid-shell {
317
+ position: relative;
318
+ border-bottom: 1px solid var(--sg-border, #cbd5e1);
319
+ }
320
+
321
+ .sv-grid-table {
322
+ table-layout: fixed;
323
+ border-collapse: separate;
324
+ border-spacing: 0;
325
+ }
326
+
327
+ .sv-grid-table:focus {
328
+ outline: none;
329
+ }
330
+
331
+ .sv-grid-column,
332
+ .sv-grid-cell {
333
+ box-sizing: border-box;
334
+ overflow: hidden;
335
+ text-overflow: ellipsis;
336
+ white-space: nowrap;
337
+ background: var(--sg-bg, #fff);
338
+ color: var(--sg-fg, #0f172a);
339
+ user-select: none;
340
+ /* Grid lines ship with the grid so it looks complete out of the box - no
341
+ host stylesheet required. Only right + bottom per cell (border-spacing is
342
+ 0), so adjacent cells share a single 1px line rather than doubling. */
343
+ border-right: 1px solid var(--sg-border, #e2e8f0);
344
+ border-bottom: 1px solid var(--sg-border, #e2e8f0);
345
+ }
346
+ /* The last cell / column in each row drops its right border so the grid's
347
+ right edge stays clean (the shell provides the outer frame). */
348
+ .sv-grid-table tr > :last-child.sv-grid-column,
349
+ .sv-grid-table tr > :last-child.sv-grid-cell {
350
+ border-right: 0;
351
+ }
352
+ /* Row hover tint - opt-in via `enableRowHover` (off by default; the class is
353
+ present unless the grid opts in). Uses `background-color` (not the shorthand)
354
+ so it never resets the fill-marquee `background-image`, and skips selected
355
+ cells so the selection stays visible under a hovered row. */
356
+ .sv-grid-table:not(.sv-grid-no-row-hover)
357
+ tbody tr:hover > .sv-grid-cell:not([data-selected-range="true"]) {
358
+ background-color: var(--sg-row-hover-bg, #eef2ff);
359
+ }
360
+ /* Only the active cell + the cell hosting the fill handle become a
361
+ positioning context (so the absolutely-positioned handle anchors
362
+ to the cell box). Adding `position: relative` to EVERY cell paints
363
+ each one as its own layout box and noticeably slows vertical
364
+ scroll on dense grids - keep it scoped. Sticky / pinned cells are
365
+ already positioning contexts via `position: sticky`. */
366
+ .sv-grid-cell-active,
367
+ .sv-grid-cell-has-fill-handle {
368
+ position: relative;
369
+ }
370
+ /* The cell that owns the fill handle gets overflow: visible so the
371
+ handle isn't clipped - chip cells in particular pack pills right up
372
+ to the cell edges, and with overflow: hidden the handle's hover
373
+ scale-up + the handle itself could be partially eaten by them. */
374
+ .sv-grid-cell-has-fill-handle {
375
+ overflow: visible;
376
+ }
377
+
378
+ /* Full-width expandable detail row (props.isDetailRow / renderDetailRow).
379
+ Overrides the normal single-line cell clamps so the panel spans every
380
+ column and grows to its natural height. Pair with virtualization={false}
381
+ so the variable height isn't fought by the fixed-row-height virtualizer.
382
+ These rules sit AFTER `.sv-grid-cell` so they win at equal specificity. */
383
+ .sv-grid-detail-row {
384
+ height: auto !important;
385
+ }
386
+ .sv-grid-detail-cell {
387
+ overflow: visible;
388
+ text-overflow: clip;
389
+ white-space: normal;
390
+ height: auto;
391
+ padding: 0;
392
+ background: var(--sg-bg, #fff);
393
+ user-select: text;
394
+ }
395
+
396
+ /* Pinned columns read as "frozen" via three layered cues:
397
+ 1. A distinct tint (slightly stronger than the header) so the
398
+ pinned strip is visible even before you scroll.
399
+ 2. A solid 1px divider on the inside edge (toward the scrollable
400
+ middle) and a soft drop shadow extending into the scroll area.
401
+ 3. A thin accent stripe on the outermost edge that turns on when
402
+ the grid scrolls past the pin - a familiar Excel-style cue.
403
+ The shadow direction flips based on which side is pinned so it
404
+ always points toward the scrollable middle. */
405
+ .sv-grid-cell[data-pinned="left"],
406
+ .sv-grid-column[data-pinned="left"] {
407
+ background: var(--sg-pinned-bg, color-mix(in oklab, var(--sg-header-bg, #f1f5f9) 92%, var(--sg-accent, #2563eb) 8%));
408
+ box-shadow:
409
+ inset -1px 0 0 var(--sg-pinned-divider, var(--sg-border, #cbd5e1)),
410
+ 8px 0 12px -6px rgba(15, 23, 42, 0.22);
411
+ }
412
+ .sv-grid-cell[data-pinned="right"],
413
+ .sv-grid-column[data-pinned="right"] {
414
+ background: var(--sg-pinned-bg, color-mix(in oklab, var(--sg-header-bg, #f1f5f9) 92%, var(--sg-accent, #2563eb) 8%));
415
+ box-shadow:
416
+ inset 1px 0 0 var(--sg-pinned-divider, var(--sg-border, #cbd5e1)),
417
+ -8px 0 12px -6px rgba(15, 23, 42, 0.22);
418
+ }
419
+ /* Header row pinned cells get a slightly darker variant + bolder font
420
+ so the frozen header itself reads as part of the grid chrome. */
421
+ .sv-grid-head .sv-grid-column[data-pinned="left"],
422
+ .sv-grid-head .sv-grid-column[data-pinned="right"] {
423
+ background: var(--sg-pinned-header-bg, color-mix(in oklab, var(--sg-header-bg, #f1f5f9) 86%, var(--sg-accent, #2563eb) 14%));
424
+ font-weight: 600;
425
+ }
426
+ /* Zebra striping, opt-in via the `zebraRows` prop (which adds
427
+ `.sv-grid-row-alt` to alternating DATA rows only - pinned, group,
428
+ detail, and summary rows never get the class, so they keep a single
429
+ background). This rule sits before `.sv-grid-row-selected` /
430
+ `:hover` so those states paint over the stripe. */
431
+ .sv-grid-row-alt > .sv-grid-cell {
432
+ background: var(--sg-row-alt-bg, #f8fafc);
433
+ }
434
+ /* Zebra rows: keep the pinned tint visible (don't let the row-alt
435
+ background bleed through) by re-painting the pinned cells. */
436
+ .sv-grid-row-alt > .sv-grid-cell[data-pinned] {
437
+ background: var(--sg-pinned-bg, color-mix(in oklab, var(--sg-header-bg, #f1f5f9) 92%, var(--sg-accent, #2563eb) 8%));
438
+ }
439
+ /* When the row is selected, keep the pinned tint but layer the
440
+ selection color over it so the row still reads as selected. */
441
+ .sv-grid-row-selected > .sv-grid-cell[data-pinned] {
442
+ background:
443
+ linear-gradient(
444
+ color-mix(in srgb, var(--sg-selection-bg, #dbeafe) 65%, transparent),
445
+ color-mix(in srgb, var(--sg-selection-bg, #dbeafe) 65%, transparent)
446
+ ),
447
+ var(--sg-pinned-bg, color-mix(in oklab, var(--sg-header-bg, #f1f5f9) 92%, var(--sg-accent, #2563eb) 8%));
448
+ }
449
+ /* Hovered row keeps the pinned tint distinguishable from the hover. Selected
450
+ cells are excluded so the selection stays visible under hover. */
451
+ .sv-grid-table:not(.sv-grid-no-row-hover)
452
+ .sv-grid-row:hover > .sv-grid-cell[data-pinned]:not([data-selected-range="true"]) {
453
+ background:
454
+ linear-gradient(
455
+ color-mix(in srgb, var(--sg-row-hover-bg, #eef2ff) 55%, transparent),
456
+ color-mix(in srgb, var(--sg-row-hover-bg, #eef2ff) 55%, transparent)
457
+ ),
458
+ var(--sg-pinned-bg, color-mix(in oklab, var(--sg-header-bg, #f1f5f9) 92%, var(--sg-accent, #2563eb) 8%));
459
+ }
460
+
461
+ .sv-grid-column {
462
+ position: relative;
463
+ }
464
+
465
+ /* Column alignment via data-align attribute (see getColumnAlign helper).
466
+ * For body cells text-align is enough; for headers the label lives inside
467
+ * a flex container so we adjust justify-content on the sort button.
468
+ * Padding is biased to the aligned side: left-aligned text gets a 7px
469
+ * left gap; right-aligned numbers/dates get a 7px right gap. */
470
+ .sv-grid-cell[data-align="left"],
471
+ .sv-grid-column[data-align="left"] {
472
+ padding-left: var(--sg-cell-px, 7px);
473
+ }
474
+ .sv-grid-cell[data-align="right"] {
475
+ text-align: right;
476
+ padding-right: var(--sg-cell-px, 7px);
477
+ }
478
+ .sv-grid-cell[data-align="center"] {
479
+ text-align: center;
480
+ }
481
+ .sv-grid-column[data-align="right"] {
482
+ padding-right: var(--sg-cell-px, 7px);
483
+ }
484
+ .sv-grid-column[data-align="right"] .sv-grid-header-sort {
485
+ justify-content: flex-end;
486
+ }
487
+ /* The custom vertical scrollbar overlays the right 16px of the viewport
488
+ (absolute, z-index 40). Nudge the last column's right-aligned content in by
489
+ that width when the scrollbar is visible, so numbers/values aren't hidden
490
+ underneath it. Left/center content already clears the right edge. */
491
+ .sv-grid-has-vscroll .sv-grid-table tr > :last-child.sv-grid-cell[data-align="right"],
492
+ .sv-grid-has-vscroll .sv-grid-table tr > :last-child.sv-grid-column[data-align="right"] {
493
+ padding-right: calc(var(--sg-cell-px, 7px) + 16px);
494
+ }
495
+ .sv-grid-column[data-align="center"] .sv-grid-header-sort {
496
+ justify-content: center;
497
+ }
498
+
499
+ .sv-grid-resize-handle {
500
+ position: absolute;
501
+ top: 0;
502
+ right: 0;
503
+ width: 5px;
504
+ height: 100%;
505
+ cursor: col-resize;
506
+ user-select: none;
507
+ z-index: 2;
508
+ transition: background-color 100ms ease;
509
+ }
510
+
511
+ /* An accent center pill (rather than tinting the whole strip): faint on column
512
+ hover, bright when the handle itself is hovered or while dragging. */
513
+ .sv-grid-resize-handle::after {
514
+ content: "";
515
+ position: absolute;
516
+ inset: 0;
517
+ margin: auto 2px;
518
+ width: 2px;
519
+ background: var(--sg-fg, #0f172a);
520
+ opacity: 0;
521
+ border-radius: 1px;
522
+ transition: background-color 100ms ease, opacity 100ms ease;
523
+ }
524
+ .sv-grid-column:hover .sv-grid-resize-handle::after {
525
+ opacity: 0.3;
526
+ }
527
+ .sv-grid-column:hover .sv-grid-resize-handle:hover::after,
528
+ .sv-grid-resize-handle.is-resizing::after {
529
+ background: var(--sg-accent, #2563eb);
530
+ opacity: 1;
531
+ }
532
+
533
+ /* Row resize handle (counterpart of the column resize handle). Lives
534
+ at the bottom of the row-header gutter cell; the consumer opts in
535
+ by attaching the `rowResize` action and setting
536
+ `cellClass: 'sv-row-gutter'` on the row-header column. */
537
+ .sv-grid-row-resize-handle {
538
+ /* Geometry + interactivity are also set inline by the rowResize
539
+ action so the strip works even if this stylesheet hasn't been
540
+ parsed yet. This rule only owns the hover/active tint. */
541
+ transition: background-color 100ms ease;
542
+ }
543
+ .sv-grid-row-resize-handle:hover,
544
+ .sv-grid-row-resize-handle.is-resizing {
545
+ background: color-mix(in srgb, var(--sg-accent, #0b63f3) 30%, transparent);
546
+ }
547
+
548
+ .sv-grid-head {
549
+ position: sticky;
550
+ top: 0;
551
+ /* Above pinned body cells (z-index 30 via cellPinStyle). Without
552
+ this, when a row scrolls partially behind the sticky header,
553
+ its pinned cells (left + right) paint OVER the header while the
554
+ middle non-pinned cells are correctly hidden behind it, leaving
555
+ "floating" symbol / pnl cells at the top of the viewport. */
556
+ z-index: 35;
557
+ background: var(--sg-header-bg, #f5f7fb);
558
+ }
559
+ /* Column-header cells take the header background (and header foreground)
560
+ so the header row paints as a solid band rather than body-colored
561
+ cells over the sticky header strip. Together with the row-number
562
+ gutter below - which uses the same --sg-header-bg - the column headers
563
+ and row headers read as one continuous header chrome. */
564
+ .sv-grid-head .sv-grid-column {
565
+ background: var(--sg-header-bg, #f5f7fb);
566
+ /* Header typography is themeable so each design-system preset can match
567
+ its real grid header (e.g. Excel bold, Atlassian uppercase + subtle,
568
+ shadcn medium + muted). The label/sort-button inherit these. */
569
+ color: var(--sg-header-label-color, var(--sg-header-fg, var(--sg-fg, #0f172a)));
570
+ font-weight: var(--sg-header-weight, 600);
571
+ font-size: var(--sg-header-size, inherit);
572
+ text-transform: var(--sg-header-transform, none);
573
+ letter-spacing: var(--sg-header-tracking, normal);
574
+ }
575
+
576
+ /* Header drag-to-reorder. The `draggable` attribute is only set
577
+ * when `enableColumnReorder` is true, so the cursor and drop
578
+ * indicators only show in that mode. */
579
+ .sv-grid-column[draggable="true"] { cursor: grab; }
580
+ .sv-grid-column[draggable="true"]:active { cursor: grabbing; }
581
+ .sv-grid-column.is-dragging { opacity: 0.55; }
582
+ .sv-grid-column.is-drag-target-before,
583
+ .sv-grid-column.is-drag-target-after {
584
+ position: relative;
585
+ }
586
+ .sv-grid-column.is-drag-target-before::before,
587
+ .sv-grid-column.is-drag-target-after::after {
588
+ content: "";
589
+ position: absolute; top: 4px; bottom: 4px; width: 3px;
590
+ background: linear-gradient(180deg, #6366f1, #8b5cf6);
591
+ border-radius: 2px;
592
+ box-shadow: 0 0 6px #6366f1;
593
+ pointer-events: none;
594
+ z-index: 7;
595
+ animation: sg-drop-pulse 700ms ease-in-out infinite alternate;
596
+ }
597
+ .sv-grid-column.is-drag-target-before::before { left: -2px; }
598
+ .sv-grid-column.is-drag-target-after::after { right: -2px; }
599
+ @keyframes sg-drop-pulse { from { opacity: 0.55; } to { opacity: 1; } }
600
+
601
+ /* Managed row dragging ----------------------------------------------------- */
602
+ /* The whole row is the drag source; the row-number cell shows a grip so the
603
+ * affordance is discoverable. Pair `rowDragManaged` with `showRowNumbers` for
604
+ * the grip; without row numbers the grab cursor still hints it. */
605
+ .sv-grid-row-draggable { cursor: grab; }
606
+ .sv-grid-row-draggable:active { cursor: grabbing; }
607
+ .sv-grid-row-draggable .sv-grid-row-number-cell {
608
+ position: relative;
609
+ padding-left: 14px;
610
+ }
611
+ .sv-grid-row-draggable .sv-grid-row-number-cell::before {
612
+ content: "\2807"; /* braille grip glyph */
613
+ position: absolute;
614
+ left: 3px;
615
+ top: 50%;
616
+ transform: translateY(-50%);
617
+ font-size: 13px;
618
+ line-height: 1;
619
+ color: var(--sg-muted, #94a3b8);
620
+ opacity: 0.4;
621
+ transition: opacity 120ms ease;
622
+ pointer-events: none;
623
+ }
624
+ .sv-grid-row-draggable:hover .sv-grid-row-number-cell::before { opacity: 1; }
625
+
626
+ /* Default highlight for an external drop zone (use:rowDropZone) while a
627
+ matching row is dragged over it. Consumers can override the class. */
628
+ .sv-grid-row-dropzone-over {
629
+ outline: 2px dashed var(--sg-accent, #6366f1);
630
+ outline-offset: -2px;
631
+ background: color-mix(in srgb, var(--sg-accent, #6366f1) 10%, transparent);
632
+ }
633
+
634
+ /* Drop indicator: a glowing line on the row's top (before) or bottom (after)
635
+ * edge. Painted on the cells so it spans the full row across table layouts. */
636
+ .sv-grid-row-drop-before > td {
637
+ box-shadow: inset 0 2px 0 0 var(--sg-accent, #6366f1);
638
+ }
639
+ .sv-grid-row-drop-after > td {
640
+ box-shadow: inset 0 -2px 0 0 var(--sg-accent, #6366f1);
641
+ }
642
+
643
+ /* Pinned rows (top / bottom). Each cell sticks individually so the
644
+ * row tracks scroll on every browser. Top rows stick below the sticky
645
+ * thead via --sg-thead-h; bottom rows stick to the bottom of the
646
+ * scroll container. Tinted background distinguishes them from
647
+ * regular rows. */
648
+ .sv-grid-pinned-row td {
649
+ position: sticky;
650
+ z-index: 4;
651
+ background: var(--sg-pinned-bg, color-mix(in oklab, var(--sg-header-bg, #f1f5f9) 92%, var(--sg-accent, #2563eb) 8%));
652
+ border-bottom: 1px solid var(--sg-pinned-border, color-mix(in oklab, var(--sg-accent, #2563eb) 24%, transparent));
653
+ font-weight: 600;
654
+ }
655
+ .sv-grid-pinned-row-top td { top: var(--sg-thead-h, 36px); }
656
+ .sv-grid-pinned-row-bottom td { bottom: 0; border-top: 1px solid var(--sg-pinned-border, color-mix(in oklab, var(--sg-accent, #2563eb) 24%, transparent)); }
657
+ /* Stack multiple pinned-top rows: row 1 stops at thead, row 2 stops
658
+ * at thead + 36px, etc. The component itself sets --sg-pinned-top-h
659
+ * to the current pinned-top stack height via $effect. */
660
+ .sv-grid-pinned-row-top[data-pinned-index="1"] td { top: calc(var(--sg-thead-h, 36px) + var(--sg-pinned-row-h, 32px)); }
661
+ .sv-grid-pinned-row-top[data-pinned-index="2"] td { top: calc(var(--sg-thead-h, 36px) + var(--sg-pinned-row-h, 32px) * 2); }
662
+ .sv-grid-pinned-row-top[data-pinned-index="3"] td { top: calc(var(--sg-thead-h, 36px) + var(--sg-pinned-row-h, 32px) * 3); }
663
+ .sv-grid-pinned-row-bottom[data-pinned-index="1"] td { bottom: var(--sg-pinned-row-h, 32px); }
664
+ .sv-grid-pinned-row-bottom[data-pinned-index="2"] td { bottom: calc(var(--sg-pinned-row-h, 32px) * 2); }
665
+ .sv-grid-pinned-row-bottom[data-pinned-index="3"] td { bottom: calc(var(--sg-pinned-row-h, 32px) * 3); }
666
+ /* Sticky-left columns keep their left position; just override their
667
+ * z so they sit above non-pinned pinned-row cells. */
668
+ .sv-grid-pinned-row td[data-pinned] { z-index: 5; }
669
+
670
+ /* Group header rows for multi-level (pivot-style) headers. Sits above
671
+ * the standard leaf header row when the column tree has nesting. */
672
+ .sv-grid-group-header-row {
673
+ background: var(--sg-header-bg, #eef2f8);
674
+ }
675
+ .sv-grid-group-header-cell {
676
+ box-sizing: border-box;
677
+ border-bottom: 1px solid var(--sg-border, #d8dee9);
678
+ border-right: 1px solid var(--sg-border, #e2e8f0);
679
+ text-align: center;
680
+ padding: 4px 8px;
681
+ font-weight: 700;
682
+ font-size: 11.5px;
683
+ color: var(--sg-header-fg, #475569);
684
+ text-transform: uppercase;
685
+ letter-spacing: 0.04em;
686
+ }
687
+ .sv-grid-group-header-placeholder {
688
+ background: transparent;
689
+ border-right-color: transparent;
690
+ }
691
+ .sv-grid-group-header-label {
692
+ display: inline-block;
693
+ max-width: 100%;
694
+ overflow: hidden;
695
+ text-overflow: ellipsis;
696
+ white-space: nowrap;
697
+ }
698
+ /* Collapse toggle on a collapsible column group header. */
699
+ .sv-grid-group-toggle {
700
+ display: inline-flex;
701
+ align-items: center;
702
+ gap: 5px;
703
+ max-width: 100%;
704
+ border: 0;
705
+ background: transparent;
706
+ color: inherit;
707
+ font: inherit;
708
+ letter-spacing: inherit;
709
+ text-transform: inherit;
710
+ cursor: pointer;
711
+ padding: 2px 6px;
712
+ border-radius: 5px;
713
+ }
714
+ .sv-grid-group-toggle:hover {
715
+ background: color-mix(in srgb, var(--sg-accent, #2563eb) 12%, transparent);
716
+ color: var(--sg-accent, #2563eb);
717
+ }
718
+ .sv-grid-group-caret {
719
+ flex-shrink: 0;
720
+ transition: transform 140ms ease;
721
+ }
722
+ /* Collapsed: point the caret right (like a closed disclosure). */
723
+ .sv-grid-group-toggle.is-collapsed .sv-grid-group-caret {
724
+ transform: rotate(-90deg);
725
+ }
726
+
727
+ .sv-grid-foot {
728
+ position: sticky;
729
+ bottom: 0;
730
+ z-index: 6;
731
+ background: var(--sg-header-bg, #f5f7fb);
732
+ }
733
+
734
+ /* Responsive (narrow) mode: smooth momentum touch panning, and let touch
735
+ gestures pan the grid freely (the wheel-trap contain stays for pointer). */
736
+ .sv-grid-container.sv-grid-narrow {
737
+ -webkit-overflow-scrolling: touch;
738
+ scroll-behavior: auto;
739
+ }
740
+
741
+ .sv-grid-container {
742
+ scrollbar-width: auto;
743
+ -ms-overflow-style: auto;
744
+ /* Trap wheel scroll inside the grid. Without this, hitting the top
745
+ * or bottom edge of the grid lets the wheel event chain to the
746
+ * outer page (or any scrollable ancestor), so what feels like one
747
+ * wheel notch keeps scrolling something else - the "starts and
748
+ * doesn't stop" symptom. `contain` cancels the chained scroll
749
+ * but still bounces normally inside the grid. */
750
+ overscroll-behavior: contain;
751
+ /* Disable scroll anchoring. The virtualizer changes the top-spacer
752
+ * height every time the visible row window slides - modern browsers
753
+ * (default `overflow-anchor: auto`) react by quietly adjusting
754
+ * `scrollTop` to keep the visible content stable. That adjustment
755
+ * fires another `scroll` event, which fires `onBodyScroll`, which
756
+ * re-runs the virtualizer, which shifts the spacer again, which
757
+ * adjusts `scrollTop` again - a self-sustaining loop that
758
+ * presents as "the grid keeps scrolling after the wheel stops."
759
+ * Turning anchoring off lets the virtualizer own the scroll
760
+ * position outright. */
761
+ overflow-anchor: none;
762
+ /* Tell the browser that the sticky thead occupies the top
763
+ `--sg-thead-h` pixels of the scroll container. `scrollIntoView`
764
+ and friends use this to avoid scrolling a row underneath the
765
+ sticky header - critical for Excel-style keyboard nav. */
766
+ scroll-padding-top: var(--sg-thead-h, 36px);
767
+ }
768
+
769
+ .sv-grid-container.sv-grid-container-custom-scrollbars {
770
+ scrollbar-width: none;
771
+ -ms-overflow-style: none;
772
+ }
773
+
774
+ .sv-grid-container.sv-grid-container-custom-scrollbars::-webkit-scrollbar {
775
+ display: none;
776
+ }
777
+
778
+ .sv-grid-scrollbar {
779
+ position: absolute;
780
+ /* Above pinned columns (z-index 30 via cellPinStyle) so a frozen
781
+ left/right column never paints over the custom scrollbar - that
782
+ was the bug behind "vertical scrollbar hidden under the frozen
783
+ column" in grids with a pinned column at the right edge. */
784
+ z-index: 40;
785
+ }
786
+
787
+ /* Scrollbars anchor to the inline-end edge so RTL flips them to the
788
+ * left automatically. `inset-inline-end` resolves to `right` in LTR
789
+ * and `left` in RTL, no manual override needed. */
790
+ .sv-grid-scrollbar-vertical {
791
+ top: 0;
792
+ inset-inline-end: 0;
793
+ width: 16px;
794
+ height: calc(100% - 16px);
795
+ }
796
+
797
+ .sv-grid-scrollbar-corner {
798
+ position: absolute;
799
+ top: 0;
800
+ inset-inline-end: 0;
801
+ width: 16px;
802
+ background: var(--sg-header-bg, #f5f7fb);
803
+ border-bottom: 1px solid rgba(15, 23, 42, 0.08);
804
+ /* Above pinned header cells (z-index 30) so the gap above the
805
+ vertical scrollbar stays clean over a frozen column. */
806
+ z-index: 41;
807
+ pointer-events: none;
808
+ }
809
+
810
+ .sv-grid-scrollbar-corner-br {
811
+ position: absolute;
812
+ inset-inline-end: 0;
813
+ bottom: 0;
814
+ width: 16px;
815
+ height: 16px;
816
+ background: var(--sg-header-bg, #eef2f8);
817
+ box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.05);
818
+ z-index: 42;
819
+ pointer-events: none;
820
+ }
821
+
822
+ .sv-grid-scrollbar-horizontal {
823
+ inset-inline-start: 0;
824
+ bottom: 0;
825
+ width: calc(100% - 16px);
826
+ height: 16px;
827
+ }
828
+
829
+ .sv-grid-selection-column,
830
+ .sv-grid-selection-cell {
831
+ text-align: center;
832
+ padding-inline: 6px;
833
+ position: sticky;
834
+ z-index: 4;
835
+ }
836
+
837
+ /* Row-number column: sticks to the left edge of the scroll viewport. */
838
+ .sv-grid-row-number-column,
839
+ .sv-grid-row-number-cell {
840
+ text-align: right;
841
+ padding-inline: 8px;
842
+ position: sticky;
843
+ left: 0;
844
+ z-index: 4;
845
+ /* Match the column-header band so the row-number gutter and the column
846
+ headers form one continuous header chrome. */
847
+ background: var(--sg-header-bg, #f5f7fb);
848
+ color: var(--sg-muted, #64748b);
849
+ font-variant-numeric: tabular-nums;
850
+ }
851
+ .sv-grid-row-number-head {
852
+ color: inherit;
853
+ }
854
+
855
+ .sv-grid-filter-row-control {
856
+ display: flex;
857
+ flex-direction: row;
858
+ align-items: center;
859
+ gap: 4px;
860
+ }
861
+
862
+ .sv-grid-filter-operator {
863
+ flex: 2 1 0;
864
+ min-width: 0;
865
+ box-sizing: border-box;
866
+ }
867
+
868
+ .sv-grid-filter-value {
869
+ flex: 3 1 0;
870
+ min-width: 0;
871
+ box-sizing: border-box;
872
+ }
873
+
874
+ /* Brief glow used when the user clicks the funnel icon while the grid
875
+ is in row-filter mode - draws attention to where the input is so
876
+ the click isn't a no-op. */
877
+ .sv-grid-filter-value.sv-grid-filter-value-pulse {
878
+ animation: sv-grid-filter-pulse 700ms ease-out;
879
+ }
880
+ @keyframes sv-grid-filter-pulse {
881
+ 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--sg-accent, #0b63f3) 55%, transparent); }
882
+ 70% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--sg-accent, #0b63f3) 0%, transparent); }
883
+ 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--sg-accent, #0b63f3) 0%, transparent); }
884
+ }
885
+
886
+ .sv-grid-checkbox {
887
+ position: relative;
888
+ display: inline-flex;
889
+ align-items: center;
890
+ justify-content: center;
891
+ width: 16px;
892
+ height: 16px;
893
+ margin: 0 auto;
894
+ border: 1px solid var(--sg-input-border, #8794a8);
895
+ border-radius: 4px;
896
+ background: var(--sg-input-bg, #fff);
897
+ color: var(--sg-accent, #0b63f3);
898
+ cursor: pointer;
899
+ transition:
900
+ border-color 120ms ease,
901
+ background-color 120ms ease;
902
+ }
903
+
904
+ /* Full-row editor: inline editors shown for every editable cell of a row
905
+ in full-row edit. Fill the cell so the row reads as a form line. */
906
+ .sv-grid-fr-editor {
907
+ width: 100%;
908
+ box-sizing: border-box;
909
+ }
910
+ select.sv-grid-fr-editor {
911
+ height: 100%;
912
+ min-height: 26px;
913
+ }
914
+ .sv-grid-fr-checkbox {
915
+ width: 16px;
916
+ height: 16px;
917
+ accent-color: var(--sg-accent, #3b82f6);
918
+ cursor: pointer;
919
+ }
920
+
921
+ /* Color editor - native HTML color input filling the cell so the
922
+ swatch is clickable across the whole cell area, not just the tiny
923
+ OS default size. */
924
+ .sv-grid-cell-editor-color {
925
+ width: 100%;
926
+ height: 100%;
927
+ padding: 2px;
928
+ border: 0;
929
+ background: transparent;
930
+ cursor: pointer;
931
+ }
932
+ .sv-grid-cell-editor-color::-webkit-color-swatch-wrapper { padding: 0; }
933
+ .sv-grid-cell-editor-color::-webkit-color-swatch { border: 0; border-radius: 4px; }
934
+ .sv-grid-cell-editor-color::-moz-color-swatch { border: 0; border-radius: 4px; }
935
+
936
+ /* Rating editor - 5 clickable stars + clear button. Renders inline
937
+ in the cell when editorType="rating"; the readonly view renders a
938
+ filled-star count via the default text path (or a snippet cell). */
939
+ .sv-grid-rating-editor {
940
+ display: inline-flex;
941
+ align-items: center;
942
+ gap: 1px;
943
+ height: 100%;
944
+ }
945
+ .sv-grid-rating-star {
946
+ border: 0; background: transparent; cursor: pointer;
947
+ color: var(--sg-rating-empty, #cbd5e1);
948
+ font-size: 18px; line-height: 1;
949
+ padding: 0 1px;
950
+ transition: color 80ms ease, transform 80ms ease;
951
+ }
952
+ .sv-grid-rating-star-on { color: var(--sg-rating-on, #f59e0b); }
953
+ .sv-grid-rating-star:hover { color: var(--sg-rating-hover, #fbbf24); transform: scale(1.12); }
954
+ .sv-grid-rating-clear {
955
+ margin-left: 4px;
956
+ border: 0; background: transparent;
957
+ color: var(--sg-muted, #94a3b8);
958
+ cursor: pointer; font-size: 14px;
959
+ }
960
+ .sv-grid-rating-clear:hover { color: var(--sg-fg, #0f172a); }
961
+
962
+ .sv-grid-checkbox[aria-checked="true"],
963
+ .sv-grid-checkbox[aria-checked="mixed"] {
964
+ border-color: var(--sg-accent, #2563eb);
965
+ background: var(--sg-accent, #2563eb);
966
+ color: var(--sg-on-accent, #fff);
967
+ }
968
+
969
+ .sv-grid-checkbox[aria-checked="true"]::after {
970
+ content: "";
971
+ width: 5px;
972
+ height: 9px;
973
+ border-right: 2px solid currentColor;
974
+ border-bottom: 2px solid currentColor;
975
+ transform: rotate(40deg) translate(-1px, -1px);
976
+ }
977
+
978
+ .sv-grid-checkbox[aria-checked="mixed"]::after {
979
+ content: "";
980
+ width: 8px;
981
+ height: 2px;
982
+ border-radius: 1px;
983
+ background: currentColor;
984
+ }
985
+
986
+ .sv-grid-checkbox:focus-visible {
987
+ outline: 2px solid var(--sg-accent, #0b63f3);
988
+ outline-offset: 1px;
989
+ }
990
+
991
+ .sv-grid-checkbox-readonly {
992
+ cursor: default;
993
+ pointer-events: none;
994
+ }
995
+
996
+ /* Built-in cell flash (ColumnDef `cellFlash`). Theme-tinted fade; consumers
997
+ can pass their own class (e.g. up/down colouring) via `cellFlash.className`. */
998
+ @keyframes sv-grid-cell-flash-kf {
999
+ 0% { background-color: var(--sg-cell-flash, color-mix(in oklab, var(--sg-accent, #3b82f6) 42%, transparent)); }
1000
+ 100% { background-color: transparent; }
1001
+ }
1002
+ .sv-grid-cell-flash {
1003
+ animation: sv-grid-cell-flash-kf 0.7s ease-out;
1004
+ }
1005
+ @media (prefers-reduced-motion: reduce) {
1006
+ .sv-grid-cell-flash { animation: none; }
1007
+ }
1008
+
1009
+ .sv-grid-cell-active,
1010
+ .sv-grid-cell-editing {
1011
+ position: relative;
1012
+ /* High enough to sit above pinned-column stacking contexts (z=4) so the
1013
+ list/chips popover overlays adjacent cells instead of being clipped. */
1014
+ z-index: 20;
1015
+ /* `box-shadow: inset` is bound to the cell's own box, so the ring
1016
+ clips cleanly with the cell when it's partially scrolled out of
1017
+ view (and shows up consistently at the right edge of a virtualized
1018
+ window). The previous `outline + outline-offset: -2px` rendered at
1019
+ the wrong position on clipped cells in some browsers - it's drawn
1020
+ outside the layout box, so the negative offset's effect was
1021
+ inconsistent at scroll boundaries. */
1022
+ box-shadow: inset 0 0 0 2px var(--sg-accent, #0b63f3);
1023
+ outline: none;
1024
+ /* Let list/chips popouts extend past the cell box (default cells have
1025
+ overflow: hidden so the chips picker would otherwise be clipped). */
1026
+ overflow: visible;
1027
+ }
1028
+
1029
+ /* Excel-style fill handle: a 7×7 blue square anchored to the bottom-
1030
+ right corner of the active cell or selection range. The parent
1031
+ `.sv-grid-cell` is `position: relative` (sticky cells override
1032
+ that with sticky - which is also a positioning context), so the
1033
+ handle anchors to the cell box. */
1034
+ /* Excel-style per-cell note indicator. A small triangle in the top-
1035
+ * right corner that, when hovered, shows the note tooltip. The
1036
+ * triangle IS the hot-zone (12×12 square clipped to a triangle via
1037
+ * border tricks); a transparent invisible square on top widens the
1038
+ * hit target a little so it's not painful to hit. */
1039
+ .sv-grid-cell-note-corner {
1040
+ position: absolute;
1041
+ top: 0; right: 0;
1042
+ width: 12px; height: 12px;
1043
+ /* Triangle: 0,0 → 12,0 → 12,12 */
1044
+ background:
1045
+ linear-gradient(45deg, transparent 50%, var(--sg-note-corner, #f59e0b) 50%);
1046
+ cursor: help;
1047
+ z-index: 6;
1048
+ }
1049
+ /* Slightly larger invisible hit area so users don't have to land on
1050
+ a 6×6 pixel triangle. */
1051
+ .sv-grid-cell-note-corner::before {
1052
+ content: '';
1053
+ position: absolute;
1054
+ inset: -3px -3px 0 0;
1055
+ }
1056
+
1057
+ .sv-grid-fill-handle {
1058
+ position: absolute;
1059
+ /* Sit fully INSIDE the cell box so `overflow: hidden` doesn't clip
1060
+ most of the handle. Previously the handle stuck 3px outside the
1061
+ cell and the visible 4×4 corner was nearly unclickable - especially
1062
+ on chip cells where pills filled the bottom edge. */
1063
+ bottom: 0;
1064
+ right: 0;
1065
+ width: 9px;
1066
+ height: 9px;
1067
+ background: var(--sg-accent, #0b63f3);
1068
+ border: 1px solid var(--sg-bg, #ffffff);
1069
+ box-sizing: border-box;
1070
+ cursor: crosshair;
1071
+ z-index: 15;
1072
+ touch-action: none;
1073
+ }
1074
+ .sv-grid-fill-handle:hover {
1075
+ transform: scale(1.3);
1076
+ transform-origin: bottom right;
1077
+ }
1078
+
1079
+ /* Excel-style fill-handle drag marquee: ONE thin dashed rectangle around the
1080
+ whole target range (source + fill-into area), not a thick per-cell border or
1081
+ fill tint. Drawn as four background-image layers on the boundary cells - no
1082
+ `border`, so it paints on the compositor with zero reflow while dragging.
1083
+ `--sg-fill-marquee` overrides the colour (defaults to a theme-aware grey). */
1084
+ /* Step 1 (LOW specificity): default every edge layer to `none`, then light up
1085
+ the edges this cell sits on. These are custom properties, which the
1086
+ `background:` shorthands on selected / zebra cells do NOT reset - so they can
1087
+ safely live at low specificity and just compete with each other by source
1088
+ order (gradient rules come after the defaults, so they win). */
1089
+ .sv-grid-cell[data-fill-top="true"],
1090
+ .sv-grid-cell[data-fill-bottom="true"],
1091
+ .sv-grid-cell[data-fill-left="true"],
1092
+ .sv-grid-cell[data-fill-right="true"] {
1093
+ --sv-fill-top: none;
1094
+ --sv-fill-bottom: none;
1095
+ --sv-fill-left: none;
1096
+ --sv-fill-right: none;
1097
+ /* Match the selection colour (the grid accent) by default. */
1098
+ --sv-fill-color: var(--sg-fill-marquee, var(--sg-accent, #2563eb));
1099
+ }
1100
+ .sv-grid-cell[data-fill-top="true"] {
1101
+ --sv-fill-top: repeating-linear-gradient(to right, var(--sv-fill-color) 0 3px, transparent 3px 6px);
1102
+ }
1103
+ .sv-grid-cell[data-fill-bottom="true"] {
1104
+ --sv-fill-bottom: repeating-linear-gradient(to right, var(--sv-fill-color) 0 3px, transparent 3px 6px);
1105
+ }
1106
+ .sv-grid-cell[data-fill-left="true"] {
1107
+ --sv-fill-left: repeating-linear-gradient(to bottom, var(--sv-fill-color) 0 3px, transparent 3px 6px);
1108
+ }
1109
+ .sv-grid-cell[data-fill-right="true"] {
1110
+ --sv-fill-right: repeating-linear-gradient(to bottom, var(--sv-fill-color) 0 3px, transparent 3px 6px);
1111
+ }
1112
+ /* Step 2 (HIGH specificity, `.sv-grid-table` prefix): compose the resolved edge
1113
+ layers into `background-image` so it beats the `background:` shorthands on
1114
+ selected / zebra / hover cells (which would otherwise reset background-image).
1115
+ The cell keeps its background-COLOR; this only adds the dashed lines on top. */
1116
+ .sv-grid-table .sv-grid-cell[data-fill-top="true"],
1117
+ .sv-grid-table .sv-grid-cell[data-fill-bottom="true"],
1118
+ .sv-grid-table .sv-grid-cell[data-fill-left="true"],
1119
+ .sv-grid-table .sv-grid-cell[data-fill-right="true"] {
1120
+ background-image: var(--sv-fill-top), var(--sv-fill-bottom),
1121
+ var(--sv-fill-left), var(--sv-fill-right);
1122
+ background-repeat: no-repeat;
1123
+ background-size: 100% 2px, 100% 2px, 2px 100%, 2px 100%;
1124
+ background-position: top left, bottom left, top left, top right;
1125
+ }
1126
+
1127
+ .sv-grid-cell-editing {
1128
+ padding: 0;
1129
+ }
1130
+
1131
+ /* The four CSS variables let us compose a single box-shadow that draws the
1132
+ selection rectangle outline only on the cells that sit on its edges. */
1133
+ .sv-grid-cell[data-selected-range="true"] {
1134
+ background: var(--sg-selection-bg, #eef4ff);
1135
+ --sv-range-top: 0 0 0 transparent;
1136
+ --sv-range-bottom: 0 0 0 transparent;
1137
+ --sv-range-left: 0 0 0 transparent;
1138
+ --sv-range-right: 0 0 0 transparent;
1139
+ box-shadow: var(--sv-range-top), var(--sv-range-bottom),
1140
+ var(--sv-range-left), var(--sv-range-right);
1141
+ }
1142
+
1143
+ /* Selection-range edges as inset box-shadows. We tried `border-*: 2px
1144
+ solid` to dodge the 1px-notch artifact at cell boundaries, but
1145
+ border width changes force a full table reflow on every selection
1146
+ change - catastrophic during keyboard nav (every arrow key pressed
1147
+ re-flows ~30 visible rows + their neighbours under border-collapse).
1148
+ Box-shadow inset paints on the compositor only - no reflow. */
1149
+ .sv-grid-cell[data-range-top="true"] {
1150
+ --sv-range-top: inset 0 2px 0 var(--sg-accent, #0b63f3);
1151
+ }
1152
+ .sv-grid-cell[data-range-bottom="true"] {
1153
+ --sv-range-bottom: inset 0 -2px 0 var(--sg-accent, #0b63f3);
1154
+ }
1155
+ .sv-grid-cell[data-range-left="true"] {
1156
+ --sv-range-left: inset 2px 0 0 var(--sg-accent, #0b63f3);
1157
+ }
1158
+ .sv-grid-cell[data-range-right="true"] {
1159
+ --sv-range-right: inset -2px 0 0 var(--sg-accent, #0b63f3);
1160
+ }
1161
+
1162
+ /* Lift edge cells above their neighbours so the inset shadow renders
1163
+ above adjacent cells' (collapsed) borders rather than under them. */
1164
+ .sv-grid-cell[data-range-top="true"],
1165
+ .sv-grid-cell[data-range-bottom="true"],
1166
+ .sv-grid-cell[data-range-left="true"],
1167
+ .sv-grid-cell[data-range-right="true"],
1168
+ .sv-grid-cell.sv-merge-edge-right,
1169
+ .sv-grid-cell.sv-merge-edge-bottom {
1170
+ position: relative;
1171
+ z-index: 3;
1172
+ }
1173
+
1174
+ /* Inherited selection-range edges from `spreadsheetLayout` merges.
1175
+ Same inset-shadow technique - no layout impact when toggling. */
1176
+ .sv-grid-cell.sv-merge-edge-right {
1177
+ box-shadow: inset -2px 0 0 var(--sg-accent, #0b63f3);
1178
+ }
1179
+ .sv-grid-cell.sv-merge-edge-bottom {
1180
+ box-shadow: inset 0 -2px 0 var(--sg-accent, #0b63f3);
1181
+ }
1182
+ .sv-grid-cell.sv-merge-in-range {
1183
+ background: var(--sg-selection-bg, #eef4ff);
1184
+ }
1185
+
1186
+ .sv-grid-cell-editor {
1187
+ position: absolute;
1188
+ inset: 0;
1189
+ width: 100%;
1190
+ height: 100%;
1191
+ border: 0;
1192
+ outline: none;
1193
+ background: var(--sg-input-bg, #fff);
1194
+ box-sizing: border-box;
1195
+ font: inherit;
1196
+ color: inherit;
1197
+ padding: 0 8px;
1198
+ }
1199
+
1200
+ /* Base look for the filter inputs (header filter row, per-column filter, the
1201
+ global search box, and the menu's search / condition inputs). The inline cell
1202
+ editor is styled separately - it's borderless and fills its cell. Shipping
1203
+ this with the grid means filters look like real inputs with no host
1204
+ stylesheet. */
1205
+ .sv-grid-column-filter,
1206
+ .sv-grid-filter-value,
1207
+ .sv-grid-global-filter input,
1208
+ .sv-grid-menu-search,
1209
+ .sv-grid-menu-condition-value {
1210
+ background: var(--sg-input-bg, #fff);
1211
+ color: var(--sg-fg, #0f172a);
1212
+ border: 1px solid var(--sg-input-border, #cbd5e1);
1213
+ border-radius: 5px;
1214
+ padding: 0 8px;
1215
+ box-sizing: border-box;
1216
+ font: inherit;
1217
+ }
1218
+ .sv-grid-column-filter {
1219
+ height: 28px;
1220
+ width: 100%;
1221
+ font-size: 0.8125rem;
1222
+ }
1223
+ .sv-grid-column-filter::placeholder,
1224
+ .sv-grid-filter-value::placeholder,
1225
+ .sv-grid-menu-search::placeholder,
1226
+ .sv-grid-global-filter input::placeholder,
1227
+ .sv-grid-cell-editor::placeholder {
1228
+ color: var(--sg-muted, #64748b);
1229
+ opacity: 0.7;
1230
+ }
1231
+
1232
+ /* Calm, theme-aware focus (a soft box-shadow rather than a hard outline). */
1233
+ .sv-grid-global-filter input:focus,
1234
+ .sv-grid-filter-value:focus,
1235
+ .sv-grid-column-filter:focus,
1236
+ .sv-grid-menu-search:focus,
1237
+ .sv-grid-menu-condition-value:focus,
1238
+ .sv-grid-menu-operator:focus,
1239
+ .sv-grid-cell-editor:focus {
1240
+ outline: none;
1241
+ border-color: var(--sg-accent, #2563eb);
1242
+ box-shadow: 0 0 0 2px color-mix(in srgb, var(--sg-accent, #2563eb) 30%, transparent);
1243
+ }
1244
+
1245
+ .sv-grid-cell-editor-number,
1246
+ .sv-grid-cell-editor-date,
1247
+ .sv-grid-cell-editor-datetime {
1248
+ width: 100%;
1249
+ height: 100%;
1250
+ }
1251
+
1252
+ /* List editor: native <select>. For multi-select it grows into a
1253
+ small popup-style listbox that hangs over the cell. */
1254
+ .sv-grid-cell-editor-list {
1255
+ width: 100%;
1256
+ height: 100%;
1257
+ appearance: auto;
1258
+ font: inherit;
1259
+ color: inherit;
1260
+ background: var(--sg-input-bg, #fff);
1261
+ border: 0;
1262
+ padding: 0 6px;
1263
+ box-sizing: border-box;
1264
+ }
1265
+ .sv-grid-cell-editor-list[multiple] {
1266
+ position: absolute;
1267
+ top: 0;
1268
+ left: 0;
1269
+ right: 0;
1270
+ height: auto;
1271
+ min-height: 100%;
1272
+ max-height: 220px;
1273
+ z-index: 5;
1274
+ padding: 4px;
1275
+ border: 1px solid var(--sg-accent, #0b63f3);
1276
+ background: var(--sg-input-bg, #fff);
1277
+ box-shadow: 0 8px 24px rgba(15, 23, 42, 0.18);
1278
+ }
1279
+
1280
+ /* Free-form chips editor (multi-value cell with removable tokens).
1281
+ Absolutely positioned so it can grow downward past the row without
1282
+ pushing other rows. Theme-aware background + accent border + drop
1283
+ shadow so it reads as a popout above the next row, not as part of
1284
+ it. The cell's outer outline is suppressed for this editor - this
1285
+ popout already provides its own border. */
1286
+ .sv-grid-cell-editor-chips {
1287
+ position: absolute;
1288
+ top: -1px;
1289
+ left: -1px;
1290
+ right: -1px;
1291
+ min-height: calc(100% + 2px);
1292
+ background: var(--sg-header-bg, var(--sg-bg, #ffffff));
1293
+ color: var(--sg-fg, #0f172a);
1294
+ padding: 4px 6px;
1295
+ box-sizing: border-box;
1296
+ z-index: 1000;
1297
+ overflow: visible;
1298
+ display: flex;
1299
+ align-items: flex-start;
1300
+ border: 1px solid var(--sg-accent, #2563eb);
1301
+ border-radius: var(--sg-radius, 6px);
1302
+ box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45);
1303
+ }
1304
+ /* When the chips editor is mounted, the parent .sv-grid-cell-editing
1305
+ no longer needs its own outline - the popout already shows one. */
1306
+ .sv-grid-cell-editing:has(.sv-grid-cell-editor-chips) {
1307
+ outline: none;
1308
+ }
1309
+ .sv-grid-chips-row {
1310
+ display: flex;
1311
+ flex-wrap: wrap;
1312
+ align-items: center;
1313
+ gap: 4px;
1314
+ width: 100%;
1315
+ }
1316
+ .sv-grid-chip-input {
1317
+ flex: 1 1 80px;
1318
+ min-width: 60px;
1319
+ border: 0;
1320
+ outline: none;
1321
+ background: transparent;
1322
+ font: inherit;
1323
+ color: inherit;
1324
+ padding: 2px 4px;
1325
+ }
1326
+ .sv-grid-chip-picker {
1327
+ flex: 1 1 100px;
1328
+ min-width: 80px;
1329
+ font: inherit;
1330
+ color: inherit;
1331
+ background: var(--sg-bg, #fff);
1332
+ border: 1px solid rgba(15, 23, 42, 0.15);
1333
+ border-radius: 4px;
1334
+ padding: 2px 4px;
1335
+ }
1336
+ .sv-grid-chip-commit {
1337
+ font-size: 11px;
1338
+ text-transform: uppercase;
1339
+ letter-spacing: 0.04em;
1340
+ color: #fff;
1341
+ background: var(--sg-accent, #0b63f3);
1342
+ border: 0;
1343
+ border-radius: 4px;
1344
+ padding: 3px 8px;
1345
+ cursor: pointer;
1346
+ }
1347
+ .sv-grid-chip-commit:hover {
1348
+ filter: brightness(1.1);
1349
+ }
1350
+
1351
+ /* Chip badge - used both in readonly cell display and inside the
1352
+ chips editor. Subtle neutral chrome, scales to the row's font size.
1353
+ Readonly chip rows stay on one line (the parent <td> has
1354
+ overflow: hidden, so overflowing chips get clipped - widen the
1355
+ column or open the editor to see all). */
1356
+ .sv-grid-chips-display {
1357
+ display: inline-flex;
1358
+ flex-wrap: nowrap;
1359
+ align-items: center;
1360
+ gap: 4px;
1361
+ max-width: 100%;
1362
+ vertical-align: middle;
1363
+ }
1364
+ .sv-grid-sparkline {
1365
+ display: inline-block;
1366
+ vertical-align: middle;
1367
+ overflow: visible;
1368
+ }
1369
+ /* Conditional formatting overlays - behind the cell text. */
1370
+ .sv-grid-cf-bg {
1371
+ position: absolute;
1372
+ inset: 0;
1373
+ z-index: 0;
1374
+ pointer-events: none;
1375
+ }
1376
+ .sv-grid-cf-bar {
1377
+ position: absolute;
1378
+ left: 0;
1379
+ top: 0;
1380
+ bottom: 0;
1381
+ z-index: 0;
1382
+ opacity: 0.85;
1383
+ border-radius: 0 2px 2px 0;
1384
+ pointer-events: none;
1385
+ }
1386
+ .sv-grid-cell-cf {
1387
+ position: relative;
1388
+ }
1389
+ /* Declarative cell validation (column `validate` hook). Invalid cells get a
1390
+ * soft red wash and a red inset ring - Handsontable's `htInvalid` look. The
1391
+ * value keeps rendering as-is; the message (if any) shows as the tooltip. */
1392
+ .sv-grid-cell-invalid {
1393
+ background-color: var(--sg-invalid-bg, rgba(239, 68, 68, 0.14)) !important;
1394
+ box-shadow: inset 0 0 0 1px var(--sg-invalid-border, rgba(239, 68, 68, 0.45));
1395
+ color: var(--sg-invalid-fg, #b91c1c);
1396
+ }
1397
+ .sv-grid-cell-invalid.sv-grid-cell-active {
1398
+ box-shadow: inset 0 0 0 2px var(--sg-invalid-border, rgba(239, 68, 68, 0.7));
1399
+ }
1400
+ .sv-grid-status-bar {
1401
+ display: flex;
1402
+ flex-wrap: wrap;
1403
+ align-items: center;
1404
+ gap: 18px;
1405
+ padding: 6px 14px;
1406
+ font-size: 12px;
1407
+ color: var(--sg-fg);
1408
+ background: var(--sg-header-bg, #f1f5f9);
1409
+ border: 1px solid var(--sg-border, #e2e8f0);
1410
+ border-top: 0;
1411
+ flex-shrink: 0;
1412
+ }
1413
+ .sv-grid-status-item {
1414
+ font-variant-numeric: tabular-nums;
1415
+ font-weight: 600;
1416
+ }
1417
+ .sv-grid-status-label {
1418
+ color: var(--sg-muted, #64748b);
1419
+ font-weight: 400;
1420
+ margin-right: 5px;
1421
+ }
1422
+ .sv-grid-cf-content {
1423
+ position: relative;
1424
+ z-index: 1;
1425
+ }
1426
+ .sv-grid-cf-icon {
1427
+ margin-right: 5px;
1428
+ font-size: 0.95em;
1429
+ }
1430
+ .sv-grid-chip {
1431
+ display: inline-flex;
1432
+ align-items: center;
1433
+ gap: 4px;
1434
+ padding: 2px 8px;
1435
+ font-size: 0.85em;
1436
+ line-height: 1.4;
1437
+ background: color-mix(in srgb, var(--sg-accent, #2563eb) 18%, transparent);
1438
+ color: var(--sg-fg, inherit);
1439
+ border-radius: 999px;
1440
+ border: 1px solid
1441
+ color-mix(in srgb, var(--sg-accent, #2563eb) 35%, transparent);
1442
+ white-space: nowrap;
1443
+ }
1444
+ .sv-grid-chip-removable {
1445
+ padding-right: 2px;
1446
+ }
1447
+ .sv-grid-chip-remove {
1448
+ display: inline-flex;
1449
+ align-items: center;
1450
+ justify-content: center;
1451
+ width: 16px;
1452
+ height: 16px;
1453
+ border: 0;
1454
+ border-radius: 999px;
1455
+ background: color-mix(in srgb, var(--sg-fg, #0f172a) 18%, transparent);
1456
+ color: inherit;
1457
+ font-size: 12px;
1458
+ line-height: 1;
1459
+ cursor: pointer;
1460
+ padding: 0;
1461
+ }
1462
+ .sv-grid-chip-remove:hover {
1463
+ background: rgba(220, 38, 38, 0.7);
1464
+ color: #fff;
1465
+ }
1466
+
1467
+ .sv-grid-icon {
1468
+ width: 1em;
1469
+ height: 1em;
1470
+ display: block;
1471
+ flex: none;
1472
+ }
1473
+
1474
+ .sv-grid-header-cell {
1475
+ display: flex;
1476
+ align-items: center;
1477
+ gap: 2px;
1478
+ width: 100%;
1479
+ min-width: 0;
1480
+ /* Themeable header height. Defaults to auto (content-driven); presets
1481
+ can set a taller header (e.g. Material's roomy data-table header).
1482
+ The component measures the rendered header height for sticky offsets,
1483
+ so this propagates to --sg-thead-h automatically. */
1484
+ min-height: var(--sg-header-min-height, auto);
1485
+ }
1486
+
1487
+ .sv-grid-header-sort {
1488
+ display: flex;
1489
+ align-items: center;
1490
+ gap: 4px;
1491
+ flex: 1 1 auto;
1492
+ min-width: 0;
1493
+ padding: 2px;
1494
+ border: 0;
1495
+ background: transparent;
1496
+ font: inherit;
1497
+ color: inherit;
1498
+ text-align: left;
1499
+ cursor: pointer;
1500
+ }
1501
+
1502
+ /* Custom (function-valued) header rendering. Behaves like the sort
1503
+ button but is a div so the consumer's snippet can contain its own
1504
+ interactive elements (menu buttons, dropdowns, etc) - button-in-
1505
+ button DOM is invalid. */
1506
+ .sv-grid-header-custom {
1507
+ display: flex;
1508
+ align-items: center;
1509
+ gap: 4px;
1510
+ flex: 1 1 auto;
1511
+ min-width: 0;
1512
+ padding: 2px;
1513
+ text-align: left;
1514
+ cursor: pointer;
1515
+ outline: none;
1516
+ }
1517
+
1518
+ .sv-grid-header-label {
1519
+ /* min-width:0 lets this flex item shrink below its text width so a long
1520
+ label truncates to a single line with an ellipsis instead of overflowing
1521
+ or forcing the header taller. flex:0 1 auto keeps the sort icon snug to
1522
+ the label rather than pushed to the far edge. */
1523
+ flex: 0 1 auto;
1524
+ min-width: 0;
1525
+ overflow: hidden;
1526
+ text-overflow: ellipsis;
1527
+ white-space: nowrap;
1528
+ }
1529
+
1530
+ .sv-grid-header-icon {
1531
+ display: inline-flex;
1532
+ flex: none;
1533
+ font-size: 13px;
1534
+ color: var(--sg-muted, #5b6b85);
1535
+ }
1536
+
1537
+ .sv-grid-header-icon-hint {
1538
+ opacity: 0;
1539
+ transition: opacity 120ms ease;
1540
+ }
1541
+
1542
+ .sv-grid-column:hover .sv-grid-header-icon-hint {
1543
+ opacity: 0.4;
1544
+ }
1545
+
1546
+ .sv-grid-header-icon-flag {
1547
+ color: var(--sg-accent, #0b63f3);
1548
+ }
1549
+
1550
+ .sv-grid-col-menu-btn {
1551
+ display: inline-flex;
1552
+ align-items: center;
1553
+ justify-content: center;
1554
+ flex: none;
1555
+ /* Collapse to zero width when invisible so a non-hovered column
1556
+ has no dead space at the right; the funnel (when an active
1557
+ filter is on) can then sit flush against the right edge.
1558
+ Hover / focus / open expand it back to 22px. */
1559
+ width: 0;
1560
+ height: 22px;
1561
+ padding: 0;
1562
+ border: 0;
1563
+ border-radius: 4px;
1564
+ background: transparent;
1565
+ color: var(--sg-muted, #5b6b85);
1566
+ font-size: 15px;
1567
+ cursor: pointer;
1568
+ opacity: 0;
1569
+ pointer-events: none;
1570
+ overflow: hidden;
1571
+ transition:
1572
+ width 140ms ease,
1573
+ opacity 140ms ease,
1574
+ background-color 120ms ease;
1575
+ }
1576
+
1577
+ .sv-grid-column:hover .sv-grid-col-menu-btn,
1578
+ .sv-grid-col-menu-btn.is-open,
1579
+ .sv-grid-col-menu-btn:focus-visible {
1580
+ width: 22px;
1581
+ opacity: 1;
1582
+ pointer-events: auto;
1583
+ }
1584
+
1585
+ /* The funnel filter button is a sibling .sv-grid-col-menu-btn that
1586
+ ALSO carries .sv-grid-col-filter-btn. When the column has an
1587
+ active filter (.is-active) the funnel stays visible at full size
1588
+ even when the column isn't hovered - so users can see at a glance
1589
+ which columns are filtered. Because the 3-dot menu still collapses
1590
+ to width: 0 in that state, the funnel ends up flush against the
1591
+ right edge. On hover, the menu expands back to 22px and pushes the
1592
+ funnel left naturally. */
1593
+ .sv-grid-col-filter-btn.is-active {
1594
+ width: 22px;
1595
+ opacity: 1;
1596
+ pointer-events: auto;
1597
+ }
1598
+
1599
+ .sv-grid-col-menu-btn:hover,
1600
+ .sv-grid-col-menu-btn.is-open {
1601
+ background: var(--sg-row-hover-bg, #e2e8f3);
1602
+ }
1603
+
1604
+ .sv-grid-filter-operator-btn {
1605
+ display: inline-flex;
1606
+ align-items: center;
1607
+ gap: 2px;
1608
+ flex: none;
1609
+ height: 24px;
1610
+ padding: 0 4px;
1611
+ border: 1px solid var(--sg-input-border, #cbd5e1);
1612
+ border-radius: 4px;
1613
+ background: var(--sg-input-bg, #fff);
1614
+ color: var(--sg-fg, #334155);
1615
+ font-size: 13px;
1616
+ cursor: pointer;
1617
+ }
1618
+
1619
+ .sv-grid-filter-operator-btn.is-open {
1620
+ border-color: var(--sg-accent, #0b63f3);
1621
+ }
1622
+
1623
+ .sv-grid-caret {
1624
+ display: inline-flex;
1625
+ font-size: 9px;
1626
+ color: var(--sg-muted, #94a3b8);
1627
+ }
1628
+
1629
+ .sv-grid-menu-backdrop {
1630
+ position: fixed;
1631
+ inset: 0;
1632
+ z-index: 900;
1633
+ background: transparent;
1634
+ }
1635
+
1636
+ .sv-grid-menu {
1637
+ position: fixed;
1638
+ z-index: 901;
1639
+ max-height: calc(100vh - 24px);
1640
+ overflow: auto;
1641
+ padding: 4px;
1642
+ background: var(--sg-bg, #fff);
1643
+ border: 1px solid var(--sg-border, #d6dee9);
1644
+ border-radius: 8px;
1645
+ box-shadow: 0 12px 28px rgba(15, 23, 42, 0.18);
1646
+ font-size: 13px;
1647
+ color: var(--sg-fg, #1f2937);
1648
+ }
1649
+
1650
+ .sv-grid-column-menu {
1651
+ width: 260px;
1652
+ }
1653
+ /* Column-menu tab bar (General / Filter / Columns). */
1654
+ .sv-grid-menu-tabs {
1655
+ display: flex;
1656
+ gap: 2px;
1657
+ margin: -2px -2px 4px;
1658
+ padding: 2px 2px 0;
1659
+ border-bottom: 1px solid var(--sg-border, #e2e8f0);
1660
+ }
1661
+ .sv-grid-menu-tab {
1662
+ flex: 1;
1663
+ padding: 6px 6px;
1664
+ border: 0;
1665
+ border-bottom: 2px solid transparent;
1666
+ background: transparent;
1667
+ color: var(--sg-muted, #64748b);
1668
+ font-size: 12px;
1669
+ font-weight: 600;
1670
+ cursor: pointer;
1671
+ }
1672
+ .sv-grid-menu-tab:hover {
1673
+ color: var(--sg-fg, #0f172a);
1674
+ }
1675
+ .sv-grid-menu-tab.is-active {
1676
+ color: var(--sg-accent, #2563eb);
1677
+ border-bottom-color: var(--sg-accent, #2563eb);
1678
+ }
1679
+
1680
+ .sv-grid-operator-menu {
1681
+ width: 184px;
1682
+ }
1683
+
1684
+ .sv-grid-context-menu {
1685
+ min-width: 180px;
1686
+ }
1687
+
1688
+ .sv-grid-comment-editor {
1689
+ width: 240px;
1690
+ padding: 8px;
1691
+ }
1692
+ .sv-grid-comment-textarea {
1693
+ width: 100%;
1694
+ resize: vertical;
1695
+ min-height: 60px;
1696
+ padding: 6px 8px;
1697
+ border: 1px solid var(--sg-input-border, #cbd5e1);
1698
+ border-radius: 4px;
1699
+ background: var(--sg-input-bg, #fff);
1700
+ color: var(--sg-fg, #0f172a);
1701
+ font: inherit;
1702
+ font-size: 13px;
1703
+ outline: none;
1704
+ }
1705
+ .sv-grid-comment-textarea:focus {
1706
+ border-color: var(--sg-accent, #6366f1);
1707
+ }
1708
+ .sv-grid-comment-actions {
1709
+ display: flex;
1710
+ align-items: center;
1711
+ gap: 6px;
1712
+ margin-top: 8px;
1713
+ }
1714
+ .sv-grid-comment-spacer {
1715
+ flex: 1 1 auto;
1716
+ }
1717
+ .sv-grid-comment-actions button {
1718
+ padding: 4px 10px;
1719
+ border-radius: 4px;
1720
+ border: 1px solid var(--sg-border, #cbd5e1);
1721
+ background: var(--sg-bg, #fff);
1722
+ color: var(--sg-fg, #1f2937);
1723
+ font: inherit;
1724
+ font-size: 12px;
1725
+ cursor: pointer;
1726
+ }
1727
+ .sv-grid-comment-save {
1728
+ border-color: var(--sg-accent, #6366f1) !important;
1729
+ background: var(--sg-accent, #6366f1) !important;
1730
+ color: #fff !important;
1731
+ }
1732
+ .sv-grid-comment-remove {
1733
+ color: var(--sg-danger, #dc2626) !important;
1734
+ }
1735
+
1736
+ .sv-grid-menu-item {
1737
+ display: flex;
1738
+ align-items: center;
1739
+ gap: 8px;
1740
+ width: 100%;
1741
+ padding: 7px 10px;
1742
+ border: 0;
1743
+ border-radius: 5px;
1744
+ background: transparent;
1745
+ color: inherit;
1746
+ font: inherit;
1747
+ text-align: left;
1748
+ cursor: pointer;
1749
+ }
1750
+
1751
+ .sv-grid-menu-item:hover {
1752
+ background: var(--sg-row-hover-bg, #eef2f8);
1753
+ }
1754
+
1755
+ .sv-grid-menu-item[aria-checked="true"] {
1756
+ background: var(--sg-selection-bg, #eaf2ff);
1757
+ color: var(--sg-accent, #0b63f3);
1758
+ }
1759
+
1760
+ .sv-grid-menu-sep {
1761
+ height: 1px;
1762
+ margin: 4px 6px;
1763
+ background: var(--sg-border, #e6ebf2);
1764
+ }
1765
+
1766
+ .sv-grid-menu-filter {
1767
+ padding: 4px 6px 6px;
1768
+ }
1769
+
1770
+ .sv-grid-menu-filter-head {
1771
+ display: flex;
1772
+ align-items: center;
1773
+ gap: 6px;
1774
+ padding: 2px 0 6px;
1775
+ font-weight: 600;
1776
+ color: var(--sg-muted, #475569);
1777
+ }
1778
+
1779
+ .sv-grid-menu-search {
1780
+ width: 100%;
1781
+ height: 28px;
1782
+ box-sizing: border-box;
1783
+ margin-bottom: 6px;
1784
+ padding: 0 8px;
1785
+ border: 1px solid var(--sg-input-border, #cbd5e1);
1786
+ border-radius: 5px;
1787
+ font: inherit;
1788
+ }
1789
+
1790
+ .sv-grid-menu-filter-row {
1791
+ display: flex;
1792
+ gap: 4px;
1793
+ margin-bottom: 6px;
1794
+ }
1795
+
1796
+ .sv-grid-menu-operator-group {
1797
+ display: flex;
1798
+ gap: 2px;
1799
+ margin-bottom: 6px;
1800
+ }
1801
+
1802
+ .sv-grid-menu-operator-btn {
1803
+ flex: 1 1 0;
1804
+ display: inline-flex;
1805
+ align-items: center;
1806
+ justify-content: center;
1807
+ height: 28px;
1808
+ padding: 0;
1809
+ border: 1px solid var(--sg-input-border, #cbd5e1);
1810
+ border-radius: 4px;
1811
+ background: var(--sg-input-bg, #fff);
1812
+ color: var(--sg-fg, #475569);
1813
+ cursor: pointer;
1814
+ transition:
1815
+ background-color 100ms ease,
1816
+ color 100ms ease,
1817
+ border-color 100ms ease;
1818
+ }
1819
+
1820
+ .sv-grid-menu-operator-btn:hover {
1821
+ background: var(--sg-row-hover-bg, #eef2f8);
1822
+ }
1823
+
1824
+ .sv-grid-menu-operator-btn.is-active {
1825
+ background: var(--sg-accent, #0b63f3);
1826
+ border-color: var(--sg-accent, #0b63f3);
1827
+ color: #fff;
1828
+ }
1829
+
1830
+ .sv-grid-menu-condition-value {
1831
+ flex: 1 1 0;
1832
+ min-width: 0;
1833
+ height: 28px;
1834
+ box-sizing: border-box;
1835
+ padding: 0 8px;
1836
+ border: 1px solid var(--sg-input-border, #cbd5e1);
1837
+ border-radius: 5px;
1838
+ font: inherit;
1839
+ }
1840
+
1841
+ /* Multi-condition filter: AND/OR join toggle + add-condition button. */
1842
+ .sv-grid-menu-add-cond {
1843
+ align-self: flex-start;
1844
+ margin-top: 2px;
1845
+ padding: 3px 8px;
1846
+ font-size: 11.5px;
1847
+ font-weight: 600;
1848
+ color: var(--sg-accent, #3b82f6);
1849
+ background: transparent;
1850
+ border: 1px dashed var(--sg-border, #cbd5e1);
1851
+ border-radius: 5px;
1852
+ cursor: pointer;
1853
+ }
1854
+ .sv-grid-menu-add-cond:hover {
1855
+ background: color-mix(in oklab, var(--sg-accent, #3b82f6) 8%, transparent);
1856
+ border-style: solid;
1857
+ }
1858
+ .sv-grid-menu-join {
1859
+ display: inline-flex;
1860
+ align-items: center;
1861
+ gap: 2px;
1862
+ margin: 2px 0;
1863
+ }
1864
+ .sv-grid-menu-join button {
1865
+ padding: 2px 10px;
1866
+ font-size: 11px;
1867
+ font-weight: 700;
1868
+ color: var(--sg-muted, #64748b);
1869
+ background: transparent;
1870
+ border: 1px solid var(--sg-border, #cbd5e1);
1871
+ cursor: pointer;
1872
+ }
1873
+ .sv-grid-menu-join button:first-child { border-radius: 5px 0 0 5px; }
1874
+ .sv-grid-menu-join button:nth-child(2) { border-radius: 0; border-left: 0; }
1875
+ .sv-grid-menu-join button.is-on {
1876
+ background: var(--sg-accent, #3b82f6);
1877
+ color: #fff;
1878
+ border-color: var(--sg-accent, #3b82f6);
1879
+ }
1880
+ .sv-grid-menu-join-x {
1881
+ margin-left: auto;
1882
+ border-radius: 5px !important;
1883
+ font-size: 14px;
1884
+ line-height: 1;
1885
+ padding: 2px 7px !important;
1886
+ }
1887
+
1888
+ .sv-grid-facet-list {
1889
+ max-height: 200px;
1890
+ overflow: auto;
1891
+ border: 1px solid var(--sg-border, #eaeef4);
1892
+ border-radius: 5px;
1893
+ }
1894
+
1895
+ .sv-grid-facet {
1896
+ display: flex;
1897
+ align-items: center;
1898
+ gap: 8px;
1899
+ padding: 4px 8px;
1900
+ cursor: pointer;
1901
+ }
1902
+
1903
+ .sv-grid-facet:hover {
1904
+ background: var(--sg-row-hover-bg, #f4f6fa);
1905
+ }
1906
+
1907
+ .sv-grid-facet-all {
1908
+ border-bottom: 1px solid var(--sg-border, #eaeef4);
1909
+ font-weight: 600;
1910
+ }
1911
+
1912
+ .sv-grid-facet input {
1913
+ flex: none;
1914
+ }
1915
+
1916
+ .sv-grid-facet-label {
1917
+ overflow: hidden;
1918
+ text-overflow: ellipsis;
1919
+ white-space: nowrap;
1920
+ }
1921
+
1922
+ .sv-grid-facet-empty,
1923
+ .sv-grid-facet-note {
1924
+ padding: 6px 8px;
1925
+ color: var(--sg-muted, #94a3b8);
1926
+ font-size: 12px;
1927
+ }
1928
+
1929
+ .sv-grid-menu-actions {
1930
+ display: flex;
1931
+ justify-content: flex-end;
1932
+ gap: 6px;
1933
+ padding-top: 8px;
1934
+ }
1935
+
1936
+ .sv-grid-menu-btn {
1937
+ padding: 5px 10px;
1938
+ border: 1px solid var(--sg-input-border, #cbd5e1);
1939
+ border-radius: 5px;
1940
+ background: var(--sg-input-bg, #fff);
1941
+ color: var(--sg-fg, #334155);
1942
+ font: inherit;
1943
+ cursor: pointer;
1944
+ }
1945
+
1946
+ .sv-grid-menu-btn-primary {
1947
+ background: var(--sg-accent, #0b63f3);
1948
+ border-color: var(--sg-accent, #0b63f3);
1949
+ color: #fff;
1950
+ }
1951
+
1952
+ .sv-grid-menu-item:disabled,
1953
+ .sv-grid-menu-btn:disabled {
1954
+ opacity: 0.4;
1955
+ cursor: default;
1956
+ }
1957
+
1958
+ .sv-grid-menu-item:disabled:hover {
1959
+ background: transparent;
1960
+ }
1961
+
1962
+ .sv-grid-group-row > .sv-grid-cell {
1963
+ background: var(--sg-header-bg, #eef2f8);
1964
+ font-weight: 600;
1965
+ cursor: pointer;
1966
+ }
1967
+
1968
+ .sv-grid-row-selected > .sv-grid-cell {
1969
+ background: var(--sg-selection-bg, #eaf2ff);
1970
+ }
1971
+
1972
+ .sv-grid-group-cell {
1973
+ padding: 0 12px;
1974
+ }
1975
+
1976
+ .sv-grid-group-content {
1977
+ display: inline-flex;
1978
+ align-items: center;
1979
+ gap: 6px;
1980
+ }
1981
+
1982
+ .sv-grid-group-toggle {
1983
+ border: 0;
1984
+ background: transparent;
1985
+ padding: 0 4px 0 0;
1986
+ font-size: 11px;
1987
+ line-height: 1;
1988
+ color: var(--sg-fg, #334155);
1989
+ cursor: pointer;
1990
+ }
1991
+
1992
+ .sv-grid-group-count {
1993
+ margin-left: 6px;
1994
+ font-weight: 400;
1995
+ font-size: 12px;
1996
+ color: var(--sg-muted, #64748b);
1997
+ }
1998
+ .sv-grid-group-agg {
1999
+ margin-left: 10px;
2000
+ font-size: 12px;
2001
+ font-weight: 600;
2002
+ color: var(--sg-fg);
2003
+ white-space: nowrap;
2004
+ }
2005
+ .sv-grid-group-agg-label {
2006
+ font-weight: 400;
2007
+ color: var(--sg-muted, #64748b);
2008
+ margin-right: 4px;
2009
+ }
2010
+ .sv-grid-group-agg-label::after {
2011
+ content: ":";
2012
+ }
2013
+
2014
+ .sv-grid-group-child-indent {
2015
+ display: inline-block;
2016
+ width: 18px;
2017
+ }
2018
+
2019
+ /* ---- Custom hover tooltip (column .tooltip + cell notes) ---- */
2020
+ .sv-grid-tooltip {
2021
+ position: fixed;
2022
+ z-index: 10000;
2023
+ max-width: 280px;
2024
+ padding: 8px 10px;
2025
+ background: #0f172a;
2026
+ color: #f1f5f9;
2027
+ border-radius: var(--sg-radius, 6px);
2028
+ font-size: 12px;
2029
+ line-height: 1.45;
2030
+ box-shadow: 0 8px 24px rgba(15, 23, 42, 0.28);
2031
+ pointer-events: none;
2032
+ white-space: pre-wrap;
2033
+ word-wrap: break-word;
2034
+ }
2035
+ [data-theme="dark"] .sv-grid-tooltip { background: #f1f5f9; color: #0f172a; }
2036
+
2037
+ /* ---- Textarea editor ---- */
2038
+ .sv-grid-cell-editor-textarea {
2039
+ width: 100%;
2040
+ min-height: 80px;
2041
+ padding: 6px 8px;
2042
+ border: 1px solid var(--sg-accent, #6366f1);
2043
+ background: var(--sg-bg, #fff);
2044
+ color: var(--sg-fg, #0f172a);
2045
+ border-radius: 4px;
2046
+ font-family: inherit;
2047
+ font-size: 13px;
2048
+ line-height: 1.4;
2049
+ resize: vertical;
2050
+ outline: none;
2051
+ box-shadow: var(--sg-focus-ring, 0 0 0 2px rgba(99, 102, 241, 0.40));
2052
+ }
2053
+
2054
+ .sv-grid-autocomplete {
2055
+ position: relative;
2056
+ width: 100%;
2057
+ }
2058
+ .sv-grid-autocomplete-list {
2059
+ position: absolute;
2060
+ left: 0;
2061
+ right: 0;
2062
+ top: 100%;
2063
+ z-index: 30;
2064
+ max-height: 220px;
2065
+ overflow: auto;
2066
+ margin-top: 2px;
2067
+ padding: 4px;
2068
+ background: var(--sg-bg, #fff);
2069
+ border: 1px solid var(--sg-border, #d6dee9);
2070
+ border-radius: var(--sg-radius, 6px);
2071
+ box-shadow: 0 12px 28px rgba(15, 23, 42, 0.18);
2072
+ }
2073
+ .sv-grid-autocomplete-option {
2074
+ display: block;
2075
+ width: 100%;
2076
+ text-align: left;
2077
+ padding: 5px 8px;
2078
+ border: 0;
2079
+ border-radius: 4px;
2080
+ background: transparent;
2081
+ color: var(--sg-fg, #1f2937);
2082
+ font: inherit;
2083
+ font-size: 13px;
2084
+ cursor: pointer;
2085
+ white-space: nowrap;
2086
+ overflow: hidden;
2087
+ text-overflow: ellipsis;
2088
+ }
2089
+ .sv-grid-autocomplete-option:hover,
2090
+ .sv-grid-autocomplete-option[aria-selected="true"] {
2091
+ background: var(--sg-row-hover-bg, rgba(99, 102, 241, 0.10));
2092
+ }
2093
+
2094
+ /* ---- Find-in-grid overlay ---- */
2095
+ .sv-grid-find {
2096
+ position: absolute;
2097
+ top: 8px; right: 8px;
2098
+ z-index: 60;
2099
+ display: inline-flex; align-items: center; gap: 4px;
2100
+ padding: 6px 8px;
2101
+ background: var(--sg-bg, #fff);
2102
+ color: var(--sg-fg, #0f172a);
2103
+ border: 1px solid var(--sg-border, #cbd5e1);
2104
+ border-radius: 8px;
2105
+ box-shadow: 0 10px 25px rgba(15, 23, 42, 0.18);
2106
+ min-width: 280px;
2107
+ }
2108
+ .sv-grid-find-icon {
2109
+ width: 14px; height: 14px;
2110
+ color: var(--sg-muted, #94a3b8);
2111
+ flex: none;
2112
+ margin-left: 2px;
2113
+ }
2114
+ .sv-grid-find-input {
2115
+ flex: 1; min-width: 0;
2116
+ border: 0; outline: none;
2117
+ background: transparent;
2118
+ color: inherit;
2119
+ font-size: 13px;
2120
+ padding: 2px 6px;
2121
+ }
2122
+ .sv-grid-find-input::placeholder { color: var(--sg-muted, #94a3b8); }
2123
+ .sv-grid-find-count {
2124
+ font-size: 11px;
2125
+ color: var(--sg-muted, #64748b);
2126
+ font-variant-numeric: tabular-nums;
2127
+ padding: 0 4px;
2128
+ white-space: nowrap;
2129
+ }
2130
+ .sv-grid-find-step, .sv-grid-find-close {
2131
+ display: inline-flex; align-items: center; justify-content: center;
2132
+ width: 22px; height: 22px;
2133
+ background: transparent;
2134
+ border: 0;
2135
+ color: var(--sg-muted, #64748b);
2136
+ border-radius: 4px;
2137
+ cursor: pointer;
2138
+ font-size: 12px;
2139
+ }
2140
+ .sv-grid-find-step:hover:not(:disabled),
2141
+ .sv-grid-find-close:hover {
2142
+ background: var(--sg-row-hover-bg, rgba(148, 163, 184, 0.12));
2143
+ color: var(--sg-fg, #0f172a);
2144
+ }
2145
+ .sv-grid-find-step:disabled { opacity: 0.30; cursor: default; }
2146
+
2147
+ /* ---- Pagination footer (GridFooter.svelte) ------------------------------
2148
+ Ships with the grid so the pager is styled out of the box - previously this
2149
+ lived only in the examples' host stylesheet, leaving bare consumers with an
2150
+ unstyled pager. Uses --sg-* tokens with fallbacks like the rest of the theme. */
2151
+ .sv-grid-pagination {
2152
+ display: flex;
2153
+ align-items: center;
2154
+ justify-content: flex-end;
2155
+ gap: 24px;
2156
+ padding: 12px 16px;
2157
+ margin-top: 0;
2158
+ border: 1px solid var(--sg-border, #e2e8f0);
2159
+ border-top: 0;
2160
+ border-radius: 0 0 var(--sg-radius, 6px) var(--sg-radius, 6px);
2161
+ background: var(--sg-header-bg, #f1f5f9);
2162
+ color: var(--sg-fg, #0f172a);
2163
+ font-size: 13px;
2164
+ }
2165
+ /* Top-positioned pager: rounded + bordered on the top edge instead. */
2166
+ .sv-grid-pagination-top {
2167
+ border-top: 1px solid var(--sg-border, #e2e8f0);
2168
+ border-bottom: 0;
2169
+ border-radius: var(--sg-radius, 6px) var(--sg-radius, 6px) 0 0;
2170
+ }
2171
+ .sv-grid-pagination-pagesize {
2172
+ display: inline-flex;
2173
+ align-items: center;
2174
+ gap: 8px;
2175
+ color: var(--sg-muted, #64748b);
2176
+ }
2177
+ .sv-grid-pagination-pagesize-dd {
2178
+ position: relative;
2179
+ height: 28px;
2180
+ min-width: 62px;
2181
+ border: 1px solid var(--sg-input-border, #cbd5e1);
2182
+ border-radius: 5px;
2183
+ background: var(--sg-input-bg, #fff);
2184
+ }
2185
+ .sv-grid-pagination-pagesize-dd .sv-grid-dropdown,
2186
+ .sv-grid-pagination-pagesize-dd .sv-grid-dropdown-trigger {
2187
+ background: transparent;
2188
+ border-radius: 5px;
2189
+ font-size: 13px;
2190
+ color: var(--sg-fg, #0f172a);
2191
+ }
2192
+ .sv-grid-pagination-pagesize-dd:focus-within {
2193
+ border-color: var(--sg-accent, #2563eb);
2194
+ box-shadow: 0 0 0 2px color-mix(in srgb, var(--sg-accent, #2563eb) 30%, transparent);
2195
+ }
2196
+ .sv-grid-pagination-range {
2197
+ color: var(--sg-fg, #0f172a);
2198
+ }
2199
+ .sv-grid-pagination-nav {
2200
+ display: inline-flex;
2201
+ align-items: center;
2202
+ gap: 4px;
2203
+ }
2204
+ .sv-grid-pagination-btn {
2205
+ display: inline-flex;
2206
+ align-items: center;
2207
+ justify-content: center;
2208
+ width: 28px;
2209
+ height: 28px;
2210
+ padding: 0;
2211
+ border: 0;
2212
+ border-radius: 5px;
2213
+ background: transparent;
2214
+ color: var(--sg-fg, #0f172a);
2215
+ font: inherit;
2216
+ font-size: 16px;
2217
+ cursor: pointer;
2218
+ transition: background-color 100ms ease, color 100ms ease;
2219
+ }
2220
+ .sv-grid-pagination-btn:hover:not(:disabled) {
2221
+ background: var(--sg-input-bg, #fff);
2222
+ color: var(--sg-accent, #2563eb);
2223
+ }
2224
+ .sv-grid-pagination-btn:disabled {
2225
+ color: var(--sg-muted, #64748b);
2226
+ opacity: 0.4;
2227
+ cursor: default;
2228
+ }
2229
+ .sv-grid-pagination-label {
2230
+ margin: 0 8px;
2231
+ color: var(--sg-fg, #0f172a);
2232
+ }
2233
+
2234
+ /* ---- Menu / filter chrome completeness -----------------------------------
2235
+ These styles previously lived only in the examples' host stylesheet. Shipping
2236
+ them here means the column menu, filter/choose-columns popovers, facet
2237
+ checklist, operator select, filter buttons, and the scrollbar corner are
2238
+ fully themed out of the box for any consumer - all via --sg-* tokens. */
2239
+
2240
+ /* Hide the scrollbar corner when its scrollbar is absent. */
2241
+ .sv-grid-no-scroll .sv-grid-scrollbar-corner,
2242
+ .sv-grid-no-scroll .sv-grid-scrollbar {
2243
+ display: none;
2244
+ }
2245
+ /* Scrollbar corner divider uses the theme border token. */
2246
+ .sv-grid-scrollbar-corner,
2247
+ .sv-grid-scrollbar-corner-br {
2248
+ border-bottom-color: var(--sg-border, #e2e8f0);
2249
+ }
2250
+
2251
+ /* Filter operator <select> (the dropdown that replaced the radio group). */
2252
+ .sv-grid-menu-operator-select {
2253
+ width: 100%;
2254
+ height: 28px;
2255
+ padding: 0 22px 0 8px;
2256
+ margin-bottom: 6px;
2257
+ border: 1px solid var(--sg-input-border, #cbd5e1);
2258
+ border-radius: 5px;
2259
+ background: var(--sg-input-bg, #fff);
2260
+ color: var(--sg-fg, #0f172a);
2261
+ font: inherit;
2262
+ font-size: 13px;
2263
+ cursor: pointer;
2264
+ appearance: none;
2265
+ -webkit-appearance: none;
2266
+ background-image: linear-gradient(45deg, transparent 50%, currentColor 50%),
2267
+ linear-gradient(135deg, currentColor 50%, transparent 50%);
2268
+ background-position: calc(100% - 12px) 12px, calc(100% - 8px) 12px;
2269
+ background-size: 4px 4px, 4px 4px;
2270
+ background-repeat: no-repeat;
2271
+ }
2272
+ .sv-grid-menu-operator-select:focus {
2273
+ outline: none;
2274
+ border-color: var(--sg-accent, #2563eb);
2275
+ box-shadow: 0 0 0 2px color-mix(in srgb, var(--sg-accent, #2563eb) 40%, transparent);
2276
+ }
2277
+ /* Operator toggle button (active) uses the on-accent token. */
2278
+ .sv-grid-menu-operator-btn.is-active {
2279
+ color: var(--sg-on-accent, #fff);
2280
+ }
2281
+
2282
+ /* Filter-only + choose-columns popover widths. */
2283
+ .sv-grid-filter-menu {
2284
+ width: 260px;
2285
+ }
2286
+ .sv-grid-choose-columns-menu {
2287
+ width: 240px;
2288
+ }
2289
+ .sv-grid-choose-columns-menu .sv-grid-facet-list {
2290
+ max-height: 280px;
2291
+ }
2292
+
2293
+ /* Native checkboxes in the facet list pick up the theme accent. */
2294
+ .sv-grid-facet input[type="checkbox"] {
2295
+ accent-color: var(--sg-accent, #2563eb);
2296
+ width: 14px;
2297
+ height: 14px;
2298
+ cursor: pointer;
2299
+ }
2300
+
2301
+ /* Submenu right-chevron on the "Choose columns" item. */
2302
+ .sv-grid-menu-item-chevron {
2303
+ margin-left: auto;
2304
+ transform: rotate(-90deg);
2305
+ opacity: 0.55;
2306
+ }
2307
+ .sv-grid-menu-item.is-open .sv-grid-menu-item-chevron {
2308
+ opacity: 1;
2309
+ }
2310
+
2311
+ /* Magnifier prefix on the menu's search input. */
2312
+ .sv-grid-menu-search {
2313
+ padding-left: 28px;
2314
+ background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='6'/%3E%3Cpath d='M20 20l-4.5-4.5'/%3E%3C/svg%3E");
2315
+ background-position: 8px center;
2316
+ background-repeat: no-repeat;
2317
+ background-size: 14px 14px;
2318
+ }
2319
+
2320
+ /* Filter menu vertical rhythm. */
2321
+ .sv-grid-menu-filter > * + * {
2322
+ margin-top: 6px;
2323
+ }
2324
+
2325
+ /* Column-header filter (funnel) button tints accent when a filter is active. */
2326
+ .sv-grid-col-filter-btn.is-active {
2327
+ color: var(--sg-accent, #2563eb);
2328
+ }
2329
+
2330
+ /* Row-number gutter: neutralize the right border so it fuses with the header. */
2331
+ .sv-grid-row-number-column,
2332
+ .sv-grid-row-number-cell {
2333
+ border-right-color: var(--sg-header-bg, #f1f5f9);
2334
+ }
2335
+
2336
+ /* Group row label colour. */
2337
+ .sv-grid-group-row > .sv-grid-cell {
2338
+ color: var(--sg-header-fg, #0f172a);
2339
+ }
2340
+
2341
+ /* Filter-row operator button: soften when idle, accent border on hover/open. */
2342
+ .sv-grid-filter-operator-btn {
2343
+ opacity: 0.85;
2344
+ }
2345
+ .sv-grid-filter-operator-btn:hover {
2346
+ opacity: 1;
2347
+ border-color: var(--sg-accent, #2563eb);
2348
+ }
2349
+ .sv-grid-filter-operator-btn.is-open {
2350
+ opacity: 1;
2351
+ }
2352
+
2353
+ /* Kanban board mode search box (board.searchable) */
2354
+ .sv-grid-board-search {
2355
+ display: flex;
2356
+ align-items: center;
2357
+ gap: 6px;
2358
+ margin-bottom: 8px;
2359
+ padding: 5px 9px;
2360
+ border: 1px solid var(--sg-border, #e4e7ec);
2361
+ border-radius: var(--sg-radius, 8px);
2362
+ background: var(--sg-bg, #fff);
2363
+ color: color-mix(in srgb, var(--sg-fg, #101828) 55%, transparent);
2364
+ max-width: 280px;
2365
+ }
2366
+ .sv-grid-board-search:focus-within {
2367
+ border-color: var(--sg-accent, #3b82f6);
2368
+ }
2369
+ .sv-grid-board-search input {
2370
+ flex: 1 1 auto;
2371
+ border: 0;
2372
+ outline: none;
2373
+ background: transparent;
2374
+ font: inherit;
2375
+ font-size: 0.82rem;
2376
+ color: var(--sg-fg, #101828);
2377
+ }