@umriss-ui/table 0.2.1 → 0.2.2
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 +29 -0
- package/README.md +3 -0
- package/dist/index.d.ts +6 -5
- package/dist/table.css +1 -1
- package/dist/table.js +390 -387
- package/package.json +3 -3
package/dist/table.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import "./table.css";
|
|
2
|
-
var
|
|
3
|
-
var _t = (e, t, n) => t in e ?
|
|
4
|
-
var
|
|
5
|
-
import { useState as
|
|
6
|
-
import { DEFAULT_FORMATS as
|
|
7
|
-
import { jsx as c, jsxs as
|
|
2
|
+
var wt = Object.defineProperty;
|
|
3
|
+
var _t = (e, t, n) => t in e ? wt(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
|
4
|
+
var z = (e, t, n) => _t(e, typeof t != "symbol" ? t + "" : t, n);
|
|
5
|
+
import { useState as P, useCallback as B, useMemo as V, useRef as oe, useId as Z, useContext as xe, useSyncExternalStore as pe, createContext as Ge, useLayoutEffect as J } from "react";
|
|
6
|
+
import { DEFAULT_FORMATS as vt, useVirtual as kt, useFormats as te, useWording as $, Checkbox as be, DateRangePicker as yt, FormField as Ee, NumberInput as Pe, Popover as Ue, Button as G, TagGroup as Ct, Tag as St, useDensityFor as qe, VisuallyHidden as ge, Menu as Nt, MenuItem as At, assess as xt, verdictWeight as Tt, Select as Ot, Input as Rt, DEFAULT_WORDING as It, Badge as Ce, useFreshness as Ft } from "@umriss-ui/core";
|
|
7
|
+
import { jsx as c, jsxs as x, Fragment as Q } from "react/jsx-runtime";
|
|
8
8
|
import { createPortal as Lt } from "react-dom";
|
|
9
9
|
function zt(e) {
|
|
10
|
-
const [t, n] =
|
|
10
|
+
const [t, n] = P(/* @__PURE__ */ new Set()), o = B((u) => t.has(u), [t]), r = B((u) => {
|
|
11
11
|
n((d) => {
|
|
12
12
|
const h = new Set(d);
|
|
13
13
|
return h.has(u) ? h.delete(u) : h.add(u), h;
|
|
@@ -21,7 +21,7 @@ function zt(e) {
|
|
|
21
21
|
), l = B(() => {
|
|
22
22
|
n((u) => {
|
|
23
23
|
const d = new Set(u);
|
|
24
|
-
return e.length > 0 && e.every((
|
|
24
|
+
return e.length > 0 && e.every((_) => d.has(_)) ? e.forEach((_) => d.delete(_)) : e.forEach((_) => d.add(_)), d;
|
|
25
25
|
});
|
|
26
26
|
}, [e]), a = B(() => n(/* @__PURE__ */ new Set()), []);
|
|
27
27
|
return { selected: t, isSelected: o, toggle: r, toggleAll: l, clear: a, allSelected: i, someSelected: s, count: t.size };
|
|
@@ -32,7 +32,7 @@ function Te(e, t) {
|
|
|
32
32
|
...e.filter((n) => !t.includes(n.id))
|
|
33
33
|
] : e;
|
|
34
34
|
}
|
|
35
|
-
const ie = (e) => e == null || typeof e == "number" && Number.isNaN(e), jt = (e, t) => typeof e == "number" && typeof t == "number" ? e - t :
|
|
35
|
+
const ie = (e) => e == null || typeof e == "number" && Number.isNaN(e), jt = (e, t) => typeof e == "number" && typeof t == "number" ? e - t : vt.compareText(String(e), String(t));
|
|
36
36
|
function Oe(e, t, n) {
|
|
37
37
|
const {
|
|
38
38
|
search: o = "",
|
|
@@ -42,134 +42,134 @@ function Oe(e, t, n) {
|
|
|
42
42
|
pageSize: l,
|
|
43
43
|
hidden: a,
|
|
44
44
|
order: u
|
|
45
|
-
} = n, d = Te(t, u), h = a != null && a.length ? d.filter((
|
|
46
|
-
const I =
|
|
47
|
-
return !ie(I) && String(I).toLowerCase().includes(
|
|
48
|
-
}),
|
|
49
|
-
const
|
|
50
|
-
if (!
|
|
51
|
-
const I =
|
|
52
|
-
return
|
|
53
|
-
const F =
|
|
54
|
-
return ie(F) || ie(
|
|
55
|
-
} : (
|
|
56
|
-
}).filter((
|
|
57
|
-
m.length > 0 &&
|
|
45
|
+
} = n, d = Te(t, u), h = a != null && a.length ? d.filter((w) => w.hideable === !1 || !a.includes(w.id)) : d, _ = o.trim().toLowerCase(), b = t.filter((w) => w.searchable && w.value), p = (w) => !_ || b.some((C) => {
|
|
46
|
+
const I = C.value(w);
|
|
47
|
+
return !ie(I) && String(I).toLowerCase().includes(_);
|
|
48
|
+
}), g = e.filter((w) => p(w) && (r ? r(w) : !0)), m = (Array.isArray(i) ? i : i ? [i] : []).map((w) => {
|
|
49
|
+
const C = t.find((T) => T.id === w.column);
|
|
50
|
+
if (!C || !C.compare && !C.value) return null;
|
|
51
|
+
const I = w.direction === "asc" ? 1 : -1, A = C.compare, S = C.value;
|
|
52
|
+
return S ? (T, L) => {
|
|
53
|
+
const F = S(T), E = S(L);
|
|
54
|
+
return ie(F) || ie(E) ? ie(F) === ie(E) ? 0 : ie(F) ? 1 : -1 : (A ? A(T, L) : jt(F, E)) * I;
|
|
55
|
+
} : (T, L) => A(T, L) * I;
|
|
56
|
+
}).filter((w) => w !== null);
|
|
57
|
+
m.length > 0 && g.sort((w, C) => {
|
|
58
58
|
for (const I of m) {
|
|
59
|
-
const A = I(
|
|
59
|
+
const A = I(w, C);
|
|
60
60
|
if (A !== 0) return A;
|
|
61
61
|
}
|
|
62
62
|
return 0;
|
|
63
63
|
});
|
|
64
|
-
const y = l && l > 0 ? l :
|
|
64
|
+
const y = l && l > 0 ? l : g.length || 1, O = Math.max(1, Math.ceil(g.length / y)), N = Math.min(Math.max(1, s), O), M = g.slice((N - 1) * y, N * y);
|
|
65
65
|
return {
|
|
66
66
|
columns: h,
|
|
67
|
-
filtered:
|
|
68
|
-
visible:
|
|
67
|
+
filtered: g,
|
|
68
|
+
visible: M,
|
|
69
69
|
page: N,
|
|
70
70
|
pageCount: O,
|
|
71
71
|
columnCount: h.length
|
|
72
72
|
};
|
|
73
73
|
}
|
|
74
74
|
function Et(e, t, n) {
|
|
75
|
-
const { rowKey: o, filter: r, defaultSort: i = null, initialView: s, virtual: l } = n, [a, u] =
|
|
76
|
-
var
|
|
77
|
-
return (
|
|
78
|
-
}), [
|
|
75
|
+
const { rowKey: o, filter: r, defaultSort: i = null, initialView: s, virtual: l } = n, [a, u] = P((s == null ? void 0 : s.search) ?? ""), [d, h] = P(() => {
|
|
76
|
+
var k;
|
|
77
|
+
return (k = s == null ? void 0 : s.sort) != null && k.length ? [...s.sort] : i ? Array.isArray(i) ? [...i] : [i] : [];
|
|
78
|
+
}), [_, b] = P((s == null ? void 0 : s.page) ?? 1), [p, g] = P(
|
|
79
79
|
(s == null ? void 0 : s.pageSize) ?? n.pageSize ?? 10
|
|
80
|
-
), [
|
|
80
|
+
), [v, m] = P([]), [y, O] = P((s == null ? void 0 : s.hidden) ?? []), [N, M] = P((s == null ? void 0 : s.order) ?? []), [w, C] = P(() => {
|
|
81
81
|
if (s != null && s.widths) return { ...s.widths };
|
|
82
|
-
const
|
|
82
|
+
const k = {};
|
|
83
83
|
for (const R of t)
|
|
84
|
-
R.width !== void 0 && (
|
|
85
|
-
return
|
|
84
|
+
R.width !== void 0 && (k[R.id] = R.width);
|
|
85
|
+
return k;
|
|
86
86
|
}), I = l ? 0 : p, A = V(
|
|
87
87
|
() => Oe(e, t, {
|
|
88
88
|
search: a,
|
|
89
89
|
filter: r,
|
|
90
90
|
sort: d,
|
|
91
|
-
page:
|
|
91
|
+
page: _,
|
|
92
92
|
pageSize: I,
|
|
93
93
|
hidden: y,
|
|
94
94
|
order: N
|
|
95
95
|
}),
|
|
96
|
-
[e, t, a, r, d,
|
|
97
|
-
),
|
|
96
|
+
[e, t, a, r, d, _, I, y, N]
|
|
97
|
+
), S = kt(l ? A.filtered.length : 0, {
|
|
98
98
|
rowHeight: (l == null ? void 0 : l.rowHeight) ?? 0,
|
|
99
99
|
overscan: l == null ? void 0 : l.overscan
|
|
100
|
-
}),
|
|
101
|
-
() => l ? A.filtered.slice(
|
|
102
|
-
[l, A.filtered, A.visible,
|
|
103
|
-
),
|
|
104
|
-
u(
|
|
105
|
-
}, []), W = B((
|
|
106
|
-
|
|
107
|
-
}, []), q = B((
|
|
100
|
+
}), T = V(
|
|
101
|
+
() => l ? A.filtered.slice(S.from, S.to) : A.visible,
|
|
102
|
+
[l, A.filtered, A.visible, S.from, S.to]
|
|
103
|
+
), L = V(() => A.filtered.map(o), [A.filtered, o]), F = zt(L), E = B((k) => {
|
|
104
|
+
u(k), b(1);
|
|
105
|
+
}, []), W = B((k) => {
|
|
106
|
+
g(k), b(1);
|
|
107
|
+
}, []), q = B((k, R = !1) => {
|
|
108
108
|
h((j) => {
|
|
109
|
-
const Y = j.find((ne) => ne.column ===
|
|
109
|
+
const Y = j.find((ne) => ne.column === k);
|
|
110
110
|
if (!R) {
|
|
111
111
|
const ne = j.length === 1 && (Y == null ? void 0 : Y.direction) === "asc" ? "desc" : "asc";
|
|
112
|
-
return [{ column:
|
|
112
|
+
return [{ column: k, direction: ne }];
|
|
113
113
|
}
|
|
114
114
|
return Y ? Y.direction === "asc" ? j.map(
|
|
115
|
-
(ne) => ne.column ===
|
|
116
|
-
) : j.filter((ne) => ne.column !==
|
|
117
|
-
}),
|
|
118
|
-
}, []),
|
|
115
|
+
(ne) => ne.column === k ? { column: k, direction: "desc" } : ne
|
|
116
|
+
) : j.filter((ne) => ne.column !== k) : [...j, { column: k, direction: "asc" }];
|
|
117
|
+
}), b(1);
|
|
118
|
+
}, []), D = B((k) => {
|
|
119
119
|
m(
|
|
120
|
-
(R) => R.includes(
|
|
120
|
+
(R) => R.includes(k) ? R.filter((j) => j !== k) : [...R, k]
|
|
121
121
|
);
|
|
122
122
|
}, []), K = B(
|
|
123
|
-
(
|
|
124
|
-
[
|
|
125
|
-
),
|
|
123
|
+
(k) => v.includes(k),
|
|
124
|
+
[v]
|
|
125
|
+
), ve = B((k) => {
|
|
126
126
|
O(
|
|
127
|
-
(R) => R.includes(
|
|
127
|
+
(R) => R.includes(k) ? R.filter((j) => j !== k) : [...R, k]
|
|
128
128
|
);
|
|
129
|
-
}, []), ht = B((
|
|
130
|
-
|
|
129
|
+
}, []), ht = B((k, R) => {
|
|
130
|
+
C((j) => {
|
|
131
131
|
if (R === void 0) {
|
|
132
|
-
if (!(
|
|
132
|
+
if (!(k in j)) return j;
|
|
133
133
|
const Y = { ...j };
|
|
134
|
-
return delete Y[
|
|
134
|
+
return delete Y[k], Y;
|
|
135
135
|
}
|
|
136
|
-
return { ...j, [
|
|
136
|
+
return { ...j, [k]: R };
|
|
137
137
|
});
|
|
138
138
|
}, []), mt = B(
|
|
139
|
-
(
|
|
139
|
+
(k) => {
|
|
140
140
|
var R;
|
|
141
|
-
return (R = d.find((j) => j.column ===
|
|
141
|
+
return (R = d.find((j) => j.column === k)) == null ? void 0 : R.direction;
|
|
142
142
|
},
|
|
143
143
|
[d]
|
|
144
144
|
), pt = B(
|
|
145
|
-
(
|
|
145
|
+
(k) => {
|
|
146
146
|
if (d.length < 2) return;
|
|
147
|
-
const R = d.findIndex((j) => j.column ===
|
|
147
|
+
const R = d.findIndex((j) => j.column === k);
|
|
148
148
|
return R === -1 ? void 0 : R + 1;
|
|
149
149
|
},
|
|
150
150
|
[d]
|
|
151
|
-
),
|
|
152
|
-
() => Te(t, N).filter((
|
|
151
|
+
), bt = V(
|
|
152
|
+
() => Te(t, N).filter((k) => k.label !== void 0 && k.hideable !== !1).map((k) => ({ id: k.id, label: k.label, visible: !y.includes(k.id) })),
|
|
153
153
|
[t, N, y]
|
|
154
154
|
), Le = n.pageSize ?? 10, ze = V(() => {
|
|
155
|
-
const
|
|
155
|
+
const k = {};
|
|
156
156
|
for (const R of t)
|
|
157
|
-
R.width !== void 0 && (
|
|
158
|
-
return
|
|
159
|
-
}, [t]),
|
|
160
|
-
const
|
|
161
|
-
for (const [R, j] of Object.entries(
|
|
162
|
-
ze[R] !== j && (
|
|
163
|
-
return
|
|
164
|
-
}, [
|
|
157
|
+
R.width !== void 0 && (k[R.id] = R.width);
|
|
158
|
+
return k;
|
|
159
|
+
}, [t]), ke = V(() => {
|
|
160
|
+
const k = {};
|
|
161
|
+
for (const [R, j] of Object.entries(w))
|
|
162
|
+
ze[R] !== j && (k[R] = j);
|
|
163
|
+
return k;
|
|
164
|
+
}, [w, ze]), ye = V(
|
|
165
165
|
() => i ? Array.isArray(i) ? i : [i] : [],
|
|
166
166
|
[i]
|
|
167
167
|
), je = d.length === ye.length && d.every(
|
|
168
|
-
(
|
|
168
|
+
(k, R) => {
|
|
169
169
|
var j, Y;
|
|
170
|
-
return
|
|
170
|
+
return k.column === ((j = ye[R]) == null ? void 0 : j.column) && k.direction === ((Y = ye[R]) == null ? void 0 : Y.direction);
|
|
171
171
|
}
|
|
172
|
-
),
|
|
172
|
+
), gt = V(
|
|
173
173
|
() => ({
|
|
174
174
|
...a ? { search: a } : {},
|
|
175
175
|
...d.length && !je ? { sort: d } : {},
|
|
@@ -180,7 +180,7 @@ function Et(e, t, n) {
|
|
|
180
180
|
...!l && p !== Le ? { pageSize: p } : {},
|
|
181
181
|
...y.length ? { hidden: y } : {},
|
|
182
182
|
...N.length ? { order: N } : {},
|
|
183
|
-
...Object.keys(
|
|
183
|
+
...Object.keys(ke).length ? { widths: ke } : {}
|
|
184
184
|
}),
|
|
185
185
|
[
|
|
186
186
|
l,
|
|
@@ -192,32 +192,32 @@ function Et(e, t, n) {
|
|
|
192
192
|
Le,
|
|
193
193
|
y,
|
|
194
194
|
N,
|
|
195
|
-
|
|
195
|
+
ke
|
|
196
196
|
]
|
|
197
197
|
);
|
|
198
198
|
return {
|
|
199
199
|
...A,
|
|
200
|
-
visible:
|
|
201
|
-
virtual: l ?
|
|
202
|
-
view:
|
|
200
|
+
visible: T,
|
|
201
|
+
virtual: l ? S : void 0,
|
|
202
|
+
view: gt,
|
|
203
203
|
search: a,
|
|
204
|
-
setSearch:
|
|
204
|
+
setSearch: E,
|
|
205
205
|
sort: d,
|
|
206
206
|
toggleSort: q,
|
|
207
207
|
sortDirectionOf: mt,
|
|
208
208
|
sortRankOf: pt,
|
|
209
|
-
setPage:
|
|
209
|
+
setPage: b,
|
|
210
210
|
pageSize: p,
|
|
211
211
|
setPageSize: W,
|
|
212
|
-
expanded:
|
|
213
|
-
toggleRow:
|
|
212
|
+
expanded: v,
|
|
213
|
+
toggleRow: D,
|
|
214
214
|
isExpanded: K,
|
|
215
215
|
hidden: y,
|
|
216
|
-
toggleColumn:
|
|
217
|
-
columnChoices:
|
|
216
|
+
toggleColumn: ve,
|
|
217
|
+
columnChoices: bt,
|
|
218
218
|
order: N,
|
|
219
|
-
setOrder:
|
|
220
|
-
widths:
|
|
219
|
+
setOrder: M,
|
|
220
|
+
widths: w,
|
|
221
221
|
setWidth: ht,
|
|
222
222
|
selection: F
|
|
223
223
|
};
|
|
@@ -232,19 +232,19 @@ function re(e, t) {
|
|
|
232
232
|
!Ye || Me.has(e) || (Me.add(e), console.warn(`@umriss-ui/table: ${t}`));
|
|
233
233
|
}
|
|
234
234
|
const U = (e) => e == null || typeof e == "number" && Number.isNaN(e);
|
|
235
|
-
function
|
|
235
|
+
function we(e) {
|
|
236
236
|
return U(e) ? "empty" : typeof e == "string" ? "text" : typeof e == "number" ? "number" : typeof e == "boolean" ? "boolean" : e instanceof Date ? Number.isNaN(e.getTime()) ? "empty" : "date" : "other";
|
|
237
237
|
}
|
|
238
238
|
function Mt(e, t) {
|
|
239
239
|
for (const n of e) {
|
|
240
|
-
const o =
|
|
240
|
+
const o = we(t(n));
|
|
241
241
|
if (o !== "empty") return o;
|
|
242
242
|
}
|
|
243
243
|
return "empty";
|
|
244
244
|
}
|
|
245
245
|
const Xe = (e, t) => t ?? e === "number";
|
|
246
246
|
function ae(e, t, n, o) {
|
|
247
|
-
switch (
|
|
247
|
+
switch (we(e)) {
|
|
248
248
|
case "text":
|
|
249
249
|
return e;
|
|
250
250
|
case "number": {
|
|
@@ -264,7 +264,7 @@ function ae(e, t, n, o) {
|
|
|
264
264
|
function Je(e, t) {
|
|
265
265
|
if (!U(e)) {
|
|
266
266
|
if (t) return Je(t(e));
|
|
267
|
-
switch (
|
|
267
|
+
switch (we(e)) {
|
|
268
268
|
case "text":
|
|
269
269
|
return e;
|
|
270
270
|
case "number":
|
|
@@ -282,7 +282,7 @@ const Dt = "ja", Vt = "nein";
|
|
|
282
282
|
function Qe(e, t) {
|
|
283
283
|
if (!U(e)) {
|
|
284
284
|
if (t) return Qe(t(e));
|
|
285
|
-
switch (
|
|
285
|
+
switch (we(e)) {
|
|
286
286
|
case "text":
|
|
287
287
|
return e;
|
|
288
288
|
case "number":
|
|
@@ -305,7 +305,7 @@ function Ht(e, t, n) {
|
|
|
305
305
|
if (r !== 0)
|
|
306
306
|
return n === "sum" ? o : o / r;
|
|
307
307
|
}
|
|
308
|
-
const Re = "absent", le = (e) => U(e) ? Re : e instanceof Date ? `value:${e.getTime()}` : `value:${String(e)}`, Bt = "
|
|
308
|
+
const Re = "absent", le = (e) => U(e) ? Re : e instanceof Date ? `value:${e.getTime()}` : `value:${String(e)}`, Bt = "_frame_10bwr_11 _text_18b86_23", $t = "_children_10bwr_23", Wt = "_scroll_10bwr_29 _scroll_18b86_40", Kt = "_footerTarget_10bwr_36", Gt = "_table_10bwr_40", Ut = "_th_10bwr_48 _ring_18b86_65", qt = "_sticky_10bwr_63", Yt = "_td_10bwr_71", Xt = "_rowHeader_10bwr_83", Jt = "_compact_10bwr_99", Qt = "_numeric_10bwr_114", Zt = "_absent_10bwr_126", en = "_striped_10bwr_130", tn = "_stickyCell_10bwr_154", nn = "_sortButton_10bwr_166 _ring_18b86_65", on = "_sortIndicator_10bwr_191", rn = "_sortArrow_10bwr_198", sn = "_sortArrowDesc_10bwr_202", ln = "_sortActive_10bwr_210", cn = "_sortRank_10bwr_216", an = "_thFlex_10bwr_224", dn = "_footerKind_10bwr_245", un = "_emptyCell_10bwr_253", fn = "_empty_10bwr_253", hn = "_emptyTitle_10bwr_269", mn = "_skeleton_10bwr_276", pn = "_toolbar_10bwr_304 _text_18b86_23", bn = "_toolbarGroup_10bwr_318", gn = "_toolbarInfo_10bwr_335", wn = "_pagination_10bwr_341 _text_18b86_23", _n = "_paginationControls_10bwr_354", vn = "_pageSize_10bwr_361", kn = "_paginationStatus_10bwr_373", yn = "_filterButton_10bwr_382 _ring_18b86_65", Cn = "_filterActive_10bwr_405", Sn = "_filterPanel_10bwr_410", Nn = "_filterContent_10bwr_423 _scroll_18b86_40", An = "_filterFooter_10bwr_434", xn = "_filterLabel_10bwr_448", Tn = "_filterValue_10bwr_458", On = "_filteredCount_10bwr_464", Rn = "_rangeFields_10bwr_475", In = "_rangePeriod_10bwr_485", Fn = "_conditions_10bwr_491", Ln = "_conditionButton_10bwr_497", zn = "_condition_10bwr_491", jn = "_columnsPanel_10bwr_521", En = "_columnsList_10bwr_529", Pn = "_columnsEntry_10bwr_538", Mn = "_move_10bwr_550", Dn = "_expander_10bwr_585", Vn = "_expanderOpen_10bwr_616", Hn = "_detailRow_10bwr_620", Bn = "_detailCell_10bwr_620", $n = "_actionsCell_10bwr_628", Wn = "_actions_10bwr_628", Kn = "_grip_10bwr_656", Gn = "_virtualBody_10bwr_697", Un = "_virtualRow_10bwr_705", qn = "_fillerRow_10bwr_710", Yn = "_control_10bwr_145", f = {
|
|
309
309
|
frame: Bt,
|
|
310
310
|
children: $t,
|
|
311
311
|
scroll: Wt,
|
|
@@ -333,12 +333,12 @@ const Re = "absent", le = (e) => U(e) ? Re : e instanceof Date ? `value:${e.getT
|
|
|
333
333
|
emptyTitle: hn,
|
|
334
334
|
skeleton: mn,
|
|
335
335
|
toolbar: pn,
|
|
336
|
-
toolbarGroup:
|
|
337
|
-
toolbarInfo:
|
|
338
|
-
pagination:
|
|
336
|
+
toolbarGroup: bn,
|
|
337
|
+
toolbarInfo: gn,
|
|
338
|
+
pagination: wn,
|
|
339
339
|
paginationControls: _n,
|
|
340
|
-
pageSize:
|
|
341
|
-
paginationStatus:
|
|
340
|
+
pageSize: vn,
|
|
341
|
+
paginationStatus: kn,
|
|
342
342
|
filterButton: yn,
|
|
343
343
|
filterActive: Cn,
|
|
344
344
|
filterPanel: Sn,
|
|
@@ -424,16 +424,16 @@ function eo({
|
|
|
424
424
|
format: r
|
|
425
425
|
}) {
|
|
426
426
|
const i = te(), s = $(), l = V(() => e ?? [], [e]), a = V(() => {
|
|
427
|
-
const h = { formats: i, wording: s, format: r },
|
|
428
|
-
|
|
429
|
-
const
|
|
430
|
-
return [...
|
|
427
|
+
const h = { formats: i, wording: s, format: r }, _ = n.map((v) => ({ key: le(v), text: Ne(v, h), value: v }));
|
|
428
|
+
_.sort(tt(i));
|
|
429
|
+
const b = new Set(_.map((v) => v.key)), p = l.filter((v) => !U(v) && !b.has(le(v))).map((v) => ({ key: le(v), text: Ne(v, h), value: v })), g = o || l.some(U) ? [{ key: Re, text: s.cellAbsentValue, value: null }] : [];
|
|
430
|
+
return [..._, ...p, ...g];
|
|
431
431
|
}, [n, l, o, r, i, s]), u = Se(l), d = (h) => {
|
|
432
|
-
const
|
|
433
|
-
t(
|
|
432
|
+
const _ = u.has(h.key) ? l.filter((b) => le(b) !== h.key) : [...l, h.value];
|
|
433
|
+
t(_.length > 0 ? _ : null);
|
|
434
434
|
};
|
|
435
435
|
return /* @__PURE__ */ c("div", { className: f.filterContent, children: a.map((h) => /* @__PURE__ */ c(
|
|
436
|
-
|
|
436
|
+
be,
|
|
437
437
|
{
|
|
438
438
|
label: h.text,
|
|
439
439
|
checked: u.has(h.key),
|
|
@@ -463,7 +463,7 @@ const to = Ze(
|
|
|
463
463
|
}
|
|
464
464
|
), no = (e) => new Date(e.getFullYear(), e.getMonth(), e.getDate()).getTime(), oo = (e) => new Date(e.getFullYear(), e.getMonth(), e.getDate() + 1).getTime(), ce = (e) => typeof e == "number" && Number.isFinite(e), ee = (e) => e instanceof Date && !Number.isNaN(e.getTime()), ro = (e) => ee(e) ? no(e) : ce(e) ? e : void 0, so = (e) => ee(e) ? { value: oo(e), open: !0 } : ce(e) ? { value: e, open: !1 } : void 0, fe = (e, t) => ee(e) ? t.formats.date(e) : ae(e, t.format, t.formats, t.wording) ?? String(e);
|
|
465
465
|
function io({ condition: e, setCondition: t }) {
|
|
466
|
-
const n = $(), [o, r] =
|
|
466
|
+
const n = $(), [o, r] = P(null), i = o !== null, s = o ? o.from : ce(e == null ? void 0 : e.from) ? e.from : null, l = o ? o.to : ce(e == null ? void 0 : e.to) ? e.to : null, a = (u, d) => {
|
|
467
467
|
const h = { from: s, to: l, [u]: d };
|
|
468
468
|
if (h.from !== null && h.to !== null && h.from > h.to) {
|
|
469
469
|
r(h);
|
|
@@ -478,7 +478,7 @@ function io({ condition: e, setCondition: t }) {
|
|
|
478
478
|
...h.to !== null ? { to: h.to } : {}
|
|
479
479
|
});
|
|
480
480
|
};
|
|
481
|
-
return /* @__PURE__ */
|
|
481
|
+
return /* @__PURE__ */ x("div", { className: f.rangeFields, children: [
|
|
482
482
|
/* @__PURE__ */ c(Ee, { label: n.filterFrom, children: /* @__PURE__ */ c(Pe, { size: "sm", value: s, invalid: i, onChange: (u) => a("from", u) }) }),
|
|
483
483
|
/* @__PURE__ */ c(Ee, { label: n.filterTo, error: i ? n.rangeInvalid : void 0, children: /* @__PURE__ */ c(Pe, { size: "sm", value: l, onChange: (u) => a("to", u) }) })
|
|
484
484
|
] });
|
|
@@ -530,11 +530,11 @@ const ao = Ze(
|
|
|
530
530
|
);
|
|
531
531
|
class He {
|
|
532
532
|
constructor(t) {
|
|
533
|
-
|
|
533
|
+
z(this, "entries", /* @__PURE__ */ new Map());
|
|
534
534
|
/** Keys in the order of the running pass. */
|
|
535
|
-
|
|
535
|
+
z(this, "pass", []);
|
|
536
536
|
/** Order from the markers in the DOM, after the last commit. */
|
|
537
|
-
|
|
537
|
+
z(this, "dom", []);
|
|
538
538
|
this.markerAttribute = t;
|
|
539
539
|
}
|
|
540
540
|
note(t) {
|
|
@@ -576,47 +576,47 @@ const uo = (e) => JSON.stringify([
|
|
|
576
576
|
]), fo = (e, t) => e == null ? void 0 : e[t];
|
|
577
577
|
class ho {
|
|
578
578
|
constructor() {
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
579
|
+
z(this, "columns", new He("data-umriss-column"));
|
|
580
|
+
z(this, "actions", new He("data-umriss-action"));
|
|
581
|
+
z(this, "signatures", /* @__PURE__ */ new Map());
|
|
582
582
|
/** The row detail: the presentation of the `RowDetail` that registered last. */
|
|
583
|
-
|
|
583
|
+
z(this, "detail", null);
|
|
584
584
|
/** How many `RowActions` stand right now. */
|
|
585
|
-
|
|
585
|
+
z(this, "actionGroups", /* @__PURE__ */ new Set());
|
|
586
586
|
/** Whether the row header column sticks - it then stands first, on screen, in
|
|
587
587
|
the column menu and in the export alike. */
|
|
588
|
-
|
|
588
|
+
z(this, "stickyRowHeader", !1);
|
|
589
589
|
/* Without a pagination bar the table does not page: one that stops quietly at
|
|
590
590
|
the tenth row because nobody put one there is a trap (found at the alarm
|
|
591
591
|
list, umriss-table 13). Without a table toolbar, but with a search or a
|
|
592
592
|
column filter, the table puts one there itself (table-filters 04):
|
|
593
593
|
conditions and the ratio need a place, and a place that came into being
|
|
594
594
|
only with the first condition would shift the table. */
|
|
595
|
-
|
|
595
|
+
z(this, "parts", /* @__PURE__ */ new Map());
|
|
596
596
|
/** The element the table's children stand in - for the markers. */
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
597
|
+
z(this, "children", null);
|
|
598
|
+
z(this, "hook", null);
|
|
599
|
+
z(this, "structure", 0);
|
|
600
|
+
z(this, "values", 0);
|
|
601
|
+
z(this, "presentation", 0);
|
|
602
|
+
z(this, "hookVersion", 0);
|
|
603
|
+
z(this, "reported", "");
|
|
604
|
+
z(this, "listeners", /* @__PURE__ */ new Set());
|
|
605
605
|
/* --- Subscription ------------------------------------------------------------- */
|
|
606
|
-
|
|
606
|
+
z(this, "subscribe", (t) => (this.listeners.add(t), () => {
|
|
607
607
|
this.listeners.delete(t);
|
|
608
608
|
}));
|
|
609
609
|
/** What the hook reads. */
|
|
610
|
-
|
|
610
|
+
z(this, "structureVersion", () => this.structure);
|
|
611
611
|
/** What body and unbound parts read. Every counter only rises, so the sum
|
|
612
612
|
rises exactly when one of them rises. */
|
|
613
|
-
|
|
613
|
+
z(this, "bodyVersion", () => this.structure + this.values + this.presentation + this.hookVersion);
|
|
614
614
|
/* --- The kind of a column ------------------------------------------------------- */
|
|
615
|
-
|
|
615
|
+
z(this, "kinds", /* @__PURE__ */ new Map());
|
|
616
616
|
/* --- The model ------------------------------------------------------------------ */
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
617
|
+
z(this, "modelCache", null);
|
|
618
|
+
z(this, "projectionCache", null);
|
|
619
|
+
z(this, "unpaged", null);
|
|
620
620
|
}
|
|
621
621
|
/** Reports from a layout effect what has changed since the last report.
|
|
622
622
|
Without a change nothing happens. */
|
|
@@ -664,7 +664,7 @@ class ho {
|
|
|
664
664
|
this.columns.entries.has(t) || this.registerColumn(t, n);
|
|
665
665
|
}
|
|
666
666
|
removeColumn(t) {
|
|
667
|
-
this.columns.entries.delete(t) && (this.signatures.delete(t), this.structure++);
|
|
667
|
+
this.columns.entries.delete(t) && (this.signatures.delete(t), this.kinds.delete(t), this.structure++);
|
|
668
668
|
}
|
|
669
669
|
checkUniqueness() {
|
|
670
670
|
const t = /* @__PURE__ */ new Set();
|
|
@@ -719,14 +719,14 @@ class ho {
|
|
|
719
719
|
if (((s = this.modelCache) == null ? void 0 : s.key) === r && this.modelCache.rows === t && this.modelCache.formats === n)
|
|
720
720
|
return this.modelCache.columns;
|
|
721
721
|
const i = o.map((l) => {
|
|
722
|
-
const { spec: a } = l, u = this.kindOf(l, t), d = this.isSortable(l, t), h = a.searchable ?? u === "text",
|
|
722
|
+
const { spec: a } = l, u = this.kindOf(l, t), d = this.isSortable(l, t), h = a.searchable ?? u === "text", _ = (b) => Je(l.read(b), a.ownSortValue);
|
|
723
723
|
return {
|
|
724
724
|
id: a.id,
|
|
725
725
|
label: a.label,
|
|
726
|
-
value: d || h ?
|
|
726
|
+
value: d || h ? _ : void 0,
|
|
727
727
|
/* Text sorts with the provider's comparison, not with the built-in
|
|
728
728
|
German one (spec, the table of defaults). */
|
|
729
|
-
compare: u === "text" && !a.ownSortValue ? (
|
|
729
|
+
compare: u === "text" && !a.ownSortValue ? (b, p) => n.compareText(String(_(b)), String(_(p))) : void 0,
|
|
730
730
|
searchable: h,
|
|
731
731
|
hideable: !a.rowHeader,
|
|
732
732
|
resizable: a.resizable,
|
|
@@ -840,13 +840,13 @@ function ot({
|
|
|
840
840
|
setOpen: s,
|
|
841
841
|
panelId: l
|
|
842
842
|
}) {
|
|
843
|
-
const a = $(), u = te(), { id: d, label: h, format:
|
|
844
|
-
if (!
|
|
845
|
-
const
|
|
843
|
+
const a = $(), u = te(), { id: d, label: h, format: _ } = e.spec, { values: b, absent: p } = V(() => Zn(n.admitted, e.read, u), [n.admitted, e, u]), g = se(e.spec.filter);
|
|
844
|
+
if (!g) return null;
|
|
845
|
+
const v = n.publicSnapshot, m = g.Input, y = Xn(g) ? { absentOccurs: p, format: _, kind: t.kindOf(e, n.rows) } : {}, O = () => {
|
|
846
846
|
var N;
|
|
847
847
|
s(!1), (N = (r ?? o).current) == null || N.focus();
|
|
848
848
|
};
|
|
849
|
-
return /* @__PURE__ */
|
|
849
|
+
return /* @__PURE__ */ x(
|
|
850
850
|
Ue,
|
|
851
851
|
{
|
|
852
852
|
open: i,
|
|
@@ -861,28 +861,28 @@ function ot({
|
|
|
861
861
|
/* @__PURE__ */ c(
|
|
862
862
|
m,
|
|
863
863
|
{
|
|
864
|
-
condition:
|
|
865
|
-
setCondition: (N) =>
|
|
866
|
-
values:
|
|
864
|
+
condition: v.filter[d] ?? null,
|
|
865
|
+
setCondition: (N) => v.setFilter(d, N),
|
|
866
|
+
values: b,
|
|
867
867
|
column: { id: d, label: h },
|
|
868
868
|
...y
|
|
869
869
|
}
|
|
870
870
|
),
|
|
871
|
-
/* @__PURE__ */
|
|
872
|
-
/* @__PURE__ */ c(G, { size: "sm", variant: "ghost", onClick: () =>
|
|
871
|
+
/* @__PURE__ */ x("div", { className: f.filterFooter, children: [
|
|
872
|
+
/* @__PURE__ */ c(G, { size: "sm", variant: "ghost", onClick: () => v.setFilter(d, null), children: a.filterReset }),
|
|
873
873
|
/* @__PURE__ */ c(G, { size: "sm", onClick: O, children: a.filterDone })
|
|
874
874
|
] })
|
|
875
875
|
]
|
|
876
876
|
}
|
|
877
877
|
);
|
|
878
878
|
}
|
|
879
|
-
function
|
|
879
|
+
function bo({
|
|
880
880
|
entry: e,
|
|
881
881
|
registry: t,
|
|
882
882
|
hook: n
|
|
883
883
|
}) {
|
|
884
|
-
const o = $(), [r, i] =
|
|
885
|
-
return /* @__PURE__ */
|
|
884
|
+
const o = $(), [r, i] = P(!1), s = oe(null), l = Z(), { id: a, label: u } = e.spec, d = a in n.publicSnapshot.filter;
|
|
885
|
+
return /* @__PURE__ */ x(Q, { children: [
|
|
886
886
|
/* @__PURE__ */ c(
|
|
887
887
|
"button",
|
|
888
888
|
{
|
|
@@ -921,23 +921,23 @@ function go({
|
|
|
921
921
|
)
|
|
922
922
|
] });
|
|
923
923
|
}
|
|
924
|
-
function
|
|
924
|
+
function go({ registry: e, hook: t }) {
|
|
925
925
|
const n = $(), o = te(), r = Object.entries(t.publicSnapshot.filter).flatMap(([i, s]) => {
|
|
926
926
|
const l = e.columnById(i), a = l ? se(l.spec.filter) : void 0;
|
|
927
927
|
if (!l || !a) return [];
|
|
928
928
|
const u = { formats: o, wording: n, format: l.spec.format, kind: e.kindOf(l, t.rows) };
|
|
929
929
|
return [{ entry: l, text: Qn(a, s, u) }];
|
|
930
930
|
});
|
|
931
|
-
return r.length === 0 ? null : /* @__PURE__ */ c(Ct, { "aria-label": n.conditions, className: f.conditions, children: r.map(({ entry: i, text: s }) => /* @__PURE__ */ c(
|
|
931
|
+
return r.length === 0 ? null : /* @__PURE__ */ c(Ct, { "aria-label": n.conditions, className: f.conditions, children: r.map(({ entry: i, text: s }) => /* @__PURE__ */ c(wo, { entry: i, text: s, registry: e, hook: t }, i.spec.id)) });
|
|
932
932
|
}
|
|
933
|
-
function
|
|
933
|
+
function wo({
|
|
934
934
|
entry: e,
|
|
935
935
|
text: t,
|
|
936
936
|
registry: n,
|
|
937
937
|
hook: o
|
|
938
938
|
}) {
|
|
939
|
-
const r = $(), [i, s] =
|
|
940
|
-
return /* @__PURE__ */
|
|
939
|
+
const r = $(), [i, s] = P(!1), l = oe(null), a = oe(null), u = Z(), { id: d, label: h } = e.spec;
|
|
940
|
+
return /* @__PURE__ */ x(Q, { children: [
|
|
941
941
|
/* @__PURE__ */ c(
|
|
942
942
|
St,
|
|
943
943
|
{
|
|
@@ -945,7 +945,7 @@ function ko({
|
|
|
945
945
|
className: f.condition,
|
|
946
946
|
onRemove: () => o.publicSnapshot.setFilter(d, null),
|
|
947
947
|
removeLabel: r.removeConditionNamed(h, t),
|
|
948
|
-
children: /* @__PURE__ */
|
|
948
|
+
children: /* @__PURE__ */ x(
|
|
949
949
|
"button",
|
|
950
950
|
{
|
|
951
951
|
ref: a,
|
|
@@ -980,14 +980,14 @@ function ko({
|
|
|
980
980
|
] });
|
|
981
981
|
}
|
|
982
982
|
const Be = ";", _o = `\r
|
|
983
|
-
`,
|
|
983
|
+
`, vo = "\uFEFF", ko = (e) => String(e).replace(".", ","), rt = (e) => /[";\r\n]/.test(e) ? `"${e.replace(/"/g, '""')}"` : e, yo = (e, t) => {
|
|
984
984
|
var o;
|
|
985
985
|
const n = (o = t.value) == null ? void 0 : o.call(t, e);
|
|
986
|
-
return n == null ? "" : rt(typeof n == "number" ?
|
|
986
|
+
return n == null ? "" : rt(typeof n == "number" ? ko(n) : String(n));
|
|
987
987
|
};
|
|
988
988
|
function Co(e, t) {
|
|
989
989
|
const n = t.map((r) => rt(r.label ?? r.id)).join(Be), o = e.map((r) => t.map((i) => yo(r, i)).join(Be));
|
|
990
|
-
return
|
|
990
|
+
return vo + [n, ...o].join(_o);
|
|
991
991
|
}
|
|
992
992
|
function st(e) {
|
|
993
993
|
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);
|
|
@@ -1018,13 +1018,13 @@ function lt({
|
|
|
1018
1018
|
const r = $(), i = te(), s = (e == null ? void 0 : e.hook) ?? null;
|
|
1019
1019
|
let l = null, a = null;
|
|
1020
1020
|
if (e && s) {
|
|
1021
|
-
const u = s.publicSnapshot, d = u.search !== "" || Object.keys(u.filter).length > 0, h = o ? [] : u.filtered.filter((
|
|
1022
|
-
l = /* @__PURE__ */ c(
|
|
1021
|
+
const u = s.publicSnapshot, d = u.search !== "" || Object.keys(u.filter).length > 0, h = o ? [] : u.filtered.filter((b) => u.selection.isSelected(s.rowKey(b))), _ = e.hasRowActions() ? e.actions.ordered().filter((b) => b.spec.bulk) : [];
|
|
1022
|
+
l = /* @__PURE__ */ c(go, { registry: e, hook: s }), a = /* @__PURE__ */ x("div", { className: f.toolbarGroup, children: [
|
|
1023
1023
|
/* @__PURE__ */ c("span", { role: "status", className: f.filteredCount, children: d ? r.filteredOfTotal(i.count(u.filtered.length), i.count(s.admitted.length)) : "" }),
|
|
1024
1024
|
d && /* @__PURE__ */ c(G, { size: "sm", variant: "ghost", onClick: () => it(u), children: r.resetAll }),
|
|
1025
|
-
h.length > 0 && /* @__PURE__ */
|
|
1025
|
+
h.length > 0 && /* @__PURE__ */ x(Q, { children: [
|
|
1026
1026
|
/* @__PURE__ */ c("span", { className: f.toolbarInfo, children: r.selectedCount(h.length, i.count(h.length)) }),
|
|
1027
|
-
|
|
1027
|
+
_.map(({ key: b, spec: p }) => /* @__PURE__ */ c(
|
|
1028
1028
|
G,
|
|
1029
1029
|
{
|
|
1030
1030
|
size: "sm",
|
|
@@ -1032,13 +1032,13 @@ function lt({
|
|
|
1032
1032
|
onClick: () => p.onSelect(h),
|
|
1033
1033
|
children: p.label
|
|
1034
1034
|
},
|
|
1035
|
-
|
|
1035
|
+
b
|
|
1036
1036
|
))
|
|
1037
1037
|
] })
|
|
1038
1038
|
] });
|
|
1039
1039
|
}
|
|
1040
|
-
return /* @__PURE__ */
|
|
1041
|
-
/* @__PURE__ */
|
|
1040
|
+
return /* @__PURE__ */ x("div", { className: H(f.toolbar, t), children: [
|
|
1041
|
+
/* @__PURE__ */ x("div", { className: f.toolbarGroup, children: [
|
|
1042
1042
|
n,
|
|
1043
1043
|
l
|
|
1044
1044
|
] }),
|
|
@@ -1080,9 +1080,9 @@ function Ao(e) {
|
|
|
1080
1080
|
};
|
|
1081
1081
|
}
|
|
1082
1082
|
function ct({ wording: e }) {
|
|
1083
|
-
return /* @__PURE__ */
|
|
1083
|
+
return /* @__PURE__ */ x(Q, { children: [
|
|
1084
1084
|
/* @__PURE__ */ c("span", { "aria-hidden": "true", className: f.absent, children: "—" }),
|
|
1085
|
-
/* @__PURE__ */ c(
|
|
1085
|
+
/* @__PURE__ */ c(ge, { children: e.cellAbsentValue })
|
|
1086
1086
|
] });
|
|
1087
1087
|
}
|
|
1088
1088
|
function xo(e, t, n, o, r) {
|
|
@@ -1146,12 +1146,12 @@ function To(e) {
|
|
|
1146
1146
|
}
|
|
1147
1147
|
function i(l) {
|
|
1148
1148
|
e.beginPass(), e.setStickyRowHeader(l.stickyRowHeader === !0);
|
|
1149
|
-
const a = oe(null), [u, d] =
|
|
1149
|
+
const a = oe(null), [u, d] = P(null);
|
|
1150
1150
|
J(() => {
|
|
1151
1151
|
e.children = a.current, e.checkOrder(), e.commit();
|
|
1152
1152
|
});
|
|
1153
1153
|
const h = V(() => ({ registry: e, footerTarget: u }), [u]);
|
|
1154
|
-
return /* @__PURE__ */ c(Ae.Provider, { value: h, children: /* @__PURE__ */
|
|
1154
|
+
return /* @__PURE__ */ c(Ae.Provider, { value: h, children: /* @__PURE__ */ x("div", { className: H(f.frame, l.className), children: [
|
|
1155
1155
|
/* @__PURE__ */ c("div", { ref: a, className: f.children, children: l.children }),
|
|
1156
1156
|
/* @__PURE__ */ c(Oo, { registry: e }),
|
|
1157
1157
|
/* @__PURE__ */ c(Ro, { registry: e, props: l }),
|
|
@@ -1178,46 +1178,47 @@ function Ro({ registry: e, props: t }) {
|
|
|
1178
1178
|
ariaLabel: h
|
|
1179
1179
|
} = t;
|
|
1180
1180
|
pe(e.subscribe, e.bodyVersion, e.bodyVersion);
|
|
1181
|
-
const
|
|
1182
|
-
if (!
|
|
1183
|
-
const m =
|
|
1181
|
+
const _ = $(), b = te(), p = qe(s, "regular"), g = Z(), v = e.hook;
|
|
1182
|
+
if (!v) return null;
|
|
1183
|
+
const m = v.publicSnapshot, y = e.projection(), O = e.rowHeader(), N = st(e), M = e.detail, w = e.hasRowActions() ? e.actions.ordered() : [], C = v.companion.virtual, I = (n ? 1 : 0) + (M ? 1 : 0), A = I + N.length + (w.length > 0 ? 1 : 0), S = I * me, T = (D) => r && D === O, L = y.visible, F = !u && N.some((D) => D.spec.footer), E = m.search !== "" || Object.keys(m.filter).length > 0, W = (D, K, ve) => /* @__PURE__ */ c(
|
|
1184
1184
|
Fo,
|
|
1185
1185
|
{
|
|
1186
|
-
row:
|
|
1186
|
+
row: D,
|
|
1187
1187
|
index: K,
|
|
1188
|
-
absolute:
|
|
1188
|
+
absolute: C ? ve : void 0,
|
|
1189
1189
|
registry: e,
|
|
1190
|
-
hook:
|
|
1190
|
+
hook: v,
|
|
1191
1191
|
columns: N,
|
|
1192
1192
|
header: O,
|
|
1193
1193
|
selectable: n,
|
|
1194
|
-
actions:
|
|
1194
|
+
actions: w,
|
|
1195
1195
|
stickyRowHeader: r,
|
|
1196
|
-
rowHeaderLeft:
|
|
1196
|
+
rowHeaderLeft: S,
|
|
1197
1197
|
columnCount: A,
|
|
1198
1198
|
rowProps: d,
|
|
1199
|
-
baseId:
|
|
1200
|
-
formats:
|
|
1201
|
-
wording:
|
|
1199
|
+
baseId: g,
|
|
1200
|
+
formats: b,
|
|
1201
|
+
wording: _
|
|
1202
1202
|
},
|
|
1203
|
-
|
|
1203
|
+
v.rowKey(D)
|
|
1204
1204
|
);
|
|
1205
1205
|
let q;
|
|
1206
|
-
return u ? q = /* @__PURE__ */ c("tbody", { children: /* @__PURE__ */ c(Po, { columns: A }) }) : y.filtered.length === 0 ? q = /* @__PURE__ */ c("tbody", { children: /* @__PURE__ */ c("tr", { children: /* @__PURE__ */ c("td", { colSpan: A, className: f.emptyCell, children: /* @__PURE__ */ c("div", { className: f.empty, children:
|
|
1207
|
-
/* @__PURE__ */ c("p", { className: f.emptyTitle, children:
|
|
1208
|
-
/* @__PURE__ */ c(G, { size: "sm", variant: "ghost", onClick: () => it(m), children:
|
|
1209
|
-
] }) : a ?? /* @__PURE__ */ c("p", { className: f.emptyTitle, children:
|
|
1206
|
+
return u ? q = /* @__PURE__ */ c("tbody", { children: /* @__PURE__ */ c(Po, { columns: A }) }) : y.filtered.length === 0 ? q = /* @__PURE__ */ c("tbody", { children: /* @__PURE__ */ c("tr", { children: /* @__PURE__ */ c("td", { colSpan: A, className: f.emptyCell, children: /* @__PURE__ */ c("div", { className: f.empty, children: v.admitted.length > 0 && E ? /* @__PURE__ */ x(Q, { children: [
|
|
1207
|
+
/* @__PURE__ */ c("p", { className: f.emptyTitle, children: _.nothingMatchesFilters }),
|
|
1208
|
+
/* @__PURE__ */ c(G, { size: "sm", variant: "ghost", onClick: () => it(m), children: _.resetAll })
|
|
1209
|
+
] }) : a ?? /* @__PURE__ */ c("p", { className: f.emptyTitle, children: _.noEntries }) }) }) }) }) : C ? q = /* @__PURE__ */ c(Mo, { virtual: C, colSpan: A, children: L.map((D, K) => W(D, K, C.from + K)) }) : q = /* @__PURE__ */ c("tbody", { children: L.map((D, K) => W(D, K, K)) }), /* @__PURE__ */ c(
|
|
1210
1210
|
"div",
|
|
1211
1211
|
{
|
|
1212
|
-
ref:
|
|
1213
|
-
onScroll:
|
|
1212
|
+
ref: C == null ? void 0 : C.scrollRef,
|
|
1213
|
+
onScroll: C == null ? void 0 : C.onScroll,
|
|
1214
1214
|
className: f.scroll,
|
|
1215
1215
|
style: l ? { maxHeight: l } : void 0,
|
|
1216
|
-
children: /* @__PURE__ */
|
|
1216
|
+
children: /* @__PURE__ */ x(
|
|
1217
1217
|
"table",
|
|
1218
1218
|
{
|
|
1219
1219
|
"aria-label": h,
|
|
1220
|
-
"aria-rowcount":
|
|
1220
|
+
"aria-rowcount": C ? y.filtered.length + 1 + (F ? 1 : 0) : void 0,
|
|
1221
|
+
"aria-busy": u || void 0,
|
|
1221
1222
|
className: H(
|
|
1222
1223
|
f.table,
|
|
1223
1224
|
p === "compact" && f.compact,
|
|
@@ -1225,7 +1226,7 @@ function Ro({ registry: e, props: t }) {
|
|
|
1225
1226
|
i && f.striped
|
|
1226
1227
|
),
|
|
1227
1228
|
children: [
|
|
1228
|
-
/* @__PURE__ */ c("thead", { children: /* @__PURE__ */
|
|
1229
|
+
/* @__PURE__ */ c("thead", { children: /* @__PURE__ */ x("tr", { "aria-rowindex": C ? 1 : void 0, children: [
|
|
1229
1230
|
n && /* @__PURE__ */ c(
|
|
1230
1231
|
"th",
|
|
1231
1232
|
{
|
|
@@ -1233,9 +1234,9 @@ function Ro({ registry: e, props: t }) {
|
|
|
1233
1234
|
className: H(f.th, f.control, r && f.stickyCell),
|
|
1234
1235
|
style: r ? { left: 0 } : void 0,
|
|
1235
1236
|
children: /* @__PURE__ */ c(
|
|
1236
|
-
|
|
1237
|
+
be,
|
|
1237
1238
|
{
|
|
1238
|
-
"aria-label":
|
|
1239
|
+
"aria-label": _.selectAllRows,
|
|
1239
1240
|
checked: m.selection.allSelected,
|
|
1240
1241
|
indeterminate: m.selection.someSelected,
|
|
1241
1242
|
onChange: m.selection.toggleAll
|
|
@@ -1243,29 +1244,29 @@ function Ro({ registry: e, props: t }) {
|
|
|
1243
1244
|
)
|
|
1244
1245
|
}
|
|
1245
1246
|
),
|
|
1246
|
-
|
|
1247
|
+
M && /* @__PURE__ */ c(
|
|
1247
1248
|
"td",
|
|
1248
1249
|
{
|
|
1249
1250
|
className: H(f.th, f.control, r && f.stickyCell),
|
|
1250
1251
|
style: r ? { left: (n ? 1 : 0) * me } : void 0
|
|
1251
1252
|
}
|
|
1252
1253
|
),
|
|
1253
|
-
N.map((
|
|
1254
|
+
N.map((D) => /* @__PURE__ */ c(
|
|
1254
1255
|
Io,
|
|
1255
1256
|
{
|
|
1256
|
-
entry:
|
|
1257
|
+
entry: D,
|
|
1257
1258
|
registry: e,
|
|
1258
|
-
hook:
|
|
1259
|
-
sticky:
|
|
1260
|
-
left:
|
|
1259
|
+
hook: v,
|
|
1260
|
+
sticky: T(D),
|
|
1261
|
+
left: S
|
|
1261
1262
|
},
|
|
1262
|
-
|
|
1263
|
+
D.key
|
|
1263
1264
|
)),
|
|
1264
|
-
|
|
1265
|
+
w.length > 0 && /* @__PURE__ */ c("th", { scope: "col", className: H(f.th, f.actionsCell), children: /* @__PURE__ */ c(ge, { children: _.rowActions }) })
|
|
1265
1266
|
] }) }),
|
|
1266
1267
|
q,
|
|
1267
|
-
F &&
|
|
1268
|
-
Array.from({ length: I }, (
|
|
1268
|
+
F && /* @__PURE__ */ c("tfoot", { children: /* @__PURE__ */ x("tr", { "aria-rowindex": C ? y.filtered.length + 2 : void 0, children: [
|
|
1269
|
+
Array.from({ length: I }, (D, K) => /* @__PURE__ */ c(
|
|
1269
1270
|
"td",
|
|
1270
1271
|
{
|
|
1271
1272
|
className: H(f.td, f.control, r && f.stickyCell),
|
|
@@ -1273,19 +1274,19 @@ function Ro({ registry: e, props: t }) {
|
|
|
1273
1274
|
},
|
|
1274
1275
|
K
|
|
1275
1276
|
)),
|
|
1276
|
-
N.map((
|
|
1277
|
+
N.map((D) => /* @__PURE__ */ c(
|
|
1277
1278
|
zo,
|
|
1278
1279
|
{
|
|
1279
|
-
entry:
|
|
1280
|
+
entry: D,
|
|
1280
1281
|
rows: y.filtered,
|
|
1281
|
-
formats:
|
|
1282
|
-
wording:
|
|
1283
|
-
sticky:
|
|
1284
|
-
left:
|
|
1282
|
+
formats: b,
|
|
1283
|
+
wording: _,
|
|
1284
|
+
sticky: T(D),
|
|
1285
|
+
left: S
|
|
1285
1286
|
},
|
|
1286
|
-
|
|
1287
|
+
D.key
|
|
1287
1288
|
)),
|
|
1288
|
-
|
|
1289
|
+
w.length > 0 && /* @__PURE__ */ c("td", { className: f.td })
|
|
1289
1290
|
] }) })
|
|
1290
1291
|
]
|
|
1291
1292
|
}
|
|
@@ -1300,58 +1301,59 @@ function Io({
|
|
|
1300
1301
|
sticky: o,
|
|
1301
1302
|
left: r
|
|
1302
1303
|
}) {
|
|
1303
|
-
const { spec: i } = e, s = n.publicSnapshot, l = t.kindOf(e, n.rows), a = Xe(l, i.rightAligned), u = t.isSortable(e, n.rows), d = i.id, h = s.sort.findIndex((
|
|
1304
|
-
|
|
1305
|
-
const
|
|
1304
|
+
const { spec: i } = e, s = n.publicSnapshot, l = t.kindOf(e, n.rows), a = Xe(l, i.rightAligned), u = t.isSortable(e, n.rows), d = i.id, h = s.sort.findIndex((w) => w.column === d), _ = h === -1 ? void 0 : s.sort[h].direction, b = s.sort.length > 1 && h !== -1 ? h + 1 : void 0, p = s.widths[d], g = 48, v = (w) => {
|
|
1305
|
+
w.stopPropagation(), w.preventDefault();
|
|
1306
|
+
const C = w.currentTarget, I = C.closest("th");
|
|
1306
1307
|
if (!I) return;
|
|
1307
|
-
const A =
|
|
1308
|
-
|
|
1309
|
-
const
|
|
1310
|
-
|
|
1311
|
-
}, F = (
|
|
1312
|
-
|
|
1308
|
+
const A = w.clientX, S = I.getBoundingClientRect().width, T = w.pointerId;
|
|
1309
|
+
C.setPointerCapture(T);
|
|
1310
|
+
const L = (E) => {
|
|
1311
|
+
E.pointerId === T && s.setWidth(d, Math.max(g, S + (E.clientX - A)));
|
|
1312
|
+
}, F = (E) => {
|
|
1313
|
+
E.pointerId === T && (C.removeEventListener("pointermove", L), C.removeEventListener("pointerup", F), C.removeEventListener("pointercancel", F), C.hasPointerCapture(T) && C.releasePointerCapture(T));
|
|
1313
1314
|
};
|
|
1314
|
-
|
|
1315
|
-
}, m = (
|
|
1316
|
-
const
|
|
1317
|
-
if (!
|
|
1318
|
-
const A = Array.from(
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1315
|
+
C.addEventListener("pointermove", L), C.addEventListener("pointerup", F), C.addEventListener("pointercancel", F);
|
|
1316
|
+
}, m = (w) => {
|
|
1317
|
+
const C = w == null ? void 0 : w.parentElement, I = w == null ? void 0 : w.closest("table");
|
|
1318
|
+
if (!w || !C || !I) return;
|
|
1319
|
+
const A = Array.from(C.children).indexOf(w), S = C.children.length, T = { cell: w.style.width, table: I.style.width };
|
|
1320
|
+
w.style.width = "", I.style.width = "auto";
|
|
1321
|
+
let L = 0;
|
|
1322
|
+
for (const F of Array.from(I.rows)) {
|
|
1323
|
+
if (F.cells.length !== S) continue;
|
|
1324
|
+
const E = F.cells[A];
|
|
1325
|
+
E && (L = Math.max(L, E.scrollWidth));
|
|
1324
1326
|
}
|
|
1325
|
-
|
|
1326
|
-
}, y = (
|
|
1327
|
-
if (!i.resizable || !
|
|
1328
|
-
const
|
|
1329
|
-
if (!
|
|
1330
|
-
|
|
1331
|
-
const
|
|
1327
|
+
w.style.width = T.cell, I.style.width = T.table, L > 0 && s.setWidth(d, Math.max(g, L + 1));
|
|
1328
|
+
}, y = (w) => {
|
|
1329
|
+
if (!i.resizable || !w.altKey) return;
|
|
1330
|
+
const C = w.key === "ArrowRight", I = w.key === "ArrowLeft", A = w.key === "Home";
|
|
1331
|
+
if (!C && !I && !A) return;
|
|
1332
|
+
w.preventDefault();
|
|
1333
|
+
const S = w.currentTarget;
|
|
1332
1334
|
if (A) {
|
|
1333
|
-
m(
|
|
1335
|
+
m(S);
|
|
1334
1336
|
return;
|
|
1335
1337
|
}
|
|
1336
|
-
const
|
|
1337
|
-
s.setWidth(d, Math.max(
|
|
1338
|
-
}, O = u ? /* @__PURE__ */
|
|
1338
|
+
const T = S.getBoundingClientRect().width, L = w.shiftKey ? 32 : 8;
|
|
1339
|
+
s.setWidth(d, Math.max(g, T + (C ? L : -L)));
|
|
1340
|
+
}, O = u ? /* @__PURE__ */ x(
|
|
1339
1341
|
"button",
|
|
1340
1342
|
{
|
|
1341
1343
|
type: "button",
|
|
1342
1344
|
className: f.sortButton,
|
|
1343
|
-
onClick: (
|
|
1345
|
+
onClick: (w) => s.toggleSort(d, w.shiftKey || w.metaKey),
|
|
1344
1346
|
children: [
|
|
1345
1347
|
/* @__PURE__ */ c("span", { children: i.label }),
|
|
1346
|
-
|
|
1347
|
-
/* @__PURE__ */ c("span", { className: H(f.sortIndicator,
|
|
1348
|
+
b !== void 0 && /* @__PURE__ */ c("span", { className: f.sortRank, "aria-hidden": "true", children: b }),
|
|
1349
|
+
/* @__PURE__ */ c("span", { className: H(f.sortIndicator, _ && f.sortActive), "aria-hidden": "true", children: _ ? /* @__PURE__ */ c("svg", { viewBox: "0 0 10 10", width: "10", height: "10", className: H(f.sortArrow, _ === "desc" && f.sortArrowDesc), children: /* @__PURE__ */ c("path", { d: "M2.2 6.2 5 3.4l2.8 2.8", fill: "none", stroke: "currentColor", strokeWidth: "1.6", strokeLinecap: "round", strokeLinejoin: "round" }) }) : /* @__PURE__ */ x("svg", { viewBox: "0 0 10 12", width: "10", height: "12", children: [
|
|
1348
1350
|
/* @__PURE__ */ c("path", { d: "M2.4 4.4 5 1.8l2.6 2.6", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }),
|
|
1349
1351
|
/* @__PURE__ */ c("path", { d: "M2.4 7.6 5 10.2l2.6-2.6", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" })
|
|
1350
1352
|
] }) })
|
|
1351
1353
|
]
|
|
1352
1354
|
}
|
|
1353
|
-
) : i.label, N =
|
|
1354
|
-
return /* @__PURE__ */
|
|
1355
|
+
) : i.label, N = _ === "asc" ? "ascending" : _ === "desc" ? "descending" : "none", M = se(i.filter) !== void 0 && !(i.filter === "list" && l === "other");
|
|
1356
|
+
return /* @__PURE__ */ x(
|
|
1355
1357
|
"th",
|
|
1356
1358
|
{
|
|
1357
1359
|
scope: "col",
|
|
@@ -1365,19 +1367,19 @@ function Io({
|
|
|
1365
1367
|
...o ? { left: r } : {}
|
|
1366
1368
|
},
|
|
1367
1369
|
children: [
|
|
1368
|
-
|
|
1370
|
+
M ? /* @__PURE__ */ x("span", { className: f.thFlex, children: [
|
|
1369
1371
|
O,
|
|
1370
|
-
/* @__PURE__ */ c(
|
|
1372
|
+
/* @__PURE__ */ c(bo, { entry: e, registry: t, hook: n })
|
|
1371
1373
|
] }) : O,
|
|
1372
1374
|
i.resizable && /* @__PURE__ */ c(
|
|
1373
1375
|
"span",
|
|
1374
1376
|
{
|
|
1375
1377
|
role: "presentation",
|
|
1376
1378
|
className: f.grip,
|
|
1377
|
-
onPointerDown:
|
|
1378
|
-
onClick: (
|
|
1379
|
-
onDoubleClick: (
|
|
1380
|
-
|
|
1379
|
+
onPointerDown: v,
|
|
1380
|
+
onClick: (w) => w.stopPropagation(),
|
|
1381
|
+
onDoubleClick: (w) => {
|
|
1382
|
+
w.stopPropagation(), m(w.currentTarget.closest("th"));
|
|
1381
1383
|
}
|
|
1382
1384
|
}
|
|
1383
1385
|
)
|
|
@@ -1398,20 +1400,20 @@ function Fo({
|
|
|
1398
1400
|
stickyRowHeader: u,
|
|
1399
1401
|
rowHeaderLeft: d,
|
|
1400
1402
|
columnCount: h,
|
|
1401
|
-
rowProps:
|
|
1402
|
-
baseId:
|
|
1403
|
+
rowProps: _,
|
|
1404
|
+
baseId: b,
|
|
1403
1405
|
formats: p,
|
|
1404
|
-
wording:
|
|
1406
|
+
wording: g
|
|
1405
1407
|
}) {
|
|
1406
|
-
const
|
|
1407
|
-
return /* @__PURE__ */
|
|
1408
|
-
/* @__PURE__ */
|
|
1408
|
+
const v = xe(at), m = r.publicSnapshot, y = r.rowKey(e), O = xo(e, s, r, p, g), N = o.detail, M = N !== null && m.expanded.includes(y), w = `${b}-detail-${t}`, { className: C, ...I } = (_ == null ? void 0 : _(e)) ?? {}, A = n !== void 0;
|
|
1409
|
+
return /* @__PURE__ */ x(Q, { children: [
|
|
1410
|
+
/* @__PURE__ */ x(
|
|
1409
1411
|
"tr",
|
|
1410
1412
|
{
|
|
1411
1413
|
...I,
|
|
1412
|
-
className: H(
|
|
1414
|
+
className: H(C, A && f.virtualRow),
|
|
1413
1415
|
"data-row": A ? n : void 0,
|
|
1414
|
-
tabIndex: A ? n ===
|
|
1416
|
+
tabIndex: A ? n === v ? 0 : -1 : void 0,
|
|
1415
1417
|
"data-even": A && n % 2 === 1 ? "" : void 0,
|
|
1416
1418
|
"aria-rowindex": A ? n + 2 : void 0,
|
|
1417
1419
|
children: [
|
|
@@ -1421,9 +1423,9 @@ function Fo({
|
|
|
1421
1423
|
className: H(f.td, f.control, u && f.stickyCell),
|
|
1422
1424
|
style: u ? { left: 0 } : void 0,
|
|
1423
1425
|
children: /* @__PURE__ */ c(
|
|
1424
|
-
|
|
1426
|
+
be,
|
|
1425
1427
|
{
|
|
1426
|
-
"aria-label":
|
|
1428
|
+
"aria-label": g.selectRow(O),
|
|
1427
1429
|
checked: m.selection.isSelected(y),
|
|
1428
1430
|
onChange: () => m.selection.toggle(y)
|
|
1429
1431
|
}
|
|
@@ -1439,34 +1441,34 @@ function Fo({
|
|
|
1439
1441
|
"button",
|
|
1440
1442
|
{
|
|
1441
1443
|
type: "button",
|
|
1442
|
-
"aria-expanded":
|
|
1443
|
-
"aria-controls":
|
|
1444
|
-
"aria-label":
|
|
1445
|
-
className: H(f.expander,
|
|
1444
|
+
"aria-expanded": M,
|
|
1445
|
+
"aria-controls": M ? w : void 0,
|
|
1446
|
+
"aria-label": M ? g.collapseRowNamed(O) : g.expandRowNamed(O),
|
|
1447
|
+
className: H(f.expander, M && f.expanderOpen),
|
|
1446
1448
|
onClick: () => m.toggleRow(y),
|
|
1447
1449
|
children: /* @__PURE__ */ c("svg", { viewBox: "0 0 10 10", width: "10", height: "10", "aria-hidden": "true", children: /* @__PURE__ */ c("path", { d: "M3.5 1.5 7 5l-3.5 3.5", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) })
|
|
1448
1450
|
}
|
|
1449
1451
|
)
|
|
1450
1452
|
}
|
|
1451
1453
|
),
|
|
1452
|
-
i.map((
|
|
1454
|
+
i.map((S) => /* @__PURE__ */ c(
|
|
1453
1455
|
Lo,
|
|
1454
1456
|
{
|
|
1455
|
-
entry:
|
|
1457
|
+
entry: S,
|
|
1456
1458
|
row: e,
|
|
1457
|
-
kind: o.kindOf(
|
|
1458
|
-
sticky: u &&
|
|
1459
|
+
kind: o.kindOf(S, r.rows),
|
|
1460
|
+
sticky: u && S === s,
|
|
1459
1461
|
left: d,
|
|
1460
1462
|
formats: p,
|
|
1461
|
-
wording:
|
|
1463
|
+
wording: g
|
|
1462
1464
|
},
|
|
1463
|
-
|
|
1465
|
+
S.key
|
|
1464
1466
|
)),
|
|
1465
|
-
a.length > 0 && /* @__PURE__ */ c("td", { className: H(f.td, f.actionsCell), children: /* @__PURE__ */ c(Eo, { actions: a, row: e, name: O, wording:
|
|
1467
|
+
a.length > 0 && /* @__PURE__ */ c("td", { className: H(f.td, f.actionsCell), children: /* @__PURE__ */ c(Eo, { actions: a, row: e, name: O, wording: g }) })
|
|
1466
1468
|
]
|
|
1467
1469
|
}
|
|
1468
1470
|
),
|
|
1469
|
-
|
|
1471
|
+
M && N && /* @__PURE__ */ c("tr", { id: w, className: f.detailRow, children: /* @__PURE__ */ c("td", { colSpan: h, className: f.detailCell, children: N.presentation(e) }) })
|
|
1470
1472
|
] });
|
|
1471
1473
|
}
|
|
1472
1474
|
function Lo({
|
|
@@ -1503,9 +1505,9 @@ function zo({
|
|
|
1503
1505
|
const { footer: s, format: l } = e.spec, a = H(f.td, f.numeric, r && f.stickyCell), u = r ? { left: i } : void 0;
|
|
1504
1506
|
if (!s) return /* @__PURE__ */ c("td", { className: H(f.td, r && f.stickyCell), style: u });
|
|
1505
1507
|
const d = Ht(t, e.read, s);
|
|
1506
|
-
return /* @__PURE__ */
|
|
1508
|
+
return /* @__PURE__ */ x("td", { className: a, style: u, "data-footer": s, children: [
|
|
1507
1509
|
/* @__PURE__ */ c("span", { "aria-hidden": "true", className: f.footerKind, children: s === "sum" ? "Σ" : "⌀" }),
|
|
1508
|
-
/* @__PURE__ */
|
|
1510
|
+
/* @__PURE__ */ x(ge, { children: [
|
|
1509
1511
|
s === "sum" ? o.footerSum : o.footerAverage,
|
|
1510
1512
|
" "
|
|
1511
1513
|
] }),
|
|
@@ -1555,29 +1557,29 @@ function Mo({
|
|
|
1555
1557
|
colSpan: t,
|
|
1556
1558
|
children: n
|
|
1557
1559
|
}) {
|
|
1558
|
-
const { count: o, fillerBefore: r, fillerAfter: i, showRow: s } = e, l = oe(null), [a, u] =
|
|
1560
|
+
const { count: o, fillerBefore: r, fillerAfter: i, showRow: s } = e, l = oe(null), [a, u] = P(0), d = (b, p) => {
|
|
1559
1561
|
l.current = p, u(p), s(p), requestAnimationFrame(() => {
|
|
1560
|
-
var
|
|
1561
|
-
(
|
|
1562
|
+
var g;
|
|
1563
|
+
(g = b.querySelector(`[data-row="${p}"]`)) == null || g.focus();
|
|
1562
1564
|
});
|
|
1563
|
-
}, h = a >= e.from && a < e.to ? a : e.from,
|
|
1564
|
-
if (
|
|
1565
|
-
const p =
|
|
1566
|
-
if (
|
|
1567
|
-
const
|
|
1565
|
+
}, h = a >= e.from && a < e.to ? a : e.from, _ = (b) => {
|
|
1566
|
+
if (b.defaultPrevented || o === 0) return;
|
|
1567
|
+
const p = b.target, g = p.closest("[data-row]");
|
|
1568
|
+
if (g && p !== g) return;
|
|
1569
|
+
const v = g ? Number(g.dataset.row) : l.current ?? -1;
|
|
1568
1570
|
let m = null;
|
|
1569
|
-
|
|
1571
|
+
b.key === "ArrowDown" ? m = Math.min(o - 1, v + 1) : b.key === "ArrowUp" ? m = Math.max(0, v - 1) : b.key === "Home" ? m = 0 : b.key === "End" && (m = o - 1), !(m === null || m === v) && (b.preventDefault(), d(b.currentTarget, m));
|
|
1570
1572
|
};
|
|
1571
1573
|
return /* @__PURE__ */ c(
|
|
1572
1574
|
"tbody",
|
|
1573
1575
|
{
|
|
1574
1576
|
className: f.virtualBody,
|
|
1575
|
-
onKeyDown:
|
|
1576
|
-
onFocus: (
|
|
1577
|
-
const p =
|
|
1577
|
+
onKeyDown: _,
|
|
1578
|
+
onFocus: (b) => {
|
|
1579
|
+
const p = b.target.closest("[data-row]");
|
|
1578
1580
|
p && u(Number(p.dataset.row));
|
|
1579
1581
|
},
|
|
1580
|
-
children: /* @__PURE__ */
|
|
1582
|
+
children: /* @__PURE__ */ x(at.Provider, { value: h, children: [
|
|
1581
1583
|
/* @__PURE__ */ c(We, { height: r, colSpan: t }),
|
|
1582
1584
|
n,
|
|
1583
1585
|
/* @__PURE__ */ c(We, { height: i, colSpan: t })
|
|
@@ -1598,30 +1600,30 @@ const Do = "_verdict_a8pbv_6", Vo = "_glyph_a8pbv_13", Ho = "_value_a8pbv_23", B
|
|
|
1598
1600
|
};
|
|
1599
1601
|
function Ko({ reading: e, format: t }) {
|
|
1600
1602
|
const n = te(), o = $(), { measured: r, assessment: i } = e, s = $o(i.verdict, o);
|
|
1601
|
-
return /* @__PURE__ */
|
|
1603
|
+
return /* @__PURE__ */ x("span", { className: he.verdict, "data-verdict": i.verdict, title: s, children: [
|
|
1602
1604
|
/* @__PURE__ */ c("span", { "aria-hidden": "true", className: he.glyph, children: Wo[i.verdict] }),
|
|
1603
1605
|
/* @__PURE__ */ c("span", { className: he.value, children: r === null ? o.statAbsentValue : Ke(r, t, n) }),
|
|
1604
|
-
i.excess !== void 0 && /* @__PURE__ */
|
|
1606
|
+
i.excess !== void 0 && /* @__PURE__ */ x("span", { className: he.excess, children: [
|
|
1605
1607
|
"+",
|
|
1606
1608
|
Ke(i.excess, t, n)
|
|
1607
1609
|
] }),
|
|
1608
|
-
/* @__PURE__ */ c(
|
|
1610
|
+
/* @__PURE__ */ c(ge, { children: s })
|
|
1609
1611
|
] });
|
|
1610
1612
|
}
|
|
1611
1613
|
const Go = (e) => e.measured;
|
|
1612
1614
|
function Uo(e) {
|
|
1613
1615
|
return function({ id: n, value: o, label: r, limits: i, format: s, sortBy: l = "verdict", width: a, resizable: u }) {
|
|
1614
1616
|
const d = JSON.stringify(i), h = V(() => {
|
|
1615
|
-
const
|
|
1617
|
+
const b = JSON.parse(d);
|
|
1616
1618
|
return (p) => {
|
|
1617
|
-
const
|
|
1619
|
+
const g = typeof o == "string" ? p == null ? void 0 : p[o] : o(p);
|
|
1618
1620
|
return {
|
|
1619
|
-
measured: typeof
|
|
1620
|
-
assessment: xt(
|
|
1621
|
+
measured: typeof g == "number" && Number.isFinite(g) ? g : null,
|
|
1622
|
+
assessment: xt(g, b)
|
|
1621
1623
|
};
|
|
1622
1624
|
};
|
|
1623
|
-
}, [o, d]),
|
|
1624
|
-
(
|
|
1625
|
+
}, [o, d]), _ = B(
|
|
1626
|
+
(b) => l === "value" ? b.measured : Tt(b.assessment.verdict),
|
|
1625
1627
|
[l]
|
|
1626
1628
|
);
|
|
1627
1629
|
return /* @__PURE__ */ c(
|
|
@@ -1633,9 +1635,9 @@ function Uo(e) {
|
|
|
1633
1635
|
width: a,
|
|
1634
1636
|
resizable: u,
|
|
1635
1637
|
value: h,
|
|
1636
|
-
sortValue:
|
|
1638
|
+
sortValue: _,
|
|
1637
1639
|
exportValue: Go,
|
|
1638
|
-
children: (
|
|
1640
|
+
children: (b) => /* @__PURE__ */ c(Ko, { reading: b, format: s })
|
|
1639
1641
|
}
|
|
1640
1642
|
);
|
|
1641
1643
|
};
|
|
@@ -1668,16 +1670,16 @@ function qo(e, t) {
|
|
|
1668
1670
|
};
|
|
1669
1671
|
}
|
|
1670
1672
|
function Yo(e, t) {
|
|
1671
|
-
const n = V(() => t ? e.filter((s) => t(s)) : e, [e, t]), [o, r] =
|
|
1673
|
+
const n = V(() => t ? e.filter((s) => t(s)) : e, [e, t]), [o, r] = P(() => ({ source: e, result: n }));
|
|
1672
1674
|
if (!t) return e;
|
|
1673
1675
|
const i = o.source === e && (o.result === n || o.result.length === n.length && o.result.every((s, l) => s === n[l]));
|
|
1674
1676
|
return i || r({ source: e, result: n }), i ? o.result : n;
|
|
1675
1677
|
}
|
|
1676
1678
|
function Xo(e, t) {
|
|
1677
|
-
var l, a, u, d, h,
|
|
1679
|
+
var l, a, u, d, h, _;
|
|
1678
1680
|
if (t.size === 0) return e;
|
|
1679
|
-
const n = (l = e.sort) == null ? void 0 : l.filter((
|
|
1680
|
-
return (n == null ? void 0 : n.length) === ((d = e.sort) == null ? void 0 : d.length) && (o == null ? void 0 : o.length) === ((h = e.hidden) == null ? void 0 : h.length) && (r == null ? void 0 : r.length) === ((
|
|
1681
|
+
const n = (l = e.sort) == null ? void 0 : l.filter((b) => t.has(b.column)), o = (a = e.hidden) == null ? void 0 : a.filter((b) => t.has(b)), r = (u = e.order) == null ? void 0 : u.filter((b) => t.has(b)), i = e.widths ? Object.fromEntries(Object.entries(e.widths).filter(([b]) => t.has(b))) : void 0;
|
|
1682
|
+
return (n == null ? void 0 : n.length) === ((d = e.sort) == null ? void 0 : d.length) && (o == null ? void 0 : o.length) === ((h = e.hidden) == null ? void 0 : h.length) && (r == null ? void 0 : r.length) === ((_ = e.order) == null ? void 0 : _.length) && Object.keys(i ?? {}).length === Object.keys(e.widths ?? {}).length ? e : {
|
|
1681
1683
|
...e.search ? { search: e.search } : {},
|
|
1682
1684
|
...e.page ? { page: e.page } : {},
|
|
1683
1685
|
...e.pageSize ? { pageSize: e.pageSize } : {},
|
|
@@ -1694,49 +1696,49 @@ function Qo(e, t) {
|
|
|
1694
1696
|
return { ...n, ...t };
|
|
1695
1697
|
}
|
|
1696
1698
|
function Zo(e, t) {
|
|
1697
|
-
const [n] =
|
|
1698
|
-
const
|
|
1699
|
-
return { ...
|
|
1699
|
+
const [n] = P(() => new ho()), [o] = P(() => {
|
|
1700
|
+
const S = To(n);
|
|
1701
|
+
return { ...S, VerdictColumn: Uo(S.Column) };
|
|
1700
1702
|
});
|
|
1701
1703
|
pe(n.subscribe, n.structureVersion, n.structureVersion);
|
|
1702
|
-
const r = te(), i = e, s = n.modelColumns(i, r), [l] =
|
|
1703
|
-
rowKey:
|
|
1704
|
+
const r = te(), i = e, s = n.modelColumns(i, r), [l] = P(() => t.initialView), [a, u] = P(() => Object.entries((l == null ? void 0 : l.conditions) ?? {})), d = V(() => qo(a, n), [a, n]), h = t.preFilter ?? t.filter, _ = Yo(i, h), b = t.rowKey, p = Et(_, s, {
|
|
1705
|
+
rowKey: b,
|
|
1704
1706
|
pageSize: t.pageSize,
|
|
1705
1707
|
defaultSort: t.defaultSort,
|
|
1706
1708
|
filter: d,
|
|
1707
1709
|
initialView: l,
|
|
1708
1710
|
virtual: t.virtual
|
|
1709
|
-
}), { setPage:
|
|
1710
|
-
(
|
|
1711
|
-
let
|
|
1712
|
-
if (!
|
|
1713
|
-
const F = n.columnById(
|
|
1714
|
-
if (!
|
|
1711
|
+
}), { setPage: g } = p, v = B(
|
|
1712
|
+
(S, T) => {
|
|
1713
|
+
let L = T == null;
|
|
1714
|
+
if (!L && n.orderedColumns().length > 0) {
|
|
1715
|
+
const F = n.columnById(S), E = F ? se(F.spec.filter) : void 0;
|
|
1716
|
+
if (!E) {
|
|
1715
1717
|
re(
|
|
1716
|
-
`condition-without-filter:${
|
|
1717
|
-
F ? `The column "${
|
|
1718
|
+
`condition-without-filter:${S}`,
|
|
1719
|
+
F ? `The column "${S}" has no filter; its condition is passed over.` : `No column is called "${S}"; its condition is passed over.`
|
|
1718
1720
|
);
|
|
1719
1721
|
return;
|
|
1720
1722
|
}
|
|
1721
|
-
const W = et(
|
|
1723
|
+
const W = et(E, T);
|
|
1722
1724
|
if (W === "foreign") {
|
|
1723
|
-
dt(
|
|
1725
|
+
dt(S);
|
|
1724
1726
|
return;
|
|
1725
1727
|
}
|
|
1726
|
-
|
|
1728
|
+
L = W === "empty";
|
|
1727
1729
|
}
|
|
1728
1730
|
u((F) => {
|
|
1729
|
-
const
|
|
1730
|
-
return
|
|
1731
|
-
}),
|
|
1731
|
+
const E = F.findIndex(([W]) => W === S);
|
|
1732
|
+
return L ? E === -1 ? F : F.filter((W, q) => q !== E) : E === -1 ? [...F, [S, T]] : F.map((W, q) => q === E ? [S, T] : W);
|
|
1733
|
+
}), g(1);
|
|
1732
1734
|
},
|
|
1733
|
-
[n,
|
|
1734
|
-
), m = new Set(n.orderedColumns().map((
|
|
1735
|
+
[n, g]
|
|
1736
|
+
), m = new Set(n.orderedColumns().map((S) => S.spec.id)), [y, O] = P(() => /* @__PURE__ */ new Set());
|
|
1735
1737
|
if (!Jo(y, m)) {
|
|
1736
|
-
const
|
|
1737
|
-
O(m), a.some(([
|
|
1738
|
+
const S = new Set([...y].filter((T) => !m.has(T)));
|
|
1739
|
+
O(m), a.some(([T]) => S.has(T)) && u((T) => T.filter(([L]) => !S.has(L)));
|
|
1738
1740
|
}
|
|
1739
|
-
const N = m.size === 0 ? a : a.filter(([
|
|
1741
|
+
const N = m.size === 0 ? a : a.filter(([S, T]) => ut(n, S, T)), M = Xo(p.view, m), w = N.length > 0 ? { ...M, conditions: Object.fromEntries(N) } : M, C = m.size === 0 ? p.sort : p.sort.filter((S) => m.has(S.column)), I = n.paginates() || t.virtual !== void 0, A = {
|
|
1740
1742
|
rows: e,
|
|
1741
1743
|
filtered: p.filtered,
|
|
1742
1744
|
visible: I ? p.visible : p.filtered,
|
|
@@ -1747,7 +1749,7 @@ function Zo(e, t) {
|
|
|
1747
1749
|
setPageSize: p.setPageSize,
|
|
1748
1750
|
search: p.search,
|
|
1749
1751
|
setSearch: p.setSearch,
|
|
1750
|
-
sort:
|
|
1752
|
+
sort: C,
|
|
1751
1753
|
toggleSort: p.toggleSort,
|
|
1752
1754
|
hidden: p.hidden,
|
|
1753
1755
|
toggleColumn: p.toggleColumn,
|
|
@@ -1758,20 +1760,20 @@ function Zo(e, t) {
|
|
|
1758
1760
|
expanded: p.expanded,
|
|
1759
1761
|
toggleRow: p.toggleRow,
|
|
1760
1762
|
filter: Object.fromEntries(N),
|
|
1761
|
-
setFilter:
|
|
1763
|
+
setFilter: v,
|
|
1762
1764
|
selection: t.selection ?? p.selection,
|
|
1763
|
-
view:
|
|
1765
|
+
view: w,
|
|
1764
1766
|
asCsv: () => So(n),
|
|
1765
1767
|
virtual: t.virtual !== void 0
|
|
1766
1768
|
};
|
|
1767
1769
|
return n.setHook({
|
|
1768
1770
|
rows: i,
|
|
1769
|
-
admitted:
|
|
1771
|
+
admitted: _,
|
|
1770
1772
|
modelColumns: s,
|
|
1771
1773
|
companion: p,
|
|
1772
1774
|
filter: d,
|
|
1773
1775
|
publicSnapshot: A,
|
|
1774
|
-
rowKey:
|
|
1776
|
+
rowKey: b,
|
|
1775
1777
|
formats: r
|
|
1776
1778
|
}), { ...A, ...o };
|
|
1777
1779
|
}
|
|
@@ -1813,25 +1815,25 @@ function Mr({ placeholder: e, "aria-label": t, className: n, of: o }) {
|
|
|
1813
1815
|
);
|
|
1814
1816
|
}
|
|
1815
1817
|
function Dr({ of: e }) {
|
|
1816
|
-
var
|
|
1817
|
-
const t = ue(e), n = $(), [o, r] =
|
|
1818
|
+
var v;
|
|
1819
|
+
const t = ue(e), n = $(), [o, r] = P(!1), i = oe(null), s = oe(null), l = Z(), [a, u] = P(null);
|
|
1818
1820
|
if (J(() => {
|
|
1819
1821
|
var N;
|
|
1820
1822
|
if (!a || !s.current) return;
|
|
1821
1823
|
const m = Array.from(s.current.children).find(
|
|
1822
|
-
(
|
|
1824
|
+
(M) => M.dataset.column === a.id
|
|
1823
1825
|
), y = m == null ? void 0 : m.querySelector(`[data-direction="${a.direction}"]`), O = m == null ? void 0 : m.querySelector(
|
|
1824
1826
|
`[data-direction="${a.direction === "forward" ? "backward" : "forward"}"]`
|
|
1825
1827
|
);
|
|
1826
1828
|
(N = y && !y.disabled ? y : O) == null || N.focus();
|
|
1827
1829
|
}, [a]), !t) return null;
|
|
1828
|
-
const { registry: d, snapshot: h } = t,
|
|
1829
|
-
Te(d.modelColumns(
|
|
1830
|
-
), p = d.stickyRowHeader ? ((
|
|
1831
|
-
const O =
|
|
1832
|
-
N < 0 || N >= O.length || ([O[m], O[N]] = [O[N], O[m]], h.setOrder(O), u({ id:
|
|
1830
|
+
const { registry: d, snapshot: h } = t, _ = d.hook, b = d.withStickyHeaderFirst(
|
|
1831
|
+
Te(d.modelColumns(_.rows, _.formats), h.order)
|
|
1832
|
+
), p = d.stickyRowHeader ? ((v = b[0]) == null ? void 0 : v.hideable) === !1 : !1, g = (m, y) => {
|
|
1833
|
+
const O = b.map((M) => M.id), N = m + y;
|
|
1834
|
+
N < 0 || N >= O.length || ([O[m], O[N]] = [O[N], O[m]], h.setOrder(O), u({ id: b[m].id, direction: y < 0 ? "forward" : "backward" }));
|
|
1833
1835
|
};
|
|
1834
|
-
return /* @__PURE__ */
|
|
1836
|
+
return /* @__PURE__ */ x(Q, { children: [
|
|
1835
1837
|
/* @__PURE__ */ c(
|
|
1836
1838
|
G,
|
|
1837
1839
|
{
|
|
@@ -1855,11 +1857,11 @@ function Dr({ of: e }) {
|
|
|
1855
1857
|
ariaLabel: n.arrangeColumns,
|
|
1856
1858
|
id: l,
|
|
1857
1859
|
className: f.columnsPanel,
|
|
1858
|
-
children: /* @__PURE__ */ c("ul", { ref: s, className: f.columnsList, "aria-label": n.arrangeColumns, children:
|
|
1860
|
+
children: /* @__PURE__ */ c("ul", { ref: s, className: f.columnsList, "aria-label": n.arrangeColumns, children: b.map((m, y) => {
|
|
1859
1861
|
const O = m.label ?? m.id;
|
|
1860
|
-
return /* @__PURE__ */
|
|
1862
|
+
return /* @__PURE__ */ x("li", { className: f.columnsEntry, "data-column": m.id, children: [
|
|
1861
1863
|
/* @__PURE__ */ c(
|
|
1862
|
-
|
|
1864
|
+
be,
|
|
1863
1865
|
{
|
|
1864
1866
|
label: O,
|
|
1865
1867
|
checked: !h.hidden.includes(m.id),
|
|
@@ -1875,7 +1877,7 @@ function Dr({ of: e }) {
|
|
|
1875
1877
|
"data-direction": "forward",
|
|
1876
1878
|
"aria-label": n.columnForward(O),
|
|
1877
1879
|
disabled: y === 0 || p && y <= 1,
|
|
1878
|
-
onClick: () =>
|
|
1880
|
+
onClick: () => g(y, -1),
|
|
1879
1881
|
children: /* @__PURE__ */ c("svg", { viewBox: "0 0 10 10", width: "10", height: "10", "aria-hidden": "true", children: /* @__PURE__ */ c("path", { d: "M2 6.5 5 3.5l3 3", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) })
|
|
1880
1882
|
}
|
|
1881
1883
|
),
|
|
@@ -1886,8 +1888,8 @@ function Dr({ of: e }) {
|
|
|
1886
1888
|
className: f.move,
|
|
1887
1889
|
"data-direction": "backward",
|
|
1888
1890
|
"aria-label": n.columnBackward(O),
|
|
1889
|
-
disabled: y ===
|
|
1890
|
-
onClick: () =>
|
|
1891
|
+
disabled: y === b.length - 1 || p && y === 0,
|
|
1892
|
+
onClick: () => g(y, 1),
|
|
1891
1893
|
children: /* @__PURE__ */ c("svg", { viewBox: "0 0 10 10", width: "10", height: "10", "aria-hidden": "true", children: /* @__PURE__ */ c("path", { d: "M2 3.5 5 6.5l3-3", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) })
|
|
1892
1894
|
}
|
|
1893
1895
|
)
|
|
@@ -1908,16 +1910,16 @@ function Vr({ filename: e, onExport: t, of: n }) {
|
|
|
1908
1910
|
return;
|
|
1909
1911
|
}
|
|
1910
1912
|
const a = URL.createObjectURL(new Blob([l], { type: "text/csv;charset=utf-8" })), u = document.createElement("a");
|
|
1911
|
-
u.href = a, u.download = e ?? r.exportFileName, u.click(), setTimeout(() => URL.revokeObjectURL(a),
|
|
1913
|
+
u.href = a, u.download = e ?? r.exportFileName, u.click(), setTimeout(() => URL.revokeObjectURL(a), 1e4);
|
|
1912
1914
|
}, children: r.exportLabel });
|
|
1913
1915
|
}
|
|
1914
1916
|
function Hr({ pageSizes: e = [10, 25, 50], className: t, of: n }) {
|
|
1915
1917
|
const o = ue(n), r = $(), i = te();
|
|
1916
1918
|
if (Ie(o == null ? void 0 : o.registry, "pagination"), !o || o.snapshot.virtual) return null;
|
|
1917
|
-
const { snapshot: s } = o, l = s.filtered.length, a = e.includes(s.pageSize) ? e : [...e, s.pageSize].sort((d, h) => d - h), u = /* @__PURE__ */
|
|
1919
|
+
const { snapshot: s } = o, l = s.filtered.length, a = e.includes(s.pageSize) ? e : [...e, s.pageSize].sort((d, h) => d - h), u = /* @__PURE__ */ x("nav", { "aria-label": r.pagination, className: H(f.pagination, t), children: [
|
|
1918
1920
|
/* @__PURE__ */ c("span", { children: r.entries(l, i.count(l)) }),
|
|
1919
|
-
/* @__PURE__ */
|
|
1920
|
-
/* @__PURE__ */
|
|
1921
|
+
/* @__PURE__ */ x("div", { className: f.paginationControls, children: [
|
|
1922
|
+
/* @__PURE__ */ x("label", { className: f.pageSize, children: [
|
|
1921
1923
|
r.rows,
|
|
1922
1924
|
/* @__PURE__ */ c(
|
|
1923
1925
|
Ot,
|
|
@@ -2026,22 +2028,22 @@ function Kr(e, t = {}) {
|
|
|
2026
2028
|
flood: s,
|
|
2027
2029
|
keepDone: l = !1,
|
|
2028
2030
|
columns: a = ur
|
|
2029
|
-
} = e, u = new Map(o.map((
|
|
2030
|
-
const
|
|
2031
|
+
} = e, u = new Map(o.map((g) => [g.id, g])), d = sr(n, (i == null ? void 0 : i.windowMs) ?? 1 / 0, r), h = s ? cr(n, s, r) : null, _ = new Set((h == null ? void 0 : h.alarms) ?? []), b = n.filter((g) => l || !or(g.lifecycle)).map((g) => {
|
|
2032
|
+
const v = u.get(g.type) ?? hr(g.type), m = d.get(g.type) ?? 0;
|
|
2031
2033
|
return {
|
|
2032
|
-
id:
|
|
2033
|
-
alarm:
|
|
2034
|
-
type:
|
|
2035
|
-
lifecycle:
|
|
2036
|
-
priority:
|
|
2037
|
-
rank: tr(
|
|
2038
|
-
age: r -
|
|
2039
|
-
duration: (
|
|
2034
|
+
id: g.id,
|
|
2035
|
+
alarm: g,
|
|
2036
|
+
type: v,
|
|
2037
|
+
lifecycle: g.lifecycle,
|
|
2038
|
+
priority: v.priority,
|
|
2039
|
+
rank: tr(v.priority),
|
|
2040
|
+
age: r - g.raised,
|
|
2041
|
+
duration: (g.cleared ?? r) - g.raised,
|
|
2040
2042
|
frequency: m,
|
|
2041
2043
|
chatters: i !== void 0 && m >= i.atLeast,
|
|
2042
|
-
inFlood:
|
|
2044
|
+
inFlood: _.has(g.id)
|
|
2043
2045
|
};
|
|
2044
|
-
}), p = Oe(
|
|
2046
|
+
}), p = Oe(b, a, {
|
|
2045
2047
|
...t,
|
|
2046
2048
|
sort: t.sort === void 0 ? fr : t.sort
|
|
2047
2049
|
});
|
|
@@ -2049,20 +2051,20 @@ function Kr(e, t = {}) {
|
|
|
2049
2051
|
...p,
|
|
2050
2052
|
flood: h,
|
|
2051
2053
|
standingUnacknowledged: p.filtered.reduce(
|
|
2052
|
-
(
|
|
2054
|
+
(g, v) => g + (v.lifecycle === "standing-unacknowledged" ? 1 : 0),
|
|
2053
2055
|
0
|
|
2054
2056
|
)
|
|
2055
2057
|
};
|
|
2056
2058
|
}
|
|
2057
|
-
const mr = "_list_alpwk_4 _text_18b86_23", pr = "_bar_alpwk_12",
|
|
2059
|
+
const mr = "_list_alpwk_4 _text_18b86_23", pr = "_bar_alpwk_12", br = "_heading_alpwk_19", gr = "_filler_alpwk_25", wr = "_asOf_alpwk_29", _r = "_live_alpwk_46", vr = "_label_alpwk_51", kr = "_counter_alpwk_55", yr = "_lifecycle_alpwk_59", Cr = "_empty_alpwk_63", Sr = "_row_alpwk_70", X = {
|
|
2058
2060
|
list: mr,
|
|
2059
2061
|
bar: pr,
|
|
2060
|
-
heading:
|
|
2061
|
-
filler:
|
|
2062
|
-
asOf:
|
|
2062
|
+
heading: br,
|
|
2063
|
+
filler: gr,
|
|
2064
|
+
asOf: wr,
|
|
2063
2065
|
live: _r,
|
|
2064
|
-
label:
|
|
2065
|
-
counter:
|
|
2066
|
+
label: vr,
|
|
2067
|
+
counter: kr,
|
|
2066
2068
|
lifecycle: yr,
|
|
2067
2069
|
empty: Cr,
|
|
2068
2070
|
row: Sr
|
|
@@ -2110,36 +2112,37 @@ function ft({
|
|
|
2110
2112
|
freshness: i,
|
|
2111
2113
|
...s
|
|
2112
2114
|
}) {
|
|
2113
|
-
const l = $(), a = te(), u = i !== null, d = (i == null ? void 0 : i.freshness) === "lost", { Table: h, Column:
|
|
2114
|
-
return /* @__PURE__ */
|
|
2115
|
-
/* @__PURE__ */
|
|
2115
|
+
const l = $(), a = te(), u = i !== null, d = (i == null ? void 0 : i.freshness) === "lost", { Table: h, Column: _ } = Zo(e.visible, { rowKey: (m) => m.id, selection: t }), b = V(() => e.filtered.map((m) => m.alarm), [e.filtered]), p = V(() => t === void 0 ? [] : e.filtered.map((m) => m.id).filter((m) => t.selected.has(m)), [e.filtered, t]), g = V(() => ar(b, p), [b, p]), v = qe(o, "compact");
|
|
2116
|
+
return /* @__PURE__ */ x("div", { className: [X.list, r].filter(Boolean).join(" "), ...s, children: [
|
|
2117
|
+
/* @__PURE__ */ x("div", { className: X.bar, children: [
|
|
2116
2118
|
/* @__PURE__ */ c("span", { className: X.heading, children: l.alarms }),
|
|
2117
2119
|
e.flood !== null && /* @__PURE__ */ c(Ce, { tone: "warning", children: l.floodHint(e.flood.count) }),
|
|
2118
|
-
u && i !== null && /* @__PURE__ */
|
|
2120
|
+
u && i !== null && /* @__PURE__ */ x("span", { className: X.asOf, "data-freshness": i.freshness, children: [
|
|
2119
2121
|
i.freshness === "lost" ? l.freshnessDisconnected : i.freshness === "stale" ? l.freshnessStale : l.freshnessFresh,
|
|
2120
2122
|
i.age !== null && ` · ${a.relative(i.age)}`
|
|
2121
2123
|
] }),
|
|
2122
2124
|
/* @__PURE__ */ c("span", { className: X.filler }),
|
|
2123
|
-
t !== void 0 && n !== void 0 && /* @__PURE__ */ c(G, { variant: "primary", size: "sm", disabled:
|
|
2125
|
+
t !== void 0 && n !== void 0 && /* @__PURE__ */ c(G, { variant: "primary", size: "sm", disabled: g === 0, onClick: () => n(p), children: g === 0 ? l.acknowledgeAlarm : l.acknowledgeAlarms(g) })
|
|
2124
2126
|
] }),
|
|
2125
2127
|
/* @__PURE__ */ c("div", { "aria-live": "polite", "aria-atomic": "true", className: X.live, children: l.standingUnacknowledged(e.standingUnacknowledged) }),
|
|
2126
|
-
/* @__PURE__ */
|
|
2128
|
+
/* @__PURE__ */ x(
|
|
2127
2129
|
h,
|
|
2128
2130
|
{
|
|
2131
|
+
ariaLabel: l.alarms,
|
|
2129
2132
|
selectable: t !== void 0,
|
|
2130
|
-
density:
|
|
2133
|
+
density: v,
|
|
2131
2134
|
stickyHeader: !0,
|
|
2132
2135
|
rowProps: (m) => ({ className: X.row, "data-lifecycle": m.lifecycle, "data-priority": m.priority }),
|
|
2133
2136
|
empty: /* @__PURE__ */ c("span", { className: X.empty, children: d ? l.noAlarmsDisconnected : l.noAlarms }),
|
|
2134
2137
|
children: [
|
|
2135
|
-
/* @__PURE__ */ c(
|
|
2138
|
+
/* @__PURE__ */ c(_, { id: "type", label: l.columnAlarm, value: (m) => m.type.label, rowHeader: !0, sortable: !1, children: (m, y) => /* @__PURE__ */ x(Q, { children: [
|
|
2136
2139
|
/* @__PURE__ */ c("span", { className: X.label, children: m }),
|
|
2137
2140
|
y.chatters && /* @__PURE__ */ c(Ce, { tone: "warning", pill: !0, className: X.counter, children: l.chatterHint(y.frequency) })
|
|
2138
2141
|
] }) }),
|
|
2139
|
-
/* @__PURE__ */ c(
|
|
2140
|
-
/* @__PURE__ */ c(
|
|
2142
|
+
/* @__PURE__ */ c(_, { value: "lifecycle", label: l.columnLifecycleState, sortable: !1, children: (m) => /* @__PURE__ */ c("span", { className: X.lifecycle, children: Nr(m, l) }) }),
|
|
2143
|
+
/* @__PURE__ */ c(_, { value: "priority", label: l.columnPriority, sortable: !1, children: (m) => /* @__PURE__ */ c(Ce, { tone: xr(m), children: Ar(m, l) }) }),
|
|
2141
2144
|
/* @__PURE__ */ c(
|
|
2142
|
-
|
|
2145
|
+
_,
|
|
2143
2146
|
{
|
|
2144
2147
|
id: "raised",
|
|
2145
2148
|
label: l.columnRaised,
|
|
@@ -2148,8 +2151,8 @@ function ft({
|
|
|
2148
2151
|
sortable: !1
|
|
2149
2152
|
}
|
|
2150
2153
|
),
|
|
2151
|
-
/* @__PURE__ */ c(
|
|
2152
|
-
/* @__PURE__ */ c(
|
|
2154
|
+
/* @__PURE__ */ c(_, { value: "duration", label: l.columnDuration, sortable: !1, children: (m) => Tr(m, l) }),
|
|
2155
|
+
/* @__PURE__ */ c(_, { value: "frequency", label: l.columnFrequency, format: "count", sortable: !1 })
|
|
2153
2156
|
]
|
|
2154
2157
|
}
|
|
2155
2158
|
)
|