@svgrid/grid-wc 3.0.0 → 3.0.2

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 (96) hide show
  1. package/README.md +130 -110
  2. package/dist/GridMenus-B1mC1aPp.js +1077 -0
  3. package/dist/SvChartMenu-CBMKm7Xb.js +413 -0
  4. package/dist/SvDateRangeInput-BrYTQEMM.js +197 -0
  5. package/dist/SvDateTimePicker-CnLlqNDQ.js +766 -0
  6. package/dist/SvField-Bmzp3ObZ.js +147 -0
  7. package/dist/SvGridCellEditor-B005dmV1.js +560 -0
  8. package/dist/SvGridChart-4TcL9Rj2.js +3702 -0
  9. package/dist/SvGridChartBuilder-C4OL4XYx.js +1165 -0
  10. package/dist/SvGridChartPanel-CfHA8Ioq.js +1743 -0
  11. package/dist/SvGridChartView-Ci-9_EJ0.js +45 -0
  12. package/dist/SvGridDropdown-BlA6iw9m.js +257 -0
  13. package/dist/angular/fesm2022/svgrid-grid-wc-angular.mjs +178 -7
  14. package/dist/angular/fesm2022/svgrid-grid-wc-angular.mjs.map +1 -1
  15. package/dist/angular/types/svgrid-grid-wc-angular.d.ts +77 -2
  16. package/dist/{shadow/cell-formatting-C0OsDmi_.js → cell-formatting-Eypm-id0.js} +1 -1
  17. package/dist/chart/SvChartMenu-C-sbGNk8.js +586 -0
  18. package/dist/chart/chart-export-BHGuh_kZ.js +127 -0
  19. package/dist/chart/chart-export-pdf-BjkkIEkE.js +104 -0
  20. package/dist/chart/chart-summary-B86RFA3M.js +137 -0
  21. package/dist/chart/chart-trend-DP6DSsBa.js +56 -0
  22. package/dist/chart/chart-validate-CD6ptiwg.js +180 -0
  23. package/dist/chart/client-BuB0wIgc.js +2757 -0
  24. package/dist/chart/sv-chart-element.d.ts +98 -0
  25. package/dist/chart/sv-chart-element.js +7282 -0
  26. package/dist/chart-DoqdUoGg.js +4398 -0
  27. package/dist/chart-export-pdf-BirUdchl.js +104 -0
  28. package/dist/chart-summary-BP9i-v8M.js +137 -0
  29. package/dist/chart-validate-CD6ptiwg.js +180 -0
  30. package/dist/{shadow/client-DjwUji8D.js → client-DEF0GRjE.js} +1 -1
  31. package/dist/{shadow/column-resize-DvCRUrN3.js → column-resize-DUPgynvc.js} +3 -3
  32. package/dist/date-format-DMTwV8NC.js +1128 -0
  33. package/dist/{export-format-B6FUgOll.js → export-format-uGayRKWM.js} +3 -3
  34. package/dist/focus-trap-DvlOlOGM.js +65 -0
  35. package/dist/list-option-DrRyivWp.js +82 -0
  36. package/dist/react/chart.d.ts +99 -0
  37. package/dist/react/chart.js +49 -0
  38. package/dist/react/index.d.ts +28 -0
  39. package/dist/react/index.js +4 -1
  40. package/dist/{row-resize-D-8s3cqT.js → row-resize-Cf8qPLbi.js} +44 -36
  41. package/dist/shadow/GridMenus-B1mC1aPp.js +1077 -0
  42. package/dist/shadow/SvChartMenu-CBMKm7Xb.js +413 -0
  43. package/dist/shadow/SvDateRangeInput-BrYTQEMM.js +197 -0
  44. package/dist/shadow/SvDateTimePicker-CnLlqNDQ.js +766 -0
  45. package/dist/shadow/SvField-Bmzp3ObZ.js +147 -0
  46. package/dist/shadow/SvGridCellEditor-B005dmV1.js +560 -0
  47. package/dist/shadow/SvGridChart-4TcL9Rj2.js +3702 -0
  48. package/dist/shadow/SvGridChartBuilder-C4OL4XYx.js +1165 -0
  49. package/dist/shadow/SvGridChartPanel-CfHA8Ioq.js +1743 -0
  50. package/dist/shadow/SvGridChartView-Ci-9_EJ0.js +45 -0
  51. package/dist/shadow/SvGridDropdown-BlA6iw9m.js +257 -0
  52. package/dist/{cell-formatting-C0OsDmi_.js → shadow/cell-formatting-Eypm-id0.js} +1 -1
  53. package/dist/shadow/chart-DoqdUoGg.js +4398 -0
  54. package/dist/shadow/chart-export-pdf-BirUdchl.js +104 -0
  55. package/dist/shadow/chart-summary-BP9i-v8M.js +137 -0
  56. package/dist/shadow/chart-validate-CD6ptiwg.js +180 -0
  57. package/dist/{client-DjwUji8D.js → shadow/client-DEF0GRjE.js} +1 -1
  58. package/dist/{column-resize-DvCRUrN3.js → shadow/column-resize-DUPgynvc.js} +3 -3
  59. package/dist/shadow/date-format-DMTwV8NC.js +1128 -0
  60. package/dist/shadow/{export-format-C8kZGZfz.js → export-format-DhdZREP1.js} +3 -3
  61. package/dist/shadow/focus-trap-DvlOlOGM.js +65 -0
  62. package/dist/shadow/list-option-DrRyivWp.js +82 -0
  63. package/dist/shadow/{row-resize-D-8s3cqT.js → row-resize-Cf8qPLbi.js} +44 -36
  64. package/dist/shadow/sv-grid-shadow-element.d.ts +15 -0
  65. package/dist/shadow/sv-grid-shadow-element.js +4853 -3626
  66. package/dist/shadow/{svelte-virtualizer.svelte-DZ9UcyfT.js → svelte-virtualizer.svelte-CnGhFGDc.js} +37 -34
  67. package/dist/sv-grid-element.d.ts +15 -0
  68. package/dist/sv-grid-element.js +4809 -3612
  69. package/dist/{svelte-virtualizer.svelte-DZ9UcyfT.js → svelte-virtualizer.svelte-CnGhFGDc.js} +37 -34
  70. package/dist/vue/chart.d.ts +64 -0
  71. package/dist/vue/chart.js +41 -0
  72. package/dist/vue/index.d.ts +11 -2
  73. package/dist/vue/index.js +4 -1
  74. package/package.json +18 -5
  75. package/dist/GridMenus-DpmS1pzo.js +0 -1121
  76. package/dist/SvDateRangeInput-u4ibte8S.js +0 -196
  77. package/dist/SvDateTimePicker-DVFiDxUq.js +0 -765
  78. package/dist/SvField-ChCI-O2O.js +0 -146
  79. package/dist/SvGridCellEditor-DvsQyE9a.js +0 -550
  80. package/dist/SvGridChart-yK5Zv85y.js +0 -1199
  81. package/dist/SvGridChartPanel-B38_VjXM.js +0 -584
  82. package/dist/SvGridChartView-ScXTF6t-.js +0 -50
  83. package/dist/SvGridDropdown-DnAESFDu.js +0 -256
  84. package/dist/chart-uvs3sFJA.js +0 -1220
  85. package/dist/date-format-CPHqTHN6.js +0 -1127
  86. package/dist/shadow/GridMenus-DpmS1pzo.js +0 -1121
  87. package/dist/shadow/SvDateRangeInput-u4ibte8S.js +0 -196
  88. package/dist/shadow/SvDateTimePicker-DVFiDxUq.js +0 -765
  89. package/dist/shadow/SvField-ChCI-O2O.js +0 -146
  90. package/dist/shadow/SvGridCellEditor-DvsQyE9a.js +0 -550
  91. package/dist/shadow/SvGridChart-yK5Zv85y.js +0 -1199
  92. package/dist/shadow/SvGridChartPanel-B38_VjXM.js +0 -584
  93. package/dist/shadow/SvGridChartView-ScXTF6t-.js +0 -50
  94. package/dist/shadow/SvGridDropdown-DnAESFDu.js +0 -256
  95. package/dist/shadow/chart-uvs3sFJA.js +0 -1220
  96. package/dist/shadow/date-format-CPHqTHN6.js +0 -1127
package/README.md CHANGED
@@ -1,110 +1,130 @@
1
- <p align="center">
2
- <img src="https://svgrid.com/brand/svgrid-logo-icon-1200.png" alt="SvGrid" width="100" height="100" />
3
- </p>
4
-
5
- <h1 align="center">@svgrid/grid-wc</h1>
6
-
7
- <p align="center"><strong>SvGrid as a framework-agnostic web component.</strong></p>
8
-
9
- <p align="center">
10
- <a href="https://www.npmjs.com/package/@svgrid/grid-wc"><img src="https://img.shields.io/npm/v/%40svgrid%2Fgrid-wc.svg?label=%40svgrid%2Fgrid-wc" alt="npm version" /></a>
11
- <a href="https://www.npmjs.com/package/@svgrid/grid-wc"><img src="https://img.shields.io/npm/dm/%40svgrid%2Fgrid-wc.svg" alt="npm downloads" /></a>
12
- <a href="./LICENSE"><img src="https://img.shields.io/badge/license-MIT-brightgreen.svg" alt="MIT License" /></a>
13
- </p>
14
-
15
- <p align="center">
16
- <a href="https://svgrid.com">Website</a> ·
17
- <a href="https://svgrid.com/docs/">Docs</a> ·
18
- <a href="https://svgrid.com/demos/">Demos</a>
19
- </p>
20
-
21
- ---
22
-
23
- A single, self-contained `<sv-grid>`
24
- [custom element](https://developer.mozilla.org/en-US/docs/Web/API/Web_components)
25
- you can drop into **React, Vue, Angular, or plain HTML** - no build step, no Svelte
26
- required in the host app.
27
-
28
- Powered by [SvGrid](https://svgrid.com), the Svelte 5 data grid and data table:
29
- virtual scrolling, Excel-style filters, sorting, inline editing, grouping, and
30
- pagination.
31
-
32
- ## CDN (zero build)
33
-
34
- ```html
35
- <script type="module" src="https://unpkg.com/@svgrid/grid-wc"></script>
36
-
37
- <sv-grid id="grid" sortable filterable style="display:block;height:420px"></sv-grid>
38
-
39
- <script type="module">
40
- const grid = document.getElementById('grid')
41
- // Arrays/objects are set as PROPERTIES, not attributes:
42
- grid.columns = [
43
- { field: 'name', header: 'Name', editorType: 'text', width: 200 },
44
- { field: 'salary', header: 'Salary', align: 'right',
45
- format: { type: 'currency', currency: 'USD' } },
46
- ]
47
- grid.data = [
48
- { name: 'Ada Lovelace', salary: 145000 },
49
- { name: 'Alan Turing', salary: 160000 },
50
- ]
51
- grid.addEventListener('rowclick', (e) => console.log(e.detail))
52
- </script>
53
- ```
54
-
55
- ## npm
56
-
57
- ```bash
58
- npm install @svgrid/grid-wc
59
- ```
60
-
61
- ```js
62
- import '@svgrid/grid-wc' // registers <sv-grid> globally
63
- ```
64
-
65
- ## Attributes & properties
66
-
67
- | Name | Kind | Default | Notes |
68
- | --- | --- | --- | --- |
69
- | `data` | property | `[]` | Array of row objects. Set via `el.data = [...]`. |
70
- | `columns` | property | `[]` | Array of column defs. Set via `el.columns = [...]`. |
71
- | `sortable` | attribute (boolean) | `true` | Enable column sorting. |
72
- | `filterable` | attribute (boolean) | `true` | Enable column filtering. |
73
- | `selectable` | attribute (boolean) | `false` | Row checkboxes + selection. |
74
- | `editable` | attribute (boolean) | `false` | Inline cell editing. |
75
- | `row-height` | attribute (number) | `36` | Row height in px. |
76
-
77
- ### Events
78
-
79
- | Event | `detail` |
80
- | --- | --- |
81
- | `rowclick` | the clicked row object |
82
- | `selectionchange` | array of selected rows |
83
-
84
- ## Frameworks
85
-
86
- - **React 19+**: `<sv-grid sortable .data={rows} .columns={cols} />` (older React: set via a `ref`).
87
- - **Vue 3**: `<sv-grid sortable :data.prop="rows" :columns.prop="cols" />`.
88
- - **Angular**: add `CUSTOM_ELEMENTS_SCHEMA`, then `<sv-grid [data]="rows" [columns]="cols" sortable>`.
89
-
90
- Full guide: [svgrid.com/docs/help/web-components](https://svgrid.com/docs/help/web-components/).
91
-
92
- ## Styling
93
-
94
- Built with `shadow: 'none'` (light DOM) so your page CSS and the `--sg-*` theme
95
- tokens apply, and the grid's overlay popups stay styled:
96
-
97
- ```css
98
- sv-grid {
99
- --sg-bg: #fff;
100
- --sg-header-bg: #f8fafc;
101
- --sg-border: #e2e8f0;
102
- }
103
- ```
104
-
105
- ## Pro
106
-
107
- This element ships the free MIT `@svgrid/grid` core. For export, import,
108
- print, pivot, and AI, see [@svgrid/enterprise](https://svgrid.com/pricing/).
109
-
110
- SvGrid(TM) is a trademark of jQWidgets Ltd. This package is MIT-licensed.
1
+ <p align="center">
2
+ <img src="https://svgrid.com/brand/svgrid-logo-icon-1200.png" alt="SvGrid" width="100" height="100" />
3
+ </p>
4
+
5
+ <h1 align="center">@svgrid/grid-wc</h1>
6
+
7
+ <p align="center"><strong>SvGrid as a framework-agnostic web component.</strong></p>
8
+
9
+ <p align="center">
10
+ <a href="https://www.npmjs.com/package/@svgrid/grid-wc"><img src="https://img.shields.io/npm/v/%40svgrid%2Fgrid-wc.svg?label=%40svgrid%2Fgrid-wc" alt="npm version" /></a>
11
+ <a href="https://www.npmjs.com/package/@svgrid/grid-wc"><img src="https://img.shields.io/npm/dm/%40svgrid%2Fgrid-wc.svg" alt="npm downloads" /></a>
12
+ <a href="./LICENSE"><img src="https://img.shields.io/badge/license-MIT-brightgreen.svg" alt="MIT License" /></a>
13
+ </p>
14
+
15
+ <p align="center">
16
+ <a href="https://svgrid.com">Website</a> ·
17
+ <a href="https://svgrid.com/docs/">Docs</a> ·
18
+ <a href="https://svgrid.com/demos/">Demos</a>
19
+ </p>
20
+
21
+ ---
22
+
23
+ A single, self-contained `<sv-grid>`
24
+ [custom element](https://developer.mozilla.org/en-US/docs/Web/API/Web_components)
25
+ you can drop into **React, Vue, Angular, or plain HTML** - no build step, no Svelte
26
+ required in the host app.
27
+
28
+ Powered by [SvGrid](https://svgrid.com), the Svelte 5 data grid and data table:
29
+ virtual scrolling, Excel-style filters, sorting, inline editing, grouping, and
30
+ pagination.
31
+
32
+ ## CDN (zero build)
33
+
34
+ ```html
35
+ <script type="module" src="https://unpkg.com/@svgrid/grid-wc"></script>
36
+
37
+ <sv-grid id="grid" sortable filterable style="display:block;height:420px"></sv-grid>
38
+
39
+ <script type="module">
40
+ const grid = document.getElementById('grid')
41
+ // Arrays/objects are set as PROPERTIES, not attributes:
42
+ grid.columns = [
43
+ { field: 'name', header: 'Name', editorType: 'text', width: 200 },
44
+ { field: 'salary', header: 'Salary', align: 'right',
45
+ format: { type: 'currency', currency: 'USD' } },
46
+ ]
47
+ grid.data = [
48
+ { name: 'Ada Lovelace', salary: 145000 },
49
+ { name: 'Alan Turing', salary: 160000 },
50
+ ]
51
+ grid.addEventListener('rowclick', (e) => console.log(e.detail))
52
+ </script>
53
+ ```
54
+
55
+ ## npm
56
+
57
+ ```bash
58
+ npm install @svgrid/grid-wc
59
+ ```
60
+
61
+ ```js
62
+ import '@svgrid/grid-wc' // registers <sv-grid> globally
63
+ ```
64
+
65
+ ## Attributes & properties
66
+
67
+ | Name | Kind | Default | Notes |
68
+ | --- | --- | --- | --- |
69
+ | `data` | property | `[]` | Array of row objects. Set via `el.data = [...]`. |
70
+ | `columns` | property | `[]` | Array of column defs. Set via `el.columns = [...]`. |
71
+ | `sortable` | attribute (boolean) | `true` | Enable column sorting. |
72
+ | `filterable` | attribute (boolean) | `true` | Enable column filtering. |
73
+ | `selectable` | attribute (boolean) | `false` | Row checkboxes + selection. |
74
+ | `editable` | attribute (boolean) | `false` | Inline cell editing. |
75
+ | `row-height` | attribute (number) | `36` | Row height in px. |
76
+
77
+ ### Events
78
+
79
+ | Event | `detail` |
80
+ | --- | --- |
81
+ | `rowclick` | the clicked row object |
82
+ | `selectionchange` | array of selected rows |
83
+
84
+ ## The chart element
85
+
86
+ The standalone chart is a second element in the same package, without the grid:
87
+
88
+ ```html
89
+ <script type="module" src="https://cdn.jsdelivr.net/npm/@svgrid/grid-wc/dist/chart/sv-chart-element.js"></script>
90
+ <sv-chart id="chart" legend="right" zoomable range-presets></sv-chart>
91
+ <script type="module">
92
+ document.getElementById('chart').spec = {
93
+ type: 'line', categories: ['2026-01-01', '2026-01-02', '2026-01-03'],
94
+ series: [{ label: 'Close', values: [10, 12, 11] }], xType: 'ordinal-time',
95
+ }
96
+ </script>
97
+ ```
98
+
99
+ From npm: `import '@svgrid/grid-wc/chart'`, with wrappers at
100
+ `@svgrid/grid-wc/react/chart`, `@svgrid/grid-wc/vue/chart` and the
101
+ `SvChartComponent` export of `@svgrid/grid-wc/angular`. Reference:
102
+ [svgrid.com/docs/help/web-components/sv-chart](https://svgrid.com/docs/help/web-components/sv-chart/).
103
+
104
+ ## Frameworks
105
+
106
+ - **React 19+**: `<sv-grid sortable .data={rows} .columns={cols} />` (older React: set via a `ref`).
107
+ - **Vue 3**: `<sv-grid sortable :data.prop="rows" :columns.prop="cols" />`.
108
+ - **Angular**: add `CUSTOM_ELEMENTS_SCHEMA`, then `<sv-grid [data]="rows" [columns]="cols" sortable>`.
109
+
110
+ Full guide: [svgrid.com/docs/help/web-components](https://svgrid.com/docs/help/web-components/).
111
+
112
+ ## Styling
113
+
114
+ Built with `shadow: 'none'` (light DOM) so your page CSS and the `--sg-*` theme
115
+ tokens apply, and the grid's overlay popups stay styled:
116
+
117
+ ```css
118
+ sv-grid {
119
+ --sg-bg: #fff;
120
+ --sg-header-bg: #f8fafc;
121
+ --sg-border: #e2e8f0;
122
+ }
123
+ ```
124
+
125
+ ## Pro
126
+
127
+ This element ships the free MIT `@svgrid/grid` core. For export, import,
128
+ print, pivot, and AI, see [@svgrid/enterprise](https://svgrid.com/pricing/).
129
+
130
+ SvGrid(TM) is a trademark of jQWidgets Ltd. This package is MIT-licensed.