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