@wirecore/wirelayer-react 0.10.0 → 0.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/Affix/Affix.d.ts +5 -1
- package/dist/components/Affix/Affix.d.ts.map +1 -1
- package/dist/components/NotificationCenter/NotificationCenter.d.ts +6 -3
- package/dist/components/NotificationCenter/NotificationCenter.d.ts.map +1 -1
- package/dist/components/SidebarNav/SidebarNav.d.ts +13 -5
- package/dist/components/SidebarNav/SidebarNav.d.ts.map +1 -1
- package/dist/components/Sortable/Sortable.d.ts +6 -1
- package/dist/components/Sortable/Sortable.d.ts.map +1 -1
- package/dist/components/Tour/Tour.d.ts +10 -1
- package/dist/components/Tour/Tour.d.ts.map +1 -1
- package/dist/data-table/DataTable.d.ts +8 -3
- package/dist/data-table/DataTable.d.ts.map +1 -1
- package/dist/data-table/index.d.ts +1 -1
- package/dist/data-table/index.d.ts.map +1 -1
- package/dist/data-table/types.d.ts +12 -1
- package/dist/data-table/types.d.ts.map +1 -1
- package/dist/data-table.js +762 -752
- package/dist/index.js +1858 -1778
- package/llms-full.txt +67 -4
- package/llms.txt +1 -0
- package/package.json +3 -3
package/dist/data-table.js
CHANGED
|
@@ -305,18 +305,18 @@ var Zn = (e) => "getRows" in e ? pt(e.getRows) : e, Qn = "input, textarea, selec
|
|
|
305
305
|
number: 56,
|
|
306
306
|
actions: 88
|
|
307
307
|
}, er = () => void 0;
|
|
308
|
-
function tr({ classes: a, data: o, dataSource: s, cacheTime: ee = 0, searchDebounce: fe = 300, pivot: _e, columns: be, caption: we, getRowId: Ve, pageSize: h, onPageSizeChange: Je, pageSizeOptions: Ye, page: ft, onPageChange: pt, first: ht, onFirstChange: yt, paginatorPosition: Wt = "bottom", paginatorEdges: Yt, paginatorAlign: $t, sorting: en, onSortingChange: sn, defaultSorting: ln, sortMode: un = "single", manual: dn = !1, rowCount: fn, selectable: pn = !1, selectionMode: mn = "multiple", selection: hn, onSelectionChange: gn, selectedRows: _n, onSelectedRowsChange: vn, selectOnRowClick: yn = !1, isRowSelectable: bn, selectAllMode: xn = "page", allSelection: Sn, onAllSelectionChange: Cn, rowLabel: wn, loading: Tn = !1, loadingVariant: En = "overlay", emptyText: Dn, noResultsText: On, loadingText: kn, selectAllLabel: An, getSubRows: tr, treeFilterMode: nr, expanded: rr, defaultExpanded: ir, onExpandedChange: ar, expandLabel: or, rowExpandable: sr, expansion: cr, advancedFilter: lr, advancedFilterValue: ur, onAdvancedFilterValueChange: dr, renderAdvancedFilter: fr, search: pr = !1, globalFilter: mr, onGlobalFilterChange: hr, rowKeywords: gr, highlightSearch: _r = !1, filters: vr, onFiltersChange: yr, filterDisplay: br = "row", showFilters: xr, onShowFiltersChange: Sr, filterToggle: Cr = !1, filterReset: wr = !1, maxConstraints: Tr = 2, resizable: Er = !1, columnToggle: Dr = !1, hiddenColumns: Or, onHiddenColumnsChange: kr, columnMenu: Ar = !1, reorderableColumns: jr = !1, columnOrder: Mr, onColumnOrderChange: Nr, pinnedColumns: Pr, onPinnedColumnsChange: Fr, exportFilename: Ir, csvSeparator: Lr, exportFormats: Rr, groupBy: zr, onGroupByChange: Br, frozenRows: Vr, reorderableRows: Hr = !1, onRowReorder: Ur, rowNumbers: Wr = !1, rowActions: Gr, onRowAction: Kr, contextMenu: qr = !1, rowClass: Jr, rowHref: Yr, onRowClick: Xr, navigation: Zr = "tab", statusBar: Qr = !1, cellSelection: w = !1, onCellSelectionChange: $r, onCellPaste: ei, onSave: ti, find: ni = !1, wrapHeaders: ri = !1, verticalHeaders: ii = !1, editMode: T = "cell", editTrigger: ai = "click", onCellEdit: oi, onRowEdit: si, size: ci, onSizeChange: li, densityToggle: ui = !1, gridlines: di = !1, bordered: fi = !1, striped: pi = !1, fullscreenToggle: mi = !1, scrollHeight: hi, features: gi, virtual: _i = !1, rowHeight: vi = 41, onLoadMore: yi, onScrollEnd: bi,
|
|
309
|
-
let
|
|
308
|
+
function tr({ classes: a, data: o, dataSource: s, cacheTime: ee = 0, searchDebounce: fe = 300, pivot: _e, columns: be, caption: we, getRowId: Ve, pageSize: h, onPageSizeChange: Je, pageSizeOptions: Ye, page: ft, onPageChange: pt, first: ht, onFirstChange: yt, paginatorPosition: Wt = "bottom", paginatorEdges: Yt, paginatorAlign: $t, sorting: en, onSortingChange: sn, defaultSorting: ln, sortMode: un = "single", manual: dn = !1, rowCount: fn, selectable: pn = !1, selectionMode: mn = "multiple", selection: hn, onSelectionChange: gn, selectedRows: _n, onSelectedRowsChange: vn, selectOnRowClick: yn = !1, isRowSelectable: bn, selectAllMode: xn = "page", allSelection: Sn, onAllSelectionChange: Cn, rowLabel: wn, loading: Tn = !1, loadingVariant: En = "overlay", emptyText: Dn, noResultsText: On, loadingText: kn, selectAllLabel: An, getSubRows: tr, treeFilterMode: nr, expanded: rr, defaultExpanded: ir, onExpandedChange: ar, expandLabel: or, rowExpandable: sr, expansion: cr, advancedFilter: lr, advancedFilterValue: ur, onAdvancedFilterValueChange: dr, renderAdvancedFilter: fr, search: pr = !1, globalFilter: mr, onGlobalFilterChange: hr, rowKeywords: gr, highlightSearch: _r = !1, filters: vr, onFiltersChange: yr, filterDisplay: br = "row", showFilters: xr, onShowFiltersChange: Sr, filterToggle: Cr = !1, filterReset: wr = !1, maxConstraints: Tr = 2, resizable: Er = !1, columnToggle: Dr = !1, hiddenColumns: Or, onHiddenColumnsChange: kr, columnMenu: Ar = !1, reorderableColumns: jr = !1, columnOrder: Mr, onColumnOrderChange: Nr, pinnedColumns: Pr, onPinnedColumnsChange: Fr, exportFilename: Ir, csvSeparator: Lr, exportFormats: Rr, groupBy: zr, onGroupByChange: Br, frozenRows: Vr, reorderableRows: Hr = !1, onRowReorder: Ur, rowNumbers: Wr = !1, rowActions: Gr, onRowAction: Kr, contextMenu: qr = !1, rowClass: Jr, rowHref: Yr, onRowClick: Xr, navigation: Zr = "tab", statusBar: Qr = !1, cellSelection: w = !1, onCellSelectionChange: $r, onCellPaste: ei, onSave: ti, find: ni = !1, wrapHeaders: ri = !1, verticalHeaders: ii = !1, editMode: T = "cell", editTrigger: ai = "click", onCellEdit: oi, onRowEdit: si, size: ci, onSizeChange: li, densityToggle: ui = !1, gridlines: di = !1, bordered: fi = !1, striped: pi = !1, fullscreenToggle: mi = !1, scrollHeight: hi, features: gi, virtual: _i = !1, rowHeight: vi = 41, onLoadMore: yi, onScrollEnd: bi, onScroll: xi, stateKey: Si, stateStorage: Ci = "session", stateExclude: wi = Yn, toolbar: Ti, toolbarStart: Ei, toolbarEnd: Di, empty: Oi, noResults: ki, loadingContent: Ai, ref: ji, className: Mi, ...Ni }) {
|
|
309
|
+
let Pi = n("dataTable", ve, a), Fi = n("menu", Ke)(), E = e(), { locale: D } = t(), O = E.dataTable, Ii = tn(), Li = v(null), [Ri] = y(() => Object.assign({}, ...gi ?? [])), zi = (e, t) => wn?.(e, t) ?? O.row(t), Bi = (e, t) => or?.(e, t) ?? O.subRows(zi(e, t)), [Vi, Hi] = y({
|
|
310
310
|
status: "idle",
|
|
311
311
|
items: []
|
|
312
|
-
}),
|
|
312
|
+
}), Ui = v(s), [Wi] = y(() => pe({ source: { getItems: (e) => Zn(Ui.current).getItems(e) } }));
|
|
313
313
|
g(() => {
|
|
314
|
-
|
|
314
|
+
Ui.current = s, Wi.configure({
|
|
315
315
|
ttl: ee,
|
|
316
316
|
debounce: fe
|
|
317
317
|
});
|
|
318
|
-
}), g(() => (
|
|
319
|
-
let
|
|
318
|
+
}), g(() => (Wi.configure({ onChange: Hi }), () => Wi.dispose()), [Wi]);
|
|
319
|
+
let Gi = _(() => {
|
|
320
320
|
if (!_e) return null;
|
|
321
321
|
let e = /* @__PURE__ */ new Map(), t = (n) => n.forEach((n) => n.columns ? t(n.columns) : e.set(n.id, n));
|
|
322
322
|
t(be);
|
|
@@ -338,82 +338,82 @@ function tr({ classes: a, data: o, dataSource: s, cacheTime: ee = 0, searchDebou
|
|
|
338
338
|
be,
|
|
339
339
|
D,
|
|
340
340
|
O
|
|
341
|
-
]), [
|
|
341
|
+
]), [Ki, qi] = y(() => Ce("and", "root")), Ji = ur ?? Ki, [Yi, Xi] = y(!1), Zi = _(() => Array.isArray(lr) ? lr : lr ? de(be, o ?? Jn) : [], [
|
|
342
342
|
lr,
|
|
343
343
|
be,
|
|
344
344
|
o
|
|
345
|
-
]),
|
|
346
|
-
|
|
347
|
-
},
|
|
345
|
+
]), Qi = !!lr && Pe(Ji, Zi), $i = (e) => {
|
|
346
|
+
qi(e), dr?.(e);
|
|
347
|
+
}, ea = !!lr && !!fr;
|
|
348
348
|
g(() => {
|
|
349
349
|
lr && !fr && wt("DataTable: `advancedFilter` has no editor, so the toolbar button is hidden – pass `renderAdvancedFilter={(props) => <ConditionBuilder {...props} />}` with ConditionBuilder from @wirecore/wirelayer-blocks-react");
|
|
350
350
|
}, [lr, fr]);
|
|
351
|
-
let
|
|
352
|
-
|
|
351
|
+
let ta = _(() => Qi && !dn ? (o ?? Jn).filter((e) => Ue(e, Ji, Zi, D)) : o, [
|
|
352
|
+
Qi,
|
|
353
353
|
dn,
|
|
354
354
|
o,
|
|
355
|
-
|
|
356
|
-
|
|
355
|
+
Ji,
|
|
356
|
+
Zi,
|
|
357
357
|
D
|
|
358
|
-
]),
|
|
358
|
+
]), na = Gi ? Gi.rows : s ? Vi.items : ta ?? Jn, ra = Gi ? Gi.columns : be, k = dn || !!s, ia = s ? Vi.totalCount ?? Vi.items.length : fn, aa = !!s && Vi.status === "error", oa = Tn || !!s && Vi.status === "loading", { leafDefs: A, columnById: j } = _(() => {
|
|
359
359
|
let e = /* @__PURE__ */ new Map(), t = [], n = (r) => r.forEach((r) => {
|
|
360
360
|
e.set(r.id, r), r.columns ? n(r.columns) : t.push(r);
|
|
361
361
|
});
|
|
362
|
-
return n(
|
|
362
|
+
return n(ra), {
|
|
363
363
|
leafDefs: t,
|
|
364
364
|
columnById: e
|
|
365
365
|
};
|
|
366
|
-
}, [
|
|
367
|
-
h !==
|
|
368
|
-
let
|
|
369
|
-
pageIndex:
|
|
370
|
-
pageSize:
|
|
371
|
-
}), [
|
|
366
|
+
}, [ra]), sa = (e, t) => typeof e.accessor == "function" ? e.accessor(t) : t[e.accessor ?? e.id], M = (e, t, n) => e?.format ? e.format(t, n) : In(t), ca = Xn(en), [la, ua] = y(() => Rn(ln)), N = _(() => ca === void 0 ? la : Rn(ca), [ca, la]), [da, fa] = y(0), [pa, ma] = y(h ?? 10), [ha, ga] = y(h);
|
|
367
|
+
h !== ha && (ga(h), ma(h ?? 10));
|
|
368
|
+
let _a = ht === void 0 ? ft === void 0 ? da : ft - 1 : Math.floor(ht / pa), va = pa, P = _(() => ({
|
|
369
|
+
pageIndex: _a,
|
|
370
|
+
pageSize: va
|
|
371
|
+
}), [_a, va]), ya = (e) => {
|
|
372
372
|
let t = (o ?? Jn).indexOf(e);
|
|
373
373
|
return Ve ? Ve(e, t) : t >= 0 ? String(t) : void 0;
|
|
374
|
-
},
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
]), [
|
|
379
|
-
|
|
380
|
-
let [
|
|
374
|
+
}, ba = Xn(hn), xa = Xn(_n), Sa = _(() => xa?.map(ya).filter((e) => e !== void 0), [xa]), [Ca, wa] = y({}), Ta = _(() => ba === void 0 ? Sa === void 0 ? Ca : Hn(Sa) : Hn(ba), [
|
|
375
|
+
ba,
|
|
376
|
+
Sa,
|
|
377
|
+
Ca
|
|
378
|
+
]), [Ea, Da] = y(null), Oa = Xn(Sn), ka = Oa === void 0 ? Ea : Oa, [Aa, ja] = y(!0), Ma = xr ?? Aa, [F, Na] = y(() => Ln(zr)), Pa = Ln(zr).join("\0"), [Fa, Ia] = y(Pa);
|
|
379
|
+
Pa !== Fa && (Ia(Pa), Na(Ln(zr)));
|
|
380
|
+
let [La, Ra] = y(() => ir ? Vn(ir) : zr && !cr ? !0 : {}), za = Xn(rr), Ba = _(() => za === void 0 ? La : Vn(za), [za, La]), [Va, Ha] = y(""), I = mr ?? Va, [Ua, Wa] = y([]), Ga = Xn(vr), Ka = _(() => Ga === void 0 ? Ua : Bn(Ga), [Ga, Ua]), [qa, Ja] = y({}), Ya = Xn(Or), Xa = _(() => Ya === void 0 ? qa : Vn(Ya, !1), [Ya, qa]), [Za, Qa] = y([]), $a = Xn(Mr) ?? Za, [eo, to] = y(null), no = Xn(Pr), ro = _(() => no ?? eo ?? {
|
|
381
381
|
start: A.filter((e) => e.pinned === "start").map((e) => e.id),
|
|
382
382
|
end: A.filter((e) => e.pinned === "end").map((e) => e.id)
|
|
383
383
|
}, [
|
|
384
|
-
|
|
385
|
-
|
|
384
|
+
no,
|
|
385
|
+
eo,
|
|
386
386
|
A
|
|
387
|
-
]), [
|
|
388
|
-
ci !==
|
|
389
|
-
let
|
|
387
|
+
]), [io, ao] = y({}), [oo, so] = y(ci ?? "md"), [co, lo] = y(ci);
|
|
388
|
+
ci !== co && (lo(ci), ci && so(ci));
|
|
389
|
+
let uo = _(() => ({
|
|
390
390
|
top: [...Vr ?? []],
|
|
391
391
|
bottom: []
|
|
392
|
-
}), [Vr]),
|
|
393
|
-
|
|
394
|
-
},
|
|
395
|
-
e.pageSize !== P.pageSize && (
|
|
396
|
-
},
|
|
397
|
-
|
|
392
|
+
}), [Vr]), fo = (e) => {
|
|
393
|
+
ua(e), sn?.(un === "multiple" ? [...e] : e[0] ?? null);
|
|
394
|
+
}, po = (e) => {
|
|
395
|
+
e.pageSize !== P.pageSize && (ma(e.pageSize), Je?.(e.pageSize)), fa(e.pageIndex), pt?.(e.pageIndex + 1), yt?.(e.pageIndex * e.pageSize);
|
|
396
|
+
}, mo = v(/* @__PURE__ */ new Map()), ho = (e) => {
|
|
397
|
+
wa(e);
|
|
398
398
|
let t = Object.keys(e).filter((t) => e[t]);
|
|
399
399
|
gn?.(t);
|
|
400
400
|
let n = L.getCoreRowModel().rowsById;
|
|
401
|
-
for (let t of [...
|
|
402
|
-
for (let e of t) n[e] &&
|
|
401
|
+
for (let t of [...mo.current.keys()]) e[t] || mo.current.delete(t);
|
|
402
|
+
for (let e of t) n[e] && mo.current.set(e, n[e].original);
|
|
403
403
|
for (let t of _n ?? []) {
|
|
404
|
-
let n =
|
|
405
|
-
n !== void 0 && e[n] && !
|
|
404
|
+
let n = ya(t);
|
|
405
|
+
n !== void 0 && e[n] && !mo.current.has(n) && mo.current.set(n, t);
|
|
406
406
|
}
|
|
407
|
-
vn?.(t.flatMap((e) =>
|
|
408
|
-
}, ho = (e) => {
|
|
409
|
-
Ea(e), Cn?.(e);
|
|
407
|
+
vn?.(t.flatMap((e) => mo.current.has(e) ? [mo.current.get(e)] : []));
|
|
410
408
|
}, go = (e) => {
|
|
411
|
-
|
|
412
|
-
}, _o = (
|
|
413
|
-
|
|
414
|
-
}, yo = (e) => {
|
|
415
|
-
|
|
416
|
-
}, bo =
|
|
409
|
+
Da(e), Cn?.(e);
|
|
410
|
+
}, _o = (e) => {
|
|
411
|
+
ja(e), Sr?.(e);
|
|
412
|
+
}, vo = () => _o(!Ma), yo = (e) => {
|
|
413
|
+
Ra(e), ar?.(e === !0 ? [] : Object.keys(e).filter((t) => e[t]));
|
|
414
|
+
}, bo = (e) => {
|
|
415
|
+
so(e), li?.(e);
|
|
416
|
+
}, xo = !!gr && !Gi, So = _(() => {
|
|
417
417
|
let e = (e) => !e.filter || e.filter === "text" || e.filter === "select" || e.filter === "multiSelect", t = (e, t, n) => e.format ? e.format(t, n) : In(t), n = (r) => r.columns ? {
|
|
418
418
|
id: r.id,
|
|
419
419
|
header: r.header,
|
|
@@ -435,78 +435,78 @@ function tr({ classes: a, data: o, dataSource: s, cacheTime: ee = 0, searchDebou
|
|
|
435
435
|
filterFn: r.filterFn,
|
|
436
436
|
byValue: Wn(r)
|
|
437
437
|
}, a),
|
|
438
|
-
enableGlobalFilter:
|
|
438
|
+
enableGlobalFilter: xo || r.searchable !== !1,
|
|
439
439
|
enableHiding: r.hideable !== !1,
|
|
440
440
|
enableGrouping: !0,
|
|
441
441
|
...r.width ? { size: r.width } : {},
|
|
442
442
|
minSize: Kn
|
|
443
443
|
};
|
|
444
|
-
return
|
|
444
|
+
return ra.map(n);
|
|
445
445
|
}, [
|
|
446
|
-
|
|
446
|
+
ra,
|
|
447
447
|
D,
|
|
448
|
-
|
|
448
|
+
xo
|
|
449
449
|
]), L = jn({
|
|
450
450
|
features: Mn,
|
|
451
|
-
columns:
|
|
452
|
-
data:
|
|
453
|
-
getRowId: (e, t) =>
|
|
451
|
+
columns: So,
|
|
452
|
+
data: na,
|
|
453
|
+
getRowId: (e, t) => Gi ? e.id : Ve?.(e, t) ?? String(t),
|
|
454
454
|
state: {
|
|
455
455
|
sorting: N,
|
|
456
456
|
pagination: P,
|
|
457
|
-
rowSelection:
|
|
458
|
-
expanded:
|
|
457
|
+
rowSelection: Ta,
|
|
458
|
+
expanded: Ba,
|
|
459
459
|
globalFilter: I,
|
|
460
|
-
columnFilters:
|
|
461
|
-
columnVisibility:
|
|
462
|
-
columnOrder:
|
|
463
|
-
columnPinning:
|
|
464
|
-
columnSizing:
|
|
460
|
+
columnFilters: Ka,
|
|
461
|
+
columnVisibility: Xa,
|
|
462
|
+
columnOrder: $a,
|
|
463
|
+
columnPinning: ro,
|
|
464
|
+
columnSizing: io,
|
|
465
465
|
grouping: F,
|
|
466
|
-
rowPinning:
|
|
466
|
+
rowPinning: uo
|
|
467
467
|
},
|
|
468
468
|
getSubRows: tr,
|
|
469
469
|
filterFromLeafRows: nr === "lenient",
|
|
470
470
|
getRowCanExpand: (e) => !!cr && (sr?.(e.original) ?? !0) || !!e.subRows?.length,
|
|
471
471
|
...Hr || w ? { autoResetExpanded: !1 } : {},
|
|
472
|
-
onExpandedChange: (e) =>
|
|
473
|
-
onSortingChange: (e) =>
|
|
474
|
-
onPaginationChange: (e) =>
|
|
475
|
-
onRowSelectionChange: (e) =>
|
|
472
|
+
onExpandedChange: (e) => yo(C(e, Ba)),
|
|
473
|
+
onSortingChange: (e) => fo(C(e, N)),
|
|
474
|
+
onPaginationChange: (e) => po(C(e, P)),
|
|
475
|
+
onRowSelectionChange: (e) => ho(C(e, Ta)),
|
|
476
476
|
onGlobalFilterChange: (e) => {
|
|
477
477
|
let t = C(e, I) ?? "";
|
|
478
|
-
|
|
478
|
+
Ha(t), hr?.(t);
|
|
479
479
|
},
|
|
480
480
|
onColumnFiltersChange: (e) => {
|
|
481
|
-
let t = C(e,
|
|
482
|
-
|
|
481
|
+
let t = C(e, Ka);
|
|
482
|
+
Wa(t), yr?.(zn(t));
|
|
483
483
|
},
|
|
484
484
|
onColumnVisibilityChange: (e) => {
|
|
485
|
-
let t = C(e,
|
|
486
|
-
|
|
485
|
+
let t = C(e, Xa);
|
|
486
|
+
Ja(t), kr?.(Object.keys(t).filter((e) => t[e] === !1));
|
|
487
487
|
},
|
|
488
488
|
onColumnOrderChange: (e) => {
|
|
489
|
-
let t = C(e,
|
|
490
|
-
|
|
489
|
+
let t = C(e, $a);
|
|
490
|
+
Qa(t), Nr?.(t);
|
|
491
491
|
},
|
|
492
492
|
onColumnPinningChange: (e) => {
|
|
493
|
-
let t = C(e,
|
|
494
|
-
|
|
493
|
+
let t = C(e, ro);
|
|
494
|
+
to(t), Fr?.({
|
|
495
495
|
start: [...t.start],
|
|
496
496
|
end: [...t.end]
|
|
497
497
|
});
|
|
498
498
|
},
|
|
499
|
-
onColumnSizingChange: (e) =>
|
|
499
|
+
onColumnSizingChange: (e) => ao((t) => C(e, t)),
|
|
500
500
|
onGroupingChange: (e) => {
|
|
501
501
|
let t = C(e, F);
|
|
502
|
-
|
|
502
|
+
Na(t), Br?.(t);
|
|
503
503
|
},
|
|
504
504
|
globalFilterFn: (e, t, n) => {
|
|
505
|
-
if (
|
|
505
|
+
if (xo && We(gr(e.original), n, D)) return !0;
|
|
506
506
|
let r = j.get(t);
|
|
507
507
|
return r?.searchable !== !1 && Ge([M(r, e.getValue(t), e.original)], n, D);
|
|
508
508
|
},
|
|
509
|
-
getColumnCanGlobalFilter: (e) =>
|
|
509
|
+
getColumnCanGlobalFilter: (e) => xo || j.get(e.id)?.searchable !== !1,
|
|
510
510
|
enableColumnResizing: Er,
|
|
511
511
|
columnResizeMode: "onChange",
|
|
512
512
|
groupedColumnMode: !1,
|
|
@@ -516,9 +516,9 @@ function tr({ classes: a, data: o, dataSource: s, cacheTime: ee = 0, searchDebou
|
|
|
516
516
|
manualSorting: k,
|
|
517
517
|
manualFiltering: k,
|
|
518
518
|
manualPagination: k || !h,
|
|
519
|
-
rowCount: k ?
|
|
520
|
-
}), [R,
|
|
521
|
-
size:
|
|
519
|
+
rowCount: k ? ia : void 0
|
|
520
|
+
}), [R, Co] = y(!1), wo = {
|
|
521
|
+
size: oo,
|
|
522
522
|
gridlines: di,
|
|
523
523
|
bordered: fi,
|
|
524
524
|
paginatorAlign: $e($t),
|
|
@@ -526,43 +526,43 @@ function tr({ classes: a, data: o, dataSource: s, cacheTime: ee = 0, searchDebou
|
|
|
526
526
|
scrollable: !!hi,
|
|
527
527
|
wrapHeaders: ri,
|
|
528
528
|
verticalHeaders: ii
|
|
529
|
-
}, z = Zr === "grid",
|
|
530
|
-
...
|
|
529
|
+
}, z = Zr === "grid", To = z && !!tr, B = _i && !!hi && !!Ri.useVirtualizer, Eo = !!h, V = Pi({
|
|
530
|
+
...wo,
|
|
531
531
|
fullscreen: R,
|
|
532
532
|
grid: z
|
|
533
|
-
}),
|
|
533
|
+
}), Do = (e) => {
|
|
534
534
|
let t = j.get(e);
|
|
535
|
-
return
|
|
536
|
-
...
|
|
535
|
+
return Pi({
|
|
536
|
+
...wo,
|
|
537
537
|
align: t?.align,
|
|
538
538
|
hideBelow: t?.hideBelow ? `hide-${t.hideBelow}` : void 0
|
|
539
539
|
});
|
|
540
|
-
},
|
|
540
|
+
}, Oo = (e, t) => {
|
|
541
541
|
let n = j.get(e)?.cellClass;
|
|
542
542
|
return typeof n == "function" ? t && !t.getIsGrouped() ? n(t.original) : void 0 : n;
|
|
543
|
-
},
|
|
543
|
+
}, ko = A.some((e) => e.editable), Ao = T !== "row", H = [
|
|
544
544
|
...Hr ? ["drag"] : [],
|
|
545
545
|
...pn ? ["select"] : [],
|
|
546
546
|
...cr ? ["expand"] : [],
|
|
547
547
|
...Wr ? ["number"] : []
|
|
548
|
-
], U = Gr || T === "row" &&
|
|
548
|
+
], U = Gr || T === "row" && ko ? ["actions"] : [], W = L.getVisibleLeafColumns(), jo = W.length + H.length + U.length, Mo = Er || A.some((e) => e.width) || ro.start.length > 0 || ro.end.length > 0, No = ro.start.length > 0, Po = ro.end.length > 0, Fo = H.reduce((e, t) => e + $n[t], 0), Io = U.reduce((e, t) => e + $n[t], 0), Lo = (e, t) => {
|
|
549
549
|
let n = L.getColumn(e), r = n?.getIsPinned();
|
|
550
550
|
if (!n || !r) return "";
|
|
551
551
|
let i = r === "start" ? L.getStartVisibleLeafColumns().at(-1)?.id === e && V.pinnedStartEdge() : L.getEndVisibleLeafColumns()[0]?.id === e && V.pinnedEndEdge();
|
|
552
552
|
return [t ? V.pinnedHead() : V.pinned(), i].filter(Boolean).join(" ");
|
|
553
|
-
},
|
|
553
|
+
}, Ro = (e, t) => {
|
|
554
554
|
let n = L.getColumn(e);
|
|
555
|
-
if (!n || !
|
|
555
|
+
if (!n || !Mo) return;
|
|
556
556
|
let r = n.getIsPinned();
|
|
557
557
|
return {
|
|
558
558
|
...t ? { width: n.getSize() } : {},
|
|
559
|
-
...r === "start" ? { insetInlineStart:
|
|
560
|
-
...r === "end" ? { insetInlineEnd:
|
|
559
|
+
...r === "start" ? { insetInlineStart: Fo + n.getStart("start") } : {},
|
|
560
|
+
...r === "end" ? { insetInlineEnd: Io + n.getAfter("end") } : {}
|
|
561
561
|
};
|
|
562
|
-
},
|
|
563
|
-
if (!
|
|
562
|
+
}, zo = (e) => U.includes(e) ? Po : No, G = (e, t) => [e === "select" ? V.selectCell() : V.utilityCell(), zo(e) ? t ? V.pinnedHead() : V.pinned() : ""].filter(Boolean).join(" "), K = (e) => {
|
|
563
|
+
if (!Mo) return;
|
|
564
564
|
let t = { width: $n[e] };
|
|
565
|
-
if (!
|
|
565
|
+
if (!zo(e)) return t;
|
|
566
566
|
if (U.includes(e)) return {
|
|
567
567
|
...t,
|
|
568
568
|
insetInlineEnd: 0
|
|
@@ -572,13 +572,13 @@ function tr({ classes: a, data: o, dataSource: s, cacheTime: ee = 0, searchDebou
|
|
|
572
572
|
...t,
|
|
573
573
|
insetInlineStart: n.reduce((e, t) => e + $n[t], 0)
|
|
574
574
|
};
|
|
575
|
-
},
|
|
575
|
+
}, Bo = L.getHeaderGroups(), Vo = (() => {
|
|
576
576
|
let e = /* @__PURE__ */ new Map(), t = /* @__PURE__ */ new Map();
|
|
577
|
-
|
|
577
|
+
Bo.forEach((n, r) => n.headers.forEach((n) => {
|
|
578
578
|
n.isPlaceholder || (e.set(n.column.id, r), t.set(n.column.id, n));
|
|
579
579
|
}));
|
|
580
580
|
let n = /* @__PURE__ */ new Set();
|
|
581
|
-
return
|
|
581
|
+
return Bo.map((r, i) => r.headers.flatMap((r) => {
|
|
582
582
|
let a = r.column.id;
|
|
583
583
|
if (n.has(a)) return [];
|
|
584
584
|
n.add(a);
|
|
@@ -589,21 +589,21 @@ function tr({ classes: a, data: o, dataSource: s, cacheTime: ee = 0, searchDebou
|
|
|
589
589
|
group: o.subHeaders.length > 0
|
|
590
590
|
}];
|
|
591
591
|
}));
|
|
592
|
-
})(), q = (e) => j.get(e.id)?.header ?? e.id,
|
|
592
|
+
})(), q = (e) => j.get(e.id)?.header ?? e.id, Ho = (e) => j.get(e.id)?.headerHidden ? V.srOnly() : V.headLabel(), Uo = (e) => !!j.get(e)?.sortable, Wo = (e) => {
|
|
593
593
|
let t = N[0];
|
|
594
|
-
return t?.id === e ? t.desc ? "descending" : "ascending" :
|
|
595
|
-
},
|
|
596
|
-
|
|
597
|
-
}, J = v(null),
|
|
594
|
+
return t?.id === e ? t.desc ? "descending" : "ascending" : Uo(e) ? "none" : void 0;
|
|
595
|
+
}, Go = (e) => N.findIndex((t) => t.id === e) + 1, [Ko, qo] = y(""), Jo = (e) => {
|
|
596
|
+
qo(""), setTimeout(() => qo(e));
|
|
597
|
+
}, J = v(null), Yo = v(!1);
|
|
598
598
|
rn(() => {
|
|
599
599
|
if (!J.current) return;
|
|
600
|
-
let e =
|
|
601
|
-
(
|
|
600
|
+
let e = Li.current?.querySelector(J.current);
|
|
601
|
+
(Yo.current ? e?.closest("td") ?? e : e)?.focus(), J.current = null, Yo.current = !1;
|
|
602
602
|
});
|
|
603
|
-
let
|
|
603
|
+
let Xo = Ar || jr, Zo = (e) => jr && j.get(e)?.reorderable !== !1, Qo = (e) => {
|
|
604
604
|
let t = j.get(e.id), n = e.getIsSorted(), r = e.getIsPinned(), i = W.map((e) => e.id), a = i.indexOf(e.id);
|
|
605
605
|
return [
|
|
606
|
-
|
|
606
|
+
Uo(e.id) ? [
|
|
607
607
|
{
|
|
608
608
|
value: "sort-asc",
|
|
609
609
|
label: O.sortAscending,
|
|
@@ -635,7 +635,7 @@ function tr({ classes: a, data: o, dataSource: s, cacheTime: ee = 0, searchDebou
|
|
|
635
635
|
label: O.unpin
|
|
636
636
|
}] : []
|
|
637
637
|
],
|
|
638
|
-
|
|
638
|
+
Zo(e.id) ? [{
|
|
639
639
|
value: "move-earlier",
|
|
640
640
|
label: O.moveEarlier,
|
|
641
641
|
disabled: a <= 0
|
|
@@ -655,12 +655,12 @@ function tr({ classes: a, data: o, dataSource: s, cacheTime: ee = 0, searchDebou
|
|
|
655
655
|
label: O.hideColumn
|
|
656
656
|
}] : []]
|
|
657
657
|
].filter((e) => e.length).flatMap((e, t) => t ? [{ type: "separator" }, ...e] : e);
|
|
658
|
-
},
|
|
658
|
+
}, $o = (e, t, n) => {
|
|
659
659
|
let r = L.getAllLeafColumns().map((e) => e.id).filter((t) => t !== e);
|
|
660
660
|
r.splice(r.indexOf(t) + +!!n, 0, e), L.setColumnOrder(r);
|
|
661
661
|
let i = W.map((e) => e.id).filter((t) => t !== e);
|
|
662
|
-
i.splice(i.indexOf(t) + +!!n, 0, e),
|
|
663
|
-
},
|
|
662
|
+
i.splice(i.indexOf(t) + +!!n, 0, e), Jo(O.columnMoved(j.get(e)?.header ?? e, i.indexOf(e) + 1, i.length));
|
|
663
|
+
}, es = (e, t) => {
|
|
664
664
|
let n = W.map((e) => e.id), r = n.indexOf(e.id);
|
|
665
665
|
switch (J.current = `[data-column-menu="${CSS.escape(e.id)}"]`, t) {
|
|
666
666
|
case "sort-asc":
|
|
@@ -669,11 +669,11 @@ function tr({ classes: a, data: o, dataSource: s, cacheTime: ee = 0, searchDebou
|
|
|
669
669
|
id: e.id,
|
|
670
670
|
desc: t === "sort-desc"
|
|
671
671
|
};
|
|
672
|
-
un === "multiple" ?
|
|
672
|
+
un === "multiple" ? Go(e.id) ? fo(N.map((t) => t.id === e.id ? n : t)) : fo([...N, n]) : fo([n]);
|
|
673
673
|
break;
|
|
674
674
|
}
|
|
675
675
|
case "sort-clear":
|
|
676
|
-
|
|
676
|
+
fo(N.filter((t) => t.id !== e.id));
|
|
677
677
|
break;
|
|
678
678
|
case "pin-start":
|
|
679
679
|
case "pin-end":
|
|
@@ -681,10 +681,10 @@ function tr({ classes: a, data: o, dataSource: s, cacheTime: ee = 0, searchDebou
|
|
|
681
681
|
e.pin(t === "unpin" ? !1 : t === "pin-start" ? "start" : "end");
|
|
682
682
|
break;
|
|
683
683
|
case "move-earlier":
|
|
684
|
-
|
|
684
|
+
$o(e.id, n[r - 1], !1);
|
|
685
685
|
break;
|
|
686
686
|
case "move-later":
|
|
687
|
-
|
|
687
|
+
$o(e.id, n[r + 1], !0);
|
|
688
688
|
break;
|
|
689
689
|
case "group":
|
|
690
690
|
L.setGrouping([...F, e.id]);
|
|
@@ -699,21 +699,21 @@ function tr({ classes: a, data: o, dataSource: s, cacheTime: ee = 0, searchDebou
|
|
|
699
699
|
break;
|
|
700
700
|
}
|
|
701
701
|
}
|
|
702
|
-
}, [
|
|
703
|
-
|
|
704
|
-
},
|
|
705
|
-
if (!
|
|
702
|
+
}, [ts, ns] = y(null), [rs, is] = y(null), as = (e, t) => {
|
|
703
|
+
ns(e), t.dataTransfer.setData("text/plain", e), t.dataTransfer.effectAllowed = "move";
|
|
704
|
+
}, os = (e, t) => {
|
|
705
|
+
if (!ts || ts === e || !Zo(e)) return;
|
|
706
706
|
t.preventDefault();
|
|
707
707
|
let n = t.currentTarget, r = n.getBoundingClientRect(), i = getComputedStyle(n).direction === "rtl", a = t.clientX > r.left + r.width / 2;
|
|
708
|
-
|
|
708
|
+
is({
|
|
709
709
|
id: e,
|
|
710
710
|
after: i ? !a : a
|
|
711
711
|
});
|
|
712
|
-
},
|
|
713
|
-
|
|
714
|
-
},
|
|
715
|
-
e.preventDefault(),
|
|
716
|
-
},
|
|
712
|
+
}, ss = () => {
|
|
713
|
+
ns(null), is(null);
|
|
714
|
+
}, cs = (e) => {
|
|
715
|
+
e.preventDefault(), ts && rs && $o(ts, rs.id, rs.after), ss();
|
|
716
|
+
}, ls = (e) => rs?.id === e ? rs.after ? "after" : "before" : void 0, us = (e, t) => {
|
|
717
717
|
let n = t.currentTarget.closest("th"), r = n?.closest("table");
|
|
718
718
|
if (!n || !r) return;
|
|
719
719
|
let i = j.get(e), a = B && i ? L.getRowModel().rows.map((t) => M(i, t.getValue(e), t.original)) : void 0, o = De(r, n, a);
|
|
@@ -721,8 +721,8 @@ function tr({ classes: a, data: o, dataSource: s, cacheTime: ee = 0, searchDebou
|
|
|
721
721
|
...t,
|
|
722
722
|
[e]: Math.min(1200, Math.max(Kn, o))
|
|
723
723
|
}));
|
|
724
|
-
},
|
|
725
|
-
if (t.key === "Enter") return t.preventDefault(),
|
|
724
|
+
}, ds = (e, t) => {
|
|
725
|
+
if (t.key === "Enter") return t.preventDefault(), us(e, t);
|
|
726
726
|
let n = Ne(t.key, t.currentTarget) * qn;
|
|
727
727
|
if (!n) return;
|
|
728
728
|
t.preventDefault();
|
|
@@ -731,44 +731,44 @@ function tr({ classes: a, data: o, dataSource: s, cacheTime: ee = 0, searchDebou
|
|
|
731
731
|
...t,
|
|
732
732
|
[e]: Math.max(Kn, r.getSize() + n)
|
|
733
733
|
}));
|
|
734
|
-
},
|
|
735
|
-
let t =
|
|
734
|
+
}, fs = (e) => !!e && (!!e.filter || !!e.renderFilter), ps = br === "row" && Ma && A.some((e) => fs(e)), ms = br === "menu" && Ma, hs = !!I || Ka.length > 0 || Qi, gs = (e) => Ka.find((t) => t.id === e)?.value, _s = (e) => e.filterOptions ?? [...new Set(na.map((t) => M(e, sa(e, t), t)))].filter(Boolean).sort(), vs = (e) => {
|
|
735
|
+
let t = gs(e.id);
|
|
736
736
|
return t === void 0 ? e.filter === "multiSelect" ? [] : null : typeof t == "string" ? t : t.constraints[0]?.value ?? null;
|
|
737
|
-
},
|
|
737
|
+
}, ys = (e, t) => L.getColumn(e)?.setFilterValue(t !== void 0 && Fe(t) ? t : void 0), bs = (e) => e.filterMatchMode ?? (Wn(e) && e.filter === "multiSelect" ? "in" : ye[e.filter ?? "text"][0]), xs = (e) => Be(bs(e))?.input ?? e.filter ?? "text", Ss = (e, t) => {
|
|
738
738
|
let n = e.filter ?? "text";
|
|
739
|
-
if ((n === "text" || n === "select") && !e.filterMatchMode && !Wn(e) && !e.renderFilter) return
|
|
740
|
-
|
|
739
|
+
if ((n === "text" || n === "select") && !e.filterMatchMode && !Wn(e) && !e.renderFilter) return ys(e.id, In(t));
|
|
740
|
+
ys(e.id, {
|
|
741
741
|
operator: "and",
|
|
742
742
|
constraints: [{
|
|
743
|
-
matchMode:
|
|
743
|
+
matchMode: bs(e),
|
|
744
744
|
value: t
|
|
745
745
|
}]
|
|
746
746
|
});
|
|
747
|
-
},
|
|
748
|
-
let n =
|
|
747
|
+
}, Cs = (e, t) => {
|
|
748
|
+
let n = vs(e);
|
|
749
749
|
return Array.isArray(n) ? n[t] : null;
|
|
750
|
-
},
|
|
751
|
-
let r =
|
|
752
|
-
i[t] = n,
|
|
753
|
-
},
|
|
754
|
-
|
|
750
|
+
}, ws = (e, t, n) => {
|
|
751
|
+
let r = vs(e), i = Array.isArray(r) ? [...r] : [null, null];
|
|
752
|
+
i[t] = n, Ss(e, i);
|
|
753
|
+
}, Ts = mn !== "single", Es = xn === "all" && k, Ds = (e) => Es && ka ? e.getCanSelect() && !ka.except.includes(e.id) : e.getIsSelected(), Os = Es && ka ? Math.max(0, (ia ?? na.length) - ka.except.length) : Object.values(Ta).filter(Boolean).length, ks = Es ? ka ? !ka.except.length || "indeterminate" : Os ? "indeterminate" : !1 : L.getIsAllPageRowsSelected() ? !0 : L.getIsSomePageRowsSelected() ? "indeterminate" : !1, As = (e) => {
|
|
754
|
+
Es ? (ho({}), go(ka || !e ? null : {
|
|
755
755
|
mode: "all",
|
|
756
756
|
except: []
|
|
757
757
|
})) : xn === "all" ? L.toggleAllRowsSelected(e) : L.toggleAllPageRowsSelected(e);
|
|
758
|
-
},
|
|
758
|
+
}, js = `${Ii}-select`, Ms = v(null), Ns = v(!1), Ps = (e, t, n = !1) => {
|
|
759
759
|
let r = L.getRowModel().rows.filter((e) => e.getCanSelect()).map((e) => e.id);
|
|
760
|
-
if (
|
|
761
|
-
let i = new Set(
|
|
762
|
-
for (let a of n &&
|
|
763
|
-
|
|
760
|
+
if (Es && ka) {
|
|
761
|
+
let i = new Set(ka.except);
|
|
762
|
+
for (let a of n && Ms.current ? Me(r, Ms.current, e.id) : [e.id]) t ? i.delete(a) : i.add(a);
|
|
763
|
+
go({
|
|
764
764
|
mode: "all",
|
|
765
765
|
except: [...i]
|
|
766
766
|
});
|
|
767
|
-
} else
|
|
768
|
-
|
|
769
|
-
},
|
|
767
|
+
} else ho(Ts ? Un(Ta, n && Ms.current ? Me(r, Ms.current, e.id) : [e.id], t) : t ? Hn([e.id]) : {});
|
|
768
|
+
Ms.current = e.id;
|
|
769
|
+
}, Fs = (e) => Ns.current = e.shiftKey, Is = "button, a, input, select, textarea, label, [role=checkbox], [role=combobox], [contenteditable]", Ls = (e, t) => {
|
|
770
770
|
let n = t.target, r = !!n.closest("[data-row-link]");
|
|
771
|
-
if (!r && n.closest(
|
|
771
|
+
if (!r && n.closest(Is)) return;
|
|
772
772
|
let i = Yr?.(e.original);
|
|
773
773
|
if (Xr?.({
|
|
774
774
|
row: e.original,
|
|
@@ -778,11 +778,11 @@ function tr({ classes: a, data: o, dataSource: s, cacheTime: ee = 0, searchDebou
|
|
|
778
778
|
}), i) {
|
|
779
779
|
if (r || t.nativeEvent.defaultPrevented) return;
|
|
780
780
|
t.ctrlKey || t.metaKey || t.shiftKey ? window.open(i, "_blank", "noopener") : window.location.assign(i);
|
|
781
|
-
} else yn && e.getCanSelect() &&
|
|
782
|
-
},
|
|
781
|
+
} else yn && e.getCanSelect() && Ps(e, !Ts || !Ds(e), Ts && t.shiftKey);
|
|
782
|
+
}, Rs = (e, t) => {
|
|
783
783
|
let n = Yr?.(e.original);
|
|
784
|
-
t.button === 1 && n && !t.target.closest(
|
|
785
|
-
},
|
|
784
|
+
t.button === 1 && n && !t.target.closest(Is) && window.open(n, "_blank", "noopener");
|
|
785
|
+
}, zs = Vr?.length ? L.getCenterRows() : L.getRowModel().rows, Bs = Vr?.length ? L.getTopRows() : [], Y = (aa ? Jn : zs).flatMap((e) => e.getIsGrouped() ? [{
|
|
786
786
|
kind: "group",
|
|
787
787
|
row: e,
|
|
788
788
|
key: e.id
|
|
@@ -794,45 +794,54 @@ function tr({ classes: a, data: o, dataSource: s, cacheTime: ee = 0, searchDebou
|
|
|
794
794
|
kind: "expansion",
|
|
795
795
|
row: e,
|
|
796
796
|
key: `${e.id}:details`
|
|
797
|
-
}] : []]),
|
|
797
|
+
}] : []]), Vs = h && !k ? P.pageIndex * P.pageSize : 0, Hs = new Map(Y.filter((e) => e.kind === "row").map((e, t) => [e.row.id, Vs + t + 1])), Us = (e) => `${Ii}-details-${e.id}`, Ws = L.getIsAllRowsExpanded(), Gs = !!tr || F.length > 0, Ks = A.some((e) => e.aggregate), qs = A.some((e) => e.aggregate || e.footer || e.renderFooter), Js = (e, t, n) => t == null ? "" : e.format && n ? e.format(t, n) : typeof t == "number" ? new Intl.NumberFormat(D, { maximumFractionDigits: 2 }).format(t) : In(t), Ys = (e, t) => {
|
|
798
798
|
if (!e.aggregate) return "";
|
|
799
|
-
let n = t.filter((e) => !e.getIsGrouped()), r = oe(n.map((t) =>
|
|
800
|
-
return
|
|
801
|
-
},
|
|
799
|
+
let n = t.filter((e) => !e.getIsGrouped()), r = oe(n.map((t) => sa(e, t.original)), e.aggregate);
|
|
800
|
+
return Js(e, r, e.aggregate === "count" ? void 0 : n[0]?.original);
|
|
801
|
+
}, Xs = (e) => {
|
|
802
802
|
if (e.footer !== void 0) return e.footer;
|
|
803
803
|
if (!e.aggregate) return "";
|
|
804
|
-
let t =
|
|
804
|
+
let t = Ys(e, L.getFilteredRowModel().flatRows);
|
|
805
805
|
return typeof e.aggregate == "string" ? O.aggregates[e.aggregate]?.(t) ?? t : t;
|
|
806
|
-
},
|
|
806
|
+
}, Zs = (e) => {
|
|
807
|
+
let t = Xs(e);
|
|
808
|
+
if (!e.renderFooter) return t;
|
|
809
|
+
let n = L.getFilteredRowModel().flatRows.filter((e) => !e.getIsGrouped()), r = e.aggregate ? oe(n.map((t) => sa(e, t.original)), e.aggregate) : void 0;
|
|
810
|
+
return e.renderFooter({
|
|
811
|
+
value: r,
|
|
812
|
+
text: t,
|
|
813
|
+
rows: n.map((e) => e.original)
|
|
814
|
+
});
|
|
815
|
+
}, Qs = (e) => typeof Gr == "function" ? Gr(e.original) : Gr ?? [], [$s, ec] = y(null), tc = (e) => {
|
|
807
816
|
let t = e.target.closest("[data-row-id]");
|
|
808
|
-
|
|
809
|
-
},
|
|
817
|
+
ec(t ? L.getRow(t.dataset.rowId, !0) ?? null : null);
|
|
818
|
+
}, nc = (e, t) => {
|
|
810
819
|
e && Kr?.({
|
|
811
820
|
value: t,
|
|
812
821
|
row: e.original,
|
|
813
822
|
rowId: e.id
|
|
814
823
|
});
|
|
815
|
-
},
|
|
824
|
+
}, rc = (e) => {
|
|
816
825
|
try {
|
|
817
826
|
return L.getRow(e, !0) ?? void 0;
|
|
818
827
|
} catch {
|
|
819
828
|
return;
|
|
820
829
|
}
|
|
821
|
-
}, [X,
|
|
830
|
+
}, [X, ic] = y(null), [ac, oc] = y(null), [sc, cc] = y(null), lc = v(null);
|
|
822
831
|
g(() => {
|
|
823
|
-
|
|
824
|
-
}, [
|
|
825
|
-
let
|
|
832
|
+
lc.current &&= (Li.current?.querySelector(`[data-drag-handle="${CSS.escape(lc.current)}"]`)?.focus(), null);
|
|
833
|
+
}, [na]);
|
|
834
|
+
let uc = !!tr, dc = F.length > 0, fc = (e) => F.map((t) => Le(e.getValue(t))).join("\0"), pc = (e) => F.map((t) => {
|
|
826
835
|
let n = j.get(t);
|
|
827
836
|
return `${n?.header ?? t}: ${M(n, e.getValue(t), e.original)}`;
|
|
828
|
-
}).join(", "),
|
|
837
|
+
}).join(", "), mc = () => Y.filter((e) => e.kind === "row" && (dc || e.row.depth === 0)).map((e) => e.row), hc = () => {
|
|
829
838
|
let e = (t) => t.map((t) => ({
|
|
830
839
|
id: t.id,
|
|
831
840
|
...tr?.(t.original) ? { children: e(t.subRows) } : {}
|
|
832
841
|
}));
|
|
833
842
|
return e(L.getCoreRowModel().rows);
|
|
834
|
-
},
|
|
835
|
-
let r = (e, t) => e < t ? t - 1 : t, i = e.index, a = r(i, t.index + +!!n), o =
|
|
843
|
+
}, gc = (e, t, n) => {
|
|
844
|
+
let r = (e, t) => e < t ? t - 1 : t, i = e.index, a = r(i, t.index + +!!n), o = dc && fc(e) !== fc(t);
|
|
836
845
|
if (i === a && !o) return;
|
|
837
846
|
let s = o ? Object.fromEntries(F.map((e) => [e, t.getValue(e)])) : void 0;
|
|
838
847
|
Ur?.({
|
|
@@ -842,11 +851,11 @@ function tr({ classes: a, data: o, dataSource: s, cacheTime: ee = 0, searchDebou
|
|
|
842
851
|
to: a,
|
|
843
852
|
...s ? { group: s } : {}
|
|
844
853
|
});
|
|
845
|
-
let c =
|
|
846
|
-
|
|
847
|
-
},
|
|
854
|
+
let c = mc().filter((n) => n.id !== e.id && (!dc || fc(n) === fc(t))).map((e) => e.id), ee = c.indexOf(t.id) + +!!n + 1, l = zi(e.original, e.index);
|
|
855
|
+
Jo(o ? O.rowMovedToGroup(l, pc(t), ee, c.length + 1) : O.rowMoved(l, ee, c.length + 1));
|
|
856
|
+
}, _c = (e, t) => {
|
|
848
857
|
if (!t) return;
|
|
849
|
-
let n =
|
|
858
|
+
let n = hc(), r = t.parentId ? rc(t.parentId) : void 0, i = t.parentId ? ze(n, t.parentId)?.node.children ?? [] : n;
|
|
850
859
|
Ur?.({
|
|
851
860
|
row: e.original,
|
|
852
861
|
rowId: e.id,
|
|
@@ -854,73 +863,73 @@ function tr({ classes: a, data: o, dataSource: s, cacheTime: ee = 0, searchDebou
|
|
|
854
863
|
to: t.index,
|
|
855
864
|
parentId: t.parentId,
|
|
856
865
|
index: t.index
|
|
857
|
-
}), r && !r.getIsExpanded() && r.toggleExpanded(!0),
|
|
858
|
-
},
|
|
859
|
-
if (
|
|
866
|
+
}), r && !r.getIsExpanded() && r.toggleExpanded(!0), Jo(O.rowMovedInTree(zi(e.original, e.index), r ? zi(r.original, r.index) : null, t.index + 1, i.filter((t) => t.id !== e.id).length + 1));
|
|
867
|
+
}, vc = (e, t) => {
|
|
868
|
+
if (uc) {
|
|
860
869
|
let n = getComputedStyle(t.currentTarget).direction === "rtl", r = t.key === "ArrowUp" ? "up" : t.key === "ArrowDown" ? "down" : t.key === "ArrowRight" ? n ? "out" : "in" : t.key === "ArrowLeft" ? n ? "in" : "out" : void 0;
|
|
861
870
|
if (!r) return;
|
|
862
|
-
t.preventDefault(),
|
|
871
|
+
t.preventDefault(), lc.current = e.id, _c(e, Ct(hc(), e.id, r));
|
|
863
872
|
return;
|
|
864
873
|
}
|
|
865
874
|
if (t.key !== "ArrowUp" && t.key !== "ArrowDown") return;
|
|
866
875
|
t.preventDefault();
|
|
867
|
-
let n =
|
|
868
|
-
if (
|
|
876
|
+
let n = mc();
|
|
877
|
+
if (dc) {
|
|
869
878
|
let r = Ae(n.map((e) => ({
|
|
870
879
|
id: e.id,
|
|
871
|
-
group:
|
|
872
|
-
})), e.id, t.key === "ArrowUp" ? "up" : "down"), i = r &&
|
|
880
|
+
group: fc(e)
|
|
881
|
+
})), e.id, t.key === "ArrowUp" ? "up" : "down"), i = r && rc(r.targetId);
|
|
873
882
|
if (!r || !i) return;
|
|
874
|
-
|
|
883
|
+
lc.current = e.id, gc(e, i, r.after);
|
|
875
884
|
return;
|
|
876
885
|
}
|
|
877
886
|
let r = n[n.indexOf(e) + (t.key === "ArrowUp" ? -1 : 1)];
|
|
878
|
-
r && (
|
|
879
|
-
},
|
|
880
|
-
if (
|
|
881
|
-
|
|
882
|
-
},
|
|
887
|
+
r && (lc.current = e.id, gc(e, r, t.key === "ArrowDown"));
|
|
888
|
+
}, yc = (e, t) => {
|
|
889
|
+
if (ac !== e.id) return t.preventDefault();
|
|
890
|
+
ic(e.id), t.dataTransfer.setData("text/plain", e.id), t.dataTransfer.effectAllowed = "move";
|
|
891
|
+
}, bc = (e, t) => {
|
|
883
892
|
if (!X || X === e.id) return;
|
|
884
893
|
let n = t.currentTarget.getBoundingClientRect(), r = (t.clientY - n.top) / n.height;
|
|
885
|
-
if (
|
|
894
|
+
if (uc) {
|
|
886
895
|
let n = tr?.(e.original) ? r < .25 ? "before" : r > .75 ? "after" : "inside" : r < .5 ? "before" : "after";
|
|
887
|
-
if (!xt(
|
|
888
|
-
t.preventDefault(),
|
|
896
|
+
if (!xt(hc(), X, e.id, n)) return cc(null);
|
|
897
|
+
t.preventDefault(), cc({
|
|
889
898
|
id: e.id,
|
|
890
899
|
position: n
|
|
891
900
|
});
|
|
892
|
-
} else t.preventDefault(),
|
|
901
|
+
} else t.preventDefault(), cc({
|
|
893
902
|
id: e.id,
|
|
894
903
|
position: r > .5 ? "after" : "before"
|
|
895
904
|
});
|
|
896
|
-
},
|
|
897
|
-
X && (t.preventDefault(),
|
|
905
|
+
}, xc = (e, t) => {
|
|
906
|
+
X && (t.preventDefault(), cc({
|
|
898
907
|
id: e.id,
|
|
899
908
|
position: "inside"
|
|
900
909
|
}));
|
|
901
|
-
},
|
|
902
|
-
|
|
903
|
-
},
|
|
910
|
+
}, Sc = () => {
|
|
911
|
+
ic(null), cc(null), oc(null);
|
|
912
|
+
}, Cc = (e) => {
|
|
904
913
|
e.preventDefault();
|
|
905
|
-
let t = X ?
|
|
906
|
-
if (t && n &&
|
|
907
|
-
if (
|
|
914
|
+
let t = X ? rc(X) : void 0, n = sc ? rc(sc.id) : void 0;
|
|
915
|
+
if (t && n && sc) {
|
|
916
|
+
if (uc) _c(t, xt(hc(), t.id, n.id, sc.position));
|
|
908
917
|
else if (n.getIsGrouped()) {
|
|
909
918
|
let e = n.getLeafRows().filter((e) => !e.getIsGrouped() && e.id !== t.id).at(-1);
|
|
910
|
-
e &&
|
|
911
|
-
} else
|
|
919
|
+
e && gc(t, e, !0);
|
|
920
|
+
} else gc(t, n, sc.position === "after");
|
|
912
921
|
}
|
|
913
|
-
|
|
914
|
-
},
|
|
915
|
-
|
|
916
|
-
},
|
|
917
|
-
let n = rt(
|
|
922
|
+
Sc();
|
|
923
|
+
}, wc = (e) => sc?.id === e ? sc.position : void 0, [Tc, Ec] = y({}), Dc = v(Tc), Oc = (e) => {
|
|
924
|
+
Dc.current = e, Ec(e);
|
|
925
|
+
}, kc = (e, t) => {
|
|
926
|
+
let n = rt(Tc, e.id, t);
|
|
918
927
|
return n ? n.value : e.getValue(t);
|
|
919
|
-
},
|
|
928
|
+
}, Ac = w || T === "batch", [jc] = y(() => new ae()), [, Mc] = y(0), Nc = () => Mc((e) => e + 1), Pc = (e, t = !0, n = !1) => {
|
|
920
929
|
if (e.length) {
|
|
921
|
-
if (T === "batch")
|
|
930
|
+
if (T === "batch") Oc(m(Dc.current, e, n));
|
|
922
931
|
else for (let t of n ? [...e].reverse() : e) {
|
|
923
|
-
let e =
|
|
932
|
+
let e = rc(t.rowId);
|
|
924
933
|
e && oi?.({
|
|
925
934
|
row: e.original,
|
|
926
935
|
rowId: e.id,
|
|
@@ -929,9 +938,9 @@ function tr({ classes: a, data: o, dataSource: s, cacheTime: ee = 0, searchDebou
|
|
|
929
938
|
});
|
|
930
939
|
}
|
|
931
940
|
if (T === "row") for (let { rowId: t, values: r } of ce(e, n)) {
|
|
932
|
-
let e =
|
|
941
|
+
let e = rc(t);
|
|
933
942
|
if (!e) continue;
|
|
934
|
-
let n = A.filter((e) => e.editable).map((t) => [t.id,
|
|
943
|
+
let n = A.filter((e) => e.editable).map((t) => [t.id, kc(e, t.id)]);
|
|
935
944
|
si?.({
|
|
936
945
|
row: e.original,
|
|
937
946
|
rowId: t,
|
|
@@ -941,23 +950,23 @@ function tr({ classes: a, data: o, dataSource: s, cacheTime: ee = 0, searchDebou
|
|
|
941
950
|
}
|
|
942
951
|
});
|
|
943
952
|
}
|
|
944
|
-
t &&
|
|
953
|
+
t && Ac && (jc.push(e), Nc());
|
|
945
954
|
}
|
|
946
|
-
},
|
|
947
|
-
let e =
|
|
948
|
-
e && (
|
|
949
|
-
},
|
|
950
|
-
let e =
|
|
951
|
-
e && (
|
|
952
|
-
},
|
|
955
|
+
}, Fc = () => {
|
|
956
|
+
let e = jc.undo();
|
|
957
|
+
e && (Pc(e, !1, !0), Nc(), Jo(O.undone(e.length)));
|
|
958
|
+
}, Ic = () => {
|
|
959
|
+
let e = jc.redo();
|
|
960
|
+
e && (Pc(e, !1), Nc(), Jo(O.redone(e.length)));
|
|
961
|
+
}, Lc = Object.keys(Tc).length, Rc = () => {
|
|
953
962
|
let e = $.current;
|
|
954
963
|
(e?.querySelector("[tabindex=\"0\"]") ?? e)?.focus();
|
|
955
|
-
},
|
|
956
|
-
let e = Object.values(
|
|
964
|
+
}, zc = () => {
|
|
965
|
+
let e = Object.values(Dc.current);
|
|
957
966
|
if (!e.length) return;
|
|
958
967
|
let t = [], n = /* @__PURE__ */ new Map();
|
|
959
968
|
for (let r of e) {
|
|
960
|
-
let e =
|
|
969
|
+
let e = rc(r.rowId);
|
|
961
970
|
if (!e) continue;
|
|
962
971
|
t.push({
|
|
963
972
|
row: e.original,
|
|
@@ -976,78 +985,78 @@ function tr({ classes: a, data: o, dataSource: s, cacheTime: ee = 0, searchDebou
|
|
|
976
985
|
ti?.({
|
|
977
986
|
changes: t,
|
|
978
987
|
rows: [...n.values()]
|
|
979
|
-
}),
|
|
980
|
-
},
|
|
981
|
-
Object.keys(
|
|
982
|
-
}, [
|
|
983
|
-
|
|
984
|
-
}, [
|
|
985
|
-
J.current = e,
|
|
986
|
-
},
|
|
988
|
+
}), Oc({}), jc.clear(), Nc(), Jo(O.changesSaved(t.length)), Rc();
|
|
989
|
+
}, Bc = () => {
|
|
990
|
+
Object.keys(Dc.current).length && (Oc({}), jc.clear(), Nc(), Jo(O.changesDiscarded), Rc());
|
|
991
|
+
}, [Vc, Hc] = y(null), [Uc, Wc] = y(null), [Gc, Kc] = y({}), [qc, Jc] = y({}), Yc = v(Gc), Xc = (e) => {
|
|
992
|
+
Yc.current = e, Kc(e);
|
|
993
|
+
}, [Zc, Qc] = y(!1), $c = v(!1), el = (e) => {
|
|
994
|
+
J.current = e, Yo.current = z;
|
|
995
|
+
}, tl = (e) => e.editor ?? "text", nl = (e, t) => `${e}:${t}`, rl = (e, t) => `${Ii}-error-${e}-${t}`, il = "[data-editor] :is(input, button, [role=combobox], [tabindex=\"0\"])", al = () => Y.filter((e) => e.kind === "row").flatMap((e) => W.filter((e) => j.get(e.id)?.editable).map((t) => ({
|
|
987
996
|
rowId: e.row.id,
|
|
988
997
|
columnId: t.id
|
|
989
|
-
}))),
|
|
990
|
-
|
|
998
|
+
}))), ol = (e, t) => {
|
|
999
|
+
ll({
|
|
991
1000
|
rowId: e.id,
|
|
992
1001
|
columnId: t
|
|
993
|
-
}),
|
|
994
|
-
},
|
|
995
|
-
let r = ue(t.map((t) => [t, () => j.get(t)?.validate?.(n[t], e.original)])), i = (e) => (
|
|
996
|
-
return r instanceof Promise ? (
|
|
997
|
-
|
|
1002
|
+
}), Xc({ [t]: kc(e, t) }), Jc({}), J.current = il;
|
|
1003
|
+
}, sl = (e, t, n) => {
|
|
1004
|
+
let r = ue(t.map((t) => [t, () => j.get(t)?.validate?.(n[t], e.original)])), i = (e) => (Jc(e), Object.keys(e).length === 0);
|
|
1005
|
+
return r instanceof Promise ? ($c.current = !0, Qc(!0), r.then(i).finally(() => {
|
|
1006
|
+
$c.current = !1, Qc(!1);
|
|
998
1007
|
})) : i(r);
|
|
999
|
-
},
|
|
1000
|
-
|
|
1001
|
-
},
|
|
1002
|
-
if (!
|
|
1003
|
-
let i =
|
|
1008
|
+
}, cl = v(Vc), ll = (e) => {
|
|
1009
|
+
cl.current = e, Hc(e);
|
|
1010
|
+
}, ul = (e, t, n, r = Yc.current) => {
|
|
1011
|
+
if (!Vc || $c.current) return;
|
|
1012
|
+
let i = sl(e, [t], r);
|
|
1004
1013
|
i instanceof Promise ? i.then((i) => {
|
|
1005
|
-
let a =
|
|
1006
|
-
a?.rowId === e.id && a.columnId === t && (i ?
|
|
1007
|
-
}) : i ?
|
|
1008
|
-
},
|
|
1014
|
+
let a = cl.current;
|
|
1015
|
+
a?.rowId === e.id && a.columnId === t && (i ? dl(e, t, n, r) : J.current = il);
|
|
1016
|
+
}) : i ? dl(e, t, n, r) : J.current = il;
|
|
1017
|
+
}, dl = (e, t, n, r) => {
|
|
1009
1018
|
let i = r[t];
|
|
1010
|
-
|
|
1011
|
-
let a =
|
|
1012
|
-
if ((T === "batch" ? !mt(i, a) : i !== e.getValue(t)) &&
|
|
1019
|
+
ll(null);
|
|
1020
|
+
let a = kc(e, t);
|
|
1021
|
+
if ((T === "batch" ? !mt(i, a) : i !== e.getValue(t)) && Pc([{
|
|
1013
1022
|
rowId: e.id,
|
|
1014
1023
|
columnId: t,
|
|
1015
1024
|
before: a,
|
|
1016
1025
|
after: i
|
|
1017
1026
|
}]), n) {
|
|
1018
|
-
let r =
|
|
1019
|
-
if (i && a) return
|
|
1027
|
+
let r = al(), i = r[r.findIndex((n) => n.rowId === e.id && n.columnId === t) + n], a = i && L.getRow(i.rowId, !0);
|
|
1028
|
+
if (i && a) return ol(a, i.columnId);
|
|
1020
1029
|
}
|
|
1021
|
-
|
|
1022
|
-
},
|
|
1023
|
-
|
|
1024
|
-
}, dl = (e, t, n) => {
|
|
1025
|
-
n.defaultPrevented || (n.key === "Escape" ? (n.preventDefault(), ul(e, t)) : n.key === "Enter" && (n.target.matches("textarea") ? n.ctrlKey || n.metaKey : !n.target.matches("button, [role=combobox]")) ? (n.preventDefault(), cl(e, t)) : n.key === "Tab" && (n.preventDefault(), cl(e, t, n.shiftKey ? -1 : 1)));
|
|
1026
|
-
}, fl = (e, t, n) => {
|
|
1027
|
-
let r = n.relatedTarget, i = n.currentTarget;
|
|
1028
|
-
r && (i.contains(r) || !Ii.current?.contains(r) && r.closest("[data-scope]")) || cl(e, t);
|
|
1030
|
+
el(`[data-edit="${CSS.escape(nl(e.id, t))}"]`);
|
|
1031
|
+
}, fl = (e, t) => {
|
|
1032
|
+
ll(null), Jc({}), el(`[data-edit="${CSS.escape(nl(e.id, t))}"]`);
|
|
1029
1033
|
}, pl = (e, t, n) => {
|
|
1034
|
+
n.defaultPrevented || (n.key === "Escape" ? (n.preventDefault(), fl(e, t)) : n.key === "Enter" && (n.target.matches("textarea") ? n.ctrlKey || n.metaKey : !n.target.matches("button, [role=combobox]")) ? (n.preventDefault(), ul(e, t)) : n.key === "Tab" && (n.preventDefault(), ul(e, t, n.shiftKey ? -1 : 1)));
|
|
1035
|
+
}, ml = (e, t, n) => {
|
|
1036
|
+
let r = n.relatedTarget, i = n.currentTarget;
|
|
1037
|
+
r && (i.contains(r) || !Li.current?.contains(r) && r.closest("[data-scope]")) || ul(e, t);
|
|
1038
|
+
}, hl = (e, t, n) => {
|
|
1030
1039
|
let r = {
|
|
1031
|
-
...
|
|
1040
|
+
...Yc.current,
|
|
1032
1041
|
[t.id]: n
|
|
1033
1042
|
};
|
|
1034
|
-
|
|
1035
|
-
},
|
|
1036
|
-
value:
|
|
1037
|
-
setValue: (e) =>
|
|
1038
|
-
...
|
|
1043
|
+
Xc(r), Ao && Gn.has(tl(t)) && !t.renderEditor && ul(e, t.id, void 0, r);
|
|
1044
|
+
}, gl = (e, t) => ({
|
|
1045
|
+
value: Gc[t.id],
|
|
1046
|
+
setValue: (e) => Xc({
|
|
1047
|
+
...Yc.current,
|
|
1039
1048
|
[t.id]: e
|
|
1040
1049
|
}),
|
|
1041
1050
|
row: e.original,
|
|
1042
|
-
commit: () =>
|
|
1043
|
-
cancel: () =>
|
|
1044
|
-
invalid: !!
|
|
1045
|
-
}),
|
|
1046
|
-
|
|
1047
|
-
},
|
|
1048
|
-
if (
|
|
1049
|
-
let n =
|
|
1050
|
-
|
|
1051
|
+
commit: () => Ao ? ul(e, t.id) : vl(e, !0),
|
|
1052
|
+
cancel: () => Ao ? fl(e, t.id) : vl(e, !1),
|
|
1053
|
+
invalid: !!qc[t.id]
|
|
1054
|
+
}), _l = (e) => {
|
|
1055
|
+
Wc(e.id), Jc({}), Xc(Object.fromEntries(A.filter((e) => e.editable).map((t) => [t.id, e.getValue(t.id)]))), J.current = il;
|
|
1056
|
+
}, vl = (e, t) => {
|
|
1057
|
+
if ($c.current) return;
|
|
1058
|
+
let n = Yc.current, r = () => {
|
|
1059
|
+
Wc(null), Jc({}), el(`[data-row-edit="${CSS.escape(e.id)}"]`);
|
|
1051
1060
|
};
|
|
1052
1061
|
if (!t) return r();
|
|
1053
1062
|
let i = A.filter((e) => e.editable).map((e) => e.id), a = (t) => {
|
|
@@ -1055,57 +1064,57 @@ function tr({ classes: a, data: o, dataSource: s, cacheTime: ee = 0, searchDebou
|
|
|
1055
1064
|
row: e.original,
|
|
1056
1065
|
rowId: e.id,
|
|
1057
1066
|
values: { ...n }
|
|
1058
|
-
}), r()) : J.current =
|
|
1059
|
-
}, o =
|
|
1067
|
+
}), r()) : J.current = il;
|
|
1068
|
+
}, o = sl(e, i, n);
|
|
1060
1069
|
o instanceof Promise ? o.then(a) : a(o);
|
|
1061
|
-
},
|
|
1062
|
-
t.defaultPrevented || (t.key === "Escape" ? (t.preventDefault(),
|
|
1063
|
-
}, [Z,
|
|
1064
|
-
if (!
|
|
1065
|
-
let n =
|
|
1066
|
-
return n >=
|
|
1067
|
-
},
|
|
1068
|
-
let t = ut(e,
|
|
1070
|
+
}, yl = (e, t) => {
|
|
1071
|
+
t.defaultPrevented || (t.key === "Escape" ? (t.preventDefault(), vl(e, !1)) : t.key === "Enter" && t.target.matches("input") && (t.preventDefault(), vl(e, !0)));
|
|
1072
|
+
}, [Z, bl] = y(null), xl = Y.filter((e) => e.kind === "row").map((e) => e.row.id), Sl = W.map((e) => e.id), Cl = w ? ut(Z, xl, Sl) : null, wl = new Map(xl.map((e, t) => [e, t])), Tl = new Map(Sl.map((e, t) => [e, t])), El = (e, t) => {
|
|
1073
|
+
if (!Cl) return !1;
|
|
1074
|
+
let n = wl.get(e) ?? -1, r = Tl.get(t) ?? -1;
|
|
1075
|
+
return n >= Cl.top && n <= Cl.bottom && r >= Cl.left && r <= Cl.right;
|
|
1076
|
+
}, Dl = (e) => {
|
|
1077
|
+
let t = ut(e, xl, Sl);
|
|
1069
1078
|
if (!t) return null;
|
|
1070
|
-
let n =
|
|
1079
|
+
let n = xl.slice(t.top, t.bottom + 1), r = Sl.slice(t.left, t.right + 1), i = n.flatMap((e) => rc(e) ?? []);
|
|
1071
1080
|
return {
|
|
1072
1081
|
rowIds: n,
|
|
1073
1082
|
columnIds: r,
|
|
1074
1083
|
rows: i.map((e) => e.original),
|
|
1075
|
-
values: i.map((e) => r.map((t) =>
|
|
1084
|
+
values: i.map((e) => r.map((t) => kc(e, t)))
|
|
1076
1085
|
};
|
|
1077
|
-
},
|
|
1078
|
-
e && Z && e.anchor.rowId === Z.anchor.rowId && e.anchor.columnId === Z.anchor.columnId && e.focus.rowId === Z.focus.rowId && e.focus.columnId === Z.focus.columnId || !e && !Z || (
|
|
1079
|
-
},
|
|
1086
|
+
}, Ol = (e) => {
|
|
1087
|
+
e && Z && e.anchor.rowId === Z.anchor.rowId && e.anchor.columnId === Z.anchor.columnId && e.focus.rowId === Z.focus.rowId && e.focus.columnId === Z.focus.columnId || !e && !Z || (bl(e), $r?.(Dl(e)));
|
|
1088
|
+
}, kl = v(!1), Al = v(!1), jl = v(!1);
|
|
1080
1089
|
g(() => {
|
|
1081
1090
|
if (!w) return;
|
|
1082
|
-
let e = () =>
|
|
1091
|
+
let e = () => kl.current = !1;
|
|
1083
1092
|
return window.addEventListener("pointerup", e), () => window.removeEventListener("pointerup", e);
|
|
1084
1093
|
}, [w]);
|
|
1085
|
-
let
|
|
1094
|
+
let Ml = (e, t, n) => {
|
|
1086
1095
|
if (!w || n.button !== 0 || n.target.closest("[data-editor]")) return;
|
|
1087
1096
|
let r = {
|
|
1088
1097
|
rowId: e,
|
|
1089
1098
|
columnId: t
|
|
1090
1099
|
}, i = n.shiftKey && Z;
|
|
1091
|
-
|
|
1100
|
+
Ol(i ? {
|
|
1092
1101
|
anchor: Z.anchor,
|
|
1093
1102
|
focus: r
|
|
1094
1103
|
} : {
|
|
1095
1104
|
anchor: r,
|
|
1096
1105
|
focus: r
|
|
1097
|
-
}),
|
|
1098
|
-
},
|
|
1099
|
-
|
|
1106
|
+
}), kl.current = !0, jl.current = !!i, i && window.getSelection()?.removeAllRanges();
|
|
1107
|
+
}, Nl = (e, t, n) => {
|
|
1108
|
+
kl.current && Z && n.buttons & 1 && (Ol({
|
|
1100
1109
|
anchor: Z.anchor,
|
|
1101
1110
|
focus: {
|
|
1102
1111
|
rowId: e,
|
|
1103
1112
|
columnId: t
|
|
1104
1113
|
}
|
|
1105
1114
|
}), window.getSelection()?.removeAllRanges());
|
|
1106
|
-
},
|
|
1107
|
-
|
|
1108
|
-
},
|
|
1115
|
+
}, Pl = (e) => {
|
|
1116
|
+
jl.current && (jl.current = !1, e.preventDefault(), e.stopPropagation());
|
|
1117
|
+
}, Fl = (e, t) => $.current?.querySelector(`tr[data-row-id="${CSS.escape(e)}"] > [data-column-id="${CSS.escape(t)}"]`) ?? null, Il = (e) => {
|
|
1109
1118
|
let t = e.target, n = e.key;
|
|
1110
1119
|
if (!w || !z || !e.shiftKey || e.altKey || ![
|
|
1111
1120
|
"ArrowUp",
|
|
@@ -1117,7 +1126,7 @@ function tr({ classes: a, data: o, dataSource: s, cacheTime: ee = 0, searchDebou
|
|
|
1117
1126
|
].includes(n)) return !1;
|
|
1118
1127
|
let r = t.closest("tr")?.dataset.rowId, i = t.dataset.columnId;
|
|
1119
1128
|
if (!r || !i || !t.matches("td")) return !1;
|
|
1120
|
-
let a = getComputedStyle(t).direction === "rtl", o = n === "ArrowUp" ? "up" : n === "ArrowDown" ? "down" : n === "Home" ? "home" : n === "End" ? "end" : n === "ArrowRight" === a ? "previous" : "next", s = Z &&
|
|
1129
|
+
let a = getComputedStyle(t).direction === "rtl", o = n === "ArrowUp" ? "up" : n === "ArrowDown" ? "down" : n === "Home" ? "home" : n === "End" ? "end" : n === "ArrowRight" === a ? "previous" : "next", s = Z && El(r, i) ? Z : {
|
|
1121
1130
|
anchor: {
|
|
1122
1131
|
rowId: r,
|
|
1123
1132
|
columnId: i
|
|
@@ -1126,46 +1135,46 @@ function tr({ classes: a, data: o, dataSource: s, cacheTime: ee = 0, searchDebou
|
|
|
1126
1135
|
rowId: r,
|
|
1127
1136
|
columnId: i
|
|
1128
1137
|
}
|
|
1129
|
-
}, c = Te(s,
|
|
1130
|
-
e.preventDefault(),
|
|
1138
|
+
}, c = Te(s, xl, Sl, o, e.ctrlKey || e.metaKey);
|
|
1139
|
+
e.preventDefault(), Ol(c);
|
|
1131
1140
|
let ee = () => {
|
|
1132
|
-
let e =
|
|
1133
|
-
return e ? (
|
|
1141
|
+
let e = Fl(c.focus.rowId, c.focus.columnId);
|
|
1142
|
+
return e ? (Al.current = !0, e.focus(), Al.current = !1, e.scrollIntoView?.({
|
|
1134
1143
|
block: "nearest",
|
|
1135
1144
|
inline: "nearest"
|
|
1136
1145
|
}), !0) : !1;
|
|
1137
1146
|
};
|
|
1138
|
-
return !ee() && B && (
|
|
1139
|
-
},
|
|
1140
|
-
let e =
|
|
1147
|
+
return !ee() && B && (ku?.scrollToIndex(Y.findIndex((e) => e.kind === "row" && e.row.id === c.focus.rowId)), requestAnimationFrame(() => requestAnimationFrame(() => void ee()))), !0;
|
|
1148
|
+
}, Ll = (e, t) => M(j.get(t), kc(e, t), e.original), Rl = () => {
|
|
1149
|
+
let e = Dl(Z);
|
|
1141
1150
|
if (e) {
|
|
1142
|
-
let t = e.rowIds.flatMap((e) =>
|
|
1151
|
+
let t = e.rowIds.flatMap((e) => rc(e) ?? []);
|
|
1143
1152
|
return {
|
|
1144
|
-
text: bt(t.map((t) => e.columnIds.map((e) =>
|
|
1153
|
+
text: bt(t.map((t) => e.columnIds.map((e) => Ll(t, e)))),
|
|
1145
1154
|
count: t.length * e.columnIds.length
|
|
1146
1155
|
};
|
|
1147
1156
|
}
|
|
1148
|
-
let t = Y.filter((e) => e.kind === "row" &&
|
|
1157
|
+
let t = Y.filter((e) => e.kind === "row" && Ds(e.row)).map((e) => e.row);
|
|
1149
1158
|
return t.length ? {
|
|
1150
|
-
text: bt(t.map((e) =>
|
|
1151
|
-
count: t.length *
|
|
1159
|
+
text: bt(t.map((e) => Sl.map((t) => Ll(e, t)))),
|
|
1160
|
+
count: t.length * Sl.length
|
|
1152
1161
|
} : null;
|
|
1153
|
-
},
|
|
1162
|
+
}, zl = () => {
|
|
1154
1163
|
let e = document.activeElement;
|
|
1155
1164
|
return !!e && !!$.current?.contains(e) && !e.closest(Qn);
|
|
1156
|
-
},
|
|
1157
|
-
if (!
|
|
1158
|
-
let t =
|
|
1159
|
-
t && (e.clipboardData.setData("text/plain", t.text), e.preventDefault(),
|
|
1160
|
-
},
|
|
1161
|
-
let t = tt(e), n = ut(Z,
|
|
1165
|
+
}, Bl = (e) => {
|
|
1166
|
+
if (!zl() || !e.clipboardData || window.getSelection()?.toString()) return;
|
|
1167
|
+
let t = Rl();
|
|
1168
|
+
t && (e.clipboardData.setData("text/plain", t.text), e.preventDefault(), Jo(O.cellsCopied(t.count)));
|
|
1169
|
+
}, Vl = async (e) => {
|
|
1170
|
+
let t = tt(e), n = ut(Z, xl, Sl);
|
|
1162
1171
|
if (!t.length || !n || !Z) return;
|
|
1163
1172
|
let r = nt(t, {
|
|
1164
1173
|
row: n.top,
|
|
1165
1174
|
column: n.left
|
|
1166
|
-
},
|
|
1175
|
+
}, xl, Sl, n), i = [], a = [];
|
|
1167
1176
|
for (let e of r) {
|
|
1168
|
-
let t = j.get(e.columnId), n =
|
|
1177
|
+
let t = j.get(e.columnId), n = rc(e.rowId);
|
|
1169
1178
|
if (!t || !n) continue;
|
|
1170
1179
|
if (!t.editable) {
|
|
1171
1180
|
i.push({
|
|
@@ -1174,7 +1183,7 @@ function tr({ classes: a, data: o, dataSource: s, cacheTime: ee = 0, searchDebou
|
|
|
1174
1183
|
});
|
|
1175
1184
|
continue;
|
|
1176
1185
|
}
|
|
1177
|
-
let r = et(e.text,
|
|
1186
|
+
let r = et(e.text, tl(t), {
|
|
1178
1187
|
locale: D,
|
|
1179
1188
|
choices: t.editOptions
|
|
1180
1189
|
});
|
|
@@ -1185,7 +1194,7 @@ function tr({ classes: a, data: o, dataSource: s, cacheTime: ee = 0, searchDebou
|
|
|
1185
1194
|
});
|
|
1186
1195
|
continue;
|
|
1187
1196
|
}
|
|
1188
|
-
let o =
|
|
1197
|
+
let o = kc(n, e.columnId);
|
|
1189
1198
|
mt(r.value, o) || a.push({
|
|
1190
1199
|
change: {
|
|
1191
1200
|
rowId: n.id,
|
|
@@ -1219,112 +1228,112 @@ function tr({ classes: a, data: o, dataSource: s, cacheTime: ee = 0, searchDebou
|
|
|
1219
1228
|
c.defaultPrevented = !0;
|
|
1220
1229
|
}
|
|
1221
1230
|
};
|
|
1222
|
-
ei?.(c), !c.defaultPrevented && (
|
|
1223
|
-
},
|
|
1224
|
-
if (!
|
|
1231
|
+
ei?.(c), !c.defaultPrevented && (Pc(s.map(({ change: e }) => e)), Ol(lt(r, xl, Sl)), Jo(O.cellsPasted(s.length, i.length)));
|
|
1232
|
+
}, Hl = (e) => {
|
|
1233
|
+
if (!zl()) return;
|
|
1225
1234
|
let t = e.clipboardData?.getData("text/plain");
|
|
1226
|
-
t && (e.preventDefault(),
|
|
1235
|
+
t && (e.preventDefault(), Vl(t));
|
|
1227
1236
|
};
|
|
1228
1237
|
g(() => {
|
|
1229
|
-
if (w) return document.addEventListener("copy",
|
|
1230
|
-
document.removeEventListener("copy",
|
|
1238
|
+
if (w) return document.addEventListener("copy", Bl), document.addEventListener("paste", Hl), () => {
|
|
1239
|
+
document.removeEventListener("copy", Bl), document.removeEventListener("paste", Hl);
|
|
1231
1240
|
};
|
|
1232
1241
|
});
|
|
1233
|
-
let
|
|
1234
|
-
if (!
|
|
1242
|
+
let Ul = (e) => {
|
|
1243
|
+
if (!Ac || e.target.closest(Qn)) return !1;
|
|
1235
1244
|
let t = je(e);
|
|
1236
|
-
return t ? (e.preventDefault(), t === "undo" ?
|
|
1237
|
-
}, [
|
|
1245
|
+
return t ? (e.preventDefault(), t === "undo" ? Fc() : Ic(), !0) : !1;
|
|
1246
|
+
}, [Wl, Gl] = y(!1), [Kl, ql] = y(""), [Jl, Yl] = y(0), Xl = ni && Wl && !!Kl.trim(), Zl = Xl ? (Eo && !k ? L.getPrePaginatedRowModel().rows : L.getRowModel().rows).filter((e) => !e.getIsGrouped()) : [], Q = Xl ? Ee(Zl.map((e) => ({
|
|
1238
1247
|
id: e.id,
|
|
1239
1248
|
cells: W.map((t) => ({
|
|
1240
1249
|
columnId: t.id,
|
|
1241
|
-
text:
|
|
1250
|
+
text: Ll(e, t.id)
|
|
1242
1251
|
}))
|
|
1243
|
-
})),
|
|
1252
|
+
})), Kl, D) : [], Ql = Q.length ? Q[Math.min(Jl, Q.length - 1)] : void 0, $l = new Set(Q.map((e) => `${e.rowId}\u0000${e.columnId}`)), eu = (e, t) => Xl ? Ql?.rowId === e && Ql.columnId === t ? V.findCurrent() : $l.has(`${e}\u0000${t}`) ? V.findMatch() : "" : "", tu = v(!1), nu = (e) => {
|
|
1244
1253
|
if (!Q.length) return;
|
|
1245
1254
|
let t = (e + Q.length) % Q.length;
|
|
1246
|
-
|
|
1255
|
+
Yl(t);
|
|
1247
1256
|
let n = Q[t];
|
|
1248
|
-
if (
|
|
1249
|
-
let e =
|
|
1257
|
+
if (Eo && !k) {
|
|
1258
|
+
let e = Zl.findIndex((e) => e.id === n.rowId), t = Math.floor(e / P.pageSize);
|
|
1250
1259
|
e >= 0 && t !== P.pageIndex && L.setPageIndex(t);
|
|
1251
1260
|
}
|
|
1252
|
-
|
|
1261
|
+
tu.current = !0;
|
|
1253
1262
|
};
|
|
1254
1263
|
g(() => {
|
|
1255
|
-
if (
|
|
1256
|
-
|
|
1257
|
-
let e = () =>
|
|
1264
|
+
if (!tu.current || !Ql) return;
|
|
1265
|
+
tu.current = !1;
|
|
1266
|
+
let e = () => Fl(Ql.rowId, Ql.columnId)?.scrollIntoView?.({
|
|
1258
1267
|
block: "nearest",
|
|
1259
1268
|
inline: "nearest"
|
|
1260
|
-
}), t = Y.findIndex((e) => e.kind === "row" && e.row.id ===
|
|
1261
|
-
B && t >= 0 ? (
|
|
1269
|
+
}), t = Y.findIndex((e) => e.kind === "row" && e.row.id === Ql.rowId);
|
|
1270
|
+
B && t >= 0 ? (ku?.scrollToIndex(t, { align: "center" }), requestAnimationFrame(() => requestAnimationFrame(e))) : e();
|
|
1262
1271
|
});
|
|
1263
|
-
let
|
|
1264
|
-
let e = !
|
|
1265
|
-
|
|
1266
|
-
},
|
|
1267
|
-
e.key === "Enter" ? (e.preventDefault(),
|
|
1268
|
-
},
|
|
1269
|
-
|
|
1270
|
-
},
|
|
1271
|
-
if (!
|
|
1272
|
-
let e = Y.map((e) => e.kind === "row" ? dt(W.map((t) => j.get(t.id)?.colSpan?.(e.row.original) ?? 1)) : W.map(() => 1)), t = Y.map((e, t) => e.kind !== "row" || Y[t - 1]?.kind !== "row"), n = W.map((e) => j.get(e.id)?.rowSpan === "auto"), r = (t, n) => Y.map((r, i) => r.kind === "row" && e[i][n] === 1 ?
|
|
1272
|
+
let ru = () => {
|
|
1273
|
+
let e = !Wl;
|
|
1274
|
+
Gl(e), J.current = e ? "[data-find-input] input, input[data-find-input]" : "[data-find-toggle]";
|
|
1275
|
+
}, iu = (e) => {
|
|
1276
|
+
e.key === "Enter" ? (e.preventDefault(), nu(Jl + (e.shiftKey ? -1 : 1))) : e.key === "Escape" && (e.preventDefault(), ru());
|
|
1277
|
+
}, au = (e) => {
|
|
1278
|
+
ql(e), Yl(0), tu.current = !0;
|
|
1279
|
+
}, ou = !B && A.some((e) => e.rowSpan === "auto" || e.colSpan), su = (e) => `${Ii}-head-${e}`, cu = (() => {
|
|
1280
|
+
if (!ou) return;
|
|
1281
|
+
let e = Y.map((e) => e.kind === "row" ? dt(W.map((t) => j.get(t.id)?.colSpan?.(e.row.original) ?? 1)) : W.map(() => 1)), t = Y.map((e, t) => e.kind !== "row" || Y[t - 1]?.kind !== "row"), n = W.map((e) => j.get(e.id)?.rowSpan === "auto"), r = (t, n) => Y.map((r, i) => r.kind === "row" && e[i][n] === 1 ? Ll(r.row, t) : null), i = se(W.flatMap((e, t) => n[t] ? [r(e.id, t)] : []), t), a = 0;
|
|
1273
1282
|
return {
|
|
1274
1283
|
columnSpans: e,
|
|
1275
1284
|
rowSpans: n.map((e) => e ? i[a++] : void 0)
|
|
1276
1285
|
};
|
|
1277
|
-
})(),
|
|
1278
|
-
rowSpan:
|
|
1279
|
-
colSpan:
|
|
1280
|
-
}),
|
|
1281
|
-
if (!
|
|
1282
|
-
let { rowSpan: n, colSpan: r } =
|
|
1286
|
+
})(), lu = (e, t) => ({
|
|
1287
|
+
rowSpan: cu?.rowSpans[t]?.[e] ?? 1,
|
|
1288
|
+
colSpan: cu?.columnSpans[e]?.[t] ?? 1
|
|
1289
|
+
}), uu = (e, t) => {
|
|
1290
|
+
if (!ou) return {};
|
|
1291
|
+
let { rowSpan: n, colSpan: r } = lu(e, t);
|
|
1283
1292
|
return {
|
|
1284
1293
|
...n > 1 ? { rowSpan: n } : {},
|
|
1285
1294
|
...r > 1 ? { colSpan: r } : {},
|
|
1286
|
-
headers: W.slice(t, t + r).map((e) =>
|
|
1295
|
+
headers: W.slice(t, t + r).map((e) => su(e.id)).join(" ")
|
|
1287
1296
|
};
|
|
1288
|
-
},
|
|
1297
|
+
}, du = (e = {}) => {
|
|
1289
1298
|
let t = L.getVisibleLeafColumns().map((e) => j.get(e.id)).filter((e) => e.exportable !== !1), n = (e.selectionOnly ? L.getSelectedRowModel().flatRows : L.getSortedRowModel().flatRows).filter((e) => !e.getIsGrouped()).map((e) => t.map((t) => t.exportValue ? t.exportValue(e.original) : M(t, e.getValue(t.id), e.original))), r = e.separator ?? Lr ?? he(D), i = vt([t.map((e) => e.exportHeader ?? e.header), ...n], r);
|
|
1290
1299
|
return e.bom === !1 ? i.slice(1) : i;
|
|
1291
|
-
},
|
|
1300
|
+
}, fu = (e = !1) => {
|
|
1292
1301
|
let t = typeof e == "boolean" ? { selectionOnly: e } : e;
|
|
1293
|
-
Se(`${t.filename ?? Ir ?? "export"}.csv`,
|
|
1294
|
-
},
|
|
1302
|
+
Se(`${t.filename ?? Ir ?? "export"}.csv`, du(t));
|
|
1303
|
+
}, pu = (e) => [{
|
|
1295
1304
|
row: e,
|
|
1296
1305
|
group: e.getIsGrouped(),
|
|
1297
1306
|
depth: e.depth
|
|
1298
|
-
}, ...e.subRows.flatMap(
|
|
1307
|
+
}, ...e.subRows.flatMap(pu)], mu = (e = !1) => e ? L.getSelectedRowModel().flatRows.filter((e) => !e.getIsGrouped()).map((e) => ({
|
|
1299
1308
|
row: e,
|
|
1300
1309
|
group: !1,
|
|
1301
1310
|
depth: 0
|
|
1302
|
-
})) : L.getSortedRowModel().rows.flatMap(
|
|
1311
|
+
})) : L.getSortedRowModel().rows.flatMap(pu), hu = (e) => {
|
|
1303
1312
|
let t = j.get(e.groupingColumnId);
|
|
1304
1313
|
return `${t?.header ?? ""}: ${M(t, e.groupingValue, e.original)} (${e.getLeafRows().filter((e) => !e.getIsGrouped()).length})`;
|
|
1305
|
-
},
|
|
1314
|
+
}, gu = (e) => e.editor === "datetime" ? "datetime" : e.filter === "date" || e.editor === "date" ? "date" : void 0, _u = (e, t, n) => {
|
|
1306
1315
|
if (e == null || e === "") return null;
|
|
1307
1316
|
if (typeof e == "number") return Number.isFinite(e) ? e : null;
|
|
1308
1317
|
if (e instanceof Date) return {
|
|
1309
1318
|
date: e,
|
|
1310
|
-
time:
|
|
1319
|
+
time: gu(t) === "datetime"
|
|
1311
1320
|
};
|
|
1312
|
-
let r =
|
|
1321
|
+
let r = gu(t);
|
|
1313
1322
|
return r && (typeof e == "string" || typeof e == "number") ? {
|
|
1314
1323
|
date: e,
|
|
1315
1324
|
time: r === "datetime"
|
|
1316
1325
|
} : typeof e == "boolean" && !t.format ? e : n ? M(t, e, n) : In(e);
|
|
1317
|
-
},
|
|
1318
|
-
let t = L.getVisibleLeafColumns().map((e) => j.get(e.id)).filter((e) => e.exportable !== !1), n =
|
|
1326
|
+
}, vu = (e = {}) => {
|
|
1327
|
+
let t = L.getVisibleLeafColumns().map((e) => j.get(e.id)).filter((e) => e.exportable !== !1), n = mu(e.selectionOnly).filter((t) => !t.group || e.groups !== !1).map(({ row: n, group: r, depth: i }) => {
|
|
1319
1328
|
if (r) {
|
|
1320
1329
|
let e = n.getLeafRows().filter((e) => !e.getIsGrouped());
|
|
1321
1330
|
return {
|
|
1322
1331
|
kind: "group",
|
|
1323
1332
|
level: i,
|
|
1324
1333
|
cells: t.map((t, r) => {
|
|
1325
|
-
if (r === 0) return
|
|
1334
|
+
if (r === 0) return hu(n);
|
|
1326
1335
|
if (!t.aggregate) return null;
|
|
1327
|
-
let i = oe(e.map((e) =>
|
|
1336
|
+
let i = oe(e.map((e) => sa(t, e.original)), t.aggregate);
|
|
1328
1337
|
return typeof i == "number" ? i : In(i);
|
|
1329
1338
|
})
|
|
1330
1339
|
};
|
|
@@ -1336,7 +1345,7 @@ function tr({ classes: a, data: o, dataSource: s, cacheTime: ee = 0, searchDebou
|
|
|
1336
1345
|
let t = e.exportValue(n.original);
|
|
1337
1346
|
return typeof t == "number" || typeof t == "boolean" ? t : t instanceof Date ? { date: t } : In(t);
|
|
1338
1347
|
}
|
|
1339
|
-
return
|
|
1348
|
+
return _u(n.getValue(e.id), e, n.original);
|
|
1340
1349
|
})
|
|
1341
1350
|
};
|
|
1342
1351
|
});
|
|
@@ -1344,7 +1353,7 @@ function tr({ classes: a, data: o, dataSource: s, cacheTime: ee = 0, searchDebou
|
|
|
1344
1353
|
let e = L.getFilteredRowModel().flatRows.filter((e) => !e.getIsGrouped()), r = t.map((t) => {
|
|
1345
1354
|
if (t.footer !== void 0) return t.footer;
|
|
1346
1355
|
if (!t.aggregate) return null;
|
|
1347
|
-
let n = oe(e.map((e) =>
|
|
1356
|
+
let n = oe(e.map((e) => sa(t, e.original)), t.aggregate);
|
|
1348
1357
|
return typeof n == "number" ? n : In(n);
|
|
1349
1358
|
});
|
|
1350
1359
|
r[0] === null && (r[0] = O.total), n.push({
|
|
@@ -1357,71 +1366,71 @@ function tr({ classes: a, data: o, dataSource: s, cacheTime: ee = 0, searchDebou
|
|
|
1357
1366
|
columns: t.map((e) => ({ header: e.exportHeader ?? e.header })),
|
|
1358
1367
|
rows: n
|
|
1359
1368
|
});
|
|
1360
|
-
},
|
|
1361
|
-
let t = W.map((e) => j.get(e.id)), n =
|
|
1369
|
+
}, yu = (e = {}) => xe(`${e.filename ?? Ir ?? "export"}.xlsx`, vu(e)), bu = (e, t) => e === "xlsx" ? yu({ selectionOnly: t }) : fu(t), xu = (e = {}) => {
|
|
1370
|
+
let t = W.map((e) => j.get(e.id)), n = Vo.map((e) => e.map((e) => ({
|
|
1362
1371
|
text: q(e.header.column),
|
|
1363
1372
|
colSpan: e.group ? e.header.colSpan : 1,
|
|
1364
1373
|
rowSpan: e.rowSpan,
|
|
1365
1374
|
align: e.group ? void 0 : j.get(e.header.column.id)?.align
|
|
1366
|
-
}))), r =
|
|
1375
|
+
}))), r = mu(e.selectionOnly).map(({ row: e, group: n }) => n ? {
|
|
1367
1376
|
kind: "group",
|
|
1368
1377
|
cells: [{
|
|
1369
|
-
text:
|
|
1378
|
+
text: hu(e),
|
|
1370
1379
|
colSpan: t.length
|
|
1371
1380
|
}]
|
|
1372
1381
|
} : { cells: t.map((t) => ({
|
|
1373
|
-
text:
|
|
1382
|
+
text: Ll(e, t.id),
|
|
1374
1383
|
align: t.align
|
|
1375
|
-
})) }), i =
|
|
1376
|
-
text:
|
|
1384
|
+
})) }), i = qs ? t.map((e) => ({
|
|
1385
|
+
text: Xs(e),
|
|
1377
1386
|
align: e.align
|
|
1378
1387
|
})) : void 0;
|
|
1379
1388
|
ot(st({
|
|
1380
1389
|
title: e.title ?? we,
|
|
1381
1390
|
caption: we,
|
|
1382
1391
|
lang: D,
|
|
1383
|
-
dir: getComputedStyle(
|
|
1392
|
+
dir: getComputedStyle(Li.current ?? document.body).direction === "rtl" ? "rtl" : "ltr",
|
|
1384
1393
|
head: n,
|
|
1385
1394
|
body: r,
|
|
1386
1395
|
foot: i
|
|
1387
1396
|
}));
|
|
1388
|
-
},
|
|
1389
|
-
|
|
1390
|
-
},
|
|
1391
|
-
|
|
1397
|
+
}, Su = () => {
|
|
1398
|
+
Si && le(Si, Ci);
|
|
1399
|
+
}, Cu = () => {
|
|
1400
|
+
Ka.length && L.setColumnFilters([]), I && L.setGlobalFilter(""), Qi && $i(Ce("and", "root")), P.pageIndex && po({
|
|
1392
1401
|
...P,
|
|
1393
1402
|
pageIndex: 0
|
|
1394
1403
|
});
|
|
1395
|
-
},
|
|
1396
|
-
|
|
1397
|
-
},
|
|
1398
|
-
s && await
|
|
1404
|
+
}, wu = () => {
|
|
1405
|
+
Cu(), fo(Rn(ln)), Object.keys(Ta).length && ho({}), ka && go(null), Ju((e) => e + 1);
|
|
1406
|
+
}, Tu = async () => {
|
|
1407
|
+
s && await Wi.refresh();
|
|
1399
1408
|
};
|
|
1400
|
-
nn(
|
|
1401
|
-
exportCsv:
|
|
1402
|
-
generateCsv:
|
|
1403
|
-
clearState:
|
|
1404
|
-
resetFilters:
|
|
1405
|
-
resetState:
|
|
1406
|
-
exportXlsx:
|
|
1407
|
-
generateXlsx:
|
|
1408
|
-
print:
|
|
1409
|
-
refresh:
|
|
1410
|
-
undo:
|
|
1411
|
-
redo:
|
|
1409
|
+
nn(ji, () => ({
|
|
1410
|
+
exportCsv: fu,
|
|
1411
|
+
generateCsv: du,
|
|
1412
|
+
clearState: Su,
|
|
1413
|
+
resetFilters: Cu,
|
|
1414
|
+
resetState: wu,
|
|
1415
|
+
exportXlsx: yu,
|
|
1416
|
+
generateXlsx: vu,
|
|
1417
|
+
print: xu,
|
|
1418
|
+
refresh: Tu,
|
|
1419
|
+
undo: Fc,
|
|
1420
|
+
redo: Ic
|
|
1412
1421
|
})), rn(() => {
|
|
1413
1422
|
if (!R) return;
|
|
1414
1423
|
let e = [];
|
|
1415
|
-
for (let t of document.body.children) t !==
|
|
1424
|
+
for (let t of document.body.children) t !== Li.current && t instanceof HTMLElement && !t.inert && (t.inert = !0, e.push(t));
|
|
1416
1425
|
return () => e.forEach((e) => e.inert = !1);
|
|
1417
1426
|
}, [R]);
|
|
1418
|
-
let
|
|
1419
|
-
|
|
1420
|
-
},
|
|
1421
|
-
R && e.key === "Escape" && !e.defaultPrevented && (e.preventDefault(),
|
|
1422
|
-
},
|
|
1427
|
+
let Eu = () => {
|
|
1428
|
+
Co(!R), J.current = "[data-fullscreen-toggle]";
|
|
1429
|
+
}, Du = (e) => {
|
|
1430
|
+
R && e.key === "Escape" && !e.defaultPrevented && (e.preventDefault(), Eu());
|
|
1431
|
+
}, Ou = v(null), ku = (Ri.useVirtualizer ?? er)({
|
|
1423
1432
|
count: B ? Y.length : 0,
|
|
1424
|
-
getScrollElement: () =>
|
|
1433
|
+
getScrollElement: () => Ou.current,
|
|
1425
1434
|
estimateSize: () => vi,
|
|
1426
1435
|
overscan: 8,
|
|
1427
1436
|
getItemKey: (e) => Y[e]?.key ?? e,
|
|
@@ -1431,34 +1440,35 @@ function tr({ classes: a, data: o, dataSource: s, cacheTime: ee = 0, searchDebou
|
|
|
1431
1440
|
}
|
|
1432
1441
|
});
|
|
1433
1442
|
g(() => {
|
|
1434
|
-
_i && !
|
|
1435
|
-
}, [_i,
|
|
1436
|
-
let
|
|
1443
|
+
_i && !Ri.useVirtualizer && wt("DataTable: `virtual` needs the feature virtualRows, so all rows are rendered – pass `features={[virtualRows]}` with virtualRows from @wirecore/wirelayer-react/virtual");
|
|
1444
|
+
}, [_i, Ri]);
|
|
1445
|
+
let Au = B ? ku?.getVirtualItems() ?? [] : [], ju = B ? Au.map((e) => ({
|
|
1437
1446
|
...Y[e.index],
|
|
1438
1447
|
index: e.index
|
|
1439
1448
|
})) : Y.map((e, t) => ({
|
|
1440
1449
|
...e,
|
|
1441
1450
|
index: t
|
|
1442
|
-
})),
|
|
1443
|
-
B && e &&
|
|
1444
|
-
},
|
|
1451
|
+
})), Mu = B ? Au[0]?.start ?? 0 : 0, Nu = B ? (ku?.getTotalSize() ?? 0) - (Au.at(-1)?.end ?? 0) : 0, Pu = (e) => {
|
|
1452
|
+
B && e && ku?.measureElement(e);
|
|
1453
|
+
}, Fu = v(!1);
|
|
1445
1454
|
g(() => {
|
|
1446
|
-
|
|
1447
|
-
}, [
|
|
1448
|
-
let
|
|
1455
|
+
Fu.current = !1;
|
|
1456
|
+
}, [na.length]);
|
|
1457
|
+
let Iu = (e) => {
|
|
1458
|
+
if (xi?.(e), !hi) return;
|
|
1449
1459
|
let t = e.currentTarget;
|
|
1450
|
-
|
|
1451
|
-
},
|
|
1460
|
+
Fu.current || t.scrollTop + t.clientHeight < t.scrollHeight - 80 || (Fu.current = !0, yi?.(), bi?.());
|
|
1461
|
+
}, Lu = v(null), [Ru, zu] = y(0);
|
|
1452
1462
|
g(() => {
|
|
1453
|
-
if (!
|
|
1454
|
-
let e = new ResizeObserver(() => Lu
|
|
1455
|
-
return e.observe(
|
|
1463
|
+
if (!Lu.current || typeof ResizeObserver > "u") return;
|
|
1464
|
+
let e = new ResizeObserver(() => zu(Lu.current?.offsetHeight ?? 0));
|
|
1465
|
+
return e.observe(Lu.current), () => e.disconnect();
|
|
1456
1466
|
}, []);
|
|
1457
1467
|
let $ = v(null);
|
|
1458
1468
|
g(() => {
|
|
1459
1469
|
z && $.current && _t($.current);
|
|
1460
1470
|
});
|
|
1461
|
-
let
|
|
1471
|
+
let Bu = (e) => {
|
|
1462
1472
|
if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey || e.defaultPrevented) return !1;
|
|
1463
1473
|
let t = e.target, n = t.closest("td"), r = n?.parentElement?.dataset.rowId;
|
|
1464
1474
|
if (!n || !r || n.cellIndex !== H.length || t.closest(Qn)) return !1;
|
|
@@ -1475,20 +1485,20 @@ function tr({ classes: a, data: o, dataSource: s, cacheTime: ee = 0, searchDebou
|
|
|
1475
1485
|
$.current?.querySelector(`tr[data-row-id="${CSS.escape(e?.id ?? "")}"] > td:nth-child(${H.length + 1})`)?.focus();
|
|
1476
1486
|
} else i.toggleExpanded(s === "expand");
|
|
1477
1487
|
return !0;
|
|
1478
|
-
},
|
|
1479
|
-
z && $.current && (
|
|
1488
|
+
}, Vu = (e) => {
|
|
1489
|
+
z && $.current && (To && Bu(e) || ke(e.nativeEvent, $.current, {
|
|
1480
1490
|
itemCount: Y.length,
|
|
1481
|
-
scrollToItem: B ? (e) =>
|
|
1482
|
-
pageRows:
|
|
1491
|
+
scrollToItem: B ? (e) => ku?.scrollToIndex(e) : void 0,
|
|
1492
|
+
pageRows: Ou.current && hi ? Math.max(1, Math.floor(Ou.current.clientHeight / vi) - 1) : 10,
|
|
1483
1493
|
onSelectRow: (e) => {
|
|
1484
1494
|
let t = L.getRow(e, !0);
|
|
1485
|
-
t?.getCanSelect() &&
|
|
1495
|
+
t?.getCanSelect() && Ps(t, !Ts || !Ds(t));
|
|
1486
1496
|
}
|
|
1487
1497
|
}));
|
|
1488
|
-
},
|
|
1498
|
+
}, Hu = (e) => {
|
|
1489
1499
|
z && $.current && Oe($.current, e.target);
|
|
1490
1500
|
let t = e.target, n = t.closest("tr")?.dataset.rowId, r = t.dataset.columnId;
|
|
1491
|
-
w && z && !
|
|
1501
|
+
w && z && !kl.current && !Al.current && n && r && t.matches("td") && Ol({
|
|
1492
1502
|
anchor: {
|
|
1493
1503
|
rowId: n,
|
|
1494
1504
|
columnId: r
|
|
@@ -1498,120 +1508,120 @@ function tr({ classes: a, data: o, dataSource: s, cacheTime: ee = 0, searchDebou
|
|
|
1498
1508
|
columnId: r
|
|
1499
1509
|
}
|
|
1500
1510
|
});
|
|
1501
|
-
},
|
|
1502
|
-
|
|
1503
|
-
},
|
|
1511
|
+
}, Uu = (e) => {
|
|
1512
|
+
Ul(e) || Il(e) || Vu(e);
|
|
1513
|
+
}, Wu = v(!1);
|
|
1504
1514
|
g(() => {
|
|
1505
|
-
if (!
|
|
1506
|
-
let e = Re(
|
|
1507
|
-
|
|
1515
|
+
if (!Si) return;
|
|
1516
|
+
let e = Re(Si, Ci), t = e && Qe(e, wi);
|
|
1517
|
+
Wu.current = !0, t && (t.sorting && fo(t.sorting), t.filters && L.setColumnFilters(Bn(t.filters)), t.globalFilter !== void 0 && L.setGlobalFilter(t.globalFilter), t.columnSizing && ao(t.columnSizing), t.columnOrder && L.setColumnOrder(t.columnOrder), t.hiddenColumns && L.setColumnVisibility(Vn(t.hiddenColumns, !1)), t.pinnedColumns && L.setColumnPinning(t.pinnedColumns), t.expanded && t.expanded.length && yo(Vn(t.expanded)), t.selection && ho(Hn(t.selection)), t.density && bo(t.density), t.showFilters !== void 0 && t.showFilters !== Ma && _o(t.showFilters), (t.page || t.pageSize) && po({
|
|
1508
1518
|
pageIndex: (t.page ?? 1) - 1,
|
|
1509
1519
|
pageSize: t.pageSize ?? P.pageSize
|
|
1510
1520
|
}));
|
|
1511
1521
|
}, []);
|
|
1512
|
-
let
|
|
1522
|
+
let Gu = {
|
|
1513
1523
|
sorting: N,
|
|
1514
|
-
filters: zn(
|
|
1524
|
+
filters: zn(Ka),
|
|
1515
1525
|
globalFilter: I,
|
|
1516
1526
|
page: P.pageIndex + 1,
|
|
1517
1527
|
pageSize: P.pageSize,
|
|
1518
|
-
columnSizing:
|
|
1519
|
-
columnOrder:
|
|
1520
|
-
hiddenColumns: Object.keys(
|
|
1521
|
-
pinnedColumns:
|
|
1522
|
-
expanded:
|
|
1523
|
-
selection: Object.keys(
|
|
1524
|
-
density:
|
|
1525
|
-
showFilters:
|
|
1526
|
-
},
|
|
1528
|
+
columnSizing: io,
|
|
1529
|
+
columnOrder: $a,
|
|
1530
|
+
hiddenColumns: Object.keys(Xa).filter((e) => Xa[e] === !1),
|
|
1531
|
+
pinnedColumns: ro,
|
|
1532
|
+
expanded: Ba === !0 ? [] : Object.keys(Ba).filter((e) => Ba[e]),
|
|
1533
|
+
selection: Object.keys(Ta).filter((e) => Ta[e]),
|
|
1534
|
+
density: oo,
|
|
1535
|
+
showFilters: Ma
|
|
1536
|
+
}, Ku = JSON.stringify(Qe(Gu, wi)), [qu, Ju] = y(0), Yu = v(0);
|
|
1527
1537
|
g(() => {
|
|
1528
|
-
|
|
1538
|
+
Si && Wu.current && (qu === Yu.current ? gt(Si, JSON.parse(Ku), Ci) : (Yu.current = qu, le(Si, Ci)));
|
|
1529
1539
|
}, [
|
|
1530
|
-
xi,
|
|
1531
1540
|
Si,
|
|
1532
|
-
|
|
1533
|
-
|
|
1541
|
+
Ci,
|
|
1542
|
+
Ku,
|
|
1543
|
+
qu
|
|
1534
1544
|
]);
|
|
1535
|
-
let
|
|
1545
|
+
let Xu = {
|
|
1536
1546
|
page: P.pageIndex + 1,
|
|
1537
1547
|
pageSize: h ? P.pageSize : 0,
|
|
1538
1548
|
sorting: N.map((e) => ({
|
|
1539
1549
|
id: e.id,
|
|
1540
1550
|
desc: e.desc
|
|
1541
1551
|
})),
|
|
1542
|
-
filters: zn(
|
|
1552
|
+
filters: zn(Ka),
|
|
1543
1553
|
search: I,
|
|
1544
1554
|
groupBy: F,
|
|
1545
|
-
...
|
|
1546
|
-
},
|
|
1547
|
-
...
|
|
1555
|
+
...Qi ? { condition: Ji } : {}
|
|
1556
|
+
}, Zu = ct(Xu), Qu = ct({
|
|
1557
|
+
...Xu,
|
|
1548
1558
|
page: void 0,
|
|
1549
1559
|
pageSize: void 0
|
|
1550
|
-
}),
|
|
1560
|
+
}), $u = v(void 0), ed = v(I);
|
|
1551
1561
|
g(() => {
|
|
1552
1562
|
if (!s) return;
|
|
1553
|
-
let e =
|
|
1554
|
-
if (
|
|
1555
|
-
|
|
1563
|
+
let e = $u.current !== void 0 && $u.current !== Qu;
|
|
1564
|
+
if ($u.current = Qu, e && P.pageIndex !== 0) {
|
|
1565
|
+
po({
|
|
1556
1566
|
...P,
|
|
1557
1567
|
pageIndex: 0
|
|
1558
1568
|
});
|
|
1559
1569
|
return;
|
|
1560
1570
|
}
|
|
1561
|
-
let t =
|
|
1562
|
-
|
|
1563
|
-
}, [
|
|
1564
|
-
let
|
|
1571
|
+
let t = ed.current !== I;
|
|
1572
|
+
ed.current = I, Wi.load(JSON.parse(Zu), { debounce: t });
|
|
1573
|
+
}, [Zu, !!s]);
|
|
1574
|
+
let td = k ? ia ?? na.length : L.getPrePaginatedRowModel().rows.length, nd = (Ye ?? []).map((e) => ({
|
|
1565
1575
|
value: String(e),
|
|
1566
1576
|
label: String(e)
|
|
1567
|
-
})),
|
|
1577
|
+
})), rd = ni || pr || Dr || !!Ir || ui || mi || Cr || wr || ea || !!Ti || !!Ei || !!Di, id = _r ? I : "", ad = oa && En === "skeleton", od = Math.min(Y.length || h || 5, 50), sd = hs && (k || na.length > 0) && (ki !== void 0 || On !== void 0), cd = (() => {
|
|
1568
1578
|
if (!Qr) return [];
|
|
1569
1579
|
let e = L.getSelectedRowModel().flatRows.filter((e) => !e.getIsGrouped());
|
|
1570
1580
|
return e.length ? W.flatMap((t) => {
|
|
1571
|
-
let n = j.get(t.id), r = Ze(e.map((e) =>
|
|
1581
|
+
let n = j.get(t.id), r = Ze(e.map((e) => sa(n, e.original)));
|
|
1572
1582
|
if (!r) return [];
|
|
1573
1583
|
let i = e[0].original;
|
|
1574
1584
|
return [{
|
|
1575
1585
|
id: t.id,
|
|
1576
|
-
text: `${n.header}: ${O.aggregates.sum(
|
|
1586
|
+
text: `${n.header}: ${O.aggregates.sum(Js(n, r.sum, i))} · ${O.aggregates.avg(Js(n, r.avg, i))}`
|
|
1577
1587
|
}];
|
|
1578
1588
|
}) : [];
|
|
1579
|
-
})(),
|
|
1589
|
+
})(), ld = k ? ia ?? na.length : L.getCoreRowModel().rows.length, ud = Yr ? W.find((e) => {
|
|
1580
1590
|
let t = j.get(e.id);
|
|
1581
|
-
return !t?.copyable && !(
|
|
1582
|
-
})?.id : void 0,
|
|
1591
|
+
return !t?.copyable && !(Ao && t?.editable);
|
|
1592
|
+
})?.id : void 0, dd = (e, t) => t === ud ? Yr?.(e.original) : void 0, fd = (e) => e.columns ? e.columns.flatMap(fd) : [e.id], pd = ra.some((e) => e.columns) ? (() => {
|
|
1583
1593
|
let e = L.getAllLeafColumns(), t = (t) => e.findIndex((e) => e.id === t);
|
|
1584
|
-
return
|
|
1594
|
+
return ra.map((n) => ({
|
|
1585
1595
|
def: n,
|
|
1586
|
-
leaves:
|
|
1596
|
+
leaves: fd(n).map((n) => e[t(n)]).filter(Boolean).sort((e, n) => t(e.id) - t(n.id))
|
|
1587
1597
|
})).sort((e, n) => t(e.leaves[0]?.id ?? "") - t(n.leaves[0]?.id ?? ""));
|
|
1588
|
-
})() : void 0,
|
|
1589
|
-
let n =
|
|
1598
|
+
})() : void 0, md = (e, t) => {
|
|
1599
|
+
let n = ra.map((e) => ({
|
|
1590
1600
|
id: e.id,
|
|
1591
|
-
leaves:
|
|
1601
|
+
leaves: fd(e)
|
|
1592
1602
|
})), r = qe(L.getAllLeafColumns().map((e) => e.id), n, e, t);
|
|
1593
1603
|
if (!r) return;
|
|
1594
1604
|
L.setColumnOrder(r);
|
|
1595
1605
|
let i = n.map((e) => e.id).sort((e, t) => r.indexOf(n.find((t) => t.id === e).leaves[0]) - r.indexOf(n.find((e) => e.id === t).leaves[0]));
|
|
1596
|
-
|
|
1597
|
-
},
|
|
1606
|
+
Jo(O.columnMoved(j.get(e)?.header ?? e, i.indexOf(e) + 1, i.length));
|
|
1607
|
+
}, hd = Rr?.length ? Rr : ["csv"], gd = pn && Os > 0, _d = hd.length === 1 && hd[0] === "csv" ? gd ? [{
|
|
1598
1608
|
value: "all",
|
|
1599
1609
|
label: O.exportAll
|
|
1600
1610
|
}, {
|
|
1601
1611
|
value: "selection",
|
|
1602
1612
|
label: O.exportSelection
|
|
1603
|
-
}] : [] :
|
|
1613
|
+
}] : [] : hd.flatMap((e) => gd ? [{
|
|
1604
1614
|
value: `${e}:all`,
|
|
1605
1615
|
label: O.exportAs(e, !1)
|
|
1606
1616
|
}, {
|
|
1607
1617
|
value: `${e}:selection`,
|
|
1608
1618
|
label: O.exportAs(e, !0)
|
|
1609
|
-
}] :
|
|
1619
|
+
}] : hd.length > 1 ? [{
|
|
1610
1620
|
value: `${e}:all`,
|
|
1611
1621
|
label: O.exportAs(e, !1)
|
|
1612
|
-
}] : []),
|
|
1622
|
+
}] : []), vd = hd.length > 1 ? O.exportMenu : hd[0] === "xlsx" ? O.exportXlsx : O.export, yd = /* @__PURE__ */ x("div", {
|
|
1613
1623
|
className: V.footer(),
|
|
1614
|
-
children: [
|
|
1624
|
+
children: [nd.length > 0 && /* @__PURE__ */ x("div", {
|
|
1615
1625
|
className: V.pageSize(),
|
|
1616
1626
|
children: [/* @__PURE__ */ b("span", {
|
|
1617
1627
|
"aria-hidden": "true",
|
|
@@ -1619,87 +1629,87 @@ function tr({ classes: a, data: o, dataSource: s, cacheTime: ee = 0, searchDebou
|
|
|
1619
1629
|
}), /* @__PURE__ */ b(re, {
|
|
1620
1630
|
className: V.pageSizeSelect(),
|
|
1621
1631
|
"aria-label": O.rowsPerPage,
|
|
1622
|
-
items:
|
|
1632
|
+
items: nd,
|
|
1623
1633
|
value: String(P.pageSize),
|
|
1624
1634
|
onValueChange: (e) => L.setPageSize(Number(e))
|
|
1625
1635
|
})]
|
|
1626
1636
|
}), /* @__PURE__ */ b(r, {
|
|
1627
|
-
count:
|
|
1637
|
+
count: td,
|
|
1628
1638
|
pageSize: P.pageSize,
|
|
1629
1639
|
page: P.pageIndex + 1,
|
|
1630
1640
|
translations: { rootLabel: `${we}: ${E.pagination.rootLabel}` },
|
|
1631
1641
|
withEdges: Yt,
|
|
1632
1642
|
onPageChange: (e) => L.setPageIndex(e - 1)
|
|
1633
1643
|
})]
|
|
1634
|
-
}),
|
|
1635
|
-
let i = w &&
|
|
1644
|
+
}), bd = (e, t, n, r) => {
|
|
1645
|
+
let i = w && El(e.id, t), a = T === "batch" && !!rt(Tc, e.id, t);
|
|
1636
1646
|
return {
|
|
1637
1647
|
className: [
|
|
1638
1648
|
i ? V.cellSelected() : "",
|
|
1639
1649
|
a ? V.cellChanged() : "",
|
|
1640
|
-
|
|
1650
|
+
eu(e.id, t)
|
|
1641
1651
|
],
|
|
1642
1652
|
attributes: {
|
|
1643
1653
|
...w || ni ? { "data-column-id": t } : {},
|
|
1644
1654
|
...w && z ? { "aria-selected": i } : {},
|
|
1645
1655
|
...a ? { "data-changed": "" } : {},
|
|
1646
|
-
...
|
|
1656
|
+
...uu(n, r),
|
|
1647
1657
|
...w ? {
|
|
1648
|
-
onPointerDown: (n) =>
|
|
1649
|
-
onPointerEnter: (n) =>
|
|
1650
|
-
onClickCapture:
|
|
1658
|
+
onPointerDown: (n) => Ml(e.id, t, n),
|
|
1659
|
+
onPointerEnter: (n) => Nl(e.id, t, n),
|
|
1660
|
+
onClickCapture: Pl
|
|
1651
1661
|
} : {}
|
|
1652
1662
|
}
|
|
1653
1663
|
};
|
|
1654
|
-
},
|
|
1664
|
+
}, xd = (e, t) => Uc === e.id ? /* @__PURE__ */ x(an, { children: [/* @__PURE__ */ b(d, {
|
|
1655
1665
|
icon: Ot,
|
|
1656
1666
|
label: O.saveRow(t),
|
|
1657
1667
|
variant: "text",
|
|
1658
1668
|
size: "sm",
|
|
1659
|
-
onClick: () =>
|
|
1669
|
+
onClick: () => vl(e, !0)
|
|
1660
1670
|
}), /* @__PURE__ */ b(d, {
|
|
1661
1671
|
icon: Zt,
|
|
1662
1672
|
label: O.cancelEdit(t),
|
|
1663
1673
|
variant: "text",
|
|
1664
1674
|
size: "sm",
|
|
1665
|
-
onClick: () =>
|
|
1675
|
+
onClick: () => vl(e, !1)
|
|
1666
1676
|
})] }) : /* @__PURE__ */ b(d, {
|
|
1667
1677
|
"data-row-edit": e.id,
|
|
1668
1678
|
icon: Ut,
|
|
1669
1679
|
label: O.editRow(t),
|
|
1670
1680
|
variant: "text",
|
|
1671
1681
|
size: "sm",
|
|
1672
|
-
onClick: () =>
|
|
1673
|
-
}),
|
|
1674
|
-
let r = j.get(t.id), i = M(r, n, e.original), a = T === "batch" && !!rt(
|
|
1675
|
-
if (r?.editable && (
|
|
1682
|
+
onClick: () => _l(e)
|
|
1683
|
+
}), Sd = (e, t, n) => {
|
|
1684
|
+
let r = j.get(t.id), i = M(r, n, e.original), a = T === "batch" && !!rt(Tc, e.id, t.id), o = r?.cell ? r.cell(e.original, n) : void 0;
|
|
1685
|
+
if (r?.editable && (Ao && Vc?.rowId === e.id && Vc.columnId === t.id || T === "row" && Uc === e.id)) return /* @__PURE__ */ x("div", {
|
|
1676
1686
|
"data-editor": "",
|
|
1677
1687
|
className: V.editor(),
|
|
1678
|
-
"aria-busy":
|
|
1679
|
-
onKeyDown: (n) =>
|
|
1680
|
-
onBlur:
|
|
1681
|
-
children: [r.renderEditor ? r.renderEditor(
|
|
1682
|
-
type:
|
|
1688
|
+
"aria-busy": Zc || void 0,
|
|
1689
|
+
onKeyDown: (n) => Ao ? pl(e, t.id, n) : yl(e, n),
|
|
1690
|
+
onBlur: Ao ? (n) => ml(e, t.id, n) : void 0,
|
|
1691
|
+
children: [r.renderEditor ? r.renderEditor(gl(e, r)) : /* @__PURE__ */ b(Pn, {
|
|
1692
|
+
type: tl(r),
|
|
1683
1693
|
label: q(t),
|
|
1684
1694
|
options: r.editOptions,
|
|
1685
1695
|
renderOption: r.renderOption,
|
|
1686
|
-
invalid: !!
|
|
1687
|
-
value:
|
|
1688
|
-
onChange: (t) =>
|
|
1689
|
-
}),
|
|
1690
|
-
id:
|
|
1696
|
+
invalid: !!qc[t.id],
|
|
1697
|
+
value: Gc[t.id],
|
|
1698
|
+
onChange: (t) => hl(e, r, t)
|
|
1699
|
+
}), qc[t.id] && /* @__PURE__ */ b("span", {
|
|
1700
|
+
id: rl(e.id, t.id),
|
|
1691
1701
|
role: "alert",
|
|
1692
1702
|
className: V.editError(),
|
|
1693
|
-
children:
|
|
1703
|
+
children: qc[t.id]
|
|
1694
1704
|
})]
|
|
1695
1705
|
});
|
|
1696
|
-
if (
|
|
1706
|
+
if (Ao && r?.editable) return /* @__PURE__ */ b("button", {
|
|
1697
1707
|
type: "button",
|
|
1698
|
-
className:
|
|
1699
|
-
"data-edit":
|
|
1708
|
+
className: Do(t.id).editButton(),
|
|
1709
|
+
"data-edit": nl(e.id, t.id),
|
|
1700
1710
|
"aria-label": a ? `${O.edit(q(t), i)}, ${O.changed}` : O.edit(q(t), i),
|
|
1701
1711
|
onClick: (n) => {
|
|
1702
|
-
(ai !== "dblclick" || n.detail !== 1) &&
|
|
1712
|
+
(ai !== "dblclick" || n.detail !== 1) && ol(e, t.id);
|
|
1703
1713
|
},
|
|
1704
1714
|
children: o ?? i
|
|
1705
1715
|
});
|
|
@@ -1710,23 +1720,23 @@ function tr({ classes: a, data: o, dataSource: s, cacheTime: ee = 0, searchDebou
|
|
|
1710
1720
|
label: O.copy(q(t), i)
|
|
1711
1721
|
})]
|
|
1712
1722
|
});
|
|
1713
|
-
let s =
|
|
1723
|
+
let s = Xl ? Kl.trim() : id, c = o === void 0 ? s ? /* @__PURE__ */ b(p, {
|
|
1714
1724
|
text: i,
|
|
1715
1725
|
query: s
|
|
1716
|
-
}) : i : o, ee =
|
|
1726
|
+
}) : i : o, ee = dd(e, t.id);
|
|
1717
1727
|
return ee ? /* @__PURE__ */ b("a", {
|
|
1718
1728
|
href: ee,
|
|
1719
1729
|
className: V.rowLink(),
|
|
1720
1730
|
"data-row-link": "",
|
|
1721
1731
|
children: c
|
|
1722
1732
|
}) : c;
|
|
1723
|
-
},
|
|
1724
|
-
onContextMenuCapture:
|
|
1733
|
+
}, Cd = /* @__PURE__ */ x("tbody", {
|
|
1734
|
+
onContextMenuCapture: tc,
|
|
1725
1735
|
children: [
|
|
1726
|
-
Y.length === 0 && !
|
|
1727
|
-
colSpan:
|
|
1736
|
+
Y.length === 0 && !ad && /* @__PURE__ */ b("tr", { children: /* @__PURE__ */ b("td", {
|
|
1737
|
+
colSpan: jo,
|
|
1728
1738
|
className: V.message(),
|
|
1729
|
-
children:
|
|
1739
|
+
children: aa ? /* @__PURE__ */ x("span", {
|
|
1730
1740
|
className: V.errorContent(),
|
|
1731
1741
|
children: [/* @__PURE__ */ b("span", {
|
|
1732
1742
|
role: "alert",
|
|
@@ -1734,18 +1744,18 @@ function tr({ classes: a, data: o, dataSource: s, cacheTime: ee = 0, searchDebou
|
|
|
1734
1744
|
}), /* @__PURE__ */ b(u, {
|
|
1735
1745
|
variant: "outline",
|
|
1736
1746
|
size: "sm",
|
|
1737
|
-
onClick: () => void
|
|
1747
|
+
onClick: () => void Tu(),
|
|
1738
1748
|
children: E.dataSource.retry
|
|
1739
1749
|
})]
|
|
1740
|
-
}) :
|
|
1750
|
+
}) : oa ? Ai ?? /* @__PURE__ */ x("span", {
|
|
1741
1751
|
className: V.messageContent(),
|
|
1742
1752
|
children: [/* @__PURE__ */ b(ne, {
|
|
1743
1753
|
size: "sm",
|
|
1744
1754
|
label: kn ?? E.common.loading
|
|
1745
1755
|
}), kn ?? E.common.loading]
|
|
1746
|
-
}) :
|
|
1756
|
+
}) : sd ? ki ?? On ?? Dn ?? E.common.empty : Oi ?? Dn ?? E.common.empty
|
|
1747
1757
|
}) }),
|
|
1748
|
-
|
|
1758
|
+
ad && Array.from({ length: od }, (e, t) => /* @__PURE__ */ x("tr", {
|
|
1749
1759
|
className: V.row(),
|
|
1750
1760
|
children: [
|
|
1751
1761
|
H.map((e) => /* @__PURE__ */ b("td", {
|
|
@@ -1753,8 +1763,8 @@ function tr({ classes: a, data: o, dataSource: s, cacheTime: ee = 0, searchDebou
|
|
|
1753
1763
|
style: K(e)
|
|
1754
1764
|
}, e)),
|
|
1755
1765
|
W.map((e) => /* @__PURE__ */ b("td", {
|
|
1756
|
-
className:
|
|
1757
|
-
style:
|
|
1766
|
+
className: Do(e.id).td({ class: Lo(e.id, !1) }),
|
|
1767
|
+
style: Ro(e.id, !1),
|
|
1758
1768
|
children: /* @__PURE__ */ b(i, {})
|
|
1759
1769
|
}, e.id)),
|
|
1760
1770
|
U.length > 0 && /* @__PURE__ */ b("td", {
|
|
@@ -1763,30 +1773,30 @@ function tr({ classes: a, data: o, dataSource: s, cacheTime: ee = 0, searchDebou
|
|
|
1763
1773
|
})
|
|
1764
1774
|
]
|
|
1765
1775
|
}, `skeleton-${t + 1}`)),
|
|
1766
|
-
|
|
1776
|
+
Mu > 0 && !ad && /* @__PURE__ */ b("tr", {
|
|
1767
1777
|
className: V.spacer(),
|
|
1768
1778
|
"aria-hidden": "true",
|
|
1769
1779
|
children: /* @__PURE__ */ b("td", {
|
|
1770
|
-
colSpan:
|
|
1780
|
+
colSpan: jo,
|
|
1771
1781
|
className: V.spacerCell(),
|
|
1772
|
-
style: { height:
|
|
1782
|
+
style: { height: Mu }
|
|
1773
1783
|
})
|
|
1774
1784
|
}),
|
|
1775
|
-
(
|
|
1776
|
-
let t = e.row, n = B ? e.index +
|
|
1785
|
+
(ad ? [] : ju).map((e) => {
|
|
1786
|
+
let t = e.row, n = B ? e.index + Vo.length + 1 : void 0;
|
|
1777
1787
|
if (e.kind === "group") {
|
|
1778
1788
|
let r = j.get(t.groupingColumnId), i = M(r, t.groupingValue, t.original), a = t.getLeafRows().length;
|
|
1779
1789
|
return /* @__PURE__ */ x("tr", {
|
|
1780
|
-
ref:
|
|
1790
|
+
ref: Pu,
|
|
1781
1791
|
className: V.groupRow({ class: X ? [V.dropTarget(), V.dropInside()] : void 0 }),
|
|
1782
1792
|
"data-index": e.index,
|
|
1783
1793
|
"aria-rowindex": n,
|
|
1784
|
-
"data-drop": X ?
|
|
1785
|
-
onDragOver: Hr ? (e) =>
|
|
1786
|
-
onDragLeave: Hr ? () =>
|
|
1787
|
-
onDrop: Hr ?
|
|
1794
|
+
"data-drop": X ? wc(t.id) : void 0,
|
|
1795
|
+
onDragOver: Hr ? (e) => xc(t, e) : void 0,
|
|
1796
|
+
onDragLeave: Hr ? () => cc(null) : void 0,
|
|
1797
|
+
onDrop: Hr ? Cc : void 0,
|
|
1788
1798
|
children: [/* @__PURE__ */ b("td", {
|
|
1789
|
-
colSpan:
|
|
1799
|
+
colSpan: Ks ? H.length + 1 : jo,
|
|
1790
1800
|
className: V.groupCell(),
|
|
1791
1801
|
children: /* @__PURE__ */ x("div", {
|
|
1792
1802
|
className: V.treeCell(),
|
|
@@ -1814,50 +1824,50 @@ function tr({ classes: a, data: o, dataSource: s, cacheTime: ee = 0, searchDebou
|
|
|
1814
1824
|
})
|
|
1815
1825
|
]
|
|
1816
1826
|
})
|
|
1817
|
-
}),
|
|
1818
|
-
className:
|
|
1819
|
-
children:
|
|
1827
|
+
}), Ks && /* @__PURE__ */ x(an, { children: [W.slice(1).map((e) => /* @__PURE__ */ b("td", {
|
|
1828
|
+
className: Do(e.id).groupAggregate(),
|
|
1829
|
+
children: Ys(j.get(e.id), t.getLeafRows())
|
|
1820
1830
|
}, e.id)), U.length > 0 && /* @__PURE__ */ b("td", { className: V.groupAggregate() })] })]
|
|
1821
1831
|
}, e.key);
|
|
1822
1832
|
}
|
|
1823
1833
|
if (e.kind === "expansion") return /* @__PURE__ */ b("tr", {
|
|
1824
|
-
id:
|
|
1825
|
-
ref:
|
|
1834
|
+
id: Us(t),
|
|
1835
|
+
ref: Pu,
|
|
1826
1836
|
className: V.expansionRow(),
|
|
1827
1837
|
"data-index": e.index,
|
|
1828
1838
|
"aria-rowindex": n,
|
|
1829
1839
|
children: /* @__PURE__ */ b("td", {
|
|
1830
|
-
colSpan:
|
|
1840
|
+
colSpan: jo,
|
|
1831
1841
|
className: V.expansionCell(),
|
|
1832
1842
|
children: cr?.(t.original, t.id)
|
|
1833
1843
|
})
|
|
1834
1844
|
}, e.key);
|
|
1835
|
-
let r =
|
|
1845
|
+
let r = zi(t.original, t.index);
|
|
1836
1846
|
return /* @__PURE__ */ x("tr", {
|
|
1837
|
-
ref:
|
|
1847
|
+
ref: Pu,
|
|
1838
1848
|
className: V.row({ class: [
|
|
1839
1849
|
Hr ? V.dropTarget() : "",
|
|
1840
|
-
Hr &&
|
|
1850
|
+
Hr && uc && X ? V.dropInside() : "",
|
|
1841
1851
|
Yr?.(t.original) ? V.linkRow() : "",
|
|
1842
1852
|
Jr?.(t.original)
|
|
1843
1853
|
] }),
|
|
1844
|
-
"data-state":
|
|
1845
|
-
"aria-selected": z && pn ?
|
|
1854
|
+
"data-state": Ds(t) ? "selected" : void 0,
|
|
1855
|
+
"aria-selected": z && pn ? Ds(t) : void 0,
|
|
1846
1856
|
"data-row-id": t.id,
|
|
1847
1857
|
"data-index": e.index,
|
|
1848
1858
|
"aria-rowindex": n,
|
|
1849
|
-
"aria-level":
|
|
1850
|
-
"aria-expanded":
|
|
1851
|
-
draggable:
|
|
1852
|
-
"data-drop":
|
|
1859
|
+
"aria-level": To ? t.depth + 1 : void 0,
|
|
1860
|
+
"aria-expanded": To && t.getCanExpand() ? t.getIsExpanded() : void 0,
|
|
1861
|
+
draggable: ac === t.id ? "true" : void 0,
|
|
1862
|
+
"data-drop": wc(t.id),
|
|
1853
1863
|
"data-dragging": X === t.id || void 0,
|
|
1854
|
-
onClick: (e) =>
|
|
1855
|
-
onAuxClick: (e) =>
|
|
1856
|
-
onDragStart: (e) =>
|
|
1857
|
-
onDragOver: (e) =>
|
|
1858
|
-
onDragLeave: () =>
|
|
1859
|
-
onDrop:
|
|
1860
|
-
onDragEnd:
|
|
1864
|
+
onClick: (e) => Ls(t, e),
|
|
1865
|
+
onAuxClick: (e) => Rs(t, e),
|
|
1866
|
+
onDragStart: (e) => yc(t, e),
|
|
1867
|
+
onDragOver: (e) => bc(t, e),
|
|
1868
|
+
onDragLeave: () => cc(null),
|
|
1869
|
+
onDrop: Cc,
|
|
1870
|
+
onDragEnd: Sc,
|
|
1861
1871
|
children: [
|
|
1862
1872
|
H.map((e) => /* @__PURE__ */ b("td", {
|
|
1863
1873
|
className: V.td({ class: G(e, !1) }),
|
|
@@ -1867,36 +1877,36 @@ function tr({ classes: a, data: o, dataSource: s, cacheTime: ee = 0, searchDebou
|
|
|
1867
1877
|
className: V.dragHandle(),
|
|
1868
1878
|
"data-drag-handle": t.id,
|
|
1869
1879
|
"aria-label": O.moveRow(r),
|
|
1870
|
-
"aria-keyshortcuts":
|
|
1871
|
-
onKeyDown: (e) =>
|
|
1872
|
-
onPointerDown: () =>
|
|
1873
|
-
onPointerUp: () =>
|
|
1880
|
+
"aria-keyshortcuts": uc ? "ArrowUp ArrowDown ArrowLeft ArrowRight" : "ArrowUp ArrowDown",
|
|
1881
|
+
onKeyDown: (e) => vc(t, e),
|
|
1882
|
+
onPointerDown: () => oc(t.id),
|
|
1883
|
+
onPointerUp: () => oc(X ? ac : null),
|
|
1874
1884
|
children: /* @__PURE__ */ b(zt, {
|
|
1875
1885
|
className: V.dragIcon(),
|
|
1876
1886
|
"aria-hidden": "true"
|
|
1877
1887
|
})
|
|
1878
|
-
}) : e === "select" &&
|
|
1879
|
-
onClickCapture:
|
|
1880
|
-
onKeyDownCapture:
|
|
1888
|
+
}) : e === "select" && Ts ? /* @__PURE__ */ b("span", {
|
|
1889
|
+
onClickCapture: Fs,
|
|
1890
|
+
onKeyDownCapture: Fs,
|
|
1881
1891
|
children: /* @__PURE__ */ b(f, {
|
|
1882
|
-
checked:
|
|
1892
|
+
checked: Ds(t),
|
|
1883
1893
|
disabled: !t.getCanSelect(),
|
|
1884
1894
|
"aria-label": O.selectRow(r),
|
|
1885
|
-
onCheckedChange: (e) =>
|
|
1895
|
+
onCheckedChange: (e) => Ps(t, e === !0, Ns.current)
|
|
1886
1896
|
})
|
|
1887
1897
|
}) : e === "select" ? /* @__PURE__ */ b("input", {
|
|
1888
1898
|
type: "radio",
|
|
1889
|
-
name:
|
|
1899
|
+
name: js,
|
|
1890
1900
|
className: V.radio(),
|
|
1891
|
-
checked:
|
|
1901
|
+
checked: Ds(t),
|
|
1892
1902
|
disabled: !t.getCanSelect(),
|
|
1893
1903
|
"aria-label": O.selectRow(r),
|
|
1894
|
-
onChange: () =>
|
|
1904
|
+
onChange: () => Ps(t, !0)
|
|
1895
1905
|
}) : e === "expand" && t.getCanExpand() ? /* @__PURE__ */ b("button", {
|
|
1896
1906
|
type: "button",
|
|
1897
1907
|
className: V.expander(),
|
|
1898
1908
|
"aria-expanded": t.getIsExpanded(),
|
|
1899
|
-
"aria-controls": t.getIsExpanded() ?
|
|
1909
|
+
"aria-controls": t.getIsExpanded() ? Us(t) : void 0,
|
|
1900
1910
|
"aria-label": O.details(r),
|
|
1901
1911
|
onClick: () => t.toggleExpanded(),
|
|
1902
1912
|
children: /* @__PURE__ */ b(At, {
|
|
@@ -1906,31 +1916,31 @@ function tr({ classes: a, data: o, dataSource: s, cacheTime: ee = 0, searchDebou
|
|
|
1906
1916
|
})
|
|
1907
1917
|
}) : e === "expand" ? /* @__PURE__ */ b("span", { className: V.expanderSpacer() }) : /* @__PURE__ */ b("span", {
|
|
1908
1918
|
className: V.rowNumber(),
|
|
1909
|
-
children:
|
|
1919
|
+
children: Hs.get(t.id)
|
|
1910
1920
|
})
|
|
1911
1921
|
}, e)),
|
|
1912
1922
|
t.getVisibleCells().map((n, r) => {
|
|
1913
|
-
if (
|
|
1914
|
-
let t =
|
|
1923
|
+
if (ou) {
|
|
1924
|
+
let t = lu(e.index, r);
|
|
1915
1925
|
if (!t.rowSpan || !t.colSpan) return null;
|
|
1916
1926
|
}
|
|
1917
|
-
let i =
|
|
1927
|
+
let i = Sd(t, n.column, kc(t, n.column.id)), a = bd(t, n.column.id, e.index, r);
|
|
1918
1928
|
return /* @__PURE__ */ b("td", {
|
|
1919
|
-
className:
|
|
1920
|
-
|
|
1921
|
-
|
|
1929
|
+
className: Do(n.column.id).td({ class: [
|
|
1930
|
+
Lo(n.column.id, !1),
|
|
1931
|
+
Oo(n.column.id, t),
|
|
1922
1932
|
...a.className
|
|
1923
1933
|
] }),
|
|
1924
|
-
style:
|
|
1934
|
+
style: Ro(n.column.id, !1),
|
|
1925
1935
|
...a.attributes,
|
|
1926
|
-
children:
|
|
1936
|
+
children: Gs && r === 0 ? /* @__PURE__ */ x("div", {
|
|
1927
1937
|
className: V.treeCell(),
|
|
1928
1938
|
style: { paddingInlineStart: t.depth * 20 },
|
|
1929
1939
|
children: [tr && t.getCanExpand() ? /* @__PURE__ */ b("button", {
|
|
1930
1940
|
type: "button",
|
|
1931
1941
|
className: V.expander(),
|
|
1932
1942
|
"aria-expanded": t.getIsExpanded(),
|
|
1933
|
-
"aria-label":
|
|
1943
|
+
"aria-label": Bi(t.original, t.index),
|
|
1934
1944
|
onClick: t.getToggleExpandedHandler(),
|
|
1935
1945
|
children: /* @__PURE__ */ b(At, {
|
|
1936
1946
|
className: V.expanderIcon(),
|
|
@@ -1946,9 +1956,9 @@ function tr({ classes: a, data: o, dataSource: s, cacheTime: ee = 0, searchDebou
|
|
|
1946
1956
|
style: K("actions"),
|
|
1947
1957
|
children: /* @__PURE__ */ x("div", {
|
|
1948
1958
|
className: V.editActions(),
|
|
1949
|
-
children: [T === "row" &&
|
|
1950
|
-
items:
|
|
1951
|
-
onSelect: (e) =>
|
|
1959
|
+
children: [T === "row" && ko && xd(t, r), Gr && Uc !== t.id && /* @__PURE__ */ b(l, {
|
|
1960
|
+
items: Qs(t),
|
|
1961
|
+
onSelect: (e) => nc(t, e),
|
|
1952
1962
|
children: /* @__PURE__ */ b(d, {
|
|
1953
1963
|
icon: It,
|
|
1954
1964
|
label: O.rowActions(r),
|
|
@@ -1961,29 +1971,29 @@ function tr({ classes: a, data: o, dataSource: s, cacheTime: ee = 0, searchDebou
|
|
|
1961
1971
|
]
|
|
1962
1972
|
}, e.key);
|
|
1963
1973
|
}),
|
|
1964
|
-
|
|
1974
|
+
Nu > 0 && !ad && /* @__PURE__ */ b("tr", {
|
|
1965
1975
|
className: V.spacer(),
|
|
1966
1976
|
"aria-hidden": "true",
|
|
1967
1977
|
children: /* @__PURE__ */ b("td", {
|
|
1968
|
-
colSpan:
|
|
1978
|
+
colSpan: jo,
|
|
1969
1979
|
className: V.spacerCell(),
|
|
1970
|
-
style: { height:
|
|
1980
|
+
style: { height: Nu }
|
|
1971
1981
|
})
|
|
1972
1982
|
})
|
|
1973
1983
|
]
|
|
1974
|
-
}),
|
|
1975
|
-
...
|
|
1976
|
-
ref:
|
|
1977
|
-
className: V.base({ class:
|
|
1984
|
+
}), wd = /* @__PURE__ */ x("div", {
|
|
1985
|
+
...Ni,
|
|
1986
|
+
ref: Li,
|
|
1987
|
+
className: V.base({ class: Mi }),
|
|
1978
1988
|
role: R ? "dialog" : void 0,
|
|
1979
1989
|
"aria-modal": R || void 0,
|
|
1980
1990
|
"aria-label": R ? we : void 0,
|
|
1981
|
-
onKeyDown:
|
|
1991
|
+
onKeyDown: Du,
|
|
1982
1992
|
children: [
|
|
1983
|
-
|
|
1993
|
+
rd && /* @__PURE__ */ x("div", {
|
|
1984
1994
|
className: V.toolbar(),
|
|
1985
1995
|
children: [
|
|
1986
|
-
|
|
1996
|
+
Ei,
|
|
1987
1997
|
pr && /* @__PURE__ */ b(te, {
|
|
1988
1998
|
type: "search",
|
|
1989
1999
|
size: "sm",
|
|
@@ -1994,27 +2004,27 @@ function tr({ classes: a, data: o, dataSource: s, cacheTime: ee = 0, searchDebou
|
|
|
1994
2004
|
value: I,
|
|
1995
2005
|
onChange: (e) => L.setGlobalFilter(e.target.value)
|
|
1996
2006
|
}),
|
|
1997
|
-
|
|
2007
|
+
Ti,
|
|
1998
2008
|
/* @__PURE__ */ x("div", {
|
|
1999
2009
|
className: V.toolbarEnd(),
|
|
2000
2010
|
children: [
|
|
2001
|
-
|
|
2011
|
+
Di,
|
|
2002
2012
|
ni && /* @__PURE__ */ b(d, {
|
|
2003
2013
|
"data-find-toggle": "",
|
|
2004
2014
|
icon: Jt,
|
|
2005
2015
|
label: O.find,
|
|
2006
2016
|
variant: "outline",
|
|
2007
2017
|
size: "sm",
|
|
2008
|
-
"aria-expanded":
|
|
2009
|
-
onClick:
|
|
2018
|
+
"aria-expanded": Wl,
|
|
2019
|
+
onClick: ru
|
|
2010
2020
|
}),
|
|
2011
|
-
|
|
2021
|
+
ea && /* @__PURE__ */ b(u, {
|
|
2012
2022
|
variant: "outline",
|
|
2013
2023
|
size: "sm",
|
|
2014
2024
|
leadingIcon: Bt,
|
|
2015
|
-
"aria-expanded":
|
|
2016
|
-
"aria-controls": `${
|
|
2017
|
-
onClick: () =>
|
|
2025
|
+
"aria-expanded": Yi,
|
|
2026
|
+
"aria-controls": `${Ii}-advanced`,
|
|
2027
|
+
onClick: () => Xi(!Yi),
|
|
2018
2028
|
children: E.conditionBuilder.advanced
|
|
2019
2029
|
}),
|
|
2020
2030
|
Cr && /* @__PURE__ */ b(d, {
|
|
@@ -2022,16 +2032,16 @@ function tr({ classes: a, data: o, dataSource: s, cacheTime: ee = 0, searchDebou
|
|
|
2022
2032
|
label: O.filterToggle,
|
|
2023
2033
|
variant: "outline",
|
|
2024
2034
|
size: "sm",
|
|
2025
|
-
"aria-pressed":
|
|
2026
|
-
onClick:
|
|
2035
|
+
"aria-pressed": Ma,
|
|
2036
|
+
onClick: vo
|
|
2027
2037
|
}),
|
|
2028
2038
|
wr && /* @__PURE__ */ b(d, {
|
|
2029
2039
|
icon: Rt,
|
|
2030
2040
|
label: O.resetFilters,
|
|
2031
2041
|
variant: "outline",
|
|
2032
2042
|
size: "sm",
|
|
2033
|
-
disabled: !
|
|
2034
|
-
onClick:
|
|
2043
|
+
disabled: !hs,
|
|
2044
|
+
onClick: Cu
|
|
2035
2045
|
}),
|
|
2036
2046
|
ui && /* @__PURE__ */ x(S.Root, {
|
|
2037
2047
|
positioning: {
|
|
@@ -2049,22 +2059,22 @@ function tr({ classes: a, data: o, dataSource: s, cacheTime: ee = 0, searchDebou
|
|
|
2049
2059
|
size: "sm"
|
|
2050
2060
|
})
|
|
2051
2061
|
}), /* @__PURE__ */ b(on, { children: /* @__PURE__ */ b(S.Positioner, { children: /* @__PURE__ */ b(S.Content, {
|
|
2052
|
-
className:
|
|
2062
|
+
className: Fi.content(),
|
|
2053
2063
|
children: /* @__PURE__ */ b(S.RadioItemGroup, {
|
|
2054
|
-
value:
|
|
2055
|
-
onValueChange: (e) =>
|
|
2064
|
+
value: oo,
|
|
2065
|
+
onValueChange: (e) => bo(e.value),
|
|
2056
2066
|
children: [
|
|
2057
2067
|
"sm",
|
|
2058
2068
|
"md",
|
|
2059
2069
|
"lg"
|
|
2060
2070
|
].map((e) => /* @__PURE__ */ x(S.RadioItem, {
|
|
2061
2071
|
value: e,
|
|
2062
|
-
className:
|
|
2072
|
+
className: Fi.item(),
|
|
2063
2073
|
children: [/* @__PURE__ */ b(S.ItemIndicator, { children: /* @__PURE__ */ b(Ot, {
|
|
2064
2074
|
className: V.menuCheck(),
|
|
2065
2075
|
"aria-hidden": "true"
|
|
2066
2076
|
}) }), /* @__PURE__ */ b(S.ItemText, {
|
|
2067
|
-
className:
|
|
2077
|
+
className: Fi.label(),
|
|
2068
2078
|
children: O.densities[e]
|
|
2069
2079
|
})]
|
|
2070
2080
|
}, e))
|
|
@@ -2087,8 +2097,8 @@ function tr({ classes: a, data: o, dataSource: s, cacheTime: ee = 0, searchDebou
|
|
|
2087
2097
|
children: O.columns
|
|
2088
2098
|
})
|
|
2089
2099
|
}), /* @__PURE__ */ b(on, { children: /* @__PURE__ */ b(S.Positioner, { children: /* @__PURE__ */ b(S.Content, {
|
|
2090
|
-
className:
|
|
2091
|
-
children: (
|
|
2100
|
+
className: Fi.content(),
|
|
2101
|
+
children: (pd || [{
|
|
2092
2102
|
def: void 0,
|
|
2093
2103
|
leaves: L.getAllLeafColumns()
|
|
2094
2104
|
}]).map(({ def: e, leaves: t }, n) => {
|
|
@@ -2097,12 +2107,12 @@ function tr({ classes: a, data: o, dataSource: s, cacheTime: ee = 0, searchDebou
|
|
|
2097
2107
|
checked: e.getIsVisible(),
|
|
2098
2108
|
onCheckedChange: (t) => e.toggleVisibility(t),
|
|
2099
2109
|
closeOnSelect: !1,
|
|
2100
|
-
className:
|
|
2110
|
+
className: Fi.item({ class: t ? V.columnGroupItem() : void 0 }),
|
|
2101
2111
|
children: [/* @__PURE__ */ b(S.ItemIndicator, { children: /* @__PURE__ */ b(Ot, {
|
|
2102
2112
|
className: V.menuCheck(),
|
|
2103
2113
|
"aria-hidden": "true"
|
|
2104
2114
|
}) }), /* @__PURE__ */ b(S.ItemText, {
|
|
2105
|
-
className:
|
|
2115
|
+
className: Fi.label(),
|
|
2106
2116
|
children: q(e)
|
|
2107
2117
|
})]
|
|
2108
2118
|
}, e.id);
|
|
@@ -2112,28 +2122,28 @@ function tr({ classes: a, data: o, dataSource: s, cacheTime: ee = 0, searchDebou
|
|
|
2112
2122
|
checked: r.every((e) => e.getIsVisible()),
|
|
2113
2123
|
disabled: !r.length,
|
|
2114
2124
|
onCheckedChange: (e) => L.setColumnVisibility({
|
|
2115
|
-
...
|
|
2125
|
+
...Xa,
|
|
2116
2126
|
...Object.fromEntries(r.map((t) => [t.id, e]))
|
|
2117
2127
|
}),
|
|
2118
2128
|
closeOnSelect: !1,
|
|
2119
|
-
className:
|
|
2129
|
+
className: Fi.item(),
|
|
2120
2130
|
children: [/* @__PURE__ */ b(S.ItemIndicator, { children: /* @__PURE__ */ b(Ot, {
|
|
2121
2131
|
className: V.menuCheck(),
|
|
2122
2132
|
"aria-hidden": "true"
|
|
2123
2133
|
}) }), /* @__PURE__ */ b(S.ItemText, {
|
|
2124
|
-
className:
|
|
2134
|
+
className: Fi.label(),
|
|
2125
2135
|
children: e.header
|
|
2126
2136
|
})]
|
|
2127
2137
|
}),
|
|
2128
2138
|
r.map((e) => i(e, !0)),
|
|
2129
2139
|
jr && [-1, 1].map((t) => /* @__PURE__ */ b(S.Item, {
|
|
2130
2140
|
value: `group-${t < 0 ? "earlier" : "later"}:${e.id}`,
|
|
2131
|
-
disabled: t < 0 ? n === 0 : n ===
|
|
2141
|
+
disabled: t < 0 ? n === 0 : n === pd.length - 1,
|
|
2132
2142
|
closeOnSelect: !1,
|
|
2133
|
-
className:
|
|
2134
|
-
onSelect: () =>
|
|
2143
|
+
className: Fi.item({ class: V.columnGroupItem() }),
|
|
2144
|
+
onSelect: () => md(e.id, t),
|
|
2135
2145
|
children: /* @__PURE__ */ b(S.ItemText, {
|
|
2136
|
-
className:
|
|
2146
|
+
className: Fi.label(),
|
|
2137
2147
|
children: t < 0 ? O.columnGroupEarlier(e.header) : O.columnGroupLater(e.header)
|
|
2138
2148
|
})
|
|
2139
2149
|
}, t))
|
|
@@ -2141,24 +2151,24 @@ function tr({ classes: a, data: o, dataSource: s, cacheTime: ee = 0, searchDebou
|
|
|
2141
2151
|
})
|
|
2142
2152
|
}) }) })]
|
|
2143
2153
|
}),
|
|
2144
|
-
Ir && (
|
|
2145
|
-
items:
|
|
2154
|
+
Ir && (_d.length > 1 ? /* @__PURE__ */ b(l, {
|
|
2155
|
+
items: _d,
|
|
2146
2156
|
onSelect: (e) => {
|
|
2147
2157
|
let [t, n] = e.includes(":") ? e.split(":") : ["csv", e];
|
|
2148
|
-
|
|
2158
|
+
bu(t, n === "selection");
|
|
2149
2159
|
},
|
|
2150
2160
|
children: /* @__PURE__ */ b(u, {
|
|
2151
2161
|
variant: "outline",
|
|
2152
2162
|
size: "sm",
|
|
2153
2163
|
leadingIcon: Ft,
|
|
2154
|
-
children:
|
|
2164
|
+
children: vd
|
|
2155
2165
|
})
|
|
2156
2166
|
}) : /* @__PURE__ */ b(u, {
|
|
2157
2167
|
variant: "outline",
|
|
2158
2168
|
size: "sm",
|
|
2159
2169
|
leadingIcon: Ft,
|
|
2160
|
-
onClick: () =>
|
|
2161
|
-
children:
|
|
2170
|
+
onClick: () => bu(hd[0], !1),
|
|
2171
|
+
children: vd
|
|
2162
2172
|
})),
|
|
2163
2173
|
mi && /* @__PURE__ */ b(d, {
|
|
2164
2174
|
"data-fullscreen-toggle": "",
|
|
@@ -2166,23 +2176,23 @@ function tr({ classes: a, data: o, dataSource: s, cacheTime: ee = 0, searchDebou
|
|
|
2166
2176
|
label: R ? O.exitFullscreen : O.fullscreen,
|
|
2167
2177
|
variant: "outline",
|
|
2168
2178
|
size: "sm",
|
|
2169
|
-
onClick:
|
|
2179
|
+
onClick: Eu
|
|
2170
2180
|
})
|
|
2171
2181
|
]
|
|
2172
2182
|
})
|
|
2173
2183
|
]
|
|
2174
2184
|
}),
|
|
2175
|
-
|
|
2176
|
-
id: `${
|
|
2185
|
+
ea && Yi && /* @__PURE__ */ b("div", {
|
|
2186
|
+
id: `${Ii}-advanced`,
|
|
2177
2187
|
className: V.advancedFilter(),
|
|
2178
2188
|
children: fr({
|
|
2179
|
-
fields:
|
|
2180
|
-
value:
|
|
2181
|
-
onValueChange:
|
|
2189
|
+
fields: Zi,
|
|
2190
|
+
value: Ji,
|
|
2191
|
+
onValueChange: $i,
|
|
2182
2192
|
label: E.conditionBuilder.advanced
|
|
2183
2193
|
})
|
|
2184
2194
|
}),
|
|
2185
|
-
ni &&
|
|
2195
|
+
ni && Wl && /* @__PURE__ */ x("div", {
|
|
2186
2196
|
className: V.findBar(),
|
|
2187
2197
|
role: "search",
|
|
2188
2198
|
"aria-label": O.find,
|
|
@@ -2195,14 +2205,14 @@ function tr({ classes: a, data: o, dataSource: s, cacheTime: ee = 0, searchDebou
|
|
|
2195
2205
|
className: V.findInput(),
|
|
2196
2206
|
placeholder: O.searchPlaceholder,
|
|
2197
2207
|
"aria-label": O.find,
|
|
2198
|
-
value:
|
|
2199
|
-
onChange: (e) =>
|
|
2200
|
-
onKeyDown:
|
|
2208
|
+
value: Kl,
|
|
2209
|
+
onChange: (e) => au(e.target.value),
|
|
2210
|
+
onKeyDown: iu
|
|
2201
2211
|
}),
|
|
2202
2212
|
/* @__PURE__ */ b("span", {
|
|
2203
2213
|
className: V.findCount(),
|
|
2204
2214
|
"aria-live": "polite",
|
|
2205
|
-
children:
|
|
2215
|
+
children: Kl.trim() ? O.findMatches(Q.length ? Math.min(Jl, Q.length - 1) + 1 : 0, Q.length) : ""
|
|
2206
2216
|
}),
|
|
2207
2217
|
/* @__PURE__ */ b(d, {
|
|
2208
2218
|
icon: jt,
|
|
@@ -2210,7 +2220,7 @@ function tr({ classes: a, data: o, dataSource: s, cacheTime: ee = 0, searchDebou
|
|
|
2210
2220
|
variant: "text",
|
|
2211
2221
|
size: "sm",
|
|
2212
2222
|
disabled: !Q.length,
|
|
2213
|
-
onClick: () =>
|
|
2223
|
+
onClick: () => nu(Jl - 1)
|
|
2214
2224
|
}),
|
|
2215
2225
|
/* @__PURE__ */ b(d, {
|
|
2216
2226
|
icon: kt,
|
|
@@ -2218,14 +2228,14 @@ function tr({ classes: a, data: o, dataSource: s, cacheTime: ee = 0, searchDebou
|
|
|
2218
2228
|
variant: "text",
|
|
2219
2229
|
size: "sm",
|
|
2220
2230
|
disabled: !Q.length,
|
|
2221
|
-
onClick: () =>
|
|
2231
|
+
onClick: () => nu(Jl + 1)
|
|
2222
2232
|
}),
|
|
2223
2233
|
/* @__PURE__ */ b(d, {
|
|
2224
2234
|
icon: Zt,
|
|
2225
2235
|
label: O.findClose,
|
|
2226
2236
|
variant: "text",
|
|
2227
2237
|
size: "sm",
|
|
2228
|
-
onClick:
|
|
2238
|
+
onClick: ru
|
|
2229
2239
|
})
|
|
2230
2240
|
]
|
|
2231
2241
|
}),
|
|
@@ -2234,35 +2244,35 @@ function tr({ classes: a, data: o, dataSource: s, cacheTime: ee = 0, searchDebou
|
|
|
2234
2244
|
children: [
|
|
2235
2245
|
/* @__PURE__ */ b("span", {
|
|
2236
2246
|
className: V.batchCount(),
|
|
2237
|
-
children: O.changes(
|
|
2247
|
+
children: O.changes(Lc)
|
|
2238
2248
|
}),
|
|
2239
2249
|
/* @__PURE__ */ b(u, {
|
|
2240
2250
|
variant: "text",
|
|
2241
2251
|
size: "sm",
|
|
2242
2252
|
leadingIcon: Xt,
|
|
2243
|
-
disabled: !
|
|
2244
|
-
onClick:
|
|
2253
|
+
disabled: !jc.canUndo,
|
|
2254
|
+
onClick: Fc,
|
|
2245
2255
|
children: O.undo
|
|
2246
2256
|
}),
|
|
2247
2257
|
/* @__PURE__ */ b(u, {
|
|
2248
2258
|
variant: "text",
|
|
2249
2259
|
size: "sm",
|
|
2250
2260
|
leadingIcon: Gt,
|
|
2251
|
-
disabled: !
|
|
2252
|
-
onClick:
|
|
2261
|
+
disabled: !jc.canRedo,
|
|
2262
|
+
onClick: Ic,
|
|
2253
2263
|
children: O.redo
|
|
2254
2264
|
}),
|
|
2255
2265
|
/* @__PURE__ */ b(u, {
|
|
2256
2266
|
variant: "outline",
|
|
2257
2267
|
size: "sm",
|
|
2258
|
-
disabled: !
|
|
2259
|
-
onClick:
|
|
2268
|
+
disabled: !Lc,
|
|
2269
|
+
onClick: Bc,
|
|
2260
2270
|
children: O.discardChanges
|
|
2261
2271
|
}),
|
|
2262
2272
|
/* @__PURE__ */ b(u, {
|
|
2263
2273
|
size: "sm",
|
|
2264
|
-
disabled: !
|
|
2265
|
-
onClick:
|
|
2274
|
+
disabled: !Lc,
|
|
2275
|
+
onClick: zc,
|
|
2266
2276
|
children: O.saveChanges
|
|
2267
2277
|
})
|
|
2268
2278
|
]
|
|
@@ -2270,54 +2280,54 @@ function tr({ classes: a, data: o, dataSource: s, cacheTime: ee = 0, searchDebou
|
|
|
2270
2280
|
/* @__PURE__ */ b("p", {
|
|
2271
2281
|
role: "status",
|
|
2272
2282
|
className: V.status(),
|
|
2273
|
-
children:
|
|
2283
|
+
children: Ko || (s ? aa ? "" : ge(Vi, E, D) : hs ? O.results(L.getFilteredRowModel().rows.length) : "")
|
|
2274
2284
|
}),
|
|
2275
|
-
|
|
2285
|
+
Eo && Wt === "top" && yd,
|
|
2276
2286
|
/* @__PURE__ */ b("div", {
|
|
2277
|
-
ref:
|
|
2287
|
+
ref: Ou,
|
|
2278
2288
|
className: V.scroll(),
|
|
2279
2289
|
style: hi ? { maxHeight: hi } : void 0,
|
|
2280
|
-
onScroll:
|
|
2290
|
+
onScroll: Iu,
|
|
2281
2291
|
children: /* @__PURE__ */ x("table", {
|
|
2282
2292
|
ref: $,
|
|
2283
|
-
className: V.table({ class:
|
|
2284
|
-
style:
|
|
2285
|
-
"aria-busy":
|
|
2286
|
-
"aria-rowcount": B ? Y.length +
|
|
2287
|
-
role: z ?
|
|
2288
|
-
"aria-multiselectable": z && (pn &&
|
|
2293
|
+
className: V.table({ class: Mo ? V.fixedLayout() : void 0 }),
|
|
2294
|
+
style: Mo ? { minWidth: L.getTotalSize() + Fo + Io } : void 0,
|
|
2295
|
+
"aria-busy": oa || void 0,
|
|
2296
|
+
"aria-rowcount": B ? Y.length + Vo.length : void 0,
|
|
2297
|
+
role: z ? To ? "treegrid" : "grid" : void 0,
|
|
2298
|
+
"aria-multiselectable": z && (pn && Ts || w) ? "true" : void 0,
|
|
2289
2299
|
tabIndex: (w || T === "batch") && !z ? -1 : void 0,
|
|
2290
|
-
onKeyDown:
|
|
2291
|
-
onFocus:
|
|
2300
|
+
onKeyDown: Uu,
|
|
2301
|
+
onFocus: Hu,
|
|
2292
2302
|
children: [
|
|
2293
2303
|
/* @__PURE__ */ b("caption", {
|
|
2294
2304
|
className: V.caption(),
|
|
2295
2305
|
children: we
|
|
2296
2306
|
}),
|
|
2297
2307
|
/* @__PURE__ */ x("thead", {
|
|
2298
|
-
ref:
|
|
2308
|
+
ref: Lu,
|
|
2299
2309
|
className: V.head(),
|
|
2300
|
-
children: [
|
|
2310
|
+
children: [Vo.map((e, t) => /* @__PURE__ */ x("tr", {
|
|
2301
2311
|
className: V.headRow(),
|
|
2302
2312
|
children: [
|
|
2303
2313
|
t === 0 && H.map((e) => /* @__PURE__ */ b("th", {
|
|
2304
2314
|
scope: "col",
|
|
2305
|
-
rowSpan:
|
|
2315
|
+
rowSpan: Vo.length,
|
|
2306
2316
|
className: V.th({ class: G(e, !0) }),
|
|
2307
2317
|
style: K(e),
|
|
2308
|
-
children: e === "select" &&
|
|
2309
|
-
checked:
|
|
2318
|
+
children: e === "select" && Ts ? /* @__PURE__ */ b(f, {
|
|
2319
|
+
checked: ks,
|
|
2310
2320
|
"aria-label": An ?? (xn === "all" ? O.selectAllRows : O.selectAll),
|
|
2311
|
-
onCheckedChange: (e) =>
|
|
2321
|
+
onCheckedChange: (e) => As(e === !0)
|
|
2312
2322
|
}) : e === "select" ? /* @__PURE__ */ b("span", {
|
|
2313
2323
|
className: V.srOnly(),
|
|
2314
2324
|
children: O.select
|
|
2315
2325
|
}) : e === "expand" ? /* @__PURE__ */ b("button", {
|
|
2316
2326
|
type: "button",
|
|
2317
2327
|
className: V.expander(),
|
|
2318
|
-
"aria-label":
|
|
2319
|
-
onClick: () => L.toggleAllRowsExpanded(!
|
|
2320
|
-
children: b(
|
|
2328
|
+
"aria-label": Ws ? O.collapseAll : O.expandAll,
|
|
2329
|
+
onClick: () => L.toggleAllRowsExpanded(!Ws),
|
|
2330
|
+
children: b(Ws ? Mt : Nt, {
|
|
2321
2331
|
className: V.expanderIcon(),
|
|
2322
2332
|
"aria-hidden": "true"
|
|
2323
2333
|
})
|
|
@@ -2335,36 +2345,36 @@ function tr({ classes: a, data: o, dataSource: s, cacheTime: ee = 0, searchDebou
|
|
|
2335
2345
|
className: V.th({ class: V.groupTh() }),
|
|
2336
2346
|
children: q(t)
|
|
2337
2347
|
}, e.header.id);
|
|
2338
|
-
let r = t.getIsSorted(), i =
|
|
2348
|
+
let r = t.getIsSorted(), i = Go(t.id);
|
|
2339
2349
|
return /* @__PURE__ */ x("th", {
|
|
2340
|
-
id:
|
|
2350
|
+
id: ou ? su(t.id) : void 0,
|
|
2341
2351
|
scope: "col",
|
|
2342
2352
|
rowSpan: e.rowSpan > 1 ? e.rowSpan : void 0,
|
|
2343
|
-
className:
|
|
2344
|
-
|
|
2353
|
+
className: Do(t.id).th({ class: [
|
|
2354
|
+
Lo(t.id, !0),
|
|
2345
2355
|
jr ? V.dropTargetColumn() : "",
|
|
2346
2356
|
j.get(t.id)?.headerClass
|
|
2347
2357
|
] }),
|
|
2348
|
-
style:
|
|
2349
|
-
"aria-sort":
|
|
2350
|
-
draggable:
|
|
2351
|
-
"data-drop":
|
|
2352
|
-
"data-dragging":
|
|
2353
|
-
onDragStart: (e) =>
|
|
2354
|
-
onDragOver: (e) =>
|
|
2355
|
-
onDragLeave: () =>
|
|
2356
|
-
onDrop:
|
|
2357
|
-
onDragEnd:
|
|
2358
|
+
style: Ro(t.id, !0),
|
|
2359
|
+
"aria-sort": Wo(t.id),
|
|
2360
|
+
draggable: Zo(t.id) && !t.getIsPinned() ? "true" : void 0,
|
|
2361
|
+
"data-drop": ls(t.id),
|
|
2362
|
+
"data-dragging": ts === t.id || void 0,
|
|
2363
|
+
onDragStart: (e) => as(t.id, e),
|
|
2364
|
+
onDragOver: (e) => os(t.id, e),
|
|
2365
|
+
onDragLeave: () => is(null),
|
|
2366
|
+
onDrop: cs,
|
|
2367
|
+
onDragEnd: ss,
|
|
2358
2368
|
children: [/* @__PURE__ */ x("div", {
|
|
2359
|
-
className:
|
|
2369
|
+
className: Do(t.id).headContent(),
|
|
2360
2370
|
children: [
|
|
2361
|
-
|
|
2371
|
+
Uo(t.id) ? /* @__PURE__ */ x("button", {
|
|
2362
2372
|
type: "button",
|
|
2363
2373
|
className: V.sortButton(),
|
|
2364
|
-
onClick: (e) =>
|
|
2374
|
+
onClick: (e) => fo(Xe(N, t.id, un === "multiple" && e.shiftKey)),
|
|
2365
2375
|
children: [
|
|
2366
2376
|
/* @__PURE__ */ b("span", {
|
|
2367
|
-
className:
|
|
2377
|
+
className: Ho(t),
|
|
2368
2378
|
children: q(t)
|
|
2369
2379
|
}),
|
|
2370
2380
|
b(r === "asc" ? Et : r === "desc" ? Tt : Dt, {
|
|
@@ -2381,15 +2391,15 @@ function tr({ classes: a, data: o, dataSource: s, cacheTime: ee = 0, searchDebou
|
|
|
2381
2391
|
})] })
|
|
2382
2392
|
]
|
|
2383
2393
|
}) : /* @__PURE__ */ b("span", {
|
|
2384
|
-
className:
|
|
2394
|
+
className: Ho(t),
|
|
2385
2395
|
children: q(t)
|
|
2386
2396
|
}),
|
|
2387
|
-
|
|
2397
|
+
ms && n && fs(n) && /* @__PURE__ */ b(Fn, {
|
|
2388
2398
|
header: q(t),
|
|
2389
2399
|
type: n.filter ?? "text",
|
|
2390
|
-
value:
|
|
2391
|
-
onChange: (e) =>
|
|
2392
|
-
options:
|
|
2400
|
+
value: gs(t.id),
|
|
2401
|
+
onChange: (e) => ys(t.id, e),
|
|
2402
|
+
options: _s(n),
|
|
2393
2403
|
inputProps: n.filterInputProps,
|
|
2394
2404
|
renderOption: n.renderOption,
|
|
2395
2405
|
matchModes: n.matchModes,
|
|
@@ -2399,9 +2409,9 @@ function tr({ classes: a, data: o, dataSource: s, cacheTime: ee = 0, searchDebou
|
|
|
2399
2409
|
column: n
|
|
2400
2410
|
}) : void 0
|
|
2401
2411
|
}),
|
|
2402
|
-
|
|
2403
|
-
items:
|
|
2404
|
-
onSelect: (e) =>
|
|
2412
|
+
Xo && /* @__PURE__ */ b(l, {
|
|
2413
|
+
items: Qo(t),
|
|
2414
|
+
onSelect: (e) => es(t, e),
|
|
2405
2415
|
children: /* @__PURE__ */ b("button", {
|
|
2406
2416
|
type: "button",
|
|
2407
2417
|
className: V.headButton(),
|
|
@@ -2426,14 +2436,14 @@ function tr({ classes: a, data: o, dataSource: s, cacheTime: ee = 0, searchDebou
|
|
|
2426
2436
|
"data-resizing": t.getIsResizing() || void 0,
|
|
2427
2437
|
onMouseDown: e.header.getResizeHandler(),
|
|
2428
2438
|
onTouchStart: e.header.getResizeHandler(),
|
|
2429
|
-
onKeyDown: (e) =>
|
|
2430
|
-
onDoubleClick: (e) =>
|
|
2439
|
+
onKeyDown: (e) => ds(t.id, e),
|
|
2440
|
+
onDoubleClick: (e) => us(t.id, e)
|
|
2431
2441
|
})]
|
|
2432
2442
|
}, e.header.id);
|
|
2433
2443
|
}),
|
|
2434
2444
|
t === 0 && U.length > 0 && /* @__PURE__ */ b("th", {
|
|
2435
2445
|
scope: "col",
|
|
2436
|
-
rowSpan:
|
|
2446
|
+
rowSpan: Vo.length,
|
|
2437
2447
|
className: V.th({ class: G("actions", !0) }),
|
|
2438
2448
|
style: K("actions"),
|
|
2439
2449
|
children: /* @__PURE__ */ b("span", {
|
|
@@ -2442,7 +2452,7 @@ function tr({ classes: a, data: o, dataSource: s, cacheTime: ee = 0, searchDebou
|
|
|
2442
2452
|
})
|
|
2443
2453
|
})
|
|
2444
2454
|
]
|
|
2445
|
-
}, t)),
|
|
2455
|
+
}, t)), ps && /* @__PURE__ */ x("tr", {
|
|
2446
2456
|
className: V.filterRow(),
|
|
2447
2457
|
children: [
|
|
2448
2458
|
H.map((e) => /* @__PURE__ */ b("td", {
|
|
@@ -2452,31 +2462,31 @@ function tr({ classes: a, data: o, dataSource: s, cacheTime: ee = 0, searchDebou
|
|
|
2452
2462
|
W.map((e) => {
|
|
2453
2463
|
let t = j.get(e.id);
|
|
2454
2464
|
return /* @__PURE__ */ b("td", {
|
|
2455
|
-
className:
|
|
2456
|
-
style:
|
|
2457
|
-
children: t &&
|
|
2458
|
-
value:
|
|
2459
|
-
setValue: (e) =>
|
|
2465
|
+
className: Do(e.id).filterCell({ class: Lo(e.id, !0) }),
|
|
2466
|
+
style: Ro(e.id, !0),
|
|
2467
|
+
children: t && fs(t) ? t.renderFilter ? t.renderFilter({
|
|
2468
|
+
value: vs(t),
|
|
2469
|
+
setValue: (e) => Ss(t, e),
|
|
2460
2470
|
column: t
|
|
2461
|
-
}) : Ie(
|
|
2471
|
+
}) : Ie(bs(t)) ? /* @__PURE__ */ b("div", {
|
|
2462
2472
|
className: V.filterRowRange(),
|
|
2463
2473
|
children: [0, 1].map((n) => /* @__PURE__ */ b(Pn, {
|
|
2464
|
-
type:
|
|
2474
|
+
type: xs(t),
|
|
2465
2475
|
label: `${O.filter(q(e))}, ${n ? O.to : O.from}`,
|
|
2466
|
-
options:
|
|
2476
|
+
options: _s(t),
|
|
2467
2477
|
inputProps: t.filterInputProps,
|
|
2468
|
-
value:
|
|
2469
|
-
onChange: (e) =>
|
|
2478
|
+
value: Cs(t, n),
|
|
2479
|
+
onChange: (e) => ws(t, n, e)
|
|
2470
2480
|
}, n))
|
|
2471
2481
|
}) : /* @__PURE__ */ b(Pn, {
|
|
2472
|
-
type:
|
|
2482
|
+
type: xs(t),
|
|
2473
2483
|
label: O.filter(q(e)),
|
|
2474
|
-
options:
|
|
2484
|
+
options: _s(t),
|
|
2475
2485
|
inputProps: t.filterInputProps,
|
|
2476
2486
|
renderOption: t.renderOption,
|
|
2477
2487
|
any: !0,
|
|
2478
|
-
value:
|
|
2479
|
-
onChange: (e) =>
|
|
2488
|
+
value: vs(t),
|
|
2489
|
+
onChange: (e) => Ss(t, e)
|
|
2480
2490
|
}) : null
|
|
2481
2491
|
}, e.id);
|
|
2482
2492
|
}),
|
|
@@ -2487,13 +2497,13 @@ function tr({ classes: a, data: o, dataSource: s, cacheTime: ee = 0, searchDebou
|
|
|
2487
2497
|
]
|
|
2488
2498
|
})]
|
|
2489
2499
|
}),
|
|
2490
|
-
|
|
2500
|
+
Bs.length > 0 && /* @__PURE__ */ b("tbody", {
|
|
2491
2501
|
className: V.frozenBody(),
|
|
2492
|
-
style: hi ? { top:
|
|
2493
|
-
children:
|
|
2502
|
+
style: hi ? { top: Ru } : void 0,
|
|
2503
|
+
children: Bs.map((e) => /* @__PURE__ */ x("tr", {
|
|
2494
2504
|
className: V.row({ class: Jr?.(e.original) }),
|
|
2495
|
-
"data-state":
|
|
2496
|
-
"aria-selected": z && pn ?
|
|
2505
|
+
"data-state": Ds(e) ? "selected" : void 0,
|
|
2506
|
+
"aria-selected": z && pn ? Ds(e) : void 0,
|
|
2497
2507
|
"data-row-id": e.id,
|
|
2498
2508
|
children: [
|
|
2499
2509
|
H.map((e) => /* @__PURE__ */ b("td", {
|
|
@@ -2503,9 +2513,9 @@ function tr({ classes: a, data: o, dataSource: s, cacheTime: ee = 0, searchDebou
|
|
|
2503
2513
|
e.getVisibleCells().map((t) => {
|
|
2504
2514
|
let n = j.get(t.column.id);
|
|
2505
2515
|
return /* @__PURE__ */ b("td", {
|
|
2506
|
-
className:
|
|
2507
|
-
style:
|
|
2508
|
-
children: n?.editable && (
|
|
2516
|
+
className: Do(t.column.id).td({ class: [Lo(t.column.id, !1), Oo(t.column.id, e)] }),
|
|
2517
|
+
style: Ro(t.column.id, !1),
|
|
2518
|
+
children: n?.editable && (Ao || Uc === e.id) ? Sd(e, t.column, kc(e, t.column.id)) : n?.copyable ? /* @__PURE__ */ x("span", {
|
|
2509
2519
|
className: V.copyCell(),
|
|
2510
2520
|
children: [n.cell ? n.cell(e.original, t.getValue()) : M(n, t.getValue(), e.original), /* @__PURE__ */ b(ie, {
|
|
2511
2521
|
value: M(n, t.getValue(), e.original),
|
|
@@ -2517,21 +2527,21 @@ function tr({ classes: a, data: o, dataSource: s, cacheTime: ee = 0, searchDebou
|
|
|
2517
2527
|
U.length > 0 && /* @__PURE__ */ b("td", {
|
|
2518
2528
|
className: V.td({ class: G("actions", !1) }),
|
|
2519
2529
|
style: K("actions"),
|
|
2520
|
-
children: T === "row" &&
|
|
2530
|
+
children: T === "row" && ko && /* @__PURE__ */ b("div", {
|
|
2521
2531
|
className: V.editActions(),
|
|
2522
|
-
children:
|
|
2532
|
+
children: xd(e, zi(e.original, e.index))
|
|
2523
2533
|
})
|
|
2524
2534
|
})
|
|
2525
2535
|
]
|
|
2526
2536
|
}, e.id))
|
|
2527
2537
|
}),
|
|
2528
2538
|
qr && Gr ? /* @__PURE__ */ b(c, {
|
|
2529
|
-
items:
|
|
2530
|
-
label:
|
|
2531
|
-
onSelect: (e) =>
|
|
2532
|
-
children:
|
|
2533
|
-
}) :
|
|
2534
|
-
|
|
2539
|
+
items: $s ? Qs($s) : [],
|
|
2540
|
+
label: $s ? O.rowActions(zi($s.original, $s.index)) : void 0,
|
|
2541
|
+
onSelect: (e) => nc($s, e),
|
|
2542
|
+
children: Cd
|
|
2543
|
+
}) : Cd,
|
|
2544
|
+
qs && /* @__PURE__ */ b("tfoot", {
|
|
2535
2545
|
className: V.foot(),
|
|
2536
2546
|
children: /* @__PURE__ */ x("tr", { children: [
|
|
2537
2547
|
H.map((e) => /* @__PURE__ */ b("td", {
|
|
@@ -2539,9 +2549,9 @@ function tr({ classes: a, data: o, dataSource: s, cacheTime: ee = 0, searchDebou
|
|
|
2539
2549
|
style: K(e)
|
|
2540
2550
|
}, e)),
|
|
2541
2551
|
W.map((e) => /* @__PURE__ */ b("td", {
|
|
2542
|
-
className:
|
|
2543
|
-
style:
|
|
2544
|
-
children:
|
|
2552
|
+
className: Do(e.id).footCell({ class: [Lo(e.id, !1), Oo(e.id)] }),
|
|
2553
|
+
style: Ro(e.id, !1),
|
|
2554
|
+
children: Zs(j.get(e.id))
|
|
2545
2555
|
}, e.id)),
|
|
2546
2556
|
U.length > 0 && /* @__PURE__ */ b("td", {
|
|
2547
2557
|
className: V.footCell({ class: G("actions", !1) }),
|
|
@@ -2555,18 +2565,18 @@ function tr({ classes: a, data: o, dataSource: s, cacheTime: ee = 0, searchDebou
|
|
|
2555
2565
|
Qr && /* @__PURE__ */ x("div", {
|
|
2556
2566
|
className: V.statusBar(),
|
|
2557
2567
|
children: [
|
|
2558
|
-
/* @__PURE__ */ b("span", { children: O.rowCount(
|
|
2559
|
-
|
|
2560
|
-
pn && /* @__PURE__ */ b("span", { children: E.common.selectedCount(
|
|
2561
|
-
|
|
2568
|
+
/* @__PURE__ */ b("span", { children: O.rowCount(ld) }),
|
|
2569
|
+
hs && /* @__PURE__ */ b("span", { children: O.filteredCount(L.getFilteredRowModel().rows.length) }),
|
|
2570
|
+
pn && /* @__PURE__ */ b("span", { children: E.common.selectedCount(Os) }),
|
|
2571
|
+
cd.map((e) => /* @__PURE__ */ b("span", { children: e.text }, e.id))
|
|
2562
2572
|
]
|
|
2563
2573
|
}),
|
|
2564
|
-
|
|
2574
|
+
Eo && Wt === "bottom" && yd
|
|
2565
2575
|
]
|
|
2566
2576
|
});
|
|
2567
2577
|
return /* @__PURE__ */ b(Nn.Provider, {
|
|
2568
|
-
value:
|
|
2569
|
-
children: R ? cn(
|
|
2578
|
+
value: Ri,
|
|
2579
|
+
children: R ? cn(wd, document.body) : /* @__PURE__ */ b(Qt, { children: wd })
|
|
2570
2580
|
});
|
|
2571
2581
|
}
|
|
2572
2582
|
//#endregion
|