@natoora-libs/core 0.1.11 → 0.1.13-dev-doug-3

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,
@@ -878,7 +882,7 @@ var ExtendedButton = ({
878
882
  buttonType = "button",
879
883
  color = "noOutline",
880
884
  disabled = false,
881
- href,
885
+ href = "",
882
886
  tooltip = "",
883
887
  component = "button",
884
888
  type,
@@ -915,7 +919,7 @@ var ExtendedButton = ({
915
919
  component,
916
920
  "data-testid": copy ? `extended-button-${copy.toLowerCase()}` : "extended-button",
917
921
  disabled,
918
- href: href ? href : void 0,
922
+ href,
919
923
  onClick,
920
924
  type: buttonType,
921
925
  variant,
@@ -3013,7 +3017,7 @@ var RoundButton = ({
3013
3017
  onClick(e);
3014
3018
  }
3015
3019
  };
3016
- const Button14 = /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
3020
+ const Button15 = /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
3017
3021
  import_material16.Fab,
3018
3022
  {
3019
3023
  className: cx(
@@ -3037,7 +3041,7 @@ var RoundButton = ({
3037
3041
  children: icon ? iconComponentMap[icon] : children || ""
3038
3042
  }
3039
3043
  );
3040
- 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;
3041
3045
  };
3042
3046
  var RoundButton_default = RoundButton;
3043
3047
 
@@ -6429,11 +6433,60 @@ var SearchAndFilterHeaderForTable = (props) => {
6429
6433
  };
6430
6434
  var SearchAndFilterHeaderForTable_default = React4.memo(SearchAndFilterHeaderForTable);
6431
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
+
6432
6485
  // src/components/SectionName/SectionName.tsx
6433
6486
  var import_icons_material11 = require("@mui/icons-material");
6434
- var import_material53 = require("@mui/material");
6487
+ var import_material54 = require("@mui/material");
6435
6488
  var import_mui48 = require("tss-react/mui");
6436
- var import_jsx_runtime104 = require("react/jsx-runtime");
6489
+ var import_jsx_runtime105 = require("react/jsx-runtime");
6437
6490
  var useStyles43 = (0, import_mui48.makeStyles)()((theme) => ({
6438
6491
  container: {
6439
6492
  display: "flex",
@@ -6476,10 +6529,10 @@ var SectionName = ({
6476
6529
  openHistoryLog
6477
6530
  }) => {
6478
6531
  const { classes } = useStyles43();
6479
- return /* @__PURE__ */ (0, import_jsx_runtime104.jsxs)(import_material53.Box, { className: classes.container, children: [
6480
- /* @__PURE__ */ (0, import_jsx_runtime104.jsxs)(import_material53.Box, { className: classes.titleContainer, children: [
6481
- /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(
6482
- 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,
6483
6536
  {
6484
6537
  variant: "h5",
6485
6538
  component: "a",
@@ -6488,7 +6541,7 @@ var SectionName = ({
6488
6541
  children: name
6489
6542
  }
6490
6543
  ),
6491
- 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)(
6492
6545
  import_icons_material11.Info,
6493
6546
  {
6494
6547
  fontSize: "small",
@@ -6497,8 +6550,8 @@ var SectionName = ({
6497
6550
  }
6498
6551
  ) }) : null
6499
6552
  ] }),
6500
- /* @__PURE__ */ (0, import_jsx_runtime104.jsxs)(import_material53.Box, { className: classes.actionButtons, children: [
6501
- 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)(
6502
6555
  ExtendedButton_default,
6503
6556
  {
6504
6557
  type: buttonType,
@@ -6511,25 +6564,25 @@ var SectionName = ({
6511
6564
  variant: "text"
6512
6565
  }
6513
6566
  ) : null,
6514
- openHistoryLog && buttonText && /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(import_material53.Divider, { orientation: "vertical", sx: { height: "24px" } }),
6515
- 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, {}) })
6516
6569
  ] })
6517
6570
  ] });
6518
6571
  };
6519
6572
  var SectionName_default = SectionName;
6520
6573
 
6521
6574
  // src/components/SmartSelect/SmartSelect.tsx
6522
- var import_react28 = require("react");
6523
- var import_material54 = require("@mui/material");
6575
+ var import_react29 = require("react");
6576
+ var import_material55 = require("@mui/material");
6524
6577
  var import_mui49 = require("tss-react/mui");
6525
- var import_jsx_runtime105 = require("react/jsx-runtime");
6578
+ var import_jsx_runtime106 = require("react/jsx-runtime");
6526
6579
  var useStyles44 = (0, import_mui49.makeStyles)()(() => ({
6527
6580
  container: {
6528
6581
  display: "flex",
6529
6582
  flexDirection: "column"
6530
6583
  }
6531
6584
  }));
6532
- var SmartSelect = (0, import_react28.forwardRef)(
6585
+ var SmartSelect = (0, import_react29.forwardRef)(
6533
6586
  ({
6534
6587
  value,
6535
6588
  defaultOption,
@@ -6548,9 +6601,9 @@ var SmartSelect = (0, import_react28.forwardRef)(
6548
6601
  menuProps
6549
6602
  }, ref) => {
6550
6603
  const { classes } = useStyles44();
6551
- const [open, setOpen] = (0, import_react28.useState)(false);
6552
- const [localOptions, setLocalOptions] = (0, import_react28.useState)(options || []);
6553
- (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)(() => {
6554
6607
  if (options) {
6555
6608
  setLocalOptions(options);
6556
6609
  }
@@ -6589,8 +6642,8 @@ var SmartSelect = (0, import_react28.forwardRef)(
6589
6642
  onChange(selectedOption);
6590
6643
  }
6591
6644
  };
6592
- return /* @__PURE__ */ (0, import_jsx_runtime105.jsxs)(
6593
- import_material54.FormControl,
6645
+ return /* @__PURE__ */ (0, import_jsx_runtime106.jsxs)(
6646
+ import_material55.FormControl,
6594
6647
  {
6595
6648
  fullWidth: true,
6596
6649
  className: classes.container,
@@ -6599,21 +6652,21 @@ var SmartSelect = (0, import_react28.forwardRef)(
6599
6652
  "data-testid": dataTestId,
6600
6653
  disabled,
6601
6654
  children: [
6602
- inputLabel && /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(
6603
- import_material54.InputLabel,
6655
+ inputLabel && /* @__PURE__ */ (0, import_jsx_runtime106.jsx)(
6656
+ import_material55.InputLabel,
6604
6657
  {
6605
6658
  id: "smart-select-label",
6606
6659
  "data-testid": `${dataTestId}-label`,
6607
6660
  children: inputLabel
6608
6661
  }
6609
6662
  ),
6610
- /* @__PURE__ */ (0, import_jsx_runtime105.jsxs)(
6611
- import_material54.Select,
6663
+ /* @__PURE__ */ (0, import_jsx_runtime106.jsxs)(
6664
+ import_material55.Select,
6612
6665
  {
6613
6666
  ref,
6614
6667
  disabled,
6615
6668
  labelId: "smart-select-label",
6616
- value,
6669
+ value: value ?? "",
6617
6670
  onChange: handleChange,
6618
6671
  onOpen: handleOpen,
6619
6672
  error,
@@ -6624,26 +6677,26 @@ var SmartSelect = (0, import_react28.forwardRef)(
6624
6677
  MenuProps: menuProps,
6625
6678
  label: inputLabel,
6626
6679
  children: [
6627
- isFetching && /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(
6628
- import_material54.MenuItem,
6680
+ isFetching && /* @__PURE__ */ (0, import_jsx_runtime106.jsx)(
6681
+ import_material55.MenuItem,
6629
6682
  {
6630
6683
  disabled: true,
6631
6684
  "data-testid": `${dataTestId}-loading`,
6632
6685
  id: `${dataTestId}-loading`,
6633
- 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 })
6634
6687
  }
6635
6688
  ),
6636
- (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 }),
6637
- localOptions.length === 0 && !isFetching && options?.length !== 0 && defaultOptionLabelIsValid && defaultOptionValueIsValid && /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(
6638
- 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,
6639
6692
  {
6640
6693
  value: defaultOption?.value,
6641
6694
  "data-testid": `${dataTestId}-default-option`,
6642
6695
  children: defaultOption?.label
6643
6696
  }
6644
6697
  ),
6645
- !isFetching && combinedOptions.length > 0 && combinedOptions.map((option) => /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(
6646
- import_material54.MenuItem,
6698
+ !isFetching && combinedOptions.length > 0 && combinedOptions.map((option) => /* @__PURE__ */ (0, import_jsx_runtime106.jsx)(
6699
+ import_material55.MenuItem,
6647
6700
  {
6648
6701
  value: option?.value,
6649
6702
  "data-testid": `${dataTestId}-option-${option?.value}`,
@@ -6655,7 +6708,7 @@ var SmartSelect = (0, import_react28.forwardRef)(
6655
6708
  ]
6656
6709
  }
6657
6710
  ),
6658
- 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 })
6659
6712
  ]
6660
6713
  }
6661
6714
  );
@@ -6664,11 +6717,11 @@ var SmartSelect = (0, import_react28.forwardRef)(
6664
6717
  var SmartSelect_default = SmartSelect;
6665
6718
 
6666
6719
  // src/components/SquareLabel/SquareLabel.tsx
6667
- var import_react29 = require("react");
6668
- var import_material55 = require("@mui/material");
6720
+ var import_react30 = require("react");
6721
+ var import_material56 = require("@mui/material");
6669
6722
  var import_red2 = __toESM(require("@mui/material/colors/red"), 1);
6670
6723
  var import_mui50 = require("tss-react/mui");
6671
- var import_jsx_runtime106 = require("react/jsx-runtime");
6724
+ var import_jsx_runtime107 = require("react/jsx-runtime");
6672
6725
  var useStyles45 = (0, import_mui50.makeStyles)()((theme) => ({
6673
6726
  red: {
6674
6727
  backgroundColor: import_red2.default["50"],
@@ -6683,15 +6736,15 @@ var useStyles45 = (0, import_mui50.makeStyles)()((theme) => ({
6683
6736
  }));
6684
6737
  var SquareLabel = ({ color, copy }) => {
6685
6738
  const { classes } = useStyles45();
6686
- 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 });
6687
6740
  };
6688
- var SquareLabel_default = (0, import_react29.memo)(SquareLabel);
6741
+ var SquareLabel_default = (0, import_react30.memo)(SquareLabel);
6689
6742
 
6690
6743
  // src/components/Switch/Switch.tsx
6691
- var import_react30 = require("react");
6692
- var import_material56 = require("@mui/material");
6744
+ var import_react31 = require("react");
6745
+ var import_material57 = require("@mui/material");
6693
6746
  var import_mui51 = require("tss-react/mui");
6694
- var import_jsx_runtime107 = require("react/jsx-runtime");
6747
+ var import_jsx_runtime108 = require("react/jsx-runtime");
6695
6748
  var LSwitch = ({
6696
6749
  checked,
6697
6750
  labelOn,
@@ -6699,8 +6752,8 @@ var LSwitch = ({
6699
6752
  handleChange,
6700
6753
  classes,
6701
6754
  disabled
6702
- }) => /* @__PURE__ */ (0, import_jsx_runtime107.jsx)("div", { className: classes.c_switch, children: /* @__PURE__ */ (0, import_jsx_runtime107.jsxs)(
6703
- 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,
6704
6757
  {
6705
6758
  component: "label",
6706
6759
  container: true,
@@ -6709,9 +6762,9 @@ var LSwitch = ({
6709
6762
  alignItems: "center"
6710
6763
  },
6711
6764
  children: [
6712
- labelOff && /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(import_material56.Grid2, { children: labelOff }),
6713
- /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(import_material56.Grid2, { children: /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(
6714
- 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,
6715
6768
  {
6716
6769
  checked,
6717
6770
  color: "primary",
@@ -6719,7 +6772,7 @@ var LSwitch = ({
6719
6772
  disabled
6720
6773
  }
6721
6774
  ) }),
6722
- 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 })
6723
6776
  ]
6724
6777
  }
6725
6778
  ) });
@@ -6741,245 +6794,26 @@ var LabelledSwitch = (0, import_mui51.withStyles)(LSwitch, (theme) => ({
6741
6794
  fontSize: "1rem"
6742
6795
  }
6743
6796
  }));
6744
- var Switch_default = (0, import_react30.memo)(LabelledSwitch);
6797
+ var Switch_default = (0, import_react31.memo)(LabelledSwitch);
6745
6798
 
6746
6799
  // src/components/SmartTableHeaderFilterMenu/SmartTableHeaderFilterMenu.tsx
6747
- var import_react31 = require("react");
6800
+ var import_react34 = require("react");
6748
6801
  var import_Check = __toESM(require("@mui/icons-material/Check"), 1);
6749
- var import_material57 = require("@mui/material");
6802
+ var import_material61 = require("@mui/material");
6750
6803
  var import_classnames3 = __toESM(require("classnames"), 1);
6751
- var import_mui52 = require("tss-react/mui");
6752
- var import_jsx_runtime108 = require("react/jsx-runtime");
6753
- var useStyles46 = (0, import_mui52.makeStyles)()((theme) => ({
6754
- filterMenu: {
6755
- display: "flex",
6756
- flexDirection: "column"
6757
- },
6758
- filterOptions: {
6759
- maxHeight: theme.spacing(62),
6760
- overflowY: "auto",
6761
- "&::-webkit-scrollbar": {
6762
- width: "8px",
6763
- height: "8px"
6764
- },
6765
- "&::-webkit-scrollbar-track": {
6766
- backgroundColor: theme.palette.mode === "dark" ? theme.palette.grey[800] : theme.palette.grey[100]
6767
- },
6768
- "&::-webkit-scrollbar-thumb": {
6769
- backgroundColor: theme.palette.mode === "dark" ? theme.palette.grey[900] : theme.palette.grey[400],
6770
- borderRadius: "10px"
6771
- },
6772
- "&::-webkit-scrollbar-thumb:hover": {
6773
- backgroundColor: theme.palette.mode === "dark" ? theme.palette.common.black : theme.palette.grey[500]
6774
- }
6775
- },
6776
- filter: {
6777
- display: "flex",
6778
- alignItems: "center",
6779
- justifyContent: "space-between",
6780
- padding: theme.spacing(0, 3)
6781
- },
6782
- applyFilterButtonsContainer: {
6783
- display: "flex",
6784
- padding: theme.spacing(0, 1)
6785
- },
6786
- saveAsDefaultButton: {
6787
- color: theme.palette.primary.main
6788
- },
6789
- skeleton: {
6790
- height: theme.spacing(3),
6791
- margin: theme.spacing(1)
6792
- }
6793
- }));
6794
- var resolveFilterOption = (filterOption) => {
6795
- if (typeof filterOption === "object") {
6796
- return filterOption?.label || filterOption?.name || "";
6797
- }
6798
- return filterOption;
6799
- };
6800
- var findFilterIndex = (filters, filterOption) => filters.findIndex((item) => {
6801
- if (typeof item === "string" && typeof filterOption === "string") {
6802
- return item === filterOption;
6803
- }
6804
- if (typeof item === "object" && typeof filterOption === "object") {
6805
- return item.id === filterOption.id;
6806
- }
6807
- return false;
6808
- });
6809
- var SmartTableHeaderFilterMenu = ({
6810
- headCell,
6811
- numActiveFilters,
6812
- headerFilters,
6813
- shouldShowCheckOnFilter,
6814
- onApplyFilters
6815
- }) => {
6816
- const { classes } = useStyles46();
6817
- const [anchorEl, setAnchorEl] = (0, import_react31.useState)(null);
6818
- const [selectedFilters, setSelectedFilters] = (0, import_react31.useState)(
6819
- headerFilters[headCell.id] ?? []
6820
- );
6821
- const filterOptions = headCell.filterOptionsQuery?.data ?? [];
6822
- const numFilterOptions = filterOptions.length ?? 0;
6823
- const numCurrentSelectedFilters = selectedFilters.length;
6824
- const handleFilterMenuOpen = (event) => {
6825
- if (!numFilterOptions) {
6826
- headCell.filterOptionsQuery?.refetch();
6827
- }
6828
- setAnchorEl(event.currentTarget);
6829
- };
6830
- const handleFilterMenuClose = () => {
6831
- setSelectedFilters(headerFilters[headCell.id]);
6832
- setAnchorEl(null);
6833
- };
6834
- const handleFilterOptionClick = (option) => {
6835
- const selectedIndex = findFilterIndex(selectedFilters, option);
6836
- let newSelected;
6837
- if (selectedIndex === -1) {
6838
- if (typeof option === "string") {
6839
- newSelected = [...selectedFilters, option];
6840
- } else {
6841
- newSelected = [...selectedFilters, option];
6842
- }
6843
- } else {
6844
- newSelected = selectedFilters.filter(
6845
- (_, index) => index !== selectedIndex
6846
- );
6847
- }
6848
- setSelectedFilters(newSelected);
6849
- };
6850
- const handleApplyFilters = (shouldSave) => {
6851
- const updatedFilters = {
6852
- ...headerFilters,
6853
- [headCell.id]: [...selectedFilters]
6854
- };
6855
- onApplyFilters?.(updatedFilters, shouldSave);
6856
- setAnchorEl(null);
6857
- };
6858
- (0, import_react31.useEffect)(() => {
6859
- setSelectedFilters(headerFilters[headCell.id] ?? []);
6860
- }, [headerFilters, headCell.id]);
6861
- const isOptionChecked = (0, import_react31.useMemo)(() => (resolvedOption) => !!selectedFilters?.some(
6862
- (value) => resolveFilterOption(value) === resolvedOption
6863
- ), [selectedFilters]);
6864
- const loadingSkeletons = /* @__PURE__ */ (0, import_jsx_runtime108.jsxs)(import_material57.Box, { "data-testid": "loading-skeletons", width: 272, children: [
6865
- /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(import_material57.Skeleton, { variant: "rounded", className: classes.skeleton }),
6866
- /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(import_material57.Divider, {}),
6867
- /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(import_material57.Skeleton, { variant: "rounded", className: classes.skeleton }),
6868
- /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(import_material57.Skeleton, { variant: "rounded", className: classes.skeleton }),
6869
- /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(import_material57.Skeleton, { variant: "rounded", className: classes.skeleton }),
6870
- /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(import_material57.Skeleton, { variant: "rounded", className: classes.skeleton }),
6871
- /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(import_material57.Divider, {}),
6872
- /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(import_material57.Skeleton, { variant: "rounded", className: classes.skeleton })
6873
- ] });
6874
- return /* @__PURE__ */ (0, import_jsx_runtime108.jsxs)(import_jsx_runtime108.Fragment, { children: [
6875
- /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(
6876
- ActiveFiltersIconButton_default,
6877
- {
6878
- numActiveFilters,
6879
- handleClick: handleFilterMenuOpen,
6880
- className: (0, import_classnames3.default)("filter-menu-trigger", {
6881
- "has-active-filters": !!numActiveFilters || !!anchorEl
6882
- })
6883
- }
6884
- ),
6885
- /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(
6886
- import_material57.Menu,
6887
- {
6888
- open: !!anchorEl,
6889
- onClose: handleFilterMenuClose,
6890
- anchorEl,
6891
- "data-testid": "filter-menu",
6892
- anchorOrigin: { vertical: "bottom", horizontal: "right" },
6893
- transformOrigin: { vertical: "top", horizontal: "right" },
6894
- children: headCell.filterOptionsQuery?.isFetching ? loadingSkeletons : /* @__PURE__ */ (0, import_jsx_runtime108.jsxs)(import_material57.Box, { className: classes.filterMenu, children: [
6895
- /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(import_material57.Box, { px: 3, mb: 0.5, children: /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(
6896
- import_material57.FormControlLabel,
6897
- {
6898
- label: "Select All",
6899
- control: /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(
6900
- import_material57.Checkbox,
6901
- {
6902
- disableRipple: true,
6903
- checked: numCurrentSelectedFilters === numFilterOptions,
6904
- indeterminate: numCurrentSelectedFilters > 0 && numCurrentSelectedFilters < numFilterOptions,
6905
- onChange: ({ target: { checked } }) => {
6906
- if (checked) {
6907
- setSelectedFilters([...filterOptions]);
6908
- } else {
6909
- setSelectedFilters([]);
6910
- }
6911
- }
6912
- }
6913
- )
6914
- }
6915
- ) }),
6916
- /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(import_material57.Divider, { sx: { mb: 0.5 } }),
6917
- /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(import_material57.Box, { className: classes.filterOptions, children: filterOptions.map(
6918
- (option) => {
6919
- const resolvedOption = resolveFilterOption(option);
6920
- return /* @__PURE__ */ (0, import_jsx_runtime108.jsxs)(
6921
- import_material57.Box,
6922
- {
6923
- className: classes.filter,
6924
- children: [
6925
- /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(
6926
- import_material57.FormControlLabel,
6927
- {
6928
- label: resolvedOption,
6929
- control: /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(
6930
- import_material57.Checkbox,
6931
- {
6932
- disableRipple: true,
6933
- onChange: () => handleFilterOptionClick(option),
6934
- checked: isOptionChecked(resolvedOption)
6935
- }
6936
- )
6937
- },
6938
- resolvedOption
6939
- ),
6940
- 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
6941
- ]
6942
- },
6943
- resolvedOption
6944
- );
6945
- }
6946
- ) }),
6947
- /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(import_material57.Divider, { sx: { mb: 0.5 } }),
6948
- /* @__PURE__ */ (0, import_jsx_runtime108.jsxs)(import_material57.Box, { className: classes.applyFilterButtonsContainer, children: [
6949
- /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(
6950
- ExtendedButton_default,
6951
- {
6952
- copy: "Save as Default",
6953
- buttonType: "button",
6954
- variant: "text",
6955
- tooltip: "Persists those filters for future visits",
6956
- className: classes.saveAsDefaultButton,
6957
- onClick: () => handleApplyFilters(true)
6958
- }
6959
- ),
6960
- /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(
6961
- ExtendedButton_default,
6962
- {
6963
- copy: "Apply",
6964
- color: "primary",
6965
- buttonType: "submit",
6966
- onClick: () => handleApplyFilters(false)
6967
- }
6968
- )
6969
- ] })
6970
- ] })
6971
- }
6972
- )
6973
- ] });
6974
- };
6975
- var SmartTableHeaderFilterMenu_default = (0, import_react31.memo)(SmartTableHeaderFilterMenu);
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");
6976
6810
 
6977
6811
  // src/components/SmartTableHeader/SmartTableHeader.tsx
6978
6812
  var import_react32 = require("react");
6979
6813
  var import_material58 = require("@mui/material");
6980
- var import_mui53 = require("tss-react/mui");
6814
+ var import_mui52 = require("tss-react/mui");
6981
6815
  var import_jsx_runtime109 = require("react/jsx-runtime");
6982
- var useStyles47 = (0, import_mui53.makeStyles)()((theme) => ({
6816
+ var useStyles46 = (0, import_mui52.makeStyles)()((theme) => ({
6983
6817
  root: {
6984
6818
  backgroundColor: colors.neutral100,
6985
6819
  height: theme.spacing(6),
@@ -7001,7 +6835,7 @@ var useStyles47 = (0, import_mui53.makeStyles)()((theme) => ({
7001
6835
  },
7002
6836
  tableHeaderContent: {
7003
6837
  borderBottom: "1px solid",
7004
- borderBottomColor: colors.neutral250,
6838
+ borderBottomColor: colors.neutral300,
7005
6839
  whiteSpace: "nowrap",
7006
6840
  "& .filter-menu-trigger": {
7007
6841
  visibility: "hidden",
@@ -7046,7 +6880,7 @@ var SmartTableHeader = ({
7046
6880
  onApplyFilters,
7047
6881
  shouldShowCheckOnFilter
7048
6882
  }) => {
7049
- const { classes } = useStyles47();
6883
+ const { classes } = useStyles46();
7050
6884
  const createSortHandler = (property) => (event) => {
7051
6885
  onRequestSort(event, property);
7052
6886
  };
@@ -7056,237 +6890,93 @@ var SmartTableHeader = ({
7056
6890
  import_material58.Checkbox,
7057
6891
  {
7058
6892
  color: "primary",
6893
+ disableRipple: true,
7059
6894
  indeterminate: numSelected > 0 && numSelected < numRows,
7060
6895
  checked: numRows > 0 && numSelected === numRows,
7061
6896
  onChange: onSelectAllClick
7062
6897
  }
7063
6898
  ) }) : null,
7064
- headCells.map((headCell) => /* @__PURE__ */ (0, import_jsx_runtime109.jsxs)(
6899
+ headCells.map((headCell) => /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(
7065
6900
  import_material58.TableCell,
7066
6901
  {
7067
6902
  className: classes.tableHeaderContent,
7068
6903
  align: "left",
7069
- sx: { width: headCell.width ?? "auto" },
6904
+ width: headCell.width ?? "auto",
7070
6905
  sortDirection: orderBy === headCell.id ? order : false,
7071
- children: [
7072
- /* @__PURE__ */ (0, import_jsx_runtime109.jsxs)(
7073
- import_material58.TableSortLabel,
7074
- {
7075
- "data-testid": "table-sort-label",
7076
- active: isSortActive(headCell.id),
7077
- direction: orderBy === headCell.id ? order : "asc",
7078
- onClick: createSortHandler(headCell.id),
7079
- children: [
7080
- headCell.renderHeader ?? headCell.label,
7081
- orderBy === headCell.id ? /* @__PURE__ */ (0, import_jsx_runtime109.jsx)("span", { className: classes.visuallyHidden, children: order === "desc" ? "sorted descending" : "sorted ascending" }) : null
7082
- ]
7083
- }
7084
- ),
7085
- headCell.filterOptionsQuery ? /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(
7086
- SmartTableHeaderFilterMenu_default,
7087
- {
7088
- headCell,
7089
- headerFilters,
7090
- numActiveFilters: headerFilters[headCell.id]?.length ?? 0,
7091
- onApplyFilters,
7092
- shouldShowCheckOnFilter
7093
- }
7094
- ) : null
7095
- ]
7096
- },
7097
- headCell.id
7098
- ))
7099
- ] }) });
7100
- };
7101
- var SmartTableHeader_default = (0, import_react32.memo)(SmartTableHeader);
7102
-
7103
- // src/components/Table/Table.tsx
7104
- var import_react33 = require("react");
7105
- var import_material60 = require("@mui/material");
7106
- var import_debounce = __toESM(require_debounce(), 1);
7107
- var import_mui54 = require("tss-react/mui");
7108
- var import_uuid = require("uuid");
7109
-
7110
- // src/components/TableLoading/TableLoading.tsx
7111
- var import_material59 = require("@mui/material");
7112
- var import_jsx_runtime110 = require("react/jsx-runtime");
7113
- var TableLoading = ({
7114
- rowsPerPage,
7115
- rowHeight
7116
- }) => /* @__PURE__ */ (0, import_jsx_runtime110.jsx)(import_material59.Box, { children: Array.from({ length: rowsPerPage ?? 0 }).map((_, index) => /* @__PURE__ */ (0, import_jsx_runtime110.jsx)(
7117
- import_material59.Skeleton,
7118
- {
7119
- animation: "pulse",
7120
- "data-testid": "table-loading-skeleton",
7121
- style: { margin: "8px", opacity: 0.4 },
7122
- variant: "rectangular",
7123
- height: rowHeight
7124
- },
7125
- index
7126
- )) });
7127
- var TableLoading_default = TableLoading;
7128
-
7129
- // src/components/Table/helpers.tsx
7130
- function stableSort(array, cmp) {
7131
- const stabilizedThis = array.map((el, index) => [el, index]);
7132
- stabilizedThis.sort((a, b) => {
7133
- const order = cmp(a[0], b[0]);
7134
- if (order !== 0) {
7135
- return order;
7136
- }
7137
- return a[1] - b[1];
7138
- });
7139
- return stabilizedThis.map((el) => el[0]);
7140
- }
7141
- function descendingComparator(a, b, orderBy) {
7142
- if (b[orderBy] < a[orderBy]) {
7143
- return -1;
7144
- }
7145
- if (b[orderBy] > a[orderBy]) {
7146
- return 1;
7147
- }
7148
- return 0;
7149
- }
7150
- function getSorting(order, orderBy) {
7151
- return order === "desc" ? (a, b) => descendingComparator(a, b, orderBy) : (a, b) => -descendingComparator(a, b, orderBy);
7152
- }
7153
- function calculateRowsPerPage(rowHeight) {
7154
- const appContainerDom = document.getElementById("mainContainer");
7155
- const headerDom = document.getElementById("aboveTableHeader");
7156
- if (appContainerDom && headerDom) {
7157
- return Math.floor(
7158
- (appContainerDom.clientHeight - headerDom.clientHeight - 24) / rowHeight - 2
7159
- );
7160
- }
7161
- return 1;
7162
- }
7163
-
7164
- // src/components/Table/Table.tsx
7165
- var import_jsx_runtime111 = require("react/jsx-runtime");
7166
- var useStyles48 = (0, import_mui54.makeStyles)()(() => ({
7167
- root: {
7168
- height: "calc(100vh - 262px)",
7169
- overflow: "scroll"
7170
- },
7171
- paper: {
7172
- width: "100%",
7173
- display: "flex",
7174
- flexDirection: "column",
7175
- justifyContent: "space-between"
7176
- },
7177
- header: {
7178
- "& .MuiTableSortLabel-root": {
7179
- fontWeight: 600,
7180
- fontSize: ".875rem"
7181
- }
7182
- },
7183
- container: {
7184
- maxHeight: "calc(100% - 0)"
7185
- }
7186
- }));
7187
- var Table = ({
7188
- appliedFilters,
7189
- data,
7190
- doNotCalculateRows,
7191
- headCells,
7192
- isLoading,
7193
- onRowClick,
7194
- page = 0,
7195
- RenderItem = null,
7196
- rowsPerPage: defaultRowsPerPage = 10,
7197
- serverRendered,
7198
- updateSort
7199
- }) => {
7200
- const [order, setOrder] = (0, import_react33.useState)(appliedFilters?.sortDir || "desc");
7201
- const [orderBy, setOrderBy] = (0, import_react33.useState)(
7202
- appliedFilters?.sortField || "delivery_date"
7203
- );
7204
- const [rowsPerPage, setRowsPerPage] = (0, import_react33.useState)(defaultRowsPerPage);
7205
- const { classes } = useStyles48();
7206
- const rowHeight = 56;
7207
- const emptyRows = rowsPerPage - Math.min(rowsPerPage, data.length - page * rowsPerPage);
7208
- const handleRequestSort = (event, property) => {
7209
- const isAsc = orderBy === property && order === "asc";
7210
- const orderDir = isAsc ? "desc" : "asc";
7211
- setOrder(orderDir);
7212
- setOrderBy(property);
7213
- if (updateSort) {
7214
- updateSort(property, orderDir);
7215
- }
7216
- };
7217
- (0, import_react33.useLayoutEffect)(() => {
7218
- if (!doNotCalculateRows) {
7219
- return;
7220
- }
7221
- function updateRowsPerPage() {
7222
- const newRowsPerPage = calculateRowsPerPage(rowHeight);
7223
- setRowsPerPage(newRowsPerPage);
7224
- }
7225
- updateRowsPerPage();
7226
- const debounced = (0, import_debounce.default)(updateRowsPerPage, 150);
7227
- window.addEventListener("resize", debounced);
7228
- return () => {
7229
- window.removeEventListener("resize", debounced);
7230
- };
7231
- }, [doNotCalculateRows]);
7232
- const createSortHandler = (property) => (event) => {
7233
- handleRequestSort(event, property);
7234
- };
7235
- const getTableRows = () => {
7236
- const index = page;
7237
- const rows = serverRendered ? data : stableSort(data, getSorting(order, orderBy)).slice(
7238
- index * rowsPerPage,
7239
- index * rowsPerPage + rowsPerPage
7240
- );
7241
- const rowsComponents = rows.map((row) => {
7242
- if (RenderItem) {
7243
- return /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(RenderItem, { ...row }, row.id);
7244
- }
7245
- 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);
7246
- });
7247
- if (emptyRows > 0 && rowsPerPage > emptyRows) {
7248
- rowsComponents.push(
7249
- /* @__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)())
7250
- );
7251
- }
7252
- return rowsComponents;
7253
- };
7254
- 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: [
7255
- /* @__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)(
7256
- import_material60.TableCell,
7257
- {
7258
- align: "left",
7259
- sortDirection: orderBy === headCell.id ? order : void 0,
7260
- children: /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(
7261
- import_material60.TableSortLabel,
6906
+ children: /* @__PURE__ */ (0, import_jsx_runtime109.jsxs)(
6907
+ import_material58.Box,
7262
6908
  {
7263
- active: orderBy === headCell.id,
7264
- direction: orderBy === headCell.id ? order : "asc",
7265
- onClick: createSortHandler(headCell.id),
7266
- children: headCell.label
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,
6915
+ {
6916
+ "data-testid": "table-sort-label",
6917
+ active: isSortActive(headCell.id),
6918
+ direction: orderBy === headCell.id ? order : "asc",
6919
+ onClick: createSortHandler(headCell.id),
6920
+ children: [
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
6923
+ ]
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
+ ]
7267
6937
  }
7268
6938
  )
7269
6939
  },
7270
6940
  headCell.id
7271
- )) }) }),
7272
- /* @__PURE__ */ (0, import_jsx_runtime111.jsxs)(import_material60.TableBody, { children: [
7273
- getTableRows(),
7274
- 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" }) })
7275
- ] })
7276
- ] }) }) }) });
6941
+ ))
6942
+ ] }) });
7277
6943
  };
7278
- var Table_default = Table;
6944
+ var SmartTableHeader_default = (0, import_react32.memo)(SmartTableHeader);
7279
6945
 
7280
- // src/components/TableDesktop/TableDesktop.tsx
7281
- var import_react34 = require("react");
7282
- var import_material62 = require("@mui/material");
7283
- var import_mui56 = require("tss-react/mui");
6946
+ // src/components/TableDesktopNoColumnsMessage/TableDesktopNoColumnsMessage.tsx
6947
+ var import_TableBody = __toESM(require("@mui/material/TableBody"), 1);
6948
+ var import_TableCell = __toESM(require("@mui/material/TableCell"), 1);
6949
+ var import_TableRow = __toESM(require("@mui/material/TableRow"), 1);
6950
+ var import_Typography = __toESM(require("@mui/material/Typography"), 1);
6951
+ var import_jsx_runtime110 = require("react/jsx-runtime");
6952
+ var TableDesktopNoColumnsMessage = () => /* @__PURE__ */ (0, import_jsx_runtime110.jsx)(import_TableBody.default, { children: /* @__PURE__ */ (0, import_jsx_runtime110.jsx)(import_TableRow.default, { children: /* @__PURE__ */ (0, import_jsx_runtime110.jsxs)(
6953
+ import_TableCell.default,
6954
+ {
6955
+ sx: {
6956
+ py: 8,
6957
+ gap: 2,
6958
+ borderBottom: "none",
6959
+ display: "flex",
6960
+ flexDirection: "column",
6961
+ justifyContent: "center",
6962
+ alignItems: "center"
6963
+ },
6964
+ children: [
6965
+ /* @__PURE__ */ (0, import_jsx_runtime110.jsx)(import_Typography.default, { variant: "subtitle2", fontSize: 16, children: "Customise your view" }),
6966
+ /* @__PURE__ */ (0, import_jsx_runtime110.jsxs)(import_Typography.default, { variant: "subtitle1", align: "center", color: "textSecondary", children: [
6967
+ "Use the column selector on the right to choose which fields",
6968
+ /* @__PURE__ */ (0, import_jsx_runtime110.jsx)("br", {}),
6969
+ "you want to display in the table"
6970
+ ] })
6971
+ ]
6972
+ }
6973
+ ) }) });
7284
6974
 
7285
6975
  // src/components/TableEmptyResult/TableEmptyResult.tsx
7286
- var import_material61 = require("@mui/material");
7287
- var import_mui55 = require("tss-react/mui");
7288
- var import_jsx_runtime112 = require("react/jsx-runtime");
7289
- var useStyles49 = (0, import_mui55.makeStyles)()(() => ({
6976
+ var import_material59 = require("@mui/material");
6977
+ var import_mui53 = require("tss-react/mui");
6978
+ var import_jsx_runtime111 = require("react/jsx-runtime");
6979
+ var useStyles47 = (0, import_mui53.makeStyles)()(() => ({
7290
6980
  tableCellIcon: { padding: 24, height: "calc(100vh - 320px)" },
7291
6981
  tableCellDefault: { padding: 24 }
7292
6982
  }));
@@ -7296,18 +6986,18 @@ var TableEmptyResult = ({
7296
6986
  handleClickOnClearFiltersButton = () => {
7297
6987
  }
7298
6988
  }) => {
7299
- const { classes } = useStyles49();
7300
- return showClearFilterButton ? /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(import_material61.TableRow, { children: /* @__PURE__ */ (0, import_jsx_runtime112.jsxs)(
7301
- import_material61.TableCell,
6989
+ const { classes } = useStyles47();
6990
+ return showClearFilterButton ? /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(import_material59.TableRow, { children: /* @__PURE__ */ (0, import_jsx_runtime111.jsxs)(
6991
+ import_material59.TableCell,
7302
6992
  {
7303
6993
  className: classes.tableCellIcon,
7304
6994
  colSpan,
7305
6995
  align: "center",
7306
6996
  children: [
7307
- /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(EmptyGlassIcon_default, {}),
7308
- /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(import_material61.Typography, { variant: "h6", children: "No results found." }),
7309
- /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(import_material61.Typography, { variant: "subtitle1", children: "Search without applied filters?" }),
7310
- /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(
6997
+ /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(EmptyGlassIcon_default, {}),
6998
+ /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(import_material59.Typography, { variant: "h6", children: "No results found." }),
6999
+ /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(import_material59.Typography, { variant: "subtitle1", children: "Search without applied filters?" }),
7000
+ /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(
7311
7001
  FilledButton_default,
7312
7002
  {
7313
7003
  copy: "Search",
@@ -7318,8 +7008,8 @@ var TableEmptyResult = ({
7318
7008
  )
7319
7009
  ]
7320
7010
  }
7321
- ) }) : /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(import_material61.TableRow, { children: /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(
7322
- import_material61.TableCell,
7011
+ ) }) : /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(import_material59.TableRow, { children: /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(
7012
+ import_material59.TableCell,
7323
7013
  {
7324
7014
  className: classes.tableCellDefault,
7325
7015
  colSpan,
@@ -7331,8 +7021,9 @@ var TableEmptyResult = ({
7331
7021
  var TableEmptyResult_default = TableEmptyResult;
7332
7022
 
7333
7023
  // src/components/TableDesktop/TableDesktop.tsx
7334
- var import_jsx_runtime113 = require("react/jsx-runtime");
7335
- var useStyles50 = (0, import_mui56.makeStyles)()((theme) => ({
7024
+ var import_jsx_runtime112 = require("react/jsx-runtime");
7025
+ var ROW_HEIGHT = 56;
7026
+ var useStyles48 = (0, import_mui54.makeStyles)()((theme) => ({
7336
7027
  root: {
7337
7028
  justifyContent: "space-between",
7338
7029
  display: "flex",
@@ -7362,7 +7053,7 @@ var useStyles50 = (0, import_mui56.makeStyles)()((theme) => ({
7362
7053
  }
7363
7054
  }
7364
7055
  }));
7365
- var descendingComparator2 = (a, b, orderBy) => {
7056
+ var descendingComparator = (a, b, orderBy) => {
7366
7057
  const objA = a[orderBy];
7367
7058
  const objB = b[orderBy];
7368
7059
  const valA = typeof objA === "object" ? objA?.name : objA;
@@ -7384,11 +7075,17 @@ var descendingComparator2 = (a, b, orderBy) => {
7384
7075
  }
7385
7076
  return 0;
7386
7077
  };
7387
- var stableSort2 = (array, cmp) => array.map((el, index) => ({ el, index })).sort((a, b) => {
7078
+ var stableSort = (array, cmp) => array.map((el, index) => ({ el, index })).sort((a, b) => {
7388
7079
  const order = cmp(a.el, b.el);
7389
7080
  return order !== 0 ? order : a.index - b.index;
7390
7081
  }).map((el) => el.el);
7391
- var getComparator = (order, orderBy) => order === "desc" ? (a, b) => descendingComparator2(a, b, orderBy) : (a, b) => -descendingComparator2(a, b, orderBy);
7082
+ var getComparator = (order, orderBy) => order === "desc" ? (a, b) => descendingComparator(a, b, orderBy) : (a, b) => -descendingComparator(a, b, orderBy);
7083
+ var resolveOptionType = (option, fieldName) => {
7084
+ if (!option || typeof option !== "object") {
7085
+ return option;
7086
+ }
7087
+ return option[fieldName] || "";
7088
+ };
7392
7089
  var TableDesktop = ({
7393
7090
  data,
7394
7091
  headCells,
@@ -7410,30 +7107,30 @@ var TableDesktop = ({
7410
7107
  onApplyFilters,
7411
7108
  shouldShowCheckOnFilter
7412
7109
  }) => {
7413
- const [order, setOrder] = (0, import_react34.useState)(appliedFilters?.sortDir || "desc");
7414
- const [orderBy, setOrderBy] = (0, import_react34.useState)(
7110
+ const { classes } = useStyles48();
7111
+ const [order, setOrder] = (0, import_react33.useState)(appliedFilters?.sortDir || "desc");
7112
+ const [orderBy, setOrderBy] = (0, import_react33.useState)(
7415
7113
  appliedFilters?.sortField || "delivery_date"
7416
7114
  );
7417
- const [selected, setSelected] = (0, import_react34.useState)([]);
7418
- const [page] = (0, import_react34.useState)(0);
7419
- const { classes } = useStyles50();
7420
- const rowHeight = 56;
7421
- const emptyRows = (0, import_react34.useMemo)(
7115
+ const [selected, setSelected] = (0, import_react33.useState)(/* @__PURE__ */ new Set());
7116
+ const [page] = (0, import_react33.useState)(0);
7117
+ const numRows = data.length;
7118
+ const emptyRows = (0, import_react33.useMemo)(
7422
7119
  () => rowsPerPage - data.length,
7423
7120
  [rowsPerPage, data]
7424
7121
  );
7425
- const visibleHeadCells = (0, import_react34.useMemo)(
7122
+ const visibleHeadCells = (0, import_react33.useMemo)(
7426
7123
  () => headCells.filter((headCell) => headCell?.enabled ?? true),
7427
7124
  [headCells]
7428
7125
  );
7429
- const handleSelectAllClick = (0, import_react34.useCallback)(
7126
+ const handleSelectAllClick = (0, import_react33.useCallback)(
7430
7127
  (event) => {
7431
7128
  if (event.target.checked) {
7432
- const newSelected = data.map((n) => n[keyField]);
7433
- setSelected(newSelected);
7434
- return;
7129
+ const allItems = new Set(data.map((n) => n[keyField]));
7130
+ setSelected(allItems);
7131
+ } else {
7132
+ setSelected(/* @__PURE__ */ new Set());
7435
7133
  }
7436
- setSelected([]);
7437
7134
  },
7438
7135
  [data, keyField]
7439
7136
  );
@@ -7446,119 +7143,871 @@ var TableDesktop = ({
7446
7143
  updateSort(property, orderDir);
7447
7144
  }
7448
7145
  };
7449
- const handleRowCheckboxClick = (0, import_react34.useCallback)(
7450
- (event, keyFieldValue) => {
7451
- const selectedIndex = selected.indexOf(keyFieldValue);
7452
- let newSelected = [];
7453
- if (selectedIndex === -1) {
7454
- newSelected = newSelected.concat(selected, keyFieldValue);
7455
- } else if (selectedIndex === 0) {
7456
- newSelected = newSelected.concat(selected.slice(1));
7457
- } else if (selectedIndex === selected.length - 1) {
7458
- newSelected = newSelected.concat(selected.slice(0, -1));
7459
- } else if (selectedIndex > 0) {
7460
- newSelected = newSelected.concat(
7461
- selected.slice(0, selectedIndex),
7462
- selected.slice(selectedIndex + 1)
7463
- );
7146
+ const handleRowCheckboxChange = (0, import_react33.useCallback)(
7147
+ (event, keyFieldValue) => {
7148
+ event.stopPropagation();
7149
+ setSelected((prev) => {
7150
+ const newSelected = new Set(prev);
7151
+ if (newSelected.has(keyFieldValue)) {
7152
+ newSelected.delete(keyFieldValue);
7153
+ } else {
7154
+ newSelected.add(keyFieldValue);
7155
+ }
7156
+ return newSelected;
7157
+ });
7158
+ },
7159
+ []
7160
+ );
7161
+ const renderTableRows = (0, import_react33.useMemo)(() => {
7162
+ if (isLoading) {
7163
+ return [...Array(Math.min(numRows, rowsPerPage))].map((_, rowIndex) => /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(import_material60.TableRow, { children: [...Array(visibleHeadCells.length)].map((_2, cellIndex) => /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(import_material60.TableCell, { children: /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(
7164
+ import_material60.Skeleton,
7165
+ {
7166
+ animation: "pulse",
7167
+ variant: "rounded",
7168
+ height: ROW_HEIGHT - 33,
7169
+ sx: { bgcolor: colors.neutral100 },
7170
+ "data-testid": "loading-skeleton"
7171
+ }
7172
+ ) }, cellIndex)) }, rowIndex));
7173
+ }
7174
+ const sortedData = disableInternalSort ? data : stableSort(data, getComparator(order, orderBy));
7175
+ return sortedData.slice(page * rowsPerPage, page * rowsPerPage + rowsPerPage).map((row, index) => {
7176
+ const isItemSelected = selected.has(row[keyField]);
7177
+ return /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(
7178
+ RenderItem,
7179
+ {
7180
+ ...{
7181
+ ...row,
7182
+ index,
7183
+ deleteItem,
7184
+ isItemSelected,
7185
+ enableCheckboxSelection,
7186
+ rowHeight: ROW_HEIGHT,
7187
+ rowId: row[keyField],
7188
+ handleRowCheckboxChange,
7189
+ visibleHeadCells
7190
+ }
7191
+ },
7192
+ row[keyField] ?? index
7193
+ );
7194
+ });
7195
+ }, [
7196
+ data,
7197
+ order,
7198
+ orderBy,
7199
+ page,
7200
+ rowsPerPage,
7201
+ selected,
7202
+ isLoading,
7203
+ numRows,
7204
+ enableCheckboxSelection,
7205
+ disableInternalSort,
7206
+ deleteItem,
7207
+ keyField,
7208
+ handleRowCheckboxChange,
7209
+ visibleHeadCells,
7210
+ RenderItem
7211
+ ]);
7212
+ (0, import_react33.useEffect)(() => {
7213
+ if (!enableCheckboxSelection) {
7214
+ setSelected(/* @__PURE__ */ new Set());
7215
+ }
7216
+ }, [enableCheckboxSelection]);
7217
+ return /* @__PURE__ */ (0, import_jsx_runtime112.jsx)("div", { className: classes.root, style: { height }, children: /* @__PURE__ */ (0, import_jsx_runtime112.jsxs)(import_material60.Paper, { className: classes.paper, children: [
7218
+ /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(import_material60.TableContainer, { className: classes.container, children: /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(
7219
+ import_material60.Table,
7220
+ {
7221
+ stickyHeader: true,
7222
+ "aria-labelledby": "tableTitle",
7223
+ "aria-label": "sticky table",
7224
+ style: { tableLayout },
7225
+ children: visibleHeadCells.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(TableDesktopNoColumnsMessage, {}) : /* @__PURE__ */ (0, import_jsx_runtime112.jsxs)(import_jsx_runtime112.Fragment, { children: [
7226
+ /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(
7227
+ SmartTableHeader_default,
7228
+ {
7229
+ headCells: visibleHeadCells,
7230
+ order,
7231
+ orderBy,
7232
+ numSelected: selected.size,
7233
+ numRows,
7234
+ enableCheckboxSelection,
7235
+ headerFilters: headerFilters ?? {},
7236
+ onRequestSort: handleRequestSort,
7237
+ onSelectAllClick: handleSelectAllClick,
7238
+ onApplyFilters,
7239
+ shouldShowCheckOnFilter
7240
+ }
7241
+ ),
7242
+ /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(import_material60.TableBody, { children: rowsPerPage !== emptyRows ? renderTableRows : /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(
7243
+ TableEmptyResult_default,
7244
+ {
7245
+ colSpan: enableCheckboxSelection ? visibleHeadCells.length + 1 : visibleHeadCells.length,
7246
+ showClearFilterButton,
7247
+ handleClickOnClearFiltersButton
7248
+ }
7249
+ ) })
7250
+ ] })
7251
+ }
7252
+ ) }),
7253
+ children
7254
+ ] }) });
7255
+ };
7256
+ var TableDesktop_default = TableDesktop;
7257
+
7258
+ // src/components/SmartTableHeaderFilterMenu/SmartTableHeaderFilterMenu.tsx
7259
+ var import_jsx_runtime113 = require("react/jsx-runtime");
7260
+ var useStyles49 = (0, import_mui55.makeStyles)()((theme) => ({
7261
+ filterMenu: {
7262
+ display: "flex",
7263
+ flexDirection: "column"
7264
+ },
7265
+ filterOptions: {
7266
+ maxHeight: theme.spacing(62),
7267
+ overflowY: "auto",
7268
+ "&::-webkit-scrollbar": {
7269
+ width: "8px",
7270
+ height: "8px"
7271
+ },
7272
+ "&::-webkit-scrollbar-track": {
7273
+ backgroundColor: theme.palette.mode === "dark" ? theme.palette.grey[800] : theme.palette.grey[100]
7274
+ },
7275
+ "&::-webkit-scrollbar-thumb": {
7276
+ backgroundColor: theme.palette.mode === "dark" ? theme.palette.grey[900] : theme.palette.grey[400],
7277
+ borderRadius: "10px"
7278
+ },
7279
+ "&::-webkit-scrollbar-thumb:hover": {
7280
+ backgroundColor: theme.palette.mode === "dark" ? theme.palette.common.black : theme.palette.grey[500]
7281
+ }
7282
+ },
7283
+ filter: {
7284
+ display: "flex",
7285
+ alignItems: "center",
7286
+ justifyContent: "space-between",
7287
+ padding: theme.spacing(0, 3)
7288
+ },
7289
+ applyFilterButtonsContainer: {
7290
+ display: "flex",
7291
+ padding: theme.spacing(0, 1),
7292
+ justifyContent: "space-between"
7293
+ },
7294
+ saveAsDefaultButton: {
7295
+ color: theme.palette.primary.main
7296
+ },
7297
+ skeleton: {
7298
+ height: theme.spacing(3),
7299
+ margin: theme.spacing(1)
7300
+ }
7301
+ }));
7302
+ var findFilterIndex = (filters, filterOption) => filters.findIndex((item) => {
7303
+ if (typeof item === "string" && typeof filterOption === "string") {
7304
+ return item === filterOption;
7305
+ }
7306
+ if (typeof item === "object" && typeof filterOption === "object") {
7307
+ return item.id === filterOption.id;
7308
+ }
7309
+ return false;
7310
+ });
7311
+ var SmartTableHeaderFilterMenu = ({
7312
+ headCell,
7313
+ numActiveFilters,
7314
+ headerFilters,
7315
+ shouldShowCheckOnFilter,
7316
+ onApplyFilters
7317
+ }) => {
7318
+ const { classes } = useStyles49();
7319
+ const [anchorEl, setAnchorEl] = (0, import_react34.useState)(null);
7320
+ const [filterOptionsData, setFilterOptionsData] = (0, import_react34.useState)();
7321
+ const [selectedFilters, setSelectedFilters] = (0, import_react34.useState)(
7322
+ headerFilters[headCell.id] ?? []
7323
+ );
7324
+ (0, import_react34.useEffect)(() => {
7325
+ if (headCell.filterOptions) {
7326
+ setFilterOptionsData(headCell.filterOptions);
7327
+ }
7328
+ }, [headCell.filterOptions]);
7329
+ const numFilterOptions = (0, import_react34.useMemo)(() => filterOptionsData?.length ?? 0, [filterOptionsData?.length]);
7330
+ const numCurrentSelectedFilters = selectedFilters.length;
7331
+ const handleFilterMenuOpen = (event) => {
7332
+ if (!numFilterOptions) {
7333
+ headCell.refetchFilterOptions?.();
7334
+ }
7335
+ setAnchorEl(event.currentTarget);
7336
+ };
7337
+ const handleFilterMenuClose = () => {
7338
+ setSelectedFilters(headerFilters[headCell.id]);
7339
+ setAnchorEl(null);
7340
+ };
7341
+ const handleFilterOptionClick = (option) => {
7342
+ const selectedIndex = findFilterIndex(selectedFilters, option);
7343
+ let newSelected;
7344
+ if (selectedIndex === -1) {
7345
+ if (typeof option === "string") {
7346
+ newSelected = [...selectedFilters, option];
7347
+ } else {
7348
+ newSelected = [...selectedFilters, option];
7349
+ }
7350
+ } else {
7351
+ newSelected = selectedFilters.filter(
7352
+ (_, index) => index !== selectedIndex
7353
+ );
7354
+ }
7355
+ setSelectedFilters(newSelected);
7356
+ };
7357
+ const handleApplyFilters = (shouldSave) => {
7358
+ const updatedFilters = {
7359
+ ...headerFilters,
7360
+ [headCell.id]: [...selectedFilters]
7361
+ };
7362
+ onApplyFilters?.(updatedFilters, shouldSave);
7363
+ setAnchorEl(null);
7364
+ };
7365
+ (0, import_react34.useEffect)(() => {
7366
+ setSelectedFilters(headerFilters[headCell.id] ?? []);
7367
+ }, [headerFilters, headCell.id]);
7368
+ const isOptionChecked = (0, import_react34.useMemo)(() => (resolvedOption) => !!selectedFilters?.some(
7369
+ (value) => resolveOptionType(value, headCell.fieldName ?? "") === resolvedOption
7370
+ ), [selectedFilters]);
7371
+ const loadingSkeletons = /* @__PURE__ */ (0, import_jsx_runtime113.jsxs)(import_material61.Box, { "data-testid": "loading-skeletons", width: 272, children: [
7372
+ /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(import_material61.Skeleton, { variant: "rounded", className: classes.skeleton }),
7373
+ /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(import_material61.Divider, {}),
7374
+ /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(import_material61.Skeleton, { variant: "rounded", className: classes.skeleton }),
7375
+ /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(import_material61.Skeleton, { variant: "rounded", className: classes.skeleton }),
7376
+ /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(import_material61.Skeleton, { variant: "rounded", className: classes.skeleton }),
7377
+ /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(import_material61.Skeleton, { variant: "rounded", className: classes.skeleton }),
7378
+ /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(import_material61.Divider, {}),
7379
+ /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(import_material61.Skeleton, { variant: "rounded", className: classes.skeleton })
7380
+ ] });
7381
+ return /* @__PURE__ */ (0, import_jsx_runtime113.jsxs)(import_jsx_runtime113.Fragment, { children: [
7382
+ /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(
7383
+ ActiveFiltersIconButton_default,
7384
+ {
7385
+ numActiveFilters,
7386
+ handleClick: handleFilterMenuOpen,
7387
+ className: (0, import_classnames3.default)("filter-menu-trigger", {
7388
+ "has-active-filters": !!numActiveFilters || !!anchorEl
7389
+ })
7390
+ }
7391
+ ),
7392
+ /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(
7393
+ import_material61.Menu,
7394
+ {
7395
+ open: !!anchorEl,
7396
+ onClose: handleFilterMenuClose,
7397
+ anchorEl,
7398
+ "data-testid": "filter-menu",
7399
+ anchorOrigin: { vertical: "bottom", horizontal: "right" },
7400
+ transformOrigin: { vertical: "top", horizontal: "right" },
7401
+ children: headCell.isFetchingFilterOptions ? loadingSkeletons : /* @__PURE__ */ (0, import_jsx_runtime113.jsxs)(import_material61.Box, { className: classes.filterMenu, children: [
7402
+ /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(import_material61.Box, { px: 3, mb: 0.5, children: /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(
7403
+ import_material61.FormControlLabel,
7404
+ {
7405
+ label: "Select All",
7406
+ control: /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(
7407
+ import_material61.Checkbox,
7408
+ {
7409
+ disableRipple: true,
7410
+ checked: numCurrentSelectedFilters === numFilterOptions,
7411
+ indeterminate: numCurrentSelectedFilters > 0 && numCurrentSelectedFilters < numFilterOptions,
7412
+ onChange: ({ target: { checked } }) => {
7413
+ if (checked) {
7414
+ setSelectedFilters([...filterOptionsData]);
7415
+ } else {
7416
+ setSelectedFilters([]);
7417
+ }
7418
+ }
7419
+ }
7420
+ )
7421
+ }
7422
+ ) }),
7423
+ /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(import_material61.Divider, { sx: { mb: 0.5 } }),
7424
+ /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(import_material61.Box, { className: classes.filterOptions, children: filterOptionsData?.map(
7425
+ (option) => {
7426
+ const resolvedOption = resolveOptionType(option, headCell.fieldName ?? "");
7427
+ return /* @__PURE__ */ (0, import_jsx_runtime113.jsxs)(
7428
+ import_material61.Box,
7429
+ {
7430
+ className: classes.filter,
7431
+ children: [
7432
+ /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(
7433
+ import_material61.FormControlLabel,
7434
+ {
7435
+ label: resolvedOption,
7436
+ control: /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(
7437
+ import_material61.Checkbox,
7438
+ {
7439
+ disableRipple: true,
7440
+ onChange: () => handleFilterOptionClick(option),
7441
+ checked: isOptionChecked(resolvedOption)
7442
+ }
7443
+ )
7444
+ },
7445
+ resolvedOption
7446
+ ),
7447
+ shouldShowCheckOnFilter?.(headCell.id, option) ? /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(import_material61.Tooltip, { title: "This filter is saved as default", children: /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(import_Check.default, { fontSize: "small", color: "action" }) }) : null
7448
+ ]
7449
+ },
7450
+ resolvedOption
7451
+ );
7452
+ }
7453
+ ) }),
7454
+ /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(import_material61.Divider, { sx: { mb: 0.5 } }),
7455
+ /* @__PURE__ */ (0, import_jsx_runtime113.jsxs)(import_material61.Box, { className: classes.applyFilterButtonsContainer, children: [
7456
+ /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(
7457
+ ExtendedButton_default,
7458
+ {
7459
+ copy: "Save as Default",
7460
+ buttonType: "button",
7461
+ variant: "text",
7462
+ tooltip: "Persists those filters for future visits",
7463
+ className: classes.saveAsDefaultButton,
7464
+ onClick: () => handleApplyFilters(true)
7465
+ }
7466
+ ),
7467
+ /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(
7468
+ ExtendedButton_default,
7469
+ {
7470
+ copy: "Apply",
7471
+ color: "primary",
7472
+ buttonType: "submit",
7473
+ onClick: () => handleApplyFilters(false)
7474
+ }
7475
+ )
7476
+ ] })
7477
+ ] })
7478
+ }
7479
+ )
7480
+ ] });
7481
+ };
7482
+ var SmartTableHeaderFilterMenu_default = (0, import_react34.memo)(SmartTableHeaderFilterMenu);
7483
+
7484
+ // src/components/Table/Table.tsx
7485
+ var import_react35 = require("react");
7486
+ var import_material63 = require("@mui/material");
7487
+ var import_debounce = __toESM(require_debounce(), 1);
7488
+ var import_mui56 = require("tss-react/mui");
7489
+ var import_uuid = require("uuid");
7490
+
7491
+ // src/components/TableLoading/TableLoading.tsx
7492
+ var import_material62 = require("@mui/material");
7493
+ var import_jsx_runtime114 = require("react/jsx-runtime");
7494
+ var TableLoading = ({
7495
+ rowsPerPage,
7496
+ rowHeight
7497
+ }) => /* @__PURE__ */ (0, import_jsx_runtime114.jsx)(import_material62.Box, { children: Array.from({ length: rowsPerPage ?? 0 }).map((_, index) => /* @__PURE__ */ (0, import_jsx_runtime114.jsx)(
7498
+ import_material62.Skeleton,
7499
+ {
7500
+ animation: "pulse",
7501
+ "data-testid": "table-loading-skeleton",
7502
+ style: { margin: "8px", opacity: 0.4 },
7503
+ variant: "rectangular",
7504
+ height: rowHeight
7505
+ },
7506
+ index
7507
+ )) });
7508
+ var TableLoading_default = TableLoading;
7509
+
7510
+ // src/components/Table/helpers.tsx
7511
+ function stableSort2(array, cmp) {
7512
+ const stabilizedThis = array.map((el, index) => [el, index]);
7513
+ stabilizedThis.sort((a, b) => {
7514
+ const order = cmp(a[0], b[0]);
7515
+ if (order !== 0) {
7516
+ return order;
7517
+ }
7518
+ return a[1] - b[1];
7519
+ });
7520
+ return stabilizedThis.map((el) => el[0]);
7521
+ }
7522
+ function descendingComparator2(a, b, orderBy) {
7523
+ if (b[orderBy] < a[orderBy]) {
7524
+ return -1;
7525
+ }
7526
+ if (b[orderBy] > a[orderBy]) {
7527
+ return 1;
7528
+ }
7529
+ return 0;
7530
+ }
7531
+ function getSorting(order, orderBy) {
7532
+ return order === "desc" ? (a, b) => descendingComparator2(a, b, orderBy) : (a, b) => -descendingComparator2(a, b, orderBy);
7533
+ }
7534
+ function calculateRowsPerPage(rowHeight) {
7535
+ const appContainerDom = document.getElementById("mainContainer");
7536
+ const headerDom = document.getElementById("aboveTableHeader");
7537
+ if (appContainerDom && headerDom) {
7538
+ return Math.floor(
7539
+ (appContainerDom.clientHeight - headerDom.clientHeight - 24) / rowHeight - 2
7540
+ );
7541
+ }
7542
+ return 1;
7543
+ }
7544
+
7545
+ // src/components/Table/Table.tsx
7546
+ var import_jsx_runtime115 = require("react/jsx-runtime");
7547
+ var useStyles50 = (0, import_mui56.makeStyles)()(() => ({
7548
+ root: {
7549
+ height: "calc(100vh - 262px)",
7550
+ overflow: "scroll"
7551
+ },
7552
+ paper: {
7553
+ width: "100%",
7554
+ display: "flex",
7555
+ flexDirection: "column",
7556
+ justifyContent: "space-between"
7557
+ },
7558
+ header: {
7559
+ "& .MuiTableSortLabel-root": {
7560
+ fontWeight: 600,
7561
+ fontSize: ".875rem"
7562
+ }
7563
+ },
7564
+ container: {
7565
+ maxHeight: "calc(100% - 0)"
7566
+ }
7567
+ }));
7568
+ var Table2 = ({
7569
+ appliedFilters,
7570
+ data,
7571
+ doNotCalculateRows,
7572
+ headCells,
7573
+ isLoading,
7574
+ onRowClick,
7575
+ page = 0,
7576
+ RenderItem = null,
7577
+ rowsPerPage: defaultRowsPerPage = 10,
7578
+ serverRendered,
7579
+ updateSort
7580
+ }) => {
7581
+ const [order, setOrder] = (0, import_react35.useState)(appliedFilters?.sortDir || "desc");
7582
+ const [orderBy, setOrderBy] = (0, import_react35.useState)(
7583
+ appliedFilters?.sortField || "delivery_date"
7584
+ );
7585
+ const [rowsPerPage, setRowsPerPage] = (0, import_react35.useState)(defaultRowsPerPage);
7586
+ const { classes } = useStyles50();
7587
+ const rowHeight = 56;
7588
+ const emptyRows = rowsPerPage - Math.min(rowsPerPage, data.length - page * rowsPerPage);
7589
+ const handleRequestSort = (event, property) => {
7590
+ const isAsc = orderBy === property && order === "asc";
7591
+ const orderDir = isAsc ? "desc" : "asc";
7592
+ setOrder(orderDir);
7593
+ setOrderBy(property);
7594
+ if (updateSort) {
7595
+ updateSort(property, orderDir);
7596
+ }
7597
+ };
7598
+ (0, import_react35.useLayoutEffect)(() => {
7599
+ if (!doNotCalculateRows) {
7600
+ return;
7601
+ }
7602
+ function updateRowsPerPage() {
7603
+ const newRowsPerPage = calculateRowsPerPage(rowHeight);
7604
+ setRowsPerPage(newRowsPerPage);
7605
+ }
7606
+ updateRowsPerPage();
7607
+ const debounced = (0, import_debounce.default)(updateRowsPerPage, 150);
7608
+ window.addEventListener("resize", debounced);
7609
+ return () => {
7610
+ window.removeEventListener("resize", debounced);
7611
+ };
7612
+ }, [doNotCalculateRows]);
7613
+ const createSortHandler = (property) => (event) => {
7614
+ handleRequestSort(event, property);
7615
+ };
7616
+ const getTableRows = () => {
7617
+ const index = page;
7618
+ const rows = serverRendered ? data : stableSort2(data, getSorting(order, orderBy)).slice(
7619
+ index * rowsPerPage,
7620
+ index * rowsPerPage + rowsPerPage
7621
+ );
7622
+ const rowsComponents = rows.map((row) => {
7623
+ if (RenderItem) {
7624
+ return /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(RenderItem, { ...row }, row.id);
7464
7625
  }
7465
- setSelected(newSelected);
7466
- },
7467
- [selected]
7468
- );
7469
- const renderTableRows = (0, import_react34.useMemo)(() => {
7470
- const sortedData = disableInternalSort ? data : stableSort2(data, getComparator(order, orderBy));
7471
- return sortedData.slice(page * rowsPerPage, page * rowsPerPage + rowsPerPage).map((row, index) => {
7472
- const isItemSelected = selected.includes(row[keyField]);
7473
- return /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(
7474
- RenderItem,
7475
- {
7476
- ...{
7477
- ...row,
7478
- index,
7479
- deleteItem,
7480
- isItemSelected,
7481
- enableCheckboxSelection,
7482
- keyFieldValue: row[keyField],
7483
- handleRowCheckboxClick,
7484
- visibleHeadCells
7485
- }
7486
- },
7487
- row[keyField] ?? index
7488
- );
7626
+ return /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(import_material63.TableRow, { hover: true, onClick: () => onRowClick?.(row), children: headCells?.map((column) => /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(import_material63.TableCell, { children: row[column.id] }, column.id)) }, row.id);
7489
7627
  });
7490
- }, [
7491
- data,
7492
- order,
7493
- orderBy,
7494
- page,
7495
- rowsPerPage,
7496
- selected,
7497
- enableCheckboxSelection,
7498
- disableInternalSort,
7499
- deleteItem,
7500
- keyField,
7501
- handleRowCheckboxClick,
7502
- visibleHeadCells,
7503
- RenderItem
7504
- ]);
7505
- 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: [
7506
- 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)(
7507
- import_material62.Skeleton,
7628
+ if (emptyRows > 0 && rowsPerPage > emptyRows) {
7629
+ rowsComponents.push(
7630
+ /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(import_material63.TableRow, { style: { height: rowHeight * emptyRows }, children: /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(import_material63.TableCell, { colSpan: 8 }) }, (0, import_uuid.v4)())
7631
+ );
7632
+ }
7633
+ return rowsComponents;
7634
+ };
7635
+ return /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(import_material63.Paper, { className: classes.root, children: /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(import_material63.Box, { className: classes.paper, children: isLoading ? /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(TableLoading_default, { rowHeight, rowsPerPage }) : /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(import_material63.TableContainer, { className: classes.container, children: /* @__PURE__ */ (0, import_jsx_runtime115.jsxs)(import_material63.Table, { size: "medium", stickyHeader: true, children: [
7636
+ /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(import_material63.TableHead, { className: classes.header, children: /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(import_material63.TableRow, { children: headCells?.map((headCell) => /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(
7637
+ import_material63.TableCell,
7508
7638
  {
7509
- animation: "pulse",
7510
- variant: "rounded",
7511
- sx: { margin: 1 },
7512
- height: rowHeight,
7513
- "data-testid": "loading-skeleton"
7639
+ align: "left",
7640
+ sortDirection: orderBy === headCell.id ? order : void 0,
7641
+ children: /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(
7642
+ import_material63.TableSortLabel,
7643
+ {
7644
+ active: orderBy === headCell.id,
7645
+ direction: orderBy === headCell.id ? order : "asc",
7646
+ onClick: createSortHandler(headCell.id),
7647
+ children: headCell.label
7648
+ }
7649
+ )
7514
7650
  },
7515
- index
7516
- )) }) : /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(import_material62.TableContainer, { className: classes.container, children: /* @__PURE__ */ (0, import_jsx_runtime113.jsxs)(
7517
- import_material62.Table,
7518
- {
7519
- "aria-labelledby": "tableTitle",
7520
- "aria-label": "sticky table",
7521
- stickyHeader: true,
7522
- style: { tableLayout },
7523
- children: [
7524
- /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(
7525
- SmartTableHeader_default,
7526
- {
7527
- headCells: visibleHeadCells,
7528
- order,
7529
- orderBy,
7530
- numSelected: selected.length,
7531
- numRows: data.length,
7532
- enableCheckboxSelection,
7533
- headerFilters: headerFilters ?? {},
7534
- onRequestSort: handleRequestSort,
7535
- onSelectAllClick: handleSelectAllClick,
7536
- onApplyFilters,
7537
- shouldShowCheckOnFilter
7538
- }
7539
- ),
7540
- /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(import_material62.TableBody, { children: rowsPerPage !== emptyRows ? renderTableRows : /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(
7541
- TableEmptyResult_default,
7651
+ headCell.id
7652
+ )) }) }),
7653
+ /* @__PURE__ */ (0, import_jsx_runtime115.jsxs)(import_material63.TableBody, { children: [
7654
+ getTableRows(),
7655
+ rowsPerPage === emptyRows && /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(import_material63.TableRow, { style: { height: rowHeight * emptyRows }, children: /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(import_material63.TableCell, { colSpan: 8, align: "center", children: "Nothing to display" }) })
7656
+ ] })
7657
+ ] }) }) }) });
7658
+ };
7659
+ var Table_default = Table2;
7660
+
7661
+ // src/components/TableDesktopFooter/TableDesktopFooter.tsx
7662
+ var import_Refresh = __toESM(require("@mui/icons-material/Refresh"), 1);
7663
+ var import_material64 = require("@mui/material");
7664
+ var import_jsx_runtime116 = require("react/jsx-runtime");
7665
+ var TableDesktopFooter = ({
7666
+ numPages,
7667
+ page,
7668
+ pageSize,
7669
+ pageSizeOptions,
7670
+ handlePageChange,
7671
+ handlePageSizeChange,
7672
+ refetch,
7673
+ isFetching
7674
+ }) => {
7675
+ return /* @__PURE__ */ (0, import_jsx_runtime116.jsxs)(
7676
+ import_material64.Box,
7677
+ {
7678
+ py: 1,
7679
+ gap: 2,
7680
+ display: "flex",
7681
+ justifyContent: "space-between",
7682
+ alignItems: "center",
7683
+ borderTop: `1px solid ${colors.neutral300}`,
7684
+ bgcolor: (theme) => theme.palette.background.default,
7685
+ children: [
7686
+ /* @__PURE__ */ (0, import_jsx_runtime116.jsxs)(
7687
+ import_material64.Button,
7688
+ {
7689
+ disableRipple: true,
7690
+ variant: "outlined",
7691
+ onClick: () => refetch(),
7692
+ disabled: isFetching,
7693
+ sx: {
7694
+ ml: 1,
7695
+ gap: 1,
7696
+ borderRadius: 25,
7697
+ color: colors.neutral800,
7698
+ borderColor: colors.neutral600
7699
+ },
7700
+ children: [
7701
+ /* @__PURE__ */ (0, import_jsx_runtime116.jsx)(
7702
+ import_Refresh.default,
7703
+ {
7704
+ fontSize: "small",
7705
+ color: isFetching ? "disabled" : "primary"
7706
+ }
7707
+ ),
7708
+ "REFRESH"
7709
+ ]
7710
+ }
7711
+ ),
7712
+ /* @__PURE__ */ (0, import_jsx_runtime116.jsxs)(import_material64.Box, { display: "flex", children: [
7713
+ /* @__PURE__ */ (0, import_jsx_runtime116.jsxs)(import_material64.Stack, { direction: "row", spacing: 2, alignItems: "center", children: [
7714
+ /* @__PURE__ */ (0, import_jsx_runtime116.jsx)(import_material64.Typography, { children: "Rows per page:" }),
7715
+ /* @__PURE__ */ (0, import_jsx_runtime116.jsx)(
7716
+ import_material64.Select,
7717
+ {
7718
+ value: pageSize,
7719
+ onChange: handlePageSizeChange,
7720
+ size: "small",
7721
+ variant: "standard",
7722
+ children: pageSizeOptions.map((size) => /* @__PURE__ */ (0, import_jsx_runtime116.jsx)(import_material64.MenuItem, { value: size, children: size }, size))
7723
+ }
7724
+ )
7725
+ ] }),
7726
+ /* @__PURE__ */ (0, import_jsx_runtime116.jsx)(
7727
+ import_material64.Pagination,
7542
7728
  {
7543
- colSpan: enableCheckboxSelection ? visibleHeadCells.length + 1 : visibleHeadCells.length,
7544
- showClearFilterButton,
7545
- handleClickOnClearFiltersButton
7729
+ color: "standard",
7730
+ count: numPages,
7731
+ page,
7732
+ onChange: handlePageChange
7546
7733
  }
7547
- ) })
7548
- ]
7734
+ )
7735
+ ] })
7736
+ ]
7737
+ }
7738
+ );
7739
+ };
7740
+
7741
+ // src/components/TableDesktopRowCell/TableDesktopRowCell.tsx
7742
+ var import_react38 = require("react");
7743
+ var import_material65 = require("@mui/material");
7744
+
7745
+ // src/components/TableDesktopRowCell/TableDesktopSmartSelect.tsx
7746
+ var import_react36 = require("react");
7747
+ var import_jsx_runtime117 = require("react/jsx-runtime");
7748
+ var resolveValue = (value) => {
7749
+ if (typeof value === "string") {
7750
+ return value;
7751
+ }
7752
+ return value?.id;
7753
+ };
7754
+ var TableDesktopSmartSelect = (0, import_react36.memo)(({
7755
+ ref,
7756
+ initialValue,
7757
+ inputLabel,
7758
+ fieldName,
7759
+ rowId,
7760
+ disabled,
7761
+ filterOptions,
7762
+ refetchFilterOptions,
7763
+ isFetchingFilterOptions,
7764
+ onUpdateEditableCell
7765
+ }) => {
7766
+ const [value, setValue] = (0, import_react36.useState)(initialValue);
7767
+ const [options, setOptions] = (0, import_react36.useState)();
7768
+ const valueId = resolveValue(value);
7769
+ const valueLabel = resolveOptionType(value, fieldName);
7770
+ (0, import_react36.useEffect)(() => {
7771
+ if (filterOptions) {
7772
+ const parsedOptions = filterOptions?.map((option) => ({
7773
+ value: resolveValue(option),
7774
+ label: String(resolveOptionType(option, fieldName))
7775
+ }));
7776
+ setOptions(parsedOptions);
7777
+ }
7778
+ }, [filterOptions]);
7779
+ return /* @__PURE__ */ (0, import_jsx_runtime117.jsx)(
7780
+ SmartSelect_default,
7781
+ {
7782
+ ref,
7783
+ value: valueId,
7784
+ inputLabel,
7785
+ options,
7786
+ disabled,
7787
+ refetch: refetchFilterOptions,
7788
+ isFetching: isFetchingFilterOptions,
7789
+ defaultOption: {
7790
+ value: valueId ?? "",
7791
+ label: String(valueLabel ?? "")
7792
+ },
7793
+ onChange: ({ value: value2, label }) => {
7794
+ setValue({ id: value2 ?? "", name: label ?? "" });
7795
+ onUpdateEditableCell?.(rowId, value2 ?? "");
7549
7796
  }
7550
- ) }),
7551
- children
7552
- ] }) });
7797
+ }
7798
+ );
7799
+ });
7800
+
7801
+ // src/components/TableDesktopRowCell/TableDesktopRowCell.tsx
7802
+ var import_Check2 = __toESM(require("@mui/icons-material/Check"), 1);
7803
+
7804
+ // src/components/TableDesktopRowCell/TableDesktopTextField.tsx
7805
+ var import_TextField = __toESM(require("@mui/material/TextField"), 1);
7806
+ var import_react37 = require("react");
7807
+ var import_jsx_runtime118 = require("react/jsx-runtime");
7808
+ var TableDesktopTextField = ({
7809
+ rowId,
7810
+ editInitialValue,
7811
+ inputLabel,
7812
+ disabled,
7813
+ validateInput,
7814
+ onUpdateEditableCell
7815
+ }) => {
7816
+ const [value, setValue] = (0, import_react37.useState)(editInitialValue);
7817
+ const hasError = (0, import_react37.useMemo)(() => !validateInput?.(value), [value, validateInput]);
7818
+ return /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(
7819
+ import_TextField.default,
7820
+ {
7821
+ fullWidth: true,
7822
+ variant: "standard",
7823
+ defaultValue: value,
7824
+ label: inputLabel,
7825
+ error: hasError,
7826
+ disabled,
7827
+ onChange: ({ target: { value: value2 } }) => {
7828
+ setValue(value2);
7829
+ },
7830
+ onBlur: ({ target: { value: value2 } }) => {
7831
+ if (hasError) {
7832
+ return;
7833
+ }
7834
+ onUpdateEditableCell?.(rowId, value2);
7835
+ }
7836
+ }
7837
+ );
7838
+ };
7839
+
7840
+ // src/components/TableDesktopRowCell/TableDesktopRowCell.tsx
7841
+ var import_Close = __toESM(require("@mui/icons-material/Close"), 1);
7842
+ var import_Edit = __toESM(require("@mui/icons-material/Edit"), 1);
7843
+ var import_jsx_runtime119 = require("react/jsx-runtime");
7844
+ var TableDesktopRowCell = ({
7845
+ inputLabel,
7846
+ editInitialValue,
7847
+ rowId,
7848
+ fieldName,
7849
+ width,
7850
+ disabled,
7851
+ readOnlyValue,
7852
+ editableCellType,
7853
+ filterOptions,
7854
+ refetchFilterOptions,
7855
+ isFetchingFilterOptions,
7856
+ validateInput,
7857
+ onUpdateEditableCell,
7858
+ onCellClick
7859
+ }) => {
7860
+ const cellRef = (0, import_react38.useRef)(null);
7861
+ const [isOverflowed, setIsOverflowed] = (0, import_react38.useState)(false);
7862
+ const [isCellHovered, setIsCellHovered] = (0, import_react38.useState)(false);
7863
+ const [isEditMode, setIsEditMode] = (0, import_react38.useState)(false);
7864
+ (0, import_react38.useEffect)(() => {
7865
+ const ref = cellRef.current;
7866
+ if (ref) {
7867
+ setIsOverflowed(ref.scrollWidth > ref.clientWidth);
7868
+ }
7869
+ }, [readOnlyValue, width]);
7870
+ (0, import_react38.useEffect)(() => {
7871
+ const handleKeyDown = (e) => {
7872
+ if (e.key === "Escape") {
7873
+ setIsEditMode(false);
7874
+ }
7875
+ };
7876
+ if (isEditMode) {
7877
+ window.addEventListener("keydown", handleKeyDown);
7878
+ }
7879
+ return () => {
7880
+ window.removeEventListener("keydown", handleKeyDown);
7881
+ };
7882
+ }, [isEditMode]);
7883
+ const editableComponents = {
7884
+ "select": /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(
7885
+ TableDesktopSmartSelect,
7886
+ {
7887
+ rowId,
7888
+ fieldName,
7889
+ disabled,
7890
+ initialValue: editInitialValue,
7891
+ inputLabel: inputLabel ?? "",
7892
+ filterOptions,
7893
+ refetchFilterOptions,
7894
+ isFetchingFilterOptions,
7895
+ onUpdateEditableCell
7896
+ }
7897
+ ),
7898
+ "checkbox": /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(
7899
+ import_material65.Checkbox,
7900
+ {
7901
+ disableRipple: true,
7902
+ disabled,
7903
+ defaultChecked: editInitialValue,
7904
+ onChange: ({ target: { checked } }) => {
7905
+ onUpdateEditableCell?.(rowId, checked);
7906
+ }
7907
+ }
7908
+ ),
7909
+ "text": /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(
7910
+ TableDesktopTextField,
7911
+ {
7912
+ rowId,
7913
+ disabled,
7914
+ editInitialValue,
7915
+ inputLabel: inputLabel ?? "",
7916
+ validateInput,
7917
+ onUpdateEditableCell
7918
+ }
7919
+ ),
7920
+ "numeric": /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(
7921
+ import_material65.TextField,
7922
+ {
7923
+ fullWidth: true,
7924
+ variant: "standard",
7925
+ disabled,
7926
+ defaultValue: editInitialValue,
7927
+ label: inputLabel,
7928
+ onChange: (e) => {
7929
+ e.target.value = e.target.value.replace(/\D/g, "");
7930
+ },
7931
+ onBlur: ({ target: { value } }) => {
7932
+ onUpdateEditableCell?.(rowId, value);
7933
+ },
7934
+ slotProps: {
7935
+ input: {
7936
+ inputMode: "numeric"
7937
+ }
7938
+ }
7939
+ }
7940
+ )
7941
+ };
7942
+ const getReadOnlyBooleanIcon = (value) => {
7943
+ if (value) {
7944
+ return /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(import_Check2.default, { sx: { fontSize: 16 } });
7945
+ }
7946
+ return "-";
7947
+ };
7948
+ const handleEditClick = (e) => {
7949
+ e.stopPropagation();
7950
+ setIsEditMode((prev) => !prev);
7951
+ };
7952
+ return /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(import_material65.Tooltip, { title: isOverflowed ? String(readOnlyValue) : "", arrow: true, children: /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(
7953
+ import_material65.TableCell,
7954
+ {
7955
+ align: "left",
7956
+ onMouseEnter: () => editableCellType && !disabled && setIsCellHovered(true),
7957
+ onMouseLeave: () => editableCellType && !disabled && setIsCellHovered(false),
7958
+ onClick: (event) => !disabled && onCellClick?.(event, isEditMode),
7959
+ sx: {
7960
+ padding: 1,
7961
+ width: width ?? "auto",
7962
+ position: "relative",
7963
+ cursor: disabled ? "default" : "pointer",
7964
+ opacity: disabled ? 0.2 : 1,
7965
+ ":hover": editableCellType && {
7966
+ background: isEditMode ? colors.lightBlueBackground : colors.neutral100
7967
+ },
7968
+ background: isEditMode ? colors.lightBlueBackground : (theme) => theme.palette.background.default
7969
+ },
7970
+ children: /* @__PURE__ */ (0, import_jsx_runtime119.jsxs)(
7971
+ import_material65.Box,
7972
+ {
7973
+ p: 1,
7974
+ ref: cellRef,
7975
+ overflow: "hidden",
7976
+ textOverflow: "ellipsis",
7977
+ whiteSpace: "nowrap",
7978
+ children: [
7979
+ isCellHovered ? /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(import_material65.Tooltip, { title: isEditMode ? "" : "Toggle Edit Mode", children: /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(
7980
+ import_material65.IconButton,
7981
+ {
7982
+ onClick: handleEditClick,
7983
+ sx: {
7984
+ top: 0,
7985
+ right: 0,
7986
+ zIndex: 1,
7987
+ borderRadius: 0,
7988
+ position: "absolute",
7989
+ background: isEditMode ? colors.lightBlueBackground : colors.neutral100,
7990
+ "&:hover": {
7991
+ backgroundColor: isEditMode ? colors.lightBlueBackground : colors.neutral150
7992
+ }
7993
+ },
7994
+ children: isEditMode ? /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(import_Close.default, { fontSize: "small", color: "error" }) : /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(import_Edit.default, { fontSize: "small" })
7995
+ }
7996
+ ) }) : null,
7997
+ isEditMode && editableCellType ? editableComponents[editableCellType] : typeof readOnlyValue === "boolean" ? getReadOnlyBooleanIcon(readOnlyValue) : readOnlyValue
7998
+ ]
7999
+ }
8000
+ )
8001
+ }
8002
+ ) });
7553
8003
  };
7554
- var TableDesktop_default = TableDesktop;
7555
8004
 
7556
8005
  // src/components/TableHeader/TableHeader.tsx
7557
- var import_react35 = require("react");
8006
+ var import_react39 = require("react");
7558
8007
  var import_icons_material12 = require("@mui/icons-material");
7559
- var import_material63 = require("@mui/material");
8008
+ var import_material66 = require("@mui/material");
7560
8009
  var import_mui57 = require("tss-react/mui");
7561
- var import_jsx_runtime114 = require("react/jsx-runtime");
8010
+ var import_jsx_runtime120 = require("react/jsx-runtime");
7562
8011
  var useStyles51 = (0, import_mui57.makeStyles)()(() => ({
7563
8012
  sortLabel: {
7564
8013
  "& .MuiTableSortLabel-icon": {
@@ -7567,9 +8016,9 @@ var useStyles51 = (0, import_mui57.makeStyles)()(() => ({
7567
8016
  }
7568
8017
  }));
7569
8018
  var TableHeader = ({ cells, onSort = null }) => {
7570
- const [sortableCells, setSortableCells] = (0, import_react35.useState)([]);
8019
+ const [sortableCells, setSortableCells] = (0, import_react39.useState)([]);
7571
8020
  const { classes } = useStyles51();
7572
- (0, import_react35.useEffect)(() => {
8021
+ (0, import_react39.useEffect)(() => {
7573
8022
  setSortableCells(cells);
7574
8023
  }, []);
7575
8024
  const getNewSortDirection = (direction) => {
@@ -7603,8 +8052,8 @@ var TableHeader = ({ cells, onSort = null }) => {
7603
8052
  });
7604
8053
  setSortableCells(sortedCells);
7605
8054
  };
7606
- 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)(
7607
- import_material63.TableSortLabel,
8055
+ return /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(import_material66.TableHead, { children: /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(import_material66.TableRow, { children: sortableCells.map((cell, key) => /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(import_material66.TableCell, { children: cell.isSortable ? /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(
8056
+ import_material66.TableSortLabel,
7608
8057
  {
7609
8058
  className: classes.sortLabel,
7610
8059
  direction: cell?.direction || "asc",
@@ -7614,12 +8063,12 @@ var TableHeader = ({ cells, onSort = null }) => {
7614
8063
  }
7615
8064
  ) : cell.label }, cell.label || key)) }) });
7616
8065
  };
7617
- var TableHeader_default = (0, import_react35.memo)(TableHeader);
8066
+ var TableHeader_default = (0, import_react39.memo)(TableHeader);
7618
8067
 
7619
8068
  // src/components/TextDivider/TextDivider.tsx
7620
- var import_material64 = require("@mui/material");
8069
+ var import_material67 = require("@mui/material");
7621
8070
  var import_mui58 = require("tss-react/mui");
7622
- var import_jsx_runtime115 = require("react/jsx-runtime");
8071
+ var import_jsx_runtime121 = require("react/jsx-runtime");
7623
8072
  var useStyles52 = (0, import_mui58.makeStyles)()(() => ({
7624
8073
  icon: {
7625
8074
  fontSize: 20
@@ -7656,19 +8105,19 @@ var TextDivider = ({
7656
8105
  }) => {
7657
8106
  const { classes } = useStyles52();
7658
8107
  const iconColor = color ?? colors.neutral900;
7659
- return /* @__PURE__ */ (0, import_jsx_runtime115.jsxs)(
7660
- import_material64.Box,
8108
+ return /* @__PURE__ */ (0, import_jsx_runtime121.jsxs)(
8109
+ import_material67.Box,
7661
8110
  {
7662
8111
  display: "flex",
7663
8112
  alignItems: "center",
7664
8113
  justifyContent: "space-between",
7665
8114
  className: classes.container,
7666
8115
  children: [
7667
- /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(import_material64.Divider, { className: classes.leftDivider }),
7668
- /* @__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: [
7669
- Icon2 && iconPosition === "left" && /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(Icon2, { className: classes.icon, style: { color: iconColor } }),
7670
- /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(
7671
- import_material64.Typography,
8116
+ /* @__PURE__ */ (0, import_jsx_runtime121.jsx)(import_material67.Divider, { className: classes.leftDivider }),
8117
+ /* @__PURE__ */ (0, import_jsx_runtime121.jsx)(import_material67.Button, { onClick, disabled: !onClick, className: classes.button, children: /* @__PURE__ */ (0, import_jsx_runtime121.jsxs)(import_material67.Box, { className: classes.center, children: [
8118
+ Icon2 && iconPosition === "left" && /* @__PURE__ */ (0, import_jsx_runtime121.jsx)(Icon2, { className: classes.icon, style: { color: iconColor } }),
8119
+ /* @__PURE__ */ (0, import_jsx_runtime121.jsx)(
8120
+ import_material67.Typography,
7672
8121
  {
7673
8122
  color: "textSecondary",
7674
8123
  className: classes.title,
@@ -7676,9 +8125,9 @@ var TextDivider = ({
7676
8125
  children: title
7677
8126
  }
7678
8127
  ),
7679
- Icon2 && iconPosition === "right" && /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(Icon2, { className: classes.icon, style: { color: iconColor } })
8128
+ Icon2 && iconPosition === "right" && /* @__PURE__ */ (0, import_jsx_runtime121.jsx)(Icon2, { className: classes.icon, style: { color: iconColor } })
7680
8129
  ] }) }),
7681
- /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(import_material64.Divider, { className: classes.rightDivider })
8130
+ /* @__PURE__ */ (0, import_jsx_runtime121.jsx)(import_material67.Divider, { className: classes.rightDivider })
7682
8131
  ]
7683
8132
  }
7684
8133
  );
@@ -7690,7 +8139,7 @@ var import_react_dates = require("react-dates");
7690
8139
  var import_mui59 = require("tss-react/mui");
7691
8140
  var import_initialize = require("react-dates/initialize");
7692
8141
  var import_datepicker = require("react-dates/lib/css/_datepicker.css");
7693
- var import_jsx_runtime116 = require("react/jsx-runtime");
8142
+ var import_jsx_runtime122 = require("react/jsx-runtime");
7694
8143
  var useStyles53 = (0, import_mui59.makeStyles)()((theme) => ({
7695
8144
  wrapper: {
7696
8145
  "& .DateRangePicker": {
@@ -7786,15 +8235,15 @@ var ThemedDateRangePicker = ({
7786
8235
  ...props
7787
8236
  }) => {
7788
8237
  const { classes, cx } = useStyles53();
7789
- 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 }) });
8238
+ return /* @__PURE__ */ (0, import_jsx_runtime122.jsx)("div", { className: cx(classes.wrapper, className), children: /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(import_react_dates.DateRangePicker, { ...props }) });
7790
8239
  };
7791
8240
  var ThemedDateRangePicker_default = ThemedDateRangePicker;
7792
8241
 
7793
8242
  // src/components/TheToolbar/TheToolbar.tsx
7794
- var import_react36 = require("react");
7795
- var import_material65 = require("@mui/material");
8243
+ var import_react40 = require("react");
8244
+ var import_material68 = require("@mui/material");
7796
8245
  var import_mui60 = require("tss-react/mui");
7797
- var import_jsx_runtime117 = require("react/jsx-runtime");
8246
+ var import_jsx_runtime123 = require("react/jsx-runtime");
7798
8247
  var useStyles54 = (0, import_mui60.makeStyles)()((theme) => ({
7799
8248
  menuButton: {
7800
8249
  color: theme.palette.primary.contrastText
@@ -7814,9 +8263,9 @@ var TheToolbar = ({
7814
8263
  rightSection
7815
8264
  }) => {
7816
8265
  const { classes } = useStyles54();
7817
- return /* @__PURE__ */ (0, import_jsx_runtime117.jsxs)(import_material65.Box, { children: [
7818
- /* @__PURE__ */ (0, import_jsx_runtime117.jsx)(import_material65.AppBar, { children: /* @__PURE__ */ (0, import_jsx_runtime117.jsxs)(import_material65.Toolbar, { className: classes.topBar, children: [
7819
- /* @__PURE__ */ (0, import_jsx_runtime117.jsx)(
8266
+ return /* @__PURE__ */ (0, import_jsx_runtime123.jsxs)(import_material68.Box, { children: [
8267
+ /* @__PURE__ */ (0, import_jsx_runtime123.jsx)(import_material68.AppBar, { children: /* @__PURE__ */ (0, import_jsx_runtime123.jsxs)(import_material68.Toolbar, { className: classes.topBar, children: [
8268
+ /* @__PURE__ */ (0, import_jsx_runtime123.jsx)(
7820
8269
  RoundButton_default,
7821
8270
  {
7822
8271
  className: classes.menuButton,
@@ -7825,7 +8274,7 @@ var TheToolbar = ({
7825
8274
  onClick: handleOpen
7826
8275
  }
7827
8276
  ),
7828
- /* @__PURE__ */ (0, import_jsx_runtime117.jsx)(
8277
+ /* @__PURE__ */ (0, import_jsx_runtime123.jsx)(
7829
8278
  CompanyLogo_default,
7830
8279
  {
7831
8280
  size: "small",
@@ -7834,31 +8283,31 @@ var TheToolbar = ({
7834
8283
  imageLogoLightSmall
7835
8284
  }
7836
8285
  ),
7837
- /* @__PURE__ */ (0, import_jsx_runtime117.jsx)(import_material65.Box, { ml: 2, children: leftSection }),
7838
- /* @__PURE__ */ (0, import_jsx_runtime117.jsx)(import_material65.Box, { ml: "auto", children: rightSection })
8286
+ /* @__PURE__ */ (0, import_jsx_runtime123.jsx)(import_material68.Box, { ml: 2, children: leftSection }),
8287
+ /* @__PURE__ */ (0, import_jsx_runtime123.jsx)(import_material68.Box, { ml: "auto", children: rightSection })
7839
8288
  ] }) }),
7840
8289
  LeftDrawer
7841
8290
  ] });
7842
8291
  };
7843
- var TheToolbar_default = (0, import_react36.memo)(TheToolbar);
8292
+ var TheToolbar_default = (0, import_react40.memo)(TheToolbar);
7844
8293
 
7845
8294
  // src/components/ToastMessage/ToastMessage.tsx
7846
- var import_material66 = require("@mui/material");
7847
- var import_jsx_runtime118 = require("react/jsx-runtime");
8295
+ var import_material69 = require("@mui/material");
8296
+ var import_jsx_runtime124 = require("react/jsx-runtime");
7848
8297
  var ToastMessage = ({
7849
8298
  toastType,
7850
8299
  toastMessage,
7851
8300
  open,
7852
8301
  onClose
7853
- }) => /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(
7854
- import_material66.Snackbar,
8302
+ }) => /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(
8303
+ import_material69.Snackbar,
7855
8304
  {
7856
8305
  open,
7857
8306
  autoHideDuration: 1500,
7858
8307
  onClose,
7859
8308
  anchorOrigin: { vertical: "top", horizontal: "right" },
7860
- children: /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(
7861
- import_material66.Alert,
8309
+ children: /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(
8310
+ import_material69.Alert,
7862
8311
  {
7863
8312
  elevation: 6,
7864
8313
  variant: "filled",
@@ -7884,9 +8333,9 @@ var ToastMessage = ({
7884
8333
  var ToastMessage_default = ToastMessage;
7885
8334
 
7886
8335
  // src/components/TwoButtonDialog/TwoButtonDialog.tsx
7887
- var import_material67 = require("@mui/material");
8336
+ var import_material70 = require("@mui/material");
7888
8337
  var import_mui61 = require("tss-react/mui");
7889
- var import_jsx_runtime119 = require("react/jsx-runtime");
8338
+ var import_jsx_runtime125 = require("react/jsx-runtime");
7890
8339
  var useStyles55 = (0, import_mui61.makeStyles)()((theme) => ({
7891
8340
  paper: {
7892
8341
  padding: theme.spacing(2)
@@ -7916,20 +8365,20 @@ var TwoButtonDialog = ({
7916
8365
  cancelButton
7917
8366
  }) => {
7918
8367
  const { classes } = useStyles55();
7919
- return /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(
7920
- import_material67.Dialog,
8368
+ return /* @__PURE__ */ (0, import_jsx_runtime125.jsx)(
8369
+ import_material70.Dialog,
7921
8370
  {
7922
8371
  open,
7923
8372
  disableEnforceFocus: true,
7924
8373
  maxWidth: "sm",
7925
8374
  fullWidth: true,
7926
8375
  closeAfterTransition: true,
7927
- BackdropComponent: import_material67.Backdrop,
8376
+ BackdropComponent: import_material70.Backdrop,
7928
8377
  BackdropProps: { timeout: 500 },
7929
- 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: [
7930
- /* @__PURE__ */ (0, import_jsx_runtime119.jsxs)(import_material67.Box, { className: classes.mb, children: [
7931
- /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(import_material67.Typography, { variant: "h5", component: "div", children: /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(
7932
- import_material67.Box,
8378
+ children: /* @__PURE__ */ (0, import_jsx_runtime125.jsx)(import_material70.Fade, { in: open, children: /* @__PURE__ */ (0, import_jsx_runtime125.jsxs)(import_material70.Paper, { className: classes.paper, children: [
8379
+ /* @__PURE__ */ (0, import_jsx_runtime125.jsxs)(import_material70.Box, { className: classes.mb, children: [
8380
+ /* @__PURE__ */ (0, import_jsx_runtime125.jsx)(import_material70.Typography, { variant: "h5", component: "div", children: /* @__PURE__ */ (0, import_jsx_runtime125.jsx)(
8381
+ import_material70.Box,
7933
8382
  {
7934
8383
  sx: {
7935
8384
  fontWeight: 600
@@ -7937,23 +8386,23 @@ var TwoButtonDialog = ({
7937
8386
  children: title
7938
8387
  }
7939
8388
  ) }),
7940
- /* @__PURE__ */ (0, import_jsx_runtime119.jsxs)(
7941
- import_material67.Box,
8389
+ /* @__PURE__ */ (0, import_jsx_runtime125.jsxs)(
8390
+ import_material70.Box,
7942
8391
  {
7943
8392
  className: classes.mt,
7944
8393
  sx: {
7945
8394
  fontWeight: 600
7946
8395
  },
7947
8396
  children: [
7948
- subtitle1 && /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(import_material67.Typography, { variant: "subtitle1", children: subtitle1 }),
7949
- subtitle2 && /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(import_material67.Typography, { variant: "subtitle1", children: subtitle2 })
8397
+ subtitle1 && /* @__PURE__ */ (0, import_jsx_runtime125.jsx)(import_material70.Typography, { variant: "subtitle1", children: subtitle1 }),
8398
+ subtitle2 && /* @__PURE__ */ (0, import_jsx_runtime125.jsx)(import_material70.Typography, { variant: "subtitle1", children: subtitle2 })
7950
8399
  ]
7951
8400
  }
7952
8401
  )
7953
8402
  ] }),
7954
- /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(import_material67.Divider, {}),
7955
- /* @__PURE__ */ (0, import_jsx_runtime119.jsxs)(import_material67.Box, { className: classes.buttonContainer, children: [
7956
- /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(
8403
+ /* @__PURE__ */ (0, import_jsx_runtime125.jsx)(import_material70.Divider, {}),
8404
+ /* @__PURE__ */ (0, import_jsx_runtime125.jsxs)(import_material70.Box, { className: classes.buttonContainer, children: [
8405
+ /* @__PURE__ */ (0, import_jsx_runtime125.jsx)(
7957
8406
  FilledButton_default,
7958
8407
  {
7959
8408
  copy: cancelLabel,
@@ -7966,7 +8415,7 @@ var TwoButtonDialog = ({
7966
8415
  }
7967
8416
  }
7968
8417
  ),
7969
- /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(
8418
+ /* @__PURE__ */ (0, import_jsx_runtime125.jsx)(
7970
8419
  FilledButton_default,
7971
8420
  {
7972
8421
  color: "primary",
@@ -7975,7 +8424,7 @@ var TwoButtonDialog = ({
7975
8424
  }
7976
8425
  )
7977
8426
  ] }),
7978
- /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(Loading_default, { isLoading: dialogLoading })
8427
+ /* @__PURE__ */ (0, import_jsx_runtime125.jsx)(Loading_default, { isLoading: dialogLoading })
7979
8428
  ] }) })
7980
8429
  }
7981
8430
  );
@@ -7983,30 +8432,30 @@ var TwoButtonDialog = ({
7983
8432
  var TwoButtonDialog_default = TwoButtonDialog;
7984
8433
 
7985
8434
  // src/components/UserBust/UserBust.tsx
7986
- var import_react37 = require("react");
7987
- var import_material68 = require("@mui/material");
7988
- var import_jsx_runtime120 = require("react/jsx-runtime");
7989
- var UserBust = ({ user, avatarProps, typographyProps }) => /* @__PURE__ */ (0, import_jsx_runtime120.jsxs)("div", { children: [
7990
- /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(
7991
- import_material68.Avatar,
8435
+ var import_react41 = require("react");
8436
+ var import_material71 = require("@mui/material");
8437
+ var import_jsx_runtime126 = require("react/jsx-runtime");
8438
+ var UserBust = ({ user, avatarProps, typographyProps }) => /* @__PURE__ */ (0, import_jsx_runtime126.jsxs)("div", { children: [
8439
+ /* @__PURE__ */ (0, import_jsx_runtime126.jsx)(
8440
+ import_material71.Avatar,
7992
8441
  {
7993
8442
  src: user.profile_picture,
7994
8443
  alt: "user_avatar",
7995
8444
  style: { width: avatarProps.width, height: avatarProps.height }
7996
8445
  }
7997
8446
  ),
7998
- /* @__PURE__ */ (0, import_jsx_runtime120.jsxs)("div", { style: { paddingTop: 16 }, children: [
7999
- /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(import_material68.Typography, { ...typographyProps.name, children: `${user.first_name} ${user.last_name}` }),
8000
- /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(import_material68.Typography, { ...typographyProps.username, children: user.username })
8447
+ /* @__PURE__ */ (0, import_jsx_runtime126.jsxs)("div", { style: { paddingTop: 16 }, children: [
8448
+ /* @__PURE__ */ (0, import_jsx_runtime126.jsx)(import_material71.Typography, { ...typographyProps.name, children: `${user.first_name} ${user.last_name}` }),
8449
+ /* @__PURE__ */ (0, import_jsx_runtime126.jsx)(import_material71.Typography, { ...typographyProps.username, children: user.username })
8001
8450
  ] })
8002
8451
  ] });
8003
- var UserBust_default = (0, import_react37.memo)(UserBust);
8452
+ var UserBust_default = (0, import_react41.memo)(UserBust);
8004
8453
 
8005
8454
  // src/components/icons/IconChart.tsx
8006
- var import_jsx_runtime121 = require("react/jsx-runtime");
8455
+ var import_jsx_runtime127 = require("react/jsx-runtime");
8007
8456
  var SvgIconChart = (props) => {
8008
8457
  const { fill } = props;
8009
- return /* @__PURE__ */ (0, import_jsx_runtime121.jsx)(
8458
+ return /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(
8010
8459
  "svg",
8011
8460
  {
8012
8461
  width: "20",
@@ -8015,7 +8464,7 @@ var SvgIconChart = (props) => {
8015
8464
  fill: "none",
8016
8465
  xmlns: "http://www.w3.org/2000/svg",
8017
8466
  ...props,
8018
- children: /* @__PURE__ */ (0, import_jsx_runtime121.jsx)(
8467
+ children: /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(
8019
8468
  "path",
8020
8469
  {
8021
8470
  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",
@@ -8082,6 +8531,7 @@ var IconChart_default = SvgIconChart;
8082
8531
  ScrollableDialog,
8083
8532
  SearchAndFilterHeader,
8084
8533
  SearchAndFilterHeaderForTable,
8534
+ SearchFieldDebounced,
8085
8535
  SearchWithFilters,
8086
8536
  SearchWithFiltersForTable,
8087
8537
  SectionName,
@@ -8093,6 +8543,9 @@ var IconChart_default = SvgIconChart;
8093
8543
  Switch,
8094
8544
  Table,
8095
8545
  TableDesktop,
8546
+ TableDesktopFooter,
8547
+ TableDesktopRowCell,
8548
+ TableDesktopSmartSelect,
8096
8549
  TableEmptyResult,
8097
8550
  TableHeader,
8098
8551
  TableLoading,