@natoora-libs/core 0.1.11 → 0.1.13

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,64 @@ 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;
7279
-
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");
6944
+ var SmartTableHeader_default = (0, import_react32.memo)(SmartTableHeader);
7284
6945
 
7285
6946
  // 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)()(() => ({
6947
+ var import_material59 = require("@mui/material");
6948
+ var import_mui53 = require("tss-react/mui");
6949
+ var import_jsx_runtime110 = require("react/jsx-runtime");
6950
+ var useStyles47 = (0, import_mui53.makeStyles)()(() => ({
7290
6951
  tableCellIcon: { padding: 24, height: "calc(100vh - 320px)" },
7291
6952
  tableCellDefault: { padding: 24 }
7292
6953
  }));
@@ -7296,18 +6957,18 @@ var TableEmptyResult = ({
7296
6957
  handleClickOnClearFiltersButton = () => {
7297
6958
  }
7298
6959
  }) => {
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,
6960
+ const { classes } = useStyles47();
6961
+ return showClearFilterButton ? /* @__PURE__ */ (0, import_jsx_runtime110.jsx)(import_material59.TableRow, { children: /* @__PURE__ */ (0, import_jsx_runtime110.jsxs)(
6962
+ import_material59.TableCell,
7302
6963
  {
7303
6964
  className: classes.tableCellIcon,
7304
6965
  colSpan,
7305
6966
  align: "center",
7306
6967
  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)(
6968
+ /* @__PURE__ */ (0, import_jsx_runtime110.jsx)(EmptyGlassIcon_default, {}),
6969
+ /* @__PURE__ */ (0, import_jsx_runtime110.jsx)(import_material59.Typography, { variant: "h6", children: "No results found." }),
6970
+ /* @__PURE__ */ (0, import_jsx_runtime110.jsx)(import_material59.Typography, { variant: "subtitle1", children: "Search without applied filters?" }),
6971
+ /* @__PURE__ */ (0, import_jsx_runtime110.jsx)(
7311
6972
  FilledButton_default,
7312
6973
  {
7313
6974
  copy: "Search",
@@ -7318,8 +6979,8 @@ var TableEmptyResult = ({
7318
6979
  )
7319
6980
  ]
7320
6981
  }
7321
- ) }) : /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(import_material61.TableRow, { children: /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(
7322
- import_material61.TableCell,
6982
+ ) }) : /* @__PURE__ */ (0, import_jsx_runtime110.jsx)(import_material59.TableRow, { children: /* @__PURE__ */ (0, import_jsx_runtime110.jsx)(
6983
+ import_material59.TableCell,
7323
6984
  {
7324
6985
  className: classes.tableCellDefault,
7325
6986
  colSpan,
@@ -7331,8 +6992,9 @@ var TableEmptyResult = ({
7331
6992
  var TableEmptyResult_default = TableEmptyResult;
7332
6993
 
7333
6994
  // src/components/TableDesktop/TableDesktop.tsx
7334
- var import_jsx_runtime113 = require("react/jsx-runtime");
7335
- var useStyles50 = (0, import_mui56.makeStyles)()((theme) => ({
6995
+ var import_jsx_runtime111 = require("react/jsx-runtime");
6996
+ var ROW_HEIGHT = 56;
6997
+ var useStyles48 = (0, import_mui54.makeStyles)()((theme) => ({
7336
6998
  root: {
7337
6999
  justifyContent: "space-between",
7338
7000
  display: "flex",
@@ -7362,7 +7024,7 @@ var useStyles50 = (0, import_mui56.makeStyles)()((theme) => ({
7362
7024
  }
7363
7025
  }
7364
7026
  }));
7365
- var descendingComparator2 = (a, b, orderBy) => {
7027
+ var descendingComparator = (a, b, orderBy) => {
7366
7028
  const objA = a[orderBy];
7367
7029
  const objB = b[orderBy];
7368
7030
  const valA = typeof objA === "object" ? objA?.name : objA;
@@ -7384,11 +7046,17 @@ var descendingComparator2 = (a, b, orderBy) => {
7384
7046
  }
7385
7047
  return 0;
7386
7048
  };
7387
- var stableSort2 = (array, cmp) => array.map((el, index) => ({ el, index })).sort((a, b) => {
7049
+ var stableSort = (array, cmp) => array.map((el, index) => ({ el, index })).sort((a, b) => {
7388
7050
  const order = cmp(a.el, b.el);
7389
7051
  return order !== 0 ? order : a.index - b.index;
7390
7052
  }).map((el) => el.el);
7391
- var getComparator = (order, orderBy) => order === "desc" ? (a, b) => descendingComparator2(a, b, orderBy) : (a, b) => -descendingComparator2(a, b, orderBy);
7053
+ var getComparator = (order, orderBy) => order === "desc" ? (a, b) => descendingComparator(a, b, orderBy) : (a, b) => -descendingComparator(a, b, orderBy);
7054
+ var resolveOptionType = (option, fieldName) => {
7055
+ if (!option || typeof option !== "object") {
7056
+ return option;
7057
+ }
7058
+ return option[fieldName] || "";
7059
+ };
7392
7060
  var TableDesktop = ({
7393
7061
  data,
7394
7062
  headCells,
@@ -7410,30 +7078,30 @@ var TableDesktop = ({
7410
7078
  onApplyFilters,
7411
7079
  shouldShowCheckOnFilter
7412
7080
  }) => {
7413
- const [order, setOrder] = (0, import_react34.useState)(appliedFilters?.sortDir || "desc");
7414
- const [orderBy, setOrderBy] = (0, import_react34.useState)(
7081
+ const { classes } = useStyles48();
7082
+ const [order, setOrder] = (0, import_react33.useState)(appliedFilters?.sortDir || "desc");
7083
+ const [orderBy, setOrderBy] = (0, import_react33.useState)(
7415
7084
  appliedFilters?.sortField || "delivery_date"
7416
7085
  );
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)(
7086
+ const [selected, setSelected] = (0, import_react33.useState)(/* @__PURE__ */ new Set());
7087
+ const [page] = (0, import_react33.useState)(0);
7088
+ const numRows = data.length;
7089
+ const emptyRows = (0, import_react33.useMemo)(
7422
7090
  () => rowsPerPage - data.length,
7423
7091
  [rowsPerPage, data]
7424
7092
  );
7425
- const visibleHeadCells = (0, import_react34.useMemo)(
7093
+ const visibleHeadCells = (0, import_react33.useMemo)(
7426
7094
  () => headCells.filter((headCell) => headCell?.enabled ?? true),
7427
7095
  [headCells]
7428
7096
  );
7429
- const handleSelectAllClick = (0, import_react34.useCallback)(
7097
+ const handleSelectAllClick = (0, import_react33.useCallback)(
7430
7098
  (event) => {
7431
7099
  if (event.target.checked) {
7432
- const newSelected = data.map((n) => n[keyField]);
7433
- setSelected(newSelected);
7434
- return;
7100
+ const allItems = new Set(data.map((n) => n[keyField]));
7101
+ setSelected(allItems);
7102
+ } else {
7103
+ setSelected(/* @__PURE__ */ new Set());
7435
7104
  }
7436
- setSelected([]);
7437
7105
  },
7438
7106
  [data, keyField]
7439
7107
  );
@@ -7446,119 +7114,871 @@ var TableDesktop = ({
7446
7114
  updateSort(property, orderDir);
7447
7115
  }
7448
7116
  };
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
- );
7117
+ const handleRowCheckboxChange = (0, import_react33.useCallback)(
7118
+ (event, keyFieldValue) => {
7119
+ event.stopPropagation();
7120
+ setSelected((prev) => {
7121
+ const newSelected = new Set(prev);
7122
+ if (newSelected.has(keyFieldValue)) {
7123
+ newSelected.delete(keyFieldValue);
7124
+ } else {
7125
+ newSelected.add(keyFieldValue);
7126
+ }
7127
+ return newSelected;
7128
+ });
7129
+ },
7130
+ []
7131
+ );
7132
+ const renderTableRows = (0, import_react33.useMemo)(() => {
7133
+ if (isLoading) {
7134
+ return [...Array(Math.min(numRows, rowsPerPage))].map((_, rowIndex) => /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(import_material60.TableRow, { children: [...Array(visibleHeadCells.length)].map((_2, cellIndex) => /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(import_material60.TableCell, { children: /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(
7135
+ import_material60.Skeleton,
7136
+ {
7137
+ animation: "pulse",
7138
+ variant: "rounded",
7139
+ height: ROW_HEIGHT - 33,
7140
+ sx: { bgcolor: colors.neutral100 },
7141
+ "data-testid": "loading-skeleton"
7142
+ }
7143
+ ) }, cellIndex)) }, rowIndex));
7144
+ }
7145
+ const sortedData = disableInternalSort ? data : stableSort(data, getComparator(order, orderBy));
7146
+ return sortedData.slice(page * rowsPerPage, page * rowsPerPage + rowsPerPage).map((row, index) => {
7147
+ const isItemSelected = selected.has(row[keyField]);
7148
+ return /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(
7149
+ RenderItem,
7150
+ {
7151
+ ...{
7152
+ ...row,
7153
+ index,
7154
+ deleteItem,
7155
+ isItemSelected,
7156
+ enableCheckboxSelection,
7157
+ rowHeight: ROW_HEIGHT,
7158
+ rowId: row[keyField],
7159
+ handleRowCheckboxChange,
7160
+ visibleHeadCells
7161
+ }
7162
+ },
7163
+ row[keyField] ?? index
7164
+ );
7165
+ });
7166
+ }, [
7167
+ data,
7168
+ order,
7169
+ orderBy,
7170
+ page,
7171
+ rowsPerPage,
7172
+ selected,
7173
+ isLoading,
7174
+ numRows,
7175
+ enableCheckboxSelection,
7176
+ disableInternalSort,
7177
+ deleteItem,
7178
+ keyField,
7179
+ handleRowCheckboxChange,
7180
+ visibleHeadCells,
7181
+ RenderItem
7182
+ ]);
7183
+ (0, import_react33.useEffect)(() => {
7184
+ if (!enableCheckboxSelection) {
7185
+ setSelected(/* @__PURE__ */ new Set());
7186
+ }
7187
+ }, [enableCheckboxSelection]);
7188
+ return /* @__PURE__ */ (0, import_jsx_runtime111.jsx)("div", { className: classes.root, style: { height }, children: /* @__PURE__ */ (0, import_jsx_runtime111.jsxs)(import_material60.Paper, { className: classes.paper, children: [
7189
+ /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(import_material60.TableContainer, { className: classes.container, children: /* @__PURE__ */ (0, import_jsx_runtime111.jsxs)(
7190
+ import_material60.Table,
7191
+ {
7192
+ stickyHeader: true,
7193
+ "aria-labelledby": "tableTitle",
7194
+ "aria-label": "sticky table",
7195
+ style: { tableLayout },
7196
+ children: [
7197
+ /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(
7198
+ SmartTableHeader_default,
7199
+ {
7200
+ headCells: visibleHeadCells,
7201
+ order,
7202
+ orderBy,
7203
+ numSelected: selected.size,
7204
+ numRows,
7205
+ enableCheckboxSelection,
7206
+ headerFilters: headerFilters ?? {},
7207
+ onRequestSort: handleRequestSort,
7208
+ onSelectAllClick: handleSelectAllClick,
7209
+ onApplyFilters,
7210
+ shouldShowCheckOnFilter
7211
+ }
7212
+ ),
7213
+ /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(import_material60.TableBody, { children: rowsPerPage !== emptyRows ? renderTableRows : /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(
7214
+ TableEmptyResult_default,
7215
+ {
7216
+ colSpan: enableCheckboxSelection ? visibleHeadCells.length + 1 : visibleHeadCells.length,
7217
+ showClearFilterButton,
7218
+ handleClickOnClearFiltersButton
7219
+ }
7220
+ ) })
7221
+ ]
7222
+ }
7223
+ ) }),
7224
+ children
7225
+ ] }) });
7226
+ };
7227
+ var TableDesktop_default = TableDesktop;
7228
+
7229
+ // src/components/SmartTableHeaderFilterMenu/SmartTableHeaderFilterMenu.tsx
7230
+ var import_jsx_runtime112 = require("react/jsx-runtime");
7231
+ var useStyles49 = (0, import_mui55.makeStyles)()((theme) => ({
7232
+ filterMenu: {
7233
+ display: "flex",
7234
+ flexDirection: "column"
7235
+ },
7236
+ filterOptions: {
7237
+ maxHeight: theme.spacing(62),
7238
+ overflowY: "auto",
7239
+ "&::-webkit-scrollbar": {
7240
+ width: "8px",
7241
+ height: "8px"
7242
+ },
7243
+ "&::-webkit-scrollbar-track": {
7244
+ backgroundColor: theme.palette.mode === "dark" ? theme.palette.grey[800] : theme.palette.grey[100]
7245
+ },
7246
+ "&::-webkit-scrollbar-thumb": {
7247
+ backgroundColor: theme.palette.mode === "dark" ? theme.palette.grey[900] : theme.palette.grey[400],
7248
+ borderRadius: "10px"
7249
+ },
7250
+ "&::-webkit-scrollbar-thumb:hover": {
7251
+ backgroundColor: theme.palette.mode === "dark" ? theme.palette.common.black : theme.palette.grey[500]
7252
+ }
7253
+ },
7254
+ filter: {
7255
+ display: "flex",
7256
+ alignItems: "center",
7257
+ justifyContent: "space-between",
7258
+ padding: theme.spacing(0, 3)
7259
+ },
7260
+ applyFilterButtonsContainer: {
7261
+ display: "flex",
7262
+ padding: theme.spacing(0, 1),
7263
+ justifyContent: "space-between"
7264
+ },
7265
+ saveAsDefaultButton: {
7266
+ color: theme.palette.primary.main
7267
+ },
7268
+ skeleton: {
7269
+ height: theme.spacing(3),
7270
+ margin: theme.spacing(1)
7271
+ }
7272
+ }));
7273
+ var findFilterIndex = (filters, filterOption) => filters.findIndex((item) => {
7274
+ if (typeof item === "string" && typeof filterOption === "string") {
7275
+ return item === filterOption;
7276
+ }
7277
+ if (typeof item === "object" && typeof filterOption === "object") {
7278
+ return item.id === filterOption.id;
7279
+ }
7280
+ return false;
7281
+ });
7282
+ var SmartTableHeaderFilterMenu = ({
7283
+ headCell,
7284
+ numActiveFilters,
7285
+ headerFilters,
7286
+ shouldShowCheckOnFilter,
7287
+ onApplyFilters
7288
+ }) => {
7289
+ const { classes } = useStyles49();
7290
+ const [anchorEl, setAnchorEl] = (0, import_react34.useState)(null);
7291
+ const [filterOptionsData, setFilterOptionsData] = (0, import_react34.useState)();
7292
+ const [selectedFilters, setSelectedFilters] = (0, import_react34.useState)(
7293
+ headerFilters[headCell.id] ?? []
7294
+ );
7295
+ (0, import_react34.useEffect)(() => {
7296
+ if (headCell.filterOptions) {
7297
+ setFilterOptionsData(headCell.filterOptions);
7298
+ }
7299
+ }, [headCell.filterOptions]);
7300
+ const numFilterOptions = (0, import_react34.useMemo)(() => filterOptionsData?.length ?? 0, [filterOptionsData?.length]);
7301
+ const numCurrentSelectedFilters = selectedFilters.length;
7302
+ const handleFilterMenuOpen = (event) => {
7303
+ if (!numFilterOptions) {
7304
+ headCell.refetchFilterOptions?.();
7305
+ }
7306
+ setAnchorEl(event.currentTarget);
7307
+ };
7308
+ const handleFilterMenuClose = () => {
7309
+ setSelectedFilters(headerFilters[headCell.id]);
7310
+ setAnchorEl(null);
7311
+ };
7312
+ const handleFilterOptionClick = (option) => {
7313
+ const selectedIndex = findFilterIndex(selectedFilters, option);
7314
+ let newSelected;
7315
+ if (selectedIndex === -1) {
7316
+ if (typeof option === "string") {
7317
+ newSelected = [...selectedFilters, option];
7318
+ } else {
7319
+ newSelected = [...selectedFilters, option];
7320
+ }
7321
+ } else {
7322
+ newSelected = selectedFilters.filter(
7323
+ (_, index) => index !== selectedIndex
7324
+ );
7325
+ }
7326
+ setSelectedFilters(newSelected);
7327
+ };
7328
+ const handleApplyFilters = (shouldSave) => {
7329
+ const updatedFilters = {
7330
+ ...headerFilters,
7331
+ [headCell.id]: [...selectedFilters]
7332
+ };
7333
+ onApplyFilters?.(updatedFilters, shouldSave);
7334
+ setAnchorEl(null);
7335
+ };
7336
+ (0, import_react34.useEffect)(() => {
7337
+ setSelectedFilters(headerFilters[headCell.id] ?? []);
7338
+ }, [headerFilters, headCell.id]);
7339
+ const isOptionChecked = (0, import_react34.useMemo)(() => (resolvedOption) => !!selectedFilters?.some(
7340
+ (value) => resolveOptionType(value, headCell.fieldName ?? "") === resolvedOption
7341
+ ), [selectedFilters]);
7342
+ const loadingSkeletons = /* @__PURE__ */ (0, import_jsx_runtime112.jsxs)(import_material61.Box, { "data-testid": "loading-skeletons", width: 272, children: [
7343
+ /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(import_material61.Skeleton, { variant: "rounded", className: classes.skeleton }),
7344
+ /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(import_material61.Divider, {}),
7345
+ /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(import_material61.Skeleton, { variant: "rounded", className: classes.skeleton }),
7346
+ /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(import_material61.Skeleton, { variant: "rounded", className: classes.skeleton }),
7347
+ /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(import_material61.Skeleton, { variant: "rounded", className: classes.skeleton }),
7348
+ /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(import_material61.Skeleton, { variant: "rounded", className: classes.skeleton }),
7349
+ /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(import_material61.Divider, {}),
7350
+ /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(import_material61.Skeleton, { variant: "rounded", className: classes.skeleton })
7351
+ ] });
7352
+ return /* @__PURE__ */ (0, import_jsx_runtime112.jsxs)(import_jsx_runtime112.Fragment, { children: [
7353
+ /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(
7354
+ ActiveFiltersIconButton_default,
7355
+ {
7356
+ numActiveFilters,
7357
+ handleClick: handleFilterMenuOpen,
7358
+ className: (0, import_classnames3.default)("filter-menu-trigger", {
7359
+ "has-active-filters": !!numActiveFilters || !!anchorEl
7360
+ })
7361
+ }
7362
+ ),
7363
+ /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(
7364
+ import_material61.Menu,
7365
+ {
7366
+ open: !!anchorEl,
7367
+ onClose: handleFilterMenuClose,
7368
+ anchorEl,
7369
+ "data-testid": "filter-menu",
7370
+ anchorOrigin: { vertical: "bottom", horizontal: "right" },
7371
+ transformOrigin: { vertical: "top", horizontal: "right" },
7372
+ children: headCell.isFetchingFilterOptions ? loadingSkeletons : /* @__PURE__ */ (0, import_jsx_runtime112.jsxs)(import_material61.Box, { className: classes.filterMenu, children: [
7373
+ /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(import_material61.Box, { px: 3, mb: 0.5, children: /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(
7374
+ import_material61.FormControlLabel,
7375
+ {
7376
+ label: "Select All",
7377
+ control: /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(
7378
+ import_material61.Checkbox,
7379
+ {
7380
+ disableRipple: true,
7381
+ checked: numCurrentSelectedFilters === numFilterOptions,
7382
+ indeterminate: numCurrentSelectedFilters > 0 && numCurrentSelectedFilters < numFilterOptions,
7383
+ onChange: ({ target: { checked } }) => {
7384
+ if (checked) {
7385
+ setSelectedFilters([...filterOptionsData]);
7386
+ } else {
7387
+ setSelectedFilters([]);
7388
+ }
7389
+ }
7390
+ }
7391
+ )
7392
+ }
7393
+ ) }),
7394
+ /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(import_material61.Divider, { sx: { mb: 0.5 } }),
7395
+ /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(import_material61.Box, { className: classes.filterOptions, children: filterOptionsData?.map(
7396
+ (option) => {
7397
+ const resolvedOption = resolveOptionType(option, headCell.fieldName ?? "");
7398
+ return /* @__PURE__ */ (0, import_jsx_runtime112.jsxs)(
7399
+ import_material61.Box,
7400
+ {
7401
+ className: classes.filter,
7402
+ children: [
7403
+ /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(
7404
+ import_material61.FormControlLabel,
7405
+ {
7406
+ label: resolvedOption,
7407
+ control: /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(
7408
+ import_material61.Checkbox,
7409
+ {
7410
+ disableRipple: true,
7411
+ onChange: () => handleFilterOptionClick(option),
7412
+ checked: isOptionChecked(resolvedOption)
7413
+ }
7414
+ )
7415
+ },
7416
+ resolvedOption
7417
+ ),
7418
+ shouldShowCheckOnFilter?.(headCell.id, option) ? /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(import_material61.Tooltip, { title: "This filter is saved as default", children: /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(import_Check.default, { fontSize: "small", color: "action" }) }) : null
7419
+ ]
7420
+ },
7421
+ resolvedOption
7422
+ );
7423
+ }
7424
+ ) }),
7425
+ /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(import_material61.Divider, { sx: { mb: 0.5 } }),
7426
+ /* @__PURE__ */ (0, import_jsx_runtime112.jsxs)(import_material61.Box, { className: classes.applyFilterButtonsContainer, children: [
7427
+ /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(
7428
+ ExtendedButton_default,
7429
+ {
7430
+ copy: "Save as Default",
7431
+ buttonType: "button",
7432
+ variant: "text",
7433
+ tooltip: "Persists those filters for future visits",
7434
+ className: classes.saveAsDefaultButton,
7435
+ onClick: () => handleApplyFilters(true)
7436
+ }
7437
+ ),
7438
+ /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(
7439
+ ExtendedButton_default,
7440
+ {
7441
+ copy: "Apply",
7442
+ color: "primary",
7443
+ buttonType: "submit",
7444
+ onClick: () => handleApplyFilters(false)
7445
+ }
7446
+ )
7447
+ ] })
7448
+ ] })
7449
+ }
7450
+ )
7451
+ ] });
7452
+ };
7453
+ var SmartTableHeaderFilterMenu_default = (0, import_react34.memo)(SmartTableHeaderFilterMenu);
7454
+
7455
+ // src/components/Table/Table.tsx
7456
+ var import_react35 = require("react");
7457
+ var import_material63 = require("@mui/material");
7458
+ var import_debounce = __toESM(require_debounce(), 1);
7459
+ var import_mui56 = require("tss-react/mui");
7460
+ var import_uuid = require("uuid");
7461
+
7462
+ // src/components/TableLoading/TableLoading.tsx
7463
+ var import_material62 = require("@mui/material");
7464
+ var import_jsx_runtime113 = require("react/jsx-runtime");
7465
+ var TableLoading = ({
7466
+ rowsPerPage,
7467
+ rowHeight
7468
+ }) => /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(import_material62.Box, { children: Array.from({ length: rowsPerPage ?? 0 }).map((_, index) => /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(
7469
+ import_material62.Skeleton,
7470
+ {
7471
+ animation: "pulse",
7472
+ "data-testid": "table-loading-skeleton",
7473
+ style: { margin: "8px", opacity: 0.4 },
7474
+ variant: "rectangular",
7475
+ height: rowHeight
7476
+ },
7477
+ index
7478
+ )) });
7479
+ var TableLoading_default = TableLoading;
7480
+
7481
+ // src/components/Table/helpers.tsx
7482
+ function stableSort2(array, cmp) {
7483
+ const stabilizedThis = array.map((el, index) => [el, index]);
7484
+ stabilizedThis.sort((a, b) => {
7485
+ const order = cmp(a[0], b[0]);
7486
+ if (order !== 0) {
7487
+ return order;
7488
+ }
7489
+ return a[1] - b[1];
7490
+ });
7491
+ return stabilizedThis.map((el) => el[0]);
7492
+ }
7493
+ function descendingComparator2(a, b, orderBy) {
7494
+ if (b[orderBy] < a[orderBy]) {
7495
+ return -1;
7496
+ }
7497
+ if (b[orderBy] > a[orderBy]) {
7498
+ return 1;
7499
+ }
7500
+ return 0;
7501
+ }
7502
+ function getSorting(order, orderBy) {
7503
+ return order === "desc" ? (a, b) => descendingComparator2(a, b, orderBy) : (a, b) => -descendingComparator2(a, b, orderBy);
7504
+ }
7505
+ function calculateRowsPerPage(rowHeight) {
7506
+ const appContainerDom = document.getElementById("mainContainer");
7507
+ const headerDom = document.getElementById("aboveTableHeader");
7508
+ if (appContainerDom && headerDom) {
7509
+ return Math.floor(
7510
+ (appContainerDom.clientHeight - headerDom.clientHeight - 24) / rowHeight - 2
7511
+ );
7512
+ }
7513
+ return 1;
7514
+ }
7515
+
7516
+ // src/components/Table/Table.tsx
7517
+ var import_jsx_runtime114 = require("react/jsx-runtime");
7518
+ var useStyles50 = (0, import_mui56.makeStyles)()(() => ({
7519
+ root: {
7520
+ height: "calc(100vh - 262px)",
7521
+ overflow: "scroll"
7522
+ },
7523
+ paper: {
7524
+ width: "100%",
7525
+ display: "flex",
7526
+ flexDirection: "column",
7527
+ justifyContent: "space-between"
7528
+ },
7529
+ header: {
7530
+ "& .MuiTableSortLabel-root": {
7531
+ fontWeight: 600,
7532
+ fontSize: ".875rem"
7533
+ }
7534
+ },
7535
+ container: {
7536
+ maxHeight: "calc(100% - 0)"
7537
+ }
7538
+ }));
7539
+ var Table2 = ({
7540
+ appliedFilters,
7541
+ data,
7542
+ doNotCalculateRows,
7543
+ headCells,
7544
+ isLoading,
7545
+ onRowClick,
7546
+ page = 0,
7547
+ RenderItem = null,
7548
+ rowsPerPage: defaultRowsPerPage = 10,
7549
+ serverRendered,
7550
+ updateSort
7551
+ }) => {
7552
+ const [order, setOrder] = (0, import_react35.useState)(appliedFilters?.sortDir || "desc");
7553
+ const [orderBy, setOrderBy] = (0, import_react35.useState)(
7554
+ appliedFilters?.sortField || "delivery_date"
7555
+ );
7556
+ const [rowsPerPage, setRowsPerPage] = (0, import_react35.useState)(defaultRowsPerPage);
7557
+ const { classes } = useStyles50();
7558
+ const rowHeight = 56;
7559
+ const emptyRows = rowsPerPage - Math.min(rowsPerPage, data.length - page * rowsPerPage);
7560
+ const handleRequestSort = (event, property) => {
7561
+ const isAsc = orderBy === property && order === "asc";
7562
+ const orderDir = isAsc ? "desc" : "asc";
7563
+ setOrder(orderDir);
7564
+ setOrderBy(property);
7565
+ if (updateSort) {
7566
+ updateSort(property, orderDir);
7567
+ }
7568
+ };
7569
+ (0, import_react35.useLayoutEffect)(() => {
7570
+ if (!doNotCalculateRows) {
7571
+ return;
7572
+ }
7573
+ function updateRowsPerPage() {
7574
+ const newRowsPerPage = calculateRowsPerPage(rowHeight);
7575
+ setRowsPerPage(newRowsPerPage);
7576
+ }
7577
+ updateRowsPerPage();
7578
+ const debounced = (0, import_debounce.default)(updateRowsPerPage, 150);
7579
+ window.addEventListener("resize", debounced);
7580
+ return () => {
7581
+ window.removeEventListener("resize", debounced);
7582
+ };
7583
+ }, [doNotCalculateRows]);
7584
+ const createSortHandler = (property) => (event) => {
7585
+ handleRequestSort(event, property);
7586
+ };
7587
+ const getTableRows = () => {
7588
+ const index = page;
7589
+ const rows = serverRendered ? data : stableSort2(data, getSorting(order, orderBy)).slice(
7590
+ index * rowsPerPage,
7591
+ index * rowsPerPage + rowsPerPage
7592
+ );
7593
+ const rowsComponents = rows.map((row) => {
7594
+ if (RenderItem) {
7595
+ return /* @__PURE__ */ (0, import_jsx_runtime114.jsx)(RenderItem, { ...row }, row.id);
7464
7596
  }
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
- );
7597
+ return /* @__PURE__ */ (0, import_jsx_runtime114.jsx)(import_material63.TableRow, { hover: true, onClick: () => onRowClick?.(row), children: headCells?.map((column) => /* @__PURE__ */ (0, import_jsx_runtime114.jsx)(import_material63.TableCell, { children: row[column.id] }, column.id)) }, row.id);
7489
7598
  });
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,
7599
+ if (emptyRows > 0 && rowsPerPage > emptyRows) {
7600
+ rowsComponents.push(
7601
+ /* @__PURE__ */ (0, import_jsx_runtime114.jsx)(import_material63.TableRow, { style: { height: rowHeight * emptyRows }, children: /* @__PURE__ */ (0, import_jsx_runtime114.jsx)(import_material63.TableCell, { colSpan: 8 }) }, (0, import_uuid.v4)())
7602
+ );
7603
+ }
7604
+ return rowsComponents;
7605
+ };
7606
+ return /* @__PURE__ */ (0, import_jsx_runtime114.jsx)(import_material63.Paper, { className: classes.root, children: /* @__PURE__ */ (0, import_jsx_runtime114.jsx)(import_material63.Box, { className: classes.paper, children: isLoading ? /* @__PURE__ */ (0, import_jsx_runtime114.jsx)(TableLoading_default, { rowHeight, rowsPerPage }) : /* @__PURE__ */ (0, import_jsx_runtime114.jsx)(import_material63.TableContainer, { className: classes.container, children: /* @__PURE__ */ (0, import_jsx_runtime114.jsxs)(import_material63.Table, { size: "medium", stickyHeader: true, children: [
7607
+ /* @__PURE__ */ (0, import_jsx_runtime114.jsx)(import_material63.TableHead, { className: classes.header, children: /* @__PURE__ */ (0, import_jsx_runtime114.jsx)(import_material63.TableRow, { children: headCells?.map((headCell) => /* @__PURE__ */ (0, import_jsx_runtime114.jsx)(
7608
+ import_material63.TableCell,
7508
7609
  {
7509
- animation: "pulse",
7510
- variant: "rounded",
7511
- sx: { margin: 1 },
7512
- height: rowHeight,
7513
- "data-testid": "loading-skeleton"
7610
+ align: "left",
7611
+ sortDirection: orderBy === headCell.id ? order : void 0,
7612
+ children: /* @__PURE__ */ (0, import_jsx_runtime114.jsx)(
7613
+ import_material63.TableSortLabel,
7614
+ {
7615
+ active: orderBy === headCell.id,
7616
+ direction: orderBy === headCell.id ? order : "asc",
7617
+ onClick: createSortHandler(headCell.id),
7618
+ children: headCell.label
7619
+ }
7620
+ )
7514
7621
  },
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,
7622
+ headCell.id
7623
+ )) }) }),
7624
+ /* @__PURE__ */ (0, import_jsx_runtime114.jsxs)(import_material63.TableBody, { children: [
7625
+ getTableRows(),
7626
+ rowsPerPage === emptyRows && /* @__PURE__ */ (0, import_jsx_runtime114.jsx)(import_material63.TableRow, { style: { height: rowHeight * emptyRows }, children: /* @__PURE__ */ (0, import_jsx_runtime114.jsx)(import_material63.TableCell, { colSpan: 8, align: "center", children: "Nothing to display" }) })
7627
+ ] })
7628
+ ] }) }) }) });
7629
+ };
7630
+ var Table_default = Table2;
7631
+
7632
+ // src/components/TableDesktopFooter/TableDesktopFooter.tsx
7633
+ var import_Refresh = __toESM(require("@mui/icons-material/Refresh"), 1);
7634
+ var import_material64 = require("@mui/material");
7635
+ var import_jsx_runtime115 = require("react/jsx-runtime");
7636
+ var TableDesktopFooter = ({
7637
+ numPages,
7638
+ page,
7639
+ pageSize,
7640
+ pageSizeOptions,
7641
+ handlePageChange,
7642
+ handlePageSizeChange,
7643
+ refetch,
7644
+ isFetching
7645
+ }) => {
7646
+ return /* @__PURE__ */ (0, import_jsx_runtime115.jsxs)(
7647
+ import_material64.Box,
7648
+ {
7649
+ py: 1,
7650
+ gap: 2,
7651
+ display: "flex",
7652
+ justifyContent: "space-between",
7653
+ alignItems: "center",
7654
+ borderTop: `1px solid ${colors.neutral300}`,
7655
+ bgcolor: (theme) => theme.palette.background.default,
7656
+ children: [
7657
+ /* @__PURE__ */ (0, import_jsx_runtime115.jsxs)(
7658
+ import_material64.Button,
7659
+ {
7660
+ disableRipple: true,
7661
+ variant: "outlined",
7662
+ onClick: () => refetch(),
7663
+ disabled: isFetching,
7664
+ sx: {
7665
+ ml: 1,
7666
+ gap: 1,
7667
+ borderRadius: 25,
7668
+ color: colors.neutral800,
7669
+ borderColor: colors.neutral600
7670
+ },
7671
+ children: [
7672
+ /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(
7673
+ import_Refresh.default,
7674
+ {
7675
+ fontSize: "small",
7676
+ color: isFetching ? "disabled" : "primary"
7677
+ }
7678
+ ),
7679
+ "REFRESH"
7680
+ ]
7681
+ }
7682
+ ),
7683
+ /* @__PURE__ */ (0, import_jsx_runtime115.jsxs)(import_material64.Box, { display: "flex", children: [
7684
+ /* @__PURE__ */ (0, import_jsx_runtime115.jsxs)(import_material64.Stack, { direction: "row", spacing: 2, alignItems: "center", children: [
7685
+ /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(import_material64.Typography, { children: "Rows per page:" }),
7686
+ /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(
7687
+ import_material64.Select,
7688
+ {
7689
+ value: pageSize,
7690
+ onChange: handlePageSizeChange,
7691
+ size: "small",
7692
+ variant: "standard",
7693
+ children: pageSizeOptions.map((size) => /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(import_material64.MenuItem, { value: size, children: size }, size))
7694
+ }
7695
+ )
7696
+ ] }),
7697
+ /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(
7698
+ import_material64.Pagination,
7542
7699
  {
7543
- colSpan: enableCheckboxSelection ? visibleHeadCells.length + 1 : visibleHeadCells.length,
7544
- showClearFilterButton,
7545
- handleClickOnClearFiltersButton
7700
+ color: "standard",
7701
+ count: numPages,
7702
+ page,
7703
+ onChange: handlePageChange
7546
7704
  }
7547
- ) })
7548
- ]
7705
+ )
7706
+ ] })
7707
+ ]
7708
+ }
7709
+ );
7710
+ };
7711
+
7712
+ // src/components/TableDesktopRowCell/TableDesktopRowCell.tsx
7713
+ var import_react38 = require("react");
7714
+ var import_material65 = require("@mui/material");
7715
+
7716
+ // src/components/TableDesktopRowCell/TableDesktopSmartSelect.tsx
7717
+ var import_react36 = require("react");
7718
+ var import_jsx_runtime116 = require("react/jsx-runtime");
7719
+ var resolveValue = (value) => {
7720
+ if (typeof value === "string") {
7721
+ return value;
7722
+ }
7723
+ return value?.id;
7724
+ };
7725
+ var TableDesktopSmartSelect = (0, import_react36.memo)(({
7726
+ ref,
7727
+ initialValue,
7728
+ inputLabel,
7729
+ fieldName,
7730
+ rowId,
7731
+ disabled,
7732
+ filterOptions,
7733
+ refetchFilterOptions,
7734
+ isFetchingFilterOptions,
7735
+ onUpdateEditableCell
7736
+ }) => {
7737
+ const [value, setValue] = (0, import_react36.useState)(initialValue);
7738
+ const [options, setOptions] = (0, import_react36.useState)();
7739
+ const valueId = resolveValue(value);
7740
+ const valueLabel = resolveOptionType(value, fieldName);
7741
+ (0, import_react36.useEffect)(() => {
7742
+ if (filterOptions) {
7743
+ const parsedOptions = filterOptions?.map((option) => ({
7744
+ value: resolveValue(option),
7745
+ label: String(resolveOptionType(option, fieldName))
7746
+ }));
7747
+ setOptions(parsedOptions);
7748
+ }
7749
+ }, [filterOptions]);
7750
+ return /* @__PURE__ */ (0, import_jsx_runtime116.jsx)(
7751
+ SmartSelect_default,
7752
+ {
7753
+ ref,
7754
+ value: valueId,
7755
+ inputLabel,
7756
+ options,
7757
+ disabled,
7758
+ refetch: refetchFilterOptions,
7759
+ isFetching: isFetchingFilterOptions,
7760
+ defaultOption: {
7761
+ value: valueId ?? "",
7762
+ label: String(valueLabel ?? "")
7763
+ },
7764
+ onChange: ({ value: value2, label }) => {
7765
+ setValue({ id: value2 ?? "", name: label ?? "" });
7766
+ onUpdateEditableCell?.(rowId, value2 ?? "");
7549
7767
  }
7550
- ) }),
7551
- children
7552
- ] }) });
7768
+ }
7769
+ );
7770
+ });
7771
+
7772
+ // src/components/TableDesktopRowCell/TableDesktopRowCell.tsx
7773
+ var import_Check2 = __toESM(require("@mui/icons-material/Check"), 1);
7774
+
7775
+ // src/components/TableDesktopRowCell/TableDesktopTextField.tsx
7776
+ var import_TextField = __toESM(require("@mui/material/TextField"), 1);
7777
+ var import_react37 = require("react");
7778
+ var import_jsx_runtime117 = require("react/jsx-runtime");
7779
+ var TableDesktopTextField = ({
7780
+ rowId,
7781
+ editInitialValue,
7782
+ inputLabel,
7783
+ disabled,
7784
+ validateInput,
7785
+ onUpdateEditableCell
7786
+ }) => {
7787
+ const [value, setValue] = (0, import_react37.useState)(editInitialValue);
7788
+ const hasError = (0, import_react37.useMemo)(() => !validateInput?.(value), [value, validateInput]);
7789
+ return /* @__PURE__ */ (0, import_jsx_runtime117.jsx)(
7790
+ import_TextField.default,
7791
+ {
7792
+ fullWidth: true,
7793
+ variant: "standard",
7794
+ defaultValue: value,
7795
+ label: inputLabel,
7796
+ error: hasError,
7797
+ disabled,
7798
+ onChange: ({ target: { value: value2 } }) => {
7799
+ setValue(value2);
7800
+ },
7801
+ onBlur: ({ target: { value: value2 } }) => {
7802
+ if (hasError) {
7803
+ return;
7804
+ }
7805
+ onUpdateEditableCell?.(rowId, value2);
7806
+ }
7807
+ }
7808
+ );
7809
+ };
7810
+
7811
+ // src/components/TableDesktopRowCell/TableDesktopRowCell.tsx
7812
+ var import_Close = __toESM(require("@mui/icons-material/Close"), 1);
7813
+ var import_Edit = __toESM(require("@mui/icons-material/Edit"), 1);
7814
+ var import_jsx_runtime118 = require("react/jsx-runtime");
7815
+ var TableDesktopRowCell = ({
7816
+ inputLabel,
7817
+ editInitialValue,
7818
+ rowId,
7819
+ fieldName,
7820
+ width,
7821
+ disabled,
7822
+ readOnlyValue,
7823
+ editableCellType,
7824
+ filterOptions,
7825
+ refetchFilterOptions,
7826
+ isFetchingFilterOptions,
7827
+ validateInput,
7828
+ onUpdateEditableCell,
7829
+ onCellClick
7830
+ }) => {
7831
+ const cellRef = (0, import_react38.useRef)(null);
7832
+ const [isOverflowed, setIsOverflowed] = (0, import_react38.useState)(false);
7833
+ const [isCellHovered, setIsCellHovered] = (0, import_react38.useState)(false);
7834
+ const [isEditMode, setIsEditMode] = (0, import_react38.useState)(false);
7835
+ (0, import_react38.useEffect)(() => {
7836
+ const ref = cellRef.current;
7837
+ if (ref) {
7838
+ setIsOverflowed(ref.scrollWidth > ref.clientWidth);
7839
+ }
7840
+ }, [readOnlyValue, width]);
7841
+ (0, import_react38.useEffect)(() => {
7842
+ const handleKeyDown = (e) => {
7843
+ if (e.key === "Escape") {
7844
+ setIsEditMode(false);
7845
+ }
7846
+ };
7847
+ if (isEditMode) {
7848
+ window.addEventListener("keydown", handleKeyDown);
7849
+ }
7850
+ return () => {
7851
+ window.removeEventListener("keydown", handleKeyDown);
7852
+ };
7853
+ }, [isEditMode]);
7854
+ const editableComponents = {
7855
+ "select": /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(
7856
+ TableDesktopSmartSelect,
7857
+ {
7858
+ rowId,
7859
+ fieldName,
7860
+ disabled,
7861
+ initialValue: editInitialValue,
7862
+ inputLabel: inputLabel ?? "",
7863
+ filterOptions,
7864
+ refetchFilterOptions,
7865
+ isFetchingFilterOptions,
7866
+ onUpdateEditableCell
7867
+ }
7868
+ ),
7869
+ "checkbox": /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(
7870
+ import_material65.Checkbox,
7871
+ {
7872
+ disableRipple: true,
7873
+ disabled,
7874
+ defaultChecked: editInitialValue,
7875
+ onChange: ({ target: { checked } }) => {
7876
+ onUpdateEditableCell?.(rowId, checked);
7877
+ }
7878
+ }
7879
+ ),
7880
+ "text": /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(
7881
+ TableDesktopTextField,
7882
+ {
7883
+ rowId,
7884
+ disabled,
7885
+ editInitialValue,
7886
+ inputLabel: inputLabel ?? "",
7887
+ validateInput,
7888
+ onUpdateEditableCell
7889
+ }
7890
+ ),
7891
+ "numeric": /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(
7892
+ import_material65.TextField,
7893
+ {
7894
+ fullWidth: true,
7895
+ variant: "standard",
7896
+ disabled,
7897
+ defaultValue: editInitialValue,
7898
+ label: inputLabel,
7899
+ onChange: (e) => {
7900
+ e.target.value = e.target.value.replace(/\D/g, "");
7901
+ },
7902
+ onBlur: ({ target: { value } }) => {
7903
+ onUpdateEditableCell?.(rowId, value);
7904
+ },
7905
+ slotProps: {
7906
+ input: {
7907
+ inputMode: "numeric"
7908
+ }
7909
+ }
7910
+ }
7911
+ )
7912
+ };
7913
+ const getReadOnlyBooleanIcon = (value) => {
7914
+ if (value) {
7915
+ return /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(import_Check2.default, { sx: { fontSize: 16 } });
7916
+ }
7917
+ return "-";
7918
+ };
7919
+ const handleEditClick = (e) => {
7920
+ e.stopPropagation();
7921
+ setIsEditMode((prev) => !prev);
7922
+ };
7923
+ return /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(import_material65.Tooltip, { title: isOverflowed ? String(readOnlyValue) : "", arrow: true, children: /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(
7924
+ import_material65.TableCell,
7925
+ {
7926
+ align: "left",
7927
+ onMouseEnter: () => editableCellType && !disabled && setIsCellHovered(true),
7928
+ onMouseLeave: () => editableCellType && !disabled && setIsCellHovered(false),
7929
+ onClick: (event) => !disabled && onCellClick?.(event, isEditMode),
7930
+ sx: {
7931
+ padding: 1,
7932
+ width: width ?? "auto",
7933
+ position: "relative",
7934
+ cursor: disabled ? "default" : "pointer",
7935
+ opacity: disabled ? 0.2 : 1,
7936
+ ":hover": editableCellType && {
7937
+ background: isEditMode ? colors.lightBlueBackground : colors.neutral100
7938
+ },
7939
+ background: isEditMode ? colors.lightBlueBackground : (theme) => theme.palette.background.default
7940
+ },
7941
+ children: /* @__PURE__ */ (0, import_jsx_runtime118.jsxs)(
7942
+ import_material65.Box,
7943
+ {
7944
+ p: 1,
7945
+ ref: cellRef,
7946
+ overflow: "hidden",
7947
+ textOverflow: "ellipsis",
7948
+ whiteSpace: "nowrap",
7949
+ children: [
7950
+ isCellHovered ? /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(import_material65.Tooltip, { title: isEditMode ? "" : "Toggle Edit Mode", children: /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(
7951
+ import_material65.IconButton,
7952
+ {
7953
+ onClick: handleEditClick,
7954
+ sx: {
7955
+ top: 0,
7956
+ right: 0,
7957
+ zIndex: 1,
7958
+ borderRadius: 0,
7959
+ position: "absolute",
7960
+ background: isEditMode ? colors.lightBlueBackground : colors.neutral100,
7961
+ "&:hover": {
7962
+ backgroundColor: isEditMode ? colors.lightBlueBackground : colors.neutral150
7963
+ }
7964
+ },
7965
+ children: isEditMode ? /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(import_Close.default, { fontSize: "small", color: "error" }) : /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(import_Edit.default, { fontSize: "small" })
7966
+ }
7967
+ ) }) : null,
7968
+ isEditMode && editableCellType ? editableComponents[editableCellType] : typeof readOnlyValue === "boolean" ? getReadOnlyBooleanIcon(readOnlyValue) : readOnlyValue
7969
+ ]
7970
+ }
7971
+ )
7972
+ }
7973
+ ) });
7553
7974
  };
7554
- var TableDesktop_default = TableDesktop;
7555
7975
 
7556
7976
  // src/components/TableHeader/TableHeader.tsx
7557
- var import_react35 = require("react");
7977
+ var import_react39 = require("react");
7558
7978
  var import_icons_material12 = require("@mui/icons-material");
7559
- var import_material63 = require("@mui/material");
7979
+ var import_material66 = require("@mui/material");
7560
7980
  var import_mui57 = require("tss-react/mui");
7561
- var import_jsx_runtime114 = require("react/jsx-runtime");
7981
+ var import_jsx_runtime119 = require("react/jsx-runtime");
7562
7982
  var useStyles51 = (0, import_mui57.makeStyles)()(() => ({
7563
7983
  sortLabel: {
7564
7984
  "& .MuiTableSortLabel-icon": {
@@ -7567,9 +7987,9 @@ var useStyles51 = (0, import_mui57.makeStyles)()(() => ({
7567
7987
  }
7568
7988
  }));
7569
7989
  var TableHeader = ({ cells, onSort = null }) => {
7570
- const [sortableCells, setSortableCells] = (0, import_react35.useState)([]);
7990
+ const [sortableCells, setSortableCells] = (0, import_react39.useState)([]);
7571
7991
  const { classes } = useStyles51();
7572
- (0, import_react35.useEffect)(() => {
7992
+ (0, import_react39.useEffect)(() => {
7573
7993
  setSortableCells(cells);
7574
7994
  }, []);
7575
7995
  const getNewSortDirection = (direction) => {
@@ -7603,8 +8023,8 @@ var TableHeader = ({ cells, onSort = null }) => {
7603
8023
  });
7604
8024
  setSortableCells(sortedCells);
7605
8025
  };
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,
8026
+ return /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(import_material66.TableHead, { children: /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(import_material66.TableRow, { children: sortableCells.map((cell, key) => /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(import_material66.TableCell, { children: cell.isSortable ? /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(
8027
+ import_material66.TableSortLabel,
7608
8028
  {
7609
8029
  className: classes.sortLabel,
7610
8030
  direction: cell?.direction || "asc",
@@ -7614,12 +8034,12 @@ var TableHeader = ({ cells, onSort = null }) => {
7614
8034
  }
7615
8035
  ) : cell.label }, cell.label || key)) }) });
7616
8036
  };
7617
- var TableHeader_default = (0, import_react35.memo)(TableHeader);
8037
+ var TableHeader_default = (0, import_react39.memo)(TableHeader);
7618
8038
 
7619
8039
  // src/components/TextDivider/TextDivider.tsx
7620
- var import_material64 = require("@mui/material");
8040
+ var import_material67 = require("@mui/material");
7621
8041
  var import_mui58 = require("tss-react/mui");
7622
- var import_jsx_runtime115 = require("react/jsx-runtime");
8042
+ var import_jsx_runtime120 = require("react/jsx-runtime");
7623
8043
  var useStyles52 = (0, import_mui58.makeStyles)()(() => ({
7624
8044
  icon: {
7625
8045
  fontSize: 20
@@ -7656,19 +8076,19 @@ var TextDivider = ({
7656
8076
  }) => {
7657
8077
  const { classes } = useStyles52();
7658
8078
  const iconColor = color ?? colors.neutral900;
7659
- return /* @__PURE__ */ (0, import_jsx_runtime115.jsxs)(
7660
- import_material64.Box,
8079
+ return /* @__PURE__ */ (0, import_jsx_runtime120.jsxs)(
8080
+ import_material67.Box,
7661
8081
  {
7662
8082
  display: "flex",
7663
8083
  alignItems: "center",
7664
8084
  justifyContent: "space-between",
7665
8085
  className: classes.container,
7666
8086
  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,
8087
+ /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(import_material67.Divider, { className: classes.leftDivider }),
8088
+ /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(import_material67.Button, { onClick, disabled: !onClick, className: classes.button, children: /* @__PURE__ */ (0, import_jsx_runtime120.jsxs)(import_material67.Box, { className: classes.center, children: [
8089
+ Icon2 && iconPosition === "left" && /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(Icon2, { className: classes.icon, style: { color: iconColor } }),
8090
+ /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(
8091
+ import_material67.Typography,
7672
8092
  {
7673
8093
  color: "textSecondary",
7674
8094
  className: classes.title,
@@ -7676,9 +8096,9 @@ var TextDivider = ({
7676
8096
  children: title
7677
8097
  }
7678
8098
  ),
7679
- Icon2 && iconPosition === "right" && /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(Icon2, { className: classes.icon, style: { color: iconColor } })
8099
+ Icon2 && iconPosition === "right" && /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(Icon2, { className: classes.icon, style: { color: iconColor } })
7680
8100
  ] }) }),
7681
- /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(import_material64.Divider, { className: classes.rightDivider })
8101
+ /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(import_material67.Divider, { className: classes.rightDivider })
7682
8102
  ]
7683
8103
  }
7684
8104
  );
@@ -7690,7 +8110,7 @@ var import_react_dates = require("react-dates");
7690
8110
  var import_mui59 = require("tss-react/mui");
7691
8111
  var import_initialize = require("react-dates/initialize");
7692
8112
  var import_datepicker = require("react-dates/lib/css/_datepicker.css");
7693
- var import_jsx_runtime116 = require("react/jsx-runtime");
8113
+ var import_jsx_runtime121 = require("react/jsx-runtime");
7694
8114
  var useStyles53 = (0, import_mui59.makeStyles)()((theme) => ({
7695
8115
  wrapper: {
7696
8116
  "& .DateRangePicker": {
@@ -7786,15 +8206,15 @@ var ThemedDateRangePicker = ({
7786
8206
  ...props
7787
8207
  }) => {
7788
8208
  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 }) });
8209
+ return /* @__PURE__ */ (0, import_jsx_runtime121.jsx)("div", { className: cx(classes.wrapper, className), children: /* @__PURE__ */ (0, import_jsx_runtime121.jsx)(import_react_dates.DateRangePicker, { ...props }) });
7790
8210
  };
7791
8211
  var ThemedDateRangePicker_default = ThemedDateRangePicker;
7792
8212
 
7793
8213
  // src/components/TheToolbar/TheToolbar.tsx
7794
- var import_react36 = require("react");
7795
- var import_material65 = require("@mui/material");
8214
+ var import_react40 = require("react");
8215
+ var import_material68 = require("@mui/material");
7796
8216
  var import_mui60 = require("tss-react/mui");
7797
- var import_jsx_runtime117 = require("react/jsx-runtime");
8217
+ var import_jsx_runtime122 = require("react/jsx-runtime");
7798
8218
  var useStyles54 = (0, import_mui60.makeStyles)()((theme) => ({
7799
8219
  menuButton: {
7800
8220
  color: theme.palette.primary.contrastText
@@ -7814,9 +8234,9 @@ var TheToolbar = ({
7814
8234
  rightSection
7815
8235
  }) => {
7816
8236
  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)(
8237
+ return /* @__PURE__ */ (0, import_jsx_runtime122.jsxs)(import_material68.Box, { children: [
8238
+ /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(import_material68.AppBar, { children: /* @__PURE__ */ (0, import_jsx_runtime122.jsxs)(import_material68.Toolbar, { className: classes.topBar, children: [
8239
+ /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(
7820
8240
  RoundButton_default,
7821
8241
  {
7822
8242
  className: classes.menuButton,
@@ -7825,7 +8245,7 @@ var TheToolbar = ({
7825
8245
  onClick: handleOpen
7826
8246
  }
7827
8247
  ),
7828
- /* @__PURE__ */ (0, import_jsx_runtime117.jsx)(
8248
+ /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(
7829
8249
  CompanyLogo_default,
7830
8250
  {
7831
8251
  size: "small",
@@ -7834,31 +8254,31 @@ var TheToolbar = ({
7834
8254
  imageLogoLightSmall
7835
8255
  }
7836
8256
  ),
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 })
8257
+ /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(import_material68.Box, { ml: 2, children: leftSection }),
8258
+ /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(import_material68.Box, { ml: "auto", children: rightSection })
7839
8259
  ] }) }),
7840
8260
  LeftDrawer
7841
8261
  ] });
7842
8262
  };
7843
- var TheToolbar_default = (0, import_react36.memo)(TheToolbar);
8263
+ var TheToolbar_default = (0, import_react40.memo)(TheToolbar);
7844
8264
 
7845
8265
  // src/components/ToastMessage/ToastMessage.tsx
7846
- var import_material66 = require("@mui/material");
7847
- var import_jsx_runtime118 = require("react/jsx-runtime");
8266
+ var import_material69 = require("@mui/material");
8267
+ var import_jsx_runtime123 = require("react/jsx-runtime");
7848
8268
  var ToastMessage = ({
7849
8269
  toastType,
7850
8270
  toastMessage,
7851
8271
  open,
7852
8272
  onClose
7853
- }) => /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(
7854
- import_material66.Snackbar,
8273
+ }) => /* @__PURE__ */ (0, import_jsx_runtime123.jsx)(
8274
+ import_material69.Snackbar,
7855
8275
  {
7856
8276
  open,
7857
8277
  autoHideDuration: 1500,
7858
8278
  onClose,
7859
8279
  anchorOrigin: { vertical: "top", horizontal: "right" },
7860
- children: /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(
7861
- import_material66.Alert,
8280
+ children: /* @__PURE__ */ (0, import_jsx_runtime123.jsx)(
8281
+ import_material69.Alert,
7862
8282
  {
7863
8283
  elevation: 6,
7864
8284
  variant: "filled",
@@ -7884,9 +8304,9 @@ var ToastMessage = ({
7884
8304
  var ToastMessage_default = ToastMessage;
7885
8305
 
7886
8306
  // src/components/TwoButtonDialog/TwoButtonDialog.tsx
7887
- var import_material67 = require("@mui/material");
8307
+ var import_material70 = require("@mui/material");
7888
8308
  var import_mui61 = require("tss-react/mui");
7889
- var import_jsx_runtime119 = require("react/jsx-runtime");
8309
+ var import_jsx_runtime124 = require("react/jsx-runtime");
7890
8310
  var useStyles55 = (0, import_mui61.makeStyles)()((theme) => ({
7891
8311
  paper: {
7892
8312
  padding: theme.spacing(2)
@@ -7916,20 +8336,20 @@ var TwoButtonDialog = ({
7916
8336
  cancelButton
7917
8337
  }) => {
7918
8338
  const { classes } = useStyles55();
7919
- return /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(
7920
- import_material67.Dialog,
8339
+ return /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(
8340
+ import_material70.Dialog,
7921
8341
  {
7922
8342
  open,
7923
8343
  disableEnforceFocus: true,
7924
8344
  maxWidth: "sm",
7925
8345
  fullWidth: true,
7926
8346
  closeAfterTransition: true,
7927
- BackdropComponent: import_material67.Backdrop,
8347
+ BackdropComponent: import_material70.Backdrop,
7928
8348
  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,
8349
+ children: /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(import_material70.Fade, { in: open, children: /* @__PURE__ */ (0, import_jsx_runtime124.jsxs)(import_material70.Paper, { className: classes.paper, children: [
8350
+ /* @__PURE__ */ (0, import_jsx_runtime124.jsxs)(import_material70.Box, { className: classes.mb, children: [
8351
+ /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(import_material70.Typography, { variant: "h5", component: "div", children: /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(
8352
+ import_material70.Box,
7933
8353
  {
7934
8354
  sx: {
7935
8355
  fontWeight: 600
@@ -7937,23 +8357,23 @@ var TwoButtonDialog = ({
7937
8357
  children: title
7938
8358
  }
7939
8359
  ) }),
7940
- /* @__PURE__ */ (0, import_jsx_runtime119.jsxs)(
7941
- import_material67.Box,
8360
+ /* @__PURE__ */ (0, import_jsx_runtime124.jsxs)(
8361
+ import_material70.Box,
7942
8362
  {
7943
8363
  className: classes.mt,
7944
8364
  sx: {
7945
8365
  fontWeight: 600
7946
8366
  },
7947
8367
  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 })
8368
+ subtitle1 && /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(import_material70.Typography, { variant: "subtitle1", children: subtitle1 }),
8369
+ subtitle2 && /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(import_material70.Typography, { variant: "subtitle1", children: subtitle2 })
7950
8370
  ]
7951
8371
  }
7952
8372
  )
7953
8373
  ] }),
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)(
8374
+ /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(import_material70.Divider, {}),
8375
+ /* @__PURE__ */ (0, import_jsx_runtime124.jsxs)(import_material70.Box, { className: classes.buttonContainer, children: [
8376
+ /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(
7957
8377
  FilledButton_default,
7958
8378
  {
7959
8379
  copy: cancelLabel,
@@ -7966,7 +8386,7 @@ var TwoButtonDialog = ({
7966
8386
  }
7967
8387
  }
7968
8388
  ),
7969
- /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(
8389
+ /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(
7970
8390
  FilledButton_default,
7971
8391
  {
7972
8392
  color: "primary",
@@ -7975,7 +8395,7 @@ var TwoButtonDialog = ({
7975
8395
  }
7976
8396
  )
7977
8397
  ] }),
7978
- /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(Loading_default, { isLoading: dialogLoading })
8398
+ /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(Loading_default, { isLoading: dialogLoading })
7979
8399
  ] }) })
7980
8400
  }
7981
8401
  );
@@ -7983,30 +8403,30 @@ var TwoButtonDialog = ({
7983
8403
  var TwoButtonDialog_default = TwoButtonDialog;
7984
8404
 
7985
8405
  // 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,
8406
+ var import_react41 = require("react");
8407
+ var import_material71 = require("@mui/material");
8408
+ var import_jsx_runtime125 = require("react/jsx-runtime");
8409
+ var UserBust = ({ user, avatarProps, typographyProps }) => /* @__PURE__ */ (0, import_jsx_runtime125.jsxs)("div", { children: [
8410
+ /* @__PURE__ */ (0, import_jsx_runtime125.jsx)(
8411
+ import_material71.Avatar,
7992
8412
  {
7993
8413
  src: user.profile_picture,
7994
8414
  alt: "user_avatar",
7995
8415
  style: { width: avatarProps.width, height: avatarProps.height }
7996
8416
  }
7997
8417
  ),
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 })
8418
+ /* @__PURE__ */ (0, import_jsx_runtime125.jsxs)("div", { style: { paddingTop: 16 }, children: [
8419
+ /* @__PURE__ */ (0, import_jsx_runtime125.jsx)(import_material71.Typography, { ...typographyProps.name, children: `${user.first_name} ${user.last_name}` }),
8420
+ /* @__PURE__ */ (0, import_jsx_runtime125.jsx)(import_material71.Typography, { ...typographyProps.username, children: user.username })
8001
8421
  ] })
8002
8422
  ] });
8003
- var UserBust_default = (0, import_react37.memo)(UserBust);
8423
+ var UserBust_default = (0, import_react41.memo)(UserBust);
8004
8424
 
8005
8425
  // src/components/icons/IconChart.tsx
8006
- var import_jsx_runtime121 = require("react/jsx-runtime");
8426
+ var import_jsx_runtime126 = require("react/jsx-runtime");
8007
8427
  var SvgIconChart = (props) => {
8008
8428
  const { fill } = props;
8009
- return /* @__PURE__ */ (0, import_jsx_runtime121.jsx)(
8429
+ return /* @__PURE__ */ (0, import_jsx_runtime126.jsx)(
8010
8430
  "svg",
8011
8431
  {
8012
8432
  width: "20",
@@ -8015,7 +8435,7 @@ var SvgIconChart = (props) => {
8015
8435
  fill: "none",
8016
8436
  xmlns: "http://www.w3.org/2000/svg",
8017
8437
  ...props,
8018
- children: /* @__PURE__ */ (0, import_jsx_runtime121.jsx)(
8438
+ children: /* @__PURE__ */ (0, import_jsx_runtime126.jsx)(
8019
8439
  "path",
8020
8440
  {
8021
8441
  d: "M2.49967 11.6667L2.91634 11.725L6.72467 7.91667C6.57467 7.375 6.71634 6.75833 7.15801 6.325C7.80801 5.66667 8.85801 5.66667 9.50801 6.325C9.94967 6.75833 10.0913 7.375 9.94134 7.91667L12.083 10.0583L12.4997 10C12.6497 10 12.7913 10 12.9163 10.0583L15.8913 7.08333C15.833 6.95833 15.833 6.81667 15.833 6.66667C15.833 6.22464 16.0086 5.80072 16.3212 5.48816C16.6337 5.17559 17.0576 5 17.4997 5C17.9417 5 18.3656 5.17559 18.6782 5.48816C18.9907 5.80072 19.1663 6.22464 19.1663 6.66667C19.1663 7.10869 18.9907 7.53262 18.6782 7.84518C18.3656 8.15774 17.9417 8.33333 17.4997 8.33333C17.3497 8.33333 17.208 8.33333 17.083 8.275L14.108 11.25C14.1663 11.375 14.1663 11.5167 14.1663 11.6667C14.1663 12.1087 13.9907 12.5326 13.6782 12.8452C13.3656 13.1577 12.9417 13.3333 12.4997 13.3333C12.0576 13.3333 11.6337 13.1577 11.3212 12.8452C11.0086 12.5326 10.833 12.1087 10.833 11.6667L10.8913 11.25L8.74967 9.10833C8.48301 9.16667 8.18301 9.16667 7.91634 9.10833L4.10801 12.9167L4.16634 13.3333C4.16634 13.7754 3.99075 14.1993 3.67819 14.5118C3.36563 14.8244 2.9417 15 2.49967 15C2.05765 15 1.63372 14.8244 1.32116 14.5118C1.0086 14.1993 0.833008 13.7754 0.833008 13.3333C0.833008 12.8913 1.0086 12.4674 1.32116 12.1548C1.63372 11.8423 2.05765 11.6667 2.49967 11.6667Z",
@@ -8082,6 +8502,7 @@ var IconChart_default = SvgIconChart;
8082
8502
  ScrollableDialog,
8083
8503
  SearchAndFilterHeader,
8084
8504
  SearchAndFilterHeaderForTable,
8505
+ SearchFieldDebounced,
8085
8506
  SearchWithFilters,
8086
8507
  SearchWithFiltersForTable,
8087
8508
  SectionName,
@@ -8093,6 +8514,9 @@ var IconChart_default = SvgIconChart;
8093
8514
  Switch,
8094
8515
  Table,
8095
8516
  TableDesktop,
8517
+ TableDesktopFooter,
8518
+ TableDesktopRowCell,
8519
+ TableDesktopSmartSelect,
8096
8520
  TableEmptyResult,
8097
8521
  TableHeader,
8098
8522
  TableLoading,