@umriss-ui/table 0.41.1 → 0.42.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 +32 -2
- package/README.md +12 -3
- package/dist/index.d.ts +0 -12
- package/dist/table.css +1 -1
- package/dist/table.js +1021 -1018
- package/docs/llms-full.md +86 -37
- package/package.json +7 -6
package/dist/table.js
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import "./table.css";
|
|
3
|
-
import { useState as
|
|
4
|
-
import { DEFAULT_FORMATS as
|
|
3
|
+
import { useState as V, useCallback as fe, useMemo as j, useRef as W, useId as be, useContext as _e, createContext as rt, useSyncExternalStore as st, useLayoutEffect as Z, useEffect as xe } from "react";
|
|
4
|
+
import { DEFAULT_FORMATS as xn, treeModel as rn, useVirtual as Oo, useFormats as ke, useWording as ie, Checkbox as He, DateRangePicker as Eo, FormField as vt, NumberInput as yt, separatorsOf as Mo, Tooltip as tt, Popover as it, Button as Q, TagGroup as An, Tag as Dt, Menu as Nn, MenuItem as nt, MenuSeparator as Lo, ControlSizeProvider as Tn, Select as Rn, VisuallyHidden as Oe, DatePicker as qo, Input as On, announce as Fo, usePortalTarget as Bo, IconButton as Do, AngleGlyph as Po, useDensityFor as Vo, assess as Io, verdictWeight as _t, allBranches as $o, duplicateKey as zo } from "@umriss-ui/core";
|
|
5
5
|
import { jsx as f, jsxs as T, Fragment as re } from "react/jsx-runtime";
|
|
6
6
|
import { createPortal as En } from "react-dom";
|
|
7
|
-
function
|
|
8
|
-
const [t, n] =
|
|
9
|
-
n((
|
|
10
|
-
const
|
|
11
|
-
return
|
|
7
|
+
function Ko(e) {
|
|
8
|
+
const [t, n] = V(/* @__PURE__ */ new Set()), o = fe((a) => t.has(a), [t]), r = fe((a) => {
|
|
9
|
+
n((d) => {
|
|
10
|
+
const u = new Set(d);
|
|
11
|
+
return u.has(a) ? u.delete(a) : u.add(a), u;
|
|
12
12
|
});
|
|
13
|
-
}, []), s =
|
|
13
|
+
}, []), s = j(
|
|
14
14
|
() => e.length > 0 && e.every((a) => t.has(a)),
|
|
15
15
|
[e, t]
|
|
16
|
-
), i =
|
|
16
|
+
), i = j(
|
|
17
17
|
() => !s && e.some((a) => t.has(a)),
|
|
18
18
|
[e, t, s]
|
|
19
19
|
), l = fe(() => {
|
|
20
20
|
n((a) => {
|
|
21
|
-
const
|
|
22
|
-
return e.length > 0 && e.every((b) =>
|
|
21
|
+
const d = new Set(a);
|
|
22
|
+
return e.length > 0 && e.every((b) => d.has(b)) ? e.forEach((b) => d.delete(b)) : e.forEach((b) => d.add(b)), d;
|
|
23
23
|
});
|
|
24
24
|
}, [e]), c = fe(() => n(/* @__PURE__ */ new Set()), []);
|
|
25
25
|
return { selected: t, isSelected: o, toggle: r, toggleAll: l, clear: c, allSelected: s, someSelected: i, count: t.size };
|
|
@@ -35,8 +35,8 @@ function Mn(e, t) {
|
|
|
35
35
|
}
|
|
36
36
|
return "empty";
|
|
37
37
|
}
|
|
38
|
-
const
|
|
39
|
-
function
|
|
38
|
+
const Pt = (e, t) => t ?? e === "number";
|
|
39
|
+
function De(e, t, n, o) {
|
|
40
40
|
switch (lt(e)) {
|
|
41
41
|
case "text":
|
|
42
42
|
return e;
|
|
@@ -54,9 +54,9 @@ function Pe(e, t, n, o) {
|
|
|
54
54
|
return null;
|
|
55
55
|
}
|
|
56
56
|
}
|
|
57
|
-
function
|
|
57
|
+
function kt(e, t) {
|
|
58
58
|
if (!se(e)) {
|
|
59
|
-
if (t) return
|
|
59
|
+
if (t) return kt(t(e));
|
|
60
60
|
switch (lt(e)) {
|
|
61
61
|
case "text":
|
|
62
62
|
return e;
|
|
@@ -71,9 +71,9 @@ function xt(e, t) {
|
|
|
71
71
|
}
|
|
72
72
|
}
|
|
73
73
|
}
|
|
74
|
-
function
|
|
74
|
+
function Vt(e, t) {
|
|
75
75
|
if (!se(e)) {
|
|
76
|
-
if (t) return
|
|
76
|
+
if (t) return Vt(t(e));
|
|
77
77
|
switch (lt(e)) {
|
|
78
78
|
case "text":
|
|
79
79
|
return e;
|
|
@@ -88,23 +88,23 @@ function It(e, t) {
|
|
|
88
88
|
}
|
|
89
89
|
}
|
|
90
90
|
}
|
|
91
|
-
const
|
|
92
|
-
function
|
|
93
|
-
const n = t.map(e.read).filter((
|
|
91
|
+
const It = "absent", Ce = (e) => se(e) ? It : e instanceof Date ? `value:${e.getTime()}` : `value:${String(e)}`, sn = (e) => e instanceof Date ? e.getTime() : typeof e == "number" && !Number.isNaN(e) ? e : void 0;
|
|
92
|
+
function $t(e, t) {
|
|
93
|
+
const n = t.map(e.read).filter((d) => !se(d) && !(d instanceof Date && Number.isNaN(d.getTime()))), o = e.aggregate;
|
|
94
94
|
if (typeof o == "function") return o(n, t);
|
|
95
95
|
if (o === "count") return n.length;
|
|
96
|
-
if (o === "distinct") return new Set(n.map(
|
|
97
|
-
const r = n.filter((
|
|
96
|
+
if (o === "distinct") return new Set(n.map(Ce)).size;
|
|
97
|
+
const r = n.filter((d) => sn(d) !== void 0);
|
|
98
98
|
if (r.length === 0) return;
|
|
99
|
-
const s = r.map((
|
|
99
|
+
const s = r.map((d) => sn(d)), i = r[0] instanceof Date, l = (d) => i ? new Date(d) : d;
|
|
100
100
|
let c = 1 / 0, a = -1 / 0;
|
|
101
|
-
for (const
|
|
102
|
-
|
|
101
|
+
for (const d of s)
|
|
102
|
+
d < c && (c = d), d > a && (a = d);
|
|
103
103
|
switch (o) {
|
|
104
104
|
case "sum":
|
|
105
|
-
return s.reduce((
|
|
105
|
+
return s.reduce((d, u) => d + u, 0);
|
|
106
106
|
case "avg":
|
|
107
|
-
return s.reduce((
|
|
107
|
+
return s.reduce((d, u) => d + u, 0) / s.length;
|
|
108
108
|
case "min":
|
|
109
109
|
return l(c);
|
|
110
110
|
case "max":
|
|
@@ -113,40 +113,40 @@ function zt(e, t) {
|
|
|
113
113
|
return [l(c), l(a)];
|
|
114
114
|
}
|
|
115
115
|
}
|
|
116
|
-
const
|
|
116
|
+
const zt = 3, je = (e) => {
|
|
117
117
|
if (!se(e))
|
|
118
118
|
return e instanceof Date ? e.getTime() : typeof e == "boolean" ? e ? 1 : 0 : typeof e == "number" ? e : String(e);
|
|
119
119
|
};
|
|
120
120
|
function pt(e, t, n) {
|
|
121
|
-
const o =
|
|
121
|
+
const o = je(e), r = je(t);
|
|
122
122
|
return o === void 0 || r === void 0 ? o === r ? 0 : o === void 0 ? 1 : -1 : typeof o == "number" && typeof r == "number" ? o - r : n(String(o), String(r));
|
|
123
123
|
}
|
|
124
|
-
function
|
|
125
|
-
const n = t.compareText ??
|
|
124
|
+
function Go(e, t) {
|
|
125
|
+
const n = t.compareText ?? xn.compareText, o = (r, s, i) => {
|
|
126
126
|
const l = /* @__PURE__ */ new Map(), c = t.levels[s];
|
|
127
127
|
if (!c) return [];
|
|
128
128
|
const a = /* @__PURE__ */ new Map();
|
|
129
129
|
for (const g of r) {
|
|
130
|
-
const v = c.value(g),
|
|
131
|
-
let y = a.get(
|
|
130
|
+
const v = c.value(g), x = Ce(v);
|
|
131
|
+
let y = a.get(x);
|
|
132
132
|
y || (y = {
|
|
133
|
-
path: JSON.stringify([...i,
|
|
133
|
+
path: JSON.stringify([...i, x]),
|
|
134
134
|
value: se(v) ? void 0 : v,
|
|
135
135
|
level: s,
|
|
136
136
|
rows: [],
|
|
137
137
|
groups: [],
|
|
138
138
|
aggregates: {}
|
|
139
|
-
}, a.set(
|
|
139
|
+
}, a.set(x, y), l.set(y, [...i, x])), y.rows.push(g);
|
|
140
140
|
}
|
|
141
141
|
for (const g of a.values())
|
|
142
|
-
for (const v of t.aggregates ?? []) g.aggregates[v.id] =
|
|
143
|
-
const
|
|
142
|
+
for (const v of t.aggregates ?? []) g.aggregates[v.id] = $t(v, g.rows);
|
|
143
|
+
const d = t.sort?.find(
|
|
144
144
|
(g) => g.column === c.id || t.aggregates?.some((v) => v.id === g.column)
|
|
145
|
-
),
|
|
145
|
+
), u = d?.direction === "desc" ? -1 : 1, b = d !== void 0 && d.column !== c.id ? d.column : void 0, p = (g) => {
|
|
146
146
|
let v;
|
|
147
|
-
for (const
|
|
148
|
-
const y = c.order(
|
|
149
|
-
|
|
147
|
+
for (const x of g.rows) {
|
|
148
|
+
const y = c.order(x);
|
|
149
|
+
je(y) !== void 0 && (v === void 0 || pt(y, v, n) < 0) && (v = y);
|
|
150
150
|
}
|
|
151
151
|
return v;
|
|
152
152
|
}, m = (g) => {
|
|
@@ -155,8 +155,8 @@ function jo(e, t) {
|
|
|
155
155
|
return Array.isArray(v) ? v[0] : v;
|
|
156
156
|
}, w = [...a.values()].sort((g, v) => {
|
|
157
157
|
if (g.value === void 0 || v.value === void 0) return pt(g.value, v.value, n);
|
|
158
|
-
const
|
|
159
|
-
return
|
|
158
|
+
const x = m(g), y = m(v), _ = pt(x, y, n);
|
|
159
|
+
return je(x) === void 0 || je(y) === void 0 ? _ : _ * u;
|
|
160
160
|
});
|
|
161
161
|
for (const g of w)
|
|
162
162
|
g.groups = o(g.rows, s + 1, l.get(g));
|
|
@@ -164,19 +164,19 @@ function jo(e, t) {
|
|
|
164
164
|
};
|
|
165
165
|
return o(e, 0, []);
|
|
166
166
|
}
|
|
167
|
-
function
|
|
167
|
+
function jo(e, t) {
|
|
168
168
|
const n = /* @__PURE__ */ new Set(), o = (r) => {
|
|
169
169
|
for (const s of r)
|
|
170
170
|
n.add(s.path), o(s.groups);
|
|
171
171
|
};
|
|
172
172
|
return o(e), t.filter((r) => n.has(r));
|
|
173
173
|
}
|
|
174
|
-
const
|
|
174
|
+
const Ho = (e) => (t) => {
|
|
175
175
|
if (!(t instanceof Date) || Number.isNaN(t.getTime())) return;
|
|
176
176
|
const n = t.getFullYear(), o = t.getMonth(), r = t.getDate();
|
|
177
177
|
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);
|
|
178
178
|
};
|
|
179
|
-
function
|
|
179
|
+
function Wo(e) {
|
|
180
180
|
const t = new Date(e.getFullYear(), e.getMonth(), e.getDate() + 3 - (e.getDay() + 6) % 7), n = new Date(t.getFullYear(), 0, 4);
|
|
181
181
|
return { week: 1 + Math.round((t.getTime() - n.getTime()) / 864e5 / 7 - ((n.getDay() + 6) % 7 - 3) / 7), year: t.getFullYear() };
|
|
182
182
|
}
|
|
@@ -184,7 +184,7 @@ function Yo(e, t, n, o) {
|
|
|
184
184
|
if (e === "year") return String(t.getFullYear());
|
|
185
185
|
if (e === "month") return n.month(t);
|
|
186
186
|
if (e === "week") {
|
|
187
|
-
const { week: r, year: s } =
|
|
187
|
+
const { week: r, year: s } = Wo(t);
|
|
188
188
|
return o.calendarWeek(r, s);
|
|
189
189
|
}
|
|
190
190
|
return n.date(t);
|
|
@@ -207,10 +207,10 @@ function Uo(e, t, n) {
|
|
|
207
207
|
for (let l = 0; l += Math.max(1, n - (e[l]?.parents.length ?? 0)), !(l >= e.length); )
|
|
208
208
|
o.push(l);
|
|
209
209
|
const r = o.length, s = Math.min(Math.max(1, t), r), i = n > 0 ? e.slice(o[s - 1], o[s] ?? e.length) : [...e];
|
|
210
|
-
return { lines:
|
|
210
|
+
return { lines: Fn(i), page: s, pageCount: r };
|
|
211
211
|
}
|
|
212
|
-
const
|
|
213
|
-
function
|
|
212
|
+
const qn = (e) => e.flatMap((t) => t.kind === "row" ? [t.row] : []);
|
|
213
|
+
function Fn(e) {
|
|
214
214
|
const t = e[0];
|
|
215
215
|
if (!t) return [...e];
|
|
216
216
|
const n = t.parents.map((r, s) => ({
|
|
@@ -221,56 +221,56 @@ function Bn(e) {
|
|
|
221
221
|
})), o = t.kind === "row" && t.span && !t.first ? { ...t, first: !0, continued: !0 } : t;
|
|
222
222
|
return [...n, o, ...e.slice(1)];
|
|
223
223
|
}
|
|
224
|
-
function
|
|
224
|
+
function Bn(e, t) {
|
|
225
225
|
return t?.length ? [
|
|
226
226
|
...t.map((n) => e.find((o) => o.id === n)).filter((n) => n !== void 0),
|
|
227
227
|
...e.filter((n) => !t.includes(n.id))
|
|
228
228
|
] : e;
|
|
229
229
|
}
|
|
230
|
-
const
|
|
231
|
-
function
|
|
230
|
+
const Fe = (e) => e == null || typeof e == "number" && Number.isNaN(e), Jo = (e, t) => typeof e == "number" && typeof t == "number" ? e - t : xn.compareText(String(e), String(t));
|
|
231
|
+
function Dn(e, t, n) {
|
|
232
232
|
const o = (t ?? "").trim().toLowerCase(), r = e.filter((i) => i.searchable && i.value), s = (i) => !o || r.some((l) => {
|
|
233
233
|
const c = l.value(i);
|
|
234
|
-
return !
|
|
234
|
+
return !Fe(c) && String(c).toLowerCase().includes(o);
|
|
235
235
|
});
|
|
236
236
|
return { term: o, matches: (i) => s(i) && (n ? n(i) : !0) };
|
|
237
237
|
}
|
|
238
|
-
function
|
|
238
|
+
function Pn(e, t) {
|
|
239
239
|
const n = Array.isArray(t) ? t : t ? [t] : [], o = [], r = n.map((i) => {
|
|
240
240
|
const l = e.find((b) => b.id === i.column);
|
|
241
241
|
if (!l || !l.compare && !l.value) return null;
|
|
242
|
-
const c = i.direction === "asc" ? 1 : -1, a = l.compare,
|
|
243
|
-
return o.push(
|
|
244
|
-
const m = b.keys[
|
|
245
|
-
return
|
|
242
|
+
const c = i.direction === "asc" ? 1 : -1, a = l.compare, d = l.value, u = o.length;
|
|
243
|
+
return o.push(d), d ? (b, p) => {
|
|
244
|
+
const m = b.keys[u], w = p.keys[u];
|
|
245
|
+
return Fe(m) || Fe(w) ? Fe(m) === Fe(w) ? 0 : Fe(m) ? 1 : -1 : (a ? a(b.row, p.row) : Jo(m, w)) * c;
|
|
246
246
|
} : (b, p) => a(b.row, p.row) * c;
|
|
247
247
|
}).filter((i) => i !== null);
|
|
248
248
|
return { levels: n, sorted: (i) => (
|
|
249
249
|
// Array#sort is stable (ES2019), equal values keep their order.
|
|
250
250
|
r.length === 0 ? [...i] : i.map((l) => ({ row: l, keys: o.map((c) => c?.(l)) })).sort((l, c) => {
|
|
251
251
|
for (const a of r) {
|
|
252
|
-
const
|
|
253
|
-
if (
|
|
252
|
+
const d = a(l, c);
|
|
253
|
+
if (d !== 0) return d;
|
|
254
254
|
}
|
|
255
255
|
return 0;
|
|
256
256
|
}).map((l) => l.row)
|
|
257
257
|
) };
|
|
258
258
|
}
|
|
259
|
-
function
|
|
260
|
-
const { matches: o } =
|
|
259
|
+
function Vn(e, t, n) {
|
|
260
|
+
const { matches: o } = Dn(t, n.search, n.filter), { levels: r, sorted: s } = Pn(t, n.sort);
|
|
261
261
|
return { filtered: s(e.filter(o)), levels: r };
|
|
262
262
|
}
|
|
263
|
-
function
|
|
264
|
-
return
|
|
263
|
+
function In(e, t, n) {
|
|
264
|
+
return Go(e, { levels: n.levels, aggregates: n.aggregates, compareText: n.compareText, sort: t });
|
|
265
265
|
}
|
|
266
|
-
function
|
|
267
|
-
const { page: r = 1, pageSize: s, hidden: i, order: l } = t, c =
|
|
266
|
+
function St(e, t, n, o) {
|
|
267
|
+
const { page: r = 1, pageSize: s, hidden: i, order: l } = t, c = Ct(e, i, l);
|
|
268
268
|
if (o) {
|
|
269
269
|
const b = Uo(o.lines, r, s ?? 0);
|
|
270
270
|
return {
|
|
271
271
|
columns: c,
|
|
272
272
|
filtered: n,
|
|
273
|
-
visible:
|
|
273
|
+
visible: qn(b.lines),
|
|
274
274
|
groups: o.groups,
|
|
275
275
|
lines: o.lines,
|
|
276
276
|
visibleLines: b.lines,
|
|
@@ -279,70 +279,70 @@ function kt(e, t, n, o) {
|
|
|
279
279
|
columnCount: c.length
|
|
280
280
|
};
|
|
281
281
|
}
|
|
282
|
-
const a = s && s > 0 ? s : n.length || 1,
|
|
282
|
+
const a = s && s > 0 ? s : n.length || 1, d = Math.max(1, Math.ceil(n.length / a)), u = Math.min(Math.max(1, r), d);
|
|
283
283
|
return {
|
|
284
284
|
columns: c,
|
|
285
285
|
filtered: n,
|
|
286
|
-
visible: n.slice((
|
|
287
|
-
page:
|
|
288
|
-
pageCount:
|
|
286
|
+
visible: n.slice((u - 1) * a, u * a),
|
|
287
|
+
page: u,
|
|
288
|
+
pageCount: d,
|
|
289
289
|
columnCount: c.length
|
|
290
290
|
};
|
|
291
291
|
}
|
|
292
|
-
const
|
|
293
|
-
const o =
|
|
292
|
+
const Ct = (e, t, n) => {
|
|
293
|
+
const o = Bn(e, n);
|
|
294
294
|
return t?.length ? o.filter((r) => r.hideable === !1 || !t.includes(r.id)) : o;
|
|
295
295
|
};
|
|
296
|
-
function
|
|
296
|
+
function $n(e, t, n) {
|
|
297
297
|
const { page: o = 1, pageSize: r, hidden: s, order: i } = n;
|
|
298
298
|
if (n.server) {
|
|
299
|
-
const
|
|
299
|
+
const d = Ct(t, s, i), { rowCount: u } = n.server, b = r && r > 0 ? r : Math.max(u, 1), p = Math.max(1, Math.ceil(u / b)), m = u > 0 ? Math.min(Math.max(1, o), p) : Math.max(1, o);
|
|
300
300
|
return {
|
|
301
|
-
columns:
|
|
301
|
+
columns: d,
|
|
302
302
|
filtered: [...e],
|
|
303
303
|
visible: [...e],
|
|
304
304
|
page: m,
|
|
305
305
|
pageCount: p,
|
|
306
|
-
columnCount:
|
|
306
|
+
columnCount: d.length
|
|
307
307
|
};
|
|
308
308
|
}
|
|
309
309
|
if (n.tree) {
|
|
310
|
-
const { term:
|
|
311
|
-
return Xo(e, n.tree, b,
|
|
310
|
+
const { term: d, matches: u } = Dn(t, n.search, n.filter), { sorted: b } = Pn(t, n.sort);
|
|
311
|
+
return Xo(e, n.tree, b, d || n.filter ? u : void 0, Ct(t, s, i));
|
|
312
312
|
}
|
|
313
|
-
const { filtered: l, levels: c } =
|
|
314
|
-
if (!n.grouping?.levels.length) return
|
|
315
|
-
const a =
|
|
316
|
-
return
|
|
313
|
+
const { filtered: l, levels: c } = Vn(e, t, n);
|
|
314
|
+
if (!n.grouping?.levels.length) return St(t, n, l);
|
|
315
|
+
const a = In(l, c, n.grouping);
|
|
316
|
+
return St(t, n, l, { groups: a, lines: Ln(a, n.grouping.folded) });
|
|
317
317
|
}
|
|
318
318
|
function Xo(e, t, n, o, r) {
|
|
319
319
|
const { admit: s } = t, i = (v) => n(s ? v.filter(s) : v), l = /* @__PURE__ */ new Map(), c = {
|
|
320
320
|
key: t.key,
|
|
321
321
|
children: (v) => {
|
|
322
322
|
if (!l.has(v)) {
|
|
323
|
-
const
|
|
324
|
-
l.set(v,
|
|
323
|
+
const x = t.children(v);
|
|
324
|
+
l.set(v, x && i(x));
|
|
325
325
|
}
|
|
326
326
|
return l.get(v);
|
|
327
327
|
},
|
|
328
328
|
label: () => "",
|
|
329
329
|
matches: o
|
|
330
|
-
}, a = i(e),
|
|
330
|
+
}, a = i(e), d = { expanded: t.open, checked: /* @__PURE__ */ new Set(), active: null, anchor: null, search: "" }, u = rn(a, c, d), b = /* @__PURE__ */ new Set();
|
|
331
331
|
let p = 0;
|
|
332
332
|
const m = (v) => {
|
|
333
|
-
for (const
|
|
333
|
+
for (const x of v) {
|
|
334
334
|
p++;
|
|
335
|
-
const y = c.children(
|
|
336
|
-
y && (b.add(t.key(
|
|
335
|
+
const y = c.children(x);
|
|
336
|
+
y && (b.add(t.key(x)), m(y));
|
|
337
337
|
}
|
|
338
338
|
};
|
|
339
339
|
m(a);
|
|
340
|
-
const w = rn(a, c, { ...
|
|
340
|
+
const w = rn(a, c, { ...d, expanded: b }), g = u.map((v) => v.node);
|
|
341
341
|
return {
|
|
342
342
|
columns: r,
|
|
343
343
|
filtered: w.filter((v) => v.matches).map((v) => v.node),
|
|
344
344
|
visible: g,
|
|
345
|
-
entries:
|
|
345
|
+
entries: u,
|
|
346
346
|
shown: g,
|
|
347
347
|
roots: w.filter((v) => v.level === 0).map((v) => v.node),
|
|
348
348
|
exported: w.filter((v) => v.matches || v.pathOnly),
|
|
@@ -352,135 +352,135 @@ function Xo(e, t, n, o, r) {
|
|
|
352
352
|
columnCount: r.length
|
|
353
353
|
};
|
|
354
354
|
}
|
|
355
|
-
function
|
|
355
|
+
function xt(e) {
|
|
356
356
|
const t = {};
|
|
357
357
|
for (const n of e) n.width !== void 0 && (t[n.id] = n.width);
|
|
358
358
|
return t;
|
|
359
359
|
}
|
|
360
|
-
function
|
|
360
|
+
function zn(e, t, n) {
|
|
361
361
|
if (!e.lines) return { ...e, visible: (e.shown ?? e.filtered).slice(t, n) };
|
|
362
362
|
const o = e.lines.slice(t, n);
|
|
363
|
-
return { ...e, visibleLines: o, visible:
|
|
363
|
+
return { ...e, visibleLines: o, visible: qn(o) };
|
|
364
364
|
}
|
|
365
365
|
function Qo(e, t, n) {
|
|
366
|
-
const { rowKey: o, filter: r, defaultSort: s = null, initialView: i, virtual: l, grouping: c, server: a, tree:
|
|
366
|
+
const { rowKey: o, filter: r, defaultSort: s = null, initialView: i, virtual: l, grouping: c, server: a, tree: d } = n, u = (P) => P?.sort?.length ? [...P.sort] : s ? Array.isArray(s) ? [...s] : [s] : [], b = (P) => P?.widths ? { ...P.widths } : xt(t), [p, m] = V(i?.search ?? ""), [w, g] = V(() => u(i)), [v, x] = V(i?.page ?? 1), [y, _] = V(
|
|
367
367
|
i?.pageSize ?? n.pageSize ?? 10
|
|
368
|
-
), [
|
|
369
|
-
m(
|
|
370
|
-
},
|
|
371
|
-
() =>
|
|
372
|
-
[
|
|
373
|
-
),
|
|
374
|
-
() =>
|
|
368
|
+
), [S, C] = V([]), [A, L] = V(i?.hidden ?? []), [k, O] = V(i?.order ?? []), [M, R] = V(() => b(i)), E = (P) => {
|
|
369
|
+
m(P.search ?? ""), g(u(P)), x(P.page ?? 1), _(P.pageSize ?? n.pageSize ?? 10), L(P.hidden ?? []), O(P.order ?? []), R(b(P));
|
|
370
|
+
}, B = l || d ? 0 : y, I = !a && !d, D = j(
|
|
371
|
+
() => I ? Vn(e, t, { search: p, filter: r, sort: w }) : null,
|
|
372
|
+
[I, e, t, p, r, w]
|
|
373
|
+
), z = c?.levels.length ? c : void 0, Y = j(
|
|
374
|
+
() => D && z ? In(D.filtered, D.levels, z) : void 0,
|
|
375
375
|
// The fold is not an input of the grouping: it only chooses lines.
|
|
376
376
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
377
|
-
[
|
|
378
|
-
), ce =
|
|
379
|
-
() => Y &&
|
|
377
|
+
[D, z?.levels, z?.aggregates, z?.compareText]
|
|
378
|
+
), ce = j(
|
|
379
|
+
() => Y && z ? Ln(Y, z.folded) : void 0,
|
|
380
380
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
381
|
-
[Y,
|
|
382
|
-
),
|
|
383
|
-
() =>
|
|
384
|
-
[
|
|
385
|
-
), [ne,
|
|
381
|
+
[Y, z?.folded]
|
|
382
|
+
), G = j(
|
|
383
|
+
() => D ? St(t, { page: v, pageSize: B, hidden: A, order: k }, D.filtered, Y && ce ? { groups: Y, lines: ce } : void 0) : $n(e, t, { search: p, filter: r, sort: w, page: v, pageSize: B, hidden: A, order: k, grouping: c, server: a, tree: d }),
|
|
384
|
+
[D, Y, ce, t, v, B, A, k, e, p, r, w, c, a, d]
|
|
385
|
+
), [ne, ue] = V(36), le = Oo(l ? (G.lines ?? G.shown ?? G.filtered).length : 0, {
|
|
386
386
|
rowHeight: l ? ne : 0,
|
|
387
387
|
overscan: typeof l == "object" ? l.overscan : void 0
|
|
388
|
-
}), ee =
|
|
389
|
-
() => l ?
|
|
390
|
-
[l,
|
|
391
|
-
), oe = ee.visibleLines,
|
|
392
|
-
m(
|
|
393
|
-
}, []), Ae = fe((
|
|
394
|
-
_(
|
|
395
|
-
}, []),
|
|
388
|
+
}), ee = j(
|
|
389
|
+
() => l ? zn(G, le.from, le.to) : G,
|
|
390
|
+
[l, G, le.from, le.to]
|
|
391
|
+
), oe = ee.visibleLines, H = ee.visible, ge = j(() => G.filtered.map(o), [G.filtered, o]), q = Ko(ge), ae = fe((P) => {
|
|
392
|
+
m(P), x(1);
|
|
393
|
+
}, []), Ae = fe((P) => {
|
|
394
|
+
_(P), x(1);
|
|
395
|
+
}, []), de = fe((P, J = !1) => {
|
|
396
396
|
g((te) => {
|
|
397
|
-
const me = te.find((we) => we.column ===
|
|
397
|
+
const me = te.find((we) => we.column === P);
|
|
398
398
|
if (!J) {
|
|
399
399
|
const we = te.length === 1 && me?.direction === "asc" ? "desc" : "asc";
|
|
400
|
-
return [{ column:
|
|
400
|
+
return [{ column: P, direction: we }];
|
|
401
401
|
}
|
|
402
402
|
return me ? me.direction === "asc" ? te.map(
|
|
403
|
-
(we) => we.column ===
|
|
404
|
-
) : te.filter((we) => we.column !==
|
|
405
|
-
}),
|
|
406
|
-
}, []), Ne = fe((
|
|
407
|
-
|
|
408
|
-
(J) => J.includes(
|
|
403
|
+
(we) => we.column === P ? { column: P, direction: "desc" } : we
|
|
404
|
+
) : te.filter((we) => we.column !== P) : [...te, { column: P, direction: "asc" }];
|
|
405
|
+
}), x(1);
|
|
406
|
+
}, []), Ne = fe((P) => {
|
|
407
|
+
C(
|
|
408
|
+
(J) => J.includes(P) ? J.filter((te) => te !== P) : [...J, P]
|
|
409
409
|
);
|
|
410
|
-
}, []), Me = fe((
|
|
410
|
+
}, []), Me = fe((P) => {
|
|
411
411
|
L(
|
|
412
|
-
(J) => J.includes(
|
|
412
|
+
(J) => J.includes(P) ? J.filter((te) => te !== P) : [...J, P]
|
|
413
413
|
);
|
|
414
|
-
}, []), pe = fe((
|
|
414
|
+
}, []), pe = fe((P, J) => {
|
|
415
415
|
R((te) => {
|
|
416
416
|
if (J === void 0) {
|
|
417
|
-
if (!(
|
|
417
|
+
if (!(P in te)) return te;
|
|
418
418
|
const me = { ...te };
|
|
419
|
-
return delete me[
|
|
419
|
+
return delete me[P], me;
|
|
420
420
|
}
|
|
421
|
-
return { ...te, [
|
|
421
|
+
return { ...te, [P]: J };
|
|
422
422
|
});
|
|
423
|
-
}, []), U = n.pageSize ?? 10,
|
|
424
|
-
const
|
|
423
|
+
}, []), U = n.pageSize ?? 10, Se = j(() => xt(t), [t]), Le = j(() => {
|
|
424
|
+
const P = {};
|
|
425
425
|
for (const [J, te] of Object.entries(M))
|
|
426
|
-
|
|
427
|
-
return
|
|
428
|
-
}, [M,
|
|
426
|
+
Se[J] !== te && (P[J] = te);
|
|
427
|
+
return P;
|
|
428
|
+
}, [M, Se]), Ve = j(
|
|
429
429
|
() => s ? Array.isArray(s) ? s : [s] : [],
|
|
430
430
|
[s]
|
|
431
|
-
),
|
|
432
|
-
(
|
|
433
|
-
), Je =
|
|
431
|
+
), qe = w.length === Ve.length && w.every(
|
|
432
|
+
(P, J) => P.column === Ve[J]?.column && P.direction === Ve[J]?.direction
|
|
433
|
+
), Je = j(
|
|
434
434
|
() => ({
|
|
435
435
|
...p ? { search: p } : {},
|
|
436
|
-
...w.length && !
|
|
436
|
+
...w.length && !qe ? { sort: w } : {},
|
|
437
437
|
/* Without paging there is no page a view could carry - a page three in
|
|
438
438
|
the view of a virtualised table would be a promise nobody redeems on
|
|
439
439
|
opening. */
|
|
440
|
-
...!l &&
|
|
440
|
+
...!l && G.page > 1 ? { page: G.page } : {},
|
|
441
441
|
...!l && y !== U ? { pageSize: y } : {},
|
|
442
442
|
...A.length ? { hidden: A } : {},
|
|
443
|
-
...
|
|
443
|
+
...k.length ? { order: k } : {},
|
|
444
444
|
...Object.keys(Le).length ? { widths: Le } : {}
|
|
445
445
|
}),
|
|
446
446
|
[
|
|
447
447
|
l,
|
|
448
448
|
p,
|
|
449
449
|
w,
|
|
450
|
-
|
|
451
|
-
|
|
450
|
+
qe,
|
|
451
|
+
G.page,
|
|
452
452
|
y,
|
|
453
453
|
U,
|
|
454
454
|
A,
|
|
455
|
-
|
|
455
|
+
k,
|
|
456
456
|
Le
|
|
457
457
|
]
|
|
458
458
|
);
|
|
459
459
|
return {
|
|
460
|
-
...
|
|
461
|
-
visible:
|
|
460
|
+
...G,
|
|
461
|
+
visible: H,
|
|
462
462
|
visibleLines: oe,
|
|
463
463
|
virtual: l ? le : void 0,
|
|
464
|
-
setPitch:
|
|
464
|
+
setPitch: ue,
|
|
465
465
|
server: a,
|
|
466
466
|
restart: E,
|
|
467
467
|
view: Je,
|
|
468
468
|
search: p,
|
|
469
469
|
setSearch: ae,
|
|
470
470
|
sort: w,
|
|
471
|
-
toggleSort:
|
|
472
|
-
setPage:
|
|
471
|
+
toggleSort: de,
|
|
472
|
+
setPage: x,
|
|
473
473
|
pageSize: y,
|
|
474
474
|
setPageSize: Ae,
|
|
475
|
-
expanded:
|
|
475
|
+
expanded: S,
|
|
476
476
|
toggleRow: Ne,
|
|
477
477
|
hidden: A,
|
|
478
478
|
toggleColumn: Me,
|
|
479
|
-
order:
|
|
479
|
+
order: k,
|
|
480
480
|
setOrder: O,
|
|
481
481
|
widths: M,
|
|
482
482
|
setWidth: pe,
|
|
483
|
-
selection:
|
|
483
|
+
selection: q
|
|
484
484
|
};
|
|
485
485
|
}
|
|
486
486
|
function Zo(e, t) {
|
|
@@ -532,19 +532,19 @@ function cr(e, t) {
|
|
|
532
532
|
...s && Object.keys(s).length ? { widths: s } : {}
|
|
533
533
|
};
|
|
534
534
|
}
|
|
535
|
-
function
|
|
535
|
+
function ur() {
|
|
536
536
|
try {
|
|
537
537
|
return process.env.NODE_ENV !== "production";
|
|
538
538
|
} catch {
|
|
539
539
|
return !1;
|
|
540
540
|
}
|
|
541
541
|
}
|
|
542
|
-
const
|
|
542
|
+
const Kt = ur(), ln = /* @__PURE__ */ new Set();
|
|
543
543
|
function X(e, t) {
|
|
544
|
-
!
|
|
544
|
+
!Kt || ln.has(e) || (ln.add(e), console.warn(`@umriss-ui/table: ${t}`));
|
|
545
545
|
}
|
|
546
|
-
const
|
|
547
|
-
frame:
|
|
546
|
+
const dr = "_frame_luucq_11 _text_18806_22", fr = "_children_luucq_24", hr = "_scroll_luucq_33 _scroll_18806_96", gr = "_footerTarget_luucq_62", pr = "_table_luucq_79", mr = "_th_luucq_91 _ring_18806_125", wr = "_sticky_luucq_111", br = "_td_luucq_131", vr = "_rowHeader_luucq_145", yr = "_compact_luucq_166 _dense_18806_38", _r = "_numeric_luucq_197", kr = "_value_luucq_217", Sr = "_valueText_luucq_227", Cr = "_sized_luucq_231", xr = "_cutTip_luucq_248 _text_18806_22", Ar = "_absent_luucq_290", Nr = "_striped_luucq_294", Tr = "_pinned_luucq_319", Rr = "_pinStartEdge_luucq_335", Or = "_pinEndEdge_luucq_336", Er = "_sortButton_luucq_366 _ring_18806_125", Mr = "_sortIndicator_luucq_391", Lr = "_sortArrow_luucq_398", qr = "_sortArrowDesc_luucq_402", Fr = "_sortActive_luucq_410", Br = "_sortRank_luucq_416", Dr = "_thFlex_luucq_424", Pr = "_headLine_luucq_444", Vr = "_headLabel_luucq_467", Ir = "_footerKind_luucq_483", $r = "_emptyCell_luucq_501", zr = "_emptyTitle_luucq_523", Kr = "_skeleton_luucq_532", Gr = "_toolbar_luucq_564 _text_18806_22", jr = "_toolbarGroup_luucq_580", Hr = "_toolbarGroupIdle_luucq_596", Wr = "_searchGrow_luucq_603", Yr = "_toolbarMd_luucq_613", Ur = "_toolbarInfo_luucq_617", Jr = "_pagination_luucq_623 _text_18806_22", Xr = "_paginationControls_luucq_636", Qr = "_pageSize_luucq_643", Zr = "_pageSteps_luucq_651", es = "_paginationStatus_luucq_657", ts = "_filterButton_luucq_666 _ring_18806_125", ns = "_filterActive_luucq_693", os = "_filterPanel_luucq_698", rs = "_filterContent_luucq_712 _scroll_18806_96", ss = "_filterFooter_luucq_723", is = "_filterLabel_luucq_737", ls = "_filterValue_luucq_747", as = "_filteredCount_luucq_753", cs = "_rangeFields_luucq_764", us = "_rangePeriod_luucq_774", ds = "_conditions_luucq_780", fs = "_conditionButton_luucq_786", hs = "_condition_luucq_780", gs = "_columnsPanel_luucq_811", ps = "_columnsList_luucq_820", ms = "_columnsEntry_luucq_829", ws = "_move_luucq_841", bs = "_pinOn_luucq_879", vs = "_groupingChoice_luucq_889", ys = "_groupingHeading_luucq_897", _s = "_groupingOptions_luucq_906", ks = "_groupingOption_luucq_906 _ring_18806_125", Ss = "_groupingLevel_luucq_949", Cs = "_groupingTag_luucq_954", xs = "_groupingTrigger_luucq_961", As = "_groupingPrefix_luucq_967", Ns = "_groupingPath_luucq_972", Ts = "_groupingSeparator_luucq_976", Rs = "_groupHeader_luucq_993", Os = "_spanCell_luucq_1036", Es = "_groupFolded_luucq_1117", Ms = "_spanValue_luucq_1121", Ls = "_groupLabel_luucq_1122", qs = "_spanText_luucq_1135", Fs = "_groupValue_luucq_1136", Bs = "_groupCount_luucq_1143", Ds = "_continued_luucq_1157", Ps = "_spanSelect_luucq_1188", Vs = "_treeCell_luucq_1204", Is = "_treeText_luucq_1212", $s = "_foldSlot_luucq_1216", zs = "_treeRow_luucq_1226", Ks = "_branchRow_luucq_1230", Gs = "_detailCell_luucq_1242", js = "_pathRow_luucq_1248", Hs = "_fold_luucq_1216", Ws = "_foldClosed_luucq_1289", Ys = "_foldedCount_luucq_1299", Us = "_shareHost_luucq_1307", Js = "_shareBar_luucq_1314", Xs = "_expander_luucq_1326", Qs = "_expanderOpen_luucq_1361", Zs = "_detailRow_luucq_1365", ei = "_treeDetail_luucq_1374", ti = "_treeDetailRail_luucq_1379", ni = "_actionsCell_luucq_1394", oi = "_actions_luucq_1394", ri = "_decision_luucq_1413", si = "_reserve_luucq_1432", ii = "_grip_luucq_1442", li = "_virtualBody_luucq_1483", ai = "_virtualRow_luucq_1499", ci = "_fillerRow_luucq_1523", ui = "_grid_luucq_1536", di = "_editing_luucq_1552", fi = "_editingValue_luucq_1556", hi = "_editor_luucq_1562", gi = "_editorField_luucq_1575", pi = "_draftButtons_luucq_1607", mi = "_held_luucq_1615", wi = "_deleteAsk_luucq_1619", bi = "_newRowBar_luucq_1626", vi = "_draftMessage_luucq_1633", yi = "_editorMessage_luucq_1658", _i = "_control_luucq_307", ki = "_empty_luucq_501", Si = "_toned_luucq_1419", h = {
|
|
547
|
+
frame: dr,
|
|
548
548
|
children: fr,
|
|
549
549
|
scroll: hr,
|
|
550
550
|
footerTarget: gr,
|
|
@@ -555,10 +555,10 @@ const ur = "_frame_1lxch_11 _text_18806_22", fr = "_children_1lxch_24", hr = "_s
|
|
|
555
555
|
rowHeader: vr,
|
|
556
556
|
compact: yr,
|
|
557
557
|
numeric: _r,
|
|
558
|
-
value:
|
|
559
|
-
valueText:
|
|
560
|
-
sized:
|
|
561
|
-
cutTip:
|
|
558
|
+
value: kr,
|
|
559
|
+
valueText: Sr,
|
|
560
|
+
sized: Cr,
|
|
561
|
+
cutTip: xr,
|
|
562
562
|
absent: Ar,
|
|
563
563
|
striped: Nr,
|
|
564
564
|
pinned: Tr,
|
|
@@ -567,20 +567,20 @@ const ur = "_frame_1lxch_11 _text_18806_22", fr = "_children_1lxch_24", hr = "_s
|
|
|
567
567
|
sortButton: Er,
|
|
568
568
|
sortIndicator: Mr,
|
|
569
569
|
sortArrow: Lr,
|
|
570
|
-
sortArrowDesc:
|
|
571
|
-
sortActive:
|
|
572
|
-
sortRank:
|
|
573
|
-
thFlex:
|
|
574
|
-
headLine:
|
|
575
|
-
headLabel:
|
|
576
|
-
footerKind:
|
|
577
|
-
emptyCell:
|
|
578
|
-
emptyTitle:
|
|
579
|
-
skeleton:
|
|
580
|
-
toolbar:
|
|
581
|
-
toolbarGroup:
|
|
582
|
-
toolbarGroupIdle:
|
|
583
|
-
searchGrow:
|
|
570
|
+
sortArrowDesc: qr,
|
|
571
|
+
sortActive: Fr,
|
|
572
|
+
sortRank: Br,
|
|
573
|
+
thFlex: Dr,
|
|
574
|
+
headLine: Pr,
|
|
575
|
+
headLabel: Vr,
|
|
576
|
+
footerKind: Ir,
|
|
577
|
+
emptyCell: $r,
|
|
578
|
+
emptyTitle: zr,
|
|
579
|
+
skeleton: Kr,
|
|
580
|
+
toolbar: Gr,
|
|
581
|
+
toolbarGroup: jr,
|
|
582
|
+
toolbarGroupIdle: Hr,
|
|
583
|
+
searchGrow: Wr,
|
|
584
584
|
toolbarMd: Yr,
|
|
585
585
|
toolbarInfo: Ur,
|
|
586
586
|
pagination: Jr,
|
|
@@ -597,8 +597,8 @@ const ur = "_frame_1lxch_11 _text_18806_22", fr = "_children_1lxch_24", hr = "_s
|
|
|
597
597
|
filterValue: ls,
|
|
598
598
|
filteredCount: as,
|
|
599
599
|
rangeFields: cs,
|
|
600
|
-
rangePeriod:
|
|
601
|
-
conditions:
|
|
600
|
+
rangePeriod: us,
|
|
601
|
+
conditions: ds,
|
|
602
602
|
conditionButton: fs,
|
|
603
603
|
condition: hs,
|
|
604
604
|
columnsPanel: gs,
|
|
@@ -609,10 +609,10 @@ const ur = "_frame_1lxch_11 _text_18806_22", fr = "_children_1lxch_24", hr = "_s
|
|
|
609
609
|
groupingChoice: vs,
|
|
610
610
|
groupingHeading: ys,
|
|
611
611
|
groupingOptions: _s,
|
|
612
|
-
groupingOption:
|
|
613
|
-
groupingLevel:
|
|
614
|
-
groupingTag:
|
|
615
|
-
groupingTrigger:
|
|
612
|
+
groupingOption: ks,
|
|
613
|
+
groupingLevel: Ss,
|
|
614
|
+
groupingTag: Cs,
|
|
615
|
+
groupingTrigger: xs,
|
|
616
616
|
groupingPrefix: As,
|
|
617
617
|
groupingPath: Ns,
|
|
618
618
|
groupingSeparator: Ts,
|
|
@@ -621,20 +621,20 @@ const ur = "_frame_1lxch_11 _text_18806_22", fr = "_children_1lxch_24", hr = "_s
|
|
|
621
621
|
groupFolded: Es,
|
|
622
622
|
spanValue: Ms,
|
|
623
623
|
groupLabel: Ls,
|
|
624
|
-
spanText:
|
|
625
|
-
groupValue:
|
|
626
|
-
groupCount:
|
|
627
|
-
continued:
|
|
628
|
-
spanSelect:
|
|
629
|
-
treeCell:
|
|
630
|
-
treeText:
|
|
631
|
-
foldSlot:
|
|
632
|
-
treeRow:
|
|
633
|
-
branchRow:
|
|
634
|
-
detailCell:
|
|
635
|
-
pathRow:
|
|
636
|
-
fold:
|
|
637
|
-
foldClosed:
|
|
624
|
+
spanText: qs,
|
|
625
|
+
groupValue: Fs,
|
|
626
|
+
groupCount: Bs,
|
|
627
|
+
continued: Ds,
|
|
628
|
+
spanSelect: Ps,
|
|
629
|
+
treeCell: Vs,
|
|
630
|
+
treeText: Is,
|
|
631
|
+
foldSlot: $s,
|
|
632
|
+
treeRow: zs,
|
|
633
|
+
branchRow: Ks,
|
|
634
|
+
detailCell: Gs,
|
|
635
|
+
pathRow: js,
|
|
636
|
+
fold: Hs,
|
|
637
|
+
foldClosed: Ws,
|
|
638
638
|
foldedCount: Ys,
|
|
639
639
|
shareHost: Us,
|
|
640
640
|
shareBar: Js,
|
|
@@ -651,8 +651,8 @@ const ur = "_frame_1lxch_11 _text_18806_22", fr = "_children_1lxch_24", hr = "_s
|
|
|
651
651
|
virtualBody: li,
|
|
652
652
|
virtualRow: ai,
|
|
653
653
|
fillerRow: ci,
|
|
654
|
-
grid:
|
|
655
|
-
editing:
|
|
654
|
+
grid: ui,
|
|
655
|
+
editing: di,
|
|
656
656
|
editingValue: fi,
|
|
657
657
|
editor: hi,
|
|
658
658
|
editorField: gi,
|
|
@@ -663,33 +663,33 @@ const ur = "_frame_1lxch_11 _text_18806_22", fr = "_children_1lxch_24", hr = "_s
|
|
|
663
663
|
draftMessage: vi,
|
|
664
664
|
editorMessage: yi,
|
|
665
665
|
control: _i,
|
|
666
|
-
empty:
|
|
667
|
-
toned:
|
|
666
|
+
empty: ki,
|
|
667
|
+
toned: Si
|
|
668
668
|
};
|
|
669
|
-
function
|
|
669
|
+
function Va(e) {
|
|
670
670
|
return e;
|
|
671
671
|
}
|
|
672
|
-
const
|
|
673
|
-
function
|
|
674
|
-
return
|
|
672
|
+
const We = /* @__PURE__ */ new WeakMap();
|
|
673
|
+
function Kn(e, t) {
|
|
674
|
+
return We.set(e, t), e;
|
|
675
675
|
}
|
|
676
|
-
const
|
|
676
|
+
const Ci = (e) => We.has(e);
|
|
677
677
|
function Ee(e) {
|
|
678
|
-
return e === "list" ? Ti : e === "range" ?
|
|
678
|
+
return e === "list" ? Ti : e === "range" ? Bi : typeof e == "object" && e !== null ? e : void 0;
|
|
679
679
|
}
|
|
680
|
-
function
|
|
680
|
+
function Gn(e, t) {
|
|
681
681
|
if (t == null) return "empty";
|
|
682
|
-
const n =
|
|
682
|
+
const n = We.get(e);
|
|
683
683
|
return n ? n.isCondition(t) ? n.isEmpty(t) ? "empty" : "effective" : "foreign" : "effective";
|
|
684
684
|
}
|
|
685
|
-
function
|
|
686
|
-
return se(t) ?
|
|
685
|
+
function xi(e, t, n) {
|
|
686
|
+
return se(t) ? We.get(e)?.absentMatches(n) ?? !1 : e.matches(t, n);
|
|
687
687
|
}
|
|
688
688
|
function Ai(e, t, n) {
|
|
689
|
-
const o =
|
|
689
|
+
const o = We.get(e);
|
|
690
690
|
return o ? o.describeIn(t, n) : e.describe(t);
|
|
691
691
|
}
|
|
692
|
-
const an = (e) => e instanceof Date ? e.getTime() : typeof e == "number" ? e : void 0,
|
|
692
|
+
const an = (e) => e instanceof Date ? e.getTime() : typeof e == "number" ? e : void 0, jn = (e) => (t, n) => {
|
|
693
693
|
const o = an(t.value), r = an(n.value);
|
|
694
694
|
return o !== void 0 && r !== void 0 ? o - r : e.compareText(t.text, n.text);
|
|
695
695
|
};
|
|
@@ -705,14 +705,14 @@ function At(e, t, n) {
|
|
|
705
705
|
const c = l instanceof Date ? `date:${l.getTime()}` : typeof l == "object" || typeof l == "function" ? l : `${typeof l}:${String(l)}`;
|
|
706
706
|
o.has(c) || o.set(c, l);
|
|
707
707
|
}
|
|
708
|
-
return { values: [...o.values()].map((i) => ({ value: i, text: String(i) })).sort(
|
|
708
|
+
return { values: [...o.values()].map((i) => ({ value: i, text: String(i) })).sort(jn(n)).map(({ value: i }) => i), absent: r };
|
|
709
709
|
}
|
|
710
710
|
const cn = /* @__PURE__ */ new WeakMap();
|
|
711
711
|
function Nt(e) {
|
|
712
712
|
let t = cn.get(e);
|
|
713
|
-
return t || (t = new Set(e.map(
|
|
713
|
+
return t || (t = new Set(e.map(Ce)), cn.set(e, t)), t;
|
|
714
714
|
}
|
|
715
|
-
const Tt = (e, t) => se(e) ? t.wording.cellAbsentValue :
|
|
715
|
+
const Tt = (e, t) => se(e) ? t.wording.cellAbsentValue : De(e, t.format, t.formats, t.wording) ?? String(e);
|
|
716
716
|
function Ni({
|
|
717
717
|
condition: e,
|
|
718
718
|
setCondition: t,
|
|
@@ -720,35 +720,35 @@ function Ni({
|
|
|
720
720
|
absentOccurs: o = !1,
|
|
721
721
|
format: r
|
|
722
722
|
}) {
|
|
723
|
-
const s =
|
|
724
|
-
const
|
|
725
|
-
b.sort(
|
|
726
|
-
const p = new Set(b.map((g) => g.key)), m = l.filter((g) => !se(g) && !p.has(
|
|
723
|
+
const s = ke(), i = ie(), l = j(() => e ?? [], [e]), c = j(() => {
|
|
724
|
+
const u = { formats: s, wording: i, format: r }, b = n.map((g) => ({ key: Ce(g), text: Tt(g, u), value: g }));
|
|
725
|
+
b.sort(jn(s));
|
|
726
|
+
const p = new Set(b.map((g) => g.key)), m = l.filter((g) => !se(g) && !p.has(Ce(g))).map((g) => ({ key: Ce(g), text: Tt(g, u), value: g })), w = o || l.some(se) ? [{ key: It, text: i.cellAbsentValue, value: null }] : [];
|
|
727
727
|
return [...b, ...m, ...w];
|
|
728
|
-
}, [n, l, o, r, s, i]), a = Nt(l),
|
|
729
|
-
const b = a.has(
|
|
728
|
+
}, [n, l, o, r, s, i]), a = Nt(l), d = (u) => {
|
|
729
|
+
const b = a.has(u.key) ? l.filter((p) => Ce(p) !== u.key) : [...l, u.value];
|
|
730
730
|
t(b.length > 0 ? b : null);
|
|
731
731
|
};
|
|
732
|
-
return /* @__PURE__ */ f("div", { className: h.filterContent, children: c.map((
|
|
733
|
-
|
|
732
|
+
return /* @__PURE__ */ f("div", { className: h.filterContent, children: c.map((u) => /* @__PURE__ */ f(
|
|
733
|
+
He,
|
|
734
734
|
{
|
|
735
|
-
label:
|
|
736
|
-
checked: a.has(
|
|
737
|
-
onChange: () => u
|
|
735
|
+
label: u.text,
|
|
736
|
+
checked: a.has(u.key),
|
|
737
|
+
onChange: () => d(u)
|
|
738
738
|
},
|
|
739
|
-
|
|
739
|
+
u.key
|
|
740
740
|
)) });
|
|
741
741
|
}
|
|
742
|
-
const Ti = /* @__PURE__ */
|
|
742
|
+
const Ti = /* @__PURE__ */ Kn(
|
|
743
743
|
{
|
|
744
|
-
matches: (e, t) => Nt(t).has(
|
|
744
|
+
matches: (e, t) => Nt(t).has(Ce(e)),
|
|
745
745
|
Input: Ni,
|
|
746
746
|
describe: (e) => e.map((t) => se(t) ? "–" : String(t)).join(", ")
|
|
747
747
|
},
|
|
748
748
|
{
|
|
749
749
|
isCondition: (e) => Array.isArray(e),
|
|
750
750
|
isEmpty: (e) => e.length === 0,
|
|
751
|
-
absentMatches: (e) => Nt(e).has(
|
|
751
|
+
absentMatches: (e) => Nt(e).has(It),
|
|
752
752
|
/* From three values on the first two and how many more: a condition is one
|
|
753
753
|
line in the table toolbar, not a list. */
|
|
754
754
|
describeIn: (e, t) => {
|
|
@@ -758,21 +758,21 @@ const Ti = /* @__PURE__ */ Gn(
|
|
|
758
758
|
return `${n.slice(0, 2).join(", ")} ${t.wording.moreValues(o, t.formats.count(o))}`;
|
|
759
759
|
}
|
|
760
760
|
}
|
|
761
|
-
), Ri = (e) => new Date(e.getFullYear(), e.getMonth(), e.getDate()).getTime(), Oi = (e) => new Date(e.getFullYear(), e.getMonth(), e.getDate() + 1).getTime(),
|
|
761
|
+
), Ri = (e) => new Date(e.getFullYear(), e.getMonth(), e.getDate()).getTime(), Oi = (e) => new Date(e.getFullYear(), e.getMonth(), e.getDate() + 1).getTime(), Be = (e) => typeof e == "number" && Number.isFinite(e), ye = (e) => e instanceof Date && !Number.isNaN(e.getTime()), Ei = (e) => ye(e) ? Ri(e) : Be(e) ? e : void 0, Mi = (e) => ye(e) ? { value: Oi(e), open: !0 } : Be(e) ? { value: e, open: !1 } : void 0, Qe = (e, t) => ye(e) ? t.formats.date(e) : De(e, t.format, t.formats, t.wording) ?? String(e);
|
|
762
762
|
function Li({ condition: e, setCondition: t }) {
|
|
763
|
-
const n = ie(), [o, r] =
|
|
764
|
-
const
|
|
765
|
-
if (
|
|
766
|
-
r(
|
|
763
|
+
const n = ie(), [o, r] = V(null), s = o !== null, i = o ? o.from : Be(e?.from) ? e.from : null, l = o ? o.to : Be(e?.to) ? e.to : null, c = (a, d) => {
|
|
764
|
+
const u = { from: i, to: l, [a]: d };
|
|
765
|
+
if (u.from !== null && u.to !== null && u.from > u.to) {
|
|
766
|
+
r(u);
|
|
767
767
|
return;
|
|
768
768
|
}
|
|
769
|
-
if (r(null),
|
|
769
|
+
if (r(null), u.from === null && u.to === null) {
|
|
770
770
|
t(null);
|
|
771
771
|
return;
|
|
772
772
|
}
|
|
773
773
|
t({
|
|
774
|
-
...
|
|
775
|
-
...
|
|
774
|
+
...u.from !== null ? { from: u.from } : {},
|
|
775
|
+
...u.to !== null ? { to: u.to } : {}
|
|
776
776
|
});
|
|
777
777
|
};
|
|
778
778
|
return /* @__PURE__ */ T("div", { className: h.rangeFields, children: [
|
|
@@ -780,7 +780,7 @@ function Li({ condition: e, setCondition: t }) {
|
|
|
780
780
|
/* @__PURE__ */ f(vt, { label: n.filterTo, error: s ? n.rangeInvalid : void 0, children: /* @__PURE__ */ f(yt, { size: "sm", value: l, onChange: (a) => c("to", a) }) })
|
|
781
781
|
] });
|
|
782
782
|
}
|
|
783
|
-
function
|
|
783
|
+
function qi({ condition: e, setCondition: t }) {
|
|
784
784
|
const n = ye(e?.from) && ye(e?.to) ? { from: e.from, to: e.to } : null;
|
|
785
785
|
return /* @__PURE__ */ f("div", { className: h.rangePeriod, children: /* @__PURE__ */ f(
|
|
786
786
|
Eo,
|
|
@@ -792,23 +792,23 @@ function Fi({ condition: e, setCondition: t }) {
|
|
|
792
792
|
}
|
|
793
793
|
) });
|
|
794
794
|
}
|
|
795
|
-
function
|
|
796
|
-
return e.kind === "date" ? /* @__PURE__ */ f(
|
|
795
|
+
function Fi(e) {
|
|
796
|
+
return e.kind === "date" ? /* @__PURE__ */ f(qi, { ...e }) : /* @__PURE__ */ f(Li, { ...e });
|
|
797
797
|
}
|
|
798
|
-
const
|
|
798
|
+
const Bi = /* @__PURE__ */ Kn(
|
|
799
799
|
{
|
|
800
800
|
matches: (e, t) => {
|
|
801
|
-
const n = ye(e) ? e.getTime() :
|
|
801
|
+
const n = ye(e) ? e.getTime() : Be(e) ? e : void 0;
|
|
802
802
|
if (n === void 0) return !1;
|
|
803
803
|
const o = Ei(t.from), r = Mi(t.to);
|
|
804
804
|
return !(o !== void 0 && n < o || r !== void 0 && (r.open ? n >= r.value : n > r.value));
|
|
805
805
|
},
|
|
806
|
-
Input:
|
|
806
|
+
Input: Fi,
|
|
807
807
|
describe: (e) => [e.from, e.to].map((t) => t === void 0 ? "" : String(t)).join("–")
|
|
808
808
|
},
|
|
809
809
|
{
|
|
810
810
|
isCondition: (e) => typeof e != "object" || e === null || Array.isArray(e) || e instanceof Date ? !1 : Object.entries(e).every(
|
|
811
|
-
([n, o]) => (n === "from" || n === "to") && (o === void 0 ||
|
|
811
|
+
([n, o]) => (n === "from" || n === "to") && (o === void 0 || Be(o) || ye(o))
|
|
812
812
|
),
|
|
813
813
|
isEmpty: (e) => e.from === void 0 && e.to === void 0,
|
|
814
814
|
absentMatches: () => !1,
|
|
@@ -852,7 +852,7 @@ class wt {
|
|
|
852
852
|
return this.dom = n, this.pass = n, o !== this.ordered().map((r) => r.key).join("|");
|
|
853
853
|
}
|
|
854
854
|
}
|
|
855
|
-
const
|
|
855
|
+
const un = (e) => JSON.stringify([
|
|
856
856
|
e.id,
|
|
857
857
|
e.label,
|
|
858
858
|
typeof e.value == "string" ? e.value : "ƒ",
|
|
@@ -878,13 +878,13 @@ const dn = (e) => JSON.stringify([
|
|
|
878
878
|
/* Whether a column edits, and how - not its editor or its check, which
|
|
879
879
|
are new functions on every render and are read when an edit starts. */
|
|
880
880
|
typeof e.edit == "function" ? "ƒ" : e.edit
|
|
881
|
-
]),
|
|
881
|
+
]), Di = (e, t) => e?.[t], dn = (e, t) => {
|
|
882
882
|
const n = {
|
|
883
883
|
key: e,
|
|
884
884
|
spec: t,
|
|
885
885
|
read: (o) => {
|
|
886
886
|
const r = n.spec.value;
|
|
887
|
-
return typeof r == "string" ?
|
|
887
|
+
return typeof r == "string" ? Di(o, r) : r(o);
|
|
888
888
|
}
|
|
889
889
|
};
|
|
890
890
|
return n;
|
|
@@ -896,10 +896,11 @@ function ot(e, t) {
|
|
|
896
896
|
return n.includes("[native code]") ? !1 : n === String(t);
|
|
897
897
|
}
|
|
898
898
|
function fn(e, t) {
|
|
899
|
+
if (e.id !== t.id) return t;
|
|
899
900
|
const n = ot(e.value, t.value) ? e.value : t.value, o = ot(e.ownSortValue, t.ownSortValue) ? e.ownSortValue : t.ownSortValue, r = ot(e.ownGroupValue, t.ownGroupValue) ? e.ownGroupValue : t.ownGroupValue;
|
|
900
901
|
return n === t.value && o === t.ownSortValue && r === t.ownGroupValue ? t : { ...t, value: n, ownSortValue: o, ownGroupValue: r };
|
|
901
902
|
}
|
|
902
|
-
class
|
|
903
|
+
class Pi {
|
|
903
904
|
columns = new wt("data-umriss-column");
|
|
904
905
|
actions = new wt("data-umriss-action");
|
|
905
906
|
/** The group keys: values to group by that are no column. */
|
|
@@ -953,21 +954,21 @@ class Vi {
|
|
|
953
954
|
}
|
|
954
955
|
/** After the commit: check the order against the DOM. */
|
|
955
956
|
checkOrder() {
|
|
956
|
-
this.children && (this.columns.check(this.children) && this.structure++, this.actions.check(this.children) && this.structure++, this.groupKeys.check(this.children) && this.structure++);
|
|
957
|
+
this.checkUniqueness(), this.children && (this.columns.check(this.children) && this.structure++, this.actions.check(this.children) && this.structure++, this.groupKeys.check(this.children) && this.structure++);
|
|
957
958
|
}
|
|
958
959
|
/* --- Columns ------------------------------------------------------------------ */
|
|
959
960
|
/** A column registers during the render. Idempotent: the same spec changes no
|
|
960
961
|
version. */
|
|
961
962
|
registerColumn(t, n) {
|
|
962
|
-
const o = this.columns.entries.get(t), r =
|
|
963
|
+
const o = this.columns.entries.get(t), r = un(n);
|
|
963
964
|
if (o) {
|
|
964
965
|
const s = o.spec;
|
|
965
966
|
n = fn(s, n), this.signatures.get(t) !== r && this.structure++, (s.value !== n.value || s.ownSortValue !== n.ownSortValue || s.ownGroupValue !== n.ownGroupValue) && this.values++, (s.presentation !== n.presentation || s.ownExportValue !== n.ownExportValue || s.aggregate !== n.aggregate) && this.presentation++, o.spec = n;
|
|
966
967
|
} else {
|
|
967
|
-
const s =
|
|
968
|
+
const s = dn(t, n);
|
|
968
969
|
this.columns.entries.set(t, s), this.structure++;
|
|
969
970
|
}
|
|
970
|
-
this.signatures.set(t, r), this.columns.note(t)
|
|
971
|
+
this.signatures.set(t, r), this.columns.note(t);
|
|
971
972
|
}
|
|
972
973
|
/** After mounting - including after the Strict Mode's second mount, whose
|
|
973
974
|
cleanup removed the entry in between. */
|
|
@@ -977,6 +978,8 @@ class Vi {
|
|
|
977
978
|
removeColumn(t) {
|
|
978
979
|
this.columns.entries.delete(t) && (this.signatures.delete(t), this.kinds.delete(t), this.structure++);
|
|
979
980
|
}
|
|
981
|
+
/** Once the render's columns have all registered: an id seen mid-render may
|
|
982
|
+
still belong to a column whose own id is about to change. */
|
|
980
983
|
checkUniqueness() {
|
|
981
984
|
const t = /* @__PURE__ */ new Set();
|
|
982
985
|
let n = 0;
|
|
@@ -1018,11 +1021,11 @@ class Vi {
|
|
|
1018
1021
|
/* --- Group keys and the grouping ---------------------------------------------- */
|
|
1019
1022
|
/** A group key registers during the render, as a column does. Idempotent. */
|
|
1020
1023
|
registerGroupKey(t, n) {
|
|
1021
|
-
const o = this.groupKeys.entries.get(t), r =
|
|
1024
|
+
const o = this.groupKeys.entries.get(t), r = un(n);
|
|
1022
1025
|
if (o)
|
|
1023
1026
|
n = fn(o.spec, n), this.signatures.get(t) !== r && this.structure++, (o.spec.value !== n.value || o.spec.ownGroupValue !== n.ownGroupValue) && this.values++, o.spec = n;
|
|
1024
1027
|
else {
|
|
1025
|
-
const s =
|
|
1028
|
+
const s = dn(t, n);
|
|
1026
1029
|
this.groupKeys.entries.set(t, s), this.structure++;
|
|
1027
1030
|
}
|
|
1028
1031
|
this.signatures.set(t, r), this.groupKeys.note(t);
|
|
@@ -1084,7 +1087,7 @@ class Vi {
|
|
|
1084
1087
|
each once. */
|
|
1085
1088
|
effectiveGrouping(t, n) {
|
|
1086
1089
|
const o = new Set(this.groupingEntries(n).map((r) => r.spec.id));
|
|
1087
|
-
return [...new Set(t)].filter((r) => o.has(r)).slice(0,
|
|
1090
|
+
return [...new Set(t)].filter((r) => o.has(r)).slice(0, zt);
|
|
1088
1091
|
}
|
|
1089
1092
|
groupingCache = null;
|
|
1090
1093
|
/** The levels and aggregates for the model - the same identity as long as
|
|
@@ -1097,11 +1100,11 @@ class Vi {
|
|
|
1097
1100
|
value: (c) => {
|
|
1098
1101
|
const a = l.read(c);
|
|
1099
1102
|
if (a == null) return;
|
|
1100
|
-
const { ownGroupValue:
|
|
1101
|
-
return
|
|
1103
|
+
const { ownGroupValue: d, group: u } = l.spec;
|
|
1104
|
+
return d ? d(a) : u ? Ho(u)(a) : a;
|
|
1102
1105
|
},
|
|
1103
1106
|
/* A value of one's own is a name; its groups stand by what they hold. */
|
|
1104
|
-
order: l.spec.ownGroupValue ? (c) =>
|
|
1107
|
+
order: l.spec.ownGroupValue ? (c) => kt(l.read(c), l.spec.ownSortValue) : void 0
|
|
1105
1108
|
})), i = this.orderedColumns().filter((l) => l.spec.aggregate !== void 0).map(
|
|
1106
1109
|
(l) => ({
|
|
1107
1110
|
id: l.spec.id,
|
|
@@ -1147,15 +1150,15 @@ class Vi {
|
|
|
1147
1150
|
if (this.modelCache?.key === r && this.modelCache.rows === t && this.modelCache.formats === n)
|
|
1148
1151
|
return this.modelCache.columns;
|
|
1149
1152
|
const s = o.map((i) => {
|
|
1150
|
-
const { spec: l } = i, c = this.kindOf(i, t), a = this.isSortable(i, t),
|
|
1153
|
+
const { spec: l } = i, c = this.kindOf(i, t), a = this.isSortable(i, t), d = l.searchable ?? c === "text", u = (b) => kt(i.read(b), l.ownSortValue);
|
|
1151
1154
|
return {
|
|
1152
1155
|
id: l.id,
|
|
1153
1156
|
label: l.label,
|
|
1154
|
-
value: a ||
|
|
1157
|
+
value: a || d ? u : void 0,
|
|
1155
1158
|
/* Text sorts with the provider's comparison, not with the built-in
|
|
1156
1159
|
German one (spec, the table of defaults). */
|
|
1157
|
-
compare: c === "text" && !l.ownSortValue ? (b, p) => n.compareText(String(
|
|
1158
|
-
searchable:
|
|
1160
|
+
compare: c === "text" && !l.ownSortValue ? (b, p) => n.compareText(String(u(b)), String(u(p))) : void 0,
|
|
1161
|
+
searchable: d,
|
|
1159
1162
|
hideable: !l.rowHeader,
|
|
1160
1163
|
resizable: l.resizable,
|
|
1161
1164
|
width: l.width
|
|
@@ -1192,7 +1195,7 @@ class Vi {
|
|
|
1192
1195
|
grouping: this.groupingFor(t),
|
|
1193
1196
|
server: o.server,
|
|
1194
1197
|
tree: t.tree
|
|
1195
|
-
}, s =
|
|
1198
|
+
}, s = $n(t.admitted, n, r), i = o.virtual ? zn(s, o.virtual.from, o.virtual.to) : s;
|
|
1196
1199
|
return this.projectionCache = { hook: t, columns: n, projection: i }, i;
|
|
1197
1200
|
}
|
|
1198
1201
|
/* --- The hook's snapshot ---------------------------------------------------------- */
|
|
@@ -1280,20 +1283,20 @@ class Vi {
|
|
|
1280
1283
|
this.actions.entries.delete(t) && this.structure++;
|
|
1281
1284
|
}
|
|
1282
1285
|
}
|
|
1283
|
-
const
|
|
1284
|
-
|
|
1285
|
-
},
|
|
1286
|
-
`,
|
|
1286
|
+
const Hn = /* @__PURE__ */ new WeakMap(), Vi = (e, t) => {
|
|
1287
|
+
Hn.set(e, t);
|
|
1288
|
+
}, Ii = (e) => typeof e == "function" || typeof e == "object" && e !== null ? Hn.get(e) : void 0, F = (...e) => e.filter(Boolean).join(" "), Wn = { separator: ",", decimal: ".", yes: "yes", no: "no" }, $i = `\r
|
|
1289
|
+
`, zi = "\uFEFF", Yn = (e, t) => typeof e == "number" ? String(e).replace(".", t.decimal) : typeof e == "boolean" ? e ? t.yes : t.no : e, Un = (e, t) => e.includes(t) || /["\r\n]/.test(e) ? `"${e.replace(/"/g, '""')}"` : e, Jn = (e, t) => t && /^[=+\-@\t\r]/.test(e) ? `'${e}` : e, Ki = (e, t, n, o) => {
|
|
1287
1290
|
const r = t.value?.(e);
|
|
1288
1291
|
return r == null ? "" : Un(typeof r == "string" ? Jn(r, o) : Yn(r, n), n.separator);
|
|
1289
1292
|
}, Xn = (e, t, n, o) => [
|
|
1290
1293
|
t.map((r) => Un(Jn(r.label ?? r.id, o), n.separator)).join(n.separator),
|
|
1291
|
-
...e.map((r) => t.map((s) =>
|
|
1294
|
+
...e.map((r) => t.map((s) => Ki(r, s, n, o)).join(n.separator))
|
|
1292
1295
|
];
|
|
1293
|
-
function hn(e, t, n =
|
|
1294
|
-
return
|
|
1296
|
+
function hn(e, t, n = Wn) {
|
|
1297
|
+
return zi + Xn(e, t, n, !0).join($i);
|
|
1295
1298
|
}
|
|
1296
|
-
function
|
|
1299
|
+
function Gi(e, t, n = Wn) {
|
|
1297
1300
|
return Xn(e, t, { ...n, separator: " " }, !1).join(`
|
|
1298
1301
|
`);
|
|
1299
1302
|
}
|
|
@@ -1305,7 +1308,7 @@ function Zn(e) {
|
|
|
1305
1308
|
e.setSearch("");
|
|
1306
1309
|
for (const t of Object.keys(e.filter)) e.setFilter(t, null);
|
|
1307
1310
|
}
|
|
1308
|
-
function
|
|
1311
|
+
function Gt(e, t) {
|
|
1309
1312
|
const { decimal: n } = Mo(e);
|
|
1310
1313
|
return {
|
|
1311
1314
|
separator: n === "," ? ";" : ",",
|
|
@@ -1319,17 +1322,17 @@ function eo(e, t) {
|
|
|
1319
1322
|
(n) => ({
|
|
1320
1323
|
id: n.spec.id,
|
|
1321
1324
|
label: n.spec.label,
|
|
1322
|
-
value: (o) =>
|
|
1325
|
+
value: (o) => Vt(n.read(o), n.spec.ownExportValue)
|
|
1323
1326
|
})
|
|
1324
1327
|
);
|
|
1325
1328
|
}
|
|
1326
|
-
function
|
|
1329
|
+
function ji(e, t, n, o) {
|
|
1327
1330
|
const r = e.hook;
|
|
1328
1331
|
if (!r) return "";
|
|
1329
|
-
const s = eo(e, r.rows), i =
|
|
1332
|
+
const s = eo(e, r.rows), i = Gt(n, o), { exported: l, filtered: c } = e.projection();
|
|
1330
1333
|
if (!l) return hn(c, s, i);
|
|
1331
|
-
const a = new Map(l.map((
|
|
1332
|
-
return hn(l.map((
|
|
1334
|
+
const a = new Map(l.map((u) => [u.node, u.level + 1])), d = { id: "#level", label: t, value: (u) => a.get(u) };
|
|
1335
|
+
return hn(l.map((u) => u.node), [d, ...s], i);
|
|
1333
1336
|
}
|
|
1334
1337
|
function to(e) {
|
|
1335
1338
|
const t = e.hook;
|
|
@@ -1339,14 +1342,14 @@ function to(e) {
|
|
|
1339
1342
|
}
|
|
1340
1343
|
function no(e, t, n) {
|
|
1341
1344
|
const o = e.hook, r = to(e);
|
|
1342
|
-
return !o || r.length === 0 ? "" :
|
|
1345
|
+
return !o || r.length === 0 ? "" : Gi(r, eo(e, o.rows), Gt(t, n));
|
|
1343
1346
|
}
|
|
1344
|
-
function
|
|
1347
|
+
function Hi(e, t, n, o) {
|
|
1345
1348
|
return oo(e, e.read(t), n, o);
|
|
1346
1349
|
}
|
|
1347
1350
|
function oo(e, t, n, o) {
|
|
1348
|
-
const r =
|
|
1349
|
-
return r === void 0 ? "" : Yn(r,
|
|
1351
|
+
const r = Vt(t, e.spec.ownExportValue);
|
|
1352
|
+
return r === void 0 ? "" : Yn(r, Gt(n, o));
|
|
1350
1353
|
}
|
|
1351
1354
|
function ro({
|
|
1352
1355
|
entry: e,
|
|
@@ -1359,15 +1362,15 @@ function ro({
|
|
|
1359
1362
|
setOpen: l,
|
|
1360
1363
|
panelId: c
|
|
1361
1364
|
}) {
|
|
1362
|
-
const a = ie(),
|
|
1363
|
-
() => w ? At(w, (A) => A,
|
|
1364
|
-
[w, n.admitted, e,
|
|
1365
|
-
),
|
|
1365
|
+
const a = ie(), d = ke(), { id: u, label: b, format: p } = e.spec, { filterOptions: m } = n, w = m?.(u), { values: g, absent: v } = j(
|
|
1366
|
+
() => w ? At(w, (A) => A, d) : At(n.admitted, e.read, d),
|
|
1367
|
+
[w, n.admitted, e, d]
|
|
1368
|
+
), x = Ee(e.spec.filter);
|
|
1366
1369
|
if (n.publicSnapshot.server && !w && e.spec.filter === "list" && X(
|
|
1367
|
-
`server-filter-options:${
|
|
1368
|
-
`The list filter of "${
|
|
1369
|
-
), !
|
|
1370
|
-
const y = n.publicSnapshot, _ =
|
|
1370
|
+
`server-filter-options:${u}`,
|
|
1371
|
+
`The list filter of "${u}" offers only the values of the page in server mode; \`filterOptions\` gives it the server's.`
|
|
1372
|
+
), !x) return null;
|
|
1373
|
+
const y = n.publicSnapshot, _ = x.Input, S = Ci(x) ? { absentOccurs: v, format: p, kind: t.kindOf(e, n.rows) } : {}, C = () => {
|
|
1371
1374
|
l(!1), (s ?? o).current?.focus();
|
|
1372
1375
|
};
|
|
1373
1376
|
return /* @__PURE__ */ T(
|
|
@@ -1385,45 +1388,45 @@ function ro({
|
|
|
1385
1388
|
/* @__PURE__ */ f(
|
|
1386
1389
|
_,
|
|
1387
1390
|
{
|
|
1388
|
-
condition: y.filter[
|
|
1389
|
-
setCondition: (A) => y.setFilter(
|
|
1391
|
+
condition: y.filter[u] ?? null,
|
|
1392
|
+
setCondition: (A) => y.setFilter(u, A),
|
|
1390
1393
|
values: g,
|
|
1391
|
-
column: { id:
|
|
1392
|
-
...
|
|
1394
|
+
column: { id: u, label: b },
|
|
1395
|
+
...S
|
|
1393
1396
|
}
|
|
1394
1397
|
),
|
|
1395
1398
|
/* @__PURE__ */ T("div", { className: h.filterFooter, children: [
|
|
1396
|
-
/* @__PURE__ */ f(Q, { size: "sm", variant: "ghost", onClick: () => y.setFilter(
|
|
1397
|
-
/* @__PURE__ */ f(Q, { size: "sm", onClick:
|
|
1399
|
+
/* @__PURE__ */ f(Q, { size: "sm", variant: "ghost", onClick: () => y.setFilter(u, null), children: a.filterReset }),
|
|
1400
|
+
/* @__PURE__ */ f(Q, { size: "sm", onClick: C, children: a.filterDone })
|
|
1398
1401
|
] })
|
|
1399
1402
|
]
|
|
1400
1403
|
}
|
|
1401
1404
|
);
|
|
1402
1405
|
}
|
|
1403
|
-
function
|
|
1406
|
+
function Wi({
|
|
1404
1407
|
entry: e,
|
|
1405
1408
|
registry: t,
|
|
1406
1409
|
hook: n
|
|
1407
1410
|
}) {
|
|
1408
|
-
const o = ie(), [r, s] =
|
|
1411
|
+
const o = ie(), [r, s] = V(!1), i = W(null), l = be(), { id: c, label: a } = e.spec, d = c in n.publicSnapshot.filter;
|
|
1409
1412
|
return /* @__PURE__ */ T(re, { children: [
|
|
1410
1413
|
/* @__PURE__ */ f(tt, { content: o.filterHint, children: /* @__PURE__ */ f(
|
|
1411
1414
|
"button",
|
|
1412
1415
|
{
|
|
1413
1416
|
type: "button",
|
|
1414
|
-
className:
|
|
1417
|
+
className: F(h.filterButton, d && h.filterActive),
|
|
1415
1418
|
"aria-label": o.filterColumn(a),
|
|
1416
1419
|
"aria-haspopup": "dialog",
|
|
1417
1420
|
"aria-expanded": r,
|
|
1418
1421
|
"aria-controls": r ? l : void 0,
|
|
1419
|
-
onClick: (
|
|
1420
|
-
i.current =
|
|
1422
|
+
onClick: (u) => {
|
|
1423
|
+
i.current = u.currentTarget, s(!r);
|
|
1421
1424
|
},
|
|
1422
1425
|
children: /* @__PURE__ */ f("svg", { viewBox: "0 0 14 14", width: "13", height: "13", "aria-hidden": "true", children: /* @__PURE__ */ f(
|
|
1423
1426
|
"path",
|
|
1424
1427
|
{
|
|
1425
1428
|
d: "M1.8 2.6h10.4L8.3 7.5v3.4l-2.6 1.1V7.5L1.8 2.6z",
|
|
1426
|
-
fill:
|
|
1429
|
+
fill: d ? "currentColor" : "none",
|
|
1427
1430
|
stroke: "currentColor",
|
|
1428
1431
|
strokeWidth: "1.4",
|
|
1429
1432
|
strokeLinecap: "round",
|
|
@@ -1448,17 +1451,17 @@ function qi({
|
|
|
1448
1451
|
] });
|
|
1449
1452
|
}
|
|
1450
1453
|
function Yi({ registry: e, hook: t }) {
|
|
1451
|
-
const n = ie(), o =
|
|
1454
|
+
const n = ie(), o = ke(), r = Object.entries(t.publicSnapshot.filter).flatMap(([s, i]) => {
|
|
1452
1455
|
const l = t.rowFilters.get(s);
|
|
1453
1456
|
if (l) return l.describe ? [{ id: s, rowFilter: l, text: l.describe(i) }] : [];
|
|
1454
1457
|
const c = e.columnById(s), a = c ? Ee(c.spec.filter) : void 0;
|
|
1455
1458
|
if (!c || !a) return [];
|
|
1456
|
-
const
|
|
1457
|
-
return [{ id: s, entry: c, text: Ai(a, i,
|
|
1459
|
+
const d = { formats: o, wording: n, format: c.spec.format, kind: e.kindOf(c, t.rows) };
|
|
1460
|
+
return [{ id: s, entry: c, text: Ai(a, i, d) }];
|
|
1458
1461
|
});
|
|
1459
1462
|
return r.length === 0 ? null : /* @__PURE__ */ f(An, { "aria-label": n.conditions, className: h.conditions, children: r.map(
|
|
1460
1463
|
(s) => "rowFilter" in s ? /* @__PURE__ */ T(
|
|
1461
|
-
|
|
1464
|
+
Dt,
|
|
1462
1465
|
{
|
|
1463
1466
|
className: h.condition,
|
|
1464
1467
|
onRemove: () => t.publicSnapshot.setFilter(s.id, null),
|
|
@@ -1478,28 +1481,28 @@ function Ui({
|
|
|
1478
1481
|
registry: n,
|
|
1479
1482
|
hook: o
|
|
1480
1483
|
}) {
|
|
1481
|
-
const r = ie(), [s, i] =
|
|
1484
|
+
const r = ie(), [s, i] = V(!1), l = W(null), c = W(null), a = be(), { id: d, label: u } = e.spec;
|
|
1482
1485
|
return /* @__PURE__ */ T(re, { children: [
|
|
1483
1486
|
/* @__PURE__ */ f(
|
|
1484
|
-
|
|
1487
|
+
Dt,
|
|
1485
1488
|
{
|
|
1486
1489
|
ref: l,
|
|
1487
1490
|
className: h.condition,
|
|
1488
|
-
onRemove: () => o.publicSnapshot.setFilter(
|
|
1489
|
-
removeLabel: r.removeConditionNamed(
|
|
1491
|
+
onRemove: () => o.publicSnapshot.setFilter(d, null),
|
|
1492
|
+
removeLabel: r.removeConditionNamed(u, t),
|
|
1490
1493
|
children: /* @__PURE__ */ T(
|
|
1491
1494
|
"button",
|
|
1492
1495
|
{
|
|
1493
1496
|
ref: c,
|
|
1494
1497
|
type: "button",
|
|
1495
1498
|
className: h.conditionButton,
|
|
1496
|
-
"aria-label": r.editConditionNamed(
|
|
1499
|
+
"aria-label": r.editConditionNamed(u, t),
|
|
1497
1500
|
"aria-haspopup": "dialog",
|
|
1498
1501
|
"aria-expanded": s,
|
|
1499
1502
|
"aria-controls": s ? a : void 0,
|
|
1500
1503
|
onClick: () => i(!s),
|
|
1501
1504
|
children: [
|
|
1502
|
-
/* @__PURE__ */ f("span", { className: h.filterLabel, children:
|
|
1505
|
+
/* @__PURE__ */ f("span", { className: h.filterLabel, children: u }),
|
|
1503
1506
|
/* @__PURE__ */ f("span", { className: h.filterValue, children: t })
|
|
1504
1507
|
]
|
|
1505
1508
|
}
|
|
@@ -1530,18 +1533,18 @@ function Xi({ registry: e, hook: t }) {
|
|
|
1530
1533
|
return /* @__PURE__ */ T("section", { className: h.groupingChoice, "aria-label": n.grouping, children: [
|
|
1531
1534
|
/* @__PURE__ */ f("h3", { className: h.groupingHeading, children: n.grouping }),
|
|
1532
1535
|
/* @__PURE__ */ f("div", { className: h.groupingOptions, children: o.map((i) => {
|
|
1533
|
-
const { id: l, label: c } = i.spec, a = r.indexOf(l),
|
|
1536
|
+
const { id: l, label: c } = i.spec, a = r.indexOf(l), d = a !== -1;
|
|
1534
1537
|
return /* @__PURE__ */ T(
|
|
1535
1538
|
"button",
|
|
1536
1539
|
{
|
|
1537
1540
|
type: "button",
|
|
1538
1541
|
className: h.groupingOption,
|
|
1539
1542
|
"aria-label": n.groupBy(c),
|
|
1540
|
-
"aria-pressed":
|
|
1541
|
-
disabled: !
|
|
1542
|
-
onClick: () => s(
|
|
1543
|
+
"aria-pressed": d,
|
|
1544
|
+
disabled: !d && r.length >= zt,
|
|
1545
|
+
onClick: () => s(d ? r.filter((u) => u !== l) : [...r, l]),
|
|
1543
1546
|
children: [
|
|
1544
|
-
|
|
1547
|
+
d && /* @__PURE__ */ f("span", { className: h.groupingLevel, "aria-hidden": "true", children: a + 1 }),
|
|
1545
1548
|
c
|
|
1546
1549
|
]
|
|
1547
1550
|
},
|
|
@@ -1554,7 +1557,7 @@ function Qi({ registry: e, hook: t }) {
|
|
|
1554
1557
|
const n = ie();
|
|
1555
1558
|
if (!e.tree) return null;
|
|
1556
1559
|
const o = t.publicSnapshot;
|
|
1557
|
-
return /* @__PURE__ */ T("div", { className:
|
|
1560
|
+
return /* @__PURE__ */ T("div", { className: F(h.groupingChoice, h.groupingOptions), children: [
|
|
1558
1561
|
/* @__PURE__ */ f("button", { type: "button", className: h.groupingOption, onClick: o.unfoldAllBranches, children: n.unfoldAll }),
|
|
1559
1562
|
/* @__PURE__ */ f("button", { type: "button", className: h.groupingOption, onClick: o.foldAllBranches, children: n.foldAll })
|
|
1560
1563
|
] });
|
|
@@ -1566,10 +1569,10 @@ function Zi({ registry: e, hook: t }) {
|
|
|
1566
1569
|
return (
|
|
1567
1570
|
/* In a tag group, as the conditions stand: the tag is one stop, its button
|
|
1568
1571
|
the thing one tabs to, and the ring stands on the tag. */
|
|
1569
|
-
/* @__PURE__ */ f(An, { "aria-label": n.groupedBy, className: h.groupingTag, children: /* @__PURE__ */ f(
|
|
1572
|
+
/* @__PURE__ */ f(An, { "aria-label": n.groupedBy, className: h.groupingTag, children: /* @__PURE__ */ f(Dt, { onRemove: () => o.setGrouping([]), removeLabel: n.removeGrouping, children: /* @__PURE__ */ T(
|
|
1570
1573
|
Nn,
|
|
1571
1574
|
{
|
|
1572
|
-
trigger: /* @__PURE__ */ T("button", { type: "button", className:
|
|
1575
|
+
trigger: /* @__PURE__ */ T("button", { type: "button", className: F(h.conditionButton, h.groupingTrigger), children: [
|
|
1573
1576
|
/* @__PURE__ */ f("span", { className: h.groupingPrefix, children: n.groupedBy }),
|
|
1574
1577
|
s.map((i, l) => /* @__PURE__ */ T("span", { className: h.groupingPath, children: [
|
|
1575
1578
|
l > 0 && /* @__PURE__ */ f("span", { className: h.groupingSeparator, "aria-hidden": "true", children: "›" }),
|
|
@@ -1602,21 +1605,21 @@ function lo({
|
|
|
1602
1605
|
own: o = !1,
|
|
1603
1606
|
size: r = "sm"
|
|
1604
1607
|
}) {
|
|
1605
|
-
const s = ie(), i =
|
|
1608
|
+
const s = ie(), i = ke(), l = e?.hook ?? null;
|
|
1606
1609
|
let c = null, a = null;
|
|
1607
1610
|
if (e && l) {
|
|
1608
|
-
const
|
|
1611
|
+
const d = l.publicSnapshot, u = d.search !== "" || Object.keys(d.filter).length > 0, b = o || d.selection.count === 0 ? [] : l.selectedRows ?? d.filtered.filter((w) => d.selection.isSelected(l.rowKey(w))), p = e.hasRowActions() ? e.actions.ordered().filter((w) => w.spec.bulk) : [];
|
|
1609
1612
|
c = /* @__PURE__ */ T(re, { children: [
|
|
1610
1613
|
/* @__PURE__ */ f(Zi, { registry: e, hook: l }),
|
|
1611
1614
|
/* @__PURE__ */ f(Yi, { registry: e, hook: l })
|
|
1612
1615
|
] });
|
|
1613
|
-
const m = !
|
|
1614
|
-
a = /* @__PURE__ */ T("div", { className:
|
|
1615
|
-
/* @__PURE__ */ f("span", { role: "status", className: h.filteredCount, children:
|
|
1616
|
+
const m = !u && b.length === 0 && !e.rowAdding;
|
|
1617
|
+
a = /* @__PURE__ */ T("div", { className: F(h.toolbarGroup, m && h.toolbarGroupIdle), children: [
|
|
1618
|
+
/* @__PURE__ */ f("span", { role: "status", className: h.filteredCount, children: u ? d.server ? (
|
|
1616
1619
|
/* The server counts the matches only; a total beside them would be a second request. */
|
|
1617
|
-
s.entries(
|
|
1618
|
-
) : s.filteredOfTotal(i.count(
|
|
1619
|
-
|
|
1620
|
+
s.entries(d.rowCount, i.count(d.rowCount))
|
|
1621
|
+
) : s.filteredOfTotal(i.count(d.filtered.length), i.count(l.tableState.total ?? l.admitted.length)) : "" }),
|
|
1622
|
+
u && /* @__PURE__ */ f(Q, { size: r, variant: "ghost", onClick: () => Zn(d), children: s.resetAll }),
|
|
1620
1623
|
b.length > 0 && /* @__PURE__ */ T(re, { children: [
|
|
1621
1624
|
/* @__PURE__ */ f("span", { className: h.toolbarInfo, children: s.selectedCount(b.length, i.count(b.length)) }),
|
|
1622
1625
|
p.map(({ key: w, spec: g }) => /* @__PURE__ */ f(
|
|
@@ -1633,7 +1636,7 @@ function lo({
|
|
|
1633
1636
|
e.rowAdding && /* @__PURE__ */ f(io, { registry: e })
|
|
1634
1637
|
] });
|
|
1635
1638
|
}
|
|
1636
|
-
return /* @__PURE__ */ f(so, { value: r, children: /* @__PURE__ */ f(Tn, { size: r, children: /* @__PURE__ */ T("div", { className:
|
|
1639
|
+
return /* @__PURE__ */ f(so, { value: r, children: /* @__PURE__ */ f(Tn, { size: r, children: /* @__PURE__ */ T("div", { className: F(h.toolbar, r === "md" && h.toolbarMd, t), children: [
|
|
1637
1640
|
/* @__PURE__ */ T("div", { className: h.toolbarGroup, children: [
|
|
1638
1641
|
n,
|
|
1639
1642
|
c
|
|
@@ -1644,7 +1647,7 @@ function lo({
|
|
|
1644
1647
|
const Rt = /* @__PURE__ */ rt(null), el = () => () => {
|
|
1645
1648
|
}, gn = () => 0;
|
|
1646
1649
|
function Ye(e) {
|
|
1647
|
-
const t = _e(Rt), n = e ?
|
|
1650
|
+
const t = _e(Rt), n = e ? Ii(e.Table) ?? null : t?.registry ?? null;
|
|
1648
1651
|
st(
|
|
1649
1652
|
n ? n.subscribe : el,
|
|
1650
1653
|
n ? n.bodyVersion : gn,
|
|
@@ -1672,7 +1675,7 @@ const nl = (e) => {
|
|
|
1672
1675
|
return t;
|
|
1673
1676
|
};
|
|
1674
1677
|
function ol(e, t) {
|
|
1675
|
-
const n =
|
|
1678
|
+
const n = W(null);
|
|
1676
1679
|
Z(() => {
|
|
1677
1680
|
const o = e.current;
|
|
1678
1681
|
if (!o) return;
|
|
@@ -1682,22 +1685,22 @@ function ol(e, t) {
|
|
|
1682
1685
|
if (i === 0 || typeof o.animate != "function") return;
|
|
1683
1686
|
const l = getComputedStyle(o).getPropertyValue("--u-ease-out").trim() || "ease-out", c = tl(s.positions, r);
|
|
1684
1687
|
for (const a of Array.from(o.querySelectorAll("tbody > tr[data-motion]"))) {
|
|
1685
|
-
const
|
|
1686
|
-
|
|
1688
|
+
const d = a.dataset.motion, u = c.get(d);
|
|
1689
|
+
u !== void 0 ? a.animate([{ transform: `translateY(${u}px)` }, { transform: "none" }], { duration: i, easing: l }) : s.positions.has(d) || a.animate([{ opacity: 0, transform: "translateY(-4px)" }, { opacity: 1, transform: "none" }], { duration: i, easing: l });
|
|
1687
1690
|
}
|
|
1688
1691
|
});
|
|
1689
1692
|
}
|
|
1690
1693
|
function rl(e, t, n) {
|
|
1691
|
-
const o =
|
|
1694
|
+
const o = W(t);
|
|
1692
1695
|
Z(() => {
|
|
1693
1696
|
const r = e.current, s = o.current;
|
|
1694
1697
|
if (o.current = t, !r || s === t || typeof r.animate != "function") return;
|
|
1695
1698
|
const i = ao(r, "--u-duration-medium");
|
|
1696
1699
|
if (i === 0) return;
|
|
1697
1700
|
const l = performance.now();
|
|
1698
|
-
let c = requestAnimationFrame(function a(
|
|
1699
|
-
const
|
|
1700
|
-
r.textContent = n(Math.round(s + (t - s) * b)),
|
|
1701
|
+
let c = requestAnimationFrame(function a(d) {
|
|
1702
|
+
const u = Math.min(1, (d - l) / i), b = 1 - (1 - u) ** 3;
|
|
1703
|
+
r.textContent = n(Math.round(s + (t - s) * b)), u < 1 && (c = requestAnimationFrame(a));
|
|
1701
1704
|
});
|
|
1702
1705
|
return () => {
|
|
1703
1706
|
cancelAnimationFrame(c), r.textContent = n(t);
|
|
@@ -1706,11 +1709,11 @@ function rl(e, t, n) {
|
|
|
1706
1709
|
}
|
|
1707
1710
|
const sl = (e) => e.controls + (e.span ? 1 : 0) + e.aggregates.length + (e.actions ? 1 : 0);
|
|
1708
1711
|
function co(e) {
|
|
1709
|
-
const { controls: t, span: n, aggregates: o, actions: r, blocks: s } = e, i = o.length, l = o.indexOf(!0), c = s.end > 0 ? s.end - (r ? 1 : 0) : 0, a = Math.max(n || i === 0 ? 0 : 1, Math.min(l === -1 ? i : l, i - c)),
|
|
1712
|
+
const { controls: t, span: n, aggregates: o, actions: r, blocks: s } = e, i = o.length, l = o.indexOf(!0), c = s.end > 0 ? s.end - (r ? 1 : 0) : 0, a = Math.max(n || i === 0 ? 0 : 1, Math.min(l === -1 ? i : l, i - c)), d = t + (n ? 1 : 0), u = s.start > 0 ? s.start - d : 0;
|
|
1710
1713
|
return {
|
|
1711
1714
|
lead: a,
|
|
1712
|
-
labelColumns: s.start > 0 ? Math.min(a,
|
|
1713
|
-
countColumns:
|
|
1715
|
+
labelColumns: s.start > 0 ? Math.min(a, u) : a,
|
|
1716
|
+
countColumns: u > 0 ? Math.min(a, u) : a
|
|
1714
1717
|
};
|
|
1715
1718
|
}
|
|
1716
1719
|
function bt(e, t) {
|
|
@@ -1722,12 +1725,12 @@ function bt(e, t) {
|
|
|
1722
1725
|
}
|
|
1723
1726
|
const Ue = (e) => `row:${e}`;
|
|
1724
1727
|
function il({ layout: e, body: t, rowKey: n, expanded: o, foot: r }) {
|
|
1725
|
-
const s = bt("cells", e), i = bt("whole", e), l = [{ key: "head", cells: s, at: -1 }], c = (a,
|
|
1726
|
-
const
|
|
1727
|
-
l.push({ key: Ue(
|
|
1728
|
+
const s = bt("cells", e), i = bt("whole", e), l = [{ key: "head", cells: s, at: -1 }], c = (a, d) => {
|
|
1729
|
+
const u = n(a);
|
|
1730
|
+
l.push({ key: Ue(u), cells: s, at: d, row: a }), o.has(u) && l.push({ key: `detail:${u}`, cells: i, at: d, row: a });
|
|
1728
1731
|
};
|
|
1729
|
-
return "rows" in t ? t.rows.forEach(c) : t.lines.forEach((a,
|
|
1730
|
-
a.kind === "row" ? c(a.row,
|
|
1732
|
+
return "rows" in t ? t.rows.forEach(c) : t.lines.forEach((a, d) => {
|
|
1733
|
+
a.kind === "row" ? c(a.row, d) : l.push({ key: `${a.kind}:${a.group.path}`, cells: bt(a.kind, e), at: d });
|
|
1731
1734
|
}), l.length === 1 && l.push({ key: "empty", cells: i, at: -1 }), r && l.push({ key: "foot", cells: s, at: -1 }), l;
|
|
1732
1735
|
}
|
|
1733
1736
|
function uo(e, t) {
|
|
@@ -1739,16 +1742,16 @@ function uo(e, t) {
|
|
|
1739
1742
|
}
|
|
1740
1743
|
return { index: 0, start: 0 };
|
|
1741
1744
|
}
|
|
1742
|
-
const
|
|
1745
|
+
const Ge = (e, t) => e.slice(0, t).reduce((n, o) => n + o, 0);
|
|
1743
1746
|
function ll(e, t, n, o) {
|
|
1744
1747
|
const r = e.length - 1, s = e[t.line];
|
|
1745
1748
|
if (!s) return t;
|
|
1746
1749
|
const { index: i } = uo(s.cells, t.column), l = (c) => ({ line: Math.max(0, Math.min(r, c)), column: t.column });
|
|
1747
1750
|
switch (n) {
|
|
1748
1751
|
case "left":
|
|
1749
|
-
return i > 0 ? { line: t.line, column:
|
|
1752
|
+
return i > 0 ? { line: t.line, column: Ge(s.cells, i - 1) } : t;
|
|
1750
1753
|
case "right":
|
|
1751
|
-
return i < s.cells.length - 1 ? { line: t.line, column:
|
|
1754
|
+
return i < s.cells.length - 1 ? { line: t.line, column: Ge(s.cells, i + 1) } : t;
|
|
1752
1755
|
case "up":
|
|
1753
1756
|
return l(t.line - 1);
|
|
1754
1757
|
case "down":
|
|
@@ -1760,15 +1763,15 @@ function ll(e, t, n, o) {
|
|
|
1760
1763
|
case "lineStart":
|
|
1761
1764
|
return { line: t.line, column: 0 };
|
|
1762
1765
|
case "lineEnd":
|
|
1763
|
-
return { line: t.line, column:
|
|
1766
|
+
return { line: t.line, column: Ge(s.cells, s.cells.length - 1) };
|
|
1764
1767
|
case "first":
|
|
1765
1768
|
return { line: 0, column: 0 };
|
|
1766
1769
|
case "last":
|
|
1767
|
-
return { line: r, column:
|
|
1770
|
+
return { line: r, column: Ge(e[r].cells, e[r].cells.length - 1) };
|
|
1768
1771
|
}
|
|
1769
1772
|
}
|
|
1770
1773
|
function al(e, t, n, o) {
|
|
1771
|
-
const r = e.flatMap((l, c) => l.cells.map((a,
|
|
1774
|
+
const r = e.flatMap((l, c) => l.cells.map((a, d) => ({ line: c, column: Ge(l.cells, d) }))), s = r.findIndex((l) => l.line === t.line && l.column === uo(e[t.line].cells, t.column).start);
|
|
1772
1775
|
return (n ? r.slice(0, Math.max(0, s)).reverse() : r.slice(s + 1)).find(o) ?? null;
|
|
1773
1776
|
}
|
|
1774
1777
|
function pn(e, t, n) {
|
|
@@ -1788,8 +1791,8 @@ class cl {
|
|
|
1788
1791
|
return n && (this.wish = null), n;
|
|
1789
1792
|
}
|
|
1790
1793
|
}
|
|
1791
|
-
function
|
|
1792
|
-
const [e, t] =
|
|
1794
|
+
function ul() {
|
|
1795
|
+
const [e, t] = V({ active: null, widget: !1, editing: null }), [n] = V(() => new cl());
|
|
1793
1796
|
return { state: e, setState: t, focus: n };
|
|
1794
1797
|
}
|
|
1795
1798
|
const mn = (e) => e?.spec.edit !== void 0;
|
|
@@ -1797,57 +1800,57 @@ function fo(e, t) {
|
|
|
1797
1800
|
const n = (o) => se(o) || o === "" ? null : o instanceof Date ? o.getTime() : o;
|
|
1798
1801
|
return Object.is(n(e), n(t));
|
|
1799
1802
|
}
|
|
1800
|
-
function
|
|
1801
|
-
const { grid: t, lines: n, ids: o, columnById: r, rowKey: s, onCellEdit: i, rowMode: l, onRowSave: c, onRowAdd: a, newRow:
|
|
1802
|
-
const O = n[
|
|
1803
|
+
function dl(e) {
|
|
1804
|
+
const { grid: t, lines: n, ids: o, columnById: r, rowKey: s, onCellEdit: i, rowMode: l, onRowSave: c, onRowAdd: a, newRow: d } = e, { setState: u } = t, b = n.map((k) => k.key), p = t.state.editing, m = (k) => k === he ? p?.fresh : n.find((O) => O.key === k)?.row, w = (k) => {
|
|
1805
|
+
const O = n[k.line];
|
|
1803
1806
|
return O?.key === he ? { row: O.row } : O?.row !== void 0 && O.key === Ue(s(O.row)) ? { row: O.row } : null;
|
|
1804
|
-
}, g = (
|
|
1805
|
-
const R = n[
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
active: { line: R.key, column: E.spec.id, lineIndex:
|
|
1809
|
-
editing: { line: R.key, column: E.spec.id, row: l, drafts:
|
|
1807
|
+
}, g = (k) => w(k) !== null && mn(r(o[k.column] ?? "")), v = () => o.map(r).filter(mn), x = (k, O, M = !1) => {
|
|
1808
|
+
const R = n[k.line], E = r(o[k.column] ?? ""), B = l ? Object.fromEntries(v().map((I) => [I.spec.id, I.read(R.row)])) : {};
|
|
1809
|
+
B[E.spec.id] = O === void 0 ? E.read(R.row) : O, t.focus.want(M ? "open" : "editor"), u((I) => ({
|
|
1810
|
+
...I,
|
|
1811
|
+
active: { line: R.key, column: E.spec.id, lineIndex: k.line, columnIndex: k.column },
|
|
1812
|
+
editing: { line: R.key, column: E.spec.id, row: l, drafts: B, errors: {}, refused: !1 }
|
|
1810
1813
|
}));
|
|
1811
|
-
}, y = (
|
|
1814
|
+
}, y = (k = {}, O = !0) => {
|
|
1812
1815
|
if (!p) return !0;
|
|
1813
|
-
const M = { ...p.drafts, ...
|
|
1816
|
+
const M = { ...p.drafts, ...k }, R = m(p.line);
|
|
1814
1817
|
if (R === void 0)
|
|
1815
|
-
return
|
|
1818
|
+
return u((D) => ({ ...D, editing: null })), !0;
|
|
1816
1819
|
const E = {};
|
|
1817
|
-
for (const [
|
|
1818
|
-
const Y = r(
|
|
1819
|
-
Y && (E[
|
|
1820
|
+
for (const [D, z] of Object.entries(M)) {
|
|
1821
|
+
const Y = r(D)?.spec.validate?.(z, R);
|
|
1822
|
+
Y && (E[D] = Y);
|
|
1820
1823
|
}
|
|
1821
|
-
const
|
|
1822
|
-
if (
|
|
1823
|
-
const
|
|
1824
|
-
return O && t.focus.want("editor"),
|
|
1825
|
-
...
|
|
1826
|
-
active: { line: p.line, column:
|
|
1827
|
-
editing:
|
|
1824
|
+
const B = Object.keys(M).find((D) => E[D] !== void 0);
|
|
1825
|
+
if (B !== void 0) {
|
|
1826
|
+
const D = p.row ? B : p.column;
|
|
1827
|
+
return O && t.focus.want("editor"), u((z) => ({
|
|
1828
|
+
...z,
|
|
1829
|
+
active: { line: p.line, column: D, lineIndex: Math.max(0, b.indexOf(p.line)), columnIndex: o.indexOf(D) },
|
|
1830
|
+
editing: z.editing && { ...z.editing, column: D, drafts: M, errors: E, refused: !1 }
|
|
1828
1831
|
})), !1;
|
|
1829
1832
|
}
|
|
1830
|
-
const
|
|
1831
|
-
return p.line === he ? a?.({ values: M }) : p.row ?
|
|
1832
|
-
}, _ = (
|
|
1833
|
-
t.focus.want("cell"),
|
|
1834
|
-
},
|
|
1835
|
-
t.focus.want("editor"),
|
|
1833
|
+
const I = Object.keys(M).filter((D) => !fo(M[D], r(D)?.read(R)));
|
|
1834
|
+
return p.line === he ? a?.({ values: M }) : p.row ? I.length > 0 && c?.({ rowKey: s(R), changes: Object.fromEntries(I.map((D) => [D, M[D]])), row: R }) : I.length > 0 && i?.({ rowKey: s(R), columnId: p.column, value: M[p.column], row: R }), O && t.focus.want("cell"), u((D) => ({ ...D, editing: null })), !0;
|
|
1835
|
+
}, _ = (k, O) => y({ [k]: O }), S = () => {
|
|
1836
|
+
t.focus.want("cell"), u((k) => ({ ...k, editing: null }));
|
|
1837
|
+
}, C = () => {
|
|
1838
|
+
t.focus.want("editor"), u((k) => k.editing ? { ...k, editing: { ...k.editing, refused: !0 } } : k);
|
|
1836
1839
|
};
|
|
1837
|
-
return { rowAt: w, editable: g, startEdit:
|
|
1840
|
+
return { rowAt: w, editable: g, startEdit: x, save: y, commit: _, discard: S, refuse: C, setDraft: (k, O) => u((M) => {
|
|
1838
1841
|
if (!M.editing) return M;
|
|
1839
1842
|
const R = { ...M.editing.errors };
|
|
1840
|
-
if (R[
|
|
1841
|
-
const E = r(
|
|
1842
|
-
E ? R[
|
|
1843
|
+
if (R[k] !== void 0) {
|
|
1844
|
+
const E = r(k)?.spec.validate?.(O, m(M.editing.line));
|
|
1845
|
+
E ? R[k] = E : delete R[k];
|
|
1843
1846
|
}
|
|
1844
|
-
return { ...M, editing: { ...M.editing, drafts: { ...M.editing.drafts, [
|
|
1847
|
+
return { ...M, editing: { ...M.editing, drafts: { ...M.editing.drafts, [k]: O }, errors: R, refused: !1 } };
|
|
1845
1848
|
}), addRow: () => {
|
|
1846
|
-
if (p && (p.row || !y())) return
|
|
1847
|
-
const
|
|
1849
|
+
if (p && (p.row || !y())) return C();
|
|
1850
|
+
const k = v(), O = k[0];
|
|
1848
1851
|
if (!O) return;
|
|
1849
|
-
const M =
|
|
1850
|
-
t.focus.want("editor"),
|
|
1852
|
+
const M = d?.() ?? {};
|
|
1853
|
+
t.focus.want("editor"), u((R) => ({
|
|
1851
1854
|
...R,
|
|
1852
1855
|
widget: !1,
|
|
1853
1856
|
active: { line: he, column: O.spec.id, lineIndex: 1, columnIndex: o.indexOf(O.spec.id) },
|
|
@@ -1856,7 +1859,7 @@ function ul(e) {
|
|
|
1856
1859
|
column: O.spec.id,
|
|
1857
1860
|
row: !0,
|
|
1858
1861
|
/* What `newRow` leaves out is empty - `null`, as an emptied field says it. */
|
|
1859
|
-
drafts: Object.fromEntries(
|
|
1862
|
+
drafts: Object.fromEntries(k.map((E) => [E.spec.id, E.read(M) ?? null])),
|
|
1860
1863
|
errors: {},
|
|
1861
1864
|
refused: !1,
|
|
1862
1865
|
fresh: M
|
|
@@ -1864,19 +1867,19 @@ function ul(e) {
|
|
|
1864
1867
|
}));
|
|
1865
1868
|
} };
|
|
1866
1869
|
}
|
|
1867
|
-
const
|
|
1868
|
-
function
|
|
1870
|
+
const jt = 'a[href], button, input, select, textarea, [tabindex], [contenteditable="true"]';
|
|
1871
|
+
function Ht(e) {
|
|
1869
1872
|
let t = 0;
|
|
1870
1873
|
return Array.from(e.cells).map((n) => {
|
|
1871
1874
|
const o = { cell: n, start: t, end: t + n.colSpan };
|
|
1872
1875
|
return t = o.end, o;
|
|
1873
1876
|
});
|
|
1874
1877
|
}
|
|
1875
|
-
function
|
|
1878
|
+
function Wt(e, t) {
|
|
1876
1879
|
if (!(t instanceof Element)) return null;
|
|
1877
1880
|
const n = t.closest("td, th"), o = n?.parentElement, r = o?.dataset.gridLine;
|
|
1878
1881
|
if (!n || !o || r === void 0 || o.closest("table") !== e) return null;
|
|
1879
|
-
const { start: s, end: i } =
|
|
1882
|
+
const { start: s, end: i } = Ht(o).find((l) => l.cell === n);
|
|
1880
1883
|
return { cell: n, line: r, column: s, end: i };
|
|
1881
1884
|
}
|
|
1882
1885
|
const fl = {
|
|
@@ -1900,29 +1903,29 @@ function gl({ grid: e, lines: t, ids: n, virtual: o }, r, s) {
|
|
|
1900
1903
|
const i = t[s.line];
|
|
1901
1904
|
if (!i) return;
|
|
1902
1905
|
e.setState((a) => ({ ...a, widget: !1, active: { line: i.key, column: n[s.column] ?? "", lineIndex: s.line, columnIndex: s.column } }));
|
|
1903
|
-
const l = Array.from(r.querySelectorAll("tr[data-grid-line]")).find((a) => a.dataset.gridLine === i.key), c = l ?
|
|
1906
|
+
const l = Array.from(r.querySelectorAll("tr[data-grid-line]")).find((a) => a.dataset.gridLine === i.key), c = l ? Ht(l).find((a) => s.column >= a.start && s.column < a.end)?.cell : void 0;
|
|
1904
1907
|
c ? c.focus({ preventScroll: i.key === "head" }) : (e.focus.want("cell"), o && i.at >= 0 && o.showRow(i.at));
|
|
1905
1908
|
}
|
|
1906
1909
|
function pl(e, t, n) {
|
|
1907
|
-
const { grid: o, lines: r, ids: s, columnById: i, select: l } = e, { rowAt: c, editable: a, startEdit:
|
|
1910
|
+
const { grid: o, lines: r, ids: s, columnById: i, select: l } = e, { rowAt: c, editable: a, startEdit: d, save: u, discard: b } = t, p = r.map((y) => y.key), m = o.state.editing, w = n.currentTarget;
|
|
1908
1911
|
if (n.defaultPrevented) return;
|
|
1909
|
-
const g =
|
|
1912
|
+
const g = Wt(w, n.target);
|
|
1910
1913
|
if (!g) return;
|
|
1911
1914
|
const v = { line: p.indexOf(g.line), column: ho(g, o.state.active) };
|
|
1912
1915
|
if (v.line < 0) return;
|
|
1913
1916
|
if (m?.row && m.line === g.line) {
|
|
1914
|
-
n.key === "Escape" ? (n.preventDefault(), b()) : n.key === "Enter" && !(n.target instanceof HTMLButtonElement) && (n.preventDefault(),
|
|
1917
|
+
n.key === "Escape" ? (n.preventDefault(), b()) : n.key === "Enter" && !(n.target instanceof HTMLButtonElement) && (n.preventDefault(), u());
|
|
1915
1918
|
return;
|
|
1916
1919
|
}
|
|
1917
1920
|
if (m && m.line === g.line && m.column === s[g.column]) {
|
|
1918
1921
|
if (n.key === "Escape")
|
|
1919
1922
|
n.preventDefault(), b();
|
|
1920
1923
|
else if (n.key === "Enter" && !(n.target instanceof HTMLButtonElement))
|
|
1921
|
-
n.preventDefault(),
|
|
1924
|
+
n.preventDefault(), u();
|
|
1922
1925
|
else if (n.key === "Tab") {
|
|
1923
|
-
const y = al(r, v, n.shiftKey, a), _ =
|
|
1926
|
+
const y = al(r, v, n.shiftKey, a), _ = u();
|
|
1924
1927
|
if ((y || !_) && n.preventDefault(), !_) return;
|
|
1925
|
-
y ?
|
|
1928
|
+
y ? d(y) : o.focus.want(null);
|
|
1926
1929
|
}
|
|
1927
1930
|
return;
|
|
1928
1931
|
}
|
|
@@ -1931,9 +1934,9 @@ function pl(e, t, n) {
|
|
|
1931
1934
|
return;
|
|
1932
1935
|
}
|
|
1933
1936
|
if (n.altKey || n.metaKey) return;
|
|
1934
|
-
const
|
|
1935
|
-
if (
|
|
1936
|
-
n.preventDefault(), gl(e, w, ll(r, v,
|
|
1937
|
+
const x = n.ctrlKey ? { Home: "first", End: "last" }[n.key] : fl[n.key];
|
|
1938
|
+
if (x) {
|
|
1939
|
+
n.preventDefault(), gl(e, w, ll(r, v, x, hl(g.cell, w)));
|
|
1937
1940
|
return;
|
|
1938
1941
|
}
|
|
1939
1942
|
if (!n.ctrlKey) {
|
|
@@ -1944,43 +1947,43 @@ function pl(e, t, n) {
|
|
|
1944
1947
|
}
|
|
1945
1948
|
if (n.key === "Enter" || n.key === "F2") {
|
|
1946
1949
|
if (a(v)) {
|
|
1947
|
-
n.preventDefault(),
|
|
1950
|
+
n.preventDefault(), d(v);
|
|
1948
1951
|
return;
|
|
1949
1952
|
}
|
|
1950
|
-
const y = g.cell.querySelector(
|
|
1953
|
+
const y = g.cell.querySelector(jt);
|
|
1951
1954
|
y && (n.preventDefault(), o.setState((_) => ({ ..._, widget: !0 })), y.focus());
|
|
1952
1955
|
return;
|
|
1953
1956
|
}
|
|
1954
1957
|
if (n.key.length === 1 && a(v)) {
|
|
1955
1958
|
const y = i(s[g.column] ?? "")?.spec.edit;
|
|
1956
|
-
n.preventDefault(),
|
|
1959
|
+
n.preventDefault(), d(v, y === "text" ? n.key : y === "number" && /\d/.test(n.key) ? Number(n.key) : void 0);
|
|
1957
1960
|
}
|
|
1958
1961
|
}
|
|
1959
1962
|
}
|
|
1960
1963
|
function ml({ grid: e, lines: t }, { editable: n, startEdit: o }, r) {
|
|
1961
1964
|
if (r.button !== 0 || e.state.editing) return;
|
|
1962
|
-
const s =
|
|
1963
|
-
if (!s || r.target.closest(
|
|
1965
|
+
const s = Wt(r.currentTarget, r.target);
|
|
1966
|
+
if (!s || r.target.closest(jt) !== s.cell) return;
|
|
1964
1967
|
const i = { line: t.findIndex((l) => l.key === s.line), column: s.column };
|
|
1965
1968
|
i.line >= 0 && n(i) && o(i, void 0, !0);
|
|
1966
1969
|
}
|
|
1967
1970
|
function wl({ grid: e, lines: t, ids: n }, { save: o, refuse: r }, s) {
|
|
1968
|
-
const i = e.state.editing, l =
|
|
1971
|
+
const i = e.state.editing, l = Wt(s.currentTarget, s.target);
|
|
1969
1972
|
if (!l) return;
|
|
1970
|
-
const c = t.findIndex((
|
|
1973
|
+
const c = t.findIndex((d) => d.key === l.line), a = n[l.column] ?? "";
|
|
1971
1974
|
if (i?.row) {
|
|
1972
1975
|
if (i.line !== l.line) return r();
|
|
1973
|
-
a in i.drafts && a !== i.column && e.setState((
|
|
1976
|
+
a in i.drafts && a !== i.column && e.setState((d) => ({ ...d, editing: d.editing && { ...d.editing, column: a } }));
|
|
1974
1977
|
} else if (i && (i.line !== l.line || i.column !== a) && !o()) {
|
|
1975
1978
|
e.focus.want("editor");
|
|
1976
1979
|
return;
|
|
1977
1980
|
}
|
|
1978
|
-
e.focus.want(null), e.setState((
|
|
1979
|
-
const
|
|
1981
|
+
e.focus.want(null), e.setState((d) => {
|
|
1982
|
+
const u = ho(l, d.active);
|
|
1980
1983
|
return {
|
|
1981
|
-
...
|
|
1984
|
+
...d,
|
|
1982
1985
|
widget: s.target !== l.cell,
|
|
1983
|
-
active: { line: l.line, column: n[
|
|
1986
|
+
active: { line: l.line, column: n[u] ?? "", lineIndex: Math.max(0, c), columnIndex: u }
|
|
1984
1987
|
};
|
|
1985
1988
|
});
|
|
1986
1989
|
}
|
|
@@ -1988,7 +1991,7 @@ function bl({ grid: e }, t) {
|
|
|
1988
1991
|
t.currentTarget.contains(t.relatedTarget) || e.setState((n) => n.widget ? { ...n, widget: !1 } : n);
|
|
1989
1992
|
}
|
|
1990
1993
|
function vl(e) {
|
|
1991
|
-
const { grid: t, rowKey: n, onRowDelete: o } = e, r =
|
|
1994
|
+
const { grid: t, rowKey: n, onRowDelete: o } = e, r = dl(e), { save: s, discard: i, commit: l, setDraft: c, editable: a, addRow: d } = r, u = {
|
|
1992
1995
|
editing: t.state.editing,
|
|
1993
1996
|
setDraft: c,
|
|
1994
1997
|
commit: l,
|
|
@@ -2001,27 +2004,27 @@ function vl(e) {
|
|
|
2001
2004
|
onClick: (m) => ml(e, r, m),
|
|
2002
2005
|
onFocus: (m) => wl(e, r, m),
|
|
2003
2006
|
onBlur: (m) => bl(e, m),
|
|
2004
|
-
context:
|
|
2007
|
+
context: u,
|
|
2005
2008
|
editable: a,
|
|
2006
|
-
addRow:
|
|
2009
|
+
addRow: d,
|
|
2007
2010
|
outside: p
|
|
2008
2011
|
};
|
|
2009
2012
|
}
|
|
2010
|
-
const
|
|
2013
|
+
const Pe = /* @__PURE__ */ rt(null);
|
|
2011
2014
|
function yl(e, t) {
|
|
2012
|
-
const n = _e(
|
|
2015
|
+
const n = _e(Pe), o = n?.editing;
|
|
2013
2016
|
return o && o.line === e && t in o.drafts ? n : null;
|
|
2014
2017
|
}
|
|
2015
|
-
const
|
|
2018
|
+
const ze = "data-grid-tabindex";
|
|
2016
2019
|
function _l(e, t) {
|
|
2017
|
-
if (t && !e.hasAttribute(
|
|
2018
|
-
e.setAttribute(
|
|
2019
|
-
else if (!t && e.hasAttribute(
|
|
2020
|
-
const n = e.getAttribute(
|
|
2021
|
-
n === "" ? e.removeAttribute("tabindex") : e.setAttribute("tabindex", n), e.removeAttribute(
|
|
2020
|
+
if (t && !e.hasAttribute(ze))
|
|
2021
|
+
e.setAttribute(ze, e.getAttribute("tabindex") ?? ""), e.tabIndex = -1;
|
|
2022
|
+
else if (!t && e.hasAttribute(ze)) {
|
|
2023
|
+
const n = e.getAttribute(ze);
|
|
2024
|
+
n === "" ? e.removeAttribute("tabindex") : e.setAttribute("tabindex", n), e.removeAttribute(ze);
|
|
2022
2025
|
}
|
|
2023
2026
|
}
|
|
2024
|
-
function
|
|
2027
|
+
function kl({
|
|
2025
2028
|
table: e,
|
|
2026
2029
|
grid: t,
|
|
2027
2030
|
lines: n,
|
|
@@ -2029,49 +2032,49 @@ function xl({
|
|
|
2029
2032
|
editable: r,
|
|
2030
2033
|
outside: s
|
|
2031
2034
|
}) {
|
|
2032
|
-
const i =
|
|
2035
|
+
const i = W(s);
|
|
2033
2036
|
Z(() => {
|
|
2034
2037
|
i.current = s;
|
|
2035
2038
|
});
|
|
2036
2039
|
const l = s !== void 0;
|
|
2037
|
-
return
|
|
2040
|
+
return xe(() => {
|
|
2038
2041
|
const c = e.current;
|
|
2039
2042
|
if (!l || !c) return;
|
|
2040
|
-
const a = (
|
|
2041
|
-
for (let
|
|
2042
|
-
if (
|
|
2043
|
+
const a = (d) => {
|
|
2044
|
+
for (let u = d.target instanceof Element ? d.target : null; u; u = u.parentElement)
|
|
2045
|
+
if (u === c || u.id && c.querySelector(`[aria-controls="${CSS.escape(u.id)}"]`)) return;
|
|
2043
2046
|
i.current?.();
|
|
2044
2047
|
};
|
|
2045
2048
|
return document.addEventListener("mousedown", a), () => document.removeEventListener("mousedown", a);
|
|
2046
2049
|
}, [l, e]), Z(() => {
|
|
2047
2050
|
const c = e.current;
|
|
2048
2051
|
if (!c) return;
|
|
2049
|
-
const { active: a, widget:
|
|
2052
|
+
const { active: a, widget: d, editing: u } = t.state, b = Sl(a, n, o), p = n[b.line]?.key, m = new Map(n.map((y, _) => [y.key, _]));
|
|
2050
2053
|
let w = null, g = null;
|
|
2051
2054
|
for (const y of Array.from(c.querySelectorAll("tr[data-grid-line]"))) {
|
|
2052
|
-
const _ = y.dataset.gridLine,
|
|
2053
|
-
for (const { cell:
|
|
2054
|
-
const
|
|
2055
|
-
|
|
2056
|
-
const O =
|
|
2057
|
-
for (const M of Array.from(
|
|
2055
|
+
const _ = y.dataset.gridLine, S = Ht(y);
|
|
2056
|
+
for (const { cell: C, start: A, end: L } of S) {
|
|
2057
|
+
const k = b.column >= A && b.column < L || C === S.at(-1).cell && b.column >= L;
|
|
2058
|
+
k && _ === p && (w = C), k && g === null && _ !== "head" && (g = C), C.tabIndex = -1, r && _ !== "head" && !r({ line: m.get(_) ?? -1, column: A }) ? C.setAttribute("aria-readonly", "true") : C.removeAttribute("aria-readonly");
|
|
2059
|
+
const O = u?.row === !0 && u.line === _ || C === w && (d || u !== null && u.line === _);
|
|
2060
|
+
for (const M of Array.from(C.querySelectorAll(jt))) _l(M, !O);
|
|
2058
2061
|
}
|
|
2059
2062
|
}
|
|
2060
2063
|
const v = w ?? g ?? c.querySelector("tr[data-grid-line] > *");
|
|
2061
|
-
v && !(
|
|
2062
|
-
const
|
|
2063
|
-
if (
|
|
2064
|
+
v && !(u?.row && v.parentElement?.dataset.gridLine === u.line) && (v.tabIndex = 0);
|
|
2065
|
+
const x = t.focus.take(w !== null);
|
|
2066
|
+
if (x === "editor" || x === "open") {
|
|
2064
2067
|
const y = w?.querySelector("input, select, textarea, button");
|
|
2065
|
-
if (y?.focus(), y instanceof HTMLInputElement && y.type === "text" && y.setSelectionRange(y.value.length, y.value.length),
|
|
2068
|
+
if (y?.focus(), y instanceof HTMLInputElement && y.type === "text" && y.setSelectionRange(y.value.length, y.value.length), x === "open" && y instanceof HTMLSelectElement)
|
|
2066
2069
|
try {
|
|
2067
2070
|
y.showPicker();
|
|
2068
2071
|
} catch {
|
|
2069
2072
|
}
|
|
2070
|
-
else
|
|
2071
|
-
} else
|
|
2073
|
+
else x === "open" && y instanceof HTMLButtonElement && y.click();
|
|
2074
|
+
} else x === "cell" && w?.focus();
|
|
2072
2075
|
}), null;
|
|
2073
2076
|
}
|
|
2074
|
-
function
|
|
2077
|
+
function Sl(e, t, n) {
|
|
2075
2078
|
return e ? {
|
|
2076
2079
|
line: pn(
|
|
2077
2080
|
t.map((o) => o.key),
|
|
@@ -2081,34 +2084,34 @@ function kl(e, t, n) {
|
|
|
2081
2084
|
column: pn(n, e.column, e.columnIndex)
|
|
2082
2085
|
} : { line: Math.min(1, t.length - 1), column: 0 };
|
|
2083
2086
|
}
|
|
2084
|
-
function
|
|
2085
|
-
const r =
|
|
2087
|
+
function Cl({ entry: e, row: t, rowName: n, grid: o }) {
|
|
2088
|
+
const r = ke(), s = W(null), { spec: i } = e, l = o.editing, c = i.id, a = l.drafts[c], d = l.errors[c] ?? null, u = (m) => o.setDraft(c, m), b = o.wording.editCell(i.label, n);
|
|
2086
2089
|
let p;
|
|
2087
2090
|
if (typeof i.edit == "function")
|
|
2088
2091
|
p = i.edit({
|
|
2089
2092
|
value: a,
|
|
2090
|
-
onChange:
|
|
2093
|
+
onChange: u,
|
|
2091
2094
|
commit: (m) => o.commit(c, m === void 0 ? a : m),
|
|
2092
2095
|
row: t,
|
|
2093
|
-
invalid:
|
|
2096
|
+
invalid: d !== null,
|
|
2094
2097
|
label: b
|
|
2095
2098
|
});
|
|
2096
2099
|
else if (i.edit === "number")
|
|
2097
|
-
p = /* @__PURE__ */ f(yt, { size: "sm", value: typeof a == "number" ? a : null, onChange:
|
|
2100
|
+
p = /* @__PURE__ */ f(yt, { size: "sm", value: typeof a == "number" ? a : null, onChange: u });
|
|
2098
2101
|
else if (i.edit === "date")
|
|
2099
|
-
p = /* @__PURE__ */ f(
|
|
2102
|
+
p = /* @__PURE__ */ f(qo, { size: "sm", value: a instanceof Date ? a : null, onChange: (m) => l.row ? u(m) : o.commit(c, m) });
|
|
2100
2103
|
else if (i.edit === "select") {
|
|
2101
2104
|
const m = i.editOptions ?? At(o.hook.admitted, e.read, r).values, w = m.findIndex((g) => fo(g, a));
|
|
2102
|
-
p = /* @__PURE__ */ T(Rn, { size: "sm", value: w < 0 ? "" : String(w), onChange: (g) =>
|
|
2105
|
+
p = /* @__PURE__ */ T(Rn, { size: "sm", value: w < 0 ? "" : String(w), onChange: (g) => u(m[Number(g.target.value)]), children: [
|
|
2103
2106
|
w < 0 && /* @__PURE__ */ f("option", { value: "" }),
|
|
2104
2107
|
m.map((g, v) => /* @__PURE__ */ f("option", { value: v, children: g instanceof Date ? r.date(g) : String(g) }, v))
|
|
2105
2108
|
] });
|
|
2106
2109
|
} else
|
|
2107
|
-
p = /* @__PURE__ */ f(On, { size: "sm", value: se(a) ? "" : String(a), onChange: (m) =>
|
|
2110
|
+
p = /* @__PURE__ */ f(On, { size: "sm", value: se(a) ? "" : String(a), onChange: (m) => u(m.target.value) });
|
|
2108
2111
|
return /* @__PURE__ */ T("div", { ref: s, className: h.editor, children: [
|
|
2109
|
-
/* @__PURE__ */ f(vt, { className: h.editorField, label: /* @__PURE__ */ f(Oe, { children: b }), error:
|
|
2110
|
-
/* @__PURE__ */ f(it, { open:
|
|
2111
|
-
}, anchorRef: s, restoreFocus: !1, offset: 4, className: h.editorMessage, children: /* @__PURE__ */ f("span", { "aria-hidden": "true", children:
|
|
2112
|
+
/* @__PURE__ */ f(vt, { className: h.editorField, label: /* @__PURE__ */ f(Oe, { children: b }), error: d ?? void 0, children: p }),
|
|
2113
|
+
/* @__PURE__ */ f(it, { open: d !== null, onOpenChange: () => {
|
|
2114
|
+
}, anchorRef: s, restoreFocus: !1, offset: 4, className: h.editorMessage, children: /* @__PURE__ */ f("span", { "aria-hidden": "true", children: d }) })
|
|
2112
2115
|
] });
|
|
2113
2116
|
}
|
|
2114
2117
|
function go({ wording: e }) {
|
|
@@ -2117,7 +2120,7 @@ function go({ wording: e }) {
|
|
|
2117
2120
|
/* @__PURE__ */ f(Oe, { children: e.cellAbsentValue })
|
|
2118
2121
|
] });
|
|
2119
2122
|
}
|
|
2120
|
-
const
|
|
2123
|
+
const xl = { sum: "Σ", avg: "⌀", min: "min", max: "max" }, Al = (e, t) => ({
|
|
2121
2124
|
sum: t.footerSum,
|
|
2122
2125
|
avg: t.footerAverage,
|
|
2123
2126
|
min: t.footerMinimum,
|
|
@@ -2132,15 +2135,15 @@ function po(e, t, n) {
|
|
|
2132
2135
|
r || wn.set(t, r = /* @__PURE__ */ new Map());
|
|
2133
2136
|
const s = r.get(e), i = e.spec.value, l = e.spec.rightAligned;
|
|
2134
2137
|
if (s && s.spec === o && s.reader === i && s.aligned === l) return s;
|
|
2135
|
-
const c = n ? n.value :
|
|
2138
|
+
const c = n ? n.value : $t({ id: e.spec.id, read: e.read, aggregate: o }, t);
|
|
2136
2139
|
let a = 0;
|
|
2137
2140
|
if ((o === "sum" || o === "avg") && typeof c == "number")
|
|
2138
2141
|
for (const b of t) {
|
|
2139
2142
|
const p = e.read(b);
|
|
2140
2143
|
Nl(p) && (a = Math.max(a, Tl(p)));
|
|
2141
2144
|
}
|
|
2142
|
-
const
|
|
2143
|
-
return r.set(e,
|
|
2145
|
+
const d = o === "count" || o === "distinct" || (l ?? Mn(t, e.read) === "number"), u = { spec: o, reader: i, aligned: l, value: c, places: a, numeric: d };
|
|
2146
|
+
return r.set(e, u), u;
|
|
2144
2147
|
}
|
|
2145
2148
|
function Ot({
|
|
2146
2149
|
entry: e,
|
|
@@ -2152,20 +2155,20 @@ function Ot({
|
|
|
2152
2155
|
}) {
|
|
2153
2156
|
const { aggregate: i, format: l, presentation: c } = e.spec;
|
|
2154
2157
|
if (!i) return null;
|
|
2155
|
-
const a = typeof i == "function" ? "own" : i, { value:
|
|
2158
|
+
const a = typeof i == "function" ? "own" : i, { value: d, places: u } = po(e, t, s), b = (w) => De(w, l, n, o);
|
|
2156
2159
|
let p;
|
|
2157
|
-
if (se(
|
|
2158
|
-
else if ((a === "sum" || a === "avg") && l === void 0 && typeof
|
|
2159
|
-
p = n.number(
|
|
2160
|
-
else if (a === "range" && l === "date" && Rl(
|
|
2161
|
-
const [w, g] =
|
|
2160
|
+
if (se(d)) p = /* @__PURE__ */ f(go, { wording: o });
|
|
2161
|
+
else if ((a === "sum" || a === "avg") && l === void 0 && typeof d == "number")
|
|
2162
|
+
p = n.number(d, Math.min(10, a === "avg" ? u + 1 : u));
|
|
2163
|
+
else if (a === "range" && l === "date" && Rl(d)) {
|
|
2164
|
+
const [w, g] = d;
|
|
2162
2165
|
p = w.getTime() === g.getTime() ? n.date(w) : o.rangeFromTo(n.dateShort(w), n.dateShort(g));
|
|
2163
|
-
} else if (a === "count" || a === "distinct") p = n.count(
|
|
2166
|
+
} else if (a === "count" || a === "distinct") p = n.count(d);
|
|
2164
2167
|
else if (a === "range") {
|
|
2165
|
-
const [w, g] =
|
|
2168
|
+
const [w, g] = d;
|
|
2166
2169
|
p = b(w) === b(g) ? b(w) : o.rangeFromTo(b(w) ?? "", b(g) ?? "");
|
|
2167
|
-
} else a === "own" && c ? p = c(
|
|
2168
|
-
const m =
|
|
2170
|
+
} else a === "own" && c ? p = c(d, t[0]) : p = b(d);
|
|
2171
|
+
const m = xl[a];
|
|
2169
2172
|
return /* @__PURE__ */ T(re, { children: [
|
|
2170
2173
|
r && m && /* @__PURE__ */ f("span", { "aria-hidden": "true", className: h.footerKind, children: m }),
|
|
2171
2174
|
r && /* @__PURE__ */ T(Oe, { children: [
|
|
@@ -2188,7 +2191,7 @@ function ct(e, t, n = t) {
|
|
|
2188
2191
|
if (!o) return wo;
|
|
2189
2192
|
const r = o.side === "start";
|
|
2190
2193
|
return {
|
|
2191
|
-
className:
|
|
2194
|
+
className: F(h.pinned, o.edge && (r ? h.pinStartEdge : h.pinEndEdge)),
|
|
2192
2195
|
/* The scroll area keeps a padding as wide as the block for the browser's
|
|
2193
2196
|
scroll into view; a pinned cell lies inside it and would scroll the
|
|
2194
2197
|
table back to its start when focused. Its target is shifted out of the
|
|
@@ -2204,16 +2207,16 @@ function ct(e, t, n = t) {
|
|
|
2204
2207
|
}
|
|
2205
2208
|
};
|
|
2206
2209
|
}
|
|
2207
|
-
function
|
|
2210
|
+
function ut(e, t, n, o) {
|
|
2208
2211
|
if (t === void 0) return o.groupNoValue;
|
|
2209
2212
|
const r = e?.spec;
|
|
2210
2213
|
if (r?.group && t instanceof Date) return Yo(r.group, t, n, o);
|
|
2211
2214
|
const s = r?.ownGroupValue ? void 0 : r?.format;
|
|
2212
|
-
return
|
|
2215
|
+
return De(t, s, n, o) ?? String(t);
|
|
2213
2216
|
}
|
|
2214
2217
|
function Et({ entry: e, group: t, formats: n, wording: o }) {
|
|
2215
2218
|
const r = e?.spec;
|
|
2216
|
-
return t.value !== void 0 && r?.presentation && !r.ownGroupValue && !r.group ? /* @__PURE__ */ f(re, { children: r.presentation(t.value, t.rows[0]) }) : /* @__PURE__ */ f(re, { children:
|
|
2219
|
+
return t.value !== void 0 && r?.presentation && !r.ownGroupValue && !r.group ? /* @__PURE__ */ f(re, { children: r.presentation(t.value, t.rows[0]) }) : /* @__PURE__ */ f(re, { children: ut(e, t.value, n, o) });
|
|
2217
2220
|
}
|
|
2218
2221
|
function Mt({
|
|
2219
2222
|
group: e,
|
|
@@ -2224,17 +2227,17 @@ function Mt({
|
|
|
2224
2227
|
formats: s,
|
|
2225
2228
|
wording: i
|
|
2226
2229
|
}) {
|
|
2227
|
-
const l =
|
|
2228
|
-
if (
|
|
2229
|
-
|
|
2230
|
+
const l = ut(n, e.value, s, i), c = s.count(e.rows.length), a = () => r.publicSnapshot.toggleFold(e.path), d = (u) => {
|
|
2231
|
+
if (u.altKey && (u.key === "ArrowLeft" || u.key === "ArrowRight")) {
|
|
2232
|
+
u.preventDefault(), bn(e, u.key === "ArrowLeft", r);
|
|
2230
2233
|
return;
|
|
2231
2234
|
}
|
|
2232
|
-
if (
|
|
2233
|
-
|
|
2234
|
-
else if (
|
|
2235
|
-
if (
|
|
2235
|
+
if (u.key === "ArrowRight" && !o)
|
|
2236
|
+
u.preventDefault(), a();
|
|
2237
|
+
else if (u.key === "ArrowLeft") {
|
|
2238
|
+
if (u.preventDefault(), o) a();
|
|
2236
2239
|
else if (t) {
|
|
2237
|
-
const b =
|
|
2240
|
+
const b = u.currentTarget.closest("table");
|
|
2238
2241
|
Array.from(b?.querySelectorAll("[data-fold-path]") ?? []).find(
|
|
2239
2242
|
(m) => m.dataset.foldPath === t.path
|
|
2240
2243
|
)?.focus();
|
|
@@ -2245,13 +2248,13 @@ function Mt({
|
|
|
2245
2248
|
"button",
|
|
2246
2249
|
{
|
|
2247
2250
|
type: "button",
|
|
2248
|
-
className:
|
|
2251
|
+
className: F(h.fold, !o && h.foldClosed),
|
|
2249
2252
|
"data-fold-path": e.path,
|
|
2250
2253
|
"aria-expanded": o,
|
|
2251
2254
|
"aria-label": o ? i.foldGroup(l, c) : i.unfoldGroup(l, c),
|
|
2252
|
-
onKeyDown:
|
|
2253
|
-
onClick: (
|
|
2254
|
-
if (!
|
|
2255
|
+
onKeyDown: d,
|
|
2256
|
+
onClick: (u) => {
|
|
2257
|
+
if (!u.altKey) return a();
|
|
2255
2258
|
bn(e, o, r);
|
|
2256
2259
|
},
|
|
2257
2260
|
children: /* @__PURE__ */ f(bo, {})
|
|
@@ -2259,15 +2262,15 @@ function Mt({
|
|
|
2259
2262
|
);
|
|
2260
2263
|
}
|
|
2261
2264
|
function Ol({ value: e, formats: t }) {
|
|
2262
|
-
const n =
|
|
2265
|
+
const n = W(null);
|
|
2263
2266
|
return rl(n, e, t.count), /* @__PURE__ */ f("span", { ref: n, className: h.groupCount, children: t.count(e) });
|
|
2264
2267
|
}
|
|
2265
2268
|
function Lt({ group: e, entry: t, hook: n, formats: o, wording: r }) {
|
|
2266
2269
|
const { selection: s } = n.publicSnapshot, i = e.rows.map(n.rowKey), l = i.filter((a) => s.isSelected(a)).length, c = l === i.length;
|
|
2267
2270
|
return /* @__PURE__ */ f(
|
|
2268
|
-
|
|
2271
|
+
He,
|
|
2269
2272
|
{
|
|
2270
|
-
"aria-label": r.selectGroup(
|
|
2273
|
+
"aria-label": r.selectGroup(ut(t, e.value, o, r)),
|
|
2271
2274
|
checked: c,
|
|
2272
2275
|
indeterminate: l > 0 && !c,
|
|
2273
2276
|
onChange: () => {
|
|
@@ -2295,10 +2298,10 @@ function El({
|
|
|
2295
2298
|
wording: i
|
|
2296
2299
|
}) {
|
|
2297
2300
|
const l = e.span;
|
|
2298
|
-
return /* @__PURE__ */ f("td", { className:
|
|
2301
|
+
return /* @__PURE__ */ f("td", { className: F(h.td, h.spanCell, o.className), style: o.style, children: e.first && /* @__PURE__ */ T("span", { className: h.spanValue, children: [
|
|
2299
2302
|
n && /* @__PURE__ */ f("span", { className: h.spanSelect, children: /* @__PURE__ */ f(Lt, { group: l, entry: t, hook: r, formats: s, wording: i }) }),
|
|
2300
2303
|
/* @__PURE__ */ f(Mt, { group: l, parent: e.parents.at(-1), entry: t, open: !0, hook: r, formats: s, wording: i }),
|
|
2301
|
-
/* @__PURE__ */ T("span", { className: h.spanText, title:
|
|
2304
|
+
/* @__PURE__ */ T("span", { className: h.spanText, title: ut(t, l.value, s, i), children: [
|
|
2302
2305
|
/* @__PURE__ */ f(Et, { entry: t, group: l, formats: s, wording: i }),
|
|
2303
2306
|
e.continued && /* @__PURE__ */ f("span", { className: h.continued, children: i.groupContinued })
|
|
2304
2307
|
] }),
|
|
@@ -2316,93 +2319,93 @@ function Ml({
|
|
|
2316
2319
|
blocks: l,
|
|
2317
2320
|
selectable: c,
|
|
2318
2321
|
hasActions: a,
|
|
2319
|
-
total:
|
|
2320
|
-
siblings:
|
|
2322
|
+
total: d,
|
|
2323
|
+
siblings: u,
|
|
2321
2324
|
depth: b,
|
|
2322
2325
|
hook: p,
|
|
2323
2326
|
formats: m,
|
|
2324
2327
|
wording: w,
|
|
2325
2328
|
grid: g
|
|
2326
2329
|
}) {
|
|
2327
|
-
const { group: v } = e,
|
|
2330
|
+
const { group: v } = e, x = e.kind === "header", y = x && !p.publicSnapshot.folded.includes(v.path), { lead: _, labelColumns: S, countColumns: C } = co({
|
|
2328
2331
|
controls: i,
|
|
2329
2332
|
span: o !== void 0,
|
|
2330
|
-
aggregates: s.map((
|
|
2333
|
+
aggregates: s.map((B) => B.spec.aggregate !== void 0),
|
|
2331
2334
|
actions: a,
|
|
2332
2335
|
blocks: l
|
|
2333
|
-
}), A = s.slice(_), L = i + (o ? 1 : 0),
|
|
2336
|
+
}), A = s.slice(_), L = i + (o ? 1 : 0), k = (B, I = B) => ct(l, B, I), O = (B) => _ - B > 0 && /* @__PURE__ */ f("td", { className: h.td, colSpan: _ - B }), M = s.find((B) => B.spec.aggregate === "sum" && B.spec.share !== !1), R = n !== void 0, E = /* @__PURE__ */ T("span", { className: h.groupLabel, children: [
|
|
2334
2337
|
/* @__PURE__ */ f(Mt, { group: v, parent: e.parents.at(-1), entry: r, open: y, hook: p, formats: m, wording: w }),
|
|
2335
2338
|
/* @__PURE__ */ f("span", { className: h.groupValue, children: /* @__PURE__ */ f(Et, { entry: r, group: v, formats: m, wording: w }) }),
|
|
2336
2339
|
/* @__PURE__ */ f(Ol, { value: v.rows.length, formats: m }),
|
|
2337
|
-
|
|
2340
|
+
x && e.continued && /* @__PURE__ */ f("span", { className: h.continued, children: w.groupContinued })
|
|
2338
2341
|
] });
|
|
2339
2342
|
return /* @__PURE__ */ T(
|
|
2340
2343
|
"tr",
|
|
2341
2344
|
{
|
|
2342
|
-
className:
|
|
2345
|
+
className: F(x ? h.groupHeader : h.groupFolded, R && h.virtualRow),
|
|
2343
2346
|
"data-line": e.kind,
|
|
2344
2347
|
"data-level": v.level,
|
|
2345
|
-
"data-motion": n !== void 0 || !(
|
|
2346
|
-
"data-continued":
|
|
2347
|
-
"data-group-first":
|
|
2348
|
+
"data-motion": n !== void 0 || !(x && e.continued) ? `${e.kind}:${v.path}` : void 0,
|
|
2349
|
+
"data-continued": x && e.continued ? "" : void 0,
|
|
2350
|
+
"data-group-first": x ? void 0 : "",
|
|
2348
2351
|
"data-group": v.path,
|
|
2349
2352
|
"data-grid-line": g ? `${e.kind}:${v.path}` : void 0,
|
|
2350
2353
|
"data-row": R ? n : void 0,
|
|
2351
2354
|
"aria-rowindex": R ? n + 2 : void 0,
|
|
2352
2355
|
"data-index": t,
|
|
2353
|
-
style:
|
|
2354
|
-
"aria-level":
|
|
2356
|
+
style: x ? { "--u-header-level": v.level } : void 0,
|
|
2357
|
+
"aria-level": x ? v.level + 1 : b,
|
|
2355
2358
|
"aria-expanded": y,
|
|
2356
|
-
"aria-posinset":
|
|
2357
|
-
"aria-setsize":
|
|
2359
|
+
"aria-posinset": u.indexOf(v) + 1 || void 0,
|
|
2360
|
+
"aria-setsize": u.length || void 0,
|
|
2358
2361
|
children: [
|
|
2359
|
-
Array.from({ length: i }, (
|
|
2360
|
-
|
|
2362
|
+
Array.from({ length: i }, (B, I) => /* @__PURE__ */ f("td", { className: F(h.td, h.control, k(I).className), style: k(I).style, children: I === 0 && c && x && /* @__PURE__ */ f(Lt, { group: v, entry: r, hook: p, formats: m, wording: w }) }, `c${I}`)),
|
|
2363
|
+
x ? /* @__PURE__ */ T(re, { children: [
|
|
2361
2364
|
/* @__PURE__ */ f(
|
|
2362
2365
|
"td",
|
|
2363
2366
|
{
|
|
2364
|
-
className:
|
|
2365
|
-
colSpan: (o ? 1 : 0) +
|
|
2367
|
+
className: F(h.td, k(i, L + S - 1).className),
|
|
2368
|
+
colSpan: (o ? 1 : 0) + S,
|
|
2366
2369
|
style: {
|
|
2367
|
-
...
|
|
2370
|
+
...k(i, L + S - 1).style,
|
|
2368
2371
|
paddingLeft: `calc(var(--u-space-3) + ${v.level * 20}px)`
|
|
2369
2372
|
},
|
|
2370
2373
|
children: E
|
|
2371
2374
|
}
|
|
2372
2375
|
),
|
|
2373
|
-
O(
|
|
2376
|
+
O(S)
|
|
2374
2377
|
] }) : /* @__PURE__ */ T(re, { children: [
|
|
2375
|
-
/* @__PURE__ */ f("td", { className:
|
|
2378
|
+
/* @__PURE__ */ f("td", { className: F(h.td, h.spanCell, k(i).className), style: k(i).style, children: /* @__PURE__ */ T("span", { className: h.spanValue, children: [
|
|
2376
2379
|
c && /* @__PURE__ */ f("span", { className: h.spanSelect, children: /* @__PURE__ */ f(Lt, { group: v, entry: o, hook: p, formats: m, wording: w }) }),
|
|
2377
2380
|
/* @__PURE__ */ f(Mt, { group: v, parent: e.parents.at(-1), entry: o, open: !1, hook: p, formats: m, wording: w }),
|
|
2378
2381
|
/* @__PURE__ */ f("span", { className: h.spanText, children: /* @__PURE__ */ f(Et, { entry: o, group: v, formats: m, wording: w }) }),
|
|
2379
2382
|
/* @__PURE__ */ f("span", { className: h.groupCount, children: m.count(v.rows.length) })
|
|
2380
2383
|
] }) }),
|
|
2381
|
-
|
|
2384
|
+
C > 0 && /* @__PURE__ */ f(
|
|
2382
2385
|
"td",
|
|
2383
2386
|
{
|
|
2384
|
-
className:
|
|
2385
|
-
style:
|
|
2386
|
-
colSpan:
|
|
2387
|
+
className: F(h.td, h.foldedCount, k(L, L + C - 1).className),
|
|
2388
|
+
style: k(L, L + C - 1).style,
|
|
2389
|
+
colSpan: C,
|
|
2387
2390
|
children: w.entries(v.rows.length, m.count(v.rows.length))
|
|
2388
2391
|
}
|
|
2389
2392
|
),
|
|
2390
|
-
O(
|
|
2393
|
+
O(C)
|
|
2391
2394
|
] }),
|
|
2392
|
-
A.map((
|
|
2393
|
-
|
|
2395
|
+
A.map((B, I) => /* @__PURE__ */ f(
|
|
2396
|
+
ql,
|
|
2394
2397
|
{
|
|
2395
|
-
pin:
|
|
2396
|
-
entry:
|
|
2398
|
+
pin: k(L + _ + I),
|
|
2399
|
+
entry: B,
|
|
2397
2400
|
group: v,
|
|
2398
|
-
share:
|
|
2399
|
-
total:
|
|
2401
|
+
share: x && B === M,
|
|
2402
|
+
total: d,
|
|
2400
2403
|
formats: m,
|
|
2401
2404
|
wording: w
|
|
2402
2405
|
},
|
|
2403
|
-
|
|
2406
|
+
B.key
|
|
2404
2407
|
)),
|
|
2405
|
-
a && /* @__PURE__ */ f("td", { className:
|
|
2408
|
+
a && /* @__PURE__ */ f("td", { className: F(h.td, k(l.count - 1).className), style: k(l.count - 1).style })
|
|
2406
2409
|
]
|
|
2407
2410
|
}
|
|
2408
2411
|
);
|
|
@@ -2412,9 +2415,9 @@ function Ll(e, t) {
|
|
|
2412
2415
|
let n = vn.get(t);
|
|
2413
2416
|
n || vn.set(t, n = /* @__PURE__ */ new Map());
|
|
2414
2417
|
let o = n.get(e);
|
|
2415
|
-
return (!o || o.reader !== e.spec.value) && (o = { reader: e.spec.value, sum:
|
|
2418
|
+
return (!o || o.reader !== e.spec.value) && (o = { reader: e.spec.value, sum: $t({ id: e.spec.id, read: e.read, aggregate: "sum" }, t) }, n.set(e, o)), o.sum;
|
|
2416
2419
|
}
|
|
2417
|
-
function
|
|
2420
|
+
function ql({
|
|
2418
2421
|
entry: e,
|
|
2419
2422
|
pin: t,
|
|
2420
2423
|
group: n,
|
|
@@ -2424,16 +2427,16 @@ function Fl({
|
|
|
2424
2427
|
wording: i
|
|
2425
2428
|
}) {
|
|
2426
2429
|
const { spec: l } = e;
|
|
2427
|
-
if (!l.aggregate) return /* @__PURE__ */ f("td", { className:
|
|
2430
|
+
if (!l.aggregate) return /* @__PURE__ */ f("td", { className: F(h.td, t.className), style: t.style });
|
|
2428
2431
|
let c = null;
|
|
2429
2432
|
if (o && l.aggregate === "sum" && l.share !== !1) {
|
|
2430
|
-
const a = Ll(e, r),
|
|
2431
|
-
if (typeof a == "number" && a > 0 && typeof
|
|
2432
|
-
const
|
|
2433
|
-
c = /* @__PURE__ */ f("span", { className: h.shareBar, style: { width: `${Math.max(2, Math.round(
|
|
2433
|
+
const a = Ll(e, r), d = n.aggregates[l.id];
|
|
2434
|
+
if (typeof a == "number" && a > 0 && typeof d == "number" && d > 0) {
|
|
2435
|
+
const u = Math.min(1, d / a);
|
|
2436
|
+
c = /* @__PURE__ */ f("span", { className: h.shareBar, style: { width: `${Math.max(2, Math.round(u * 64))}px` }, "aria-hidden": "true" });
|
|
2434
2437
|
}
|
|
2435
2438
|
}
|
|
2436
|
-
return /* @__PURE__ */ f("td", { className:
|
|
2439
|
+
return /* @__PURE__ */ f("td", { className: F(h.td, mo(e, n.rows, { value: n.aggregates[l.id] }) && h.numeric, h.aggregateCell, t.className), style: t.style, "data-aggregate": typeof l.aggregate == "function" ? "own" : l.aggregate, children: c ? /* @__PURE__ */ T("span", { className: h.shareHost, children: [
|
|
2437
2440
|
/* @__PURE__ */ f(Ot, { entry: e, rows: n.rows, known: { value: n.aggregates[l.id] }, formats: s, wording: i }),
|
|
2438
2441
|
c
|
|
2439
2442
|
] }) : /* @__PURE__ */ f(Ot, { entry: e, rows: n.rows, known: { value: n.aggregates[l.id] }, formats: s, wording: i }) });
|
|
@@ -2447,7 +2450,7 @@ function vo(e, t, n, o, r) {
|
|
|
2447
2450
|
const i = r !== void 0 && r.branch && !r.empty;
|
|
2448
2451
|
return { content: s, open: i ? t.branches.includes(o) : t.expanded.includes(o) };
|
|
2449
2452
|
}
|
|
2450
|
-
function
|
|
2453
|
+
function Fl(e, t, n, o, r) {
|
|
2451
2454
|
const s = /* @__PURE__ */ new Set([...t.expanded, ...t.branches]), i = /* @__PURE__ */ new Set();
|
|
2452
2455
|
for (const l of n) {
|
|
2453
2456
|
const c = o(l);
|
|
@@ -2455,7 +2458,7 @@ function Bl(e, t, n, o, r) {
|
|
|
2455
2458
|
}
|
|
2456
2459
|
return i;
|
|
2457
2460
|
}
|
|
2458
|
-
function
|
|
2461
|
+
function Bl({
|
|
2459
2462
|
setup: e,
|
|
2460
2463
|
entry: t,
|
|
2461
2464
|
detail: n,
|
|
@@ -2463,16 +2466,16 @@ function Dl({
|
|
|
2463
2466
|
wording: r,
|
|
2464
2467
|
children: s
|
|
2465
2468
|
}) {
|
|
2466
|
-
const i = t.branch && !t.empty, l = i || n !== void 0, c = i && t.expanded || (n?.open ?? !1), a = (
|
|
2467
|
-
i && e.set(t.key,
|
|
2468
|
-
},
|
|
2469
|
-
if (!(
|
|
2470
|
-
if (
|
|
2471
|
-
if (
|
|
2469
|
+
const i = t.branch && !t.empty, l = i || n !== void 0, c = i && t.expanded || (n?.open ?? !1), a = (u) => {
|
|
2470
|
+
i && e.set(t.key, u), n && n.open !== u && n.toggle();
|
|
2471
|
+
}, d = (u) => {
|
|
2472
|
+
if (!(u.key !== "ArrowLeft" && u.key !== "ArrowRight")) {
|
|
2473
|
+
if (u.preventDefault(), u.altKey) return e.siblings(t.key, u.key === "ArrowRight");
|
|
2474
|
+
if (u.key === "ArrowRight")
|
|
2472
2475
|
c || a(!0);
|
|
2473
2476
|
else if (c) a(!1);
|
|
2474
2477
|
else {
|
|
2475
|
-
const b = e.parent(t.key), p =
|
|
2478
|
+
const b = e.parent(t.key), p = u.currentTarget.closest("table");
|
|
2476
2479
|
Array.from(p?.querySelectorAll("[data-branch-key]") ?? []).find((w) => w.dataset.branchKey === b)?.focus();
|
|
2477
2480
|
}
|
|
2478
2481
|
}
|
|
@@ -2482,12 +2485,12 @@ function Dl({
|
|
|
2482
2485
|
"button",
|
|
2483
2486
|
{
|
|
2484
2487
|
type: "button",
|
|
2485
|
-
className:
|
|
2488
|
+
className: F(h.fold, !c && h.foldClosed),
|
|
2486
2489
|
"data-branch-key": t.key,
|
|
2487
2490
|
"aria-expanded": c,
|
|
2488
2491
|
"aria-label": c ? r.foldBranch(o) : r.unfoldBranch(o),
|
|
2489
|
-
onKeyDown:
|
|
2490
|
-
onClick: (
|
|
2492
|
+
onKeyDown: d,
|
|
2493
|
+
onClick: (u) => u.altKey ? e.siblings(t.key, !c) : a(!c),
|
|
2491
2494
|
children: /* @__PURE__ */ f(bo, {})
|
|
2492
2495
|
}
|
|
2493
2496
|
) : /* @__PURE__ */ f("span", { className: h.foldSlot }),
|
|
@@ -2497,7 +2500,7 @@ function Dl({
|
|
|
2497
2500
|
] })
|
|
2498
2501
|
] });
|
|
2499
2502
|
}
|
|
2500
|
-
function
|
|
2503
|
+
function Dl(e, t, n, o) {
|
|
2501
2504
|
const r = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Set(), l = [];
|
|
2502
2505
|
return e.forEach((c, a) => {
|
|
2503
2506
|
r.set(c.key, c), l.length = c.level, s.set(c.key, l.at(-1)), l.push(c.key), e[a + 1]?.level === 0 && i.add(c.key);
|
|
@@ -2514,28 +2517,28 @@ function Pl(e, t, n, o) {
|
|
|
2514
2517
|
},
|
|
2515
2518
|
/* Alt on a fold acts on the branch and its siblings, as on a group header. */
|
|
2516
2519
|
siblings: (c, a) => {
|
|
2517
|
-
const
|
|
2518
|
-
for (const
|
|
2519
|
-
s.get(
|
|
2520
|
+
const d = s.get(c);
|
|
2521
|
+
for (const u of e)
|
|
2522
|
+
s.get(u.key) === d && u.branch && !u.empty && n.branches.includes(u.key) !== a && n.toggleBranch(u.key);
|
|
2520
2523
|
}
|
|
2521
2524
|
};
|
|
2522
2525
|
}
|
|
2523
|
-
function
|
|
2526
|
+
function Pl({
|
|
2524
2527
|
registry: e,
|
|
2525
2528
|
hook: t,
|
|
2526
2529
|
props: n,
|
|
2527
2530
|
layout: o,
|
|
2528
2531
|
grid: r
|
|
2529
2532
|
}) {
|
|
2530
|
-
const { selectable: s = !1, loading: i = !1, grid: l = !1 } = n, { snapshot: c, projection: a, virtual:
|
|
2533
|
+
const { selectable: s = !1, loading: i = !1, grid: l = !1 } = n, { snapshot: c, projection: a, virtual: d, lines: u, spanEntry: b, dataColumns: p, expanderColumn: m, controlColumns: w, trailing: g, blocks: v, rows: x, footerShown: y } = o, _ = l ? il({
|
|
2531
2534
|
layout: { controls: w, span: b !== void 0, aggregates: p.map((L) => L.spec.aggregate !== void 0), actions: g, blocks: v },
|
|
2532
|
-
body: i ? { rows: [] } :
|
|
2535
|
+
body: i ? { rows: [] } : u ? { lines: d ? a.lines : u } : { rows: d ? a.shown ?? a.filtered : x },
|
|
2533
2536
|
rowKey: t.rowKey,
|
|
2534
|
-
expanded: o.detail ?
|
|
2537
|
+
expanded: o.detail ? Fl(e, c, a.shown ?? a.filtered, t.rowKey, o.tree) : /* @__PURE__ */ new Set(),
|
|
2535
2538
|
foot: y
|
|
2536
|
-
}) : [],
|
|
2537
|
-
|
|
2538
|
-
const
|
|
2539
|
+
}) : [], S = r.state.editing?.line === he ? r.state.editing : null;
|
|
2540
|
+
S && _[0] && _.splice(1, 0, { key: he, cells: _[0].cells, at: -1, row: S.fresh });
|
|
2541
|
+
const C = [
|
|
2539
2542
|
...s ? ["#select"] : [],
|
|
2540
2543
|
...m ? ["#detail"] : [],
|
|
2541
2544
|
...b ? ["#span"] : [],
|
|
@@ -2544,10 +2547,10 @@ function Vl({
|
|
|
2544
2547
|
], A = l ? vl({
|
|
2545
2548
|
grid: r,
|
|
2546
2549
|
lines: _,
|
|
2547
|
-
ids:
|
|
2548
|
-
columnById: (L) => p.find((
|
|
2550
|
+
ids: C,
|
|
2551
|
+
columnById: (L) => p.find((k) => k.spec.id === L),
|
|
2549
2552
|
rowKey: t.rowKey,
|
|
2550
|
-
virtual:
|
|
2553
|
+
virtual: d,
|
|
2551
2554
|
onCellEdit: n.onCellEdit,
|
|
2552
2555
|
rowMode: o.rowMode,
|
|
2553
2556
|
onRowSave: n.onRowSave,
|
|
@@ -2556,14 +2559,14 @@ function Vl({
|
|
|
2556
2559
|
onRowDelete: n.onRowDelete,
|
|
2557
2560
|
select: s ? (L) => c.selection.toggle(t.rowKey(L)) : void 0
|
|
2558
2561
|
}) : void 0;
|
|
2559
|
-
return { lines: _, fresh:
|
|
2562
|
+
return { lines: _, fresh: S, ids: C, events: A };
|
|
2560
2563
|
}
|
|
2561
|
-
function
|
|
2564
|
+
function Vl(e) {
|
|
2562
2565
|
for (const t of e) t.removeAttribute("data-copied");
|
|
2563
2566
|
document.body.offsetWidth;
|
|
2564
2567
|
for (const t of e) t.setAttribute("data-copied", "");
|
|
2565
2568
|
}
|
|
2566
|
-
function
|
|
2569
|
+
function Il({
|
|
2567
2570
|
registry: e,
|
|
2568
2571
|
hook: t,
|
|
2569
2572
|
grid: n,
|
|
@@ -2575,38 +2578,38 @@ function $l({
|
|
|
2575
2578
|
tableElement: c
|
|
2576
2579
|
}) {
|
|
2577
2580
|
return (a) => {
|
|
2578
|
-
const
|
|
2581
|
+
const d = (A) => Fo(A, c());
|
|
2579
2582
|
if (a.defaultPrevented || a.altKey || a.shiftKey || a.ctrlKey === a.metaKey || a.key.toLowerCase() !== "c") return;
|
|
2580
|
-
const { target:
|
|
2581
|
-
if (!(
|
|
2582
|
-
const p =
|
|
2583
|
+
const { target: u, currentTarget: b } = a;
|
|
2584
|
+
if (!(u instanceof Element)) return;
|
|
2585
|
+
const p = u.closest("td, th"), m = p?.dataset.editing, w = u.closest("input, textarea, select, [contenteditable]:not([contenteditable='false'])");
|
|
2583
2586
|
if (w?.matches("textarea, [contenteditable]:not([contenteditable='false']), input:not([type=checkbox], [type=radio], [type=button], [type=submit], [type=reset], [type=range], [type=color], [type=file], [type=image])") && m === void 0 || window.getSelection()?.toString() || (w instanceof HTMLInputElement || w instanceof HTMLTextAreaElement) && w.selectionStart !== w.selectionEnd) return;
|
|
2584
|
-
let v = "",
|
|
2585
|
-
const _ = to(e),
|
|
2586
|
-
if (
|
|
2587
|
-
v = w instanceof HTMLInputElement || w instanceof HTMLTextAreaElement ? w.value : oo(
|
|
2587
|
+
let v = "", x = "", y = p ? [p] : [];
|
|
2588
|
+
const _ = to(e), S = m === void 0 ? void 0 : s.find((A) => A.spec.id === m);
|
|
2589
|
+
if (S)
|
|
2590
|
+
v = w instanceof HTMLInputElement || w instanceof HTMLTextAreaElement ? w.value : oo(S, n.state.editing?.drafts[S.spec.id], i, l), x = l.copiedCell;
|
|
2588
2591
|
else if (_.length > 0) {
|
|
2589
|
-
v = no(e, i, l),
|
|
2592
|
+
v = no(e, i, l), x = l.copiedRows(_.length, i.count(_.length));
|
|
2590
2593
|
const A = new Set(_.map((L) => t.rowKey(L)));
|
|
2591
2594
|
y = Array.from(b.querySelectorAll("tr[data-motion]")).filter((L) => A.has(L.dataset.motion)).flatMap((L) => Array.from(L.children));
|
|
2592
2595
|
} else if (o && n.state.active) {
|
|
2593
|
-
const { line: A, column: L } = n.state.active,
|
|
2594
|
-
if (!
|
|
2596
|
+
const { line: A, column: L } = n.state.active, k = r.find((R) => R.key === A), O = s.find((R) => R.spec.id === L);
|
|
2597
|
+
if (!k || k.row === void 0 || k.key !== Ue(t.rowKey(k.row)) || !O) return;
|
|
2595
2598
|
const M = Array.from(b.querySelectorAll("tr[data-grid-line]")).find((R) => R.dataset.gridLine === A)?.children[n.state.active.columnIndex];
|
|
2596
|
-
M && (y = [M]), v =
|
|
2599
|
+
M && (y = [M]), v = Hi(O, k.row, i, l), x = l.copiedCell;
|
|
2597
2600
|
} else return;
|
|
2598
2601
|
a.preventDefault();
|
|
2599
|
-
const
|
|
2600
|
-
X("copy-failed", `The clipboard refused the copy (${String(A)}). It needs a secure context and a focused document.`),
|
|
2602
|
+
const C = (A) => {
|
|
2603
|
+
X("copy-failed", `The clipboard refused the copy (${String(A)}). It needs a secure context and a focused document.`), d(l.copyFailed);
|
|
2601
2604
|
};
|
|
2602
2605
|
Promise.resolve().then(() => navigator.clipboard.writeText(v)).then(() => {
|
|
2603
|
-
|
|
2604
|
-
},
|
|
2606
|
+
Vl(y), d(x);
|
|
2607
|
+
}, C);
|
|
2605
2608
|
};
|
|
2606
2609
|
}
|
|
2607
|
-
function
|
|
2608
|
-
const [t, n] =
|
|
2609
|
-
|
|
2610
|
+
function $l({ table: e }) {
|
|
2611
|
+
const [t, n] = V(null), o = Bo(), r = W(null);
|
|
2612
|
+
xe(() => {
|
|
2610
2613
|
const i = e.current;
|
|
2611
2614
|
if (!i) return;
|
|
2612
2615
|
let l;
|
|
@@ -2616,13 +2619,13 @@ function zl({ table: e }) {
|
|
|
2616
2619
|
clearTimeout(l);
|
|
2617
2620
|
const w = p instanceof Element ? p.closest("td, th") : null, g = p instanceof Element ? p.closest(`.${h.headLine}`) : null, v = g ? g.querySelector(`.${h.headLabel}`) : w?.querySelector(`:scope > .${h.value}, :scope .${h.treeText} > .${h.value}`);
|
|
2618
2621
|
if (!w || !v || v.childElementCount > 0 || v.scrollWidth <= v.clientWidth + 1) return n(null);
|
|
2619
|
-
const
|
|
2620
|
-
l = setTimeout(() => n({ text: v.textContent ?? "", cell: w.getBoundingClientRect(), target:
|
|
2621
|
-
},
|
|
2622
|
+
const x = i.closest("dialog") ?? o() ?? document.body;
|
|
2623
|
+
l = setTimeout(() => n({ text: v.textContent ?? "", cell: w.getBoundingClientRect(), target: x }), m);
|
|
2624
|
+
}, d = (p) => a(p.target, 300), u = (p) => a(p.target, 0), b = (p) => {
|
|
2622
2625
|
p.key === "Escape" && c();
|
|
2623
2626
|
};
|
|
2624
|
-
return i.addEventListener("pointerover",
|
|
2625
|
-
clearTimeout(l), i.removeEventListener("pointerover",
|
|
2627
|
+
return i.addEventListener("pointerover", d), i.addEventListener("pointerleave", c), i.addEventListener("focusin", u), i.addEventListener("focusout", c), document.addEventListener("keydown", b), window.addEventListener("scroll", c, !0), () => {
|
|
2628
|
+
clearTimeout(l), i.removeEventListener("pointerover", d), i.removeEventListener("pointerleave", c), i.removeEventListener("focusin", u), i.removeEventListener("focusout", c), document.removeEventListener("keydown", b), window.removeEventListener("scroll", c, !0);
|
|
2626
2629
|
};
|
|
2627
2630
|
}, [e, o]);
|
|
2628
2631
|
const s = !!t && t.target instanceof HTMLDialogElement && "showPopover" in HTMLElement.prototype;
|
|
@@ -2645,7 +2648,7 @@ function zl({ table: e }) {
|
|
|
2645
2648
|
t.target
|
|
2646
2649
|
) : null;
|
|
2647
2650
|
}
|
|
2648
|
-
function
|
|
2651
|
+
function qt(e, t) {
|
|
2649
2652
|
const n = e.scrollWidth - e.clientWidth;
|
|
2650
2653
|
e.toggleAttribute("data-beyond-start", !t.start && e.scrollLeft > 0.5), e.toggleAttribute("data-beyond-end", !t.end && e.scrollLeft < n - 0.5);
|
|
2651
2654
|
}
|
|
@@ -2659,14 +2662,14 @@ function _o(e) {
|
|
|
2659
2662
|
t.toggleAttribute("data-stuck", o);
|
|
2660
2663
|
}
|
|
2661
2664
|
}
|
|
2662
|
-
function
|
|
2665
|
+
function zl(e, t) {
|
|
2663
2666
|
const n = t.state.editing?.line;
|
|
2664
2667
|
Z(() => {
|
|
2665
2668
|
const o = e.hook;
|
|
2666
2669
|
!o || n === void 0 || n === he || o.rows.some((r) => Ue(o.rowKey(r)) === n) || t.setState((r) => ({ ...r, editing: null }));
|
|
2667
2670
|
});
|
|
2668
2671
|
}
|
|
2669
|
-
function
|
|
2672
|
+
function Kl(e, t) {
|
|
2670
2673
|
Z(() => {
|
|
2671
2674
|
const n = e.current;
|
|
2672
2675
|
if (n?.parentElement && !t && n.parentElement.style.removeProperty("scroll-padding-top"), !n || !t) return;
|
|
@@ -2674,7 +2677,7 @@ function Gl(e, t) {
|
|
|
2674
2677
|
n.style.setProperty("--u-table-head", `${o}px`), n.style.setProperty("--u-table-group-header", `${r}px`), n.parentElement?.style.setProperty("scroll-padding-top", `${o}px`), n.parentElement && _o(n.parentElement);
|
|
2675
2678
|
});
|
|
2676
2679
|
}
|
|
2677
|
-
function
|
|
2680
|
+
function Gl(e, t) {
|
|
2678
2681
|
Z(() => {
|
|
2679
2682
|
const n = e.takeFocusBeforeFold(), o = t.current;
|
|
2680
2683
|
if (!n || !o || n.table !== o || n.element.isConnected) return;
|
|
@@ -2685,8 +2688,8 @@ function jl(e, t) {
|
|
|
2685
2688
|
}
|
|
2686
2689
|
});
|
|
2687
2690
|
}
|
|
2688
|
-
function
|
|
2689
|
-
const o =
|
|
2691
|
+
function jl(e, t, n) {
|
|
2692
|
+
const o = W(null);
|
|
2690
2693
|
Z(() => {
|
|
2691
2694
|
const r = t.current?.tBodies[0];
|
|
2692
2695
|
if (!r || !e.server) return;
|
|
@@ -2699,10 +2702,10 @@ function Hl(e, t, n) {
|
|
|
2699
2702
|
s && i?.cells.length === s.length && Array.from(i.cells).forEach((l, c) => l.style.width = `${s[c]}px`);
|
|
2700
2703
|
});
|
|
2701
2704
|
}
|
|
2702
|
-
function
|
|
2703
|
-
|
|
2705
|
+
function Hl(e) {
|
|
2706
|
+
xe(() => {
|
|
2704
2707
|
const t = e.current;
|
|
2705
|
-
if (!(!
|
|
2708
|
+
if (!(!Kt || !t)) {
|
|
2706
2709
|
for (const n of Array.from(t.querySelectorAll(`tbody .${h.value}`))) {
|
|
2707
2710
|
if (n.scrollHeight <= n.clientHeight + 1) continue;
|
|
2708
2711
|
const o = n.closest("td, th"), r = o?.parentElement ? Array.from(o.parentElement.children).indexOf(o) : -1, s = t.tHead?.rows?.[0]?.cells[r]?.textContent?.trim() || `column ${r + 1}`;
|
|
@@ -2721,7 +2724,7 @@ function Wl(e) {
|
|
|
2721
2724
|
}
|
|
2722
2725
|
});
|
|
2723
2726
|
}
|
|
2724
|
-
function
|
|
2727
|
+
function Wl(e, t) {
|
|
2725
2728
|
Z(() => {
|
|
2726
2729
|
const n = t.current?.tHead?.rows?.[0]?.getBoundingClientRect().height;
|
|
2727
2730
|
n && e.hook?.tableState.virtual && e.hook.tableState.setPitch(n);
|
|
@@ -2735,40 +2738,40 @@ function Yl({
|
|
|
2735
2738
|
drafting: o,
|
|
2736
2739
|
sticking: r
|
|
2737
2740
|
}) {
|
|
2738
|
-
const { selectable: s = !1, loading: i = !1, grid: l = !1 } = n, c = t.publicSnapshot, a = e.projection(),
|
|
2739
|
-
start:
|
|
2740
|
-
end:
|
|
2741
|
+
const { selectable: s = !1, loading: i = !1, grid: l = !1 } = n, c = t.publicSnapshot, a = e.projection(), d = e.rowHeader(), u = Qn(e), b = e.detail, p = e.hasRowActions() ? e.actions.ordered() : [], m = t.tableState.virtual, w = c.grouping, g = w.length > 0 ? a.visibleLines : void 0, v = g ? e.groupingEntries(t.rows) : [], x = (oe) => v.find((H) => H.spec.id === oe), y = g && w.length > 1 ? x(w.at(-1)) : void 0, _ = g ? u.filter((oe) => !w.includes(oe.spec.id)) : u, S = a.entries, C = S ? Dl(S, t, c, _[0]) : void 0, A = b !== null && !S, L = (s ? 1 : 0) + (A ? 1 : 0), k = L + (y ? 1 : 0), O = l && n.editMode === "row", M = l && (O || n.onRowAdd !== void 0 || n.onRowDelete !== void 0), R = p.length > 0 || M, E = k + _.length + (R ? 1 : 0), B = e.pins(), I = _.filter((oe) => B[oe.spec.id] === "start").length, D = _.filter((oe) => B[oe.spec.id] === "end").length, z = y !== void 0 && B[y.spec.id] === "start", Y = p.length > 0 || n.onRowDelete !== void 0 || o, ce = e.actionsPinned() ? Y : o && M, G = {
|
|
2742
|
+
start: I > 0 || z ? k + I : 0,
|
|
2743
|
+
end: D > 0 ? D + (R ? 1 : 0) : R && ce ? 1 : 0,
|
|
2741
2744
|
count: E
|
|
2742
2745
|
}, ne = {
|
|
2743
|
-
start: r.start ?
|
|
2744
|
-
end: r.end || o && M ?
|
|
2746
|
+
start: r.start ? G.start : 0,
|
|
2747
|
+
end: r.end || o && M ? G.end : 0,
|
|
2745
2748
|
count: E
|
|
2746
|
-
},
|
|
2749
|
+
}, ue = a.visible, le = !i && !c.server && _.some((oe) => oe.spec.aggregate), ee = c.search !== "" || Object.keys(c.filter).length > 0;
|
|
2747
2750
|
return {
|
|
2748
2751
|
snapshot: c,
|
|
2749
2752
|
projection: a,
|
|
2750
|
-
header:
|
|
2753
|
+
header: d,
|
|
2751
2754
|
detail: b,
|
|
2752
2755
|
actions: p,
|
|
2753
2756
|
virtual: m,
|
|
2754
2757
|
grouping: w,
|
|
2755
2758
|
lines: g,
|
|
2756
|
-
entryOf:
|
|
2759
|
+
entryOf: x,
|
|
2757
2760
|
spanEntry: y,
|
|
2758
2761
|
dataColumns: _,
|
|
2759
|
-
entries:
|
|
2760
|
-
tree:
|
|
2762
|
+
entries: S,
|
|
2763
|
+
tree: C,
|
|
2761
2764
|
expanderColumn: A,
|
|
2762
2765
|
controlColumns: L,
|
|
2763
|
-
leading:
|
|
2766
|
+
leading: k,
|
|
2764
2767
|
rowMode: O,
|
|
2765
2768
|
rowTools: M,
|
|
2766
2769
|
trailing: R,
|
|
2767
2770
|
columnCount: E,
|
|
2768
|
-
pins:
|
|
2769
|
-
pinned:
|
|
2771
|
+
pins: B,
|
|
2772
|
+
pinned: G,
|
|
2770
2773
|
blocks: ne,
|
|
2771
|
-
rows:
|
|
2774
|
+
rows: ue,
|
|
2772
2775
|
footerShown: le,
|
|
2773
2776
|
restricted: ee
|
|
2774
2777
|
};
|
|
@@ -2781,9 +2784,9 @@ function yn({
|
|
|
2781
2784
|
wording: o,
|
|
2782
2785
|
line: r
|
|
2783
2786
|
}) {
|
|
2784
|
-
const s = _e(
|
|
2785
|
-
|
|
2786
|
-
c ? b.current?.focus() :
|
|
2787
|
+
const s = _e(Pe), i = s?.editing?.row === !0 && s.editing.line !== r, l = s?.remove, [c, a] = V(!1), d = W(!1), u = W(null), b = W(null);
|
|
2788
|
+
xe(() => {
|
|
2789
|
+
c ? b.current?.focus() : d.current && u.current?.focus(), d.current = c;
|
|
2787
2790
|
}, [c]);
|
|
2788
2791
|
const p = (w) => {
|
|
2789
2792
|
if (i) return;
|
|
@@ -2795,8 +2798,8 @@ function yn({
|
|
|
2795
2798
|
a(!1), l(t);
|
|
2796
2799
|
}, children: o.deleteRow }),
|
|
2797
2800
|
/* @__PURE__ */ f(Q, { ref: b, size: "sm", variant: "ghost", "aria-label": o.rowAction(o.keepRow, n), onClick: () => a(!1), children: o.keepRow })
|
|
2798
|
-
] }) : /* @__PURE__ */ f(Q, { ref:
|
|
2799
|
-
return e.length <= Ul ? /* @__PURE__ */ T("div", { className:
|
|
2801
|
+
] }) : /* @__PURE__ */ f(Q, { ref: u, size: "sm", variant: "ghost", "aria-label": o.rowAction(o.deleteRow, n), onClick: () => !i && a(!0), children: o.deleteRow }));
|
|
2802
|
+
return e.length <= Ul ? /* @__PURE__ */ T("div", { className: F(h.actions, c && h.decision), children: [
|
|
2800
2803
|
!c && e.map(({ key: w, spec: g }) => /* @__PURE__ */ f(
|
|
2801
2804
|
Q,
|
|
2802
2805
|
{
|
|
@@ -2809,12 +2812,12 @@ function yn({
|
|
|
2809
2812
|
w
|
|
2810
2813
|
)),
|
|
2811
2814
|
m
|
|
2812
|
-
] }) : /* @__PURE__ */ T("div", { className:
|
|
2815
|
+
] }) : /* @__PURE__ */ T("div", { className: F(h.actions, c && h.decision), children: [
|
|
2813
2816
|
!c && /* @__PURE__ */ f(
|
|
2814
2817
|
Nn,
|
|
2815
2818
|
{
|
|
2816
2819
|
align: "end",
|
|
2817
|
-
trigger: /* @__PURE__ */ f(
|
|
2820
|
+
trigger: /* @__PURE__ */ f(Do, { size: "sm", variant: "ghost", "aria-label": o.rowActionsMenu(n), children: "⋯" }),
|
|
2818
2821
|
children: e.map(({ key: w, spec: g }) => /* @__PURE__ */ f(nt, { tone: g.tone, onSelect: () => p(g), children: g.label }, w))
|
|
2819
2822
|
}
|
|
2820
2823
|
),
|
|
@@ -2822,8 +2825,8 @@ function yn({
|
|
|
2822
2825
|
] });
|
|
2823
2826
|
}
|
|
2824
2827
|
function Jl({ name: e, wording: t }) {
|
|
2825
|
-
const n = _e(
|
|
2826
|
-
return /* @__PURE__ */ T("div", { ref: o, className:
|
|
2828
|
+
const n = _e(Pe), o = W(null);
|
|
2829
|
+
return /* @__PURE__ */ T("div", { ref: o, className: F(h.actions, h.decision, h.draftButtons), children: [
|
|
2827
2830
|
/* @__PURE__ */ f(Q, { className: h.toned, size: "sm", variant: "primary", "aria-label": t.rowAction(t.saveRow, e), onClick: n.save, children: t.saveRow }),
|
|
2828
2831
|
/* @__PURE__ */ f(Q, { size: "sm", variant: "ghost", "aria-label": t.rowAction(t.discardRow, e), onClick: n.discard, children: t.discardRow }),
|
|
2829
2832
|
/* @__PURE__ */ f(
|
|
@@ -2843,28 +2846,28 @@ function Jl({ name: e, wording: t }) {
|
|
|
2843
2846
|
}
|
|
2844
2847
|
function Xl({ columns: e, rightAligned: t = [], rows: n = 4 }) {
|
|
2845
2848
|
const o = [72, 48, 60, 40, 56, 64];
|
|
2846
|
-
return /* @__PURE__ */ f(re, { children: Array.from({ length: n }, (r, s) => /* @__PURE__ */ f("tr", { "aria-hidden": "true", children: Array.from({ length: e }, (i, l) => /* @__PURE__ */ f("td", { className:
|
|
2849
|
+
return /* @__PURE__ */ f(re, { children: Array.from({ length: n }, (r, s) => /* @__PURE__ */ f("tr", { "aria-hidden": "true", children: Array.from({ length: e }, (i, l) => /* @__PURE__ */ f("td", { className: F(h.td, t[l] && h.numeric), children: /* @__PURE__ */ f("span", { className: h.skeleton, style: { width: `${o[(s + l) % o.length]}%` } }) }, l)) }, s)) });
|
|
2847
2850
|
}
|
|
2848
|
-
const
|
|
2849
|
-
function
|
|
2851
|
+
const ko = /* @__PURE__ */ rt(0);
|
|
2852
|
+
function Ft({ height: e, colSpan: t }) {
|
|
2850
2853
|
return typeof e == "number" && e <= 0 ? null : /* @__PURE__ */ f("tr", { "aria-hidden": "true", "data-filler": "", className: h.fillerRow, children: /* @__PURE__ */ f("td", { colSpan: t, style: { height: e } }) });
|
|
2851
2854
|
}
|
|
2852
|
-
function
|
|
2855
|
+
function So({
|
|
2853
2856
|
virtual: e,
|
|
2854
2857
|
colSpan: t,
|
|
2855
2858
|
children: n
|
|
2856
2859
|
}) {
|
|
2857
|
-
const { count: o, fillerBefore: r, fillerAfter: s, showRow: i } = e, l =
|
|
2860
|
+
const { count: o, fillerBefore: r, fillerAfter: s, showRow: i } = e, l = W(null), [c, a] = V(0), d = (p, m) => {
|
|
2858
2861
|
l.current = m, a(m), i(m), requestAnimationFrame(() => {
|
|
2859
2862
|
p.querySelector(`[data-row="${m}"]`)?.focus();
|
|
2860
2863
|
});
|
|
2861
|
-
},
|
|
2864
|
+
}, u = c >= e.from && c < e.to ? c : e.from, b = (p) => {
|
|
2862
2865
|
if (p.defaultPrevented || o === 0) return;
|
|
2863
2866
|
const m = p.target, w = m.closest("[data-row]");
|
|
2864
2867
|
if (w && m !== w) return;
|
|
2865
2868
|
const g = w ? Number(w.dataset.row) : l.current ?? -1;
|
|
2866
2869
|
let v = null;
|
|
2867
|
-
p.key === "ArrowDown" ? v = Math.min(o - 1, g + 1) : p.key === "ArrowUp" ? v = Math.max(0, g - 1) : p.key === "Home" ? v = 0 : p.key === "End" && (v = o - 1), !(v === null || v === g) && (p.preventDefault(),
|
|
2870
|
+
p.key === "ArrowDown" ? v = Math.min(o - 1, g + 1) : p.key === "ArrowUp" ? v = Math.max(0, g - 1) : p.key === "Home" ? v = 0 : p.key === "End" && (v = o - 1), !(v === null || v === g) && (p.preventDefault(), d(p.currentTarget, v));
|
|
2868
2871
|
};
|
|
2869
2872
|
return /* @__PURE__ */ f(
|
|
2870
2873
|
"tbody",
|
|
@@ -2875,10 +2878,10 @@ function ko({
|
|
|
2875
2878
|
const m = p.target.closest("[data-row]");
|
|
2876
2879
|
m && a(Number(m.dataset.row));
|
|
2877
2880
|
},
|
|
2878
|
-
children: /* @__PURE__ */ T(
|
|
2879
|
-
/* @__PURE__ */ f(
|
|
2881
|
+
children: /* @__PURE__ */ T(ko, { value: u, children: [
|
|
2882
|
+
/* @__PURE__ */ f(Ft, { height: r, colSpan: t }),
|
|
2880
2883
|
n,
|
|
2881
|
-
/* @__PURE__ */ f(
|
|
2884
|
+
/* @__PURE__ */ f(Ft, { height: s, colSpan: t })
|
|
2882
2885
|
] })
|
|
2883
2886
|
}
|
|
2884
2887
|
);
|
|
@@ -2886,9 +2889,9 @@ function ko({
|
|
|
2886
2889
|
function Ql(e, t, n, o, r) {
|
|
2887
2890
|
if (!t) return n.rowKey(e);
|
|
2888
2891
|
const s = t.read(e);
|
|
2889
|
-
return se(s) ? r.cellAbsentValue :
|
|
2892
|
+
return se(s) ? r.cellAbsentValue : De(s, t.spec.format, o, r) ?? n.rowKey(e);
|
|
2890
2893
|
}
|
|
2891
|
-
function
|
|
2894
|
+
function Co({
|
|
2892
2895
|
row: e,
|
|
2893
2896
|
index: t,
|
|
2894
2897
|
absolute: n,
|
|
@@ -2899,68 +2902,68 @@ function So({
|
|
|
2899
2902
|
selectable: l,
|
|
2900
2903
|
actions: c,
|
|
2901
2904
|
blocks: a,
|
|
2902
|
-
columnCount:
|
|
2903
|
-
rowProps:
|
|
2905
|
+
columnCount: d,
|
|
2906
|
+
rowProps: u,
|
|
2904
2907
|
baseId: b,
|
|
2905
2908
|
formats: p,
|
|
2906
2909
|
wording: m,
|
|
2907
2910
|
line: w,
|
|
2908
2911
|
tree: g,
|
|
2909
2912
|
spanEntry: v,
|
|
2910
|
-
grid:
|
|
2913
|
+
grid: x,
|
|
2911
2914
|
trailing: y,
|
|
2912
2915
|
fresh: _ = !1
|
|
2913
2916
|
}) {
|
|
2914
|
-
const
|
|
2917
|
+
const S = _e(ko), C = r.publicSnapshot, A = _ ? he : r.rowKey(e), L = _ ? m.newRow : Ql(e, i, r, p, m), k = _ ? he : Ue(A), O = _e(Pe)?.editing, M = O?.row === !0 && O.line === k, R = o.detail, E = _ ? void 0 : g?.entry(e), B = _ ? null : vo(o, C, e, A, E), I = B !== null, D = B?.open ?? !1, z = B?.content, Y = `${b}-detail-${t}`, { className: ce, ...G } = u?.(e) ?? {}, ne = n !== void 0, ue = w ? w.span ?? w.parents.at(-1) : void 0, le = R !== null && !g, ee = (l ? 1 : 0) + (le ? 1 : 0), oe = ee + (v ? 1 : 0), H = (q) => ct(a, q), ge = E !== void 0 && E.branch && !E.empty;
|
|
2915
2918
|
return /* @__PURE__ */ T(re, { children: [
|
|
2916
2919
|
/* @__PURE__ */ T(
|
|
2917
2920
|
"tr",
|
|
2918
2921
|
{
|
|
2919
|
-
...
|
|
2920
|
-
className:
|
|
2922
|
+
...G,
|
|
2923
|
+
className: F(
|
|
2921
2924
|
ce,
|
|
2922
2925
|
ne && h.virtualRow,
|
|
2923
2926
|
E && h.treeRow,
|
|
2924
2927
|
ge && h.branchRow,
|
|
2925
2928
|
E?.pathOnly && h.pathRow
|
|
2926
2929
|
),
|
|
2927
|
-
"data-before-root": E && !
|
|
2930
|
+
"data-before-root": E && !D && g?.beforeRoot(A) ? "" : void 0,
|
|
2928
2931
|
"data-row": ne ? n : void 0,
|
|
2929
2932
|
"data-line": w ? "row" : void 0,
|
|
2930
2933
|
"data-motion": A,
|
|
2931
|
-
"data-selected": l &&
|
|
2934
|
+
"data-selected": l && C.selection.isSelected(A) ? "" : void 0,
|
|
2932
2935
|
"data-group-first": w?.first ? "" : void 0,
|
|
2933
|
-
"data-group":
|
|
2936
|
+
"data-group": ue?.path,
|
|
2934
2937
|
"aria-level": w ? w.parents.length + 1 : E ? E.level + 1 : void 0,
|
|
2935
|
-
"aria-posinset":
|
|
2936
|
-
"aria-setsize":
|
|
2938
|
+
"aria-posinset": ue ? ue.rows.indexOf(e) + 1 : E?.position,
|
|
2939
|
+
"aria-setsize": ue ? ue.rows.length : E?.siblings,
|
|
2937
2940
|
"aria-expanded": ge ? E.expanded : void 0,
|
|
2938
2941
|
"data-branch": ge ? E.expanded ? "open" : "closed" : void 0,
|
|
2939
|
-
tabIndex: ne && !
|
|
2940
|
-
"data-grid-line":
|
|
2942
|
+
tabIndex: ne && !x ? n === S ? 0 : -1 : void 0,
|
|
2943
|
+
"data-grid-line": x ? k : void 0,
|
|
2941
2944
|
"data-draft": M ? "" : void 0,
|
|
2942
2945
|
"data-even": ne && n % 2 === 1 ? "" : void 0,
|
|
2943
2946
|
"aria-rowindex": ne ? n + 2 : void 0,
|
|
2944
2947
|
children: [
|
|
2945
|
-
_ && Array.from({ length: ee + (v ? 1 : 0) }, (
|
|
2946
|
-
!_ && l && /* @__PURE__ */ f("td", { className:
|
|
2947
|
-
|
|
2948
|
+
_ && Array.from({ length: ee + (v ? 1 : 0) }, (q, ae) => /* @__PURE__ */ f("td", { className: F(h.td, ae < ee && h.control, H(ae).className), style: H(ae).style }, ae)),
|
|
2949
|
+
!_ && l && /* @__PURE__ */ f("td", { className: F(h.td, h.control, H(0).className), style: H(0).style, children: /* @__PURE__ */ f(
|
|
2950
|
+
He,
|
|
2948
2951
|
{
|
|
2949
2952
|
"aria-label": m.selectRow(L),
|
|
2950
|
-
checked:
|
|
2951
|
-
onChange: () =>
|
|
2953
|
+
checked: C.selection.isSelected(A),
|
|
2954
|
+
onChange: () => C.selection.toggle(A)
|
|
2952
2955
|
}
|
|
2953
2956
|
) }),
|
|
2954
|
-
!_ && le && /* @__PURE__ */ f("td", { className:
|
|
2957
|
+
!_ && le && /* @__PURE__ */ f("td", { className: F(h.td, h.control, H(ee - 1).className), style: H(ee - 1).style, children: I && /* @__PURE__ */ f(
|
|
2955
2958
|
"button",
|
|
2956
2959
|
{
|
|
2957
2960
|
type: "button",
|
|
2958
|
-
"aria-expanded":
|
|
2959
|
-
"aria-controls":
|
|
2960
|
-
"aria-label":
|
|
2961
|
-
className:
|
|
2962
|
-
onClick: () =>
|
|
2963
|
-
children: /* @__PURE__ */ f(
|
|
2961
|
+
"aria-expanded": D,
|
|
2962
|
+
"aria-controls": D ? Y : void 0,
|
|
2963
|
+
"aria-label": D ? m.collapseRowNamed(L) : m.expandRowNamed(L),
|
|
2964
|
+
className: F(h.expander, D && h.expanderOpen),
|
|
2965
|
+
onClick: () => C.toggleRow(A),
|
|
2966
|
+
children: /* @__PURE__ */ f(Po, {})
|
|
2964
2967
|
}
|
|
2965
2968
|
) }),
|
|
2966
2969
|
w && w.span && /* @__PURE__ */ f(
|
|
@@ -2969,27 +2972,27 @@ function So({
|
|
|
2969
2972
|
line: { ...w, span: w.span },
|
|
2970
2973
|
entry: v,
|
|
2971
2974
|
selectable: l,
|
|
2972
|
-
pin:
|
|
2975
|
+
pin: H(ee),
|
|
2973
2976
|
hook: r,
|
|
2974
2977
|
formats: p,
|
|
2975
2978
|
wording: m
|
|
2976
2979
|
}
|
|
2977
2980
|
),
|
|
2978
|
-
s.map((
|
|
2981
|
+
s.map((q, ae) => /* @__PURE__ */ f(
|
|
2979
2982
|
ta,
|
|
2980
2983
|
{
|
|
2981
|
-
entry:
|
|
2984
|
+
entry: q,
|
|
2982
2985
|
row: e,
|
|
2983
|
-
kind: o.kindOf(
|
|
2984
|
-
pin:
|
|
2986
|
+
kind: o.kindOf(q, r.rows),
|
|
2987
|
+
pin: H(oe + ae),
|
|
2985
2988
|
formats: p,
|
|
2986
2989
|
wording: m,
|
|
2987
|
-
line:
|
|
2990
|
+
line: k,
|
|
2988
2991
|
rowName: L,
|
|
2989
|
-
width:
|
|
2990
|
-
tree: E &&
|
|
2992
|
+
width: C.widths[q.spec.id],
|
|
2993
|
+
tree: E && q === g?.column ? { setup: g, entry: E, detail: I && !ge ? { open: D, toggle: () => C.toggleRow(A) } : void 0 } : void 0
|
|
2991
2994
|
},
|
|
2992
|
-
|
|
2995
|
+
q.key
|
|
2993
2996
|
)),
|
|
2994
2997
|
y && /* @__PURE__ */ f(
|
|
2995
2998
|
Zl,
|
|
@@ -2999,23 +3002,23 @@ function So({
|
|
|
2999
3002
|
row: e,
|
|
3000
3003
|
name: L,
|
|
3001
3004
|
wording: m,
|
|
3002
|
-
line:
|
|
3003
|
-
pin:
|
|
3005
|
+
line: k,
|
|
3006
|
+
pin: H(d - 1)
|
|
3004
3007
|
}
|
|
3005
3008
|
)
|
|
3006
3009
|
]
|
|
3007
3010
|
}
|
|
3008
3011
|
),
|
|
3009
|
-
|
|
3012
|
+
D && /* @__PURE__ */ f(
|
|
3010
3013
|
ea,
|
|
3011
3014
|
{
|
|
3012
3015
|
id: Y,
|
|
3013
|
-
group:
|
|
3014
|
-
gridLine:
|
|
3016
|
+
group: ue?.path,
|
|
3017
|
+
gridLine: x ? `detail:${A}` : void 0,
|
|
3015
3018
|
beforeRoot: E && g?.beforeRoot(A) ? "" : void 0,
|
|
3016
|
-
colSpan:
|
|
3019
|
+
colSpan: d,
|
|
3017
3020
|
entry: E,
|
|
3018
|
-
children:
|
|
3021
|
+
children: z
|
|
3019
3022
|
}
|
|
3020
3023
|
)
|
|
3021
3024
|
] });
|
|
@@ -3029,7 +3032,7 @@ function Zl({
|
|
|
3029
3032
|
line: s,
|
|
3030
3033
|
pin: i
|
|
3031
3034
|
}) {
|
|
3032
|
-
return /* @__PURE__ */ f("td", { className:
|
|
3035
|
+
return /* @__PURE__ */ f("td", { className: F(h.td, h.actionsCell, i.className, e && h.editing), style: i.style, children: e ? /* @__PURE__ */ T(re, { children: [
|
|
3033
3036
|
/* @__PURE__ */ f(Jl, { name: o, wording: r }),
|
|
3034
3037
|
/* @__PURE__ */ f("span", { className: h.held, "aria-hidden": "true", children: /* @__PURE__ */ f(yn, { actions: t, row: n, name: o, wording: r, line: s }) })
|
|
3035
3038
|
] }) : /* @__PURE__ */ f(yn, { actions: t, row: n, name: o, wording: r, line: s }) });
|
|
@@ -3047,7 +3050,7 @@ function ea({
|
|
|
3047
3050
|
"td",
|
|
3048
3051
|
{
|
|
3049
3052
|
colSpan: r,
|
|
3050
|
-
className:
|
|
3053
|
+
className: F(h.detailCell, s && h.treeDetail),
|
|
3051
3054
|
style: s ? { "--_table-tree-level": s.level } : void 0,
|
|
3052
3055
|
children: s ? /* @__PURE__ */ f("div", { className: h.treeDetailRail, children: i }) : i
|
|
3053
3056
|
}
|
|
@@ -3065,39 +3068,39 @@ function ta({
|
|
|
3065
3068
|
tree: c,
|
|
3066
3069
|
width: a
|
|
3067
3070
|
}) {
|
|
3068
|
-
const { spec:
|
|
3071
|
+
const { spec: d } = e, u = e.read(t), b = Pt(n, d.rightAligned), p = yl(i, d.id), w = !(_e(Pe) !== null) || d.edit === void 0 ? void 0 : d.edit === "text" || d.edit === "number" ? "type" : "pick";
|
|
3069
3072
|
let g;
|
|
3070
|
-
se(
|
|
3073
|
+
se(u) ? g = /* @__PURE__ */ f(go, { wording: s }) : d.presentation ? g = d.presentation(u, t) : g = De(u, d.format, r, s);
|
|
3071
3074
|
const v = typeof g == "string";
|
|
3072
3075
|
g = /* @__PURE__ */ f(
|
|
3073
3076
|
"div",
|
|
3074
3077
|
{
|
|
3075
|
-
className:
|
|
3078
|
+
className: F(h.value, v && h.valueText, a !== void 0 && h.sized, p && h.editingValue),
|
|
3076
3079
|
style: a !== void 0 ? { "--_table-width": `${a}px` } : void 0,
|
|
3077
3080
|
"aria-hidden": p ? !0 : void 0,
|
|
3078
3081
|
children: g
|
|
3079
3082
|
}
|
|
3080
|
-
), c && (g = /* @__PURE__ */ f(
|
|
3081
|
-
const
|
|
3083
|
+
), c && (g = /* @__PURE__ */ f(Bl, { ...c, name: l, wording: s, children: g }));
|
|
3084
|
+
const x = d.rowHeader ? "th" : "td";
|
|
3082
3085
|
return /* @__PURE__ */ T(
|
|
3083
|
-
|
|
3086
|
+
x,
|
|
3084
3087
|
{
|
|
3085
|
-
scope:
|
|
3086
|
-
className:
|
|
3088
|
+
scope: d.rowHeader ? "row" : void 0,
|
|
3089
|
+
className: F(h.td, b && h.numeric, d.rowHeader && h.rowHeader, o.className, p && h.editing),
|
|
3087
3090
|
style: o.style,
|
|
3088
3091
|
"data-edit": w,
|
|
3089
|
-
"data-editing": p ?
|
|
3092
|
+
"data-editing": p ? d.id : void 0,
|
|
3090
3093
|
children: [
|
|
3091
|
-
p && /* @__PURE__ */ f(
|
|
3094
|
+
p && /* @__PURE__ */ f(Cl, { entry: e, row: t, rowName: l, grid: p }),
|
|
3092
3095
|
g
|
|
3093
3096
|
]
|
|
3094
3097
|
}
|
|
3095
3098
|
);
|
|
3096
3099
|
}
|
|
3097
|
-
function
|
|
3100
|
+
function Bt(e, t, n, o, r) {
|
|
3098
3101
|
const { registry: s, hook: i, layout: l } = e;
|
|
3099
3102
|
return /* @__PURE__ */ f(
|
|
3100
|
-
|
|
3103
|
+
Co,
|
|
3101
3104
|
{
|
|
3102
3105
|
row: t,
|
|
3103
3106
|
index: n,
|
|
@@ -3126,7 +3129,7 @@ function Dt(e, t, n, o, r) {
|
|
|
3126
3129
|
function na(e, t) {
|
|
3127
3130
|
const { registry: n, hook: o, layout: r } = e;
|
|
3128
3131
|
return /* @__PURE__ */ f("tbody", { children: /* @__PURE__ */ f(
|
|
3129
|
-
|
|
3132
|
+
Co,
|
|
3130
3133
|
{
|
|
3131
3134
|
row: t.fresh,
|
|
3132
3135
|
fresh: !0,
|
|
@@ -3161,7 +3164,7 @@ function oa(e) {
|
|
|
3161
3164
|
rows: e.pageSize ? e.heldLines || e.pageSize : void 0,
|
|
3162
3165
|
rightAligned: [
|
|
3163
3166
|
...Array.from({ length: o.controlColumns + (o.spanEntry ? 1 : 0) }, () => !1),
|
|
3164
|
-
...o.dataColumns.map((r) =>
|
|
3167
|
+
...o.dataColumns.map((r) => Pt(t.kindOf(r, n.rows), r.spec.rightAligned))
|
|
3165
3168
|
]
|
|
3166
3169
|
}
|
|
3167
3170
|
) });
|
|
@@ -3182,7 +3185,7 @@ function ra(e) {
|
|
|
3182
3185
|
) }) });
|
|
3183
3186
|
}
|
|
3184
3187
|
function sa(e, t) {
|
|
3185
|
-
const { hook: n, layout: o, wording: r, formats: s } = e, { virtual: i, grouping: l, projection: c } = o, a = i ?
|
|
3188
|
+
const { hook: n, layout: o, wording: r, formats: s } = e, { virtual: i, grouping: l, projection: c } = o, a = i ? Fn(t).map((m) => m.kind === "folded" || !m.continued ? m : { ...m, continued: !1 }) : t, d = a.length - t.length, u = i && i.from > 0 ? i.fillerBefore / i.from : 0, b = (m, w, g, v) => /* @__PURE__ */ f(
|
|
3186
3189
|
Ml,
|
|
3187
3190
|
{
|
|
3188
3191
|
line: m,
|
|
@@ -3205,8 +3208,8 @@ function sa(e, t) {
|
|
|
3205
3208
|
},
|
|
3206
3209
|
w
|
|
3207
3210
|
), p = (m, w) => {
|
|
3208
|
-
const g = w -
|
|
3209
|
-
return g < 0 ? m.kind === "row" ? null : b(m, `${m.kind}:${m.group.path}:repeated`, w, void 0) : m.kind === "row" ?
|
|
3211
|
+
const g = w - d, v = i ? i.from + g : g;
|
|
3212
|
+
return g < 0 ? m.kind === "row" ? null : b(m, `${m.kind}:${m.group.path}:repeated`, w, void 0) : m.kind === "row" ? Bt(e, m.row, g, v, m) : b(
|
|
3210
3213
|
m,
|
|
3211
3214
|
`${m.kind}:${m.group.path}${m.kind === "header" && m.continued ? ":continued" : ""}`,
|
|
3212
3215
|
g,
|
|
@@ -3214,9 +3217,9 @@ function sa(e, t) {
|
|
|
3214
3217
|
);
|
|
3215
3218
|
};
|
|
3216
3219
|
return i ? /* @__PURE__ */ f(
|
|
3217
|
-
|
|
3220
|
+
So,
|
|
3218
3221
|
{
|
|
3219
|
-
virtual: { ...i, fillerBefore: Math.max(0, i.fillerBefore -
|
|
3222
|
+
virtual: { ...i, fillerBefore: Math.max(0, i.fillerBefore - d * u) },
|
|
3220
3223
|
colSpan: o.columnCount,
|
|
3221
3224
|
children: a.map(p)
|
|
3222
3225
|
}
|
|
@@ -3226,16 +3229,16 @@ function sa(e, t) {
|
|
|
3226
3229
|
] });
|
|
3227
3230
|
}
|
|
3228
3231
|
function ia(e, t, n, o) {
|
|
3229
|
-
return n && t > 0 && t < e ? /* @__PURE__ */ f(
|
|
3232
|
+
return n && t > 0 && t < e ? /* @__PURE__ */ f(Ft, { height: `calc(var(--_table-pitch) * ${e - t})`, colSpan: o }) : null;
|
|
3230
3233
|
}
|
|
3231
3234
|
function la(e, t, n) {
|
|
3232
3235
|
const { layout: o } = e, { virtual: r, lines: s, rows: i, projection: l } = o;
|
|
3233
3236
|
return t && !n ? { body: oa(e), empty: !1 } : l.filtered.length === 0 ? { body: ra(e), empty: !0 } : s ? { body: sa(e, s), empty: !1 } : r ? {
|
|
3234
|
-
body: /* @__PURE__ */ f(
|
|
3237
|
+
body: /* @__PURE__ */ f(So, { virtual: r, colSpan: o.columnCount, children: i.map((c, a) => Bt(e, c, a, r.from + a)) }),
|
|
3235
3238
|
empty: !1
|
|
3236
3239
|
} : {
|
|
3237
3240
|
body: /* @__PURE__ */ T("tbody", { children: [
|
|
3238
|
-
i.map((c, a) =>
|
|
3241
|
+
i.map((c, a) => Bt(e, c, a, a)),
|
|
3239
3242
|
e.filler
|
|
3240
3243
|
] }),
|
|
3241
3244
|
empty: !1
|
|
@@ -3247,61 +3250,61 @@ function _n({
|
|
|
3247
3250
|
hook: n,
|
|
3248
3251
|
pin: o
|
|
3249
3252
|
}) {
|
|
3250
|
-
const { spec: r } = e, s = n.publicSnapshot, i = t.kindOf(e, n.rows), l =
|
|
3251
|
-
|
|
3252
|
-
const
|
|
3253
|
+
const { spec: r } = e, s = n.publicSnapshot, i = t.kindOf(e, n.rows), l = Pt(i, r.rightAligned), c = t.isSortable(e, n.rows), a = r.id, d = s.sort.findIndex((S) => S.column === a), u = d === -1 ? void 0 : s.sort[d].direction, b = s.sort.length > 1 && d !== -1 ? d + 1 : void 0, p = s.widths[a], m = 48, w = (S) => {
|
|
3254
|
+
S.stopPropagation(), S.preventDefault();
|
|
3255
|
+
const C = S.currentTarget, A = C.closest("th");
|
|
3253
3256
|
if (!A) return;
|
|
3254
|
-
const L =
|
|
3255
|
-
|
|
3257
|
+
const L = S.clientX, k = A.getBoundingClientRect().width, O = S.pointerId;
|
|
3258
|
+
C.setPointerCapture(O);
|
|
3256
3259
|
const M = (E) => {
|
|
3257
|
-
E.pointerId === O && s.setWidth(a, Math.max(m,
|
|
3260
|
+
E.pointerId === O && s.setWidth(a, Math.max(m, k + (E.clientX - L)));
|
|
3258
3261
|
}, R = (E) => {
|
|
3259
|
-
E.pointerId === O && (
|
|
3262
|
+
E.pointerId === O && (C.removeEventListener("pointermove", M), C.removeEventListener("pointerup", R), C.removeEventListener("pointercancel", R), C.hasPointerCapture(O) && C.releasePointerCapture(O));
|
|
3260
3263
|
};
|
|
3261
|
-
|
|
3262
|
-
}, g = (
|
|
3263
|
-
const
|
|
3264
|
-
if (!
|
|
3265
|
-
const L = Array.from(
|
|
3266
|
-
|
|
3264
|
+
C.addEventListener("pointermove", M), C.addEventListener("pointerup", R), C.addEventListener("pointercancel", R);
|
|
3265
|
+
}, g = (S) => {
|
|
3266
|
+
const C = S?.parentElement, A = S?.closest("table");
|
|
3267
|
+
if (!S || !C || !A) return;
|
|
3268
|
+
const L = Array.from(C.children).indexOf(S), k = C.children.length, O = { cell: S.style.width, table: A.style.width };
|
|
3269
|
+
S.style.width = "", A.style.width = "auto";
|
|
3267
3270
|
let M = 0;
|
|
3268
3271
|
for (const R of Array.from(A.rows)) {
|
|
3269
|
-
if (R.cells.length !==
|
|
3272
|
+
if (R.cells.length !== k) continue;
|
|
3270
3273
|
const E = R.cells[L];
|
|
3271
3274
|
if (!E) continue;
|
|
3272
|
-
const
|
|
3273
|
-
M = Math.max(M, E.scrollWidth + Y,
|
|
3275
|
+
const B = E.querySelector(`.${h.value}`), I = getComputedStyle(E), D = (parseFloat(I.paddingLeft) || 0) + (parseFloat(I.paddingRight) || 0), z = E.querySelector(`.${h.headLabel}`), Y = z ? z.scrollWidth - z.clientWidth : 0;
|
|
3276
|
+
M = Math.max(M, E.scrollWidth + Y, B ? B.scrollWidth + D : 0);
|
|
3274
3277
|
}
|
|
3275
|
-
|
|
3276
|
-
}, v = (
|
|
3277
|
-
if (!r.resizable || !
|
|
3278
|
-
const
|
|
3279
|
-
if (!
|
|
3280
|
-
|
|
3281
|
-
const
|
|
3278
|
+
S.style.width = O.cell, A.style.width = O.table, M > 0 && s.setWidth(a, Math.max(m, M + 1));
|
|
3279
|
+
}, v = (S) => {
|
|
3280
|
+
if (!r.resizable || !S.altKey) return;
|
|
3281
|
+
const C = S.key === "ArrowRight", A = S.key === "ArrowLeft", L = S.key === "Home";
|
|
3282
|
+
if (!C && !A && !L) return;
|
|
3283
|
+
S.preventDefault();
|
|
3284
|
+
const k = S.currentTarget;
|
|
3282
3285
|
if (L) {
|
|
3283
|
-
g(
|
|
3286
|
+
g(k);
|
|
3284
3287
|
return;
|
|
3285
3288
|
}
|
|
3286
|
-
const O =
|
|
3287
|
-
s.setWidth(a, Math.max(m, O + (
|
|
3288
|
-
},
|
|
3289
|
+
const O = k.getBoundingClientRect().width, M = S.shiftKey ? 32 : 8;
|
|
3290
|
+
s.setWidth(a, Math.max(m, O + (C ? M : -M)));
|
|
3291
|
+
}, x = c ? /* @__PURE__ */ T(
|
|
3289
3292
|
"button",
|
|
3290
3293
|
{
|
|
3291
3294
|
type: "button",
|
|
3292
|
-
className:
|
|
3293
|
-
onClick: (
|
|
3295
|
+
className: F(h.sortButton, h.headLine),
|
|
3296
|
+
onClick: (S) => s.toggleSort(a, S.shiftKey || S.metaKey),
|
|
3294
3297
|
children: [
|
|
3295
3298
|
/* @__PURE__ */ f("span", { className: h.headLabel, children: r.label }),
|
|
3296
3299
|
b !== void 0 && /* @__PURE__ */ f("span", { className: h.sortRank, "aria-hidden": "true", children: b }),
|
|
3297
|
-
/* @__PURE__ */ f("span", { className:
|
|
3300
|
+
/* @__PURE__ */ f("span", { className: F(h.sortIndicator, u && h.sortActive), "aria-hidden": "true", children: u ? /* @__PURE__ */ f("svg", { viewBox: "0 0 10 10", width: "10", height: "10", "aria-hidden": "true", className: F(h.sortArrow, u === "desc" && h.sortArrowDesc), children: /* @__PURE__ */ f("path", { d: "M2.2 6.2 5 3.4l2.8 2.8", fill: "none", stroke: "currentColor", strokeWidth: "1.4", strokeLinecap: "round", strokeLinejoin: "round" }) }) : (
|
|
3298
3301
|
/* Drawn in the nominal box and set in the 12 pixels the indicator
|
|
3299
3302
|
takes, so that the head does not move. */
|
|
3300
3303
|
/* @__PURE__ */ f("svg", { viewBox: "0 0 10 10", width: "10", height: "12", "aria-hidden": "true", children: /* @__PURE__ */ f("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" }) })
|
|
3301
3304
|
) })
|
|
3302
3305
|
]
|
|
3303
3306
|
}
|
|
3304
|
-
) : /* @__PURE__ */ f("span", { className: h.headLine, children: /* @__PURE__ */ f("span", { className: h.headLabel, children: r.label }) }), y =
|
|
3307
|
+
) : /* @__PURE__ */ f("span", { className: h.headLine, children: /* @__PURE__ */ f("span", { className: h.headLabel, children: r.label }) }), y = u === "asc" ? "ascending" : u === "desc" ? "descending" : "none", _ = Ee(r.filter) !== void 0 && !(r.filter === "list" && i === "other");
|
|
3305
3308
|
return /* @__PURE__ */ T(
|
|
3306
3309
|
"th",
|
|
3307
3310
|
{
|
|
@@ -3310,25 +3313,25 @@ function _n({
|
|
|
3310
3313
|
"aria-sort": c ? y : void 0,
|
|
3311
3314
|
tabIndex: r.resizable && !c ? 0 : void 0,
|
|
3312
3315
|
onKeyDown: v,
|
|
3313
|
-
className:
|
|
3316
|
+
className: F(h.th, l && h.numeric, p !== void 0 && h.sized, o.className),
|
|
3314
3317
|
style: {
|
|
3315
3318
|
...p !== void 0 ? { width: p } : {},
|
|
3316
3319
|
...o.style
|
|
3317
3320
|
},
|
|
3318
3321
|
children: [
|
|
3319
3322
|
_ ? /* @__PURE__ */ T("span", { className: h.thFlex, children: [
|
|
3320
|
-
|
|
3321
|
-
/* @__PURE__ */ f(
|
|
3322
|
-
] }) :
|
|
3323
|
+
x,
|
|
3324
|
+
/* @__PURE__ */ f(Wi, { entry: e, registry: t, hook: n })
|
|
3325
|
+
] }) : x,
|
|
3323
3326
|
r.resizable && /* @__PURE__ */ f(
|
|
3324
3327
|
"span",
|
|
3325
3328
|
{
|
|
3326
3329
|
role: "presentation",
|
|
3327
3330
|
className: h.grip,
|
|
3328
3331
|
onPointerDown: w,
|
|
3329
|
-
onClick: (
|
|
3330
|
-
onDoubleClick: (
|
|
3331
|
-
|
|
3332
|
+
onClick: (S) => S.stopPropagation(),
|
|
3333
|
+
onDoubleClick: (S) => {
|
|
3334
|
+
S.stopPropagation(), g(S.currentTarget.closest("th"));
|
|
3332
3335
|
}
|
|
3333
3336
|
}
|
|
3334
3337
|
)
|
|
@@ -3343,10 +3346,10 @@ function aa({
|
|
|
3343
3346
|
props: o,
|
|
3344
3347
|
wording: r
|
|
3345
3348
|
}) {
|
|
3346
|
-
const { selectable: s = !1, grid: i = !1 } = o, { snapshot: l, virtual: c, spanEntry: a, dataColumns:
|
|
3349
|
+
const { selectable: s = !1, grid: i = !1 } = o, { snapshot: l, virtual: c, spanEntry: a, dataColumns: d, expanderColumn: u, controlColumns: b, leading: p, rowMode: m, rowTools: w, trailing: g, columnCount: v, blocks: x } = n, y = (_, S = _) => ct(x, _, S);
|
|
3347
3350
|
return /* @__PURE__ */ f("thead", { children: /* @__PURE__ */ T("tr", { "aria-rowindex": c ? 1 : void 0, "data-grid-line": Yt(i, "head"), children: [
|
|
3348
|
-
s && /* @__PURE__ */ f("th", { scope: "col", className:
|
|
3349
|
-
|
|
3351
|
+
s && /* @__PURE__ */ f("th", { scope: "col", className: F(h.th, h.control, y(0).className), style: y(0).style, children: /* @__PURE__ */ f(
|
|
3352
|
+
He,
|
|
3350
3353
|
{
|
|
3351
3354
|
"aria-label": l.server ? r.selectAllOnPage : r.selectAllRows,
|
|
3352
3355
|
checked: l.selection.allSelected,
|
|
@@ -3354,29 +3357,29 @@ function aa({
|
|
|
3354
3357
|
onChange: l.selection.toggleAll
|
|
3355
3358
|
}
|
|
3356
3359
|
) }),
|
|
3357
|
-
|
|
3360
|
+
u && /* @__PURE__ */ f(
|
|
3358
3361
|
"td",
|
|
3359
3362
|
{
|
|
3360
|
-
className:
|
|
3363
|
+
className: F(h.th, h.control, y(b - 1).className),
|
|
3361
3364
|
style: y(b - 1).style
|
|
3362
3365
|
}
|
|
3363
3366
|
),
|
|
3364
|
-
a && (e.columnById(a.spec.id) === a ? /* @__PURE__ */ f(_n, { entry: a, registry: e, hook: t, pin: y(b) }) : /* @__PURE__ */ f("th", { scope: "col", className:
|
|
3365
|
-
|
|
3367
|
+
a && (e.columnById(a.spec.id) === a ? /* @__PURE__ */ f(_n, { entry: a, registry: e, hook: t, pin: y(b) }) : /* @__PURE__ */ f("th", { scope: "col", className: F(h.th, y(b).className), style: y(b).style, children: a.spec.label })),
|
|
3368
|
+
d.map((_, S) => /* @__PURE__ */ f(_n, { entry: _, registry: e, hook: t, pin: y(p + S) }, _.key)),
|
|
3366
3369
|
g && /* @__PURE__ */ T(
|
|
3367
3370
|
"th",
|
|
3368
3371
|
{
|
|
3369
3372
|
scope: "col",
|
|
3370
|
-
className:
|
|
3373
|
+
className: F(h.th, h.actionsCell, y(v - 1).className),
|
|
3371
3374
|
style: y(v - 1).style,
|
|
3372
3375
|
children: [
|
|
3373
3376
|
/* @__PURE__ */ f(Oe, { children: r.rowActions }),
|
|
3374
3377
|
w && /* @__PURE__ */ T("span", { className: h.reserve, "aria-hidden": "true", children: [
|
|
3375
|
-
(m || o.onRowAdd) && /* @__PURE__ */ T("span", { className:
|
|
3378
|
+
(m || o.onRowAdd) && /* @__PURE__ */ T("span", { className: F(h.actions, h.decision), children: [
|
|
3376
3379
|
/* @__PURE__ */ f(Q, { tabIndex: -1, size: "sm", children: r.saveRow }),
|
|
3377
3380
|
/* @__PURE__ */ f(Q, { tabIndex: -1, size: "sm", children: r.discardRow })
|
|
3378
3381
|
] }),
|
|
3379
|
-
o.onRowDelete && /* @__PURE__ */ T("span", { className:
|
|
3382
|
+
o.onRowDelete && /* @__PURE__ */ T("span", { className: F(h.actions, h.decision), children: [
|
|
3380
3383
|
/* @__PURE__ */ f("span", { className: h.deleteAsk, children: r.deleteRowAsk }),
|
|
3381
3384
|
/* @__PURE__ */ f(Q, { tabIndex: -1, size: "sm", children: r.deleteRow }),
|
|
3382
3385
|
/* @__PURE__ */ f(Q, { tabIndex: -1, size: "sm", children: r.keepRow })
|
|
@@ -3393,12 +3396,12 @@ function ca({
|
|
|
3393
3396
|
formats: n,
|
|
3394
3397
|
wording: o
|
|
3395
3398
|
}) {
|
|
3396
|
-
const { projection: r, virtual: s, spanEntry: i, dataColumns: l, controlColumns: c, leading: a, trailing:
|
|
3399
|
+
const { projection: r, virtual: s, spanEntry: i, dataColumns: l, controlColumns: c, leading: a, trailing: d, columnCount: u, blocks: b } = e, p = (m, w = m) => ct(b, m, w);
|
|
3397
3400
|
return /* @__PURE__ */ f("tfoot", { children: /* @__PURE__ */ T("tr", { "aria-rowindex": s ? (r.lines ?? r.shown ?? r.filtered).length + 2 : void 0, "data-grid-line": Yt(t, "foot"), children: [
|
|
3398
|
-
Array.from({ length: c }, (m, w) => /* @__PURE__ */ f("td", { className:
|
|
3399
|
-
i && /* @__PURE__ */ f("td", { className:
|
|
3401
|
+
Array.from({ length: c }, (m, w) => /* @__PURE__ */ f("td", { className: F(h.td, h.control, p(w).className), style: p(w).style }, w)),
|
|
3402
|
+
i && /* @__PURE__ */ f("td", { className: F(h.td, p(c).className), style: p(c).style }),
|
|
3400
3403
|
l.map((m, w) => /* @__PURE__ */ f(
|
|
3401
|
-
|
|
3404
|
+
ua,
|
|
3402
3405
|
{
|
|
3403
3406
|
entry: m,
|
|
3404
3407
|
rows: r.roots ?? r.filtered,
|
|
@@ -3409,10 +3412,10 @@ function ca({
|
|
|
3409
3412
|
},
|
|
3410
3413
|
m.key
|
|
3411
3414
|
)),
|
|
3412
|
-
|
|
3415
|
+
d && /* @__PURE__ */ f("td", { className: F(h.td, p(u - 1).className), style: p(u - 1).style })
|
|
3413
3416
|
] }) });
|
|
3414
3417
|
}
|
|
3415
|
-
function
|
|
3418
|
+
function ua({
|
|
3416
3419
|
entry: e,
|
|
3417
3420
|
rows: t,
|
|
3418
3421
|
formats: n,
|
|
@@ -3420,12 +3423,12 @@ function da({
|
|
|
3420
3423
|
pin: r = wo,
|
|
3421
3424
|
topLevel: s = !1
|
|
3422
3425
|
}) {
|
|
3423
|
-
if (!e.spec.aggregate) return /* @__PURE__ */ f("td", { className:
|
|
3426
|
+
if (!e.spec.aggregate) return /* @__PURE__ */ f("td", { className: F(h.td, r.className), style: r.style });
|
|
3424
3427
|
const i = typeof e.spec.aggregate == "function" ? "own" : e.spec.aggregate;
|
|
3425
3428
|
return /* @__PURE__ */ T(
|
|
3426
3429
|
"td",
|
|
3427
3430
|
{
|
|
3428
|
-
className:
|
|
3431
|
+
className: F(h.td, mo(e, t) && h.numeric, r.className),
|
|
3429
3432
|
style: r.style,
|
|
3430
3433
|
"data-footer": i,
|
|
3431
3434
|
title: s ? o.footerTopLevel : void 0,
|
|
@@ -3436,37 +3439,37 @@ function da({
|
|
|
3436
3439
|
}
|
|
3437
3440
|
);
|
|
3438
3441
|
}
|
|
3439
|
-
function
|
|
3442
|
+
function da({
|
|
3440
3443
|
table: e,
|
|
3441
3444
|
blocks: t,
|
|
3442
3445
|
onSticking: n,
|
|
3443
3446
|
pinnedKeys: o
|
|
3444
3447
|
}) {
|
|
3445
|
-
const { start: r, end: s } = t, i =
|
|
3448
|
+
const { start: r, end: s } = t, i = W({
|
|
3446
3449
|
key: "",
|
|
3447
3450
|
sticking: { start: !0, end: !0 }
|
|
3448
3451
|
}), l = () => {
|
|
3449
3452
|
const c = e.current, a = c?.parentElement;
|
|
3450
3453
|
if (!c || !a || (a.style.removeProperty("scroll-padding-left"), a.style.removeProperty("scroll-padding-right"), !r && !s)) return;
|
|
3451
|
-
const
|
|
3452
|
-
let
|
|
3454
|
+
const d = Array.from(c.tHead?.rows?.[0]?.cells ?? []);
|
|
3455
|
+
let u = 0;
|
|
3453
3456
|
for (let g = 0; g < r; g++)
|
|
3454
|
-
c.style.setProperty(`--u-table-pin-start-${g}`, `${
|
|
3457
|
+
c.style.setProperty(`--u-table-pin-start-${g}`, `${u}px`), u += d[g]?.getBoundingClientRect().width ?? 0;
|
|
3455
3458
|
let b = 0;
|
|
3456
3459
|
for (let g = 0; g < s; g++)
|
|
3457
|
-
c.style.setProperty(`--u-table-pin-end-${g}`, `${b}px`), b +=
|
|
3460
|
+
c.style.setProperty(`--u-table-pin-end-${g}`, `${b}px`), b += d[d.length - 1 - g]?.getBoundingClientRect().width ?? 0;
|
|
3458
3461
|
const p = `${r}|${s}|${t.count}|${o}`;
|
|
3459
3462
|
i.current.key !== p && (i.current = { key: p, sticking: i.current.sticking });
|
|
3460
3463
|
const m = i.current;
|
|
3461
|
-
m.sticking.start && (m.start =
|
|
3462
|
-
const w = ir(m.start ??
|
|
3463
|
-
m.sticking = w, n(w), w.start || (
|
|
3464
|
+
m.sticking.start && (m.start = u), m.sticking.end && (m.end = b);
|
|
3465
|
+
const w = ir(m.start ?? u, m.end ?? b, a.clientWidth);
|
|
3466
|
+
m.sticking = w, n(w), w.start || (u = 0), w.end || (b = 0), c.style.setProperty("--u-table-pin-start", `${u}px`), c.style.setProperty("--u-table-pin-end", `${b}px`), u && a.style.setProperty("scroll-padding-left", `${u}px`), b && a.style.setProperty("scroll-padding-right", `${b}px`), yo(a);
|
|
3464
3467
|
};
|
|
3465
|
-
return Z(l),
|
|
3468
|
+
return Z(l), xe(() => {
|
|
3466
3469
|
const c = e.current;
|
|
3467
3470
|
if (!c || !r && !s || typeof ResizeObserver > "u") return;
|
|
3468
|
-
const a = new ResizeObserver(l),
|
|
3469
|
-
for (const
|
|
3471
|
+
const a = new ResizeObserver(l), d = Array.from(c.tHead?.rows?.[0]?.cells ?? []);
|
|
3472
|
+
for (const u of [...d.slice(0, r), ...d.slice(d.length - s)]) a.observe(u);
|
|
3470
3473
|
return c.parentElement && a.observe(c.parentElement), () => a.disconnect();
|
|
3471
3474
|
}, [e, r, s, t.count, o]), null;
|
|
3472
3475
|
}
|
|
@@ -3481,15 +3484,15 @@ function fa({ table: e }) {
|
|
|
3481
3484
|
}, [e]), null;
|
|
3482
3485
|
}
|
|
3483
3486
|
function ha({ table: e, blocks: t }) {
|
|
3484
|
-
const n =
|
|
3487
|
+
const n = W(t);
|
|
3485
3488
|
return Z(() => {
|
|
3486
3489
|
n.current = t;
|
|
3487
3490
|
const o = e.current?.parentElement;
|
|
3488
|
-
o &&
|
|
3489
|
-
}),
|
|
3491
|
+
o && qt(o, t);
|
|
3492
|
+
}), xe(() => {
|
|
3490
3493
|
const o = e.current, r = o?.parentElement;
|
|
3491
3494
|
if (!o || !r || typeof ResizeObserver > "u") return;
|
|
3492
|
-
const s = new ResizeObserver(() =>
|
|
3495
|
+
const s = new ResizeObserver(() => qt(r, n.current));
|
|
3493
3496
|
return s.observe(r), s.observe(o), () => s.disconnect();
|
|
3494
3497
|
}, [e]), null;
|
|
3495
3498
|
}
|
|
@@ -3503,34 +3506,34 @@ function ga({ registry: e, props: t }) {
|
|
|
3503
3506
|
empty: l,
|
|
3504
3507
|
loading: c = !1,
|
|
3505
3508
|
rowProps: a,
|
|
3506
|
-
ariaLabel:
|
|
3507
|
-
grid:
|
|
3509
|
+
ariaLabel: d,
|
|
3510
|
+
grid: u = !1
|
|
3508
3511
|
} = t;
|
|
3509
3512
|
st(e.subscribe, e.bodyVersion, e.bodyVersion);
|
|
3510
|
-
const b = ie(), p =
|
|
3511
|
-
|
|
3512
|
-
const
|
|
3513
|
-
ol(g,
|
|
3513
|
+
const b = ie(), p = ke(), m = Vo(s, "regular"), w = be(), g = W(null), [v, x] = V(0), y = ul(), [_, S] = V({ start: !0, end: !0 });
|
|
3514
|
+
zl(e, y), Kl(g, o), Gl(e, g), jl(e, g, c), Hl(g), Wl(e, g);
|
|
3515
|
+
const C = e.hook && !e.hook.tableState.virtual ? e.hook.publicSnapshot : null;
|
|
3516
|
+
ol(g, C ? `${C.grouping.join("|")}#${C.folded.join("|")}` : "");
|
|
3514
3517
|
const A = e.hook;
|
|
3515
3518
|
if (!A) return null;
|
|
3516
|
-
const L = y.state.editing?.row === !0,
|
|
3517
|
-
e.setAddRow(
|
|
3518
|
-
const
|
|
3519
|
-
Ae > v &&
|
|
3520
|
-
const
|
|
3519
|
+
const L = y.state.editing?.row === !0, k = Yl({ registry: e, hook: A, props: t, drafting: L, sticking: _ }), { snapshot: O, projection: M, virtual: R, lines: E, entries: B, grouping: I, dataColumns: D, columnCount: z, pins: Y, pinned: ce, blocks: G, rows: ne, footerShown: ue } = k, { lines: le, fresh: ee, ids: oe, events: H } = Pl({ registry: e, hook: A, props: t, layout: k, grid: y }), ge = Il({ registry: e, hook: A, grid: y, gridMode: u, gridLines: le, dataColumns: D, formats: p, wording: b, tableElement: () => g.current });
|
|
3520
|
+
e.setAddRow(H?.addRow ?? null);
|
|
3521
|
+
const q = (e.paginates() || O.server) && !R ? O.pageSize : 0, ae = E ? E.length : ne.length, Ae = q && !c ? Math.min(ae, q) : 0;
|
|
3522
|
+
Ae > v && x(Ae);
|
|
3523
|
+
const de = Math.min(Math.max(Ae, v, O.pageCount > 1 ? q : 0), q), Ne = c && ae > 0, Me = {
|
|
3521
3524
|
registry: e,
|
|
3522
3525
|
hook: A,
|
|
3523
|
-
layout:
|
|
3526
|
+
layout: k,
|
|
3524
3527
|
selectable: n,
|
|
3525
|
-
gridMode:
|
|
3528
|
+
gridMode: u,
|
|
3526
3529
|
empty: l,
|
|
3527
3530
|
rowProps: a,
|
|
3528
3531
|
baseId: w,
|
|
3529
3532
|
formats: p,
|
|
3530
3533
|
wording: b,
|
|
3531
|
-
pageSize:
|
|
3532
|
-
heldLines:
|
|
3533
|
-
filler: ia(
|
|
3534
|
+
pageSize: q,
|
|
3535
|
+
heldLines: de,
|
|
3536
|
+
filler: ia(de, ae, q, z)
|
|
3534
3537
|
}, pe = la(Me, c, Ne);
|
|
3535
3538
|
return /* @__PURE__ */ T(re, { children: [
|
|
3536
3539
|
/* @__PURE__ */ T(
|
|
@@ -3538,7 +3541,7 @@ function ga({ registry: e, props: t }) {
|
|
|
3538
3541
|
{
|
|
3539
3542
|
ref: R?.scrollRef,
|
|
3540
3543
|
onScroll: (U) => {
|
|
3541
|
-
R?.onScroll(), E && o && _o(U.currentTarget), (
|
|
3544
|
+
R?.onScroll(), E && o && _o(U.currentTarget), (G.start || G.end) && yo(U.currentTarget), qt(U.currentTarget, G);
|
|
3542
3545
|
},
|
|
3543
3546
|
onKeyDown: ge,
|
|
3544
3547
|
onAnimationEnd: (U) => U.target.removeAttribute("data-copied"),
|
|
@@ -3549,56 +3552,56 @@ function ga({ registry: e, props: t }) {
|
|
|
3549
3552
|
"table",
|
|
3550
3553
|
{
|
|
3551
3554
|
ref: g,
|
|
3552
|
-
role: E ||
|
|
3553
|
-
"aria-readonly":
|
|
3554
|
-
onKeyDown:
|
|
3555
|
-
onFocus:
|
|
3556
|
-
onClick:
|
|
3557
|
-
onBlur:
|
|
3558
|
-
"data-depth": E ?
|
|
3559
|
-
style: E ? { "--u-header-levels":
|
|
3560
|
-
"aria-label":
|
|
3561
|
-
"aria-rowcount": R ? (M.lines ?? M.shown ?? M.filtered).length + 1 + (
|
|
3555
|
+
role: E || B ? "treegrid" : u ? "grid" : void 0,
|
|
3556
|
+
"aria-readonly": u && !D.some((U) => U.spec.edit !== void 0) ? !0 : void 0,
|
|
3557
|
+
onKeyDown: H?.onKeyDown,
|
|
3558
|
+
onFocus: H?.onFocus,
|
|
3559
|
+
onClick: H?.onClick,
|
|
3560
|
+
onBlur: H?.onBlur,
|
|
3561
|
+
"data-depth": E ? I.length : void 0,
|
|
3562
|
+
style: E ? { "--u-header-levels": I.length - 1 } : void 0,
|
|
3563
|
+
"aria-label": d,
|
|
3564
|
+
"aria-rowcount": R ? (M.lines ?? M.shown ?? M.filtered).length + 1 + (ue ? 1 : 0) : void 0,
|
|
3562
3565
|
"aria-busy": c || void 0,
|
|
3563
3566
|
"data-stale": Ne || void 0,
|
|
3564
|
-
className:
|
|
3567
|
+
className: F(
|
|
3565
3568
|
h.table,
|
|
3566
3569
|
m === "compact" && h.compact,
|
|
3567
3570
|
o && h.sticky,
|
|
3568
3571
|
r && h.striped,
|
|
3569
|
-
|
|
3572
|
+
u && h.grid
|
|
3570
3573
|
),
|
|
3571
3574
|
children: [
|
|
3572
|
-
/* @__PURE__ */ f(aa, { registry: e, hook: A, layout:
|
|
3573
|
-
/* @__PURE__ */ T(
|
|
3575
|
+
/* @__PURE__ */ f(aa, { registry: e, hook: A, layout: k, props: t, wording: b }),
|
|
3576
|
+
/* @__PURE__ */ T(Pe, { value: H ? { ...H.context, hook: A, wording: b } : null, children: [
|
|
3574
3577
|
ee && na(Me, ee),
|
|
3575
3578
|
pe.body
|
|
3576
3579
|
] }),
|
|
3577
|
-
|
|
3580
|
+
ue && /* @__PURE__ */ f(ca, { layout: k, gridMode: u, formats: p, wording: b })
|
|
3578
3581
|
]
|
|
3579
3582
|
}
|
|
3580
3583
|
) }),
|
|
3581
3584
|
pe.empty && /* @__PURE__ */ f(fa, { table: g }),
|
|
3582
|
-
/* @__PURE__ */ f(ha, { table: g, blocks:
|
|
3583
|
-
/* @__PURE__ */ f(
|
|
3585
|
+
/* @__PURE__ */ f(ha, { table: g, blocks: G }),
|
|
3586
|
+
/* @__PURE__ */ f($l, { table: g }),
|
|
3584
3587
|
/* @__PURE__ */ f(
|
|
3585
|
-
|
|
3588
|
+
da,
|
|
3586
3589
|
{
|
|
3587
3590
|
table: g,
|
|
3588
3591
|
blocks: ce,
|
|
3589
|
-
onSticking: (U) =>
|
|
3590
|
-
pinnedKeys:
|
|
3592
|
+
onSticking: (U) => S((Se) => Se.start === U.start && Se.end === U.end ? Se : U),
|
|
3593
|
+
pinnedKeys: D.filter((U) => Y[U.spec.id]).map((U) => U.key).join("|")
|
|
3591
3594
|
}
|
|
3592
3595
|
),
|
|
3593
|
-
|
|
3594
|
-
|
|
3596
|
+
u && /* @__PURE__ */ f(
|
|
3597
|
+
kl,
|
|
3595
3598
|
{
|
|
3596
3599
|
table: g,
|
|
3597
3600
|
grid: y,
|
|
3598
3601
|
lines: le,
|
|
3599
3602
|
ids: oe,
|
|
3600
|
-
editable:
|
|
3601
|
-
outside:
|
|
3603
|
+
editable: D.some((U) => U.spec.edit !== void 0) ? H?.editable : void 0,
|
|
3604
|
+
outside: H?.outside
|
|
3602
3605
|
}
|
|
3603
3606
|
)
|
|
3604
3607
|
]
|
|
@@ -3636,7 +3639,7 @@ function pa(e) {
|
|
|
3636
3639
|
validate: e.validate
|
|
3637
3640
|
};
|
|
3638
3641
|
}
|
|
3639
|
-
function
|
|
3642
|
+
function Ke(e, t, n, o, r) {
|
|
3640
3643
|
Z(
|
|
3641
3644
|
() => () => {
|
|
3642
3645
|
n(), e.commit();
|
|
@@ -3649,40 +3652,40 @@ function Ge(e, t, n, o, r) {
|
|
|
3649
3652
|
}
|
|
3650
3653
|
function ma(e) {
|
|
3651
3654
|
function t(c) {
|
|
3652
|
-
const a = be(),
|
|
3653
|
-
return e.registerColumn(a,
|
|
3654
|
-
e.ensureColumn(a,
|
|
3655
|
-
}, !0),
|
|
3656
|
-
`foreign:${
|
|
3657
|
-
`The column "${
|
|
3655
|
+
const a = be(), d = _e(Rt), u = pa(c);
|
|
3656
|
+
return e.registerColumn(a, u), Ke(e, a, () => e.removeColumn(a), () => {
|
|
3657
|
+
e.ensureColumn(a, u);
|
|
3658
|
+
}, !0), Kt && d && d.registry !== e && X(
|
|
3659
|
+
`foreign:${u.id}`,
|
|
3660
|
+
`The column "${u.id}" comes from a different useTable call than the table it stands in. It reads the rows of its own hook.`
|
|
3658
3661
|
), /* @__PURE__ */ f("span", { hidden: !0, "data-umriss-column": a });
|
|
3659
3662
|
}
|
|
3660
3663
|
function n({ children: c }) {
|
|
3661
3664
|
const a = be();
|
|
3662
|
-
return e.registerDetail(a, c),
|
|
3665
|
+
return e.registerDetail(a, c), Ke(e, a, () => e.removeDetail(a), () => {
|
|
3663
3666
|
e.detail || e.registerDetail(a, c);
|
|
3664
3667
|
}, !1), null;
|
|
3665
3668
|
}
|
|
3666
3669
|
function o({ children: c, pin: a = !0 }) {
|
|
3667
|
-
const
|
|
3668
|
-
return e.registerActionGroup(
|
|
3669
|
-
e.registerActionGroup(
|
|
3670
|
+
const d = be();
|
|
3671
|
+
return e.registerActionGroup(d, a), Ke(e, d, () => e.removeActionGroup(d), () => {
|
|
3672
|
+
e.registerActionGroup(d, a);
|
|
3670
3673
|
}, !1), /* @__PURE__ */ f(re, { children: c });
|
|
3671
3674
|
}
|
|
3672
3675
|
function r(c) {
|
|
3673
|
-
const a = be(),
|
|
3676
|
+
const a = be(), d = {
|
|
3674
3677
|
label: c.children,
|
|
3675
3678
|
bulk: c.bulk === !0,
|
|
3676
3679
|
tone: c.tone ?? "default",
|
|
3677
3680
|
onSelect: c.onSelect
|
|
3678
3681
|
};
|
|
3679
|
-
return e.registerAction(a,
|
|
3680
|
-
e.ensureAction(a,
|
|
3682
|
+
return e.registerAction(a, d), Ke(e, a, () => e.removeAction(a), () => {
|
|
3683
|
+
e.ensureAction(a, d);
|
|
3681
3684
|
}, !0), /* @__PURE__ */ f("span", { hidden: !0, "data-umriss-action": a });
|
|
3682
3685
|
}
|
|
3683
3686
|
function s(c) {
|
|
3684
|
-
const a = be(),
|
|
3685
|
-
id: c.id ??
|
|
3687
|
+
const a = be(), d = typeof c.value == "string" ? c.value : void 0, b = {
|
|
3688
|
+
id: c.id ?? d ?? c.label,
|
|
3686
3689
|
label: c.label,
|
|
3687
3690
|
value: c.value,
|
|
3688
3691
|
rowHeader: !1,
|
|
@@ -3691,26 +3694,26 @@ function ma(e) {
|
|
|
3691
3694
|
group: c.group,
|
|
3692
3695
|
groupable: !0
|
|
3693
3696
|
};
|
|
3694
|
-
return e.registerGroupKey(a, b),
|
|
3697
|
+
return e.registerGroupKey(a, b), Ke(e, a, () => e.removeGroupKey(a), () => {
|
|
3695
3698
|
e.ensureGroupKey(a, b);
|
|
3696
3699
|
}, !0), /* @__PURE__ */ f("span", { hidden: !0, "data-umriss-groupkey": a });
|
|
3697
3700
|
}
|
|
3698
3701
|
function i(c) {
|
|
3699
3702
|
e.beginPass(), e.setStickyRowHeader(c.stickyRowHeader === !0), e.setTableGroupable(c.groupable !== !1), e.setRowAdding(c.grid === !0 && c.onRowAdd !== void 0), e.server && c.groupable === !0 && X("server-groupable", "`groupable` is passed over in server mode: the groups would be the page's, not the server's.");
|
|
3700
|
-
const a =
|
|
3703
|
+
const a = W(null), [d, u] = V(null);
|
|
3701
3704
|
Z(() => {
|
|
3702
3705
|
e.children = a.current, e.checkOrder(), e.commit();
|
|
3703
3706
|
});
|
|
3704
|
-
const b =
|
|
3705
|
-
return /* @__PURE__ */ f(Rt, { value: b, children: /* @__PURE__ */ T("div", { className:
|
|
3707
|
+
const b = j(() => ({ registry: e, footerTarget: d }), [d]);
|
|
3708
|
+
return /* @__PURE__ */ f(Rt, { value: b, children: /* @__PURE__ */ T("div", { className: F(h.frame, c.className), children: [
|
|
3706
3709
|
/* @__PURE__ */ f("div", { ref: a, className: h.children, children: c.children }),
|
|
3707
3710
|
/* @__PURE__ */ f(wa, { registry: e }),
|
|
3708
3711
|
/* @__PURE__ */ f(ga, { registry: e, props: c }),
|
|
3709
|
-
/* @__PURE__ */ f("div", { ref:
|
|
3712
|
+
/* @__PURE__ */ f("div", { ref: u, className: h.footerTarget })
|
|
3710
3713
|
] }) });
|
|
3711
3714
|
}
|
|
3712
3715
|
const l = { Table: i, Column: t, RowDetail: n, RowActions: o, Action: r, GroupBy: s };
|
|
3713
|
-
return
|
|
3716
|
+
return Vi(i, e), l;
|
|
3714
3717
|
}
|
|
3715
3718
|
function wa({ registry: e }) {
|
|
3716
3719
|
return st(e.subscribe, e.bodyVersion, e.bodyVersion), !e.hook || !e.needsOwnToolbar() ? null : /* @__PURE__ */ f(lo, { registry: e, own: !0 });
|
|
@@ -3720,37 +3723,37 @@ const ba = "_verdict_1mxfd_6", va = "_glyph_1mxfd_13", ya = "_value_1mxfd_23", _
|
|
|
3720
3723
|
glyph: va,
|
|
3721
3724
|
value: ya,
|
|
3722
3725
|
excess: _a
|
|
3723
|
-
},
|
|
3726
|
+
}, kn = (e, t, n) => t === "percent" ? n.percent(e) : t === "count" ? n.count(e) : n.number(e, typeof t == "object" ? t.decimals : void 0), ka = (e, t) => e === "alarm" ? t.verdictAlarm : e === "warning" ? t.verdictWarning : e === "unknown" ? t.verdictUnknown : t.verdictOk, Sa = {
|
|
3724
3727
|
ok: "✓",
|
|
3725
3728
|
unknown: "?",
|
|
3726
3729
|
warning: "▲",
|
|
3727
3730
|
alarm: "■"
|
|
3728
3731
|
};
|
|
3729
|
-
function
|
|
3730
|
-
const n =
|
|
3732
|
+
function Ca({ reading: e, format: t }) {
|
|
3733
|
+
const n = ke(), o = ie(), { measured: r, assessment: s } = e, i = ka(s.verdict, o);
|
|
3731
3734
|
return /* @__PURE__ */ T("span", { className: Ze.verdict, "data-verdict": s.verdict, title: i, children: [
|
|
3732
|
-
/* @__PURE__ */ f("span", { "aria-hidden": "true", className: Ze.glyph, children:
|
|
3733
|
-
/* @__PURE__ */ f("span", { className: Ze.value, children: r === null ? o.statAbsentValue :
|
|
3735
|
+
/* @__PURE__ */ f("span", { "aria-hidden": "true", className: Ze.glyph, children: Sa[s.verdict] }),
|
|
3736
|
+
/* @__PURE__ */ f("span", { className: Ze.value, children: r === null ? o.statAbsentValue : kn(r, t, n) }),
|
|
3734
3737
|
s.excess !== void 0 && /* @__PURE__ */ T("span", { className: Ze.excess, children: [
|
|
3735
3738
|
"+",
|
|
3736
|
-
|
|
3739
|
+
kn(s.excess, t, n)
|
|
3737
3740
|
] }),
|
|
3738
3741
|
/* @__PURE__ */ f(Oe, { children: i })
|
|
3739
3742
|
] });
|
|
3740
3743
|
}
|
|
3741
|
-
const
|
|
3744
|
+
const xa = (e) => e.measured, Aa = (e) => e.reduce(
|
|
3742
3745
|
(t, n) => !t || _t(n.assessment.verdict) > _t(t.assessment.verdict) ? n : t,
|
|
3743
3746
|
void 0
|
|
3744
3747
|
);
|
|
3745
3748
|
function Na(e) {
|
|
3746
|
-
return function({ id: n, value: o, label: r, limits: s, format: i, sortBy: l = "verdict", width: c, resizable: a, pin:
|
|
3747
|
-
const b = JSON.stringify(s), p =
|
|
3749
|
+
return function({ id: n, value: o, label: r, limits: s, format: i, sortBy: l = "verdict", width: c, resizable: a, pin: d, aggregate: u }) {
|
|
3750
|
+
const b = JSON.stringify(s), p = j(() => {
|
|
3748
3751
|
const w = JSON.parse(b);
|
|
3749
3752
|
return (g) => {
|
|
3750
3753
|
const v = typeof o == "string" ? g?.[o] : o(g);
|
|
3751
3754
|
return {
|
|
3752
3755
|
measured: typeof v == "number" && Number.isFinite(v) ? v : null,
|
|
3753
|
-
assessment:
|
|
3756
|
+
assessment: Io(v, w)
|
|
3754
3757
|
};
|
|
3755
3758
|
};
|
|
3756
3759
|
}, [o, b]), m = fe(
|
|
@@ -3765,25 +3768,25 @@ function Na(e) {
|
|
|
3765
3768
|
numeric: !0,
|
|
3766
3769
|
width: c,
|
|
3767
3770
|
resizable: a,
|
|
3768
|
-
pin:
|
|
3771
|
+
pin: d,
|
|
3769
3772
|
value: p,
|
|
3770
3773
|
sortValue: m,
|
|
3771
|
-
exportValue:
|
|
3772
|
-
aggregate:
|
|
3773
|
-
children: (w) => /* @__PURE__ */ f(
|
|
3774
|
+
exportValue: xa,
|
|
3775
|
+
aggregate: u === "worst" ? Aa : void 0,
|
|
3776
|
+
children: (w) => /* @__PURE__ */ f(Ca, { reading: w, format: i })
|
|
3774
3777
|
}
|
|
3775
3778
|
);
|
|
3776
3779
|
};
|
|
3777
3780
|
}
|
|
3778
|
-
const Ta = [],
|
|
3781
|
+
const Ta = [], xo = (e) => X(
|
|
3779
3782
|
`condition-foreign:${e}`,
|
|
3780
3783
|
`The condition for "${e}" is not of the kind of its filter and is passed over.`
|
|
3781
3784
|
);
|
|
3782
3785
|
function Ao(e, t, n) {
|
|
3783
3786
|
const o = e.columnById(t), r = o ? Ee(o.spec.filter) : void 0;
|
|
3784
3787
|
if (!r) return !1;
|
|
3785
|
-
const s =
|
|
3786
|
-
return s === "foreign" &&
|
|
3788
|
+
const s = Gn(r, n);
|
|
3789
|
+
return s === "foreign" && xo(t), s === "effective";
|
|
3787
3790
|
}
|
|
3788
3791
|
function Ra(e, t, n) {
|
|
3789
3792
|
if (e.length === 0) return;
|
|
@@ -3794,13 +3797,13 @@ function Ra(e, t, n) {
|
|
|
3794
3797
|
for (const [i, l] of e) {
|
|
3795
3798
|
const c = n.get(i);
|
|
3796
3799
|
if (c) {
|
|
3797
|
-
r.push((
|
|
3800
|
+
r.push((d) => c.matches(d, l));
|
|
3798
3801
|
continue;
|
|
3799
3802
|
}
|
|
3800
3803
|
const a = t.columnById(i);
|
|
3801
|
-
a && Ao(t, i, l) && r.push((
|
|
3802
|
-
const
|
|
3803
|
-
return !
|
|
3804
|
+
a && Ao(t, i, l) && r.push((d) => {
|
|
3805
|
+
const u = Ee(a.spec.filter);
|
|
3806
|
+
return !u || xi(u, a.read(d), l);
|
|
3804
3807
|
});
|
|
3805
3808
|
}
|
|
3806
3809
|
}
|
|
@@ -3808,17 +3811,17 @@ function Ra(e, t, n) {
|
|
|
3808
3811
|
};
|
|
3809
3812
|
}
|
|
3810
3813
|
function Oa(e) {
|
|
3811
|
-
const [t, n] =
|
|
3814
|
+
const [t, n] = V({ fn: e });
|
|
3812
3815
|
return ot(t.fn, e) ? t.fn : (n({ fn: e }), e);
|
|
3813
3816
|
}
|
|
3814
3817
|
function Ea(e, t) {
|
|
3815
|
-
const n =
|
|
3818
|
+
const n = j(() => t ? e.filter((i) => t(i)) : e, [e, t]), [o, r] = V(n);
|
|
3816
3819
|
if (!t) return e;
|
|
3817
3820
|
const s = o === n || o.length === n.length && o.every((i, l) => i === n[l]);
|
|
3818
3821
|
return s || r(n), s ? o : n;
|
|
3819
3822
|
}
|
|
3820
3823
|
const et = (e) => e === void 0 ? [] : typeof e == "string" ? [e] : [...e], Ma = (e, t) => e.length === t.length && e.every((n, o) => n === t[o]);
|
|
3821
|
-
function
|
|
3824
|
+
function Sn(e) {
|
|
3822
3825
|
const t = [], n = (o) => {
|
|
3823
3826
|
for (const r of o)
|
|
3824
3827
|
t.push(r.path), n(r.groups);
|
|
@@ -3835,59 +3838,59 @@ function La(e, t, n) {
|
|
|
3835
3838
|
};
|
|
3836
3839
|
return r(e, 0), o;
|
|
3837
3840
|
}
|
|
3838
|
-
const
|
|
3839
|
-
function
|
|
3840
|
-
return { ...
|
|
3841
|
+
const Cn = (e, t) => e.size === t.size && [...e].every((n) => t.has(n));
|
|
3842
|
+
function qa(e, t) {
|
|
3843
|
+
return { ...xt(e), ...t };
|
|
3841
3844
|
}
|
|
3842
|
-
function
|
|
3843
|
-
const [n] =
|
|
3845
|
+
function Ia(e, t) {
|
|
3846
|
+
const [n] = V(() => new Pi()), [o] = V(() => {
|
|
3844
3847
|
const N = ma(n);
|
|
3845
3848
|
return { ...N, VerdictColumn: Na(N.Column) };
|
|
3846
3849
|
});
|
|
3847
3850
|
st(n.subscribe, n.structureVersion, n.structureVersion);
|
|
3848
|
-
const r =
|
|
3851
|
+
const r = ke(), s = ie(), i = e, l = n.modelColumns(i, r), [c] = V(() => t.initialView), a = t.server === !0, d = t.server ? t.rowCount : 0, u = j(() => a ? { rowCount: d } : void 0, [a, d]);
|
|
3849
3852
|
n.setServer(a), a && (t.preFilter && X("server-prefilter", "`preFilter` is passed over in server mode: the server decides which rows the table has."), t.virtual && X("server-virtual", "`virtual` is passed over in server mode: the table pages instead."), (t.defaultGrouping !== void 0 || c?.grouping?.length) && X("server-grouping", "A grouping is passed over in server mode: the groups would be the page's, not the server's."));
|
|
3850
|
-
const [b, p] =
|
|
3853
|
+
const [b, p] = V(() => Object.entries(c?.conditions ?? {})), m = t.rowFilters ?? Ta, w = m.map((N) => N.id).join("\0"), g = j(
|
|
3851
3854
|
() => new Map(m.map((N) => [N.id, N])),
|
|
3852
3855
|
// eslint-disable-next-line react-hooks/exhaustive-deps -- the filters by their ids; they are defined outside the component
|
|
3853
3856
|
[w]
|
|
3854
3857
|
);
|
|
3855
3858
|
for (const N of m)
|
|
3856
3859
|
n.columnById(N.id) && X(`row-filter-column:${N.id}`, `The row filter "${N.id}" has the id of a column; a condition under that id is the row filter's, and the column's filter cannot hold one of its own.`);
|
|
3857
|
-
const v =
|
|
3860
|
+
const v = j(() => Ra(b, n, g), [b, n, g]), x = t.preFilter, y = Ea(i, a ? void 0 : x), [_, S] = V(
|
|
3858
3861
|
() => c?.grouping ? [...c.grouping] : et(t.defaultGrouping)
|
|
3859
|
-
), [
|
|
3862
|
+
), [C, A] = V(() => c?.folded ?? []), [L, k] = V(() => c?.pinned ? { ...c.pinned } : null), O = Oa(t.rowKey), M = t.server ? void 0 : t.childRows, R = M !== void 0;
|
|
3860
3863
|
n.setTree(R);
|
|
3861
|
-
const E =
|
|
3864
|
+
const E = W({ children: M, key: O });
|
|
3862
3865
|
Z(() => {
|
|
3863
3866
|
E.current = { children: M, key: O };
|
|
3864
3867
|
});
|
|
3865
|
-
const [
|
|
3868
|
+
const [B] = V(() => ({
|
|
3866
3869
|
key: (N) => E.current.key(N),
|
|
3867
3870
|
children: (N) => E.current.children?.(N),
|
|
3868
3871
|
label: () => ""
|
|
3869
|
-
})), [
|
|
3872
|
+
})), [I] = V(() => {
|
|
3870
3873
|
const N = t.server ? void 0 : t.defaultBranches;
|
|
3871
|
-
return !R || N === void 0 ? [] : typeof N == "number" ? La(i,
|
|
3872
|
-
}), [
|
|
3873
|
-
|
|
3874
|
+
return !R || N === void 0 ? [] : typeof N == "number" ? La(i, B, N) : [...N];
|
|
3875
|
+
}), [D, z] = V(() => c?.branches ?? I), Y = j(() => R ? new Set($o(i, B)) : /* @__PURE__ */ new Set(), [R, i, B]), ce = R ? D.filter((N) => Y.has(N)) : [];
|
|
3876
|
+
j(() => {
|
|
3874
3877
|
if (!R) return;
|
|
3875
|
-
const N =
|
|
3878
|
+
const N = zo(i, B);
|
|
3876
3879
|
N !== null && X(`tree-duplicate:${N}`, `The row key "${N}" occurs twice in the tree: its fold and its selection would act on both rows.`);
|
|
3877
|
-
}, [R, i,
|
|
3878
|
-
const
|
|
3880
|
+
}, [R, i, B]), R && (t.defaultGrouping !== void 0 || c?.grouping?.length) && X("tree-grouping", "A grouping is passed over with `childRows`: tree rows and grouping both build levels.");
|
|
3881
|
+
const G = n.orderedColumns().length + n.groupKeys.entries.size > 0, ne = a || R ? [] : G ? n.effectiveGrouping(_, i) : _.slice(0, zt), ue = ne.join("|"), le = j(() => new Set(C), [C]), ee = ne.length ? n.groupingModel(ne, i) : null, oe = j(
|
|
3879
3882
|
() => ee && ee.levels.length ? { ...ee, folded: le, compareText: r.compareText } : void 0,
|
|
3880
3883
|
// eslint-disable-next-line react-hooks/exhaustive-deps -- the model's identity carries the ids and the columns
|
|
3881
|
-
[ee, le, r.compareText,
|
|
3882
|
-
),
|
|
3883
|
-
() => R ? { key: O, children:
|
|
3884
|
+
[ee, le, r.compareText, ue]
|
|
3885
|
+
), H = ce.join("\0"), ge = j(
|
|
3886
|
+
() => R ? { key: O, children: B.children, open: new Set(ce), admit: x } : void 0,
|
|
3884
3887
|
/* ponytail: the pre-filter is read through the roots it admits - a new
|
|
3885
3888
|
pre-filter that only drops children takes hold with the next change of
|
|
3886
3889
|
rows or branches. Compare its admitted children, as useAdmitted does
|
|
3887
3890
|
the roots, if a caller needs that live. */
|
|
3888
3891
|
// eslint-disable-next-line react-hooks/exhaustive-deps -- the open keys by value; the rows the pre-filter admits stand for it
|
|
3889
|
-
[R,
|
|
3890
|
-
),
|
|
3892
|
+
[R, H, y, B]
|
|
3893
|
+
), q = Qo(y, l, {
|
|
3891
3894
|
rowKey: O,
|
|
3892
3895
|
pageSize: t.pageSize,
|
|
3893
3896
|
defaultSort: t.defaultSort,
|
|
@@ -3895,144 +3898,144 @@ function $a(e, t) {
|
|
|
3895
3898
|
initialView: c,
|
|
3896
3899
|
virtual: a ? void 0 : t.virtual,
|
|
3897
3900
|
grouping: oe,
|
|
3898
|
-
server:
|
|
3901
|
+
server: u,
|
|
3899
3902
|
tree: ge
|
|
3900
|
-
}), { setPage: ae } =
|
|
3901
|
-
(N,
|
|
3902
|
-
const
|
|
3903
|
-
let
|
|
3904
|
-
const on = g.has(
|
|
3903
|
+
}), { setPage: ae } = q, Ae = fe(
|
|
3904
|
+
(N, $) => {
|
|
3905
|
+
const K = typeof N == "string" ? N : N.id;
|
|
3906
|
+
let $e = $ == null;
|
|
3907
|
+
const on = g.has(K);
|
|
3905
3908
|
if (typeof N != "string" && !on) {
|
|
3906
3909
|
X(
|
|
3907
|
-
`row-filter-unknown:${
|
|
3908
|
-
`The row filter "${
|
|
3910
|
+
`row-filter-unknown:${K}`,
|
|
3911
|
+
`The row filter "${K}" is not among the table's \`rowFilters\`; its condition is passed over.`
|
|
3909
3912
|
);
|
|
3910
3913
|
return;
|
|
3911
3914
|
}
|
|
3912
|
-
if (
|
|
3913
|
-
const ve = n.columnById(
|
|
3915
|
+
if (!$e && !on && n.orderedColumns().length > 0) {
|
|
3916
|
+
const ve = n.columnById(K), Te = ve ? Ee(ve.spec.filter) : void 0;
|
|
3914
3917
|
if (!Te) {
|
|
3915
3918
|
X(
|
|
3916
|
-
`condition-without-filter:${
|
|
3917
|
-
ve ? `The column "${
|
|
3919
|
+
`condition-without-filter:${K}`,
|
|
3920
|
+
ve ? `The column "${K}" has no filter; its condition is passed over.` : `No column is called "${K}"; its condition is passed over.`
|
|
3918
3921
|
);
|
|
3919
3922
|
return;
|
|
3920
3923
|
}
|
|
3921
|
-
const Re =
|
|
3924
|
+
const Re = Gn(Te, $);
|
|
3922
3925
|
if (Re === "foreign") {
|
|
3923
|
-
|
|
3926
|
+
xo(K);
|
|
3924
3927
|
return;
|
|
3925
3928
|
}
|
|
3926
|
-
|
|
3929
|
+
$e = Re === "empty";
|
|
3927
3930
|
}
|
|
3928
3931
|
p((ve) => {
|
|
3929
|
-
const Te = ve.findIndex(([Re]) => Re ===
|
|
3930
|
-
return
|
|
3932
|
+
const Te = ve.findIndex(([Re]) => Re === K);
|
|
3933
|
+
return $e ? Te === -1 ? ve : ve.filter((Re, gt) => gt !== Te) : Te === -1 ? [...ve, [K, $]] : ve.map((Re, gt) => gt === Te ? [K, $] : Re);
|
|
3931
3934
|
}), ae(1);
|
|
3932
3935
|
},
|
|
3933
3936
|
[n, ae, g]
|
|
3934
|
-
),
|
|
3935
|
-
if (!
|
|
3936
|
-
const N = new Set([...Ne].filter((
|
|
3937
|
-
Me(
|
|
3938
|
-
const
|
|
3939
|
-
b.some(([
|
|
3937
|
+
), de = new Set(n.orderedColumns().map((N) => N.spec.id)), [Ne, Me] = V(() => /* @__PURE__ */ new Set());
|
|
3938
|
+
if (!Cn(Ne, de)) {
|
|
3939
|
+
const N = new Set([...Ne].filter((K) => !de.has(K)));
|
|
3940
|
+
Me(de);
|
|
3941
|
+
const $ = (K) => N.has(K) && !g.has(K);
|
|
3942
|
+
b.some(([K]) => $(K)) && p((K) => K.filter(([$e]) => !$($e)));
|
|
3940
3943
|
}
|
|
3941
|
-
const pe =
|
|
3942
|
-
...
|
|
3943
|
-
...Ma(ne,
|
|
3944
|
-
...
|
|
3945
|
-
...
|
|
3946
|
-
...R && !
|
|
3947
|
-
}, te = (N,
|
|
3948
|
-
|
|
3944
|
+
const pe = de.size === 0 ? b : b.filter(([N, $]) => g.has(N) || Ao(n, N, $)), U = cr(q.view, de), Se = pe.length > 0 ? { ...U, conditions: Object.fromEntries(pe) } : U, Le = de.size === 0 ? q.sort : q.sort.filter((N) => de.has(N.column)), Ve = a || R ? [] : G ? n.effectiveGrouping(et(t.defaultGrouping), i) : et(t.defaultGrouping), qe = q.groups ? jo(q.groups, C) : G ? [] : [...C], Je = n.declaredPins(), P = or(L, Je, de), J = {
|
|
3945
|
+
...Se,
|
|
3946
|
+
...Ma(ne, Ve) ? {} : { grouping: ne },
|
|
3947
|
+
...qe.length ? { folded: qe } : {},
|
|
3948
|
+
...P ? { pinned: P } : {},
|
|
3949
|
+
...R && !Cn(new Set(ce), new Set(I.filter((N) => Y.has(N)))) ? { branches: ce } : {}
|
|
3950
|
+
}, te = (N, $) => k((K) => tr(K ?? n.declaredPins(), N, $)), [me, we] = V(0), No = (N) => {
|
|
3951
|
+
q.restart(N), p(Object.entries(N.conditions ?? {})), S(N.grouping ? [...N.grouping] : et(t.defaultGrouping)), A(N.folded ?? []), k(N.pinned ? { ...N.pinned } : null), z(N.branches ?? I), we(($) => $ + 1);
|
|
3949
3952
|
}, To = (N) => {
|
|
3950
|
-
|
|
3953
|
+
S([...N]), ae(1);
|
|
3951
3954
|
}, Ro = (N) => {
|
|
3952
|
-
|
|
3953
|
-
}, Jt = !a && !!t.virtual,
|
|
3954
|
-
|
|
3955
|
+
Sn(q.groups).includes(N) && (n.noteFocusBeforeFold(), A(($) => $.includes(N) ? $.filter((K) => K !== N) : [...$, N]));
|
|
3956
|
+
}, Jt = !a && !!t.virtual, dt = !R && n.paginates() || Jt, ft = t.selection ?? q.selection, Xe = ar(J), Xt = W(Xe), Qt = W(0);
|
|
3957
|
+
xe(() => {
|
|
3955
3958
|
const N = Qt.current !== me;
|
|
3956
3959
|
Qt.current = me, Xt.current !== Xe && (Xt.current = Xe, N || t.onViewChange?.(J));
|
|
3957
3960
|
}, [Xe, me]);
|
|
3958
3961
|
const Zt = {
|
|
3959
|
-
search:
|
|
3962
|
+
search: q.search,
|
|
3960
3963
|
conditions: Object.fromEntries(pe),
|
|
3961
3964
|
sort: Le,
|
|
3962
|
-
page:
|
|
3963
|
-
pageSize:
|
|
3964
|
-
}, ht = a ? lr(Zt) : "", en =
|
|
3965
|
-
|
|
3965
|
+
page: q.page,
|
|
3966
|
+
pageSize: q.pageSize
|
|
3967
|
+
}, ht = a ? lr(Zt) : "", en = W(null);
|
|
3968
|
+
xe(() => {
|
|
3966
3969
|
!a || en.current === ht || (en.current = ht, t.onRequest?.(Zt));
|
|
3967
3970
|
}, [ht]);
|
|
3968
|
-
const [
|
|
3971
|
+
const [Ie] = V(() => /* @__PURE__ */ new Map());
|
|
3969
3972
|
let tn;
|
|
3970
3973
|
if (a) {
|
|
3971
3974
|
const N = /* @__PURE__ */ new Set();
|
|
3972
|
-
for (const
|
|
3973
|
-
const
|
|
3974
|
-
N.add(
|
|
3975
|
+
for (const $ of i) {
|
|
3976
|
+
const K = O($);
|
|
3977
|
+
N.add(K), Ie.set(K, $);
|
|
3975
3978
|
}
|
|
3976
|
-
for (const
|
|
3977
|
-
!N.has(
|
|
3978
|
-
tn = [...ft.selected].filter((
|
|
3979
|
+
for (const $ of [...Ie.keys()])
|
|
3980
|
+
!N.has($) && !ft.isSelected($) && Ie.delete($);
|
|
3981
|
+
tn = [...ft.selected].filter(($) => Ie.has($)).map(($) => Ie.get($));
|
|
3979
3982
|
}
|
|
3980
3983
|
const nn = {
|
|
3981
3984
|
rows: e,
|
|
3982
|
-
filtered:
|
|
3983
|
-
visible:
|
|
3984
|
-
page:
|
|
3985
|
-
pageCount:
|
|
3986
|
-
pageSize:
|
|
3987
|
-
setPage:
|
|
3988
|
-
setPageSize:
|
|
3989
|
-
search:
|
|
3990
|
-
setSearch:
|
|
3985
|
+
filtered: q.filtered,
|
|
3986
|
+
visible: dt || R ? q.visible : q.filtered,
|
|
3987
|
+
page: dt ? q.page : 1,
|
|
3988
|
+
pageCount: dt ? q.pageCount : 1,
|
|
3989
|
+
pageSize: q.pageSize,
|
|
3990
|
+
setPage: q.setPage,
|
|
3991
|
+
setPageSize: q.setPageSize,
|
|
3992
|
+
search: q.search,
|
|
3993
|
+
setSearch: q.setSearch,
|
|
3991
3994
|
sort: Le,
|
|
3992
|
-
toggleSort:
|
|
3993
|
-
hidden:
|
|
3994
|
-
toggleColumn:
|
|
3995
|
-
order:
|
|
3996
|
-
setOrder:
|
|
3995
|
+
toggleSort: q.toggleSort,
|
|
3996
|
+
hidden: q.hidden,
|
|
3997
|
+
toggleColumn: q.toggleColumn,
|
|
3998
|
+
order: q.order,
|
|
3999
|
+
setOrder: q.setOrder,
|
|
3997
4000
|
pinned: L ?? Je,
|
|
3998
4001
|
setPin: te,
|
|
3999
|
-
widths:
|
|
4000
|
-
setWidth:
|
|
4001
|
-
expanded:
|
|
4002
|
-
toggleRow:
|
|
4002
|
+
widths: qa(l, q.widths),
|
|
4003
|
+
setWidth: q.setWidth,
|
|
4004
|
+
expanded: q.expanded,
|
|
4005
|
+
toggleRow: q.toggleRow,
|
|
4003
4006
|
filter: Object.fromEntries(pe),
|
|
4004
4007
|
setFilter: Ae,
|
|
4005
|
-
conditionOf: (N) => pe.find(([
|
|
4008
|
+
conditionOf: (N) => pe.find(([$]) => $ === N.id)?.[1] ?? null,
|
|
4006
4009
|
selection: ft,
|
|
4007
4010
|
view: J,
|
|
4008
4011
|
grouping: ne,
|
|
4009
4012
|
setGrouping: To,
|
|
4010
4013
|
setView: No,
|
|
4011
|
-
folded:
|
|
4014
|
+
folded: qe,
|
|
4012
4015
|
toggleFold: Ro,
|
|
4013
4016
|
foldAll: () => {
|
|
4014
|
-
n.noteFocusBeforeFold(), A(
|
|
4017
|
+
n.noteFocusBeforeFold(), A(Sn(q.groups));
|
|
4015
4018
|
},
|
|
4016
4019
|
unfoldAll: () => {
|
|
4017
4020
|
n.noteFocusBeforeFold(), A([]);
|
|
4018
4021
|
},
|
|
4019
4022
|
branches: ce,
|
|
4020
4023
|
toggleBranch: (N) => {
|
|
4021
|
-
Y.has(N) &&
|
|
4024
|
+
Y.has(N) && z(($) => $.includes(N) ? $.filter((K) => K !== N) : [...$, N]);
|
|
4022
4025
|
},
|
|
4023
|
-
unfoldAllBranches: () =>
|
|
4024
|
-
foldAllBranches: () =>
|
|
4025
|
-
asCsv: () =>
|
|
4026
|
+
unfoldAllBranches: () => z([...Y]),
|
|
4027
|
+
foldAllBranches: () => z([]),
|
|
4028
|
+
asCsv: () => ji(n, s.levelColumn, r, s),
|
|
4026
4029
|
selectionAsText: () => no(n, r, s),
|
|
4027
4030
|
virtual: Jt,
|
|
4028
|
-
rowCount: a ?
|
|
4031
|
+
rowCount: a ? d : q.filtered.length,
|
|
4029
4032
|
server: a
|
|
4030
4033
|
};
|
|
4031
4034
|
return n.setHook({
|
|
4032
4035
|
rows: i,
|
|
4033
4036
|
admitted: y,
|
|
4034
4037
|
modelColumns: l,
|
|
4035
|
-
tableState:
|
|
4038
|
+
tableState: q,
|
|
4036
4039
|
filter: v,
|
|
4037
4040
|
grouping: oe,
|
|
4038
4041
|
tree: ge,
|
|
@@ -4046,7 +4049,7 @@ function $a(e, t) {
|
|
|
4046
4049
|
rowFilters: g
|
|
4047
4050
|
}), { ...nn, ...o };
|
|
4048
4051
|
}
|
|
4049
|
-
function
|
|
4052
|
+
function $a(e) {
|
|
4050
4053
|
return e;
|
|
4051
4054
|
}
|
|
4052
4055
|
function Ut(e, t) {
|
|
@@ -4058,13 +4061,13 @@ function Ut(e, t) {
|
|
|
4058
4061
|
};
|
|
4059
4062
|
}, [e, t, n]);
|
|
4060
4063
|
}
|
|
4061
|
-
function
|
|
4064
|
+
function za({ children: e, className: t, size: n = "sm", of: o }) {
|
|
4062
4065
|
const r = Ye(o);
|
|
4063
4066
|
Ut(r?.registry, "toolbar");
|
|
4064
4067
|
const s = r?.registry;
|
|
4065
4068
|
return /* @__PURE__ */ f(lo, { registry: s ?? null, className: t, size: n, children: e });
|
|
4066
4069
|
}
|
|
4067
|
-
function
|
|
4070
|
+
function Ka({ placeholder: e, "aria-label": t, className: n, size: o, grow: r, of: s }) {
|
|
4068
4071
|
const i = Ye(s), l = at(o), c = ie();
|
|
4069
4072
|
if (Ut(i?.registry, "search"), !i) return null;
|
|
4070
4073
|
const { snapshot: a } = i;
|
|
@@ -4073,9 +4076,9 @@ function Ga({ placeholder: e, "aria-label": t, className: n, size: o, grow: r, o
|
|
|
4073
4076
|
{
|
|
4074
4077
|
size: l,
|
|
4075
4078
|
type: "search",
|
|
4076
|
-
className:
|
|
4079
|
+
className: F(r && h.searchGrow, n),
|
|
4077
4080
|
value: a.search,
|
|
4078
|
-
onChange: (
|
|
4081
|
+
onChange: (d) => a.setSearch(d.target.value),
|
|
4079
4082
|
clearable: !0,
|
|
4080
4083
|
onClear: () => a.setSearch(""),
|
|
4081
4084
|
placeholder: e ?? c.tableSearchPlaceholder,
|
|
@@ -4083,40 +4086,40 @@ function Ga({ placeholder: e, "aria-label": t, className: n, size: o, grow: r, o
|
|
|
4083
4086
|
}
|
|
4084
4087
|
);
|
|
4085
4088
|
}
|
|
4086
|
-
function
|
|
4087
|
-
const n = Ye(t), o = at(e), r = ie(), [s, i] =
|
|
4089
|
+
function Ga({ size: e, of: t }) {
|
|
4090
|
+
const n = Ye(t), o = at(e), r = ie(), [s, i] = V(!1), l = W(null), c = W(null), a = be(), [d, u] = V(null);
|
|
4088
4091
|
if (Z(() => {
|
|
4089
|
-
if (!
|
|
4092
|
+
if (!d || !c.current) return;
|
|
4090
4093
|
const _ = Array.from(c.current.children).find(
|
|
4091
|
-
(A) => A.dataset.column ===
|
|
4092
|
-
),
|
|
4093
|
-
(
|
|
4094
|
-
}, [
|
|
4095
|
-
const { registry: b, snapshot: p } = n, m = b.hook, w = b.inPinOrder(
|
|
4096
|
-
const
|
|
4097
|
-
return
|
|
4098
|
-
},
|
|
4099
|
-
const
|
|
4100
|
-
if (!v(_,
|
|
4101
|
-
[
|
|
4102
|
-
const [L,
|
|
4103
|
-
|
|
4104
|
-
}, y = (_,
|
|
4105
|
-
const A = g[_] ===
|
|
4106
|
-
return /* @__PURE__ */ f(tt, { content: A ? r.unpinHint :
|
|
4094
|
+
(A) => A.dataset.column === d.id
|
|
4095
|
+
), S = _?.querySelector(d.key), C = d.otherwise ? _?.querySelector(d.otherwise) : void 0;
|
|
4096
|
+
(S && !S.disabled ? S : C)?.focus();
|
|
4097
|
+
}, [d]), !n) return null;
|
|
4098
|
+
const { registry: b, snapshot: p } = n, m = b.hook, w = b.inPinOrder(Bn(b.modelColumns(m.rows, m.formats), p.order)), g = b.pins(), v = (_, S) => {
|
|
4099
|
+
const C = w[_ + S];
|
|
4100
|
+
return C !== void 0 && g[C.id] === g[w[_].id];
|
|
4101
|
+
}, x = (_, S) => {
|
|
4102
|
+
const C = w.map((O) => O.id), A = _ + S;
|
|
4103
|
+
if (!v(_, S)) return;
|
|
4104
|
+
[C[_], C[A]] = [C[A], C[_]], p.setOrder(C);
|
|
4105
|
+
const [L, k] = S < 0 ? ["forward", "backward"] : ["backward", "forward"];
|
|
4106
|
+
u({ id: w[_].id, key: `[data-direction="${L}"]`, otherwise: `[data-direction="${k}"]` });
|
|
4107
|
+
}, y = (_, S, C) => {
|
|
4108
|
+
const A = g[_] === C;
|
|
4109
|
+
return /* @__PURE__ */ f(tt, { content: A ? r.unpinHint : C === "start" ? r.pinToStartHint : r.pinToEndHint, children: /* @__PURE__ */ f(
|
|
4107
4110
|
"button",
|
|
4108
4111
|
{
|
|
4109
4112
|
type: "button",
|
|
4110
|
-
className:
|
|
4111
|
-
"data-pin":
|
|
4112
|
-
"aria-label": A ? r.unpinColumn(
|
|
4113
|
+
className: F(h.move, A && h.pinOn),
|
|
4114
|
+
"data-pin": C,
|
|
4115
|
+
"aria-label": A ? r.unpinColumn(S) : C === "start" ? r.pinColumnToStart(S) : r.pinColumnToEnd(S),
|
|
4113
4116
|
onClick: () => {
|
|
4114
|
-
p.setPin(_, A ? null :
|
|
4117
|
+
p.setPin(_, A ? null : C), u({ id: _, key: `[data-pin="${C}"]` });
|
|
4115
4118
|
},
|
|
4116
4119
|
children: /* @__PURE__ */ f("svg", { viewBox: "0 0 10 10", width: "10", height: "10", "aria-hidden": "true", children: /* @__PURE__ */ f(
|
|
4117
4120
|
"path",
|
|
4118
4121
|
{
|
|
4119
|
-
d:
|
|
4122
|
+
d: C === "start" ? "M2 1.5v7M8.5 5H4.5M6 3.5 4.5 5 6 6.5" : "M8 1.5v7M1.5 5h4M4 3.5 5.5 5 4 6.5",
|
|
4120
4123
|
fill: "none",
|
|
4121
4124
|
stroke: "currentColor",
|
|
4122
4125
|
strokeWidth: "1.4",
|
|
@@ -4152,13 +4155,13 @@ function ja({ size: e, of: t }) {
|
|
|
4152
4155
|
id: a,
|
|
4153
4156
|
className: h.columnsPanel,
|
|
4154
4157
|
children: [
|
|
4155
|
-
/* @__PURE__ */ f("ul", { ref: c, className: h.columnsList, "aria-label": r.arrangeColumns, children: w.map((_,
|
|
4156
|
-
const
|
|
4158
|
+
/* @__PURE__ */ f("ul", { ref: c, className: h.columnsList, "aria-label": r.arrangeColumns, children: w.map((_, S) => {
|
|
4159
|
+
const C = _.label ?? _.id;
|
|
4157
4160
|
return /* @__PURE__ */ T("li", { className: h.columnsEntry, "data-column": _.id, children: [
|
|
4158
4161
|
/* @__PURE__ */ f(
|
|
4159
|
-
|
|
4162
|
+
He,
|
|
4160
4163
|
{
|
|
4161
|
-
label:
|
|
4164
|
+
label: C,
|
|
4162
4165
|
checked: !p.hidden.includes(_.id),
|
|
4163
4166
|
disabled: _.hideable === !1,
|
|
4164
4167
|
onChange: () => p.toggleColumn(_.id)
|
|
@@ -4170,9 +4173,9 @@ function ja({ size: e, of: t }) {
|
|
|
4170
4173
|
type: "button",
|
|
4171
4174
|
className: h.move,
|
|
4172
4175
|
"data-direction": "forward",
|
|
4173
|
-
"aria-label": r.columnForward(
|
|
4174
|
-
disabled: !v(
|
|
4175
|
-
onClick: () =>
|
|
4176
|
+
"aria-label": r.columnForward(C),
|
|
4177
|
+
disabled: !v(S, -1),
|
|
4178
|
+
onClick: () => x(S, -1),
|
|
4176
4179
|
children: /* @__PURE__ */ f("svg", { viewBox: "0 0 10 10", width: "10", height: "10", "aria-hidden": "true", children: /* @__PURE__ */ f("path", { d: "M2 6.5 5 3.5l3 3", fill: "none", stroke: "currentColor", strokeWidth: "1.4", strokeLinecap: "round", strokeLinejoin: "round" }) })
|
|
4177
4180
|
}
|
|
4178
4181
|
) }),
|
|
@@ -4182,14 +4185,14 @@ function ja({ size: e, of: t }) {
|
|
|
4182
4185
|
type: "button",
|
|
4183
4186
|
className: h.move,
|
|
4184
4187
|
"data-direction": "backward",
|
|
4185
|
-
"aria-label": r.columnBackward(
|
|
4186
|
-
disabled: !v(
|
|
4187
|
-
onClick: () =>
|
|
4188
|
+
"aria-label": r.columnBackward(C),
|
|
4189
|
+
disabled: !v(S, 1),
|
|
4190
|
+
onClick: () => x(S, 1),
|
|
4188
4191
|
children: /* @__PURE__ */ f("svg", { viewBox: "0 0 10 10", width: "10", height: "10", "aria-hidden": "true", children: /* @__PURE__ */ f("path", { d: "M2 3.5 5 6.5l3-3", fill: "none", stroke: "currentColor", strokeWidth: "1.4", strokeLinecap: "round", strokeLinejoin: "round" }) })
|
|
4189
4192
|
}
|
|
4190
4193
|
) }),
|
|
4191
|
-
y(_.id,
|
|
4192
|
-
y(_.id,
|
|
4194
|
+
y(_.id, C, "start"),
|
|
4195
|
+
y(_.id, C, "end")
|
|
4193
4196
|
] }, _.id);
|
|
4194
4197
|
}) }),
|
|
4195
4198
|
/* @__PURE__ */ f(Xi, { registry: b, hook: m }),
|
|
@@ -4199,7 +4202,7 @@ function ja({ size: e, of: t }) {
|
|
|
4199
4202
|
)
|
|
4200
4203
|
] });
|
|
4201
4204
|
}
|
|
4202
|
-
function
|
|
4205
|
+
function ja({ filename: e, onExport: t, size: n, of: o }) {
|
|
4203
4206
|
const r = Ye(o), s = at(n), i = ie();
|
|
4204
4207
|
if (!r) return null;
|
|
4205
4208
|
const { snapshot: l } = r;
|
|
@@ -4209,14 +4212,14 @@ function Ha({ filename: e, onExport: t, size: n, of: o }) {
|
|
|
4209
4212
|
t(a);
|
|
4210
4213
|
return;
|
|
4211
4214
|
}
|
|
4212
|
-
const
|
|
4213
|
-
|
|
4215
|
+
const d = URL.createObjectURL(new Blob([a], { type: "text/csv;charset=utf-8" })), u = document.createElement("a");
|
|
4216
|
+
u.href = d, u.download = e ?? i.exportFileName, u.click(), setTimeout(() => URL.revokeObjectURL(d), 1e4);
|
|
4214
4217
|
}, children: l.server ? i.exportPageLabel : i.exportLabel });
|
|
4215
4218
|
}
|
|
4216
|
-
function
|
|
4217
|
-
const o = Ye(n), r = ie(), s =
|
|
4219
|
+
function Ha({ pageSizes: e = [10, 25, 50], className: t, of: n }) {
|
|
4220
|
+
const o = Ye(n), r = ie(), s = ke();
|
|
4218
4221
|
if (Ut(o?.registry, "pagination"), o?.registry.tree && X("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;
|
|
4219
|
-
const { snapshot: i } = o, l = i.rowCount, c = e.includes(i.pageSize) ? e : [...e, i.pageSize].sort((
|
|
4222
|
+
const { snapshot: i } = o, l = i.rowCount, c = e.includes(i.pageSize) ? e : [...e, i.pageSize].sort((d, u) => d - u), a = /* @__PURE__ */ T("nav", { "aria-label": r.pagination, className: F(h.pagination, t), children: [
|
|
4220
4223
|
/* @__PURE__ */ f("span", { children: r.entries(l, s.count(l)) }),
|
|
4221
4224
|
/* @__PURE__ */ T("div", { className: h.paginationControls, children: [
|
|
4222
4225
|
/* @__PURE__ */ T("label", { className: h.pageSize, children: [
|
|
@@ -4225,11 +4228,11 @@ function Wa({ pageSizes: e = [10, 25, 50], className: t, of: n }) {
|
|
|
4225
4228
|
Rn,
|
|
4226
4229
|
{
|
|
4227
4230
|
size: "sm",
|
|
4228
|
-
chars: Math.max(...c.map((
|
|
4231
|
+
chars: Math.max(...c.map((d) => String(d).length)),
|
|
4229
4232
|
value: i.pageSize,
|
|
4230
|
-
onChange: (
|
|
4233
|
+
onChange: (d) => i.setPageSize(Number(d.target.value)),
|
|
4231
4234
|
"aria-label": r.rowsPerPage,
|
|
4232
|
-
children: c.map((
|
|
4235
|
+
children: c.map((d) => /* @__PURE__ */ f("option", { value: d, children: d }, d))
|
|
4233
4236
|
}
|
|
4234
4237
|
)
|
|
4235
4238
|
] }),
|
|
@@ -4245,18 +4248,18 @@ function Wa({ pageSizes: e = [10, 25, 50], className: t, of: n }) {
|
|
|
4245
4248
|
] });
|
|
4246
4249
|
return o.inside ? o.footerTarget ? En(a, o.footerTarget) : null : a;
|
|
4247
4250
|
}
|
|
4248
|
-
function
|
|
4251
|
+
function Wa(e) {
|
|
4249
4252
|
return e;
|
|
4250
4253
|
}
|
|
4251
4254
|
export {
|
|
4252
|
-
|
|
4253
|
-
|
|
4254
|
-
|
|
4255
|
-
|
|
4256
|
-
|
|
4257
|
-
|
|
4258
|
-
|
|
4259
|
-
|
|
4260
|
-
|
|
4261
|
-
|
|
4255
|
+
Ga as ColumnMenu,
|
|
4256
|
+
ja as Export,
|
|
4257
|
+
Ha as Pagination,
|
|
4258
|
+
Ka as Search,
|
|
4259
|
+
za as Toolbar,
|
|
4260
|
+
$a as column,
|
|
4261
|
+
Va as columnFilter,
|
|
4262
|
+
Wa as rowFilter,
|
|
4263
|
+
Ia as useTable,
|
|
4264
|
+
Ko as useTableSelection
|
|
4262
4265
|
};
|