@natoora-libs/core 0.1.10 → 0.1.13-dev-doug-2

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.
@@ -371,6 +371,7 @@ __export(components_exports, {
371
371
  ScrollableDialog: () => ScrollableDialog_default,
372
372
  SearchAndFilterHeader: () => SearchAndFilterHeader_default,
373
373
  SearchAndFilterHeaderForTable: () => SearchAndFilterHeaderForTable_default,
374
+ SearchFieldDebounced: () => SearchFieldDebounced,
374
375
  SearchWithFilters: () => SearchWithFilters_default,
375
376
  SearchWithFiltersForTable: () => SearchWithFiltersForTable_default,
376
377
  SectionName: () => SectionName_default,
@@ -382,6 +383,9 @@ __export(components_exports, {
382
383
  Switch: () => Switch_default,
383
384
  Table: () => Table_default,
384
385
  TableDesktop: () => TableDesktop_default,
386
+ TableDesktopFooter: () => TableDesktopFooter,
387
+ TableDesktopRowCell: () => TableDesktopRowCell,
388
+ TableDesktopSmartSelect: () => TableDesktopSmartSelect,
385
389
  TableEmptyResult: () => TableEmptyResult_default,
386
390
  TableHeader: () => TableHeader_default,
387
391
  TableLoading: () => TableLoading_default,
@@ -525,70 +529,6 @@ var AlertDialogFullScreen_default = AlertDialogFullScreen;
525
529
  var import_material4 = require("@mui/material");
526
530
  var import_mui2 = require("tss-react/mui");
527
531
 
528
- // src/resources/styles/colors/darkPalette.ts
529
- var darkPalette = {
530
- // General colors
531
- white: "#FFFFFF",
532
- black: "#000000",
533
- // Neutral
534
- neutral50: "#1C1B1A",
535
- neutral100: "#1F1F1F",
536
- neutral150: "#262626",
537
- neutral200: "#2E2E2E",
538
- neutral250: "#383838",
539
- neutral300: "#424242",
540
- neutral400: "#4C4C4C",
541
- neutral500: "#666666",
542
- neutral600: "#808080",
543
- neutral700: "#A3A3A3",
544
- neutral750: "#B3B3B3",
545
- neutral800: "#CCCCCC",
546
- neutral900: "#F5F5F5",
547
- // Input and contrast
548
- contrast: "#FFFFFF",
549
- constrastOpacity50: "rgba(255,255,255,0.5)",
550
- // Icon and Material UI colors
551
- iconSearch: "#B0B0B0",
552
- default: "#444444",
553
- muiPrimary: "#E9FB62",
554
- muiPrimaryBlack: "#FFFFFF",
555
- lightMuiPrimaryColorBackground: "#e9fb6214",
556
- lightBlueBackground: "#e9fb6214",
557
- muiPrimaryAlternate: "#07BAF1",
558
- muiPrimaryHover: "#1890d5",
559
- muiSecondary: "#DE5B99",
560
- muiSecondaryAlternate: "#EC613C",
561
- muiSuccess: "#66BB6A",
562
- muiSuccessAlternate: "#81C784",
563
- // Transparency variants
564
- blackOpacity10: "inherit",
565
- blackOpacity20: "inherit",
566
- blackOpacity30: "inherit",
567
- blackOpacity50: "inherit",
568
- blackOpacity80: "inherit",
569
- primaryOpacity10: "rgba(233, 251, 98, 0.10)",
570
- primaryOpacity20: "rgba(233, 251, 98, 0.20)",
571
- primaryOpacity30: "rgba(233, 251, 98, 0.30)",
572
- secondaryAlternateOpacity30: "rgba(236, 97, 60, .3)",
573
- blueOpacity08: "rgba(25, 118, 210, 0.08)",
574
- whiteOpacity10: "rgba(255,255,255,0.1)",
575
- whiteOpacity20: "rgba(255,255,255,0.2)",
576
- whiteOpacity40: "rgba(255,255,255,0.4)",
577
- // Table rows and top bar
578
- topBar: "#2e3133",
579
- // Button colors
580
- // Round Button (default)
581
- buttonHoverBackground: "rgba(255, 255, 255, 0.08)",
582
- // Active Button
583
- buttonActiveText: "#E9FB62",
584
- // Contrast Button
585
- buttonContrastBorder: "#CECECE",
586
- buttonContrastText: "#CECECE",
587
- // Error Button
588
- error: "#EF5350"
589
- };
590
- var darkPalette_default = darkPalette;
591
-
592
532
  // src/resources/styles/colors/lightPalette.ts
593
533
  var lightPalette = {
594
534
  // General colors
@@ -654,9 +594,8 @@ var lightPalette = {
654
594
  var lightPalette_default = lightPalette;
655
595
 
656
596
  // src/resources/styles/colors.ts
657
- var stylesheet = localStorage.getItem("@stylesheet");
658
- var isDarkModeEnabled = stylesheet === "styles/style-dark.css";
659
- var palette = isDarkModeEnabled ? darkPalette_default : lightPalette_default;
597
+ var isDarkModeEnabled = false;
598
+ var palette = lightPalette_default;
660
599
  var colors = {
661
600
  white: palette.white,
662
601
  black: palette.black,
@@ -3078,7 +3017,7 @@ var RoundButton = ({
3078
3017
  onClick(e);
3079
3018
  }
3080
3019
  };
3081
- const Button14 = /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
3020
+ const Button15 = /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
3082
3021
  import_material16.Fab,
3083
3022
  {
3084
3023
  className: cx(
@@ -3102,7 +3041,7 @@ var RoundButton = ({
3102
3041
  children: icon ? iconComponentMap[icon] : children || ""
3103
3042
  }
3104
3043
  );
3105
- return tooltip ? /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(import_material16.Tooltip, { title: tooltip, children: Button14 }) : Button14;
3044
+ return tooltip ? /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(import_material16.Tooltip, { title: tooltip, children: Button15 }) : Button15;
3106
3045
  };
3107
3046
  var RoundButton_default = RoundButton;
3108
3047
 
@@ -6494,11 +6433,60 @@ var SearchAndFilterHeaderForTable = (props) => {
6494
6433
  };
6495
6434
  var SearchAndFilterHeaderForTable_default = React4.memo(SearchAndFilterHeaderForTable);
6496
6435
 
6436
+ // src/components/SearchFieldDebounced/SearchFieldDebounced.tsx
6437
+ var import_react28 = require("react");
6438
+ var import_material53 = require("@mui/material");
6439
+ var import_Search = __toESM(require("@mui/icons-material/Search"), 1);
6440
+ var import_jsx_runtime104 = require("react/jsx-runtime");
6441
+ var SearchFieldDebounced = ({
6442
+ onSearch,
6443
+ initialValue = "",
6444
+ debounceDelay = 500
6445
+ }) => {
6446
+ const [value, setValue] = (0, import_react28.useState)(initialValue);
6447
+ const debounceRef = (0, import_react28.useRef)(null);
6448
+ const handleChange = (e) => {
6449
+ setValue(e.target.value);
6450
+ if (debounceRef.current) {
6451
+ clearTimeout(debounceRef.current);
6452
+ }
6453
+ ;
6454
+ debounceRef.current = window.setTimeout(() => {
6455
+ onSearch(e.target.value);
6456
+ }, debounceDelay);
6457
+ };
6458
+ (0, import_react28.useEffect)(() => {
6459
+ return () => {
6460
+ if (debounceRef.current) clearTimeout(debounceRef.current);
6461
+ };
6462
+ }, []);
6463
+ return /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(import_material53.Box, { width: 285, children: /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(
6464
+ import_material53.TextField,
6465
+ {
6466
+ fullWidth: true,
6467
+ variant: "outlined",
6468
+ placeholder: "Search",
6469
+ value,
6470
+ onChange: handleChange,
6471
+ slotProps: {
6472
+ input: {
6473
+ sx: {
6474
+ maxHeight: 5,
6475
+ px: 2,
6476
+ py: 2.5
6477
+ },
6478
+ startAdornment: /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(import_material53.InputAdornment, { position: "start", children: /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(import_Search.default, { fontSize: "small" }) })
6479
+ }
6480
+ }
6481
+ }
6482
+ ) });
6483
+ };
6484
+
6497
6485
  // src/components/SectionName/SectionName.tsx
6498
6486
  var import_icons_material11 = require("@mui/icons-material");
6499
- var import_material53 = require("@mui/material");
6487
+ var import_material54 = require("@mui/material");
6500
6488
  var import_mui48 = require("tss-react/mui");
6501
- var import_jsx_runtime104 = require("react/jsx-runtime");
6489
+ var import_jsx_runtime105 = require("react/jsx-runtime");
6502
6490
  var useStyles43 = (0, import_mui48.makeStyles)()((theme) => ({
6503
6491
  container: {
6504
6492
  display: "flex",
@@ -6541,10 +6529,10 @@ var SectionName = ({
6541
6529
  openHistoryLog
6542
6530
  }) => {
6543
6531
  const { classes } = useStyles43();
6544
- return /* @__PURE__ */ (0, import_jsx_runtime104.jsxs)(import_material53.Box, { className: classes.container, children: [
6545
- /* @__PURE__ */ (0, import_jsx_runtime104.jsxs)(import_material53.Box, { className: classes.titleContainer, children: [
6546
- /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(
6547
- import_material53.Typography,
6532
+ return /* @__PURE__ */ (0, import_jsx_runtime105.jsxs)(import_material54.Box, { className: classes.container, children: [
6533
+ /* @__PURE__ */ (0, import_jsx_runtime105.jsxs)(import_material54.Box, { className: classes.titleContainer, children: [
6534
+ /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(
6535
+ import_material54.Typography,
6548
6536
  {
6549
6537
  variant: "h5",
6550
6538
  component: "a",
@@ -6553,7 +6541,7 @@ var SectionName = ({
6553
6541
  children: name
6554
6542
  }
6555
6543
  ),
6556
- tooltipDescription ? /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(import_material53.Tooltip, { title: tooltipDescription, placement: "right", children: /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(
6544
+ tooltipDescription ? /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(import_material54.Tooltip, { title: tooltipDescription, placement: "right", children: /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(
6557
6545
  import_icons_material11.Info,
6558
6546
  {
6559
6547
  fontSize: "small",
@@ -6562,8 +6550,8 @@ var SectionName = ({
6562
6550
  }
6563
6551
  ) }) : null
6564
6552
  ] }),
6565
- /* @__PURE__ */ (0, import_jsx_runtime104.jsxs)(import_material53.Box, { className: classes.actionButtons, children: [
6566
- buttonText ? /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(
6553
+ /* @__PURE__ */ (0, import_jsx_runtime105.jsxs)(import_material54.Box, { className: classes.actionButtons, children: [
6554
+ buttonText ? /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(
6567
6555
  ExtendedButton_default,
6568
6556
  {
6569
6557
  type: buttonType,
@@ -6576,25 +6564,25 @@ var SectionName = ({
6576
6564
  variant: "text"
6577
6565
  }
6578
6566
  ) : null,
6579
- openHistoryLog && buttonText && /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(import_material53.Divider, { orientation: "vertical", sx: { height: "24px" } }),
6580
- openHistoryLog && /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(import_material53.IconButton, { size: "small", onClick: () => openHistoryLog(), children: /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(import_icons_material11.History, {}) })
6567
+ openHistoryLog && buttonText && /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(import_material54.Divider, { orientation: "vertical", sx: { height: "24px" } }),
6568
+ openHistoryLog && /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(import_material54.IconButton, { size: "small", onClick: () => openHistoryLog(), children: /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(import_icons_material11.History, {}) })
6581
6569
  ] })
6582
6570
  ] });
6583
6571
  };
6584
6572
  var SectionName_default = SectionName;
6585
6573
 
6586
6574
  // src/components/SmartSelect/SmartSelect.tsx
6587
- var import_react28 = require("react");
6588
- var import_material54 = require("@mui/material");
6575
+ var import_react29 = require("react");
6576
+ var import_material55 = require("@mui/material");
6589
6577
  var import_mui49 = require("tss-react/mui");
6590
- var import_jsx_runtime105 = require("react/jsx-runtime");
6578
+ var import_jsx_runtime106 = require("react/jsx-runtime");
6591
6579
  var useStyles44 = (0, import_mui49.makeStyles)()(() => ({
6592
6580
  container: {
6593
6581
  display: "flex",
6594
6582
  flexDirection: "column"
6595
6583
  }
6596
6584
  }));
6597
- var SmartSelect = (0, import_react28.forwardRef)(
6585
+ var SmartSelect = (0, import_react29.forwardRef)(
6598
6586
  ({
6599
6587
  value,
6600
6588
  defaultOption,
@@ -6613,9 +6601,9 @@ var SmartSelect = (0, import_react28.forwardRef)(
6613
6601
  menuProps
6614
6602
  }, ref) => {
6615
6603
  const { classes } = useStyles44();
6616
- const [open, setOpen] = (0, import_react28.useState)(false);
6617
- const [localOptions, setLocalOptions] = (0, import_react28.useState)(options || []);
6618
- (0, import_react28.useEffect)(() => {
6604
+ const [open, setOpen] = (0, import_react29.useState)(false);
6605
+ const [localOptions, setLocalOptions] = (0, import_react29.useState)(options || []);
6606
+ (0, import_react29.useEffect)(() => {
6619
6607
  if (options) {
6620
6608
  setLocalOptions(options);
6621
6609
  }
@@ -6654,8 +6642,8 @@ var SmartSelect = (0, import_react28.forwardRef)(
6654
6642
  onChange(selectedOption);
6655
6643
  }
6656
6644
  };
6657
- return /* @__PURE__ */ (0, import_jsx_runtime105.jsxs)(
6658
- import_material54.FormControl,
6645
+ return /* @__PURE__ */ (0, import_jsx_runtime106.jsxs)(
6646
+ import_material55.FormControl,
6659
6647
  {
6660
6648
  fullWidth: true,
6661
6649
  className: classes.container,
@@ -6664,21 +6652,21 @@ var SmartSelect = (0, import_react28.forwardRef)(
6664
6652
  "data-testid": dataTestId,
6665
6653
  disabled,
6666
6654
  children: [
6667
- inputLabel && /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(
6668
- import_material54.InputLabel,
6655
+ inputLabel && /* @__PURE__ */ (0, import_jsx_runtime106.jsx)(
6656
+ import_material55.InputLabel,
6669
6657
  {
6670
6658
  id: "smart-select-label",
6671
6659
  "data-testid": `${dataTestId}-label`,
6672
6660
  children: inputLabel
6673
6661
  }
6674
6662
  ),
6675
- /* @__PURE__ */ (0, import_jsx_runtime105.jsxs)(
6676
- import_material54.Select,
6663
+ /* @__PURE__ */ (0, import_jsx_runtime106.jsxs)(
6664
+ import_material55.Select,
6677
6665
  {
6678
6666
  ref,
6679
6667
  disabled,
6680
6668
  labelId: "smart-select-label",
6681
- value,
6669
+ value: value ?? "",
6682
6670
  onChange: handleChange,
6683
6671
  onOpen: handleOpen,
6684
6672
  error,
@@ -6689,26 +6677,26 @@ var SmartSelect = (0, import_react28.forwardRef)(
6689
6677
  MenuProps: menuProps,
6690
6678
  label: inputLabel,
6691
6679
  children: [
6692
- isFetching && /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(
6693
- import_material54.MenuItem,
6680
+ isFetching && /* @__PURE__ */ (0, import_jsx_runtime106.jsx)(
6681
+ import_material55.MenuItem,
6694
6682
  {
6695
6683
  disabled: true,
6696
6684
  "data-testid": `${dataTestId}-loading`,
6697
6685
  id: `${dataTestId}-loading`,
6698
- children: /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(import_material54.CircularProgress, { size: 24 })
6686
+ children: /* @__PURE__ */ (0, import_jsx_runtime106.jsx)(import_material55.CircularProgress, { size: 24 })
6699
6687
  }
6700
6688
  ),
6701
- (defaultOption === null || !defaultOptionLabelIsValid || !defaultOptionValueIsValid) && !isFetching && options?.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(import_material54.MenuItem, { disabled: true, "data-testid": `${dataTestId}-empty-message`, children: emptyMessage }),
6702
- localOptions.length === 0 && !isFetching && options?.length !== 0 && defaultOptionLabelIsValid && defaultOptionValueIsValid && /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(
6703
- import_material54.MenuItem,
6689
+ (defaultOption === null || !defaultOptionLabelIsValid || !defaultOptionValueIsValid) && !isFetching && options?.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime106.jsx)(import_material55.MenuItem, { disabled: true, "data-testid": `${dataTestId}-empty-message`, children: emptyMessage }),
6690
+ localOptions.length === 0 && !isFetching && options?.length !== 0 && defaultOptionLabelIsValid && defaultOptionValueIsValid && /* @__PURE__ */ (0, import_jsx_runtime106.jsx)(
6691
+ import_material55.MenuItem,
6704
6692
  {
6705
6693
  value: defaultOption?.value,
6706
6694
  "data-testid": `${dataTestId}-default-option`,
6707
6695
  children: defaultOption?.label
6708
6696
  }
6709
6697
  ),
6710
- !isFetching && combinedOptions.length > 0 && combinedOptions.map((option) => /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(
6711
- import_material54.MenuItem,
6698
+ !isFetching && combinedOptions.length > 0 && combinedOptions.map((option) => /* @__PURE__ */ (0, import_jsx_runtime106.jsx)(
6699
+ import_material55.MenuItem,
6712
6700
  {
6713
6701
  value: option?.value,
6714
6702
  "data-testid": `${dataTestId}-option-${option?.value}`,
@@ -6720,7 +6708,7 @@ var SmartSelect = (0, import_react28.forwardRef)(
6720
6708
  ]
6721
6709
  }
6722
6710
  ),
6723
- helperText && /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(import_material54.FormHelperText, { "data-testid": `${dataTestId}-helper-text`, children: helperText })
6711
+ helperText && /* @__PURE__ */ (0, import_jsx_runtime106.jsx)(import_material55.FormHelperText, { "data-testid": `${dataTestId}-helper-text`, children: helperText })
6724
6712
  ]
6725
6713
  }
6726
6714
  );
@@ -6729,11 +6717,11 @@ var SmartSelect = (0, import_react28.forwardRef)(
6729
6717
  var SmartSelect_default = SmartSelect;
6730
6718
 
6731
6719
  // src/components/SquareLabel/SquareLabel.tsx
6732
- var import_react29 = require("react");
6733
- var import_material55 = require("@mui/material");
6720
+ var import_react30 = require("react");
6721
+ var import_material56 = require("@mui/material");
6734
6722
  var import_red2 = __toESM(require("@mui/material/colors/red"), 1);
6735
6723
  var import_mui50 = require("tss-react/mui");
6736
- var import_jsx_runtime106 = require("react/jsx-runtime");
6724
+ var import_jsx_runtime107 = require("react/jsx-runtime");
6737
6725
  var useStyles45 = (0, import_mui50.makeStyles)()((theme) => ({
6738
6726
  red: {
6739
6727
  backgroundColor: import_red2.default["50"],
@@ -6748,15 +6736,15 @@ var useStyles45 = (0, import_mui50.makeStyles)()((theme) => ({
6748
6736
  }));
6749
6737
  var SquareLabel = ({ color, copy }) => {
6750
6738
  const { classes } = useStyles45();
6751
- return /* @__PURE__ */ (0, import_jsx_runtime106.jsx)(import_material55.Typography, { className: classes[color], children: copy });
6739
+ return /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(import_material56.Typography, { className: classes[color], children: copy });
6752
6740
  };
6753
- var SquareLabel_default = (0, import_react29.memo)(SquareLabel);
6741
+ var SquareLabel_default = (0, import_react30.memo)(SquareLabel);
6754
6742
 
6755
6743
  // src/components/Switch/Switch.tsx
6756
- var import_react30 = require("react");
6757
- var import_material56 = require("@mui/material");
6744
+ var import_react31 = require("react");
6745
+ var import_material57 = require("@mui/material");
6758
6746
  var import_mui51 = require("tss-react/mui");
6759
- var import_jsx_runtime107 = require("react/jsx-runtime");
6747
+ var import_jsx_runtime108 = require("react/jsx-runtime");
6760
6748
  var LSwitch = ({
6761
6749
  checked,
6762
6750
  labelOn,
@@ -6764,8 +6752,8 @@ var LSwitch = ({
6764
6752
  handleChange,
6765
6753
  classes,
6766
6754
  disabled
6767
- }) => /* @__PURE__ */ (0, import_jsx_runtime107.jsx)("div", { className: classes.c_switch, children: /* @__PURE__ */ (0, import_jsx_runtime107.jsxs)(
6768
- import_material56.Grid2,
6755
+ }) => /* @__PURE__ */ (0, import_jsx_runtime108.jsx)("div", { className: classes.c_switch, children: /* @__PURE__ */ (0, import_jsx_runtime108.jsxs)(
6756
+ import_material57.Grid2,
6769
6757
  {
6770
6758
  component: "label",
6771
6759
  container: true,
@@ -6774,9 +6762,9 @@ var LSwitch = ({
6774
6762
  alignItems: "center"
6775
6763
  },
6776
6764
  children: [
6777
- labelOff && /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(import_material56.Grid2, { children: labelOff }),
6778
- /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(import_material56.Grid2, { children: /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(
6779
- import_material56.Switch,
6765
+ labelOff && /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(import_material57.Grid2, { children: labelOff }),
6766
+ /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(import_material57.Grid2, { children: /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(
6767
+ import_material57.Switch,
6780
6768
  {
6781
6769
  checked,
6782
6770
  color: "primary",
@@ -6784,7 +6772,7 @@ var LSwitch = ({
6784
6772
  disabled
6785
6773
  }
6786
6774
  ) }),
6787
- labelOn && /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(import_material56.Grid2, { children: labelOn })
6775
+ labelOn && /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(import_material57.Grid2, { children: labelOn })
6788
6776
  ]
6789
6777
  }
6790
6778
  ) });
@@ -6806,380 +6794,679 @@ var LabelledSwitch = (0, import_mui51.withStyles)(LSwitch, (theme) => ({
6806
6794
  fontSize: "1rem"
6807
6795
  }
6808
6796
  }));
6809
- var Switch_default = (0, import_react30.memo)(LabelledSwitch);
6797
+ var Switch_default = (0, import_react31.memo)(LabelledSwitch);
6810
6798
 
6811
6799
  // src/components/SmartTableHeaderFilterMenu/SmartTableHeaderFilterMenu.tsx
6812
- var import_react31 = require("react");
6800
+ var import_react34 = require("react");
6813
6801
  var import_Check = __toESM(require("@mui/icons-material/Check"), 1);
6814
- var import_material57 = require("@mui/material");
6802
+ var import_material61 = require("@mui/material");
6815
6803
  var import_classnames3 = __toESM(require("classnames"), 1);
6804
+ var import_mui55 = require("tss-react/mui");
6805
+
6806
+ // src/components/TableDesktop/TableDesktop.tsx
6807
+ var import_react33 = require("react");
6808
+ var import_material60 = require("@mui/material");
6809
+ var import_mui54 = require("tss-react/mui");
6810
+
6811
+ // src/components/SmartTableHeader/SmartTableHeader.tsx
6812
+ var import_react32 = require("react");
6813
+ var import_material58 = require("@mui/material");
6816
6814
  var import_mui52 = require("tss-react/mui");
6817
- var import_jsx_runtime108 = require("react/jsx-runtime");
6815
+ var import_jsx_runtime109 = require("react/jsx-runtime");
6818
6816
  var useStyles46 = (0, import_mui52.makeStyles)()((theme) => ({
6819
- filterMenu: {
6820
- display: "flex",
6821
- flexDirection: "column"
6817
+ root: {
6818
+ backgroundColor: colors.neutral100,
6819
+ height: theme.spacing(6),
6820
+ "& .MuiTableSortLabel-root": {
6821
+ fontWeight: 600,
6822
+ fontSize: ".875rem"
6823
+ }
6822
6824
  },
6823
- filterOptions: {
6824
- maxHeight: theme.spacing(62),
6825
- overflowY: "auto",
6826
- "&::-webkit-scrollbar": {
6827
- width: "8px",
6828
- height: "8px"
6829
- },
6830
- "&::-webkit-scrollbar-track": {
6831
- backgroundColor: theme.palette.mode === "dark" ? theme.palette.grey[800] : theme.palette.grey[100]
6825
+ visuallyHidden: {
6826
+ border: 0,
6827
+ clip: "rect(0 0 0 0)",
6828
+ height: 1,
6829
+ margin: -1,
6830
+ overflow: "hidden",
6831
+ padding: 0,
6832
+ position: "absolute",
6833
+ top: 20,
6834
+ width: 1
6835
+ },
6836
+ tableHeaderContent: {
6837
+ borderBottom: "1px solid",
6838
+ borderBottomColor: colors.neutral300,
6839
+ whiteSpace: "nowrap",
6840
+ "& .filter-menu-trigger": {
6841
+ visibility: "hidden",
6842
+ opacity: 0,
6843
+ transition: "visibility 0.1s, opacity 0.1s ease-in"
6832
6844
  },
6833
- "&::-webkit-scrollbar-thumb": {
6834
- backgroundColor: theme.palette.mode === "dark" ? theme.palette.grey[900] : theme.palette.grey[400],
6835
- borderRadius: "10px"
6845
+ "&:hover .filter-menu-trigger, & .filter-menu-trigger.has-active-filters": {
6846
+ visibility: "visible",
6847
+ opacity: 1
6836
6848
  },
6837
- "&::-webkit-scrollbar-thumb:hover": {
6838
- backgroundColor: theme.palette.mode === "dark" ? theme.palette.common.black : theme.palette.grey[500]
6849
+ "&:hover .MuiTableSortLabel-root": {
6850
+ "& .MuiTableSortLabel-icon": {
6851
+ opacity: 1
6852
+ }
6839
6853
  }
6840
6854
  },
6841
- filter: {
6855
+ filterMenu: {
6842
6856
  display: "flex",
6843
- alignItems: "center",
6844
- justifyContent: "space-between",
6857
+ flexDirection: "column",
6858
+ gap: theme.spacing(0.5)
6859
+ },
6860
+ filterCheckboxDropdown: {
6861
+ display: "flex",
6862
+ flexDirection: "column",
6845
6863
  padding: theme.spacing(0, 3)
6846
6864
  },
6847
6865
  applyFilterButtonsContainer: {
6848
6866
  display: "flex",
6849
6867
  padding: theme.spacing(0, 1)
6850
- },
6851
- saveAsDefaultButton: {
6852
- color: theme.palette.primary.main
6853
- },
6854
- skeleton: {
6855
- height: theme.spacing(3),
6856
- margin: theme.spacing(1)
6857
6868
  }
6858
6869
  }));
6859
- var resolveFilterOption = (filterOption) => {
6860
- if (typeof filterOption === "object") {
6861
- return filterOption?.label || filterOption?.name || "";
6862
- }
6863
- return filterOption;
6864
- };
6865
- var findFilterIndex = (filters, filterOption) => filters.findIndex((item) => {
6866
- if (typeof item === "string" && typeof filterOption === "string") {
6867
- return item === filterOption;
6868
- }
6869
- if (typeof item === "object" && typeof filterOption === "object") {
6870
- return item.id === filterOption.id;
6871
- }
6872
- return false;
6873
- });
6874
- var SmartTableHeaderFilterMenu = ({
6875
- headCell,
6876
- numActiveFilters,
6870
+ var SmartTableHeader = ({
6871
+ order,
6872
+ orderBy,
6873
+ headCells,
6874
+ numSelected,
6875
+ numRows,
6876
+ enableCheckboxSelection = false,
6877
6877
  headerFilters,
6878
- shouldShowCheckOnFilter,
6879
- onApplyFilters
6878
+ onRequestSort,
6879
+ onSelectAllClick,
6880
+ onApplyFilters,
6881
+ shouldShowCheckOnFilter
6880
6882
  }) => {
6881
6883
  const { classes } = useStyles46();
6882
- const [anchorEl, setAnchorEl] = (0, import_react31.useState)(null);
6883
- const [selectedFilters, setSelectedFilters] = (0, import_react31.useState)(
6884
- headerFilters[headCell.id] ?? []
6885
- );
6886
- const filterOptions = headCell.filterOptionsQuery?.data ?? [];
6887
- const numFilterOptions = filterOptions.length ?? 0;
6888
- const numCurrentSelectedFilters = selectedFilters.length;
6889
- const handleFilterMenuOpen = (event) => {
6890
- if (!numFilterOptions) {
6891
- headCell.filterOptionsQuery?.refetch();
6892
- }
6893
- setAnchorEl(event.currentTarget);
6894
- };
6895
- const handleFilterMenuClose = () => {
6896
- setSelectedFilters(headerFilters[headCell.id]);
6897
- setAnchorEl(null);
6898
- };
6899
- const handleFilterOptionClick = (option) => {
6900
- const selectedIndex = findFilterIndex(selectedFilters, option);
6901
- let newSelected;
6902
- if (selectedIndex === -1) {
6903
- if (typeof option === "string") {
6904
- newSelected = [...selectedFilters, option];
6905
- } else {
6906
- newSelected = [...selectedFilters, option];
6907
- }
6908
- } else {
6909
- newSelected = selectedFilters.filter(
6910
- (_, index) => index !== selectedIndex
6911
- );
6912
- }
6913
- setSelectedFilters(newSelected);
6914
- };
6915
- const handleApplyFilters = (shouldSave) => {
6916
- const updatedFilters = {
6917
- ...headerFilters,
6918
- [headCell.id]: [...selectedFilters]
6919
- };
6920
- onApplyFilters?.(updatedFilters, shouldSave);
6921
- setAnchorEl(null);
6884
+ const createSortHandler = (property) => (event) => {
6885
+ onRequestSort(event, property);
6922
6886
  };
6923
- (0, import_react31.useEffect)(() => {
6924
- setSelectedFilters(headerFilters[headCell.id] ?? []);
6925
- }, [headerFilters, headCell.id]);
6926
- const isOptionChecked = (0, import_react31.useMemo)(() => (resolvedOption) => !!selectedFilters?.some(
6927
- (value) => resolveFilterOption(value) === resolvedOption
6928
- ), [selectedFilters]);
6929
- const loadingSkeletons = /* @__PURE__ */ (0, import_jsx_runtime108.jsxs)(import_material57.Box, { "data-testid": "loading-skeletons", width: 272, children: [
6930
- /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(import_material57.Skeleton, { variant: "rounded", className: classes.skeleton }),
6931
- /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(import_material57.Divider, {}),
6932
- /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(import_material57.Skeleton, { variant: "rounded", className: classes.skeleton }),
6933
- /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(import_material57.Skeleton, { variant: "rounded", className: classes.skeleton }),
6934
- /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(import_material57.Skeleton, { variant: "rounded", className: classes.skeleton }),
6935
- /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(import_material57.Skeleton, { variant: "rounded", className: classes.skeleton }),
6936
- /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(import_material57.Divider, {}),
6937
- /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(import_material57.Skeleton, { variant: "rounded", className: classes.skeleton })
6938
- ] });
6939
- return /* @__PURE__ */ (0, import_jsx_runtime108.jsxs)(import_jsx_runtime108.Fragment, { children: [
6940
- /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(
6941
- ActiveFiltersIconButton_default,
6887
+ const isSortActive = (headCellId) => orderBy === headCellId;
6888
+ return /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(import_material58.TableHead, { className: classes.root, children: /* @__PURE__ */ (0, import_jsx_runtime109.jsxs)(import_material58.TableRow, { children: [
6889
+ enableCheckboxSelection ? /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(import_material58.TableCell, { padding: "checkbox", children: /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(
6890
+ import_material58.Checkbox,
6942
6891
  {
6943
- numActiveFilters,
6944
- handleClick: handleFilterMenuOpen,
6945
- className: (0, import_classnames3.default)("filter-menu-trigger", {
6946
- "has-active-filters": !!numActiveFilters || !!anchorEl
6947
- })
6892
+ color: "primary",
6893
+ disableRipple: true,
6894
+ indeterminate: numSelected > 0 && numSelected < numRows,
6895
+ checked: numRows > 0 && numSelected === numRows,
6896
+ onChange: onSelectAllClick
6948
6897
  }
6949
- ),
6950
- /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(
6951
- import_material57.Menu,
6898
+ ) }) : null,
6899
+ headCells.map((headCell) => /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(
6900
+ import_material58.TableCell,
6952
6901
  {
6953
- open: !!anchorEl,
6954
- onClose: handleFilterMenuClose,
6955
- anchorEl,
6956
- "data-testid": "filter-menu",
6957
- anchorOrigin: { vertical: "bottom", horizontal: "right" },
6958
- transformOrigin: { vertical: "top", horizontal: "right" },
6959
- children: headCell.filterOptionsQuery?.isFetching ? loadingSkeletons : /* @__PURE__ */ (0, import_jsx_runtime108.jsxs)(import_material57.Box, { className: classes.filterMenu, children: [
6960
- /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(import_material57.Box, { px: 3, mb: 0.5, children: /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(
6961
- import_material57.FormControlLabel,
6962
- {
6963
- label: "Select All",
6964
- control: /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(
6965
- import_material57.Checkbox,
6902
+ className: classes.tableHeaderContent,
6903
+ align: "left",
6904
+ width: headCell.width ?? "auto",
6905
+ sortDirection: orderBy === headCell.id ? order : false,
6906
+ children: /* @__PURE__ */ (0, import_jsx_runtime109.jsxs)(
6907
+ import_material58.Box,
6908
+ {
6909
+ display: "flex",
6910
+ flexDirection: "row",
6911
+ gap: headCell.disableSort ? 1 : 0,
6912
+ children: [
6913
+ headCell.disableSort ? /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(import_material58.Typography, { variant: "subtitle2", mt: 0.25, fontWeight: 600, children: headCell.label }) : /* @__PURE__ */ (0, import_jsx_runtime109.jsxs)(
6914
+ import_material58.TableSortLabel,
6966
6915
  {
6967
- disableRipple: true,
6968
- checked: numCurrentSelectedFilters === numFilterOptions,
6969
- indeterminate: numCurrentSelectedFilters > 0 && numCurrentSelectedFilters < numFilterOptions,
6970
- onChange: ({ target: { checked } }) => {
6971
- if (checked) {
6972
- setSelectedFilters([...filterOptions]);
6973
- } else {
6974
- setSelectedFilters([]);
6975
- }
6976
- }
6977
- }
6978
- )
6979
- }
6980
- ) }),
6981
- /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(import_material57.Divider, { sx: { mb: 0.5 } }),
6982
- /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(import_material57.Box, { className: classes.filterOptions, children: filterOptions.map(
6983
- (option) => {
6984
- const resolvedOption = resolveFilterOption(option);
6985
- return /* @__PURE__ */ (0, import_jsx_runtime108.jsxs)(
6986
- import_material57.Box,
6987
- {
6988
- className: classes.filter,
6916
+ "data-testid": "table-sort-label",
6917
+ active: isSortActive(headCell.id),
6918
+ direction: orderBy === headCell.id ? order : "asc",
6919
+ onClick: createSortHandler(headCell.id),
6989
6920
  children: [
6990
- /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(
6991
- import_material57.FormControlLabel,
6992
- {
6993
- label: resolvedOption,
6994
- control: /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(
6995
- import_material57.Checkbox,
6996
- {
6997
- disableRipple: true,
6998
- onChange: () => handleFilterOptionClick(option),
6999
- checked: isOptionChecked(resolvedOption)
7000
- }
7001
- )
7002
- },
7003
- resolvedOption
7004
- ),
7005
- shouldShowCheckOnFilter?.(headCell.id, option) ? /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(import_material57.Tooltip, { title: "This filter is saved as default", children: /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(import_Check.default, { fontSize: "small", color: "action" }) }) : null
6921
+ headCell.RenderHeader ?? headCell.label,
6922
+ orderBy === headCell.id ? /* @__PURE__ */ (0, import_jsx_runtime109.jsx)("span", { className: classes.visuallyHidden, children: order === "desc" ? "sorted descending" : "sorted ascending" }) : null
7006
6923
  ]
7007
- },
7008
- resolvedOption
7009
- );
7010
- }
7011
- ) }),
7012
- /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(import_material57.Divider, { sx: { mb: 0.5 } }),
7013
- /* @__PURE__ */ (0, import_jsx_runtime108.jsxs)(import_material57.Box, { className: classes.applyFilterButtonsContainer, children: [
7014
- /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(
7015
- ExtendedButton_default,
7016
- {
7017
- copy: "Save as Default",
7018
- buttonType: "button",
7019
- variant: "text",
7020
- tooltip: "Persists those filters for future visits",
7021
- className: classes.saveAsDefaultButton,
7022
- onClick: () => handleApplyFilters(true)
7023
- }
7024
- ),
7025
- /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(
7026
- ExtendedButton_default,
7027
- {
7028
- copy: "Apply",
7029
- color: "primary",
7030
- buttonType: "submit",
7031
- onClick: () => handleApplyFilters(false)
7032
- }
7033
- )
7034
- ] })
7035
- ] })
7036
- }
7037
- )
7038
- ] });
6924
+ }
6925
+ ),
6926
+ headCell.refetchFilterOptions ? /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(
6927
+ SmartTableHeaderFilterMenu_default,
6928
+ {
6929
+ headCell,
6930
+ headerFilters,
6931
+ numActiveFilters: headerFilters[headCell.id]?.length ?? 0,
6932
+ onApplyFilters,
6933
+ shouldShowCheckOnFilter
6934
+ }
6935
+ ) : null
6936
+ ]
6937
+ }
6938
+ )
6939
+ },
6940
+ headCell.id
6941
+ ))
6942
+ ] }) });
7039
6943
  };
7040
- var SmartTableHeaderFilterMenu_default = (0, import_react31.memo)(SmartTableHeaderFilterMenu);
6944
+ var SmartTableHeader_default = (0, import_react32.memo)(SmartTableHeader);
7041
6945
 
7042
- // src/components/SmartTableHeader/SmartTableHeader.tsx
7043
- var import_react32 = require("react");
7044
- var import_material58 = require("@mui/material");
6946
+ // src/components/TableEmptyResult/TableEmptyResult.tsx
6947
+ var import_material59 = require("@mui/material");
7045
6948
  var import_mui53 = require("tss-react/mui");
7046
- var import_jsx_runtime109 = require("react/jsx-runtime");
7047
- var useStyles47 = (0, import_mui53.makeStyles)()((theme) => ({
7048
- root: {
7049
- backgroundColor: colors.neutral100,
7050
- height: theme.spacing(6),
7051
- "& .MuiTableSortLabel-root": {
7052
- fontWeight: 600,
7053
- fontSize: ".875rem"
6949
+ var import_jsx_runtime110 = require("react/jsx-runtime");
6950
+ var useStyles47 = (0, import_mui53.makeStyles)()(() => ({
6951
+ tableCellIcon: { padding: 24, height: "calc(100vh - 320px)" },
6952
+ tableCellDefault: { padding: 24 }
6953
+ }));
6954
+ var TableEmptyResult = ({
6955
+ colSpan,
6956
+ showClearFilterButton = false,
6957
+ handleClickOnClearFiltersButton = () => {
6958
+ }
6959
+ }) => {
6960
+ const { classes } = useStyles47();
6961
+ return showClearFilterButton ? /* @__PURE__ */ (0, import_jsx_runtime110.jsx)(import_material59.TableRow, { children: /* @__PURE__ */ (0, import_jsx_runtime110.jsxs)(
6962
+ import_material59.TableCell,
6963
+ {
6964
+ className: classes.tableCellIcon,
6965
+ colSpan,
6966
+ align: "center",
6967
+ children: [
6968
+ /* @__PURE__ */ (0, import_jsx_runtime110.jsx)(EmptyGlassIcon_default, {}),
6969
+ /* @__PURE__ */ (0, import_jsx_runtime110.jsx)(import_material59.Typography, { variant: "h6", children: "No results found." }),
6970
+ /* @__PURE__ */ (0, import_jsx_runtime110.jsx)(import_material59.Typography, { variant: "subtitle1", children: "Search without applied filters?" }),
6971
+ /* @__PURE__ */ (0, import_jsx_runtime110.jsx)(
6972
+ FilledButton_default,
6973
+ {
6974
+ copy: "Search",
6975
+ variant: "contained",
6976
+ color: "primary",
6977
+ onClick: handleClickOnClearFiltersButton
6978
+ }
6979
+ )
6980
+ ]
7054
6981
  }
6982
+ ) }) : /* @__PURE__ */ (0, import_jsx_runtime110.jsx)(import_material59.TableRow, { children: /* @__PURE__ */ (0, import_jsx_runtime110.jsx)(
6983
+ import_material59.TableCell,
6984
+ {
6985
+ className: classes.tableCellDefault,
6986
+ colSpan,
6987
+ align: "center",
6988
+ children: "Nothing to display"
6989
+ }
6990
+ ) });
6991
+ };
6992
+ var TableEmptyResult_default = TableEmptyResult;
6993
+
6994
+ // src/components/TableDesktop/TableDesktop.tsx
6995
+ var import_jsx_runtime111 = require("react/jsx-runtime");
6996
+ var ROW_HEIGHT = 56;
6997
+ var useStyles48 = (0, import_mui54.makeStyles)()((theme) => ({
6998
+ root: {
6999
+ justifyContent: "space-between",
7000
+ display: "flex",
7001
+ justifyItems: "stretch"
7055
7002
  },
7056
- visuallyHidden: {
7057
- border: 0,
7058
- clip: "rect(0 0 0 0)",
7059
- height: 1,
7060
- margin: -1,
7061
- overflow: "hidden",
7062
- padding: 0,
7063
- position: "absolute",
7064
- top: 20,
7065
- width: 1
7003
+ paper: {
7004
+ width: "100%",
7005
+ display: "flex",
7006
+ flexDirection: "column",
7007
+ justifyContent: "space-between"
7066
7008
  },
7067
- tableHeaderContent: {
7068
- borderBottom: "1px solid",
7069
- borderBottomColor: colors.neutral250,
7070
- whiteSpace: "nowrap",
7071
- "& .filter-menu-trigger": {
7072
- visibility: "hidden",
7073
- opacity: 0,
7074
- transition: "visibility 0.1s, opacity 0.1s ease-in"
7009
+ container: {
7010
+ maxHeight: "100%",
7011
+ "&::-webkit-scrollbar": {
7012
+ width: "8px",
7013
+ height: "8px"
7075
7014
  },
7076
- "&:hover .filter-menu-trigger, & .filter-menu-trigger.has-active-filters": {
7077
- visibility: "visible",
7078
- opacity: 1
7015
+ "&::-webkit-scrollbar-track": {
7016
+ backgroundColor: theme.palette.mode === "dark" ? theme.palette.grey[800] : theme.palette.grey[100]
7079
7017
  },
7080
- "&:hover .MuiTableSortLabel-root": {
7081
- "& .MuiTableSortLabel-icon": {
7082
- opacity: 1
7018
+ "&::-webkit-scrollbar-thumb": {
7019
+ backgroundColor: theme.palette.mode === "dark" ? theme.palette.grey[900] : theme.palette.grey[400],
7020
+ borderRadius: "10px"
7021
+ },
7022
+ "&::-webkit-scrollbar-thumb:hover": {
7023
+ backgroundColor: theme.palette.mode === "dark" ? theme.palette.common.black : theme.palette.grey[500]
7024
+ }
7025
+ }
7026
+ }));
7027
+ var descendingComparator = (a, b, orderBy) => {
7028
+ const objA = a[orderBy];
7029
+ const objB = b[orderBy];
7030
+ const valA = typeof objA === "object" ? objA?.name : objA;
7031
+ const valB = typeof objB === "object" ? objB?.name : objB;
7032
+ if (!valA && !valB) {
7033
+ return 0;
7034
+ }
7035
+ if (valA && !valB) {
7036
+ return -1;
7037
+ }
7038
+ if (!valA && valB) {
7039
+ return 1;
7040
+ }
7041
+ if (valA > valB) {
7042
+ return -1;
7043
+ }
7044
+ if (valA < valB) {
7045
+ return 1;
7046
+ }
7047
+ return 0;
7048
+ };
7049
+ var stableSort = (array, cmp) => array.map((el, index) => ({ el, index })).sort((a, b) => {
7050
+ const order = cmp(a.el, b.el);
7051
+ return order !== 0 ? order : a.index - b.index;
7052
+ }).map((el) => el.el);
7053
+ var getComparator = (order, orderBy) => order === "desc" ? (a, b) => descendingComparator(a, b, orderBy) : (a, b) => -descendingComparator(a, b, orderBy);
7054
+ var resolveOptionType = (option, fieldName) => {
7055
+ if (!option || typeof option !== "object") {
7056
+ return option;
7057
+ }
7058
+ return option[fieldName] || "";
7059
+ };
7060
+ var TableDesktop = ({
7061
+ data,
7062
+ headCells,
7063
+ RenderItem,
7064
+ appliedFilters,
7065
+ headerFilters,
7066
+ children,
7067
+ height,
7068
+ isLoading,
7069
+ rowsPerPage = 50,
7070
+ enableCheckboxSelection = false,
7071
+ disableInternalSort = false,
7072
+ updateSort,
7073
+ showClearFilterButton,
7074
+ handleClickOnClearFiltersButton,
7075
+ deleteItem,
7076
+ keyField = "id",
7077
+ tableLayout = "auto",
7078
+ onApplyFilters,
7079
+ shouldShowCheckOnFilter
7080
+ }) => {
7081
+ const { classes } = useStyles48();
7082
+ const [order, setOrder] = (0, import_react33.useState)(appliedFilters?.sortDir || "desc");
7083
+ const [orderBy, setOrderBy] = (0, import_react33.useState)(
7084
+ appliedFilters?.sortField || "delivery_date"
7085
+ );
7086
+ const [selected, setSelected] = (0, import_react33.useState)(/* @__PURE__ */ new Set());
7087
+ const [page] = (0, import_react33.useState)(0);
7088
+ const numRows = data.length;
7089
+ const emptyRows = (0, import_react33.useMemo)(
7090
+ () => rowsPerPage - data.length,
7091
+ [rowsPerPage, data]
7092
+ );
7093
+ const visibleHeadCells = (0, import_react33.useMemo)(
7094
+ () => headCells.filter((headCell) => headCell?.enabled ?? true),
7095
+ [headCells]
7096
+ );
7097
+ const handleSelectAllClick = (0, import_react33.useCallback)(
7098
+ (event) => {
7099
+ if (event.target.checked) {
7100
+ const allItems = new Set(data.map((n) => n[keyField]));
7101
+ setSelected(allItems);
7102
+ } else {
7103
+ setSelected(/* @__PURE__ */ new Set());
7083
7104
  }
7105
+ },
7106
+ [data, keyField]
7107
+ );
7108
+ const handleRequestSort = (event, property) => {
7109
+ const isAsc = orderBy === property && order === "asc";
7110
+ const orderDir = isAsc ? "desc" : "asc";
7111
+ setOrder(orderDir);
7112
+ setOrderBy(property);
7113
+ if (updateSort) {
7114
+ updateSort(property, orderDir);
7084
7115
  }
7085
- },
7116
+ };
7117
+ const handleRowCheckboxChange = (0, import_react33.useCallback)(
7118
+ (event, keyFieldValue) => {
7119
+ event.stopPropagation();
7120
+ setSelected((prev) => {
7121
+ const newSelected = new Set(prev);
7122
+ if (newSelected.has(keyFieldValue)) {
7123
+ newSelected.delete(keyFieldValue);
7124
+ } else {
7125
+ newSelected.add(keyFieldValue);
7126
+ }
7127
+ return newSelected;
7128
+ });
7129
+ },
7130
+ []
7131
+ );
7132
+ const renderTableRows = (0, import_react33.useMemo)(() => {
7133
+ if (isLoading) {
7134
+ return [...Array(Math.min(numRows, rowsPerPage))].map((_, rowIndex) => /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(import_material60.TableRow, { children: [...Array(visibleHeadCells.length)].map((_2, cellIndex) => /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(import_material60.TableCell, { children: /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(
7135
+ import_material60.Skeleton,
7136
+ {
7137
+ animation: "pulse",
7138
+ variant: "rounded",
7139
+ height: ROW_HEIGHT - 33,
7140
+ sx: { bgcolor: colors.neutral100 },
7141
+ "data-testid": "loading-skeleton"
7142
+ }
7143
+ ) }, cellIndex)) }, rowIndex));
7144
+ }
7145
+ const sortedData = disableInternalSort ? data : stableSort(data, getComparator(order, orderBy));
7146
+ return sortedData.slice(page * rowsPerPage, page * rowsPerPage + rowsPerPage).map((row, index) => {
7147
+ const isItemSelected = selected.has(row[keyField]);
7148
+ return /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(
7149
+ RenderItem,
7150
+ {
7151
+ ...{
7152
+ ...row,
7153
+ index,
7154
+ deleteItem,
7155
+ isItemSelected,
7156
+ enableCheckboxSelection,
7157
+ rowHeight: ROW_HEIGHT,
7158
+ rowId: row[keyField],
7159
+ handleRowCheckboxChange,
7160
+ visibleHeadCells
7161
+ }
7162
+ },
7163
+ row[keyField] ?? index
7164
+ );
7165
+ });
7166
+ }, [
7167
+ data,
7168
+ order,
7169
+ orderBy,
7170
+ page,
7171
+ rowsPerPage,
7172
+ selected,
7173
+ isLoading,
7174
+ numRows,
7175
+ enableCheckboxSelection,
7176
+ disableInternalSort,
7177
+ deleteItem,
7178
+ keyField,
7179
+ handleRowCheckboxChange,
7180
+ visibleHeadCells,
7181
+ RenderItem
7182
+ ]);
7183
+ (0, import_react33.useEffect)(() => {
7184
+ if (!enableCheckboxSelection) {
7185
+ setSelected(/* @__PURE__ */ new Set());
7186
+ }
7187
+ }, [enableCheckboxSelection]);
7188
+ return /* @__PURE__ */ (0, import_jsx_runtime111.jsx)("div", { className: classes.root, style: { height }, children: /* @__PURE__ */ (0, import_jsx_runtime111.jsxs)(import_material60.Paper, { className: classes.paper, children: [
7189
+ /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(import_material60.TableContainer, { className: classes.container, children: /* @__PURE__ */ (0, import_jsx_runtime111.jsxs)(
7190
+ import_material60.Table,
7191
+ {
7192
+ stickyHeader: true,
7193
+ "aria-labelledby": "tableTitle",
7194
+ "aria-label": "sticky table",
7195
+ style: { tableLayout },
7196
+ children: [
7197
+ /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(
7198
+ SmartTableHeader_default,
7199
+ {
7200
+ headCells: visibleHeadCells,
7201
+ order,
7202
+ orderBy,
7203
+ numSelected: selected.size,
7204
+ numRows,
7205
+ enableCheckboxSelection,
7206
+ headerFilters: headerFilters ?? {},
7207
+ onRequestSort: handleRequestSort,
7208
+ onSelectAllClick: handleSelectAllClick,
7209
+ onApplyFilters,
7210
+ shouldShowCheckOnFilter
7211
+ }
7212
+ ),
7213
+ /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(import_material60.TableBody, { children: rowsPerPage !== emptyRows ? renderTableRows : /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(
7214
+ TableEmptyResult_default,
7215
+ {
7216
+ colSpan: enableCheckboxSelection ? visibleHeadCells.length + 1 : visibleHeadCells.length,
7217
+ showClearFilterButton,
7218
+ handleClickOnClearFiltersButton
7219
+ }
7220
+ ) })
7221
+ ]
7222
+ }
7223
+ ) }),
7224
+ children
7225
+ ] }) });
7226
+ };
7227
+ var TableDesktop_default = TableDesktop;
7228
+
7229
+ // src/components/SmartTableHeaderFilterMenu/SmartTableHeaderFilterMenu.tsx
7230
+ var import_jsx_runtime112 = require("react/jsx-runtime");
7231
+ var useStyles49 = (0, import_mui55.makeStyles)()((theme) => ({
7086
7232
  filterMenu: {
7087
7233
  display: "flex",
7088
- flexDirection: "column",
7089
- gap: theme.spacing(0.5)
7234
+ flexDirection: "column"
7090
7235
  },
7091
- filterCheckboxDropdown: {
7236
+ filterOptions: {
7237
+ maxHeight: theme.spacing(62),
7238
+ overflowY: "auto",
7239
+ "&::-webkit-scrollbar": {
7240
+ width: "8px",
7241
+ height: "8px"
7242
+ },
7243
+ "&::-webkit-scrollbar-track": {
7244
+ backgroundColor: theme.palette.mode === "dark" ? theme.palette.grey[800] : theme.palette.grey[100]
7245
+ },
7246
+ "&::-webkit-scrollbar-thumb": {
7247
+ backgroundColor: theme.palette.mode === "dark" ? theme.palette.grey[900] : theme.palette.grey[400],
7248
+ borderRadius: "10px"
7249
+ },
7250
+ "&::-webkit-scrollbar-thumb:hover": {
7251
+ backgroundColor: theme.palette.mode === "dark" ? theme.palette.common.black : theme.palette.grey[500]
7252
+ }
7253
+ },
7254
+ filter: {
7092
7255
  display: "flex",
7093
- flexDirection: "column",
7256
+ alignItems: "center",
7257
+ justifyContent: "space-between",
7094
7258
  padding: theme.spacing(0, 3)
7095
7259
  },
7096
7260
  applyFilterButtonsContainer: {
7097
7261
  display: "flex",
7098
- padding: theme.spacing(0, 1)
7262
+ padding: theme.spacing(0, 1),
7263
+ justifyContent: "space-between"
7264
+ },
7265
+ saveAsDefaultButton: {
7266
+ color: theme.palette.primary.main
7267
+ },
7268
+ skeleton: {
7269
+ height: theme.spacing(3),
7270
+ margin: theme.spacing(1)
7099
7271
  }
7100
7272
  }));
7101
- var SmartTableHeader = ({
7102
- order,
7103
- orderBy,
7104
- headCells,
7105
- numSelected,
7106
- numRows,
7107
- enableCheckboxSelection = false,
7273
+ var findFilterIndex = (filters, filterOption) => filters.findIndex((item) => {
7274
+ if (typeof item === "string" && typeof filterOption === "string") {
7275
+ return item === filterOption;
7276
+ }
7277
+ if (typeof item === "object" && typeof filterOption === "object") {
7278
+ return item.id === filterOption.id;
7279
+ }
7280
+ return false;
7281
+ });
7282
+ var SmartTableHeaderFilterMenu = ({
7283
+ headCell,
7284
+ numActiveFilters,
7108
7285
  headerFilters,
7109
- onRequestSort,
7110
- onSelectAllClick,
7111
- onApplyFilters,
7112
- shouldShowCheckOnFilter
7286
+ shouldShowCheckOnFilter,
7287
+ onApplyFilters
7113
7288
  }) => {
7114
- const { classes } = useStyles47();
7115
- const createSortHandler = (property) => (event) => {
7116
- onRequestSort(event, property);
7289
+ const { classes } = useStyles49();
7290
+ const [anchorEl, setAnchorEl] = (0, import_react34.useState)(null);
7291
+ const [filterOptionsData, setFilterOptionsData] = (0, import_react34.useState)();
7292
+ const [selectedFilters, setSelectedFilters] = (0, import_react34.useState)(
7293
+ headerFilters[headCell.id] ?? []
7294
+ );
7295
+ (0, import_react34.useEffect)(() => {
7296
+ if (headCell.filterOptions) {
7297
+ setFilterOptionsData(headCell.filterOptions);
7298
+ }
7299
+ }, [headCell.filterOptions]);
7300
+ const numFilterOptions = (0, import_react34.useMemo)(() => filterOptionsData?.length ?? 0, [filterOptionsData?.length]);
7301
+ const numCurrentSelectedFilters = selectedFilters.length;
7302
+ const handleFilterMenuOpen = (event) => {
7303
+ if (!numFilterOptions) {
7304
+ headCell.refetchFilterOptions?.();
7305
+ }
7306
+ setAnchorEl(event.currentTarget);
7117
7307
  };
7118
- const isSortActive = (headCellId) => orderBy === headCellId;
7119
- return /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(import_material58.TableHead, { className: classes.root, children: /* @__PURE__ */ (0, import_jsx_runtime109.jsxs)(import_material58.TableRow, { children: [
7120
- enableCheckboxSelection ? /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(import_material58.TableCell, { padding: "checkbox", children: /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(
7121
- import_material58.Checkbox,
7308
+ const handleFilterMenuClose = () => {
7309
+ setSelectedFilters(headerFilters[headCell.id]);
7310
+ setAnchorEl(null);
7311
+ };
7312
+ const handleFilterOptionClick = (option) => {
7313
+ const selectedIndex = findFilterIndex(selectedFilters, option);
7314
+ let newSelected;
7315
+ if (selectedIndex === -1) {
7316
+ if (typeof option === "string") {
7317
+ newSelected = [...selectedFilters, option];
7318
+ } else {
7319
+ newSelected = [...selectedFilters, option];
7320
+ }
7321
+ } else {
7322
+ newSelected = selectedFilters.filter(
7323
+ (_, index) => index !== selectedIndex
7324
+ );
7325
+ }
7326
+ setSelectedFilters(newSelected);
7327
+ };
7328
+ const handleApplyFilters = (shouldSave) => {
7329
+ const updatedFilters = {
7330
+ ...headerFilters,
7331
+ [headCell.id]: [...selectedFilters]
7332
+ };
7333
+ onApplyFilters?.(updatedFilters, shouldSave);
7334
+ setAnchorEl(null);
7335
+ };
7336
+ (0, import_react34.useEffect)(() => {
7337
+ setSelectedFilters(headerFilters[headCell.id] ?? []);
7338
+ }, [headerFilters, headCell.id]);
7339
+ const isOptionChecked = (0, import_react34.useMemo)(() => (resolvedOption) => !!selectedFilters?.some(
7340
+ (value) => resolveOptionType(value, headCell.fieldName ?? "") === resolvedOption
7341
+ ), [selectedFilters]);
7342
+ const loadingSkeletons = /* @__PURE__ */ (0, import_jsx_runtime112.jsxs)(import_material61.Box, { "data-testid": "loading-skeletons", width: 272, children: [
7343
+ /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(import_material61.Skeleton, { variant: "rounded", className: classes.skeleton }),
7344
+ /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(import_material61.Divider, {}),
7345
+ /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(import_material61.Skeleton, { variant: "rounded", className: classes.skeleton }),
7346
+ /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(import_material61.Skeleton, { variant: "rounded", className: classes.skeleton }),
7347
+ /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(import_material61.Skeleton, { variant: "rounded", className: classes.skeleton }),
7348
+ /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(import_material61.Skeleton, { variant: "rounded", className: classes.skeleton }),
7349
+ /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(import_material61.Divider, {}),
7350
+ /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(import_material61.Skeleton, { variant: "rounded", className: classes.skeleton })
7351
+ ] });
7352
+ return /* @__PURE__ */ (0, import_jsx_runtime112.jsxs)(import_jsx_runtime112.Fragment, { children: [
7353
+ /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(
7354
+ ActiveFiltersIconButton_default,
7122
7355
  {
7123
- color: "primary",
7124
- indeterminate: numSelected > 0 && numSelected < numRows,
7125
- checked: numRows > 0 && numSelected === numRows,
7126
- onChange: onSelectAllClick
7356
+ numActiveFilters,
7357
+ handleClick: handleFilterMenuOpen,
7358
+ className: (0, import_classnames3.default)("filter-menu-trigger", {
7359
+ "has-active-filters": !!numActiveFilters || !!anchorEl
7360
+ })
7127
7361
  }
7128
- ) }) : null,
7129
- headCells.map((headCell) => /* @__PURE__ */ (0, import_jsx_runtime109.jsxs)(
7130
- import_material58.TableCell,
7362
+ ),
7363
+ /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(
7364
+ import_material61.Menu,
7131
7365
  {
7132
- className: classes.tableHeaderContent,
7133
- align: "left",
7134
- sx: { width: headCell.width ?? "auto" },
7135
- sortDirection: orderBy === headCell.id ? order : false,
7136
- children: [
7137
- /* @__PURE__ */ (0, import_jsx_runtime109.jsxs)(
7138
- import_material58.TableSortLabel,
7366
+ open: !!anchorEl,
7367
+ onClose: handleFilterMenuClose,
7368
+ anchorEl,
7369
+ "data-testid": "filter-menu",
7370
+ anchorOrigin: { vertical: "bottom", horizontal: "right" },
7371
+ transformOrigin: { vertical: "top", horizontal: "right" },
7372
+ children: headCell.isFetchingFilterOptions ? loadingSkeletons : /* @__PURE__ */ (0, import_jsx_runtime112.jsxs)(import_material61.Box, { className: classes.filterMenu, children: [
7373
+ /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(import_material61.Box, { px: 3, mb: 0.5, children: /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(
7374
+ import_material61.FormControlLabel,
7139
7375
  {
7140
- "data-testid": "table-sort-label",
7141
- active: isSortActive(headCell.id),
7142
- direction: orderBy === headCell.id ? order : "asc",
7143
- onClick: createSortHandler(headCell.id),
7144
- children: [
7145
- headCell.renderHeader ?? headCell.label,
7146
- orderBy === headCell.id ? /* @__PURE__ */ (0, import_jsx_runtime109.jsx)("span", { className: classes.visuallyHidden, children: order === "desc" ? "sorted descending" : "sorted ascending" }) : null
7147
- ]
7376
+ label: "Select All",
7377
+ control: /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(
7378
+ import_material61.Checkbox,
7379
+ {
7380
+ disableRipple: true,
7381
+ checked: numCurrentSelectedFilters === numFilterOptions,
7382
+ indeterminate: numCurrentSelectedFilters > 0 && numCurrentSelectedFilters < numFilterOptions,
7383
+ onChange: ({ target: { checked } }) => {
7384
+ if (checked) {
7385
+ setSelectedFilters([...filterOptionsData]);
7386
+ } else {
7387
+ setSelectedFilters([]);
7388
+ }
7389
+ }
7390
+ }
7391
+ )
7148
7392
  }
7149
- ),
7150
- headCell.filterOptionsQuery ? /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(
7151
- SmartTableHeaderFilterMenu_default,
7152
- {
7153
- headCell,
7154
- headerFilters,
7155
- numActiveFilters: headerFilters[headCell.id]?.length ?? 0,
7156
- onApplyFilters,
7157
- shouldShowCheckOnFilter
7393
+ ) }),
7394
+ /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(import_material61.Divider, { sx: { mb: 0.5 } }),
7395
+ /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(import_material61.Box, { className: classes.filterOptions, children: filterOptionsData?.map(
7396
+ (option) => {
7397
+ const resolvedOption = resolveOptionType(option, headCell.fieldName ?? "");
7398
+ return /* @__PURE__ */ (0, import_jsx_runtime112.jsxs)(
7399
+ import_material61.Box,
7400
+ {
7401
+ className: classes.filter,
7402
+ children: [
7403
+ /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(
7404
+ import_material61.FormControlLabel,
7405
+ {
7406
+ label: resolvedOption,
7407
+ control: /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(
7408
+ import_material61.Checkbox,
7409
+ {
7410
+ disableRipple: true,
7411
+ onChange: () => handleFilterOptionClick(option),
7412
+ checked: isOptionChecked(resolvedOption)
7413
+ }
7414
+ )
7415
+ },
7416
+ resolvedOption
7417
+ ),
7418
+ shouldShowCheckOnFilter?.(headCell.id, option) ? /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(import_material61.Tooltip, { title: "This filter is saved as default", children: /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(import_Check.default, { fontSize: "small", color: "action" }) }) : null
7419
+ ]
7420
+ },
7421
+ resolvedOption
7422
+ );
7158
7423
  }
7159
- ) : null
7160
- ]
7161
- },
7162
- headCell.id
7163
- ))
7164
- ] }) });
7424
+ ) }),
7425
+ /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(import_material61.Divider, { sx: { mb: 0.5 } }),
7426
+ /* @__PURE__ */ (0, import_jsx_runtime112.jsxs)(import_material61.Box, { className: classes.applyFilterButtonsContainer, children: [
7427
+ /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(
7428
+ ExtendedButton_default,
7429
+ {
7430
+ copy: "Save as Default",
7431
+ buttonType: "button",
7432
+ variant: "text",
7433
+ tooltip: "Persists those filters for future visits",
7434
+ className: classes.saveAsDefaultButton,
7435
+ onClick: () => handleApplyFilters(true)
7436
+ }
7437
+ ),
7438
+ /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(
7439
+ ExtendedButton_default,
7440
+ {
7441
+ copy: "Apply",
7442
+ color: "primary",
7443
+ buttonType: "submit",
7444
+ onClick: () => handleApplyFilters(false)
7445
+ }
7446
+ )
7447
+ ] })
7448
+ ] })
7449
+ }
7450
+ )
7451
+ ] });
7165
7452
  };
7166
- var SmartTableHeader_default = (0, import_react32.memo)(SmartTableHeader);
7453
+ var SmartTableHeaderFilterMenu_default = (0, import_react34.memo)(SmartTableHeaderFilterMenu);
7167
7454
 
7168
7455
  // src/components/Table/Table.tsx
7169
- var import_react33 = require("react");
7170
- var import_material60 = require("@mui/material");
7456
+ var import_react35 = require("react");
7457
+ var import_material63 = require("@mui/material");
7171
7458
  var import_debounce = __toESM(require_debounce(), 1);
7172
- var import_mui54 = require("tss-react/mui");
7459
+ var import_mui56 = require("tss-react/mui");
7173
7460
  var import_uuid = require("uuid");
7174
7461
 
7175
7462
  // src/components/TableLoading/TableLoading.tsx
7176
- var import_material59 = require("@mui/material");
7177
- var import_jsx_runtime110 = require("react/jsx-runtime");
7463
+ var import_material62 = require("@mui/material");
7464
+ var import_jsx_runtime113 = require("react/jsx-runtime");
7178
7465
  var TableLoading = ({
7179
7466
  rowsPerPage,
7180
7467
  rowHeight
7181
- }) => /* @__PURE__ */ (0, import_jsx_runtime110.jsx)(import_material59.Box, { children: Array.from({ length: rowsPerPage ?? 0 }).map((_, index) => /* @__PURE__ */ (0, import_jsx_runtime110.jsx)(
7182
- import_material59.Skeleton,
7468
+ }) => /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(import_material62.Box, { children: Array.from({ length: rowsPerPage ?? 0 }).map((_, index) => /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(
7469
+ import_material62.Skeleton,
7183
7470
  {
7184
7471
  animation: "pulse",
7185
7472
  "data-testid": "table-loading-skeleton",
@@ -7192,7 +7479,7 @@ var TableLoading = ({
7192
7479
  var TableLoading_default = TableLoading;
7193
7480
 
7194
7481
  // src/components/Table/helpers.tsx
7195
- function stableSort(array, cmp) {
7482
+ function stableSort2(array, cmp) {
7196
7483
  const stabilizedThis = array.map((el, index) => [el, index]);
7197
7484
  stabilizedThis.sort((a, b) => {
7198
7485
  const order = cmp(a[0], b[0]);
@@ -7203,7 +7490,7 @@ function stableSort(array, cmp) {
7203
7490
  });
7204
7491
  return stabilizedThis.map((el) => el[0]);
7205
7492
  }
7206
- function descendingComparator(a, b, orderBy) {
7493
+ function descendingComparator2(a, b, orderBy) {
7207
7494
  if (b[orderBy] < a[orderBy]) {
7208
7495
  return -1;
7209
7496
  }
@@ -7213,7 +7500,7 @@ function descendingComparator(a, b, orderBy) {
7213
7500
  return 0;
7214
7501
  }
7215
7502
  function getSorting(order, orderBy) {
7216
- return order === "desc" ? (a, b) => descendingComparator(a, b, orderBy) : (a, b) => -descendingComparator(a, b, orderBy);
7503
+ return order === "desc" ? (a, b) => descendingComparator2(a, b, orderBy) : (a, b) => -descendingComparator2(a, b, orderBy);
7217
7504
  }
7218
7505
  function calculateRowsPerPage(rowHeight) {
7219
7506
  const appContainerDom = document.getElementById("mainContainer");
@@ -7227,8 +7514,8 @@ function calculateRowsPerPage(rowHeight) {
7227
7514
  }
7228
7515
 
7229
7516
  // src/components/Table/Table.tsx
7230
- var import_jsx_runtime111 = require("react/jsx-runtime");
7231
- var useStyles48 = (0, import_mui54.makeStyles)()(() => ({
7517
+ var import_jsx_runtime114 = require("react/jsx-runtime");
7518
+ var useStyles50 = (0, import_mui56.makeStyles)()(() => ({
7232
7519
  root: {
7233
7520
  height: "calc(100vh - 262px)",
7234
7521
  overflow: "scroll"
@@ -7249,7 +7536,7 @@ var useStyles48 = (0, import_mui54.makeStyles)()(() => ({
7249
7536
  maxHeight: "calc(100% - 0)"
7250
7537
  }
7251
7538
  }));
7252
- var Table = ({
7539
+ var Table2 = ({
7253
7540
  appliedFilters,
7254
7541
  data,
7255
7542
  doNotCalculateRows,
@@ -7260,248 +7547,16 @@ var Table = ({
7260
7547
  RenderItem = null,
7261
7548
  rowsPerPage: defaultRowsPerPage = 10,
7262
7549
  serverRendered,
7263
- updateSort
7264
- }) => {
7265
- const [order, setOrder] = (0, import_react33.useState)(appliedFilters?.sortDir || "desc");
7266
- const [orderBy, setOrderBy] = (0, import_react33.useState)(
7267
- appliedFilters?.sortField || "delivery_date"
7268
- );
7269
- const [rowsPerPage, setRowsPerPage] = (0, import_react33.useState)(defaultRowsPerPage);
7270
- const { classes } = useStyles48();
7271
- const rowHeight = 56;
7272
- const emptyRows = rowsPerPage - Math.min(rowsPerPage, data.length - page * rowsPerPage);
7273
- const handleRequestSort = (event, property) => {
7274
- const isAsc = orderBy === property && order === "asc";
7275
- const orderDir = isAsc ? "desc" : "asc";
7276
- setOrder(orderDir);
7277
- setOrderBy(property);
7278
- if (updateSort) {
7279
- updateSort(property, orderDir);
7280
- }
7281
- };
7282
- (0, import_react33.useLayoutEffect)(() => {
7283
- if (!doNotCalculateRows) {
7284
- return;
7285
- }
7286
- function updateRowsPerPage() {
7287
- const newRowsPerPage = calculateRowsPerPage(rowHeight);
7288
- setRowsPerPage(newRowsPerPage);
7289
- }
7290
- updateRowsPerPage();
7291
- const debounced = (0, import_debounce.default)(updateRowsPerPage, 150);
7292
- window.addEventListener("resize", debounced);
7293
- return () => {
7294
- window.removeEventListener("resize", debounced);
7295
- };
7296
- }, [doNotCalculateRows]);
7297
- const createSortHandler = (property) => (event) => {
7298
- handleRequestSort(event, property);
7299
- };
7300
- const getTableRows = () => {
7301
- const index = page;
7302
- const rows = serverRendered ? data : stableSort(data, getSorting(order, orderBy)).slice(
7303
- index * rowsPerPage,
7304
- index * rowsPerPage + rowsPerPage
7305
- );
7306
- const rowsComponents = rows.map((row) => {
7307
- if (RenderItem) {
7308
- return /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(RenderItem, { ...row }, row.id);
7309
- }
7310
- return /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(import_material60.TableRow, { hover: true, onClick: () => onRowClick?.(row), children: headCells?.map((column) => /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(import_material60.TableCell, { children: row[column.id] }, column.id)) }, row.id);
7311
- });
7312
- if (emptyRows > 0 && rowsPerPage > emptyRows) {
7313
- rowsComponents.push(
7314
- /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(import_material60.TableRow, { style: { height: rowHeight * emptyRows }, children: /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(import_material60.TableCell, { colSpan: 8 }) }, (0, import_uuid.v4)())
7315
- );
7316
- }
7317
- return rowsComponents;
7318
- };
7319
- return /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(import_material60.Paper, { className: classes.root, children: /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(import_material60.Box, { className: classes.paper, children: isLoading ? /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(TableLoading_default, { rowHeight, rowsPerPage }) : /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(import_material60.TableContainer, { className: classes.container, children: /* @__PURE__ */ (0, import_jsx_runtime111.jsxs)(import_material60.Table, { size: "medium", stickyHeader: true, children: [
7320
- /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(import_material60.TableHead, { className: classes.header, children: /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(import_material60.TableRow, { children: headCells?.map((headCell) => /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(
7321
- import_material60.TableCell,
7322
- {
7323
- align: "left",
7324
- sortDirection: orderBy === headCell.id ? order : void 0,
7325
- children: /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(
7326
- import_material60.TableSortLabel,
7327
- {
7328
- active: orderBy === headCell.id,
7329
- direction: orderBy === headCell.id ? order : "asc",
7330
- onClick: createSortHandler(headCell.id),
7331
- children: headCell.label
7332
- }
7333
- )
7334
- },
7335
- headCell.id
7336
- )) }) }),
7337
- /* @__PURE__ */ (0, import_jsx_runtime111.jsxs)(import_material60.TableBody, { children: [
7338
- getTableRows(),
7339
- rowsPerPage === emptyRows && /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(import_material60.TableRow, { style: { height: rowHeight * emptyRows }, children: /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(import_material60.TableCell, { colSpan: 8, align: "center", children: "Nothing to display" }) })
7340
- ] })
7341
- ] }) }) }) });
7342
- };
7343
- var Table_default = Table;
7344
-
7345
- // src/components/TableDesktop/TableDesktop.tsx
7346
- var import_react34 = require("react");
7347
- var import_material62 = require("@mui/material");
7348
- var import_mui56 = require("tss-react/mui");
7349
-
7350
- // src/components/TableEmptyResult/TableEmptyResult.tsx
7351
- var import_material61 = require("@mui/material");
7352
- var import_mui55 = require("tss-react/mui");
7353
- var import_jsx_runtime112 = require("react/jsx-runtime");
7354
- var useStyles49 = (0, import_mui55.makeStyles)()(() => ({
7355
- tableCellIcon: { padding: 24, height: "calc(100vh - 320px)" },
7356
- tableCellDefault: { padding: 24 }
7357
- }));
7358
- var TableEmptyResult = ({
7359
- colSpan,
7360
- showClearFilterButton = false,
7361
- handleClickOnClearFiltersButton = () => {
7362
- }
7363
- }) => {
7364
- const { classes } = useStyles49();
7365
- return showClearFilterButton ? /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(import_material61.TableRow, { children: /* @__PURE__ */ (0, import_jsx_runtime112.jsxs)(
7366
- import_material61.TableCell,
7367
- {
7368
- className: classes.tableCellIcon,
7369
- colSpan,
7370
- align: "center",
7371
- children: [
7372
- /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(EmptyGlassIcon_default, {}),
7373
- /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(import_material61.Typography, { variant: "h6", children: "No results found." }),
7374
- /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(import_material61.Typography, { variant: "subtitle1", children: "Search without applied filters?" }),
7375
- /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(
7376
- FilledButton_default,
7377
- {
7378
- copy: "Search",
7379
- variant: "contained",
7380
- color: "primary",
7381
- onClick: handleClickOnClearFiltersButton
7382
- }
7383
- )
7384
- ]
7385
- }
7386
- ) }) : /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(import_material61.TableRow, { children: /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(
7387
- import_material61.TableCell,
7388
- {
7389
- className: classes.tableCellDefault,
7390
- colSpan,
7391
- align: "center",
7392
- children: "Nothing to display"
7393
- }
7394
- ) });
7395
- };
7396
- var TableEmptyResult_default = TableEmptyResult;
7397
-
7398
- // src/components/TableDesktop/TableDesktop.tsx
7399
- var import_jsx_runtime113 = require("react/jsx-runtime");
7400
- var useStyles50 = (0, import_mui56.makeStyles)()((theme) => ({
7401
- root: {
7402
- justifyContent: "space-between",
7403
- display: "flex",
7404
- justifyItems: "stretch"
7405
- },
7406
- paper: {
7407
- width: "100%",
7408
- display: "flex",
7409
- flexDirection: "column",
7410
- justifyContent: "space-between"
7411
- },
7412
- container: {
7413
- maxHeight: "100%",
7414
- "&::-webkit-scrollbar": {
7415
- width: "8px",
7416
- height: "8px"
7417
- },
7418
- "&::-webkit-scrollbar-track": {
7419
- backgroundColor: theme.palette.mode === "dark" ? theme.palette.grey[800] : theme.palette.grey[100]
7420
- },
7421
- "&::-webkit-scrollbar-thumb": {
7422
- backgroundColor: theme.palette.mode === "dark" ? theme.palette.grey[900] : theme.palette.grey[400],
7423
- borderRadius: "10px"
7424
- },
7425
- "&::-webkit-scrollbar-thumb:hover": {
7426
- backgroundColor: theme.palette.mode === "dark" ? theme.palette.common.black : theme.palette.grey[500]
7427
- }
7428
- }
7429
- }));
7430
- var descendingComparator2 = (a, b, orderBy) => {
7431
- const objA = a[orderBy];
7432
- const objB = b[orderBy];
7433
- const valA = typeof objA === "object" ? objA?.name : objA;
7434
- const valB = typeof objB === "object" ? objB?.name : objB;
7435
- if (!valA && !valB) {
7436
- return 0;
7437
- }
7438
- if (valA && !valB) {
7439
- return -1;
7440
- }
7441
- if (!valA && valB) {
7442
- return 1;
7443
- }
7444
- if (valA > valB) {
7445
- return -1;
7446
- }
7447
- if (valA < valB) {
7448
- return 1;
7449
- }
7450
- return 0;
7451
- };
7452
- var stableSort2 = (array, cmp) => array.map((el, index) => ({ el, index })).sort((a, b) => {
7453
- const order = cmp(a.el, b.el);
7454
- return order !== 0 ? order : a.index - b.index;
7455
- }).map((el) => el.el);
7456
- var getComparator = (order, orderBy) => order === "desc" ? (a, b) => descendingComparator2(a, b, orderBy) : (a, b) => -descendingComparator2(a, b, orderBy);
7457
- var TableDesktop = ({
7458
- data,
7459
- headCells,
7460
- RenderItem,
7461
- appliedFilters,
7462
- headerFilters,
7463
- children,
7464
- height,
7465
- isLoading,
7466
- rowsPerPage = 50,
7467
- enableCheckboxSelection = false,
7468
- disableInternalSort = false,
7469
- updateSort,
7470
- showClearFilterButton,
7471
- handleClickOnClearFiltersButton,
7472
- deleteItem,
7473
- keyField = "id",
7474
- tableLayout = "auto",
7475
- onApplyFilters,
7476
- shouldShowCheckOnFilter
7477
- }) => {
7478
- const [order, setOrder] = (0, import_react34.useState)(appliedFilters?.sortDir || "desc");
7479
- const [orderBy, setOrderBy] = (0, import_react34.useState)(
7480
- appliedFilters?.sortField || "delivery_date"
7481
- );
7482
- const [selected, setSelected] = (0, import_react34.useState)([]);
7483
- const [page] = (0, import_react34.useState)(0);
7484
- const { classes } = useStyles50();
7485
- const rowHeight = 56;
7486
- const emptyRows = (0, import_react34.useMemo)(
7487
- () => rowsPerPage - data.length,
7488
- [rowsPerPage, data]
7489
- );
7490
- const visibleHeadCells = (0, import_react34.useMemo)(
7491
- () => headCells.filter((headCell) => headCell?.enabled ?? true),
7492
- [headCells]
7493
- );
7494
- const handleSelectAllClick = (0, import_react34.useCallback)(
7495
- (event) => {
7496
- if (event.target.checked) {
7497
- const newSelected = data.map((n) => n[keyField]);
7498
- setSelected(newSelected);
7499
- return;
7500
- }
7501
- setSelected([]);
7502
- },
7503
- [data, keyField]
7550
+ updateSort
7551
+ }) => {
7552
+ const [order, setOrder] = (0, import_react35.useState)(appliedFilters?.sortDir || "desc");
7553
+ const [orderBy, setOrderBy] = (0, import_react35.useState)(
7554
+ appliedFilters?.sortField || "delivery_date"
7504
7555
  );
7556
+ const [rowsPerPage, setRowsPerPage] = (0, import_react35.useState)(defaultRowsPerPage);
7557
+ const { classes } = useStyles50();
7558
+ const rowHeight = 56;
7559
+ const emptyRows = rowsPerPage - Math.min(rowsPerPage, data.length - page * rowsPerPage);
7505
7560
  const handleRequestSort = (event, property) => {
7506
7561
  const isAsc = orderBy === property && order === "asc";
7507
7562
  const orderDir = isAsc ? "desc" : "asc";
@@ -7511,119 +7566,419 @@ var TableDesktop = ({
7511
7566
  updateSort(property, orderDir);
7512
7567
  }
7513
7568
  };
7514
- const handleRowCheckboxClick = (0, import_react34.useCallback)(
7515
- (event, keyFieldValue) => {
7516
- const selectedIndex = selected.indexOf(keyFieldValue);
7517
- let newSelected = [];
7518
- if (selectedIndex === -1) {
7519
- newSelected = newSelected.concat(selected, keyFieldValue);
7520
- } else if (selectedIndex === 0) {
7521
- newSelected = newSelected.concat(selected.slice(1));
7522
- } else if (selectedIndex === selected.length - 1) {
7523
- newSelected = newSelected.concat(selected.slice(0, -1));
7524
- } else if (selectedIndex > 0) {
7525
- newSelected = newSelected.concat(
7526
- selected.slice(0, selectedIndex),
7527
- selected.slice(selectedIndex + 1)
7528
- );
7569
+ (0, import_react35.useLayoutEffect)(() => {
7570
+ if (!doNotCalculateRows) {
7571
+ return;
7572
+ }
7573
+ function updateRowsPerPage() {
7574
+ const newRowsPerPage = calculateRowsPerPage(rowHeight);
7575
+ setRowsPerPage(newRowsPerPage);
7576
+ }
7577
+ updateRowsPerPage();
7578
+ const debounced = (0, import_debounce.default)(updateRowsPerPage, 150);
7579
+ window.addEventListener("resize", debounced);
7580
+ return () => {
7581
+ window.removeEventListener("resize", debounced);
7582
+ };
7583
+ }, [doNotCalculateRows]);
7584
+ const createSortHandler = (property) => (event) => {
7585
+ handleRequestSort(event, property);
7586
+ };
7587
+ const getTableRows = () => {
7588
+ const index = page;
7589
+ const rows = serverRendered ? data : stableSort2(data, getSorting(order, orderBy)).slice(
7590
+ index * rowsPerPage,
7591
+ index * rowsPerPage + rowsPerPage
7592
+ );
7593
+ const rowsComponents = rows.map((row) => {
7594
+ if (RenderItem) {
7595
+ return /* @__PURE__ */ (0, import_jsx_runtime114.jsx)(RenderItem, { ...row }, row.id);
7529
7596
  }
7530
- setSelected(newSelected);
7531
- },
7532
- [selected]
7533
- );
7534
- const renderTableRows = (0, import_react34.useMemo)(() => {
7535
- const sortedData = disableInternalSort ? data : stableSort2(data, getComparator(order, orderBy));
7536
- return sortedData.slice(page * rowsPerPage, page * rowsPerPage + rowsPerPage).map((row, index) => {
7537
- const isItemSelected = selected.includes(row[keyField]);
7538
- return /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(
7539
- RenderItem,
7540
- {
7541
- ...{
7542
- ...row,
7543
- index,
7544
- deleteItem,
7545
- isItemSelected,
7546
- enableCheckboxSelection,
7547
- keyFieldValue: row[keyField],
7548
- handleRowCheckboxClick,
7549
- visibleHeadCells
7550
- }
7551
- },
7552
- row[keyField] ?? index
7553
- );
7597
+ return /* @__PURE__ */ (0, import_jsx_runtime114.jsx)(import_material63.TableRow, { hover: true, onClick: () => onRowClick?.(row), children: headCells?.map((column) => /* @__PURE__ */ (0, import_jsx_runtime114.jsx)(import_material63.TableCell, { children: row[column.id] }, column.id)) }, row.id);
7554
7598
  });
7555
- }, [
7556
- data,
7557
- order,
7558
- orderBy,
7559
- page,
7560
- rowsPerPage,
7561
- selected,
7562
- enableCheckboxSelection,
7563
- disableInternalSort,
7564
- deleteItem,
7565
- keyField,
7566
- handleRowCheckboxClick,
7567
- visibleHeadCells,
7568
- RenderItem
7569
- ]);
7570
- return /* @__PURE__ */ (0, import_jsx_runtime113.jsx)("div", { className: classes.root, style: { height }, children: /* @__PURE__ */ (0, import_jsx_runtime113.jsxs)(import_material62.Paper, { className: classes.paper, children: [
7571
- isLoading ? /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(import_material62.Box, { width: "100%", overflow: "hidden", children: [...Array(Math.floor(rowsPerPage ?? 50))].map((_, index) => /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(
7572
- import_material62.Skeleton,
7599
+ if (emptyRows > 0 && rowsPerPage > emptyRows) {
7600
+ rowsComponents.push(
7601
+ /* @__PURE__ */ (0, import_jsx_runtime114.jsx)(import_material63.TableRow, { style: { height: rowHeight * emptyRows }, children: /* @__PURE__ */ (0, import_jsx_runtime114.jsx)(import_material63.TableCell, { colSpan: 8 }) }, (0, import_uuid.v4)())
7602
+ );
7603
+ }
7604
+ return rowsComponents;
7605
+ };
7606
+ return /* @__PURE__ */ (0, import_jsx_runtime114.jsx)(import_material63.Paper, { className: classes.root, children: /* @__PURE__ */ (0, import_jsx_runtime114.jsx)(import_material63.Box, { className: classes.paper, children: isLoading ? /* @__PURE__ */ (0, import_jsx_runtime114.jsx)(TableLoading_default, { rowHeight, rowsPerPage }) : /* @__PURE__ */ (0, import_jsx_runtime114.jsx)(import_material63.TableContainer, { className: classes.container, children: /* @__PURE__ */ (0, import_jsx_runtime114.jsxs)(import_material63.Table, { size: "medium", stickyHeader: true, children: [
7607
+ /* @__PURE__ */ (0, import_jsx_runtime114.jsx)(import_material63.TableHead, { className: classes.header, children: /* @__PURE__ */ (0, import_jsx_runtime114.jsx)(import_material63.TableRow, { children: headCells?.map((headCell) => /* @__PURE__ */ (0, import_jsx_runtime114.jsx)(
7608
+ import_material63.TableCell,
7573
7609
  {
7574
- animation: "pulse",
7575
- variant: "rounded",
7576
- sx: { margin: 1 },
7577
- height: rowHeight,
7578
- "data-testid": "loading-skeleton"
7610
+ align: "left",
7611
+ sortDirection: orderBy === headCell.id ? order : void 0,
7612
+ children: /* @__PURE__ */ (0, import_jsx_runtime114.jsx)(
7613
+ import_material63.TableSortLabel,
7614
+ {
7615
+ active: orderBy === headCell.id,
7616
+ direction: orderBy === headCell.id ? order : "asc",
7617
+ onClick: createSortHandler(headCell.id),
7618
+ children: headCell.label
7619
+ }
7620
+ )
7579
7621
  },
7580
- index
7581
- )) }) : /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(import_material62.TableContainer, { className: classes.container, children: /* @__PURE__ */ (0, import_jsx_runtime113.jsxs)(
7582
- import_material62.Table,
7583
- {
7584
- "aria-labelledby": "tableTitle",
7585
- "aria-label": "sticky table",
7586
- stickyHeader: true,
7587
- style: { tableLayout },
7588
- children: [
7589
- /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(
7590
- SmartTableHeader_default,
7591
- {
7592
- headCells: visibleHeadCells,
7593
- order,
7594
- orderBy,
7595
- numSelected: selected.length,
7596
- numRows: data.length,
7597
- enableCheckboxSelection,
7598
- headerFilters: headerFilters ?? {},
7599
- onRequestSort: handleRequestSort,
7600
- onSelectAllClick: handleSelectAllClick,
7601
- onApplyFilters,
7602
- shouldShowCheckOnFilter
7603
- }
7604
- ),
7605
- /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(import_material62.TableBody, { children: rowsPerPage !== emptyRows ? renderTableRows : /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(
7606
- TableEmptyResult_default,
7622
+ headCell.id
7623
+ )) }) }),
7624
+ /* @__PURE__ */ (0, import_jsx_runtime114.jsxs)(import_material63.TableBody, { children: [
7625
+ getTableRows(),
7626
+ rowsPerPage === emptyRows && /* @__PURE__ */ (0, import_jsx_runtime114.jsx)(import_material63.TableRow, { style: { height: rowHeight * emptyRows }, children: /* @__PURE__ */ (0, import_jsx_runtime114.jsx)(import_material63.TableCell, { colSpan: 8, align: "center", children: "Nothing to display" }) })
7627
+ ] })
7628
+ ] }) }) }) });
7629
+ };
7630
+ var Table_default = Table2;
7631
+
7632
+ // src/components/TableDesktopFooter/TableDesktopFooter.tsx
7633
+ var import_Refresh = __toESM(require("@mui/icons-material/Refresh"), 1);
7634
+ var import_material64 = require("@mui/material");
7635
+ var import_jsx_runtime115 = require("react/jsx-runtime");
7636
+ var TableDesktopFooter = ({
7637
+ numPages,
7638
+ page,
7639
+ pageSize,
7640
+ pageSizeOptions,
7641
+ handlePageChange,
7642
+ handlePageSizeChange,
7643
+ refetch,
7644
+ isFetching
7645
+ }) => {
7646
+ return /* @__PURE__ */ (0, import_jsx_runtime115.jsxs)(
7647
+ import_material64.Box,
7648
+ {
7649
+ py: 1,
7650
+ gap: 2,
7651
+ display: "flex",
7652
+ justifyContent: "space-between",
7653
+ alignItems: "center",
7654
+ borderTop: `1px solid ${colors.neutral300}`,
7655
+ bgcolor: (theme) => theme.palette.background.default,
7656
+ children: [
7657
+ /* @__PURE__ */ (0, import_jsx_runtime115.jsxs)(
7658
+ import_material64.Button,
7659
+ {
7660
+ disableRipple: true,
7661
+ variant: "outlined",
7662
+ onClick: () => refetch(),
7663
+ disabled: isFetching,
7664
+ sx: {
7665
+ ml: 1,
7666
+ gap: 1,
7667
+ borderRadius: 25,
7668
+ color: colors.neutral800,
7669
+ borderColor: colors.neutral600
7670
+ },
7671
+ children: [
7672
+ /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(
7673
+ import_Refresh.default,
7674
+ {
7675
+ fontSize: "small",
7676
+ color: isFetching ? "disabled" : "primary"
7677
+ }
7678
+ ),
7679
+ "REFRESH"
7680
+ ]
7681
+ }
7682
+ ),
7683
+ /* @__PURE__ */ (0, import_jsx_runtime115.jsxs)(import_material64.Box, { display: "flex", children: [
7684
+ /* @__PURE__ */ (0, import_jsx_runtime115.jsxs)(import_material64.Stack, { direction: "row", spacing: 2, alignItems: "center", children: [
7685
+ /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(import_material64.Typography, { children: "Rows per page:" }),
7686
+ /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(
7687
+ import_material64.Select,
7688
+ {
7689
+ value: pageSize,
7690
+ onChange: handlePageSizeChange,
7691
+ size: "small",
7692
+ variant: "standard",
7693
+ children: pageSizeOptions.map((size) => /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(import_material64.MenuItem, { value: size, children: size }, size))
7694
+ }
7695
+ )
7696
+ ] }),
7697
+ /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(
7698
+ import_material64.Pagination,
7607
7699
  {
7608
- colSpan: enableCheckboxSelection ? visibleHeadCells.length + 1 : visibleHeadCells.length,
7609
- showClearFilterButton,
7610
- handleClickOnClearFiltersButton
7700
+ color: "standard",
7701
+ count: numPages,
7702
+ page,
7703
+ onChange: handlePageChange
7611
7704
  }
7612
- ) })
7613
- ]
7705
+ )
7706
+ ] })
7707
+ ]
7708
+ }
7709
+ );
7710
+ };
7711
+
7712
+ // src/components/TableDesktopRowCell/TableDesktopRowCell.tsx
7713
+ var import_react38 = require("react");
7714
+ var import_material65 = require("@mui/material");
7715
+
7716
+ // src/components/TableDesktopRowCell/TableDesktopSmartSelect.tsx
7717
+ var import_react36 = require("react");
7718
+ var import_jsx_runtime116 = require("react/jsx-runtime");
7719
+ var resolveValue = (value) => {
7720
+ if (typeof value === "string") {
7721
+ return value;
7722
+ }
7723
+ return value?.id;
7724
+ };
7725
+ var TableDesktopSmartSelect = (0, import_react36.memo)(({
7726
+ ref,
7727
+ initialValue,
7728
+ inputLabel,
7729
+ fieldName,
7730
+ rowId,
7731
+ disabled,
7732
+ filterOptions,
7733
+ refetchFilterOptions,
7734
+ isFetchingFilterOptions,
7735
+ onUpdateEditableCell
7736
+ }) => {
7737
+ const [value, setValue] = (0, import_react36.useState)(initialValue);
7738
+ const [options, setOptions] = (0, import_react36.useState)();
7739
+ const valueId = resolveValue(value);
7740
+ const valueLabel = resolveOptionType(value, fieldName);
7741
+ (0, import_react36.useEffect)(() => {
7742
+ if (filterOptions) {
7743
+ const parsedOptions = filterOptions?.map((option) => ({
7744
+ value: resolveValue(option),
7745
+ label: String(resolveOptionType(option, fieldName))
7746
+ }));
7747
+ setOptions(parsedOptions);
7748
+ }
7749
+ }, [filterOptions]);
7750
+ return /* @__PURE__ */ (0, import_jsx_runtime116.jsx)(
7751
+ SmartSelect_default,
7752
+ {
7753
+ ref,
7754
+ value: valueId,
7755
+ inputLabel,
7756
+ options,
7757
+ disabled,
7758
+ refetch: refetchFilterOptions,
7759
+ isFetching: isFetchingFilterOptions,
7760
+ defaultOption: {
7761
+ value: valueId ?? "",
7762
+ label: String(valueLabel ?? "")
7763
+ },
7764
+ onChange: ({ value: value2, label }) => {
7765
+ setValue({ id: value2 ?? "", name: label ?? "" });
7766
+ onUpdateEditableCell?.(rowId, value2 ?? "");
7614
7767
  }
7615
- ) }),
7616
- children
7617
- ] }) });
7768
+ }
7769
+ );
7770
+ });
7771
+
7772
+ // src/components/TableDesktopRowCell/TableDesktopRowCell.tsx
7773
+ var import_Check2 = __toESM(require("@mui/icons-material/Check"), 1);
7774
+
7775
+ // src/components/TableDesktopRowCell/TableDesktopTextField.tsx
7776
+ var import_TextField = __toESM(require("@mui/material/TextField"), 1);
7777
+ var import_react37 = require("react");
7778
+ var import_jsx_runtime117 = require("react/jsx-runtime");
7779
+ var TableDesktopTextField = ({
7780
+ rowId,
7781
+ editInitialValue,
7782
+ inputLabel,
7783
+ disabled,
7784
+ validateInput,
7785
+ onUpdateEditableCell
7786
+ }) => {
7787
+ const [value, setValue] = (0, import_react37.useState)(editInitialValue);
7788
+ const hasError = (0, import_react37.useMemo)(() => !validateInput?.(value), [value, validateInput]);
7789
+ return /* @__PURE__ */ (0, import_jsx_runtime117.jsx)(
7790
+ import_TextField.default,
7791
+ {
7792
+ fullWidth: true,
7793
+ variant: "standard",
7794
+ defaultValue: value,
7795
+ label: inputLabel,
7796
+ error: hasError,
7797
+ disabled,
7798
+ onChange: ({ target: { value: value2 } }) => {
7799
+ setValue(value2);
7800
+ },
7801
+ onBlur: ({ target: { value: value2 } }) => {
7802
+ if (hasError) {
7803
+ return;
7804
+ }
7805
+ onUpdateEditableCell?.(rowId, value2);
7806
+ }
7807
+ }
7808
+ );
7809
+ };
7810
+
7811
+ // src/components/TableDesktopRowCell/TableDesktopRowCell.tsx
7812
+ var import_Close = __toESM(require("@mui/icons-material/Close"), 1);
7813
+ var import_Edit = __toESM(require("@mui/icons-material/Edit"), 1);
7814
+ var import_jsx_runtime118 = require("react/jsx-runtime");
7815
+ var TableDesktopRowCell = ({
7816
+ inputLabel,
7817
+ editInitialValue,
7818
+ rowId,
7819
+ fieldName,
7820
+ width,
7821
+ disabled,
7822
+ readOnlyValue,
7823
+ editableCellType,
7824
+ filterOptions,
7825
+ refetchFilterOptions,
7826
+ isFetchingFilterOptions,
7827
+ validateInput,
7828
+ onUpdateEditableCell,
7829
+ onCellClick
7830
+ }) => {
7831
+ const cellRef = (0, import_react38.useRef)(null);
7832
+ const [isOverflowed, setIsOverflowed] = (0, import_react38.useState)(false);
7833
+ const [isCellHovered, setIsCellHovered] = (0, import_react38.useState)(false);
7834
+ const [isEditMode, setIsEditMode] = (0, import_react38.useState)(false);
7835
+ (0, import_react38.useEffect)(() => {
7836
+ const ref = cellRef.current;
7837
+ if (ref) {
7838
+ setIsOverflowed(ref.scrollWidth > ref.clientWidth);
7839
+ }
7840
+ }, [readOnlyValue, width]);
7841
+ (0, import_react38.useEffect)(() => {
7842
+ const handleKeyDown = (e) => {
7843
+ if (e.key === "Escape") {
7844
+ setIsEditMode(false);
7845
+ }
7846
+ };
7847
+ if (isEditMode) {
7848
+ window.addEventListener("keydown", handleKeyDown);
7849
+ }
7850
+ return () => {
7851
+ window.removeEventListener("keydown", handleKeyDown);
7852
+ };
7853
+ }, [isEditMode]);
7854
+ const editableComponents = {
7855
+ "select": /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(
7856
+ TableDesktopSmartSelect,
7857
+ {
7858
+ rowId,
7859
+ fieldName,
7860
+ disabled,
7861
+ initialValue: editInitialValue,
7862
+ inputLabel: inputLabel ?? "",
7863
+ filterOptions,
7864
+ refetchFilterOptions,
7865
+ isFetchingFilterOptions,
7866
+ onUpdateEditableCell
7867
+ }
7868
+ ),
7869
+ "checkbox": /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(
7870
+ import_material65.Checkbox,
7871
+ {
7872
+ disableRipple: true,
7873
+ disabled,
7874
+ defaultChecked: editInitialValue,
7875
+ onChange: ({ target: { checked } }) => {
7876
+ onUpdateEditableCell?.(rowId, checked);
7877
+ }
7878
+ }
7879
+ ),
7880
+ "text": /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(
7881
+ TableDesktopTextField,
7882
+ {
7883
+ rowId,
7884
+ disabled,
7885
+ editInitialValue,
7886
+ inputLabel: inputLabel ?? "",
7887
+ validateInput,
7888
+ onUpdateEditableCell
7889
+ }
7890
+ ),
7891
+ "numeric": /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(
7892
+ import_material65.TextField,
7893
+ {
7894
+ fullWidth: true,
7895
+ variant: "standard",
7896
+ disabled,
7897
+ defaultValue: editInitialValue,
7898
+ label: inputLabel,
7899
+ onChange: (e) => {
7900
+ e.target.value = e.target.value.replace(/\D/g, "");
7901
+ },
7902
+ onBlur: ({ target: { value } }) => {
7903
+ onUpdateEditableCell?.(rowId, value);
7904
+ },
7905
+ slotProps: {
7906
+ input: {
7907
+ inputMode: "numeric"
7908
+ }
7909
+ }
7910
+ }
7911
+ )
7912
+ };
7913
+ const getReadOnlyBooleanIcon = (value) => {
7914
+ if (value) {
7915
+ return /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(import_Check2.default, { sx: { fontSize: 16 } });
7916
+ }
7917
+ return "-";
7918
+ };
7919
+ const handleEditClick = (e) => {
7920
+ e.stopPropagation();
7921
+ setIsEditMode((prev) => !prev);
7922
+ };
7923
+ return /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(import_material65.Tooltip, { title: isOverflowed ? String(readOnlyValue) : "", arrow: true, children: /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(
7924
+ import_material65.TableCell,
7925
+ {
7926
+ align: "left",
7927
+ onMouseEnter: () => editableCellType && !disabled && setIsCellHovered(true),
7928
+ onMouseLeave: () => editableCellType && !disabled && setIsCellHovered(false),
7929
+ onClick: (event) => !disabled && onCellClick?.(event, isEditMode),
7930
+ sx: {
7931
+ padding: 1,
7932
+ width: width ?? "auto",
7933
+ position: "relative",
7934
+ cursor: disabled ? "default" : "pointer",
7935
+ opacity: disabled ? 0.2 : 1,
7936
+ ":hover": editableCellType && {
7937
+ background: isEditMode ? colors.lightBlueBackground : colors.neutral100
7938
+ },
7939
+ background: isEditMode ? colors.lightBlueBackground : (theme) => theme.palette.background.default
7940
+ },
7941
+ children: /* @__PURE__ */ (0, import_jsx_runtime118.jsxs)(
7942
+ import_material65.Box,
7943
+ {
7944
+ p: 1,
7945
+ ref: cellRef,
7946
+ overflow: "hidden",
7947
+ textOverflow: "ellipsis",
7948
+ whiteSpace: "nowrap",
7949
+ children: [
7950
+ isCellHovered ? /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(import_material65.Tooltip, { title: isEditMode ? "" : "Toggle Edit Mode", children: /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(
7951
+ import_material65.IconButton,
7952
+ {
7953
+ onClick: handleEditClick,
7954
+ sx: {
7955
+ top: 0,
7956
+ right: 0,
7957
+ zIndex: 1,
7958
+ borderRadius: 0,
7959
+ position: "absolute",
7960
+ background: isEditMode ? colors.lightBlueBackground : colors.neutral100,
7961
+ "&:hover": {
7962
+ backgroundColor: isEditMode ? colors.lightBlueBackground : colors.neutral150
7963
+ }
7964
+ },
7965
+ children: isEditMode ? /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(import_Close.default, { fontSize: "small", color: "error" }) : /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(import_Edit.default, { fontSize: "small" })
7966
+ }
7967
+ ) }) : null,
7968
+ isEditMode && editableCellType ? editableComponents[editableCellType] : typeof readOnlyValue === "boolean" ? getReadOnlyBooleanIcon(readOnlyValue) : readOnlyValue
7969
+ ]
7970
+ }
7971
+ )
7972
+ }
7973
+ ) });
7618
7974
  };
7619
- var TableDesktop_default = TableDesktop;
7620
7975
 
7621
7976
  // src/components/TableHeader/TableHeader.tsx
7622
- var import_react35 = require("react");
7977
+ var import_react39 = require("react");
7623
7978
  var import_icons_material12 = require("@mui/icons-material");
7624
- var import_material63 = require("@mui/material");
7979
+ var import_material66 = require("@mui/material");
7625
7980
  var import_mui57 = require("tss-react/mui");
7626
- var import_jsx_runtime114 = require("react/jsx-runtime");
7981
+ var import_jsx_runtime119 = require("react/jsx-runtime");
7627
7982
  var useStyles51 = (0, import_mui57.makeStyles)()(() => ({
7628
7983
  sortLabel: {
7629
7984
  "& .MuiTableSortLabel-icon": {
@@ -7632,9 +7987,9 @@ var useStyles51 = (0, import_mui57.makeStyles)()(() => ({
7632
7987
  }
7633
7988
  }));
7634
7989
  var TableHeader = ({ cells, onSort = null }) => {
7635
- const [sortableCells, setSortableCells] = (0, import_react35.useState)([]);
7990
+ const [sortableCells, setSortableCells] = (0, import_react39.useState)([]);
7636
7991
  const { classes } = useStyles51();
7637
- (0, import_react35.useEffect)(() => {
7992
+ (0, import_react39.useEffect)(() => {
7638
7993
  setSortableCells(cells);
7639
7994
  }, []);
7640
7995
  const getNewSortDirection = (direction) => {
@@ -7668,8 +8023,8 @@ var TableHeader = ({ cells, onSort = null }) => {
7668
8023
  });
7669
8024
  setSortableCells(sortedCells);
7670
8025
  };
7671
- return /* @__PURE__ */ (0, import_jsx_runtime114.jsx)(import_material63.TableHead, { children: /* @__PURE__ */ (0, import_jsx_runtime114.jsx)(import_material63.TableRow, { children: sortableCells.map((cell, key) => /* @__PURE__ */ (0, import_jsx_runtime114.jsx)(import_material63.TableCell, { children: cell.isSortable ? /* @__PURE__ */ (0, import_jsx_runtime114.jsx)(
7672
- import_material63.TableSortLabel,
8026
+ return /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(import_material66.TableHead, { children: /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(import_material66.TableRow, { children: sortableCells.map((cell, key) => /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(import_material66.TableCell, { children: cell.isSortable ? /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(
8027
+ import_material66.TableSortLabel,
7673
8028
  {
7674
8029
  className: classes.sortLabel,
7675
8030
  direction: cell?.direction || "asc",
@@ -7679,12 +8034,12 @@ var TableHeader = ({ cells, onSort = null }) => {
7679
8034
  }
7680
8035
  ) : cell.label }, cell.label || key)) }) });
7681
8036
  };
7682
- var TableHeader_default = (0, import_react35.memo)(TableHeader);
8037
+ var TableHeader_default = (0, import_react39.memo)(TableHeader);
7683
8038
 
7684
8039
  // src/components/TextDivider/TextDivider.tsx
7685
- var import_material64 = require("@mui/material");
8040
+ var import_material67 = require("@mui/material");
7686
8041
  var import_mui58 = require("tss-react/mui");
7687
- var import_jsx_runtime115 = require("react/jsx-runtime");
8042
+ var import_jsx_runtime120 = require("react/jsx-runtime");
7688
8043
  var useStyles52 = (0, import_mui58.makeStyles)()(() => ({
7689
8044
  icon: {
7690
8045
  fontSize: 20
@@ -7721,19 +8076,19 @@ var TextDivider = ({
7721
8076
  }) => {
7722
8077
  const { classes } = useStyles52();
7723
8078
  const iconColor = color ?? colors.neutral900;
7724
- return /* @__PURE__ */ (0, import_jsx_runtime115.jsxs)(
7725
- import_material64.Box,
8079
+ return /* @__PURE__ */ (0, import_jsx_runtime120.jsxs)(
8080
+ import_material67.Box,
7726
8081
  {
7727
8082
  display: "flex",
7728
8083
  alignItems: "center",
7729
8084
  justifyContent: "space-between",
7730
8085
  className: classes.container,
7731
8086
  children: [
7732
- /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(import_material64.Divider, { className: classes.leftDivider }),
7733
- /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(import_material64.Button, { onClick, disabled: !onClick, className: classes.button, children: /* @__PURE__ */ (0, import_jsx_runtime115.jsxs)(import_material64.Box, { className: classes.center, children: [
7734
- Icon2 && iconPosition === "left" && /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(Icon2, { className: classes.icon, style: { color: iconColor } }),
7735
- /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(
7736
- import_material64.Typography,
8087
+ /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(import_material67.Divider, { className: classes.leftDivider }),
8088
+ /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(import_material67.Button, { onClick, disabled: !onClick, className: classes.button, children: /* @__PURE__ */ (0, import_jsx_runtime120.jsxs)(import_material67.Box, { className: classes.center, children: [
8089
+ Icon2 && iconPosition === "left" && /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(Icon2, { className: classes.icon, style: { color: iconColor } }),
8090
+ /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(
8091
+ import_material67.Typography,
7737
8092
  {
7738
8093
  color: "textSecondary",
7739
8094
  className: classes.title,
@@ -7741,9 +8096,9 @@ var TextDivider = ({
7741
8096
  children: title
7742
8097
  }
7743
8098
  ),
7744
- Icon2 && iconPosition === "right" && /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(Icon2, { className: classes.icon, style: { color: iconColor } })
8099
+ Icon2 && iconPosition === "right" && /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(Icon2, { className: classes.icon, style: { color: iconColor } })
7745
8100
  ] }) }),
7746
- /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(import_material64.Divider, { className: classes.rightDivider })
8101
+ /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(import_material67.Divider, { className: classes.rightDivider })
7747
8102
  ]
7748
8103
  }
7749
8104
  );
@@ -7755,7 +8110,7 @@ var import_react_dates = require("react-dates");
7755
8110
  var import_mui59 = require("tss-react/mui");
7756
8111
  var import_initialize = require("react-dates/initialize");
7757
8112
  var import_datepicker = require("react-dates/lib/css/_datepicker.css");
7758
- var import_jsx_runtime116 = require("react/jsx-runtime");
8113
+ var import_jsx_runtime121 = require("react/jsx-runtime");
7759
8114
  var useStyles53 = (0, import_mui59.makeStyles)()((theme) => ({
7760
8115
  wrapper: {
7761
8116
  "& .DateRangePicker": {
@@ -7851,15 +8206,15 @@ var ThemedDateRangePicker = ({
7851
8206
  ...props
7852
8207
  }) => {
7853
8208
  const { classes, cx } = useStyles53();
7854
- return /* @__PURE__ */ (0, import_jsx_runtime116.jsx)("div", { className: cx(classes.wrapper, className), children: /* @__PURE__ */ (0, import_jsx_runtime116.jsx)(import_react_dates.DateRangePicker, { ...props }) });
8209
+ return /* @__PURE__ */ (0, import_jsx_runtime121.jsx)("div", { className: cx(classes.wrapper, className), children: /* @__PURE__ */ (0, import_jsx_runtime121.jsx)(import_react_dates.DateRangePicker, { ...props }) });
7855
8210
  };
7856
8211
  var ThemedDateRangePicker_default = ThemedDateRangePicker;
7857
8212
 
7858
8213
  // src/components/TheToolbar/TheToolbar.tsx
7859
- var import_react36 = require("react");
7860
- var import_material65 = require("@mui/material");
8214
+ var import_react40 = require("react");
8215
+ var import_material68 = require("@mui/material");
7861
8216
  var import_mui60 = require("tss-react/mui");
7862
- var import_jsx_runtime117 = require("react/jsx-runtime");
8217
+ var import_jsx_runtime122 = require("react/jsx-runtime");
7863
8218
  var useStyles54 = (0, import_mui60.makeStyles)()((theme) => ({
7864
8219
  menuButton: {
7865
8220
  color: theme.palette.primary.contrastText
@@ -7879,9 +8234,9 @@ var TheToolbar = ({
7879
8234
  rightSection
7880
8235
  }) => {
7881
8236
  const { classes } = useStyles54();
7882
- return /* @__PURE__ */ (0, import_jsx_runtime117.jsxs)(import_material65.Box, { children: [
7883
- /* @__PURE__ */ (0, import_jsx_runtime117.jsx)(import_material65.AppBar, { children: /* @__PURE__ */ (0, import_jsx_runtime117.jsxs)(import_material65.Toolbar, { className: classes.topBar, children: [
7884
- /* @__PURE__ */ (0, import_jsx_runtime117.jsx)(
8237
+ return /* @__PURE__ */ (0, import_jsx_runtime122.jsxs)(import_material68.Box, { children: [
8238
+ /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(import_material68.AppBar, { children: /* @__PURE__ */ (0, import_jsx_runtime122.jsxs)(import_material68.Toolbar, { className: classes.topBar, children: [
8239
+ /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(
7885
8240
  RoundButton_default,
7886
8241
  {
7887
8242
  className: classes.menuButton,
@@ -7890,7 +8245,7 @@ var TheToolbar = ({
7890
8245
  onClick: handleOpen
7891
8246
  }
7892
8247
  ),
7893
- /* @__PURE__ */ (0, import_jsx_runtime117.jsx)(
8248
+ /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(
7894
8249
  CompanyLogo_default,
7895
8250
  {
7896
8251
  size: "small",
@@ -7899,31 +8254,31 @@ var TheToolbar = ({
7899
8254
  imageLogoLightSmall
7900
8255
  }
7901
8256
  ),
7902
- /* @__PURE__ */ (0, import_jsx_runtime117.jsx)(import_material65.Box, { ml: 2, children: leftSection }),
7903
- /* @__PURE__ */ (0, import_jsx_runtime117.jsx)(import_material65.Box, { ml: "auto", children: rightSection })
8257
+ /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(import_material68.Box, { ml: 2, children: leftSection }),
8258
+ /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(import_material68.Box, { ml: "auto", children: rightSection })
7904
8259
  ] }) }),
7905
8260
  LeftDrawer
7906
8261
  ] });
7907
8262
  };
7908
- var TheToolbar_default = (0, import_react36.memo)(TheToolbar);
8263
+ var TheToolbar_default = (0, import_react40.memo)(TheToolbar);
7909
8264
 
7910
8265
  // src/components/ToastMessage/ToastMessage.tsx
7911
- var import_material66 = require("@mui/material");
7912
- var import_jsx_runtime118 = require("react/jsx-runtime");
8266
+ var import_material69 = require("@mui/material");
8267
+ var import_jsx_runtime123 = require("react/jsx-runtime");
7913
8268
  var ToastMessage = ({
7914
8269
  toastType,
7915
8270
  toastMessage,
7916
8271
  open,
7917
8272
  onClose
7918
- }) => /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(
7919
- import_material66.Snackbar,
8273
+ }) => /* @__PURE__ */ (0, import_jsx_runtime123.jsx)(
8274
+ import_material69.Snackbar,
7920
8275
  {
7921
8276
  open,
7922
8277
  autoHideDuration: 1500,
7923
8278
  onClose,
7924
8279
  anchorOrigin: { vertical: "top", horizontal: "right" },
7925
- children: /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(
7926
- import_material66.Alert,
8280
+ children: /* @__PURE__ */ (0, import_jsx_runtime123.jsx)(
8281
+ import_material69.Alert,
7927
8282
  {
7928
8283
  elevation: 6,
7929
8284
  variant: "filled",
@@ -7949,9 +8304,9 @@ var ToastMessage = ({
7949
8304
  var ToastMessage_default = ToastMessage;
7950
8305
 
7951
8306
  // src/components/TwoButtonDialog/TwoButtonDialog.tsx
7952
- var import_material67 = require("@mui/material");
8307
+ var import_material70 = require("@mui/material");
7953
8308
  var import_mui61 = require("tss-react/mui");
7954
- var import_jsx_runtime119 = require("react/jsx-runtime");
8309
+ var import_jsx_runtime124 = require("react/jsx-runtime");
7955
8310
  var useStyles55 = (0, import_mui61.makeStyles)()((theme) => ({
7956
8311
  paper: {
7957
8312
  padding: theme.spacing(2)
@@ -7981,20 +8336,20 @@ var TwoButtonDialog = ({
7981
8336
  cancelButton
7982
8337
  }) => {
7983
8338
  const { classes } = useStyles55();
7984
- return /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(
7985
- import_material67.Dialog,
8339
+ return /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(
8340
+ import_material70.Dialog,
7986
8341
  {
7987
8342
  open,
7988
8343
  disableEnforceFocus: true,
7989
8344
  maxWidth: "sm",
7990
8345
  fullWidth: true,
7991
8346
  closeAfterTransition: true,
7992
- BackdropComponent: import_material67.Backdrop,
8347
+ BackdropComponent: import_material70.Backdrop,
7993
8348
  BackdropProps: { timeout: 500 },
7994
- children: /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(import_material67.Fade, { in: open, children: /* @__PURE__ */ (0, import_jsx_runtime119.jsxs)(import_material67.Paper, { className: classes.paper, children: [
7995
- /* @__PURE__ */ (0, import_jsx_runtime119.jsxs)(import_material67.Box, { className: classes.mb, children: [
7996
- /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(import_material67.Typography, { variant: "h5", component: "div", children: /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(
7997
- import_material67.Box,
8349
+ children: /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(import_material70.Fade, { in: open, children: /* @__PURE__ */ (0, import_jsx_runtime124.jsxs)(import_material70.Paper, { className: classes.paper, children: [
8350
+ /* @__PURE__ */ (0, import_jsx_runtime124.jsxs)(import_material70.Box, { className: classes.mb, children: [
8351
+ /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(import_material70.Typography, { variant: "h5", component: "div", children: /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(
8352
+ import_material70.Box,
7998
8353
  {
7999
8354
  sx: {
8000
8355
  fontWeight: 600
@@ -8002,23 +8357,23 @@ var TwoButtonDialog = ({
8002
8357
  children: title
8003
8358
  }
8004
8359
  ) }),
8005
- /* @__PURE__ */ (0, import_jsx_runtime119.jsxs)(
8006
- import_material67.Box,
8360
+ /* @__PURE__ */ (0, import_jsx_runtime124.jsxs)(
8361
+ import_material70.Box,
8007
8362
  {
8008
8363
  className: classes.mt,
8009
8364
  sx: {
8010
8365
  fontWeight: 600
8011
8366
  },
8012
8367
  children: [
8013
- subtitle1 && /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(import_material67.Typography, { variant: "subtitle1", children: subtitle1 }),
8014
- subtitle2 && /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(import_material67.Typography, { variant: "subtitle1", children: subtitle2 })
8368
+ subtitle1 && /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(import_material70.Typography, { variant: "subtitle1", children: subtitle1 }),
8369
+ subtitle2 && /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(import_material70.Typography, { variant: "subtitle1", children: subtitle2 })
8015
8370
  ]
8016
8371
  }
8017
8372
  )
8018
8373
  ] }),
8019
- /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(import_material67.Divider, {}),
8020
- /* @__PURE__ */ (0, import_jsx_runtime119.jsxs)(import_material67.Box, { className: classes.buttonContainer, children: [
8021
- /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(
8374
+ /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(import_material70.Divider, {}),
8375
+ /* @__PURE__ */ (0, import_jsx_runtime124.jsxs)(import_material70.Box, { className: classes.buttonContainer, children: [
8376
+ /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(
8022
8377
  FilledButton_default,
8023
8378
  {
8024
8379
  copy: cancelLabel,
@@ -8031,7 +8386,7 @@ var TwoButtonDialog = ({
8031
8386
  }
8032
8387
  }
8033
8388
  ),
8034
- /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(
8389
+ /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(
8035
8390
  FilledButton_default,
8036
8391
  {
8037
8392
  color: "primary",
@@ -8040,7 +8395,7 @@ var TwoButtonDialog = ({
8040
8395
  }
8041
8396
  )
8042
8397
  ] }),
8043
- /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(Loading_default, { isLoading: dialogLoading })
8398
+ /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(Loading_default, { isLoading: dialogLoading })
8044
8399
  ] }) })
8045
8400
  }
8046
8401
  );
@@ -8048,30 +8403,30 @@ var TwoButtonDialog = ({
8048
8403
  var TwoButtonDialog_default = TwoButtonDialog;
8049
8404
 
8050
8405
  // src/components/UserBust/UserBust.tsx
8051
- var import_react37 = require("react");
8052
- var import_material68 = require("@mui/material");
8053
- var import_jsx_runtime120 = require("react/jsx-runtime");
8054
- var UserBust = ({ user, avatarProps, typographyProps }) => /* @__PURE__ */ (0, import_jsx_runtime120.jsxs)("div", { children: [
8055
- /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(
8056
- import_material68.Avatar,
8406
+ var import_react41 = require("react");
8407
+ var import_material71 = require("@mui/material");
8408
+ var import_jsx_runtime125 = require("react/jsx-runtime");
8409
+ var UserBust = ({ user, avatarProps, typographyProps }) => /* @__PURE__ */ (0, import_jsx_runtime125.jsxs)("div", { children: [
8410
+ /* @__PURE__ */ (0, import_jsx_runtime125.jsx)(
8411
+ import_material71.Avatar,
8057
8412
  {
8058
8413
  src: user.profile_picture,
8059
8414
  alt: "user_avatar",
8060
8415
  style: { width: avatarProps.width, height: avatarProps.height }
8061
8416
  }
8062
8417
  ),
8063
- /* @__PURE__ */ (0, import_jsx_runtime120.jsxs)("div", { style: { paddingTop: 16 }, children: [
8064
- /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(import_material68.Typography, { ...typographyProps.name, children: `${user.first_name} ${user.last_name}` }),
8065
- /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(import_material68.Typography, { ...typographyProps.username, children: user.username })
8418
+ /* @__PURE__ */ (0, import_jsx_runtime125.jsxs)("div", { style: { paddingTop: 16 }, children: [
8419
+ /* @__PURE__ */ (0, import_jsx_runtime125.jsx)(import_material71.Typography, { ...typographyProps.name, children: `${user.first_name} ${user.last_name}` }),
8420
+ /* @__PURE__ */ (0, import_jsx_runtime125.jsx)(import_material71.Typography, { ...typographyProps.username, children: user.username })
8066
8421
  ] })
8067
8422
  ] });
8068
- var UserBust_default = (0, import_react37.memo)(UserBust);
8423
+ var UserBust_default = (0, import_react41.memo)(UserBust);
8069
8424
 
8070
8425
  // src/components/icons/IconChart.tsx
8071
- var import_jsx_runtime121 = require("react/jsx-runtime");
8426
+ var import_jsx_runtime126 = require("react/jsx-runtime");
8072
8427
  var SvgIconChart = (props) => {
8073
8428
  const { fill } = props;
8074
- return /* @__PURE__ */ (0, import_jsx_runtime121.jsx)(
8429
+ return /* @__PURE__ */ (0, import_jsx_runtime126.jsx)(
8075
8430
  "svg",
8076
8431
  {
8077
8432
  width: "20",
@@ -8080,7 +8435,7 @@ var SvgIconChart = (props) => {
8080
8435
  fill: "none",
8081
8436
  xmlns: "http://www.w3.org/2000/svg",
8082
8437
  ...props,
8083
- children: /* @__PURE__ */ (0, import_jsx_runtime121.jsx)(
8438
+ children: /* @__PURE__ */ (0, import_jsx_runtime126.jsx)(
8084
8439
  "path",
8085
8440
  {
8086
8441
  d: "M2.49967 11.6667L2.91634 11.725L6.72467 7.91667C6.57467 7.375 6.71634 6.75833 7.15801 6.325C7.80801 5.66667 8.85801 5.66667 9.50801 6.325C9.94967 6.75833 10.0913 7.375 9.94134 7.91667L12.083 10.0583L12.4997 10C12.6497 10 12.7913 10 12.9163 10.0583L15.8913 7.08333C15.833 6.95833 15.833 6.81667 15.833 6.66667C15.833 6.22464 16.0086 5.80072 16.3212 5.48816C16.6337 5.17559 17.0576 5 17.4997 5C17.9417 5 18.3656 5.17559 18.6782 5.48816C18.9907 5.80072 19.1663 6.22464 19.1663 6.66667C19.1663 7.10869 18.9907 7.53262 18.6782 7.84518C18.3656 8.15774 17.9417 8.33333 17.4997 8.33333C17.3497 8.33333 17.208 8.33333 17.083 8.275L14.108 11.25C14.1663 11.375 14.1663 11.5167 14.1663 11.6667C14.1663 12.1087 13.9907 12.5326 13.6782 12.8452C13.3656 13.1577 12.9417 13.3333 12.4997 13.3333C12.0576 13.3333 11.6337 13.1577 11.3212 12.8452C11.0086 12.5326 10.833 12.1087 10.833 11.6667L10.8913 11.25L8.74967 9.10833C8.48301 9.16667 8.18301 9.16667 7.91634 9.10833L4.10801 12.9167L4.16634 13.3333C4.16634 13.7754 3.99075 14.1993 3.67819 14.5118C3.36563 14.8244 2.9417 15 2.49967 15C2.05765 15 1.63372 14.8244 1.32116 14.5118C1.0086 14.1993 0.833008 13.7754 0.833008 13.3333C0.833008 12.8913 1.0086 12.4674 1.32116 12.1548C1.63372 11.8423 2.05765 11.6667 2.49967 11.6667Z",
@@ -8147,6 +8502,7 @@ var IconChart_default = SvgIconChart;
8147
8502
  ScrollableDialog,
8148
8503
  SearchAndFilterHeader,
8149
8504
  SearchAndFilterHeaderForTable,
8505
+ SearchFieldDebounced,
8150
8506
  SearchWithFilters,
8151
8507
  SearchWithFiltersForTable,
8152
8508
  SectionName,
@@ -8158,6 +8514,9 @@ var IconChart_default = SvgIconChart;
8158
8514
  Switch,
8159
8515
  Table,
8160
8516
  TableDesktop,
8517
+ TableDesktopFooter,
8518
+ TableDesktopRowCell,
8519
+ TableDesktopSmartSelect,
8161
8520
  TableEmptyResult,
8162
8521
  TableHeader,
8163
8522
  TableLoading,