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