@svgrid/grid-wc 2.6.2 → 3.0.0
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/GridMenus-DpmS1pzo.js +1121 -0
- package/dist/SvDateRangeInput-u4ibte8S.js +196 -0
- package/dist/SvDateTimePicker-DVFiDxUq.js +765 -0
- package/dist/{dismissable-xj_k_fnZ.js → SvField-ChCI-O2O.js} +44 -84
- package/dist/{SvGrid.helpers-CgUd39VT.js → SvGrid.helpers-BdVDtjUm.js} +37 -11
- package/dist/SvGridCellEditor-DvsQyE9a.js +550 -0
- package/dist/{SvGridChart-BztTavvw.js → SvGridChart-yK5Zv85y.js} +158 -158
- package/dist/{SvGridChartPanel-Ca5HWIZ3.js → SvGridChartPanel-B38_VjXM.js} +52 -52
- package/dist/{SvGridChartView-AcWj_tcs.js → SvGridChartView-ScXTF6t-.js} +4 -4
- package/dist/{SvGridDropdown-BXqvR1cs.js → SvGridDropdown-DnAESFDu.js} +29 -29
- package/dist/angular/fesm2022/svgrid-grid-wc-angular.mjs +358 -0
- package/dist/angular/fesm2022/svgrid-grid-wc-angular.mjs.map +1 -0
- package/dist/angular/package.json +25 -0
- package/dist/angular/types/svgrid-grid-wc-angular.d.ts +161 -0
- package/dist/{client-DoXxrq8q.js → client-DjwUji8D.js} +1 -1
- package/dist/column-resize-DvCRUrN3.js +101 -0
- package/dist/date-format-CPHqTHN6.js +1127 -0
- package/dist/dismissable-DvhBKm3q.js +41 -0
- package/dist/react/index.d.ts +313 -0
- package/dist/react/index.js +72 -0
- package/dist/{row-drag-touch-Ddaa-QeB.js → row-drag-touch-CycRR65n.js} +12 -10
- package/dist/row-resize-D-8s3cqT.js +94 -0
- package/dist/shadow/GridMenus-DpmS1pzo.js +1121 -0
- package/dist/shadow/SvDateRangeInput-u4ibte8S.js +196 -0
- package/dist/shadow/SvDateTimePicker-DVFiDxUq.js +765 -0
- package/dist/shadow/SvField-ChCI-O2O.js +146 -0
- package/dist/shadow/SvGrid.helpers-BdVDtjUm.js +135 -0
- package/dist/shadow/SvGridCellEditor-DvsQyE9a.js +550 -0
- package/dist/shadow/SvGridChart-yK5Zv85y.js +1199 -0
- package/dist/shadow/SvGridChartPanel-B38_VjXM.js +584 -0
- package/dist/shadow/SvGridChartView-ScXTF6t-.js +50 -0
- package/dist/shadow/SvGridDropdown-DnAESFDu.js +256 -0
- package/dist/shadow/cell-formatting-C0OsDmi_.js +86 -0
- package/dist/shadow/chart-uvs3sFJA.js +1220 -0
- package/dist/shadow/client-DjwUji8D.js +2960 -0
- package/dist/shadow/column-resize-DvCRUrN3.js +101 -0
- package/dist/shadow/date-format-CPHqTHN6.js +1127 -0
- package/dist/shadow/dismissable-DvhBKm3q.js +41 -0
- package/dist/shadow/editor-contract-peBDxir_.js +22 -0
- package/dist/shadow/editor-registry-DxGKqcvx.js +24 -0
- package/dist/shadow/export-format-C8kZGZfz.js +161 -0
- package/dist/shadow/popover-WsGlvtQv.js +69 -0
- package/dist/shadow/row-drag-touch-CycRR65n.js +93 -0
- package/dist/shadow/row-resize-D-8s3cqT.js +94 -0
- package/dist/shadow/sv-grid-shadow-element.d.ts +246 -0
- package/dist/shadow/sv-grid-shadow-element.js +10175 -0
- package/dist/{svelte-virtualizer.svelte-CFoYP2Ls.js → shadow/svelte-virtualizer.svelte-DZ9UcyfT.js} +35 -30
- package/dist/shadow/validate-CgmAtX1A.js +75 -0
- package/dist/sv-grid-element.d.ts +246 -0
- package/dist/sv-grid-element.js +3655 -2620
- package/dist/svelte-virtualizer.svelte-DZ9UcyfT.js +527 -0
- package/dist/validate-CgmAtX1A.js +75 -0
- package/dist/vue/index.d.ts +147 -0
- package/dist/vue/index.js +72 -0
- package/package.json +71 -6
- package/dist/GridMenus-CU_-Ks4f.js +0 -1001
- package/dist/SvDateTimePicker-Ch1Vug8H.js +0 -1885
- package/dist/SvGridCellEditor-CBJUbAsR.js +0 -523
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
import { $ as e, A as t, D as n, E as r, F as i, I as a, J as o, K as s, O as c, R as l, V as u, et as d, f, j as p, k as m, n as h, q as g, rt as _, tt as v, v as ee, w as te, y } from "./client-DjwUji8D.js";
|
|
2
|
+
import { n as b, r as x } from "./editor-contract-peBDxir_.js";
|
|
3
|
+
//#region ../grid/dist/SvField.svelte
|
|
4
|
+
var S = p("<span class=\"sv-field__req svelte-xtfnp5\" aria-hidden=\"true\">*</span>"), C = p("<label class=\"sv-field__label svelte-xtfnp5\"> <!></label>"), w = p("<span class=\"sv-field__spinner svelte-xtfnp5\" role=\"status\" aria-label=\"Loading\"></span>"), T = p("<span class=\"sv-field__labelrow svelte-xtfnp5\"><!> <!></span>"), ne = p("<span class=\"sv-field__req svelte-xtfnp5\" aria-hidden=\"true\">*</span>"), re = p("<label class=\"sv-field__float-label svelte-xtfnp5\"> <!></label>"), ie = p("<span class=\"sv-field__adorn sv-field__adorn--lead svelte-xtfnp5\"><!></span>"), E = p("<span class=\"sv-field__affix sv-field__affix--pre svelte-xtfnp5\"> </span>"), D = p("<span class=\"sv-field__affix sv-field__affix--suf svelte-xtfnp5\"> </span>"), O = p("<span class=\"sv-field__adorn sv-field__adorn--trail svelte-xtfnp5\"><!></span>"), k = p("<span class=\"sv-field__action-txt svelte-xtfnp5\"> </span>"), A = p("<button class=\"sv-field__action svelte-xtfnp5\" type=\"button\" tabindex=\"-1\"><!></button>"), ae = p("<button class=\"sv-field__clear svelte-xtfnp5\" type=\"button\" tabindex=\"-1\">×</button>"), oe = p("<div><!> <!> <!> <span class=\"sv-field__slot svelte-xtfnp5\"><!></span> <!> <!> <!> <!></div>"), j = p("<span class=\"sv-field__error svelte-xtfnp5\" role=\"alert\"> </span>"), M = p("<span class=\"sv-field__hint svelte-xtfnp5\"> </span>"), N = p("<div><!> <!> <!></div>");
|
|
5
|
+
function P(i, p) {
|
|
6
|
+
v(p, !0);
|
|
7
|
+
let P = h(p, "required", 3, !1), F = h(p, "block", 3, !1), I = h(p, "loading", 3, !1), L = h(p, "frame", 3, !1), R = h(p, "invalid", 3, !1), z = h(p, "size", 3, "md"), B = h(p, "disabled", 3, !1), V = h(p, "readonly", 3, !1), H = h(p, "clearable", 3, !1), U = h(p, "showClear", 3, !1), W = h(p, "clearLabel", 3, "Clear"), G = h(p, "labelMode", 3, "static"), K = h(p, "filled", 3, !1), se = e(() => p.width == null ? void 0 : typeof p.width == "number" ? `${p.width}px` : p.width), q = e(() => G() === "floating" && L() && !!p.label), J = e(() => p.dir === "ltr" || p.dir === "rtl" ? p.dir : void 0);
|
|
8
|
+
var Y = N();
|
|
9
|
+
let X;
|
|
10
|
+
var Z = s(Y), ce = (e) => {
|
|
11
|
+
var t = T(), n = s(t), i = (e) => {
|
|
12
|
+
var t = C(), n = s(t, !0), i = o(n), a = (e) => {
|
|
13
|
+
var t = S();
|
|
14
|
+
m(e, t);
|
|
15
|
+
};
|
|
16
|
+
r(i, (e) => {
|
|
17
|
+
P() && e(a);
|
|
18
|
+
}), _(t), u(() => {
|
|
19
|
+
f(t, "for", p.id), c(n, p.label);
|
|
20
|
+
}), m(e, t);
|
|
21
|
+
};
|
|
22
|
+
r(n, (e) => {
|
|
23
|
+
p.label && !l(q) && e(i);
|
|
24
|
+
});
|
|
25
|
+
var a = o(n, 2), d = (e) => {
|
|
26
|
+
var t = w();
|
|
27
|
+
m(e, t);
|
|
28
|
+
};
|
|
29
|
+
r(a, (e) => {
|
|
30
|
+
I() && e(d);
|
|
31
|
+
}), _(t), m(e, t);
|
|
32
|
+
};
|
|
33
|
+
r(Z, (e) => {
|
|
34
|
+
(p.label && !l(q) || I()) && e(ce);
|
|
35
|
+
});
|
|
36
|
+
var Q = o(Z, 2), le = (e) => {
|
|
37
|
+
var i = oe();
|
|
38
|
+
let d, h;
|
|
39
|
+
var v = s(i), b = (e) => {
|
|
40
|
+
var t = re(), n = s(t, !0), i = o(n), a = (e) => {
|
|
41
|
+
var t = ne();
|
|
42
|
+
m(e, t);
|
|
43
|
+
};
|
|
44
|
+
r(i, (e) => {
|
|
45
|
+
P() && e(a);
|
|
46
|
+
}), _(t), u(() => {
|
|
47
|
+
f(t, "for", p.id), c(n, p.label);
|
|
48
|
+
}), m(e, t);
|
|
49
|
+
};
|
|
50
|
+
r(v, (e) => {
|
|
51
|
+
l(q) && e(b);
|
|
52
|
+
});
|
|
53
|
+
var x = o(v, 2), S = (e) => {
|
|
54
|
+
var t = ie(), r = s(t);
|
|
55
|
+
n(r, () => p.leading), _(t), m(e, t);
|
|
56
|
+
};
|
|
57
|
+
r(x, (e) => {
|
|
58
|
+
p.leading && e(S);
|
|
59
|
+
});
|
|
60
|
+
var C = o(x, 2), w = (e) => {
|
|
61
|
+
var t = E(), n = s(t, !0);
|
|
62
|
+
_(t), u(() => c(n, p.prefix)), m(e, t);
|
|
63
|
+
};
|
|
64
|
+
r(C, (e) => {
|
|
65
|
+
p.prefix && e(w);
|
|
66
|
+
});
|
|
67
|
+
var T = o(C, 2), j = s(T);
|
|
68
|
+
n(j, () => p.children), _(T);
|
|
69
|
+
var M = o(T, 2), N = (e) => {
|
|
70
|
+
var t = D(), n = s(t, !0);
|
|
71
|
+
_(t), u(() => c(n, p.suffix)), m(e, t);
|
|
72
|
+
};
|
|
73
|
+
r(M, (e) => {
|
|
74
|
+
p.suffix && e(N);
|
|
75
|
+
});
|
|
76
|
+
var I = o(M, 2), L = (e) => {
|
|
77
|
+
var t = O(), r = s(t);
|
|
78
|
+
n(r, () => p.trailing), _(t), m(e, t);
|
|
79
|
+
};
|
|
80
|
+
r(I, (e) => {
|
|
81
|
+
p.trailing && e(L);
|
|
82
|
+
});
|
|
83
|
+
var G = o(I, 2), J = (e) => {
|
|
84
|
+
var i = t(), o = g(i);
|
|
85
|
+
te(o, 17, () => p.actions, (e) => e.label, (e, i) => {
|
|
86
|
+
var o = A(), d = s(o), p = (e) => {
|
|
87
|
+
var r = t(), a = g(r);
|
|
88
|
+
n(a, () => l(i).icon), m(e, r);
|
|
89
|
+
}, h = (e) => {
|
|
90
|
+
var t = k(), n = s(t, !0);
|
|
91
|
+
_(t), u(() => c(n, l(i).label)), m(e, t);
|
|
92
|
+
};
|
|
93
|
+
r(d, (e) => {
|
|
94
|
+
l(i).icon ? e(p) : e(h, -1);
|
|
95
|
+
}), _(o), u(() => {
|
|
96
|
+
f(o, "aria-label", l(i).label), f(o, "title", l(i).label), o.disabled = B() || l(i).disabled;
|
|
97
|
+
}), a("click", o, () => l(i).onClick()), m(e, o);
|
|
98
|
+
}), m(e, i);
|
|
99
|
+
};
|
|
100
|
+
r(G, (e) => {
|
|
101
|
+
p.actions?.length && e(J);
|
|
102
|
+
});
|
|
103
|
+
var Y = o(G, 2), X = (e) => {
|
|
104
|
+
var t = ae();
|
|
105
|
+
u(() => f(t, "aria-label", W())), a("click", t, () => p.onclear?.()), m(e, t);
|
|
106
|
+
};
|
|
107
|
+
r(Y, (e) => {
|
|
108
|
+
H() && U() && !B() && !V() && e(X);
|
|
109
|
+
}), _(i), u(() => {
|
|
110
|
+
d = y(i, 1, `sv-field__control sv-field--${z() ?? ""}`, "svelte-xtfnp5", d, {
|
|
111
|
+
"is-invalid": R(),
|
|
112
|
+
"is-disabled": B(),
|
|
113
|
+
"is-readonly": V(),
|
|
114
|
+
"is-filled": K()
|
|
115
|
+
}), h = ee(i, "", h, { width: F() ? void 0 : l(se) });
|
|
116
|
+
}), m(e, i);
|
|
117
|
+
}, $ = (e) => {
|
|
118
|
+
var r = t(), i = g(r);
|
|
119
|
+
n(i, () => p.children), m(e, r);
|
|
120
|
+
};
|
|
121
|
+
r(Q, (e) => {
|
|
122
|
+
L() ? e(le) : e($, -1);
|
|
123
|
+
});
|
|
124
|
+
var ue = o(Q, 2), de = (e) => {
|
|
125
|
+
var t = j(), n = s(t, !0);
|
|
126
|
+
_(t), u((e) => {
|
|
127
|
+
f(t, "id", e), c(n, p.error);
|
|
128
|
+
}, [() => b(p.id)]), m(e, t);
|
|
129
|
+
}, fe = (e) => {
|
|
130
|
+
var t = M(), n = s(t, !0);
|
|
131
|
+
_(t), u((e) => {
|
|
132
|
+
f(t, "id", e), c(n, p.hint);
|
|
133
|
+
}, [() => x(p.id)]), m(e, t);
|
|
134
|
+
};
|
|
135
|
+
r(ue, (e) => {
|
|
136
|
+
p.error ? e(de) : p.hint && e(fe, 1);
|
|
137
|
+
}), _(Y), u(() => {
|
|
138
|
+
X = y(Y, 1, "sv-field svelte-xtfnp5", null, X, {
|
|
139
|
+
"sv-field--block": F(),
|
|
140
|
+
"sv-field--floating": l(q)
|
|
141
|
+
}), f(Y, "dir", l(J)), Y.dir = Y.dir;
|
|
142
|
+
}), m(i, Y), d();
|
|
143
|
+
}
|
|
144
|
+
i(["click"]);
|
|
145
|
+
//#endregion
|
|
146
|
+
export { P as t };
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
//#region ../grid/dist/SvGrid.helpers.js
|
|
2
|
+
function e(e) {
|
|
3
|
+
let t = "";
|
|
4
|
+
return e.color && (t += `color:${e.color};`), e.fontWeight != null && (t += `font-weight:${e.fontWeight};`), t;
|
|
5
|
+
}
|
|
6
|
+
function t(e) {
|
|
7
|
+
return Number.isInteger(e) ? e.toLocaleString() : e.toLocaleString(void 0, { maximumFractionDigits: 2 });
|
|
8
|
+
}
|
|
9
|
+
function n(e, t) {
|
|
10
|
+
return `${e}:${t}`;
|
|
11
|
+
}
|
|
12
|
+
function r(e) {
|
|
13
|
+
if (!e) return "";
|
|
14
|
+
if (typeof e == "string") return e;
|
|
15
|
+
if (Array.isArray(e)) return e.filter(Boolean).join(" ");
|
|
16
|
+
if (typeof e == "object") {
|
|
17
|
+
let t = [];
|
|
18
|
+
for (let [n, r] of Object.entries(e)) r && t.push(n);
|
|
19
|
+
return t.join(" ");
|
|
20
|
+
}
|
|
21
|
+
return "";
|
|
22
|
+
}
|
|
23
|
+
function i(e) {
|
|
24
|
+
if (e == null || e === "") return "";
|
|
25
|
+
if (typeof e == "string" && /^\d{4}-\d{2}-\d{2}$/.test(e)) return e;
|
|
26
|
+
let t = e instanceof Date ? e : new Date(e);
|
|
27
|
+
return Number.isNaN(t.getTime()) ? "" : t.toISOString().slice(0, 10);
|
|
28
|
+
}
|
|
29
|
+
function a(e) {
|
|
30
|
+
if (e == null || e === "") return "";
|
|
31
|
+
if (typeof e == "string" && /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}$/.test(e)) return e;
|
|
32
|
+
let t = e instanceof Date ? e : new Date(e);
|
|
33
|
+
return Number.isNaN(t.getTime()) ? "" : t.toISOString().slice(0, 16);
|
|
34
|
+
}
|
|
35
|
+
function o(e) {
|
|
36
|
+
return String(e).replace(/-native$/, "");
|
|
37
|
+
}
|
|
38
|
+
function s(e) {
|
|
39
|
+
if (e instanceof Date) return e;
|
|
40
|
+
if (typeof e == "string") {
|
|
41
|
+
let t = e.match(/^(\d{1,2}):(\d{2})(?::(\d{2}))?/);
|
|
42
|
+
if (t) {
|
|
43
|
+
let e = /* @__PURE__ */ new Date();
|
|
44
|
+
return e.setHours(Math.min(23, +t[1]), Math.min(59, +t[2]), t[3] ? +t[3] : 0, 0), e;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
return null;
|
|
48
|
+
}
|
|
49
|
+
function c(e) {
|
|
50
|
+
return e ? `${String(e.getHours()).padStart(2, "0")}:${String(e.getMinutes()).padStart(2, "0")}` : null;
|
|
51
|
+
}
|
|
52
|
+
function l(e, t) {
|
|
53
|
+
let n = o(e);
|
|
54
|
+
return n === "date" ? i(t) : n === "datetime" ? a(t) : String(t ?? "");
|
|
55
|
+
}
|
|
56
|
+
function u(e) {
|
|
57
|
+
let t = o(e);
|
|
58
|
+
return t === "number" ? "number" : t === "date" ? "date" : t === "datetime" ? "datetime-local" : t === "time" ? "time" : t === "password" ? "password" : t === "color" ? "color" : "text";
|
|
59
|
+
}
|
|
60
|
+
function d(e) {
|
|
61
|
+
if (!e || Number.isNaN(e.getTime())) return "";
|
|
62
|
+
let t = (e) => String(e).padStart(2, "0");
|
|
63
|
+
return `${e.getFullYear()}-${t(e.getMonth() + 1)}-${t(e.getDate())}`;
|
|
64
|
+
}
|
|
65
|
+
function f(e) {
|
|
66
|
+
if (!e) return null;
|
|
67
|
+
let t = /^(\d{4})-(\d{2})-(\d{2})/.exec(e);
|
|
68
|
+
if (!t) {
|
|
69
|
+
let t = new Date(e);
|
|
70
|
+
return Number.isNaN(t.getTime()) ? null : t;
|
|
71
|
+
}
|
|
72
|
+
let n = new Date(Number(t[1]), Number(t[2]) - 1, Number(t[3]));
|
|
73
|
+
return Number.isNaN(n.getTime()) ? null : n;
|
|
74
|
+
}
|
|
75
|
+
function p(e) {
|
|
76
|
+
if (!e || String(e).endsWith("-native")) return !1;
|
|
77
|
+
let t = o(e);
|
|
78
|
+
return t === "date" || t === "datetime" || t === "time";
|
|
79
|
+
}
|
|
80
|
+
function m(e) {
|
|
81
|
+
return o(e) === "number" ? "text" : u(e);
|
|
82
|
+
}
|
|
83
|
+
function h(e) {
|
|
84
|
+
return /^-?(\d*\.?\d*)(e-?\d*)?$/i.test(e);
|
|
85
|
+
}
|
|
86
|
+
function g(e) {
|
|
87
|
+
return e == null || e === "" ? [] : Array.isArray(e) ? e.filter((e) => e != null && e !== "") : [e];
|
|
88
|
+
}
|
|
89
|
+
function _(e, t) {
|
|
90
|
+
let n = e.find((e) => e.value === t || String(e.value) === String(t));
|
|
91
|
+
return n ? n.label : String(t ?? "");
|
|
92
|
+
}
|
|
93
|
+
function v(e, t) {
|
|
94
|
+
return e.find((e) => e.value === t || String(e.value) === String(t))?.color;
|
|
95
|
+
}
|
|
96
|
+
function y(e) {
|
|
97
|
+
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));` : "";
|
|
98
|
+
}
|
|
99
|
+
function b(e) {
|
|
100
|
+
let t = o(e);
|
|
101
|
+
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";
|
|
102
|
+
}
|
|
103
|
+
function x(e) {
|
|
104
|
+
if (e == null || e === "") return null;
|
|
105
|
+
let t = e instanceof Date ? e : new Date(e);
|
|
106
|
+
return Number.isNaN(t.getTime()) ? null : t;
|
|
107
|
+
}
|
|
108
|
+
function S(e, t) {
|
|
109
|
+
return Math.max(8, Math.min(e, window.innerWidth - t - 8));
|
|
110
|
+
}
|
|
111
|
+
function C(e) {
|
|
112
|
+
return typeof CSS < "u" && CSS.escape ? CSS.escape(e) : e.replace(/"/g, "\\\"");
|
|
113
|
+
}
|
|
114
|
+
function w(e, t) {
|
|
115
|
+
if (e == null || e === "") return NaN;
|
|
116
|
+
if (t) {
|
|
117
|
+
let t = (e instanceof Date ? e : new Date(String(e))).getTime();
|
|
118
|
+
return Number.isFinite(t) ? t : NaN;
|
|
119
|
+
}
|
|
120
|
+
let n = typeof e == "number" ? e : Number(e);
|
|
121
|
+
return Number.isFinite(n) ? n : NaN;
|
|
122
|
+
}
|
|
123
|
+
function T(e) {
|
|
124
|
+
let t = Math.abs(e), n = t >= 1e3 ? 0 : t >= 100 ? 1 : t >= 1 ? 2 : 4;
|
|
125
|
+
return e.toLocaleString(void 0, { maximumFractionDigits: n });
|
|
126
|
+
}
|
|
127
|
+
function E(e) {
|
|
128
|
+
return new Date(e).toLocaleDateString(void 0, {
|
|
129
|
+
year: "numeric",
|
|
130
|
+
month: "short",
|
|
131
|
+
day: "numeric"
|
|
132
|
+
});
|
|
133
|
+
}
|
|
134
|
+
//#endregion
|
|
135
|
+
export { g as C, d as S, _, C as a, r as b, E as c, m as d, n as f, v as g, u as h, y as i, T as l, b as m, e as n, c as o, l as p, S as r, t as s, x as t, f as u, h as v, p as w, s as x, w as y };
|