@wirecore/wirelayer-react 0.9.2 → 0.11.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/data-table/DataTable.d.ts +13 -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 +776 -764
- package/dist/index.js +61 -49
- package/llms-full.txt +64 -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",
|
|
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
|
-
va,
|
|
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), [
|
|
376
375
|
ba,
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
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
|
+
no,
|
|
384
385
|
eo,
|
|
385
|
-
Qa,
|
|
386
386
|
A
|
|
387
|
-
]), [
|
|
388
|
-
|
|
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
|
-
},
|
|
409
|
-
|
|
410
|
-
},
|
|
411
|
-
|
|
412
|
-
},
|
|
413
|
-
|
|
414
|
-
},
|
|
415
|
-
|
|
416
|
-
},
|
|
407
|
+
vn?.(t.flatMap((e) => mo.current.has(e) ? [mo.current.get(e)] : []));
|
|
408
|
+
}, go = (e) => {
|
|
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,53 +516,53 @@ 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:
|
|
522
|
-
gridlines:
|
|
523
|
-
bordered:
|
|
519
|
+
rowCount: k ? ia : void 0
|
|
520
|
+
}), [R, Co] = y(!1), wo = {
|
|
521
|
+
size: oo,
|
|
522
|
+
gridlines: di,
|
|
523
|
+
bordered: fi,
|
|
524
524
|
paginatorAlign: $e($t),
|
|
525
|
-
striped:
|
|
526
|
-
scrollable: !!
|
|
525
|
+
striped: pi,
|
|
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,74 +863,74 @@ 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 =
|
|
924
|
-
e &&
|
|
932
|
+
let e = rc(t.rowId);
|
|
933
|
+
e && oi?.({
|
|
925
934
|
row: e.original,
|
|
926
935
|
rowId: e.id,
|
|
927
936
|
columnId: t.columnId,
|
|
@@ -929,10 +938,10 @@ 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,
|
|
935
|
-
|
|
943
|
+
let n = A.filter((e) => e.editable).map((t) => [t.id, kc(e, t.id)]);
|
|
944
|
+
si?.({
|
|
936
945
|
row: e.original,
|
|
937
946
|
rowId: t,
|
|
938
947
|
values: {
|
|
@@ -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,136 +985,136 @@ 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
|
-
},
|
|
1025
|
-
n.defaultPrevented || (n.key === "Escape" ? (n.preventDefault(),
|
|
1026
|
-
},
|
|
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))}"]`);
|
|
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) => {
|
|
1027
1036
|
let r = n.relatedTarget, i = n.currentTarget;
|
|
1028
|
-
r && (i.contains(r) || !
|
|
1029
|
-
},
|
|
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) => {
|
|
1054
|
-
t ? (
|
|
1063
|
+
t ? (si?.({
|
|
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,108 +1366,109 @@ 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: () =>
|
|
1425
|
-
estimateSize: () =>
|
|
1433
|
+
getScrollElement: () => Ou.current,
|
|
1434
|
+
estimateSize: () => vi,
|
|
1426
1435
|
overscan: 8,
|
|
1427
1436
|
getItemKey: (e) => Y[e]?.key ?? e,
|
|
1428
1437
|
initialRect: {
|
|
1429
1438
|
width: 0,
|
|
1430
|
-
height: Number.parseInt(
|
|
1439
|
+
height: Number.parseInt(hi ?? "", 10) || 400
|
|
1431
1440
|
}
|
|
1432
1441
|
});
|
|
1433
1442
|
g(() => {
|
|
1434
|
-
|
|
1435
|
-
}, [
|
|
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(() =>
|
|
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
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1540
|
+
Si,
|
|
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,86 +1629,88 @@ 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
|
-
onClick: () =>
|
|
1711
|
+
onClick: (n) => {
|
|
1712
|
+
(ai !== "dblclick" || n.detail !== 1) && ol(e, t.id);
|
|
1713
|
+
},
|
|
1702
1714
|
children: o ?? i
|
|
1703
1715
|
});
|
|
1704
1716
|
if (r?.copyable) return /* @__PURE__ */ x("span", {
|
|
@@ -1708,23 +1720,23 @@ function tr({ classes: a, data: o, dataSource: s, cacheTime: ee = 0, searchDebou
|
|
|
1708
1720
|
label: O.copy(q(t), i)
|
|
1709
1721
|
})]
|
|
1710
1722
|
});
|
|
1711
|
-
let s =
|
|
1723
|
+
let s = Xl ? Kl.trim() : id, c = o === void 0 ? s ? /* @__PURE__ */ b(p, {
|
|
1712
1724
|
text: i,
|
|
1713
1725
|
query: s
|
|
1714
|
-
}) : i : o, ee =
|
|
1726
|
+
}) : i : o, ee = dd(e, t.id);
|
|
1715
1727
|
return ee ? /* @__PURE__ */ b("a", {
|
|
1716
1728
|
href: ee,
|
|
1717
1729
|
className: V.rowLink(),
|
|
1718
1730
|
"data-row-link": "",
|
|
1719
1731
|
children: c
|
|
1720
1732
|
}) : c;
|
|
1721
|
-
},
|
|
1722
|
-
onContextMenuCapture:
|
|
1733
|
+
}, Cd = /* @__PURE__ */ x("tbody", {
|
|
1734
|
+
onContextMenuCapture: tc,
|
|
1723
1735
|
children: [
|
|
1724
|
-
Y.length === 0 && !
|
|
1725
|
-
colSpan:
|
|
1736
|
+
Y.length === 0 && !ad && /* @__PURE__ */ b("tr", { children: /* @__PURE__ */ b("td", {
|
|
1737
|
+
colSpan: jo,
|
|
1726
1738
|
className: V.message(),
|
|
1727
|
-
children:
|
|
1739
|
+
children: aa ? /* @__PURE__ */ x("span", {
|
|
1728
1740
|
className: V.errorContent(),
|
|
1729
1741
|
children: [/* @__PURE__ */ b("span", {
|
|
1730
1742
|
role: "alert",
|
|
@@ -1732,18 +1744,18 @@ function tr({ classes: a, data: o, dataSource: s, cacheTime: ee = 0, searchDebou
|
|
|
1732
1744
|
}), /* @__PURE__ */ b(u, {
|
|
1733
1745
|
variant: "outline",
|
|
1734
1746
|
size: "sm",
|
|
1735
|
-
onClick: () => void
|
|
1747
|
+
onClick: () => void Tu(),
|
|
1736
1748
|
children: E.dataSource.retry
|
|
1737
1749
|
})]
|
|
1738
|
-
}) :
|
|
1750
|
+
}) : oa ? Ai ?? /* @__PURE__ */ x("span", {
|
|
1739
1751
|
className: V.messageContent(),
|
|
1740
1752
|
children: [/* @__PURE__ */ b(ne, {
|
|
1741
1753
|
size: "sm",
|
|
1742
1754
|
label: kn ?? E.common.loading
|
|
1743
1755
|
}), kn ?? E.common.loading]
|
|
1744
|
-
}) :
|
|
1756
|
+
}) : sd ? ki ?? On ?? Dn ?? E.common.empty : Oi ?? Dn ?? E.common.empty
|
|
1745
1757
|
}) }),
|
|
1746
|
-
|
|
1758
|
+
ad && Array.from({ length: od }, (e, t) => /* @__PURE__ */ x("tr", {
|
|
1747
1759
|
className: V.row(),
|
|
1748
1760
|
children: [
|
|
1749
1761
|
H.map((e) => /* @__PURE__ */ b("td", {
|
|
@@ -1751,8 +1763,8 @@ function tr({ classes: a, data: o, dataSource: s, cacheTime: ee = 0, searchDebou
|
|
|
1751
1763
|
style: K(e)
|
|
1752
1764
|
}, e)),
|
|
1753
1765
|
W.map((e) => /* @__PURE__ */ b("td", {
|
|
1754
|
-
className:
|
|
1755
|
-
style:
|
|
1766
|
+
className: Do(e.id).td({ class: Lo(e.id, !1) }),
|
|
1767
|
+
style: Ro(e.id, !1),
|
|
1756
1768
|
children: /* @__PURE__ */ b(i, {})
|
|
1757
1769
|
}, e.id)),
|
|
1758
1770
|
U.length > 0 && /* @__PURE__ */ b("td", {
|
|
@@ -1761,30 +1773,30 @@ function tr({ classes: a, data: o, dataSource: s, cacheTime: ee = 0, searchDebou
|
|
|
1761
1773
|
})
|
|
1762
1774
|
]
|
|
1763
1775
|
}, `skeleton-${t + 1}`)),
|
|
1764
|
-
|
|
1776
|
+
Mu > 0 && !ad && /* @__PURE__ */ b("tr", {
|
|
1765
1777
|
className: V.spacer(),
|
|
1766
1778
|
"aria-hidden": "true",
|
|
1767
1779
|
children: /* @__PURE__ */ b("td", {
|
|
1768
|
-
colSpan:
|
|
1780
|
+
colSpan: jo,
|
|
1769
1781
|
className: V.spacerCell(),
|
|
1770
|
-
style: { height:
|
|
1782
|
+
style: { height: Mu }
|
|
1771
1783
|
})
|
|
1772
1784
|
}),
|
|
1773
|
-
(
|
|
1774
|
-
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;
|
|
1775
1787
|
if (e.kind === "group") {
|
|
1776
1788
|
let r = j.get(t.groupingColumnId), i = M(r, t.groupingValue, t.original), a = t.getLeafRows().length;
|
|
1777
1789
|
return /* @__PURE__ */ x("tr", {
|
|
1778
|
-
ref:
|
|
1790
|
+
ref: Pu,
|
|
1779
1791
|
className: V.groupRow({ class: X ? [V.dropTarget(), V.dropInside()] : void 0 }),
|
|
1780
1792
|
"data-index": e.index,
|
|
1781
1793
|
"aria-rowindex": n,
|
|
1782
|
-
"data-drop": X ?
|
|
1783
|
-
onDragOver: Hr ? (e) =>
|
|
1784
|
-
onDragLeave: Hr ? () =>
|
|
1785
|
-
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,
|
|
1786
1798
|
children: [/* @__PURE__ */ b("td", {
|
|
1787
|
-
colSpan:
|
|
1799
|
+
colSpan: Ks ? H.length + 1 : jo,
|
|
1788
1800
|
className: V.groupCell(),
|
|
1789
1801
|
children: /* @__PURE__ */ x("div", {
|
|
1790
1802
|
className: V.treeCell(),
|
|
@@ -1812,50 +1824,50 @@ function tr({ classes: a, data: o, dataSource: s, cacheTime: ee = 0, searchDebou
|
|
|
1812
1824
|
})
|
|
1813
1825
|
]
|
|
1814
1826
|
})
|
|
1815
|
-
}),
|
|
1816
|
-
className:
|
|
1817
|
-
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())
|
|
1818
1830
|
}, e.id)), U.length > 0 && /* @__PURE__ */ b("td", { className: V.groupAggregate() })] })]
|
|
1819
1831
|
}, e.key);
|
|
1820
1832
|
}
|
|
1821
1833
|
if (e.kind === "expansion") return /* @__PURE__ */ b("tr", {
|
|
1822
|
-
id:
|
|
1823
|
-
ref:
|
|
1834
|
+
id: Us(t),
|
|
1835
|
+
ref: Pu,
|
|
1824
1836
|
className: V.expansionRow(),
|
|
1825
1837
|
"data-index": e.index,
|
|
1826
1838
|
"aria-rowindex": n,
|
|
1827
1839
|
children: /* @__PURE__ */ b("td", {
|
|
1828
|
-
colSpan:
|
|
1840
|
+
colSpan: jo,
|
|
1829
1841
|
className: V.expansionCell(),
|
|
1830
1842
|
children: cr?.(t.original, t.id)
|
|
1831
1843
|
})
|
|
1832
1844
|
}, e.key);
|
|
1833
|
-
let r =
|
|
1845
|
+
let r = zi(t.original, t.index);
|
|
1834
1846
|
return /* @__PURE__ */ x("tr", {
|
|
1835
|
-
ref:
|
|
1847
|
+
ref: Pu,
|
|
1836
1848
|
className: V.row({ class: [
|
|
1837
1849
|
Hr ? V.dropTarget() : "",
|
|
1838
|
-
Hr &&
|
|
1850
|
+
Hr && uc && X ? V.dropInside() : "",
|
|
1839
1851
|
Yr?.(t.original) ? V.linkRow() : "",
|
|
1840
1852
|
Jr?.(t.original)
|
|
1841
1853
|
] }),
|
|
1842
|
-
"data-state":
|
|
1843
|
-
"aria-selected": z && pn ?
|
|
1854
|
+
"data-state": Ds(t) ? "selected" : void 0,
|
|
1855
|
+
"aria-selected": z && pn ? Ds(t) : void 0,
|
|
1844
1856
|
"data-row-id": t.id,
|
|
1845
1857
|
"data-index": e.index,
|
|
1846
1858
|
"aria-rowindex": n,
|
|
1847
|
-
"aria-level":
|
|
1848
|
-
"aria-expanded":
|
|
1849
|
-
draggable:
|
|
1850
|
-
"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),
|
|
1851
1863
|
"data-dragging": X === t.id || void 0,
|
|
1852
|
-
onClick: (e) =>
|
|
1853
|
-
onAuxClick: (e) =>
|
|
1854
|
-
onDragStart: (e) =>
|
|
1855
|
-
onDragOver: (e) =>
|
|
1856
|
-
onDragLeave: () =>
|
|
1857
|
-
onDrop:
|
|
1858
|
-
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,
|
|
1859
1871
|
children: [
|
|
1860
1872
|
H.map((e) => /* @__PURE__ */ b("td", {
|
|
1861
1873
|
className: V.td({ class: G(e, !1) }),
|
|
@@ -1865,36 +1877,36 @@ function tr({ classes: a, data: o, dataSource: s, cacheTime: ee = 0, searchDebou
|
|
|
1865
1877
|
className: V.dragHandle(),
|
|
1866
1878
|
"data-drag-handle": t.id,
|
|
1867
1879
|
"aria-label": O.moveRow(r),
|
|
1868
|
-
"aria-keyshortcuts":
|
|
1869
|
-
onKeyDown: (e) =>
|
|
1870
|
-
onPointerDown: () =>
|
|
1871
|
-
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),
|
|
1872
1884
|
children: /* @__PURE__ */ b(zt, {
|
|
1873
1885
|
className: V.dragIcon(),
|
|
1874
1886
|
"aria-hidden": "true"
|
|
1875
1887
|
})
|
|
1876
|
-
}) : e === "select" &&
|
|
1877
|
-
onClickCapture:
|
|
1878
|
-
onKeyDownCapture:
|
|
1888
|
+
}) : e === "select" && Ts ? /* @__PURE__ */ b("span", {
|
|
1889
|
+
onClickCapture: Fs,
|
|
1890
|
+
onKeyDownCapture: Fs,
|
|
1879
1891
|
children: /* @__PURE__ */ b(f, {
|
|
1880
|
-
checked:
|
|
1892
|
+
checked: Ds(t),
|
|
1881
1893
|
disabled: !t.getCanSelect(),
|
|
1882
1894
|
"aria-label": O.selectRow(r),
|
|
1883
|
-
onCheckedChange: (e) =>
|
|
1895
|
+
onCheckedChange: (e) => Ps(t, e === !0, Ns.current)
|
|
1884
1896
|
})
|
|
1885
1897
|
}) : e === "select" ? /* @__PURE__ */ b("input", {
|
|
1886
1898
|
type: "radio",
|
|
1887
|
-
name:
|
|
1899
|
+
name: js,
|
|
1888
1900
|
className: V.radio(),
|
|
1889
|
-
checked:
|
|
1901
|
+
checked: Ds(t),
|
|
1890
1902
|
disabled: !t.getCanSelect(),
|
|
1891
1903
|
"aria-label": O.selectRow(r),
|
|
1892
|
-
onChange: () =>
|
|
1904
|
+
onChange: () => Ps(t, !0)
|
|
1893
1905
|
}) : e === "expand" && t.getCanExpand() ? /* @__PURE__ */ b("button", {
|
|
1894
1906
|
type: "button",
|
|
1895
1907
|
className: V.expander(),
|
|
1896
1908
|
"aria-expanded": t.getIsExpanded(),
|
|
1897
|
-
"aria-controls": t.getIsExpanded() ?
|
|
1909
|
+
"aria-controls": t.getIsExpanded() ? Us(t) : void 0,
|
|
1898
1910
|
"aria-label": O.details(r),
|
|
1899
1911
|
onClick: () => t.toggleExpanded(),
|
|
1900
1912
|
children: /* @__PURE__ */ b(At, {
|
|
@@ -1904,31 +1916,31 @@ function tr({ classes: a, data: o, dataSource: s, cacheTime: ee = 0, searchDebou
|
|
|
1904
1916
|
})
|
|
1905
1917
|
}) : e === "expand" ? /* @__PURE__ */ b("span", { className: V.expanderSpacer() }) : /* @__PURE__ */ b("span", {
|
|
1906
1918
|
className: V.rowNumber(),
|
|
1907
|
-
children:
|
|
1919
|
+
children: Hs.get(t.id)
|
|
1908
1920
|
})
|
|
1909
1921
|
}, e)),
|
|
1910
1922
|
t.getVisibleCells().map((n, r) => {
|
|
1911
|
-
if (
|
|
1912
|
-
let t =
|
|
1923
|
+
if (ou) {
|
|
1924
|
+
let t = lu(e.index, r);
|
|
1913
1925
|
if (!t.rowSpan || !t.colSpan) return null;
|
|
1914
1926
|
}
|
|
1915
|
-
let i =
|
|
1927
|
+
let i = Sd(t, n.column, kc(t, n.column.id)), a = bd(t, n.column.id, e.index, r);
|
|
1916
1928
|
return /* @__PURE__ */ b("td", {
|
|
1917
|
-
className:
|
|
1918
|
-
|
|
1919
|
-
|
|
1929
|
+
className: Do(n.column.id).td({ class: [
|
|
1930
|
+
Lo(n.column.id, !1),
|
|
1931
|
+
Oo(n.column.id, t),
|
|
1920
1932
|
...a.className
|
|
1921
1933
|
] }),
|
|
1922
|
-
style:
|
|
1934
|
+
style: Ro(n.column.id, !1),
|
|
1923
1935
|
...a.attributes,
|
|
1924
|
-
children:
|
|
1936
|
+
children: Gs && r === 0 ? /* @__PURE__ */ x("div", {
|
|
1925
1937
|
className: V.treeCell(),
|
|
1926
1938
|
style: { paddingInlineStart: t.depth * 20 },
|
|
1927
1939
|
children: [tr && t.getCanExpand() ? /* @__PURE__ */ b("button", {
|
|
1928
1940
|
type: "button",
|
|
1929
1941
|
className: V.expander(),
|
|
1930
1942
|
"aria-expanded": t.getIsExpanded(),
|
|
1931
|
-
"aria-label":
|
|
1943
|
+
"aria-label": Bi(t.original, t.index),
|
|
1932
1944
|
onClick: t.getToggleExpandedHandler(),
|
|
1933
1945
|
children: /* @__PURE__ */ b(At, {
|
|
1934
1946
|
className: V.expanderIcon(),
|
|
@@ -1944,9 +1956,9 @@ function tr({ classes: a, data: o, dataSource: s, cacheTime: ee = 0, searchDebou
|
|
|
1944
1956
|
style: K("actions"),
|
|
1945
1957
|
children: /* @__PURE__ */ x("div", {
|
|
1946
1958
|
className: V.editActions(),
|
|
1947
|
-
children: [T === "row" &&
|
|
1948
|
-
items:
|
|
1949
|
-
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),
|
|
1950
1962
|
children: /* @__PURE__ */ b(d, {
|
|
1951
1963
|
icon: It,
|
|
1952
1964
|
label: O.rowActions(r),
|
|
@@ -1959,29 +1971,29 @@ function tr({ classes: a, data: o, dataSource: s, cacheTime: ee = 0, searchDebou
|
|
|
1959
1971
|
]
|
|
1960
1972
|
}, e.key);
|
|
1961
1973
|
}),
|
|
1962
|
-
|
|
1974
|
+
Nu > 0 && !ad && /* @__PURE__ */ b("tr", {
|
|
1963
1975
|
className: V.spacer(),
|
|
1964
1976
|
"aria-hidden": "true",
|
|
1965
1977
|
children: /* @__PURE__ */ b("td", {
|
|
1966
|
-
colSpan:
|
|
1978
|
+
colSpan: jo,
|
|
1967
1979
|
className: V.spacerCell(),
|
|
1968
|
-
style: { height:
|
|
1980
|
+
style: { height: Nu }
|
|
1969
1981
|
})
|
|
1970
1982
|
})
|
|
1971
1983
|
]
|
|
1972
|
-
}),
|
|
1973
|
-
...
|
|
1974
|
-
ref:
|
|
1975
|
-
className: V.base({ class:
|
|
1984
|
+
}), wd = /* @__PURE__ */ x("div", {
|
|
1985
|
+
...Ni,
|
|
1986
|
+
ref: Li,
|
|
1987
|
+
className: V.base({ class: Mi }),
|
|
1976
1988
|
role: R ? "dialog" : void 0,
|
|
1977
1989
|
"aria-modal": R || void 0,
|
|
1978
1990
|
"aria-label": R ? we : void 0,
|
|
1979
|
-
onKeyDown:
|
|
1991
|
+
onKeyDown: Du,
|
|
1980
1992
|
children: [
|
|
1981
|
-
|
|
1993
|
+
rd && /* @__PURE__ */ x("div", {
|
|
1982
1994
|
className: V.toolbar(),
|
|
1983
1995
|
children: [
|
|
1984
|
-
|
|
1996
|
+
Ei,
|
|
1985
1997
|
pr && /* @__PURE__ */ b(te, {
|
|
1986
1998
|
type: "search",
|
|
1987
1999
|
size: "sm",
|
|
@@ -1992,27 +2004,27 @@ function tr({ classes: a, data: o, dataSource: s, cacheTime: ee = 0, searchDebou
|
|
|
1992
2004
|
value: I,
|
|
1993
2005
|
onChange: (e) => L.setGlobalFilter(e.target.value)
|
|
1994
2006
|
}),
|
|
1995
|
-
|
|
2007
|
+
Ti,
|
|
1996
2008
|
/* @__PURE__ */ x("div", {
|
|
1997
2009
|
className: V.toolbarEnd(),
|
|
1998
2010
|
children: [
|
|
1999
|
-
|
|
2011
|
+
Di,
|
|
2000
2012
|
ni && /* @__PURE__ */ b(d, {
|
|
2001
2013
|
"data-find-toggle": "",
|
|
2002
2014
|
icon: Jt,
|
|
2003
2015
|
label: O.find,
|
|
2004
2016
|
variant: "outline",
|
|
2005
2017
|
size: "sm",
|
|
2006
|
-
"aria-expanded":
|
|
2007
|
-
onClick:
|
|
2018
|
+
"aria-expanded": Wl,
|
|
2019
|
+
onClick: ru
|
|
2008
2020
|
}),
|
|
2009
|
-
|
|
2021
|
+
ea && /* @__PURE__ */ b(u, {
|
|
2010
2022
|
variant: "outline",
|
|
2011
2023
|
size: "sm",
|
|
2012
2024
|
leadingIcon: Bt,
|
|
2013
|
-
"aria-expanded":
|
|
2014
|
-
"aria-controls": `${
|
|
2015
|
-
onClick: () =>
|
|
2025
|
+
"aria-expanded": Yi,
|
|
2026
|
+
"aria-controls": `${Ii}-advanced`,
|
|
2027
|
+
onClick: () => Xi(!Yi),
|
|
2016
2028
|
children: E.conditionBuilder.advanced
|
|
2017
2029
|
}),
|
|
2018
2030
|
Cr && /* @__PURE__ */ b(d, {
|
|
@@ -2020,18 +2032,18 @@ function tr({ classes: a, data: o, dataSource: s, cacheTime: ee = 0, searchDebou
|
|
|
2020
2032
|
label: O.filterToggle,
|
|
2021
2033
|
variant: "outline",
|
|
2022
2034
|
size: "sm",
|
|
2023
|
-
"aria-pressed":
|
|
2024
|
-
onClick:
|
|
2035
|
+
"aria-pressed": Ma,
|
|
2036
|
+
onClick: vo
|
|
2025
2037
|
}),
|
|
2026
2038
|
wr && /* @__PURE__ */ b(d, {
|
|
2027
2039
|
icon: Rt,
|
|
2028
2040
|
label: O.resetFilters,
|
|
2029
2041
|
variant: "outline",
|
|
2030
2042
|
size: "sm",
|
|
2031
|
-
disabled: !
|
|
2032
|
-
onClick:
|
|
2043
|
+
disabled: !hs,
|
|
2044
|
+
onClick: Cu
|
|
2033
2045
|
}),
|
|
2034
|
-
|
|
2046
|
+
ui && /* @__PURE__ */ x(S.Root, {
|
|
2035
2047
|
positioning: {
|
|
2036
2048
|
placement: "bottom-end",
|
|
2037
2049
|
gutter: 4
|
|
@@ -2047,22 +2059,22 @@ function tr({ classes: a, data: o, dataSource: s, cacheTime: ee = 0, searchDebou
|
|
|
2047
2059
|
size: "sm"
|
|
2048
2060
|
})
|
|
2049
2061
|
}), /* @__PURE__ */ b(on, { children: /* @__PURE__ */ b(S.Positioner, { children: /* @__PURE__ */ b(S.Content, {
|
|
2050
|
-
className:
|
|
2062
|
+
className: Fi.content(),
|
|
2051
2063
|
children: /* @__PURE__ */ b(S.RadioItemGroup, {
|
|
2052
|
-
value:
|
|
2053
|
-
onValueChange: (e) =>
|
|
2064
|
+
value: oo,
|
|
2065
|
+
onValueChange: (e) => bo(e.value),
|
|
2054
2066
|
children: [
|
|
2055
2067
|
"sm",
|
|
2056
2068
|
"md",
|
|
2057
2069
|
"lg"
|
|
2058
2070
|
].map((e) => /* @__PURE__ */ x(S.RadioItem, {
|
|
2059
2071
|
value: e,
|
|
2060
|
-
className:
|
|
2072
|
+
className: Fi.item(),
|
|
2061
2073
|
children: [/* @__PURE__ */ b(S.ItemIndicator, { children: /* @__PURE__ */ b(Ot, {
|
|
2062
2074
|
className: V.menuCheck(),
|
|
2063
2075
|
"aria-hidden": "true"
|
|
2064
2076
|
}) }), /* @__PURE__ */ b(S.ItemText, {
|
|
2065
|
-
className:
|
|
2077
|
+
className: Fi.label(),
|
|
2066
2078
|
children: O.densities[e]
|
|
2067
2079
|
})]
|
|
2068
2080
|
}, e))
|
|
@@ -2085,8 +2097,8 @@ function tr({ classes: a, data: o, dataSource: s, cacheTime: ee = 0, searchDebou
|
|
|
2085
2097
|
children: O.columns
|
|
2086
2098
|
})
|
|
2087
2099
|
}), /* @__PURE__ */ b(on, { children: /* @__PURE__ */ b(S.Positioner, { children: /* @__PURE__ */ b(S.Content, {
|
|
2088
|
-
className:
|
|
2089
|
-
children: (
|
|
2100
|
+
className: Fi.content(),
|
|
2101
|
+
children: (pd || [{
|
|
2090
2102
|
def: void 0,
|
|
2091
2103
|
leaves: L.getAllLeafColumns()
|
|
2092
2104
|
}]).map(({ def: e, leaves: t }, n) => {
|
|
@@ -2095,12 +2107,12 @@ function tr({ classes: a, data: o, dataSource: s, cacheTime: ee = 0, searchDebou
|
|
|
2095
2107
|
checked: e.getIsVisible(),
|
|
2096
2108
|
onCheckedChange: (t) => e.toggleVisibility(t),
|
|
2097
2109
|
closeOnSelect: !1,
|
|
2098
|
-
className:
|
|
2110
|
+
className: Fi.item({ class: t ? V.columnGroupItem() : void 0 }),
|
|
2099
2111
|
children: [/* @__PURE__ */ b(S.ItemIndicator, { children: /* @__PURE__ */ b(Ot, {
|
|
2100
2112
|
className: V.menuCheck(),
|
|
2101
2113
|
"aria-hidden": "true"
|
|
2102
2114
|
}) }), /* @__PURE__ */ b(S.ItemText, {
|
|
2103
|
-
className:
|
|
2115
|
+
className: Fi.label(),
|
|
2104
2116
|
children: q(e)
|
|
2105
2117
|
})]
|
|
2106
2118
|
}, e.id);
|
|
@@ -2110,28 +2122,28 @@ function tr({ classes: a, data: o, dataSource: s, cacheTime: ee = 0, searchDebou
|
|
|
2110
2122
|
checked: r.every((e) => e.getIsVisible()),
|
|
2111
2123
|
disabled: !r.length,
|
|
2112
2124
|
onCheckedChange: (e) => L.setColumnVisibility({
|
|
2113
|
-
...
|
|
2125
|
+
...Xa,
|
|
2114
2126
|
...Object.fromEntries(r.map((t) => [t.id, e]))
|
|
2115
2127
|
}),
|
|
2116
2128
|
closeOnSelect: !1,
|
|
2117
|
-
className:
|
|
2129
|
+
className: Fi.item(),
|
|
2118
2130
|
children: [/* @__PURE__ */ b(S.ItemIndicator, { children: /* @__PURE__ */ b(Ot, {
|
|
2119
2131
|
className: V.menuCheck(),
|
|
2120
2132
|
"aria-hidden": "true"
|
|
2121
2133
|
}) }), /* @__PURE__ */ b(S.ItemText, {
|
|
2122
|
-
className:
|
|
2134
|
+
className: Fi.label(),
|
|
2123
2135
|
children: e.header
|
|
2124
2136
|
})]
|
|
2125
2137
|
}),
|
|
2126
2138
|
r.map((e) => i(e, !0)),
|
|
2127
2139
|
jr && [-1, 1].map((t) => /* @__PURE__ */ b(S.Item, {
|
|
2128
2140
|
value: `group-${t < 0 ? "earlier" : "later"}:${e.id}`,
|
|
2129
|
-
disabled: t < 0 ? n === 0 : n ===
|
|
2141
|
+
disabled: t < 0 ? n === 0 : n === pd.length - 1,
|
|
2130
2142
|
closeOnSelect: !1,
|
|
2131
|
-
className:
|
|
2132
|
-
onSelect: () =>
|
|
2143
|
+
className: Fi.item({ class: V.columnGroupItem() }),
|
|
2144
|
+
onSelect: () => md(e.id, t),
|
|
2133
2145
|
children: /* @__PURE__ */ b(S.ItemText, {
|
|
2134
|
-
className:
|
|
2146
|
+
className: Fi.label(),
|
|
2135
2147
|
children: t < 0 ? O.columnGroupEarlier(e.header) : O.columnGroupLater(e.header)
|
|
2136
2148
|
})
|
|
2137
2149
|
}, t))
|
|
@@ -2139,48 +2151,48 @@ function tr({ classes: a, data: o, dataSource: s, cacheTime: ee = 0, searchDebou
|
|
|
2139
2151
|
})
|
|
2140
2152
|
}) }) })]
|
|
2141
2153
|
}),
|
|
2142
|
-
Ir && (
|
|
2143
|
-
items:
|
|
2154
|
+
Ir && (_d.length > 1 ? /* @__PURE__ */ b(l, {
|
|
2155
|
+
items: _d,
|
|
2144
2156
|
onSelect: (e) => {
|
|
2145
2157
|
let [t, n] = e.includes(":") ? e.split(":") : ["csv", e];
|
|
2146
|
-
|
|
2158
|
+
bu(t, n === "selection");
|
|
2147
2159
|
},
|
|
2148
2160
|
children: /* @__PURE__ */ b(u, {
|
|
2149
2161
|
variant: "outline",
|
|
2150
2162
|
size: "sm",
|
|
2151
2163
|
leadingIcon: Ft,
|
|
2152
|
-
children:
|
|
2164
|
+
children: vd
|
|
2153
2165
|
})
|
|
2154
2166
|
}) : /* @__PURE__ */ b(u, {
|
|
2155
2167
|
variant: "outline",
|
|
2156
2168
|
size: "sm",
|
|
2157
2169
|
leadingIcon: Ft,
|
|
2158
|
-
onClick: () =>
|
|
2159
|
-
children:
|
|
2170
|
+
onClick: () => bu(hd[0], !1),
|
|
2171
|
+
children: vd
|
|
2160
2172
|
})),
|
|
2161
|
-
|
|
2173
|
+
mi && /* @__PURE__ */ b(d, {
|
|
2162
2174
|
"data-fullscreen-toggle": "",
|
|
2163
2175
|
icon: R ? Ht : Vt,
|
|
2164
2176
|
label: R ? O.exitFullscreen : O.fullscreen,
|
|
2165
2177
|
variant: "outline",
|
|
2166
2178
|
size: "sm",
|
|
2167
|
-
onClick:
|
|
2179
|
+
onClick: Eu
|
|
2168
2180
|
})
|
|
2169
2181
|
]
|
|
2170
2182
|
})
|
|
2171
2183
|
]
|
|
2172
2184
|
}),
|
|
2173
|
-
|
|
2174
|
-
id: `${
|
|
2185
|
+
ea && Yi && /* @__PURE__ */ b("div", {
|
|
2186
|
+
id: `${Ii}-advanced`,
|
|
2175
2187
|
className: V.advancedFilter(),
|
|
2176
2188
|
children: fr({
|
|
2177
|
-
fields:
|
|
2178
|
-
value:
|
|
2179
|
-
onValueChange:
|
|
2189
|
+
fields: Zi,
|
|
2190
|
+
value: Ji,
|
|
2191
|
+
onValueChange: $i,
|
|
2180
2192
|
label: E.conditionBuilder.advanced
|
|
2181
2193
|
})
|
|
2182
2194
|
}),
|
|
2183
|
-
ni &&
|
|
2195
|
+
ni && Wl && /* @__PURE__ */ x("div", {
|
|
2184
2196
|
className: V.findBar(),
|
|
2185
2197
|
role: "search",
|
|
2186
2198
|
"aria-label": O.find,
|
|
@@ -2193,14 +2205,14 @@ function tr({ classes: a, data: o, dataSource: s, cacheTime: ee = 0, searchDebou
|
|
|
2193
2205
|
className: V.findInput(),
|
|
2194
2206
|
placeholder: O.searchPlaceholder,
|
|
2195
2207
|
"aria-label": O.find,
|
|
2196
|
-
value:
|
|
2197
|
-
onChange: (e) =>
|
|
2198
|
-
onKeyDown:
|
|
2208
|
+
value: Kl,
|
|
2209
|
+
onChange: (e) => au(e.target.value),
|
|
2210
|
+
onKeyDown: iu
|
|
2199
2211
|
}),
|
|
2200
2212
|
/* @__PURE__ */ b("span", {
|
|
2201
2213
|
className: V.findCount(),
|
|
2202
2214
|
"aria-live": "polite",
|
|
2203
|
-
children:
|
|
2215
|
+
children: Kl.trim() ? O.findMatches(Q.length ? Math.min(Jl, Q.length - 1) + 1 : 0, Q.length) : ""
|
|
2204
2216
|
}),
|
|
2205
2217
|
/* @__PURE__ */ b(d, {
|
|
2206
2218
|
icon: jt,
|
|
@@ -2208,7 +2220,7 @@ function tr({ classes: a, data: o, dataSource: s, cacheTime: ee = 0, searchDebou
|
|
|
2208
2220
|
variant: "text",
|
|
2209
2221
|
size: "sm",
|
|
2210
2222
|
disabled: !Q.length,
|
|
2211
|
-
onClick: () =>
|
|
2223
|
+
onClick: () => nu(Jl - 1)
|
|
2212
2224
|
}),
|
|
2213
2225
|
/* @__PURE__ */ b(d, {
|
|
2214
2226
|
icon: kt,
|
|
@@ -2216,14 +2228,14 @@ function tr({ classes: a, data: o, dataSource: s, cacheTime: ee = 0, searchDebou
|
|
|
2216
2228
|
variant: "text",
|
|
2217
2229
|
size: "sm",
|
|
2218
2230
|
disabled: !Q.length,
|
|
2219
|
-
onClick: () =>
|
|
2231
|
+
onClick: () => nu(Jl + 1)
|
|
2220
2232
|
}),
|
|
2221
2233
|
/* @__PURE__ */ b(d, {
|
|
2222
2234
|
icon: Zt,
|
|
2223
2235
|
label: O.findClose,
|
|
2224
2236
|
variant: "text",
|
|
2225
2237
|
size: "sm",
|
|
2226
|
-
onClick:
|
|
2238
|
+
onClick: ru
|
|
2227
2239
|
})
|
|
2228
2240
|
]
|
|
2229
2241
|
}),
|
|
@@ -2232,35 +2244,35 @@ function tr({ classes: a, data: o, dataSource: s, cacheTime: ee = 0, searchDebou
|
|
|
2232
2244
|
children: [
|
|
2233
2245
|
/* @__PURE__ */ b("span", {
|
|
2234
2246
|
className: V.batchCount(),
|
|
2235
|
-
children: O.changes(
|
|
2247
|
+
children: O.changes(Lc)
|
|
2236
2248
|
}),
|
|
2237
2249
|
/* @__PURE__ */ b(u, {
|
|
2238
2250
|
variant: "text",
|
|
2239
2251
|
size: "sm",
|
|
2240
2252
|
leadingIcon: Xt,
|
|
2241
|
-
disabled: !
|
|
2242
|
-
onClick:
|
|
2253
|
+
disabled: !jc.canUndo,
|
|
2254
|
+
onClick: Fc,
|
|
2243
2255
|
children: O.undo
|
|
2244
2256
|
}),
|
|
2245
2257
|
/* @__PURE__ */ b(u, {
|
|
2246
2258
|
variant: "text",
|
|
2247
2259
|
size: "sm",
|
|
2248
2260
|
leadingIcon: Gt,
|
|
2249
|
-
disabled: !
|
|
2250
|
-
onClick:
|
|
2261
|
+
disabled: !jc.canRedo,
|
|
2262
|
+
onClick: Ic,
|
|
2251
2263
|
children: O.redo
|
|
2252
2264
|
}),
|
|
2253
2265
|
/* @__PURE__ */ b(u, {
|
|
2254
2266
|
variant: "outline",
|
|
2255
2267
|
size: "sm",
|
|
2256
|
-
disabled: !
|
|
2257
|
-
onClick:
|
|
2268
|
+
disabled: !Lc,
|
|
2269
|
+
onClick: Bc,
|
|
2258
2270
|
children: O.discardChanges
|
|
2259
2271
|
}),
|
|
2260
2272
|
/* @__PURE__ */ b(u, {
|
|
2261
2273
|
size: "sm",
|
|
2262
|
-
disabled: !
|
|
2263
|
-
onClick:
|
|
2274
|
+
disabled: !Lc,
|
|
2275
|
+
onClick: zc,
|
|
2264
2276
|
children: O.saveChanges
|
|
2265
2277
|
})
|
|
2266
2278
|
]
|
|
@@ -2268,54 +2280,54 @@ function tr({ classes: a, data: o, dataSource: s, cacheTime: ee = 0, searchDebou
|
|
|
2268
2280
|
/* @__PURE__ */ b("p", {
|
|
2269
2281
|
role: "status",
|
|
2270
2282
|
className: V.status(),
|
|
2271
|
-
children:
|
|
2283
|
+
children: Ko || (s ? aa ? "" : ge(Vi, E, D) : hs ? O.results(L.getFilteredRowModel().rows.length) : "")
|
|
2272
2284
|
}),
|
|
2273
|
-
|
|
2285
|
+
Eo && Wt === "top" && yd,
|
|
2274
2286
|
/* @__PURE__ */ b("div", {
|
|
2275
|
-
ref:
|
|
2287
|
+
ref: Ou,
|
|
2276
2288
|
className: V.scroll(),
|
|
2277
|
-
style:
|
|
2278
|
-
onScroll:
|
|
2289
|
+
style: hi ? { maxHeight: hi } : void 0,
|
|
2290
|
+
onScroll: Iu,
|
|
2279
2291
|
children: /* @__PURE__ */ x("table", {
|
|
2280
2292
|
ref: $,
|
|
2281
|
-
className: V.table({ class:
|
|
2282
|
-
style:
|
|
2283
|
-
"aria-busy":
|
|
2284
|
-
"aria-rowcount": B ? Y.length +
|
|
2285
|
-
role: z ?
|
|
2286
|
-
"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,
|
|
2287
2299
|
tabIndex: (w || T === "batch") && !z ? -1 : void 0,
|
|
2288
|
-
onKeyDown:
|
|
2289
|
-
onFocus:
|
|
2300
|
+
onKeyDown: Uu,
|
|
2301
|
+
onFocus: Hu,
|
|
2290
2302
|
children: [
|
|
2291
2303
|
/* @__PURE__ */ b("caption", {
|
|
2292
2304
|
className: V.caption(),
|
|
2293
2305
|
children: we
|
|
2294
2306
|
}),
|
|
2295
2307
|
/* @__PURE__ */ x("thead", {
|
|
2296
|
-
ref:
|
|
2308
|
+
ref: Lu,
|
|
2297
2309
|
className: V.head(),
|
|
2298
|
-
children: [
|
|
2310
|
+
children: [Vo.map((e, t) => /* @__PURE__ */ x("tr", {
|
|
2299
2311
|
className: V.headRow(),
|
|
2300
2312
|
children: [
|
|
2301
2313
|
t === 0 && H.map((e) => /* @__PURE__ */ b("th", {
|
|
2302
2314
|
scope: "col",
|
|
2303
|
-
rowSpan:
|
|
2315
|
+
rowSpan: Vo.length,
|
|
2304
2316
|
className: V.th({ class: G(e, !0) }),
|
|
2305
2317
|
style: K(e),
|
|
2306
|
-
children: e === "select" &&
|
|
2307
|
-
checked:
|
|
2318
|
+
children: e === "select" && Ts ? /* @__PURE__ */ b(f, {
|
|
2319
|
+
checked: ks,
|
|
2308
2320
|
"aria-label": An ?? (xn === "all" ? O.selectAllRows : O.selectAll),
|
|
2309
|
-
onCheckedChange: (e) =>
|
|
2321
|
+
onCheckedChange: (e) => As(e === !0)
|
|
2310
2322
|
}) : e === "select" ? /* @__PURE__ */ b("span", {
|
|
2311
2323
|
className: V.srOnly(),
|
|
2312
2324
|
children: O.select
|
|
2313
2325
|
}) : e === "expand" ? /* @__PURE__ */ b("button", {
|
|
2314
2326
|
type: "button",
|
|
2315
2327
|
className: V.expander(),
|
|
2316
|
-
"aria-label":
|
|
2317
|
-
onClick: () => L.toggleAllRowsExpanded(!
|
|
2318
|
-
children: b(
|
|
2328
|
+
"aria-label": Ws ? O.collapseAll : O.expandAll,
|
|
2329
|
+
onClick: () => L.toggleAllRowsExpanded(!Ws),
|
|
2330
|
+
children: b(Ws ? Mt : Nt, {
|
|
2319
2331
|
className: V.expanderIcon(),
|
|
2320
2332
|
"aria-hidden": "true"
|
|
2321
2333
|
})
|
|
@@ -2333,36 +2345,36 @@ function tr({ classes: a, data: o, dataSource: s, cacheTime: ee = 0, searchDebou
|
|
|
2333
2345
|
className: V.th({ class: V.groupTh() }),
|
|
2334
2346
|
children: q(t)
|
|
2335
2347
|
}, e.header.id);
|
|
2336
|
-
let r = t.getIsSorted(), i =
|
|
2348
|
+
let r = t.getIsSorted(), i = Go(t.id);
|
|
2337
2349
|
return /* @__PURE__ */ x("th", {
|
|
2338
|
-
id:
|
|
2350
|
+
id: ou ? su(t.id) : void 0,
|
|
2339
2351
|
scope: "col",
|
|
2340
2352
|
rowSpan: e.rowSpan > 1 ? e.rowSpan : void 0,
|
|
2341
|
-
className:
|
|
2342
|
-
|
|
2353
|
+
className: Do(t.id).th({ class: [
|
|
2354
|
+
Lo(t.id, !0),
|
|
2343
2355
|
jr ? V.dropTargetColumn() : "",
|
|
2344
2356
|
j.get(t.id)?.headerClass
|
|
2345
2357
|
] }),
|
|
2346
|
-
style:
|
|
2347
|
-
"aria-sort":
|
|
2348
|
-
draggable:
|
|
2349
|
-
"data-drop":
|
|
2350
|
-
"data-dragging":
|
|
2351
|
-
onDragStart: (e) =>
|
|
2352
|
-
onDragOver: (e) =>
|
|
2353
|
-
onDragLeave: () =>
|
|
2354
|
-
onDrop:
|
|
2355
|
-
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,
|
|
2356
2368
|
children: [/* @__PURE__ */ x("div", {
|
|
2357
|
-
className:
|
|
2369
|
+
className: Do(t.id).headContent(),
|
|
2358
2370
|
children: [
|
|
2359
|
-
|
|
2371
|
+
Uo(t.id) ? /* @__PURE__ */ x("button", {
|
|
2360
2372
|
type: "button",
|
|
2361
2373
|
className: V.sortButton(),
|
|
2362
|
-
onClick: (e) =>
|
|
2374
|
+
onClick: (e) => fo(Xe(N, t.id, un === "multiple" && e.shiftKey)),
|
|
2363
2375
|
children: [
|
|
2364
2376
|
/* @__PURE__ */ b("span", {
|
|
2365
|
-
className:
|
|
2377
|
+
className: Ho(t),
|
|
2366
2378
|
children: q(t)
|
|
2367
2379
|
}),
|
|
2368
2380
|
b(r === "asc" ? Et : r === "desc" ? Tt : Dt, {
|
|
@@ -2379,15 +2391,15 @@ function tr({ classes: a, data: o, dataSource: s, cacheTime: ee = 0, searchDebou
|
|
|
2379
2391
|
})] })
|
|
2380
2392
|
]
|
|
2381
2393
|
}) : /* @__PURE__ */ b("span", {
|
|
2382
|
-
className:
|
|
2394
|
+
className: Ho(t),
|
|
2383
2395
|
children: q(t)
|
|
2384
2396
|
}),
|
|
2385
|
-
|
|
2397
|
+
ms && n && fs(n) && /* @__PURE__ */ b(Fn, {
|
|
2386
2398
|
header: q(t),
|
|
2387
2399
|
type: n.filter ?? "text",
|
|
2388
|
-
value:
|
|
2389
|
-
onChange: (e) =>
|
|
2390
|
-
options:
|
|
2400
|
+
value: gs(t.id),
|
|
2401
|
+
onChange: (e) => ys(t.id, e),
|
|
2402
|
+
options: _s(n),
|
|
2391
2403
|
inputProps: n.filterInputProps,
|
|
2392
2404
|
renderOption: n.renderOption,
|
|
2393
2405
|
matchModes: n.matchModes,
|
|
@@ -2397,9 +2409,9 @@ function tr({ classes: a, data: o, dataSource: s, cacheTime: ee = 0, searchDebou
|
|
|
2397
2409
|
column: n
|
|
2398
2410
|
}) : void 0
|
|
2399
2411
|
}),
|
|
2400
|
-
|
|
2401
|
-
items:
|
|
2402
|
-
onSelect: (e) =>
|
|
2412
|
+
Xo && /* @__PURE__ */ b(l, {
|
|
2413
|
+
items: Qo(t),
|
|
2414
|
+
onSelect: (e) => es(t, e),
|
|
2403
2415
|
children: /* @__PURE__ */ b("button", {
|
|
2404
2416
|
type: "button",
|
|
2405
2417
|
className: V.headButton(),
|
|
@@ -2424,14 +2436,14 @@ function tr({ classes: a, data: o, dataSource: s, cacheTime: ee = 0, searchDebou
|
|
|
2424
2436
|
"data-resizing": t.getIsResizing() || void 0,
|
|
2425
2437
|
onMouseDown: e.header.getResizeHandler(),
|
|
2426
2438
|
onTouchStart: e.header.getResizeHandler(),
|
|
2427
|
-
onKeyDown: (e) =>
|
|
2428
|
-
onDoubleClick: (e) =>
|
|
2439
|
+
onKeyDown: (e) => ds(t.id, e),
|
|
2440
|
+
onDoubleClick: (e) => us(t.id, e)
|
|
2429
2441
|
})]
|
|
2430
2442
|
}, e.header.id);
|
|
2431
2443
|
}),
|
|
2432
2444
|
t === 0 && U.length > 0 && /* @__PURE__ */ b("th", {
|
|
2433
2445
|
scope: "col",
|
|
2434
|
-
rowSpan:
|
|
2446
|
+
rowSpan: Vo.length,
|
|
2435
2447
|
className: V.th({ class: G("actions", !0) }),
|
|
2436
2448
|
style: K("actions"),
|
|
2437
2449
|
children: /* @__PURE__ */ b("span", {
|
|
@@ -2440,7 +2452,7 @@ function tr({ classes: a, data: o, dataSource: s, cacheTime: ee = 0, searchDebou
|
|
|
2440
2452
|
})
|
|
2441
2453
|
})
|
|
2442
2454
|
]
|
|
2443
|
-
}, t)),
|
|
2455
|
+
}, t)), ps && /* @__PURE__ */ x("tr", {
|
|
2444
2456
|
className: V.filterRow(),
|
|
2445
2457
|
children: [
|
|
2446
2458
|
H.map((e) => /* @__PURE__ */ b("td", {
|
|
@@ -2450,31 +2462,31 @@ function tr({ classes: a, data: o, dataSource: s, cacheTime: ee = 0, searchDebou
|
|
|
2450
2462
|
W.map((e) => {
|
|
2451
2463
|
let t = j.get(e.id);
|
|
2452
2464
|
return /* @__PURE__ */ b("td", {
|
|
2453
|
-
className:
|
|
2454
|
-
style:
|
|
2455
|
-
children: t &&
|
|
2456
|
-
value:
|
|
2457
|
-
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),
|
|
2458
2470
|
column: t
|
|
2459
|
-
}) : Ie(
|
|
2471
|
+
}) : Ie(bs(t)) ? /* @__PURE__ */ b("div", {
|
|
2460
2472
|
className: V.filterRowRange(),
|
|
2461
2473
|
children: [0, 1].map((n) => /* @__PURE__ */ b(Pn, {
|
|
2462
|
-
type:
|
|
2474
|
+
type: xs(t),
|
|
2463
2475
|
label: `${O.filter(q(e))}, ${n ? O.to : O.from}`,
|
|
2464
|
-
options:
|
|
2476
|
+
options: _s(t),
|
|
2465
2477
|
inputProps: t.filterInputProps,
|
|
2466
|
-
value:
|
|
2467
|
-
onChange: (e) =>
|
|
2478
|
+
value: Cs(t, n),
|
|
2479
|
+
onChange: (e) => ws(t, n, e)
|
|
2468
2480
|
}, n))
|
|
2469
2481
|
}) : /* @__PURE__ */ b(Pn, {
|
|
2470
|
-
type:
|
|
2482
|
+
type: xs(t),
|
|
2471
2483
|
label: O.filter(q(e)),
|
|
2472
|
-
options:
|
|
2484
|
+
options: _s(t),
|
|
2473
2485
|
inputProps: t.filterInputProps,
|
|
2474
2486
|
renderOption: t.renderOption,
|
|
2475
2487
|
any: !0,
|
|
2476
|
-
value:
|
|
2477
|
-
onChange: (e) =>
|
|
2488
|
+
value: vs(t),
|
|
2489
|
+
onChange: (e) => Ss(t, e)
|
|
2478
2490
|
}) : null
|
|
2479
2491
|
}, e.id);
|
|
2480
2492
|
}),
|
|
@@ -2485,13 +2497,13 @@ function tr({ classes: a, data: o, dataSource: s, cacheTime: ee = 0, searchDebou
|
|
|
2485
2497
|
]
|
|
2486
2498
|
})]
|
|
2487
2499
|
}),
|
|
2488
|
-
|
|
2500
|
+
Bs.length > 0 && /* @__PURE__ */ b("tbody", {
|
|
2489
2501
|
className: V.frozenBody(),
|
|
2490
|
-
style:
|
|
2491
|
-
children:
|
|
2502
|
+
style: hi ? { top: Ru } : void 0,
|
|
2503
|
+
children: Bs.map((e) => /* @__PURE__ */ x("tr", {
|
|
2492
2504
|
className: V.row({ class: Jr?.(e.original) }),
|
|
2493
|
-
"data-state":
|
|
2494
|
-
"aria-selected": z && pn ?
|
|
2505
|
+
"data-state": Ds(e) ? "selected" : void 0,
|
|
2506
|
+
"aria-selected": z && pn ? Ds(e) : void 0,
|
|
2495
2507
|
"data-row-id": e.id,
|
|
2496
2508
|
children: [
|
|
2497
2509
|
H.map((e) => /* @__PURE__ */ b("td", {
|
|
@@ -2501,9 +2513,9 @@ function tr({ classes: a, data: o, dataSource: s, cacheTime: ee = 0, searchDebou
|
|
|
2501
2513
|
e.getVisibleCells().map((t) => {
|
|
2502
2514
|
let n = j.get(t.column.id);
|
|
2503
2515
|
return /* @__PURE__ */ b("td", {
|
|
2504
|
-
className:
|
|
2505
|
-
style:
|
|
2506
|
-
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", {
|
|
2507
2519
|
className: V.copyCell(),
|
|
2508
2520
|
children: [n.cell ? n.cell(e.original, t.getValue()) : M(n, t.getValue(), e.original), /* @__PURE__ */ b(ie, {
|
|
2509
2521
|
value: M(n, t.getValue(), e.original),
|
|
@@ -2515,21 +2527,21 @@ function tr({ classes: a, data: o, dataSource: s, cacheTime: ee = 0, searchDebou
|
|
|
2515
2527
|
U.length > 0 && /* @__PURE__ */ b("td", {
|
|
2516
2528
|
className: V.td({ class: G("actions", !1) }),
|
|
2517
2529
|
style: K("actions"),
|
|
2518
|
-
children: T === "row" &&
|
|
2530
|
+
children: T === "row" && ko && /* @__PURE__ */ b("div", {
|
|
2519
2531
|
className: V.editActions(),
|
|
2520
|
-
children:
|
|
2532
|
+
children: xd(e, zi(e.original, e.index))
|
|
2521
2533
|
})
|
|
2522
2534
|
})
|
|
2523
2535
|
]
|
|
2524
2536
|
}, e.id))
|
|
2525
2537
|
}),
|
|
2526
2538
|
qr && Gr ? /* @__PURE__ */ b(c, {
|
|
2527
|
-
items:
|
|
2528
|
-
label:
|
|
2529
|
-
onSelect: (e) => $s
|
|
2530
|
-
children:
|
|
2531
|
-
}) :
|
|
2532
|
-
|
|
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", {
|
|
2533
2545
|
className: V.foot(),
|
|
2534
2546
|
children: /* @__PURE__ */ x("tr", { children: [
|
|
2535
2547
|
H.map((e) => /* @__PURE__ */ b("td", {
|
|
@@ -2537,9 +2549,9 @@ function tr({ classes: a, data: o, dataSource: s, cacheTime: ee = 0, searchDebou
|
|
|
2537
2549
|
style: K(e)
|
|
2538
2550
|
}, e)),
|
|
2539
2551
|
W.map((e) => /* @__PURE__ */ b("td", {
|
|
2540
|
-
className:
|
|
2541
|
-
style:
|
|
2542
|
-
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))
|
|
2543
2555
|
}, e.id)),
|
|
2544
2556
|
U.length > 0 && /* @__PURE__ */ b("td", {
|
|
2545
2557
|
className: V.footCell({ class: G("actions", !1) }),
|
|
@@ -2553,18 +2565,18 @@ function tr({ classes: a, data: o, dataSource: s, cacheTime: ee = 0, searchDebou
|
|
|
2553
2565
|
Qr && /* @__PURE__ */ x("div", {
|
|
2554
2566
|
className: V.statusBar(),
|
|
2555
2567
|
children: [
|
|
2556
|
-
/* @__PURE__ */ b("span", { children: O.rowCount(
|
|
2557
|
-
|
|
2558
|
-
pn && /* @__PURE__ */ b("span", { children: E.common.selectedCount(
|
|
2559
|
-
|
|
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))
|
|
2560
2572
|
]
|
|
2561
2573
|
}),
|
|
2562
|
-
|
|
2574
|
+
Eo && Wt === "bottom" && yd
|
|
2563
2575
|
]
|
|
2564
2576
|
});
|
|
2565
2577
|
return /* @__PURE__ */ b(Nn.Provider, {
|
|
2566
|
-
value:
|
|
2567
|
-
children: R ? cn(
|
|
2578
|
+
value: Ri,
|
|
2579
|
+
children: R ? cn(wd, document.body) : /* @__PURE__ */ b(Qt, { children: wd })
|
|
2568
2580
|
});
|
|
2569
2581
|
}
|
|
2570
2582
|
//#endregion
|