@svgrid/grid 3.0.7 → 3.0.9

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 (91) hide show
  1. package/README.md +1 -1
  2. package/dist/GridMenus.svelte +3 -2
  3. package/dist/SvGrid.controller.svelte.d.ts +60 -8
  4. package/dist/SvGrid.controller.svelte.js +490 -114
  5. package/dist/SvGrid.css +186 -3
  6. package/dist/SvGrid.svelte +285 -164
  7. package/dist/SvGrid.types.d.ts +24 -7
  8. package/dist/cdn/{GridMenus-CcwU8I4t.js → GridMenus-B1sipj6y.js} +165 -165
  9. package/dist/cdn/{GridMenus-BgUS-W3o.js → GridMenus-DlAzfHLk.js} +201 -201
  10. package/dist/cdn/server-block-cache-Dj-KPqEQ.js +1289 -0
  11. package/dist/cdn/{src-kE9B98r6.js → src-BYsa66I0.js} +9747 -10178
  12. package/dist/cdn/{src-25JmJ_7g.js → src-pA4RroLV.js} +10709 -11140
  13. package/dist/cdn/svgrid.js +27 -27
  14. package/dist/cdn/svgrid.svelte-external.js +27 -27
  15. package/dist/cdn/validate-XuMe4_KR.js +80 -0
  16. package/dist/cell-render.js +25 -3
  17. package/dist/columns.js +16 -1
  18. package/dist/conditional-formatting.js +9 -2
  19. package/dist/core.d.ts +93 -0
  20. package/dist/core.js +313 -47
  21. package/dist/filtering/excel-filters.js +41 -6
  22. package/dist/headless.d.ts +1 -1
  23. package/dist/headless.js +1 -1
  24. package/dist/index.d.ts +2 -1
  25. package/dist/index.js +2 -1
  26. package/dist/keyboard-handlers.js +5 -1
  27. package/dist/selection.d.ts +2 -2
  28. package/dist/selection.js +46 -12
  29. package/dist/server-block-cache.d.ts +7 -32
  30. package/dist/server-block-cache.js +21 -12
  31. package/dist/server-data-source.js +3 -1
  32. package/dist/server.d.ts +1 -0
  33. package/dist/server.js +1 -0
  34. package/dist/spreadsheet.js +7 -0
  35. package/dist/{subscribe.js → subscribe.svelte.js} +5 -1
  36. package/dist/validate.js +13 -14
  37. package/dist/virtualization/column-virtualizer.d.ts +4 -0
  38. package/dist/virtualization/column-virtualizer.js +2 -0
  39. package/dist/virtualization/types.d.ts +20 -0
  40. package/dist/virtualization/virtualizer.js +90 -24
  41. package/dist/windowed-brand.d.ts +22 -0
  42. package/dist/windowed-brand.js +60 -0
  43. package/dist/windowed-data.d.ts +6 -0
  44. package/dist/windowed-data.js +34 -0
  45. package/dist/windowed-row-model.d.ts +1 -0
  46. package/dist/windowed-row-model.js +97 -0
  47. package/package.json +1 -1
  48. package/src/GridMenus.svelte +3 -2
  49. package/src/SvGrid.controller.svelte.ts +483 -122
  50. package/src/SvGrid.css +186 -3
  51. package/src/SvGrid.svelte +285 -164
  52. package/src/SvGrid.types.ts +24 -7
  53. package/src/cell-render.ts +24 -2
  54. package/src/columns.ts +16 -1
  55. package/src/conditional-formatting.ts +6 -4
  56. package/src/core.sort.test.ts +61 -0
  57. package/src/core.ts +309 -49
  58. package/src/counting-cell.test.svelte +11 -0
  59. package/src/filtering/excel-filters.ts +39 -6
  60. package/src/headless.reactivity.svelte.test.ts +89 -0
  61. package/src/headless.ts +1 -1
  62. package/src/index.ts +7 -1
  63. package/src/keyboard-handlers.ts +5 -1
  64. package/src/new-features.test.ts +24 -0
  65. package/src/selection.test.ts +51 -0
  66. package/src/selection.ts +47 -14
  67. package/src/server-block-cache.ts +27 -10
  68. package/src/server-data-source.ts +3 -1
  69. package/src/server.ts +6 -0
  70. package/src/spreadsheet.ts +6 -0
  71. package/src/{subscribe.test.ts → subscribe.svelte.test.ts} +1 -1
  72. package/src/{subscribe.ts → subscribe.svelte.ts} +5 -1
  73. package/src/svgrid.behavior.test.ts +58 -0
  74. package/src/svgrid.column-cell-recycling.test.ts +120 -0
  75. package/src/svgrid.interaction.test.ts +4 -1
  76. package/src/svgrid.new-features.wrapper.test.ts +5 -4
  77. package/src/svgrid.pinned-column-virtualization.test.ts +162 -0
  78. package/src/svgrid.row-model-prop.svelte.test.ts +15 -3
  79. package/src/validate.test.ts +20 -4
  80. package/src/validate.ts +13 -16
  81. package/src/virtualization/column-virtualizer.ts +6 -0
  82. package/src/virtualization/types.ts +20 -0
  83. package/src/virtualization/virtualizer.test.ts +152 -0
  84. package/src/virtualization/virtualizer.ts +93 -27
  85. package/src/windowed-brand.ts +67 -0
  86. package/src/windowed-data.test.ts +105 -0
  87. package/src/windowed-data.ts +36 -0
  88. package/src/windowed-row-model.ts +113 -0
  89. package/dist/cdn/server-block-cache-DIqb3VZn.js +0 -241
  90. package/dist/cdn/validate-AZoD8BoR.js +0 -80
  91. /package/dist/{subscribe.d.ts → subscribe.svelte.d.ts} +0 -0
@@ -1793,13 +1793,17 @@ export type Props<TFeatures extends TableFeatures = TableFeatures, TData extends
1793
1793
  * `virtualization`. **On by default**, which is what makes a 100-column grid
1794
1794
  * scroll smoothly.
1795
1795
  *
1796
- * It recycles column DOM nodes, so it cannot coexist with sticky pinned
1797
- * columns - turn it off if you need pinning to survive horizontal scrolling.
1796
+ * Pinned columns stay rendered while it is on: the pinned-left and
1797
+ * pinned-right columns are drawn as their own runs either side of the
1798
+ * virtual window, so a wide grid with pinned edges still renders only the
1799
+ * columns in view plus the pinned ones.
1798
1800
  */
1799
1801
  columnVirtualization?: boolean;
1800
1802
  /**
1801
- * Extra columns rendered either side of the viewport when
1802
- * `columnVirtualization` is on. Defaults to 3.
1803
+ * Columns kept rendered beyond the viewport when `columnVirtualization`
1804
+ * is on: this many ahead of a horizontal scroll at all times, one behind
1805
+ * it. The rendered columns move three at a time, so right after a move up
1806
+ * to `columnOverscan + 2` are rendered ahead. Defaults to 3.
1803
1807
  */
1804
1808
  columnOverscan?: number;
1805
1809
  /**
@@ -1812,9 +1816,7 @@ export type Props<TFeatures extends TableFeatures = TableFeatures, TData extends
1812
1816
  * column id (matches `ColumnDef.field` when no explicit id is set).
1813
1817
  * The internal pinning state is seeded once at mount; user-driven
1814
1818
  * pinning via the column menu still works and overrides this default.
1815
- * Requires `columnVirtualization={false}` to be visible in the menu
1816
- * UI (sticky positioning can't co-exist with column virtualization
1817
- * since the virtualizer recycles DOM nodes).
1819
+ * Works with column virtualization on (the default).
1818
1820
  */
1819
1821
  initialColumnPinning?: {
1820
1822
  left?: ReadonlyArray<string>;
@@ -2261,6 +2263,12 @@ export type Props<TFeatures extends TableFeatures = TableFeatures, TData extends
2261
2263
  * triangles by threshold), and `rule` (apply a style when a predicate
2262
2264
  * matches). Scope a format to specific columns with `columns: [...]`,
2263
2265
  * or omit it to apply to every column. Later entries win on conflict.
2266
+ *
2267
+ * `colorScale` and `dataBar` apply to data rows only: group, footer and
2268
+ * grand-total rows carry subtotals on a different scale, so they keep the
2269
+ * `rule` and `iconSet` formats and drop the scaled ones. On a server row
2270
+ * model, give scaled formats `minValue` / `maxValue`; the grid does not
2271
+ * scan rows it has not loaded for a range.
2264
2272
  */
2265
2273
  conditionalFormats?: ReadonlyArray<ConditionalFormat<TData>>;
2266
2274
  /**
@@ -2567,6 +2575,15 @@ export type Props<TFeatures extends TableFeatures = TableFeatures, TData extends
2567
2575
  rowSpan: number;
2568
2576
  colSpan: number;
2569
2577
  }>;
2578
+ /**
2579
+ * How rows are laid out. `'flex'` (the default) draws each row as a line
2580
+ * of fixed-width cells, so adding or removing cells in one row - what a
2581
+ * horizontal scroll does every frame - lays out that row only. `'table'`
2582
+ * uses the HTML table algorithm, which re-lays every row on such a change
2583
+ * but can draw a merged cell spanning rows; the grid switches to it on its
2584
+ * own when `mergedCells` has one.
2585
+ */
2586
+ rowLayout?: "flex" | "table";
2570
2587
  /**
2571
2588
  * Rows to pin to the BOTTOM of the grid - rendered below the regular
2572
2589
  * rows and sticky-positioned (sticks to the bottom of the viewport