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