@gears-frontx/ui-kit 0.4.5 → 0.4.7

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