@svgrid/grid-wc 3.0.1 → 3.0.3
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 +24 -1
- package/dist/GridMenus-DMkf7UMn.js +1086 -0
- package/dist/SvChartMenu-DkSyLWYH.js +413 -0
- package/dist/SvDateRangeInput-BrYTQEMM.js +197 -0
- package/dist/SvDateTimePicker-Czin1Ead.js +766 -0
- package/dist/SvField-Bmzp3ObZ.js +147 -0
- package/dist/SvGridCellEditor-DhXEIlyE.js +560 -0
- package/dist/SvGridChart-BMdCbrqb.js +3702 -0
- package/dist/SvGridChartBuilder-Chp_MD1B.js +1166 -0
- package/dist/SvGridChartPanel-BIV2O2Lp.js +1743 -0
- package/dist/SvGridChartView-DyhkumD-.js +45 -0
- package/dist/SvGridDropdown-BwPpGwLz.js +257 -0
- package/dist/angular/fesm2022/svgrid-grid-wc-angular.mjs +212 -7
- package/dist/angular/fesm2022/svgrid-grid-wc-angular.mjs.map +1 -1
- package/dist/angular/types/svgrid-grid-wc-angular.d.ts +92 -2
- package/dist/{cell-formatting-Eypm-id0.js → cell-formatting-CBfgahv1.js} +1 -1
- package/dist/chart/SvChartMenu-DslxOgPN.js +590 -0
- package/dist/chart/chart-export-BHGuh_kZ.js +127 -0
- package/dist/chart/chart-export-pdf-BjkkIEkE.js +104 -0
- package/dist/chart/chart-summary-6Xu2JoNC.js +137 -0
- package/dist/chart/chart-trend-7fxtAqEl.js +56 -0
- package/dist/chart/chart-validate-CD6ptiwg.js +180 -0
- package/dist/chart/client-BuB0wIgc.js +2757 -0
- package/dist/chart/sv-chart-element.d.ts +98 -0
- package/dist/chart/sv-chart-element.js +7282 -0
- package/dist/chart-D_LKA1fr.js +4398 -0
- package/dist/chart-export-pdf-9OCvhzr0.js +104 -0
- package/dist/chart-summary-v3Lhe8YD.js +137 -0
- package/dist/chart-validate-CD6ptiwg.js +180 -0
- package/dist/{shadow/client-DjwUji8D.js → client-DEF0GRjE.js} +1 -1
- package/dist/{shadow/column-resize-DvCRUrN3.js → column-resize-DUPgynvc.js} +3 -3
- package/dist/date-format-DMTwV8NC.js +1128 -0
- package/dist/{shadow/dismissable-DvhBKm3q.js → dismissable-CQ6XFXsk.js} +5 -1
- package/dist/{export-format-uGayRKWM.js → export-format-CAi1mp-1.js} +1 -1
- package/dist/focus-trap-Dbb2tJxb.js +65 -0
- package/dist/list-option-DrRyivWp.js +82 -0
- package/dist/react/chart.d.ts +99 -0
- package/dist/react/chart.js +49 -0
- package/dist/react/index.d.ts +72 -0
- package/dist/react/index.js +8 -1
- package/dist/row-resize-limG_N1z.js +111 -0
- package/dist/shadow/GridMenus-DMkf7UMn.js +1086 -0
- package/dist/shadow/SvChartMenu-DkSyLWYH.js +413 -0
- package/dist/shadow/SvDateRangeInput-BrYTQEMM.js +197 -0
- package/dist/shadow/SvDateTimePicker-Czin1Ead.js +766 -0
- package/dist/shadow/SvField-Bmzp3ObZ.js +147 -0
- package/dist/shadow/SvGridCellEditor-DhXEIlyE.js +560 -0
- package/dist/shadow/SvGridChart-BMdCbrqb.js +3702 -0
- package/dist/shadow/SvGridChartBuilder-Chp_MD1B.js +1166 -0
- package/dist/shadow/SvGridChartPanel-BIV2O2Lp.js +1743 -0
- package/dist/shadow/SvGridChartView-DyhkumD-.js +45 -0
- package/dist/shadow/SvGridDropdown-BwPpGwLz.js +257 -0
- package/dist/shadow/{cell-formatting-Eypm-id0.js → cell-formatting-CBfgahv1.js} +1 -1
- package/dist/shadow/chart-D_LKA1fr.js +4398 -0
- package/dist/shadow/chart-export-pdf-9OCvhzr0.js +104 -0
- package/dist/shadow/chart-summary-v3Lhe8YD.js +137 -0
- package/dist/shadow/chart-validate-CD6ptiwg.js +180 -0
- package/dist/{client-DjwUji8D.js → shadow/client-DEF0GRjE.js} +1 -1
- package/dist/{column-resize-DvCRUrN3.js → shadow/column-resize-DUPgynvc.js} +3 -3
- package/dist/shadow/date-format-DMTwV8NC.js +1128 -0
- package/dist/{dismissable-DvhBKm3q.js → shadow/dismissable-CQ6XFXsk.js} +5 -1
- package/dist/shadow/{export-format-DhdZREP1.js → export-format-mnW_rVBZ.js} +1 -1
- package/dist/shadow/focus-trap-Dbb2tJxb.js +65 -0
- package/dist/shadow/list-option-DrRyivWp.js +82 -0
- package/dist/shadow/row-resize-limG_N1z.js +111 -0
- package/dist/shadow/sv-grid-shadow-element.d.ts +41 -0
- package/dist/shadow/sv-grid-shadow-element.js +5905 -3986
- package/dist/shadow/{svelte-virtualizer.svelte-DZ9UcyfT.js → svelte-virtualizer.svelte-CnGhFGDc.js} +37 -34
- package/dist/shadow/validate-BqDthkNr.js +88 -0
- package/dist/sv-grid-element.d.ts +41 -0
- package/dist/sv-grid-element.js +5874 -3985
- package/dist/{svelte-virtualizer.svelte-DZ9UcyfT.js → svelte-virtualizer.svelte-CnGhFGDc.js} +37 -34
- package/dist/validate-BqDthkNr.js +88 -0
- package/dist/vue/chart.d.ts +64 -0
- package/dist/vue/chart.js +41 -0
- package/dist/vue/index.d.ts +26 -2
- package/dist/vue/index.js +1 -22
- package/package.json +18 -5
- package/dist/GridMenus-YwTw9Upd.js +0 -1123
- package/dist/SvDateRangeInput-CrxeppBV.js +0 -196
- package/dist/SvDateTimePicker-xAO-Pb4S.js +0 -765
- package/dist/SvField-CE345DyF.js +0 -146
- package/dist/SvGridCellEditor-D7SyHtff.js +0 -550
- package/dist/SvGridChart-CMaVmlso.js +0 -1477
- package/dist/SvGridChartPanel-Pc_IW0eA.js +0 -833
- package/dist/SvGridChartView-DLhhzmFy.js +0 -52
- package/dist/SvGridDropdown-DUncHqM-.js +0 -256
- package/dist/chart-GRBAgN1M.js +0 -1658
- package/dist/date-format-D_oQ5Yw0.js +0 -1127
- package/dist/row-resize-D-8s3cqT.js +0 -94
- package/dist/shadow/GridMenus-YwTw9Upd.js +0 -1123
- package/dist/shadow/SvDateRangeInput-CrxeppBV.js +0 -196
- package/dist/shadow/SvDateTimePicker-xAO-Pb4S.js +0 -765
- package/dist/shadow/SvField-CE345DyF.js +0 -146
- package/dist/shadow/SvGridCellEditor-D7SyHtff.js +0 -550
- package/dist/shadow/SvGridChart-CMaVmlso.js +0 -1477
- package/dist/shadow/SvGridChartPanel-Pc_IW0eA.js +0 -833
- package/dist/shadow/SvGridChartView-DLhhzmFy.js +0 -52
- package/dist/shadow/SvGridDropdown-DUncHqM-.js +0 -256
- package/dist/shadow/chart-GRBAgN1M.js +0 -1658
- package/dist/shadow/date-format-D_oQ5Yw0.js +0 -1127
- package/dist/shadow/row-resize-D-8s3cqT.js +0 -94
- package/dist/shadow/validate-CgmAtX1A.js +0 -75
- package/dist/validate-CgmAtX1A.js +0 -75
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
//#region ../grid/dist/row-resize.js
|
|
2
|
-
var e = "sv-grid-row-resize-handle";
|
|
3
|
-
function t(t, n) {
|
|
4
|
-
let r = n, i = null;
|
|
5
|
-
function a(e) {
|
|
6
|
-
let t = e.querySelector("[data-svgrid-row]")?.dataset.svgridRow;
|
|
7
|
-
return t == null ? NaN : Number(t);
|
|
8
|
-
}
|
|
9
|
-
function o(e) {
|
|
10
|
-
if (!i) return;
|
|
11
|
-
let t = r.min ?? 20, n = r.max ?? 320, a = Math.max(t, Math.min(n, i.startHeight + (e.clientY - i.startY)));
|
|
12
|
-
i.trEl.style.height = `${Math.round(a)}px`, r.onResizeMove?.(i.rowIndex, Math.round(a));
|
|
13
|
-
}
|
|
14
|
-
function s(e) {
|
|
15
|
-
if (!i) return;
|
|
16
|
-
let t = r.min ?? 20, n = r.max ?? 320, a = Math.max(t, Math.min(n, i.startHeight + (e.clientY - i.startY)));
|
|
17
|
-
r.onResize(i.rowIndex, Math.round(a)), i.strip.classList.remove("is-resizing");
|
|
18
|
-
try {
|
|
19
|
-
i.trEl.releasePointerCapture(e.pointerId);
|
|
20
|
-
} catch {}
|
|
21
|
-
i = null, window.removeEventListener("pointermove", o), window.removeEventListener("pointerup", s), document.body.style.cursor = "";
|
|
22
|
-
}
|
|
23
|
-
function c(t) {
|
|
24
|
-
if (r.disabled) return;
|
|
25
|
-
let n = t.target;
|
|
26
|
-
if (!n?.classList.contains(e)) return;
|
|
27
|
-
let i = t.shiftKey ? 1 : 10, o = 0;
|
|
28
|
-
if (t.key === "ArrowUp") o = -i;
|
|
29
|
-
else if (t.key === "ArrowDown") o = i;
|
|
30
|
-
else return;
|
|
31
|
-
let s = n.closest("tr.sv-grid-row");
|
|
32
|
-
if (!s) return;
|
|
33
|
-
let c = a(s);
|
|
34
|
-
if (!Number.isFinite(c)) return;
|
|
35
|
-
t.preventDefault(), t.stopPropagation();
|
|
36
|
-
let l = r.min ?? 20, u = r.max ?? 320, d = Math.round(Math.max(l, Math.min(u, s.getBoundingClientRect().height + o)));
|
|
37
|
-
s.style.height = `${d}px`, r.onResizeMove?.(c, d), r.onResize(c, d);
|
|
38
|
-
}
|
|
39
|
-
function l(t) {
|
|
40
|
-
if (r.disabled) return;
|
|
41
|
-
let n = t.target;
|
|
42
|
-
if (!n?.classList.contains(e)) return;
|
|
43
|
-
let c = n.closest("tr.sv-grid-row");
|
|
44
|
-
if (!c) return;
|
|
45
|
-
let l = a(c);
|
|
46
|
-
if (Number.isFinite(l)) {
|
|
47
|
-
t.preventDefault(), t.stopPropagation(), n.classList.add("is-resizing"), i = {
|
|
48
|
-
rowIndex: l,
|
|
49
|
-
startY: t.clientY,
|
|
50
|
-
startHeight: c.getBoundingClientRect().height,
|
|
51
|
-
trEl: c,
|
|
52
|
-
strip: n
|
|
53
|
-
};
|
|
54
|
-
try {
|
|
55
|
-
c.setPointerCapture(t.pointerId);
|
|
56
|
-
} catch {}
|
|
57
|
-
document.body.style.cursor = "row-resize", window.addEventListener("pointermove", o), window.addEventListener("pointerup", s);
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
function u() {
|
|
61
|
-
if (r.disabled) {
|
|
62
|
-
d();
|
|
63
|
-
return;
|
|
64
|
-
}
|
|
65
|
-
let n = t.querySelectorAll("tr.sv-grid-row");
|
|
66
|
-
for (let t of n) {
|
|
67
|
-
if (t.classList.contains("sv-grid-header-row") || t.classList.contains("sv-grid-row-spacer")) continue;
|
|
68
|
-
let n = t.querySelector(".sv-grid-cell.sv-row-gutter, .sv-grid-cell.sv-grid-row-number-cell") ?? (r.anchor === "row" ? t.querySelector(".sv-grid-cell") : null);
|
|
69
|
-
if (!n || n.querySelector(`:scope > .${e}`)) continue;
|
|
70
|
-
getComputedStyle(n).position === "static" && (n.style.position = "relative"), n.style.overflow = "visible";
|
|
71
|
-
let i = document.createElement("div");
|
|
72
|
-
i.className = e, i.setAttribute("role", "separator"), i.setAttribute("aria-orientation", "horizontal"), i.setAttribute("aria-label", "Resize row"), i.tabIndex = 0, i.style.cssText = "position:absolute;left:0;right:0;bottom:0;height:5px;cursor:row-resize;user-select:none;z-index:60;pointer-events:auto;", n.appendChild(i);
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
function d() {
|
|
76
|
-
t.querySelectorAll(`.${e}`).forEach((e) => e.remove());
|
|
77
|
-
}
|
|
78
|
-
t.addEventListener("pointerdown", l, { capture: !0 }), t.addEventListener("keydown", c, { capture: !0 });
|
|
79
|
-
let f = new MutationObserver(() => u());
|
|
80
|
-
return f.observe(t, {
|
|
81
|
-
childList: !0,
|
|
82
|
-
subtree: !0
|
|
83
|
-
}), u(), {
|
|
84
|
-
update(e) {
|
|
85
|
-
let t = r.disabled;
|
|
86
|
-
r = e, t !== r.disabled && u();
|
|
87
|
-
},
|
|
88
|
-
destroy() {
|
|
89
|
-
t.removeEventListener("pointerdown", l, { capture: !0 }), t.removeEventListener("keydown", c, { capture: !0 }), window.removeEventListener("pointermove", o), window.removeEventListener("pointerup", s), f.disconnect(), d();
|
|
90
|
-
}
|
|
91
|
-
};
|
|
92
|
-
}
|
|
93
|
-
//#endregion
|
|
94
|
-
export { t as rowResize };
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
//#region ../grid/dist/validate.js
|
|
2
|
-
var e = "https://svgrid.com/docs/getting-started/3-data-and-columns/";
|
|
3
|
-
function t(e, n = []) {
|
|
4
|
-
for (let r of e) r.columns?.length ? t(r.columns, n) : n.push(r);
|
|
5
|
-
return n;
|
|
6
|
-
}
|
|
7
|
-
function n(n) {
|
|
8
|
-
let i = [], a = t(n.columns ?? []), o = (n.data ?? []).slice(0, 10);
|
|
9
|
-
if (o.length) {
|
|
10
|
-
let t = /* @__PURE__ */ new Set();
|
|
11
|
-
for (let e of o) if (e && typeof e == "object") for (let n of Object.keys(e)) t.add(n);
|
|
12
|
-
for (let n of a) {
|
|
13
|
-
let a = n.field;
|
|
14
|
-
if (!a || n.fieldFn || t.has(a)) continue;
|
|
15
|
-
let o = r(a, [...t]);
|
|
16
|
-
i.push(`[svgrid] Column field "${a}" does not exist on your row data, so that column renders empty.${o ? ` Did you mean "${o}"?` : ""} Available keys: ${[...t].slice(0, 12).join(", ")}. See ${e}`);
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
let s = /* @__PURE__ */ new Map();
|
|
20
|
-
for (let e of a) {
|
|
21
|
-
let t = e.id ?? e.field;
|
|
22
|
-
t && s.set(t, (s.get(t) ?? 0) + 1);
|
|
23
|
-
}
|
|
24
|
-
for (let [t, n] of s) n > 1 && i.push(`[svgrid] ${n} columns share the id "${t}". Column state (sorting, filtering, pinning, width) is keyed by id, so they will act as one. Give each an explicit \`id\`. See ${e}`);
|
|
25
|
-
let c = n.pageable === void 0 && n.showPagination === void 0;
|
|
26
|
-
n.pageSize !== void 0 && c && i.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."), !(n.sortable === !0 || n.features?.rowSortingFeature) && a.some((e) => e.sortable === !0) && i.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).");
|
|
27
|
-
let l = /* @__PURE__ */ new Set();
|
|
28
|
-
for (let e of a) {
|
|
29
|
-
let t = e.id ?? e.field;
|
|
30
|
-
t && l.add(t);
|
|
31
|
-
}
|
|
32
|
-
for (let e of n.groupBy ?? []) {
|
|
33
|
-
if (l.has(e)) continue;
|
|
34
|
-
let t = r(e, [...l]);
|
|
35
|
-
i.push(`[svgrid] \`groupBy\` refers to column "${e}", which does not exist, so that grouping level is ignored.${t ? ` Did you mean "${t}"?` : ""} Column ids: ${[...l].slice(0, 12).join(", ")}`);
|
|
36
|
-
}
|
|
37
|
-
let u = n.treeData?.column;
|
|
38
|
-
if (u && !l.has(u) && i.push(`[svgrid] \`treeData.column\` refers to column "${u}", which does not exist, so the expander falls back to the first visible column.`), o.length && n.treeData) {
|
|
39
|
-
let e = /* @__PURE__ */ new Set();
|
|
40
|
-
for (let t of o) if (t && typeof t == "object") for (let n of Object.keys(t)) e.add(n);
|
|
41
|
-
let t = n.treeData.parentField;
|
|
42
|
-
if (t && !e.has(t)) {
|
|
43
|
-
let n = r(t, [...e]);
|
|
44
|
-
i.push(`[svgrid] \`treeData.parentField\` is "${t}", which is not on your row data, so every row becomes a root and no hierarchy appears.${n ? ` Did you mean "${n}"?` : ""}`);
|
|
45
|
-
}
|
|
46
|
-
let a = n.treeData.idField;
|
|
47
|
-
a && !e.has(a) && i.push(`[svgrid] \`treeData.idField\` is "${a}", which is not on your row data, so parent lookups cannot match and the tree stays flat.`);
|
|
48
|
-
}
|
|
49
|
-
return (n.initialColumnPinning?.left?.length ?? 0) + (n.initialColumnPinning?.right?.length ?? 0) > 0 && n.columnVirtualization !== !1 && i.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}`."), n.externalPagination === !0 && n.rowCount === void 0 && i.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`."), n.externalSort === !0 && !n.onSortingChange && i.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."), n.externalFilter === !0 && !n.onFiltersChange && i.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."), i;
|
|
50
|
-
}
|
|
51
|
-
function r(e, t) {
|
|
52
|
-
let n, r = Infinity;
|
|
53
|
-
for (let a of t) {
|
|
54
|
-
let t = i(e.toLowerCase(), a.toLowerCase());
|
|
55
|
-
t < r && (r = t, n = a);
|
|
56
|
-
}
|
|
57
|
-
let a = Math.min(3, Math.floor(e.length / 3) + 1);
|
|
58
|
-
return r <= a ? n : void 0;
|
|
59
|
-
}
|
|
60
|
-
function i(e, t) {
|
|
61
|
-
if (e === t) return 0;
|
|
62
|
-
let n = Array(t.length + 1);
|
|
63
|
-
for (let e = 0; e <= t.length; e++) n[e] = e;
|
|
64
|
-
for (let r = 1; r <= e.length; r++) {
|
|
65
|
-
let i = n[0];
|
|
66
|
-
n[0] = r;
|
|
67
|
-
for (let a = 1; a <= t.length; a++) {
|
|
68
|
-
let o = Math.min(n[a] + 1, n[a - 1] + 1, i + (e[r - 1] === t[a - 1] ? 0 : 1));
|
|
69
|
-
i = n[a], n[a] = o;
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
return n[t.length];
|
|
73
|
-
}
|
|
74
|
-
//#endregion
|
|
75
|
-
export { n as validateGridConfig };
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
//#region ../grid/dist/validate.js
|
|
2
|
-
var e = "https://svgrid.com/docs/getting-started/3-data-and-columns/";
|
|
3
|
-
function t(e, n = []) {
|
|
4
|
-
for (let r of e) r.columns?.length ? t(r.columns, n) : n.push(r);
|
|
5
|
-
return n;
|
|
6
|
-
}
|
|
7
|
-
function n(n) {
|
|
8
|
-
let i = [], a = t(n.columns ?? []), o = (n.data ?? []).slice(0, 10);
|
|
9
|
-
if (o.length) {
|
|
10
|
-
let t = /* @__PURE__ */ new Set();
|
|
11
|
-
for (let e of o) if (e && typeof e == "object") for (let n of Object.keys(e)) t.add(n);
|
|
12
|
-
for (let n of a) {
|
|
13
|
-
let a = n.field;
|
|
14
|
-
if (!a || n.fieldFn || t.has(a)) continue;
|
|
15
|
-
let o = r(a, [...t]);
|
|
16
|
-
i.push(`[svgrid] Column field "${a}" does not exist on your row data, so that column renders empty.${o ? ` Did you mean "${o}"?` : ""} Available keys: ${[...t].slice(0, 12).join(", ")}. See ${e}`);
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
let s = /* @__PURE__ */ new Map();
|
|
20
|
-
for (let e of a) {
|
|
21
|
-
let t = e.id ?? e.field;
|
|
22
|
-
t && s.set(t, (s.get(t) ?? 0) + 1);
|
|
23
|
-
}
|
|
24
|
-
for (let [t, n] of s) n > 1 && i.push(`[svgrid] ${n} columns share the id "${t}". Column state (sorting, filtering, pinning, width) is keyed by id, so they will act as one. Give each an explicit \`id\`. See ${e}`);
|
|
25
|
-
let c = n.pageable === void 0 && n.showPagination === void 0;
|
|
26
|
-
n.pageSize !== void 0 && c && i.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."), !(n.sortable === !0 || n.features?.rowSortingFeature) && a.some((e) => e.sortable === !0) && i.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).");
|
|
27
|
-
let l = /* @__PURE__ */ new Set();
|
|
28
|
-
for (let e of a) {
|
|
29
|
-
let t = e.id ?? e.field;
|
|
30
|
-
t && l.add(t);
|
|
31
|
-
}
|
|
32
|
-
for (let e of n.groupBy ?? []) {
|
|
33
|
-
if (l.has(e)) continue;
|
|
34
|
-
let t = r(e, [...l]);
|
|
35
|
-
i.push(`[svgrid] \`groupBy\` refers to column "${e}", which does not exist, so that grouping level is ignored.${t ? ` Did you mean "${t}"?` : ""} Column ids: ${[...l].slice(0, 12).join(", ")}`);
|
|
36
|
-
}
|
|
37
|
-
let u = n.treeData?.column;
|
|
38
|
-
if (u && !l.has(u) && i.push(`[svgrid] \`treeData.column\` refers to column "${u}", which does not exist, so the expander falls back to the first visible column.`), o.length && n.treeData) {
|
|
39
|
-
let e = /* @__PURE__ */ new Set();
|
|
40
|
-
for (let t of o) if (t && typeof t == "object") for (let n of Object.keys(t)) e.add(n);
|
|
41
|
-
let t = n.treeData.parentField;
|
|
42
|
-
if (t && !e.has(t)) {
|
|
43
|
-
let n = r(t, [...e]);
|
|
44
|
-
i.push(`[svgrid] \`treeData.parentField\` is "${t}", which is not on your row data, so every row becomes a root and no hierarchy appears.${n ? ` Did you mean "${n}"?` : ""}`);
|
|
45
|
-
}
|
|
46
|
-
let a = n.treeData.idField;
|
|
47
|
-
a && !e.has(a) && i.push(`[svgrid] \`treeData.idField\` is "${a}", which is not on your row data, so parent lookups cannot match and the tree stays flat.`);
|
|
48
|
-
}
|
|
49
|
-
return (n.initialColumnPinning?.left?.length ?? 0) + (n.initialColumnPinning?.right?.length ?? 0) > 0 && n.columnVirtualization !== !1 && i.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}`."), n.externalPagination === !0 && n.rowCount === void 0 && i.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`."), n.externalSort === !0 && !n.onSortingChange && i.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."), n.externalFilter === !0 && !n.onFiltersChange && i.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."), i;
|
|
50
|
-
}
|
|
51
|
-
function r(e, t) {
|
|
52
|
-
let n, r = Infinity;
|
|
53
|
-
for (let a of t) {
|
|
54
|
-
let t = i(e.toLowerCase(), a.toLowerCase());
|
|
55
|
-
t < r && (r = t, n = a);
|
|
56
|
-
}
|
|
57
|
-
let a = Math.min(3, Math.floor(e.length / 3) + 1);
|
|
58
|
-
return r <= a ? n : void 0;
|
|
59
|
-
}
|
|
60
|
-
function i(e, t) {
|
|
61
|
-
if (e === t) return 0;
|
|
62
|
-
let n = Array(t.length + 1);
|
|
63
|
-
for (let e = 0; e <= t.length; e++) n[e] = e;
|
|
64
|
-
for (let r = 1; r <= e.length; r++) {
|
|
65
|
-
let i = n[0];
|
|
66
|
-
n[0] = r;
|
|
67
|
-
for (let a = 1; a <= t.length; a++) {
|
|
68
|
-
let o = Math.min(n[a] + 1, n[a - 1] + 1, i + (e[r - 1] === t[a - 1] ? 0 : 1));
|
|
69
|
-
i = n[a], n[a] = o;
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
return n[t.length];
|
|
73
|
-
}
|
|
74
|
-
//#endregion
|
|
75
|
-
export { n as validateGridConfig };
|