@svgrid/grid 2.2.32 → 2.2.33

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 (80) hide show
  1. package/dist/DockNodeView.svelte +1 -1
  2. package/dist/GridFooter.svelte +0 -40
  3. package/dist/GridMenus.svelte +0 -77
  4. package/dist/SvDateRangeInput.svelte +1 -1
  5. package/dist/SvGrid.svelte +2 -25
  6. package/dist/SvGridChart.svelte +2 -10
  7. package/dist/SvGridSelect.svelte +0 -2
  8. package/dist/SvKbd.svelte +1 -1
  9. package/dist/SvList.svelte +1 -1
  10. package/dist/SvMenubar.svelte +1 -1
  11. package/dist/SvMultiSelect.svelte +0 -1
  12. package/dist/SvOtpInput.svelte +1 -1
  13. package/dist/SvRichText.svelte +4 -0
  14. package/dist/SvTour.svelte +4 -0
  15. package/dist/SvTreeSelect.svelte +0 -2
  16. package/dist/cdn/{GridMenus-C6ixSGWW.js → GridMenus-B7XhhqdN.js} +2 -4
  17. package/dist/cdn/{GridMenus-Cyk3qpJ7.js → GridMenus-BxmIvCJh.js} +4 -6
  18. package/dist/cdn/{SvDateTimePicker-CdqaP61H.js → SvDateTimePicker-o94wfSUa.js} +1 -1
  19. package/dist/cdn/{SvGridChart-BcLCYvw9.js → SvGridChart-Cr_90pPD.js} +1 -1
  20. package/dist/cdn/{SvGridChartPanel-DvjwxLvK.js → SvGridChartPanel-ICbxiUvK.js} +4 -4
  21. package/dist/cdn/{SvGridChartView-PwqI4s02.js → SvGridChartView-Bx42PMvf.js} +2 -2
  22. package/dist/cdn/{SvGridDropdown-Dh-2ej8j.js → SvGridDropdown-CUOdm7YA.js} +1 -1
  23. package/dist/cdn/{disclose-version-DoD9AFD_.js → disclose-version-DljhZohK.js} +45 -45
  24. package/dist/cdn/{src-CgD-wiuS.js → src-erjBRYfX.js} +14 -31
  25. package/dist/cdn/{src-BgHjWF0Q.js → src-ktbQVOk-.js} +7 -24
  26. package/dist/cdn/svgrid.js +5 -5
  27. package/dist/cdn/svgrid.svelte-external.js +1 -1
  28. package/dist/chart.d.ts +2 -0
  29. package/dist/chart.js +1 -4
  30. package/dist/createMenu.svelte.js +0 -1
  31. package/dist/createPopoverSelect.svelte.d.ts +2 -2
  32. package/dist/editing.js +1 -1
  33. package/dist/export-format.js +3 -0
  34. package/dist/selection.js +0 -1
  35. package/package.json +3 -2
  36. package/src/DockNodeView.svelte +1 -1
  37. package/src/GridFooter.svelte +0 -40
  38. package/src/GridMenus.svelte +0 -77
  39. package/src/SvCalendar.test.ts +1 -1
  40. package/src/SvDateRangeInput.svelte +1 -1
  41. package/src/SvGrid.controller.svelte.ts +0 -5
  42. package/src/SvGrid.svelte +2 -25
  43. package/src/SvGrid.types.ts +0 -1
  44. package/src/SvGridChart.svelte +2 -10
  45. package/src/SvGridSelect.svelte +0 -2
  46. package/src/SvKbd.svelte +1 -1
  47. package/src/SvList.svelte +1 -1
  48. package/src/SvMenubar.svelte +1 -1
  49. package/src/SvMultiSelect.svelte +0 -1
  50. package/src/SvOtpInput.svelte +1 -1
  51. package/src/SvRichText.svelte +4 -0
  52. package/src/SvTour.svelte +4 -0
  53. package/src/SvTreeSelect.svelte +0 -2
  54. package/src/ai.test.ts +1 -1
  55. package/src/build-api.ts +0 -105
  56. package/src/cell-formatting.test.ts +1 -1
  57. package/src/cell-render.ts +0 -94
  58. package/src/chart.ts +1 -2
  59. package/src/clipboard.ts +0 -102
  60. package/src/columns.ts +0 -115
  61. package/src/createMenu.svelte.ts +0 -1
  62. package/src/editing.ts +2 -105
  63. package/src/editor-registry.grid.test.ts +0 -2
  64. package/src/export-format.ts +3 -0
  65. package/src/features.ts +0 -90
  66. package/src/keyboard-handlers.coverage.test.ts +1 -1
  67. package/src/keyboard-handlers.ts +0 -120
  68. package/src/menus.test.ts +0 -1
  69. package/src/menus.ts +0 -112
  70. package/src/new-features.test.ts +3 -1
  71. package/src/row-drag.test.ts +1 -1
  72. package/src/row-resize.test.ts +1 -2
  73. package/src/scroll-sync.test.ts +4 -7
  74. package/src/scroll-sync.ts +0 -122
  75. package/src/selection.ts +0 -109
  76. package/src/server-group-model.test.ts +2 -2
  77. package/src/summaries.ts +0 -112
  78. package/src/svgrid.behavior.test.ts +0 -1
  79. package/src/svgrid.column-reorder.test.ts +0 -8
  80. package/src/tree-row-model.test.ts +0 -1
@@ -2,132 +2,10 @@
2
2
  // reading/writing controller state via the `ctx` handle; the reactive core
3
3
  // ($state/$derived/$effect) stays in the controller.
4
4
  import {
5
- applyExcelFilter,
6
- normalizeForFilter,
7
- createColumnVirtualizer,
8
- createCoreRowModel,
9
- createExpandedRowModel,
10
- createFilteredRowModel,
11
- createGroupedRowModel,
12
- createPaginatedRowModel,
13
- createSvelteVirtualizer,
14
- createSortedRowModel,
15
- createSvGrid,
16
- filterFns,
17
- getGridCellA11yProps,
18
- getGridCellDomId,
19
- getGridHeaderA11yProps,
20
- getGridRootA11yProps,
21
- getGridRowA11yProps,
22
- parseEditorValue,
23
- normalizeEditorOptions,
24
- sortFns,
25
- tableFeatures,
26
- rowSortingFeature,
27
- columnFilteringFeature,
28
- columnGroupingFeature,
29
- type CellContext,
30
- type EditorContext,
31
- type CellEditorOption,
32
- type CellEditorType,
33
- type CellFormatter,
34
- type CellFormatConfig,
35
- type Column,
36
- type ColumnDef,
37
- type Row,
38
5
  type RowData,
39
- type SvGridApi,
40
6
  type TableFeatures,
41
7
  } from "./index";
42
8
  import "./sv-grid-scrollbar";
43
- import type { Snippet } from "svelte";
44
- import { getKeyboardIntent, getNextActiveCell } from "./keyboard";
45
- import {
46
- formatNumericWithConfig,
47
- getDateFormatter,
48
- resolveDatePattern,
49
- } from "./cell-formatting";
50
- import {
51
- RenderSnippetConfig,
52
- RenderComponentConfig,
53
- } from "./render-component";
54
- import { buildFillPattern } from "./fill-patterns";
55
- import { buildSparkline, toSparklineValues } from "./sparkline";
56
- import {
57
- resolveCellFormat,
58
- computeColumnStat,
59
- formatsNeedingStats,
60
- type ColumnStat,
61
- type ResolvedCellFormat,
62
- } from "./conditional-formatting";
63
- import SvGridDropdown from "./SvGridDropdown.svelte";
64
- import type {
65
- Props,
66
- SelectionPoint,
67
- SelectionRange,
68
- CellEditState,
69
- FilterOperator,
70
- FilterOption,
71
- MenuPosition,
72
- } from "./SvGrid.types";
73
- import {
74
- cfTextStyle,
75
- fmtStat,
76
- getCellKey,
77
- resolveClassList,
78
- toDateInputValue,
79
- toDateTimeLocalInputValue,
80
- getEditableInputValue,
81
- getEditorInputType,
82
- toValueArray,
83
- getOptionLabel,
84
- getOptionColor,
85
- colorfulChipStyle,
86
- getEditorClass,
87
- asDate,
88
- clampMenuX,
89
- cssEscape,
90
- rawToNumber,
91
- formatFacetNumber,
92
- formatFacetDate,
93
- } from "./SvGrid.helpers";
94
- import { createKeyboard } from "./keyboard-handlers";
95
- import { createSummaries } from "./summaries";
96
- import { createMenus } from "./menus";
97
- import { createCellRender } from "./cell-render";
98
- import { createEditing } from "./editing";
99
- import { createSelection } from "./selection";
100
- import { createColumns } from "./columns";
101
- import { createGridApi } from "./build-api";
102
- import { createClipboard } from "./clipboard";
103
- import {
104
- filterOperatorOptions,
105
- fallbackOperatorOption,
106
- TEXT_OPERATORS,
107
- NUMBER_OPERATORS,
108
- DATE_OPERATORS,
109
- CHECKBOX_OPERATORS,
110
- operatorOption,
111
- operatorsForColumn,
112
- defaultOperatorFor,
113
- operatorLabelFor,
114
- } from "./filter-operators";
115
- import {
116
- type FacetBucket,
117
- isBucketableColumn,
118
- buildBuckets,
119
- isInBucket,
120
- } from "./facet-buckets";
121
- import {
122
- getColumnBaseValue,
123
- isGroupRow,
124
- toolPanelHeaderLabel,
125
- formatSummaryNumeric,
126
- getColumnAlign,
127
- getPinnedCellValue,
128
- getColumnAccessorValue,
129
- columnDefMatchesId,
130
- } from "./cell-values";
131
9
 
132
10
  export function createScrollSync<
133
11
  TFeatures extends TableFeatures = TableFeatures,
package/src/selection.ts CHANGED
@@ -2,125 +2,17 @@
2
2
  // reading/writing controller state via the `ctx` handle; the reactive core
3
3
  // ($state/$derived/$effect) stays in the controller.
4
4
  import {
5
- applyExcelFilter,
6
- normalizeForFilter,
7
- createColumnVirtualizer,
8
- createCoreRowModel,
9
- createExpandedRowModel,
10
- createFilteredRowModel,
11
- createGroupedRowModel,
12
- createPaginatedRowModel,
13
- createSvelteVirtualizer,
14
- createSortedRowModel,
15
- createSvGrid,
16
- filterFns,
17
- getGridCellA11yProps,
18
5
  getGridCellDomId,
19
- getGridHeaderA11yProps,
20
- getGridRootA11yProps,
21
- getGridRowA11yProps,
22
- parseEditorValue,
23
- normalizeEditorOptions,
24
- sortFns,
25
- tableFeatures,
26
- rowSortingFeature,
27
- columnFilteringFeature,
28
- columnGroupingFeature,
29
- type CellContext,
30
- type EditorContext,
31
- type CellEditorOption,
32
- type CellEditorType,
33
- type CellFormatter,
34
- type CellFormatConfig,
35
- type Column,
36
- type ColumnDef,
37
- type Row,
38
6
  type RowData,
39
- type SvGridApi,
40
7
  type TableFeatures,
41
8
  } from "./index";
42
9
  import "./sv-grid-scrollbar";
43
- import type { Snippet } from "svelte";
44
- import { getKeyboardIntent, getNextActiveCell } from "./keyboard";
45
- import {
46
- formatNumericWithConfig,
47
- getDateFormatter,
48
- resolveDatePattern,
49
- } from "./cell-formatting";
50
- import {
51
- RenderSnippetConfig,
52
- RenderComponentConfig,
53
- } from "./render-component";
54
- import { buildFillPattern } from "./fill-patterns";
55
- import { buildSparkline, toSparklineValues } from "./sparkline";
56
- import {
57
- resolveCellFormat,
58
- computeColumnStat,
59
- formatsNeedingStats,
60
- type ColumnStat,
61
- type ResolvedCellFormat,
62
- } from "./conditional-formatting";
63
- import SvGridDropdown from "./SvGridDropdown.svelte";
64
10
  import type {
65
- Props,
66
- SelectionPoint,
67
11
  SelectionRange,
68
- CellEditState,
69
- FilterOperator,
70
- FilterOption,
71
- MenuPosition,
72
12
  } from "./SvGrid.types";
73
- import {
74
- cfTextStyle,
75
- fmtStat,
76
- getCellKey,
77
- resolveClassList,
78
- toDateInputValue,
79
- toDateTimeLocalInputValue,
80
- getEditableInputValue,
81
- getEditorInputType,
82
- toValueArray,
83
- getOptionLabel,
84
- getOptionColor,
85
- colorfulChipStyle,
86
- getEditorClass,
87
- asDate,
88
- clampMenuX,
89
- cssEscape,
90
- rawToNumber,
91
- formatFacetNumber,
92
- formatFacetDate,
93
- } from "./SvGrid.helpers";
94
- import { createColumns } from "./columns";
95
- import { createGridApi } from "./build-api";
96
- import { createClipboard } from "./clipboard";
97
- import {
98
- filterOperatorOptions,
99
- fallbackOperatorOption,
100
- TEXT_OPERATORS,
101
- NUMBER_OPERATORS,
102
- DATE_OPERATORS,
103
- CHECKBOX_OPERATORS,
104
- operatorOption,
105
- operatorsForColumn,
106
- defaultOperatorFor,
107
- operatorLabelFor,
108
- } from "./filter-operators";
109
- import {
110
- type FacetBucket,
111
- isBucketableColumn,
112
- buildBuckets,
113
- isInBucket,
114
- } from "./facet-buckets";
115
13
  import {
116
14
  getColumnBaseValue,
117
15
  isGroupRow,
118
- toolPanelHeaderLabel,
119
- formatSummaryNumeric,
120
- getColumnAlign,
121
- getPinnedCellValue,
122
- getColumnAccessorValue,
123
- columnDefMatchesId,
124
16
  } from "./cell-values";
125
17
 
126
18
  export function createSelection<
@@ -244,7 +136,6 @@ export function createSelection<
244
136
  `td[data-svgrid-row="${rowIndex}"][data-svgrid-col="${colIndex}"]`,
245
137
  );
246
138
  if (cellEl) {
247
- const headerHeight = ctx.theadEl?.offsetHeight ?? 0;
248
139
  const containerRect = ctx.scrollContainer.getBoundingClientRect();
249
140
  const cellRect = cellEl.getBoundingClientRect();
250
141
  const cellTopInView = cellRect.top - containerRect.top;
@@ -114,10 +114,10 @@ describe('createServerGroupModel', () => {
114
114
 
115
115
  it('collapse removes the children again', async () => {
116
116
  const src = makeGroupSource(DATA)
117
- let state = { displayRows: [] as ServerDisplayRow<Row>[] } as never
117
+ // Reads go through ctl.getState() below, so the change callback is a no-op.
118
118
  const ctl = createServerGroupModel<Row>(src, {
119
119
  groupBy: ['country', 'city'],
120
- onChange: (s) => (state = s as never),
120
+ onChange: () => {},
121
121
  })
122
122
  ctl.refresh()
123
123
  await flush()
package/src/summaries.ts CHANGED
@@ -2,129 +2,17 @@
2
2
  // reading/writing controller state via the `ctx` handle; the reactive core
3
3
  // ($state/$derived/$effect) stays in the controller.
4
4
  import {
5
- applyExcelFilter,
6
- normalizeForFilter,
7
- createColumnVirtualizer,
8
- createCoreRowModel,
9
- createExpandedRowModel,
10
- createFilteredRowModel,
11
- createGroupedRowModel,
12
- createPaginatedRowModel,
13
- createSvelteVirtualizer,
14
- createSortedRowModel,
15
- createSvGrid,
16
- filterFns,
17
- getGridCellA11yProps,
18
- getGridCellDomId,
19
- getGridHeaderA11yProps,
20
- getGridRootA11yProps,
21
- getGridRowA11yProps,
22
- parseEditorValue,
23
- normalizeEditorOptions,
24
- sortFns,
25
- tableFeatures,
26
- rowSortingFeature,
27
- columnFilteringFeature,
28
- columnGroupingFeature,
29
- type CellContext,
30
- type EditorContext,
31
- type CellEditorOption,
32
- type CellEditorType,
33
- type CellFormatter,
34
- type CellFormatConfig,
35
5
  type Column,
36
- type ColumnDef,
37
6
  type Row,
38
7
  type RowData,
39
- type SvGridApi,
40
8
  type TableFeatures,
41
9
  } from "./index";
42
10
  import "./sv-grid-scrollbar";
43
- import type { Snippet } from "svelte";
44
- import { getKeyboardIntent, getNextActiveCell } from "./keyboard";
45
11
  import {
46
- formatNumericWithConfig,
47
- getDateFormatter,
48
- resolveDatePattern,
49
- } from "./cell-formatting";
50
- import {
51
- RenderSnippetConfig,
52
- RenderComponentConfig,
53
- } from "./render-component";
54
- import { buildFillPattern } from "./fill-patterns";
55
- import { buildSparkline, toSparklineValues } from "./sparkline";
56
- import {
57
- resolveCellFormat,
58
- computeColumnStat,
59
- formatsNeedingStats,
60
- type ColumnStat,
61
- type ResolvedCellFormat,
62
- } from "./conditional-formatting";
63
- import SvGridDropdown from "./SvGridDropdown.svelte";
64
- import type {
65
- Props,
66
- SelectionPoint,
67
- SelectionRange,
68
- CellEditState,
69
- FilterOperator,
70
- FilterOption,
71
- MenuPosition,
72
- } from "./SvGrid.types";
73
- import {
74
- cfTextStyle,
75
- fmtStat,
76
12
  getCellKey,
77
- resolveClassList,
78
- toDateInputValue,
79
- toDateTimeLocalInputValue,
80
- getEditableInputValue,
81
- getEditorInputType,
82
- toValueArray,
83
- getOptionLabel,
84
- getOptionColor,
85
- colorfulChipStyle,
86
- getEditorClass,
87
- asDate,
88
- clampMenuX,
89
- cssEscape,
90
- rawToNumber,
91
- formatFacetNumber,
92
- formatFacetDate,
93
13
  } from "./SvGrid.helpers";
94
- import { createMenus } from "./menus";
95
- import { createCellRender } from "./cell-render";
96
- import { createEditing } from "./editing";
97
- import { createSelection } from "./selection";
98
- import { createColumns } from "./columns";
99
- import { createGridApi } from "./build-api";
100
- import { createClipboard } from "./clipboard";
101
- import {
102
- filterOperatorOptions,
103
- fallbackOperatorOption,
104
- TEXT_OPERATORS,
105
- NUMBER_OPERATORS,
106
- DATE_OPERATORS,
107
- CHECKBOX_OPERATORS,
108
- operatorOption,
109
- operatorsForColumn,
110
- defaultOperatorFor,
111
- operatorLabelFor,
112
- } from "./filter-operators";
113
- import {
114
- type FacetBucket,
115
- isBucketableColumn,
116
- buildBuckets,
117
- isInBucket,
118
- } from "./facet-buckets";
119
14
  import {
120
- getColumnBaseValue,
121
- isGroupRow,
122
- toolPanelHeaderLabel,
123
15
  formatSummaryNumeric,
124
- getColumnAlign,
125
- getPinnedCellValue,
126
- getColumnAccessorValue,
127
- columnDefMatchesId,
128
16
  } from "./cell-values";
129
17
 
130
18
  export function createSummaries<
@@ -25,7 +25,6 @@ import {
25
25
  createGroupedRowModel,
26
26
  createPaginatedRowModel,
27
27
  createSortedRowModel,
28
- renderSnippet,
29
28
  rowExpandingFeature,
30
29
  rowPaginationFeature,
31
30
  rowSelectionFeature,
@@ -106,14 +106,6 @@ function headerOrder(target: HTMLElement): string[] {
106
106
  return Array.from(ths).map((th) => th.dataset.svgridHeaderCol ?? '')
107
107
  }
108
108
 
109
- function header(target: HTMLElement, id: string): HTMLElement {
110
- // jsdom doesn't ship CSS.escape; our ids are simple alphanumerics so
111
- // a plain attribute selector is fine.
112
- const el = target.querySelector<HTMLElement>(`th[data-svgrid-header-col="${id}"]`)
113
- if (!el) throw new Error(`header not found: ${id}`)
114
- return el
115
- }
116
-
117
109
  describe('SvGrid column reorder - default off', () => {
118
110
  it('does NOT set draggable on headers when the prop is unset', async () => {
119
111
  const { target, destroy } = await mountGrid()
@@ -115,7 +115,6 @@ describe('createTreeRowModel', () => {
115
115
  })
116
116
 
117
117
  it('honours a custom idField', () => {
118
- type K = { key: number; parent: number | null }
119
118
  const keyed = [
120
119
  { key: 10, parent: null },
121
120
  { key: 11, parent: 10 },