@svgrid/grid 2.2.32 → 2.2.34

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/dist/DockNodeView.svelte +1 -1
  2. package/dist/GridFooter.svelte +46 -47
  3. package/dist/GridMenus.svelte +0 -77
  4. package/dist/SvDateRangeInput.svelte +1 -1
  5. package/dist/SvGrid.css +10 -0
  6. package/dist/SvGrid.svelte +2 -25
  7. package/dist/SvGridChart.svelte +2 -10
  8. package/dist/SvGridSelect.svelte +0 -2
  9. package/dist/SvKbd.svelte +1 -1
  10. package/dist/SvList.svelte +1 -1
  11. package/dist/SvMenubar.svelte +1 -1
  12. package/dist/SvMultiSelect.svelte +0 -1
  13. package/dist/SvOtpInput.svelte +1 -1
  14. package/dist/SvRichText.svelte +4 -0
  15. package/dist/SvTour.svelte +4 -0
  16. package/dist/SvTreeSelect.svelte +0 -2
  17. package/dist/cdn/{GridMenus-Cyk3qpJ7.js → GridMenus-T-bZNprc.js} +153 -152
  18. package/dist/cdn/{GridMenus-C6ixSGWW.js → GridMenus-oQYElQll.js} +5 -7
  19. package/dist/cdn/{SvDateTimePicker-ClqtVIj3.js → SvDateTimePicker-CHnUkWcH.js} +163 -163
  20. package/dist/cdn/{SvDateTimePicker-CdqaP61H.js → SvDateTimePicker-CRQH_U7E.js} +570 -553
  21. package/dist/cdn/{SvGridChart-BhnFdLd0.js → SvGridChart-BEJmNNx9.js} +1 -1
  22. package/dist/cdn/{SvGridChart-BcLCYvw9.js → SvGridChart-BwVos976.js} +27 -20
  23. package/dist/cdn/{SvGridChartPanel-Cmx9DHAS.js → SvGridChartPanel-BOknOkrP.js} +2 -2
  24. package/dist/cdn/{SvGridChartPanel-DvjwxLvK.js → SvGridChartPanel-D2PjII4O.js} +22 -14
  25. package/dist/cdn/{SvGridChartView-PwqI4s02.js → SvGridChartView-00LPUHL1.js} +3 -3
  26. package/dist/cdn/{SvGridChartView-B40DTJSX.js → SvGridChartView-BhUEJ5ki.js} +2 -2
  27. package/dist/cdn/{SvGridDropdown-Dh-2ej8j.js → SvGridDropdown-D13MtJ2j.js} +5 -4
  28. package/dist/cdn/{chart-T1usDN0o.js → chart-i4XcXyHJ.js} +12 -10
  29. package/dist/cdn/disclose-version-Dr7rEVv-.js +2866 -0
  30. package/dist/cdn/{export-format-JT5pWVT8.js → export-format-Cv1Dll6k.js} +66 -245
  31. package/dist/cdn/{src-BgHjWF0Q.js → src-72QTH8lh.js} +9006 -8811
  32. package/dist/cdn/{src-CgD-wiuS.js → src-Cm7C_WOZ.js} +9206 -8927
  33. package/dist/cdn/svgrid.js +9 -9
  34. package/dist/cdn/svgrid.svelte-external.js +8 -8
  35. package/dist/chart.d.ts +2 -0
  36. package/dist/chart.js +1 -4
  37. package/dist/columns.js +9 -2
  38. package/dist/createMenu.svelte.js +0 -1
  39. package/dist/createPopoverSelect.svelte.d.ts +2 -2
  40. package/dist/editing.js +1 -1
  41. package/dist/export-format.js +3 -0
  42. package/dist/selection.js +0 -1
  43. package/package.json +3 -2
  44. package/src/DockNodeView.svelte +1 -1
  45. package/src/GridFooter.svelte +46 -47
  46. package/src/GridMenus.svelte +0 -77
  47. package/src/SvCalendar.test.ts +1 -1
  48. package/src/SvDateRangeInput.svelte +1 -1
  49. package/src/SvGrid.controller.svelte.ts +0 -5
  50. package/src/SvGrid.css +10 -0
  51. package/src/SvGrid.svelte +2 -25
  52. package/src/SvGrid.types.ts +0 -1
  53. package/src/SvGridChart.svelte +2 -10
  54. package/src/SvGridSelect.svelte +0 -2
  55. package/src/SvKbd.svelte +1 -1
  56. package/src/SvList.svelte +1 -1
  57. package/src/SvMenubar.svelte +1 -1
  58. package/src/SvMultiSelect.svelte +0 -1
  59. package/src/SvOtpInput.svelte +1 -1
  60. package/src/SvRichText.svelte +4 -0
  61. package/src/SvTour.svelte +4 -0
  62. package/src/SvTreeSelect.svelte +0 -2
  63. package/src/ai.test.ts +1 -1
  64. package/src/build-api.ts +0 -105
  65. package/src/cell-formatting.test.ts +1 -1
  66. package/src/cell-render.ts +0 -94
  67. package/src/chart.ts +1 -2
  68. package/src/clipboard.ts +0 -102
  69. package/src/columns.ts +7 -117
  70. package/src/createMenu.svelte.ts +0 -1
  71. package/src/editing.ts +2 -105
  72. package/src/editor-registry.grid.test.ts +0 -2
  73. package/src/export-format.ts +3 -0
  74. package/src/features.ts +0 -90
  75. package/src/keyboard-handlers.coverage.test.ts +1 -1
  76. package/src/keyboard-handlers.ts +0 -120
  77. package/src/menus.test.ts +0 -1
  78. package/src/menus.ts +0 -112
  79. package/src/new-features.test.ts +3 -1
  80. package/src/row-drag.test.ts +1 -1
  81. package/src/row-resize.test.ts +1 -2
  82. package/src/scroll-sync.test.ts +4 -7
  83. package/src/scroll-sync.ts +0 -122
  84. package/src/selection.ts +0 -109
  85. package/src/server-group-model.test.ts +2 -2
  86. package/src/summaries.ts +0 -112
  87. package/src/svgrid.behavior.test.ts +0 -1
  88. package/src/svgrid.column-reorder.test.ts +0 -8
  89. package/src/svgrid.footer-pagesize.svelte.test.ts +86 -0
  90. package/src/tree-row-model.test.ts +0 -1
  91. package/dist/cdn/disclose-version-DoD9AFD_.js +0 -2958
@@ -0,0 +1,86 @@
1
+ /**
2
+ * The footer's page-size control used to import SvGridDropdown statically.
3
+ * That pulled a ~22 KB component into the base bundle to pick one of four
4
+ * numbers, and worse, it gave the bundler a static path to a module that
5
+ * SvGrid.svelte deliberately loads with `import()` as a cell editor. The lazy
6
+ * boundary silently stopped existing: the dropdown shipped in base and the
7
+ * dynamic import resolved to the already-bundled copy.
8
+ *
9
+ * The footer now renders the dropdown's closed trigger as plain markup and
10
+ * fetches the real component on first open. These tests pin the two things
11
+ * that regression would break: the trigger must look and read the same before
12
+ * any load, and clicking it must actually open the list rather than requiring
13
+ * a second click once the chunk arrives.
14
+ */
15
+ import { describe, expect, it } from 'vitest'
16
+ import { mount, unmount } from 'svelte'
17
+ import SvGrid from './SvGrid.svelte'
18
+ import { createCoreRowModel, rowPaginationFeature, tableFeatures } from './index'
19
+ import type { ColumnDef } from './index'
20
+
21
+ type Row = { id: number; name: string }
22
+ const features = tableFeatures({ rowPaginationFeature })
23
+ const rows: Row[] = Array.from({ length: 40 }, (_, i) => ({ id: i + 1, name: `Row ${i + 1}` }))
24
+ const cols: ColumnDef<typeof features, Row>[] = [{ field: 'name', header: 'Name', width: 160 }]
25
+
26
+ const tick = () => new Promise<void>((r) => setTimeout(r))
27
+
28
+ function mountGrid(target: HTMLElement) {
29
+ return mount(SvGrid<typeof features, Row>, {
30
+ target,
31
+ props: {
32
+ data: rows,
33
+ columns: cols,
34
+ features,
35
+ showPagination: true,
36
+ pageSize: 10,
37
+ getCoreRowModel: createCoreRowModel(),
38
+ } as never,
39
+ })
40
+ }
41
+
42
+ const trigger = (host: HTMLElement) =>
43
+ host.querySelector<HTMLButtonElement>(
44
+ '.sv-grid-pagination-pagesize-dd .sv-grid-dropdown-trigger',
45
+ )
46
+
47
+ describe('footer page-size control', () => {
48
+ it('renders a dropdown trigger without loading SvGridDropdown', async () => {
49
+ const host = document.createElement('div')
50
+ document.body.appendChild(host)
51
+ const app = mountGrid(host)
52
+ await tick()
53
+
54
+ const btn = trigger(host)
55
+ expect(btn).not.toBeNull()
56
+ // Same classes and ARIA as the real component's closed state, so swapping
57
+ // it in causes no visual change and no layout shift.
58
+ expect(btn!.getAttribute('aria-haspopup')).toBe('listbox')
59
+ expect(btn!.getAttribute('aria-expanded')).toBe('false')
60
+ expect(btn!.querySelector('.sv-grid-dropdown-label')?.textContent?.trim()).toBe('10')
61
+ expect(btn!.querySelector('.sv-grid-dropdown-caret')).not.toBeNull()
62
+ // Nothing is open until the user asks for it.
63
+ expect(host.querySelector('[role="listbox"]')).toBeNull()
64
+
65
+ unmount(app)
66
+ host.remove()
67
+ })
68
+
69
+ it('opens on the first click, without needing a second one', async () => {
70
+ const host = document.createElement('div')
71
+ document.body.appendChild(host)
72
+ const app = mountGrid(host)
73
+ await tick()
74
+
75
+ trigger(host)!.click()
76
+ // The component is fetched here; give the dynamic import a turn to settle.
77
+ for (let i = 0; i < 10 && !document.querySelector('[role="listbox"]'); i++) await tick()
78
+
79
+ // autoOpen carries the originating click through to an open panel.
80
+ expect(document.querySelector('[role="listbox"]')).not.toBeNull()
81
+ expect(trigger(host)!.getAttribute('aria-expanded')).toBe('true')
82
+
83
+ unmount(app)
84
+ host.remove()
85
+ })
86
+ })
@@ -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 },