@gen-epix/ui-client-common 4.6.1 → 4.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (146) hide show
  1. package/README.md +2 -2
  2. package/dist/_chunks/Breadcrumbs.js +4 -4
  3. package/dist/_chunks/CrudPage.js +233 -232
  4. package/dist/_chunks/CrudPage.js.map +1 -1
  5. package/dist/_chunks/GeoFilter.js +1 -0
  6. package/dist/_chunks/GeoFilter.js.map +1 -1
  7. package/dist/_chunks/Notifications.js +16 -16
  8. package/dist/_chunks/QueryClientProvider.js +1 -1
  9. package/dist/_chunks/QueryClientProvider.js.map +1 -1
  10. package/dist/_chunks/QueryClientService.js +73 -72
  11. package/dist/_chunks/QueryClientService.js.map +1 -1
  12. package/dist/_chunks/Table.js +1314 -887
  13. package/dist/_chunks/Table.js.map +1 -1
  14. package/dist/_chunks/TableUtil.js +5126 -178
  15. package/dist/_chunks/TableUtil.js.map +1 -1
  16. package/dist/_chunks/TextFilter.js +10 -6
  17. package/dist/_chunks/TextFilter.js.map +1 -1
  18. package/dist/_chunks/UserInvitationsAdminPage.js +131 -131
  19. package/dist/_chunks/UserInvitationsAdminPage.js.map +1 -1
  20. package/dist/_chunks/_baseFlatten.js +12 -12
  21. package/dist/_chunks/_baseFlatten.js.map +1 -1
  22. package/dist/_chunks/_baseIteratee.js +78 -78
  23. package/dist/_chunks/_baseIteratee.js.map +1 -1
  24. package/dist/_chunks/decorate.js +1 -1
  25. package/dist/_chunks/decorateParam.js +1 -1
  26. package/dist/_chunks/middleware.js +66 -70
  27. package/dist/_chunks/middleware.js.map +1 -1
  28. package/dist/_chunks/omit.js +98 -98
  29. package/dist/_chunks/omit.js.map +1 -1
  30. package/dist/_chunks/query.js +123 -107
  31. package/dist/_chunks/query.js.map +1 -1
  32. package/dist/_chunks/react.js +1 -1
  33. package/dist/_chunks/react.js.map +1 -1
  34. package/dist/_chunks/tableStore.js +298 -275
  35. package/dist/_chunks/tableStore.js.map +1 -1
  36. package/dist/_chunks/useMutation.js +2 -2
  37. package/dist/_chunks/useMutation.js.map +1 -1
  38. package/dist/_chunks/useQueryMemo.js +15 -16
  39. package/dist/_chunks/useQueryMemo.js.map +1 -1
  40. package/dist/_chunks/vanilla.js +1 -1
  41. package/dist/_chunks/vanilla.js.map +1 -1
  42. package/dist/_chunks/yup.js +2 -2
  43. package/dist/_chunks/yup.js.map +1 -1
  44. package/dist/classes/abstracts/FilterAbstract/FilterAbstract.d.ts +11 -0
  45. package/dist/classes/abstracts/FilterAbstract/index.js +48 -3
  46. package/dist/classes/abstracts/FilterAbstract/index.js.map +1 -1
  47. package/dist/classes/filters/BooleanFilter.d.ts +1 -0
  48. package/dist/classes/filters/DateFilter.d.ts +1 -1
  49. package/dist/classes/filters/GeoFilter.d.ts +1 -0
  50. package/dist/classes/filters/MultiSelectFilter.d.ts +1 -0
  51. package/dist/classes/filters/NumberRangeFilter.d.ts +1 -0
  52. package/dist/classes/filters/TextFilter.d.ts +1 -0
  53. package/dist/classes/services/AuthenticationService/index.js +8 -8
  54. package/dist/classes/services/AuthenticationService/index.js.map +1 -1
  55. package/dist/classes/services/AuthorizationService/index.js +4 -4
  56. package/dist/classes/services/AuthorizationService/index.js.map +1 -1
  57. package/dist/classes/services/BreadcrumbService/index.js +4 -4
  58. package/dist/classes/services/BreadcrumbService/index.js.map +1 -1
  59. package/dist/classes/services/EmotionCacheService/index.js.map +1 -1
  60. package/dist/classes/services/InactivityService/index.js +30 -30
  61. package/dist/classes/services/InactivityService/index.js.map +1 -1
  62. package/dist/classes/services/LogService/index.js +15 -15
  63. package/dist/classes/services/LogService/index.js.map +1 -1
  64. package/dist/classes/services/PageEventBusService/index.js.map +1 -1
  65. package/dist/components/app/App/index.js +27 -24
  66. package/dist/components/app/App/index.js.map +1 -1
  67. package/dist/components/app/ApplicationBootstrapWithAuthentication/index.js +18 -18
  68. package/dist/components/app/ApplicationBootstrapWithAuthentication/index.js.map +1 -1
  69. package/dist/components/app/ApplicationBootstrapWithoutAuthorization/index.js +18 -18
  70. package/dist/components/app/ApplicationBootstrapWithoutAuthorization/index.js.map +1 -1
  71. package/dist/components/app/AuthenticationWrapper/index.js +15 -15
  72. package/dist/components/app/AuthorizationWrapper/index.js +16 -16
  73. package/dist/components/app/AuthorizationWrapper/index.js.map +1 -1
  74. package/dist/components/app/RouterRoot/index.js +33 -33
  75. package/dist/components/app/RouterRoot/index.js.map +1 -1
  76. package/dist/components/epi/EpiContactDetailsDialog/index.js +4 -4
  77. package/dist/components/epi/EpiContactDetailsDialog/index.js.map +1 -1
  78. package/dist/components/ui/ApplicationBar/index.js +234 -234
  79. package/dist/components/ui/ApplicationBar/index.js.map +1 -1
  80. package/dist/components/ui/GenericErrorMessage/index.js +13 -13
  81. package/dist/components/ui/LicensesDialog/index.js +6 -6
  82. package/dist/components/ui/OrganizationSwitcherDialog/index.js +11 -11
  83. package/dist/components/ui/OutagesDialog/index.js +4 -4
  84. package/dist/components/ui/OutagesDialog/index.js.map +1 -1
  85. package/dist/components/ui/PageContainer/index.js +5 -5
  86. package/dist/components/ui/PageContainer/index.js.map +1 -1
  87. package/dist/components/ui/ResponseHandler/index.js +4 -4
  88. package/dist/components/ui/SortableList/SortableList.d.ts +5 -3
  89. package/dist/components/ui/Table/Table.d.ts +5 -2
  90. package/dist/components/ui/Table/TableColumnsEditorDialog.d.ts +13 -2
  91. package/dist/components/ui/Table/TableDownloadSidebarItem.d.ts +10 -0
  92. package/dist/components/ui/Table/TableSidebarMenu.d.ts +2 -1
  93. package/dist/components/ui/Table/index.d.ts +2 -0
  94. package/dist/components/ui/Table/index.js +1 -1
  95. package/dist/components/ui/Table/useTableColumnsMenu.d.ts +6 -0
  96. package/dist/components/ui/UserFeedbackDialog/index.js +15 -15
  97. package/dist/dataHooks/useIdentifierIssuerOwnOrganizationQuery/index.js +12 -12
  98. package/dist/dataHooks/useIdentifierIssuerQuery/index.js +11 -11
  99. package/dist/dataHooks/useInviteUserConstraintsQuery/index.js +5 -5
  100. package/dist/dataHooks/useInviteUserConstraintsQuery/index.js.map +1 -1
  101. package/dist/dataHooks/useOrganizationAdminPoliciesQuery/index.js +15 -15
  102. package/dist/dataHooks/useOrganizationsQuery/index.js +7 -7
  103. package/dist/dataHooks/useUsersQuery/index.js +10 -10
  104. package/dist/hooks/useCreateMutation/index.js +14 -14
  105. package/dist/hooks/useCreateMutation/index.js.map +1 -1
  106. package/dist/hooks/useDeleteMutation/index.js +17 -17
  107. package/dist/hooks/useDeleteMutation/index.js.map +1 -1
  108. package/dist/hooks/useEditMutation/index.js +22 -22
  109. package/dist/hooks/useEditMutation/index.js.map +1 -1
  110. package/dist/hooks/useInitializeTableStore/index.js +6 -6
  111. package/dist/hooks/useInitializeTableStore/index.js.map +1 -1
  112. package/dist/locale/en.json +27 -5
  113. package/dist/locale/nl.json +27 -5
  114. package/dist/models/table.models.d.ts +1 -0
  115. package/dist/models/table.models.js.map +1 -1
  116. package/dist/pages/AcceptInvitationPage/index.js +10 -10
  117. package/dist/pages/AdminPage/index.js +19 -19
  118. package/dist/pages/ChooseIdentityProviderPage/index.js +5 -5
  119. package/dist/pages/ErrorPage/index.js +4 -4
  120. package/dist/pages/IdentifierIssuersAdminPage/index.js +7 -7
  121. package/dist/pages/IdentifierIssuersAdminPage/index.js.map +1 -1
  122. package/dist/pages/OrganizationAdminPoliciesAdminPage/index.js +16 -16
  123. package/dist/pages/OrganizationContactsAdminPage/index.js +10 -10
  124. package/dist/pages/OrganizationContactsAdminPage/index.js.map +1 -1
  125. package/dist/pages/OrganizationSitesAdminPage/index.js +12 -12
  126. package/dist/pages/OrganizationSitesAdminPage/index.js.map +1 -1
  127. package/dist/pages/OrganizationsAdminPage/index.js +20 -20
  128. package/dist/pages/OrganizationsAdminPage/index.js.map +1 -1
  129. package/dist/pages/OutagesAdminPage/index.js +11 -11
  130. package/dist/pages/OutagesAdminPage/index.js.map +1 -1
  131. package/dist/pages/RouterErrorPage/index.js +4 -4
  132. package/dist/pages/UsersAdminPage/index.js +34 -34
  133. package/dist/pages/UsersAdminPage/index.js.map +1 -1
  134. package/dist/setup/setup.js +4 -4
  135. package/dist/setup/setup.js.map +1 -1
  136. package/dist/stores/oidcStore/oidcStore.d.ts +1 -1
  137. package/dist/stores/tableStore/tableStore.d.ts +3 -1
  138. package/dist/utils/StandardConfigUtil/index.js +2 -2
  139. package/dist/utils/StandardConfigUtil/index.js.map +1 -1
  140. package/dist/utils/TableUtil/TableUtil.d.ts +5 -0
  141. package/package.json +35 -37
  142. package/dist/_chunks/useColumnsMenu.js +0 -157
  143. package/dist/_chunks/useColumnsMenu.js.map +0 -1
  144. package/dist/hooks/useColumnsMenu/index.d.ts +0 -1
  145. package/dist/hooks/useColumnsMenu/index.js +0 -1
  146. package/dist/hooks/useColumnsMenu/useColumnsMenu.d.ts +0 -6
@@ -1,42 +1,41 @@
1
1
  import { n as e, t } from "./rolldown-runtime.js";
2
2
  import { i as n, n as r, o as i, r as a, s as o, t as s } from "./TextFilter.js";
3
- import { n as c, r as l, t as u } from "./TableUtil.js";
4
- import { f as d } from "./isArrayLike.js";
5
- import { TABLE_COLUMN_FROZEN as f } from "../models/table.models.js";
6
- import { t as p } from "./react.js";
7
- import { t as m } from "./tableStore.js";
3
+ import { r as c, t as l } from "./uniq.js";
4
+ import { t as u } from "./omit.js";
5
+ import { n as d, r as f, t as p } from "./TableUtil.js";
6
+ import { t as m } from "./react.js";
8
7
  import { PageEventBusService as h } from "../classes/services/PageEventBusService/index.js";
9
- import { t as g } from "./omit.js";
10
- import { useConfig as _ } from "../hooks/useConfig/index.js";
11
- import { r as v, t as y } from "./uniq.js";
12
- import { n as b, t as x } from "./useColumnsMenu.js";
13
- import { t as S } from "./GeoFilter.js";
14
- import { BooleanFilterField as C } from "../components/filters/BooleanFilterField/index.js";
15
- import { DateFilterField as w } from "../components/filters/DateFilterField/index.js";
16
- import { GeoFilterField as T } from "../components/filters/GeoFilterField/index.js";
17
- import { MultiSelectFilterField as E } from "../components/filters/MultiSelectFilterField/index.js";
18
- import { NumberRangeFilterField as D } from "../components/filters/NumberRangeFilterField/index.js";
19
- import { TextFilterField as O } from "../components/filters/TextFilterField/index.js";
20
- import { SidebarItem as k, SidebarMenu as ee, SidebarMenuItem as te } from "../components/ui/Sidebar/index.js";
21
- import { container as ne } from "tsyringe";
22
- import { WindowService as re } from "@gen-epix/ui-core/classes/services/WindowService";
8
+ import { useConfig as g } from "../hooks/useConfig/index.js";
9
+ import { l as _, t as v } from "./tableStore.js";
10
+ import { f as y } from "./isArrayLike.js";
11
+ import { t as b } from "./GeoFilter.js";
12
+ import { BooleanFilterField as x } from "../components/filters/BooleanFilterField/index.js";
13
+ import { DateFilterField as S } from "../components/filters/DateFilterField/index.js";
14
+ import { GeoFilterField as C } from "../components/filters/GeoFilterField/index.js";
15
+ import { MultiSelectFilterField as w } from "../components/filters/MultiSelectFilterField/index.js";
16
+ import { NumberRangeFilterField as T } from "../components/filters/NumberRangeFilterField/index.js";
17
+ import { TextFilterField as E } from "../components/filters/TextFilterField/index.js";
18
+ import { TABLE_COLUMN_FROZEN as D } from "../models/table.models.js";
19
+ import { SidebarItem as O, SidebarMenu as ee, SidebarMenuItem as k } from "../components/ui/Sidebar/index.js";
20
+ import { container as te } from "tsyringe";
21
+ import { WindowService as ne } from "@gen-epix/ui-core/classes/services/WindowService";
23
22
  import { t as A } from "i18next";
24
- import { Box as j, Button as M, Checkbox as N, Divider as P, FormControlLabel as ie, FormGroup as ae, IconButton as F, Menu as oe, Paper as se, Popover as ce, Tooltip as I, Typography as le, alpha as ue, darken as de, lighten as fe, styled as L, useTheme as pe } from "@mui/material";
25
- import * as me from "react";
26
- import he, { Fragment as R, createContext as ge, forwardRef as _e, use as ve, useCallback as z, useEffect as B, useId as ye, useImperativeHandle as be, useLayoutEffect as xe, useMemo as V, useRef as H, useState as U } from "react";
27
- import { Fragment as W, jsx as G, jsxs as K } from "react/jsx-runtime";
28
- import { useTranslation as q } from "react-i18next";
29
- import { TestIdUtil as J } from "@gen-epix/ui-core/utils/TestIdUtil";
23
+ import { Box as j, Button as re, Checkbox as ie, Divider as ae, FormControlLabel as M, IconButton as N, Link as P, Menu as oe, Paper as se, Popover as ce, Tooltip as F, Typography as le, alpha as ue, darken as de, lighten as fe, styled as pe, useTheme as me } from "@mui/material";
24
+ import * as he from "react";
25
+ import I, { Fragment as ge, createContext as L, forwardRef as _e, use as ve, useCallback as R, useEffect as z, useId as ye, useImperativeHandle as be, useLayoutEffect as xe, useMemo as B, useRef as V, useState as H } from "react";
26
+ import { Fragment as U, jsx as W, jsxs as G } from "react/jsx-runtime";
27
+ import { useTranslation as K } from "react-i18next";
28
+ import { TestIdUtil as q } from "@gen-epix/ui-core/utils/TestIdUtil";
30
29
  import { TableVirtuoso as Se } from "react-virtuoso";
31
30
  import { useScrollbarSize as Ce } from "@gen-epix/ui-core/hooks/useScrollbarSize";
32
31
  import { visuallyHidden as we } from "@mui/utils";
33
32
  import Te from "@mui/icons-material/ArrowDownward";
34
33
  import Ee from "@mui/icons-material/FilterAlt";
35
- import { FormProvider as De, useForm as Oe, useFormContext as Y, useWatch as ke } from "react-hook-form";
36
- import Ae from "@mui/icons-material/MoreVert";
37
- import { withDialog as je } from "@gen-epix/ui-core-components/hoc/withDialog";
38
- import { DndContext as X, DragOverlay as Me, KeyboardSensor as Z, PointerSensor as Ne, defaultDropAnimationSideEffects as Pe, useSensor as Fe, useSensors as Ie } from "@dnd-kit/core";
39
- import { SortableContext as Le, arrayMove as Re, sortableKeyboardCoordinates as ze, useSortable as Be } from "@dnd-kit/sortable";
34
+ import { FormProvider as De, useController as Oe, useForm as ke, useFormContext as Ae, useWatch as je } from "react-hook-form";
35
+ import Me from "@mui/icons-material/MoreVert";
36
+ import { withDialog as J } from "@gen-epix/ui-core-components/hoc/withDialog";
37
+ import { DndContext as Ne, DragOverlay as Pe, KeyboardSensor as Fe, PointerSensor as Y, defaultDropAnimationSideEffects as Ie, useSensor as X, useSensors as Le } from "@dnd-kit/core";
38
+ import { SortableContext as Z, arrayMove as Re, sortableKeyboardCoordinates as ze, useSortable as Be } from "@dnd-kit/sortable";
40
39
  import { CSS as Ve } from "@dnd-kit/utilities";
41
40
  import He from "@mui/icons-material/DragIndicator";
42
41
  import Ue from "@mui/icons-material/IndeterminateCheckBox";
@@ -44,15 +43,21 @@ import We from "@mui/icons-material/Check";
44
43
  import Ge from "@mui/icons-material/RestartAlt";
45
44
  import Ke from "@mui/icons-material/Close";
46
45
  import { NestedDropdown as qe } from "@gen-epix/ui-core-components/components/NestedMenu";
46
+ import Je from "@mui/icons-material/CheckBoxOutlined";
47
+ import Ye from "@mui/icons-material/CheckBoxOutlineBlankOutlined";
48
+ import Xe from "@mui/icons-material/ToggleOffOutlined";
49
+ import Ze from "@mui/icons-material/ToggleOnOutlined";
50
+ import Qe from "@mui/icons-material/EditOutlined";
51
+ import $e from "@mui/icons-material/Download";
47
52
  // ../../node_modules/.pnpm/use-debounce@10.1.1_react@19.3.1/node_modules/use-debounce/dist/index.module.js
48
- var Je = /* @__PURE__ */ e(c(), 1), Ye = /* @__PURE__ */ e(n(), 1), Xe = /* @__PURE__ */ e(g(), 1), Ze = /* @__PURE__ */ e(v(), 1);
49
- function Qe(e, t, n, r) {
50
- var i = this, a = H(null), o = H(0), s = H(0), c = H(null), l = H([]), u = H(), d = H(), f = H(e), p = H(!0), m = H(), h = H();
53
+ var et = /* @__PURE__ */ e(d(), 1), tt = /* @__PURE__ */ e(n(), 1), nt = /* @__PURE__ */ e(u(), 1), rt = /* @__PURE__ */ e(c(), 1);
54
+ function it(e, t, n, r) {
55
+ var i = this, a = V(null), o = V(0), s = V(0), c = V(null), l = V([]), u = V(), d = V(), f = V(e), p = V(!0), m = V(), h = V();
51
56
  f.current = e;
52
57
  var g = typeof window < "u", _ = !t && t !== 0 && g;
53
58
  if (typeof e != "function") throw TypeError("Expected a function");
54
59
  t = +t || 0;
55
- var v = !!(n ||= {}).leading, y = !("trailing" in n) || !!n.trailing, b = !!n.flushOnExit && y, x = "maxWait" in n, S = "debounceOnServer" in n && !!n.debounceOnServer, C = x ? Math.max(+n.maxWait || 0, t) : null, w = V(function() {
60
+ var v = !!(n ||= {}).leading, y = !("trailing" in n) || !!n.trailing, b = !!n.flushOnExit && y, x = "maxWait" in n, S = "debounceOnServer" in n && !!n.debounceOnServer, C = x ? Math.max(+n.maxWait || 0, t) : null, w = B(function() {
56
61
  var e = function(e) {
57
62
  var t = l.current, n = u.current;
58
63
  return l.current = u.current = null, o.current = e, s.current = s.current || e, d.current = f.current.apply(n, t);
@@ -105,95 +110,157 @@ function Qe(e, t, n, r) {
105
110
  S,
106
111
  r
107
112
  ]);
108
- return h.current = w, B(function() {
113
+ return h.current = w, z(function() {
109
114
  return p.current = !0, function() {
110
115
  var e;
111
116
  b && h.current.flush(), m.current &&= ((e = globalThis.document) == null || e.removeEventListener == null || e.removeEventListener("visibilitychange", m.current), null), p.current = !1;
112
117
  };
113
118
  }, [b]), w;
114
119
  }
120
+ // ../../node_modules/.pnpm/zustand@5.1.0_@types+react@19.3.0_immer@11.2.10_react@19.3.1_use-sync-external-store@1.7.0_react@19.3.1_/node_modules/zustand/esm/vanilla/shallow.mjs
121
+ var at = (e) => Symbol.iterator in e, ot = (e) => "entries" in e, st = (e, t) => {
122
+ let n = e instanceof Map ? e : new Map(e.entries()), r = t instanceof Map ? t : new Map(t.entries());
123
+ if (n.size !== r.size) return !1;
124
+ for (let [e, t] of n) if (!r.has(e) || !Object.is(t, r.get(e))) return !1;
125
+ return !0;
126
+ }, ct = (e, t) => {
127
+ let n = e[Symbol.iterator](), r = t[Symbol.iterator](), i = n.next(), a = r.next();
128
+ for (; !i.done && !a.done;) {
129
+ if (!Object.is(i.value, a.value)) return !1;
130
+ i = n.next(), a = r.next();
131
+ }
132
+ return !!i.done && !!a.done;
133
+ };
134
+ function lt(e, t) {
135
+ return Object.is(e, t) ? !0 : typeof e != "object" || !e || typeof t != "object" || !t || Object.getPrototypeOf(e) !== Object.getPrototypeOf(t) ? !1 : at(e) && at(t) ? ot(e) && ot(t) ? st(e, t) : ct(e, t) : st({ entries: () => Object.entries(e) }, { entries: () => Object.entries(t) });
136
+ }
137
+ // ../../node_modules/.pnpm/zustand@5.1.0_@types+react@19.3.0_immer@11.2.10_react@19.3.1_use-sync-external-store@1.7.0_react@19.3.1_/node_modules/zustand/esm/react/shallow.mjs
138
+ function Q(e) {
139
+ let t = I.useRef(void 0);
140
+ return (n) => {
141
+ let r = e(n);
142
+ return lt(t.current, r) ? t.current : t.current = r;
143
+ };
144
+ }
115
145
  // src/components/ui/Table/TableCellAsyncContent.tsx
116
- var $e = ({ content: e }) => {
117
- let [t, n] = U(null);
118
- return B(() => {
146
+ var ut = ({ content: e }) => {
147
+ let [t, n] = H(null);
148
+ return z(() => {
119
149
  (async () => {
120
150
  e instanceof Promise ? n(await e) : n(e);
121
151
  })();
122
- }, [e]), /* @__PURE__ */ G(W, { children: t });
152
+ }, [e]), /* @__PURE__ */ W(U, { children: t });
123
153
  };
124
154
  // ../../node_modules/.pnpm/clsx@2.1.1/node_modules/clsx/dist/clsx.mjs
125
- function et(e) {
155
+ function dt(e) {
126
156
  var t, n, r = "";
127
157
  if (typeof e == "string" || typeof e == "number") r += e;
128
158
  else if (typeof e == "object") {
129
159
  if (Array.isArray(e)) {
130
160
  var i = e.length;
131
- for (t = 0; t < i; t++) e[t] && (n = et(e[t])) && (r && (r += " "), r += n);
161
+ for (t = 0; t < i; t++) e[t] && (n = dt(e[t])) && (r && (r += " "), r += n);
132
162
  } else for (n in e) e[n] && (r && (r += " "), r += n);
133
163
  }
134
164
  return r;
135
165
  }
136
- function tt() {
137
- for (var e, t, n = 0, r = "", i = arguments.length; n < i; n++) (e = arguments[n]) && (t = et(e)) && (r && (r += " "), r += t);
166
+ function ft() {
167
+ for (var e, t, n = 0, r = "", i = arguments.length; n < i; n++) (e = arguments[n]) && (t = dt(e)) && (r && (r += " "), r += t);
138
168
  return r;
139
169
  }
140
170
  // src/components/ui/Table/TableFilter.tsx
141
- var nt = /* @__PURE__ */ e((/* @__PURE__ */ t(((e, t) => {
142
- var n = l(), r = d();
171
+ var pt = /* @__PURE__ */ e((/* @__PURE__ */ t(((e, t) => {
172
+ var n = f(), r = y();
143
173
  function i(e) {
144
174
  return e && e.length ? n(e, r) : 0;
145
175
  }
146
176
  t.exports = i;
147
- })))(), 1), rt = ({ filter: e }) => /* @__PURE__ */ K(W, { children: [
148
- e instanceof s && /* @__PURE__ */ G(O, { filter: e }),
149
- e instanceof o && /* @__PURE__ */ G(C, { filter: e }),
150
- e instanceof r && /* @__PURE__ */ G(D, { filter: e }),
151
- e instanceof a && /* @__PURE__ */ G(E, { filter: e }),
152
- e instanceof S && /* @__PURE__ */ G(T, { filter: e }),
153
- e instanceof i && /* @__PURE__ */ G(w, { filter: e })
154
- ] }), it = ({ filter: e, onFilterChange: t }) => {
155
- let n = m(), { t: r } = q(), i = p(n, (e) => e.setFilterValue), a = V(() => ({ [e.id]: e.initialFilterValue }), [e.id, e.initialFilterValue]), o = V(() => ({ [e.id]: e.filterValue ?? e.initialFilterValue }), [
177
+ })))(), 1), mt = ({ filter: e }) => {
178
+ let { field: t } = Oe({
179
+ defaultValue: e.includeMissingValues,
180
+ name: e.includeMissingValuesFormFieldName
181
+ }), { t: n } = K(), c = v(), l = m(c, (e) => e.showMissingValuesFilter), u = je({ name: e.id }), d = e.isInitialFilterValue(u), f = d ? n`Select missing values` : n`Include missing values`, p = d ? n`When enabled, select only items with missing values.` : n`When enabled, include items with missing values alongside items matching the selected values.`;
182
+ return /* @__PURE__ */ G(U, { children: [
183
+ e instanceof s && /* @__PURE__ */ W(E, { filter: e }),
184
+ e instanceof o && /* @__PURE__ */ W(x, { filter: e }),
185
+ e instanceof r && /* @__PURE__ */ W(T, { filter: e }),
186
+ e instanceof a && /* @__PURE__ */ W(w, { filter: e }),
187
+ e instanceof b && /* @__PURE__ */ W(C, { filter: e }),
188
+ e instanceof i && /* @__PURE__ */ W(S, { filter: e }),
189
+ l && e.supportsMissingValuesFilter && /* @__PURE__ */ W(F, {
190
+ arrow: !0,
191
+ placement: "top",
192
+ title: p,
193
+ children: /* @__PURE__ */ W(M, {
194
+ control: /* @__PURE__ */ W(ie, {
195
+ checked: t.value === !0,
196
+ name: t.name,
197
+ onBlur: t.onBlur,
198
+ onChange: t.onChange
199
+ }),
200
+ label: f
201
+ })
202
+ })
203
+ ] });
204
+ }, ht = ({ filter: e, onFilterChange: t }) => {
205
+ let n = v(), { t: r } = K(), i = m(n, (e) => e.setFilterValue), a = m(n, (e) => e.showMissingValuesFilter), o = e.includeMissingValuesFormFieldName, s = B(() => ({
206
+ [e.id]: e.initialFilterValue,
207
+ ...a ? { [o]: !1 } : {}
208
+ }), [
209
+ e.id,
210
+ e.initialFilterValue,
211
+ o,
212
+ a
213
+ ]), c = B(() => ({
214
+ [e.id]: e.filterValue ?? e.initialFilterValue,
215
+ ...a ? { [o]: e.includeMissingValues } : {}
216
+ }), [
156
217
  e.id,
157
218
  e.filterValue,
158
- e.initialFilterValue
159
- ]), s = Oe({
160
- defaultValues: a,
161
- values: o
162
- }), { formState: { isDirty: c }, handleSubmit: l } = s, u = z(async (n) => {
163
- await i(e.id, n[e.id]), t();
219
+ e.includeMissingValues,
220
+ e.initialFilterValue,
221
+ o,
222
+ a
223
+ ]), l = ke({
224
+ defaultValues: s,
225
+ values: c
226
+ }), { formState: { isDirty: u }, handleSubmit: d } = l, f = R(async (n) => {
227
+ await i(e.id, n[e.id], a ? n[o] === !0 : void 0), t();
164
228
  }, [
165
229
  e.id,
230
+ o,
166
231
  t,
167
- i
168
- ]), d = z(async () => {
169
- await i(e.id, e.initialFilterValue), t();
232
+ i,
233
+ a
234
+ ]), p = R(async () => {
235
+ await i(e.id, e.initialFilterValue, !a && void 0), t();
170
236
  }, [
171
237
  e.id,
172
238
  e.initialFilterValue,
173
239
  t,
174
- i
240
+ i,
241
+ a
175
242
  ]);
176
- return /* @__PURE__ */ G(De, {
177
- ...s,
178
- children: /* @__PURE__ */ K(j, {
243
+ return /* @__PURE__ */ W(De, {
244
+ ...l,
245
+ children: /* @__PURE__ */ G(j, {
179
246
  autoComplete: "off",
180
247
  component: "form",
181
248
  id: "Filters",
182
- onSubmit: l(u),
249
+ onSubmit: d(f),
183
250
  sx: { minWidth: "400px" },
184
- children: [/* @__PURE__ */ G(rt, { filter: e }), /* @__PURE__ */ K(j, {
251
+ children: [/* @__PURE__ */ W(mt, { filter: e }), /* @__PURE__ */ G(j, {
185
252
  sx: {
186
253
  display: "flex",
187
254
  gap: 1,
188
255
  justifyContent: "flex-end"
189
256
  },
190
- children: [/* @__PURE__ */ G(M, {
191
- disabled: e.isInitialFilterValue(),
192
- onClick: d,
257
+ children: [/* @__PURE__ */ W(re, {
258
+ disabled: !e.isFilterActive(),
259
+ onClick: p,
193
260
  variant: "outlined",
194
261
  children: r`Remove filter`
195
- }), /* @__PURE__ */ G(M, {
196
- disabled: !c,
262
+ }), /* @__PURE__ */ W(re, {
263
+ disabled: !u,
197
264
  type: "submit",
198
265
  variant: "contained",
199
266
  children: r`Apply`
@@ -201,28 +268,28 @@ var nt = /* @__PURE__ */ e((/* @__PURE__ */ t(((e, t) => {
201
268
  })]
202
269
  })
203
270
  });
204
- }, at = {}, ot = ({ ariaSort: e, backgroundColor: t, canDrag: n, children: r, className: i, column: a, columnIndex: o, enabled: s, height: c, onClick: l, onCustomDrag: u, order: d, ref: h, role: g, row: _, rowIndex: v, sx: y, tabIndex: x, title: S, width: C, xOffset: w }) => {
205
- let T = pe(), E = m(), D = p(E, b((e) => e.dataContext)), O = z((e) => {
271
+ }, gt = {}, _t = ({ ariaSort: e, backgroundColor: t, canDrag: n, children: r, className: i, column: a, columnIndex: o, enabled: s, height: c, onClick: l, onCustomDrag: u, order: d, ref: f, role: p, row: h, rowIndex: g, sx: _, tabIndex: y, title: b, width: x, xOffset: S }) => {
272
+ let C = me(), w = v(), T = m(w, Q((e) => e.dataContext)), E = R((e) => {
206
273
  l({
207
- dataContext: D,
274
+ dataContext: T,
208
275
  id: a.id,
209
- row: _,
210
- rowIndex: v
276
+ row: h,
277
+ rowIndex: g
211
278
  }, e.nativeEvent);
212
279
  }, [
213
280
  a.id,
214
- D,
281
+ T,
215
282
  l,
216
- _,
217
- v
218
- ]), k = H(null), ee = z((e) => {
283
+ h,
284
+ g
285
+ ]), O = V(null), ee = R((e) => {
219
286
  if (!u || n && !n(e)) return;
220
287
  let t = e.currentTarget, r = t.getBoundingClientRect().width, i = {
221
288
  elementOffsetX: e.clientX - t.getBoundingClientRect().left,
222
289
  elementWidth: r,
223
290
  target: t
224
291
  }, o = (n) => {
225
- k.current || (k.current = {
292
+ O.current || (O.current = {
226
293
  target: t,
227
294
  x: e.clientX,
228
295
  y: e.clientY
@@ -234,7 +301,7 @@ var nt = /* @__PURE__ */ e((/* @__PURE__ */ t(((e, t) => {
234
301
  type: "start",
235
302
  ...i
236
303
  }, a));
237
- let r = n.clientX - k.current.x, o = n.clientY - k.current.y;
304
+ let r = n.clientX - O.current.x, o = n.clientY - O.current.y;
238
305
  u({
239
306
  clientX: n.clientX,
240
307
  clientY: n.clientY,
@@ -244,8 +311,8 @@ var nt = /* @__PURE__ */ e((/* @__PURE__ */ t(((e, t) => {
244
311
  ...i
245
312
  }, a);
246
313
  }, s = (e) => {
247
- if (e.preventDefault(), k.current) {
248
- let t = e.clientX - k.current.x, n = e.clientY - k.current.y;
314
+ if (e.preventDefault(), O.current) {
315
+ let t = e.clientX - O.current.x, n = e.clientY - O.current.y;
249
316
  u({
250
317
  clientX: e.clientX,
251
318
  clientY: e.clientY,
@@ -255,34 +322,34 @@ var nt = /* @__PURE__ */ e((/* @__PURE__ */ t(((e, t) => {
255
322
  ...i
256
323
  }, a);
257
324
  }
258
- k.current = null, document.removeEventListener("mousemove", o), document.removeEventListener("mouseup", s);
325
+ O.current = null, document.removeEventListener("mousemove", o), document.removeEventListener("mouseup", s);
259
326
  };
260
327
  document.addEventListener("mouseup", s, { once: !0 }), document.addEventListener("mousemove", o);
261
328
  }, [
262
329
  u,
263
330
  n,
264
331
  a
265
- ]), te = !a.frozen, ne = z(() => {
266
- let e = a.frozen === f.LEFT, n = a.frozen === f.RIGHT, r = e || n, i;
267
- return t && (at[t] ? i = at[t] : (i = T.palette.getContrastText(t), at[t] = i)), {
332
+ ]), k = !a.frozen, te = R(() => {
333
+ let e = a.frozen === D.LEFT, n = a.frozen === D.RIGHT, r = e || n, i;
334
+ return t && (gt[t] ? i = gt[t] : (i = C.palette.getContrastText(t), gt[t] = i)), {
268
335
  "*": t ?? { color: i ? `${i} !important` : void 0 },
269
- background: r ? T.palette.background.paper : t,
336
+ background: r ? C.palette.background.paper : t,
270
337
  boxSizing: "border-box",
271
338
  color: i,
272
- left: e ? `${w ?? 0}px` : void 0,
339
+ left: e ? `${S ?? 0}px` : void 0,
273
340
  lineHeight: c,
274
341
  order: d,
275
342
  overflow: "hidden",
276
343
  paddingLeft: "8px",
277
344
  paddingRight: "8px",
278
345
  position: r ? "sticky" : "relative",
279
- right: n ? `${w ?? 0}px` : void 0,
346
+ right: n ? `${S ?? 0}px` : void 0,
280
347
  textAlign: a.textAlign ?? "left",
281
348
  textOverflow: a.disableEllipsis ? void 0 : "ellipsis",
282
349
  whiteSpace: a.disableEllipsis ? void 0 : "nowrap",
283
- width: `${C}px`,
350
+ width: `${x}px`,
284
351
  zIndex: +!!r,
285
- ...y
352
+ ..._
286
353
  };
287
354
  }, [
288
355
  t,
@@ -291,35 +358,35 @@ var nt = /* @__PURE__ */ e((/* @__PURE__ */ t(((e, t) => {
291
358
  a.textAlign,
292
359
  c,
293
360
  d,
294
- y,
295
- T.palette,
296
- C,
297
- w
361
+ _,
362
+ C.palette,
363
+ x,
364
+ S
298
365
  ]);
299
- return /* @__PURE__ */ G(j, {
366
+ return /* @__PURE__ */ W(j, {
300
367
  "aria-sort": e,
301
368
  className: i,
302
369
  "data-column-index": o,
303
370
  "data-frozen": +!!a.frozen,
304
371
  "data-id": a.id,
305
- "data-row-index": v ?? "",
306
- onClick: l && s ? O : void 0,
307
- onMouseDown: te && u ? ee : void 0,
308
- ref: h,
309
- role: g ?? "cell",
310
- sx: ne(),
311
- tabIndex: x,
312
- title: S,
372
+ "data-row-index": g ?? "",
373
+ onClick: l && s ? E : void 0,
374
+ onMouseDown: k && u ? ee : void 0,
375
+ ref: f,
376
+ role: p ?? "cell",
377
+ sx: te(),
378
+ tabIndex: y,
379
+ title: b,
313
380
  children: r
314
381
  });
315
- }, Q = {
382
+ }, $ = {
316
383
  columnDivider: "GENEPIX-TableHeaderCell-columnDivider",
317
384
  content: "GENEPIX-TableHeaderCell-content",
318
385
  customHeaderIcon: "GENEPIX-TableHeaderCell-customHeaderIcon",
319
386
  filterLabelIcon: "GENEPIX-TableHeaderCell-filterLabelIcon",
320
387
  root: "GENEPIX-TableHeaderCell",
321
388
  sortLabelIcon: "GENEPIX-TableHeaderCell-sortLabelIcon"
322
- }, $ = 18, st = `${Q.root}--focus`, ct = L(F, { name: "GENEPIX-TableSortLabelIcon" })(({ ownerState: e, theme: t }) => ({
389
+ }, vt = 18, yt = `${$.root}--focus`, bt = pe(N, { name: "GENEPIX-TableSortLabelIcon" })(({ ownerState: e, theme: t }) => ({
323
390
  "&:hover": {
324
391
  color: t.palette.primary.main,
325
392
  opacity: "1 !important"
@@ -330,95 +397,95 @@ var nt = /* @__PURE__ */ e((/* @__PURE__ */ t(((e, t) => {
330
397
  },
331
398
  color: t.palette.text.primary,
332
399
  display: "none",
333
- fontSize: $,
334
- height: `${$}px`,
400
+ fontSize: vt,
401
+ height: `${vt}px`,
335
402
  opacity: 0,
336
403
  padding: 0,
337
404
  userSelect: "none",
338
- width: `${$}px`
339
- })), lt = L(F, { name: "GENEPIX-TableCustomHeaderIcon" })(({ theme: e }) => ({
405
+ width: `${vt}px`
406
+ })), xt = pe(N, { name: "GENEPIX-TableCustomHeaderIcon" })(({ theme: e }) => ({
340
407
  "&:hover": {
341
408
  color: e.palette.primary.main,
342
409
  opacity: "1 !important"
343
410
  },
344
411
  display: "none",
345
- fontSize: $,
346
- height: `${$}px`,
412
+ fontSize: vt,
413
+ height: `${vt}px`,
347
414
  opacity: 0,
348
415
  padding: 0,
349
416
  userSelect: "none",
350
- width: `${$}px`
351
- })), ut = L(F, { name: "GENEPIX-TableFilterLabelIcon" })(({ theme: e }) => ({
417
+ width: `${vt}px`
418
+ })), St = pe(N, { name: "GENEPIX-TableFilterLabelIcon" })(({ theme: e }) => ({
352
419
  "&:hover": {
353
420
  color: e.palette.primary.main,
354
421
  opacity: "1 !important"
355
422
  },
356
423
  display: "none",
357
- fontSize: $,
358
- height: `${$}px`,
424
+ fontSize: vt,
425
+ height: `${vt}px`,
359
426
  opacity: 0,
360
427
  padding: 0,
361
428
  userSelect: "none",
362
- width: `${$}px`
363
- })), dt = (e) => {
364
- let { t } = q(), n = pe(), r = m(), i = p(r, (e) => e.sortByField), a = p(r, (e) => e.dataContext), o = p(r, (e) => e.sortDirection), s = p(r, (e) => e.setSorting), c = p(r, (e) => e.filters), l = H(null), u = ye(), [d, f] = U(), h = H(null), g = H(null), { column: _, columnIndex: v, dividerColor: y, height: b, onColumnDividerKeyDown: x, onColumnDividerMouseDown: S, onCustomDrag: C, order: w, width: T, xOffset: E } = e, D = H(!1), O = z((e) => _.frozen || e.button !== 0 ? !1 : e.nativeEvent.target.classList.contains(Q.content), [_.frozen]), k = z((e, t) => {
429
+ width: `${vt}px`
430
+ })), Ct = (e) => {
431
+ let { t } = K(), n = me(), r = v(), i = m(r, (e) => e.sortByField), a = m(r, (e) => e.dataContext), o = m(r, (e) => e.sortDirection), s = m(r, (e) => e.setSorting), c = m(r, (e) => e.filters), l = V(null), u = ye(), [d, f] = H(), p = V(null), h = V(null), { column: g, columnIndex: _, dividerColor: y, height: b, onColumnDividerKeyDown: x, onColumnDividerMouseDown: S, onCustomDrag: C, order: w, width: T, xOffset: E } = e, D = V(!1), O = R((e) => g.frozen || e.button !== 0 ? !1 : e.nativeEvent.target.classList.contains($.content), [g.frozen]), ee = R((e, t) => {
365
432
  C && (e.type === "start" && (D.current = !0), C(e, t));
366
- }, [C]), ee = z(async () => {
367
- i === _.id ? await s(_.id, o === "asc" ? "desc" : "asc") : await s(_.id, "asc");
433
+ }, [C]), k = R(async () => {
434
+ i === g.id ? await s(g.id, o === "asc" ? "desc" : "asc") : await s(g.id, "asc");
368
435
  }, [
369
- _.id,
436
+ g.id,
370
437
  s,
371
438
  i,
372
439
  o
373
- ]), te = z(async (e) => {
374
- D.current ? (e.preventDefault(), e.stopPropagation(), D.current = !1) : _.comparatorFactory && await ee();
375
- }, [_.comparatorFactory, ee]), ne = z(async (e) => {
376
- await ee();
377
- }, [ee]), re = z(() => {
378
- f((e) => e ? null : h.current);
379
- }, []), A = z(() => {
440
+ ]), te = R(async (e) => {
441
+ D.current ? (e.preventDefault(), e.stopPropagation(), D.current = !1) : g.comparatorFactory && await k();
442
+ }, [g.comparatorFactory, k]), ne = R(async (e) => {
443
+ await k();
444
+ }, [k]), A = R(() => {
445
+ f((e) => e ? null : p.current);
446
+ }, []), re = R(() => {
380
447
  f(null);
381
- }, []), M = z((e) => {
382
- e.button === 0 && (e.preventDefault(), e.stopPropagation(), S(e, _));
383
- }, [_, S]), N = z((e) => {
384
- x(e, _);
385
- }, [_, x]), P = V(() => c.find((e) => e.id === _.id), [_.id, c]), ie = V(() => !!P && !P.isInitialFilterValue(), [P]), ae = z(() => {
386
- _.customHeaderIcon?.onClick({
387
- column: _,
448
+ }, []), ie = R((e) => {
449
+ e.button === 0 && (e.preventDefault(), e.stopPropagation(), S(e, g));
450
+ }, [g, S]), ae = R((e) => {
451
+ x(e, g);
452
+ }, [g, x]), M = B(() => c.find((e) => e.id === g.id), [g.id, c]), N = m(r, (e) => e.filters.find((e) => e.id === g.id)?.isFilterActive() ?? !1), P = R(() => {
453
+ g.customHeaderIcon?.onClick({
454
+ column: g,
388
455
  dataContext: a
389
456
  });
390
- }, [_, a]), F = z(() => {
457
+ }, [g, a]), oe = R(() => {
391
458
  f(null), setTimeout(() => {
392
- h.current.classList.add(st), h.current?.focus(), g.current?.focus();
459
+ p.current.classList.add(yt), p.current?.focus(), h.current?.focus();
393
460
  });
394
- }, []), oe = i === _.id, le = { direction: i === _.id ? o : "asc" }, ue = tt(Q.sortLabelIcon, { [`${Q.sortLabelIcon}--active`]: oe }), de = tt(Q.filterLabelIcon, { [`${Q.filterLabelIcon}--active`]: ie }), fe = !!_.customHeaderIcon, L = !!_.comparatorFactory, me = !!P, he = L || me || fe ? 0 : -1, R = +n.spacing(2).replace("px", ""), ge = V(() => {
395
- if (i === _.id) return o === "asc" ? "ascending" : "descending";
461
+ }, []), le = i === g.id, ue = { direction: i === g.id ? o : "asc" }, de = ft($.sortLabelIcon, { [`${$.sortLabelIcon}--active`]: le }), fe = ft($.filterLabelIcon, { [`${$.filterLabelIcon}--active`]: N }), pe = !!g.customHeaderIcon, he = !!g.comparatorFactory, I = !!M, ge = he || I || pe ? 0 : -1, L = +n.spacing(2).replace("px", ""), _e = B(() => {
462
+ if (i === g.id) return o === "asc" ? "ascending" : "descending";
396
463
  }, [
397
- _.id,
464
+ g.id,
398
465
  i,
399
466
  o
400
467
  ]);
401
- return /* @__PURE__ */ K(ot, {
402
- ariaSort: ge,
468
+ return /* @__PURE__ */ G(_t, {
469
+ ariaSort: _e,
403
470
  canDrag: O,
404
- className: tt(Q.root, { [st]: !!d }),
405
- column: _,
406
- columnIndex: v,
471
+ className: ft($.root, { [yt]: !!d }),
472
+ column: g,
473
+ columnIndex: _,
407
474
  height: b,
408
- onCustomDrag: k,
475
+ onCustomDrag: ee,
409
476
  order: w,
410
- ref: h,
477
+ ref: p,
411
478
  role: "columnheader",
412
479
  sx: {
413
- [`.${Q.filterLabelIcon}--active`]: { color: n.palette.secondary.main },
414
- [`.${Q.sortLabelIcon}--active, .${Q.filterLabelIcon}--active`]: {
480
+ [`.${$.filterLabelIcon}--active`]: { color: n.palette.secondary.main },
481
+ [`.${$.sortLabelIcon}--active, .${$.filterLabelIcon}--active`]: {
415
482
  display: "inline-block",
416
483
  opacity: "1 !important"
417
484
  },
418
- [`.${Q.sortLabelIcon}--active`]: { color: n.palette.text.secondary },
419
- [`&:hover, &:focus-visible, &:focus, &:focus-within, &.${st}`]: {
420
- [`.${Q.columnDivider}`]: { opacity: 1 },
421
- [`.${Q.sortLabelIcon}, .${Q.filterLabelIcon}, .${Q.customHeaderIcon}`]: {
485
+ [`.${$.sortLabelIcon}--active`]: { color: n.palette.text.secondary },
486
+ [`&:hover, &:focus-visible, &:focus, &:focus-within, &.${yt}`]: {
487
+ [`.${$.columnDivider}`]: { opacity: 1 },
488
+ [`.${$.sortLabelIcon}, .${$.filterLabelIcon}, .${$.customHeaderIcon}`]: {
422
489
  display: "inline-block",
423
490
  opacity: .5
424
491
  }
@@ -429,106 +496,106 @@ var nt = /* @__PURE__ */ e((/* @__PURE__ */ t(((e, t) => {
429
496
  justifyContent: "flex-start",
430
497
  textAlign: "left"
431
498
  },
432
- tabIndex: he,
499
+ tabIndex: ge,
433
500
  width: T,
434
501
  xOffset: E,
435
- children: [_.type === "actions" && /* @__PURE__ */ G(j, {
436
- className: Q.content,
502
+ children: [g.type === "actions" && /* @__PURE__ */ W(j, {
503
+ className: $.content,
437
504
  sx: we,
438
505
  children: t`Actions`
439
- }), _.type !== "actions" && /* @__PURE__ */ K(j, {
506
+ }), g.type !== "actions" && /* @__PURE__ */ G(j, {
440
507
  sx: {
441
- [`&:hover .${Q.content}`]: { maxWidth: `calc(100% + 16px - ${(0, nt.default)([
442
- fe ? R : 0,
443
- me ? R : 0,
444
- L ? R : 0,
445
- R
508
+ [`&:hover .${$.content}`]: { maxWidth: `calc(100% + 16px - ${(0, pt.default)([
509
+ pe ? L : 0,
510
+ I ? L : 0,
511
+ he ? L : 0,
512
+ L
446
513
  ])}px)` },
447
514
  alignItems: "center",
448
515
  display: "inline-flex",
449
516
  width: "100%"
450
517
  },
451
518
  children: [
452
- _.renderHeader ? /* @__PURE__ */ G(W, { children: _.renderHeader({
453
- column: _,
519
+ g.renderHeader ? /* @__PURE__ */ W(U, { children: g.renderHeader({
520
+ column: g,
454
521
  dataContext: a
455
- }) }) : /* @__PURE__ */ G(I, {
522
+ }) }) : /* @__PURE__ */ W(F, {
456
523
  arrow: !0,
457
524
  placement: "top",
458
- title: _.headerTooltipContent,
459
- children: /* @__PURE__ */ G(j, {
460
- className: Q.content,
525
+ title: g.headerTooltipContent,
526
+ children: /* @__PURE__ */ W(j, {
527
+ className: $.content,
461
528
  onClick: te,
462
529
  ref: l,
463
530
  sx: {
464
531
  cursor: "pointer",
465
532
  flexGrow: 1,
466
- maxWidth: `calc(100% + 16px - ${(0, nt.default)([
467
- oe ? R : 0,
468
- ie ? R : 0,
469
- R
533
+ maxWidth: `calc(100% + 16px - ${(0, pt.default)([
534
+ le ? L : 0,
535
+ N ? L : 0,
536
+ L
470
537
  ])}px)`,
471
538
  overflow: "hidden",
472
539
  textOverflow: "ellipsis",
473
540
  whiteSpace: "nowrap"
474
541
  },
475
- children: _.renderHeaderContent ? _.renderHeaderContent({
476
- column: _,
542
+ children: g.renderHeaderContent ? g.renderHeaderContent({
543
+ column: g,
477
544
  dataContext: a
478
- }) : _.headerName ?? ""
545
+ }) : g.headerName ?? ""
479
546
  })
480
547
  }),
481
- fe && /* @__PURE__ */ G(lt, {
482
- className: Q.customHeaderIcon,
483
- onClick: ae,
548
+ pe && /* @__PURE__ */ W(xt, {
549
+ className: $.customHeaderIcon,
550
+ onClick: P,
484
551
  tabIndex: 0,
485
- title: _.customHeaderIcon?.label,
486
- children: _.customHeaderIcon?.iconElement
552
+ title: g.customHeaderIcon?.label,
553
+ children: g.customHeaderIcon?.iconElement
487
554
  }),
488
- me && /* @__PURE__ */ K(W, { children: [/* @__PURE__ */ G(ut, {
489
- className: de,
490
- onClick: re,
491
- ref: g,
555
+ I && /* @__PURE__ */ G(U, { children: [/* @__PURE__ */ W(St, {
556
+ className: fe,
557
+ onClick: A,
558
+ ref: h,
492
559
  tabIndex: 0,
493
- title: t("Show filter for {{name}}", { name: _.headerName || t("unknown") }),
494
- children: /* @__PURE__ */ G(Ee, { fontSize: "inherit" })
495
- }), /* @__PURE__ */ G(ce, {
560
+ title: t("Show filter for {{name}}", { name: g.headerName || t("unknown") }),
561
+ children: /* @__PURE__ */ W(Ee, { fontSize: "inherit" })
562
+ }), /* @__PURE__ */ W(ce, {
496
563
  anchorEl: d,
497
564
  anchorOrigin: {
498
565
  horizontal: "center",
499
566
  vertical: "bottom"
500
567
  },
501
568
  id: u,
502
- onClose: F,
569
+ onClose: oe,
503
570
  open: !!d,
504
571
  sx: { zIndex: n.zIndex.appBar + 1 },
505
572
  transformOrigin: {
506
573
  horizontal: "center",
507
574
  vertical: "top"
508
575
  },
509
- children: /* @__PURE__ */ G(se, {
576
+ children: /* @__PURE__ */ W(se, {
510
577
  elevation: 4,
511
578
  square: !0,
512
579
  sx: { padding: n.spacing(3) },
513
- children: /* @__PURE__ */ G(it, {
514
- filter: P,
515
- onFilterChange: A
580
+ children: /* @__PURE__ */ W(ht, {
581
+ filter: M,
582
+ onFilterChange: re
516
583
  })
517
584
  })
518
585
  })] }),
519
- L && /* @__PURE__ */ G(W, { children: /* @__PURE__ */ G(ct, {
520
- className: ue,
586
+ he && /* @__PURE__ */ W(U, { children: /* @__PURE__ */ W(bt, {
587
+ className: de,
521
588
  onClick: ne,
522
- ownerState: le,
589
+ ownerState: ue,
523
590
  tabIndex: 0,
524
- title: t("Toggle sorting for {{name}}", { name: _.headerName || t("unknown") }),
525
- children: /* @__PURE__ */ G(Te, { fontSize: "inherit" })
591
+ title: t("Toggle sorting for {{name}}", { name: g.headerName || t("unknown") }),
592
+ children: /* @__PURE__ */ W(Te, { fontSize: "inherit" })
526
593
  }) }),
527
- _.resizable !== !1 && /* @__PURE__ */ G(j, {
528
- "aria-label": t("Resize column {{name}}, use arrow keys to adjust the size.", { name: _.headerName || t("unknown") }),
529
- className: Q.columnDivider,
530
- onKeyDown: N,
531
- onMouseDown: M,
594
+ g.resizable !== !1 && /* @__PURE__ */ W(j, {
595
+ "aria-label": t("Resize column {{name}}, use arrow keys to adjust the size.", { name: g.headerName || t("unknown") }),
596
+ className: $.columnDivider,
597
+ onKeyDown: ae,
598
+ onMouseDown: ie,
532
599
  role: "separator",
533
600
  sx: {
534
601
  "&:focus-visible, &:focus, &:focus-within": {
@@ -552,13 +619,13 @@ var nt = /* @__PURE__ */ e((/* @__PURE__ */ t(((e, t) => {
552
619
  })
553
620
  ]
554
621
  })]
555
- }, _.id);
556
- }, ft = (e) => {
557
- let t = m(), n = p(t, b((e) => e.dataContext)), [r, i] = U(null), { t: a } = q(), o = !!r, s = z((e) => {
622
+ }, g.id);
623
+ }, wt = (e) => {
624
+ let t = v(), n = m(t, Q((e) => e.dataContext)), [r, i] = H(null), { t: a } = K(), o = !!r, s = R((e) => {
558
625
  i(e.currentTarget);
559
- }, []), c = z(() => {
626
+ }, []), c = R(() => {
560
627
  i(null);
561
- }, []), l = V(() => e.column.getActions({
628
+ }, []), l = B(() => e.column.getActions({
562
629
  dataContext: n,
563
630
  id: e.column.id,
564
631
  row: e.row,
@@ -568,11 +635,11 @@ var nt = /* @__PURE__ */ e((/* @__PURE__ */ t(((e, t) => {
568
635
  e.column,
569
636
  e.row,
570
637
  e.rowIndex
571
- ]), u = z(() => {}, []);
572
- return /* @__PURE__ */ G(ot, {
638
+ ]), u = R(() => {}, []);
639
+ return /* @__PURE__ */ W(_t, {
573
640
  ...e,
574
641
  onClick: u,
575
- children: l.length > 0 && /* @__PURE__ */ K(W, { children: [/* @__PURE__ */ G(F, {
642
+ children: l.length > 0 && /* @__PURE__ */ G(U, { children: [/* @__PURE__ */ W(N, {
576
643
  "aria-label": a`Row actions`,
577
644
  onClick: s,
578
645
  sx: {
@@ -581,8 +648,8 @@ var nt = /* @__PURE__ */ e((/* @__PURE__ */ t(((e, t) => {
581
648
  top: "50%",
582
649
  transform: "translateY(-50%)"
583
650
  },
584
- children: /* @__PURE__ */ G(Ae, {})
585
- }), /* @__PURE__ */ G(oe, {
651
+ children: /* @__PURE__ */ W(Me, {})
652
+ }), /* @__PURE__ */ W(oe, {
586
653
  anchorEl: r,
587
654
  id: "basic-menu",
588
655
  onClick: c,
@@ -592,26 +659,27 @@ var nt = /* @__PURE__ */ e((/* @__PURE__ */ t(((e, t) => {
592
659
  children: l
593
660
  })] })
594
661
  }, e.column.id);
595
- }, pt = ({ children: e }) => {
596
- let t = V(() => ({ sideEffects: Pe({ styles: { active: { opacity: "0.6" } } }) }), []);
597
- return /* @__PURE__ */ G(Me, {
598
- ...J.createAttributes("SortableOverlay"),
662
+ }, Tt = ({ children: e }) => {
663
+ let t = B(() => ({ sideEffects: Ie({ styles: { active: { opacity: "1" } } }) }), []);
664
+ return /* @__PURE__ */ W(Pe, {
665
+ ...q.createAttributes("SortableOverlay"),
599
666
  dropAnimation: t,
667
+ style: { opacity: 1 },
600
668
  zIndex: 1e3,
601
669
  children: e
602
670
  });
603
- }, mt = ge({
671
+ }, Et = L({
604
672
  attributes: void 0,
605
673
  listeners: void 0,
606
674
  ref: void 0
607
- }), ht = (e) => {
675
+ }), Dt = (e) => {
608
676
  let { children: t, value: n } = e;
609
- return /* @__PURE__ */ G(mt, {
677
+ return /* @__PURE__ */ W(Et, {
610
678
  value: n,
611
679
  children: t
612
680
  });
613
- }, gt = ({ children: e, id: t, sx: n }) => {
614
- let r = pe(), { attributes: i, isDragging: a, listeners: o, setActivatorNodeRef: s, setNodeRef: c, transform: l, transition: u } = Be({ id: t }), d = V(() => ({
681
+ }, Ot = ({ children: e, id: t, sx: n }) => {
682
+ let r = me(), { attributes: i, isDragging: a, listeners: o, setActivatorNodeRef: s, setNodeRef: c, transform: l, transition: u } = Be({ id: t }), d = B(() => ({
615
683
  attributes: i,
616
684
  listeners: o,
617
685
  ref: s
@@ -620,36 +688,41 @@ var nt = /* @__PURE__ */ e((/* @__PURE__ */ t(((e, t) => {
620
688
  o,
621
689
  s
622
690
  ]), f = {
623
- backgroundColor: a ? r.palette.secondary.main : r.palette.background.paper,
624
691
  transform: Ve.Translate.toString(l),
625
692
  transition: u
626
693
  };
627
- return /* @__PURE__ */ G(ht, {
694
+ return /* @__PURE__ */ W(Dt, {
628
695
  value: d,
629
- children: /* @__PURE__ */ G(j, {
630
- ...J.createAttributes("SortableListItem", { id: t }),
696
+ children: /* @__PURE__ */ W(j, {
697
+ ...q.createAttributes("SortableListItem", { id: t }),
631
698
  component: "li",
632
699
  ref: c,
700
+ role: "row",
633
701
  style: f,
634
702
  sx: {
635
703
  ...n ?? {},
704
+ "&:hover": { backgroundColor: a ? r.palette.background.paper : r.palette.action.hover },
636
705
  alignItems: "center",
637
706
  backgroundColor: r.palette.background.paper,
638
- borderRadius: `${r.shape.borderRadius}px`,
639
- boxShadow: 1,
707
+ borderBottom: `1px solid ${r.palette.divider}`,
708
+ boxShadow: a ? r.shadows[6] : void 0,
640
709
  boxSizing: "border-box",
641
- display: "flex",
642
- flexGrow: 1,
710
+ display: "grid",
711
+ gridTemplateColumns: "100px 1fr 100px",
643
712
  justifyContent: "space-between",
644
- listStyle: "none"
713
+ listStyle: "none",
714
+ outline: a ? `2px solid ${r.palette.primary.main}` : void 0,
715
+ outlineOffset: a ? "-2px" : void 0,
716
+ position: a ? "relative" : void 0,
717
+ zIndex: a ? 1 : void 0
645
718
  },
646
719
  children: e
647
720
  })
648
721
  });
649
- }, _t = ({ name: e }) => {
650
- let t = pe(), { attributes: n, listeners: r, ref: i } = ve(mt);
651
- return /* @__PURE__ */ G(j, {
652
- ...J.createAttributes("SortableListItemDragHandle"),
722
+ }, kt = ({ name: e }) => {
723
+ let t = me(), { attributes: n, listeners: r, ref: i } = ve(Et);
724
+ return /* @__PURE__ */ W(j, {
725
+ ...q.createAttributes("SortableListItemDragHandle"),
653
726
  component: "button",
654
727
  ...n,
655
728
  ...r,
@@ -657,7 +730,10 @@ var nt = /* @__PURE__ */ e((/* @__PURE__ */ t(((e, t) => {
657
730
  name: e,
658
731
  ref: i,
659
732
  sx: {
660
- "&:focus-visible": { boxShadow: `0 0px 0px 2px ${t.palette.primary.main}` },
733
+ "&:focus-visible": {
734
+ outline: `2px solid ${t.palette.primary.main}`,
735
+ outlineOffset: 2
736
+ },
661
737
  "&:hover": { backgroundColor: t.palette.action.hover },
662
738
  alignItems: "center",
663
739
  appearance: "none",
@@ -671,241 +747,332 @@ var nt = /* @__PURE__ */ e((/* @__PURE__ */ t(((e, t) => {
671
747
  outline: "none",
672
748
  touchAction: "none"
673
749
  },
674
- children: /* @__PURE__ */ G(He, {})
750
+ type: "button",
751
+ children: /* @__PURE__ */ W(He, {})
675
752
  });
676
- }, vt = ({ items: e, onChange: t, renderItemContent: n }) => {
677
- let r = pe(), { t: i } = q(), [a, o] = U(null), s = V(() => e.find((e) => e.id === a?.id), [a, e]), c = Ie(Fe(Ne), Fe(Z, { coordinateGetter: ze })), l = z(() => {
678
- o(null);
679
- }, []), u = z(({ active: n, over: r }) => {
753
+ }, At = ({ items: e, onChange: t, renderHeaderContent: n, renderItemContent: r }) => {
754
+ let i = me(), { t: a } = K(), [o, s] = H(null), c = B(() => e.find((e) => e.id === o?.id), [o, e]), l = R((t) => e.find((e) => e.id === t), [e]), u = R((t) => e.findIndex((e) => e.id === t) + 1, [e]), d = Le(X(Y), X(Fe, { coordinateGetter: ze })), f = R(() => {
755
+ s(null);
756
+ }, []), p = R(({ active: n, over: r }) => {
680
757
  if (r && n.id !== r?.id) {
681
758
  let i = e.findIndex(({ id: e }) => e === n.id), a = e.findIndex(({ id: e }) => e === r.id);
682
759
  t(Re(e, i, a));
683
760
  }
684
- o(null);
685
- }, [e, t]), d = z(({ active: e }) => {
686
- o(e);
687
- }, []), f = z((n) => {
761
+ s(null);
762
+ }, [e, t]), m = R(({ active: e }) => {
763
+ s(e);
764
+ }, []), h = R((n) => {
688
765
  let r = n.target.getAttribute("data-id");
689
- if (!r) return;
766
+ if (r === null) return;
690
767
  let i = n.target.checked;
691
- t(e.map((e) => e.id === r ? {
768
+ t(e.map((e) => String(e.id) === r ? {
692
769
  ...e,
693
770
  isSelected: i
694
771
  } : e));
695
- }, [t, e]), p = z((e) => /* @__PURE__ */ K(gt, {
772
+ }, [t, e]), g = R((e) => /* @__PURE__ */ G(Ot, {
696
773
  id: e.id,
697
- sx: {
698
- "&:hover": { backgroundColor: r.palette.action.hover },
699
- backgroundColor: r.palette.background.paper
700
- },
701
- children: [/* @__PURE__ */ G(ie, {
702
- control: /* @__PURE__ */ G(N, {
703
- checked: e.isSelected,
704
- onChange: f,
705
- size: "small",
706
- slotProps: { input: { "data-id": e.id } }
774
+ children: [
775
+ /* @__PURE__ */ W(j, {
776
+ role: "cell",
777
+ children: /* @__PURE__ */ W(M, {
778
+ control: /* @__PURE__ */ W(ie, {
779
+ "aria-label": a("Visibility for {{label}}", { label: e.label }),
780
+ checked: e.isSelected,
781
+ name: e.label,
782
+ onChange: h,
783
+ size: "small",
784
+ slotProps: { input: { "data-id": e.id } }
785
+ }),
786
+ label: "",
787
+ sx: { paddingLeft: i.spacing(1) }
788
+ })
707
789
  }),
708
- label: n(e),
709
- sx: {
710
- flexGrow: 1,
711
- paddingLeft: r.spacing(1)
712
- }
713
- }), /* @__PURE__ */ G(_t, { name: i("Drag handle for {{label}}", { label: e.label }) })]
790
+ r(e),
791
+ /* @__PURE__ */ W(j, {
792
+ role: "cell",
793
+ sx: {
794
+ alignItems: "center",
795
+ display: "flex",
796
+ justifyContent: "flex-end",
797
+ paddingRight: i.spacing(1),
798
+ width: "100%"
799
+ },
800
+ children: /* @__PURE__ */ W(kt, { name: a("Drag handle for {{label}}", { label: e.label }) })
801
+ })
802
+ ]
714
803
  }, e.id), [
715
- f,
716
- n,
717
- i,
718
- r
804
+ h,
805
+ r,
806
+ a,
807
+ i
719
808
  ]);
720
- return /* @__PURE__ */ K(X, {
721
- onDragCancel: l,
722
- onDragEnd: u,
723
- onDragStart: d,
724
- sensors: c,
725
- children: [/* @__PURE__ */ G(Le, {
726
- items: e,
727
- children: /* @__PURE__ */ G(ae, { children: /* @__PURE__ */ G(j, {
728
- ...J.createAttributes("SortableList"),
729
- component: "ul",
809
+ return /* @__PURE__ */ G(Ne, {
810
+ accessibility: {
811
+ announcements: {
812
+ onDragCancel: ({ active: t }) => {
813
+ let n = l(t.id);
814
+ if (n) return a("Reordering {{label}} cancelled. {{label}} returned to position {{position}} of {{count}}.", {
815
+ count: e.length,
816
+ label: n.label,
817
+ position: u(t.id)
818
+ });
819
+ },
820
+ onDragEnd: ({ active: t, over: n }) => {
821
+ let r = l(t.id);
822
+ if (r) return n ? a("{{label}} dropped at position {{position}} of {{count}}.", {
823
+ count: e.length,
824
+ label: r.label,
825
+ position: u(n.id)
826
+ }) : a("{{label}} returned to position {{position}} of {{count}}.", {
827
+ count: e.length,
828
+ label: r.label,
829
+ position: u(t.id)
830
+ });
831
+ },
832
+ onDragOver: ({ active: t, over: n }) => {
833
+ let r = l(t.id);
834
+ if (r && n) return a("{{label}} moved to position {{position}} of {{count}}.", {
835
+ count: e.length,
836
+ label: r.label,
837
+ position: u(n.id)
838
+ });
839
+ },
840
+ onDragStart: ({ active: t }) => {
841
+ let n = l(t.id);
842
+ if (n) return a("Picked up {{label}}. Position {{position}} of {{count}}.", {
843
+ count: e.length,
844
+ label: n.label,
845
+ position: u(t.id)
846
+ });
847
+ }
848
+ },
849
+ screenReaderInstructions: { draggable: a("To reorder an item, focus its drag handle and press Space. Use arrow keys to move it. Press Space to drop, or Escape to cancel.") }
850
+ },
851
+ onDragCancel: f,
852
+ onDragEnd: p,
853
+ onDragStart: m,
854
+ sensors: d,
855
+ children: [/* @__PURE__ */ G(j, {
856
+ "aria-label": a("Change column order and visibility"),
857
+ role: "table",
858
+ children: [/* @__PURE__ */ G(j, {
859
+ role: "row",
730
860
  sx: {
731
- display: "flex",
732
- flexDirection: "column",
733
- gap: r.spacing(.5),
734
- listStyle: "none",
735
- padding: 0
861
+ alignItems: "center",
862
+ borderBottom: `1px solid ${i.palette.divider}`,
863
+ display: "grid",
864
+ gridTemplateColumns: "100px 1fr 100px",
865
+ height: i.spacing(5)
736
866
  },
737
- children: e.map((e) => p(e))
738
- }) })
739
- }), /* @__PURE__ */ G(pt, { children: s ? p(s) : null })]
867
+ children: [
868
+ /* @__PURE__ */ W(j, {
869
+ component: "div",
870
+ role: "columnheader",
871
+ sx: { fontWeight: "bold" },
872
+ children: a`Visible`
873
+ }),
874
+ n ? n() : /* @__PURE__ */ W(j, {
875
+ component: "div",
876
+ role: "columnheader",
877
+ sx: { fontWeight: "bold" },
878
+ children: a`Column`
879
+ }),
880
+ /* @__PURE__ */ W(j, {
881
+ "aria-label": a`Reorder`,
882
+ role: "columnheader"
883
+ })
884
+ ]
885
+ }), /* @__PURE__ */ W(Z, {
886
+ items: e,
887
+ children: /* @__PURE__ */ W(j, {
888
+ ...q.createAttributes("SortableList"),
889
+ component: "ul",
890
+ role: "rowgroup",
891
+ sx: {
892
+ gap: i.spacing(.5),
893
+ listStyle: "none",
894
+ margin: 0,
895
+ padding: 0
896
+ },
897
+ children: e.map((e) => g(e))
898
+ })
899
+ })]
900
+ }), /* @__PURE__ */ W(Tt, { children: c ? g(c) : null })]
740
901
  });
741
- }, yt = je(({ onActionsChange: e, onClose: t, onTitleChange: n, openProps: { hasCellData: r } }) => {
742
- let { t: i } = q(), [a, o] = U([]), s = m(), c = p(s, b((e) => e.emitEvent)), l = p(s, b((e) => e.dataContext)), d = p(s, b((e) => e.getCurrentColumnVisualSettings())), f = p(s, b((e) => e.columns)), h = p(s, b((e) => e.sortedData)), g = V(() => {
902
+ }, jt = J(({ onActionsChange: e, onClose: t, onTitleChange: n, openProps: { hasCellData: r }, renderHeaderContent: i, renderItemContent: a }) => {
903
+ let { t: o } = K(), [s, c] = H([]), l = v(), u = m(l, Q((e) => e.emitEvent)), d = m(l, Q((e) => e.dataContext)), f = m(l, Q((e) => e.getCurrentColumnVisualSettings())), h = m(l, Q((e) => e.columns)), g = m(l, Q((e) => e.sortedData)), _ = B(() => {
743
904
  let e = /* @__PURE__ */ new Map();
744
- return f.forEach((t) => {
905
+ return h.forEach((t) => {
745
906
  e.set(t.id, t);
746
907
  }), e;
747
- }, [f]), _ = z((e) => {
908
+ }, [h]), y = R((e) => {
748
909
  let t = [];
749
910
  e.forEach((e) => {
750
- let n = g.get(e.id);
911
+ let n = _.get(e.id);
751
912
  n && !n.frozen && t.push({
913
+ column: n,
752
914
  id: n.id,
753
915
  isSelected: e.isVisible,
916
+ itemContent: n.headerName,
754
917
  label: n.headerName
755
918
  });
756
- }), o(t);
757
- }, [g]);
758
- B(() => {
759
- _(d);
760
- }, [d, _]);
761
- let v = z(() => {
762
- _(u.createInitialVisualColumnSettings(f));
763
- }, [f, _]);
764
- B(() => {
765
- n(i`Change column order and visibility`);
766
- }, [n, i]);
767
- let y = z(() => {
768
- c("columnVisibilityChange", [...f.filter((e) => e.frozen).map((e) => e.id), ...a.filter((e) => e.isSelected).map((e) => e.id.toString())]);
769
- let e = f.findIndex((e) => !e.frozen), n = f.slice(0, e), r = f.slice(e + a.length);
770
- c("columnOrderChange", [
919
+ }), c(t);
920
+ }, [_]);
921
+ z(() => {
922
+ y(f);
923
+ }, [f, y]);
924
+ let b = R(() => {
925
+ y(p.createInitialVisualColumnSettings(h));
926
+ }, [h, y]);
927
+ z(() => {
928
+ n(o`Change column order and visibility`);
929
+ }, [n, o]);
930
+ let x = R(() => {
931
+ u("columnVisibilityChange", [...h.filter((e) => e.frozen).map((e) => e.id), ...s.filter((e) => e.isSelected).map((e) => e.id.toString())]);
932
+ let e = h.findIndex((e) => !e.frozen), n = h.slice(0, e), r = h.slice(e + s.length);
933
+ u("columnOrderChange", [
771
934
  ...n.map((e) => e.id),
772
- ...a.map((e) => e.id.toString()),
935
+ ...s.map((e) => e.id.toString()),
773
936
  ...r.map((e) => e.id)
774
937
  ]), t();
775
938
  }, [
776
- f,
777
- c,
778
- a,
939
+ h,
940
+ u,
941
+ s,
779
942
  t
780
- ]), x = z((e) => {
781
- let t = u.getColumnIdsWithData({
782
- dataContext: l,
943
+ ]), S = R((e) => {
944
+ let t = p.getColumnIdsWithData({
945
+ dataContext: d,
783
946
  hasCellData: r,
784
- sortedData: h,
785
- tableColumns: f,
786
- visibleColumnIds: a.filter(e).map((e) => e.id.toString())
947
+ sortedData: g,
948
+ tableColumns: h,
949
+ visibleColumnIds: s.filter(e).map((e) => e.id.toString())
787
950
  });
788
- o((e) => e.map((e) => ({
951
+ c((e) => e.map((e) => ({
789
952
  ...e,
790
953
  isSelected: t.includes(e.id.toString())
791
954
  })));
792
955
  }, [
793
- l,
956
+ d,
794
957
  r,
795
- a,
796
- h,
797
- f
798
- ]), S = z(() => {
799
- x(() => !0);
800
- }, [x]), C = z(() => {
801
- x((e) => e.isSelected);
802
- }, [x]), w = z(() => {
803
- o((e) => e.map((e) => ({
958
+ s,
959
+ g,
960
+ h
961
+ ]), C = R(() => {
962
+ S(() => !0);
963
+ }, [S]), w = R(() => {
964
+ S((e) => e.isSelected);
965
+ }, [S]), T = R(() => {
966
+ c((e) => e.map((e) => ({
804
967
  ...e,
805
968
  isSelected: !0
806
969
  })));
807
- }, []), T = z(() => {
808
- o((e) => e.map((e) => ({
970
+ }, []), E = R(() => {
971
+ c((e) => e.map((e) => ({
809
972
  ...e,
810
973
  isSelected: !1
811
974
  })));
812
975
  }, []);
813
- B(() => {
976
+ z(() => {
814
977
  e([
815
978
  {
816
- ...J.createAttributes("TableColumnOrderDialog-enable-all"),
979
+ ...q.createAttributes("TableColumnOrderDialog-enable-all"),
817
980
  autoFocus: !0,
818
981
  color: "secondary",
819
- label: i`Enable all`,
820
- onClick: w,
982
+ label: o`Show all`,
983
+ onClick: T,
821
984
  variant: "outlined"
822
985
  },
823
986
  {
824
- ...J.createAttributes("TableColumnOrderDialog-enable-all-with-data"),
987
+ ...q.createAttributes("TableColumnOrderDialog-enable-all-with-data"),
825
988
  autoFocus: !0,
826
989
  color: "secondary",
827
- label: i`Enable all with data`,
828
- onClick: S,
990
+ label: o`Show all with data`,
991
+ onClick: C,
829
992
  variant: "outlined"
830
993
  },
831
994
  {
832
- ...J.createAttributes("TableColumnOrderDialog-disable-all"),
995
+ ...q.createAttributes("TableColumnOrderDialog-disable-all"),
833
996
  autoFocus: !0,
834
997
  color: "secondary",
835
- label: i`Disable all`,
836
- onClick: T,
998
+ label: o`Hide all`,
999
+ onClick: E,
837
1000
  variant: "outlined"
838
1001
  },
839
1002
  {
840
- ...J.createAttributes("TableColumnOrderDialog-disable-all-without-data"),
1003
+ ...q.createAttributes("TableColumnOrderDialog-disable-all-without-data"),
841
1004
  autoFocus: !0,
842
1005
  color: "secondary",
843
- label: i`Disable all without data`,
844
- onClick: C,
1006
+ label: o`Hide all without data`,
1007
+ onClick: w,
845
1008
  variant: "outlined"
846
1009
  },
847
1010
  {
848
- ...J.createAttributes("TableColumnOrderDialog-reset"),
1011
+ ...q.createAttributes("TableColumnOrderDialog-reset"),
849
1012
  autoFocus: !0,
850
1013
  color: "secondary",
851
- label: i`Reset to default`,
852
- onClick: v,
1014
+ label: o`Reset to default`,
1015
+ onClick: b,
853
1016
  variant: "outlined"
854
1017
  },
855
1018
  {
856
- ...J.createAttributes("TableColumnOrderDialog-close"),
1019
+ ...q.createAttributes("TableColumnOrderDialog-close"),
857
1020
  autoFocus: !0,
858
1021
  color: "primary",
859
- label: i`Close`,
1022
+ label: o`Close`,
860
1023
  onClick: t,
861
1024
  variant: "outlined"
862
1025
  },
863
1026
  {
864
- ...J.createAttributes("TableColumnOrderDialog-save"),
1027
+ ...q.createAttributes("TableColumnOrderDialog-save"),
865
1028
  autoFocus: !0,
866
1029
  color: "secondary",
867
- label: i`Apply`,
868
- onClick: y,
1030
+ label: o`Apply`,
1031
+ onClick: x,
869
1032
  variant: "contained"
870
1033
  }
871
1034
  ]);
872
1035
  }, [
873
1036
  e,
874
1037
  t,
1038
+ E,
1039
+ C,
1040
+ b,
1041
+ x,
875
1042
  T,
876
- S,
877
- v,
878
- y,
879
- w,
880
- i,
881
- C
1043
+ o,
1044
+ w
882
1045
  ]);
883
- let E = z((e) => {
884
- o(e);
885
- }, []), D = z((e) => e.label, []);
886
- return /* @__PURE__ */ G(j, {
1046
+ let D = R((e) => {
1047
+ c(e);
1048
+ }, []), O = R((e) => /* @__PURE__ */ W(j, {
1049
+ role: "cell",
1050
+ children: e.label
1051
+ }), []);
1052
+ return /* @__PURE__ */ W(j, {
887
1053
  sx: {},
888
- children: /* @__PURE__ */ G(vt, {
889
- items: a,
890
- onChange: E,
891
- renderItemContent: D
1054
+ children: /* @__PURE__ */ W(At, {
1055
+ items: s,
1056
+ onChange: D,
1057
+ renderHeaderContent: i,
1058
+ renderItemContent: a ?? O
892
1059
  })
893
1060
  });
894
1061
  }, {
895
1062
  defaultTitle: "",
896
1063
  disableBackdropClick: !1,
897
1064
  fullWidth: !0,
898
- maxWidth: "md",
1065
+ maxWidth: "lg",
899
1066
  noCloseButton: !1,
900
1067
  testId: "TableColumnOrderDialog"
901
- }), bt = ({ cell: e, onCheckBoxClick: t, tableColumn: n }) => {
902
- let { t: r } = q(), i = m(), a = p(i, b((e) => e.idSelectorCallback)), o = p(i, b((e) => e.selectedIds)), s = p(i, b((e) => e.setSelectedIds)), c = a(e.row), l = z((e) => {
1068
+ }), Mt = ({ cell: e, onCheckBoxClick: t, tableColumn: n }) => {
1069
+ let { t: r } = K(), i = v(), a = m(i, Q((e) => e.idSelectorCallback)), o = m(i, Q((e) => e.selectedIds)), s = m(i, Q((e) => e.setSelectedIds)), c = a(e.row), l = R((e) => {
903
1070
  e.stopPropagation(), e.shiftKey && e.preventDefault(), t(e, c);
904
- }, [t, c]), u = z((e, t) => {
1071
+ }, [t, c]), u = R((e, t) => {
905
1072
  let n = e.target.getAttribute("name");
906
1073
  t && !o.includes(n) ? s([...o, n]) : t || s(o.filter((e) => e !== n));
907
1074
  }, [o, s]);
908
- return /* @__PURE__ */ G(N, {
1075
+ return /* @__PURE__ */ W(ie, {
909
1076
  checked: o.includes(c),
910
1077
  disabled: n.isDisabled ? n.isDisabled(e) : !1,
911
1078
  name: a(e.row),
@@ -917,15 +1084,15 @@ var nt = /* @__PURE__ */ e((/* @__PURE__ */ t(((e, t) => {
917
1084
  padding: 0
918
1085
  }
919
1086
  });
920
- }, xt = /* @__PURE__ */ e(y(), 1), St = ({ tableColumnParams: e }) => {
921
- let { t } = q(), n = e.column, r = m(), i = p(r, b((e) => e.dataContext)), a = p(r, b((e) => e.idSelectorCallback)), o = p(r, b((e) => e.selectedIds)), s = p(r, b((e) => e.sortedData)), c = p(r, b((e) => e.setSelectedIds)), l = n.isDisabled ? s.filter((e) => n.isDisabled({
1087
+ }, Nt = /* @__PURE__ */ e(l(), 1), Pt = ({ tableColumnParams: e }) => {
1088
+ let { t } = K(), n = e.column, r = v(), i = m(r, Q((e) => e.dataContext)), a = m(r, Q((e) => e.idSelectorCallback)), o = m(r, Q((e) => e.selectedIds)), s = m(r, Q((e) => e.sortedData)), c = m(r, Q((e) => e.setSelectedIds)), l = n.isDisabled ? s.filter((e) => n.isDisabled({
922
1089
  dataContext: i,
923
1090
  id: a(e),
924
1091
  row: e,
925
1092
  rowIndex: s.indexOf(e)
926
- }) === !1) : s, u = l.every((e) => o.includes(a(e))), d = l.some((e) => o.includes(a(e))), f = z((e) => {
1093
+ }) === !1) : s, u = l.every((e) => o.includes(a(e))), d = l.some((e) => o.includes(a(e))), f = R((e) => {
927
1094
  let t = l.map((e) => a(e));
928
- c(u ? o.filter((e) => !t.includes(e)) : (0, xt.default)([...o, ...t]));
1095
+ c(u ? o.filter((e) => !t.includes(e)) : (0, Nt.default)([...o, ...t]));
929
1096
  }, [
930
1097
  l,
931
1098
  a,
@@ -933,9 +1100,9 @@ var nt = /* @__PURE__ */ e((/* @__PURE__ */ t(((e, t) => {
933
1100
  o,
934
1101
  c
935
1102
  ]);
936
- return /* @__PURE__ */ G(N, {
1103
+ return /* @__PURE__ */ W(ie, {
937
1104
  checked: d,
938
- checkedIcon: u ? void 0 : /* @__PURE__ */ G(Ue, {}),
1105
+ checkedIcon: u ? void 0 : /* @__PURE__ */ W(Ue, {}),
939
1106
  name: "select-all",
940
1107
  onChange: f,
941
1108
  slotProps: { input: { "aria-label": t`Select all` } },
@@ -944,11 +1111,11 @@ var nt = /* @__PURE__ */ e((/* @__PURE__ */ t(((e, t) => {
944
1111
  padding: 0
945
1112
  }
946
1113
  });
947
- }, Ct = ({ cell: e, getRowName: t, onReadableIndexClick: n, tableColumn: r }) => {
948
- let i = _(), a = z((r) => {
1114
+ }, Ft = ({ cell: e, getRowName: t, onReadableIndexClick: n, tableColumn: r }) => {
1115
+ let i = g(), a = R((r) => {
949
1116
  if (n) {
950
1117
  if (!t) throw Error("getRowName is required when onReadableIndexClick is provided");
951
- i.enablePageEvents && ne.resolve(h).emit("click", {
1118
+ i.enablePageEvents && te.resolve(h).emit("click", {
952
1119
  label: t(e.row),
953
1120
  type: "table-row-index"
954
1121
  }), r.preventDefault(), r.stopPropagation(), n(e.row);
@@ -959,7 +1126,7 @@ var nt = /* @__PURE__ */ e((/* @__PURE__ */ t(((e, t) => {
959
1126
  n,
960
1127
  e.row
961
1128
  ]);
962
- return n ? /* @__PURE__ */ G(M, {
1129
+ return n ? /* @__PURE__ */ W(re, {
963
1130
  "aria-label": r.getAriaLabel(e),
964
1131
  color: "primary",
965
1132
  onClick: a,
@@ -973,546 +1140,555 @@ var nt = /* @__PURE__ */ e((/* @__PURE__ */ t(((e, t) => {
973
1140
  variant: "text",
974
1141
  children: e.rowIndex + 1
975
1142
  }) : e.rowIndex + 1;
976
- }, wt = ({ font: e, forceHorizontalOverflow: t, getRowName: n, headerHeight: r = 4, initialVisibleItemIndex: i, onRangeChanged: a = Ze.default, onReadableIndexClick: o, onRowClick: s, onRowMouseEnter: c = Ze.default, onRowMouseLeave: l = Ze.default, onVerticalScrollPositionChange: d, onVisibleItemIndexChange: f, overscanMain: g, overscanReverse: v, ref: y, rowHeight: x = 4, rowHighlightingSubject: S, sx: C }) => {
977
- let w = pe(), { t: T } = q(), E = _(), D = ne.resolve(re), O = m(), { DEFAULT_OVERSCAN_MAIN: k, DEFAULT_OVERSCAN_REVERSE: ee } = E.table;
978
- p(O, b((e) => e.getCurrentColumnVisualSettings().filter((e) => e.isVisible).map((e) => e.id)));
979
- let te = p(O, b((e) => e.setCurrentColumnVisualSettings)), A = p(O, b((e) => e.sortedData)), M = p(O, b((e) => e.idSelectorCallback)), N = p(O, b((e) => e.columns)), P = p(O, b((e) => e.isInitialized)), ie = p(O, b((e) => e.isRowEnabledCallback)), ae = p(O, b((e) => e.addEventListener)), F = p(O, b((e) => e.dataContext)), oe = p(O, b((e) => e.isCondensed)), se = p(O, b((e) => e.setSelectedIds)), ce = p(O, b((e) => e.columnDimensions)), I = H(null), le = H(Ze.default), [L, me] = U(!1), he = V(() => fe(ue(w.palette.divider, 1), .1), [w.palette.divider]), ge = V(() => de(ue(w.palette.divider, 1), .15), [w.palette.divider]), ve = Ce(), ye = H(null), we = H(0), Te = H(null), Ee = H(/* @__PURE__ */ new Set()), De = H(!1), Oe = H(null), [Y, ke] = U(), Ae = H(null), je = H(null), X = H(null);
980
- p(O, (e) => JSON.stringify(e.filters.map((e) => e.filterValue))), p(O, b((e) => e.sortByField)), p(O, b((e) => e.sortDirection));
981
- let Me = z((e, t) => {
1143
+ }, It = ({ font: e, forceHorizontalOverflow: t, getRowName: n, headerHeight: r = 4, initialVisibleItemIndex: i, onRangeChanged: a = rt.default, onReadableIndexClick: o, onRowClick: s, onRowMouseEnter: c = rt.default, onRowMouseLeave: l = rt.default, onVerticalScrollPositionChange: u, onVisibleItemIndexChange: d, overscanMain: f, overscanReverse: _, ref: y, renderColumnsEditorHeaderContent: b, renderColumnsEditorItemContent: x, rowHeight: S = 4, rowHighlightingSubject: C, sx: w }) => {
1144
+ let T = me(), E = T.spacing(S), D = +E.replace("px", ""), { t: O } = K(), ee = g(), k = te.resolve(ne), A = v(), { DEFAULT_OVERSCAN_MAIN: re, DEFAULT_OVERSCAN_REVERSE: ie } = ee.table;
1145
+ m(A, Q((e) => e.getCurrentColumnVisualSettings().filter((e) => e.isVisible).map((e) => e.id)));
1146
+ let ae = m(A, Q((e) => e.setCurrentColumnVisualSettings)), M = m(A, Q((e) => e.sortedData)), N = m(A, Q((e) => e.idSelectorCallback)), P = m(A, Q((e) => e.columns)), oe = m(A, Q((e) => e.isInitialized)), se = m(A, Q((e) => e.isRowEnabledCallback)), ce = m(A, Q((e) => e.addEventListener)), F = m(A, Q((e) => e.dataContext)), le = m(A, Q((e) => e.isCondensed)), pe = m(A, Q((e) => e.setSelectedIds)), he = m(A, Q((e) => e.columnDimensions)), I = V(null), L = V(rt.default), [ve, ye] = H(!1), we = B(() => fe(ue(T.palette.divider, 1), .1), [T.palette.divider]), Te = B(() => de(ue(T.palette.divider, 1), .15), [T.palette.divider]), Ee = Ce(), De = V(null), Oe = V(0), ke = V(null), Ae = V(/* @__PURE__ */ new Set()), je = V(!1), Me = V(null), [J, Ne] = H(), Pe = V(null), Fe = V(null), Y = V(null);
1147
+ m(A, (e) => JSON.stringify(e.filters.map((e) => [e.filterValue, e.includeMissingValues]))), m(A, Q((e) => e.sortByField)), m(A, Q((e) => e.sortDirection));
1148
+ let Ie = R((e, t) => {
982
1149
  if (s) {
983
1150
  if (!n) throw Error("getRowName is required when onRowClick is provided");
984
- E.enablePageEvents && ne.resolve(h).emit("click", {
1151
+ ee.enablePageEvents && te.resolve(h).emit("click", {
985
1152
  label: n(e.row),
986
1153
  type: "table-row"
987
1154
  }), t.preventDefault(), t.stopPropagation(), s(e);
988
1155
  }
989
1156
  }, [
990
- E.enablePageEvents,
1157
+ ee.enablePageEvents,
991
1158
  n,
992
1159
  s
993
- ]), Z = z(() => I?.current?.filter((e) => e.isVisible) ?? [], []), Ne = z(() => {
994
- if (!I?.current?.length || !Y) return;
995
- let e = (0, Je.default)(Z(), (e) => e.calculatedWidth), t = Y.querySelector("[role=table]");
996
- we.current = e, t && (t.style.width = `${e}px`);
997
- }, [Z, Y]);
1160
+ ]), X = R(() => I?.current?.filter((e) => e.isVisible) ?? [], []), Le = B(() => {
1161
+ let e = /* @__PURE__ */ new Map();
1162
+ return P.forEach((t) => {
1163
+ e.set(t.id, t);
1164
+ }), e;
1165
+ }, [P]), Z = R(() => {
1166
+ if (!I?.current?.length || !J) return;
1167
+ let e = (0, et.default)(X(), (e) => e.calculatedWidth), t = J.querySelector("[role=table]");
1168
+ Oe.current = e, t && (t.style.width = `${e}px`);
1169
+ }, [X, J]);
998
1170
  xe(() => {
999
- Ne();
1000
- }, [Ne]);
1001
- let Pe = z((e, t) => /* @__PURE__ */ G(Ct, {
1171
+ Z();
1172
+ }, [Z]);
1173
+ let Re = R((e, t) => /* @__PURE__ */ W(Ft, {
1002
1174
  cell: t,
1003
1175
  getRowName: n,
1004
1176
  onReadableIndexClick: o,
1005
1177
  tableColumn: e
1006
- }, t.id), [n, o]), Fe = z((e) => /* @__PURE__ */ G(St, { tableColumnParams: e }), []);
1007
- B(() => {
1008
- je.current = null;
1009
- }, [A]);
1010
- let Ie = z((e, t) => {
1011
- if (!e.shiftKey || !je.current) {
1012
- je.current = t;
1178
+ }, t.id), [n, o]), ze = R((e) => /* @__PURE__ */ W(Pt, { tableColumnParams: e }), []);
1179
+ z(() => {
1180
+ Fe.current = null;
1181
+ }, [M]);
1182
+ let Be = R((e, t) => {
1183
+ if (!e.shiftKey || !Fe.current) {
1184
+ Fe.current = t;
1013
1185
  return;
1014
1186
  }
1015
- let n = A.findIndex((e) => M(e) === je.current), r = A.findIndex((e) => M(e) === t);
1187
+ let n = M.findIndex((e) => N(e) === Fe.current), r = M.findIndex((e) => N(e) === t);
1016
1188
  if (n === -1 || r === -1) return;
1017
- let [i, a] = n < r ? [n, r] : [r, n], o = A.slice(i, a + 1).map((e) => M(e)), s = O.getState().selectedIds, c = O.getState().selectedIds.includes(t) ? s.filter((e) => !o.includes(e)) : Array.from(/* @__PURE__ */ new Set([...s, ...o]));
1018
- se(c), je.current = t;
1189
+ let [i, a] = n < r ? [n, r] : [r, n], o = M.slice(i, a + 1).map((e) => N(e)), s = A.getState().selectedIds, c = A.getState().selectedIds.includes(t) ? s.filter((e) => !o.includes(e)) : Array.from(/* @__PURE__ */ new Set([...s, ...o]));
1190
+ pe(c), Fe.current = t;
1019
1191
  }, [
1192
+ N,
1193
+ pe,
1020
1194
  M,
1021
- se,
1022
- A,
1023
- O
1024
- ]), Le = z((e, t) => {
1025
- let n = M(t.row);
1026
- return /* @__PURE__ */ G(bt, {
1195
+ A
1196
+ ]), Ve = R((e, t) => {
1197
+ let n = N(t.row);
1198
+ return /* @__PURE__ */ W(Mt, {
1027
1199
  cell: t,
1028
- onCheckBoxClick: Ie,
1200
+ onCheckBoxClick: Be,
1029
1201
  tableColumn: e
1030
1202
  }, n);
1031
- }, [M, Ie]), Re = z(() => {
1032
- if (!N.length || !Y) return;
1033
- let e = u.updateColumnSizesInVisualSettings(Y, ve, A, N, I.current);
1034
- L && (Y.querySelectorAll("[data-column-index]").forEach((t) => {
1203
+ }, [N, Be]), He = R(() => {
1204
+ if (!P.length || !J) return;
1205
+ let e = p.updateColumnSizesInVisualSettings(J, Ee, M, P, I.current);
1206
+ ve && (J.querySelectorAll("[data-column-index]").forEach((t) => {
1035
1207
  let n = t.getAttribute("data-id");
1036
1208
  t.style.width = `${e.get(n).calculatedWidth}px`;
1037
- }), Ne());
1209
+ }), Z());
1038
1210
  }, [
1039
- L,
1040
1211
  ve,
1041
- A,
1042
- N,
1043
- Y,
1044
- Ne
1212
+ Ee,
1213
+ M,
1214
+ P,
1215
+ J,
1216
+ Z
1045
1217
  ]);
1046
- B(() => {
1047
- Y && !L && P && (I.current = O.getState().getCurrentColumnVisualSettings(), Re(), Ne(), me(!0));
1218
+ z(() => {
1219
+ J && !ve && oe && (I.current = A.getState().getCurrentColumnVisualSettings(), He(), Z(), ye(!0));
1048
1220
  }, [
1049
- L,
1050
- P,
1051
- Y,
1052
- O,
1053
- Re,
1054
- Ne
1221
+ ve,
1222
+ oe,
1223
+ J,
1224
+ A,
1225
+ He,
1226
+ Z
1055
1227
  ]);
1056
- let ze = z(() => Y?.querySelector("[data-virtuoso-scroller=true]"), [Y]), Be = z(() => {
1057
- te(I.current);
1058
- }, [te]), Ve = Qe(() => {
1059
- Be();
1060
- }, 500, { trailing: !0 }), He = z((e, t) => {
1061
- e.calculatedWidth = t, e.widthPx = t, e.hasResized = !0, Re(), Ve();
1062
- }, [Re, Ve]), Ue = z((e, t) => {
1228
+ let Ue = R(() => J?.querySelector("[data-virtuoso-scroller=true]"), [J]), We = R(() => {
1229
+ ae(I.current);
1230
+ }, [ae]), Ge = it(() => {
1231
+ console.log("saveColumnVisualSettingsToStoreDebounced"), We();
1232
+ }, 500, { trailing: !0 }), Ke = R((e, t) => {
1233
+ e.calculatedWidth = t, e.widthPx = t, e.hasResized = !0, He(), Ge();
1234
+ }, [He, Ge]), qe = R((e, t) => {
1063
1235
  if (e.key !== "ArrowLeft" && e.key !== "ArrowRight") return;
1064
1236
  e.preventDefault();
1065
1237
  let n = I.current.find((e) => e.id === t.id), r = n.calculatedWidth, i = e.key === "ArrowLeft" ? Math.max(50, r - 10) : r + 10;
1066
- He(n, i);
1067
- }, [He]), We = z((e, t) => {
1238
+ Ke(n, i);
1239
+ }, [Ke]), Je = R((e, t) => {
1068
1240
  e.preventDefault();
1069
1241
  let n = I.current.find((e) => e.id === t.id), r = e.clientX, i = n?.calculatedWidth, a = (e) => {
1070
1242
  let t = e.clientX;
1071
1243
  if (r === t) return;
1072
1244
  let a = t - r, o = Math.max(50, i + a);
1073
- i !== o && He(n, o);
1245
+ i !== o && Ke(n, o);
1074
1246
  }, o = (e) => {
1075
- le.current(), le.current = Ze.default;
1247
+ L.current(), L.current = rt.default;
1076
1248
  };
1077
- document.addEventListener("mousemove", a), document.addEventListener("mouseup", o), le.current = () => {
1249
+ document.addEventListener("mousemove", a), document.addEventListener("mouseup", o), L.current = () => {
1078
1250
  document.removeEventListener("mousemove", a), document.removeEventListener("mouseup", o);
1079
1251
  };
1080
- }, [He]);
1081
- B(() => () => {
1082
- le.current();
1252
+ }, [Ke]);
1253
+ z(() => () => {
1254
+ L.current();
1083
1255
  }, []);
1084
- let Ge = z((e, t) => u.handleMoveColumn(ce, I.current, N, e, t), [ce, N]), Ke = z(() => {
1085
- Y.querySelectorAll("[data-column-index]").forEach((e) => {
1256
+ let Ye = R((e, t) => p.handleMoveColumn(he, I.current, P, e, t), [he, P]), Xe = R(() => {
1257
+ J.querySelectorAll("[data-column-index]").forEach((e) => {
1086
1258
  let t = e.getAttribute("data-id");
1087
1259
  e.style.order = I.current.findIndex((e) => e.id === t).toString();
1088
1260
  });
1089
- }, [Y]);
1090
- B(() => {
1261
+ }, [J]);
1262
+ z(() => {
1091
1263
  let e = () => {
1092
- Re(), Ke();
1264
+ He(), Xe();
1093
1265
  };
1094
- return D.window.addEventListener("resize", e), () => {
1095
- D.window.removeEventListener("resize", e);
1266
+ return k.window.addEventListener("resize", e), () => {
1267
+ k.window.removeEventListener("resize", e);
1096
1268
  };
1097
1269
  }, [
1098
- Ke,
1099
- Re,
1100
- D.window
1270
+ Xe,
1271
+ He,
1272
+ k.window
1101
1273
  ]);
1102
- let qe = z((e) => {
1103
- let t = Z();
1274
+ let Ze = R((e) => {
1275
+ let t = X();
1104
1276
  return {
1105
1277
  elementIndex: t.findIndex((t) => t.id === e.id),
1106
1278
  visibleTableSettingsColumns: t,
1107
1279
  widths: t.map((e) => e.calculatedWidth)
1108
1280
  };
1109
- }, [Z]), et = z((e, t) => {
1110
- let n = qe(t);
1111
- if (e.type === "start" && (D.body.style.setProperty("overflow", "hidden"), Y?.style.setProperty("--selection-background", "none"), e.target.style.setProperty("opacity", "0.3"), X.current = {
1281
+ }, [X]), Qe = R((e, t) => {
1282
+ let n = Ze(t);
1283
+ if (e.type === "start" && (k.body.style.setProperty("overflow", "hidden"), J?.style.setProperty("--selection-background", "none"), e.target.style.setProperty("opacity", "0.3"), Y.current = {
1112
1284
  clonedElement: e.target.cloneNode(!0),
1113
1285
  elementOffsetX: n.widths.slice(0, n.elementIndex).reduce((e, t) => e + t, 0) - 15,
1114
- scrollPosition: ze().scrollLeft
1115
- }, X.current.clonedElement.style.cssText = `
1286
+ scrollPosition: Ue().scrollLeft
1287
+ }, Y.current.clonedElement.style.cssText = `
1116
1288
  font-weight: bold;
1117
1289
  position: absolute;
1118
1290
  top: ${e.target.getBoundingClientRect().top}px;
1119
1291
  left: ${e.clientX - e.elementOffsetX}px;
1120
- z-index: ${w.zIndex.modal.toString()};
1292
+ z-index: ${T.zIndex.modal.toString()};
1121
1293
  pointer-events: none;
1122
1294
  filter: blur(0.5px);
1123
1295
  box-shadow: 1px 2px 3px 0px rgba(0,0,0,0.5);
1124
- `, D.body.appendChild(X.current.clonedElement)), e.type === "end" && (D.body.style.removeProperty("overflow"), Y?.style.setProperty("--selection-background", "highlight"), D.document.getSelection().empty(), X.current.clonedElement.remove(), e.target.style.setProperty("opacity", "1")), e.type === "move") {
1125
- X.current.clonedElement.style.setProperty("left", `${e.clientX - e.elementOffsetX}px`), X.current.clonedElement.style.setProperty("top", `${e.clientY}px`);
1126
- let r = X.current.elementOffsetX + e.deltaX + e.elementOffsetX + (ze().scrollLeft - X.current.scrollPosition), i = n.widths.slice(0, n.elementIndex - 1).reduce((e, t) => e + t, 0) + Math.min(16, n.widths?.[n.elementIndex - 1] ?? Infinity), a = n.widths.slice(0, n.elementIndex + 1).reduce((e, t) => e + t, 0) + Math.min(16, n.widths?.[n.elementIndex + 1] ?? Infinity);
1127
- (r < i && Ge(t, -1) || r > a && Ge(t, 1)) && (Ke(), qe(t));
1296
+ `, k.body.appendChild(Y.current.clonedElement)), e.type === "end" && (k.body.style.removeProperty("overflow"), J?.style.setProperty("--selection-background", "highlight"), k.document.getSelection().empty(), Y.current.clonedElement.remove(), e.target.style.setProperty("opacity", "1")), e.type === "move") {
1297
+ Y.current.clonedElement.style.setProperty("left", `${e.clientX - e.elementOffsetX}px`), Y.current.clonedElement.style.setProperty("top", `${e.clientY}px`);
1298
+ let r = Y.current.elementOffsetX + e.deltaX + e.elementOffsetX + (Ue().scrollLeft - Y.current.scrollPosition), i = n.widths.slice(0, n.elementIndex - 1).reduce((e, t) => e + t, 0) + Math.min(16, n.widths?.[n.elementIndex - 1] ?? Infinity), a = n.widths.slice(0, n.elementIndex + 1).reduce((e, t) => e + t, 0) + Math.min(16, n.widths?.[n.elementIndex + 1] ?? Infinity);
1299
+ (r < i && Ye(t, -1) || r > a && Ye(t, 1)) && (Xe(), Ze(t));
1128
1300
  }
1129
1301
  }, [
1130
- qe,
1131
- ze,
1132
- Ge,
1133
- Y?.style,
1134
- w.zIndex.modal,
1135
- Ke,
1136
- D.body,
1137
- D.document
1138
- ]), tt = z(() => /* @__PURE__ */ G(j, {
1302
+ Ze,
1303
+ Ue,
1304
+ Ye,
1305
+ J?.style,
1306
+ T.zIndex.modal,
1307
+ Xe,
1308
+ k.body,
1309
+ k.document
1310
+ ]), $e = R(() => /* @__PURE__ */ W(j, {
1139
1311
  "aria-rowindex": 1,
1140
1312
  role: "row",
1141
1313
  sx: {
1142
- [`&:hover .${Q.columnDivider}`]: { opacity: 1 },
1143
- background: w.palette.background.paper,
1144
- borderBottom: `1px solid ${ge}`,
1314
+ [`&:hover .${$.columnDivider}`]: { opacity: 1 },
1315
+ background: T.palette.background.paper,
1316
+ borderBottom: `1px solid ${Te}`,
1145
1317
  display: "flex",
1146
1318
  fontWeight: "bold",
1147
- height: w.spacing(r),
1319
+ height: T.spacing(r),
1148
1320
  zIndex: 3
1149
1321
  },
1150
- children: Z().map((e, t) => {
1151
- let n = N.find((t) => t.id === e.id);
1152
- return n ? /* @__PURE__ */ G(dt, {
1322
+ children: X().map((e, t) => {
1323
+ let n = Le.get(e.id);
1324
+ return n ? /* @__PURE__ */ W(Ct, {
1153
1325
  column: n.type === "selectable" ? {
1154
1326
  ...n,
1155
- renderHeaderContent: Fe
1327
+ renderHeaderContent: ze
1156
1328
  } : n,
1157
1329
  columnIndex: t,
1158
- dividerColor: ge,
1159
- height: w.spacing(r),
1160
- onColumnDividerKeyDown: Ue,
1161
- onColumnDividerMouseDown: We,
1162
- onCustomDrag: et,
1163
- order: I.current.findIndex((t) => t.id === e.id),
1330
+ dividerColor: Te,
1331
+ height: T.spacing(r),
1332
+ onColumnDividerKeyDown: qe,
1333
+ onColumnDividerMouseDown: Je,
1334
+ onCustomDrag: Qe,
1335
+ order: t,
1164
1336
  role: "columnheader",
1165
1337
  width: e.calculatedWidth,
1166
1338
  xOffset: e.offsetX
1167
1339
  }, e.id) : null;
1168
1340
  })
1169
1341
  }), [
1170
- w,
1342
+ T,
1171
1343
  r,
1172
- ge,
1173
- Z,
1174
- N,
1175
- Fe,
1176
- We,
1177
- Ue,
1178
- et
1179
- ]), nt = z((e, t) => /* @__PURE__ */ G(W, { children: Z().map((n, r) => {
1180
- let i = N.find((e) => e.id === n.id), a;
1181
- if (i.cellTitleGetter) a = i.cellTitleGetter({
1182
- column: i,
1183
- dataContext: F,
1184
- id: n.id,
1185
- row: t,
1186
- rowIndex: e
1187
- });
1188
- else if (i.type === "text") a = u.getTableTextCellValue({
1189
- column: i,
1190
- dataContext: F,
1191
- row: t,
1192
- rowIndex: e
1193
- });
1194
- else if (i.type === "boolean") a = u.getTableBooleanCellDisplayValue({
1195
- column: i,
1196
- dataContext: F,
1197
- row: t,
1198
- rowIndex: e,
1199
- t: T
1200
- });
1201
- else if (i.type === "number") {
1202
- let n = u.getTableNumberCellValue({
1203
- column: i,
1344
+ Te,
1345
+ X,
1346
+ Le,
1347
+ ze,
1348
+ Je,
1349
+ qe,
1350
+ Qe
1351
+ ]), at = R((e, t) => {
1352
+ let n = !se || se(t, F);
1353
+ return /* @__PURE__ */ W(U, { children: X().map((r, i) => {
1354
+ let a = Le.get(r.id);
1355
+ if (!a) return null;
1356
+ let o;
1357
+ if (a.cellTitleGetter) o = a.cellTitleGetter({
1358
+ column: a,
1204
1359
  dataContext: F,
1360
+ id: r.id,
1205
1361
  row: t,
1206
1362
  rowIndex: e
1207
1363
  });
1208
- a = (0, Ye.default)(n) ? n.toString() : "";
1209
- } else i.type === "date" ? a = u.getTableDateCellValue({
1210
- column: i,
1211
- dataContext: F,
1212
- row: t,
1213
- rowIndex: e
1214
- }) : i.type === "options" && (a = u.getTableOptionsCellDisplayValue({
1215
- column: i,
1216
- dataContext: F,
1217
- row: t,
1218
- rowIndex: e
1219
- }));
1220
- let o = {
1221
- backgroundColor: oe && i.cellColorGetter ? i.cellColorGetter({
1222
- column: i,
1364
+ else if (a.type === "text") o = p.getTableTextCellValue({
1365
+ column: a,
1223
1366
  dataContext: F,
1224
- id: n.id,
1225
1367
  row: t,
1226
1368
  rowIndex: e
1227
- }) : void 0,
1228
- columnIndex: r,
1229
- enabled: !ie || ie(t, F),
1230
- height: w.spacing(x),
1231
- onClick: Me,
1232
- order: I.current.findIndex((e) => e.id === n.id),
1233
- row: t,
1234
- rowIndex: e,
1235
- sx: i.sx,
1236
- title: a,
1237
- width: n.calculatedWidth,
1238
- xOffset: n.offsetX
1239
- };
1240
- return i.type === "actions" ? /* @__PURE__ */ G(ft, {
1241
- ...o,
1242
- column: i
1243
- }, n.id) : /* @__PURE__ */ K(ot, {
1244
- ...o,
1245
- column: i,
1246
- children: [
1247
- !!i.renderCell && /* @__PURE__ */ G(R, { children: i.renderCell({
1248
- column: i,
1249
- dataContext: F,
1250
- id: n.id,
1251
- row: t,
1252
- rowIndex: e
1253
- }) }, i.id),
1254
- !i.renderCell && !!i.displayValueGetter && /* @__PURE__ */ G(R, { children: /* @__PURE__ */ G($e, { content: i.displayValueGetter({
1255
- column: i,
1256
- dataContext: F,
1257
- id: n.id,
1258
- row: t,
1259
- rowIndex: e
1260
- }) }) }, i.id),
1261
- !i.displayValueGetter && !i.renderCell && i.type === "text" && u.getTableTextCellValue({
1262
- column: i,
1263
- dataContext: F,
1264
- row: t,
1265
- rowIndex: e
1266
- }),
1267
- !i.displayValueGetter && !i.renderCell && i.type === "boolean" && u.getTableBooleanCellDisplayValue({
1268
- column: i,
1269
- dataContext: F,
1270
- row: t,
1271
- rowIndex: e,
1272
- t: T
1273
- }),
1274
- !i.displayValueGetter && !i.renderCell && i.type === "number" && u.getTableNumberCellValue({
1275
- column: i,
1276
- dataContext: F,
1277
- row: t,
1278
- rowIndex: e
1279
- }),
1280
- !i.displayValueGetter && !i.renderCell && i.type === "date" && u.getTableDateCellValue({
1281
- column: i,
1282
- dataContext: F,
1283
- row: t,
1284
- rowIndex: e
1285
- }),
1286
- !i.displayValueGetter && !i.renderCell && i.type === "options" && u.getTableOptionsCellDisplayValue({
1287
- column: i,
1288
- dataContext: F,
1289
- row: t,
1290
- rowIndex: e
1291
- }),
1292
- !i.displayValueGetter && !i.renderCell && i.type === "readableIndex" && Pe(i, {
1369
+ });
1370
+ else if (a.type === "boolean") o = p.getTableBooleanCellDisplayValue({
1371
+ column: a,
1372
+ dataContext: F,
1373
+ row: t,
1374
+ rowIndex: e,
1375
+ t: O
1376
+ });
1377
+ else if (a.type === "number") {
1378
+ let n = p.getTableNumberCellValue({
1379
+ column: a,
1293
1380
  dataContext: F,
1294
- id: n.id,
1295
1381
  row: t,
1296
1382
  rowIndex: e
1297
- }),
1298
- !i.displayValueGetter && !i.renderCell && i.type === "selectable" && Le(i, {
1383
+ });
1384
+ o = (0, tt.default)(n) ? n.toString() : "";
1385
+ } else a.type === "date" ? o = p.getTableDateCellValue({
1386
+ column: a,
1387
+ dataContext: F,
1388
+ row: t,
1389
+ rowIndex: e
1390
+ }) : a.type === "options" && (o = p.getTableOptionsCellDisplayValue({
1391
+ column: a,
1392
+ dataContext: F,
1393
+ row: t,
1394
+ rowIndex: e
1395
+ }));
1396
+ let s = {
1397
+ backgroundColor: le && a.cellColorGetter ? a.cellColorGetter({
1398
+ column: a,
1299
1399
  dataContext: F,
1300
- id: n.id,
1400
+ id: r.id,
1301
1401
  row: t,
1302
1402
  rowIndex: e
1303
- })
1304
- ]
1305
- }, n.id);
1306
- }) }), [
1307
- Z,
1308
- ie,
1309
- Me,
1403
+ }) : void 0,
1404
+ columnIndex: i,
1405
+ enabled: n,
1406
+ height: E,
1407
+ onClick: Ie,
1408
+ order: i,
1409
+ row: t,
1410
+ rowIndex: e,
1411
+ sx: a.sx,
1412
+ title: o,
1413
+ width: r.calculatedWidth,
1414
+ xOffset: r.offsetX
1415
+ };
1416
+ return a.type === "actions" ? /* @__PURE__ */ W(wt, {
1417
+ ...s,
1418
+ column: a
1419
+ }, r.id) : /* @__PURE__ */ G(_t, {
1420
+ ...s,
1421
+ column: a,
1422
+ children: [
1423
+ !!a.renderCell && /* @__PURE__ */ W(ge, { children: a.renderCell({
1424
+ column: a,
1425
+ dataContext: F,
1426
+ id: r.id,
1427
+ row: t,
1428
+ rowIndex: e
1429
+ }) }, a.id),
1430
+ !a.renderCell && !!a.displayValueGetter && /* @__PURE__ */ W(ge, { children: /* @__PURE__ */ W(ut, { content: a.displayValueGetter({
1431
+ column: a,
1432
+ dataContext: F,
1433
+ id: r.id,
1434
+ row: t,
1435
+ rowIndex: e
1436
+ }) }) }, a.id),
1437
+ !a.displayValueGetter && !a.renderCell && a.type === "text" && p.getTableTextCellValue({
1438
+ column: a,
1439
+ dataContext: F,
1440
+ row: t,
1441
+ rowIndex: e
1442
+ }),
1443
+ !a.displayValueGetter && !a.renderCell && a.type === "boolean" && p.getTableBooleanCellDisplayValue({
1444
+ column: a,
1445
+ dataContext: F,
1446
+ row: t,
1447
+ rowIndex: e,
1448
+ t: O
1449
+ }),
1450
+ !a.displayValueGetter && !a.renderCell && a.type === "number" && p.getTableNumberCellValue({
1451
+ column: a,
1452
+ dataContext: F,
1453
+ row: t,
1454
+ rowIndex: e
1455
+ }),
1456
+ !a.displayValueGetter && !a.renderCell && a.type === "date" && p.getTableDateCellValue({
1457
+ column: a,
1458
+ dataContext: F,
1459
+ row: t,
1460
+ rowIndex: e
1461
+ }),
1462
+ !a.displayValueGetter && !a.renderCell && a.type === "options" && p.getTableOptionsCellDisplayValue({
1463
+ column: a,
1464
+ dataContext: F,
1465
+ row: t,
1466
+ rowIndex: e
1467
+ }),
1468
+ !a.displayValueGetter && !a.renderCell && a.type === "readableIndex" && Re(a, {
1469
+ dataContext: F,
1470
+ id: r.id,
1471
+ row: t,
1472
+ rowIndex: e
1473
+ }),
1474
+ !a.displayValueGetter && !a.renderCell && a.type === "selectable" && Ve(a, {
1475
+ dataContext: F,
1476
+ id: r.id,
1477
+ row: t,
1478
+ rowIndex: e
1479
+ })
1480
+ ]
1481
+ }, r.id);
1482
+ }) });
1483
+ }, [
1484
+ X,
1485
+ se,
1486
+ Ie,
1487
+ Ve,
1488
+ Re,
1489
+ E,
1490
+ O,
1310
1491
  Le,
1311
- Pe,
1312
- x,
1313
- T,
1314
- N,
1315
- w,
1316
1492
  F,
1317
- oe
1318
- ]), rt = z((e) => {
1493
+ le
1494
+ ]), ot = R((e) => {
1319
1495
  c(e);
1320
- }, [c]), it = z((e) => {
1496
+ }, [c]), st = R((e) => {
1321
1497
  l(e);
1322
1498
  }, [l]);
1323
- B(() => {
1324
- if (!S) return Ze.default;
1325
- let e = S.subscribe((e, t) => {
1326
- t.forEach((e) => {
1327
- Y.querySelectorAll(`[data-testid=virtuoso-item-list] [data-id='${e}']`).forEach((e) => {
1328
- e.classList.remove("highlighted");
1329
- });
1330
- }), e.forEach((e) => {
1331
- Y.querySelectorAll(`[data-testid=virtuoso-item-list] [data-id='${e}']`).forEach((e) => {
1332
- e.classList.add("highlighted");
1333
- });
1499
+ z(() => {
1500
+ if (!C) return rt.default;
1501
+ let e = C.subscribe((e, t) => {
1502
+ if (!e.length && !t.length) return;
1503
+ let n = new Set(e), r = new Set(t);
1504
+ J.querySelectorAll("[data-testid=virtuoso-item-list] [data-id]").forEach((e) => {
1505
+ let t = e.getAttribute("data-id");
1506
+ t !== null && (n.has(t) ? e.classList.add("highlighted") : r.has(t) && e.classList.remove("highlighted"));
1334
1507
  });
1335
1508
  });
1336
1509
  return () => {
1337
1510
  e();
1338
1511
  };
1339
1512
  }, [
1340
- S,
1341
- Y,
1342
- w.palette.action.hover,
1343
- w.palette.background.paper
1344
- ]), B(() => {
1513
+ C,
1514
+ J,
1515
+ T.palette.action.hover,
1516
+ T.palette.background.paper
1517
+ ]), z(() => {
1345
1518
  let e = () => {
1346
- Re(), Ke(), Ne(), Be();
1519
+ He(), Xe(), Z(), We();
1347
1520
  }, t = [
1348
- ae("condensedChange", (t) => {
1349
- O.getState().setIsCondensed(t), I.current = O.getState().getCurrentColumnVisualSettings(), e();
1521
+ ce("condensedChange", (t) => {
1522
+ A.getState().setIsCondensed(t), I.current = A.getState().getCurrentColumnVisualSettings(), e();
1350
1523
  }),
1351
- ae("reset", () => {
1352
- O.getState().resetColumns(), I.current = O.getState().getCurrentColumnVisualSettings(), e();
1524
+ ce("reset", () => {
1525
+ A.getState().resetColumns(), I.current = A.getState().getCurrentColumnVisualSettings(), e();
1353
1526
  }),
1354
- ae("columnVisibilityChange", (t) => {
1527
+ ce("columnVisibilityChange", (t) => {
1355
1528
  I.current.forEach((e) => {
1356
1529
  e.isVisible = t.includes(e.id);
1357
1530
  }), e();
1358
1531
  }),
1359
- ae("columnOrderChange", (t) => {
1532
+ ce("columnOrderChange", (t) => {
1360
1533
  I.current.sort((e, n) => t.indexOf(e.id) - t.indexOf(n.id)), e();
1361
1534
  }),
1362
- ae("openColumnsEditorDialog", (e) => {
1363
- Ae.current.open({ hasCellData: e });
1535
+ ce("openColumnsEditorDialog", (e) => {
1536
+ Pe.current.open({ hasCellData: e });
1364
1537
  })
1365
1538
  ];
1366
1539
  return () => {
1367
1540
  t.forEach((e) => e());
1368
1541
  };
1369
1542
  }, [
1370
- ae,
1371
- Be,
1372
- N,
1373
- O,
1374
- Ke,
1375
- Re,
1376
- Ne
1543
+ ce,
1544
+ We,
1545
+ P,
1546
+ A,
1547
+ Xe,
1548
+ He,
1549
+ Z
1377
1550
  ]);
1378
- let at = z(() => {
1379
- let e = ze();
1380
- if (e && d && d(e.scrollTop), ye.current && f) {
1381
- let t = e.scrollTop, n = +w.spacing(x).replace("px", "");
1382
- f(Math.floor(t / n));
1551
+ let ct = R(() => {
1552
+ let e = Ue();
1553
+ if (e && u && u(e.scrollTop), De.current && d) {
1554
+ let t = e.scrollTop;
1555
+ d(Math.floor(t / D));
1383
1556
  }
1384
1557
  }, [
1385
- ze,
1558
+ Ue,
1559
+ u,
1386
1560
  d,
1387
- f,
1388
- w,
1389
- x
1390
- ]), $ = z(() => +w.spacing(x).replace("px", ""), [x, w]), st = z((e) => {
1391
- let t = ze();
1561
+ D
1562
+ ]), lt = R(() => D, [D]), dt = R((e) => {
1563
+ let t = Ue();
1392
1564
  t && (t.scrollTop = e);
1393
- }, [ze]), ct = z(() => {
1394
- let e = Oe.current;
1395
- e && !De.current && e.hasRendered && (Oe.current = null, e.onScrolledToIndex());
1396
- }, []), lt = z((e, t) => {
1397
- Oe.current = t ? {
1398
- hasRendered: Ee.current.has(e),
1565
+ }, [Ue]), ft = R(() => {
1566
+ let e = Me.current;
1567
+ e && !je.current && e.hasRendered && (Me.current = null, e.onScrolledToIndex());
1568
+ }, []), pt = R((e, t) => {
1569
+ Me.current = t ? {
1570
+ hasRendered: Ae.current.has(e),
1399
1571
  index: e,
1400
1572
  onScrolledToIndex: t
1401
- } : null, ye.current?.scrollToIndex(e), ct();
1402
- }, [ct]);
1573
+ } : null, De.current?.scrollToIndex(e), ft();
1574
+ }, [ft]);
1403
1575
  be(y, () => ({
1404
- scrollToIndex: lt,
1405
- setVerticalScrollPosition: st
1576
+ scrollToIndex: pt,
1577
+ setVerticalScrollPosition: dt
1406
1578
  }));
1407
- let ut = z((e) => {
1408
- Te.current = e, a(e);
1409
- }, [a]), pt = z((e) => {
1410
- Ee.current = new Set(e.map((e) => e.index));
1411
- let t = Oe.current;
1412
- t && Ee.current.has(t.index) && (t.hasRendered = !0), ct();
1413
- }, [ct]), mt = z((e) => {
1414
- De.current = e, ct();
1415
- }, [ct]);
1416
- return B(() => {
1417
- Te.current && a(Te.current);
1418
- }, [a, A]), /* @__PURE__ */ K(j, {
1419
- ref: ke,
1579
+ let mt = R((e) => {
1580
+ ke.current = e, a(e);
1581
+ }, [a]), ht = R((e) => {
1582
+ Ae.current = new Set(e.map((e) => e.index));
1583
+ let t = Me.current;
1584
+ t && Ae.current.has(t.index) && (t.hasRendered = !0), ft();
1585
+ }, [ft]), gt = R((e) => {
1586
+ je.current = e, ft();
1587
+ }, [ft]);
1588
+ return z(() => {
1589
+ ke.current && a(ke.current);
1590
+ }, [a, M]), /* @__PURE__ */ G(j, {
1591
+ ref: Ne,
1420
1592
  style: { "--selection-background": "highlight" },
1421
1593
  sx: {
1422
1594
  "*::selection": { backgroundColor: "var(--selection-background) !important" },
1423
1595
  height: "100%",
1424
1596
  position: "relative",
1425
1597
  width: "100%",
1426
- ...C
1598
+ ...w
1427
1599
  },
1428
- children: [L && /* @__PURE__ */ G(Se, {
1429
- ...J.createAttributes("Table"),
1600
+ children: [ve && /* @__PURE__ */ W(Se, {
1601
+ ...q.createAttributes("Table"),
1430
1602
  components: {
1431
- EmptyPlaceholder: _e((e, t) => /* @__PURE__ */ G(j, {
1603
+ EmptyPlaceholder: _e((e, t) => /* @__PURE__ */ W(j, {
1432
1604
  ...e,
1433
1605
  ref: t
1434
1606
  })),
1435
- FillerRow: _e((e, t) => /* @__PURE__ */ G(j, {
1607
+ FillerRow: _e((e, t) => /* @__PURE__ */ W(j, {
1436
1608
  ref: t,
1437
1609
  style: { height: e.height }
1438
1610
  })),
1439
- Table: _e((e, t) => /* @__PURE__ */ G(j, {
1611
+ Table: _e((e, t) => /* @__PURE__ */ W(j, {
1440
1612
  ...e,
1441
- "data-row-count": A.length,
1613
+ "data-row-count": M.length,
1442
1614
  ref: t,
1443
1615
  role: "table",
1444
1616
  sx: {
1445
1617
  minWidth: "100%",
1446
1618
  position: "relative",
1447
- width: we.current
1619
+ width: Oe.current
1448
1620
  }
1449
1621
  })),
1450
- TableBody: _e((t, n) => /* @__PURE__ */ G(j, {
1622
+ TableBody: _e((t, n) => /* @__PURE__ */ W(j, {
1451
1623
  ...t,
1452
1624
  ref: n,
1453
1625
  sx: { font: e }
1454
1626
  })),
1455
- TableHead: _e((e, t) => /* @__PURE__ */ G(j, {
1627
+ TableHead: _e((e, t) => /* @__PURE__ */ W(j, {
1456
1628
  ...e,
1457
1629
  ref: t
1458
1630
  })),
1459
1631
  TableRow: _e((e, t) => {
1460
- let n = !ie || ie(e.item, F);
1461
- return /* @__PURE__ */ G(j, {
1462
- "data-id": M(e.item),
1463
- onMouseEnter: () => rt(e.item),
1464
- onMouseLeave: () => it(e.item),
1632
+ let n = !se || se(e.item, F);
1633
+ return /* @__PURE__ */ W(j, {
1634
+ "data-id": N(e.item),
1635
+ onMouseEnter: () => ot(e.item),
1636
+ onMouseLeave: () => st(e.item),
1465
1637
  ref: t,
1466
1638
  role: "row",
1467
1639
  sx: {
1468
1640
  "&:hover, &.highlighted": {
1469
- "*": { color: `${w.palette.text.primary} !important` },
1641
+ "*": { color: `${T.palette.text.primary} !important` },
1470
1642
  "& [role=cell]": {
1471
- "*": { color: `${w.palette.text.primary} !important` },
1472
- backgroundColor: w.palette.grey[100],
1473
- color: `${w.palette.text.primary} !important`
1643
+ "*": { color: `${T.palette.text.primary} !important` },
1644
+ backgroundColor: T.palette.grey[100],
1645
+ color: `${T.palette.text.primary} !important`
1474
1646
  },
1475
- backgroundColor: w.palette.grey[100],
1476
- color: `${w.palette.text.primary} !important`
1647
+ backgroundColor: T.palette.grey[100],
1648
+ color: `${T.palette.text.primary} !important`
1477
1649
  },
1478
- borderBottom: `1px solid ${he}`,
1650
+ borderBottom: `1px solid ${we}`,
1479
1651
  color: n ? void 0 : "text.disabled",
1480
1652
  cursor: n && s ? "pointer" : void 0,
1481
1653
  display: "flex",
1482
- height: w.spacing(x)
1654
+ height: T.spacing(S)
1483
1655
  },
1484
- ...(0, Xe.default)(e, "item")
1656
+ ...(0, nt.default)(e, "item")
1485
1657
  });
1486
1658
  })
1487
1659
  },
1488
- data: A,
1489
- fixedHeaderContent: tt,
1490
- fixedItemHeight: +w.spacing(x).replace("px", ""),
1660
+ data: M,
1661
+ fixedHeaderContent: $e,
1662
+ fixedItemHeight: D,
1491
1663
  initialTopMostItemIndex: i ?? 0,
1492
- isScrolling: mt,
1493
- itemContent: nt,
1494
- itemSize: $,
1495
- itemsRendered: pt,
1496
- onScroll: at,
1664
+ isScrolling: gt,
1665
+ itemContent: at,
1666
+ itemSize: lt,
1667
+ itemsRendered: ht,
1668
+ onScroll: ct,
1497
1669
  overscan: {
1498
- main: g ?? k,
1499
- reverse: v ?? ee
1670
+ main: f ?? re,
1671
+ reverse: _ ?? ie
1500
1672
  },
1501
- rangeChanged: ut,
1502
- ref: ye,
1673
+ rangeChanged: mt,
1674
+ ref: De,
1503
1675
  style: {
1504
1676
  height: "100%",
1505
1677
  overflowX: t ? "scroll" : "auto"
1506
1678
  },
1507
- totalCount: A.length
1508
- }), /* @__PURE__ */ G(yt, { ref: Ae })]
1679
+ totalCount: M.length
1680
+ }), /* @__PURE__ */ W(jt, {
1681
+ ref: Pe,
1682
+ renderHeaderContent: b,
1683
+ renderItemContent: x
1684
+ })]
1509
1685
  });
1510
- }, Tt = ({ caption: e, component: t = "h2", variant: n = "h2" }) => {
1511
- let { t: r } = q(), i = m(), a = p(i, (e) => e.baseData.length), o = p(i, b((e) => e.sortedData.length));
1512
- return /* @__PURE__ */ G(le, {
1686
+ }, Lt = ({ caption: e, component: t = "h2", variant: n = "h2" }) => {
1687
+ let { t: r } = K(), i = v(), a = m(i, (e) => e.baseData.length), o = m(i, Q((e) => e.sortedData.length));
1688
+ return /* @__PURE__ */ W(le, {
1513
1689
  component: t,
1514
1690
  variant: n,
1515
- children: /* @__PURE__ */ K(W, { children: [
1691
+ children: /* @__PURE__ */ G(U, { children: [
1516
1692
  o === 0 && (e ?? r("Items")),
1517
1693
  o > 0 && o === a && r("{{items}} ({{count}})", {
1518
1694
  count: o,
@@ -1526,10 +1702,10 @@ var nt = /* @__PURE__ */ e((/* @__PURE__ */ t(((e, t) => {
1526
1702
  })
1527
1703
  ] })
1528
1704
  });
1529
- }, Et = /* @__PURE__ */ t(((e, t) => {
1530
- t.exports = Object.prototype.hasOwnProperty.call(me, "module.exports") ? me["module.exports"] : { ...me };
1531
- })), Dt = /* @__PURE__ */ t(((e) => {
1532
- var t = Et();
1705
+ }, Rt = /* @__PURE__ */ t(((e, t) => {
1706
+ t.exports = Object.prototype.hasOwnProperty.call(he, "module.exports") ? he["module.exports"] : { ...he };
1707
+ })), zt = /* @__PURE__ */ t(((e) => {
1708
+ var t = Rt();
1533
1709
  function n(e, t) {
1534
1710
  return e === t && (e !== 0 || 1 / e == 1 / t) || e !== e && t !== t;
1535
1711
  }
@@ -1566,7 +1742,7 @@ var nt = /* @__PURE__ */ e((/* @__PURE__ */ t(((e, t) => {
1566
1742
  }
1567
1743
  var d = typeof window > "u" || window.document === void 0 || window.document.createElement === void 0 ? u : c;
1568
1744
  e.useSyncExternalStore = t.useSyncExternalStore === void 0 ? d : t.useSyncExternalStore;
1569
- })), Ot = /* @__PURE__ */ t(((e) => {
1745
+ })), Bt = /* @__PURE__ */ t(((e) => {
1570
1746
  process.env.NODE_ENV !== "production" && (function() {
1571
1747
  function t(e, t) {
1572
1748
  return e === t && (e !== 0 || 1 / e == 1 / t) || e !== e && t !== t;
@@ -1609,13 +1785,13 @@ var nt = /* @__PURE__ */ e((/* @__PURE__ */ t(((e, t) => {
1609
1785
  return t();
1610
1786
  }
1611
1787
  typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
1612
- var a = Et(), o = typeof Object.is == "function" ? Object.is : t, s = a.useState, c = a.useEffect, l = a.useLayoutEffect, u = a.useDebugValue, d = !1, f = !1, p = typeof window > "u" || window.document === void 0 || window.document.createElement === void 0 ? i : n;
1788
+ var a = Rt(), o = typeof Object.is == "function" ? Object.is : t, s = a.useState, c = a.useEffect, l = a.useLayoutEffect, u = a.useDebugValue, d = !1, f = !1, p = typeof window > "u" || window.document === void 0 || window.document.createElement === void 0 ? i : n;
1613
1789
  e.useSyncExternalStore = a.useSyncExternalStore === void 0 ? p : a.useSyncExternalStore, typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
1614
1790
  })();
1615
- })), kt = /* @__PURE__ */ t(((e, t) => {
1616
- t.exports = process.env.NODE_ENV === "production" ? Dt() : Ot();
1617
- })), At = /* @__PURE__ */ t(((e) => {
1618
- var t = Et(), n = kt();
1791
+ })), Vt = /* @__PURE__ */ t(((e, t) => {
1792
+ t.exports = process.env.NODE_ENV === "production" ? zt() : Bt();
1793
+ })), Ht = /* @__PURE__ */ t(((e) => {
1794
+ var t = Rt(), n = Vt();
1619
1795
  function r(e, t) {
1620
1796
  return e === t && (e !== 0 || 1 / e == 1 / t) || e !== e && t !== t;
1621
1797
  }
@@ -1659,13 +1835,13 @@ var nt = /* @__PURE__ */ e((/* @__PURE__ */ t(((e, t) => {
1659
1835
  f.hasValue = !0, f.value = p;
1660
1836
  }, [p]), l(p), p;
1661
1837
  };
1662
- })), jt = /* @__PURE__ */ t(((e) => {
1838
+ })), Ut = /* @__PURE__ */ t(((e) => {
1663
1839
  process.env.NODE_ENV !== "production" && (function() {
1664
1840
  function t(e, t) {
1665
1841
  return e === t && (e !== 0 || 1 / e == 1 / t) || e !== e && t !== t;
1666
1842
  }
1667
1843
  typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
1668
- var n = Et(), r = kt(), i = typeof Object.is == "function" ? Object.is : t, a = r.useSyncExternalStore, o = n.useRef, s = n.useEffect, c = n.useMemo, l = n.useDebugValue;
1844
+ var n = Rt(), r = Vt(), i = typeof Object.is == "function" ? Object.is : t, a = r.useSyncExternalStore, o = n.useRef, s = n.useEffect, c = n.useMemo, l = n.useDebugValue;
1669
1845
  e.useSyncExternalStoreWithSelector = function(e, t, n, r, u) {
1670
1846
  var d = o(null);
1671
1847
  if (d.current === null) {
@@ -1706,71 +1882,75 @@ var nt = /* @__PURE__ */ e((/* @__PURE__ */ t(((e, t) => {
1706
1882
  }, [p]), l(p), p;
1707
1883
  }, typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
1708
1884
  })();
1709
- })), { useSyncExternalStoreWithSelector: Mt } = (/* @__PURE__ */ e((/* @__PURE__ */ t(((e, t) => {
1710
- t.exports = process.env.NODE_ENV === "production" ? At() : jt();
1711
- })))(), 1)).default, Nt = (e) => e;
1712
- function Pt(e, t = Nt, n) {
1713
- let r = Mt(e.subscribe, e.getState, e.getInitialState, t, n);
1714
- return he.useDebugValue(r), r;
1885
+ })), { useSyncExternalStoreWithSelector: Wt } = (/* @__PURE__ */ e((/* @__PURE__ */ t(((e, t) => {
1886
+ t.exports = process.env.NODE_ENV === "production" ? Ht() : Ut();
1887
+ })))(), 1)).default, Gt = (e) => e;
1888
+ function Kt(e, t = Gt, n) {
1889
+ let r = Wt(e.subscribe, e.getState, e.getInitialState, t, n);
1890
+ return I.useDebugValue(r), r;
1715
1891
  }
1716
1892
  // src/components/ui/Table/TableFiltersSidebarItem.tsx
1717
- var Ft = Ee, It = ({ filterDimension: e, onFilterVisibilityChange: t, visibleFilterWithinDimension: n }) => {
1718
- let r = Pt(m(), (e) => e.filters, (e, t) => JSON.stringify(e.map((e) => e.filterValue)) === JSON.stringify(t.map((e) => e.filterValue))), i = e.filterIds.map((e) => r.find((t) => t.id === e)), { setValue: a } = Y(), o = V(() => {
1719
- if (e.allowOnlyPreferredFilter || e.filterIds.length === 1) return [i.find((t) => t?.id && t.id === e.preferredFilterId)].filter((e) => !!e);
1893
+ var qt = Ee, Jt = ({ filterDimension: e, onFilterVisibilityChange: t, showMissingValuesFilter: n, visibleFilterWithinDimension: r }) => {
1894
+ let i = Kt(v(), (e) => e.filters, (e, t) => JSON.stringify(e.map((e) => [e.filterValue, e.includeMissingValues])) === JSON.stringify(t.map((e) => [e.filterValue, e.includeMissingValues]))), a = e.filterIds.map((e) => i.find((t) => t.id === e)), { setValue: o } = Ae(), s = B(() => {
1895
+ if (e.allowOnlyPreferredFilter || e.filterIds.length === 1) return [a.find((t) => t?.id && t.id === e.preferredFilterId)].filter((e) => !!e);
1720
1896
  if (!e.allowMultipleVisibleFilters) {
1721
- let t = n ?? e.preferredFilterId;
1722
- return [i.find((e) => e?.id && e.id === t)].filter((e) => !!e);
1897
+ let t = r ?? e.preferredFilterId;
1898
+ return [a.find((e) => e?.id && e.id === t)].filter((e) => !!e);
1723
1899
  }
1724
- return i;
1900
+ return a;
1725
1901
  }, [
1726
- i,
1902
+ a,
1727
1903
  e.allowMultipleVisibleFilters,
1728
1904
  e.allowOnlyPreferredFilter,
1729
1905
  e.filterIds.length,
1730
1906
  e.preferredFilterId,
1731
- n
1732
- ]), s = V(() => i.length > 1 && !e.allowOnlyPreferredFilter && !e.allowMultipleVisibleFilters, [
1733
- i.length,
1907
+ r
1908
+ ]), c = B(() => a.length > 1 && !e.allowOnlyPreferredFilter && !e.allowMultipleVisibleFilters, [
1909
+ a.length,
1734
1910
  e.allowMultipleVisibleFilters,
1735
1911
  e.allowOnlyPreferredFilter
1736
- ]), c = V(() => !(i.length === 1 || e.allowOnlyPreferredFilter), [i.length, e.allowOnlyPreferredFilter]), l = V(() => s ? {
1737
- items: i.map((n) => ({
1738
- active: n === o[0],
1912
+ ]), l = B(() => !(a.length === 1 || e.allowOnlyPreferredFilter), [a.length, e.allowOnlyPreferredFilter]), u = B(() => c ? {
1913
+ items: a.map((r) => ({
1914
+ active: r === s[0],
1739
1915
  callback: () => {
1740
- t(e.id, n.id), e.filterIds.forEach((e) => {
1741
- e !== n.id && a(e, r.find((t) => t.id === e).initialFilterValue, { shouldDirty: !0 });
1916
+ t(e.id, r.id), e.filterIds.forEach((e) => {
1917
+ if (e !== r.id) {
1918
+ let t = i.find((t) => t.id === e);
1919
+ o(e, t.initialFilterValue, { shouldDirty: !0 }), n && o(t.includeMissingValuesFormFieldName, !1, { shouldDirty: !0 });
1920
+ }
1742
1921
  });
1743
1922
  },
1744
- label: n.label
1923
+ label: r.label
1745
1924
  })),
1746
- label: o[0].label
1925
+ label: s[0].label
1747
1926
  } : null, [
1748
- i,
1927
+ a,
1749
1928
  e.filterIds,
1750
1929
  e.id,
1930
+ s,
1931
+ i,
1751
1932
  o,
1752
- r,
1753
- a,
1754
1933
  t,
1755
- s
1934
+ c,
1935
+ n
1756
1936
  ]);
1757
- return o.length ? /* @__PURE__ */ K(j, {
1937
+ return s.length ? /* @__PURE__ */ G(j, {
1758
1938
  sx: { mb: 2 },
1759
1939
  children: [
1760
- c && /* @__PURE__ */ K(j, {
1940
+ l && /* @__PURE__ */ G(j, {
1761
1941
  sx: {
1762
1942
  alignItems: "center",
1763
1943
  display: "flex",
1764
1944
  justifyContent: "space-between"
1765
1945
  },
1766
- children: [/* @__PURE__ */ G(j, { children: /* @__PURE__ */ G(le, {
1946
+ children: [/* @__PURE__ */ W(j, { children: /* @__PURE__ */ W(le, {
1767
1947
  sx: {
1768
1948
  margin: 0,
1769
1949
  padding: 0
1770
1950
  },
1771
1951
  variant: "h6",
1772
1952
  children: e.label
1773
- }) }), s && /* @__PURE__ */ G(j, { children: /* @__PURE__ */ G(qe, {
1953
+ }) }), c && /* @__PURE__ */ W(j, { children: /* @__PURE__ */ W(qe, {
1774
1954
  ButtonProps: {
1775
1955
  color: "inherit",
1776
1956
  size: "small",
@@ -1783,100 +1963,122 @@ var Ft = Ee, It = ({ filterDimension: e, onFilterVisibilityChange: t, visibleFil
1783
1963
  },
1784
1964
  variant: "text"
1785
1965
  },
1786
- menuItemsData: l
1966
+ menuItemsData: u
1787
1967
  }) })]
1788
1968
  }),
1789
- o.map((e) => /* @__PURE__ */ G(j, {
1969
+ s.map((e) => /* @__PURE__ */ W(j, {
1790
1970
  sx: { my: 1 },
1791
- children: /* @__PURE__ */ G(rt, { filter: e })
1971
+ children: /* @__PURE__ */ W(mt, { filter: e })
1792
1972
  }, e.id)),
1793
- /* @__PURE__ */ G(P, {})
1973
+ /* @__PURE__ */ W(ae, {})
1794
1974
  ]
1795
1975
  }, e.id) : null;
1796
- }, Lt = ({ onClose: e }) => {
1797
- let { t } = q(), n = m(), r = p(n, (e) => e.setFilterValues), i = p(n, (e) => e.filterDimensions), a = Pt(n, (e) => e.filters, (e, t) => JSON.stringify(e.map((e) => e.filterValue)) === JSON.stringify(t.map((e) => e.filterValue))), o = p(n, (e) => e.filters.some((e) => !e.isInitialFilterValue(e.filterValue))), s = p(n, (e) => e.resetFilters), c = p(n, (e) => e.visibleFilterWithinDimensions), l = p(n, (e) => e.setVisibleFilterWithinDimensions), [u, d] = U(c), f = V(() => Object.fromEntries(a.map((e) => [e.id, e.initialFilterValue])), [a]), h = V(() => Object.fromEntries(a.map((e) => [e.id, e.filterValue ?? e.initialFilterValue])), [a]), g = Oe({
1798
- defaultValues: f,
1976
+ }, Yt = ({ onClose: e }) => {
1977
+ let { t } = K(), n = v(), r = m(n, (e) => e.setFilterValues), i = m(n, (e) => e.filterDimensions), a = Kt(n, (e) => e.filters, (e, t) => JSON.stringify(e.map((e) => [e.filterValue, e.includeMissingValues])) === JSON.stringify(t.map((e) => [e.filterValue, e.includeMissingValues]))), o = m(n, (e) => e.filters.some((e) => e.isFilterActive())), s = m(n, (e) => e.showMissingValuesFilter), c = m(n, (e) => e.resetFilters), l = m(n, (e) => e.visibleFilterWithinDimensions), u = m(n, (e) => e.setVisibleFilterWithinDimensions), [d, f] = H(l), p = B(() => {
1978
+ let e = Object.fromEntries(a.map((e) => [e.id, e.initialFilterValue]));
1979
+ return s && a.forEach((t) => {
1980
+ e[t.includeMissingValuesFormFieldName] = !1;
1981
+ }), e;
1982
+ }, [a, s]), h = B(() => {
1983
+ let e = Object.fromEntries(a.map((e) => [e.id, e.filterValue ?? e.initialFilterValue]));
1984
+ return s && a.forEach((t) => {
1985
+ e[t.includeMissingValuesFormFieldName] = t.includeMissingValues;
1986
+ }), e;
1987
+ }, [a, s]), g = ke({
1988
+ defaultValues: p,
1799
1989
  values: h
1800
- }), _ = z((e, t) => {
1801
- d((n) => ({
1990
+ }), _ = R((e, t) => {
1991
+ f((n) => ({
1802
1992
  ...n,
1803
1993
  [e]: t
1804
1994
  }));
1805
- }, []), { control: v, formState: { isDirty: y }, handleSubmit: b, reset: x, setValue: S } = g, C = ke({
1806
- control: v,
1995
+ }, []), { control: y, formState: { isDirty: b }, handleSubmit: x, reset: S, setValue: C } = g, w = je({
1996
+ control: y,
1807
1997
  defaultValue: h
1808
- }), w = V(() => Object.entries(C).some(([e, t]) => !a.find((t) => t.id === e).isInitialFilterValue(t)), [a, C]), T = z(async (t) => {
1809
- await r(t), x(t), l(u), e();
1998
+ }), T = B(() => a.some((e) => e.isFilterActive(w[e.id], s && w[e.includeMissingValuesFormFieldName] === !0)), [
1999
+ a,
2000
+ w,
2001
+ s
2002
+ ]), E = R(async (t) => {
2003
+ await r(t), S(t), u(d), e();
1810
2004
  }, [
1811
- u,
2005
+ d,
1812
2006
  e,
1813
- x,
2007
+ S,
1814
2008
  r,
1815
- l
1816
- ]), E = z(async () => {
1817
- x(f), await s(), l(u), e();
2009
+ u
2010
+ ]), D = R(async () => {
2011
+ S(p), await c(), u(d), e();
1818
2012
  }, [
1819
- f,
1820
- u,
2013
+ p,
2014
+ d,
1821
2015
  e,
1822
- x,
1823
- s,
1824
- l
1825
- ]), D = z((e) => {
2016
+ S,
2017
+ c,
2018
+ u
2019
+ ]), O = R((e) => {
1826
2020
  let t = a.find((t) => t.id === e);
1827
- S(e, t.initialFilterValue, { shouldDirty: !0 });
1828
- }, [a, S]), O = V(() => a.filter((e) => e.showInSidebar), [a]);
1829
- return /* @__PURE__ */ G(W, { children: !!a && !!h && !!f && /* @__PURE__ */ G(De, {
2021
+ C(e, t.initialFilterValue, { shouldDirty: !0 }), s && C(t.includeMissingValuesFormFieldName, !1, { shouldDirty: !0 });
2022
+ }, [
2023
+ a,
2024
+ C,
2025
+ s
2026
+ ]), ee = B(() => a.filter((e) => e.showInSidebar), [a]);
2027
+ return /* @__PURE__ */ W(U, { children: !!a && !!h && !!p && /* @__PURE__ */ W(De, {
1830
2028
  ...g,
1831
- children: /* @__PURE__ */ K(j, {
2029
+ children: /* @__PURE__ */ G(j, {
1832
2030
  autoComplete: "off",
1833
2031
  component: "form",
1834
2032
  id: "Filters",
1835
- onSubmit: b(T),
2033
+ onSubmit: x(E),
1836
2034
  sx: {
1837
2035
  display: "grid",
1838
2036
  gridTemplateRows: "max-content auto",
1839
2037
  height: "100%"
1840
2038
  },
1841
- children: [/* @__PURE__ */ K(j, { children: [
1842
- y && o && !w && /* @__PURE__ */ G(j, {
2039
+ children: [/* @__PURE__ */ G(j, { children: [
2040
+ b && o && !T && /* @__PURE__ */ W(j, {
1843
2041
  sx: { my: 1 },
1844
2042
  children: t`All filters have been removed, but have not yet been applied.`
1845
2043
  }),
1846
- /* @__PURE__ */ G(j, { children: Object.entries(C).map(([e, n]) => {
1847
- let r = a.find((t) => t.id === e);
1848
- return r.isInitialFilterValue(C[e]) ? null : /* @__PURE__ */ K(j, {
1849
- sx: {
1850
- alignItems: "center",
1851
- display: "grid",
1852
- gap: 1,
1853
- gridTemplateColumns: "auto max-content"
1854
- },
1855
- children: [/* @__PURE__ */ K(j, { children: [
1856
- /* @__PURE__ */ G(j, {
1857
- component: "span",
1858
- children: r.label
1859
- }),
1860
- /* @__PURE__ */ G(j, {
1861
- component: "span",
1862
- children: ": "
1863
- }),
1864
- /* @__PURE__ */ G(j, {
1865
- component: "strong",
1866
- children: r.getPresentationValue(n, t)
1867
- })
1868
- ] }), /* @__PURE__ */ G(F, {
1869
- "aria-label": t("Remove filter with label {{filterLabel}} and value {{filterValue}}", {
1870
- filterLabel: r.label,
1871
- filterValue: r.getPresentationValue(n, t)
1872
- }),
1873
- onClick: () => D(e),
1874
- size: "small",
1875
- children: /* @__PURE__ */ G(Ke, {})
1876
- })]
1877
- }, e);
2044
+ /* @__PURE__ */ W(j, { children: a.map((e) => {
2045
+ let n = w[e.id], r = s && w[e.includeMissingValuesFormFieldName] === !0;
2046
+ if (e.isFilterActive(n, r)) {
2047
+ let i = [e.isInitialFilterValue(n) ? "" : e.getPresentationValue(n, t), r ? t`Missing` : ""].filter(Boolean).join(", ");
2048
+ return /* @__PURE__ */ G(j, {
2049
+ sx: {
2050
+ alignItems: "center",
2051
+ display: "grid",
2052
+ gap: 1,
2053
+ gridTemplateColumns: "auto max-content"
2054
+ },
2055
+ children: [/* @__PURE__ */ G(j, { children: [
2056
+ /* @__PURE__ */ W(j, {
2057
+ component: "span",
2058
+ children: e.label
2059
+ }),
2060
+ /* @__PURE__ */ W(j, {
2061
+ component: "span",
2062
+ children: ": "
2063
+ }),
2064
+ /* @__PURE__ */ W(j, {
2065
+ component: "strong",
2066
+ children: i
2067
+ })
2068
+ ] }), /* @__PURE__ */ W(N, {
2069
+ "aria-label": t("Remove filter with label {{filterLabel}} and value {{filterValue}}", {
2070
+ filterLabel: e.label,
2071
+ filterValue: i
2072
+ }),
2073
+ onClick: () => O(e.id),
2074
+ size: "small",
2075
+ children: /* @__PURE__ */ W(Ke, {})
2076
+ })]
2077
+ }, e.id);
2078
+ }
2079
+ return null;
1878
2080
  }) }),
1879
- (o || y) && /* @__PURE__ */ K(j, {
2081
+ (o || b) && /* @__PURE__ */ G(j, {
1880
2082
  sx: {
1881
2083
  display: "flex",
1882
2084
  gap: 1,
@@ -1884,55 +2086,173 @@ var Ft = Ee, It = ({ filterDimension: e, onFilterVisibilityChange: t, visibleFil
1884
2086
  marginRight: 1,
1885
2087
  my: 1
1886
2088
  },
1887
- children: [/* @__PURE__ */ G(M, {
1888
- ...J.createAttributes("TableFiltersSidebarItem-reset"),
2089
+ children: [/* @__PURE__ */ W(re, {
2090
+ ...q.createAttributes("TableFiltersSidebarItem-reset"),
1889
2091
  color: "primary",
1890
- onClick: E,
1891
- startIcon: /* @__PURE__ */ G(Ge, {}),
2092
+ onClick: D,
2093
+ startIcon: /* @__PURE__ */ W(Ge, {}),
1892
2094
  variant: "outlined",
1893
2095
  children: t`Reset`
1894
- }), /* @__PURE__ */ G(M, {
1895
- ...J.createAttributes("TableFiltersSidebarItem-apply"),
2096
+ }), /* @__PURE__ */ W(re, {
2097
+ ...q.createAttributes("TableFiltersSidebarItem-apply"),
1896
2098
  color: "secondary",
1897
- startIcon: /* @__PURE__ */ G(We, {}),
2099
+ startIcon: /* @__PURE__ */ W(We, {}),
1898
2100
  type: "submit",
1899
2101
  children: t`Apply`
1900
2102
  })]
1901
2103
  })
1902
- ] }), /* @__PURE__ */ K(j, {
2104
+ ] }), /* @__PURE__ */ G(j, {
1903
2105
  sx: {
1904
2106
  overflowY: "auto",
1905
2107
  paddingRight: 1
1906
2108
  },
1907
- children: [i.length > 0 && /* @__PURE__ */ G(W, { children: i.filter((e) => e.filterIds.length).map((e) => /* @__PURE__ */ G(It, {
2109
+ children: [i.length > 0 && /* @__PURE__ */ W(U, { children: i.filter((e) => e.filterIds.length).map((e) => /* @__PURE__ */ W(Jt, {
1908
2110
  filterDimension: e,
1909
2111
  onFilterVisibilityChange: _,
1910
- visibleFilterWithinDimension: u[e.id]
1911
- }, e.id)) }), i.length === 0 && /* @__PURE__ */ G(W, { children: O.map((e) => /* @__PURE__ */ K(j, {
2112
+ showMissingValuesFilter: s,
2113
+ visibleFilterWithinDimension: d[e.id]
2114
+ }, e.id)) }), i.length === 0 && /* @__PURE__ */ W(U, { children: ee.map((e) => /* @__PURE__ */ G(j, {
1912
2115
  sx: { my: 2 },
1913
- children: [/* @__PURE__ */ G(j, {
2116
+ children: [/* @__PURE__ */ W(j, {
1914
2117
  sx: { my: 1 },
1915
- children: /* @__PURE__ */ G(rt, { filter: e })
1916
- }), /* @__PURE__ */ G(P, {})]
2118
+ children: /* @__PURE__ */ W(mt, { filter: e })
2119
+ }), /* @__PURE__ */ W(ae, {})]
1917
2120
  }, e.id)) })]
1918
2121
  })]
1919
2122
  })
1920
2123
  }) });
1921
- }, Rt = ({ onClose: e, open: t }) => {
1922
- let { t: n } = q();
1923
- return /* @__PURE__ */ G(k, {
1924
- closeIcon: /* @__PURE__ */ G(Ft, {}),
2124
+ }, Xt = ({ onClose: e, open: t }) => {
2125
+ let { t: n } = K();
2126
+ return /* @__PURE__ */ W(O, {
2127
+ closeIcon: /* @__PURE__ */ W(qt, {}),
1925
2128
  closeIconTooltipText: n`Close filters`,
1926
2129
  onClose: e,
1927
2130
  open: t,
1928
2131
  testIdAttributes: { name: "tableFiltersSidebarItem" },
1929
2132
  title: n`Filters`,
1930
2133
  width: 60,
1931
- children: t && /* @__PURE__ */ G(Lt, { onClose: e })
2134
+ children: t && /* @__PURE__ */ W(Yt, { onClose: e })
1932
2135
  });
1933
- }, zt = ({ ContainerProps: e }) => {
1934
- let t = x({});
1935
- return /* @__PURE__ */ G(qe, {
2136
+ }, Zt = ({ hasCellData: e }) => {
2137
+ let t = v(), n = m(t, Q((e) => e.emitEvent)), r = m(t, Q((e) => e.columns)), i = m(t, Q((e) => e.dataContext)), a = m(t, Q((e) => e.getCurrentColumnVisualSettings().filter((e) => e.isVisible).map((e) => e.id))), o = m(t, Q((e) => e.columnDimensions)), s = m(t, Q((e) => e.isCondensed)), c = m(t, Q((e) => e.sortedData)), { t: l } = K(), u = B(() => r.some((e) => e.cellColorGetter), [r]), d = R(() => {
2138
+ n("openColumnsEditorDialog", e);
2139
+ }, [n, e]), f = R((e) => {
2140
+ let t = _(a, (t) => t.includes(e) ? t.filter((t) => t !== e) : (t.push(e), t));
2141
+ n("columnVisibilityChange", t);
2142
+ }, [n, a]), h = R((e) => {
2143
+ let t = e.every((e) => a.includes(e)), r = _(a, (n) => t ? n.filter((t) => !e.includes(t)) : (e.forEach((e) => {
2144
+ n.includes(e) || n.push(e);
2145
+ }), n));
2146
+ n("columnVisibilityChange", r);
2147
+ }, [n, a]), g = R(() => {
2148
+ n("columnVisibilityChange", p.getColumnIdsWithData({
2149
+ dataContext: i,
2150
+ hasCellData: e,
2151
+ sortedData: c,
2152
+ tableColumns: r,
2153
+ visibleColumnIds: a
2154
+ }));
2155
+ }, [
2156
+ n,
2157
+ e,
2158
+ c,
2159
+ r,
2160
+ a,
2161
+ i
2162
+ ]), y = R(() => {
2163
+ n("condensedChange", !s);
2164
+ }, [n, s]);
2165
+ return B(() => {
2166
+ let e = [
2167
+ u ? {
2168
+ autoCloseDisabled: !0,
2169
+ callback: () => y(),
2170
+ checked: s ? "true" : "false",
2171
+ divider: !0,
2172
+ label: l`Condensed`,
2173
+ rightIcon: W(s ? Ze : Xe, {})
2174
+ } : void 0,
2175
+ {
2176
+ callback: () => d(),
2177
+ divider: !0,
2178
+ label: l`Column editor`,
2179
+ leftIcon: /* @__PURE__ */ W(Qe, { sx: { fontSize: "1.5rem" } })
2180
+ },
2181
+ {
2182
+ autoCloseDisabled: !0,
2183
+ callback: () => n("reset"),
2184
+ label: l`Reset`
2185
+ },
2186
+ {
2187
+ autoCloseDisabled: !0,
2188
+ callback: () => {
2189
+ n("columnVisibilityChange", [...r.map((e) => e.id)]);
2190
+ },
2191
+ label: l`Show all`
2192
+ },
2193
+ {
2194
+ autoCloseDisabled: !0,
2195
+ callback: () => {
2196
+ n("columnVisibilityChange", [...r.filter((e) => e.frozen).map((e) => e.id)]);
2197
+ },
2198
+ label: l`Hide all`
2199
+ },
2200
+ {
2201
+ autoCloseDisabled: !0,
2202
+ callback: () => g(),
2203
+ divider: !0,
2204
+ label: l`Hide columns without data`
2205
+ }
2206
+ ].filter((e) => e);
2207
+ return o ? o.forEach((t) => {
2208
+ let n = t.columnIds.every((e) => a.includes(e)), i = t.columnIds.some((e) => a.includes(e));
2209
+ e.push({
2210
+ autoCloseDisabled: !0,
2211
+ callback: () => h(t.columnIds),
2212
+ checked: n ? "true" : i ? "mixed" : "false",
2213
+ items: t.columnIds.map((e) => {
2214
+ let t = a.includes(e);
2215
+ return {
2216
+ autoCloseDisabled: !0,
2217
+ callback: () => f(e),
2218
+ checked: t ? "true" : "false",
2219
+ label: r.find((t) => t.id === e)?.headerName ?? "",
2220
+ rightIcon: W(t ? Je : Ye, {})
2221
+ };
2222
+ }),
2223
+ label: t.label,
2224
+ rightIcon: W(n ? Je : i ? Ue : Ye, {})
2225
+ });
2226
+ }) : r.filter((e) => !e.frozen).forEach((t) => {
2227
+ let n = a.includes(t.id);
2228
+ e.push({
2229
+ autoCloseDisabled: !0,
2230
+ callback: () => f(t.id),
2231
+ checked: n ? "true" : "false",
2232
+ label: t.headerName,
2233
+ rightIcon: W(n ? Je : Ye, {})
2234
+ });
2235
+ }), {
2236
+ items: e,
2237
+ label: l`Columns`
2238
+ };
2239
+ }, [
2240
+ s,
2241
+ u,
2242
+ l,
2243
+ o,
2244
+ y,
2245
+ d,
2246
+ n,
2247
+ r,
2248
+ g,
2249
+ a,
2250
+ h,
2251
+ f
2252
+ ]);
2253
+ }, Qt = ({ ContainerProps: e }) => {
2254
+ let t = Zt({});
2255
+ return /* @__PURE__ */ W(qe, {
1936
2256
  ButtonProps: {
1937
2257
  color: "primary",
1938
2258
  size: "small",
@@ -1942,36 +2262,143 @@ var Ft = Ee, It = ({ filterDimension: e, onFilterVisibilityChange: t, visibleFil
1942
2262
  menuItemsData: t,
1943
2263
  MenuProps: { elevation: 3 }
1944
2264
  });
1945
- }, Bt = ({ header: e, headerComponent: t = "h3", headerVariant: n = "h5", showTableMenu: r = !0 }) => /* @__PURE__ */ K(j, {
2265
+ }, $t = ({ header: e, headerComponent: t = "h3", headerVariant: n = "h5", showTableMenu: r = !0 }) => /* @__PURE__ */ G(j, {
1946
2266
  sx: {
1947
2267
  alignItems: "center",
1948
2268
  display: "flex",
1949
2269
  justifyContent: e ? "space-between" : "flex-end"
1950
2270
  },
1951
- children: [e && /* @__PURE__ */ G(j, { children: /* @__PURE__ */ G(Tt, {
2271
+ children: [e && /* @__PURE__ */ W(j, { children: /* @__PURE__ */ W(Lt, {
1952
2272
  caption: e,
1953
2273
  component: t,
1954
2274
  variant: n
1955
- }) }), r && /* @__PURE__ */ G(j, { children: /* @__PURE__ */ G(zt, {}) })]
1956
- }), Vt = ({ extraSidebarMenuItems: e }) => {
1957
- let t = m(), n = p(t, (e) => e.filters.filter((e) => !e.isInitialFilterValue()).length), [r, i] = U(!1), a = z(() => {
1958
- i(!1);
1959
- }, []), o = z(() => {
1960
- i(!0);
1961
- }, []);
1962
- return /* @__PURE__ */ K(W, { children: [/* @__PURE__ */ K(ee, { children: [/* @__PURE__ */ G(te, {
1963
- badgeColor: "secondary",
1964
- badgeContent: n,
1965
- first: !0,
1966
- icon: /* @__PURE__ */ G(Ft, {}),
1967
- onClick: o,
1968
- testIdAttributes: { name: "filters" },
1969
- title: A`Open filters`
1970
- }), e] }), /* @__PURE__ */ G(Rt, {
1971
- onClose: a,
1972
- open: r
2275
+ }) }), r && /* @__PURE__ */ W(j, { children: /* @__PURE__ */ W(Qt, {}) })]
2276
+ }), en = $e, tn = ({ downloadAsFileName: e }) => {
2277
+ let { t } = K(), n = v(), r = m(n, Q((e) => e.selectedIds.length > 0)), i = m(n, Q((e) => e.dataContext)), a = R(() => n.getState().getCurrentColumnVisualSettings().filter((e) => e.isVisible).map((e) => e.id), [n]), o = R(() => n.getState().columns, [n]), s = R(() => {
2278
+ let { idSelectorCallback: e, selectedIds: t, sortedData: r } = n.getState();
2279
+ return r.filter((n) => t.includes(e(n)));
2280
+ }, [n]), c = R(async () => {
2281
+ await p.downloadAsExcel(n.getState().sortedData, a(), o(), e ? `${e}.xlsx` : "all_rows.xlsx", i);
2282
+ }, [
2283
+ i,
2284
+ e,
2285
+ o,
2286
+ a,
2287
+ n
2288
+ ]), l = R(() => {
2289
+ p.downloadAsCSV(n.getState().sortedData, a(), o(), e ? `${e}.csv` : "all_rows.csv", i);
2290
+ }, [
2291
+ i,
2292
+ e,
2293
+ o,
2294
+ a,
2295
+ n
2296
+ ]), u = R(async () => {
2297
+ await p.downloadAsExcel(s(), a(), o(), e ? `${e}__selected_rows.xlsx` : "selected_rows.xlsx", i);
2298
+ }, [
2299
+ i,
2300
+ e,
2301
+ o,
2302
+ s,
2303
+ a
2304
+ ]), d = R(() => {
2305
+ p.downloadAsCSV(s(), a(), o(), e ? `${e}__selected_rows.csv` : "selected_rows.csv", i);
2306
+ }, [
2307
+ i,
2308
+ e,
2309
+ o,
2310
+ s,
2311
+ a
2312
+ ]);
2313
+ return /* @__PURE__ */ G(U, { children: [/* @__PURE__ */ G(j, { children: [/* @__PURE__ */ W(le, {
2314
+ variant: "h6",
2315
+ children: t`All rows`
2316
+ }), /* @__PURE__ */ G(j, {
2317
+ sx: { marginLeft: 1 },
2318
+ children: [/* @__PURE__ */ W(j, { children: /* @__PURE__ */ W(P, {
2319
+ component: "button",
2320
+ onClick: c,
2321
+ tabIndex: 0,
2322
+ children: t`Download all rows as Excel`
2323
+ }) }), /* @__PURE__ */ W(j, { children: /* @__PURE__ */ W(P, {
2324
+ component: "button",
2325
+ onClick: l,
2326
+ tabIndex: 0,
2327
+ children: t`Download all rows as CSV`
2328
+ }) })]
2329
+ })] }), r && /* @__PURE__ */ G(j, {
2330
+ sx: { my: 1 },
2331
+ children: [/* @__PURE__ */ W(le, {
2332
+ variant: "h6",
2333
+ children: t`Selected rows`
2334
+ }), /* @__PURE__ */ G(j, {
2335
+ sx: { marginLeft: 1 },
2336
+ children: [/* @__PURE__ */ W(j, { children: /* @__PURE__ */ W(P, {
2337
+ component: "button",
2338
+ onClick: u,
2339
+ tabIndex: 0,
2340
+ children: t`Download selected rows as Excel`
2341
+ }) }), /* @__PURE__ */ W(j, { children: /* @__PURE__ */ W(P, {
2342
+ component: "button",
2343
+ onClick: d,
2344
+ tabIndex: 0,
2345
+ children: t`Download selected rows as CSV`
2346
+ }) })]
2347
+ })]
1973
2348
  })] });
2349
+ }, nn = ({ downloadAsFileName: e, onClose: t, open: n }) => {
2350
+ let { t: r } = K();
2351
+ return /* @__PURE__ */ W(O, {
2352
+ closeIcon: /* @__PURE__ */ W(en, {}),
2353
+ closeIconTooltipText: r`Close download`,
2354
+ onClose: t,
2355
+ open: n,
2356
+ testIdAttributes: { name: "tableDownloadSidebarItem" },
2357
+ title: r`Download`,
2358
+ width: 60,
2359
+ children: n && /* @__PURE__ */ W(tn, { downloadAsFileName: e })
2360
+ });
2361
+ }, rn = ({ downloadAsFileName: e, extraSidebarMenuItems: t }) => {
2362
+ let n = v(), r = m(n, (e) => e.filters.filter((e) => e.isFilterActive()).length), [i, a] = H(!1), [o, s] = H(!1), c = R(() => {
2363
+ a(!1);
2364
+ }, []), l = R(() => {
2365
+ s(!1);
2366
+ }, []), u = R(() => {
2367
+ a(!0);
2368
+ }, []), d = R(() => {
2369
+ s(!0);
2370
+ }, []);
2371
+ return /* @__PURE__ */ G(U, { children: [
2372
+ /* @__PURE__ */ G(ee, { children: [
2373
+ /* @__PURE__ */ W(k, {
2374
+ badgeColor: "secondary",
2375
+ badgeContent: r,
2376
+ first: !0,
2377
+ icon: /* @__PURE__ */ W(qt, {}),
2378
+ onClick: u,
2379
+ testIdAttributes: { name: "filters" },
2380
+ title: A`Open filters`
2381
+ }),
2382
+ /* @__PURE__ */ W(k, {
2383
+ badgeColor: "secondary",
2384
+ icon: /* @__PURE__ */ W(en, {}),
2385
+ onClick: d,
2386
+ testIdAttributes: { name: "download" },
2387
+ title: A`Open download`
2388
+ }),
2389
+ t
2390
+ ] }),
2391
+ /* @__PURE__ */ W(Xt, {
2392
+ onClose: c,
2393
+ open: i
2394
+ }),
2395
+ /* @__PURE__ */ W(nn, {
2396
+ downloadAsFileName: e,
2397
+ onClose: l,
2398
+ open: o
2399
+ })
2400
+ ] });
1974
2401
  };
1975
- export { Lt as a, wt as c, ot as d, it as f, Qe as h, Rt as i, ft as l, $e as m, Bt as n, Ft as o, rt as p, zt as r, Tt as s, Vt as t, dt as u };
2402
+ export { it as _, Xt as a, Lt as c, wt as d, Ct as f, ut as g, mt as h, Zt as i, It as l, ht as m, $t as n, Yt as o, _t as p, Qt as r, qt as s, rn as t, jt as u };
1976
2403
 
1977
2404
  //# sourceMappingURL=Table.js.map