@umriss-ui/table 0.2.4 → 0.3.1
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/CHANGELOG.md +60 -0
- package/README.md +32 -4
- package/dist/index.d.ts +226 -5
- package/dist/table.css +1 -1
- package/dist/table.js +2026 -1234
- package/package.json +3 -3
package/dist/table.js
CHANGED
|
@@ -1,492 +1,657 @@
|
|
|
1
1
|
import "./table.css";
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
import { useState as
|
|
6
|
-
import { DEFAULT_FORMATS as
|
|
7
|
-
import { jsx as
|
|
8
|
-
import { createPortal as
|
|
9
|
-
function
|
|
10
|
-
const [t, n] =
|
|
11
|
-
n((
|
|
12
|
-
const
|
|
13
|
-
return
|
|
2
|
+
var Jt = Object.defineProperty;
|
|
3
|
+
var Xt = (e, t, n) => t in e ? Jt(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
|
4
|
+
var B = (e, t, n) => Xt(e, typeof t != "symbol" ? t + "" : t, n);
|
|
5
|
+
import { useState as H, useCallback as X, useMemo as $, useRef as re, useId as se, useContext as Ue, useSyncExternalStore as Le, createContext as yt, useLayoutEffect as W } from "react";
|
|
6
|
+
import { DEFAULT_FORMATS as Ct, useVirtual as Qt, useFormats as ue, useWording as U, Checkbox as Se, DateRangePicker as Zt, FormField as rt, NumberInput as st, Popover as St, Button as ee, TagGroup as Nt, Tag as xt, Menu as At, MenuItem as Fe, MenuSeparator as en, VisuallyHidden as Re, useDensityFor as Tt, assess as tn, verdictWeight as Ee, Select as nn, Input as on, DEFAULT_WORDING as rn, Badge as Ie, useFreshness as sn } from "@umriss-ui/core";
|
|
7
|
+
import { jsx as l, jsxs as O, Fragment as Q } from "react/jsx-runtime";
|
|
8
|
+
import { createPortal as an } from "react-dom";
|
|
9
|
+
function ln(e) {
|
|
10
|
+
const [t, n] = H(/* @__PURE__ */ new Set()), o = X((u) => t.has(u), [t]), r = X((u) => {
|
|
11
|
+
n((h) => {
|
|
12
|
+
const d = new Set(h);
|
|
13
|
+
return d.has(u) ? d.delete(u) : d.add(u), d;
|
|
14
14
|
});
|
|
15
|
-
}, []),
|
|
15
|
+
}, []), s = $(
|
|
16
16
|
() => e.length > 0 && e.every((u) => t.has(u)),
|
|
17
17
|
[e, t]
|
|
18
|
-
),
|
|
19
|
-
() => !
|
|
20
|
-
[e, t,
|
|
21
|
-
),
|
|
18
|
+
), i = $(
|
|
19
|
+
() => !s && e.some((u) => t.has(u)),
|
|
20
|
+
[e, t, s]
|
|
21
|
+
), a = X(() => {
|
|
22
22
|
n((u) => {
|
|
23
|
-
const
|
|
24
|
-
return e.length > 0 && e.every((
|
|
23
|
+
const h = new Set(u);
|
|
24
|
+
return e.length > 0 && e.every((m) => h.has(m)) ? e.forEach((m) => h.delete(m)) : e.forEach((m) => h.add(m)), h;
|
|
25
25
|
});
|
|
26
|
-
}, [e]),
|
|
27
|
-
return { selected: t, isSelected: o, toggle: r, toggleAll:
|
|
26
|
+
}, [e]), c = X(() => n(/* @__PURE__ */ new Set()), []);
|
|
27
|
+
return { selected: t, isSelected: o, toggle: r, toggleAll: a, clear: c, allSelected: s, someSelected: i, count: t.size };
|
|
28
|
+
}
|
|
29
|
+
const Y = (e) => e == null || typeof e == "number" && Number.isNaN(e);
|
|
30
|
+
function Me(e) {
|
|
31
|
+
return Y(e) ? "empty" : typeof e == "string" ? "text" : typeof e == "number" ? "number" : typeof e == "boolean" ? "boolean" : e instanceof Date ? Number.isNaN(e.getTime()) ? "empty" : "date" : "other";
|
|
32
|
+
}
|
|
33
|
+
function Ft(e, t) {
|
|
34
|
+
for (const n of e) {
|
|
35
|
+
const o = Me(t(n));
|
|
36
|
+
if (o !== "empty") return o;
|
|
37
|
+
}
|
|
38
|
+
return "empty";
|
|
28
39
|
}
|
|
29
|
-
|
|
40
|
+
const Ot = (e, t) => t ?? e === "number";
|
|
41
|
+
function _e(e, t, n, o) {
|
|
42
|
+
switch (Me(e)) {
|
|
43
|
+
case "text":
|
|
44
|
+
return e;
|
|
45
|
+
case "number": {
|
|
46
|
+
const r = e;
|
|
47
|
+
return t === "percent" ? n.percent(r) : t === "count" ? n.count(r) : typeof t == "object" ? n.number(r, t.decimals) : n.number(r);
|
|
48
|
+
}
|
|
49
|
+
case "date": {
|
|
50
|
+
const r = e;
|
|
51
|
+
return t === "date" ? n.date(r) : t === "time" ? n.time(r, !1) : n.dateTime(r, !1);
|
|
52
|
+
}
|
|
53
|
+
case "boolean":
|
|
54
|
+
return e ? o.booleanYes : o.booleanNo;
|
|
55
|
+
default:
|
|
56
|
+
return null;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
function ze(e, t) {
|
|
60
|
+
if (!Y(e)) {
|
|
61
|
+
if (t) return ze(t(e));
|
|
62
|
+
switch (Me(e)) {
|
|
63
|
+
case "text":
|
|
64
|
+
return e;
|
|
65
|
+
case "number":
|
|
66
|
+
return e;
|
|
67
|
+
case "date":
|
|
68
|
+
return e.getTime();
|
|
69
|
+
case "boolean":
|
|
70
|
+
return e ? 1 : 0;
|
|
71
|
+
default:
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
const cn = "ja", un = "nein";
|
|
77
|
+
function Lt(e, t) {
|
|
78
|
+
if (!Y(e)) {
|
|
79
|
+
if (t) return Lt(t(e));
|
|
80
|
+
switch (Me(e)) {
|
|
81
|
+
case "text":
|
|
82
|
+
return e;
|
|
83
|
+
case "number":
|
|
84
|
+
return e;
|
|
85
|
+
case "date":
|
|
86
|
+
return e.toISOString();
|
|
87
|
+
case "boolean":
|
|
88
|
+
return e ? cn : un;
|
|
89
|
+
default:
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
const Je = "absent", ge = (e) => Y(e) ? Je : e instanceof Date ? `value:${e.getTime()}` : `value:${String(e)}`, it = (e) => e instanceof Date ? e.getTime() : typeof e == "number" && !Number.isNaN(e) ? e : void 0;
|
|
95
|
+
function Xe(e, t) {
|
|
96
|
+
const n = t.map(e.read).filter((c) => !Y(c) && !(c instanceof Date && Number.isNaN(c.getTime()))), o = e.aggregate;
|
|
97
|
+
if (typeof o == "function") return o(n, t);
|
|
98
|
+
if (o === "count") return n.length;
|
|
99
|
+
if (o === "distinct") return new Set(n.map(ge)).size;
|
|
100
|
+
const r = n.filter((c) => it(c) !== void 0);
|
|
101
|
+
if (r.length === 0) return;
|
|
102
|
+
const s = r.map((c) => it(c)), i = r[0] instanceof Date, a = (c) => i ? new Date(c) : c;
|
|
103
|
+
switch (o) {
|
|
104
|
+
case "sum":
|
|
105
|
+
return s.reduce((c, u) => c + u, 0);
|
|
106
|
+
case "avg":
|
|
107
|
+
return s.reduce((c, u) => c + u, 0) / s.length;
|
|
108
|
+
case "min":
|
|
109
|
+
return a(Math.min(...s));
|
|
110
|
+
case "max":
|
|
111
|
+
return a(Math.max(...s));
|
|
112
|
+
case "range":
|
|
113
|
+
return [a(Math.min(...s)), a(Math.max(...s))];
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
const Qe = 3, Ce = (e) => {
|
|
117
|
+
if (!Y(e))
|
|
118
|
+
return e instanceof Date ? e.getTime() : typeof e == "boolean" ? e ? 1 : 0 : typeof e == "number" ? e : String(e);
|
|
119
|
+
};
|
|
120
|
+
function Be(e, t, n) {
|
|
121
|
+
const o = Ce(e), r = Ce(t);
|
|
122
|
+
return o === void 0 || r === void 0 ? o === r ? 0 : o === void 0 ? 1 : -1 : typeof o == "number" && typeof r == "number" ? o - r : n(String(o), String(r));
|
|
123
|
+
}
|
|
124
|
+
function dn(e, t) {
|
|
125
|
+
const n = t.compareText ?? Ct.compareText, o = (r, s, i) => {
|
|
126
|
+
var b;
|
|
127
|
+
const a = /* @__PURE__ */ new Map(), c = t.levels[s];
|
|
128
|
+
if (!c) return [];
|
|
129
|
+
const u = /* @__PURE__ */ new Map();
|
|
130
|
+
for (const g of r) {
|
|
131
|
+
const _ = c.value(g), C = ge(_);
|
|
132
|
+
let S = u.get(C);
|
|
133
|
+
S || (S = {
|
|
134
|
+
path: JSON.stringify([...i, C]),
|
|
135
|
+
value: Y(_) ? void 0 : _,
|
|
136
|
+
level: s,
|
|
137
|
+
rows: [],
|
|
138
|
+
groups: [],
|
|
139
|
+
aggregates: {}
|
|
140
|
+
}, u.set(C, S), a.set(S, [...i, C])), S.rows.push(g);
|
|
141
|
+
}
|
|
142
|
+
for (const g of u.values())
|
|
143
|
+
for (const _ of t.aggregates ?? []) g.aggregates[_.id] = Xe(_, g.rows);
|
|
144
|
+
const h = (b = t.sort) == null ? void 0 : b.find(
|
|
145
|
+
(g) => {
|
|
146
|
+
var _;
|
|
147
|
+
return g.column === c.id || ((_ = t.aggregates) == null ? void 0 : _.some((C) => C.id === g.column));
|
|
148
|
+
}
|
|
149
|
+
), d = (h == null ? void 0 : h.direction) === "desc" ? -1 : 1, m = h !== void 0 && h.column !== c.id ? h.column : void 0, w = (g) => {
|
|
150
|
+
let _;
|
|
151
|
+
for (const C of g.rows) {
|
|
152
|
+
const S = c.order(C);
|
|
153
|
+
Ce(S) !== void 0 && (_ === void 0 || Be(S, _, n) < 0) && (_ = S);
|
|
154
|
+
}
|
|
155
|
+
return _;
|
|
156
|
+
}, k = (g) => {
|
|
157
|
+
if (m === void 0) return c.order ? w(g) : g.value;
|
|
158
|
+
const _ = g.aggregates[m];
|
|
159
|
+
return Array.isArray(_) ? _[0] : _;
|
|
160
|
+
}, p = [...u.values()].sort((g, _) => {
|
|
161
|
+
if (g.value === void 0 || _.value === void 0) return Be(g.value, _.value, n);
|
|
162
|
+
const C = k(g), S = k(_), I = Be(C, S, n);
|
|
163
|
+
return Ce(C) === void 0 || Ce(S) === void 0 ? I : I * d;
|
|
164
|
+
});
|
|
165
|
+
for (const g of p)
|
|
166
|
+
g.groups = o(g.rows, s + 1, a.get(g));
|
|
167
|
+
return p;
|
|
168
|
+
};
|
|
169
|
+
return o(e, 0, []);
|
|
170
|
+
}
|
|
171
|
+
function fn(e, t) {
|
|
172
|
+
const n = /* @__PURE__ */ new Set(), o = (r) => {
|
|
173
|
+
for (const s of r)
|
|
174
|
+
n.add(s.path), o(s.groups);
|
|
175
|
+
};
|
|
176
|
+
return o(e), t.filter((r) => n.has(r));
|
|
177
|
+
}
|
|
178
|
+
const hn = (e) => (t) => {
|
|
179
|
+
if (!(t instanceof Date) || Number.isNaN(t.getTime())) return;
|
|
180
|
+
const n = t.getFullYear(), o = t.getMonth(), r = t.getDate();
|
|
181
|
+
return e === "year" ? new Date(n, 0, 1) : e === "month" ? new Date(n, o, 1) : e === "week" ? new Date(n, o, r - (t.getDay() + 6) % 7) : new Date(n, o, r);
|
|
182
|
+
};
|
|
183
|
+
function gn(e) {
|
|
184
|
+
const t = new Date(e.getFullYear(), e.getMonth(), e.getDate() + 3 - (e.getDay() + 6) % 7), n = new Date(t.getFullYear(), 0, 4);
|
|
185
|
+
return { week: 1 + Math.round((t.getTime() - n.getTime()) / 864e5 / 7 - ((n.getDay() + 6) % 7 - 3) / 7), year: t.getFullYear() };
|
|
186
|
+
}
|
|
187
|
+
function pn(e, t, n, o) {
|
|
188
|
+
if (e === "year") return String(t.getFullYear());
|
|
189
|
+
if (e === "month") return n.month(t);
|
|
190
|
+
if (e === "week") {
|
|
191
|
+
const { week: r, year: s } = gn(t);
|
|
192
|
+
return o.calendarWeek(r, s);
|
|
193
|
+
}
|
|
194
|
+
return n.date(t);
|
|
195
|
+
}
|
|
196
|
+
function mn(e, t) {
|
|
197
|
+
const n = [], o = (r, s) => {
|
|
198
|
+
for (const i of r) {
|
|
199
|
+
const a = t.has(i.path);
|
|
200
|
+
if (i.groups.length === 0 && i.level === 0) {
|
|
201
|
+
if (n.push({ kind: "header", group: i, parents: s, continued: !1 }), !a)
|
|
202
|
+
for (const c of i.rows) n.push({ kind: "row", row: c, parents: [i], span: void 0, first: !1, continued: !1 });
|
|
203
|
+
} else i.groups.length > 0 ? (n.push({ kind: "header", group: i, parents: s, continued: !1 }), a || o(i.groups, [...s, i])) : a ? n.push({ kind: "folded", group: i, parents: s }) : i.rows.forEach((c, u) => n.push({ kind: "row", row: c, parents: s, span: i, first: u === 0, continued: !1 }));
|
|
204
|
+
}
|
|
205
|
+
};
|
|
206
|
+
return o(e, []), n;
|
|
207
|
+
}
|
|
208
|
+
function wn(e, t, n) {
|
|
209
|
+
const o = n > 0 ? n : e.length || 1, r = Math.max(1, Math.ceil(e.length / o)), s = Math.min(Math.max(1, t), r), i = e.slice((s - 1) * o, s * o);
|
|
210
|
+
return { lines: Rt(i), page: s, pageCount: r };
|
|
211
|
+
}
|
|
212
|
+
const Ze = (e) => e.flatMap((t) => t.kind === "row" ? [t.row] : []);
|
|
213
|
+
function Rt(e) {
|
|
214
|
+
const t = e[0];
|
|
215
|
+
if (!t) return [...e];
|
|
216
|
+
const n = t.parents.map((r, s) => ({
|
|
217
|
+
kind: "header",
|
|
218
|
+
group: r,
|
|
219
|
+
parents: t.parents.slice(0, s),
|
|
220
|
+
continued: !0
|
|
221
|
+
})), o = t.kind === "row" && t.span && !t.first ? { ...t, first: !0, continued: !0 } : t;
|
|
222
|
+
return [...n, o, ...e.slice(1)];
|
|
223
|
+
}
|
|
224
|
+
function et(e, t) {
|
|
30
225
|
return t != null && t.length ? [
|
|
31
226
|
...t.map((n) => e.find((o) => o.id === n)).filter((n) => n !== void 0),
|
|
32
227
|
...e.filter((n) => !t.includes(n.id))
|
|
33
228
|
] : e;
|
|
34
229
|
}
|
|
35
|
-
const
|
|
36
|
-
function
|
|
230
|
+
const ke = (e) => e == null || typeof e == "number" && Number.isNaN(e), bn = (e, t) => typeof e == "number" && typeof t == "number" ? e - t : Ct.compareText(String(e), String(t));
|
|
231
|
+
function tt(e, t, n) {
|
|
232
|
+
var x;
|
|
37
233
|
const {
|
|
38
234
|
search: o = "",
|
|
39
235
|
filter: r,
|
|
40
|
-
sort:
|
|
41
|
-
page:
|
|
42
|
-
pageSize:
|
|
43
|
-
hidden:
|
|
236
|
+
sort: s = null,
|
|
237
|
+
page: i = 1,
|
|
238
|
+
pageSize: a,
|
|
239
|
+
hidden: c,
|
|
44
240
|
order: u
|
|
45
|
-
} = n,
|
|
46
|
-
const
|
|
47
|
-
return !
|
|
48
|
-
}),
|
|
49
|
-
const
|
|
50
|
-
if (!
|
|
51
|
-
const
|
|
52
|
-
return
|
|
53
|
-
const
|
|
54
|
-
return
|
|
55
|
-
} : (
|
|
56
|
-
}).filter((
|
|
57
|
-
|
|
58
|
-
for (const
|
|
59
|
-
const
|
|
60
|
-
if (
|
|
241
|
+
} = n, h = et(t, u), d = c != null && c.length ? h.filter((A) => A.hideable === !1 || !c.includes(A.id)) : h, m = o.trim().toLowerCase(), w = t.filter((A) => A.searchable && A.value), k = (A) => !m || w.some((v) => {
|
|
242
|
+
const F = v.value(A);
|
|
243
|
+
return !ke(F) && String(F).toLowerCase().includes(m);
|
|
244
|
+
}), p = e.filter((A) => k(A) && (r ? r(A) : !0)), b = Array.isArray(s) ? s : s ? [s] : [], g = b.map((A) => {
|
|
245
|
+
const v = t.find((V) => V.id === A.column);
|
|
246
|
+
if (!v || !v.compare && !v.value) return null;
|
|
247
|
+
const F = A.direction === "asc" ? 1 : -1, L = v.compare, N = v.value;
|
|
248
|
+
return N ? (V, z) => {
|
|
249
|
+
const P = N(V), q = N(z);
|
|
250
|
+
return ke(P) || ke(q) ? ke(P) === ke(q) ? 0 : ke(P) ? 1 : -1 : (L ? L(V, z) : bn(P, q)) * F;
|
|
251
|
+
} : (V, z) => L(V, z) * F;
|
|
252
|
+
}).filter((A) => A !== null);
|
|
253
|
+
if (g.length > 0 && p.sort((A, v) => {
|
|
254
|
+
for (const F of g) {
|
|
255
|
+
const L = F(A, v);
|
|
256
|
+
if (L !== 0) return L;
|
|
61
257
|
}
|
|
62
258
|
return 0;
|
|
63
|
-
})
|
|
64
|
-
|
|
259
|
+
}), (x = n.grouping) != null && x.levels.length) {
|
|
260
|
+
const { folded: A, ...v } = n.grouping, F = dn(p, { ...v, sort: b }), L = mn(F, A), N = wn(L, i, a ?? 0);
|
|
261
|
+
return {
|
|
262
|
+
columns: d,
|
|
263
|
+
filtered: p,
|
|
264
|
+
visible: Ze(N.lines),
|
|
265
|
+
groups: F,
|
|
266
|
+
lines: L,
|
|
267
|
+
visibleLines: N.lines,
|
|
268
|
+
page: N.page,
|
|
269
|
+
pageCount: N.pageCount,
|
|
270
|
+
columnCount: d.length
|
|
271
|
+
};
|
|
272
|
+
}
|
|
273
|
+
const _ = a && a > 0 ? a : p.length || 1, C = Math.max(1, Math.ceil(p.length / _)), S = Math.min(Math.max(1, i), C), I = p.slice((S - 1) * _, S * _);
|
|
65
274
|
return {
|
|
66
|
-
columns:
|
|
67
|
-
filtered:
|
|
68
|
-
visible:
|
|
69
|
-
page:
|
|
70
|
-
pageCount:
|
|
71
|
-
columnCount:
|
|
275
|
+
columns: d,
|
|
276
|
+
filtered: p,
|
|
277
|
+
visible: I,
|
|
278
|
+
page: S,
|
|
279
|
+
pageCount: C,
|
|
280
|
+
columnCount: d.length
|
|
72
281
|
};
|
|
73
282
|
}
|
|
74
|
-
function
|
|
75
|
-
const { rowKey: o, filter: r, defaultSort:
|
|
76
|
-
var
|
|
77
|
-
return (
|
|
78
|
-
}), [
|
|
79
|
-
(
|
|
80
|
-
), [
|
|
81
|
-
if (
|
|
82
|
-
const
|
|
83
|
-
for (const
|
|
84
|
-
|
|
85
|
-
return
|
|
86
|
-
}),
|
|
87
|
-
() =>
|
|
88
|
-
search:
|
|
283
|
+
function kn(e, t, n) {
|
|
284
|
+
const { rowKey: o, filter: r, defaultSort: s = null, initialView: i, virtual: a, grouping: c } = n, [u, h] = H((i == null ? void 0 : i.search) ?? ""), [d, m] = H(() => {
|
|
285
|
+
var T;
|
|
286
|
+
return (T = i == null ? void 0 : i.sort) != null && T.length ? [...i.sort] : s ? Array.isArray(s) ? [...s] : [s] : [];
|
|
287
|
+
}), [w, k] = H((i == null ? void 0 : i.page) ?? 1), [p, b] = H(
|
|
288
|
+
(i == null ? void 0 : i.pageSize) ?? n.pageSize ?? 10
|
|
289
|
+
), [g, _] = H([]), [C, S] = H((i == null ? void 0 : i.hidden) ?? []), [I, x] = H((i == null ? void 0 : i.order) ?? []), [A, v] = H(() => {
|
|
290
|
+
if (i != null && i.widths) return { ...i.widths };
|
|
291
|
+
const T = {};
|
|
292
|
+
for (const D of t)
|
|
293
|
+
D.width !== void 0 && (T[D.id] = D.width);
|
|
294
|
+
return T;
|
|
295
|
+
}), F = a ? 0 : p, L = $(
|
|
296
|
+
() => tt(e, t, {
|
|
297
|
+
search: u,
|
|
89
298
|
filter: r,
|
|
90
299
|
sort: d,
|
|
91
|
-
page:
|
|
92
|
-
pageSize:
|
|
93
|
-
hidden:
|
|
94
|
-
order:
|
|
300
|
+
page: w,
|
|
301
|
+
pageSize: F,
|
|
302
|
+
hidden: C,
|
|
303
|
+
order: I,
|
|
304
|
+
grouping: c
|
|
95
305
|
}),
|
|
96
|
-
[e, t,
|
|
97
|
-
),
|
|
98
|
-
rowHeight: (
|
|
99
|
-
overscan:
|
|
100
|
-
}),
|
|
101
|
-
() =>
|
|
102
|
-
[
|
|
103
|
-
),
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
306
|
+
[e, t, u, r, d, w, F, C, I, c]
|
|
307
|
+
), N = Qt(a ? (L.lines ?? L.filtered).length : 0, {
|
|
308
|
+
rowHeight: (a == null ? void 0 : a.rowHeight) ?? 0,
|
|
309
|
+
overscan: a == null ? void 0 : a.overscan
|
|
310
|
+
}), V = $(
|
|
311
|
+
() => a && L.lines ? L.lines.slice(N.from, N.to) : L.visibleLines,
|
|
312
|
+
[a, L.lines, L.visibleLines, N.from, N.to]
|
|
313
|
+
), z = $(
|
|
314
|
+
() => a ? V ? Ze(V) : L.filtered.slice(N.from, N.to) : L.visible,
|
|
315
|
+
[a, V, L.filtered, L.visible, N.from, N.to]
|
|
316
|
+
), P = $(() => L.filtered.map(o), [L.filtered, o]), q = ln(P), ie = X((T) => {
|
|
317
|
+
h(T), k(1);
|
|
318
|
+
}, []), ae = X((T) => {
|
|
319
|
+
b(T), k(1);
|
|
320
|
+
}, []), de = X((T, D = !1) => {
|
|
321
|
+
m((E) => {
|
|
322
|
+
const ne = E.find((he) => he.column === T);
|
|
323
|
+
if (!D) {
|
|
324
|
+
const he = E.length === 1 && (ne == null ? void 0 : ne.direction) === "asc" ? "desc" : "asc";
|
|
325
|
+
return [{ column: T, direction: he }];
|
|
113
326
|
}
|
|
114
|
-
return
|
|
115
|
-
(
|
|
116
|
-
) :
|
|
117
|
-
}),
|
|
118
|
-
}, []),
|
|
119
|
-
|
|
120
|
-
(
|
|
327
|
+
return ne ? ne.direction === "asc" ? E.map(
|
|
328
|
+
(he) => he.column === T ? { column: T, direction: "desc" } : he
|
|
329
|
+
) : E.filter((he) => he.column !== T) : [...E, { column: T, direction: "asc" }];
|
|
330
|
+
}), k(1);
|
|
331
|
+
}, []), fe = X((T) => {
|
|
332
|
+
_(
|
|
333
|
+
(D) => D.includes(T) ? D.filter((E) => E !== T) : [...D, T]
|
|
121
334
|
);
|
|
122
|
-
}, []),
|
|
123
|
-
(
|
|
124
|
-
[
|
|
125
|
-
),
|
|
126
|
-
|
|
127
|
-
(
|
|
335
|
+
}, []), we = X(
|
|
336
|
+
(T) => g.includes(T),
|
|
337
|
+
[g]
|
|
338
|
+
), be = X((T) => {
|
|
339
|
+
S(
|
|
340
|
+
(D) => D.includes(T) ? D.filter((E) => E !== T) : [...D, T]
|
|
128
341
|
);
|
|
129
|
-
}, []),
|
|
130
|
-
|
|
131
|
-
if (
|
|
132
|
-
if (!(
|
|
133
|
-
const
|
|
134
|
-
return delete
|
|
342
|
+
}, []), ye = X((T, D) => {
|
|
343
|
+
v((E) => {
|
|
344
|
+
if (D === void 0) {
|
|
345
|
+
if (!(T in E)) return E;
|
|
346
|
+
const ne = { ...E };
|
|
347
|
+
return delete ne[T], ne;
|
|
135
348
|
}
|
|
136
|
-
return { ...
|
|
349
|
+
return { ...E, [T]: D };
|
|
137
350
|
});
|
|
138
|
-
}, []),
|
|
139
|
-
(
|
|
140
|
-
var
|
|
141
|
-
return (
|
|
351
|
+
}, []), le = X(
|
|
352
|
+
(T) => {
|
|
353
|
+
var D;
|
|
354
|
+
return (D = d.find((E) => E.column === T)) == null ? void 0 : D.direction;
|
|
142
355
|
},
|
|
143
356
|
[d]
|
|
144
|
-
),
|
|
145
|
-
(
|
|
357
|
+
), te = X(
|
|
358
|
+
(T) => {
|
|
146
359
|
if (d.length < 2) return;
|
|
147
|
-
const
|
|
148
|
-
return
|
|
360
|
+
const D = d.findIndex((E) => E.column === T);
|
|
361
|
+
return D === -1 ? void 0 : D + 1;
|
|
149
362
|
},
|
|
150
363
|
[d]
|
|
151
|
-
),
|
|
152
|
-
() =>
|
|
153
|
-
[t,
|
|
154
|
-
),
|
|
155
|
-
const
|
|
156
|
-
for (const
|
|
157
|
-
|
|
158
|
-
return
|
|
159
|
-
}, [t]),
|
|
160
|
-
const
|
|
161
|
-
for (const [
|
|
162
|
-
|
|
163
|
-
return
|
|
164
|
-
}, [
|
|
165
|
-
() =>
|
|
166
|
-
[
|
|
167
|
-
),
|
|
168
|
-
(
|
|
169
|
-
var
|
|
170
|
-
return
|
|
364
|
+
), y = $(
|
|
365
|
+
() => et(t, I).filter((T) => T.label !== void 0 && T.hideable !== !1).map((T) => ({ id: T.id, label: T.label, visible: !C.includes(T.id) })),
|
|
366
|
+
[t, I, C]
|
|
367
|
+
), R = n.pageSize ?? 10, K = $(() => {
|
|
368
|
+
const T = {};
|
|
369
|
+
for (const D of t)
|
|
370
|
+
D.width !== void 0 && (T[D.id] = D.width);
|
|
371
|
+
return T;
|
|
372
|
+
}, [t]), j = $(() => {
|
|
373
|
+
const T = {};
|
|
374
|
+
for (const [D, E] of Object.entries(A))
|
|
375
|
+
K[D] !== E && (T[D] = E);
|
|
376
|
+
return T;
|
|
377
|
+
}, [A, K]), M = $(
|
|
378
|
+
() => s ? Array.isArray(s) ? s : [s] : [],
|
|
379
|
+
[s]
|
|
380
|
+
), J = d.length === M.length && d.every(
|
|
381
|
+
(T, D) => {
|
|
382
|
+
var E, ne;
|
|
383
|
+
return T.column === ((E = M[D]) == null ? void 0 : E.column) && T.direction === ((ne = M[D]) == null ? void 0 : ne.direction);
|
|
171
384
|
}
|
|
172
|
-
),
|
|
385
|
+
), Z = $(
|
|
173
386
|
() => ({
|
|
174
|
-
...
|
|
175
|
-
...d.length && !
|
|
387
|
+
...u ? { search: u } : {},
|
|
388
|
+
...d.length && !J ? { sort: d } : {},
|
|
176
389
|
/* Without paging there is no page a view could carry - a page three in
|
|
177
390
|
the view of a virtualised table would be a promise nobody redeems on
|
|
178
391
|
opening. */
|
|
179
|
-
...!
|
|
180
|
-
...!
|
|
181
|
-
...
|
|
182
|
-
...
|
|
183
|
-
...Object.keys(
|
|
392
|
+
...!a && L.page > 1 ? { page: L.page } : {},
|
|
393
|
+
...!a && p !== R ? { pageSize: p } : {},
|
|
394
|
+
...C.length ? { hidden: C } : {},
|
|
395
|
+
...I.length ? { order: I } : {},
|
|
396
|
+
...Object.keys(j).length ? { widths: j } : {}
|
|
184
397
|
}),
|
|
185
398
|
[
|
|
186
|
-
l,
|
|
187
399
|
a,
|
|
400
|
+
u,
|
|
188
401
|
d,
|
|
189
|
-
|
|
190
|
-
|
|
402
|
+
J,
|
|
403
|
+
L.page,
|
|
191
404
|
p,
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
405
|
+
R,
|
|
406
|
+
C,
|
|
407
|
+
I,
|
|
408
|
+
j
|
|
196
409
|
]
|
|
197
410
|
);
|
|
198
411
|
return {
|
|
199
|
-
...
|
|
200
|
-
visible:
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
412
|
+
...L,
|
|
413
|
+
visible: z,
|
|
414
|
+
visibleLines: V,
|
|
415
|
+
virtual: a ? N : void 0,
|
|
416
|
+
view: Z,
|
|
417
|
+
search: u,
|
|
418
|
+
setSearch: ie,
|
|
205
419
|
sort: d,
|
|
206
|
-
toggleSort:
|
|
207
|
-
sortDirectionOf:
|
|
208
|
-
sortRankOf:
|
|
209
|
-
setPage:
|
|
420
|
+
toggleSort: de,
|
|
421
|
+
sortDirectionOf: le,
|
|
422
|
+
sortRankOf: te,
|
|
423
|
+
setPage: k,
|
|
210
424
|
pageSize: p,
|
|
211
|
-
setPageSize:
|
|
212
|
-
expanded:
|
|
213
|
-
toggleRow:
|
|
214
|
-
isExpanded:
|
|
215
|
-
hidden:
|
|
216
|
-
toggleColumn:
|
|
217
|
-
columnChoices:
|
|
218
|
-
order:
|
|
219
|
-
setOrder:
|
|
220
|
-
widths:
|
|
221
|
-
setWidth:
|
|
222
|
-
selection:
|
|
425
|
+
setPageSize: ae,
|
|
426
|
+
expanded: g,
|
|
427
|
+
toggleRow: fe,
|
|
428
|
+
isExpanded: we,
|
|
429
|
+
hidden: C,
|
|
430
|
+
toggleColumn: be,
|
|
431
|
+
columnChoices: y,
|
|
432
|
+
order: I,
|
|
433
|
+
setOrder: x,
|
|
434
|
+
widths: A,
|
|
435
|
+
setWidth: ye,
|
|
436
|
+
selection: q
|
|
223
437
|
};
|
|
224
438
|
}
|
|
225
|
-
function
|
|
439
|
+
function vn() {
|
|
226
440
|
var t;
|
|
227
441
|
const e = import.meta;
|
|
228
442
|
return typeof ((t = e.env) == null ? void 0 : t.DEV) == "boolean" ? e.env.DEV : typeof process < "u" && (process != null && process.env) ? process.env.NODE_ENV !== "production" : !1;
|
|
229
443
|
}
|
|
230
|
-
const
|
|
231
|
-
function
|
|
232
|
-
!
|
|
233
|
-
}
|
|
234
|
-
const
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
striped: en,
|
|
322
|
-
stickyCell: tn,
|
|
323
|
-
sortButton: nn,
|
|
324
|
-
sortIndicator: on,
|
|
325
|
-
sortArrow: rn,
|
|
326
|
-
sortArrowDesc: sn,
|
|
327
|
-
sortActive: ln,
|
|
328
|
-
sortRank: cn,
|
|
329
|
-
thFlex: an,
|
|
330
|
-
footerKind: dn,
|
|
331
|
-
emptyCell: un,
|
|
332
|
-
empty: fn,
|
|
333
|
-
emptyTitle: hn,
|
|
334
|
-
skeleton: mn,
|
|
335
|
-
toolbar: pn,
|
|
336
|
-
toolbarGroup: gn,
|
|
337
|
-
toolbarInfo: bn,
|
|
338
|
-
pagination: wn,
|
|
339
|
-
paginationControls: _n,
|
|
340
|
-
pageSize: vn,
|
|
341
|
-
paginationStatus: kn,
|
|
342
|
-
filterButton: yn,
|
|
343
|
-
filterActive: Cn,
|
|
344
|
-
filterPanel: Sn,
|
|
345
|
-
filterContent: Nn,
|
|
346
|
-
filterFooter: An,
|
|
347
|
-
filterLabel: xn,
|
|
348
|
-
filterValue: Tn,
|
|
349
|
-
filteredCount: On,
|
|
350
|
-
rangeFields: Rn,
|
|
351
|
-
rangePeriod: In,
|
|
352
|
-
conditions: Fn,
|
|
353
|
-
conditionButton: Ln,
|
|
354
|
-
condition: zn,
|
|
355
|
-
columnsPanel: jn,
|
|
356
|
-
columnsList: En,
|
|
357
|
-
columnsEntry: Pn,
|
|
358
|
-
move: Mn,
|
|
359
|
-
expander: Dn,
|
|
360
|
-
expanderOpen: Vn,
|
|
361
|
-
detailRow: Hn,
|
|
362
|
-
detailCell: Bn,
|
|
363
|
-
actionsCell: $n,
|
|
364
|
-
actions: Wn,
|
|
365
|
-
grip: Kn,
|
|
366
|
-
virtualBody: Gn,
|
|
367
|
-
virtualRow: Un,
|
|
368
|
-
fillerRow: qn,
|
|
369
|
-
control: Yn
|
|
444
|
+
const Mt = vn(), at = /* @__PURE__ */ new Set();
|
|
445
|
+
function pe(e, t) {
|
|
446
|
+
!Mt || at.has(e) || (at.add(e), console.warn(`@umriss-ui/table: ${t}`));
|
|
447
|
+
}
|
|
448
|
+
const _n = "_frame_1wkkr_11 _text_1hv7a_23", yn = "_children_1wkkr_23", Cn = "_scroll_1wkkr_29 _scroll_1hv7a_40", Sn = "_footerTarget_1wkkr_36", Nn = "_table_1wkkr_40", xn = "_th_1wkkr_48 _ring_1hv7a_65", An = "_sticky_1wkkr_63", Tn = "_td_1wkkr_71", Fn = "_rowHeader_1wkkr_83", On = "_compact_1wkkr_99", Ln = "_numeric_1wkkr_114", Rn = "_absent_1wkkr_126", Mn = "_striped_1wkkr_130", Vn = "_stickyCell_1wkkr_154", Dn = "_sortButton_1wkkr_166 _ring_1hv7a_65", In = "_sortIndicator_1wkkr_191", Bn = "_sortArrow_1wkkr_198", Pn = "_sortArrowDesc_1wkkr_202", Gn = "_sortActive_1wkkr_210", En = "_sortRank_1wkkr_216", zn = "_thFlex_1wkkr_224", jn = "_footerKind_1wkkr_245", Hn = "_emptyCell_1wkkr_253", $n = "_empty_1wkkr_253", Kn = "_emptyTitle_1wkkr_269", Wn = "_skeleton_1wkkr_276", qn = "_toolbar_1wkkr_304 _text_1hv7a_23", Yn = "_toolbarGroup_1wkkr_318", Un = "_toolbarInfo_1wkkr_335", Jn = "_pagination_1wkkr_341 _text_1hv7a_23", Xn = "_paginationControls_1wkkr_354", Qn = "_pageSize_1wkkr_361", Zn = "_paginationStatus_1wkkr_373", eo = "_filterButton_1wkkr_382 _ring_1hv7a_65", to = "_filterActive_1wkkr_405", no = "_filterPanel_1wkkr_410", oo = "_filterContent_1wkkr_423 _scroll_1hv7a_40", ro = "_filterFooter_1wkkr_434", so = "_filterLabel_1wkkr_448", io = "_filterValue_1wkkr_458", ao = "_filteredCount_1wkkr_464", lo = "_rangeFields_1wkkr_475", co = "_rangePeriod_1wkkr_485", uo = "_conditions_1wkkr_491", fo = "_conditionButton_1wkkr_497", ho = "_condition_1wkkr_491", go = "_columnsPanel_1wkkr_521", po = "_columnsList_1wkkr_529", mo = "_columnsEntry_1wkkr_538", wo = "_move_1wkkr_550", bo = "_groupingChoice_1wkkr_585", ko = "_groupingHeading_1wkkr_591", vo = "_groupingOptions_1wkkr_600", _o = "_groupingOption_1wkkr_600 _ring_1hv7a_65", yo = "_groupingLevel_1wkkr_639", Co = "_groupingTag_1wkkr_644", So = "_groupingTrigger_1wkkr_651", No = "_groupingPrefix_1wkkr_656", xo = "_groupingPath_1wkkr_661", Ao = "_groupingSeparator_1wkkr_665", To = "_groupHeader_1wkkr_682", Fo = "_spanCell_1wkkr_723", Oo = "_groupFolded_1wkkr_772", Lo = "_spanValue_1wkkr_776", Ro = "_groupLabel_1wkkr_777", Mo = "_spanText_1wkkr_789", Vo = "_groupValue_1wkkr_790", Do = "_groupCount_1wkkr_797", Io = "_continued_1wkkr_811", Bo = "_spanSelect_1wkkr_842", Po = "_fold_1wkkr_856", Go = "_foldClosed_1wkkr_888", Eo = "_foldedCount_1wkkr_898", zo = "_shareHost_1wkkr_906", jo = "_shareBar_1wkkr_913", Ho = "_expander_1wkkr_925", $o = "_expanderOpen_1wkkr_956", Ko = "_detailRow_1wkkr_960", Wo = "_detailCell_1wkkr_960", qo = "_actionsCell_1wkkr_968", Yo = "_actions_1wkkr_968", Uo = "_grip_1wkkr_996", Jo = "_virtualBody_1wkkr_1037", Xo = "_virtualRow_1wkkr_1045", Qo = "_fillerRow_1wkkr_1050", Zo = "_control_1wkkr_145", f = {
|
|
449
|
+
frame: _n,
|
|
450
|
+
children: yn,
|
|
451
|
+
scroll: Cn,
|
|
452
|
+
footerTarget: Sn,
|
|
453
|
+
table: Nn,
|
|
454
|
+
th: xn,
|
|
455
|
+
sticky: An,
|
|
456
|
+
td: Tn,
|
|
457
|
+
rowHeader: Fn,
|
|
458
|
+
compact: On,
|
|
459
|
+
numeric: Ln,
|
|
460
|
+
absent: Rn,
|
|
461
|
+
striped: Mn,
|
|
462
|
+
stickyCell: Vn,
|
|
463
|
+
sortButton: Dn,
|
|
464
|
+
sortIndicator: In,
|
|
465
|
+
sortArrow: Bn,
|
|
466
|
+
sortArrowDesc: Pn,
|
|
467
|
+
sortActive: Gn,
|
|
468
|
+
sortRank: En,
|
|
469
|
+
thFlex: zn,
|
|
470
|
+
footerKind: jn,
|
|
471
|
+
emptyCell: Hn,
|
|
472
|
+
empty: $n,
|
|
473
|
+
emptyTitle: Kn,
|
|
474
|
+
skeleton: Wn,
|
|
475
|
+
toolbar: qn,
|
|
476
|
+
toolbarGroup: Yn,
|
|
477
|
+
toolbarInfo: Un,
|
|
478
|
+
pagination: Jn,
|
|
479
|
+
paginationControls: Xn,
|
|
480
|
+
pageSize: Qn,
|
|
481
|
+
paginationStatus: Zn,
|
|
482
|
+
filterButton: eo,
|
|
483
|
+
filterActive: to,
|
|
484
|
+
filterPanel: no,
|
|
485
|
+
filterContent: oo,
|
|
486
|
+
filterFooter: ro,
|
|
487
|
+
filterLabel: so,
|
|
488
|
+
filterValue: io,
|
|
489
|
+
filteredCount: ao,
|
|
490
|
+
rangeFields: lo,
|
|
491
|
+
rangePeriod: co,
|
|
492
|
+
conditions: uo,
|
|
493
|
+
conditionButton: fo,
|
|
494
|
+
condition: ho,
|
|
495
|
+
columnsPanel: go,
|
|
496
|
+
columnsList: po,
|
|
497
|
+
columnsEntry: mo,
|
|
498
|
+
move: wo,
|
|
499
|
+
groupingChoice: bo,
|
|
500
|
+
groupingHeading: ko,
|
|
501
|
+
groupingOptions: vo,
|
|
502
|
+
groupingOption: _o,
|
|
503
|
+
groupingLevel: yo,
|
|
504
|
+
groupingTag: Co,
|
|
505
|
+
groupingTrigger: So,
|
|
506
|
+
groupingPrefix: No,
|
|
507
|
+
groupingPath: xo,
|
|
508
|
+
groupingSeparator: Ao,
|
|
509
|
+
groupHeader: To,
|
|
510
|
+
spanCell: Fo,
|
|
511
|
+
groupFolded: Oo,
|
|
512
|
+
spanValue: Lo,
|
|
513
|
+
groupLabel: Ro,
|
|
514
|
+
spanText: Mo,
|
|
515
|
+
groupValue: Vo,
|
|
516
|
+
groupCount: Do,
|
|
517
|
+
continued: Io,
|
|
518
|
+
spanSelect: Bo,
|
|
519
|
+
fold: Po,
|
|
520
|
+
foldClosed: Go,
|
|
521
|
+
foldedCount: Eo,
|
|
522
|
+
shareHost: zo,
|
|
523
|
+
shareBar: jo,
|
|
524
|
+
expander: Ho,
|
|
525
|
+
expanderOpen: $o,
|
|
526
|
+
detailRow: Ko,
|
|
527
|
+
detailCell: Wo,
|
|
528
|
+
actionsCell: qo,
|
|
529
|
+
actions: Yo,
|
|
530
|
+
grip: Uo,
|
|
531
|
+
virtualBody: Jo,
|
|
532
|
+
virtualRow: Xo,
|
|
533
|
+
fillerRow: Qo,
|
|
534
|
+
control: Zo
|
|
370
535
|
};
|
|
371
|
-
function
|
|
536
|
+
function Js(e) {
|
|
372
537
|
return e;
|
|
373
538
|
}
|
|
374
|
-
const
|
|
375
|
-
function
|
|
376
|
-
return
|
|
539
|
+
const Ne = /* @__PURE__ */ new WeakMap();
|
|
540
|
+
function Vt(e, t) {
|
|
541
|
+
return Ne.set(e, t), e;
|
|
377
542
|
}
|
|
378
|
-
const
|
|
379
|
-
function
|
|
380
|
-
return e === "list" ?
|
|
543
|
+
const er = (e) => Ne.has(e);
|
|
544
|
+
function me(e) {
|
|
545
|
+
return e === "list" ? sr : e === "range" ? hr : typeof e == "object" && e !== null ? e : void 0;
|
|
381
546
|
}
|
|
382
|
-
function
|
|
547
|
+
function Dt(e, t) {
|
|
383
548
|
if (t == null) return "empty";
|
|
384
|
-
const n =
|
|
549
|
+
const n = Ne.get(e);
|
|
385
550
|
return n ? n.isCondition(t) ? n.isEmpty(t) ? "empty" : "effective" : "foreign" : "effective";
|
|
386
551
|
}
|
|
387
|
-
function
|
|
552
|
+
function tr(e, t, n) {
|
|
388
553
|
var o;
|
|
389
|
-
return
|
|
554
|
+
return Y(t) ? ((o = Ne.get(e)) == null ? void 0 : o.absentMatches(n)) ?? !1 : e.matches(t, n);
|
|
390
555
|
}
|
|
391
|
-
function
|
|
392
|
-
const o =
|
|
556
|
+
function nr(e, t, n) {
|
|
557
|
+
const o = Ne.get(e);
|
|
393
558
|
return o ? o.describeIn(t, n) : e.describe(t);
|
|
394
559
|
}
|
|
395
|
-
const
|
|
396
|
-
const o =
|
|
560
|
+
const lt = (e) => e instanceof Date ? e.getTime() : typeof e == "number" ? e : void 0, It = (e) => (t, n) => {
|
|
561
|
+
const o = lt(t.value), r = lt(n.value);
|
|
397
562
|
return o !== void 0 && r !== void 0 ? o - r : e.compareText(t.text, n.text);
|
|
398
563
|
};
|
|
399
|
-
function
|
|
564
|
+
function or(e, t, n) {
|
|
400
565
|
const o = /* @__PURE__ */ new Map();
|
|
401
566
|
let r = !1;
|
|
402
|
-
for (const
|
|
403
|
-
const
|
|
404
|
-
if (
|
|
567
|
+
for (const i of e) {
|
|
568
|
+
const a = t(i);
|
|
569
|
+
if (Y(a)) {
|
|
405
570
|
r = !0;
|
|
406
571
|
continue;
|
|
407
572
|
}
|
|
408
|
-
const
|
|
409
|
-
o.has(
|
|
573
|
+
const c = a instanceof Date ? `date:${a.getTime()}` : typeof a == "object" || typeof a == "function" ? a : `${typeof a}:${String(a)}`;
|
|
574
|
+
o.has(c) || o.set(c, a);
|
|
410
575
|
}
|
|
411
|
-
return { values: [...o.values()].map((
|
|
576
|
+
return { values: [...o.values()].map((i) => ({ value: i, text: String(i) })).sort(It(n)).map(({ value: i }) => i), absent: r };
|
|
412
577
|
}
|
|
413
|
-
const
|
|
414
|
-
function
|
|
415
|
-
let t =
|
|
416
|
-
return t || (t = new Set(e.map(
|
|
578
|
+
const ct = /* @__PURE__ */ new WeakMap();
|
|
579
|
+
function je(e) {
|
|
580
|
+
let t = ct.get(e);
|
|
581
|
+
return t || (t = new Set(e.map(ge)), ct.set(e, t)), t;
|
|
417
582
|
}
|
|
418
|
-
const
|
|
419
|
-
function
|
|
583
|
+
const He = (e, t) => Y(e) ? t.wording.cellAbsentValue : _e(e, t.format, t.formats, t.wording) ?? String(e);
|
|
584
|
+
function rr({
|
|
420
585
|
condition: e,
|
|
421
586
|
setCondition: t,
|
|
422
587
|
values: n,
|
|
423
588
|
absentOccurs: o = !1,
|
|
424
589
|
format: r
|
|
425
590
|
}) {
|
|
426
|
-
const
|
|
427
|
-
const
|
|
428
|
-
|
|
429
|
-
const
|
|
430
|
-
return [...
|
|
431
|
-
}, [n,
|
|
432
|
-
const
|
|
433
|
-
t(
|
|
591
|
+
const s = ue(), i = U(), a = $(() => e ?? [], [e]), c = $(() => {
|
|
592
|
+
const d = { formats: s, wording: i, format: r }, m = n.map((b) => ({ key: ge(b), text: He(b, d), value: b }));
|
|
593
|
+
m.sort(It(s));
|
|
594
|
+
const w = new Set(m.map((b) => b.key)), k = a.filter((b) => !Y(b) && !w.has(ge(b))).map((b) => ({ key: ge(b), text: He(b, d), value: b })), p = o || a.some(Y) ? [{ key: Je, text: i.cellAbsentValue, value: null }] : [];
|
|
595
|
+
return [...m, ...k, ...p];
|
|
596
|
+
}, [n, a, o, r, s, i]), u = je(a), h = (d) => {
|
|
597
|
+
const m = u.has(d.key) ? a.filter((w) => ge(w) !== d.key) : [...a, d.value];
|
|
598
|
+
t(m.length > 0 ? m : null);
|
|
434
599
|
};
|
|
435
|
-
return /* @__PURE__ */
|
|
436
|
-
|
|
600
|
+
return /* @__PURE__ */ l("div", { className: f.filterContent, children: c.map((d) => /* @__PURE__ */ l(
|
|
601
|
+
Se,
|
|
437
602
|
{
|
|
438
|
-
label:
|
|
439
|
-
checked: u.has(
|
|
440
|
-
onChange: () => d
|
|
603
|
+
label: d.text,
|
|
604
|
+
checked: u.has(d.key),
|
|
605
|
+
onChange: () => h(d)
|
|
441
606
|
},
|
|
442
|
-
|
|
607
|
+
d.key
|
|
443
608
|
)) });
|
|
444
609
|
}
|
|
445
|
-
const
|
|
610
|
+
const sr = Vt(
|
|
446
611
|
{
|
|
447
|
-
matches: (e, t) =>
|
|
448
|
-
Input:
|
|
449
|
-
describe: (e) => e.map((t) =>
|
|
612
|
+
matches: (e, t) => je(t).has(ge(e)),
|
|
613
|
+
Input: rr,
|
|
614
|
+
describe: (e) => e.map((t) => Y(t) ? "–" : String(t)).join(", ")
|
|
450
615
|
},
|
|
451
616
|
{
|
|
452
617
|
isCondition: (e) => Array.isArray(e),
|
|
453
618
|
isEmpty: (e) => e.length === 0,
|
|
454
|
-
absentMatches: (e) =>
|
|
619
|
+
absentMatches: (e) => je(e).has(Je),
|
|
455
620
|
/* From three values on the first two and how many more: a condition is one
|
|
456
621
|
line in the table toolbar, not a list. */
|
|
457
622
|
describeIn: (e, t) => {
|
|
458
|
-
const n = e.map((r) =>
|
|
623
|
+
const n = e.map((r) => He(r, t));
|
|
459
624
|
if (n.length <= 2) return n.join(", ");
|
|
460
625
|
const o = n.length - 2;
|
|
461
626
|
return `${n.slice(0, 2).join(", ")} ${t.wording.moreValues(o, t.formats.count(o))}`;
|
|
462
627
|
}
|
|
463
628
|
}
|
|
464
|
-
),
|
|
465
|
-
function
|
|
466
|
-
const n =
|
|
467
|
-
const
|
|
468
|
-
if (
|
|
469
|
-
r(
|
|
629
|
+
), ir = (e) => new Date(e.getFullYear(), e.getMonth(), e.getDate()).getTime(), ar = (e) => new Date(e.getFullYear(), e.getMonth(), e.getDate() + 1).getTime(), ve = (e) => typeof e == "number" && Number.isFinite(e), ce = (e) => e instanceof Date && !Number.isNaN(e.getTime()), lr = (e) => ce(e) ? ir(e) : ve(e) ? e : void 0, cr = (e) => ce(e) ? { value: ar(e), open: !0 } : ve(e) ? { value: e, open: !1 } : void 0, Ae = (e, t) => ce(e) ? t.formats.date(e) : _e(e, t.format, t.formats, t.wording) ?? String(e);
|
|
630
|
+
function ur({ condition: e, setCondition: t }) {
|
|
631
|
+
const n = U(), [o, r] = H(null), s = o !== null, i = o ? o.from : ve(e == null ? void 0 : e.from) ? e.from : null, a = o ? o.to : ve(e == null ? void 0 : e.to) ? e.to : null, c = (u, h) => {
|
|
632
|
+
const d = { from: i, to: a, [u]: h };
|
|
633
|
+
if (d.from !== null && d.to !== null && d.from > d.to) {
|
|
634
|
+
r(d);
|
|
470
635
|
return;
|
|
471
636
|
}
|
|
472
|
-
if (r(null),
|
|
637
|
+
if (r(null), d.from === null && d.to === null) {
|
|
473
638
|
t(null);
|
|
474
639
|
return;
|
|
475
640
|
}
|
|
476
641
|
t({
|
|
477
|
-
...
|
|
478
|
-
...
|
|
642
|
+
...d.from !== null ? { from: d.from } : {},
|
|
643
|
+
...d.to !== null ? { to: d.to } : {}
|
|
479
644
|
});
|
|
480
645
|
};
|
|
481
|
-
return /* @__PURE__ */
|
|
482
|
-
/* @__PURE__ */
|
|
483
|
-
/* @__PURE__ */
|
|
646
|
+
return /* @__PURE__ */ O("div", { className: f.rangeFields, children: [
|
|
647
|
+
/* @__PURE__ */ l(rt, { label: n.filterFrom, children: /* @__PURE__ */ l(st, { size: "sm", value: i, invalid: s, onChange: (u) => c("from", u) }) }),
|
|
648
|
+
/* @__PURE__ */ l(rt, { label: n.filterTo, error: s ? n.rangeInvalid : void 0, children: /* @__PURE__ */ l(st, { size: "sm", value: a, onChange: (u) => c("to", u) }) })
|
|
484
649
|
] });
|
|
485
650
|
}
|
|
486
|
-
function
|
|
487
|
-
const n =
|
|
488
|
-
return /* @__PURE__ */
|
|
489
|
-
|
|
651
|
+
function dr({ condition: e, setCondition: t }) {
|
|
652
|
+
const n = ce(e == null ? void 0 : e.from) && ce(e == null ? void 0 : e.to) ? { from: e.from, to: e.to } : null;
|
|
653
|
+
return /* @__PURE__ */ l("div", { className: f.rangePeriod, children: /* @__PURE__ */ l(
|
|
654
|
+
Zt,
|
|
490
655
|
{
|
|
491
656
|
size: "sm",
|
|
492
657
|
clearable: !0,
|
|
@@ -495,46 +660,46 @@ function lo({ condition: e, setCondition: t }) {
|
|
|
495
660
|
}
|
|
496
661
|
) });
|
|
497
662
|
}
|
|
498
|
-
function
|
|
499
|
-
return e.kind === "date" ? /* @__PURE__ */
|
|
663
|
+
function fr(e) {
|
|
664
|
+
return e.kind === "date" ? /* @__PURE__ */ l(dr, { ...e }) : /* @__PURE__ */ l(ur, { ...e });
|
|
500
665
|
}
|
|
501
|
-
const
|
|
666
|
+
const hr = Vt(
|
|
502
667
|
{
|
|
503
668
|
matches: (e, t) => {
|
|
504
|
-
const n =
|
|
669
|
+
const n = ce(e) ? e.getTime() : ve(e) ? e : void 0;
|
|
505
670
|
if (n === void 0) return !1;
|
|
506
|
-
const o =
|
|
671
|
+
const o = lr(t.from), r = cr(t.to);
|
|
507
672
|
return !(o !== void 0 && n < o || r !== void 0 && (r.open ? n >= r.value : n > r.value));
|
|
508
673
|
},
|
|
509
|
-
Input:
|
|
674
|
+
Input: fr,
|
|
510
675
|
describe: (e) => [e.from, e.to].map((t) => t === void 0 ? "" : String(t)).join("–")
|
|
511
676
|
},
|
|
512
677
|
{
|
|
513
678
|
isCondition: (e) => typeof e != "object" || e === null || Array.isArray(e) || e instanceof Date ? !1 : Object.entries(e).every(
|
|
514
|
-
([n, o]) => (n === "from" || n === "to") && (o === void 0 ||
|
|
679
|
+
([n, o]) => (n === "from" || n === "to") && (o === void 0 || ve(o) || ce(o))
|
|
515
680
|
),
|
|
516
681
|
isEmpty: (e) => e.from === void 0 && e.to === void 0,
|
|
517
682
|
absentMatches: () => !1,
|
|
518
683
|
describeIn: (e, t) => {
|
|
519
684
|
const { from: n, to: o } = e;
|
|
520
685
|
if (n !== void 0 && o !== void 0) {
|
|
521
|
-
const r =
|
|
686
|
+
const r = ce(n) && ce(o) && n.getFullYear() === o.getFullYear();
|
|
522
687
|
return t.wording.rangeFromTo(
|
|
523
|
-
r ? t.formats.dateShort(n) :
|
|
524
|
-
|
|
688
|
+
r ? t.formats.dateShort(n) : Ae(n, t),
|
|
689
|
+
Ae(o, t)
|
|
525
690
|
);
|
|
526
691
|
}
|
|
527
|
-
return n !== void 0 ? t.wording.rangeFrom(
|
|
692
|
+
return n !== void 0 ? t.wording.rangeFrom(Ae(n, t)) : o === void 0 ? "" : t.wording.rangeTo(Ae(o, t));
|
|
528
693
|
}
|
|
529
694
|
}
|
|
530
695
|
);
|
|
531
|
-
class
|
|
696
|
+
class Pe {
|
|
532
697
|
constructor(t) {
|
|
533
|
-
|
|
698
|
+
B(this, "entries", /* @__PURE__ */ new Map());
|
|
534
699
|
/** Keys in the order of the running pass. */
|
|
535
|
-
|
|
700
|
+
B(this, "pass", []);
|
|
536
701
|
/** Order from the markers in the DOM, after the last commit. */
|
|
537
|
-
|
|
702
|
+
B(this, "dom", []);
|
|
538
703
|
this.markerAttribute = t;
|
|
539
704
|
}
|
|
540
705
|
note(t) {
|
|
@@ -555,12 +720,13 @@ class He {
|
|
|
555
720
|
return this.dom = n, this.pass = n, o !== this.ordered().map((r) => r.key).join("|");
|
|
556
721
|
}
|
|
557
722
|
}
|
|
558
|
-
const
|
|
723
|
+
const ut = (e) => JSON.stringify([
|
|
559
724
|
e.id,
|
|
560
725
|
e.label,
|
|
561
726
|
typeof e.value == "string" ? e.value : "ƒ",
|
|
562
727
|
e.format,
|
|
563
|
-
e.
|
|
728
|
+
typeof e.aggregate == "function" ? "ƒ" : e.aggregate,
|
|
729
|
+
e.share,
|
|
564
730
|
e.rowHeader,
|
|
565
731
|
e.rightAligned,
|
|
566
732
|
e.width,
|
|
@@ -572,51 +738,63 @@ const uo = (e) => JSON.stringify([
|
|
|
572
738
|
typeof e.filter == "object" ? "own" : e.filter,
|
|
573
739
|
!!e.presentation,
|
|
574
740
|
!!e.ownSortValue,
|
|
575
|
-
!!e.ownExportValue
|
|
576
|
-
|
|
577
|
-
|
|
741
|
+
!!e.ownExportValue,
|
|
742
|
+
!!e.ownGroupValue,
|
|
743
|
+
e.group,
|
|
744
|
+
e.groupable
|
|
745
|
+
]), dt = (e, t) => e == null ? void 0 : e[t];
|
|
746
|
+
class gr {
|
|
578
747
|
constructor() {
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
748
|
+
B(this, "columns", new Pe("data-umriss-column"));
|
|
749
|
+
B(this, "actions", new Pe("data-umriss-action"));
|
|
750
|
+
/** The group keys: values to group by that are no column. */
|
|
751
|
+
B(this, "groupKeys", new Pe("data-umriss-groupkey"));
|
|
752
|
+
B(this, "signatures", /* @__PURE__ */ new Map());
|
|
582
753
|
/** The row detail: the presentation of the `RowDetail` that registered last. */
|
|
583
|
-
|
|
754
|
+
B(this, "detail", null);
|
|
584
755
|
/** How many `RowActions` stand right now. */
|
|
585
|
-
|
|
756
|
+
B(this, "actionGroups", /* @__PURE__ */ new Set());
|
|
586
757
|
/** Whether the row header column sticks - it then stands first, on screen, in
|
|
587
758
|
the column menu and in the export alike. */
|
|
588
|
-
|
|
759
|
+
B(this, "stickyRowHeader", !1);
|
|
589
760
|
/* Without a pagination bar the table does not page: one that stops quietly at
|
|
590
761
|
the tenth row because nobody put one there is a trap (found at the alarm
|
|
591
762
|
list, umriss-table 13). Without a table toolbar, but with a search or a
|
|
592
763
|
column filter, the table puts one there itself (table-filters 04):
|
|
593
764
|
conditions and the ratio need a place, and a place that came into being
|
|
594
765
|
only with the first condition would shift the table. */
|
|
595
|
-
|
|
766
|
+
B(this, "parts", /* @__PURE__ */ new Map());
|
|
596
767
|
/** The element the table's children stand in - for the markers. */
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
768
|
+
B(this, "children", null);
|
|
769
|
+
B(this, "hook", null);
|
|
770
|
+
B(this, "structure", 0);
|
|
771
|
+
B(this, "values", 0);
|
|
772
|
+
B(this, "presentation", 0);
|
|
773
|
+
B(this, "hookVersion", 0);
|
|
774
|
+
B(this, "reported", "");
|
|
775
|
+
B(this, "listeners", /* @__PURE__ */ new Set());
|
|
605
776
|
/* --- Subscription ------------------------------------------------------------- */
|
|
606
|
-
|
|
777
|
+
B(this, "subscribe", (t) => (this.listeners.add(t), () => {
|
|
607
778
|
this.listeners.delete(t);
|
|
608
779
|
}));
|
|
609
780
|
/** What the hook reads. */
|
|
610
|
-
|
|
781
|
+
B(this, "structureVersion", () => this.structure);
|
|
611
782
|
/** What body and unbound parts read. Every counter only rises, so the sum
|
|
612
783
|
rises exactly when one of them rises. */
|
|
613
|
-
|
|
784
|
+
B(this, "bodyVersion", () => this.structure + this.values + this.presentation + this.hookVersion);
|
|
785
|
+
/** The focus a fold may hide: the focused element of a grouped line, the
|
|
786
|
+
group that line stands in, and its table - noted before the fold, since
|
|
787
|
+
afterwards the element may be gone and the focus lost. */
|
|
788
|
+
B(this, "focusBeforeFold", null);
|
|
789
|
+
/** Whether the table lets itself be grouped at all (`<Table groupable>`). */
|
|
790
|
+
B(this, "tableGroupable", !0);
|
|
791
|
+
B(this, "groupingCache", null);
|
|
614
792
|
/* --- The kind of a column ------------------------------------------------------- */
|
|
615
|
-
|
|
793
|
+
B(this, "kinds", /* @__PURE__ */ new Map());
|
|
616
794
|
/* --- The model ------------------------------------------------------------------ */
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
795
|
+
B(this, "modelCache", null);
|
|
796
|
+
B(this, "projectionCache", null);
|
|
797
|
+
B(this, "unpaged", null);
|
|
620
798
|
}
|
|
621
799
|
/** Reports from a layout effect what has changed since the last report.
|
|
622
800
|
Without a change nothing happens. */
|
|
@@ -631,30 +809,30 @@ class ho {
|
|
|
631
809
|
/** The table renders: a new pass begins. Idempotent - a second call within
|
|
632
810
|
the same pass clears what is empty anyway. */
|
|
633
811
|
beginPass() {
|
|
634
|
-
this.columns.pass = [], this.actions.pass = [];
|
|
812
|
+
this.columns.pass = [], this.actions.pass = [], this.groupKeys.pass = [];
|
|
635
813
|
}
|
|
636
814
|
/** After the commit: check the order against the DOM. */
|
|
637
815
|
checkOrder() {
|
|
638
|
-
this.children && (this.columns.check(this.children) && this.structure++, this.actions.check(this.children) && this.structure++);
|
|
816
|
+
this.children && (this.columns.check(this.children) && this.structure++, this.actions.check(this.children) && this.structure++, this.groupKeys.check(this.children) && this.structure++);
|
|
639
817
|
}
|
|
640
818
|
/* --- Columns ------------------------------------------------------------------ */
|
|
641
819
|
/** A column registers during the render. Idempotent: the same spec changes no
|
|
642
820
|
version. */
|
|
643
821
|
registerColumn(t, n) {
|
|
644
|
-
const o = this.columns.entries.get(t), r =
|
|
822
|
+
const o = this.columns.entries.get(t), r = ut(n);
|
|
645
823
|
if (o) {
|
|
646
|
-
const
|
|
647
|
-
this.signatures.get(t) !== r && this.structure++, (
|
|
824
|
+
const s = o.spec;
|
|
825
|
+
this.signatures.get(t) !== r && this.structure++, (s.value !== n.value || s.ownSortValue !== n.ownSortValue || s.ownGroupValue !== n.ownGroupValue) && this.values++, (s.presentation !== n.presentation || s.ownExportValue !== n.ownExportValue || s.aggregate !== n.aggregate) && this.presentation++, o.spec = n;
|
|
648
826
|
} else {
|
|
649
|
-
const
|
|
827
|
+
const s = {
|
|
650
828
|
key: t,
|
|
651
829
|
spec: n,
|
|
652
|
-
read: (
|
|
653
|
-
const
|
|
654
|
-
return typeof
|
|
830
|
+
read: (i) => {
|
|
831
|
+
const a = s.spec.value;
|
|
832
|
+
return typeof a == "string" ? dt(i, a) : a(i);
|
|
655
833
|
}
|
|
656
834
|
};
|
|
657
|
-
this.columns.entries.set(t,
|
|
835
|
+
this.columns.entries.set(t, s), this.structure++;
|
|
658
836
|
}
|
|
659
837
|
this.signatures.set(t, r), this.columns.note(t), this.checkUniqueness();
|
|
660
838
|
}
|
|
@@ -670,8 +848,8 @@ class ho {
|
|
|
670
848
|
const t = /* @__PURE__ */ new Set();
|
|
671
849
|
let n = 0;
|
|
672
850
|
for (const { spec: o } of this.columns.entries.values())
|
|
673
|
-
t.has(o.id) &&
|
|
674
|
-
n > 1 &&
|
|
851
|
+
t.has(o.id) && pe(`id:${o.id}`, `Two columns carry the id "${o.id}". The second one is passed over.`), t.add(o.id), o.rowHeader && n++;
|
|
852
|
+
n > 1 && pe("rowHeader", "More than one column is `rowHeader`. A table has at most one row header; the first one holds.");
|
|
675
853
|
}
|
|
676
854
|
/** The table says during the render whether its row header sticks. Idempotent. */
|
|
677
855
|
setStickyRowHeader(t) {
|
|
@@ -696,11 +874,104 @@ class ho {
|
|
|
696
874
|
rowHeader() {
|
|
697
875
|
return this.orderedColumns().find((t) => t.spec.rowHeader);
|
|
698
876
|
}
|
|
877
|
+
/* --- Group keys and the grouping ---------------------------------------------- */
|
|
878
|
+
/** A group key registers during the render, as a column does. Idempotent. */
|
|
879
|
+
registerGroupKey(t, n) {
|
|
880
|
+
const o = this.groupKeys.entries.get(t), r = ut(n);
|
|
881
|
+
if (o)
|
|
882
|
+
this.signatures.get(t) !== r && this.structure++, (o.spec.value !== n.value || o.spec.ownGroupValue !== n.ownGroupValue) && this.values++, o.spec = n;
|
|
883
|
+
else {
|
|
884
|
+
const s = {
|
|
885
|
+
key: t,
|
|
886
|
+
spec: n,
|
|
887
|
+
read: (i) => {
|
|
888
|
+
const a = s.spec.value;
|
|
889
|
+
return typeof a == "string" ? dt(i, a) : a(i);
|
|
890
|
+
}
|
|
891
|
+
};
|
|
892
|
+
this.groupKeys.entries.set(t, s), this.structure++;
|
|
893
|
+
}
|
|
894
|
+
this.signatures.set(t, r), this.groupKeys.note(t);
|
|
895
|
+
}
|
|
896
|
+
ensureGroupKey(t, n) {
|
|
897
|
+
this.groupKeys.entries.has(t) || this.registerGroupKey(t, n);
|
|
898
|
+
}
|
|
899
|
+
removeGroupKey(t) {
|
|
900
|
+
this.groupKeys.entries.delete(t) && (this.signatures.delete(t), this.kinds.delete(t), this.structure++);
|
|
901
|
+
}
|
|
902
|
+
/** Notes where the focus stands - from the event that folds, never in a
|
|
903
|
+
render. */
|
|
904
|
+
noteFocusBeforeFold() {
|
|
905
|
+
var o;
|
|
906
|
+
const t = document.activeElement, n = (o = t == null ? void 0 : t.closest("tr[data-group]")) == null ? void 0 : o.dataset.group;
|
|
907
|
+
this.focusBeforeFold = t && n !== void 0 ? { element: t, group: n, table: t.closest("table") } : null;
|
|
908
|
+
}
|
|
909
|
+
/** The focus noted before the last fold - once. */
|
|
910
|
+
takeFocusBeforeFold() {
|
|
911
|
+
const t = this.focusBeforeFold;
|
|
912
|
+
return this.focusBeforeFold = null, t;
|
|
913
|
+
}
|
|
914
|
+
setTableGroupable(t) {
|
|
915
|
+
this.tableGroupable !== t && (this.tableGroupable = t, this.structure++);
|
|
916
|
+
}
|
|
917
|
+
/** Everything a table can be grouped by: its columns, then its group keys. */
|
|
918
|
+
groupingEntries(t) {
|
|
919
|
+
if (!this.tableGroupable) return [];
|
|
920
|
+
const n = /* @__PURE__ */ new Set();
|
|
921
|
+
return [...this.orderedColumns(), ...this.groupKeys.ordered()].filter((o) => {
|
|
922
|
+
if (n.has(o.spec.id)) return !1;
|
|
923
|
+
n.add(o.spec.id);
|
|
924
|
+
const { groupable: r, ownGroupValue: s } = o.spec;
|
|
925
|
+
return r ?? (this.kindOf(o, t) !== "other" || !!s);
|
|
926
|
+
});
|
|
927
|
+
}
|
|
928
|
+
/** The ids of a grouping that something groupable carries - at most three,
|
|
929
|
+
each once. */
|
|
930
|
+
effectiveGrouping(t, n) {
|
|
931
|
+
const o = new Set(this.groupingEntries(n).map((r) => r.spec.id));
|
|
932
|
+
return [...new Set(t)].filter((r) => o.has(r)).slice(0, Qe);
|
|
933
|
+
}
|
|
934
|
+
/** The levels and aggregates for the model - the same identity as long as
|
|
935
|
+
nothing changed that they read. */
|
|
936
|
+
groupingModel(t, n) {
|
|
937
|
+
var a;
|
|
938
|
+
const o = [t.join("|"), this.structure, this.values].join(":");
|
|
939
|
+
if (((a = this.groupingCache) == null ? void 0 : a.key) === o) return this.groupingCache;
|
|
940
|
+
const r = this.groupingEntries(n), s = t.map((c) => r.find((u) => u.spec.id === c)).filter((c) => c !== void 0).map((c) => ({
|
|
941
|
+
id: c.spec.id,
|
|
942
|
+
value: (u) => {
|
|
943
|
+
const h = c.read(u);
|
|
944
|
+
if (h == null) return;
|
|
945
|
+
const { ownGroupValue: d, group: m } = c.spec;
|
|
946
|
+
return d ? d(h) : m ? hn(m)(h) : h;
|
|
947
|
+
},
|
|
948
|
+
/* A value of one's own is a name; its groups stand by what they hold. */
|
|
949
|
+
order: c.spec.ownGroupValue ? (u) => ze(c.read(u), c.spec.ownSortValue) : void 0
|
|
950
|
+
})), i = this.orderedColumns().filter((c) => c.spec.aggregate !== void 0).map(
|
|
951
|
+
(c) => ({
|
|
952
|
+
id: c.spec.id,
|
|
953
|
+
read: c.read,
|
|
954
|
+
/* Read with the latest spec on every call: an aggregate of one's own
|
|
955
|
+
written in the call is a new function on every render. */
|
|
956
|
+
aggregate: typeof c.spec.aggregate == "function" ? (u, h) => c.spec.aggregate(u, h) : c.spec.aggregate
|
|
957
|
+
})
|
|
958
|
+
);
|
|
959
|
+
return this.groupingCache = { key: o, levels: s, aggregates: i }, this.groupingCache;
|
|
960
|
+
}
|
|
961
|
+
/** The grouping for the body's own pass: resolved against the columns of
|
|
962
|
+
this pass, so that even the first frame stands grouped. */
|
|
963
|
+
groupingFor(t) {
|
|
964
|
+
var r;
|
|
965
|
+
const n = this.effectiveGrouping(t.publicSnapshot.grouping, t.rows);
|
|
966
|
+
if (n.length === 0) return;
|
|
967
|
+
const o = this.groupingModel(n, t.rows);
|
|
968
|
+
return ((r = t.grouping) == null ? void 0 : r.levels) === o.levels ? t.grouping : { ...o, folded: t.folded, compareText: t.formats.compareText };
|
|
969
|
+
}
|
|
699
970
|
/** The kind of a column, read off the rows passed in and remembered. */
|
|
700
971
|
kindOf(t, n) {
|
|
701
972
|
const o = this.kinds.get(t.key);
|
|
702
973
|
if (o && o.rows === n && o.value === t.spec.value) return o.kind;
|
|
703
|
-
const r =
|
|
974
|
+
const r = Ft(n, t.read);
|
|
704
975
|
return this.kinds.set(t.key, { rows: n, value: t.spec.value, kind: r }), r;
|
|
705
976
|
}
|
|
706
977
|
/** Can it be sorted by this column? Without a statement: when its value is
|
|
@@ -714,42 +985,45 @@ class ho {
|
|
|
714
985
|
that the model reads - that is how the body recognises whether it may take
|
|
715
986
|
over the hook's calculation. */
|
|
716
987
|
modelColumns(t, n) {
|
|
717
|
-
var
|
|
718
|
-
const o = this.orderedColumns(), r = [this.structure, this.values, o.map((
|
|
719
|
-
if (((
|
|
988
|
+
var i;
|
|
989
|
+
const o = this.orderedColumns(), r = [this.structure, this.values, o.map((a) => a.key).join("|")].join(":");
|
|
990
|
+
if (((i = this.modelCache) == null ? void 0 : i.key) === r && this.modelCache.rows === t && this.modelCache.formats === n)
|
|
720
991
|
return this.modelCache.columns;
|
|
721
|
-
const
|
|
722
|
-
const { spec:
|
|
992
|
+
const s = o.map((a) => {
|
|
993
|
+
const { spec: c } = a, u = this.kindOf(a, t), h = this.isSortable(a, t), d = c.searchable ?? u === "text", m = (w) => ze(a.read(w), c.ownSortValue);
|
|
723
994
|
return {
|
|
724
|
-
id:
|
|
725
|
-
label:
|
|
726
|
-
value:
|
|
995
|
+
id: c.id,
|
|
996
|
+
label: c.label,
|
|
997
|
+
value: h || d ? m : void 0,
|
|
727
998
|
/* Text sorts with the provider's comparison, not with the built-in
|
|
728
999
|
German one (spec, the table of defaults). */
|
|
729
|
-
compare: u === "text" && !
|
|
730
|
-
searchable:
|
|
731
|
-
hideable: !
|
|
732
|
-
resizable:
|
|
733
|
-
width:
|
|
1000
|
+
compare: u === "text" && !c.ownSortValue ? (w, k) => n.compareText(String(m(w)), String(m(k))) : void 0,
|
|
1001
|
+
searchable: d,
|
|
1002
|
+
hideable: !c.rowHeader,
|
|
1003
|
+
resizable: c.resizable,
|
|
1004
|
+
width: c.width
|
|
734
1005
|
};
|
|
735
1006
|
});
|
|
736
|
-
return this.modelCache = { key: r, rows: t, formats: n, columns:
|
|
1007
|
+
return this.modelCache = { key: r, rows: t, formats: n, columns: s }, s;
|
|
737
1008
|
}
|
|
738
1009
|
/** The projection for the body. Without a pagination bar it is a single page
|
|
739
1010
|
holding all the filtered rows. */
|
|
740
1011
|
projection() {
|
|
741
1012
|
var n;
|
|
742
1013
|
const t = this.computedProjection();
|
|
743
|
-
return this.paginates() || this.hook.companion.virtual ? t : (((n = this.unpaged) == null ? void 0 : n.from) !== t && (this.unpaged = {
|
|
1014
|
+
return this.paginates() || this.hook.companion.virtual ? t : (((n = this.unpaged) == null ? void 0 : n.from) !== t && (this.unpaged = {
|
|
1015
|
+
from: t,
|
|
1016
|
+
projection: { ...t, visible: t.filtered, visibleLines: t.lines, page: 1, pageCount: 1 }
|
|
1017
|
+
}), this.unpaged.projection);
|
|
744
1018
|
}
|
|
745
1019
|
/** The hook's projection when it calculated with the same columns - otherwise
|
|
746
1020
|
a new one, with the columns of this pass. */
|
|
747
1021
|
computedProjection() {
|
|
748
|
-
var
|
|
1022
|
+
var a;
|
|
749
1023
|
const t = this.hook, n = this.modelColumns(t.rows, t.formats), o = t.companion;
|
|
750
1024
|
if (n === t.modelColumns)
|
|
751
1025
|
return o;
|
|
752
|
-
if (((
|
|
1026
|
+
if (((a = this.projectionCache) == null ? void 0 : a.hook) === t && this.projectionCache.columns === n) return this.projectionCache.projection;
|
|
753
1027
|
const r = {
|
|
754
1028
|
search: o.search,
|
|
755
1029
|
filter: t.filter,
|
|
@@ -757,9 +1031,10 @@ class ho {
|
|
|
757
1031
|
page: o.page,
|
|
758
1032
|
pageSize: o.virtual ? 0 : o.pageSize,
|
|
759
1033
|
hidden: o.hidden,
|
|
760
|
-
order: o.order
|
|
761
|
-
|
|
762
|
-
|
|
1034
|
+
order: o.order,
|
|
1035
|
+
grouping: this.groupingFor(t)
|
|
1036
|
+
}, s = tt(t.admitted, n, r), i = o.virtual ? pr(s, o.virtual.from, o.virtual.to) : s;
|
|
1037
|
+
return this.projectionCache = { hook: t, columns: n, projection: i }, i;
|
|
763
1038
|
}
|
|
764
1039
|
/* --- The hook's snapshot ---------------------------------------------------------- */
|
|
765
1040
|
/** The hook deposits its snapshot during the render. Idempotent for the same
|
|
@@ -788,9 +1063,11 @@ class ho {
|
|
|
788
1063
|
paginates() {
|
|
789
1064
|
return this.count("pagination") > 0;
|
|
790
1065
|
}
|
|
791
|
-
/** Whether the table puts up a table toolbar of its own
|
|
1066
|
+
/** Whether the table puts up a table toolbar of its own - also while it is
|
|
1067
|
+
grouped: the tag that names and removes the grouping needs a place. */
|
|
792
1068
|
needsOwnToolbar() {
|
|
793
|
-
|
|
1069
|
+
var t;
|
|
1070
|
+
return this.count("toolbar") > 0 ? !1 : this.count("search") > 0 || this.orderedColumns().some((n) => me(n.spec.filter) !== void 0) || (((t = this.hook) == null ? void 0 : t.publicSnapshot.grouping.length) ?? 0) > 0;
|
|
794
1071
|
}
|
|
795
1072
|
/* --- Row detail ------------------------------------------------------------------- */
|
|
796
1073
|
registerDetail(t, n) {
|
|
@@ -827,78 +1104,83 @@ class ho {
|
|
|
827
1104
|
this.actions.entries.delete(t) && this.structure++;
|
|
828
1105
|
}
|
|
829
1106
|
}
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
1107
|
+
function pr(e, t, n) {
|
|
1108
|
+
if (!e.lines) return { ...e, visible: e.filtered.slice(t, n) };
|
|
1109
|
+
const o = e.lines.slice(t, n);
|
|
1110
|
+
return { ...e, visibleLines: o, visible: Ze(o) };
|
|
1111
|
+
}
|
|
1112
|
+
const Bt = /* @__PURE__ */ new WeakMap(), mr = (e, t) => {
|
|
1113
|
+
Bt.set(e, t);
|
|
1114
|
+
}, wr = (e) => typeof e == "function" || typeof e == "object" && e !== null ? Bt.get(e) : void 0, G = (...e) => e.filter(Boolean).join(" ");
|
|
1115
|
+
function Pt({
|
|
834
1116
|
entry: e,
|
|
835
1117
|
registry: t,
|
|
836
1118
|
hook: n,
|
|
837
1119
|
anchor: o,
|
|
838
1120
|
focus: r,
|
|
839
|
-
open:
|
|
840
|
-
setOpen:
|
|
841
|
-
panelId:
|
|
1121
|
+
open: s,
|
|
1122
|
+
setOpen: i,
|
|
1123
|
+
panelId: a
|
|
842
1124
|
}) {
|
|
843
|
-
const
|
|
844
|
-
if (!
|
|
845
|
-
const
|
|
846
|
-
var
|
|
847
|
-
|
|
1125
|
+
const c = U(), u = ue(), { id: h, label: d, format: m } = e.spec, { values: w, absent: k } = $(() => or(n.admitted, e.read, u), [n.admitted, e, u]), p = me(e.spec.filter);
|
|
1126
|
+
if (!p) return null;
|
|
1127
|
+
const b = n.publicSnapshot, g = p.Input, _ = er(p) ? { absentOccurs: k, format: m, kind: t.kindOf(e, n.rows) } : {}, C = () => {
|
|
1128
|
+
var S;
|
|
1129
|
+
i(!1), (S = (r ?? o).current) == null || S.focus();
|
|
848
1130
|
};
|
|
849
|
-
return /* @__PURE__ */
|
|
850
|
-
|
|
1131
|
+
return /* @__PURE__ */ O(
|
|
1132
|
+
St,
|
|
851
1133
|
{
|
|
852
|
-
open:
|
|
853
|
-
onOpenChange:
|
|
1134
|
+
open: s,
|
|
1135
|
+
onOpenChange: i,
|
|
854
1136
|
anchorRef: o,
|
|
855
1137
|
align: "end",
|
|
856
1138
|
role: "dialog",
|
|
857
|
-
ariaLabel:
|
|
858
|
-
id:
|
|
1139
|
+
ariaLabel: c.filterColumn(d),
|
|
1140
|
+
id: a,
|
|
859
1141
|
className: f.filterPanel,
|
|
860
1142
|
children: [
|
|
861
|
-
/* @__PURE__ */
|
|
862
|
-
|
|
1143
|
+
/* @__PURE__ */ l(
|
|
1144
|
+
g,
|
|
863
1145
|
{
|
|
864
|
-
condition:
|
|
865
|
-
setCondition: (
|
|
866
|
-
values:
|
|
867
|
-
column: { id:
|
|
868
|
-
...
|
|
1146
|
+
condition: b.filter[h] ?? null,
|
|
1147
|
+
setCondition: (S) => b.setFilter(h, S),
|
|
1148
|
+
values: w,
|
|
1149
|
+
column: { id: h, label: d },
|
|
1150
|
+
..._
|
|
869
1151
|
}
|
|
870
1152
|
),
|
|
871
|
-
/* @__PURE__ */
|
|
872
|
-
/* @__PURE__ */
|
|
873
|
-
/* @__PURE__ */
|
|
1153
|
+
/* @__PURE__ */ O("div", { className: f.filterFooter, children: [
|
|
1154
|
+
/* @__PURE__ */ l(ee, { size: "sm", variant: "ghost", onClick: () => b.setFilter(h, null), children: c.filterReset }),
|
|
1155
|
+
/* @__PURE__ */ l(ee, { size: "sm", onClick: C, children: c.filterDone })
|
|
874
1156
|
] })
|
|
875
1157
|
]
|
|
876
1158
|
}
|
|
877
1159
|
);
|
|
878
1160
|
}
|
|
879
|
-
function
|
|
1161
|
+
function br({
|
|
880
1162
|
entry: e,
|
|
881
1163
|
registry: t,
|
|
882
1164
|
hook: n
|
|
883
1165
|
}) {
|
|
884
|
-
const o =
|
|
885
|
-
return /* @__PURE__ */
|
|
886
|
-
/* @__PURE__ */
|
|
1166
|
+
const o = U(), [r, s] = H(!1), i = re(null), a = se(), { id: c, label: u } = e.spec, h = c in n.publicSnapshot.filter;
|
|
1167
|
+
return /* @__PURE__ */ O(Q, { children: [
|
|
1168
|
+
/* @__PURE__ */ l(
|
|
887
1169
|
"button",
|
|
888
1170
|
{
|
|
889
|
-
ref:
|
|
1171
|
+
ref: i,
|
|
890
1172
|
type: "button",
|
|
891
|
-
className:
|
|
1173
|
+
className: G(f.filterButton, h && f.filterActive),
|
|
892
1174
|
"aria-label": o.filterColumn(u),
|
|
893
1175
|
"aria-haspopup": "dialog",
|
|
894
1176
|
"aria-expanded": r,
|
|
895
|
-
"aria-controls": r ?
|
|
896
|
-
onClick: () =>
|
|
897
|
-
children: /* @__PURE__ */
|
|
1177
|
+
"aria-controls": r ? a : void 0,
|
|
1178
|
+
onClick: () => s(!r),
|
|
1179
|
+
children: /* @__PURE__ */ l("svg", { viewBox: "0 0 14 14", width: "13", height: "13", "aria-hidden": "true", children: /* @__PURE__ */ l(
|
|
898
1180
|
"path",
|
|
899
1181
|
{
|
|
900
1182
|
d: "M1.8 2.6h10.4L8.3 7.5v3.4l-2.6 1.1V7.5L1.8 2.6z",
|
|
901
|
-
fill:
|
|
1183
|
+
fill: h ? "currentColor" : "none",
|
|
902
1184
|
stroke: "currentColor",
|
|
903
1185
|
strokeWidth: "1.4",
|
|
904
1186
|
strokeLinecap: "round",
|
|
@@ -907,167 +1189,522 @@ function go({
|
|
|
907
1189
|
) })
|
|
908
1190
|
}
|
|
909
1191
|
),
|
|
910
|
-
/* @__PURE__ */
|
|
911
|
-
|
|
1192
|
+
/* @__PURE__ */ l(
|
|
1193
|
+
Pt,
|
|
912
1194
|
{
|
|
913
1195
|
entry: e,
|
|
914
1196
|
registry: t,
|
|
915
1197
|
hook: n,
|
|
916
|
-
anchor:
|
|
1198
|
+
anchor: i,
|
|
917
1199
|
open: r,
|
|
918
|
-
setOpen:
|
|
919
|
-
panelId:
|
|
1200
|
+
setOpen: s,
|
|
1201
|
+
panelId: a
|
|
920
1202
|
}
|
|
921
1203
|
)
|
|
922
1204
|
] });
|
|
923
1205
|
}
|
|
924
|
-
function
|
|
925
|
-
const n =
|
|
926
|
-
const
|
|
927
|
-
if (!
|
|
928
|
-
const u = { formats: o, wording: n, format:
|
|
929
|
-
return [{ entry:
|
|
1206
|
+
function kr({ registry: e, hook: t }) {
|
|
1207
|
+
const n = U(), o = ue(), r = Object.entries(t.publicSnapshot.filter).flatMap(([s, i]) => {
|
|
1208
|
+
const a = e.columnById(s), c = a ? me(a.spec.filter) : void 0;
|
|
1209
|
+
if (!a || !c) return [];
|
|
1210
|
+
const u = { formats: o, wording: n, format: a.spec.format, kind: e.kindOf(a, t.rows) };
|
|
1211
|
+
return [{ entry: a, text: nr(c, i, u) }];
|
|
930
1212
|
});
|
|
931
|
-
return r.length === 0 ? null : /* @__PURE__ */
|
|
1213
|
+
return r.length === 0 ? null : /* @__PURE__ */ l(Nt, { "aria-label": n.conditions, className: f.conditions, children: r.map(({ entry: s, text: i }) => /* @__PURE__ */ l(vr, { entry: s, text: i, registry: e, hook: t }, s.spec.id)) });
|
|
932
1214
|
}
|
|
933
|
-
function
|
|
1215
|
+
function vr({
|
|
934
1216
|
entry: e,
|
|
935
1217
|
text: t,
|
|
936
1218
|
registry: n,
|
|
937
1219
|
hook: o
|
|
938
1220
|
}) {
|
|
939
|
-
const r =
|
|
940
|
-
return /* @__PURE__ */
|
|
941
|
-
/* @__PURE__ */
|
|
942
|
-
|
|
1221
|
+
const r = U(), [s, i] = H(!1), a = re(null), c = re(null), u = se(), { id: h, label: d } = e.spec;
|
|
1222
|
+
return /* @__PURE__ */ O(Q, { children: [
|
|
1223
|
+
/* @__PURE__ */ l(
|
|
1224
|
+
xt,
|
|
943
1225
|
{
|
|
944
|
-
ref:
|
|
1226
|
+
ref: a,
|
|
945
1227
|
className: f.condition,
|
|
946
|
-
onRemove: () => o.publicSnapshot.setFilter(
|
|
947
|
-
removeLabel: r.removeConditionNamed(
|
|
948
|
-
children: /* @__PURE__ */
|
|
1228
|
+
onRemove: () => o.publicSnapshot.setFilter(h, null),
|
|
1229
|
+
removeLabel: r.removeConditionNamed(d, t),
|
|
1230
|
+
children: /* @__PURE__ */ O(
|
|
949
1231
|
"button",
|
|
950
1232
|
{
|
|
951
|
-
ref:
|
|
1233
|
+
ref: c,
|
|
952
1234
|
type: "button",
|
|
953
1235
|
className: f.conditionButton,
|
|
954
|
-
"aria-label": r.editConditionNamed(
|
|
1236
|
+
"aria-label": r.editConditionNamed(d, t),
|
|
955
1237
|
"aria-haspopup": "dialog",
|
|
956
|
-
"aria-expanded":
|
|
957
|
-
"aria-controls":
|
|
958
|
-
onClick: () =>
|
|
1238
|
+
"aria-expanded": s,
|
|
1239
|
+
"aria-controls": s ? u : void 0,
|
|
1240
|
+
onClick: () => i(!s),
|
|
959
1241
|
children: [
|
|
960
|
-
/* @__PURE__ */
|
|
961
|
-
/* @__PURE__ */
|
|
1242
|
+
/* @__PURE__ */ l("span", { className: f.filterLabel, children: d }),
|
|
1243
|
+
/* @__PURE__ */ l("span", { className: f.filterValue, children: t })
|
|
962
1244
|
]
|
|
963
1245
|
}
|
|
964
1246
|
)
|
|
965
1247
|
}
|
|
966
1248
|
),
|
|
967
|
-
/* @__PURE__ */
|
|
968
|
-
|
|
1249
|
+
/* @__PURE__ */ l(
|
|
1250
|
+
Pt,
|
|
969
1251
|
{
|
|
970
1252
|
entry: e,
|
|
971
1253
|
registry: n,
|
|
972
1254
|
hook: o,
|
|
973
|
-
anchor:
|
|
974
|
-
focus:
|
|
975
|
-
open:
|
|
976
|
-
setOpen:
|
|
1255
|
+
anchor: a,
|
|
1256
|
+
focus: c,
|
|
1257
|
+
open: s,
|
|
1258
|
+
setOpen: i,
|
|
977
1259
|
panelId: u
|
|
978
1260
|
}
|
|
979
1261
|
)
|
|
980
1262
|
] });
|
|
981
1263
|
}
|
|
982
|
-
const
|
|
983
|
-
`,
|
|
1264
|
+
const ft = ";", _r = `\r
|
|
1265
|
+
`, yr = "\uFEFF", Cr = (e) => String(e).replace(".", ","), Gt = (e) => /[";\r\n]/.test(e) ? `"${e.replace(/"/g, '""')}"` : e, Sr = (e, t) => {
|
|
984
1266
|
var o;
|
|
985
1267
|
const n = (o = t.value) == null ? void 0 : o.call(t, e);
|
|
986
|
-
return n == null ? "" :
|
|
1268
|
+
return n == null ? "" : Gt(typeof n == "number" ? Cr(n) : String(n));
|
|
987
1269
|
};
|
|
988
|
-
function
|
|
989
|
-
const n = t.map((r) =>
|
|
990
|
-
return
|
|
1270
|
+
function Nr(e, t) {
|
|
1271
|
+
const n = t.map((r) => Gt(r.label ?? r.id)).join(ft), o = e.map((r) => t.map((s) => Sr(r, s)).join(ft));
|
|
1272
|
+
return yr + [n, ...o].join(_r);
|
|
991
1273
|
}
|
|
992
|
-
function
|
|
1274
|
+
function Et(e) {
|
|
993
1275
|
const t = new Map(e.orderedColumns().map((o) => [o.spec.id, o])), n = e.projection().columns.map((o) => t.get(o.id)).filter((o) => o !== void 0);
|
|
994
1276
|
return e.withStickyHeaderFirst(n.map((o) => ({ id: o.spec.id, e: o }))).map(({ e: o }) => o);
|
|
995
1277
|
}
|
|
996
|
-
function
|
|
1278
|
+
function zt(e) {
|
|
997
1279
|
e.setSearch("");
|
|
998
1280
|
for (const t of Object.keys(e.filter)) e.setFilter(t, null);
|
|
999
1281
|
}
|
|
1000
|
-
function
|
|
1282
|
+
function xr(e) {
|
|
1001
1283
|
const t = e.hook;
|
|
1002
1284
|
if (!t) return "";
|
|
1003
|
-
const n =
|
|
1285
|
+
const n = Et(e).filter((o) => e.kindOf(o, t.rows) !== "other" || o.spec.ownExportValue).map(
|
|
1004
1286
|
(o) => ({
|
|
1005
1287
|
id: o.spec.id,
|
|
1006
1288
|
label: o.spec.label,
|
|
1007
|
-
value: (r) =>
|
|
1289
|
+
value: (r) => Lt(o.read(r), o.spec.ownExportValue)
|
|
1008
1290
|
})
|
|
1009
1291
|
);
|
|
1010
|
-
return
|
|
1292
|
+
return Nr(e.projection().filtered, n);
|
|
1011
1293
|
}
|
|
1012
|
-
|
|
1294
|
+
const Ar = (e, t, n) => {
|
|
1295
|
+
var o;
|
|
1296
|
+
return ((o = e.groupingEntries(t.rows).find((r) => r.spec.id === n)) == null ? void 0 : o.spec.label) ?? n;
|
|
1297
|
+
};
|
|
1298
|
+
function Tr({ registry: e, hook: t }) {
|
|
1299
|
+
const n = U(), o = e.groupingEntries(t.rows);
|
|
1300
|
+
if (o.length === 0) return null;
|
|
1301
|
+
const { grouping: r, setGrouping: s } = t.publicSnapshot;
|
|
1302
|
+
return /* @__PURE__ */ O("section", { className: f.groupingChoice, "aria-label": n.grouping, children: [
|
|
1303
|
+
/* @__PURE__ */ l("h3", { className: f.groupingHeading, children: n.grouping }),
|
|
1304
|
+
/* @__PURE__ */ l("div", { className: f.groupingOptions, children: o.map((i) => {
|
|
1305
|
+
const { id: a, label: c } = i.spec, u = r.indexOf(a), h = u !== -1;
|
|
1306
|
+
return /* @__PURE__ */ O(
|
|
1307
|
+
"button",
|
|
1308
|
+
{
|
|
1309
|
+
type: "button",
|
|
1310
|
+
className: f.groupingOption,
|
|
1311
|
+
"aria-label": n.groupBy(c),
|
|
1312
|
+
"aria-pressed": h,
|
|
1313
|
+
disabled: !h && r.length >= Qe,
|
|
1314
|
+
onClick: () => s(h ? r.filter((d) => d !== a) : [...r, a]),
|
|
1315
|
+
children: [
|
|
1316
|
+
h && /* @__PURE__ */ l("span", { className: f.groupingLevel, "aria-hidden": "true", children: u + 1 }),
|
|
1317
|
+
c
|
|
1318
|
+
]
|
|
1319
|
+
},
|
|
1320
|
+
a
|
|
1321
|
+
);
|
|
1322
|
+
}) })
|
|
1323
|
+
] });
|
|
1324
|
+
}
|
|
1325
|
+
function Fr({ registry: e, hook: t }) {
|
|
1326
|
+
const n = U(), o = t.publicSnapshot, { grouping: r } = o;
|
|
1327
|
+
if (r.length === 0) return null;
|
|
1328
|
+
const s = r.map((i) => Ar(e, t, i));
|
|
1329
|
+
return (
|
|
1330
|
+
/* In a tag group, as the conditions stand: the tag is one stop, its button
|
|
1331
|
+
the thing one tabs to, and the ring stands on the tag. */
|
|
1332
|
+
/* @__PURE__ */ l(Nt, { "aria-label": n.groupedBy, className: f.groupingTag, children: /* @__PURE__ */ l(xt, { onRemove: () => o.setGrouping([]), removeLabel: n.removeGrouping, children: /* @__PURE__ */ O(
|
|
1333
|
+
At,
|
|
1334
|
+
{
|
|
1335
|
+
trigger: /* @__PURE__ */ O("button", { type: "button", className: G(f.conditionButton, f.groupingTrigger), children: [
|
|
1336
|
+
/* @__PURE__ */ l("span", { className: f.groupingPrefix, children: n.groupedBy }),
|
|
1337
|
+
s.map((i, a) => /* @__PURE__ */ O("span", { className: f.groupingPath, children: [
|
|
1338
|
+
a > 0 && /* @__PURE__ */ l("span", { className: f.groupingSeparator, "aria-hidden": "true", children: "›" }),
|
|
1339
|
+
i
|
|
1340
|
+
] }, r[a]))
|
|
1341
|
+
] }),
|
|
1342
|
+
children: [
|
|
1343
|
+
r.map((i, a) => /* @__PURE__ */ l(Fe, { onSelect: () => o.setGrouping(r.filter((c) => c !== i)), children: n.removeGroupingLevel(s[a]) }, i)),
|
|
1344
|
+
/* @__PURE__ */ l(en, {}),
|
|
1345
|
+
/* @__PURE__ */ l(Fe, { onSelect: o.unfoldAll, children: n.unfoldAll }),
|
|
1346
|
+
/* @__PURE__ */ l(Fe, { onSelect: o.foldAll, children: n.foldAll })
|
|
1347
|
+
]
|
|
1348
|
+
}
|
|
1349
|
+
) }) })
|
|
1350
|
+
);
|
|
1351
|
+
}
|
|
1352
|
+
function jt({
|
|
1013
1353
|
registry: e,
|
|
1014
1354
|
className: t,
|
|
1015
1355
|
children: n,
|
|
1016
1356
|
own: o = !1
|
|
1017
1357
|
}) {
|
|
1018
|
-
const r =
|
|
1019
|
-
let
|
|
1020
|
-
if (e &&
|
|
1021
|
-
const u =
|
|
1022
|
-
|
|
1023
|
-
/* @__PURE__ */
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1358
|
+
const r = U(), s = ue(), i = (e == null ? void 0 : e.hook) ?? null;
|
|
1359
|
+
let a = null, c = null;
|
|
1360
|
+
if (e && i) {
|
|
1361
|
+
const u = i.publicSnapshot, h = u.search !== "" || Object.keys(u.filter).length > 0, d = o ? [] : u.filtered.filter((w) => u.selection.isSelected(i.rowKey(w))), m = e.hasRowActions() ? e.actions.ordered().filter((w) => w.spec.bulk) : [];
|
|
1362
|
+
a = /* @__PURE__ */ O(Q, { children: [
|
|
1363
|
+
/* @__PURE__ */ l(Fr, { registry: e, hook: i }),
|
|
1364
|
+
/* @__PURE__ */ l(kr, { registry: e, hook: i })
|
|
1365
|
+
] }), c = /* @__PURE__ */ O("div", { className: f.toolbarGroup, children: [
|
|
1366
|
+
/* @__PURE__ */ l("span", { role: "status", className: f.filteredCount, children: h ? r.filteredOfTotal(s.count(u.filtered.length), s.count(i.admitted.length)) : "" }),
|
|
1367
|
+
h && /* @__PURE__ */ l(ee, { size: "sm", variant: "ghost", onClick: () => zt(u), children: r.resetAll }),
|
|
1368
|
+
d.length > 0 && /* @__PURE__ */ O(Q, { children: [
|
|
1369
|
+
/* @__PURE__ */ l("span", { className: f.toolbarInfo, children: r.selectedCount(d.length, s.count(d.length)) }),
|
|
1370
|
+
m.map(({ key: w, spec: k }) => /* @__PURE__ */ l(
|
|
1371
|
+
ee,
|
|
1029
1372
|
{
|
|
1030
1373
|
size: "sm",
|
|
1031
|
-
variant:
|
|
1032
|
-
onClick: () =>
|
|
1033
|
-
children:
|
|
1374
|
+
variant: k.tone === "danger" ? "danger" : "secondary",
|
|
1375
|
+
onClick: () => k.onSelect(d),
|
|
1376
|
+
children: k.label
|
|
1034
1377
|
},
|
|
1035
|
-
|
|
1378
|
+
w
|
|
1036
1379
|
))
|
|
1037
1380
|
] })
|
|
1038
1381
|
] });
|
|
1039
1382
|
}
|
|
1040
|
-
return /* @__PURE__ */
|
|
1041
|
-
/* @__PURE__ */
|
|
1383
|
+
return /* @__PURE__ */ O("div", { className: G(f.toolbar, t), children: [
|
|
1384
|
+
/* @__PURE__ */ O("div", { className: f.toolbarGroup, children: [
|
|
1042
1385
|
n,
|
|
1043
|
-
|
|
1386
|
+
a
|
|
1044
1387
|
] }),
|
|
1045
|
-
|
|
1388
|
+
c
|
|
1046
1389
|
] });
|
|
1047
1390
|
}
|
|
1048
|
-
const
|
|
1049
|
-
},
|
|
1050
|
-
function
|
|
1391
|
+
const $e = yt(null), Or = () => () => {
|
|
1392
|
+
}, ht = () => 0;
|
|
1393
|
+
function xe(e) {
|
|
1051
1394
|
var r;
|
|
1052
|
-
const t =
|
|
1053
|
-
|
|
1054
|
-
n ? n.subscribe :
|
|
1055
|
-
n ? n.bodyVersion :
|
|
1056
|
-
n ? n.bodyVersion :
|
|
1395
|
+
const t = Ue($e), n = e ? wr(e.Table) ?? null : (t == null ? void 0 : t.registry) ?? null;
|
|
1396
|
+
Le(
|
|
1397
|
+
n ? n.subscribe : Or,
|
|
1398
|
+
n ? n.bodyVersion : ht,
|
|
1399
|
+
n ? n.bodyVersion : ht
|
|
1057
1400
|
);
|
|
1058
1401
|
const o = (r = n == null ? void 0 : n.hook) == null ? void 0 : r.publicSnapshot;
|
|
1059
1402
|
return !n || !o ? null : { registry: n, snapshot: o, inside: !e && t !== null, footerTarget: e ? null : (t == null ? void 0 : t.footerTarget) ?? null };
|
|
1060
1403
|
}
|
|
1061
|
-
function
|
|
1404
|
+
function Ht({ wording: e }) {
|
|
1405
|
+
return /* @__PURE__ */ O(Q, { children: [
|
|
1406
|
+
/* @__PURE__ */ l("span", { "aria-hidden": "true", className: f.absent, children: "—" }),
|
|
1407
|
+
/* @__PURE__ */ l(Re, { children: e.cellAbsentValue })
|
|
1408
|
+
] });
|
|
1409
|
+
}
|
|
1410
|
+
const Lr = { sum: "Σ", avg: "⌀", min: "min", max: "max" }, Rr = (e, t) => ({
|
|
1411
|
+
sum: t.footerSum,
|
|
1412
|
+
avg: t.footerAverage,
|
|
1413
|
+
min: t.footerMinimum,
|
|
1414
|
+
max: t.footerMaximum,
|
|
1415
|
+
range: t.footerRange,
|
|
1416
|
+
count: t.footerCount,
|
|
1417
|
+
distinct: t.footerDistinct
|
|
1418
|
+
})[e] ?? t.footerAggregate;
|
|
1419
|
+
function Ke({
|
|
1420
|
+
entry: e,
|
|
1421
|
+
rows: t,
|
|
1422
|
+
formats: n,
|
|
1423
|
+
wording: o,
|
|
1424
|
+
signed: r = !1
|
|
1425
|
+
}) {
|
|
1426
|
+
const { aggregate: s, format: i, presentation: a } = e.spec;
|
|
1427
|
+
if (!s) return null;
|
|
1428
|
+
const c = typeof s == "function" ? "own" : s, u = Xe({ id: e.spec.id, read: e.read, aggregate: s }, t), h = (w) => _e(w, i, n, o);
|
|
1429
|
+
let d;
|
|
1430
|
+
if (Y(u)) d = /* @__PURE__ */ l(Ht, { wording: o });
|
|
1431
|
+
else if (c === "range" && i === "date" && Mr(u)) {
|
|
1432
|
+
const [w, k] = u;
|
|
1433
|
+
d = w.getTime() === k.getTime() ? n.date(w) : o.rangeFromTo(n.dateShort(w), n.dateShort(k));
|
|
1434
|
+
} else if (c === "count" || c === "distinct") d = n.count(u);
|
|
1435
|
+
else if (c === "range") {
|
|
1436
|
+
const [w, k] = u;
|
|
1437
|
+
d = h(w) === h(k) ? h(w) : o.rangeFromTo(h(w) ?? "", h(k) ?? "");
|
|
1438
|
+
} else c === "own" && a ? d = a(u, t[0]) : d = h(u);
|
|
1439
|
+
const m = Lr[c];
|
|
1440
|
+
return /* @__PURE__ */ O(Q, { children: [
|
|
1441
|
+
r && m && /* @__PURE__ */ l("span", { "aria-hidden": "true", className: f.footerKind, children: m }),
|
|
1442
|
+
r && /* @__PURE__ */ O(Re, { children: [
|
|
1443
|
+
Rr(c, o),
|
|
1444
|
+
" "
|
|
1445
|
+
] }),
|
|
1446
|
+
d
|
|
1447
|
+
] });
|
|
1448
|
+
}
|
|
1449
|
+
const Mr = ([e, t]) => e instanceof Date && t instanceof Date && e.getFullYear() === t.getFullYear();
|
|
1450
|
+
function $t(e, t) {
|
|
1451
|
+
const n = e.spec.aggregate;
|
|
1452
|
+
return n === "count" || n === "distinct" ? !0 : e.spec.rightAligned !== void 0 ? e.spec.rightAligned : Ft(t, e.read) === "number";
|
|
1453
|
+
}
|
|
1454
|
+
function Vr(e, t) {
|
|
1455
|
+
const n = /* @__PURE__ */ new Map();
|
|
1456
|
+
for (const [o, r] of t) {
|
|
1457
|
+
const s = e.get(o);
|
|
1458
|
+
s !== void 0 && Math.abs(s - r) >= 0.5 && n.set(o, s - r);
|
|
1459
|
+
}
|
|
1460
|
+
return n;
|
|
1461
|
+
}
|
|
1462
|
+
function Kt(e, t) {
|
|
1463
|
+
const n = getComputedStyle(e).getPropertyValue(t).trim(), o = Number.parseFloat(n);
|
|
1464
|
+
return Number.isFinite(o) ? n.endsWith("ms") ? o : o * 1e3 : 0;
|
|
1465
|
+
}
|
|
1466
|
+
const Dr = (e) => {
|
|
1467
|
+
const t = /* @__PURE__ */ new Map(), n = e.getBoundingClientRect().top;
|
|
1468
|
+
for (const o of Array.from(e.querySelectorAll("tbody > tr[data-motion]")))
|
|
1469
|
+
t.set(o.dataset.motion, o.getBoundingClientRect().top - n);
|
|
1470
|
+
return t;
|
|
1471
|
+
};
|
|
1472
|
+
function Ir(e, t) {
|
|
1473
|
+
const n = re(null);
|
|
1474
|
+
W(() => {
|
|
1475
|
+
const o = e.current;
|
|
1476
|
+
if (!o) return;
|
|
1477
|
+
const r = Dr(o), s = n.current;
|
|
1478
|
+
if (n.current = { trigger: t, positions: r }, !s || s.trigger === t) return;
|
|
1479
|
+
const i = Kt(o, "--u-duration-medium");
|
|
1480
|
+
if (i === 0 || typeof o.animate != "function") return;
|
|
1481
|
+
const a = getComputedStyle(o).getPropertyValue("--u-ease-out").trim() || "ease-out", c = Vr(s.positions, r);
|
|
1482
|
+
for (const u of Array.from(o.querySelectorAll("tbody > tr[data-motion]"))) {
|
|
1483
|
+
const h = u.dataset.motion, d = c.get(h);
|
|
1484
|
+
d !== void 0 ? u.animate([{ transform: `translateY(${d}px)` }, { transform: "none" }], { duration: i, easing: a }) : s.positions.has(h) || u.animate([{ opacity: 0, transform: "translateY(-4px)" }, { opacity: 1, transform: "none" }], { duration: i, easing: a });
|
|
1485
|
+
}
|
|
1486
|
+
});
|
|
1487
|
+
}
|
|
1488
|
+
function Br(e, t, n) {
|
|
1489
|
+
const o = re(t);
|
|
1490
|
+
W(() => {
|
|
1491
|
+
const r = e.current, s = o.current;
|
|
1492
|
+
if (o.current = t, !r || s === t || typeof r.animate != "function") return;
|
|
1493
|
+
const i = Kt(r, "--u-duration-medium");
|
|
1494
|
+
if (i === 0) return;
|
|
1495
|
+
const a = performance.now();
|
|
1496
|
+
let c = requestAnimationFrame(function u(h) {
|
|
1497
|
+
const d = Math.min(1, (h - a) / i), m = 1 - (1 - d) ** 3;
|
|
1498
|
+
r.textContent = n(Math.round(s + (t - s) * m)), d < 1 && (c = requestAnimationFrame(u));
|
|
1499
|
+
});
|
|
1500
|
+
return () => {
|
|
1501
|
+
cancelAnimationFrame(c), r.textContent = n(t);
|
|
1502
|
+
};
|
|
1503
|
+
}, [e, t, n]);
|
|
1504
|
+
}
|
|
1505
|
+
function Ve(e, t, n, o) {
|
|
1506
|
+
if (t === void 0) return o.groupNoValue;
|
|
1507
|
+
const r = e == null ? void 0 : e.spec;
|
|
1508
|
+
if (r != null && r.group && t instanceof Date) return pn(r.group, t, n, o);
|
|
1509
|
+
const s = r != null && r.ownGroupValue || r == null ? void 0 : r.format;
|
|
1510
|
+
return _e(t, s, n, o) ?? String(t);
|
|
1511
|
+
}
|
|
1512
|
+
function We({ entry: e, group: t, formats: n, wording: o }) {
|
|
1513
|
+
const r = e == null ? void 0 : e.spec;
|
|
1514
|
+
return t.value !== void 0 && (r != null && r.presentation) && !r.ownGroupValue && !r.group ? /* @__PURE__ */ l(Q, { children: r.presentation(t.value, t.rows[0]) }) : /* @__PURE__ */ l(Q, { children: Ve(e, t.value, n, o) });
|
|
1515
|
+
}
|
|
1516
|
+
function qe({
|
|
1517
|
+
group: e,
|
|
1518
|
+
parent: t,
|
|
1519
|
+
entry: n,
|
|
1520
|
+
open: o,
|
|
1521
|
+
hook: r,
|
|
1522
|
+
formats: s,
|
|
1523
|
+
wording: i
|
|
1524
|
+
}) {
|
|
1525
|
+
const a = Ve(n, e.value, s, i), c = s.count(e.rows.length), u = () => r.publicSnapshot.toggleFold(e.path), h = (d) => {
|
|
1526
|
+
if (d.altKey && (d.key === "ArrowLeft" || d.key === "ArrowRight")) {
|
|
1527
|
+
d.preventDefault(), gt(e, d.key === "ArrowLeft", r);
|
|
1528
|
+
return;
|
|
1529
|
+
}
|
|
1530
|
+
if (d.key === "ArrowRight" && !o)
|
|
1531
|
+
d.preventDefault(), u();
|
|
1532
|
+
else if (d.key === "ArrowLeft") {
|
|
1533
|
+
if (d.preventDefault(), o) u();
|
|
1534
|
+
else if (t) {
|
|
1535
|
+
const m = d.currentTarget.closest("table"), w = Array.from((m == null ? void 0 : m.querySelectorAll("[data-fold-path]")) ?? []).find(
|
|
1536
|
+
(k) => k.dataset.foldPath === t.path
|
|
1537
|
+
);
|
|
1538
|
+
w == null || w.focus();
|
|
1539
|
+
}
|
|
1540
|
+
}
|
|
1541
|
+
};
|
|
1542
|
+
return /* @__PURE__ */ l(
|
|
1543
|
+
"button",
|
|
1544
|
+
{
|
|
1545
|
+
type: "button",
|
|
1546
|
+
className: G(f.fold, !o && f.foldClosed),
|
|
1547
|
+
"data-fold-path": e.path,
|
|
1548
|
+
"aria-expanded": o,
|
|
1549
|
+
"aria-label": o ? i.foldGroup(a, c) : i.unfoldGroup(a, c),
|
|
1550
|
+
onKeyDown: h,
|
|
1551
|
+
onClick: (d) => {
|
|
1552
|
+
if (!d.altKey) return u();
|
|
1553
|
+
gt(e, o, r);
|
|
1554
|
+
},
|
|
1555
|
+
children: /* @__PURE__ */ l("svg", { viewBox: "0 0 12 12", width: "12", height: "12", "aria-hidden": "true", children: /* @__PURE__ */ l("path", { d: "M3 4.5 6 7.5 9 4.5", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) })
|
|
1556
|
+
}
|
|
1557
|
+
);
|
|
1558
|
+
}
|
|
1559
|
+
function Pr({ value: e, formats: t }) {
|
|
1560
|
+
const n = re(null);
|
|
1561
|
+
return Br(n, e, t.count), /* @__PURE__ */ l("span", { ref: n, className: f.groupCount, children: t.count(e) });
|
|
1562
|
+
}
|
|
1563
|
+
function Ye({ group: e, entry: t, hook: n, formats: o, wording: r }) {
|
|
1564
|
+
const { selection: s } = n.publicSnapshot, i = e.rows.map(n.rowKey), a = i.filter((u) => s.isSelected(u)).length, c = a === i.length;
|
|
1565
|
+
return /* @__PURE__ */ l(
|
|
1566
|
+
Se,
|
|
1567
|
+
{
|
|
1568
|
+
"aria-label": r.selectGroup(Ve(t, e.value, o, r)),
|
|
1569
|
+
checked: c,
|
|
1570
|
+
indeterminate: a > 0 && !c,
|
|
1571
|
+
onChange: () => {
|
|
1572
|
+
for (const u of i) s.isSelected(u) === c && s.toggle(u);
|
|
1573
|
+
}
|
|
1574
|
+
}
|
|
1575
|
+
);
|
|
1576
|
+
}
|
|
1577
|
+
function gt(e, t, n) {
|
|
1578
|
+
const o = n.publicSnapshot, r = [], s = (i) => {
|
|
1579
|
+
for (const a of i)
|
|
1580
|
+
a.level === e.level ? r.push(a) : s(a.groups);
|
|
1581
|
+
};
|
|
1582
|
+
s(n.companion.groups ?? []);
|
|
1583
|
+
for (const i of r)
|
|
1584
|
+
o.folded.includes(i.path) !== t && o.toggleFold(i.path);
|
|
1585
|
+
}
|
|
1586
|
+
function Gr({
|
|
1587
|
+
line: e,
|
|
1588
|
+
entry: t,
|
|
1589
|
+
selectable: n,
|
|
1590
|
+
hook: o,
|
|
1591
|
+
formats: r,
|
|
1592
|
+
wording: s
|
|
1593
|
+
}) {
|
|
1594
|
+
const i = e.span;
|
|
1595
|
+
return /* @__PURE__ */ l("td", { className: G(f.td, f.spanCell), children: e.first && /* @__PURE__ */ O("span", { className: f.spanValue, children: [
|
|
1596
|
+
n && /* @__PURE__ */ l("span", { className: f.spanSelect, children: /* @__PURE__ */ l(Ye, { group: i, entry: t, hook: o, formats: r, wording: s }) }),
|
|
1597
|
+
/* @__PURE__ */ l(qe, { group: i, parent: e.parents.at(-1), entry: t, open: !0, hook: o, formats: r, wording: s }),
|
|
1598
|
+
/* @__PURE__ */ O("span", { className: f.spanText, title: Ve(t, i.value, r, s), children: [
|
|
1599
|
+
/* @__PURE__ */ l(We, { entry: t, group: i, formats: r, wording: s }),
|
|
1600
|
+
e.continued && /* @__PURE__ */ l("span", { className: f.continued, children: s.groupContinued })
|
|
1601
|
+
] }),
|
|
1602
|
+
/* @__PURE__ */ l("span", { className: f.groupCount, children: r.count(i.rows.length) })
|
|
1603
|
+
] }) });
|
|
1604
|
+
}
|
|
1605
|
+
function pt({
|
|
1606
|
+
line: e,
|
|
1607
|
+
index: t,
|
|
1608
|
+
absolute: n,
|
|
1609
|
+
spanEntry: o,
|
|
1610
|
+
levelEntry: r,
|
|
1611
|
+
columns: s,
|
|
1612
|
+
controlColumns: i,
|
|
1613
|
+
selectable: a,
|
|
1614
|
+
hasActions: c,
|
|
1615
|
+
total: u,
|
|
1616
|
+
siblings: h,
|
|
1617
|
+
depth: d,
|
|
1618
|
+
hook: m,
|
|
1619
|
+
formats: w,
|
|
1620
|
+
wording: k
|
|
1621
|
+
}) {
|
|
1622
|
+
const { group: p } = e, b = e.kind === "header", g = b && !m.publicSnapshot.folded.includes(p.path), _ = s.findIndex((v) => v.spec.aggregate !== void 0), C = _ === -1 ? s.length : _, S = s.slice(C), I = s.find((v) => v.spec.aggregate === "sum" && v.spec.share !== !1), x = n !== void 0, A = /* @__PURE__ */ O("span", { className: f.groupLabel, children: [
|
|
1623
|
+
/* @__PURE__ */ l(qe, { group: p, parent: e.parents.at(-1), entry: r, open: g, hook: m, formats: w, wording: k }),
|
|
1624
|
+
/* @__PURE__ */ l("span", { className: f.groupValue, children: /* @__PURE__ */ l(We, { entry: r, group: p, formats: w, wording: k }) }),
|
|
1625
|
+
/* @__PURE__ */ l(Pr, { value: p.rows.length, formats: w }),
|
|
1626
|
+
b && e.continued && /* @__PURE__ */ l("span", { className: f.continued, children: k.groupContinued })
|
|
1627
|
+
] });
|
|
1628
|
+
return /* @__PURE__ */ O(
|
|
1629
|
+
"tr",
|
|
1630
|
+
{
|
|
1631
|
+
className: G(b ? f.groupHeader : f.groupFolded, x && f.virtualRow),
|
|
1632
|
+
"data-line": e.kind,
|
|
1633
|
+
"data-level": p.level,
|
|
1634
|
+
"data-motion": n !== void 0 || !(b && e.continued) ? `${e.kind}:${p.path}` : void 0,
|
|
1635
|
+
"data-continued": b && e.continued ? "" : void 0,
|
|
1636
|
+
"data-group-first": b ? void 0 : "",
|
|
1637
|
+
"data-group": p.path,
|
|
1638
|
+
"data-row": x ? n : void 0,
|
|
1639
|
+
"aria-rowindex": x ? n + 2 : void 0,
|
|
1640
|
+
"data-index": t,
|
|
1641
|
+
style: b ? { "--u-header-level": p.level } : void 0,
|
|
1642
|
+
"aria-level": b ? p.level + 1 : d,
|
|
1643
|
+
"aria-expanded": g,
|
|
1644
|
+
"aria-posinset": h.indexOf(p) + 1 || void 0,
|
|
1645
|
+
"aria-setsize": h.length || void 0,
|
|
1646
|
+
children: [
|
|
1647
|
+
Array.from({ length: i }, (v, F) => /* @__PURE__ */ l("td", { className: G(f.td, f.control), children: F === 0 && a && b && /* @__PURE__ */ l(Ye, { group: p, entry: r, hook: m, formats: w, wording: k }) }, `c${F}`)),
|
|
1648
|
+
b ? /* @__PURE__ */ l("td", { className: f.td, colSpan: (o ? 1 : 0) + C, style: { paddingLeft: `calc(var(--u-space-3) + ${p.level * 20}px)` }, children: A }) : /* @__PURE__ */ O(Q, { children: [
|
|
1649
|
+
/* @__PURE__ */ l("td", { className: G(f.td, f.spanCell), children: /* @__PURE__ */ O("span", { className: f.spanValue, children: [
|
|
1650
|
+
a && /* @__PURE__ */ l("span", { className: f.spanSelect, children: /* @__PURE__ */ l(Ye, { group: p, entry: o, hook: m, formats: w, wording: k }) }),
|
|
1651
|
+
/* @__PURE__ */ l(qe, { group: p, parent: e.parents.at(-1), entry: o, open: !1, hook: m, formats: w, wording: k }),
|
|
1652
|
+
/* @__PURE__ */ l("span", { className: f.spanText, children: /* @__PURE__ */ l(We, { entry: o, group: p, formats: w, wording: k }) }),
|
|
1653
|
+
/* @__PURE__ */ l("span", { className: f.groupCount, children: w.count(p.rows.length) })
|
|
1654
|
+
] }) }),
|
|
1655
|
+
C > 0 && /* @__PURE__ */ l("td", { className: G(f.td, f.foldedCount), colSpan: C, children: k.entries(p.rows.length, w.count(p.rows.length)) })
|
|
1656
|
+
] }),
|
|
1657
|
+
S.map((v) => /* @__PURE__ */ l(
|
|
1658
|
+
Er,
|
|
1659
|
+
{
|
|
1660
|
+
entry: v,
|
|
1661
|
+
group: p,
|
|
1662
|
+
share: b && v === I,
|
|
1663
|
+
total: u,
|
|
1664
|
+
formats: w,
|
|
1665
|
+
wording: k
|
|
1666
|
+
},
|
|
1667
|
+
v.key
|
|
1668
|
+
)),
|
|
1669
|
+
c && /* @__PURE__ */ l("td", { className: f.td })
|
|
1670
|
+
]
|
|
1671
|
+
}
|
|
1672
|
+
);
|
|
1673
|
+
}
|
|
1674
|
+
function Er({
|
|
1675
|
+
entry: e,
|
|
1676
|
+
group: t,
|
|
1677
|
+
share: n,
|
|
1678
|
+
total: o,
|
|
1679
|
+
formats: r,
|
|
1680
|
+
wording: s
|
|
1681
|
+
}) {
|
|
1682
|
+
const { spec: i } = e;
|
|
1683
|
+
if (!i.aggregate) return /* @__PURE__ */ l("td", { className: f.td });
|
|
1684
|
+
let a = null;
|
|
1685
|
+
if (n && i.aggregate === "sum" && i.share !== !1) {
|
|
1686
|
+
const c = Xe({ id: i.id, read: e.read, aggregate: "sum" }, o), u = t.aggregates[i.id];
|
|
1687
|
+
if (typeof c == "number" && c > 0 && typeof u == "number" && u > 0) {
|
|
1688
|
+
const h = Math.min(1, u / c);
|
|
1689
|
+
a = /* @__PURE__ */ l("span", { className: f.shareBar, style: { width: `${Math.max(2, Math.round(h * 64))}px` }, "aria-hidden": "true" });
|
|
1690
|
+
}
|
|
1691
|
+
}
|
|
1692
|
+
return /* @__PURE__ */ l("td", { className: G(f.td, $t(e, t.rows) && f.numeric, f.aggregateCell), "data-aggregate": typeof i.aggregate == "function" ? "own" : i.aggregate, children: a ? /* @__PURE__ */ O("span", { className: f.shareHost, children: [
|
|
1693
|
+
/* @__PURE__ */ l(Ke, { entry: e, rows: t.rows, formats: r, wording: s }),
|
|
1694
|
+
a
|
|
1695
|
+
] }) : /* @__PURE__ */ l(Ke, { entry: e, rows: t.rows, formats: r, wording: s }) });
|
|
1696
|
+
}
|
|
1697
|
+
function zr(e) {
|
|
1062
1698
|
const t = typeof e.value == "string" ? e.value : void 0;
|
|
1063
1699
|
let n = e.id ?? t;
|
|
1064
|
-
return n === void 0 && (
|
|
1700
|
+
return n === void 0 && (pe(`without-id:${e.label}`, `The column "${e.label}" has a computed value but no id. Its label serves as the id.`), n = e.label), e.footer !== void 0 && pe(`footer:${n}`, `The column "${n}" uses \`footer\`, which is called \`aggregate\` now. The old name goes with the next minor version.`), e.children !== void 0 && typeof e.children != "function" && pe(`children:${n}`, `The children of the column "${n}" are not a function and are passed over.`), {
|
|
1065
1701
|
id: n,
|
|
1066
1702
|
label: e.label,
|
|
1067
1703
|
value: e.value,
|
|
1068
1704
|
presentation: typeof e.children == "function" ? e.children : void 0,
|
|
1069
1705
|
format: e.format,
|
|
1070
|
-
|
|
1706
|
+
aggregate: e.aggregate ?? e.footer,
|
|
1707
|
+
share: e.share,
|
|
1071
1708
|
rowHeader: e.rowHeader === !0,
|
|
1072
1709
|
rightAligned: e.numeric,
|
|
1073
1710
|
width: e.width,
|
|
@@ -1076,217 +1713,321 @@ function Ao(e) {
|
|
|
1076
1713
|
searchable: e.searchable,
|
|
1077
1714
|
filter: e.filter,
|
|
1078
1715
|
ownSortValue: e.sortValue,
|
|
1079
|
-
ownExportValue: e.exportValue
|
|
1716
|
+
ownExportValue: e.exportValue,
|
|
1717
|
+
ownGroupValue: e.groupValue,
|
|
1718
|
+
group: e.group,
|
|
1719
|
+
groupable: e.groupable
|
|
1080
1720
|
};
|
|
1081
1721
|
}
|
|
1082
|
-
function
|
|
1083
|
-
return /* @__PURE__ */ x(Q, { children: [
|
|
1084
|
-
/* @__PURE__ */ c("span", { "aria-hidden": "true", className: f.absent, children: "—" }),
|
|
1085
|
-
/* @__PURE__ */ c(be, { children: e.cellAbsentValue })
|
|
1086
|
-
] });
|
|
1087
|
-
}
|
|
1088
|
-
function xo(e, t, n, o, r) {
|
|
1722
|
+
function jr(e, t, n, o, r) {
|
|
1089
1723
|
if (!t) return n.rowKey(e);
|
|
1090
|
-
const
|
|
1091
|
-
return
|
|
1092
|
-
}
|
|
1093
|
-
const
|
|
1094
|
-
function
|
|
1095
|
-
function t(
|
|
1096
|
-
const
|
|
1097
|
-
return e.registerColumn(
|
|
1724
|
+
const s = t.read(e);
|
|
1725
|
+
return Y(s) ? r.cellAbsentValue : _e(s, t.spec.format, o, r) ?? n.rowKey(e);
|
|
1726
|
+
}
|
|
1727
|
+
const Oe = 34;
|
|
1728
|
+
function Hr(e) {
|
|
1729
|
+
function t(c) {
|
|
1730
|
+
const u = se(), h = Ue($e), d = zr(c);
|
|
1731
|
+
return e.registerColumn(u, d), W(
|
|
1098
1732
|
() => () => {
|
|
1099
|
-
e.removeColumn(
|
|
1733
|
+
e.removeColumn(u), e.commit();
|
|
1100
1734
|
},
|
|
1101
|
-
[
|
|
1102
|
-
),
|
|
1103
|
-
e.ensureColumn(
|
|
1104
|
-
}),
|
|
1735
|
+
[u]
|
|
1736
|
+
), W(() => {
|
|
1737
|
+
e.ensureColumn(u, d), e.checkOrder(), e.commit();
|
|
1738
|
+
}), Mt && h && h.registry !== e && pe(
|
|
1105
1739
|
`foreign:${d.id}`,
|
|
1106
1740
|
`The column "${d.id}" comes from a different useTable call than the table it stands in. It reads the rows of its own hook.`
|
|
1107
|
-
), /* @__PURE__ */
|
|
1741
|
+
), /* @__PURE__ */ l("span", { hidden: !0, "data-umriss-column": u });
|
|
1108
1742
|
}
|
|
1109
|
-
function n({ children:
|
|
1110
|
-
const
|
|
1111
|
-
return e.registerDetail(
|
|
1743
|
+
function n({ children: c }) {
|
|
1744
|
+
const u = se();
|
|
1745
|
+
return e.registerDetail(u, c), W(
|
|
1112
1746
|
() => () => {
|
|
1113
|
-
e.removeDetail(
|
|
1747
|
+
e.removeDetail(u), e.commit();
|
|
1114
1748
|
},
|
|
1115
|
-
[
|
|
1116
|
-
),
|
|
1117
|
-
e.detail || e.registerDetail(
|
|
1749
|
+
[u]
|
|
1750
|
+
), W(() => {
|
|
1751
|
+
e.detail || e.registerDetail(u, c), e.commit();
|
|
1118
1752
|
}), null;
|
|
1119
1753
|
}
|
|
1120
|
-
function o({ children:
|
|
1121
|
-
const
|
|
1122
|
-
return e.registerActionGroup(
|
|
1754
|
+
function o({ children: c }) {
|
|
1755
|
+
const u = se();
|
|
1756
|
+
return e.registerActionGroup(u), W(
|
|
1123
1757
|
() => () => {
|
|
1124
|
-
e.removeActionGroup(
|
|
1758
|
+
e.removeActionGroup(u), e.commit();
|
|
1125
1759
|
},
|
|
1126
|
-
[
|
|
1127
|
-
),
|
|
1128
|
-
e.registerActionGroup(
|
|
1129
|
-
}), /* @__PURE__ */
|
|
1130
|
-
}
|
|
1131
|
-
function r(
|
|
1132
|
-
const
|
|
1133
|
-
label:
|
|
1134
|
-
bulk:
|
|
1135
|
-
tone:
|
|
1136
|
-
onSelect:
|
|
1760
|
+
[u]
|
|
1761
|
+
), W(() => {
|
|
1762
|
+
e.registerActionGroup(u), e.commit();
|
|
1763
|
+
}), /* @__PURE__ */ l(Q, { children: c });
|
|
1764
|
+
}
|
|
1765
|
+
function r(c) {
|
|
1766
|
+
const u = se(), h = {
|
|
1767
|
+
label: c.children,
|
|
1768
|
+
bulk: c.bulk === !0,
|
|
1769
|
+
tone: c.tone ?? "default",
|
|
1770
|
+
onSelect: c.onSelect
|
|
1137
1771
|
};
|
|
1138
|
-
return e.registerAction(
|
|
1772
|
+
return e.registerAction(u, h), W(
|
|
1139
1773
|
() => () => {
|
|
1140
|
-
e.removeAction(
|
|
1774
|
+
e.removeAction(u), e.commit();
|
|
1141
1775
|
},
|
|
1142
|
-
[
|
|
1143
|
-
),
|
|
1144
|
-
e.ensureAction(
|
|
1145
|
-
}), /* @__PURE__ */
|
|
1146
|
-
}
|
|
1147
|
-
function
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1776
|
+
[u]
|
|
1777
|
+
), W(() => {
|
|
1778
|
+
e.ensureAction(u, h), e.checkOrder(), e.commit();
|
|
1779
|
+
}), /* @__PURE__ */ l("span", { hidden: !0, "data-umriss-action": u });
|
|
1780
|
+
}
|
|
1781
|
+
function s(c) {
|
|
1782
|
+
const u = se(), h = typeof c.value == "string" ? c.value : void 0, m = {
|
|
1783
|
+
id: c.id ?? h ?? c.label,
|
|
1784
|
+
label: c.label,
|
|
1785
|
+
value: c.value,
|
|
1786
|
+
rowHeader: !1,
|
|
1787
|
+
resizable: !1,
|
|
1788
|
+
ownGroupValue: c.groupValue,
|
|
1789
|
+
group: c.group,
|
|
1790
|
+
groupable: !0
|
|
1791
|
+
};
|
|
1792
|
+
return e.registerGroupKey(u, m), W(
|
|
1793
|
+
() => () => {
|
|
1794
|
+
e.removeGroupKey(u), e.commit();
|
|
1795
|
+
},
|
|
1796
|
+
[u]
|
|
1797
|
+
), W(() => {
|
|
1798
|
+
e.ensureGroupKey(u, m), e.checkOrder(), e.commit();
|
|
1799
|
+
}), /* @__PURE__ */ l("span", { hidden: !0, "data-umriss-groupkey": u });
|
|
1800
|
+
}
|
|
1801
|
+
function i(c) {
|
|
1802
|
+
e.beginPass(), e.setStickyRowHeader(c.stickyRowHeader === !0), e.setTableGroupable(c.groupable !== !1);
|
|
1803
|
+
const u = re(null), [h, d] = H(null);
|
|
1804
|
+
W(() => {
|
|
1805
|
+
e.children = u.current, e.checkOrder(), e.commit();
|
|
1152
1806
|
});
|
|
1153
|
-
const
|
|
1154
|
-
return /* @__PURE__ */
|
|
1155
|
-
/* @__PURE__ */
|
|
1156
|
-
/* @__PURE__ */
|
|
1157
|
-
/* @__PURE__ */
|
|
1158
|
-
/* @__PURE__ */
|
|
1807
|
+
const m = $(() => ({ registry: e, footerTarget: h }), [h]);
|
|
1808
|
+
return /* @__PURE__ */ l($e.Provider, { value: m, children: /* @__PURE__ */ O("div", { className: G(f.frame, c.className), children: [
|
|
1809
|
+
/* @__PURE__ */ l("div", { ref: u, className: f.children, children: c.children }),
|
|
1810
|
+
/* @__PURE__ */ l($r, { registry: e }),
|
|
1811
|
+
/* @__PURE__ */ l(Kr, { registry: e, props: c }),
|
|
1812
|
+
/* @__PURE__ */ l("div", { ref: d, className: f.footerTarget })
|
|
1159
1813
|
] }) });
|
|
1160
1814
|
}
|
|
1161
|
-
const
|
|
1162
|
-
return
|
|
1815
|
+
const a = { Table: i, Column: t, RowDetail: n, RowActions: o, Action: r, GroupBy: s };
|
|
1816
|
+
return mr(i, e), a;
|
|
1163
1817
|
}
|
|
1164
|
-
function
|
|
1165
|
-
return
|
|
1818
|
+
function $r({ registry: e }) {
|
|
1819
|
+
return Le(e.subscribe, e.bodyVersion, e.bodyVersion), !e.hook || !e.needsOwnToolbar() ? null : /* @__PURE__ */ l(jt, { registry: e, own: !0 });
|
|
1166
1820
|
}
|
|
1167
|
-
function
|
|
1821
|
+
function Kr({ registry: e, props: t }) {
|
|
1168
1822
|
const {
|
|
1169
1823
|
selectable: n = !1,
|
|
1170
1824
|
stickyHeader: o = !1,
|
|
1171
1825
|
stickyRowHeader: r = !1,
|
|
1172
|
-
striped:
|
|
1173
|
-
density:
|
|
1174
|
-
maxHeight:
|
|
1175
|
-
empty:
|
|
1826
|
+
striped: s = !1,
|
|
1827
|
+
density: i,
|
|
1828
|
+
maxHeight: a,
|
|
1829
|
+
empty: c,
|
|
1176
1830
|
loading: u = !1,
|
|
1177
|
-
rowProps:
|
|
1178
|
-
ariaLabel:
|
|
1831
|
+
rowProps: h,
|
|
1832
|
+
ariaLabel: d
|
|
1179
1833
|
} = t;
|
|
1180
|
-
|
|
1181
|
-
const
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1834
|
+
Le(e.subscribe, e.bodyVersion, e.bodyVersion);
|
|
1835
|
+
const m = U(), w = ue(), k = Tt(i, "regular"), p = se(), b = re(null);
|
|
1836
|
+
W(() => {
|
|
1837
|
+
var j, M;
|
|
1838
|
+
const y = b.current;
|
|
1839
|
+
if (!y || !o) return;
|
|
1840
|
+
const R = ((j = y.tHead) == null ? void 0 : j.getBoundingClientRect().height) ?? 0, K = ((M = y.querySelector("tr[data-line='header']")) == null ? void 0 : M.getBoundingClientRect().height) ?? 0;
|
|
1841
|
+
y.style.setProperty("--u-table-head", `${R}px`), y.style.setProperty("--u-table-group-header", `${K}px`), y.parentElement && mt(y.parentElement);
|
|
1842
|
+
}), W(() => {
|
|
1843
|
+
const y = e.takeFocusBeforeFold(), R = b.current;
|
|
1844
|
+
if (!y || !R || y.table !== R || y.element.isConnected) return;
|
|
1845
|
+
const K = Array.from(R.querySelectorAll("[data-fold-path]")), j = JSON.parse(y.group);
|
|
1846
|
+
for (let M = j.length; M > 0; M--) {
|
|
1847
|
+
const J = JSON.stringify(j.slice(0, M)), Z = K.find((T) => T.dataset.foldPath === J);
|
|
1848
|
+
if (Z) return Z.focus();
|
|
1849
|
+
}
|
|
1850
|
+
});
|
|
1851
|
+
const g = e.hook && !e.hook.companion.virtual ? e.hook.publicSnapshot : null;
|
|
1852
|
+
Ir(b, g ? `${g.grouping.join("|")}#${g.folded.join("|")}` : "");
|
|
1853
|
+
const _ = e.hook;
|
|
1854
|
+
if (!_) return null;
|
|
1855
|
+
const C = _.publicSnapshot, S = e.projection(), I = e.rowHeader(), x = Et(e), A = e.detail, v = e.hasRowActions() ? e.actions.ordered() : [], F = _.companion.virtual, L = C.grouping, N = L.length > 0 ? S.visibleLines : void 0, V = N ? e.groupingEntries(_.rows) : [], z = (y) => V.find((R) => R.spec.id === y), P = N && L.length > 1 ? z(L.at(-1)) : void 0, q = N ? x.filter((y) => !L.includes(y.spec.id)) : x, ie = (n ? 1 : 0) + (A ? 1 : 0), ae = ie + (P ? 1 : 0) + q.length + (v.length > 0 ? 1 : 0), de = ie * Oe, fe = (y) => r && y === I, we = S.visible, be = !u && q.some((y) => y.spec.aggregate), ye = C.search !== "" || Object.keys(C.filter).length > 0, le = (y, R, K, j) => /* @__PURE__ */ l(
|
|
1856
|
+
Wr,
|
|
1185
1857
|
{
|
|
1186
|
-
row:
|
|
1187
|
-
index:
|
|
1188
|
-
absolute:
|
|
1858
|
+
row: y,
|
|
1859
|
+
index: R,
|
|
1860
|
+
absolute: F ? K : void 0,
|
|
1189
1861
|
registry: e,
|
|
1190
|
-
hook:
|
|
1191
|
-
columns:
|
|
1192
|
-
|
|
1862
|
+
hook: _,
|
|
1863
|
+
columns: q,
|
|
1864
|
+
line: j,
|
|
1865
|
+
spanEntry: P,
|
|
1866
|
+
header: I,
|
|
1193
1867
|
selectable: n,
|
|
1194
|
-
actions:
|
|
1868
|
+
actions: v,
|
|
1195
1869
|
stickyRowHeader: r,
|
|
1196
|
-
rowHeaderLeft:
|
|
1197
|
-
columnCount:
|
|
1198
|
-
rowProps:
|
|
1199
|
-
baseId:
|
|
1200
|
-
formats:
|
|
1201
|
-
wording:
|
|
1870
|
+
rowHeaderLeft: de,
|
|
1871
|
+
columnCount: ae,
|
|
1872
|
+
rowProps: h,
|
|
1873
|
+
baseId: p,
|
|
1874
|
+
formats: w,
|
|
1875
|
+
wording: m
|
|
1202
1876
|
},
|
|
1203
|
-
|
|
1877
|
+
_.rowKey(y)
|
|
1204
1878
|
);
|
|
1205
|
-
let
|
|
1206
|
-
|
|
1207
|
-
/* @__PURE__ */
|
|
1208
|
-
|
|
1209
|
-
|
|
1879
|
+
let te;
|
|
1880
|
+
if (u)
|
|
1881
|
+
te = /* @__PURE__ */ l("tbody", { children: /* @__PURE__ */ l(Xr, { columns: ae }) });
|
|
1882
|
+
else if (S.filtered.length === 0)
|
|
1883
|
+
te = /* @__PURE__ */ l("tbody", { children: /* @__PURE__ */ l("tr", { children: /* @__PURE__ */ l("td", { colSpan: ae, className: f.emptyCell, children: /* @__PURE__ */ l("div", { className: f.empty, children: _.admitted.length > 0 && ye ? /* @__PURE__ */ O(Q, { children: [
|
|
1884
|
+
/* @__PURE__ */ l("p", { className: f.emptyTitle, children: m.nothingMatchesFilters }),
|
|
1885
|
+
/* @__PURE__ */ l(ee, { size: "sm", variant: "ghost", onClick: () => zt(C), children: m.resetAll })
|
|
1886
|
+
] }) : c ?? /* @__PURE__ */ l("p", { className: f.emptyTitle, children: m.noEntries }) }) }) }) });
|
|
1887
|
+
else if (N) {
|
|
1888
|
+
const y = F ? Rt(N).map((M) => M.kind === "folded" || !M.continued ? M : { ...M, continued: !1 }) : N, R = y.length - N.length, K = F && F.from > 0 ? F.fillerBefore / F.from : 0, j = (M, J) => {
|
|
1889
|
+
var D, E;
|
|
1890
|
+
const Z = J - R, T = F ? F.from + Z : Z;
|
|
1891
|
+
return Z < 0 ? M.kind === "row" ? null : /* @__PURE__ */ l(
|
|
1892
|
+
pt,
|
|
1893
|
+
{
|
|
1894
|
+
line: M,
|
|
1895
|
+
index: J,
|
|
1896
|
+
absolute: void 0,
|
|
1897
|
+
spanEntry: P,
|
|
1898
|
+
levelEntry: z(L[M.group.level]),
|
|
1899
|
+
columns: q,
|
|
1900
|
+
controlColumns: ie,
|
|
1901
|
+
selectable: n,
|
|
1902
|
+
hasActions: v.length > 0,
|
|
1903
|
+
total: S.filtered,
|
|
1904
|
+
siblings: ((D = M.parents.at(-1)) == null ? void 0 : D.groups) ?? S.groups ?? [],
|
|
1905
|
+
depth: L.length,
|
|
1906
|
+
hook: _,
|
|
1907
|
+
formats: w,
|
|
1908
|
+
wording: m
|
|
1909
|
+
},
|
|
1910
|
+
`${M.kind}:${M.group.path}:repeated`
|
|
1911
|
+
) : M.kind === "row" ? le(M.row, Z, T, M) : /* @__PURE__ */ l(
|
|
1912
|
+
pt,
|
|
1913
|
+
{
|
|
1914
|
+
line: M,
|
|
1915
|
+
index: Z,
|
|
1916
|
+
absolute: F ? T : void 0,
|
|
1917
|
+
spanEntry: P,
|
|
1918
|
+
levelEntry: z(L[M.group.level]),
|
|
1919
|
+
columns: q,
|
|
1920
|
+
controlColumns: ie,
|
|
1921
|
+
selectable: n,
|
|
1922
|
+
hasActions: v.length > 0,
|
|
1923
|
+
total: S.filtered,
|
|
1924
|
+
siblings: ((E = M.parents.at(-1)) == null ? void 0 : E.groups) ?? S.groups ?? [],
|
|
1925
|
+
depth: L.length,
|
|
1926
|
+
hook: _,
|
|
1927
|
+
formats: w,
|
|
1928
|
+
wording: m
|
|
1929
|
+
},
|
|
1930
|
+
`${M.kind}:${M.group.path}${M.kind === "header" && M.continued ? ":continued" : ""}`
|
|
1931
|
+
);
|
|
1932
|
+
};
|
|
1933
|
+
te = F ? /* @__PURE__ */ l(
|
|
1934
|
+
kt,
|
|
1935
|
+
{
|
|
1936
|
+
virtual: { ...F, fillerBefore: Math.max(0, F.fillerBefore - R * K) },
|
|
1937
|
+
colSpan: ae,
|
|
1938
|
+
children: y.map(j)
|
|
1939
|
+
}
|
|
1940
|
+
) : /* @__PURE__ */ l("tbody", { children: N.map(j) });
|
|
1941
|
+
} else F ? te = /* @__PURE__ */ l(kt, { virtual: F, colSpan: ae, children: we.map((y, R) => le(y, R, F.from + R)) }) : te = /* @__PURE__ */ l("tbody", { children: we.map((y, R) => le(y, R, R)) });
|
|
1942
|
+
return /* @__PURE__ */ l(
|
|
1210
1943
|
"div",
|
|
1211
1944
|
{
|
|
1212
|
-
ref:
|
|
1213
|
-
onScroll:
|
|
1945
|
+
ref: F == null ? void 0 : F.scrollRef,
|
|
1946
|
+
onScroll: (y) => {
|
|
1947
|
+
F == null || F.onScroll(), N && o && mt(y.currentTarget);
|
|
1948
|
+
},
|
|
1214
1949
|
className: f.scroll,
|
|
1215
|
-
style:
|
|
1216
|
-
children: /* @__PURE__ */
|
|
1950
|
+
style: a ? { maxHeight: a } : void 0,
|
|
1951
|
+
children: /* @__PURE__ */ O(
|
|
1217
1952
|
"table",
|
|
1218
1953
|
{
|
|
1219
|
-
|
|
1220
|
-
|
|
1954
|
+
ref: b,
|
|
1955
|
+
role: N ? "treegrid" : void 0,
|
|
1956
|
+
"data-depth": N ? L.length : void 0,
|
|
1957
|
+
style: N ? { "--u-header-levels": L.length - 1 } : void 0,
|
|
1958
|
+
"aria-label": d,
|
|
1959
|
+
"aria-rowcount": F ? (S.lines ?? S.filtered).length + 1 + (be ? 1 : 0) : void 0,
|
|
1221
1960
|
"aria-busy": u || void 0,
|
|
1222
|
-
className:
|
|
1961
|
+
className: G(
|
|
1223
1962
|
f.table,
|
|
1224
|
-
|
|
1963
|
+
k === "compact" && f.compact,
|
|
1225
1964
|
o && f.sticky,
|
|
1226
|
-
|
|
1965
|
+
s && f.striped
|
|
1227
1966
|
),
|
|
1228
1967
|
children: [
|
|
1229
|
-
/* @__PURE__ */
|
|
1230
|
-
n && /* @__PURE__ */
|
|
1968
|
+
/* @__PURE__ */ l("thead", { children: /* @__PURE__ */ O("tr", { "aria-rowindex": F ? 1 : void 0, children: [
|
|
1969
|
+
n && /* @__PURE__ */ l(
|
|
1231
1970
|
"th",
|
|
1232
1971
|
{
|
|
1233
1972
|
scope: "col",
|
|
1234
|
-
className:
|
|
1973
|
+
className: G(f.th, f.control, r && f.stickyCell),
|
|
1235
1974
|
style: r ? { left: 0 } : void 0,
|
|
1236
|
-
children: /* @__PURE__ */
|
|
1237
|
-
|
|
1975
|
+
children: /* @__PURE__ */ l(
|
|
1976
|
+
Se,
|
|
1238
1977
|
{
|
|
1239
|
-
"aria-label":
|
|
1240
|
-
checked:
|
|
1241
|
-
indeterminate:
|
|
1242
|
-
onChange:
|
|
1978
|
+
"aria-label": m.selectAllRows,
|
|
1979
|
+
checked: C.selection.allSelected,
|
|
1980
|
+
indeterminate: C.selection.someSelected,
|
|
1981
|
+
onChange: C.selection.toggleAll
|
|
1243
1982
|
}
|
|
1244
1983
|
)
|
|
1245
1984
|
}
|
|
1246
1985
|
),
|
|
1247
|
-
|
|
1986
|
+
A && /* @__PURE__ */ l(
|
|
1248
1987
|
"td",
|
|
1249
1988
|
{
|
|
1250
|
-
className:
|
|
1251
|
-
style: r ? { left: (n ? 1 : 0) *
|
|
1989
|
+
className: G(f.th, f.control, r && f.stickyCell),
|
|
1990
|
+
style: r ? { left: (n ? 1 : 0) * Oe } : void 0
|
|
1252
1991
|
}
|
|
1253
1992
|
),
|
|
1254
|
-
|
|
1255
|
-
|
|
1993
|
+
P && (e.columnById(P.spec.id) === P ? /* @__PURE__ */ l(wt, { entry: P, registry: e, hook: _, sticky: !1, left: de }) : /* @__PURE__ */ l("th", { scope: "col", className: f.th, children: P.spec.label })),
|
|
1994
|
+
q.map((y) => /* @__PURE__ */ l(
|
|
1995
|
+
wt,
|
|
1256
1996
|
{
|
|
1257
|
-
entry:
|
|
1997
|
+
entry: y,
|
|
1258
1998
|
registry: e,
|
|
1259
|
-
hook:
|
|
1260
|
-
sticky:
|
|
1261
|
-
left:
|
|
1999
|
+
hook: _,
|
|
2000
|
+
sticky: fe(y),
|
|
2001
|
+
left: de
|
|
1262
2002
|
},
|
|
1263
|
-
|
|
2003
|
+
y.key
|
|
1264
2004
|
)),
|
|
1265
|
-
|
|
2005
|
+
v.length > 0 && /* @__PURE__ */ l("th", { scope: "col", className: G(f.th, f.actionsCell), children: /* @__PURE__ */ l(Re, { children: m.rowActions }) })
|
|
1266
2006
|
] }) }),
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
Array.from({ length:
|
|
2007
|
+
te,
|
|
2008
|
+
be && /* @__PURE__ */ l("tfoot", { children: /* @__PURE__ */ O("tr", { "aria-rowindex": F ? (S.lines ?? S.filtered).length + 2 : void 0, children: [
|
|
2009
|
+
Array.from({ length: ie }, (y, R) => /* @__PURE__ */ l(
|
|
1270
2010
|
"td",
|
|
1271
2011
|
{
|
|
1272
|
-
className:
|
|
1273
|
-
style: r ? { left:
|
|
2012
|
+
className: G(f.td, f.control, r && f.stickyCell),
|
|
2013
|
+
style: r ? { left: R * Oe } : void 0
|
|
1274
2014
|
},
|
|
1275
|
-
|
|
2015
|
+
R
|
|
1276
2016
|
)),
|
|
1277
|
-
|
|
1278
|
-
|
|
2017
|
+
P && /* @__PURE__ */ l("td", { className: f.td }),
|
|
2018
|
+
q.map((y) => /* @__PURE__ */ l(
|
|
2019
|
+
Yr,
|
|
1279
2020
|
{
|
|
1280
|
-
entry:
|
|
1281
|
-
rows:
|
|
1282
|
-
formats:
|
|
1283
|
-
wording:
|
|
1284
|
-
sticky:
|
|
1285
|
-
left:
|
|
2021
|
+
entry: y,
|
|
2022
|
+
rows: S.filtered,
|
|
2023
|
+
formats: w,
|
|
2024
|
+
wording: m,
|
|
2025
|
+
sticky: fe(y),
|
|
2026
|
+
left: de
|
|
1286
2027
|
},
|
|
1287
|
-
|
|
2028
|
+
y.key
|
|
1288
2029
|
)),
|
|
1289
|
-
|
|
2030
|
+
v.length > 0 && /* @__PURE__ */ l("td", { className: f.td })
|
|
1290
2031
|
] }) })
|
|
1291
2032
|
]
|
|
1292
2033
|
}
|
|
@@ -1294,92 +2035,98 @@ function Ro({ registry: e, props: t }) {
|
|
|
1294
2035
|
}
|
|
1295
2036
|
);
|
|
1296
2037
|
}
|
|
1297
|
-
function
|
|
2038
|
+
function mt(e) {
|
|
2039
|
+
for (const t of Array.from(e.querySelectorAll("tbody > tr[data-line='header']"))) {
|
|
2040
|
+
const n = t.cells[t.cells.length - 1], o = !!n && n.getBoundingClientRect().top > t.getBoundingClientRect().top + 0.5;
|
|
2041
|
+
t.toggleAttribute("data-stuck", o);
|
|
2042
|
+
}
|
|
2043
|
+
}
|
|
2044
|
+
function wt({
|
|
1298
2045
|
entry: e,
|
|
1299
2046
|
registry: t,
|
|
1300
2047
|
hook: n,
|
|
1301
2048
|
sticky: o,
|
|
1302
2049
|
left: r
|
|
1303
2050
|
}) {
|
|
1304
|
-
const { spec:
|
|
1305
|
-
|
|
1306
|
-
const
|
|
1307
|
-
if (!
|
|
1308
|
-
const
|
|
1309
|
-
|
|
1310
|
-
const
|
|
1311
|
-
|
|
1312
|
-
},
|
|
1313
|
-
|
|
2051
|
+
const { spec: s } = e, i = n.publicSnapshot, a = t.kindOf(e, n.rows), c = Ot(a, s.rightAligned), u = t.isSortable(e, n.rows), h = s.id, d = i.sort.findIndex((x) => x.column === h), m = d === -1 ? void 0 : i.sort[d].direction, w = i.sort.length > 1 && d !== -1 ? d + 1 : void 0, k = i.widths[h], p = 48, b = (x) => {
|
|
2052
|
+
x.stopPropagation(), x.preventDefault();
|
|
2053
|
+
const A = x.currentTarget, v = A.closest("th");
|
|
2054
|
+
if (!v) return;
|
|
2055
|
+
const F = x.clientX, L = v.getBoundingClientRect().width, N = x.pointerId;
|
|
2056
|
+
A.setPointerCapture(N);
|
|
2057
|
+
const V = (P) => {
|
|
2058
|
+
P.pointerId === N && i.setWidth(h, Math.max(p, L + (P.clientX - F)));
|
|
2059
|
+
}, z = (P) => {
|
|
2060
|
+
P.pointerId === N && (A.removeEventListener("pointermove", V), A.removeEventListener("pointerup", z), A.removeEventListener("pointercancel", z), A.hasPointerCapture(N) && A.releasePointerCapture(N));
|
|
1314
2061
|
};
|
|
1315
|
-
|
|
1316
|
-
},
|
|
1317
|
-
const
|
|
1318
|
-
if (!
|
|
1319
|
-
const
|
|
1320
|
-
|
|
1321
|
-
let
|
|
1322
|
-
for (const
|
|
1323
|
-
if (
|
|
1324
|
-
const
|
|
1325
|
-
|
|
2062
|
+
A.addEventListener("pointermove", V), A.addEventListener("pointerup", z), A.addEventListener("pointercancel", z);
|
|
2063
|
+
}, g = (x) => {
|
|
2064
|
+
const A = x == null ? void 0 : x.parentElement, v = x == null ? void 0 : x.closest("table");
|
|
2065
|
+
if (!x || !A || !v) return;
|
|
2066
|
+
const F = Array.from(A.children).indexOf(x), L = A.children.length, N = { cell: x.style.width, table: v.style.width };
|
|
2067
|
+
x.style.width = "", v.style.width = "auto";
|
|
2068
|
+
let V = 0;
|
|
2069
|
+
for (const z of Array.from(v.rows)) {
|
|
2070
|
+
if (z.cells.length !== L) continue;
|
|
2071
|
+
const P = z.cells[F];
|
|
2072
|
+
P && (V = Math.max(V, P.scrollWidth));
|
|
1326
2073
|
}
|
|
1327
|
-
|
|
1328
|
-
},
|
|
1329
|
-
if (!
|
|
1330
|
-
const
|
|
1331
|
-
if (!
|
|
1332
|
-
|
|
1333
|
-
const
|
|
1334
|
-
if (
|
|
1335
|
-
|
|
2074
|
+
x.style.width = N.cell, v.style.width = N.table, V > 0 && i.setWidth(h, Math.max(p, V + 1));
|
|
2075
|
+
}, _ = (x) => {
|
|
2076
|
+
if (!s.resizable || !x.altKey) return;
|
|
2077
|
+
const A = x.key === "ArrowRight", v = x.key === "ArrowLeft", F = x.key === "Home";
|
|
2078
|
+
if (!A && !v && !F) return;
|
|
2079
|
+
x.preventDefault();
|
|
2080
|
+
const L = x.currentTarget;
|
|
2081
|
+
if (F) {
|
|
2082
|
+
g(L);
|
|
1336
2083
|
return;
|
|
1337
2084
|
}
|
|
1338
|
-
const
|
|
1339
|
-
|
|
1340
|
-
},
|
|
2085
|
+
const N = L.getBoundingClientRect().width, V = x.shiftKey ? 32 : 8;
|
|
2086
|
+
i.setWidth(h, Math.max(p, N + (A ? V : -V)));
|
|
2087
|
+
}, C = u ? /* @__PURE__ */ O(
|
|
1341
2088
|
"button",
|
|
1342
2089
|
{
|
|
1343
2090
|
type: "button",
|
|
1344
2091
|
className: f.sortButton,
|
|
1345
|
-
onClick: (
|
|
2092
|
+
onClick: (x) => i.toggleSort(h, x.shiftKey || x.metaKey),
|
|
1346
2093
|
children: [
|
|
1347
|
-
/* @__PURE__ */
|
|
1348
|
-
|
|
1349
|
-
/* @__PURE__ */
|
|
1350
|
-
/* @__PURE__ */
|
|
1351
|
-
/* @__PURE__ */
|
|
2094
|
+
/* @__PURE__ */ l("span", { children: s.label }),
|
|
2095
|
+
w !== void 0 && /* @__PURE__ */ l("span", { className: f.sortRank, "aria-hidden": "true", children: w }),
|
|
2096
|
+
/* @__PURE__ */ l("span", { className: G(f.sortIndicator, m && f.sortActive), "aria-hidden": "true", children: m ? /* @__PURE__ */ l("svg", { viewBox: "0 0 10 10", width: "10", height: "10", className: G(f.sortArrow, m === "desc" && f.sortArrowDesc), children: /* @__PURE__ */ l("path", { d: "M2.2 6.2 5 3.4l2.8 2.8", fill: "none", stroke: "currentColor", strokeWidth: "1.6", strokeLinecap: "round", strokeLinejoin: "round" }) }) : /* @__PURE__ */ O("svg", { viewBox: "0 0 10 12", width: "10", height: "12", children: [
|
|
2097
|
+
/* @__PURE__ */ l("path", { d: "M2.4 4.4 5 1.8l2.6 2.6", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }),
|
|
2098
|
+
/* @__PURE__ */ l("path", { d: "M2.4 7.6 5 10.2l2.6-2.6", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" })
|
|
1352
2099
|
] }) })
|
|
1353
2100
|
]
|
|
1354
2101
|
}
|
|
1355
|
-
) :
|
|
1356
|
-
return /* @__PURE__ */
|
|
2102
|
+
) : s.label, S = m === "asc" ? "ascending" : m === "desc" ? "descending" : "none", I = me(s.filter) !== void 0 && !(s.filter === "list" && a === "other");
|
|
2103
|
+
return /* @__PURE__ */ O(
|
|
1357
2104
|
"th",
|
|
1358
2105
|
{
|
|
1359
2106
|
scope: "col",
|
|
1360
|
-
"data-column":
|
|
1361
|
-
"aria-sort": u ?
|
|
1362
|
-
tabIndex:
|
|
1363
|
-
onKeyDown:
|
|
1364
|
-
className:
|
|
2107
|
+
"data-column": h,
|
|
2108
|
+
"aria-sort": u ? S : void 0,
|
|
2109
|
+
tabIndex: s.resizable && !u ? 0 : void 0,
|
|
2110
|
+
onKeyDown: _,
|
|
2111
|
+
className: G(f.th, c && f.numeric, o && f.stickyCell),
|
|
1365
2112
|
style: {
|
|
1366
|
-
...
|
|
2113
|
+
...k !== void 0 ? { width: k } : {},
|
|
1367
2114
|
...o ? { left: r } : {}
|
|
1368
2115
|
},
|
|
1369
2116
|
children: [
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
/* @__PURE__ */
|
|
1373
|
-
] }) :
|
|
1374
|
-
|
|
2117
|
+
I ? /* @__PURE__ */ O("span", { className: f.thFlex, children: [
|
|
2118
|
+
C,
|
|
2119
|
+
/* @__PURE__ */ l(br, { entry: e, registry: t, hook: n })
|
|
2120
|
+
] }) : C,
|
|
2121
|
+
s.resizable && /* @__PURE__ */ l(
|
|
1375
2122
|
"span",
|
|
1376
2123
|
{
|
|
1377
2124
|
role: "presentation",
|
|
1378
2125
|
className: f.grip,
|
|
1379
|
-
onPointerDown:
|
|
1380
|
-
onClick: (
|
|
1381
|
-
onDoubleClick: (
|
|
1382
|
-
|
|
2126
|
+
onPointerDown: b,
|
|
2127
|
+
onClick: (x) => x.stopPropagation(),
|
|
2128
|
+
onDoubleClick: (x) => {
|
|
2129
|
+
x.stopPropagation(), g(x.currentTarget.closest("th"));
|
|
1383
2130
|
}
|
|
1384
2131
|
}
|
|
1385
2132
|
)
|
|
@@ -1387,612 +2134,657 @@ function Io({
|
|
|
1387
2134
|
}
|
|
1388
2135
|
);
|
|
1389
2136
|
}
|
|
1390
|
-
function
|
|
2137
|
+
function Wr({
|
|
1391
2138
|
row: e,
|
|
1392
2139
|
index: t,
|
|
1393
2140
|
absolute: n,
|
|
1394
2141
|
registry: o,
|
|
1395
2142
|
hook: r,
|
|
1396
|
-
columns:
|
|
1397
|
-
header:
|
|
1398
|
-
selectable:
|
|
1399
|
-
actions:
|
|
2143
|
+
columns: s,
|
|
2144
|
+
header: i,
|
|
2145
|
+
selectable: a,
|
|
2146
|
+
actions: c,
|
|
1400
2147
|
stickyRowHeader: u,
|
|
1401
|
-
rowHeaderLeft:
|
|
1402
|
-
columnCount:
|
|
1403
|
-
rowProps:
|
|
1404
|
-
baseId:
|
|
1405
|
-
formats:
|
|
1406
|
-
wording:
|
|
2148
|
+
rowHeaderLeft: h,
|
|
2149
|
+
columnCount: d,
|
|
2150
|
+
rowProps: m,
|
|
2151
|
+
baseId: w,
|
|
2152
|
+
formats: k,
|
|
2153
|
+
wording: p,
|
|
2154
|
+
line: b,
|
|
2155
|
+
spanEntry: g
|
|
1407
2156
|
}) {
|
|
1408
|
-
const
|
|
1409
|
-
return /* @__PURE__ */
|
|
1410
|
-
/* @__PURE__ */
|
|
2157
|
+
const _ = Ue(Wt), C = r.publicSnapshot, S = r.rowKey(e), I = jr(e, i, r, k, p), x = o.detail, A = x !== null && C.expanded.includes(S), v = `${w}-detail-${t}`, { className: F, ...L } = (m == null ? void 0 : m(e)) ?? {}, N = n !== void 0, V = b ? b.span ?? b.parents.at(-1) : void 0;
|
|
2158
|
+
return /* @__PURE__ */ O(Q, { children: [
|
|
2159
|
+
/* @__PURE__ */ O(
|
|
1411
2160
|
"tr",
|
|
1412
2161
|
{
|
|
1413
|
-
...
|
|
1414
|
-
className:
|
|
1415
|
-
"data-row":
|
|
1416
|
-
|
|
1417
|
-
"data-
|
|
1418
|
-
"
|
|
2162
|
+
...L,
|
|
2163
|
+
className: G(F, N && f.virtualRow),
|
|
2164
|
+
"data-row": N ? n : void 0,
|
|
2165
|
+
"data-line": b ? "row" : void 0,
|
|
2166
|
+
"data-motion": S,
|
|
2167
|
+
"data-group-first": b != null && b.first ? "" : void 0,
|
|
2168
|
+
"data-group": V == null ? void 0 : V.path,
|
|
2169
|
+
"aria-level": b ? b.parents.length + 1 : void 0,
|
|
2170
|
+
"aria-posinset": V ? V.rows.indexOf(e) + 1 : void 0,
|
|
2171
|
+
"aria-setsize": V == null ? void 0 : V.rows.length,
|
|
2172
|
+
tabIndex: N ? n === _ ? 0 : -1 : void 0,
|
|
2173
|
+
"data-even": N && n % 2 === 1 ? "" : void 0,
|
|
2174
|
+
"aria-rowindex": N ? n + 2 : void 0,
|
|
1419
2175
|
children: [
|
|
1420
|
-
|
|
2176
|
+
a && /* @__PURE__ */ l(
|
|
1421
2177
|
"td",
|
|
1422
2178
|
{
|
|
1423
|
-
className:
|
|
2179
|
+
className: G(f.td, f.control, u && f.stickyCell),
|
|
1424
2180
|
style: u ? { left: 0 } : void 0,
|
|
1425
|
-
children: /* @__PURE__ */
|
|
1426
|
-
|
|
2181
|
+
children: /* @__PURE__ */ l(
|
|
2182
|
+
Se,
|
|
1427
2183
|
{
|
|
1428
|
-
"aria-label":
|
|
1429
|
-
checked:
|
|
1430
|
-
onChange: () =>
|
|
2184
|
+
"aria-label": p.selectRow(I),
|
|
2185
|
+
checked: C.selection.isSelected(S),
|
|
2186
|
+
onChange: () => C.selection.toggle(S)
|
|
1431
2187
|
}
|
|
1432
2188
|
)
|
|
1433
2189
|
}
|
|
1434
2190
|
),
|
|
1435
|
-
|
|
2191
|
+
x && /* @__PURE__ */ l(
|
|
1436
2192
|
"td",
|
|
1437
2193
|
{
|
|
1438
|
-
className:
|
|
1439
|
-
style: u ? { left: (
|
|
1440
|
-
children: /* @__PURE__ */
|
|
2194
|
+
className: G(f.td, f.control, u && f.stickyCell),
|
|
2195
|
+
style: u ? { left: (a ? 1 : 0) * Oe } : void 0,
|
|
2196
|
+
children: /* @__PURE__ */ l(
|
|
1441
2197
|
"button",
|
|
1442
2198
|
{
|
|
1443
2199
|
type: "button",
|
|
1444
|
-
"aria-expanded":
|
|
1445
|
-
"aria-controls":
|
|
1446
|
-
"aria-label":
|
|
1447
|
-
className:
|
|
1448
|
-
onClick: () =>
|
|
1449
|
-
children: /* @__PURE__ */
|
|
2200
|
+
"aria-expanded": A,
|
|
2201
|
+
"aria-controls": A ? v : void 0,
|
|
2202
|
+
"aria-label": A ? p.collapseRowNamed(I) : p.expandRowNamed(I),
|
|
2203
|
+
className: G(f.expander, A && f.expanderOpen),
|
|
2204
|
+
onClick: () => C.toggleRow(S),
|
|
2205
|
+
children: /* @__PURE__ */ l("svg", { viewBox: "0 0 10 10", width: "10", height: "10", "aria-hidden": "true", children: /* @__PURE__ */ l("path", { d: "M3.5 1.5 7 5l-3.5 3.5", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) })
|
|
1450
2206
|
}
|
|
1451
2207
|
)
|
|
1452
2208
|
}
|
|
1453
2209
|
),
|
|
1454
|
-
|
|
1455
|
-
|
|
2210
|
+
b && b.span && /* @__PURE__ */ l(Gr, { line: { ...b, span: b.span }, entry: g, selectable: a, hook: r, formats: k, wording: p }),
|
|
2211
|
+
s.map((z) => /* @__PURE__ */ l(
|
|
2212
|
+
qr,
|
|
1456
2213
|
{
|
|
1457
|
-
entry:
|
|
2214
|
+
entry: z,
|
|
1458
2215
|
row: e,
|
|
1459
|
-
kind: o.kindOf(
|
|
1460
|
-
sticky: u &&
|
|
1461
|
-
left:
|
|
1462
|
-
formats:
|
|
1463
|
-
wording:
|
|
2216
|
+
kind: o.kindOf(z, r.rows),
|
|
2217
|
+
sticky: u && z === i,
|
|
2218
|
+
left: h,
|
|
2219
|
+
formats: k,
|
|
2220
|
+
wording: p
|
|
1464
2221
|
},
|
|
1465
|
-
|
|
2222
|
+
z.key
|
|
1466
2223
|
)),
|
|
1467
|
-
|
|
2224
|
+
c.length > 0 && /* @__PURE__ */ l("td", { className: G(f.td, f.actionsCell), children: /* @__PURE__ */ l(Jr, { actions: c, row: e, name: I, wording: p }) })
|
|
1468
2225
|
]
|
|
1469
2226
|
}
|
|
1470
2227
|
),
|
|
1471
|
-
|
|
2228
|
+
A && x && /* @__PURE__ */ l("tr", { id: v, className: f.detailRow, "data-group": V == null ? void 0 : V.path, children: /* @__PURE__ */ l("td", { colSpan: d, className: f.detailCell, children: x.presentation(e) }) })
|
|
1472
2229
|
] });
|
|
1473
2230
|
}
|
|
1474
|
-
function
|
|
2231
|
+
function qr({
|
|
1475
2232
|
entry: e,
|
|
1476
2233
|
row: t,
|
|
1477
2234
|
kind: n,
|
|
1478
2235
|
sticky: o,
|
|
1479
2236
|
left: r,
|
|
1480
|
-
formats:
|
|
1481
|
-
wording:
|
|
2237
|
+
formats: s,
|
|
2238
|
+
wording: i
|
|
1482
2239
|
}) {
|
|
1483
|
-
const { spec:
|
|
1484
|
-
let
|
|
1485
|
-
|
|
1486
|
-
const
|
|
1487
|
-
return /* @__PURE__ */
|
|
1488
|
-
|
|
2240
|
+
const { spec: a } = e, c = e.read(t), u = Ot(n, a.rightAligned);
|
|
2241
|
+
let h;
|
|
2242
|
+
Y(c) ? h = /* @__PURE__ */ l(Ht, { wording: i }) : a.presentation ? h = a.presentation(c, t) : h = _e(c, a.format, s, i);
|
|
2243
|
+
const d = a.rowHeader ? "th" : "td";
|
|
2244
|
+
return /* @__PURE__ */ l(
|
|
2245
|
+
d,
|
|
1489
2246
|
{
|
|
1490
|
-
scope:
|
|
1491
|
-
className:
|
|
2247
|
+
scope: a.rowHeader ? "row" : void 0,
|
|
2248
|
+
className: G(f.td, u && f.numeric, a.rowHeader && f.rowHeader, o && f.stickyCell),
|
|
1492
2249
|
style: o ? { left: r } : void 0,
|
|
1493
|
-
children:
|
|
2250
|
+
children: h
|
|
1494
2251
|
}
|
|
1495
2252
|
);
|
|
1496
2253
|
}
|
|
1497
|
-
function
|
|
2254
|
+
function Yr({
|
|
1498
2255
|
entry: e,
|
|
1499
2256
|
rows: t,
|
|
1500
2257
|
formats: n,
|
|
1501
2258
|
wording: o,
|
|
1502
2259
|
sticky: r,
|
|
1503
|
-
left:
|
|
2260
|
+
left: s
|
|
1504
2261
|
}) {
|
|
1505
|
-
const
|
|
1506
|
-
if (!
|
|
1507
|
-
const
|
|
1508
|
-
return /* @__PURE__ */
|
|
1509
|
-
/* @__PURE__ */ c("span", { "aria-hidden": "true", className: f.footerKind, children: s === "sum" ? "Σ" : "⌀" }),
|
|
1510
|
-
/* @__PURE__ */ x(be, { children: [
|
|
1511
|
-
s === "sum" ? o.footerSum : o.footerAverage,
|
|
1512
|
-
" "
|
|
1513
|
-
] }),
|
|
1514
|
-
d === void 0 ? /* @__PURE__ */ c(ct, { wording: o }) : ae(d, l, n, o)
|
|
1515
|
-
] });
|
|
2262
|
+
const i = r ? { left: s } : void 0;
|
|
2263
|
+
if (!e.spec.aggregate) return /* @__PURE__ */ l("td", { className: G(f.td, r && f.stickyCell), style: i });
|
|
2264
|
+
const a = typeof e.spec.aggregate == "function" ? "own" : e.spec.aggregate;
|
|
2265
|
+
return /* @__PURE__ */ l("td", { className: G(f.td, $t(e, t) && f.numeric, r && f.stickyCell), style: i, "data-footer": a, children: /* @__PURE__ */ l(Ke, { entry: e, rows: t, formats: n, wording: o, signed: !0 }) });
|
|
1516
2266
|
}
|
|
1517
|
-
const
|
|
1518
|
-
function
|
|
2267
|
+
const Ur = 2;
|
|
2268
|
+
function Jr({
|
|
1519
2269
|
actions: e,
|
|
1520
2270
|
row: t,
|
|
1521
2271
|
name: n,
|
|
1522
2272
|
wording: o
|
|
1523
2273
|
}) {
|
|
1524
|
-
const r = (
|
|
1525
|
-
const
|
|
1526
|
-
s
|
|
2274
|
+
const r = (s) => {
|
|
2275
|
+
const i = s.onSelect;
|
|
2276
|
+
i(s.bulk ? [t] : t);
|
|
1527
2277
|
};
|
|
1528
|
-
return e.length <=
|
|
1529
|
-
|
|
2278
|
+
return e.length <= Ur ? /* @__PURE__ */ l("div", { className: f.actions, children: e.map(({ key: s, spec: i }) => /* @__PURE__ */ l(
|
|
2279
|
+
ee,
|
|
1530
2280
|
{
|
|
1531
2281
|
size: "sm",
|
|
1532
2282
|
variant: "ghost",
|
|
1533
|
-
"aria-label": o.rowAction(
|
|
1534
|
-
onClick: () => r(
|
|
1535
|
-
children:
|
|
2283
|
+
"aria-label": o.rowAction(i.label, n),
|
|
2284
|
+
onClick: () => r(i),
|
|
2285
|
+
children: i.label
|
|
1536
2286
|
},
|
|
1537
|
-
|
|
1538
|
-
)) }) : /* @__PURE__ */
|
|
1539
|
-
|
|
2287
|
+
s
|
|
2288
|
+
)) }) : /* @__PURE__ */ l("div", { className: f.actions, children: /* @__PURE__ */ l(
|
|
2289
|
+
At,
|
|
1540
2290
|
{
|
|
1541
2291
|
align: "end",
|
|
1542
|
-
trigger: /* @__PURE__ */
|
|
1543
|
-
children: e.map(({ key:
|
|
2292
|
+
trigger: /* @__PURE__ */ l(ee, { size: "sm", variant: "ghost", "aria-label": o.rowActionsMenu(n), children: "⋯" }),
|
|
2293
|
+
children: e.map(({ key: s, spec: i }) => /* @__PURE__ */ l(Fe, { tone: i.tone, onSelect: () => r(i), children: i.label }, s))
|
|
1544
2294
|
}
|
|
1545
2295
|
) });
|
|
1546
2296
|
}
|
|
1547
|
-
function
|
|
2297
|
+
function Xr({ columns: e, rows: t = 4 }) {
|
|
1548
2298
|
const n = [72, 48, 60, 40, 56, 64];
|
|
1549
|
-
return /* @__PURE__ */
|
|
2299
|
+
return /* @__PURE__ */ l(Q, { children: Array.from({ length: t }, (o, r) => /* @__PURE__ */ l("tr", { "aria-hidden": "true", children: Array.from({ length: e }, (s, i) => /* @__PURE__ */ l("td", { className: f.td, children: /* @__PURE__ */ l("span", { className: f.skeleton, style: { width: `${n[(r + i) % n.length]}%` } }) }, i)) }, r)) });
|
|
1550
2300
|
}
|
|
1551
|
-
const
|
|
1552
|
-
function
|
|
1553
|
-
return e <= 0 ? null : /* @__PURE__ */
|
|
2301
|
+
const Wt = yt(0);
|
|
2302
|
+
function bt({ height: e, colSpan: t }) {
|
|
2303
|
+
return e <= 0 ? null : /* @__PURE__ */ l("tr", { "aria-hidden": "true", "data-filler": "", className: f.fillerRow, children: /* @__PURE__ */ l("td", { colSpan: t, style: { height: e } }) });
|
|
1554
2304
|
}
|
|
1555
|
-
function
|
|
2305
|
+
function kt({
|
|
1556
2306
|
virtual: e,
|
|
1557
2307
|
colSpan: t,
|
|
1558
2308
|
children: n
|
|
1559
2309
|
}) {
|
|
1560
|
-
const { count: o, fillerBefore: r, fillerAfter:
|
|
1561
|
-
|
|
1562
|
-
var
|
|
1563
|
-
(
|
|
2310
|
+
const { count: o, fillerBefore: r, fillerAfter: s, showRow: i } = e, a = re(null), [c, u] = H(0), h = (w, k) => {
|
|
2311
|
+
a.current = k, u(k), i(k), requestAnimationFrame(() => {
|
|
2312
|
+
var p;
|
|
2313
|
+
(p = w.querySelector(`[data-row="${k}"]`)) == null || p.focus();
|
|
1564
2314
|
});
|
|
1565
|
-
},
|
|
1566
|
-
if (
|
|
1567
|
-
const
|
|
1568
|
-
if (
|
|
1569
|
-
const
|
|
1570
|
-
let
|
|
1571
|
-
|
|
2315
|
+
}, d = c >= e.from && c < e.to ? c : e.from, m = (w) => {
|
|
2316
|
+
if (w.defaultPrevented || o === 0) return;
|
|
2317
|
+
const k = w.target, p = k.closest("[data-row]");
|
|
2318
|
+
if (p && k !== p) return;
|
|
2319
|
+
const b = p ? Number(p.dataset.row) : a.current ?? -1;
|
|
2320
|
+
let g = null;
|
|
2321
|
+
w.key === "ArrowDown" ? g = Math.min(o - 1, b + 1) : w.key === "ArrowUp" ? g = Math.max(0, b - 1) : w.key === "Home" ? g = 0 : w.key === "End" && (g = o - 1), !(g === null || g === b) && (w.preventDefault(), h(w.currentTarget, g));
|
|
1572
2322
|
};
|
|
1573
|
-
return /* @__PURE__ */
|
|
2323
|
+
return /* @__PURE__ */ l(
|
|
1574
2324
|
"tbody",
|
|
1575
2325
|
{
|
|
1576
2326
|
className: f.virtualBody,
|
|
1577
|
-
onKeyDown:
|
|
1578
|
-
onFocus: (
|
|
1579
|
-
const
|
|
1580
|
-
|
|
2327
|
+
onKeyDown: m,
|
|
2328
|
+
onFocus: (w) => {
|
|
2329
|
+
const k = w.target.closest("[data-row]");
|
|
2330
|
+
k && u(Number(k.dataset.row));
|
|
1581
2331
|
},
|
|
1582
|
-
children: /* @__PURE__ */
|
|
1583
|
-
/* @__PURE__ */
|
|
2332
|
+
children: /* @__PURE__ */ O(Wt.Provider, { value: d, children: [
|
|
2333
|
+
/* @__PURE__ */ l(bt, { height: r, colSpan: t }),
|
|
1584
2334
|
n,
|
|
1585
|
-
/* @__PURE__ */
|
|
2335
|
+
/* @__PURE__ */ l(bt, { height: s, colSpan: t })
|
|
1586
2336
|
] })
|
|
1587
2337
|
}
|
|
1588
2338
|
);
|
|
1589
2339
|
}
|
|
1590
|
-
const
|
|
1591
|
-
verdict:
|
|
1592
|
-
glyph:
|
|
1593
|
-
value:
|
|
1594
|
-
excess:
|
|
1595
|
-
},
|
|
2340
|
+
const Qr = "_verdict_yxa4g_6", Zr = "_glyph_yxa4g_13", es = "_value_yxa4g_23", ts = "_excess_yxa4g_28", Te = {
|
|
2341
|
+
verdict: Qr,
|
|
2342
|
+
glyph: Zr,
|
|
2343
|
+
value: es,
|
|
2344
|
+
excess: ts
|
|
2345
|
+
}, vt = (e, t, n) => t === "percent" ? n.percent(e) : t === "count" ? n.count(e) : n.number(e, typeof t == "object" ? t.decimals : void 0), ns = (e, t) => e === "alarm" ? t.verdictAlarm : e === "warning" ? t.verdictWarning : e === "unknown" ? t.verdictUnknown : t.verdictOk, os = {
|
|
1596
2346
|
ok: "✓",
|
|
1597
2347
|
unknown: "?",
|
|
1598
2348
|
warning: "▲",
|
|
1599
2349
|
alarm: "■"
|
|
1600
2350
|
};
|
|
1601
|
-
function
|
|
1602
|
-
const n =
|
|
1603
|
-
return /* @__PURE__ */
|
|
1604
|
-
/* @__PURE__ */
|
|
1605
|
-
/* @__PURE__ */
|
|
1606
|
-
|
|
2351
|
+
function rs({ reading: e, format: t }) {
|
|
2352
|
+
const n = ue(), o = U(), { measured: r, assessment: s } = e, i = ns(s.verdict, o);
|
|
2353
|
+
return /* @__PURE__ */ O("span", { className: Te.verdict, "data-verdict": s.verdict, title: i, children: [
|
|
2354
|
+
/* @__PURE__ */ l("span", { "aria-hidden": "true", className: Te.glyph, children: os[s.verdict] }),
|
|
2355
|
+
/* @__PURE__ */ l("span", { className: Te.value, children: r === null ? o.statAbsentValue : vt(r, t, n) }),
|
|
2356
|
+
s.excess !== void 0 && /* @__PURE__ */ O("span", { className: Te.excess, children: [
|
|
1607
2357
|
"+",
|
|
1608
|
-
|
|
2358
|
+
vt(s.excess, t, n)
|
|
1609
2359
|
] }),
|
|
1610
|
-
/* @__PURE__ */
|
|
2360
|
+
/* @__PURE__ */ l(Re, { children: i })
|
|
1611
2361
|
] });
|
|
1612
2362
|
}
|
|
1613
|
-
const
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
2363
|
+
const ss = (e) => e.measured, is = (e) => e.reduce(
|
|
2364
|
+
(t, n) => !t || Ee(n.assessment.verdict) > Ee(t.assessment.verdict) ? n : t,
|
|
2365
|
+
void 0
|
|
2366
|
+
);
|
|
2367
|
+
function as(e) {
|
|
2368
|
+
return function({ id: n, value: o, label: r, limits: s, format: i, sortBy: a = "verdict", width: c, resizable: u, aggregate: h }) {
|
|
2369
|
+
const d = JSON.stringify(s), m = $(() => {
|
|
2370
|
+
const k = JSON.parse(d);
|
|
1618
2371
|
return (p) => {
|
|
1619
2372
|
const b = typeof o == "string" ? p == null ? void 0 : p[o] : o(p);
|
|
1620
2373
|
return {
|
|
1621
2374
|
measured: typeof b == "number" && Number.isFinite(b) ? b : null,
|
|
1622
|
-
assessment:
|
|
2375
|
+
assessment: tn(b, k)
|
|
1623
2376
|
};
|
|
1624
2377
|
};
|
|
1625
|
-
}, [o, d]),
|
|
1626
|
-
(
|
|
1627
|
-
[
|
|
2378
|
+
}, [o, d]), w = X(
|
|
2379
|
+
(k) => a === "value" ? k.measured : Ee(k.assessment.verdict),
|
|
2380
|
+
[a]
|
|
1628
2381
|
);
|
|
1629
|
-
return /* @__PURE__ */
|
|
2382
|
+
return /* @__PURE__ */ l(
|
|
1630
2383
|
e,
|
|
1631
2384
|
{
|
|
1632
2385
|
id: n ?? (typeof o == "string" ? o : void 0),
|
|
1633
2386
|
label: r,
|
|
1634
2387
|
numeric: !0,
|
|
1635
|
-
width:
|
|
2388
|
+
width: c,
|
|
1636
2389
|
resizable: u,
|
|
1637
|
-
value:
|
|
1638
|
-
sortValue:
|
|
1639
|
-
exportValue:
|
|
1640
|
-
|
|
2390
|
+
value: m,
|
|
2391
|
+
sortValue: w,
|
|
2392
|
+
exportValue: ss,
|
|
2393
|
+
aggregate: h === "worst" ? is : void 0,
|
|
2394
|
+
children: (k) => /* @__PURE__ */ l(rs, { reading: k, format: i })
|
|
1641
2395
|
}
|
|
1642
2396
|
);
|
|
1643
2397
|
};
|
|
1644
2398
|
}
|
|
1645
|
-
const
|
|
2399
|
+
const qt = (e) => pe(
|
|
1646
2400
|
`condition-foreign:${e}`,
|
|
1647
2401
|
`The condition for "${e}" is not of the kind of its filter and is passed over.`
|
|
1648
2402
|
);
|
|
1649
|
-
function
|
|
1650
|
-
const o = e.columnById(t), r = o ?
|
|
2403
|
+
function Yt(e, t, n) {
|
|
2404
|
+
const o = e.columnById(t), r = o ? me(o.spec.filter) : void 0;
|
|
1651
2405
|
if (!r) return !1;
|
|
1652
|
-
const
|
|
1653
|
-
return
|
|
2406
|
+
const s = Dt(r, n);
|
|
2407
|
+
return s === "foreign" && qt(t), s === "effective";
|
|
1654
2408
|
}
|
|
1655
|
-
function
|
|
2409
|
+
function ls(e, t) {
|
|
1656
2410
|
if (e.length === 0) return;
|
|
1657
2411
|
let n = -1, o = [];
|
|
1658
2412
|
return (r) => {
|
|
1659
2413
|
if (n !== t.structureVersion()) {
|
|
1660
2414
|
n = t.structureVersion(), o = [];
|
|
1661
|
-
for (const [
|
|
1662
|
-
const
|
|
1663
|
-
|
|
2415
|
+
for (const [s, i] of e) {
|
|
2416
|
+
const a = t.columnById(s);
|
|
2417
|
+
a && Yt(t, s, i) && o.push({ entry: a, condition: i });
|
|
1664
2418
|
}
|
|
1665
2419
|
}
|
|
1666
|
-
return o.every(({ entry:
|
|
1667
|
-
const
|
|
1668
|
-
return !
|
|
2420
|
+
return o.every(({ entry: s, condition: i }) => {
|
|
2421
|
+
const a = me(s.spec.filter);
|
|
2422
|
+
return !a || tr(a, s.read(r), i);
|
|
1669
2423
|
});
|
|
1670
2424
|
};
|
|
1671
2425
|
}
|
|
1672
|
-
function
|
|
1673
|
-
const n =
|
|
2426
|
+
function cs(e, t) {
|
|
2427
|
+
const n = $(() => t ? e.filter((i) => t(i)) : e, [e, t]), [o, r] = H(() => ({ source: e, result: n }));
|
|
1674
2428
|
if (!t) return e;
|
|
1675
|
-
const
|
|
1676
|
-
return
|
|
2429
|
+
const s = o.source === e && (o.result === n || o.result.length === n.length && o.result.every((i, a) => i === n[a]));
|
|
2430
|
+
return s || r({ source: e, result: n }), s ? o.result : n;
|
|
1677
2431
|
}
|
|
1678
|
-
function
|
|
1679
|
-
var
|
|
2432
|
+
function us(e, t) {
|
|
2433
|
+
var a, c, u, h, d, m;
|
|
1680
2434
|
if (t.size === 0) return e;
|
|
1681
|
-
const n = (
|
|
1682
|
-
return (n == null ? void 0 : n.length) === ((
|
|
2435
|
+
const n = (a = e.sort) == null ? void 0 : a.filter((w) => t.has(w.column)), o = (c = e.hidden) == null ? void 0 : c.filter((w) => t.has(w)), r = (u = e.order) == null ? void 0 : u.filter((w) => t.has(w)), s = e.widths ? Object.fromEntries(Object.entries(e.widths).filter(([w]) => t.has(w))) : void 0;
|
|
2436
|
+
return (n == null ? void 0 : n.length) === ((h = e.sort) == null ? void 0 : h.length) && (o == null ? void 0 : o.length) === ((d = e.hidden) == null ? void 0 : d.length) && (r == null ? void 0 : r.length) === ((m = e.order) == null ? void 0 : m.length) && Object.keys(s ?? {}).length === Object.keys(e.widths ?? {}).length ? e : {
|
|
1683
2437
|
...e.search ? { search: e.search } : {},
|
|
1684
2438
|
...e.page ? { page: e.page } : {},
|
|
1685
2439
|
...e.pageSize ? { pageSize: e.pageSize } : {},
|
|
1686
2440
|
...n != null && n.length ? { sort: n } : {},
|
|
1687
2441
|
...o != null && o.length ? { hidden: o } : {},
|
|
1688
2442
|
...r != null && r.length ? { order: r } : {},
|
|
1689
|
-
...
|
|
2443
|
+
...s && Object.keys(s).length ? { widths: s } : {}
|
|
1690
2444
|
};
|
|
1691
2445
|
}
|
|
1692
|
-
const
|
|
1693
|
-
function
|
|
2446
|
+
const Ge = (e) => e === void 0 ? [] : typeof e == "string" ? [e] : [...e], ds = (e, t) => e.length === t.length && e.every((n, o) => n === t[o]);
|
|
2447
|
+
function _t(e) {
|
|
2448
|
+
const t = [], n = (o) => {
|
|
2449
|
+
for (const r of o)
|
|
2450
|
+
t.push(r.path), n(r.groups);
|
|
2451
|
+
};
|
|
2452
|
+
return n(e ?? []), t;
|
|
2453
|
+
}
|
|
2454
|
+
const fs = (e, t) => e.size === t.size && [...e].every((n) => t.has(n));
|
|
2455
|
+
function hs(e, t) {
|
|
1694
2456
|
const n = {};
|
|
1695
2457
|
for (const o of e) o.width !== void 0 && (n[o.id] = o.width);
|
|
1696
2458
|
return { ...n, ...t };
|
|
1697
2459
|
}
|
|
1698
|
-
function
|
|
1699
|
-
const [n] =
|
|
1700
|
-
const
|
|
1701
|
-
return { ...
|
|
2460
|
+
function gs(e, t) {
|
|
2461
|
+
const [n] = H(() => new gr()), [o] = H(() => {
|
|
2462
|
+
const y = Hr(n);
|
|
2463
|
+
return { ...y, VerdictColumn: as(y.Column) };
|
|
1702
2464
|
});
|
|
1703
|
-
|
|
1704
|
-
const r =
|
|
1705
|
-
|
|
2465
|
+
Le(n.subscribe, n.structureVersion, n.structureVersion);
|
|
2466
|
+
const r = ue(), s = e, i = n.modelColumns(s, r), [a] = H(() => t.initialView), [c, u] = H(() => Object.entries((a == null ? void 0 : a.conditions) ?? {})), h = $(() => ls(c, n), [c, n]), d = t.preFilter ?? t.filter, m = cs(s, d), [w, k] = H(
|
|
2467
|
+
() => a != null && a.grouping ? [...a.grouping] : Ge(t.defaultGrouping)
|
|
2468
|
+
), [p, b] = H(() => (a == null ? void 0 : a.folded) ?? []), g = n.orderedColumns().length + n.groupKeys.entries.size > 0, _ = g ? n.effectiveGrouping(w, s) : w.slice(0, Qe), C = _.join("|"), S = $(() => new Set(p), [p]), I = _.length ? n.groupingModel(_, s) : null, x = $(
|
|
2469
|
+
() => I && I.levels.length ? { ...I, folded: S, compareText: r.compareText } : void 0,
|
|
2470
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps -- the model's identity carries the ids and the columns
|
|
2471
|
+
[I, S, r.compareText, C]
|
|
2472
|
+
), A = t.rowKey, v = kn(m, i, {
|
|
2473
|
+
rowKey: A,
|
|
1706
2474
|
pageSize: t.pageSize,
|
|
1707
2475
|
defaultSort: t.defaultSort,
|
|
1708
|
-
filter:
|
|
1709
|
-
initialView:
|
|
1710
|
-
virtual: t.virtual
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
|
|
2476
|
+
filter: h,
|
|
2477
|
+
initialView: a,
|
|
2478
|
+
virtual: t.virtual,
|
|
2479
|
+
grouping: x
|
|
2480
|
+
}), { setPage: F } = v, L = X(
|
|
2481
|
+
(y, R) => {
|
|
2482
|
+
let K = R == null;
|
|
2483
|
+
if (!K && n.orderedColumns().length > 0) {
|
|
2484
|
+
const j = n.columnById(y), M = j ? me(j.spec.filter) : void 0;
|
|
2485
|
+
if (!M) {
|
|
2486
|
+
pe(
|
|
2487
|
+
`condition-without-filter:${y}`,
|
|
2488
|
+
j ? `The column "${y}" has no filter; its condition is passed over.` : `No column is called "${y}"; its condition is passed over.`
|
|
1720
2489
|
);
|
|
1721
2490
|
return;
|
|
1722
2491
|
}
|
|
1723
|
-
const
|
|
1724
|
-
if (
|
|
1725
|
-
|
|
2492
|
+
const J = Dt(M, R);
|
|
2493
|
+
if (J === "foreign") {
|
|
2494
|
+
qt(y);
|
|
1726
2495
|
return;
|
|
1727
2496
|
}
|
|
1728
|
-
|
|
2497
|
+
K = J === "empty";
|
|
1729
2498
|
}
|
|
1730
|
-
u((
|
|
1731
|
-
const
|
|
1732
|
-
return
|
|
1733
|
-
}),
|
|
2499
|
+
u((j) => {
|
|
2500
|
+
const M = j.findIndex(([J]) => J === y);
|
|
2501
|
+
return K ? M === -1 ? j : j.filter((J, Z) => Z !== M) : M === -1 ? [...j, [y, R]] : j.map((J, Z) => Z === M ? [y, R] : J);
|
|
2502
|
+
}), F(1);
|
|
1734
2503
|
},
|
|
1735
|
-
[n,
|
|
1736
|
-
),
|
|
1737
|
-
if (!
|
|
1738
|
-
const
|
|
1739
|
-
|
|
2504
|
+
[n, F]
|
|
2505
|
+
), N = new Set(n.orderedColumns().map((y) => y.spec.id)), [V, z] = H(() => /* @__PURE__ */ new Set());
|
|
2506
|
+
if (!fs(V, N)) {
|
|
2507
|
+
const y = new Set([...V].filter((R) => !N.has(R)));
|
|
2508
|
+
z(N), c.some(([R]) => y.has(R)) && u((R) => R.filter(([K]) => !y.has(K)));
|
|
1740
2509
|
}
|
|
1741
|
-
const
|
|
2510
|
+
const P = N.size === 0 ? c : c.filter(([y, R]) => Yt(n, y, R)), q = us(v.view, N), ie = P.length > 0 ? { ...q, conditions: Object.fromEntries(P) } : q, ae = N.size === 0 ? v.sort : v.sort.filter((y) => N.has(y.column)), de = g ? n.effectiveGrouping(Ge(t.defaultGrouping), s) : Ge(t.defaultGrouping), fe = v.groups ? fn(v.groups, p) : g ? [] : [...p], we = {
|
|
2511
|
+
...ie,
|
|
2512
|
+
...ds(_, de) ? {} : { grouping: _ },
|
|
2513
|
+
...fe.length ? { folded: fe } : {}
|
|
2514
|
+
}, be = (y) => {
|
|
2515
|
+
k([...y]), F(1);
|
|
2516
|
+
}, ye = (y) => {
|
|
2517
|
+
_t(v.groups).includes(y) && (n.noteFocusBeforeFold(), b((R) => R.includes(y) ? R.filter((K) => K !== y) : [...R, y]));
|
|
2518
|
+
}, le = n.paginates() || t.virtual !== void 0, te = {
|
|
1742
2519
|
rows: e,
|
|
1743
|
-
filtered:
|
|
1744
|
-
visible:
|
|
1745
|
-
page:
|
|
1746
|
-
pageCount:
|
|
1747
|
-
pageSize:
|
|
1748
|
-
setPage:
|
|
1749
|
-
setPageSize:
|
|
1750
|
-
search:
|
|
1751
|
-
setSearch:
|
|
1752
|
-
sort:
|
|
1753
|
-
toggleSort:
|
|
1754
|
-
hidden:
|
|
1755
|
-
toggleColumn:
|
|
1756
|
-
order:
|
|
1757
|
-
setOrder:
|
|
1758
|
-
widths:
|
|
1759
|
-
setWidth:
|
|
1760
|
-
expanded:
|
|
1761
|
-
toggleRow:
|
|
1762
|
-
filter: Object.fromEntries(
|
|
1763
|
-
setFilter:
|
|
1764
|
-
selection: t.selection ??
|
|
1765
|
-
view:
|
|
1766
|
-
|
|
2520
|
+
filtered: v.filtered,
|
|
2521
|
+
visible: le ? v.visible : v.filtered,
|
|
2522
|
+
page: le ? v.page : 1,
|
|
2523
|
+
pageCount: le ? v.pageCount : 1,
|
|
2524
|
+
pageSize: v.pageSize,
|
|
2525
|
+
setPage: v.setPage,
|
|
2526
|
+
setPageSize: v.setPageSize,
|
|
2527
|
+
search: v.search,
|
|
2528
|
+
setSearch: v.setSearch,
|
|
2529
|
+
sort: ae,
|
|
2530
|
+
toggleSort: v.toggleSort,
|
|
2531
|
+
hidden: v.hidden,
|
|
2532
|
+
toggleColumn: v.toggleColumn,
|
|
2533
|
+
order: v.order,
|
|
2534
|
+
setOrder: v.setOrder,
|
|
2535
|
+
widths: hs(i, v.widths),
|
|
2536
|
+
setWidth: v.setWidth,
|
|
2537
|
+
expanded: v.expanded,
|
|
2538
|
+
toggleRow: v.toggleRow,
|
|
2539
|
+
filter: Object.fromEntries(P),
|
|
2540
|
+
setFilter: L,
|
|
2541
|
+
selection: t.selection ?? v.selection,
|
|
2542
|
+
view: we,
|
|
2543
|
+
grouping: _,
|
|
2544
|
+
setGrouping: be,
|
|
2545
|
+
folded: fe,
|
|
2546
|
+
toggleFold: ye,
|
|
2547
|
+
foldAll: () => {
|
|
2548
|
+
n.noteFocusBeforeFold(), b(_t(v.groups));
|
|
2549
|
+
},
|
|
2550
|
+
unfoldAll: () => {
|
|
2551
|
+
n.noteFocusBeforeFold(), b([]);
|
|
2552
|
+
},
|
|
2553
|
+
asCsv: () => xr(n),
|
|
1767
2554
|
virtual: t.virtual !== void 0
|
|
1768
2555
|
};
|
|
1769
2556
|
return n.setHook({
|
|
1770
|
-
rows:
|
|
1771
|
-
admitted:
|
|
1772
|
-
modelColumns:
|
|
1773
|
-
companion:
|
|
1774
|
-
filter:
|
|
1775
|
-
|
|
1776
|
-
|
|
2557
|
+
rows: s,
|
|
2558
|
+
admitted: m,
|
|
2559
|
+
modelColumns: i,
|
|
2560
|
+
companion: v,
|
|
2561
|
+
filter: h,
|
|
2562
|
+
grouping: x,
|
|
2563
|
+
folded: S,
|
|
2564
|
+
publicSnapshot: te,
|
|
2565
|
+
rowKey: A,
|
|
1777
2566
|
formats: r
|
|
1778
|
-
}), { ...
|
|
2567
|
+
}), { ...te, ...o };
|
|
1779
2568
|
}
|
|
1780
|
-
function
|
|
2569
|
+
function Xs(e) {
|
|
1781
2570
|
return e;
|
|
1782
2571
|
}
|
|
1783
|
-
function
|
|
1784
|
-
const n =
|
|
1785
|
-
e == null || e.register(t, n),
|
|
2572
|
+
function nt(e, t) {
|
|
2573
|
+
const n = se();
|
|
2574
|
+
e == null || e.register(t, n), W(() => {
|
|
1786
2575
|
if (e)
|
|
1787
2576
|
return e.register(t, n), e.commit(), () => {
|
|
1788
2577
|
e.remove(t, n), e.commit();
|
|
1789
2578
|
};
|
|
1790
2579
|
}, [e, t, n]);
|
|
1791
2580
|
}
|
|
1792
|
-
function
|
|
1793
|
-
const o =
|
|
1794
|
-
|
|
2581
|
+
function Qs({ children: e, className: t, of: n }) {
|
|
2582
|
+
const o = xe(n);
|
|
2583
|
+
nt(o == null ? void 0 : o.registry, "toolbar");
|
|
1795
2584
|
const r = o == null ? void 0 : o.registry;
|
|
1796
|
-
return /* @__PURE__ */
|
|
1797
|
-
}
|
|
1798
|
-
function
|
|
1799
|
-
const r =
|
|
1800
|
-
if (
|
|
1801
|
-
const { snapshot:
|
|
1802
|
-
return /* @__PURE__ */
|
|
1803
|
-
|
|
2585
|
+
return /* @__PURE__ */ l(jt, { registry: r ?? null, className: t, children: e });
|
|
2586
|
+
}
|
|
2587
|
+
function Zs({ placeholder: e, "aria-label": t, className: n, of: o }) {
|
|
2588
|
+
const r = xe(o), s = U();
|
|
2589
|
+
if (nt(r == null ? void 0 : r.registry, "search"), !r) return null;
|
|
2590
|
+
const { snapshot: i } = r;
|
|
2591
|
+
return /* @__PURE__ */ l(
|
|
2592
|
+
on,
|
|
1804
2593
|
{
|
|
1805
2594
|
size: "sm",
|
|
1806
2595
|
type: "search",
|
|
1807
2596
|
className: n,
|
|
1808
|
-
value:
|
|
1809
|
-
onChange: (
|
|
2597
|
+
value: i.search,
|
|
2598
|
+
onChange: (a) => i.setSearch(a.target.value),
|
|
1810
2599
|
clearable: !0,
|
|
1811
|
-
onClear: () =>
|
|
1812
|
-
placeholder: e ??
|
|
1813
|
-
"aria-label": t ??
|
|
2600
|
+
onClear: () => i.setSearch(""),
|
|
2601
|
+
placeholder: e ?? s.tableSearchPlaceholder,
|
|
2602
|
+
"aria-label": t ?? s.tableSearchLabel
|
|
1814
2603
|
}
|
|
1815
2604
|
);
|
|
1816
2605
|
}
|
|
1817
|
-
function
|
|
1818
|
-
var
|
|
1819
|
-
const t =
|
|
1820
|
-
if (
|
|
1821
|
-
var
|
|
1822
|
-
if (!
|
|
1823
|
-
const
|
|
1824
|
-
(
|
|
1825
|
-
),
|
|
1826
|
-
`[data-direction="${
|
|
2606
|
+
function ei({ of: e }) {
|
|
2607
|
+
var b;
|
|
2608
|
+
const t = xe(e), n = U(), [o, r] = H(!1), s = re(null), i = re(null), a = se(), [c, u] = H(null);
|
|
2609
|
+
if (W(() => {
|
|
2610
|
+
var S;
|
|
2611
|
+
if (!c || !i.current) return;
|
|
2612
|
+
const g = Array.from(i.current.children).find(
|
|
2613
|
+
(I) => I.dataset.column === c.id
|
|
2614
|
+
), _ = g == null ? void 0 : g.querySelector(`[data-direction="${c.direction}"]`), C = g == null ? void 0 : g.querySelector(
|
|
2615
|
+
`[data-direction="${c.direction === "forward" ? "backward" : "forward"}"]`
|
|
1827
2616
|
);
|
|
1828
|
-
(
|
|
1829
|
-
}, [
|
|
1830
|
-
const { registry:
|
|
1831
|
-
|
|
1832
|
-
),
|
|
1833
|
-
const
|
|
1834
|
-
|
|
2617
|
+
(S = _ && !_.disabled ? _ : C) == null || S.focus();
|
|
2618
|
+
}, [c]), !t) return null;
|
|
2619
|
+
const { registry: h, snapshot: d } = t, m = h.hook, w = h.withStickyHeaderFirst(
|
|
2620
|
+
et(h.modelColumns(m.rows, m.formats), d.order)
|
|
2621
|
+
), k = h.stickyRowHeader ? ((b = w[0]) == null ? void 0 : b.hideable) === !1 : !1, p = (g, _) => {
|
|
2622
|
+
const C = w.map((I) => I.id), S = g + _;
|
|
2623
|
+
S < 0 || S >= C.length || ([C[g], C[S]] = [C[S], C[g]], d.setOrder(C), u({ id: w[g].id, direction: _ < 0 ? "forward" : "backward" }));
|
|
1835
2624
|
};
|
|
1836
|
-
return /* @__PURE__ */
|
|
1837
|
-
/* @__PURE__ */
|
|
1838
|
-
|
|
2625
|
+
return /* @__PURE__ */ O(Q, { children: [
|
|
2626
|
+
/* @__PURE__ */ l(
|
|
2627
|
+
ee,
|
|
1839
2628
|
{
|
|
1840
|
-
ref:
|
|
2629
|
+
ref: s,
|
|
1841
2630
|
size: "sm",
|
|
1842
2631
|
"aria-haspopup": "dialog",
|
|
1843
2632
|
"aria-expanded": o,
|
|
1844
|
-
"aria-controls": o ?
|
|
2633
|
+
"aria-controls": o ? a : void 0,
|
|
1845
2634
|
onClick: () => r(!o),
|
|
1846
2635
|
children: n.columns
|
|
1847
2636
|
}
|
|
1848
2637
|
),
|
|
1849
|
-
/* @__PURE__ */
|
|
1850
|
-
|
|
2638
|
+
/* @__PURE__ */ O(
|
|
2639
|
+
St,
|
|
1851
2640
|
{
|
|
1852
2641
|
open: o,
|
|
1853
2642
|
onOpenChange: r,
|
|
1854
|
-
anchorRef:
|
|
2643
|
+
anchorRef: s,
|
|
1855
2644
|
align: "end",
|
|
1856
2645
|
role: "dialog",
|
|
1857
2646
|
ariaLabel: n.arrangeColumns,
|
|
1858
|
-
id:
|
|
2647
|
+
id: a,
|
|
1859
2648
|
className: f.columnsPanel,
|
|
1860
|
-
children:
|
|
1861
|
-
|
|
1862
|
-
|
|
1863
|
-
/* @__PURE__ */
|
|
1864
|
-
|
|
1865
|
-
|
|
1866
|
-
|
|
1867
|
-
|
|
1868
|
-
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
|
|
1872
|
-
|
|
1873
|
-
|
|
1874
|
-
|
|
1875
|
-
|
|
1876
|
-
|
|
1877
|
-
|
|
1878
|
-
|
|
1879
|
-
|
|
1880
|
-
|
|
1881
|
-
|
|
1882
|
-
|
|
1883
|
-
|
|
1884
|
-
|
|
1885
|
-
|
|
1886
|
-
|
|
1887
|
-
|
|
1888
|
-
|
|
1889
|
-
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
|
|
1893
|
-
|
|
1894
|
-
|
|
1895
|
-
|
|
1896
|
-
|
|
1897
|
-
|
|
2649
|
+
children: [
|
|
2650
|
+
/* @__PURE__ */ l("ul", { ref: i, className: f.columnsList, "aria-label": n.arrangeColumns, children: w.map((g, _) => {
|
|
2651
|
+
const C = g.label ?? g.id;
|
|
2652
|
+
return /* @__PURE__ */ O("li", { className: f.columnsEntry, "data-column": g.id, children: [
|
|
2653
|
+
/* @__PURE__ */ l(
|
|
2654
|
+
Se,
|
|
2655
|
+
{
|
|
2656
|
+
label: C,
|
|
2657
|
+
checked: !d.hidden.includes(g.id),
|
|
2658
|
+
disabled: g.hideable === !1,
|
|
2659
|
+
onChange: () => d.toggleColumn(g.id)
|
|
2660
|
+
}
|
|
2661
|
+
),
|
|
2662
|
+
/* @__PURE__ */ l(
|
|
2663
|
+
"button",
|
|
2664
|
+
{
|
|
2665
|
+
type: "button",
|
|
2666
|
+
className: f.move,
|
|
2667
|
+
"data-direction": "forward",
|
|
2668
|
+
"aria-label": n.columnForward(C),
|
|
2669
|
+
disabled: _ === 0 || k && _ <= 1,
|
|
2670
|
+
onClick: () => p(_, -1),
|
|
2671
|
+
children: /* @__PURE__ */ l("svg", { viewBox: "0 0 10 10", width: "10", height: "10", "aria-hidden": "true", children: /* @__PURE__ */ l("path", { d: "M2 6.5 5 3.5l3 3", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) })
|
|
2672
|
+
}
|
|
2673
|
+
),
|
|
2674
|
+
/* @__PURE__ */ l(
|
|
2675
|
+
"button",
|
|
2676
|
+
{
|
|
2677
|
+
type: "button",
|
|
2678
|
+
className: f.move,
|
|
2679
|
+
"data-direction": "backward",
|
|
2680
|
+
"aria-label": n.columnBackward(C),
|
|
2681
|
+
disabled: _ === w.length - 1 || k && _ === 0,
|
|
2682
|
+
onClick: () => p(_, 1),
|
|
2683
|
+
children: /* @__PURE__ */ l("svg", { viewBox: "0 0 10 10", width: "10", height: "10", "aria-hidden": "true", children: /* @__PURE__ */ l("path", { d: "M2 3.5 5 6.5l3-3", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) })
|
|
2684
|
+
}
|
|
2685
|
+
)
|
|
2686
|
+
] }, g.id);
|
|
2687
|
+
}) }),
|
|
2688
|
+
/* @__PURE__ */ l(Tr, { registry: h, hook: m })
|
|
2689
|
+
]
|
|
1898
2690
|
}
|
|
1899
2691
|
)
|
|
1900
2692
|
] });
|
|
1901
2693
|
}
|
|
1902
|
-
function
|
|
1903
|
-
const o =
|
|
2694
|
+
function ti({ filename: e, onExport: t, of: n }) {
|
|
2695
|
+
const o = xe(n), r = U();
|
|
1904
2696
|
if (!o) return null;
|
|
1905
|
-
const { snapshot:
|
|
1906
|
-
return /* @__PURE__ */
|
|
1907
|
-
const
|
|
2697
|
+
const { snapshot: s } = o;
|
|
2698
|
+
return /* @__PURE__ */ l(ee, { size: "sm", onClick: () => {
|
|
2699
|
+
const a = s.asCsv();
|
|
1908
2700
|
if (t) {
|
|
1909
|
-
t(
|
|
2701
|
+
t(a);
|
|
1910
2702
|
return;
|
|
1911
2703
|
}
|
|
1912
|
-
const
|
|
1913
|
-
u.href =
|
|
2704
|
+
const c = URL.createObjectURL(new Blob([a], { type: "text/csv;charset=utf-8" })), u = document.createElement("a");
|
|
2705
|
+
u.href = c, u.download = e ?? r.exportFileName, u.click(), setTimeout(() => URL.revokeObjectURL(c), 1e4);
|
|
1914
2706
|
}, children: r.exportLabel });
|
|
1915
2707
|
}
|
|
1916
|
-
function
|
|
1917
|
-
const o =
|
|
1918
|
-
if (
|
|
1919
|
-
const { snapshot:
|
|
1920
|
-
/* @__PURE__ */
|
|
1921
|
-
/* @__PURE__ */
|
|
1922
|
-
/* @__PURE__ */
|
|
2708
|
+
function ni({ pageSizes: e = [10, 25, 50], className: t, of: n }) {
|
|
2709
|
+
const o = xe(n), r = U(), s = ue();
|
|
2710
|
+
if (nt(o == null ? void 0 : o.registry, "pagination"), !o || o.snapshot.virtual) return null;
|
|
2711
|
+
const { snapshot: i } = o, a = i.filtered.length, c = e.includes(i.pageSize) ? e : [...e, i.pageSize].sort((h, d) => h - d), u = /* @__PURE__ */ O("nav", { "aria-label": r.pagination, className: G(f.pagination, t), children: [
|
|
2712
|
+
/* @__PURE__ */ l("span", { children: r.entries(a, s.count(a)) }),
|
|
2713
|
+
/* @__PURE__ */ O("div", { className: f.paginationControls, children: [
|
|
2714
|
+
/* @__PURE__ */ O("label", { className: f.pageSize, children: [
|
|
1923
2715
|
r.rows,
|
|
1924
|
-
/* @__PURE__ */
|
|
1925
|
-
|
|
2716
|
+
/* @__PURE__ */ l(
|
|
2717
|
+
nn,
|
|
1926
2718
|
{
|
|
1927
2719
|
selectSize: "sm",
|
|
1928
|
-
value:
|
|
1929
|
-
onChange: (
|
|
2720
|
+
value: i.pageSize,
|
|
2721
|
+
onChange: (h) => i.setPageSize(Number(h.target.value)),
|
|
1930
2722
|
"aria-label": r.rowsPerPage,
|
|
1931
|
-
children:
|
|
2723
|
+
children: c.map((h) => /* @__PURE__ */ l("option", { value: h, children: h }, h))
|
|
1932
2724
|
}
|
|
1933
2725
|
)
|
|
1934
2726
|
] }),
|
|
1935
|
-
/* @__PURE__ */
|
|
1936
|
-
/* @__PURE__ */
|
|
1937
|
-
/* @__PURE__ */
|
|
2727
|
+
/* @__PURE__ */ l("span", { className: f.paginationStatus, children: r.pageOfPages(i.page, i.pageCount) }),
|
|
2728
|
+
/* @__PURE__ */ l(ee, { size: "sm", disabled: i.page <= 1, onClick: () => i.setPage(i.page - 1), children: r.previousPage }),
|
|
2729
|
+
/* @__PURE__ */ l(ee, { size: "sm", disabled: i.page >= i.pageCount, onClick: () => i.setPage(i.page + 1), children: r.nextPage })
|
|
1938
2730
|
] })
|
|
1939
2731
|
] });
|
|
1940
|
-
return o.inside ? o.footerTarget ?
|
|
2732
|
+
return o.inside ? o.footerTarget ? an(u, o.footerTarget) : null : u;
|
|
1941
2733
|
}
|
|
1942
|
-
const
|
|
1943
|
-
function
|
|
2734
|
+
const ps = ["high", "medium", "low"], ms = (e) => ps.indexOf(e), ws = (e) => e === "standing-unacknowledged" || e === "standing-acknowledged", De = (e) => e === "standing-acknowledged" || e === "cleared-acknowledged", bs = (e) => e === "cleared-acknowledged";
|
|
2735
|
+
function ks(e, t) {
|
|
1944
2736
|
switch (t) {
|
|
1945
2737
|
case "raised":
|
|
1946
2738
|
return "standing-unacknowledged";
|
|
1947
2739
|
case "acknowledged":
|
|
1948
|
-
return
|
|
2740
|
+
return ws(e) ? "standing-acknowledged" : "cleared-acknowledged";
|
|
1949
2741
|
case "cleared":
|
|
1950
|
-
return
|
|
2742
|
+
return De(e) ? "cleared-acknowledged" : "cleared-unacknowledged";
|
|
1951
2743
|
}
|
|
1952
2744
|
}
|
|
1953
|
-
const
|
|
1954
|
-
function
|
|
2745
|
+
const oi = (e, t) => e.direction === "obere" ? t <= e.returnTo : t >= e.returnTo, ot = (e, t, n) => e > n - t && e <= n, ri = (e, t, n) => e.reduce((o, r) => o + (ot(r, t, n) ? 1 : 0), 0);
|
|
2746
|
+
function vs(e, t, n) {
|
|
1955
2747
|
const o = /* @__PURE__ */ new Map();
|
|
1956
2748
|
for (const r of e)
|
|
1957
|
-
|
|
2749
|
+
ot(r.raised, t, n) && o.set(r.type, (o.get(r.type) ?? 0) + 1);
|
|
1958
2750
|
return o;
|
|
1959
2751
|
}
|
|
1960
|
-
function
|
|
2752
|
+
function _s(e) {
|
|
1961
2753
|
let t = Number.POSITIVE_INFINITY;
|
|
1962
2754
|
for (const n of e) n < t && (t = n);
|
|
1963
2755
|
return t;
|
|
1964
2756
|
}
|
|
1965
|
-
function
|
|
2757
|
+
function ys(e) {
|
|
1966
2758
|
let t = Number.NEGATIVE_INFINITY;
|
|
1967
2759
|
for (const n of e) n > t && (t = n);
|
|
1968
2760
|
return t;
|
|
1969
2761
|
}
|
|
1970
|
-
function
|
|
1971
|
-
const o = e.filter((
|
|
2762
|
+
function Cs(e, t, n) {
|
|
2763
|
+
const o = e.filter((s) => ot(s.raised, t.windowMs, n));
|
|
1972
2764
|
if (o.length < t.atLeast) return null;
|
|
1973
|
-
const r = o.map((
|
|
2765
|
+
const r = o.map((s) => s.raised);
|
|
1974
2766
|
return {
|
|
1975
2767
|
// No spread: a flood is the case with many elements, and an argument list
|
|
1976
2768
|
// of that size blows the call stack at some point. A loop cannot.
|
|
1977
|
-
from:
|
|
1978
|
-
to:
|
|
2769
|
+
from: _s(r),
|
|
2770
|
+
to: ys(r),
|
|
1979
2771
|
count: o.length,
|
|
1980
|
-
alarms: o.map((
|
|
2772
|
+
alarms: o.map((s) => s.id)
|
|
1981
2773
|
};
|
|
1982
2774
|
}
|
|
1983
|
-
function
|
|
2775
|
+
function Ss(e, t) {
|
|
1984
2776
|
const n = new Set(t);
|
|
1985
2777
|
return e.reduce(
|
|
1986
|
-
(o, r) => o + (n.has(r.id) && !
|
|
2778
|
+
(o, r) => o + (n.has(r.id) && !De(r.lifecycle) ? 1 : 0),
|
|
1987
2779
|
0
|
|
1988
2780
|
);
|
|
1989
2781
|
}
|
|
1990
|
-
function
|
|
2782
|
+
function si(e, t, n) {
|
|
1991
2783
|
const o = new Set(t);
|
|
1992
2784
|
let r = 0;
|
|
1993
|
-
return { alarms: e.map((
|
|
2785
|
+
return { alarms: e.map((i) => !o.has(i.id) || De(i.lifecycle) ? i : (r += 1, { ...i, lifecycle: ks(i.lifecycle, "acknowledged"), acknowledgedAt: n })), count: r };
|
|
1994
2786
|
}
|
|
1995
|
-
const
|
|
2787
|
+
const Ns = (e) => [
|
|
1996
2788
|
{
|
|
1997
2789
|
id: "type",
|
|
1998
2790
|
label: e.columnAlarm,
|
|
@@ -2006,70 +2798,70 @@ const dr = (e) => [
|
|
|
2006
2798
|
level of the order asks only about the acknowledgement and expressly not
|
|
2007
2799
|
about whether the alarm is still standing. Otherwise the fleeting alarm
|
|
2008
2800
|
falls back down again. */
|
|
2009
|
-
{ id: "acknowledgement", label: e.columnAcknowledgement, value: (t) =>
|
|
2801
|
+
{ id: "acknowledgement", label: e.columnAcknowledgement, value: (t) => De(t.lifecycle) ? 1 : 0 },
|
|
2010
2802
|
{ id: "raised", label: e.columnRaised, value: (t) => t.alarm.raised },
|
|
2011
2803
|
{ id: "age", label: e.columnAge, value: (t) => t.age },
|
|
2012
2804
|
{ id: "frequency", label: e.columnFrequency, value: (t) => t.frequency }
|
|
2013
|
-
],
|
|
2805
|
+
], xs = Ns(rn), As = [
|
|
2014
2806
|
{ column: "priority", direction: "asc" },
|
|
2015
2807
|
{ column: "acknowledgement", direction: "asc" },
|
|
2016
2808
|
{ column: "raised", direction: "desc" }
|
|
2017
|
-
],
|
|
2809
|
+
], Ts = (e) => ({
|
|
2018
2810
|
id: e,
|
|
2019
2811
|
label: e,
|
|
2020
2812
|
priority: "high"
|
|
2021
2813
|
});
|
|
2022
|
-
function
|
|
2814
|
+
function ii(e, t = {}) {
|
|
2023
2815
|
const {
|
|
2024
2816
|
alarms: n,
|
|
2025
2817
|
types: o,
|
|
2026
2818
|
asOf: r,
|
|
2027
|
-
chatter:
|
|
2028
|
-
flood:
|
|
2029
|
-
keepDone:
|
|
2030
|
-
columns:
|
|
2031
|
-
} = e, u = new Map(o.map((
|
|
2032
|
-
const
|
|
2819
|
+
chatter: s,
|
|
2820
|
+
flood: i,
|
|
2821
|
+
keepDone: a = !1,
|
|
2822
|
+
columns: c = xs
|
|
2823
|
+
} = e, u = new Map(o.map((p) => [p.id, p])), h = vs(n, (s == null ? void 0 : s.windowMs) ?? 1 / 0, r), d = i ? Cs(n, i, r) : null, m = new Set((d == null ? void 0 : d.alarms) ?? []), w = n.filter((p) => a || !bs(p.lifecycle)).map((p) => {
|
|
2824
|
+
const b = u.get(p.type) ?? Ts(p.type), g = h.get(p.type) ?? 0;
|
|
2033
2825
|
return {
|
|
2034
|
-
id:
|
|
2035
|
-
alarm:
|
|
2036
|
-
type:
|
|
2037
|
-
lifecycle:
|
|
2038
|
-
priority:
|
|
2039
|
-
rank:
|
|
2040
|
-
age: r -
|
|
2041
|
-
duration: (
|
|
2042
|
-
frequency:
|
|
2043
|
-
chatters:
|
|
2044
|
-
inFlood:
|
|
2826
|
+
id: p.id,
|
|
2827
|
+
alarm: p,
|
|
2828
|
+
type: b,
|
|
2829
|
+
lifecycle: p.lifecycle,
|
|
2830
|
+
priority: b.priority,
|
|
2831
|
+
rank: ms(b.priority),
|
|
2832
|
+
age: r - p.raised,
|
|
2833
|
+
duration: (p.cleared ?? r) - p.raised,
|
|
2834
|
+
frequency: g,
|
|
2835
|
+
chatters: s !== void 0 && g >= s.atLeast,
|
|
2836
|
+
inFlood: m.has(p.id)
|
|
2045
2837
|
};
|
|
2046
|
-
}),
|
|
2838
|
+
}), k = tt(w, c, {
|
|
2047
2839
|
...t,
|
|
2048
|
-
sort: t.sort === void 0 ?
|
|
2840
|
+
sort: t.sort === void 0 ? As : t.sort
|
|
2049
2841
|
});
|
|
2050
2842
|
return {
|
|
2051
|
-
...
|
|
2052
|
-
flood:
|
|
2053
|
-
standingUnacknowledged:
|
|
2054
|
-
(
|
|
2843
|
+
...k,
|
|
2844
|
+
flood: d,
|
|
2845
|
+
standingUnacknowledged: k.filtered.reduce(
|
|
2846
|
+
(p, b) => p + (b.lifecycle === "standing-unacknowledged" ? 1 : 0),
|
|
2055
2847
|
0
|
|
2056
2848
|
)
|
|
2057
2849
|
};
|
|
2058
2850
|
}
|
|
2059
|
-
const
|
|
2060
|
-
list:
|
|
2061
|
-
bar:
|
|
2062
|
-
heading:
|
|
2063
|
-
filler:
|
|
2064
|
-
asOf:
|
|
2065
|
-
live:
|
|
2066
|
-
label:
|
|
2067
|
-
counter:
|
|
2068
|
-
lifecycle:
|
|
2069
|
-
empty:
|
|
2070
|
-
row:
|
|
2851
|
+
const Fs = "_list_17f0w_4 _text_1hv7a_23", Os = "_bar_17f0w_12", Ls = "_heading_17f0w_19", Rs = "_filler_17f0w_25", Ms = "_asOf_17f0w_29", Vs = "_live_17f0w_46", Ds = "_label_17f0w_51", Is = "_counter_17f0w_55", Bs = "_lifecycle_17f0w_59", Ps = "_empty_17f0w_63", Gs = "_row_17f0w_70", oe = {
|
|
2852
|
+
list: Fs,
|
|
2853
|
+
bar: Os,
|
|
2854
|
+
heading: Ls,
|
|
2855
|
+
filler: Rs,
|
|
2856
|
+
asOf: Ms,
|
|
2857
|
+
live: Vs,
|
|
2858
|
+
label: Ds,
|
|
2859
|
+
counter: Is,
|
|
2860
|
+
lifecycle: Bs,
|
|
2861
|
+
empty: Ps,
|
|
2862
|
+
row: Gs
|
|
2071
2863
|
};
|
|
2072
|
-
function
|
|
2864
|
+
function Es(e, t) {
|
|
2073
2865
|
switch (e) {
|
|
2074
2866
|
case "standing-unacknowledged":
|
|
2075
2867
|
return t.lifecycleStandingUnacknowledged;
|
|
@@ -2081,108 +2873,108 @@ function Nr(e, t) {
|
|
|
2081
2873
|
return t.lifecycleClearedAcknowledged;
|
|
2082
2874
|
}
|
|
2083
2875
|
}
|
|
2084
|
-
function
|
|
2876
|
+
function zs(e, t) {
|
|
2085
2877
|
return e === "high" ? t.priorityHigh : e === "medium" ? t.priorityMedium : t.priorityLow;
|
|
2086
2878
|
}
|
|
2087
|
-
function
|
|
2879
|
+
function js(e) {
|
|
2088
2880
|
return e === "high" ? "danger" : e === "medium" ? "warning" : "neutral";
|
|
2089
2881
|
}
|
|
2090
|
-
function
|
|
2091
|
-
const n = Math.max(0, Math.floor(e / 6e4)), o = Math.floor(n / 60), r = n % 60,
|
|
2092
|
-
return o > 0 &&
|
|
2882
|
+
function Hs(e, t) {
|
|
2883
|
+
const n = Math.max(0, Math.floor(e / 6e4)), o = Math.floor(n / 60), r = n % 60, s = [];
|
|
2884
|
+
return o > 0 && s.push(t.hoursShort(o)), (o === 0 || r > 0) && s.push(t.minutesShort(r)), s.join(" ");
|
|
2093
2885
|
}
|
|
2094
|
-
function
|
|
2886
|
+
function ai(e) {
|
|
2095
2887
|
const { asOf: t, freshness: n, ...o } = e;
|
|
2096
|
-
return t === void 0 || n === void 0 ? /* @__PURE__ */
|
|
2888
|
+
return t === void 0 || n === void 0 ? /* @__PURE__ */ l(Ut, { ...o, freshness: null }) : /* @__PURE__ */ l($s, { ...o, asOf: t, ages: n });
|
|
2097
2889
|
}
|
|
2098
|
-
function
|
|
2890
|
+
function $s({
|
|
2099
2891
|
asOf: e,
|
|
2100
2892
|
ages: t,
|
|
2101
2893
|
...n
|
|
2102
2894
|
}) {
|
|
2103
|
-
const o =
|
|
2104
|
-
return /* @__PURE__ */
|
|
2895
|
+
const o = sn(e, t);
|
|
2896
|
+
return /* @__PURE__ */ l(Ut, { ...n, freshness: o });
|
|
2105
2897
|
}
|
|
2106
|
-
function
|
|
2898
|
+
function Ut({
|
|
2107
2899
|
view: e,
|
|
2108
2900
|
selection: t,
|
|
2109
2901
|
onAcknowledge: n,
|
|
2110
2902
|
density: o,
|
|
2111
2903
|
className: r,
|
|
2112
|
-
freshness:
|
|
2113
|
-
...
|
|
2904
|
+
freshness: s,
|
|
2905
|
+
...i
|
|
2114
2906
|
}) {
|
|
2115
|
-
const
|
|
2116
|
-
return /* @__PURE__ */
|
|
2117
|
-
/* @__PURE__ */
|
|
2118
|
-
/* @__PURE__ */
|
|
2119
|
-
e.flood !== null && /* @__PURE__ */
|
|
2120
|
-
u &&
|
|
2121
|
-
|
|
2122
|
-
|
|
2907
|
+
const a = U(), c = ue(), u = s !== null, h = (s == null ? void 0 : s.freshness) === "lost", { Table: d, Column: m } = gs(e.visible, { rowKey: (g) => g.id, selection: t }), w = $(() => e.filtered.map((g) => g.alarm), [e.filtered]), k = $(() => t === void 0 ? [] : e.filtered.map((g) => g.id).filter((g) => t.selected.has(g)), [e.filtered, t]), p = $(() => Ss(w, k), [w, k]), b = Tt(o, "compact");
|
|
2908
|
+
return /* @__PURE__ */ O("div", { className: [oe.list, r].filter(Boolean).join(" "), ...i, children: [
|
|
2909
|
+
/* @__PURE__ */ O("div", { className: oe.bar, children: [
|
|
2910
|
+
/* @__PURE__ */ l("span", { className: oe.heading, children: a.alarms }),
|
|
2911
|
+
e.flood !== null && /* @__PURE__ */ l(Ie, { tone: "warning", children: a.floodHint(e.flood.count) }),
|
|
2912
|
+
u && s !== null && /* @__PURE__ */ O("span", { className: oe.asOf, "data-freshness": s.freshness, children: [
|
|
2913
|
+
s.freshness === "lost" ? a.freshnessDisconnected : s.freshness === "stale" ? a.freshnessStale : a.freshnessFresh,
|
|
2914
|
+
s.age !== null && ` · ${c.relative(s.age)}`
|
|
2123
2915
|
] }),
|
|
2124
|
-
/* @__PURE__ */
|
|
2125
|
-
t !== void 0 && n !== void 0 && /* @__PURE__ */
|
|
2916
|
+
/* @__PURE__ */ l("span", { className: oe.filler }),
|
|
2917
|
+
t !== void 0 && n !== void 0 && /* @__PURE__ */ l(ee, { variant: "primary", size: "sm", disabled: p === 0, onClick: () => n(k), children: p === 0 ? a.acknowledgeAlarm : a.acknowledgeAlarms(p) })
|
|
2126
2918
|
] }),
|
|
2127
|
-
/* @__PURE__ */
|
|
2128
|
-
/* @__PURE__ */
|
|
2129
|
-
|
|
2919
|
+
/* @__PURE__ */ l("div", { "aria-live": "polite", "aria-atomic": "true", className: oe.live, children: a.standingUnacknowledged(e.standingUnacknowledged) }),
|
|
2920
|
+
/* @__PURE__ */ O(
|
|
2921
|
+
d,
|
|
2130
2922
|
{
|
|
2131
|
-
ariaLabel:
|
|
2923
|
+
ariaLabel: a.alarms,
|
|
2132
2924
|
selectable: t !== void 0,
|
|
2133
|
-
density:
|
|
2925
|
+
density: b,
|
|
2134
2926
|
stickyHeader: !0,
|
|
2135
|
-
rowProps: (
|
|
2136
|
-
empty: /* @__PURE__ */
|
|
2927
|
+
rowProps: (g) => ({ className: oe.row, "data-lifecycle": g.lifecycle, "data-priority": g.priority }),
|
|
2928
|
+
empty: /* @__PURE__ */ l("span", { className: oe.empty, children: h ? a.noAlarmsDisconnected : a.noAlarms }),
|
|
2137
2929
|
children: [
|
|
2138
|
-
/* @__PURE__ */
|
|
2139
|
-
/* @__PURE__ */
|
|
2140
|
-
|
|
2930
|
+
/* @__PURE__ */ l(m, { id: "type", label: a.columnAlarm, value: (g) => g.type.label, rowHeader: !0, sortable: !1, children: (g, _) => /* @__PURE__ */ O(Q, { children: [
|
|
2931
|
+
/* @__PURE__ */ l("span", { className: oe.label, children: g }),
|
|
2932
|
+
_.chatters && /* @__PURE__ */ l(Ie, { tone: "warning", pill: !0, className: oe.counter, children: a.chatterHint(_.frequency) })
|
|
2141
2933
|
] }) }),
|
|
2142
|
-
/* @__PURE__ */
|
|
2143
|
-
/* @__PURE__ */
|
|
2144
|
-
/* @__PURE__ */
|
|
2145
|
-
|
|
2934
|
+
/* @__PURE__ */ l(m, { value: "lifecycle", label: a.columnLifecycleState, sortable: !1, children: (g) => /* @__PURE__ */ l("span", { className: oe.lifecycle, children: Es(g, a) }) }),
|
|
2935
|
+
/* @__PURE__ */ l(m, { value: "priority", label: a.columnPriority, sortable: !1, children: (g) => /* @__PURE__ */ l(Ie, { tone: js(g), children: zs(g, a) }) }),
|
|
2936
|
+
/* @__PURE__ */ l(
|
|
2937
|
+
m,
|
|
2146
2938
|
{
|
|
2147
2939
|
id: "raised",
|
|
2148
|
-
label:
|
|
2149
|
-
value: (
|
|
2940
|
+
label: a.columnRaised,
|
|
2941
|
+
value: (g) => new Date(g.alarm.raised),
|
|
2150
2942
|
numeric: !0,
|
|
2151
2943
|
sortable: !1
|
|
2152
2944
|
}
|
|
2153
2945
|
),
|
|
2154
|
-
/* @__PURE__ */
|
|
2155
|
-
/* @__PURE__ */
|
|
2946
|
+
/* @__PURE__ */ l(m, { value: "duration", label: a.columnDuration, sortable: !1, children: (g) => Hs(g, a) }),
|
|
2947
|
+
/* @__PURE__ */ l(m, { value: "frequency", label: a.columnFrequency, format: "count", sortable: !1 })
|
|
2156
2948
|
]
|
|
2157
2949
|
}
|
|
2158
2950
|
)
|
|
2159
2951
|
] });
|
|
2160
2952
|
}
|
|
2161
2953
|
export {
|
|
2162
|
-
|
|
2163
|
-
|
|
2164
|
-
|
|
2165
|
-
|
|
2166
|
-
|
|
2167
|
-
|
|
2168
|
-
|
|
2169
|
-
|
|
2170
|
-
|
|
2171
|
-
|
|
2172
|
-
|
|
2173
|
-
|
|
2174
|
-
|
|
2175
|
-
|
|
2176
|
-
|
|
2177
|
-
|
|
2178
|
-
|
|
2179
|
-
|
|
2180
|
-
|
|
2181
|
-
|
|
2182
|
-
|
|
2183
|
-
|
|
2184
|
-
|
|
2185
|
-
|
|
2186
|
-
|
|
2187
|
-
|
|
2954
|
+
xs as ALARM_COLUMNS,
|
|
2955
|
+
ai as AlarmList,
|
|
2956
|
+
ei as ColumnMenu,
|
|
2957
|
+
As as DEFAULT_ORDER,
|
|
2958
|
+
ti as Export,
|
|
2959
|
+
ps as PRIORITIES,
|
|
2960
|
+
ni as Pagination,
|
|
2961
|
+
Zs as Search,
|
|
2962
|
+
Qs as Toolbar,
|
|
2963
|
+
si as acknowledge,
|
|
2964
|
+
Ns as alarmColumns,
|
|
2965
|
+
ii as alarmModel,
|
|
2966
|
+
Xs as column,
|
|
2967
|
+
Js as columnFilter,
|
|
2968
|
+
Ss as countAcknowledgeable,
|
|
2969
|
+
ri as countInWindow,
|
|
2970
|
+
Cs as detectFlood,
|
|
2971
|
+
vs as frequencyByType,
|
|
2972
|
+
oi as hasReturned,
|
|
2973
|
+
De as isAcknowledged,
|
|
2974
|
+
bs as isDone,
|
|
2975
|
+
ws as isStanding,
|
|
2976
|
+
ks as nextLifecycleState,
|
|
2977
|
+
ms as priorityRank,
|
|
2978
|
+
gs as useTable,
|
|
2979
|
+
ln as useTableSelection
|
|
2188
2980
|
};
|