@umriss-ui/table 0.9.0 → 0.10.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 +21 -0
- package/dist/table.css +1 -1
- package/dist/table.js +470 -470
- package/docs/llms-full.md +6154 -5331
- package/package.json +3 -3
package/dist/table.js
CHANGED
|
@@ -2,15 +2,15 @@ import "./table.css";
|
|
|
2
2
|
var so = Object.defineProperty;
|
|
3
3
|
var io = (e, t, n) => t in e ? so(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
|
4
4
|
var J = (e, t, n) => io(e, typeof t != "symbol" ? t + "" : t, n);
|
|
5
|
-
import { useState as Z, useCallback as ke, useMemo as se, useRef as
|
|
6
|
-
import { DEFAULT_FORMATS as Cn, treeModel as en, useVirtual as lo, useFormats as Oe, useWording as be, Checkbox as qe, DateRangePicker as ao, FormField as At, NumberInput as Rt, Tooltip as ot, Popover as gt, Button as he, TagGroup as xn, Tag as Kt, Menu as Nn, MenuItem as ft, MenuSeparator as co, VisuallyHidden as Pe, Select as An, DatePicker as
|
|
5
|
+
import { useState as Z, useCallback as ke, useMemo as se, useRef as ue, useId as Te, useContext as Fe, createContext as ht, useSyncExternalStore as pt, useLayoutEffect as ae, useEffect as st } from "react";
|
|
6
|
+
import { DEFAULT_FORMATS as Cn, treeModel as en, useVirtual as lo, useFormats as Oe, useWording as be, Checkbox as qe, DateRangePicker as ao, FormField as At, NumberInput as Rt, Tooltip as ot, Popover as gt, Button as he, TagGroup as xn, Tag as Kt, Menu as Nn, MenuItem as ft, MenuSeparator as co, ControlSizeProvider as uo, VisuallyHidden as Pe, Select as An, DatePicker as fo, Input as Rn, useDensityFor as Tn, AngleGlyph as ho, IconButton as po, assess as go, verdictWeight as Tt, allBranches as mo, duplicateKey as bo, DEFAULT_WORDING as wo, Badge as et, useFreshness as vo } from "@umriss-ui/core";
|
|
7
7
|
import { jsx as c, jsxs as M, Fragment as me } from "react/jsx-runtime";
|
|
8
|
-
import { createPortal as
|
|
9
|
-
function
|
|
8
|
+
import { createPortal as yo } from "react-dom";
|
|
9
|
+
function _o(e) {
|
|
10
10
|
const [t, n] = Z(/* @__PURE__ */ new Set()), o = ke((a) => t.has(a), [t]), r = ke((a) => {
|
|
11
11
|
n((f) => {
|
|
12
|
-
const
|
|
13
|
-
return
|
|
12
|
+
const u = new Set(f);
|
|
13
|
+
return u.has(a) ? u.delete(a) : u.add(a), u;
|
|
14
14
|
});
|
|
15
15
|
}, []), s = se(
|
|
16
16
|
() => e.length > 0 && e.every((a) => t.has(a)),
|
|
@@ -18,13 +18,13 @@ function yo(e) {
|
|
|
18
18
|
), l = se(
|
|
19
19
|
() => !s && e.some((a) => t.has(a)),
|
|
20
20
|
[e, t, s]
|
|
21
|
-
),
|
|
21
|
+
), d = ke(() => {
|
|
22
22
|
n((a) => {
|
|
23
23
|
const f = new Set(a);
|
|
24
24
|
return e.length > 0 && e.every((m) => f.has(m)) ? e.forEach((m) => f.delete(m)) : e.forEach((m) => f.add(m)), f;
|
|
25
25
|
});
|
|
26
26
|
}, [e]), i = ke(() => n(/* @__PURE__ */ new Set()), []);
|
|
27
|
-
return { selected: t, isSelected: o, toggle: r, toggleAll:
|
|
27
|
+
return { selected: t, isSelected: o, toggle: r, toggleAll: d, clear: i, allSelected: s, someSelected: l, count: t.size };
|
|
28
28
|
}
|
|
29
29
|
const ve = (e) => e == null || typeof e == "number" && Number.isNaN(e);
|
|
30
30
|
function mt(e) {
|
|
@@ -73,7 +73,7 @@ function Ot(e, t) {
|
|
|
73
73
|
}
|
|
74
74
|
}
|
|
75
75
|
}
|
|
76
|
-
const
|
|
76
|
+
const ko = "ja", So = "nein";
|
|
77
77
|
function Mn(e, t) {
|
|
78
78
|
if (!ve(e)) {
|
|
79
79
|
if (t) return Mn(t(e));
|
|
@@ -85,7 +85,7 @@ function Mn(e, t) {
|
|
|
85
85
|
case "date":
|
|
86
86
|
return e.toISOString();
|
|
87
87
|
case "boolean":
|
|
88
|
-
return e ?
|
|
88
|
+
return e ? ko : So;
|
|
89
89
|
default:
|
|
90
90
|
return;
|
|
91
91
|
}
|
|
@@ -99,18 +99,18 @@ function jt(e, t) {
|
|
|
99
99
|
if (o === "distinct") return new Set(n.map(Be)).size;
|
|
100
100
|
const r = n.filter((i) => tn(i) !== void 0);
|
|
101
101
|
if (r.length === 0) return;
|
|
102
|
-
const s = r.map((i) => tn(i)), l = r[0] instanceof Date,
|
|
102
|
+
const s = r.map((i) => tn(i)), l = r[0] instanceof Date, d = (i) => l ? new Date(i) : i;
|
|
103
103
|
switch (o) {
|
|
104
104
|
case "sum":
|
|
105
105
|
return s.reduce((i, a) => i + a, 0);
|
|
106
106
|
case "avg":
|
|
107
107
|
return s.reduce((i, a) => i + a, 0) / s.length;
|
|
108
108
|
case "min":
|
|
109
|
-
return
|
|
109
|
+
return d(Math.min(...s));
|
|
110
110
|
case "max":
|
|
111
|
-
return
|
|
111
|
+
return d(Math.max(...s));
|
|
112
112
|
case "range":
|
|
113
|
-
return [
|
|
113
|
+
return [d(Math.min(...s)), d(Math.max(...s))];
|
|
114
114
|
}
|
|
115
115
|
}
|
|
116
116
|
const Wt = 3, rt = (e) => {
|
|
@@ -121,10 +121,10 @@ function kt(e, t, n) {
|
|
|
121
121
|
const o = rt(e), r = rt(t);
|
|
122
122
|
return o === void 0 || r === void 0 ? o === r ? 0 : o === void 0 ? 1 : -1 : typeof o == "number" && typeof r == "number" ? o - r : n(String(o), String(r));
|
|
123
123
|
}
|
|
124
|
-
function
|
|
124
|
+
function Co(e, t) {
|
|
125
125
|
const n = t.compareText ?? Cn.compareText, o = (r, s, l) => {
|
|
126
126
|
var p;
|
|
127
|
-
const
|
|
127
|
+
const d = /* @__PURE__ */ new Map(), i = t.levels[s];
|
|
128
128
|
if (!i) return [];
|
|
129
129
|
const a = /* @__PURE__ */ new Map();
|
|
130
130
|
for (const g of r) {
|
|
@@ -137,7 +137,7 @@ function So(e, t) {
|
|
|
137
137
|
rows: [],
|
|
138
138
|
groups: [],
|
|
139
139
|
aggregates: {}
|
|
140
|
-
}, a.set(P, _),
|
|
140
|
+
}, a.set(P, _), d.set(_, [...l, P])), _.rows.push(g);
|
|
141
141
|
}
|
|
142
142
|
for (const g of a.values())
|
|
143
143
|
for (const O of t.aggregates ?? []) g.aggregates[O.id] = jt(O, g.rows);
|
|
@@ -146,7 +146,7 @@ function So(e, t) {
|
|
|
146
146
|
var O;
|
|
147
147
|
return g.column === i.id || ((O = t.aggregates) == null ? void 0 : O.some((P) => P.id === g.column));
|
|
148
148
|
}
|
|
149
|
-
),
|
|
149
|
+
), u = (f == null ? void 0 : f.direction) === "desc" ? -1 : 1, m = f !== void 0 && f.column !== i.id ? f.column : void 0, v = (g) => {
|
|
150
150
|
let O;
|
|
151
151
|
for (const P of g.rows) {
|
|
152
152
|
const _ = i.order(P);
|
|
@@ -160,52 +160,52 @@ function So(e, t) {
|
|
|
160
160
|
}, b = [...a.values()].sort((g, O) => {
|
|
161
161
|
if (g.value === void 0 || O.value === void 0) return kt(g.value, O.value, n);
|
|
162
162
|
const P = w(g), _ = w(O), k = kt(P, _, n);
|
|
163
|
-
return rt(P) === void 0 || rt(_) === void 0 ? k : k *
|
|
163
|
+
return rt(P) === void 0 || rt(_) === void 0 ? k : k * u;
|
|
164
164
|
});
|
|
165
165
|
for (const g of b)
|
|
166
|
-
g.groups = o(g.rows, s + 1,
|
|
166
|
+
g.groups = o(g.rows, s + 1, d.get(g));
|
|
167
167
|
return b;
|
|
168
168
|
};
|
|
169
169
|
return o(e, 0, []);
|
|
170
170
|
}
|
|
171
|
-
function
|
|
171
|
+
function xo(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 No = (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 Ao(e) {
|
|
184
184
|
const t = new Date(e.getFullYear(), e.getMonth(), e.getDate() + 3 - (e.getDay() + 6) % 7), n = new Date(t.getFullYear(), 0, 4);
|
|
185
185
|
return { week: 1 + Math.round((t.getTime() - n.getTime()) / 864e5 / 7 - ((n.getDay() + 6) % 7 - 3) / 7), year: t.getFullYear() };
|
|
186
186
|
}
|
|
187
|
-
function
|
|
187
|
+
function Ro(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 } = Ao(t);
|
|
192
192
|
return o.calendarWeek(r, s);
|
|
193
193
|
}
|
|
194
194
|
return n.date(t);
|
|
195
195
|
}
|
|
196
|
-
function
|
|
196
|
+
function To(e, t) {
|
|
197
197
|
const n = [], o = (r, s) => {
|
|
198
198
|
for (const l of r) {
|
|
199
|
-
const
|
|
199
|
+
const d = t.has(l.path);
|
|
200
200
|
if (l.groups.length === 0 && l.level === 0) {
|
|
201
|
-
if (n.push({ kind: "header", group: l, parents: s, continued: !1 }), !
|
|
201
|
+
if (n.push({ kind: "header", group: l, parents: s, continued: !1 }), !d)
|
|
202
202
|
for (const i of l.rows) n.push({ kind: "row", row: i, parents: [l], span: void 0, first: !1, continued: !1 });
|
|
203
|
-
} else l.groups.length > 0 ? (n.push({ kind: "header", group: l, parents: s, continued: !1 }),
|
|
203
|
+
} else l.groups.length > 0 ? (n.push({ kind: "header", group: l, parents: s, continued: !1 }), d || o(l.groups, [...s, l])) : d ? n.push({ kind: "folded", group: l, parents: s }) : l.rows.forEach((i, a) => n.push({ kind: "row", row: i, parents: s, span: l, first: a === 0, continued: !1 }));
|
|
204
204
|
}
|
|
205
205
|
};
|
|
206
206
|
return o(e, []), n;
|
|
207
207
|
}
|
|
208
|
-
function
|
|
208
|
+
function Oo(e, t, n) {
|
|
209
209
|
const o = n > 0 ? n : e.length || 1, r = Math.max(1, Math.ceil(e.length / o)), s = Math.min(Math.max(1, t), r), l = e.slice((s - 1) * o, s * o);
|
|
210
210
|
return { lines: Fn(l), page: s, pageCount: r };
|
|
211
211
|
}
|
|
@@ -227,7 +227,7 @@ function Ut(e, t) {
|
|
|
227
227
|
...e.filter((n) => !t.includes(n.id))
|
|
228
228
|
] : e;
|
|
229
229
|
}
|
|
230
|
-
const je = (e) => e == null || typeof e == "number" && Number.isNaN(e),
|
|
230
|
+
const je = (e) => e == null || typeof e == "number" && Number.isNaN(e), Mo = (e, t) => typeof e == "number" && typeof t == "number" ? e - t : Cn.compareText(String(e), String(t));
|
|
231
231
|
function Yt(e, t, n) {
|
|
232
232
|
var L;
|
|
233
233
|
const {
|
|
@@ -235,19 +235,19 @@ function Yt(e, t, n) {
|
|
|
235
235
|
filter: r,
|
|
236
236
|
sort: s = null,
|
|
237
237
|
page: l = 1,
|
|
238
|
-
pageSize:
|
|
238
|
+
pageSize: d,
|
|
239
239
|
hidden: i,
|
|
240
240
|
order: a
|
|
241
|
-
} = n, f = Ut(t, a),
|
|
241
|
+
} = n, f = Ut(t, a), u = i != null && i.length ? f.filter((R) => R.hideable === !1 || !i.includes(R.id)) : f;
|
|
242
242
|
if (n.manual) {
|
|
243
|
-
const { rowCount: R } = n.manual, K =
|
|
243
|
+
const { rowCount: R } = n.manual, K = d && d > 0 ? d : Math.max(R, 1), q = Math.max(1, Math.ceil(R / K)), E = R > 0 ? Math.min(Math.max(1, l), q) : Math.max(1, l);
|
|
244
244
|
return {
|
|
245
|
-
columns:
|
|
245
|
+
columns: u,
|
|
246
246
|
filtered: [...e],
|
|
247
247
|
visible: [...e],
|
|
248
248
|
page: E,
|
|
249
249
|
pageCount: q,
|
|
250
|
-
columnCount:
|
|
250
|
+
columnCount: u.length
|
|
251
251
|
};
|
|
252
252
|
}
|
|
253
253
|
const m = o.trim().toLowerCase(), v = t.filter((R) => R.searchable && R.value), w = (R) => !m || v.some((K) => {
|
|
@@ -259,7 +259,7 @@ function Yt(e, t, n) {
|
|
|
259
259
|
const q = R.direction === "asc" ? 1 : -1, E = K.compare, D = K.value;
|
|
260
260
|
return D ? (F, X) => {
|
|
261
261
|
const Q = D(F), ye = D(X);
|
|
262
|
-
return je(Q) || je(ye) ? je(Q) === je(ye) ? 0 : je(Q) ? 1 : -1 : (E ? E(F, X) :
|
|
262
|
+
return je(Q) || je(ye) ? je(Q) === je(ye) ? 0 : je(Q) ? 1 : -1 : (E ? E(F, X) : Mo(Q, ye)) * q;
|
|
263
263
|
} : (F, X) => E(F, X) * q;
|
|
264
264
|
}).filter((R) => R !== null), O = (R) => (
|
|
265
265
|
// Array#sort is stable (ES2019), equal values keep their order.
|
|
@@ -271,12 +271,12 @@ function Yt(e, t, n) {
|
|
|
271
271
|
return 0;
|
|
272
272
|
})
|
|
273
273
|
);
|
|
274
|
-
if (n.tree) return
|
|
274
|
+
if (n.tree) return Fo(e, n.tree, O, m || r ? b : void 0, u);
|
|
275
275
|
const P = O(e.filter(b));
|
|
276
276
|
if ((L = n.grouping) != null && L.levels.length) {
|
|
277
|
-
const { folded: R, ...K } = n.grouping, q =
|
|
277
|
+
const { folded: R, ...K } = n.grouping, q = Co(P, { ...K, sort: p }), E = To(q, R), D = Oo(E, l, d ?? 0);
|
|
278
278
|
return {
|
|
279
|
-
columns:
|
|
279
|
+
columns: u,
|
|
280
280
|
filtered: P,
|
|
281
281
|
visible: qt(D.lines),
|
|
282
282
|
groups: q,
|
|
@@ -284,32 +284,32 @@ function Yt(e, t, n) {
|
|
|
284
284
|
visibleLines: D.lines,
|
|
285
285
|
page: D.page,
|
|
286
286
|
pageCount: D.pageCount,
|
|
287
|
-
columnCount:
|
|
287
|
+
columnCount: u.length
|
|
288
288
|
};
|
|
289
289
|
}
|
|
290
|
-
const _ =
|
|
290
|
+
const _ = d && d > 0 ? d : P.length || 1, k = Math.max(1, Math.ceil(P.length / _)), C = Math.min(Math.max(1, l), k), N = P.slice((C - 1) * _, C * _);
|
|
291
291
|
return {
|
|
292
|
-
columns:
|
|
292
|
+
columns: u,
|
|
293
293
|
filtered: P,
|
|
294
294
|
visible: N,
|
|
295
295
|
page: C,
|
|
296
296
|
pageCount: k,
|
|
297
|
-
columnCount:
|
|
297
|
+
columnCount: u.length
|
|
298
298
|
};
|
|
299
299
|
}
|
|
300
|
-
function
|
|
301
|
-
const { admit: s } = t, l = (g) => n(s ? g.filter(s) : g),
|
|
300
|
+
function Fo(e, t, n, o, r) {
|
|
301
|
+
const { admit: s } = t, l = (g) => n(s ? g.filter(s) : g), d = /* @__PURE__ */ new Map(), i = {
|
|
302
302
|
key: t.key,
|
|
303
303
|
children: (g) => {
|
|
304
|
-
if (!
|
|
304
|
+
if (!d.has(g)) {
|
|
305
305
|
const O = t.children(g);
|
|
306
|
-
|
|
306
|
+
d.set(g, O && l(O));
|
|
307
307
|
}
|
|
308
|
-
return
|
|
308
|
+
return d.get(g);
|
|
309
309
|
},
|
|
310
310
|
label: () => "",
|
|
311
311
|
matches: o
|
|
312
|
-
}, a = l(e), f = { expanded: t.open, checked: /* @__PURE__ */ new Set(), active: null, anchor: null, search: "" },
|
|
312
|
+
}, a = l(e), f = { expanded: t.open, checked: /* @__PURE__ */ new Set(), active: null, anchor: null, search: "" }, u = en(a, i, f), m = /* @__PURE__ */ new Set();
|
|
313
313
|
let v = 0;
|
|
314
314
|
const w = (g) => {
|
|
315
315
|
for (const O of g) {
|
|
@@ -319,12 +319,12 @@ function Mo(e, t, n, o, r) {
|
|
|
319
319
|
}
|
|
320
320
|
};
|
|
321
321
|
w(a);
|
|
322
|
-
const b = en(a, i, { ...f, expanded: m }), p =
|
|
322
|
+
const b = en(a, i, { ...f, expanded: m }), p = u.map((g) => g.node);
|
|
323
323
|
return {
|
|
324
324
|
columns: r,
|
|
325
325
|
filtered: b.filter((g) => g.matches).map((g) => g.node),
|
|
326
326
|
visible: p,
|
|
327
|
-
entries:
|
|
327
|
+
entries: u,
|
|
328
328
|
shown: p,
|
|
329
329
|
roots: b.filter((g) => g.level === 0).map((g) => g.node),
|
|
330
330
|
exported: b.filter((g) => g.matches || g.pathOnly),
|
|
@@ -334,8 +334,8 @@ function Mo(e, t, n, o, r) {
|
|
|
334
334
|
columnCount: r.length
|
|
335
335
|
};
|
|
336
336
|
}
|
|
337
|
-
function
|
|
338
|
-
const { rowKey: o, filter: r, defaultSort: s = null, initialView: l, virtual:
|
|
337
|
+
function Lo(e, t, n) {
|
|
338
|
+
const { rowKey: o, filter: r, defaultSort: s = null, initialView: l, virtual: d, grouping: i, manual: a, tree: f } = n, [u, m] = Z((l == null ? void 0 : l.search) ?? ""), [v, w] = Z(() => {
|
|
339
339
|
var I;
|
|
340
340
|
return (I = l == null ? void 0 : l.sort) != null && I.length ? [...l.sort] : s ? Array.isArray(s) ? [...s] : [s] : [];
|
|
341
341
|
}), [b, p] = Z((l == null ? void 0 : l.page) ?? 1), [g, O] = Z(
|
|
@@ -346,9 +346,9 @@ function Fo(e, t, n) {
|
|
|
346
346
|
for (const U of t)
|
|
347
347
|
U.width !== void 0 && (I[U.id] = U.width);
|
|
348
348
|
return I;
|
|
349
|
-
}), q =
|
|
349
|
+
}), q = d || f ? 0 : g, E = se(
|
|
350
350
|
() => Yt(e, t, {
|
|
351
|
-
search:
|
|
351
|
+
search: u,
|
|
352
352
|
filter: r,
|
|
353
353
|
sort: v,
|
|
354
354
|
page: b,
|
|
@@ -359,17 +359,17 @@ function Fo(e, t, n) {
|
|
|
359
359
|
manual: a,
|
|
360
360
|
tree: f
|
|
361
361
|
}),
|
|
362
|
-
[e, t,
|
|
363
|
-
), D = lo(
|
|
364
|
-
rowHeight: (
|
|
365
|
-
overscan:
|
|
362
|
+
[e, t, u, r, v, b, q, k, N, i, a, f]
|
|
363
|
+
), D = lo(d ? (E.lines ?? E.shown ?? E.filtered).length : 0, {
|
|
364
|
+
rowHeight: (d == null ? void 0 : d.rowHeight) ?? 0,
|
|
365
|
+
overscan: d == null ? void 0 : d.overscan
|
|
366
366
|
}), F = se(
|
|
367
|
-
() =>
|
|
368
|
-
[
|
|
367
|
+
() => d && E.lines ? E.lines.slice(D.from, D.to) : E.visibleLines,
|
|
368
|
+
[d, E.lines, E.visibleLines, D.from, D.to]
|
|
369
369
|
), X = se(
|
|
370
|
-
() =>
|
|
371
|
-
[
|
|
372
|
-
), Q = se(() => E.filtered.map(o), [E.filtered, o]), ye =
|
|
370
|
+
() => d ? F ? qt(F) : (E.shown ?? E.filtered).slice(D.from, D.to) : E.visible,
|
|
371
|
+
[d, F, E.shown, E.filtered, E.visible, D.from, D.to]
|
|
372
|
+
), Q = se(() => E.filtered.map(o), [E.filtered, o]), ye = _o(Q), _e = ke((I) => {
|
|
373
373
|
m(I), p(1);
|
|
374
374
|
}, []), oe = ke((I) => {
|
|
375
375
|
O(I), p(1);
|
|
@@ -430,30 +430,30 @@ function Fo(e, t, n) {
|
|
|
430
430
|
for (const [U, te] of Object.entries(R))
|
|
431
431
|
ee[U] !== te && (I[U] = te);
|
|
432
432
|
return I;
|
|
433
|
-
}, [R, ee]),
|
|
433
|
+
}, [R, ee]), de = se(
|
|
434
434
|
() => s ? Array.isArray(s) ? s : [s] : [],
|
|
435
435
|
[s]
|
|
436
|
-
), Ne = v.length ===
|
|
436
|
+
), Ne = v.length === de.length && v.every(
|
|
437
437
|
(I, U) => {
|
|
438
438
|
var te, ie;
|
|
439
|
-
return I.column === ((te =
|
|
439
|
+
return I.column === ((te = de[U]) == null ? void 0 : te.column) && I.direction === ((ie = de[U]) == null ? void 0 : ie.direction);
|
|
440
440
|
}
|
|
441
441
|
), Je = se(
|
|
442
442
|
() => ({
|
|
443
|
-
...
|
|
443
|
+
...u ? { search: u } : {},
|
|
444
444
|
...v.length && !Ne ? { sort: v } : {},
|
|
445
445
|
/* Without paging there is no page a view could carry - a page three in
|
|
446
446
|
the view of a virtualised table would be a promise nobody redeems on
|
|
447
447
|
opening. */
|
|
448
|
-
...!
|
|
449
|
-
...!
|
|
448
|
+
...!d && E.page > 1 ? { page: E.page } : {},
|
|
449
|
+
...!d && g !== V ? { pageSize: g } : {},
|
|
450
450
|
...k.length ? { hidden: k } : {},
|
|
451
451
|
...N.length ? { order: N } : {},
|
|
452
452
|
...Object.keys(Y).length ? { widths: Y } : {}
|
|
453
453
|
}),
|
|
454
454
|
[
|
|
455
|
-
u,
|
|
456
455
|
d,
|
|
456
|
+
u,
|
|
457
457
|
v,
|
|
458
458
|
Ne,
|
|
459
459
|
E.page,
|
|
@@ -468,10 +468,10 @@ function Fo(e, t, n) {
|
|
|
468
468
|
...E,
|
|
469
469
|
visible: X,
|
|
470
470
|
visibleLines: F,
|
|
471
|
-
virtual:
|
|
471
|
+
virtual: d ? D : void 0,
|
|
472
472
|
manual: a,
|
|
473
473
|
view: Je,
|
|
474
|
-
search:
|
|
474
|
+
search: u,
|
|
475
475
|
setSearch: _e,
|
|
476
476
|
sort: v,
|
|
477
477
|
toggleSort: y,
|
|
@@ -493,82 +493,81 @@ function Fo(e, t, n) {
|
|
|
493
493
|
selection: ye
|
|
494
494
|
};
|
|
495
495
|
}
|
|
496
|
-
function
|
|
496
|
+
function Do(e, t) {
|
|
497
497
|
return [
|
|
498
498
|
...e.filter((n) => t[n.id] === "start"),
|
|
499
499
|
...e.filter((n) => t[n.id] === void 0),
|
|
500
500
|
...e.filter((n) => t[n.id] === "end")
|
|
501
501
|
];
|
|
502
502
|
}
|
|
503
|
-
function
|
|
503
|
+
function Eo(e, t) {
|
|
504
504
|
const n = {};
|
|
505
505
|
for (const o of e) o.pin && (n[o.id] = o.pin);
|
|
506
506
|
return t !== void 0 && !n[t] && (n[t] = "start"), n;
|
|
507
507
|
}
|
|
508
|
-
function
|
|
508
|
+
function Bo(e, t, n) {
|
|
509
509
|
const o = { ...e };
|
|
510
510
|
return n ? o[t] = n : delete o[t], o;
|
|
511
511
|
}
|
|
512
|
-
const
|
|
513
|
-
function
|
|
512
|
+
const Po = (e, t) => Object.keys(e).length === Object.keys(t).length && Object.entries(e).every(([n, o]) => t[n] === o);
|
|
513
|
+
function Io(e, t, n) {
|
|
514
514
|
if (!e) return;
|
|
515
515
|
const o = n.size === 0 ? e : Object.fromEntries(Object.entries(e).filter(([r]) => n.has(r)));
|
|
516
|
-
return
|
|
516
|
+
return Po(o, t) ? void 0 : o;
|
|
517
517
|
}
|
|
518
|
-
function
|
|
518
|
+
function zo(e, t, n = t) {
|
|
519
519
|
if (n < e.start) return { side: "start", at: t, edge: n === e.start - 1 };
|
|
520
520
|
const o = e.count - e.end;
|
|
521
521
|
if (e.end > 0 && t >= o) return { side: "end", at: e.count - 1 - n, edge: t === o };
|
|
522
522
|
}
|
|
523
|
-
const
|
|
524
|
-
function
|
|
525
|
-
const o = n - Math.min(n / 2,
|
|
523
|
+
const Vo = 256;
|
|
524
|
+
function $o(e, t, n) {
|
|
525
|
+
const o = n - Math.min(n / 2, Vo);
|
|
526
526
|
return n <= 0 || e + t <= o ? { start: !0, end: !0 } : e > 0 && e <= o ? { start: !0, end: !1 } : { start: !1, end: t > 0 && t <= o };
|
|
527
527
|
}
|
|
528
|
-
const
|
|
529
|
-
function
|
|
528
|
+
const Ko = (e) => JSON.stringify([e.search, e.conditions, e.sort, e.page, e.pageSize]);
|
|
529
|
+
function Go() {
|
|
530
530
|
var t;
|
|
531
531
|
const e = import.meta;
|
|
532
532
|
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;
|
|
533
533
|
}
|
|
534
|
-
const Ln =
|
|
534
|
+
const Ln = Go(), nn = /* @__PURE__ */ new Set();
|
|
535
535
|
function ge(e, t) {
|
|
536
536
|
!Ln || nn.has(e) || (nn.add(e), console.warn(`@umriss-ui/table: ${t}`));
|
|
537
537
|
}
|
|
538
|
-
const
|
|
539
|
-
frame:
|
|
540
|
-
children:
|
|
541
|
-
scroll:
|
|
542
|
-
footerTarget:
|
|
543
|
-
table:
|
|
544
|
-
th:
|
|
545
|
-
sticky:
|
|
546
|
-
td:
|
|
547
|
-
rowHeader:
|
|
548
|
-
compact:
|
|
549
|
-
sortButton:
|
|
550
|
-
numeric:
|
|
551
|
-
token:
|
|
552
|
-
absent:
|
|
553
|
-
striped:
|
|
554
|
-
pinned:
|
|
555
|
-
pinStartEdge:
|
|
556
|
-
pinEndEdge:
|
|
557
|
-
sortIndicator:
|
|
558
|
-
sortArrow:
|
|
559
|
-
sortArrowDesc:
|
|
538
|
+
const Ho = "_frame_1rr1m_11 _text_12fqh_23", jo = "_children_1rr1m_24", Wo = "_scroll_1rr1m_33 _scroll_12fqh_84", qo = "_footerTarget_1rr1m_62", Uo = "_table_1rr1m_66", Yo = "_th_1rr1m_74 _ring_12fqh_113", Jo = "_sticky_1rr1m_89", Xo = "_td_1rr1m_97", Qo = "_rowHeader_1rr1m_109", Zo = "_compact_1rr1m_130 _dense_12fqh_39", er = "_sortButton_1rr1m_147 _ring_12fqh_113", tr = "_numeric_1rr1m_175", nr = "_token_1rr1m_6", or = "_absent_1rr1m_192", rr = "_striped_1rr1m_196", sr = "_pinned_1rr1m_223", ir = "_pinStartEdge_1rr1m_239", lr = "_pinEndEdge_1rr1m_240", ar = "_sortIndicator_1rr1m_295", cr = "_sortArrow_1rr1m_302", dr = "_sortArrowDesc_1rr1m_306", ur = "_sortActive_1rr1m_314", fr = "_sortRank_1rr1m_320", hr = "_thFlex_1rr1m_328", pr = "_footerKind_1rr1m_353", gr = "_emptyCell_1rr1m_361", mr = "_emptyTitle_1rr1m_383", br = "_skeleton_1rr1m_392", wr = "_toolbar_1rr1m_424 _text_12fqh_23", vr = "_toolbarGroup_1rr1m_441", yr = "_toolbarGroupIdle_1rr1m_458", _r = "_toolbarMd_1rr1m_464", kr = "_toolbarInfo_1rr1m_468", Sr = "_pagination_1rr1m_474 _text_12fqh_23", Cr = "_paginationControls_1rr1m_487", xr = "_pageSize_1rr1m_494", Nr = "_pageSteps_1rr1m_502", Ar = "_paginationStatus_1rr1m_508", Rr = "_filterButton_1rr1m_517 _ring_12fqh_113", Tr = "_filterActive_1rr1m_544", Or = "_filterPanel_1rr1m_549", Mr = "_filterContent_1rr1m_563 _scroll_12fqh_84", Fr = "_filterFooter_1rr1m_574", Lr = "_filterLabel_1rr1m_588", Dr = "_filterValue_1rr1m_598", Er = "_filteredCount_1rr1m_604", Br = "_rangeFields_1rr1m_615", Pr = "_rangePeriod_1rr1m_625", Ir = "_conditions_1rr1m_631", zr = "_conditionButton_1rr1m_637", Vr = "_condition_1rr1m_631", $r = "_columnsPanel_1rr1m_662", Kr = "_columnsList_1rr1m_671", Gr = "_columnsEntry_1rr1m_680", Hr = "_move_1rr1m_692", jr = "_pinOn_1rr1m_730", Wr = "_groupingChoice_1rr1m_740", qr = "_groupingHeading_1rr1m_748", Ur = "_groupingOptions_1rr1m_757", Yr = "_groupingOption_1rr1m_757 _ring_12fqh_113", Jr = "_groupingLevel_1rr1m_800", Xr = "_groupingTag_1rr1m_805", Qr = "_groupingTrigger_1rr1m_812", Zr = "_groupingPrefix_1rr1m_818", es = "_groupingPath_1rr1m_823", ts = "_groupingSeparator_1rr1m_827", ns = "_groupHeader_1rr1m_844", os = "_spanCell_1rr1m_885", rs = "_groupFolded_1rr1m_963", ss = "_spanValue_1rr1m_967", is = "_groupLabel_1rr1m_968", ls = "_spanText_1rr1m_982", as = "_groupValue_1rr1m_983", cs = "_groupCount_1rr1m_990", ds = "_continued_1rr1m_1004", us = "_spanSelect_1rr1m_1035", fs = "_treeCell_1rr1m_1051", hs = "_foldSlot_1rr1m_1058", ps = "_treeRow_1rr1m_1070", gs = "_branchRow_1rr1m_1074", ms = "_detailCell_1rr1m_1087", bs = "_pathRow_1rr1m_1093", ws = "_fold_1rr1m_1058", vs = "_foldClosed_1rr1m_1134", ys = "_foldedCount_1rr1m_1144", _s = "_shareHost_1rr1m_1152", ks = "_shareBar_1rr1m_1159", Ss = "_expander_1rr1m_1171", Cs = "_expanderOpen_1rr1m_1206", xs = "_detailRow_1rr1m_1210", Ns = "_treeDetail_1rr1m_1219", As = "_treeDetailRail_1rr1m_1224", Rs = "_actionsCell_1rr1m_1241", Ts = "_actions_1rr1m_1241", Os = "_decision_1rr1m_1272", Ms = "_reserve_1rr1m_1291", Fs = "_grip_1rr1m_1301", Ls = "_virtualBody_1rr1m_1342", Ds = "_virtualRow_1rr1m_1358", Es = "_fillerRow_1rr1m_1382", Bs = "_grid_1rr1m_1395", Ps = "_editing_1rr1m_1411", Is = "_editingValue_1rr1m_1415", zs = "_editor_1rr1m_1421", Vs = "_editorField_1rr1m_1434", $s = "_draftButtons_1rr1m_1466", Ks = "_held_1rr1m_1474", Gs = "_deleteAsk_1rr1m_1478", Hs = "_newRowBar_1rr1m_1485", js = "_draftMessage_1rr1m_1492", Ws = "_editorMessage_1rr1m_1517", qs = "_control_1rr1m_211", Us = "_empty_1rr1m_361", Ys = "_toned_1rr1m_1278", h = {
|
|
539
|
+
frame: Ho,
|
|
540
|
+
children: jo,
|
|
541
|
+
scroll: Wo,
|
|
542
|
+
footerTarget: qo,
|
|
543
|
+
table: Uo,
|
|
544
|
+
th: Yo,
|
|
545
|
+
sticky: Jo,
|
|
546
|
+
td: Xo,
|
|
547
|
+
rowHeader: Qo,
|
|
548
|
+
compact: Zo,
|
|
549
|
+
sortButton: er,
|
|
550
|
+
numeric: tr,
|
|
551
|
+
token: nr,
|
|
552
|
+
absent: or,
|
|
553
|
+
striped: rr,
|
|
554
|
+
pinned: sr,
|
|
555
|
+
pinStartEdge: ir,
|
|
556
|
+
pinEndEdge: lr,
|
|
557
|
+
sortIndicator: ar,
|
|
558
|
+
sortArrow: cr,
|
|
559
|
+
sortArrowDesc: dr,
|
|
560
560
|
sortActive: ur,
|
|
561
|
-
sortRank:
|
|
562
|
-
thFlex:
|
|
563
|
-
footerKind:
|
|
564
|
-
emptyCell:
|
|
565
|
-
emptyTitle:
|
|
566
|
-
skeleton:
|
|
567
|
-
toolbar:
|
|
568
|
-
toolbarGroup:
|
|
569
|
-
toolbarGroupIdle:
|
|
570
|
-
toolbarMd:
|
|
571
|
-
search: _r,
|
|
561
|
+
sortRank: fr,
|
|
562
|
+
thFlex: hr,
|
|
563
|
+
footerKind: pr,
|
|
564
|
+
emptyCell: gr,
|
|
565
|
+
emptyTitle: mr,
|
|
566
|
+
skeleton: br,
|
|
567
|
+
toolbar: wr,
|
|
568
|
+
toolbarGroup: vr,
|
|
569
|
+
toolbarGroupIdle: yr,
|
|
570
|
+
toolbarMd: _r,
|
|
572
571
|
toolbarInfo: kr,
|
|
573
572
|
pagination: Sr,
|
|
574
573
|
paginationControls: Cr,
|
|
@@ -611,8 +610,8 @@ const Go = "_frame_1404u_11 _text_ocaqi_23", Ho = "_children_1404u_24", jo = "_s
|
|
|
611
610
|
spanText: ls,
|
|
612
611
|
groupValue: as,
|
|
613
612
|
groupCount: cs,
|
|
614
|
-
continued:
|
|
615
|
-
spanSelect:
|
|
613
|
+
continued: ds,
|
|
614
|
+
spanSelect: us,
|
|
616
615
|
treeCell: fs,
|
|
617
616
|
foldSlot: hs,
|
|
618
617
|
treeRow: ps,
|
|
@@ -684,13 +683,13 @@ function Mt(e, t, n) {
|
|
|
684
683
|
const o = /* @__PURE__ */ new Map();
|
|
685
684
|
let r = !1;
|
|
686
685
|
for (const l of e) {
|
|
687
|
-
const
|
|
688
|
-
if (ve(
|
|
686
|
+
const d = t(l);
|
|
687
|
+
if (ve(d)) {
|
|
689
688
|
r = !0;
|
|
690
689
|
continue;
|
|
691
690
|
}
|
|
692
|
-
const i =
|
|
693
|
-
o.has(i) || o.set(i,
|
|
691
|
+
const i = d instanceof Date ? `date:${d.getTime()}` : typeof d == "object" || typeof d == "function" ? d : `${typeof d}:${String(d)}`;
|
|
692
|
+
o.has(i) || o.set(i, d);
|
|
694
693
|
}
|
|
695
694
|
return { values: [...o.values()].map((l) => ({ value: l, text: String(l) })).sort(Bn(n)).map(({ value: l }) => l), absent: r };
|
|
696
695
|
}
|
|
@@ -707,23 +706,23 @@ function Zs({
|
|
|
707
706
|
absentOccurs: o = !1,
|
|
708
707
|
format: r
|
|
709
708
|
}) {
|
|
710
|
-
const s = Oe(), l = be(),
|
|
711
|
-
const
|
|
709
|
+
const s = Oe(), l = be(), d = se(() => e ?? [], [e]), i = se(() => {
|
|
710
|
+
const u = { formats: s, wording: l, format: r }, m = n.map((p) => ({ key: Be(p), text: Lt(p, u), value: p }));
|
|
712
711
|
m.sort(Bn(s));
|
|
713
|
-
const v = new Set(m.map((p) => p.key)), w =
|
|
712
|
+
const v = new Set(m.map((p) => p.key)), w = d.filter((p) => !ve(p) && !v.has(Be(p))).map((p) => ({ key: Be(p), text: Lt(p, u), value: p })), b = o || d.some(ve) ? [{ key: Ht, text: l.cellAbsentValue, value: null }] : [];
|
|
714
713
|
return [...m, ...w, ...b];
|
|
715
|
-
}, [n,
|
|
716
|
-
const m = a.has(
|
|
714
|
+
}, [n, d, o, r, s, l]), a = Ft(d), f = (u) => {
|
|
715
|
+
const m = a.has(u.key) ? d.filter((v) => Be(v) !== u.key) : [...d, u.value];
|
|
717
716
|
t(m.length > 0 ? m : null);
|
|
718
717
|
};
|
|
719
|
-
return /* @__PURE__ */ c("div", { className: h.filterContent, children: i.map((
|
|
718
|
+
return /* @__PURE__ */ c("div", { className: h.filterContent, children: i.map((u) => /* @__PURE__ */ c(
|
|
720
719
|
qe,
|
|
721
720
|
{
|
|
722
|
-
label:
|
|
723
|
-
checked: a.has(
|
|
724
|
-
onChange: () => f(
|
|
721
|
+
label: u.text,
|
|
722
|
+
checked: a.has(u.key),
|
|
723
|
+
onChange: () => f(u)
|
|
725
724
|
},
|
|
726
|
-
|
|
725
|
+
u.key
|
|
727
726
|
)) });
|
|
728
727
|
}
|
|
729
728
|
const ei = Dn(
|
|
@@ -745,26 +744,26 @@ const ei = Dn(
|
|
|
745
744
|
return `${n.slice(0, 2).join(", ")} ${t.wording.moreValues(o, t.formats.count(o))}`;
|
|
746
745
|
}
|
|
747
746
|
}
|
|
748
|
-
), ti = (e) => new Date(e.getFullYear(), e.getMonth(), e.getDate()).getTime(), ni = (e) => new Date(e.getFullYear(), e.getMonth(), e.getDate() + 1).getTime(), We = (e) => typeof e == "number" && Number.isFinite(e), Me = (e) => e instanceof Date && !Number.isNaN(e.getTime()), oi = (e) => Me(e) ? ti(e) : We(e) ? e : void 0, ri = (e) => Me(e) ? { value: ni(e), open: !0 } : We(e) ? { value: e, open: !1 } : void 0,
|
|
747
|
+
), ti = (e) => new Date(e.getFullYear(), e.getMonth(), e.getDate()).getTime(), ni = (e) => new Date(e.getFullYear(), e.getMonth(), e.getDate() + 1).getTime(), We = (e) => typeof e == "number" && Number.isFinite(e), Me = (e) => e instanceof Date && !Number.isNaN(e.getTime()), oi = (e) => Me(e) ? ti(e) : We(e) ? e : void 0, ri = (e) => Me(e) ? { value: ni(e), open: !0 } : We(e) ? { value: e, open: !1 } : void 0, dt = (e, t) => Me(e) ? t.formats.date(e) : Ue(e, t.format, t.formats, t.wording) ?? String(e);
|
|
749
748
|
function si({ condition: e, setCondition: t }) {
|
|
750
|
-
const n = be(), [o, r] = Z(null), s = o !== null, l = o ? o.from : We(e == null ? void 0 : e.from) ? e.from : null,
|
|
751
|
-
const
|
|
752
|
-
if (
|
|
753
|
-
r(
|
|
749
|
+
const n = be(), [o, r] = Z(null), s = o !== null, l = o ? o.from : We(e == null ? void 0 : e.from) ? e.from : null, d = o ? o.to : We(e == null ? void 0 : e.to) ? e.to : null, i = (a, f) => {
|
|
750
|
+
const u = { from: l, to: d, [a]: f };
|
|
751
|
+
if (u.from !== null && u.to !== null && u.from > u.to) {
|
|
752
|
+
r(u);
|
|
754
753
|
return;
|
|
755
754
|
}
|
|
756
|
-
if (r(null),
|
|
755
|
+
if (r(null), u.from === null && u.to === null) {
|
|
757
756
|
t(null);
|
|
758
757
|
return;
|
|
759
758
|
}
|
|
760
759
|
t({
|
|
761
|
-
...
|
|
762
|
-
...
|
|
760
|
+
...u.from !== null ? { from: u.from } : {},
|
|
761
|
+
...u.to !== null ? { to: u.to } : {}
|
|
763
762
|
});
|
|
764
763
|
};
|
|
765
764
|
return /* @__PURE__ */ M("div", { className: h.rangeFields, children: [
|
|
766
765
|
/* @__PURE__ */ c(At, { label: n.filterFrom, children: /* @__PURE__ */ c(Rt, { size: "sm", value: l, invalid: s, onChange: (a) => i("from", a) }) }),
|
|
767
|
-
/* @__PURE__ */ c(At, { label: n.filterTo, error: s ? n.rangeInvalid : void 0, children: /* @__PURE__ */ c(Rt, { size: "sm", value:
|
|
766
|
+
/* @__PURE__ */ c(At, { label: n.filterTo, error: s ? n.rangeInvalid : void 0, children: /* @__PURE__ */ c(Rt, { size: "sm", value: d, onChange: (a) => i("to", a) }) })
|
|
768
767
|
] });
|
|
769
768
|
}
|
|
770
769
|
function ii({ condition: e, setCondition: t }) {
|
|
@@ -804,11 +803,11 @@ const ai = Dn(
|
|
|
804
803
|
if (n !== void 0 && o !== void 0) {
|
|
805
804
|
const r = Me(n) && Me(o) && n.getFullYear() === o.getFullYear();
|
|
806
805
|
return t.wording.rangeFromTo(
|
|
807
|
-
r ? t.formats.dateShort(n) :
|
|
808
|
-
|
|
806
|
+
r ? t.formats.dateShort(n) : dt(n, t),
|
|
807
|
+
dt(o, t)
|
|
809
808
|
);
|
|
810
809
|
}
|
|
811
|
-
return n !== void 0 ? t.wording.rangeFrom(
|
|
810
|
+
return n !== void 0 ? t.wording.rangeFrom(dt(n, t)) : o === void 0 ? "" : t.wording.rangeTo(dt(o, t));
|
|
812
811
|
}
|
|
813
812
|
}
|
|
814
813
|
);
|
|
@@ -960,8 +959,8 @@ class ci {
|
|
|
960
959
|
key: t,
|
|
961
960
|
spec: n,
|
|
962
961
|
read: (l) => {
|
|
963
|
-
const
|
|
964
|
-
return typeof
|
|
962
|
+
const d = s.spec.value;
|
|
963
|
+
return typeof d == "string" ? ln(l, d) : d(l);
|
|
965
964
|
}
|
|
966
965
|
};
|
|
967
966
|
this.columns.entries.set(t, s), this.structure++;
|
|
@@ -990,7 +989,7 @@ class ci {
|
|
|
990
989
|
/** What the columns of this pass declare. */
|
|
991
990
|
declaredPins() {
|
|
992
991
|
var t;
|
|
993
|
-
return
|
|
992
|
+
return Eo(
|
|
994
993
|
this.orderedColumns().map((n) => ({ id: n.spec.id, pin: n.spec.pin })),
|
|
995
994
|
this.stickyRowHeader ? (t = this.rowHeader()) == null ? void 0 : t.spec.id : void 0
|
|
996
995
|
);
|
|
@@ -1003,7 +1002,7 @@ class ci {
|
|
|
1003
1002
|
/** The columns with the pinned blocks at either end - the one place where
|
|
1004
1003
|
that is decided, for screen, column menu and export. */
|
|
1005
1004
|
inPinOrder(t) {
|
|
1006
|
-
return
|
|
1005
|
+
return Do(t, this.pins());
|
|
1007
1006
|
}
|
|
1008
1007
|
/** The columns in JSX order, the first one per id. */
|
|
1009
1008
|
orderedColumns() {
|
|
@@ -1027,8 +1026,8 @@ class ci {
|
|
|
1027
1026
|
key: t,
|
|
1028
1027
|
spec: n,
|
|
1029
1028
|
read: (l) => {
|
|
1030
|
-
const
|
|
1031
|
-
return typeof
|
|
1029
|
+
const d = s.spec.value;
|
|
1030
|
+
return typeof d == "string" ? ln(l, d) : d(l);
|
|
1032
1031
|
}
|
|
1033
1032
|
};
|
|
1034
1033
|
this.groupKeys.entries.set(t, s), this.structure++;
|
|
@@ -1087,16 +1086,16 @@ class ci {
|
|
|
1087
1086
|
/** The levels and aggregates for the model - the same identity as long as
|
|
1088
1087
|
nothing changed that they read. */
|
|
1089
1088
|
groupingModel(t, n) {
|
|
1090
|
-
var
|
|
1089
|
+
var d;
|
|
1091
1090
|
const o = [t.join("|"), this.structure, this.values].join(":");
|
|
1092
|
-
if (((
|
|
1091
|
+
if (((d = this.groupingCache) == null ? void 0 : d.key) === o) return this.groupingCache;
|
|
1093
1092
|
const r = this.groupingEntries(n), s = t.map((i) => r.find((a) => a.spec.id === i)).filter((i) => i !== void 0).map((i) => ({
|
|
1094
1093
|
id: i.spec.id,
|
|
1095
1094
|
value: (a) => {
|
|
1096
1095
|
const f = i.read(a);
|
|
1097
1096
|
if (f == null) return;
|
|
1098
|
-
const { ownGroupValue:
|
|
1099
|
-
return
|
|
1097
|
+
const { ownGroupValue: u, group: m } = i.spec;
|
|
1098
|
+
return u ? u(f) : m ? No(m)(f) : f;
|
|
1100
1099
|
},
|
|
1101
1100
|
/* A value of one's own is a name; its groups stand by what they hold. */
|
|
1102
1101
|
order: i.spec.ownGroupValue ? (a) => Ot(i.read(a), i.spec.ownSortValue) : void 0
|
|
@@ -1139,19 +1138,19 @@ class ci {
|
|
|
1139
1138
|
over the hook's calculation. */
|
|
1140
1139
|
modelColumns(t, n) {
|
|
1141
1140
|
var l;
|
|
1142
|
-
const o = this.orderedColumns(), r = [this.structure, this.values, o.map((
|
|
1141
|
+
const o = this.orderedColumns(), r = [this.structure, this.values, o.map((d) => d.key).join("|")].join(":");
|
|
1143
1142
|
if (((l = this.modelCache) == null ? void 0 : l.key) === r && this.modelCache.rows === t && this.modelCache.formats === n)
|
|
1144
1143
|
return this.modelCache.columns;
|
|
1145
|
-
const s = o.map((
|
|
1146
|
-
const { spec: i } =
|
|
1144
|
+
const s = o.map((d) => {
|
|
1145
|
+
const { spec: i } = d, a = this.kindOf(d, t), f = this.isSortable(d, t), u = i.searchable ?? a === "text", m = (v) => Ot(d.read(v), i.ownSortValue);
|
|
1147
1146
|
return {
|
|
1148
1147
|
id: i.id,
|
|
1149
1148
|
label: i.label,
|
|
1150
|
-
value: f ||
|
|
1149
|
+
value: f || u ? m : void 0,
|
|
1151
1150
|
/* Text sorts with the provider's comparison, not with the built-in
|
|
1152
1151
|
German one (spec, the table of defaults). */
|
|
1153
1152
|
compare: a === "text" && !i.ownSortValue ? (v, w) => n.compareText(String(m(v)), String(m(w))) : void 0,
|
|
1154
|
-
searchable:
|
|
1153
|
+
searchable: u,
|
|
1155
1154
|
hideable: !i.rowHeader,
|
|
1156
1155
|
resizable: i.resizable,
|
|
1157
1156
|
width: i.width
|
|
@@ -1172,11 +1171,11 @@ class ci {
|
|
|
1172
1171
|
/** The hook's projection when it calculated with the same columns - otherwise
|
|
1173
1172
|
a new one, with the columns of this pass. */
|
|
1174
1173
|
computedProjection() {
|
|
1175
|
-
var
|
|
1174
|
+
var d;
|
|
1176
1175
|
const t = this.hook, n = this.modelColumns(t.rows, t.formats), o = t.companion;
|
|
1177
1176
|
if (n === t.modelColumns)
|
|
1178
1177
|
return o;
|
|
1179
|
-
if (((
|
|
1178
|
+
if (((d = this.projectionCache) == null ? void 0 : d.hook) === t && this.projectionCache.columns === n) return this.projectionCache.projection;
|
|
1180
1179
|
const r = {
|
|
1181
1180
|
search: o.search,
|
|
1182
1181
|
filter: t.filter,
|
|
@@ -1188,7 +1187,7 @@ class ci {
|
|
|
1188
1187
|
grouping: this.groupingFor(t),
|
|
1189
1188
|
manual: o.manual,
|
|
1190
1189
|
tree: t.tree
|
|
1191
|
-
}, s = Yt(t.admitted, n, r), l = o.virtual ?
|
|
1190
|
+
}, s = Yt(t.admitted, n, r), l = o.virtual ? di(s, o.virtual.from, o.virtual.to) : s;
|
|
1192
1191
|
return this.projectionCache = { hook: t, columns: n, projection: l }, l;
|
|
1193
1192
|
}
|
|
1194
1193
|
/* --- The hook's snapshot ---------------------------------------------------------- */
|
|
@@ -1269,12 +1268,12 @@ class ci {
|
|
|
1269
1268
|
this.actions.entries.delete(t) && this.structure++;
|
|
1270
1269
|
}
|
|
1271
1270
|
}
|
|
1272
|
-
function
|
|
1271
|
+
function di(e, t, n) {
|
|
1273
1272
|
if (!e.lines) return { ...e, visible: (e.shown ?? e.filtered).slice(t, n) };
|
|
1274
1273
|
const o = e.lines.slice(t, n);
|
|
1275
1274
|
return { ...e, visibleLines: o, visible: qt(o) };
|
|
1276
1275
|
}
|
|
1277
|
-
const Pn = /* @__PURE__ */ new WeakMap(),
|
|
1276
|
+
const Pn = /* @__PURE__ */ new WeakMap(), ui = (e, t) => {
|
|
1278
1277
|
Pn.set(e, t);
|
|
1279
1278
|
}, fi = (e) => typeof e == "function" || typeof e == "object" && e !== null ? Pn.get(e) : void 0, W = (...e) => e.filter(Boolean).join(" ");
|
|
1280
1279
|
function In({
|
|
@@ -1285,26 +1284,26 @@ function In({
|
|
|
1285
1284
|
align: r,
|
|
1286
1285
|
focus: s,
|
|
1287
1286
|
open: l,
|
|
1288
|
-
setOpen:
|
|
1287
|
+
setOpen: d,
|
|
1289
1288
|
panelId: i
|
|
1290
1289
|
}) {
|
|
1291
|
-
const a = be(), f = Oe(), { id:
|
|
1290
|
+
const a = be(), f = Oe(), { id: u, label: m, format: v } = e.spec, { filterOptions: w } = n, b = w == null ? void 0 : w(u), { values: p, absent: g } = se(
|
|
1292
1291
|
() => b ? Mt(b, (N) => N, f) : Mt(n.admitted, e.read, f),
|
|
1293
1292
|
[b, n.admitted, e, f]
|
|
1294
1293
|
), O = Ve(e.spec.filter);
|
|
1295
1294
|
if (n.publicSnapshot.manual && !b && e.spec.filter === "list" && ge(
|
|
1296
|
-
`manual-filter-options:${
|
|
1297
|
-
`The list filter of "${
|
|
1295
|
+
`manual-filter-options:${u}`,
|
|
1296
|
+
`The list filter of "${u}" offers only the values of the page in manual mode; \`filterOptions\` gives it the server's.`
|
|
1298
1297
|
), !O) return null;
|
|
1299
1298
|
const P = n.publicSnapshot, _ = O.Input, k = Js(O) ? { absentOccurs: g, format: v, kind: t.kindOf(e, n.rows) } : {}, C = () => {
|
|
1300
1299
|
var N;
|
|
1301
|
-
|
|
1300
|
+
d(!1), (N = (s ?? o).current) == null || N.focus();
|
|
1302
1301
|
};
|
|
1303
1302
|
return /* @__PURE__ */ M(
|
|
1304
1303
|
gt,
|
|
1305
1304
|
{
|
|
1306
1305
|
open: l,
|
|
1307
|
-
onOpenChange:
|
|
1306
|
+
onOpenChange: d,
|
|
1308
1307
|
anchorRef: o,
|
|
1309
1308
|
align: r,
|
|
1310
1309
|
role: "dialog",
|
|
@@ -1315,15 +1314,15 @@ function In({
|
|
|
1315
1314
|
/* @__PURE__ */ c(
|
|
1316
1315
|
_,
|
|
1317
1316
|
{
|
|
1318
|
-
condition: P.filter[
|
|
1319
|
-
setCondition: (N) => P.setFilter(
|
|
1317
|
+
condition: P.filter[u] ?? null,
|
|
1318
|
+
setCondition: (N) => P.setFilter(u, N),
|
|
1320
1319
|
values: p,
|
|
1321
|
-
column: { id:
|
|
1320
|
+
column: { id: u, label: m },
|
|
1322
1321
|
...k
|
|
1323
1322
|
}
|
|
1324
1323
|
),
|
|
1325
1324
|
/* @__PURE__ */ M("div", { className: h.filterFooter, children: [
|
|
1326
|
-
/* @__PURE__ */ c(he, { size: "sm", variant: "ghost", onClick: () => P.setFilter(
|
|
1325
|
+
/* @__PURE__ */ c(he, { size: "sm", variant: "ghost", onClick: () => P.setFilter(u, null), children: a.filterReset }),
|
|
1327
1326
|
/* @__PURE__ */ c(he, { size: "sm", onClick: C, children: a.filterDone })
|
|
1328
1327
|
] })
|
|
1329
1328
|
]
|
|
@@ -1335,7 +1334,7 @@ function hi({
|
|
|
1335
1334
|
registry: t,
|
|
1336
1335
|
hook: n
|
|
1337
1336
|
}) {
|
|
1338
|
-
const o = be(), [r, s] = Z(!1), l =
|
|
1337
|
+
const o = be(), [r, s] = Z(!1), l = ue(null), d = Te(), { id: i, label: a } = e.spec, f = i in n.publicSnapshot.filter;
|
|
1339
1338
|
return /* @__PURE__ */ M(me, { children: [
|
|
1340
1339
|
/* @__PURE__ */ c(ot, { content: o.filterHint, children: /* @__PURE__ */ c(
|
|
1341
1340
|
"button",
|
|
@@ -1345,9 +1344,9 @@ function hi({
|
|
|
1345
1344
|
"aria-label": o.filterColumn(a),
|
|
1346
1345
|
"aria-haspopup": "dialog",
|
|
1347
1346
|
"aria-expanded": r,
|
|
1348
|
-
"aria-controls": r ?
|
|
1349
|
-
onClick: (
|
|
1350
|
-
l.current =
|
|
1347
|
+
"aria-controls": r ? d : void 0,
|
|
1348
|
+
onClick: (u) => {
|
|
1349
|
+
l.current = u.currentTarget, s(!r);
|
|
1351
1350
|
},
|
|
1352
1351
|
children: /* @__PURE__ */ c("svg", { viewBox: "0 0 14 14", width: "13", height: "13", "aria-hidden": "true", children: /* @__PURE__ */ c(
|
|
1353
1352
|
"path",
|
|
@@ -1372,15 +1371,15 @@ function hi({
|
|
|
1372
1371
|
align: "end",
|
|
1373
1372
|
open: r,
|
|
1374
1373
|
setOpen: s,
|
|
1375
|
-
panelId:
|
|
1374
|
+
panelId: d
|
|
1376
1375
|
}
|
|
1377
1376
|
)
|
|
1378
1377
|
] });
|
|
1379
1378
|
}
|
|
1380
1379
|
function pi({ registry: e, hook: t }) {
|
|
1381
1380
|
const n = be(), o = Oe(), r = Object.entries(t.publicSnapshot.filter).flatMap(([s, l]) => {
|
|
1382
|
-
const
|
|
1383
|
-
if (
|
|
1381
|
+
const d = t.rowFilters.get(s);
|
|
1382
|
+
if (d) return d.describe ? [{ id: s, rowFilter: d, text: d.describe(l) }] : [];
|
|
1384
1383
|
const i = e.columnById(s), a = i ? Ve(i.spec.filter) : void 0;
|
|
1385
1384
|
if (!i || !a) return [];
|
|
1386
1385
|
const f = { formats: o, wording: n, format: i.spec.format, kind: e.kindOf(i, t.rows) };
|
|
@@ -1408,28 +1407,28 @@ function gi({
|
|
|
1408
1407
|
registry: n,
|
|
1409
1408
|
hook: o
|
|
1410
1409
|
}) {
|
|
1411
|
-
const r = be(), [s, l] = Z(!1),
|
|
1410
|
+
const r = be(), [s, l] = Z(!1), d = ue(null), i = ue(null), a = Te(), { id: f, label: u } = e.spec;
|
|
1412
1411
|
return /* @__PURE__ */ M(me, { children: [
|
|
1413
1412
|
/* @__PURE__ */ c(
|
|
1414
1413
|
Kt,
|
|
1415
1414
|
{
|
|
1416
|
-
ref:
|
|
1415
|
+
ref: d,
|
|
1417
1416
|
className: h.condition,
|
|
1418
1417
|
onRemove: () => o.publicSnapshot.setFilter(f, null),
|
|
1419
|
-
removeLabel: r.removeConditionNamed(
|
|
1418
|
+
removeLabel: r.removeConditionNamed(u, t),
|
|
1420
1419
|
children: /* @__PURE__ */ M(
|
|
1421
1420
|
"button",
|
|
1422
1421
|
{
|
|
1423
1422
|
ref: i,
|
|
1424
1423
|
type: "button",
|
|
1425
1424
|
className: h.conditionButton,
|
|
1426
|
-
"aria-label": r.editConditionNamed(
|
|
1425
|
+
"aria-label": r.editConditionNamed(u, t),
|
|
1427
1426
|
"aria-haspopup": "dialog",
|
|
1428
1427
|
"aria-expanded": s,
|
|
1429
1428
|
"aria-controls": s ? a : void 0,
|
|
1430
1429
|
onClick: () => l(!s),
|
|
1431
1430
|
children: [
|
|
1432
|
-
/* @__PURE__ */ c("span", { className: h.filterLabel, children:
|
|
1431
|
+
/* @__PURE__ */ c("span", { className: h.filterLabel, children: u }),
|
|
1433
1432
|
/* @__PURE__ */ c("span", { className: h.filterValue, children: t })
|
|
1434
1433
|
]
|
|
1435
1434
|
}
|
|
@@ -1442,7 +1441,7 @@ function gi({
|
|
|
1442
1441
|
entry: e,
|
|
1443
1442
|
registry: n,
|
|
1444
1443
|
hook: o,
|
|
1445
|
-
anchor:
|
|
1444
|
+
anchor: d,
|
|
1446
1445
|
align: "start",
|
|
1447
1446
|
focus: i,
|
|
1448
1447
|
open: s,
|
|
@@ -1481,8 +1480,8 @@ function yi(e, t) {
|
|
|
1481
1480
|
})
|
|
1482
1481
|
), { exported: r, filtered: s } = e.projection();
|
|
1483
1482
|
if (!r) return cn(s, o);
|
|
1484
|
-
const l = new Map(r.map((i) => [i.node, i.level + 1])),
|
|
1485
|
-
return cn(r.map((i) => i.node), [
|
|
1483
|
+
const l = new Map(r.map((i) => [i.node, i.level + 1])), d = { id: "#level", label: t, value: (i) => l.get(i) };
|
|
1484
|
+
return cn(r.map((i) => i.node), [d, ...o]);
|
|
1486
1485
|
}
|
|
1487
1486
|
const _i = (e, t, n) => {
|
|
1488
1487
|
var o;
|
|
@@ -1495,7 +1494,7 @@ function ki({ registry: e, hook: t }) {
|
|
|
1495
1494
|
return /* @__PURE__ */ M("section", { className: h.groupingChoice, "aria-label": n.grouping, children: [
|
|
1496
1495
|
/* @__PURE__ */ c("h3", { className: h.groupingHeading, children: n.grouping }),
|
|
1497
1496
|
/* @__PURE__ */ c("div", { className: h.groupingOptions, children: o.map((l) => {
|
|
1498
|
-
const { id:
|
|
1497
|
+
const { id: d, label: i } = l.spec, a = r.indexOf(d), f = a !== -1;
|
|
1499
1498
|
return /* @__PURE__ */ M(
|
|
1500
1499
|
"button",
|
|
1501
1500
|
{
|
|
@@ -1504,13 +1503,13 @@ function ki({ registry: e, hook: t }) {
|
|
|
1504
1503
|
"aria-label": n.groupBy(i),
|
|
1505
1504
|
"aria-pressed": f,
|
|
1506
1505
|
disabled: !f && r.length >= Wt,
|
|
1507
|
-
onClick: () => s(f ? r.filter((
|
|
1506
|
+
onClick: () => s(f ? r.filter((u) => u !== d) : [...r, d]),
|
|
1508
1507
|
children: [
|
|
1509
1508
|
f && /* @__PURE__ */ c("span", { className: h.groupingLevel, "aria-hidden": "true", children: a + 1 }),
|
|
1510
1509
|
i
|
|
1511
1510
|
]
|
|
1512
1511
|
},
|
|
1513
|
-
|
|
1512
|
+
d
|
|
1514
1513
|
);
|
|
1515
1514
|
}) })
|
|
1516
1515
|
] });
|
|
@@ -1536,13 +1535,13 @@ function Ci({ registry: e, hook: t }) {
|
|
|
1536
1535
|
{
|
|
1537
1536
|
trigger: /* @__PURE__ */ M("button", { type: "button", className: W(h.conditionButton, h.groupingTrigger), children: [
|
|
1538
1537
|
/* @__PURE__ */ c("span", { className: h.groupingPrefix, children: n.groupedBy }),
|
|
1539
|
-
s.map((l,
|
|
1540
|
-
|
|
1538
|
+
s.map((l, d) => /* @__PURE__ */ M("span", { className: h.groupingPath, children: [
|
|
1539
|
+
d > 0 && /* @__PURE__ */ c("span", { className: h.groupingSeparator, "aria-hidden": "true", children: "›" }),
|
|
1541
1540
|
l
|
|
1542
|
-
] }, r[
|
|
1541
|
+
] }, r[d]))
|
|
1543
1542
|
] }),
|
|
1544
1543
|
children: [
|
|
1545
|
-
r.map((l,
|
|
1544
|
+
r.map((l, d) => /* @__PURE__ */ c(ft, { onSelect: () => o.setGrouping(r.filter((i) => i !== l)), children: n.removeGroupingLevel(s[d]) }, l)),
|
|
1546
1545
|
/* @__PURE__ */ c(co, {}),
|
|
1547
1546
|
/* @__PURE__ */ c(ft, { onSelect: o.unfoldAll, children: n.unfoldAll }),
|
|
1548
1547
|
/* @__PURE__ */ c(ft, { onSelect: o.foldAll, children: n.foldAll })
|
|
@@ -1570,21 +1569,21 @@ function Hn({
|
|
|
1570
1569
|
own: o = !1,
|
|
1571
1570
|
size: r = "sm"
|
|
1572
1571
|
}) {
|
|
1573
|
-
const s = be(), l = Oe(),
|
|
1572
|
+
const s = be(), l = Oe(), d = (e == null ? void 0 : e.hook) ?? null;
|
|
1574
1573
|
let i = null, a = null;
|
|
1575
|
-
if (e &&
|
|
1576
|
-
const f =
|
|
1574
|
+
if (e && d) {
|
|
1575
|
+
const f = d.publicSnapshot, u = f.search !== "" || Object.keys(f.filter).length > 0, m = o ? [] : d.selectedRows ?? f.filtered.filter((b) => f.selection.isSelected(d.rowKey(b))), v = e.hasRowActions() ? e.actions.ordered().filter((b) => b.spec.bulk) : [];
|
|
1577
1576
|
i = /* @__PURE__ */ M(me, { children: [
|
|
1578
|
-
/* @__PURE__ */ c(Ci, { registry: e, hook:
|
|
1579
|
-
/* @__PURE__ */ c(pi, { registry: e, hook:
|
|
1577
|
+
/* @__PURE__ */ c(Ci, { registry: e, hook: d }),
|
|
1578
|
+
/* @__PURE__ */ c(pi, { registry: e, hook: d })
|
|
1580
1579
|
] });
|
|
1581
|
-
const w = !
|
|
1580
|
+
const w = !u && m.length === 0 && !e.rowAdding;
|
|
1582
1581
|
a = /* @__PURE__ */ M("div", { className: W(h.toolbarGroup, w && h.toolbarGroupIdle), children: [
|
|
1583
|
-
/* @__PURE__ */ c("span", { role: "status", className: h.filteredCount, children:
|
|
1582
|
+
/* @__PURE__ */ c("span", { role: "status", className: h.filteredCount, children: u ? f.manual ? (
|
|
1584
1583
|
/* The server counts the matches only; a total beside them would be a second request. */
|
|
1585
1584
|
s.entries(f.rowCount, l.count(f.rowCount))
|
|
1586
|
-
) : s.filteredOfTotal(l.count(f.filtered.length), l.count(
|
|
1587
|
-
|
|
1585
|
+
) : s.filteredOfTotal(l.count(f.filtered.length), l.count(d.companion.total ?? d.admitted.length)) : "" }),
|
|
1586
|
+
u && /* @__PURE__ */ c(he, { size: r, variant: "ghost", onClick: () => $n(f), children: s.resetAll }),
|
|
1588
1587
|
m.length > 0 && /* @__PURE__ */ M(me, { children: [
|
|
1589
1588
|
/* @__PURE__ */ c("span", { className: h.toolbarInfo, children: s.selectedCount(m.length, l.count(m.length)) }),
|
|
1590
1589
|
v.map(({ key: b, spec: p }) => /* @__PURE__ */ c(
|
|
@@ -1601,23 +1600,23 @@ function Hn({
|
|
|
1601
1600
|
e.rowAdding && /* @__PURE__ */ c(Gn, { registry: e })
|
|
1602
1601
|
] });
|
|
1603
1602
|
}
|
|
1604
|
-
return /* @__PURE__ */ c(Kn.Provider, { value: r, children: /* @__PURE__ */ M("div", { className: W(h.toolbar, r === "md" && h.toolbarMd, t), children: [
|
|
1603
|
+
return /* @__PURE__ */ c(Kn.Provider, { value: r, children: /* @__PURE__ */ c(uo, { size: r, children: /* @__PURE__ */ M("div", { className: W(h.toolbar, r === "md" && h.toolbarMd, t), children: [
|
|
1605
1604
|
/* @__PURE__ */ M("div", { className: h.toolbarGroup, children: [
|
|
1606
1605
|
n,
|
|
1607
1606
|
i
|
|
1608
1607
|
] }),
|
|
1609
1608
|
a
|
|
1610
|
-
] }) });
|
|
1609
|
+
] }) }) });
|
|
1611
1610
|
}
|
|
1612
1611
|
const Dt = ht(null), xi = () => () => {
|
|
1613
|
-
},
|
|
1612
|
+
}, dn = () => 0;
|
|
1614
1613
|
function lt(e) {
|
|
1615
1614
|
var r;
|
|
1616
1615
|
const t = Fe(Dt), n = e ? fi(e.Table) ?? null : (t == null ? void 0 : t.registry) ?? null;
|
|
1617
1616
|
pt(
|
|
1618
1617
|
n ? n.subscribe : xi,
|
|
1619
|
-
n ? n.bodyVersion :
|
|
1620
|
-
n ? n.bodyVersion :
|
|
1618
|
+
n ? n.bodyVersion : dn,
|
|
1619
|
+
n ? n.bodyVersion : dn
|
|
1621
1620
|
);
|
|
1622
1621
|
const o = (r = n == null ? void 0 : n.hook) == null ? void 0 : r.publicSnapshot;
|
|
1623
1622
|
return !n || !o ? null : { registry: n, snapshot: o, inside: !e && t !== null, footerTarget: e ? null : (t == null ? void 0 : t.footerTarget) ?? null };
|
|
@@ -1644,22 +1643,22 @@ function Et({
|
|
|
1644
1643
|
wording: o,
|
|
1645
1644
|
signed: r = !1
|
|
1646
1645
|
}) {
|
|
1647
|
-
const { aggregate: s, format: l, presentation:
|
|
1646
|
+
const { aggregate: s, format: l, presentation: d } = e.spec;
|
|
1648
1647
|
if (!s) return null;
|
|
1649
1648
|
const i = typeof s == "function" ? "own" : s, a = jt({ id: e.spec.id, read: e.read, aggregate: s }, t), f = (v) => Ue(v, l, n, o);
|
|
1650
|
-
let
|
|
1651
|
-
if (ve(a))
|
|
1649
|
+
let u;
|
|
1650
|
+
if (ve(a)) u = /* @__PURE__ */ c(jn, { wording: o });
|
|
1652
1651
|
else if ((i === "sum" || i === "avg") && l === void 0 && typeof a == "number") {
|
|
1653
1652
|
const v = Math.max(0, ...t.map((w) => e.read(w)).filter(Ri).map(Ti));
|
|
1654
|
-
|
|
1653
|
+
u = n.number(a, Math.min(10, i === "avg" ? v + 1 : v));
|
|
1655
1654
|
} else if (i === "range" && l === "date" && Oi(a)) {
|
|
1656
1655
|
const [v, w] = a;
|
|
1657
|
-
|
|
1658
|
-
} else if (i === "count" || i === "distinct")
|
|
1656
|
+
u = v.getTime() === w.getTime() ? n.date(v) : o.rangeFromTo(n.dateShort(v), n.dateShort(w));
|
|
1657
|
+
} else if (i === "count" || i === "distinct") u = n.count(a);
|
|
1659
1658
|
else if (i === "range") {
|
|
1660
1659
|
const [v, w] = a;
|
|
1661
|
-
|
|
1662
|
-
} else i === "own" &&
|
|
1660
|
+
u = f(v) === f(w) ? f(v) : o.rangeFromTo(f(v) ?? "", f(w) ?? "");
|
|
1661
|
+
} else i === "own" && d ? u = d(a, t[0]) : u = f(a);
|
|
1663
1662
|
const m = Ni[i];
|
|
1664
1663
|
return /* @__PURE__ */ M(me, { children: [
|
|
1665
1664
|
r && m && /* @__PURE__ */ c("span", { "aria-hidden": "true", className: h.footerKind, children: m }),
|
|
@@ -1667,7 +1666,7 @@ function Et({
|
|
|
1667
1666
|
Ai(i, o),
|
|
1668
1667
|
" "
|
|
1669
1668
|
] }),
|
|
1670
|
-
|
|
1669
|
+
u
|
|
1671
1670
|
] });
|
|
1672
1671
|
}
|
|
1673
1672
|
const Ri = (e) => typeof e == "number" && Number.isFinite(e), Ti = (e) => {
|
|
@@ -1698,7 +1697,7 @@ const Fi = (e) => {
|
|
|
1698
1697
|
return t;
|
|
1699
1698
|
};
|
|
1700
1699
|
function Li(e, t) {
|
|
1701
|
-
const n =
|
|
1700
|
+
const n = ue(null);
|
|
1702
1701
|
ae(() => {
|
|
1703
1702
|
const o = e.current;
|
|
1704
1703
|
if (!o) return;
|
|
@@ -1706,24 +1705,24 @@ function Li(e, t) {
|
|
|
1706
1705
|
if (n.current = { trigger: t, positions: r }, !s || s.trigger === t) return;
|
|
1707
1706
|
const l = qn(o, "--u-duration-medium");
|
|
1708
1707
|
if (l === 0 || typeof o.animate != "function") return;
|
|
1709
|
-
const
|
|
1708
|
+
const d = getComputedStyle(o).getPropertyValue("--u-ease-out").trim() || "ease-out", i = Mi(s.positions, r);
|
|
1710
1709
|
for (const a of Array.from(o.querySelectorAll("tbody > tr[data-motion]"))) {
|
|
1711
|
-
const f = a.dataset.motion,
|
|
1712
|
-
|
|
1710
|
+
const f = a.dataset.motion, u = i.get(f);
|
|
1711
|
+
u !== void 0 ? a.animate([{ transform: `translateY(${u}px)` }, { transform: "none" }], { duration: l, easing: d }) : s.positions.has(f) || a.animate([{ opacity: 0, transform: "translateY(-4px)" }, { opacity: 1, transform: "none" }], { duration: l, easing: d });
|
|
1713
1712
|
}
|
|
1714
1713
|
});
|
|
1715
1714
|
}
|
|
1716
1715
|
function Di(e, t, n) {
|
|
1717
|
-
const o =
|
|
1716
|
+
const o = ue(t);
|
|
1718
1717
|
ae(() => {
|
|
1719
1718
|
const r = e.current, s = o.current;
|
|
1720
1719
|
if (o.current = t, !r || s === t || typeof r.animate != "function") return;
|
|
1721
1720
|
const l = qn(r, "--u-duration-medium");
|
|
1722
1721
|
if (l === 0) return;
|
|
1723
|
-
const
|
|
1722
|
+
const d = performance.now();
|
|
1724
1723
|
let i = requestAnimationFrame(function a(f) {
|
|
1725
|
-
const
|
|
1726
|
-
r.textContent = n(Math.round(s + (t - s) * m)),
|
|
1724
|
+
const u = Math.min(1, (f - d) / l), m = 1 - (1 - u) ** 3;
|
|
1725
|
+
r.textContent = n(Math.round(s + (t - s) * m)), u < 1 && (i = requestAnimationFrame(a));
|
|
1727
1726
|
});
|
|
1728
1727
|
return () => {
|
|
1729
1728
|
cancelAnimationFrame(i), r.textContent = n(t);
|
|
@@ -1732,7 +1731,7 @@ function Di(e, t, n) {
|
|
|
1732
1731
|
}
|
|
1733
1732
|
const Un = {};
|
|
1734
1733
|
function Jt(e, t, n = t) {
|
|
1735
|
-
const o =
|
|
1734
|
+
const o = zo(e, t, n);
|
|
1736
1735
|
if (!o) return Un;
|
|
1737
1736
|
const r = o.side === "start";
|
|
1738
1737
|
return {
|
|
@@ -1754,29 +1753,29 @@ function Jt(e, t, n = t) {
|
|
|
1754
1753
|
}
|
|
1755
1754
|
const Ei = (e) => e.controls + (e.span ? 1 : 0) + e.aggregates.length + (e.actions ? 1 : 0);
|
|
1756
1755
|
function Yn(e) {
|
|
1757
|
-
const { controls: t, span: n, aggregates: o, actions: r, blocks: s } = e, l = o.length,
|
|
1756
|
+
const { controls: t, span: n, aggregates: o, actions: r, blocks: s } = e, l = o.length, d = o.indexOf(!0), i = s.end > 0 ? s.end - (r ? 1 : 0) : 0, a = Math.max(n || l === 0 ? 0 : 1, Math.min(d === -1 ? l : d, l - i)), f = t + (n ? 1 : 0), u = s.start > 0 ? s.start - f : 0;
|
|
1758
1757
|
return {
|
|
1759
1758
|
lead: a,
|
|
1760
|
-
labelColumns: s.start > 0 ? Math.min(a,
|
|
1761
|
-
countColumns:
|
|
1759
|
+
labelColumns: s.start > 0 ? Math.min(a, u) : a,
|
|
1760
|
+
countColumns: u > 0 ? Math.min(a, u) : a
|
|
1762
1761
|
};
|
|
1763
1762
|
}
|
|
1764
1763
|
function Ct(e, t) {
|
|
1765
1764
|
const n = Ei(t);
|
|
1766
1765
|
if (e === "cells") return Array.from({ length: n }, () => 1);
|
|
1767
1766
|
if (e === "whole") return [n];
|
|
1768
|
-
const { lead: o, labelColumns: r, countColumns: s } = Yn(t), l = Array.from({ length: t.controls }, () => 1),
|
|
1769
|
-
return e === "header" ? [...l, (t.span ? 1 : 0) + r, ...i(r), ...
|
|
1767
|
+
const { lead: o, labelColumns: r, countColumns: s } = Yn(t), l = Array.from({ length: t.controls }, () => 1), d = Array.from({ length: t.aggregates.length - o + (t.actions ? 1 : 0) }, () => 1), i = (a) => o - a > 0 ? [o - a] : [];
|
|
1768
|
+
return e === "header" ? [...l, (t.span ? 1 : 0) + r, ...i(r), ...d] : [...l, 1, ...s > 0 ? [s] : [], ...i(s), ...d];
|
|
1770
1769
|
}
|
|
1771
1770
|
const wt = (e) => `row:${e}`;
|
|
1772
1771
|
function Bi({ layout: e, body: t, rowKey: n, expanded: o, foot: r }) {
|
|
1773
|
-
const s = Ct("cells", e), l = Ct("whole", e),
|
|
1774
|
-
const
|
|
1775
|
-
|
|
1772
|
+
const s = Ct("cells", e), l = Ct("whole", e), d = [{ key: "head", cells: s, at: -1 }], i = (a, f) => {
|
|
1773
|
+
const u = n(a);
|
|
1774
|
+
d.push({ key: wt(u), cells: s, at: f, row: a }), o.has(u) && d.push({ key: `detail:${u}`, cells: l, at: f, row: a });
|
|
1776
1775
|
};
|
|
1777
1776
|
return "rows" in t ? t.rows.forEach(i) : t.lines.forEach((a, f) => {
|
|
1778
|
-
a.kind === "row" ? i(a.row, f) :
|
|
1779
|
-
}),
|
|
1777
|
+
a.kind === "row" ? i(a.row, f) : d.push({ key: `${a.kind}:${a.group.path}`, cells: Ct(a.kind, e), at: f });
|
|
1778
|
+
}), d.length === 1 && d.push({ key: "empty", cells: l, at: -1 }), r && d.push({ key: "foot", cells: s, at: -1 }), d;
|
|
1780
1779
|
}
|
|
1781
1780
|
function Jn(e, t) {
|
|
1782
1781
|
let n = 0;
|
|
@@ -1791,20 +1790,20 @@ const nt = (e, t) => e.slice(0, t).reduce((n, o) => n + o, 0);
|
|
|
1791
1790
|
function Pi(e, t, n, o) {
|
|
1792
1791
|
const r = e.length - 1, s = e[t.line];
|
|
1793
1792
|
if (!s) return t;
|
|
1794
|
-
const { index: l } = Jn(s.cells, t.column),
|
|
1793
|
+
const { index: l } = Jn(s.cells, t.column), d = (i) => ({ line: Math.max(0, Math.min(r, i)), column: t.column });
|
|
1795
1794
|
switch (n) {
|
|
1796
1795
|
case "left":
|
|
1797
1796
|
return l > 0 ? { line: t.line, column: nt(s.cells, l - 1) } : t;
|
|
1798
1797
|
case "right":
|
|
1799
1798
|
return l < s.cells.length - 1 ? { line: t.line, column: nt(s.cells, l + 1) } : t;
|
|
1800
1799
|
case "up":
|
|
1801
|
-
return
|
|
1800
|
+
return d(t.line - 1);
|
|
1802
1801
|
case "down":
|
|
1803
|
-
return
|
|
1802
|
+
return d(t.line + 1);
|
|
1804
1803
|
case "pageUp":
|
|
1805
|
-
return
|
|
1804
|
+
return d(t.line - Math.max(1, o));
|
|
1806
1805
|
case "pageDown":
|
|
1807
|
-
return
|
|
1806
|
+
return d(t.line + Math.max(1, o));
|
|
1808
1807
|
case "lineStart":
|
|
1809
1808
|
return { line: t.line, column: 0 };
|
|
1810
1809
|
case "lineEnd":
|
|
@@ -1816,17 +1815,17 @@ function Pi(e, t, n, o) {
|
|
|
1816
1815
|
}
|
|
1817
1816
|
}
|
|
1818
1817
|
function Ii(e, t, n, o) {
|
|
1819
|
-
const r = e.flatMap((
|
|
1818
|
+
const r = e.flatMap((d, i) => d.cells.map((a, f) => ({ line: i, column: nt(d.cells, f) }))), s = r.findIndex((d) => d.line === t.line && d.column === Jn(e[t.line].cells, t.column).start);
|
|
1820
1819
|
return (n ? r.slice(0, Math.max(0, s)).reverse() : r.slice(s + 1)).find(o) ?? null;
|
|
1821
1820
|
}
|
|
1822
|
-
function
|
|
1821
|
+
function un(e, t, n) {
|
|
1823
1822
|
const o = e.indexOf(t);
|
|
1824
1823
|
return o >= 0 ? o : Math.max(0, Math.min(e.length - 1, n));
|
|
1825
1824
|
}
|
|
1826
1825
|
function vt(e, t, n, o) {
|
|
1827
1826
|
if (t === void 0) return o.groupNoValue;
|
|
1828
1827
|
const r = e == null ? void 0 : e.spec;
|
|
1829
|
-
if (r != null && r.group && t instanceof Date) return
|
|
1828
|
+
if (r != null && r.group && t instanceof Date) return Ro(r.group, t, n, o);
|
|
1830
1829
|
const s = r != null && r.ownGroupValue || r == null ? void 0 : r.format;
|
|
1831
1830
|
return Ue(t, s, n, o) ?? String(t);
|
|
1832
1831
|
}
|
|
@@ -1843,17 +1842,17 @@ function Pt({
|
|
|
1843
1842
|
formats: s,
|
|
1844
1843
|
wording: l
|
|
1845
1844
|
}) {
|
|
1846
|
-
const
|
|
1847
|
-
if (
|
|
1848
|
-
|
|
1845
|
+
const d = vt(n, e.value, s, l), i = s.count(e.rows.length), a = () => r.publicSnapshot.toggleFold(e.path), f = (u) => {
|
|
1846
|
+
if (u.altKey && (u.key === "ArrowLeft" || u.key === "ArrowRight")) {
|
|
1847
|
+
u.preventDefault(), fn(e, u.key === "ArrowLeft", r);
|
|
1849
1848
|
return;
|
|
1850
1849
|
}
|
|
1851
|
-
if (
|
|
1852
|
-
|
|
1853
|
-
else if (
|
|
1854
|
-
if (
|
|
1850
|
+
if (u.key === "ArrowRight" && !o)
|
|
1851
|
+
u.preventDefault(), a();
|
|
1852
|
+
else if (u.key === "ArrowLeft") {
|
|
1853
|
+
if (u.preventDefault(), o) a();
|
|
1855
1854
|
else if (t) {
|
|
1856
|
-
const m =
|
|
1855
|
+
const m = u.currentTarget.closest("table"), v = Array.from((m == null ? void 0 : m.querySelectorAll("[data-fold-path]")) ?? []).find(
|
|
1857
1856
|
(w) => w.dataset.foldPath === t.path
|
|
1858
1857
|
);
|
|
1859
1858
|
v == null || v.focus();
|
|
@@ -1867,10 +1866,10 @@ function Pt({
|
|
|
1867
1866
|
className: W(h.fold, !o && h.foldClosed),
|
|
1868
1867
|
"data-fold-path": e.path,
|
|
1869
1868
|
"aria-expanded": o,
|
|
1870
|
-
"aria-label": o ? l.foldGroup(
|
|
1869
|
+
"aria-label": o ? l.foldGroup(d, i) : l.unfoldGroup(d, i),
|
|
1871
1870
|
onKeyDown: f,
|
|
1872
|
-
onClick: (
|
|
1873
|
-
if (!
|
|
1871
|
+
onClick: (u) => {
|
|
1872
|
+
if (!u.altKey) return a();
|
|
1874
1873
|
fn(e, o, r);
|
|
1875
1874
|
},
|
|
1876
1875
|
children: /* @__PURE__ */ c(Xn, {})
|
|
@@ -1878,17 +1877,17 @@ function Pt({
|
|
|
1878
1877
|
);
|
|
1879
1878
|
}
|
|
1880
1879
|
function zi({ value: e, formats: t }) {
|
|
1881
|
-
const n =
|
|
1880
|
+
const n = ue(null);
|
|
1882
1881
|
return Di(n, e, t.count), /* @__PURE__ */ c("span", { ref: n, className: h.groupCount, children: t.count(e) });
|
|
1883
1882
|
}
|
|
1884
1883
|
function It({ group: e, entry: t, hook: n, formats: o, wording: r }) {
|
|
1885
|
-
const { selection: s } = n.publicSnapshot, l = e.rows.map(n.rowKey),
|
|
1884
|
+
const { selection: s } = n.publicSnapshot, l = e.rows.map(n.rowKey), d = l.filter((a) => s.isSelected(a)).length, i = d === l.length;
|
|
1886
1885
|
return /* @__PURE__ */ c(
|
|
1887
1886
|
qe,
|
|
1888
1887
|
{
|
|
1889
1888
|
"aria-label": r.selectGroup(vt(t, e.value, o, r)),
|
|
1890
1889
|
checked: i,
|
|
1891
|
-
indeterminate:
|
|
1890
|
+
indeterminate: d > 0 && !i,
|
|
1892
1891
|
onChange: () => {
|
|
1893
1892
|
for (const a of l) s.isSelected(a) === i && s.toggle(a);
|
|
1894
1893
|
}
|
|
@@ -1897,8 +1896,8 @@ function It({ group: e, entry: t, hook: n, formats: o, wording: r }) {
|
|
|
1897
1896
|
}
|
|
1898
1897
|
function fn(e, t, n) {
|
|
1899
1898
|
const o = n.publicSnapshot, r = [], s = (l) => {
|
|
1900
|
-
for (const
|
|
1901
|
-
|
|
1899
|
+
for (const d of l)
|
|
1900
|
+
d.level === e.level ? r.push(d) : s(d.groups);
|
|
1902
1901
|
};
|
|
1903
1902
|
s(n.companion.groups ?? []);
|
|
1904
1903
|
for (const l of r)
|
|
@@ -1913,15 +1912,15 @@ function Vi({
|
|
|
1913
1912
|
formats: s,
|
|
1914
1913
|
wording: l
|
|
1915
1914
|
}) {
|
|
1916
|
-
const
|
|
1915
|
+
const d = e.span;
|
|
1917
1916
|
return /* @__PURE__ */ c("td", { className: W(h.td, h.spanCell, o.className), style: o.style, children: e.first && /* @__PURE__ */ M("span", { className: h.spanValue, children: [
|
|
1918
|
-
n && /* @__PURE__ */ c("span", { className: h.spanSelect, children: /* @__PURE__ */ c(It, { group:
|
|
1919
|
-
/* @__PURE__ */ c(Pt, { group:
|
|
1920
|
-
/* @__PURE__ */ M("span", { className: h.spanText, title: vt(t,
|
|
1921
|
-
/* @__PURE__ */ c(Bt, { entry: t, group:
|
|
1917
|
+
n && /* @__PURE__ */ c("span", { className: h.spanSelect, children: /* @__PURE__ */ c(It, { group: d, entry: t, hook: r, formats: s, wording: l }) }),
|
|
1918
|
+
/* @__PURE__ */ c(Pt, { group: d, parent: e.parents.at(-1), entry: t, open: !0, hook: r, formats: s, wording: l }),
|
|
1919
|
+
/* @__PURE__ */ M("span", { className: h.spanText, title: vt(t, d.value, s, l), children: [
|
|
1920
|
+
/* @__PURE__ */ c(Bt, { entry: t, group: d, formats: s, wording: l }),
|
|
1922
1921
|
e.continued && /* @__PURE__ */ c("span", { className: h.continued, children: l.groupContinued })
|
|
1923
1922
|
] }),
|
|
1924
|
-
/* @__PURE__ */ c("span", { className: h.groupCount, children: s.count(
|
|
1923
|
+
/* @__PURE__ */ c("span", { className: h.groupCount, children: s.count(d.rows.length) })
|
|
1925
1924
|
] }) });
|
|
1926
1925
|
}
|
|
1927
1926
|
function hn({
|
|
@@ -1932,11 +1931,11 @@ function hn({
|
|
|
1932
1931
|
levelEntry: r,
|
|
1933
1932
|
columns: s,
|
|
1934
1933
|
controlColumns: l,
|
|
1935
|
-
blocks:
|
|
1934
|
+
blocks: d,
|
|
1936
1935
|
selectable: i,
|
|
1937
1936
|
hasActions: a,
|
|
1938
1937
|
total: f,
|
|
1939
|
-
siblings:
|
|
1938
|
+
siblings: u,
|
|
1940
1939
|
depth: m,
|
|
1941
1940
|
hook: v,
|
|
1942
1941
|
formats: w,
|
|
@@ -1948,8 +1947,8 @@ function hn({
|
|
|
1948
1947
|
span: o !== void 0,
|
|
1949
1948
|
aggregates: s.map((F) => F.spec.aggregate !== void 0),
|
|
1950
1949
|
actions: a,
|
|
1951
|
-
blocks:
|
|
1952
|
-
}), N = s.slice(_), L = l + (o ? 1 : 0), R = (F, X = F) => Jt(
|
|
1950
|
+
blocks: d
|
|
1951
|
+
}), N = s.slice(_), L = l + (o ? 1 : 0), R = (F, X = F) => Jt(d, F, X), K = (F) => _ - F > 0 && /* @__PURE__ */ c("td", { className: h.td, colSpan: _ - F }), q = s.find((F) => F.spec.aggregate === "sum" && F.spec.share !== !1), E = n !== void 0, D = /* @__PURE__ */ M("span", { className: h.groupLabel, children: [
|
|
1953
1952
|
/* @__PURE__ */ c(Pt, { group: g, parent: e.parents.at(-1), entry: r, open: P, hook: v, formats: w, wording: b }),
|
|
1954
1953
|
/* @__PURE__ */ c("span", { className: h.groupValue, children: /* @__PURE__ */ c(Bt, { entry: r, group: g, formats: w, wording: b }) }),
|
|
1955
1954
|
/* @__PURE__ */ c(zi, { value: g.rows.length, formats: w }),
|
|
@@ -1972,8 +1971,8 @@ function hn({
|
|
|
1972
1971
|
style: O ? { "--u-header-level": g.level } : void 0,
|
|
1973
1972
|
"aria-level": O ? g.level + 1 : m,
|
|
1974
1973
|
"aria-expanded": P,
|
|
1975
|
-
"aria-posinset":
|
|
1976
|
-
"aria-setsize":
|
|
1974
|
+
"aria-posinset": u.indexOf(g) + 1 || void 0,
|
|
1975
|
+
"aria-setsize": u.length || void 0,
|
|
1977
1976
|
children: [
|
|
1978
1977
|
Array.from({ length: l }, (F, X) => /* @__PURE__ */ c("td", { className: W(h.td, h.control, R(X).className), style: R(X).style, children: X === 0 && i && O && /* @__PURE__ */ c(It, { group: g, entry: r, hook: v, formats: w, wording: b }) }, `c${X}`)),
|
|
1979
1978
|
O ? /* @__PURE__ */ M(me, { children: [
|
|
@@ -2021,7 +2020,7 @@ function hn({
|
|
|
2021
2020
|
},
|
|
2022
2021
|
F.key
|
|
2023
2022
|
)),
|
|
2024
|
-
a && /* @__PURE__ */ c("td", { className: W(h.td, R(
|
|
2023
|
+
a && /* @__PURE__ */ c("td", { className: W(h.td, R(d.count - 1).className), style: R(d.count - 1).style })
|
|
2025
2024
|
]
|
|
2026
2025
|
}
|
|
2027
2026
|
);
|
|
@@ -2035,17 +2034,17 @@ function $i({
|
|
|
2035
2034
|
formats: s,
|
|
2036
2035
|
wording: l
|
|
2037
2036
|
}) {
|
|
2038
|
-
const { spec:
|
|
2039
|
-
if (!
|
|
2037
|
+
const { spec: d } = e;
|
|
2038
|
+
if (!d.aggregate) return /* @__PURE__ */ c("td", { className: W(h.td, t.className), style: t.style });
|
|
2040
2039
|
let i = null;
|
|
2041
|
-
if (o &&
|
|
2042
|
-
const a = jt({ id:
|
|
2040
|
+
if (o && d.aggregate === "sum" && d.share !== !1) {
|
|
2041
|
+
const a = jt({ id: d.id, read: e.read, aggregate: "sum" }, r), f = n.aggregates[d.id];
|
|
2043
2042
|
if (typeof a == "number" && a > 0 && typeof f == "number" && f > 0) {
|
|
2044
|
-
const
|
|
2045
|
-
i = /* @__PURE__ */ c("span", { className: h.shareBar, style: { width: `${Math.max(2, Math.round(
|
|
2043
|
+
const u = Math.min(1, f / a);
|
|
2044
|
+
i = /* @__PURE__ */ c("span", { className: h.shareBar, style: { width: `${Math.max(2, Math.round(u * 64))}px` }, "aria-hidden": "true" });
|
|
2046
2045
|
}
|
|
2047
2046
|
}
|
|
2048
|
-
return /* @__PURE__ */ c("td", { className: W(h.td, Wn(e, n.rows) && h.numeric, h.aggregateCell, t.className), style: t.style, "data-aggregate": typeof
|
|
2047
|
+
return /* @__PURE__ */ c("td", { className: W(h.td, Wn(e, n.rows) && h.numeric, h.aggregateCell, t.className), style: t.style, "data-aggregate": typeof d.aggregate == "function" ? "own" : d.aggregate, children: i ? /* @__PURE__ */ M("span", { className: h.shareHost, children: [
|
|
2049
2048
|
/* @__PURE__ */ c(Et, { entry: e, rows: n.rows, formats: s, wording: l }),
|
|
2050
2049
|
i
|
|
2051
2050
|
] }) : /* @__PURE__ */ c(Et, { entry: e, rows: n.rows, formats: s, wording: l }) });
|
|
@@ -2097,7 +2096,7 @@ function xt(e, t) {
|
|
|
2097
2096
|
if (!(t instanceof Element)) return null;
|
|
2098
2097
|
const n = t.closest("td, th"), o = n == null ? void 0 : n.parentElement, r = o == null ? void 0 : o.dataset.gridLine;
|
|
2099
2098
|
if (!n || !o || r === void 0 || o.closest("table") !== e) return null;
|
|
2100
|
-
const { start: s, end: l } = Xt(o).find((
|
|
2099
|
+
const { start: s, end: l } = Xt(o).find((d) => d.cell === n);
|
|
2101
2100
|
return { cell: n, line: r, column: s, end: l };
|
|
2102
2101
|
}
|
|
2103
2102
|
function Wi({
|
|
@@ -2108,38 +2107,38 @@ function Wi({
|
|
|
2108
2107
|
editable: r,
|
|
2109
2108
|
outside: s
|
|
2110
2109
|
}) {
|
|
2111
|
-
const l =
|
|
2110
|
+
const l = ue(s);
|
|
2112
2111
|
ae(() => {
|
|
2113
2112
|
l.current = s;
|
|
2114
2113
|
});
|
|
2115
|
-
const
|
|
2114
|
+
const d = s !== void 0;
|
|
2116
2115
|
return st(() => {
|
|
2117
2116
|
const i = e.current;
|
|
2118
|
-
if (!
|
|
2117
|
+
if (!d || !i) return;
|
|
2119
2118
|
const a = (f) => {
|
|
2120
|
-
var
|
|
2119
|
+
var u;
|
|
2121
2120
|
for (let m = f.target instanceof Element ? f.target : null; m; m = m.parentElement)
|
|
2122
2121
|
if (m === i || m.id && i.querySelector(`[aria-controls="${CSS.escape(m.id)}"]`)) return;
|
|
2123
|
-
(
|
|
2122
|
+
(u = l.current) == null || u.call(l);
|
|
2124
2123
|
};
|
|
2125
2124
|
return document.addEventListener("mousedown", a), () => document.removeEventListener("mousedown", a);
|
|
2126
|
-
}, [
|
|
2125
|
+
}, [d, e]), ae(() => {
|
|
2127
2126
|
var P, _;
|
|
2128
2127
|
const i = e.current;
|
|
2129
2128
|
if (!i) return;
|
|
2130
|
-
const { active: a, widget: f, editing:
|
|
2129
|
+
const { active: a, widget: f, editing: u } = t.state, m = qi(a, n, o), v = (P = n[m.line]) == null ? void 0 : P.key, w = new Map(n.map((k, C) => [k.key, C]));
|
|
2131
2130
|
let b = null, p = null;
|
|
2132
2131
|
for (const k of Array.from(i.querySelectorAll("tr[data-grid-line]"))) {
|
|
2133
2132
|
const C = k.dataset.gridLine, N = Xt(k);
|
|
2134
2133
|
for (const { cell: L, start: R, end: K } of N) {
|
|
2135
2134
|
const q = m.column >= R && m.column < K || L === N.at(-1).cell && m.column >= K;
|
|
2136
2135
|
q && C === v && (b = L), q && p === null && C !== "head" && (p = L), L.tabIndex = -1, r && C !== "head" && !r({ line: w.get(C) ?? -1, column: R }) ? L.setAttribute("aria-readonly", "true") : L.removeAttribute("aria-readonly");
|
|
2137
|
-
const E = (
|
|
2136
|
+
const E = (u == null ? void 0 : u.row) === !0 && u.line === C || L === b && (f || u !== null && u.line === C);
|
|
2138
2137
|
for (const D of Array.from(L.querySelectorAll(zt))) ji(D, !E);
|
|
2139
2138
|
}
|
|
2140
2139
|
}
|
|
2141
2140
|
const g = b ?? p ?? i.querySelector("tr[data-grid-line] > *");
|
|
2142
|
-
g && !(
|
|
2141
|
+
g && !(u != null && u.row && ((_ = g.parentElement) == null ? void 0 : _.dataset.gridLine) === u.line) && (g.tabIndex = 0);
|
|
2143
2142
|
const O = t.focus.take(b !== null);
|
|
2144
2143
|
if (O === "editor" || O === "open") {
|
|
2145
2144
|
const k = b == null ? void 0 : b.querySelector("input, select, textarea, button");
|
|
@@ -2154,12 +2153,12 @@ function Wi({
|
|
|
2154
2153
|
}
|
|
2155
2154
|
function qi(e, t, n) {
|
|
2156
2155
|
return e ? {
|
|
2157
|
-
line:
|
|
2156
|
+
line: un(
|
|
2158
2157
|
t.map((o) => o.key),
|
|
2159
2158
|
e.line,
|
|
2160
2159
|
e.lineIndex
|
|
2161
2160
|
),
|
|
2162
|
-
column:
|
|
2161
|
+
column: un(n, e.column, e.columnIndex)
|
|
2163
2162
|
} : { line: Math.min(1, t.length - 1), column: 0 };
|
|
2164
2163
|
}
|
|
2165
2164
|
const Ui = {
|
|
@@ -2177,7 +2176,7 @@ function Qn(e, t) {
|
|
|
2177
2176
|
return Object.is(n(e), n(t));
|
|
2178
2177
|
}
|
|
2179
2178
|
function Yi(e) {
|
|
2180
|
-
const { grid: t, lines: n, ids: o, columnById: r, rowKey: s, virtual: l, onCellEdit:
|
|
2179
|
+
const { grid: t, lines: n, ids: o, columnById: r, rowKey: s, virtual: l, onCellEdit: d, rowMode: i, onRowSave: a, onRowAdd: f, newRow: u, onRowDelete: m, select: v } = e, { setState: w } = t, b = n.map((y) => y.key), p = t.state.editing, g = (y) => {
|
|
2181
2180
|
var A;
|
|
2182
2181
|
return y === xe ? p == null ? void 0 : p.fresh : (A = n.find((B) => B.key === y)) == null ? void 0 : A.row;
|
|
2183
2182
|
}, O = (y) => {
|
|
@@ -2204,24 +2203,24 @@ function Yi(e) {
|
|
|
2204
2203
|
if (j === void 0)
|
|
2205
2204
|
return w((Y) => ({ ...Y, editing: null })), !0;
|
|
2206
2205
|
const z = {};
|
|
2207
|
-
for (const [Y,
|
|
2208
|
-
const Ne = (ee = (ce = r(Y)) == null ? void 0 : (V = ce.spec).validate) == null ? void 0 : ee.call(V,
|
|
2206
|
+
for (const [Y, de] of Object.entries(B)) {
|
|
2207
|
+
const Ne = (ee = (ce = r(Y)) == null ? void 0 : (V = ce.spec).validate) == null ? void 0 : ee.call(V, de, j);
|
|
2209
2208
|
Ne && (z[Y] = Ne);
|
|
2210
2209
|
}
|
|
2211
2210
|
const ne = Object.keys(B).find((Y) => z[Y] !== void 0);
|
|
2212
2211
|
if (ne !== void 0) {
|
|
2213
2212
|
const Y = p.row ? ne : p.column;
|
|
2214
|
-
return A && t.focus.want("editor"), w((
|
|
2215
|
-
...
|
|
2213
|
+
return A && t.focus.want("editor"), w((de) => ({
|
|
2214
|
+
...de,
|
|
2216
2215
|
active: { line: p.line, column: Y, lineIndex: Math.max(0, b.indexOf(p.line)), columnIndex: o.indexOf(Y) },
|
|
2217
|
-
editing:
|
|
2216
|
+
editing: de.editing && { ...de.editing, column: Y, drafts: B, errors: z, refused: !1 }
|
|
2218
2217
|
})), !1;
|
|
2219
2218
|
}
|
|
2220
2219
|
const G = Object.keys(B).filter((Y) => {
|
|
2221
|
-
var
|
|
2222
|
-
return !Qn(B[Y], (
|
|
2220
|
+
var de;
|
|
2221
|
+
return !Qn(B[Y], (de = r(Y)) == null ? void 0 : de.read(j));
|
|
2223
2222
|
});
|
|
2224
|
-
return p.line === xe ? f == null || f({ values: B }) : p.row ? G.length > 0 && (a == null || a({ rowKey: s(j), changes: Object.fromEntries(G.map((Y) => [Y, B[Y]])), row: j })) : G.length > 0 && (
|
|
2223
|
+
return p.line === xe ? f == null || f({ values: B }) : p.row ? G.length > 0 && (a == null || a({ rowKey: s(j), changes: Object.fromEntries(G.map((Y) => [Y, B[Y]])), row: j })) : G.length > 0 && (d == null || d({ rowKey: s(j), columnId: p.column, value: B[p.column], row: j })), A && t.focus.want("cell"), w((Y) => ({ ...Y, editing: null })), !0;
|
|
2225
2224
|
}, R = (y, A) => L({ [y]: A }), K = () => {
|
|
2226
2225
|
t.focus.want("cell"), w((y) => ({ ...y, editing: null }));
|
|
2227
2226
|
}, q = () => {
|
|
@@ -2239,7 +2238,7 @@ function Yi(e) {
|
|
|
2239
2238
|
if (p && (p.row || !L())) return q();
|
|
2240
2239
|
const y = _(), A = y[0];
|
|
2241
2240
|
if (!A) return;
|
|
2242
|
-
const B = (
|
|
2241
|
+
const B = (u == null ? void 0 : u()) ?? {};
|
|
2243
2242
|
t.focus.want("editor"), w((j) => ({
|
|
2244
2243
|
...j,
|
|
2245
2244
|
widget: !1,
|
|
@@ -2352,29 +2351,29 @@ function Ji(e, t) {
|
|
|
2352
2351
|
return n > 0 ? Math.max(1, Math.floor(r / n) - 1) : 10;
|
|
2353
2352
|
}
|
|
2354
2353
|
function Xi({ entry: e, row: t, rowName: n, grid: o }) {
|
|
2355
|
-
const r = Oe(), s =
|
|
2354
|
+
const r = Oe(), s = ue(null), { spec: l } = e, d = o.editing, i = l.id, a = d.drafts[i], f = d.errors[i] ?? null, u = (w) => o.setDraft(i, w), m = o.wording.editCell(l.label, n);
|
|
2356
2355
|
let v;
|
|
2357
2356
|
if (typeof l.edit == "function")
|
|
2358
2357
|
v = l.edit({
|
|
2359
2358
|
value: a,
|
|
2360
|
-
onChange:
|
|
2359
|
+
onChange: u,
|
|
2361
2360
|
commit: (w) => o.commit(i, w === void 0 ? a : w),
|
|
2362
2361
|
row: t,
|
|
2363
2362
|
invalid: f !== null,
|
|
2364
2363
|
label: m
|
|
2365
2364
|
});
|
|
2366
2365
|
else if (l.edit === "number")
|
|
2367
|
-
v = /* @__PURE__ */ c(Rt, { size: "sm", value: typeof a == "number" ? a : null, onChange:
|
|
2366
|
+
v = /* @__PURE__ */ c(Rt, { size: "sm", value: typeof a == "number" ? a : null, onChange: u });
|
|
2368
2367
|
else if (l.edit === "date")
|
|
2369
|
-
v = /* @__PURE__ */ c(
|
|
2368
|
+
v = /* @__PURE__ */ c(fo, { size: "sm", value: a instanceof Date ? a : null, onChange: (w) => d.row ? u(w) : o.commit(i, w) });
|
|
2370
2369
|
else if (l.edit === "select") {
|
|
2371
2370
|
const w = l.editOptions ?? Mt(o.hook.admitted, e.read, r).values, b = w.findIndex((p) => Qn(p, a));
|
|
2372
|
-
v = /* @__PURE__ */ M(An, {
|
|
2371
|
+
v = /* @__PURE__ */ M(An, { size: "sm", value: b < 0 ? "" : String(b), onChange: (p) => u(w[Number(p.target.value)]), children: [
|
|
2373
2372
|
b < 0 && /* @__PURE__ */ c("option", { value: "" }),
|
|
2374
2373
|
w.map((p, g) => /* @__PURE__ */ c("option", { value: g, children: p instanceof Date ? r.date(p) : String(p) }, g))
|
|
2375
2374
|
] });
|
|
2376
2375
|
} else
|
|
2377
|
-
v = /* @__PURE__ */ c(Rn, { size: "sm", value: ve(a) ? "" : String(a), onChange: (w) =>
|
|
2376
|
+
v = /* @__PURE__ */ c(Rn, { size: "sm", value: ve(a) ? "" : String(a), onChange: (w) => u(w.target.value) });
|
|
2378
2377
|
return /* @__PURE__ */ M("div", { ref: s, className: h.editor, children: [
|
|
2379
2378
|
/* @__PURE__ */ c(At, { className: h.editorField, label: /* @__PURE__ */ c(Pe, { children: m }), error: f ?? void 0, children: v }),
|
|
2380
2379
|
/* @__PURE__ */ c(gt, { open: f !== null, onOpenChange: () => {
|
|
@@ -2417,17 +2416,17 @@ function Zi(e, t, n, o, r) {
|
|
|
2417
2416
|
}
|
|
2418
2417
|
function el(e) {
|
|
2419
2418
|
function t(i) {
|
|
2420
|
-
const a = Te(), f = Fe(Dt),
|
|
2421
|
-
return e.registerColumn(a,
|
|
2419
|
+
const a = Te(), f = Fe(Dt), u = Qi(i);
|
|
2420
|
+
return e.registerColumn(a, u), ae(
|
|
2422
2421
|
() => () => {
|
|
2423
2422
|
e.removeColumn(a), e.commit();
|
|
2424
2423
|
},
|
|
2425
2424
|
[a]
|
|
2426
2425
|
), ae(() => {
|
|
2427
|
-
e.ensureColumn(a,
|
|
2426
|
+
e.ensureColumn(a, u), e.checkOrder(), e.commit();
|
|
2428
2427
|
}), Ln && f && f.registry !== e && ge(
|
|
2429
|
-
`foreign:${
|
|
2430
|
-
`The column "${
|
|
2428
|
+
`foreign:${u.id}`,
|
|
2429
|
+
`The column "${u.id}" comes from a different useTable call than the table it stands in. It reads the rows of its own hook.`
|
|
2431
2430
|
), /* @__PURE__ */ c("span", { hidden: !0, "data-umriss-column": a });
|
|
2432
2431
|
}
|
|
2433
2432
|
function n({ children: i }) {
|
|
@@ -2490,7 +2489,7 @@ function el(e) {
|
|
|
2490
2489
|
}
|
|
2491
2490
|
function l(i) {
|
|
2492
2491
|
e.beginPass(), e.setStickyRowHeader(i.stickyRowHeader === !0), e.setTableGroupable(i.groupable !== !1), e.setRowAdding(i.grid === !0 && i.onRowAdd !== void 0), e.manual && i.groupable === !0 && ge("manual-groupable", "`groupable` is passed over in manual mode: the groups would be the page's, not the server's.");
|
|
2493
|
-
const a =
|
|
2492
|
+
const a = ue(null), [f, u] = Z(null);
|
|
2494
2493
|
ae(() => {
|
|
2495
2494
|
e.children = a.current, e.checkOrder(), e.commit();
|
|
2496
2495
|
});
|
|
@@ -2499,11 +2498,11 @@ function el(e) {
|
|
|
2499
2498
|
/* @__PURE__ */ c("div", { ref: a, className: h.children, children: i.children }),
|
|
2500
2499
|
/* @__PURE__ */ c(tl, { registry: e }),
|
|
2501
2500
|
/* @__PURE__ */ c(nl, { registry: e, props: i }),
|
|
2502
|
-
/* @__PURE__ */ c("div", { ref:
|
|
2501
|
+
/* @__PURE__ */ c("div", { ref: u, className: h.footerTarget })
|
|
2503
2502
|
] }) });
|
|
2504
2503
|
}
|
|
2505
|
-
const
|
|
2506
|
-
return
|
|
2504
|
+
const d = { Table: l, Column: t, RowDetail: n, RowActions: o, Action: r, GroupBy: s };
|
|
2505
|
+
return ui(l, e), d;
|
|
2507
2506
|
}
|
|
2508
2507
|
function tl({ registry: e }) {
|
|
2509
2508
|
return pt(e.subscribe, e.bodyVersion, e.bodyVersion), !e.hook || !e.needsOwnToolbar() ? null : /* @__PURE__ */ c(Hn, { registry: e, own: !0 });
|
|
@@ -2516,14 +2515,14 @@ function nl({ registry: e, props: t }) {
|
|
|
2516
2515
|
striped: r = !1,
|
|
2517
2516
|
density: s,
|
|
2518
2517
|
maxHeight: l,
|
|
2519
|
-
empty:
|
|
2518
|
+
empty: d,
|
|
2520
2519
|
loading: i = !1,
|
|
2521
2520
|
rowProps: a,
|
|
2522
2521
|
ariaLabel: f,
|
|
2523
|
-
grid:
|
|
2522
|
+
grid: u = !1
|
|
2524
2523
|
} = t;
|
|
2525
2524
|
pt(e.subscribe, e.bodyVersion, e.bodyVersion);
|
|
2526
|
-
const m = be(), v = Oe(), w = Tn(s, "regular"), b = Te(), p =
|
|
2525
|
+
const m = be(), v = Oe(), w = Tn(s, "regular"), b = Te(), p = ue(null), g = Gi(), [O, P] = Z({ start: !0, end: !0 }), _ = (Qe = g.state.editing) == null ? void 0 : Qe.line;
|
|
2527
2526
|
ae(() => {
|
|
2528
2527
|
const x = e.hook;
|
|
2529
2528
|
!x || _ === void 0 || _ === xe || x.rows.some((H) => wt(x.rowKey(H)) === _) || g.setState((H) => ({ ...H, editing: null }));
|
|
@@ -2542,7 +2541,7 @@ function nl({ registry: e, props: t }) {
|
|
|
2542
2541
|
if (fe) return fe.focus();
|
|
2543
2542
|
}
|
|
2544
2543
|
});
|
|
2545
|
-
const k =
|
|
2544
|
+
const k = ue(null);
|
|
2546
2545
|
ae(() => {
|
|
2547
2546
|
var T;
|
|
2548
2547
|
const x = (T = p.current) == null ? void 0 : T.tBodies[0];
|
|
@@ -2592,15 +2591,15 @@ function nl({ registry: e, props: t }) {
|
|
|
2592
2591
|
}
|
|
2593
2592
|
};
|
|
2594
2593
|
}
|
|
2595
|
-
const j = E !== null && !A, z = (n ? 1 : 0) + (j ? 1 : 0), ne = z + (oe ? 1 : 0), G =
|
|
2596
|
-
start:
|
|
2594
|
+
const j = E !== null && !A, z = (n ? 1 : 0) + (j ? 1 : 0), ne = z + (oe ? 1 : 0), G = u && t.editMode === "row", ce = u && (G || t.onRowAdd !== void 0 || t.onRowDelete !== void 0), V = D.length > 0 || ce, ee = ne + y.length + (V ? 1 : 0), Y = e.pins(), de = y.filter((x) => Y[x.spec.id] === "start").length, Ne = y.filter((x) => Y[x.spec.id] === "end").length, Je = oe !== void 0 && Y[oe.spec.id] === "start", I = ((Ee = g.state.editing) == null ? void 0 : Ee.row) === !0, U = D.length > 0 || t.onRowDelete !== void 0 || I, te = {
|
|
2595
|
+
start: de > 0 || Je ? ne + de : 0,
|
|
2597
2596
|
end: Ne > 0 ? Ne + (V ? 1 : 0) : V && U ? 1 : 0,
|
|
2598
2597
|
count: ee
|
|
2599
2598
|
}, ie = {
|
|
2600
2599
|
start: O.start ? te.start : 0,
|
|
2601
2600
|
end: O.end || I && ce ? te.end : 0,
|
|
2602
2601
|
count: ee
|
|
2603
|
-
}, re = (x, H = x) => Jt(ie, x, H), Le = R.visible, $e = !i && !L.manual && y.some((x) => x.spec.aggregate), at = L.search !== "" || Object.keys(L.filter).length > 0, De =
|
|
2602
|
+
}, re = (x, H = x) => Jt(ie, x, H), Le = R.visible, $e = !i && !L.manual && y.some((x) => x.spec.aggregate), at = L.search !== "" || Object.keys(L.filter).length > 0, De = u ? Bi({
|
|
2604
2603
|
layout: { controls: z, span: oe !== void 0, aggregates: y.map((x) => x.spec.aggregate !== void 0), actions: V, blocks: ie },
|
|
2605
2604
|
body: i ? { rows: [] } : Q ? { lines: F ? R.lines : Q } : { rows: F ? R.shown ?? R.filtered : Le },
|
|
2606
2605
|
rowKey: N.rowKey,
|
|
@@ -2614,7 +2613,7 @@ function nl({ registry: e, props: t }) {
|
|
|
2614
2613
|
...oe ? ["#span"] : [],
|
|
2615
2614
|
...y.map((x) => x.spec.id),
|
|
2616
2615
|
...V ? ["#actions"] : []
|
|
2617
|
-
], le =
|
|
2616
|
+
], le = u ? Yi({
|
|
2618
2617
|
grid: g,
|
|
2619
2618
|
lines: De,
|
|
2620
2619
|
ids: ct,
|
|
@@ -2630,7 +2629,7 @@ function nl({ registry: e, props: t }) {
|
|
|
2630
2629
|
select: n ? (x) => L.selection.toggle(N.rowKey(x)) : void 0
|
|
2631
2630
|
}) : void 0;
|
|
2632
2631
|
e.setAddRow((le == null ? void 0 : le.addRow) ?? null);
|
|
2633
|
-
const Ge = (x) =>
|
|
2632
|
+
const Ge = (x) => u ? x : void 0, Ie = (x, H, we, T) => /* @__PURE__ */ c(
|
|
2634
2633
|
bn,
|
|
2635
2634
|
{
|
|
2636
2635
|
row: x,
|
|
@@ -2652,7 +2651,7 @@ function nl({ registry: e, props: t }) {
|
|
|
2652
2651
|
baseId: b,
|
|
2653
2652
|
formats: v,
|
|
2654
2653
|
wording: m,
|
|
2655
|
-
grid:
|
|
2654
|
+
grid: u
|
|
2656
2655
|
},
|
|
2657
2656
|
N.rowKey(x)
|
|
2658
2657
|
), Xe = Ke && /* @__PURE__ */ c("tbody", { children: /* @__PURE__ */ c(
|
|
@@ -2697,7 +2696,7 @@ function nl({ registry: e, props: t }) {
|
|
|
2697
2696
|
Ae = He = /* @__PURE__ */ c("tbody", { children: /* @__PURE__ */ c("tr", { "data-grid-line": Ge("empty"), children: /* @__PURE__ */ c("td", { colSpan: ee, className: h.emptyCell, children: /* @__PURE__ */ c("div", { className: h.empty, children: (L.manual || N.admitted.length > 0) && at ? /* @__PURE__ */ M(me, { children: [
|
|
2698
2697
|
/* @__PURE__ */ c("p", { className: h.emptyTitle, children: m.nothingMatchesFilters }),
|
|
2699
2698
|
/* @__PURE__ */ c(he, { size: "sm", variant: "ghost", onClick: () => $n(L), children: m.resetAll })
|
|
2700
|
-
] }) :
|
|
2699
|
+
] }) : d ?? /* @__PURE__ */ c("p", { className: h.emptyTitle, children: m.noEntries }) }) }) }) });
|
|
2701
2700
|
else if (Q) {
|
|
2702
2701
|
const x = F ? Fn(Q).map((S) => S.kind === "folded" || !S.continued ? S : { ...S, continued: !1 }) : Q, H = x.length - Q.length, we = F && F.from > 0 ? F.fillerBefore / F.from : 0, T = (S, $) => {
|
|
2703
2702
|
var Ce, Re;
|
|
@@ -2718,7 +2717,7 @@ function nl({ registry: e, props: t }) {
|
|
|
2718
2717
|
total: R.filtered,
|
|
2719
2718
|
siblings: ((Ce = S.parents.at(-1)) == null ? void 0 : Ce.groups) ?? R.groups ?? [],
|
|
2720
2719
|
depth: X.length,
|
|
2721
|
-
grid:
|
|
2720
|
+
grid: u,
|
|
2722
2721
|
hook: N,
|
|
2723
2722
|
formats: v,
|
|
2724
2723
|
wording: m
|
|
@@ -2740,7 +2739,7 @@ function nl({ registry: e, props: t }) {
|
|
|
2740
2739
|
total: R.filtered,
|
|
2741
2740
|
siblings: ((Re = S.parents.at(-1)) == null ? void 0 : Re.groups) ?? R.groups ?? [],
|
|
2742
2741
|
depth: X.length,
|
|
2743
|
-
grid:
|
|
2742
|
+
grid: u,
|
|
2744
2743
|
hook: N,
|
|
2745
2744
|
formats: v,
|
|
2746
2745
|
wording: m
|
|
@@ -2772,8 +2771,8 @@ function nl({ registry: e, props: t }) {
|
|
|
2772
2771
|
"table",
|
|
2773
2772
|
{
|
|
2774
2773
|
ref: p,
|
|
2775
|
-
role: Q || A ? "treegrid" :
|
|
2776
|
-
"aria-readonly":
|
|
2774
|
+
role: Q || A ? "treegrid" : u ? "grid" : void 0,
|
|
2775
|
+
"aria-readonly": u && !y.some((x) => x.spec.edit !== void 0) ? !0 : void 0,
|
|
2777
2776
|
onKeyDown: le == null ? void 0 : le.onKeyDown,
|
|
2778
2777
|
onFocus: le == null ? void 0 : le.onFocus,
|
|
2779
2778
|
onClick: le == null ? void 0 : le.onClick,
|
|
@@ -2788,7 +2787,7 @@ function nl({ registry: e, props: t }) {
|
|
|
2788
2787
|
w === "compact" && h.compact,
|
|
2789
2788
|
o && h.sticky,
|
|
2790
2789
|
r && h.striped,
|
|
2791
|
-
|
|
2790
|
+
u && h.grid
|
|
2792
2791
|
),
|
|
2793
2792
|
children: [
|
|
2794
2793
|
/* @__PURE__ */ c("thead", { children: /* @__PURE__ */ M("tr", { "aria-rowindex": F ? 1 : void 0, "data-grid-line": Ge("head"), children: [
|
|
@@ -2841,7 +2840,7 @@ function nl({ registry: e, props: t }) {
|
|
|
2841
2840
|
Array.from({ length: z }, (x, H) => /* @__PURE__ */ c("td", { className: W(h.td, h.control, re(H).className), style: re(H).style }, H)),
|
|
2842
2841
|
oe && /* @__PURE__ */ c("td", { className: W(h.td, re(z).className), style: re(z).style }),
|
|
2843
2842
|
y.map((x, H) => /* @__PURE__ */ c(
|
|
2844
|
-
|
|
2843
|
+
dl,
|
|
2845
2844
|
{
|
|
2846
2845
|
entry: x,
|
|
2847
2846
|
rows: R.roots ?? R.filtered,
|
|
@@ -2868,7 +2867,7 @@ function nl({ registry: e, props: t }) {
|
|
|
2868
2867
|
pinnedKeys: y.filter((x) => Y[x.spec.id]).map((x) => x.key).join("|")
|
|
2869
2868
|
}
|
|
2870
2869
|
),
|
|
2871
|
-
|
|
2870
|
+
u && /* @__PURE__ */ c(
|
|
2872
2871
|
Wi,
|
|
2873
2872
|
{
|
|
2874
2873
|
table: p,
|
|
@@ -2891,32 +2890,32 @@ function ol({
|
|
|
2891
2890
|
onSticking: n,
|
|
2892
2891
|
pinnedKeys: o
|
|
2893
2892
|
}) {
|
|
2894
|
-
const { start: r, end: s } = t, l =
|
|
2893
|
+
const { start: r, end: s } = t, l = ue({
|
|
2895
2894
|
key: "",
|
|
2896
2895
|
sticking: { start: !0, end: !0 }
|
|
2897
|
-
}),
|
|
2896
|
+
}), d = () => {
|
|
2898
2897
|
var p, g, O, P;
|
|
2899
2898
|
const i = e.current, a = i == null ? void 0 : i.parentElement;
|
|
2900
2899
|
if (!i || !a || (a.style.removeProperty("scroll-padding-left"), a.style.removeProperty("scroll-padding-right"), !r && !s)) return;
|
|
2901
2900
|
const f = Array.from(((g = (p = i.tHead) == null ? void 0 : p.rows[0]) == null ? void 0 : g.cells) ?? []);
|
|
2902
|
-
let
|
|
2901
|
+
let u = 0;
|
|
2903
2902
|
for (let _ = 0; _ < r; _++)
|
|
2904
|
-
i.style.setProperty(`--u-table-pin-start-${_}`, `${
|
|
2903
|
+
i.style.setProperty(`--u-table-pin-start-${_}`, `${u}px`), u += ((O = f[_]) == null ? void 0 : O.getBoundingClientRect().width) ?? 0;
|
|
2905
2904
|
let m = 0;
|
|
2906
2905
|
for (let _ = 0; _ < s; _++)
|
|
2907
2906
|
i.style.setProperty(`--u-table-pin-end-${_}`, `${m}px`), m += ((P = f[f.length - 1 - _]) == null ? void 0 : P.getBoundingClientRect().width) ?? 0;
|
|
2908
2907
|
const v = `${r}|${s}|${t.count}|${o}`;
|
|
2909
2908
|
l.current.key !== v && (l.current = { key: v, sticking: l.current.sticking });
|
|
2910
2909
|
const w = l.current;
|
|
2911
|
-
w.sticking.start && (w.start =
|
|
2912
|
-
const b =
|
|
2913
|
-
w.sticking = b, n(b), b.start || (
|
|
2910
|
+
w.sticking.start && (w.start = u), w.sticking.end && (w.end = m);
|
|
2911
|
+
const b = $o(w.start ?? u, w.end ?? m, a.clientWidth);
|
|
2912
|
+
w.sticking = b, n(b), b.start || (u = 0), b.end || (m = 0), i.style.setProperty("--u-table-pin-start", `${u}px`), i.style.setProperty("--u-table-pin-end", `${m}px`), u && a.style.setProperty("scroll-padding-left", `${u}px`), m && a.style.setProperty("scroll-padding-right", `${m}px`), Zn(a);
|
|
2914
2913
|
};
|
|
2915
|
-
return ae(
|
|
2916
|
-
var
|
|
2914
|
+
return ae(d), st(() => {
|
|
2915
|
+
var u, m;
|
|
2917
2916
|
const i = e.current;
|
|
2918
2917
|
if (!i || !r && !s || typeof ResizeObserver > "u") return;
|
|
2919
|
-
const a = new ResizeObserver(
|
|
2918
|
+
const a = new ResizeObserver(d), f = Array.from(((m = (u = i.tHead) == null ? void 0 : u.rows[0]) == null ? void 0 : m.cells) ?? []);
|
|
2920
2919
|
for (const v of [...f.slice(0, r), ...f.slice(f.length - s)]) a.observe(v);
|
|
2921
2920
|
return i.parentElement && a.observe(i.parentElement), () => a.disconnect();
|
|
2922
2921
|
}, [e, r, s, t.count, o]), null;
|
|
@@ -2933,7 +2932,7 @@ function rl({ table: e }) {
|
|
|
2933
2932
|
}, [e]), null;
|
|
2934
2933
|
}
|
|
2935
2934
|
function sl({ table: e, blocks: t }) {
|
|
2936
|
-
const n =
|
|
2935
|
+
const n = ue(t);
|
|
2937
2936
|
return ae(() => {
|
|
2938
2937
|
var r;
|
|
2939
2938
|
n.current = t;
|
|
@@ -2966,7 +2965,7 @@ function mn({
|
|
|
2966
2965
|
hook: n,
|
|
2967
2966
|
pin: o
|
|
2968
2967
|
}) {
|
|
2969
|
-
const { spec: r } = e, s = n.publicSnapshot, l = t.kindOf(e, n.rows),
|
|
2968
|
+
const { spec: r } = e, s = n.publicSnapshot, l = t.kindOf(e, n.rows), d = Gt(l, r.rightAligned), i = t.isSortable(e, n.rows), a = r.id, f = s.sort.findIndex((k) => k.column === a), u = f === -1 ? void 0 : s.sort[f].direction, m = s.sort.length > 1 && f !== -1 ? f + 1 : void 0, v = s.widths[a], w = 48, b = (k) => {
|
|
2970
2969
|
k.stopPropagation(), k.preventDefault();
|
|
2971
2970
|
const C = k.currentTarget, N = C.closest("th");
|
|
2972
2971
|
if (!N) return;
|
|
@@ -3011,14 +3010,14 @@ function mn({
|
|
|
3011
3010
|
children: [
|
|
3012
3011
|
/* @__PURE__ */ c("span", { children: r.label }),
|
|
3013
3012
|
m !== void 0 && /* @__PURE__ */ c("span", { className: h.sortRank, "aria-hidden": "true", children: m }),
|
|
3014
|
-
/* @__PURE__ */ c("span", { className: W(h.sortIndicator,
|
|
3013
|
+
/* @__PURE__ */ c("span", { className: W(h.sortIndicator, u && h.sortActive), "aria-hidden": "true", children: u ? /* @__PURE__ */ c("svg", { viewBox: "0 0 10 10", width: "10", height: "10", "aria-hidden": "true", className: W(h.sortArrow, u === "desc" && h.sortArrowDesc), children: /* @__PURE__ */ c("path", { d: "M2.2 6.2 5 3.4l2.8 2.8", fill: "none", stroke: "currentColor", strokeWidth: "1.4", strokeLinecap: "round", strokeLinejoin: "round" }) }) : (
|
|
3015
3014
|
/* Drawn in the nominal box and set in the 12 pixels the indicator
|
|
3016
3015
|
has always taken, so that the head does not move. */
|
|
3017
3016
|
/* @__PURE__ */ c("svg", { viewBox: "0 0 10 10", width: "10", height: "12", "aria-hidden": "true", children: /* @__PURE__ */ c("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" }) })
|
|
3018
3017
|
) })
|
|
3019
3018
|
]
|
|
3020
3019
|
}
|
|
3021
|
-
) : r.label, P =
|
|
3020
|
+
) : r.label, P = u === "asc" ? "ascending" : u === "desc" ? "descending" : "none", _ = Ve(r.filter) !== void 0 && !(r.filter === "list" && l === "other");
|
|
3022
3021
|
return /* @__PURE__ */ M(
|
|
3023
3022
|
"th",
|
|
3024
3023
|
{
|
|
@@ -3027,7 +3026,7 @@ function mn({
|
|
|
3027
3026
|
"aria-sort": i ? P : void 0,
|
|
3028
3027
|
tabIndex: r.resizable && !i ? 0 : void 0,
|
|
3029
3028
|
onKeyDown: g,
|
|
3030
|
-
className: W(h.th,
|
|
3029
|
+
className: W(h.th, d && h.numeric, o.className),
|
|
3031
3030
|
style: {
|
|
3032
3031
|
...v !== void 0 ? { width: v } : {},
|
|
3033
3032
|
...o.style
|
|
@@ -3061,11 +3060,11 @@ function bn({
|
|
|
3061
3060
|
hook: r,
|
|
3062
3061
|
columns: s,
|
|
3063
3062
|
header: l,
|
|
3064
|
-
selectable:
|
|
3063
|
+
selectable: d,
|
|
3065
3064
|
actions: i,
|
|
3066
3065
|
blocks: a,
|
|
3067
3066
|
columnCount: f,
|
|
3068
|
-
rowProps:
|
|
3067
|
+
rowProps: u,
|
|
3069
3068
|
baseId: m,
|
|
3070
3069
|
formats: v,
|
|
3071
3070
|
wording: w,
|
|
@@ -3077,7 +3076,7 @@ function bn({
|
|
|
3077
3076
|
fresh: _ = !1
|
|
3078
3077
|
}) {
|
|
3079
3078
|
var V;
|
|
3080
|
-
const k = Fe(to), C = r.publicSnapshot, N = _ ? xe : r.rowKey(e), L = _ ? w.newRow : Zi(e, l, r, v, w), R = _ ? xe : wt(N), K = (V = Fe(Ye)) == null ? void 0 : V.editing, q = (K == null ? void 0 : K.row) === !0 && K.line === R, E = o.detail, D = _ || p == null ? void 0 : p.entry(e), F = _ ? null : eo(o, C, e, N, D), X = F !== null, Q = (F == null ? void 0 : F.open) ?? !1, ye = F == null ? void 0 : F.content, _e = `${m}-detail-${t}`, { className: oe, ...y } = (
|
|
3079
|
+
const k = Fe(to), C = r.publicSnapshot, N = _ ? xe : r.rowKey(e), L = _ ? w.newRow : Zi(e, l, r, v, w), R = _ ? xe : wt(N), K = (V = Fe(Ye)) == null ? void 0 : V.editing, q = (K == null ? void 0 : K.row) === !0 && K.line === R, E = o.detail, D = _ || p == null ? void 0 : p.entry(e), F = _ ? null : eo(o, C, e, N, D), X = F !== null, Q = (F == null ? void 0 : F.open) ?? !1, ye = F == null ? void 0 : F.content, _e = `${m}-detail-${t}`, { className: oe, ...y } = (u == null ? void 0 : u(e)) ?? {}, A = n !== void 0, B = b ? b.span ?? b.parents.at(-1) : void 0, j = E !== null && !p, z = (d ? 1 : 0) + (j ? 1 : 0), ne = z + (g ? 1 : 0), G = (ee) => Jt(a, ee), ce = D !== void 0 && D.branch && !D.empty;
|
|
3081
3080
|
return /* @__PURE__ */ M(me, { children: [
|
|
3082
3081
|
/* @__PURE__ */ M(
|
|
3083
3082
|
"tr",
|
|
@@ -3094,7 +3093,7 @@ function bn({
|
|
|
3094
3093
|
"data-row": A ? n : void 0,
|
|
3095
3094
|
"data-line": b ? "row" : void 0,
|
|
3096
3095
|
"data-motion": N,
|
|
3097
|
-
"data-selected":
|
|
3096
|
+
"data-selected": d && C.selection.isSelected(N) ? "" : void 0,
|
|
3098
3097
|
"data-group-first": b != null && b.first ? "" : void 0,
|
|
3099
3098
|
"data-group": B == null ? void 0 : B.path,
|
|
3100
3099
|
"aria-level": b ? b.parents.length + 1 : D ? D.level + 1 : void 0,
|
|
@@ -3109,7 +3108,7 @@ function bn({
|
|
|
3109
3108
|
"aria-rowindex": A ? n + 2 : void 0,
|
|
3110
3109
|
children: [
|
|
3111
3110
|
_ && Array.from({ length: z + (g ? 1 : 0) }, (ee, Y) => /* @__PURE__ */ c("td", { className: W(h.td, Y < z && h.control, G(Y).className), style: G(Y).style }, Y)),
|
|
3112
|
-
!_ &&
|
|
3111
|
+
!_ && d && /* @__PURE__ */ c("td", { className: W(h.td, h.control, G(0).className), style: G(0).style, children: /* @__PURE__ */ c(
|
|
3113
3112
|
qe,
|
|
3114
3113
|
{
|
|
3115
3114
|
"aria-label": w.selectRow(L),
|
|
@@ -3126,7 +3125,7 @@ function bn({
|
|
|
3126
3125
|
"aria-label": Q ? w.collapseRowNamed(L) : w.expandRowNamed(L),
|
|
3127
3126
|
className: W(h.expander, Q && h.expanderOpen),
|
|
3128
3127
|
onClick: () => C.toggleRow(N),
|
|
3129
|
-
children: /* @__PURE__ */ c(
|
|
3128
|
+
children: /* @__PURE__ */ c(ho, {})
|
|
3130
3129
|
}
|
|
3131
3130
|
) }),
|
|
3132
3131
|
b && b.span && /* @__PURE__ */ c(
|
|
@@ -3134,7 +3133,7 @@ function bn({
|
|
|
3134
3133
|
{
|
|
3135
3134
|
line: { ...b, span: b.span },
|
|
3136
3135
|
entry: g,
|
|
3137
|
-
selectable:
|
|
3136
|
+
selectable: d,
|
|
3138
3137
|
pin: G(z),
|
|
3139
3138
|
hook: r,
|
|
3140
3139
|
formats: v,
|
|
@@ -3193,42 +3192,42 @@ function ll({
|
|
|
3193
3192
|
formats: r,
|
|
3194
3193
|
wording: s,
|
|
3195
3194
|
line: l,
|
|
3196
|
-
rowName:
|
|
3195
|
+
rowName: d,
|
|
3197
3196
|
tree: i
|
|
3198
3197
|
}) {
|
|
3199
|
-
const { spec: a } = e, f = e.read(t),
|
|
3198
|
+
const { spec: a } = e, f = e.read(t), u = Gt(n, a.rightAligned), m = Hi(l, a.id), w = !(Fe(Ye) !== null) || a.edit === void 0 ? void 0 : a.edit === "text" || a.edit === "number" ? "type" : "pick";
|
|
3200
3199
|
let b;
|
|
3201
3200
|
ve(f) ? b = /* @__PURE__ */ c(jn, { wording: s }) : a.presentation ? b = a.presentation(f, t) : b = Ue(f, a.format, r, s);
|
|
3202
3201
|
const p = typeof b == "string" && b.length <= il && !/\s/.test(b);
|
|
3203
|
-
i && (b = /* @__PURE__ */ c(cl, { ...i, name:
|
|
3202
|
+
i && (b = /* @__PURE__ */ c(cl, { ...i, name: d, wording: s, children: b }));
|
|
3204
3203
|
const g = a.rowHeader ? "th" : "td";
|
|
3205
3204
|
return /* @__PURE__ */ c(
|
|
3206
3205
|
g,
|
|
3207
3206
|
{
|
|
3208
3207
|
scope: a.rowHeader ? "row" : void 0,
|
|
3209
|
-
className: W(h.td,
|
|
3208
|
+
className: W(h.td, u && h.numeric, a.rowHeader && h.rowHeader, p && h.token, o.className, m && h.editing),
|
|
3210
3209
|
style: o.style,
|
|
3211
3210
|
"data-edit": w,
|
|
3212
3211
|
children: m ? /* @__PURE__ */ M(me, { children: [
|
|
3213
|
-
/* @__PURE__ */ c(Xi, { entry: e, row: t, rowName:
|
|
3212
|
+
/* @__PURE__ */ c(Xi, { entry: e, row: t, rowName: d, grid: m }),
|
|
3214
3213
|
/* @__PURE__ */ c("span", { className: h.editingValue, "aria-hidden": "true", children: b })
|
|
3215
3214
|
] }) : b
|
|
3216
3215
|
}
|
|
3217
3216
|
);
|
|
3218
3217
|
}
|
|
3219
3218
|
function eo(e, t, n, o, r) {
|
|
3220
|
-
var
|
|
3221
|
-
const s = (
|
|
3219
|
+
var d;
|
|
3220
|
+
const s = (d = e.detail) == null ? void 0 : d.presentation(n);
|
|
3222
3221
|
if (s == null || s === !1) return null;
|
|
3223
3222
|
const l = r !== void 0 && r.branch && !r.empty;
|
|
3224
3223
|
return { content: s, open: l ? t.branches.includes(o) : t.expanded.includes(o) };
|
|
3225
3224
|
}
|
|
3226
3225
|
function al(e, t, n, o, r) {
|
|
3227
|
-
var
|
|
3226
|
+
var d;
|
|
3228
3227
|
const s = /* @__PURE__ */ new Set([...t.expanded, ...t.branches]), l = /* @__PURE__ */ new Set();
|
|
3229
3228
|
for (const i of n) {
|
|
3230
3229
|
const a = o(i);
|
|
3231
|
-
s.has(a) && ((
|
|
3230
|
+
s.has(a) && ((d = eo(e, t, i, a, r == null ? void 0 : r.entry(i))) != null && d.open) && l.add(a);
|
|
3232
3231
|
}
|
|
3233
3232
|
return l;
|
|
3234
3233
|
}
|
|
@@ -3240,22 +3239,22 @@ function cl({
|
|
|
3240
3239
|
wording: r,
|
|
3241
3240
|
children: s
|
|
3242
3241
|
}) {
|
|
3243
|
-
const l = t.branch && !t.empty,
|
|
3244
|
-
l && e.set(t.key,
|
|
3245
|
-
}, f = (
|
|
3246
|
-
if (!(
|
|
3247
|
-
if (
|
|
3248
|
-
if (
|
|
3242
|
+
const l = t.branch && !t.empty, d = l || n !== void 0, i = l && t.expanded || ((n == null ? void 0 : n.open) ?? !1), a = (u) => {
|
|
3243
|
+
l && e.set(t.key, u), n && n.open !== u && n.toggle();
|
|
3244
|
+
}, f = (u) => {
|
|
3245
|
+
if (!(u.key !== "ArrowLeft" && u.key !== "ArrowRight")) {
|
|
3246
|
+
if (u.preventDefault(), u.altKey) return e.siblings(t.key, u.key === "ArrowRight");
|
|
3247
|
+
if (u.key === "ArrowRight")
|
|
3249
3248
|
i || a(!0);
|
|
3250
3249
|
else if (i) a(!1);
|
|
3251
3250
|
else {
|
|
3252
|
-
const m = e.parent(t.key), v =
|
|
3251
|
+
const m = e.parent(t.key), v = u.currentTarget.closest("table"), w = Array.from((v == null ? void 0 : v.querySelectorAll("[data-branch-key]")) ?? []).find((b) => b.dataset.branchKey === m);
|
|
3253
3252
|
w == null || w.focus();
|
|
3254
3253
|
}
|
|
3255
3254
|
}
|
|
3256
3255
|
};
|
|
3257
3256
|
return /* @__PURE__ */ M("span", { className: h.treeCell, style: { "--tree-level": t.level }, children: [
|
|
3258
|
-
|
|
3257
|
+
d ? /* @__PURE__ */ c(
|
|
3259
3258
|
"button",
|
|
3260
3259
|
{
|
|
3261
3260
|
type: "button",
|
|
@@ -3264,7 +3263,7 @@ function cl({
|
|
|
3264
3263
|
"aria-expanded": i,
|
|
3265
3264
|
"aria-label": i ? r.foldBranch(o) : r.unfoldBranch(o),
|
|
3266
3265
|
onKeyDown: f,
|
|
3267
|
-
onClick: (
|
|
3266
|
+
onClick: (u) => u.altKey ? e.siblings(t.key, !i) : a(!i),
|
|
3268
3267
|
children: /* @__PURE__ */ c(Xn, {})
|
|
3269
3268
|
}
|
|
3270
3269
|
) : /* @__PURE__ */ c("span", { className: h.foldSlot }),
|
|
@@ -3274,7 +3273,7 @@ function cl({
|
|
|
3274
3273
|
] })
|
|
3275
3274
|
] });
|
|
3276
3275
|
}
|
|
3277
|
-
function
|
|
3276
|
+
function dl({
|
|
3278
3277
|
entry: e,
|
|
3279
3278
|
rows: t,
|
|
3280
3279
|
formats: n,
|
|
@@ -3298,7 +3297,7 @@ function ul({
|
|
|
3298
3297
|
}
|
|
3299
3298
|
);
|
|
3300
3299
|
}
|
|
3301
|
-
const
|
|
3300
|
+
const ul = 2;
|
|
3302
3301
|
function wn({
|
|
3303
3302
|
actions: e,
|
|
3304
3303
|
row: t,
|
|
@@ -3307,23 +3306,23 @@ function wn({
|
|
|
3307
3306
|
line: r
|
|
3308
3307
|
}) {
|
|
3309
3308
|
var b;
|
|
3310
|
-
const s = Fe(Ye), l = ((b = s == null ? void 0 : s.editing) == null ? void 0 : b.row) === !0 && s.editing.line !== r,
|
|
3309
|
+
const s = Fe(Ye), l = ((b = s == null ? void 0 : s.editing) == null ? void 0 : b.row) === !0 && s.editing.line !== r, d = s == null ? void 0 : s.remove, [i, a] = Z(!1), f = ue(!1), u = ue(null), m = ue(null);
|
|
3311
3310
|
st(() => {
|
|
3312
3311
|
var p, g;
|
|
3313
|
-
i ? (p = m.current) == null || p.focus() : f.current && ((g =
|
|
3312
|
+
i ? (p = m.current) == null || p.focus() : f.current && ((g = u.current) == null || g.focus()), f.current = i;
|
|
3314
3313
|
}, [i]);
|
|
3315
3314
|
const v = (p) => {
|
|
3316
3315
|
if (l) return;
|
|
3317
3316
|
const g = p.onSelect;
|
|
3318
3317
|
g(p.bulk ? [t] : t);
|
|
3319
|
-
}, w =
|
|
3318
|
+
}, w = d && (i ? /* @__PURE__ */ M(me, { children: [
|
|
3320
3319
|
/* @__PURE__ */ c("span", { className: h.deleteAsk, children: o.deleteRowAsk }),
|
|
3321
3320
|
/* @__PURE__ */ c(he, { className: h.toned, size: "sm", variant: "danger", "aria-label": o.rowAction(o.deleteRow, n), onClick: () => {
|
|
3322
|
-
a(!1),
|
|
3321
|
+
a(!1), d(t);
|
|
3323
3322
|
}, children: o.deleteRow }),
|
|
3324
3323
|
/* @__PURE__ */ c(he, { ref: m, size: "sm", variant: "ghost", "aria-label": o.rowAction(o.keepRow, n), onClick: () => a(!1), children: o.keepRow })
|
|
3325
|
-
] }) : /* @__PURE__ */ c(he, { ref:
|
|
3326
|
-
return e.length <=
|
|
3324
|
+
] }) : /* @__PURE__ */ c(he, { ref: u, size: "sm", variant: "ghost", "aria-label": o.rowAction(o.deleteRow, n), onClick: () => !l && a(!0), children: o.deleteRow }));
|
|
3325
|
+
return e.length <= ul ? /* @__PURE__ */ M("div", { className: W(h.actions, i && h.decision), children: [
|
|
3327
3326
|
!i && e.map(({ key: p, spec: g }) => /* @__PURE__ */ c(
|
|
3328
3327
|
he,
|
|
3329
3328
|
{
|
|
@@ -3341,7 +3340,7 @@ function wn({
|
|
|
3341
3340
|
Nn,
|
|
3342
3341
|
{
|
|
3343
3342
|
align: "end",
|
|
3344
|
-
trigger: /* @__PURE__ */ c(
|
|
3343
|
+
trigger: /* @__PURE__ */ c(po, { size: "sm", variant: "ghost", "aria-label": o.rowActionsMenu(n), children: "⋯" }),
|
|
3345
3344
|
children: e.map(({ key: p, spec: g }) => /* @__PURE__ */ c(ft, { tone: g.tone, onSelect: () => v(g), children: g.label }, p))
|
|
3346
3345
|
}
|
|
3347
3346
|
),
|
|
@@ -3350,7 +3349,7 @@ function wn({
|
|
|
3350
3349
|
}
|
|
3351
3350
|
function fl({ name: e, wording: t }) {
|
|
3352
3351
|
var r;
|
|
3353
|
-
const n = Fe(Ye), o =
|
|
3352
|
+
const n = Fe(Ye), o = ue(null);
|
|
3354
3353
|
return /* @__PURE__ */ M("div", { ref: o, className: W(h.actions, h.decision, h.draftButtons), children: [
|
|
3355
3354
|
/* @__PURE__ */ c(he, { className: h.toned, size: "sm", variant: "primary", "aria-label": t.rowAction(t.saveRow, e), onClick: n.save, children: t.saveRow }),
|
|
3356
3355
|
/* @__PURE__ */ c(he, { size: "sm", variant: "ghost", "aria-label": t.rowAction(t.discardRow, e), onClick: n.discard, children: t.discardRow }),
|
|
@@ -3371,7 +3370,7 @@ function fl({ name: e, wording: t }) {
|
|
|
3371
3370
|
}
|
|
3372
3371
|
function hl({ columns: e, rightAligned: t = [], rows: n = 4 }) {
|
|
3373
3372
|
const o = [72, 48, 60, 40, 56, 64];
|
|
3374
|
-
return /* @__PURE__ */ c(me, { children: Array.from({ length: n }, (r, s) => /* @__PURE__ */ c("tr", { "aria-hidden": "true", children: Array.from({ length: e }, (l,
|
|
3373
|
+
return /* @__PURE__ */ c(me, { children: Array.from({ length: n }, (r, s) => /* @__PURE__ */ c("tr", { "aria-hidden": "true", children: Array.from({ length: e }, (l, d) => /* @__PURE__ */ c("td", { className: W(h.td, t[d] && h.numeric), children: /* @__PURE__ */ c("span", { className: h.skeleton, style: { width: `${o[(s + d) % o.length]}%` } }) }, d)) }, s)) });
|
|
3375
3374
|
}
|
|
3376
3375
|
const to = ht(0);
|
|
3377
3376
|
function vn({ height: e, colSpan: t }) {
|
|
@@ -3382,16 +3381,16 @@ function yn({
|
|
|
3382
3381
|
colSpan: t,
|
|
3383
3382
|
children: n
|
|
3384
3383
|
}) {
|
|
3385
|
-
const { count: o, fillerBefore: r, fillerAfter: s, showRow: l } = e,
|
|
3386
|
-
|
|
3384
|
+
const { count: o, fillerBefore: r, fillerAfter: s, showRow: l } = e, d = ue(null), [i, a] = Z(0), f = (v, w) => {
|
|
3385
|
+
d.current = w, a(w), l(w), requestAnimationFrame(() => {
|
|
3387
3386
|
var b;
|
|
3388
3387
|
(b = v.querySelector(`[data-row="${w}"]`)) == null || b.focus();
|
|
3389
3388
|
});
|
|
3390
|
-
},
|
|
3389
|
+
}, u = i >= e.from && i < e.to ? i : e.from, m = (v) => {
|
|
3391
3390
|
if (v.defaultPrevented || o === 0) return;
|
|
3392
3391
|
const w = v.target, b = w.closest("[data-row]");
|
|
3393
3392
|
if (b && w !== b) return;
|
|
3394
|
-
const p = b ? Number(b.dataset.row) :
|
|
3393
|
+
const p = b ? Number(b.dataset.row) : d.current ?? -1;
|
|
3395
3394
|
let g = null;
|
|
3396
3395
|
v.key === "ArrowDown" ? g = Math.min(o - 1, p + 1) : v.key === "ArrowUp" ? g = Math.max(0, p - 1) : v.key === "Home" ? g = 0 : v.key === "End" && (g = o - 1), !(g === null || g === p) && (v.preventDefault(), f(v.currentTarget, g));
|
|
3397
3396
|
};
|
|
@@ -3404,7 +3403,7 @@ function yn({
|
|
|
3404
3403
|
const w = v.target.closest("[data-row]");
|
|
3405
3404
|
w && a(Number(w.dataset.row));
|
|
3406
3405
|
},
|
|
3407
|
-
children: /* @__PURE__ */ M(to.Provider, { value:
|
|
3406
|
+
children: /* @__PURE__ */ M(to.Provider, { value: u, children: [
|
|
3408
3407
|
/* @__PURE__ */ c(vn, { height: r, colSpan: t }),
|
|
3409
3408
|
n,
|
|
3410
3409
|
/* @__PURE__ */ c(vn, { height: s, colSpan: t })
|
|
@@ -3412,7 +3411,7 @@ function yn({
|
|
|
3412
3411
|
}
|
|
3413
3412
|
);
|
|
3414
3413
|
}
|
|
3415
|
-
const pl = "_verdict_1mxfd_6", gl = "_glyph_1mxfd_13", ml = "_value_1mxfd_23", bl = "_excess_1mxfd_28",
|
|
3414
|
+
const pl = "_verdict_1mxfd_6", gl = "_glyph_1mxfd_13", ml = "_value_1mxfd_23", bl = "_excess_1mxfd_28", ut = {
|
|
3416
3415
|
verdict: pl,
|
|
3417
3416
|
glyph: gl,
|
|
3418
3417
|
value: ml,
|
|
@@ -3425,10 +3424,10 @@ const pl = "_verdict_1mxfd_6", gl = "_glyph_1mxfd_13", ml = "_value_1mxfd_23", b
|
|
|
3425
3424
|
};
|
|
3426
3425
|
function yl({ reading: e, format: t }) {
|
|
3427
3426
|
const n = Oe(), o = be(), { measured: r, assessment: s } = e, l = wl(s.verdict, o);
|
|
3428
|
-
return /* @__PURE__ */ M("span", { className:
|
|
3429
|
-
/* @__PURE__ */ c("span", { "aria-hidden": "true", className:
|
|
3430
|
-
/* @__PURE__ */ c("span", { className:
|
|
3431
|
-
s.excess !== void 0 && /* @__PURE__ */ M("span", { className:
|
|
3427
|
+
return /* @__PURE__ */ M("span", { className: ut.verdict, "data-verdict": s.verdict, title: l, children: [
|
|
3428
|
+
/* @__PURE__ */ c("span", { "aria-hidden": "true", className: ut.glyph, children: vl[s.verdict] }),
|
|
3429
|
+
/* @__PURE__ */ c("span", { className: ut.value, children: r === null ? o.statAbsentValue : _n(r, t, n) }),
|
|
3430
|
+
s.excess !== void 0 && /* @__PURE__ */ M("span", { className: ut.excess, children: [
|
|
3432
3431
|
"+",
|
|
3433
3432
|
_n(s.excess, t, n)
|
|
3434
3433
|
] }),
|
|
@@ -3440,19 +3439,19 @@ const _l = (e) => e.measured, kl = (e) => e.reduce(
|
|
|
3440
3439
|
void 0
|
|
3441
3440
|
);
|
|
3442
3441
|
function Sl(e) {
|
|
3443
|
-
return function({ id: n, value: o, label: r, limits: s, format: l, sortBy:
|
|
3442
|
+
return function({ id: n, value: o, label: r, limits: s, format: l, sortBy: d = "verdict", width: i, resizable: a, pin: f, aggregate: u }) {
|
|
3444
3443
|
const m = JSON.stringify(s), v = se(() => {
|
|
3445
3444
|
const b = JSON.parse(m);
|
|
3446
3445
|
return (p) => {
|
|
3447
3446
|
const g = typeof o == "string" ? p == null ? void 0 : p[o] : o(p);
|
|
3448
3447
|
return {
|
|
3449
3448
|
measured: typeof g == "number" && Number.isFinite(g) ? g : null,
|
|
3450
|
-
assessment:
|
|
3449
|
+
assessment: go(g, b)
|
|
3451
3450
|
};
|
|
3452
3451
|
};
|
|
3453
3452
|
}, [o, m]), w = ke(
|
|
3454
|
-
(b) =>
|
|
3455
|
-
[
|
|
3453
|
+
(b) => d === "value" ? b.measured : Tt(b.assessment.verdict),
|
|
3454
|
+
[d]
|
|
3456
3455
|
);
|
|
3457
3456
|
return /* @__PURE__ */ c(
|
|
3458
3457
|
e,
|
|
@@ -3466,7 +3465,7 @@ function Sl(e) {
|
|
|
3466
3465
|
value: v,
|
|
3467
3466
|
sortValue: w,
|
|
3468
3467
|
exportValue: _l,
|
|
3469
|
-
aggregate:
|
|
3468
|
+
aggregate: u === "worst" ? kl : void 0,
|
|
3470
3469
|
children: (b) => /* @__PURE__ */ c(yl, { reading: b, format: l })
|
|
3471
3470
|
}
|
|
3472
3471
|
);
|
|
@@ -3488,16 +3487,16 @@ function xl(e, t, n) {
|
|
|
3488
3487
|
return (s) => {
|
|
3489
3488
|
if (o !== t.structureVersion()) {
|
|
3490
3489
|
o = t.structureVersion(), r = [];
|
|
3491
|
-
for (const [l,
|
|
3490
|
+
for (const [l, d] of e) {
|
|
3492
3491
|
const i = n.get(l);
|
|
3493
3492
|
if (i) {
|
|
3494
|
-
r.push((f) => i.matches(f,
|
|
3493
|
+
r.push((f) => i.matches(f, d));
|
|
3495
3494
|
continue;
|
|
3496
3495
|
}
|
|
3497
3496
|
const a = t.columnById(l);
|
|
3498
|
-
a && oo(t, l,
|
|
3499
|
-
const
|
|
3500
|
-
return !
|
|
3497
|
+
a && oo(t, l, d) && r.push((f) => {
|
|
3498
|
+
const u = Ve(a.spec.filter);
|
|
3499
|
+
return !u || Xs(u, a.read(f), d);
|
|
3501
3500
|
});
|
|
3502
3501
|
}
|
|
3503
3502
|
}
|
|
@@ -3507,14 +3506,14 @@ function xl(e, t, n) {
|
|
|
3507
3506
|
function Nl(e, t) {
|
|
3508
3507
|
const n = se(() => t ? e.filter((l) => t(l)) : e, [e, t]), [o, r] = Z(n);
|
|
3509
3508
|
if (!t) return e;
|
|
3510
|
-
const s = o === n || o.length === n.length && o.every((l,
|
|
3509
|
+
const s = o === n || o.length === n.length && o.every((l, d) => l === n[d]);
|
|
3511
3510
|
return s || r(n), s ? o : n;
|
|
3512
3511
|
}
|
|
3513
3512
|
function Al(e, t) {
|
|
3514
|
-
var
|
|
3513
|
+
var d, i, a, f, u, m;
|
|
3515
3514
|
if (t.size === 0) return e;
|
|
3516
|
-
const n = (
|
|
3517
|
-
return (n == null ? void 0 : n.length) === ((f = e.sort) == null ? void 0 : f.length) && (o == null ? void 0 : o.length) === ((
|
|
3515
|
+
const n = (d = e.sort) == null ? void 0 : d.filter((v) => t.has(v.column)), o = (i = e.hidden) == null ? void 0 : i.filter((v) => t.has(v)), r = (a = e.order) == null ? void 0 : a.filter((v) => t.has(v)), s = e.widths ? Object.fromEntries(Object.entries(e.widths).filter(([v]) => t.has(v))) : void 0;
|
|
3516
|
+
return (n == null ? void 0 : n.length) === ((f = e.sort) == null ? void 0 : f.length) && (o == null ? void 0 : o.length) === ((u = e.hidden) == null ? void 0 : u.length) && (r == null ? void 0 : r.length) === ((m = e.order) == null ? void 0 : m.length) && Object.keys(s ?? {}).length === Object.keys(e.widths ?? {}).length ? e : {
|
|
3518
3517
|
...e.search ? { search: e.search } : {},
|
|
3519
3518
|
...e.page ? { page: e.page } : {},
|
|
3520
3519
|
...e.pageSize ? { pageSize: e.pageSize } : {},
|
|
@@ -3535,9 +3534,9 @@ function kn(e) {
|
|
|
3535
3534
|
function Tl(e, t, n) {
|
|
3536
3535
|
const o = [], r = (s, l) => {
|
|
3537
3536
|
if (!(l >= n))
|
|
3538
|
-
for (const
|
|
3539
|
-
const i = t.children(
|
|
3540
|
-
i != null && i.length && (o.push(t.key(
|
|
3537
|
+
for (const d of s) {
|
|
3538
|
+
const i = t.children(d);
|
|
3539
|
+
i != null && i.length && (o.push(t.key(d)), r(i, l + 1));
|
|
3541
3540
|
}
|
|
3542
3541
|
};
|
|
3543
3542
|
return r(e, 0), o;
|
|
@@ -3555,7 +3554,7 @@ function Ml(e, t) {
|
|
|
3555
3554
|
return { ...T, VerdictColumn: Sl(T.Column) };
|
|
3556
3555
|
});
|
|
3557
3556
|
pt(n.subscribe, n.structureVersion, n.structureVersion);
|
|
3558
|
-
const r = Oe(), s = be(), l = e,
|
|
3557
|
+
const r = Oe(), s = be(), l = e, d = n.modelColumns(l, r), [i] = Z(() => t.initialView), a = t.manual === !0, f = t.manual ? t.rowCount : 0, u = se(() => a ? { rowCount: f } : void 0, [a, f]);
|
|
3559
3558
|
n.setManual(a), a && ((t.preFilter ?? t.filter) && ge("manual-prefilter", "`preFilter` is passed over in manual mode: the server decides which rows the table has."), t.virtual && ge("manual-virtual", "`virtual` is passed over in manual mode: the table pages instead."), (t.defaultGrouping !== void 0 || (H = i == null ? void 0 : i.grouping) != null && H.length) && ge("manual-grouping", "A grouping is passed over in manual mode: the groups would be the page's, not the server's."));
|
|
3560
3559
|
const [m, v] = Z(() => Object.entries((i == null ? void 0 : i.conditions) ?? {})), w = t.rowFilters ?? Cl, b = w.map((T) => T.id).join("\0"), p = se(
|
|
3561
3560
|
() => new Map(w.map((T) => [T.id, T])),
|
|
@@ -3568,7 +3567,7 @@ function Ml(e, t) {
|
|
|
3568
3567
|
() => i != null && i.grouping ? [...i.grouping] : Nt(t.defaultGrouping)
|
|
3569
3568
|
), [C, N] = Z(() => (i == null ? void 0 : i.folded) ?? []), [L, R] = Z(() => i != null && i.pinned ? { ...i.pinned } : null), K = t.rowKey, q = t.manual ? void 0 : t.childRows, E = q !== void 0;
|
|
3570
3569
|
n.setTree(E);
|
|
3571
|
-
const D =
|
|
3570
|
+
const D = ue({ children: q, key: K });
|
|
3572
3571
|
ae(() => {
|
|
3573
3572
|
D.current = { children: q, key: K };
|
|
3574
3573
|
});
|
|
@@ -3582,10 +3581,10 @@ function Ml(e, t) {
|
|
|
3582
3581
|
})), [X] = Z(() => {
|
|
3583
3582
|
const T = t.manual ? void 0 : t.defaultBranches;
|
|
3584
3583
|
return !E || T === void 0 ? [] : typeof T == "number" ? Tl(l, F, T) : [...T];
|
|
3585
|
-
}), [Q, ye] = Z(() => (i == null ? void 0 : i.branches) ?? X), _e = se(() => E ? new Set(
|
|
3584
|
+
}), [Q, ye] = Z(() => (i == null ? void 0 : i.branches) ?? X), _e = se(() => E ? new Set(mo(l, F)) : /* @__PURE__ */ new Set(), [E, l, F]), oe = E ? Q.filter((T) => _e.has(T)) : [];
|
|
3586
3585
|
se(() => {
|
|
3587
3586
|
if (!E) return;
|
|
3588
|
-
const T =
|
|
3587
|
+
const T = bo(l, F);
|
|
3589
3588
|
T !== null && ge(`tree-duplicate:${T}`, `The row key "${T}" occurs twice in the tree: its fold and its selection would act on both rows.`);
|
|
3590
3589
|
}, [E, l, F]), E && (t.defaultGrouping !== void 0 || (we = i == null ? void 0 : i.grouping) != null && we.length) && ge("tree-grouping", "A grouping is passed over with `childRows`: tree rows and grouping both build levels.");
|
|
3591
3590
|
const y = n.orderedColumns().length + n.groupKeys.entries.size > 0, A = a || E ? [] : y ? n.effectiveGrouping(_, l) : _.slice(0, Wt), B = A.join("|"), j = se(() => new Set(C), [C]), z = A.length ? n.groupingModel(A, l) : null, ne = se(
|
|
@@ -3600,7 +3599,7 @@ function Ml(e, t) {
|
|
|
3600
3599
|
the roots, if a caller needs that live. */
|
|
3601
3600
|
// eslint-disable-next-line react-hooks/exhaustive-deps -- the open keys by value; the rows the pre-filter admits stand for it
|
|
3602
3601
|
[E, G, P, F]
|
|
3603
|
-
), V =
|
|
3602
|
+
), V = Lo(P, d, {
|
|
3604
3603
|
rowKey: K,
|
|
3605
3604
|
pageSize: t.pageSize,
|
|
3606
3605
|
defaultSort: t.defaultSort,
|
|
@@ -3608,7 +3607,7 @@ function Ml(e, t) {
|
|
|
3608
3607
|
initialView: i,
|
|
3609
3608
|
virtual: a ? void 0 : t.virtual,
|
|
3610
3609
|
grouping: ne,
|
|
3611
|
-
manual:
|
|
3610
|
+
manual: u,
|
|
3612
3611
|
tree: ce
|
|
3613
3612
|
}), { setPage: ee } = V, Y = ke(
|
|
3614
3613
|
(T, S) => {
|
|
@@ -3644,20 +3643,20 @@ function Ml(e, t) {
|
|
|
3644
3643
|
}), ee(1);
|
|
3645
3644
|
},
|
|
3646
3645
|
[n, ee, p]
|
|
3647
|
-
),
|
|
3648
|
-
if (!Sn(Ne,
|
|
3649
|
-
const T = new Set([...Ne].filter(($) => !
|
|
3650
|
-
Je(
|
|
3646
|
+
), de = new Set(n.orderedColumns().map((T) => T.spec.id)), [Ne, Je] = Z(() => /* @__PURE__ */ new Set());
|
|
3647
|
+
if (!Sn(Ne, de)) {
|
|
3648
|
+
const T = new Set([...Ne].filter(($) => !de.has($)));
|
|
3649
|
+
Je(de);
|
|
3651
3650
|
const S = ($) => T.has($) && !p.has($);
|
|
3652
3651
|
m.some(([$]) => S($)) && v(($) => $.filter(([fe]) => !S(fe)));
|
|
3653
3652
|
}
|
|
3654
|
-
const I =
|
|
3653
|
+
const I = de.size === 0 ? m : m.filter(([T, S]) => p.has(T) || oo(n, T, S)), U = Al(V.view, de), te = I.length > 0 ? { ...U, conditions: Object.fromEntries(I) } : U, ie = de.size === 0 ? V.sort : V.sort.filter((T) => de.has(T.column)), re = a || E ? [] : y ? n.effectiveGrouping(Nt(t.defaultGrouping), l) : Nt(t.defaultGrouping), Le = V.groups ? xo(V.groups, C) : y ? [] : [...C], $e = n.declaredPins(), at = Io(L, $e, de), De = {
|
|
3655
3654
|
...te,
|
|
3656
3655
|
...Rl(A, re) ? {} : { grouping: A },
|
|
3657
3656
|
...Le.length ? { folded: Le } : {},
|
|
3658
3657
|
...at ? { pinned: at } : {},
|
|
3659
3658
|
...E && !Sn(new Set(oe), new Set(X.filter((T) => _e.has(T)))) ? { branches: oe } : {}
|
|
3660
|
-
}, Ke = (T, S) => R(($) =>
|
|
3659
|
+
}, Ke = (T, S) => R(($) => Bo($ ?? n.declaredPins(), T, S)), ct = (T) => {
|
|
3661
3660
|
k([...T]), ee(1);
|
|
3662
3661
|
}, le = (T) => {
|
|
3663
3662
|
kn(V.groups).includes(T) && (n.noteFocusBeforeFold(), N((S) => S.includes(T) ? S.filter(($) => $ !== T) : [...S, T]));
|
|
@@ -3668,7 +3667,7 @@ function Ml(e, t) {
|
|
|
3668
3667
|
sort: ie,
|
|
3669
3668
|
page: V.page,
|
|
3670
3669
|
pageSize: V.pageSize
|
|
3671
|
-
}, He = a ?
|
|
3670
|
+
}, He = a ? Ko(Ae) : "", Qe = ue(null);
|
|
3672
3671
|
st(() => {
|
|
3673
3672
|
var T;
|
|
3674
3673
|
!a || Qe.current === He || (Qe.current = He, (T = t.onViewChange) == null || T.call(t, Ae));
|
|
@@ -3704,7 +3703,7 @@ function Ml(e, t) {
|
|
|
3704
3703
|
setOrder: V.setOrder,
|
|
3705
3704
|
pinned: L ?? $e,
|
|
3706
3705
|
setPin: Ke,
|
|
3707
|
-
widths: Ol(
|
|
3706
|
+
widths: Ol(d, V.widths),
|
|
3708
3707
|
setWidth: V.setWidth,
|
|
3709
3708
|
expanded: V.expanded,
|
|
3710
3709
|
toggleRow: V.toggleRow,
|
|
@@ -3740,7 +3739,7 @@ function Ml(e, t) {
|
|
|
3740
3739
|
return n.setHook({
|
|
3741
3740
|
rows: l,
|
|
3742
3741
|
admitted: P,
|
|
3743
|
-
modelColumns:
|
|
3742
|
+
modelColumns: d,
|
|
3744
3743
|
companion: V,
|
|
3745
3744
|
filter: g,
|
|
3746
3745
|
grouping: ne,
|
|
@@ -3774,7 +3773,7 @@ function Sa({ children: e, className: t, size: n = "sm", of: o }) {
|
|
|
3774
3773
|
return /* @__PURE__ */ c(Hn, { registry: s ?? null, className: t, size: n, children: e });
|
|
3775
3774
|
}
|
|
3776
3775
|
function Ca({ placeholder: e, "aria-label": t, className: n, size: o, of: r }) {
|
|
3777
|
-
const s = lt(r), l = bt(o),
|
|
3776
|
+
const s = lt(r), l = bt(o), d = be();
|
|
3778
3777
|
if (Qt(s == null ? void 0 : s.registry, "search"), !s) return null;
|
|
3779
3778
|
const { snapshot: i } = s;
|
|
3780
3779
|
return /* @__PURE__ */ c(
|
|
@@ -3782,18 +3781,18 @@ function Ca({ placeholder: e, "aria-label": t, className: n, size: o, of: r }) {
|
|
|
3782
3781
|
{
|
|
3783
3782
|
size: l,
|
|
3784
3783
|
type: "search",
|
|
3785
|
-
className:
|
|
3784
|
+
className: n,
|
|
3786
3785
|
value: i.search,
|
|
3787
3786
|
onChange: (a) => i.setSearch(a.target.value),
|
|
3788
3787
|
clearable: !0,
|
|
3789
3788
|
onClear: () => i.setSearch(""),
|
|
3790
|
-
placeholder: e ??
|
|
3791
|
-
"aria-label": t ??
|
|
3789
|
+
placeholder: e ?? d.tableSearchPlaceholder,
|
|
3790
|
+
"aria-label": t ?? d.tableSearchLabel
|
|
3792
3791
|
}
|
|
3793
3792
|
);
|
|
3794
3793
|
}
|
|
3795
3794
|
function xa({ size: e, of: t }) {
|
|
3796
|
-
const n = lt(t), o = bt(e), r = be(), [s, l] = Z(!1),
|
|
3795
|
+
const n = lt(t), o = bt(e), r = be(), [s, l] = Z(!1), d = ue(null), i = ue(null), a = Te(), [f, u] = Z(null);
|
|
3797
3796
|
if (ae(() => {
|
|
3798
3797
|
var N;
|
|
3799
3798
|
if (!f || !i.current) return;
|
|
@@ -3810,7 +3809,7 @@ function xa({ size: e, of: t }) {
|
|
|
3810
3809
|
if (!g(_, k)) return;
|
|
3811
3810
|
[C[_], C[N]] = [C[N], C[_]], v.setOrder(C);
|
|
3812
3811
|
const [L, R] = k < 0 ? ["forward", "backward"] : ["backward", "forward"];
|
|
3813
|
-
|
|
3812
|
+
u({ id: b[_].id, key: `[data-direction="${L}"]`, otherwise: `[data-direction="${R}"]` });
|
|
3814
3813
|
}, P = (_, k, C) => {
|
|
3815
3814
|
const N = p[_] === C;
|
|
3816
3815
|
return /* @__PURE__ */ c(ot, { content: N ? r.unpinHint : C === "start" ? r.pinToStartHint : r.pinToEndHint, children: /* @__PURE__ */ c(
|
|
@@ -3821,7 +3820,7 @@ function xa({ size: e, of: t }) {
|
|
|
3821
3820
|
"data-pin": C,
|
|
3822
3821
|
"aria-label": N ? r.unpinColumn(k) : C === "start" ? r.pinColumnToStart(k) : r.pinColumnToEnd(k),
|
|
3823
3822
|
onClick: () => {
|
|
3824
|
-
v.setPin(_, N ? null : C),
|
|
3823
|
+
v.setPin(_, N ? null : C), u({ id: _, key: `[data-pin="${C}"]` });
|
|
3825
3824
|
},
|
|
3826
3825
|
children: /* @__PURE__ */ c("svg", { viewBox: "0 0 10 10", width: "10", height: "10", "aria-hidden": "true", children: /* @__PURE__ */ c(
|
|
3827
3826
|
"path",
|
|
@@ -3841,7 +3840,7 @@ function xa({ size: e, of: t }) {
|
|
|
3841
3840
|
/* @__PURE__ */ c(
|
|
3842
3841
|
he,
|
|
3843
3842
|
{
|
|
3844
|
-
ref:
|
|
3843
|
+
ref: d,
|
|
3845
3844
|
size: o,
|
|
3846
3845
|
"aria-haspopup": "dialog",
|
|
3847
3846
|
"aria-expanded": s,
|
|
@@ -3855,7 +3854,7 @@ function xa({ size: e, of: t }) {
|
|
|
3855
3854
|
{
|
|
3856
3855
|
open: s,
|
|
3857
3856
|
onOpenChange: l,
|
|
3858
|
-
anchorRef:
|
|
3857
|
+
anchorRef: d,
|
|
3859
3858
|
align: "start",
|
|
3860
3859
|
role: "dialog",
|
|
3861
3860
|
ariaLabel: r.arrangeColumns,
|
|
@@ -3912,29 +3911,30 @@ function xa({ size: e, of: t }) {
|
|
|
3912
3911
|
function Na({ filename: e, onExport: t, size: n, of: o }) {
|
|
3913
3912
|
const r = lt(o), s = bt(n), l = be();
|
|
3914
3913
|
if (!r) return null;
|
|
3915
|
-
const { snapshot:
|
|
3914
|
+
const { snapshot: d } = r;
|
|
3916
3915
|
return /* @__PURE__ */ c(he, { size: s, onClick: () => {
|
|
3917
|
-
const a =
|
|
3916
|
+
const a = d.asCsv();
|
|
3918
3917
|
if (t) {
|
|
3919
3918
|
t(a);
|
|
3920
3919
|
return;
|
|
3921
3920
|
}
|
|
3922
|
-
const f = URL.createObjectURL(new Blob([a], { type: "text/csv;charset=utf-8" })),
|
|
3923
|
-
|
|
3924
|
-
}, children:
|
|
3921
|
+
const f = URL.createObjectURL(new Blob([a], { type: "text/csv;charset=utf-8" })), u = document.createElement("a");
|
|
3922
|
+
u.href = f, u.download = e ?? l.exportFileName, u.click(), setTimeout(() => URL.revokeObjectURL(f), 1e4);
|
|
3923
|
+
}, children: d.manual ? l.exportPageLabel : l.exportLabel });
|
|
3925
3924
|
}
|
|
3926
3925
|
function Aa({ pageSizes: e = [10, 25, 50], className: t, of: n }) {
|
|
3927
3926
|
const o = lt(n), r = be(), s = Oe();
|
|
3928
3927
|
if (Qt(o == null ? void 0 : o.registry, "pagination"), o != null && o.registry.tree && ge("tree-pagination", "`Pagination` is passed over with `childRows`: a page cut through a branch tears rows from their parent. A large tree uses `virtual`."), !o || o.snapshot.virtual || o.registry.tree) return null;
|
|
3929
|
-
const { snapshot: l } = o,
|
|
3930
|
-
/* @__PURE__ */ c("span", { children: r.entries(
|
|
3928
|
+
const { snapshot: l } = o, d = l.rowCount, i = e.includes(l.pageSize) ? e : [...e, l.pageSize].sort((f, u) => f - u), a = /* @__PURE__ */ M("nav", { "aria-label": r.pagination, className: W(h.pagination, t), children: [
|
|
3929
|
+
/* @__PURE__ */ c("span", { children: r.entries(d, s.count(d)) }),
|
|
3931
3930
|
/* @__PURE__ */ M("div", { className: h.paginationControls, children: [
|
|
3932
3931
|
/* @__PURE__ */ M("label", { className: h.pageSize, children: [
|
|
3933
3932
|
r.rows,
|
|
3934
3933
|
/* @__PURE__ */ c(
|
|
3935
3934
|
An,
|
|
3936
3935
|
{
|
|
3937
|
-
|
|
3936
|
+
size: "sm",
|
|
3937
|
+
chars: Math.max(...i.map((f) => String(f).length)),
|
|
3938
3938
|
value: l.pageSize,
|
|
3939
3939
|
onChange: (f) => l.setPageSize(Number(f.target.value)),
|
|
3940
3940
|
"aria-label": r.rowsPerPage,
|
|
@@ -3952,7 +3952,7 @@ function Aa({ pageSizes: e = [10, 25, 50], className: t, of: n }) {
|
|
|
3952
3952
|
] })
|
|
3953
3953
|
] })
|
|
3954
3954
|
] });
|
|
3955
|
-
return o.inside ? o.footerTarget ?
|
|
3955
|
+
return o.inside ? o.footerTarget ? yo(a, o.footerTarget) : null : a;
|
|
3956
3956
|
}
|
|
3957
3957
|
const Fl = ["high", "medium", "low"], Ll = (e) => Fl.indexOf(e), Dl = (e) => e === "active-unacknowledged" || e === "active-acknowledged", yt = (e) => e === "active-acknowledged" || e === "resolved-acknowledged", El = (e) => e === "resolved-acknowledged";
|
|
3958
3958
|
function Bl(e, t) {
|
|
@@ -4049,7 +4049,7 @@ const Hl = (e) => [
|
|
|
4049
4049
|
{ id: "raised", label: e.columnRaised, value: (t) => t.alarm.raised },
|
|
4050
4050
|
{ id: "age", label: e.columnAge, value: (t) => t.age },
|
|
4051
4051
|
{ id: "frequency", label: e.columnFrequency, value: (t) => t.frequency }
|
|
4052
|
-
], jl = Hl(
|
|
4052
|
+
], jl = Hl(wo), Wl = [
|
|
4053
4053
|
{ column: "availability", direction: "asc" },
|
|
4054
4054
|
{ column: "priority", direction: "asc" },
|
|
4055
4055
|
{ column: "acknowledgement", direction: "asc" },
|
|
@@ -4066,9 +4066,9 @@ function Ea(e, t = {}) {
|
|
|
4066
4066
|
asOf: r,
|
|
4067
4067
|
chatter: s,
|
|
4068
4068
|
flood: l,
|
|
4069
|
-
keepDone:
|
|
4069
|
+
keepDone: d = !1,
|
|
4070
4070
|
columns: i = jl
|
|
4071
|
-
} = e, a = new Map(o.map((b) => [b.id, b])), f = zl(n, (s == null ? void 0 : s.windowMs) ?? 1 / 0, r),
|
|
4071
|
+
} = e, a = new Map(o.map((b) => [b.id, b])), f = zl(n, (s == null ? void 0 : s.windowMs) ?? 1 / 0, r), u = l ? Kl(n, l, r) : null, m = new Set((u == null ? void 0 : u.alarms) ?? []), v = n.filter((b) => d || !El(b.lifecycle)).map((b) => {
|
|
4072
4072
|
const p = a.get(b.type) ?? ql(b.type), g = f.get(b.type) ?? 0;
|
|
4073
4073
|
return {
|
|
4074
4074
|
id: b.id,
|
|
@@ -4090,7 +4090,7 @@ function Ea(e, t = {}) {
|
|
|
4090
4090
|
});
|
|
4091
4091
|
return {
|
|
4092
4092
|
...w,
|
|
4093
|
-
flood:
|
|
4093
|
+
flood: u,
|
|
4094
4094
|
activeUnacknowledged: w.filtered.reduce(
|
|
4095
4095
|
(b, p) => b + (p.lifecycle === "active-unacknowledged" && !$t(p.availability) ? 1 : 0),
|
|
4096
4096
|
0
|
|
@@ -4101,7 +4101,7 @@ function Ea(e, t = {}) {
|
|
|
4101
4101
|
)
|
|
4102
4102
|
};
|
|
4103
4103
|
}
|
|
4104
|
-
const Ul = "_list_1t95e_4
|
|
4104
|
+
const Ul = "_list_1t95e_4 _text_12fqh_23", Yl = "_bar_1t95e_12", Jl = "_heading_1t95e_19", Xl = "_filler_1t95e_25", Ql = "_asOf_1t95e_29", Zl = "_live_1t95e_46", ea = "_alarm_1t95e_54", ta = "_label_1t95e_59", na = "_counter_1t95e_63", oa = "_state_1t95e_70", ra = "_lifecycle_1t95e_74", sa = "_hidden_1t95e_80", ia = "_hiddenLabel_1t95e_87", la = "_availability_1t95e_93", aa = "_empty_1t95e_97", ca = "_row_1t95e_105", pe = {
|
|
4105
4105
|
list: Ul,
|
|
4106
4106
|
bar: Yl,
|
|
4107
4107
|
heading: Jl,
|
|
@@ -4119,7 +4119,7 @@ const Ul = "_list_1t95e_4 _text_ocaqi_23", Yl = "_bar_1t95e_12", Jl = "_heading_
|
|
|
4119
4119
|
empty: aa,
|
|
4120
4120
|
row: ca
|
|
4121
4121
|
};
|
|
4122
|
-
function
|
|
4122
|
+
function da(e, t) {
|
|
4123
4123
|
switch (e) {
|
|
4124
4124
|
case "active-unacknowledged":
|
|
4125
4125
|
return t.lifecycleActiveUnacknowledged;
|
|
@@ -4131,13 +4131,13 @@ function ua(e, t) {
|
|
|
4131
4131
|
return t.lifecycleResolvedAcknowledged;
|
|
4132
4132
|
}
|
|
4133
4133
|
}
|
|
4134
|
-
function
|
|
4134
|
+
function ua(e, t, n) {
|
|
4135
4135
|
switch (e.availability) {
|
|
4136
4136
|
case "snoozed": {
|
|
4137
4137
|
const o = e.alarm.snooze;
|
|
4138
4138
|
if (!o) return null;
|
|
4139
|
-
const r = new Date(o.until), s = new Date(e.alarm.raised + e.age),
|
|
4140
|
-
return { short: t.availabilitySnoozedShort, full: t.availabilitySnoozed(
|
|
4139
|
+
const r = new Date(o.until), s = new Date(e.alarm.raised + e.age), d = r.toDateString() === s.toDateString() ? n.time(r, !1) : n.dateTime(r, !1);
|
|
4140
|
+
return { short: t.availabilitySnoozedShort, full: t.availabilitySnoozed(d, o.by) };
|
|
4141
4141
|
}
|
|
4142
4142
|
case "suppressed":
|
|
4143
4143
|
return { short: t.availabilitySuppressed, full: t.availabilitySuppressed };
|
|
@@ -4166,7 +4166,7 @@ function ga({
|
|
|
4166
4166
|
ages: t,
|
|
4167
4167
|
...n
|
|
4168
4168
|
}) {
|
|
4169
|
-
const o =
|
|
4169
|
+
const o = vo(e, t);
|
|
4170
4170
|
return /* @__PURE__ */ c(ro, { ...n, freshness: o });
|
|
4171
4171
|
}
|
|
4172
4172
|
function ro({
|
|
@@ -4177,24 +4177,24 @@ function ro({
|
|
|
4177
4177
|
className: r,
|
|
4178
4178
|
freshness: s,
|
|
4179
4179
|
hiddenOnly: l = !1,
|
|
4180
|
-
onHiddenOnlyChange:
|
|
4180
|
+
onHiddenOnlyChange: d,
|
|
4181
4181
|
...i
|
|
4182
4182
|
}) {
|
|
4183
|
-
const a = be(), f = Oe(),
|
|
4183
|
+
const a = be(), f = Oe(), u = s !== null, m = (s == null ? void 0 : s.freshness) === "lost", { Table: v, Column: w } = Ml(e.visible, { rowKey: (_) => _.id, selection: t }), b = se(() => e.filtered.map((_) => _.alarm), [e.filtered]), p = se(() => t === void 0 ? [] : e.filtered.map((_) => _.id).filter((_) => t.selected.has(_)), [e.filtered, t]), g = se(() => Gl(b, p), [b, p]), O = Tn(o, "compact"), P = a.hiddenAlarms(e.hiddenAlarms);
|
|
4184
4184
|
return /* @__PURE__ */ M("div", { className: [pe.list, r].filter(Boolean).join(" "), ...i, children: [
|
|
4185
4185
|
/* @__PURE__ */ M("div", { className: pe.bar, children: [
|
|
4186
4186
|
/* @__PURE__ */ c("span", { className: pe.heading, children: a.alarms }),
|
|
4187
4187
|
e.flood !== null && /* @__PURE__ */ c(et, { tone: "warning", children: a.floodHint(e.flood.count) }),
|
|
4188
|
-
|
|
4188
|
+
u && s !== null && /* @__PURE__ */ M("span", { className: pe.asOf, "data-freshness": s.freshness, children: [
|
|
4189
4189
|
s.freshness === "lost" ? a.freshnessDisconnected : s.freshness === "stale" ? a.freshnessStale : a.freshnessFresh,
|
|
4190
4190
|
s.age !== null && ` · ${f.relative(s.age)}`
|
|
4191
4191
|
] }),
|
|
4192
|
-
|
|
4192
|
+
d !== void 0 && (e.hiddenAlarms > 0 || l) ? /* @__PURE__ */ c(
|
|
4193
4193
|
qe,
|
|
4194
4194
|
{
|
|
4195
4195
|
className: pe.hidden,
|
|
4196
4196
|
checked: l,
|
|
4197
|
-
onChange: (_) =>
|
|
4197
|
+
onChange: (_) => d(_.currentTarget.checked),
|
|
4198
4198
|
label: /* @__PURE__ */ c("span", { className: pe.hiddenLabel, children: P })
|
|
4199
4199
|
}
|
|
4200
4200
|
) : e.hiddenAlarms > 0 && /* @__PURE__ */ c("span", { className: pe.hidden, children: P }),
|
|
@@ -4222,13 +4222,13 @@ function ro({
|
|
|
4222
4222
|
k.chatters && /* @__PURE__ */ c(et, { tone: "warning", pill: !0, className: pe.counter, children: a.chatterHint(k.frequency) })
|
|
4223
4223
|
] }) }),
|
|
4224
4224
|
/* @__PURE__ */ c(w, { value: "lifecycle", label: a.columnLifecycleState, sortable: !1, children: (_, k) => {
|
|
4225
|
-
const C =
|
|
4225
|
+
const C = ua(k, a, f), N = C === null ? null : C.short === C.full ? /* @__PURE__ */ c(et, { className: pe.availability, children: C.short }) : /* @__PURE__ */ c(ot, { content: C.full, children: /* @__PURE__ */ M(et, { className: pe.availability, children: [
|
|
4226
4226
|
/* @__PURE__ */ c("span", { "aria-hidden": "true", children: C.short }),
|
|
4227
4227
|
/* @__PURE__ */ c(Pe, { children: C.full })
|
|
4228
4228
|
] }) });
|
|
4229
4229
|
return /* @__PURE__ */ M("span", { className: pe.state, children: [
|
|
4230
4230
|
N,
|
|
4231
|
-
/* @__PURE__ */ c("span", { className: pe.lifecycle, children:
|
|
4231
|
+
/* @__PURE__ */ c("span", { className: pe.lifecycle, children: da(_, a) })
|
|
4232
4232
|
] });
|
|
4233
4233
|
} }),
|
|
4234
4234
|
/* @__PURE__ */ c(w, { value: "priority", label: a.columnPriority, sortable: !1, children: (_, k) => /* @__PURE__ */ c(et, { tone: $t(k.availability) ? "neutral" : ha(_), children: fa(_, a) }) }),
|
|
@@ -4286,5 +4286,5 @@ export {
|
|
|
4286
4286
|
Ra as snooze,
|
|
4287
4287
|
Ta as unsnooze,
|
|
4288
4288
|
Ml as useTable,
|
|
4289
|
-
|
|
4289
|
+
_o as useTableSelection
|
|
4290
4290
|
};
|