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