@umriss-ui/table 0.55.0 → 0.55.1
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 +13 -0
- package/dist/table.css +1 -1
- package/dist/table.js +901 -901
- package/docs/llms-full.md +114 -41
- package/package.json +2 -2
package/dist/table.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import "./table.css";
|
|
3
|
-
import { useRef as
|
|
4
|
-
import { warnOnce as
|
|
5
|
-
import { jsx as f, jsxs as
|
|
3
|
+
import { useRef as j, useLayoutEffect as ee, useState as G, useCallback as _e, useMemo as oe, createContext as yt, useEffect as ae, useContext as $e, useId as Ve, useSyncExternalStore as tn, useImperativeHandle as Vs, Fragment as Is } from "react";
|
|
4
|
+
import { warnOnce as Ks, hasWarned as Gs, writeNumber as kn, DEFAULT_FORMATS as hr, zoneFields as Ie, zoneInstant as Ut, zoneDayStart as pr, treeModel as Eo, useVirtual as js, useFormats as We, useWording as we, Checkbox as ct, SegmentedControl as Hs, DateRangePicker as Ws, FormField as Cn, NumberInput as xn, Select as Yn, Input as Jn, DEFAULT_WORDING as gr, separatorsOf as qs, announce as dt, DateTimePicker as Us, DatePicker as Ys, VisuallyHidden as He, Popover as nn, Button as ue, Menu as mr, MenuItem as Yt, IconButton as Nt, MoreGlyph as Js, Tooltip as Jt, TagGroup as wr, Tag as Xn, MenuSeparator as Xs, ControlSizeProvider as br, usePortalTarget as Zs, AngleGlyph as An, Spinner as Qs, useTimeZoneLabel as ei, useDensityFor as ti, assess as ni, verdictWeight as Tn, allBranches as oi, duplicateKey as ri, GripGlyph as si, EndGlyph as Mo } from "@umriss-ui/core";
|
|
5
|
+
import { jsx as f, jsxs as M, Fragment as fe } from "react/jsx-runtime";
|
|
6
6
|
import { createPortal as vr } from "react-dom";
|
|
7
7
|
function ii() {
|
|
8
8
|
try {
|
|
@@ -11,18 +11,18 @@ function ii() {
|
|
|
11
11
|
return !1;
|
|
12
12
|
}
|
|
13
13
|
}
|
|
14
|
-
const
|
|
15
|
-
function
|
|
14
|
+
const Me = ii(), yr = "@umriss-ui/table", te = (e, t) => Ks(yr, e, t), Oo = [];
|
|
15
|
+
function Lo(e, t) {
|
|
16
16
|
if (Array.isArray(e)) return e;
|
|
17
|
-
if (e == null) return
|
|
18
|
-
if (
|
|
17
|
+
if (e == null) return Oo;
|
|
18
|
+
if (Me) {
|
|
19
19
|
const o = (ArrayBuffer.isView(e) ? e.constructor.name : null) ?? (typeof e == "object" ? `an object with the keys ${Object.keys(e).slice(0, 3).join(", ")}` : `a ${typeof e}`);
|
|
20
20
|
te(
|
|
21
21
|
`rows:${t}:${o}`,
|
|
22
22
|
`${t} got ${o}, which is not an array; it is read as no rows. umriss reads one object per row - \`Array.from\` makes rows of an Arrow table or a typed array.`
|
|
23
23
|
);
|
|
24
24
|
}
|
|
25
|
-
return
|
|
25
|
+
return Oo;
|
|
26
26
|
}
|
|
27
27
|
const ai = (e, t) => {
|
|
28
28
|
if (e instanceof Date && t instanceof Date) return !Object.is(e.getTime(), t.getTime());
|
|
@@ -31,7 +31,7 @@ const ai = (e, t) => {
|
|
|
31
31
|
};
|
|
32
32
|
function Xt(e, t, n, o, r) {
|
|
33
33
|
const s = `stale:${e}`;
|
|
34
|
-
if (!
|
|
34
|
+
if (!Me || t === n || Gs(yr, s) || typeof t != "function" || typeof n != "function") return;
|
|
35
35
|
const i = e === "The rowKey" ? "Carry the value in the rows." : "Carry the value in the rows, or give the column a `key` that changes with it.";
|
|
36
36
|
try {
|
|
37
37
|
for (let a = 0; a < Math.min(o.length, 1e3); a++) {
|
|
@@ -47,7 +47,7 @@ function Xt(e, t, n, o, r) {
|
|
|
47
47
|
} catch {
|
|
48
48
|
}
|
|
49
49
|
}
|
|
50
|
-
const
|
|
50
|
+
const I = (...e) => e.filter(Boolean).join(" ");
|
|
51
51
|
function li(e, t) {
|
|
52
52
|
return [
|
|
53
53
|
...e.filter((n) => t[n.id] === "start"),
|
|
@@ -80,7 +80,7 @@ function gi(e, t, n) {
|
|
|
80
80
|
const o = n - Math.min(n / 2, pi);
|
|
81
81
|
return n <= 0 || e + t <= o ? { start: !0, end: !0 } : e > 0 && e <= o ? { start: !0, end: !1 } : { start: !1, end: t > 0 && t <= o };
|
|
82
82
|
}
|
|
83
|
-
const mi = "
|
|
83
|
+
const mi = "_frame_1fhf3_11 _text_1ftkm_22", wi = "_children_1fhf3_46", bi = "_scroll_1fhf3_55 _scroll_1ftkm_106", vi = "_footerTarget_1fhf3_99", yi = "_table_1fhf3_116", Si = "_th_1fhf3_128 _ring_1ftkm_135", _i = "_sticky_1fhf3_148", ki = "_columnsGroup_1fhf3_169", Ci = "_headGroup_1fhf3_176", xi = "_td_1fhf3_192", Ai = "_groupEdge_1fhf3_192", Ti = "_rowHeader_1fhf3_226", Ni = "_compact_1fhf3_264 _dense_1ftkm_38", Ri = "_numeric_1fhf3_312", Ei = "_value_1fhf3_332", Mi = "_valueText_1fhf3_342", Oi = "_sized_1fhf3_346", Li = "_cutTip_1fhf3_363 _text_1ftkm_22", $i = "_absent_1fhf3_405", Fi = "_striped_1fhf3_409", Pi = "_pinned_1fhf3_192", zi = "_pinStartEdge_1fhf3_196", Bi = "_pinEndEdge_1fhf3_196", Di = "_sortButton_1fhf3_518 _ring_1ftkm_135", Vi = "_sortIndicator_1fhf3_561", Ii = "_sortArrow_1fhf3_568", Ki = "_sortArrowDesc_1fhf3_572", Gi = "_sortActive_1fhf3_580", ji = "_zoneLabel_1fhf3_587", Hi = "_sortRank_1fhf3_592", Wi = "_thFlex_1fhf3_600", qi = "_headLine_1fhf3_620", Ui = "_headLabel_1fhf3_638", Yi = "_reaching_1fhf3_655", Ji = "_footerKind_1fhf3_670", Xi = "_emptyCell_1fhf3_688", Zi = "_emptyTitle_1fhf3_710", Qi = "_skeleton_1fhf3_719", ea = "_toolbar_1fhf3_751 _text_1ftkm_22", ta = "_toolbarGroup_1fhf3_767", na = "_toolbarGroupIdle_1fhf3_783", oa = "_searchGrow_1fhf3_790", ra = "_toolbarMd_1fhf3_800", sa = "_matchOffer_1fhf3_805 _text_1ftkm_22", ia = "_toolbarInfo_1fhf3_816", aa = "_pagination_1fhf3_822 _text_1ftkm_22", la = "_paginationControls_1fhf3_836", ca = "_pageSize_1fhf3_843", da = "_pageSteps_1fhf3_851", ua = "_turned_1fhf3_857", fa = "_paginationStatus_1fhf3_869", ha = "_filterButton_1fhf3_885 _ring_1ftkm_135", pa = "_filterActive_1fhf3_912", ga = "_filterPanel_1fhf3_917", ma = "_filterContent_1fhf3_931 _scroll_1ftkm_106", wa = "_filterFooter_1fhf3_942", ba = "_filterLabel_1fhf3_956", va = "_filterValue_1fhf3_966", ya = "_filteredCount_1fhf3_972", Sa = "_rangeFields_1fhf3_983", _a = "_textFields_1fhf3_996", ka = "_textTerm_1fhf3_1003", Ca = "_rangePeriod_1fhf3_1013", xa = "_conditions_1fhf3_1019", Aa = "_conditionButton_1fhf3_1025", Ta = "_condition_1fhf3_1019", Na = "_columnsPanel_1fhf3_1051", Ra = "_fitAll_1fhf3_1060", Ea = "_columnsList_1fhf3_1064", Ma = "_columnsEntry_1fhf3_1073", Oa = "_columnGrip_1fhf3_1080", La = "_move_1fhf3_1126", $a = "_pinOn_1fhf3_1164", Fa = "_groupingChoice_1fhf3_1174", Pa = "_groupingHeading_1fhf3_1182", za = "_groupingOptions_1fhf3_1191", Ba = "_groupingOption_1fhf3_1191 _ring_1ftkm_135", Da = "_groupingLevel_1fhf3_1234", Va = "_groupingTag_1fhf3_1239", Ia = "_groupingTrigger_1fhf3_1246", Ka = "_groupingPrefix_1fhf3_1252", Ga = "_groupingPath_1fhf3_1257", ja = "_groupingSeparator_1fhf3_1261", Ha = "_groupHeader_1fhf3_1278", Wa = "_spanCell_1fhf3_288", qa = "_groupFolded_1fhf3_1402", Ua = "_spanValue_1fhf3_1406", Ya = "_groupLabel_1fhf3_1407", Ja = "_spanText_1fhf3_1420", Xa = "_groupValue_1fhf3_1421", Za = "_groupCount_1fhf3_1428", Qa = "_continued_1fhf3_1442", el = "_spanSelect_1fhf3_1473", tl = "_treeCell_1fhf3_1489", nl = "_treeText_1fhf3_1497", ol = "_foldSlot_1fhf3_1501", rl = "_treeRow_1fhf3_1511", sl = "_branchRow_1fhf3_1515", il = "_detailCell_1fhf3_1527", al = "_pathRow_1fhf3_1533", ll = "_fold_1fhf3_1501", cl = "_foldClosed_1fhf3_1574", dl = "_foldedCount_1fhf3_1584", ul = "_shareHost_1fhf3_1592", fl = "_shareBar_1fhf3_1599", hl = "_expander_1fhf3_1611", pl = "_expanderOpen_1fhf3_1646", gl = "_detailRow_1fhf3_1650", ml = "_treeDetail_1fhf3_1659", wl = "_treeDetailRail_1fhf3_1664", bl = "_branchLine_1fhf3_1672", vl = "_branchLoading_1fhf3_1680", yl = "_actionsCell_1fhf3_1694", Sl = "_actions_1fhf3_1694", _l = "_decision_1fhf3_1713", kl = "_reserve_1fhf3_1738", Cl = "_grip_1fhf3_1748", xl = "_virtualBody_1fhf3_1826", Al = "_virtualRow_1fhf3_1842", Tl = "_fillerRow_1fhf3_1866", Nl = "_grid_1fhf3_1892", Rl = "_editing_1fhf3_1908", El = "_editingValue_1fhf3_1912", Ml = "_editor_1fhf3_1918", Ol = "_editorField_1fhf3_1931", Ll = "_draftButtons_1fhf3_1963", $l = "_held_1fhf3_1971", Fl = "_deleteAsk_1fhf3_1975", Pl = "_newRowBar_1fhf3_1982", zl = "_draftMessage_1fhf3_1989", Bl = "_editorMessage_1fhf3_2014", Dl = "_rowButton_1fhf3_232", Vl = "_control_1fhf3_422", Il = "_empty_1fhf3_688", Kl = "_toned_1fhf3_1719", w = {
|
|
84
84
|
frame: mi,
|
|
85
85
|
children: wi,
|
|
86
86
|
scroll: bi,
|
|
@@ -90,26 +90,26 @@ const mi = "_frame_1ajo2_11 _text_1ftkm_22", wi = "_children_1ajo2_46", bi = "_s
|
|
|
90
90
|
sticky: _i,
|
|
91
91
|
columnsGroup: ki,
|
|
92
92
|
headGroup: Ci,
|
|
93
|
-
|
|
94
|
-
|
|
93
|
+
td: xi,
|
|
94
|
+
groupEdge: Ai,
|
|
95
95
|
rowHeader: Ti,
|
|
96
96
|
compact: Ni,
|
|
97
97
|
numeric: Ri,
|
|
98
|
-
value:
|
|
99
|
-
valueText:
|
|
100
|
-
sized:
|
|
101
|
-
cutTip:
|
|
102
|
-
absent:
|
|
103
|
-
striped:
|
|
104
|
-
pinned:
|
|
105
|
-
pinStartEdge:
|
|
106
|
-
pinEndEdge:
|
|
107
|
-
sortButton:
|
|
108
|
-
sortIndicator:
|
|
109
|
-
sortArrow:
|
|
110
|
-
sortArrowDesc:
|
|
111
|
-
sortActive:
|
|
112
|
-
zoneLabel:
|
|
98
|
+
value: Ei,
|
|
99
|
+
valueText: Mi,
|
|
100
|
+
sized: Oi,
|
|
101
|
+
cutTip: Li,
|
|
102
|
+
absent: $i,
|
|
103
|
+
striped: Fi,
|
|
104
|
+
pinned: Pi,
|
|
105
|
+
pinStartEdge: zi,
|
|
106
|
+
pinEndEdge: Bi,
|
|
107
|
+
sortButton: Di,
|
|
108
|
+
sortIndicator: Vi,
|
|
109
|
+
sortArrow: Ii,
|
|
110
|
+
sortArrowDesc: Ki,
|
|
111
|
+
sortActive: Gi,
|
|
112
|
+
zoneLabel: ji,
|
|
113
113
|
sortRank: Hi,
|
|
114
114
|
thFlex: Wi,
|
|
115
115
|
headLine: qi,
|
|
@@ -149,21 +149,21 @@ const mi = "_frame_1ajo2_11 _text_1ftkm_22", wi = "_children_1ajo2_46", bi = "_s
|
|
|
149
149
|
condition: Ta,
|
|
150
150
|
columnsPanel: Na,
|
|
151
151
|
fitAll: Ra,
|
|
152
|
-
columnsList:
|
|
153
|
-
columnsEntry:
|
|
154
|
-
columnGrip:
|
|
155
|
-
move:
|
|
156
|
-
pinOn:
|
|
157
|
-
groupingChoice:
|
|
158
|
-
groupingHeading:
|
|
159
|
-
groupingOptions:
|
|
160
|
-
groupingOption:
|
|
161
|
-
groupingLevel:
|
|
162
|
-
groupingTag:
|
|
163
|
-
groupingTrigger:
|
|
164
|
-
groupingPrefix:
|
|
165
|
-
groupingPath:
|
|
166
|
-
groupingSeparator:
|
|
152
|
+
columnsList: Ea,
|
|
153
|
+
columnsEntry: Ma,
|
|
154
|
+
columnGrip: Oa,
|
|
155
|
+
move: La,
|
|
156
|
+
pinOn: $a,
|
|
157
|
+
groupingChoice: Fa,
|
|
158
|
+
groupingHeading: Pa,
|
|
159
|
+
groupingOptions: za,
|
|
160
|
+
groupingOption: Ba,
|
|
161
|
+
groupingLevel: Da,
|
|
162
|
+
groupingTag: Va,
|
|
163
|
+
groupingTrigger: Ia,
|
|
164
|
+
groupingPrefix: Ka,
|
|
165
|
+
groupingPath: Ga,
|
|
166
|
+
groupingSeparator: ja,
|
|
167
167
|
groupHeader: Ha,
|
|
168
168
|
spanCell: Wa,
|
|
169
169
|
groupFolded: qa,
|
|
@@ -203,29 +203,29 @@ const mi = "_frame_1ajo2_11 _text_1ftkm_22", wi = "_children_1ajo2_46", bi = "_s
|
|
|
203
203
|
fillerRow: Tl,
|
|
204
204
|
grid: Nl,
|
|
205
205
|
editing: Rl,
|
|
206
|
-
editingValue:
|
|
207
|
-
editor:
|
|
208
|
-
editorField:
|
|
209
|
-
draftButtons:
|
|
210
|
-
held:
|
|
211
|
-
deleteAsk:
|
|
212
|
-
newRowBar:
|
|
213
|
-
draftMessage:
|
|
214
|
-
editorMessage:
|
|
215
|
-
rowButton:
|
|
216
|
-
control:
|
|
217
|
-
empty:
|
|
218
|
-
toned:
|
|
206
|
+
editingValue: El,
|
|
207
|
+
editor: Ml,
|
|
208
|
+
editorField: Ol,
|
|
209
|
+
draftButtons: Ll,
|
|
210
|
+
held: $l,
|
|
211
|
+
deleteAsk: Fl,
|
|
212
|
+
newRowBar: Pl,
|
|
213
|
+
draftMessage: zl,
|
|
214
|
+
editorMessage: Bl,
|
|
215
|
+
rowButton: Dl,
|
|
216
|
+
control: Vl,
|
|
217
|
+
empty: Il,
|
|
218
|
+
toned: Kl
|
|
219
219
|
}, Sr = {};
|
|
220
|
-
function
|
|
221
|
-
return t ? { ...e, className:
|
|
220
|
+
function Mt(e, t) {
|
|
221
|
+
return t ? { ...e, className: I(e.className, w.groupEdge) } : e;
|
|
222
222
|
}
|
|
223
223
|
function on(e, t, n = t) {
|
|
224
224
|
const o = hi(e, t, n);
|
|
225
225
|
if (!o) return Sr;
|
|
226
226
|
const r = o.side === "start";
|
|
227
227
|
return {
|
|
228
|
-
className:
|
|
228
|
+
className: I(w.pinned, o.edge && (r ? w.pinStartEdge : w.pinEndEdge)),
|
|
229
229
|
/* The scroll area keeps a padding as wide as the block for the browser's
|
|
230
230
|
scroll into view; a pinned cell lies inside it and would scroll the
|
|
231
231
|
table back to its start when focused. Its target is shifted out of the
|
|
@@ -241,15 +241,15 @@ function on(e, t, n = t) {
|
|
|
241
241
|
}
|
|
242
242
|
};
|
|
243
243
|
}
|
|
244
|
-
const
|
|
244
|
+
const Ot = (e) => e?.tHead?.rows?.[e.tHead.rows.length - 1];
|
|
245
245
|
function Nn(e) {
|
|
246
246
|
const t = e.getBoundingClientRect(), n = e.offsetWidth;
|
|
247
247
|
return n > 0 && t.width > 0 ? t.height * n / t.width : t.height;
|
|
248
248
|
}
|
|
249
249
|
const Rn = (e) => {
|
|
250
|
-
const t =
|
|
250
|
+
const t = Ot(e);
|
|
251
251
|
return t ? Nn(t) : 0;
|
|
252
|
-
},
|
|
252
|
+
}, Gl = ["date", "time", "dateTime", "timeWithSeconds", "dateTimeWithSeconds"], jl = new Set(Gl), Zn = (e) => jl.has(e), ge = (e) => e == null || typeof e == "number" && Number.isNaN(e);
|
|
253
253
|
function rn(e) {
|
|
254
254
|
return ge(e) ? "empty" : typeof e == "string" ? "text" : typeof e == "number" ? "number" : typeof e == "boolean" ? "boolean" : e instanceof Date ? Number.isNaN(e.getTime()) ? "empty" : "date" : "other";
|
|
255
255
|
}
|
|
@@ -290,9 +290,9 @@ function ft(e, t, n, o) {
|
|
|
290
290
|
return null;
|
|
291
291
|
}
|
|
292
292
|
}
|
|
293
|
-
function
|
|
293
|
+
function En(e, t) {
|
|
294
294
|
if (!ge(e)) {
|
|
295
|
-
if (t) return
|
|
295
|
+
if (t) return En(t(e));
|
|
296
296
|
switch (rn(e)) {
|
|
297
297
|
case "text":
|
|
298
298
|
return e;
|
|
@@ -307,9 +307,9 @@ function jn(e, t) {
|
|
|
307
307
|
}
|
|
308
308
|
}
|
|
309
309
|
}
|
|
310
|
-
function
|
|
310
|
+
function Pt(e, t) {
|
|
311
311
|
if (!ge(e)) {
|
|
312
|
-
if (t) return
|
|
312
|
+
if (t) return Pt(t(e));
|
|
313
313
|
switch (rn(e)) {
|
|
314
314
|
case "text":
|
|
315
315
|
case "number":
|
|
@@ -321,15 +321,15 @@ function Ft(e, t) {
|
|
|
321
321
|
}
|
|
322
322
|
}
|
|
323
323
|
}
|
|
324
|
-
const eo = "absent", Xe = (e) => ge(e) ? eo : e instanceof Date ? `value:${e.getTime()}` : `value:${String(e)}`,
|
|
324
|
+
const eo = "absent", Xe = (e) => ge(e) ? eo : e instanceof Date ? `value:${e.getTime()}` : `value:${String(e)}`, $o = (e) => e instanceof Date ? e.getTime() : typeof e == "number" && !Number.isNaN(e) ? e : void 0;
|
|
325
325
|
function to(e, t) {
|
|
326
326
|
const n = t.map(e.read).filter((u) => !ge(u) && !(u instanceof Date && Number.isNaN(u.getTime()))), o = e.aggregate;
|
|
327
327
|
if (typeof o == "function") return o(n, t);
|
|
328
328
|
if (o === "count") return n.length;
|
|
329
329
|
if (o === "distinct") return new Set(n.map(Xe)).size;
|
|
330
|
-
const r = n.filter((u) =>
|
|
330
|
+
const r = n.filter((u) => $o(u) !== void 0);
|
|
331
331
|
if (r.length === 0) return;
|
|
332
|
-
const s = r.map((u) =>
|
|
332
|
+
const s = r.map((u) => $o(u)), i = r[0] instanceof Date, a = (u) => i ? new Date(u) : u;
|
|
333
333
|
let l = 1 / 0, c = -1 / 0;
|
|
334
334
|
for (const u of s)
|
|
335
335
|
u < l && (l = u), u > c && (c = u);
|
|
@@ -346,12 +346,12 @@ function to(e, t) {
|
|
|
346
346
|
return [a(l), a(c)];
|
|
347
347
|
}
|
|
348
348
|
}
|
|
349
|
-
const no = 3, lt = (e) => e.size ?? e.rows.length,
|
|
349
|
+
const no = 3, lt = (e) => e.size ?? e.rows.length, Fo = (e) => JSON.stringify(e.map(Xe)), Et = (e) => {
|
|
350
350
|
if (!ge(e))
|
|
351
351
|
return e instanceof Date ? e.getTime() : typeof e == "boolean" ? e ? 1 : 0 : typeof e == "number" ? e : String(e);
|
|
352
352
|
};
|
|
353
353
|
function wn(e, t, n) {
|
|
354
|
-
const o =
|
|
354
|
+
const o = Et(e), r = Et(t);
|
|
355
355
|
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));
|
|
356
356
|
}
|
|
357
357
|
function Hl(e, t) {
|
|
@@ -379,7 +379,7 @@ function Hl(e, t) {
|
|
|
379
379
|
let v;
|
|
380
380
|
for (const y of g.rows) {
|
|
381
381
|
const k = l.order(y);
|
|
382
|
-
|
|
382
|
+
Et(k) !== void 0 && (v === void 0 || wn(k, v, n) < 0) && (v = k);
|
|
383
383
|
}
|
|
384
384
|
return v;
|
|
385
385
|
}, m = (g) => {
|
|
@@ -389,7 +389,7 @@ function Hl(e, t) {
|
|
|
389
389
|
}, p = [...c.values()].sort((g, v) => {
|
|
390
390
|
if (g.value === void 0 || v.value === void 0) return wn(g.value, v.value, n);
|
|
391
391
|
const y = m(g), k = m(v), _ = wn(y, k, n);
|
|
392
|
-
return
|
|
392
|
+
return Et(y) === void 0 || Et(k) === void 0 ? _ : _ * d;
|
|
393
393
|
});
|
|
394
394
|
for (const g of p)
|
|
395
395
|
g.groups = o(g.rows, s + 1, a.get(g));
|
|
@@ -406,15 +406,15 @@ function Wl(e, t) {
|
|
|
406
406
|
}
|
|
407
407
|
const ql = (e, t) => (n) => {
|
|
408
408
|
if (!(n instanceof Date) || Number.isNaN(n.getTime())) return;
|
|
409
|
-
const { year: o, month: r, day: s, weekday: i } =
|
|
409
|
+
const { year: o, month: r, day: s, weekday: i } = Ie(n, t);
|
|
410
410
|
return e === "year" ? Ut({ year: o, month: 0, day: 1 }, t) : e === "month" ? Ut({ year: o, month: r, day: 1 }, t) : e === "week" ? Ut({ year: o, month: r, day: s - (i + 6) % 7 }, t) : pr(n, t);
|
|
411
411
|
};
|
|
412
412
|
function Ul(e, t) {
|
|
413
|
-
const { year: n, month: o, day: r, weekday: s } =
|
|
413
|
+
const { year: n, month: o, day: r, weekday: s } = Ie(e, t), i = new Date(Date.UTC(n, o, r + 3 - (s + 6) % 7)), a = i.getUTCFullYear(), l = (i.getTime() - Date.UTC(a, 0, 1)) / 864e5;
|
|
414
414
|
return { week: Math.floor(l / 7) + 1, year: a };
|
|
415
415
|
}
|
|
416
416
|
function Yl(e, t, n, o, r) {
|
|
417
|
-
if (e === "year") return String(
|
|
417
|
+
if (e === "year") return String(Ie(t, r).year);
|
|
418
418
|
if (e === "month") return n.month(t);
|
|
419
419
|
if (e === "week") {
|
|
420
420
|
const { week: s, year: i } = Ul(t, r);
|
|
@@ -445,7 +445,7 @@ function xr(e, t, n) {
|
|
|
445
445
|
const o = Cr(e, n), r = o.length, s = Math.min(Math.max(1, t), r), i = n > 0 ? e.slice(o[s - 1], o[s] ?? e.length) : [...e];
|
|
446
446
|
return { lines: Ar(i), page: s, pageCount: r };
|
|
447
447
|
}
|
|
448
|
-
const
|
|
448
|
+
const zt = (e) => e.flatMap((t) => t.kind === "row" ? [t.row] : []);
|
|
449
449
|
function Ar(e) {
|
|
450
450
|
const t = e[0];
|
|
451
451
|
if (!t) return [...e];
|
|
@@ -470,10 +470,10 @@ function Jl(e, t, n) {
|
|
|
470
470
|
return `${b}.at must be an index in rows, not before the one of the group above it`;
|
|
471
471
|
a = h.at;
|
|
472
472
|
const m = h.path.length - 1, p = m > 0 ? i[m - 1] : void 0;
|
|
473
|
-
if (m > 0 && (!p || p.path !==
|
|
473
|
+
if (m > 0 && (!p || p.path !== Fo(h.path.slice(0, m))))
|
|
474
474
|
return `${b} is a group of level ${m + 1} that does not stand under the group above it`;
|
|
475
475
|
const g = h.path[m], v = {
|
|
476
|
-
path:
|
|
476
|
+
path: Fo(h.path),
|
|
477
477
|
value: ge(g) ? void 0 : g,
|
|
478
478
|
level: m,
|
|
479
479
|
rows: [],
|
|
@@ -516,7 +516,7 @@ function Rr(e, t, n) {
|
|
|
516
516
|
});
|
|
517
517
|
return { term: o, matches: (i) => s(i) && (n ? n(i) : !0) };
|
|
518
518
|
}
|
|
519
|
-
function
|
|
519
|
+
function Er(e, t) {
|
|
520
520
|
const n = Array.isArray(t) ? t : t ? [t] : [], o = [], r = n.map((i) => {
|
|
521
521
|
const a = e.find((h) => h.id === i.column);
|
|
522
522
|
if (!a || !a.compare && !a.value) return null;
|
|
@@ -537,21 +537,21 @@ function jr(e, t) {
|
|
|
537
537
|
}).map((a) => a.row)
|
|
538
538
|
) };
|
|
539
539
|
}
|
|
540
|
-
function
|
|
541
|
-
const { matches: o } = Rr(t, n.search, n.filter), { levels: r, sorted: s } =
|
|
540
|
+
function Mr(e, t, n) {
|
|
541
|
+
const { matches: o } = Rr(t, n.search, n.filter), { levels: r, sorted: s } = Er(t, n.sort);
|
|
542
542
|
return { filtered: s(e.filter(o)), levels: r };
|
|
543
543
|
}
|
|
544
|
-
function
|
|
544
|
+
function Or(e, t, n) {
|
|
545
545
|
return Hl(e, { levels: n.levels, aggregates: n.aggregates, compareText: n.compareText, sort: t });
|
|
546
546
|
}
|
|
547
|
-
function
|
|
548
|
-
const { page: r = 1, pageSize: s, hidden: i, order: a } = t, l =
|
|
547
|
+
function Mn(e, t, n, o) {
|
|
548
|
+
const { page: r = 1, pageSize: s, hidden: i, order: a } = t, l = On(e, i, a);
|
|
549
549
|
if (o) {
|
|
550
550
|
const h = xr(o.lines, r, s ?? 0);
|
|
551
551
|
return {
|
|
552
552
|
columns: l,
|
|
553
553
|
filtered: n,
|
|
554
|
-
visible:
|
|
554
|
+
visible: zt(h.lines),
|
|
555
555
|
groups: o.groups,
|
|
556
556
|
lines: o.lines,
|
|
557
557
|
visibleLines: h.lines,
|
|
@@ -570,14 +570,14 @@ function En(e, t, n, o) {
|
|
|
570
570
|
columnCount: l.length
|
|
571
571
|
};
|
|
572
572
|
}
|
|
573
|
-
const
|
|
573
|
+
const On = (e, t, n) => {
|
|
574
574
|
const o = Nr(e, n);
|
|
575
575
|
return t?.length ? o.filter((r) => r.hideable === !1 || !t.includes(r.id)) : o;
|
|
576
576
|
};
|
|
577
|
-
function
|
|
577
|
+
function Lr(e, t, n) {
|
|
578
578
|
const { page: o = 1, pageSize: r, hidden: s, order: i } = n;
|
|
579
579
|
if (n.server) {
|
|
580
|
-
const u =
|
|
580
|
+
const u = On(t, s, i), { rowCount: d, answered: h } = n.server, b = r && r > 0 ? r : Math.max(d, 1), m = Math.max(1, Math.ceil(d / b)), p = d === 0 && !h ? Math.max(1, o) : Math.min(Math.max(1, o), m);
|
|
581
581
|
return {
|
|
582
582
|
columns: u,
|
|
583
583
|
filtered: [...e],
|
|
@@ -595,13 +595,13 @@ function Or(e, t, n) {
|
|
|
595
595
|
};
|
|
596
596
|
}
|
|
597
597
|
if (n.tree) {
|
|
598
|
-
const { term: u, matches: d } = Rr(t, n.search, n.filter), { sorted: h } =
|
|
599
|
-
return Zl(e, n.tree, h, u || n.filter ? d : void 0,
|
|
598
|
+
const { term: u, matches: d } = Rr(t, n.search, n.filter), { sorted: h } = Er(t, n.sort);
|
|
599
|
+
return Zl(e, n.tree, h, u || n.filter ? d : void 0, On(t, s, i));
|
|
600
600
|
}
|
|
601
|
-
const { filtered: a, levels: l } =
|
|
602
|
-
if (!n.grouping?.levels.length) return
|
|
603
|
-
const c =
|
|
604
|
-
return
|
|
601
|
+
const { filtered: a, levels: l } = Mr(e, t, n);
|
|
602
|
+
if (!n.grouping?.levels.length) return Mn(t, n, a);
|
|
603
|
+
const c = Or(a, l, n.grouping);
|
|
604
|
+
return Mn(t, n, a, { groups: c, lines: kr(c, n.grouping.folded) });
|
|
605
605
|
}
|
|
606
606
|
function Zl(e, t, n, o, r) {
|
|
607
607
|
const { admit: s } = t, i = (v) => n(s ? v.filter(s) : v), a = /* @__PURE__ */ new Map(), l = {
|
|
@@ -616,7 +616,7 @@ function Zl(e, t, n, o, r) {
|
|
|
616
616
|
label: () => "",
|
|
617
617
|
unloaded: t.unloaded,
|
|
618
618
|
matches: o
|
|
619
|
-
}, c = i(e), u = { expanded: t.open, checked: /* @__PURE__ */ new Set(), active: null, anchor: null, search: "" }, d =
|
|
619
|
+
}, c = i(e), u = { expanded: t.open, checked: /* @__PURE__ */ new Set(), active: null, anchor: null, search: "" }, d = Eo(c, l, u), h = /* @__PURE__ */ new Set();
|
|
620
620
|
let b = 0;
|
|
621
621
|
const m = (v) => {
|
|
622
622
|
for (const y of v) {
|
|
@@ -626,7 +626,7 @@ function Zl(e, t, n, o, r) {
|
|
|
626
626
|
}
|
|
627
627
|
};
|
|
628
628
|
m(c);
|
|
629
|
-
const p =
|
|
629
|
+
const p = Eo(c, l, { ...u, expanded: h }), g = d.map((v) => v.node);
|
|
630
630
|
return {
|
|
631
631
|
columns: r,
|
|
632
632
|
filtered: p.filter((v) => v.matches).map((v) => v.node),
|
|
@@ -642,16 +642,16 @@ function Zl(e, t, n, o, r) {
|
|
|
642
642
|
};
|
|
643
643
|
}
|
|
644
644
|
const Ql = 120, ec = 300;
|
|
645
|
-
function
|
|
645
|
+
function $r(e) {
|
|
646
646
|
const t = e.hook?.tableState;
|
|
647
647
|
return !!t && e.framed && e.paginates() && !t.virtual && !e.tree && t.chosenPageSize === null;
|
|
648
648
|
}
|
|
649
|
-
const
|
|
649
|
+
const Ln = (e) => e.server && $r(e) && e.fitMeasured !== e.hook.tableState.pageSize;
|
|
650
650
|
function tc(e, t, n) {
|
|
651
651
|
return e >= n * t - 1 && e < (n + 1) * t ? n : Math.max(1, Math.floor(e / t));
|
|
652
652
|
}
|
|
653
|
-
const
|
|
654
|
-
function
|
|
653
|
+
const Po = (e) => e.server ? e.hook?.publicSnapshot.rowCount ?? 0 : Tr(e.projection());
|
|
654
|
+
function zo(e, t) {
|
|
655
655
|
const n = Rn(e), o = e.tHead ? Nn(e.tHead) : 0, r = e.tFoot ? Nn(e.tFoot) : 0;
|
|
656
656
|
return { pitch: n, room: t.clientHeight - o - r };
|
|
657
657
|
}
|
|
@@ -664,24 +664,24 @@ function nc(e) {
|
|
|
664
664
|
return n.remove(), o;
|
|
665
665
|
}
|
|
666
666
|
function oc(e, t, n, o, r) {
|
|
667
|
-
const s =
|
|
667
|
+
const s = j({ loading: n });
|
|
668
668
|
ee(() => {
|
|
669
669
|
s.current = { loading: n };
|
|
670
670
|
});
|
|
671
|
-
const i =
|
|
671
|
+
const i = j(""), a = j(0), l = () => {
|
|
672
672
|
const h = e.hook, b = t.current, m = b?.parentElement;
|
|
673
673
|
if (!h || !b || !m) return;
|
|
674
674
|
const p = h.tableState;
|
|
675
|
-
if (
|
|
675
|
+
if (!$r(e)) {
|
|
676
676
|
p.pageSize !== (p.chosenPageSize ?? p.defaultPageSize) && p.setFittedPageSize(null);
|
|
677
677
|
return;
|
|
678
678
|
}
|
|
679
679
|
if (!m.style.getPropertyValue("--_table-held") || !m.clientHeight) return;
|
|
680
|
-
const { pitch: g, room: v } =
|
|
680
|
+
const { pitch: g, room: v } = zo(b, m);
|
|
681
681
|
if (!g) return;
|
|
682
|
-
const y = r ? v - nc(m) : v, k =
|
|
682
|
+
const y = r ? v - nc(m) : v, k = Po(e), _ = p.pageSize, x = tc(y, g, _);
|
|
683
683
|
!(e.server && e.fitMeasured === null) && (k === 0 && !s.current.loading || k > 0 && x >= k && _ >= k) || (x < 3 && te("fit-few-lines", `The table's frame holds fewer than three lines (${x}); give it more height or let it flow.`), x !== _ && p.setFittedPageSize(x === p.defaultPageSize ? null : x), e.server && e.setFitMeasured(x));
|
|
684
|
-
}, c = e.hook?.tableState, u = `${e.framed}|${o}|${c?.pageSize}|${c?.chosenPageSize}`, d = e.hook && !e.server ?
|
|
684
|
+
}, c = e.hook?.tableState, u = `${e.framed}|${o}|${c?.pageSize}|${c?.chosenPageSize}`, d = e.hook && !e.server ? Po(e) : 0;
|
|
685
685
|
ee(() => {
|
|
686
686
|
!(i.current !== u) && a.current === d || (i.current = u, a.current = d, l());
|
|
687
687
|
}), ee(() => {
|
|
@@ -691,7 +691,7 @@ function oc(e, t, n, o, r) {
|
|
|
691
691
|
const m = () => {
|
|
692
692
|
const g = t.current, v = e.hook;
|
|
693
693
|
if (!g || !v || !e.framed) return !1;
|
|
694
|
-
const { pitch: y, room: k } =
|
|
694
|
+
const { pitch: y, room: k } = zo(g, h);
|
|
695
695
|
return y > 0 && k < v.tableState.pageSize * y - 1;
|
|
696
696
|
}, p = new ResizeObserver(() => {
|
|
697
697
|
clearTimeout(b), !e.server && m() ? l() : b = setTimeout(l, e.server ? ec : Ql);
|
|
@@ -716,7 +716,7 @@ function rc(e, t) {
|
|
|
716
716
|
o = o.filter((a) => !i.includes(a));
|
|
717
717
|
}
|
|
718
718
|
}
|
|
719
|
-
function
|
|
719
|
+
function Bo(e) {
|
|
720
720
|
const t = Array.from(e.tHead?.querySelectorAll("th[data-flex]") ?? []), n = e.parentElement;
|
|
721
721
|
if (t.length === 0 || !n) return;
|
|
722
722
|
const o = e.style.width;
|
|
@@ -735,20 +735,20 @@ function sc(e) {
|
|
|
735
735
|
}
|
|
736
736
|
const ic = (e, t) => e === t || e !== void 0 && t !== void 0 && e.length === t.length && e.every((n, o) => n === t[o]);
|
|
737
737
|
function ac(e, t) {
|
|
738
|
-
const n =
|
|
738
|
+
const n = j(null);
|
|
739
739
|
ee(() => {
|
|
740
740
|
const o = e.current;
|
|
741
741
|
if (!o) return;
|
|
742
742
|
const r = sc(o);
|
|
743
|
-
r === n.current?.inputs && ic(t, n.current.rows) || (n.current = { inputs: r, rows: t },
|
|
743
|
+
r === n.current?.inputs && ic(t, n.current.rows) || (n.current = { inputs: r, rows: t }, Bo(o));
|
|
744
744
|
}), ee(() => {
|
|
745
745
|
const o = e.current, r = o?.parentElement;
|
|
746
746
|
if (!o || !r || typeof ResizeObserver > "u") return;
|
|
747
|
-
const s = new ResizeObserver(() =>
|
|
747
|
+
const s = new ResizeObserver(() => Bo(o));
|
|
748
748
|
return s.observe(r), () => s.disconnect();
|
|
749
749
|
}, [e]);
|
|
750
750
|
}
|
|
751
|
-
function
|
|
751
|
+
function Fr(e) {
|
|
752
752
|
const t = e.parentElement, n = e.closest("table");
|
|
753
753
|
if (!t || !n) return 0;
|
|
754
754
|
const o = Array.from(t.children).indexOf(e), r = t.children.length, s = { cell: e.style.width, min: e.style.minWidth, table: n.style.width };
|
|
@@ -773,12 +773,12 @@ function $r(e) {
|
|
|
773
773
|
}
|
|
774
774
|
function lc(e, t) {
|
|
775
775
|
for (const n of Array.from(e?.tHead?.querySelectorAll("th[data-column]") ?? [])) {
|
|
776
|
-
const o =
|
|
776
|
+
const o = Fr(n);
|
|
777
777
|
o > 0 && t(n.dataset.column, Math.max(48, o + 1));
|
|
778
778
|
}
|
|
779
779
|
}
|
|
780
780
|
function cc(e) {
|
|
781
|
-
const [t, n] =
|
|
781
|
+
const [t, n] = G(/* @__PURE__ */ new Set()), [o, r] = G(!1), [s, i] = G(/* @__PURE__ */ new Set()), a = _e(
|
|
782
782
|
(p) => o ? !s.has(p) : t.has(p),
|
|
783
783
|
[t, o, s]
|
|
784
784
|
), l = _e(
|
|
@@ -836,110 +836,110 @@ function cc(e) {
|
|
|
836
836
|
count: t.size
|
|
837
837
|
};
|
|
838
838
|
}
|
|
839
|
-
function
|
|
839
|
+
function $n(e) {
|
|
840
840
|
const t = {};
|
|
841
841
|
for (const n of e) n.width !== void 0 && (t[n.id] = n.width);
|
|
842
842
|
return t;
|
|
843
843
|
}
|
|
844
|
-
function
|
|
844
|
+
function Pr(e, t, n) {
|
|
845
845
|
if (!e.lines) return { ...e, visible: (e.shown ?? e.filtered).slice(t, n) };
|
|
846
846
|
const o = e.lines.slice(t, n);
|
|
847
|
-
return { ...e, visibleLines: o, visible:
|
|
847
|
+
return { ...e, visibleLines: o, visible: zt(o) };
|
|
848
848
|
}
|
|
849
|
-
const
|
|
849
|
+
const Do = (e, t) => t == null ? -1 : e.findIndex((n) => n === t || String(n) === t);
|
|
850
850
|
function dc(e, t, n) {
|
|
851
|
-
const { rowKey: o, filter: r, defaultSort: s = null, initialView: i, virtual: a, grouping: l, server: c, tree: u } = n, d = (
|
|
852
|
-
m(
|
|
853
|
-
}, re = a || u ? 0 : N ?? T, A = !c && !u,
|
|
854
|
-
() => A ?
|
|
851
|
+
const { rowKey: o, filter: r, defaultSort: s = null, initialView: i, virtual: a, grouping: l, server: c, tree: u } = n, d = (F) => F?.sort ? [...F.sort] : s ? Array.isArray(s) ? [...s] : [s] : [], h = (F) => F?.widths ? { ...F.widths } : $n(t), [b, m] = G(i?.search ?? ""), [p, g] = G(() => d(i)), [v, y] = G(i?.page ?? 1), [k, _] = G(i?.pageSize ?? null), x = n.pageSize ?? 10, T = k ?? x, [N, R] = G(null), [C, L] = G([]), [E, D] = G(i?.hidden ?? []), [$, X] = G(i?.order ?? []), [K, z] = G(() => h(i)), H = (F) => {
|
|
852
|
+
m(F.search ?? ""), g(d(F)), y(F.page ?? 1), _(F.pageSize ?? null), R(null), D(F.hidden ?? []), X(F.order ?? []), z(h(F));
|
|
853
|
+
}, re = a || u ? 0 : N ?? T, A = !c && !u, O = oe(
|
|
854
|
+
() => A ? Mr(e, t, { search: b, filter: r, sort: p }) : null,
|
|
855
855
|
[A, e, t, b, r, p]
|
|
856
|
-
),
|
|
857
|
-
() =>
|
|
856
|
+
), B = l?.levels.length ? l : void 0, Y = oe(
|
|
857
|
+
() => O && B ? Or(O.filtered, O.levels, B) : void 0,
|
|
858
858
|
// The fold is not an input of the grouping: it only chooses lines.
|
|
859
859
|
// eslint-disable-next-line react-hooks/exhaustive-deps -- the grouping's other fields are read through `groupLevels`, whose parts stand in the list
|
|
860
|
-
[
|
|
860
|
+
[O, B?.levels, B?.aggregates, B?.compareText]
|
|
861
861
|
), ce = oe(
|
|
862
|
-
() => Y &&
|
|
862
|
+
() => Y && B ? kr(Y, B.folded) : void 0,
|
|
863
863
|
// eslint-disable-next-line react-hooks/exhaustive-deps -- the lines follow the groups and the fold only; the rest of `groupLevels` is read with that render
|
|
864
|
-
[Y,
|
|
864
|
+
[Y, B?.folded]
|
|
865
865
|
), U = oe(
|
|
866
|
-
() =>
|
|
867
|
-
[
|
|
866
|
+
() => O ? Mn(t, { page: v, pageSize: re, hidden: E, order: $ }, O.filtered, Y && ce ? { groups: Y, lines: ce } : void 0) : Lr(e, t, { search: b, filter: r, sort: p, page: v, pageSize: re, hidden: E, order: $, grouping: l, server: c, tree: u }),
|
|
867
|
+
[O, Y, ce, t, v, re, E, $, e, b, r, p, l, c, u]
|
|
868
868
|
), ie = A && !a && U.filtered.length > 0 ? U.page : v;
|
|
869
869
|
ie !== v && y(ie);
|
|
870
|
-
const [he, de] =
|
|
870
|
+
const [he, de] = G(36), ne = js(a ? (U.lines ?? U.shown ?? U.filtered).length : 0, {
|
|
871
871
|
rowHeight: a ? he : 0,
|
|
872
872
|
overscan: typeof a == "object" ? a.overscan : void 0
|
|
873
873
|
}), Te = oe(
|
|
874
|
-
() => a ?
|
|
874
|
+
() => a ? Pr(U, ne.from, ne.to) : U,
|
|
875
875
|
[a, U, ne.from, ne.to]
|
|
876
|
-
), me = Te.visibleLines, se = Te.visible, Z = oe(() => U.filtered.map(o), [U.filtered, o]),
|
|
876
|
+
), me = Te.visibleLines, se = Te.visible, Z = oe(() => U.filtered.map(o), [U.filtered, o]), Oe = cc(Z), [Fe, be] = G(0), ot = ne.scrollRef;
|
|
877
877
|
ee(() => {
|
|
878
|
-
const
|
|
879
|
-
|
|
880
|
-
}, [
|
|
881
|
-
const
|
|
882
|
-
y(
|
|
883
|
-
}, []), ve = _e((
|
|
884
|
-
m(
|
|
885
|
-
}, [
|
|
878
|
+
const F = ot.current;
|
|
879
|
+
Fe > 0 && F?.scrollTo({ top: 0 });
|
|
880
|
+
}, [Fe]);
|
|
881
|
+
const Ke = _e((F) => {
|
|
882
|
+
y(F), F === 1 && be((J) => J + 1);
|
|
883
|
+
}, []), ve = _e((F) => {
|
|
884
|
+
m(F), Ke(1);
|
|
885
|
+
}, [Ke]), qe = j({ projection: U, chosen: T, size: N ?? T });
|
|
886
886
|
ee(() => {
|
|
887
887
|
qe.current = { projection: U, chosen: T, size: N ?? T };
|
|
888
888
|
});
|
|
889
|
-
const Ce =
|
|
889
|
+
const Ce = j(() => ({ focus: null, current: null })), Pe = _e((F) => {
|
|
890
890
|
const J = qe.current.projection;
|
|
891
891
|
if (c) {
|
|
892
|
-
const { focus: Re, current: un } = Ce.current(), fn = J.visibleLines ? J.visibleLines.map((tt) => tt.kind === "row" ? o(tt.row) : null) : J.visible.map(o), hn = [Re, un].map((tt) =>
|
|
893
|
-
return Math.floor(((J.page - 1) * qe.current.size + hn) /
|
|
892
|
+
const { focus: Re, current: un } = Ce.current(), fn = J.visibleLines ? J.visibleLines.map((tt) => tt.kind === "row" ? o(tt.row) : null) : J.visible.map(o), hn = [Re, un].map((tt) => Do(fn, tt)).find((tt) => tt >= 0) ?? 0;
|
|
893
|
+
return Math.floor(((J.page - 1) * qe.current.size + hn) / F) + 1;
|
|
894
894
|
}
|
|
895
|
-
const pe = J.lines ?
|
|
895
|
+
const pe = J.lines ? zt(J.lines) : J.filtered, Be = pe.map(o), Le = new Set(J.visible.map(o)), { focus: ht, current: pt } = Ce.current(), gt = [ht, pt && Le.has(pt) ? pt : null, J.visible[0] ? o(J.visible[0]) : null].map((Re) => Do(Be, Re)).find((Re) => Re >= 0);
|
|
896
896
|
if (gt === void 0) return 1;
|
|
897
|
-
if (!J.lines) return Math.floor(gt /
|
|
898
|
-
const mt = pe[gt],
|
|
899
|
-
return
|
|
900
|
-
}, [o, c]),
|
|
901
|
-
y(
|
|
902
|
-
}, [
|
|
903
|
-
Ue.current = !0, y(
|
|
904
|
-
}, [
|
|
897
|
+
if (!J.lines) return Math.floor(gt / F) + 1;
|
|
898
|
+
const mt = pe[gt], Vt = J.lines.findIndex((Re) => Re.kind === "row" && Re.row === mt);
|
|
899
|
+
return Vt < 0 ? 1 : Cr(J.lines, F).filter((Re) => Re <= Vt).length;
|
|
900
|
+
}, [o, c]), ze = _e((F) => {
|
|
901
|
+
y(Pe(F === "fit" ? x : F)), _(F === "fit" ? null : F), R(null);
|
|
902
|
+
}, [Pe, x]), Ue = j(!1), Ye = _e((F) => {
|
|
903
|
+
Ue.current = !0, y(Pe(F ?? qe.current.chosen)), R(F);
|
|
904
|
+
}, [Pe]), Ne = _e((F, J = !1) => {
|
|
905
905
|
g((pe) => {
|
|
906
|
-
const
|
|
906
|
+
const Be = pe.find((Le) => Le.column === F);
|
|
907
907
|
if (!J) {
|
|
908
|
-
const
|
|
909
|
-
return [{ column:
|
|
908
|
+
const Le = pe.length === 1 && Be?.direction === "asc" ? "desc" : "asc";
|
|
909
|
+
return [{ column: F, direction: Le }];
|
|
910
910
|
}
|
|
911
|
-
return
|
|
912
|
-
(
|
|
913
|
-
) : pe.filter((
|
|
911
|
+
return Be ? Be.direction === "asc" ? pe.map(
|
|
912
|
+
(Le) => Le.column === F ? { column: F, direction: "desc" } : Le
|
|
913
|
+
) : pe.filter((Le) => Le.column !== F) : [...pe, { column: F, direction: "asc" }];
|
|
914
914
|
}), y(1);
|
|
915
|
-
}, []), _t = _e((
|
|
916
|
-
|
|
917
|
-
(J) => J.includes(
|
|
915
|
+
}, []), _t = _e((F) => {
|
|
916
|
+
L(
|
|
917
|
+
(J) => J.includes(F) ? J.filter((pe) => pe !== F) : [...J, F]
|
|
918
918
|
);
|
|
919
|
-
}, []), q = _e((
|
|
920
|
-
|
|
921
|
-
(J) => J.includes(
|
|
919
|
+
}, []), q = _e((F) => {
|
|
920
|
+
D(
|
|
921
|
+
(J) => J.includes(F) ? J.filter((pe) => pe !== F) : [...J, F]
|
|
922
922
|
);
|
|
923
|
-
}, []), Qe = _e((
|
|
924
|
-
|
|
923
|
+
}, []), Qe = _e((F, J) => {
|
|
924
|
+
z((pe) => {
|
|
925
925
|
if (J === void 0) {
|
|
926
|
-
if (!(
|
|
927
|
-
const
|
|
928
|
-
return delete
|
|
926
|
+
if (!(F in pe)) return pe;
|
|
927
|
+
const Be = { ...pe };
|
|
928
|
+
return delete Be[F], Be;
|
|
929
929
|
}
|
|
930
|
-
return { ...pe, [
|
|
930
|
+
return { ...pe, [F]: J };
|
|
931
931
|
});
|
|
932
|
-
}, []), et = oe(() =>
|
|
933
|
-
const
|
|
934
|
-
for (const [J, pe] of Object.entries(
|
|
935
|
-
et[J] !== pe && (
|
|
936
|
-
return
|
|
937
|
-
}, [
|
|
932
|
+
}, []), et = oe(() => $n(t), [t]), xe = oe(() => {
|
|
933
|
+
const F = {};
|
|
934
|
+
for (const [J, pe] of Object.entries(K))
|
|
935
|
+
et[J] !== pe && (F[J] = pe);
|
|
936
|
+
return F;
|
|
937
|
+
}, [K, et]), W = oe(
|
|
938
938
|
() => s ? Array.isArray(s) ? s : [s] : [],
|
|
939
939
|
[s]
|
|
940
940
|
), Se = p.length === W.length && p.every(
|
|
941
|
-
(
|
|
942
|
-
),
|
|
941
|
+
(F, J) => F.column === W[J]?.column && F.direction === W[J]?.direction
|
|
942
|
+
), Ge = oe(
|
|
943
943
|
() => ({
|
|
944
944
|
...b ? { search: b } : {},
|
|
945
945
|
...Se ? {} : { sort: p },
|
|
@@ -948,8 +948,8 @@ function dc(e, t, n) {
|
|
|
948
948
|
opening. */
|
|
949
949
|
...!a && U.page > 1 ? { page: U.page } : {},
|
|
950
950
|
...!a && k !== null ? { pageSize: k } : {},
|
|
951
|
-
...
|
|
952
|
-
|
|
951
|
+
...E.length ? { hidden: E } : {},
|
|
952
|
+
...$.length ? { order: $ } : {},
|
|
953
953
|
...Object.keys(xe).length ? { widths: xe } : {}
|
|
954
954
|
}),
|
|
955
955
|
[
|
|
@@ -959,8 +959,8 @@ function dc(e, t, n) {
|
|
|
959
959
|
Se,
|
|
960
960
|
U.page,
|
|
961
961
|
k,
|
|
962
|
-
|
|
963
|
-
|
|
962
|
+
E,
|
|
963
|
+
$,
|
|
964
964
|
xe
|
|
965
965
|
]
|
|
966
966
|
);
|
|
@@ -972,36 +972,36 @@ function dc(e, t, n) {
|
|
|
972
972
|
setPitch: de,
|
|
973
973
|
server: c,
|
|
974
974
|
restart: H,
|
|
975
|
-
view:
|
|
975
|
+
view: Ge,
|
|
976
976
|
search: b,
|
|
977
977
|
setSearch: ve,
|
|
978
978
|
sort: p,
|
|
979
979
|
toggleSort: Ne,
|
|
980
|
-
setPage:
|
|
980
|
+
setPage: Ke,
|
|
981
981
|
pageSize: N ?? T,
|
|
982
|
-
setPageSize:
|
|
982
|
+
setPageSize: ze,
|
|
983
983
|
chosenPageSize: k,
|
|
984
|
-
setAnchor: (
|
|
985
|
-
Ce.current =
|
|
984
|
+
setAnchor: (F) => {
|
|
985
|
+
Ce.current = F;
|
|
986
986
|
},
|
|
987
987
|
defaultPageSize: x,
|
|
988
988
|
setFittedPageSize: Ye,
|
|
989
989
|
takeFitMoved: () => {
|
|
990
|
-
const
|
|
991
|
-
return Ue.current = !1,
|
|
990
|
+
const F = Ue.current;
|
|
991
|
+
return Ue.current = !1, F;
|
|
992
992
|
},
|
|
993
993
|
expanded: C,
|
|
994
994
|
toggleRow: _t,
|
|
995
|
-
hidden:
|
|
995
|
+
hidden: E,
|
|
996
996
|
toggleColumn: q,
|
|
997
|
-
order:
|
|
997
|
+
order: $,
|
|
998
998
|
setOrder: X,
|
|
999
|
-
widths:
|
|
999
|
+
widths: K,
|
|
1000
1000
|
setWidth: Qe,
|
|
1001
|
-
selection:
|
|
1001
|
+
selection: Oe
|
|
1002
1002
|
};
|
|
1003
1003
|
}
|
|
1004
|
-
const
|
|
1004
|
+
const Vo = (e) => JSON.stringify([e.search, e.conditions, e.sort, e.page, e.pageSize, e.grouping ?? [], Zt(e.folded) ?? []]), Io = (e) => JSON.stringify(
|
|
1005
1005
|
{ ...e, hidden: Zt(e.hidden), folded: Zt(e.folded), branches: Zt(e.branches) },
|
|
1006
1006
|
(t, n) => n && typeof n == "object" && !Array.isArray(n) ? Object.fromEntries(Object.entries(n).sort(([o], [r]) => o < r ? -1 : o > r ? 1 : 0)) : n
|
|
1007
1007
|
), Zt = (e) => e === void 0 ? void 0 : [...e].sort();
|
|
@@ -1019,52 +1019,52 @@ function uc(e, t) {
|
|
|
1019
1019
|
};
|
|
1020
1020
|
}
|
|
1021
1021
|
const fc = (e, t) => {
|
|
1022
|
-
const n =
|
|
1022
|
+
const n = Ie(e, t);
|
|
1023
1023
|
return n.hours + n.minutes + n.seconds + (e.getTime() % 1e3 + 1e3) % 1e3 === 0;
|
|
1024
1024
|
}, oo = (e, t) => {
|
|
1025
1025
|
for (const n of e) if (n instanceof Date && !fc(n, t)) return !1;
|
|
1026
1026
|
return !0;
|
|
1027
1027
|
}, hc = (e, t) => {
|
|
1028
|
-
const n =
|
|
1028
|
+
const n = Ie(e, t);
|
|
1029
1029
|
return `${String(n.year).padStart(4, "0")}-${String(n.month + 1).padStart(2, "0")}-${String(n.day).padStart(2, "0")}`;
|
|
1030
1030
|
};
|
|
1031
1031
|
function qu(e) {
|
|
1032
1032
|
return e;
|
|
1033
1033
|
}
|
|
1034
|
-
const
|
|
1034
|
+
const Bt = /* @__PURE__ */ new WeakMap();
|
|
1035
1035
|
function ro(e, t) {
|
|
1036
|
-
return
|
|
1036
|
+
return Bt.set(e, t), e;
|
|
1037
1037
|
}
|
|
1038
|
-
const pc = (e) =>
|
|
1038
|
+
const pc = (e) => Bt.has(e);
|
|
1039
1039
|
function nt(e) {
|
|
1040
|
-
return e === "list" ?
|
|
1040
|
+
return e === "list" ? Dr : e === "range" ? Vr : e === "text" ? Ec : typeof e == "object" && e !== null ? e : void 0;
|
|
1041
1041
|
}
|
|
1042
|
-
function
|
|
1042
|
+
function zr(e, t) {
|
|
1043
1043
|
if (t == null) return "empty";
|
|
1044
|
-
const n =
|
|
1044
|
+
const n = Bt.get(e);
|
|
1045
1045
|
return n ? n.isCondition(t) ? n.isEmpty(t) ? "empty" : "effective" : "foreign" : "effective";
|
|
1046
1046
|
}
|
|
1047
|
-
const gc = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z$/,
|
|
1047
|
+
const gc = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z$/, Ko = (e) => {
|
|
1048
1048
|
if (typeof e != "string" || !gc.test(e)) return e;
|
|
1049
1049
|
const t = new Date(e);
|
|
1050
1050
|
return Number.isNaN(t.getTime()) ? e : t;
|
|
1051
1051
|
};
|
|
1052
1052
|
function mc(e, t, n) {
|
|
1053
|
-
return e ===
|
|
1053
|
+
return e === Vr && typeof t == "object" && t !== null && !Array.isArray(t) ? Object.fromEntries(Object.entries(t).map(([o, r]) => [o, Ko(r)])) : e === Dr && n === "date" && Array.isArray(t) ? t.map(Ko) : t;
|
|
1054
1054
|
}
|
|
1055
1055
|
function wc(e, t, n, o) {
|
|
1056
|
-
const r =
|
|
1056
|
+
const r = Bt.get(e);
|
|
1057
1057
|
return ge(t) ? r?.absentMatches(n, o) ?? !1 : r?.matchesIn ? r.matchesIn(t, n, o) : e.matches(t, n);
|
|
1058
1058
|
}
|
|
1059
1059
|
function bc(e, t, n) {
|
|
1060
|
-
const o =
|
|
1060
|
+
const o = Bt.get(e);
|
|
1061
1061
|
return o ? o.describeIn(t, n) : e.describe(t);
|
|
1062
1062
|
}
|
|
1063
|
-
const
|
|
1064
|
-
const o =
|
|
1063
|
+
const Go = (e) => e instanceof Date ? e.getTime() : typeof e == "number" ? e : void 0, Br = (e) => (t, n) => {
|
|
1064
|
+
const o = Go(t.value), r = Go(n.value);
|
|
1065
1065
|
return o !== void 0 && r !== void 0 ? o - r : e.compareText(t.text, n.text);
|
|
1066
1066
|
};
|
|
1067
|
-
function
|
|
1067
|
+
function Fn(e, t, n) {
|
|
1068
1068
|
const o = /* @__PURE__ */ new Map();
|
|
1069
1069
|
let r = !1;
|
|
1070
1070
|
for (const i of e) {
|
|
@@ -1076,14 +1076,14 @@ function $n(e, t, n) {
|
|
|
1076
1076
|
const l = a instanceof Date ? `date:${a.getTime()}` : typeof a == "object" || typeof a == "function" ? a : `${typeof a}:${String(a)}`;
|
|
1077
1077
|
o.has(l) || o.set(l, a);
|
|
1078
1078
|
}
|
|
1079
|
-
return { values: [...o.values()].map((i) => ({ value: i, text: String(i) })).sort(
|
|
1079
|
+
return { values: [...o.values()].map((i) => ({ value: i, text: String(i) })).sort(Br(n)).map(({ value: i }) => i), absent: r };
|
|
1080
1080
|
}
|
|
1081
|
-
const
|
|
1082
|
-
function
|
|
1083
|
-
let t =
|
|
1084
|
-
return t || (t = new Set(e.map(Xe)),
|
|
1081
|
+
const jo = /* @__PURE__ */ new WeakMap();
|
|
1082
|
+
function Pn(e) {
|
|
1083
|
+
let t = jo.get(e);
|
|
1084
|
+
return t || (t = new Set(e.map(Xe)), jo.set(e, t)), t;
|
|
1085
1085
|
}
|
|
1086
|
-
const
|
|
1086
|
+
const zn = (e, t) => ge(e) ? t.wording.cellAbsentValue : ft(e, t.format, t.formats, t.wording) ?? String(e);
|
|
1087
1087
|
function vc({
|
|
1088
1088
|
condition: e,
|
|
1089
1089
|
setCondition: t,
|
|
@@ -1092,11 +1092,11 @@ function vc({
|
|
|
1092
1092
|
format: r
|
|
1093
1093
|
}) {
|
|
1094
1094
|
const s = We(), i = we(), a = oe(() => e ?? [], [e]), l = oe(() => {
|
|
1095
|
-
const d = { formats: s, wording: i, format: r }, h = n.map((g) => ({ key: Xe(g), text:
|
|
1096
|
-
h.sort(
|
|
1097
|
-
const b = new Set(h.map((g) => g.key)), m = a.filter((g) => !ge(g) && !b.has(Xe(g))).map((g) => ({ key: Xe(g), text:
|
|
1095
|
+
const d = { formats: s, wording: i, format: r }, h = n.map((g) => ({ key: Xe(g), text: zn(g, d), value: g }));
|
|
1096
|
+
h.sort(Br(s));
|
|
1097
|
+
const b = new Set(h.map((g) => g.key)), m = a.filter((g) => !ge(g) && !b.has(Xe(g))).map((g) => ({ key: Xe(g), text: zn(g, d), value: g })), p = o || a.some(ge) ? [{ key: eo, text: i.cellAbsentValue, value: null }] : [];
|
|
1098
1098
|
return [...h, ...m, ...p];
|
|
1099
|
-
}, [n, a, o, r, s, i]), c =
|
|
1099
|
+
}, [n, a, o, r, s, i]), c = Pn(a), u = (d) => {
|
|
1100
1100
|
const h = c.has(d.key) ? a.filter((b) => Xe(b) !== d.key) : [...a, d.value];
|
|
1101
1101
|
t(h.length > 0 ? h : null);
|
|
1102
1102
|
};
|
|
@@ -1110,29 +1110,29 @@ function vc({
|
|
|
1110
1110
|
d.key
|
|
1111
1111
|
)) });
|
|
1112
1112
|
}
|
|
1113
|
-
const
|
|
1113
|
+
const Dr = /* @__PURE__ */ ro(
|
|
1114
1114
|
{
|
|
1115
|
-
matches: (e, t) =>
|
|
1115
|
+
matches: (e, t) => Pn(t).has(Xe(e)),
|
|
1116
1116
|
Input: vc,
|
|
1117
1117
|
describe: (e) => e.map((t) => ge(t) ? "–" : String(t)).join(", ")
|
|
1118
1118
|
},
|
|
1119
1119
|
{
|
|
1120
1120
|
isCondition: (e) => Array.isArray(e),
|
|
1121
1121
|
isEmpty: (e) => e.length === 0,
|
|
1122
|
-
absentMatches: (e) =>
|
|
1122
|
+
absentMatches: (e) => Pn(e).has(eo),
|
|
1123
1123
|
/* From three values on the first two and how many more: a condition is one
|
|
1124
1124
|
line in the table toolbar, not a list. */
|
|
1125
1125
|
describeIn: (e, t) => {
|
|
1126
|
-
const n = e.map((r) =>
|
|
1126
|
+
const n = e.map((r) => zn(r, t));
|
|
1127
1127
|
if (n.length <= 2) return n.join(", ");
|
|
1128
1128
|
const o = n.length - 2;
|
|
1129
1129
|
return `${n.slice(0, 2).join(", ")} ${t.wording.moreValues(o, t.formats.count(o))}`;
|
|
1130
1130
|
}
|
|
1131
1131
|
}
|
|
1132
1132
|
), yc = (e, t) => pr(e, t).getTime(), Sc = (e, t) => {
|
|
1133
|
-
const { year: n, month: o, day: r } =
|
|
1133
|
+
const { year: n, month: o, day: r } = Ie(e, t);
|
|
1134
1134
|
return Ut({ year: n, month: o, day: r + 1 }, t).getTime();
|
|
1135
|
-
},
|
|
1135
|
+
}, Lt = (e) => typeof e == "number" && Number.isFinite(e), Ze = (e) => e instanceof Date && !Number.isNaN(e.getTime()), _c = (e, t) => Ze(e) ? yc(e, t) : Lt(e) ? e : void 0, kc = (e, t) => Ze(e) ? { value: Sc(e, t), open: !0 } : Lt(e) ? { value: e, open: !1 } : void 0;
|
|
1136
1136
|
function Ho(e, t, n) {
|
|
1137
1137
|
const o = Ze(e) ? e.getTime() : typeof e == "number" && !Number.isNaN(e) ? e : void 0;
|
|
1138
1138
|
if (o === void 0) return !1;
|
|
@@ -1141,7 +1141,7 @@ function Ho(e, t, n) {
|
|
|
1141
1141
|
}
|
|
1142
1142
|
const Ht = (e, t) => Ze(e) ? t.formats.date(e) : ft(e, t.format, t.formats, t.wording) ?? String(e);
|
|
1143
1143
|
function Cc({ condition: e, setCondition: t, format: n }) {
|
|
1144
|
-
const o = we(), r = !(typeof n == "object" && n.useGrouping === !1), [s, i] =
|
|
1144
|
+
const o = we(), r = !(typeof n == "object" && n.useGrouping === !1), [s, i] = G(null), a = s !== null, l = s ? s.from : Lt(e?.from) ? e.from : null, c = s ? s.to : Lt(e?.to) ? e.to : null, u = (d, h) => {
|
|
1145
1145
|
const b = { from: l, to: c, [d]: h };
|
|
1146
1146
|
if (b.from !== null && b.to !== null && b.from > b.to) {
|
|
1147
1147
|
i(b);
|
|
@@ -1156,7 +1156,7 @@ function Cc({ condition: e, setCondition: t, format: n }) {
|
|
|
1156
1156
|
...b.to !== null ? { to: b.to } : {}
|
|
1157
1157
|
});
|
|
1158
1158
|
};
|
|
1159
|
-
return /* @__PURE__ */
|
|
1159
|
+
return /* @__PURE__ */ M("div", { className: w.rangeFields, children: [
|
|
1160
1160
|
/* @__PURE__ */ f(Cn, { label: o.filterFrom, children: /* @__PURE__ */ f(xn, { size: "sm", grouping: r, value: l, invalid: a, onValueChange: (d) => u("from", d) }) }),
|
|
1161
1161
|
/* @__PURE__ */ f(Cn, { label: o.filterTo, error: a ? o.rangeInvalid : void 0, children: /* @__PURE__ */ f(xn, { size: "sm", grouping: r, value: c, onValueChange: (d) => u("to", d) }) })
|
|
1162
1162
|
] });
|
|
@@ -1176,7 +1176,7 @@ function xc({ condition: e, setCondition: t }) {
|
|
|
1176
1176
|
function Ac(e) {
|
|
1177
1177
|
return e.kind === "date" ? /* @__PURE__ */ f(xc, { ...e }) : /* @__PURE__ */ f(Cc, { ...e });
|
|
1178
1178
|
}
|
|
1179
|
-
const
|
|
1179
|
+
const Vr = /* @__PURE__ */ ro(
|
|
1180
1180
|
{
|
|
1181
1181
|
matches: (e, t) => Ho(e, t, void 0),
|
|
1182
1182
|
Input: Ac,
|
|
@@ -1184,7 +1184,7 @@ const Dr = /* @__PURE__ */ ro(
|
|
|
1184
1184
|
},
|
|
1185
1185
|
{
|
|
1186
1186
|
isCondition: (e) => typeof e != "object" || e === null || Array.isArray(e) || e instanceof Date ? !1 : Object.entries(e).every(
|
|
1187
|
-
([n, o]) => (n === "from" || n === "to") && (o === void 0 ||
|
|
1187
|
+
([n, o]) => (n === "from" || n === "to") && (o === void 0 || Lt(o) || Ze(o))
|
|
1188
1188
|
),
|
|
1189
1189
|
isEmpty: (e) => e.from === void 0 && e.to === void 0,
|
|
1190
1190
|
absentMatches: () => !1,
|
|
@@ -1192,7 +1192,7 @@ const Dr = /* @__PURE__ */ ro(
|
|
|
1192
1192
|
describeIn: (e, t) => {
|
|
1193
1193
|
const { from: n, to: o } = e;
|
|
1194
1194
|
if (n !== void 0 && o !== void 0) {
|
|
1195
|
-
const r = t.formats.timeZone, s = Ze(n) && Ze(o) &&
|
|
1195
|
+
const r = t.formats.timeZone, s = Ze(n) && Ze(o) && Ie(n, r).year === Ie(o, r).year;
|
|
1196
1196
|
return t.wording.rangeFromTo(
|
|
1197
1197
|
s ? t.formats.dateShort(n) : Ht(n, t),
|
|
1198
1198
|
Ht(o, t)
|
|
@@ -1208,7 +1208,7 @@ const Dr = /* @__PURE__ */ ro(
|
|
|
1208
1208
|
endsWith: { label: (e) => e.textEndsWith, test: (e, t) => e.endsWith(t) },
|
|
1209
1209
|
equals: { label: (e) => e.textEquals, test: (e, t) => e === t },
|
|
1210
1210
|
isEmpty: { label: (e) => e.textIsEmpty, test: (e) => e === "" }
|
|
1211
|
-
},
|
|
1211
|
+
}, Ir = Object.keys(sn), Tc = (e) => typeof e == "object" && e !== null && Ir.includes(e.operator) && (e.value === void 0 || typeof e.value == "string"), Kr = (e) => e.operator === "isEmpty" || (e.value ?? "") !== "", so = (e) => e.terms.filter(Kr);
|
|
1212
1212
|
function Nc(e, t, n) {
|
|
1213
1213
|
return sn[t.operator].test(e.toLocaleLowerCase(n), (t.value ?? "").toLocaleLowerCase(n));
|
|
1214
1214
|
}
|
|
@@ -1216,8 +1216,8 @@ function bn(e, t, n) {
|
|
|
1216
1216
|
const o = ge(e) ? "" : String(e), r = so(t).map((s) => Nc(o, s, n));
|
|
1217
1217
|
return t.join === "or" ? r.some(Boolean) : r.every(Boolean);
|
|
1218
1218
|
}
|
|
1219
|
-
function
|
|
1220
|
-
const n = e.filter(
|
|
1219
|
+
function Bn(e, t) {
|
|
1220
|
+
const n = e.filter(Kr).map((o) => o.operator === "isEmpty" ? { operator: o.operator } : o);
|
|
1221
1221
|
return n.length === 0 ? null : n.length === 1 ? { terms: [n[0]] } : { join: t, terms: [n[0], n[1]] };
|
|
1222
1222
|
}
|
|
1223
1223
|
function Wo(e, t) {
|
|
@@ -1226,25 +1226,25 @@ function Wo(e, t) {
|
|
|
1226
1226
|
return n.operator === "isEmpty" ? o : t.textTerm(o, n.value ?? "");
|
|
1227
1227
|
}).join(` ${e.join === "or" ? t.textOr : t.textAnd} `);
|
|
1228
1228
|
}
|
|
1229
|
-
const qo = { operator: "contains", value: "" },
|
|
1229
|
+
const qo = { operator: "contains", value: "" }, Dn = (e) => ({
|
|
1230
1230
|
terms: [e?.terms[0] ?? qo, e?.terms[1] ?? qo],
|
|
1231
1231
|
join: e?.join ?? "and"
|
|
1232
1232
|
}), Uo = (e) => {
|
|
1233
|
-
const { terms: t, join: n } =
|
|
1234
|
-
return JSON.stringify(
|
|
1233
|
+
const { terms: t, join: n } = Dn(e);
|
|
1234
|
+
return JSON.stringify(Bn(t, n));
|
|
1235
1235
|
};
|
|
1236
1236
|
function Rc({ condition: e, setCondition: t }) {
|
|
1237
|
-
const n = we(), [o, r] =
|
|
1237
|
+
const n = we(), [o, r] = G(() => Dn(e));
|
|
1238
1238
|
let s = o;
|
|
1239
|
-
Uo({ join: o.join, terms: o.terms }) !== Uo(e) && (s =
|
|
1239
|
+
Uo({ join: o.join, terms: o.terms }) !== Uo(e) && (s = Dn(e), r(s));
|
|
1240
1240
|
const i = (c, u) => {
|
|
1241
1241
|
const d = [c === 0 ? u : s.terms[0], c === 1 ? u : s.terms[1]];
|
|
1242
|
-
r({ ...s, terms: d }), t(
|
|
1242
|
+
r({ ...s, terms: d }), t(Bn(d, s.join));
|
|
1243
1243
|
}, a = (c) => {
|
|
1244
|
-
r({ ...s, join: c }), t(
|
|
1244
|
+
r({ ...s, join: c }), t(Bn(s.terms, c));
|
|
1245
1245
|
}, l = (c) => {
|
|
1246
1246
|
const u = s.terms[c];
|
|
1247
|
-
return /* @__PURE__ */
|
|
1247
|
+
return /* @__PURE__ */ M("div", { className: w.textTerm, role: "group", "aria-label": n.filterTerm(c + 1), children: [
|
|
1248
1248
|
/* @__PURE__ */ f(
|
|
1249
1249
|
Yn,
|
|
1250
1250
|
{
|
|
@@ -1252,13 +1252,13 @@ function Rc({ condition: e, setCondition: t }) {
|
|
|
1252
1252
|
"aria-label": n.filterOperator,
|
|
1253
1253
|
value: u.operator,
|
|
1254
1254
|
onChange: (d) => i(c, { ...u, operator: d.target.value }),
|
|
1255
|
-
children:
|
|
1255
|
+
children: Ir.map((d) => /* @__PURE__ */ f("option", { value: d, children: sn[d].label(n) }, d))
|
|
1256
1256
|
}
|
|
1257
1257
|
),
|
|
1258
1258
|
u.operator !== "isEmpty" && /* @__PURE__ */ f(Jn, { size: "sm", "aria-label": n.filterValue, value: u.value ?? "", onChange: (d) => i(c, { ...u, value: d.target.value }) })
|
|
1259
1259
|
] });
|
|
1260
1260
|
};
|
|
1261
|
-
return /* @__PURE__ */
|
|
1261
|
+
return /* @__PURE__ */ M("div", { className: w.textFields, children: [
|
|
1262
1262
|
l(0),
|
|
1263
1263
|
/* @__PURE__ */ f(
|
|
1264
1264
|
Hs,
|
|
@@ -1276,7 +1276,7 @@ function Rc({ condition: e, setCondition: t }) {
|
|
|
1276
1276
|
l(1)
|
|
1277
1277
|
] });
|
|
1278
1278
|
}
|
|
1279
|
-
const
|
|
1279
|
+
const Ec = /* @__PURE__ */ ro(
|
|
1280
1280
|
{
|
|
1281
1281
|
matches: (e, t) => bn(e, t, void 0),
|
|
1282
1282
|
Input: Rc,
|
|
@@ -1348,13 +1348,13 @@ const Yo = (e) => JSON.stringify([
|
|
|
1348
1348
|
/* Whether a column edits, and how - not its editor or its check, which
|
|
1349
1349
|
are new functions on every render and are read when an edit starts. */
|
|
1350
1350
|
typeof e.edit == "function" ? "ƒ" : e.edit
|
|
1351
|
-
]),
|
|
1351
|
+
]), Gr = (e, t) => e?.[t], Jo = (e, t) => {
|
|
1352
1352
|
const n = {
|
|
1353
1353
|
key: e,
|
|
1354
1354
|
spec: t,
|
|
1355
1355
|
read: (o) => {
|
|
1356
1356
|
const r = n.spec.value;
|
|
1357
|
-
return typeof r == "string" ?
|
|
1357
|
+
return typeof r == "string" ? Gr(o, r) : r(o);
|
|
1358
1358
|
}
|
|
1359
1359
|
};
|
|
1360
1360
|
return n;
|
|
@@ -1367,12 +1367,12 @@ function at(e, t) {
|
|
|
1367
1367
|
}
|
|
1368
1368
|
function Xo(e, t, n) {
|
|
1369
1369
|
if (e.id !== t.id) return t;
|
|
1370
|
-
const o = `Column "${t.id}"`, r = (l) => typeof e.value == "string" ?
|
|
1370
|
+
const o = `Column "${t.id}"`, r = (l) => typeof e.value == "string" ? Gr(l, e.value) : e.value(l);
|
|
1371
1371
|
at(e.value, t.value) && Xt(o, e.value, t.value, n), at(e.ownSortValue, t.ownSortValue) && Xt(o, e.ownSortValue, t.ownSortValue, n, r), at(e.ownGroupValue, t.ownGroupValue) && Xt(o, e.ownGroupValue, t.ownGroupValue, n, r);
|
|
1372
1372
|
const s = at(e.value, t.value) ? e.value : t.value, i = at(e.ownSortValue, t.ownSortValue) ? e.ownSortValue : t.ownSortValue, a = at(e.ownGroupValue, t.ownGroupValue) ? e.ownGroupValue : t.ownGroupValue;
|
|
1373
1373
|
return s === t.value && i === t.ownSortValue && a === t.ownGroupValue ? t : { ...t, value: s, ownSortValue: i, ownGroupValue: a };
|
|
1374
1374
|
}
|
|
1375
|
-
class
|
|
1375
|
+
class Mc {
|
|
1376
1376
|
columns = new vn("data-umriss-column");
|
|
1377
1377
|
actions = new vn("data-umriss-action");
|
|
1378
1378
|
/** The group keys: values to group by that are no column. */
|
|
@@ -1583,7 +1583,7 @@ class Ec {
|
|
|
1583
1583
|
return d ? d(u) : h ? ql(h, o)(u) : u;
|
|
1584
1584
|
},
|
|
1585
1585
|
/* A value of one's own is a name; its groups stand by what they hold. */
|
|
1586
|
-
order: l.spec.ownGroupValue ? (c) =>
|
|
1586
|
+
order: l.spec.ownGroupValue ? (c) => En(l.read(c), l.spec.ownSortValue) : void 0
|
|
1587
1587
|
})), a = this.orderedColumns().filter((l) => l.spec.aggregate !== void 0).map(
|
|
1588
1588
|
(l) => ({
|
|
1589
1589
|
id: l.spec.id,
|
|
@@ -1610,7 +1610,7 @@ class Ec {
|
|
|
1610
1610
|
const o = this.kinds.get(t.key);
|
|
1611
1611
|
if (o && o.rows === n && o.value === t.spec.value) return o.kind;
|
|
1612
1612
|
const r = _r(n, t.read);
|
|
1613
|
-
return this.kinds.set(t.key, { rows: n, value: t.spec.value, kind: r }),
|
|
1613
|
+
return this.kinds.set(t.key, { rows: n, value: t.spec.value, kind: r }), Me && (this.warnFormat(t, r), this.warnMixed(t, n, r)), r;
|
|
1614
1614
|
}
|
|
1615
1615
|
/** A numeric column or aggregate that meets a string in any row: the table does not coerce - it sorts the
|
|
1616
1616
|
string apart from the numbers and leaves it out of a sum - so the data's shape is the application's. */
|
|
@@ -1657,7 +1657,7 @@ class Ec {
|
|
|
1657
1657
|
if (this.modelCache?.key === s && this.modelCache.rows === t && this.modelCache.formats === n && this.modelCache.wording === o)
|
|
1658
1658
|
return this.modelCache.columns;
|
|
1659
1659
|
const i = r.map((a) => {
|
|
1660
|
-
const { spec: l } = a, c = this.kindOf(a, t), u = this.isSortable(a, t), d = l.searchable ?? c === "text", h = (g) =>
|
|
1660
|
+
const { spec: l } = a, c = this.kindOf(a, t), u = this.isSortable(a, t), d = l.searchable ?? c === "text", h = (g) => En(a.read(g), l.ownSortValue), b = this.shownFormat(a, t, n.timeZone), m = /* @__PURE__ */ new WeakMap(), p = d && c !== "text" && c !== "other" && c !== "empty" ? (g) => {
|
|
1661
1661
|
const v = typeof g == "object" && g !== null;
|
|
1662
1662
|
if (v && m.has(g)) return m.get(g);
|
|
1663
1663
|
const y = a.read(g), k = ge(y) ? void 0 : ft(y, b, n, o) ?? void 0;
|
|
@@ -1708,7 +1708,7 @@ class Ec {
|
|
|
1708
1708
|
grouping: this.groupingFor(t),
|
|
1709
1709
|
server: o.server,
|
|
1710
1710
|
tree: t.tree
|
|
1711
|
-
}, s =
|
|
1711
|
+
}, s = Lr(t.admitted, n, r), i = o.virtual ? Pr(s, o.virtual.from, o.virtual.to) : s;
|
|
1712
1712
|
return this.projectionCache = { hook: t, columns: n, projection: i }, i;
|
|
1713
1713
|
}
|
|
1714
1714
|
/* --- The hook's snapshot ---------------------------------------------------------- */
|
|
@@ -1883,28 +1883,28 @@ class Ec {
|
|
|
1883
1883
|
this.actions.entries.delete(t) && this.structure++;
|
|
1884
1884
|
}
|
|
1885
1885
|
}
|
|
1886
|
-
const
|
|
1887
|
-
|
|
1888
|
-
},
|
|
1889
|
-
`,
|
|
1890
|
-
function
|
|
1886
|
+
const jr = /* @__PURE__ */ new WeakMap(), Oc = (e, t) => {
|
|
1887
|
+
jr.set(e, t);
|
|
1888
|
+
}, Lc = (e) => typeof e == "function" || typeof e == "object" && e !== null ? jr.get(e) : void 0, Hr = { separator: ",", decimal: ".", yes: "yes", no: "no" }, $c = `\r
|
|
1889
|
+
`, Fc = "\uFEFF", Wr = (e, t) => typeof e == "number" ? Pc(e).replace(".", t.decimal) : typeof e == "boolean" ? e ? t.yes : t.no : e;
|
|
1890
|
+
function Pc(e) {
|
|
1891
1891
|
if (!Number.isFinite(e)) return "";
|
|
1892
1892
|
const [t = "", n] = String(e).split("e");
|
|
1893
1893
|
if (n === void 0) return t;
|
|
1894
1894
|
const o = t.startsWith("-") ? "-" : "", [r = "", s = ""] = t.replace("-", "").split("."), i = r + s, a = r.length + Number(n), l = a <= 0 ? `0.${"0".repeat(-a)}${i}` : a >= i.length ? i + "0".repeat(a - i.length) : `${i.slice(0, a)}.${i.slice(a)}`;
|
|
1895
1895
|
return o + l;
|
|
1896
1896
|
}
|
|
1897
|
-
const qr = (e, t) => e.includes(t) || /["\r\n]/.test(e) ? `"${e.replace(/"/g, '""')}"` : e, Ur = (e, t) => t && /^\s*[=+\-@\t\r]/.test(e) ? `'${e}` : e,
|
|
1897
|
+
const qr = (e, t) => e.includes(t) || /["\r\n]/.test(e) ? `"${e.replace(/"/g, '""')}"` : e, Ur = (e, t) => t && /^\s*[=+\-@\t\r]/.test(e) ? `'${e}` : e, zc = (e, t, n, o) => {
|
|
1898
1898
|
const r = t.value?.(e);
|
|
1899
1899
|
return r == null ? "" : qr(typeof r == "string" ? Ur(r, o) : Wr(r, n), n.separator);
|
|
1900
1900
|
}, Yr = (e, t, n, o) => [
|
|
1901
1901
|
t.map((r) => qr(Ur(r.label ?? r.id, o), n.separator)).join(n.separator),
|
|
1902
|
-
...e.map((r) => t.map((s) =>
|
|
1902
|
+
...e.map((r) => t.map((s) => zc(r, s, n, o)).join(n.separator))
|
|
1903
1903
|
];
|
|
1904
|
-
function zc(e, t, n = Hr) {
|
|
1905
|
-
return $c + Yr(e, t, n, !0).join(Lc);
|
|
1906
|
-
}
|
|
1907
1904
|
function Bc(e, t, n = Hr) {
|
|
1905
|
+
return Fc + Yr(e, t, n, !0).join($c);
|
|
1906
|
+
}
|
|
1907
|
+
function Dc(e, t, n = Hr) {
|
|
1908
1908
|
return Yr(e, t, { ...n, separator: " " }, !1).join(`
|
|
1909
1909
|
`);
|
|
1910
1910
|
}
|
|
@@ -1931,8 +1931,8 @@ function io(e, t) {
|
|
|
1931
1931
|
}
|
|
1932
1932
|
function Qr(e, t) {
|
|
1933
1933
|
return Xr(e).filter((n) => {
|
|
1934
|
-
const o = !!n.spec.ownExportValue || n.spec.format !== void 0 || t.some((r) =>
|
|
1935
|
-
return
|
|
1934
|
+
const o = !!n.spec.ownExportValue || n.spec.format !== void 0 || t.some((r) => Pt(n.read(r)) !== void 0);
|
|
1935
|
+
return Me && !o && e.kindOf(n, t) === "other" && te(`export-other:${n.spec.id}`, `The column "${n.spec.id}" holds values the export cannot write (objects), so it is left out of the file and the copy. Give it \`exportValue\` to say what it writes.`), Me && o && !n.spec.label && te(`export-label:${n.spec.id}`, `The column "${n.spec.id}" has no label, so its export header is the id. Give it a \`label\`.`), o;
|
|
1936
1936
|
});
|
|
1937
1937
|
}
|
|
1938
1938
|
const ao = (e, t) => {
|
|
@@ -1941,18 +1941,18 @@ const ao = (e, t) => {
|
|
|
1941
1941
|
}, lo = (e, t, n, o) => {
|
|
1942
1942
|
const r = !n && (t ?? oo(e, o));
|
|
1943
1943
|
return (s) => s instanceof Date ? r ? hc(s, o) : s.toISOString() : s;
|
|
1944
|
-
},
|
|
1944
|
+
}, Vc = (e, t, n) => {
|
|
1945
1945
|
const o = lo([], ao(e, t), !!t.spec.ownExportValue, n);
|
|
1946
1946
|
return {
|
|
1947
1947
|
id: t.spec.id,
|
|
1948
1948
|
label: Jr(t),
|
|
1949
|
-
value: (r) => o(
|
|
1949
|
+
value: (r) => o(Pt(t.read(r), t.spec.ownExportValue))
|
|
1950
1950
|
};
|
|
1951
1951
|
}, es = (e, t) => {
|
|
1952
1952
|
const { groups: n } = e.projection(), o = (r) => r.flatMap((s) => s.groups.length ? o(s.groups) : s.rows);
|
|
1953
1953
|
return n ? o(n) : t;
|
|
1954
1954
|
};
|
|
1955
|
-
function
|
|
1955
|
+
function Ic(e, t, n) {
|
|
1956
1956
|
const o = e.hook;
|
|
1957
1957
|
if (!o) return { columns: [], rows: [] };
|
|
1958
1958
|
const r = Qr(e, n ?? o.rows), { widths: s } = o.publicSnapshot, i = r.map((u) => ({
|
|
@@ -1960,7 +1960,7 @@ function Vc(e, t, n) {
|
|
|
1960
1960
|
width: s[u.spec.id],
|
|
1961
1961
|
...u.spec.ownExportValue && { own: !0 },
|
|
1962
1962
|
day: ao(e, u)
|
|
1963
|
-
})), a = (u) => r.map((d) =>
|
|
1963
|
+
})), a = (u) => r.map((d) => Pt(d.read(u), d.spec.ownExportValue));
|
|
1964
1964
|
if (n) return { columns: i, rows: n.map(a) };
|
|
1965
1965
|
const { exported: l, filtered: c } = e.projection();
|
|
1966
1966
|
return l ? {
|
|
@@ -1971,7 +1971,7 @@ function Vc(e, t, n) {
|
|
|
1971
1971
|
const ts = {
|
|
1972
1972
|
extension: "csv",
|
|
1973
1973
|
mime: "text/csv;charset=utf-8",
|
|
1974
|
-
write: (e, { formats: t, wording: n }) =>
|
|
1974
|
+
write: (e, { formats: t, wording: n }) => Bc(
|
|
1975
1975
|
e.rows,
|
|
1976
1976
|
e.columns.map((o, r) => {
|
|
1977
1977
|
const s = lo(e.rows.map((i) => i[r]), o.day, !!o.own, t.timeZone);
|
|
@@ -1989,25 +1989,25 @@ function ns(e) {
|
|
|
1989
1989
|
function os(e, t, n) {
|
|
1990
1990
|
const o = e.hook, r = ns(e);
|
|
1991
1991
|
if (!o || r.length === 0) return "";
|
|
1992
|
-
const s = Qr(e, o.rows).map((a) =>
|
|
1992
|
+
const s = Qr(e, o.rows).map((a) => Vc(e, a, t.timeZone)), { exported: i } = e.projection();
|
|
1993
1993
|
if (i) {
|
|
1994
1994
|
const a = new Map(i.map((l) => [l.node, l.level + 1]));
|
|
1995
1995
|
s.unshift({ id: "level", label: n.levelColumn, value: (l) => a.get(l) });
|
|
1996
1996
|
}
|
|
1997
|
-
return
|
|
1997
|
+
return Dc(r, s, io(t, n));
|
|
1998
1998
|
}
|
|
1999
|
-
function
|
|
1999
|
+
function Kc(e, t, n, o, r) {
|
|
2000
2000
|
return rs(e, t, t.read(n), o, r);
|
|
2001
2001
|
}
|
|
2002
2002
|
function rs(e, t, n, o, r) {
|
|
2003
|
-
const i = lo([], ao(e, t), !!t.spec.ownExportValue, o.timeZone)(
|
|
2003
|
+
const i = lo([], ao(e, t), !!t.spec.ownExportValue, o.timeZone)(Pt(n, t.spec.ownExportValue));
|
|
2004
2004
|
return i === void 0 ? "" : Wr(i, io(o, r));
|
|
2005
2005
|
}
|
|
2006
|
-
function
|
|
2006
|
+
function Gc(e, t) {
|
|
2007
2007
|
const n = e.replace(/[\u0000-\u001f\u007f-\u009f\\/:*?"<>|]/g, "_").replace(/^[.\s]+|[.\s]+$/g, ""), o = n.split(".")[0].toUpperCase();
|
|
2008
2008
|
return n === "" || /^(CON|PRN|AUX|NUL|COM\d|LPT\d)$/.test(o) ? t : n;
|
|
2009
2009
|
}
|
|
2010
|
-
const
|
|
2010
|
+
const jc = (e) => e.controls + (e.span ? 1 : 0) + e.aggregates.length + (e.actions ? 1 : 0);
|
|
2011
2011
|
function ss(e) {
|
|
2012
2012
|
const { controls: t, span: n, aggregates: o, actions: r, blocks: s } = e, i = o.length, a = o.indexOf(!0), l = s.end > 0 ? s.end - (r ? 1 : 0) : 0, c = Math.max(n || i === 0 ? 0 : 1, Math.min(a === -1 ? i : a, i - l)), u = t + (n ? 1 : 0), d = s.start > 0 ? s.start - u : 0;
|
|
2013
2013
|
return {
|
|
@@ -2017,7 +2017,7 @@ function ss(e) {
|
|
|
2017
2017
|
};
|
|
2018
2018
|
}
|
|
2019
2019
|
function yn(e, t) {
|
|
2020
|
-
const n =
|
|
2020
|
+
const n = jc(t);
|
|
2021
2021
|
if (e === "cells") return Array.from({ length: n }, () => 1);
|
|
2022
2022
|
if (e === "whole") return [n];
|
|
2023
2023
|
const { lead: o, labelColumns: r, countColumns: s } = ss(t), i = Array.from({ length: t.controls }, () => 1), a = Array.from({ length: t.aggregates.length - o + (t.actions ? 1 : 0) }, () => 1), l = (c) => o - c > 0 ? [o - c] : [];
|
|
@@ -2090,7 +2090,7 @@ function Uc(e, t, n) {
|
|
|
2090
2090
|
const o = e.indexOf(t);
|
|
2091
2091
|
return o >= 0 ? o : Math.max(0, Math.min(e.length - 1, n));
|
|
2092
2092
|
}
|
|
2093
|
-
const
|
|
2093
|
+
const Ee = "new";
|
|
2094
2094
|
class Yc {
|
|
2095
2095
|
wish = null;
|
|
2096
2096
|
/** The cell the focus last stood in: where it went when that cell left the
|
|
@@ -2115,7 +2115,7 @@ class Yc {
|
|
|
2115
2115
|
}
|
|
2116
2116
|
}
|
|
2117
2117
|
function Jc() {
|
|
2118
|
-
const [e, t] =
|
|
2118
|
+
const [e, t] = G({ active: null, widget: !1, editing: null }), [n] = G(() => new Yc());
|
|
2119
2119
|
return { state: e, setState: t, focus: n };
|
|
2120
2120
|
}
|
|
2121
2121
|
const Qo = (e) => e?.spec.edit !== void 0;
|
|
@@ -2124,70 +2124,70 @@ function as(e, t) {
|
|
|
2124
2124
|
return Object.is(n(e), n(t));
|
|
2125
2125
|
}
|
|
2126
2126
|
function Xc(e) {
|
|
2127
|
-
const { grid: t, lines: n, ids: o, columnById: r, rowKey: s, onCellEdit: i, rowMode: a, onRowSave: l, onRowAdd: c, newRow: u } = e, { setState: d } = t, h = t.state.editing, b = (C) => C ===
|
|
2128
|
-
const
|
|
2129
|
-
return
|
|
2130
|
-
}, g = (C) => p(C) !== null && Qo(r(o[C.column] ?? "")), v = () => o.map(r).filter(Qo), y = (C,
|
|
2131
|
-
const
|
|
2132
|
-
X[
|
|
2133
|
-
...
|
|
2134
|
-
active: { line:
|
|
2135
|
-
editing: { line:
|
|
2127
|
+
const { grid: t, lines: n, ids: o, columnById: r, rowKey: s, onCellEdit: i, rowMode: a, onRowSave: l, onRowAdd: c, newRow: u } = e, { setState: d } = t, h = t.state.editing, b = (C) => C === Ee ? h?.fresh : n.find((L) => L.key === C)?.row ?? h?.source, m = () => h !== null && h.line !== Ee && !e.loading && !e.hasRow(h.line), p = (C) => {
|
|
2128
|
+
const L = n[C.line];
|
|
2129
|
+
return L?.key === Ee ? { row: L.row } : L?.row !== void 0 && L.key === ut(s(L.row)) ? { row: L.row } : null;
|
|
2130
|
+
}, g = (C) => p(C) !== null && Qo(r(o[C.column] ?? "")), v = () => o.map(r).filter(Qo), y = (C, L, E = !1) => {
|
|
2131
|
+
const D = n[C.line], $ = r(o[C.column] ?? ""), X = a ? Object.fromEntries(v().map((K) => [K.spec.id, K.read(D.row)])) : {};
|
|
2132
|
+
X[$.spec.id] = L === void 0 ? $.read(D.row) : L, t.focus.want(E ? "open" : "editor"), d((K) => ({
|
|
2133
|
+
...K,
|
|
2134
|
+
active: { line: D.key, column: $.spec.id, lineIndex: C.line, columnIndex: C.column },
|
|
2135
|
+
editing: { line: D.key, column: $.spec.id, row: a, drafts: X, errors: {}, refused: !1, source: D.row }
|
|
2136
2136
|
}));
|
|
2137
|
-
}, k = (C = {},
|
|
2137
|
+
}, k = (C = {}, L = !0) => {
|
|
2138
2138
|
if (!h) return !0;
|
|
2139
|
-
const
|
|
2140
|
-
if (
|
|
2141
|
-
return d((
|
|
2142
|
-
const
|
|
2143
|
-
for (const [
|
|
2144
|
-
const re = r(
|
|
2145
|
-
re && (
|
|
2139
|
+
const E = { ...h.drafts, ...C }, D = b(h.line);
|
|
2140
|
+
if (D === void 0)
|
|
2141
|
+
return d((z) => ({ ...z, editing: null })), !0;
|
|
2142
|
+
const $ = {};
|
|
2143
|
+
for (const [z, H] of Object.entries(E)) {
|
|
2144
|
+
const re = r(z)?.spec.validate?.(H, D);
|
|
2145
|
+
re && ($[z] = re);
|
|
2146
2146
|
}
|
|
2147
|
-
const X = Object.keys(
|
|
2147
|
+
const X = Object.keys(E).find((z) => $[z] !== void 0);
|
|
2148
2148
|
if (X !== void 0 && m())
|
|
2149
|
-
return t.focus.want("cell"), d((
|
|
2149
|
+
return t.focus.want("cell"), d((z) => ({ ...z, editing: null })), !0;
|
|
2150
2150
|
if (X !== void 0) {
|
|
2151
|
-
const
|
|
2152
|
-
return
|
|
2151
|
+
const z = h.row ? X : h.column;
|
|
2152
|
+
return L && t.focus.want("editor"), d((H) => ({
|
|
2153
2153
|
...H,
|
|
2154
|
-
active: { line: h.line, column:
|
|
2155
|
-
editing: H.editing && { ...H.editing, column:
|
|
2154
|
+
active: { line: h.line, column: z, lineIndex: Math.max(0, an(n).get(h.line) ?? -1), columnIndex: o.indexOf(z) },
|
|
2155
|
+
editing: H.editing && { ...H.editing, column: z, drafts: E, errors: $, refused: !1 }
|
|
2156
2156
|
})), !1;
|
|
2157
2157
|
}
|
|
2158
|
-
const
|
|
2159
|
-
return h.line ===
|
|
2160
|
-
}, _ = (C,
|
|
2158
|
+
const K = Object.keys(E).filter((z) => !as(E[z], r(z)?.read(D)));
|
|
2159
|
+
return h.line === Ee ? c?.({ values: E }) : h.row ? K.length > 0 && l?.({ rowKey: s(D), changes: Object.fromEntries(K.map((z) => [z, E[z]])), row: D }) : K.length > 0 && i?.({ rowKey: s(D), columnId: h.column, value: E[h.column], row: D }), L && t.focus.want("cell"), d((z) => ({ ...z, editing: null })), !0;
|
|
2160
|
+
}, _ = (C, L) => k({ [C]: L }), x = () => {
|
|
2161
2161
|
t.focus.want("cell"), d((C) => ({ ...C, editing: null }));
|
|
2162
2162
|
}, T = () => {
|
|
2163
2163
|
t.focus.want("editor"), d((C) => C.editing ? { ...C, editing: { ...C.editing, refused: !0 } } : C);
|
|
2164
2164
|
};
|
|
2165
|
-
return { rowAt: p, editable: g, startEdit: y, save: k, commit: _, discard: x, refuse: T, setDraft: (C,
|
|
2166
|
-
if (!
|
|
2167
|
-
const
|
|
2168
|
-
if (
|
|
2169
|
-
const
|
|
2170
|
-
|
|
2165
|
+
return { rowAt: p, editable: g, startEdit: y, save: k, commit: _, discard: x, refuse: T, setDraft: (C, L) => d((E) => {
|
|
2166
|
+
if (!E.editing) return E;
|
|
2167
|
+
const D = { ...E.editing.errors };
|
|
2168
|
+
if (D[C] !== void 0) {
|
|
2169
|
+
const $ = r(C)?.spec.validate?.(L, b(E.editing.line));
|
|
2170
|
+
$ ? D[C] = $ : delete D[C];
|
|
2171
2171
|
}
|
|
2172
|
-
return { ...
|
|
2172
|
+
return { ...E, editing: { ...E.editing, drafts: { ...E.editing.drafts, [C]: L }, errors: D, refused: !1 } };
|
|
2173
2173
|
}), addRow: () => {
|
|
2174
2174
|
if (h && (h.row || !k())) return T();
|
|
2175
|
-
const C = v(),
|
|
2176
|
-
if (!
|
|
2177
|
-
const
|
|
2178
|
-
t.focus.want("editor"), d((
|
|
2179
|
-
...
|
|
2175
|
+
const C = v(), L = C[0];
|
|
2176
|
+
if (!L) return;
|
|
2177
|
+
const E = u?.() ?? {};
|
|
2178
|
+
t.focus.want("editor"), d((D) => ({
|
|
2179
|
+
...D,
|
|
2180
2180
|
widget: !1,
|
|
2181
|
-
active: { line:
|
|
2181
|
+
active: { line: Ee, column: L.spec.id, lineIndex: 1, columnIndex: o.indexOf(L.spec.id) },
|
|
2182
2182
|
editing: {
|
|
2183
|
-
line:
|
|
2184
|
-
column:
|
|
2183
|
+
line: Ee,
|
|
2184
|
+
column: L.spec.id,
|
|
2185
2185
|
row: !0,
|
|
2186
2186
|
/* What `newRow` leaves out is empty - `null`, as an emptied field says it. */
|
|
2187
|
-
drafts: Object.fromEntries(C.map((
|
|
2187
|
+
drafts: Object.fromEntries(C.map(($) => [$.spec.id, $.read(E) ?? null])),
|
|
2188
2188
|
errors: {},
|
|
2189
2189
|
refused: !1,
|
|
2190
|
-
fresh:
|
|
2190
|
+
fresh: E
|
|
2191
2191
|
}
|
|
2192
2192
|
}));
|
|
2193
2193
|
}, gone: m };
|
|
@@ -2291,7 +2291,7 @@ function td(e, t, n) {
|
|
|
2291
2291
|
if (n.key === " ") {
|
|
2292
2292
|
g.line === "head" && n.preventDefault();
|
|
2293
2293
|
const _ = c(v);
|
|
2294
|
-
a && _ && g.line !==
|
|
2294
|
+
a && _ && g.line !== Ee && (n.preventDefault(), a(_.row, n.shiftKey));
|
|
2295
2295
|
return;
|
|
2296
2296
|
}
|
|
2297
2297
|
if (n.key === "Enter" || n.key === "F2") {
|
|
@@ -2305,7 +2305,7 @@ function td(e, t, n) {
|
|
|
2305
2305
|
return;
|
|
2306
2306
|
}
|
|
2307
2307
|
const x = c(v);
|
|
2308
|
-
n.key === "Enter" && l && x && g.line !==
|
|
2308
|
+
n.key === "Enter" && l && x && g.line !== Ee && (n.preventDefault(), l(x.row));
|
|
2309
2309
|
return;
|
|
2310
2310
|
}
|
|
2311
2311
|
if (n.key.length === 1 && u(v)) {
|
|
@@ -2370,7 +2370,7 @@ function sd(e) {
|
|
|
2370
2370
|
}
|
|
2371
2371
|
const St = /* @__PURE__ */ yt(null);
|
|
2372
2372
|
function id(e, t) {
|
|
2373
|
-
const n =
|
|
2373
|
+
const n = $e(St), o = n?.editing;
|
|
2374
2374
|
return o && o.line === e && t in o.drafts ? n : null;
|
|
2375
2375
|
}
|
|
2376
2376
|
const At = "data-grid-tabindex";
|
|
@@ -2393,7 +2393,7 @@ function ld({
|
|
|
2393
2393
|
hold: a,
|
|
2394
2394
|
registry: l
|
|
2395
2395
|
}) {
|
|
2396
|
-
const c =
|
|
2396
|
+
const c = j(s);
|
|
2397
2397
|
ee(() => {
|
|
2398
2398
|
c.current = s;
|
|
2399
2399
|
});
|
|
@@ -2422,11 +2422,11 @@ function ld({
|
|
|
2422
2422
|
continue;
|
|
2423
2423
|
}
|
|
2424
2424
|
const R = vt(T);
|
|
2425
|
-
for (const { cell: C, start:
|
|
2426
|
-
const
|
|
2427
|
-
|
|
2428
|
-
const
|
|
2429
|
-
for (const X of Array.from(C.querySelectorAll(ln))) ad(X,
|
|
2425
|
+
for (const { cell: C, start: L, end: E } of R) {
|
|
2426
|
+
const D = p.column >= L && p.column < E || C === R.at(-1).cell && p.column >= E;
|
|
2427
|
+
D && N === g && (y = C), D && k === null && N !== "head" && (k = C), C.tabIndex = -1, r && N !== "head" && !r({ line: v.get(N) ?? -1, column: L }) ? C.setAttribute("aria-readonly", "true") : C.removeAttribute("aria-readonly");
|
|
2428
|
+
const $ = m?.row === !0 && m.line === N || C === y && (b || m !== null && m.line === N);
|
|
2429
|
+
for (const X of Array.from(C.querySelectorAll(ln))) ad(X, !$);
|
|
2430
2430
|
}
|
|
2431
2431
|
}
|
|
2432
2432
|
const _ = y ?? k ?? d.querySelector("tr[data-grid-line] > *");
|
|
@@ -2451,7 +2451,7 @@ function cd(e, t, n) {
|
|
|
2451
2451
|
} : { line: Math.min(1, t.length - 1), column: 0 };
|
|
2452
2452
|
}
|
|
2453
2453
|
function dd({ entry: e, row: t, rowName: n, grid: o }) {
|
|
2454
|
-
const r = We(), s =
|
|
2454
|
+
const r = We(), s = j(null), { spec: i } = e, a = o.editing, l = i.id, c = a.drafts[l], u = a.errors[l] ?? null, d = (p) => o.setDraft(l, p), h = o.wording.editCell(i.label, n), b = a.errors;
|
|
2455
2455
|
ae(() => {
|
|
2456
2456
|
b[l] !== void 0 && dt(b[l], s.current);
|
|
2457
2457
|
}, [b, l]);
|
|
@@ -2473,16 +2473,16 @@ function dd({ entry: e, row: t, rowName: n, grid: o }) {
|
|
|
2473
2473
|
const p = i.format, g = i.edit === "dateTime" || (p !== void 0 ? p !== "date" : !oo(o.hook.rows.map(e.read), r.timeZone)), v = (y) => a.row ? d(y) : o.commit(l, y);
|
|
2474
2474
|
m = g ? /* @__PURE__ */ f(Us, { size: "sm", withSeconds: typeof p == "string" && p.endsWith("Seconds"), value: c instanceof Date ? c : null, onValueChange: v }) : /* @__PURE__ */ f(Ys, { size: "sm", value: c instanceof Date ? c : null, onValueChange: v });
|
|
2475
2475
|
} else if (i.edit === "select") {
|
|
2476
|
-
let p = i.editOptions ??
|
|
2476
|
+
let p = i.editOptions ?? Fn(o.hook.admitted, e.read, r).values;
|
|
2477
2477
|
Array.isArray(p) || (te(`edit-options:${l}`, `\`editOptions\` of the column "${l}" is not an array; the cell offers no choice and edits nothing.`), p = []);
|
|
2478
2478
|
const g = p.findIndex((v) => as(v, c));
|
|
2479
|
-
m = /* @__PURE__ */
|
|
2479
|
+
m = /* @__PURE__ */ M(Yn, { size: "sm", value: g < 0 ? "" : String(g), onChange: (v) => d(p[Number(v.target.value)]), children: [
|
|
2480
2480
|
g < 0 && /* @__PURE__ */ f("option", { value: "" }),
|
|
2481
2481
|
p.map((v, y) => /* @__PURE__ */ f("option", { value: y, children: v instanceof Date ? r.date(v) : String(v) }, y))
|
|
2482
2482
|
] });
|
|
2483
2483
|
} else
|
|
2484
2484
|
m = /* @__PURE__ */ f(Jn, { size: "sm", value: ge(c) ? "" : String(c), onChange: (p) => d(p.target.value) });
|
|
2485
|
-
return /* @__PURE__ */
|
|
2485
|
+
return /* @__PURE__ */ M("div", { ref: s, className: w.editor, children: [
|
|
2486
2486
|
/* @__PURE__ */ f(Cn, { className: w.editorField, label: /* @__PURE__ */ f(He, { children: h }), error: u ?? void 0, children: m }),
|
|
2487
2487
|
/* @__PURE__ */ f(nn, { open: u !== null, onOpenChange: () => {
|
|
2488
2488
|
}, anchorRef: s, role: "none", restoreFocus: !1, offset: 4, className: w.editorMessage, children: /* @__PURE__ */ f("span", { "aria-hidden": "true", children: u }) })
|
|
@@ -2499,7 +2499,7 @@ function er({
|
|
|
2499
2499
|
wording: o,
|
|
2500
2500
|
line: r
|
|
2501
2501
|
}) {
|
|
2502
|
-
const s =
|
|
2502
|
+
const s = $e(St), i = s?.editing?.row === !0 && s.editing.line !== r, a = s?.remove, [l, c] = G(!1), u = j(!1), d = j(null), h = j(null);
|
|
2503
2503
|
ae(() => {
|
|
2504
2504
|
l ? h.current?.focus() : u.current && d.current?.focus(), u.current = l;
|
|
2505
2505
|
}, [l]);
|
|
@@ -2507,14 +2507,14 @@ function er({
|
|
|
2507
2507
|
if (i || Je(g.disabled, t)) return;
|
|
2508
2508
|
const v = g.onSelect;
|
|
2509
2509
|
v(g.bulk ? [t] : t);
|
|
2510
|
-
}, m = e.filter(({ spec: g }) => !Je(g.hidden, t)), p = a && (l ? /* @__PURE__ */
|
|
2510
|
+
}, m = e.filter(({ spec: g }) => !Je(g.hidden, t)), p = a && (l ? /* @__PURE__ */ M(fe, { children: [
|
|
2511
2511
|
/* @__PURE__ */ f("span", { className: w.deleteAsk, children: o.deleteRowAsk }),
|
|
2512
2512
|
/* @__PURE__ */ f(ue, { className: w.toned, size: "sm", variant: "danger", "aria-label": o.rowAction(o.deleteRow, n), onClick: () => {
|
|
2513
2513
|
c(!1), a(t);
|
|
2514
2514
|
}, children: o.deleteRow }),
|
|
2515
2515
|
/* @__PURE__ */ f(ue, { ref: h, size: "sm", variant: "ghost", "aria-label": o.rowAction(o.keepRow, n), onClick: () => c(!1), children: o.keepRow })
|
|
2516
2516
|
] }) : /* @__PURE__ */ f(ue, { ref: d, size: "sm", variant: "ghost", "aria-label": o.rowAction(o.deleteRow, n), onClick: () => !i && c(!0), children: o.deleteRow }));
|
|
2517
|
-
return m.length <= ud ? /* @__PURE__ */
|
|
2517
|
+
return m.length <= ud ? /* @__PURE__ */ M("div", { className: I(w.actions, l && w.decision), children: [
|
|
2518
2518
|
!l && m.map(({ key: g, spec: v }) => /* @__PURE__ */ f(
|
|
2519
2519
|
ue,
|
|
2520
2520
|
{
|
|
@@ -2528,7 +2528,7 @@ function er({
|
|
|
2528
2528
|
g
|
|
2529
2529
|
)),
|
|
2530
2530
|
p
|
|
2531
|
-
] }) : /* @__PURE__ */
|
|
2531
|
+
] }) : /* @__PURE__ */ M("div", { className: I(w.actions, l && w.decision), children: [
|
|
2532
2532
|
!l && m.length > 0 && /* @__PURE__ */ f(
|
|
2533
2533
|
mr,
|
|
2534
2534
|
{
|
|
@@ -2541,8 +2541,8 @@ function er({
|
|
|
2541
2541
|
] });
|
|
2542
2542
|
}
|
|
2543
2543
|
function fd({ name: e, wording: t }) {
|
|
2544
|
-
const n =
|
|
2545
|
-
return /* @__PURE__ */
|
|
2544
|
+
const n = $e(St), o = j(null);
|
|
2545
|
+
return /* @__PURE__ */ M("div", { ref: o, className: I(w.actions, w.decision, w.draftButtons), children: [
|
|
2546
2546
|
/* @__PURE__ */ f(ue, { className: w.toned, size: "sm", variant: "primary", "aria-label": t.rowAction(t.saveRow, e), onClick: n.save, children: t.saveRow }),
|
|
2547
2547
|
/* @__PURE__ */ f(ue, { size: "sm", variant: "ghost", "aria-label": t.rowAction(t.discardRow, e), onClick: n.discard, children: t.discardRow }),
|
|
2548
2548
|
/* @__PURE__ */ f(
|
|
@@ -2572,8 +2572,8 @@ function us({
|
|
|
2572
2572
|
setOpen: a,
|
|
2573
2573
|
panelId: l
|
|
2574
2574
|
}) {
|
|
2575
|
-
const c = we(), u = We(), { id: d, label: h, format: b } = e.spec, { filterOptions: m } = n, p = m?.(d), [g, v] =
|
|
2576
|
-
() => !i && !g ? null : p ?
|
|
2575
|
+
const c = we(), u = We(), { id: d, label: h, format: b } = e.spec, { filterOptions: m } = n, p = m?.(d), [g, v] = G(i), [y, k] = G({ values: [], absent: !1 }), _ = oe(
|
|
2576
|
+
() => !i && !g ? null : p ? Fn(p, (D) => D, u) : Fn(n.admitted, e.read, u),
|
|
2577
2577
|
[i, g, p, n.admitted, e, u]
|
|
2578
2578
|
);
|
|
2579
2579
|
i !== g && (v(i), !i && _ !== null && k(_));
|
|
@@ -2582,10 +2582,10 @@ function us({
|
|
|
2582
2582
|
`server-filter-options:${d}`,
|
|
2583
2583
|
`The list filter of "${d}" offers only the values of the page in server mode; \`filterOptions\` gives it the server's.`
|
|
2584
2584
|
), !N) return null;
|
|
2585
|
-
const R = n.publicSnapshot, C = N.Input,
|
|
2585
|
+
const R = n.publicSnapshot, C = N.Input, L = pc(N) ? { absentOccurs: T, format: b, kind: t.kindOf(e, n.rows) } : {}, E = () => {
|
|
2586
2586
|
a(!1), (s ?? o).current?.focus();
|
|
2587
2587
|
};
|
|
2588
|
-
return /* @__PURE__ */
|
|
2588
|
+
return /* @__PURE__ */ M(
|
|
2589
2589
|
nn,
|
|
2590
2590
|
{
|
|
2591
2591
|
open: i,
|
|
@@ -2601,15 +2601,15 @@ function us({
|
|
|
2601
2601
|
C,
|
|
2602
2602
|
{
|
|
2603
2603
|
condition: R.filter[d] ?? null,
|
|
2604
|
-
setCondition: (
|
|
2604
|
+
setCondition: (D) => R.setFilter(d, D),
|
|
2605
2605
|
values: x,
|
|
2606
2606
|
column: { id: d, label: h },
|
|
2607
|
-
...
|
|
2607
|
+
...L
|
|
2608
2608
|
}
|
|
2609
2609
|
),
|
|
2610
|
-
/* @__PURE__ */
|
|
2610
|
+
/* @__PURE__ */ M("div", { className: w.filterFooter, children: [
|
|
2611
2611
|
/* @__PURE__ */ f(ue, { size: "sm", variant: "ghost", onClick: () => R.setFilter(d, null), children: c.filterReset }),
|
|
2612
|
-
/* @__PURE__ */ f(ue, { size: "sm", onClick:
|
|
2612
|
+
/* @__PURE__ */ f(ue, { size: "sm", onClick: E, children: c.filterDone })
|
|
2613
2613
|
] })
|
|
2614
2614
|
]
|
|
2615
2615
|
}
|
|
@@ -2620,13 +2620,13 @@ function hd({
|
|
|
2620
2620
|
registry: t,
|
|
2621
2621
|
hook: n
|
|
2622
2622
|
}) {
|
|
2623
|
-
const o = we(), [r, s] =
|
|
2624
|
-
return /* @__PURE__ */
|
|
2623
|
+
const o = we(), [r, s] = G(!1), i = j(null), a = Ve(), { id: l, label: c } = e.spec, u = l in n.publicSnapshot.filter;
|
|
2624
|
+
return /* @__PURE__ */ M(fe, { children: [
|
|
2625
2625
|
/* @__PURE__ */ f(Jt, { content: o.filterHint, children: /* @__PURE__ */ f(
|
|
2626
2626
|
"button",
|
|
2627
2627
|
{
|
|
2628
2628
|
type: "button",
|
|
2629
|
-
className:
|
|
2629
|
+
className: I(w.filterButton, u && w.filterActive),
|
|
2630
2630
|
"aria-label": o.filterColumn(c),
|
|
2631
2631
|
"aria-haspopup": "dialog",
|
|
2632
2632
|
"aria-expanded": r,
|
|
@@ -2672,7 +2672,7 @@ function pd({ registry: e, hook: t }) {
|
|
|
2672
2672
|
return [{ id: s, entry: l, text: bc(c, i, u) }];
|
|
2673
2673
|
});
|
|
2674
2674
|
return r.length === 0 ? null : /* @__PURE__ */ f(wr, { "aria-label": n.conditions, className: w.conditions, children: r.map(
|
|
2675
|
-
(s) => "rowFilter" in s ? /* @__PURE__ */
|
|
2675
|
+
(s) => "rowFilter" in s ? /* @__PURE__ */ M(
|
|
2676
2676
|
Xn,
|
|
2677
2677
|
{
|
|
2678
2678
|
className: w.condition,
|
|
@@ -2693,8 +2693,8 @@ function gd({
|
|
|
2693
2693
|
registry: n,
|
|
2694
2694
|
hook: o
|
|
2695
2695
|
}) {
|
|
2696
|
-
const r = we(), [s, i] =
|
|
2697
|
-
return /* @__PURE__ */
|
|
2696
|
+
const r = we(), [s, i] = G(!1), a = j(null), l = j(null), c = Ve(), { id: u, label: d } = e.spec;
|
|
2697
|
+
return /* @__PURE__ */ M(fe, { children: [
|
|
2698
2698
|
/* @__PURE__ */ f(
|
|
2699
2699
|
Xn,
|
|
2700
2700
|
{
|
|
@@ -2702,7 +2702,7 @@ function gd({
|
|
|
2702
2702
|
className: w.condition,
|
|
2703
2703
|
onRemove: () => o.publicSnapshot.setFilter(u, null),
|
|
2704
2704
|
removeLabel: r.removeConditionNamed(d, t),
|
|
2705
|
-
children: /* @__PURE__ */
|
|
2705
|
+
children: /* @__PURE__ */ M(
|
|
2706
2706
|
"button",
|
|
2707
2707
|
{
|
|
2708
2708
|
ref: l,
|
|
@@ -2742,11 +2742,11 @@ function wd({ registry: e, hook: t }) {
|
|
|
2742
2742
|
const n = we(), o = e.groupingEntries(t.rows);
|
|
2743
2743
|
if (o.length === 0) return null;
|
|
2744
2744
|
const { grouping: r, setGrouping: s } = t.publicSnapshot;
|
|
2745
|
-
return /* @__PURE__ */
|
|
2745
|
+
return /* @__PURE__ */ M("section", { className: w.groupingChoice, "aria-label": n.grouping, children: [
|
|
2746
2746
|
/* @__PURE__ */ f("h3", { className: w.groupingHeading, children: n.grouping }),
|
|
2747
2747
|
/* @__PURE__ */ f("div", { className: w.groupingOptions, children: o.map((i) => {
|
|
2748
2748
|
const { id: a, label: l } = i.spec, c = r.indexOf(a), u = c !== -1;
|
|
2749
|
-
return /* @__PURE__ */
|
|
2749
|
+
return /* @__PURE__ */ M(
|
|
2750
2750
|
"button",
|
|
2751
2751
|
{
|
|
2752
2752
|
type: "button",
|
|
@@ -2769,7 +2769,7 @@ function bd({ registry: e, hook: t }) {
|
|
|
2769
2769
|
const n = we();
|
|
2770
2770
|
if (!e.tree) return null;
|
|
2771
2771
|
const o = t.publicSnapshot;
|
|
2772
|
-
return /* @__PURE__ */
|
|
2772
|
+
return /* @__PURE__ */ M("div", { className: I(w.groupingChoice, w.groupingOptions), children: [
|
|
2773
2773
|
/* @__PURE__ */ f("button", { type: "button", className: w.groupingOption, onClick: o.unfoldAllBranches, children: n.unfoldAll }),
|
|
2774
2774
|
/* @__PURE__ */ f("button", { type: "button", className: w.groupingOption, onClick: o.foldAllBranches, children: n.foldAll })
|
|
2775
2775
|
] });
|
|
@@ -2781,12 +2781,12 @@ function vd({ registry: e, hook: t }) {
|
|
|
2781
2781
|
return (
|
|
2782
2782
|
/* In a tag group, as the conditions stand: the tag is one stop, its button
|
|
2783
2783
|
the thing one tabs to, and the ring stands on the tag. */
|
|
2784
|
-
/* @__PURE__ */ f(wr, { "aria-label": n.groupedBy, className: w.groupingTag, children: /* @__PURE__ */ f(Xn, { onRemove: () => o.setGrouping([]), removeLabel: n.removeGrouping, children: /* @__PURE__ */
|
|
2784
|
+
/* @__PURE__ */ f(wr, { "aria-label": n.groupedBy, className: w.groupingTag, children: /* @__PURE__ */ f(Xn, { onRemove: () => o.setGrouping([]), removeLabel: n.removeGrouping, children: /* @__PURE__ */ M(
|
|
2785
2785
|
mr,
|
|
2786
2786
|
{
|
|
2787
|
-
trigger: /* @__PURE__ */
|
|
2787
|
+
trigger: /* @__PURE__ */ M("button", { type: "button", className: I(w.conditionButton, w.groupingTrigger), children: [
|
|
2788
2788
|
/* @__PURE__ */ f("span", { className: w.groupingPrefix, children: n.groupedBy }),
|
|
2789
|
-
s.map((i, a) => /* @__PURE__ */
|
|
2789
|
+
s.map((i, a) => /* @__PURE__ */ M("span", { className: w.groupingPath, children: [
|
|
2790
2790
|
a > 0 && /* @__PURE__ */ f("span", { className: w.groupingSeparator, "aria-hidden": "true", children: "›" }),
|
|
2791
2791
|
i
|
|
2792
2792
|
] }, r[a]))
|
|
@@ -2803,7 +2803,7 @@ function vd({ registry: e, hook: t }) {
|
|
|
2803
2803
|
}
|
|
2804
2804
|
const fs = /* @__PURE__ */ yt("sm");
|
|
2805
2805
|
function cn(e) {
|
|
2806
|
-
const t =
|
|
2806
|
+
const t = $e(fs);
|
|
2807
2807
|
return e ?? t;
|
|
2808
2808
|
}
|
|
2809
2809
|
function hs({ registry: e }) {
|
|
@@ -2822,18 +2822,18 @@ function ps({
|
|
|
2822
2822
|
let c = null, u = null;
|
|
2823
2823
|
if (e && l) {
|
|
2824
2824
|
const d = l.publicSnapshot, h = d.search !== "" || Object.keys(d.filter).length > 0, b = d.server && !o ? l.chosenGroup : null, m = o || b || d.selection.count === 0 ? [] : l.selectedRows ?? d.filtered.filter((_) => d.selection.isSelected(l.rowKey(_))), p = d.server && d.selection.allMatching && !o, g = b ? b.count - b.except.length : p ? (l.matches ?? 0) - d.selection.except.size : m.length, v = p || b !== null, y = e.hasRowActions() ? e.actions.ordered().filter((_) => _.spec.bulk) : [];
|
|
2825
|
-
c = /* @__PURE__ */
|
|
2825
|
+
c = /* @__PURE__ */ M(fe, { children: [
|
|
2826
2826
|
/* @__PURE__ */ f(vd, { registry: e, hook: l }),
|
|
2827
2827
|
/* @__PURE__ */ f(pd, { registry: e, hook: l })
|
|
2828
2828
|
] });
|
|
2829
2829
|
const k = !h && g === 0 && !e.rowAdding;
|
|
2830
|
-
u = /* @__PURE__ */
|
|
2830
|
+
u = /* @__PURE__ */ M("div", { className: I(w.toolbarGroup, k && w.toolbarGroupIdle), children: [
|
|
2831
2831
|
/* @__PURE__ */ f("span", { role: "status", className: w.filteredCount, children: !h || e.skeleton ? "" : d.server ? (
|
|
2832
2832
|
/* The server counts the matches only; a total beside them would be a second request. */
|
|
2833
2833
|
l.matches === null ? "" : i.entries(l.matches, a.count(l.matches))
|
|
2834
2834
|
) : i.filteredOfTotal(a.count(d.filtered.length), a.count(l.tableState.total ?? l.admitted.length), l.tableState.total ?? l.admitted.length) }),
|
|
2835
2835
|
h && /* @__PURE__ */ f(ue, { size: r, variant: "ghost", onClick: () => Zr(d), children: i.resetAll }),
|
|
2836
|
-
g > 0 && /* @__PURE__ */
|
|
2836
|
+
g > 0 && /* @__PURE__ */ M(fe, { children: [
|
|
2837
2837
|
/* @__PURE__ */ f("span", { className: w.toolbarInfo, children: i.selectedCount(g, a.count(g)) }),
|
|
2838
2838
|
y.map(({ key: _, spec: x }) => {
|
|
2839
2839
|
const T = v ? void 0 : m.filter((C) => !Je(x.hidden, C) && !Je(x.disabled, C));
|
|
@@ -2857,8 +2857,8 @@ function ps({
|
|
|
2857
2857
|
e.rowAdding && /* @__PURE__ */ f(hs, { registry: e })
|
|
2858
2858
|
] });
|
|
2859
2859
|
}
|
|
2860
|
-
return /* @__PURE__ */ f(fs, { value: r, children: /* @__PURE__ */ f(br, { size: r, children: /* @__PURE__ */
|
|
2861
|
-
/* @__PURE__ */
|
|
2860
|
+
return /* @__PURE__ */ f(fs, { value: r, children: /* @__PURE__ */ f(br, { size: r, children: /* @__PURE__ */ M("div", { ...s, className: I(w.toolbar, r === "md" && w.toolbarMd, t), children: [
|
|
2861
|
+
/* @__PURE__ */ M("div", { className: w.toolbarGroup, children: [
|
|
2862
2862
|
n,
|
|
2863
2863
|
c
|
|
2864
2864
|
] }),
|
|
@@ -2867,7 +2867,7 @@ function ps({
|
|
|
2867
2867
|
}
|
|
2868
2868
|
const gs = yt(null);
|
|
2869
2869
|
function Uu({ label: e, children: t }) {
|
|
2870
|
-
const n =
|
|
2870
|
+
const n = Ve(), o = oe(() => ({ id: n, label: e }), [n, e]);
|
|
2871
2871
|
return /* @__PURE__ */ f(gs, { value: o, children: t });
|
|
2872
2872
|
}
|
|
2873
2873
|
function dn(e) {
|
|
@@ -2876,12 +2876,12 @@ function dn(e) {
|
|
|
2876
2876
|
o > 0 && n.spec.heading?.id !== e[o - 1].spec.heading?.id && t.add(n);
|
|
2877
2877
|
}), t;
|
|
2878
2878
|
}
|
|
2879
|
-
const
|
|
2879
|
+
const Vn = /* @__PURE__ */ yt(null), yd = () => () => {
|
|
2880
2880
|
}, tr = () => 0;
|
|
2881
|
-
function
|
|
2882
|
-
const n =
|
|
2881
|
+
function Dt(e, t) {
|
|
2882
|
+
const n = $e(Vn);
|
|
2883
2883
|
!e && !n && te(`no-table:${t}`, `\`${t}\` stands in no table and renders nothing: place it inside the table, or give it \`of\` (the return value of \`useTable\`).`);
|
|
2884
|
-
const o = e ?
|
|
2884
|
+
const o = e ? Lc(e.Table) ?? null : n?.registry ?? null;
|
|
2885
2885
|
tn(
|
|
2886
2886
|
o ? o.subscribe : yd,
|
|
2887
2887
|
o ? o.bodyVersion : tr,
|
|
@@ -2909,7 +2909,7 @@ const _d = (e) => {
|
|
|
2909
2909
|
return t;
|
|
2910
2910
|
};
|
|
2911
2911
|
function kd(e, t) {
|
|
2912
|
-
const n =
|
|
2912
|
+
const n = j(null);
|
|
2913
2913
|
ee(() => {
|
|
2914
2914
|
const o = e.current;
|
|
2915
2915
|
if (!o) return;
|
|
@@ -2925,7 +2925,7 @@ function kd(e, t) {
|
|
|
2925
2925
|
});
|
|
2926
2926
|
}
|
|
2927
2927
|
function Cd(e, t, n) {
|
|
2928
|
-
const o =
|
|
2928
|
+
const o = j(t);
|
|
2929
2929
|
ee(() => {
|
|
2930
2930
|
const r = e.current, s = o.current;
|
|
2931
2931
|
if (o.current = t, !r || s === t || typeof r.animate != "function") return;
|
|
@@ -2942,7 +2942,7 @@ function Cd(e, t, n) {
|
|
|
2942
2942
|
}, [e, t, n]);
|
|
2943
2943
|
}
|
|
2944
2944
|
function ws({ wording: e }) {
|
|
2945
|
-
return /* @__PURE__ */
|
|
2945
|
+
return /* @__PURE__ */ M(fe, { children: [
|
|
2946
2946
|
/* @__PURE__ */ f("span", { "aria-hidden": "true", className: w.absent, children: "—" }),
|
|
2947
2947
|
/* @__PURE__ */ f(He, { children: e.cellAbsentValue })
|
|
2948
2948
|
] });
|
|
@@ -2972,7 +2972,7 @@ function bs(e, t, n) {
|
|
|
2972
2972
|
const u = o === "count" || o === "distinct" || (a ?? _r(t, e.read) === "number"), d = { spec: o, reader: i, aligned: a, value: l, places: c, numeric: u };
|
|
2973
2973
|
return r.set(e, d), d;
|
|
2974
2974
|
}
|
|
2975
|
-
function
|
|
2975
|
+
function In({
|
|
2976
2976
|
entry: e,
|
|
2977
2977
|
rows: t,
|
|
2978
2978
|
formats: n,
|
|
@@ -2997,13 +2997,13 @@ function Vn({
|
|
|
2997
2997
|
g = p(k) === p(_) ? p(k) : o.rangeFromTo(p(k) ?? "", p(_) ?? "");
|
|
2998
2998
|
} else d === "own" && u ? g = u(b, t[0]) : g = p(b);
|
|
2999
2999
|
const v = xd[d], y = d === "own" && !!l;
|
|
3000
|
-
return /* @__PURE__ */
|
|
3001
|
-
r && y && /* @__PURE__ */
|
|
3000
|
+
return /* @__PURE__ */ M(fe, { children: [
|
|
3001
|
+
r && y && /* @__PURE__ */ M("span", { className: w.footerKind, children: [
|
|
3002
3002
|
l,
|
|
3003
3003
|
" "
|
|
3004
3004
|
] }),
|
|
3005
3005
|
r && v && /* @__PURE__ */ f("span", { "aria-hidden": "true", className: w.footerKind, children: v }),
|
|
3006
|
-
r && !y && /* @__PURE__ */
|
|
3006
|
+
r && !y && /* @__PURE__ */ M(He, { children: [
|
|
3007
3007
|
Ad(d, o),
|
|
3008
3008
|
" "
|
|
3009
3009
|
] }),
|
|
@@ -3013,22 +3013,22 @@ function Vn({
|
|
|
3013
3013
|
const Td = (e) => typeof e == "number" && Number.isFinite(e), vs = (e) => {
|
|
3014
3014
|
const [t = "", n = "0"] = e.toExponential().split("e");
|
|
3015
3015
|
return Math.max(0, (t.split(".")[1]?.length ?? 0) - Number(n));
|
|
3016
|
-
}, Nd = ([e, t], n) => e instanceof Date && t instanceof Date &&
|
|
3017
|
-
function
|
|
3016
|
+
}, Nd = ([e, t], n) => e instanceof Date && t instanceof Date && Ie(e, n).year === Ie(t, n).year;
|
|
3017
|
+
function Kn(e, t, n) {
|
|
3018
3018
|
return e.spec.aggregate ? bs(e, t, n).numeric : !1;
|
|
3019
3019
|
}
|
|
3020
|
-
function
|
|
3020
|
+
function $t(e, t, n, o) {
|
|
3021
3021
|
if (t === void 0) return o.groupNoValue;
|
|
3022
3022
|
const r = e?.spec;
|
|
3023
3023
|
if (r?.group && t instanceof Date) return Yl(r.group, t, n, o, n.timeZone);
|
|
3024
3024
|
const s = r?.ownGroupValue ? void 0 : r?.format;
|
|
3025
3025
|
return ft(t, s, n, o) ?? String(t);
|
|
3026
3026
|
}
|
|
3027
|
-
function
|
|
3027
|
+
function Gn({ entry: e, group: t, formats: n, wording: o }) {
|
|
3028
3028
|
const r = e?.spec;
|
|
3029
|
-
return t.value !== void 0 && r?.presentation && !r.ownGroupValue && !r.group ? /* @__PURE__ */ f(fe, { children: r.presentation(t.value, t.rows[0]) }) : /* @__PURE__ */ f(fe, { children:
|
|
3029
|
+
return t.value !== void 0 && r?.presentation && !r.ownGroupValue && !r.group ? /* @__PURE__ */ f(fe, { children: r.presentation(t.value, t.rows[0]) }) : /* @__PURE__ */ f(fe, { children: $t(e, t.value, n, o) });
|
|
3030
3030
|
}
|
|
3031
|
-
function
|
|
3031
|
+
function jn({
|
|
3032
3032
|
group: e,
|
|
3033
3033
|
parent: t,
|
|
3034
3034
|
entry: n,
|
|
@@ -3037,7 +3037,7 @@ function Gn({
|
|
|
3037
3037
|
formats: s,
|
|
3038
3038
|
wording: i
|
|
3039
3039
|
}) {
|
|
3040
|
-
const a =
|
|
3040
|
+
const a = $t(n, e.value, s, i), l = s.count(lt(e)), c = (d) => {
|
|
3041
3041
|
dt(o ? i.groupFolded(a) : i.groupOpened(a), d), r.publicSnapshot.toggleFold(e.path);
|
|
3042
3042
|
}, u = (d) => {
|
|
3043
3043
|
if (d.altKey && (d.key === "ArrowLeft" || d.key === "ArrowRight")) {
|
|
@@ -3060,7 +3060,7 @@ function Gn({
|
|
|
3060
3060
|
"button",
|
|
3061
3061
|
{
|
|
3062
3062
|
type: "button",
|
|
3063
|
-
className:
|
|
3063
|
+
className: I(w.fold, !o && w.foldClosed),
|
|
3064
3064
|
"data-fold-path": e.path,
|
|
3065
3065
|
"aria-expanded": o,
|
|
3066
3066
|
"aria-label": o ? i.foldGroup(a, l) : i.unfoldGroup(a, l),
|
|
@@ -3074,7 +3074,7 @@ function Gn({
|
|
|
3074
3074
|
);
|
|
3075
3075
|
}
|
|
3076
3076
|
function Rd({ value: e, formats: t }) {
|
|
3077
|
-
const n =
|
|
3077
|
+
const n = j(null);
|
|
3078
3078
|
return Cd(n, e, t.count), /* @__PURE__ */ f("span", { ref: n, className: w.groupCount, children: t.count(e) });
|
|
3079
3079
|
}
|
|
3080
3080
|
function Hn({ group: e, entry: t, hook: n, formats: o, wording: r }) {
|
|
@@ -3084,7 +3084,7 @@ function Hn({ group: e, entry: t, hook: n, formats: o, wording: r }) {
|
|
|
3084
3084
|
return /* @__PURE__ */ f(
|
|
3085
3085
|
ct,
|
|
3086
3086
|
{
|
|
3087
|
-
"aria-label": r.selectGroup(
|
|
3087
|
+
"aria-label": r.selectGroup($t(t, e.value, o, r)),
|
|
3088
3088
|
checked: u && n.chosenGroup.except.length === 0,
|
|
3089
3089
|
indeterminate: u && n.chosenGroup.except.length > 0,
|
|
3090
3090
|
onCheckedChange: () => n.chooseGroup(u ? null : { path: e.path, count: lt(e) })
|
|
@@ -3095,7 +3095,7 @@ function Hn({ group: e, entry: t, hook: n, formats: o, wording: r }) {
|
|
|
3095
3095
|
return /* @__PURE__ */ f(
|
|
3096
3096
|
ct,
|
|
3097
3097
|
{
|
|
3098
|
-
"aria-label": r.selectGroup(
|
|
3098
|
+
"aria-label": r.selectGroup($t(t, e.value, o, r)),
|
|
3099
3099
|
checked: c,
|
|
3100
3100
|
indeterminate: l > 0 && !c,
|
|
3101
3101
|
onCheckedChange: () => {
|
|
@@ -3113,7 +3113,7 @@ function or(e, t, n) {
|
|
|
3113
3113
|
for (const i of r)
|
|
3114
3114
|
o.folded.includes(i.path) !== t && o.toggleFold(i.path);
|
|
3115
3115
|
}
|
|
3116
|
-
function
|
|
3116
|
+
function Ed({
|
|
3117
3117
|
line: e,
|
|
3118
3118
|
entry: t,
|
|
3119
3119
|
selectable: n,
|
|
@@ -3123,17 +3123,17 @@ function jd({
|
|
|
3123
3123
|
wording: i
|
|
3124
3124
|
}) {
|
|
3125
3125
|
const a = e.span;
|
|
3126
|
-
return /* @__PURE__ */ f("td", { className:
|
|
3126
|
+
return /* @__PURE__ */ f("td", { className: I(w.td, w.spanCell, o.className), style: o.style, children: e.first && /* @__PURE__ */ M("span", { className: w.spanValue, children: [
|
|
3127
3127
|
n && /* @__PURE__ */ f("span", { className: w.spanSelect, children: /* @__PURE__ */ f(Hn, { group: a, entry: t, hook: r, formats: s, wording: i }) }),
|
|
3128
|
-
/* @__PURE__ */ f(
|
|
3129
|
-
/* @__PURE__ */
|
|
3130
|
-
/* @__PURE__ */ f(
|
|
3128
|
+
/* @__PURE__ */ f(jn, { group: a, parent: e.parents.at(-1), entry: t, open: !0, hook: r, formats: s, wording: i }),
|
|
3129
|
+
/* @__PURE__ */ M("span", { className: w.spanText, title: $t(t, a.value, s, i), children: [
|
|
3130
|
+
/* @__PURE__ */ f(Gn, { entry: t, group: a, formats: s, wording: i }),
|
|
3131
3131
|
e.continued && /* @__PURE__ */ f("span", { className: w.continued, children: i.groupContinued })
|
|
3132
3132
|
] }),
|
|
3133
3133
|
/* @__PURE__ */ f("span", { className: w.groupCount, children: s.count(lt(a)) })
|
|
3134
3134
|
] }) });
|
|
3135
3135
|
}
|
|
3136
|
-
function
|
|
3136
|
+
function Md({
|
|
3137
3137
|
line: e,
|
|
3138
3138
|
index: t,
|
|
3139
3139
|
absolute: n,
|
|
@@ -3156,19 +3156,19 @@ function Ed({
|
|
|
3156
3156
|
const { group: y } = e, k = e.kind === "header", _ = k && !m.publicSnapshot.folded.includes(y.path), { lead: x, labelColumns: T, countColumns: N } = ss({
|
|
3157
3157
|
controls: a,
|
|
3158
3158
|
span: r !== void 0,
|
|
3159
|
-
aggregates: i.map((
|
|
3159
|
+
aggregates: i.map((z) => z.spec.aggregate !== void 0),
|
|
3160
3160
|
actions: u,
|
|
3161
3161
|
blocks: l
|
|
3162
|
-
}), R = i.slice(x), C = dn(i),
|
|
3163
|
-
/* @__PURE__ */ f(
|
|
3164
|
-
/* @__PURE__ */ f("span", { className: w.groupValue, children: /* @__PURE__ */ f(
|
|
3162
|
+
}), R = i.slice(x), C = dn(i), L = a + (r ? 1 : 0), E = (z, H = z) => on(l, z, H), D = (z) => x - z > 0 && /* @__PURE__ */ f("td", { className: w.td, colSpan: x - z }), $ = i.find((z) => z.spec.aggregate === "sum" && z.spec.share !== !1), X = n !== void 0, K = /* @__PURE__ */ M("span", { className: w.groupLabel, children: [
|
|
3163
|
+
/* @__PURE__ */ f(jn, { group: y, parent: e.parents.at(-1), entry: s, open: _, hook: m, formats: p, wording: g }),
|
|
3164
|
+
/* @__PURE__ */ f("span", { className: w.groupValue, children: /* @__PURE__ */ f(Gn, { entry: s, group: y, formats: p, wording: g }) }),
|
|
3165
3165
|
/* @__PURE__ */ f(Rd, { value: lt(y), formats: p }),
|
|
3166
3166
|
k && e.continued && /* @__PURE__ */ f("span", { className: w.continued, children: g.groupContinued })
|
|
3167
3167
|
] });
|
|
3168
|
-
return /* @__PURE__ */
|
|
3168
|
+
return /* @__PURE__ */ M(
|
|
3169
3169
|
"tr",
|
|
3170
3170
|
{
|
|
3171
|
-
className:
|
|
3171
|
+
className: I(k ? w.groupHeader : w.groupFolded, X && w.virtualRow),
|
|
3172
3172
|
"data-line": e.kind,
|
|
3173
3173
|
"data-level": y.level,
|
|
3174
3174
|
"data-motion": n !== void 0 || !(k && e.continued) ? `${e.kind}:${y.path}` : void 0,
|
|
@@ -3185,65 +3185,65 @@ function Ed({
|
|
|
3185
3185
|
"aria-posinset": h.indexOf(y) + 1 || void 0,
|
|
3186
3186
|
"aria-setsize": h.length || void 0,
|
|
3187
3187
|
children: [
|
|
3188
|
-
Array.from({ length: a }, (
|
|
3189
|
-
k ? /* @__PURE__ */
|
|
3188
|
+
Array.from({ length: a }, (z, H) => /* @__PURE__ */ f("td", { className: I(w.td, w.control, E(H).className), style: E(H).style, children: H === 0 && c && k && /* @__PURE__ */ f(Hn, { group: y, entry: s, hook: m, formats: p, wording: g }) }, `c${H}`)),
|
|
3189
|
+
k ? /* @__PURE__ */ M(fe, { children: [
|
|
3190
3190
|
/* @__PURE__ */ f(
|
|
3191
3191
|
"td",
|
|
3192
3192
|
{
|
|
3193
|
-
className:
|
|
3193
|
+
className: I(w.td, E(a, L + T - 1).className),
|
|
3194
3194
|
colSpan: (r ? 1 : 0) + T,
|
|
3195
3195
|
style: {
|
|
3196
|
-
...
|
|
3196
|
+
...E(a, L + T - 1).style,
|
|
3197
3197
|
paddingLeft: `calc(var(--u-space-3) + ${y.level * 20}px)`
|
|
3198
3198
|
},
|
|
3199
|
-
children:
|
|
3199
|
+
children: K
|
|
3200
3200
|
}
|
|
3201
3201
|
),
|
|
3202
|
-
|
|
3203
|
-
] }) : /* @__PURE__ */
|
|
3204
|
-
/* @__PURE__ */ f("td", { className:
|
|
3202
|
+
D(T)
|
|
3203
|
+
] }) : /* @__PURE__ */ M(fe, { children: [
|
|
3204
|
+
/* @__PURE__ */ f("td", { className: I(w.td, w.spanCell, E(a).className), style: E(a).style, children: /* @__PURE__ */ M("span", { className: w.spanValue, children: [
|
|
3205
3205
|
c && /* @__PURE__ */ f("span", { className: w.spanSelect, children: /* @__PURE__ */ f(Hn, { group: y, entry: r, hook: m, formats: p, wording: g }) }),
|
|
3206
|
-
/* @__PURE__ */ f(
|
|
3207
|
-
/* @__PURE__ */ f("span", { className: w.spanText, children: /* @__PURE__ */ f(
|
|
3206
|
+
/* @__PURE__ */ f(jn, { group: y, parent: e.parents.at(-1), entry: r, open: !1, hook: m, formats: p, wording: g }),
|
|
3207
|
+
/* @__PURE__ */ f("span", { className: w.spanText, children: /* @__PURE__ */ f(Gn, { entry: r, group: y, formats: p, wording: g }) }),
|
|
3208
3208
|
/* @__PURE__ */ f("span", { className: w.groupCount, children: p.count(lt(y)) })
|
|
3209
3209
|
] }) }),
|
|
3210
3210
|
N > 0 && /* @__PURE__ */ f(
|
|
3211
3211
|
"td",
|
|
3212
3212
|
{
|
|
3213
|
-
className:
|
|
3214
|
-
style:
|
|
3213
|
+
className: I(w.td, w.foldedCount, E(L, L + N - 1).className),
|
|
3214
|
+
style: E(L, L + N - 1).style,
|
|
3215
3215
|
colSpan: N,
|
|
3216
3216
|
children: g.entries(lt(y), p.count(lt(y)))
|
|
3217
3217
|
}
|
|
3218
3218
|
),
|
|
3219
|
-
|
|
3219
|
+
D(N)
|
|
3220
3220
|
] }),
|
|
3221
|
-
R.map((
|
|
3222
|
-
|
|
3221
|
+
R.map((z, H) => /* @__PURE__ */ f(
|
|
3222
|
+
Ld,
|
|
3223
3223
|
{
|
|
3224
|
-
pin:
|
|
3225
|
-
entry:
|
|
3224
|
+
pin: Mt(E(L + x + H), C.has(z)),
|
|
3225
|
+
entry: z,
|
|
3226
3226
|
group: y,
|
|
3227
|
-
share: k &&
|
|
3227
|
+
share: k && z === $ && !m.publicSnapshot.server,
|
|
3228
3228
|
total: d,
|
|
3229
3229
|
formats: p,
|
|
3230
3230
|
wording: g
|
|
3231
3231
|
},
|
|
3232
|
-
|
|
3232
|
+
z.key
|
|
3233
3233
|
)),
|
|
3234
|
-
u && /* @__PURE__ */ f("td", { className:
|
|
3234
|
+
u && /* @__PURE__ */ f("td", { className: I(w.td, E(l.count - 1).className), style: E(l.count - 1).style })
|
|
3235
3235
|
]
|
|
3236
3236
|
}
|
|
3237
3237
|
);
|
|
3238
3238
|
}
|
|
3239
3239
|
const rr = /* @__PURE__ */ new WeakMap();
|
|
3240
|
-
function
|
|
3240
|
+
function Od(e, t) {
|
|
3241
3241
|
let n = rr.get(t);
|
|
3242
3242
|
n || rr.set(t, n = /* @__PURE__ */ new Map());
|
|
3243
3243
|
let o = n.get(e);
|
|
3244
3244
|
return (!o || o.reader !== e.spec.value) && (o = { reader: e.spec.value, sum: to({ id: e.spec.id, read: e.read, aggregate: "sum" }, t) }, n.set(e, o)), o.sum;
|
|
3245
3245
|
}
|
|
3246
|
-
function
|
|
3246
|
+
function Ld({
|
|
3247
3247
|
entry: e,
|
|
3248
3248
|
pin: t,
|
|
3249
3249
|
group: n,
|
|
@@ -3253,17 +3253,17 @@ function Od({
|
|
|
3253
3253
|
wording: i
|
|
3254
3254
|
}) {
|
|
3255
3255
|
const { spec: a } = e;
|
|
3256
|
-
if (!a.aggregate) return /* @__PURE__ */ f("td", { className:
|
|
3256
|
+
if (!a.aggregate) return /* @__PURE__ */ f("td", { className: I(w.td, t.className), style: t.style });
|
|
3257
3257
|
let l = null;
|
|
3258
3258
|
if (o && a.aggregate === "sum" && a.share !== !1) {
|
|
3259
|
-
const b =
|
|
3259
|
+
const b = Od(e, r), m = n.aggregates[a.id];
|
|
3260
3260
|
if (typeof b == "number" && b > 0 && typeof m == "number" && m > 0) {
|
|
3261
3261
|
const p = Math.min(1, m / b);
|
|
3262
3262
|
l = /* @__PURE__ */ f("span", { className: w.shareBar, style: { width: `${Math.max(2, Math.round(p * 64))}px` }, "aria-hidden": "true" });
|
|
3263
3263
|
}
|
|
3264
3264
|
}
|
|
3265
|
-
const c = n.size !== void 0, u = { value: n.aggregates[a.id] }, d = c ? r : n.rows, h = /* @__PURE__ */ f(
|
|
3266
|
-
return /* @__PURE__ */ f("td", { className:
|
|
3265
|
+
const c = n.size !== void 0, u = { value: n.aggregates[a.id] }, d = c ? r : n.rows, h = /* @__PURE__ */ f(In, { entry: e, rows: d, ...c ? { given: u } : { known: u }, formats: s, wording: i });
|
|
3266
|
+
return /* @__PURE__ */ f("td", { className: I(w.td, Kn(e, d, c ? void 0 : u) && w.numeric, w.aggregateCell, t.className), style: t.style, "data-aggregate": typeof a.aggregate == "function" ? "own" : a.aggregate, children: l ? /* @__PURE__ */ M("span", { className: w.shareHost, children: [
|
|
3267
3267
|
h,
|
|
3268
3268
|
l
|
|
3269
3269
|
] }) : h });
|
|
@@ -3277,7 +3277,7 @@ function Ss(e, t, n, o, r) {
|
|
|
3277
3277
|
const i = r !== void 0 && r.branch && !r.empty;
|
|
3278
3278
|
return { content: s, open: i ? t.branches.includes(o) : t.expanded.includes(o) };
|
|
3279
3279
|
}
|
|
3280
|
-
function
|
|
3280
|
+
function $d(e, t, n, o, r) {
|
|
3281
3281
|
const s = /* @__PURE__ */ new Set([...t.expanded, ...t.branches]), i = /* @__PURE__ */ new Set();
|
|
3282
3282
|
for (const a of n) {
|
|
3283
3283
|
const l = o(a);
|
|
@@ -3285,7 +3285,7 @@ function Ld(e, t, n, o, r) {
|
|
|
3285
3285
|
}
|
|
3286
3286
|
return i;
|
|
3287
3287
|
}
|
|
3288
|
-
function
|
|
3288
|
+
function Fd({
|
|
3289
3289
|
setup: e,
|
|
3290
3290
|
entry: t,
|
|
3291
3291
|
detail: n,
|
|
@@ -3307,12 +3307,12 @@ function $d({
|
|
|
3307
3307
|
}
|
|
3308
3308
|
}
|
|
3309
3309
|
};
|
|
3310
|
-
return /* @__PURE__ */
|
|
3310
|
+
return /* @__PURE__ */ M("span", { className: w.treeCell, style: { "--_table-tree-level": t.level }, children: [
|
|
3311
3311
|
a ? /* @__PURE__ */ f(
|
|
3312
3312
|
"button",
|
|
3313
3313
|
{
|
|
3314
3314
|
type: "button",
|
|
3315
|
-
className:
|
|
3315
|
+
className: I(w.fold, !l && w.foldClosed),
|
|
3316
3316
|
"data-branch-key": t.key,
|
|
3317
3317
|
"aria-expanded": l,
|
|
3318
3318
|
"aria-label": l ? r.foldBranch(o) : r.unfoldBranch(o),
|
|
@@ -3321,13 +3321,13 @@ function $d({
|
|
|
3321
3321
|
children: /* @__PURE__ */ f(ys, {})
|
|
3322
3322
|
}
|
|
3323
3323
|
) : /* @__PURE__ */ f("span", { className: w.foldSlot }),
|
|
3324
|
-
/* @__PURE__ */
|
|
3324
|
+
/* @__PURE__ */ M("span", { className: w.treeText, children: [
|
|
3325
3325
|
s,
|
|
3326
3326
|
t.pathOnly && /* @__PURE__ */ f(He, { children: `, ${r.pathRow}` })
|
|
3327
3327
|
] })
|
|
3328
3328
|
] });
|
|
3329
3329
|
}
|
|
3330
|
-
function
|
|
3330
|
+
function Pd(e, t, n, o) {
|
|
3331
3331
|
const r = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Set(), a = [];
|
|
3332
3332
|
return e.forEach((l, c) => {
|
|
3333
3333
|
r.set(l.key, l), a.length = l.level, s.set(l.key, a.at(-1)), a.push(l.key), e[c + 1]?.level === 0 && i.add(l.key);
|
|
@@ -3351,7 +3351,7 @@ function Fd(e, t, n, o) {
|
|
|
3351
3351
|
};
|
|
3352
3352
|
}
|
|
3353
3353
|
const sr = /* @__PURE__ */ new WeakMap();
|
|
3354
|
-
function
|
|
3354
|
+
function zd(e, t, n, o) {
|
|
3355
3355
|
const { loading: r = !1 } = n, { projection: s, virtual: i, lines: a, spanEntry: l, dataColumns: c, controlColumns: u, trailing: d, blocks: h, rows: b, footerShown: m } = o, p = r ? void 0 : a ? i ? s.lines : a : i ? s.shown ?? s.filtered : b, g = s.shown ?? s.filtered, v = c.map((T) => T.spec.aggregate !== void 0 ? "1" : "0").join(""), y = [r, a !== void 0, p, g, t.rowKey, o.snapshot, o.detail, o.entries, u, l !== void 0, v, d, h.start, h.end, h.count, m], k = sr.get(e);
|
|
3356
3356
|
if (k && k.made.every((T, N) => T === y[N])) return k;
|
|
3357
3357
|
const _ = p ? a ? { lines: p } : { rows: p } : { rows: [] }, x = {
|
|
@@ -3360,14 +3360,14 @@ function Pd(e, t, n, o) {
|
|
|
3360
3360
|
layout: { controls: u, span: l !== void 0, aggregates: c.map((T) => T.spec.aggregate !== void 0), actions: d, blocks: h },
|
|
3361
3361
|
body: _,
|
|
3362
3362
|
rowKey: t.rowKey,
|
|
3363
|
-
expanded: o.detail ?
|
|
3363
|
+
expanded: o.detail ? $d(e, o.snapshot, g, t.rowKey, o.tree) : /* @__PURE__ */ new Set(),
|
|
3364
3364
|
foot: m
|
|
3365
3365
|
}),
|
|
3366
3366
|
rowLines: (T) => {
|
|
3367
3367
|
if (x.rowLinesOf?.rows !== T.rows) {
|
|
3368
|
-
const N = /* @__PURE__ */ new Set(), R = T.tree?.children, C = (
|
|
3369
|
-
for (const
|
|
3370
|
-
N.add(ut(T.rowKey(
|
|
3368
|
+
const N = /* @__PURE__ */ new Set(), R = T.tree?.children, C = (L) => {
|
|
3369
|
+
for (const E of L)
|
|
3370
|
+
N.add(ut(T.rowKey(E))), R && C(R(E) ?? []);
|
|
3371
3371
|
};
|
|
3372
3372
|
C(T.rows), x.rowLinesOf = { rows: T.rows, set: N };
|
|
3373
3373
|
}
|
|
@@ -3376,22 +3376,22 @@ function Pd(e, t, n, o) {
|
|
|
3376
3376
|
};
|
|
3377
3377
|
return sr.set(e, x), x;
|
|
3378
3378
|
}
|
|
3379
|
-
function
|
|
3379
|
+
function Bd(e, t, n) {
|
|
3380
3380
|
const o = e.lines[0];
|
|
3381
3381
|
if (!n || !o) return e.lines;
|
|
3382
3382
|
const r = e.spliced;
|
|
3383
3383
|
if (r && r.row === t) return r.lines;
|
|
3384
3384
|
const s = e.lines.slice();
|
|
3385
|
-
return s.splice(1, 0, { key:
|
|
3385
|
+
return s.splice(1, 0, { key: Ee, cells: o.cells, at: -1, row: t }), e.spliced = { row: t, lines: s }, s;
|
|
3386
3386
|
}
|
|
3387
|
-
function
|
|
3387
|
+
function Dd({
|
|
3388
3388
|
registry: e,
|
|
3389
3389
|
hook: t,
|
|
3390
3390
|
props: n,
|
|
3391
3391
|
layout: o,
|
|
3392
3392
|
grid: r
|
|
3393
3393
|
}) {
|
|
3394
|
-
const { selectable: s = !1, loading: i = !1, grid: a = !1 } = n, { virtual: l, spanEntry: c, dataColumns: u, expanderColumn: d, trailing: h } = o, b = r.state.editing?.line ===
|
|
3394
|
+
const { selectable: s = !1, loading: i = !1, grid: a = !1 } = n, { virtual: l, spanEntry: c, dataColumns: u, expanderColumn: d, trailing: h } = o, b = r.state.editing?.line === Ee ? r.state.editing : null, m = a ? zd(e, t, n, o) : void 0, p = m ? Bd(m, b?.fresh, b !== null) : [], g = [
|
|
3395
3395
|
...s ? ["#select"] : [],
|
|
3396
3396
|
...d ? ["#detail"] : [],
|
|
3397
3397
|
...c ? ["#span"] : [],
|
|
@@ -3420,12 +3420,12 @@ function Bd({
|
|
|
3420
3420
|
}) : void 0;
|
|
3421
3421
|
return { lines: p, fresh: b, ids: g, events: v };
|
|
3422
3422
|
}
|
|
3423
|
-
function
|
|
3423
|
+
function Vd(e) {
|
|
3424
3424
|
for (const t of e) t.removeAttribute("data-copied");
|
|
3425
3425
|
document.body.offsetWidth;
|
|
3426
3426
|
for (const t of e) t.setAttribute("data-copied", "");
|
|
3427
3427
|
}
|
|
3428
|
-
function
|
|
3428
|
+
function Id({
|
|
3429
3429
|
registry: e,
|
|
3430
3430
|
hook: t,
|
|
3431
3431
|
grid: n,
|
|
@@ -3452,22 +3452,22 @@ function Vd({
|
|
|
3452
3452
|
const N = new Set(_.map((R) => String(t.rowKey(R))));
|
|
3453
3453
|
k = Array.from(h.querySelectorAll("tr[data-motion]")).filter((R) => N.has(R.dataset.motion)).flatMap((R) => Array.from(R.children));
|
|
3454
3454
|
} else if (o && n.state.active) {
|
|
3455
|
-
const { line: N, column: R } = n.state.active, C = r.find((
|
|
3456
|
-
if (!C || C.row === void 0 || C.key !== ut(t.rowKey(C.row)) || !
|
|
3457
|
-
const
|
|
3458
|
-
|
|
3455
|
+
const { line: N, column: R } = n.state.active, C = r.find((D) => D.key === N), L = s.find((D) => D.spec.id === R);
|
|
3456
|
+
if (!C || C.row === void 0 || C.key !== ut(t.rowKey(C.row)) || !L) return;
|
|
3457
|
+
const E = Array.from(h.querySelectorAll("tr[data-grid-line]")).find((D) => D.dataset.gridLine === N)?.children[n.state.active.columnIndex];
|
|
3458
|
+
E && (k = [E]), v = Kc(e, L, C.row, i, a), y = a.copiedCell;
|
|
3459
3459
|
} else return;
|
|
3460
3460
|
c.preventDefault();
|
|
3461
3461
|
const T = (N) => {
|
|
3462
3462
|
te("copy-failed", `The clipboard refused the copy (${String(N)}). It needs a secure context and a focused document.`), u(a.copyFailed);
|
|
3463
3463
|
};
|
|
3464
3464
|
Promise.resolve().then(() => navigator.clipboard.writeText(v)).then(() => {
|
|
3465
|
-
|
|
3465
|
+
Vd(k), u(y);
|
|
3466
3466
|
}, T);
|
|
3467
3467
|
};
|
|
3468
3468
|
}
|
|
3469
3469
|
const uo = /* @__PURE__ */ yt({ key: void 0, report: void 0 }), Wn = /* @__PURE__ */ new WeakMap();
|
|
3470
|
-
function
|
|
3470
|
+
function Kd(e, t, n) {
|
|
3471
3471
|
const o = e.target;
|
|
3472
3472
|
if (e.button !== 0 || !(o instanceof Element)) return;
|
|
3473
3473
|
const r = o.closest("tr");
|
|
@@ -3477,8 +3477,8 @@ function Id(e, t, n) {
|
|
|
3477
3477
|
const i = Wn.get(r);
|
|
3478
3478
|
n(t(i), i);
|
|
3479
3479
|
}
|
|
3480
|
-
function
|
|
3481
|
-
const [t, n] =
|
|
3480
|
+
function Gd({ table: e }) {
|
|
3481
|
+
const [t, n] = G(null), o = Zs(), r = j(null);
|
|
3482
3482
|
ae(() => {
|
|
3483
3483
|
const i = e.current;
|
|
3484
3484
|
if (!i) return;
|
|
@@ -3557,7 +3557,7 @@ function fo(e, t, n) {
|
|
|
3557
3557
|
}
|
|
3558
3558
|
return e.setReveal({ key: t, column: n }), c || Cs(e), !0;
|
|
3559
3559
|
}
|
|
3560
|
-
function
|
|
3560
|
+
function jd(e, t, n) {
|
|
3561
3561
|
const o = e.cellFocus;
|
|
3562
3562
|
return !!o && o.columns.includes(n) && fo(e, t, n);
|
|
3563
3563
|
}
|
|
@@ -3583,7 +3583,7 @@ function Wd(e, t) {
|
|
|
3583
3583
|
});
|
|
3584
3584
|
}
|
|
3585
3585
|
function qd(e, t, n) {
|
|
3586
|
-
const o =
|
|
3586
|
+
const o = j(null);
|
|
3587
3587
|
ee(() => {
|
|
3588
3588
|
const r = t.current?.tBodies[0];
|
|
3589
3589
|
if (!r || !e.server) return;
|
|
@@ -3597,7 +3597,7 @@ function qd(e, t, n) {
|
|
|
3597
3597
|
});
|
|
3598
3598
|
}
|
|
3599
3599
|
function Ud(e) {
|
|
3600
|
-
const t =
|
|
3600
|
+
const t = j(null);
|
|
3601
3601
|
ee(() => {
|
|
3602
3602
|
const n = e.current, o = n?.tHead?.rows?.[n.tHead.rows.length - 1], r = o ? Array.from(o.cells) : [];
|
|
3603
3603
|
if (!n || r.length === 0) return;
|
|
@@ -3615,10 +3615,10 @@ function Ud(e) {
|
|
|
3615
3615
|
function Yd(e) {
|
|
3616
3616
|
ae(() => {
|
|
3617
3617
|
const t = e.current;
|
|
3618
|
-
if (!(!
|
|
3618
|
+
if (!(!Me || !t)) {
|
|
3619
3619
|
for (const n of Array.from(t.querySelectorAll(`tbody .${w.value}`))) {
|
|
3620
3620
|
if (n.scrollHeight <= n.clientHeight + 1) continue;
|
|
3621
|
-
const o = n.closest("td, th"), r = o?.parentElement ? Array.from(o.parentElement.children).indexOf(o) : -1, s =
|
|
3621
|
+
const o = n.closest("td, th"), r = o?.parentElement ? Array.from(o.parentElement.children).indexOf(o) : -1, s = Ot(t)?.cells[r]?.textContent?.trim() || `column ${r + 1}`;
|
|
3622
3622
|
te(
|
|
3623
3623
|
`taller-than-a-row:${s}`,
|
|
3624
3624
|
`a value in "${s}" is taller than a row and is cut at its edge. A row's height never follows what it shows (ADR-0042): draw it with a small control, or show it whole in the row's detail.`
|
|
@@ -3637,12 +3637,12 @@ function Yd(e) {
|
|
|
3637
3637
|
function Jd(e) {
|
|
3638
3638
|
ae(() => {
|
|
3639
3639
|
const t = e?.scrollRef.current;
|
|
3640
|
-
!
|
|
3640
|
+
!Me || !e || !t || e.count === 0 || e.from === 0 && e.to >= e.count && t.clientHeight > window.innerHeight && te("virtual-unbounded", "`virtual` renders every row because its scroll area has no bound. Give the table a `maxHeight`, or a parent of definite height.");
|
|
3641
3641
|
});
|
|
3642
3642
|
}
|
|
3643
3643
|
function Xd(e, t) {
|
|
3644
3644
|
ee(() => {
|
|
3645
|
-
const n =
|
|
3645
|
+
const n = Ot(t.current)?.getBoundingClientRect().height;
|
|
3646
3646
|
n && e.hook?.tableState.virtual && e.hook.tableState.setPitch(n);
|
|
3647
3647
|
});
|
|
3648
3648
|
}
|
|
@@ -3652,12 +3652,12 @@ function Zd(e) {
|
|
|
3652
3652
|
});
|
|
3653
3653
|
}
|
|
3654
3654
|
function Qd(e, t) {
|
|
3655
|
-
const n =
|
|
3655
|
+
const n = j(void 0);
|
|
3656
3656
|
ee(() => {
|
|
3657
3657
|
n.current !== t && (n.current = t, t != null && fo(e, t));
|
|
3658
3658
|
});
|
|
3659
3659
|
}
|
|
3660
|
-
const
|
|
3660
|
+
const Ft = (e, t) => e ? t : void 0;
|
|
3661
3661
|
function eu({
|
|
3662
3662
|
registry: e,
|
|
3663
3663
|
hook: t,
|
|
@@ -3665,14 +3665,14 @@ function eu({
|
|
|
3665
3665
|
drafting: o,
|
|
3666
3666
|
sticking: r
|
|
3667
3667
|
}) {
|
|
3668
|
-
const { selectable: s = !1, loading: i = !1, grid: a = !1 } = n, l = t.publicSnapshot, c = e.projection(), u = e.rowHeader(), d = Xr(e), h = e.detail, b = e.hasRowActions() ? e.actions.ordered() : [], m = t.tableState.virtual, p = l.grouping, g = p.length > 0 ? c.visibleLines : void 0, v = g ? e.groupingEntries(t.rows) : [], y = (se) => v.find((Z) => Z.spec.id === se), k = g && p.length > 1 ? y(p.at(-1)) : void 0, _ = g ? d.filter((se) => !p.includes(se.spec.id)) : d, x = c.entries, T = x ?
|
|
3669
|
-
start:
|
|
3670
|
-
end: H > 0 ? H + (
|
|
3671
|
-
count:
|
|
3668
|
+
const { selectable: s = !1, loading: i = !1, grid: a = !1 } = n, l = t.publicSnapshot, c = e.projection(), u = e.rowHeader(), d = Xr(e), h = e.detail, b = e.hasRowActions() ? e.actions.ordered() : [], m = t.tableState.virtual, p = l.grouping, g = p.length > 0 ? c.visibleLines : void 0, v = g ? e.groupingEntries(t.rows) : [], y = (se) => v.find((Z) => Z.spec.id === se), k = g && p.length > 1 ? y(p.at(-1)) : void 0, _ = g ? d.filter((se) => !p.includes(se.spec.id)) : d, x = c.entries, T = x ? Pd(x, t, l, _[0]) : void 0, N = h !== null && !x, R = (s ? 1 : 0) + (N ? 1 : 0), C = R + (k ? 1 : 0), L = a && n.editMode === "row", E = a && (L || n.onRowAdd !== void 0 || n.onRowDelete !== void 0), D = b.length > 0 || E, $ = C + _.length + (D ? 1 : 0), X = _.some((se) => se.spec.heading) ? 2 : 1, K = e.pins(), z = _.filter((se) => K[se.spec.id] === "start").length, H = _.filter((se) => K[se.spec.id] === "end").length, re = k !== void 0 && K[k.spec.id] === "start", A = b.length > 0 || n.onRowDelete !== void 0 || o, O = e.actionsPinned() ? A : o && E, B = {
|
|
3669
|
+
start: z > 0 || re ? C + z : 0,
|
|
3670
|
+
end: H > 0 ? H + (D ? 1 : 0) : D && O ? 1 : 0,
|
|
3671
|
+
count: $
|
|
3672
3672
|
}, Y = {
|
|
3673
|
-
start: r.start ?
|
|
3674
|
-
end: r.end || o &&
|
|
3675
|
-
count:
|
|
3673
|
+
start: r.start ? B.start : 0,
|
|
3674
|
+
end: r.end || o && E ? B.end : 0,
|
|
3675
|
+
count: $
|
|
3676
3676
|
}, ce = c.visible, U = e.paginates() && !m && !x, ie = m !== void 0 || U, he = l.server ? l.rowCount : Tr(c), de = c.visibleLines?.find((se) => se.kind !== "header" || !se.continued), ne = U ? c.lines && de && !l.server ? Math.max(0, c.lines.findIndex((se) => se === de || se.kind === "row" && de.kind === "row" && se.row === de.row)) : (c.page - 1) * l.pageSize : 0, Te = (l.server ? t.totals !== void 0 && t.error === void 0 : !i) && _.some((se) => se.spec.aggregate), me = l.search !== "" || Object.keys(l.filter).length > 0;
|
|
3677
3677
|
return {
|
|
3678
3678
|
snapshot: l,
|
|
@@ -3691,16 +3691,16 @@ function eu({
|
|
|
3691
3691
|
expanderColumn: N,
|
|
3692
3692
|
controlColumns: R,
|
|
3693
3693
|
leading: C,
|
|
3694
|
-
rowMode:
|
|
3695
|
-
rowTools:
|
|
3696
|
-
trailing:
|
|
3697
|
-
columnCount:
|
|
3694
|
+
rowMode: L,
|
|
3695
|
+
rowTools: E,
|
|
3696
|
+
trailing: D,
|
|
3697
|
+
columnCount: $,
|
|
3698
3698
|
headRows: X,
|
|
3699
3699
|
numbered: ie,
|
|
3700
3700
|
rowTotal: he,
|
|
3701
3701
|
pageStart: ne,
|
|
3702
|
-
pins:
|
|
3703
|
-
pinned:
|
|
3702
|
+
pins: K,
|
|
3703
|
+
pinned: B,
|
|
3704
3704
|
blocks: Y,
|
|
3705
3705
|
rows: ce,
|
|
3706
3706
|
footerShown: Te,
|
|
@@ -3711,7 +3711,7 @@ function eu({
|
|
|
3711
3711
|
}
|
|
3712
3712
|
function xs({ columns: e, rightAligned: t = [], rows: n = 4 }) {
|
|
3713
3713
|
const o = [72, 48, 60, 40, 56, 64];
|
|
3714
|
-
return /* @__PURE__ */ f(fe, { children: Array.from({ length: n }, (r, s) => /* @__PURE__ */ f("tr", { "aria-hidden": "true", children: Array.from({ length: e }, (i, a) => /* @__PURE__ */ f("td", { className:
|
|
3714
|
+
return /* @__PURE__ */ f(fe, { children: Array.from({ length: n }, (r, s) => /* @__PURE__ */ f("tr", { "aria-hidden": "true", children: Array.from({ length: e }, (i, a) => /* @__PURE__ */ f("td", { className: I(w.td, t[a] && w.numeric), children: /* @__PURE__ */ f("span", { className: w.skeleton, style: { width: `${o[(s + a) % o.length]}%` } }) }, a)) }, s)) });
|
|
3715
3715
|
}
|
|
3716
3716
|
const As = /* @__PURE__ */ yt(0);
|
|
3717
3717
|
function Un({ height: e, colSpan: t }) {
|
|
@@ -3722,7 +3722,7 @@ function Ts({
|
|
|
3722
3722
|
colSpan: t,
|
|
3723
3723
|
children: n
|
|
3724
3724
|
}) {
|
|
3725
|
-
const { count: o, fillerBefore: r, fillerAfter: s, showRow: i } = e, a =
|
|
3725
|
+
const { count: o, fillerBefore: r, fillerAfter: s, showRow: i } = e, a = j(null), [l, c] = G(0), u = (b, m) => {
|
|
3726
3726
|
a.current = m, c(m), i(m), requestAnimationFrame(() => {
|
|
3727
3727
|
b.querySelector(`[data-row="${m}"]`)?.focus();
|
|
3728
3728
|
});
|
|
@@ -3743,7 +3743,7 @@ function Ts({
|
|
|
3743
3743
|
const m = b.target.closest("[data-row]");
|
|
3744
3744
|
m && c(Number(m.dataset.row));
|
|
3745
3745
|
},
|
|
3746
|
-
children: /* @__PURE__ */
|
|
3746
|
+
children: /* @__PURE__ */ M(As, { value: d, children: [
|
|
3747
3747
|
/* @__PURE__ */ f(Un, { height: r, colSpan: t }),
|
|
3748
3748
|
n,
|
|
3749
3749
|
/* @__PURE__ */ f(Un, { height: s, colSpan: t })
|
|
@@ -3780,9 +3780,9 @@ function Ns({
|
|
|
3780
3780
|
trailing: _,
|
|
3781
3781
|
fresh: x = !1
|
|
3782
3782
|
}) {
|
|
3783
|
-
const T =
|
|
3784
|
-
return /* @__PURE__ */
|
|
3785
|
-
/* @__PURE__ */
|
|
3783
|
+
const T = $e(As), N = $e(uo), R = s.publicSnapshot, C = x ? Ee : s.rowKey(e), L = x ? p.newRow : tu(e, a, s, m, p), E = x ? Ee : ut(C), D = $e(St)?.editing, $ = D?.row === !0 && D.line === E, X = r.detail, K = x ? void 0 : v?.entry(e), z = x ? null : Ss(r, R, e, C, K), H = z !== null, re = z?.open ?? !1, A = z?.content, O = `${b}-detail-${t}`, { className: B, ...Y } = h?.(e) ?? {}, ce = n !== void 0, U = g ? g.span ?? g.parents.at(-1) : void 0, ie = X !== null && !v, he = (l ? 1 : 0) + (ie ? 1 : 0), de = he + (y ? 1 : 0), ne = (Z) => on(u, Z), Te = dn(i), me = K !== void 0 && K.branch && !K.empty, se = me && K.expanded && K.unloaded ? s.branchStatus.get(C) : void 0;
|
|
3784
|
+
return /* @__PURE__ */ M(fe, { children: [
|
|
3785
|
+
/* @__PURE__ */ M(
|
|
3786
3786
|
"tr",
|
|
3787
3787
|
{
|
|
3788
3788
|
...Y,
|
|
@@ -3790,43 +3790,43 @@ function Ns({
|
|
|
3790
3790
|
"aria-selected": k && l && !x ? s.isPicked(C) : void 0,
|
|
3791
3791
|
"aria-current": !x && N.key === C ? "true" : void 0,
|
|
3792
3792
|
"data-current": !x && N.key === C ? "" : void 0,
|
|
3793
|
-
className:
|
|
3794
|
-
|
|
3793
|
+
className: I(
|
|
3794
|
+
B,
|
|
3795
3795
|
ce && w.virtualRow,
|
|
3796
|
-
|
|
3796
|
+
K && w.treeRow,
|
|
3797
3797
|
me && w.branchRow,
|
|
3798
|
-
|
|
3798
|
+
K?.pathOnly && w.pathRow
|
|
3799
3799
|
),
|
|
3800
|
-
"data-before-root":
|
|
3800
|
+
"data-before-root": K && !re && v?.beforeRoot(C) ? "" : void 0,
|
|
3801
3801
|
"data-row": ce ? n : void 0,
|
|
3802
3802
|
"data-line": g ? "row" : void 0,
|
|
3803
3803
|
"data-motion": C,
|
|
3804
3804
|
"data-selected": l && s.isPicked(C) ? "" : void 0,
|
|
3805
3805
|
"data-group-first": g?.first ? "" : void 0,
|
|
3806
3806
|
"data-group": U?.path,
|
|
3807
|
-
"aria-level": g ? g.parents.length + 1 :
|
|
3808
|
-
"aria-posinset": U ? U.rows.indexOf(e) + 1 :
|
|
3809
|
-
"aria-setsize": U ? U.rows.length :
|
|
3810
|
-
"aria-expanded": me ?
|
|
3807
|
+
"aria-level": g ? g.parents.length + 1 : K ? K.level + 1 : void 0,
|
|
3808
|
+
"aria-posinset": U ? U.rows.indexOf(e) + 1 : K?.position,
|
|
3809
|
+
"aria-setsize": U ? U.rows.length : K?.siblings,
|
|
3810
|
+
"aria-expanded": me ? K.expanded : void 0,
|
|
3811
3811
|
"aria-busy": se === null ? !0 : void 0,
|
|
3812
|
-
"data-branch": me ?
|
|
3812
|
+
"data-branch": me ? K.expanded ? "open" : "closed" : void 0,
|
|
3813
3813
|
tabIndex: ce && !k ? n === T ? 0 : -1 : void 0,
|
|
3814
|
-
"data-grid-line": k ?
|
|
3815
|
-
"data-draft":
|
|
3814
|
+
"data-grid-line": k ? E : void 0,
|
|
3815
|
+
"data-draft": $ ? "" : void 0,
|
|
3816
3816
|
"data-even": ce && n % 2 === 1 ? "" : void 0,
|
|
3817
3817
|
"aria-rowindex": o,
|
|
3818
3818
|
children: [
|
|
3819
|
-
x && Array.from({ length: he + (y ? 1 : 0) }, (Z,
|
|
3819
|
+
x && Array.from({ length: he + (y ? 1 : 0) }, (Z, Oe) => /* @__PURE__ */ f("td", { className: I(w.td, Oe < he && w.control, ne(Oe).className), style: ne(Oe).style }, Oe)),
|
|
3820
3820
|
!x && l && /* @__PURE__ */ f(
|
|
3821
3821
|
"td",
|
|
3822
3822
|
{
|
|
3823
|
-
className:
|
|
3823
|
+
className: I(w.td, w.control, ne(0).className),
|
|
3824
3824
|
style: ne(0).style,
|
|
3825
3825
|
onMouseDown: (Z) => Z.shiftKey && Z.preventDefault(),
|
|
3826
3826
|
children: /* @__PURE__ */ f(
|
|
3827
3827
|
ct,
|
|
3828
3828
|
{
|
|
3829
|
-
"aria-label": p.selectRow(
|
|
3829
|
+
"aria-label": p.selectRow(L),
|
|
3830
3830
|
checked: s.isPicked(C),
|
|
3831
3831
|
onChange: (Z) => s.pick(C, Z.nativeEvent.shiftKey === !0),
|
|
3832
3832
|
onKeyDown: (Z) => {
|
|
@@ -3837,20 +3837,20 @@ function Ns({
|
|
|
3837
3837
|
)
|
|
3838
3838
|
}
|
|
3839
3839
|
),
|
|
3840
|
-
!x && ie && /* @__PURE__ */ f("td", { className:
|
|
3840
|
+
!x && ie && /* @__PURE__ */ f("td", { className: I(w.td, w.control, ne(he - 1).className), style: ne(he - 1).style, children: H && /* @__PURE__ */ f(
|
|
3841
3841
|
"button",
|
|
3842
3842
|
{
|
|
3843
3843
|
type: "button",
|
|
3844
3844
|
"aria-expanded": re,
|
|
3845
|
-
"aria-controls": re ?
|
|
3846
|
-
"aria-label": re ? p.collapseRowNamed(
|
|
3847
|
-
className:
|
|
3845
|
+
"aria-controls": re ? O : void 0,
|
|
3846
|
+
"aria-label": re ? p.collapseRowNamed(L) : p.expandRowNamed(L),
|
|
3847
|
+
className: I(w.expander, re && w.expanderOpen),
|
|
3848
3848
|
onClick: () => R.toggleRow(C),
|
|
3849
3849
|
children: /* @__PURE__ */ f(An, {})
|
|
3850
3850
|
}
|
|
3851
3851
|
) }),
|
|
3852
3852
|
g && g.span && /* @__PURE__ */ f(
|
|
3853
|
-
|
|
3853
|
+
Ed,
|
|
3854
3854
|
{
|
|
3855
3855
|
line: { ...g, span: g.span },
|
|
3856
3856
|
entry: y,
|
|
@@ -3861,33 +3861,33 @@ function Ns({
|
|
|
3861
3861
|
wording: p
|
|
3862
3862
|
}
|
|
3863
3863
|
),
|
|
3864
|
-
i.map((Z,
|
|
3864
|
+
i.map((Z, Oe) => /* @__PURE__ */ f(
|
|
3865
3865
|
ou,
|
|
3866
3866
|
{
|
|
3867
3867
|
entry: Z,
|
|
3868
3868
|
row: e,
|
|
3869
3869
|
kind: r.kindOf(Z, s.rows),
|
|
3870
3870
|
format: r.shownFormat(Z, s.rows, m.timeZone),
|
|
3871
|
-
pin:
|
|
3871
|
+
pin: Mt(ne(de + Oe), Te.has(Z)),
|
|
3872
3872
|
formats: m,
|
|
3873
3873
|
wording: p,
|
|
3874
|
-
line:
|
|
3874
|
+
line: E,
|
|
3875
3875
|
isCurrent: !x && N.key === C,
|
|
3876
|
-
rowName:
|
|
3876
|
+
rowName: L,
|
|
3877
3877
|
width: R.widths[Z.spec.id],
|
|
3878
|
-
tree:
|
|
3878
|
+
tree: K && Z === v?.column ? { setup: v, entry: K, detail: H && !me ? { open: re, toggle: () => R.toggleRow(C) } : void 0 } : void 0
|
|
3879
3879
|
},
|
|
3880
3880
|
Z.key
|
|
3881
3881
|
)),
|
|
3882
3882
|
_ && /* @__PURE__ */ f(
|
|
3883
3883
|
nu,
|
|
3884
3884
|
{
|
|
3885
|
-
draft:
|
|
3885
|
+
draft: $,
|
|
3886
3886
|
actions: x ? [] : c,
|
|
3887
3887
|
row: e,
|
|
3888
|
-
name:
|
|
3888
|
+
name: L,
|
|
3889
3889
|
wording: p,
|
|
3890
|
-
line:
|
|
3890
|
+
line: E,
|
|
3891
3891
|
pin: ne(d - 1)
|
|
3892
3892
|
}
|
|
3893
3893
|
)
|
|
@@ -3902,11 +3902,11 @@ function Ns({
|
|
|
3902
3902
|
gridLine: void 0,
|
|
3903
3903
|
beforeRoot: void 0,
|
|
3904
3904
|
colSpan: d,
|
|
3905
|
-
entry:
|
|
3906
|
-
children: /* @__PURE__ */ f("div", { className: w.branchLine, children: se === null ? /* @__PURE__ */
|
|
3905
|
+
entry: K,
|
|
3906
|
+
children: /* @__PURE__ */ f("div", { className: w.branchLine, children: se === null ? /* @__PURE__ */ M("span", { role: "status", className: w.branchLoading, children: [
|
|
3907
3907
|
/* @__PURE__ */ f(Qs, { size: 14, "aria-hidden": "true" }),
|
|
3908
|
-
p.branchLoading(
|
|
3909
|
-
] }) : /* @__PURE__ */
|
|
3908
|
+
p.branchLoading(L)
|
|
3909
|
+
] }) : /* @__PURE__ */ M(fe, { children: [
|
|
3910
3910
|
/* @__PURE__ */ f("span", { role: "alert", children: se }),
|
|
3911
3911
|
/* @__PURE__ */ f(ue, { size: "sm", variant: "ghost", onClick: () => s.retryBranch(C), children: p.tryAgain })
|
|
3912
3912
|
] }) })
|
|
@@ -3915,12 +3915,12 @@ function Ns({
|
|
|
3915
3915
|
re && /* @__PURE__ */ f(
|
|
3916
3916
|
ir,
|
|
3917
3917
|
{
|
|
3918
|
-
id:
|
|
3918
|
+
id: O,
|
|
3919
3919
|
group: U?.path,
|
|
3920
3920
|
gridLine: k ? `detail:${C}` : void 0,
|
|
3921
|
-
beforeRoot:
|
|
3921
|
+
beforeRoot: K && v?.beforeRoot(C) ? "" : void 0,
|
|
3922
3922
|
colSpan: d,
|
|
3923
|
-
entry:
|
|
3923
|
+
entry: K,
|
|
3924
3924
|
children: A
|
|
3925
3925
|
}
|
|
3926
3926
|
)
|
|
@@ -3935,7 +3935,7 @@ function nu({
|
|
|
3935
3935
|
line: s,
|
|
3936
3936
|
pin: i
|
|
3937
3937
|
}) {
|
|
3938
|
-
return /* @__PURE__ */ f("td", { className:
|
|
3938
|
+
return /* @__PURE__ */ f("td", { className: I(w.td, w.actionsCell, i.className, e && w.editing), style: i.style, children: e ? /* @__PURE__ */ M(fe, { children: [
|
|
3939
3939
|
/* @__PURE__ */ f(fd, { name: o, wording: r }),
|
|
3940
3940
|
/* @__PURE__ */ f("span", { className: w.held, "aria-hidden": "true", children: /* @__PURE__ */ f(er, { actions: t, row: n, name: o, wording: r, line: s }) })
|
|
3941
3941
|
] }) : /* @__PURE__ */ f(er, { actions: t, row: n, name: o, wording: r, line: s }) });
|
|
@@ -3953,7 +3953,7 @@ function ir({
|
|
|
3953
3953
|
"td",
|
|
3954
3954
|
{
|
|
3955
3955
|
colSpan: r,
|
|
3956
|
-
className:
|
|
3956
|
+
className: I(w.detailCell, s && w.treeDetail),
|
|
3957
3957
|
style: s ? { "--_table-tree-level": s.level } : void 0,
|
|
3958
3958
|
children: s ? /* @__PURE__ */ f("div", { className: w.treeDetailRail, children: i }) : i
|
|
3959
3959
|
}
|
|
@@ -3973,28 +3973,28 @@ function ou({
|
|
|
3973
3973
|
tree: u,
|
|
3974
3974
|
width: d
|
|
3975
3975
|
}) {
|
|
3976
|
-
const { spec: h } = e, b = e.read(t), m = Qn(n, h.rightAligned), p = id(a, h.id), g =
|
|
3976
|
+
const { spec: h } = e, b = e.read(t), m = Qn(n, h.rightAligned), p = id(a, h.id), g = $e(St) !== null, v = !g || h.edit === void 0 ? void 0 : h.edit === "text" || h.edit === "number" ? "type" : "pick";
|
|
3977
3977
|
let y;
|
|
3978
3978
|
ge(b) ? y = /* @__PURE__ */ f(ws, { wording: i }) : h.presentation ? y = h.presentation(b, t) : y = ft(b, o, s, i);
|
|
3979
3979
|
const k = typeof y == "string";
|
|
3980
3980
|
y = /* @__PURE__ */ f(
|
|
3981
3981
|
"div",
|
|
3982
3982
|
{
|
|
3983
|
-
className:
|
|
3983
|
+
className: I(w.value, k && w.valueText, d !== void 0 && w.sized, p && w.editingValue),
|
|
3984
3984
|
style: d !== void 0 ? { "--_table-width": `${d}px` } : void 0,
|
|
3985
3985
|
"aria-hidden": p ? !0 : void 0,
|
|
3986
3986
|
children: y
|
|
3987
3987
|
}
|
|
3988
3988
|
);
|
|
3989
|
-
const _ =
|
|
3990
|
-
h.rowHeader && _ && !g && (y = /* @__PURE__ */ f("button", { type: "button", className: w.rowButton, "aria-current": l ? "true" : void 0, onClick: () => _(t), children: y })), u && (y = /* @__PURE__ */ f(
|
|
3989
|
+
const _ = $e(uo).report;
|
|
3990
|
+
h.rowHeader && _ && !g && (y = /* @__PURE__ */ f("button", { type: "button", className: w.rowButton, "aria-current": l ? "true" : void 0, onClick: () => _(t), children: y })), u && (y = /* @__PURE__ */ f(Fd, { ...u, name: c, wording: i, children: y }));
|
|
3991
3991
|
const x = h.rowHeader ? "th" : "td";
|
|
3992
|
-
return /* @__PURE__ */
|
|
3992
|
+
return /* @__PURE__ */ M(
|
|
3993
3993
|
x,
|
|
3994
3994
|
{
|
|
3995
3995
|
scope: h.rowHeader ? "row" : void 0,
|
|
3996
3996
|
"aria-label": h.rowHeader && u ? c : void 0,
|
|
3997
|
-
className:
|
|
3997
|
+
className: I(w.td, m && w.numeric, h.rowHeader && w.rowHeader, r.className, p && w.editing),
|
|
3998
3998
|
style: r.style,
|
|
3999
3999
|
"data-edit": v,
|
|
4000
4000
|
"data-editing": p ? h.id : void 0,
|
|
@@ -4063,10 +4063,10 @@ function ru(e, t) {
|
|
|
4063
4063
|
grid: !0,
|
|
4064
4064
|
ariaRow: r.numbered ? r.headRows + 1 : void 0
|
|
4065
4065
|
},
|
|
4066
|
-
|
|
4066
|
+
Ee
|
|
4067
4067
|
) });
|
|
4068
4068
|
}
|
|
4069
|
-
function
|
|
4069
|
+
function Es(e) {
|
|
4070
4070
|
const { registry: t, hook: n, layout: o } = e;
|
|
4071
4071
|
return [
|
|
4072
4072
|
...Array.from({ length: o.controlColumns + (o.spanEntry ? 1 : 0) }, () => !1),
|
|
@@ -4080,18 +4080,18 @@ function su(e) {
|
|
|
4080
4080
|
{
|
|
4081
4081
|
columns: t.columnCount,
|
|
4082
4082
|
rows: e.pageSize ? e.heldLines || e.pageSize : void 0,
|
|
4083
|
-
rightAligned:
|
|
4083
|
+
rightAligned: Es(e)
|
|
4084
4084
|
}
|
|
4085
4085
|
) });
|
|
4086
4086
|
}
|
|
4087
4087
|
function iu(e, t, n) {
|
|
4088
|
-
return /* @__PURE__ */ f("tbody", { children: /* @__PURE__ */ f("tr", { "data-grid-line":
|
|
4088
|
+
return /* @__PURE__ */ f("tbody", { children: /* @__PURE__ */ f("tr", { "data-grid-line": Ft(e.gridMode, "error"), children: /* @__PURE__ */ f(
|
|
4089
4089
|
"td",
|
|
4090
4090
|
{
|
|
4091
4091
|
colSpan: e.layout.columnCount,
|
|
4092
4092
|
className: w.emptyCell,
|
|
4093
4093
|
style: e.pageSize && e.heldLines ? { height: `calc(var(--_table-pitch) * ${e.heldLines})`, verticalAlign: "top" } : void 0,
|
|
4094
|
-
children: /* @__PURE__ */
|
|
4094
|
+
children: /* @__PURE__ */ M("div", { className: w.empty, children: [
|
|
4095
4095
|
/* @__PURE__ */ f("p", { role: "alert", className: w.emptyTitle, children: t }),
|
|
4096
4096
|
/* @__PURE__ */ f(ue, { size: "sm", variant: "ghost", onClick: n, children: e.wording.tryAgain })
|
|
4097
4097
|
] })
|
|
@@ -4100,13 +4100,13 @@ function iu(e, t, n) {
|
|
|
4100
4100
|
}
|
|
4101
4101
|
function au(e) {
|
|
4102
4102
|
const { hook: t, layout: n, wording: o } = e, { snapshot: r } = n;
|
|
4103
|
-
return /* @__PURE__ */ f("tbody", { children: /* @__PURE__ */ f("tr", { "data-grid-line":
|
|
4103
|
+
return /* @__PURE__ */ f("tbody", { children: /* @__PURE__ */ f("tr", { "data-grid-line": Ft(e.gridMode, "empty"), children: /* @__PURE__ */ f(
|
|
4104
4104
|
"td",
|
|
4105
4105
|
{
|
|
4106
4106
|
colSpan: n.columnCount,
|
|
4107
4107
|
className: w.emptyCell,
|
|
4108
4108
|
style: e.pageSize && e.heldLines ? { height: `calc(var(--_table-pitch) * ${e.heldLines})`, verticalAlign: "top" } : void 0,
|
|
4109
|
-
children: /* @__PURE__ */ f("div", { className: w.empty, children: (r.server || t.admitted.length > 0) && n.restricted ? /* @__PURE__ */
|
|
4109
|
+
children: /* @__PURE__ */ f("div", { className: w.empty, children: (r.server || t.admitted.length > 0) && n.restricted ? /* @__PURE__ */ M(fe, { children: [
|
|
4110
4110
|
/* @__PURE__ */ f("p", { className: w.emptyTitle, children: o.nothingMatchesFilters }),
|
|
4111
4111
|
/* @__PURE__ */ f(ue, { size: "sm", variant: "ghost", onClick: () => Zr(r), children: o.resetAll })
|
|
4112
4112
|
] }) : e.empty ?? /* @__PURE__ */ f("p", { className: w.emptyTitle, children: o.noEntries }) })
|
|
@@ -4115,7 +4115,7 @@ function au(e) {
|
|
|
4115
4115
|
}
|
|
4116
4116
|
function lu(e, t) {
|
|
4117
4117
|
const { hook: n, layout: o, wording: r, formats: s } = e, { virtual: i, grouping: a, projection: l } = o, c = i ? Ar(t).map((m) => m.kind === "folded" || !m.continued ? m : { ...m, continued: !1 }) : t, u = c.length - t.length, d = i && i.from > 0 ? i.fillerBefore / i.from : 0, h = (m, p, g, v, y) => /* @__PURE__ */ f(
|
|
4118
|
-
|
|
4118
|
+
Md,
|
|
4119
4119
|
{
|
|
4120
4120
|
line: m,
|
|
4121
4121
|
index: g,
|
|
@@ -4154,7 +4154,7 @@ function lu(e, t) {
|
|
|
4154
4154
|
colSpan: o.columnCount,
|
|
4155
4155
|
children: c.map(b)
|
|
4156
4156
|
}
|
|
4157
|
-
) : /* @__PURE__ */
|
|
4157
|
+
) : /* @__PURE__ */ M("tbody", { children: [
|
|
4158
4158
|
t.map(b),
|
|
4159
4159
|
e.filler
|
|
4160
4160
|
] });
|
|
@@ -4175,16 +4175,16 @@ function du(e, t, n) {
|
|
|
4175
4175
|
if (n && r.server && e.pageSize) {
|
|
4176
4176
|
const u = l.slice(0, e.pageSize), d = Math.min(e.pageSize, s.publicSnapshot.rowCount - (c.page - 1) * e.pageSize), h = Math.max(0, d - u.length);
|
|
4177
4177
|
return {
|
|
4178
|
-
body: /* @__PURE__ */
|
|
4178
|
+
body: /* @__PURE__ */ M("tbody", { children: [
|
|
4179
4179
|
u.map((b, m) => Qt(e, b, m, m)),
|
|
4180
|
-
/* @__PURE__ */ f(xs, { columns: o.columnCount, rows: h, rightAligned:
|
|
4180
|
+
/* @__PURE__ */ f(xs, { columns: o.columnCount, rows: h, rightAligned: Es(e) }),
|
|
4181
4181
|
h ? null : e.filler
|
|
4182
4182
|
] }),
|
|
4183
4183
|
empty: !1
|
|
4184
4184
|
};
|
|
4185
4185
|
}
|
|
4186
4186
|
return {
|
|
4187
|
-
body: /* @__PURE__ */
|
|
4187
|
+
body: /* @__PURE__ */ M("tbody", { children: [
|
|
4188
4188
|
l.map((u, d) => Qt(e, u, d, d)),
|
|
4189
4189
|
e.filler
|
|
4190
4190
|
] }),
|
|
@@ -4199,53 +4199,53 @@ function ar({
|
|
|
4199
4199
|
}) {
|
|
4200
4200
|
const { spec: r } = e, s = n.publicSnapshot, i = t.kindOf(e, n.rows), a = Qn(i, r.rightAligned), l = t.isSortable(e, n.rows), c = r.id, u = s.sort.findIndex((R) => R.column === c), d = u === -1 ? void 0 : s.sort[u].direction, h = s.sort.length > 1 && u !== -1 ? u + 1 : void 0, b = s.widths[c], m = 48, p = r.flex !== void 0 && b === void 0, g = (R) => {
|
|
4201
4201
|
R.stopPropagation(), R.preventDefault();
|
|
4202
|
-
const C = R.currentTarget,
|
|
4203
|
-
if (!
|
|
4204
|
-
const
|
|
4205
|
-
C.setPointerCapture(
|
|
4206
|
-
const
|
|
4207
|
-
|
|
4202
|
+
const C = R.currentTarget, L = C.closest("th");
|
|
4203
|
+
if (!L) return;
|
|
4204
|
+
const E = R.clientX, D = L.getBoundingClientRect().width, $ = R.pointerId, X = s.widths[c], K = Math.max(m, r.flex !== void 0 ? r.minWidth ?? 0 : 0);
|
|
4205
|
+
C.setPointerCapture($);
|
|
4206
|
+
const z = (O) => {
|
|
4207
|
+
O.pointerId === $ && s.setWidth(c, Math.max(K, D + (O.clientX - E)));
|
|
4208
4208
|
}, H = () => {
|
|
4209
|
-
C.removeEventListener("pointermove",
|
|
4210
|
-
}, re = (
|
|
4211
|
-
|
|
4212
|
-
}, A = (
|
|
4213
|
-
|
|
4209
|
+
C.removeEventListener("pointermove", z), C.removeEventListener("pointerup", re), C.removeEventListener("pointercancel", re), document.removeEventListener("keydown", A, !0), C.hasPointerCapture($) && C.releasePointerCapture($);
|
|
4210
|
+
}, re = (O) => {
|
|
4211
|
+
O.pointerId === $ && H();
|
|
4212
|
+
}, A = (O) => {
|
|
4213
|
+
O.key === "Escape" && (O.stopPropagation(), s.setWidth(c, X), H());
|
|
4214
4214
|
};
|
|
4215
|
-
C.addEventListener("pointermove",
|
|
4215
|
+
C.addEventListener("pointermove", z), C.addEventListener("pointerup", re), C.addEventListener("pointercancel", re), document.addEventListener("keydown", A, !0);
|
|
4216
4216
|
}, v = (R) => {
|
|
4217
|
-
const C = R ?
|
|
4217
|
+
const C = R ? Fr(R) : 0;
|
|
4218
4218
|
C > 0 && s.setWidth(c, Math.max(m, C + 1));
|
|
4219
4219
|
}, y = (R) => {
|
|
4220
4220
|
if (!r.resizable || !R.altKey) return;
|
|
4221
|
-
const C = R.key === "ArrowRight",
|
|
4222
|
-
if (!C && !
|
|
4221
|
+
const C = R.key === "ArrowRight", L = R.key === "ArrowLeft", E = R.key === "Home";
|
|
4222
|
+
if (!C && !L && !E) return;
|
|
4223
4223
|
R.preventDefault();
|
|
4224
|
-
const
|
|
4225
|
-
if (
|
|
4226
|
-
v(
|
|
4224
|
+
const D = R.currentTarget;
|
|
4225
|
+
if (E) {
|
|
4226
|
+
v(D);
|
|
4227
4227
|
return;
|
|
4228
4228
|
}
|
|
4229
|
-
const
|
|
4230
|
-
s.setWidth(c, Math.max(m,
|
|
4231
|
-
}, k = ei(), _ = /* @__PURE__ */
|
|
4229
|
+
const $ = D.getBoundingClientRect().width, X = R.shiftKey ? 32 : 8;
|
|
4230
|
+
s.setWidth(c, Math.max(m, $ + (C ? X : -X)));
|
|
4231
|
+
}, k = ei(), _ = /* @__PURE__ */ M(fe, { children: [
|
|
4232
4232
|
r.label,
|
|
4233
|
-
k !== null && Zn(r.format) && /* @__PURE__ */
|
|
4233
|
+
k !== null && Zn(r.format) && /* @__PURE__ */ M("span", { className: w.zoneLabel, children: [
|
|
4234
4234
|
" ",
|
|
4235
4235
|
k
|
|
4236
4236
|
] })
|
|
4237
|
-
] }), x = l ? /* @__PURE__ */
|
|
4237
|
+
] }), x = l ? /* @__PURE__ */ M(
|
|
4238
4238
|
"button",
|
|
4239
4239
|
{
|
|
4240
4240
|
type: "button",
|
|
4241
|
-
className:
|
|
4241
|
+
className: I(w.sortButton, w.headLine),
|
|
4242
4242
|
onClick: (R) => {
|
|
4243
4243
|
t.markSorted(c), s.toggleSort(c, R.shiftKey || R.metaKey);
|
|
4244
4244
|
},
|
|
4245
4245
|
children: [
|
|
4246
4246
|
/* @__PURE__ */ f("span", { className: w.headLabel, children: _ }),
|
|
4247
4247
|
h !== void 0 && /* @__PURE__ */ f("span", { className: w.sortRank, "aria-hidden": "true", children: h }),
|
|
4248
|
-
/* @__PURE__ */ f("span", { className:
|
|
4248
|
+
/* @__PURE__ */ f("span", { className: I(w.sortIndicator, d && w.sortActive), "aria-hidden": "true", children: d ? /* @__PURE__ */ f("svg", { viewBox: "0 0 10 10", width: "10", height: "10", "aria-hidden": "true", className: I(w.sortArrow, d === "desc" && w.sortArrowDesc), children: /* @__PURE__ */ f("path", { d: "M2.2 6.2 5 3.4l2.8 2.8", fill: "none", stroke: "currentColor", strokeWidth: "1.4", strokeLinecap: "round", strokeLinejoin: "round" }) }) : (
|
|
4249
4249
|
/* Drawn in the nominal box and set in the 12 pixels the indicator
|
|
4250
4250
|
takes, so that the head does not move. */
|
|
4251
4251
|
/* @__PURE__ */ f("svg", { viewBox: "0 0 10 10", width: "10", height: "12", "aria-hidden": "true", children: /* @__PURE__ */ f("path", { d: "M2.8 3.7 5 1.5l2.2 2.2M2.8 6.3 5 8.5l2.2-2.2", fill: "none", stroke: "currentColor", strokeWidth: "1.4", strokeLinecap: "round", strokeLinejoin: "round" }) })
|
|
@@ -4253,7 +4253,7 @@ function ar({
|
|
|
4253
4253
|
]
|
|
4254
4254
|
}
|
|
4255
4255
|
) : /* @__PURE__ */ f("span", { className: w.headLine, children: /* @__PURE__ */ f("span", { className: w.headLabel, children: _ }) }), T = d === "asc" ? "ascending" : d === "desc" ? "descending" : "none", N = nt(r.filter) !== void 0 && !(r.filter === "list" && i === "other");
|
|
4256
|
-
return /* @__PURE__ */
|
|
4256
|
+
return /* @__PURE__ */ M(
|
|
4257
4257
|
"th",
|
|
4258
4258
|
{
|
|
4259
4259
|
scope: "col",
|
|
@@ -4262,14 +4262,14 @@ function ar({
|
|
|
4262
4262
|
tabIndex: r.resizable && !l ? 0 : void 0,
|
|
4263
4263
|
onKeyDown: y,
|
|
4264
4264
|
"data-flex": p ? r.flex : void 0,
|
|
4265
|
-
className:
|
|
4265
|
+
className: I(w.th, a && w.numeric, b !== void 0 && w.sized, o.className),
|
|
4266
4266
|
style: {
|
|
4267
4267
|
...b !== void 0 ? { width: b } : {},
|
|
4268
4268
|
...p && r.minWidth !== void 0 ? { minWidth: r.minWidth } : {},
|
|
4269
4269
|
...o.style
|
|
4270
4270
|
},
|
|
4271
4271
|
children: [
|
|
4272
|
-
N ? /* @__PURE__ */
|
|
4272
|
+
N ? /* @__PURE__ */ M("span", { className: w.thFlex, children: [
|
|
4273
4273
|
x,
|
|
4274
4274
|
/* @__PURE__ */ f(hd, { entry: e, registry: t, hook: n })
|
|
4275
4275
|
] }) : x,
|
|
@@ -4303,17 +4303,17 @@ function uu({
|
|
|
4303
4303
|
C && C.heading?.id === T.spec.heading?.id && C.side === R ? C.to = N : k.push({ heading: T.spec.heading, side: R, from: N, to: N });
|
|
4304
4304
|
});
|
|
4305
4305
|
const _ = c.some((T) => T.spec.heading), x = dn(c);
|
|
4306
|
-
return /* @__PURE__ */
|
|
4307
|
-
_ && /* @__PURE__ */
|
|
4308
|
-
h > 0 && /* @__PURE__ */ f("td", { ...Sn, colSpan: h, className:
|
|
4306
|
+
return /* @__PURE__ */ M("thead", { children: [
|
|
4307
|
+
_ && /* @__PURE__ */ M("tr", { "data-head-group": "", "aria-rowindex": n.numbered ? 1 : void 0, "data-grid-line": Ft(i, en), children: [
|
|
4308
|
+
h > 0 && /* @__PURE__ */ f("td", { ...Sn, colSpan: h, className: I(w.th, y(0, h - 1).className), style: y(0, h - 1).style }),
|
|
4309
4309
|
k.map(({ heading: T, from: N, to: R }) => {
|
|
4310
|
-
const C =
|
|
4311
|
-
return T ? /* @__PURE__ */ f("th", { scope: "colgroup", colSpan: R - N + 1, className:
|
|
4310
|
+
const C = Mt(y(h + N, h + R), x.has(c[N])), L = I(w.th, T && w.headGroup, C.className);
|
|
4311
|
+
return T ? /* @__PURE__ */ f("th", { scope: "colgroup", colSpan: R - N + 1, className: L, style: C.style, children: T.label }, N) : /* @__PURE__ */ f("td", { ...Sn, colSpan: R - N + 1, className: L, style: C.style }, N);
|
|
4312
4312
|
}),
|
|
4313
|
-
p && /* @__PURE__ */ f("td", { ...Sn, className:
|
|
4313
|
+
p && /* @__PURE__ */ f("td", { ...Sn, className: I(w.th, y(g - 1).className), style: y(g - 1).style })
|
|
4314
4314
|
] }),
|
|
4315
|
-
/* @__PURE__ */
|
|
4316
|
-
s && /* @__PURE__ */ f("th", { scope: "col", className:
|
|
4315
|
+
/* @__PURE__ */ M("tr", { "aria-rowindex": n.numbered ? _ ? 2 : 1 : void 0, "data-grid-line": Ft(i, "head"), children: [
|
|
4316
|
+
s && /* @__PURE__ */ f("th", { scope: "col", className: I(w.th, w.control, y(0).className), style: y(0).style, children: /* @__PURE__ */ f(
|
|
4317
4317
|
ct,
|
|
4318
4318
|
{
|
|
4319
4319
|
"aria-label": a.server ? r.selectAllOnPage : r.selectAllRows,
|
|
@@ -4325,26 +4325,26 @@ function uu({
|
|
|
4325
4325
|
u && /* @__PURE__ */ f(
|
|
4326
4326
|
"td",
|
|
4327
4327
|
{
|
|
4328
|
-
className:
|
|
4328
|
+
className: I(w.th, w.control, y(d - 1).className),
|
|
4329
4329
|
style: y(d - 1).style
|
|
4330
4330
|
}
|
|
4331
4331
|
),
|
|
4332
|
-
l && (e.columnById(l.spec.id) === l ? /* @__PURE__ */ f(ar, { entry: l, registry: e, hook: t, pin: y(d) }) : /* @__PURE__ */ f("th", { scope: "col", className:
|
|
4333
|
-
c.map((T, N) => /* @__PURE__ */ f(ar, { entry: T, registry: e, hook: t, pin:
|
|
4334
|
-
p && /* @__PURE__ */
|
|
4332
|
+
l && (e.columnById(l.spec.id) === l ? /* @__PURE__ */ f(ar, { entry: l, registry: e, hook: t, pin: y(d) }) : /* @__PURE__ */ f("th", { scope: "col", className: I(w.th, y(d).className), style: y(d).style, children: l.spec.label })),
|
|
4333
|
+
c.map((T, N) => /* @__PURE__ */ f(ar, { entry: T, registry: e, hook: t, pin: Mt(y(h + N), x.has(T)) }, T.key)),
|
|
4334
|
+
p && /* @__PURE__ */ M(
|
|
4335
4335
|
"th",
|
|
4336
4336
|
{
|
|
4337
4337
|
scope: "col",
|
|
4338
|
-
className:
|
|
4338
|
+
className: I(w.th, w.actionsCell, y(g - 1).className),
|
|
4339
4339
|
style: y(g - 1).style,
|
|
4340
4340
|
children: [
|
|
4341
4341
|
/* @__PURE__ */ f(He, { children: r.rowActions }),
|
|
4342
|
-
m && /* @__PURE__ */
|
|
4343
|
-
(b || o.onRowAdd) && /* @__PURE__ */
|
|
4342
|
+
m && /* @__PURE__ */ M("span", { className: w.reserve, "aria-hidden": "true", children: [
|
|
4343
|
+
(b || o.onRowAdd) && /* @__PURE__ */ M("span", { className: I(w.actions, w.decision), children: [
|
|
4344
4344
|
/* @__PURE__ */ f(ue, { tabIndex: -1, size: "sm", children: r.saveRow }),
|
|
4345
4345
|
/* @__PURE__ */ f(ue, { tabIndex: -1, size: "sm", children: r.discardRow })
|
|
4346
4346
|
] }),
|
|
4347
|
-
o.onRowDelete && /* @__PURE__ */
|
|
4347
|
+
o.onRowDelete && /* @__PURE__ */ M("span", { className: I(w.actions, w.decision), children: [
|
|
4348
4348
|
/* @__PURE__ */ f("span", { className: w.deleteAsk, children: r.deleteRowAsk }),
|
|
4349
4349
|
/* @__PURE__ */ f(ue, { tabIndex: -1, size: "sm", children: r.deleteRow }),
|
|
4350
4350
|
/* @__PURE__ */ f(ue, { tabIndex: -1, size: "sm", children: r.keepRow })
|
|
@@ -4363,9 +4363,9 @@ function fu({
|
|
|
4363
4363
|
wording: o
|
|
4364
4364
|
}) {
|
|
4365
4365
|
const { projection: r, spanEntry: s, dataColumns: i, controlColumns: a, leading: l, trailing: c, columnCount: u, blocks: d } = e, h = (m, p = m) => on(d, m, p), b = dn(i);
|
|
4366
|
-
return /* @__PURE__ */ f("tfoot", { children: /* @__PURE__ */
|
|
4367
|
-
Array.from({ length: a }, (m, p) => /* @__PURE__ */ f("td", { className:
|
|
4368
|
-
s && /* @__PURE__ */ f("td", { className:
|
|
4366
|
+
return /* @__PURE__ */ f("tfoot", { children: /* @__PURE__ */ M("tr", { "aria-rowindex": e.numbered ? e.rowTotal + 1 + e.headRows : void 0, "data-grid-line": Ft(t, "foot"), children: [
|
|
4367
|
+
Array.from({ length: a }, (m, p) => /* @__PURE__ */ f("td", { className: I(w.td, w.control, h(p).className), style: h(p).style }, p)),
|
|
4368
|
+
s && /* @__PURE__ */ f("td", { className: I(w.td, h(a).className), style: h(a).style }),
|
|
4369
4369
|
i.map((m, p) => /* @__PURE__ */ f(
|
|
4370
4370
|
hu,
|
|
4371
4371
|
{
|
|
@@ -4374,13 +4374,13 @@ function fu({
|
|
|
4374
4374
|
topLevel: r.roots !== void 0,
|
|
4375
4375
|
formats: n,
|
|
4376
4376
|
wording: o,
|
|
4377
|
-
pin:
|
|
4377
|
+
pin: Mt(h(l + p), b.has(m)),
|
|
4378
4378
|
totals: e.totals,
|
|
4379
4379
|
busy: e.busy
|
|
4380
4380
|
},
|
|
4381
4381
|
m.key
|
|
4382
4382
|
)),
|
|
4383
|
-
c && /* @__PURE__ */ f("td", { className:
|
|
4383
|
+
c && /* @__PURE__ */ f("td", { className: I(w.td, h(u - 1).className), style: h(u - 1).style })
|
|
4384
4384
|
] }) });
|
|
4385
4385
|
}
|
|
4386
4386
|
function hu({
|
|
@@ -4393,20 +4393,20 @@ function hu({
|
|
|
4393
4393
|
totals: i,
|
|
4394
4394
|
busy: a = !1
|
|
4395
4395
|
}) {
|
|
4396
|
-
if (!e.spec.aggregate) return /* @__PURE__ */ f("td", { className:
|
|
4396
|
+
if (!e.spec.aggregate) return /* @__PURE__ */ f("td", { className: I(w.td, r.className), style: r.style });
|
|
4397
4397
|
const l = typeof e.spec.aggregate == "function" ? "own" : e.spec.aggregate;
|
|
4398
|
-
return i ? /* @__PURE__ */
|
|
4399
|
-
a ? /* @__PURE__ */ f("span", { "aria-hidden": "true", className: w.skeleton, style: { width: "60%" } }) : /* @__PURE__ */ f(
|
|
4398
|
+
return i ? /* @__PURE__ */ M("td", { className: I(w.td, Kn(e, t) && w.numeric, r.className), style: r.style, "data-footer": l, children: [
|
|
4399
|
+
a ? /* @__PURE__ */ f("span", { "aria-hidden": "true", className: w.skeleton, style: { width: "60%" } }) : /* @__PURE__ */ f(In, { entry: e, rows: t, formats: n, wording: o, signed: !0, given: { value: i[e.spec.id] } }),
|
|
4400
4400
|
/* @__PURE__ */ f(He, { children: ` (${o.footerOfMatches})` })
|
|
4401
|
-
] }) : /* @__PURE__ */
|
|
4401
|
+
] }) : /* @__PURE__ */ M(
|
|
4402
4402
|
"td",
|
|
4403
4403
|
{
|
|
4404
|
-
className:
|
|
4404
|
+
className: I(w.td, Kn(e, t) && w.numeric, r.className),
|
|
4405
4405
|
style: r.style,
|
|
4406
4406
|
"data-footer": l,
|
|
4407
4407
|
title: s ? o.footerTopLevel : void 0,
|
|
4408
4408
|
children: [
|
|
4409
|
-
/* @__PURE__ */ f(
|
|
4409
|
+
/* @__PURE__ */ f(In, { entry: e, rows: t, formats: n, wording: o, signed: !0 }),
|
|
4410
4410
|
s && /* @__PURE__ */ f(He, { children: ` (${o.footerTopLevel})` })
|
|
4411
4411
|
]
|
|
4412
4412
|
}
|
|
@@ -4416,10 +4416,10 @@ function pu({ hook: e }) {
|
|
|
4416
4416
|
const t = we(), n = We(), { selection: o, rows: r } = e.publicSnapshot, s = e.matches ?? 0, i = o.allMatching, a = r.length > 0 && r.every((c) => e.isPicked(e.rowKey(c)));
|
|
4417
4417
|
if (!i && !(a && s > r.length)) return null;
|
|
4418
4418
|
const l = s - o.except.size;
|
|
4419
|
-
return /* @__PURE__ */ f("div", { role: "status", "data-select-matching": !0, className: w.matchOffer, children: i ? /* @__PURE__ */
|
|
4419
|
+
return /* @__PURE__ */ f("div", { role: "status", "data-select-matching": !0, className: w.matchOffer, children: i ? /* @__PURE__ */ M(fe, { children: [
|
|
4420
4420
|
t.allMatchingSelected(l, n.count(l)),
|
|
4421
4421
|
/* @__PURE__ */ f(ue, { size: "sm", variant: "ghost", onClick: o.clear, children: t.clearSelection })
|
|
4422
|
-
] }) : /* @__PURE__ */
|
|
4422
|
+
] }) : /* @__PURE__ */ M(fe, { children: [
|
|
4423
4423
|
t.selectedOnPage(r.length, n.count(r.length)),
|
|
4424
4424
|
/* @__PURE__ */ f(ue, { size: "sm", variant: "ghost", onClick: o.selectMatching, children: t.selectAllMatching(s, n.count(s)) })
|
|
4425
4425
|
] }) });
|
|
@@ -4430,13 +4430,13 @@ function gu({
|
|
|
4430
4430
|
onSticking: n,
|
|
4431
4431
|
pinnedKeys: o
|
|
4432
4432
|
}) {
|
|
4433
|
-
const { start: r, end: s } = t, i =
|
|
4433
|
+
const { start: r, end: s } = t, i = j({
|
|
4434
4434
|
key: "",
|
|
4435
4435
|
sticking: { start: !0, end: !0 }
|
|
4436
4436
|
}), a = () => {
|
|
4437
4437
|
const l = e.current, c = l?.parentElement;
|
|
4438
4438
|
if (!l || !c || (c.style.removeProperty("scroll-padding-left"), c.style.removeProperty("scroll-padding-right"), !r && !s)) return;
|
|
4439
|
-
const u = Array.from(
|
|
4439
|
+
const u = Array.from(Ot(l)?.cells ?? []);
|
|
4440
4440
|
let d = 0;
|
|
4441
4441
|
for (let g = 0; g < r; g++)
|
|
4442
4442
|
l.style.setProperty(`--u-table-pin-start-${g}`, `${d}px`), d += u[g]?.getBoundingClientRect().width ?? 0;
|
|
@@ -4453,7 +4453,7 @@ function gu({
|
|
|
4453
4453
|
return ee(a), ae(() => {
|
|
4454
4454
|
const l = e.current;
|
|
4455
4455
|
if (!l || !r && !s || typeof ResizeObserver > "u") return;
|
|
4456
|
-
const c = new ResizeObserver(a), u = Array.from(
|
|
4456
|
+
const c = new ResizeObserver(a), u = Array.from(Ot(l)?.cells ?? []);
|
|
4457
4457
|
for (const d of [...u.slice(0, r), ...u.slice(u.length - s)]) c.observe(d);
|
|
4458
4458
|
return l.parentElement && c.observe(l.parentElement), () => c.disconnect();
|
|
4459
4459
|
}, [e, r, s, t.count, o]), null;
|
|
@@ -4469,7 +4469,7 @@ function mu({ table: e }) {
|
|
|
4469
4469
|
}, [e]), null;
|
|
4470
4470
|
}
|
|
4471
4471
|
function wu({ table: e, blocks: t }) {
|
|
4472
|
-
const n =
|
|
4472
|
+
const n = j(t);
|
|
4473
4473
|
return ee(() => {
|
|
4474
4474
|
n.current = t;
|
|
4475
4475
|
const o = e.current?.parentElement;
|
|
@@ -4486,7 +4486,7 @@ function bu({
|
|
|
4486
4486
|
props: t,
|
|
4487
4487
|
name: n
|
|
4488
4488
|
}) {
|
|
4489
|
-
const o = e.hook?.error, r = o !== void 0 ? { ...t, loading: !1 } : e.hook?.late ||
|
|
4489
|
+
const o = e.hook?.error, r = o !== void 0 ? { ...t, loading: !1 } : e.hook?.late || Ln(e) ? { ...t, loading: !0 } : t, {
|
|
4490
4490
|
selectable: s = !1,
|
|
4491
4491
|
stickyHeader: i = !1,
|
|
4492
4492
|
striped: a = !1,
|
|
@@ -4502,33 +4502,33 @@ function bu({
|
|
|
4502
4502
|
tn(e.subscribe, e.bodyVersion, e.bodyVersion), ee(() => {
|
|
4503
4503
|
e.setBusy(t.loading ?? !1);
|
|
4504
4504
|
}, [e, t.loading]);
|
|
4505
|
-
const g = we(), v = We(), y = ti(l, "regular"), k =
|
|
4505
|
+
const g = we(), v = We(), y = ti(l, "regular"), k = Ve(), _ = j(null), [x, T] = G(0), [N, R] = G(0);
|
|
4506
4506
|
ee(() => {
|
|
4507
4507
|
const W = Rn(_.current);
|
|
4508
4508
|
W && W !== N && R(W);
|
|
4509
4509
|
});
|
|
4510
|
-
const C =
|
|
4510
|
+
const C = j(null), L = j(null);
|
|
4511
4511
|
ee(() => {
|
|
4512
4512
|
const W = _.current?.tHead ?? null;
|
|
4513
|
-
W === C.current || typeof ResizeObserver > "u" || (
|
|
4513
|
+
W === C.current || typeof ResizeObserver > "u" || (L.current?.disconnect(), C.current = W, W && (L.current = new ResizeObserver(() => {
|
|
4514
4514
|
const Se = Rn(_.current);
|
|
4515
4515
|
Se && R(Se);
|
|
4516
|
-
}),
|
|
4517
|
-
}), ee(() => () =>
|
|
4518
|
-
const
|
|
4516
|
+
}), L.current.observe(W)));
|
|
4517
|
+
}), ee(() => () => L.current?.disconnect(), []);
|
|
4518
|
+
const E = Jc(), [D, $] = G({ start: !0, end: !0 });
|
|
4519
4519
|
ee(() => (e.setFrameTable(_.current), () => {
|
|
4520
4520
|
e.setFrameTable(null);
|
|
4521
4521
|
}), [e]), Hd(_, i), Wd(e, _), qd(e, _, d), Ud(_), ac(_, e.hook?.tableState.filtered), Yd(_);
|
|
4522
4522
|
const X = !n["aria-label"] && !n["aria-labelledby"];
|
|
4523
4523
|
ae(() => {
|
|
4524
|
-
|
|
4524
|
+
Me && X && te("table-unnamed", 'A table has no name. Give it `aria-label` or `aria-labelledby`: a screen reader lists tables by name, and an unnamed one is just "table".');
|
|
4525
4525
|
}, [X]), Jd(e.hook?.tableState.virtual), Xd(e, _), oc(e, _, d, N, e.server && s);
|
|
4526
|
-
const
|
|
4526
|
+
const K = e.hook?.tableState.setAnchor;
|
|
4527
4527
|
ee(() => {
|
|
4528
|
-
|
|
4528
|
+
K?.(() => ({ focus: (_.current?.tBodies[0]?.contains(document.activeElement) ? document.activeElement.closest("tr[data-motion]") : null)?.dataset.motion ?? null, current: b }));
|
|
4529
4529
|
}), Qd(e, b), Zd(e);
|
|
4530
|
-
const
|
|
4531
|
-
kd(_,
|
|
4530
|
+
const z = e.hook && !e.hook.tableState.virtual ? e.hook.publicSnapshot : null;
|
|
4531
|
+
kd(_, z ? `${z.grouping.join("|")}#${z.folded.join("|")}|${z.pageSize}` : "");
|
|
4532
4532
|
const H = e.hook?.publicSnapshot.selection;
|
|
4533
4533
|
ae(() => {
|
|
4534
4534
|
e.takePicked() && p && s && H && !H.allMatching && dt(g.tableSelectedCount(H.count), _.current);
|
|
@@ -4537,26 +4537,26 @@ function bu({
|
|
|
4537
4537
|
ae(() => {
|
|
4538
4538
|
const W = e.takeSorted();
|
|
4539
4539
|
if (W === null) return;
|
|
4540
|
-
const Se = e.hook?.publicSnapshot.sort.find((
|
|
4541
|
-
dt(Se ? Se.direction === "asc" ? g.sortedAscending(
|
|
4540
|
+
const Se = e.hook?.publicSnapshot.sort.find((F) => F.column === W), Ge = e.columns.ordered().find((F) => F.spec.id === W)?.spec.label ?? W;
|
|
4541
|
+
dt(Se ? Se.direction === "asc" ? g.sortedAscending(Ge) : g.sortedDescending(Ge) : g.sortRemoved(Ge), _.current);
|
|
4542
4542
|
}, [re]);
|
|
4543
4543
|
const A = d && o === void 0 && (e.hook?.publicSnapshot.visible.length ?? 0) === 0;
|
|
4544
4544
|
ee(() => e.setSkeleton(A), [e, A]);
|
|
4545
|
-
const
|
|
4546
|
-
if (!
|
|
4547
|
-
const
|
|
4545
|
+
const O = e.hook;
|
|
4546
|
+
if (!O) return null;
|
|
4547
|
+
const B = E.state.editing?.row === !0, Y = eu({ registry: e, hook: O, props: r, drafting: B, sticking: D }), { snapshot: ce, virtual: U, lines: ie, entries: he, grouping: de, dataColumns: ne, columnCount: Te, pins: me, pinned: se, blocks: Z, rows: Oe, footerShown: Fe } = Y, { lines: be, fresh: ot, ids: Ke, events: ve } = Dd({ registry: e, hook: O, props: r, layout: Y, grid: E }), qe = Id({ registry: e, hook: O, grid: E, gridMode: p, gridLines: be, dataColumns: ne, formats: v, wording: g, tableElement: () => _.current });
|
|
4548
4548
|
e.setAddRow(ve?.addRow ?? null), e.setCellFocus(p ? {
|
|
4549
4549
|
columns: ne.map((W) => W.spec.id),
|
|
4550
4550
|
put: (W, Se) => {
|
|
4551
|
-
const
|
|
4552
|
-
|
|
4551
|
+
const Ge = Ke.indexOf(Se), F = Math.max(1, be.findIndex((J) => J.key === ut(W)));
|
|
4552
|
+
E.setState((J) => ({ ...J, widget: !1, active: { line: ut(W), column: Se, lineIndex: F, columnIndex: Ge } })), E.focus.want("cell");
|
|
4553
4553
|
}
|
|
4554
4554
|
} : null), m && !e.rowHeader() && te("currentRowHeader", "The keyboard cannot choose a row without a row header; mark a column `rowHeader` for `onCurrentRowChange`. The pointer still can.");
|
|
4555
|
-
const Ce = (e.paginates() || ce.server) && !U ? ce.pageSize : 0,
|
|
4556
|
-
|
|
4557
|
-
const Ue = Math.min(Math.max(
|
|
4555
|
+
const Ce = (e.paginates() || ce.server) && !U ? ce.pageSize : 0, Pe = ie ? ie.length : Oe.length, ze = Ce && !d ? Math.min(Pe, Ce) : 0;
|
|
4556
|
+
ze > x && T(ze);
|
|
4557
|
+
const Ue = Math.min(Math.max(ze, x, ce.pageCount > 1 ? Ce : 0), Ce), Ye = d && Pe > 0, Ne = O.tableState.chosenPageSize ?? O.tableState.defaultPageSize, _t = Ce ? Math.min(Math.max(ze, x, ce.pageCount > 1 ? Ne : 0), Ne) || (d && !Ye ? Ne : 0) : 0, q = e.framed && !Ce && Fe && !c && !d && o === void 0 && Y.projection.filtered.length > 0, Qe = e.framed && Ce && N && !c ? (Y.headRows + _t + (Fe ? 1 : 0)) * N : 0, et = {
|
|
4558
4558
|
registry: e,
|
|
4559
|
-
hook:
|
|
4559
|
+
hook: O,
|
|
4560
4560
|
layout: Y,
|
|
4561
4561
|
selectable: s,
|
|
4562
4562
|
gridMode: p,
|
|
@@ -4567,11 +4567,11 @@ function bu({
|
|
|
4567
4567
|
wording: g,
|
|
4568
4568
|
pageSize: Ce,
|
|
4569
4569
|
heldLines: Ue,
|
|
4570
|
-
filler: cu(Ue,
|
|
4571
|
-
}, xe = o !== void 0 ? { body: iu(et, o,
|
|
4572
|
-
return /* @__PURE__ */
|
|
4573
|
-
ce.server && s && /* @__PURE__ */ f(pu, { hook:
|
|
4574
|
-
/* @__PURE__ */
|
|
4570
|
+
filler: cu(Ue, Pe, Ce, Te)
|
|
4571
|
+
}, xe = o !== void 0 ? { body: iu(et, o, O.retry), empty: !0 } : du(et, d, Ye);
|
|
4572
|
+
return /* @__PURE__ */ M(fe, { children: [
|
|
4573
|
+
ce.server && s && /* @__PURE__ */ f(pu, { hook: O }),
|
|
4574
|
+
/* @__PURE__ */ M(
|
|
4575
4575
|
"div",
|
|
4576
4576
|
{
|
|
4577
4577
|
ref: U?.scrollRef,
|
|
@@ -4584,7 +4584,7 @@ function bu({
|
|
|
4584
4584
|
className: w.scroll,
|
|
4585
4585
|
style: c ? { maxHeight: c } : Qe ? { "--_table-held": `${Qe}px` } : void 0,
|
|
4586
4586
|
children: [
|
|
4587
|
-
/* @__PURE__ */ f(br, { size: "sm", children: /* @__PURE__ */
|
|
4587
|
+
/* @__PURE__ */ f(br, { size: "sm", children: /* @__PURE__ */ M(
|
|
4588
4588
|
"table",
|
|
4589
4589
|
{
|
|
4590
4590
|
ref: _,
|
|
@@ -4595,16 +4595,16 @@ function bu({
|
|
|
4595
4595
|
onKeyDown: ve?.onKeyDown,
|
|
4596
4596
|
onFocus: ve?.onFocus,
|
|
4597
4597
|
onClick: (W) => {
|
|
4598
|
-
ve?.onClick(W), m &&
|
|
4598
|
+
ve?.onClick(W), m && Kd(W, O.rowKey, m);
|
|
4599
4599
|
},
|
|
4600
4600
|
onBlur: ve?.onBlur,
|
|
4601
4601
|
"data-depth": ie ? de.length : void 0,
|
|
4602
4602
|
style: ie ? { "--u-header-levels": de.length - 1 } : void 0,
|
|
4603
4603
|
...n,
|
|
4604
|
-
"aria-rowcount": Y.numbered ? Y.rowTotal + Y.headRows + (
|
|
4604
|
+
"aria-rowcount": Y.numbered ? Y.rowTotal + Y.headRows + (Fe ? 1 : 0) : void 0,
|
|
4605
4605
|
"aria-busy": d || void 0,
|
|
4606
4606
|
"data-stale": Ye || void 0,
|
|
4607
|
-
className:
|
|
4607
|
+
className: I(
|
|
4608
4608
|
w.table,
|
|
4609
4609
|
y === "compact" && w.compact,
|
|
4610
4610
|
i && w.sticky,
|
|
@@ -4613,24 +4613,24 @@ function bu({
|
|
|
4613
4613
|
q && w.reaching
|
|
4614
4614
|
),
|
|
4615
4615
|
children: [
|
|
4616
|
-
/* @__PURE__ */ f(uu, { registry: e, hook:
|
|
4617
|
-
/* @__PURE__ */ f(St, { value: ve ? { ...ve.context, hook:
|
|
4616
|
+
/* @__PURE__ */ f(uu, { registry: e, hook: O, layout: Y, props: r, wording: g }),
|
|
4617
|
+
/* @__PURE__ */ f(St, { value: ve ? { ...ve.context, hook: O, wording: g } : null, children: /* @__PURE__ */ M(uo, { value: { key: b, report: m && ((W) => m(O.rowKey(W), W)) }, children: [
|
|
4618
4618
|
ot && ru(et, ot),
|
|
4619
4619
|
xe.body
|
|
4620
4620
|
] }) }),
|
|
4621
|
-
|
|
4621
|
+
Fe && /* @__PURE__ */ f(fu, { layout: Y, gridMode: p, formats: v, wording: g })
|
|
4622
4622
|
]
|
|
4623
4623
|
}
|
|
4624
4624
|
) }),
|
|
4625
4625
|
xe.empty && /* @__PURE__ */ f(mu, { table: _ }),
|
|
4626
4626
|
/* @__PURE__ */ f(wu, { table: _, blocks: Z }),
|
|
4627
|
-
/* @__PURE__ */ f(
|
|
4627
|
+
/* @__PURE__ */ f(Gd, { table: _ }),
|
|
4628
4628
|
/* @__PURE__ */ f(
|
|
4629
4629
|
gu,
|
|
4630
4630
|
{
|
|
4631
4631
|
table: _,
|
|
4632
4632
|
blocks: se,
|
|
4633
|
-
onSticking: (W) =>
|
|
4633
|
+
onSticking: (W) => $((Se) => Se.start === W.start && Se.end === W.end ? Se : W),
|
|
4634
4634
|
pinnedKeys: ne.filter((W) => me[W.spec.id]).map((W) => W.key).join("|")
|
|
4635
4635
|
}
|
|
4636
4636
|
),
|
|
@@ -4638,9 +4638,9 @@ function bu({
|
|
|
4638
4638
|
ld,
|
|
4639
4639
|
{
|
|
4640
4640
|
table: _,
|
|
4641
|
-
grid:
|
|
4641
|
+
grid: E,
|
|
4642
4642
|
lines: be,
|
|
4643
|
-
ids:
|
|
4643
|
+
ids: Ke,
|
|
4644
4644
|
editable: ne.some((W) => W.spec.edit !== void 0) ? ve?.editable : void 0,
|
|
4645
4645
|
outside: ve?.outside,
|
|
4646
4646
|
settle: ve?.settle,
|
|
@@ -4746,28 +4746,28 @@ function Tt(e, t, n, o, r) {
|
|
|
4746
4746
|
}
|
|
4747
4747
|
function _u(e) {
|
|
4748
4748
|
function t(l) {
|
|
4749
|
-
const c =
|
|
4749
|
+
const c = Ve(), u = $e(Vn), d = Su(l, $e(gs));
|
|
4750
4750
|
return e.registerColumn(c, d), Tt(e, c, () => e.removeColumn(c), () => {
|
|
4751
4751
|
e.ensureColumn(c, d);
|
|
4752
|
-
}, !0),
|
|
4752
|
+
}, !0), Me && u && u.registry !== e && te(
|
|
4753
4753
|
`foreign:${d.id}`,
|
|
4754
4754
|
`The column "${d.id}" comes from a different useTable call than the table it stands in. It reads the rows of its own hook.`
|
|
4755
4755
|
), /* @__PURE__ */ f("span", { hidden: !0, "data-umriss-column": c });
|
|
4756
4756
|
}
|
|
4757
4757
|
function n({ children: l }) {
|
|
4758
|
-
const c =
|
|
4758
|
+
const c = Ve();
|
|
4759
4759
|
return e.registerDetail(c, l), Tt(e, c, () => e.removeDetail(c), () => {
|
|
4760
4760
|
e.detail || e.registerDetail(c, l);
|
|
4761
4761
|
}, !1), null;
|
|
4762
4762
|
}
|
|
4763
4763
|
function o({ children: l, pin: c = !0 }) {
|
|
4764
|
-
const u =
|
|
4764
|
+
const u = Ve();
|
|
4765
4765
|
return e.registerActionGroup(u, c), Tt(e, u, () => e.removeActionGroup(u), () => {
|
|
4766
4766
|
e.registerActionGroup(u, c);
|
|
4767
4767
|
}, !1), /* @__PURE__ */ f(fe, { children: l });
|
|
4768
4768
|
}
|
|
4769
4769
|
function r(l) {
|
|
4770
|
-
const c =
|
|
4770
|
+
const c = Ve(), u = {
|
|
4771
4771
|
label: l.children,
|
|
4772
4772
|
bulk: l.bulk === !0,
|
|
4773
4773
|
tone: l.tone ?? "default",
|
|
@@ -4780,7 +4780,7 @@ function _u(e) {
|
|
|
4780
4780
|
}, !0), /* @__PURE__ */ f("span", { hidden: !0, "data-umriss-action": c });
|
|
4781
4781
|
}
|
|
4782
4782
|
function s(l) {
|
|
4783
|
-
const c =
|
|
4783
|
+
const c = Ve(), u = typeof l.value == "string" ? l.value : void 0, h = {
|
|
4784
4784
|
id: l.id ?? u ?? l.label,
|
|
4785
4785
|
label: l.label,
|
|
4786
4786
|
value: l.value,
|
|
@@ -4807,12 +4807,12 @@ function _u(e) {
|
|
|
4807
4807
|
...g
|
|
4808
4808
|
} = l, v = { ...g };
|
|
4809
4809
|
for (const N of yu) delete v[N];
|
|
4810
|
-
const y = { "aria-label": b, "aria-labelledby": m, "aria-describedby": p }, k =
|
|
4810
|
+
const y = { "aria-label": b, "aria-labelledby": m, "aria-describedby": p }, k = j(null), [_, x] = G(null);
|
|
4811
4811
|
vu(e, k, !!l.maxHeight), ee(() => {
|
|
4812
4812
|
e.children = k.current, e.checkOrder(), e.commit();
|
|
4813
4813
|
});
|
|
4814
4814
|
const T = oe(() => ({ registry: e, footerTarget: _ }), [_]);
|
|
4815
|
-
return /* @__PURE__ */ f(
|
|
4815
|
+
return /* @__PURE__ */ f(Vn, { value: T, children: /* @__PURE__ */ M("div", { ...v, ref: c, className: I(w.frame, u), style: d, "data-bounded": l.maxHeight ? "" : void 0, children: [
|
|
4816
4816
|
/* @__PURE__ */ f("div", { ref: k, className: w.children, children: h }),
|
|
4817
4817
|
/* @__PURE__ */ f(ku, { registry: e }),
|
|
4818
4818
|
/* @__PURE__ */ f(bu, { registry: e, props: l, name: y }),
|
|
@@ -4820,7 +4820,7 @@ function _u(e) {
|
|
|
4820
4820
|
] }) });
|
|
4821
4821
|
}
|
|
4822
4822
|
const a = { Table: i, Column: t, RowDetail: n, RowActions: o, Action: r, GroupBy: s };
|
|
4823
|
-
return
|
|
4823
|
+
return Oc(i, e), a;
|
|
4824
4824
|
}
|
|
4825
4825
|
function ku({ registry: e }) {
|
|
4826
4826
|
return tn(e.subscribe, e.bodyVersion, e.bodyVersion), !e.hook || !e.needsOwnToolbar() ? null : /* @__PURE__ */ f(ps, { registry: e, own: !0 });
|
|
@@ -4836,23 +4836,23 @@ const Cu = "_verdict_1mxfd_6", xu = "_glyph_1mxfd_13", Au = "_value_1mxfd_23", T
|
|
|
4836
4836
|
warning: "▲",
|
|
4837
4837
|
alarm: "■"
|
|
4838
4838
|
};
|
|
4839
|
-
function
|
|
4839
|
+
function Eu({ reading: e, format: t }) {
|
|
4840
4840
|
const n = We(), o = we(), { measured: r, assessment: s } = e, i = Nu(s.verdict, o);
|
|
4841
|
-
return /* @__PURE__ */
|
|
4841
|
+
return /* @__PURE__ */ M("span", { className: Wt.verdict, "data-verdict": s.verdict, title: i, children: [
|
|
4842
4842
|
/* @__PURE__ */ f("span", { "aria-hidden": "true", className: Wt.glyph, children: Ru[s.verdict] }),
|
|
4843
4843
|
/* @__PURE__ */ f("span", { className: Wt.value, children: r === null ? o.statAbsentValue : kn(n, r, t) }),
|
|
4844
|
-
s.excess !== void 0 && /* @__PURE__ */
|
|
4844
|
+
s.excess !== void 0 && /* @__PURE__ */ M("span", { className: Wt.excess, children: [
|
|
4845
4845
|
"+",
|
|
4846
4846
|
kn(n, s.excess, t)
|
|
4847
4847
|
] }),
|
|
4848
4848
|
/* @__PURE__ */ f(He, { children: i })
|
|
4849
4849
|
] });
|
|
4850
4850
|
}
|
|
4851
|
-
const
|
|
4851
|
+
const Mu = (e) => e.measured, Ou = (e) => e.reduce(
|
|
4852
4852
|
(t, n) => !t || Tn(n.assessment.verdict) > Tn(t.assessment.verdict) ? n : t,
|
|
4853
4853
|
void 0
|
|
4854
4854
|
);
|
|
4855
|
-
function
|
|
4855
|
+
function Lu(e) {
|
|
4856
4856
|
return function({ id: n, value: o, label: r, limits: s, format: i, sortBy: a = "verdict", width: l, resizable: c, pin: u, aggregate: d, aggregateLabel: h }) {
|
|
4857
4857
|
const b = JSON.stringify(s), m = oe(() => {
|
|
4858
4858
|
const g = JSON.parse(b);
|
|
@@ -4878,29 +4878,29 @@ function Ou(e) {
|
|
|
4878
4878
|
pin: u,
|
|
4879
4879
|
value: m,
|
|
4880
4880
|
sortValue: p,
|
|
4881
|
-
exportValue:
|
|
4882
|
-
aggregate: d === "worst" ?
|
|
4881
|
+
exportValue: Mu,
|
|
4882
|
+
aggregate: d === "worst" ? Ou : void 0,
|
|
4883
4883
|
aggregateLabel: h,
|
|
4884
|
-
children: (g) => /* @__PURE__ */ f(
|
|
4884
|
+
children: (g) => /* @__PURE__ */ f(Eu, { reading: g, format: i })
|
|
4885
4885
|
}
|
|
4886
4886
|
);
|
|
4887
4887
|
};
|
|
4888
4888
|
}
|
|
4889
|
-
const dr = (e) => Object.entries(e ?? {}).map(([t, n]) => [t, n, !0]),
|
|
4889
|
+
const dr = (e) => Object.entries(e ?? {}).map(([t, n]) => [t, n, !0]), $u = [], Ms = (e) => te(
|
|
4890
4890
|
`condition-foreign:${e}`,
|
|
4891
4891
|
`The condition for "${e}" is not of the kind of its filter and is passed over.`
|
|
4892
|
-
),
|
|
4893
|
-
function
|
|
4892
|
+
), Fu = 300;
|
|
4893
|
+
function Os(e, t, n) {
|
|
4894
4894
|
const o = e.columnById(t), r = o ? nt(o.spec.filter) : void 0;
|
|
4895
4895
|
if (!r) return !1;
|
|
4896
|
-
const s =
|
|
4897
|
-
return s === "foreign" &&
|
|
4896
|
+
const s = zr(r, n);
|
|
4897
|
+
return s === "foreign" && Ms(t), s === "effective";
|
|
4898
4898
|
}
|
|
4899
|
-
function
|
|
4899
|
+
function Ls(e, t, n, o) {
|
|
4900
4900
|
const r = e.columnById(n), s = r ? nt(r.spec.filter) : void 0;
|
|
4901
4901
|
return r && s ? mc(s, o, e.kindOf(r, t)) : o;
|
|
4902
4902
|
}
|
|
4903
|
-
function
|
|
4903
|
+
function Pu(e, t, n, o, r) {
|
|
4904
4904
|
if (e.length === 0) return;
|
|
4905
4905
|
let s = -1, i = [];
|
|
4906
4906
|
return (a) => {
|
|
@@ -4912,8 +4912,8 @@ function Fu(e, t, n, o, r) {
|
|
|
4912
4912
|
i.push((m) => d.matches(m, c));
|
|
4913
4913
|
continue;
|
|
4914
4914
|
}
|
|
4915
|
-
const h = t.columnById(l), b = u ?
|
|
4916
|
-
h &&
|
|
4915
|
+
const h = t.columnById(l), b = u ? Ls(t, r, l, c) : c;
|
|
4916
|
+
h && Os(t, l, b) && i.push((m) => {
|
|
4917
4917
|
const p = nt(h.spec.filter);
|
|
4918
4918
|
return !p || wc(p, h.read(m), b, o);
|
|
4919
4919
|
});
|
|
@@ -4922,17 +4922,17 @@ function Fu(e, t, n, o, r) {
|
|
|
4922
4922
|
return i.every((l) => l(a));
|
|
4923
4923
|
};
|
|
4924
4924
|
}
|
|
4925
|
-
function
|
|
4926
|
-
const [n, o] =
|
|
4925
|
+
function zu(e, t) {
|
|
4926
|
+
const [n, o] = G({ fn: e });
|
|
4927
4927
|
return at(n.fn, e) ? (Xt("The rowKey", n.fn, e, t), n.fn) : (o({ fn: e }), e);
|
|
4928
4928
|
}
|
|
4929
|
-
function
|
|
4930
|
-
const n = oe(() => t ? e.filter((i) => t(i)) : e, [e, t]), [o, r] =
|
|
4929
|
+
function Bu(e, t) {
|
|
4930
|
+
const n = oe(() => t ? e.filter((i) => t(i)) : e, [e, t]), [o, r] = G(n);
|
|
4931
4931
|
if (!t) return e;
|
|
4932
4932
|
const s = o === n || o.length === n.length && o.every((i, a) => i === n[a]);
|
|
4933
4933
|
return s || r(n), s ? o : n;
|
|
4934
4934
|
}
|
|
4935
|
-
const qt = (e) => e === void 0 ? [] : typeof e == "string" ? [e] : [...e],
|
|
4935
|
+
const qt = (e) => e === void 0 ? [] : typeof e == "string" ? [e] : [...e], Du = (e, t) => e.length === t.length && e.every((n, o) => n === t[o]);
|
|
4936
4936
|
function _n(e) {
|
|
4937
4937
|
const t = [], n = (o) => {
|
|
4938
4938
|
for (const r of o)
|
|
@@ -4940,7 +4940,7 @@ function _n(e) {
|
|
|
4940
4940
|
};
|
|
4941
4941
|
return n(e ?? []), t;
|
|
4942
4942
|
}
|
|
4943
|
-
function
|
|
4943
|
+
function Vu(e, t, n) {
|
|
4944
4944
|
const o = [], r = (s, i) => {
|
|
4945
4945
|
if (!(i >= n))
|
|
4946
4946
|
for (const a of s) {
|
|
@@ -4951,101 +4951,101 @@ function Du(e, t, n) {
|
|
|
4951
4951
|
return r(e, 0), o;
|
|
4952
4952
|
}
|
|
4953
4953
|
const ur = (e, t) => e.size === t.size && [...e].every((n) => t.has(n));
|
|
4954
|
-
function
|
|
4955
|
-
return {
|
|
4954
|
+
function Iu(e, t) {
|
|
4955
|
+
return { ...$n(e), ...t };
|
|
4956
4956
|
}
|
|
4957
4957
|
function Yu(e, t) {
|
|
4958
4958
|
const n = typeof t.rowKey == "function", o = typeof t.rowKey;
|
|
4959
4959
|
ae(() => {
|
|
4960
4960
|
n || te(`rowkey:${o}`, "rowKey must be a function (row) => string, e.g. `rowKey: (row) => row.id`; the table shows no rows.");
|
|
4961
4961
|
}, [n, o]);
|
|
4962
|
-
const r = n ?
|
|
4962
|
+
const r = n ? Lo(e, "the rows of useTable") : Lo([], ""), [s] = G(() => new Mc());
|
|
4963
4963
|
s.setRows(r);
|
|
4964
|
-
const [i] =
|
|
4964
|
+
const [i] = G(() => {
|
|
4965
4965
|
const S = _u(s);
|
|
4966
|
-
return { ...S, VerdictColumn:
|
|
4966
|
+
return { ...S, VerdictColumn: Lu(S.Column) };
|
|
4967
4967
|
});
|
|
4968
4968
|
tn(s.subscribe, s.structureVersion, s.structureVersion);
|
|
4969
|
-
const a = We(), l = we(), c = r, u = s.modelColumns(c, a, l), [d] =
|
|
4969
|
+
const a = We(), l = we(), c = r, u = s.modelColumns(c, a, l), [d] = G(() => t.initialView), h = t.server === !0, b = t.server ? t.rowCount : 0, m = j(0), [p, g] = G(!1);
|
|
4970
4970
|
b > 0 && !p && g(!0), s.setServer(h), h && (t.preFilter && te("server-prefilter", "`preFilter` is passed over in server mode: the server decides which rows the table has."), t.virtual && te("server-virtual", "`virtual` is passed over in server mode: the table pages instead."));
|
|
4971
|
-
const [v, y] =
|
|
4971
|
+
const [v, y] = G(() => dr(d?.conditions)), k = t.rowFilters ?? $u, _ = k.map((S) => S.id).join("\0"), x = oe(
|
|
4972
4972
|
() => new Map(k.map((S) => [S.id, S])),
|
|
4973
4973
|
// eslint-disable-next-line react-hooks/exhaustive-deps -- the filters by their ids; they are defined outside the component
|
|
4974
4974
|
[_]
|
|
4975
4975
|
);
|
|
4976
4976
|
for (const S of k)
|
|
4977
4977
|
s.columnById(S.id) && te(`row-filter-column:${S.id}`, `The row filter "${S.id}" has the id of a column; a condition under that id is the row filter's, and the column's filter cannot hold one of its own.`);
|
|
4978
|
-
const T = oe(() =>
|
|
4978
|
+
const T = oe(() => Pu(v, s, x, a, c), [v, s, x, a, c]), N = t.preFilter, R = Bu(c, h ? void 0 : N), [C, L] = G(
|
|
4979
4979
|
() => d?.grouping ? [...d.grouping] : qt(t.defaultGrouping)
|
|
4980
|
-
), [
|
|
4980
|
+
), [E, D] = G(() => d?.folded ?? []), [$, X] = G(null), [K, z] = G(() => d?.pinned ? { ...d.pinned } : null), H = zu(n ? t.rowKey : () => "", c), re = t.server ? void 0 : t.childRows, A = re !== void 0;
|
|
4981
4981
|
s.setTree(A);
|
|
4982
|
-
const
|
|
4982
|
+
const O = j({ children: re, key: H });
|
|
4983
4983
|
ee(() => {
|
|
4984
|
-
|
|
4984
|
+
O.current = { children: re, key: H };
|
|
4985
4985
|
});
|
|
4986
|
-
const [
|
|
4987
|
-
key: (S) =>
|
|
4988
|
-
children: (S) =>
|
|
4989
|
-
unloaded: (S) =>
|
|
4986
|
+
const [B] = G(() => ({
|
|
4987
|
+
key: (S) => O.current.key(S),
|
|
4988
|
+
children: (S) => O.current.children?.(S) ?? void 0,
|
|
4989
|
+
unloaded: (S) => O.current.children?.(S) === null,
|
|
4990
4990
|
label: () => ""
|
|
4991
|
-
})), [Y] =
|
|
4991
|
+
})), [Y] = G(() => {
|
|
4992
4992
|
const S = t.server ? void 0 : t.defaultBranches;
|
|
4993
|
-
return !A || S === void 0 ? [] : typeof S == "number" ?
|
|
4994
|
-
}), [ce, U] =
|
|
4993
|
+
return !A || S === void 0 ? [] : typeof S == "number" ? Vu(c, B, S) : [...S];
|
|
4994
|
+
}), [ce, U] = G(() => d?.branches ?? Y), ie = oe(() => A ? new Set(oi(c, B)) : /* @__PURE__ */ new Set(), [A, c, B]), he = oe(() => {
|
|
4995
4995
|
const S = /* @__PURE__ */ new Map();
|
|
4996
4996
|
if (!A) return S;
|
|
4997
|
-
const
|
|
4998
|
-
for (const le of
|
|
4999
|
-
|
|
4997
|
+
const P = (V) => {
|
|
4998
|
+
for (const le of V)
|
|
4999
|
+
B.unloaded?.(le) ? S.set(B.key(le), le) : P(B.children(le) ?? []);
|
|
5000
5000
|
};
|
|
5001
|
-
return
|
|
5002
|
-
}, [A, c,
|
|
5003
|
-
const
|
|
5004
|
-
me.current.set(S,
|
|
5005
|
-
const le = (ye) => Te((
|
|
5006
|
-
if (me.current.get(S) !==
|
|
5007
|
-
const it = new Map(
|
|
5001
|
+
return P(c), S;
|
|
5002
|
+
}, [A, c, B]), de = A ? ce.filter((S) => ie.has(S) || he.has(S)) : [], [ne, Te] = G(() => /* @__PURE__ */ new Map()), me = j(/* @__PURE__ */ new Map()), se = (S) => {
|
|
5003
|
+
const P = he.get(S), V = (me.current.get(S) ?? 0) + 1;
|
|
5004
|
+
me.current.set(S, V);
|
|
5005
|
+
const le = (ye) => Te((je) => {
|
|
5006
|
+
if (me.current.get(S) !== V) return je;
|
|
5007
|
+
const it = new Map(je);
|
|
5008
5008
|
return ye === void 0 ? it.delete(S) : it.set(S, ye), it;
|
|
5009
5009
|
}), Ae = (ye) => le(ye instanceof Error ? ye.message : String(ye));
|
|
5010
5010
|
let ke;
|
|
5011
5011
|
try {
|
|
5012
|
-
ke = (t.server ? void 0 : t.onBranchOpen)?.(S,
|
|
5012
|
+
ke = (t.server ? void 0 : t.onBranchOpen)?.(S, P);
|
|
5013
5013
|
} catch (ye) {
|
|
5014
5014
|
return Ae(ye);
|
|
5015
5015
|
}
|
|
5016
5016
|
ke && typeof ke.then == "function" && (le(null), ke.then(() => le(void 0), Ae));
|
|
5017
|
-
}, Z = de.filter((S) => he.has(S)),
|
|
5017
|
+
}, Z = de.filter((S) => he.has(S)), Oe = Z.join("\0");
|
|
5018
5018
|
ae(() => {
|
|
5019
5019
|
for (const S of [...me.current.keys()])
|
|
5020
|
-
Z.includes(S) || (me.current.delete(S), Te((
|
|
5021
|
-
if (!
|
|
5022
|
-
const
|
|
5023
|
-
return
|
|
5020
|
+
Z.includes(S) || (me.current.delete(S), Te((P) => {
|
|
5021
|
+
if (!P.has(S)) return P;
|
|
5022
|
+
const V = new Map(P);
|
|
5023
|
+
return V.delete(S), V;
|
|
5024
5024
|
}));
|
|
5025
5025
|
for (const S of Z) me.current.has(S) || se(S);
|
|
5026
|
-
}, [
|
|
5026
|
+
}, [Oe]), oe(() => {
|
|
5027
5027
|
if (!A) return;
|
|
5028
|
-
const S = ri(c,
|
|
5028
|
+
const S = ri(c, B);
|
|
5029
5029
|
S !== null && te(`tree-duplicate:${S}`, `The row key "${S}" occurs twice in the tree: its fold and its selection would act on both rows.`);
|
|
5030
|
-
}, [A, c,
|
|
5031
|
-
const
|
|
5032
|
-
() => ve && ve.levels.length ? { ...ve, folded:
|
|
5030
|
+
}, [A, c, B]), A && (t.defaultGrouping !== void 0 || d?.grouping?.length) && te("tree-grouping", "A grouping is passed over with `childRows`: tree rows and grouping both build levels.");
|
|
5031
|
+
const Fe = s.orderedColumns().length + s.groupKeys.entries.size > 0, be = A ? [] : Fe ? s.effectiveGrouping(C, c) : C.slice(0, no), ot = be.join("|"), Ke = oe(() => new Set(E), [E]), ve = be.length && !h ? s.groupingModel(be, c, a.timeZone) : null, qe = oe(
|
|
5032
|
+
() => ve && ve.levels.length ? { ...ve, folded: Ke, compareText: a.compareText } : void 0,
|
|
5033
5033
|
// eslint-disable-next-line react-hooks/exhaustive-deps -- the model's identity carries the ids and the columns
|
|
5034
|
-
[ve,
|
|
5035
|
-
), Ce = de.join("\0"),
|
|
5036
|
-
() => A ? { key: H, children:
|
|
5034
|
+
[ve, Ke, a.compareText, ot]
|
|
5035
|
+
), Ce = de.join("\0"), Pe = oe(
|
|
5036
|
+
() => A ? { key: H, children: B.children, unloaded: B.unloaded, open: new Set(de), admit: N } : void 0,
|
|
5037
5037
|
/* ponytail: the pre-filter is read through the roots it admits - a new
|
|
5038
5038
|
pre-filter that only drops children takes hold with the next change of
|
|
5039
5039
|
rows or branches. Compare its admitted children, as useAdmitted does
|
|
5040
5040
|
the roots, if a caller needs that live. */
|
|
5041
5041
|
// eslint-disable-next-line react-hooks/exhaustive-deps -- the open keys by value; the rows the pre-filter admits stand for it
|
|
5042
|
-
[A, Ce, R,
|
|
5043
|
-
),
|
|
5044
|
-
() => h && be.length > 0 && !Ye && (
|
|
5042
|
+
[A, Ce, R, B]
|
|
5043
|
+
), ze = t.server ? t.groups : void 0, Ue = t.server ? t.answers?.grouping : void 0, Ye = Ue !== void 0 && Ue.join("|") !== be.join("|"), Ne = oe(
|
|
5044
|
+
() => h && be.length > 0 && !Ye && (ze !== void 0 || c.length > 0) ? Jl(c, ze, be.length) : void 0,
|
|
5045
5045
|
// eslint-disable-next-line react-hooks/exhaustive-deps -- the grouping by its ids
|
|
5046
|
-
[h, ot, Ye,
|
|
5046
|
+
[h, ot, Ye, ze, c]
|
|
5047
5047
|
);
|
|
5048
|
-
(typeof Ne == "string" || h && be.length > 0 && !Ye &&
|
|
5048
|
+
(typeof Ne == "string" || h && be.length > 0 && !Ye && ze === void 0 && c.length > 0) && te(
|
|
5049
5049
|
`server-groups:${typeof Ne == "string" ? Ne : "missing"}`,
|
|
5050
5050
|
`\`groups\` does not answer the grouping (${be.join(", ")}): ${typeof Ne == "string" ? Ne : "it is missing"}. The rows are shown ungrouped; hand back one group line per group the page shows, as ServerGroup describes.`
|
|
5051
5051
|
);
|
|
@@ -5061,160 +5061,160 @@ function Yu(e, t) {
|
|
|
5061
5061
|
virtual: h ? void 0 : t.virtual,
|
|
5062
5062
|
grouping: qe,
|
|
5063
5063
|
server: _t,
|
|
5064
|
-
tree:
|
|
5064
|
+
tree: Pe
|
|
5065
5065
|
}), { setPage: Qe } = q, et = _e(
|
|
5066
|
-
(S,
|
|
5067
|
-
const
|
|
5068
|
-
let le =
|
|
5069
|
-
const Ae = x.has(
|
|
5066
|
+
(S, P) => {
|
|
5067
|
+
const V = typeof S == "string" ? S : S.id;
|
|
5068
|
+
let le = P == null;
|
|
5069
|
+
const Ae = x.has(V);
|
|
5070
5070
|
if (typeof S != "string" && !Ae) {
|
|
5071
5071
|
te(
|
|
5072
|
-
`row-filter-unknown:${
|
|
5073
|
-
`The row filter "${
|
|
5072
|
+
`row-filter-unknown:${V}`,
|
|
5073
|
+
`The row filter "${V}" is not among the table's \`rowFilters\`; its condition is passed over.`
|
|
5074
5074
|
);
|
|
5075
5075
|
return;
|
|
5076
5076
|
}
|
|
5077
5077
|
if (!le && !Ae && s.orderedColumns().length > 0) {
|
|
5078
|
-
const ke = s.columnById(
|
|
5078
|
+
const ke = s.columnById(V), ye = ke ? nt(ke.spec.filter) : void 0;
|
|
5079
5079
|
if (!ye) {
|
|
5080
5080
|
te(
|
|
5081
|
-
`condition-without-filter:${
|
|
5082
|
-
ke ? `The column "${
|
|
5081
|
+
`condition-without-filter:${V}`,
|
|
5082
|
+
ke ? `The column "${V}" has no filter; its condition is passed over.` : `No column is called "${V}"; its condition is passed over.`
|
|
5083
5083
|
);
|
|
5084
5084
|
return;
|
|
5085
5085
|
}
|
|
5086
|
-
const
|
|
5087
|
-
if (
|
|
5088
|
-
|
|
5086
|
+
const je = zr(ye, P);
|
|
5087
|
+
if (je === "foreign") {
|
|
5088
|
+
Ms(V);
|
|
5089
5089
|
return;
|
|
5090
5090
|
}
|
|
5091
|
-
le =
|
|
5091
|
+
le = je === "empty";
|
|
5092
5092
|
}
|
|
5093
5093
|
y((ke) => {
|
|
5094
|
-
const ye = ke.findIndex(([
|
|
5095
|
-
return le ? ye === -1 ? ke : ke.filter((
|
|
5094
|
+
const ye = ke.findIndex(([je]) => je === V);
|
|
5095
|
+
return le ? ye === -1 ? ke : ke.filter((je, it) => it !== ye) : ye === -1 ? [...ke, [V, P]] : ke.map((je, it) => it === ye ? [V, P] : je);
|
|
5096
5096
|
}), Qe(1);
|
|
5097
5097
|
},
|
|
5098
5098
|
[s, Qe, x]
|
|
5099
|
-
), xe = new Set(s.orderedColumns().map((S) => S.spec.id)), [W, Se] =
|
|
5099
|
+
), xe = new Set(s.orderedColumns().map((S) => S.spec.id)), [W, Se] = G(() => /* @__PURE__ */ new Set());
|
|
5100
5100
|
if (!ur(W, xe)) {
|
|
5101
|
-
const S = new Set([...W].filter((
|
|
5101
|
+
const S = new Set([...W].filter((V) => !xe.has(V)));
|
|
5102
5102
|
Se(xe);
|
|
5103
|
-
const
|
|
5104
|
-
v.some(([
|
|
5103
|
+
const P = (V) => S.has(V) && !x.has(V);
|
|
5104
|
+
v.some(([V]) => P(V)) && y((V) => V.filter(([le]) => !P(le)));
|
|
5105
5105
|
}
|
|
5106
|
-
const
|
|
5106
|
+
const Ge = v.map(([S, P, V]) => [S, V && !x.has(S) ? Ls(s, c, S, P) : P]), F = xe.size === 0 ? Ge : Ge.filter(([S, P]) => x.has(S) || Os(s, S, P)), J = uc(q.view, xe), pe = F.length > 0 ? { ...J, conditions: Object.fromEntries(F) } : J, Be = xe.size === 0 ? q.sort : q.sort.filter((S) => xe.has(S.column)), Le = A ? [] : Fe ? s.effectiveGrouping(qt(t.defaultGrouping), c) : qt(t.defaultGrouping), ht = h ? [...E] : q.groups ? Wl(q.groups, E) : Fe ? [] : [...E], pt = s.declaredPins(), gt = fi(K, pt, xe), mt = {
|
|
5107
5107
|
...pe,
|
|
5108
|
-
...
|
|
5108
|
+
...Du(be, Le) ? {} : { grouping: be },
|
|
5109
5109
|
...ht.length ? { folded: ht } : {},
|
|
5110
5110
|
...gt ? { pinned: gt } : {},
|
|
5111
5111
|
...A && !ur(new Set(de), new Set(Y.filter((S) => ie.has(S)))) ? { branches: de } : {}
|
|
5112
|
-
},
|
|
5113
|
-
q.restart(S), y(dr(S.conditions)),
|
|
5112
|
+
}, Vt = (S, P) => z((V) => di(V ?? s.declaredPins(), S, P)), [Re, un] = G(0), fn = (S) => {
|
|
5113
|
+
q.restart(S), y(dr(S.conditions)), L(S.grouping ? [...S.grouping] : qt(t.defaultGrouping)), D(S.folded ?? []), z(S.pinned ? { ...S.pinned } : null), U(S.branches ?? Y), un((P) => P + 1);
|
|
5114
5114
|
}, hn = (S) => {
|
|
5115
|
-
|
|
5115
|
+
L([...S]), h && (D([]), X(null)), Qe(1);
|
|
5116
5116
|
}, tt = (S) => {
|
|
5117
|
-
_n(q.groups).includes(S) && (s.noteFocusBeforeFold(),
|
|
5118
|
-
},
|
|
5117
|
+
_n(q.groups).includes(S) && (s.noteFocusBeforeFold(), D((P) => P.includes(S) ? P.filter((V) => V !== S) : [...P, S]));
|
|
5118
|
+
}, It = !h && !!t.virtual, pn = !A && s.paginates() || It, Q = t.selection ?? q.selection, po = t.pageSize !== void 0;
|
|
5119
5119
|
ae(() => {
|
|
5120
|
-
if (!
|
|
5120
|
+
if (!Me || !po || h || It || A) return;
|
|
5121
5121
|
const S = requestAnimationFrame(() => {
|
|
5122
5122
|
s.paginates() || te("page-size-no-bar", "`pageSize` is passed, but no `Pagination` stands for this table, so every row is shown. `pageSize` holds as soon as a `Pagination` stands inside the table or gets it as `of`.");
|
|
5123
5123
|
});
|
|
5124
5124
|
return () => cancelAnimationFrame(S);
|
|
5125
|
-
}, [po, h,
|
|
5126
|
-
if (!
|
|
5125
|
+
}, [po, h, It, A, s]), ae(() => {
|
|
5126
|
+
if (!Me || r.length === 0) return;
|
|
5127
5127
|
const S = requestAnimationFrame(() => {
|
|
5128
|
-
const
|
|
5129
|
-
for (const { spec:
|
|
5130
|
-
const le =
|
|
5131
|
-
typeof le == "string" && !
|
|
5128
|
+
const P = r.slice(0, t.pageSize ?? 10);
|
|
5129
|
+
for (const { spec: V } of s.orderedColumns()) {
|
|
5130
|
+
const le = V.value;
|
|
5131
|
+
typeof le == "string" && !P.some((Ae) => typeof Ae == "object" && Ae !== null && le in Ae) && te(`field:${V.id}:${le}`, `Column "${V.id}" reads the field "${le}", which no row of the first page has; every cell shows no value.`);
|
|
5132
5132
|
}
|
|
5133
5133
|
});
|
|
5134
5134
|
return () => cancelAnimationFrame(S);
|
|
5135
5135
|
}, [r, t.pageSize, s]);
|
|
5136
|
-
const
|
|
5136
|
+
const Kt = Io(mt), go = j(Kt), mo = j(0), gn = Io({ ...mt, page: void 0 }), wo = j(gn), bo = j(!1);
|
|
5137
5137
|
ae(() => {
|
|
5138
5138
|
bo.current = q.takeFitMoved();
|
|
5139
5139
|
}), ae(() => {
|
|
5140
5140
|
const S = bo.current && wo.current === gn;
|
|
5141
5141
|
wo.current = gn;
|
|
5142
|
-
const
|
|
5143
|
-
mo.current = Re, go.current !==
|
|
5144
|
-
}, [
|
|
5142
|
+
const P = mo.current !== Re || S;
|
|
5143
|
+
mo.current = Re, go.current !== Kt && (go.current = Kt, P || t.onViewChange?.(mt));
|
|
5144
|
+
}, [Kt, Re]);
|
|
5145
5145
|
const rt = {
|
|
5146
5146
|
search: q.search,
|
|
5147
|
-
conditions: Object.fromEntries(
|
|
5148
|
-
sort:
|
|
5147
|
+
conditions: Object.fromEntries(F),
|
|
5148
|
+
sort: Be,
|
|
5149
5149
|
page: q.page,
|
|
5150
5150
|
pageSize: q.pageSize,
|
|
5151
5151
|
grouping: be,
|
|
5152
5152
|
folded: [...ht].sort()
|
|
5153
|
-
}, kt = h ?
|
|
5153
|
+
}, kt = h ? Vo(rt) : "", vo = j(null), yo = j(/* @__PURE__ */ new Set()), st = t.server && t.answers ? Vo(t.answers) : null, $s = j(st), So = st !== null && st !== kt, mn = j(t.onRequest);
|
|
5154
5154
|
ae(() => {
|
|
5155
5155
|
mn.current = t.onRequest;
|
|
5156
5156
|
}), ae(() => () => s.settleSearch(!1), [s]);
|
|
5157
|
-
const
|
|
5157
|
+
const Fs = Ln(s);
|
|
5158
5158
|
ae(() => {
|
|
5159
|
-
if (!h ||
|
|
5159
|
+
if (!h || Ln(s)) return;
|
|
5160
5160
|
const S = s.takeTyped();
|
|
5161
|
-
vo.current !== kt && (vo.current = kt, ++m.current > 1 && g(!0),
|
|
5162
|
-
}, [kt, st,
|
|
5161
|
+
vo.current !== kt && (vo.current = kt, ++m.current > 1 && g(!0), Me && yo.current.add(kt), S ? s.holdSearch(() => mn.current?.(rt), Fu) : (s.settleSearch(!1), t.onRequest?.(rt))), Me && st !== null && st !== $s.current && t.error === void 0 && !yo.current.has(st) && te("server-answers", "`answers` matches none of the requests `onRequest` received; the table stays busy. Hand back the request object you were given, or one with the same search, conditions, sort, page and page size.");
|
|
5162
|
+
}, [kt, st, Fs]), ae(() => {
|
|
5163
5163
|
s.takeTyped();
|
|
5164
5164
|
});
|
|
5165
|
-
const wt = JSON.stringify([rt.search, rt.conditions]), _o =
|
|
5165
|
+
const wt = JSON.stringify([rt.search, rt.conditions]), _o = j(wt);
|
|
5166
5166
|
ae(() => {
|
|
5167
5167
|
Q.allMatching && !h && te("selection-all-matching", '`allMatching` is ignored without `server`: the table holds every row, and "select all" selects them by key.'), _o.current !== wt && (_o.current = wt, h && Q.clear());
|
|
5168
|
-
}, [wt, Q.allMatching]),
|
|
5169
|
-
const
|
|
5168
|
+
}, [wt, Q.allMatching]), $ && (Q.count > 0 || Q.allMatching) && X(null);
|
|
5169
|
+
const De = $?.key === wt ? $ : null, ko = oe(() => {
|
|
5170
5170
|
const S = /* @__PURE__ */ new Set();
|
|
5171
|
-
if (!
|
|
5172
|
-
for (const
|
|
5173
|
-
|
|
5171
|
+
if (!De || !h) return S;
|
|
5172
|
+
for (const P of q.lines ?? [])
|
|
5173
|
+
P.kind === "row" && [...P.parents, ...P.span ? [P.span] : []].some((V) => V.path === De.path) && S.add(H(P.row));
|
|
5174
5174
|
return S;
|
|
5175
|
-
}, [
|
|
5175
|
+
}, [De, h, q.lines, H]), Ps = (S) => De && ko.has(S) ? !De.except.includes(S) : Q.isSelected(S);
|
|
5176
5176
|
ae(() => {
|
|
5177
5177
|
if (h || A || Q.selected.size === 0 || s.busy) return;
|
|
5178
|
-
const S = new Set(c.map(H)),
|
|
5179
|
-
|
|
5178
|
+
const S = new Set(c.map(H)), P = [...Q.selected].filter((V) => !S.has(V));
|
|
5179
|
+
P.length > 0 && Q.set(P, !1);
|
|
5180
5180
|
}, [c]);
|
|
5181
|
-
const Co = oe(() => h ? null : new Set(q.filtered.map(H)), [h, q.filtered, H]),
|
|
5181
|
+
const Co = oe(() => h ? null : new Set(q.filtered.map(H)), [h, q.filtered, H]), Gt = Co ? [...Q.selected].filter((S) => Co.has(S)) : [...Q.selected], Ct = Gt.join("\0"), zs = Gt.length === Q.selected.size ? Q : { ...Q, count: Gt.length }, xo = j({ selected: Q.selected, allMatching: Q.allMatching, except: Q.except, signature: Ct });
|
|
5182
5182
|
ae(() => {
|
|
5183
5183
|
const S = xo.current;
|
|
5184
5184
|
if (S.selected === Q.selected && S.allMatching === Q.allMatching && S.except === Q.except && S.signature === Ct) return;
|
|
5185
5185
|
xo.current = { selected: Q.selected, allMatching: Q.allMatching, except: Q.except, signature: Ct };
|
|
5186
|
-
const
|
|
5187
|
-
S.allMatching === Q.allMatching &&
|
|
5186
|
+
const P = (V, le) => V === le || V.size === le.size && [...V].every((Ae) => le.has(Ae));
|
|
5187
|
+
S.allMatching === Q.allMatching && P(S.selected, Q.selected) && P(S.except, Q.except) && S.signature === Ct || t.onSelectionChange?.(Gt, [...Q.selected]);
|
|
5188
5188
|
}, [Q.selected, Q.allMatching, Q.except, Ct]);
|
|
5189
|
-
const [xt] =
|
|
5189
|
+
const [xt] = G(() => /* @__PURE__ */ new Map());
|
|
5190
5190
|
let Ao;
|
|
5191
5191
|
if (h) {
|
|
5192
5192
|
const S = /* @__PURE__ */ new Set();
|
|
5193
|
-
for (const
|
|
5194
|
-
const
|
|
5195
|
-
S.add(
|
|
5193
|
+
for (const P of c) {
|
|
5194
|
+
const V = H(P);
|
|
5195
|
+
S.add(V), xt.set(V, P);
|
|
5196
5196
|
}
|
|
5197
|
-
for (const
|
|
5198
|
-
!S.has(
|
|
5199
|
-
Ao = [...Q.selected].filter((
|
|
5197
|
+
for (const P of [...xt.keys()])
|
|
5198
|
+
!S.has(P) && !Q.isSelected(P) && xt.delete(P);
|
|
5199
|
+
Ao = [...Q.selected].filter((P) => xt.has(P)).map((P) => xt.get(P));
|
|
5200
5200
|
}
|
|
5201
|
-
const
|
|
5201
|
+
const jt = j(null), To = !Q.allMatching && Q.selected.size === 0;
|
|
5202
5202
|
ae(() => {
|
|
5203
|
-
To && (
|
|
5203
|
+
To && (jt.current = null);
|
|
5204
5204
|
}, [To]);
|
|
5205
|
-
const
|
|
5205
|
+
const Bs = () => {
|
|
5206
5206
|
s.markPicked(), Q.toggleAll();
|
|
5207
|
-
},
|
|
5208
|
-
if (s.markPicked(),
|
|
5209
|
-
X({ ...
|
|
5207
|
+
}, Ds = (S, P) => {
|
|
5208
|
+
if (s.markPicked(), De && ko.has(S)) {
|
|
5209
|
+
X({ ...De, except: De.except.includes(S) ? De.except.filter((ye) => ye !== S) : [...De.except, S] });
|
|
5210
5210
|
return;
|
|
5211
5211
|
}
|
|
5212
|
-
const
|
|
5213
|
-
|
|
5214
|
-
}, No = (S,
|
|
5212
|
+
const V = (q.lines ? zt(q.lines) : q.shown ?? q.filtered).map(H), le = jt.current === null ? -1 : V.indexOf(jt.current), Ae = V.indexOf(S), ke = !Q.isSelected(S);
|
|
5213
|
+
jt.current = S, !P || le < 0 || Ae < 0 ? Q.toggle(S) : Q.set(V.slice(Math.min(le, Ae), Math.max(le, Ae) + 1), ke);
|
|
5214
|
+
}, No = (S, P) => S.write(Ic(s, l.levelColumn, P), {
|
|
5215
5215
|
formats: a,
|
|
5216
5216
|
wording: l,
|
|
5217
|
-
...a.timeZone && { wallClock: (
|
|
5217
|
+
...a.timeZone && { wallClock: (V) => Ie(V, a.timeZone) }
|
|
5218
5218
|
}), Ro = {
|
|
5219
5219
|
rows: r,
|
|
5220
5220
|
filtered: q.filtered,
|
|
@@ -5226,7 +5226,7 @@ function Yu(e, t) {
|
|
|
5226
5226
|
setPageSize: q.setPageSize,
|
|
5227
5227
|
search: q.search,
|
|
5228
5228
|
setSearch: q.setSearch,
|
|
5229
|
-
sort:
|
|
5229
|
+
sort: Be,
|
|
5230
5230
|
toggleSort: q.toggleSort,
|
|
5231
5231
|
hidden: q.hidden,
|
|
5232
5232
|
/* A row header cannot be hidden, so it does not enter `hidden` either. */
|
|
@@ -5235,17 +5235,17 @@ function Yu(e, t) {
|
|
|
5235
5235
|
},
|
|
5236
5236
|
order: q.order,
|
|
5237
5237
|
setOrder: q.setOrder,
|
|
5238
|
-
pinned:
|
|
5239
|
-
setPin:
|
|
5240
|
-
widths:
|
|
5238
|
+
pinned: K ?? pt,
|
|
5239
|
+
setPin: Vt,
|
|
5240
|
+
widths: Iu(u, q.widths),
|
|
5241
5241
|
setWidth: q.setWidth,
|
|
5242
5242
|
autoSizeColumns: () => lc(s.frameTable, q.setWidth),
|
|
5243
5243
|
expanded: q.expanded,
|
|
5244
5244
|
toggleRow: q.toggleRow,
|
|
5245
|
-
filter: Object.fromEntries(
|
|
5245
|
+
filter: Object.fromEntries(F),
|
|
5246
5246
|
setFilter: et,
|
|
5247
|
-
conditionOf: (S) =>
|
|
5248
|
-
selection:
|
|
5247
|
+
conditionOf: (S) => F.find(([P]) => P === S.id)?.[1] ?? null,
|
|
5248
|
+
selection: zs,
|
|
5249
5249
|
view: mt,
|
|
5250
5250
|
grouping: be,
|
|
5251
5251
|
setGrouping: hn,
|
|
@@ -5253,21 +5253,21 @@ function Yu(e, t) {
|
|
|
5253
5253
|
folded: ht,
|
|
5254
5254
|
toggleFold: tt,
|
|
5255
5255
|
foldAll: () => {
|
|
5256
|
-
s.noteFocusBeforeFold(),
|
|
5256
|
+
s.noteFocusBeforeFold(), D((S) => h ? [.../* @__PURE__ */ new Set([...S, ..._n(q.groups)])] : _n(q.groups));
|
|
5257
5257
|
},
|
|
5258
5258
|
unfoldAll: () => {
|
|
5259
|
-
s.noteFocusBeforeFold(),
|
|
5259
|
+
s.noteFocusBeforeFold(), D([]);
|
|
5260
5260
|
},
|
|
5261
5261
|
branches: de,
|
|
5262
5262
|
toggleBranch: (S) => {
|
|
5263
|
-
!ie.has(S) && !he.has(S) || U((
|
|
5263
|
+
!ie.has(S) && !he.has(S) || U((P) => P.includes(S) ? P.filter((V) => V !== S) : [...P, S]);
|
|
5264
5264
|
},
|
|
5265
5265
|
unfoldAllBranches: () => U([...ie, ...Z]),
|
|
5266
5266
|
foldAllBranches: () => U([]),
|
|
5267
5267
|
asCsv: () => No(ts),
|
|
5268
5268
|
exportAs: No,
|
|
5269
5269
|
selectionAsText: () => os(s, a, l),
|
|
5270
|
-
virtual:
|
|
5270
|
+
virtual: It,
|
|
5271
5271
|
rowCount: h ? b : q.filtered.length,
|
|
5272
5272
|
server: h,
|
|
5273
5273
|
request: h ? rt : null,
|
|
@@ -5280,27 +5280,27 @@ function Yu(e, t) {
|
|
|
5280
5280
|
tableState: q,
|
|
5281
5281
|
filter: T,
|
|
5282
5282
|
grouping: qe,
|
|
5283
|
-
tree:
|
|
5283
|
+
tree: Pe,
|
|
5284
5284
|
branchStatus: ne,
|
|
5285
5285
|
retryBranch: se,
|
|
5286
|
-
folded:
|
|
5286
|
+
folded: Ke,
|
|
5287
5287
|
/* Sound: the connection is read type-erased; the hook's `Z`-typed table is rebuilt from it at the one place that knows `Z`. */
|
|
5288
5288
|
publicSnapshot: Ro,
|
|
5289
5289
|
rowKey: H,
|
|
5290
5290
|
formats: a,
|
|
5291
5291
|
wording: l,
|
|
5292
|
-
pins:
|
|
5292
|
+
pins: K,
|
|
5293
5293
|
filterOptions: h ? t.filterOptions : void 0,
|
|
5294
5294
|
exportRows: t.server ? t.exportRows : void 0,
|
|
5295
5295
|
selectedRows: Ao,
|
|
5296
5296
|
matches: h ? be.length > 0 ? t.server ? t.matchCount ?? null : null : b : null,
|
|
5297
|
-
chosenGroup:
|
|
5298
|
-
isPicked:
|
|
5297
|
+
chosenGroup: De,
|
|
5298
|
+
isPicked: Ps,
|
|
5299
5299
|
chooseGroup: (S) => {
|
|
5300
5300
|
S && Q.clear(), X(S && { ...S, key: wt, except: [] });
|
|
5301
5301
|
},
|
|
5302
|
-
pick:
|
|
5303
|
-
pickAll:
|
|
5302
|
+
pick: Ds,
|
|
5303
|
+
pickAll: Bs,
|
|
5304
5304
|
late: So,
|
|
5305
5305
|
error: t.server && !So ? t.error : void 0,
|
|
5306
5306
|
retry: () => {
|
|
@@ -5310,7 +5310,7 @@ function Yu(e, t) {
|
|
|
5310
5310
|
rowFilters: x
|
|
5311
5311
|
}), { ...Ro, ...i, ...{
|
|
5312
5312
|
scrollToRow: (S) => fo(s, S),
|
|
5313
|
-
focusCell: (S,
|
|
5313
|
+
focusCell: (S, P) => jd(s, S, P)
|
|
5314
5314
|
} };
|
|
5315
5315
|
}
|
|
5316
5316
|
function Ju(e) {
|
|
@@ -5323,7 +5323,7 @@ function fr(e, t, n, o, r) {
|
|
|
5323
5323
|
return s;
|
|
5324
5324
|
}
|
|
5325
5325
|
function ho(e, t) {
|
|
5326
|
-
const n =
|
|
5326
|
+
const n = Ve();
|
|
5327
5327
|
e?.register(t, n), ee(() => {
|
|
5328
5328
|
if (e)
|
|
5329
5329
|
return e.register(t, n), e.commit(), () => {
|
|
@@ -5332,13 +5332,13 @@ function ho(e, t) {
|
|
|
5332
5332
|
}, [e, t, n]);
|
|
5333
5333
|
}
|
|
5334
5334
|
function Xu({ children: e, className: t, size: n = "sm", of: o, ref: r, ...s }) {
|
|
5335
|
-
const i =
|
|
5335
|
+
const i = Dt(o, "Toolbar");
|
|
5336
5336
|
ho(i?.registry, "toolbar");
|
|
5337
5337
|
const a = i?.registry;
|
|
5338
5338
|
return /* @__PURE__ */ f(ps, { registry: a ?? null, className: t, size: n, frame: { ...s, ref: r }, children: e });
|
|
5339
5339
|
}
|
|
5340
5340
|
function Zu({ placeholder: e, "aria-label": t, className: n, size: o, grow: r, of: s, ...i }) {
|
|
5341
|
-
const a =
|
|
5341
|
+
const a = Dt(s, "Search"), l = cn(o), c = we();
|
|
5342
5342
|
if (ho(a?.registry, "search"), !a) return null;
|
|
5343
5343
|
const { snapshot: u } = a;
|
|
5344
5344
|
return /* @__PURE__ */ f(
|
|
@@ -5349,7 +5349,7 @@ function Zu({ placeholder: e, "aria-label": t, className: n, size: o, grow: r, o
|
|
|
5349
5349
|
...i,
|
|
5350
5350
|
size: l,
|
|
5351
5351
|
type: "search",
|
|
5352
|
-
className:
|
|
5352
|
+
className: I(r && w.searchGrow, n),
|
|
5353
5353
|
value: u.search,
|
|
5354
5354
|
onChange: (d) => {
|
|
5355
5355
|
a.registry.markTyped(d.target.value !== ""), u.setSearch(d.target.value);
|
|
@@ -5367,78 +5367,78 @@ function Zu({ placeholder: e, "aria-label": t, className: n, size: o, grow: r, o
|
|
|
5367
5367
|
);
|
|
5368
5368
|
}
|
|
5369
5369
|
function Qu({ size: e, of: t, ref: n, ...o }) {
|
|
5370
|
-
const r =
|
|
5371
|
-
|
|
5372
|
-
const u =
|
|
5370
|
+
const r = Dt(t, "ColumnMenu"), s = cn(e), i = we(), [a, l] = G(!1), c = j(null);
|
|
5371
|
+
Vs(n, () => c.current);
|
|
5372
|
+
const u = j(null), d = Ve(), [h, b] = G(null);
|
|
5373
5373
|
ee(() => {
|
|
5374
5374
|
if (!h || !u.current) return;
|
|
5375
5375
|
const A = Array.from(u.current.children).find(
|
|
5376
5376
|
(Y) => Y.dataset.column === h.id
|
|
5377
|
-
),
|
|
5378
|
-
(
|
|
5377
|
+
), O = A?.querySelector(h.key), B = h.otherwise ? A?.querySelector(h.otherwise) : void 0;
|
|
5378
|
+
(O && !O.disabled ? O : B)?.focus();
|
|
5379
5379
|
}, [h]);
|
|
5380
|
-
const [m, p] =
|
|
5380
|
+
const [m, p] = G(null), g = j(null), v = () => {
|
|
5381
5381
|
window.clearInterval(g.current?.timer), g.current = null, p(null);
|
|
5382
5382
|
}, y = m !== null;
|
|
5383
5383
|
if (ae(() => {
|
|
5384
5384
|
if (!y) return;
|
|
5385
|
-
const A = (
|
|
5386
|
-
|
|
5385
|
+
const A = (O) => {
|
|
5386
|
+
O.key === "Escape" && (O.stopPropagation(), v());
|
|
5387
5387
|
};
|
|
5388
5388
|
return window.addEventListener("keydown", A, !0), () => window.removeEventListener("keydown", A, !0);
|
|
5389
5389
|
}, [y]), ae(() => () => window.clearInterval(g.current?.timer), []), !r) return null;
|
|
5390
|
-
const { registry: k, snapshot: _ } = r, x = k.hook, T = k.inPinOrder(Nr(k.modelColumns(x.rows, x.formats, x.wording), _.order)), N = k.pins(), R = (A) => k.columnById(A)?.spec.heading, C = (A,
|
|
5391
|
-
const
|
|
5392
|
-
return
|
|
5393
|
-
},
|
|
5394
|
-
const
|
|
5395
|
-
if (!
|
|
5396
|
-
[
|
|
5397
|
-
const [ce, U] =
|
|
5390
|
+
const { registry: k, snapshot: _ } = r, x = k.hook, T = k.inPinOrder(Nr(k.modelColumns(x.rows, x.formats, x.wording), _.order)), N = k.pins(), R = (A) => k.columnById(A)?.spec.heading, C = (A, O) => N[A] === N[O] && R(A)?.id === R(O)?.id, L = (A, O) => {
|
|
5391
|
+
const B = T[A + O];
|
|
5392
|
+
return B !== void 0 && C(B.id, T[A].id);
|
|
5393
|
+
}, E = (A, O) => {
|
|
5394
|
+
const B = T.map((ie) => ie.id), Y = A + O;
|
|
5395
|
+
if (!L(A, O)) return;
|
|
5396
|
+
[B[A], B[Y]] = [B[Y], B[A]], _.setOrder(B);
|
|
5397
|
+
const [ce, U] = O < 0 ? ["forward", "backward"] : ["backward", "forward"];
|
|
5398
5398
|
b({ id: T[A].id, key: `[data-direction="${ce}"]`, otherwise: `[data-direction="${U}"]` });
|
|
5399
|
-
},
|
|
5400
|
-
const A = g.current,
|
|
5401
|
-
p({ from: A.from, place: fr(A.boxes,
|
|
5402
|
-
}, X = (A,
|
|
5399
|
+
}, D = (A) => A.clientY - A.scroller.getBoundingClientRect().top + A.scroller.scrollTop, $ = () => {
|
|
5400
|
+
const A = g.current, O = D(A), B = A.hi > A.lo ? A.boxes[A.lo + 1].top - A.boxes[A.lo].top : 0;
|
|
5401
|
+
p({ from: A.from, place: fr(A.boxes, O, A.from, A.lo, A.hi), dy: O - A.start, step: B });
|
|
5402
|
+
}, X = (A, O) => {
|
|
5403
5403
|
if (A.button !== 0 || g.current || !u.current) return;
|
|
5404
|
-
const
|
|
5404
|
+
const B = u.current.parentElement, Y = B.getBoundingClientRect().top - B.scrollTop, ce = Array.from(u.current.querySelectorAll("[data-column]")).map((de) => {
|
|
5405
5405
|
const ne = de.getBoundingClientRect();
|
|
5406
5406
|
return { top: ne.top - Y, bottom: ne.bottom - Y };
|
|
5407
5407
|
});
|
|
5408
|
-
let U =
|
|
5409
|
-
for (; U > 0 && C(T[U - 1].id, T[
|
|
5410
|
-
for (; ie < T.length - 1 && C(T[ie + 1].id, T[
|
|
5408
|
+
let U = O, ie = O;
|
|
5409
|
+
for (; U > 0 && C(T[U - 1].id, T[O].id); ) U--;
|
|
5410
|
+
for (; ie < T.length - 1 && C(T[ie + 1].id, T[O].id); ) ie++;
|
|
5411
5411
|
A.currentTarget.setPointerCapture?.(A.pointerId);
|
|
5412
|
-
const he = { from:
|
|
5412
|
+
const he = { from: O, lo: U, hi: ie, boxes: ce, start: A.clientY - Y, clientY: A.clientY, scroller: B, timer: 0 };
|
|
5413
5413
|
g.current = he, he.timer = window.setInterval(() => {
|
|
5414
|
-
const de =
|
|
5415
|
-
|
|
5416
|
-
}, 16),
|
|
5417
|
-
},
|
|
5418
|
-
g.current && (g.current.clientY = A.clientY,
|
|
5419
|
-
},
|
|
5414
|
+
const de = B.getBoundingClientRect(), ne = 24, Te = he.clientY < de.top + ne ? -8 : he.clientY > de.bottom - ne ? 8 : 0, me = B.scrollTop;
|
|
5415
|
+
B.scrollTop += Te, B.scrollTop !== me && $();
|
|
5416
|
+
}, 16), $();
|
|
5417
|
+
}, K = (A) => {
|
|
5418
|
+
g.current && (g.current.clientY = A.clientY, $());
|
|
5419
|
+
}, z = () => {
|
|
5420
5420
|
const A = g.current;
|
|
5421
5421
|
if (!A) return;
|
|
5422
|
-
const
|
|
5423
|
-
if (v(),
|
|
5424
|
-
const
|
|
5425
|
-
|
|
5426
|
-
}, H = (A) => m ? A === m.from ? m.dy : m.place > m.from && A > m.from && A <= m.place ? -m.step : m.place < m.from && A < m.from && A >= m.place ? m.step : 0 : 0, re = (A,
|
|
5427
|
-
const Y = N[A] ===
|
|
5428
|
-
return /* @__PURE__ */ f(Jt, { content: Y ? i.unpinHint :
|
|
5422
|
+
const O = fr(A.boxes, D(A), A.from, A.lo, A.hi);
|
|
5423
|
+
if (v(), O === A.from) return;
|
|
5424
|
+
const B = T.map((Y) => Y.id);
|
|
5425
|
+
B.splice(O, 0, B.splice(A.from, 1)[0]), _.setOrder(B);
|
|
5426
|
+
}, H = (A) => m ? A === m.from ? m.dy : m.place > m.from && A > m.from && A <= m.place ? -m.step : m.place < m.from && A < m.from && A >= m.place ? m.step : 0 : 0, re = (A, O, B) => {
|
|
5427
|
+
const Y = N[A] === B;
|
|
5428
|
+
return /* @__PURE__ */ f(Jt, { content: Y ? i.unpinHint : B === "start" ? i.pinToStartHint : i.pinToEndHint, children: /* @__PURE__ */ f(
|
|
5429
5429
|
"button",
|
|
5430
5430
|
{
|
|
5431
5431
|
type: "button",
|
|
5432
|
-
className:
|
|
5433
|
-
"data-pin":
|
|
5434
|
-
"aria-label": Y ? i.unpinColumn(
|
|
5432
|
+
className: I(w.move, Y && w.pinOn),
|
|
5433
|
+
"data-pin": B,
|
|
5434
|
+
"aria-label": Y ? i.unpinColumn(O) : B === "start" ? i.pinColumnToStart(O) : i.pinColumnToEnd(O),
|
|
5435
5435
|
onClick: () => {
|
|
5436
|
-
_.setPin(A, Y ? null :
|
|
5436
|
+
_.setPin(A, Y ? null : B), b({ id: A, key: `[data-pin="${B}"]` });
|
|
5437
5437
|
},
|
|
5438
5438
|
children: /* @__PURE__ */ f("svg", { viewBox: "0 0 10 10", width: "10", height: "10", "aria-hidden": "true", children: /* @__PURE__ */ f(
|
|
5439
5439
|
"path",
|
|
5440
5440
|
{
|
|
5441
|
-
d:
|
|
5441
|
+
d: B === "start" ? "M2 1.5v7M8.5 5H4.5M6 3.5 4.5 5 6 6.5" : "M8 1.5v7M1.5 5h4M4 3.5 5.5 5 4 6.5",
|
|
5442
5442
|
fill: "none",
|
|
5443
5443
|
stroke: "currentColor",
|
|
5444
5444
|
strokeWidth: "1.4",
|
|
@@ -5449,7 +5449,7 @@ function Qu({ size: e, of: t, ref: n, ...o }) {
|
|
|
5449
5449
|
}
|
|
5450
5450
|
) });
|
|
5451
5451
|
};
|
|
5452
|
-
return /* @__PURE__ */
|
|
5452
|
+
return /* @__PURE__ */ M(fe, { children: [
|
|
5453
5453
|
/* @__PURE__ */ f(
|
|
5454
5454
|
ue,
|
|
5455
5455
|
{
|
|
@@ -5463,7 +5463,7 @@ function Qu({ size: e, of: t, ref: n, ...o }) {
|
|
|
5463
5463
|
children: i.columns
|
|
5464
5464
|
}
|
|
5465
5465
|
),
|
|
5466
|
-
/* @__PURE__ */
|
|
5466
|
+
/* @__PURE__ */ M(
|
|
5467
5467
|
nn,
|
|
5468
5468
|
{
|
|
5469
5469
|
open: a,
|
|
@@ -5475,16 +5475,16 @@ function Qu({ size: e, of: t, ref: n, ...o }) {
|
|
|
5475
5475
|
id: d,
|
|
5476
5476
|
className: w.columnsPanel,
|
|
5477
5477
|
children: [
|
|
5478
|
-
/* @__PURE__ */ f("ul", { ref: u, className: w.columnsList, "data-dragging": y || void 0, "aria-label": i.arrangeColumns, children: T.map((A,
|
|
5479
|
-
const
|
|
5480
|
-
return /* @__PURE__ */
|
|
5478
|
+
/* @__PURE__ */ f("ul", { ref: u, className: w.columnsList, "data-dragging": y || void 0, "aria-label": i.arrangeColumns, children: T.map((A, O) => {
|
|
5479
|
+
const B = A.label ?? A.id, Y = H(O), ce = R(A.id), U = ce && ce.id !== R(T[O - 1]?.id ?? "")?.id;
|
|
5480
|
+
return /* @__PURE__ */ M(Is, { children: [
|
|
5481
5481
|
U && /* @__PURE__ */ f("li", { className: w.columnsGroup, children: ce.label }),
|
|
5482
|
-
/* @__PURE__ */
|
|
5482
|
+
/* @__PURE__ */ M(
|
|
5483
5483
|
"li",
|
|
5484
5484
|
{
|
|
5485
5485
|
className: w.columnsEntry,
|
|
5486
5486
|
"data-column": A.id,
|
|
5487
|
-
"data-lifted": m?.from ===
|
|
5487
|
+
"data-lifted": m?.from === O || void 0,
|
|
5488
5488
|
style: Y ? { transform: `translateY(${Y}px)` } : void 0,
|
|
5489
5489
|
children: [
|
|
5490
5490
|
/* @__PURE__ */ f(
|
|
@@ -5493,9 +5493,9 @@ function Qu({ size: e, of: t, ref: n, ...o }) {
|
|
|
5493
5493
|
className: w.columnGrip,
|
|
5494
5494
|
"data-grip": "",
|
|
5495
5495
|
"aria-hidden": "true",
|
|
5496
|
-
onPointerDown: (ie) => X(ie,
|
|
5497
|
-
onPointerMove:
|
|
5498
|
-
onPointerUp:
|
|
5496
|
+
onPointerDown: (ie) => X(ie, O),
|
|
5497
|
+
onPointerMove: K,
|
|
5498
|
+
onPointerUp: z,
|
|
5499
5499
|
onPointerCancel: v,
|
|
5500
5500
|
onLostPointerCapture: v,
|
|
5501
5501
|
children: /* @__PURE__ */ f(si, {})
|
|
@@ -5504,7 +5504,7 @@ function Qu({ size: e, of: t, ref: n, ...o }) {
|
|
|
5504
5504
|
/* @__PURE__ */ f(
|
|
5505
5505
|
ct,
|
|
5506
5506
|
{
|
|
5507
|
-
label:
|
|
5507
|
+
label: B,
|
|
5508
5508
|
checked: !_.hidden.includes(A.id),
|
|
5509
5509
|
disabled: A.hideable === !1,
|
|
5510
5510
|
onCheckedChange: () => _.toggleColumn(A.id)
|
|
@@ -5516,9 +5516,9 @@ function Qu({ size: e, of: t, ref: n, ...o }) {
|
|
|
5516
5516
|
type: "button",
|
|
5517
5517
|
className: w.move,
|
|
5518
5518
|
"data-direction": "forward",
|
|
5519
|
-
"aria-label": i.columnForward(
|
|
5520
|
-
disabled: !O
|
|
5521
|
-
onClick: () =>
|
|
5519
|
+
"aria-label": i.columnForward(B),
|
|
5520
|
+
disabled: !L(O, -1),
|
|
5521
|
+
onClick: () => E(O, -1),
|
|
5522
5522
|
children: /* @__PURE__ */ f("svg", { viewBox: "0 0 10 10", width: "10", height: "10", "aria-hidden": "true", children: /* @__PURE__ */ f("path", { d: "M2 6.5 5 3.5l3 3", fill: "none", stroke: "currentColor", strokeWidth: "1.4", strokeLinecap: "round", strokeLinejoin: "round" }) })
|
|
5523
5523
|
}
|
|
5524
5524
|
) }),
|
|
@@ -5528,14 +5528,14 @@ function Qu({ size: e, of: t, ref: n, ...o }) {
|
|
|
5528
5528
|
type: "button",
|
|
5529
5529
|
className: w.move,
|
|
5530
5530
|
"data-direction": "backward",
|
|
5531
|
-
"aria-label": i.columnBackward(
|
|
5532
|
-
disabled: !O
|
|
5533
|
-
onClick: () =>
|
|
5531
|
+
"aria-label": i.columnBackward(B),
|
|
5532
|
+
disabled: !L(O, 1),
|
|
5533
|
+
onClick: () => E(O, 1),
|
|
5534
5534
|
children: /* @__PURE__ */ f("svg", { viewBox: "0 0 10 10", width: "10", height: "10", "aria-hidden": "true", children: /* @__PURE__ */ f("path", { d: "M2 3.5 5 6.5l3-3", fill: "none", stroke: "currentColor", strokeWidth: "1.4", strokeLinecap: "round", strokeLinejoin: "round" }) })
|
|
5535
5535
|
}
|
|
5536
5536
|
) }),
|
|
5537
|
-
re(A.id,
|
|
5538
|
-
re(A.id,
|
|
5537
|
+
re(A.id, B, "start"),
|
|
5538
|
+
re(A.id, B, "end")
|
|
5539
5539
|
]
|
|
5540
5540
|
}
|
|
5541
5541
|
)
|
|
@@ -5550,7 +5550,7 @@ function Qu({ size: e, of: t, ref: n, ...o }) {
|
|
|
5550
5550
|
] });
|
|
5551
5551
|
}
|
|
5552
5552
|
function ef({ format: e, filename: t, onExport: n, label: o, size: r, of: s, ...i }) {
|
|
5553
|
-
const a =
|
|
5553
|
+
const a = Dt(s, "Export"), l = cn(r), c = we(), [u, d] = G(!1), h = j(!1), [b, m] = G(null);
|
|
5554
5554
|
if (!a) return null;
|
|
5555
5555
|
const { snapshot: p, registry: g } = a, v = g.hook?.exportRows, y = e ?? ts, k = (x) => {
|
|
5556
5556
|
if (n) {
|
|
@@ -5560,9 +5560,9 @@ function ef({ format: e, filename: t, onExport: n, label: o, size: r, of: s, ...
|
|
|
5560
5560
|
const T = URL.createObjectURL(new Blob([x], { type: y.mime })), N = document.createElement("a");
|
|
5561
5561
|
N.href = T;
|
|
5562
5562
|
const R = `${c.exportFileName.replace(/\.[^.]*$/, "")}.${y.extension}`;
|
|
5563
|
-
N.download =
|
|
5563
|
+
N.download = Gc(t ?? R, R), N.click(), setTimeout(() => URL.revokeObjectURL(T), 1e4), dt(c.exportDone);
|
|
5564
5564
|
};
|
|
5565
|
-
return /* @__PURE__ */
|
|
5565
|
+
return /* @__PURE__ */ M(fe, { children: [
|
|
5566
5566
|
/* @__PURE__ */ f(ue, { ...i, size: l, onClick: () => {
|
|
5567
5567
|
if (m(null), !v || !p.request) {
|
|
5568
5568
|
k(p.exportAs(y));
|
|
@@ -5582,57 +5582,57 @@ function ef({ format: e, filename: t, onExport: n, label: o, size: r, of: s, ...
|
|
|
5582
5582
|
] });
|
|
5583
5583
|
}
|
|
5584
5584
|
function tf({ pageSizes: e = [10, 25, 50], className: t, of: n, ...o }) {
|
|
5585
|
-
const r =
|
|
5585
|
+
const r = Dt(n, "Pagination"), s = we(), i = We();
|
|
5586
5586
|
ho(r?.registry, "pagination"), r?.registry.tree && te("tree-pagination", "`Pagination` is passed over with `childRows`: a page cut through a branch tears rows from their parent. A large tree uses `virtual`.");
|
|
5587
|
-
const a = r?.snapshot, l = a?.rowCount ?? 0, c = r?.registry.projection(), u = c?.visible ?? [], d = !c?.lines || a?.server ? -1 :
|
|
5587
|
+
const a = r?.snapshot, l = a?.rowCount ?? 0, c = r?.registry.projection(), u = c?.visible ?? [], d = !c?.lines || a?.server ? -1 : zt(c.lines).indexOf(u[0]), h = !a || l === 0 ? 0 : d >= 0 ? d + 1 : (a.page - 1) * a.pageSize + 1, b = a ? d >= 0 ? d + u.length : Math.min(a.page * a.pageSize, l) : 0, m = a && !r?.registry.skeleton ? s.pageRange(h, b, l, { from: i.count(h), to: i.count(b), total: i.count(l) }) : "", p = j(!1), [g, v] = G(null);
|
|
5588
5588
|
ae(() => {
|
|
5589
5589
|
p.current && (p.current = !1, v(m));
|
|
5590
5590
|
}, [a?.page]);
|
|
5591
|
-
const y =
|
|
5591
|
+
const y = j(null), k = j(null);
|
|
5592
5592
|
if (ee(() => {
|
|
5593
|
-
const
|
|
5593
|
+
const $ = k.current;
|
|
5594
5594
|
k.current = null;
|
|
5595
5595
|
const X = Array.from(y.current?.querySelectorAll("button") ?? []);
|
|
5596
|
-
if (
|
|
5597
|
-
X.map((
|
|
5596
|
+
if ($ === null || !X[$]?.disabled) return;
|
|
5597
|
+
X.map((z, H) => ({ button: z, index: H })).filter(({ button: z }) => !z.disabled).sort((z, H) => Math.abs(z.index - $) - Math.abs(H.index - $))[0]?.button.focus();
|
|
5598
5598
|
}, [a?.page]), !r || r.snapshot.virtual || r.registry.tree) return null;
|
|
5599
|
-
const { snapshot: _ } = r, x = r.registry.hook?.tableState.chosenPageSize ?? null, T = r.registry.framed, N = T && x === null, R = N || e.includes(_.pageSize) ? e : [...e, _.pageSize].sort((
|
|
5599
|
+
const { snapshot: _ } = r, x = r.registry.hook?.tableState.chosenPageSize ?? null, T = r.registry.framed, N = T && x === null, R = N || e.includes(_.pageSize) ? e : [...e, _.pageSize].sort(($, X) => $ - X), C = ($, X, K) => {
|
|
5600
5600
|
if (r.registry.pageHold) return r.registry.pageHold();
|
|
5601
|
-
k.current = document.activeElement ===
|
|
5602
|
-
},
|
|
5601
|
+
k.current = document.activeElement === K ? X : null, p.current = !0, v((z) => z ?? ""), _.setPage($);
|
|
5602
|
+
}, L = _.page <= 1, E = _.page >= _.pageCount, D = /* @__PURE__ */ M("nav", { ...o, "aria-label": s.pagination, className: I(w.pagination, t), children: [
|
|
5603
5603
|
/* @__PURE__ */ f("span", { children: m }),
|
|
5604
5604
|
g !== null && /* @__PURE__ */ f(He, { role: "status", children: g && m }),
|
|
5605
|
-
/* @__PURE__ */
|
|
5606
|
-
/* @__PURE__ */
|
|
5605
|
+
/* @__PURE__ */ M("div", { className: w.paginationControls, children: [
|
|
5606
|
+
/* @__PURE__ */ M("label", { className: w.pageSize, children: [
|
|
5607
5607
|
s.rows,
|
|
5608
|
-
/* @__PURE__ */
|
|
5608
|
+
/* @__PURE__ */ M(
|
|
5609
5609
|
Yn,
|
|
5610
5610
|
{
|
|
5611
5611
|
size: "sm",
|
|
5612
|
-
chars: Math.max(...R.map((
|
|
5612
|
+
chars: Math.max(...R.map(($) => String($).length), ...T ? [s.fit.length] : []),
|
|
5613
5613
|
value: N ? "fit" : _.pageSize,
|
|
5614
|
-
onChange: (
|
|
5614
|
+
onChange: ($) => r.registry.pageHold ? r.registry.pageHold() : _.setPageSize($.target.value === "fit" ? "fit" : Number($.target.value)),
|
|
5615
5615
|
"aria-label": s.rowsPerPage,
|
|
5616
5616
|
children: [
|
|
5617
5617
|
T && /* @__PURE__ */ f("option", { value: "fit", children: s.fit }),
|
|
5618
|
-
R.map((
|
|
5618
|
+
R.map(($) => /* @__PURE__ */ f("option", { value: $, children: $ }, $))
|
|
5619
5619
|
]
|
|
5620
5620
|
}
|
|
5621
5621
|
)
|
|
5622
5622
|
] }),
|
|
5623
|
-
/* @__PURE__ */
|
|
5624
|
-
/* @__PURE__ */ f(Nt, { size: "sm", disabled:
|
|
5625
|
-
/* @__PURE__ */ f(Nt, { size: "sm", disabled:
|
|
5623
|
+
/* @__PURE__ */ M("span", { className: w.pageSteps, ref: y, children: [
|
|
5624
|
+
/* @__PURE__ */ f(Nt, { size: "sm", disabled: L, "aria-label": s.firstPage, onClick: ($) => C(1, 0, $.currentTarget), children: /* @__PURE__ */ f(Mo, { className: w.turned }) }),
|
|
5625
|
+
/* @__PURE__ */ f(Nt, { size: "sm", disabled: L, "aria-label": s.previousPage, onClick: ($) => C(_.page - 1, 1, $.currentTarget), children: /* @__PURE__ */ f(An, { className: w.turned }) }),
|
|
5626
5626
|
/* @__PURE__ */ f("span", { className: w.paginationStatus, children: r.registry.skeleton ? "" : s.pageOfPages(_.page, _.pageCount, {
|
|
5627
5627
|
page: i.count(_.page),
|
|
5628
5628
|
total: i.count(_.pageCount)
|
|
5629
5629
|
}) }),
|
|
5630
|
-
/* @__PURE__ */ f(Nt, { size: "sm", disabled:
|
|
5631
|
-
/* @__PURE__ */ f(Nt, { size: "sm", disabled:
|
|
5630
|
+
/* @__PURE__ */ f(Nt, { size: "sm", disabled: E, "aria-label": s.nextPage, onClick: ($) => C(_.page + 1, 2, $.currentTarget), children: /* @__PURE__ */ f(An, {}) }),
|
|
5631
|
+
/* @__PURE__ */ f(Nt, { size: "sm", disabled: E, "aria-label": s.lastPage, onClick: ($) => C(_.pageCount, 3, $.currentTarget), children: /* @__PURE__ */ f(Mo, {}) })
|
|
5632
5632
|
] })
|
|
5633
5633
|
] })
|
|
5634
5634
|
] });
|
|
5635
|
-
return r.inside ? r.footerTarget ? vr(
|
|
5635
|
+
return r.inside ? r.footerTarget ? vr(D, r.footerTarget) : null : D;
|
|
5636
5636
|
}
|
|
5637
5637
|
function nf(e) {
|
|
5638
5638
|
return e;
|
|
@@ -5647,9 +5647,9 @@ export {
|
|
|
5647
5647
|
Ju as column,
|
|
5648
5648
|
qu as columnFilter,
|
|
5649
5649
|
ts as csv,
|
|
5650
|
-
|
|
5650
|
+
Fo as groupPath,
|
|
5651
5651
|
nf as rowFilter,
|
|
5652
|
-
|
|
5652
|
+
Lr as tableModel,
|
|
5653
5653
|
Yu as useTable,
|
|
5654
5654
|
cc as useTableSelection
|
|
5655
5655
|
};
|