@svgrid/grid-wc 2.2.0 → 2.4.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/LICENSE +0 -25
- package/README.md +110 -90
- package/dist/GridMenus-Boz00ms0.js +1000 -0
- package/dist/SvDateTimePicker-Ch1Vug8H.js +1885 -0
- package/dist/SvGridChart-BztTavvw.js +1199 -0
- package/dist/SvGridChartPanel-Ca5HWIZ3.js +584 -0
- package/dist/SvGridChartView-AcWj_tcs.js +50 -0
- package/dist/SvGridDropdown-BXqvR1cs.js +256 -0
- package/dist/cell-formatting-C0OsDmi_.js +86 -0
- package/dist/chart-uvs3sFJA.js +1220 -0
- package/dist/client-DoXxrq8q.js +2960 -0
- package/dist/dismissable-xj_k_fnZ.js +186 -0
- package/dist/editor-contract-peBDxir_.js +22 -0
- package/dist/export-format-B6FUgOll.js +161 -0
- package/dist/popover-WsGlvtQv.js +69 -0
- package/dist/sv-grid-element.js +8338 -21356
- package/dist/svelte-virtualizer.svelte-ZL3wxPzD.js +614 -0
- package/package.json +5 -5
|
@@ -0,0 +1,186 @@
|
|
|
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, f as d, it as f, j as p, k as m, n as h, nt as g, q as _, tt as v, v as ee, w as te, y } from "./client-DoXxrq8q.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>"), ae = p("<span class=\"sv-field__affix sv-field__affix--pre svelte-xtfnp5\"> </span>"), oe = p("<span class=\"sv-field__affix sv-field__affix--suf svelte-xtfnp5\"> </span>"), E = p("<span class=\"sv-field__adorn sv-field__adorn--trail svelte-xtfnp5\"><!></span>"), D = p("<span class=\"sv-field__action-txt svelte-xtfnp5\"> </span>"), O = p("<button class=\"sv-field__action svelte-xtfnp5\" type=\"button\" tabindex=\"-1\"><!></button>"), k = p("<button class=\"sv-field__clear svelte-xtfnp5\" type=\"button\" tabindex=\"-1\">×</button>"), A = 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
|
+
g(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
|
+
}), f(t), u(() => {
|
|
19
|
+
d(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), h = (e) => {
|
|
26
|
+
var t = w();
|
|
27
|
+
m(e, t);
|
|
28
|
+
};
|
|
29
|
+
r(a, (e) => {
|
|
30
|
+
I() && e(h);
|
|
31
|
+
}), f(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 = A();
|
|
38
|
+
let h, g;
|
|
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
|
+
}), f(t), u(() => {
|
|
47
|
+
d(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), f(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 = ae(), n = s(t, !0);
|
|
62
|
+
f(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), f(T);
|
|
69
|
+
var M = o(T, 2), N = (e) => {
|
|
70
|
+
var t = oe(), n = s(t, !0);
|
|
71
|
+
f(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 = E(), r = s(t);
|
|
78
|
+
n(r, () => p.trailing), f(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 = _(i);
|
|
85
|
+
te(o, 17, () => p.actions, (e) => e.label, (e, i) => {
|
|
86
|
+
var o = O(), p = s(o), h = (e) => {
|
|
87
|
+
var r = t(), a = _(r);
|
|
88
|
+
n(a, () => l(i).icon), m(e, r);
|
|
89
|
+
}, g = (e) => {
|
|
90
|
+
var t = D(), n = s(t, !0);
|
|
91
|
+
f(t), u(() => c(n, l(i).label)), m(e, t);
|
|
92
|
+
};
|
|
93
|
+
r(p, (e) => {
|
|
94
|
+
l(i).icon ? e(h) : e(g, -1);
|
|
95
|
+
}), f(o), u(() => {
|
|
96
|
+
d(o, "aria-label", l(i).label), d(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 = k();
|
|
105
|
+
u(() => d(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
|
+
}), f(i), u(() => {
|
|
110
|
+
h = y(i, 1, `sv-field__control sv-field--${z() ?? ""}`, "svelte-xtfnp5", h, {
|
|
111
|
+
"is-invalid": R(),
|
|
112
|
+
"is-disabled": B(),
|
|
113
|
+
"is-readonly": V(),
|
|
114
|
+
"is-filled": K()
|
|
115
|
+
}), g = ee(i, "", g, { width: F() ? void 0 : l(se) });
|
|
116
|
+
}), m(e, i);
|
|
117
|
+
}, $ = (e) => {
|
|
118
|
+
var r = t(), i = _(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
|
+
f(t), u((e) => {
|
|
127
|
+
d(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
|
+
f(t), u((e) => {
|
|
132
|
+
d(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
|
+
}), f(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
|
+
}), d(Y, "dir", l(J)), Y.dir = Y.dir;
|
|
142
|
+
}), m(i, Y), v();
|
|
143
|
+
}
|
|
144
|
+
i(["click"]);
|
|
145
|
+
//#endregion
|
|
146
|
+
//#region ../grid/dist/a11y/dismissable.js
|
|
147
|
+
function F(e, t) {
|
|
148
|
+
return t ? (Array.isArray(e) ? e : [e]).some((e) => e != null && e.contains(t)) : !1;
|
|
149
|
+
}
|
|
150
|
+
var I = [], L = !1;
|
|
151
|
+
function R() {
|
|
152
|
+
L || typeof document > "u" || (L = !0, document.addEventListener("keydown", (e) => {
|
|
153
|
+
if (e.key !== "Escape") return;
|
|
154
|
+
let t = I[I.length - 1];
|
|
155
|
+
t?.closeOnEscape && (e.stopPropagation(), t.onDismiss("escape"));
|
|
156
|
+
}, !0), document.addEventListener("pointerdown", (e) => {
|
|
157
|
+
let t = I[I.length - 1];
|
|
158
|
+
t?.closeOnOutside && (F(t.element(), e.target) || t.onDismiss("outside"));
|
|
159
|
+
}, !0));
|
|
160
|
+
}
|
|
161
|
+
function z(e) {
|
|
162
|
+
let t = {
|
|
163
|
+
element: e.element,
|
|
164
|
+
onDismiss: e.onDismiss,
|
|
165
|
+
closeOnEscape: e.closeOnEscape ?? !0,
|
|
166
|
+
closeOnOutside: e.closeOnOutside ?? !0
|
|
167
|
+
};
|
|
168
|
+
return {
|
|
169
|
+
activate() {
|
|
170
|
+
R(), I.includes(t) || I.push(t);
|
|
171
|
+
},
|
|
172
|
+
release() {
|
|
173
|
+
let e = I.indexOf(t);
|
|
174
|
+
e >= 0 && I.splice(e, 1);
|
|
175
|
+
}
|
|
176
|
+
};
|
|
177
|
+
}
|
|
178
|
+
function B(e, t) {
|
|
179
|
+
if (typeof window > "u") return () => {};
|
|
180
|
+
let n = (n) => {
|
|
181
|
+
F(e(), n.target) || t();
|
|
182
|
+
};
|
|
183
|
+
return window.addEventListener("scroll", n, !0), () => window.removeEventListener("scroll", n, !0);
|
|
184
|
+
}
|
|
185
|
+
//#endregion
|
|
186
|
+
export { B as n, P as r, z as t };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
//#region ../grid/dist/editor-contract.js
|
|
2
|
+
var e = (e) => e ? `${e}__error` : void 0, t = (e) => e ? `${e}__hint` : void 0, n = 0, r = (e = "sv-ed") => `${e}-${n++}`;
|
|
3
|
+
function i(n) {
|
|
4
|
+
let r = [n.error ? e(n.id) : void 0, n.hint ? t(n.id) : void 0].filter(Boolean);
|
|
5
|
+
return {
|
|
6
|
+
"aria-invalid": n.invalid ? "true" : void 0,
|
|
7
|
+
"aria-required": n.required ? "true" : void 0,
|
|
8
|
+
"aria-describedby": r.length ? r.join(" ") : void 0,
|
|
9
|
+
"aria-label": n.ariaLabel
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
function a(e, t) {
|
|
13
|
+
if (!t) return e;
|
|
14
|
+
let n = { ...e };
|
|
15
|
+
for (let e in t) {
|
|
16
|
+
let r = t[e];
|
|
17
|
+
r != null && r !== "" && (n[e] = r);
|
|
18
|
+
}
|
|
19
|
+
return n;
|
|
20
|
+
}
|
|
21
|
+
//#endregion
|
|
22
|
+
export { a, r as i, e as n, t as r, i as t };
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
import { n as e, r as t, t as n } from "./cell-formatting-C0OsDmi_.js";
|
|
2
|
+
import "./sv-grid-element.js";
|
|
3
|
+
//#region ../grid/dist/export-format.js
|
|
4
|
+
function r(e) {
|
|
5
|
+
if (e instanceof Date) return Number.isNaN(e.getTime()) ? null : e;
|
|
6
|
+
if (typeof e == "number" && Number.isFinite(e)) {
|
|
7
|
+
let t = new Date(e);
|
|
8
|
+
return Number.isNaN(t.getTime()) ? null : t;
|
|
9
|
+
}
|
|
10
|
+
if (typeof e == "string" && e.trim() !== "") {
|
|
11
|
+
let t = new Date(e);
|
|
12
|
+
return Number.isNaN(t.getTime()) ? null : t;
|
|
13
|
+
}
|
|
14
|
+
return null;
|
|
15
|
+
}
|
|
16
|
+
function i(i, a) {
|
|
17
|
+
if (i == null) return "";
|
|
18
|
+
if (!a) return String(i);
|
|
19
|
+
if (a.type === "number" || a.type === "currency" || a.type === "percent") return n(i, {
|
|
20
|
+
type: a.type,
|
|
21
|
+
locales: a.locales,
|
|
22
|
+
currency: a.type === "currency" ? a.currency ?? "USD" : void 0,
|
|
23
|
+
valueIsPercentPoints: a.type === "percent" ? a.valueIsPercentPoints : void 0,
|
|
24
|
+
options: a.options
|
|
25
|
+
});
|
|
26
|
+
if (a.type === "date" || a.type === "datetime") {
|
|
27
|
+
let n = r(i);
|
|
28
|
+
if (n) {
|
|
29
|
+
let r = t(a.pattern, a.type), i = r || a.options ? {
|
|
30
|
+
...r,
|
|
31
|
+
...a.options
|
|
32
|
+
} : a.type === "date" ? {
|
|
33
|
+
year: "numeric",
|
|
34
|
+
month: "2-digit",
|
|
35
|
+
day: "2-digit"
|
|
36
|
+
} : {
|
|
37
|
+
year: "numeric",
|
|
38
|
+
month: "2-digit",
|
|
39
|
+
day: "2-digit",
|
|
40
|
+
hour: "2-digit",
|
|
41
|
+
minute: "2-digit"
|
|
42
|
+
};
|
|
43
|
+
return e(a.locales, i).format(n);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
return String(i);
|
|
47
|
+
}
|
|
48
|
+
function a(e, t, n = {}) {
|
|
49
|
+
let r = n.columns && n.columns.length ? n.columns.map((e) => t.find((t) => t.field === e)).filter((e) => !!e) : t.filter((e) => e.field), a = r.map((e) => e.field), o = {};
|
|
50
|
+
for (let e of r) e.align && (o[e.field] = e.align);
|
|
51
|
+
let s = {};
|
|
52
|
+
for (let e of r) s[e.field] = e.header;
|
|
53
|
+
let c = [s];
|
|
54
|
+
for (let t of e) {
|
|
55
|
+
let e = {};
|
|
56
|
+
for (let a of r) {
|
|
57
|
+
let r = t[a.field];
|
|
58
|
+
e[a.field] = n.rawValues ? r : i(r, a.format);
|
|
59
|
+
}
|
|
60
|
+
c.push(e);
|
|
61
|
+
}
|
|
62
|
+
return {
|
|
63
|
+
records: c,
|
|
64
|
+
fields: a,
|
|
65
|
+
align: o
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
var o = "";
|
|
69
|
+
function s(e) {
|
|
70
|
+
if (e?.aborted) throw new DOMException("Export aborted", "AbortError");
|
|
71
|
+
}
|
|
72
|
+
var c = () => new Promise((e) => setTimeout(e, 0));
|
|
73
|
+
function l(e, t) {
|
|
74
|
+
let n = e == null ? "" : e instanceof Date ? e.toISOString() : String(e);
|
|
75
|
+
return n === "" ? n : n.includes(t) || n.includes("\"") || n.includes("\n") || n.includes("\r") ? `"${n.replace(/"/g, "\"\"")}"` : n;
|
|
76
|
+
}
|
|
77
|
+
async function u(e, t, n = {}) {
|
|
78
|
+
let r = n.csv?.delimiter ?? ",", i = n.csv?.eol ?? "\r\n", a = n.csv?.bom ?? !0, u = Math.max(1, n.chunkRows ?? 5e3), d = e.length, f = [];
|
|
79
|
+
for (let i = 0; i < e.length; i++) {
|
|
80
|
+
s(n.signal);
|
|
81
|
+
let a = e[i];
|
|
82
|
+
f.push(t.map((e) => l(a[e], r)).join(r)), i > 0 && i % u === 0 && (n.onProgress?.({
|
|
83
|
+
phase: "serialize",
|
|
84
|
+
ratio: i / d,
|
|
85
|
+
row: i,
|
|
86
|
+
total: d
|
|
87
|
+
}), await c());
|
|
88
|
+
}
|
|
89
|
+
n.onProgress?.({
|
|
90
|
+
phase: "serialize",
|
|
91
|
+
ratio: 1,
|
|
92
|
+
row: d,
|
|
93
|
+
total: d
|
|
94
|
+
});
|
|
95
|
+
let p = f.join(i);
|
|
96
|
+
return (a ? o : "") + p;
|
|
97
|
+
}
|
|
98
|
+
async function d(e, t, n = {}) {
|
|
99
|
+
let r = Math.max(1, n.chunkRows ?? 5e3), i = e.length - 1, a = [];
|
|
100
|
+
for (let o = 1; o < e.length; o++) {
|
|
101
|
+
s(n.signal);
|
|
102
|
+
let l = e[o], u = {};
|
|
103
|
+
for (let e of t) u[e] = l[e];
|
|
104
|
+
a.push(u), o > 0 && o % r === 0 && (n.onProgress?.({
|
|
105
|
+
phase: "serialize",
|
|
106
|
+
ratio: o / i,
|
|
107
|
+
row: o,
|
|
108
|
+
total: i
|
|
109
|
+
}), await c());
|
|
110
|
+
}
|
|
111
|
+
return n.onProgress?.({
|
|
112
|
+
phase: "serialize",
|
|
113
|
+
ratio: 1,
|
|
114
|
+
row: i,
|
|
115
|
+
total: i
|
|
116
|
+
}), JSON.stringify(a, null, 2);
|
|
117
|
+
}
|
|
118
|
+
function f(e) {
|
|
119
|
+
return (e == null ? "" : e instanceof Date ? e.toISOString() : String(e)).replace(/\\/g, "\\\\").replace(/\|/g, "\\|").replace(/\r?\n/g, "<br>");
|
|
120
|
+
}
|
|
121
|
+
async function p(e, t, n = {}) {
|
|
122
|
+
let r = Math.max(1, n.chunkRows ?? 5e3), i = e.length, a = n.align ?? {}, o = e[0], l = `| ${t.map((e) => f(o?.[e])).join(" | ")} |`, u = `| ${t.map((e) => {
|
|
123
|
+
let t = a[e];
|
|
124
|
+
return t === "right" ? "---:" : t === "center" ? ":--:" : "---";
|
|
125
|
+
}).join(" | ")} |`, d = [];
|
|
126
|
+
for (let a = 1; a < e.length; a++) {
|
|
127
|
+
s(n.signal);
|
|
128
|
+
let o = e[a];
|
|
129
|
+
d.push(`| ${t.map((e) => f(o[e])).join(" | ")} |`), a > 0 && a % r === 0 && (n.onProgress?.({
|
|
130
|
+
phase: "serialize",
|
|
131
|
+
ratio: a / i,
|
|
132
|
+
row: a,
|
|
133
|
+
total: i
|
|
134
|
+
}), await c());
|
|
135
|
+
}
|
|
136
|
+
return n.onProgress?.({
|
|
137
|
+
phase: "serialize",
|
|
138
|
+
ratio: 1,
|
|
139
|
+
row: i,
|
|
140
|
+
total: i
|
|
141
|
+
}), [
|
|
142
|
+
l,
|
|
143
|
+
u,
|
|
144
|
+
...d
|
|
145
|
+
].join("\n") + "\n";
|
|
146
|
+
}
|
|
147
|
+
function m(e, t) {
|
|
148
|
+
if (typeof document > "u" || typeof URL > "u") throw Error("@svgrid/grid: export requires a browser environment");
|
|
149
|
+
let n = URL.createObjectURL(e), r = document.createElement("a");
|
|
150
|
+
r.href = n, r.download = t, document.body.appendChild(r), r.click(), r.remove(), setTimeout(() => URL.revokeObjectURL(n), 0);
|
|
151
|
+
}
|
|
152
|
+
function h(e, t, n) {
|
|
153
|
+
if (typeof document > "u" || typeof URL > "u") throw Error("@svgrid/grid: text export requires a browser environment");
|
|
154
|
+
m(new Blob([e], { type: n }), t);
|
|
155
|
+
}
|
|
156
|
+
async function g(e) {
|
|
157
|
+
if (typeof navigator > "u" || !navigator.clipboard) throw Error("@svgrid/grid: clipboard API is unavailable in this context");
|
|
158
|
+
await navigator.clipboard.writeText(e);
|
|
159
|
+
}
|
|
160
|
+
//#endregion
|
|
161
|
+
export { g as copyTextToClipboard, h as downloadTextFile, a as projectGridRows, u as serializeDelimited, d as serializeJson, p as serializeMarkdown };
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
//#region ../grid/dist/popover.js
|
|
2
|
+
var e = [
|
|
3
|
+
"--sg-accent",
|
|
4
|
+
"--sg-on-accent",
|
|
5
|
+
"--sg-bg",
|
|
6
|
+
"--sg-fg",
|
|
7
|
+
"--sg-muted",
|
|
8
|
+
"--sg-border",
|
|
9
|
+
"--sg-header-bg",
|
|
10
|
+
"--sg-header-fg",
|
|
11
|
+
"--sg-row-hover-bg",
|
|
12
|
+
"--sg-row-alt-bg",
|
|
13
|
+
"--sg-selection-bg",
|
|
14
|
+
"--sg-selection-fg",
|
|
15
|
+
"--sg-input-bg",
|
|
16
|
+
"--sg-input-border",
|
|
17
|
+
"--sg-danger",
|
|
18
|
+
"--sg-focus-ring",
|
|
19
|
+
"--sg-radius",
|
|
20
|
+
"--sg-font",
|
|
21
|
+
"--sg-invalid-bg",
|
|
22
|
+
"--sg-invalid-border",
|
|
23
|
+
"--sg-invalid-fg",
|
|
24
|
+
"--sg-rating-on",
|
|
25
|
+
"--sg-rating-empty",
|
|
26
|
+
"--sg-rating-hover"
|
|
27
|
+
];
|
|
28
|
+
function t(t, n = e) {
|
|
29
|
+
let r = getComputedStyle(t);
|
|
30
|
+
for (let e of n) {
|
|
31
|
+
let n = r.getPropertyValue(e).trim();
|
|
32
|
+
n && t.style.setProperty(e, n);
|
|
33
|
+
}
|
|
34
|
+
return document.body.appendChild(t), { destroy() {
|
|
35
|
+
t.parentNode === document.body && document.body.removeChild(t);
|
|
36
|
+
} };
|
|
37
|
+
}
|
|
38
|
+
function n(e, t = {}) {
|
|
39
|
+
if (typeof e.animate != "function" || typeof matchMedia == "function" && matchMedia("(prefers-reduced-motion: reduce)").matches) return;
|
|
40
|
+
let n = t.up ? 6 : -6, r = t.scale ?? .97;
|
|
41
|
+
return e.animate([{
|
|
42
|
+
opacity: 0,
|
|
43
|
+
transform: `translateY(${n}px) scale(${r})`
|
|
44
|
+
}, {
|
|
45
|
+
opacity: 1,
|
|
46
|
+
transform: "translateY(0) scale(1)"
|
|
47
|
+
}], {
|
|
48
|
+
duration: t.duration ?? 140,
|
|
49
|
+
easing: "cubic-bezier(0.16, 1, 0.3, 1)"
|
|
50
|
+
}), {};
|
|
51
|
+
}
|
|
52
|
+
function r(e, t) {
|
|
53
|
+
let n = t.gap ?? 2, r = t.viewportMargin ?? 8, i = t.minHeight ?? 96, a = window.innerHeight - e.bottom - n - r, o = e.top - n - r, s = a < t.estimatedHeight && o > a, c = Math.max(i, Math.floor(s ? o : a)), l = Math.min(t.estimatedHeight, c), u = Math.max(e.width, t.minWidth ?? 0), d = e.left;
|
|
54
|
+
if (t.clampHorizontal !== !1) {
|
|
55
|
+
let e = window.innerWidth - u - 4;
|
|
56
|
+
d = Math.max(4, Math.min(d, e));
|
|
57
|
+
}
|
|
58
|
+
return {
|
|
59
|
+
top: s ? Math.max(r, e.top - n - l) : e.bottom + n,
|
|
60
|
+
left: d,
|
|
61
|
+
width: u,
|
|
62
|
+
openUpward: s,
|
|
63
|
+
maxHeight: l,
|
|
64
|
+
availHeight: c,
|
|
65
|
+
bottom: Math.round(window.innerHeight - e.top + n)
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
//#endregion
|
|
69
|
+
export { n, t as r, r as t };
|