@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
package/README.md CHANGED
@@ -180,7 +180,7 @@ The pack sells in two editions, both covering unlimited production apps.
180
180
  merges, frozen panes, named ranges and charts surviving the round trip.
181
181
  - **SvGrid Studio.** The designer, the code generator and the SQL data sources.
182
182
 
183
- Both editions come with a 30-day evaluation period: every feature runs without a key, and under a
183
+ You can evaluate both editions without asking for a key: every feature runs without one, and under a
184
184
  key that does not cover it, with a watermark and a console message about the Enterprise package. `licenseCovers('spreadsheet')` tells you which
185
185
  side of the line the current key is on, if you would rather hide an entry point than let it nudge.
186
186
 
@@ -49,7 +49,6 @@
49
49
  const unpinColumn = $derived(ctrl.unpinColumn);
50
50
  const sortDirectionByColumn = $derived(ctrl.sortDirectionByColumn);
51
51
  const groupingColumns = $derived(ctrl.groupingColumns);
52
- const columnVirtualizationEnabled = $derived(ctrl.columnVirtualizationEnabled);
53
52
  const updateFilterOperator = $derived(ctrl.updateFilterOperator);
54
53
  const updateFilterMenuValue = $derived(ctrl.updateFilterMenuValue);
55
54
  const updateFilterMenuValueTo = $derived(ctrl.updateFilterMenuValueTo);
@@ -644,7 +643,9 @@
644
643
  <span class="sv-grid-header-icon">{@render icon("x")}</span> Remove sort
645
644
  </button>
646
645
  {/if}
647
- {#if !columnVirtualizationEnabled}
646
+ <!-- Pinning works with column virtualization on: the pinned columns render
647
+ as their own runs either side of the virtual window. -->
648
+ {#if menuColumnId}
648
649
  {@const menuPinSide = isColumnPinned(menuColumnId)}
649
650
  <div class="sv-grid-menu-sep"></div>
650
651
  <button
@@ -103,6 +103,8 @@ export declare function createSvGridController<TFeatures extends TableFeatures =
103
103
  columnWidths: Record<string, number>;
104
104
  readonly collapsedColumns: Record<string, boolean>;
105
105
  readonly mergeIndex: import("./merges.js").MergeIndex | null;
106
+ readonly flexRows: boolean;
107
+ readonly flexLayoutActive: boolean;
106
108
  readonly setColumnCollapsed: (columnId: string, collapsed: boolean) => void;
107
109
  readonly MIN_COLUMN_WIDTH: number;
108
110
  columnPinning: {
@@ -217,6 +219,10 @@ export declare function createSvGridController<TFeatures extends TableFeatures =
217
219
  groupId?: string;
218
220
  collapsible: boolean;
219
221
  collapsed: boolean;
222
+ /** Width of the unrendered columns before this cell when column
223
+ * virtualization splits the window into pinned and centre runs; the
224
+ * template draws a spacer of this width first. */
225
+ gapBefore?: number;
220
226
  }[];
221
227
  }[];
222
228
  readonly groupHeaderRowsWindowed: {
@@ -237,6 +243,10 @@ export declare function createSvGridController<TFeatures extends TableFeatures =
237
243
  groupId?: string;
238
244
  collapsible: boolean;
239
245
  collapsed: boolean;
246
+ /** Width of the unrendered columns before this cell when column
247
+ * virtualization splits the window into pinned and centre runs; the
248
+ * template draws a spacer of this width first. */
249
+ gapBefore?: number;
240
250
  }[];
241
251
  }[];
242
252
  readonly pinnedOffsets: {
@@ -308,8 +318,8 @@ export declare function createSvGridController<TFeatures extends TableFeatures =
308
318
  };
309
319
  readonly selectionBarCount: number;
310
320
  readonly selectionBarVisible: boolean;
311
- lastSelectionSerialized: string;
312
- lastCellRangeSerialized: string;
321
+ lastSelectionSerialized: string | null;
322
+ lastCellRangeSerialized: string | null;
313
323
  readonly statusBarEnabled: boolean;
314
324
  readonly statusBarAggregates: readonly ("sum" | "avg" | "min" | "max" | "count" | "numericCount")[];
315
325
  readonly statusBarStats: {
@@ -566,13 +576,25 @@ export declare function createSvGridController<TFeatures extends TableFeatures =
566
576
  readonly logicalToDomRowOffset: (logical: number) => number;
567
577
  readonly virtualColumns: import("./index.js").VirtualItem[];
568
578
  readonly virtualColumnTotalSize: number;
569
- readonly renderedColumnItems: import("./index.js").VirtualItem[] | {
579
+ readonly renderedColumnItems: {
570
580
  index: number;
571
581
  key: number;
572
582
  size: any;
573
583
  start: number;
574
584
  end: any;
575
- }[];
585
+ }[] | (import("./index.js").VirtualItem | {
586
+ index: number;
587
+ key: number;
588
+ size: number;
589
+ start: number;
590
+ end: number;
591
+ } | {
592
+ index: number;
593
+ key: number;
594
+ size: number;
595
+ start: number;
596
+ end: number;
597
+ })[];
576
598
  readonly hasRenderedColumn: (entry: {
577
599
  item: any;
578
600
  column: any | undefined;
@@ -581,9 +603,39 @@ export declare function createSvGridController<TFeatures extends TableFeatures =
581
603
  column: any;
582
604
  };
583
605
  readonly renderedColumns: {
584
- item: any;
585
- column: any;
606
+ item: import("./index.js").VirtualItem | {
607
+ index: number;
608
+ key: number;
609
+ size: any;
610
+ start: number;
611
+ end: any;
612
+ } | {
613
+ index: number;
614
+ key: number;
615
+ size: number;
616
+ start: number;
617
+ end: number;
618
+ } | {
619
+ index: number;
620
+ key: number;
621
+ size: number;
622
+ start: number;
623
+ end: number;
624
+ };
625
+ column: NonNullable<Column<TData>>;
626
+ gap: number;
627
+ key: string;
628
+ pinned: "left" | "right" | null;
629
+ }[];
630
+ readonly renderedColumnRuns: {
631
+ first: number;
632
+ last: number;
633
+ gap: number;
586
634
  }[];
635
+ readonly columnRunOf: (colIndex: number) => {
636
+ firstCol: number;
637
+ lastCol: number;
638
+ };
587
639
  readonly totalColumnWidth: number;
588
640
  readonly hasHorizontalOverflow: boolean;
589
641
  readonly columnWindowStart: number;
@@ -620,8 +672,8 @@ export declare function createSvGridController<TFeatures extends TableFeatures =
620
672
  readonly getPinnedCellValue: typeof getPinnedCellValue;
621
673
  readonly formatPinnedValue: (column: Column<TData>, value: unknown) => string;
622
674
  readonly computePinnedCellClass: (rowData: TData, column: Column<TData>) => string;
623
- readonly isRowSelected: (rowId: string) => any;
624
- readonly toggleRowSelectionById: (rowId: string) => void;
675
+ readonly isRowSelected: (rowId: string, original?: unknown) => any;
676
+ readonly toggleRowSelectionById: (rowId: string, original?: unknown) => void;
625
677
  readonly headerSelectionState: "some" | "none" | "all";
626
678
  readonly visibleRowRange: {
627
679
  startIndex: number;