wcz-layout 9.7.0 → 10.0.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 (93) hide show
  1. package/dist/AggregatedCell-BtKC5-m6.mjs +497 -0
  2. package/dist/AggregatedCell-BtKC5-m6.mjs.map +1 -0
  3. package/dist/Approval-C-hF4jbT.mjs.map +1 -1
  4. package/dist/DialogsContext-DLqA8RJ_.mjs.map +1 -1
  5. package/dist/Email-BzQQkbe9.mjs.map +1 -1
  6. package/dist/FileMeta-DDqUju1Y.mjs.map +1 -1
  7. package/dist/LayoutTable-4DLs-NI-.d.mts +752 -0
  8. package/dist/{QueryClientParam-Cbb0MIKg.d.mts → QueryClientParam-JcH0mJWl.d.mts} +2 -2
  9. package/dist/RouterListItemButton-ULMlaQh6.mjs.map +1 -1
  10. package/dist/{User-1gKoYJvW.d.mts → User-D4__w1I1.d.mts} +4 -2
  11. package/dist/approval-DFExxyAJ.mjs +84 -0
  12. package/dist/approval-DFExxyAJ.mjs.map +1 -0
  13. package/dist/auth.d.mts +21 -11
  14. package/dist/auth.mjs +43 -26
  15. package/dist/auth.mjs.map +1 -1
  16. package/dist/components.d.mts +22 -30
  17. package/dist/components.mjs +786 -139
  18. package/dist/components.mjs.map +1 -1
  19. package/dist/createApi-CLYWCzR2.mjs +27 -0
  20. package/dist/createApi-CLYWCzR2.mjs.map +1 -0
  21. package/dist/data/client.d.mts +702 -1152
  22. package/dist/data/client.mjs +4 -3
  23. package/dist/data/client.mjs.map +1 -1
  24. package/dist/data/server.d.mts +3 -3
  25. package/dist/data/server.mjs +4 -2
  26. package/dist/data/server.mjs.map +1 -1
  27. package/dist/{file-BWcNzq55.mjs → file-CZwQfvTU.mjs} +5 -24
  28. package/dist/file-CZwQfvTU.mjs.map +1 -0
  29. package/dist/{file-DimNsRly.mjs → file-aSQto2rw.mjs} +6 -7
  30. package/dist/file-aSQto2rw.mjs.map +1 -0
  31. package/dist/hooks.d.mts +7 -46
  32. package/dist/hooks.mjs +2578 -239
  33. package/dist/hooks.mjs.map +1 -1
  34. package/dist/index.d.mts +28 -9
  35. package/dist/index.mjs +1248 -500
  36. package/dist/index.mjs.map +1 -1
  37. package/dist/middleware.d.mts +20 -19
  38. package/dist/middleware.mjs +47 -2
  39. package/dist/middleware.mjs.map +1 -1
  40. package/dist/models.d.mts +17 -10
  41. package/dist/models.mjs.map +1 -1
  42. package/dist/{peoplesoft-CskGsqd6.d.mts → peoplesoft-BY_75WTS.d.mts} +2 -2
  43. package/dist/{peoplesoft-DTPGpN2h.mjs → peoplesoft-CQnc01Hc.mjs} +24 -81
  44. package/dist/peoplesoft-CQnc01Hc.mjs.map +1 -0
  45. package/dist/providers-Dbl95AxR.mjs +74 -0
  46. package/dist/providers-Dbl95AxR.mjs.map +1 -0
  47. package/dist/tokens-D8CVIFTb.mjs +143 -0
  48. package/dist/tokens-D8CVIFTb.mjs.map +1 -0
  49. package/dist/{utils-5x4uNxsX.d.mts → utils-Bhi0KiBx.d.mts} +18 -6
  50. package/dist/{utils-DjdexspV.mjs → utils-KaM5VMTJ.mjs} +64 -42
  51. package/dist/utils-KaM5VMTJ.mjs.map +1 -0
  52. package/dist/utils.d.mts +2 -2
  53. package/dist/utils.mjs +2 -2
  54. package/dist/vite.d.mts +1 -2
  55. package/dist/vite.mjs +3 -3
  56. package/dist/vite.mjs.map +1 -1
  57. package/package.json +23 -23
  58. package/skills/client-db/SKILL.md +104 -96
  59. package/skills/db-schema/SKILL.md +46 -33
  60. package/skills/dialogs/SKILL.md +21 -27
  61. package/skills/forms/SKILL.md +60 -39
  62. package/skills/general/SKILL.md +56 -25
  63. package/skills/general/references/exports.md +106 -0
  64. package/skills/migrations/SKILL.md +53 -2
  65. package/skills/migrations/versions/migrate-v9-to-v10.md +581 -0
  66. package/skills/routing/SKILL.md +50 -60
  67. package/skills/server-functions/SKILL.md +36 -56
  68. package/skills/services/SKILL.md +7 -4
  69. package/skills/services/docs/approval.md +2 -2
  70. package/skills/services/docs/peoplesoft.md +1 -1
  71. package/skills/start/SKILL.md +9 -5
  72. package/skills/start/steps/05-database-setup.md +52 -52
  73. package/skills/start/steps/06-entra-setup.md +1 -1
  74. package/skills/start/steps/07-vault-setup.md +5 -12
  75. package/skills/table/SKILL.md +275 -0
  76. package/skills/unslop/SKILL.md +80 -0
  77. package/dist/NotificationContext-CgwUOeW0.mjs +0 -7
  78. package/dist/NotificationContext-CgwUOeW0.mjs.map +0 -1
  79. package/dist/authMiddleware-DPly0b_T.mjs +0 -48
  80. package/dist/authMiddleware-DPly0b_T.mjs.map +0 -1
  81. package/dist/entra-CJSyeQsx.mjs +0 -109
  82. package/dist/entra-CJSyeQsx.mjs.map +0 -1
  83. package/dist/file-BWcNzq55.mjs.map +0 -1
  84. package/dist/file-DimNsRly.mjs.map +0 -1
  85. package/dist/msalServer-DLwA7_ta.mjs +0 -30
  86. package/dist/msalServer-DLwA7_ta.mjs.map +0 -1
  87. package/dist/peoplesoft-DTPGpN2h.mjs.map +0 -1
  88. package/dist/useDialogs-BUzVrTSP.mjs +0 -248
  89. package/dist/useDialogs-BUzVrTSP.mjs.map +0 -1
  90. package/dist/user-Dzv0N9fj.d.mts +0 -16
  91. package/dist/utils-DjdexspV.mjs.map +0 -1
  92. package/skills/data-grid/SKILL.md +0 -142
  93. package/skills/migrations/versions/migrate-v9-to-v10.tsx +0 -9
package/dist/hooks.mjs CHANGED
@@ -1,15 +1,36 @@
1
- import { a as getFieldStatus } from "./utils-DjdexspV.mjs";
2
- import { t as NotificationContext } from "./NotificationContext-CgwUOeW0.mjs";
3
- import { t as useDialogs } from "./useDialogs-BUzVrTSP.mjs";
1
+ import { a as foldForSearch, o as getFieldStatus } from "./utils-KaM5VMTJ.mjs";
2
+ import { a as tableContext, c as useTableContext, f as columnLabel, g as shortcutLabel, i as layoutTableFeatures, l as formatValue, m as moveColumn, n as cellContext, o as useCellContext, p as hasColumnLabel, r as headerContext, s as useHeaderContext, t as AggregatedCell, v as useDialogs } from "./AggregatedCell-BtKC5-m6.mjs";
4
3
  import { c } from "react/compiler-runtime";
5
- import { Autocomplete, Button, Checkbox, FormControl, FormControlLabel, FormHelperText, FormLabel, Radio, RadioGroup, Slider, Switch, TextField } from "@mui/material";
6
- import { DatePicker, DateRangePicker, DateTimePicker, DateTimeRangePicker, TimePicker, TimeRangePicker } from "@mui/x-date-pickers-pro";
7
- import { useContext, useEffect, useRef } from "react";
8
- import { useTranslation } from "react-i18next";
9
- import { jsx, jsxs } from "react/jsx-runtime";
4
+ import { Autocomplete, Badge, Box, Button, Checkbox, Divider, FormControl, FormControlLabel, FormHelperText, FormLabel, IconButton, InputAdornment, InputLabel, ListItemIcon, ListItemText, Menu, MenuItem, Popover, Radio, RadioGroup, Select, Skeleton, Slider, Stack, Switch, TableCell, TablePagination, TableRow, TableSortLabel, TextField, Tooltip, Typography, useTheme } from "@mui/material";
5
+ import { DatePicker, DateTimePicker, TimePicker } from "@mui/x-date-pickers";
6
+ import dayjs from "dayjs";
7
+ import { useEffect, useRef, useState } from "react";
8
+ import { useTranslation, useTranslation as useTranslation$1 } from "react-i18next";
9
+ import ArrowBack from "@mui/icons-material/ArrowBack";
10
+ import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
11
+ import Close from "@mui/icons-material/Close";
12
+ import MoreVert from "@mui/icons-material/MoreVert";
10
13
  import { useInView } from "react-intersection-observer";
14
+ import { useHotkey } from "@tanstack/react-hotkeys";
15
+ import { FlexRender, Subscribe, constructFilterFn, createTableHook, filterFn_arrHas, filterFn_empty, filterFn_endsWith, filterFn_equals, filterFn_equalsString, filterFn_greaterThan, filterFn_greaterThanOrEqualTo, filterFn_inDateRange, filterFn_inNumberRange, filterFn_includesString, filterFn_lessThan, filterFn_lessThanOrEqualTo, filterFn_notEmpty, filterFn_startsWith } from "@tanstack/react-table";
11
16
  import { createFormHook, createFormHookContexts } from "@tanstack/react-form";
12
17
  import { NumericFormat } from "react-number-format";
18
+ import KeyboardArrowDown from "@mui/icons-material/KeyboardArrowDown";
19
+ import KeyboardArrowRight from "@mui/icons-material/KeyboardArrowRight";
20
+ import PushPin from "@mui/icons-material/PushPin";
21
+ import Check from "@mui/icons-material/Check";
22
+ import localizedFormat from "dayjs/plugin/localizedFormat";
23
+ import ArrowDownward from "@mui/icons-material/ArrowDownward";
24
+ import ArrowForward from "@mui/icons-material/ArrowForward";
25
+ import ArrowUpward from "@mui/icons-material/ArrowUpward";
26
+ import Clear from "@mui/icons-material/Clear";
27
+ import VisibilityOff from "@mui/icons-material/VisibilityOff";
28
+ import Workspaces from "@mui/icons-material/Workspaces";
29
+ import ViewColumn from "@mui/icons-material/ViewColumn";
30
+ import Add from "@mui/icons-material/Add";
31
+ import DeleteForever from "@mui/icons-material/DeleteForever";
32
+ import FilterList from "@mui/icons-material/FilterList";
33
+ import Search from "@mui/icons-material/Search";
13
34
  //#region src/components/form/FormAutocomplete.tsx
14
35
  const FormAutocomplete = (t0) => {
15
36
  const $ = c(24);
@@ -166,9 +187,9 @@ const FormCheckbox = (props) => {
166
187
  //#region src/components/form/FormDatePicker.tsx
167
188
  const FormDatePicker = (props) => {
168
189
  const $ = c(19);
169
- if ($[0] !== "fd3801846177cf754134f54f40ba317ddd09332641ff63d233cd125421f2c67b") {
190
+ if ($[0] !== "b3ec6a4f7a9d751734b17e31959ca5d29f8a6181225d63bd8d0d932da93bddff") {
170
191
  for (let $i = 0; $i < 19; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
171
- $[0] = "fd3801846177cf754134f54f40ba317ddd09332641ff63d233cd125421f2c67b";
192
+ $[0] = "b3ec6a4f7a9d751734b17e31959ca5d29f8a6181225d63bd8d0d932da93bddff";
172
193
  }
173
194
  const field = useFieldContext();
174
195
  let t0;
@@ -230,79 +251,12 @@ const FormDatePicker = (props) => {
230
251
  return t6;
231
252
  };
232
253
  //#endregion
233
- //#region src/components/form/FormDateRangePicker.tsx
234
- const FormDateRangePicker = (props) => {
235
- const $ = c(19);
236
- if ($[0] !== "26740a78e061ed162c8cdd3f736bac4bbd8228343542f0a95b626c4370dfec2c") {
237
- for (let $i = 0; $i < 19; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
238
- $[0] = "26740a78e061ed162c8cdd3f736bac4bbd8228343542f0a95b626c4370dfec2c";
239
- }
240
- const field = useFieldContext();
241
- let t0;
242
- if ($[1] !== field) {
243
- t0 = getFieldStatus(field);
244
- $[1] = field;
245
- $[2] = t0;
246
- } else t0 = $[2];
247
- const { isTouched, hasError, helperText } = t0;
248
- let t1;
249
- if ($[3] !== field) {
250
- t1 = (value) => field.handleChange(value);
251
- $[3] = field;
252
- $[4] = t1;
253
- } else t1 = $[4];
254
- const t2 = isTouched && hasError;
255
- const t3 = isTouched && helperText;
256
- let t4;
257
- if ($[5] !== field.handleBlur || $[6] !== props.textFieldProps || $[7] !== t2 || $[8] !== t3) {
258
- t4 = {
259
- onBlur: field.handleBlur,
260
- error: t2,
261
- helperText: t3,
262
- ...props.textFieldProps
263
- };
264
- $[5] = field.handleBlur;
265
- $[6] = props.textFieldProps;
266
- $[7] = t2;
267
- $[8] = t3;
268
- $[9] = t4;
269
- } else t4 = $[9];
270
- let t5;
271
- if ($[10] !== props.slotProps || $[11] !== t4) {
272
- t5 = {
273
- textField: t4,
274
- ...props.slotProps
275
- };
276
- $[10] = props.slotProps;
277
- $[11] = t4;
278
- $[12] = t5;
279
- } else t5 = $[12];
280
- let t6;
281
- if ($[13] !== field.name || $[14] !== field.state.value || $[15] !== props || $[16] !== t1 || $[17] !== t5) {
282
- t6 = /* @__PURE__ */ jsx(DateRangePicker, {
283
- name: field.name,
284
- value: field.state.value,
285
- onChange: t1,
286
- slotProps: t5,
287
- "aria-label": field.name,
288
- ...props
289
- });
290
- $[13] = field.name;
291
- $[14] = field.state.value;
292
- $[15] = props;
293
- $[16] = t1;
294
- $[17] = t5;
295
- $[18] = t6;
296
- } else t6 = $[18];
297
- return t6;
298
- };
299
- //#endregion
300
254
  //#region src/components/form/FormTimePicker.tsx
301
255
  const FormTimePicker = (props) => {
302
256
  const $ = c(19);
303
- if ($[0] !== "aa55e2d0367833e113247906f25693dd58dcaee1a6122e3a6c66663c92c05612") {
257
+ if ($[0] !== "009664b5441550099c1a5250000faad760e9a295ff513262f5d4c405041c4af0") {
304
258
  for (let $i = 0; $i < 19; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
305
- $[0] = "aa55e2d0367833e113247906f25693dd58dcaee1a6122e3a6c66663c92c05612";
259
+ $[0] = "009664b5441550099c1a5250000faad760e9a295ff513262f5d4c405041c4af0";
306
260
  }
307
261
  const field = useFieldContext();
308
262
  let t0;
@@ -364,79 +318,12 @@ const FormTimePicker = (props) => {
364
318
  return t6;
365
319
  };
366
320
  //#endregion
367
- //#region src/components/form/FormTimeRangePicker.tsx
368
- const FormTimeRangePicker = (props) => {
369
- const $ = c(19);
370
- if ($[0] !== "30660889eec66a781b0a525918a386583e5fce924bb503c7bbb22779b32dfb41") {
371
- for (let $i = 0; $i < 19; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
372
- $[0] = "30660889eec66a781b0a525918a386583e5fce924bb503c7bbb22779b32dfb41";
373
- }
374
- const field = useFieldContext();
375
- let t0;
376
- if ($[1] !== field) {
377
- t0 = getFieldStatus(field);
378
- $[1] = field;
379
- $[2] = t0;
380
- } else t0 = $[2];
381
- const { isTouched, hasError, helperText } = t0;
382
- let t1;
383
- if ($[3] !== field) {
384
- t1 = (value) => field.handleChange(value);
385
- $[3] = field;
386
- $[4] = t1;
387
- } else t1 = $[4];
388
- const t2 = isTouched && hasError;
389
- const t3 = isTouched && helperText;
390
- let t4;
391
- if ($[5] !== field.handleBlur || $[6] !== props.textFieldProps || $[7] !== t2 || $[8] !== t3) {
392
- t4 = {
393
- onBlur: field.handleBlur,
394
- error: t2,
395
- helperText: t3,
396
- ...props.textFieldProps
397
- };
398
- $[5] = field.handleBlur;
399
- $[6] = props.textFieldProps;
400
- $[7] = t2;
401
- $[8] = t3;
402
- $[9] = t4;
403
- } else t4 = $[9];
404
- let t5;
405
- if ($[10] !== props.slotProps || $[11] !== t4) {
406
- t5 = {
407
- textField: t4,
408
- ...props.slotProps
409
- };
410
- $[10] = props.slotProps;
411
- $[11] = t4;
412
- $[12] = t5;
413
- } else t5 = $[12];
414
- let t6;
415
- if ($[13] !== field.name || $[14] !== field.state.value || $[15] !== props || $[16] !== t1 || $[17] !== t5) {
416
- t6 = /* @__PURE__ */ jsx(TimeRangePicker, {
417
- name: field.name,
418
- value: field.state.value,
419
- onChange: t1,
420
- slotProps: t5,
421
- "aria-label": field.name,
422
- ...props
423
- });
424
- $[13] = field.name;
425
- $[14] = field.state.value;
426
- $[15] = props;
427
- $[16] = t1;
428
- $[17] = t5;
429
- $[18] = t6;
430
- } else t6 = $[18];
431
- return t6;
432
- };
433
- //#endregion
434
321
  //#region src/components/form/FormDateTimePicker.tsx
435
322
  const FormDateTimePicker = (props) => {
436
323
  const $ = c(19);
437
- if ($[0] !== "b00d96cea788cb528419859c0fa3a0bfd614231d390c4dc4461c509a72ff1a2b") {
324
+ if ($[0] !== "dc1d4a9f2239023276c3ff2c1edc368e73b5542beb69edd186ca52ac837a180c") {
438
325
  for (let $i = 0; $i < 19; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
439
- $[0] = "b00d96cea788cb528419859c0fa3a0bfd614231d390c4dc4461c509a72ff1a2b";
326
+ $[0] = "dc1d4a9f2239023276c3ff2c1edc368e73b5542beb69edd186ca52ac837a180c";
440
327
  }
441
328
  const field = useFieldContext();
442
329
  let t0;
@@ -498,73 +385,6 @@ const FormDateTimePicker = (props) => {
498
385
  return t6;
499
386
  };
500
387
  //#endregion
501
- //#region src/components/form/FormDateTimeRangePicker.tsx
502
- const FormDateTimeRangePicker = (props) => {
503
- const $ = c(19);
504
- if ($[0] !== "90233aef36d5b4bc17041c44cfdbb9dd1cb92164078d619b4751236fb27414a5") {
505
- for (let $i = 0; $i < 19; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
506
- $[0] = "90233aef36d5b4bc17041c44cfdbb9dd1cb92164078d619b4751236fb27414a5";
507
- }
508
- const field = useFieldContext();
509
- let t0;
510
- if ($[1] !== field) {
511
- t0 = getFieldStatus(field);
512
- $[1] = field;
513
- $[2] = t0;
514
- } else t0 = $[2];
515
- const { isTouched, hasError, helperText } = t0;
516
- let t1;
517
- if ($[3] !== field) {
518
- t1 = (value) => field.handleChange(value);
519
- $[3] = field;
520
- $[4] = t1;
521
- } else t1 = $[4];
522
- const t2 = isTouched && hasError;
523
- const t3 = isTouched && helperText;
524
- let t4;
525
- if ($[5] !== field.handleBlur || $[6] !== props.textFieldProps || $[7] !== t2 || $[8] !== t3) {
526
- t4 = {
527
- onBlur: field.handleBlur,
528
- error: t2,
529
- helperText: t3,
530
- ...props.textFieldProps
531
- };
532
- $[5] = field.handleBlur;
533
- $[6] = props.textFieldProps;
534
- $[7] = t2;
535
- $[8] = t3;
536
- $[9] = t4;
537
- } else t4 = $[9];
538
- let t5;
539
- if ($[10] !== props.slotProps || $[11] !== t4) {
540
- t5 = {
541
- textField: t4,
542
- ...props.slotProps
543
- };
544
- $[10] = props.slotProps;
545
- $[11] = t4;
546
- $[12] = t5;
547
- } else t5 = $[12];
548
- let t6;
549
- if ($[13] !== field.name || $[14] !== field.state.value || $[15] !== props || $[16] !== t1 || $[17] !== t5) {
550
- t6 = /* @__PURE__ */ jsx(DateTimeRangePicker, {
551
- name: field.name,
552
- value: field.state.value,
553
- onChange: t1,
554
- slotProps: t5,
555
- "aria-label": field.name,
556
- ...props
557
- });
558
- $[13] = field.name;
559
- $[14] = field.state.value;
560
- $[15] = props;
561
- $[16] = t1;
562
- $[17] = t5;
563
- $[18] = t6;
564
- } else t6 = $[18];
565
- return t6;
566
- };
567
- //#endregion
568
388
  //#region src/components/form/FormNumberField.tsx
569
389
  const FormNumberField = (t0) => {
570
390
  const $ = c(17);
@@ -680,7 +500,7 @@ const FormRadioGroup = (t0) => {
680
500
  const t7 = field.name;
681
501
  let t8;
682
502
  if ($[11] !== options) {
683
- t8 = options.map(_temp$1);
503
+ t8 = options.map(_temp$8);
684
504
  $[11] = options;
685
505
  $[12] = t8;
686
506
  } else t8 = $[12];
@@ -731,7 +551,7 @@ const FormRadioGroup = (t0) => {
731
551
  } else t11 = $[27];
732
552
  return t11;
733
553
  };
734
- function _temp$1(option) {
554
+ function _temp$8(option) {
735
555
  return /* @__PURE__ */ jsx(FormControlLabel, {
736
556
  value: option.value,
737
557
  control: /* @__PURE__ */ jsx(Radio, {}),
@@ -863,7 +683,7 @@ const FormSubmitButton = (props) => {
863
683
  let t2;
864
684
  if ($[6] !== form.Subscribe || $[7] !== t1) {
865
685
  t2 = /* @__PURE__ */ jsx(form.Subscribe, {
866
- selector: _temp,
686
+ selector: _temp$7,
867
687
  children: t1
868
688
  });
869
689
  $[6] = form.Subscribe;
@@ -872,7 +692,7 @@ const FormSubmitButton = (props) => {
872
692
  } else t2 = $[8];
873
693
  return t2;
874
694
  };
875
- function _temp(state) {
695
+ function _temp$7(state) {
876
696
  return [state.canSubmit, state.isSubmitting];
877
697
  }
878
698
  //#endregion
@@ -1011,32 +831,14 @@ const { useAppForm: useLayoutForm, withForm: withLayoutForm } = createFormHook({
1011
831
  RadioGroup: FormRadioGroup,
1012
832
  Slider: FormSlider,
1013
833
  DatePicker: FormDatePicker,
1014
- DateRangePicker: FormDateRangePicker,
1015
834
  TimePicker: FormTimePicker,
1016
- TimeRangePicker: FormTimeRangePicker,
1017
- DateTimePicker: FormDateTimePicker,
1018
- DateTimeRangePicker: FormDateTimeRangePicker
835
+ DateTimePicker: FormDateTimePicker
1019
836
  },
1020
837
  formComponents: { SubmitButton: FormSubmitButton },
1021
838
  fieldContext,
1022
839
  formContext
1023
840
  });
1024
841
  //#endregion
1025
- //#region src/hooks/useNotification.ts
1026
- /**
1027
- * @deprecated Prefer a success animation for successful actions and a non-disappearing alert dialog for errors.
1028
- */
1029
- function useNotification() {
1030
- const $ = c(1);
1031
- if ($[0] !== "8e3153deaa4a94d3ff93cc356c9ebb0318779678482cc87d8179a89624e3d9fb") {
1032
- for (let $i = 0; $i < 1; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
1033
- $[0] = "8e3153deaa4a94d3ff93cc356c9ebb0318779678482cc87d8179a89624e3d9fb";
1034
- }
1035
- const context = useContext(NotificationContext);
1036
- if (!context) throw new Error("useNotification must be used within a NotificationProvider");
1037
- return context;
1038
- }
1039
- //#endregion
1040
842
  //#region src/hooks/useScanDetection.ts
1041
843
  const useScanDetection = ({ timeToEvaluate = 100, averageWaitTime = 50, startCharacter = [], endCharacter = ["Enter", "Escape"], onComplete, onError, minLength = 1, ignoreIfFocusOn, stopPropagation = false, preventDefault = false, container, enabled = true }) => {
1042
844
  const buffer = useRef([]);
@@ -1085,6 +887,2543 @@ const useScanDetection = ({ timeToEvaluate = 100, averageWaitTime = 50, startCha
1085
887
  }, [container]);
1086
888
  };
1087
889
  //#endregion
1088
- export { useDialogs, useFieldContext, useFormContext, useInView, useLayoutForm, useNotification, useScanDetection, useTranslation, withLayoutForm };
890
+ //#region src/components/table/cells/features/ActionsCell.tsx
891
+ const ActionsCell = (t0) => {
892
+ const $ = c(25);
893
+ if ($[0] !== "c383b316e656daf525eafc82d0cfbfc90d697f09f84d09450d77bdc197a2cd1c") {
894
+ for (let $i = 0; $i < 25; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
895
+ $[0] = "c383b316e656daf525eafc82d0cfbfc90d697f09f84d09450d77bdc197a2cd1c";
896
+ }
897
+ const { actions } = t0;
898
+ const cell = useCellContext();
899
+ const { t } = useTranslation$1();
900
+ const [anchorEl, setAnchorEl] = useState(null);
901
+ if (!actions.length) return null;
902
+ let t1;
903
+ if ($[1] !== t) {
904
+ t1 = t("Layout.Table.RowActions");
905
+ $[1] = t;
906
+ $[2] = t1;
907
+ } else t1 = $[2];
908
+ let t2;
909
+ if ($[3] !== t) {
910
+ t2 = t("Layout.Table.RowActions");
911
+ $[3] = t;
912
+ $[4] = t2;
913
+ } else t2 = $[4];
914
+ let t3;
915
+ let t4;
916
+ if ($[5] === Symbol.for("react.memo_cache_sentinel")) {
917
+ t3 = (event) => {
918
+ event.stopPropagation();
919
+ setAnchorEl(event.currentTarget);
920
+ };
921
+ t4 = /* @__PURE__ */ jsx(MoreVert, { fontSize: "small" });
922
+ $[5] = t3;
923
+ $[6] = t4;
924
+ } else {
925
+ t3 = $[5];
926
+ t4 = $[6];
927
+ }
928
+ let t5;
929
+ if ($[7] !== t2) {
930
+ t5 = /* @__PURE__ */ jsx(IconButton, {
931
+ size: "small",
932
+ "aria-label": t2,
933
+ "aria-haspopup": "menu",
934
+ onClick: t3,
935
+ children: t4
936
+ });
937
+ $[7] = t2;
938
+ $[8] = t5;
939
+ } else t5 = $[8];
940
+ let t6;
941
+ if ($[9] !== t1 || $[10] !== t5) {
942
+ t6 = /* @__PURE__ */ jsx(Tooltip, {
943
+ title: t1,
944
+ children: t5
945
+ });
946
+ $[9] = t1;
947
+ $[10] = t5;
948
+ $[11] = t6;
949
+ } else t6 = $[11];
950
+ const t7 = !!anchorEl;
951
+ let t8;
952
+ if ($[12] === Symbol.for("react.memo_cache_sentinel")) {
953
+ t8 = () => setAnchorEl(null);
954
+ $[12] = t8;
955
+ } else t8 = $[12];
956
+ let t9;
957
+ if ($[13] !== actions || $[14] !== cell) {
958
+ let t10;
959
+ if ($[16] !== cell) {
960
+ t10 = (action) => [...action.divider ? [/* @__PURE__ */ jsx(Divider, {}, `${action.label}-divider`)] : [], /* @__PURE__ */ jsxs(MenuItem, {
961
+ disabled: action.disabled,
962
+ onClick: (event_0) => {
963
+ event_0.stopPropagation();
964
+ action.onClick(cell.row.original);
965
+ setAnchorEl(null);
966
+ },
967
+ children: [action.icon && /* @__PURE__ */ jsx(ListItemIcon, { children: action.icon }), /* @__PURE__ */ jsx(ListItemText, { children: action.label })]
968
+ }, action.label)];
969
+ $[16] = cell;
970
+ $[17] = t10;
971
+ } else t10 = $[17];
972
+ t9 = actions.flatMap(t10);
973
+ $[13] = actions;
974
+ $[14] = cell;
975
+ $[15] = t9;
976
+ } else t9 = $[15];
977
+ let t10;
978
+ if ($[18] !== anchorEl || $[19] !== t7 || $[20] !== t9) {
979
+ t10 = /* @__PURE__ */ jsx(Menu, {
980
+ anchorEl,
981
+ open: t7,
982
+ onClose: t8,
983
+ children: t9
984
+ });
985
+ $[18] = anchorEl;
986
+ $[19] = t7;
987
+ $[20] = t9;
988
+ $[21] = t10;
989
+ } else t10 = $[21];
990
+ let t11;
991
+ if ($[22] !== t10 || $[23] !== t6) {
992
+ t11 = /* @__PURE__ */ jsxs(Fragment$1, { children: [t6, t10] });
993
+ $[22] = t10;
994
+ $[23] = t6;
995
+ $[24] = t11;
996
+ } else t11 = $[24];
997
+ return t11;
998
+ };
999
+ //#endregion
1000
+ //#region src/components/table/cells/features/ExpandCell.tsx
1001
+ const ExpandCell = () => {
1002
+ const $ = c(6);
1003
+ if ($[0] !== "e373a958f2659efd7f8e4c11adbdf6443660367dbb6d665b170d691b9c28fde7") {
1004
+ for (let $i = 0; $i < 6; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
1005
+ $[0] = "e373a958f2659efd7f8e4c11adbdf6443660367dbb6d665b170d691b9c28fde7";
1006
+ }
1007
+ const { row } = useCellContext();
1008
+ let t0;
1009
+ if ($[1] !== row) {
1010
+ t0 = () => {
1011
+ if (!row.getCanExpand()) return null;
1012
+ const expanded = row.getIsExpanded();
1013
+ return /* @__PURE__ */ jsx(IconButton, {
1014
+ size: "small",
1015
+ onClick: (event) => {
1016
+ event.stopPropagation();
1017
+ row.toggleExpanded();
1018
+ },
1019
+ "aria-label": expanded ? "Collapse row" : "Expand row",
1020
+ sx: { ml: row.depth * 2 },
1021
+ children: expanded ? /* @__PURE__ */ jsx(KeyboardArrowDown, { fontSize: "small" }) : /* @__PURE__ */ jsx(KeyboardArrowRight, { fontSize: "small" })
1022
+ });
1023
+ };
1024
+ $[1] = row;
1025
+ $[2] = t0;
1026
+ } else t0 = $[2];
1027
+ let t1;
1028
+ if ($[3] !== row.table.atoms.expanded || $[4] !== t0) {
1029
+ t1 = /* @__PURE__ */ jsx(Subscribe, {
1030
+ source: row.table.atoms.expanded,
1031
+ children: t0
1032
+ });
1033
+ $[3] = row.table.atoms.expanded;
1034
+ $[4] = t0;
1035
+ $[5] = t1;
1036
+ } else t1 = $[5];
1037
+ return t1;
1038
+ };
1039
+ //#endregion
1040
+ //#region src/components/table/cells/features/GroupCell.tsx
1041
+ const GroupCell = () => {
1042
+ const $ = c(17);
1043
+ if ($[0] !== "5e5ed5193c8ad64ae2d82dd097433b77f8ae2ca32d57487fd7564cb6ebc811a4") {
1044
+ for (let $i = 0; $i < 17; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
1045
+ $[0] = "5e5ed5193c8ad64ae2d82dd097433b77f8ae2ca32d57487fd7564cb6ebc811a4";
1046
+ }
1047
+ const cell = useCellContext();
1048
+ const { row } = cell;
1049
+ const t0 = row.depth * 2;
1050
+ let t1;
1051
+ if ($[1] !== t0) {
1052
+ t1 = {
1053
+ ml: t0,
1054
+ alignItems: "center"
1055
+ };
1056
+ $[1] = t0;
1057
+ $[2] = t1;
1058
+ } else t1 = $[2];
1059
+ let t2;
1060
+ if ($[3] !== row) {
1061
+ t2 = () => {
1062
+ const expanded = row.getIsExpanded();
1063
+ return /* @__PURE__ */ jsx(IconButton, {
1064
+ size: "small",
1065
+ onClick: (event) => {
1066
+ event.stopPropagation();
1067
+ row.toggleExpanded();
1068
+ },
1069
+ "aria-label": expanded ? "Collapse group" : "Expand group",
1070
+ children: expanded ? /* @__PURE__ */ jsx(KeyboardArrowDown, { fontSize: "small" }) : /* @__PURE__ */ jsx(KeyboardArrowRight, { fontSize: "small" })
1071
+ });
1072
+ };
1073
+ $[3] = row;
1074
+ $[4] = t2;
1075
+ } else t2 = $[4];
1076
+ let t3;
1077
+ if ($[5] !== row.table.atoms.expanded || $[6] !== t2) {
1078
+ t3 = /* @__PURE__ */ jsx(Subscribe, {
1079
+ source: row.table.atoms.expanded,
1080
+ children: t2
1081
+ });
1082
+ $[5] = row.table.atoms.expanded;
1083
+ $[6] = t2;
1084
+ $[7] = t3;
1085
+ } else t3 = $[7];
1086
+ let t4;
1087
+ if ($[8] !== cell) {
1088
+ t4 = /* @__PURE__ */ jsx(FlexRender, { cell });
1089
+ $[8] = cell;
1090
+ $[9] = t4;
1091
+ } else t4 = $[9];
1092
+ let t5;
1093
+ if ($[10] !== row.subRows.length) {
1094
+ t5 = /* @__PURE__ */ jsxs(Typography, {
1095
+ variant: "caption",
1096
+ color: "text.secondary",
1097
+ children: [
1098
+ "(",
1099
+ row.subRows.length,
1100
+ ")"
1101
+ ]
1102
+ });
1103
+ $[10] = row.subRows.length;
1104
+ $[11] = t5;
1105
+ } else t5 = $[11];
1106
+ let t6;
1107
+ if ($[12] !== t1 || $[13] !== t3 || $[14] !== t4 || $[15] !== t5) {
1108
+ t6 = /* @__PURE__ */ jsxs(Stack, {
1109
+ direction: "row",
1110
+ spacing: .5,
1111
+ sx: t1,
1112
+ children: [
1113
+ t3,
1114
+ t4,
1115
+ t5
1116
+ ]
1117
+ });
1118
+ $[12] = t1;
1119
+ $[13] = t3;
1120
+ $[14] = t4;
1121
+ $[15] = t5;
1122
+ $[16] = t6;
1123
+ } else t6 = $[16];
1124
+ return t6;
1125
+ };
1126
+ //#endregion
1127
+ //#region src/components/table/cells/features/PinRowCell.tsx
1128
+ const PinRowCell = () => {
1129
+ const $ = c(6);
1130
+ if ($[0] !== "7f27a5609f2431f18a788370d3382a09670f5d22d3f0bf3673d963f7c1d96a2d") {
1131
+ for (let $i = 0; $i < 6; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
1132
+ $[0] = "7f27a5609f2431f18a788370d3382a09670f5d22d3f0bf3673d963f7c1d96a2d";
1133
+ }
1134
+ const { row } = useCellContext();
1135
+ let t0;
1136
+ if ($[1] !== row) {
1137
+ t0 = () => {
1138
+ if (!row.getCanPin()) return null;
1139
+ const pinned = row.getIsPinned();
1140
+ return /* @__PURE__ */ jsx(Tooltip, {
1141
+ title: pinned ? "Unpin row" : "Pin row",
1142
+ children: /* @__PURE__ */ jsx(IconButton, {
1143
+ size: "small",
1144
+ color: pinned ? "primary" : "default",
1145
+ onClick: (event) => {
1146
+ event.stopPropagation();
1147
+ row.pin(pinned ? false : "top");
1148
+ },
1149
+ children: /* @__PURE__ */ jsx(PushPin, { fontSize: "small" })
1150
+ })
1151
+ });
1152
+ };
1153
+ $[1] = row;
1154
+ $[2] = t0;
1155
+ } else t0 = $[2];
1156
+ let t1;
1157
+ if ($[3] !== row.table.atoms.rowPinning || $[4] !== t0) {
1158
+ t1 = /* @__PURE__ */ jsx(Subscribe, {
1159
+ source: row.table.atoms.rowPinning,
1160
+ children: t0
1161
+ });
1162
+ $[3] = row.table.atoms.rowPinning;
1163
+ $[4] = t0;
1164
+ $[5] = t1;
1165
+ } else t1 = $[5];
1166
+ return t1;
1167
+ };
1168
+ //#endregion
1169
+ //#region src/components/table/cells/features/SelectCell.tsx
1170
+ const SelectCell = () => {
1171
+ const $ = c(6);
1172
+ if ($[0] !== "63921cbcf7fcb34cd713e4f8ddc73200874bc27abe8c714719a6e3a2f7d9bc3a") {
1173
+ for (let $i = 0; $i < 6; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
1174
+ $[0] = "63921cbcf7fcb34cd713e4f8ddc73200874bc27abe8c714719a6e3a2f7d9bc3a";
1175
+ }
1176
+ const { row } = useCellContext();
1177
+ let t0;
1178
+ if ($[1] !== row) {
1179
+ t0 = () => row.getCanSelect() ? /* @__PURE__ */ jsx(Checkbox, {
1180
+ size: "small",
1181
+ checked: row.getIsSelected(),
1182
+ indeterminate: !row.getIsSelected() && row.getIsSomeSelected(),
1183
+ onChange: row.getToggleSelectedHandler(),
1184
+ onClick: _temp$6,
1185
+ slotProps: { input: { "aria-label": "Select row" } }
1186
+ }) : null;
1187
+ $[1] = row;
1188
+ $[2] = t0;
1189
+ } else t0 = $[2];
1190
+ let t1;
1191
+ if ($[3] !== row.table.atoms.rowSelection || $[4] !== t0) {
1192
+ t1 = /* @__PURE__ */ jsx(Subscribe, {
1193
+ source: row.table.atoms.rowSelection,
1194
+ children: t0
1195
+ });
1196
+ $[3] = row.table.atoms.rowSelection;
1197
+ $[4] = t0;
1198
+ $[5] = t1;
1199
+ } else t1 = $[5];
1200
+ return t1;
1201
+ };
1202
+ function _temp$6(event) {
1203
+ return event.stopPropagation();
1204
+ }
1205
+ //#endregion
1206
+ //#region src/components/table/cells/formatters/BooleanCell.tsx
1207
+ /** Icons are inline-block, so without this they sit on the baseline and read as too high. */
1208
+ const ICON_SX = { verticalAlign: "middle" };
1209
+ const BooleanCell = () => {
1210
+ const $ = c(3);
1211
+ if ($[0] !== "c4041104e91084b687210e0524e009dc1af846acee76bcfc3bf9d28753f13090") {
1212
+ for (let $i = 0; $i < 3; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
1213
+ $[0] = "c4041104e91084b687210e0524e009dc1af846acee76bcfc3bf9d28753f13090";
1214
+ }
1215
+ const cell = useCellContext();
1216
+ let t0;
1217
+ if ($[1] !== cell) {
1218
+ t0 = cell.getValue() ? /* @__PURE__ */ jsx(Check, {
1219
+ fontSize: "small",
1220
+ color: "success",
1221
+ sx: ICON_SX
1222
+ }) : /* @__PURE__ */ jsx(Close, {
1223
+ fontSize: "small",
1224
+ color: "error",
1225
+ sx: ICON_SX
1226
+ });
1227
+ $[1] = cell;
1228
+ $[2] = t0;
1229
+ } else t0 = $[2];
1230
+ return t0;
1231
+ };
1232
+ //#endregion
1233
+ //#region src/components/table/cells/formatters/DateCell.tsx
1234
+ dayjs.extend(localizedFormat);
1235
+ const DateCell = (t0) => {
1236
+ const $ = c(19);
1237
+ if ($[0] !== "21b387c4bddca0bccbe970e472aebb39930745f6d942bddb5392537064b45906") {
1238
+ for (let $i = 0; $i < 19; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
1239
+ $[0] = "21b387c4bddca0bccbe970e472aebb39930745f6d942bddb5392537064b45906";
1240
+ }
1241
+ let props;
1242
+ let t1;
1243
+ if ($[1] !== t0) {
1244
+ ({format: t1, ...props} = t0);
1245
+ $[1] = t0;
1246
+ $[2] = props;
1247
+ $[3] = t1;
1248
+ } else {
1249
+ props = $[2];
1250
+ t1 = $[3];
1251
+ }
1252
+ const format = t1 === void 0 ? "L" : t1;
1253
+ const cell = useCellContext();
1254
+ let T0;
1255
+ let t2;
1256
+ let t3;
1257
+ let t4;
1258
+ let t5;
1259
+ let t6;
1260
+ if ($[4] !== cell || $[5] !== format || $[6] !== props) {
1261
+ t6 = Symbol.for("react.early_return_sentinel");
1262
+ bb0: {
1263
+ const value = cell.getValue();
1264
+ if (!value) {
1265
+ t6 = null;
1266
+ break bb0;
1267
+ }
1268
+ T0 = Typography;
1269
+ t2 = "body2";
1270
+ t3 = true;
1271
+ t4 = props;
1272
+ t5 = dayjs(value).format(format);
1273
+ }
1274
+ $[4] = cell;
1275
+ $[5] = format;
1276
+ $[6] = props;
1277
+ $[7] = T0;
1278
+ $[8] = t2;
1279
+ $[9] = t3;
1280
+ $[10] = t4;
1281
+ $[11] = t5;
1282
+ $[12] = t6;
1283
+ } else {
1284
+ T0 = $[7];
1285
+ t2 = $[8];
1286
+ t3 = $[9];
1287
+ t4 = $[10];
1288
+ t5 = $[11];
1289
+ t6 = $[12];
1290
+ }
1291
+ if (t6 !== Symbol.for("react.early_return_sentinel")) return t6;
1292
+ let t7;
1293
+ if ($[13] !== T0 || $[14] !== t2 || $[15] !== t3 || $[16] !== t4 || $[17] !== t5) {
1294
+ t7 = /* @__PURE__ */ jsx(T0, {
1295
+ variant: t2,
1296
+ noWrap: t3,
1297
+ ...t4,
1298
+ children: t5
1299
+ });
1300
+ $[13] = T0;
1301
+ $[14] = t2;
1302
+ $[15] = t3;
1303
+ $[16] = t4;
1304
+ $[17] = t5;
1305
+ $[18] = t7;
1306
+ } else t7 = $[18];
1307
+ return t7;
1308
+ };
1309
+ //#endregion
1310
+ //#region src/components/table/cells/formatters/DateTimeCell.tsx
1311
+ const DateTimeCell = (t0) => {
1312
+ const $ = c(7);
1313
+ if ($[0] !== "fe9e4fc38583f37e5227c0f76eb86e36fdbf232415dbb06681be0a948a3dc051") {
1314
+ for (let $i = 0; $i < 7; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
1315
+ $[0] = "fe9e4fc38583f37e5227c0f76eb86e36fdbf232415dbb06681be0a948a3dc051";
1316
+ }
1317
+ let props;
1318
+ let t1;
1319
+ if ($[1] !== t0) {
1320
+ ({format: t1, ...props} = t0);
1321
+ $[1] = t0;
1322
+ $[2] = props;
1323
+ $[3] = t1;
1324
+ } else {
1325
+ props = $[2];
1326
+ t1 = $[3];
1327
+ }
1328
+ const format = t1 === void 0 ? "L LT" : t1;
1329
+ let t2;
1330
+ if ($[4] !== format || $[5] !== props) {
1331
+ t2 = /* @__PURE__ */ jsx(DateCell, {
1332
+ format,
1333
+ ...props
1334
+ });
1335
+ $[4] = format;
1336
+ $[5] = props;
1337
+ $[6] = t2;
1338
+ } else t2 = $[6];
1339
+ return t2;
1340
+ };
1341
+ //#endregion
1342
+ //#region src/components/table/cells/formatters/NumberCell.tsx
1343
+ const NumberCell = (t0) => {
1344
+ const $ = c(12);
1345
+ if ($[0] !== "7cf664bb8daeb610d39db08282e13af06d501456129b3096149df17a8de8bf43") {
1346
+ for (let $i = 0; $i < 12; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
1347
+ $[0] = "7cf664bb8daeb610d39db08282e13af06d501456129b3096149df17a8de8bf43";
1348
+ }
1349
+ let options;
1350
+ let props;
1351
+ let sx;
1352
+ if ($[1] !== t0) {
1353
+ ({options, sx, ...props} = t0);
1354
+ $[1] = t0;
1355
+ $[2] = options;
1356
+ $[3] = props;
1357
+ $[4] = sx;
1358
+ } else {
1359
+ options = $[2];
1360
+ props = $[3];
1361
+ sx = $[4];
1362
+ }
1363
+ const cell = useCellContext();
1364
+ let t1;
1365
+ if ($[5] !== cell || $[6] !== options || $[7] !== props || $[8] !== sx) {
1366
+ const value = cell.getValue();
1367
+ let t2;
1368
+ if ($[10] !== sx) {
1369
+ t2 = {
1370
+ fontVariantNumeric: "tabular-nums",
1371
+ ...sx
1372
+ };
1373
+ $[10] = sx;
1374
+ $[11] = t2;
1375
+ } else t2 = $[11];
1376
+ t1 = /* @__PURE__ */ jsx(Typography, {
1377
+ variant: "body2",
1378
+ noWrap: true,
1379
+ sx: t2,
1380
+ ...props,
1381
+ children: typeof value === "number" && value.toLocaleString(void 0, options)
1382
+ });
1383
+ $[5] = cell;
1384
+ $[6] = options;
1385
+ $[7] = props;
1386
+ $[8] = sx;
1387
+ $[9] = t1;
1388
+ } else t1 = $[9];
1389
+ return t1;
1390
+ };
1391
+ //#endregion
1392
+ //#region src/components/table/cells/formatters/ValueCell.tsx
1393
+ const ValueCell = (props) => {
1394
+ const $ = c(6);
1395
+ if ($[0] !== "0ab00a06181368c5fd56e221c1dd8e5c7a77c9128bcfd533b69fc70bfb59896f") {
1396
+ for (let $i = 0; $i < 6; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
1397
+ $[0] = "0ab00a06181368c5fd56e221c1dd8e5c7a77c9128bcfd533b69fc70bfb59896f";
1398
+ }
1399
+ const cell = useCellContext();
1400
+ let t0;
1401
+ if ($[1] !== cell) {
1402
+ t0 = cell.renderValue();
1403
+ $[1] = cell;
1404
+ $[2] = t0;
1405
+ } else t0 = $[2];
1406
+ const value = t0;
1407
+ let t1;
1408
+ if ($[3] !== props || $[4] !== value) {
1409
+ t1 = /* @__PURE__ */ jsx(Typography, {
1410
+ variant: "body2",
1411
+ noWrap: true,
1412
+ ...props,
1413
+ children: value
1414
+ });
1415
+ $[3] = props;
1416
+ $[4] = value;
1417
+ $[5] = t1;
1418
+ } else t1 = $[5];
1419
+ return t1;
1420
+ };
1421
+ //#endregion
1422
+ //#region src/components/table/filterFns.ts
1423
+ const apply = (fn, row, columnId, value) => fn(row, columnId, fn.resolveFilterValue?.(value) ?? value);
1424
+ const ignoreDiacritics = (fn) => constructFilterFn({
1425
+ ...fn,
1426
+ resolveFilterValue: foldForSearch,
1427
+ resolveDataValue: foldForSearch
1428
+ });
1429
+ const includesString = ignoreDiacritics(filterFn_includesString);
1430
+ const equalsString = ignoreDiacritics(filterFn_equalsString);
1431
+ const startsWith = ignoreDiacritics(filterFn_startsWith);
1432
+ const endsWith = ignoreDiacritics(filterFn_endsWith);
1433
+ const isFilterActive = (filter) => filter.operator === "isEmpty" || filter.operator === "isNotEmpty" || !isBlank(filter.value);
1434
+ const isBlank = (value) => value === void 0 || value === null || value === "" || Array.isArray(value) && (!value.length || value.every(isBlank));
1435
+ const toTime = (value) => {
1436
+ if (value instanceof Date) return Number.isNaN(value.getTime()) ? null : value.getTime();
1437
+ if (typeof value === "string" || typeof value === "number") {
1438
+ const time = new Date(value).getTime();
1439
+ return Number.isNaN(time) ? null : time;
1440
+ }
1441
+ return null;
1442
+ };
1443
+ const toDay = (time) => new Date(time).setHours(0, 0, 0, 0);
1444
+ const compareDates = (row, columnId, value, operator) => {
1445
+ const rowTime = toTime(row.getValue(columnId));
1446
+ const filterTime = toTime(value);
1447
+ if (rowTime === null || filterTime === null) return void 0;
1448
+ switch (operator) {
1449
+ case "equals": return toDay(rowTime) === toDay(filterTime);
1450
+ case "greaterThan": return rowTime > filterTime;
1451
+ case "greaterThanOrEqualTo": return rowTime >= filterTime;
1452
+ case "lessThan": return rowTime < filterTime;
1453
+ case "lessThanOrEqualTo": return rowTime <= filterTime;
1454
+ default: return;
1455
+ }
1456
+ };
1457
+ const daysFromToday = (row, columnId) => {
1458
+ const rowTime = toTime(row.getValue(columnId));
1459
+ if (rowTime === null) return null;
1460
+ return Math.floor((toDay(rowTime) - toDay(Date.now())) / 864e5);
1461
+ };
1462
+ const isRelativeToToday = (row, columnId, value) => {
1463
+ const diff = daysFromToday(row, columnId);
1464
+ if (diff === null) return false;
1465
+ if (Array.isArray(value)) {
1466
+ const [min, max] = value.map(Number);
1467
+ return (Number.isNaN(min) || diff >= min) && (Number.isNaN(max) || diff <= max);
1468
+ }
1469
+ const days = Number(value);
1470
+ return !Number.isNaN(days) && diff === days;
1471
+ };
1472
+ const equals = (row, columnId, value, variant) => {
1473
+ if (Array.isArray(value)) return apply(filterFn_arrHas, row, columnId, value);
1474
+ if (variant === "date") return compareDates(row, columnId, value, "equals") ?? false;
1475
+ return apply(filterFn_equals, row, columnId, value);
1476
+ };
1477
+ const test = (row, columnId, operator, value, variant) => {
1478
+ switch (operator) {
1479
+ case "includesString": return apply(includesString, row, columnId, value);
1480
+ case "notIncludesString": return !apply(includesString, row, columnId, value);
1481
+ case "equalsString": return apply(equalsString, row, columnId, value);
1482
+ case "notEqualsString": return !apply(equalsString, row, columnId, value);
1483
+ case "startsWith": return apply(startsWith, row, columnId, value);
1484
+ case "endsWith": return apply(endsWith, row, columnId, value);
1485
+ case "isEmpty": return filterFn_empty(row, columnId, true);
1486
+ case "isNotEmpty": return filterFn_notEmpty(row, columnId, true);
1487
+ case "equals": return equals(row, columnId, value, variant);
1488
+ case "notEquals": return !equals(row, columnId, value, variant);
1489
+ case "greaterThan":
1490
+ case "greaterThanOrEqualTo":
1491
+ case "lessThan":
1492
+ case "lessThanOrEqualTo": {
1493
+ if (variant === "date") return compareDates(row, columnId, value, operator) ?? false;
1494
+ const fn = {
1495
+ greaterThan: filterFn_greaterThan,
1496
+ greaterThanOrEqualTo: filterFn_greaterThanOrEqualTo,
1497
+ lessThan: filterFn_lessThan,
1498
+ lessThanOrEqualTo: filterFn_lessThanOrEqualTo
1499
+ }[operator];
1500
+ return apply(fn, row, columnId, value);
1501
+ }
1502
+ case "inRange": return apply(variant === "date" ? filterFn_inDateRange : filterFn_inNumberRange, row, columnId, Array.isArray(value) ? value : [value, value]);
1503
+ case "isRelativeToToday": return isRelativeToToday(row, columnId, value);
1504
+ }
1505
+ };
1506
+ const dynamicFilterFn = (row, columnId) => {
1507
+ const filters = row.table.store.state.columnFilters.filter((filter) => filter.id === columnId);
1508
+ if (!filters.length) return true;
1509
+ const variant = (row.table.getColumn(columnId)?.columnDef.meta)?.variant ?? "text";
1510
+ const results = filters.filter(isFilterActive).map((filter) => test(row, columnId, filter.operator ?? "includesString", filter.value, variant));
1511
+ if (!results.length) return true;
1512
+ return (filters[0].joinOperator ?? "and") === "and" ? results.every(Boolean) : results.some(Boolean);
1513
+ };
1514
+ dynamicFilterFn.autoRemove = () => false;
1515
+ const globalFilterFn = includesString;
1516
+ const TEXT_OPERATORS = [
1517
+ "includesString",
1518
+ "notIncludesString",
1519
+ "startsWith",
1520
+ "endsWith",
1521
+ "equalsString",
1522
+ "notEqualsString",
1523
+ "isEmpty",
1524
+ "isNotEmpty"
1525
+ ];
1526
+ const NUMBER_OPERATORS = [
1527
+ "equals",
1528
+ "notEquals",
1529
+ "lessThan",
1530
+ "lessThanOrEqualTo",
1531
+ "greaterThan",
1532
+ "greaterThanOrEqualTo",
1533
+ "inRange"
1534
+ ];
1535
+ const DATE_OPERATORS = [
1536
+ "equals",
1537
+ "notEquals",
1538
+ "lessThan",
1539
+ "lessThanOrEqualTo",
1540
+ "greaterThan",
1541
+ "greaterThanOrEqualTo",
1542
+ "inRange",
1543
+ "isRelativeToToday",
1544
+ "isEmpty",
1545
+ "isNotEmpty"
1546
+ ];
1547
+ const CHOICE_OPERATORS = [
1548
+ "equals",
1549
+ "notEquals",
1550
+ "isEmpty",
1551
+ "isNotEmpty"
1552
+ ];
1553
+ const getFilterOperators = (variant) => {
1554
+ switch (variant) {
1555
+ case "number": return NUMBER_OPERATORS;
1556
+ case "date": return DATE_OPERATORS;
1557
+ case "boolean":
1558
+ case "select":
1559
+ case "multi-select": return CHOICE_OPERATORS;
1560
+ default: return TEXT_OPERATORS;
1561
+ }
1562
+ };
1563
+ //#endregion
1564
+ //#region src/components/table/headers/AggregationFooter.tsx
1565
+ const AggregationFooter = (t0) => {
1566
+ const $ = c(8);
1567
+ if ($[0] !== "2b3427c1cdd7a1c3368f3344dda08d0113fd71842b5d048d5aefe63b4f576caa") {
1568
+ for (let $i = 0; $i < 8; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
1569
+ $[0] = "2b3427c1cdd7a1c3368f3344dda08d0113fd71842b5d048d5aefe63b4f576caa";
1570
+ }
1571
+ const { prefix: t1, options } = t0;
1572
+ const prefix = t1 === void 0 ? "" : t1;
1573
+ const { column } = useHeaderContext();
1574
+ let t2;
1575
+ if ($[1] !== column || $[2] !== options || $[3] !== prefix) {
1576
+ t2 = () => {
1577
+ const value = formatValue(column.getAggregationValue({ rows: column.table.getFilteredRowModel().rows }));
1578
+ if (!value) return null;
1579
+ const numeric = Number(value);
1580
+ return /* @__PURE__ */ jsxs(Typography, {
1581
+ variant: "body2",
1582
+ noWrap: true,
1583
+ sx: { fontWeight: 700 },
1584
+ children: [prefix, Number.isFinite(numeric) ? numeric.toLocaleString(void 0, options) : value]
1585
+ });
1586
+ };
1587
+ $[1] = column;
1588
+ $[2] = options;
1589
+ $[3] = prefix;
1590
+ $[4] = t2;
1591
+ } else t2 = $[4];
1592
+ let t3;
1593
+ if ($[5] !== column.table.atoms.columnFilters || $[6] !== t2) {
1594
+ t3 = /* @__PURE__ */ jsx(Subscribe, {
1595
+ source: column.table.atoms.columnFilters,
1596
+ children: t2
1597
+ });
1598
+ $[5] = column.table.atoms.columnFilters;
1599
+ $[6] = t2;
1600
+ $[7] = t3;
1601
+ } else t3 = $[7];
1602
+ return t3;
1603
+ };
1604
+ //#endregion
1605
+ //#region src/components/table/headers/ExpandAllCell.tsx
1606
+ const ExpandAllCell = () => {
1607
+ const $ = c(6);
1608
+ if ($[0] !== "851f8a7aeadefee23d0b10559fef0b77d249b3af774b5b47e7baf05db417b810") {
1609
+ for (let $i = 0; $i < 6; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
1610
+ $[0] = "851f8a7aeadefee23d0b10559fef0b77d249b3af774b5b47e7baf05db417b810";
1611
+ }
1612
+ const table = useHeaderContext().table;
1613
+ let t0;
1614
+ if ($[1] !== table) {
1615
+ t0 = () => {
1616
+ if (!table.getCanSomeRowsExpand()) return null;
1617
+ return /* @__PURE__ */ jsx(IconButton, {
1618
+ size: "small",
1619
+ onClick: table.getToggleAllRowsExpandedHandler(),
1620
+ "aria-label": "Toggle all rows",
1621
+ children: /* @__PURE__ */ jsx(ArrowDownward, {
1622
+ fontSize: "small",
1623
+ sx: {
1624
+ transition: "transform 150ms",
1625
+ transform: table.getIsAllRowsExpanded() ? "rotate(0deg)" : "rotate(-90deg)"
1626
+ }
1627
+ })
1628
+ });
1629
+ };
1630
+ $[1] = table;
1631
+ $[2] = t0;
1632
+ } else t0 = $[2];
1633
+ let t1;
1634
+ if ($[3] !== t0 || $[4] !== table.atoms.expanded) {
1635
+ t1 = /* @__PURE__ */ jsx(Subscribe, {
1636
+ source: table.atoms.expanded,
1637
+ children: t0
1638
+ });
1639
+ $[3] = t0;
1640
+ $[4] = table.atoms.expanded;
1641
+ $[5] = t1;
1642
+ } else t1 = $[5];
1643
+ return t1;
1644
+ };
1645
+ //#endregion
1646
+ //#region src/components/table/headers/HeaderMenu.tsx
1647
+ const HeaderMenu = () => {
1648
+ const $ = c(10);
1649
+ if ($[0] !== "ecfcf0f9fe23e5b130d059c75e052010db8c0f428bc5ec35c88d8a9df9828811") {
1650
+ for (let $i = 0; $i < 10; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
1651
+ $[0] = "ecfcf0f9fe23e5b130d059c75e052010db8c0f428bc5ec35c88d8a9df9828811";
1652
+ }
1653
+ const header = useHeaderContext();
1654
+ const { t } = useTranslation$1();
1655
+ const [anchorEl, setAnchorEl] = useState(null);
1656
+ const { column } = header;
1657
+ let t0;
1658
+ if ($[1] === Symbol.for("react.memo_cache_sentinel")) {
1659
+ t0 = () => setAnchorEl(null);
1660
+ $[1] = t0;
1661
+ } else t0 = $[1];
1662
+ const close = t0;
1663
+ let t1;
1664
+ if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
1665
+ t1 = (action) => () => {
1666
+ action();
1667
+ close();
1668
+ };
1669
+ $[2] = t1;
1670
+ } else t1 = $[2];
1671
+ const run = t1;
1672
+ if (!hasColumnLabel(column)) return null;
1673
+ let t2;
1674
+ if ($[3] !== anchorEl || $[4] !== column || $[5] !== t) {
1675
+ t2 = () => {
1676
+ const canSort = column.getCanSort();
1677
+ const canPin = column.getCanPin();
1678
+ const canGroup = column.getCanGroup();
1679
+ const canHide = column.getCanHide();
1680
+ if (!canSort && !canPin && !canGroup && !canHide) return null;
1681
+ const sorted = column.getIsSorted();
1682
+ const pinned = column.getIsPinned();
1683
+ const grouped = column.getIsGrouped();
1684
+ const index = column.getIndex();
1685
+ const leafCount = column.table.getVisibleLeafColumns().length;
1686
+ return /* @__PURE__ */ jsxs(Box, {
1687
+ sx: {
1688
+ display: "flex",
1689
+ flexShrink: 0,
1690
+ mr: "-5px",
1691
+ overflow: "hidden",
1692
+ width: anchorEl ? "auto" : 0,
1693
+ ".MuiTableCell-root:hover &": { width: "auto" },
1694
+ "&:focus-within": { width: "auto" },
1695
+ "@media (hover: none)": { width: "auto" }
1696
+ },
1697
+ children: [/* @__PURE__ */ jsx(IconButton, {
1698
+ size: "small",
1699
+ onClick: (event) => setAnchorEl(event.currentTarget),
1700
+ "aria-label": t("Layout.Table.ColumnMenu"),
1701
+ children: /* @__PURE__ */ jsx(MoreVert, { fontSize: "small" })
1702
+ }), /* @__PURE__ */ jsxs(Menu, {
1703
+ anchorEl,
1704
+ open: !!anchorEl,
1705
+ onClose: close,
1706
+ children: [
1707
+ canSort && sorted !== "asc" && /* @__PURE__ */ jsxs(MenuItem, {
1708
+ onClick: run(() => column.toggleSorting(false, true)),
1709
+ children: [/* @__PURE__ */ jsx(ListItemIcon, { children: /* @__PURE__ */ jsx(ArrowUpward, { fontSize: "small" }) }), /* @__PURE__ */ jsx(ListItemText, { children: t("Layout.Table.SortAscending") })]
1710
+ }),
1711
+ canSort && sorted !== "desc" && /* @__PURE__ */ jsxs(MenuItem, {
1712
+ onClick: run(() => column.toggleSorting(true, true)),
1713
+ children: [/* @__PURE__ */ jsx(ListItemIcon, { children: /* @__PURE__ */ jsx(ArrowDownward, { fontSize: "small" }) }), /* @__PURE__ */ jsx(ListItemText, { children: t("Layout.Table.SortDescending") })]
1714
+ }),
1715
+ canSort && sorted !== false && /* @__PURE__ */ jsxs(MenuItem, {
1716
+ onClick: run(() => column.clearSorting()),
1717
+ children: [/* @__PURE__ */ jsx(ListItemIcon, { children: /* @__PURE__ */ jsx(Clear, { fontSize: "small" }) }), /* @__PURE__ */ jsx(ListItemText, { children: t("Layout.Table.ClearSort") })]
1718
+ }),
1719
+ canPin && /* @__PURE__ */ jsx(Divider, {}),
1720
+ canPin && ["start", "end"].map((position) => /* @__PURE__ */ jsxs(MenuItem, {
1721
+ selected: pinned === position,
1722
+ onClick: run(() => column.pin(pinned === position ? false : position)),
1723
+ children: [/* @__PURE__ */ jsx(ListItemIcon, { children: /* @__PURE__ */ jsx(PushPin, { fontSize: "small" }) }), /* @__PURE__ */ jsx(ListItemText, { children: pinned === position ? t("Layout.Table.Unpin") : position === "start" ? t("Layout.Table.PinStart") : t("Layout.Table.PinEnd") })]
1724
+ }, position)),
1725
+ /* @__PURE__ */ jsx(Divider, {}),
1726
+ /* @__PURE__ */ jsxs(MenuItem, {
1727
+ disabled: index <= 0,
1728
+ onClick: run(() => moveColumn(column, -1)),
1729
+ children: [/* @__PURE__ */ jsx(ListItemIcon, { children: /* @__PURE__ */ jsx(ArrowBack, { fontSize: "small" }) }), /* @__PURE__ */ jsx(ListItemText, { children: t("Layout.Table.MoveLeft") })]
1730
+ }),
1731
+ /* @__PURE__ */ jsxs(MenuItem, {
1732
+ disabled: index >= leafCount - 1,
1733
+ onClick: run(() => moveColumn(column, 1)),
1734
+ children: [/* @__PURE__ */ jsx(ListItemIcon, { children: /* @__PURE__ */ jsx(ArrowForward, { fontSize: "small" }) }), /* @__PURE__ */ jsx(ListItemText, { children: t("Layout.Table.MoveRight") })]
1735
+ }),
1736
+ canGroup && /* @__PURE__ */ jsx(Divider, {}),
1737
+ canGroup && /* @__PURE__ */ jsxs(MenuItem, {
1738
+ onClick: run(() => column.toggleGrouping()),
1739
+ children: [/* @__PURE__ */ jsx(ListItemIcon, { children: /* @__PURE__ */ jsx(Workspaces, { fontSize: "small" }) }), /* @__PURE__ */ jsx(ListItemText, { children: grouped ? t("Layout.Table.Ungroup") : t("Layout.Table.GroupBy") })]
1740
+ }),
1741
+ canHide && /* @__PURE__ */ jsx(Divider, {}),
1742
+ canHide && /* @__PURE__ */ jsxs(MenuItem, {
1743
+ onClick: run(() => column.toggleVisibility(false)),
1744
+ children: [/* @__PURE__ */ jsx(ListItemIcon, { children: /* @__PURE__ */ jsx(VisibilityOff, { fontSize: "small" }) }), /* @__PURE__ */ jsx(ListItemText, { children: t("Layout.Table.HideColumn") })]
1745
+ })
1746
+ ]
1747
+ })]
1748
+ });
1749
+ };
1750
+ $[3] = anchorEl;
1751
+ $[4] = column;
1752
+ $[5] = t;
1753
+ $[6] = t2;
1754
+ } else t2 = $[6];
1755
+ let t3;
1756
+ if ($[7] !== column.table.store || $[8] !== t2) {
1757
+ t3 = /* @__PURE__ */ jsx(Subscribe, {
1758
+ source: column.table.store,
1759
+ selector: _temp$5,
1760
+ children: t2
1761
+ });
1762
+ $[7] = column.table.store;
1763
+ $[8] = t2;
1764
+ $[9] = t3;
1765
+ } else t3 = $[9];
1766
+ return t3;
1767
+ };
1768
+ function _temp$5(state) {
1769
+ return state;
1770
+ }
1771
+ //#endregion
1772
+ //#region src/components/table/headers/HeaderResizeHandle.tsx
1773
+ const BAR_HEIGHT = 24;
1774
+ const TARGET_SIZE = 10;
1775
+ const bar = (accent) => ({
1776
+ content: "\"\"",
1777
+ position: "absolute",
1778
+ insetInlineEnd: 0,
1779
+ top: `calc(50% - ${BAR_HEIGHT / 2}px)`,
1780
+ width: accent ? "3px" : "1px",
1781
+ height: BAR_HEIGHT,
1782
+ borderRadius: accent ? "1.5px" : "0.5px",
1783
+ bgcolor: accent ? "primary.dark" : "divider",
1784
+ transition: (theme) => theme.transitions.create(["width", "background-color"])
1785
+ });
1786
+ const base = {
1787
+ position: "absolute",
1788
+ insetBlock: 0,
1789
+ insetInlineEnd: 0,
1790
+ width: TARGET_SIZE
1791
+ };
1792
+ const HeaderResizeHandle = () => {
1793
+ const $ = c(10);
1794
+ if ($[0] !== "e1cc0c056dc5cc9102191f0d1628d7994976d6fec3257d6bc6da3e49d48245f1") {
1795
+ for (let $i = 0; $i < 10; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
1796
+ $[0] = "e1cc0c056dc5cc9102191f0d1628d7994976d6fec3257d6bc6da3e49d48245f1";
1797
+ }
1798
+ const header = useHeaderContext();
1799
+ const { column } = header;
1800
+ if (!column.getCanResize()) {
1801
+ let t0;
1802
+ if ($[1] === Symbol.for("react.memo_cache_sentinel")) {
1803
+ t0 = /* @__PURE__ */ jsx(Box, { sx: {
1804
+ ...base,
1805
+ "&::after": bar(false)
1806
+ } });
1807
+ $[1] = t0;
1808
+ } else t0 = $[1];
1809
+ return t0;
1810
+ }
1811
+ let t0;
1812
+ if ($[2] !== header) {
1813
+ t0 = header.getResizeHandler();
1814
+ $[2] = header;
1815
+ $[3] = t0;
1816
+ } else t0 = $[3];
1817
+ const handler = t0;
1818
+ let t1;
1819
+ if ($[4] !== column || $[5] !== handler) {
1820
+ t1 = () => /* @__PURE__ */ jsx(Box, {
1821
+ role: "separator",
1822
+ "aria-orientation": "vertical",
1823
+ onMouseDown: handler,
1824
+ onTouchStart: handler,
1825
+ onDoubleClick: () => column.resetSize(),
1826
+ onClick: _temp$4,
1827
+ sx: {
1828
+ ...base,
1829
+ cursor: "col-resize",
1830
+ touchAction: "none",
1831
+ userSelect: "none",
1832
+ "&::after": bar(column.getIsResizing()),
1833
+ "&:hover::after": bar(true)
1834
+ }
1835
+ });
1836
+ $[4] = column;
1837
+ $[5] = handler;
1838
+ $[6] = t1;
1839
+ } else t1 = $[6];
1840
+ let t2;
1841
+ if ($[7] !== column.table.atoms.columnResizing || $[8] !== t1) {
1842
+ t2 = /* @__PURE__ */ jsx(Subscribe, {
1843
+ source: column.table.atoms.columnResizing,
1844
+ children: t1
1845
+ });
1846
+ $[7] = column.table.atoms.columnResizing;
1847
+ $[8] = t1;
1848
+ $[9] = t2;
1849
+ } else t2 = $[9];
1850
+ return t2;
1851
+ };
1852
+ function _temp$4(event) {
1853
+ return event.stopPropagation();
1854
+ }
1855
+ //#endregion
1856
+ //#region src/components/table/headers/HeaderSortLabel.tsx
1857
+ const HeaderSortLabel = (t0) => {
1858
+ const $ = c(7);
1859
+ if ($[0] !== "3963eb1f093b2c0b3513d5574e478a830b2db6eeb5db09ed16762691d354080a") {
1860
+ for (let $i = 0; $i < 7; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
1861
+ $[0] = "3963eb1f093b2c0b3513d5574e478a830b2db6eeb5db09ed16762691d354080a";
1862
+ }
1863
+ const { children } = t0;
1864
+ const { column } = useHeaderContext();
1865
+ if (!column.getCanSort()) return children;
1866
+ let t1;
1867
+ if ($[1] !== children || $[2] !== column) {
1868
+ t1 = (sorting) => {
1869
+ const direction = column.getIsSorted();
1870
+ const sortIndex = sorting.length > 1 ? column.getSortIndex() : -1;
1871
+ return /* @__PURE__ */ jsxs(TableSortLabel, {
1872
+ active: direction !== false,
1873
+ direction: direction === false ? "asc" : direction,
1874
+ onClick: column.getToggleSortingHandler(),
1875
+ children: [children, sortIndex > -1 && /* @__PURE__ */ jsx(Box, {
1876
+ component: "span",
1877
+ sx: {
1878
+ ml: .5,
1879
+ fontSize: 11,
1880
+ opacity: .7
1881
+ },
1882
+ children: sortIndex + 1
1883
+ })]
1884
+ });
1885
+ };
1886
+ $[1] = children;
1887
+ $[2] = column;
1888
+ $[3] = t1;
1889
+ } else t1 = $[3];
1890
+ let t2;
1891
+ if ($[4] !== column.table.atoms.sorting || $[5] !== t1) {
1892
+ t2 = /* @__PURE__ */ jsx(Subscribe, {
1893
+ source: column.table.atoms.sorting,
1894
+ children: t1
1895
+ });
1896
+ $[4] = column.table.atoms.sorting;
1897
+ $[5] = t1;
1898
+ $[6] = t2;
1899
+ } else t2 = $[6];
1900
+ return t2;
1901
+ };
1902
+ //#endregion
1903
+ //#region src/components/table/headers/SelectAllCell.tsx
1904
+ const SelectAllCell = (t0) => {
1905
+ const $ = c(7);
1906
+ if ($[0] !== "33588c3e9cbdc713efa770a1c85d8af909b2a6100693622a56aa84ee845a7d85") {
1907
+ for (let $i = 0; $i < 7; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
1908
+ $[0] = "33588c3e9cbdc713efa770a1c85d8af909b2a6100693622a56aa84ee845a7d85";
1909
+ }
1910
+ const { scope: t1 } = t0;
1911
+ const scope = t1 === void 0 ? "page" : t1;
1912
+ const table = useHeaderContext().table;
1913
+ let t2;
1914
+ if ($[1] !== scope || $[2] !== table) {
1915
+ t2 = () => {
1916
+ const checked = scope === "page" ? table.getIsAllPageRowsSelected() : table.getIsAllRowsSelected();
1917
+ const indeterminate = scope === "page" ? table.getIsSomePageRowsSelected() : table.getIsSomeRowsSelected();
1918
+ return /* @__PURE__ */ jsx(Checkbox, {
1919
+ size: "small",
1920
+ checked,
1921
+ indeterminate: !checked && indeterminate,
1922
+ onChange: scope === "page" ? table.getToggleAllPageRowsSelectedHandler() : table.getToggleAllRowsSelectedHandler(),
1923
+ slotProps: { input: { "aria-label": "Select all rows" } }
1924
+ });
1925
+ };
1926
+ $[1] = scope;
1927
+ $[2] = table;
1928
+ $[3] = t2;
1929
+ } else t2 = $[3];
1930
+ let t3;
1931
+ if ($[4] !== t2 || $[5] !== table.atoms.rowSelection) {
1932
+ t3 = /* @__PURE__ */ jsx(Subscribe, {
1933
+ source: table.atoms.rowSelection,
1934
+ children: t2
1935
+ });
1936
+ $[4] = t2;
1937
+ $[5] = table.atoms.rowSelection;
1938
+ $[6] = t3;
1939
+ } else t3 = $[6];
1940
+ return t3;
1941
+ };
1942
+ //#endregion
1943
+ //#region src/components/table/table/ColumnsPanel.tsx
1944
+ const ColumnsPanel = () => {
1945
+ const $ = c(29);
1946
+ if ($[0] !== "6e9b775bc940f7c6695c6f73b0a2c1b2006d3ddafbf891fff9340e618b93e44d") {
1947
+ for (let $i = 0; $i < 29; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
1948
+ $[0] = "6e9b775bc940f7c6695c6f73b0a2c1b2006d3ddafbf891fff9340e618b93e44d";
1949
+ }
1950
+ const table = useTableContext();
1951
+ const { t } = useTranslation$1();
1952
+ const [anchorEl, setAnchorEl] = useState(null);
1953
+ const buttonRef = useRef(null);
1954
+ let t0;
1955
+ if ($[1] !== table) {
1956
+ t0 = table.getAllLeafColumns().filter(_temp$3);
1957
+ $[1] = table;
1958
+ $[2] = t0;
1959
+ } else t0 = $[2];
1960
+ const columns = t0;
1961
+ let t1;
1962
+ if ($[3] === Symbol.for("react.memo_cache_sentinel")) {
1963
+ t1 = () => setAnchorEl((current) => current ? null : buttonRef.current);
1964
+ $[3] = t1;
1965
+ } else t1 = $[3];
1966
+ const t2 = columns.length > 0;
1967
+ let t3;
1968
+ if ($[4] !== t2) {
1969
+ t3 = { enabled: t2 };
1970
+ $[4] = t2;
1971
+ $[5] = t3;
1972
+ } else t3 = $[5];
1973
+ useHotkey("Alt+C", t1, t3);
1974
+ if (!columns.length) return null;
1975
+ let t4;
1976
+ if ($[6] !== t) {
1977
+ t4 = shortcutLabel(t("Layout.Table.Columns"), "Alt+C");
1978
+ $[6] = t;
1979
+ $[7] = t4;
1980
+ } else t4 = $[7];
1981
+ let t5;
1982
+ if ($[8] === Symbol.for("react.memo_cache_sentinel")) {
1983
+ t5 = /* @__PURE__ */ jsx(IconButton, {
1984
+ ref: buttonRef,
1985
+ size: "small",
1986
+ onClick: (event) => setAnchorEl(event.currentTarget),
1987
+ children: /* @__PURE__ */ jsx(ViewColumn, { fontSize: "small" })
1988
+ });
1989
+ $[8] = t5;
1990
+ } else t5 = $[8];
1991
+ let t6;
1992
+ if ($[9] !== t4) {
1993
+ t6 = /* @__PURE__ */ jsx(Tooltip, {
1994
+ title: t4,
1995
+ children: t5
1996
+ });
1997
+ $[9] = t4;
1998
+ $[10] = t6;
1999
+ } else t6 = $[10];
2000
+ const t7 = !!anchorEl;
2001
+ let t10;
2002
+ let t11;
2003
+ let t8;
2004
+ let t9;
2005
+ if ($[11] === Symbol.for("react.memo_cache_sentinel")) {
2006
+ t8 = () => setAnchorEl(null);
2007
+ t9 = {
2008
+ vertical: "bottom",
2009
+ horizontal: "right"
2010
+ };
2011
+ t10 = {
2012
+ vertical: "top",
2013
+ horizontal: "right"
2014
+ };
2015
+ t11 = { paper: { sx: { maxWidth: "calc(100vw - 16px)" } } };
2016
+ $[11] = t10;
2017
+ $[12] = t11;
2018
+ $[13] = t8;
2019
+ $[14] = t9;
2020
+ } else {
2021
+ t10 = $[11];
2022
+ t11 = $[12];
2023
+ t8 = $[13];
2024
+ t9 = $[14];
2025
+ }
2026
+ let t12;
2027
+ if ($[15] !== columns || $[16] !== t || $[17] !== table) {
2028
+ t12 = () => /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(Box, {
2029
+ sx: {
2030
+ display: "flex",
2031
+ flexDirection: "column",
2032
+ px: 1.5,
2033
+ py: 1,
2034
+ maxHeight: 300,
2035
+ minWidth: 240,
2036
+ overflow: "auto"
2037
+ },
2038
+ children: columns.map(_temp2$1)
2039
+ }), /* @__PURE__ */ jsx(Box, {
2040
+ sx: {
2041
+ display: "flex",
2042
+ alignItems: "center",
2043
+ p: 1.5,
2044
+ borderTop: 1,
2045
+ borderColor: "divider"
2046
+ },
2047
+ children: /* @__PURE__ */ jsx(FormControlLabel, {
2048
+ label: t("Layout.Table.ShowHideAll"),
2049
+ slotProps: { typography: {
2050
+ variant: "body2",
2051
+ noWrap: true
2052
+ } },
2053
+ control: /* @__PURE__ */ jsx(Checkbox, {
2054
+ size: "small",
2055
+ checked: table.getIsAllColumnsVisible(),
2056
+ indeterminate: table.getIsSomeColumnsVisible() && !table.getIsAllColumnsVisible(),
2057
+ onChange: table.getToggleAllColumnsVisibilityHandler()
2058
+ })
2059
+ })
2060
+ })] });
2061
+ $[15] = columns;
2062
+ $[16] = t;
2063
+ $[17] = table;
2064
+ $[18] = t12;
2065
+ } else t12 = $[18];
2066
+ let t13;
2067
+ if ($[19] !== t12 || $[20] !== table.atoms.columnVisibility) {
2068
+ t13 = /* @__PURE__ */ jsx(Subscribe, {
2069
+ source: table.atoms.columnVisibility,
2070
+ children: t12
2071
+ });
2072
+ $[19] = t12;
2073
+ $[20] = table.atoms.columnVisibility;
2074
+ $[21] = t13;
2075
+ } else t13 = $[21];
2076
+ let t14;
2077
+ if ($[22] !== anchorEl || $[23] !== t13 || $[24] !== t7) {
2078
+ t14 = /* @__PURE__ */ jsx(Popover, {
2079
+ anchorEl,
2080
+ open: t7,
2081
+ onClose: t8,
2082
+ anchorOrigin: t9,
2083
+ transformOrigin: t10,
2084
+ slotProps: t11,
2085
+ children: t13
2086
+ });
2087
+ $[22] = anchorEl;
2088
+ $[23] = t13;
2089
+ $[24] = t7;
2090
+ $[25] = t14;
2091
+ } else t14 = $[25];
2092
+ let t15;
2093
+ if ($[26] !== t14 || $[27] !== t6) {
2094
+ t15 = /* @__PURE__ */ jsxs(Fragment$1, { children: [t6, t14] });
2095
+ $[26] = t14;
2096
+ $[27] = t6;
2097
+ $[28] = t15;
2098
+ } else t15 = $[28];
2099
+ return t15;
2100
+ };
2101
+ function _temp$3(column) {
2102
+ return hasColumnLabel(column) && column.getCanHide();
2103
+ }
2104
+ function _temp2$1(column_0) {
2105
+ return /* @__PURE__ */ jsx(FormControlLabel, {
2106
+ label: columnLabel(column_0),
2107
+ slotProps: { typography: {
2108
+ variant: "body2",
2109
+ noWrap: true
2110
+ } },
2111
+ control: /* @__PURE__ */ jsx(Checkbox, {
2112
+ size: "small",
2113
+ checked: column_0.getIsVisible(),
2114
+ onChange: column_0.getToggleVisibilityHandler()
2115
+ })
2116
+ }, column_0.id);
2117
+ }
2118
+ //#endregion
2119
+ //#region src/components/table/ColumnFilterField.tsx
2120
+ const filterMeta = (column) => column.columnDef.meta ?? {};
2121
+ const resolveOptions = (column) => {
2122
+ const declared = filterMeta(column).options;
2123
+ if (declared) return declared;
2124
+ return Array.from(column.getFacetedUniqueValues().keys()).map((value) => ({
2125
+ label: formatValue(value),
2126
+ value: formatValue(value)
2127
+ })).filter((option) => option.value !== "").sort((a, b) => a.label.localeCompare(b.label));
2128
+ };
2129
+ const toDateInputValue = (value) => {
2130
+ if (!(value instanceof Date || typeof value === "string" || typeof value === "number")) return "";
2131
+ const date = value instanceof Date ? value : new Date(value);
2132
+ if (Number.isNaN(date.getTime())) return "";
2133
+ return `${date.getFullYear()}-${String(date.getMonth() + 1).padStart(2, "0")}-${String(date.getDate()).padStart(2, "0")}`;
2134
+ };
2135
+ const fromDateInputValue = (raw) => raw ? (/* @__PURE__ */ new Date(`${raw}T00:00:00`)).toISOString() : void 0;
2136
+ const toNumber = (raw) => raw === "" ? "" : Number(raw);
2137
+ const pair = (value) => Array.isArray(value) ? [value[0], value[1]] : ["", ""];
2138
+ function ColumnFilterField(t0) {
2139
+ const $ = c(123);
2140
+ if ($[0] !== "5472f0f3f904ec8bb8abe412ebf0d2e19ae251239f8741d21196cc627823b1ce") {
2141
+ for (let $i = 0; $i < 123; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
2142
+ $[0] = "5472f0f3f904ec8bb8abe412ebf0d2e19ae251239f8741d21196cc627823b1ce";
2143
+ }
2144
+ const { column, filter, onChange } = t0;
2145
+ const { t } = useTranslation$1();
2146
+ let t1;
2147
+ if ($[1] !== column) {
2148
+ t1 = filterMeta(column).variant ?? "text";
2149
+ $[1] = column;
2150
+ $[2] = t1;
2151
+ } else t1 = $[2];
2152
+ const variant = t1;
2153
+ const operator = filter.operator ?? "includesString";
2154
+ let t2;
2155
+ if ($[3] !== t) {
2156
+ t2 = t("Layout.Table.Value");
2157
+ $[3] = t;
2158
+ $[4] = t2;
2159
+ } else t2 = $[4];
2160
+ let t3;
2161
+ if ($[5] !== t2) {
2162
+ t3 = {
2163
+ size: "small",
2164
+ fullWidth: true,
2165
+ label: t2
2166
+ };
2167
+ $[5] = t2;
2168
+ $[6] = t3;
2169
+ } else t3 = $[6];
2170
+ const shared = t3;
2171
+ if (operator === "isEmpty" || operator === "isNotEmpty") {
2172
+ let t4;
2173
+ if ($[7] !== t) {
2174
+ t4 = t("Layout.Table.NoValueRequired");
2175
+ $[7] = t;
2176
+ $[8] = t4;
2177
+ } else t4 = $[8];
2178
+ let t5;
2179
+ if ($[9] !== t4) {
2180
+ t5 = /* @__PURE__ */ jsx(Typography, {
2181
+ variant: "body2",
2182
+ color: "text.secondary",
2183
+ children: t4
2184
+ });
2185
+ $[9] = t4;
2186
+ $[10] = t5;
2187
+ } else t5 = $[10];
2188
+ return t5;
2189
+ }
2190
+ if (operator === "inRange") {
2191
+ let T0;
2192
+ let T1;
2193
+ let from;
2194
+ let isDate;
2195
+ let t4;
2196
+ let t5;
2197
+ let t6;
2198
+ let t7;
2199
+ let t8;
2200
+ let t9;
2201
+ let to;
2202
+ if ($[11] !== filter.value || $[12] !== shared || $[13] !== t || $[14] !== variant) {
2203
+ [from, to] = pair(filter.value);
2204
+ isDate = variant === "date";
2205
+ T1 = Stack;
2206
+ t8 = "row";
2207
+ t9 = 1;
2208
+ T0 = TextField;
2209
+ t4 = shared;
2210
+ t5 = isDate ? "date" : "number";
2211
+ if ($[26] !== t) {
2212
+ t6 = t("Layout.Table.From");
2213
+ $[26] = t;
2214
+ $[27] = t6;
2215
+ } else t6 = $[27];
2216
+ t7 = isDate ? toDateInputValue(from) : from ?? "";
2217
+ $[11] = filter.value;
2218
+ $[12] = shared;
2219
+ $[13] = t;
2220
+ $[14] = variant;
2221
+ $[15] = T0;
2222
+ $[16] = T1;
2223
+ $[17] = from;
2224
+ $[18] = isDate;
2225
+ $[19] = t4;
2226
+ $[20] = t5;
2227
+ $[21] = t6;
2228
+ $[22] = t7;
2229
+ $[23] = t8;
2230
+ $[24] = t9;
2231
+ $[25] = to;
2232
+ } else {
2233
+ T0 = $[15];
2234
+ T1 = $[16];
2235
+ from = $[17];
2236
+ isDate = $[18];
2237
+ t4 = $[19];
2238
+ t5 = $[20];
2239
+ t6 = $[21];
2240
+ t7 = $[22];
2241
+ t8 = $[23];
2242
+ t9 = $[24];
2243
+ to = $[25];
2244
+ }
2245
+ let t10;
2246
+ if ($[28] !== isDate || $[29] !== onChange || $[30] !== to) {
2247
+ t10 = (event) => onChange([isDate ? fromDateInputValue(event.target.value) : toNumber(event.target.value), to]);
2248
+ $[28] = isDate;
2249
+ $[29] = onChange;
2250
+ $[30] = to;
2251
+ $[31] = t10;
2252
+ } else t10 = $[31];
2253
+ let t11;
2254
+ if ($[32] === Symbol.for("react.memo_cache_sentinel")) {
2255
+ t11 = { inputLabel: { shrink: true } };
2256
+ $[32] = t11;
2257
+ } else t11 = $[32];
2258
+ let t12;
2259
+ if ($[33] !== T0 || $[34] !== t10 || $[35] !== t4 || $[36] !== t5 || $[37] !== t6 || $[38] !== t7) {
2260
+ t12 = /* @__PURE__ */ jsx(T0, {
2261
+ ...t4,
2262
+ type: t5,
2263
+ label: t6,
2264
+ value: t7,
2265
+ onChange: t10,
2266
+ slotProps: t11
2267
+ });
2268
+ $[33] = T0;
2269
+ $[34] = t10;
2270
+ $[35] = t4;
2271
+ $[36] = t5;
2272
+ $[37] = t6;
2273
+ $[38] = t7;
2274
+ $[39] = t12;
2275
+ } else t12 = $[39];
2276
+ const t13 = isDate ? "date" : "number";
2277
+ let t14;
2278
+ if ($[40] !== t) {
2279
+ t14 = t("Layout.Table.To");
2280
+ $[40] = t;
2281
+ $[41] = t14;
2282
+ } else t14 = $[41];
2283
+ let t15;
2284
+ if ($[42] !== isDate || $[43] !== to) {
2285
+ t15 = isDate ? toDateInputValue(to) : to ?? "";
2286
+ $[42] = isDate;
2287
+ $[43] = to;
2288
+ $[44] = t15;
2289
+ } else t15 = $[44];
2290
+ let t16;
2291
+ if ($[45] !== from || $[46] !== isDate || $[47] !== onChange) {
2292
+ t16 = (event_0) => onChange([from, isDate ? fromDateInputValue(event_0.target.value) : toNumber(event_0.target.value)]);
2293
+ $[45] = from;
2294
+ $[46] = isDate;
2295
+ $[47] = onChange;
2296
+ $[48] = t16;
2297
+ } else t16 = $[48];
2298
+ let t17;
2299
+ if ($[49] === Symbol.for("react.memo_cache_sentinel")) {
2300
+ t17 = { inputLabel: { shrink: true } };
2301
+ $[49] = t17;
2302
+ } else t17 = $[49];
2303
+ let t18;
2304
+ if ($[50] !== shared || $[51] !== t13 || $[52] !== t14 || $[53] !== t15 || $[54] !== t16) {
2305
+ t18 = /* @__PURE__ */ jsx(TextField, {
2306
+ ...shared,
2307
+ type: t13,
2308
+ label: t14,
2309
+ value: t15,
2310
+ onChange: t16,
2311
+ slotProps: t17
2312
+ });
2313
+ $[50] = shared;
2314
+ $[51] = t13;
2315
+ $[52] = t14;
2316
+ $[53] = t15;
2317
+ $[54] = t16;
2318
+ $[55] = t18;
2319
+ } else t18 = $[55];
2320
+ let t19;
2321
+ if ($[56] !== T1 || $[57] !== t12 || $[58] !== t18 || $[59] !== t8 || $[60] !== t9) {
2322
+ t19 = /* @__PURE__ */ jsxs(T1, {
2323
+ direction: t8,
2324
+ spacing: t9,
2325
+ children: [t12, t18]
2326
+ });
2327
+ $[56] = T1;
2328
+ $[57] = t12;
2329
+ $[58] = t18;
2330
+ $[59] = t8;
2331
+ $[60] = t9;
2332
+ $[61] = t19;
2333
+ } else t19 = $[61];
2334
+ return t19;
2335
+ }
2336
+ if (operator === "isRelativeToToday") {
2337
+ let t4;
2338
+ if ($[62] !== t) {
2339
+ t4 = t("Layout.Table.DaysFromToday");
2340
+ $[62] = t;
2341
+ $[63] = t4;
2342
+ } else t4 = $[63];
2343
+ const t5 = filter.value ?? "";
2344
+ let t6;
2345
+ if ($[64] !== onChange) {
2346
+ t6 = (event_1) => onChange(toNumber(event_1.target.value));
2347
+ $[64] = onChange;
2348
+ $[65] = t6;
2349
+ } else t6 = $[65];
2350
+ let t7;
2351
+ if ($[66] !== shared || $[67] !== t4 || $[68] !== t5 || $[69] !== t6) {
2352
+ t7 = /* @__PURE__ */ jsx(TextField, {
2353
+ ...shared,
2354
+ type: "number",
2355
+ label: t4,
2356
+ value: t5,
2357
+ onChange: t6
2358
+ });
2359
+ $[66] = shared;
2360
+ $[67] = t4;
2361
+ $[68] = t5;
2362
+ $[69] = t6;
2363
+ $[70] = t7;
2364
+ } else t7 = $[70];
2365
+ return t7;
2366
+ }
2367
+ if (variant === "select" || variant === "multi-select") {
2368
+ let T0;
2369
+ let t4;
2370
+ let t5;
2371
+ let t6;
2372
+ let t7;
2373
+ let t8;
2374
+ let t9;
2375
+ if ($[71] !== column || $[72] !== filter.value || $[73] !== variant) {
2376
+ const options = resolveOptions(column);
2377
+ const multiple = variant === "multi-select";
2378
+ let t10;
2379
+ if ($[81] !== filter.value) {
2380
+ t10 = Array.isArray(filter.value) ? filter.value : [];
2381
+ $[81] = filter.value;
2382
+ $[82] = t10;
2383
+ } else t10 = $[82];
2384
+ const selected = t10;
2385
+ T0 = Autocomplete;
2386
+ t4 = "small";
2387
+ t5 = true;
2388
+ t6 = multiple;
2389
+ t7 = options;
2390
+ t8 = multiple;
2391
+ t9 = multiple ? options.filter((option) => selected.includes(option.value)) : options.find((option_0) => option_0.value === filter.value) ?? null;
2392
+ $[71] = column;
2393
+ $[72] = filter.value;
2394
+ $[73] = variant;
2395
+ $[74] = T0;
2396
+ $[75] = t4;
2397
+ $[76] = t5;
2398
+ $[77] = t6;
2399
+ $[78] = t7;
2400
+ $[79] = t8;
2401
+ $[80] = t9;
2402
+ } else {
2403
+ T0 = $[74];
2404
+ t4 = $[75];
2405
+ t5 = $[76];
2406
+ t6 = $[77];
2407
+ t7 = $[78];
2408
+ t8 = $[79];
2409
+ t9 = $[80];
2410
+ }
2411
+ let t10;
2412
+ if ($[83] !== onChange) {
2413
+ t10 = (_, next) => onChange(Array.isArray(next) ? next.map(_temp3) : next?.value ?? void 0);
2414
+ $[83] = onChange;
2415
+ $[84] = t10;
2416
+ } else t10 = $[84];
2417
+ let t11;
2418
+ if ($[85] !== t) {
2419
+ t11 = (params) => /* @__PURE__ */ jsx(TextField, {
2420
+ ...params,
2421
+ size: "small",
2422
+ label: t("Layout.Table.Value")
2423
+ });
2424
+ $[85] = t;
2425
+ $[86] = t11;
2426
+ } else t11 = $[86];
2427
+ let t12;
2428
+ if ($[87] !== T0 || $[88] !== t10 || $[89] !== t11 || $[90] !== t4 || $[91] !== t5 || $[92] !== t6 || $[93] !== t7 || $[94] !== t8 || $[95] !== t9) {
2429
+ t12 = /* @__PURE__ */ jsx(T0, {
2430
+ size: t4,
2431
+ fullWidth: t5,
2432
+ multiple: t6,
2433
+ options: t7,
2434
+ disableCloseOnSelect: t8,
2435
+ value: t9,
2436
+ isOptionEqualToValue: _temp$2,
2437
+ getOptionLabel: _temp2,
2438
+ onChange: t10,
2439
+ renderInput: t11
2440
+ });
2441
+ $[87] = T0;
2442
+ $[88] = t10;
2443
+ $[89] = t11;
2444
+ $[90] = t4;
2445
+ $[91] = t5;
2446
+ $[92] = t6;
2447
+ $[93] = t7;
2448
+ $[94] = t8;
2449
+ $[95] = t9;
2450
+ $[96] = t12;
2451
+ } else t12 = $[96];
2452
+ return t12;
2453
+ }
2454
+ if (variant === "boolean") {
2455
+ const t4 = typeof filter.value === "boolean" ? String(filter.value) : "";
2456
+ let t5;
2457
+ if ($[97] !== onChange) {
2458
+ t5 = (event_2) => onChange(event_2.target.value === "" ? void 0 : event_2.target.value === "true");
2459
+ $[97] = onChange;
2460
+ $[98] = t5;
2461
+ } else t5 = $[98];
2462
+ let t6;
2463
+ let t7;
2464
+ let t8;
2465
+ if ($[99] === Symbol.for("react.memo_cache_sentinel")) {
2466
+ t6 = /* @__PURE__ */ jsx(MenuItem, {
2467
+ value: "",
2468
+ children: "—"
2469
+ });
2470
+ t7 = /* @__PURE__ */ jsx(MenuItem, {
2471
+ value: "true",
2472
+ children: "✓"
2473
+ });
2474
+ t8 = /* @__PURE__ */ jsx(MenuItem, {
2475
+ value: "false",
2476
+ children: "✗"
2477
+ });
2478
+ $[99] = t6;
2479
+ $[100] = t7;
2480
+ $[101] = t8;
2481
+ } else {
2482
+ t6 = $[99];
2483
+ t7 = $[100];
2484
+ t8 = $[101];
2485
+ }
2486
+ let t9;
2487
+ if ($[102] !== shared || $[103] !== t4 || $[104] !== t5) {
2488
+ t9 = /* @__PURE__ */ jsxs(TextField, {
2489
+ ...shared,
2490
+ select: true,
2491
+ value: t4,
2492
+ onChange: t5,
2493
+ children: [
2494
+ t6,
2495
+ t7,
2496
+ t8
2497
+ ]
2498
+ });
2499
+ $[102] = shared;
2500
+ $[103] = t4;
2501
+ $[104] = t5;
2502
+ $[105] = t9;
2503
+ } else t9 = $[105];
2504
+ return t9;
2505
+ }
2506
+ if (variant === "date") {
2507
+ let t4;
2508
+ if ($[106] !== filter.value) {
2509
+ t4 = toDateInputValue(filter.value);
2510
+ $[106] = filter.value;
2511
+ $[107] = t4;
2512
+ } else t4 = $[107];
2513
+ let t5;
2514
+ if ($[108] !== onChange) {
2515
+ t5 = (event_3) => onChange(fromDateInputValue(event_3.target.value) ?? "");
2516
+ $[108] = onChange;
2517
+ $[109] = t5;
2518
+ } else t5 = $[109];
2519
+ let t6;
2520
+ if ($[110] === Symbol.for("react.memo_cache_sentinel")) {
2521
+ t6 = { inputLabel: { shrink: true } };
2522
+ $[110] = t6;
2523
+ } else t6 = $[110];
2524
+ let t7;
2525
+ if ($[111] !== shared || $[112] !== t4 || $[113] !== t5) {
2526
+ t7 = /* @__PURE__ */ jsx(TextField, {
2527
+ ...shared,
2528
+ type: "date",
2529
+ value: t4,
2530
+ onChange: t5,
2531
+ slotProps: t6
2532
+ });
2533
+ $[111] = shared;
2534
+ $[112] = t4;
2535
+ $[113] = t5;
2536
+ $[114] = t7;
2537
+ } else t7 = $[114];
2538
+ return t7;
2539
+ }
2540
+ const t4 = variant === "number" ? "number" : "text";
2541
+ const t5 = filter.value ?? "";
2542
+ let t6;
2543
+ if ($[115] !== onChange || $[116] !== variant) {
2544
+ t6 = (event_4) => onChange(variant === "number" ? toNumber(event_4.target.value) : event_4.target.value);
2545
+ $[115] = onChange;
2546
+ $[116] = variant;
2547
+ $[117] = t6;
2548
+ } else t6 = $[117];
2549
+ let t7;
2550
+ if ($[118] !== shared || $[119] !== t4 || $[120] !== t5 || $[121] !== t6) {
2551
+ t7 = /* @__PURE__ */ jsx(TextField, {
2552
+ ...shared,
2553
+ type: t4,
2554
+ value: t5,
2555
+ onChange: t6
2556
+ });
2557
+ $[118] = shared;
2558
+ $[119] = t4;
2559
+ $[120] = t5;
2560
+ $[121] = t6;
2561
+ $[122] = t7;
2562
+ } else t7 = $[122];
2563
+ return t7;
2564
+ }
2565
+ function _temp3(option_3) {
2566
+ return option_3.value;
2567
+ }
2568
+ function _temp2(option_2) {
2569
+ return option_2.label;
2570
+ }
2571
+ function _temp$2(option_1, selectedOption) {
2572
+ return option_1.value === selectedOption.value;
2573
+ }
2574
+ //#endregion
2575
+ //#region src/components/table/table/FiltersMenu.tsx
2576
+ const DATE_OPERATOR_LABELS = {
2577
+ lessThan: "Layout.Table.Operators.Date.lessThan",
2578
+ lessThanOrEqualTo: "Layout.Table.Operators.Date.lessThanOrEqualTo",
2579
+ greaterThan: "Layout.Table.Operators.Date.greaterThan",
2580
+ greaterThanOrEqualTo: "Layout.Table.Operators.Date.greaterThanOrEqualTo"
2581
+ };
2582
+ /** Slot widths taken from the MUI X `GridFilterForm` inputs. */
2583
+ const LOGIC_WIDTH = 75;
2584
+ const FIELD_WIDTH = 150;
2585
+ const VALUE_WIDTH = 190;
2586
+ const FiltersMenu = () => {
2587
+ const table = useTableContext();
2588
+ const { t } = useTranslation$1();
2589
+ const [anchorEl, setAnchorEl] = useState(null);
2590
+ const placeholder = useRef(null);
2591
+ const buttonRef = useRef(null);
2592
+ const filterableColumns = table.getAllLeafColumns().filter((column) => column.getCanFilter());
2593
+ const close = () => {
2594
+ setAnchorEl(null);
2595
+ placeholder.current = null;
2596
+ };
2597
+ useHotkey("Control+F", () => anchorEl ? close() : setAnchorEl(buttonRef.current), { enabled: filterableColumns.length > 0 });
2598
+ if (!filterableColumns.length) return null;
2599
+ const setFilters = (filters) => table.setColumnFilters(filters);
2600
+ const newFilter = (column_0, joinOperator = "and") => ({
2601
+ id: column_0.id,
2602
+ filterId: crypto.randomUUID(),
2603
+ value: "",
2604
+ operator: getFilterOperators(column_0.columnDef.meta?.variant ?? "text")[0],
2605
+ joinOperator
2606
+ });
2607
+ return /* @__PURE__ */ jsx(Subscribe, {
2608
+ source: table.atoms.columnFilters,
2609
+ selector: (filters_0) => filters_0,
2610
+ children: (columnFilters) => {
2611
+ if (!columnFilters.length) placeholder.current ??= newFilter(filterableColumns[0]);
2612
+ const rows = columnFilters.length ? columnFilters : placeholder.current ? [placeholder.current] : [];
2613
+ const activeCount = columnFilters.filter(isFilterActive).length;
2614
+ const update = (filterId, patch) => setFilters(rows.map((filter) => filter.filterId === filterId ? {
2615
+ ...filter,
2616
+ ...patch,
2617
+ ..."value" in patch && { value: patch.value ?? "" }
2618
+ } : filter));
2619
+ const remove = (filterId_0) => {
2620
+ const next = rows.filter((filter_0) => filter_0.filterId !== filterId_0);
2621
+ placeholder.current = null;
2622
+ setFilters(next);
2623
+ if (!next.length) close();
2624
+ };
2625
+ const add = () => setFilters([...rows, newFilter(filterableColumns[0], rows[0]?.joinOperator ?? "and")]);
2626
+ return /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(Tooltip, {
2627
+ title: shortcutLabel(t("Layout.Table.Filters"), "Control+F"),
2628
+ children: /* @__PURE__ */ jsx(IconButton, {
2629
+ ref: buttonRef,
2630
+ size: "small",
2631
+ color: activeCount ? "primary" : "default",
2632
+ onClick: (event) => setAnchorEl(event.currentTarget),
2633
+ children: /* @__PURE__ */ jsx(Badge, {
2634
+ badgeContent: activeCount,
2635
+ color: "primary",
2636
+ variant: "dot",
2637
+ children: /* @__PURE__ */ jsx(FilterList, { fontSize: "small" })
2638
+ })
2639
+ })
2640
+ }), /* @__PURE__ */ jsxs(Popover, {
2641
+ anchorEl,
2642
+ open: !!anchorEl,
2643
+ onClose: close,
2644
+ anchorOrigin: {
2645
+ vertical: "bottom",
2646
+ horizontal: "right"
2647
+ },
2648
+ transformOrigin: {
2649
+ vertical: "top",
2650
+ horizontal: "right"
2651
+ },
2652
+ slotProps: { paper: { sx: { maxWidth: "calc(100vw - 16px)" } } },
2653
+ children: [/* @__PURE__ */ jsx(Box, {
2654
+ sx: {
2655
+ display: "flex",
2656
+ flexDirection: "column",
2657
+ gap: 2.5,
2658
+ p: "20px 12px 16px 8px",
2659
+ maxHeight: 400,
2660
+ overflow: "auto"
2661
+ },
2662
+ children: rows.map((filter_1, index) => {
2663
+ const column_1 = table.getColumn(filter_1.id);
2664
+ if (!column_1 || !filter_1.filterId) return null;
2665
+ const variant = column_1.columnDef.meta?.variant ?? "text";
2666
+ const operators = getFilterOperators(variant);
2667
+ return /* @__PURE__ */ jsxs(Box, {
2668
+ sx: {
2669
+ display: "flex",
2670
+ alignItems: "center",
2671
+ gap: 1.5
2672
+ },
2673
+ children: [
2674
+ /* @__PURE__ */ jsx(IconButton, {
2675
+ size: "small",
2676
+ "aria-label": t("Layout.Table.RemoveFilter"),
2677
+ sx: { flexShrink: 0 },
2678
+ onClick: () => remove(filter_1.filterId),
2679
+ children: /* @__PURE__ */ jsx(Close, { fontSize: "small" })
2680
+ }),
2681
+ /* @__PURE__ */ jsx(FormControl, {
2682
+ size: "small",
2683
+ sx: {
2684
+ width: LOGIC_WIDTH,
2685
+ flexShrink: 0,
2686
+ visibility: index === 0 ? "hidden" : "visible"
2687
+ },
2688
+ children: /* @__PURE__ */ jsxs(Select, {
2689
+ disabled: index > 1,
2690
+ value: filter_1.joinOperator ?? "and",
2691
+ inputProps: { "aria-label": t("Layout.Table.Operator") },
2692
+ onChange: (event_0) => setFilters(rows.map((item) => ({
2693
+ ...item,
2694
+ joinOperator: event_0.target.value
2695
+ }))),
2696
+ children: [/* @__PURE__ */ jsx(MenuItem, {
2697
+ value: "and",
2698
+ children: t("Layout.Table.And")
2699
+ }), /* @__PURE__ */ jsx(MenuItem, {
2700
+ value: "or",
2701
+ children: t("Layout.Table.Or")
2702
+ })]
2703
+ })
2704
+ }),
2705
+ /* @__PURE__ */ jsx(Autocomplete, {
2706
+ size: "small",
2707
+ sx: {
2708
+ width: FIELD_WIDTH,
2709
+ flexShrink: 0
2710
+ },
2711
+ disableClearable: true,
2712
+ options: filterableColumns,
2713
+ value: column_1,
2714
+ isOptionEqualToValue: (option, selected) => option.id === selected.id,
2715
+ getOptionLabel: (option_0) => columnLabel(option_0),
2716
+ onChange: (_, next_0) => update(filter_1.filterId, {
2717
+ id: next_0.id,
2718
+ operator: getFilterOperators(next_0.columnDef.meta?.variant ?? "text")[0],
2719
+ value: ""
2720
+ }),
2721
+ renderInput: (params) => /* @__PURE__ */ jsx(TextField, {
2722
+ ...params,
2723
+ size: "small",
2724
+ label: t("Layout.Table.Field")
2725
+ })
2726
+ }),
2727
+ /* @__PURE__ */ jsxs(FormControl, {
2728
+ size: "small",
2729
+ sx: {
2730
+ width: FIELD_WIDTH,
2731
+ flexShrink: 0
2732
+ },
2733
+ children: [/* @__PURE__ */ jsx(InputLabel, { children: t("Layout.Table.Operator") }), /* @__PURE__ */ jsx(Select, {
2734
+ label: t("Layout.Table.Operator"),
2735
+ value: filter_1.operator ?? operators[0],
2736
+ onChange: (event_1) => update(filter_1.filterId, {
2737
+ operator: event_1.target.value,
2738
+ value: ""
2739
+ }),
2740
+ children: operators.map((operator) => /* @__PURE__ */ jsx(MenuItem, {
2741
+ value: operator,
2742
+ children: variant === "date" && operator in DATE_OPERATOR_LABELS ? t(DATE_OPERATOR_LABELS[operator]) : t(`Layout.Table.Operators.${operator}`)
2743
+ }, operator))
2744
+ })]
2745
+ }),
2746
+ /* @__PURE__ */ jsx(Box, {
2747
+ sx: {
2748
+ width: VALUE_WIDTH,
2749
+ flexGrow: 1
2750
+ },
2751
+ children: /* @__PURE__ */ jsx(ColumnFilterField, {
2752
+ column: column_1,
2753
+ filter: filter_1,
2754
+ onChange: (value) => update(filter_1.filterId, { value })
2755
+ })
2756
+ })
2757
+ ]
2758
+ }, filter_1.filterId);
2759
+ })
2760
+ }), /* @__PURE__ */ jsxs(Box, {
2761
+ sx: {
2762
+ display: "flex",
2763
+ justifyContent: "space-between",
2764
+ gap: 1,
2765
+ p: 1,
2766
+ borderTop: 1,
2767
+ borderColor: "divider"
2768
+ },
2769
+ children: [/* @__PURE__ */ jsx(Button, {
2770
+ size: "small",
2771
+ startIcon: /* @__PURE__ */ jsx(Add, {}),
2772
+ onClick: add,
2773
+ children: t("Layout.Table.AddFilter")
2774
+ }), columnFilters.length > 0 && /* @__PURE__ */ jsx(Button, {
2775
+ size: "small",
2776
+ color: "inherit",
2777
+ startIcon: /* @__PURE__ */ jsx(DeleteForever, {}),
2778
+ onClick: () => {
2779
+ placeholder.current = null;
2780
+ table.resetColumnFilters(true);
2781
+ },
2782
+ children: t("Layout.Table.ClearFilters")
2783
+ })]
2784
+ })]
2785
+ })] });
2786
+ }
2787
+ });
2788
+ };
2789
+ //#endregion
2790
+ //#region src/components/table/table/GlobalFilter.tsx
2791
+ const GlobalFilter = (t0) => {
2792
+ const $ = c(57);
2793
+ if ($[0] !== "fcd35c65e16f19ec02f235915ea90785448df1eaba0e2e257556e7ecf39f564f") {
2794
+ for (let $i = 0; $i < 57; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
2795
+ $[0] = "fcd35c65e16f19ec02f235915ea90785448df1eaba0e2e257556e7ecf39f564f";
2796
+ }
2797
+ const { defaultExpanded, debounce: t1 } = t0;
2798
+ const debounce = t1 === void 0 ? 300 : t1;
2799
+ const table = useTableContext();
2800
+ const { t } = useTranslation$1();
2801
+ const theme = useTheme();
2802
+ const inputRef = useRef(null);
2803
+ const [value, setValue] = useState(table.state.globalFilter ?? "");
2804
+ const [expanded, setExpanded] = useState(!!defaultExpanded);
2805
+ let t2;
2806
+ let t3;
2807
+ if ($[1] !== debounce || $[2] !== table || $[3] !== value) {
2808
+ t2 = () => {
2809
+ const id = setTimeout(() => table.setGlobalFilter(value), debounce);
2810
+ return () => clearTimeout(id);
2811
+ };
2812
+ t3 = [
2813
+ value,
2814
+ debounce,
2815
+ table
2816
+ ];
2817
+ $[1] = debounce;
2818
+ $[2] = table;
2819
+ $[3] = value;
2820
+ $[4] = t2;
2821
+ $[5] = t3;
2822
+ } else {
2823
+ t2 = $[4];
2824
+ t3 = $[5];
2825
+ }
2826
+ useEffect(t2, t3);
2827
+ let t4;
2828
+ if ($[6] === Symbol.for("react.memo_cache_sentinel")) {
2829
+ t4 = () => {
2830
+ setValue("");
2831
+ setExpanded(false);
2832
+ };
2833
+ $[6] = t4;
2834
+ } else t4 = $[6];
2835
+ const collapse = t4;
2836
+ let t5;
2837
+ if ($[7] === Symbol.for("react.memo_cache_sentinel")) {
2838
+ t5 = () => {
2839
+ setExpanded(true);
2840
+ inputRef.current?.focus();
2841
+ };
2842
+ $[7] = t5;
2843
+ } else t5 = $[7];
2844
+ const expand = t5;
2845
+ useHotkey("Control+Q", expand);
2846
+ let t6;
2847
+ if ($[8] === Symbol.for("react.memo_cache_sentinel")) {
2848
+ t6 = {
2849
+ display: "grid",
2850
+ alignItems: "center"
2851
+ };
2852
+ $[8] = t6;
2853
+ } else t6 = $[8];
2854
+ let t7;
2855
+ if ($[9] !== t) {
2856
+ t7 = shortcutLabel(t("Layout.Table.Search"), "Control+Q");
2857
+ $[9] = t;
2858
+ $[10] = t7;
2859
+ } else t7 = $[10];
2860
+ let t8;
2861
+ if ($[11] !== t) {
2862
+ t8 = t("Layout.Table.Search");
2863
+ $[11] = t;
2864
+ $[12] = t8;
2865
+ } else t8 = $[12];
2866
+ const t9 = expanded ? 0 : 1;
2867
+ const t10 = expanded ? "none" : "auto";
2868
+ let t11;
2869
+ if ($[13] !== theme.transitions) {
2870
+ t11 = theme.transitions.create(["opacity"]);
2871
+ $[13] = theme.transitions;
2872
+ $[14] = t11;
2873
+ } else t11 = $[14];
2874
+ let t12;
2875
+ if ($[15] !== t10 || $[16] !== t11 || $[17] !== t9) {
2876
+ t12 = {
2877
+ gridArea: "1 / 1",
2878
+ width: "min-content",
2879
+ height: "min-content",
2880
+ zIndex: 1,
2881
+ opacity: t9,
2882
+ pointerEvents: t10,
2883
+ transition: t11
2884
+ };
2885
+ $[15] = t10;
2886
+ $[16] = t11;
2887
+ $[17] = t9;
2888
+ $[18] = t12;
2889
+ } else t12 = $[18];
2890
+ let t13;
2891
+ if ($[19] === Symbol.for("react.memo_cache_sentinel")) {
2892
+ t13 = /* @__PURE__ */ jsx(Search, { fontSize: "small" });
2893
+ $[19] = t13;
2894
+ } else t13 = $[19];
2895
+ let t14;
2896
+ if ($[20] !== expanded || $[21] !== t12 || $[22] !== t8) {
2897
+ t14 = /* @__PURE__ */ jsx(IconButton, {
2898
+ size: "small",
2899
+ "aria-label": t8,
2900
+ "aria-disabled": expanded,
2901
+ onClick: expand,
2902
+ sx: t12,
2903
+ children: t13
2904
+ });
2905
+ $[20] = expanded;
2906
+ $[21] = t12;
2907
+ $[22] = t8;
2908
+ $[23] = t14;
2909
+ } else t14 = $[23];
2910
+ let t15;
2911
+ if ($[24] !== t14 || $[25] !== t7) {
2912
+ t15 = /* @__PURE__ */ jsx(Tooltip, {
2913
+ title: t7,
2914
+ children: t14
2915
+ });
2916
+ $[24] = t14;
2917
+ $[25] = t7;
2918
+ $[26] = t15;
2919
+ } else t15 = $[26];
2920
+ let t16;
2921
+ if ($[27] !== t) {
2922
+ t16 = t("Layout.Table.Search");
2923
+ $[27] = t;
2924
+ $[28] = t16;
2925
+ } else t16 = $[28];
2926
+ let t17;
2927
+ let t18;
2928
+ if ($[29] === Symbol.for("react.memo_cache_sentinel")) {
2929
+ t17 = (event) => setValue(event.target.value);
2930
+ t18 = (event_0) => event_0.key === "Escape" && collapse();
2931
+ $[29] = t17;
2932
+ $[30] = t18;
2933
+ } else {
2934
+ t17 = $[29];
2935
+ t18 = $[30];
2936
+ }
2937
+ let t19;
2938
+ if ($[31] !== defaultExpanded || $[32] !== value) {
2939
+ t19 = () => !value && !defaultExpanded && setExpanded(false);
2940
+ $[31] = defaultExpanded;
2941
+ $[32] = value;
2942
+ $[33] = t19;
2943
+ } else t19 = $[33];
2944
+ const t20 = expanded ? 260 : 40;
2945
+ const t21 = expanded ? 1 : 0;
2946
+ const t22 = expanded ? "auto" : "none";
2947
+ let t23;
2948
+ if ($[34] !== theme.transitions) {
2949
+ t23 = theme.transitions.create(["width", "opacity"]);
2950
+ $[34] = theme.transitions;
2951
+ $[35] = t23;
2952
+ } else t23 = $[35];
2953
+ let t24;
2954
+ if ($[36] !== t20 || $[37] !== t21 || $[38] !== t22 || $[39] !== t23) {
2955
+ t24 = {
2956
+ gridArea: "1 / 1",
2957
+ overflowX: "clip",
2958
+ width: t20,
2959
+ opacity: t21,
2960
+ pointerEvents: t22,
2961
+ transition: t23
2962
+ };
2963
+ $[36] = t20;
2964
+ $[37] = t21;
2965
+ $[38] = t22;
2966
+ $[39] = t23;
2967
+ $[40] = t24;
2968
+ } else t24 = $[40];
2969
+ let t25;
2970
+ if ($[41] === Symbol.for("react.memo_cache_sentinel")) {
2971
+ t25 = /* @__PURE__ */ jsx(InputAdornment, {
2972
+ position: "start",
2973
+ children: /* @__PURE__ */ jsx(Search, { fontSize: "small" })
2974
+ });
2975
+ $[41] = t25;
2976
+ } else t25 = $[41];
2977
+ let t26;
2978
+ if ($[42] !== t) {
2979
+ t26 = t("Layout.Table.ClearSearch");
2980
+ $[42] = t;
2981
+ $[43] = t26;
2982
+ } else t26 = $[43];
2983
+ let t27;
2984
+ let t28;
2985
+ if ($[44] === Symbol.for("react.memo_cache_sentinel")) {
2986
+ t27 = { mr: -.75 };
2987
+ t28 = /* @__PURE__ */ jsx(Close, { fontSize: "small" });
2988
+ $[44] = t27;
2989
+ $[45] = t28;
2990
+ } else {
2991
+ t27 = $[44];
2992
+ t28 = $[45];
2993
+ }
2994
+ let t29;
2995
+ if ($[46] !== t26) {
2996
+ t29 = { input: {
2997
+ startAdornment: t25,
2998
+ endAdornment: /* @__PURE__ */ jsx(InputAdornment, {
2999
+ position: "end",
3000
+ children: /* @__PURE__ */ jsx(IconButton, {
3001
+ edge: "end",
3002
+ size: "small",
3003
+ "aria-label": t26,
3004
+ onClick: collapse,
3005
+ sx: t27,
3006
+ children: t28
3007
+ })
3008
+ })
3009
+ } };
3010
+ $[46] = t26;
3011
+ $[47] = t29;
3012
+ } else t29 = $[47];
3013
+ let t30;
3014
+ if ($[48] !== t16 || $[49] !== t19 || $[50] !== t24 || $[51] !== t29 || $[52] !== value) {
3015
+ t30 = /* @__PURE__ */ jsx(TextField, {
3016
+ inputRef,
3017
+ size: "small",
3018
+ value,
3019
+ placeholder: t16,
3020
+ onChange: t17,
3021
+ onKeyDown: t18,
3022
+ onBlur: t19,
3023
+ sx: t24,
3024
+ slotProps: t29
3025
+ });
3026
+ $[48] = t16;
3027
+ $[49] = t19;
3028
+ $[50] = t24;
3029
+ $[51] = t29;
3030
+ $[52] = value;
3031
+ $[53] = t30;
3032
+ } else t30 = $[53];
3033
+ let t31;
3034
+ if ($[54] !== t15 || $[55] !== t30) {
3035
+ t31 = /* @__PURE__ */ jsxs(Box, {
3036
+ sx: t6,
3037
+ children: [t15, t30]
3038
+ });
3039
+ $[54] = t15;
3040
+ $[55] = t30;
3041
+ $[56] = t31;
3042
+ } else t31 = $[56];
3043
+ return t31;
3044
+ };
3045
+ //#endregion
3046
+ //#region src/components/table/table/Pagination.tsx
3047
+ const ALL = -1;
3048
+ const Pagination = (t0) => {
3049
+ const $ = c(16);
3050
+ if ($[0] !== "35f3e006007ae0e4ccbdd3e2e09ae9cbd9d16c7804126e9f3e24a96c2298d387") {
3051
+ for (let $i = 0; $i < 16; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
3052
+ $[0] = "35f3e006007ae0e4ccbdd3e2e09ae9cbd9d16c7804126e9f3e24a96c2298d387";
3053
+ }
3054
+ const { pageSizeOptions: t1, ...props } = t0;
3055
+ const pageSizeOptions = t1 === void 0 ? [
3056
+ 10,
3057
+ 25,
3058
+ 50,
3059
+ 100
3060
+ ] : t1;
3061
+ const table = useTableContext();
3062
+ const { t } = useTranslation$1();
3063
+ const { pageIndex, pageSize } = table.state.pagination;
3064
+ const sizes = Number.isFinite(pageSize) && !pageSizeOptions.includes(pageSize) ? [...pageSizeOptions, pageSize].sort(_temp$1) : pageSizeOptions;
3065
+ let t2;
3066
+ if ($[1] === Symbol.for("react.memo_cache_sentinel")) {
3067
+ t2 = {
3068
+ flexShrink: 0,
3069
+ minHeight: 52,
3070
+ borderTop: 1,
3071
+ borderColor: "divider"
3072
+ };
3073
+ $[1] = t2;
3074
+ } else t2 = $[1];
3075
+ let t3;
3076
+ if ($[2] !== t) {
3077
+ t3 = t("Layout.Table.All");
3078
+ $[2] = t;
3079
+ $[3] = t3;
3080
+ } else t3 = $[3];
3081
+ let t4;
3082
+ if ($[4] !== t3) {
3083
+ t4 = {
3084
+ label: t3,
3085
+ value: ALL
3086
+ };
3087
+ $[4] = t3;
3088
+ $[5] = t4;
3089
+ } else t4 = $[5];
3090
+ let t5;
3091
+ if ($[6] !== sizes || $[7] !== t4) {
3092
+ t5 = [...sizes, t4];
3093
+ $[6] = sizes;
3094
+ $[7] = t4;
3095
+ $[8] = t5;
3096
+ } else t5 = $[8];
3097
+ let t6;
3098
+ if ($[9] !== table) {
3099
+ t6 = table.getRowCount();
3100
+ $[9] = table;
3101
+ $[10] = t6;
3102
+ } else t6 = $[10];
3103
+ let t7;
3104
+ if ($[11] !== pageSize) {
3105
+ t7 = Number.isFinite(pageSize) ? pageSize : ALL;
3106
+ $[11] = pageSize;
3107
+ $[12] = t7;
3108
+ } else t7 = $[12];
3109
+ let t8;
3110
+ let t9;
3111
+ if ($[13] !== table) {
3112
+ t8 = (_, page) => table.setPageIndex(page);
3113
+ t9 = (event) => {
3114
+ const next = Number(event.target.value);
3115
+ table.setPageSize(next === ALL ? Infinity : next);
3116
+ table.setPageIndex(0);
3117
+ };
3118
+ $[13] = table;
3119
+ $[14] = t8;
3120
+ $[15] = t9;
3121
+ } else {
3122
+ t8 = $[14];
3123
+ t9 = $[15];
3124
+ }
3125
+ return /* @__PURE__ */ jsx(TablePagination, {
3126
+ component: "div",
3127
+ showFirstButton: true,
3128
+ showLastButton: true,
3129
+ ...props,
3130
+ sx: [t2, ...Array.isArray(props.sx) ? props.sx : [props.sx]],
3131
+ rowsPerPageOptions: t5,
3132
+ count: t6,
3133
+ page: pageIndex,
3134
+ rowsPerPage: t7,
3135
+ onPageChange: t8,
3136
+ onRowsPerPageChange: t9
3137
+ });
3138
+ };
3139
+ function _temp$1(a, b) {
3140
+ return a - b;
3141
+ }
3142
+ //#endregion
3143
+ //#region src/components/table/table/Skeleton.tsx
3144
+ const Skeleton$1 = (t0) => {
3145
+ const $ = c(10);
3146
+ if ($[0] !== "00bef53ed4714d4f0462a8803449e9eebc94975bf5c6ef2c15a2dac40876f4db") {
3147
+ for (let $i = 0; $i < 10; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
3148
+ $[0] = "00bef53ed4714d4f0462a8803449e9eebc94975bf5c6ef2c15a2dac40876f4db";
3149
+ }
3150
+ const { rowHeight } = t0;
3151
+ const table = useTableContext();
3152
+ const firstRow = useRef(null);
3153
+ let t1;
3154
+ if ($[1] !== table.state.pagination.pageSize) {
3155
+ t1 = () => Math.min(table.state.pagination.pageSize, 20);
3156
+ $[1] = table.state.pagination.pageSize;
3157
+ $[2] = t1;
3158
+ } else t1 = $[2];
3159
+ const [rowCount, setRowCount] = useState(t1);
3160
+ let t2;
3161
+ let t3;
3162
+ if ($[3] !== rowHeight) {
3163
+ t2 = () => {
3164
+ const container = firstRow.current?.closest(".MuiTableContainer-root");
3165
+ if (!container) return;
3166
+ const measure = () => {
3167
+ const spent = ["thead", "tfoot"].reduce((total, selector) => total + (container.querySelector(selector)?.getBoundingClientRect().height ?? 0), 0);
3168
+ setRowCount(Math.max(1, Math.floor((container.clientHeight - spent) / rowHeight)));
3169
+ };
3170
+ measure();
3171
+ const observer = new ResizeObserver(measure);
3172
+ observer.observe(container);
3173
+ return () => observer.disconnect();
3174
+ };
3175
+ t3 = [rowHeight];
3176
+ $[3] = rowHeight;
3177
+ $[4] = t2;
3178
+ $[5] = t3;
3179
+ } else {
3180
+ t2 = $[4];
3181
+ t3 = $[5];
3182
+ }
3183
+ useEffect(t2, t3);
3184
+ let t4;
3185
+ if ($[6] !== rowCount || $[7] !== rowHeight || $[8] !== table) {
3186
+ t4 = /* @__PURE__ */ jsx(Fragment$1, { children: Array.from({ length: rowCount }, (_, index) => /* @__PURE__ */ jsxs(TableRow, {
3187
+ ref: index === 0 ? firstRow : void 0,
3188
+ sx: { height: rowHeight },
3189
+ children: [table.getVisibleLeafColumns().map(_temp), /* @__PURE__ */ jsx(TableCell, {
3190
+ "aria-hidden": true,
3191
+ sx: { p: 0 }
3192
+ })]
3193
+ }, index)) });
3194
+ $[6] = rowCount;
3195
+ $[7] = rowHeight;
3196
+ $[8] = table;
3197
+ $[9] = t4;
3198
+ } else t4 = $[9];
3199
+ return t4;
3200
+ };
3201
+ function _temp(column) {
3202
+ return hasColumnLabel(column) ? /* @__PURE__ */ jsx(TableCell, {
3203
+ sx: {
3204
+ py: 0,
3205
+ px: "10px"
3206
+ },
3207
+ children: /* @__PURE__ */ jsx(Skeleton, { variant: "text" })
3208
+ }, column.id) : /* @__PURE__ */ jsx(TableCell, {
3209
+ align: "center",
3210
+ sx: {
3211
+ px: .5,
3212
+ py: 0
3213
+ },
3214
+ children: /* @__PURE__ */ jsx(Skeleton, {
3215
+ variant: "circular",
3216
+ width: 22,
3217
+ height: 22,
3218
+ sx: { mx: "auto" }
3219
+ })
3220
+ }, column.id);
3221
+ }
3222
+ //#endregion
3223
+ //#region src/components/table/table/Toolbar.tsx
3224
+ /** Vertical rule with the MUI X toolbar proportions: half height, 4px gutters. */
3225
+ const ToolbarDivider = () => {
3226
+ const $ = c(2);
3227
+ if ($[0] !== "f0b66427050989a7d55e85e65bda2cbd8971c5fb24eadc65102729994051490d") {
3228
+ for (let $i = 0; $i < 2; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
3229
+ $[0] = "f0b66427050989a7d55e85e65bda2cbd8971c5fb24eadc65102729994051490d";
3230
+ }
3231
+ let t0;
3232
+ if ($[1] === Symbol.for("react.memo_cache_sentinel")) {
3233
+ t0 = /* @__PURE__ */ jsx(Divider, {
3234
+ orientation: "vertical",
3235
+ sx: {
3236
+ height: "50%",
3237
+ alignSelf: "center",
3238
+ mx: .5
3239
+ }
3240
+ });
3241
+ $[1] = t0;
3242
+ } else t0 = $[1];
3243
+ return t0;
3244
+ };
3245
+ const Toolbar$1 = (t0) => {
3246
+ const $ = c(29);
3247
+ if ($[0] !== "f0b66427050989a7d55e85e65bda2cbd8971c5fb24eadc65102729994051490d") {
3248
+ for (let $i = 0; $i < 29; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
3249
+ $[0] = "f0b66427050989a7d55e85e65bda2cbd8971c5fb24eadc65102729994051490d";
3250
+ }
3251
+ const { title, actions, disableColumnFilter, disableColumnSelector, disableSearch } = t0;
3252
+ const table = useTableContext();
3253
+ const { t } = useTranslation$1();
3254
+ let t1;
3255
+ if ($[1] === Symbol.for("react.memo_cache_sentinel")) {
3256
+ t1 = {
3257
+ flexShrink: 0,
3258
+ display: "flex",
3259
+ alignItems: "center",
3260
+ justifyContent: "end",
3261
+ minHeight: 52,
3262
+ gap: .25,
3263
+ p: .75,
3264
+ boxSizing: "border-box",
3265
+ borderBottom: 1,
3266
+ borderColor: "divider"
3267
+ };
3268
+ $[1] = t1;
3269
+ } else t1 = $[1];
3270
+ let t2;
3271
+ if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
3272
+ t2 = {
3273
+ flex: 1,
3274
+ minWidth: 0,
3275
+ display: "flex",
3276
+ alignItems: "center",
3277
+ gap: 1,
3278
+ mx: .5
3279
+ };
3280
+ $[2] = t2;
3281
+ } else t2 = $[2];
3282
+ let t3;
3283
+ if ($[3] !== title) {
3284
+ t3 = title && /* @__PURE__ */ jsx(Typography, {
3285
+ variant: "body1",
3286
+ noWrap: true,
3287
+ sx: { fontWeight: "medium" },
3288
+ children: title
3289
+ });
3290
+ $[3] = title;
3291
+ $[4] = t3;
3292
+ } else t3 = $[4];
3293
+ let t4;
3294
+ if ($[5] !== t || $[6] !== table) {
3295
+ t4 = () => {
3296
+ const count = table.getSelectedRowIds().length;
3297
+ if (!count) return null;
3298
+ return /* @__PURE__ */ jsx(Typography, {
3299
+ variant: "body2",
3300
+ noWrap: true,
3301
+ color: "primary",
3302
+ children: t("Layout.Table.SelectedCount", { count })
3303
+ });
3304
+ };
3305
+ $[5] = t;
3306
+ $[6] = table;
3307
+ $[7] = t4;
3308
+ } else t4 = $[7];
3309
+ let t5;
3310
+ if ($[8] !== t4 || $[9] !== table.atoms.rowSelection) {
3311
+ t5 = /* @__PURE__ */ jsx(Subscribe, {
3312
+ source: table.atoms.rowSelection,
3313
+ children: t4
3314
+ });
3315
+ $[8] = t4;
3316
+ $[9] = table.atoms.rowSelection;
3317
+ $[10] = t5;
3318
+ } else t5 = $[10];
3319
+ let t6;
3320
+ if ($[11] !== t3 || $[12] !== t5) {
3321
+ t6 = /* @__PURE__ */ jsxs(Box, {
3322
+ sx: t2,
3323
+ children: [t3, t5]
3324
+ });
3325
+ $[11] = t3;
3326
+ $[12] = t5;
3327
+ $[13] = t6;
3328
+ } else t6 = $[13];
3329
+ let t7;
3330
+ if ($[14] !== actions) {
3331
+ t7 = actions && /* @__PURE__ */ jsx(ToolbarDivider, {});
3332
+ $[14] = actions;
3333
+ $[15] = t7;
3334
+ } else t7 = $[15];
3335
+ let t8;
3336
+ if ($[16] !== disableColumnSelector) {
3337
+ t8 = !disableColumnSelector && /* @__PURE__ */ jsx(ColumnsPanel, {});
3338
+ $[16] = disableColumnSelector;
3339
+ $[17] = t8;
3340
+ } else t8 = $[17];
3341
+ let t9;
3342
+ if ($[18] !== disableColumnFilter) {
3343
+ t9 = !disableColumnFilter && /* @__PURE__ */ jsx(FiltersMenu, {});
3344
+ $[18] = disableColumnFilter;
3345
+ $[19] = t9;
3346
+ } else t9 = $[19];
3347
+ let t10;
3348
+ if ($[20] !== disableSearch) {
3349
+ t10 = !disableSearch && /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(ToolbarDivider, {}), /* @__PURE__ */ jsx(GlobalFilter, {})] });
3350
+ $[20] = disableSearch;
3351
+ $[21] = t10;
3352
+ } else t10 = $[21];
3353
+ let t11;
3354
+ if ($[22] !== actions || $[23] !== t10 || $[24] !== t6 || $[25] !== t7 || $[26] !== t8 || $[27] !== t9) {
3355
+ t11 = /* @__PURE__ */ jsxs(Box, {
3356
+ role: "toolbar",
3357
+ "aria-orientation": "horizontal",
3358
+ sx: t1,
3359
+ children: [
3360
+ t6,
3361
+ actions,
3362
+ t7,
3363
+ t8,
3364
+ t9,
3365
+ t10
3366
+ ]
3367
+ });
3368
+ $[22] = actions;
3369
+ $[23] = t10;
3370
+ $[24] = t6;
3371
+ $[25] = t7;
3372
+ $[26] = t8;
3373
+ $[27] = t9;
3374
+ $[28] = t11;
3375
+ } else t11 = $[28];
3376
+ return t11;
3377
+ };
3378
+ //#endregion
3379
+ //#region src/hooks/useLayoutTable.tsx
3380
+ const { appFeatures, createAppColumnHelper: createLayoutColumnHelper, useAppTable: useLayoutTable } = createTableHook({
3381
+ features: layoutTableFeatures,
3382
+ tableContext,
3383
+ cellContext,
3384
+ headerContext,
3385
+ getRowId: (row) => row.id,
3386
+ defaultColumn: {
3387
+ filterFn: dynamicFilterFn,
3388
+ aggregatedCell: () => /* @__PURE__ */ jsx(AggregatedCell, {})
3389
+ },
3390
+ globalFilterFn,
3391
+ columnResizeMode: "onChange",
3392
+ isMultiSortEvent: (e) => {
3393
+ const { ctrlKey, metaKey, shiftKey } = e;
3394
+ return ctrlKey || metaKey || shiftKey;
3395
+ },
3396
+ tableComponents: {
3397
+ ColumnsPanel,
3398
+ FiltersMenu,
3399
+ GlobalFilter,
3400
+ Pagination,
3401
+ Skeleton: Skeleton$1,
3402
+ Toolbar: Toolbar$1
3403
+ },
3404
+ cellComponents: {
3405
+ ActionsCell,
3406
+ AggregatedCell,
3407
+ BooleanCell,
3408
+ DateCell,
3409
+ DateTimeCell,
3410
+ ExpandCell,
3411
+ GroupCell,
3412
+ NumberCell,
3413
+ PinRowCell,
3414
+ SelectCell,
3415
+ ValueCell
3416
+ },
3417
+ headerComponents: {
3418
+ AggregationFooter,
3419
+ ExpandAllCell,
3420
+ HeaderMenu,
3421
+ HeaderResizeHandle,
3422
+ HeaderSortLabel,
3423
+ SelectAllCell
3424
+ }
3425
+ });
3426
+ //#endregion
3427
+ export { createLayoutColumnHelper, layoutTableFeatures, useCellContext, useDialogs, useFieldContext, useFormContext, useHeaderContext, useInView, useLayoutForm, useLayoutTable, useScanDetection, useTableContext, useTranslation, withLayoutForm };
1089
3428
 
1090
3429
  //# sourceMappingURL=hooks.mjs.map