@gears-frontx/ui-kit 0.4.5 → 0.4.6

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