@svgrid/grid-wc 3.0.4 → 3.0.6

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 (31) hide show
  1. package/dist/{GridMenus-DMkf7UMn.js → GridMenus-Nf04Zcl5.js} +2 -2
  2. package/dist/{SvGrid.helpers-BdVDtjUm.js → SvGrid.helpers-zBkDTryR.js} +36 -37
  3. package/dist/{shadow/SvGridCellEditor-DhXEIlyE.js → SvGridCellEditor-BTbDEgpe.js} +1 -1
  4. package/dist/{shadow/SvGridChart-BMdCbrqb.js → SvGridChart-BSNYAW_W.js} +4 -4
  5. package/dist/{SvGridChartBuilder-Chp_MD1B.js → SvGridChartBuilder-DDl_Bv8k.js} +3 -3
  6. package/dist/{SvGridChartPanel-BIV2O2Lp.js → SvGridChartPanel-DkIR-3rA.js} +6 -6
  7. package/dist/{SvGridChartView-DyhkumD-.js → SvGridChartView-B4pqLWnm.js} +2 -2
  8. package/dist/{shadow/cell-formatting-CBfgahv1.js → cell-formatting-hb3vzxhJ.js} +27 -5
  9. package/dist/{shadow/chart-export-pdf-9OCvhzr0.js → chart-export-pdf-hJVuR7_z.js} +1 -1
  10. package/dist/{chart-D_LKA1fr.js → chart-nwSa4jQe.js} +1 -1
  11. package/dist/{shadow/chart-summary-v3Lhe8YD.js → chart-summary-BL4WDgEu.js} +1 -1
  12. package/dist/{export-format-CAi1mp-1.js → export-format-CXEUNl8j.js} +60 -65
  13. package/dist/shadow/{GridMenus-DMkf7UMn.js → GridMenus-Nf04Zcl5.js} +2 -2
  14. package/dist/shadow/{SvGrid.helpers-BdVDtjUm.js → SvGrid.helpers-zBkDTryR.js} +36 -37
  15. package/dist/{SvGridCellEditor-DhXEIlyE.js → shadow/SvGridCellEditor-BTbDEgpe.js} +1 -1
  16. package/dist/{SvGridChart-BMdCbrqb.js → shadow/SvGridChart-BSNYAW_W.js} +4 -4
  17. package/dist/shadow/{SvGridChartBuilder-Chp_MD1B.js → SvGridChartBuilder-DDl_Bv8k.js} +3 -3
  18. package/dist/shadow/{SvGridChartPanel-BIV2O2Lp.js → SvGridChartPanel-DkIR-3rA.js} +6 -6
  19. package/dist/shadow/{SvGridChartView-DyhkumD-.js → SvGridChartView-B4pqLWnm.js} +2 -2
  20. package/dist/{cell-formatting-CBfgahv1.js → shadow/cell-formatting-hb3vzxhJ.js} +27 -5
  21. package/dist/{chart-export-pdf-9OCvhzr0.js → shadow/chart-export-pdf-hJVuR7_z.js} +1 -1
  22. package/dist/shadow/{chart-D_LKA1fr.js → chart-nwSa4jQe.js} +1 -1
  23. package/dist/{chart-summary-v3Lhe8YD.js → shadow/chart-summary-BL4WDgEu.js} +1 -1
  24. package/dist/shadow/{export-format-mnW_rVBZ.js → export-format-DQtIyOvV.js} +60 -65
  25. package/dist/shadow/sv-grid-shadow-element.js +1972 -1918
  26. package/dist/shadow/{svelte-virtualizer.svelte-CnGhFGDc.js → svelte-virtualizer.svelte-CMX34S17.js} +7 -3
  27. package/dist/shadow/{validate-BqDthkNr.js → validate-JAuMsk6Z.js} +36 -36
  28. package/dist/sv-grid-element.js +1957 -1903
  29. package/dist/{svelte-virtualizer.svelte-CnGhFGDc.js → svelte-virtualizer.svelte-CMX34S17.js} +7 -3
  30. package/dist/{validate-BqDthkNr.js → validate-JAuMsk6Z.js} +36 -36
  31. package/package.json +3 -3
@@ -441,11 +441,14 @@ function D(e) {
441
441
  }
442
442
  return {
443
443
  setOptions(e) {
444
- let n = {
444
+ let r = {
445
445
  ...t,
446
446
  ...e
447
- };
448
- b(t, n) || (t = n, s());
447
+ }, i = typeof e.estimateSize == "function";
448
+ !i && b(t, r) || (t = r, i && (n = null), s());
449
+ },
450
+ measure() {
451
+ n = null, s();
449
452
  },
450
453
  setScrollOffset(e) {
451
454
  (t.scrollOffset ?? 0) !== e && (t = {
@@ -516,6 +519,7 @@ function O(r) {
516
519
  return t(a);
517
520
  },
518
521
  setOptions: i.setOptions,
522
+ measure: i.measure,
519
523
  setScrollOffset: i.setScrollOffset,
520
524
  setViewportHeight: i.setViewportHeight,
521
525
  scrollToIndex: i.scrollToIndex,
@@ -8,69 +8,69 @@ function t(t) {
8
8
  }
9
9
  //#endregion
10
10
  //#region ../grid/dist/validate.js
11
- var n = 10, r = "https://svgrid.com/docs/getting-started/3-data-and-columns/";
12
- function i(e, t = []) {
13
- for (let n of e) n.columns?.length ? i(n.columns, t) : t.push(n);
11
+ var n = 10, r = 1e3, i = "https://svgrid.com/docs/getting-started/3-data-and-columns/";
12
+ function a(e, t = []) {
13
+ for (let n of e) n.columns?.length ? a(n.columns, t) : t.push(n);
14
14
  return t;
15
15
  }
16
- function a(e) {
17
- let a = [], s = i(e.columns ?? []), c = [];
18
- for (let r of e.data ?? []) {
19
- if (c.length >= n) break;
20
- t(r) || c.push(r);
16
+ function o(e) {
17
+ let o = [], c = a(e.columns ?? []), l = [], u = e.data ?? [], d = Math.min(u.length, r);
18
+ for (let e = 0; e < d && l.length < n; e += 1) {
19
+ let n = u[e];
20
+ t(n) || l.push(n);
21
21
  }
22
- if (c.length && !e.serverGroup) {
22
+ if (l.length && !e.serverGroup) {
23
23
  let e = /* @__PURE__ */ new Set();
24
- for (let t of c) if (t && typeof t == "object") for (let n of Object.keys(t)) e.add(n);
25
- for (let t of s) {
24
+ for (let t of l) if (t && typeof t == "object") for (let n of Object.keys(t)) e.add(n);
25
+ for (let t of c) {
26
26
  let n = t.field;
27
27
  if (!n || t.fieldFn || e.has(n)) continue;
28
- let i = o(n, [...e]);
29
- a.push(`[svgrid] Column field "${n}" does not exist on your row data, so that column renders empty.${i ? ` Did you mean "${i}"?` : ""} Available keys: ${[...e].slice(0, 12).join(", ")}. See ${r}`);
28
+ let r = s(n, [...e]);
29
+ o.push(`[svgrid] Column field "${n}" does not exist on your row data, so that column renders empty.${r ? ` Did you mean "${r}"?` : ""} Available keys: ${[...e].slice(0, 12).join(", ")}. See ${i}`);
30
30
  }
31
31
  }
32
- let l = /* @__PURE__ */ new Map();
33
- for (let e of s) {
32
+ let f = /* @__PURE__ */ new Map();
33
+ for (let e of c) {
34
34
  let t = e.id ?? e.field;
35
- t && l.set(t, (l.get(t) ?? 0) + 1);
35
+ t && f.set(t, (f.get(t) ?? 0) + 1);
36
36
  }
37
- for (let [e, t] of l) t > 1 && a.push(`[svgrid] ${t} columns share the id "${e}". Column state (sorting, filtering, pinning, width) is keyed by id, so they will act as one. Give each an explicit \`id\`. See ${r}`);
38
- let u = e.pageable === void 0 && e.showPagination === void 0;
39
- e.pageSize !== void 0 && u && a.push("[svgrid] `pageSize` is set but pagination was never turned on, so it has no effect and every row renders. Add `pageable` to switch the pager on."), !(e.sortable === !0 || e.features?.rowSortingFeature) && s.some((e) => e.sortable === !0) && a.push("[svgrid] A column sets `sortable: true`, but sorting is not enabled on the grid, so its header does nothing. Add `sortable` to <SvGrid> (it registers the sorting feature for you).");
40
- let d = /* @__PURE__ */ new Set();
41
- for (let e of s) {
37
+ for (let [e, t] of f) t > 1 && o.push(`[svgrid] ${t} columns share the id "${e}". Column state (sorting, filtering, pinning, width) is keyed by id, so they will act as one. Give each an explicit \`id\`. See ${i}`);
38
+ let p = e.pageable === void 0 && e.showPagination === void 0;
39
+ e.pageSize !== void 0 && p && o.push("[svgrid] `pageSize` is set but pagination was never turned on, so it has no effect and every row renders. Add `pageable` to switch the pager on."), !(e.sortable === !0 || e.features?.rowSortingFeature) && c.some((e) => e.sortable === !0) && o.push("[svgrid] A column sets `sortable: true`, but sorting is not enabled on the grid, so its header does nothing. Add `sortable` to <SvGrid> (it registers the sorting feature for you).");
40
+ let m = /* @__PURE__ */ new Set();
41
+ for (let e of c) {
42
42
  let t = e.id ?? e.field;
43
- t && d.add(t);
43
+ t && m.add(t);
44
44
  }
45
45
  for (let t of e.groupBy ?? []) {
46
- if (d.has(t)) continue;
47
- let e = o(t, [...d]);
48
- a.push(`[svgrid] \`groupBy\` refers to column "${t}", which does not exist, so that grouping level is ignored.${e ? ` Did you mean "${e}"?` : ""} Column ids: ${[...d].slice(0, 12).join(", ")}`);
46
+ if (m.has(t)) continue;
47
+ let e = s(t, [...m]);
48
+ o.push(`[svgrid] \`groupBy\` refers to column "${t}", which does not exist, so that grouping level is ignored.${e ? ` Did you mean "${e}"?` : ""} Column ids: ${[...m].slice(0, 12).join(", ")}`);
49
49
  }
50
- let f = e.treeData?.column;
51
- if (f && !d.has(f) && a.push(`[svgrid] \`treeData.column\` refers to column "${f}", which does not exist, so the expander falls back to the first visible column.`), c.length && e.treeData) {
50
+ let h = e.treeData?.column;
51
+ if (h && !m.has(h) && o.push(`[svgrid] \`treeData.column\` refers to column "${h}", which does not exist, so the expander falls back to the first visible column.`), l.length && e.treeData) {
52
52
  let t = /* @__PURE__ */ new Set();
53
- for (let e of c) if (e && typeof e == "object") for (let n of Object.keys(e)) t.add(n);
53
+ for (let e of l) if (e && typeof e == "object") for (let n of Object.keys(e)) t.add(n);
54
54
  let n = e.treeData.parentField;
55
55
  if (n && !t.has(n)) {
56
- let e = o(n, [...t]);
57
- a.push(`[svgrid] \`treeData.parentField\` is "${n}", which is not on your row data, so every row becomes a root and no hierarchy appears.${e ? ` Did you mean "${e}"?` : ""}`);
56
+ let e = s(n, [...t]);
57
+ o.push(`[svgrid] \`treeData.parentField\` is "${n}", which is not on your row data, so every row becomes a root and no hierarchy appears.${e ? ` Did you mean "${e}"?` : ""}`);
58
58
  }
59
59
  let r = e.treeData.idField;
60
- r && !t.has(r) && a.push(`[svgrid] \`treeData.idField\` is "${r}", which is not on your row data, so parent lookups cannot match and the tree stays flat.`);
60
+ r && !t.has(r) && o.push(`[svgrid] \`treeData.idField\` is "${r}", which is not on your row data, so parent lookups cannot match and the tree stays flat.`);
61
61
  }
62
- return e.gantt && e.treeData && a.push("[svgrid] `gantt` and `treeData` are both set. The Gantt builds its own work-breakdown tree from `gantt.parentField` and needs every descendant row, but `treeData` hides collapsed children from the view, so summary bars will under-report. Remove `treeData` and set `gantt.parentField` instead."), (e.initialColumnPinning?.left?.length ?? 0) + (e.initialColumnPinning?.right?.length ?? 0) > 0 && e.columnVirtualization !== !1 && a.push("[svgrid] `initialColumnPinning` is set while column virtualization is on (its default), so the pinned columns will not stick - the virtualizer recycles column nodes. Add `columnVirtualization={false}`."), e.externalPagination === !0 && e.rowCount === void 0 && a.push("[svgrid] `externalPagination` is on but `rowCount` is not set, so the pager cannot know how many pages exist. Pass the server total as `rowCount`."), e.externalSort === !0 && !e.onSortingChange && a.push("[svgrid] `externalSort` is on but there is no `onSortingChange` handler, so clicking a header changes nothing - the grid stopped sorting and nobody is listening. Add `onSortingChange` and re-fetch in your handler."), e.externalFilter === !0 && !e.onFiltersChange && a.push("[svgrid] `externalFilter` is on but there is no `onFiltersChange` handler, so filtering the grid changes nothing. Add `onFiltersChange` and re-fetch in your handler."), a;
62
+ return e.gantt && e.treeData && o.push("[svgrid] `gantt` and `treeData` are both set. The Gantt builds its own work-breakdown tree from `gantt.parentField` and needs every descendant row, but `treeData` hides collapsed children from the view, so summary bars will under-report. Remove `treeData` and set `gantt.parentField` instead."), (e.initialColumnPinning?.left?.length ?? 0) + (e.initialColumnPinning?.right?.length ?? 0) > 0 && e.columnVirtualization !== !1 && o.push("[svgrid] `initialColumnPinning` is set while column virtualization is on (its default), so the pinned columns will not stick - the virtualizer recycles column nodes. Add `columnVirtualization={false}`."), e.externalPagination === !0 && e.rowCount === void 0 && o.push("[svgrid] `externalPagination` is on but `rowCount` is not set, so the pager cannot know how many pages exist. Pass the server total as `rowCount`."), e.externalSort === !0 && !e.onSortingChange && o.push("[svgrid] `externalSort` is on but there is no `onSortingChange` handler, so clicking a header changes nothing - the grid stopped sorting and nobody is listening. Add `onSortingChange` and re-fetch in your handler."), e.externalFilter === !0 && !e.onFiltersChange && o.push("[svgrid] `externalFilter` is on but there is no `onFiltersChange` handler, so filtering the grid changes nothing. Add `onFiltersChange` and re-fetch in your handler."), o;
63
63
  }
64
- function o(e, t) {
64
+ function s(e, t) {
65
65
  let n, r = Infinity;
66
66
  for (let i of t) {
67
- let t = s(e.toLowerCase(), i.toLowerCase());
67
+ let t = c(e.toLowerCase(), i.toLowerCase());
68
68
  t < r && (r = t, n = i);
69
69
  }
70
70
  let i = Math.min(3, Math.floor(e.length / 3) + 1);
71
71
  return r <= i ? n : void 0;
72
72
  }
73
- function s(e, t) {
73
+ function c(e, t) {
74
74
  if (e === t) return 0;
75
75
  let n = Array(t.length + 1);
76
76
  for (let e = 0; e <= t.length; e++) n[e] = e;
@@ -85,4 +85,4 @@ function s(e, t) {
85
85
  return n[t.length];
86
86
  }
87
87
  //#endregion
88
- export { a as validateGridConfig };
88
+ export { o as validateGridConfig };
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "type": "commercial",
5
5
  "url": "https://svgrid.com/pricing"
6
6
  },
7
- "version": "3.0.4",
7
+ "version": "3.0.6",
8
8
  "description": "SvGrid as a framework-agnostic web component (<sv-grid> custom element, plus <sv-grid-shadow> for an open shadow root and <sv-chart> for the standalone chart). Drop into React, Vue, Angular, or plain HTML - no build step required.",
9
9
  "type": "module",
10
10
  "license": "MIT",
@@ -112,8 +112,8 @@
112
112
  "vite": "^8.2.1",
113
113
  "vue": "^3.5.42",
114
114
  "vue-tsc": "^3.3.11",
115
- "@svgrid/enterprise": "^3.1.0",
116
- "@svgrid/grid": "^3.0.6"
115
+ "@svgrid/enterprise": "^3.1.2",
116
+ "@svgrid/grid": "^3.0.8"
117
117
  },
118
118
  "types": "./dist/sv-grid-element.d.ts",
119
119
  "peerDependencies": {