@svgrid/grid-wc 2.7.0 → 3.0.1
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.
- package/README.md +110 -110
- package/dist/GridMenus-YwTw9Upd.js +1123 -0
- package/dist/SvDateRangeInput-CrxeppBV.js +196 -0
- package/dist/SvDateTimePicker-xAO-Pb4S.js +765 -0
- package/dist/{dismissable-Nx79OIVg.js → SvField-CE345DyF.js} +11 -51
- package/dist/{shadow/SvGrid.helpers-BZPDBcza.js → SvGrid.helpers-BdVDtjUm.js} +24 -14
- package/dist/SvGridCellEditor-D7SyHtff.js +550 -0
- package/dist/SvGridChart-CMaVmlso.js +1477 -0
- package/dist/SvGridChartPanel-Pc_IW0eA.js +833 -0
- package/dist/{SvGridChartView-ScXTF6t-.js → SvGridChartView-DLhhzmFy.js} +6 -4
- package/dist/{SvGridDropdown-DnAESFDu.js → SvGridDropdown-DUncHqM-.js} +2 -2
- package/dist/{shadow/cell-formatting-C0OsDmi_.js → cell-formatting-Eypm-id0.js} +1 -1
- package/dist/chart-GRBAgN1M.js +1658 -0
- package/dist/date-format-D_oQ5Yw0.js +1127 -0
- package/dist/dismissable-DvhBKm3q.js +41 -0
- package/dist/{export-format-B6FUgOll.js → export-format-uGayRKWM.js} +3 -3
- package/dist/{shadow/row-drag-touch-Ddaa-QeB.js → row-drag-touch-CycRR65n.js} +12 -10
- package/dist/shadow/GridMenus-YwTw9Upd.js +1123 -0
- package/dist/shadow/SvDateRangeInput-CrxeppBV.js +196 -0
- package/dist/shadow/SvDateTimePicker-xAO-Pb4S.js +765 -0
- package/dist/shadow/{dismissable-Nx79OIVg.js → SvField-CE345DyF.js} +11 -51
- package/dist/{SvGrid.helpers-BZPDBcza.js → shadow/SvGrid.helpers-BdVDtjUm.js} +24 -14
- package/dist/shadow/SvGridCellEditor-D7SyHtff.js +550 -0
- package/dist/shadow/SvGridChart-CMaVmlso.js +1477 -0
- package/dist/shadow/SvGridChartPanel-Pc_IW0eA.js +833 -0
- package/dist/shadow/{SvGridChartView-ScXTF6t-.js → SvGridChartView-DLhhzmFy.js} +6 -4
- package/dist/shadow/{SvGridDropdown-DnAESFDu.js → SvGridDropdown-DUncHqM-.js} +2 -2
- package/dist/{cell-formatting-C0OsDmi_.js → shadow/cell-formatting-Eypm-id0.js} +1 -1
- package/dist/shadow/chart-GRBAgN1M.js +1658 -0
- package/dist/shadow/date-format-D_oQ5Yw0.js +1127 -0
- package/dist/shadow/dismissable-DvhBKm3q.js +41 -0
- package/dist/shadow/{export-format-C8kZGZfz.js → export-format-DhdZREP1.js} +3 -3
- package/dist/{row-drag-touch-Ddaa-QeB.js → shadow/row-drag-touch-CycRR65n.js} +12 -10
- package/dist/shadow/sv-grid-shadow-element.js +2896 -2628
- package/dist/sv-grid-element.js +2894 -2626
- package/package.json +3 -3
- package/dist/GridMenus-DE0zNY_3.js +0 -1022
- package/dist/SvDateTimePicker-BpeEupA2.js +0 -1885
- package/dist/SvGridCellEditor-_rqEaig7.js +0 -531
- package/dist/SvGridChart-yK5Zv85y.js +0 -1199
- package/dist/SvGridChartPanel-B38_VjXM.js +0 -584
- package/dist/chart-uvs3sFJA.js +0 -1220
- package/dist/shadow/GridMenus-DE0zNY_3.js +0 -1022
- package/dist/shadow/SvDateTimePicker-BpeEupA2.js +0 -1885
- package/dist/shadow/SvGridCellEditor-_rqEaig7.js +0 -531
- package/dist/shadow/SvGridChart-yK5Zv85y.js +0 -1199
- package/dist/shadow/SvGridChartPanel-B38_VjXM.js +0 -584
- package/dist/shadow/chart-uvs3sFJA.js +0 -1220
package/README.md
CHANGED
|
@@ -1,110 +1,110 @@
|
|
|
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
|
+
## 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.
|