@umriss-ui/table 0.3.0 → 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 +20 -0
- package/dist/table.css +1 -1
- package/dist/table.js +834 -826
- package/package.json +3 -3
package/dist/table.js
CHANGED
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
import "./table.css";
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
import { useState as
|
|
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
|
|
7
|
-
import { jsx as l, jsxs as
|
|
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
8
|
import { createPortal as an } from "react-dom";
|
|
9
9
|
function ln(e) {
|
|
10
|
-
const [t, n] =
|
|
10
|
+
const [t, n] = H(/* @__PURE__ */ new Set()), o = X((u) => t.has(u), [t]), r = X((u) => {
|
|
11
11
|
n((h) => {
|
|
12
|
-
const
|
|
13
|
-
return
|
|
12
|
+
const d = new Set(h);
|
|
13
|
+
return d.has(u) ? d.delete(u) : d.add(u), d;
|
|
14
14
|
});
|
|
15
|
-
}, []), s =
|
|
15
|
+
}, []), s = $(
|
|
16
16
|
() => e.length > 0 && e.every((u) => t.has(u)),
|
|
17
17
|
[e, t]
|
|
18
|
-
), i =
|
|
18
|
+
), i = $(
|
|
19
19
|
() => !s && e.some((u) => t.has(u)),
|
|
20
20
|
[e, t, s]
|
|
21
21
|
), a = X(() => {
|
|
22
22
|
n((u) => {
|
|
23
23
|
const h = new Set(u);
|
|
24
|
-
return e.length > 0 && e.every((
|
|
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
26
|
}, [e]), c = X(() => n(/* @__PURE__ */ new Set()), []);
|
|
27
27
|
return { selected: t, isSelected: o, toggle: r, toggleAll: a, clear: c, allSelected: s, someSelected: i, count: t.size };
|
|
@@ -91,8 +91,8 @@ function Lt(e, t) {
|
|
|
91
91
|
}
|
|
92
92
|
}
|
|
93
93
|
}
|
|
94
|
-
const
|
|
95
|
-
function
|
|
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
96
|
const n = t.map(e.read).filter((c) => !Y(c) && !(c instanceof Date && Number.isNaN(c.getTime()))), o = e.aggregate;
|
|
97
97
|
if (typeof o == "function") return o(n, t);
|
|
98
98
|
if (o === "count") return n.length;
|
|
@@ -117,54 +117,54 @@ const Qe = 3, Ce = (e) => {
|
|
|
117
117
|
if (!Y(e))
|
|
118
118
|
return e instanceof Date ? e.getTime() : typeof e == "boolean" ? e ? 1 : 0 : typeof e == "number" ? e : String(e);
|
|
119
119
|
};
|
|
120
|
-
function
|
|
120
|
+
function Be(e, t, n) {
|
|
121
121
|
const o = Ce(e), r = Ce(t);
|
|
122
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
123
|
}
|
|
124
124
|
function dn(e, t) {
|
|
125
125
|
const n = t.compareText ?? Ct.compareText, o = (r, s, i) => {
|
|
126
|
-
var
|
|
126
|
+
var b;
|
|
127
127
|
const a = /* @__PURE__ */ new Map(), c = t.levels[s];
|
|
128
128
|
if (!c) return [];
|
|
129
129
|
const u = /* @__PURE__ */ new Map();
|
|
130
130
|
for (const g of r) {
|
|
131
|
-
const
|
|
132
|
-
let
|
|
133
|
-
|
|
134
|
-
path: JSON.stringify([...i,
|
|
135
|
-
value: Y(
|
|
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
136
|
level: s,
|
|
137
137
|
rows: [],
|
|
138
138
|
groups: [],
|
|
139
139
|
aggregates: {}
|
|
140
|
-
}, u.set(
|
|
140
|
+
}, u.set(C, S), a.set(S, [...i, C])), S.rows.push(g);
|
|
141
141
|
}
|
|
142
142
|
for (const g of u.values())
|
|
143
|
-
for (const
|
|
144
|
-
const h = (
|
|
143
|
+
for (const _ of t.aggregates ?? []) g.aggregates[_.id] = Xe(_, g.rows);
|
|
144
|
+
const h = (b = t.sort) == null ? void 0 : b.find(
|
|
145
145
|
(g) => {
|
|
146
|
-
var
|
|
147
|
-
return g.column === c.id || ((
|
|
146
|
+
var _;
|
|
147
|
+
return g.column === c.id || ((_ = t.aggregates) == null ? void 0 : _.some((C) => C.id === g.column));
|
|
148
148
|
}
|
|
149
|
-
),
|
|
150
|
-
let
|
|
151
|
-
for (const
|
|
152
|
-
const
|
|
153
|
-
Ce(
|
|
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
154
|
}
|
|
155
|
-
return
|
|
155
|
+
return _;
|
|
156
156
|
}, k = (g) => {
|
|
157
|
-
if (
|
|
158
|
-
const
|
|
159
|
-
return Array.isArray(
|
|
160
|
-
},
|
|
161
|
-
if (g.value === void 0 ||
|
|
162
|
-
const
|
|
163
|
-
return Ce(
|
|
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
164
|
});
|
|
165
|
-
for (const g of
|
|
165
|
+
for (const g of p)
|
|
166
166
|
g.groups = o(g.rows, s + 1, a.get(g));
|
|
167
|
-
return
|
|
167
|
+
return p;
|
|
168
168
|
};
|
|
169
169
|
return o(e, 0, []);
|
|
170
170
|
}
|
|
@@ -229,7 +229,7 @@ function et(e, t) {
|
|
|
229
229
|
}
|
|
230
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
231
|
function tt(e, t, n) {
|
|
232
|
-
var
|
|
232
|
+
var x;
|
|
233
233
|
const {
|
|
234
234
|
search: o = "",
|
|
235
235
|
filter: r,
|
|
@@ -238,202 +238,202 @@ function tt(e, t, n) {
|
|
|
238
238
|
pageSize: a,
|
|
239
239
|
hidden: c,
|
|
240
240
|
order: u
|
|
241
|
-
} = n, h = et(t, u),
|
|
242
|
-
const
|
|
243
|
-
return !ke(
|
|
244
|
-
}),
|
|
245
|
-
const
|
|
246
|
-
if (!
|
|
247
|
-
const
|
|
248
|
-
return
|
|
249
|
-
const
|
|
250
|
-
return ke(
|
|
251
|
-
} : (
|
|
252
|
-
}).filter((
|
|
253
|
-
if (g.length > 0 &&
|
|
254
|
-
for (const
|
|
255
|
-
const
|
|
256
|
-
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;
|
|
257
257
|
}
|
|
258
258
|
return 0;
|
|
259
|
-
}), (
|
|
260
|
-
const { folded:
|
|
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
261
|
return {
|
|
262
|
-
columns:
|
|
263
|
-
filtered:
|
|
264
|
-
visible: Ze(
|
|
265
|
-
groups:
|
|
266
|
-
lines:
|
|
267
|
-
visibleLines:
|
|
268
|
-
page:
|
|
269
|
-
pageCount:
|
|
270
|
-
columnCount:
|
|
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
271
|
};
|
|
272
272
|
}
|
|
273
|
-
const
|
|
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 * _);
|
|
274
274
|
return {
|
|
275
|
-
columns:
|
|
276
|
-
filtered:
|
|
277
|
-
visible:
|
|
278
|
-
page:
|
|
279
|
-
pageCount:
|
|
280
|
-
columnCount:
|
|
275
|
+
columns: d,
|
|
276
|
+
filtered: p,
|
|
277
|
+
visible: I,
|
|
278
|
+
page: S,
|
|
279
|
+
pageCount: C,
|
|
280
|
+
columnCount: d.length
|
|
281
281
|
};
|
|
282
282
|
}
|
|
283
283
|
function kn(e, t, n) {
|
|
284
|
-
const { rowKey: o, filter: r, defaultSort: s = null, initialView: i, virtual: a, grouping: c } = n, [u, h] =
|
|
285
|
-
var
|
|
286
|
-
return (
|
|
287
|
-
}), [
|
|
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
288
|
(i == null ? void 0 : i.pageSize) ?? n.pageSize ?? 10
|
|
289
|
-
), [g,
|
|
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
290
|
if (i != null && i.widths) return { ...i.widths };
|
|
291
|
-
const
|
|
292
|
-
for (const
|
|
293
|
-
|
|
294
|
-
return
|
|
295
|
-
}),
|
|
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
296
|
() => tt(e, t, {
|
|
297
297
|
search: u,
|
|
298
298
|
filter: r,
|
|
299
|
-
sort:
|
|
300
|
-
page:
|
|
301
|
-
pageSize:
|
|
302
|
-
hidden:
|
|
303
|
-
order:
|
|
299
|
+
sort: d,
|
|
300
|
+
page: w,
|
|
301
|
+
pageSize: F,
|
|
302
|
+
hidden: C,
|
|
303
|
+
order: I,
|
|
304
304
|
grouping: c
|
|
305
305
|
}),
|
|
306
|
-
[e, t, u, r,
|
|
307
|
-
),
|
|
306
|
+
[e, t, u, r, d, w, F, C, I, c]
|
|
307
|
+
), N = Qt(a ? (L.lines ?? L.filtered).length : 0, {
|
|
308
308
|
rowHeight: (a == null ? void 0 : a.rowHeight) ?? 0,
|
|
309
309
|
overscan: a == null ? void 0 : a.overscan
|
|
310
|
-
}),
|
|
311
|
-
() => a &&
|
|
312
|
-
[a,
|
|
313
|
-
),
|
|
314
|
-
() => a ?
|
|
315
|
-
[a,
|
|
316
|
-
),
|
|
317
|
-
h(
|
|
318
|
-
}, []), ae = X((
|
|
319
|
-
|
|
320
|
-
}, []), de = X((
|
|
321
|
-
|
|
322
|
-
const
|
|
323
|
-
if (!
|
|
324
|
-
const he =
|
|
325
|
-
return [{ column:
|
|
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 }];
|
|
326
326
|
}
|
|
327
|
-
return
|
|
328
|
-
(he) => he.column ===
|
|
329
|
-
) :
|
|
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
330
|
}), k(1);
|
|
331
|
-
}, []), fe = X((
|
|
332
|
-
|
|
333
|
-
(
|
|
331
|
+
}, []), fe = X((T) => {
|
|
332
|
+
_(
|
|
333
|
+
(D) => D.includes(T) ? D.filter((E) => E !== T) : [...D, T]
|
|
334
334
|
);
|
|
335
335
|
}, []), we = X(
|
|
336
|
-
(
|
|
336
|
+
(T) => g.includes(T),
|
|
337
337
|
[g]
|
|
338
|
-
), be = X((
|
|
339
|
-
|
|
340
|
-
(
|
|
338
|
+
), be = X((T) => {
|
|
339
|
+
S(
|
|
340
|
+
(D) => D.includes(T) ? D.filter((E) => E !== T) : [...D, T]
|
|
341
341
|
);
|
|
342
|
-
}, []), ye = X((
|
|
343
|
-
|
|
344
|
-
if (
|
|
345
|
-
if (!(
|
|
346
|
-
const
|
|
347
|
-
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;
|
|
348
348
|
}
|
|
349
|
-
return { ...
|
|
349
|
+
return { ...E, [T]: D };
|
|
350
350
|
});
|
|
351
351
|
}, []), le = X(
|
|
352
|
-
(
|
|
353
|
-
var
|
|
354
|
-
return (
|
|
352
|
+
(T) => {
|
|
353
|
+
var D;
|
|
354
|
+
return (D = d.find((E) => E.column === T)) == null ? void 0 : D.direction;
|
|
355
355
|
},
|
|
356
|
-
[
|
|
356
|
+
[d]
|
|
357
357
|
), te = X(
|
|
358
|
-
(
|
|
359
|
-
if (
|
|
360
|
-
const
|
|
361
|
-
return
|
|
358
|
+
(T) => {
|
|
359
|
+
if (d.length < 2) return;
|
|
360
|
+
const D = d.findIndex((E) => E.column === T);
|
|
361
|
+
return D === -1 ? void 0 : D + 1;
|
|
362
362
|
},
|
|
363
|
-
[
|
|
364
|
-
), y =
|
|
365
|
-
() => et(t,
|
|
366
|
-
[t,
|
|
367
|
-
), R = n.pageSize ?? 10,
|
|
368
|
-
const
|
|
369
|
-
for (const
|
|
370
|
-
|
|
371
|
-
return
|
|
372
|
-
}, [t]),
|
|
373
|
-
const
|
|
374
|
-
for (const [
|
|
375
|
-
|
|
376
|
-
return
|
|
377
|
-
}, [
|
|
363
|
+
[d]
|
|
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
378
|
() => s ? Array.isArray(s) ? s : [s] : [],
|
|
379
379
|
[s]
|
|
380
|
-
),
|
|
381
|
-
(
|
|
382
|
-
var
|
|
383
|
-
return
|
|
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);
|
|
384
384
|
}
|
|
385
|
-
),
|
|
385
|
+
), Z = $(
|
|
386
386
|
() => ({
|
|
387
387
|
...u ? { search: u } : {},
|
|
388
|
-
...
|
|
388
|
+
...d.length && !J ? { sort: d } : {},
|
|
389
389
|
/* Without paging there is no page a view could carry - a page three in
|
|
390
390
|
the view of a virtualised table would be a promise nobody redeems on
|
|
391
391
|
opening. */
|
|
392
|
-
...!a &&
|
|
393
|
-
...!a &&
|
|
394
|
-
...
|
|
395
|
-
...
|
|
396
|
-
...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 } : {}
|
|
397
397
|
}),
|
|
398
398
|
[
|
|
399
399
|
a,
|
|
400
400
|
u,
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
401
|
+
d,
|
|
402
|
+
J,
|
|
403
|
+
L.page,
|
|
404
|
+
p,
|
|
405
405
|
R,
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
406
|
+
C,
|
|
407
|
+
I,
|
|
408
|
+
j
|
|
409
409
|
]
|
|
410
410
|
);
|
|
411
411
|
return {
|
|
412
|
-
...
|
|
413
|
-
visible:
|
|
414
|
-
visibleLines:
|
|
415
|
-
virtual: a ?
|
|
416
|
-
view:
|
|
412
|
+
...L,
|
|
413
|
+
visible: z,
|
|
414
|
+
visibleLines: V,
|
|
415
|
+
virtual: a ? N : void 0,
|
|
416
|
+
view: Z,
|
|
417
417
|
search: u,
|
|
418
418
|
setSearch: ie,
|
|
419
|
-
sort:
|
|
419
|
+
sort: d,
|
|
420
420
|
toggleSort: de,
|
|
421
421
|
sortDirectionOf: le,
|
|
422
422
|
sortRankOf: te,
|
|
423
423
|
setPage: k,
|
|
424
|
-
pageSize:
|
|
424
|
+
pageSize: p,
|
|
425
425
|
setPageSize: ae,
|
|
426
426
|
expanded: g,
|
|
427
427
|
toggleRow: fe,
|
|
428
428
|
isExpanded: we,
|
|
429
|
-
hidden:
|
|
429
|
+
hidden: C,
|
|
430
430
|
toggleColumn: be,
|
|
431
431
|
columnChoices: y,
|
|
432
|
-
order:
|
|
433
|
-
setOrder:
|
|
434
|
-
widths:
|
|
432
|
+
order: I,
|
|
433
|
+
setOrder: x,
|
|
434
|
+
widths: A,
|
|
435
435
|
setWidth: ye,
|
|
436
|
-
selection:
|
|
436
|
+
selection: q
|
|
437
437
|
};
|
|
438
438
|
}
|
|
439
439
|
function vn() {
|
|
@@ -445,7 +445,7 @@ const Mt = vn(), at = /* @__PURE__ */ new Set();
|
|
|
445
445
|
function pe(e, t) {
|
|
446
446
|
!Mt || at.has(e) || (at.add(e), console.warn(`@umriss-ui/table: ${t}`));
|
|
447
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",
|
|
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
449
|
frame: _n,
|
|
450
450
|
children: yn,
|
|
451
451
|
scroll: Cn,
|
|
@@ -462,10 +462,10 @@ const _n = "_frame_1wkkr_11 _text_1hv7a_23", yn = "_children_1wkkr_23", Cn = "_s
|
|
|
462
462
|
stickyCell: Vn,
|
|
463
463
|
sortButton: Dn,
|
|
464
464
|
sortIndicator: In,
|
|
465
|
-
sortArrow:
|
|
466
|
-
sortArrowDesc:
|
|
467
|
-
sortActive:
|
|
468
|
-
sortRank:
|
|
465
|
+
sortArrow: Bn,
|
|
466
|
+
sortArrowDesc: Pn,
|
|
467
|
+
sortActive: Gn,
|
|
468
|
+
sortRank: En,
|
|
469
469
|
thFlex: zn,
|
|
470
470
|
footerKind: jn,
|
|
471
471
|
emptyCell: Hn,
|
|
@@ -475,8 +475,8 @@ const _n = "_frame_1wkkr_11 _text_1hv7a_23", yn = "_children_1wkkr_23", Cn = "_s
|
|
|
475
475
|
toolbar: qn,
|
|
476
476
|
toolbarGroup: Yn,
|
|
477
477
|
toolbarInfo: Un,
|
|
478
|
-
pagination:
|
|
479
|
-
paginationControls:
|
|
478
|
+
pagination: Jn,
|
|
479
|
+
paginationControls: Xn,
|
|
480
480
|
pageSize: Qn,
|
|
481
481
|
paginationStatus: Zn,
|
|
482
482
|
filterButton: eo,
|
|
@@ -515,10 +515,10 @@ const _n = "_frame_1wkkr_11 _text_1hv7a_23", yn = "_children_1wkkr_23", Cn = "_s
|
|
|
515
515
|
groupValue: Vo,
|
|
516
516
|
groupCount: Do,
|
|
517
517
|
continued: Io,
|
|
518
|
-
spanSelect:
|
|
519
|
-
fold:
|
|
520
|
-
foldClosed:
|
|
521
|
-
foldedCount:
|
|
518
|
+
spanSelect: Bo,
|
|
519
|
+
fold: Po,
|
|
520
|
+
foldClosed: Go,
|
|
521
|
+
foldedCount: Eo,
|
|
522
522
|
shareHost: zo,
|
|
523
523
|
shareBar: jo,
|
|
524
524
|
expander: Ho,
|
|
@@ -528,12 +528,12 @@ const _n = "_frame_1wkkr_11 _text_1hv7a_23", yn = "_children_1wkkr_23", Cn = "_s
|
|
|
528
528
|
actionsCell: qo,
|
|
529
529
|
actions: Yo,
|
|
530
530
|
grip: Uo,
|
|
531
|
-
virtualBody:
|
|
532
|
-
virtualRow:
|
|
531
|
+
virtualBody: Jo,
|
|
532
|
+
virtualRow: Xo,
|
|
533
533
|
fillerRow: Qo,
|
|
534
534
|
control: Zo
|
|
535
535
|
};
|
|
536
|
-
function
|
|
536
|
+
function Js(e) {
|
|
537
537
|
return e;
|
|
538
538
|
}
|
|
539
539
|
const Ne = /* @__PURE__ */ new WeakMap();
|
|
@@ -588,23 +588,23 @@ function rr({
|
|
|
588
588
|
absentOccurs: o = !1,
|
|
589
589
|
format: r
|
|
590
590
|
}) {
|
|
591
|
-
const s = ue(), i = U(), a =
|
|
592
|
-
const
|
|
593
|
-
|
|
594
|
-
const
|
|
595
|
-
return [...
|
|
596
|
-
}, [n, a, o, r, s, i]), u = je(a), h = (
|
|
597
|
-
const
|
|
598
|
-
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);
|
|
599
599
|
};
|
|
600
|
-
return /* @__PURE__ */ l("div", { className:
|
|
600
|
+
return /* @__PURE__ */ l("div", { className: f.filterContent, children: c.map((d) => /* @__PURE__ */ l(
|
|
601
601
|
Se,
|
|
602
602
|
{
|
|
603
|
-
label:
|
|
604
|
-
checked: u.has(
|
|
605
|
-
onChange: () => h(
|
|
603
|
+
label: d.text,
|
|
604
|
+
checked: u.has(d.key),
|
|
605
|
+
onChange: () => h(d)
|
|
606
606
|
},
|
|
607
|
-
|
|
607
|
+
d.key
|
|
608
608
|
)) });
|
|
609
609
|
}
|
|
610
610
|
const sr = Vt(
|
|
@@ -616,7 +616,7 @@ const sr = Vt(
|
|
|
616
616
|
{
|
|
617
617
|
isCondition: (e) => Array.isArray(e),
|
|
618
618
|
isEmpty: (e) => e.length === 0,
|
|
619
|
-
absentMatches: (e) => je(e).has(
|
|
619
|
+
absentMatches: (e) => je(e).has(Je),
|
|
620
620
|
/* From three values on the first two and how many more: a condition is one
|
|
621
621
|
line in the table toolbar, not a list. */
|
|
622
622
|
describeIn: (e, t) => {
|
|
@@ -628,29 +628,29 @@ const sr = Vt(
|
|
|
628
628
|
}
|
|
629
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
630
|
function ur({ condition: e, setCondition: t }) {
|
|
631
|
-
const n = U(), [o, r] =
|
|
632
|
-
const
|
|
633
|
-
if (
|
|
634
|
-
r(
|
|
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);
|
|
635
635
|
return;
|
|
636
636
|
}
|
|
637
|
-
if (r(null),
|
|
637
|
+
if (r(null), d.from === null && d.to === null) {
|
|
638
638
|
t(null);
|
|
639
639
|
return;
|
|
640
640
|
}
|
|
641
641
|
t({
|
|
642
|
-
...
|
|
643
|
-
...
|
|
642
|
+
...d.from !== null ? { from: d.from } : {},
|
|
643
|
+
...d.to !== null ? { to: d.to } : {}
|
|
644
644
|
});
|
|
645
645
|
};
|
|
646
|
-
return /* @__PURE__ */
|
|
646
|
+
return /* @__PURE__ */ O("div", { className: f.rangeFields, children: [
|
|
647
647
|
/* @__PURE__ */ l(rt, { label: n.filterFrom, children: /* @__PURE__ */ l(st, { size: "sm", value: i, invalid: s, onChange: (u) => c("from", u) }) }),
|
|
648
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) }) })
|
|
649
649
|
] });
|
|
650
650
|
}
|
|
651
651
|
function dr({ condition: e, setCondition: t }) {
|
|
652
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:
|
|
653
|
+
return /* @__PURE__ */ l("div", { className: f.rangePeriod, children: /* @__PURE__ */ l(
|
|
654
654
|
Zt,
|
|
655
655
|
{
|
|
656
656
|
size: "sm",
|
|
@@ -693,13 +693,13 @@ const hr = Vt(
|
|
|
693
693
|
}
|
|
694
694
|
}
|
|
695
695
|
);
|
|
696
|
-
class
|
|
696
|
+
class Pe {
|
|
697
697
|
constructor(t) {
|
|
698
|
-
|
|
698
|
+
B(this, "entries", /* @__PURE__ */ new Map());
|
|
699
699
|
/** Keys in the order of the running pass. */
|
|
700
|
-
|
|
700
|
+
B(this, "pass", []);
|
|
701
701
|
/** Order from the markers in the DOM, after the last commit. */
|
|
702
|
-
|
|
702
|
+
B(this, "dom", []);
|
|
703
703
|
this.markerAttribute = t;
|
|
704
704
|
}
|
|
705
705
|
note(t) {
|
|
@@ -745,55 +745,56 @@ const ut = (e) => JSON.stringify([
|
|
|
745
745
|
]), dt = (e, t) => e == null ? void 0 : e[t];
|
|
746
746
|
class gr {
|
|
747
747
|
constructor() {
|
|
748
|
-
|
|
749
|
-
|
|
748
|
+
B(this, "columns", new Pe("data-umriss-column"));
|
|
749
|
+
B(this, "actions", new Pe("data-umriss-action"));
|
|
750
750
|
/** The group keys: values to group by that are no column. */
|
|
751
|
-
|
|
752
|
-
|
|
751
|
+
B(this, "groupKeys", new Pe("data-umriss-groupkey"));
|
|
752
|
+
B(this, "signatures", /* @__PURE__ */ new Map());
|
|
753
753
|
/** The row detail: the presentation of the `RowDetail` that registered last. */
|
|
754
|
-
|
|
754
|
+
B(this, "detail", null);
|
|
755
755
|
/** How many `RowActions` stand right now. */
|
|
756
|
-
|
|
756
|
+
B(this, "actionGroups", /* @__PURE__ */ new Set());
|
|
757
757
|
/** Whether the row header column sticks - it then stands first, on screen, in
|
|
758
758
|
the column menu and in the export alike. */
|
|
759
|
-
|
|
759
|
+
B(this, "stickyRowHeader", !1);
|
|
760
760
|
/* Without a pagination bar the table does not page: one that stops quietly at
|
|
761
761
|
the tenth row because nobody put one there is a trap (found at the alarm
|
|
762
762
|
list, umriss-table 13). Without a table toolbar, but with a search or a
|
|
763
763
|
column filter, the table puts one there itself (table-filters 04):
|
|
764
764
|
conditions and the ratio need a place, and a place that came into being
|
|
765
765
|
only with the first condition would shift the table. */
|
|
766
|
-
|
|
766
|
+
B(this, "parts", /* @__PURE__ */ new Map());
|
|
767
767
|
/** The element the table's children stand in - for the markers. */
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
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());
|
|
776
776
|
/* --- Subscription ------------------------------------------------------------- */
|
|
777
|
-
|
|
777
|
+
B(this, "subscribe", (t) => (this.listeners.add(t), () => {
|
|
778
778
|
this.listeners.delete(t);
|
|
779
779
|
}));
|
|
780
780
|
/** What the hook reads. */
|
|
781
|
-
|
|
781
|
+
B(this, "structureVersion", () => this.structure);
|
|
782
782
|
/** What body and unbound parts read. Every counter only rises, so the sum
|
|
783
783
|
rises exactly when one of them rises. */
|
|
784
|
-
|
|
785
|
-
/** The
|
|
786
|
-
|
|
787
|
-
|
|
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);
|
|
788
789
|
/** Whether the table lets itself be grouped at all (`<Table groupable>`). */
|
|
789
|
-
|
|
790
|
-
|
|
790
|
+
B(this, "tableGroupable", !0);
|
|
791
|
+
B(this, "groupingCache", null);
|
|
791
792
|
/* --- The kind of a column ------------------------------------------------------- */
|
|
792
|
-
|
|
793
|
+
B(this, "kinds", /* @__PURE__ */ new Map());
|
|
793
794
|
/* --- The model ------------------------------------------------------------------ */
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
795
|
+
B(this, "modelCache", null);
|
|
796
|
+
B(this, "projectionCache", null);
|
|
797
|
+
B(this, "unpaged", null);
|
|
797
798
|
}
|
|
798
799
|
/** Reports from a layout effect what has changed since the last report.
|
|
799
800
|
Without a change nothing happens. */
|
|
@@ -898,12 +899,17 @@ class gr {
|
|
|
898
899
|
removeGroupKey(t) {
|
|
899
900
|
this.groupKeys.entries.delete(t) && (this.signatures.delete(t), this.kinds.delete(t), this.structure++);
|
|
900
901
|
}
|
|
901
|
-
|
|
902
|
-
|
|
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;
|
|
903
908
|
}
|
|
904
|
-
/**
|
|
905
|
-
|
|
906
|
-
|
|
909
|
+
/** The focus noted before the last fold - once. */
|
|
910
|
+
takeFocusBeforeFold() {
|
|
911
|
+
const t = this.focusBeforeFold;
|
|
912
|
+
return this.focusBeforeFold = null, t;
|
|
907
913
|
}
|
|
908
914
|
setTableGroupable(t) {
|
|
909
915
|
this.tableGroupable !== t && (this.tableGroupable = t, this.structure++);
|
|
@@ -936,8 +942,8 @@ class gr {
|
|
|
936
942
|
value: (u) => {
|
|
937
943
|
const h = c.read(u);
|
|
938
944
|
if (h == null) return;
|
|
939
|
-
const { ownGroupValue:
|
|
940
|
-
return
|
|
945
|
+
const { ownGroupValue: d, group: m } = c.spec;
|
|
946
|
+
return d ? d(h) : m ? hn(m)(h) : h;
|
|
941
947
|
},
|
|
942
948
|
/* A value of one's own is a name; its groups stand by what they hold. */
|
|
943
949
|
order: c.spec.ownGroupValue ? (u) => ze(c.read(u), c.spec.ownSortValue) : void 0
|
|
@@ -984,15 +990,15 @@ class gr {
|
|
|
984
990
|
if (((i = this.modelCache) == null ? void 0 : i.key) === r && this.modelCache.rows === t && this.modelCache.formats === n)
|
|
985
991
|
return this.modelCache.columns;
|
|
986
992
|
const s = o.map((a) => {
|
|
987
|
-
const { spec: c } = a, u = this.kindOf(a, t), h = this.isSortable(a, t),
|
|
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);
|
|
988
994
|
return {
|
|
989
995
|
id: c.id,
|
|
990
996
|
label: c.label,
|
|
991
|
-
value: h ||
|
|
997
|
+
value: h || d ? m : void 0,
|
|
992
998
|
/* Text sorts with the provider's comparison, not with the built-in
|
|
993
999
|
German one (spec, the table of defaults). */
|
|
994
|
-
compare: u === "text" && !c.ownSortValue ? (
|
|
995
|
-
searchable:
|
|
1000
|
+
compare: u === "text" && !c.ownSortValue ? (w, k) => n.compareText(String(m(w)), String(m(k))) : void 0,
|
|
1001
|
+
searchable: d,
|
|
996
1002
|
hideable: !c.rowHeader,
|
|
997
1003
|
resizable: c.resizable,
|
|
998
1004
|
width: c.width
|
|
@@ -1103,10 +1109,10 @@ function pr(e, t, n) {
|
|
|
1103
1109
|
const o = e.lines.slice(t, n);
|
|
1104
1110
|
return { ...e, visibleLines: o, visible: Ze(o) };
|
|
1105
1111
|
}
|
|
1106
|
-
const
|
|
1107
|
-
|
|
1108
|
-
}, wr = (e) => typeof e == "function" || typeof e == "object" && e !== null ?
|
|
1109
|
-
function
|
|
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({
|
|
1110
1116
|
entry: e,
|
|
1111
1117
|
registry: t,
|
|
1112
1118
|
hook: n,
|
|
@@ -1116,13 +1122,13 @@ function Gt({
|
|
|
1116
1122
|
setOpen: i,
|
|
1117
1123
|
panelId: a
|
|
1118
1124
|
}) {
|
|
1119
|
-
const c = U(), u = ue(), { id: h, label:
|
|
1120
|
-
if (!
|
|
1121
|
-
const
|
|
1122
|
-
var
|
|
1123
|
-
i(!1), (
|
|
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();
|
|
1124
1130
|
};
|
|
1125
|
-
return /* @__PURE__ */
|
|
1131
|
+
return /* @__PURE__ */ O(
|
|
1126
1132
|
St,
|
|
1127
1133
|
{
|
|
1128
1134
|
open: s,
|
|
@@ -1130,23 +1136,23 @@ function Gt({
|
|
|
1130
1136
|
anchorRef: o,
|
|
1131
1137
|
align: "end",
|
|
1132
1138
|
role: "dialog",
|
|
1133
|
-
ariaLabel: c.filterColumn(
|
|
1139
|
+
ariaLabel: c.filterColumn(d),
|
|
1134
1140
|
id: a,
|
|
1135
|
-
className:
|
|
1141
|
+
className: f.filterPanel,
|
|
1136
1142
|
children: [
|
|
1137
1143
|
/* @__PURE__ */ l(
|
|
1138
1144
|
g,
|
|
1139
1145
|
{
|
|
1140
|
-
condition:
|
|
1141
|
-
setCondition: (
|
|
1142
|
-
values:
|
|
1143
|
-
column: { id: h, label:
|
|
1144
|
-
...
|
|
1146
|
+
condition: b.filter[h] ?? null,
|
|
1147
|
+
setCondition: (S) => b.setFilter(h, S),
|
|
1148
|
+
values: w,
|
|
1149
|
+
column: { id: h, label: d },
|
|
1150
|
+
..._
|
|
1145
1151
|
}
|
|
1146
1152
|
),
|
|
1147
|
-
/* @__PURE__ */
|
|
1148
|
-
/* @__PURE__ */ l(ee, { size: "sm", variant: "ghost", onClick: () =>
|
|
1149
|
-
/* @__PURE__ */ l(ee, { size: "sm", onClick:
|
|
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 })
|
|
1150
1156
|
] })
|
|
1151
1157
|
]
|
|
1152
1158
|
}
|
|
@@ -1157,14 +1163,14 @@ function br({
|
|
|
1157
1163
|
registry: t,
|
|
1158
1164
|
hook: n
|
|
1159
1165
|
}) {
|
|
1160
|
-
const o = U(), [r, s] =
|
|
1161
|
-
return /* @__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: [
|
|
1162
1168
|
/* @__PURE__ */ l(
|
|
1163
1169
|
"button",
|
|
1164
1170
|
{
|
|
1165
1171
|
ref: i,
|
|
1166
1172
|
type: "button",
|
|
1167
|
-
className:
|
|
1173
|
+
className: G(f.filterButton, h && f.filterActive),
|
|
1168
1174
|
"aria-label": o.filterColumn(u),
|
|
1169
1175
|
"aria-haspopup": "dialog",
|
|
1170
1176
|
"aria-expanded": r,
|
|
@@ -1184,7 +1190,7 @@ function br({
|
|
|
1184
1190
|
}
|
|
1185
1191
|
),
|
|
1186
1192
|
/* @__PURE__ */ l(
|
|
1187
|
-
|
|
1193
|
+
Pt,
|
|
1188
1194
|
{
|
|
1189
1195
|
entry: e,
|
|
1190
1196
|
registry: t,
|
|
@@ -1204,7 +1210,7 @@ function kr({ registry: e, hook: t }) {
|
|
|
1204
1210
|
const u = { formats: o, wording: n, format: a.spec.format, kind: e.kindOf(a, t.rows) };
|
|
1205
1211
|
return [{ entry: a, text: nr(c, i, u) }];
|
|
1206
1212
|
});
|
|
1207
|
-
return r.length === 0 ? null : /* @__PURE__ */ l(Nt, { "aria-label": n.conditions, className:
|
|
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)) });
|
|
1208
1214
|
}
|
|
1209
1215
|
function vr({
|
|
1210
1216
|
entry: e,
|
|
@@ -1212,36 +1218,36 @@ function vr({
|
|
|
1212
1218
|
registry: n,
|
|
1213
1219
|
hook: o
|
|
1214
1220
|
}) {
|
|
1215
|
-
const r = U(), [s, i] =
|
|
1216
|
-
return /* @__PURE__ */
|
|
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: [
|
|
1217
1223
|
/* @__PURE__ */ l(
|
|
1218
1224
|
xt,
|
|
1219
1225
|
{
|
|
1220
1226
|
ref: a,
|
|
1221
|
-
className:
|
|
1227
|
+
className: f.condition,
|
|
1222
1228
|
onRemove: () => o.publicSnapshot.setFilter(h, null),
|
|
1223
|
-
removeLabel: r.removeConditionNamed(
|
|
1224
|
-
children: /* @__PURE__ */
|
|
1229
|
+
removeLabel: r.removeConditionNamed(d, t),
|
|
1230
|
+
children: /* @__PURE__ */ O(
|
|
1225
1231
|
"button",
|
|
1226
1232
|
{
|
|
1227
1233
|
ref: c,
|
|
1228
1234
|
type: "button",
|
|
1229
|
-
className:
|
|
1230
|
-
"aria-label": r.editConditionNamed(
|
|
1235
|
+
className: f.conditionButton,
|
|
1236
|
+
"aria-label": r.editConditionNamed(d, t),
|
|
1231
1237
|
"aria-haspopup": "dialog",
|
|
1232
1238
|
"aria-expanded": s,
|
|
1233
1239
|
"aria-controls": s ? u : void 0,
|
|
1234
1240
|
onClick: () => i(!s),
|
|
1235
1241
|
children: [
|
|
1236
|
-
/* @__PURE__ */ l("span", { className:
|
|
1237
|
-
/* @__PURE__ */ l("span", { className:
|
|
1242
|
+
/* @__PURE__ */ l("span", { className: f.filterLabel, children: d }),
|
|
1243
|
+
/* @__PURE__ */ l("span", { className: f.filterValue, children: t })
|
|
1238
1244
|
]
|
|
1239
1245
|
}
|
|
1240
1246
|
)
|
|
1241
1247
|
}
|
|
1242
1248
|
),
|
|
1243
1249
|
/* @__PURE__ */ l(
|
|
1244
|
-
|
|
1250
|
+
Pt,
|
|
1245
1251
|
{
|
|
1246
1252
|
entry: e,
|
|
1247
1253
|
registry: n,
|
|
@@ -1256,16 +1262,16 @@ function vr({
|
|
|
1256
1262
|
] });
|
|
1257
1263
|
}
|
|
1258
1264
|
const ft = ";", _r = `\r
|
|
1259
|
-
`, yr = "\uFEFF", Cr = (e) => String(e).replace(".", ","),
|
|
1265
|
+
`, yr = "\uFEFF", Cr = (e) => String(e).replace(".", ","), Gt = (e) => /[";\r\n]/.test(e) ? `"${e.replace(/"/g, '""')}"` : e, Sr = (e, t) => {
|
|
1260
1266
|
var o;
|
|
1261
1267
|
const n = (o = t.value) == null ? void 0 : o.call(t, e);
|
|
1262
|
-
return n == null ? "" :
|
|
1268
|
+
return n == null ? "" : Gt(typeof n == "number" ? Cr(n) : String(n));
|
|
1263
1269
|
};
|
|
1264
1270
|
function Nr(e, t) {
|
|
1265
|
-
const n = t.map((r) =>
|
|
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));
|
|
1266
1272
|
return yr + [n, ...o].join(_r);
|
|
1267
1273
|
}
|
|
1268
|
-
function
|
|
1274
|
+
function Et(e) {
|
|
1269
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);
|
|
1270
1276
|
return e.withStickyHeaderFirst(n.map((o) => ({ id: o.spec.id, e: o }))).map(({ e: o }) => o);
|
|
1271
1277
|
}
|
|
@@ -1276,7 +1282,7 @@ function zt(e) {
|
|
|
1276
1282
|
function xr(e) {
|
|
1277
1283
|
const t = e.hook;
|
|
1278
1284
|
if (!t) return "";
|
|
1279
|
-
const n =
|
|
1285
|
+
const n = Et(e).filter((o) => e.kindOf(o, t.rows) !== "other" || o.spec.ownExportValue).map(
|
|
1280
1286
|
(o) => ({
|
|
1281
1287
|
id: o.spec.id,
|
|
1282
1288
|
label: o.spec.label,
|
|
@@ -1293,21 +1299,21 @@ function Tr({ registry: e, hook: t }) {
|
|
|
1293
1299
|
const n = U(), o = e.groupingEntries(t.rows);
|
|
1294
1300
|
if (o.length === 0) return null;
|
|
1295
1301
|
const { grouping: r, setGrouping: s } = t.publicSnapshot;
|
|
1296
|
-
return /* @__PURE__ */
|
|
1297
|
-
/* @__PURE__ */ l("h3", { className:
|
|
1298
|
-
/* @__PURE__ */ l("div", { className:
|
|
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) => {
|
|
1299
1305
|
const { id: a, label: c } = i.spec, u = r.indexOf(a), h = u !== -1;
|
|
1300
|
-
return /* @__PURE__ */
|
|
1306
|
+
return /* @__PURE__ */ O(
|
|
1301
1307
|
"button",
|
|
1302
1308
|
{
|
|
1303
1309
|
type: "button",
|
|
1304
|
-
className:
|
|
1310
|
+
className: f.groupingOption,
|
|
1305
1311
|
"aria-label": n.groupBy(c),
|
|
1306
1312
|
"aria-pressed": h,
|
|
1307
1313
|
disabled: !h && r.length >= Qe,
|
|
1308
|
-
onClick: () => s(h ? r.filter((
|
|
1314
|
+
onClick: () => s(h ? r.filter((d) => d !== a) : [...r, a]),
|
|
1309
1315
|
children: [
|
|
1310
|
-
h && /* @__PURE__ */ l("span", { className:
|
|
1316
|
+
h && /* @__PURE__ */ l("span", { className: f.groupingLevel, "aria-hidden": "true", children: u + 1 }),
|
|
1311
1317
|
c
|
|
1312
1318
|
]
|
|
1313
1319
|
},
|
|
@@ -1323,13 +1329,13 @@ function Fr({ registry: e, hook: t }) {
|
|
|
1323
1329
|
return (
|
|
1324
1330
|
/* In a tag group, as the conditions stand: the tag is one stop, its button
|
|
1325
1331
|
the thing one tabs to, and the ring stands on the tag. */
|
|
1326
|
-
/* @__PURE__ */ l(Nt, { "aria-label": n.groupedBy, className:
|
|
1332
|
+
/* @__PURE__ */ l(Nt, { "aria-label": n.groupedBy, className: f.groupingTag, children: /* @__PURE__ */ l(xt, { onRemove: () => o.setGrouping([]), removeLabel: n.removeGrouping, children: /* @__PURE__ */ O(
|
|
1327
1333
|
At,
|
|
1328
1334
|
{
|
|
1329
|
-
trigger: /* @__PURE__ */
|
|
1330
|
-
/* @__PURE__ */ l("span", { className:
|
|
1331
|
-
s.map((i, a) => /* @__PURE__ */
|
|
1332
|
-
a > 0 && /* @__PURE__ */ l("span", { className:
|
|
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: "›" }),
|
|
1333
1339
|
i
|
|
1334
1340
|
] }, r[a]))
|
|
1335
1341
|
] }),
|
|
@@ -1352,30 +1358,30 @@ function jt({
|
|
|
1352
1358
|
const r = U(), s = ue(), i = (e == null ? void 0 : e.hook) ?? null;
|
|
1353
1359
|
let a = null, c = null;
|
|
1354
1360
|
if (e && i) {
|
|
1355
|
-
const u = i.publicSnapshot, h = u.search !== "" || Object.keys(u.filter).length > 0,
|
|
1356
|
-
a = /* @__PURE__ */
|
|
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: [
|
|
1357
1363
|
/* @__PURE__ */ l(Fr, { registry: e, hook: i }),
|
|
1358
1364
|
/* @__PURE__ */ l(kr, { registry: e, hook: i })
|
|
1359
|
-
] }), c = /* @__PURE__ */
|
|
1360
|
-
/* @__PURE__ */ l("span", { role: "status", className:
|
|
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)) : "" }),
|
|
1361
1367
|
h && /* @__PURE__ */ l(ee, { size: "sm", variant: "ghost", onClick: () => zt(u), children: r.resetAll }),
|
|
1362
|
-
|
|
1363
|
-
/* @__PURE__ */ l("span", { className:
|
|
1364
|
-
|
|
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(
|
|
1365
1371
|
ee,
|
|
1366
1372
|
{
|
|
1367
1373
|
size: "sm",
|
|
1368
1374
|
variant: k.tone === "danger" ? "danger" : "secondary",
|
|
1369
|
-
onClick: () => k.onSelect(
|
|
1375
|
+
onClick: () => k.onSelect(d),
|
|
1370
1376
|
children: k.label
|
|
1371
1377
|
},
|
|
1372
|
-
|
|
1378
|
+
w
|
|
1373
1379
|
))
|
|
1374
1380
|
] })
|
|
1375
1381
|
] });
|
|
1376
1382
|
}
|
|
1377
|
-
return /* @__PURE__ */
|
|
1378
|
-
/* @__PURE__ */
|
|
1383
|
+
return /* @__PURE__ */ O("div", { className: G(f.toolbar, t), children: [
|
|
1384
|
+
/* @__PURE__ */ O("div", { className: f.toolbarGroup, children: [
|
|
1379
1385
|
n,
|
|
1380
1386
|
a
|
|
1381
1387
|
] }),
|
|
@@ -1396,8 +1402,8 @@ function xe(e) {
|
|
|
1396
1402
|
return !n || !o ? null : { registry: n, snapshot: o, inside: !e && t !== null, footerTarget: e ? null : (t == null ? void 0 : t.footerTarget) ?? null };
|
|
1397
1403
|
}
|
|
1398
1404
|
function Ht({ wording: e }) {
|
|
1399
|
-
return /* @__PURE__ */
|
|
1400
|
-
/* @__PURE__ */ l("span", { "aria-hidden": "true", className:
|
|
1405
|
+
return /* @__PURE__ */ O(Q, { children: [
|
|
1406
|
+
/* @__PURE__ */ l("span", { "aria-hidden": "true", className: f.absent, children: "—" }),
|
|
1401
1407
|
/* @__PURE__ */ l(Re, { children: e.cellAbsentValue })
|
|
1402
1408
|
] });
|
|
1403
1409
|
}
|
|
@@ -1419,25 +1425,25 @@ function Ke({
|
|
|
1419
1425
|
}) {
|
|
1420
1426
|
const { aggregate: s, format: i, presentation: a } = e.spec;
|
|
1421
1427
|
if (!s) return null;
|
|
1422
|
-
const c = typeof s == "function" ? "own" : s, u =
|
|
1423
|
-
let
|
|
1424
|
-
if (Y(u))
|
|
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 });
|
|
1425
1431
|
else if (c === "range" && i === "date" && Mr(u)) {
|
|
1426
|
-
const [
|
|
1427
|
-
|
|
1428
|
-
} else if (c === "count" || c === "distinct")
|
|
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);
|
|
1429
1435
|
else if (c === "range") {
|
|
1430
|
-
const [
|
|
1431
|
-
|
|
1432
|
-
} else c === "own" && a ?
|
|
1433
|
-
const
|
|
1434
|
-
return /* @__PURE__ */
|
|
1435
|
-
r &&
|
|
1436
|
-
r && /* @__PURE__ */
|
|
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: [
|
|
1437
1443
|
Rr(c, o),
|
|
1438
1444
|
" "
|
|
1439
1445
|
] }),
|
|
1440
|
-
|
|
1446
|
+
d
|
|
1441
1447
|
] });
|
|
1442
1448
|
}
|
|
1443
1449
|
const Mr = ([e, t]) => e instanceof Date && t instanceof Date && e.getFullYear() === t.getFullYear();
|
|
@@ -1464,8 +1470,8 @@ const Dr = (e) => {
|
|
|
1464
1470
|
return t;
|
|
1465
1471
|
};
|
|
1466
1472
|
function Ir(e, t) {
|
|
1467
|
-
const n =
|
|
1468
|
-
|
|
1473
|
+
const n = re(null);
|
|
1474
|
+
W(() => {
|
|
1469
1475
|
const o = e.current;
|
|
1470
1476
|
if (!o) return;
|
|
1471
1477
|
const r = Dr(o), s = n.current;
|
|
@@ -1474,22 +1480,22 @@ function Ir(e, t) {
|
|
|
1474
1480
|
if (i === 0 || typeof o.animate != "function") return;
|
|
1475
1481
|
const a = getComputedStyle(o).getPropertyValue("--u-ease-out").trim() || "ease-out", c = Vr(s.positions, r);
|
|
1476
1482
|
for (const u of Array.from(o.querySelectorAll("tbody > tr[data-motion]"))) {
|
|
1477
|
-
const h = u.dataset.motion,
|
|
1478
|
-
|
|
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 });
|
|
1479
1485
|
}
|
|
1480
1486
|
});
|
|
1481
1487
|
}
|
|
1482
|
-
function
|
|
1483
|
-
const o =
|
|
1484
|
-
|
|
1488
|
+
function Br(e, t, n) {
|
|
1489
|
+
const o = re(t);
|
|
1490
|
+
W(() => {
|
|
1485
1491
|
const r = e.current, s = o.current;
|
|
1486
1492
|
if (o.current = t, !r || s === t || typeof r.animate != "function") return;
|
|
1487
1493
|
const i = Kt(r, "--u-duration-medium");
|
|
1488
1494
|
if (i === 0) return;
|
|
1489
1495
|
const a = performance.now();
|
|
1490
1496
|
let c = requestAnimationFrame(function u(h) {
|
|
1491
|
-
const
|
|
1492
|
-
r.textContent = n(Math.round(s + (t - s) *
|
|
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));
|
|
1493
1499
|
});
|
|
1494
1500
|
return () => {
|
|
1495
1501
|
cancelAnimationFrame(c), r.textContent = n(t);
|
|
@@ -1505,62 +1511,54 @@ function Ve(e, t, n, o) {
|
|
|
1505
1511
|
}
|
|
1506
1512
|
function We({ entry: e, group: t, formats: n, wording: o }) {
|
|
1507
1513
|
const r = e == null ? void 0 : e.spec;
|
|
1508
|
-
return t.value !== void 0 && (r != null && r.presentation) && !r.ownGroupValue && !r.group ? /* @__PURE__ */ l(
|
|
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) });
|
|
1509
1515
|
}
|
|
1510
1516
|
function qe({
|
|
1511
1517
|
group: e,
|
|
1512
1518
|
parent: t,
|
|
1513
1519
|
entry: n,
|
|
1514
1520
|
open: o,
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
wording: a
|
|
1521
|
+
hook: r,
|
|
1522
|
+
formats: s,
|
|
1523
|
+
wording: i
|
|
1519
1524
|
}) {
|
|
1520
|
-
const c =
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
});
|
|
1524
|
-
const u = Ve(n, e.value, i, a), h = i.count(e.rows.length), f = () => {
|
|
1525
|
-
r.requestFoldFocus(e.path), s.publicSnapshot.toggleFold(e.path);
|
|
1526
|
-
}, b = (p) => {
|
|
1527
|
-
if (p.altKey && (p.key === "ArrowLeft" || p.key === "ArrowRight")) {
|
|
1528
|
-
p.preventDefault(), r.requestFoldFocus(e.path), gt(e, p.key === "ArrowLeft", s);
|
|
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);
|
|
1529
1528
|
return;
|
|
1530
1529
|
}
|
|
1531
|
-
if (
|
|
1532
|
-
|
|
1533
|
-
else if (
|
|
1534
|
-
if (
|
|
1530
|
+
if (d.key === "ArrowRight" && !o)
|
|
1531
|
+
d.preventDefault(), u();
|
|
1532
|
+
else if (d.key === "ArrowLeft") {
|
|
1533
|
+
if (d.preventDefault(), o) u();
|
|
1535
1534
|
else if (t) {
|
|
1536
|
-
const
|
|
1537
|
-
(
|
|
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
|
|
1538
1537
|
);
|
|
1539
|
-
|
|
1538
|
+
w == null || w.focus();
|
|
1540
1539
|
}
|
|
1541
1540
|
}
|
|
1542
1541
|
};
|
|
1543
1542
|
return /* @__PURE__ */ l(
|
|
1544
1543
|
"button",
|
|
1545
1544
|
{
|
|
1546
|
-
ref: c,
|
|
1547
1545
|
type: "button",
|
|
1548
|
-
className:
|
|
1546
|
+
className: G(f.fold, !o && f.foldClosed),
|
|
1549
1547
|
"data-fold-path": e.path,
|
|
1550
1548
|
"aria-expanded": o,
|
|
1551
|
-
"aria-label": o ?
|
|
1552
|
-
onKeyDown:
|
|
1553
|
-
onClick: (
|
|
1554
|
-
if (!
|
|
1555
|
-
|
|
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);
|
|
1556
1554
|
},
|
|
1557
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" }) })
|
|
1558
1556
|
}
|
|
1559
1557
|
);
|
|
1560
1558
|
}
|
|
1561
|
-
function
|
|
1562
|
-
const n =
|
|
1563
|
-
return
|
|
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) });
|
|
1564
1562
|
}
|
|
1565
1563
|
function Ye({ group: e, entry: t, hook: n, formats: o, wording: r }) {
|
|
1566
1564
|
const { selection: s } = n.publicSnapshot, i = e.rows.map(n.rowKey), a = i.filter((u) => s.isSelected(u)).length, c = a === i.length;
|
|
@@ -1585,24 +1583,23 @@ function gt(e, t, n) {
|
|
|
1585
1583
|
for (const i of r)
|
|
1586
1584
|
o.folded.includes(i.path) !== t && o.toggleFold(i.path);
|
|
1587
1585
|
}
|
|
1588
|
-
function
|
|
1586
|
+
function Gr({
|
|
1589
1587
|
line: e,
|
|
1590
1588
|
entry: t,
|
|
1591
1589
|
selectable: n,
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
wording: i
|
|
1590
|
+
hook: o,
|
|
1591
|
+
formats: r,
|
|
1592
|
+
wording: s
|
|
1596
1593
|
}) {
|
|
1597
|
-
const
|
|
1598
|
-
return /* @__PURE__ */ l("td", { className:
|
|
1599
|
-
n && /* @__PURE__ */ l("span", { className:
|
|
1600
|
-
/* @__PURE__ */ l(qe, { group:
|
|
1601
|
-
/* @__PURE__ */
|
|
1602
|
-
/* @__PURE__ */ l(We, { entry: t, group:
|
|
1603
|
-
e.continued && /* @__PURE__ */ l("span", { className:
|
|
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 })
|
|
1604
1601
|
] }),
|
|
1605
|
-
/* @__PURE__ */ l("span", { className:
|
|
1602
|
+
/* @__PURE__ */ l("span", { className: f.groupCount, children: r.count(i.rows.length) })
|
|
1606
1603
|
] }) });
|
|
1607
1604
|
}
|
|
1608
1605
|
function pt({
|
|
@@ -1617,64 +1614,64 @@ function pt({
|
|
|
1617
1614
|
hasActions: c,
|
|
1618
1615
|
total: u,
|
|
1619
1616
|
siblings: h,
|
|
1620
|
-
depth:
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
wording: m
|
|
1617
|
+
depth: d,
|
|
1618
|
+
hook: m,
|
|
1619
|
+
formats: w,
|
|
1620
|
+
wording: k
|
|
1625
1621
|
}) {
|
|
1626
|
-
const { group:
|
|
1627
|
-
/* @__PURE__ */ l(qe, { group:
|
|
1628
|
-
/* @__PURE__ */ l("span", { className:
|
|
1629
|
-
/* @__PURE__ */ l(
|
|
1630
|
-
|
|
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 })
|
|
1631
1627
|
] });
|
|
1632
|
-
return /* @__PURE__ */
|
|
1628
|
+
return /* @__PURE__ */ O(
|
|
1633
1629
|
"tr",
|
|
1634
1630
|
{
|
|
1635
|
-
className:
|
|
1631
|
+
className: G(b ? f.groupHeader : f.groupFolded, x && f.virtualRow),
|
|
1636
1632
|
"data-line": e.kind,
|
|
1637
|
-
"data-level":
|
|
1638
|
-
"data-motion": n !== void 0 || !(
|
|
1639
|
-
"data-continued":
|
|
1640
|
-
"data-group-first":
|
|
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,
|
|
1641
1638
|
"data-row": x ? n : void 0,
|
|
1642
1639
|
"aria-rowindex": x ? n + 2 : void 0,
|
|
1643
1640
|
"data-index": t,
|
|
1644
|
-
style:
|
|
1645
|
-
"aria-level":
|
|
1646
|
-
"aria-expanded":
|
|
1647
|
-
"aria-posinset": h.indexOf(
|
|
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,
|
|
1648
1645
|
"aria-setsize": h.length || void 0,
|
|
1649
1646
|
children: [
|
|
1650
|
-
Array.from({ length: i }, (
|
|
1651
|
-
|
|
1652
|
-
/* @__PURE__ */ l("td", { className:
|
|
1653
|
-
a && /* @__PURE__ */ l("span", { className:
|
|
1654
|
-
/* @__PURE__ */ l(qe, { group:
|
|
1655
|
-
/* @__PURE__ */ l("span", { className:
|
|
1656
|
-
/* @__PURE__ */ l("span", { className:
|
|
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) })
|
|
1657
1654
|
] }) }),
|
|
1658
|
-
C > 0 && /* @__PURE__ */ l("td", { className:
|
|
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)) })
|
|
1659
1656
|
] }),
|
|
1660
|
-
|
|
1661
|
-
|
|
1657
|
+
S.map((v) => /* @__PURE__ */ l(
|
|
1658
|
+
Er,
|
|
1662
1659
|
{
|
|
1663
|
-
entry:
|
|
1664
|
-
group:
|
|
1665
|
-
share:
|
|
1660
|
+
entry: v,
|
|
1661
|
+
group: p,
|
|
1662
|
+
share: b && v === I,
|
|
1666
1663
|
total: u,
|
|
1667
|
-
formats:
|
|
1668
|
-
wording:
|
|
1664
|
+
formats: w,
|
|
1665
|
+
wording: k
|
|
1669
1666
|
},
|
|
1670
|
-
|
|
1667
|
+
v.key
|
|
1671
1668
|
)),
|
|
1672
|
-
c && /* @__PURE__ */ l("td", { className:
|
|
1669
|
+
c && /* @__PURE__ */ l("td", { className: f.td })
|
|
1673
1670
|
]
|
|
1674
1671
|
}
|
|
1675
1672
|
);
|
|
1676
1673
|
}
|
|
1677
|
-
function
|
|
1674
|
+
function Er({
|
|
1678
1675
|
entry: e,
|
|
1679
1676
|
group: t,
|
|
1680
1677
|
share: n,
|
|
@@ -1683,16 +1680,16 @@ function Br({
|
|
|
1683
1680
|
wording: s
|
|
1684
1681
|
}) {
|
|
1685
1682
|
const { spec: i } = e;
|
|
1686
|
-
if (!i.aggregate) return /* @__PURE__ */ l("td", { className:
|
|
1683
|
+
if (!i.aggregate) return /* @__PURE__ */ l("td", { className: f.td });
|
|
1687
1684
|
let a = null;
|
|
1688
1685
|
if (n && i.aggregate === "sum" && i.share !== !1) {
|
|
1689
|
-
const c =
|
|
1686
|
+
const c = Xe({ id: i.id, read: e.read, aggregate: "sum" }, o), u = t.aggregates[i.id];
|
|
1690
1687
|
if (typeof c == "number" && c > 0 && typeof u == "number" && u > 0) {
|
|
1691
1688
|
const h = Math.min(1, u / c);
|
|
1692
|
-
a = /* @__PURE__ */ l("span", { className:
|
|
1689
|
+
a = /* @__PURE__ */ l("span", { className: f.shareBar, style: { width: `${Math.max(2, Math.round(h * 64))}px` }, "aria-hidden": "true" });
|
|
1693
1690
|
}
|
|
1694
1691
|
}
|
|
1695
|
-
return /* @__PURE__ */ l("td", { className:
|
|
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: [
|
|
1696
1693
|
/* @__PURE__ */ l(Ke, { entry: e, rows: t.rows, formats: r, wording: s }),
|
|
1697
1694
|
a
|
|
1698
1695
|
] }) : /* @__PURE__ */ l(Ke, { entry: e, rows: t.rows, formats: r, wording: s }) });
|
|
@@ -1730,40 +1727,40 @@ function jr(e, t, n, o, r) {
|
|
|
1730
1727
|
const Oe = 34;
|
|
1731
1728
|
function Hr(e) {
|
|
1732
1729
|
function t(c) {
|
|
1733
|
-
const u = se(), h = Ue($e),
|
|
1734
|
-
return e.registerColumn(u,
|
|
1730
|
+
const u = se(), h = Ue($e), d = zr(c);
|
|
1731
|
+
return e.registerColumn(u, d), W(
|
|
1735
1732
|
() => () => {
|
|
1736
1733
|
e.removeColumn(u), e.commit();
|
|
1737
1734
|
},
|
|
1738
1735
|
[u]
|
|
1739
|
-
),
|
|
1740
|
-
e.ensureColumn(u,
|
|
1736
|
+
), W(() => {
|
|
1737
|
+
e.ensureColumn(u, d), e.checkOrder(), e.commit();
|
|
1741
1738
|
}), Mt && h && h.registry !== e && pe(
|
|
1742
|
-
`foreign:${
|
|
1743
|
-
`The column "${
|
|
1739
|
+
`foreign:${d.id}`,
|
|
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.`
|
|
1744
1741
|
), /* @__PURE__ */ l("span", { hidden: !0, "data-umriss-column": u });
|
|
1745
1742
|
}
|
|
1746
1743
|
function n({ children: c }) {
|
|
1747
1744
|
const u = se();
|
|
1748
|
-
return e.registerDetail(u, c),
|
|
1745
|
+
return e.registerDetail(u, c), W(
|
|
1749
1746
|
() => () => {
|
|
1750
1747
|
e.removeDetail(u), e.commit();
|
|
1751
1748
|
},
|
|
1752
1749
|
[u]
|
|
1753
|
-
),
|
|
1750
|
+
), W(() => {
|
|
1754
1751
|
e.detail || e.registerDetail(u, c), e.commit();
|
|
1755
1752
|
}), null;
|
|
1756
1753
|
}
|
|
1757
1754
|
function o({ children: c }) {
|
|
1758
1755
|
const u = se();
|
|
1759
|
-
return e.registerActionGroup(u),
|
|
1756
|
+
return e.registerActionGroup(u), W(
|
|
1760
1757
|
() => () => {
|
|
1761
1758
|
e.removeActionGroup(u), e.commit();
|
|
1762
1759
|
},
|
|
1763
1760
|
[u]
|
|
1764
|
-
),
|
|
1761
|
+
), W(() => {
|
|
1765
1762
|
e.registerActionGroup(u), e.commit();
|
|
1766
|
-
}), /* @__PURE__ */ l(
|
|
1763
|
+
}), /* @__PURE__ */ l(Q, { children: c });
|
|
1767
1764
|
}
|
|
1768
1765
|
function r(c) {
|
|
1769
1766
|
const u = se(), h = {
|
|
@@ -1772,17 +1769,17 @@ function Hr(e) {
|
|
|
1772
1769
|
tone: c.tone ?? "default",
|
|
1773
1770
|
onSelect: c.onSelect
|
|
1774
1771
|
};
|
|
1775
|
-
return e.registerAction(u, h),
|
|
1772
|
+
return e.registerAction(u, h), W(
|
|
1776
1773
|
() => () => {
|
|
1777
1774
|
e.removeAction(u), e.commit();
|
|
1778
1775
|
},
|
|
1779
1776
|
[u]
|
|
1780
|
-
),
|
|
1777
|
+
), W(() => {
|
|
1781
1778
|
e.ensureAction(u, h), e.checkOrder(), e.commit();
|
|
1782
1779
|
}), /* @__PURE__ */ l("span", { hidden: !0, "data-umriss-action": u });
|
|
1783
1780
|
}
|
|
1784
1781
|
function s(c) {
|
|
1785
|
-
const u = se(), h = typeof c.value == "string" ? c.value : void 0,
|
|
1782
|
+
const u = se(), h = typeof c.value == "string" ? c.value : void 0, m = {
|
|
1786
1783
|
id: c.id ?? h ?? c.label,
|
|
1787
1784
|
label: c.label,
|
|
1788
1785
|
value: c.value,
|
|
@@ -1792,27 +1789,27 @@ function Hr(e) {
|
|
|
1792
1789
|
group: c.group,
|
|
1793
1790
|
groupable: !0
|
|
1794
1791
|
};
|
|
1795
|
-
return e.registerGroupKey(u,
|
|
1792
|
+
return e.registerGroupKey(u, m), W(
|
|
1796
1793
|
() => () => {
|
|
1797
1794
|
e.removeGroupKey(u), e.commit();
|
|
1798
1795
|
},
|
|
1799
1796
|
[u]
|
|
1800
|
-
),
|
|
1801
|
-
e.ensureGroupKey(u,
|
|
1797
|
+
), W(() => {
|
|
1798
|
+
e.ensureGroupKey(u, m), e.checkOrder(), e.commit();
|
|
1802
1799
|
}), /* @__PURE__ */ l("span", { hidden: !0, "data-umriss-groupkey": u });
|
|
1803
1800
|
}
|
|
1804
1801
|
function i(c) {
|
|
1805
1802
|
e.beginPass(), e.setStickyRowHeader(c.stickyRowHeader === !0), e.setTableGroupable(c.groupable !== !1);
|
|
1806
|
-
const u =
|
|
1807
|
-
|
|
1803
|
+
const u = re(null), [h, d] = H(null);
|
|
1804
|
+
W(() => {
|
|
1808
1805
|
e.children = u.current, e.checkOrder(), e.commit();
|
|
1809
1806
|
});
|
|
1810
|
-
const
|
|
1811
|
-
return /* @__PURE__ */ l($e.Provider, { value:
|
|
1812
|
-
/* @__PURE__ */ l("div", { ref: u, className:
|
|
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 }),
|
|
1813
1810
|
/* @__PURE__ */ l($r, { registry: e }),
|
|
1814
1811
|
/* @__PURE__ */ l(Kr, { registry: e, props: c }),
|
|
1815
|
-
/* @__PURE__ */ l("div", { ref:
|
|
1812
|
+
/* @__PURE__ */ l("div", { ref: d, className: f.footerTarget })
|
|
1816
1813
|
] }) });
|
|
1817
1814
|
}
|
|
1818
1815
|
const a = { Table: i, Column: t, RowDetail: n, RowActions: o, Action: r, GroupBy: s };
|
|
@@ -1832,199 +1829,205 @@ function Kr({ registry: e, props: t }) {
|
|
|
1832
1829
|
empty: c,
|
|
1833
1830
|
loading: u = !1,
|
|
1834
1831
|
rowProps: h,
|
|
1835
|
-
ariaLabel:
|
|
1832
|
+
ariaLabel: d
|
|
1836
1833
|
} = t;
|
|
1837
1834
|
Le(e.subscribe, e.bodyVersion, e.bodyVersion);
|
|
1838
|
-
const
|
|
1839
|
-
|
|
1840
|
-
var
|
|
1841
|
-
const y =
|
|
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;
|
|
1842
1839
|
if (!y || !o) return;
|
|
1843
|
-
const R = ((
|
|
1844
|
-
y.style.setProperty("--u-table-head", `${R}px`), y.style.setProperty("--u-table-group-header", `${
|
|
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
|
+
}
|
|
1845
1850
|
});
|
|
1846
1851
|
const g = e.hook && !e.hook.companion.virtual ? e.hook.publicSnapshot : null;
|
|
1847
|
-
Ir(
|
|
1848
|
-
const
|
|
1849
|
-
if (!
|
|
1850
|
-
const
|
|
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(
|
|
1851
1856
|
Wr,
|
|
1852
1857
|
{
|
|
1853
1858
|
row: y,
|
|
1854
1859
|
index: R,
|
|
1855
|
-
absolute:
|
|
1860
|
+
absolute: F ? K : void 0,
|
|
1856
1861
|
registry: e,
|
|
1857
|
-
hook:
|
|
1858
|
-
columns:
|
|
1859
|
-
line:
|
|
1860
|
-
spanEntry:
|
|
1861
|
-
header:
|
|
1862
|
+
hook: _,
|
|
1863
|
+
columns: q,
|
|
1864
|
+
line: j,
|
|
1865
|
+
spanEntry: P,
|
|
1866
|
+
header: I,
|
|
1862
1867
|
selectable: n,
|
|
1863
|
-
actions:
|
|
1868
|
+
actions: v,
|
|
1864
1869
|
stickyRowHeader: r,
|
|
1865
1870
|
rowHeaderLeft: de,
|
|
1866
1871
|
columnCount: ae,
|
|
1867
1872
|
rowProps: h,
|
|
1868
|
-
baseId:
|
|
1869
|
-
formats:
|
|
1870
|
-
wording:
|
|
1873
|
+
baseId: p,
|
|
1874
|
+
formats: w,
|
|
1875
|
+
wording: m
|
|
1871
1876
|
},
|
|
1872
|
-
|
|
1877
|
+
_.rowKey(y)
|
|
1873
1878
|
);
|
|
1874
1879
|
let te;
|
|
1875
1880
|
if (u)
|
|
1876
|
-
te = /* @__PURE__ */ l("tbody", { children: /* @__PURE__ */ l(
|
|
1877
|
-
else if (
|
|
1878
|
-
te = /* @__PURE__ */ l("tbody", { children: /* @__PURE__ */ l("tr", { children: /* @__PURE__ */ l("td", { colSpan: ae, className:
|
|
1879
|
-
/* @__PURE__ */ l("p", { className:
|
|
1880
|
-
/* @__PURE__ */ l(ee, { size: "sm", variant: "ghost", onClick: () => zt(
|
|
1881
|
-
] }) : c ?? /* @__PURE__ */ l("p", { className:
|
|
1882
|
-
else if (
|
|
1883
|
-
const y =
|
|
1884
|
-
var
|
|
1885
|
-
const
|
|
1886
|
-
return
|
|
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(
|
|
1887
1892
|
pt,
|
|
1888
1893
|
{
|
|
1889
1894
|
line: M,
|
|
1890
|
-
index:
|
|
1895
|
+
index: J,
|
|
1891
1896
|
absolute: void 0,
|
|
1892
|
-
spanEntry:
|
|
1893
|
-
levelEntry:
|
|
1894
|
-
columns:
|
|
1897
|
+
spanEntry: P,
|
|
1898
|
+
levelEntry: z(L[M.group.level]),
|
|
1899
|
+
columns: q,
|
|
1895
1900
|
controlColumns: ie,
|
|
1896
1901
|
selectable: n,
|
|
1897
|
-
hasActions:
|
|
1898
|
-
total:
|
|
1899
|
-
siblings: ((
|
|
1900
|
-
depth:
|
|
1901
|
-
|
|
1902
|
-
|
|
1903
|
-
|
|
1904
|
-
wording: b
|
|
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
|
|
1905
1909
|
},
|
|
1906
1910
|
`${M.kind}:${M.group.path}:repeated`
|
|
1907
|
-
) : M.kind === "row" ? le(M.row,
|
|
1911
|
+
) : M.kind === "row" ? le(M.row, Z, T, M) : /* @__PURE__ */ l(
|
|
1908
1912
|
pt,
|
|
1909
1913
|
{
|
|
1910
1914
|
line: M,
|
|
1911
|
-
index:
|
|
1912
|
-
absolute:
|
|
1913
|
-
spanEntry:
|
|
1914
|
-
levelEntry:
|
|
1915
|
-
columns:
|
|
1915
|
+
index: Z,
|
|
1916
|
+
absolute: F ? T : void 0,
|
|
1917
|
+
spanEntry: P,
|
|
1918
|
+
levelEntry: z(L[M.group.level]),
|
|
1919
|
+
columns: q,
|
|
1916
1920
|
controlColumns: ie,
|
|
1917
1921
|
selectable: n,
|
|
1918
|
-
hasActions:
|
|
1919
|
-
total:
|
|
1920
|
-
siblings: ((
|
|
1921
|
-
depth:
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
|
|
1925
|
-
wording: b
|
|
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
|
|
1926
1929
|
},
|
|
1927
1930
|
`${M.kind}:${M.group.path}${M.kind === "header" && M.continued ? ":continued" : ""}`
|
|
1928
1931
|
);
|
|
1929
1932
|
};
|
|
1930
|
-
te =
|
|
1933
|
+
te = F ? /* @__PURE__ */ l(
|
|
1931
1934
|
kt,
|
|
1932
1935
|
{
|
|
1933
|
-
virtual: { ...
|
|
1936
|
+
virtual: { ...F, fillerBefore: Math.max(0, F.fillerBefore - R * K) },
|
|
1934
1937
|
colSpan: ae,
|
|
1935
|
-
children: y.map(
|
|
1938
|
+
children: y.map(j)
|
|
1936
1939
|
}
|
|
1937
|
-
) : /* @__PURE__ */ l("tbody", { children:
|
|
1938
|
-
} else
|
|
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)) });
|
|
1939
1942
|
return /* @__PURE__ */ l(
|
|
1940
1943
|
"div",
|
|
1941
1944
|
{
|
|
1942
|
-
ref:
|
|
1945
|
+
ref: F == null ? void 0 : F.scrollRef,
|
|
1943
1946
|
onScroll: (y) => {
|
|
1944
|
-
|
|
1947
|
+
F == null || F.onScroll(), N && o && mt(y.currentTarget);
|
|
1945
1948
|
},
|
|
1946
|
-
className:
|
|
1949
|
+
className: f.scroll,
|
|
1947
1950
|
style: a ? { maxHeight: a } : void 0,
|
|
1948
|
-
children: /* @__PURE__ */
|
|
1951
|
+
children: /* @__PURE__ */ O(
|
|
1949
1952
|
"table",
|
|
1950
1953
|
{
|
|
1951
|
-
ref:
|
|
1952
|
-
role:
|
|
1953
|
-
"data-depth":
|
|
1954
|
-
style:
|
|
1955
|
-
"aria-label":
|
|
1956
|
-
"aria-rowcount":
|
|
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,
|
|
1957
1960
|
"aria-busy": u || void 0,
|
|
1958
|
-
className:
|
|
1959
|
-
|
|
1960
|
-
k === "compact" &&
|
|
1961
|
-
o &&
|
|
1962
|
-
s &&
|
|
1961
|
+
className: G(
|
|
1962
|
+
f.table,
|
|
1963
|
+
k === "compact" && f.compact,
|
|
1964
|
+
o && f.sticky,
|
|
1965
|
+
s && f.striped
|
|
1963
1966
|
),
|
|
1964
1967
|
children: [
|
|
1965
|
-
/* @__PURE__ */ l("thead", { children: /* @__PURE__ */
|
|
1968
|
+
/* @__PURE__ */ l("thead", { children: /* @__PURE__ */ O("tr", { "aria-rowindex": F ? 1 : void 0, children: [
|
|
1966
1969
|
n && /* @__PURE__ */ l(
|
|
1967
1970
|
"th",
|
|
1968
1971
|
{
|
|
1969
1972
|
scope: "col",
|
|
1970
|
-
className:
|
|
1973
|
+
className: G(f.th, f.control, r && f.stickyCell),
|
|
1971
1974
|
style: r ? { left: 0 } : void 0,
|
|
1972
1975
|
children: /* @__PURE__ */ l(
|
|
1973
1976
|
Se,
|
|
1974
1977
|
{
|
|
1975
|
-
"aria-label":
|
|
1976
|
-
checked:
|
|
1977
|
-
indeterminate:
|
|
1978
|
-
onChange:
|
|
1978
|
+
"aria-label": m.selectAllRows,
|
|
1979
|
+
checked: C.selection.allSelected,
|
|
1980
|
+
indeterminate: C.selection.someSelected,
|
|
1981
|
+
onChange: C.selection.toggleAll
|
|
1979
1982
|
}
|
|
1980
1983
|
)
|
|
1981
1984
|
}
|
|
1982
1985
|
),
|
|
1983
|
-
|
|
1986
|
+
A && /* @__PURE__ */ l(
|
|
1984
1987
|
"td",
|
|
1985
1988
|
{
|
|
1986
|
-
className:
|
|
1989
|
+
className: G(f.th, f.control, r && f.stickyCell),
|
|
1987
1990
|
style: r ? { left: (n ? 1 : 0) * Oe } : void 0
|
|
1988
1991
|
}
|
|
1989
1992
|
),
|
|
1990
|
-
|
|
1991
|
-
|
|
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(
|
|
1992
1995
|
wt,
|
|
1993
1996
|
{
|
|
1994
1997
|
entry: y,
|
|
1995
1998
|
registry: e,
|
|
1996
|
-
hook:
|
|
1999
|
+
hook: _,
|
|
1997
2000
|
sticky: fe(y),
|
|
1998
2001
|
left: de
|
|
1999
2002
|
},
|
|
2000
2003
|
y.key
|
|
2001
2004
|
)),
|
|
2002
|
-
|
|
2005
|
+
v.length > 0 && /* @__PURE__ */ l("th", { scope: "col", className: G(f.th, f.actionsCell), children: /* @__PURE__ */ l(Re, { children: m.rowActions }) })
|
|
2003
2006
|
] }) }),
|
|
2004
2007
|
te,
|
|
2005
|
-
be && /* @__PURE__ */ l("tfoot", { children: /* @__PURE__ */
|
|
2008
|
+
be && /* @__PURE__ */ l("tfoot", { children: /* @__PURE__ */ O("tr", { "aria-rowindex": F ? (S.lines ?? S.filtered).length + 2 : void 0, children: [
|
|
2006
2009
|
Array.from({ length: ie }, (y, R) => /* @__PURE__ */ l(
|
|
2007
2010
|
"td",
|
|
2008
2011
|
{
|
|
2009
|
-
className:
|
|
2012
|
+
className: G(f.td, f.control, r && f.stickyCell),
|
|
2010
2013
|
style: r ? { left: R * Oe } : void 0
|
|
2011
2014
|
},
|
|
2012
2015
|
R
|
|
2013
2016
|
)),
|
|
2014
|
-
|
|
2015
|
-
|
|
2017
|
+
P && /* @__PURE__ */ l("td", { className: f.td }),
|
|
2018
|
+
q.map((y) => /* @__PURE__ */ l(
|
|
2016
2019
|
Yr,
|
|
2017
2020
|
{
|
|
2018
2021
|
entry: y,
|
|
2019
|
-
rows:
|
|
2020
|
-
formats:
|
|
2021
|
-
wording:
|
|
2022
|
+
rows: S.filtered,
|
|
2023
|
+
formats: w,
|
|
2024
|
+
wording: m,
|
|
2022
2025
|
sticky: fe(y),
|
|
2023
2026
|
left: de
|
|
2024
2027
|
},
|
|
2025
2028
|
y.key
|
|
2026
2029
|
)),
|
|
2027
|
-
|
|
2030
|
+
v.length > 0 && /* @__PURE__ */ l("td", { className: f.td })
|
|
2028
2031
|
] }) })
|
|
2029
2032
|
]
|
|
2030
2033
|
}
|
|
@@ -2045,85 +2048,85 @@ function wt({
|
|
|
2045
2048
|
sticky: o,
|
|
2046
2049
|
left: r
|
|
2047
2050
|
}) {
|
|
2048
|
-
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,
|
|
2049
|
-
|
|
2050
|
-
const
|
|
2051
|
-
if (!
|
|
2052
|
-
const
|
|
2053
|
-
|
|
2054
|
-
const
|
|
2055
|
-
|
|
2056
|
-
},
|
|
2057
|
-
|
|
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));
|
|
2058
2061
|
};
|
|
2059
|
-
|
|
2060
|
-
}, g = (
|
|
2061
|
-
const
|
|
2062
|
-
if (!
|
|
2063
|
-
const
|
|
2064
|
-
|
|
2065
|
-
let
|
|
2066
|
-
for (const
|
|
2067
|
-
if (
|
|
2068
|
-
const
|
|
2069
|
-
|
|
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));
|
|
2070
2073
|
}
|
|
2071
|
-
|
|
2072
|
-
},
|
|
2073
|
-
if (!s.resizable || !
|
|
2074
|
-
const
|
|
2075
|
-
if (!
|
|
2076
|
-
|
|
2077
|
-
const
|
|
2078
|
-
if (
|
|
2079
|
-
g(
|
|
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);
|
|
2080
2083
|
return;
|
|
2081
2084
|
}
|
|
2082
|
-
const
|
|
2083
|
-
i.setWidth(h, Math.max(
|
|
2084
|
-
},
|
|
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(
|
|
2085
2088
|
"button",
|
|
2086
2089
|
{
|
|
2087
2090
|
type: "button",
|
|
2088
|
-
className:
|
|
2089
|
-
onClick: (
|
|
2091
|
+
className: f.sortButton,
|
|
2092
|
+
onClick: (x) => i.toggleSort(h, x.shiftKey || x.metaKey),
|
|
2090
2093
|
children: [
|
|
2091
2094
|
/* @__PURE__ */ l("span", { children: s.label }),
|
|
2092
|
-
|
|
2093
|
-
/* @__PURE__ */ l("span", { className:
|
|
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: [
|
|
2094
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" }),
|
|
2095
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" })
|
|
2096
2099
|
] }) })
|
|
2097
2100
|
]
|
|
2098
2101
|
}
|
|
2099
|
-
) : s.label,
|
|
2100
|
-
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(
|
|
2101
2104
|
"th",
|
|
2102
2105
|
{
|
|
2103
2106
|
scope: "col",
|
|
2104
2107
|
"data-column": h,
|
|
2105
|
-
"aria-sort": u ?
|
|
2108
|
+
"aria-sort": u ? S : void 0,
|
|
2106
2109
|
tabIndex: s.resizable && !u ? 0 : void 0,
|
|
2107
|
-
onKeyDown:
|
|
2108
|
-
className:
|
|
2110
|
+
onKeyDown: _,
|
|
2111
|
+
className: G(f.th, c && f.numeric, o && f.stickyCell),
|
|
2109
2112
|
style: {
|
|
2110
2113
|
...k !== void 0 ? { width: k } : {},
|
|
2111
2114
|
...o ? { left: r } : {}
|
|
2112
2115
|
},
|
|
2113
2116
|
children: [
|
|
2114
|
-
|
|
2115
|
-
|
|
2117
|
+
I ? /* @__PURE__ */ O("span", { className: f.thFlex, children: [
|
|
2118
|
+
C,
|
|
2116
2119
|
/* @__PURE__ */ l(br, { entry: e, registry: t, hook: n })
|
|
2117
|
-
] }) :
|
|
2120
|
+
] }) : C,
|
|
2118
2121
|
s.resizable && /* @__PURE__ */ l(
|
|
2119
2122
|
"span",
|
|
2120
2123
|
{
|
|
2121
2124
|
role: "presentation",
|
|
2122
|
-
className:
|
|
2123
|
-
onPointerDown:
|
|
2124
|
-
onClick: (
|
|
2125
|
-
onDoubleClick: (
|
|
2126
|
-
|
|
2125
|
+
className: f.grip,
|
|
2126
|
+
onPointerDown: b,
|
|
2127
|
+
onClick: (x) => x.stopPropagation(),
|
|
2128
|
+
onDoubleClick: (x) => {
|
|
2129
|
+
x.stopPropagation(), g(x.currentTarget.closest("th"));
|
|
2127
2130
|
}
|
|
2128
2131
|
}
|
|
2129
2132
|
)
|
|
@@ -2143,85 +2146,86 @@ function Wr({
|
|
|
2143
2146
|
actions: c,
|
|
2144
2147
|
stickyRowHeader: u,
|
|
2145
2148
|
rowHeaderLeft: h,
|
|
2146
|
-
columnCount:
|
|
2147
|
-
rowProps:
|
|
2148
|
-
baseId:
|
|
2149
|
+
columnCount: d,
|
|
2150
|
+
rowProps: m,
|
|
2151
|
+
baseId: w,
|
|
2149
2152
|
formats: k,
|
|
2150
|
-
wording:
|
|
2151
|
-
line:
|
|
2153
|
+
wording: p,
|
|
2154
|
+
line: b,
|
|
2152
2155
|
spanEntry: g
|
|
2153
2156
|
}) {
|
|
2154
|
-
const
|
|
2155
|
-
return /* @__PURE__ */
|
|
2156
|
-
/* @__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(
|
|
2157
2160
|
"tr",
|
|
2158
2161
|
{
|
|
2159
|
-
...
|
|
2160
|
-
className:
|
|
2161
|
-
"data-row":
|
|
2162
|
-
"data-line":
|
|
2163
|
-
"data-motion":
|
|
2164
|
-
"data-group-first":
|
|
2165
|
-
"
|
|
2166
|
-
"aria-
|
|
2167
|
-
"aria-
|
|
2168
|
-
|
|
2169
|
-
|
|
2170
|
-
"
|
|
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,
|
|
2171
2175
|
children: [
|
|
2172
2176
|
a && /* @__PURE__ */ l(
|
|
2173
2177
|
"td",
|
|
2174
2178
|
{
|
|
2175
|
-
className:
|
|
2179
|
+
className: G(f.td, f.control, u && f.stickyCell),
|
|
2176
2180
|
style: u ? { left: 0 } : void 0,
|
|
2177
2181
|
children: /* @__PURE__ */ l(
|
|
2178
2182
|
Se,
|
|
2179
2183
|
{
|
|
2180
|
-
"aria-label":
|
|
2181
|
-
checked:
|
|
2182
|
-
onChange: () =>
|
|
2184
|
+
"aria-label": p.selectRow(I),
|
|
2185
|
+
checked: C.selection.isSelected(S),
|
|
2186
|
+
onChange: () => C.selection.toggle(S)
|
|
2183
2187
|
}
|
|
2184
2188
|
)
|
|
2185
2189
|
}
|
|
2186
2190
|
),
|
|
2187
|
-
|
|
2191
|
+
x && /* @__PURE__ */ l(
|
|
2188
2192
|
"td",
|
|
2189
2193
|
{
|
|
2190
|
-
className:
|
|
2194
|
+
className: G(f.td, f.control, u && f.stickyCell),
|
|
2191
2195
|
style: u ? { left: (a ? 1 : 0) * Oe } : void 0,
|
|
2192
2196
|
children: /* @__PURE__ */ l(
|
|
2193
2197
|
"button",
|
|
2194
2198
|
{
|
|
2195
2199
|
type: "button",
|
|
2196
|
-
"aria-expanded":
|
|
2197
|
-
"aria-controls":
|
|
2198
|
-
"aria-label":
|
|
2199
|
-
className:
|
|
2200
|
-
onClick: () =>
|
|
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),
|
|
2201
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" }) })
|
|
2202
2206
|
}
|
|
2203
2207
|
)
|
|
2204
2208
|
}
|
|
2205
2209
|
),
|
|
2206
|
-
|
|
2207
|
-
s.map((
|
|
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(
|
|
2208
2212
|
qr,
|
|
2209
2213
|
{
|
|
2210
|
-
entry:
|
|
2214
|
+
entry: z,
|
|
2211
2215
|
row: e,
|
|
2212
|
-
kind: o.kindOf(
|
|
2213
|
-
sticky: u &&
|
|
2216
|
+
kind: o.kindOf(z, r.rows),
|
|
2217
|
+
sticky: u && z === i,
|
|
2214
2218
|
left: h,
|
|
2215
2219
|
formats: k,
|
|
2216
|
-
wording:
|
|
2220
|
+
wording: p
|
|
2217
2221
|
},
|
|
2218
|
-
|
|
2222
|
+
z.key
|
|
2219
2223
|
)),
|
|
2220
|
-
c.length > 0 && /* @__PURE__ */ l("td", { className:
|
|
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 }) })
|
|
2221
2225
|
]
|
|
2222
2226
|
}
|
|
2223
2227
|
),
|
|
2224
|
-
|
|
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) }) })
|
|
2225
2229
|
] });
|
|
2226
2230
|
}
|
|
2227
2231
|
function qr({
|
|
@@ -2236,12 +2240,12 @@ function qr({
|
|
|
2236
2240
|
const { spec: a } = e, c = e.read(t), u = Ot(n, a.rightAligned);
|
|
2237
2241
|
let h;
|
|
2238
2242
|
Y(c) ? h = /* @__PURE__ */ l(Ht, { wording: i }) : a.presentation ? h = a.presentation(c, t) : h = _e(c, a.format, s, i);
|
|
2239
|
-
const
|
|
2243
|
+
const d = a.rowHeader ? "th" : "td";
|
|
2240
2244
|
return /* @__PURE__ */ l(
|
|
2241
|
-
|
|
2245
|
+
d,
|
|
2242
2246
|
{
|
|
2243
2247
|
scope: a.rowHeader ? "row" : void 0,
|
|
2244
|
-
className:
|
|
2248
|
+
className: G(f.td, u && f.numeric, a.rowHeader && f.rowHeader, o && f.stickyCell),
|
|
2245
2249
|
style: o ? { left: r } : void 0,
|
|
2246
2250
|
children: h
|
|
2247
2251
|
}
|
|
@@ -2256,12 +2260,12 @@ function Yr({
|
|
|
2256
2260
|
left: s
|
|
2257
2261
|
}) {
|
|
2258
2262
|
const i = r ? { left: s } : void 0;
|
|
2259
|
-
if (!e.spec.aggregate) return /* @__PURE__ */ l("td", { className:
|
|
2263
|
+
if (!e.spec.aggregate) return /* @__PURE__ */ l("td", { className: G(f.td, r && f.stickyCell), style: i });
|
|
2260
2264
|
const a = typeof e.spec.aggregate == "function" ? "own" : e.spec.aggregate;
|
|
2261
|
-
return /* @__PURE__ */ l("td", { className:
|
|
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 }) });
|
|
2262
2266
|
}
|
|
2263
2267
|
const Ur = 2;
|
|
2264
|
-
function
|
|
2268
|
+
function Jr({
|
|
2265
2269
|
actions: e,
|
|
2266
2270
|
row: t,
|
|
2267
2271
|
name: n,
|
|
@@ -2271,7 +2275,7 @@ function Xr({
|
|
|
2271
2275
|
const i = s.onSelect;
|
|
2272
2276
|
i(s.bulk ? [t] : t);
|
|
2273
2277
|
};
|
|
2274
|
-
return e.length <= Ur ? /* @__PURE__ */ l("div", { className:
|
|
2278
|
+
return e.length <= Ur ? /* @__PURE__ */ l("div", { className: f.actions, children: e.map(({ key: s, spec: i }) => /* @__PURE__ */ l(
|
|
2275
2279
|
ee,
|
|
2276
2280
|
{
|
|
2277
2281
|
size: "sm",
|
|
@@ -2281,7 +2285,7 @@ function Xr({
|
|
|
2281
2285
|
children: i.label
|
|
2282
2286
|
},
|
|
2283
2287
|
s
|
|
2284
|
-
)) }) : /* @__PURE__ */ l("div", { className:
|
|
2288
|
+
)) }) : /* @__PURE__ */ l("div", { className: f.actions, children: /* @__PURE__ */ l(
|
|
2285
2289
|
At,
|
|
2286
2290
|
{
|
|
2287
2291
|
align: "end",
|
|
@@ -2290,42 +2294,42 @@ function Xr({
|
|
|
2290
2294
|
}
|
|
2291
2295
|
) });
|
|
2292
2296
|
}
|
|
2293
|
-
function
|
|
2297
|
+
function Xr({ columns: e, rows: t = 4 }) {
|
|
2294
2298
|
const n = [72, 48, 60, 40, 56, 64];
|
|
2295
|
-
return /* @__PURE__ */ l(
|
|
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)) });
|
|
2296
2300
|
}
|
|
2297
2301
|
const Wt = yt(0);
|
|
2298
2302
|
function bt({ height: e, colSpan: t }) {
|
|
2299
|
-
return e <= 0 ? null : /* @__PURE__ */ l("tr", { "aria-hidden": "true", "data-filler": "", className:
|
|
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 } }) });
|
|
2300
2304
|
}
|
|
2301
2305
|
function kt({
|
|
2302
2306
|
virtual: e,
|
|
2303
2307
|
colSpan: t,
|
|
2304
2308
|
children: n
|
|
2305
2309
|
}) {
|
|
2306
|
-
const { count: o, fillerBefore: r, fillerAfter: s, showRow: i } = e, a =
|
|
2310
|
+
const { count: o, fillerBefore: r, fillerAfter: s, showRow: i } = e, a = re(null), [c, u] = H(0), h = (w, k) => {
|
|
2307
2311
|
a.current = k, u(k), i(k), requestAnimationFrame(() => {
|
|
2308
|
-
var
|
|
2309
|
-
(
|
|
2312
|
+
var p;
|
|
2313
|
+
(p = w.querySelector(`[data-row="${k}"]`)) == null || p.focus();
|
|
2310
2314
|
});
|
|
2311
|
-
},
|
|
2312
|
-
if (
|
|
2313
|
-
const k =
|
|
2314
|
-
if (
|
|
2315
|
-
const
|
|
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;
|
|
2316
2320
|
let g = null;
|
|
2317
|
-
|
|
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));
|
|
2318
2322
|
};
|
|
2319
2323
|
return /* @__PURE__ */ l(
|
|
2320
2324
|
"tbody",
|
|
2321
2325
|
{
|
|
2322
|
-
className:
|
|
2323
|
-
onKeyDown:
|
|
2324
|
-
onFocus: (
|
|
2325
|
-
const k =
|
|
2326
|
+
className: f.virtualBody,
|
|
2327
|
+
onKeyDown: m,
|
|
2328
|
+
onFocus: (w) => {
|
|
2329
|
+
const k = w.target.closest("[data-row]");
|
|
2326
2330
|
k && u(Number(k.dataset.row));
|
|
2327
2331
|
},
|
|
2328
|
-
children: /* @__PURE__ */
|
|
2332
|
+
children: /* @__PURE__ */ O(Wt.Provider, { value: d, children: [
|
|
2329
2333
|
/* @__PURE__ */ l(bt, { height: r, colSpan: t }),
|
|
2330
2334
|
n,
|
|
2331
2335
|
/* @__PURE__ */ l(bt, { height: s, colSpan: t })
|
|
@@ -2333,7 +2337,7 @@ function kt({
|
|
|
2333
2337
|
}
|
|
2334
2338
|
);
|
|
2335
2339
|
}
|
|
2336
|
-
const Qr = "
|
|
2340
|
+
const Qr = "_verdict_yxa4g_6", Zr = "_glyph_yxa4g_13", es = "_value_yxa4g_23", ts = "_excess_yxa4g_28", Te = {
|
|
2337
2341
|
verdict: Qr,
|
|
2338
2342
|
glyph: Zr,
|
|
2339
2343
|
value: es,
|
|
@@ -2346,10 +2350,10 @@ const Qr = "_verdict_a8pbv_6", Zr = "_glyph_a8pbv_13", es = "_value_a8pbv_23", t
|
|
|
2346
2350
|
};
|
|
2347
2351
|
function rs({ reading: e, format: t }) {
|
|
2348
2352
|
const n = ue(), o = U(), { measured: r, assessment: s } = e, i = ns(s.verdict, o);
|
|
2349
|
-
return /* @__PURE__ */
|
|
2353
|
+
return /* @__PURE__ */ O("span", { className: Te.verdict, "data-verdict": s.verdict, title: i, children: [
|
|
2350
2354
|
/* @__PURE__ */ l("span", { "aria-hidden": "true", className: Te.glyph, children: os[s.verdict] }),
|
|
2351
2355
|
/* @__PURE__ */ l("span", { className: Te.value, children: r === null ? o.statAbsentValue : vt(r, t, n) }),
|
|
2352
|
-
s.excess !== void 0 && /* @__PURE__ */
|
|
2356
|
+
s.excess !== void 0 && /* @__PURE__ */ O("span", { className: Te.excess, children: [
|
|
2353
2357
|
"+",
|
|
2354
2358
|
vt(s.excess, t, n)
|
|
2355
2359
|
] }),
|
|
@@ -2357,22 +2361,22 @@ function rs({ reading: e, format: t }) {
|
|
|
2357
2361
|
] });
|
|
2358
2362
|
}
|
|
2359
2363
|
const ss = (e) => e.measured, is = (e) => e.reduce(
|
|
2360
|
-
(t, n) => !t ||
|
|
2364
|
+
(t, n) => !t || Ee(n.assessment.verdict) > Ee(t.assessment.verdict) ? n : t,
|
|
2361
2365
|
void 0
|
|
2362
2366
|
);
|
|
2363
2367
|
function as(e) {
|
|
2364
2368
|
return function({ id: n, value: o, label: r, limits: s, format: i, sortBy: a = "verdict", width: c, resizable: u, aggregate: h }) {
|
|
2365
|
-
const
|
|
2366
|
-
const k = JSON.parse(
|
|
2367
|
-
return (
|
|
2368
|
-
const
|
|
2369
|
+
const d = JSON.stringify(s), m = $(() => {
|
|
2370
|
+
const k = JSON.parse(d);
|
|
2371
|
+
return (p) => {
|
|
2372
|
+
const b = typeof o == "string" ? p == null ? void 0 : p[o] : o(p);
|
|
2369
2373
|
return {
|
|
2370
|
-
measured: typeof
|
|
2371
|
-
assessment: tn(
|
|
2374
|
+
measured: typeof b == "number" && Number.isFinite(b) ? b : null,
|
|
2375
|
+
assessment: tn(b, k)
|
|
2372
2376
|
};
|
|
2373
2377
|
};
|
|
2374
|
-
}, [o,
|
|
2375
|
-
(k) => a === "value" ? k.measured :
|
|
2378
|
+
}, [o, d]), w = X(
|
|
2379
|
+
(k) => a === "value" ? k.measured : Ee(k.assessment.verdict),
|
|
2376
2380
|
[a]
|
|
2377
2381
|
);
|
|
2378
2382
|
return /* @__PURE__ */ l(
|
|
@@ -2383,8 +2387,8 @@ function as(e) {
|
|
|
2383
2387
|
numeric: !0,
|
|
2384
2388
|
width: c,
|
|
2385
2389
|
resizable: u,
|
|
2386
|
-
value:
|
|
2387
|
-
sortValue:
|
|
2390
|
+
value: m,
|
|
2391
|
+
sortValue: w,
|
|
2388
2392
|
exportValue: ss,
|
|
2389
2393
|
aggregate: h === "worst" ? is : void 0,
|
|
2390
2394
|
children: (k) => /* @__PURE__ */ l(rs, { reading: k, format: i })
|
|
@@ -2420,16 +2424,16 @@ function ls(e, t) {
|
|
|
2420
2424
|
};
|
|
2421
2425
|
}
|
|
2422
2426
|
function cs(e, t) {
|
|
2423
|
-
const n =
|
|
2427
|
+
const n = $(() => t ? e.filter((i) => t(i)) : e, [e, t]), [o, r] = H(() => ({ source: e, result: n }));
|
|
2424
2428
|
if (!t) return e;
|
|
2425
2429
|
const s = o.source === e && (o.result === n || o.result.length === n.length && o.result.every((i, a) => i === n[a]));
|
|
2426
2430
|
return s || r({ source: e, result: n }), s ? o.result : n;
|
|
2427
2431
|
}
|
|
2428
2432
|
function us(e, t) {
|
|
2429
|
-
var a, c, u, h,
|
|
2433
|
+
var a, c, u, h, d, m;
|
|
2430
2434
|
if (t.size === 0) return e;
|
|
2431
|
-
const n = (a = e.sort) == null ? void 0 : a.filter((
|
|
2432
|
-
return (n == null ? void 0 : n.length) === ((h = e.sort) == null ? void 0 : h.length) && (o == null ? void 0 : o.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 : {
|
|
2433
2437
|
...e.search ? { search: e.search } : {},
|
|
2434
2438
|
...e.page ? { page: e.page } : {},
|
|
2435
2439
|
...e.pageSize ? { pageSize: e.pageSize } : {},
|
|
@@ -2439,7 +2443,7 @@ function us(e, t) {
|
|
|
2439
2443
|
...s && Object.keys(s).length ? { widths: s } : {}
|
|
2440
2444
|
};
|
|
2441
2445
|
}
|
|
2442
|
-
const
|
|
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]);
|
|
2443
2447
|
function _t(e) {
|
|
2444
2448
|
const t = [], n = (o) => {
|
|
2445
2449
|
for (const r of o)
|
|
@@ -2454,116 +2458,120 @@ function hs(e, t) {
|
|
|
2454
2458
|
return { ...n, ...t };
|
|
2455
2459
|
}
|
|
2456
2460
|
function gs(e, t) {
|
|
2457
|
-
const [n] =
|
|
2461
|
+
const [n] = H(() => new gr()), [o] = H(() => {
|
|
2458
2462
|
const y = Hr(n);
|
|
2459
2463
|
return { ...y, VerdictColumn: as(y.Column) };
|
|
2460
2464
|
});
|
|
2461
2465
|
Le(n.subscribe, n.structureVersion, n.structureVersion);
|
|
2462
|
-
const r = ue(), s = e, i = n.modelColumns(s, r), [a] =
|
|
2463
|
-
() => a != null && a.grouping ? [...a.grouping] :
|
|
2464
|
-
), [
|
|
2465
|
-
() =>
|
|
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,
|
|
2466
2470
|
// eslint-disable-next-line react-hooks/exhaustive-deps -- the model's identity carries the ids and the columns
|
|
2467
|
-
[
|
|
2468
|
-
),
|
|
2469
|
-
rowKey:
|
|
2471
|
+
[I, S, r.compareText, C]
|
|
2472
|
+
), A = t.rowKey, v = kn(m, i, {
|
|
2473
|
+
rowKey: A,
|
|
2470
2474
|
pageSize: t.pageSize,
|
|
2471
2475
|
defaultSort: t.defaultSort,
|
|
2472
2476
|
filter: h,
|
|
2473
2477
|
initialView: a,
|
|
2474
2478
|
virtual: t.virtual,
|
|
2475
|
-
grouping:
|
|
2476
|
-
}), { setPage:
|
|
2479
|
+
grouping: x
|
|
2480
|
+
}), { setPage: F } = v, L = X(
|
|
2477
2481
|
(y, R) => {
|
|
2478
|
-
let
|
|
2479
|
-
if (!
|
|
2480
|
-
const
|
|
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;
|
|
2481
2485
|
if (!M) {
|
|
2482
2486
|
pe(
|
|
2483
2487
|
`condition-without-filter:${y}`,
|
|
2484
|
-
|
|
2488
|
+
j ? `The column "${y}" has no filter; its condition is passed over.` : `No column is called "${y}"; its condition is passed over.`
|
|
2485
2489
|
);
|
|
2486
2490
|
return;
|
|
2487
2491
|
}
|
|
2488
|
-
const
|
|
2489
|
-
if (
|
|
2492
|
+
const J = Dt(M, R);
|
|
2493
|
+
if (J === "foreign") {
|
|
2490
2494
|
qt(y);
|
|
2491
2495
|
return;
|
|
2492
2496
|
}
|
|
2493
|
-
|
|
2497
|
+
K = J === "empty";
|
|
2494
2498
|
}
|
|
2495
|
-
u((
|
|
2496
|
-
const M =
|
|
2497
|
-
return
|
|
2498
|
-
}),
|
|
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);
|
|
2499
2503
|
},
|
|
2500
|
-
[n,
|
|
2501
|
-
),
|
|
2502
|
-
if (!fs(
|
|
2503
|
-
const y = new Set([...
|
|
2504
|
-
|
|
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)));
|
|
2505
2509
|
}
|
|
2506
|
-
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 = {
|
|
2507
2511
|
...ie,
|
|
2508
|
-
...ds(
|
|
2512
|
+
...ds(_, de) ? {} : { grouping: _ },
|
|
2509
2513
|
...fe.length ? { folded: fe } : {}
|
|
2510
2514
|
}, be = (y) => {
|
|
2511
|
-
k([...y]),
|
|
2515
|
+
k([...y]), F(1);
|
|
2512
2516
|
}, ye = (y) => {
|
|
2513
|
-
_t(
|
|
2517
|
+
_t(v.groups).includes(y) && (n.noteFocusBeforeFold(), b((R) => R.includes(y) ? R.filter((K) => K !== y) : [...R, y]));
|
|
2514
2518
|
}, le = n.paginates() || t.virtual !== void 0, te = {
|
|
2515
2519
|
rows: e,
|
|
2516
|
-
filtered:
|
|
2517
|
-
visible: le ?
|
|
2518
|
-
page: le ?
|
|
2519
|
-
pageCount: le ?
|
|
2520
|
-
pageSize:
|
|
2521
|
-
setPage:
|
|
2522
|
-
setPageSize:
|
|
2523
|
-
search:
|
|
2524
|
-
setSearch:
|
|
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,
|
|
2525
2529
|
sort: ae,
|
|
2526
|
-
toggleSort:
|
|
2527
|
-
hidden:
|
|
2528
|
-
toggleColumn:
|
|
2529
|
-
order:
|
|
2530
|
-
setOrder:
|
|
2531
|
-
widths: hs(i,
|
|
2532
|
-
setWidth:
|
|
2533
|
-
expanded:
|
|
2534
|
-
toggleRow:
|
|
2535
|
-
filter: Object.fromEntries(
|
|
2536
|
-
setFilter:
|
|
2537
|
-
selection: t.selection ??
|
|
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,
|
|
2538
2542
|
view: we,
|
|
2539
|
-
grouping:
|
|
2543
|
+
grouping: _,
|
|
2540
2544
|
setGrouping: be,
|
|
2541
2545
|
folded: fe,
|
|
2542
2546
|
toggleFold: ye,
|
|
2543
|
-
foldAll: () =>
|
|
2544
|
-
|
|
2547
|
+
foldAll: () => {
|
|
2548
|
+
n.noteFocusBeforeFold(), b(_t(v.groups));
|
|
2549
|
+
},
|
|
2550
|
+
unfoldAll: () => {
|
|
2551
|
+
n.noteFocusBeforeFold(), b([]);
|
|
2552
|
+
},
|
|
2545
2553
|
asCsv: () => xr(n),
|
|
2546
2554
|
virtual: t.virtual !== void 0
|
|
2547
2555
|
};
|
|
2548
2556
|
return n.setHook({
|
|
2549
2557
|
rows: s,
|
|
2550
|
-
admitted:
|
|
2558
|
+
admitted: m,
|
|
2551
2559
|
modelColumns: i,
|
|
2552
|
-
companion:
|
|
2560
|
+
companion: v,
|
|
2553
2561
|
filter: h,
|
|
2554
|
-
grouping:
|
|
2555
|
-
folded:
|
|
2562
|
+
grouping: x,
|
|
2563
|
+
folded: S,
|
|
2556
2564
|
publicSnapshot: te,
|
|
2557
|
-
rowKey:
|
|
2565
|
+
rowKey: A,
|
|
2558
2566
|
formats: r
|
|
2559
2567
|
}), { ...te, ...o };
|
|
2560
2568
|
}
|
|
2561
|
-
function
|
|
2569
|
+
function Xs(e) {
|
|
2562
2570
|
return e;
|
|
2563
2571
|
}
|
|
2564
2572
|
function nt(e, t) {
|
|
2565
2573
|
const n = se();
|
|
2566
|
-
e == null || e.register(t, n),
|
|
2574
|
+
e == null || e.register(t, n), W(() => {
|
|
2567
2575
|
if (e)
|
|
2568
2576
|
return e.register(t, n), e.commit(), () => {
|
|
2569
2577
|
e.remove(t, n), e.commit();
|
|
@@ -2596,25 +2604,25 @@ function Zs({ placeholder: e, "aria-label": t, className: n, of: o }) {
|
|
|
2596
2604
|
);
|
|
2597
2605
|
}
|
|
2598
2606
|
function ei({ of: e }) {
|
|
2599
|
-
var
|
|
2600
|
-
const t = xe(e), n = U(), [o, r] =
|
|
2601
|
-
if (
|
|
2602
|
-
var
|
|
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;
|
|
2603
2611
|
if (!c || !i.current) return;
|
|
2604
2612
|
const g = Array.from(i.current.children).find(
|
|
2605
|
-
(
|
|
2606
|
-
),
|
|
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(
|
|
2607
2615
|
`[data-direction="${c.direction === "forward" ? "backward" : "forward"}"]`
|
|
2608
2616
|
);
|
|
2609
|
-
(
|
|
2617
|
+
(S = _ && !_.disabled ? _ : C) == null || S.focus();
|
|
2610
2618
|
}, [c]), !t) return null;
|
|
2611
|
-
const { registry: h, snapshot:
|
|
2612
|
-
et(h.modelColumns(
|
|
2613
|
-
), k = h.stickyRowHeader ? ((
|
|
2614
|
-
const
|
|
2615
|
-
|
|
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" }));
|
|
2616
2624
|
};
|
|
2617
|
-
return /* @__PURE__ */
|
|
2625
|
+
return /* @__PURE__ */ O(Q, { children: [
|
|
2618
2626
|
/* @__PURE__ */ l(
|
|
2619
2627
|
ee,
|
|
2620
2628
|
{
|
|
@@ -2627,7 +2635,7 @@ function ei({ of: e }) {
|
|
|
2627
2635
|
children: n.columns
|
|
2628
2636
|
}
|
|
2629
2637
|
),
|
|
2630
|
-
/* @__PURE__ */
|
|
2638
|
+
/* @__PURE__ */ O(
|
|
2631
2639
|
St,
|
|
2632
2640
|
{
|
|
2633
2641
|
open: o,
|
|
@@ -2637,29 +2645,29 @@ function ei({ of: e }) {
|
|
|
2637
2645
|
role: "dialog",
|
|
2638
2646
|
ariaLabel: n.arrangeColumns,
|
|
2639
2647
|
id: a,
|
|
2640
|
-
className:
|
|
2648
|
+
className: f.columnsPanel,
|
|
2641
2649
|
children: [
|
|
2642
|
-
/* @__PURE__ */ l("ul", { ref: i, className:
|
|
2643
|
-
const
|
|
2644
|
-
return /* @__PURE__ */
|
|
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: [
|
|
2645
2653
|
/* @__PURE__ */ l(
|
|
2646
2654
|
Se,
|
|
2647
2655
|
{
|
|
2648
|
-
label:
|
|
2649
|
-
checked: !
|
|
2656
|
+
label: C,
|
|
2657
|
+
checked: !d.hidden.includes(g.id),
|
|
2650
2658
|
disabled: g.hideable === !1,
|
|
2651
|
-
onChange: () =>
|
|
2659
|
+
onChange: () => d.toggleColumn(g.id)
|
|
2652
2660
|
}
|
|
2653
2661
|
),
|
|
2654
2662
|
/* @__PURE__ */ l(
|
|
2655
2663
|
"button",
|
|
2656
2664
|
{
|
|
2657
2665
|
type: "button",
|
|
2658
|
-
className:
|
|
2666
|
+
className: f.move,
|
|
2659
2667
|
"data-direction": "forward",
|
|
2660
|
-
"aria-label": n.columnForward(
|
|
2661
|
-
disabled:
|
|
2662
|
-
onClick: () =>
|
|
2668
|
+
"aria-label": n.columnForward(C),
|
|
2669
|
+
disabled: _ === 0 || k && _ <= 1,
|
|
2670
|
+
onClick: () => p(_, -1),
|
|
2663
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" }) })
|
|
2664
2672
|
}
|
|
2665
2673
|
),
|
|
@@ -2667,17 +2675,17 @@ function ei({ of: e }) {
|
|
|
2667
2675
|
"button",
|
|
2668
2676
|
{
|
|
2669
2677
|
type: "button",
|
|
2670
|
-
className:
|
|
2678
|
+
className: f.move,
|
|
2671
2679
|
"data-direction": "backward",
|
|
2672
|
-
"aria-label": n.columnBackward(
|
|
2673
|
-
disabled:
|
|
2674
|
-
onClick: () =>
|
|
2680
|
+
"aria-label": n.columnBackward(C),
|
|
2681
|
+
disabled: _ === w.length - 1 || k && _ === 0,
|
|
2682
|
+
onClick: () => p(_, 1),
|
|
2675
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" }) })
|
|
2676
2684
|
}
|
|
2677
2685
|
)
|
|
2678
2686
|
] }, g.id);
|
|
2679
2687
|
}) }),
|
|
2680
|
-
/* @__PURE__ */ l(Tr, { registry: h, hook:
|
|
2688
|
+
/* @__PURE__ */ l(Tr, { registry: h, hook: m })
|
|
2681
2689
|
]
|
|
2682
2690
|
}
|
|
2683
2691
|
)
|
|
@@ -2700,10 +2708,10 @@ function ti({ filename: e, onExport: t, of: n }) {
|
|
|
2700
2708
|
function ni({ pageSizes: e = [10, 25, 50], className: t, of: n }) {
|
|
2701
2709
|
const o = xe(n), r = U(), s = ue();
|
|
2702
2710
|
if (nt(o == null ? void 0 : o.registry, "pagination"), !o || o.snapshot.virtual) return null;
|
|
2703
|
-
const { snapshot: i } = o, a = i.filtered.length, c = e.includes(i.pageSize) ? e : [...e, i.pageSize].sort((h,
|
|
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: [
|
|
2704
2712
|
/* @__PURE__ */ l("span", { children: r.entries(a, s.count(a)) }),
|
|
2705
|
-
/* @__PURE__ */
|
|
2706
|
-
/* @__PURE__ */
|
|
2713
|
+
/* @__PURE__ */ O("div", { className: f.paginationControls, children: [
|
|
2714
|
+
/* @__PURE__ */ O("label", { className: f.pageSize, children: [
|
|
2707
2715
|
r.rows,
|
|
2708
2716
|
/* @__PURE__ */ l(
|
|
2709
2717
|
nn,
|
|
@@ -2716,7 +2724,7 @@ function ni({ pageSizes: e = [10, 25, 50], className: t, of: n }) {
|
|
|
2716
2724
|
}
|
|
2717
2725
|
)
|
|
2718
2726
|
] }),
|
|
2719
|
-
/* @__PURE__ */ l("span", { className:
|
|
2727
|
+
/* @__PURE__ */ l("span", { className: f.paginationStatus, children: r.pageOfPages(i.page, i.pageCount) }),
|
|
2720
2728
|
/* @__PURE__ */ l(ee, { size: "sm", disabled: i.page <= 1, onClick: () => i.setPage(i.page - 1), children: r.previousPage }),
|
|
2721
2729
|
/* @__PURE__ */ l(ee, { size: "sm", disabled: i.page >= i.pageCount, onClick: () => i.setPage(i.page + 1), children: r.nextPage })
|
|
2722
2730
|
] })
|
|
@@ -2812,35 +2820,35 @@ function ii(e, t = {}) {
|
|
|
2812
2820
|
flood: i,
|
|
2813
2821
|
keepDone: a = !1,
|
|
2814
2822
|
columns: c = xs
|
|
2815
|
-
} = e, u = new Map(o.map((
|
|
2816
|
-
const
|
|
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;
|
|
2817
2825
|
return {
|
|
2818
|
-
id:
|
|
2819
|
-
alarm:
|
|
2820
|
-
type:
|
|
2821
|
-
lifecycle:
|
|
2822
|
-
priority:
|
|
2823
|
-
rank: ms(
|
|
2824
|
-
age: r -
|
|
2825
|
-
duration: (
|
|
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,
|
|
2826
2834
|
frequency: g,
|
|
2827
2835
|
chatters: s !== void 0 && g >= s.atLeast,
|
|
2828
|
-
inFlood:
|
|
2836
|
+
inFlood: m.has(p.id)
|
|
2829
2837
|
};
|
|
2830
|
-
}), k = tt(
|
|
2838
|
+
}), k = tt(w, c, {
|
|
2831
2839
|
...t,
|
|
2832
2840
|
sort: t.sort === void 0 ? As : t.sort
|
|
2833
2841
|
});
|
|
2834
2842
|
return {
|
|
2835
2843
|
...k,
|
|
2836
|
-
flood:
|
|
2844
|
+
flood: d,
|
|
2837
2845
|
standingUnacknowledged: k.filtered.reduce(
|
|
2838
|
-
(
|
|
2846
|
+
(p, b) => p + (b.lifecycle === "standing-unacknowledged" ? 1 : 0),
|
|
2839
2847
|
0
|
|
2840
2848
|
)
|
|
2841
2849
|
};
|
|
2842
2850
|
}
|
|
2843
|
-
const Fs = "
|
|
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 = {
|
|
2844
2852
|
list: Fs,
|
|
2845
2853
|
bar: Os,
|
|
2846
2854
|
heading: Ls,
|
|
@@ -2849,11 +2857,11 @@ const Fs = "_list_alpwk_4 _text_1hv7a_23", Os = "_bar_alpwk_12", Ls = "_heading_
|
|
|
2849
2857
|
live: Vs,
|
|
2850
2858
|
label: Ds,
|
|
2851
2859
|
counter: Is,
|
|
2852
|
-
lifecycle:
|
|
2853
|
-
empty:
|
|
2854
|
-
row:
|
|
2860
|
+
lifecycle: Bs,
|
|
2861
|
+
empty: Ps,
|
|
2862
|
+
row: Gs
|
|
2855
2863
|
};
|
|
2856
|
-
function
|
|
2864
|
+
function Es(e, t) {
|
|
2857
2865
|
switch (e) {
|
|
2858
2866
|
case "standing-unacknowledged":
|
|
2859
2867
|
return t.lifecycleStandingUnacknowledged;
|
|
@@ -2896,37 +2904,37 @@ function Ut({
|
|
|
2896
2904
|
freshness: s,
|
|
2897
2905
|
...i
|
|
2898
2906
|
}) {
|
|
2899
|
-
const a = U(), c = ue(), u = s !== null, h = (s == null ? void 0 : s.freshness) === "lost", { Table:
|
|
2900
|
-
return /* @__PURE__ */
|
|
2901
|
-
/* @__PURE__ */
|
|
2902
|
-
/* @__PURE__ */ l("span", { className:
|
|
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 }),
|
|
2903
2911
|
e.flood !== null && /* @__PURE__ */ l(Ie, { tone: "warning", children: a.floodHint(e.flood.count) }),
|
|
2904
|
-
u && s !== null && /* @__PURE__ */
|
|
2912
|
+
u && s !== null && /* @__PURE__ */ O("span", { className: oe.asOf, "data-freshness": s.freshness, children: [
|
|
2905
2913
|
s.freshness === "lost" ? a.freshnessDisconnected : s.freshness === "stale" ? a.freshnessStale : a.freshnessFresh,
|
|
2906
2914
|
s.age !== null && ` · ${c.relative(s.age)}`
|
|
2907
2915
|
] }),
|
|
2908
|
-
/* @__PURE__ */ l("span", { className:
|
|
2909
|
-
t !== void 0 && n !== void 0 && /* @__PURE__ */ l(ee, { variant: "primary", size: "sm", disabled:
|
|
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) })
|
|
2910
2918
|
] }),
|
|
2911
|
-
/* @__PURE__ */ l("div", { "aria-live": "polite", "aria-atomic": "true", className:
|
|
2912
|
-
/* @__PURE__ */
|
|
2913
|
-
|
|
2919
|
+
/* @__PURE__ */ l("div", { "aria-live": "polite", "aria-atomic": "true", className: oe.live, children: a.standingUnacknowledged(e.standingUnacknowledged) }),
|
|
2920
|
+
/* @__PURE__ */ O(
|
|
2921
|
+
d,
|
|
2914
2922
|
{
|
|
2915
2923
|
ariaLabel: a.alarms,
|
|
2916
2924
|
selectable: t !== void 0,
|
|
2917
|
-
density:
|
|
2925
|
+
density: b,
|
|
2918
2926
|
stickyHeader: !0,
|
|
2919
|
-
rowProps: (g) => ({ className:
|
|
2920
|
-
empty: /* @__PURE__ */ l("span", { className:
|
|
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 }),
|
|
2921
2929
|
children: [
|
|
2922
|
-
/* @__PURE__ */ l(
|
|
2923
|
-
/* @__PURE__ */ l("span", { className:
|
|
2924
|
-
|
|
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) })
|
|
2925
2933
|
] }) }),
|
|
2926
|
-
/* @__PURE__ */ l(
|
|
2927
|
-
/* @__PURE__ */ l(
|
|
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) }) }),
|
|
2928
2936
|
/* @__PURE__ */ l(
|
|
2929
|
-
|
|
2937
|
+
m,
|
|
2930
2938
|
{
|
|
2931
2939
|
id: "raised",
|
|
2932
2940
|
label: a.columnRaised,
|
|
@@ -2935,8 +2943,8 @@ function Ut({
|
|
|
2935
2943
|
sortable: !1
|
|
2936
2944
|
}
|
|
2937
2945
|
),
|
|
2938
|
-
/* @__PURE__ */ l(
|
|
2939
|
-
/* @__PURE__ */ l(
|
|
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 })
|
|
2940
2948
|
]
|
|
2941
2949
|
}
|
|
2942
2950
|
)
|
|
@@ -2955,8 +2963,8 @@ export {
|
|
|
2955
2963
|
si as acknowledge,
|
|
2956
2964
|
Ns as alarmColumns,
|
|
2957
2965
|
ii as alarmModel,
|
|
2958
|
-
|
|
2959
|
-
|
|
2966
|
+
Xs as column,
|
|
2967
|
+
Js as columnFilter,
|
|
2960
2968
|
Ss as countAcknowledgeable,
|
|
2961
2969
|
ri as countInWindow,
|
|
2962
2970
|
Cs as detectFlood,
|