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