@svgrid/grid 3.0.5 → 3.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (148) hide show
  1. package/README.md +28 -7
  2. package/dist/GridMenus.svelte +34 -4
  3. package/dist/SvGrid.controller.svelte.d.ts +21 -3
  4. package/dist/SvGrid.controller.svelte.js +205 -50
  5. package/dist/SvGrid.css +127 -2
  6. package/dist/SvGrid.svelte +223 -38
  7. package/dist/SvGrid.types.d.ts +77 -4
  8. package/dist/SvGridDropdown.svelte +20 -0
  9. package/dist/SvGridDropdown.svelte.d.ts +12 -0
  10. package/dist/SvModal.svelte +22 -0
  11. package/dist/SvModal.svelte.d.ts +7 -0
  12. package/dist/a11y/dismissable.d.ts +10 -0
  13. package/dist/a11y/dismissable.js +24 -2
  14. package/dist/build-api.js +81 -31
  15. package/dist/cdn/{GridMenus-CID62rlI.js → GridMenus-C-NtjlrJ.js} +150 -141
  16. package/dist/cdn/GridMenus-TssHej3q.js +644 -0
  17. package/dist/cdn/{SvChartMenu-FBSMINA6.js → SvChartMenu-BFSTpvB-.js} +1 -1
  18. package/dist/cdn/{SvChartMenu-Bl6PBbkT.js → SvChartMenu-BZ1Iwv0y.js} +1 -1
  19. package/dist/cdn/{SvDateTimePicker-DQwt4UAs.js → SvDateTimePicker-D9u_cOf8.js} +1 -1
  20. package/dist/cdn/{SvDateTimePicker-vNU6bZ-q.js → SvDateTimePicker-s_6IUpI7.js} +1 -1
  21. package/dist/cdn/{SvGridCellEditor-B1p-vCK5.js → SvGridCellEditor-BlyCSp0q.js} +1 -1
  22. package/dist/cdn/{SvGridCellEditor-D_0q4xAu.js → SvGridCellEditor-ClRRA9lW.js} +1 -1
  23. package/dist/cdn/{SvGridChart-DzLkSwCH.js → SvGridChart-B4EV8U6t.js} +4 -4
  24. package/dist/cdn/{SvGridChart-C3EWAZaM.js → SvGridChart-DsmwTyZF.js} +4 -4
  25. package/dist/cdn/{SvGridChartBuilder-CfII62sZ.js → SvGridChartBuilder-cHloHobN.js} +4 -4
  26. package/dist/cdn/{SvGridChartBuilder-BE2T1ykB.js → SvGridChartBuilder-vOl7C0Za.js} +4 -4
  27. package/dist/cdn/{SvGridChartPanel-xf4sWVTo.js → SvGridChartPanel-AcqF-Ll5.js} +5 -5
  28. package/dist/cdn/{SvGridChartPanel-CCX5_Wgd.js → SvGridChartPanel-biMtSBPA.js} +5 -5
  29. package/dist/cdn/{SvGridChartView-DYwabQWj.js → SvGridChartView-Dx_GmZuL.js} +2 -2
  30. package/dist/cdn/{SvGridChartView-CfuXmY5I.js → SvGridChartView-I3rDHXAq.js} +2 -2
  31. package/dist/cdn/{SvGridDropdown-D0VdjeR8.js → SvGridDropdown-BWeM3lMe.js} +46 -46
  32. package/dist/cdn/{SvGridDropdown-D13MtJ2j.js → SvGridDropdown-CJ6QqTxu.js} +67 -67
  33. package/dist/cdn/{SvModal-CIZWCcad.js → SvModal-ClxGmpAc.js} +187 -186
  34. package/dist/cdn/{SvModal-BAE-pjZX.js → SvModal-DhB_VMFR.js} +148 -147
  35. package/dist/cdn/{cell-formatting-C2Hf5gqd.js → cell-formatting-DVVKOSI9.js} +1 -1
  36. package/dist/cdn/{chart-Dz7SqMXH.js → chart-DEZxwC0i.js} +1 -1
  37. package/dist/cdn/{chart-panel-messages-CUbf2R4i.js → chart-panel-messages-D12XcTZJ.js} +1 -1
  38. package/dist/cdn/{chart-panel-messages-CmNrMdsr.js → chart-panel-messages-DguS7gC5.js} +1 -1
  39. package/dist/cdn/{chart-summary-BJW_tg_X.js → chart-summary-CMAXBGY-.js} +1 -1
  40. package/dist/cdn/{chart-trend-CaN9mDEV.js → chart-trend-BkEp61Gj.js} +1 -1
  41. package/dist/cdn/{dismissable-DAHetSNk.js → dismissable-Brc4EZU1.js} +5 -1
  42. package/dist/cdn/{export-format-CUDLy2yn.js → export-format-YzdwBww2.js} +1 -1
  43. package/dist/cdn/{row-resize-niQCp040.js → row-resize-DtOS1KG6.js} +41 -32
  44. package/dist/cdn/{server-block-cache-CGoWz-87.js → server-block-cache-DIqb3VZn.js} +4 -0
  45. package/dist/cdn/{src-jcFMkBnN.js → src-CgoeSM8k.js} +4697 -4131
  46. package/dist/cdn/{src-Bklofsad.js → src-DfwxB1TH.js} +4727 -4161
  47. package/dist/cdn/svgrid.js +17 -17
  48. package/dist/cdn/svgrid.svelte-external.js +17 -17
  49. package/dist/cdn/{validate-C7Rn_Bns.js → validate-AZoD8BoR.js} +6 -2
  50. package/dist/cell-formatting.js +18 -1
  51. package/dist/cell-render.js +25 -6
  52. package/dist/clipboard.d.ts +2 -2
  53. package/dist/clipboard.js +72 -23
  54. package/dist/columns.js +7 -2
  55. package/dist/conditional-formatting.d.ts +2 -0
  56. package/dist/conditional-formatting.js +2 -0
  57. package/dist/core.d.ts +22 -6
  58. package/dist/core.js +365 -25
  59. package/dist/editing.js +24 -0
  60. package/dist/grid-messages.d.ts +4 -0
  61. package/dist/grid-messages.js +4 -0
  62. package/dist/headless.d.ts +5 -0
  63. package/dist/headless.js +12 -0
  64. package/dist/history.d.ts +21 -0
  65. package/dist/history.js +34 -4
  66. package/dist/index.d.ts +1 -1
  67. package/dist/keyboard-handlers.js +24 -1
  68. package/dist/keyboard.js +4 -0
  69. package/dist/row-drag-touch.d.ts +1 -1
  70. package/dist/row-drag.js +35 -1
  71. package/dist/row-model.d.ts +6 -0
  72. package/dist/row-resize.js +22 -1
  73. package/dist/selection.js +1 -1
  74. package/dist/server-block-cache.d.ts +5 -0
  75. package/dist/server-block-cache.js +8 -0
  76. package/dist/server-data-source.d.ts +35 -3
  77. package/dist/server-data-source.js +11 -2
  78. package/dist/server.d.ts +1 -1
  79. package/dist/sparkline.js +7 -5
  80. package/dist/svgrid-wrapper.types.d.ts +33 -0
  81. package/dist/validate.js +9 -1
  82. package/package.json +6 -1
  83. package/src/GridMenus.svelte +34 -4
  84. package/src/SvGrid.controller.svelte.ts +206 -53
  85. package/src/SvGrid.css +127 -2
  86. package/src/SvGrid.svelte +223 -38
  87. package/src/SvGrid.types.ts +77 -4
  88. package/src/SvGridDropdown.svelte +20 -0
  89. package/src/SvModal.svelte +22 -0
  90. package/src/SvModal.test.ts +30 -1
  91. package/src/a11y/dismissable.test.ts +10 -1
  92. package/src/a11y/dismissable.ts +22 -2
  93. package/src/build-api.ts +85 -27
  94. package/src/cell-formatting.test.ts +17 -0
  95. package/src/cell-formatting.ts +18 -1
  96. package/src/cell-render.test.ts +24 -2
  97. package/src/cell-render.ts +24 -8
  98. package/src/clipboard.test.ts +107 -0
  99. package/src/clipboard.ts +62 -23
  100. package/src/columns.test.ts +4 -4
  101. package/src/columns.ts +7 -2
  102. package/src/conditional-formatting.test.ts +8 -0
  103. package/src/conditional-formatting.ts +3 -0
  104. package/src/core.tick-repair.test.ts +287 -0
  105. package/src/core.ts +374 -26
  106. package/src/editing.test.ts +52 -0
  107. package/src/editing.ts +25 -0
  108. package/src/grid-messages.test.ts +7 -0
  109. package/src/grid-messages.ts +10 -0
  110. package/src/headless.ts +24 -0
  111. package/src/history.test.ts +49 -1
  112. package/src/history.ts +48 -2
  113. package/src/index.ts +2 -0
  114. package/src/keyboard-handlers.coverage.test.ts +65 -0
  115. package/src/keyboard-handlers.ts +26 -1
  116. package/src/keyboard.ts +3 -0
  117. package/src/row-drag-touch.ts +2 -2
  118. package/src/row-drag.test.ts +51 -0
  119. package/src/row-drag.ts +35 -2
  120. package/src/row-model.ts +6 -0
  121. package/src/row-resize.ts +24 -1
  122. package/src/selection.ts +1 -1
  123. package/src/server-block-cache.test.ts +27 -0
  124. package/src/server-block-cache.ts +13 -0
  125. package/src/server-data-source.infinite.test.ts +62 -0
  126. package/src/server-data-source.test.ts +19 -0
  127. package/src/server-data-source.ts +48 -4
  128. package/src/server.ts +2 -0
  129. package/src/sparkline.test.ts +7 -0
  130. package/src/sparkline.ts +6 -4
  131. package/src/svgrid-wrapper.types.ts +32 -0
  132. package/src/svgrid.api.test.ts +21 -0
  133. package/src/svgrid.charting.test.ts +12 -4
  134. package/src/svgrid.context-menu.test.ts +12 -0
  135. package/src/svgrid.detail-rows.svelte.test.ts +187 -0
  136. package/src/svgrid.filter-menu-scroll.test.ts +9 -0
  137. package/src/svgrid.gantt-seam.test.ts +1 -1
  138. package/src/svgrid.live-update-paths.svelte.test.ts +184 -0
  139. package/src/svgrid.menu-scroll-close.test.ts +10 -0
  140. package/src/svgrid.row-model-seam.svelte.test.ts +16 -0
  141. package/src/svgrid.row-pinning.test.ts +15 -1
  142. package/src/svgrid.selection-bar-seam.test.ts +1 -1
  143. package/src/svgrid.sticky-groups.svelte.test.ts +145 -0
  144. package/src/svgrid.upsell-license.test.ts +1 -1
  145. package/src/test-setup.ts +12 -0
  146. package/src/transaction.test.ts +58 -0
  147. package/src/validate.ts +7 -1
  148. package/dist/cdn/GridMenus-DLL-qZeu.js +0 -635
package/dist/SvGrid.css CHANGED
@@ -535,6 +535,10 @@
535
535
  .sv-grid-placeholder-retry:hover {
536
536
  background: color-mix(in srgb, var(--sg-fg, #0f172a) 6%, transparent);
537
537
  }
538
+ .sv-grid-placeholder-retry:focus-visible {
539
+ outline: 2px solid var(--sg-accent, #2563eb);
540
+ outline-offset: 2px;
541
+ }
538
542
 
539
543
  /* Pinned columns read as "frozen" via three layered cues:
540
544
  1. A distinct fill (slightly stronger than the header) so the
@@ -813,6 +817,12 @@
813
817
  .sv-grid-row-drop-after > td {
814
818
  box-shadow: inset 0 -2px 0 0 var(--sg-accent, #6366f1);
815
819
  }
820
+ /* Landing inside a group or tree row (the row becomes its child): the
821
+ * whole row is the target, so it takes a tint and a ring rather than a line. */
822
+ .sv-grid-row-drop-into > td {
823
+ box-shadow: inset 0 2px 0 0 var(--sg-accent, #6366f1), inset 0 -2px 0 0 var(--sg-accent, #6366f1);
824
+ background: color-mix(in srgb, var(--sg-accent, #6366f1) 10%, transparent);
825
+ }
816
826
 
817
827
  /* Pinned rows (top / bottom). Each cell sticks individually so the
818
828
  * row tracks scroll on every browser. Top rows stick below the sticky
@@ -837,6 +847,27 @@
837
847
  .sv-grid-pinned-row-bottom[data-pinned-index="1"] td { bottom: var(--sg-pinned-row-h, 32px); }
838
848
  .sv-grid-pinned-row-bottom[data-pinned-index="2"] td { bottom: calc(var(--sg-pinned-row-h, 32px) * 2); }
839
849
  .sv-grid-pinned-row-bottom[data-pinned-index="3"] td { bottom: calc(var(--sg-pinned-row-h, 32px) * 3); }
850
+ /* While the selection bar is up the scroller carries bottom padding (see
851
+ --sg-selbar-reserve), and a sticky bottom edge is inset by that padding:
852
+ the lowest pinned row then holds 68px above the viewport's edge, with the
853
+ body rows scrolling through the strip beneath it, in and out from behind
854
+ the bar. That strip is meant to be the bar's own ground, so the lowest
855
+ pinned row paints it: a shadow in the body colour, spread by half the
856
+ reserve and pushed down by the same, fills the strip under each cell; the
857
+ clip cuts the spread's sideways spill at the cell's own edges so a later
858
+ cell's shadow never paints over its neighbour. The cells sit at z-index 4,
859
+ above the rows and under the floating bar. */
860
+ .sv-grid-root[data-selbar$='bottom'] .sv-grid-pinned-row-bottom[data-pinned-index="0"] td {
861
+ box-shadow: 0 calc(var(--sg-selbar-reserve) / 2) 0 calc(var(--sg-selbar-reserve) / 2) var(--sg-bg, #fff);
862
+ clip-path: inset(0 0 calc(-1 * var(--sg-selbar-reserve)) 0);
863
+ }
864
+ /* The same strip above a sticky header when the bar sits at the top: the
865
+ header holds under the reserve and rows scrolled up showed through above
866
+ it. The first header row's cells paint the strip the same way. */
867
+ .sv-grid-root[data-selbar$='top'] .sv-grid-head > tr:first-child > th {
868
+ box-shadow: 0 calc(-1 * var(--sg-selbar-reserve) / 2) 0 calc(var(--sg-selbar-reserve) / 2) var(--sg-bg, #fff);
869
+ clip-path: inset(calc(-1 * var(--sg-selbar-reserve)) 0 0 0);
870
+ }
840
871
  /* Sticky-left columns keep their left position; just override their
841
872
  * z so they sit above non-pinned pinned-row cells. */
842
873
  .sv-grid-pinned-row td[data-pinned] { z-index: 5; }
@@ -1018,13 +1049,58 @@
1018
1049
  z-index: 4;
1019
1050
  }
1020
1051
 
1021
- /* Row-number column: sticks to the left edge of the scroll viewport. */
1052
+ /* Detail-toggle column (`showDetailToggle`): a row-header gutter of chevrons
1053
+ that open and close detail rows. Sticky beside the row numbers and the
1054
+ selection column, on the header band's colour so it reads as chrome, not
1055
+ data; no menu, no resize handle, outside the active cell. */
1056
+ .sv-grid-detail-toggle-column,
1057
+ .sv-grid-detail-toggle-cell {
1058
+ text-align: center;
1059
+ padding: 0;
1060
+ position: sticky;
1061
+ z-index: 4;
1062
+ background: var(--sg-header-bg, #f5f7fb);
1063
+ vertical-align: middle;
1064
+ }
1065
+ .sv-grid-detail-toggle {
1066
+ display: inline-flex;
1067
+ align-items: center;
1068
+ justify-content: center;
1069
+ width: 24px;
1070
+ height: 24px;
1071
+ padding: 0;
1072
+ border: 0;
1073
+ border-radius: 5px;
1074
+ background: transparent;
1075
+ color: var(--sg-muted, #64748b);
1076
+ cursor: pointer;
1077
+ vertical-align: middle;
1078
+ }
1079
+ .sv-grid-detail-toggle:hover {
1080
+ background: color-mix(in srgb, var(--sg-accent, #2563eb) 12%, transparent);
1081
+ color: var(--sg-accent, #2563eb);
1082
+ }
1083
+ .sv-grid-detail-toggle:focus-visible {
1084
+ outline: 2px solid var(--sg-accent, #2563eb);
1085
+ outline-offset: 1px;
1086
+ }
1087
+ .sv-grid-detail-toggle > .sv-grid-icon {
1088
+ width: 12px;
1089
+ height: 12px;
1090
+ transition: transform 0.15s ease;
1091
+ }
1092
+ .sv-grid-detail-toggle[aria-expanded="true"] > .sv-grid-icon {
1093
+ transform: rotate(90deg);
1094
+ }
1095
+
1096
+ /* Row-number column: sticks to the inline-start edge of the scroll viewport,
1097
+ which is the right edge under `dir="rtl"`. */
1022
1098
  .sv-grid-row-number-column,
1023
1099
  .sv-grid-row-number-cell {
1024
1100
  text-align: right;
1025
1101
  padding-inline: 8px;
1026
1102
  position: sticky;
1027
- left: 0;
1103
+ inset-inline-start: 0;
1028
1104
  z-index: 4;
1029
1105
  /* Match the column-header band so the row-number gutter and the column
1030
1106
  headers form one continuous header chrome. */
@@ -1327,6 +1403,15 @@ select.sv-grid-fr-editor {
1327
1403
  overflow: hidden so the chips picker would otherwise be clipped). */
1328
1404
  overflow: visible;
1329
1405
  }
1406
+ /* The active cell a grid mounts with is seeded at (0,0), not chosen: no
1407
+ ring until a click, an arrow key or the api activates a cell (the same
1408
+ gate the fill handle has always had). Once activated it stays through a
1409
+ blur, so a toolbar acting on "the focused row" keeps its cue. A page with
1410
+ six grids on it, or a detail grid inside each open row, used to open
1411
+ with an accent ring in every one of them. */
1412
+ .sv-grid-active-seeded .sv-grid-cell-active {
1413
+ box-shadow: none;
1414
+ }
1330
1415
 
1331
1416
  /* ---- The editing cell's border -------------------------------------------
1332
1417
  One ring for every editor, drawn by the CELL rather than by each editor.
@@ -1625,6 +1710,40 @@ select.sv-grid-fr-editor {
1625
1710
  border-bottom: 1px solid var(--sg-frozen-edge, var(--sg-border, #94a3b8));
1626
1711
  }
1627
1712
 
1713
+ /* A detail row with a declared height (detailRowHeight): the row keeps the
1714
+ height the virtualizer counted on - the auto-height rule above must not
1715
+ win - and the panel's body, a block inside the cell, takes that height
1716
+ and scrolls what does not fit. (A table cell's own height is only a
1717
+ minimum, so the height goes on the block.) */
1718
+ .sv-grid-row.sv-grid-detail-row.sv-grid-detail-row-sized {
1719
+ height: var(--sv-detail-h) !important;
1720
+ }
1721
+ .sv-grid-row.sv-grid-detail-row-sized > .sv-grid-detail-cell {
1722
+ vertical-align: top;
1723
+ box-sizing: border-box;
1724
+ height: var(--sv-detail-h);
1725
+ }
1726
+ .sv-grid-detail-body {
1727
+ box-sizing: border-box;
1728
+ height: 100%;
1729
+ overflow: auto;
1730
+ }
1731
+
1732
+ /* Sticky group rows: the group a row belongs to, held under the header
1733
+ (and under the frozen band) while its rows scroll past. Same layer as
1734
+ the frozen band; the last one carries the band's edge. */
1735
+ .sv-grid-row.sv-grid-row-sticky-group {
1736
+ position: sticky;
1737
+ z-index: 31;
1738
+ background: var(--sg-bg, #fff);
1739
+ }
1740
+ .sv-grid-row.sv-grid-row-sticky-group > .sv-grid-cell {
1741
+ background: var(--sg-bg, #fff);
1742
+ }
1743
+ .sv-grid-row.sv-grid-row-sticky-group-last > .sv-grid-cell {
1744
+ border-bottom: 1px solid var(--sg-frozen-edge, var(--sg-border, #94a3b8));
1745
+ }
1746
+
1628
1747
  /* The multiline text editor sizes itself by its lines and keeps the
1629
1748
  input's single-line look until a break is typed. */
1630
1749
  .sv-grid-cell-editor-multiline {
@@ -3082,6 +3201,12 @@ select.sv-grid-fr-editor {
3082
3201
  .sv-grid-row-number-cell {
3083
3202
  border-right-color: var(--sg-header-bg, #f1f5f9);
3084
3203
  }
3204
+ /* The detail-toggle gutter fuses with the row numbers the same way; only
3205
+ its own right edge keeps a line, between the chrome and the data. */
3206
+ .sv-grid-row-number-cell:has(+ .sv-grid-detail-toggle-cell),
3207
+ .sv-grid-row-number-column:has(+ .sv-grid-detail-toggle-column) {
3208
+ border-right-color: var(--sg-header-bg, #f1f5f9);
3209
+ }
3085
3210
 
3086
3211
  /* Group row label colour. */
3087
3212
  .sv-grid-group-row > .sv-grid-cell {