@svgrid/grid-wc 3.0.13 → 3.0.15
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/dist/GridFooter-DaqpUo5H.js +145 -0
- package/dist/GridMenus-BXla2VNU.js +1367 -0
- package/dist/PinSplitter-Qd1_-3pw.js +130 -0
- package/dist/{shadow/SvGrid.helpers-zBkDTryR.js → SvGrid.helpers-B2GEKrxS.js} +84 -36
- package/dist/{shadow/SvGridCellEditor-C2t-q8n3.js → SvGridCellEditor-DdqVsNeJ.js} +20 -9
- package/dist/angular/fesm2022/svgrid-grid-wc-angular.mjs +37 -3
- package/dist/angular/fesm2022/svgrid-grid-wc-angular.mjs.map +1 -1
- package/dist/angular/types/svgrid-grid-wc-angular.d.ts +15 -1
- package/dist/conditional-formatting-LFQdw2jz.js +180 -0
- package/dist/{shadow/export-format-DQtIyOvV.js → export-format-DIcJWdKl.js} +1 -1
- package/dist/grid-extension.svelte-6IzZ_3Cv.js +20 -0
- package/dist/react/index.d.ts +34 -0
- package/dist/react/index.js +7 -1
- package/dist/shadow/GridFooter-BBBUK5Ry.js +145 -0
- package/dist/shadow/GridMenus-DGiPj4-r.js +1367 -0
- package/dist/shadow/PinSplitter-Qd1_-3pw.js +130 -0
- package/dist/{SvGrid.helpers-zBkDTryR.js → shadow/SvGrid.helpers-B2GEKrxS.js} +84 -36
- package/dist/{SvGridCellEditor-C2t-q8n3.js → shadow/SvGridCellEditor-DdqVsNeJ.js} +20 -9
- package/dist/shadow/conditional-formatting-LFQdw2jz.js +180 -0
- package/dist/{export-format-CXEUNl8j.js → shadow/export-format-DIcJWdKl.js} +1 -1
- package/dist/shadow/grid-extension.svelte-6IzZ_3Cv.js +20 -0
- package/dist/shadow/sparkline-DWRBQubt.js +86 -0
- package/dist/shadow/sv-grid-shadow-element.d.ts +22 -0
- package/dist/shadow/sv-grid-shadow-element.js +3623 -3711
- package/dist/shadow/svelte-virtualizer.svelte-Bftvroa6.js +360 -0
- package/dist/shadow/{validate-43C03DLP.js → validate-BaMO8UPE.js} +1 -1
- package/dist/sparkline-DWRBQubt.js +86 -0
- package/dist/sv-grid-element.d.ts +22 -0
- package/dist/sv-grid-element.js +3281 -3369
- package/dist/svelte-virtualizer.svelte-Bftvroa6.js +360 -0
- package/dist/{validate-43C03DLP.js → validate-BaMO8UPE.js} +1 -1
- package/dist/vue/index.d.ts +16 -2
- package/dist/vue/index.js +1 -1
- package/package.json +3 -3
- package/dist/GridMenus-BsOHO9kc.js +0 -1086
- package/dist/shadow/GridMenus-BsOHO9kc.js +0 -1086
- package/dist/shadow/svelte-virtualizer.svelte-BGip4kwG.js +0 -581
- package/dist/svelte-virtualizer.svelte-BGip4kwG.js +0 -581
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
(function(){try{var c=".sv-pin-split.svelte-3uth74{z-index:50;pointer-events:none;width:0;position:absolute;top:0;left:0}.sv-pin-split.is-editing.svelte-3uth74{display:none}.sv-pin-split-line.svelte-3uth74{top:0;bottom:0;left:calc(var(--x) - 1px);background:color-mix(in srgb, var(--sg-fg,#0f172a) 18%, transparent);width:2px;transition:background-color .12s;position:absolute}.sv-pin-split-hit.svelte-3uth74{bottom:0;left:max(0px, calc(var(--x) - 4px));cursor:col-resize;pointer-events:auto;touch-action:none;outline:none;width:8px;position:absolute}.sv-pin-split.is-dragging.svelte-3uth74 .sv-pin-split-line:where(.svelte-3uth74){background:var(--sg-accent,#2563eb)}.sv-pin-split.svelte-3uth74:has(.sv-pin-split-hit:where(.svelte-3uth74):hover) .sv-pin-split-line:where(.svelte-3uth74){background:var(--sg-accent,#2563eb)}.sv-pin-split.svelte-3uth74:has(.sv-pin-split-hit:where(.svelte-3uth74):focus-visible) .sv-pin-split-line:where(.svelte-3uth74){background:var(--sg-accent,#2563eb)}.sv-pin-split.is-dragging.svelte-3uth74 .sv-pin-split-line:where(.svelte-3uth74){width:3px;left:calc(var(--x) - 1.5px)}.sv-pin-split-ghost.svelte-3uth74{border-left:2px dashed color-mix(in srgb, var(--sg-accent,#2563eb) 50%, transparent);width:0;position:absolute;top:0;bottom:0}.sv-pin-split-tip.svelte-3uth74{top:6px;left:calc(var(--x) + 8px);background:var(--sg-fg,#0f172a);color:var(--sg-bg,#fff);white-space:nowrap;border-radius:6px;padding:3px 8px;font-size:12px;position:absolute}\n";if(typeof globalThis!=='undefined'){var f=globalThis.__SVGRID_WC_ADD_CSS__;if(typeof f==='function')f(c);else(globalThis.__SVGRID_WC_CSS_CHUNKS__=globalThis.__SVGRID_WC_CSS_CHUNKS__||[]).push(c);}if(typeof document==='undefined')return;if(document.querySelector('style[data-svgrid-grid-wc-chunk="PinSplitter"]'))return;var s=document.createElement('style');s.setAttribute('data-svgrid-grid-wc-chunk',"PinSplitter");s.textContent=c;document.head.appendChild(s);}catch(e){}})();
|
|
2
|
+
import { $ as e, A as t, D as n, I as r, J as i, L as a, M as o, Q as s, R as c, U as l, W as u, X as d, Y as f, at as p, f as m, j as h, k as g, n as _, nt as v, rt as y, tt as b, v as x, y as S, z as C } from "./client-wYhMjrKG.js";
|
|
3
|
+
import { n as w } from "./grid-extension.svelte-6IzZ_3Cv.js";
|
|
4
|
+
//#region ../grid/dist/pin-splitter.js
|
|
5
|
+
function T(e, t) {
|
|
6
|
+
let n = [e], r = e;
|
|
7
|
+
for (let e of t) n.push(r += e);
|
|
8
|
+
return n;
|
|
9
|
+
}
|
|
10
|
+
function E(e, t, n, r) {
|
|
11
|
+
let i = 0, a = Math.abs((e[0] ?? 0) - t);
|
|
12
|
+
for (let o = 1; o < e.length && o <= n; o++) {
|
|
13
|
+
let n = e[o] ?? Infinity;
|
|
14
|
+
if (n > r) break;
|
|
15
|
+
Math.abs(n - t) < a && (i = o, a = Math.abs(n - t));
|
|
16
|
+
}
|
|
17
|
+
return i;
|
|
18
|
+
}
|
|
19
|
+
function D(e, t) {
|
|
20
|
+
let n = new Set(e), r = t.filter((e) => n.has(e)), i = new Set(r), a = 0;
|
|
21
|
+
return e.map((e) => i.has(e) ? r[a++] ?? e : e);
|
|
22
|
+
}
|
|
23
|
+
//#endregion
|
|
24
|
+
//#region ../grid/dist/PinSplitter.svelte
|
|
25
|
+
var O = o("<div class=\"sv-pin-split-ghost svelte-3uth74\" aria-hidden=\"true\"></div> <div class=\"sv-pin-split-tip svelte-3uth74\" aria-hidden=\"true\"> </div>", 1), k = o("<div><!> <div class=\"sv-pin-split-line svelte-3uth74\" aria-hidden=\"true\"></div> <div class=\"sv-pin-split-hit svelte-3uth74\" role=\"separator\" aria-orientation=\"vertical\" tabindex=\"0\"></div></div>");
|
|
26
|
+
function A(r, o) {
|
|
27
|
+
y(o, !0);
|
|
28
|
+
let A = _(o, "ctrl", 7), j = b(() => new Set(A().effectivePinning.right)), M = b(() => A().allColumns.filter((e) => !C(j).has(e.id))), N = b(() => new Set(A().effectivePinning.left)), P = b(() => C(M).filter((e) => C(N).has(e.id)).length), F = b(() => T(A().systemColumnsWidth ?? 0, C(M).map((e) => A().getColumnWidth(e.id)))), I = b(() => C(F)[C(P)] ?? 0), L = b(() => A().hasHorizontalOverflow ? 16 : 0), R = b(() => {
|
|
29
|
+
let e = w()?.lockColumn, t = 0;
|
|
30
|
+
if (e) for (let n of C(M)) {
|
|
31
|
+
if (!C(N).has(n.id) || !e(A(), n.id)) break;
|
|
32
|
+
t += 1;
|
|
33
|
+
}
|
|
34
|
+
return t;
|
|
35
|
+
}), z = b(() => A().messages), B = e(null);
|
|
36
|
+
function V() {
|
|
37
|
+
let e = A().scrollContainer;
|
|
38
|
+
if (!e?.clientWidth) return Infinity;
|
|
39
|
+
let t = 0;
|
|
40
|
+
for (let e of C(j)) t += A().getColumnWidth(e) ?? 0;
|
|
41
|
+
return e.clientWidth - t - 120;
|
|
42
|
+
}
|
|
43
|
+
function H(e) {
|
|
44
|
+
let t = A().scrollContainer;
|
|
45
|
+
return t ? e.clientX - t.getBoundingClientRect().left : e.clientX;
|
|
46
|
+
}
|
|
47
|
+
function U(e) {
|
|
48
|
+
if (e === C(P)) return;
|
|
49
|
+
let t = C(M).map((e) => e.id), n = new Set(t), r = [...A().columnPinning.left.filter((e) => !n.has(e)), ...t.slice(0, e)], i = A().grid.getAllColumns().map((e) => e.id), a = A().userColumnOrder ?? [], o = a.length ? [...a, ...i.filter((e) => !a.includes(e))] : i, s = D(o, A().allColumns.map((e) => e.id));
|
|
50
|
+
s.some((e, t) => e !== o[t]) && A().setColumnOrderInternal(s), A().columnPinning = {
|
|
51
|
+
left: r,
|
|
52
|
+
right: [...A().columnPinning.right]
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
function W(e) {
|
|
56
|
+
if (e.button !== 0) return;
|
|
57
|
+
e.preventDefault(), e.stopPropagation();
|
|
58
|
+
let t = A().scrollContainer;
|
|
59
|
+
t && (t.scrollLeft = 0), e.currentTarget.setPointerCapture?.(e.pointerId), s(B, {
|
|
60
|
+
x: C(I),
|
|
61
|
+
count: C(P)
|
|
62
|
+
}, !0);
|
|
63
|
+
}
|
|
64
|
+
u(() => {
|
|
65
|
+
if (!C(B)) return;
|
|
66
|
+
let e = (e) => {
|
|
67
|
+
e.key === "Escape" && (e.preventDefault(), e.stopPropagation(), s(B, null));
|
|
68
|
+
};
|
|
69
|
+
return window.addEventListener("keydown", e, !0), () => window.removeEventListener("keydown", e, !0);
|
|
70
|
+
});
|
|
71
|
+
function G(e) {
|
|
72
|
+
if (!C(B)) return;
|
|
73
|
+
let t = H(e);
|
|
74
|
+
s(B, {
|
|
75
|
+
x: t,
|
|
76
|
+
count: Math.max(C(R), E(C(F), t, C(M).length - 1, V()))
|
|
77
|
+
}, !0);
|
|
78
|
+
}
|
|
79
|
+
function K() {
|
|
80
|
+
if (!C(B)) return;
|
|
81
|
+
let e = C(B).count;
|
|
82
|
+
s(B, null), U(e);
|
|
83
|
+
}
|
|
84
|
+
function q(e) {
|
|
85
|
+
let t = C(P);
|
|
86
|
+
if (e.key === "ArrowRight") t = C(P) + 1;
|
|
87
|
+
else if (e.key === "ArrowLeft") t = C(P) - 1;
|
|
88
|
+
else if (e.key === "Home") t = C(R);
|
|
89
|
+
else return;
|
|
90
|
+
e.preventDefault(), e.stopPropagation(), !(t < C(R) || t > C(M).length - 1) && (t > C(P) && (C(F)[t] ?? Infinity) > V() || U(t));
|
|
91
|
+
}
|
|
92
|
+
let J = b(() => C(B) ? C(B).count : C(P)), Y = b(() => C(B) ? C(F)[C(B).count] ?? C(I) : C(I)), X = b(() => C(J) === 0 ? C(z).pinSplitterNone : C(J) === 1 ? C(z).pinSplitterOne : C(z).pinSplitterMany.replace("{count}", String(C(J))));
|
|
93
|
+
var Z = h(), Q = f(Z), $ = (e) => {
|
|
94
|
+
var r = k();
|
|
95
|
+
let o, u;
|
|
96
|
+
var h = i(r), _ = (e) => {
|
|
97
|
+
var n = O(), r = f(n);
|
|
98
|
+
let a;
|
|
99
|
+
var o = d(r, 2), s = i(o, !0);
|
|
100
|
+
p(o), l(() => {
|
|
101
|
+
a = x(r, "", a, { left: `${C(B).x}px` }), g(s, C(X));
|
|
102
|
+
}), t(e, n);
|
|
103
|
+
};
|
|
104
|
+
n(h, (e) => {
|
|
105
|
+
C(B) && e(_);
|
|
106
|
+
});
|
|
107
|
+
var v = d(h, 4);
|
|
108
|
+
let y;
|
|
109
|
+
p(r), l(() => {
|
|
110
|
+
o = S(r, 1, "sv-pin-split svelte-3uth74", null, o, {
|
|
111
|
+
"is-dragging": !!C(B),
|
|
112
|
+
"is-editing": !!A().editingCell
|
|
113
|
+
}), u = x(r, "", u, {
|
|
114
|
+
"--x": `${C(Y)}px`,
|
|
115
|
+
bottom: `${C(L)}px`
|
|
116
|
+
}), m(v, "aria-label", C(z).pinSplitterLabel), m(v, "aria-valuemin", C(R)), m(v, "aria-valuemax", C(M).length - 1), m(v, "aria-valuenow", C(J)), m(v, "aria-valuetext", C(X)), m(v, "title", C(z).pinSplitterHint), y = x(v, "", y, { top: `${A().headerHeight ?? 0}px` });
|
|
117
|
+
}), a("pointerdown", v, W), a("pointermove", v, G), a("pointerup", v, K), c("pointercancel", v, () => s(B, null)), c("lostpointercapture", v, K), a("keydown", v, q), t(e, r);
|
|
118
|
+
};
|
|
119
|
+
n(Q, (e) => {
|
|
120
|
+
!A().isNarrowResponsive && C(M).length > 1 && e($);
|
|
121
|
+
}), t(r, Z), v();
|
|
122
|
+
}
|
|
123
|
+
r([
|
|
124
|
+
"pointerdown",
|
|
125
|
+
"pointermove",
|
|
126
|
+
"pointerup",
|
|
127
|
+
"keydown"
|
|
128
|
+
]);
|
|
129
|
+
//#endregion
|
|
130
|
+
export { A as default };
|
|
@@ -1,16 +1,63 @@
|
|
|
1
1
|
import { i as e } from "./cell-formatting-hb3vzxhJ.js";
|
|
2
|
-
//#region ../grid/dist/
|
|
2
|
+
//#region ../grid/dist/column-types.js
|
|
3
3
|
function t(e) {
|
|
4
|
+
switch (e) {
|
|
5
|
+
case "number": return { editorType: "number" };
|
|
6
|
+
case "boolean": return { editorType: "checkbox" };
|
|
7
|
+
case "date": return {
|
|
8
|
+
editorType: "date",
|
|
9
|
+
format: { type: "date" }
|
|
10
|
+
};
|
|
11
|
+
case "dateString": return { editorType: "date" };
|
|
12
|
+
default: return { editorType: "text" };
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
function n(e) {
|
|
16
|
+
if (!e) return;
|
|
17
|
+
if (e.cellDataType) return e.cellDataType;
|
|
18
|
+
let t = e.editorType;
|
|
19
|
+
if (t === "number") return "number";
|
|
20
|
+
if (t === "date" || t === "datetime") return "date";
|
|
21
|
+
if (t === "checkbox") return "boolean";
|
|
22
|
+
}
|
|
23
|
+
var r = (e) => e === "date" || e === "dateString";
|
|
24
|
+
function i(e) {
|
|
25
|
+
if (e != null) return typeof e == "number" && Number.isFinite(e) ? "number" : typeof e == "boolean" ? "boolean" : e instanceof Date ? "date" : typeof e == "string" && /^\d{4}-\d{2}-\d{2}([T\s]|$)/.test(e) ? "dateString" : "text";
|
|
26
|
+
}
|
|
27
|
+
function a(e, r, o) {
|
|
28
|
+
return e.map((e) => {
|
|
29
|
+
if (e.columns && e.columns.length) return {
|
|
30
|
+
...e,
|
|
31
|
+
columns: a(e.columns, r, o)
|
|
32
|
+
};
|
|
33
|
+
let s = e.cellDataType;
|
|
34
|
+
if (!s && o && !n(e) && r != null) {
|
|
35
|
+
let t = e.field;
|
|
36
|
+
s = i(e.fieldFn?.(r) ?? (typeof t == "string" ? r[t] : void 0));
|
|
37
|
+
}
|
|
38
|
+
if (!s) return e;
|
|
39
|
+
let c = t(s);
|
|
40
|
+
return {
|
|
41
|
+
...e,
|
|
42
|
+
cellDataType: s,
|
|
43
|
+
editorType: e.editorType ?? c.editorType,
|
|
44
|
+
format: e.format ?? c.format
|
|
45
|
+
};
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
//#endregion
|
|
49
|
+
//#region ../grid/dist/SvGrid.helpers.js
|
|
50
|
+
function o(e) {
|
|
4
51
|
let t = "";
|
|
5
52
|
return e.color && (t += `color:${e.color};`), e.fontWeight != null && (t += `font-weight:${e.fontWeight};`), t;
|
|
6
53
|
}
|
|
7
|
-
function
|
|
54
|
+
function s(e) {
|
|
8
55
|
return Number.isInteger(e) ? e.toLocaleString() : e.toLocaleString(void 0, { maximumFractionDigits: 2 });
|
|
9
56
|
}
|
|
10
|
-
function
|
|
57
|
+
function c(e, t) {
|
|
11
58
|
return `${e}:${t}`;
|
|
12
59
|
}
|
|
13
|
-
function
|
|
60
|
+
function l(e) {
|
|
14
61
|
if (!e) return "";
|
|
15
62
|
if (typeof e == "string") return e;
|
|
16
63
|
if (Array.isArray(e)) return e.filter(Boolean).join(" ");
|
|
@@ -21,22 +68,22 @@ function i(e) {
|
|
|
21
68
|
}
|
|
22
69
|
return "";
|
|
23
70
|
}
|
|
24
|
-
function
|
|
71
|
+
function u(e) {
|
|
25
72
|
if (e == null || e === "") return "";
|
|
26
73
|
if (typeof e == "string" && /^\d{4}-\d{2}-\d{2}$/.test(e)) return e;
|
|
27
74
|
let t = e instanceof Date ? e : new Date(e);
|
|
28
75
|
return Number.isNaN(t.getTime()) ? "" : t.toISOString().slice(0, 10);
|
|
29
76
|
}
|
|
30
|
-
function
|
|
77
|
+
function d(e) {
|
|
31
78
|
if (e == null || e === "") return "";
|
|
32
79
|
if (typeof e == "string" && /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}$/.test(e)) return e;
|
|
33
80
|
let t = e instanceof Date ? e : new Date(e);
|
|
34
81
|
return Number.isNaN(t.getTime()) ? "" : t.toISOString().slice(0, 16);
|
|
35
82
|
}
|
|
36
|
-
function
|
|
83
|
+
function f(e) {
|
|
37
84
|
return String(e).replace(/-native$/, "");
|
|
38
85
|
}
|
|
39
|
-
function
|
|
86
|
+
function p(e) {
|
|
40
87
|
if (e instanceof Date) return e;
|
|
41
88
|
if (typeof e == "string") {
|
|
42
89
|
let t = e.match(/^(\d{1,2}):(\d{2})(?::(\d{2}))?/);
|
|
@@ -47,23 +94,23 @@ function c(e) {
|
|
|
47
94
|
}
|
|
48
95
|
return null;
|
|
49
96
|
}
|
|
50
|
-
function
|
|
97
|
+
function m(e) {
|
|
51
98
|
return e ? `${String(e.getHours()).padStart(2, "0")}:${String(e.getMinutes()).padStart(2, "0")}` : null;
|
|
52
99
|
}
|
|
53
|
-
function
|
|
54
|
-
let n =
|
|
55
|
-
return n === "date" ?
|
|
100
|
+
function h(e, t) {
|
|
101
|
+
let n = f(e);
|
|
102
|
+
return n === "date" ? u(t) : n === "datetime" ? d(t) : String(t ?? "");
|
|
56
103
|
}
|
|
57
|
-
function
|
|
58
|
-
let t =
|
|
104
|
+
function g(e) {
|
|
105
|
+
let t = f(e);
|
|
59
106
|
return t === "number" ? "number" : t === "date" ? "date" : t === "datetime" ? "datetime-local" : t === "time" ? "time" : t === "password" ? "password" : t === "color" ? "color" : "text";
|
|
60
107
|
}
|
|
61
|
-
function
|
|
108
|
+
function _(e) {
|
|
62
109
|
if (!e || Number.isNaN(e.getTime())) return "";
|
|
63
110
|
let t = (e) => String(e).padStart(2, "0");
|
|
64
111
|
return `${e.getFullYear()}-${t(e.getMonth() + 1)}-${t(e.getDate())}`;
|
|
65
112
|
}
|
|
66
|
-
function
|
|
113
|
+
function v(e) {
|
|
67
114
|
if (!e) return null;
|
|
68
115
|
let t = /^(\d{4})-(\d{2})-(\d{2})/.exec(e);
|
|
69
116
|
if (!t) {
|
|
@@ -73,44 +120,45 @@ function p(e) {
|
|
|
73
120
|
let n = new Date(Number(t[1]), Number(t[2]) - 1, Number(t[3]));
|
|
74
121
|
return Number.isNaN(n.getTime()) ? null : n;
|
|
75
122
|
}
|
|
76
|
-
function
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
123
|
+
function y(e) {
|
|
124
|
+
let t = e?.editorType;
|
|
125
|
+
if (t && String(t).endsWith("-native")) return !1;
|
|
126
|
+
let i = t ? f(t) : "";
|
|
127
|
+
return i === "date" || i === "datetime" || i === "time" || r(n(e));
|
|
80
128
|
}
|
|
81
|
-
function
|
|
82
|
-
return
|
|
129
|
+
function b(e) {
|
|
130
|
+
return f(e) === "number" ? "text" : g(e);
|
|
83
131
|
}
|
|
84
|
-
function
|
|
132
|
+
function x(e) {
|
|
85
133
|
return /^-?(\d*\.?\d*)(e-?\d*)?$/i.test(e);
|
|
86
134
|
}
|
|
87
|
-
function
|
|
135
|
+
function S(e) {
|
|
88
136
|
return e == null || e === "" ? [] : Array.isArray(e) ? e.filter((e) => e != null && e !== "") : [e];
|
|
89
137
|
}
|
|
90
|
-
function
|
|
138
|
+
function C(e, t) {
|
|
91
139
|
let n = e.find((e) => e.value === t || String(e.value) === String(t));
|
|
92
140
|
return n ? n.label : String(t ?? "");
|
|
93
141
|
}
|
|
94
|
-
function
|
|
142
|
+
function w(e, t) {
|
|
95
143
|
return e.find((e) => e.value === t || String(e.value) === String(t))?.color;
|
|
96
144
|
}
|
|
97
|
-
function
|
|
145
|
+
function T(e) {
|
|
98
146
|
return e ? `background: color-mix(in srgb, ${e} 22%, transparent);border-color: color-mix(in srgb, ${e} 45%, transparent);color: color-mix(in srgb, ${e} 80%, var(--sg-fg, #0f172a));` : "";
|
|
99
147
|
}
|
|
100
|
-
function
|
|
101
|
-
let t =
|
|
148
|
+
function E(e) {
|
|
149
|
+
let t = f(e);
|
|
102
150
|
return t === "number" ? "sv-grid-cell-editor sv-grid-cell-editor-number" : t === "date" ? "sv-grid-cell-editor sv-grid-cell-editor-date" : t === "datetime" ? "sv-grid-cell-editor sv-grid-cell-editor-datetime" : t === "color" ? "sv-grid-cell-editor sv-grid-cell-editor-color" : "sv-grid-cell-editor";
|
|
103
151
|
}
|
|
104
|
-
function
|
|
152
|
+
function D(t) {
|
|
105
153
|
return e(t);
|
|
106
154
|
}
|
|
107
|
-
function
|
|
155
|
+
function O(e, t) {
|
|
108
156
|
return Math.max(8, Math.min(e, window.innerWidth - t - 8));
|
|
109
157
|
}
|
|
110
|
-
function
|
|
158
|
+
function k(e) {
|
|
111
159
|
return typeof CSS < "u" && CSS.escape ? CSS.escape(e) : e.replace(/"/g, "\\\"");
|
|
112
160
|
}
|
|
113
|
-
function
|
|
161
|
+
function A(e, t) {
|
|
114
162
|
if (e == null || e === "") return NaN;
|
|
115
163
|
if (t) {
|
|
116
164
|
let t = (e instanceof Date ? e : new Date(String(e))).getTime();
|
|
@@ -119,11 +167,11 @@ function T(e, t) {
|
|
|
119
167
|
let n = typeof e == "number" ? e : Number(e);
|
|
120
168
|
return Number.isFinite(n) ? n : NaN;
|
|
121
169
|
}
|
|
122
|
-
function
|
|
170
|
+
function j(e) {
|
|
123
171
|
let t = Math.abs(e), n = t >= 1e3 ? 0 : t >= 100 ? 1 : t >= 1 ? 2 : 4;
|
|
124
172
|
return e.toLocaleString(void 0, { maximumFractionDigits: n });
|
|
125
173
|
}
|
|
126
|
-
function
|
|
174
|
+
function M(e) {
|
|
127
175
|
return new Date(e).toLocaleDateString(void 0, {
|
|
128
176
|
year: "numeric",
|
|
129
177
|
month: "short",
|
|
@@ -131,4 +179,4 @@ function D(e) {
|
|
|
131
179
|
});
|
|
132
180
|
}
|
|
133
181
|
//#endregion
|
|
134
|
-
export {
|
|
182
|
+
export { S as C, a as D, r as E, _ as S, n as T, C as _, k as a, l as b, M as c, b as d, c as f, w as g, g as h, T as i, j as l, E as m, o as n, m as o, h as p, O as r, s, D as t, v as u, x as v, y as w, p as x, A as y };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { $ as e, A as t, C as n, D as r, I as i, J as a, K as o, L as s, M as c, O as l, Q as u, R as d, U as f, W as p, X as m, Y as h, _ as g, at as _, b as v, d as y, f as b, g as x, h as S, i as ee, j as C, k as w, n as T, nt as E, ot as D, p as te, rt as ne, tt as O, w as k, x as A, y as j, z as M } from "./client-wYhMjrKG.js";
|
|
2
|
-
import { C as re, d as ie, h as ae, m as oe, o as se, p as ce, v as le, x as ue } from "./SvGrid.helpers-
|
|
2
|
+
import { C as re, d as ie, h as ae, m as oe, o as se, p as ce, v as le, x as ue } from "./SvGrid.helpers-B2GEKrxS.js";
|
|
3
3
|
import { n as de, r as fe, t as pe } from "./editor-registry-DxGKqcvx.js";
|
|
4
4
|
//#region ../grid/dist/SvGridCellEditor.svelte
|
|
5
5
|
var N = c("<span class=\"sv-grid-chip sv-grid-chip-removable\"> <button type=\"button\" class=\"sv-grid-chip-remove\">×</button></span>"), P = c("<button type=\"button\" class=\"sv-grid-chip-commit\" aria-label=\"Commit chip selection\">Done</button>"), F = c("<div class=\"sv-grid-cell-editor sv-grid-cell-editor-chips\" role=\"group\"><div class=\"sv-grid-chips-row\"><!> <input class=\"sv-grid-chip-input\" type=\"text\"/> <!></div></div>"), I = c("<input type=\"checkbox\" class=\"sv-grid-fr-editor sv-grid-fr-checkbox\"/>"), L = c("<option> </option>"), R = c("<select class=\"sv-grid-cell-editor sv-grid-fr-editor\"></select>"), z = c("<input class=\"sv-grid-cell-editor sv-grid-fr-editor\"/>"), me = c("<button type=\"button\" class=\"sv-grid-checkbox\" role=\"checkbox\" aria-label=\"Edit checkbox value\"></button>"), he = c("<button type=\"button\" role=\"radio\">★</button>"), ge = c("<span class=\"sv-grid-rating-editor\" role=\"radiogroup\" aria-label=\"Rating\"><!> <button type=\"button\" aria-label=\"Clear rating\" class=\"sv-grid-rating-clear\">×</button></span>"), _e = c("<textarea class=\"sv-grid-cell-editor sv-grid-cell-editor-textarea\" rows=\"4\"></textarea>"), ve = c("<button type=\"button\" class=\"sv-grid-autocomplete-option\" role=\"option\"> </button>"), ye = c("<div class=\"sv-grid-autocomplete-list\" role=\"listbox\"></div>"), be = c("<div class=\"sv-grid-autocomplete\"><input class=\"sv-grid-cell-editor sv-grid-cell-editor-autocomplete\" type=\"text\"/> <!></div>"), xe = c("<input type=\"color\"/>"), Se = c("<textarea class=\"sv-grid-cell-editor sv-grid-cell-editor-text sv-grid-cell-editor-multiline\"></textarea>"), Ce = c("<input/>");
|
|
@@ -118,6 +118,10 @@ function B(i, c) {
|
|
|
118
118
|
value: e?.value,
|
|
119
119
|
rowId: e?.rowId ?? "",
|
|
120
120
|
columnId: e?.columnId ?? "",
|
|
121
|
+
columnDef: c.column.columnDef,
|
|
122
|
+
row: c.row.original,
|
|
123
|
+
typed: e?.typed === !0,
|
|
124
|
+
grid: V(),
|
|
121
125
|
onChange: (e) => M(Y)(e),
|
|
122
126
|
onCommit: (e) => {
|
|
123
127
|
e !== void 0 && M(Y)(e), M(J)();
|
|
@@ -128,6 +132,9 @@ function B(i, c) {
|
|
|
128
132
|
onCommitAndMove: (e, t) => {
|
|
129
133
|
e !== void 0 && M(Y)(e), V().commitAndMoveByTab(t === -1);
|
|
130
134
|
},
|
|
135
|
+
onCommitAndMoveDown: (e, t) => {
|
|
136
|
+
e !== void 0 && M(Y)(e), V().commitAndMoveByEnter(t === !0);
|
|
137
|
+
},
|
|
131
138
|
onRequestClose: () => {
|
|
132
139
|
V().editingCell = null, V().gridRootEl?.focus({ preventScroll: !0 });
|
|
133
140
|
},
|
|
@@ -414,13 +421,15 @@ function B(i, c) {
|
|
|
414
421
|
var i = C(), a = h(i), o = (e) => {
|
|
415
422
|
var r = C(), i = h(r);
|
|
416
423
|
{
|
|
417
|
-
let e = O(() => V().editingCell?.value);
|
|
418
|
-
n(i, () => M(W), (
|
|
419
|
-
n
|
|
424
|
+
let e = O(() => V().editingCell?.value), t = O(() => c.column.columnDef.editorFormatString ?? "yyyy-MM-dd");
|
|
425
|
+
n(i, () => M(W), (n, r) => {
|
|
426
|
+
r(n, {
|
|
420
427
|
get value() {
|
|
421
428
|
return M(e);
|
|
422
429
|
},
|
|
423
|
-
formatString
|
|
430
|
+
get formatString() {
|
|
431
|
+
return M(t);
|
|
432
|
+
},
|
|
424
433
|
dropDownDisplayMode: "calendar",
|
|
425
434
|
autoOpen: !0,
|
|
426
435
|
block: !0,
|
|
@@ -441,13 +450,15 @@ function B(i, c) {
|
|
|
441
450
|
var i = C(), a = h(i), o = (e) => {
|
|
442
451
|
var r = C(), i = h(r);
|
|
443
452
|
{
|
|
444
|
-
let e = O(() => V().editingCell?.value);
|
|
445
|
-
n(i, () => M(W), (
|
|
446
|
-
n
|
|
453
|
+
let e = O(() => V().editingCell?.value), t = O(() => c.column.columnDef.editorFormatString ?? "yyyy-MM-dd HH:mm");
|
|
454
|
+
n(i, () => M(W), (n, r) => {
|
|
455
|
+
r(n, {
|
|
447
456
|
get value() {
|
|
448
457
|
return M(e);
|
|
449
458
|
},
|
|
450
|
-
formatString
|
|
459
|
+
get formatString() {
|
|
460
|
+
return M(t);
|
|
461
|
+
},
|
|
451
462
|
dropDownDisplayMode: "both",
|
|
452
463
|
autoOpen: !0,
|
|
453
464
|
block: !0,
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
//#region ../grid/dist/conditional-formatting.js
|
|
2
|
+
var e = {
|
|
3
|
+
arrows: [
|
|
4
|
+
"↓",
|
|
5
|
+
"→",
|
|
6
|
+
"↑"
|
|
7
|
+
],
|
|
8
|
+
traffic: [
|
|
9
|
+
"🔴",
|
|
10
|
+
"🟡",
|
|
11
|
+
"🟢"
|
|
12
|
+
],
|
|
13
|
+
triangles: [
|
|
14
|
+
"▼",
|
|
15
|
+
"◆",
|
|
16
|
+
"▲"
|
|
17
|
+
]
|
|
18
|
+
};
|
|
19
|
+
function t(e) {
|
|
20
|
+
let t = Infinity, n = -Infinity, r = !1;
|
|
21
|
+
for (let i of e) {
|
|
22
|
+
if (i == null || i === "") continue;
|
|
23
|
+
let e = Number(i);
|
|
24
|
+
Number.isFinite(e) && (r = !0, e < t && (t = e), e > n && (n = e));
|
|
25
|
+
}
|
|
26
|
+
return r ? {
|
|
27
|
+
min: t,
|
|
28
|
+
max: n
|
|
29
|
+
} : null;
|
|
30
|
+
}
|
|
31
|
+
function n(e, t, n) {
|
|
32
|
+
let r = 0;
|
|
33
|
+
for (let e = 0; e < t.length; e += 1) n >= t[e] && (r = e + 1);
|
|
34
|
+
return e[Math.min(e.length - 1, Math.max(0, r))] ?? e[e.length - 1];
|
|
35
|
+
}
|
|
36
|
+
function r(e) {
|
|
37
|
+
return e < 0 ? 0 : e > 1 ? 1 : e;
|
|
38
|
+
}
|
|
39
|
+
function i(e) {
|
|
40
|
+
let t = /^#?([0-9a-f]{6})$/i.exec(e.trim());
|
|
41
|
+
if (!t) return null;
|
|
42
|
+
let n = parseInt(t[1], 16);
|
|
43
|
+
return [
|
|
44
|
+
n >> 16 & 255,
|
|
45
|
+
n >> 8 & 255,
|
|
46
|
+
n & 255
|
|
47
|
+
];
|
|
48
|
+
}
|
|
49
|
+
function a(e) {
|
|
50
|
+
return "#" + e.map((e) => Math.round(r(e / 255) * 255).toString(16).padStart(2, "0")).join("");
|
|
51
|
+
}
|
|
52
|
+
function o(e) {
|
|
53
|
+
let t = i(e);
|
|
54
|
+
if (!t) return null;
|
|
55
|
+
let n = t.map((e) => {
|
|
56
|
+
let t = e / 255;
|
|
57
|
+
return t <= .03928 ? t / 12.92 : ((t + .055) / 1.055) ** 2.4;
|
|
58
|
+
});
|
|
59
|
+
return .2126 * n[0] + .7152 * n[1] + .0722 * n[2] > .45 ? "#1e293b" : "#ffffff";
|
|
60
|
+
}
|
|
61
|
+
function s(e, t, n) {
|
|
62
|
+
let o = i(e), s = i(t);
|
|
63
|
+
if (!o || !s) return e;
|
|
64
|
+
let c = r(n);
|
|
65
|
+
return a([
|
|
66
|
+
o[0] + (s[0] - o[0]) * c,
|
|
67
|
+
o[1] + (s[1] - o[1]) * c,
|
|
68
|
+
o[2] + (s[2] - o[2]) * c
|
|
69
|
+
]);
|
|
70
|
+
}
|
|
71
|
+
function c(e, t) {
|
|
72
|
+
let n = i(e);
|
|
73
|
+
return n ? `rgba(${n[0]}, ${n[1]}, ${n[2]}, ${r(t).toFixed(3)})` : e;
|
|
74
|
+
}
|
|
75
|
+
function l(e, t) {
|
|
76
|
+
let n = [...e].sort((e, t) => e.offset - t.offset);
|
|
77
|
+
if (n.length === 0) return "#000000";
|
|
78
|
+
if (t <= n[0].offset) return n[0].color;
|
|
79
|
+
let r = n[n.length - 1];
|
|
80
|
+
if (t >= r.offset) return r.color;
|
|
81
|
+
for (let e = 0; e < n.length - 1; e += 1) {
|
|
82
|
+
let r = n[e], i = n[e + 1];
|
|
83
|
+
if (t >= r.offset && t <= i.offset) {
|
|
84
|
+
let e = i.offset - r.offset || 1;
|
|
85
|
+
return s(r.color, i.color, (t - r.offset) / e);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
return r.color;
|
|
89
|
+
}
|
|
90
|
+
function u(e, t) {
|
|
91
|
+
if (e.stops && e.stops.length >= 2) return l(e.stops, t);
|
|
92
|
+
let n = e.min ?? "#ffffff", r = e.max ?? "#000000";
|
|
93
|
+
return e.mid ? t <= .5 ? s(n, e.mid, t / .5) : s(e.mid, r, (t - .5) / .5) : s(n, r, t);
|
|
94
|
+
}
|
|
95
|
+
function d(e, t, n, i) {
|
|
96
|
+
let a;
|
|
97
|
+
if (e.compareColumn) {
|
|
98
|
+
let i = Number(n?.[e.compareColumn]);
|
|
99
|
+
if (!Number.isFinite(i) || i === 0) return null;
|
|
100
|
+
a = r(t / i);
|
|
101
|
+
} else if (e.type === "colorScale" && e.zeroCentred) {
|
|
102
|
+
let n = e.minValue ?? i?.min ?? t, o = e.maxValue ?? i?.max ?? t;
|
|
103
|
+
a = r(.5 + t / (Math.max(Math.abs(n), Math.abs(o)) || 1) / 2);
|
|
104
|
+
} else {
|
|
105
|
+
let n = i?.min ?? t, o = i?.max ?? t, s, c;
|
|
106
|
+
if (e.bounds === "percent") {
|
|
107
|
+
let t = o - n;
|
|
108
|
+
s = n + (e.minValue ?? 0) / 100 * t, c = n + (e.maxValue ?? 100) / 100 * t;
|
|
109
|
+
} else s = e.minValue ?? n, c = e.maxValue ?? o;
|
|
110
|
+
a = c === s ? .5 : r((t - s) / (c - s));
|
|
111
|
+
}
|
|
112
|
+
return e.type === "colorScale" && e.reverse && (a = 1 - a), a;
|
|
113
|
+
}
|
|
114
|
+
function f(t, i, a, s, l) {
|
|
115
|
+
let f = {};
|
|
116
|
+
for (let p of s) {
|
|
117
|
+
if (p.columns && !p.columns.includes(a)) continue;
|
|
118
|
+
let s = Number(t);
|
|
119
|
+
if (p.type === "rule") {
|
|
120
|
+
if (p.when({
|
|
121
|
+
value: t,
|
|
122
|
+
row: i
|
|
123
|
+
})) {
|
|
124
|
+
if (p.background && (f.background = p.background, !p.color)) {
|
|
125
|
+
let e = o(p.background);
|
|
126
|
+
e && (f.color = e);
|
|
127
|
+
}
|
|
128
|
+
p.color && (f.color = p.color), p.fontWeight != null && (f.fontWeight = p.fontWeight), p.icon && (f.icon = p.icon);
|
|
129
|
+
}
|
|
130
|
+
continue;
|
|
131
|
+
}
|
|
132
|
+
if (!(t == null || t === "" || !Number.isFinite(s))) {
|
|
133
|
+
if (p.type === "colorScale") {
|
|
134
|
+
let e = d(p, s, i, l);
|
|
135
|
+
if (e == null) continue;
|
|
136
|
+
if (p.mode === "alpha") {
|
|
137
|
+
let [t, n] = p.alphaBounds ?? [.05, .85];
|
|
138
|
+
f.background = c(p.base ?? "#2563eb", t + (n - t) * e);
|
|
139
|
+
} else {
|
|
140
|
+
f.background = u(p, e);
|
|
141
|
+
let t = o(f.background);
|
|
142
|
+
t && (f.color = t);
|
|
143
|
+
}
|
|
144
|
+
p.tooltip === "value" ? f.title = String(t) : p.tooltip === "percent" && (f.title = `${Math.round(e * 100)}%`);
|
|
145
|
+
} else if (p.type === "dataBar") {
|
|
146
|
+
let e;
|
|
147
|
+
if (p.compareColumn) {
|
|
148
|
+
let t = d(p, s, i, l);
|
|
149
|
+
if (t == null) continue;
|
|
150
|
+
e = t * 100;
|
|
151
|
+
} else if (p.bounds === "percent") {
|
|
152
|
+
let t = d(p, s, i, l);
|
|
153
|
+
if (t == null) continue;
|
|
154
|
+
e = t * 100;
|
|
155
|
+
} else {
|
|
156
|
+
let t = p.minValue ?? Math.min(0, l?.min ?? 0), n = (p.maxValue ?? l?.max ?? s) - t || 1;
|
|
157
|
+
e = r((s - t) / n) * 100;
|
|
158
|
+
}
|
|
159
|
+
f.dataBar = {
|
|
160
|
+
percent: e,
|
|
161
|
+
color: s < 0 ? p.negativeColor ?? "#ef4444" : p.color,
|
|
162
|
+
fromRight: !1,
|
|
163
|
+
gradient: p.gradient
|
|
164
|
+
}, p.showValue === !1 && (f.color = "transparent");
|
|
165
|
+
} else if (p.type === "iconSet") {
|
|
166
|
+
let t = e[p.set ?? "arrows"];
|
|
167
|
+
f.icon = n(t, p.thresholds, s), p.iconOnly && (f.iconOnly = !0);
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
return f;
|
|
172
|
+
}
|
|
173
|
+
function p(e) {
|
|
174
|
+
return !(e.type !== "colorScale" && e.type !== "dataBar" || "compareColumn" in e && e.compareColumn || e.minValue != null && e.maxValue != null && (e.bounds ?? "absolute") === "absolute");
|
|
175
|
+
}
|
|
176
|
+
function m(e) {
|
|
177
|
+
return e.some(p);
|
|
178
|
+
}
|
|
179
|
+
//#endregion
|
|
180
|
+
export { t as computeColumnStat, o as contrastText, p as formatNeedsStats, m as formatsNeedingStats, s as lerpColor, f as resolveCellFormat, c as rgba };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { $ as e, z as t } from "./client-wYhMjrKG.js";
|
|
2
|
+
//#region ../grid/dist/grid-extension.svelte.js
|
|
3
|
+
var n = e(null);
|
|
4
|
+
function r(e, a) {
|
|
5
|
+
let o = t(n)?.column;
|
|
6
|
+
if (!o) return e;
|
|
7
|
+
let s = a ?? i(e);
|
|
8
|
+
return e.map((e) => e?.columns?.length ? {
|
|
9
|
+
...e,
|
|
10
|
+
columns: r(e.columns, s)
|
|
11
|
+
} : e?.fieldType ? o(e, s) : e);
|
|
12
|
+
}
|
|
13
|
+
function i(e) {
|
|
14
|
+
return e.flatMap((e) => e?.columns?.length ? i(e.columns) : [e]);
|
|
15
|
+
}
|
|
16
|
+
function a() {
|
|
17
|
+
return t(n);
|
|
18
|
+
}
|
|
19
|
+
//#endregion
|
|
20
|
+
export { a as n, r as t };
|