@gears-frontx/ui-kit 0.4.6 → 0.4.9
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/chunks/data-grid-portal-container-context.js +10 -0
- package/dist/chunks/data-grid-portal-container-context.js.map +1 -0
- package/dist/chunks/{data-grid.-6P4UQGJ.css → data-grid.DSkYrsay.css} +1 -1
- package/dist/chunks/drag-drop.BASVe3_O.css +1 -0
- package/dist/chunks/hooked.js +23 -31
- package/dist/chunks/hooked.js.map +1 -1
- package/dist/chunks/is-record.js +7 -0
- package/dist/chunks/is-record.js.map +1 -0
- package/dist/chunks/messages.js +12 -1
- package/dist/chunks/messages.js.map +1 -1
- package/dist/chunks/pagination.DJ7HJSFX.css +1 -0
- package/dist/chunks/resolve-body-cell-props.BA5IRWq0.css +1 -0
- package/dist/chunks/resolve-body-cell-props.js +80 -96
- package/dist/chunks/resolve-body-cell-props.js.map +1 -1
- package/dist/chunks/row-click-utils.js +12 -0
- package/dist/chunks/row-click-utils.js.map +1 -0
- package/dist/chunks/row-number.BxFT_3yP.css +1 -0
- package/dist/chunks/segment.js +16 -9
- package/dist/chunks/segment.js.map +1 -1
- package/dist/chunks/storage-helpers.js +40 -0
- package/dist/chunks/storage-helpers.js.map +1 -0
- package/dist/chunks/table-helpers.js +20 -0
- package/dist/chunks/table-helpers.js.map +1 -0
- package/dist/chunks/table-tree.DMtpMddS.css +1 -0
- package/dist/chunks/table.biUlW2U6.css +1 -0
- package/dist/chunks/use-latest.js +11 -0
- package/dist/chunks/use-latest.js.map +1 -0
- package/dist/components/data-grid/data-grid-types.d.ts +19 -0
- package/dist/components/data-grid/data-grid-types.d.ts.map +1 -1
- package/dist/components/data-grid/data-grid.d.ts +1 -1
- package/dist/components/data-grid/data-grid.d.ts.map +1 -1
- package/dist/components/data-grid/messages.d.ts +9 -0
- package/dist/components/data-grid/messages.d.ts.map +1 -1
- package/dist/components/data-grid/plugins/actions-menu/components/data-grid-actions-menu.d.ts.map +1 -1
- package/dist/components/data-grid/plugins/actions-menu/menu-items/export-menu-items/data-grid-export-menu-item.d.ts +6 -0
- package/dist/components/data-grid/plugins/actions-menu/menu-items/export-menu-items/data-grid-export-menu-item.d.ts.map +1 -0
- package/dist/components/data-grid/plugins/actions-menu/menu-items/export-menu-items/export-cells.d.ts +18 -0
- package/dist/components/data-grid/plugins/actions-menu/menu-items/export-menu-items/export-cells.d.ts.map +1 -0
- package/dist/components/data-grid/plugins/actions-menu/menu-items/export-menu-items/export-menu-items.d.ts +9 -0
- package/dist/components/data-grid/plugins/actions-menu/menu-items/export-menu-items/export-menu-items.d.ts.map +1 -0
- package/dist/components/data-grid/plugins/actions-menu/menu-items/export-menu-items/export-service.d.ts +5 -0
- package/dist/components/data-grid/plugins/actions-menu/menu-items/export-menu-items/export-service.d.ts.map +1 -0
- package/dist/components/data-grid/plugins/actions-menu/menu-items/export-menu-items/export-types.d.ts +77 -0
- package/dist/components/data-grid/plugins/actions-menu/menu-items/export-menu-items/export-types.d.ts.map +1 -0
- package/dist/components/data-grid/plugins/actions-menu/menu-items/export-menu-items/formatters/csv-formatter.d.ts +3 -0
- package/dist/components/data-grid/plugins/actions-menu/menu-items/export-menu-items/formatters/csv-formatter.d.ts.map +1 -0
- package/dist/components/data-grid/plugins/actions-menu/menu-items/export-menu-items/formatters/excel-formatter.d.ts +4 -0
- package/dist/components/data-grid/plugins/actions-menu/menu-items/export-menu-items/formatters/excel-formatter.d.ts.map +1 -0
- package/dist/components/data-grid/plugins/actions-menu/public.d.ts +2 -0
- package/dist/components/data-grid/plugins/actions-menu/public.d.ts.map +1 -1
- package/dist/components/data-grid/plugins/drag-drop/components/data-grid-drag-drop-body-cell.d.ts +3 -0
- package/dist/components/data-grid/plugins/drag-drop/components/data-grid-drag-drop-body-cell.d.ts.map +1 -0
- package/dist/components/data-grid/plugins/drag-drop/components/data-grid-drag-drop-content.d.ts +7 -0
- package/dist/components/data-grid/plugins/drag-drop/components/data-grid-drag-drop-content.d.ts.map +1 -0
- package/dist/components/data-grid/plugins/drag-drop/components/data-grid-drag-drop-row.d.ts +8 -0
- package/dist/components/data-grid/plugins/drag-drop/components/data-grid-drag-drop-row.d.ts.map +1 -0
- package/dist/components/data-grid/plugins/drag-drop/drag-data.d.ts +4 -0
- package/dist/components/data-grid/plugins/drag-drop/drag-data.d.ts.map +1 -0
- package/dist/components/data-grid/plugins/drag-drop/drag-drop-plugin.d.ts +18 -0
- package/dist/components/data-grid/plugins/drag-drop/drag-drop-plugin.d.ts.map +1 -0
- package/dist/components/data-grid/plugins/drag-drop/drag-drop-types.d.ts +60 -0
- package/dist/components/data-grid/plugins/drag-drop/drag-drop-types.d.ts.map +1 -0
- package/dist/components/data-grid/plugins/drag-drop/drag-preview.d.ts +2 -0
- package/dist/components/data-grid/plugins/drag-drop/drag-preview.d.ts.map +1 -0
- package/dist/components/data-grid/plugins/drag-drop/public.d.ts +3 -0
- package/dist/components/data-grid/plugins/drag-drop/public.d.ts.map +1 -0
- package/dist/components/data-grid/plugins/filters/components/adaptive-popover.d.ts.map +1 -1
- package/dist/components/data-grid/plugins/filters/components/all-filters-button.d.ts.map +1 -1
- package/dist/components/data-grid/plugins/order/components/data-grid-order-button.d.ts.map +1 -1
- package/dist/components/data-grid/plugins/pagination/components/data-grid-pagination.d.ts.map +1 -1
- package/dist/components/data-grid/plugins/pagination/components/pager.d.ts +6 -0
- package/dist/components/data-grid/plugins/pagination/components/pager.d.ts.map +1 -1
- package/dist/components/data-grid/plugins/table-configuration/components/data-grid-table-configuration-trigger.d.ts.map +1 -1
- package/dist/components/data-grid/plugins/table-tree/components/data-grid-table-tree-body-cell-content.d.ts +9 -0
- package/dist/components/data-grid/plugins/table-tree/components/data-grid-table-tree-body-cell-content.d.ts.map +1 -0
- package/dist/components/data-grid/plugins/table-tree/components/data-grid-table-tree-expand.d.ts +3 -0
- package/dist/components/data-grid/plugins/table-tree/components/data-grid-table-tree-expand.d.ts.map +1 -0
- package/dist/components/data-grid/plugins/table-tree/components/data-grid-table-tree-row.d.ts +8 -0
- package/dist/components/data-grid/plugins/table-tree/components/data-grid-table-tree-row.d.ts.map +1 -0
- package/dist/components/data-grid/plugins/table-tree/public.d.ts +3 -0
- package/dist/components/data-grid/plugins/table-tree/public.d.ts.map +1 -0
- package/dist/components/data-grid/plugins/table-tree/table-tree-helpers.d.ts +4 -0
- package/dist/components/data-grid/plugins/table-tree/table-tree-helpers.d.ts.map +1 -0
- package/dist/components/data-grid/plugins/table-tree/table-tree-plugin.d.ts +5 -0
- package/dist/components/data-grid/plugins/table-tree/table-tree-plugin.d.ts.map +1 -0
- package/dist/components/data-grid/plugins/table-tree/table-tree-types.d.ts +33 -0
- package/dist/components/data-grid/plugins/table-tree/table-tree-types.d.ts.map +1 -0
- package/dist/components/data-grid/services/core/data-grid-label-context.d.ts +7 -0
- package/dist/components/data-grid/services/core/data-grid-label-context.d.ts.map +1 -0
- package/dist/components/data-grid/services/core/data-grid-portal-container-context.d.ts +9 -0
- package/dist/components/data-grid/services/core/data-grid-portal-container-context.d.ts.map +1 -0
- package/dist/components/data-grid/services/table/components/data-grid-table.d.ts.map +1 -1
- package/dist/components/pagination/pagination.d.ts +7 -4
- package/dist/components/pagination/pagination.d.ts.map +1 -1
- package/dist/data-grid/actions-menu.js +350 -33
- package/dist/data-grid/actions-menu.js.map +1 -1
- package/dist/data-grid/drag-drop.d.ts +1 -0
- package/dist/data-grid/drag-drop.js +261 -0
- package/dist/data-grid/drag-drop.js.map +1 -0
- package/dist/data-grid/filters.js +368 -364
- package/dist/data-grid/filters.js.map +1 -1
- package/dist/data-grid/order.js +111 -110
- package/dist/data-grid/order.js.map +1 -1
- package/dist/data-grid/pagination.js +152 -143
- package/dist/data-grid/pagination.js.map +1 -1
- package/dist/data-grid/row-click.js +35 -42
- package/dist/data-grid/row-click.js.map +1 -1
- package/dist/data-grid/row-number.js +6 -6
- package/dist/data-grid/table-configuration.js +49 -37
- package/dist/data-grid/table-configuration.js.map +1 -1
- package/dist/data-grid/table-tree.d.ts +1 -0
- package/dist/data-grid/table-tree.js +233 -0
- package/dist/data-grid/table-tree.js.map +1 -0
- package/dist/data-grid.js +516 -542
- package/dist/data-grid.js.map +1 -1
- package/dist/docs/data-grid.md +309 -11
- package/dist/docs/pagination.md +14 -0
- package/dist/docs/table.md +10 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +375 -370
- package/dist/index.js.map +1 -1
- package/dist/pagination.js +23 -23
- package/dist/pagination.js.map +1 -1
- package/dist/table.js +88 -88
- package/llms.txt +6 -3
- package/package.json +10 -1
- package/dist/chunks/pagination.CKDEuWt6.css +0 -1
- package/dist/chunks/resolve-body-cell-props.DGczzk1U.css +0 -1
- package/dist/chunks/row-number.C7fNu9Bw.css +0 -1
- package/dist/chunks/table.Dmz7LEk7.css +0 -1
package/dist/data-grid.js
CHANGED
|
@@ -1,91 +1,96 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as
|
|
3
|
-
import { useRef as
|
|
4
|
-
import { b as
|
|
5
|
-
import { c as
|
|
6
|
-
import { cx as
|
|
7
|
-
import { Spinner as
|
|
8
|
-
import { SearchXIcon as _t, OctagonAlertIcon as
|
|
9
|
-
import { m as
|
|
2
|
+
import { jsx as m, jsxs as G, Fragment as N } from "react/jsx-runtime";
|
|
3
|
+
import { useRef as $, useState as ut, useEffect as M, useMemo as vt, Suspense as kt } from "react";
|
|
4
|
+
import { b as R, u as j, i as U, D as xt } from "./chunks/plugins-helpers.js";
|
|
5
|
+
import { c as Kn, a as Un } from "./chunks/plugins-helpers.js";
|
|
6
|
+
import { cx as W } from "class-variance-authority";
|
|
7
|
+
import { Spinner as Lt } from "./spinner.js";
|
|
8
|
+
import { SearchXIcon as _t, OctagonAlertIcon as Et, TablePropertiesIcon as Dt } from "lucide-react";
|
|
9
|
+
import { m as H } from "./chunks/messages.js";
|
|
10
10
|
import { Empty as dt, EmptyHeader as ft, EmptyMedia as pt, EmptyTitle as mt, EmptyDescription as St } from "./empty.js";
|
|
11
|
-
import { create as
|
|
12
|
-
import { c as
|
|
13
|
-
import { S as Mt } from "./chunks/segment.js";
|
|
14
|
-
import { ToggleGroupItem as
|
|
11
|
+
import { create as V } from "zustand";
|
|
12
|
+
import { c as It } from "./chunks/hooked.js";
|
|
13
|
+
import { S as Gt, u as Mt, D as Rt } from "./chunks/segment.js";
|
|
14
|
+
import { ToggleGroupItem as Ot } from "./toggle-group.js";
|
|
15
|
+
import { i as z } from "./chunks/is-record.js";
|
|
16
|
+
import { g as tt, D as At, a as Wt } from "./chunks/storage-helpers.js";
|
|
15
17
|
import { useShallow as J } from "zustand/react/shallow";
|
|
16
|
-
import {
|
|
17
|
-
import { u as
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import
|
|
23
|
-
|
|
18
|
+
import { a as q } from "./chunks/table-helpers.js";
|
|
19
|
+
import { u as P } from "./chunks/table-context.js";
|
|
20
|
+
import { s as Ht, D as et, r as Nt, a as X, b as Vt } from "./chunks/resolve-body-cell-props.js";
|
|
21
|
+
import { TableHead as Pt, TableRow as Y, TableBody as Tt, TableHeader as Ft, Table as Bt } from "./table.js";
|
|
22
|
+
import { D as zt } from "./chunks/data-grid-record-context.js";
|
|
23
|
+
import { u as Jn } from "./chunks/data-grid-record-context.js";
|
|
24
|
+
import { i as I } from "./chunks/table-types.js";
|
|
25
|
+
import { D as $t } from "./chunks/data-grid-portal-container-context.js";
|
|
26
|
+
import { u as jt } from "./chunks/use-latest.js";
|
|
27
|
+
import './chunks/data-grid.DSkYrsay.css';const Kt = "_delayed_1ys81_5", Ut = {
|
|
28
|
+
delayed: Kt
|
|
24
29
|
};
|
|
25
30
|
function Q({ className: t }) {
|
|
26
|
-
return /* @__PURE__ */
|
|
31
|
+
return /* @__PURE__ */ m("span", { className: W(Ut.delayed, t), children: /* @__PURE__ */ m(Lt, { size: "lg" }) });
|
|
27
32
|
}
|
|
28
|
-
const
|
|
29
|
-
root:
|
|
33
|
+
const Yt = "_root_9f4nk_13", Jt = {
|
|
34
|
+
root: Yt
|
|
30
35
|
};
|
|
31
|
-
function
|
|
32
|
-
const t =
|
|
36
|
+
function qt() {
|
|
37
|
+
const t = R(), e = t.load.useLoadStateStore((o) => o.recordsLoadState), n = t.core.useExternalLoadingStore((o) => o.loading);
|
|
33
38
|
return e === "loading" || n;
|
|
34
39
|
}
|
|
35
|
-
const
|
|
36
|
-
loaderOverlay:
|
|
40
|
+
const Xt = "_loaderOverlay_ff48v_31", Qt = {
|
|
41
|
+
loaderOverlay: Xt
|
|
37
42
|
};
|
|
38
|
-
function
|
|
39
|
-
const n =
|
|
40
|
-
return /* @__PURE__ */ G("div", { className:
|
|
43
|
+
function Zt({ children: t }) {
|
|
44
|
+
const n = R().core.useLoadStateStore((p) => p.loadState), s = qt() && n === "loaded", a = s || n === "loading";
|
|
45
|
+
return /* @__PURE__ */ G("div", { className: Jt.root, "aria-busy": a ? "true" : void 0, children: [
|
|
41
46
|
t,
|
|
42
|
-
s && /* @__PURE__ */
|
|
47
|
+
s && /* @__PURE__ */ m("div", { className: Qt.loaderOverlay, children: /* @__PURE__ */ m(Q, {}) })
|
|
43
48
|
] });
|
|
44
49
|
}
|
|
45
|
-
const
|
|
46
|
-
emptyState:
|
|
50
|
+
const te = "_emptyState_1tt1k_3", ee = {
|
|
51
|
+
emptyState: te
|
|
47
52
|
};
|
|
48
|
-
function
|
|
53
|
+
function ne() {
|
|
49
54
|
const { useStore: t } = j(), e = t((n) => n.hasActiveFilters);
|
|
50
|
-
return /* @__PURE__ */
|
|
51
|
-
/* @__PURE__ */
|
|
52
|
-
/* @__PURE__ */
|
|
53
|
-
e && /* @__PURE__ */
|
|
55
|
+
return /* @__PURE__ */ m(dt, { className: ee.emptyState, children: /* @__PURE__ */ G(ft, { children: [
|
|
56
|
+
/* @__PURE__ */ m(pt, { variant: "icon", children: /* @__PURE__ */ m(_t, {}) }),
|
|
57
|
+
/* @__PURE__ */ m(mt, { children: H.emptyState.noResultsFound }),
|
|
58
|
+
e && /* @__PURE__ */ m(St, { children: H.emptyState.noResultsFoundDescription })
|
|
54
59
|
] }) });
|
|
55
60
|
}
|
|
56
|
-
const
|
|
57
|
-
dataGridLayoutMain:
|
|
61
|
+
const oe = "_dataGridLayoutMain_ta8be_5", re = {
|
|
62
|
+
dataGridLayoutMain: oe
|
|
58
63
|
};
|
|
59
|
-
function
|
|
60
|
-
const { useStore: t } = j(), e =
|
|
61
|
-
return /* @__PURE__ */ G("div", { className:
|
|
62
|
-
l && /* @__PURE__ */
|
|
63
|
-
|
|
64
|
+
function se() {
|
|
65
|
+
const { useStore: t } = j(), e = R(), n = t((S) => S.visibleRecords), o = t((S) => S.hasActiveFilters), s = e.layout.useLayoutStore((S) => S.activeSlotIds.get("main")), a = e.layout.useLayoutStore((S) => S.slots.get("main")), p = a == null ? void 0 : a.find((S) => S.id === s), g = e.layout.useLayoutStore((S) => S.slots.get("empty")), c = g == null ? void 0 : g[0], d = n.length === 0, l = p && (!d || o), f = d;
|
|
66
|
+
return /* @__PURE__ */ G("div", { className: re.dataGridLayoutMain, children: [
|
|
67
|
+
l && /* @__PURE__ */ m(p.component, {}),
|
|
68
|
+
f && (c ? /* @__PURE__ */ m(c.component, {}) : /* @__PURE__ */ m(ne, {}))
|
|
64
69
|
] });
|
|
65
70
|
}
|
|
66
|
-
function
|
|
67
|
-
const n =
|
|
68
|
-
return !n || n.length === 0 ? null : /* @__PURE__ */
|
|
71
|
+
function ie({ name: t }) {
|
|
72
|
+
const n = R().layout.useLayoutStore((o) => o.slots.get(t));
|
|
73
|
+
return !n || n.length === 0 ? null : /* @__PURE__ */ m(N, { children: n.map((o) => /* @__PURE__ */ m(o.component, {}, o.id)) });
|
|
69
74
|
}
|
|
70
|
-
const
|
|
71
|
-
dataGridTopDefault:
|
|
72
|
-
topStartSlots:
|
|
73
|
-
topStartSlot:
|
|
74
|
-
topEndSlot:
|
|
75
|
-
topEndSlots:
|
|
75
|
+
const ae = "_dataGridTopDefault_5t4tt_1", ce = "_topStartSlots_5t4tt_16", le = "_topStartSlot_5t4tt_16", ue = "_topEndSlot_5t4tt_32", de = "_topEndSlots_5t4tt_36", F = {
|
|
76
|
+
dataGridTopDefault: ae,
|
|
77
|
+
topStartSlots: ce,
|
|
78
|
+
topStartSlot: le,
|
|
79
|
+
topEndSlot: ue,
|
|
80
|
+
topEndSlots: de
|
|
76
81
|
};
|
|
77
|
-
function
|
|
78
|
-
const t =
|
|
82
|
+
function fe() {
|
|
83
|
+
const t = R(), e = t.layout.useLayoutStore(
|
|
79
84
|
(a) => a.slots.get("top-start")
|
|
80
85
|
), n = t.layout.useLayoutStore((a) => a.slots.get("top-end")), o = ((e == null ? void 0 : e.length) ?? 0) > 0, s = ((n == null ? void 0 : n.length) ?? 0) > 0;
|
|
81
86
|
return !o && !s ? null : /* @__PURE__ */ G("div", { className: F.dataGridTopDefault, children: [
|
|
82
|
-
o && /* @__PURE__ */
|
|
83
|
-
s && /* @__PURE__ */
|
|
87
|
+
o && /* @__PURE__ */ m("div", { className: F.topStartSlots, children: e == null ? void 0 : e.map((a) => /* @__PURE__ */ m("div", { className: F.topStartSlot, children: /* @__PURE__ */ m(a.component, {}) }, a.id)) }),
|
|
88
|
+
s && /* @__PURE__ */ m("div", { className: F.topEndSlots, children: n == null ? void 0 : n.map((a) => /* @__PURE__ */ m("div", { className: F.topEndSlot, children: /* @__PURE__ */ m(a.component, {}) }, a.id)) })
|
|
84
89
|
] });
|
|
85
90
|
}
|
|
86
|
-
const
|
|
87
|
-
wrapper:
|
|
88
|
-
replacement:
|
|
91
|
+
const pe = "_wrapper_1h8lw_7", me = "_replacement_1h8lw_18", nt = {
|
|
92
|
+
wrapper: pe,
|
|
93
|
+
replacement: me
|
|
89
94
|
};
|
|
90
95
|
function ht(t) {
|
|
91
96
|
const e = [];
|
|
@@ -95,68 +100,68 @@ function ht(t) {
|
|
|
95
100
|
}
|
|
96
101
|
return e;
|
|
97
102
|
}
|
|
98
|
-
function
|
|
103
|
+
function Se(t) {
|
|
99
104
|
const { display: e, flexWrap: n } = getComputedStyle(t);
|
|
100
105
|
return e.includes("flex") && n !== "" && n !== "nowrap";
|
|
101
106
|
}
|
|
102
|
-
function
|
|
107
|
+
function he(t) {
|
|
103
108
|
let e = Number.NEGATIVE_INFINITY, n = Number.POSITIVE_INFINITY;
|
|
104
109
|
for (const o of ht(t)) {
|
|
105
|
-
const { top: s, bottom: a, width:
|
|
106
|
-
|
|
110
|
+
const { top: s, bottom: a, width: p, height: g } = o.getBoundingClientRect();
|
|
111
|
+
p === 0 && g === 0 || (e = Math.max(e, s), n = Math.min(n, a));
|
|
107
112
|
}
|
|
108
113
|
return e <= n + 0.5;
|
|
109
114
|
}
|
|
110
|
-
function
|
|
115
|
+
function ye(t) {
|
|
111
116
|
return [t, ...Array.from(t.querySelectorAll("*"))].every(
|
|
112
|
-
(e) => !
|
|
117
|
+
(e) => !Se(e) || he(e)
|
|
113
118
|
);
|
|
114
119
|
}
|
|
115
|
-
function
|
|
116
|
-
const t =
|
|
117
|
-
if (
|
|
120
|
+
function ge() {
|
|
121
|
+
const t = R(), e = t.layout.useLayoutStore((d) => d.activeSlotIds.get("top")), n = t.layout.useLayoutStore((d) => d.slots.get("top")), o = n == null ? void 0 : n.find((d) => d.id === e), s = (o == null ? void 0 : o.id) === "default", a = $(null), [p, g] = ut();
|
|
122
|
+
if (M(() => {
|
|
118
123
|
const d = a.current;
|
|
119
124
|
if (!s || !d) return;
|
|
120
|
-
const l = new ResizeObserver((
|
|
125
|
+
const l = new ResizeObserver((f) => {
|
|
121
126
|
var r, i;
|
|
122
|
-
const
|
|
123
|
-
g(
|
|
127
|
+
const S = f[f.length - 1], u = ((i = (r = S.borderBoxSize) == null ? void 0 : r[0]) == null ? void 0 : i.blockSize) ?? S.contentRect.height;
|
|
128
|
+
g(ye(d) ? u : void 0);
|
|
124
129
|
});
|
|
125
130
|
return l.observe(d), () => l.disconnect();
|
|
126
131
|
}, [s]), !o) return null;
|
|
127
|
-
const c = s ?
|
|
128
|
-
return /* @__PURE__ */
|
|
132
|
+
const c = s ? fe : o.component;
|
|
133
|
+
return /* @__PURE__ */ m(
|
|
129
134
|
"div",
|
|
130
135
|
{
|
|
131
136
|
ref: a,
|
|
132
|
-
className:
|
|
133
|
-
style: !s &&
|
|
134
|
-
children: /* @__PURE__ */
|
|
137
|
+
className: W(nt.wrapper, !s && nt.replacement),
|
|
138
|
+
style: !s && p ? { minBlockSize: p } : void 0,
|
|
139
|
+
children: /* @__PURE__ */ m(c, {})
|
|
135
140
|
}
|
|
136
141
|
);
|
|
137
142
|
}
|
|
138
|
-
const
|
|
139
|
-
center:
|
|
143
|
+
const Ce = "_center_s4klt_3", ot = {
|
|
144
|
+
center: Ce
|
|
140
145
|
};
|
|
141
|
-
function
|
|
142
|
-
return t === "loaded" ? /* @__PURE__ */
|
|
143
|
-
/* @__PURE__ */
|
|
144
|
-
/* @__PURE__ */
|
|
145
|
-
/* @__PURE__ */
|
|
146
|
-
] }) }) : /* @__PURE__ */
|
|
146
|
+
function be({ loadState: t, children: e }) {
|
|
147
|
+
return t === "loaded" ? /* @__PURE__ */ m(N, { children: e }) : t === "error" ? /* @__PURE__ */ m(dt, { className: ot.center, children: /* @__PURE__ */ G(ft, { children: [
|
|
148
|
+
/* @__PURE__ */ m(pt, { variant: "icon", children: /* @__PURE__ */ m(Et, {}) }),
|
|
149
|
+
/* @__PURE__ */ m(mt, { children: H.loadError.headerDefault }),
|
|
150
|
+
/* @__PURE__ */ m(St, { children: H.loadError.bodyDefault })
|
|
151
|
+
] }) }) : /* @__PURE__ */ m(Q, { className: ot.center });
|
|
147
152
|
}
|
|
148
|
-
function
|
|
149
|
-
const t = j(), { useStore: e } = t, { core: n } =
|
|
150
|
-
return
|
|
151
|
-
process.env.NODE_ENV !== "production" && console.error("[DataGrid] Initial load failed:",
|
|
152
|
-
}), () => t.destroy()), [t]), /* @__PURE__ */
|
|
153
|
-
/* @__PURE__ */
|
|
154
|
-
/* @__PURE__ */
|
|
155
|
-
!a && /* @__PURE__ */
|
|
153
|
+
function we() {
|
|
154
|
+
const t = j(), { useStore: e } = t, { core: n } = R(), o = e((p) => p.visibleRecords), s = n.useLoadStateStore((p) => p.loadState), a = o.length === 0;
|
|
155
|
+
return M(() => (t.init().catch((p) => {
|
|
156
|
+
process.env.NODE_ENV !== "production" && console.error("[DataGrid] Initial load failed:", p);
|
|
157
|
+
}), () => t.destroy()), [t]), /* @__PURE__ */ m(Zt, { children: /* @__PURE__ */ G(be, { loadState: s, children: [
|
|
158
|
+
/* @__PURE__ */ m(ge, {}),
|
|
159
|
+
/* @__PURE__ */ m(se, {}),
|
|
160
|
+
!a && /* @__PURE__ */ m(ie, { name: "bottom" })
|
|
156
161
|
] }) });
|
|
157
162
|
}
|
|
158
163
|
function yt() {
|
|
159
|
-
const t =
|
|
164
|
+
const t = V()(() => ({
|
|
160
165
|
loadState: "blank"
|
|
161
166
|
}));
|
|
162
167
|
let e = 0;
|
|
@@ -166,7 +171,7 @@ function yt() {
|
|
|
166
171
|
setLoaded: o,
|
|
167
172
|
setError: s,
|
|
168
173
|
setBlank: a,
|
|
169
|
-
reset:
|
|
174
|
+
reset: p,
|
|
170
175
|
loadPromise: g
|
|
171
176
|
};
|
|
172
177
|
function n() {
|
|
@@ -181,7 +186,7 @@ function yt() {
|
|
|
181
186
|
function a() {
|
|
182
187
|
t.setState({ loadState: "blank" });
|
|
183
188
|
}
|
|
184
|
-
function
|
|
189
|
+
function p() {
|
|
185
190
|
e += 1, a();
|
|
186
191
|
}
|
|
187
192
|
async function g(c) {
|
|
@@ -195,8 +200,8 @@ function yt() {
|
|
|
195
200
|
}
|
|
196
201
|
}
|
|
197
202
|
}
|
|
198
|
-
function
|
|
199
|
-
const { useLoadState: t, loadPromise: e, reset: n } = yt(), o =
|
|
203
|
+
function ve() {
|
|
204
|
+
const { useLoadState: t, loadPromise: e, reset: n } = yt(), o = V()(() => ({
|
|
200
205
|
loading: !1
|
|
201
206
|
}));
|
|
202
207
|
return {
|
|
@@ -210,8 +215,8 @@ function Ce() {
|
|
|
210
215
|
o.setState({ loading: a });
|
|
211
216
|
}
|
|
212
217
|
}
|
|
213
|
-
function
|
|
214
|
-
const t =
|
|
218
|
+
function ke() {
|
|
219
|
+
const t = It();
|
|
215
220
|
return {
|
|
216
221
|
hook: t.hook,
|
|
217
222
|
callHook: t.callHook,
|
|
@@ -219,21 +224,21 @@ function be() {
|
|
|
219
224
|
callHookSync: t.callHookSync
|
|
220
225
|
};
|
|
221
226
|
}
|
|
222
|
-
const Z = "table_layout", gt = "cards_layout",
|
|
223
|
-
[Z,
|
|
224
|
-
[gt,
|
|
227
|
+
const Z = "table_layout", gt = "cards_layout", rt = "view_selector", xe = /* @__PURE__ */ new Map([
|
|
228
|
+
[Z, H.layoutMainSlotSelector.table],
|
|
229
|
+
[gt, H.layoutMainSlotSelector.cards]
|
|
225
230
|
]);
|
|
226
|
-
function
|
|
227
|
-
const t =
|
|
231
|
+
function Le() {
|
|
232
|
+
const t = R(), e = t.layout.useLayoutStore((s) => s.slots.get("main")), n = t.layout.useLayoutStore((s) => s.activeSlotIds.get("main"));
|
|
228
233
|
if (!e || e.length < 2) return null;
|
|
229
|
-
return /* @__PURE__ */
|
|
234
|
+
return /* @__PURE__ */ m(Gt, { size: "sm", iconOnly: !0, value: n, onValueChange: o, children: e.map((s) => {
|
|
230
235
|
const a = "icon" in s ? s.icon : void 0;
|
|
231
|
-
return /* @__PURE__ */
|
|
232
|
-
|
|
236
|
+
return /* @__PURE__ */ m(
|
|
237
|
+
Ot,
|
|
233
238
|
{
|
|
234
239
|
value: s.id,
|
|
235
|
-
"aria-label":
|
|
236
|
-
children: a ? /* @__PURE__ */
|
|
240
|
+
"aria-label": xe.get(s.id) ?? s.id,
|
|
241
|
+
children: a ? /* @__PURE__ */ m(a, {}) : null
|
|
237
242
|
},
|
|
238
243
|
s.id
|
|
239
244
|
);
|
|
@@ -242,13 +247,13 @@ function ve() {
|
|
|
242
247
|
s && t.layout.setActiveSlotId("main", s);
|
|
243
248
|
}
|
|
244
249
|
}
|
|
245
|
-
function
|
|
246
|
-
const e =
|
|
250
|
+
function _e(t) {
|
|
251
|
+
const e = V()(() => ({
|
|
247
252
|
slots: /* @__PURE__ */ new Map(),
|
|
248
253
|
activeSlotIds: /* @__PURE__ */ new Map()
|
|
249
254
|
})), n = {
|
|
250
255
|
registerSlot: a,
|
|
251
|
-
setActiveSlotId:
|
|
256
|
+
setActiveSlotId: p,
|
|
252
257
|
getActiveSlotId: g
|
|
253
258
|
};
|
|
254
259
|
return t.plugins.registerPublicApi(n), {
|
|
@@ -267,36 +272,33 @@ function ke(t) {
|
|
|
267
272
|
active: !0,
|
|
268
273
|
component: () => null
|
|
269
274
|
});
|
|
270
|
-
const l = d.id ?? Math.random().toString(),
|
|
275
|
+
const l = d.id ?? Math.random().toString(), f = s(c), S = d.order ?? (f.length + 1) * 10, u = { id: l, name: c, ...d, order: S }, r = [...f, u].sort((i, h) => i.order - h.order);
|
|
271
276
|
e.setState((i) => {
|
|
272
|
-
const
|
|
273
|
-
return
|
|
274
|
-
}), ("active" in d && d.active || r.length === 1) &&
|
|
275
|
-
id:
|
|
276
|
-
component:
|
|
277
|
+
const h = new Map(i.slots);
|
|
278
|
+
return h.set(c, r), { slots: h };
|
|
279
|
+
}), ("active" in d && d.active || r.length === 1) && p(c, u.id), c === "main" && r.length >= 2 && !o("top-end", rt) && a("top-end", {
|
|
280
|
+
id: rt,
|
|
281
|
+
component: Le
|
|
277
282
|
});
|
|
278
283
|
}
|
|
279
|
-
function
|
|
284
|
+
function p(c, d) {
|
|
280
285
|
e.setState((l) => {
|
|
281
|
-
const
|
|
282
|
-
return
|
|
286
|
+
const f = new Map(l.activeSlotIds);
|
|
287
|
+
return f.set(c, d), { activeSlotIds: f };
|
|
283
288
|
});
|
|
284
289
|
}
|
|
285
290
|
function g(c) {
|
|
286
291
|
return e.getState().activeSlotIds.get(c);
|
|
287
292
|
}
|
|
288
293
|
}
|
|
289
|
-
function
|
|
290
|
-
return typeof t == "object" && t !== null;
|
|
291
|
-
}
|
|
292
|
-
function xe(t, e) {
|
|
294
|
+
function Ee(t, e) {
|
|
293
295
|
const n = ((e == null ? void 0 : e.id) ?? Math.random()).toString(), o = new AbortController(), s = yt(), a = structuredClone((e == null ? void 0 : e.loadContext) ?? {});
|
|
294
|
-
let
|
|
296
|
+
let p, g, c;
|
|
295
297
|
const d = {}, l = {
|
|
296
298
|
id: n,
|
|
297
299
|
useLoadState: s.useLoadState,
|
|
298
300
|
signal: o.signal,
|
|
299
|
-
abort:
|
|
301
|
+
abort: f,
|
|
300
302
|
refresh: (e == null ? void 0 : e.refresh) ?? null,
|
|
301
303
|
get promise() {
|
|
302
304
|
return d.promise;
|
|
@@ -308,82 +310,82 @@ function xe(t, e) {
|
|
|
308
310
|
return g;
|
|
309
311
|
},
|
|
310
312
|
get fetchResult() {
|
|
311
|
-
return
|
|
313
|
+
return p;
|
|
312
314
|
},
|
|
313
315
|
get error() {
|
|
314
316
|
return c;
|
|
315
317
|
}
|
|
316
318
|
};
|
|
317
|
-
return d.promise = s.loadPromise(
|
|
318
|
-
function
|
|
319
|
+
return d.promise = s.loadPromise(S()), l;
|
|
320
|
+
function f() {
|
|
319
321
|
o.abort();
|
|
320
322
|
}
|
|
321
|
-
async function
|
|
323
|
+
async function S() {
|
|
322
324
|
try {
|
|
323
325
|
await t.hooked.callHookParallel("load:prepare", l);
|
|
324
326
|
const i = await t.hooked.callHookParallel("load:context", l);
|
|
325
327
|
r(a, i);
|
|
326
|
-
const
|
|
328
|
+
const h = {
|
|
327
329
|
...l.loadContext,
|
|
328
330
|
signal: l.signal
|
|
329
331
|
};
|
|
330
|
-
if (
|
|
331
|
-
const
|
|
332
|
-
(!
|
|
332
|
+
if (p = await t.config.load.current(h), u(p), g = (await t.hooked.callHook("load:process", l))[0] ?? p, u(g), (e == null ? void 0 : e.store) !== !1) {
|
|
333
|
+
const y = t.hooked.callHookSync("load:store", l);
|
|
334
|
+
(!y.length || y.every((C) => C !== !0)) && (t.storage.clearSections(), t.storage.createSection({ loadContext: a }, g.results));
|
|
333
335
|
}
|
|
334
336
|
await t.hooked.callHook("load:success", l);
|
|
335
337
|
} catch (i) {
|
|
336
338
|
throw c = i, await t.hooked.callHook("load:error", l), c;
|
|
337
339
|
}
|
|
338
340
|
}
|
|
339
|
-
function
|
|
341
|
+
function u(i) {
|
|
340
342
|
if (typeof i != "object" || i === null || !("results" in i))
|
|
341
343
|
throw new Error(
|
|
342
344
|
`Load result must be an object with "results" and "total?" properties. Got ${JSON.stringify(i)}`
|
|
343
345
|
);
|
|
344
346
|
}
|
|
345
|
-
function r(i,
|
|
346
|
-
for (const
|
|
347
|
-
if (
|
|
348
|
-
for (const C in
|
|
349
|
-
const w =
|
|
350
|
-
if (
|
|
347
|
+
function r(i, h) {
|
|
348
|
+
for (const y of h ?? [])
|
|
349
|
+
if (z(y))
|
|
350
|
+
for (const C in y) {
|
|
351
|
+
const w = y[C];
|
|
352
|
+
if (z(w))
|
|
351
353
|
if (Array.isArray(w))
|
|
352
354
|
i[C] = w;
|
|
353
355
|
else {
|
|
354
356
|
i[C] ?? (i[C] = {});
|
|
355
357
|
const k = i[C];
|
|
356
|
-
|
|
358
|
+
z(k) && Object.assign(k, w);
|
|
357
359
|
}
|
|
358
360
|
}
|
|
359
361
|
}
|
|
360
362
|
}
|
|
361
|
-
function
|
|
363
|
+
function De(t) {
|
|
362
364
|
const e = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Set();
|
|
363
365
|
let o;
|
|
364
|
-
const s =
|
|
366
|
+
const s = V()(() => ({
|
|
365
367
|
loadState: "blank",
|
|
366
368
|
recordsLoadState: "blank"
|
|
367
369
|
})), a = {
|
|
368
370
|
triggerLoad: r,
|
|
369
|
-
refresh:
|
|
371
|
+
refresh: S,
|
|
370
372
|
abort: d,
|
|
371
373
|
getLoadInstances: c,
|
|
372
374
|
useLoadStateStore: s
|
|
373
375
|
};
|
|
374
376
|
return t.plugins.registerPublicApi(a), {
|
|
375
377
|
...a,
|
|
376
|
-
init:
|
|
378
|
+
init: f
|
|
377
379
|
};
|
|
378
|
-
function
|
|
380
|
+
function p() {
|
|
379
381
|
s.setState({
|
|
380
382
|
loadState: e.size > 0 ? "loading" : "blank",
|
|
381
383
|
recordsLoadState: n.size > 0 ? "loading" : "blank"
|
|
382
384
|
});
|
|
383
385
|
}
|
|
384
386
|
function g(i) {
|
|
385
|
-
var
|
|
386
|
-
return (i == null ? void 0 : i.store) === !1 ? !1 : ((
|
|
387
|
+
var h, y;
|
|
388
|
+
return (i == null ? void 0 : i.store) === !1 ? !1 : ((y = (h = i == null ? void 0 : i.loadContext) == null ? void 0 : h.tree) == null ? void 0 : y.parentId) == null;
|
|
387
389
|
}
|
|
388
390
|
function c() {
|
|
389
391
|
return [...e.values()];
|
|
@@ -395,41 +397,41 @@ function Ee(t) {
|
|
|
395
397
|
async function l(i) {
|
|
396
398
|
try {
|
|
397
399
|
return await i.promise, !1;
|
|
398
|
-
} catch (
|
|
400
|
+
} catch (h) {
|
|
399
401
|
if (i.signal.aborted) return !0;
|
|
400
|
-
throw
|
|
402
|
+
throw h;
|
|
401
403
|
}
|
|
402
404
|
}
|
|
403
|
-
async function
|
|
405
|
+
async function f() {
|
|
404
406
|
await t.hooked.callHook("init");
|
|
405
407
|
const i = o;
|
|
406
408
|
if (!await l(r())) return;
|
|
407
|
-
let
|
|
408
|
-
for (; o !==
|
|
409
|
-
|
|
409
|
+
let h = i;
|
|
410
|
+
for (; o !== h; )
|
|
411
|
+
h = o, await h;
|
|
410
412
|
}
|
|
411
|
-
function
|
|
412
|
-
return o =
|
|
413
|
+
function S(i = {}) {
|
|
414
|
+
return o = u(i), o;
|
|
413
415
|
}
|
|
414
|
-
async function
|
|
416
|
+
async function u(i) {
|
|
415
417
|
d();
|
|
416
|
-
const
|
|
417
|
-
await t.hooked.callHook("refresh",
|
|
418
|
+
const h = { resetFilters: i.resetFilters ?? !0 };
|
|
419
|
+
await t.hooked.callHook("refresh", h), await l(r({ refresh: h }));
|
|
418
420
|
}
|
|
419
421
|
function r(i) {
|
|
420
|
-
const
|
|
421
|
-
return e.set(
|
|
422
|
-
e.delete(
|
|
422
|
+
const h = Ee(t, i);
|
|
423
|
+
return e.set(h.id, h), g(i) && n.add(h.id), p(), h.promise.finally(() => {
|
|
424
|
+
e.delete(h.id), n.delete(h.id), p();
|
|
423
425
|
}).catch(() => {
|
|
424
|
-
}),
|
|
426
|
+
}), h;
|
|
425
427
|
}
|
|
426
428
|
}
|
|
427
|
-
function
|
|
429
|
+
function Ie(t) {
|
|
428
430
|
const e = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Map(), o = t.config.name, s = t.config.persistent ?? "localStorage", a = {
|
|
429
431
|
registerPersistentState: c
|
|
430
432
|
};
|
|
431
433
|
return t.plugins.registerPublicApi(a), a;
|
|
432
|
-
function
|
|
434
|
+
function p(d) {
|
|
433
435
|
return `dataGrid:${o}:${d}`;
|
|
434
436
|
}
|
|
435
437
|
function g(d) {
|
|
@@ -441,66 +443,66 @@ function _e(t) {
|
|
|
441
443
|
}
|
|
442
444
|
}
|
|
443
445
|
function c(d, l = {}) {
|
|
444
|
-
const
|
|
446
|
+
const f = p(d), S = l.storage ?? s, u = S === "router" && l.router === !1;
|
|
445
447
|
return {
|
|
446
448
|
get value() {
|
|
447
449
|
return r();
|
|
448
450
|
},
|
|
449
451
|
setValue: i,
|
|
450
|
-
buildStorageItem:
|
|
452
|
+
buildStorageItem: h
|
|
451
453
|
};
|
|
452
454
|
function r() {
|
|
453
|
-
if (
|
|
455
|
+
if (u)
|
|
454
456
|
return;
|
|
455
|
-
if (
|
|
457
|
+
if (S === "memory")
|
|
456
458
|
return n.get(d);
|
|
457
|
-
if (
|
|
459
|
+
if (S === "router") {
|
|
458
460
|
const C = new URLSearchParams(window.location.search);
|
|
459
|
-
return
|
|
461
|
+
return st(C.get(d));
|
|
460
462
|
}
|
|
461
|
-
const
|
|
462
|
-
if (
|
|
463
|
-
return
|
|
463
|
+
const y = g(S);
|
|
464
|
+
if (y)
|
|
465
|
+
return st(Ge(y, f));
|
|
464
466
|
}
|
|
465
|
-
function i(
|
|
467
|
+
function i(y) {
|
|
466
468
|
var C;
|
|
467
|
-
if (!
|
|
468
|
-
if (
|
|
469
|
-
|
|
470
|
-
else if (
|
|
469
|
+
if (!u) {
|
|
470
|
+
if (S === "memory")
|
|
471
|
+
y === void 0 ? n.delete(d) : n.set(d, y);
|
|
472
|
+
else if (S === "router") {
|
|
471
473
|
const w = new URLSearchParams(window.location.search);
|
|
472
|
-
|
|
474
|
+
y === void 0 ? w.delete(d) : w.set(d, JSON.stringify(y));
|
|
473
475
|
const k = `${window.location.pathname}?${w.toString()}`;
|
|
474
476
|
window.history.replaceState(null, "", k);
|
|
475
477
|
} else {
|
|
476
|
-
const w = g(
|
|
478
|
+
const w = g(S);
|
|
477
479
|
if (!w) return;
|
|
478
480
|
try {
|
|
479
|
-
|
|
481
|
+
y === void 0 ? w.removeItem(f) : w.setItem(f, JSON.stringify(y));
|
|
480
482
|
} catch {
|
|
481
483
|
}
|
|
482
484
|
}
|
|
483
485
|
(C = e.get(d)) == null || C.forEach((w) => w());
|
|
484
486
|
}
|
|
485
487
|
}
|
|
486
|
-
function
|
|
487
|
-
if (!l.schema) return { [d]:
|
|
488
|
+
function h(y) {
|
|
489
|
+
if (!l.schema) return { [d]: y };
|
|
488
490
|
const C = {};
|
|
489
491
|
return Object.entries(l.schema).forEach(([w]) => {
|
|
490
|
-
const k =
|
|
492
|
+
const k = z(y) ? y[w] : void 0;
|
|
491
493
|
k !== void 0 && (C[w] = k);
|
|
492
494
|
}), C;
|
|
493
495
|
}
|
|
494
496
|
}
|
|
495
497
|
}
|
|
496
|
-
function
|
|
498
|
+
function Ge(t, e) {
|
|
497
499
|
try {
|
|
498
500
|
return t.getItem(e);
|
|
499
501
|
} catch {
|
|
500
502
|
return null;
|
|
501
503
|
}
|
|
502
504
|
}
|
|
503
|
-
function
|
|
505
|
+
function st(t) {
|
|
504
506
|
if (t)
|
|
505
507
|
try {
|
|
506
508
|
return JSON.parse(t);
|
|
@@ -508,7 +510,7 @@ function rt(t) {
|
|
|
508
510
|
return;
|
|
509
511
|
}
|
|
510
512
|
}
|
|
511
|
-
function
|
|
513
|
+
function Me(t) {
|
|
512
514
|
const e = /* @__PURE__ */ new Map(), n = {
|
|
513
515
|
hook: t.hooked.hook,
|
|
514
516
|
getPlugin: g
|
|
@@ -516,7 +518,7 @@ function Ie(t) {
|
|
|
516
518
|
return {
|
|
517
519
|
...n,
|
|
518
520
|
registerPlugin: a,
|
|
519
|
-
registerPlugins:
|
|
521
|
+
registerPlugins: p,
|
|
520
522
|
registerPublicApi: s,
|
|
521
523
|
pluginContext: o
|
|
522
524
|
};
|
|
@@ -533,23 +535,15 @@ function Ie(t) {
|
|
|
533
535
|
const d = c.setup(o);
|
|
534
536
|
d !== void 0 && e.set(c.name, d);
|
|
535
537
|
}
|
|
536
|
-
function
|
|
538
|
+
function p(c) {
|
|
537
539
|
c.forEach((d) => a(d));
|
|
538
540
|
}
|
|
539
541
|
function g(c) {
|
|
540
542
|
return e.get(c);
|
|
541
543
|
}
|
|
542
544
|
}
|
|
543
|
-
function
|
|
544
|
-
|
|
545
|
-
if (!(e in t))
|
|
546
|
-
throw new Error(`Key "${e}" not found in item ${JSON.stringify(t)}`);
|
|
547
|
-
return t[e];
|
|
548
|
-
}
|
|
549
|
-
return e(t);
|
|
550
|
-
}
|
|
551
|
-
function De(t) {
|
|
552
|
-
const e = P()(() => ({
|
|
545
|
+
function Re(t) {
|
|
546
|
+
const e = V()(() => ({
|
|
553
547
|
sections: /* @__PURE__ */ new Map(),
|
|
554
548
|
recordSections: /* @__PURE__ */ new Map(),
|
|
555
549
|
visibleRecords: [],
|
|
@@ -562,35 +556,35 @@ function De(t) {
|
|
|
562
556
|
useStore: e,
|
|
563
557
|
clearSections: a,
|
|
564
558
|
createSection: s,
|
|
565
|
-
getSections:
|
|
559
|
+
getSections: p,
|
|
566
560
|
getRecord: g,
|
|
567
561
|
getSectionsByParentId: c,
|
|
568
562
|
getRecordsByParentId: d,
|
|
569
563
|
getItemId: l
|
|
570
564
|
};
|
|
571
|
-
return t.plugins.registerPublicApi(o), { ...o, updateImplicitFilterKeys:
|
|
565
|
+
return t.plugins.registerPublicApi(o), { ...o, updateImplicitFilterKeys: S };
|
|
572
566
|
function s(r, i) {
|
|
573
|
-
const
|
|
574
|
-
id:
|
|
567
|
+
const h = Math.random().toString(), y = r.parentId ?? null, C = {
|
|
568
|
+
id: h,
|
|
575
569
|
visible: !0,
|
|
576
|
-
parentId:
|
|
570
|
+
parentId: y,
|
|
577
571
|
loadContext: r.loadContext,
|
|
578
572
|
records: []
|
|
579
573
|
}, w = t.config.itemKey ?? "id";
|
|
580
574
|
for (const [k, _] of i.entries()) {
|
|
581
|
-
const b =
|
|
575
|
+
const b = tt(_, w);
|
|
582
576
|
C.records.push({ id: b, item: _, index: k, section: C });
|
|
583
577
|
}
|
|
584
578
|
return e.setState((k) => {
|
|
585
579
|
const _ = new Map(k.sections), b = new Map(k.recordSections);
|
|
586
|
-
_.set(
|
|
587
|
-
const { visibleRecords: x, rootSections:
|
|
580
|
+
_.set(h, C), b.set(y, [...b.get(y) ?? [], h]);
|
|
581
|
+
const { visibleRecords: x, rootSections: L, visibleSections: E, hasActiveFilters: v } = u(_, b);
|
|
588
582
|
return {
|
|
589
583
|
sections: _,
|
|
590
584
|
recordSections: b,
|
|
591
585
|
visibleRecords: x,
|
|
592
|
-
rootSections:
|
|
593
|
-
visibleSections:
|
|
586
|
+
rootSections: L,
|
|
587
|
+
visibleSections: E,
|
|
594
588
|
hasActiveFilters: v
|
|
595
589
|
};
|
|
596
590
|
}), C;
|
|
@@ -605,86 +599,74 @@ function De(t) {
|
|
|
605
599
|
hasActiveFilters: !1
|
|
606
600
|
});
|
|
607
601
|
}
|
|
608
|
-
function
|
|
602
|
+
function p() {
|
|
609
603
|
return [...e.getState().sections.values()];
|
|
610
604
|
}
|
|
611
605
|
function g(r) {
|
|
612
606
|
for (const i of e.getState().sections.values()) {
|
|
613
|
-
const
|
|
614
|
-
if (
|
|
615
|
-
return
|
|
607
|
+
const h = i.records.find((y) => y.id === r);
|
|
608
|
+
if (h)
|
|
609
|
+
return h;
|
|
616
610
|
}
|
|
617
611
|
}
|
|
618
612
|
function c(r) {
|
|
619
613
|
const i = e.getState();
|
|
620
|
-
return (i.recordSections.get(r) ?? []).map((
|
|
614
|
+
return (i.recordSections.get(r) ?? []).map((y) => i.sections.get(y)).filter(Boolean);
|
|
621
615
|
}
|
|
622
616
|
function d(r) {
|
|
623
617
|
return c(r).flatMap((i) => i.records);
|
|
624
618
|
}
|
|
625
619
|
function l(r) {
|
|
626
620
|
const i = t.config.itemKey ?? "id";
|
|
627
|
-
return
|
|
621
|
+
return tt(r, i);
|
|
628
622
|
}
|
|
629
|
-
function
|
|
623
|
+
function f(r) {
|
|
630
624
|
return r == null ? !1 : typeof r == "boolean" ? !0 : Array.isArray(r) ? r.length > 0 : !!r;
|
|
631
625
|
}
|
|
632
|
-
function
|
|
633
|
-
n !== r && (n = r, e.setState((i) =>
|
|
626
|
+
function S(r) {
|
|
627
|
+
n !== r && (n = r, e.setState((i) => u(i.sections, i.recordSections)));
|
|
634
628
|
}
|
|
635
|
-
function
|
|
636
|
-
const
|
|
629
|
+
function u(r, i) {
|
|
630
|
+
const y = [...r.values()].filter((b) => b.visible), w = (i.get(null) ?? []).map((b) => r.get(b)).filter((b) => b.visible), k = y.flatMap((b) => b.records), _ = y.some((b) => {
|
|
637
631
|
const { filters: x } = b.loadContext;
|
|
638
632
|
return x ? Object.entries(x).some(
|
|
639
|
-
([
|
|
633
|
+
([L, E]) => !n.includes(L) && f(E == null ? void 0 : E.value)
|
|
640
634
|
) : !1;
|
|
641
635
|
});
|
|
642
636
|
return {
|
|
643
|
-
visibleSections:
|
|
637
|
+
visibleSections: y,
|
|
644
638
|
rootSections: w,
|
|
645
639
|
visibleRecords: k,
|
|
646
640
|
hasActiveFilters: _
|
|
647
641
|
};
|
|
648
642
|
}
|
|
649
643
|
}
|
|
650
|
-
function
|
|
651
|
-
|
|
652
|
-
item: e
|
|
653
|
-
}) {
|
|
654
|
-
if (t.render)
|
|
655
|
-
return typeof t.render == "function" ? /* @__PURE__ */ f(M, { children: t.render(e) }) : /* @__PURE__ */ f(M, { children: t.render });
|
|
656
|
-
if (t.component) {
|
|
657
|
-
const n = t.component, o = t.key ?? t.id, s = o.includes(".") ? Ot(e, o) : e[o];
|
|
658
|
-
return /* @__PURE__ */ f(n, { item: e, column: t, value: s });
|
|
659
|
-
}
|
|
660
|
-
return /* @__PURE__ */ f(M, { children: At(t, e) });
|
|
661
|
-
}
|
|
662
|
-
function Me({ children: t }) {
|
|
663
|
-
return /* @__PURE__ */ f(M, { children: t });
|
|
644
|
+
function Oe({ children: t }) {
|
|
645
|
+
return /* @__PURE__ */ m(N, { children: t });
|
|
664
646
|
}
|
|
665
|
-
function
|
|
647
|
+
function Ae({
|
|
666
648
|
column: t
|
|
667
649
|
}) {
|
|
668
|
-
return /* @__PURE__ */
|
|
650
|
+
return /* @__PURE__ */ m("span", { children: q(t.label) });
|
|
669
651
|
}
|
|
670
|
-
const
|
|
671
|
-
headerCell:
|
|
672
|
-
headerCellContent:
|
|
673
|
-
extraHeaderCell:
|
|
652
|
+
const We = "_headerCell_18ulc_1", He = "_headerCellContent_18ulc_13", Ne = "_extraHeaderCell_18ulc_21", K = {
|
|
653
|
+
headerCell: We,
|
|
654
|
+
headerCellContent: He,
|
|
655
|
+
extraHeaderCell: Ne
|
|
674
656
|
};
|
|
675
657
|
function Ct({ children: t }) {
|
|
676
|
-
return /* @__PURE__ */
|
|
658
|
+
return /* @__PURE__ */ m("span", { className: K.headerCellContent, children: t });
|
|
677
659
|
}
|
|
678
660
|
function bt({
|
|
679
661
|
group: t,
|
|
680
662
|
colspan: e,
|
|
681
663
|
className: n
|
|
682
664
|
}) {
|
|
683
|
-
const s =
|
|
684
|
-
return /* @__PURE__ */
|
|
685
|
-
|
|
665
|
+
const s = P().useGroupStickyOffset(t.id), a = s !== void 0, p = t.component, g = p ? /* @__PURE__ */ m(p, { group: t }) : /* @__PURE__ */ m(Ct, { children: q(t.label) });
|
|
666
|
+
return /* @__PURE__ */ m(
|
|
667
|
+
Pt,
|
|
686
668
|
{
|
|
687
|
-
className:
|
|
669
|
+
className: W(Ht.cell, K.headerCell, n),
|
|
688
670
|
pinned: a,
|
|
689
671
|
style: a ? { insetInlineStart: `${s}px` } : void 0,
|
|
690
672
|
scope: "col",
|
|
@@ -693,50 +675,39 @@ function bt({
|
|
|
693
675
|
}
|
|
694
676
|
);
|
|
695
677
|
}
|
|
696
|
-
function
|
|
697
|
-
const e =
|
|
678
|
+
function Ve({ record: t }) {
|
|
679
|
+
const e = P(), n = e.useVisibleColumns(), o = e.useTableLayout(), s = e.useComponent(
|
|
698
680
|
"body-cell-content"
|
|
699
681
|
);
|
|
700
|
-
return /* @__PURE__ */
|
|
701
|
-
/* @__PURE__ */
|
|
682
|
+
return /* @__PURE__ */ m(zt, { value: t, children: /* @__PURE__ */ G(Y, { children: [
|
|
683
|
+
/* @__PURE__ */ m(et, { position: "start" }),
|
|
702
684
|
n.map((a) => {
|
|
703
685
|
var c;
|
|
704
|
-
const
|
|
705
|
-
return /* @__PURE__ */
|
|
686
|
+
const p = (c = a.getClassName) == null ? void 0 : c.call(a, t.item), g = Nt(a, t.item, o);
|
|
687
|
+
return /* @__PURE__ */ m(
|
|
706
688
|
X,
|
|
707
689
|
{
|
|
708
690
|
columnId: a.id,
|
|
709
|
-
className:
|
|
691
|
+
className: p,
|
|
710
692
|
...g,
|
|
711
|
-
children: /* @__PURE__ */
|
|
693
|
+
children: /* @__PURE__ */ m(s, { column: a, item: t.item })
|
|
712
694
|
},
|
|
713
695
|
a.id
|
|
714
696
|
);
|
|
715
697
|
}),
|
|
716
|
-
/* @__PURE__ */
|
|
698
|
+
/* @__PURE__ */ m(et, { position: "end" })
|
|
717
699
|
] }) });
|
|
718
700
|
}
|
|
719
|
-
const
|
|
720
|
-
tableWrapper:
|
|
721
|
-
table:
|
|
722
|
-
layoutFixed:
|
|
723
|
-
layoutAuto:
|
|
724
|
-
tableBordered:
|
|
701
|
+
const Pe = "_tableWrapper_6b0cm_6", Te = "_table_6b0cm_6", Fe = "_layoutFixed_6b0cm_39", Be = "_layoutAuto_6b0cm_46", ze = "_tableBordered_6b0cm_53", B = {
|
|
702
|
+
tableWrapper: Pe,
|
|
703
|
+
table: Te,
|
|
704
|
+
layoutFixed: Fe,
|
|
705
|
+
layoutAuto: Be,
|
|
706
|
+
tableBordered: ze
|
|
725
707
|
};
|
|
726
|
-
function
|
|
727
|
-
record: t
|
|
728
|
-
}) {
|
|
729
|
-
const n = N().useComponent("row");
|
|
730
|
-
return /* @__PURE__ */ f(n, { record: t });
|
|
731
|
-
}
|
|
732
|
-
function $e({
|
|
733
|
-
records: t
|
|
734
|
-
}) {
|
|
735
|
-
return /* @__PURE__ */ f(M, { children: t.map((e) => /* @__PURE__ */ f(Be, { record: e }, e.id)) });
|
|
736
|
-
}
|
|
737
|
-
function ze() {
|
|
708
|
+
function $e() {
|
|
738
709
|
const e = j().useStore((n) => n.rootSections);
|
|
739
|
-
return /* @__PURE__ */
|
|
710
|
+
return /* @__PURE__ */ m(N, { children: e.map((n) => /* @__PURE__ */ m(Tt, { children: /* @__PURE__ */ m(At, { records: n.records }) }, n.id)) });
|
|
740
711
|
}
|
|
741
712
|
function je({
|
|
742
713
|
column: t,
|
|
@@ -744,16 +715,16 @@ function je({
|
|
|
744
715
|
className: n,
|
|
745
716
|
children: o
|
|
746
717
|
}) {
|
|
747
|
-
return /* @__PURE__ */
|
|
718
|
+
return /* @__PURE__ */ m(
|
|
748
719
|
X,
|
|
749
720
|
{
|
|
750
721
|
header: !0,
|
|
751
722
|
columnId: t.id,
|
|
752
|
-
className:
|
|
723
|
+
className: W(K.extraHeaderCell, n),
|
|
753
724
|
width: t.width,
|
|
754
725
|
rowspan: e,
|
|
755
726
|
ignoreRowClick: t.ignoreRowClick,
|
|
756
|
-
children: o ? /* @__PURE__ */
|
|
727
|
+
children: o ? /* @__PURE__ */ m(Ct, { children: o }) : null
|
|
757
728
|
}
|
|
758
729
|
);
|
|
759
730
|
}
|
|
@@ -762,14 +733,14 @@ function it({
|
|
|
762
733
|
isGroupRow: e,
|
|
763
734
|
className: n
|
|
764
735
|
}) {
|
|
765
|
-
const o =
|
|
766
|
-
return /* @__PURE__ */
|
|
736
|
+
const o = P(), s = o.useHasGroups(), a = o.useExtraColumns(t), p = !s || e;
|
|
737
|
+
return /* @__PURE__ */ m(N, { children: a.map((g) => /* @__PURE__ */ m(
|
|
767
738
|
je,
|
|
768
739
|
{
|
|
769
740
|
column: g,
|
|
770
|
-
rowspan:
|
|
741
|
+
rowspan: p && s ? 2 : void 0,
|
|
771
742
|
className: n,
|
|
772
|
-
children:
|
|
743
|
+
children: p && g.header ? /* @__PURE__ */ m(g.header, {}) : null
|
|
773
744
|
},
|
|
774
745
|
g.id
|
|
775
746
|
)) });
|
|
@@ -782,8 +753,8 @@ function Ke(t) {
|
|
|
782
753
|
function e(o, s) {
|
|
783
754
|
const a = t.getState().minContentWidths;
|
|
784
755
|
if (a.get(o) === s) return;
|
|
785
|
-
const
|
|
786
|
-
|
|
756
|
+
const p = new Map(a);
|
|
757
|
+
p.set(o, s), t.setState({ minContentWidths: p });
|
|
787
758
|
}
|
|
788
759
|
function n(o) {
|
|
789
760
|
return t((s) => s.minContentWidths.get(o));
|
|
@@ -799,16 +770,16 @@ function at({
|
|
|
799
770
|
headerCellEndSlots: n,
|
|
800
771
|
className: o
|
|
801
772
|
}) {
|
|
802
|
-
const s =
|
|
773
|
+
const s = P(), a = $(null), p = s.useComponent("header-cell-label"), g = s.useTableLayout(), c = s.useMinContentWidth(t.id), d = t.headerComponent ? /* @__PURE__ */ m(t.headerComponent, { column: t }) : (
|
|
803
774
|
// eslint-disable-next-line react-hooks/static-components -- LabelComponent comes from the grid's component registry (a store lookup), so it is the same component on every render; the rule cannot see through the lookup.
|
|
804
|
-
/* @__PURE__ */
|
|
805
|
-
), l = t.headerOverflow ?? "nowrap",
|
|
775
|
+
/* @__PURE__ */ m(p, { column: t })
|
|
776
|
+
), l = t.headerOverflow ?? "nowrap", f = t.width === "min-content", S = f ? void 0 : l, { headerStyle: u, contentVars: r, isCapped: i } = Vt(
|
|
806
777
|
t,
|
|
807
778
|
g,
|
|
808
779
|
c
|
|
809
|
-
),
|
|
810
|
-
return
|
|
811
|
-
if (!
|
|
780
|
+
), h = !t.headerComponent && l === "nowrap" ? q(t.label) : void 0, y = !!t.headerComponent && !f;
|
|
781
|
+
return M(() => {
|
|
782
|
+
if (!f) return;
|
|
812
783
|
const C = a.current;
|
|
813
784
|
if (!C) return;
|
|
814
785
|
const w = C.closest("th, td"), k = new ResizeObserver((_) => {
|
|
@@ -816,22 +787,22 @@ function at({
|
|
|
816
787
|
s.setMinContentWidth(t.id, Ue(b, w));
|
|
817
788
|
});
|
|
818
789
|
return k.observe(C), () => k.disconnect();
|
|
819
|
-
}, [
|
|
790
|
+
}, [f, t.id, s]), /* @__PURE__ */ m(
|
|
820
791
|
X,
|
|
821
792
|
{
|
|
822
793
|
header: !0,
|
|
823
794
|
columnId: t.id,
|
|
824
|
-
className:
|
|
825
|
-
style: { ...
|
|
795
|
+
className: W(K.headerCell, o),
|
|
796
|
+
style: { ...u, ...r },
|
|
826
797
|
rowspan: e,
|
|
827
|
-
overflow:
|
|
828
|
-
capped:
|
|
829
|
-
title:
|
|
830
|
-
contentRowRef:
|
|
831
|
-
fillContent:
|
|
798
|
+
overflow: S,
|
|
799
|
+
capped: f ? void 0 : i,
|
|
800
|
+
title: h,
|
|
801
|
+
contentRowRef: f ? a : void 0,
|
|
802
|
+
fillContent: y,
|
|
832
803
|
endSlot: n.map((C) => {
|
|
833
804
|
const w = C.component;
|
|
834
|
-
return /* @__PURE__ */
|
|
805
|
+
return /* @__PURE__ */ m(w, { column: t }, C.id);
|
|
835
806
|
}),
|
|
836
807
|
children: d
|
|
837
808
|
}
|
|
@@ -841,16 +812,16 @@ const Ye = "_theadSticky_167rm_11", Je = {
|
|
|
841
812
|
theadSticky: Ye
|
|
842
813
|
};
|
|
843
814
|
function qe() {
|
|
844
|
-
const t =
|
|
845
|
-
return
|
|
815
|
+
const t = P(), e = $(null), n = $(null), o = t.useHasGroups(), s = t.useStickyHeader(), a = t.useFirstRowHeaderCells(), p = t.useSecondRowHeaderColumns(), g = t.useSlots("header-cell-end");
|
|
816
|
+
return M(() => {
|
|
846
817
|
const c = e.current;
|
|
847
818
|
if (!c) return;
|
|
848
819
|
n.current = new ResizeObserver((l) => {
|
|
849
|
-
var
|
|
850
|
-
for (const
|
|
851
|
-
const { columnId: r } =
|
|
820
|
+
var f, S;
|
|
821
|
+
for (const u of l) {
|
|
822
|
+
const { columnId: r } = u.target.dataset;
|
|
852
823
|
if (r) {
|
|
853
|
-
const i = ((
|
|
824
|
+
const i = ((S = (f = u.borderBoxSize) == null ? void 0 : f[0]) == null ? void 0 : S.inlineSize) ?? u.contentRect.width;
|
|
854
825
|
t.onResizeColumn(r, i);
|
|
855
826
|
}
|
|
856
827
|
}
|
|
@@ -862,21 +833,21 @@ function qe() {
|
|
|
862
833
|
var l;
|
|
863
834
|
(l = n.current) == null || l.disconnect();
|
|
864
835
|
};
|
|
865
|
-
}, [t, a,
|
|
866
|
-
|
|
836
|
+
}, [t, a, p]), /* @__PURE__ */ G(
|
|
837
|
+
Ft,
|
|
867
838
|
{
|
|
868
839
|
ref: e,
|
|
869
|
-
className:
|
|
840
|
+
className: W(s && o && Je.theadSticky),
|
|
870
841
|
children: [
|
|
871
842
|
/* @__PURE__ */ G(Y, { children: [
|
|
872
|
-
/* @__PURE__ */
|
|
843
|
+
/* @__PURE__ */ m(it, { position: "start", isGroupRow: !0 }),
|
|
873
844
|
a.map((c) => {
|
|
874
845
|
if (c.type === "group") {
|
|
875
846
|
const l = c.item;
|
|
876
|
-
return /* @__PURE__ */
|
|
847
|
+
return /* @__PURE__ */ m(bt, { group: l, colspan: c.colspan }, l.id);
|
|
877
848
|
}
|
|
878
849
|
const d = c.item;
|
|
879
|
-
return /* @__PURE__ */
|
|
850
|
+
return /* @__PURE__ */ m(
|
|
880
851
|
at,
|
|
881
852
|
{
|
|
882
853
|
column: d,
|
|
@@ -886,9 +857,9 @@ function qe() {
|
|
|
886
857
|
d.id
|
|
887
858
|
);
|
|
888
859
|
}),
|
|
889
|
-
/* @__PURE__ */
|
|
860
|
+
/* @__PURE__ */ m(it, { position: "end", isGroupRow: !0 })
|
|
890
861
|
] }),
|
|
891
|
-
o &&
|
|
862
|
+
o && p.length > 0 && /* @__PURE__ */ m(Y, { children: p.map((c) => /* @__PURE__ */ m(
|
|
892
863
|
at,
|
|
893
864
|
{
|
|
894
865
|
column: c,
|
|
@@ -901,9 +872,9 @@ function qe() {
|
|
|
901
872
|
);
|
|
902
873
|
}
|
|
903
874
|
function ct({ slots: t }) {
|
|
904
|
-
return t.length === 0 ? null : /* @__PURE__ */
|
|
875
|
+
return t.length === 0 ? null : /* @__PURE__ */ m(N, { children: t.map((e) => {
|
|
905
876
|
const n = e.component;
|
|
906
|
-
return /* @__PURE__ */
|
|
877
|
+
return /* @__PURE__ */ m(n, {}, e.id);
|
|
907
878
|
}) });
|
|
908
879
|
}
|
|
909
880
|
const Xe = {
|
|
@@ -911,20 +882,21 @@ const Xe = {
|
|
|
911
882
|
auto: B.layoutAuto
|
|
912
883
|
};
|
|
913
884
|
function Qe() {
|
|
914
|
-
const t =
|
|
885
|
+
const t = P(), e = Mt(), n = t.useHasGroups(), o = t.useSlots("subheader"), s = t.useSlots("footer"), a = t.useTableLayout(), p = t.useStickyHeader(), g = t.useComponent("content");
|
|
915
886
|
return (
|
|
916
887
|
// eslint-disable-next-line react-hooks/static-components -- ContentWrapper comes from the grid's component registry (a store lookup), so it is the same component on every render; the rule cannot see through the lookup.
|
|
917
|
-
/* @__PURE__ */
|
|
918
|
-
|
|
888
|
+
/* @__PURE__ */ m(g, { children: /* @__PURE__ */ G(
|
|
889
|
+
Bt,
|
|
919
890
|
{
|
|
920
|
-
stickyHeader:
|
|
891
|
+
stickyHeader: p,
|
|
892
|
+
label: e,
|
|
921
893
|
containerClassName: B.tableWrapper,
|
|
922
|
-
className:
|
|
894
|
+
className: W(B.table, Xe[a], n && B.tableBordered),
|
|
923
895
|
children: [
|
|
924
|
-
/* @__PURE__ */
|
|
925
|
-
/* @__PURE__ */
|
|
926
|
-
/* @__PURE__ */
|
|
927
|
-
/* @__PURE__ */
|
|
896
|
+
/* @__PURE__ */ m(qe, {}),
|
|
897
|
+
/* @__PURE__ */ m(ct, { slots: o }),
|
|
898
|
+
/* @__PURE__ */ m($e, {}),
|
|
899
|
+
/* @__PURE__ */ m(ct, { slots: s })
|
|
928
900
|
]
|
|
929
901
|
}
|
|
930
902
|
) })
|
|
@@ -935,10 +907,10 @@ function tn(t, e, n) {
|
|
|
935
907
|
const o = /* @__PURE__ */ new Set(), s = /* @__PURE__ */ new Set();
|
|
936
908
|
let a = !1;
|
|
937
909
|
return {
|
|
938
|
-
initializeColumns:
|
|
939
|
-
useVisibleColumns:
|
|
910
|
+
initializeColumns: u,
|
|
911
|
+
useVisibleColumns: S
|
|
940
912
|
};
|
|
941
|
-
function
|
|
913
|
+
function p(r) {
|
|
942
914
|
if (!Ze.test(r))
|
|
943
915
|
throw new Error(`Column id "${r}" must be snake_case (e.g., "user_name", "is_active").`);
|
|
944
916
|
}
|
|
@@ -949,59 +921,59 @@ function tn(t, e, n) {
|
|
|
949
921
|
}
|
|
950
922
|
function c(r, i) {
|
|
951
923
|
i !== "fixed" || process.env.NODE_ENV === "production" || r.width === "min-content" || [r.width, r.minWidth, r.maxWidth].filter(
|
|
952
|
-
(
|
|
924
|
+
(y) => y !== void 0
|
|
953
925
|
).length <= 1 || o.has(r.id) || (o.add(r.id), console.warn(
|
|
954
926
|
`[DataGrid] Column "${r.id}": width, minWidth, and maxWidth cannot all apply under tableLayout="fixed" -- they collapse to a single track (width wins when set). Use tableLayout="auto" for independent min/max constraints, or drop the extra prop(s).`
|
|
955
927
|
));
|
|
956
928
|
}
|
|
957
929
|
function d(r, i) {
|
|
958
930
|
i !== "auto" || process.env.NODE_ENV === "production" || a || r.length === 0 || !r.every(
|
|
959
|
-
(
|
|
931
|
+
(y) => y.width !== void 0 || y.maxWidth !== void 0
|
|
960
932
|
) || (a = !0, console.warn(
|
|
961
933
|
'[DataGrid] Every column has a width or maxWidth under tableLayout="auto" -- if the container is wider than their sum, the browser will grow columns past their caps and capped content will show trailing blank space. Leave at least one column without a width/maxWidth to absorb the extra space.'
|
|
962
934
|
));
|
|
963
935
|
}
|
|
964
936
|
function l(r) {
|
|
965
937
|
const i = [];
|
|
966
|
-
for (const
|
|
967
|
-
if (
|
|
968
|
-
for (const
|
|
969
|
-
i.push(g({ ...
|
|
938
|
+
for (const h of r)
|
|
939
|
+
if (I(h))
|
|
940
|
+
for (const y of h.columns)
|
|
941
|
+
i.push(g({ ...y, groupId: h.id }));
|
|
970
942
|
else
|
|
971
|
-
i.push(g(
|
|
943
|
+
i.push(g(h));
|
|
972
944
|
return i;
|
|
973
945
|
}
|
|
974
|
-
function
|
|
975
|
-
const i = /* @__PURE__ */ new Map(),
|
|
976
|
-
function
|
|
977
|
-
i.set(C.id, C.visible ?? !0), C.visibleToggleDisabled &&
|
|
946
|
+
function f(r) {
|
|
947
|
+
const i = /* @__PURE__ */ new Map(), h = /* @__PURE__ */ new Set();
|
|
948
|
+
function y(C) {
|
|
949
|
+
i.set(C.id, C.visible ?? !0), C.visibleToggleDisabled && h.add(C.id);
|
|
978
950
|
}
|
|
979
951
|
for (const C of r)
|
|
980
|
-
if (
|
|
952
|
+
if (I(C))
|
|
981
953
|
for (const w of C.columns)
|
|
982
|
-
|
|
954
|
+
y(w);
|
|
983
955
|
else
|
|
984
|
-
|
|
956
|
+
y(C);
|
|
985
957
|
for (const [C, w] of Object.entries((n == null ? void 0 : n.read()) ?? {}))
|
|
986
|
-
i.has(C) && !
|
|
958
|
+
i.has(C) && !h.has(C) && i.set(C, w);
|
|
987
959
|
return i;
|
|
988
960
|
}
|
|
989
|
-
function
|
|
961
|
+
function S() {
|
|
990
962
|
return t(
|
|
991
963
|
J((r) => {
|
|
992
|
-
const i = r.flatColumns.filter((
|
|
964
|
+
const i = r.flatColumns.filter((h) => r.columnVisibility.get(h.id) !== !1);
|
|
993
965
|
return e.getOrderedColumnsWithSticky(i, r.columnSticky);
|
|
994
966
|
})
|
|
995
967
|
);
|
|
996
968
|
}
|
|
997
|
-
function
|
|
998
|
-
const i = l(r), { tableLayout:
|
|
999
|
-
for (const
|
|
1000
|
-
|
|
1001
|
-
return d(i,
|
|
969
|
+
function u(r) {
|
|
970
|
+
const i = l(r), { tableLayout: h } = t.getState();
|
|
971
|
+
for (const y of i)
|
|
972
|
+
p(y.id), c(y, h);
|
|
973
|
+
return d(i, h), {
|
|
1002
974
|
columns: r,
|
|
1003
975
|
flatColumns: i,
|
|
1004
|
-
columnVisibility:
|
|
976
|
+
columnVisibility: f(r)
|
|
1005
977
|
};
|
|
1006
978
|
}
|
|
1007
979
|
}
|
|
@@ -1017,7 +989,7 @@ function nn(t) {
|
|
|
1017
989
|
var a;
|
|
1018
990
|
const s = (a = e.value) == null ? void 0 : a.columns;
|
|
1019
991
|
return typeof s != "object" || s === null || Array.isArray(s) ? {} : Object.fromEntries(
|
|
1020
|
-
Object.entries(s).filter(([,
|
|
992
|
+
Object.entries(s).filter(([, p]) => typeof p == "boolean")
|
|
1021
993
|
);
|
|
1022
994
|
}
|
|
1023
995
|
function o(s, a) {
|
|
@@ -1030,21 +1002,21 @@ function on(t) {
|
|
|
1030
1002
|
registerExtraColumn: n,
|
|
1031
1003
|
updateExtraColumnWidth: s,
|
|
1032
1004
|
updateExtraColumnOrder: a,
|
|
1033
|
-
updateExtraColumnSticky:
|
|
1005
|
+
updateExtraColumnSticky: p,
|
|
1034
1006
|
useExtraColumns: g
|
|
1035
1007
|
};
|
|
1036
1008
|
function n(c) {
|
|
1037
|
-
const d = t.getState(), l = c.position ?? "end",
|
|
1009
|
+
const d = t.getState(), l = c.position ?? "end", f = l === "start" ? d.extraColumnsStart : d.extraColumnsEnd, S = c.order ?? (f.length + 1) * 10, u = {
|
|
1038
1010
|
id: c.id ?? Math.random().toString(36).slice(2),
|
|
1039
1011
|
header: c.header,
|
|
1040
1012
|
body: c.body,
|
|
1041
1013
|
width: c.width,
|
|
1042
1014
|
sticky: c.sticky,
|
|
1043
1015
|
ignoreRowClick: c.ignoreRowClick,
|
|
1044
|
-
order:
|
|
1016
|
+
order: S,
|
|
1045
1017
|
position: l
|
|
1046
|
-
}, r = [...
|
|
1047
|
-
l === "start" ? (o(
|
|
1018
|
+
}, r = [...f, u].sort((i, h) => i.order - h.order);
|
|
1019
|
+
l === "start" ? (o(u.id, u.sticky), t.setState({ extraColumnsStart: r })) : t.setState({ extraColumnsEnd: r });
|
|
1048
1020
|
}
|
|
1049
1021
|
function o(c, d) {
|
|
1050
1022
|
process.env.NODE_ENV !== "production" && d && (e.has(c) || (e.add(c), console.warn(
|
|
@@ -1053,41 +1025,41 @@ function on(t) {
|
|
|
1053
1025
|
}
|
|
1054
1026
|
function s(c, d) {
|
|
1055
1027
|
const l = t.getState();
|
|
1056
|
-
function
|
|
1057
|
-
const i = r.findIndex((
|
|
1028
|
+
function f(r) {
|
|
1029
|
+
const i = r.findIndex((y) => y.id === c);
|
|
1058
1030
|
if (i === -1) return;
|
|
1059
|
-
const
|
|
1060
|
-
return
|
|
1031
|
+
const h = [...r];
|
|
1032
|
+
return h[i] = { ...h[i], width: d }, h;
|
|
1061
1033
|
}
|
|
1062
|
-
const
|
|
1063
|
-
if (
|
|
1064
|
-
t.setState({ extraColumnsStart:
|
|
1034
|
+
const S = f(l.extraColumnsStart);
|
|
1035
|
+
if (S) {
|
|
1036
|
+
t.setState({ extraColumnsStart: S });
|
|
1065
1037
|
return;
|
|
1066
1038
|
}
|
|
1067
|
-
const
|
|
1068
|
-
|
|
1039
|
+
const u = f(l.extraColumnsEnd);
|
|
1040
|
+
u && t.setState({ extraColumnsEnd: u });
|
|
1069
1041
|
}
|
|
1070
1042
|
function a(c, d) {
|
|
1071
1043
|
const l = t.getState();
|
|
1072
|
-
function
|
|
1073
|
-
const i = r.findIndex((
|
|
1044
|
+
function f(r) {
|
|
1045
|
+
const i = r.findIndex((y) => y.id === c);
|
|
1074
1046
|
if (i === -1) return;
|
|
1075
|
-
const
|
|
1076
|
-
return
|
|
1047
|
+
const h = [...r];
|
|
1048
|
+
return h[i] = { ...h[i], order: d }, h.sort((y, C) => y.order - C.order);
|
|
1077
1049
|
}
|
|
1078
|
-
const
|
|
1079
|
-
if (
|
|
1080
|
-
t.setState({ extraColumnsStart:
|
|
1050
|
+
const S = f(l.extraColumnsStart);
|
|
1051
|
+
if (S) {
|
|
1052
|
+
t.setState({ extraColumnsStart: S });
|
|
1081
1053
|
return;
|
|
1082
1054
|
}
|
|
1083
|
-
const
|
|
1084
|
-
|
|
1055
|
+
const u = f(l.extraColumnsEnd);
|
|
1056
|
+
u && t.setState({ extraColumnsEnd: u });
|
|
1085
1057
|
}
|
|
1086
|
-
function
|
|
1087
|
-
const l = t.getState(),
|
|
1088
|
-
if (r === -1 || (
|
|
1089
|
-
const i = [...
|
|
1090
|
-
i[r] = { ...i[r], sticky: d }, t.setState({ [
|
|
1058
|
+
function p(c, d) {
|
|
1059
|
+
const l = t.getState(), f = l.extraColumnsStart.some((h) => h.id === c), S = f ? "extraColumnsStart" : "extraColumnsEnd", u = l[S], r = u.findIndex((h) => h.id === c);
|
|
1060
|
+
if (r === -1 || (f && o(c, d), (u[r].sticky ?? !1) === d)) return;
|
|
1061
|
+
const i = [...u];
|
|
1062
|
+
i[r] = { ...i[r], sticky: d }, t.setState({ [S]: i });
|
|
1091
1063
|
}
|
|
1092
1064
|
function g(c) {
|
|
1093
1065
|
return t((d) => c === "start" ? d.extraColumnsStart : d.extraColumnsEnd);
|
|
@@ -1098,72 +1070,72 @@ function rn(t, e, n) {
|
|
|
1098
1070
|
let s = null, a = null;
|
|
1099
1071
|
return {
|
|
1100
1072
|
useHasGroups: l,
|
|
1101
|
-
useFirstRowHeaderCells:
|
|
1102
|
-
useSecondRowHeaderColumns:
|
|
1073
|
+
useFirstRowHeaderCells: f,
|
|
1074
|
+
useSecondRowHeaderColumns: S
|
|
1103
1075
|
};
|
|
1104
|
-
function
|
|
1105
|
-
const
|
|
1106
|
-
return e.getOrderedColumnsWithSticky(r,
|
|
1076
|
+
function p() {
|
|
1077
|
+
const u = t.getState(), r = u.flatColumns.filter((i) => u.columnVisibility.get(i.id) !== !1);
|
|
1078
|
+
return e.getOrderedColumnsWithSticky(r, u.columnSticky);
|
|
1107
1079
|
}
|
|
1108
1080
|
function g() {
|
|
1109
|
-
return t.getState().columns.some(
|
|
1081
|
+
return t.getState().columns.some(I);
|
|
1110
1082
|
}
|
|
1111
1083
|
function c() {
|
|
1112
|
-
const
|
|
1084
|
+
const u = t.getState(), r = p();
|
|
1113
1085
|
if (!g()) {
|
|
1114
|
-
const
|
|
1086
|
+
const y = u.components.get("header-cell") ?? n.get("header-cell");
|
|
1115
1087
|
return r.map((C) => ({
|
|
1116
1088
|
type: "column",
|
|
1117
1089
|
item: C,
|
|
1118
|
-
component:
|
|
1090
|
+
component: y
|
|
1119
1091
|
}));
|
|
1120
1092
|
}
|
|
1121
|
-
const i = new Map(r.map((
|
|
1122
|
-
return [...
|
|
1123
|
-
const w =
|
|
1093
|
+
const i = new Map(r.map((y, C) => [y.id, C]));
|
|
1094
|
+
return [...u.columns].sort((y, C) => {
|
|
1095
|
+
const w = I(y) ? Math.min(...y.columns.map((_) => i.get(_.id) ?? 1 / 0)) : i.get(y.id) ?? 1 / 0, k = I(C) ? Math.min(...C.columns.map((_) => i.get(_.id) ?? 1 / 0)) : i.get(C.id) ?? 1 / 0;
|
|
1124
1096
|
return w - k;
|
|
1125
|
-
}).flatMap((
|
|
1126
|
-
if (
|
|
1127
|
-
const C =
|
|
1128
|
-
(w) =>
|
|
1097
|
+
}).flatMap((y) => {
|
|
1098
|
+
if (I(y)) {
|
|
1099
|
+
const C = y.columns.filter(
|
|
1100
|
+
(w) => u.columnVisibility.get(w.id) !== !1
|
|
1129
1101
|
).length;
|
|
1130
1102
|
return C === 0 ? [] : {
|
|
1131
1103
|
type: "group",
|
|
1132
|
-
item:
|
|
1133
|
-
component:
|
|
1104
|
+
item: y,
|
|
1105
|
+
component: u.components.get("header-group") ?? n.get("header-group"),
|
|
1134
1106
|
colspan: C
|
|
1135
1107
|
};
|
|
1136
1108
|
}
|
|
1137
|
-
return
|
|
1109
|
+
return u.columnVisibility.get(y.id) === !1 ? [] : {
|
|
1138
1110
|
type: "column",
|
|
1139
|
-
item:
|
|
1140
|
-
component:
|
|
1111
|
+
item: y,
|
|
1112
|
+
component: u.components.get("header-cell") ?? n.get("header-cell"),
|
|
1141
1113
|
rowspan: 2
|
|
1142
1114
|
};
|
|
1143
1115
|
});
|
|
1144
1116
|
}
|
|
1145
1117
|
function d() {
|
|
1146
1118
|
if (!g()) return o;
|
|
1147
|
-
const
|
|
1148
|
-
return
|
|
1119
|
+
const u = t.getState();
|
|
1120
|
+
return p().filter((i) => i.groupId && u.columnVisibility.get(i.id) !== !1);
|
|
1149
1121
|
}
|
|
1150
1122
|
function l() {
|
|
1151
|
-
return t((
|
|
1123
|
+
return t((u) => u.columns.some(I));
|
|
1152
1124
|
}
|
|
1153
|
-
function
|
|
1154
|
-
return t((
|
|
1155
|
-
if (s !== null && s.state ===
|
|
1125
|
+
function f() {
|
|
1126
|
+
return t((u) => {
|
|
1127
|
+
if (s !== null && s.state === u)
|
|
1156
1128
|
return s.result;
|
|
1157
1129
|
const r = c();
|
|
1158
|
-
return s = { state:
|
|
1130
|
+
return s = { state: u, result: r }, r;
|
|
1159
1131
|
});
|
|
1160
1132
|
}
|
|
1161
|
-
function
|
|
1162
|
-
return t((
|
|
1163
|
-
if (a !== null && a.state ===
|
|
1133
|
+
function S() {
|
|
1134
|
+
return t((u) => {
|
|
1135
|
+
if (a !== null && a.state === u)
|
|
1164
1136
|
return a.result;
|
|
1165
1137
|
const r = d();
|
|
1166
|
-
return a = { state:
|
|
1138
|
+
return a = { state: u, result: r }, r;
|
|
1167
1139
|
});
|
|
1168
1140
|
}
|
|
1169
1141
|
}
|
|
@@ -1174,13 +1146,13 @@ function sn(t) {
|
|
|
1174
1146
|
useSlots: n
|
|
1175
1147
|
};
|
|
1176
1148
|
function e(o, s) {
|
|
1177
|
-
const a = t.getState(),
|
|
1178
|
-
id:
|
|
1149
|
+
const a = t.getState(), p = Math.random().toString(36).slice(2), g = a.slots.get(o) ?? lt, c = s.order ?? (g.length + 1) * 10, d = {
|
|
1150
|
+
id: p,
|
|
1179
1151
|
name: o,
|
|
1180
1152
|
component: s.component,
|
|
1181
1153
|
order: c
|
|
1182
|
-
}, l = [...g, d].sort((
|
|
1183
|
-
|
|
1154
|
+
}, l = [...g, d].sort((S, u) => S.order - u.order), f = new Map(a.slots);
|
|
1155
|
+
f.set(o, l), t.setState({ slots: f });
|
|
1184
1156
|
}
|
|
1185
1157
|
function n(o) {
|
|
1186
1158
|
return t(J((s) => s.slots.get(o) ?? lt));
|
|
@@ -1194,32 +1166,32 @@ function cn(t) {
|
|
|
1194
1166
|
onResizeColumn: o,
|
|
1195
1167
|
isColumnSticky: s,
|
|
1196
1168
|
isGroupSticky: a,
|
|
1197
|
-
useColumnStickyOffset:
|
|
1169
|
+
useColumnStickyOffset: p,
|
|
1198
1170
|
useColumnEndStickyOffset: g,
|
|
1199
1171
|
useGroupStickyOffset: c
|
|
1200
1172
|
};
|
|
1201
1173
|
function e(l) {
|
|
1202
|
-
const
|
|
1203
|
-
for (const
|
|
1204
|
-
if (
|
|
1205
|
-
|
|
1206
|
-
for (const r of
|
|
1207
|
-
|
|
1174
|
+
const f = /* @__PURE__ */ new Map(), S = /* @__PURE__ */ new Map();
|
|
1175
|
+
for (const u of l)
|
|
1176
|
+
if (I(u)) {
|
|
1177
|
+
S.set(u.id, u.sticky ?? !1);
|
|
1178
|
+
for (const r of u.columns)
|
|
1179
|
+
f.set(r.id, r.sticky ?? u.sticky ?? !1);
|
|
1208
1180
|
} else
|
|
1209
|
-
|
|
1210
|
-
return { columnSticky:
|
|
1181
|
+
f.set(u.id, u.sticky ?? !1);
|
|
1182
|
+
return { columnSticky: f, groupSticky: S };
|
|
1211
1183
|
}
|
|
1212
|
-
function n(l,
|
|
1213
|
-
const
|
|
1184
|
+
function n(l, f) {
|
|
1185
|
+
const S = [], u = [];
|
|
1214
1186
|
for (const r of l)
|
|
1215
|
-
|
|
1216
|
-
return [...
|
|
1187
|
+
f.get(r.id) ? S.push(r) : u.push(r);
|
|
1188
|
+
return [...S, ...u];
|
|
1217
1189
|
}
|
|
1218
|
-
function o(l,
|
|
1219
|
-
const
|
|
1220
|
-
if (
|
|
1221
|
-
const
|
|
1222
|
-
|
|
1190
|
+
function o(l, f) {
|
|
1191
|
+
const S = t.getState().columnWidths;
|
|
1192
|
+
if (S.get(l) === f) return;
|
|
1193
|
+
const u = new Map(S);
|
|
1194
|
+
u.set(l, f), t.setState({ columnWidths: u });
|
|
1223
1195
|
}
|
|
1224
1196
|
function s(l) {
|
|
1225
1197
|
return t.getState().columnSticky.get(l) === !0;
|
|
@@ -1227,38 +1199,38 @@ function cn(t) {
|
|
|
1227
1199
|
function a(l) {
|
|
1228
1200
|
return t.getState().groupSticky.get(l) === !0;
|
|
1229
1201
|
}
|
|
1230
|
-
function
|
|
1231
|
-
return t((
|
|
1232
|
-
if (!
|
|
1233
|
-
let
|
|
1234
|
-
const
|
|
1235
|
-
for (const r of
|
|
1202
|
+
function p(l) {
|
|
1203
|
+
return t((f) => {
|
|
1204
|
+
if (!f.columnSticky.get(l)) return ln(f, l);
|
|
1205
|
+
let S = d(f);
|
|
1206
|
+
const u = f.flatColumns.filter((r) => f.columnVisibility.get(r.id) !== !1);
|
|
1207
|
+
for (const r of u) {
|
|
1236
1208
|
if (r.id === l) break;
|
|
1237
|
-
|
|
1209
|
+
f.columnSticky.get(r.id) && (S += f.columnWidths.get(r.id) ?? 0);
|
|
1238
1210
|
}
|
|
1239
|
-
return
|
|
1211
|
+
return S;
|
|
1240
1212
|
});
|
|
1241
1213
|
}
|
|
1242
1214
|
function g(l) {
|
|
1243
|
-
return t((
|
|
1215
|
+
return t((f) => dn(f, l));
|
|
1244
1216
|
}
|
|
1245
1217
|
function c(l) {
|
|
1246
|
-
return t((
|
|
1247
|
-
if (!
|
|
1248
|
-
let
|
|
1249
|
-
const
|
|
1250
|
-
for (const r of
|
|
1218
|
+
return t((f) => {
|
|
1219
|
+
if (!f.groupSticky.get(l)) return;
|
|
1220
|
+
let S = d(f);
|
|
1221
|
+
const u = f.flatColumns.filter((r) => f.columnVisibility.get(r.id) !== !1);
|
|
1222
|
+
for (const r of u) {
|
|
1251
1223
|
if (r.groupId === l) break;
|
|
1252
|
-
|
|
1224
|
+
f.columnSticky.get(r.id) && (S += f.columnWidths.get(r.id) ?? 0);
|
|
1253
1225
|
}
|
|
1254
|
-
return
|
|
1226
|
+
return S;
|
|
1255
1227
|
});
|
|
1256
1228
|
}
|
|
1257
1229
|
function d(l) {
|
|
1258
|
-
let
|
|
1259
|
-
for (const
|
|
1260
|
-
|
|
1261
|
-
return
|
|
1230
|
+
let f = 0;
|
|
1231
|
+
for (const S of l.extraColumnsStart)
|
|
1232
|
+
f += wt(S);
|
|
1233
|
+
return f;
|
|
1262
1234
|
}
|
|
1263
1235
|
}
|
|
1264
1236
|
function wt(t) {
|
|
@@ -1276,7 +1248,7 @@ function ln(t, e) {
|
|
|
1276
1248
|
function un(t) {
|
|
1277
1249
|
const e = (n) => t.columnVisibility.get(n.id) !== !1;
|
|
1278
1250
|
return t.flatColumns.some((n) => e(n) && t.columnSticky.get(n.id)) || t.columns.some(
|
|
1279
|
-
(n) =>
|
|
1251
|
+
(n) => I(n) && t.groupSticky.get(n.id) && n.columns.some(e)
|
|
1280
1252
|
);
|
|
1281
1253
|
}
|
|
1282
1254
|
function dn(t, e) {
|
|
@@ -1296,7 +1268,7 @@ function fn(t, e) {
|
|
|
1296
1268
|
return o ? Number(o[1]) : 0;
|
|
1297
1269
|
}
|
|
1298
1270
|
function pn() {
|
|
1299
|
-
return
|
|
1271
|
+
return V(() => ({
|
|
1300
1272
|
columns: [],
|
|
1301
1273
|
flatColumns: [],
|
|
1302
1274
|
columnVisibility: /* @__PURE__ */ new Map(),
|
|
@@ -1318,28 +1290,28 @@ function mn(t) {
|
|
|
1318
1290
|
id: Z,
|
|
1319
1291
|
component: Qe,
|
|
1320
1292
|
active: !0,
|
|
1321
|
-
icon:
|
|
1293
|
+
icon: Dt
|
|
1322
1294
|
});
|
|
1323
|
-
const o = sn(e), s = on(e), a = cn(e),
|
|
1295
|
+
const o = sn(e), s = on(e), a = cn(e), p = nn(t), g = tn(e, a, p), c = rn(e, a, n), d = Ke(e), l = {
|
|
1324
1296
|
registerTableSlot: o.registerSlot,
|
|
1325
1297
|
registerExtraColumn: s.registerExtraColumn,
|
|
1326
1298
|
updateExtraColumnWidth: s.updateExtraColumnWidth,
|
|
1327
1299
|
updateExtraColumnOrder: s.updateExtraColumnOrder,
|
|
1328
1300
|
updateExtraColumnSticky: s.updateExtraColumnSticky,
|
|
1329
1301
|
registerComponent: C,
|
|
1330
|
-
updateColumns:
|
|
1331
|
-
updateColumnVisibility:
|
|
1332
|
-
updateColumnSticky:
|
|
1333
|
-
updateTableLayout:
|
|
1302
|
+
updateColumns: f,
|
|
1303
|
+
updateColumnVisibility: S,
|
|
1304
|
+
updateColumnSticky: y,
|
|
1305
|
+
updateTableLayout: u,
|
|
1334
1306
|
updateStickyHeader: i
|
|
1335
1307
|
};
|
|
1336
1308
|
return t.plugins.registerPublicApi(l), {
|
|
1337
1309
|
...l,
|
|
1338
|
-
updateColumns:
|
|
1310
|
+
updateColumns: f,
|
|
1339
1311
|
useComponent: w,
|
|
1340
1312
|
useConfigurationColumns: _,
|
|
1341
1313
|
useTableLayout: r,
|
|
1342
|
-
useStickyHeader:
|
|
1314
|
+
useStickyHeader: h,
|
|
1343
1315
|
...o,
|
|
1344
1316
|
...s,
|
|
1345
1317
|
...a,
|
|
@@ -1347,12 +1319,12 @@ function mn(t) {
|
|
|
1347
1319
|
...c,
|
|
1348
1320
|
...d
|
|
1349
1321
|
};
|
|
1350
|
-
function
|
|
1351
|
-
const x = g.initializeColumns(b), { columnSticky:
|
|
1322
|
+
function f(b) {
|
|
1323
|
+
const x = g.initializeColumns(b), { columnSticky: L, groupSticky: E } = a.initializeStickyState(b), v = e.getState();
|
|
1352
1324
|
e.setState({
|
|
1353
1325
|
...x,
|
|
1354
|
-
columnSticky:
|
|
1355
|
-
groupSticky:
|
|
1326
|
+
columnSticky: L,
|
|
1327
|
+
groupSticky: E,
|
|
1356
1328
|
extraColumnsStart: v.extraColumnsStart,
|
|
1357
1329
|
extraColumnsEnd: v.extraColumnsEnd,
|
|
1358
1330
|
slots: v.slots,
|
|
@@ -1361,11 +1333,11 @@ function mn(t) {
|
|
|
1361
1333
|
minContentWidths: v.minContentWidths
|
|
1362
1334
|
});
|
|
1363
1335
|
}
|
|
1364
|
-
function
|
|
1365
|
-
const
|
|
1366
|
-
|
|
1336
|
+
function S(b, x) {
|
|
1337
|
+
const L = e.getState(), E = new Map(L.columnVisibility);
|
|
1338
|
+
E.set(b, x), e.setState({ columnVisibility: E }), p == null || p.record(b, x);
|
|
1367
1339
|
}
|
|
1368
|
-
function
|
|
1340
|
+
function u(b) {
|
|
1369
1341
|
e.setState({ tableLayout: b });
|
|
1370
1342
|
}
|
|
1371
1343
|
function r() {
|
|
@@ -1374,26 +1346,26 @@ function mn(t) {
|
|
|
1374
1346
|
function i(b) {
|
|
1375
1347
|
e.setState({ stickyHeader: b });
|
|
1376
1348
|
}
|
|
1377
|
-
function
|
|
1349
|
+
function h() {
|
|
1378
1350
|
return e((b) => b.stickyHeader);
|
|
1379
1351
|
}
|
|
1380
|
-
function
|
|
1381
|
-
const
|
|
1382
|
-
if (
|
|
1383
|
-
const v =
|
|
1352
|
+
function y(b, x) {
|
|
1353
|
+
const L = e.getState();
|
|
1354
|
+
if (L.columns.some((v) => I(v) && v.id === b)) {
|
|
1355
|
+
const v = L.columns.find((O) => I(O) && O.id === b), T = new Map(L.groupSticky);
|
|
1384
1356
|
T.set(b, x);
|
|
1385
|
-
const
|
|
1386
|
-
if (v &&
|
|
1387
|
-
for (const
|
|
1388
|
-
e.setState({ groupSticky: T, columnSticky:
|
|
1357
|
+
const D = new Map(L.columnSticky);
|
|
1358
|
+
if (v && I(v))
|
|
1359
|
+
for (const O of v.columns) D.set(O.id, x);
|
|
1360
|
+
e.setState({ groupSticky: T, columnSticky: D });
|
|
1389
1361
|
} else {
|
|
1390
|
-
const v = new Map(
|
|
1362
|
+
const v = new Map(L.columnSticky);
|
|
1391
1363
|
v.set(b, x), e.setState({ columnSticky: v });
|
|
1392
1364
|
}
|
|
1393
1365
|
}
|
|
1394
1366
|
function C(b, x) {
|
|
1395
|
-
const
|
|
1396
|
-
|
|
1367
|
+
const L = e.getState(), E = new Map(L.components);
|
|
1368
|
+
E.set(b, x), e.setState({ components: E });
|
|
1397
1369
|
}
|
|
1398
1370
|
function w(b) {
|
|
1399
1371
|
return e(
|
|
@@ -1404,7 +1376,7 @@ function mn(t) {
|
|
|
1404
1376
|
return typeof b == "function" ? b() : b;
|
|
1405
1377
|
}
|
|
1406
1378
|
function _() {
|
|
1407
|
-
const { columns: b, columnVisibility: x, columnSticky:
|
|
1379
|
+
const { columns: b, columnVisibility: x, columnSticky: L, groupSticky: E } = e(
|
|
1408
1380
|
J((v) => ({
|
|
1409
1381
|
columns: v.columns,
|
|
1410
1382
|
columnVisibility: v.columnVisibility,
|
|
@@ -1414,57 +1386,57 @@ function mn(t) {
|
|
|
1414
1386
|
);
|
|
1415
1387
|
return vt(() => {
|
|
1416
1388
|
const v = Array.from(x.values()).filter(Boolean).length;
|
|
1417
|
-
function T(
|
|
1418
|
-
const
|
|
1389
|
+
function T(D) {
|
|
1390
|
+
const O = x.get(D.id) ?? !0;
|
|
1419
1391
|
return {
|
|
1420
|
-
id:
|
|
1421
|
-
label: k(
|
|
1422
|
-
visible:
|
|
1423
|
-
sticky:
|
|
1424
|
-
visibleToggleDisabled:
|
|
1392
|
+
id: D.id,
|
|
1393
|
+
label: k(D.label),
|
|
1394
|
+
visible: O,
|
|
1395
|
+
sticky: L.get(D.id) ?? !1,
|
|
1396
|
+
visibleToggleDisabled: D.visibleToggleDisabled ?? (O && v === 1)
|
|
1425
1397
|
};
|
|
1426
1398
|
}
|
|
1427
|
-
return b.map((
|
|
1428
|
-
id:
|
|
1429
|
-
label: k(
|
|
1430
|
-
visible:
|
|
1431
|
-
sticky:
|
|
1432
|
-
columns:
|
|
1433
|
-
} : T(
|
|
1434
|
-
}, [b, x,
|
|
1399
|
+
return b.map((D) => I(D) ? {
|
|
1400
|
+
id: D.id,
|
|
1401
|
+
label: k(D.label),
|
|
1402
|
+
visible: D.visible ?? !0,
|
|
1403
|
+
sticky: E.get(D.id) ?? !1,
|
|
1404
|
+
columns: D.columns.map(T)
|
|
1405
|
+
} : T(D));
|
|
1406
|
+
}, [b, x, L, E]);
|
|
1435
1407
|
}
|
|
1436
1408
|
}
|
|
1437
1409
|
function Sn() {
|
|
1438
1410
|
const t = /* @__PURE__ */ new Map();
|
|
1439
|
-
return t.set("body-cell-content",
|
|
1411
|
+
return t.set("body-cell-content", Wt), t.set("content", Oe), t.set("header-cell-label", Ae), t.set("header-group", bt), t.set("row", Ve), t;
|
|
1440
1412
|
}
|
|
1441
1413
|
function hn(t) {
|
|
1442
|
-
const e =
|
|
1414
|
+
const e = ke(), n = {}, o = {
|
|
1443
1415
|
hooked: e,
|
|
1444
1416
|
config: t,
|
|
1445
1417
|
get plugins() {
|
|
1446
|
-
return
|
|
1418
|
+
return A(n.plugins, "plugins");
|
|
1447
1419
|
},
|
|
1448
1420
|
get core() {
|
|
1449
|
-
return
|
|
1421
|
+
return A(n.core, "core");
|
|
1450
1422
|
},
|
|
1451
1423
|
get load() {
|
|
1452
|
-
return
|
|
1424
|
+
return A(n.load, "load");
|
|
1453
1425
|
},
|
|
1454
1426
|
get storage() {
|
|
1455
|
-
return
|
|
1427
|
+
return A(n.storage, "storage");
|
|
1456
1428
|
},
|
|
1457
1429
|
get persistentState() {
|
|
1458
|
-
return
|
|
1430
|
+
return A(n.persistentState, "persistentState");
|
|
1459
1431
|
},
|
|
1460
1432
|
get layout() {
|
|
1461
|
-
return
|
|
1433
|
+
return A(n.layout, "layout");
|
|
1462
1434
|
},
|
|
1463
1435
|
get table() {
|
|
1464
|
-
return
|
|
1436
|
+
return A(n.table, "table");
|
|
1465
1437
|
}
|
|
1466
1438
|
};
|
|
1467
|
-
return n.plugins =
|
|
1439
|
+
return n.plugins = Me(o), n.core = ve(), n.load = De(o), n.storage = Re(o), n.persistentState = Ie(o), n.layout = _e(o), n.table = mn(o), {
|
|
1468
1440
|
init: a,
|
|
1469
1441
|
destroy: s,
|
|
1470
1442
|
...o.plugins.pluginContext,
|
|
@@ -1472,71 +1444,73 @@ function hn(t) {
|
|
|
1472
1444
|
};
|
|
1473
1445
|
function s() {
|
|
1474
1446
|
e.callHookSync("destroy");
|
|
1475
|
-
const
|
|
1476
|
-
o.load.abort(),
|
|
1447
|
+
const p = o.core.useLoadStateStore.getState().loadState === "loading" && o.load.getLoadInstances().length > 0;
|
|
1448
|
+
o.load.abort(), p && o.core.resetLoadState();
|
|
1477
1449
|
}
|
|
1478
1450
|
async function a() {
|
|
1479
|
-
const { loadState:
|
|
1480
|
-
|
|
1451
|
+
const { loadState: p } = o.core.useLoadStateStore.getState();
|
|
1452
|
+
p === "loaded" || p === "loading" || await o.core.loadPromise(o.load.init());
|
|
1481
1453
|
}
|
|
1482
1454
|
}
|
|
1483
|
-
function
|
|
1455
|
+
function A(t, e) {
|
|
1484
1456
|
if (t === void 0)
|
|
1485
1457
|
throw new Error(`[DataGrid] The ${e} service was used before it was created.`);
|
|
1486
1458
|
return t;
|
|
1487
1459
|
}
|
|
1488
1460
|
const yn = [];
|
|
1489
|
-
function
|
|
1461
|
+
function Fn({
|
|
1490
1462
|
name: t,
|
|
1491
1463
|
load: e,
|
|
1492
1464
|
columns: n,
|
|
1493
1465
|
children: o,
|
|
1494
1466
|
persistent: s,
|
|
1495
1467
|
persistentColumnVisibility: a,
|
|
1496
|
-
tableLayout:
|
|
1468
|
+
tableLayout: p = "fixed",
|
|
1497
1469
|
stickyHeader: g = !1,
|
|
1498
1470
|
loading: c = !1,
|
|
1499
|
-
implicitFilterKeys: d
|
|
1471
|
+
implicitFilterKeys: d,
|
|
1472
|
+
label: l,
|
|
1473
|
+
portalContainer: f
|
|
1500
1474
|
}) {
|
|
1501
|
-
const
|
|
1475
|
+
const S = jt(e), [u] = ut(
|
|
1502
1476
|
() => hn({
|
|
1503
1477
|
name: t,
|
|
1504
|
-
load:
|
|
1478
|
+
load: S,
|
|
1505
1479
|
persistent: s,
|
|
1506
1480
|
persistentColumnVisibility: a
|
|
1507
1481
|
})
|
|
1508
1482
|
);
|
|
1509
|
-
return
|
|
1510
|
-
u.updateTableLayout(
|
|
1511
|
-
}, [u,
|
|
1483
|
+
return M(() => {
|
|
1484
|
+
u.updateTableLayout(p);
|
|
1485
|
+
}, [u, p]), M(() => {
|
|
1512
1486
|
u.updateColumns(n);
|
|
1513
|
-
}, [u, n]),
|
|
1487
|
+
}, [u, n]), M(() => {
|
|
1514
1488
|
u.updateStickyHeader(g);
|
|
1515
|
-
}, [u, g]),
|
|
1489
|
+
}, [u, g]), M(() => {
|
|
1516
1490
|
u[U].core.updateLoading(c);
|
|
1517
|
-
}, [u, c]),
|
|
1491
|
+
}, [u, c]), M(() => {
|
|
1518
1492
|
u[U].storage.updateImplicitFilterKeys(
|
|
1519
1493
|
d ?? yn
|
|
1520
1494
|
);
|
|
1521
|
-
}, [u, d]), /* @__PURE__ */
|
|
1495
|
+
}, [u, d]), /* @__PURE__ */ m(xt, { value: u, children: /* @__PURE__ */ m(Rt, { value: (l == null ? void 0 : l.trim()) || void 0, children: /* @__PURE__ */ G($t, { value: f, children: [
|
|
1522
1496
|
o,
|
|
1523
|
-
/* @__PURE__ */
|
|
1524
|
-
] });
|
|
1497
|
+
/* @__PURE__ */ m(kt, { fallback: /* @__PURE__ */ m(Q, {}), children: /* @__PURE__ */ m(we, {}) })
|
|
1498
|
+
] }) }) });
|
|
1525
1499
|
}
|
|
1526
|
-
const
|
|
1500
|
+
const Bn = {
|
|
1527
1501
|
table: Z,
|
|
1528
1502
|
cards: gt
|
|
1529
1503
|
};
|
|
1530
|
-
function
|
|
1531
|
-
return
|
|
1504
|
+
function zn() {
|
|
1505
|
+
return R().layout.useLayoutStore((e) => e.activeSlotIds.get("main"));
|
|
1532
1506
|
}
|
|
1533
1507
|
export {
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1508
|
+
Bn as DATA_GRID_VIEW,
|
|
1509
|
+
Fn as DataGrid,
|
|
1510
|
+
Kn as createDataGridPlugin,
|
|
1537
1511
|
j as useDataGrid,
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1512
|
+
zn as useDataGridActiveView,
|
|
1513
|
+
Un as useDataGridPluginContext,
|
|
1514
|
+
Jn as useDataGridRecord
|
|
1541
1515
|
};
|
|
1542
1516
|
//# sourceMappingURL=data-grid.js.map
|