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