@umriss-ui/table 0.4.0 → 0.5.0
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 +51 -14
- package/README.md +3 -3
- package/dist/index.d.ts +73 -74
- package/dist/table.css +1 -1
- package/dist/table.js +864 -864
- package/docs/llms-full.md +5289 -3730
- package/package.json +5 -5
package/dist/table.js
CHANGED
|
@@ -1,30 +1,30 @@
|
|
|
1
1
|
import "./table.css";
|
|
2
2
|
var An = Object.defineProperty;
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
import { useState as W, useCallback as
|
|
6
|
-
import { DEFAULT_FORMATS as Wt, useVirtual as
|
|
7
|
-
import { jsx as u, jsxs as
|
|
8
|
-
import { createPortal as
|
|
9
|
-
function
|
|
10
|
-
const [t, n] = W(/* @__PURE__ */ new Set()), o =
|
|
3
|
+
var Tn = (e, t, n) => t in e ? An(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
|
4
|
+
var j = (e, t, n) => Tn(e, typeof t != "symbol" ? t + "" : t, n);
|
|
5
|
+
import { useState as W, useCallback as le, useMemo as q, useRef as ce, useId as me, useContext as He, useSyncExternalStore as je, createContext as gt, useLayoutEffect as X, useEffect as jt } from "react";
|
|
6
|
+
import { DEFAULT_FORMATS as Wt, useVirtual as On, useFormats as be, useWording as re, Checkbox as Le, DateRangePicker as Mn, FormField as tt, NumberInput as nt, Popover as pt, Button as fe, TagGroup as qt, Tag as Ut, Menu as Yt, MenuItem as Ke, MenuSeparator as Fn, VisuallyHidden as De, Select as Jt, DatePicker as Ln, Input as Xt, useDensityFor as Qt, AngleGlyph as Dn, assess as Rn, verdictWeight as ot, DEFAULT_WORDING as Pn, Badge as Pe, Tooltip as En, useFreshness as zn } from "@umriss-ui/core";
|
|
7
|
+
import { jsx as u, jsxs as R, Fragment as ne } from "react/jsx-runtime";
|
|
8
|
+
import { createPortal as In } from "react-dom";
|
|
9
|
+
function Vn(e) {
|
|
10
|
+
const [t, n] = W(/* @__PURE__ */ new Set()), o = le((a) => t.has(a), [t]), r = le((a) => {
|
|
11
11
|
n((f) => {
|
|
12
12
|
const d = new Set(f);
|
|
13
|
-
return d.has(
|
|
13
|
+
return d.has(a) ? d.delete(a) : d.add(a), d;
|
|
14
14
|
});
|
|
15
15
|
}, []), s = q(
|
|
16
|
-
() => e.length > 0 && e.every((
|
|
16
|
+
() => e.length > 0 && e.every((a) => t.has(a)),
|
|
17
17
|
[e, t]
|
|
18
18
|
), i = q(
|
|
19
|
-
() => !s && e.some((
|
|
19
|
+
() => !s && e.some((a) => t.has(a)),
|
|
20
20
|
[e, t, s]
|
|
21
|
-
),
|
|
22
|
-
n((
|
|
23
|
-
const f = new Set(
|
|
21
|
+
), l = le(() => {
|
|
22
|
+
n((a) => {
|
|
23
|
+
const f = new Set(a);
|
|
24
24
|
return e.length > 0 && e.every((p) => f.has(p)) ? e.forEach((p) => f.delete(p)) : e.forEach((p) => f.add(p)), f;
|
|
25
25
|
});
|
|
26
|
-
}, [e]), c =
|
|
27
|
-
return { selected: t, isSelected: o, toggle: r, toggleAll:
|
|
26
|
+
}, [e]), c = le(() => n(/* @__PURE__ */ new Set()), []);
|
|
27
|
+
return { selected: t, isSelected: o, toggle: r, toggleAll: l, clear: c, allSelected: s, someSelected: i, count: t.size };
|
|
28
28
|
}
|
|
29
29
|
const Q = (e) => e == null || typeof e == "number" && Number.isNaN(e);
|
|
30
30
|
function We(e) {
|
|
@@ -38,7 +38,7 @@ function Zt(e, t) {
|
|
|
38
38
|
return "empty";
|
|
39
39
|
}
|
|
40
40
|
const mt = (e, t) => t ?? e === "number";
|
|
41
|
-
function
|
|
41
|
+
function Re(e, t, n, o) {
|
|
42
42
|
switch (We(e)) {
|
|
43
43
|
case "text":
|
|
44
44
|
return e;
|
|
@@ -73,7 +73,7 @@ function rt(e, t) {
|
|
|
73
73
|
}
|
|
74
74
|
}
|
|
75
75
|
}
|
|
76
|
-
const
|
|
76
|
+
const Bn = "ja", Gn = "nein";
|
|
77
77
|
function en(e, t) {
|
|
78
78
|
if (!Q(e)) {
|
|
79
79
|
if (t) return en(t(e));
|
|
@@ -85,7 +85,7 @@ function en(e, t) {
|
|
|
85
85
|
case "date":
|
|
86
86
|
return e.toISOString();
|
|
87
87
|
case "boolean":
|
|
88
|
-
return e ?
|
|
88
|
+
return e ? Bn : Gn;
|
|
89
89
|
default:
|
|
90
90
|
return;
|
|
91
91
|
}
|
|
@@ -99,37 +99,37 @@ function vt(e, t) {
|
|
|
99
99
|
if (o === "distinct") return new Set(n.map(Se)).size;
|
|
100
100
|
const r = n.filter((c) => At(c) !== void 0);
|
|
101
101
|
if (r.length === 0) return;
|
|
102
|
-
const s = r.map((c) => At(c)), i = r[0] instanceof Date,
|
|
102
|
+
const s = r.map((c) => At(c)), i = r[0] instanceof Date, l = (c) => i ? new Date(c) : c;
|
|
103
103
|
switch (o) {
|
|
104
104
|
case "sum":
|
|
105
|
-
return s.reduce((c,
|
|
105
|
+
return s.reduce((c, a) => c + a, 0);
|
|
106
106
|
case "avg":
|
|
107
|
-
return s.reduce((c,
|
|
107
|
+
return s.reduce((c, a) => c + a, 0) / s.length;
|
|
108
108
|
case "min":
|
|
109
|
-
return
|
|
109
|
+
return l(Math.min(...s));
|
|
110
110
|
case "max":
|
|
111
|
-
return
|
|
111
|
+
return l(Math.max(...s));
|
|
112
112
|
case "range":
|
|
113
|
-
return [
|
|
113
|
+
return [l(Math.min(...s)), l(Math.max(...s))];
|
|
114
114
|
}
|
|
115
115
|
}
|
|
116
|
-
const wt = 3,
|
|
116
|
+
const wt = 3, Ie = (e) => {
|
|
117
117
|
if (!Q(e))
|
|
118
118
|
return e instanceof Date ? e.getTime() : typeof e == "boolean" ? e ? 1 : 0 : typeof e == "number" ? e : String(e);
|
|
119
119
|
};
|
|
120
120
|
function Xe(e, t, n) {
|
|
121
|
-
const o =
|
|
121
|
+
const o = Ie(e), r = Ie(t);
|
|
122
122
|
return o === void 0 || r === void 0 ? o === r ? 0 : o === void 0 ? 1 : -1 : typeof o == "number" && typeof r == "number" ? o - r : n(String(o), String(r));
|
|
123
123
|
}
|
|
124
124
|
function $n(e, t) {
|
|
125
125
|
const n = t.compareText ?? Wt.compareText, o = (r, s, i) => {
|
|
126
|
-
var
|
|
127
|
-
const
|
|
126
|
+
var O;
|
|
127
|
+
const l = /* @__PURE__ */ new Map(), c = t.levels[s];
|
|
128
128
|
if (!c) return [];
|
|
129
|
-
const
|
|
129
|
+
const a = /* @__PURE__ */ new Map();
|
|
130
130
|
for (const w of r) {
|
|
131
131
|
const _ = c.value(w), F = Se(_);
|
|
132
|
-
let g =
|
|
132
|
+
let g = a.get(F);
|
|
133
133
|
g || (g = {
|
|
134
134
|
path: JSON.stringify([...i, F]),
|
|
135
135
|
value: Q(_) ? void 0 : _,
|
|
@@ -137,11 +137,11 @@ function $n(e, t) {
|
|
|
137
137
|
rows: [],
|
|
138
138
|
groups: [],
|
|
139
139
|
aggregates: {}
|
|
140
|
-
},
|
|
140
|
+
}, a.set(F, g), l.set(g, [...i, F])), g.rows.push(w);
|
|
141
141
|
}
|
|
142
|
-
for (const w of
|
|
142
|
+
for (const w of a.values())
|
|
143
143
|
for (const _ of t.aggregates ?? []) w.aggregates[_.id] = vt(_, w.rows);
|
|
144
|
-
const f = (
|
|
144
|
+
const f = (O = t.sort) == null ? void 0 : O.find(
|
|
145
145
|
(w) => {
|
|
146
146
|
var _;
|
|
147
147
|
return w.column === c.id || ((_ = t.aggregates) == null ? void 0 : _.some((F) => F.id === w.column));
|
|
@@ -150,37 +150,37 @@ function $n(e, t) {
|
|
|
150
150
|
let _;
|
|
151
151
|
for (const F of w.rows) {
|
|
152
152
|
const g = c.order(F);
|
|
153
|
-
|
|
153
|
+
Ie(g) !== void 0 && (_ === void 0 || Xe(g, _, n) < 0) && (_ = g);
|
|
154
154
|
}
|
|
155
155
|
return _;
|
|
156
156
|
}, S = (w) => {
|
|
157
157
|
if (p === void 0) return c.order ? b(w) : w.value;
|
|
158
158
|
const _ = w.aggregates[p];
|
|
159
159
|
return Array.isArray(_) ? _[0] : _;
|
|
160
|
-
}, v = [...
|
|
160
|
+
}, v = [...a.values()].sort((w, _) => {
|
|
161
161
|
if (w.value === void 0 || _.value === void 0) return Xe(w.value, _.value, n);
|
|
162
162
|
const F = S(w), g = S(_), C = Xe(F, g, n);
|
|
163
|
-
return
|
|
163
|
+
return Ie(F) === void 0 || Ie(g) === void 0 ? C : C * d;
|
|
164
164
|
});
|
|
165
165
|
for (const w of v)
|
|
166
|
-
w.groups = o(w.rows, s + 1,
|
|
166
|
+
w.groups = o(w.rows, s + 1, l.get(w));
|
|
167
167
|
return v;
|
|
168
168
|
};
|
|
169
169
|
return o(e, 0, []);
|
|
170
170
|
}
|
|
171
|
-
function
|
|
171
|
+
function Kn(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 Hn = (e) => (t) => {
|
|
179
179
|
if (!(t instanceof Date) || Number.isNaN(t.getTime())) return;
|
|
180
180
|
const n = t.getFullYear(), o = t.getMonth(), r = t.getDate();
|
|
181
181
|
return e === "year" ? new Date(n, 0, 1) : e === "month" ? new Date(n, o, 1) : e === "week" ? new Date(n, o, r - (t.getDay() + 6) % 7) : new Date(n, o, r);
|
|
182
182
|
};
|
|
183
|
-
function
|
|
183
|
+
function jn(e) {
|
|
184
184
|
const t = new Date(e.getFullYear(), e.getMonth(), e.getDate() + 3 - (e.getDay() + 6) % 7), n = new Date(t.getFullYear(), 0, 4);
|
|
185
185
|
return { week: 1 + Math.round((t.getTime() - n.getTime()) / 864e5 / 7 - ((n.getDay() + 6) % 7 - 3) / 7), year: t.getFullYear() };
|
|
186
186
|
}
|
|
@@ -188,7 +188,7 @@ function Wn(e, t, n, o) {
|
|
|
188
188
|
if (e === "year") return String(t.getFullYear());
|
|
189
189
|
if (e === "month") return n.month(t);
|
|
190
190
|
if (e === "week") {
|
|
191
|
-
const { week: r, year: s } =
|
|
191
|
+
const { week: r, year: s } = jn(t);
|
|
192
192
|
return o.calendarWeek(r, s);
|
|
193
193
|
}
|
|
194
194
|
return n.date(t);
|
|
@@ -196,11 +196,11 @@ function Wn(e, t, n, o) {
|
|
|
196
196
|
function qn(e, t) {
|
|
197
197
|
const n = [], o = (r, s) => {
|
|
198
198
|
for (const i of r) {
|
|
199
|
-
const
|
|
199
|
+
const l = t.has(i.path);
|
|
200
200
|
if (i.groups.length === 0 && i.level === 0) {
|
|
201
|
-
if (n.push({ kind: "header", group: i, parents: s, continued: !1 }), !
|
|
201
|
+
if (n.push({ kind: "header", group: i, parents: s, continued: !1 }), !l)
|
|
202
202
|
for (const c of i.rows) n.push({ kind: "row", row: c, parents: [i], span: void 0, first: !1, continued: !1 });
|
|
203
|
-
} else i.groups.length > 0 ? (n.push({ kind: "header", group: i, parents: s, continued: !1 }),
|
|
203
|
+
} else i.groups.length > 0 ? (n.push({ kind: "header", group: i, parents: s, continued: !1 }), l || o(i.groups, [...s, i])) : l ? n.push({ kind: "folded", group: i, parents: s }) : i.rows.forEach((c, a) => n.push({ kind: "row", row: c, parents: s, span: i, first: a === 0, continued: !1 }));
|
|
204
204
|
}
|
|
205
205
|
};
|
|
206
206
|
return o(e, []), n;
|
|
@@ -235,17 +235,17 @@ function kt(e, t, n) {
|
|
|
235
235
|
filter: r,
|
|
236
236
|
sort: s = null,
|
|
237
237
|
page: i = 1,
|
|
238
|
-
pageSize:
|
|
238
|
+
pageSize: l,
|
|
239
239
|
hidden: c,
|
|
240
|
-
order:
|
|
241
|
-
} = n, f = _t(t,
|
|
240
|
+
order: a
|
|
241
|
+
} = n, f = _t(t, a), d = c != null && c.length ? f.filter((L) => L.hideable === !1 || !c.includes(L.id)) : f;
|
|
242
242
|
if (n.manual) {
|
|
243
|
-
const { rowCount: L } = n.manual, m =
|
|
243
|
+
const { rowCount: L } = n.manual, m = l && l > 0 ? l : Math.max(L, 1), k = Math.max(1, Math.ceil(L / m)), T = L > 0 ? Math.min(Math.max(1, i), k) : Math.max(1, i);
|
|
244
244
|
return {
|
|
245
245
|
columns: d,
|
|
246
246
|
filtered: [...e],
|
|
247
247
|
visible: [...e],
|
|
248
|
-
page:
|
|
248
|
+
page: T,
|
|
249
249
|
pageCount: k,
|
|
250
250
|
columnCount: d.length
|
|
251
251
|
};
|
|
@@ -253,36 +253,36 @@ function kt(e, t, n) {
|
|
|
253
253
|
const p = o.trim().toLowerCase(), b = t.filter((L) => L.searchable && L.value), S = (L) => !p || b.some((m) => {
|
|
254
254
|
const k = m.value(L);
|
|
255
255
|
return !Me(k) && String(k).toLowerCase().includes(p);
|
|
256
|
-
}), v = e.filter((L) => S(L) && (r ? r(L) : !0)),
|
|
256
|
+
}), v = e.filter((L) => S(L) && (r ? r(L) : !0)), O = Array.isArray(s) ? s : s ? [s] : [], w = O.map((L) => {
|
|
257
257
|
const m = t.find((M) => M.id === L.column);
|
|
258
258
|
if (!m || !m.compare && !m.value) return null;
|
|
259
|
-
const k = L.direction === "asc" ? 1 : -1,
|
|
259
|
+
const k = L.direction === "asc" ? 1 : -1, T = m.compare, y = m.value;
|
|
260
260
|
return y ? (M, N) => {
|
|
261
|
-
const
|
|
262
|
-
return Me(
|
|
263
|
-
} : (M, N) =>
|
|
261
|
+
const I = y(M), P = y(N);
|
|
262
|
+
return Me(I) || Me(P) ? Me(I) === Me(P) ? 0 : Me(I) ? 1 : -1 : (T ? T(M, N) : Yn(I, P)) * k;
|
|
263
|
+
} : (M, N) => T(M, N) * k;
|
|
264
264
|
}).filter((L) => L !== null);
|
|
265
265
|
if (w.length > 0 && v.sort((L, m) => {
|
|
266
266
|
for (const k of w) {
|
|
267
|
-
const
|
|
268
|
-
if (
|
|
267
|
+
const T = k(L, m);
|
|
268
|
+
if (T !== 0) return T;
|
|
269
269
|
}
|
|
270
270
|
return 0;
|
|
271
271
|
}), (A = n.grouping) != null && A.levels.length) {
|
|
272
|
-
const { folded: L, ...m } = n.grouping, k = $n(v, { ...m, sort:
|
|
272
|
+
const { folded: L, ...m } = n.grouping, k = $n(v, { ...m, sort: O }), T = qn(k, L), y = Un(T, i, l ?? 0);
|
|
273
273
|
return {
|
|
274
274
|
columns: d,
|
|
275
275
|
filtered: v,
|
|
276
276
|
visible: yt(y.lines),
|
|
277
277
|
groups: k,
|
|
278
|
-
lines:
|
|
278
|
+
lines: T,
|
|
279
279
|
visibleLines: y.lines,
|
|
280
280
|
page: y.page,
|
|
281
281
|
pageCount: y.pageCount,
|
|
282
282
|
columnCount: d.length
|
|
283
283
|
};
|
|
284
284
|
}
|
|
285
|
-
const _ =
|
|
285
|
+
const _ = l && l > 0 ? l : v.length || 1, F = Math.max(1, Math.ceil(v.length / _)), g = Math.min(Math.max(1, i), F), C = v.slice((g - 1) * _, g * _);
|
|
286
286
|
return {
|
|
287
287
|
columns: d,
|
|
288
288
|
filtered: v,
|
|
@@ -293,10 +293,10 @@ function kt(e, t, n) {
|
|
|
293
293
|
};
|
|
294
294
|
}
|
|
295
295
|
function Jn(e, t, n) {
|
|
296
|
-
const { rowKey: o, filter: r, defaultSort: s = null, initialView: i, virtual:
|
|
296
|
+
const { rowKey: o, filter: r, defaultSort: s = null, initialView: i, virtual: l, grouping: c, manual: a } = n, [f, d] = W((i == null ? void 0 : i.search) ?? ""), [p, b] = W(() => {
|
|
297
297
|
var D;
|
|
298
298
|
return (D = i == null ? void 0 : i.sort) != null && D.length ? [...i.sort] : s ? Array.isArray(s) ? [...s] : [s] : [];
|
|
299
|
-
}), [S, v] = W((i == null ? void 0 : i.page) ?? 1), [
|
|
299
|
+
}), [S, v] = W((i == null ? void 0 : i.page) ?? 1), [O, w] = W(
|
|
300
300
|
(i == null ? void 0 : i.pageSize) ?? n.pageSize ?? 10
|
|
301
301
|
), [_, F] = W([]), [g, C] = W((i == null ? void 0 : i.hidden) ?? []), [A, L] = W((i == null ? void 0 : i.order) ?? []), [m, k] = W(() => {
|
|
302
302
|
if (i != null && i.widths) return { ...i.widths };
|
|
@@ -304,73 +304,73 @@ function Jn(e, t, n) {
|
|
|
304
304
|
for (const G of t)
|
|
305
305
|
G.width !== void 0 && (D[G.id] = G.width);
|
|
306
306
|
return D;
|
|
307
|
-
}),
|
|
307
|
+
}), T = l ? 0 : O, y = q(
|
|
308
308
|
() => kt(e, t, {
|
|
309
309
|
search: f,
|
|
310
310
|
filter: r,
|
|
311
311
|
sort: p,
|
|
312
312
|
page: S,
|
|
313
|
-
pageSize:
|
|
313
|
+
pageSize: T,
|
|
314
314
|
hidden: g,
|
|
315
315
|
order: A,
|
|
316
316
|
grouping: c,
|
|
317
|
-
manual:
|
|
317
|
+
manual: a
|
|
318
318
|
}),
|
|
319
|
-
[e, t, f, r, p, S,
|
|
320
|
-
), M =
|
|
321
|
-
rowHeight: (
|
|
322
|
-
overscan:
|
|
319
|
+
[e, t, f, r, p, S, T, g, A, c, a]
|
|
320
|
+
), M = On(l ? (y.lines ?? y.filtered).length : 0, {
|
|
321
|
+
rowHeight: (l == null ? void 0 : l.rowHeight) ?? 0,
|
|
322
|
+
overscan: l == null ? void 0 : l.overscan
|
|
323
323
|
}), N = q(
|
|
324
|
-
() =>
|
|
325
|
-
[
|
|
326
|
-
),
|
|
327
|
-
() =>
|
|
328
|
-
[
|
|
329
|
-
),
|
|
324
|
+
() => l && y.lines ? y.lines.slice(M.from, M.to) : y.visibleLines,
|
|
325
|
+
[l, y.lines, y.visibleLines, M.from, M.to]
|
|
326
|
+
), I = q(
|
|
327
|
+
() => l ? N ? yt(N) : y.filtered.slice(M.from, M.to) : y.visible,
|
|
328
|
+
[l, N, y.filtered, y.visible, M.from, M.to]
|
|
329
|
+
), P = q(() => y.filtered.map(o), [y.filtered, o]), $ = Vn(P), U = le((D) => {
|
|
330
330
|
d(D), v(1);
|
|
331
|
-
}, []), Z =
|
|
331
|
+
}, []), Z = le((D) => {
|
|
332
332
|
w(D), v(1);
|
|
333
|
-
}, []), he =
|
|
334
|
-
b((
|
|
335
|
-
const x =
|
|
333
|
+
}, []), he = le((D, G = !1) => {
|
|
334
|
+
b((H) => {
|
|
335
|
+
const x = H.find((E) => E.column === D);
|
|
336
336
|
if (!G) {
|
|
337
|
-
const E =
|
|
337
|
+
const E = H.length === 1 && (x == null ? void 0 : x.direction) === "asc" ? "desc" : "asc";
|
|
338
338
|
return [{ column: D, direction: E }];
|
|
339
339
|
}
|
|
340
|
-
return x ? x.direction === "asc" ?
|
|
340
|
+
return x ? x.direction === "asc" ? H.map(
|
|
341
341
|
(E) => E.column === D ? { column: D, direction: "desc" } : E
|
|
342
|
-
) :
|
|
342
|
+
) : H.filter((E) => E.column !== D) : [...H, { column: D, direction: "asc" }];
|
|
343
343
|
}), v(1);
|
|
344
|
-
}, []), se =
|
|
344
|
+
}, []), se = le((D) => {
|
|
345
345
|
F(
|
|
346
|
-
(G) => G.includes(D) ? G.filter((
|
|
346
|
+
(G) => G.includes(D) ? G.filter((H) => H !== D) : [...G, D]
|
|
347
347
|
);
|
|
348
|
-
}, []), we =
|
|
348
|
+
}, []), we = le(
|
|
349
349
|
(D) => _.includes(D),
|
|
350
350
|
[_]
|
|
351
|
-
), Ce =
|
|
351
|
+
), Ce = le((D) => {
|
|
352
352
|
C(
|
|
353
|
-
(G) => G.includes(D) ? G.filter((
|
|
353
|
+
(G) => G.includes(D) ? G.filter((H) => H !== D) : [...G, D]
|
|
354
354
|
);
|
|
355
|
-
}, []),
|
|
356
|
-
k((
|
|
355
|
+
}, []), Oe = le((D, G) => {
|
|
356
|
+
k((H) => {
|
|
357
357
|
if (G === void 0) {
|
|
358
|
-
if (!(D in
|
|
359
|
-
const x = { ...
|
|
358
|
+
if (!(D in H)) return H;
|
|
359
|
+
const x = { ...H };
|
|
360
360
|
return delete x[D], x;
|
|
361
361
|
}
|
|
362
|
-
return { ...
|
|
362
|
+
return { ...H, [D]: G };
|
|
363
363
|
});
|
|
364
|
-
}, []), xe =
|
|
364
|
+
}, []), xe = le(
|
|
365
365
|
(D) => {
|
|
366
366
|
var G;
|
|
367
|
-
return (G = p.find((
|
|
367
|
+
return (G = p.find((H) => H.column === D)) == null ? void 0 : G.direction;
|
|
368
368
|
},
|
|
369
369
|
[p]
|
|
370
|
-
), ue =
|
|
370
|
+
), ue = le(
|
|
371
371
|
(D) => {
|
|
372
372
|
if (p.length < 2) return;
|
|
373
|
-
const G = p.findIndex((
|
|
373
|
+
const G = p.findIndex((H) => H.column === D);
|
|
374
374
|
return G === -1 ? void 0 : G + 1;
|
|
375
375
|
},
|
|
376
376
|
[p]
|
|
@@ -384,16 +384,16 @@ function Jn(e, t, n) {
|
|
|
384
384
|
return D;
|
|
385
385
|
}, [t]), Ne = q(() => {
|
|
386
386
|
const D = {};
|
|
387
|
-
for (const [G,
|
|
388
|
-
ye[G] !==
|
|
387
|
+
for (const [G, H] of Object.entries(m))
|
|
388
|
+
ye[G] !== H && (D[G] = H);
|
|
389
389
|
return D;
|
|
390
390
|
}, [m, ye]), _e = q(
|
|
391
391
|
() => s ? Array.isArray(s) ? s : [s] : [],
|
|
392
392
|
[s]
|
|
393
393
|
), ke = p.length === _e.length && p.every(
|
|
394
394
|
(D, G) => {
|
|
395
|
-
var
|
|
396
|
-
return D.column === ((
|
|
395
|
+
var H, x;
|
|
396
|
+
return D.column === ((H = _e[G]) == null ? void 0 : H.column) && D.direction === ((x = _e[G]) == null ? void 0 : x.direction);
|
|
397
397
|
}
|
|
398
398
|
), J = q(
|
|
399
399
|
() => ({
|
|
@@ -402,19 +402,19 @@ function Jn(e, t, n) {
|
|
|
402
402
|
/* Without paging there is no page a view could carry - a page three in
|
|
403
403
|
the view of a virtualised table would be a promise nobody redeems on
|
|
404
404
|
opening. */
|
|
405
|
-
...!
|
|
406
|
-
...!
|
|
405
|
+
...!l && y.page > 1 ? { page: y.page } : {},
|
|
406
|
+
...!l && O !== ge ? { pageSize: O } : {},
|
|
407
407
|
...g.length ? { hidden: g } : {},
|
|
408
408
|
...A.length ? { order: A } : {},
|
|
409
409
|
...Object.keys(Ne).length ? { widths: Ne } : {}
|
|
410
410
|
}),
|
|
411
411
|
[
|
|
412
|
-
|
|
412
|
+
l,
|
|
413
413
|
f,
|
|
414
414
|
p,
|
|
415
415
|
ke,
|
|
416
416
|
y.page,
|
|
417
|
-
|
|
417
|
+
O,
|
|
418
418
|
ge,
|
|
419
419
|
g,
|
|
420
420
|
A,
|
|
@@ -423,10 +423,10 @@ function Jn(e, t, n) {
|
|
|
423
423
|
);
|
|
424
424
|
return {
|
|
425
425
|
...y,
|
|
426
|
-
visible:
|
|
426
|
+
visible: I,
|
|
427
427
|
visibleLines: N,
|
|
428
|
-
virtual:
|
|
429
|
-
manual:
|
|
428
|
+
virtual: l ? M : void 0,
|
|
429
|
+
manual: a,
|
|
430
430
|
view: J,
|
|
431
431
|
search: f,
|
|
432
432
|
setSearch: U,
|
|
@@ -435,7 +435,7 @@ function Jn(e, t, n) {
|
|
|
435
435
|
sortDirectionOf: xe,
|
|
436
436
|
sortRankOf: ue,
|
|
437
437
|
setPage: v,
|
|
438
|
-
pageSize:
|
|
438
|
+
pageSize: O,
|
|
439
439
|
setPageSize: Z,
|
|
440
440
|
expanded: _,
|
|
441
441
|
toggleRow: se,
|
|
@@ -446,7 +446,7 @@ function Jn(e, t, n) {
|
|
|
446
446
|
order: A,
|
|
447
447
|
setOrder: L,
|
|
448
448
|
widths: m,
|
|
449
|
-
setWidth:
|
|
449
|
+
setWidth: Oe,
|
|
450
450
|
selection: $
|
|
451
451
|
};
|
|
452
452
|
}
|
|
@@ -483,15 +483,15 @@ function ro() {
|
|
|
483
483
|
const e = import.meta;
|
|
484
484
|
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;
|
|
485
485
|
}
|
|
486
|
-
const nn = ro(),
|
|
487
|
-
function
|
|
488
|
-
!nn ||
|
|
486
|
+
const nn = ro(), Tt = /* @__PURE__ */ new Set();
|
|
487
|
+
function ae(e, t) {
|
|
488
|
+
!nn || Tt.has(e) || (Tt.add(e), console.warn(`@umriss-ui/table: ${t}`));
|
|
489
489
|
}
|
|
490
|
-
const so = "_frame_1eual_11 _text_k1tvc_23", io = "_children_1eual_24",
|
|
490
|
+
const so = "_frame_1eual_11 _text_k1tvc_23", io = "_children_1eual_24", lo = "_scroll_1eual_33 _scroll_k1tvc_40", ao = "_footerTarget_1eual_41", co = "_table_1eual_45", uo = "_th_1eual_53 _ring_k1tvc_69", fo = "_sticky_1eual_68", ho = "_td_1eual_76", go = "_rowHeader_1eual_88", po = "_compact_1eual_104", mo = "_numeric_1eual_137", bo = "_absent_1eual_149", vo = "_striped_1eual_153", wo = "_pinned_1eual_180", yo = "_pinStartEdge_1eual_196", _o = "_pinEndEdge_1eual_197", ko = "_sortButton_1eual_227 _ring_k1tvc_69", So = "_sortIndicator_1eual_252", Co = "_sortArrow_1eual_259", xo = "_sortArrowDesc_1eual_263", No = "_sortActive_1eual_271", Ao = "_sortRank_1eual_277", To = "_thFlex_1eual_285", Oo = "_footerKind_1eual_310", Mo = "_emptyCell_1eual_318", Fo = "_empty_1eual_318", Lo = "_emptyTitle_1eual_334", Do = "_skeleton_1eual_343", Ro = "_toolbar_1eual_375 _text_k1tvc_23", Po = "_toolbarGroup_1eual_389", Eo = "_toolbarInfo_1eual_406", zo = "_pagination_1eual_412 _text_k1tvc_23", Io = "_paginationControls_1eual_425", Vo = "_pageSize_1eual_432", Bo = "_paginationStatus_1eual_444", Go = "_filterButton_1eual_453 _ring_k1tvc_69", $o = "_filterActive_1eual_480", Ko = "_filterPanel_1eual_485", Ho = "_filterContent_1eual_499 _scroll_k1tvc_40", jo = "_filterFooter_1eual_510", Wo = "_filterLabel_1eual_524", qo = "_filterValue_1eual_534", Uo = "_filteredCount_1eual_540", Yo = "_rangeFields_1eual_551", Jo = "_rangePeriod_1eual_561", Xo = "_conditions_1eual_567", Qo = "_conditionButton_1eual_573", Zo = "_condition_1eual_567", er = "_columnsPanel_1eual_598", tr = "_columnsList_1eual_607", nr = "_columnsEntry_1eual_616", or = "_move_1eual_628", rr = "_pinOn_1eual_666", sr = "_groupingChoice_1eual_673", ir = "_groupingHeading_1eual_679", lr = "_groupingOptions_1eual_688", ar = "_groupingOption_1eual_688 _ring_k1tvc_69", cr = "_groupingLevel_1eual_731", ur = "_groupingTag_1eual_736", dr = "_groupingTrigger_1eual_743", fr = "_groupingPrefix_1eual_749", hr = "_groupingPath_1eual_754", gr = "_groupingSeparator_1eual_758", pr = "_groupHeader_1eual_775", mr = "_spanCell_1eual_816", br = "_groupFolded_1eual_894", vr = "_spanValue_1eual_898", wr = "_groupLabel_1eual_899", yr = "_spanText_1eual_911", _r = "_groupValue_1eual_912", kr = "_groupCount_1eual_919", Sr = "_continued_1eual_933", Cr = "_spanSelect_1eual_964", xr = "_fold_1eual_978", Nr = "_foldClosed_1eual_1014", Ar = "_foldedCount_1eual_1024", Tr = "_shareHost_1eual_1032", Or = "_shareBar_1eual_1039", Mr = "_expander_1eual_1051", Fr = "_expanderOpen_1eual_1086", Lr = "_detailRow_1eual_1090", Dr = "_detailCell_1eual_1090", Rr = "_actionsCell_1eual_1098", Pr = "_actions_1eual_1098", Er = "_grip_1eual_1126", zr = "_virtualBody_1eual_1167", Ir = "_virtualRow_1eual_1183", Vr = "_fillerRow_1eual_1207", Br = "_grid_1eual_1220", Gr = "_editing_1eual_1236", $r = "_editingValue_1eual_1240", Kr = "_editor_1eual_1244", Hr = "_editorField_1eual_1255", jr = "_editorMessage_1eual_1273", Wr = "_control_1eual_168", h = {
|
|
491
491
|
frame: so,
|
|
492
492
|
children: io,
|
|
493
|
-
scroll:
|
|
494
|
-
footerTarget:
|
|
493
|
+
scroll: lo,
|
|
494
|
+
footerTarget: ao,
|
|
495
495
|
table: co,
|
|
496
496
|
th: uo,
|
|
497
497
|
sticky: fo,
|
|
@@ -510,24 +510,24 @@ const so = "_frame_1eual_11 _text_k1tvc_23", io = "_children_1eual_24", ao = "_s
|
|
|
510
510
|
sortArrowDesc: xo,
|
|
511
511
|
sortActive: No,
|
|
512
512
|
sortRank: Ao,
|
|
513
|
-
thFlex:
|
|
514
|
-
footerKind:
|
|
513
|
+
thFlex: To,
|
|
514
|
+
footerKind: Oo,
|
|
515
515
|
emptyCell: Mo,
|
|
516
516
|
empty: Fo,
|
|
517
517
|
emptyTitle: Lo,
|
|
518
518
|
skeleton: Do,
|
|
519
|
-
toolbar:
|
|
520
|
-
toolbarGroup:
|
|
519
|
+
toolbar: Ro,
|
|
520
|
+
toolbarGroup: Po,
|
|
521
521
|
toolbarInfo: Eo,
|
|
522
|
-
pagination:
|
|
523
|
-
paginationControls:
|
|
524
|
-
pageSize:
|
|
525
|
-
paginationStatus:
|
|
522
|
+
pagination: zo,
|
|
523
|
+
paginationControls: Io,
|
|
524
|
+
pageSize: Vo,
|
|
525
|
+
paginationStatus: Bo,
|
|
526
526
|
filterButton: Go,
|
|
527
527
|
filterActive: $o,
|
|
528
|
-
filterPanel:
|
|
529
|
-
filterContent:
|
|
530
|
-
filterFooter:
|
|
528
|
+
filterPanel: Ko,
|
|
529
|
+
filterContent: Ho,
|
|
530
|
+
filterFooter: jo,
|
|
531
531
|
filterLabel: Wo,
|
|
532
532
|
filterValue: qo,
|
|
533
533
|
filteredCount: Uo,
|
|
@@ -543,8 +543,8 @@ const so = "_frame_1eual_11 _text_k1tvc_23", io = "_children_1eual_24", ao = "_s
|
|
|
543
543
|
pinOn: rr,
|
|
544
544
|
groupingChoice: sr,
|
|
545
545
|
groupingHeading: ir,
|
|
546
|
-
groupingOptions:
|
|
547
|
-
groupingOption:
|
|
546
|
+
groupingOptions: lr,
|
|
547
|
+
groupingOption: ar,
|
|
548
548
|
groupingLevel: cr,
|
|
549
549
|
groupingTag: ur,
|
|
550
550
|
groupingTrigger: dr,
|
|
@@ -564,65 +564,65 @@ const so = "_frame_1eual_11 _text_k1tvc_23", io = "_children_1eual_24", ao = "_s
|
|
|
564
564
|
fold: xr,
|
|
565
565
|
foldClosed: Nr,
|
|
566
566
|
foldedCount: Ar,
|
|
567
|
-
shareHost:
|
|
568
|
-
shareBar:
|
|
567
|
+
shareHost: Tr,
|
|
568
|
+
shareBar: Or,
|
|
569
569
|
expander: Mr,
|
|
570
570
|
expanderOpen: Fr,
|
|
571
571
|
detailRow: Lr,
|
|
572
572
|
detailCell: Dr,
|
|
573
|
-
actionsCell:
|
|
574
|
-
actions:
|
|
573
|
+
actionsCell: Rr,
|
|
574
|
+
actions: Pr,
|
|
575
575
|
grip: Er,
|
|
576
|
-
virtualBody:
|
|
577
|
-
virtualRow:
|
|
578
|
-
fillerRow:
|
|
579
|
-
grid:
|
|
576
|
+
virtualBody: zr,
|
|
577
|
+
virtualRow: Ir,
|
|
578
|
+
fillerRow: Vr,
|
|
579
|
+
grid: Br,
|
|
580
580
|
editing: Gr,
|
|
581
581
|
editingValue: $r,
|
|
582
|
-
editor:
|
|
583
|
-
editorField:
|
|
584
|
-
editorMessage:
|
|
582
|
+
editor: Kr,
|
|
583
|
+
editorField: Hr,
|
|
584
|
+
editorMessage: jr,
|
|
585
585
|
control: Wr
|
|
586
586
|
};
|
|
587
|
-
function
|
|
587
|
+
function dl(e) {
|
|
588
588
|
return e;
|
|
589
589
|
}
|
|
590
|
-
const
|
|
590
|
+
const Ve = /* @__PURE__ */ new WeakMap();
|
|
591
591
|
function on(e, t) {
|
|
592
|
-
return
|
|
592
|
+
return Ve.set(e, t), e;
|
|
593
593
|
}
|
|
594
|
-
const qr = (e) =>
|
|
595
|
-
function
|
|
594
|
+
const qr = (e) => Ve.has(e);
|
|
595
|
+
function Te(e) {
|
|
596
596
|
return e === "list" ? Xr : e === "range" ? ss : typeof e == "object" && e !== null ? e : void 0;
|
|
597
597
|
}
|
|
598
598
|
function rn(e, t) {
|
|
599
599
|
if (t == null) return "empty";
|
|
600
|
-
const n =
|
|
600
|
+
const n = Ve.get(e);
|
|
601
601
|
return n ? n.isCondition(t) ? n.isEmpty(t) ? "empty" : "effective" : "foreign" : "effective";
|
|
602
602
|
}
|
|
603
603
|
function Ur(e, t, n) {
|
|
604
604
|
var o;
|
|
605
|
-
return Q(t) ? ((o =
|
|
605
|
+
return Q(t) ? ((o = Ve.get(e)) == null ? void 0 : o.absentMatches(n)) ?? !1 : e.matches(t, n);
|
|
606
606
|
}
|
|
607
607
|
function Yr(e, t, n) {
|
|
608
|
-
const o =
|
|
608
|
+
const o = Ve.get(e);
|
|
609
609
|
return o ? o.describeIn(t, n) : e.describe(t);
|
|
610
610
|
}
|
|
611
|
-
const
|
|
612
|
-
const o =
|
|
611
|
+
const Ot = (e) => e instanceof Date ? e.getTime() : typeof e == "number" ? e : void 0, sn = (e) => (t, n) => {
|
|
612
|
+
const o = Ot(t.value), r = Ot(n.value);
|
|
613
613
|
return o !== void 0 && r !== void 0 ? o - r : e.compareText(t.text, n.text);
|
|
614
614
|
};
|
|
615
615
|
function st(e, t, n) {
|
|
616
616
|
const o = /* @__PURE__ */ new Map();
|
|
617
617
|
let r = !1;
|
|
618
618
|
for (const i of e) {
|
|
619
|
-
const
|
|
620
|
-
if (Q(
|
|
619
|
+
const l = t(i);
|
|
620
|
+
if (Q(l)) {
|
|
621
621
|
r = !0;
|
|
622
622
|
continue;
|
|
623
623
|
}
|
|
624
|
-
const c =
|
|
625
|
-
o.has(c) || o.set(c,
|
|
624
|
+
const c = l instanceof Date ? `date:${l.getTime()}` : typeof l == "object" || typeof l == "function" ? l : `${typeof l}:${String(l)}`;
|
|
625
|
+
o.has(c) || o.set(c, l);
|
|
626
626
|
}
|
|
627
627
|
return { values: [...o.values()].map((i) => ({ value: i, text: String(i) })).sort(sn(n)).map(({ value: i }) => i), absent: r };
|
|
628
628
|
}
|
|
@@ -631,7 +631,7 @@ function it(e) {
|
|
|
631
631
|
let t = Mt.get(e);
|
|
632
632
|
return t || (t = new Set(e.map(Se)), Mt.set(e, t)), t;
|
|
633
633
|
}
|
|
634
|
-
const
|
|
634
|
+
const lt = (e, t) => Q(e) ? t.wording.cellAbsentValue : Re(e, t.format, t.formats, t.wording) ?? String(e);
|
|
635
635
|
function Jr({
|
|
636
636
|
condition: e,
|
|
637
637
|
setCondition: t,
|
|
@@ -639,20 +639,20 @@ function Jr({
|
|
|
639
639
|
absentOccurs: o = !1,
|
|
640
640
|
format: r
|
|
641
641
|
}) {
|
|
642
|
-
const s = be(), i = re(),
|
|
643
|
-
const d = { formats: s, wording: i, format: r }, p = n.map((
|
|
642
|
+
const s = be(), i = re(), l = q(() => e ?? [], [e]), c = q(() => {
|
|
643
|
+
const d = { formats: s, wording: i, format: r }, p = n.map((O) => ({ key: Se(O), text: lt(O, d), value: O }));
|
|
644
644
|
p.sort(sn(s));
|
|
645
|
-
const b = new Set(p.map((
|
|
645
|
+
const b = new Set(p.map((O) => O.key)), S = l.filter((O) => !Q(O) && !b.has(Se(O))).map((O) => ({ key: Se(O), text: lt(O, d), value: O })), v = o || l.some(Q) ? [{ key: bt, text: i.cellAbsentValue, value: null }] : [];
|
|
646
646
|
return [...p, ...S, ...v];
|
|
647
|
-
}, [n,
|
|
648
|
-
const p =
|
|
647
|
+
}, [n, l, o, r, s, i]), a = it(l), f = (d) => {
|
|
648
|
+
const p = a.has(d.key) ? l.filter((b) => Se(b) !== d.key) : [...l, d.value];
|
|
649
649
|
t(p.length > 0 ? p : null);
|
|
650
650
|
};
|
|
651
651
|
return /* @__PURE__ */ u("div", { className: h.filterContent, children: c.map((d) => /* @__PURE__ */ u(
|
|
652
652
|
Le,
|
|
653
653
|
{
|
|
654
654
|
label: d.text,
|
|
655
|
-
checked:
|
|
655
|
+
checked: a.has(d.key),
|
|
656
656
|
onChange: () => f(d)
|
|
657
657
|
},
|
|
658
658
|
d.key
|
|
@@ -671,16 +671,16 @@ const Xr = on(
|
|
|
671
671
|
/* From three values on the first two and how many more: a condition is one
|
|
672
672
|
line in the table toolbar, not a list. */
|
|
673
673
|
describeIn: (e, t) => {
|
|
674
|
-
const n = e.map((r) =>
|
|
674
|
+
const n = e.map((r) => lt(r, t));
|
|
675
675
|
if (n.length <= 2) return n.join(", ");
|
|
676
676
|
const o = n.length - 2;
|
|
677
677
|
return `${n.slice(0, 2).join(", ")} ${t.wording.moreValues(o, t.formats.count(o))}`;
|
|
678
678
|
}
|
|
679
679
|
}
|
|
680
|
-
), Qr = (e) => new Date(e.getFullYear(), e.getMonth(), e.getDate()).getTime(), Zr = (e) => new Date(e.getFullYear(), e.getMonth(), e.getDate() + 1).getTime(), Fe = (e) => typeof e == "number" && Number.isFinite(e), ve = (e) => e instanceof Date && !Number.isNaN(e.getTime()), es = (e) => ve(e) ? Qr(e) : Fe(e) ? e : void 0, ts = (e) => ve(e) ? { value: Zr(e), open: !0 } : Fe(e) ? { value: e, open: !1 } : void 0, Ge = (e, t) => ve(e) ? t.formats.date(e) :
|
|
680
|
+
), Qr = (e) => new Date(e.getFullYear(), e.getMonth(), e.getDate()).getTime(), Zr = (e) => new Date(e.getFullYear(), e.getMonth(), e.getDate() + 1).getTime(), Fe = (e) => typeof e == "number" && Number.isFinite(e), ve = (e) => e instanceof Date && !Number.isNaN(e.getTime()), es = (e) => ve(e) ? Qr(e) : Fe(e) ? e : void 0, ts = (e) => ve(e) ? { value: Zr(e), open: !0 } : Fe(e) ? { value: e, open: !1 } : void 0, Ge = (e, t) => ve(e) ? t.formats.date(e) : Re(e, t.format, t.formats, t.wording) ?? String(e);
|
|
681
681
|
function ns({ condition: e, setCondition: t }) {
|
|
682
|
-
const n = re(), [o, r] = W(null), s = o !== null, i = o ? o.from : Fe(e == null ? void 0 : e.from) ? e.from : null,
|
|
683
|
-
const d = { from: i, to:
|
|
682
|
+
const n = re(), [o, r] = W(null), s = o !== null, i = o ? o.from : Fe(e == null ? void 0 : e.from) ? e.from : null, l = o ? o.to : Fe(e == null ? void 0 : e.to) ? e.to : null, c = (a, f) => {
|
|
683
|
+
const d = { from: i, to: l, [a]: f };
|
|
684
684
|
if (d.from !== null && d.to !== null && d.from > d.to) {
|
|
685
685
|
r(d);
|
|
686
686
|
return;
|
|
@@ -694,9 +694,9 @@ function ns({ condition: e, setCondition: t }) {
|
|
|
694
694
|
...d.to !== null ? { to: d.to } : {}
|
|
695
695
|
});
|
|
696
696
|
};
|
|
697
|
-
return /* @__PURE__ */
|
|
698
|
-
/* @__PURE__ */ u(tt, { label: n.filterFrom, children: /* @__PURE__ */ u(nt, { size: "sm", value: i, invalid: s, onChange: (
|
|
699
|
-
/* @__PURE__ */ u(tt, { label: n.filterTo, error: s ? n.rangeInvalid : void 0, children: /* @__PURE__ */ u(nt, { size: "sm", value:
|
|
697
|
+
return /* @__PURE__ */ R("div", { className: h.rangeFields, children: [
|
|
698
|
+
/* @__PURE__ */ u(tt, { label: n.filterFrom, children: /* @__PURE__ */ u(nt, { size: "sm", value: i, invalid: s, onChange: (a) => c("from", a) }) }),
|
|
699
|
+
/* @__PURE__ */ u(tt, { label: n.filterTo, error: s ? n.rangeInvalid : void 0, children: /* @__PURE__ */ u(nt, { size: "sm", value: l, onChange: (a) => c("to", a) }) })
|
|
700
700
|
] });
|
|
701
701
|
}
|
|
702
702
|
function os({ condition: e, setCondition: t }) {
|
|
@@ -746,11 +746,11 @@ const ss = on(
|
|
|
746
746
|
);
|
|
747
747
|
class Qe {
|
|
748
748
|
constructor(t) {
|
|
749
|
-
|
|
749
|
+
j(this, "entries", /* @__PURE__ */ new Map());
|
|
750
750
|
/** Keys in the order of the running pass. */
|
|
751
|
-
|
|
751
|
+
j(this, "pass", []);
|
|
752
752
|
/** Order from the markers in the DOM, after the last commit. */
|
|
753
|
-
|
|
753
|
+
j(this, "dom", []);
|
|
754
754
|
this.markerAttribute = t;
|
|
755
755
|
}
|
|
756
756
|
note(t) {
|
|
@@ -800,57 +800,57 @@ const Ft = (e) => JSON.stringify([
|
|
|
800
800
|
]), Lt = (e, t) => e == null ? void 0 : e[t];
|
|
801
801
|
class is {
|
|
802
802
|
constructor() {
|
|
803
|
-
|
|
804
|
-
|
|
803
|
+
j(this, "columns", new Qe("data-umriss-column"));
|
|
804
|
+
j(this, "actions", new Qe("data-umriss-action"));
|
|
805
805
|
/** The group keys: values to group by that are no column. */
|
|
806
|
-
|
|
807
|
-
|
|
806
|
+
j(this, "groupKeys", new Qe("data-umriss-groupkey"));
|
|
807
|
+
j(this, "signatures", /* @__PURE__ */ new Map());
|
|
808
808
|
/** The row detail: the presentation of the `RowDetail` that registered last. */
|
|
809
|
-
|
|
809
|
+
j(this, "detail", null);
|
|
810
810
|
/** How many `RowActions` stand right now. */
|
|
811
|
-
|
|
811
|
+
j(this, "actionGroups", /* @__PURE__ */ new Set());
|
|
812
812
|
/** Whether the row header column sticks - `pin: "start"` on it. */
|
|
813
|
-
|
|
813
|
+
j(this, "stickyRowHeader", !1);
|
|
814
814
|
/* Without a pagination bar the table does not page: one that stops quietly at
|
|
815
815
|
the tenth row because nobody put one there is a trap (found at the alarm
|
|
816
816
|
list, umriss-table 13). Without a table toolbar, but with a search or a
|
|
817
817
|
column filter, the table puts one there itself (table-filters 04):
|
|
818
818
|
conditions and the ratio need a place, and a place that came into being
|
|
819
819
|
only with the first condition would shift the table. */
|
|
820
|
-
|
|
820
|
+
j(this, "parts", /* @__PURE__ */ new Map());
|
|
821
821
|
/** The element the table's children stand in - for the markers. */
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
822
|
+
j(this, "children", null);
|
|
823
|
+
j(this, "hook", null);
|
|
824
|
+
j(this, "structure", 0);
|
|
825
|
+
j(this, "values", 0);
|
|
826
|
+
j(this, "presentation", 0);
|
|
827
|
+
j(this, "hookVersion", 0);
|
|
828
|
+
j(this, "reported", "");
|
|
829
|
+
j(this, "listeners", /* @__PURE__ */ new Set());
|
|
830
830
|
/* --- Subscription ------------------------------------------------------------- */
|
|
831
|
-
|
|
831
|
+
j(this, "subscribe", (t) => (this.listeners.add(t), () => {
|
|
832
832
|
this.listeners.delete(t);
|
|
833
833
|
}));
|
|
834
834
|
/** What the hook reads. */
|
|
835
|
-
|
|
835
|
+
j(this, "structureVersion", () => this.structure);
|
|
836
836
|
/** What body and unbound parts read. Every counter only rises, so the sum
|
|
837
837
|
rises exactly when one of them rises. */
|
|
838
|
-
|
|
838
|
+
j(this, "bodyVersion", () => this.structure + this.values + this.presentation + this.hookVersion);
|
|
839
839
|
/** The focus a fold may hide: the focused element of a grouped line, the
|
|
840
840
|
group that line stands in, and its table - noted before the fold, since
|
|
841
841
|
afterwards the element may be gone and the focus lost. */
|
|
842
|
-
|
|
842
|
+
j(this, "focusBeforeFold", null);
|
|
843
843
|
/** Whether the table lets itself be grouped at all (`<Table groupable>`). */
|
|
844
|
-
|
|
844
|
+
j(this, "tableGroupable", !0);
|
|
845
845
|
/** Manual mode: the rows are a server's page, and nothing groups them. */
|
|
846
|
-
|
|
847
|
-
|
|
846
|
+
j(this, "manual", !1);
|
|
847
|
+
j(this, "groupingCache", null);
|
|
848
848
|
/* --- The kind of a column ------------------------------------------------------- */
|
|
849
|
-
|
|
849
|
+
j(this, "kinds", /* @__PURE__ */ new Map());
|
|
850
850
|
/* --- The model ------------------------------------------------------------------ */
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
851
|
+
j(this, "modelCache", null);
|
|
852
|
+
j(this, "projectionCache", null);
|
|
853
|
+
j(this, "unpaged", null);
|
|
854
854
|
}
|
|
855
855
|
/** Reports from a layout effect what has changed since the last report.
|
|
856
856
|
Without a change nothing happens. */
|
|
@@ -884,8 +884,8 @@ class is {
|
|
|
884
884
|
key: t,
|
|
885
885
|
spec: n,
|
|
886
886
|
read: (i) => {
|
|
887
|
-
const
|
|
888
|
-
return typeof
|
|
887
|
+
const l = s.spec.value;
|
|
888
|
+
return typeof l == "string" ? Lt(i, l) : l(i);
|
|
889
889
|
}
|
|
890
890
|
};
|
|
891
891
|
this.columns.entries.set(t, s), this.structure++;
|
|
@@ -904,8 +904,8 @@ class is {
|
|
|
904
904
|
const t = /* @__PURE__ */ new Set();
|
|
905
905
|
let n = 0;
|
|
906
906
|
for (const { spec: o } of this.columns.entries.values())
|
|
907
|
-
t.has(o.id) &&
|
|
908
|
-
n > 1 &&
|
|
907
|
+
t.has(o.id) && ae(`id:${o.id}`, `Two columns carry the id "${o.id}". The second one is passed over.`), t.add(o.id), o.rowHeader && n++;
|
|
908
|
+
n > 1 && ae("rowHeader", "More than one column is `rowHeader`. A table has at most one row header; the first one holds.");
|
|
909
909
|
}
|
|
910
910
|
/** The table says during the render whether its row header sticks. Idempotent. */
|
|
911
911
|
setStickyRowHeader(t) {
|
|
@@ -951,8 +951,8 @@ class is {
|
|
|
951
951
|
key: t,
|
|
952
952
|
spec: n,
|
|
953
953
|
read: (i) => {
|
|
954
|
-
const
|
|
955
|
-
return typeof
|
|
954
|
+
const l = s.spec.value;
|
|
955
|
+
return typeof l == "string" ? Lt(i, l) : l(i);
|
|
956
956
|
}
|
|
957
957
|
};
|
|
958
958
|
this.groupKeys.entries.set(t, s), this.structure++;
|
|
@@ -990,7 +990,7 @@ class is {
|
|
|
990
990
|
groupingEntries(t) {
|
|
991
991
|
if (!this.tableGroupable) return [];
|
|
992
992
|
if (this.manual)
|
|
993
|
-
return this.orderedColumns().some((o) => o.spec.groupable === !0) &&
|
|
993
|
+
return this.orderedColumns().some((o) => o.spec.groupable === !0) && ae("manual-groupable-column", "`groupable` on a column is passed over in manual mode: the groups would be the page's, not the server's."), [];
|
|
994
994
|
const n = /* @__PURE__ */ new Set();
|
|
995
995
|
return [...this.orderedColumns(), ...this.groupKeys.ordered()].filter((o) => {
|
|
996
996
|
if (n.has(o.spec.id)) return !1;
|
|
@@ -1008,26 +1008,26 @@ class is {
|
|
|
1008
1008
|
/** The levels and aggregates for the model - the same identity as long as
|
|
1009
1009
|
nothing changed that they read. */
|
|
1010
1010
|
groupingModel(t, n) {
|
|
1011
|
-
var
|
|
1011
|
+
var l;
|
|
1012
1012
|
const o = [t.join("|"), this.structure, this.values].join(":");
|
|
1013
|
-
if (((
|
|
1014
|
-
const r = this.groupingEntries(n), s = t.map((c) => r.find((
|
|
1013
|
+
if (((l = this.groupingCache) == null ? void 0 : l.key) === o) return this.groupingCache;
|
|
1014
|
+
const r = this.groupingEntries(n), s = t.map((c) => r.find((a) => a.spec.id === c)).filter((c) => c !== void 0).map((c) => ({
|
|
1015
1015
|
id: c.spec.id,
|
|
1016
|
-
value: (
|
|
1017
|
-
const f = c.read(
|
|
1016
|
+
value: (a) => {
|
|
1017
|
+
const f = c.read(a);
|
|
1018
1018
|
if (f == null) return;
|
|
1019
1019
|
const { ownGroupValue: d, group: p } = c.spec;
|
|
1020
|
-
return d ? d(f) : p ?
|
|
1020
|
+
return d ? d(f) : p ? Hn(p)(f) : f;
|
|
1021
1021
|
},
|
|
1022
1022
|
/* A value of one's own is a name; its groups stand by what they hold. */
|
|
1023
|
-
order: c.spec.ownGroupValue ? (
|
|
1023
|
+
order: c.spec.ownGroupValue ? (a) => rt(c.read(a), c.spec.ownSortValue) : void 0
|
|
1024
1024
|
})), i = this.orderedColumns().filter((c) => c.spec.aggregate !== void 0).map(
|
|
1025
1025
|
(c) => ({
|
|
1026
1026
|
id: c.spec.id,
|
|
1027
1027
|
read: c.read,
|
|
1028
1028
|
/* Read with the latest spec on every call: an aggregate of one's own
|
|
1029
1029
|
written in the call is a new function on every render. */
|
|
1030
|
-
aggregate: typeof c.spec.aggregate == "function" ? (
|
|
1030
|
+
aggregate: typeof c.spec.aggregate == "function" ? (a, f) => c.spec.aggregate(a, f) : c.spec.aggregate
|
|
1031
1031
|
})
|
|
1032
1032
|
);
|
|
1033
1033
|
return this.groupingCache = { key: o, levels: s, aggregates: i }, this.groupingCache;
|
|
@@ -1060,18 +1060,18 @@ class is {
|
|
|
1060
1060
|
over the hook's calculation. */
|
|
1061
1061
|
modelColumns(t, n) {
|
|
1062
1062
|
var i;
|
|
1063
|
-
const o = this.orderedColumns(), r = [this.structure, this.values, o.map((
|
|
1063
|
+
const o = this.orderedColumns(), r = [this.structure, this.values, o.map((l) => l.key).join("|")].join(":");
|
|
1064
1064
|
if (((i = this.modelCache) == null ? void 0 : i.key) === r && this.modelCache.rows === t && this.modelCache.formats === n)
|
|
1065
1065
|
return this.modelCache.columns;
|
|
1066
|
-
const s = o.map((
|
|
1067
|
-
const { spec: c } =
|
|
1066
|
+
const s = o.map((l) => {
|
|
1067
|
+
const { spec: c } = l, a = this.kindOf(l, t), f = this.isSortable(l, t), d = c.searchable ?? a === "text", p = (b) => rt(l.read(b), c.ownSortValue);
|
|
1068
1068
|
return {
|
|
1069
1069
|
id: c.id,
|
|
1070
1070
|
label: c.label,
|
|
1071
1071
|
value: f || d ? p : void 0,
|
|
1072
1072
|
/* Text sorts with the provider's comparison, not with the built-in
|
|
1073
1073
|
German one (spec, the table of defaults). */
|
|
1074
|
-
compare:
|
|
1074
|
+
compare: a === "text" && !c.ownSortValue ? (b, S) => n.compareText(String(p(b)), String(p(S))) : void 0,
|
|
1075
1075
|
searchable: d,
|
|
1076
1076
|
hideable: !c.rowHeader,
|
|
1077
1077
|
resizable: c.resizable,
|
|
@@ -1093,11 +1093,11 @@ class is {
|
|
|
1093
1093
|
/** The hook's projection when it calculated with the same columns - otherwise
|
|
1094
1094
|
a new one, with the columns of this pass. */
|
|
1095
1095
|
computedProjection() {
|
|
1096
|
-
var
|
|
1096
|
+
var l;
|
|
1097
1097
|
const t = this.hook, n = this.modelColumns(t.rows, t.formats), o = t.companion;
|
|
1098
1098
|
if (n === t.modelColumns)
|
|
1099
1099
|
return o;
|
|
1100
|
-
if (((
|
|
1100
|
+
if (((l = this.projectionCache) == null ? void 0 : l.hook) === t && this.projectionCache.columns === n) return this.projectionCache.projection;
|
|
1101
1101
|
const r = {
|
|
1102
1102
|
search: o.search,
|
|
1103
1103
|
filter: t.filter,
|
|
@@ -1108,7 +1108,7 @@ class is {
|
|
|
1108
1108
|
order: o.order,
|
|
1109
1109
|
grouping: this.groupingFor(t),
|
|
1110
1110
|
manual: o.manual
|
|
1111
|
-
}, s = kt(t.admitted, n, r), i = o.virtual ?
|
|
1111
|
+
}, s = kt(t.admitted, n, r), i = o.virtual ? ls(s, o.virtual.from, o.virtual.to) : s;
|
|
1112
1112
|
return this.projectionCache = { hook: t, columns: n, projection: i }, i;
|
|
1113
1113
|
}
|
|
1114
1114
|
/* --- The hook's snapshot ---------------------------------------------------------- */
|
|
@@ -1142,7 +1142,7 @@ class is {
|
|
|
1142
1142
|
grouped: the tag that names and removes the grouping needs a place. */
|
|
1143
1143
|
needsOwnToolbar() {
|
|
1144
1144
|
var t;
|
|
1145
|
-
return this.count("toolbar") > 0 ? !1 : this.count("search") > 0 || this.orderedColumns().some((n) =>
|
|
1145
|
+
return this.count("toolbar") > 0 ? !1 : this.count("search") > 0 || this.orderedColumns().some((n) => Te(n.spec.filter) !== void 0) || (((t = this.hook) == null ? void 0 : t.publicSnapshot.grouping.length) ?? 0) > 0;
|
|
1146
1146
|
}
|
|
1147
1147
|
/* --- Row detail ------------------------------------------------------------------- */
|
|
1148
1148
|
registerDetail(t, n) {
|
|
@@ -1179,15 +1179,15 @@ class is {
|
|
|
1179
1179
|
this.actions.entries.delete(t) && this.structure++;
|
|
1180
1180
|
}
|
|
1181
1181
|
}
|
|
1182
|
-
function
|
|
1182
|
+
function ls(e, t, n) {
|
|
1183
1183
|
if (!e.lines) return { ...e, visible: e.filtered.slice(t, n) };
|
|
1184
1184
|
const o = e.lines.slice(t, n);
|
|
1185
1185
|
return { ...e, visibleLines: o, visible: yt(o) };
|
|
1186
1186
|
}
|
|
1187
|
-
const
|
|
1188
|
-
|
|
1189
|
-
}, cs = (e) => typeof e == "function" || typeof e == "object" && e !== null ?
|
|
1190
|
-
function
|
|
1187
|
+
const ln = /* @__PURE__ */ new WeakMap(), as = (e, t) => {
|
|
1188
|
+
ln.set(e, t);
|
|
1189
|
+
}, cs = (e) => typeof e == "function" || typeof e == "object" && e !== null ? ln.get(e) : void 0, K = (...e) => e.filter(Boolean).join(" ");
|
|
1190
|
+
function an({
|
|
1191
1191
|
entry: e,
|
|
1192
1192
|
registry: t,
|
|
1193
1193
|
hook: n,
|
|
@@ -1195,21 +1195,21 @@ function ln({
|
|
|
1195
1195
|
focus: r,
|
|
1196
1196
|
open: s,
|
|
1197
1197
|
setOpen: i,
|
|
1198
|
-
panelId:
|
|
1198
|
+
panelId: l
|
|
1199
1199
|
}) {
|
|
1200
|
-
const c = re(),
|
|
1201
|
-
() => S ? st(S, (A) => A,
|
|
1202
|
-
[S, n.admitted, e,
|
|
1203
|
-
), w =
|
|
1204
|
-
if (n.publicSnapshot.manual && !S && e.spec.filter === "list" &&
|
|
1200
|
+
const c = re(), a = be(), { id: f, label: d, format: p } = e.spec, { filterOptions: b } = n, S = b == null ? void 0 : b(f), { values: v, absent: O } = q(
|
|
1201
|
+
() => S ? st(S, (A) => A, a) : st(n.admitted, e.read, a),
|
|
1202
|
+
[S, n.admitted, e, a]
|
|
1203
|
+
), w = Te(e.spec.filter);
|
|
1204
|
+
if (n.publicSnapshot.manual && !S && e.spec.filter === "list" && ae(
|
|
1205
1205
|
`manual-filter-options:${f}`,
|
|
1206
1206
|
`The list filter of "${f}" offers only the values of the page in manual mode; \`filterOptions\` gives it the server's.`
|
|
1207
1207
|
), !w) return null;
|
|
1208
|
-
const _ = n.publicSnapshot, F = w.Input, g = qr(w) ? { absentOccurs:
|
|
1208
|
+
const _ = n.publicSnapshot, F = w.Input, g = qr(w) ? { absentOccurs: O, format: p, kind: t.kindOf(e, n.rows) } : {}, C = () => {
|
|
1209
1209
|
var A;
|
|
1210
1210
|
i(!1), (A = (r ?? o).current) == null || A.focus();
|
|
1211
1211
|
};
|
|
1212
|
-
return /* @__PURE__ */
|
|
1212
|
+
return /* @__PURE__ */ R(
|
|
1213
1213
|
pt,
|
|
1214
1214
|
{
|
|
1215
1215
|
open: s,
|
|
@@ -1218,7 +1218,7 @@ function ln({
|
|
|
1218
1218
|
align: "end",
|
|
1219
1219
|
role: "dialog",
|
|
1220
1220
|
ariaLabel: c.filterColumn(d),
|
|
1221
|
-
id:
|
|
1221
|
+
id: l,
|
|
1222
1222
|
className: h.filterPanel,
|
|
1223
1223
|
children: [
|
|
1224
1224
|
/* @__PURE__ */ u(
|
|
@@ -1231,7 +1231,7 @@ function ln({
|
|
|
1231
1231
|
...g
|
|
1232
1232
|
}
|
|
1233
1233
|
),
|
|
1234
|
-
/* @__PURE__ */
|
|
1234
|
+
/* @__PURE__ */ R("div", { className: h.filterFooter, children: [
|
|
1235
1235
|
/* @__PURE__ */ u(fe, { size: "sm", variant: "ghost", onClick: () => _.setFilter(f, null), children: c.filterReset }),
|
|
1236
1236
|
/* @__PURE__ */ u(fe, { size: "sm", onClick: C, children: c.filterDone })
|
|
1237
1237
|
] })
|
|
@@ -1244,18 +1244,18 @@ function us({
|
|
|
1244
1244
|
registry: t,
|
|
1245
1245
|
hook: n
|
|
1246
1246
|
}) {
|
|
1247
|
-
const o = re(), [r, s] = W(!1), i = ce(null),
|
|
1248
|
-
return /* @__PURE__ */
|
|
1247
|
+
const o = re(), [r, s] = W(!1), i = ce(null), l = me(), { id: c, label: a } = e.spec, f = c in n.publicSnapshot.filter;
|
|
1248
|
+
return /* @__PURE__ */ R(ne, { children: [
|
|
1249
1249
|
/* @__PURE__ */ u(
|
|
1250
1250
|
"button",
|
|
1251
1251
|
{
|
|
1252
1252
|
ref: i,
|
|
1253
1253
|
type: "button",
|
|
1254
|
-
className:
|
|
1255
|
-
"aria-label": o.filterColumn(
|
|
1254
|
+
className: K(h.filterButton, f && h.filterActive),
|
|
1255
|
+
"aria-label": o.filterColumn(a),
|
|
1256
1256
|
"aria-haspopup": "dialog",
|
|
1257
1257
|
"aria-expanded": r,
|
|
1258
|
-
"aria-controls": r ?
|
|
1258
|
+
"aria-controls": r ? l : void 0,
|
|
1259
1259
|
onClick: () => s(!r),
|
|
1260
1260
|
children: /* @__PURE__ */ u("svg", { viewBox: "0 0 14 14", width: "13", height: "13", "aria-hidden": "true", children: /* @__PURE__ */ u(
|
|
1261
1261
|
"path",
|
|
@@ -1271,7 +1271,7 @@ function us({
|
|
|
1271
1271
|
}
|
|
1272
1272
|
),
|
|
1273
1273
|
/* @__PURE__ */ u(
|
|
1274
|
-
|
|
1274
|
+
an,
|
|
1275
1275
|
{
|
|
1276
1276
|
entry: e,
|
|
1277
1277
|
registry: t,
|
|
@@ -1279,17 +1279,17 @@ function us({
|
|
|
1279
1279
|
anchor: i,
|
|
1280
1280
|
open: r,
|
|
1281
1281
|
setOpen: s,
|
|
1282
|
-
panelId:
|
|
1282
|
+
panelId: l
|
|
1283
1283
|
}
|
|
1284
1284
|
)
|
|
1285
1285
|
] });
|
|
1286
1286
|
}
|
|
1287
1287
|
function ds({ registry: e, hook: t }) {
|
|
1288
1288
|
const n = re(), o = be(), r = Object.entries(t.publicSnapshot.filter).flatMap(([s, i]) => {
|
|
1289
|
-
const
|
|
1290
|
-
if (!
|
|
1291
|
-
const
|
|
1292
|
-
return [{ entry:
|
|
1289
|
+
const l = e.columnById(s), c = l ? Te(l.spec.filter) : void 0;
|
|
1290
|
+
if (!l || !c) return [];
|
|
1291
|
+
const a = { formats: o, wording: n, format: l.spec.format, kind: e.kindOf(l, t.rows) };
|
|
1292
|
+
return [{ entry: l, text: Yr(c, i, a) }];
|
|
1293
1293
|
});
|
|
1294
1294
|
return r.length === 0 ? null : /* @__PURE__ */ u(qt, { "aria-label": n.conditions, className: h.conditions, children: r.map(({ entry: s, text: i }) => /* @__PURE__ */ u(fs, { entry: s, text: i, registry: e, hook: t }, s.spec.id)) });
|
|
1295
1295
|
}
|
|
@@ -1299,16 +1299,16 @@ function fs({
|
|
|
1299
1299
|
registry: n,
|
|
1300
1300
|
hook: o
|
|
1301
1301
|
}) {
|
|
1302
|
-
const r = re(), [s, i] = W(!1),
|
|
1303
|
-
return /* @__PURE__ */
|
|
1302
|
+
const r = re(), [s, i] = W(!1), l = ce(null), c = ce(null), a = me(), { id: f, label: d } = e.spec;
|
|
1303
|
+
return /* @__PURE__ */ R(ne, { children: [
|
|
1304
1304
|
/* @__PURE__ */ u(
|
|
1305
1305
|
Ut,
|
|
1306
1306
|
{
|
|
1307
|
-
ref:
|
|
1307
|
+
ref: l,
|
|
1308
1308
|
className: h.condition,
|
|
1309
1309
|
onRemove: () => o.publicSnapshot.setFilter(f, null),
|
|
1310
1310
|
removeLabel: r.removeConditionNamed(d, t),
|
|
1311
|
-
children: /* @__PURE__ */
|
|
1311
|
+
children: /* @__PURE__ */ R(
|
|
1312
1312
|
"button",
|
|
1313
1313
|
{
|
|
1314
1314
|
ref: c,
|
|
@@ -1317,7 +1317,7 @@ function fs({
|
|
|
1317
1317
|
"aria-label": r.editConditionNamed(d, t),
|
|
1318
1318
|
"aria-haspopup": "dialog",
|
|
1319
1319
|
"aria-expanded": s,
|
|
1320
|
-
"aria-controls": s ?
|
|
1320
|
+
"aria-controls": s ? a : void 0,
|
|
1321
1321
|
onClick: () => i(!s),
|
|
1322
1322
|
children: [
|
|
1323
1323
|
/* @__PURE__ */ u("span", { className: h.filterLabel, children: d }),
|
|
@@ -1328,16 +1328,16 @@ function fs({
|
|
|
1328
1328
|
}
|
|
1329
1329
|
),
|
|
1330
1330
|
/* @__PURE__ */ u(
|
|
1331
|
-
|
|
1331
|
+
an,
|
|
1332
1332
|
{
|
|
1333
1333
|
entry: e,
|
|
1334
1334
|
registry: n,
|
|
1335
1335
|
hook: o,
|
|
1336
|
-
anchor:
|
|
1336
|
+
anchor: l,
|
|
1337
1337
|
focus: c,
|
|
1338
1338
|
open: s,
|
|
1339
1339
|
setOpen: i,
|
|
1340
|
-
panelId:
|
|
1340
|
+
panelId: a
|
|
1341
1341
|
}
|
|
1342
1342
|
)
|
|
1343
1343
|
] });
|
|
@@ -1380,11 +1380,11 @@ function ys({ registry: e, hook: t }) {
|
|
|
1380
1380
|
const n = re(), o = e.groupingEntries(t.rows);
|
|
1381
1381
|
if (o.length === 0) return null;
|
|
1382
1382
|
const { grouping: r, setGrouping: s } = t.publicSnapshot;
|
|
1383
|
-
return /* @__PURE__ */
|
|
1383
|
+
return /* @__PURE__ */ R("section", { className: h.groupingChoice, "aria-label": n.grouping, children: [
|
|
1384
1384
|
/* @__PURE__ */ u("h3", { className: h.groupingHeading, children: n.grouping }),
|
|
1385
1385
|
/* @__PURE__ */ u("div", { className: h.groupingOptions, children: o.map((i) => {
|
|
1386
|
-
const { id:
|
|
1387
|
-
return /* @__PURE__ */
|
|
1386
|
+
const { id: l, label: c } = i.spec, a = r.indexOf(l), f = a !== -1;
|
|
1387
|
+
return /* @__PURE__ */ R(
|
|
1388
1388
|
"button",
|
|
1389
1389
|
{
|
|
1390
1390
|
type: "button",
|
|
@@ -1392,13 +1392,13 @@ function ys({ registry: e, hook: t }) {
|
|
|
1392
1392
|
"aria-label": n.groupBy(c),
|
|
1393
1393
|
"aria-pressed": f,
|
|
1394
1394
|
disabled: !f && r.length >= wt,
|
|
1395
|
-
onClick: () => s(f ? r.filter((d) => d !==
|
|
1395
|
+
onClick: () => s(f ? r.filter((d) => d !== l) : [...r, l]),
|
|
1396
1396
|
children: [
|
|
1397
|
-
f && /* @__PURE__ */ u("span", { className: h.groupingLevel, "aria-hidden": "true", children:
|
|
1397
|
+
f && /* @__PURE__ */ u("span", { className: h.groupingLevel, "aria-hidden": "true", children: a + 1 }),
|
|
1398
1398
|
c
|
|
1399
1399
|
]
|
|
1400
1400
|
},
|
|
1401
|
-
|
|
1401
|
+
l
|
|
1402
1402
|
);
|
|
1403
1403
|
}) })
|
|
1404
1404
|
] });
|
|
@@ -1410,21 +1410,21 @@ function _s({ registry: e, hook: t }) {
|
|
|
1410
1410
|
return (
|
|
1411
1411
|
/* In a tag group, as the conditions stand: the tag is one stop, its button
|
|
1412
1412
|
the thing one tabs to, and the ring stands on the tag. */
|
|
1413
|
-
/* @__PURE__ */ u(qt, { "aria-label": n.groupedBy, className: h.groupingTag, children: /* @__PURE__ */ u(Ut, { onRemove: () => o.setGrouping([]), removeLabel: n.removeGrouping, children: /* @__PURE__ */
|
|
1413
|
+
/* @__PURE__ */ u(qt, { "aria-label": n.groupedBy, className: h.groupingTag, children: /* @__PURE__ */ u(Ut, { onRemove: () => o.setGrouping([]), removeLabel: n.removeGrouping, children: /* @__PURE__ */ R(
|
|
1414
1414
|
Yt,
|
|
1415
1415
|
{
|
|
1416
|
-
trigger: /* @__PURE__ */
|
|
1416
|
+
trigger: /* @__PURE__ */ R("button", { type: "button", className: K(h.conditionButton, h.groupingTrigger), children: [
|
|
1417
1417
|
/* @__PURE__ */ u("span", { className: h.groupingPrefix, children: n.groupedBy }),
|
|
1418
|
-
s.map((i,
|
|
1419
|
-
|
|
1418
|
+
s.map((i, l) => /* @__PURE__ */ R("span", { className: h.groupingPath, children: [
|
|
1419
|
+
l > 0 && /* @__PURE__ */ u("span", { className: h.groupingSeparator, "aria-hidden": "true", children: "›" }),
|
|
1420
1420
|
i
|
|
1421
|
-
] }, r[
|
|
1421
|
+
] }, r[l]))
|
|
1422
1422
|
] }),
|
|
1423
1423
|
children: [
|
|
1424
|
-
r.map((i,
|
|
1424
|
+
r.map((i, l) => /* @__PURE__ */ u(Ke, { onSelect: () => o.setGrouping(r.filter((c) => c !== i)), children: n.removeGroupingLevel(s[l]) }, i)),
|
|
1425
1425
|
/* @__PURE__ */ u(Fn, {}),
|
|
1426
|
-
/* @__PURE__ */ u(
|
|
1427
|
-
/* @__PURE__ */ u(
|
|
1426
|
+
/* @__PURE__ */ u(Ke, { onSelect: o.unfoldAll, children: n.unfoldAll }),
|
|
1427
|
+
/* @__PURE__ */ u(Ke, { onSelect: o.foldAll, children: n.foldAll })
|
|
1428
1428
|
]
|
|
1429
1429
|
}
|
|
1430
1430
|
) }) })
|
|
@@ -1437,19 +1437,19 @@ function fn({
|
|
|
1437
1437
|
own: o = !1
|
|
1438
1438
|
}) {
|
|
1439
1439
|
const r = re(), s = be(), i = (e == null ? void 0 : e.hook) ?? null;
|
|
1440
|
-
let
|
|
1440
|
+
let l = null, c = null;
|
|
1441
1441
|
if (e && i) {
|
|
1442
|
-
const
|
|
1443
|
-
|
|
1442
|
+
const a = i.publicSnapshot, f = a.search !== "" || Object.keys(a.filter).length > 0, d = o ? [] : i.selectedRows ?? a.filtered.filter((b) => a.selection.isSelected(i.rowKey(b))), p = e.hasRowActions() ? e.actions.ordered().filter((b) => b.spec.bulk) : [];
|
|
1443
|
+
l = /* @__PURE__ */ R(ne, { children: [
|
|
1444
1444
|
/* @__PURE__ */ u(_s, { registry: e, hook: i }),
|
|
1445
1445
|
/* @__PURE__ */ u(ds, { registry: e, hook: i })
|
|
1446
|
-
] }), c = /* @__PURE__ */
|
|
1447
|
-
/* @__PURE__ */ u("span", { role: "status", className: h.filteredCount, children: f ?
|
|
1446
|
+
] }), c = /* @__PURE__ */ R("div", { className: h.toolbarGroup, children: [
|
|
1447
|
+
/* @__PURE__ */ u("span", { role: "status", className: h.filteredCount, children: f ? a.manual ? (
|
|
1448
1448
|
/* The server counts the matches only; a total beside them would be a second request. */
|
|
1449
|
-
r.entries(
|
|
1450
|
-
) : r.filteredOfTotal(s.count(
|
|
1451
|
-
f && /* @__PURE__ */ u(fe, { size: "sm", variant: "ghost", onClick: () => dn(
|
|
1452
|
-
d.length > 0 && /* @__PURE__ */
|
|
1449
|
+
r.entries(a.rowCount, s.count(a.rowCount))
|
|
1450
|
+
) : r.filteredOfTotal(s.count(a.filtered.length), s.count(i.admitted.length)) : "" }),
|
|
1451
|
+
f && /* @__PURE__ */ u(fe, { size: "sm", variant: "ghost", onClick: () => dn(a), children: r.resetAll }),
|
|
1452
|
+
d.length > 0 && /* @__PURE__ */ R(ne, { children: [
|
|
1453
1453
|
/* @__PURE__ */ u("span", { className: h.toolbarInfo, children: r.selectedCount(d.length, s.count(d.length)) }),
|
|
1454
1454
|
p.map(({ key: b, spec: S }) => /* @__PURE__ */ u(
|
|
1455
1455
|
fe,
|
|
@@ -1464,29 +1464,29 @@ function fn({
|
|
|
1464
1464
|
] })
|
|
1465
1465
|
] });
|
|
1466
1466
|
}
|
|
1467
|
-
return /* @__PURE__ */
|
|
1468
|
-
/* @__PURE__ */
|
|
1467
|
+
return /* @__PURE__ */ R("div", { className: K(h.toolbar, t), children: [
|
|
1468
|
+
/* @__PURE__ */ R("div", { className: h.toolbarGroup, children: [
|
|
1469
1469
|
n,
|
|
1470
|
-
|
|
1470
|
+
l
|
|
1471
1471
|
] }),
|
|
1472
1472
|
c
|
|
1473
1473
|
] });
|
|
1474
1474
|
}
|
|
1475
|
-
const
|
|
1476
|
-
},
|
|
1477
|
-
function
|
|
1475
|
+
const at = gt(null), ks = () => () => {
|
|
1476
|
+
}, Rt = () => 0;
|
|
1477
|
+
function Be(e) {
|
|
1478
1478
|
var r;
|
|
1479
|
-
const t =
|
|
1480
|
-
|
|
1479
|
+
const t = He(at), n = e ? cs(e.Table) ?? null : (t == null ? void 0 : t.registry) ?? null;
|
|
1480
|
+
je(
|
|
1481
1481
|
n ? n.subscribe : ks,
|
|
1482
|
-
n ? n.bodyVersion :
|
|
1483
|
-
n ? n.bodyVersion :
|
|
1482
|
+
n ? n.bodyVersion : Rt,
|
|
1483
|
+
n ? n.bodyVersion : Rt
|
|
1484
1484
|
);
|
|
1485
1485
|
const o = (r = n == null ? void 0 : n.hook) == null ? void 0 : r.publicSnapshot;
|
|
1486
1486
|
return !n || !o ? null : { registry: n, snapshot: o, inside: !e && t !== null, footerTarget: e ? null : (t == null ? void 0 : t.footerTarget) ?? null };
|
|
1487
1487
|
}
|
|
1488
1488
|
function hn({ wording: e }) {
|
|
1489
|
-
return /* @__PURE__ */
|
|
1489
|
+
return /* @__PURE__ */ R(ne, { children: [
|
|
1490
1490
|
/* @__PURE__ */ u("span", { "aria-hidden": "true", className: h.absent, children: "—" }),
|
|
1491
1491
|
/* @__PURE__ */ u(De, { children: e.cellAbsentValue })
|
|
1492
1492
|
] });
|
|
@@ -1507,23 +1507,23 @@ function ct({
|
|
|
1507
1507
|
wording: o,
|
|
1508
1508
|
signed: r = !1
|
|
1509
1509
|
}) {
|
|
1510
|
-
const { aggregate: s, format: i, presentation:
|
|
1510
|
+
const { aggregate: s, format: i, presentation: l } = e.spec;
|
|
1511
1511
|
if (!s) return null;
|
|
1512
|
-
const c = typeof s == "function" ? "own" : s,
|
|
1512
|
+
const c = typeof s == "function" ? "own" : s, a = vt({ id: e.spec.id, read: e.read, aggregate: s }, t), f = (b) => Re(b, i, n, o);
|
|
1513
1513
|
let d;
|
|
1514
|
-
if (Q(
|
|
1515
|
-
else if (c === "range" && i === "date" && xs(
|
|
1516
|
-
const [b, S] =
|
|
1514
|
+
if (Q(a)) d = /* @__PURE__ */ u(hn, { wording: o });
|
|
1515
|
+
else if (c === "range" && i === "date" && xs(a)) {
|
|
1516
|
+
const [b, S] = a;
|
|
1517
1517
|
d = b.getTime() === S.getTime() ? n.date(b) : o.rangeFromTo(n.dateShort(b), n.dateShort(S));
|
|
1518
|
-
} else if (c === "count" || c === "distinct") d = n.count(
|
|
1518
|
+
} else if (c === "count" || c === "distinct") d = n.count(a);
|
|
1519
1519
|
else if (c === "range") {
|
|
1520
|
-
const [b, S] =
|
|
1520
|
+
const [b, S] = a;
|
|
1521
1521
|
d = f(b) === f(S) ? f(b) : o.rangeFromTo(f(b) ?? "", f(S) ?? "");
|
|
1522
|
-
} else c === "own" &&
|
|
1522
|
+
} else c === "own" && l ? d = l(a, t[0]) : d = f(a);
|
|
1523
1523
|
const p = Ss[c];
|
|
1524
|
-
return /* @__PURE__ */
|
|
1524
|
+
return /* @__PURE__ */ R(ne, { children: [
|
|
1525
1525
|
r && p && /* @__PURE__ */ u("span", { "aria-hidden": "true", className: h.footerKind, children: p }),
|
|
1526
|
-
r && /* @__PURE__ */
|
|
1526
|
+
r && /* @__PURE__ */ R(De, { children: [
|
|
1527
1527
|
Cs(c, o),
|
|
1528
1528
|
" "
|
|
1529
1529
|
] }),
|
|
@@ -1553,7 +1553,7 @@ const As = (e) => {
|
|
|
1553
1553
|
t.set(o.dataset.motion, o.getBoundingClientRect().top - n);
|
|
1554
1554
|
return t;
|
|
1555
1555
|
};
|
|
1556
|
-
function
|
|
1556
|
+
function Ts(e, t) {
|
|
1557
1557
|
const n = ce(null);
|
|
1558
1558
|
X(() => {
|
|
1559
1559
|
const o = e.current;
|
|
@@ -1562,24 +1562,24 @@ function Os(e, t) {
|
|
|
1562
1562
|
if (n.current = { trigger: t, positions: r }, !s || s.trigger === t) return;
|
|
1563
1563
|
const i = pn(o, "--u-duration-medium");
|
|
1564
1564
|
if (i === 0 || typeof o.animate != "function") return;
|
|
1565
|
-
const
|
|
1566
|
-
for (const
|
|
1567
|
-
const f =
|
|
1568
|
-
d !== void 0 ?
|
|
1565
|
+
const l = getComputedStyle(o).getPropertyValue("--u-ease-out").trim() || "ease-out", c = Ns(s.positions, r);
|
|
1566
|
+
for (const a of Array.from(o.querySelectorAll("tbody > tr[data-motion]"))) {
|
|
1567
|
+
const f = a.dataset.motion, d = c.get(f);
|
|
1568
|
+
d !== void 0 ? a.animate([{ transform: `translateY(${d}px)` }, { transform: "none" }], { duration: i, easing: l }) : s.positions.has(f) || a.animate([{ opacity: 0, transform: "translateY(-4px)" }, { opacity: 1, transform: "none" }], { duration: i, easing: l });
|
|
1569
1569
|
}
|
|
1570
1570
|
});
|
|
1571
1571
|
}
|
|
1572
|
-
function
|
|
1572
|
+
function Os(e, t, n) {
|
|
1573
1573
|
const o = ce(t);
|
|
1574
1574
|
X(() => {
|
|
1575
1575
|
const r = e.current, s = o.current;
|
|
1576
1576
|
if (o.current = t, !r || s === t || typeof r.animate != "function") return;
|
|
1577
1577
|
const i = pn(r, "--u-duration-medium");
|
|
1578
1578
|
if (i === 0) return;
|
|
1579
|
-
const
|
|
1580
|
-
let c = requestAnimationFrame(function
|
|
1581
|
-
const d = Math.min(1, (f -
|
|
1582
|
-
r.textContent = n(Math.round(s + (t - s) * p)), d < 1 && (c = requestAnimationFrame(
|
|
1579
|
+
const l = performance.now();
|
|
1580
|
+
let c = requestAnimationFrame(function a(f) {
|
|
1581
|
+
const d = Math.min(1, (f - l) / i), p = 1 - (1 - d) ** 3;
|
|
1582
|
+
r.textContent = n(Math.round(s + (t - s) * p)), d < 1 && (c = requestAnimationFrame(a));
|
|
1583
1583
|
});
|
|
1584
1584
|
return () => {
|
|
1585
1585
|
cancelAnimationFrame(c), r.textContent = n(t);
|
|
@@ -1592,7 +1592,7 @@ function St(e, t, n = t) {
|
|
|
1592
1592
|
if (!o) return mn;
|
|
1593
1593
|
const r = o.side === "start";
|
|
1594
1594
|
return {
|
|
1595
|
-
className:
|
|
1595
|
+
className: K(h.pinned, o.edge && (r ? h.pinStartEdge : h.pinEndEdge)),
|
|
1596
1596
|
/* The scroll area keeps a padding as wide as the block for the browser's
|
|
1597
1597
|
scroll into view; a pinned cell lies inside it and would scroll the
|
|
1598
1598
|
table back to its start when focused. Its target is shifted out of the
|
|
@@ -1610,29 +1610,29 @@ function St(e, t, n = t) {
|
|
|
1610
1610
|
}
|
|
1611
1611
|
const Ms = (e) => e.controls + (e.span ? 1 : 0) + e.aggregates.length + (e.actions ? 1 : 0);
|
|
1612
1612
|
function bn(e) {
|
|
1613
|
-
const { controls: t, span: n, aggregates: o, actions: r, blocks: s } = e, i = o.length,
|
|
1613
|
+
const { controls: t, span: n, aggregates: o, actions: r, blocks: s } = e, i = o.length, l = o.indexOf(!0), c = s.end > 0 ? s.end - (r ? 1 : 0) : 0, a = Math.max(n || i === 0 ? 0 : 1, Math.min(l === -1 ? i : l, i - c)), f = t + (n ? 1 : 0), d = s.start > 0 ? s.start - f : 0;
|
|
1614
1614
|
return {
|
|
1615
|
-
lead:
|
|
1616
|
-
labelColumns: s.start > 0 ? Math.min(
|
|
1617
|
-
countColumns: d > 0 ? Math.min(
|
|
1615
|
+
lead: a,
|
|
1616
|
+
labelColumns: s.start > 0 ? Math.min(a, d) : a,
|
|
1617
|
+
countColumns: d > 0 ? Math.min(a, d) : a
|
|
1618
1618
|
};
|
|
1619
1619
|
}
|
|
1620
1620
|
function Ze(e, t) {
|
|
1621
1621
|
const n = Ms(t);
|
|
1622
1622
|
if (e === "cells") return Array.from({ length: n }, () => 1);
|
|
1623
1623
|
if (e === "whole") return [n];
|
|
1624
|
-
const { lead: o, labelColumns: r, countColumns: s } = bn(t), i = Array.from({ length: t.controls }, () => 1),
|
|
1625
|
-
return e === "header" ? [...i, (t.span ? 1 : 0) + r, ...c(r), ...
|
|
1624
|
+
const { lead: o, labelColumns: r, countColumns: s } = bn(t), i = Array.from({ length: t.controls }, () => 1), l = Array.from({ length: t.aggregates.length - o + (t.actions ? 1 : 0) }, () => 1), c = (a) => o - a > 0 ? [o - a] : [];
|
|
1625
|
+
return e === "header" ? [...i, (t.span ? 1 : 0) + r, ...c(r), ...l] : [...i, 1, ...s > 0 ? [s] : [], ...c(s), ...l];
|
|
1626
1626
|
}
|
|
1627
1627
|
const qe = (e) => `row:${e}`;
|
|
1628
1628
|
function Fs({ layout: e, body: t, rowKey: n, expanded: o, foot: r }) {
|
|
1629
|
-
const s = Ze("cells", e), i = Ze("whole", e),
|
|
1630
|
-
const d = n(
|
|
1631
|
-
|
|
1629
|
+
const s = Ze("cells", e), i = Ze("whole", e), l = [{ key: "head", cells: s, at: -1 }], c = (a, f) => {
|
|
1630
|
+
const d = n(a);
|
|
1631
|
+
l.push({ key: qe(d), cells: s, at: f, row: a }), o.has(d) && l.push({ key: `detail:${d}`, cells: i, at: f, row: a });
|
|
1632
1632
|
};
|
|
1633
|
-
return "rows" in t ? t.rows.forEach(c) : t.lines.forEach((
|
|
1634
|
-
|
|
1635
|
-
}),
|
|
1633
|
+
return "rows" in t ? t.rows.forEach(c) : t.lines.forEach((a, f) => {
|
|
1634
|
+
a.kind === "row" ? c(a.row, f) : l.push({ key: `${a.kind}:${a.group.path}`, cells: Ze(a.kind, e), at: f });
|
|
1635
|
+
}), l.length === 1 && l.push({ key: "empty", cells: i, at: -1 }), r && l.push({ key: "foot", cells: s, at: -1 }), l;
|
|
1636
1636
|
}
|
|
1637
1637
|
function vn(e, t) {
|
|
1638
1638
|
let n = 0;
|
|
@@ -1643,39 +1643,39 @@ function vn(e, t) {
|
|
|
1643
1643
|
}
|
|
1644
1644
|
return { index: 0, start: 0 };
|
|
1645
1645
|
}
|
|
1646
|
-
const
|
|
1646
|
+
const ze = (e, t) => e.slice(0, t).reduce((n, o) => n + o, 0);
|
|
1647
1647
|
function Ls(e, t, n, o) {
|
|
1648
1648
|
const r = e.length - 1, s = e[t.line];
|
|
1649
1649
|
if (!s) return t;
|
|
1650
|
-
const { index: i } = vn(s.cells, t.column),
|
|
1650
|
+
const { index: i } = vn(s.cells, t.column), l = (c) => ({ line: Math.max(0, Math.min(r, c)), column: t.column });
|
|
1651
1651
|
switch (n) {
|
|
1652
1652
|
case "left":
|
|
1653
|
-
return i > 0 ? { line: t.line, column:
|
|
1653
|
+
return i > 0 ? { line: t.line, column: ze(s.cells, i - 1) } : t;
|
|
1654
1654
|
case "right":
|
|
1655
|
-
return i < s.cells.length - 1 ? { line: t.line, column:
|
|
1655
|
+
return i < s.cells.length - 1 ? { line: t.line, column: ze(s.cells, i + 1) } : t;
|
|
1656
1656
|
case "up":
|
|
1657
|
-
return
|
|
1657
|
+
return l(t.line - 1);
|
|
1658
1658
|
case "down":
|
|
1659
|
-
return
|
|
1659
|
+
return l(t.line + 1);
|
|
1660
1660
|
case "pageUp":
|
|
1661
|
-
return
|
|
1661
|
+
return l(t.line - Math.max(1, o));
|
|
1662
1662
|
case "pageDown":
|
|
1663
|
-
return
|
|
1663
|
+
return l(t.line + Math.max(1, o));
|
|
1664
1664
|
case "lineStart":
|
|
1665
1665
|
return { line: t.line, column: 0 };
|
|
1666
1666
|
case "lineEnd":
|
|
1667
|
-
return { line: t.line, column:
|
|
1667
|
+
return { line: t.line, column: ze(s.cells, s.cells.length - 1) };
|
|
1668
1668
|
case "first":
|
|
1669
1669
|
return { line: 0, column: 0 };
|
|
1670
1670
|
case "last":
|
|
1671
|
-
return { line: r, column:
|
|
1671
|
+
return { line: r, column: ze(e[r].cells, e[r].cells.length - 1) };
|
|
1672
1672
|
}
|
|
1673
1673
|
}
|
|
1674
1674
|
function Ds(e, t, n, o) {
|
|
1675
|
-
const r = e.flatMap((
|
|
1675
|
+
const r = e.flatMap((l, c) => l.cells.map((a, f) => ({ line: c, column: ze(l.cells, f) }))), s = r.findIndex((l) => l.line === t.line && l.column === vn(e[t.line].cells, t.column).start);
|
|
1676
1676
|
return (n ? r.slice(0, Math.max(0, s)).reverse() : r.slice(s + 1)).find(o) ?? null;
|
|
1677
1677
|
}
|
|
1678
|
-
function
|
|
1678
|
+
function Pt(e, t, n) {
|
|
1679
1679
|
const o = e.indexOf(t);
|
|
1680
1680
|
return o >= 0 ? o : Math.max(0, Math.min(e.length - 1, n));
|
|
1681
1681
|
}
|
|
@@ -1684,7 +1684,7 @@ function Ue(e, t, n, o) {
|
|
|
1684
1684
|
const r = e == null ? void 0 : e.spec;
|
|
1685
1685
|
if (r != null && r.group && t instanceof Date) return Wn(r.group, t, n, o);
|
|
1686
1686
|
const s = r != null && r.ownGroupValue || r == null ? void 0 : r.format;
|
|
1687
|
-
return
|
|
1687
|
+
return Re(t, s, n, o) ?? String(t);
|
|
1688
1688
|
}
|
|
1689
1689
|
function ut({ entry: e, group: t, formats: n, wording: o }) {
|
|
1690
1690
|
const r = e == null ? void 0 : e.spec;
|
|
@@ -1699,15 +1699,15 @@ function dt({
|
|
|
1699
1699
|
formats: s,
|
|
1700
1700
|
wording: i
|
|
1701
1701
|
}) {
|
|
1702
|
-
const
|
|
1702
|
+
const l = Ue(n, e.value, s, i), c = s.count(e.rows.length), a = () => r.publicSnapshot.toggleFold(e.path), f = (d) => {
|
|
1703
1703
|
if (d.altKey && (d.key === "ArrowLeft" || d.key === "ArrowRight")) {
|
|
1704
1704
|
d.preventDefault(), Et(e, d.key === "ArrowLeft", r);
|
|
1705
1705
|
return;
|
|
1706
1706
|
}
|
|
1707
1707
|
if (d.key === "ArrowRight" && !o)
|
|
1708
|
-
d.preventDefault(),
|
|
1708
|
+
d.preventDefault(), a();
|
|
1709
1709
|
else if (d.key === "ArrowLeft") {
|
|
1710
|
-
if (d.preventDefault(), o)
|
|
1710
|
+
if (d.preventDefault(), o) a();
|
|
1711
1711
|
else if (t) {
|
|
1712
1712
|
const p = d.currentTarget.closest("table"), b = Array.from((p == null ? void 0 : p.querySelectorAll("[data-fold-path]")) ?? []).find(
|
|
1713
1713
|
(S) => S.dataset.foldPath === t.path
|
|
@@ -1720,47 +1720,47 @@ function dt({
|
|
|
1720
1720
|
"button",
|
|
1721
1721
|
{
|
|
1722
1722
|
type: "button",
|
|
1723
|
-
className:
|
|
1723
|
+
className: K(h.fold, !o && h.foldClosed),
|
|
1724
1724
|
"data-fold-path": e.path,
|
|
1725
1725
|
"aria-expanded": o,
|
|
1726
|
-
"aria-label": o ? i.foldGroup(
|
|
1726
|
+
"aria-label": o ? i.foldGroup(l, c) : i.unfoldGroup(l, c),
|
|
1727
1727
|
onKeyDown: f,
|
|
1728
1728
|
onClick: (d) => {
|
|
1729
|
-
if (!d.altKey) return
|
|
1729
|
+
if (!d.altKey) return a();
|
|
1730
1730
|
Et(e, o, r);
|
|
1731
1731
|
},
|
|
1732
1732
|
children: /* @__PURE__ */ u("svg", { viewBox: "0 0 10 10", width: "12", height: "12", "aria-hidden": "true", children: /* @__PURE__ */ u("path", { d: "M2.5 3.75 5 6.25 7.5 3.75", fill: "none", stroke: "currentColor", strokeWidth: "1.4", strokeLinecap: "round", strokeLinejoin: "round" }) })
|
|
1733
1733
|
}
|
|
1734
1734
|
);
|
|
1735
1735
|
}
|
|
1736
|
-
function
|
|
1736
|
+
function Rs({ value: e, formats: t }) {
|
|
1737
1737
|
const n = ce(null);
|
|
1738
|
-
return
|
|
1738
|
+
return Os(n, e, t.count), /* @__PURE__ */ u("span", { ref: n, className: h.groupCount, children: t.count(e) });
|
|
1739
1739
|
}
|
|
1740
1740
|
function ft({ group: e, entry: t, hook: n, formats: o, wording: r }) {
|
|
1741
|
-
const { selection: s } = n.publicSnapshot, i = e.rows.map(n.rowKey),
|
|
1741
|
+
const { selection: s } = n.publicSnapshot, i = e.rows.map(n.rowKey), l = i.filter((a) => s.isSelected(a)).length, c = l === i.length;
|
|
1742
1742
|
return /* @__PURE__ */ u(
|
|
1743
1743
|
Le,
|
|
1744
1744
|
{
|
|
1745
1745
|
"aria-label": r.selectGroup(Ue(t, e.value, o, r)),
|
|
1746
1746
|
checked: c,
|
|
1747
|
-
indeterminate:
|
|
1747
|
+
indeterminate: l > 0 && !c,
|
|
1748
1748
|
onChange: () => {
|
|
1749
|
-
for (const
|
|
1749
|
+
for (const a of i) s.isSelected(a) === c && s.toggle(a);
|
|
1750
1750
|
}
|
|
1751
1751
|
}
|
|
1752
1752
|
);
|
|
1753
1753
|
}
|
|
1754
1754
|
function Et(e, t, n) {
|
|
1755
1755
|
const o = n.publicSnapshot, r = [], s = (i) => {
|
|
1756
|
-
for (const
|
|
1757
|
-
|
|
1756
|
+
for (const l of i)
|
|
1757
|
+
l.level === e.level ? r.push(l) : s(l.groups);
|
|
1758
1758
|
};
|
|
1759
1759
|
s(n.companion.groups ?? []);
|
|
1760
1760
|
for (const i of r)
|
|
1761
1761
|
o.folded.includes(i.path) !== t && o.toggleFold(i.path);
|
|
1762
1762
|
}
|
|
1763
|
-
function
|
|
1763
|
+
function Ps({
|
|
1764
1764
|
line: e,
|
|
1765
1765
|
entry: t,
|
|
1766
1766
|
selectable: n,
|
|
@@ -1769,18 +1769,18 @@ function Rs({
|
|
|
1769
1769
|
formats: s,
|
|
1770
1770
|
wording: i
|
|
1771
1771
|
}) {
|
|
1772
|
-
const
|
|
1773
|
-
return /* @__PURE__ */ u("td", { className:
|
|
1774
|
-
n && /* @__PURE__ */ u("span", { className: h.spanSelect, children: /* @__PURE__ */ u(ft, { group:
|
|
1775
|
-
/* @__PURE__ */ u(dt, { group:
|
|
1776
|
-
/* @__PURE__ */
|
|
1777
|
-
/* @__PURE__ */ u(ut, { entry: t, group:
|
|
1772
|
+
const l = e.span;
|
|
1773
|
+
return /* @__PURE__ */ u("td", { className: K(h.td, h.spanCell, o.className), style: o.style, children: e.first && /* @__PURE__ */ R("span", { className: h.spanValue, children: [
|
|
1774
|
+
n && /* @__PURE__ */ u("span", { className: h.spanSelect, children: /* @__PURE__ */ u(ft, { group: l, entry: t, hook: r, formats: s, wording: i }) }),
|
|
1775
|
+
/* @__PURE__ */ u(dt, { group: l, parent: e.parents.at(-1), entry: t, open: !0, hook: r, formats: s, wording: i }),
|
|
1776
|
+
/* @__PURE__ */ R("span", { className: h.spanText, title: Ue(t, l.value, s, i), children: [
|
|
1777
|
+
/* @__PURE__ */ u(ut, { entry: t, group: l, formats: s, wording: i }),
|
|
1778
1778
|
e.continued && /* @__PURE__ */ u("span", { className: h.continued, children: i.groupContinued })
|
|
1779
1779
|
] }),
|
|
1780
|
-
/* @__PURE__ */ u("span", { className: h.groupCount, children: s.count(
|
|
1780
|
+
/* @__PURE__ */ u("span", { className: h.groupCount, children: s.count(l.rows.length) })
|
|
1781
1781
|
] }) });
|
|
1782
1782
|
}
|
|
1783
|
-
function
|
|
1783
|
+
function zt({
|
|
1784
1784
|
line: e,
|
|
1785
1785
|
index: t,
|
|
1786
1786
|
absolute: n,
|
|
@@ -1788,40 +1788,40 @@ function It({
|
|
|
1788
1788
|
levelEntry: r,
|
|
1789
1789
|
columns: s,
|
|
1790
1790
|
controlColumns: i,
|
|
1791
|
-
blocks:
|
|
1791
|
+
blocks: l,
|
|
1792
1792
|
selectable: c,
|
|
1793
|
-
hasActions:
|
|
1793
|
+
hasActions: a,
|
|
1794
1794
|
total: f,
|
|
1795
1795
|
siblings: d,
|
|
1796
1796
|
depth: p,
|
|
1797
1797
|
hook: b,
|
|
1798
1798
|
formats: S,
|
|
1799
1799
|
wording: v,
|
|
1800
|
-
grid:
|
|
1800
|
+
grid: O
|
|
1801
1801
|
}) {
|
|
1802
1802
|
const { group: w } = e, _ = e.kind === "header", F = _ && !b.publicSnapshot.folded.includes(w.path), { lead: g, labelColumns: C, countColumns: A } = bn({
|
|
1803
1803
|
controls: i,
|
|
1804
1804
|
span: o !== void 0,
|
|
1805
|
-
aggregates: s.map((
|
|
1806
|
-
actions:
|
|
1807
|
-
blocks:
|
|
1808
|
-
}), L = s.slice(g), m = i + (o ? 1 : 0), k = (
|
|
1805
|
+
aggregates: s.map((I) => I.spec.aggregate !== void 0),
|
|
1806
|
+
actions: a,
|
|
1807
|
+
blocks: l
|
|
1808
|
+
}), L = s.slice(g), m = i + (o ? 1 : 0), k = (I, P = I) => St(l, I, P), T = (I) => g - I > 0 && /* @__PURE__ */ u("td", { className: h.td, colSpan: g - I }), y = s.find((I) => I.spec.aggregate === "sum" && I.spec.share !== !1), M = n !== void 0, N = /* @__PURE__ */ R("span", { className: h.groupLabel, children: [
|
|
1809
1809
|
/* @__PURE__ */ u(dt, { group: w, parent: e.parents.at(-1), entry: r, open: F, hook: b, formats: S, wording: v }),
|
|
1810
1810
|
/* @__PURE__ */ u("span", { className: h.groupValue, children: /* @__PURE__ */ u(ut, { entry: r, group: w, formats: S, wording: v }) }),
|
|
1811
|
-
/* @__PURE__ */ u(
|
|
1811
|
+
/* @__PURE__ */ u(Rs, { value: w.rows.length, formats: S }),
|
|
1812
1812
|
_ && e.continued && /* @__PURE__ */ u("span", { className: h.continued, children: v.groupContinued })
|
|
1813
1813
|
] });
|
|
1814
|
-
return /* @__PURE__ */
|
|
1814
|
+
return /* @__PURE__ */ R(
|
|
1815
1815
|
"tr",
|
|
1816
1816
|
{
|
|
1817
|
-
className:
|
|
1817
|
+
className: K(_ ? h.groupHeader : h.groupFolded, M && h.virtualRow),
|
|
1818
1818
|
"data-line": e.kind,
|
|
1819
1819
|
"data-level": w.level,
|
|
1820
1820
|
"data-motion": n !== void 0 || !(_ && e.continued) ? `${e.kind}:${w.path}` : void 0,
|
|
1821
1821
|
"data-continued": _ && e.continued ? "" : void 0,
|
|
1822
1822
|
"data-group-first": _ ? void 0 : "",
|
|
1823
1823
|
"data-group": w.path,
|
|
1824
|
-
"data-grid-line":
|
|
1824
|
+
"data-grid-line": O ? `${e.kind}:${w.path}` : void 0,
|
|
1825
1825
|
"data-row": M ? n : void 0,
|
|
1826
1826
|
"aria-rowindex": M ? n + 2 : void 0,
|
|
1827
1827
|
"data-index": t,
|
|
@@ -1831,12 +1831,12 @@ function It({
|
|
|
1831
1831
|
"aria-posinset": d.indexOf(w) + 1 || void 0,
|
|
1832
1832
|
"aria-setsize": d.length || void 0,
|
|
1833
1833
|
children: [
|
|
1834
|
-
Array.from({ length: i }, (
|
|
1835
|
-
_ ? /* @__PURE__ */
|
|
1834
|
+
Array.from({ length: i }, (I, P) => /* @__PURE__ */ u("td", { className: K(h.td, h.control, k(P).className), style: k(P).style, children: P === 0 && c && _ && /* @__PURE__ */ u(ft, { group: w, entry: r, hook: b, formats: S, wording: v }) }, `c${P}`)),
|
|
1835
|
+
_ ? /* @__PURE__ */ R(ne, { children: [
|
|
1836
1836
|
/* @__PURE__ */ u(
|
|
1837
1837
|
"td",
|
|
1838
1838
|
{
|
|
1839
|
-
className:
|
|
1839
|
+
className: K(h.td, k(i, m + C - 1).className),
|
|
1840
1840
|
colSpan: (o ? 1 : 0) + C,
|
|
1841
1841
|
style: {
|
|
1842
1842
|
...k(i, m + C - 1).style,
|
|
@@ -1845,9 +1845,9 @@ function It({
|
|
|
1845
1845
|
children: N
|
|
1846
1846
|
}
|
|
1847
1847
|
),
|
|
1848
|
-
|
|
1849
|
-
] }) : /* @__PURE__ */
|
|
1850
|
-
/* @__PURE__ */ u("td", { className:
|
|
1848
|
+
T(C)
|
|
1849
|
+
] }) : /* @__PURE__ */ R(ne, { children: [
|
|
1850
|
+
/* @__PURE__ */ u("td", { className: K(h.td, h.spanCell, k(i).className), style: k(i).style, children: /* @__PURE__ */ R("span", { className: h.spanValue, children: [
|
|
1851
1851
|
c && /* @__PURE__ */ u("span", { className: h.spanSelect, children: /* @__PURE__ */ u(ft, { group: w, entry: o, hook: b, formats: S, wording: v }) }),
|
|
1852
1852
|
/* @__PURE__ */ u(dt, { group: w, parent: e.parents.at(-1), entry: o, open: !1, hook: b, formats: S, wording: v }),
|
|
1853
1853
|
/* @__PURE__ */ u("span", { className: h.spanText, children: /* @__PURE__ */ u(ut, { entry: o, group: w, formats: S, wording: v }) }),
|
|
@@ -1856,28 +1856,28 @@ function It({
|
|
|
1856
1856
|
A > 0 && /* @__PURE__ */ u(
|
|
1857
1857
|
"td",
|
|
1858
1858
|
{
|
|
1859
|
-
className:
|
|
1859
|
+
className: K(h.td, h.foldedCount, k(m, m + A - 1).className),
|
|
1860
1860
|
style: k(m, m + A - 1).style,
|
|
1861
1861
|
colSpan: A,
|
|
1862
1862
|
children: v.entries(w.rows.length, S.count(w.rows.length))
|
|
1863
1863
|
}
|
|
1864
1864
|
),
|
|
1865
|
-
|
|
1865
|
+
T(A)
|
|
1866
1866
|
] }),
|
|
1867
|
-
L.map((
|
|
1867
|
+
L.map((I, P) => /* @__PURE__ */ u(
|
|
1868
1868
|
Es,
|
|
1869
1869
|
{
|
|
1870
|
-
pin: k(m + g +
|
|
1871
|
-
entry:
|
|
1870
|
+
pin: k(m + g + P),
|
|
1871
|
+
entry: I,
|
|
1872
1872
|
group: w,
|
|
1873
|
-
share: _ &&
|
|
1873
|
+
share: _ && I === y,
|
|
1874
1874
|
total: f,
|
|
1875
1875
|
formats: S,
|
|
1876
1876
|
wording: v
|
|
1877
1877
|
},
|
|
1878
|
-
|
|
1878
|
+
I.key
|
|
1879
1879
|
)),
|
|
1880
|
-
|
|
1880
|
+
a && /* @__PURE__ */ u("td", { className: K(h.td, k(l.count - 1).className), style: k(l.count - 1).style })
|
|
1881
1881
|
]
|
|
1882
1882
|
}
|
|
1883
1883
|
);
|
|
@@ -1891,24 +1891,24 @@ function Es({
|
|
|
1891
1891
|
formats: s,
|
|
1892
1892
|
wording: i
|
|
1893
1893
|
}) {
|
|
1894
|
-
const { spec:
|
|
1895
|
-
if (!
|
|
1894
|
+
const { spec: l } = e;
|
|
1895
|
+
if (!l.aggregate) return /* @__PURE__ */ u("td", { className: K(h.td, t.className), style: t.style });
|
|
1896
1896
|
let c = null;
|
|
1897
|
-
if (o &&
|
|
1898
|
-
const
|
|
1899
|
-
if (typeof
|
|
1900
|
-
const d = Math.min(1, f /
|
|
1897
|
+
if (o && l.aggregate === "sum" && l.share !== !1) {
|
|
1898
|
+
const a = vt({ id: l.id, read: e.read, aggregate: "sum" }, r), f = n.aggregates[l.id];
|
|
1899
|
+
if (typeof a == "number" && a > 0 && typeof f == "number" && f > 0) {
|
|
1900
|
+
const d = Math.min(1, f / a);
|
|
1901
1901
|
c = /* @__PURE__ */ u("span", { className: h.shareBar, style: { width: `${Math.max(2, Math.round(d * 64))}px` }, "aria-hidden": "true" });
|
|
1902
1902
|
}
|
|
1903
1903
|
}
|
|
1904
|
-
return /* @__PURE__ */ u("td", { className:
|
|
1904
|
+
return /* @__PURE__ */ u("td", { className: K(h.td, gn(e, n.rows) && h.numeric, h.aggregateCell, t.className), style: t.style, "data-aggregate": typeof l.aggregate == "function" ? "own" : l.aggregate, children: c ? /* @__PURE__ */ R("span", { className: h.shareHost, children: [
|
|
1905
1905
|
/* @__PURE__ */ u(ct, { entry: e, rows: n.rows, formats: s, wording: i }),
|
|
1906
1906
|
c
|
|
1907
1907
|
] }) : /* @__PURE__ */ u(ct, { entry: e, rows: n.rows, formats: s, wording: i }) });
|
|
1908
1908
|
}
|
|
1909
|
-
class
|
|
1909
|
+
class zs {
|
|
1910
1910
|
constructor() {
|
|
1911
|
-
|
|
1911
|
+
j(this, "wish", null);
|
|
1912
1912
|
}
|
|
1913
1913
|
want(t) {
|
|
1914
1914
|
(this.wish !== "editor" || t === null) && (this.wish = t);
|
|
@@ -1919,17 +1919,17 @@ class Is {
|
|
|
1919
1919
|
return n && (this.wish = null), n;
|
|
1920
1920
|
}
|
|
1921
1921
|
}
|
|
1922
|
-
function
|
|
1923
|
-
const [e, t] = W({ active: null, widget: !1, editing: null }), [n] = W(() => new
|
|
1922
|
+
function Is() {
|
|
1923
|
+
const [e, t] = W({ active: null, widget: !1, editing: null }), [n] = W(() => new zs());
|
|
1924
1924
|
return { state: e, setState: t, focus: n };
|
|
1925
1925
|
}
|
|
1926
1926
|
const wn = gt(null);
|
|
1927
|
-
function
|
|
1928
|
-
const n =
|
|
1927
|
+
function Vs(e, t) {
|
|
1928
|
+
const n = He(wn), o = n == null ? void 0 : n.editing;
|
|
1929
1929
|
return o && o.line === qe(e) && o.column === t ? n : null;
|
|
1930
1930
|
}
|
|
1931
1931
|
const yn = 'a[href], button, input, select, textarea, [tabindex], [contenteditable="true"]', Ee = "data-grid-tabindex";
|
|
1932
|
-
function
|
|
1932
|
+
function Bs(e, t) {
|
|
1933
1933
|
if (t && !e.hasAttribute(Ee))
|
|
1934
1934
|
e.setAttribute(Ee, e.getAttribute("tabindex") ?? ""), e.tabIndex = -1;
|
|
1935
1935
|
else if (!t && e.hasAttribute(Ee)) {
|
|
@@ -1944,11 +1944,11 @@ function Ct(e) {
|
|
|
1944
1944
|
return t = o.end, o;
|
|
1945
1945
|
});
|
|
1946
1946
|
}
|
|
1947
|
-
function
|
|
1947
|
+
function It(e, t) {
|
|
1948
1948
|
if (!(t instanceof Element)) return null;
|
|
1949
1949
|
const n = t.closest("td, th"), o = n == null ? void 0 : n.parentElement, r = o == null ? void 0 : o.dataset.gridLine;
|
|
1950
1950
|
if (!n || !o || r === void 0 || o.closest("table") !== e) return null;
|
|
1951
|
-
const { start: s, end: i } = Ct(o).find((
|
|
1951
|
+
const { start: s, end: i } = Ct(o).find((l) => l.cell === n);
|
|
1952
1952
|
return { cell: n, line: r, column: s, end: i };
|
|
1953
1953
|
}
|
|
1954
1954
|
function Gs({
|
|
@@ -1959,18 +1959,18 @@ function Gs({
|
|
|
1959
1959
|
editable: r
|
|
1960
1960
|
}) {
|
|
1961
1961
|
return X(() => {
|
|
1962
|
-
var
|
|
1962
|
+
var O;
|
|
1963
1963
|
const s = e.current;
|
|
1964
1964
|
if (!s) return;
|
|
1965
|
-
const { active: i, widget:
|
|
1965
|
+
const { active: i, widget: l, editing: c } = t.state, a = $s(i, n, o), f = (O = n[a.line]) == null ? void 0 : O.key, d = new Map(n.map((w, _) => [w.key, _]));
|
|
1966
1966
|
let p = null, b = null;
|
|
1967
1967
|
for (const w of Array.from(s.querySelectorAll("tr[data-grid-line]"))) {
|
|
1968
1968
|
const _ = w.dataset.gridLine, F = Ct(w);
|
|
1969
1969
|
for (const { cell: g, start: C, end: A } of F) {
|
|
1970
|
-
const L =
|
|
1970
|
+
const L = a.column >= C && a.column < A || g === F.at(-1).cell && a.column >= A;
|
|
1971
1971
|
L && _ === f && (p = g), L && b === null && _ !== "head" && (b = g), g.tabIndex = -1, r && _ !== "head" && !r({ line: d.get(_) ?? -1, column: C }) ? g.setAttribute("aria-readonly", "true") : g.removeAttribute("aria-readonly");
|
|
1972
|
-
const m = g === p && (
|
|
1973
|
-
for (const k of Array.from(g.querySelectorAll(yn)))
|
|
1972
|
+
const m = g === p && (l || c !== null && c.line === _);
|
|
1973
|
+
for (const k of Array.from(g.querySelectorAll(yn))) Bs(k, !m);
|
|
1974
1974
|
}
|
|
1975
1975
|
}
|
|
1976
1976
|
const S = p ?? b ?? s.querySelector("tr[data-grid-line] > *");
|
|
@@ -1984,15 +1984,15 @@ function Gs({
|
|
|
1984
1984
|
}
|
|
1985
1985
|
function $s(e, t, n) {
|
|
1986
1986
|
return e ? {
|
|
1987
|
-
line:
|
|
1987
|
+
line: Pt(
|
|
1988
1988
|
t.map((o) => o.key),
|
|
1989
1989
|
e.line,
|
|
1990
1990
|
e.lineIndex
|
|
1991
1991
|
),
|
|
1992
|
-
column:
|
|
1992
|
+
column: Pt(n, e.column, e.columnIndex)
|
|
1993
1993
|
} : { line: Math.min(1, t.length - 1), column: 0 };
|
|
1994
1994
|
}
|
|
1995
|
-
const
|
|
1995
|
+
const Ks = {
|
|
1996
1996
|
ArrowLeft: "left",
|
|
1997
1997
|
ArrowRight: "right",
|
|
1998
1998
|
ArrowUp: "up",
|
|
@@ -2001,117 +2001,117 @@ const zs = {
|
|
|
2001
2001
|
End: "lineEnd",
|
|
2002
2002
|
PageUp: "pageUp",
|
|
2003
2003
|
PageDown: "pageDown"
|
|
2004
|
-
},
|
|
2004
|
+
}, Hs = (e) => (e == null ? void 0 : e.spec.edit) !== void 0;
|
|
2005
2005
|
function _n(e, t) {
|
|
2006
2006
|
const n = (o) => Q(o) || o === "" ? null : o instanceof Date ? o.getTime() : o;
|
|
2007
2007
|
return Object.is(n(e), n(t));
|
|
2008
2008
|
}
|
|
2009
|
-
function
|
|
2010
|
-
const { grid: t, lines: n, ids: o, columnById: r, rowKey: s, virtual: i, onCellEdit:
|
|
2009
|
+
function js(e) {
|
|
2010
|
+
const { grid: t, lines: n, ids: o, columnById: r, rowKey: s, virtual: i, onCellEdit: l, select: c } = e, { setState: a } = t, f = n.map((m) => m.key), d = (m) => {
|
|
2011
2011
|
var k;
|
|
2012
|
-
return (k = n.find((
|
|
2012
|
+
return (k = n.find((T) => T.key === m)) == null ? void 0 : k.row;
|
|
2013
2013
|
}, p = (m) => {
|
|
2014
2014
|
const k = n[m.line];
|
|
2015
2015
|
return (k == null ? void 0 : k.row) !== void 0 && k.key === qe(s(k.row)) ? { row: k.row } : null;
|
|
2016
|
-
}, b = (m) => p(m) !== null &&
|
|
2016
|
+
}, b = (m) => p(m) !== null && Hs(r(o[m.column] ?? "")), S = (m, k = t.state.active) => k && k.line === m.line && k.columnIndex >= m.column && k.columnIndex < m.end ? k.columnIndex : m.column, v = (m, k) => {
|
|
2017
2017
|
var N;
|
|
2018
|
-
const
|
|
2019
|
-
if (!
|
|
2020
|
-
|
|
2021
|
-
const y = Array.from(m.querySelectorAll("tr[data-grid-line]")).find((
|
|
2022
|
-
M ? M.focus({ preventScroll:
|
|
2023
|
-
},
|
|
2024
|
-
const
|
|
2025
|
-
t.focus.want("editor"),
|
|
2018
|
+
const T = n[k.line];
|
|
2019
|
+
if (!T) return;
|
|
2020
|
+
a((I) => ({ ...I, widget: !1, active: { line: T.key, column: o[k.column] ?? "", lineIndex: k.line, columnIndex: k.column } }));
|
|
2021
|
+
const y = Array.from(m.querySelectorAll("tr[data-grid-line]")).find((I) => I.dataset.gridLine === T.key), M = y ? (N = Ct(y).find((I) => k.column >= I.start && k.column < I.end)) == null ? void 0 : N.cell : void 0;
|
|
2022
|
+
M ? M.focus({ preventScroll: T.key === "head" }) : (t.focus.want("cell"), i && T.at >= 0 && i.showRow(T.at));
|
|
2023
|
+
}, O = (m, k) => {
|
|
2024
|
+
const T = n[m.line], y = r(o[m.column] ?? "");
|
|
2025
|
+
t.focus.want("editor"), a((M) => ({
|
|
2026
2026
|
...M,
|
|
2027
|
-
active: { line:
|
|
2028
|
-
editing: { line:
|
|
2027
|
+
active: { line: T.key, column: y.spec.id, lineIndex: m.line, columnIndex: m.column },
|
|
2028
|
+
editing: { line: T.key, column: y.spec.id, draft: k === void 0 ? y.read(T.row) : k, error: null }
|
|
2029
2029
|
}));
|
|
2030
2030
|
}, w = (m) => {
|
|
2031
|
-
var N,
|
|
2031
|
+
var N, I;
|
|
2032
2032
|
const k = t.state.editing;
|
|
2033
2033
|
if (!k) return !0;
|
|
2034
|
-
const
|
|
2035
|
-
if (!
|
|
2036
|
-
return
|
|
2037
|
-
const M = (
|
|
2038
|
-
return M ? (
|
|
2034
|
+
const T = r(k.column), y = d(k.line);
|
|
2035
|
+
if (!T || y === void 0)
|
|
2036
|
+
return a((P) => ({ ...P, editing: null })), !0;
|
|
2037
|
+
const M = (I = (N = T.spec).validate) == null ? void 0 : I.call(N, m, y);
|
|
2038
|
+
return M ? (a((P) => ({ ...P, editing: P.editing && { ...P.editing, draft: m, error: M } })), !1) : (_n(m, T.read(y)) || l == null || l({ rowKey: s(y), columnId: T.spec.id, value: m, row: y }), t.focus.want("cell"), a((P) => ({ ...P, editing: null })), !0);
|
|
2039
2039
|
}, _ = () => {
|
|
2040
|
-
t.focus.want("cell"),
|
|
2041
|
-
}, F = (m) =>
|
|
2040
|
+
t.focus.want("cell"), a((m) => ({ ...m, editing: null }));
|
|
2041
|
+
}, F = (m) => a((k) => {
|
|
2042
2042
|
var M, N;
|
|
2043
2043
|
if (!k.editing) return k;
|
|
2044
|
-
const
|
|
2044
|
+
const T = r(k.editing.column), y = k.editing.error === null ? null : ((N = T == null ? void 0 : (M = T.spec).validate) == null ? void 0 : N.call(M, m, d(k.editing.line))) ?? null;
|
|
2045
2045
|
return { ...k, editing: { ...k.editing, draft: m, error: y } };
|
|
2046
2046
|
}), g = (m) => {
|
|
2047
|
-
var
|
|
2047
|
+
var I;
|
|
2048
2048
|
const k = m.currentTarget;
|
|
2049
2049
|
if (m.defaultPrevented) return;
|
|
2050
|
-
const
|
|
2051
|
-
if (!
|
|
2052
|
-
const y = { line: f.indexOf(
|
|
2050
|
+
const T = It(k, m.target);
|
|
2051
|
+
if (!T) return;
|
|
2052
|
+
const y = { line: f.indexOf(T.line), column: S(T) };
|
|
2053
2053
|
if (y.line < 0) return;
|
|
2054
2054
|
const M = t.state.editing;
|
|
2055
|
-
if (M && M.line ===
|
|
2055
|
+
if (M && M.line === T.line && M.column === o[T.column]) {
|
|
2056
2056
|
if (m.key === "Escape")
|
|
2057
2057
|
m.preventDefault(), _();
|
|
2058
2058
|
else if (m.key === "Enter" && !(m.target instanceof HTMLButtonElement))
|
|
2059
2059
|
m.preventDefault(), w(M.draft);
|
|
2060
2060
|
else if (m.key === "Tab") {
|
|
2061
|
-
const
|
|
2062
|
-
if ((
|
|
2063
|
-
|
|
2061
|
+
const P = Ds(n, y, m.shiftKey, b), $ = w(M.draft);
|
|
2062
|
+
if ((P || !$) && m.preventDefault(), !$) return;
|
|
2063
|
+
P ? O(P) : t.focus.want(null);
|
|
2064
2064
|
}
|
|
2065
2065
|
return;
|
|
2066
2066
|
}
|
|
2067
|
-
if (m.target !==
|
|
2068
|
-
(m.key === "Escape" || m.key === "F2") && (m.preventDefault(),
|
|
2067
|
+
if (m.target !== T.cell) {
|
|
2068
|
+
(m.key === "Escape" || m.key === "F2") && (m.preventDefault(), a((P) => ({ ...P, widget: !1 })), T.cell.focus());
|
|
2069
2069
|
return;
|
|
2070
2070
|
}
|
|
2071
2071
|
if (m.altKey || m.metaKey) return;
|
|
2072
|
-
const N = m.ctrlKey ? { Home: "first", End: "last" }[m.key] :
|
|
2072
|
+
const N = m.ctrlKey ? { Home: "first", End: "last" }[m.key] : Ks[m.key];
|
|
2073
2073
|
if (N) {
|
|
2074
|
-
m.preventDefault(), v(k, Ls(n, y, N, Ws(
|
|
2074
|
+
m.preventDefault(), v(k, Ls(n, y, N, Ws(T.cell, k)));
|
|
2075
2075
|
return;
|
|
2076
2076
|
}
|
|
2077
2077
|
if (!m.ctrlKey) {
|
|
2078
2078
|
if (m.key === " ") {
|
|
2079
|
-
const
|
|
2080
|
-
c &&
|
|
2079
|
+
const P = p(y);
|
|
2080
|
+
c && P && (m.preventDefault(), c(P.row));
|
|
2081
2081
|
return;
|
|
2082
2082
|
}
|
|
2083
2083
|
if (m.key === "Enter" || m.key === "F2") {
|
|
2084
2084
|
if (b(y)) {
|
|
2085
|
-
m.preventDefault(),
|
|
2085
|
+
m.preventDefault(), O(y);
|
|
2086
2086
|
return;
|
|
2087
2087
|
}
|
|
2088
|
-
const
|
|
2089
|
-
|
|
2088
|
+
const P = T.cell.querySelector(yn);
|
|
2089
|
+
P && (m.preventDefault(), a(($) => ({ ...$, widget: !0 })), P.focus());
|
|
2090
2090
|
return;
|
|
2091
2091
|
}
|
|
2092
2092
|
if (m.key.length === 1 && b(y)) {
|
|
2093
|
-
const
|
|
2094
|
-
m.preventDefault(),
|
|
2093
|
+
const P = (I = r(o[T.column] ?? "")) == null ? void 0 : I.spec.edit;
|
|
2094
|
+
m.preventDefault(), O(y, P === "text" ? m.key : P === "number" && /\d/.test(m.key) ? Number(m.key) : void 0);
|
|
2095
2095
|
}
|
|
2096
2096
|
}
|
|
2097
2097
|
}, C = (m) => {
|
|
2098
|
-
const k =
|
|
2098
|
+
const k = It(m.currentTarget, m.target);
|
|
2099
2099
|
if (!k) return;
|
|
2100
|
-
const
|
|
2100
|
+
const T = f.indexOf(k.line), y = t.state.editing;
|
|
2101
2101
|
if (y && (y.line !== k.line || y.column !== o[k.column]) && !w(y.draft)) {
|
|
2102
2102
|
t.focus.want("editor");
|
|
2103
2103
|
return;
|
|
2104
2104
|
}
|
|
2105
|
-
t.focus.want(null),
|
|
2105
|
+
t.focus.want(null), a((M) => {
|
|
2106
2106
|
const N = S(k, M.active);
|
|
2107
2107
|
return {
|
|
2108
2108
|
...M,
|
|
2109
2109
|
widget: m.target !== k.cell,
|
|
2110
|
-
active: { line: k.line, column: o[N] ?? "", lineIndex: Math.max(0,
|
|
2110
|
+
active: { line: k.line, column: o[N] ?? "", lineIndex: Math.max(0, T), columnIndex: N }
|
|
2111
2111
|
};
|
|
2112
2112
|
});
|
|
2113
2113
|
}, A = (m) => {
|
|
2114
|
-
m.currentTarget.contains(m.relatedTarget) ||
|
|
2114
|
+
m.currentTarget.contains(m.relatedTarget) || a((k) => k.widget ? { ...k, widget: !1 } : k);
|
|
2115
2115
|
}, L = { editing: t.state.editing, setDraft: F, commit: w };
|
|
2116
2116
|
return { onKeyDown: g, onFocus: C, onBlur: A, context: L, editable: b };
|
|
2117
2117
|
}
|
|
@@ -2121,7 +2121,7 @@ function Ws(e, t) {
|
|
|
2121
2121
|
return n > 0 ? Math.max(1, Math.floor(r / n) - 1) : 10;
|
|
2122
2122
|
}
|
|
2123
2123
|
function qs({ entry: e, row: t, rowName: n, grid: o }) {
|
|
2124
|
-
const r = be(), s = ce(null), { spec: i } = e,
|
|
2124
|
+
const r = be(), s = ce(null), { spec: i } = e, l = o.editing, c = l.draft, a = o.wording.editCell(i.label, n);
|
|
2125
2125
|
let f;
|
|
2126
2126
|
if (typeof i.edit == "function")
|
|
2127
2127
|
f = i.edit({
|
|
@@ -2129,8 +2129,8 @@ function qs({ entry: e, row: t, rowName: n, grid: o }) {
|
|
|
2129
2129
|
onChange: o.setDraft,
|
|
2130
2130
|
commit: (d) => o.commit(d === void 0 ? c : d),
|
|
2131
2131
|
row: t,
|
|
2132
|
-
invalid:
|
|
2133
|
-
label:
|
|
2132
|
+
invalid: l.error !== null,
|
|
2133
|
+
label: a
|
|
2134
2134
|
});
|
|
2135
2135
|
else if (i.edit === "number")
|
|
2136
2136
|
f = /* @__PURE__ */ u(nt, { size: "sm", value: typeof c == "number" ? c : null, onChange: o.setDraft });
|
|
@@ -2138,22 +2138,22 @@ function qs({ entry: e, row: t, rowName: n, grid: o }) {
|
|
|
2138
2138
|
f = /* @__PURE__ */ u(Ln, { size: "sm", value: c instanceof Date ? c : null, onChange: (d) => o.commit(d) });
|
|
2139
2139
|
else if (i.edit === "select") {
|
|
2140
2140
|
const d = i.editOptions ?? st(o.hook.admitted, e.read, r).values, p = d.findIndex((b) => _n(b, c));
|
|
2141
|
-
f = /* @__PURE__ */
|
|
2141
|
+
f = /* @__PURE__ */ R(Jt, { selectSize: "sm", value: p < 0 ? "" : String(p), onChange: (b) => o.setDraft(d[Number(b.target.value)]), children: [
|
|
2142
2142
|
p < 0 && /* @__PURE__ */ u("option", { value: "" }),
|
|
2143
2143
|
d.map((b, S) => /* @__PURE__ */ u("option", { value: S, children: b instanceof Date ? r.date(b) : String(b) }, S))
|
|
2144
2144
|
] });
|
|
2145
2145
|
} else
|
|
2146
2146
|
f = /* @__PURE__ */ u(Xt, { size: "sm", value: Q(c) ? "" : String(c), onChange: (d) => o.setDraft(d.target.value) });
|
|
2147
|
-
return /* @__PURE__ */
|
|
2148
|
-
/* @__PURE__ */ u(tt, { className: h.editorField, label: /* @__PURE__ */ u(De, { children:
|
|
2149
|
-
/* @__PURE__ */ u(pt, { open:
|
|
2150
|
-
}, anchorRef: s, restoreFocus: !1, offset: 4, className: h.editorMessage, children: /* @__PURE__ */ u("span", { "aria-hidden": "true", children:
|
|
2147
|
+
return /* @__PURE__ */ R("div", { ref: s, className: h.editor, children: [
|
|
2148
|
+
/* @__PURE__ */ u(tt, { className: h.editorField, label: /* @__PURE__ */ u(De, { children: a }), error: l.error ?? void 0, children: f }),
|
|
2149
|
+
/* @__PURE__ */ u(pt, { open: l.error !== null, onOpenChange: () => {
|
|
2150
|
+
}, anchorRef: s, restoreFocus: !1, offset: 4, className: h.editorMessage, children: /* @__PURE__ */ u("span", { "aria-hidden": "true", children: l.error }) })
|
|
2151
2151
|
] });
|
|
2152
2152
|
}
|
|
2153
2153
|
function Us(e) {
|
|
2154
2154
|
const t = typeof e.value == "string" ? e.value : void 0;
|
|
2155
2155
|
let n = e.id ?? t;
|
|
2156
|
-
return n === void 0 && (
|
|
2156
|
+
return n === void 0 && (ae(`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 && ae(`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" && ae(`children:${n}`, `The children of the column "${n}" are not a function and are passed over.`), {
|
|
2157
2157
|
id: n,
|
|
2158
2158
|
label: e.label,
|
|
2159
2159
|
value: e.value,
|
|
@@ -2182,63 +2182,63 @@ function Us(e) {
|
|
|
2182
2182
|
function Ys(e, t, n, o, r) {
|
|
2183
2183
|
if (!t) return n.rowKey(e);
|
|
2184
2184
|
const s = t.read(e);
|
|
2185
|
-
return Q(s) ? r.cellAbsentValue :
|
|
2185
|
+
return Q(s) ? r.cellAbsentValue : Re(s, t.spec.format, o, r) ?? n.rowKey(e);
|
|
2186
2186
|
}
|
|
2187
2187
|
function Js(e) {
|
|
2188
2188
|
function t(c) {
|
|
2189
|
-
const
|
|
2190
|
-
return e.registerColumn(
|
|
2189
|
+
const a = me(), f = He(at), d = Us(c);
|
|
2190
|
+
return e.registerColumn(a, d), X(
|
|
2191
2191
|
() => () => {
|
|
2192
|
-
e.removeColumn(
|
|
2192
|
+
e.removeColumn(a), e.commit();
|
|
2193
2193
|
},
|
|
2194
|
-
[
|
|
2194
|
+
[a]
|
|
2195
2195
|
), X(() => {
|
|
2196
|
-
e.ensureColumn(
|
|
2197
|
-
}), nn && f && f.registry !== e &&
|
|
2196
|
+
e.ensureColumn(a, d), e.checkOrder(), e.commit();
|
|
2197
|
+
}), nn && f && f.registry !== e && ae(
|
|
2198
2198
|
`foreign:${d.id}`,
|
|
2199
2199
|
`The column "${d.id}" comes from a different useTable call than the table it stands in. It reads the rows of its own hook.`
|
|
2200
|
-
), /* @__PURE__ */ u("span", { hidden: !0, "data-umriss-column":
|
|
2200
|
+
), /* @__PURE__ */ u("span", { hidden: !0, "data-umriss-column": a });
|
|
2201
2201
|
}
|
|
2202
2202
|
function n({ children: c }) {
|
|
2203
|
-
const
|
|
2204
|
-
return e.registerDetail(
|
|
2203
|
+
const a = me();
|
|
2204
|
+
return e.registerDetail(a, c), X(
|
|
2205
2205
|
() => () => {
|
|
2206
|
-
e.removeDetail(
|
|
2206
|
+
e.removeDetail(a), e.commit();
|
|
2207
2207
|
},
|
|
2208
|
-
[
|
|
2208
|
+
[a]
|
|
2209
2209
|
), X(() => {
|
|
2210
|
-
e.detail || e.registerDetail(
|
|
2210
|
+
e.detail || e.registerDetail(a, c), e.commit();
|
|
2211
2211
|
}), null;
|
|
2212
2212
|
}
|
|
2213
2213
|
function o({ children: c }) {
|
|
2214
|
-
const
|
|
2215
|
-
return e.registerActionGroup(
|
|
2214
|
+
const a = me();
|
|
2215
|
+
return e.registerActionGroup(a), X(
|
|
2216
2216
|
() => () => {
|
|
2217
|
-
e.removeActionGroup(
|
|
2217
|
+
e.removeActionGroup(a), e.commit();
|
|
2218
2218
|
},
|
|
2219
|
-
[
|
|
2219
|
+
[a]
|
|
2220
2220
|
), X(() => {
|
|
2221
|
-
e.registerActionGroup(
|
|
2221
|
+
e.registerActionGroup(a), e.commit();
|
|
2222
2222
|
}), /* @__PURE__ */ u(ne, { children: c });
|
|
2223
2223
|
}
|
|
2224
2224
|
function r(c) {
|
|
2225
|
-
const
|
|
2225
|
+
const a = me(), f = {
|
|
2226
2226
|
label: c.children,
|
|
2227
2227
|
bulk: c.bulk === !0,
|
|
2228
2228
|
tone: c.tone ?? "default",
|
|
2229
2229
|
onSelect: c.onSelect
|
|
2230
2230
|
};
|
|
2231
|
-
return e.registerAction(
|
|
2231
|
+
return e.registerAction(a, f), X(
|
|
2232
2232
|
() => () => {
|
|
2233
|
-
e.removeAction(
|
|
2233
|
+
e.removeAction(a), e.commit();
|
|
2234
2234
|
},
|
|
2235
|
-
[
|
|
2235
|
+
[a]
|
|
2236
2236
|
), X(() => {
|
|
2237
|
-
e.ensureAction(
|
|
2238
|
-
}), /* @__PURE__ */ u("span", { hidden: !0, "data-umriss-action":
|
|
2237
|
+
e.ensureAction(a, f), e.checkOrder(), e.commit();
|
|
2238
|
+
}), /* @__PURE__ */ u("span", { hidden: !0, "data-umriss-action": a });
|
|
2239
2239
|
}
|
|
2240
2240
|
function s(c) {
|
|
2241
|
-
const
|
|
2241
|
+
const a = me(), f = typeof c.value == "string" ? c.value : void 0, p = {
|
|
2242
2242
|
id: c.id ?? f ?? c.label,
|
|
2243
2243
|
label: c.label,
|
|
2244
2244
|
value: c.value,
|
|
@@ -2248,34 +2248,34 @@ function Js(e) {
|
|
|
2248
2248
|
group: c.group,
|
|
2249
2249
|
groupable: !0
|
|
2250
2250
|
};
|
|
2251
|
-
return e.registerGroupKey(
|
|
2251
|
+
return e.registerGroupKey(a, p), X(
|
|
2252
2252
|
() => () => {
|
|
2253
|
-
e.removeGroupKey(
|
|
2253
|
+
e.removeGroupKey(a), e.commit();
|
|
2254
2254
|
},
|
|
2255
|
-
[
|
|
2255
|
+
[a]
|
|
2256
2256
|
), X(() => {
|
|
2257
|
-
e.ensureGroupKey(
|
|
2258
|
-
}), /* @__PURE__ */ u("span", { hidden: !0, "data-umriss-groupkey":
|
|
2257
|
+
e.ensureGroupKey(a, p), e.checkOrder(), e.commit();
|
|
2258
|
+
}), /* @__PURE__ */ u("span", { hidden: !0, "data-umriss-groupkey": a });
|
|
2259
2259
|
}
|
|
2260
2260
|
function i(c) {
|
|
2261
|
-
e.beginPass(), e.setStickyRowHeader(c.stickyRowHeader === !0), e.setTableGroupable(c.groupable !== !1), e.manual && c.groupable === !0 &&
|
|
2262
|
-
const
|
|
2261
|
+
e.beginPass(), e.setStickyRowHeader(c.stickyRowHeader === !0), e.setTableGroupable(c.groupable !== !1), e.manual && c.groupable === !0 && ae("manual-groupable", "`groupable` is passed over in manual mode: the groups would be the page's, not the server's.");
|
|
2262
|
+
const a = ce(null), [f, d] = W(null);
|
|
2263
2263
|
X(() => {
|
|
2264
|
-
e.children =
|
|
2264
|
+
e.children = a.current, e.checkOrder(), e.commit();
|
|
2265
2265
|
});
|
|
2266
2266
|
const p = q(() => ({ registry: e, footerTarget: f }), [f]);
|
|
2267
|
-
return /* @__PURE__ */ u(
|
|
2268
|
-
/* @__PURE__ */ u("div", { ref:
|
|
2267
|
+
return /* @__PURE__ */ u(at.Provider, { value: p, children: /* @__PURE__ */ R("div", { className: K(h.frame, c.className), children: [
|
|
2268
|
+
/* @__PURE__ */ u("div", { ref: a, className: h.children, children: c.children }),
|
|
2269
2269
|
/* @__PURE__ */ u(Xs, { registry: e }),
|
|
2270
2270
|
/* @__PURE__ */ u(Qs, { registry: e, props: c }),
|
|
2271
2271
|
/* @__PURE__ */ u("div", { ref: d, className: h.footerTarget })
|
|
2272
2272
|
] }) });
|
|
2273
2273
|
}
|
|
2274
|
-
const
|
|
2275
|
-
return
|
|
2274
|
+
const l = { Table: i, Column: t, RowDetail: n, RowActions: o, Action: r, GroupBy: s };
|
|
2275
|
+
return as(i, e), l;
|
|
2276
2276
|
}
|
|
2277
2277
|
function Xs({ registry: e }) {
|
|
2278
|
-
return
|
|
2278
|
+
return je(e.subscribe, e.bodyVersion, e.bodyVersion), !e.hook || !e.needsOwnToolbar() ? null : /* @__PURE__ */ u(fn, { registry: e, own: !0 });
|
|
2279
2279
|
}
|
|
2280
2280
|
function Qs({ registry: e, props: t }) {
|
|
2281
2281
|
const {
|
|
@@ -2284,59 +2284,59 @@ function Qs({ registry: e, props: t }) {
|
|
|
2284
2284
|
striped: r = !1,
|
|
2285
2285
|
density: s,
|
|
2286
2286
|
maxHeight: i,
|
|
2287
|
-
empty:
|
|
2287
|
+
empty: l,
|
|
2288
2288
|
loading: c = !1,
|
|
2289
|
-
rowProps:
|
|
2289
|
+
rowProps: a,
|
|
2290
2290
|
ariaLabel: f,
|
|
2291
2291
|
grid: d = !1
|
|
2292
2292
|
} = t;
|
|
2293
|
-
|
|
2294
|
-
const p = re(), b = be(), S = Qt(s, "regular"), v = me(),
|
|
2293
|
+
je(e.subscribe, e.bodyVersion, e.bodyVersion);
|
|
2294
|
+
const p = re(), b = be(), S = Qt(s, "regular"), v = me(), O = ce(null), w = Is();
|
|
2295
2295
|
X(() => {
|
|
2296
|
-
var oe,
|
|
2297
|
-
const x =
|
|
2296
|
+
var oe, B, z;
|
|
2297
|
+
const x = O.current;
|
|
2298
2298
|
if (x != null && x.parentElement && !o && x.parentElement.style.removeProperty("scroll-padding-top"), !x || !o) return;
|
|
2299
|
-
const E = ((oe = x.tHead) == null ? void 0 : oe.getBoundingClientRect().height) ?? 0, ie = ((
|
|
2300
|
-
x.style.setProperty("--u-table-head", `${E}px`), x.style.setProperty("--u-table-group-header", `${ie}px`), (
|
|
2299
|
+
const E = ((oe = x.tHead) == null ? void 0 : oe.getBoundingClientRect().height) ?? 0, ie = ((B = x.querySelector("tr[data-line='header']")) == null ? void 0 : B.getBoundingClientRect().height) ?? 0;
|
|
2300
|
+
x.style.setProperty("--u-table-head", `${E}px`), x.style.setProperty("--u-table-group-header", `${ie}px`), (z = x.parentElement) == null || z.style.setProperty("scroll-padding-top", `${E}px`), x.parentElement && Vt(x.parentElement);
|
|
2301
2301
|
}), X(() => {
|
|
2302
|
-
const x = e.takeFocusBeforeFold(), E =
|
|
2302
|
+
const x = e.takeFocusBeforeFold(), E = O.current;
|
|
2303
2303
|
if (!x || !E || x.table !== E || x.element.isConnected) return;
|
|
2304
2304
|
const ie = Array.from(E.querySelectorAll("[data-fold-path]")), oe = JSON.parse(x.group);
|
|
2305
|
-
for (let
|
|
2306
|
-
const
|
|
2307
|
-
if (
|
|
2305
|
+
for (let B = oe.length; B > 0; B--) {
|
|
2306
|
+
const z = JSON.stringify(oe.slice(0, B)), V = ie.find((ee) => ee.dataset.foldPath === z);
|
|
2307
|
+
if (V) return V.focus();
|
|
2308
2308
|
}
|
|
2309
2309
|
});
|
|
2310
2310
|
const _ = ce(null);
|
|
2311
2311
|
X(() => {
|
|
2312
2312
|
var oe;
|
|
2313
|
-
const x = (oe =
|
|
2313
|
+
const x = (oe = O.current) == null ? void 0 : oe.tBodies[0];
|
|
2314
2314
|
if (!x || !e.manual) return;
|
|
2315
2315
|
if (!c) {
|
|
2316
|
-
const
|
|
2317
|
-
if (
|
|
2316
|
+
const B = Array.from(x.querySelectorAll(":scope > tr[data-motion]"));
|
|
2317
|
+
if (B.length === 0) return;
|
|
2318
2318
|
_.current = {
|
|
2319
|
-
height:
|
|
2320
|
-
widths: Array.from(
|
|
2319
|
+
height: B.reduce((z, V) => z + V.getBoundingClientRect().height, 0) / B.length,
|
|
2320
|
+
widths: Array.from(B[0].cells, (z) => z.getBoundingClientRect().width)
|
|
2321
2321
|
};
|
|
2322
2322
|
return;
|
|
2323
2323
|
}
|
|
2324
2324
|
const E = _.current;
|
|
2325
2325
|
if (!E) return;
|
|
2326
|
-
for (const
|
|
2326
|
+
for (const B of Array.from(x.rows)) B.style.height = `${E.height}px`;
|
|
2327
2327
|
const ie = x.rows[0];
|
|
2328
|
-
(ie == null ? void 0 : ie.cells.length) === E.widths.length && Array.from(ie.cells).forEach((
|
|
2328
|
+
(ie == null ? void 0 : ie.cells.length) === E.widths.length && Array.from(ie.cells).forEach((B, z) => B.style.width = `${E.widths[z]}px`);
|
|
2329
2329
|
});
|
|
2330
2330
|
const F = e.hook && !e.hook.companion.virtual ? e.hook.publicSnapshot : null;
|
|
2331
|
-
|
|
2331
|
+
Ts(O, F ? `${F.grouping.join("|")}#${F.folded.join("|")}` : "");
|
|
2332
2332
|
const g = e.hook;
|
|
2333
2333
|
if (!g) return null;
|
|
2334
|
-
const C = g.publicSnapshot, A = e.projection(), L = e.rowHeader(), m = un(e), k = e.detail,
|
|
2334
|
+
const C = g.publicSnapshot, A = e.projection(), L = e.rowHeader(), m = un(e), k = e.detail, T = e.hasRowActions() ? e.actions.ordered() : [], y = g.companion.virtual, M = C.grouping, N = M.length > 0 ? A.visibleLines : void 0, I = N ? e.groupingEntries(g.rows) : [], P = (x) => I.find((E) => E.spec.id === x), $ = N && M.length > 1 ? P(M.at(-1)) : void 0, U = N ? m.filter((x) => !M.includes(x.spec.id)) : m, Z = (n ? 1 : 0) + (k ? 1 : 0), he = Z + ($ ? 1 : 0), se = he + U.length + (T.length > 0 ? 1 : 0), we = e.pins(), Ce = U.filter((x) => we[x.spec.id] === "start").length, Oe = U.filter((x) => we[x.spec.id] === "end").length, xe = $ !== void 0 && we[$.spec.id] === "start", ue = {
|
|
2335
2335
|
start: Ce > 0 || xe ? he + Ce : 0,
|
|
2336
|
-
end:
|
|
2336
|
+
end: Oe > 0 ? Oe + (T.length > 0 ? 1 : 0) : 0,
|
|
2337
2337
|
count: se
|
|
2338
2338
|
}, Y = (x, E = x) => St(ue, x, E), ge = A.visible, ye = !c && !C.manual && U.some((x) => x.spec.aggregate), Ne = C.search !== "" || Object.keys(C.filter).length > 0, _e = d ? Fs({
|
|
2339
|
-
layout: { controls: Z, span: $ !== void 0, aggregates: U.map((x) => x.spec.aggregate !== void 0), actions:
|
|
2339
|
+
layout: { controls: Z, span: $ !== void 0, aggregates: U.map((x) => x.spec.aggregate !== void 0), actions: T.length > 0, blocks: ue },
|
|
2340
2340
|
body: c ? { rows: [] } : N ? { lines: y ? A.lines : N } : { rows: y ? A.filtered : ge },
|
|
2341
2341
|
rowKey: g.rowKey,
|
|
2342
2342
|
expanded: new Set(k ? C.expanded : []),
|
|
@@ -2346,8 +2346,8 @@ function Qs({ registry: e, props: t }) {
|
|
|
2346
2346
|
...k ? ["#detail"] : [],
|
|
2347
2347
|
...$ ? ["#span"] : [],
|
|
2348
2348
|
...U.map((x) => x.spec.id),
|
|
2349
|
-
...
|
|
2350
|
-
], J = d ?
|
|
2349
|
+
...T.length > 0 ? ["#actions"] : []
|
|
2350
|
+
], J = d ? js({
|
|
2351
2351
|
grid: w,
|
|
2352
2352
|
lines: _e,
|
|
2353
2353
|
ids: ke,
|
|
@@ -2369,10 +2369,10 @@ function Qs({ registry: e, props: t }) {
|
|
|
2369
2369
|
spanEntry: $,
|
|
2370
2370
|
header: L,
|
|
2371
2371
|
selectable: n,
|
|
2372
|
-
actions:
|
|
2372
|
+
actions: T,
|
|
2373
2373
|
blocks: ue,
|
|
2374
2374
|
columnCount: se,
|
|
2375
|
-
rowProps:
|
|
2375
|
+
rowProps: a,
|
|
2376
2376
|
baseId: v,
|
|
2377
2377
|
formats: b,
|
|
2378
2378
|
wording: p,
|
|
@@ -2380,9 +2380,9 @@ function Qs({ registry: e, props: t }) {
|
|
|
2380
2380
|
},
|
|
2381
2381
|
g.rowKey(x)
|
|
2382
2382
|
);
|
|
2383
|
-
let
|
|
2383
|
+
let H;
|
|
2384
2384
|
if (c)
|
|
2385
|
-
|
|
2385
|
+
H = /* @__PURE__ */ u("tbody", { children: /* @__PURE__ */ u(
|
|
2386
2386
|
si,
|
|
2387
2387
|
{
|
|
2388
2388
|
columns: se,
|
|
@@ -2394,61 +2394,61 @@ function Qs({ registry: e, props: t }) {
|
|
|
2394
2394
|
}
|
|
2395
2395
|
) });
|
|
2396
2396
|
else if (A.filtered.length === 0)
|
|
2397
|
-
|
|
2397
|
+
H = /* @__PURE__ */ u("tbody", { children: /* @__PURE__ */ u("tr", { "data-grid-line": D("empty"), children: /* @__PURE__ */ u("td", { colSpan: se, className: h.emptyCell, children: /* @__PURE__ */ u("div", { className: h.empty, children: (C.manual || g.admitted.length > 0) && Ne ? /* @__PURE__ */ R(ne, { children: [
|
|
2398
2398
|
/* @__PURE__ */ u("p", { className: h.emptyTitle, children: p.nothingMatchesFilters }),
|
|
2399
2399
|
/* @__PURE__ */ u(fe, { size: "sm", variant: "ghost", onClick: () => dn(C), children: p.resetAll })
|
|
2400
|
-
] }) :
|
|
2400
|
+
] }) : l ?? /* @__PURE__ */ u("p", { className: h.emptyTitle, children: p.noEntries }) }) }) }) });
|
|
2401
2401
|
else if (N) {
|
|
2402
|
-
const x = y ? tn(N).map((
|
|
2402
|
+
const x = y ? tn(N).map((B) => B.kind === "folded" || !B.continued ? B : { ...B, continued: !1 }) : N, E = x.length - N.length, ie = y && y.from > 0 ? y.fillerBefore / y.from : 0, oe = (B, z) => {
|
|
2403
2403
|
var de, pe;
|
|
2404
|
-
const
|
|
2405
|
-
return
|
|
2406
|
-
|
|
2404
|
+
const V = z - E, ee = y ? y.from + V : V;
|
|
2405
|
+
return V < 0 ? B.kind === "row" ? null : /* @__PURE__ */ u(
|
|
2406
|
+
zt,
|
|
2407
2407
|
{
|
|
2408
|
-
line:
|
|
2409
|
-
index:
|
|
2408
|
+
line: B,
|
|
2409
|
+
index: z,
|
|
2410
2410
|
absolute: void 0,
|
|
2411
2411
|
spanEntry: $,
|
|
2412
|
-
levelEntry:
|
|
2412
|
+
levelEntry: P(M[B.group.level]),
|
|
2413
2413
|
columns: U,
|
|
2414
2414
|
controlColumns: Z,
|
|
2415
2415
|
blocks: ue,
|
|
2416
2416
|
selectable: n,
|
|
2417
|
-
hasActions:
|
|
2417
|
+
hasActions: T.length > 0,
|
|
2418
2418
|
total: A.filtered,
|
|
2419
|
-
siblings: ((de =
|
|
2419
|
+
siblings: ((de = B.parents.at(-1)) == null ? void 0 : de.groups) ?? A.groups ?? [],
|
|
2420
2420
|
depth: M.length,
|
|
2421
2421
|
grid: d,
|
|
2422
2422
|
hook: g,
|
|
2423
2423
|
formats: b,
|
|
2424
2424
|
wording: p
|
|
2425
2425
|
},
|
|
2426
|
-
`${
|
|
2427
|
-
) :
|
|
2428
|
-
|
|
2426
|
+
`${B.kind}:${B.group.path}:repeated`
|
|
2427
|
+
) : B.kind === "row" ? G(B.row, V, ee, B) : /* @__PURE__ */ u(
|
|
2428
|
+
zt,
|
|
2429
2429
|
{
|
|
2430
|
-
line:
|
|
2431
|
-
index:
|
|
2430
|
+
line: B,
|
|
2431
|
+
index: V,
|
|
2432
2432
|
absolute: y ? ee : void 0,
|
|
2433
2433
|
spanEntry: $,
|
|
2434
|
-
levelEntry:
|
|
2434
|
+
levelEntry: P(M[B.group.level]),
|
|
2435
2435
|
columns: U,
|
|
2436
2436
|
controlColumns: Z,
|
|
2437
2437
|
blocks: ue,
|
|
2438
2438
|
selectable: n,
|
|
2439
|
-
hasActions:
|
|
2439
|
+
hasActions: T.length > 0,
|
|
2440
2440
|
total: A.filtered,
|
|
2441
|
-
siblings: ((pe =
|
|
2441
|
+
siblings: ((pe = B.parents.at(-1)) == null ? void 0 : pe.groups) ?? A.groups ?? [],
|
|
2442
2442
|
depth: M.length,
|
|
2443
2443
|
grid: d,
|
|
2444
2444
|
hook: g,
|
|
2445
2445
|
formats: b,
|
|
2446
2446
|
wording: p
|
|
2447
2447
|
},
|
|
2448
|
-
`${
|
|
2448
|
+
`${B.kind}:${B.group.path}${B.kind === "header" && B.continued ? ":continued" : ""}`
|
|
2449
2449
|
);
|
|
2450
2450
|
};
|
|
2451
|
-
|
|
2451
|
+
H = y ? /* @__PURE__ */ u(
|
|
2452
2452
|
$t,
|
|
2453
2453
|
{
|
|
2454
2454
|
virtual: { ...y, fillerBefore: Math.max(0, y.fillerBefore - E * ie) },
|
|
@@ -2456,21 +2456,21 @@ function Qs({ registry: e, props: t }) {
|
|
|
2456
2456
|
children: x.map(oe)
|
|
2457
2457
|
}
|
|
2458
2458
|
) : /* @__PURE__ */ u("tbody", { children: N.map(oe) });
|
|
2459
|
-
} else y ?
|
|
2460
|
-
return /* @__PURE__ */
|
|
2459
|
+
} else y ? H = /* @__PURE__ */ u($t, { virtual: y, colSpan: se, children: ge.map((x, E) => G(x, E, y.from + E)) }) : H = /* @__PURE__ */ u("tbody", { children: ge.map((x, E) => G(x, E, E)) });
|
|
2460
|
+
return /* @__PURE__ */ R(
|
|
2461
2461
|
"div",
|
|
2462
2462
|
{
|
|
2463
2463
|
ref: y == null ? void 0 : y.scrollRef,
|
|
2464
2464
|
onScroll: (x) => {
|
|
2465
|
-
y == null || y.onScroll(), N && o &&
|
|
2465
|
+
y == null || y.onScroll(), N && o && Vt(x.currentTarget), (ue.start || ue.end) && kn(x.currentTarget);
|
|
2466
2466
|
},
|
|
2467
2467
|
className: h.scroll,
|
|
2468
2468
|
style: i ? { maxHeight: i } : void 0,
|
|
2469
2469
|
children: [
|
|
2470
|
-
/* @__PURE__ */
|
|
2470
|
+
/* @__PURE__ */ R(
|
|
2471
2471
|
"table",
|
|
2472
2472
|
{
|
|
2473
|
-
ref:
|
|
2473
|
+
ref: O,
|
|
2474
2474
|
role: N ? "treegrid" : d ? "grid" : void 0,
|
|
2475
2475
|
"aria-readonly": d && !U.some((x) => x.spec.edit !== void 0) ? !0 : void 0,
|
|
2476
2476
|
onKeyDown: J == null ? void 0 : J.onKeyDown,
|
|
@@ -2481,7 +2481,7 @@ function Qs({ registry: e, props: t }) {
|
|
|
2481
2481
|
"aria-label": f,
|
|
2482
2482
|
"aria-rowcount": y ? (A.lines ?? A.filtered).length + 1 + (ye ? 1 : 0) : void 0,
|
|
2483
2483
|
"aria-busy": c || void 0,
|
|
2484
|
-
className:
|
|
2484
|
+
className: K(
|
|
2485
2485
|
h.table,
|
|
2486
2486
|
S === "compact" && h.compact,
|
|
2487
2487
|
o && h.sticky,
|
|
@@ -2489,8 +2489,8 @@ function Qs({ registry: e, props: t }) {
|
|
|
2489
2489
|
d && h.grid
|
|
2490
2490
|
),
|
|
2491
2491
|
children: [
|
|
2492
|
-
/* @__PURE__ */ u("thead", { children: /* @__PURE__ */
|
|
2493
|
-
n && /* @__PURE__ */ u("th", { scope: "col", className:
|
|
2492
|
+
/* @__PURE__ */ u("thead", { children: /* @__PURE__ */ R("tr", { "aria-rowindex": y ? 1 : void 0, "data-grid-line": D("head"), children: [
|
|
2493
|
+
n && /* @__PURE__ */ u("th", { scope: "col", className: K(h.th, h.control, Y(0).className), style: Y(0).style, children: /* @__PURE__ */ u(
|
|
2494
2494
|
Le,
|
|
2495
2495
|
{
|
|
2496
2496
|
"aria-label": C.manual ? p.selectAllOnPage : p.selectAllRows,
|
|
@@ -2502,26 +2502,26 @@ function Qs({ registry: e, props: t }) {
|
|
|
2502
2502
|
k && /* @__PURE__ */ u(
|
|
2503
2503
|
"td",
|
|
2504
2504
|
{
|
|
2505
|
-
className:
|
|
2505
|
+
className: K(h.th, h.control, Y(Z - 1).className),
|
|
2506
2506
|
style: Y(Z - 1).style
|
|
2507
2507
|
}
|
|
2508
2508
|
),
|
|
2509
|
-
$ && (e.columnById($.spec.id) === $ ? /* @__PURE__ */ u(
|
|
2510
|
-
U.map((x, E) => /* @__PURE__ */ u(
|
|
2511
|
-
|
|
2509
|
+
$ && (e.columnById($.spec.id) === $ ? /* @__PURE__ */ u(Bt, { entry: $, registry: e, hook: g, pin: Y(Z) }) : /* @__PURE__ */ u("th", { scope: "col", className: K(h.th, Y(Z).className), style: Y(Z).style, children: $.spec.label })),
|
|
2510
|
+
U.map((x, E) => /* @__PURE__ */ u(Bt, { entry: x, registry: e, hook: g, pin: Y(he + E) }, x.key)),
|
|
2511
|
+
T.length > 0 && /* @__PURE__ */ u(
|
|
2512
2512
|
"th",
|
|
2513
2513
|
{
|
|
2514
2514
|
scope: "col",
|
|
2515
|
-
className:
|
|
2515
|
+
className: K(h.th, h.actionsCell, Y(se - 1).className),
|
|
2516
2516
|
style: Y(se - 1).style,
|
|
2517
2517
|
children: /* @__PURE__ */ u(De, { children: p.rowActions })
|
|
2518
2518
|
}
|
|
2519
2519
|
)
|
|
2520
2520
|
] }) }),
|
|
2521
|
-
/* @__PURE__ */ u(wn.Provider, { value: J ? { ...J.context, hook: g, wording: p } : null, children:
|
|
2522
|
-
ye && /* @__PURE__ */ u("tfoot", { children: /* @__PURE__ */
|
|
2523
|
-
Array.from({ length: Z }, (x, E) => /* @__PURE__ */ u("td", { className:
|
|
2524
|
-
$ && /* @__PURE__ */ u("td", { className:
|
|
2521
|
+
/* @__PURE__ */ u(wn.Provider, { value: J ? { ...J.context, hook: g, wording: p } : null, children: H }),
|
|
2522
|
+
ye && /* @__PURE__ */ u("tfoot", { children: /* @__PURE__ */ R("tr", { "aria-rowindex": y ? (A.lines ?? A.filtered).length + 2 : void 0, "data-grid-line": D("foot"), children: [
|
|
2523
|
+
Array.from({ length: Z }, (x, E) => /* @__PURE__ */ u("td", { className: K(h.td, h.control, Y(E).className), style: Y(E).style }, E)),
|
|
2524
|
+
$ && /* @__PURE__ */ u("td", { className: K(h.td, Y(Z).className), style: Y(Z).style }),
|
|
2525
2525
|
U.map((x, E) => /* @__PURE__ */ u(
|
|
2526
2526
|
ni,
|
|
2527
2527
|
{
|
|
@@ -2533,7 +2533,7 @@ function Qs({ registry: e, props: t }) {
|
|
|
2533
2533
|
},
|
|
2534
2534
|
x.key
|
|
2535
2535
|
)),
|
|
2536
|
-
|
|
2536
|
+
T.length > 0 && /* @__PURE__ */ u("td", { className: K(h.td, Y(se - 1).className), style: Y(se - 1).style })
|
|
2537
2537
|
] }) })
|
|
2538
2538
|
]
|
|
2539
2539
|
}
|
|
@@ -2541,7 +2541,7 @@ function Qs({ registry: e, props: t }) {
|
|
|
2541
2541
|
/* @__PURE__ */ u(
|
|
2542
2542
|
Zs,
|
|
2543
2543
|
{
|
|
2544
|
-
table:
|
|
2544
|
+
table: O,
|
|
2545
2545
|
blocks: ue,
|
|
2546
2546
|
pinnedKeys: U.filter((x) => we[x.spec.id]).map((x) => x.key).join("|")
|
|
2547
2547
|
}
|
|
@@ -2549,7 +2549,7 @@ function Qs({ registry: e, props: t }) {
|
|
|
2549
2549
|
d && /* @__PURE__ */ u(
|
|
2550
2550
|
Gs,
|
|
2551
2551
|
{
|
|
2552
|
-
table:
|
|
2552
|
+
table: O,
|
|
2553
2553
|
grid: w,
|
|
2554
2554
|
lines: _e,
|
|
2555
2555
|
ids: ke,
|
|
@@ -2567,58 +2567,58 @@ function Zs({
|
|
|
2567
2567
|
}) {
|
|
2568
2568
|
const { start: o, end: r } = t, s = () => {
|
|
2569
2569
|
var d, p, b, S;
|
|
2570
|
-
const i = e.current,
|
|
2571
|
-
if (!i || !
|
|
2570
|
+
const i = e.current, l = i == null ? void 0 : i.parentElement;
|
|
2571
|
+
if (!i || !l || (l.style.removeProperty("scroll-padding-left"), l.style.removeProperty("scroll-padding-right"), !o && !r)) return;
|
|
2572
2572
|
const c = Array.from(((p = (d = i.tHead) == null ? void 0 : d.rows[0]) == null ? void 0 : p.cells) ?? []);
|
|
2573
|
-
let
|
|
2573
|
+
let a = 0;
|
|
2574
2574
|
for (let v = 0; v < o; v++)
|
|
2575
|
-
i.style.setProperty(`--u-table-pin-start-${v}`, `${
|
|
2575
|
+
i.style.setProperty(`--u-table-pin-start-${v}`, `${a}px`), a += ((b = c[v]) == null ? void 0 : b.getBoundingClientRect().width) ?? 0;
|
|
2576
2576
|
let f = 0;
|
|
2577
2577
|
for (let v = 0; v < r; v++)
|
|
2578
2578
|
i.style.setProperty(`--u-table-pin-end-${v}`, `${f}px`), f += ((S = c[c.length - 1 - v]) == null ? void 0 : S.getBoundingClientRect().width) ?? 0;
|
|
2579
|
-
i.style.setProperty("--u-table-pin-start", `${
|
|
2579
|
+
i.style.setProperty("--u-table-pin-start", `${a}px`), i.style.setProperty("--u-table-pin-end", `${f}px`), a && l.style.setProperty("scroll-padding-left", `${a}px`), f && l.style.setProperty("scroll-padding-right", `${f}px`), kn(l);
|
|
2580
2580
|
};
|
|
2581
|
-
return X(s),
|
|
2582
|
-
var
|
|
2581
|
+
return X(s), jt(() => {
|
|
2582
|
+
var a, f;
|
|
2583
2583
|
const i = e.current;
|
|
2584
2584
|
if (!i || !o && !r || typeof ResizeObserver > "u") return;
|
|
2585
|
-
const
|
|
2586
|
-
for (const d of [...c.slice(0, o), ...c.slice(c.length - r)])
|
|
2587
|
-
return i.parentElement &&
|
|
2585
|
+
const l = new ResizeObserver(s), c = Array.from(((f = (a = i.tHead) == null ? void 0 : a.rows[0]) == null ? void 0 : f.cells) ?? []);
|
|
2586
|
+
for (const d of [...c.slice(0, o), ...c.slice(c.length - r)]) l.observe(d);
|
|
2587
|
+
return i.parentElement && l.observe(i.parentElement), () => l.disconnect();
|
|
2588
2588
|
}, [e, o, r, t.count, n]), null;
|
|
2589
2589
|
}
|
|
2590
2590
|
function kn(e) {
|
|
2591
2591
|
const t = e.scrollWidth - e.clientWidth;
|
|
2592
2592
|
e.toggleAttribute("data-under-start", e.scrollLeft > 0.5), e.toggleAttribute("data-under-end", e.scrollLeft < t - 0.5);
|
|
2593
2593
|
}
|
|
2594
|
-
function
|
|
2594
|
+
function Vt(e) {
|
|
2595
2595
|
for (const t of Array.from(e.querySelectorAll("tbody > tr[data-line='header']"))) {
|
|
2596
2596
|
const n = t.cells[t.cells.length - 1], o = !!n && n.getBoundingClientRect().top > t.getBoundingClientRect().top + 0.5;
|
|
2597
2597
|
t.toggleAttribute("data-stuck", o);
|
|
2598
2598
|
}
|
|
2599
2599
|
}
|
|
2600
|
-
function
|
|
2600
|
+
function Bt({
|
|
2601
2601
|
entry: e,
|
|
2602
2602
|
registry: t,
|
|
2603
2603
|
hook: n,
|
|
2604
2604
|
pin: o
|
|
2605
2605
|
}) {
|
|
2606
|
-
const { spec: r } = e, s = n.publicSnapshot, i = t.kindOf(e, n.rows),
|
|
2606
|
+
const { spec: r } = e, s = n.publicSnapshot, i = t.kindOf(e, n.rows), l = mt(i, r.rightAligned), c = t.isSortable(e, n.rows), a = r.id, f = s.sort.findIndex((C) => C.column === a), d = f === -1 ? void 0 : s.sort[f].direction, p = s.sort.length > 1 && f !== -1 ? f + 1 : void 0, b = s.widths[a], S = 48, v = (C) => {
|
|
2607
2607
|
C.stopPropagation(), C.preventDefault();
|
|
2608
2608
|
const A = C.currentTarget, L = A.closest("th");
|
|
2609
2609
|
if (!L) return;
|
|
2610
|
-
const m = C.clientX, k = L.getBoundingClientRect().width,
|
|
2611
|
-
A.setPointerCapture(
|
|
2610
|
+
const m = C.clientX, k = L.getBoundingClientRect().width, T = C.pointerId;
|
|
2611
|
+
A.setPointerCapture(T);
|
|
2612
2612
|
const y = (N) => {
|
|
2613
|
-
N.pointerId ===
|
|
2613
|
+
N.pointerId === T && s.setWidth(a, Math.max(S, k + (N.clientX - m)));
|
|
2614
2614
|
}, M = (N) => {
|
|
2615
|
-
N.pointerId ===
|
|
2615
|
+
N.pointerId === T && (A.removeEventListener("pointermove", y), A.removeEventListener("pointerup", M), A.removeEventListener("pointercancel", M), A.hasPointerCapture(T) && A.releasePointerCapture(T));
|
|
2616
2616
|
};
|
|
2617
2617
|
A.addEventListener("pointermove", y), A.addEventListener("pointerup", M), A.addEventListener("pointercancel", M);
|
|
2618
|
-
},
|
|
2618
|
+
}, O = (C) => {
|
|
2619
2619
|
const A = C == null ? void 0 : C.parentElement, L = C == null ? void 0 : C.closest("table");
|
|
2620
2620
|
if (!C || !A || !L) return;
|
|
2621
|
-
const m = Array.from(A.children).indexOf(C), k = A.children.length,
|
|
2621
|
+
const m = Array.from(A.children).indexOf(C), k = A.children.length, T = { cell: C.style.width, table: L.style.width };
|
|
2622
2622
|
C.style.width = "", L.style.width = "auto";
|
|
2623
2623
|
let y = 0;
|
|
2624
2624
|
for (const M of Array.from(L.rows)) {
|
|
@@ -2626,7 +2626,7 @@ function jt({
|
|
|
2626
2626
|
const N = M.cells[m];
|
|
2627
2627
|
N && (y = Math.max(y, N.scrollWidth));
|
|
2628
2628
|
}
|
|
2629
|
-
C.style.width =
|
|
2629
|
+
C.style.width = T.cell, L.style.width = T.table, y > 0 && s.setWidth(a, Math.max(S, y + 1));
|
|
2630
2630
|
}, w = (C) => {
|
|
2631
2631
|
if (!r.resizable || !C.altKey) return;
|
|
2632
2632
|
const A = C.key === "ArrowRight", L = C.key === "ArrowLeft", m = C.key === "Home";
|
|
@@ -2634,43 +2634,43 @@ function jt({
|
|
|
2634
2634
|
C.preventDefault();
|
|
2635
2635
|
const k = C.currentTarget;
|
|
2636
2636
|
if (m) {
|
|
2637
|
-
|
|
2637
|
+
O(k);
|
|
2638
2638
|
return;
|
|
2639
2639
|
}
|
|
2640
|
-
const
|
|
2641
|
-
s.setWidth(
|
|
2642
|
-
}, _ = c ? /* @__PURE__ */
|
|
2640
|
+
const T = k.getBoundingClientRect().width, y = C.shiftKey ? 32 : 8;
|
|
2641
|
+
s.setWidth(a, Math.max(S, T + (A ? y : -y)));
|
|
2642
|
+
}, _ = c ? /* @__PURE__ */ R(
|
|
2643
2643
|
"button",
|
|
2644
2644
|
{
|
|
2645
2645
|
type: "button",
|
|
2646
2646
|
className: h.sortButton,
|
|
2647
|
-
onClick: (C) => s.toggleSort(
|
|
2647
|
+
onClick: (C) => s.toggleSort(a, C.shiftKey || C.metaKey),
|
|
2648
2648
|
children: [
|
|
2649
2649
|
/* @__PURE__ */ u("span", { children: r.label }),
|
|
2650
2650
|
p !== void 0 && /* @__PURE__ */ u("span", { className: h.sortRank, "aria-hidden": "true", children: p }),
|
|
2651
|
-
/* @__PURE__ */ u("span", { className:
|
|
2651
|
+
/* @__PURE__ */ u("span", { className: K(h.sortIndicator, d && h.sortActive), "aria-hidden": "true", children: d ? /* @__PURE__ */ u("svg", { viewBox: "0 0 10 10", width: "10", height: "10", "aria-hidden": "true", className: K(h.sortArrow, d === "desc" && h.sortArrowDesc), children: /* @__PURE__ */ u("path", { d: "M2.2 6.2 5 3.4l2.8 2.8", fill: "none", stroke: "currentColor", strokeWidth: "1.4", strokeLinecap: "round", strokeLinejoin: "round" }) }) : (
|
|
2652
2652
|
/* Drawn in the nominal box and set in the 12 pixels the indicator
|
|
2653
2653
|
has always taken, so that the head does not move. */
|
|
2654
2654
|
/* @__PURE__ */ u("svg", { viewBox: "0 0 10 10", width: "10", height: "12", "aria-hidden": "true", children: /* @__PURE__ */ u("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" }) })
|
|
2655
2655
|
) })
|
|
2656
2656
|
]
|
|
2657
2657
|
}
|
|
2658
|
-
) : r.label, F = d === "asc" ? "ascending" : d === "desc" ? "descending" : "none", g =
|
|
2659
|
-
return /* @__PURE__ */
|
|
2658
|
+
) : r.label, F = d === "asc" ? "ascending" : d === "desc" ? "descending" : "none", g = Te(r.filter) !== void 0 && !(r.filter === "list" && i === "other");
|
|
2659
|
+
return /* @__PURE__ */ R(
|
|
2660
2660
|
"th",
|
|
2661
2661
|
{
|
|
2662
2662
|
scope: "col",
|
|
2663
|
-
"data-column":
|
|
2663
|
+
"data-column": a,
|
|
2664
2664
|
"aria-sort": c ? F : void 0,
|
|
2665
2665
|
tabIndex: r.resizable && !c ? 0 : void 0,
|
|
2666
2666
|
onKeyDown: w,
|
|
2667
|
-
className:
|
|
2667
|
+
className: K(h.th, l && h.numeric, o.className),
|
|
2668
2668
|
style: {
|
|
2669
2669
|
...b !== void 0 ? { width: b } : {},
|
|
2670
2670
|
...o.style
|
|
2671
2671
|
},
|
|
2672
2672
|
children: [
|
|
2673
|
-
g ? /* @__PURE__ */
|
|
2673
|
+
g ? /* @__PURE__ */ R("span", { className: h.thFlex, children: [
|
|
2674
2674
|
_,
|
|
2675
2675
|
/* @__PURE__ */ u(us, { entry: e, registry: t, hook: n })
|
|
2676
2676
|
] }) : _,
|
|
@@ -2682,7 +2682,7 @@ function jt({
|
|
|
2682
2682
|
onPointerDown: v,
|
|
2683
2683
|
onClick: (C) => C.stopPropagation(),
|
|
2684
2684
|
onDoubleClick: (C) => {
|
|
2685
|
-
C.stopPropagation(),
|
|
2685
|
+
C.stopPropagation(), O(C.currentTarget.closest("th"));
|
|
2686
2686
|
}
|
|
2687
2687
|
}
|
|
2688
2688
|
)
|
|
@@ -2698,29 +2698,29 @@ function ei({
|
|
|
2698
2698
|
hook: r,
|
|
2699
2699
|
columns: s,
|
|
2700
2700
|
header: i,
|
|
2701
|
-
selectable:
|
|
2701
|
+
selectable: l,
|
|
2702
2702
|
actions: c,
|
|
2703
|
-
blocks:
|
|
2703
|
+
blocks: a,
|
|
2704
2704
|
columnCount: f,
|
|
2705
2705
|
rowProps: d,
|
|
2706
2706
|
baseId: p,
|
|
2707
2707
|
formats: b,
|
|
2708
2708
|
wording: S,
|
|
2709
2709
|
line: v,
|
|
2710
|
-
spanEntry:
|
|
2710
|
+
spanEntry: O,
|
|
2711
2711
|
grid: w
|
|
2712
2712
|
}) {
|
|
2713
|
-
const _ =
|
|
2714
|
-
return /* @__PURE__ */
|
|
2715
|
-
/* @__PURE__ */
|
|
2713
|
+
const _ = He(Sn), F = r.publicSnapshot, g = r.rowKey(e), C = Ys(e, i, r, b, S), A = o.detail, L = A !== null && F.expanded.includes(g), m = `${p}-detail-${t}`, { className: k, ...T } = (d == null ? void 0 : d(e)) ?? {}, y = n !== void 0, M = v ? v.span ?? v.parents.at(-1) : void 0, N = (l ? 1 : 0) + (A ? 1 : 0), I = N + (O ? 1 : 0), P = ($) => St(a, $);
|
|
2714
|
+
return /* @__PURE__ */ R(ne, { children: [
|
|
2715
|
+
/* @__PURE__ */ R(
|
|
2716
2716
|
"tr",
|
|
2717
2717
|
{
|
|
2718
|
-
...
|
|
2719
|
-
className:
|
|
2718
|
+
...T,
|
|
2719
|
+
className: K(k, y && h.virtualRow),
|
|
2720
2720
|
"data-row": y ? n : void 0,
|
|
2721
2721
|
"data-line": v ? "row" : void 0,
|
|
2722
2722
|
"data-motion": g,
|
|
2723
|
-
"data-selected":
|
|
2723
|
+
"data-selected": l && F.selection.isSelected(g) ? "" : void 0,
|
|
2724
2724
|
"data-group-first": v != null && v.first ? "" : void 0,
|
|
2725
2725
|
"data-group": M == null ? void 0 : M.path,
|
|
2726
2726
|
"aria-level": v ? v.parents.length + 1 : void 0,
|
|
@@ -2731,7 +2731,7 @@ function ei({
|
|
|
2731
2731
|
"data-even": y && n % 2 === 1 ? "" : void 0,
|
|
2732
2732
|
"aria-rowindex": y ? n + 2 : void 0,
|
|
2733
2733
|
children: [
|
|
2734
|
-
|
|
2734
|
+
l && /* @__PURE__ */ u("td", { className: K(h.td, h.control, P(0).className), style: P(0).style, children: /* @__PURE__ */ u(
|
|
2735
2735
|
Le,
|
|
2736
2736
|
{
|
|
2737
2737
|
"aria-label": S.selectRow(C),
|
|
@@ -2739,25 +2739,25 @@ function ei({
|
|
|
2739
2739
|
onChange: () => F.selection.toggle(g)
|
|
2740
2740
|
}
|
|
2741
2741
|
) }),
|
|
2742
|
-
A && /* @__PURE__ */ u("td", { className:
|
|
2742
|
+
A && /* @__PURE__ */ u("td", { className: K(h.td, h.control, P(N - 1).className), style: P(N - 1).style, children: /* @__PURE__ */ u(
|
|
2743
2743
|
"button",
|
|
2744
2744
|
{
|
|
2745
2745
|
type: "button",
|
|
2746
2746
|
"aria-expanded": L,
|
|
2747
2747
|
"aria-controls": L ? m : void 0,
|
|
2748
2748
|
"aria-label": L ? S.collapseRowNamed(C) : S.expandRowNamed(C),
|
|
2749
|
-
className:
|
|
2749
|
+
className: K(h.expander, L && h.expanderOpen),
|
|
2750
2750
|
onClick: () => F.toggleRow(g),
|
|
2751
2751
|
children: /* @__PURE__ */ u(Dn, {})
|
|
2752
2752
|
}
|
|
2753
2753
|
) }),
|
|
2754
2754
|
v && v.span && /* @__PURE__ */ u(
|
|
2755
|
-
|
|
2755
|
+
Ps,
|
|
2756
2756
|
{
|
|
2757
2757
|
line: { ...v, span: v.span },
|
|
2758
|
-
entry:
|
|
2759
|
-
selectable:
|
|
2760
|
-
pin:
|
|
2758
|
+
entry: O,
|
|
2759
|
+
selectable: l,
|
|
2760
|
+
pin: P(N),
|
|
2761
2761
|
hook: r,
|
|
2762
2762
|
formats: b,
|
|
2763
2763
|
wording: S
|
|
@@ -2769,7 +2769,7 @@ function ei({
|
|
|
2769
2769
|
entry: $,
|
|
2770
2770
|
row: e,
|
|
2771
2771
|
kind: o.kindOf($, r.rows),
|
|
2772
|
-
pin:
|
|
2772
|
+
pin: P(I + U),
|
|
2773
2773
|
formats: b,
|
|
2774
2774
|
wording: S,
|
|
2775
2775
|
rowKey: g,
|
|
@@ -2777,7 +2777,7 @@ function ei({
|
|
|
2777
2777
|
},
|
|
2778
2778
|
$.key
|
|
2779
2779
|
)),
|
|
2780
|
-
c.length > 0 && /* @__PURE__ */ u("td", { className:
|
|
2780
|
+
c.length > 0 && /* @__PURE__ */ u("td", { className: K(h.td, h.actionsCell, P(f - 1).className), style: P(f - 1).style, children: /* @__PURE__ */ u(ri, { actions: c, row: e, name: C, wording: S }) })
|
|
2781
2781
|
]
|
|
2782
2782
|
}
|
|
2783
2783
|
),
|
|
@@ -2792,20 +2792,20 @@ function ti({
|
|
|
2792
2792
|
formats: r,
|
|
2793
2793
|
wording: s,
|
|
2794
2794
|
rowKey: i,
|
|
2795
|
-
rowName:
|
|
2795
|
+
rowName: l
|
|
2796
2796
|
}) {
|
|
2797
|
-
const { spec: c } = e,
|
|
2797
|
+
const { spec: c } = e, a = e.read(t), f = mt(n, c.rightAligned), d = Vs(i, c.id);
|
|
2798
2798
|
let p;
|
|
2799
|
-
Q(
|
|
2799
|
+
Q(a) ? p = /* @__PURE__ */ u(hn, { wording: s }) : c.presentation ? p = c.presentation(a, t) : p = Re(a, c.format, r, s);
|
|
2800
2800
|
const b = c.rowHeader ? "th" : "td";
|
|
2801
2801
|
return /* @__PURE__ */ u(
|
|
2802
2802
|
b,
|
|
2803
2803
|
{
|
|
2804
2804
|
scope: c.rowHeader ? "row" : void 0,
|
|
2805
|
-
className:
|
|
2805
|
+
className: K(h.td, f && h.numeric, c.rowHeader && h.rowHeader, o.className, d && h.editing),
|
|
2806
2806
|
style: o.style,
|
|
2807
|
-
children: d ? /* @__PURE__ */
|
|
2808
|
-
/* @__PURE__ */ u(qs, { entry: e, row: t, rowName:
|
|
2807
|
+
children: d ? /* @__PURE__ */ R(ne, { children: [
|
|
2808
|
+
/* @__PURE__ */ u(qs, { entry: e, row: t, rowName: l, grid: d }),
|
|
2809
2809
|
/* @__PURE__ */ u("span", { className: h.editingValue, "aria-hidden": "true", children: p })
|
|
2810
2810
|
] }) : p
|
|
2811
2811
|
}
|
|
@@ -2818,9 +2818,9 @@ function ni({
|
|
|
2818
2818
|
wording: o,
|
|
2819
2819
|
pin: r = mn
|
|
2820
2820
|
}) {
|
|
2821
|
-
if (!e.spec.aggregate) return /* @__PURE__ */ u("td", { className:
|
|
2821
|
+
if (!e.spec.aggregate) return /* @__PURE__ */ u("td", { className: K(h.td, r.className), style: r.style });
|
|
2822
2822
|
const s = typeof e.spec.aggregate == "function" ? "own" : e.spec.aggregate;
|
|
2823
|
-
return /* @__PURE__ */ u("td", { className:
|
|
2823
|
+
return /* @__PURE__ */ u("td", { className: K(h.td, gn(e, t) && h.numeric, r.className), style: r.style, "data-footer": s, children: /* @__PURE__ */ u(ct, { entry: e, rows: t, formats: n, wording: o, signed: !0 }) });
|
|
2824
2824
|
}
|
|
2825
2825
|
const oi = 2;
|
|
2826
2826
|
function ri({
|
|
@@ -2848,13 +2848,13 @@ function ri({
|
|
|
2848
2848
|
{
|
|
2849
2849
|
align: "end",
|
|
2850
2850
|
trigger: /* @__PURE__ */ u(fe, { size: "sm", variant: "ghost", "aria-label": o.rowActionsMenu(n), children: "⋯" }),
|
|
2851
|
-
children: e.map(({ key: s, spec: i }) => /* @__PURE__ */ u(
|
|
2851
|
+
children: e.map(({ key: s, spec: i }) => /* @__PURE__ */ u(Ke, { tone: i.tone, onSelect: () => r(i), children: i.label }, s))
|
|
2852
2852
|
}
|
|
2853
2853
|
) });
|
|
2854
2854
|
}
|
|
2855
2855
|
function si({ columns: e, rightAligned: t = [], rows: n = 4 }) {
|
|
2856
2856
|
const o = [72, 48, 60, 40, 56, 64];
|
|
2857
|
-
return /* @__PURE__ */ u(ne, { children: Array.from({ length: n }, (r, s) => /* @__PURE__ */ u("tr", { "aria-hidden": "true", children: Array.from({ length: e }, (i,
|
|
2857
|
+
return /* @__PURE__ */ u(ne, { children: Array.from({ length: n }, (r, s) => /* @__PURE__ */ u("tr", { "aria-hidden": "true", children: Array.from({ length: e }, (i, l) => /* @__PURE__ */ u("td", { className: K(h.td, t[l] && h.numeric), children: /* @__PURE__ */ u("span", { className: h.skeleton, style: { width: `${o[(s + l) % o.length]}%` } }) }, l)) }, s)) });
|
|
2858
2858
|
}
|
|
2859
2859
|
const Sn = gt(0);
|
|
2860
2860
|
function Gt({ height: e, colSpan: t }) {
|
|
@@ -2865,8 +2865,8 @@ function $t({
|
|
|
2865
2865
|
colSpan: t,
|
|
2866
2866
|
children: n
|
|
2867
2867
|
}) {
|
|
2868
|
-
const { count: o, fillerBefore: r, fillerAfter: s, showRow: i } = e,
|
|
2869
|
-
|
|
2868
|
+
const { count: o, fillerBefore: r, fillerAfter: s, showRow: i } = e, l = ce(null), [c, a] = W(0), f = (b, S) => {
|
|
2869
|
+
l.current = S, a(S), i(S), requestAnimationFrame(() => {
|
|
2870
2870
|
var v;
|
|
2871
2871
|
(v = b.querySelector(`[data-row="${S}"]`)) == null || v.focus();
|
|
2872
2872
|
});
|
|
@@ -2874,9 +2874,9 @@ function $t({
|
|
|
2874
2874
|
if (b.defaultPrevented || o === 0) return;
|
|
2875
2875
|
const S = b.target, v = S.closest("[data-row]");
|
|
2876
2876
|
if (v && S !== v) return;
|
|
2877
|
-
const
|
|
2877
|
+
const O = v ? Number(v.dataset.row) : l.current ?? -1;
|
|
2878
2878
|
let w = null;
|
|
2879
|
-
b.key === "ArrowDown" ? w = Math.min(o - 1,
|
|
2879
|
+
b.key === "ArrowDown" ? w = Math.min(o - 1, O + 1) : b.key === "ArrowUp" ? w = Math.max(0, O - 1) : b.key === "Home" ? w = 0 : b.key === "End" && (w = o - 1), !(w === null || w === O) && (b.preventDefault(), f(b.currentTarget, w));
|
|
2880
2880
|
};
|
|
2881
2881
|
return /* @__PURE__ */ u(
|
|
2882
2882
|
"tbody",
|
|
@@ -2885,9 +2885,9 @@ function $t({
|
|
|
2885
2885
|
onKeyDown: p,
|
|
2886
2886
|
onFocus: (b) => {
|
|
2887
2887
|
const S = b.target.closest("[data-row]");
|
|
2888
|
-
S &&
|
|
2888
|
+
S && a(Number(S.dataset.row));
|
|
2889
2889
|
},
|
|
2890
|
-
children: /* @__PURE__ */
|
|
2890
|
+
children: /* @__PURE__ */ R(Sn.Provider, { value: d, children: [
|
|
2891
2891
|
/* @__PURE__ */ u(Gt, { height: r, colSpan: t }),
|
|
2892
2892
|
n,
|
|
2893
2893
|
/* @__PURE__ */ u(Gt, { height: s, colSpan: t })
|
|
@@ -2895,12 +2895,12 @@ function $t({
|
|
|
2895
2895
|
}
|
|
2896
2896
|
);
|
|
2897
2897
|
}
|
|
2898
|
-
const ii = "_verdict_1mxfd_6",
|
|
2898
|
+
const ii = "_verdict_1mxfd_6", li = "_glyph_1mxfd_13", ai = "_value_1mxfd_23", ci = "_excess_1mxfd_28", $e = {
|
|
2899
2899
|
verdict: ii,
|
|
2900
|
-
glyph:
|
|
2901
|
-
value:
|
|
2900
|
+
glyph: li,
|
|
2901
|
+
value: ai,
|
|
2902
2902
|
excess: ci
|
|
2903
|
-
},
|
|
2903
|
+
}, Kt = (e, t, n) => t === "percent" ? n.percent(e) : t === "count" ? n.count(e) : n.number(e, typeof t == "object" ? t.decimals : void 0), ui = (e, t) => e === "alarm" ? t.verdictAlarm : e === "warning" ? t.verdictWarning : e === "unknown" ? t.verdictUnknown : t.verdictOk, di = {
|
|
2904
2904
|
ok: "✓",
|
|
2905
2905
|
unknown: "?",
|
|
2906
2906
|
warning: "▲",
|
|
@@ -2908,12 +2908,12 @@ const ii = "_verdict_1mxfd_6", ai = "_glyph_1mxfd_13", li = "_value_1mxfd_23", c
|
|
|
2908
2908
|
};
|
|
2909
2909
|
function fi({ reading: e, format: t }) {
|
|
2910
2910
|
const n = be(), o = re(), { measured: r, assessment: s } = e, i = ui(s.verdict, o);
|
|
2911
|
-
return /* @__PURE__ */
|
|
2911
|
+
return /* @__PURE__ */ R("span", { className: $e.verdict, "data-verdict": s.verdict, title: i, children: [
|
|
2912
2912
|
/* @__PURE__ */ u("span", { "aria-hidden": "true", className: $e.glyph, children: di[s.verdict] }),
|
|
2913
|
-
/* @__PURE__ */ u("span", { className: $e.value, children: r === null ? o.statAbsentValue :
|
|
2914
|
-
s.excess !== void 0 && /* @__PURE__ */
|
|
2913
|
+
/* @__PURE__ */ u("span", { className: $e.value, children: r === null ? o.statAbsentValue : Kt(r, t, n) }),
|
|
2914
|
+
s.excess !== void 0 && /* @__PURE__ */ R("span", { className: $e.excess, children: [
|
|
2915
2915
|
"+",
|
|
2916
|
-
|
|
2916
|
+
Kt(s.excess, t, n)
|
|
2917
2917
|
] }),
|
|
2918
2918
|
/* @__PURE__ */ u(De, { children: i })
|
|
2919
2919
|
] });
|
|
@@ -2923,19 +2923,19 @@ const hi = (e) => e.measured, gi = (e) => e.reduce(
|
|
|
2923
2923
|
void 0
|
|
2924
2924
|
);
|
|
2925
2925
|
function pi(e) {
|
|
2926
|
-
return function({ id: n, value: o, label: r, limits: s, format: i, sortBy:
|
|
2926
|
+
return function({ id: n, value: o, label: r, limits: s, format: i, sortBy: l = "verdict", width: c, resizable: a, pin: f, aggregate: d }) {
|
|
2927
2927
|
const p = JSON.stringify(s), b = q(() => {
|
|
2928
2928
|
const v = JSON.parse(p);
|
|
2929
|
-
return (
|
|
2930
|
-
const w = typeof o == "string" ?
|
|
2929
|
+
return (O) => {
|
|
2930
|
+
const w = typeof o == "string" ? O == null ? void 0 : O[o] : o(O);
|
|
2931
2931
|
return {
|
|
2932
2932
|
measured: typeof w == "number" && Number.isFinite(w) ? w : null,
|
|
2933
|
-
assessment:
|
|
2933
|
+
assessment: Rn(w, v)
|
|
2934
2934
|
};
|
|
2935
2935
|
};
|
|
2936
|
-
}, [o, p]), S =
|
|
2937
|
-
(v) =>
|
|
2938
|
-
[
|
|
2936
|
+
}, [o, p]), S = le(
|
|
2937
|
+
(v) => l === "value" ? v.measured : ot(v.assessment.verdict),
|
|
2938
|
+
[l]
|
|
2939
2939
|
);
|
|
2940
2940
|
return /* @__PURE__ */ u(
|
|
2941
2941
|
e,
|
|
@@ -2944,7 +2944,7 @@ function pi(e) {
|
|
|
2944
2944
|
label: r,
|
|
2945
2945
|
numeric: !0,
|
|
2946
2946
|
width: c,
|
|
2947
|
-
resizable:
|
|
2947
|
+
resizable: a,
|
|
2948
2948
|
pin: f,
|
|
2949
2949
|
value: b,
|
|
2950
2950
|
sortValue: S,
|
|
@@ -2955,12 +2955,12 @@ function pi(e) {
|
|
|
2955
2955
|
);
|
|
2956
2956
|
};
|
|
2957
2957
|
}
|
|
2958
|
-
const Cn = (e) =>
|
|
2958
|
+
const Cn = (e) => ae(
|
|
2959
2959
|
`condition-foreign:${e}`,
|
|
2960
2960
|
`The condition for "${e}" is not of the kind of its filter and is passed over.`
|
|
2961
2961
|
);
|
|
2962
2962
|
function xn(e, t, n) {
|
|
2963
|
-
const o = e.columnById(t), r = o ?
|
|
2963
|
+
const o = e.columnById(t), r = o ? Te(o.spec.filter) : void 0;
|
|
2964
2964
|
if (!r) return !1;
|
|
2965
2965
|
const s = rn(r, n);
|
|
2966
2966
|
return s === "foreign" && Cn(t), s === "effective";
|
|
@@ -2972,26 +2972,26 @@ function mi(e, t) {
|
|
|
2972
2972
|
if (n !== t.structureVersion()) {
|
|
2973
2973
|
n = t.structureVersion(), o = [];
|
|
2974
2974
|
for (const [s, i] of e) {
|
|
2975
|
-
const
|
|
2976
|
-
|
|
2975
|
+
const l = t.columnById(s);
|
|
2976
|
+
l && xn(t, s, i) && o.push({ entry: l, condition: i });
|
|
2977
2977
|
}
|
|
2978
2978
|
}
|
|
2979
2979
|
return o.every(({ entry: s, condition: i }) => {
|
|
2980
|
-
const
|
|
2981
|
-
return !
|
|
2980
|
+
const l = Te(s.spec.filter);
|
|
2981
|
+
return !l || Ur(l, s.read(r), i);
|
|
2982
2982
|
});
|
|
2983
2983
|
};
|
|
2984
2984
|
}
|
|
2985
2985
|
function bi(e, t) {
|
|
2986
2986
|
const n = q(() => t ? e.filter((i) => t(i)) : e, [e, t]), [o, r] = W(() => ({ source: e, result: n }));
|
|
2987
2987
|
if (!t) return e;
|
|
2988
|
-
const s = o.source === e && (o.result === n || o.result.length === n.length && o.result.every((i,
|
|
2988
|
+
const s = o.source === e && (o.result === n || o.result.length === n.length && o.result.every((i, l) => i === n[l]));
|
|
2989
2989
|
return s || r({ source: e, result: n }), s ? o.result : n;
|
|
2990
2990
|
}
|
|
2991
2991
|
function vi(e, t) {
|
|
2992
|
-
var
|
|
2992
|
+
var l, c, a, f, d, p;
|
|
2993
2993
|
if (t.size === 0) return e;
|
|
2994
|
-
const n = (
|
|
2994
|
+
const n = (l = e.sort) == null ? void 0 : l.filter((b) => t.has(b.column)), o = (c = e.hidden) == null ? void 0 : c.filter((b) => t.has(b)), r = (a = e.order) == null ? void 0 : a.filter((b) => t.has(b)), s = e.widths ? Object.fromEntries(Object.entries(e.widths).filter(([b]) => t.has(b))) : void 0;
|
|
2995
2995
|
return (n == null ? void 0 : n.length) === ((f = e.sort) == null ? void 0 : f.length) && (o == null ? void 0 : o.length) === ((d = e.hidden) == null ? void 0 : d.length) && (r == null ? void 0 : r.length) === ((p = e.order) == null ? void 0 : p.length) && Object.keys(s ?? {}).length === Object.keys(e.widths ?? {}).length ? e : {
|
|
2996
2996
|
...e.search ? { search: e.search } : {},
|
|
2997
2997
|
...e.page ? { page: e.page } : {},
|
|
@@ -3003,7 +3003,7 @@ function vi(e, t) {
|
|
|
3003
3003
|
};
|
|
3004
3004
|
}
|
|
3005
3005
|
const et = (e) => e === void 0 ? [] : typeof e == "string" ? [e] : [...e], wi = (e, t) => e.length === t.length && e.every((n, o) => n === t[o]);
|
|
3006
|
-
function
|
|
3006
|
+
function Ht(e) {
|
|
3007
3007
|
const t = [], n = (o) => {
|
|
3008
3008
|
for (const r of o)
|
|
3009
3009
|
t.push(r.path), n(r.groups);
|
|
@@ -3017,68 +3017,68 @@ function _i(e, t) {
|
|
|
3017
3017
|
return { ...n, ...t };
|
|
3018
3018
|
}
|
|
3019
3019
|
function ki(e, t) {
|
|
3020
|
-
var
|
|
3020
|
+
var B;
|
|
3021
3021
|
const [n] = W(() => new is()), [o] = W(() => {
|
|
3022
|
-
const
|
|
3023
|
-
return { ...
|
|
3022
|
+
const z = Js(n);
|
|
3023
|
+
return { ...z, VerdictColumn: pi(z.Column) };
|
|
3024
3024
|
});
|
|
3025
|
-
|
|
3026
|
-
const r = be(), s = e, i = n.modelColumns(s, r), [
|
|
3027
|
-
n.setManual(c), c && ((t.preFilter ?? t.filter) &&
|
|
3028
|
-
const [d, p] = W(() => Object.entries((
|
|
3029
|
-
() =>
|
|
3030
|
-
), [_, F] = W(() => (
|
|
3031
|
-
() =>
|
|
3025
|
+
je(n.subscribe, n.structureVersion, n.structureVersion);
|
|
3026
|
+
const r = be(), s = e, i = n.modelColumns(s, r), [l] = W(() => t.initialView), c = t.manual === !0, a = t.manual ? t.rowCount : 0, f = q(() => c ? { rowCount: a } : void 0, [c, a]);
|
|
3027
|
+
n.setManual(c), c && ((t.preFilter ?? t.filter) && ae("manual-prefilter", "`preFilter` is passed over in manual mode: the server decides which rows the table has."), t.virtual && ae("manual-virtual", "`virtual` is passed over in manual mode: the table pages instead."), (t.defaultGrouping !== void 0 || (B = l == null ? void 0 : l.grouping) != null && B.length) && ae("manual-grouping", "A grouping is passed over in manual mode: the groups would be the page's, not the server's."));
|
|
3028
|
+
const [d, p] = W(() => Object.entries((l == null ? void 0 : l.conditions) ?? {})), b = q(() => mi(d, n), [d, n]), S = t.preFilter ?? t.filter, v = bi(s, c ? void 0 : S), [O, w] = W(
|
|
3029
|
+
() => l != null && l.grouping ? [...l.grouping] : et(t.defaultGrouping)
|
|
3030
|
+
), [_, F] = W(() => (l == null ? void 0 : l.folded) ?? []), [g, C] = W(() => l != null && l.pinned ? { ...l.pinned } : null), A = n.orderedColumns().length + n.groupKeys.entries.size > 0, L = c ? [] : A ? n.effectiveGrouping(O, s) : O.slice(0, wt), m = L.join("|"), k = q(() => new Set(_), [_]), T = L.length ? n.groupingModel(L, s) : null, y = q(
|
|
3031
|
+
() => T && T.levels.length ? { ...T, folded: k, compareText: r.compareText } : void 0,
|
|
3032
3032
|
// eslint-disable-next-line react-hooks/exhaustive-deps -- the model's identity carries the ids and the columns
|
|
3033
|
-
[
|
|
3033
|
+
[T, k, r.compareText, m]
|
|
3034
3034
|
), M = t.rowKey, N = Jn(v, i, {
|
|
3035
3035
|
rowKey: M,
|
|
3036
3036
|
pageSize: t.pageSize,
|
|
3037
3037
|
defaultSort: t.defaultSort,
|
|
3038
3038
|
filter: b,
|
|
3039
|
-
initialView:
|
|
3039
|
+
initialView: l,
|
|
3040
3040
|
virtual: c ? void 0 : t.virtual,
|
|
3041
3041
|
grouping: y,
|
|
3042
3042
|
manual: f
|
|
3043
|
-
}), { setPage:
|
|
3044
|
-
(
|
|
3045
|
-
let ee =
|
|
3043
|
+
}), { setPage: I } = N, P = le(
|
|
3044
|
+
(z, V) => {
|
|
3045
|
+
let ee = V == null;
|
|
3046
3046
|
if (!ee && n.orderedColumns().length > 0) {
|
|
3047
|
-
const de = n.columnById(
|
|
3047
|
+
const de = n.columnById(z), pe = de ? Te(de.spec.filter) : void 0;
|
|
3048
3048
|
if (!pe) {
|
|
3049
|
-
|
|
3050
|
-
`condition-without-filter:${
|
|
3051
|
-
de ? `The column "${
|
|
3049
|
+
ae(
|
|
3050
|
+
`condition-without-filter:${z}`,
|
|
3051
|
+
de ? `The column "${z}" has no filter; its condition is passed over.` : `No column is called "${z}"; its condition is passed over.`
|
|
3052
3052
|
);
|
|
3053
3053
|
return;
|
|
3054
3054
|
}
|
|
3055
|
-
const Ae = rn(pe,
|
|
3055
|
+
const Ae = rn(pe, V);
|
|
3056
3056
|
if (Ae === "foreign") {
|
|
3057
|
-
Cn(
|
|
3057
|
+
Cn(z);
|
|
3058
3058
|
return;
|
|
3059
3059
|
}
|
|
3060
3060
|
ee = Ae === "empty";
|
|
3061
3061
|
}
|
|
3062
3062
|
p((de) => {
|
|
3063
|
-
const pe = de.findIndex(([Ae]) => Ae ===
|
|
3064
|
-
return ee ? pe === -1 ? de : de.filter((Ae, Je) => Je !== pe) : pe === -1 ? [...de, [
|
|
3065
|
-
}),
|
|
3063
|
+
const pe = de.findIndex(([Ae]) => Ae === z);
|
|
3064
|
+
return ee ? pe === -1 ? de : de.filter((Ae, Je) => Je !== pe) : pe === -1 ? [...de, [z, V]] : de.map((Ae, Je) => Je === pe ? [z, V] : Ae);
|
|
3065
|
+
}), I(1);
|
|
3066
3066
|
},
|
|
3067
|
-
[n,
|
|
3068
|
-
), $ = new Set(n.orderedColumns().map((
|
|
3067
|
+
[n, I]
|
|
3068
|
+
), $ = new Set(n.orderedColumns().map((z) => z.spec.id)), [U, Z] = W(() => /* @__PURE__ */ new Set());
|
|
3069
3069
|
if (!yi(U, $)) {
|
|
3070
|
-
const
|
|
3071
|
-
Z($), d.some(([
|
|
3070
|
+
const z = new Set([...U].filter((V) => !$.has(V)));
|
|
3071
|
+
Z($), d.some(([V]) => z.has(V)) && p((V) => V.filter(([ee]) => !z.has(ee)));
|
|
3072
3072
|
}
|
|
3073
|
-
const he = $.size === 0 ? d : d.filter(([
|
|
3073
|
+
const he = $.size === 0 ? d : d.filter(([z, V]) => xn(n, z, V)), se = vi(N.view, $), we = he.length > 0 ? { ...se, conditions: Object.fromEntries(he) } : se, Ce = $.size === 0 ? N.sort : N.sort.filter((z) => $.has(z.column)), Oe = c ? [] : A ? n.effectiveGrouping(et(t.defaultGrouping), s) : et(t.defaultGrouping), xe = N.groups ? Kn(N.groups, _) : A ? [] : [..._], ue = n.declaredPins(), Y = to(g, ue, $), ge = {
|
|
3074
3074
|
...we,
|
|
3075
|
-
...wi(L,
|
|
3075
|
+
...wi(L, Oe) ? {} : { grouping: L },
|
|
3076
3076
|
...xe.length ? { folded: xe } : {},
|
|
3077
3077
|
...Y ? { pinned: Y } : {}
|
|
3078
|
-
}, ye = (
|
|
3079
|
-
w([...
|
|
3080
|
-
}, _e = (
|
|
3081
|
-
|
|
3078
|
+
}, ye = (z, V) => C((ee) => Zn(ee ?? n.declaredPins(), z, V)), Ne = (z) => {
|
|
3079
|
+
w([...z]), I(1);
|
|
3080
|
+
}, _e = (z) => {
|
|
3081
|
+
Ht(N.groups).includes(z) && (n.noteFocusBeforeFold(), F((V) => V.includes(z) ? V.filter((ee) => ee !== z) : [...V, z]));
|
|
3082
3082
|
}, ke = !c && t.virtual !== void 0, J = n.paginates() || ke, D = t.selection ?? N.selection, G = {
|
|
3083
3083
|
...ge,
|
|
3084
3084
|
search: N.search,
|
|
@@ -3086,22 +3086,22 @@ function ki(e, t) {
|
|
|
3086
3086
|
sort: Ce,
|
|
3087
3087
|
page: N.page,
|
|
3088
3088
|
pageSize: N.pageSize
|
|
3089
|
-
},
|
|
3090
|
-
|
|
3091
|
-
var
|
|
3092
|
-
!c || x.current ===
|
|
3093
|
-
}, [
|
|
3089
|
+
}, H = c ? oo(G) : "", x = ce(null);
|
|
3090
|
+
jt(() => {
|
|
3091
|
+
var z;
|
|
3092
|
+
!c || x.current === H || (x.current = H, (z = t.onViewChange) == null || z.call(t, G));
|
|
3093
|
+
}, [H]);
|
|
3094
3094
|
const [E] = W(() => /* @__PURE__ */ new Map());
|
|
3095
3095
|
let ie;
|
|
3096
3096
|
if (c) {
|
|
3097
|
-
const
|
|
3098
|
-
for (const
|
|
3099
|
-
const ee = M(
|
|
3100
|
-
|
|
3097
|
+
const z = /* @__PURE__ */ new Set();
|
|
3098
|
+
for (const V of s) {
|
|
3099
|
+
const ee = M(V);
|
|
3100
|
+
z.add(ee), E.set(ee, V);
|
|
3101
3101
|
}
|
|
3102
|
-
for (const
|
|
3103
|
-
!
|
|
3104
|
-
ie = [...D.selected].filter((
|
|
3102
|
+
for (const V of [...E.keys()])
|
|
3103
|
+
!z.has(V) && !D.isSelected(V) && E.delete(V);
|
|
3104
|
+
ie = [...D.selected].filter((V) => E.has(V)).map((V) => E.get(V));
|
|
3105
3105
|
}
|
|
3106
3106
|
const oe = {
|
|
3107
3107
|
rows: e,
|
|
@@ -3127,7 +3127,7 @@ function ki(e, t) {
|
|
|
3127
3127
|
expanded: N.expanded,
|
|
3128
3128
|
toggleRow: N.toggleRow,
|
|
3129
3129
|
filter: Object.fromEntries(he),
|
|
3130
|
-
setFilter:
|
|
3130
|
+
setFilter: P,
|
|
3131
3131
|
selection: D,
|
|
3132
3132
|
view: ge,
|
|
3133
3133
|
grouping: L,
|
|
@@ -3135,14 +3135,14 @@ function ki(e, t) {
|
|
|
3135
3135
|
folded: xe,
|
|
3136
3136
|
toggleFold: _e,
|
|
3137
3137
|
foldAll: () => {
|
|
3138
|
-
n.noteFocusBeforeFold(), F(
|
|
3138
|
+
n.noteFocusBeforeFold(), F(Ht(N.groups));
|
|
3139
3139
|
},
|
|
3140
3140
|
unfoldAll: () => {
|
|
3141
3141
|
n.noteFocusBeforeFold(), F([]);
|
|
3142
3142
|
},
|
|
3143
3143
|
asCsv: () => vs(n),
|
|
3144
3144
|
virtual: ke,
|
|
3145
|
-
rowCount: c ?
|
|
3145
|
+
rowCount: c ? a : N.filtered.length,
|
|
3146
3146
|
manual: c
|
|
3147
3147
|
};
|
|
3148
3148
|
return n.setHook({
|
|
@@ -3161,7 +3161,7 @@ function ki(e, t) {
|
|
|
3161
3161
|
selectedRows: ie
|
|
3162
3162
|
}), { ...oe, ...o };
|
|
3163
3163
|
}
|
|
3164
|
-
function
|
|
3164
|
+
function fl(e) {
|
|
3165
3165
|
return e;
|
|
3166
3166
|
}
|
|
3167
3167
|
function xt(e, t) {
|
|
@@ -3173,14 +3173,14 @@ function xt(e, t) {
|
|
|
3173
3173
|
};
|
|
3174
3174
|
}, [e, t, n]);
|
|
3175
3175
|
}
|
|
3176
|
-
function
|
|
3177
|
-
const o =
|
|
3176
|
+
function hl({ children: e, className: t, of: n }) {
|
|
3177
|
+
const o = Be(n);
|
|
3178
3178
|
xt(o == null ? void 0 : o.registry, "toolbar");
|
|
3179
3179
|
const r = o == null ? void 0 : o.registry;
|
|
3180
3180
|
return /* @__PURE__ */ u(fn, { registry: r ?? null, className: t, children: e });
|
|
3181
3181
|
}
|
|
3182
|
-
function
|
|
3183
|
-
const r =
|
|
3182
|
+
function gl({ placeholder: e, "aria-label": t, className: n, of: o }) {
|
|
3183
|
+
const r = Be(o), s = re();
|
|
3184
3184
|
if (xt(r == null ? void 0 : r.registry, "search"), !r) return null;
|
|
3185
3185
|
const { snapshot: i } = r;
|
|
3186
3186
|
return /* @__PURE__ */ u(
|
|
@@ -3190,7 +3190,7 @@ function ga({ placeholder: e, "aria-label": t, className: n, of: o }) {
|
|
|
3190
3190
|
type: "search",
|
|
3191
3191
|
className: n,
|
|
3192
3192
|
value: i.search,
|
|
3193
|
-
onChange: (
|
|
3193
|
+
onChange: (l) => i.setSearch(l.target.value),
|
|
3194
3194
|
clearable: !0,
|
|
3195
3195
|
onClear: () => i.setSearch(""),
|
|
3196
3196
|
placeholder: e ?? s.tableSearchPlaceholder,
|
|
@@ -3198,8 +3198,8 @@ function ga({ placeholder: e, "aria-label": t, className: n, of: o }) {
|
|
|
3198
3198
|
}
|
|
3199
3199
|
);
|
|
3200
3200
|
}
|
|
3201
|
-
function
|
|
3202
|
-
const t =
|
|
3201
|
+
function pl({ of: e }) {
|
|
3202
|
+
const t = Be(e), n = re(), [o, r] = W(!1), s = ce(null), i = ce(null), l = me(), [c, a] = W(null);
|
|
3203
3203
|
if (X(() => {
|
|
3204
3204
|
var C;
|
|
3205
3205
|
if (!c || !i.current) return;
|
|
@@ -3211,23 +3211,23 @@ function pa({ of: e }) {
|
|
|
3211
3211
|
const { registry: f, snapshot: d } = t, p = f.hook, b = f.inPinOrder(_t(f.modelColumns(p.rows, p.formats), d.order)), S = f.pins(), v = (_, F) => {
|
|
3212
3212
|
const g = b[_ + F];
|
|
3213
3213
|
return g !== void 0 && S[g.id] === S[b[_].id];
|
|
3214
|
-
},
|
|
3214
|
+
}, O = (_, F) => {
|
|
3215
3215
|
const g = b.map((m) => m.id), C = _ + F;
|
|
3216
3216
|
if (!v(_, F)) return;
|
|
3217
3217
|
[g[_], g[C]] = [g[C], g[_]], d.setOrder(g);
|
|
3218
3218
|
const [A, L] = F < 0 ? ["forward", "backward"] : ["backward", "forward"];
|
|
3219
|
-
|
|
3219
|
+
a({ id: b[_].id, key: `[data-direction="${A}"]`, otherwise: `[data-direction="${L}"]` });
|
|
3220
3220
|
}, w = (_, F, g) => {
|
|
3221
3221
|
const C = S[_] === g;
|
|
3222
3222
|
return /* @__PURE__ */ u(
|
|
3223
3223
|
"button",
|
|
3224
3224
|
{
|
|
3225
3225
|
type: "button",
|
|
3226
|
-
className:
|
|
3226
|
+
className: K(h.move, C && h.pinOn),
|
|
3227
3227
|
"data-pin": g,
|
|
3228
3228
|
"aria-label": C ? n.unpinColumn(F) : g === "start" ? n.pinColumnToStart(F) : n.pinColumnToEnd(F),
|
|
3229
3229
|
onClick: () => {
|
|
3230
|
-
d.setPin(_, C ? null : g),
|
|
3230
|
+
d.setPin(_, C ? null : g), a({ id: _, key: `[data-pin="${g}"]` });
|
|
3231
3231
|
},
|
|
3232
3232
|
children: /* @__PURE__ */ u("svg", { viewBox: "0 0 10 10", width: "10", height: "10", "aria-hidden": "true", children: /* @__PURE__ */ u(
|
|
3233
3233
|
"path",
|
|
@@ -3243,7 +3243,7 @@ function pa({ of: e }) {
|
|
|
3243
3243
|
}
|
|
3244
3244
|
);
|
|
3245
3245
|
};
|
|
3246
|
-
return /* @__PURE__ */
|
|
3246
|
+
return /* @__PURE__ */ R(ne, { children: [
|
|
3247
3247
|
/* @__PURE__ */ u(
|
|
3248
3248
|
fe,
|
|
3249
3249
|
{
|
|
@@ -3251,12 +3251,12 @@ function pa({ of: e }) {
|
|
|
3251
3251
|
size: "sm",
|
|
3252
3252
|
"aria-haspopup": "dialog",
|
|
3253
3253
|
"aria-expanded": o,
|
|
3254
|
-
"aria-controls": o ?
|
|
3254
|
+
"aria-controls": o ? l : void 0,
|
|
3255
3255
|
onClick: () => r(!o),
|
|
3256
3256
|
children: n.columns
|
|
3257
3257
|
}
|
|
3258
3258
|
),
|
|
3259
|
-
/* @__PURE__ */
|
|
3259
|
+
/* @__PURE__ */ R(
|
|
3260
3260
|
pt,
|
|
3261
3261
|
{
|
|
3262
3262
|
open: o,
|
|
@@ -3265,12 +3265,12 @@ function pa({ of: e }) {
|
|
|
3265
3265
|
align: "end",
|
|
3266
3266
|
role: "dialog",
|
|
3267
3267
|
ariaLabel: n.arrangeColumns,
|
|
3268
|
-
id:
|
|
3268
|
+
id: l,
|
|
3269
3269
|
className: h.columnsPanel,
|
|
3270
3270
|
children: [
|
|
3271
3271
|
/* @__PURE__ */ u("ul", { ref: i, className: h.columnsList, "aria-label": n.arrangeColumns, children: b.map((_, F) => {
|
|
3272
3272
|
const g = _.label ?? _.id;
|
|
3273
|
-
return /* @__PURE__ */
|
|
3273
|
+
return /* @__PURE__ */ R("li", { className: h.columnsEntry, "data-column": _.id, children: [
|
|
3274
3274
|
/* @__PURE__ */ u(
|
|
3275
3275
|
Le,
|
|
3276
3276
|
{
|
|
@@ -3288,7 +3288,7 @@ function pa({ of: e }) {
|
|
|
3288
3288
|
"data-direction": "forward",
|
|
3289
3289
|
"aria-label": n.columnForward(g),
|
|
3290
3290
|
disabled: !v(F, -1),
|
|
3291
|
-
onClick: () =>
|
|
3291
|
+
onClick: () => O(F, -1),
|
|
3292
3292
|
children: /* @__PURE__ */ u("svg", { viewBox: "0 0 10 10", width: "10", height: "10", "aria-hidden": "true", children: /* @__PURE__ */ u("path", { d: "M2 6.5 5 3.5l3 3", fill: "none", stroke: "currentColor", strokeWidth: "1.4", strokeLinecap: "round", strokeLinejoin: "round" }) })
|
|
3293
3293
|
}
|
|
3294
3294
|
),
|
|
@@ -3300,7 +3300,7 @@ function pa({ of: e }) {
|
|
|
3300
3300
|
"data-direction": "backward",
|
|
3301
3301
|
"aria-label": n.columnBackward(g),
|
|
3302
3302
|
disabled: !v(F, 1),
|
|
3303
|
-
onClick: () =>
|
|
3303
|
+
onClick: () => O(F, 1),
|
|
3304
3304
|
children: /* @__PURE__ */ u("svg", { viewBox: "0 0 10 10", width: "10", height: "10", "aria-hidden": "true", children: /* @__PURE__ */ u("path", { d: "M2 3.5 5 6.5l3-3", fill: "none", stroke: "currentColor", strokeWidth: "1.4", strokeLinecap: "round", strokeLinejoin: "round" }) })
|
|
3305
3305
|
}
|
|
3306
3306
|
),
|
|
@@ -3314,27 +3314,27 @@ function pa({ of: e }) {
|
|
|
3314
3314
|
)
|
|
3315
3315
|
] });
|
|
3316
3316
|
}
|
|
3317
|
-
function
|
|
3318
|
-
const o =
|
|
3317
|
+
function ml({ filename: e, onExport: t, of: n }) {
|
|
3318
|
+
const o = Be(n), r = re();
|
|
3319
3319
|
if (!o) return null;
|
|
3320
3320
|
const { snapshot: s } = o;
|
|
3321
3321
|
return /* @__PURE__ */ u(fe, { size: "sm", onClick: () => {
|
|
3322
|
-
const
|
|
3322
|
+
const l = s.asCsv();
|
|
3323
3323
|
if (t) {
|
|
3324
|
-
t(
|
|
3324
|
+
t(l);
|
|
3325
3325
|
return;
|
|
3326
3326
|
}
|
|
3327
|
-
const c = URL.createObjectURL(new Blob([
|
|
3328
|
-
|
|
3327
|
+
const c = URL.createObjectURL(new Blob([l], { type: "text/csv;charset=utf-8" })), a = document.createElement("a");
|
|
3328
|
+
a.href = c, a.download = e ?? r.exportFileName, a.click(), setTimeout(() => URL.revokeObjectURL(c), 1e4);
|
|
3329
3329
|
}, children: s.manual ? r.exportPageLabel : r.exportLabel });
|
|
3330
3330
|
}
|
|
3331
|
-
function
|
|
3332
|
-
const o =
|
|
3331
|
+
function bl({ pageSizes: e = [10, 25, 50], className: t, of: n }) {
|
|
3332
|
+
const o = Be(n), r = re(), s = be();
|
|
3333
3333
|
if (xt(o == null ? void 0 : o.registry, "pagination"), !o || o.snapshot.virtual) return null;
|
|
3334
|
-
const { snapshot: i } = o,
|
|
3335
|
-
/* @__PURE__ */ u("span", { children: r.entries(
|
|
3336
|
-
/* @__PURE__ */
|
|
3337
|
-
/* @__PURE__ */
|
|
3334
|
+
const { snapshot: i } = o, l = i.rowCount, c = e.includes(i.pageSize) ? e : [...e, i.pageSize].sort((f, d) => f - d), a = /* @__PURE__ */ R("nav", { "aria-label": r.pagination, className: K(h.pagination, t), children: [
|
|
3335
|
+
/* @__PURE__ */ u("span", { children: r.entries(l, s.count(l)) }),
|
|
3336
|
+
/* @__PURE__ */ R("div", { className: h.paginationControls, children: [
|
|
3337
|
+
/* @__PURE__ */ R("label", { className: h.pageSize, children: [
|
|
3338
3338
|
r.rows,
|
|
3339
3339
|
/* @__PURE__ */ u(
|
|
3340
3340
|
Jt,
|
|
@@ -3355,41 +3355,41 @@ function ba({ pageSizes: e = [10, 25, 50], className: t, of: n }) {
|
|
|
3355
3355
|
/* @__PURE__ */ u(fe, { size: "sm", disabled: i.page >= i.pageCount, onClick: () => i.setPage(i.page + 1), children: r.nextPage })
|
|
3356
3356
|
] })
|
|
3357
3357
|
] });
|
|
3358
|
-
return o.inside ? o.footerTarget ?
|
|
3358
|
+
return o.inside ? o.footerTarget ? In(a, o.footerTarget) : null : a;
|
|
3359
3359
|
}
|
|
3360
|
-
const Si = ["high", "medium", "low"], Ci = (e) => Si.indexOf(e), xi = (e) => e === "
|
|
3360
|
+
const Si = ["high", "medium", "low"], Ci = (e) => Si.indexOf(e), xi = (e) => e === "active-unacknowledged" || e === "active-acknowledged", Ye = (e) => e === "active-acknowledged" || e === "resolved-acknowledged", Ni = (e) => e === "resolved-acknowledged";
|
|
3361
3361
|
function Ai(e, t) {
|
|
3362
3362
|
switch (t) {
|
|
3363
3363
|
case "raised":
|
|
3364
|
-
return "
|
|
3364
|
+
return "active-unacknowledged";
|
|
3365
3365
|
case "acknowledged":
|
|
3366
|
-
return xi(e) ? "
|
|
3367
|
-
case "
|
|
3368
|
-
return Ye(e) ? "
|
|
3366
|
+
return xi(e) ? "active-acknowledged" : "resolved-acknowledged";
|
|
3367
|
+
case "resolved":
|
|
3368
|
+
return Ye(e) ? "resolved-acknowledged" : "resolved-unacknowledged";
|
|
3369
3369
|
}
|
|
3370
3370
|
}
|
|
3371
|
-
const
|
|
3371
|
+
const Ti = [
|
|
3372
3372
|
"in-service",
|
|
3373
|
-
"
|
|
3374
|
-
"suppressed
|
|
3375
|
-
"
|
|
3373
|
+
"snoozed",
|
|
3374
|
+
"suppressed",
|
|
3375
|
+
"disabled"
|
|
3376
3376
|
], ht = (e) => e !== "in-service";
|
|
3377
|
-
function
|
|
3378
|
-
return e.availability === "
|
|
3377
|
+
function Oi(e, t) {
|
|
3378
|
+
return e.availability === "snoozed" ? t >= e.snooze.until ? "in-service" : "snoozed" : e.availability ?? "in-service";
|
|
3379
3379
|
}
|
|
3380
|
-
function
|
|
3381
|
-
return e.availability === "
|
|
3380
|
+
function vl(e, t, n) {
|
|
3381
|
+
return e.availability === "disabled" || e.availability === "suppressed" ? e : { ...e, availability: "snoozed", snooze: { until: t, by: n } };
|
|
3382
3382
|
}
|
|
3383
|
-
function
|
|
3384
|
-
return e.availability !== "
|
|
3383
|
+
function wl(e) {
|
|
3384
|
+
return e.availability !== "snoozed" ? e : { ...e, availability: "in-service", snooze: void 0 };
|
|
3385
3385
|
}
|
|
3386
|
-
function
|
|
3387
|
-
return e.availability === "
|
|
3386
|
+
function yl(e) {
|
|
3387
|
+
return e.availability === "disabled" || e.availability === "suppressed" ? e : { ...e, availability: "disabled", snooze: void 0 };
|
|
3388
3388
|
}
|
|
3389
|
-
function
|
|
3390
|
-
return e.availability !== "
|
|
3389
|
+
function _l(e) {
|
|
3390
|
+
return e.availability !== "disabled" ? e : { ...e, availability: "in-service" };
|
|
3391
3391
|
}
|
|
3392
|
-
const
|
|
3392
|
+
const kl = (e, t) => e.direction === "upper" ? t <= e.returnTo : t >= e.returnTo, Nt = (e, t, n) => e > n - t && e <= n, Sl = (e, t, n) => e.reduce((o, r) => o + (Nt(r, t, n) ? 1 : 0), 0);
|
|
3393
3393
|
function Mi(e, t, n) {
|
|
3394
3394
|
const o = /* @__PURE__ */ new Map();
|
|
3395
3395
|
for (const r of e)
|
|
@@ -3419,19 +3419,19 @@ function Di(e, t, n) {
|
|
|
3419
3419
|
alarms: o.map((s) => s.id)
|
|
3420
3420
|
};
|
|
3421
3421
|
}
|
|
3422
|
-
function
|
|
3422
|
+
function Ri(e, t) {
|
|
3423
3423
|
const n = new Set(t);
|
|
3424
3424
|
return e.reduce(
|
|
3425
3425
|
(o, r) => o + (n.has(r.id) && !Ye(r.lifecycle) ? 1 : 0),
|
|
3426
3426
|
0
|
|
3427
3427
|
);
|
|
3428
3428
|
}
|
|
3429
|
-
function
|
|
3429
|
+
function Cl(e, t, n) {
|
|
3430
3430
|
const o = new Set(t);
|
|
3431
3431
|
let r = 0;
|
|
3432
3432
|
return { alarms: e.map((i) => !o.has(i.id) || Ye(i.lifecycle) ? i : (r += 1, { ...i, lifecycle: Ai(i.lifecycle, "acknowledged"), acknowledgedAt: n })), count: r };
|
|
3433
3433
|
}
|
|
3434
|
-
const
|
|
3434
|
+
const Pi = (e) => [
|
|
3435
3435
|
{
|
|
3436
3436
|
id: "type",
|
|
3437
3437
|
label: e.columnAlarm,
|
|
@@ -3442,76 +3442,76 @@ const Ri = (e) => [
|
|
|
3442
3442
|
{ id: "lifecycle", label: e.columnLifecycleState, value: (t) => t.lifecycle, searchable: !0 },
|
|
3443
3443
|
/* The rank, like the priority: the column exists for the first level of the
|
|
3444
3444
|
order. */
|
|
3445
|
-
{ id: "availability", label: e.columnAvailability, value: (t) =>
|
|
3445
|
+
{ id: "availability", label: e.columnAvailability, value: (t) => Ti.indexOf(t.availability) },
|
|
3446
3446
|
{ id: "priority", label: e.columnPriority, value: (t) => t.rank },
|
|
3447
3447
|
/* A column of its own instead of a glance at the lifecycle state: the second
|
|
3448
3448
|
level of the order asks only about the acknowledgement and expressly not
|
|
3449
|
-
about whether the alarm is still
|
|
3449
|
+
about whether the alarm is still active. Otherwise the fleeting alarm
|
|
3450
3450
|
falls back down again. */
|
|
3451
3451
|
{ id: "acknowledgement", label: e.columnAcknowledgement, value: (t) => Ye(t.lifecycle) ? 1 : 0 },
|
|
3452
3452
|
{ id: "raised", label: e.columnRaised, value: (t) => t.alarm.raised },
|
|
3453
3453
|
{ id: "age", label: e.columnAge, value: (t) => t.age },
|
|
3454
3454
|
{ id: "frequency", label: e.columnFrequency, value: (t) => t.frequency }
|
|
3455
|
-
], Ei =
|
|
3455
|
+
], Ei = Pi(Pn), zi = [
|
|
3456
3456
|
{ column: "availability", direction: "asc" },
|
|
3457
3457
|
{ column: "priority", direction: "asc" },
|
|
3458
3458
|
{ column: "acknowledgement", direction: "asc" },
|
|
3459
3459
|
{ column: "raised", direction: "desc" }
|
|
3460
|
-
],
|
|
3460
|
+
], Ii = (e) => ({
|
|
3461
3461
|
id: e,
|
|
3462
3462
|
label: e,
|
|
3463
3463
|
priority: "high"
|
|
3464
3464
|
});
|
|
3465
|
-
function
|
|
3465
|
+
function xl(e, t = {}) {
|
|
3466
3466
|
const {
|
|
3467
3467
|
alarms: n,
|
|
3468
3468
|
types: o,
|
|
3469
3469
|
asOf: r,
|
|
3470
3470
|
chatter: s,
|
|
3471
3471
|
flood: i,
|
|
3472
|
-
keepDone:
|
|
3472
|
+
keepDone: l = !1,
|
|
3473
3473
|
columns: c = Ei
|
|
3474
|
-
} = e,
|
|
3475
|
-
const
|
|
3474
|
+
} = e, a = new Map(o.map((v) => [v.id, v])), f = Mi(n, (s == null ? void 0 : s.windowMs) ?? 1 / 0, r), d = i ? Di(n, i, r) : null, p = new Set((d == null ? void 0 : d.alarms) ?? []), b = n.filter((v) => l || !Ni(v.lifecycle)).map((v) => {
|
|
3475
|
+
const O = a.get(v.type) ?? Ii(v.type), w = f.get(v.type) ?? 0;
|
|
3476
3476
|
return {
|
|
3477
3477
|
id: v.id,
|
|
3478
3478
|
alarm: v,
|
|
3479
|
-
type:
|
|
3479
|
+
type: O,
|
|
3480
3480
|
lifecycle: v.lifecycle,
|
|
3481
|
-
availability:
|
|
3482
|
-
priority:
|
|
3483
|
-
rank: Ci(
|
|
3481
|
+
availability: Oi(v, r),
|
|
3482
|
+
priority: O.priority,
|
|
3483
|
+
rank: Ci(O.priority),
|
|
3484
3484
|
age: r - v.raised,
|
|
3485
|
-
duration: (v.
|
|
3485
|
+
duration: (v.resolved ?? r) - v.raised,
|
|
3486
3486
|
frequency: w,
|
|
3487
3487
|
chatters: s !== void 0 && w >= s.atLeast,
|
|
3488
3488
|
inFlood: p.has(v.id)
|
|
3489
3489
|
};
|
|
3490
3490
|
}), S = kt(b, c, {
|
|
3491
3491
|
...t,
|
|
3492
|
-
sort: t.sort === void 0 ?
|
|
3492
|
+
sort: t.sort === void 0 ? zi : t.sort
|
|
3493
3493
|
});
|
|
3494
3494
|
return {
|
|
3495
3495
|
...S,
|
|
3496
3496
|
flood: d,
|
|
3497
|
-
|
|
3498
|
-
(v,
|
|
3497
|
+
activeUnacknowledged: S.filtered.reduce(
|
|
3498
|
+
(v, O) => v + (O.lifecycle === "active-unacknowledged" && !ht(O.availability) ? 1 : 0),
|
|
3499
3499
|
0
|
|
3500
3500
|
),
|
|
3501
|
-
|
|
3502
|
-
(v,
|
|
3501
|
+
hiddenAlarms: S.filtered.reduce(
|
|
3502
|
+
(v, O) => v + (ht(O.availability) ? 1 : 0),
|
|
3503
3503
|
0
|
|
3504
3504
|
)
|
|
3505
3505
|
};
|
|
3506
3506
|
}
|
|
3507
|
-
const
|
|
3508
|
-
list:
|
|
3509
|
-
bar:
|
|
3507
|
+
const Vi = "_list_fm5vz_4 _text_k1tvc_23", Bi = "_bar_fm5vz_12", Gi = "_heading_fm5vz_19", $i = "_filler_fm5vz_25", Ki = "_asOf_fm5vz_29", Hi = "_live_fm5vz_46", ji = "_label_fm5vz_51", Wi = "_counter_fm5vz_55", qi = "_state_fm5vz_61", Ui = "_lifecycle_fm5vz_65", Yi = "_hidden_fm5vz_71", Ji = "_hiddenLabel_fm5vz_78", Xi = "_availability_fm5vz_84", Qi = "_empty_fm5vz_88", Zi = "_row_fm5vz_96", te = {
|
|
3508
|
+
list: Vi,
|
|
3509
|
+
bar: Bi,
|
|
3510
3510
|
heading: Gi,
|
|
3511
3511
|
filler: $i,
|
|
3512
|
-
asOf:
|
|
3513
|
-
live:
|
|
3514
|
-
label:
|
|
3512
|
+
asOf: Ki,
|
|
3513
|
+
live: Hi,
|
|
3514
|
+
label: ji,
|
|
3515
3515
|
counter: Wi,
|
|
3516
3516
|
state: qi,
|
|
3517
3517
|
lifecycle: Ui,
|
|
@@ -3521,54 +3521,54 @@ const Bi = "_list_jm069_4 _text_k1tvc_23", ji = "_bar_jm069_12", Gi = "_heading_
|
|
|
3521
3521
|
empty: Qi,
|
|
3522
3522
|
row: Zi
|
|
3523
3523
|
};
|
|
3524
|
-
function
|
|
3524
|
+
function el(e, t) {
|
|
3525
3525
|
switch (e) {
|
|
3526
|
-
case "
|
|
3527
|
-
return t.
|
|
3528
|
-
case "
|
|
3529
|
-
return t.
|
|
3530
|
-
case "
|
|
3531
|
-
return t.
|
|
3526
|
+
case "active-unacknowledged":
|
|
3527
|
+
return t.lifecycleActiveUnacknowledged;
|
|
3528
|
+
case "active-acknowledged":
|
|
3529
|
+
return t.lifecycleActiveAcknowledged;
|
|
3530
|
+
case "resolved-unacknowledged":
|
|
3531
|
+
return t.lifecycleResolvedUnacknowledged;
|
|
3532
3532
|
default:
|
|
3533
|
-
return t.
|
|
3533
|
+
return t.lifecycleResolvedAcknowledged;
|
|
3534
3534
|
}
|
|
3535
3535
|
}
|
|
3536
|
-
function
|
|
3536
|
+
function tl(e, t, n) {
|
|
3537
3537
|
switch (e.availability) {
|
|
3538
|
-
case "
|
|
3539
|
-
const o = e.alarm.
|
|
3538
|
+
case "snoozed": {
|
|
3539
|
+
const o = e.alarm.snooze;
|
|
3540
3540
|
if (!o) return null;
|
|
3541
|
-
const r = new Date(o.until), s = new Date(e.alarm.raised + e.age),
|
|
3542
|
-
return { short: t.
|
|
3541
|
+
const r = new Date(o.until), s = new Date(e.alarm.raised + e.age), l = r.toDateString() === s.toDateString() ? n.time(r, !1) : n.dateTime(r, !1);
|
|
3542
|
+
return { short: t.availabilitySnoozedShort, full: t.availabilitySnoozed(l, o.by) };
|
|
3543
3543
|
}
|
|
3544
|
-
case "suppressed
|
|
3545
|
-
return { short: t.
|
|
3546
|
-
case "
|
|
3547
|
-
return { short: t.
|
|
3544
|
+
case "suppressed":
|
|
3545
|
+
return { short: t.availabilitySuppressed, full: t.availabilitySuppressed };
|
|
3546
|
+
case "disabled":
|
|
3547
|
+
return { short: t.availabilityDisabled, full: t.availabilityDisabled };
|
|
3548
3548
|
default:
|
|
3549
3549
|
return null;
|
|
3550
3550
|
}
|
|
3551
3551
|
}
|
|
3552
|
-
function
|
|
3552
|
+
function nl(e, t) {
|
|
3553
3553
|
return e === "high" ? t.priorityHigh : e === "medium" ? t.priorityMedium : t.priorityLow;
|
|
3554
3554
|
}
|
|
3555
|
-
function
|
|
3555
|
+
function ol(e) {
|
|
3556
3556
|
return e === "high" ? "danger" : e === "medium" ? "warning" : "neutral";
|
|
3557
3557
|
}
|
|
3558
|
-
function
|
|
3558
|
+
function rl(e, t) {
|
|
3559
3559
|
const n = Math.max(0, Math.floor(e / 6e4)), o = Math.floor(n / 60), r = n % 60, s = [];
|
|
3560
3560
|
return o > 0 && s.push(t.hoursShort(o)), (o === 0 || r > 0) && s.push(t.minutesShort(r)), s.join(" ");
|
|
3561
3561
|
}
|
|
3562
|
-
function
|
|
3562
|
+
function Nl(e) {
|
|
3563
3563
|
const { asOf: t, freshness: n, ...o } = e;
|
|
3564
|
-
return t === void 0 || n === void 0 ? /* @__PURE__ */ u(Nn, { ...o, freshness: null }) : /* @__PURE__ */ u(
|
|
3564
|
+
return t === void 0 || n === void 0 ? /* @__PURE__ */ u(Nn, { ...o, freshness: null }) : /* @__PURE__ */ u(sl, { ...o, asOf: t, ages: n });
|
|
3565
3565
|
}
|
|
3566
|
-
function
|
|
3566
|
+
function sl({
|
|
3567
3567
|
asOf: e,
|
|
3568
3568
|
ages: t,
|
|
3569
3569
|
...n
|
|
3570
3570
|
}) {
|
|
3571
|
-
const o =
|
|
3571
|
+
const o = zn(e, t);
|
|
3572
3572
|
return /* @__PURE__ */ u(Nn, { ...n, freshness: o });
|
|
3573
3573
|
}
|
|
3574
3574
|
function Nn({
|
|
@@ -3579,35 +3579,35 @@ function Nn({
|
|
|
3579
3579
|
className: r,
|
|
3580
3580
|
freshness: s,
|
|
3581
3581
|
hiddenOnly: i = !1,
|
|
3582
|
-
onHiddenOnlyChange:
|
|
3582
|
+
onHiddenOnlyChange: l,
|
|
3583
3583
|
...c
|
|
3584
3584
|
}) {
|
|
3585
|
-
const
|
|
3586
|
-
return /* @__PURE__ */
|
|
3587
|
-
/* @__PURE__ */
|
|
3588
|
-
/* @__PURE__ */ u("span", { className: te.heading, children:
|
|
3589
|
-
e.flood !== null && /* @__PURE__ */ u(
|
|
3590
|
-
d && s !== null && /* @__PURE__ */
|
|
3591
|
-
s.freshness === "lost" ?
|
|
3585
|
+
const a = re(), f = be(), d = s !== null, p = (s == null ? void 0 : s.freshness) === "lost", { Table: b, Column: S } = ki(e.visible, { rowKey: (g) => g.id, selection: t }), v = q(() => e.filtered.map((g) => g.alarm), [e.filtered]), O = q(() => t === void 0 ? [] : e.filtered.map((g) => g.id).filter((g) => t.selected.has(g)), [e.filtered, t]), w = q(() => Ri(v, O), [v, O]), _ = Qt(o, "compact"), F = a.hiddenAlarms(e.hiddenAlarms);
|
|
3586
|
+
return /* @__PURE__ */ R("div", { className: [te.list, r].filter(Boolean).join(" "), ...c, children: [
|
|
3587
|
+
/* @__PURE__ */ R("div", { className: te.bar, children: [
|
|
3588
|
+
/* @__PURE__ */ u("span", { className: te.heading, children: a.alarms }),
|
|
3589
|
+
e.flood !== null && /* @__PURE__ */ u(Pe, { tone: "warning", children: a.floodHint(e.flood.count) }),
|
|
3590
|
+
d && s !== null && /* @__PURE__ */ R("span", { className: te.asOf, "data-freshness": s.freshness, children: [
|
|
3591
|
+
s.freshness === "lost" ? a.freshnessDisconnected : s.freshness === "stale" ? a.freshnessStale : a.freshnessFresh,
|
|
3592
3592
|
s.age !== null && ` · ${f.relative(s.age)}`
|
|
3593
3593
|
] }),
|
|
3594
|
-
|
|
3594
|
+
l !== void 0 && (e.hiddenAlarms > 0 || i) ? /* @__PURE__ */ u(
|
|
3595
3595
|
Le,
|
|
3596
3596
|
{
|
|
3597
3597
|
className: te.hidden,
|
|
3598
3598
|
checked: i,
|
|
3599
|
-
onChange: (g) =>
|
|
3599
|
+
onChange: (g) => l(g.currentTarget.checked),
|
|
3600
3600
|
label: /* @__PURE__ */ u("span", { className: te.hiddenLabel, children: F })
|
|
3601
3601
|
}
|
|
3602
|
-
) : e.
|
|
3602
|
+
) : e.hiddenAlarms > 0 && /* @__PURE__ */ u("span", { className: te.hidden, children: F }),
|
|
3603
3603
|
/* @__PURE__ */ u("span", { className: te.filler }),
|
|
3604
|
-
t !== void 0 && n !== void 0 && /* @__PURE__ */ u(fe, { variant: "primary", size: "sm", disabled: w === 0, onClick: () => n(
|
|
3604
|
+
t !== void 0 && n !== void 0 && /* @__PURE__ */ u(fe, { variant: "primary", size: "sm", disabled: w === 0, onClick: () => n(O), children: w === 0 ? a.acknowledgeAlarm : a.acknowledgeAlarms(w) })
|
|
3605
3605
|
] }),
|
|
3606
|
-
/* @__PURE__ */ u("div", { "aria-live": "polite", "aria-atomic": "true", className: te.live, children:
|
|
3607
|
-
/* @__PURE__ */
|
|
3606
|
+
/* @__PURE__ */ u("div", { "aria-live": "polite", "aria-atomic": "true", className: te.live, children: a.activeUnacknowledged(e.activeUnacknowledged) }),
|
|
3607
|
+
/* @__PURE__ */ R(
|
|
3608
3608
|
b,
|
|
3609
3609
|
{
|
|
3610
|
-
ariaLabel:
|
|
3610
|
+
ariaLabel: a.alarms,
|
|
3611
3611
|
selectable: t !== void 0,
|
|
3612
3612
|
density: _,
|
|
3613
3613
|
stickyHeader: !0,
|
|
@@ -3617,35 +3617,35 @@ function Nn({
|
|
|
3617
3617
|
"data-priority": g.priority,
|
|
3618
3618
|
"data-availability": g.availability
|
|
3619
3619
|
}),
|
|
3620
|
-
empty: /* @__PURE__ */ u("span", { className: te.empty, children: p ?
|
|
3620
|
+
empty: /* @__PURE__ */ u("span", { className: te.empty, children: p ? a.noAlarmsDisconnected : a.noAlarms }),
|
|
3621
3621
|
children: [
|
|
3622
|
-
/* @__PURE__ */ u(S, { id: "type", label:
|
|
3622
|
+
/* @__PURE__ */ u(S, { id: "type", label: a.columnAlarm, value: (g) => g.type.label, rowHeader: !0, sortable: !1, children: (g, C) => /* @__PURE__ */ R(ne, { children: [
|
|
3623
3623
|
/* @__PURE__ */ u("span", { className: te.label, children: g }),
|
|
3624
|
-
C.chatters && /* @__PURE__ */ u(
|
|
3624
|
+
C.chatters && /* @__PURE__ */ u(Pe, { tone: "warning", pill: !0, className: te.counter, children: a.chatterHint(C.frequency) })
|
|
3625
3625
|
] }) }),
|
|
3626
|
-
/* @__PURE__ */ u(S, { value: "lifecycle", label:
|
|
3627
|
-
const A =
|
|
3626
|
+
/* @__PURE__ */ u(S, { value: "lifecycle", label: a.columnLifecycleState, sortable: !1, children: (g, C) => {
|
|
3627
|
+
const A = tl(C, a, f), L = A === null ? null : A.short === A.full ? /* @__PURE__ */ u(Pe, { className: te.availability, children: A.short }) : /* @__PURE__ */ u(En, { content: A.full, children: /* @__PURE__ */ R(Pe, { className: te.availability, children: [
|
|
3628
3628
|
/* @__PURE__ */ u("span", { "aria-hidden": "true", children: A.short }),
|
|
3629
3629
|
/* @__PURE__ */ u(De, { children: A.full })
|
|
3630
3630
|
] }) });
|
|
3631
|
-
return /* @__PURE__ */
|
|
3631
|
+
return /* @__PURE__ */ R("span", { className: te.state, children: [
|
|
3632
3632
|
L,
|
|
3633
|
-
/* @__PURE__ */ u("span", { className: te.lifecycle, children:
|
|
3633
|
+
/* @__PURE__ */ u("span", { className: te.lifecycle, children: el(g, a) })
|
|
3634
3634
|
] });
|
|
3635
3635
|
} }),
|
|
3636
|
-
/* @__PURE__ */ u(S, { value: "priority", label:
|
|
3636
|
+
/* @__PURE__ */ u(S, { value: "priority", label: a.columnPriority, sortable: !1, children: (g, C) => /* @__PURE__ */ u(Pe, { tone: ht(C.availability) ? "neutral" : ol(g), children: nl(g, a) }) }),
|
|
3637
3637
|
/* @__PURE__ */ u(
|
|
3638
3638
|
S,
|
|
3639
3639
|
{
|
|
3640
3640
|
id: "raised",
|
|
3641
|
-
label:
|
|
3641
|
+
label: a.columnRaised,
|
|
3642
3642
|
value: (g) => new Date(g.alarm.raised),
|
|
3643
3643
|
numeric: !0,
|
|
3644
3644
|
sortable: !1
|
|
3645
3645
|
}
|
|
3646
3646
|
),
|
|
3647
|
-
/* @__PURE__ */ u(S, { value: "duration", label:
|
|
3648
|
-
/* @__PURE__ */ u(S, { value: "frequency", label:
|
|
3647
|
+
/* @__PURE__ */ u(S, { value: "duration", label: a.columnDuration, sortable: !1, children: (g) => rl(g, a) }),
|
|
3648
|
+
/* @__PURE__ */ u(S, { value: "frequency", label: a.columnFrequency, format: "count", sortable: !1 })
|
|
3649
3649
|
]
|
|
3650
3650
|
}
|
|
3651
3651
|
)
|
|
@@ -3653,36 +3653,36 @@ function Nn({
|
|
|
3653
3653
|
}
|
|
3654
3654
|
export {
|
|
3655
3655
|
Ei as ALARM_COLUMNS,
|
|
3656
|
-
|
|
3657
|
-
|
|
3658
|
-
|
|
3659
|
-
|
|
3660
|
-
|
|
3656
|
+
Ti as AVAILABILITIES,
|
|
3657
|
+
Nl as AlarmList,
|
|
3658
|
+
pl as ColumnMenu,
|
|
3659
|
+
zi as DEFAULT_ORDER,
|
|
3660
|
+
ml as Export,
|
|
3661
3661
|
Si as PRIORITIES,
|
|
3662
|
-
|
|
3663
|
-
|
|
3664
|
-
|
|
3665
|
-
|
|
3666
|
-
|
|
3667
|
-
|
|
3668
|
-
|
|
3669
|
-
|
|
3670
|
-
|
|
3671
|
-
|
|
3672
|
-
|
|
3662
|
+
bl as Pagination,
|
|
3663
|
+
gl as Search,
|
|
3664
|
+
hl as Toolbar,
|
|
3665
|
+
Cl as acknowledge,
|
|
3666
|
+
Pi as alarmColumns,
|
|
3667
|
+
xl as alarmModel,
|
|
3668
|
+
Oi as availabilityAt,
|
|
3669
|
+
fl as column,
|
|
3670
|
+
dl as columnFilter,
|
|
3671
|
+
Ri as countAcknowledgeable,
|
|
3672
|
+
Sl as countInWindow,
|
|
3673
3673
|
Di as detectFlood,
|
|
3674
|
+
yl as disable,
|
|
3675
|
+
_l as enable,
|
|
3674
3676
|
Mi as frequencyByType,
|
|
3675
|
-
|
|
3677
|
+
kl as hasReturned,
|
|
3676
3678
|
Ye as isAcknowledged,
|
|
3679
|
+
xi as isActive,
|
|
3677
3680
|
Ni as isDone,
|
|
3678
|
-
ht as
|
|
3679
|
-
xi as isStanding,
|
|
3681
|
+
ht as isHidden,
|
|
3680
3682
|
Ai as nextLifecycleState,
|
|
3681
3683
|
Ci as priorityRank,
|
|
3682
|
-
|
|
3683
|
-
|
|
3684
|
-
ya as takeOutOfService,
|
|
3685
|
-
wa as unshelve,
|
|
3684
|
+
vl as snooze,
|
|
3685
|
+
wl as unsnooze,
|
|
3686
3686
|
ki as useTable,
|
|
3687
|
-
|
|
3687
|
+
Vn as useTableSelection
|
|
3688
3688
|
};
|