@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
@@ -213,15 +213,7 @@
213
213
  return { t0: zoom.i0 / n, t1: (zoom.i1 + 1) / n }
214
214
  })
215
215
 
216
- /** Map a brush-svg-local x to a category index in the FULL data range. */
217
- function brushXToIndex(localX: number): number {
218
- if (!brushGeo) return 0
219
- const w = brushGeo.plot.w
220
- const x = Math.max(0, Math.min(w, localX - brushGeo.plot.x))
221
- const n = spec.categories.length
222
- return Math.max(0, Math.min(n - 1, Math.floor((x / w) * n)))
223
- }
224
- type BrushDrag = { mode: 'move' | 'left' | 'right'; startX: number; startT0: number; startT1: number }
216
+ type BrushDrag ={ mode: 'move' | 'left' | 'right'; startX: number; startT0: number; startT1: number }
225
217
  let brushDrag = $state<BrushDrag | null>(null)
226
218
  function brushSvgX(e: PointerEvent, svg: SVGSVGElement): number {
227
219
  const r = svg.getBoundingClientRect()
@@ -919,7 +911,7 @@
919
911
  {#if isRadar && geo.radarCenter}
920
912
  {@const c = geo.radarCenter}
921
913
  <!-- Concentric grid rings -->
922
- {#each geo.radarRings as v, ri (ri)}
914
+ {#each geo.radarRings as _v, ri (ri)}
923
915
  {@const ringR = c.r * ((ri + 1) / geo.radarRings.length)}
924
916
  <circle class="sv-grid-chart-radar-ring" cx={c.cx} cy={c.cy} r={ringR} />
925
917
  {/each}
@@ -53,8 +53,6 @@
53
53
  labelField,
54
54
  value = $bindable<string | number | null>(null),
55
55
  onChange,
56
- onCommit,
57
- onCancel,
58
56
  placeholder = 'Select…',
59
57
  searchable = true,
60
58
  loadOptions,
package/src/SvKbd.svelte CHANGED
@@ -21,7 +21,7 @@
21
21
 
22
22
  {#if keys}
23
23
  <span class="sv-kbd-group sv-kbd--{size}">
24
- {#each keys as k, i}
24
+ {#each keys as k, i (i)}
25
25
  {#if i > 0}<span class="sv-kbd__sep" aria-hidden="true">{separator}</span>{/if}
26
26
  <kbd class="sv-kbd">{k}</kbd>
27
27
  {/each}
package/src/SvList.svelte CHANGED
@@ -37,7 +37,7 @@
37
37
  {#if children}
38
38
  {@render children()}
39
39
  {:else if items}
40
- {#each items as item}<li>{item}</li>{/each}
40
+ {#each items as item, i (i)}<li>{item}</li>{/each}
41
41
  {/if}
42
42
  </svelte:element>
43
43
 
@@ -41,7 +41,7 @@
41
41
  const resolvedDir = $derived(dir === 'ltr' || dir === 'rtl' ? dir : undefined)
42
42
  const rtl = $derived(resolvedDir === 'rtl')
43
43
 
44
- let triggerEls = $state<(HTMLButtonElement | null)[]>([])
44
+ const triggerEls = $state<(HTMLButtonElement | null)[]>([])
45
45
  let panelEl = $state<HTMLDivElement | null>(null)
46
46
  let openIndex = $state(-1)
47
47
  let activeIndex = $state(0)
@@ -50,7 +50,6 @@
50
50
  value = $bindable<ReadonlyArray<string | number>>([]),
51
51
  onChange,
52
52
  onCommit,
53
- onCancel,
54
53
  placeholder = 'Select…',
55
54
  searchable = true,
56
55
  maxTagCount = 3,
@@ -52,7 +52,7 @@
52
52
  const autoId = nextEditorId('sv-otp')
53
53
  const uid = $derived(id ?? autoId)
54
54
  const cells = $derived(otpCells(sanitizeOtp(value, length, numeric), length))
55
- let inputs = $state<HTMLInputElement[]>([])
55
+ const inputs = $state<HTMLInputElement[]>([])
56
56
 
57
57
  function commit(next: string) {
58
58
  const clean = sanitizeOtp(next, length, numeric)
@@ -90,6 +90,10 @@
90
90
  // (writing innerHTML while focused would collapse the caret).
91
91
  $effect(() => {
92
92
  const v = value ?? ''
93
+ // A contenteditable owns its own DOM: letting Svelte re-render the body
94
+ // would wipe the caret mid-typing, so the value is pushed in by hand and
95
+ // only while the editor is unfocused.
96
+ // eslint-disable-next-line svelte/no-dom-manipulating
93
97
  if (editorEl && !focused && editorEl.innerHTML !== v) editorEl.innerHTML = v
94
98
  if (editorEl) empty = editorEl.textContent!.trim().length === 0
95
99
  })
package/src/SvTour.svelte CHANGED
@@ -156,6 +156,10 @@
156
156
  >
157
157
  {#if step.image}
158
158
  <div class="sv-tour__media">
159
+ <!-- A step's `image` is either a URL (rendered as an img above) or
160
+ inline SVG markup the app author wrote for its own tour - never
161
+ user input, so rendering it as markup is the intent. -->
162
+ <!-- eslint-disable-next-line svelte/no-at-html-tags -->
159
163
  {#if /^(https?:|data:|\/)/.test(step.image)}<img class="sv-tour__img" src={step.image} alt="" />{:else}{@html step.image}{/if}
160
164
  </div>
161
165
  {/if}
@@ -36,8 +36,6 @@
36
36
  nodes,
37
37
  value = $bindable<string | number | null>(null),
38
38
  onChange,
39
- onCommit,
40
- onCancel,
41
39
  placeholder = 'Select…',
42
40
  showPath = false,
43
41
  expandedIds = [],
package/src/ai.test.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'
1
+ import { afterEach, beforeEach, describe, expect, it } from 'vitest'
2
2
  import {
3
3
  setAIProvider, getAIProvider, hasAIProvider,
4
4
  mockAIProvider,
package/src/build-api.ts CHANGED
@@ -2,52 +2,12 @@
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
6
  type SvGridApi,
40
7
  type TableFeatures,
41
8
  } from "./index";
42
9
  import "./sv-grid-scrollbar";
43
10
  import { untrack } from "svelte";
44
- import type { Snippet } from "svelte";
45
- import { getKeyboardIntent, getNextActiveCell } from "./keyboard";
46
- import {
47
- formatNumericWithConfig,
48
- getDateFormatter,
49
- resolveDatePattern,
50
- } from "./cell-formatting";
51
11
  // The export serializers load lazily (their own chunk) so export-format.ts stays
52
12
  // out of the base bundle - it is fetched only when an export/copy method is
53
13
  // actually invoked (an explicit, already-async user action).
@@ -57,77 +17,12 @@ import type {
57
17
  GridExportOptions,
58
18
  GridClipboardOptions,
59
19
  } from "./export-format";
60
- import {
61
- RenderSnippetConfig,
62
- RenderComponentConfig,
63
- } from "./render-component";
64
- import { buildFillPattern } from "./fill-patterns";
65
- import { buildSparkline, toSparklineValues } from "./sparkline";
66
- import {
67
- resolveCellFormat,
68
- computeColumnStat,
69
- formatsNeedingStats,
70
- type ColumnStat,
71
- type ResolvedCellFormat,
72
- } from "./conditional-formatting";
73
- import SvGridDropdown from "./SvGridDropdown.svelte";
74
20
  import type {
75
- Props,
76
- SelectionPoint,
77
- SelectionRange,
78
- CellEditState,
79
21
  FilterOperator,
80
- FilterOption,
81
- MenuPosition,
82
22
  } from "./SvGrid.types";
83
23
  import {
84
- cfTextStyle,
85
- fmtStat,
86
- getCellKey,
87
- resolveClassList,
88
- toDateInputValue,
89
- toDateTimeLocalInputValue,
90
- getEditableInputValue,
91
- getEditorInputType,
92
- toValueArray,
93
- getOptionLabel,
94
- getOptionColor,
95
- colorfulChipStyle,
96
- getEditorClass,
97
- asDate,
98
- clampMenuX,
99
- cssEscape,
100
- rawToNumber,
101
- formatFacetNumber,
102
- formatFacetDate,
103
- } from "./SvGrid.helpers";
104
- import { createClipboard } from "./clipboard";
105
- import {
106
- filterOperatorOptions,
107
- fallbackOperatorOption,
108
- TEXT_OPERATORS,
109
- NUMBER_OPERATORS,
110
- DATE_OPERATORS,
111
- CHECKBOX_OPERATORS,
112
- operatorOption,
113
- operatorsForColumn,
114
- defaultOperatorFor,
115
- operatorLabelFor,
116
- } from "./filter-operators";
117
- import {
118
- type FacetBucket,
119
- isBucketableColumn,
120
- buildBuckets,
121
- isInBucket,
122
- } from "./facet-buckets";
123
- import {
124
- getColumnBaseValue,
125
24
  isGroupRow,
126
- toolPanelHeaderLabel,
127
- formatSummaryNumeric,
128
25
  getColumnAlign,
129
- getPinnedCellValue,
130
- getColumnAccessorValue,
131
26
  columnDefMatchesId,
132
27
  } from "./cell-values";
133
28
 
@@ -158,7 +158,7 @@ describe('getDateFormatter', () => {
158
158
 
159
159
  describe('formatNumericWithConfig - number', () => {
160
160
  it('formats a basic integer with default locale', () => {
161
- expect(formatNumericWithConfig(1234, { type: 'number' })).toMatch(/1[\.,]?234/)
161
+ expect(formatNumericWithConfig(1234, { type: 'number' })).toMatch(/1[.,]?234/)
162
162
  })
163
163
 
164
164
  it('respects locale grouping and decimal separators', () => {
@@ -2,127 +2,33 @@
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
5
  normalizeEditorOptions,
24
- sortFns,
25
- tableFeatures,
26
- rowSortingFeature,
27
- columnFilteringFeature,
28
- columnGroupingFeature,
29
- type CellContext,
30
- type EditorContext,
31
6
  type CellEditorOption,
32
- type CellEditorType,
33
7
  type CellFormatter,
34
8
  type CellFormatConfig,
35
9
  type Column,
36
- type ColumnDef,
37
10
  type Row,
38
11
  type RowData,
39
- type SvGridApi,
40
12
  type TableFeatures,
41
13
  } from "./index";
42
14
  import "./sv-grid-scrollbar";
43
- import type { Snippet } from "svelte";
44
- import { getKeyboardIntent, getNextActiveCell } from "./keyboard";
45
15
  import {
46
16
  formatNumericWithConfig,
47
17
  getDateFormatter,
48
18
  resolveDatePattern,
49
19
  } 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
20
  import {
57
21
  resolveCellFormat,
58
- computeColumnStat,
59
- formatsNeedingStats,
60
- type ColumnStat,
61
22
  type ResolvedCellFormat,
62
23
  } 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
24
  import {
74
- cfTextStyle,
75
- fmtStat,
76
25
  getCellKey,
77
26
  resolveClassList,
78
- toDateInputValue,
79
- toDateTimeLocalInputValue,
80
- getEditableInputValue,
81
- getEditorInputType,
82
- toValueArray,
83
27
  getOptionLabel,
84
- getOptionColor,
85
- colorfulChipStyle,
86
- getEditorClass,
87
28
  asDate,
88
- clampMenuX,
89
- cssEscape,
90
- rawToNumber,
91
- formatFacetNumber,
92
- formatFacetDate,
93
29
  } from "./SvGrid.helpers";
94
- import { createEditing } from "./editing";
95
- import { createSelection } from "./selection";
96
- import { createColumns } from "./columns";
97
- import { createGridApi } from "./build-api";
98
- import { createClipboard } from "./clipboard";
99
- import {
100
- filterOperatorOptions,
101
- fallbackOperatorOption,
102
- TEXT_OPERATORS,
103
- NUMBER_OPERATORS,
104
- DATE_OPERATORS,
105
- CHECKBOX_OPERATORS,
106
- operatorOption,
107
- operatorsForColumn,
108
- defaultOperatorFor,
109
- operatorLabelFor,
110
- } from "./filter-operators";
111
- import {
112
- type FacetBucket,
113
- isBucketableColumn,
114
- buildBuckets,
115
- isInBucket,
116
- } from "./facet-buckets";
117
30
  import {
118
- getColumnBaseValue,
119
- isGroupRow,
120
- toolPanelHeaderLabel,
121
- formatSummaryNumeric,
122
- getColumnAlign,
123
31
  getPinnedCellValue,
124
- getColumnAccessorValue,
125
- columnDefMatchesId,
126
32
  } from "./cell-values";
127
33
 
128
34
  export function createCellRender<
package/src/chart.ts CHANGED
@@ -38,7 +38,6 @@ export type SeriesOverlay = 'linear' | `sma:${number}` | `ema:${number}`
38
38
  export type SeriesPattern = 'solid' | 'stripe' | 'crosshatch' | 'dots' | 'diagonal'
39
39
  /** Cycle used when `ChartSpec.patternFallback` is true and a series has no
40
40
  * explicit `pattern` set. Skips `'solid'` so every series gets a texture. */
41
- const PATTERN_CYCLE: SeriesPattern[] = ['stripe', 'crosshatch', 'dots', 'diagonal']
42
41
 
43
42
  export type ChartSeries = {
44
43
  label: string
@@ -2254,7 +2253,7 @@ export function rowsToChartSpec<T extends Record<string, unknown>>(
2254
2253
  entries.reduce((sum, e) => sum + (Number.isFinite(e.values[i]!) ? e.values[i]! : 0), 0),
2255
2254
  )
2256
2255
  const sort = opts.sort ?? (opts.topN ? 'value-desc' : 'none')
2257
- let order = categories.map((_, i) => i)
2256
+ const order = categories.map((_, i) => i)
2258
2257
  if (sort === 'value-desc') order.sort((a, b) => totals[b]! - totals[a]!)
2259
2258
  else if (sort === 'value-asc') order.sort((a, b) => totals[a]! - totals[b]!)
2260
2259
  else if (sort === 'category') order.sort((a, b) => categories[a]!.localeCompare(categories[b]!))
package/src/clipboard.ts CHANGED
@@ -2,122 +2,20 @@
2
2
  // that read/write 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
5
  parseEditorValue,
23
- normalizeEditorOptions,
24
- sortFns,
25
- tableFeatures,
26
- rowSortingFeature,
27
- columnFilteringFeature,
28
- columnGroupingFeature,
29
- type CellContext,
30
- type EditorContext,
31
- type CellEditorOption,
32
6
  type CellEditorType,
33
- type CellFormatter,
34
- type CellFormatConfig,
35
- type Column,
36
- type ColumnDef,
37
- 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
- import {
46
- formatNumericWithConfig,
47
- getDateFormatter,
48
- resolveDatePattern,
49
- } from "./cell-formatting";
50
- import {
51
- RenderSnippetConfig,
52
- RenderComponentConfig,
53
- } from "./render-component";
54
11
  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
12
  import {
74
- cfTextStyle,
75
- fmtStat,
76
13
  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
14
  } from "./SvGrid.helpers";
94
- import {
95
- filterOperatorOptions,
96
- fallbackOperatorOption,
97
- TEXT_OPERATORS,
98
- NUMBER_OPERATORS,
99
- DATE_OPERATORS,
100
- CHECKBOX_OPERATORS,
101
- operatorOption,
102
- operatorsForColumn,
103
- defaultOperatorFor,
104
- operatorLabelFor,
105
- } from "./filter-operators";
106
- import {
107
- type FacetBucket,
108
- isBucketableColumn,
109
- buildBuckets,
110
- isInBucket,
111
- } from "./facet-buckets";
112
15
  import {
113
16
  getColumnBaseValue,
114
17
  isGroupRow,
115
18
  toolPanelHeaderLabel,
116
- formatSummaryNumeric,
117
- getColumnAlign,
118
- getPinnedCellValue,
119
- getColumnAccessorValue,
120
- columnDefMatchesId,
121
19
  } from "./cell-values";
122
20
 
123
21
  export function createClipboard<
package/src/columns.ts CHANGED
@@ -2,125 +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 { createGridApi } from "./build-api";
95
- import { createClipboard } from "./clipboard";
96
- import {
97
- filterOperatorOptions,
98
- fallbackOperatorOption,
99
- TEXT_OPERATORS,
100
- NUMBER_OPERATORS,
101
- DATE_OPERATORS,
102
- CHECKBOX_OPERATORS,
103
- operatorOption,
104
- operatorsForColumn,
105
- defaultOperatorFor,
106
- operatorLabelFor,
107
- } from "./filter-operators";
108
- import {
109
- type FacetBucket,
110
- isBucketableColumn,
111
- buildBuckets,
112
- isInBucket,
113
- } from "./facet-buckets";
114
- import {
115
- getColumnBaseValue,
116
- isGroupRow,
117
- toolPanelHeaderLabel,
118
- formatSummaryNumeric,
119
- getColumnAlign,
120
- getPinnedCellValue,
121
- getColumnAccessorValue,
122
- columnDefMatchesId,
123
- } from "./cell-values";
124
9
 
125
10
  export function createColumns<
126
11
  TFeatures extends TableFeatures = TableFeatures,
@@ -66,7 +66,6 @@ export type MenuItemProps = {
66
66
  onclick: () => void
67
67
  }
68
68
 
69
- let uid = 0
70
69
 
71
70
  export function createMenu(config: MenuConfig) {
72
71
  const items = () => config.items()