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