@umriss-ui/table 0.3.2 → 0.3.3
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/dist/table.css +1 -1
- package/dist/table.js +833 -823
- package/package.json +3 -3
package/dist/table.js
CHANGED
|
@@ -2,20 +2,20 @@ import "./table.css";
|
|
|
2
2
|
var Jt = Object.defineProperty;
|
|
3
3
|
var Xt = (e, t, n) => t in e ? Jt(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
|
4
4
|
var P = (e, t, n) => Xt(e, typeof t != "symbol" ? t + "" : t, n);
|
|
5
|
-
import { useState as
|
|
6
|
-
import { DEFAULT_FORMATS as
|
|
7
|
-
import { jsx as l, jsxs as
|
|
5
|
+
import { useState as H, useCallback as X, useMemo as j, useRef as re, useId as ie, useContext as Ue, useSyncExternalStore as qe, createContext as St, useLayoutEffect as W } from "react";
|
|
6
|
+
import { DEFAULT_FORMATS as Ct, useVirtual as Qt, useFormats as ue, useWording as U, Checkbox as Ce, DateRangePicker as Zt, FormField as st, NumberInput as it, Popover as Nt, Button as ee, TagGroup as xt, Tag as At, Menu as Tt, MenuItem as Oe, MenuSeparator as en, VisuallyHidden as Re, useDensityFor as Ot, AngleGlyph as tn, assess as nn, verdictWeight as Ge, Select as on, Input as rn, DEFAULT_WORDING as sn, Badge as De, useFreshness as an } from "@umriss-ui/core";
|
|
7
|
+
import { jsx as l, jsxs as F, Fragment as Q } from "react/jsx-runtime";
|
|
8
8
|
import { createPortal as ln } from "react-dom";
|
|
9
9
|
function cn(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
12
|
const d = new Set(h);
|
|
13
13
|
return d.has(u) ? d.delete(u) : d.add(u), d;
|
|
14
14
|
});
|
|
15
|
-
}, []), s =
|
|
15
|
+
}, []), s = j(
|
|
16
16
|
() => e.length > 0 && e.every((u) => t.has(u)),
|
|
17
17
|
[e, t]
|
|
18
|
-
), i =
|
|
18
|
+
), i = j(
|
|
19
19
|
() => !s && e.some((u) => t.has(u)),
|
|
20
20
|
[e, t, s]
|
|
21
21
|
), a = X(() => {
|
|
@@ -27,19 +27,19 @@ function cn(e) {
|
|
|
27
27
|
return { selected: t, isSelected: o, toggle: r, toggleAll: a, clear: c, allSelected: s, someSelected: i, count: t.size };
|
|
28
28
|
}
|
|
29
29
|
const Y = (e) => e == null || typeof e == "number" && Number.isNaN(e);
|
|
30
|
-
function
|
|
30
|
+
function Le(e) {
|
|
31
31
|
return Y(e) ? "empty" : typeof e == "string" ? "text" : typeof e == "number" ? "number" : typeof e == "boolean" ? "boolean" : e instanceof Date ? Number.isNaN(e.getTime()) ? "empty" : "date" : "other";
|
|
32
32
|
}
|
|
33
33
|
function Ft(e, t) {
|
|
34
34
|
for (const n of e) {
|
|
35
|
-
const o =
|
|
35
|
+
const o = Le(t(n));
|
|
36
36
|
if (o !== "empty") return o;
|
|
37
37
|
}
|
|
38
38
|
return "empty";
|
|
39
39
|
}
|
|
40
|
-
const
|
|
40
|
+
const Je = (e, t) => t ?? e === "number";
|
|
41
41
|
function ye(e, t, n, o) {
|
|
42
|
-
switch (
|
|
42
|
+
switch (Le(e)) {
|
|
43
43
|
case "text":
|
|
44
44
|
return e;
|
|
45
45
|
case "number": {
|
|
@@ -56,10 +56,10 @@ function ye(e, t, n, o) {
|
|
|
56
56
|
return null;
|
|
57
57
|
}
|
|
58
58
|
}
|
|
59
|
-
function
|
|
59
|
+
function Ee(e, t) {
|
|
60
60
|
if (!Y(e)) {
|
|
61
|
-
if (t) return
|
|
62
|
-
switch (
|
|
61
|
+
if (t) return Ee(t(e));
|
|
62
|
+
switch (Le(e)) {
|
|
63
63
|
case "text":
|
|
64
64
|
return e;
|
|
65
65
|
case "number":
|
|
@@ -74,10 +74,10 @@ function ze(e, t) {
|
|
|
74
74
|
}
|
|
75
75
|
}
|
|
76
76
|
const un = "ja", dn = "nein";
|
|
77
|
-
function
|
|
77
|
+
function qt(e, t) {
|
|
78
78
|
if (!Y(e)) {
|
|
79
|
-
if (t) return
|
|
80
|
-
switch (
|
|
79
|
+
if (t) return qt(t(e));
|
|
80
|
+
switch (Le(e)) {
|
|
81
81
|
case "text":
|
|
82
82
|
return e;
|
|
83
83
|
case "number":
|
|
@@ -91,15 +91,15 @@ function Rt(e, t) {
|
|
|
91
91
|
}
|
|
92
92
|
}
|
|
93
93
|
}
|
|
94
|
-
const
|
|
95
|
-
function
|
|
94
|
+
const Xe = "absent", pe = (e) => Y(e) ? Xe : e instanceof Date ? `value:${e.getTime()}` : `value:${String(e)}`, at = (e) => e instanceof Date ? e.getTime() : typeof e == "number" && !Number.isNaN(e) ? e : void 0;
|
|
95
|
+
function Qe(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;
|
|
99
|
-
if (o === "distinct") return new Set(n.map(
|
|
100
|
-
const r = n.filter((c) =>
|
|
99
|
+
if (o === "distinct") return new Set(n.map(pe)).size;
|
|
100
|
+
const r = n.filter((c) => at(c) !== void 0);
|
|
101
101
|
if (r.length === 0) return;
|
|
102
|
-
const s = r.map((c) =>
|
|
102
|
+
const s = r.map((c) => at(c)), i = r[0] instanceof Date, a = (c) => i ? new Date(c) : c;
|
|
103
103
|
switch (o) {
|
|
104
104
|
case "sum":
|
|
105
105
|
return s.reduce((c, u) => c + u, 0);
|
|
@@ -113,58 +113,58 @@ function Xe(e, t) {
|
|
|
113
113
|
return [a(Math.min(...s)), a(Math.max(...s))];
|
|
114
114
|
}
|
|
115
115
|
}
|
|
116
|
-
const
|
|
116
|
+
const Ze = 3, Se = (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 Ie(e, t, n) {
|
|
121
121
|
const o = Se(e), r = Se(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 fn(e, t) {
|
|
125
|
-
const n = t.compareText ??
|
|
126
|
-
var
|
|
125
|
+
const n = t.compareText ?? Ct.compareText, o = (r, s, i) => {
|
|
126
|
+
var v;
|
|
127
127
|
const a = /* @__PURE__ */ new Map(), c = t.levels[s];
|
|
128
128
|
if (!c) return [];
|
|
129
129
|
const u = /* @__PURE__ */ new Map();
|
|
130
|
-
for (const
|
|
131
|
-
const
|
|
130
|
+
for (const p of r) {
|
|
131
|
+
const _ = c.value(p), S = pe(_);
|
|
132
132
|
let C = u.get(S);
|
|
133
133
|
C || (C = {
|
|
134
134
|
path: JSON.stringify([...i, S]),
|
|
135
|
-
value: Y(
|
|
135
|
+
value: Y(_) ? void 0 : _,
|
|
136
136
|
level: s,
|
|
137
137
|
rows: [],
|
|
138
138
|
groups: [],
|
|
139
139
|
aggregates: {}
|
|
140
|
-
}, u.set(S, C), a.set(C, [...i, S])), C.rows.push(
|
|
140
|
+
}, u.set(S, C), a.set(C, [...i, S])), C.rows.push(p);
|
|
141
141
|
}
|
|
142
|
-
for (const
|
|
143
|
-
for (const
|
|
144
|
-
const h = (
|
|
145
|
-
(
|
|
146
|
-
var
|
|
147
|
-
return
|
|
142
|
+
for (const p of u.values())
|
|
143
|
+
for (const _ of t.aggregates ?? []) p.aggregates[_.id] = Qe(_, p.rows);
|
|
144
|
+
const h = (v = t.sort) == null ? void 0 : v.find(
|
|
145
|
+
(p) => {
|
|
146
|
+
var _;
|
|
147
|
+
return p.column === c.id || ((_ = t.aggregates) == null ? void 0 : _.some((S) => S.id === p.column));
|
|
148
148
|
}
|
|
149
|
-
), d = (h == null ? void 0 : h.direction) === "desc" ? -1 : 1, m = h !== void 0 && h.column !== c.id ? h.column : void 0,
|
|
150
|
-
let
|
|
151
|
-
for (const S of
|
|
149
|
+
), d = (h == null ? void 0 : h.direction) === "desc" ? -1 : 1, m = h !== void 0 && h.column !== c.id ? h.column : void 0, b = (p) => {
|
|
150
|
+
let _;
|
|
151
|
+
for (const S of p.rows) {
|
|
152
152
|
const C = c.order(S);
|
|
153
|
-
Se(C) !== void 0 && (
|
|
153
|
+
Se(C) !== void 0 && (_ === void 0 || Ie(C, _, n) < 0) && (_ = C);
|
|
154
154
|
}
|
|
155
|
-
return
|
|
156
|
-
},
|
|
157
|
-
if (m === void 0) return c.order ?
|
|
158
|
-
const
|
|
159
|
-
return Array.isArray(
|
|
160
|
-
},
|
|
161
|
-
if (
|
|
162
|
-
const S =
|
|
163
|
-
return Se(S) === void 0 || Se(C) === void 0 ?
|
|
155
|
+
return _;
|
|
156
|
+
}, w = (p) => {
|
|
157
|
+
if (m === void 0) return c.order ? b(p) : p.value;
|
|
158
|
+
const _ = p.aggregates[m];
|
|
159
|
+
return Array.isArray(_) ? _[0] : _;
|
|
160
|
+
}, g = [...u.values()].sort((p, _) => {
|
|
161
|
+
if (p.value === void 0 || _.value === void 0) return Ie(p.value, _.value, n);
|
|
162
|
+
const S = w(p), C = w(_), D = Ie(S, C, n);
|
|
163
|
+
return Se(S) === void 0 || Se(C) === void 0 ? D : D * d;
|
|
164
164
|
});
|
|
165
|
-
for (const
|
|
166
|
-
|
|
167
|
-
return
|
|
165
|
+
for (const p of g)
|
|
166
|
+
p.groups = o(p.rows, s + 1, a.get(p));
|
|
167
|
+
return g;
|
|
168
168
|
};
|
|
169
169
|
return o(e, 0, []);
|
|
170
170
|
}
|
|
@@ -175,12 +175,12 @@ function hn(e, t) {
|
|
|
175
175
|
};
|
|
176
176
|
return o(e), t.filter((r) => n.has(r));
|
|
177
177
|
}
|
|
178
|
-
const
|
|
178
|
+
const pn = (e) => (t) => {
|
|
179
179
|
if (!(t instanceof Date) || Number.isNaN(t.getTime())) return;
|
|
180
180
|
const n = t.getFullYear(), o = t.getMonth(), r = t.getDate();
|
|
181
181
|
return e === "year" ? new Date(n, 0, 1) : e === "month" ? new Date(n, o, 1) : e === "week" ? new Date(n, o, r - (t.getDay() + 6) % 7) : new Date(n, o, r);
|
|
182
182
|
};
|
|
183
|
-
function
|
|
183
|
+
function gn(e) {
|
|
184
184
|
const t = new Date(e.getFullYear(), e.getMonth(), e.getDate() + 3 - (e.getDay() + 6) % 7), n = new Date(t.getFullYear(), 0, 4);
|
|
185
185
|
return { week: 1 + Math.round((t.getTime() - n.getTime()) / 864e5 / 7 - ((n.getDay() + 6) % 7 - 3) / 7), year: t.getFullYear() };
|
|
186
186
|
}
|
|
@@ -188,12 +188,12 @@ function mn(e, t, n, o) {
|
|
|
188
188
|
if (e === "year") return String(t.getFullYear());
|
|
189
189
|
if (e === "month") return n.month(t);
|
|
190
190
|
if (e === "week") {
|
|
191
|
-
const { week: r, year: s } =
|
|
191
|
+
const { week: r, year: s } = gn(t);
|
|
192
192
|
return o.calendarWeek(r, s);
|
|
193
193
|
}
|
|
194
194
|
return n.date(t);
|
|
195
195
|
}
|
|
196
|
-
function
|
|
196
|
+
function bn(e, t) {
|
|
197
197
|
const n = [], o = (r, s) => {
|
|
198
198
|
for (const i of r) {
|
|
199
199
|
const a = t.has(i.path);
|
|
@@ -205,12 +205,12 @@ function wn(e, t) {
|
|
|
205
205
|
};
|
|
206
206
|
return o(e, []), n;
|
|
207
207
|
}
|
|
208
|
-
function
|
|
208
|
+
function vn(e, t, n) {
|
|
209
209
|
const o = n > 0 ? n : e.length || 1, r = Math.max(1, Math.ceil(e.length / o)), s = Math.min(Math.max(1, t), r), i = e.slice((s - 1) * o, s * o);
|
|
210
|
-
return { lines:
|
|
210
|
+
return { lines: Rt(i), page: s, pageCount: r };
|
|
211
211
|
}
|
|
212
|
-
const
|
|
213
|
-
function
|
|
212
|
+
const et = (e) => e.flatMap((t) => t.kind === "row" ? [t.row] : []);
|
|
213
|
+
function Rt(e) {
|
|
214
214
|
const t = e[0];
|
|
215
215
|
if (!t) return [...e];
|
|
216
216
|
const n = t.parents.map((r, s) => ({
|
|
@@ -221,14 +221,14 @@ function Lt(e) {
|
|
|
221
221
|
})), o = t.kind === "row" && t.span && !t.first ? { ...t, first: !0, continued: !0 } : t;
|
|
222
222
|
return [...n, o, ...e.slice(1)];
|
|
223
223
|
}
|
|
224
|
-
function
|
|
224
|
+
function tt(e, t) {
|
|
225
225
|
return t != null && t.length ? [
|
|
226
226
|
...t.map((n) => e.find((o) => o.id === n)).filter((n) => n !== void 0),
|
|
227
227
|
...e.filter((n) => !t.includes(n.id))
|
|
228
228
|
] : e;
|
|
229
229
|
}
|
|
230
|
-
const
|
|
231
|
-
function
|
|
230
|
+
const we = (e) => e == null || typeof e == "number" && Number.isNaN(e), wn = (e, t) => typeof e == "number" && typeof t == "number" ? e - t : Ct.compareText(String(e), String(t));
|
|
231
|
+
function nt(e, t, n) {
|
|
232
232
|
var x;
|
|
233
233
|
const {
|
|
234
234
|
search: o = "",
|
|
@@ -238,202 +238,202 @@ function tt(e, t, n) {
|
|
|
238
238
|
pageSize: a,
|
|
239
239
|
hidden: c,
|
|
240
240
|
order: u
|
|
241
|
-
} = n, h =
|
|
242
|
-
const
|
|
243
|
-
return !
|
|
244
|
-
}),
|
|
245
|
-
const
|
|
246
|
-
if (!
|
|
247
|
-
const
|
|
248
|
-
return N ? (
|
|
249
|
-
const
|
|
250
|
-
return
|
|
251
|
-
} : (
|
|
241
|
+
} = n, h = tt(t, u), d = c != null && c.length ? h.filter((A) => A.hideable === !1 || !c.includes(A.id)) : h, m = o.trim().toLowerCase(), b = t.filter((A) => A.searchable && A.value), w = (A) => !m || b.some((y) => {
|
|
242
|
+
const O = y.value(A);
|
|
243
|
+
return !we(O) && String(O).toLowerCase().includes(m);
|
|
244
|
+
}), g = e.filter((A) => w(A) && (r ? r(A) : !0)), v = Array.isArray(s) ? s : s ? [s] : [], p = v.map((A) => {
|
|
245
|
+
const y = t.find((M) => M.id === A.column);
|
|
246
|
+
if (!y || !y.compare && !y.value) return null;
|
|
247
|
+
const O = A.direction === "asc" ? 1 : -1, q = y.compare, N = y.value;
|
|
248
|
+
return N ? (M, E) => {
|
|
249
|
+
const I = N(M), K = N(E);
|
|
250
|
+
return we(I) || we(K) ? we(I) === we(K) ? 0 : we(I) ? 1 : -1 : (q ? q(M, E) : wn(I, K)) * O;
|
|
251
|
+
} : (M, E) => q(M, E) * O;
|
|
252
252
|
}).filter((A) => A !== null);
|
|
253
|
-
if (
|
|
254
|
-
for (const
|
|
255
|
-
const
|
|
256
|
-
if (
|
|
253
|
+
if (p.length > 0 && g.sort((A, y) => {
|
|
254
|
+
for (const O of p) {
|
|
255
|
+
const q = O(A, y);
|
|
256
|
+
if (q !== 0) return q;
|
|
257
257
|
}
|
|
258
258
|
return 0;
|
|
259
259
|
}), (x = n.grouping) != null && x.levels.length) {
|
|
260
|
-
const { folded: A, ...
|
|
260
|
+
const { folded: A, ...y } = n.grouping, O = fn(g, { ...y, sort: v }), q = bn(O, A), N = vn(q, i, a ?? 0);
|
|
261
261
|
return {
|
|
262
262
|
columns: d,
|
|
263
|
-
filtered:
|
|
264
|
-
visible:
|
|
265
|
-
groups:
|
|
266
|
-
lines:
|
|
263
|
+
filtered: g,
|
|
264
|
+
visible: et(N.lines),
|
|
265
|
+
groups: O,
|
|
266
|
+
lines: q,
|
|
267
267
|
visibleLines: N.lines,
|
|
268
268
|
page: N.page,
|
|
269
269
|
pageCount: N.pageCount,
|
|
270
270
|
columnCount: d.length
|
|
271
271
|
};
|
|
272
272
|
}
|
|
273
|
-
const
|
|
273
|
+
const _ = a && a > 0 ? a : g.length || 1, S = Math.max(1, Math.ceil(g.length / _)), C = Math.min(Math.max(1, i), S), D = g.slice((C - 1) * _, C * _);
|
|
274
274
|
return {
|
|
275
275
|
columns: d,
|
|
276
|
-
filtered:
|
|
277
|
-
visible:
|
|
276
|
+
filtered: g,
|
|
277
|
+
visible: D,
|
|
278
278
|
page: C,
|
|
279
279
|
pageCount: S,
|
|
280
280
|
columnCount: d.length
|
|
281
281
|
};
|
|
282
282
|
}
|
|
283
283
|
function _n(e, t, n) {
|
|
284
|
-
const { rowKey: o, filter: r, defaultSort: s = null, initialView: i, virtual: a, grouping: c } = n, [u, h] =
|
|
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
285
|
var T;
|
|
286
286
|
return (T = i == null ? void 0 : i.sort) != null && T.length ? [...i.sort] : s ? Array.isArray(s) ? [...s] : [s] : [];
|
|
287
|
-
}), [
|
|
287
|
+
}), [b, w] = H((i == null ? void 0 : i.page) ?? 1), [g, v] = H(
|
|
288
288
|
(i == null ? void 0 : i.pageSize) ?? n.pageSize ?? 10
|
|
289
|
-
), [
|
|
289
|
+
), [p, _] = H([]), [S, C] = H((i == null ? void 0 : i.hidden) ?? []), [D, x] = H((i == null ? void 0 : i.order) ?? []), [A, y] = H(() => {
|
|
290
290
|
if (i != null && i.widths) return { ...i.widths };
|
|
291
291
|
const T = {};
|
|
292
|
-
for (const
|
|
293
|
-
|
|
292
|
+
for (const V of t)
|
|
293
|
+
V.width !== void 0 && (T[V.id] = V.width);
|
|
294
294
|
return T;
|
|
295
|
-
}),
|
|
296
|
-
() =>
|
|
295
|
+
}), O = a ? 0 : g, q = j(
|
|
296
|
+
() => nt(e, t, {
|
|
297
297
|
search: u,
|
|
298
298
|
filter: r,
|
|
299
299
|
sort: d,
|
|
300
|
-
page:
|
|
301
|
-
pageSize:
|
|
300
|
+
page: b,
|
|
301
|
+
pageSize: O,
|
|
302
302
|
hidden: S,
|
|
303
|
-
order:
|
|
303
|
+
order: D,
|
|
304
304
|
grouping: c
|
|
305
305
|
}),
|
|
306
|
-
[e, t, u, r, d,
|
|
307
|
-
), N = Qt(a ? (
|
|
306
|
+
[e, t, u, r, d, b, O, S, D, c]
|
|
307
|
+
), N = Qt(a ? (q.lines ?? q.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(T),
|
|
310
|
+
}), M = j(
|
|
311
|
+
() => a && q.lines ? q.lines.slice(N.from, N.to) : q.visibleLines,
|
|
312
|
+
[a, q.lines, q.visibleLines, N.from, N.to]
|
|
313
|
+
), E = j(
|
|
314
|
+
() => a ? M ? et(M) : q.filtered.slice(N.from, N.to) : q.visible,
|
|
315
|
+
[a, M, q.filtered, q.visible, N.from, N.to]
|
|
316
|
+
), I = j(() => q.filtered.map(o), [q.filtered, o]), K = cn(I), se = X((T) => {
|
|
317
|
+
h(T), w(1);
|
|
318
318
|
}, []), ae = X((T) => {
|
|
319
|
-
|
|
320
|
-
}, []), de = X((T,
|
|
321
|
-
m((
|
|
322
|
-
const ne =
|
|
323
|
-
if (!
|
|
324
|
-
const he =
|
|
319
|
+
v(T), w(1);
|
|
320
|
+
}, []), de = X((T, V = !1) => {
|
|
321
|
+
m((G) => {
|
|
322
|
+
const ne = G.find((he) => he.column === T);
|
|
323
|
+
if (!V) {
|
|
324
|
+
const he = G.length === 1 && (ne == null ? void 0 : ne.direction) === "asc" ? "desc" : "asc";
|
|
325
325
|
return [{ column: T, direction: he }];
|
|
326
326
|
}
|
|
327
|
-
return ne ? ne.direction === "asc" ?
|
|
327
|
+
return ne ? ne.direction === "asc" ? G.map(
|
|
328
328
|
(he) => he.column === T ? { column: T, direction: "desc" } : he
|
|
329
|
-
) :
|
|
330
|
-
}),
|
|
329
|
+
) : G.filter((he) => he.column !== T) : [...G, { column: T, direction: "asc" }];
|
|
330
|
+
}), w(1);
|
|
331
331
|
}, []), fe = X((T) => {
|
|
332
|
-
|
|
333
|
-
(
|
|
332
|
+
_(
|
|
333
|
+
(V) => V.includes(T) ? V.filter((G) => G !== T) : [...V, T]
|
|
334
334
|
);
|
|
335
|
-
}, []),
|
|
336
|
-
(T) =>
|
|
337
|
-
[
|
|
338
|
-
),
|
|
335
|
+
}, []), be = X(
|
|
336
|
+
(T) => p.includes(T),
|
|
337
|
+
[p]
|
|
338
|
+
), ve = X((T) => {
|
|
339
339
|
C(
|
|
340
|
-
(
|
|
340
|
+
(V) => V.includes(T) ? V.filter((G) => G !== T) : [...V, T]
|
|
341
341
|
);
|
|
342
|
-
}, []), ke = X((T,
|
|
343
|
-
|
|
344
|
-
if (
|
|
345
|
-
if (!(T in
|
|
346
|
-
const ne = { ...
|
|
342
|
+
}, []), ke = X((T, V) => {
|
|
343
|
+
y((G) => {
|
|
344
|
+
if (V === void 0) {
|
|
345
|
+
if (!(T in G)) return G;
|
|
346
|
+
const ne = { ...G };
|
|
347
347
|
return delete ne[T], ne;
|
|
348
348
|
}
|
|
349
|
-
return { ...
|
|
349
|
+
return { ...G, [T]: V };
|
|
350
350
|
});
|
|
351
351
|
}, []), le = X(
|
|
352
352
|
(T) => {
|
|
353
|
-
var
|
|
354
|
-
return (
|
|
353
|
+
var V;
|
|
354
|
+
return (V = d.find((G) => G.column === T)) == null ? void 0 : V.direction;
|
|
355
355
|
},
|
|
356
356
|
[d]
|
|
357
357
|
), te = X(
|
|
358
358
|
(T) => {
|
|
359
359
|
if (d.length < 2) return;
|
|
360
|
-
const
|
|
361
|
-
return
|
|
360
|
+
const V = d.findIndex((G) => G.column === T);
|
|
361
|
+
return V === -1 ? void 0 : V + 1;
|
|
362
362
|
},
|
|
363
363
|
[d]
|
|
364
|
-
), k =
|
|
365
|
-
() =>
|
|
366
|
-
[t,
|
|
367
|
-
),
|
|
364
|
+
), k = j(
|
|
365
|
+
() => tt(t, D).filter((T) => T.label !== void 0 && T.hideable !== !1).map((T) => ({ id: T.id, label: T.label, visible: !S.includes(T.id) })),
|
|
366
|
+
[t, D, S]
|
|
367
|
+
), R = n.pageSize ?? 10, $ = j(() => {
|
|
368
368
|
const T = {};
|
|
369
|
-
for (const
|
|
370
|
-
|
|
369
|
+
for (const V of t)
|
|
370
|
+
V.width !== void 0 && (T[V.id] = V.width);
|
|
371
371
|
return T;
|
|
372
|
-
}, [t]),
|
|
372
|
+
}, [t]), z = j(() => {
|
|
373
373
|
const T = {};
|
|
374
|
-
for (const [
|
|
375
|
-
|
|
374
|
+
for (const [V, G] of Object.entries(A))
|
|
375
|
+
$[V] !== G && (T[V] = G);
|
|
376
376
|
return T;
|
|
377
|
-
}, [A,
|
|
377
|
+
}, [A, $]), L = j(
|
|
378
378
|
() => s ? Array.isArray(s) ? s : [s] : [],
|
|
379
379
|
[s]
|
|
380
|
-
), J = d.length ===
|
|
381
|
-
(T,
|
|
382
|
-
var
|
|
383
|
-
return T.column === ((
|
|
380
|
+
), J = d.length === L.length && d.every(
|
|
381
|
+
(T, V) => {
|
|
382
|
+
var G, ne;
|
|
383
|
+
return T.column === ((G = L[V]) == null ? void 0 : G.column) && T.direction === ((ne = L[V]) == null ? void 0 : ne.direction);
|
|
384
384
|
}
|
|
385
|
-
), Z =
|
|
385
|
+
), Z = j(
|
|
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 &&
|
|
392
|
+
...!a && q.page > 1 ? { page: q.page } : {},
|
|
393
|
+
...!a && g !== R ? { pageSize: g } : {},
|
|
394
394
|
...S.length ? { hidden: S } : {},
|
|
395
|
-
...
|
|
396
|
-
...Object.keys(
|
|
395
|
+
...D.length ? { order: D } : {},
|
|
396
|
+
...Object.keys(z).length ? { widths: z } : {}
|
|
397
397
|
}),
|
|
398
398
|
[
|
|
399
399
|
a,
|
|
400
400
|
u,
|
|
401
401
|
d,
|
|
402
402
|
J,
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
403
|
+
q.page,
|
|
404
|
+
g,
|
|
405
|
+
R,
|
|
406
406
|
S,
|
|
407
|
-
|
|
408
|
-
|
|
407
|
+
D,
|
|
408
|
+
z
|
|
409
409
|
]
|
|
410
410
|
);
|
|
411
411
|
return {
|
|
412
|
-
...
|
|
413
|
-
visible:
|
|
414
|
-
visibleLines:
|
|
412
|
+
...q,
|
|
413
|
+
visible: E,
|
|
414
|
+
visibleLines: M,
|
|
415
415
|
virtual: a ? N : void 0,
|
|
416
416
|
view: Z,
|
|
417
417
|
search: u,
|
|
418
|
-
setSearch:
|
|
418
|
+
setSearch: se,
|
|
419
419
|
sort: d,
|
|
420
420
|
toggleSort: de,
|
|
421
421
|
sortDirectionOf: le,
|
|
422
422
|
sortRankOf: te,
|
|
423
|
-
setPage:
|
|
424
|
-
pageSize:
|
|
423
|
+
setPage: w,
|
|
424
|
+
pageSize: g,
|
|
425
425
|
setPageSize: ae,
|
|
426
|
-
expanded:
|
|
426
|
+
expanded: p,
|
|
427
427
|
toggleRow: fe,
|
|
428
|
-
isExpanded:
|
|
428
|
+
isExpanded: be,
|
|
429
429
|
hidden: S,
|
|
430
|
-
toggleColumn:
|
|
430
|
+
toggleColumn: ve,
|
|
431
431
|
columnChoices: k,
|
|
432
|
-
order:
|
|
432
|
+
order: D,
|
|
433
433
|
setOrder: x,
|
|
434
434
|
widths: A,
|
|
435
435
|
setWidth: ke,
|
|
436
|
-
selection:
|
|
436
|
+
selection: K
|
|
437
437
|
};
|
|
438
438
|
}
|
|
439
439
|
function yn() {
|
|
@@ -441,11 +441,11 @@ function yn() {
|
|
|
441
441
|
const e = import.meta;
|
|
442
442
|
return typeof ((t = e.env) == null ? void 0 : t.DEV) == "boolean" ? e.env.DEV : typeof process < "u" && (process != null && process.env) ? process.env.NODE_ENV !== "production" : !1;
|
|
443
443
|
}
|
|
444
|
-
const
|
|
445
|
-
function
|
|
446
|
-
!
|
|
444
|
+
const Lt = yn(), lt = /* @__PURE__ */ new Set();
|
|
445
|
+
function ge(e, t) {
|
|
446
|
+
!Lt || lt.has(e) || (lt.add(e), console.warn(`@umriss-ui/table: ${t}`));
|
|
447
447
|
}
|
|
448
|
-
const kn = "
|
|
448
|
+
const kn = "_frame_psm0q_11 _text_1hv7a_23", Sn = "_children_psm0q_23", Cn = "_scroll_psm0q_29 _scroll_1hv7a_40", Nn = "_footerTarget_psm0q_36", xn = "_table_psm0q_40", An = "_th_psm0q_48 _ring_1hv7a_65", Tn = "_sticky_psm0q_63", On = "_td_psm0q_71", Fn = "_rowHeader_psm0q_83", qn = "_compact_psm0q_99", Rn = "_numeric_psm0q_132", Ln = "_absent_psm0q_144", Mn = "_striped_psm0q_148", Vn = "_stickyCell_psm0q_172", Dn = "_sortButton_psm0q_187 _ring_1hv7a_65", In = "_sortIndicator_psm0q_212", Pn = "_sortArrow_psm0q_219", Bn = "_sortArrowDesc_psm0q_223", Gn = "_sortActive_psm0q_231", En = "_sortRank_psm0q_237", zn = "_thFlex_psm0q_245", Hn = "_footerKind_psm0q_270", jn = "_emptyCell_psm0q_278", $n = "_empty_psm0q_278", Kn = "_emptyTitle_psm0q_294", Wn = "_skeleton_psm0q_303", Yn = "_toolbar_psm0q_335 _text_1hv7a_23", Un = "_toolbarGroup_psm0q_349", Jn = "_toolbarInfo_psm0q_366", Xn = "_pagination_psm0q_372 _text_1hv7a_23", Qn = "_paginationControls_psm0q_385", Zn = "_pageSize_psm0q_392", eo = "_paginationStatus_psm0q_404", to = "_filterButton_psm0q_413 _ring_1hv7a_65", no = "_filterActive_psm0q_440", oo = "_filterPanel_psm0q_445", ro = "_filterContent_psm0q_458 _scroll_1hv7a_40", so = "_filterFooter_psm0q_469", io = "_filterLabel_psm0q_483", ao = "_filterValue_psm0q_493", lo = "_filteredCount_psm0q_499", co = "_rangeFields_psm0q_510", uo = "_rangePeriod_psm0q_520", fo = "_conditions_psm0q_526", ho = "_conditionButton_psm0q_532", po = "_condition_psm0q_526", go = "_columnsPanel_psm0q_556", mo = "_columnsList_psm0q_564", bo = "_columnsEntry_psm0q_573", vo = "_move_psm0q_585", wo = "_groupingChoice_psm0q_623", _o = "_groupingHeading_psm0q_629", yo = "_groupingOptions_psm0q_638", ko = "_groupingOption_psm0q_638 _ring_1hv7a_65", So = "_groupingLevel_psm0q_681", Co = "_groupingTag_psm0q_686", No = "_groupingTrigger_psm0q_693", xo = "_groupingPrefix_psm0q_698", Ao = "_groupingPath_psm0q_703", To = "_groupingSeparator_psm0q_707", Oo = "_groupHeader_psm0q_724", Fo = "_spanCell_psm0q_765", qo = "_groupFolded_psm0q_814", Ro = "_spanValue_psm0q_818", Lo = "_groupLabel_psm0q_819", Mo = "_spanText_psm0q_831", Vo = "_groupValue_psm0q_832", Do = "_groupCount_psm0q_839", Io = "_continued_psm0q_853", Po = "_spanSelect_psm0q_884", Bo = "_fold_psm0q_898", Go = "_foldClosed_psm0q_934", Eo = "_foldedCount_psm0q_944", zo = "_shareHost_psm0q_952", Ho = "_shareBar_psm0q_959", jo = "_expander_psm0q_971", $o = "_expanderOpen_psm0q_1006", Ko = "_detailRow_psm0q_1010", Wo = "_detailCell_psm0q_1010", Yo = "_actionsCell_psm0q_1018", Uo = "_actions_psm0q_1018", Jo = "_grip_psm0q_1046", Xo = "_virtualBody_psm0q_1087", Qo = "_virtualRow_psm0q_1103", Zo = "_fillerRow_psm0q_1127", er = "_control_psm0q_163", f = {
|
|
449
449
|
frame: kn,
|
|
450
450
|
children: Sn,
|
|
451
451
|
scroll: Cn,
|
|
@@ -453,25 +453,25 @@ const kn = "_frame_19w57_11 _text_1hv7a_23", Sn = "_children_19w57_23", Cn = "_s
|
|
|
453
453
|
table: xn,
|
|
454
454
|
th: An,
|
|
455
455
|
sticky: Tn,
|
|
456
|
-
td:
|
|
457
|
-
rowHeader:
|
|
458
|
-
compact:
|
|
459
|
-
numeric:
|
|
460
|
-
absent:
|
|
461
|
-
striped:
|
|
462
|
-
stickyCell:
|
|
463
|
-
sortButton:
|
|
464
|
-
sortIndicator:
|
|
465
|
-
sortArrow:
|
|
466
|
-
sortArrowDesc:
|
|
467
|
-
sortActive:
|
|
468
|
-
sortRank:
|
|
469
|
-
thFlex:
|
|
470
|
-
footerKind:
|
|
471
|
-
emptyCell:
|
|
472
|
-
empty:
|
|
473
|
-
emptyTitle:
|
|
474
|
-
skeleton:
|
|
456
|
+
td: On,
|
|
457
|
+
rowHeader: Fn,
|
|
458
|
+
compact: qn,
|
|
459
|
+
numeric: Rn,
|
|
460
|
+
absent: Ln,
|
|
461
|
+
striped: Mn,
|
|
462
|
+
stickyCell: Vn,
|
|
463
|
+
sortButton: Dn,
|
|
464
|
+
sortIndicator: In,
|
|
465
|
+
sortArrow: Pn,
|
|
466
|
+
sortArrowDesc: Bn,
|
|
467
|
+
sortActive: Gn,
|
|
468
|
+
sortRank: En,
|
|
469
|
+
thFlex: zn,
|
|
470
|
+
footerKind: Hn,
|
|
471
|
+
emptyCell: jn,
|
|
472
|
+
empty: $n,
|
|
473
|
+
emptyTitle: Kn,
|
|
474
|
+
skeleton: Wn,
|
|
475
475
|
toolbar: Yn,
|
|
476
476
|
toolbarGroup: Un,
|
|
477
477
|
toolbarInfo: Jn,
|
|
@@ -491,12 +491,12 @@ const kn = "_frame_19w57_11 _text_1hv7a_23", Sn = "_children_19w57_23", Cn = "_s
|
|
|
491
491
|
rangePeriod: uo,
|
|
492
492
|
conditions: fo,
|
|
493
493
|
conditionButton: ho,
|
|
494
|
-
condition:
|
|
495
|
-
columnsPanel:
|
|
494
|
+
condition: po,
|
|
495
|
+
columnsPanel: go,
|
|
496
496
|
columnsList: mo,
|
|
497
|
-
columnsEntry:
|
|
498
|
-
move:
|
|
499
|
-
groupingChoice:
|
|
497
|
+
columnsEntry: bo,
|
|
498
|
+
move: vo,
|
|
499
|
+
groupingChoice: wo,
|
|
500
500
|
groupingHeading: _o,
|
|
501
501
|
groupingOptions: yo,
|
|
502
502
|
groupingOption: ko,
|
|
@@ -506,25 +506,25 @@ const kn = "_frame_19w57_11 _text_1hv7a_23", Sn = "_children_19w57_23", Cn = "_s
|
|
|
506
506
|
groupingPrefix: xo,
|
|
507
507
|
groupingPath: Ao,
|
|
508
508
|
groupingSeparator: To,
|
|
509
|
-
groupHeader:
|
|
510
|
-
spanCell:
|
|
511
|
-
groupFolded:
|
|
512
|
-
spanValue:
|
|
513
|
-
groupLabel:
|
|
514
|
-
spanText:
|
|
515
|
-
groupValue:
|
|
516
|
-
groupCount:
|
|
517
|
-
continued:
|
|
518
|
-
spanSelect:
|
|
519
|
-
fold:
|
|
520
|
-
foldClosed:
|
|
521
|
-
foldedCount:
|
|
522
|
-
shareHost:
|
|
523
|
-
shareBar:
|
|
524
|
-
expander:
|
|
525
|
-
expanderOpen:
|
|
526
|
-
detailRow:
|
|
527
|
-
detailCell:
|
|
509
|
+
groupHeader: Oo,
|
|
510
|
+
spanCell: Fo,
|
|
511
|
+
groupFolded: qo,
|
|
512
|
+
spanValue: Ro,
|
|
513
|
+
groupLabel: Lo,
|
|
514
|
+
spanText: Mo,
|
|
515
|
+
groupValue: Vo,
|
|
516
|
+
groupCount: Do,
|
|
517
|
+
continued: Io,
|
|
518
|
+
spanSelect: Po,
|
|
519
|
+
fold: Bo,
|
|
520
|
+
foldClosed: Go,
|
|
521
|
+
foldedCount: Eo,
|
|
522
|
+
shareHost: zo,
|
|
523
|
+
shareBar: Ho,
|
|
524
|
+
expander: jo,
|
|
525
|
+
expanderOpen: $o,
|
|
526
|
+
detailRow: Ko,
|
|
527
|
+
detailCell: Wo,
|
|
528
528
|
actionsCell: Yo,
|
|
529
529
|
actions: Uo,
|
|
530
530
|
grip: Jo,
|
|
@@ -537,14 +537,14 @@ function Xs(e) {
|
|
|
537
537
|
return e;
|
|
538
538
|
}
|
|
539
539
|
const Ne = /* @__PURE__ */ new WeakMap();
|
|
540
|
-
function
|
|
540
|
+
function Mt(e, t) {
|
|
541
541
|
return Ne.set(e, t), e;
|
|
542
542
|
}
|
|
543
543
|
const tr = (e) => Ne.has(e);
|
|
544
544
|
function me(e) {
|
|
545
|
-
return e === "list" ? ir : e === "range" ?
|
|
545
|
+
return e === "list" ? ir : e === "range" ? pr : typeof e == "object" && e !== null ? e : void 0;
|
|
546
546
|
}
|
|
547
|
-
function
|
|
547
|
+
function Vt(e, t) {
|
|
548
548
|
if (t == null) return "empty";
|
|
549
549
|
const n = Ne.get(e);
|
|
550
550
|
return n ? n.isCondition(t) ? n.isEmpty(t) ? "empty" : "effective" : "foreign" : "effective";
|
|
@@ -557,8 +557,8 @@ function or(e, t, n) {
|
|
|
557
557
|
const o = Ne.get(e);
|
|
558
558
|
return o ? o.describeIn(t, n) : e.describe(t);
|
|
559
559
|
}
|
|
560
|
-
const
|
|
561
|
-
const o =
|
|
560
|
+
const ct = (e) => e instanceof Date ? e.getTime() : typeof e == "number" ? e : void 0, Dt = (e) => (t, n) => {
|
|
561
|
+
const o = ct(t.value), r = ct(n.value);
|
|
562
562
|
return o !== void 0 && r !== void 0 ? o - r : e.compareText(t.text, n.text);
|
|
563
563
|
};
|
|
564
564
|
function rr(e, t, n) {
|
|
@@ -573,14 +573,14 @@ function rr(e, t, n) {
|
|
|
573
573
|
const c = a instanceof Date ? `date:${a.getTime()}` : typeof a == "object" || typeof a == "function" ? a : `${typeof a}:${String(a)}`;
|
|
574
574
|
o.has(c) || o.set(c, a);
|
|
575
575
|
}
|
|
576
|
-
return { values: [...o.values()].map((i) => ({ value: i, text: String(i) })).sort(
|
|
576
|
+
return { values: [...o.values()].map((i) => ({ value: i, text: String(i) })).sort(Dt(n)).map(({ value: i }) => i), absent: r };
|
|
577
577
|
}
|
|
578
|
-
const
|
|
579
|
-
function
|
|
580
|
-
let t =
|
|
581
|
-
return t || (t = new Set(e.map(
|
|
578
|
+
const ut = /* @__PURE__ */ new WeakMap();
|
|
579
|
+
function ze(e) {
|
|
580
|
+
let t = ut.get(e);
|
|
581
|
+
return t || (t = new Set(e.map(pe)), ut.set(e, t)), t;
|
|
582
582
|
}
|
|
583
|
-
const
|
|
583
|
+
const He = (e, t) => Y(e) ? t.wording.cellAbsentValue : ye(e, t.format, t.formats, t.wording) ?? String(e);
|
|
584
584
|
function sr({
|
|
585
585
|
condition: e,
|
|
586
586
|
setCondition: t,
|
|
@@ -588,13 +588,13 @@ function sr({
|
|
|
588
588
|
absentOccurs: o = !1,
|
|
589
589
|
format: r
|
|
590
590
|
}) {
|
|
591
|
-
const s = ue(), i = U(), a =
|
|
592
|
-
const d = { formats: s, wording: i, format: r }, m = n.map((
|
|
593
|
-
m.sort(
|
|
594
|
-
const
|
|
595
|
-
return [...m, ...
|
|
596
|
-
}, [n, a, o, r, s, i]), u =
|
|
597
|
-
const m = u.has(d.key) ? a.filter((
|
|
591
|
+
const s = ue(), i = U(), a = j(() => e ?? [], [e]), c = j(() => {
|
|
592
|
+
const d = { formats: s, wording: i, format: r }, m = n.map((v) => ({ key: pe(v), text: He(v, d), value: v }));
|
|
593
|
+
m.sort(Dt(s));
|
|
594
|
+
const b = new Set(m.map((v) => v.key)), w = a.filter((v) => !Y(v) && !b.has(pe(v))).map((v) => ({ key: pe(v), text: He(v, d), value: v })), g = o || a.some(Y) ? [{ key: Xe, text: i.cellAbsentValue, value: null }] : [];
|
|
595
|
+
return [...m, ...w, ...g];
|
|
596
|
+
}, [n, a, o, r, s, i]), u = ze(a), h = (d) => {
|
|
597
|
+
const m = u.has(d.key) ? a.filter((b) => pe(b) !== d.key) : [...a, d.value];
|
|
598
598
|
t(m.length > 0 ? m : null);
|
|
599
599
|
};
|
|
600
600
|
return /* @__PURE__ */ l("div", { className: f.filterContent, children: c.map((d) => /* @__PURE__ */ l(
|
|
@@ -607,20 +607,20 @@ function sr({
|
|
|
607
607
|
d.key
|
|
608
608
|
)) });
|
|
609
609
|
}
|
|
610
|
-
const ir =
|
|
610
|
+
const ir = Mt(
|
|
611
611
|
{
|
|
612
|
-
matches: (e, t) =>
|
|
612
|
+
matches: (e, t) => ze(t).has(pe(e)),
|
|
613
613
|
Input: sr,
|
|
614
614
|
describe: (e) => e.map((t) => Y(t) ? "–" : String(t)).join(", ")
|
|
615
615
|
},
|
|
616
616
|
{
|
|
617
617
|
isCondition: (e) => Array.isArray(e),
|
|
618
618
|
isEmpty: (e) => e.length === 0,
|
|
619
|
-
absentMatches: (e) =>
|
|
619
|
+
absentMatches: (e) => ze(e).has(Xe),
|
|
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) => {
|
|
623
|
-
const n = e.map((r) =>
|
|
623
|
+
const n = e.map((r) => He(r, t));
|
|
624
624
|
if (n.length <= 2) return n.join(", ");
|
|
625
625
|
const o = n.length - 2;
|
|
626
626
|
return `${n.slice(0, 2).join(", ")} ${t.wording.moreValues(o, t.formats.count(o))}`;
|
|
@@ -628,7 +628,7 @@ const ir = Vt(
|
|
|
628
628
|
}
|
|
629
629
|
), ar = (e) => new Date(e.getFullYear(), e.getMonth(), e.getDate()).getTime(), lr = (e) => new Date(e.getFullYear(), e.getMonth(), e.getDate() + 1).getTime(), _e = (e) => typeof e == "number" && Number.isFinite(e), ce = (e) => e instanceof Date && !Number.isNaN(e.getTime()), cr = (e) => ce(e) ? ar(e) : _e(e) ? e : void 0, ur = (e) => ce(e) ? { value: lr(e), open: !0 } : _e(e) ? { value: e, open: !1 } : void 0, Ae = (e, t) => ce(e) ? t.formats.date(e) : ye(e, t.format, t.formats, t.wording) ?? String(e);
|
|
630
630
|
function dr({ condition: e, setCondition: t }) {
|
|
631
|
-
const n = U(), [o, r] =
|
|
631
|
+
const n = U(), [o, r] = H(null), s = o !== null, i = o ? o.from : _e(e == null ? void 0 : e.from) ? e.from : null, a = o ? o.to : _e(e == null ? void 0 : e.to) ? e.to : null, c = (u, h) => {
|
|
632
632
|
const d = { from: i, to: a, [u]: h };
|
|
633
633
|
if (d.from !== null && d.to !== null && d.from > d.to) {
|
|
634
634
|
r(d);
|
|
@@ -643,9 +643,9 @@ function dr({ condition: e, setCondition: t }) {
|
|
|
643
643
|
...d.to !== null ? { to: d.to } : {}
|
|
644
644
|
});
|
|
645
645
|
};
|
|
646
|
-
return /* @__PURE__ */
|
|
647
|
-
/* @__PURE__ */ l(
|
|
648
|
-
/* @__PURE__ */ l(
|
|
646
|
+
return /* @__PURE__ */ F("div", { className: f.rangeFields, children: [
|
|
647
|
+
/* @__PURE__ */ l(st, { label: n.filterFrom, children: /* @__PURE__ */ l(it, { size: "sm", value: i, invalid: s, onChange: (u) => c("from", u) }) }),
|
|
648
|
+
/* @__PURE__ */ l(st, { label: n.filterTo, error: s ? n.rangeInvalid : void 0, children: /* @__PURE__ */ l(it, { size: "sm", value: a, onChange: (u) => c("to", u) }) })
|
|
649
649
|
] });
|
|
650
650
|
}
|
|
651
651
|
function fr({ condition: e, setCondition: t }) {
|
|
@@ -663,7 +663,7 @@ function fr({ condition: e, setCondition: t }) {
|
|
|
663
663
|
function hr(e) {
|
|
664
664
|
return e.kind === "date" ? /* @__PURE__ */ l(fr, { ...e }) : /* @__PURE__ */ l(dr, { ...e });
|
|
665
665
|
}
|
|
666
|
-
const
|
|
666
|
+
const pr = Mt(
|
|
667
667
|
{
|
|
668
668
|
matches: (e, t) => {
|
|
669
669
|
const n = ce(e) ? e.getTime() : _e(e) ? e : void 0;
|
|
@@ -693,7 +693,7 @@ const gr = Vt(
|
|
|
693
693
|
}
|
|
694
694
|
}
|
|
695
695
|
);
|
|
696
|
-
class
|
|
696
|
+
class Pe {
|
|
697
697
|
constructor(t) {
|
|
698
698
|
P(this, "entries", /* @__PURE__ */ new Map());
|
|
699
699
|
/** Keys in the order of the running pass. */
|
|
@@ -720,7 +720,7 @@ class Be {
|
|
|
720
720
|
return this.dom = n, this.pass = n, o !== this.ordered().map((r) => r.key).join("|");
|
|
721
721
|
}
|
|
722
722
|
}
|
|
723
|
-
const
|
|
723
|
+
const dt = (e) => JSON.stringify([
|
|
724
724
|
e.id,
|
|
725
725
|
e.label,
|
|
726
726
|
typeof e.value == "string" ? e.value : "ƒ",
|
|
@@ -742,13 +742,13 @@ const ut = (e) => JSON.stringify([
|
|
|
742
742
|
!!e.ownGroupValue,
|
|
743
743
|
e.group,
|
|
744
744
|
e.groupable
|
|
745
|
-
]),
|
|
746
|
-
class
|
|
745
|
+
]), ft = (e, t) => e == null ? void 0 : e[t];
|
|
746
|
+
class gr {
|
|
747
747
|
constructor() {
|
|
748
|
-
P(this, "columns", new
|
|
749
|
-
P(this, "actions", new
|
|
748
|
+
P(this, "columns", new Pe("data-umriss-column"));
|
|
749
|
+
P(this, "actions", new Pe("data-umriss-action"));
|
|
750
750
|
/** The group keys: values to group by that are no column. */
|
|
751
|
-
P(this, "groupKeys", new
|
|
751
|
+
P(this, "groupKeys", new Pe("data-umriss-groupkey"));
|
|
752
752
|
P(this, "signatures", /* @__PURE__ */ new Map());
|
|
753
753
|
/** The row detail: the presentation of the `RowDetail` that registered last. */
|
|
754
754
|
P(this, "detail", null);
|
|
@@ -819,7 +819,7 @@ class pr {
|
|
|
819
819
|
/** A column registers during the render. Idempotent: the same spec changes no
|
|
820
820
|
version. */
|
|
821
821
|
registerColumn(t, n) {
|
|
822
|
-
const o = this.columns.entries.get(t), r =
|
|
822
|
+
const o = this.columns.entries.get(t), r = dt(n);
|
|
823
823
|
if (o) {
|
|
824
824
|
const s = o.spec;
|
|
825
825
|
this.signatures.get(t) !== r && this.structure++, (s.value !== n.value || s.ownSortValue !== n.ownSortValue || s.ownGroupValue !== n.ownGroupValue) && this.values++, (s.presentation !== n.presentation || s.ownExportValue !== n.ownExportValue || s.aggregate !== n.aggregate) && this.presentation++, o.spec = n;
|
|
@@ -829,7 +829,7 @@ class pr {
|
|
|
829
829
|
spec: n,
|
|
830
830
|
read: (i) => {
|
|
831
831
|
const a = s.spec.value;
|
|
832
|
-
return typeof a == "string" ?
|
|
832
|
+
return typeof a == "string" ? ft(i, a) : a(i);
|
|
833
833
|
}
|
|
834
834
|
};
|
|
835
835
|
this.columns.entries.set(t, s), this.structure++;
|
|
@@ -848,8 +848,8 @@ class pr {
|
|
|
848
848
|
const t = /* @__PURE__ */ new Set();
|
|
849
849
|
let n = 0;
|
|
850
850
|
for (const { spec: o } of this.columns.entries.values())
|
|
851
|
-
t.has(o.id) &&
|
|
852
|
-
n > 1 &&
|
|
851
|
+
t.has(o.id) && ge(`id:${o.id}`, `Two columns carry the id "${o.id}". The second one is passed over.`), t.add(o.id), o.rowHeader && n++;
|
|
852
|
+
n > 1 && ge("rowHeader", "More than one column is `rowHeader`. A table has at most one row header; the first one holds.");
|
|
853
853
|
}
|
|
854
854
|
/** The table says during the render whether its row header sticks. Idempotent. */
|
|
855
855
|
setStickyRowHeader(t) {
|
|
@@ -877,7 +877,7 @@ class pr {
|
|
|
877
877
|
/* --- Group keys and the grouping ---------------------------------------------- */
|
|
878
878
|
/** A group key registers during the render, as a column does. Idempotent. */
|
|
879
879
|
registerGroupKey(t, n) {
|
|
880
|
-
const o = this.groupKeys.entries.get(t), r =
|
|
880
|
+
const o = this.groupKeys.entries.get(t), r = dt(n);
|
|
881
881
|
if (o)
|
|
882
882
|
this.signatures.get(t) !== r && this.structure++, (o.spec.value !== n.value || o.spec.ownGroupValue !== n.ownGroupValue) && this.values++, o.spec = n;
|
|
883
883
|
else {
|
|
@@ -886,7 +886,7 @@ class pr {
|
|
|
886
886
|
spec: n,
|
|
887
887
|
read: (i) => {
|
|
888
888
|
const a = s.spec.value;
|
|
889
|
-
return typeof a == "string" ?
|
|
889
|
+
return typeof a == "string" ? ft(i, a) : a(i);
|
|
890
890
|
}
|
|
891
891
|
};
|
|
892
892
|
this.groupKeys.entries.set(t, s), this.structure++;
|
|
@@ -929,7 +929,7 @@ class pr {
|
|
|
929
929
|
each once. */
|
|
930
930
|
effectiveGrouping(t, n) {
|
|
931
931
|
const o = new Set(this.groupingEntries(n).map((r) => r.spec.id));
|
|
932
|
-
return [...new Set(t)].filter((r) => o.has(r)).slice(0,
|
|
932
|
+
return [...new Set(t)].filter((r) => o.has(r)).slice(0, Ze);
|
|
933
933
|
}
|
|
934
934
|
/** The levels and aggregates for the model - the same identity as long as
|
|
935
935
|
nothing changed that they read. */
|
|
@@ -943,10 +943,10 @@ class pr {
|
|
|
943
943
|
const h = c.read(u);
|
|
944
944
|
if (h == null) return;
|
|
945
945
|
const { ownGroupValue: d, group: m } = c.spec;
|
|
946
|
-
return d ? d(h) : m ?
|
|
946
|
+
return d ? d(h) : m ? pn(m)(h) : h;
|
|
947
947
|
},
|
|
948
948
|
/* A value of one's own is a name; its groups stand by what they hold. */
|
|
949
|
-
order: c.spec.ownGroupValue ? (u) =>
|
|
949
|
+
order: c.spec.ownGroupValue ? (u) => Ee(c.read(u), c.spec.ownSortValue) : void 0
|
|
950
950
|
})), i = this.orderedColumns().filter((c) => c.spec.aggregate !== void 0).map(
|
|
951
951
|
(c) => ({
|
|
952
952
|
id: c.spec.id,
|
|
@@ -990,14 +990,14 @@ class pr {
|
|
|
990
990
|
if (((i = this.modelCache) == null ? void 0 : i.key) === r && this.modelCache.rows === t && this.modelCache.formats === n)
|
|
991
991
|
return this.modelCache.columns;
|
|
992
992
|
const s = o.map((a) => {
|
|
993
|
-
const { spec: c } = a, u = this.kindOf(a, t), h = this.isSortable(a, t), d = c.searchable ?? u === "text", m = (
|
|
993
|
+
const { spec: c } = a, u = this.kindOf(a, t), h = this.isSortable(a, t), d = c.searchable ?? u === "text", m = (b) => Ee(a.read(b), c.ownSortValue);
|
|
994
994
|
return {
|
|
995
995
|
id: c.id,
|
|
996
996
|
label: c.label,
|
|
997
997
|
value: h || d ? m : void 0,
|
|
998
998
|
/* Text sorts with the provider's comparison, not with the built-in
|
|
999
999
|
German one (spec, the table of defaults). */
|
|
1000
|
-
compare: u === "text" && !c.ownSortValue ? (
|
|
1000
|
+
compare: u === "text" && !c.ownSortValue ? (b, w) => n.compareText(String(m(b)), String(m(w))) : void 0,
|
|
1001
1001
|
searchable: d,
|
|
1002
1002
|
hideable: !c.rowHeader,
|
|
1003
1003
|
resizable: c.resizable,
|
|
@@ -1033,7 +1033,7 @@ class pr {
|
|
|
1033
1033
|
hidden: o.hidden,
|
|
1034
1034
|
order: o.order,
|
|
1035
1035
|
grouping: this.groupingFor(t)
|
|
1036
|
-
}, s =
|
|
1036
|
+
}, s = nt(t.admitted, n, r), i = o.virtual ? mr(s, o.virtual.from, o.virtual.to) : s;
|
|
1037
1037
|
return this.projectionCache = { hook: t, columns: n, projection: i }, i;
|
|
1038
1038
|
}
|
|
1039
1039
|
/* --- The hook's snapshot ---------------------------------------------------------- */
|
|
@@ -1107,12 +1107,12 @@ class pr {
|
|
|
1107
1107
|
function mr(e, t, n) {
|
|
1108
1108
|
if (!e.lines) return { ...e, visible: e.filtered.slice(t, n) };
|
|
1109
1109
|
const o = e.lines.slice(t, n);
|
|
1110
|
-
return { ...e, visibleLines: o, visible:
|
|
1110
|
+
return { ...e, visibleLines: o, visible: et(o) };
|
|
1111
1111
|
}
|
|
1112
|
-
const
|
|
1113
|
-
|
|
1114
|
-
},
|
|
1115
|
-
function
|
|
1112
|
+
const It = /* @__PURE__ */ new WeakMap(), br = (e, t) => {
|
|
1113
|
+
It.set(e, t);
|
|
1114
|
+
}, vr = (e) => typeof e == "function" || typeof e == "object" && e !== null ? It.get(e) : void 0, B = (...e) => e.filter(Boolean).join(" ");
|
|
1115
|
+
function Pt({
|
|
1116
1116
|
entry: e,
|
|
1117
1117
|
registry: t,
|
|
1118
1118
|
hook: n,
|
|
@@ -1122,14 +1122,14 @@ function Bt({
|
|
|
1122
1122
|
setOpen: i,
|
|
1123
1123
|
panelId: a
|
|
1124
1124
|
}) {
|
|
1125
|
-
const c = U(), u = ue(), { id: h, label: d, format: m } = e.spec, { values:
|
|
1126
|
-
if (!
|
|
1127
|
-
const
|
|
1125
|
+
const c = U(), u = ue(), { id: h, label: d, format: m } = e.spec, { values: b, absent: w } = j(() => rr(n.admitted, e.read, u), [n.admitted, e, u]), g = me(e.spec.filter);
|
|
1126
|
+
if (!g) return null;
|
|
1127
|
+
const v = n.publicSnapshot, p = g.Input, _ = tr(g) ? { absentOccurs: w, format: m, kind: t.kindOf(e, n.rows) } : {}, S = () => {
|
|
1128
1128
|
var C;
|
|
1129
1129
|
i(!1), (C = (r ?? o).current) == null || C.focus();
|
|
1130
1130
|
};
|
|
1131
|
-
return /* @__PURE__ */
|
|
1132
|
-
|
|
1131
|
+
return /* @__PURE__ */ F(
|
|
1132
|
+
Nt,
|
|
1133
1133
|
{
|
|
1134
1134
|
open: s,
|
|
1135
1135
|
onOpenChange: i,
|
|
@@ -1141,36 +1141,36 @@ function Bt({
|
|
|
1141
1141
|
className: f.filterPanel,
|
|
1142
1142
|
children: [
|
|
1143
1143
|
/* @__PURE__ */ l(
|
|
1144
|
-
|
|
1144
|
+
p,
|
|
1145
1145
|
{
|
|
1146
|
-
condition:
|
|
1147
|
-
setCondition: (C) =>
|
|
1148
|
-
values:
|
|
1146
|
+
condition: v.filter[h] ?? null,
|
|
1147
|
+
setCondition: (C) => v.setFilter(h, C),
|
|
1148
|
+
values: b,
|
|
1149
1149
|
column: { id: h, label: d },
|
|
1150
|
-
...
|
|
1150
|
+
..._
|
|
1151
1151
|
}
|
|
1152
1152
|
),
|
|
1153
|
-
/* @__PURE__ */
|
|
1154
|
-
/* @__PURE__ */ l(ee, { size: "sm", variant: "ghost", onClick: () =>
|
|
1153
|
+
/* @__PURE__ */ F("div", { className: f.filterFooter, children: [
|
|
1154
|
+
/* @__PURE__ */ l(ee, { size: "sm", variant: "ghost", onClick: () => v.setFilter(h, null), children: c.filterReset }),
|
|
1155
1155
|
/* @__PURE__ */ l(ee, { size: "sm", onClick: S, children: c.filterDone })
|
|
1156
1156
|
] })
|
|
1157
1157
|
]
|
|
1158
1158
|
}
|
|
1159
1159
|
);
|
|
1160
1160
|
}
|
|
1161
|
-
function
|
|
1161
|
+
function wr({
|
|
1162
1162
|
entry: e,
|
|
1163
1163
|
registry: t,
|
|
1164
1164
|
hook: n
|
|
1165
1165
|
}) {
|
|
1166
|
-
const o = U(), [r, s] =
|
|
1167
|
-
return /* @__PURE__ */
|
|
1166
|
+
const o = U(), [r, s] = H(!1), i = re(null), a = ie(), { id: c, label: u } = e.spec, h = c in n.publicSnapshot.filter;
|
|
1167
|
+
return /* @__PURE__ */ F(Q, { children: [
|
|
1168
1168
|
/* @__PURE__ */ l(
|
|
1169
1169
|
"button",
|
|
1170
1170
|
{
|
|
1171
1171
|
ref: i,
|
|
1172
1172
|
type: "button",
|
|
1173
|
-
className:
|
|
1173
|
+
className: B(f.filterButton, h && f.filterActive),
|
|
1174
1174
|
"aria-label": o.filterColumn(u),
|
|
1175
1175
|
"aria-haspopup": "dialog",
|
|
1176
1176
|
"aria-expanded": r,
|
|
@@ -1190,7 +1190,7 @@ function vr({
|
|
|
1190
1190
|
}
|
|
1191
1191
|
),
|
|
1192
1192
|
/* @__PURE__ */ l(
|
|
1193
|
-
|
|
1193
|
+
Pt,
|
|
1194
1194
|
{
|
|
1195
1195
|
entry: e,
|
|
1196
1196
|
registry: t,
|
|
@@ -1210,7 +1210,7 @@ function _r({ registry: e, hook: t }) {
|
|
|
1210
1210
|
const u = { formats: o, wording: n, format: a.spec.format, kind: e.kindOf(a, t.rows) };
|
|
1211
1211
|
return [{ entry: a, text: or(c, i, u) }];
|
|
1212
1212
|
});
|
|
1213
|
-
return r.length === 0 ? null : /* @__PURE__ */ l(
|
|
1213
|
+
return r.length === 0 ? null : /* @__PURE__ */ l(xt, { "aria-label": n.conditions, className: f.conditions, children: r.map(({ entry: s, text: i }) => /* @__PURE__ */ l(yr, { entry: s, text: i, registry: e, hook: t }, s.spec.id)) });
|
|
1214
1214
|
}
|
|
1215
1215
|
function yr({
|
|
1216
1216
|
entry: e,
|
|
@@ -1218,16 +1218,16 @@ function yr({
|
|
|
1218
1218
|
registry: n,
|
|
1219
1219
|
hook: o
|
|
1220
1220
|
}) {
|
|
1221
|
-
const r = U(), [s, i] =
|
|
1222
|
-
return /* @__PURE__ */
|
|
1221
|
+
const r = U(), [s, i] = H(!1), a = re(null), c = re(null), u = ie(), { id: h, label: d } = e.spec;
|
|
1222
|
+
return /* @__PURE__ */ F(Q, { children: [
|
|
1223
1223
|
/* @__PURE__ */ l(
|
|
1224
|
-
|
|
1224
|
+
At,
|
|
1225
1225
|
{
|
|
1226
1226
|
ref: a,
|
|
1227
1227
|
className: f.condition,
|
|
1228
1228
|
onRemove: () => o.publicSnapshot.setFilter(h, null),
|
|
1229
1229
|
removeLabel: r.removeConditionNamed(d, t),
|
|
1230
|
-
children: /* @__PURE__ */
|
|
1230
|
+
children: /* @__PURE__ */ F(
|
|
1231
1231
|
"button",
|
|
1232
1232
|
{
|
|
1233
1233
|
ref: c,
|
|
@@ -1247,7 +1247,7 @@ function yr({
|
|
|
1247
1247
|
}
|
|
1248
1248
|
),
|
|
1249
1249
|
/* @__PURE__ */ l(
|
|
1250
|
-
|
|
1250
|
+
Pt,
|
|
1251
1251
|
{
|
|
1252
1252
|
entry: e,
|
|
1253
1253
|
registry: n,
|
|
@@ -1261,32 +1261,32 @@ function yr({
|
|
|
1261
1261
|
)
|
|
1262
1262
|
] });
|
|
1263
1263
|
}
|
|
1264
|
-
const
|
|
1265
|
-
`, Sr = "\uFEFF", Cr = (e) => String(e).replace(".", ","),
|
|
1264
|
+
const ht = ";", kr = `\r
|
|
1265
|
+
`, Sr = "\uFEFF", Cr = (e) => String(e).replace(".", ","), Bt = (e) => /[";\r\n]/.test(e) ? `"${e.replace(/"/g, '""')}"` : e, Nr = (e, t) => {
|
|
1266
1266
|
var o;
|
|
1267
1267
|
const n = (o = t.value) == null ? void 0 : o.call(t, e);
|
|
1268
|
-
return n == null ? "" :
|
|
1268
|
+
return n == null ? "" : Bt(typeof n == "number" ? Cr(n) : String(n));
|
|
1269
1269
|
};
|
|
1270
1270
|
function xr(e, t) {
|
|
1271
|
-
const n = t.map((r) =>
|
|
1271
|
+
const n = t.map((r) => Bt(r.label ?? r.id)).join(ht), o = e.map((r) => t.map((s) => Nr(r, s)).join(ht));
|
|
1272
1272
|
return Sr + [n, ...o].join(kr);
|
|
1273
1273
|
}
|
|
1274
|
-
function
|
|
1274
|
+
function Gt(e) {
|
|
1275
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);
|
|
1276
1276
|
return e.withStickyHeaderFirst(n.map((o) => ({ id: o.spec.id, e: o }))).map(({ e: o }) => o);
|
|
1277
1277
|
}
|
|
1278
|
-
function
|
|
1278
|
+
function Et(e) {
|
|
1279
1279
|
e.setSearch("");
|
|
1280
1280
|
for (const t of Object.keys(e.filter)) e.setFilter(t, null);
|
|
1281
1281
|
}
|
|
1282
1282
|
function Ar(e) {
|
|
1283
1283
|
const t = e.hook;
|
|
1284
1284
|
if (!t) return "";
|
|
1285
|
-
const n =
|
|
1285
|
+
const n = Gt(e).filter((o) => e.kindOf(o, t.rows) !== "other" || o.spec.ownExportValue).map(
|
|
1286
1286
|
(o) => ({
|
|
1287
1287
|
id: o.spec.id,
|
|
1288
1288
|
label: o.spec.label,
|
|
1289
|
-
value: (r) =>
|
|
1289
|
+
value: (r) => qt(o.read(r), o.spec.ownExportValue)
|
|
1290
1290
|
})
|
|
1291
1291
|
);
|
|
1292
1292
|
return xr(e.projection().filtered, n);
|
|
@@ -1295,22 +1295,22 @@ const Tr = (e, t, n) => {
|
|
|
1295
1295
|
var o;
|
|
1296
1296
|
return ((o = e.groupingEntries(t.rows).find((r) => r.spec.id === n)) == null ? void 0 : o.spec.label) ?? n;
|
|
1297
1297
|
};
|
|
1298
|
-
function
|
|
1298
|
+
function Or({ registry: e, hook: t }) {
|
|
1299
1299
|
const n = U(), o = e.groupingEntries(t.rows);
|
|
1300
1300
|
if (o.length === 0) return null;
|
|
1301
1301
|
const { grouping: r, setGrouping: s } = t.publicSnapshot;
|
|
1302
|
-
return /* @__PURE__ */
|
|
1302
|
+
return /* @__PURE__ */ F("section", { className: f.groupingChoice, "aria-label": n.grouping, children: [
|
|
1303
1303
|
/* @__PURE__ */ l("h3", { className: f.groupingHeading, children: n.grouping }),
|
|
1304
1304
|
/* @__PURE__ */ l("div", { className: f.groupingOptions, children: o.map((i) => {
|
|
1305
1305
|
const { id: a, label: c } = i.spec, u = r.indexOf(a), h = u !== -1;
|
|
1306
|
-
return /* @__PURE__ */
|
|
1306
|
+
return /* @__PURE__ */ F(
|
|
1307
1307
|
"button",
|
|
1308
1308
|
{
|
|
1309
1309
|
type: "button",
|
|
1310
1310
|
className: f.groupingOption,
|
|
1311
1311
|
"aria-label": n.groupBy(c),
|
|
1312
1312
|
"aria-pressed": h,
|
|
1313
|
-
disabled: !h && r.length >=
|
|
1313
|
+
disabled: !h && r.length >= Ze,
|
|
1314
1314
|
onClick: () => s(h ? r.filter((d) => d !== a) : [...r, a]),
|
|
1315
1315
|
children: [
|
|
1316
1316
|
h && /* @__PURE__ */ l("span", { className: f.groupingLevel, "aria-hidden": "true", children: u + 1 }),
|
|
@@ -1322,34 +1322,34 @@ function Fr({ registry: e, hook: t }) {
|
|
|
1322
1322
|
}) })
|
|
1323
1323
|
] });
|
|
1324
1324
|
}
|
|
1325
|
-
function
|
|
1325
|
+
function Fr({ registry: e, hook: t }) {
|
|
1326
1326
|
const n = U(), o = t.publicSnapshot, { grouping: r } = o;
|
|
1327
1327
|
if (r.length === 0) return null;
|
|
1328
1328
|
const s = r.map((i) => Tr(e, t, i));
|
|
1329
1329
|
return (
|
|
1330
1330
|
/* In a tag group, as the conditions stand: the tag is one stop, its button
|
|
1331
1331
|
the thing one tabs to, and the ring stands on the tag. */
|
|
1332
|
-
/* @__PURE__ */ l(
|
|
1333
|
-
|
|
1332
|
+
/* @__PURE__ */ l(xt, { "aria-label": n.groupedBy, className: f.groupingTag, children: /* @__PURE__ */ l(At, { onRemove: () => o.setGrouping([]), removeLabel: n.removeGrouping, children: /* @__PURE__ */ F(
|
|
1333
|
+
Tt,
|
|
1334
1334
|
{
|
|
1335
|
-
trigger: /* @__PURE__ */
|
|
1335
|
+
trigger: /* @__PURE__ */ F("button", { type: "button", className: B(f.conditionButton, f.groupingTrigger), children: [
|
|
1336
1336
|
/* @__PURE__ */ l("span", { className: f.groupingPrefix, children: n.groupedBy }),
|
|
1337
|
-
s.map((i, a) => /* @__PURE__ */
|
|
1337
|
+
s.map((i, a) => /* @__PURE__ */ F("span", { className: f.groupingPath, children: [
|
|
1338
1338
|
a > 0 && /* @__PURE__ */ l("span", { className: f.groupingSeparator, "aria-hidden": "true", children: "›" }),
|
|
1339
1339
|
i
|
|
1340
1340
|
] }, r[a]))
|
|
1341
1341
|
] }),
|
|
1342
1342
|
children: [
|
|
1343
|
-
r.map((i, a) => /* @__PURE__ */ l(
|
|
1343
|
+
r.map((i, a) => /* @__PURE__ */ l(Oe, { onSelect: () => o.setGrouping(r.filter((c) => c !== i)), children: n.removeGroupingLevel(s[a]) }, i)),
|
|
1344
1344
|
/* @__PURE__ */ l(en, {}),
|
|
1345
|
-
/* @__PURE__ */ l(
|
|
1346
|
-
/* @__PURE__ */ l(
|
|
1345
|
+
/* @__PURE__ */ l(Oe, { onSelect: o.unfoldAll, children: n.unfoldAll }),
|
|
1346
|
+
/* @__PURE__ */ l(Oe, { onSelect: o.foldAll, children: n.foldAll })
|
|
1347
1347
|
]
|
|
1348
1348
|
}
|
|
1349
1349
|
) }) })
|
|
1350
1350
|
);
|
|
1351
1351
|
}
|
|
1352
|
-
function
|
|
1352
|
+
function zt({
|
|
1353
1353
|
registry: e,
|
|
1354
1354
|
className: t,
|
|
1355
1355
|
children: n,
|
|
@@ -1358,56 +1358,56 @@ function Ht({
|
|
|
1358
1358
|
const r = U(), s = ue(), i = (e == null ? void 0 : e.hook) ?? null;
|
|
1359
1359
|
let a = null, c = null;
|
|
1360
1360
|
if (e && i) {
|
|
1361
|
-
const u = i.publicSnapshot, h = u.search !== "" || Object.keys(u.filter).length > 0, d = o ? [] : u.filtered.filter((
|
|
1362
|
-
a = /* @__PURE__ */
|
|
1363
|
-
/* @__PURE__ */ l(
|
|
1361
|
+
const u = i.publicSnapshot, h = u.search !== "" || Object.keys(u.filter).length > 0, d = o ? [] : u.filtered.filter((b) => u.selection.isSelected(i.rowKey(b))), m = e.hasRowActions() ? e.actions.ordered().filter((b) => b.spec.bulk) : [];
|
|
1362
|
+
a = /* @__PURE__ */ F(Q, { children: [
|
|
1363
|
+
/* @__PURE__ */ l(Fr, { registry: e, hook: i }),
|
|
1364
1364
|
/* @__PURE__ */ l(_r, { registry: e, hook: i })
|
|
1365
|
-
] }), c = /* @__PURE__ */
|
|
1365
|
+
] }), c = /* @__PURE__ */ F("div", { className: f.toolbarGroup, children: [
|
|
1366
1366
|
/* @__PURE__ */ l("span", { role: "status", className: f.filteredCount, children: h ? r.filteredOfTotal(s.count(u.filtered.length), s.count(i.admitted.length)) : "" }),
|
|
1367
|
-
h && /* @__PURE__ */ l(ee, { size: "sm", variant: "ghost", onClick: () =>
|
|
1368
|
-
d.length > 0 && /* @__PURE__ */
|
|
1367
|
+
h && /* @__PURE__ */ l(ee, { size: "sm", variant: "ghost", onClick: () => Et(u), children: r.resetAll }),
|
|
1368
|
+
d.length > 0 && /* @__PURE__ */ F(Q, { children: [
|
|
1369
1369
|
/* @__PURE__ */ l("span", { className: f.toolbarInfo, children: r.selectedCount(d.length, s.count(d.length)) }),
|
|
1370
|
-
m.map(({ key:
|
|
1370
|
+
m.map(({ key: b, spec: w }) => /* @__PURE__ */ l(
|
|
1371
1371
|
ee,
|
|
1372
1372
|
{
|
|
1373
1373
|
size: "sm",
|
|
1374
|
-
variant:
|
|
1375
|
-
onClick: () =>
|
|
1376
|
-
children:
|
|
1374
|
+
variant: w.tone === "danger" ? "danger" : "secondary",
|
|
1375
|
+
onClick: () => w.onSelect(d),
|
|
1376
|
+
children: w.label
|
|
1377
1377
|
},
|
|
1378
|
-
|
|
1378
|
+
b
|
|
1379
1379
|
))
|
|
1380
1380
|
] })
|
|
1381
1381
|
] });
|
|
1382
1382
|
}
|
|
1383
|
-
return /* @__PURE__ */
|
|
1384
|
-
/* @__PURE__ */
|
|
1383
|
+
return /* @__PURE__ */ F("div", { className: B(f.toolbar, t), children: [
|
|
1384
|
+
/* @__PURE__ */ F("div", { className: f.toolbarGroup, children: [
|
|
1385
1385
|
n,
|
|
1386
1386
|
a
|
|
1387
1387
|
] }),
|
|
1388
1388
|
c
|
|
1389
1389
|
] });
|
|
1390
1390
|
}
|
|
1391
|
-
const
|
|
1392
|
-
},
|
|
1391
|
+
const je = St(null), qr = () => () => {
|
|
1392
|
+
}, pt = () => 0;
|
|
1393
1393
|
function xe(e) {
|
|
1394
1394
|
var r;
|
|
1395
|
-
const t = Ue(
|
|
1396
|
-
|
|
1397
|
-
n ? n.subscribe :
|
|
1398
|
-
n ? n.bodyVersion :
|
|
1399
|
-
n ? n.bodyVersion :
|
|
1395
|
+
const t = Ue(je), n = e ? vr(e.Table) ?? null : (t == null ? void 0 : t.registry) ?? null;
|
|
1396
|
+
qe(
|
|
1397
|
+
n ? n.subscribe : qr,
|
|
1398
|
+
n ? n.bodyVersion : pt,
|
|
1399
|
+
n ? n.bodyVersion : pt
|
|
1400
1400
|
);
|
|
1401
1401
|
const o = (r = n == null ? void 0 : n.hook) == null ? void 0 : r.publicSnapshot;
|
|
1402
1402
|
return !n || !o ? null : { registry: n, snapshot: o, inside: !e && t !== null, footerTarget: e ? null : (t == null ? void 0 : t.footerTarget) ?? null };
|
|
1403
1403
|
}
|
|
1404
|
-
function
|
|
1405
|
-
return /* @__PURE__ */
|
|
1404
|
+
function Ht({ wording: e }) {
|
|
1405
|
+
return /* @__PURE__ */ F(Q, { children: [
|
|
1406
1406
|
/* @__PURE__ */ l("span", { "aria-hidden": "true", className: f.absent, children: "—" }),
|
|
1407
|
-
/* @__PURE__ */ l(
|
|
1407
|
+
/* @__PURE__ */ l(Re, { children: e.cellAbsentValue })
|
|
1408
1408
|
] });
|
|
1409
1409
|
}
|
|
1410
|
-
const
|
|
1410
|
+
const Rr = { sum: "Σ", avg: "⌀", min: "min", max: "max" }, Lr = (e, t) => ({
|
|
1411
1411
|
sum: t.footerSum,
|
|
1412
1412
|
avg: t.footerAverage,
|
|
1413
1413
|
min: t.footerMinimum,
|
|
@@ -1416,7 +1416,7 @@ const Lr = { sum: "Σ", avg: "⌀", min: "min", max: "max" }, Mr = (e, t) => ({
|
|
|
1416
1416
|
count: t.footerCount,
|
|
1417
1417
|
distinct: t.footerDistinct
|
|
1418
1418
|
})[e] ?? t.footerAggregate;
|
|
1419
|
-
function
|
|
1419
|
+
function $e({
|
|
1420
1420
|
entry: e,
|
|
1421
1421
|
rows: t,
|
|
1422
1422
|
formats: n,
|
|
@@ -1425,33 +1425,33 @@ function Ke({
|
|
|
1425
1425
|
}) {
|
|
1426
1426
|
const { aggregate: s, format: i, presentation: a } = e.spec;
|
|
1427
1427
|
if (!s) return null;
|
|
1428
|
-
const c = typeof s == "function" ? "own" : s, u =
|
|
1428
|
+
const c = typeof s == "function" ? "own" : s, u = Qe({ id: e.spec.id, read: e.read, aggregate: s }, t), h = (b) => ye(b, i, n, o);
|
|
1429
1429
|
let d;
|
|
1430
|
-
if (Y(u)) d = /* @__PURE__ */ l(
|
|
1431
|
-
else if (c === "range" && i === "date" &&
|
|
1432
|
-
const [
|
|
1433
|
-
d =
|
|
1430
|
+
if (Y(u)) d = /* @__PURE__ */ l(Ht, { wording: o });
|
|
1431
|
+
else if (c === "range" && i === "date" && Mr(u)) {
|
|
1432
|
+
const [b, w] = u;
|
|
1433
|
+
d = b.getTime() === w.getTime() ? n.date(b) : o.rangeFromTo(n.dateShort(b), n.dateShort(w));
|
|
1434
1434
|
} else if (c === "count" || c === "distinct") d = n.count(u);
|
|
1435
1435
|
else if (c === "range") {
|
|
1436
|
-
const [
|
|
1437
|
-
d = h(
|
|
1436
|
+
const [b, w] = u;
|
|
1437
|
+
d = h(b) === h(w) ? h(b) : o.rangeFromTo(h(b) ?? "", h(w) ?? "");
|
|
1438
1438
|
} else c === "own" && a ? d = a(u, t[0]) : d = h(u);
|
|
1439
|
-
const m =
|
|
1440
|
-
return /* @__PURE__ */
|
|
1439
|
+
const m = Rr[c];
|
|
1440
|
+
return /* @__PURE__ */ F(Q, { children: [
|
|
1441
1441
|
r && m && /* @__PURE__ */ l("span", { "aria-hidden": "true", className: f.footerKind, children: m }),
|
|
1442
|
-
r && /* @__PURE__ */
|
|
1443
|
-
|
|
1442
|
+
r && /* @__PURE__ */ F(Re, { children: [
|
|
1443
|
+
Lr(c, o),
|
|
1444
1444
|
" "
|
|
1445
1445
|
] }),
|
|
1446
1446
|
d
|
|
1447
1447
|
] });
|
|
1448
1448
|
}
|
|
1449
|
-
const
|
|
1450
|
-
function
|
|
1449
|
+
const Mr = ([e, t]) => e instanceof Date && t instanceof Date && e.getFullYear() === t.getFullYear();
|
|
1450
|
+
function jt(e, t) {
|
|
1451
1451
|
const n = e.spec.aggregate;
|
|
1452
1452
|
return n === "count" || n === "distinct" ? !0 : e.spec.rightAligned !== void 0 ? e.spec.rightAligned : Ft(t, e.read) === "number";
|
|
1453
1453
|
}
|
|
1454
|
-
function
|
|
1454
|
+
function Vr(e, t) {
|
|
1455
1455
|
const n = /* @__PURE__ */ new Map();
|
|
1456
1456
|
for (const [o, r] of t) {
|
|
1457
1457
|
const s = e.get(o);
|
|
@@ -1459,38 +1459,38 @@ function Dr(e, t) {
|
|
|
1459
1459
|
}
|
|
1460
1460
|
return n;
|
|
1461
1461
|
}
|
|
1462
|
-
function
|
|
1462
|
+
function $t(e, t) {
|
|
1463
1463
|
const n = getComputedStyle(e).getPropertyValue(t).trim(), o = Number.parseFloat(n);
|
|
1464
1464
|
return Number.isFinite(o) ? n.endsWith("ms") ? o : o * 1e3 : 0;
|
|
1465
1465
|
}
|
|
1466
|
-
const
|
|
1466
|
+
const Dr = (e) => {
|
|
1467
1467
|
const t = /* @__PURE__ */ new Map(), n = e.getBoundingClientRect().top;
|
|
1468
1468
|
for (const o of Array.from(e.querySelectorAll("tbody > tr[data-motion]")))
|
|
1469
1469
|
t.set(o.dataset.motion, o.getBoundingClientRect().top - n);
|
|
1470
1470
|
return t;
|
|
1471
1471
|
};
|
|
1472
|
-
function
|
|
1472
|
+
function Ir(e, t) {
|
|
1473
1473
|
const n = re(null);
|
|
1474
1474
|
W(() => {
|
|
1475
1475
|
const o = e.current;
|
|
1476
1476
|
if (!o) return;
|
|
1477
|
-
const r =
|
|
1477
|
+
const r = Dr(o), s = n.current;
|
|
1478
1478
|
if (n.current = { trigger: t, positions: r }, !s || s.trigger === t) return;
|
|
1479
|
-
const i =
|
|
1479
|
+
const i = $t(o, "--u-duration-medium");
|
|
1480
1480
|
if (i === 0 || typeof o.animate != "function") return;
|
|
1481
|
-
const a = getComputedStyle(o).getPropertyValue("--u-ease-out").trim() || "ease-out", c =
|
|
1481
|
+
const a = getComputedStyle(o).getPropertyValue("--u-ease-out").trim() || "ease-out", c = Vr(s.positions, r);
|
|
1482
1482
|
for (const u of Array.from(o.querySelectorAll("tbody > tr[data-motion]"))) {
|
|
1483
1483
|
const h = u.dataset.motion, d = c.get(h);
|
|
1484
1484
|
d !== void 0 ? u.animate([{ transform: `translateY(${d}px)` }, { transform: "none" }], { duration: i, easing: a }) : s.positions.has(h) || u.animate([{ opacity: 0, transform: "translateY(-4px)" }, { opacity: 1, transform: "none" }], { duration: i, easing: a });
|
|
1485
1485
|
}
|
|
1486
1486
|
});
|
|
1487
1487
|
}
|
|
1488
|
-
function
|
|
1488
|
+
function Pr(e, t, n) {
|
|
1489
1489
|
const o = re(t);
|
|
1490
1490
|
W(() => {
|
|
1491
1491
|
const r = e.current, s = o.current;
|
|
1492
1492
|
if (o.current = t, !r || s === t || typeof r.animate != "function") return;
|
|
1493
|
-
const i =
|
|
1493
|
+
const i = $t(r, "--u-duration-medium");
|
|
1494
1494
|
if (i === 0) return;
|
|
1495
1495
|
const a = performance.now();
|
|
1496
1496
|
let c = requestAnimationFrame(function u(h) {
|
|
@@ -1502,18 +1502,18 @@ function Br(e, t, n) {
|
|
|
1502
1502
|
};
|
|
1503
1503
|
}, [e, t, n]);
|
|
1504
1504
|
}
|
|
1505
|
-
function
|
|
1505
|
+
function Me(e, t, n, o) {
|
|
1506
1506
|
if (t === void 0) return o.groupNoValue;
|
|
1507
1507
|
const r = e == null ? void 0 : e.spec;
|
|
1508
1508
|
if (r != null && r.group && t instanceof Date) return mn(r.group, t, n, o);
|
|
1509
1509
|
const s = r != null && r.ownGroupValue || r == null ? void 0 : r.format;
|
|
1510
1510
|
return ye(t, s, n, o) ?? String(t);
|
|
1511
1511
|
}
|
|
1512
|
-
function
|
|
1512
|
+
function Ke({ entry: e, group: t, formats: n, wording: o }) {
|
|
1513
1513
|
const r = e == null ? void 0 : e.spec;
|
|
1514
|
-
return t.value !== void 0 && (r != null && r.presentation) && !r.ownGroupValue && !r.group ? /* @__PURE__ */ l(Q, { children: r.presentation(t.value, t.rows[0]) }) : /* @__PURE__ */ l(Q, { children:
|
|
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: Me(e, t.value, n, o) });
|
|
1515
1515
|
}
|
|
1516
|
-
function
|
|
1516
|
+
function We({
|
|
1517
1517
|
group: e,
|
|
1518
1518
|
parent: t,
|
|
1519
1519
|
entry: n,
|
|
@@ -1522,7 +1522,7 @@ function qe({
|
|
|
1522
1522
|
formats: s,
|
|
1523
1523
|
wording: i
|
|
1524
1524
|
}) {
|
|
1525
|
-
const a =
|
|
1525
|
+
const a = Me(n, e.value, s, i), c = s.count(e.rows.length), u = () => r.publicSnapshot.toggleFold(e.path), h = (d) => {
|
|
1526
1526
|
if (d.altKey && (d.key === "ArrowLeft" || d.key === "ArrowRight")) {
|
|
1527
1527
|
d.preventDefault(), gt(e, d.key === "ArrowLeft", r);
|
|
1528
1528
|
return;
|
|
@@ -1532,10 +1532,10 @@ function qe({
|
|
|
1532
1532
|
else if (d.key === "ArrowLeft") {
|
|
1533
1533
|
if (d.preventDefault(), o) u();
|
|
1534
1534
|
else if (t) {
|
|
1535
|
-
const m = d.currentTarget.closest("table"),
|
|
1536
|
-
(
|
|
1535
|
+
const m = d.currentTarget.closest("table"), b = Array.from((m == null ? void 0 : m.querySelectorAll("[data-fold-path]")) ?? []).find(
|
|
1536
|
+
(w) => w.dataset.foldPath === t.path
|
|
1537
1537
|
);
|
|
1538
|
-
|
|
1538
|
+
b == null || b.focus();
|
|
1539
1539
|
}
|
|
1540
1540
|
}
|
|
1541
1541
|
};
|
|
@@ -1543,7 +1543,7 @@ function qe({
|
|
|
1543
1543
|
"button",
|
|
1544
1544
|
{
|
|
1545
1545
|
type: "button",
|
|
1546
|
-
className:
|
|
1546
|
+
className: B(f.fold, !o && f.foldClosed),
|
|
1547
1547
|
"data-fold-path": e.path,
|
|
1548
1548
|
"aria-expanded": o,
|
|
1549
1549
|
"aria-label": o ? i.foldGroup(a, c) : i.unfoldGroup(a, c),
|
|
@@ -1556,16 +1556,16 @@ function qe({
|
|
|
1556
1556
|
}
|
|
1557
1557
|
);
|
|
1558
1558
|
}
|
|
1559
|
-
function
|
|
1559
|
+
function Br({ value: e, formats: t }) {
|
|
1560
1560
|
const n = re(null);
|
|
1561
|
-
return
|
|
1561
|
+
return Pr(n, e, t.count), /* @__PURE__ */ l("span", { ref: n, className: f.groupCount, children: t.count(e) });
|
|
1562
1562
|
}
|
|
1563
1563
|
function Ye({ group: e, entry: t, hook: n, formats: o, wording: r }) {
|
|
1564
1564
|
const { selection: s } = n.publicSnapshot, i = e.rows.map(n.rowKey), a = i.filter((u) => s.isSelected(u)).length, c = a === i.length;
|
|
1565
1565
|
return /* @__PURE__ */ l(
|
|
1566
1566
|
Ce,
|
|
1567
1567
|
{
|
|
1568
|
-
"aria-label": r.selectGroup(
|
|
1568
|
+
"aria-label": r.selectGroup(Me(t, e.value, o, r)),
|
|
1569
1569
|
checked: c,
|
|
1570
1570
|
indeterminate: a > 0 && !c,
|
|
1571
1571
|
onChange: () => {
|
|
@@ -1583,7 +1583,7 @@ function gt(e, t, n) {
|
|
|
1583
1583
|
for (const i of r)
|
|
1584
1584
|
o.folded.includes(i.path) !== t && o.toggleFold(i.path);
|
|
1585
1585
|
}
|
|
1586
|
-
function
|
|
1586
|
+
function Gr({
|
|
1587
1587
|
line: e,
|
|
1588
1588
|
entry: t,
|
|
1589
1589
|
selectable: n,
|
|
@@ -1592,17 +1592,17 @@ function Er({
|
|
|
1592
1592
|
wording: s
|
|
1593
1593
|
}) {
|
|
1594
1594
|
const i = e.span;
|
|
1595
|
-
return /* @__PURE__ */ l("td", { className:
|
|
1595
|
+
return /* @__PURE__ */ l("td", { className: B(f.td, f.spanCell), children: e.first && /* @__PURE__ */ F("span", { className: f.spanValue, children: [
|
|
1596
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(
|
|
1598
|
-
/* @__PURE__ */
|
|
1599
|
-
/* @__PURE__ */ l(
|
|
1597
|
+
/* @__PURE__ */ l(We, { group: i, parent: e.parents.at(-1), entry: t, open: !0, hook: o, formats: r, wording: s }),
|
|
1598
|
+
/* @__PURE__ */ F("span", { className: f.spanText, title: Me(t, i.value, r, s), children: [
|
|
1599
|
+
/* @__PURE__ */ l(Ke, { entry: t, group: i, formats: r, wording: s }),
|
|
1600
1600
|
e.continued && /* @__PURE__ */ l("span", { className: f.continued, children: s.groupContinued })
|
|
1601
1601
|
] }),
|
|
1602
1602
|
/* @__PURE__ */ l("span", { className: f.groupCount, children: r.count(i.rows.length) })
|
|
1603
1603
|
] }) });
|
|
1604
1604
|
}
|
|
1605
|
-
function
|
|
1605
|
+
function mt({
|
|
1606
1606
|
line: e,
|
|
1607
1607
|
index: t,
|
|
1608
1608
|
absolute: n,
|
|
@@ -1616,62 +1616,62 @@ function pt({
|
|
|
1616
1616
|
siblings: h,
|
|
1617
1617
|
depth: d,
|
|
1618
1618
|
hook: m,
|
|
1619
|
-
formats:
|
|
1620
|
-
wording:
|
|
1619
|
+
formats: b,
|
|
1620
|
+
wording: w
|
|
1621
1621
|
}) {
|
|
1622
|
-
const { group:
|
|
1623
|
-
/* @__PURE__ */ l(
|
|
1624
|
-
/* @__PURE__ */ l("span", { className: f.groupValue, children: /* @__PURE__ */ l(
|
|
1625
|
-
/* @__PURE__ */ l(
|
|
1626
|
-
|
|
1622
|
+
const { group: g } = e, v = e.kind === "header", p = v && !m.publicSnapshot.folded.includes(g.path), _ = s.findIndex((y) => y.spec.aggregate !== void 0), S = _ === -1 ? s.length : _, C = s.slice(S), D = s.find((y) => y.spec.aggregate === "sum" && y.spec.share !== !1), x = n !== void 0, A = /* @__PURE__ */ F("span", { className: f.groupLabel, children: [
|
|
1623
|
+
/* @__PURE__ */ l(We, { group: g, parent: e.parents.at(-1), entry: r, open: p, hook: m, formats: b, wording: w }),
|
|
1624
|
+
/* @__PURE__ */ l("span", { className: f.groupValue, children: /* @__PURE__ */ l(Ke, { entry: r, group: g, formats: b, wording: w }) }),
|
|
1625
|
+
/* @__PURE__ */ l(Br, { value: g.rows.length, formats: b }),
|
|
1626
|
+
v && e.continued && /* @__PURE__ */ l("span", { className: f.continued, children: w.groupContinued })
|
|
1627
1627
|
] });
|
|
1628
|
-
return /* @__PURE__ */
|
|
1628
|
+
return /* @__PURE__ */ F(
|
|
1629
1629
|
"tr",
|
|
1630
1630
|
{
|
|
1631
|
-
className:
|
|
1631
|
+
className: B(v ? f.groupHeader : f.groupFolded, x && f.virtualRow),
|
|
1632
1632
|
"data-line": e.kind,
|
|
1633
|
-
"data-level":
|
|
1634
|
-
"data-motion": n !== void 0 || !(
|
|
1635
|
-
"data-continued":
|
|
1636
|
-
"data-group-first":
|
|
1637
|
-
"data-group":
|
|
1633
|
+
"data-level": g.level,
|
|
1634
|
+
"data-motion": n !== void 0 || !(v && e.continued) ? `${e.kind}:${g.path}` : void 0,
|
|
1635
|
+
"data-continued": v && e.continued ? "" : void 0,
|
|
1636
|
+
"data-group-first": v ? void 0 : "",
|
|
1637
|
+
"data-group": g.path,
|
|
1638
1638
|
"data-row": x ? n : void 0,
|
|
1639
1639
|
"aria-rowindex": x ? n + 2 : void 0,
|
|
1640
1640
|
"data-index": t,
|
|
1641
|
-
style:
|
|
1642
|
-
"aria-level":
|
|
1643
|
-
"aria-expanded":
|
|
1644
|
-
"aria-posinset": h.indexOf(
|
|
1641
|
+
style: v ? { "--u-header-level": g.level } : void 0,
|
|
1642
|
+
"aria-level": v ? g.level + 1 : d,
|
|
1643
|
+
"aria-expanded": p,
|
|
1644
|
+
"aria-posinset": h.indexOf(g) + 1 || void 0,
|
|
1645
1645
|
"aria-setsize": h.length || void 0,
|
|
1646
1646
|
children: [
|
|
1647
|
-
Array.from({ length: i }, (
|
|
1648
|
-
|
|
1649
|
-
/* @__PURE__ */ l("td", { className:
|
|
1650
|
-
a && /* @__PURE__ */ l("span", { className: f.spanSelect, children: /* @__PURE__ */ l(Ye, { group:
|
|
1651
|
-
/* @__PURE__ */ l(
|
|
1652
|
-
/* @__PURE__ */ l("span", { className: f.spanText, children: /* @__PURE__ */ l(
|
|
1653
|
-
/* @__PURE__ */ l("span", { className: f.groupCount, children:
|
|
1647
|
+
Array.from({ length: i }, (y, O) => /* @__PURE__ */ l("td", { className: B(f.td, f.control), children: O === 0 && a && v && /* @__PURE__ */ l(Ye, { group: g, entry: r, hook: m, formats: b, wording: w }) }, `c${O}`)),
|
|
1648
|
+
v ? /* @__PURE__ */ l("td", { className: f.td, colSpan: (o ? 1 : 0) + S, style: { paddingLeft: `calc(var(--u-space-3) + ${g.level * 20}px)` }, children: A }) : /* @__PURE__ */ F(Q, { children: [
|
|
1649
|
+
/* @__PURE__ */ l("td", { className: B(f.td, f.spanCell), children: /* @__PURE__ */ F("span", { className: f.spanValue, children: [
|
|
1650
|
+
a && /* @__PURE__ */ l("span", { className: f.spanSelect, children: /* @__PURE__ */ l(Ye, { group: g, entry: o, hook: m, formats: b, wording: w }) }),
|
|
1651
|
+
/* @__PURE__ */ l(We, { group: g, parent: e.parents.at(-1), entry: o, open: !1, hook: m, formats: b, wording: w }),
|
|
1652
|
+
/* @__PURE__ */ l("span", { className: f.spanText, children: /* @__PURE__ */ l(Ke, { entry: o, group: g, formats: b, wording: w }) }),
|
|
1653
|
+
/* @__PURE__ */ l("span", { className: f.groupCount, children: b.count(g.rows.length) })
|
|
1654
1654
|
] }) }),
|
|
1655
|
-
S > 0 && /* @__PURE__ */ l("td", { className:
|
|
1655
|
+
S > 0 && /* @__PURE__ */ l("td", { className: B(f.td, f.foldedCount), colSpan: S, children: w.entries(g.rows.length, b.count(g.rows.length)) })
|
|
1656
1656
|
] }),
|
|
1657
|
-
C.map((
|
|
1658
|
-
|
|
1657
|
+
C.map((y) => /* @__PURE__ */ l(
|
|
1658
|
+
Er,
|
|
1659
1659
|
{
|
|
1660
|
-
entry:
|
|
1661
|
-
group:
|
|
1662
|
-
share:
|
|
1660
|
+
entry: y,
|
|
1661
|
+
group: g,
|
|
1662
|
+
share: v && y === D,
|
|
1663
1663
|
total: u,
|
|
1664
|
-
formats:
|
|
1665
|
-
wording:
|
|
1664
|
+
formats: b,
|
|
1665
|
+
wording: w
|
|
1666
1666
|
},
|
|
1667
|
-
|
|
1667
|
+
y.key
|
|
1668
1668
|
)),
|
|
1669
1669
|
c && /* @__PURE__ */ l("td", { className: f.td })
|
|
1670
1670
|
]
|
|
1671
1671
|
}
|
|
1672
1672
|
);
|
|
1673
1673
|
}
|
|
1674
|
-
function
|
|
1674
|
+
function Er({
|
|
1675
1675
|
entry: e,
|
|
1676
1676
|
group: t,
|
|
1677
1677
|
share: n,
|
|
@@ -1683,21 +1683,21 @@ function zr({
|
|
|
1683
1683
|
if (!i.aggregate) return /* @__PURE__ */ l("td", { className: f.td });
|
|
1684
1684
|
let a = null;
|
|
1685
1685
|
if (n && i.aggregate === "sum" && i.share !== !1) {
|
|
1686
|
-
const c =
|
|
1686
|
+
const c = Qe({ id: i.id, read: e.read, aggregate: "sum" }, o), u = t.aggregates[i.id];
|
|
1687
1687
|
if (typeof c == "number" && c > 0 && typeof u == "number" && u > 0) {
|
|
1688
1688
|
const h = Math.min(1, u / c);
|
|
1689
1689
|
a = /* @__PURE__ */ l("span", { className: f.shareBar, style: { width: `${Math.max(2, Math.round(h * 64))}px` }, "aria-hidden": "true" });
|
|
1690
1690
|
}
|
|
1691
1691
|
}
|
|
1692
|
-
return /* @__PURE__ */ l("td", { className:
|
|
1693
|
-
/* @__PURE__ */ l(
|
|
1692
|
+
return /* @__PURE__ */ l("td", { className: B(f.td, jt(e, t.rows) && f.numeric, f.aggregateCell), "data-aggregate": typeof i.aggregate == "function" ? "own" : i.aggregate, children: a ? /* @__PURE__ */ F("span", { className: f.shareHost, children: [
|
|
1693
|
+
/* @__PURE__ */ l($e, { entry: e, rows: t.rows, formats: r, wording: s }),
|
|
1694
1694
|
a
|
|
1695
|
-
] }) : /* @__PURE__ */ l(
|
|
1695
|
+
] }) : /* @__PURE__ */ l($e, { entry: e, rows: t.rows, formats: r, wording: s }) });
|
|
1696
1696
|
}
|
|
1697
|
-
function
|
|
1697
|
+
function zr(e) {
|
|
1698
1698
|
const t = typeof e.value == "string" ? e.value : void 0;
|
|
1699
1699
|
let n = e.id ?? t;
|
|
1700
|
-
return n === void 0 && (
|
|
1700
|
+
return n === void 0 && (ge(`without-id:${e.label}`, `The column "${e.label}" has a computed value but no id. Its label serves as the id.`), n = e.label), e.footer !== void 0 && ge(`footer:${n}`, `The column "${n}" uses \`footer\`, which is called \`aggregate\` now. The old name goes with the next minor version.`), e.children !== void 0 && typeof e.children != "function" && ge(`children:${n}`, `The children of the column "${n}" are not a function and are passed over.`), {
|
|
1701
1701
|
id: n,
|
|
1702
1702
|
label: e.label,
|
|
1703
1703
|
value: e.value,
|
|
@@ -1719,15 +1719,15 @@ function Hr(e) {
|
|
|
1719
1719
|
groupable: e.groupable
|
|
1720
1720
|
};
|
|
1721
1721
|
}
|
|
1722
|
-
function
|
|
1722
|
+
function Hr(e, t, n, o, r) {
|
|
1723
1723
|
if (!t) return n.rowKey(e);
|
|
1724
1724
|
const s = t.read(e);
|
|
1725
1725
|
return Y(s) ? r.cellAbsentValue : ye(s, t.spec.format, o, r) ?? n.rowKey(e);
|
|
1726
1726
|
}
|
|
1727
|
-
const
|
|
1728
|
-
function
|
|
1727
|
+
const Fe = 34;
|
|
1728
|
+
function jr(e) {
|
|
1729
1729
|
function t(c) {
|
|
1730
|
-
const u =
|
|
1730
|
+
const u = ie(), h = Ue(je), d = zr(c);
|
|
1731
1731
|
return e.registerColumn(u, d), W(
|
|
1732
1732
|
() => () => {
|
|
1733
1733
|
e.removeColumn(u), e.commit();
|
|
@@ -1735,13 +1735,13 @@ function $r(e) {
|
|
|
1735
1735
|
[u]
|
|
1736
1736
|
), W(() => {
|
|
1737
1737
|
e.ensureColumn(u, d), e.checkOrder(), e.commit();
|
|
1738
|
-
}),
|
|
1738
|
+
}), Lt && h && h.registry !== e && ge(
|
|
1739
1739
|
`foreign:${d.id}`,
|
|
1740
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.`
|
|
1741
1741
|
), /* @__PURE__ */ l("span", { hidden: !0, "data-umriss-column": u });
|
|
1742
1742
|
}
|
|
1743
1743
|
function n({ children: c }) {
|
|
1744
|
-
const u =
|
|
1744
|
+
const u = ie();
|
|
1745
1745
|
return e.registerDetail(u, c), W(
|
|
1746
1746
|
() => () => {
|
|
1747
1747
|
e.removeDetail(u), e.commit();
|
|
@@ -1752,7 +1752,7 @@ function $r(e) {
|
|
|
1752
1752
|
}), null;
|
|
1753
1753
|
}
|
|
1754
1754
|
function o({ children: c }) {
|
|
1755
|
-
const u =
|
|
1755
|
+
const u = ie();
|
|
1756
1756
|
return e.registerActionGroup(u), W(
|
|
1757
1757
|
() => () => {
|
|
1758
1758
|
e.removeActionGroup(u), e.commit();
|
|
@@ -1763,7 +1763,7 @@ function $r(e) {
|
|
|
1763
1763
|
}), /* @__PURE__ */ l(Q, { children: c });
|
|
1764
1764
|
}
|
|
1765
1765
|
function r(c) {
|
|
1766
|
-
const u =
|
|
1766
|
+
const u = ie(), h = {
|
|
1767
1767
|
label: c.children,
|
|
1768
1768
|
bulk: c.bulk === !0,
|
|
1769
1769
|
tone: c.tone ?? "default",
|
|
@@ -1779,7 +1779,7 @@ function $r(e) {
|
|
|
1779
1779
|
}), /* @__PURE__ */ l("span", { hidden: !0, "data-umriss-action": u });
|
|
1780
1780
|
}
|
|
1781
1781
|
function s(c) {
|
|
1782
|
-
const u =
|
|
1782
|
+
const u = ie(), h = typeof c.value == "string" ? c.value : void 0, m = {
|
|
1783
1783
|
id: c.id ?? h ?? c.label,
|
|
1784
1784
|
label: c.label,
|
|
1785
1785
|
value: c.value,
|
|
@@ -1800,25 +1800,25 @@ function $r(e) {
|
|
|
1800
1800
|
}
|
|
1801
1801
|
function i(c) {
|
|
1802
1802
|
e.beginPass(), e.setStickyRowHeader(c.stickyRowHeader === !0), e.setTableGroupable(c.groupable !== !1);
|
|
1803
|
-
const u = re(null), [h, d] =
|
|
1803
|
+
const u = re(null), [h, d] = H(null);
|
|
1804
1804
|
W(() => {
|
|
1805
1805
|
e.children = u.current, e.checkOrder(), e.commit();
|
|
1806
1806
|
});
|
|
1807
|
-
const m =
|
|
1808
|
-
return /* @__PURE__ */ l(
|
|
1807
|
+
const m = j(() => ({ registry: e, footerTarget: h }), [h]);
|
|
1808
|
+
return /* @__PURE__ */ l(je.Provider, { value: m, children: /* @__PURE__ */ F("div", { className: B(f.frame, c.className), children: [
|
|
1809
1809
|
/* @__PURE__ */ l("div", { ref: u, className: f.children, children: c.children }),
|
|
1810
|
-
/* @__PURE__ */ l(
|
|
1811
|
-
/* @__PURE__ */ l(
|
|
1810
|
+
/* @__PURE__ */ l($r, { registry: e }),
|
|
1811
|
+
/* @__PURE__ */ l(Kr, { registry: e, props: c }),
|
|
1812
1812
|
/* @__PURE__ */ l("div", { ref: d, className: f.footerTarget })
|
|
1813
1813
|
] }) });
|
|
1814
1814
|
}
|
|
1815
1815
|
const a = { Table: i, Column: t, RowDetail: n, RowActions: o, Action: r, GroupBy: s };
|
|
1816
|
-
return
|
|
1816
|
+
return br(i, e), a;
|
|
1817
1817
|
}
|
|
1818
|
-
function
|
|
1819
|
-
return
|
|
1818
|
+
function $r({ registry: e }) {
|
|
1819
|
+
return qe(e.subscribe, e.bodyVersion, e.bodyVersion), !e.hook || !e.needsOwnToolbar() ? null : /* @__PURE__ */ l(zt, { registry: e, own: !0 });
|
|
1820
1820
|
}
|
|
1821
|
-
function
|
|
1821
|
+
function Kr({ registry: e, props: t }) {
|
|
1822
1822
|
const {
|
|
1823
1823
|
selectable: n = !1,
|
|
1824
1824
|
stickyHeader: o = !1,
|
|
@@ -1831,146 +1831,155 @@ function Wr({ registry: e, props: t }) {
|
|
|
1831
1831
|
rowProps: h,
|
|
1832
1832
|
ariaLabel: d
|
|
1833
1833
|
} = t;
|
|
1834
|
-
|
|
1835
|
-
const m = U(),
|
|
1834
|
+
qe(e.subscribe, e.bodyVersion, e.bodyVersion);
|
|
1835
|
+
const m = U(), b = ue(), w = Ot(i, "regular"), g = ie(), v = re(null);
|
|
1836
1836
|
W(() => {
|
|
1837
|
-
var
|
|
1838
|
-
const k =
|
|
1837
|
+
var z, L;
|
|
1838
|
+
const k = v.current;
|
|
1839
1839
|
if (!k || !o) return;
|
|
1840
|
-
const
|
|
1841
|
-
k.style.setProperty("--u-table-head", `${
|
|
1840
|
+
const R = ((z = k.tHead) == null ? void 0 : z.getBoundingClientRect().height) ?? 0, $ = ((L = k.querySelector("tr[data-line='header']")) == null ? void 0 : L.getBoundingClientRect().height) ?? 0;
|
|
1841
|
+
k.style.setProperty("--u-table-head", `${R}px`), k.style.setProperty("--u-table-group-header", `${$}px`), k.parentElement && bt(k.parentElement);
|
|
1842
1842
|
}), W(() => {
|
|
1843
|
-
const k = e.takeFocusBeforeFold(),
|
|
1844
|
-
if (!k || !
|
|
1845
|
-
const
|
|
1846
|
-
for (let
|
|
1847
|
-
const J = JSON.stringify(
|
|
1843
|
+
const k = e.takeFocusBeforeFold(), R = v.current;
|
|
1844
|
+
if (!k || !R || k.table !== R || k.element.isConnected) return;
|
|
1845
|
+
const $ = Array.from(R.querySelectorAll("[data-fold-path]")), z = JSON.parse(k.group);
|
|
1846
|
+
for (let L = z.length; L > 0; L--) {
|
|
1847
|
+
const J = JSON.stringify(z.slice(0, L)), Z = $.find((T) => T.dataset.foldPath === J);
|
|
1848
1848
|
if (Z) return Z.focus();
|
|
1849
1849
|
}
|
|
1850
1850
|
});
|
|
1851
|
-
const
|
|
1852
|
-
|
|
1853
|
-
const
|
|
1854
|
-
if (!
|
|
1855
|
-
const S =
|
|
1856
|
-
|
|
1851
|
+
const p = e.hook && !e.hook.companion.virtual ? e.hook.publicSnapshot : null;
|
|
1852
|
+
Ir(v, p ? `${p.grouping.join("|")}#${p.folded.join("|")}` : "");
|
|
1853
|
+
const _ = e.hook;
|
|
1854
|
+
if (!_) return null;
|
|
1855
|
+
const S = _.publicSnapshot, C = e.projection(), D = e.rowHeader(), x = Gt(e), A = e.detail, y = e.hasRowActions() ? e.actions.ordered() : [], O = _.companion.virtual, q = S.grouping, N = q.length > 0 ? C.visibleLines : void 0, M = N ? e.groupingEntries(_.rows) : [], E = (k) => M.find((R) => R.spec.id === k), I = N && q.length > 1 ? E(q.at(-1)) : void 0, K = N ? x.filter((k) => !q.includes(k.spec.id)) : x, se = (n ? 1 : 0) + (A ? 1 : 0), ae = se + (I ? 1 : 0) + K.length + (y.length > 0 ? 1 : 0), de = se * Fe, fe = (k) => r && k === D, be = C.visible, ve = !u && K.some((k) => k.spec.aggregate), ke = S.search !== "" || Object.keys(S.filter).length > 0, le = (k, R, $, z) => /* @__PURE__ */ l(
|
|
1856
|
+
Wr,
|
|
1857
1857
|
{
|
|
1858
1858
|
row: k,
|
|
1859
|
-
index:
|
|
1860
|
-
absolute:
|
|
1859
|
+
index: R,
|
|
1860
|
+
absolute: O ? $ : void 0,
|
|
1861
1861
|
registry: e,
|
|
1862
|
-
hook:
|
|
1863
|
-
columns:
|
|
1864
|
-
line:
|
|
1865
|
-
spanEntry:
|
|
1866
|
-
header:
|
|
1862
|
+
hook: _,
|
|
1863
|
+
columns: K,
|
|
1864
|
+
line: z,
|
|
1865
|
+
spanEntry: I,
|
|
1866
|
+
header: D,
|
|
1867
1867
|
selectable: n,
|
|
1868
|
-
actions:
|
|
1868
|
+
actions: y,
|
|
1869
1869
|
stickyRowHeader: r,
|
|
1870
1870
|
rowHeaderLeft: de,
|
|
1871
1871
|
columnCount: ae,
|
|
1872
1872
|
rowProps: h,
|
|
1873
|
-
baseId:
|
|
1874
|
-
formats:
|
|
1873
|
+
baseId: g,
|
|
1874
|
+
formats: b,
|
|
1875
1875
|
wording: m
|
|
1876
1876
|
},
|
|
1877
|
-
|
|
1877
|
+
_.rowKey(k)
|
|
1878
1878
|
);
|
|
1879
1879
|
let te;
|
|
1880
1880
|
if (u)
|
|
1881
|
-
te = /* @__PURE__ */ l("tbody", { children: /* @__PURE__ */ l(
|
|
1881
|
+
te = /* @__PURE__ */ l("tbody", { children: /* @__PURE__ */ l(
|
|
1882
|
+
Qr,
|
|
1883
|
+
{
|
|
1884
|
+
columns: ae,
|
|
1885
|
+
rightAligned: [
|
|
1886
|
+
...Array.from({ length: se + (I ? 1 : 0) }, () => !1),
|
|
1887
|
+
...K.map((k) => Je(e.kindOf(k, _.rows), k.spec.rightAligned))
|
|
1888
|
+
]
|
|
1889
|
+
}
|
|
1890
|
+
) });
|
|
1882
1891
|
else if (C.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:
|
|
1892
|
+
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 && ke ? /* @__PURE__ */ F(Q, { children: [
|
|
1884
1893
|
/* @__PURE__ */ l("p", { className: f.emptyTitle, children: m.nothingMatchesFilters }),
|
|
1885
|
-
/* @__PURE__ */ l(ee, { size: "sm", variant: "ghost", onClick: () =>
|
|
1894
|
+
/* @__PURE__ */ l(ee, { size: "sm", variant: "ghost", onClick: () => Et(S), children: m.resetAll })
|
|
1886
1895
|
] }) : c ?? /* @__PURE__ */ l("p", { className: f.emptyTitle, children: m.noEntries }) }) }) }) });
|
|
1887
1896
|
else if (N) {
|
|
1888
|
-
const k =
|
|
1889
|
-
var
|
|
1890
|
-
const Z = J -
|
|
1891
|
-
return Z < 0 ?
|
|
1892
|
-
|
|
1897
|
+
const k = O ? Rt(N).map((L) => L.kind === "folded" || !L.continued ? L : { ...L, continued: !1 }) : N, R = k.length - N.length, $ = O && O.from > 0 ? O.fillerBefore / O.from : 0, z = (L, J) => {
|
|
1898
|
+
var V, G;
|
|
1899
|
+
const Z = J - R, T = O ? O.from + Z : Z;
|
|
1900
|
+
return Z < 0 ? L.kind === "row" ? null : /* @__PURE__ */ l(
|
|
1901
|
+
mt,
|
|
1893
1902
|
{
|
|
1894
|
-
line:
|
|
1903
|
+
line: L,
|
|
1895
1904
|
index: J,
|
|
1896
1905
|
absolute: void 0,
|
|
1897
|
-
spanEntry:
|
|
1898
|
-
levelEntry:
|
|
1899
|
-
columns:
|
|
1900
|
-
controlColumns:
|
|
1906
|
+
spanEntry: I,
|
|
1907
|
+
levelEntry: E(q[L.group.level]),
|
|
1908
|
+
columns: K,
|
|
1909
|
+
controlColumns: se,
|
|
1901
1910
|
selectable: n,
|
|
1902
|
-
hasActions:
|
|
1911
|
+
hasActions: y.length > 0,
|
|
1903
1912
|
total: C.filtered,
|
|
1904
|
-
siblings: ((
|
|
1905
|
-
depth:
|
|
1906
|
-
hook:
|
|
1907
|
-
formats:
|
|
1913
|
+
siblings: ((V = L.parents.at(-1)) == null ? void 0 : V.groups) ?? C.groups ?? [],
|
|
1914
|
+
depth: q.length,
|
|
1915
|
+
hook: _,
|
|
1916
|
+
formats: b,
|
|
1908
1917
|
wording: m
|
|
1909
1918
|
},
|
|
1910
|
-
`${
|
|
1911
|
-
) :
|
|
1912
|
-
|
|
1919
|
+
`${L.kind}:${L.group.path}:repeated`
|
|
1920
|
+
) : L.kind === "row" ? le(L.row, Z, T, L) : /* @__PURE__ */ l(
|
|
1921
|
+
mt,
|
|
1913
1922
|
{
|
|
1914
|
-
line:
|
|
1923
|
+
line: L,
|
|
1915
1924
|
index: Z,
|
|
1916
|
-
absolute:
|
|
1917
|
-
spanEntry:
|
|
1918
|
-
levelEntry:
|
|
1919
|
-
columns:
|
|
1920
|
-
controlColumns:
|
|
1925
|
+
absolute: O ? T : void 0,
|
|
1926
|
+
spanEntry: I,
|
|
1927
|
+
levelEntry: E(q[L.group.level]),
|
|
1928
|
+
columns: K,
|
|
1929
|
+
controlColumns: se,
|
|
1921
1930
|
selectable: n,
|
|
1922
|
-
hasActions:
|
|
1931
|
+
hasActions: y.length > 0,
|
|
1923
1932
|
total: C.filtered,
|
|
1924
|
-
siblings: ((
|
|
1925
|
-
depth:
|
|
1926
|
-
hook:
|
|
1927
|
-
formats:
|
|
1933
|
+
siblings: ((G = L.parents.at(-1)) == null ? void 0 : G.groups) ?? C.groups ?? [],
|
|
1934
|
+
depth: q.length,
|
|
1935
|
+
hook: _,
|
|
1936
|
+
formats: b,
|
|
1928
1937
|
wording: m
|
|
1929
1938
|
},
|
|
1930
|
-
`${
|
|
1939
|
+
`${L.kind}:${L.group.path}${L.kind === "header" && L.continued ? ":continued" : ""}`
|
|
1931
1940
|
);
|
|
1932
1941
|
};
|
|
1933
|
-
te =
|
|
1934
|
-
|
|
1942
|
+
te = O ? /* @__PURE__ */ l(
|
|
1943
|
+
_t,
|
|
1935
1944
|
{
|
|
1936
|
-
virtual: { ...
|
|
1945
|
+
virtual: { ...O, fillerBefore: Math.max(0, O.fillerBefore - R * $) },
|
|
1937
1946
|
colSpan: ae,
|
|
1938
|
-
children: k.map(
|
|
1947
|
+
children: k.map(z)
|
|
1939
1948
|
}
|
|
1940
|
-
) : /* @__PURE__ */ l("tbody", { children: N.map(
|
|
1941
|
-
} else
|
|
1949
|
+
) : /* @__PURE__ */ l("tbody", { children: N.map(z) });
|
|
1950
|
+
} else O ? te = /* @__PURE__ */ l(_t, { virtual: O, colSpan: ae, children: be.map((k, R) => le(k, R, O.from + R)) }) : te = /* @__PURE__ */ l("tbody", { children: be.map((k, R) => le(k, R, R)) });
|
|
1942
1951
|
return /* @__PURE__ */ l(
|
|
1943
1952
|
"div",
|
|
1944
1953
|
{
|
|
1945
|
-
ref:
|
|
1954
|
+
ref: O == null ? void 0 : O.scrollRef,
|
|
1946
1955
|
onScroll: (k) => {
|
|
1947
|
-
|
|
1956
|
+
O == null || O.onScroll(), N && o && bt(k.currentTarget);
|
|
1948
1957
|
},
|
|
1949
1958
|
className: f.scroll,
|
|
1950
1959
|
style: a ? { maxHeight: a } : void 0,
|
|
1951
|
-
children: /* @__PURE__ */
|
|
1960
|
+
children: /* @__PURE__ */ F(
|
|
1952
1961
|
"table",
|
|
1953
1962
|
{
|
|
1954
|
-
ref:
|
|
1963
|
+
ref: v,
|
|
1955
1964
|
role: N ? "treegrid" : void 0,
|
|
1956
|
-
"data-depth": N ?
|
|
1957
|
-
style: N ? { "--u-header-levels":
|
|
1965
|
+
"data-depth": N ? q.length : void 0,
|
|
1966
|
+
style: N ? { "--u-header-levels": q.length - 1 } : void 0,
|
|
1958
1967
|
"aria-label": d,
|
|
1959
|
-
"aria-rowcount":
|
|
1968
|
+
"aria-rowcount": O ? (C.lines ?? C.filtered).length + 1 + (ve ? 1 : 0) : void 0,
|
|
1960
1969
|
"aria-busy": u || void 0,
|
|
1961
|
-
className:
|
|
1970
|
+
className: B(
|
|
1962
1971
|
f.table,
|
|
1963
|
-
|
|
1972
|
+
w === "compact" && f.compact,
|
|
1964
1973
|
o && f.sticky,
|
|
1965
1974
|
s && f.striped
|
|
1966
1975
|
),
|
|
1967
1976
|
children: [
|
|
1968
|
-
/* @__PURE__ */ l("thead", { children: /* @__PURE__ */
|
|
1977
|
+
/* @__PURE__ */ l("thead", { children: /* @__PURE__ */ F("tr", { "aria-rowindex": O ? 1 : void 0, children: [
|
|
1969
1978
|
n && /* @__PURE__ */ l(
|
|
1970
1979
|
"th",
|
|
1971
1980
|
{
|
|
1972
1981
|
scope: "col",
|
|
1973
|
-
className:
|
|
1982
|
+
className: B(f.th, f.control, r && f.stickyCell),
|
|
1974
1983
|
style: r ? { left: 0 } : void 0,
|
|
1975
1984
|
children: /* @__PURE__ */ l(
|
|
1976
1985
|
Ce,
|
|
@@ -1986,48 +1995,48 @@ function Wr({ registry: e, props: t }) {
|
|
|
1986
1995
|
A && /* @__PURE__ */ l(
|
|
1987
1996
|
"td",
|
|
1988
1997
|
{
|
|
1989
|
-
className:
|
|
1990
|
-
style: r ? { left: (n ? 1 : 0) *
|
|
1998
|
+
className: B(f.th, f.control, r && f.stickyCell),
|
|
1999
|
+
style: r ? { left: (n ? 1 : 0) * Fe } : void 0
|
|
1991
2000
|
}
|
|
1992
2001
|
),
|
|
1993
|
-
|
|
1994
|
-
|
|
1995
|
-
|
|
2002
|
+
I && (e.columnById(I.spec.id) === I ? /* @__PURE__ */ l(vt, { entry: I, registry: e, hook: _, sticky: !1, left: de }) : /* @__PURE__ */ l("th", { scope: "col", className: f.th, children: I.spec.label })),
|
|
2003
|
+
K.map((k) => /* @__PURE__ */ l(
|
|
2004
|
+
vt,
|
|
1996
2005
|
{
|
|
1997
2006
|
entry: k,
|
|
1998
2007
|
registry: e,
|
|
1999
|
-
hook:
|
|
2008
|
+
hook: _,
|
|
2000
2009
|
sticky: fe(k),
|
|
2001
2010
|
left: de
|
|
2002
2011
|
},
|
|
2003
2012
|
k.key
|
|
2004
2013
|
)),
|
|
2005
|
-
|
|
2014
|
+
y.length > 0 && /* @__PURE__ */ l("th", { scope: "col", className: B(f.th, f.actionsCell), children: /* @__PURE__ */ l(Re, { children: m.rowActions }) })
|
|
2006
2015
|
] }) }),
|
|
2007
2016
|
te,
|
|
2008
|
-
|
|
2009
|
-
Array.from({ length:
|
|
2017
|
+
ve && /* @__PURE__ */ l("tfoot", { children: /* @__PURE__ */ F("tr", { "aria-rowindex": O ? (C.lines ?? C.filtered).length + 2 : void 0, children: [
|
|
2018
|
+
Array.from({ length: se }, (k, R) => /* @__PURE__ */ l(
|
|
2010
2019
|
"td",
|
|
2011
2020
|
{
|
|
2012
|
-
className:
|
|
2013
|
-
style: r ? { left:
|
|
2021
|
+
className: B(f.td, f.control, r && f.stickyCell),
|
|
2022
|
+
style: r ? { left: R * Fe } : void 0
|
|
2014
2023
|
},
|
|
2015
|
-
|
|
2024
|
+
R
|
|
2016
2025
|
)),
|
|
2017
|
-
|
|
2018
|
-
|
|
2026
|
+
I && /* @__PURE__ */ l("td", { className: f.td }),
|
|
2027
|
+
K.map((k) => /* @__PURE__ */ l(
|
|
2019
2028
|
Ur,
|
|
2020
2029
|
{
|
|
2021
2030
|
entry: k,
|
|
2022
2031
|
rows: C.filtered,
|
|
2023
|
-
formats:
|
|
2032
|
+
formats: b,
|
|
2024
2033
|
wording: m,
|
|
2025
2034
|
sticky: fe(k),
|
|
2026
2035
|
left: de
|
|
2027
2036
|
},
|
|
2028
2037
|
k.key
|
|
2029
2038
|
)),
|
|
2030
|
-
|
|
2039
|
+
y.length > 0 && /* @__PURE__ */ l("td", { className: f.td })
|
|
2031
2040
|
] }) })
|
|
2032
2041
|
]
|
|
2033
2042
|
}
|
|
@@ -2035,56 +2044,56 @@ function Wr({ registry: e, props: t }) {
|
|
|
2035
2044
|
}
|
|
2036
2045
|
);
|
|
2037
2046
|
}
|
|
2038
|
-
function
|
|
2047
|
+
function bt(e) {
|
|
2039
2048
|
for (const t of Array.from(e.querySelectorAll("tbody > tr[data-line='header']"))) {
|
|
2040
2049
|
const n = t.cells[t.cells.length - 1], o = !!n && n.getBoundingClientRect().top > t.getBoundingClientRect().top + 0.5;
|
|
2041
2050
|
t.toggleAttribute("data-stuck", o);
|
|
2042
2051
|
}
|
|
2043
2052
|
}
|
|
2044
|
-
function
|
|
2053
|
+
function vt({
|
|
2045
2054
|
entry: e,
|
|
2046
2055
|
registry: t,
|
|
2047
2056
|
hook: n,
|
|
2048
2057
|
sticky: o,
|
|
2049
2058
|
left: r
|
|
2050
2059
|
}) {
|
|
2051
|
-
const { spec: s } = e, i = n.publicSnapshot, a = t.kindOf(e, n.rows), c =
|
|
2060
|
+
const { spec: s } = e, i = n.publicSnapshot, a = t.kindOf(e, n.rows), c = Je(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, b = i.sort.length > 1 && d !== -1 ? d + 1 : void 0, w = i.widths[h], g = 48, v = (x) => {
|
|
2052
2061
|
x.stopPropagation(), x.preventDefault();
|
|
2053
|
-
const A = x.currentTarget,
|
|
2054
|
-
if (!
|
|
2055
|
-
const
|
|
2062
|
+
const A = x.currentTarget, y = A.closest("th");
|
|
2063
|
+
if (!y) return;
|
|
2064
|
+
const O = x.clientX, q = y.getBoundingClientRect().width, N = x.pointerId;
|
|
2056
2065
|
A.setPointerCapture(N);
|
|
2057
|
-
const
|
|
2058
|
-
|
|
2059
|
-
},
|
|
2060
|
-
|
|
2066
|
+
const M = (I) => {
|
|
2067
|
+
I.pointerId === N && i.setWidth(h, Math.max(g, q + (I.clientX - O)));
|
|
2068
|
+
}, E = (I) => {
|
|
2069
|
+
I.pointerId === N && (A.removeEventListener("pointermove", M), A.removeEventListener("pointerup", E), A.removeEventListener("pointercancel", E), A.hasPointerCapture(N) && A.releasePointerCapture(N));
|
|
2061
2070
|
};
|
|
2062
|
-
A.addEventListener("pointermove",
|
|
2063
|
-
},
|
|
2064
|
-
const A = x == null ? void 0 : x.parentElement,
|
|
2065
|
-
if (!x || !A || !
|
|
2066
|
-
const
|
|
2067
|
-
x.style.width = "",
|
|
2068
|
-
let
|
|
2069
|
-
for (const
|
|
2070
|
-
if (
|
|
2071
|
-
const
|
|
2072
|
-
|
|
2071
|
+
A.addEventListener("pointermove", M), A.addEventListener("pointerup", E), A.addEventListener("pointercancel", E);
|
|
2072
|
+
}, p = (x) => {
|
|
2073
|
+
const A = x == null ? void 0 : x.parentElement, y = x == null ? void 0 : x.closest("table");
|
|
2074
|
+
if (!x || !A || !y) return;
|
|
2075
|
+
const O = Array.from(A.children).indexOf(x), q = A.children.length, N = { cell: x.style.width, table: y.style.width };
|
|
2076
|
+
x.style.width = "", y.style.width = "auto";
|
|
2077
|
+
let M = 0;
|
|
2078
|
+
for (const E of Array.from(y.rows)) {
|
|
2079
|
+
if (E.cells.length !== q) continue;
|
|
2080
|
+
const I = E.cells[O];
|
|
2081
|
+
I && (M = Math.max(M, I.scrollWidth));
|
|
2073
2082
|
}
|
|
2074
|
-
x.style.width = N.cell,
|
|
2075
|
-
},
|
|
2083
|
+
x.style.width = N.cell, y.style.width = N.table, M > 0 && i.setWidth(h, Math.max(g, M + 1));
|
|
2084
|
+
}, _ = (x) => {
|
|
2076
2085
|
if (!s.resizable || !x.altKey) return;
|
|
2077
|
-
const A = x.key === "ArrowRight",
|
|
2078
|
-
if (!A && !
|
|
2086
|
+
const A = x.key === "ArrowRight", y = x.key === "ArrowLeft", O = x.key === "Home";
|
|
2087
|
+
if (!A && !y && !O) return;
|
|
2079
2088
|
x.preventDefault();
|
|
2080
|
-
const
|
|
2081
|
-
if (
|
|
2082
|
-
|
|
2089
|
+
const q = x.currentTarget;
|
|
2090
|
+
if (O) {
|
|
2091
|
+
p(q);
|
|
2083
2092
|
return;
|
|
2084
2093
|
}
|
|
2085
|
-
const N =
|
|
2086
|
-
i.setWidth(h, Math.max(
|
|
2087
|
-
}, S = u ? /* @__PURE__ */
|
|
2094
|
+
const N = q.getBoundingClientRect().width, M = x.shiftKey ? 32 : 8;
|
|
2095
|
+
i.setWidth(h, Math.max(g, N + (A ? M : -M)));
|
|
2096
|
+
}, S = u ? /* @__PURE__ */ F(
|
|
2088
2097
|
"button",
|
|
2089
2098
|
{
|
|
2090
2099
|
type: "button",
|
|
@@ -2092,42 +2101,42 @@ function wt({
|
|
|
2092
2101
|
onClick: (x) => i.toggleSort(h, x.shiftKey || x.metaKey),
|
|
2093
2102
|
children: [
|
|
2094
2103
|
/* @__PURE__ */ l("span", { children: s.label }),
|
|
2095
|
-
|
|
2096
|
-
/* @__PURE__ */ l("span", { className:
|
|
2104
|
+
b !== void 0 && /* @__PURE__ */ l("span", { className: f.sortRank, "aria-hidden": "true", children: b }),
|
|
2105
|
+
/* @__PURE__ */ l("span", { className: B(f.sortIndicator, m && f.sortActive), "aria-hidden": "true", children: m ? /* @__PURE__ */ l("svg", { viewBox: "0 0 10 10", width: "10", height: "10", "aria-hidden": "true", className: B(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.4", strokeLinecap: "round", strokeLinejoin: "round" }) }) : (
|
|
2097
2106
|
/* Drawn in the nominal box and set in the 12 pixels the indicator
|
|
2098
2107
|
has always taken, so that the head does not move. */
|
|
2099
2108
|
/* @__PURE__ */ l("svg", { viewBox: "0 0 10 10", width: "10", height: "12", "aria-hidden": "true", children: /* @__PURE__ */ l("path", { d: "M2.8 3.7 5 1.5l2.2 2.2M2.8 6.3 5 8.5l2.2-2.2", fill: "none", stroke: "currentColor", strokeWidth: "1.4", strokeLinecap: "round", strokeLinejoin: "round" }) })
|
|
2100
2109
|
) })
|
|
2101
2110
|
]
|
|
2102
2111
|
}
|
|
2103
|
-
) : s.label, C = m === "asc" ? "ascending" : m === "desc" ? "descending" : "none",
|
|
2104
|
-
return /* @__PURE__ */
|
|
2112
|
+
) : s.label, C = m === "asc" ? "ascending" : m === "desc" ? "descending" : "none", D = me(s.filter) !== void 0 && !(s.filter === "list" && a === "other");
|
|
2113
|
+
return /* @__PURE__ */ F(
|
|
2105
2114
|
"th",
|
|
2106
2115
|
{
|
|
2107
2116
|
scope: "col",
|
|
2108
2117
|
"data-column": h,
|
|
2109
2118
|
"aria-sort": u ? C : void 0,
|
|
2110
2119
|
tabIndex: s.resizable && !u ? 0 : void 0,
|
|
2111
|
-
onKeyDown:
|
|
2112
|
-
className:
|
|
2120
|
+
onKeyDown: _,
|
|
2121
|
+
className: B(f.th, c && f.numeric, o && f.stickyCell),
|
|
2113
2122
|
style: {
|
|
2114
|
-
...
|
|
2123
|
+
...w !== void 0 ? { width: w } : {},
|
|
2115
2124
|
...o ? { left: r } : {}
|
|
2116
2125
|
},
|
|
2117
2126
|
children: [
|
|
2118
|
-
|
|
2127
|
+
D ? /* @__PURE__ */ F("span", { className: f.thFlex, children: [
|
|
2119
2128
|
S,
|
|
2120
|
-
/* @__PURE__ */ l(
|
|
2129
|
+
/* @__PURE__ */ l(wr, { entry: e, registry: t, hook: n })
|
|
2121
2130
|
] }) : S,
|
|
2122
2131
|
s.resizable && /* @__PURE__ */ l(
|
|
2123
2132
|
"span",
|
|
2124
2133
|
{
|
|
2125
2134
|
role: "presentation",
|
|
2126
2135
|
className: f.grip,
|
|
2127
|
-
onPointerDown:
|
|
2136
|
+
onPointerDown: v,
|
|
2128
2137
|
onClick: (x) => x.stopPropagation(),
|
|
2129
2138
|
onDoubleClick: (x) => {
|
|
2130
|
-
x.stopPropagation(),
|
|
2139
|
+
x.stopPropagation(), p(x.currentTarget.closest("th"));
|
|
2131
2140
|
}
|
|
2132
2141
|
}
|
|
2133
2142
|
)
|
|
@@ -2135,7 +2144,7 @@ function wt({
|
|
|
2135
2144
|
}
|
|
2136
2145
|
);
|
|
2137
2146
|
}
|
|
2138
|
-
function
|
|
2147
|
+
function Wr({
|
|
2139
2148
|
row: e,
|
|
2140
2149
|
index: t,
|
|
2141
2150
|
absolute: n,
|
|
@@ -2149,40 +2158,41 @@ function qr({
|
|
|
2149
2158
|
rowHeaderLeft: h,
|
|
2150
2159
|
columnCount: d,
|
|
2151
2160
|
rowProps: m,
|
|
2152
|
-
baseId:
|
|
2153
|
-
formats:
|
|
2154
|
-
wording:
|
|
2155
|
-
line:
|
|
2156
|
-
spanEntry:
|
|
2161
|
+
baseId: b,
|
|
2162
|
+
formats: w,
|
|
2163
|
+
wording: g,
|
|
2164
|
+
line: v,
|
|
2165
|
+
spanEntry: p
|
|
2157
2166
|
}) {
|
|
2158
|
-
const
|
|
2159
|
-
return /* @__PURE__ */
|
|
2160
|
-
/* @__PURE__ */
|
|
2167
|
+
const _ = Ue(Kt), S = r.publicSnapshot, C = r.rowKey(e), D = Hr(e, i, r, w, g), x = o.detail, A = x !== null && S.expanded.includes(C), y = `${b}-detail-${t}`, { className: O, ...q } = (m == null ? void 0 : m(e)) ?? {}, N = n !== void 0, M = v ? v.span ?? v.parents.at(-1) : void 0;
|
|
2168
|
+
return /* @__PURE__ */ F(Q, { children: [
|
|
2169
|
+
/* @__PURE__ */ F(
|
|
2161
2170
|
"tr",
|
|
2162
2171
|
{
|
|
2163
|
-
...
|
|
2164
|
-
className:
|
|
2172
|
+
...q,
|
|
2173
|
+
className: B(O, N && f.virtualRow),
|
|
2165
2174
|
"data-row": N ? n : void 0,
|
|
2166
|
-
"data-line":
|
|
2175
|
+
"data-line": v ? "row" : void 0,
|
|
2167
2176
|
"data-motion": C,
|
|
2168
|
-
"data-
|
|
2169
|
-
"data-group":
|
|
2170
|
-
"
|
|
2171
|
-
"aria-
|
|
2172
|
-
"aria-
|
|
2173
|
-
|
|
2177
|
+
"data-selected": a && S.selection.isSelected(C) ? "" : void 0,
|
|
2178
|
+
"data-group-first": v != null && v.first ? "" : void 0,
|
|
2179
|
+
"data-group": M == null ? void 0 : M.path,
|
|
2180
|
+
"aria-level": v ? v.parents.length + 1 : void 0,
|
|
2181
|
+
"aria-posinset": M ? M.rows.indexOf(e) + 1 : void 0,
|
|
2182
|
+
"aria-setsize": M == null ? void 0 : M.rows.length,
|
|
2183
|
+
tabIndex: N ? n === _ ? 0 : -1 : void 0,
|
|
2174
2184
|
"data-even": N && n % 2 === 1 ? "" : void 0,
|
|
2175
2185
|
"aria-rowindex": N ? n + 2 : void 0,
|
|
2176
2186
|
children: [
|
|
2177
2187
|
a && /* @__PURE__ */ l(
|
|
2178
2188
|
"td",
|
|
2179
2189
|
{
|
|
2180
|
-
className:
|
|
2190
|
+
className: B(f.td, f.control, u && f.stickyCell),
|
|
2181
2191
|
style: u ? { left: 0 } : void 0,
|
|
2182
2192
|
children: /* @__PURE__ */ l(
|
|
2183
2193
|
Ce,
|
|
2184
2194
|
{
|
|
2185
|
-
"aria-label":
|
|
2195
|
+
"aria-label": g.selectRow(D),
|
|
2186
2196
|
checked: S.selection.isSelected(C),
|
|
2187
2197
|
onChange: () => S.selection.toggle(C)
|
|
2188
2198
|
}
|
|
@@ -2192,41 +2202,41 @@ function qr({
|
|
|
2192
2202
|
x && /* @__PURE__ */ l(
|
|
2193
2203
|
"td",
|
|
2194
2204
|
{
|
|
2195
|
-
className:
|
|
2196
|
-
style: u ? { left: (a ? 1 : 0) *
|
|
2205
|
+
className: B(f.td, f.control, u && f.stickyCell),
|
|
2206
|
+
style: u ? { left: (a ? 1 : 0) * Fe } : void 0,
|
|
2197
2207
|
children: /* @__PURE__ */ l(
|
|
2198
2208
|
"button",
|
|
2199
2209
|
{
|
|
2200
2210
|
type: "button",
|
|
2201
2211
|
"aria-expanded": A,
|
|
2202
|
-
"aria-controls": A ?
|
|
2203
|
-
"aria-label": A ?
|
|
2204
|
-
className:
|
|
2212
|
+
"aria-controls": A ? y : void 0,
|
|
2213
|
+
"aria-label": A ? g.collapseRowNamed(D) : g.expandRowNamed(D),
|
|
2214
|
+
className: B(f.expander, A && f.expanderOpen),
|
|
2205
2215
|
onClick: () => S.toggleRow(C),
|
|
2206
2216
|
children: /* @__PURE__ */ l(tn, {})
|
|
2207
2217
|
}
|
|
2208
2218
|
)
|
|
2209
2219
|
}
|
|
2210
2220
|
),
|
|
2211
|
-
|
|
2212
|
-
s.map((
|
|
2221
|
+
v && v.span && /* @__PURE__ */ l(Gr, { line: { ...v, span: v.span }, entry: p, selectable: a, hook: r, formats: w, wording: g }),
|
|
2222
|
+
s.map((E) => /* @__PURE__ */ l(
|
|
2213
2223
|
Yr,
|
|
2214
2224
|
{
|
|
2215
|
-
entry:
|
|
2225
|
+
entry: E,
|
|
2216
2226
|
row: e,
|
|
2217
|
-
kind: o.kindOf(
|
|
2218
|
-
sticky: u &&
|
|
2227
|
+
kind: o.kindOf(E, r.rows),
|
|
2228
|
+
sticky: u && E === i,
|
|
2219
2229
|
left: h,
|
|
2220
|
-
formats:
|
|
2221
|
-
wording:
|
|
2230
|
+
formats: w,
|
|
2231
|
+
wording: g
|
|
2222
2232
|
},
|
|
2223
|
-
|
|
2233
|
+
E.key
|
|
2224
2234
|
)),
|
|
2225
|
-
c.length > 0 && /* @__PURE__ */ l("td", { className:
|
|
2235
|
+
c.length > 0 && /* @__PURE__ */ l("td", { className: B(f.td, f.actionsCell), children: /* @__PURE__ */ l(Xr, { actions: c, row: e, name: D, wording: g }) })
|
|
2226
2236
|
]
|
|
2227
2237
|
}
|
|
2228
2238
|
),
|
|
2229
|
-
A && x && /* @__PURE__ */ l("tr", { id:
|
|
2239
|
+
A && x && /* @__PURE__ */ l("tr", { id: y, className: f.detailRow, "data-group": M == null ? void 0 : M.path, children: /* @__PURE__ */ l("td", { colSpan: d, className: f.detailCell, children: x.presentation(e) }) })
|
|
2230
2240
|
] });
|
|
2231
2241
|
}
|
|
2232
2242
|
function Yr({
|
|
@@ -2238,15 +2248,15 @@ function Yr({
|
|
|
2238
2248
|
formats: s,
|
|
2239
2249
|
wording: i
|
|
2240
2250
|
}) {
|
|
2241
|
-
const { spec: a } = e, c = e.read(t), u =
|
|
2251
|
+
const { spec: a } = e, c = e.read(t), u = Je(n, a.rightAligned);
|
|
2242
2252
|
let h;
|
|
2243
|
-
Y(c) ? h = /* @__PURE__ */ l(
|
|
2253
|
+
Y(c) ? h = /* @__PURE__ */ l(Ht, { wording: i }) : a.presentation ? h = a.presentation(c, t) : h = ye(c, a.format, s, i);
|
|
2244
2254
|
const d = a.rowHeader ? "th" : "td";
|
|
2245
2255
|
return /* @__PURE__ */ l(
|
|
2246
2256
|
d,
|
|
2247
2257
|
{
|
|
2248
2258
|
scope: a.rowHeader ? "row" : void 0,
|
|
2249
|
-
className:
|
|
2259
|
+
className: B(f.td, u && f.numeric, a.rowHeader && f.rowHeader, o && f.stickyCell),
|
|
2250
2260
|
style: o ? { left: r } : void 0,
|
|
2251
2261
|
children: h
|
|
2252
2262
|
}
|
|
@@ -2261,9 +2271,9 @@ function Ur({
|
|
|
2261
2271
|
left: s
|
|
2262
2272
|
}) {
|
|
2263
2273
|
const i = r ? { left: s } : void 0;
|
|
2264
|
-
if (!e.spec.aggregate) return /* @__PURE__ */ l("td", { className:
|
|
2274
|
+
if (!e.spec.aggregate) return /* @__PURE__ */ l("td", { className: B(f.td, r && f.stickyCell), style: i });
|
|
2265
2275
|
const a = typeof e.spec.aggregate == "function" ? "own" : e.spec.aggregate;
|
|
2266
|
-
return /* @__PURE__ */ l("td", { className:
|
|
2276
|
+
return /* @__PURE__ */ l("td", { className: B(f.td, jt(e, t) && f.numeric, r && f.stickyCell), style: i, "data-footer": a, children: /* @__PURE__ */ l($e, { entry: e, rows: t, formats: n, wording: o, signed: !0 }) });
|
|
2267
2277
|
}
|
|
2268
2278
|
const Jr = 2;
|
|
2269
2279
|
function Xr({
|
|
@@ -2287,53 +2297,53 @@ function Xr({
|
|
|
2287
2297
|
},
|
|
2288
2298
|
s
|
|
2289
2299
|
)) }) : /* @__PURE__ */ l("div", { className: f.actions, children: /* @__PURE__ */ l(
|
|
2290
|
-
|
|
2300
|
+
Tt,
|
|
2291
2301
|
{
|
|
2292
2302
|
align: "end",
|
|
2293
2303
|
trigger: /* @__PURE__ */ l(ee, { size: "sm", variant: "ghost", "aria-label": o.rowActionsMenu(n), children: "⋯" }),
|
|
2294
|
-
children: e.map(({ key: s, spec: i }) => /* @__PURE__ */ l(
|
|
2304
|
+
children: e.map(({ key: s, spec: i }) => /* @__PURE__ */ l(Oe, { tone: i.tone, onSelect: () => r(i), children: i.label }, s))
|
|
2295
2305
|
}
|
|
2296
2306
|
) });
|
|
2297
2307
|
}
|
|
2298
|
-
function Qr({ columns: e,
|
|
2299
|
-
const
|
|
2300
|
-
return /* @__PURE__ */ l(Q, { children: Array.from({ length:
|
|
2308
|
+
function Qr({ columns: e, rightAligned: t = [], rows: n = 4 }) {
|
|
2309
|
+
const o = [72, 48, 60, 40, 56, 64];
|
|
2310
|
+
return /* @__PURE__ */ l(Q, { children: Array.from({ length: n }, (r, s) => /* @__PURE__ */ l("tr", { "aria-hidden": "true", children: Array.from({ length: e }, (i, a) => /* @__PURE__ */ l("td", { className: B(f.td, t[a] && f.numeric), children: /* @__PURE__ */ l("span", { className: f.skeleton, style: { width: `${o[(s + a) % o.length]}%` } }) }, a)) }, s)) });
|
|
2301
2311
|
}
|
|
2302
|
-
const
|
|
2303
|
-
function
|
|
2312
|
+
const Kt = St(0);
|
|
2313
|
+
function wt({ height: e, colSpan: t }) {
|
|
2304
2314
|
return e <= 0 ? null : /* @__PURE__ */ l("tr", { "aria-hidden": "true", "data-filler": "", className: f.fillerRow, children: /* @__PURE__ */ l("td", { colSpan: t, style: { height: e } }) });
|
|
2305
2315
|
}
|
|
2306
|
-
function
|
|
2316
|
+
function _t({
|
|
2307
2317
|
virtual: e,
|
|
2308
2318
|
colSpan: t,
|
|
2309
2319
|
children: n
|
|
2310
2320
|
}) {
|
|
2311
|
-
const { count: o, fillerBefore: r, fillerAfter: s, showRow: i } = e, a = re(null), [c, u] =
|
|
2312
|
-
a.current =
|
|
2313
|
-
var
|
|
2314
|
-
(
|
|
2321
|
+
const { count: o, fillerBefore: r, fillerAfter: s, showRow: i } = e, a = re(null), [c, u] = H(0), h = (b, w) => {
|
|
2322
|
+
a.current = w, u(w), i(w), requestAnimationFrame(() => {
|
|
2323
|
+
var g;
|
|
2324
|
+
(g = b.querySelector(`[data-row="${w}"]`)) == null || g.focus();
|
|
2315
2325
|
});
|
|
2316
|
-
}, d = c >= e.from && c < e.to ? c : e.from, m = (
|
|
2317
|
-
if (
|
|
2318
|
-
const
|
|
2319
|
-
if (
|
|
2320
|
-
const
|
|
2321
|
-
let
|
|
2322
|
-
|
|
2326
|
+
}, d = c >= e.from && c < e.to ? c : e.from, m = (b) => {
|
|
2327
|
+
if (b.defaultPrevented || o === 0) return;
|
|
2328
|
+
const w = b.target, g = w.closest("[data-row]");
|
|
2329
|
+
if (g && w !== g) return;
|
|
2330
|
+
const v = g ? Number(g.dataset.row) : a.current ?? -1;
|
|
2331
|
+
let p = null;
|
|
2332
|
+
b.key === "ArrowDown" ? p = Math.min(o - 1, v + 1) : b.key === "ArrowUp" ? p = Math.max(0, v - 1) : b.key === "Home" ? p = 0 : b.key === "End" && (p = o - 1), !(p === null || p === v) && (b.preventDefault(), h(b.currentTarget, p));
|
|
2323
2333
|
};
|
|
2324
2334
|
return /* @__PURE__ */ l(
|
|
2325
2335
|
"tbody",
|
|
2326
2336
|
{
|
|
2327
2337
|
className: f.virtualBody,
|
|
2328
2338
|
onKeyDown: m,
|
|
2329
|
-
onFocus: (
|
|
2330
|
-
const
|
|
2331
|
-
|
|
2339
|
+
onFocus: (b) => {
|
|
2340
|
+
const w = b.target.closest("[data-row]");
|
|
2341
|
+
w && u(Number(w.dataset.row));
|
|
2332
2342
|
},
|
|
2333
|
-
children: /* @__PURE__ */
|
|
2334
|
-
/* @__PURE__ */ l(
|
|
2343
|
+
children: /* @__PURE__ */ F(Kt.Provider, { value: d, children: [
|
|
2344
|
+
/* @__PURE__ */ l(wt, { height: r, colSpan: t }),
|
|
2335
2345
|
n,
|
|
2336
|
-
/* @__PURE__ */ l(
|
|
2346
|
+
/* @__PURE__ */ l(wt, { height: s, colSpan: t })
|
|
2337
2347
|
] })
|
|
2338
2348
|
}
|
|
2339
2349
|
);
|
|
@@ -2343,7 +2353,7 @@ const Zr = "_verdict_1mxfd_6", es = "_glyph_1mxfd_13", ts = "_value_1mxfd_23", n
|
|
|
2343
2353
|
glyph: es,
|
|
2344
2354
|
value: ts,
|
|
2345
2355
|
excess: ns
|
|
2346
|
-
},
|
|
2356
|
+
}, yt = (e, t, n) => t === "percent" ? n.percent(e) : t === "count" ? n.count(e) : n.number(e, typeof t == "object" ? t.decimals : void 0), os = (e, t) => e === "alarm" ? t.verdictAlarm : e === "warning" ? t.verdictWarning : e === "unknown" ? t.verdictUnknown : t.verdictOk, rs = {
|
|
2347
2357
|
ok: "✓",
|
|
2348
2358
|
unknown: "?",
|
|
2349
2359
|
warning: "▲",
|
|
@@ -2351,33 +2361,33 @@ const Zr = "_verdict_1mxfd_6", es = "_glyph_1mxfd_13", ts = "_value_1mxfd_23", n
|
|
|
2351
2361
|
};
|
|
2352
2362
|
function ss({ reading: e, format: t }) {
|
|
2353
2363
|
const n = ue(), o = U(), { measured: r, assessment: s } = e, i = os(s.verdict, o);
|
|
2354
|
-
return /* @__PURE__ */
|
|
2364
|
+
return /* @__PURE__ */ F("span", { className: Te.verdict, "data-verdict": s.verdict, title: i, children: [
|
|
2355
2365
|
/* @__PURE__ */ l("span", { "aria-hidden": "true", className: Te.glyph, children: rs[s.verdict] }),
|
|
2356
|
-
/* @__PURE__ */ l("span", { className: Te.value, children: r === null ? o.statAbsentValue :
|
|
2357
|
-
s.excess !== void 0 && /* @__PURE__ */
|
|
2366
|
+
/* @__PURE__ */ l("span", { className: Te.value, children: r === null ? o.statAbsentValue : yt(r, t, n) }),
|
|
2367
|
+
s.excess !== void 0 && /* @__PURE__ */ F("span", { className: Te.excess, children: [
|
|
2358
2368
|
"+",
|
|
2359
|
-
|
|
2369
|
+
yt(s.excess, t, n)
|
|
2360
2370
|
] }),
|
|
2361
|
-
/* @__PURE__ */ l(
|
|
2371
|
+
/* @__PURE__ */ l(Re, { children: i })
|
|
2362
2372
|
] });
|
|
2363
2373
|
}
|
|
2364
2374
|
const is = (e) => e.measured, as = (e) => e.reduce(
|
|
2365
|
-
(t, n) => !t ||
|
|
2375
|
+
(t, n) => !t || Ge(n.assessment.verdict) > Ge(t.assessment.verdict) ? n : t,
|
|
2366
2376
|
void 0
|
|
2367
2377
|
);
|
|
2368
2378
|
function ls(e) {
|
|
2369
2379
|
return function({ id: n, value: o, label: r, limits: s, format: i, sortBy: a = "verdict", width: c, resizable: u, aggregate: h }) {
|
|
2370
|
-
const d = JSON.stringify(s), m =
|
|
2371
|
-
const
|
|
2372
|
-
return (
|
|
2373
|
-
const
|
|
2380
|
+
const d = JSON.stringify(s), m = j(() => {
|
|
2381
|
+
const w = JSON.parse(d);
|
|
2382
|
+
return (g) => {
|
|
2383
|
+
const v = typeof o == "string" ? g == null ? void 0 : g[o] : o(g);
|
|
2374
2384
|
return {
|
|
2375
|
-
measured: typeof
|
|
2376
|
-
assessment: nn(
|
|
2385
|
+
measured: typeof v == "number" && Number.isFinite(v) ? v : null,
|
|
2386
|
+
assessment: nn(v, w)
|
|
2377
2387
|
};
|
|
2378
2388
|
};
|
|
2379
|
-
}, [o, d]),
|
|
2380
|
-
(
|
|
2389
|
+
}, [o, d]), b = X(
|
|
2390
|
+
(w) => a === "value" ? w.measured : Ge(w.assessment.verdict),
|
|
2381
2391
|
[a]
|
|
2382
2392
|
);
|
|
2383
2393
|
return /* @__PURE__ */ l(
|
|
@@ -2389,23 +2399,23 @@ function ls(e) {
|
|
|
2389
2399
|
width: c,
|
|
2390
2400
|
resizable: u,
|
|
2391
2401
|
value: m,
|
|
2392
|
-
sortValue:
|
|
2402
|
+
sortValue: b,
|
|
2393
2403
|
exportValue: is,
|
|
2394
2404
|
aggregate: h === "worst" ? as : void 0,
|
|
2395
|
-
children: (
|
|
2405
|
+
children: (w) => /* @__PURE__ */ l(ss, { reading: w, format: i })
|
|
2396
2406
|
}
|
|
2397
2407
|
);
|
|
2398
2408
|
};
|
|
2399
2409
|
}
|
|
2400
|
-
const
|
|
2410
|
+
const Wt = (e) => ge(
|
|
2401
2411
|
`condition-foreign:${e}`,
|
|
2402
2412
|
`The condition for "${e}" is not of the kind of its filter and is passed over.`
|
|
2403
2413
|
);
|
|
2404
2414
|
function Yt(e, t, n) {
|
|
2405
2415
|
const o = e.columnById(t), r = o ? me(o.spec.filter) : void 0;
|
|
2406
2416
|
if (!r) return !1;
|
|
2407
|
-
const s =
|
|
2408
|
-
return s === "foreign" &&
|
|
2417
|
+
const s = Vt(r, n);
|
|
2418
|
+
return s === "foreign" && Wt(t), s === "effective";
|
|
2409
2419
|
}
|
|
2410
2420
|
function cs(e, t) {
|
|
2411
2421
|
if (e.length === 0) return;
|
|
@@ -2425,7 +2435,7 @@ function cs(e, t) {
|
|
|
2425
2435
|
};
|
|
2426
2436
|
}
|
|
2427
2437
|
function us(e, t) {
|
|
2428
|
-
const n =
|
|
2438
|
+
const n = j(() => t ? e.filter((i) => t(i)) : e, [e, t]), [o, r] = H(() => ({ source: e, result: n }));
|
|
2429
2439
|
if (!t) return e;
|
|
2430
2440
|
const s = o.source === e && (o.result === n || o.result.length === n.length && o.result.every((i, a) => i === n[a]));
|
|
2431
2441
|
return s || r({ source: e, result: n }), s ? o.result : n;
|
|
@@ -2433,7 +2443,7 @@ function us(e, t) {
|
|
|
2433
2443
|
function ds(e, t) {
|
|
2434
2444
|
var a, c, u, h, d, m;
|
|
2435
2445
|
if (t.size === 0) return e;
|
|
2436
|
-
const n = (a = e.sort) == null ? void 0 : a.filter((
|
|
2446
|
+
const n = (a = e.sort) == null ? void 0 : a.filter((b) => t.has(b.column)), o = (c = e.hidden) == null ? void 0 : c.filter((b) => t.has(b)), r = (u = e.order) == null ? void 0 : u.filter((b) => t.has(b)), s = e.widths ? Object.fromEntries(Object.entries(e.widths).filter(([b]) => t.has(b))) : void 0;
|
|
2437
2447
|
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 : {
|
|
2438
2448
|
...e.search ? { search: e.search } : {},
|
|
2439
2449
|
...e.page ? { page: e.page } : {},
|
|
@@ -2444,8 +2454,8 @@ function ds(e, t) {
|
|
|
2444
2454
|
...s && Object.keys(s).length ? { widths: s } : {}
|
|
2445
2455
|
};
|
|
2446
2456
|
}
|
|
2447
|
-
const
|
|
2448
|
-
function
|
|
2457
|
+
const Be = (e) => e === void 0 ? [] : typeof e == "string" ? [e] : [...e], fs = (e, t) => e.length === t.length && e.every((n, o) => n === t[o]);
|
|
2458
|
+
function kt(e) {
|
|
2449
2459
|
const t = [], n = (o) => {
|
|
2450
2460
|
for (const r of o)
|
|
2451
2461
|
t.push(r.path), n(r.groups);
|
|
@@ -2453,24 +2463,24 @@ function yt(e) {
|
|
|
2453
2463
|
return n(e ?? []), t;
|
|
2454
2464
|
}
|
|
2455
2465
|
const hs = (e, t) => e.size === t.size && [...e].every((n) => t.has(n));
|
|
2456
|
-
function
|
|
2466
|
+
function ps(e, t) {
|
|
2457
2467
|
const n = {};
|
|
2458
2468
|
for (const o of e) o.width !== void 0 && (n[o.id] = o.width);
|
|
2459
2469
|
return { ...n, ...t };
|
|
2460
2470
|
}
|
|
2461
|
-
function
|
|
2462
|
-
const [n] =
|
|
2463
|
-
const k =
|
|
2471
|
+
function gs(e, t) {
|
|
2472
|
+
const [n] = H(() => new gr()), [o] = H(() => {
|
|
2473
|
+
const k = jr(n);
|
|
2464
2474
|
return { ...k, VerdictColumn: ls(k.Column) };
|
|
2465
2475
|
});
|
|
2466
|
-
|
|
2467
|
-
const r = ue(), s = e, i = n.modelColumns(s, r), [a] =
|
|
2468
|
-
() => a != null && a.grouping ? [...a.grouping] :
|
|
2469
|
-
), [
|
|
2470
|
-
() =>
|
|
2476
|
+
qe(n.subscribe, n.structureVersion, n.structureVersion);
|
|
2477
|
+
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 = j(() => cs(c, n), [c, n]), d = t.preFilter ?? t.filter, m = us(s, d), [b, w] = H(
|
|
2478
|
+
() => a != null && a.grouping ? [...a.grouping] : Be(t.defaultGrouping)
|
|
2479
|
+
), [g, v] = H(() => (a == null ? void 0 : a.folded) ?? []), p = n.orderedColumns().length + n.groupKeys.entries.size > 0, _ = p ? n.effectiveGrouping(b, s) : b.slice(0, Ze), S = _.join("|"), C = j(() => new Set(g), [g]), D = _.length ? n.groupingModel(_, s) : null, x = j(
|
|
2480
|
+
() => D && D.levels.length ? { ...D, folded: C, compareText: r.compareText } : void 0,
|
|
2471
2481
|
// eslint-disable-next-line react-hooks/exhaustive-deps -- the model's identity carries the ids and the columns
|
|
2472
|
-
[
|
|
2473
|
-
), A = t.rowKey,
|
|
2482
|
+
[D, C, r.compareText, S]
|
|
2483
|
+
), A = t.rowKey, y = _n(m, i, {
|
|
2474
2484
|
rowKey: A,
|
|
2475
2485
|
pageSize: t.pageSize,
|
|
2476
2486
|
defaultSort: t.defaultSort,
|
|
@@ -2478,78 +2488,78 @@ function ps(e, t) {
|
|
|
2478
2488
|
initialView: a,
|
|
2479
2489
|
virtual: t.virtual,
|
|
2480
2490
|
grouping: x
|
|
2481
|
-
}), { setPage:
|
|
2482
|
-
(k,
|
|
2483
|
-
let
|
|
2484
|
-
if (
|
|
2485
|
-
const
|
|
2486
|
-
if (!
|
|
2487
|
-
|
|
2491
|
+
}), { setPage: O } = y, q = X(
|
|
2492
|
+
(k, R) => {
|
|
2493
|
+
let $ = R == null;
|
|
2494
|
+
if (!$ && n.orderedColumns().length > 0) {
|
|
2495
|
+
const z = n.columnById(k), L = z ? me(z.spec.filter) : void 0;
|
|
2496
|
+
if (!L) {
|
|
2497
|
+
ge(
|
|
2488
2498
|
`condition-without-filter:${k}`,
|
|
2489
|
-
|
|
2499
|
+
z ? `The column "${k}" has no filter; its condition is passed over.` : `No column is called "${k}"; its condition is passed over.`
|
|
2490
2500
|
);
|
|
2491
2501
|
return;
|
|
2492
2502
|
}
|
|
2493
|
-
const J =
|
|
2503
|
+
const J = Vt(L, R);
|
|
2494
2504
|
if (J === "foreign") {
|
|
2495
|
-
|
|
2505
|
+
Wt(k);
|
|
2496
2506
|
return;
|
|
2497
2507
|
}
|
|
2498
|
-
|
|
2508
|
+
$ = J === "empty";
|
|
2499
2509
|
}
|
|
2500
|
-
u((
|
|
2501
|
-
const
|
|
2502
|
-
return
|
|
2503
|
-
}),
|
|
2510
|
+
u((z) => {
|
|
2511
|
+
const L = z.findIndex(([J]) => J === k);
|
|
2512
|
+
return $ ? L === -1 ? z : z.filter((J, Z) => Z !== L) : L === -1 ? [...z, [k, R]] : z.map((J, Z) => Z === L ? [k, R] : J);
|
|
2513
|
+
}), O(1);
|
|
2504
2514
|
},
|
|
2505
|
-
[n,
|
|
2506
|
-
), N = new Set(n.orderedColumns().map((k) => k.spec.id)), [
|
|
2507
|
-
if (!hs(
|
|
2508
|
-
const k = new Set([...
|
|
2509
|
-
|
|
2510
|
-
}
|
|
2511
|
-
const
|
|
2512
|
-
...
|
|
2513
|
-
...fs(
|
|
2515
|
+
[n, O]
|
|
2516
|
+
), N = new Set(n.orderedColumns().map((k) => k.spec.id)), [M, E] = H(() => /* @__PURE__ */ new Set());
|
|
2517
|
+
if (!hs(M, N)) {
|
|
2518
|
+
const k = new Set([...M].filter((R) => !N.has(R)));
|
|
2519
|
+
E(N), c.some(([R]) => k.has(R)) && u((R) => R.filter(([$]) => !k.has($)));
|
|
2520
|
+
}
|
|
2521
|
+
const I = N.size === 0 ? c : c.filter(([k, R]) => Yt(n, k, R)), K = ds(y.view, N), se = I.length > 0 ? { ...K, conditions: Object.fromEntries(I) } : K, ae = N.size === 0 ? y.sort : y.sort.filter((k) => N.has(k.column)), de = p ? n.effectiveGrouping(Be(t.defaultGrouping), s) : Be(t.defaultGrouping), fe = y.groups ? hn(y.groups, g) : p ? [] : [...g], be = {
|
|
2522
|
+
...se,
|
|
2523
|
+
...fs(_, de) ? {} : { grouping: _ },
|
|
2514
2524
|
...fe.length ? { folded: fe } : {}
|
|
2515
|
-
},
|
|
2516
|
-
|
|
2525
|
+
}, ve = (k) => {
|
|
2526
|
+
w([...k]), O(1);
|
|
2517
2527
|
}, ke = (k) => {
|
|
2518
|
-
|
|
2528
|
+
kt(y.groups).includes(k) && (n.noteFocusBeforeFold(), v((R) => R.includes(k) ? R.filter(($) => $ !== k) : [...R, k]));
|
|
2519
2529
|
}, le = n.paginates() || t.virtual !== void 0, te = {
|
|
2520
2530
|
rows: e,
|
|
2521
|
-
filtered:
|
|
2522
|
-
visible: le ?
|
|
2523
|
-
page: le ?
|
|
2524
|
-
pageCount: le ?
|
|
2525
|
-
pageSize:
|
|
2526
|
-
setPage:
|
|
2527
|
-
setPageSize:
|
|
2528
|
-
search:
|
|
2529
|
-
setSearch:
|
|
2531
|
+
filtered: y.filtered,
|
|
2532
|
+
visible: le ? y.visible : y.filtered,
|
|
2533
|
+
page: le ? y.page : 1,
|
|
2534
|
+
pageCount: le ? y.pageCount : 1,
|
|
2535
|
+
pageSize: y.pageSize,
|
|
2536
|
+
setPage: y.setPage,
|
|
2537
|
+
setPageSize: y.setPageSize,
|
|
2538
|
+
search: y.search,
|
|
2539
|
+
setSearch: y.setSearch,
|
|
2530
2540
|
sort: ae,
|
|
2531
|
-
toggleSort:
|
|
2532
|
-
hidden:
|
|
2533
|
-
toggleColumn:
|
|
2534
|
-
order:
|
|
2535
|
-
setOrder:
|
|
2536
|
-
widths:
|
|
2537
|
-
setWidth:
|
|
2538
|
-
expanded:
|
|
2539
|
-
toggleRow:
|
|
2540
|
-
filter: Object.fromEntries(
|
|
2541
|
-
setFilter:
|
|
2542
|
-
selection: t.selection ??
|
|
2543
|
-
view:
|
|
2544
|
-
grouping:
|
|
2545
|
-
setGrouping:
|
|
2541
|
+
toggleSort: y.toggleSort,
|
|
2542
|
+
hidden: y.hidden,
|
|
2543
|
+
toggleColumn: y.toggleColumn,
|
|
2544
|
+
order: y.order,
|
|
2545
|
+
setOrder: y.setOrder,
|
|
2546
|
+
widths: ps(i, y.widths),
|
|
2547
|
+
setWidth: y.setWidth,
|
|
2548
|
+
expanded: y.expanded,
|
|
2549
|
+
toggleRow: y.toggleRow,
|
|
2550
|
+
filter: Object.fromEntries(I),
|
|
2551
|
+
setFilter: q,
|
|
2552
|
+
selection: t.selection ?? y.selection,
|
|
2553
|
+
view: be,
|
|
2554
|
+
grouping: _,
|
|
2555
|
+
setGrouping: ve,
|
|
2546
2556
|
folded: fe,
|
|
2547
2557
|
toggleFold: ke,
|
|
2548
2558
|
foldAll: () => {
|
|
2549
|
-
n.noteFocusBeforeFold(),
|
|
2559
|
+
n.noteFocusBeforeFold(), v(kt(y.groups));
|
|
2550
2560
|
},
|
|
2551
2561
|
unfoldAll: () => {
|
|
2552
|
-
n.noteFocusBeforeFold(),
|
|
2562
|
+
n.noteFocusBeforeFold(), v([]);
|
|
2553
2563
|
},
|
|
2554
2564
|
asCsv: () => Ar(n),
|
|
2555
2565
|
virtual: t.virtual !== void 0
|
|
@@ -2558,7 +2568,7 @@ function ps(e, t) {
|
|
|
2558
2568
|
rows: s,
|
|
2559
2569
|
admitted: m,
|
|
2560
2570
|
modelColumns: i,
|
|
2561
|
-
companion:
|
|
2571
|
+
companion: y,
|
|
2562
2572
|
filter: h,
|
|
2563
2573
|
grouping: x,
|
|
2564
2574
|
folded: C,
|
|
@@ -2570,8 +2580,8 @@ function ps(e, t) {
|
|
|
2570
2580
|
function Qs(e) {
|
|
2571
2581
|
return e;
|
|
2572
2582
|
}
|
|
2573
|
-
function
|
|
2574
|
-
const n =
|
|
2583
|
+
function ot(e, t) {
|
|
2584
|
+
const n = ie();
|
|
2575
2585
|
e == null || e.register(t, n), W(() => {
|
|
2576
2586
|
if (e)
|
|
2577
2587
|
return e.register(t, n), e.commit(), () => {
|
|
@@ -2581,13 +2591,13 @@ function nt(e, t) {
|
|
|
2581
2591
|
}
|
|
2582
2592
|
function Zs({ children: e, className: t, of: n }) {
|
|
2583
2593
|
const o = xe(n);
|
|
2584
|
-
|
|
2594
|
+
ot(o == null ? void 0 : o.registry, "toolbar");
|
|
2585
2595
|
const r = o == null ? void 0 : o.registry;
|
|
2586
|
-
return /* @__PURE__ */ l(
|
|
2596
|
+
return /* @__PURE__ */ l(zt, { registry: r ?? null, className: t, children: e });
|
|
2587
2597
|
}
|
|
2588
2598
|
function ei({ placeholder: e, "aria-label": t, className: n, of: o }) {
|
|
2589
2599
|
const r = xe(o), s = U();
|
|
2590
|
-
if (
|
|
2600
|
+
if (ot(r == null ? void 0 : r.registry, "search"), !r) return null;
|
|
2591
2601
|
const { snapshot: i } = r;
|
|
2592
2602
|
return /* @__PURE__ */ l(
|
|
2593
2603
|
rn,
|
|
@@ -2605,25 +2615,25 @@ function ei({ placeholder: e, "aria-label": t, className: n, of: o }) {
|
|
|
2605
2615
|
);
|
|
2606
2616
|
}
|
|
2607
2617
|
function ti({ of: e }) {
|
|
2608
|
-
var
|
|
2609
|
-
const t = xe(e), n = U(), [o, r] =
|
|
2618
|
+
var v;
|
|
2619
|
+
const t = xe(e), n = U(), [o, r] = H(!1), s = re(null), i = re(null), a = ie(), [c, u] = H(null);
|
|
2610
2620
|
if (W(() => {
|
|
2611
2621
|
var C;
|
|
2612
2622
|
if (!c || !i.current) return;
|
|
2613
|
-
const
|
|
2614
|
-
(
|
|
2615
|
-
),
|
|
2623
|
+
const p = Array.from(i.current.children).find(
|
|
2624
|
+
(D) => D.dataset.column === c.id
|
|
2625
|
+
), _ = p == null ? void 0 : p.querySelector(`[data-direction="${c.direction}"]`), S = p == null ? void 0 : p.querySelector(
|
|
2616
2626
|
`[data-direction="${c.direction === "forward" ? "backward" : "forward"}"]`
|
|
2617
2627
|
);
|
|
2618
|
-
(C =
|
|
2628
|
+
(C = _ && !_.disabled ? _ : S) == null || C.focus();
|
|
2619
2629
|
}, [c]), !t) return null;
|
|
2620
|
-
const { registry: h, snapshot: d } = t, m = h.hook,
|
|
2621
|
-
|
|
2622
|
-
),
|
|
2623
|
-
const S =
|
|
2624
|
-
C < 0 || C >= S.length || ([S[
|
|
2630
|
+
const { registry: h, snapshot: d } = t, m = h.hook, b = h.withStickyHeaderFirst(
|
|
2631
|
+
tt(h.modelColumns(m.rows, m.formats), d.order)
|
|
2632
|
+
), w = h.stickyRowHeader ? ((v = b[0]) == null ? void 0 : v.hideable) === !1 : !1, g = (p, _) => {
|
|
2633
|
+
const S = b.map((D) => D.id), C = p + _;
|
|
2634
|
+
C < 0 || C >= S.length || ([S[p], S[C]] = [S[C], S[p]], d.setOrder(S), u({ id: b[p].id, direction: _ < 0 ? "forward" : "backward" }));
|
|
2625
2635
|
};
|
|
2626
|
-
return /* @__PURE__ */
|
|
2636
|
+
return /* @__PURE__ */ F(Q, { children: [
|
|
2627
2637
|
/* @__PURE__ */ l(
|
|
2628
2638
|
ee,
|
|
2629
2639
|
{
|
|
@@ -2636,8 +2646,8 @@ function ti({ of: e }) {
|
|
|
2636
2646
|
children: n.columns
|
|
2637
2647
|
}
|
|
2638
2648
|
),
|
|
2639
|
-
/* @__PURE__ */
|
|
2640
|
-
|
|
2649
|
+
/* @__PURE__ */ F(
|
|
2650
|
+
Nt,
|
|
2641
2651
|
{
|
|
2642
2652
|
open: o,
|
|
2643
2653
|
onOpenChange: r,
|
|
@@ -2648,16 +2658,16 @@ function ti({ of: e }) {
|
|
|
2648
2658
|
id: a,
|
|
2649
2659
|
className: f.columnsPanel,
|
|
2650
2660
|
children: [
|
|
2651
|
-
/* @__PURE__ */ l("ul", { ref: i, className: f.columnsList, "aria-label": n.arrangeColumns, children:
|
|
2652
|
-
const S =
|
|
2653
|
-
return /* @__PURE__ */
|
|
2661
|
+
/* @__PURE__ */ l("ul", { ref: i, className: f.columnsList, "aria-label": n.arrangeColumns, children: b.map((p, _) => {
|
|
2662
|
+
const S = p.label ?? p.id;
|
|
2663
|
+
return /* @__PURE__ */ F("li", { className: f.columnsEntry, "data-column": p.id, children: [
|
|
2654
2664
|
/* @__PURE__ */ l(
|
|
2655
2665
|
Ce,
|
|
2656
2666
|
{
|
|
2657
2667
|
label: S,
|
|
2658
|
-
checked: !d.hidden.includes(
|
|
2659
|
-
disabled:
|
|
2660
|
-
onChange: () => d.toggleColumn(
|
|
2668
|
+
checked: !d.hidden.includes(p.id),
|
|
2669
|
+
disabled: p.hideable === !1,
|
|
2670
|
+
onChange: () => d.toggleColumn(p.id)
|
|
2661
2671
|
}
|
|
2662
2672
|
),
|
|
2663
2673
|
/* @__PURE__ */ l(
|
|
@@ -2667,8 +2677,8 @@ function ti({ of: e }) {
|
|
|
2667
2677
|
className: f.move,
|
|
2668
2678
|
"data-direction": "forward",
|
|
2669
2679
|
"aria-label": n.columnForward(S),
|
|
2670
|
-
disabled:
|
|
2671
|
-
onClick: () =>
|
|
2680
|
+
disabled: _ === 0 || w && _ <= 1,
|
|
2681
|
+
onClick: () => g(_, -1),
|
|
2672
2682
|
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.4", strokeLinecap: "round", strokeLinejoin: "round" }) })
|
|
2673
2683
|
}
|
|
2674
2684
|
),
|
|
@@ -2679,14 +2689,14 @@ function ti({ of: e }) {
|
|
|
2679
2689
|
className: f.move,
|
|
2680
2690
|
"data-direction": "backward",
|
|
2681
2691
|
"aria-label": n.columnBackward(S),
|
|
2682
|
-
disabled:
|
|
2683
|
-
onClick: () =>
|
|
2692
|
+
disabled: _ === b.length - 1 || w && _ === 0,
|
|
2693
|
+
onClick: () => g(_, 1),
|
|
2684
2694
|
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.4", strokeLinecap: "round", strokeLinejoin: "round" }) })
|
|
2685
2695
|
}
|
|
2686
2696
|
)
|
|
2687
|
-
] },
|
|
2697
|
+
] }, p.id);
|
|
2688
2698
|
}) }),
|
|
2689
|
-
/* @__PURE__ */ l(
|
|
2699
|
+
/* @__PURE__ */ l(Or, { registry: h, hook: m })
|
|
2690
2700
|
]
|
|
2691
2701
|
}
|
|
2692
2702
|
)
|
|
@@ -2708,11 +2718,11 @@ function ni({ filename: e, onExport: t, of: n }) {
|
|
|
2708
2718
|
}
|
|
2709
2719
|
function oi({ pageSizes: e = [10, 25, 50], className: t, of: n }) {
|
|
2710
2720
|
const o = xe(n), r = U(), s = ue();
|
|
2711
|
-
if (
|
|
2712
|
-
const { snapshot: i } = o, a = i.filtered.length, c = e.includes(i.pageSize) ? e : [...e, i.pageSize].sort((h, d) => h - d), u = /* @__PURE__ */
|
|
2721
|
+
if (ot(o == null ? void 0 : o.registry, "pagination"), !o || o.snapshot.virtual) return null;
|
|
2722
|
+
const { snapshot: i } = o, a = i.filtered.length, c = e.includes(i.pageSize) ? e : [...e, i.pageSize].sort((h, d) => h - d), u = /* @__PURE__ */ F("nav", { "aria-label": r.pagination, className: B(f.pagination, t), children: [
|
|
2713
2723
|
/* @__PURE__ */ l("span", { children: r.entries(a, s.count(a)) }),
|
|
2714
|
-
/* @__PURE__ */
|
|
2715
|
-
/* @__PURE__ */
|
|
2724
|
+
/* @__PURE__ */ F("div", { className: f.paginationControls, children: [
|
|
2725
|
+
/* @__PURE__ */ F("label", { className: f.pageSize, children: [
|
|
2716
2726
|
r.rows,
|
|
2717
2727
|
/* @__PURE__ */ l(
|
|
2718
2728
|
on,
|
|
@@ -2732,22 +2742,22 @@ function oi({ pageSizes: e = [10, 25, 50], className: t, of: n }) {
|
|
|
2732
2742
|
] });
|
|
2733
2743
|
return o.inside ? o.footerTarget ? ln(u, o.footerTarget) : null : u;
|
|
2734
2744
|
}
|
|
2735
|
-
const ms = ["high", "medium", "low"],
|
|
2745
|
+
const ms = ["high", "medium", "low"], bs = (e) => ms.indexOf(e), vs = (e) => e === "standing-unacknowledged" || e === "standing-acknowledged", Ve = (e) => e === "standing-acknowledged" || e === "cleared-acknowledged", ws = (e) => e === "cleared-acknowledged";
|
|
2736
2746
|
function _s(e, t) {
|
|
2737
2747
|
switch (t) {
|
|
2738
2748
|
case "raised":
|
|
2739
2749
|
return "standing-unacknowledged";
|
|
2740
2750
|
case "acknowledged":
|
|
2741
|
-
return
|
|
2751
|
+
return vs(e) ? "standing-acknowledged" : "cleared-acknowledged";
|
|
2742
2752
|
case "cleared":
|
|
2743
|
-
return
|
|
2753
|
+
return Ve(e) ? "cleared-acknowledged" : "cleared-unacknowledged";
|
|
2744
2754
|
}
|
|
2745
2755
|
}
|
|
2746
|
-
const ri = (e, t) => e.direction === "obere" ? t <= e.returnTo : t >= e.returnTo,
|
|
2756
|
+
const ri = (e, t) => e.direction === "obere" ? t <= e.returnTo : t >= e.returnTo, rt = (e, t, n) => e > n - t && e <= n, si = (e, t, n) => e.reduce((o, r) => o + (rt(r, t, n) ? 1 : 0), 0);
|
|
2747
2757
|
function ys(e, t, n) {
|
|
2748
2758
|
const o = /* @__PURE__ */ new Map();
|
|
2749
2759
|
for (const r of e)
|
|
2750
|
-
|
|
2760
|
+
rt(r.raised, t, n) && o.set(r.type, (o.get(r.type) ?? 0) + 1);
|
|
2751
2761
|
return o;
|
|
2752
2762
|
}
|
|
2753
2763
|
function ks(e) {
|
|
@@ -2761,7 +2771,7 @@ function Ss(e) {
|
|
|
2761
2771
|
return t;
|
|
2762
2772
|
}
|
|
2763
2773
|
function Cs(e, t, n) {
|
|
2764
|
-
const o = e.filter((s) =>
|
|
2774
|
+
const o = e.filter((s) => rt(s.raised, t.windowMs, n));
|
|
2765
2775
|
if (o.length < t.atLeast) return null;
|
|
2766
2776
|
const r = o.map((s) => s.raised);
|
|
2767
2777
|
return {
|
|
@@ -2776,14 +2786,14 @@ function Cs(e, t, n) {
|
|
|
2776
2786
|
function Ns(e, t) {
|
|
2777
2787
|
const n = new Set(t);
|
|
2778
2788
|
return e.reduce(
|
|
2779
|
-
(o, r) => o + (n.has(r.id) && !
|
|
2789
|
+
(o, r) => o + (n.has(r.id) && !Ve(r.lifecycle) ? 1 : 0),
|
|
2780
2790
|
0
|
|
2781
2791
|
);
|
|
2782
2792
|
}
|
|
2783
2793
|
function ii(e, t, n) {
|
|
2784
2794
|
const o = new Set(t);
|
|
2785
2795
|
let r = 0;
|
|
2786
|
-
return { alarms: e.map((i) => !o.has(i.id) ||
|
|
2796
|
+
return { alarms: e.map((i) => !o.has(i.id) || Ve(i.lifecycle) ? i : (r += 1, { ...i, lifecycle: _s(i.lifecycle, "acknowledged"), acknowledgedAt: n })), count: r };
|
|
2787
2797
|
}
|
|
2788
2798
|
const xs = (e) => [
|
|
2789
2799
|
{
|
|
@@ -2799,7 +2809,7 @@ const xs = (e) => [
|
|
|
2799
2809
|
level of the order asks only about the acknowledgement and expressly not
|
|
2800
2810
|
about whether the alarm is still standing. Otherwise the fleeting alarm
|
|
2801
2811
|
falls back down again. */
|
|
2802
|
-
{ id: "acknowledgement", label: e.columnAcknowledgement, value: (t) =>
|
|
2812
|
+
{ id: "acknowledgement", label: e.columnAcknowledgement, value: (t) => Ve(t.lifecycle) ? 1 : 0 },
|
|
2803
2813
|
{ id: "raised", label: e.columnRaised, value: (t) => t.alarm.raised },
|
|
2804
2814
|
{ id: "age", label: e.columnAge, value: (t) => t.age },
|
|
2805
2815
|
{ id: "frequency", label: e.columnFrequency, value: (t) => t.frequency }
|
|
@@ -2807,7 +2817,7 @@ const xs = (e) => [
|
|
|
2807
2817
|
{ column: "priority", direction: "asc" },
|
|
2808
2818
|
{ column: "acknowledgement", direction: "asc" },
|
|
2809
2819
|
{ column: "raised", direction: "desc" }
|
|
2810
|
-
],
|
|
2820
|
+
], Os = (e) => ({
|
|
2811
2821
|
id: e,
|
|
2812
2822
|
label: e,
|
|
2813
2823
|
priority: "high"
|
|
@@ -2821,48 +2831,48 @@ function ai(e, t = {}) {
|
|
|
2821
2831
|
flood: i,
|
|
2822
2832
|
keepDone: a = !1,
|
|
2823
2833
|
columns: c = As
|
|
2824
|
-
} = e, u = new Map(o.map((
|
|
2825
|
-
const
|
|
2834
|
+
} = e, u = new Map(o.map((g) => [g.id, g])), h = ys(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) ?? []), b = n.filter((g) => a || !ws(g.lifecycle)).map((g) => {
|
|
2835
|
+
const v = u.get(g.type) ?? Os(g.type), p = h.get(g.type) ?? 0;
|
|
2826
2836
|
return {
|
|
2827
|
-
id:
|
|
2828
|
-
alarm:
|
|
2829
|
-
type:
|
|
2830
|
-
lifecycle:
|
|
2831
|
-
priority:
|
|
2832
|
-
rank:
|
|
2833
|
-
age: r -
|
|
2834
|
-
duration: (
|
|
2835
|
-
frequency:
|
|
2836
|
-
chatters: s !== void 0 &&
|
|
2837
|
-
inFlood: m.has(
|
|
2837
|
+
id: g.id,
|
|
2838
|
+
alarm: g,
|
|
2839
|
+
type: v,
|
|
2840
|
+
lifecycle: g.lifecycle,
|
|
2841
|
+
priority: v.priority,
|
|
2842
|
+
rank: bs(v.priority),
|
|
2843
|
+
age: r - g.raised,
|
|
2844
|
+
duration: (g.cleared ?? r) - g.raised,
|
|
2845
|
+
frequency: p,
|
|
2846
|
+
chatters: s !== void 0 && p >= s.atLeast,
|
|
2847
|
+
inFlood: m.has(g.id)
|
|
2838
2848
|
};
|
|
2839
|
-
}),
|
|
2849
|
+
}), w = nt(b, c, {
|
|
2840
2850
|
...t,
|
|
2841
2851
|
sort: t.sort === void 0 ? Ts : t.sort
|
|
2842
2852
|
});
|
|
2843
2853
|
return {
|
|
2844
|
-
...
|
|
2854
|
+
...w,
|
|
2845
2855
|
flood: d,
|
|
2846
|
-
standingUnacknowledged:
|
|
2847
|
-
(
|
|
2856
|
+
standingUnacknowledged: w.filtered.reduce(
|
|
2857
|
+
(g, v) => g + (v.lifecycle === "standing-unacknowledged" ? 1 : 0),
|
|
2848
2858
|
0
|
|
2849
2859
|
)
|
|
2850
2860
|
};
|
|
2851
2861
|
}
|
|
2852
|
-
const
|
|
2853
|
-
list:
|
|
2854
|
-
bar:
|
|
2855
|
-
heading:
|
|
2856
|
-
filler:
|
|
2857
|
-
asOf:
|
|
2858
|
-
live:
|
|
2859
|
-
label:
|
|
2860
|
-
counter:
|
|
2861
|
-
lifecycle:
|
|
2862
|
-
empty:
|
|
2863
|
-
row:
|
|
2862
|
+
const Fs = "_list_17f0w_4 _text_1hv7a_23", qs = "_bar_17f0w_12", Rs = "_heading_17f0w_19", Ls = "_filler_17f0w_25", Ms = "_asOf_17f0w_29", Vs = "_live_17f0w_46", Ds = "_label_17f0w_51", Is = "_counter_17f0w_55", Ps = "_lifecycle_17f0w_59", Bs = "_empty_17f0w_63", Gs = "_row_17f0w_70", oe = {
|
|
2863
|
+
list: Fs,
|
|
2864
|
+
bar: qs,
|
|
2865
|
+
heading: Rs,
|
|
2866
|
+
filler: Ls,
|
|
2867
|
+
asOf: Ms,
|
|
2868
|
+
live: Vs,
|
|
2869
|
+
label: Ds,
|
|
2870
|
+
counter: Is,
|
|
2871
|
+
lifecycle: Ps,
|
|
2872
|
+
empty: Bs,
|
|
2873
|
+
row: Gs
|
|
2864
2874
|
};
|
|
2865
|
-
function
|
|
2875
|
+
function Es(e, t) {
|
|
2866
2876
|
switch (e) {
|
|
2867
2877
|
case "standing-unacknowledged":
|
|
2868
2878
|
return t.lifecycleStandingUnacknowledged;
|
|
@@ -2874,21 +2884,21 @@ function zs(e, t) {
|
|
|
2874
2884
|
return t.lifecycleClearedAcknowledged;
|
|
2875
2885
|
}
|
|
2876
2886
|
}
|
|
2877
|
-
function
|
|
2887
|
+
function zs(e, t) {
|
|
2878
2888
|
return e === "high" ? t.priorityHigh : e === "medium" ? t.priorityMedium : t.priorityLow;
|
|
2879
2889
|
}
|
|
2880
|
-
function
|
|
2890
|
+
function Hs(e) {
|
|
2881
2891
|
return e === "high" ? "danger" : e === "medium" ? "warning" : "neutral";
|
|
2882
2892
|
}
|
|
2883
|
-
function
|
|
2893
|
+
function js(e, t) {
|
|
2884
2894
|
const n = Math.max(0, Math.floor(e / 6e4)), o = Math.floor(n / 60), r = n % 60, s = [];
|
|
2885
2895
|
return o > 0 && s.push(t.hoursShort(o)), (o === 0 || r > 0) && s.push(t.minutesShort(r)), s.join(" ");
|
|
2886
2896
|
}
|
|
2887
2897
|
function li(e) {
|
|
2888
2898
|
const { asOf: t, freshness: n, ...o } = e;
|
|
2889
|
-
return t === void 0 || n === void 0 ? /* @__PURE__ */ l(Ut, { ...o, freshness: null }) : /* @__PURE__ */ l(
|
|
2899
|
+
return t === void 0 || n === void 0 ? /* @__PURE__ */ l(Ut, { ...o, freshness: null }) : /* @__PURE__ */ l($s, { ...o, asOf: t, ages: n });
|
|
2890
2900
|
}
|
|
2891
|
-
function
|
|
2901
|
+
function $s({
|
|
2892
2902
|
asOf: e,
|
|
2893
2903
|
ages: t,
|
|
2894
2904
|
...n
|
|
@@ -2905,46 +2915,46 @@ function Ut({
|
|
|
2905
2915
|
freshness: s,
|
|
2906
2916
|
...i
|
|
2907
2917
|
}) {
|
|
2908
|
-
const a = U(), c = ue(), u = s !== null, h = (s == null ? void 0 : s.freshness) === "lost", { Table: d, Column: m } =
|
|
2909
|
-
return /* @__PURE__ */
|
|
2910
|
-
/* @__PURE__ */
|
|
2918
|
+
const a = U(), c = ue(), u = s !== null, h = (s == null ? void 0 : s.freshness) === "lost", { Table: d, Column: m } = gs(e.visible, { rowKey: (p) => p.id, selection: t }), b = j(() => e.filtered.map((p) => p.alarm), [e.filtered]), w = j(() => t === void 0 ? [] : e.filtered.map((p) => p.id).filter((p) => t.selected.has(p)), [e.filtered, t]), g = j(() => Ns(b, w), [b, w]), v = Ot(o, "compact");
|
|
2919
|
+
return /* @__PURE__ */ F("div", { className: [oe.list, r].filter(Boolean).join(" "), ...i, children: [
|
|
2920
|
+
/* @__PURE__ */ F("div", { className: oe.bar, children: [
|
|
2911
2921
|
/* @__PURE__ */ l("span", { className: oe.heading, children: a.alarms }),
|
|
2912
|
-
e.flood !== null && /* @__PURE__ */ l(
|
|
2913
|
-
u && s !== null && /* @__PURE__ */
|
|
2922
|
+
e.flood !== null && /* @__PURE__ */ l(De, { tone: "warning", children: a.floodHint(e.flood.count) }),
|
|
2923
|
+
u && s !== null && /* @__PURE__ */ F("span", { className: oe.asOf, "data-freshness": s.freshness, children: [
|
|
2914
2924
|
s.freshness === "lost" ? a.freshnessDisconnected : s.freshness === "stale" ? a.freshnessStale : a.freshnessFresh,
|
|
2915
2925
|
s.age !== null && ` · ${c.relative(s.age)}`
|
|
2916
2926
|
] }),
|
|
2917
2927
|
/* @__PURE__ */ l("span", { className: oe.filler }),
|
|
2918
|
-
t !== void 0 && n !== void 0 && /* @__PURE__ */ l(ee, { variant: "primary", size: "sm", disabled:
|
|
2928
|
+
t !== void 0 && n !== void 0 && /* @__PURE__ */ l(ee, { variant: "primary", size: "sm", disabled: g === 0, onClick: () => n(w), children: g === 0 ? a.acknowledgeAlarm : a.acknowledgeAlarms(g) })
|
|
2919
2929
|
] }),
|
|
2920
2930
|
/* @__PURE__ */ l("div", { "aria-live": "polite", "aria-atomic": "true", className: oe.live, children: a.standingUnacknowledged(e.standingUnacknowledged) }),
|
|
2921
|
-
/* @__PURE__ */
|
|
2931
|
+
/* @__PURE__ */ F(
|
|
2922
2932
|
d,
|
|
2923
2933
|
{
|
|
2924
2934
|
ariaLabel: a.alarms,
|
|
2925
2935
|
selectable: t !== void 0,
|
|
2926
|
-
density:
|
|
2936
|
+
density: v,
|
|
2927
2937
|
stickyHeader: !0,
|
|
2928
|
-
rowProps: (
|
|
2938
|
+
rowProps: (p) => ({ className: oe.row, "data-lifecycle": p.lifecycle, "data-priority": p.priority }),
|
|
2929
2939
|
empty: /* @__PURE__ */ l("span", { className: oe.empty, children: h ? a.noAlarmsDisconnected : a.noAlarms }),
|
|
2930
2940
|
children: [
|
|
2931
|
-
/* @__PURE__ */ l(m, { id: "type", label: a.columnAlarm, value: (
|
|
2932
|
-
/* @__PURE__ */ l("span", { className: oe.label, children:
|
|
2933
|
-
|
|
2941
|
+
/* @__PURE__ */ l(m, { id: "type", label: a.columnAlarm, value: (p) => p.type.label, rowHeader: !0, sortable: !1, children: (p, _) => /* @__PURE__ */ F(Q, { children: [
|
|
2942
|
+
/* @__PURE__ */ l("span", { className: oe.label, children: p }),
|
|
2943
|
+
_.chatters && /* @__PURE__ */ l(De, { tone: "warning", pill: !0, className: oe.counter, children: a.chatterHint(_.frequency) })
|
|
2934
2944
|
] }) }),
|
|
2935
|
-
/* @__PURE__ */ l(m, { value: "lifecycle", label: a.columnLifecycleState, sortable: !1, children: (
|
|
2936
|
-
/* @__PURE__ */ l(m, { value: "priority", label: a.columnPriority, sortable: !1, children: (
|
|
2945
|
+
/* @__PURE__ */ l(m, { value: "lifecycle", label: a.columnLifecycleState, sortable: !1, children: (p) => /* @__PURE__ */ l("span", { className: oe.lifecycle, children: Es(p, a) }) }),
|
|
2946
|
+
/* @__PURE__ */ l(m, { value: "priority", label: a.columnPriority, sortable: !1, children: (p) => /* @__PURE__ */ l(De, { tone: Hs(p), children: zs(p, a) }) }),
|
|
2937
2947
|
/* @__PURE__ */ l(
|
|
2938
2948
|
m,
|
|
2939
2949
|
{
|
|
2940
2950
|
id: "raised",
|
|
2941
2951
|
label: a.columnRaised,
|
|
2942
|
-
value: (
|
|
2952
|
+
value: (p) => new Date(p.alarm.raised),
|
|
2943
2953
|
numeric: !0,
|
|
2944
2954
|
sortable: !1
|
|
2945
2955
|
}
|
|
2946
2956
|
),
|
|
2947
|
-
/* @__PURE__ */ l(m, { value: "duration", label: a.columnDuration, sortable: !1, children: (
|
|
2957
|
+
/* @__PURE__ */ l(m, { value: "duration", label: a.columnDuration, sortable: !1, children: (p) => js(p, a) }),
|
|
2948
2958
|
/* @__PURE__ */ l(m, { value: "frequency", label: a.columnFrequency, format: "count", sortable: !1 })
|
|
2949
2959
|
]
|
|
2950
2960
|
}
|
|
@@ -2971,11 +2981,11 @@ export {
|
|
|
2971
2981
|
Cs as detectFlood,
|
|
2972
2982
|
ys as frequencyByType,
|
|
2973
2983
|
ri as hasReturned,
|
|
2974
|
-
|
|
2975
|
-
|
|
2976
|
-
|
|
2984
|
+
Ve as isAcknowledged,
|
|
2985
|
+
ws as isDone,
|
|
2986
|
+
vs as isStanding,
|
|
2977
2987
|
_s as nextLifecycleState,
|
|
2978
|
-
|
|
2979
|
-
|
|
2988
|
+
bs as priorityRank,
|
|
2989
|
+
gs as useTable,
|
|
2980
2990
|
cn as useTableSelection
|
|
2981
2991
|
};
|