@natoora-libs/core 0.1.16-dev-doug-3 → 0.1.17

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.
@@ -6382,7 +6382,6 @@ var SmartSelect = forwardRef2(
6382
6382
  onChange,
6383
6383
  inputLabel,
6384
6384
  variant = "standard",
6385
- size,
6386
6385
  error,
6387
6386
  helperText,
6388
6387
  disabled,
@@ -6437,7 +6436,6 @@ var SmartSelect = forwardRef2(
6437
6436
  FormControl4,
6438
6437
  {
6439
6438
  fullWidth: true,
6440
- size,
6441
6439
  className: classes.container,
6442
6440
  error,
6443
6441
  variant,
@@ -6456,7 +6454,6 @@ var SmartSelect = forwardRef2(
6456
6454
  Select3,
6457
6455
  {
6458
6456
  ref,
6459
- size,
6460
6457
  disabled,
6461
6458
  labelId: "smart-select-label",
6462
6459
  value: value ?? "",
@@ -6590,265 +6587,54 @@ var LabelledSwitch = withStyles6(LSwitch, (theme) => ({
6590
6587
  var Switch_default = memo19(LabelledSwitch);
6591
6588
 
6592
6589
  // src/components/SmartTableHeaderFilterMenu/SmartTableHeaderFilterMenu.tsx
6593
- import { useMemo as useMemo2, useState as useState15, useEffect as useEffect10, memo as memo20 } from "react";
6590
+ import { useMemo as useMemo3, useState as useState16, useEffect as useEffect11, memo as memo21 } from "react";
6594
6591
  import CheckIcon from "@mui/icons-material/Check";
6595
6592
  import {
6596
- Box as Box28,
6597
- Checkbox as Checkbox4,
6593
+ Box as Box29,
6594
+ Checkbox as Checkbox5,
6598
6595
  Divider as Divider9,
6599
6596
  FormControlLabel as FormControlLabel3,
6600
6597
  Menu as Menu4,
6601
- Skeleton as Skeleton2,
6602
- Tooltip as Tooltip6
6598
+ Skeleton as Skeleton3,
6599
+ Tooltip as Tooltip7
6603
6600
  } from "@mui/material";
6604
6601
  import classNames3 from "classnames";
6605
- import { makeStyles as makeStyles45 } from "tss-react/mui";
6606
- import { Fragment as Fragment11, jsx as jsx108, jsxs as jsxs73 } from "react/jsx-runtime";
6607
- var useStyles45 = makeStyles45()((theme) => ({
6608
- filterMenu: {
6609
- display: "flex",
6610
- flexDirection: "column"
6611
- },
6612
- filterOptions: {
6613
- maxHeight: theme.spacing(62),
6614
- overflowY: "auto",
6615
- "&::-webkit-scrollbar": {
6616
- width: "8px",
6617
- height: "8px"
6618
- },
6619
- "&::-webkit-scrollbar-track": {
6620
- backgroundColor: theme.palette.mode === "dark" ? theme.palette.grey[800] : theme.palette.grey[100]
6621
- },
6622
- "&::-webkit-scrollbar-thumb": {
6623
- backgroundColor: theme.palette.mode === "dark" ? theme.palette.grey[900] : theme.palette.grey[400],
6624
- borderRadius: "10px"
6625
- },
6626
- "&::-webkit-scrollbar-thumb:hover": {
6627
- backgroundColor: theme.palette.mode === "dark" ? theme.palette.common.black : theme.palette.grey[500]
6628
- }
6629
- },
6630
- filter: {
6631
- display: "flex",
6632
- alignItems: "center",
6633
- justifyContent: "space-between",
6634
- padding: theme.spacing(0, 3)
6635
- },
6636
- applyFilterButtonsContainer: {
6637
- display: "flex",
6638
- padding: theme.spacing(0, 1),
6639
- justifyContent: "space-between"
6640
- },
6641
- saveAsDefaultButton: {
6642
- color: theme.palette.primary.main
6643
- },
6644
- skeleton: {
6645
- height: theme.spacing(3),
6646
- margin: theme.spacing(1)
6647
- }
6648
- }));
6649
- var resolveOptionType = (option, fieldName) => {
6650
- if (!option || typeof option !== "object") {
6651
- return option;
6652
- }
6653
- return option[fieldName] || "";
6654
- };
6655
- var findFilterIndex = (filters, filterOption) => filters.findIndex((item) => {
6656
- if (typeof item === "string" && typeof filterOption === "string") {
6657
- return item === filterOption;
6658
- }
6659
- if (typeof item === "object" && typeof filterOption === "object") {
6660
- return item.id === filterOption.id;
6661
- }
6662
- return false;
6663
- });
6664
- var SmartTableHeaderFilterMenu = ({
6665
- headCell,
6666
- numActiveFilters,
6667
- headerFilters,
6668
- shouldShowCheckOnFilter,
6669
- onApplyFilters
6670
- }) => {
6671
- const { classes } = useStyles45();
6672
- const [anchorEl, setAnchorEl] = useState15(null);
6673
- const [filterOptionsData, setFilterOptionsData] = useState15();
6674
- const [selectedFilters, setSelectedFilters] = useState15(
6675
- headerFilters[headCell.id] ?? []
6676
- );
6677
- useEffect10(() => {
6678
- if (headCell.filterOptions) {
6679
- setFilterOptionsData(headCell.filterOptions);
6680
- }
6681
- }, [headCell.filterOptions]);
6682
- const numFilterOptions = useMemo2(() => filterOptionsData?.length ?? 0, [filterOptionsData?.length]);
6683
- const numCurrentSelectedFilters = selectedFilters.length;
6684
- const handleFilterMenuOpen = (event) => {
6685
- if (!numFilterOptions) {
6686
- headCell.refetchFilterOptions?.();
6687
- }
6688
- setAnchorEl(event.currentTarget);
6689
- };
6690
- const handleFilterMenuClose = () => {
6691
- setSelectedFilters(headerFilters[headCell.id]);
6692
- setAnchorEl(null);
6693
- };
6694
- const handleFilterOptionClick = (option) => {
6695
- const selectedIndex = findFilterIndex(selectedFilters, option);
6696
- let newSelected;
6697
- if (selectedIndex === -1) {
6698
- if (typeof option === "string") {
6699
- newSelected = [...selectedFilters, option];
6700
- } else {
6701
- newSelected = [...selectedFilters, option];
6702
- }
6703
- } else {
6704
- newSelected = selectedFilters.filter(
6705
- (_, index) => index !== selectedIndex
6706
- );
6707
- }
6708
- setSelectedFilters(newSelected);
6709
- };
6710
- const handleApplyFilters = (shouldSave) => {
6711
- const updatedFilters = {
6712
- ...headerFilters,
6713
- [headCell.id]: [...selectedFilters]
6714
- };
6715
- onApplyFilters?.(updatedFilters, shouldSave);
6716
- setAnchorEl(null);
6717
- };
6718
- useEffect10(() => {
6719
- setSelectedFilters(headerFilters[headCell.id] ?? []);
6720
- }, [headerFilters, headCell.id]);
6721
- const isOptionChecked = useMemo2(() => (resolvedOption) => !!selectedFilters?.some(
6722
- (value) => resolveOptionType(value, headCell.fieldName ?? "") === resolvedOption
6723
- ), [selectedFilters]);
6724
- const loadingSkeletons = /* @__PURE__ */ jsxs73(Box28, { "data-testid": "loading-skeletons", width: 272, children: [
6725
- /* @__PURE__ */ jsx108(Skeleton2, { variant: "rounded", className: classes.skeleton }),
6726
- /* @__PURE__ */ jsx108(Divider9, {}),
6727
- /* @__PURE__ */ jsx108(Skeleton2, { variant: "rounded", className: classes.skeleton }),
6728
- /* @__PURE__ */ jsx108(Skeleton2, { variant: "rounded", className: classes.skeleton }),
6729
- /* @__PURE__ */ jsx108(Skeleton2, { variant: "rounded", className: classes.skeleton }),
6730
- /* @__PURE__ */ jsx108(Skeleton2, { variant: "rounded", className: classes.skeleton }),
6731
- /* @__PURE__ */ jsx108(Divider9, {}),
6732
- /* @__PURE__ */ jsx108(Skeleton2, { variant: "rounded", className: classes.skeleton })
6733
- ] });
6734
- return /* @__PURE__ */ jsxs73(Fragment11, { children: [
6735
- /* @__PURE__ */ jsx108(
6736
- ActiveFiltersIconButton_default,
6737
- {
6738
- numActiveFilters,
6739
- handleClick: handleFilterMenuOpen,
6740
- className: classNames3("filter-menu-trigger", {
6741
- "has-active-filters": !!numActiveFilters || !!anchorEl
6742
- })
6743
- }
6744
- ),
6745
- /* @__PURE__ */ jsx108(
6746
- Menu4,
6747
- {
6748
- open: !!anchorEl,
6749
- onClose: handleFilterMenuClose,
6750
- anchorEl,
6751
- "data-testid": "filter-menu",
6752
- anchorOrigin: { vertical: "bottom", horizontal: "right" },
6753
- transformOrigin: { vertical: "top", horizontal: "right" },
6754
- children: headCell.isFetchingFilterOptions ? loadingSkeletons : /* @__PURE__ */ jsxs73(Box28, { className: classes.filterMenu, children: [
6755
- /* @__PURE__ */ jsx108(Box28, { px: 3, mb: 0.5, children: /* @__PURE__ */ jsx108(
6756
- FormControlLabel3,
6757
- {
6758
- label: "Select All",
6759
- control: /* @__PURE__ */ jsx108(
6760
- Checkbox4,
6761
- {
6762
- disableRipple: true,
6763
- checked: numCurrentSelectedFilters === numFilterOptions,
6764
- indeterminate: numCurrentSelectedFilters > 0 && numCurrentSelectedFilters < numFilterOptions,
6765
- onChange: ({ target: { checked } }) => {
6766
- if (checked) {
6767
- setSelectedFilters([...filterOptionsData]);
6768
- } else {
6769
- setSelectedFilters([]);
6770
- }
6771
- }
6772
- }
6773
- )
6774
- }
6775
- ) }),
6776
- /* @__PURE__ */ jsx108(Divider9, { sx: { mb: 0.5 } }),
6777
- /* @__PURE__ */ jsx108(Box28, { className: classes.filterOptions, children: filterOptionsData?.map(
6778
- (option) => {
6779
- const resolvedOption = resolveOptionType(option, headCell.fieldName ?? "");
6780
- return /* @__PURE__ */ jsxs73(
6781
- Box28,
6782
- {
6783
- className: classes.filter,
6784
- children: [
6785
- /* @__PURE__ */ jsx108(
6786
- FormControlLabel3,
6787
- {
6788
- label: resolvedOption,
6789
- control: /* @__PURE__ */ jsx108(
6790
- Checkbox4,
6791
- {
6792
- disableRipple: true,
6793
- onChange: () => handleFilterOptionClick(option),
6794
- checked: isOptionChecked(resolvedOption)
6795
- }
6796
- )
6797
- },
6798
- resolvedOption
6799
- ),
6800
- shouldShowCheckOnFilter?.(headCell.id, option) ? /* @__PURE__ */ jsx108(Tooltip6, { title: "This filter is saved as default", children: /* @__PURE__ */ jsx108(CheckIcon, { fontSize: "small", color: "action" }) }) : null
6801
- ]
6802
- },
6803
- resolvedOption
6804
- );
6805
- }
6806
- ) }),
6807
- /* @__PURE__ */ jsx108(Divider9, { sx: { mb: 0.5 } }),
6808
- /* @__PURE__ */ jsxs73(Box28, { className: classes.applyFilterButtonsContainer, children: [
6809
- /* @__PURE__ */ jsx108(
6810
- ExtendedButton_default,
6811
- {
6812
- copy: "Save as Default",
6813
- buttonType: "button",
6814
- variant: "text",
6815
- tooltip: "Persists those filters for future visits",
6816
- className: classes.saveAsDefaultButton,
6817
- onClick: () => handleApplyFilters(true)
6818
- }
6819
- ),
6820
- /* @__PURE__ */ jsx108(
6821
- ExtendedButton_default,
6822
- {
6823
- copy: "Apply",
6824
- color: "primary",
6825
- buttonType: "submit",
6826
- onClick: () => handleApplyFilters(false)
6827
- }
6828
- )
6829
- ] })
6830
- ] })
6831
- }
6832
- )
6833
- ] });
6834
- };
6835
- var SmartTableHeaderFilterMenu_default = memo20(SmartTableHeaderFilterMenu);
6602
+ import { makeStyles as makeStyles48 } from "tss-react/mui";
6603
+
6604
+ // src/components/TableDesktop/TableDesktop.tsx
6605
+ import {
6606
+ useCallback as useCallback2,
6607
+ useMemo as useMemo2,
6608
+ useState as useState15,
6609
+ useEffect as useEffect10
6610
+ } from "react";
6611
+ import {
6612
+ Paper as Paper10,
6613
+ Table,
6614
+ TableBody as TableBody2,
6615
+ TableContainer,
6616
+ Skeleton as Skeleton2,
6617
+ TableRow as TableRow4,
6618
+ TableCell as TableCell4,
6619
+ CircularProgress as CircularProgress5
6620
+ } from "@mui/material";
6621
+ import { makeStyles as makeStyles47 } from "tss-react/mui";
6836
6622
 
6837
6623
  // src/components/SmartTableHeader/SmartTableHeader.tsx
6838
- import { memo as memo21 } from "react";
6624
+ import { memo as memo20 } from "react";
6839
6625
  import {
6840
- Box as Box29,
6841
- Checkbox as Checkbox5,
6626
+ Box as Box28,
6627
+ Checkbox as Checkbox4,
6842
6628
  TableCell,
6843
6629
  TableHead,
6844
6630
  TableRow,
6845
6631
  TableSortLabel,
6846
- Tooltip as Tooltip7,
6632
+ Tooltip as Tooltip6,
6847
6633
  Typography as Typography25
6848
6634
  } from "@mui/material";
6849
- import { makeStyles as makeStyles46 } from "tss-react/mui";
6850
- import { jsx as jsx109, jsxs as jsxs74 } from "react/jsx-runtime";
6851
- var useStyles46 = makeStyles46()((theme) => ({
6635
+ import { makeStyles as makeStyles45 } from "tss-react/mui";
6636
+ import { jsx as jsx108, jsxs as jsxs73 } from "react/jsx-runtime";
6637
+ var useStyles45 = makeStyles45()((theme) => ({
6852
6638
  root: {
6853
6639
  backgroundColor: colors.neutral100,
6854
6640
  height: theme.spacing(6),
@@ -6871,7 +6657,6 @@ var useStyles46 = makeStyles46()((theme) => ({
6871
6657
  tableHeaderContent: {
6872
6658
  borderBottom: "1px solid",
6873
6659
  borderBottomColor: colors.neutral300,
6874
- backgroundColor: colors.neutral100,
6875
6660
  whiteSpace: "nowrap",
6876
6661
  "& .filter-menu-trigger": {
6877
6662
  visibility: "hidden",
@@ -6916,14 +6701,14 @@ var SmartTableHeader = ({
6916
6701
  onApplyFilters,
6917
6702
  shouldShowCheckOnFilter
6918
6703
  }) => {
6919
- const { classes } = useStyles46();
6704
+ const { classes } = useStyles45();
6920
6705
  const createSortHandler = (property) => (event) => {
6921
6706
  onRequestSort(event, property);
6922
6707
  };
6923
6708
  const isSortActive = (headCellId) => orderBy === headCellId;
6924
- return /* @__PURE__ */ jsx109(TableHead, { className: classes.root, children: /* @__PURE__ */ jsxs74(TableRow, { children: [
6925
- enableCheckboxSelection ? /* @__PURE__ */ jsx109(TableCell, { padding: "checkbox", sx: { backgroundColor: colors.neutral100 }, children: /* @__PURE__ */ jsx109(
6926
- Checkbox5,
6709
+ return /* @__PURE__ */ jsx108(TableHead, { className: classes.root, children: /* @__PURE__ */ jsxs73(TableRow, { children: [
6710
+ enableCheckboxSelection ? /* @__PURE__ */ jsx108(TableCell, { padding: "checkbox", children: /* @__PURE__ */ jsx108(
6711
+ Checkbox4,
6927
6712
  {
6928
6713
  color: "primary",
6929
6714
  disableRipple: true,
@@ -6932,21 +6717,21 @@ var SmartTableHeader = ({
6932
6717
  onChange: onSelectAllClick
6933
6718
  }
6934
6719
  ) }) : null,
6935
- headCells.map((headCell) => /* @__PURE__ */ jsx109(
6720
+ headCells.map((headCell) => /* @__PURE__ */ jsx108(
6936
6721
  TableCell,
6937
6722
  {
6938
6723
  className: classes.tableHeaderContent,
6939
6724
  align: "left",
6940
6725
  width: headCell.width ?? "auto",
6941
6726
  sortDirection: orderBy === headCell.id ? order : false,
6942
- children: /* @__PURE__ */ jsxs74(
6943
- Box29,
6727
+ children: /* @__PURE__ */ jsxs73(
6728
+ Box28,
6944
6729
  {
6945
6730
  display: "flex",
6946
6731
  flexDirection: "row",
6947
6732
  gap: headCell.disableSort ? 1 : 0,
6948
6733
  children: [
6949
- headCell.disableSort ? headCell.RenderHeader ?? /* @__PURE__ */ jsx109(Tooltip7, { title: headCell.labelTooltip ?? "", arrow: true, children: /* @__PURE__ */ jsx109(Typography25, { variant: "subtitle2", mt: 0.25, fontWeight: 600, children: headCell.label }) }) : /* @__PURE__ */ jsx109(Tooltip7, { title: headCell.labelTooltip ?? "", arrow: true, children: /* @__PURE__ */ jsxs74(
6734
+ headCell.disableSort ? headCell.RenderHeader ?? /* @__PURE__ */ jsx108(Tooltip6, { title: headCell.labelTooltip ?? "", arrow: true, children: /* @__PURE__ */ jsx108(Typography25, { variant: "subtitle2", mt: 0.25, fontWeight: 600, children: headCell.label }) }) : /* @__PURE__ */ jsx108(Tooltip6, { title: headCell.labelTooltip ?? "", arrow: true, children: /* @__PURE__ */ jsxs73(
6950
6735
  TableSortLabel,
6951
6736
  {
6952
6737
  "data-testid": "table-sort-label",
@@ -6955,11 +6740,11 @@ var SmartTableHeader = ({
6955
6740
  onClick: createSortHandler(headCell.id),
6956
6741
  children: [
6957
6742
  headCell.RenderHeader ?? headCell.label,
6958
- orderBy === headCell.id ? /* @__PURE__ */ jsx109("span", { className: classes.visuallyHidden, children: order === "desc" ? "sorted descending" : "sorted ascending" }) : null
6743
+ orderBy === headCell.id ? /* @__PURE__ */ jsx108("span", { className: classes.visuallyHidden, children: order === "desc" ? "sorted descending" : "sorted ascending" }) : null
6959
6744
  ]
6960
6745
  }
6961
6746
  ) }),
6962
- headCell.refetchFilterOptions ? /* @__PURE__ */ jsx109(
6747
+ headCell.refetchFilterOptions ? /* @__PURE__ */ jsx108(
6963
6748
  SmartTableHeaderFilterMenu_default,
6964
6749
  {
6965
6750
  headCell,
@@ -6977,85 +6762,161 @@ var SmartTableHeader = ({
6977
6762
  ))
6978
6763
  ] }) });
6979
6764
  };
6980
- var SmartTableHeader_default = memo21(SmartTableHeader);
6765
+ var SmartTableHeader_default = memo20(SmartTableHeader);
6981
6766
 
6982
- // src/components/Table/Table.tsx
6983
- var import_debounce = __toESM(require_debounce(), 1);
6984
- import { useLayoutEffect, useState as useState16 } from "react";
6985
- import {
6986
- Box as Box31,
6987
- Paper as Paper10,
6988
- Table as MUITable,
6989
- TableBody,
6990
- TableCell as TableCell2,
6991
- TableContainer,
6992
- TableHead as TableHead2,
6993
- TableRow as TableRow2,
6994
- TableSortLabel as TableSortLabel2
6995
- } from "@mui/material";
6996
- import { makeStyles as makeStyles47 } from "tss-react/mui";
6997
- import { v4 as uuidv4 } from "uuid";
6767
+ // src/components/TableDesktopNoColumnsMessage/TableDesktopNoColumnsMessage.tsx
6768
+ import TableBody from "@mui/material/TableBody";
6769
+ import TableCell2 from "@mui/material/TableCell";
6770
+ import TableRow2 from "@mui/material/TableRow";
6771
+ import Typography26 from "@mui/material/Typography";
6772
+
6773
+ // src/components/Buttons/IconButton/IconButton.tsx
6774
+ import { Button as Button13 } from "@mui/material";
6775
+ import { jsxs as jsxs74 } from "react/jsx-runtime";
6776
+ var IconButton4 = ({ icon, sx, ...props }) => {
6777
+ return /* @__PURE__ */ jsxs74(
6778
+ Button13,
6779
+ {
6780
+ ...props,
6781
+ sx: {
6782
+ display: "flex",
6783
+ gap: 1,
6784
+ alignItems: "center",
6785
+ justifyContent: "center",
6786
+ borderRadius: 100,
6787
+ ...sx
6788
+ },
6789
+ children: [
6790
+ icon,
6791
+ props.children
6792
+ ]
6793
+ }
6794
+ );
6795
+ };
6796
+ var IconButton_default = IconButton4;
6998
6797
 
6999
- // src/components/TableLoading/TableLoading.tsx
7000
- import { Box as Box30, Skeleton as Skeleton3 } from "@mui/material";
7001
- import { jsx as jsx110 } from "react/jsx-runtime";
7002
- var TableLoading = ({
7003
- rowsPerPage,
7004
- rowHeight
7005
- }) => /* @__PURE__ */ jsx110(Box30, { children: Array.from({ length: rowsPerPage ?? 0 }).map((_, index) => /* @__PURE__ */ jsx110(
7006
- Skeleton3,
6798
+ // src/components/icons/IconTableEdit.tsx
6799
+ import { jsx as jsx109 } from "react/jsx-runtime";
6800
+ var SvgIconTableEdit = (props) => /* @__PURE__ */ jsx109(
6801
+ "svg",
7007
6802
  {
7008
- animation: "pulse",
7009
- "data-testid": "table-loading-skeleton",
7010
- style: { margin: "8px", opacity: 0.4 },
7011
- variant: "rectangular",
7012
- height: rowHeight
7013
- },
7014
- index
7015
- )) });
7016
- var TableLoading_default = TableLoading;
6803
+ xmlns: "http://www.w3.org/2000/svg",
6804
+ width: "24",
6805
+ height: "24",
6806
+ viewBox: "0 0 24 24",
6807
+ ...props,
6808
+ children: /* @__PURE__ */ jsx109("path", { d: "M21.7 13.35L20.7 14.35L18.65 12.3L19.65 11.3C19.86 11.08 20.21 11.08 20.42 11.3L21.7 12.58C21.92 12.79 21.92 13.14 21.7 13.35ZM12 18.94L18.07 12.88L20.12 14.93L14.06 21H12V18.94ZM4 2H18C18.5304 2 19.0391 2.21071 19.4142 2.58579C19.7893 2.96086 20 3.46957 20 4V8.17L16.17 12H12V16.17L10.17 18H4C3.46957 18 2.96086 17.7893 2.58579 17.4142C2.21071 17.0391 2 16.5304 2 16V4C2 3.46957 2.21071 2.96086 2.58579 2.58579C2.96086 2.21071 3.46957 2 4 2ZM4 6V10H10V6H4ZM12 6V10H18V6H12ZM4 12V16H10V12H4Z" })
6809
+ }
6810
+ );
6811
+ var IconTableEdit_default = SvgIconTableEdit;
7017
6812
 
7018
- // src/components/Table/helpers.tsx
7019
- function stableSort(array, cmp) {
7020
- const stabilizedThis = array.map((el, index) => [el, index]);
7021
- stabilizedThis.sort((a, b) => {
7022
- const order = cmp(a[0], b[0]);
7023
- if (order !== 0) {
7024
- return order;
7025
- }
7026
- return a[1] - b[1];
7027
- });
7028
- return stabilizedThis.map((el) => el[0]);
7029
- }
7030
- function descendingComparator(a, b, orderBy) {
7031
- if (b[orderBy] < a[orderBy]) {
7032
- return -1;
7033
- }
7034
- if (b[orderBy] > a[orderBy]) {
7035
- return 1;
6813
+ // src/components/TableDesktopNoColumnsMessage/TableDesktopNoColumnsMessage.tsx
6814
+ import { jsx as jsx110, jsxs as jsxs75 } from "react/jsx-runtime";
6815
+ var TableDesktopNoColumnsMessage = ({
6816
+ handleClickOnNoColumnsMessageAction
6817
+ }) => /* @__PURE__ */ jsx110(TableBody, { children: /* @__PURE__ */ jsx110(TableRow2, { children: /* @__PURE__ */ jsxs75(
6818
+ TableCell2,
6819
+ {
6820
+ sx: {
6821
+ py: 8,
6822
+ gap: 2,
6823
+ borderBottom: "none",
6824
+ display: "flex",
6825
+ flexDirection: "column",
6826
+ justifyContent: "center",
6827
+ alignItems: "center"
6828
+ },
6829
+ children: [
6830
+ /* @__PURE__ */ jsx110(Typography26, { variant: "subtitle2", fontSize: 16, children: "Customise your view" }),
6831
+ /* @__PURE__ */ jsx110(Typography26, { variant: "subtitle1", align: "center", color: "textSecondary", children: "Open the menu to customise your table and search." }),
6832
+ /* @__PURE__ */ jsxs75(
6833
+ Typography26,
6834
+ {
6835
+ variant: "subtitle1",
6836
+ align: "center",
6837
+ color: "textSecondary",
6838
+ sx: {
6839
+ backgroundColor: colors.neutral200,
6840
+ padding: 1,
6841
+ borderRadius: 1
6842
+ },
6843
+ children: [
6844
+ "Tips: ",
6845
+ /* @__PURE__ */ jsx110(Typography26, { component: "strong", children: "Save as default" }),
6846
+ " to keep these columns for future views"
6847
+ ]
6848
+ }
6849
+ ),
6850
+ /* @__PURE__ */ jsx110(
6851
+ IconButton_default,
6852
+ {
6853
+ icon: /* @__PURE__ */ jsx110(IconTableEdit_default, { fill: colors.white }),
6854
+ variant: "contained",
6855
+ color: "primary",
6856
+ onClick: handleClickOnNoColumnsMessageAction,
6857
+ children: "OPEN MENU"
6858
+ }
6859
+ )
6860
+ ]
7036
6861
  }
7037
- return 0;
7038
- }
7039
- function getSorting(order, orderBy) {
7040
- return order === "desc" ? (a, b) => descendingComparator(a, b, orderBy) : (a, b) => -descendingComparator(a, b, orderBy);
7041
- }
7042
- function calculateRowsPerPage(rowHeight) {
7043
- const appContainerDom = document.getElementById("mainContainer");
7044
- const headerDom = document.getElementById("aboveTableHeader");
7045
- if (appContainerDom && headerDom) {
7046
- return Math.floor(
7047
- (appContainerDom.clientHeight - headerDom.clientHeight - 24) / rowHeight - 2
7048
- );
6862
+ ) }) });
6863
+
6864
+ // src/components/TableEmptyResult/TableEmptyResult.tsx
6865
+ import { TableCell as TableCell3, TableRow as TableRow3, Typography as Typography27 } from "@mui/material";
6866
+ import { makeStyles as makeStyles46 } from "tss-react/mui";
6867
+ import { jsx as jsx111, jsxs as jsxs76 } from "react/jsx-runtime";
6868
+ var useStyles46 = makeStyles46()(() => ({
6869
+ tableCellIcon: { padding: 24, height: "calc(100vh - 320px)" },
6870
+ tableCellDefault: { padding: 24 }
6871
+ }));
6872
+ var TableEmptyResult = ({
6873
+ colSpan,
6874
+ showClearFilterButton = false,
6875
+ handleClickOnClearFiltersButton = () => {
7049
6876
  }
7050
- return 1;
7051
- }
6877
+ }) => {
6878
+ const { classes } = useStyles46();
6879
+ return showClearFilterButton ? /* @__PURE__ */ jsx111(TableRow3, { children: /* @__PURE__ */ jsxs76(
6880
+ TableCell3,
6881
+ {
6882
+ className: classes.tableCellIcon,
6883
+ colSpan,
6884
+ align: "center",
6885
+ children: [
6886
+ /* @__PURE__ */ jsx111(EmptyGlassIcon_default, {}),
6887
+ /* @__PURE__ */ jsx111(Typography27, { variant: "h6", children: "No results found." }),
6888
+ /* @__PURE__ */ jsx111(Typography27, { variant: "subtitle1", children: "Search without applied filters?" }),
6889
+ /* @__PURE__ */ jsx111(
6890
+ FilledButton_default,
6891
+ {
6892
+ copy: "Search",
6893
+ variant: "contained",
6894
+ color: "primary",
6895
+ onClick: handleClickOnClearFiltersButton
6896
+ }
6897
+ )
6898
+ ]
6899
+ }
6900
+ ) }) : /* @__PURE__ */ jsx111(TableRow3, { children: /* @__PURE__ */ jsx111(
6901
+ TableCell3,
6902
+ {
6903
+ className: classes.tableCellDefault,
6904
+ colSpan,
6905
+ align: "center",
6906
+ children: "Nothing to display"
6907
+ }
6908
+ ) });
6909
+ };
6910
+ var TableEmptyResult_default = TableEmptyResult;
7052
6911
 
7053
- // src/components/Table/Table.tsx
7054
- import { jsx as jsx111, jsxs as jsxs75 } from "react/jsx-runtime";
7055
- var useStyles47 = makeStyles47()(() => ({
6912
+ // src/components/TableDesktop/TableDesktop.tsx
6913
+ import { Fragment as Fragment11, jsx as jsx112, jsxs as jsxs77 } from "react/jsx-runtime";
6914
+ var ROW_HEIGHT = 56;
6915
+ var useStyles47 = makeStyles47()((theme) => ({
7056
6916
  root: {
7057
- height: "calc(100vh - 262px)",
7058
- overflow: "scroll"
6917
+ justifyContent: "space-between",
6918
+ display: "flex",
6919
+ justifyItems: "stretch"
7059
6920
  },
7060
6921
  paper: {
7061
6922
  width: "100%",
@@ -7063,37 +6924,106 @@ var useStyles47 = makeStyles47()(() => ({
7063
6924
  flexDirection: "column",
7064
6925
  justifyContent: "space-between"
7065
6926
  },
7066
- header: {
7067
- "& .MuiTableSortLabel-root": {
7068
- fontWeight: 600,
7069
- fontSize: ".875rem"
7070
- }
7071
- },
7072
6927
  container: {
7073
- maxHeight: "calc(100% - 0)"
6928
+ maxHeight: "100%",
6929
+ "&::-webkit-scrollbar": {
6930
+ width: "8px",
6931
+ height: "8px"
6932
+ },
6933
+ "&::-webkit-scrollbar-track": {
6934
+ backgroundColor: theme.palette.mode === "dark" ? theme.palette.grey[800] : theme.palette.grey[100]
6935
+ },
6936
+ "&::-webkit-scrollbar-thumb": {
6937
+ backgroundColor: theme.palette.mode === "dark" ? theme.palette.grey[900] : theme.palette.grey[400],
6938
+ borderRadius: "10px"
6939
+ },
6940
+ "&::-webkit-scrollbar-thumb:hover": {
6941
+ backgroundColor: theme.palette.mode === "dark" ? theme.palette.common.black : theme.palette.grey[500]
6942
+ }
7074
6943
  }
7075
6944
  }));
7076
- var Table = ({
7077
- appliedFilters,
6945
+ var descendingComparator = (a, b, orderBy) => {
6946
+ const objA = a[orderBy];
6947
+ const objB = b[orderBy];
6948
+ const valA = typeof objA === "object" ? objA?.name : objA;
6949
+ const valB = typeof objB === "object" ? objB?.name : objB;
6950
+ if (!valA && !valB) {
6951
+ return 0;
6952
+ }
6953
+ if (valA && !valB) {
6954
+ return -1;
6955
+ }
6956
+ if (!valA && valB) {
6957
+ return 1;
6958
+ }
6959
+ if (valA > valB) {
6960
+ return -1;
6961
+ }
6962
+ if (valA < valB) {
6963
+ return 1;
6964
+ }
6965
+ return 0;
6966
+ };
6967
+ var stableSort = (array, cmp) => array.map((el, index) => ({ el, index })).sort((a, b) => {
6968
+ const order = cmp(a.el, b.el);
6969
+ return order !== 0 ? order : a.index - b.index;
6970
+ }).map((el) => el.el);
6971
+ var getComparator = (order, orderBy) => order === "desc" ? (a, b) => descendingComparator(a, b, orderBy) : (a, b) => -descendingComparator(a, b, orderBy);
6972
+ var resolveOptionType = (option, fieldName) => {
6973
+ if (!option || typeof option !== "object") {
6974
+ return option;
6975
+ }
6976
+ return option[fieldName] || "";
6977
+ };
6978
+ var TableDesktop = ({
7078
6979
  data,
7079
- doNotCalculateRows,
7080
6980
  headCells,
6981
+ RenderItem,
6982
+ appliedFilters,
6983
+ headerFilters,
6984
+ children,
6985
+ height,
7081
6986
  isLoading,
7082
- onRowClick,
7083
- page = 0,
7084
- RenderItem = null,
7085
- rowsPerPage: defaultRowsPerPage = 10,
7086
- serverRendered,
7087
- updateSort
6987
+ rowsPerPage = 50,
6988
+ enableCheckboxSelection = false,
6989
+ disableInternalSort = false,
6990
+ updateSort,
6991
+ showClearFilterButton,
6992
+ handleClickOnClearFiltersButton,
6993
+ handleClickOnNoColumnsMessageAction,
6994
+ deleteItem,
6995
+ keyField = "id",
6996
+ tableLayout = "auto",
6997
+ onApplyFilters,
6998
+ shouldShowCheckOnFilter
7088
6999
  }) => {
7089
- const [order, setOrder] = useState16(appliedFilters?.sortDir || "desc");
7090
- const [orderBy, setOrderBy] = useState16(
7000
+ const { classes } = useStyles47();
7001
+ const [order, setOrder] = useState15(appliedFilters?.sortDir || "desc");
7002
+ const [orderBy, setOrderBy] = useState15(
7091
7003
  appliedFilters?.sortField || "delivery_date"
7092
7004
  );
7093
- const [rowsPerPage, setRowsPerPage] = useState16(defaultRowsPerPage);
7094
- const { classes } = useStyles47();
7095
- const rowHeight = 56;
7096
- const emptyRows = rowsPerPage - Math.min(rowsPerPage, data.length - page * rowsPerPage);
7005
+ const [selected, setSelected] = useState15(/* @__PURE__ */ new Set());
7006
+ const [page] = useState15(0);
7007
+ const numRows = data.length;
7008
+ const emptyRows = useMemo2(
7009
+ () => rowsPerPage - data.length,
7010
+ [rowsPerPage, data]
7011
+ );
7012
+ const visibleHeadCells = useMemo2(
7013
+ () => headCells.filter((headCell) => headCell?.enabled ?? true),
7014
+ [headCells]
7015
+ );
7016
+ const handleSelectAllClick = useCallback2(
7017
+ (event) => {
7018
+ if (event.target.checked) {
7019
+ const allItems = new Set(data.map((n) => n[keyField]));
7020
+ setSelected(allItems);
7021
+ } else {
7022
+ setSelected(/* @__PURE__ */ new Set());
7023
+ }
7024
+ },
7025
+ [data, keyField]
7026
+ );
7097
7027
  const handleRequestSort = (event, property) => {
7098
7028
  const isAsc = orderBy === property && order === "asc";
7099
7029
  const orderDir = isAsc ? "desc" : "asc";
@@ -7103,441 +7033,474 @@ var Table = ({
7103
7033
  updateSort(property, orderDir);
7104
7034
  }
7105
7035
  };
7106
- useLayoutEffect(() => {
7107
- if (!doNotCalculateRows) {
7108
- return;
7109
- }
7110
- function updateRowsPerPage() {
7111
- const newRowsPerPage = calculateRowsPerPage(rowHeight);
7112
- setRowsPerPage(newRowsPerPage);
7036
+ const handleRowCheckboxChange = useCallback2(
7037
+ (event, keyFieldValue) => {
7038
+ event.stopPropagation();
7039
+ setSelected((prev) => {
7040
+ const newSelected = new Set(prev);
7041
+ if (newSelected.has(keyFieldValue)) {
7042
+ newSelected.delete(keyFieldValue);
7043
+ } else {
7044
+ newSelected.add(keyFieldValue);
7045
+ }
7046
+ return newSelected;
7047
+ });
7048
+ },
7049
+ []
7050
+ );
7051
+ const renderTableRows = useMemo2(() => {
7052
+ if (isLoading) {
7053
+ return [...Array(Math.min(numRows, rowsPerPage))].map((_, rowIndex) => /* @__PURE__ */ jsx112(TableRow4, { children: [...Array(visibleHeadCells.length)].map((_2, cellIndex) => /* @__PURE__ */ jsx112(TableCell4, { children: /* @__PURE__ */ jsx112(
7054
+ Skeleton2,
7055
+ {
7056
+ animation: "pulse",
7057
+ variant: "rounded",
7058
+ height: ROW_HEIGHT - 33,
7059
+ sx: { bgcolor: colors.neutral100 },
7060
+ "data-testid": "loading-skeleton"
7061
+ }
7062
+ ) }, cellIndex)) }, rowIndex));
7113
7063
  }
7114
- updateRowsPerPage();
7115
- const debounced = (0, import_debounce.default)(updateRowsPerPage, 150);
7116
- window.addEventListener("resize", debounced);
7117
- return () => {
7118
- window.removeEventListener("resize", debounced);
7119
- };
7120
- }, [doNotCalculateRows]);
7121
- const createSortHandler = (property) => (event) => {
7122
- handleRequestSort(event, property);
7123
- };
7124
- const getTableRows = () => {
7125
- const index = page;
7126
- const rows = serverRendered ? data : stableSort(data, getSorting(order, orderBy)).slice(
7127
- index * rowsPerPage,
7128
- index * rowsPerPage + rowsPerPage
7129
- );
7130
- const rowsComponents = rows.map((row) => {
7131
- if (RenderItem) {
7132
- return /* @__PURE__ */ jsx111(RenderItem, { ...row }, row.id);
7133
- }
7134
- return /* @__PURE__ */ jsx111(TableRow2, { hover: true, onClick: () => onRowClick?.(row), children: headCells?.map((column) => /* @__PURE__ */ jsx111(TableCell2, { children: row[column.id] }, column.id)) }, row.id);
7135
- });
7136
- if (emptyRows > 0 && rowsPerPage > emptyRows) {
7137
- rowsComponents.push(
7138
- /* @__PURE__ */ jsx111(TableRow2, { style: { height: rowHeight * emptyRows }, children: /* @__PURE__ */ jsx111(TableCell2, { colSpan: 8 }) }, uuidv4())
7064
+ const sortedData = disableInternalSort ? data : stableSort(data, getComparator(order, orderBy));
7065
+ return sortedData.slice(page * rowsPerPage, page * rowsPerPage + rowsPerPage).map((row, index) => {
7066
+ const isItemSelected = selected.has(row[keyField]);
7067
+ return /* @__PURE__ */ jsx112(
7068
+ RenderItem,
7069
+ {
7070
+ ...{
7071
+ ...row,
7072
+ index,
7073
+ deleteItem,
7074
+ isItemSelected,
7075
+ enableCheckboxSelection,
7076
+ rowHeight: ROW_HEIGHT,
7077
+ rowId: row[keyField],
7078
+ handleRowCheckboxChange,
7079
+ visibleHeadCells
7080
+ }
7081
+ },
7082
+ row[keyField] ?? index
7139
7083
  );
7084
+ });
7085
+ }, [
7086
+ data,
7087
+ order,
7088
+ orderBy,
7089
+ page,
7090
+ rowsPerPage,
7091
+ selected,
7092
+ isLoading,
7093
+ numRows,
7094
+ enableCheckboxSelection,
7095
+ disableInternalSort,
7096
+ deleteItem,
7097
+ keyField,
7098
+ handleRowCheckboxChange,
7099
+ visibleHeadCells,
7100
+ RenderItem
7101
+ ]);
7102
+ useEffect10(() => {
7103
+ if (!enableCheckboxSelection) {
7104
+ setSelected(/* @__PURE__ */ new Set());
7140
7105
  }
7141
- return rowsComponents;
7142
- };
7143
- return /* @__PURE__ */ jsx111(Paper10, { className: classes.root, children: /* @__PURE__ */ jsx111(Box31, { className: classes.paper, children: isLoading ? /* @__PURE__ */ jsx111(TableLoading_default, { rowHeight, rowsPerPage }) : /* @__PURE__ */ jsx111(TableContainer, { className: classes.container, children: /* @__PURE__ */ jsxs75(MUITable, { size: "medium", stickyHeader: true, children: [
7144
- /* @__PURE__ */ jsx111(TableHead2, { className: classes.header, children: /* @__PURE__ */ jsx111(TableRow2, { children: headCells?.map((headCell) => /* @__PURE__ */ jsx111(
7145
- TableCell2,
7106
+ }, [enableCheckboxSelection]);
7107
+ return /* @__PURE__ */ jsx112("div", { className: classes.root, style: { height }, children: /* @__PURE__ */ jsxs77(Paper10, { className: classes.paper, children: [
7108
+ /* @__PURE__ */ jsx112(TableContainer, { className: classes.container, children: /* @__PURE__ */ jsx112(
7109
+ Table,
7146
7110
  {
7147
- align: "left",
7148
- sortDirection: orderBy === headCell.id ? order : void 0,
7149
- children: /* @__PURE__ */ jsx111(
7150
- TableSortLabel2,
7111
+ stickyHeader: true,
7112
+ "aria-labelledby": "tableTitle",
7113
+ "aria-label": "sticky table",
7114
+ style: { tableLayout },
7115
+ children: visibleHeadCells.length === 0 && !isLoading ? /* @__PURE__ */ jsx112(
7116
+ TableDesktopNoColumnsMessage,
7151
7117
  {
7152
- active: orderBy === headCell.id,
7153
- direction: orderBy === headCell.id ? order : "asc",
7154
- onClick: createSortHandler(headCell.id),
7155
- children: headCell.label
7118
+ handleClickOnNoColumnsMessageAction
7156
7119
  }
7157
- )
7158
- },
7159
- headCell.id
7160
- )) }) }),
7161
- /* @__PURE__ */ jsxs75(TableBody, { children: [
7162
- getTableRows(),
7163
- rowsPerPage === emptyRows && /* @__PURE__ */ jsx111(TableRow2, { style: { height: rowHeight * emptyRows }, children: /* @__PURE__ */ jsx111(TableCell2, { colSpan: 8, align: "center", children: "Nothing to display" }) })
7164
- ] })
7165
- ] }) }) }) });
7120
+ ) : /* @__PURE__ */ jsxs77(Fragment11, { children: [
7121
+ /* @__PURE__ */ jsx112(
7122
+ SmartTableHeader_default,
7123
+ {
7124
+ headCells: visibleHeadCells,
7125
+ order,
7126
+ orderBy,
7127
+ numSelected: selected.size,
7128
+ numRows,
7129
+ enableCheckboxSelection,
7130
+ headerFilters: headerFilters ?? {},
7131
+ onRequestSort: handleRequestSort,
7132
+ onSelectAllClick: handleSelectAllClick,
7133
+ onApplyFilters,
7134
+ shouldShowCheckOnFilter
7135
+ }
7136
+ ),
7137
+ !isLoading ? /* @__PURE__ */ jsx112(TableBody2, { children: rowsPerPage !== emptyRows ? renderTableRows : /* @__PURE__ */ jsx112(
7138
+ TableEmptyResult_default,
7139
+ {
7140
+ colSpan: enableCheckboxSelection ? visibleHeadCells.length + 1 : visibleHeadCells.length,
7141
+ showClearFilterButton,
7142
+ handleClickOnClearFiltersButton
7143
+ }
7144
+ ) }) : /* @__PURE__ */ jsx112(TableBody2, { children: /* @__PURE__ */ jsx112(TableRow4, { children: /* @__PURE__ */ jsx112(
7145
+ TableCell4,
7146
+ {
7147
+ colSpan: visibleHeadCells.length,
7148
+ align: "center",
7149
+ children: /* @__PURE__ */ jsx112(CircularProgress5, {})
7150
+ }
7151
+ ) }) })
7152
+ ] })
7153
+ }
7154
+ ) }),
7155
+ children
7156
+ ] }) });
7166
7157
  };
7167
- var Table_default = Table;
7158
+ var TableDesktop_default = TableDesktop;
7168
7159
 
7169
- // src/components/TableDesktop/TableDesktop.tsx
7170
- import {
7171
- useMemo as useMemo3,
7172
- useState as useState17,
7173
- useEffect as useEffect11
7174
- } from "react";
7175
- import {
7176
- Paper as Paper11,
7177
- Table as Table2,
7178
- TableBody as TableBody3,
7179
- TableContainer as TableContainer2,
7180
- Box as Box34
7181
- } from "@mui/material";
7182
-
7183
- // src/components/TableDesktopFooter/TableDesktopFooter.tsx
7184
- import Refresh3 from "@mui/icons-material/Refresh";
7185
- import { Box as Box32, Button as Button13, MenuItem as MenuItem4, Pagination as Pagination2, Select as Select4, Stack, Typography as Typography26 } from "@mui/material";
7186
- import { jsx as jsx112, jsxs as jsxs76 } from "react/jsx-runtime";
7187
- var TableDesktopFooter = ({
7188
- numPages,
7189
- page,
7190
- pageSize,
7191
- pageSizeOptions,
7192
- onPageChange,
7193
- onPageSizeChange,
7194
- refetch,
7195
- isFetching
7160
+ // src/components/SmartTableHeaderFilterMenu/SmartTableHeaderFilterMenu.tsx
7161
+ import { Fragment as Fragment12, jsx as jsx113, jsxs as jsxs78 } from "react/jsx-runtime";
7162
+ var useStyles48 = makeStyles48()((theme) => ({
7163
+ filterMenu: {
7164
+ display: "flex",
7165
+ flexDirection: "column"
7166
+ },
7167
+ filterOptions: {
7168
+ maxHeight: theme.spacing(62),
7169
+ overflowY: "auto",
7170
+ "&::-webkit-scrollbar": {
7171
+ width: "8px",
7172
+ height: "8px"
7173
+ },
7174
+ "&::-webkit-scrollbar-track": {
7175
+ backgroundColor: theme.palette.mode === "dark" ? theme.palette.grey[800] : theme.palette.grey[100]
7176
+ },
7177
+ "&::-webkit-scrollbar-thumb": {
7178
+ backgroundColor: theme.palette.mode === "dark" ? theme.palette.grey[900] : theme.palette.grey[400],
7179
+ borderRadius: "10px"
7180
+ },
7181
+ "&::-webkit-scrollbar-thumb:hover": {
7182
+ backgroundColor: theme.palette.mode === "dark" ? theme.palette.common.black : theme.palette.grey[500]
7183
+ }
7184
+ },
7185
+ filter: {
7186
+ display: "flex",
7187
+ alignItems: "center",
7188
+ justifyContent: "space-between",
7189
+ padding: theme.spacing(0, 3)
7190
+ },
7191
+ applyFilterButtonsContainer: {
7192
+ display: "flex",
7193
+ padding: theme.spacing(0, 1),
7194
+ justifyContent: "space-between"
7195
+ },
7196
+ applyButton: {
7197
+ color: theme.palette.primary.main
7198
+ },
7199
+ skeleton: {
7200
+ height: theme.spacing(3),
7201
+ margin: theme.spacing(1)
7202
+ }
7203
+ }));
7204
+ var findFilterIndex = (filters, filterOption) => filters.findIndex((item) => {
7205
+ if (typeof item === "string" && typeof filterOption === "string") {
7206
+ return item === filterOption;
7207
+ }
7208
+ if (typeof item === "object" && typeof filterOption === "object") {
7209
+ return item.id === filterOption.id;
7210
+ }
7211
+ return false;
7212
+ });
7213
+ var SmartTableHeaderFilterMenu = ({
7214
+ headCell,
7215
+ numActiveFilters,
7216
+ headerFilters,
7217
+ shouldShowCheckOnFilter,
7218
+ onApplyFilters
7196
7219
  }) => {
7197
- return /* @__PURE__ */ jsxs76(
7198
- Box32,
7199
- {
7200
- py: 1,
7201
- gap: 2,
7202
- display: "flex",
7203
- justifyContent: "space-between",
7204
- alignItems: "center",
7205
- borderTop: `1px solid ${colors.neutral300}`,
7206
- bgcolor: (theme) => theme.palette.background.default,
7207
- children: [
7208
- /* @__PURE__ */ jsxs76(
7209
- Button13,
7210
- {
7211
- disableRipple: true,
7212
- variant: "outlined",
7213
- onClick: () => refetch(),
7214
- disabled: isFetching,
7215
- sx: {
7216
- ml: 1,
7217
- gap: 1,
7218
- borderRadius: 25,
7219
- color: colors.neutral800,
7220
- borderColor: colors.neutral600
7221
- },
7222
- children: [
7223
- /* @__PURE__ */ jsx112(
7224
- Refresh3,
7220
+ const { classes } = useStyles48();
7221
+ const [anchorEl, setAnchorEl] = useState16(null);
7222
+ const [filterOptionsData, setFilterOptionsData] = useState16();
7223
+ const [selectedFilters, setSelectedFilters] = useState16(
7224
+ headerFilters[headCell.id] ?? []
7225
+ );
7226
+ useEffect11(() => {
7227
+ if (headCell.filterOptions) {
7228
+ setFilterOptionsData(headCell.filterOptions);
7229
+ }
7230
+ }, [headCell.filterOptions]);
7231
+ const numFilterOptions = useMemo3(
7232
+ () => filterOptionsData?.length ?? 0,
7233
+ [filterOptionsData?.length]
7234
+ );
7235
+ const numCurrentSelectedFilters = selectedFilters.length;
7236
+ const handleFilterMenuOpen = (event) => {
7237
+ if (!numFilterOptions) {
7238
+ headCell.refetchFilterOptions?.();
7239
+ }
7240
+ setAnchorEl(event.currentTarget);
7241
+ };
7242
+ const handleFilterMenuClose = () => {
7243
+ setSelectedFilters(headerFilters[headCell.id]);
7244
+ setAnchorEl(null);
7245
+ };
7246
+ const handleFilterOptionClick = (option) => {
7247
+ const selectedIndex = findFilterIndex(selectedFilters, option);
7248
+ let newSelected;
7249
+ if (selectedIndex === -1) {
7250
+ if (typeof option === "string") {
7251
+ newSelected = [...selectedFilters, option];
7252
+ } else {
7253
+ newSelected = [...selectedFilters, option];
7254
+ }
7255
+ } else {
7256
+ newSelected = selectedFilters.filter(
7257
+ (_, index) => index !== selectedIndex
7258
+ );
7259
+ }
7260
+ setSelectedFilters(newSelected);
7261
+ };
7262
+ const handleApplyFilters = (shouldSave) => {
7263
+ const updatedFilters = {
7264
+ ...headerFilters,
7265
+ [headCell.id]: [...selectedFilters]
7266
+ };
7267
+ onApplyFilters?.(updatedFilters, shouldSave);
7268
+ setAnchorEl(null);
7269
+ };
7270
+ useEffect11(() => {
7271
+ setSelectedFilters(headerFilters[headCell.id] ?? []);
7272
+ }, [headerFilters, headCell.id]);
7273
+ const isOptionChecked = useMemo3(
7274
+ () => (resolvedOption) => !!selectedFilters?.some(
7275
+ (value) => resolveOptionType(value, headCell.fieldName ?? "") === resolvedOption
7276
+ ),
7277
+ [selectedFilters]
7278
+ );
7279
+ const loadingSkeletons = /* @__PURE__ */ jsxs78(Box29, { "data-testid": "loading-skeletons", width: 272, children: [
7280
+ /* @__PURE__ */ jsx113(Skeleton3, { variant: "rounded", className: classes.skeleton }),
7281
+ /* @__PURE__ */ jsx113(Divider9, {}),
7282
+ /* @__PURE__ */ jsx113(Skeleton3, { variant: "rounded", className: classes.skeleton }),
7283
+ /* @__PURE__ */ jsx113(Skeleton3, { variant: "rounded", className: classes.skeleton }),
7284
+ /* @__PURE__ */ jsx113(Skeleton3, { variant: "rounded", className: classes.skeleton }),
7285
+ /* @__PURE__ */ jsx113(Skeleton3, { variant: "rounded", className: classes.skeleton }),
7286
+ /* @__PURE__ */ jsx113(Divider9, {}),
7287
+ /* @__PURE__ */ jsx113(Skeleton3, { variant: "rounded", className: classes.skeleton })
7288
+ ] });
7289
+ return /* @__PURE__ */ jsxs78(Fragment12, { children: [
7290
+ /* @__PURE__ */ jsx113(
7291
+ ActiveFiltersIconButton_default,
7292
+ {
7293
+ numActiveFilters,
7294
+ handleClick: handleFilterMenuOpen,
7295
+ className: classNames3("filter-menu-trigger", {
7296
+ "has-active-filters": !!numActiveFilters || !!anchorEl
7297
+ })
7298
+ }
7299
+ ),
7300
+ /* @__PURE__ */ jsx113(
7301
+ Menu4,
7302
+ {
7303
+ open: !!anchorEl,
7304
+ onClose: handleFilterMenuClose,
7305
+ anchorEl,
7306
+ "data-testid": "filter-menu",
7307
+ anchorOrigin: { vertical: "bottom", horizontal: "right" },
7308
+ transformOrigin: { vertical: "top", horizontal: "right" },
7309
+ children: headCell.isFetchingFilterOptions ? loadingSkeletons : /* @__PURE__ */ jsxs78(Box29, { className: classes.filterMenu, children: [
7310
+ /* @__PURE__ */ jsx113(Box29, { px: 3, mb: 0.5, children: /* @__PURE__ */ jsx113(
7311
+ FormControlLabel3,
7312
+ {
7313
+ label: "Select All",
7314
+ control: /* @__PURE__ */ jsx113(
7315
+ Checkbox5,
7225
7316
  {
7226
- fontSize: "small",
7227
- color: isFetching ? "disabled" : "primary"
7317
+ disableRipple: true,
7318
+ checked: numCurrentSelectedFilters === numFilterOptions,
7319
+ indeterminate: numCurrentSelectedFilters > 0 && numCurrentSelectedFilters < numFilterOptions,
7320
+ onChange: ({ target: { checked } }) => {
7321
+ if (checked) {
7322
+ setSelectedFilters([
7323
+ ...filterOptionsData
7324
+ ]);
7325
+ } else {
7326
+ setSelectedFilters([]);
7327
+ }
7328
+ }
7228
7329
  }
7330
+ )
7331
+ }
7332
+ ) }),
7333
+ /* @__PURE__ */ jsx113(Divider9, { sx: { mb: 0.5 } }),
7334
+ /* @__PURE__ */ jsx113(Box29, { className: classes.filterOptions, children: filterOptionsData?.map((option) => {
7335
+ const resolvedOption = resolveOptionType(
7336
+ option,
7337
+ headCell.fieldName ?? ""
7338
+ );
7339
+ return /* @__PURE__ */ jsxs78(Box29, { className: classes.filter, children: [
7340
+ /* @__PURE__ */ jsx113(
7341
+ FormControlLabel3,
7342
+ {
7343
+ label: resolvedOption,
7344
+ control: /* @__PURE__ */ jsx113(
7345
+ Checkbox5,
7346
+ {
7347
+ disableRipple: true,
7348
+ onChange: () => handleFilterOptionClick(option),
7349
+ checked: isOptionChecked(resolvedOption)
7350
+ }
7351
+ )
7352
+ },
7353
+ resolvedOption
7229
7354
  ),
7230
- "REFRESH"
7231
- ]
7232
- }
7233
- ),
7234
- /* @__PURE__ */ jsxs76(Box32, { display: "flex", children: [
7235
- /* @__PURE__ */ jsxs76(Stack, { direction: "row", spacing: 2, alignItems: "center", children: [
7236
- /* @__PURE__ */ jsx112(Typography26, { children: "Rows per page:" }),
7237
- /* @__PURE__ */ jsx112(
7238
- Select4,
7355
+ shouldShowCheckOnFilter?.(headCell.id, option) ? /* @__PURE__ */ jsx113(Tooltip7, { title: "This filter is saved as default", children: /* @__PURE__ */ jsx113(CheckIcon, { fontSize: "small", color: "action" }) }) : null
7356
+ ] }, resolvedOption);
7357
+ }) }),
7358
+ /* @__PURE__ */ jsx113(Divider9, { sx: { mb: 0.5 } }),
7359
+ /* @__PURE__ */ jsxs78(Box29, { className: classes.applyFilterButtonsContainer, children: [
7360
+ /* @__PURE__ */ jsx113(
7361
+ ExtendedButton_default,
7239
7362
  {
7240
- value: pageSize,
7241
- onChange: onPageSizeChange,
7242
- size: "small",
7243
- variant: "standard",
7244
- children: pageSizeOptions.map((size) => /* @__PURE__ */ jsx112(MenuItem4, { value: size, children: size }, size))
7363
+ copy: "Apply",
7364
+ variant: "text",
7365
+ buttonType: "button",
7366
+ tooltip: "Apply the filters without saving.",
7367
+ className: classes.applyButton,
7368
+ onClick: () => handleApplyFilters(false)
7369
+ }
7370
+ ),
7371
+ /* @__PURE__ */ jsx113(
7372
+ ExtendedButton_default,
7373
+ {
7374
+ copy: "Save as Default",
7375
+ color: "primary",
7376
+ buttonType: "submit",
7377
+ tooltip: "Persists those filters for future visits",
7378
+ onClick: () => handleApplyFilters(true)
7245
7379
  }
7246
7380
  )
7247
- ] }),
7248
- /* @__PURE__ */ jsx112(
7249
- Pagination2,
7250
- {
7251
- color: "standard",
7252
- count: numPages,
7253
- page,
7254
- onChange: onPageChange
7255
- }
7256
- )
7381
+ ] })
7257
7382
  ] })
7258
- ]
7259
- }
7260
- );
7383
+ }
7384
+ )
7385
+ ] });
7261
7386
  };
7387
+ var SmartTableHeaderFilterMenu_default = memo21(SmartTableHeaderFilterMenu);
7262
7388
 
7263
- // src/components/TableDesktopNoColumnsMessage/TableDesktopNoColumnsMessage.tsx
7264
- import TableBody2 from "@mui/material/TableBody";
7265
- import TableCell3 from "@mui/material/TableCell";
7266
- import TableRow3 from "@mui/material/TableRow";
7267
- import Typography27 from "@mui/material/Typography";
7268
- import { jsx as jsx113, jsxs as jsxs77 } from "react/jsx-runtime";
7269
- var TableDesktopNoColumnsMessage = () => /* @__PURE__ */ jsx113(TableBody2, { children: /* @__PURE__ */ jsx113(TableRow3, { children: /* @__PURE__ */ jsxs77(
7270
- TableCell3,
7271
- {
7272
- sx: {
7273
- py: 8,
7274
- gap: 2,
7275
- borderBottom: "none",
7276
- display: "flex",
7277
- flexDirection: "column",
7278
- justifyContent: "center",
7279
- alignItems: "center"
7280
- },
7281
- children: [
7282
- /* @__PURE__ */ jsx113(Typography27, { variant: "subtitle2", fontSize: 16, children: "Customise your view" }),
7283
- /* @__PURE__ */ jsxs77(Typography27, { variant: "subtitle1", align: "center", color: "textSecondary", children: [
7284
- "Use the column selector on the right to choose which fields",
7285
- /* @__PURE__ */ jsx113("br", {}),
7286
- "you want to display in the table"
7287
- ] })
7288
- ]
7289
- }
7290
- ) }) });
7389
+ // src/components/Table/Table.tsx
7390
+ var import_debounce = __toESM(require_debounce(), 1);
7391
+ import { useLayoutEffect, useState as useState17 } from "react";
7392
+ import {
7393
+ Box as Box31,
7394
+ Paper as Paper11,
7395
+ Table as MUITable,
7396
+ TableBody as TableBody3,
7397
+ TableCell as TableCell5,
7398
+ TableContainer as TableContainer2,
7399
+ TableHead as TableHead2,
7400
+ TableRow as TableRow5,
7401
+ TableSortLabel as TableSortLabel2
7402
+ } from "@mui/material";
7403
+ import { makeStyles as makeStyles49 } from "tss-react/mui";
7404
+ import { v4 as uuidv4 } from "uuid";
7291
7405
 
7292
- // src/components/TableDesktopLoadingState/TableDesktopLoadingState.tsx
7293
- import { Skeleton as Skeleton4, TableCell as TableCell4, TableRow as TableRow4 } from "@mui/material";
7406
+ // src/components/TableLoading/TableLoading.tsx
7407
+ import { Box as Box30, Skeleton as Skeleton4 } from "@mui/material";
7294
7408
  import { jsx as jsx114 } from "react/jsx-runtime";
7295
- var getRange = (n) => Array.from({ length: n }, (_, i) => i + 1);
7296
- var TableDesktopLoadingState = ({
7297
- numRows,
7409
+ var TableLoading = ({
7298
7410
  rowsPerPage,
7299
- numColumns,
7300
7411
  rowHeight
7301
- }) => {
7302
- return getRange(Math.min(numRows, rowsPerPage)).map((rowNum) => /* @__PURE__ */ jsx114(TableRow4, { children: getRange(numColumns).map((colNum) => /* @__PURE__ */ jsx114(TableCell4, { children: /* @__PURE__ */ jsx114(
7303
- Skeleton4,
7304
- {
7305
- animation: "pulse",
7306
- variant: "rounded",
7307
- height: rowHeight - 33,
7308
- sx: { bgcolor: colors.neutral100 },
7309
- "data-testid": "loading-skeleton"
7310
- }
7311
- ) }, colNum)) }, rowNum));
7312
- };
7412
+ }) => /* @__PURE__ */ jsx114(Box30, { children: Array.from({ length: rowsPerPage ?? 0 }).map((_, index) => /* @__PURE__ */ jsx114(
7413
+ Skeleton4,
7414
+ {
7415
+ animation: "pulse",
7416
+ "data-testid": "table-loading-skeleton",
7417
+ style: { margin: "8px", opacity: 0.4 },
7418
+ variant: "rectangular",
7419
+ height: rowHeight
7420
+ },
7421
+ index
7422
+ )) });
7423
+ var TableLoading_default = TableLoading;
7313
7424
 
7314
- // src/components/TableDesktopRows/TableDesktopRows.tsx
7315
- import { jsx as jsx115 } from "react/jsx-runtime";
7316
- var descendingComparator2 = (a, b, orderBy) => {
7317
- const objA = a[orderBy];
7318
- const objB = b[orderBy];
7319
- const valA = typeof objA === "object" ? objA?.name : objA;
7320
- const valB = typeof objB === "object" ? objB?.name : objB;
7321
- if (!valA && !valB) {
7322
- return 0;
7323
- }
7324
- if (valA && !valB) {
7325
- return -1;
7326
- }
7327
- if (!valA && valB) {
7328
- return 1;
7329
- }
7330
- if (valA > valB) {
7425
+ // src/components/Table/helpers.tsx
7426
+ function stableSort2(array, cmp) {
7427
+ const stabilizedThis = array.map((el, index) => [el, index]);
7428
+ stabilizedThis.sort((a, b) => {
7429
+ const order = cmp(a[0], b[0]);
7430
+ if (order !== 0) {
7431
+ return order;
7432
+ }
7433
+ return a[1] - b[1];
7434
+ });
7435
+ return stabilizedThis.map((el) => el[0]);
7436
+ }
7437
+ function descendingComparator2(a, b, orderBy) {
7438
+ if (b[orderBy] < a[orderBy]) {
7331
7439
  return -1;
7332
7440
  }
7333
- if (valA < valB) {
7441
+ if (b[orderBy] > a[orderBy]) {
7334
7442
  return 1;
7335
7443
  }
7336
7444
  return 0;
7337
- };
7338
- var stableSort2 = (array, cmp) => array.map((el, index) => ({ el, index })).sort((a, b) => {
7339
- const order = cmp(a.el, b.el);
7340
- return order !== 0 ? order : a.index - b.index;
7341
- }).map((el) => el.el);
7342
- var getComparator = (order, orderBy) => order === "desc" ? (a, b) => descendingComparator2(a, b, orderBy) : (a, b) => -descendingComparator2(a, b, orderBy);
7343
- var TableDesktopRows = ({
7344
- data,
7345
- RenderItem,
7346
- visibleHeadCells,
7347
- keyField,
7348
- order,
7349
- orderBy,
7350
- rowsPerPage,
7351
- isLoading,
7352
- disableInternalSort,
7353
- enableCheckboxSelection,
7354
- enableEditMode,
7355
- selectedRows,
7356
- handleRowCheckboxChange,
7357
- rowHeight,
7358
- deleteItem
7359
- }) => {
7360
- const sortedData = disableInternalSort ? data : stableSort2(data, getComparator(order, orderBy));
7361
- if (isLoading) {
7362
- return /* @__PURE__ */ jsx115(
7363
- TableDesktopLoadingState,
7364
- {
7365
- numRows: data.length,
7366
- rowsPerPage,
7367
- numColumns: visibleHeadCells.length + (enableCheckboxSelection ? 1 : 0),
7368
- rowHeight
7369
- }
7445
+ }
7446
+ function getSorting(order, orderBy) {
7447
+ return order === "desc" ? (a, b) => descendingComparator2(a, b, orderBy) : (a, b) => -descendingComparator2(a, b, orderBy);
7448
+ }
7449
+ function calculateRowsPerPage(rowHeight) {
7450
+ const appContainerDom = document.getElementById("mainContainer");
7451
+ const headerDom = document.getElementById("aboveTableHeader");
7452
+ if (appContainerDom && headerDom) {
7453
+ return Math.floor(
7454
+ (appContainerDom.clientHeight - headerDom.clientHeight - 24) / rowHeight - 2
7370
7455
  );
7371
7456
  }
7372
- return sortedData.map((row, index) => {
7373
- const isItemSelected = selectedRows.has(row[keyField]);
7374
- return /* @__PURE__ */ jsx115(
7375
- RenderItem,
7376
- {
7377
- ...{
7378
- ...row,
7379
- index,
7380
- deleteItem,
7381
- isItemSelected,
7382
- enableEditMode,
7383
- enableCheckboxSelection,
7384
- rowHeight,
7385
- rowId: row[keyField],
7386
- handleRowCheckboxChange,
7387
- visibleHeadCells
7388
- }
7389
- },
7390
- row[keyField] ?? index
7391
- );
7392
- });
7393
- };
7457
+ return 1;
7458
+ }
7394
7459
 
7395
- // src/components/TableDesktopRowSelectionBar/TableDesktopRowSelectionBar.tsx
7396
- import { Box as Box33, Button as Button14, Typography as Typography28 } from "@mui/material";
7397
- import { jsx as jsx116, jsxs as jsxs78 } from "react/jsx-runtime";
7398
- var TableDesktopRowSelectionBar = ({
7399
- isEveryRowInPageSelected,
7400
- isRowsFromAllPagesSelected,
7401
- numSelectedRows,
7402
- totalRowCount,
7403
- onSelectRowsFromAllPagesClick,
7404
- onClearSelectionClick
7405
- }) => {
7406
- const isAnyRowSelected = numSelectedRows > 0;
7407
- const getSelectedRowsText = () => {
7408
- if (isRowsFromAllPagesSelected) {
7409
- return `All ${totalRowCount} rows from all pages are selected based on your filters.`;
7410
- }
7411
- if (isEveryRowInPageSelected) {
7412
- return `All ${numSelectedRows} rows on this page are selected.`;
7413
- }
7414
- return `${numSelectedRows} row${numSelectedRows > 1 ? "s" : ""} selected.`;
7415
- };
7416
- return isAnyRowSelected ? /* @__PURE__ */ jsxs78(
7417
- Box33,
7418
- {
7419
- sx: {
7420
- p: 1,
7421
- height: 40,
7422
- gap: 2,
7423
- display: "flex",
7424
- justifyContent: "center",
7425
- alignItems: "center",
7426
- backgroundColor: colors.neutral150
7427
- },
7428
- children: [
7429
- /* @__PURE__ */ jsx116(Typography28, { children: getSelectedRowsText() }),
7430
- !isRowsFromAllPagesSelected ? /* @__PURE__ */ jsxs78(Button14, { onClick: onSelectRowsFromAllPagesClick, children: [
7431
- "Select all ",
7432
- totalRowCount,
7433
- " rows from all pages based on your filters"
7434
- ] }) : null,
7435
- /* @__PURE__ */ jsx116(Button14, { onClick: onClearSelectionClick, children: "Clear Selection" })
7436
- ]
7460
+ // src/components/Table/Table.tsx
7461
+ import { jsx as jsx115, jsxs as jsxs79 } from "react/jsx-runtime";
7462
+ var useStyles49 = makeStyles49()(() => ({
7463
+ root: {
7464
+ height: "calc(100vh - 262px)",
7465
+ overflow: "scroll"
7466
+ },
7467
+ paper: {
7468
+ width: "100%",
7469
+ display: "flex",
7470
+ flexDirection: "column",
7471
+ justifyContent: "space-between"
7472
+ },
7473
+ header: {
7474
+ "& .MuiTableSortLabel-root": {
7475
+ fontWeight: 600,
7476
+ fontSize: ".875rem"
7437
7477
  }
7438
- ) : null;
7439
- };
7440
-
7441
- // src/components/TableEmptyResult/TableEmptyResult.tsx
7442
- import { TableCell as TableCell5, TableRow as TableRow5, Typography as Typography29 } from "@mui/material";
7443
- import { makeStyles as makeStyles48 } from "tss-react/mui";
7444
- import { jsx as jsx117, jsxs as jsxs79 } from "react/jsx-runtime";
7445
- var useStyles48 = makeStyles48()(() => ({
7446
- tableCellIcon: { padding: 24, height: "calc(100vh - 320px)" },
7447
- tableCellDefault: { padding: 24 }
7448
- }));
7449
- var TableEmptyResult = ({
7450
- colSpan,
7451
- showClearFilterButton = false,
7452
- handleClickOnClearFiltersButton = () => {
7478
+ },
7479
+ container: {
7480
+ maxHeight: "calc(100% - 0)"
7453
7481
  }
7454
- }) => {
7455
- const { classes } = useStyles48();
7456
- return showClearFilterButton ? /* @__PURE__ */ jsx117(TableRow5, { children: /* @__PURE__ */ jsxs79(
7457
- TableCell5,
7458
- {
7459
- className: classes.tableCellIcon,
7460
- colSpan,
7461
- align: "center",
7462
- children: [
7463
- /* @__PURE__ */ jsx117(EmptyGlassIcon_default, {}),
7464
- /* @__PURE__ */ jsx117(Typography29, { variant: "h6", children: "No results found." }),
7465
- /* @__PURE__ */ jsx117(Typography29, { variant: "subtitle1", children: "Search without applied filters?" }),
7466
- /* @__PURE__ */ jsx117(
7467
- FilledButton_default,
7468
- {
7469
- copy: "Search",
7470
- variant: "contained",
7471
- color: "primary",
7472
- onClick: handleClickOnClearFiltersButton
7473
- }
7474
- )
7475
- ]
7476
- }
7477
- ) }) : /* @__PURE__ */ jsx117(TableRow5, { children: /* @__PURE__ */ jsx117(
7478
- TableCell5,
7479
- {
7480
- className: classes.tableCellDefault,
7481
- colSpan,
7482
- align: "center",
7483
- children: "Nothing to display"
7484
- }
7485
- ) });
7486
- };
7487
- var TableEmptyResult_default = TableEmptyResult;
7488
-
7489
- // src/components/TableDesktop/TableDesktop.tsx
7490
- import { Fragment as Fragment12, jsx as jsx118, jsxs as jsxs80 } from "react/jsx-runtime";
7491
- var TableDesktop = ({
7482
+ }));
7483
+ var Table2 = ({
7484
+ appliedFilters,
7492
7485
  data,
7486
+ doNotCalculateRows,
7493
7487
  headCells,
7494
- RenderItem,
7495
- appliedFilters,
7496
- headerFilters,
7497
- children,
7498
- height,
7499
- rowHeight = 56,
7500
- totalDataCount,
7501
7488
  isLoading,
7502
- rowsPerPage = 50,
7503
- enableEditMode = false,
7504
- enableCheckboxSelection = false,
7505
- disableInternalSort = false,
7506
- updateSort,
7507
- showClearFilterButton,
7508
- handleClickOnClearFiltersButton,
7509
- deleteItem,
7510
- keyField = "id",
7511
- tableLayout = "auto",
7512
- onApplyFilters,
7513
- shouldShowCheckOnFilter,
7514
- components,
7515
- componentsProps
7489
+ onRowClick,
7490
+ page = 0,
7491
+ RenderItem = null,
7492
+ rowsPerPage: defaultRowsPerPage = 10,
7493
+ serverRendered,
7494
+ updateSort
7516
7495
  }) => {
7517
7496
  const [order, setOrder] = useState17(appliedFilters?.sortDir || "desc");
7518
7497
  const [orderBy, setOrderBy] = useState17(
7519
7498
  appliedFilters?.sortField || "delivery_date"
7520
7499
  );
7521
- const [selectedRows, setSelectedRows] = useState17(/* @__PURE__ */ new Set());
7522
- const [isRowsFromAllPagesSelected, setIsRowsFromAllPagesSelected] = useState17(false);
7523
- const { toolbar: Toolbar2 } = components ?? {};
7524
- const { toolbarProps, footerProps } = componentsProps ?? {};
7525
- const numRows = useMemo3(
7526
- () => data.length,
7527
- [data.length]
7528
- );
7529
- const emptyRows = useMemo3(
7530
- () => rowsPerPage - numRows,
7531
- [rowsPerPage, numRows]
7532
- );
7533
- const isEveryRowInPageSelected = useMemo3(
7534
- () => numRows > 0 && selectedRows.size === numRows,
7535
- [selectedRows, numRows]
7536
- );
7537
- const visibleHeadCells = useMemo3(
7538
- () => headCells.filter((headCell) => headCell?.enabled ?? true),
7539
- [headCells]
7540
- );
7500
+ const [rowsPerPage, setRowsPerPage] = useState17(defaultRowsPerPage);
7501
+ const { classes } = useStyles49();
7502
+ const rowHeight = 56;
7503
+ const emptyRows = rowsPerPage - Math.min(rowsPerPage, data.length - page * rowsPerPage);
7541
7504
  const handleRequestSort = (event, property) => {
7542
7505
  const isAsc = orderBy === property && order === "asc";
7543
7506
  const orderDir = isAsc ? "desc" : "asc";
@@ -7547,254 +7510,159 @@ var TableDesktop = ({
7547
7510
  updateSort(property, orderDir);
7548
7511
  }
7549
7512
  };
7550
- const selectAllRowsInPage = () => {
7551
- const allRowsIds = new Set(data.map((n) => n[keyField]));
7552
- ;
7553
- setSelectedRows(allRowsIds);
7554
- };
7555
- const resetSelectedRows = () => {
7556
- setSelectedRows(/* @__PURE__ */ new Set());
7557
- setIsRowsFromAllPagesSelected(false);
7558
- };
7559
- const handleSelectAllClick = (event) => {
7560
- if (event.target.checked) {
7561
- selectAllRowsInPage();
7513
+ useLayoutEffect(() => {
7514
+ if (!doNotCalculateRows) {
7562
7515
  return;
7563
7516
  }
7564
- resetSelectedRows();
7517
+ function updateRowsPerPage() {
7518
+ const newRowsPerPage = calculateRowsPerPage(rowHeight);
7519
+ setRowsPerPage(newRowsPerPage);
7520
+ }
7521
+ updateRowsPerPage();
7522
+ const debounced = (0, import_debounce.default)(updateRowsPerPage, 150);
7523
+ window.addEventListener("resize", debounced);
7524
+ return () => {
7525
+ window.removeEventListener("resize", debounced);
7526
+ };
7527
+ }, [doNotCalculateRows]);
7528
+ const createSortHandler = (property) => (event) => {
7529
+ handleRequestSort(event, property);
7565
7530
  };
7566
- const handleRowCheckboxChange = (event, rowId) => {
7567
- event.stopPropagation();
7568
- setSelectedRows((prev) => {
7569
- const newSelected = new Set(prev);
7570
- if (newSelected.has(rowId)) {
7571
- newSelected.delete(rowId);
7572
- } else {
7573
- newSelected.add(rowId);
7574
- }
7575
- if (newSelected.size < numRows) {
7576
- setIsRowsFromAllPagesSelected(false);
7531
+ const getTableRows = () => {
7532
+ const index = page;
7533
+ const rows = serverRendered ? data : stableSort2(data, getSorting(order, orderBy)).slice(
7534
+ index * rowsPerPage,
7535
+ index * rowsPerPage + rowsPerPage
7536
+ );
7537
+ const rowsComponents = rows.map((row) => {
7538
+ if (RenderItem) {
7539
+ return /* @__PURE__ */ jsx115(RenderItem, { ...row }, row.id);
7577
7540
  }
7578
- return newSelected;
7541
+ return /* @__PURE__ */ jsx115(TableRow5, { hover: true, onClick: () => onRowClick?.(row), children: headCells?.map((column) => /* @__PURE__ */ jsx115(TableCell5, { children: row[column.id] }, column.id)) }, row.id);
7579
7542
  });
7580
- };
7581
- const handleSelectRowsFromAllPagesClick = () => {
7582
- setIsRowsFromAllPagesSelected(true);
7583
- selectAllRowsInPage();
7584
- };
7585
- const handleClearSelectionClick = () => {
7586
- resetSelectedRows();
7587
- };
7588
- const handleApplyFilters = (updatedFilters, shouldSave) => {
7589
- resetSelectedRows();
7590
- onApplyFilters?.(updatedFilters, shouldSave);
7591
- };
7592
- const handlePageChange = (event, page) => {
7593
- resetSelectedRows();
7594
- footerProps?.onPageChange?.(event, page);
7595
- };
7596
- useEffect11(() => {
7597
- if (!enableCheckboxSelection) {
7598
- resetSelectedRows();
7599
- }
7600
- }, [enableCheckboxSelection]);
7601
- useEffect11(() => {
7602
- if (isEveryRowInPageSelected || isRowsFromAllPagesSelected) {
7603
- const rowsIdsSet = new Set(data.map((obj) => obj[keyField]));
7604
- setSelectedRows(
7605
- (prev) => new Set([...prev].filter((value) => rowsIdsSet.has(value)))
7543
+ if (emptyRows > 0 && rowsPerPage > emptyRows) {
7544
+ rowsComponents.push(
7545
+ /* @__PURE__ */ jsx115(TableRow5, { style: { height: rowHeight * emptyRows }, children: /* @__PURE__ */ jsx115(TableCell5, { colSpan: 8 }) }, uuidv4())
7606
7546
  );
7607
7547
  }
7608
- }, [data, setSelectedRows, isEveryRowInPageSelected, isRowsFromAllPagesSelected]);
7609
- return /* @__PURE__ */ jsx118(
7610
- Box34,
7611
- {
7612
- sx: {
7613
- height,
7614
- display: "flex",
7615
- justifyContent: "space-between",
7616
- justifyItems: "stretch"
7548
+ return rowsComponents;
7549
+ };
7550
+ return /* @__PURE__ */ jsx115(Paper11, { className: classes.root, children: /* @__PURE__ */ jsx115(Box31, { className: classes.paper, children: isLoading ? /* @__PURE__ */ jsx115(TableLoading_default, { rowHeight, rowsPerPage }) : /* @__PURE__ */ jsx115(TableContainer2, { className: classes.container, children: /* @__PURE__ */ jsxs79(MUITable, { size: "medium", stickyHeader: true, children: [
7551
+ /* @__PURE__ */ jsx115(TableHead2, { className: classes.header, children: /* @__PURE__ */ jsx115(TableRow5, { children: headCells?.map((headCell) => /* @__PURE__ */ jsx115(
7552
+ TableCell5,
7553
+ {
7554
+ align: "left",
7555
+ sortDirection: orderBy === headCell.id ? order : void 0,
7556
+ children: /* @__PURE__ */ jsx115(
7557
+ TableSortLabel2,
7558
+ {
7559
+ active: orderBy === headCell.id,
7560
+ direction: orderBy === headCell.id ? order : "asc",
7561
+ onClick: createSortHandler(headCell.id),
7562
+ children: headCell.label
7563
+ }
7564
+ )
7617
7565
  },
7618
- children: /* @__PURE__ */ jsxs80(
7619
- Paper11,
7620
- {
7621
- sx: {
7622
- width: "100%",
7623
- display: "flex",
7624
- flexDirection: "column",
7625
- justifyContent: "space-between"
7626
- },
7627
- children: [
7628
- Toolbar2 ? /* @__PURE__ */ jsx118(
7629
- Toolbar2,
7630
- {
7631
- selectedRows: [...selectedRows],
7632
- isRowsInAllPagesSelected: isRowsFromAllPagesSelected,
7633
- ...toolbarProps
7634
- }
7635
- ) : null,
7636
- /* @__PURE__ */ jsx118(
7637
- TableDesktopRowSelectionBar,
7638
- {
7639
- isEveryRowInPageSelected,
7640
- isRowsFromAllPagesSelected,
7641
- numSelectedRows: selectedRows.size,
7642
- totalRowCount: totalDataCount ?? 0,
7643
- onSelectRowsFromAllPagesClick: handleSelectRowsFromAllPagesClick,
7644
- onClearSelectionClick: handleClearSelectionClick
7645
- }
7646
- ),
7647
- /* @__PURE__ */ jsx118(
7648
- TableContainer2,
7649
- {
7650
- sx: {
7651
- flexGrow: 1,
7652
- minHeight: 0,
7653
- maxHeight: "100%",
7654
- "&::-webkit-scrollbar": {
7655
- width: "8px",
7656
- height: "8px"
7657
- },
7658
- "&::-webkit-scrollbar-track": {
7659
- backgroundColor: (theme) => theme.palette.grey[100]
7660
- },
7661
- "&::-webkit-scrollbar-thumb": {
7662
- backgroundColor: (theme) => theme.palette.grey[400],
7663
- borderRadius: "10px"
7664
- },
7665
- "&::-webkit-scrollbar-thumb:hover": {
7666
- backgroundColor: (theme) => theme.palette.grey[500]
7667
- }
7668
- },
7669
- children: /* @__PURE__ */ jsx118(
7670
- Table2,
7671
- {
7672
- stickyHeader: true,
7673
- "aria-label": "sticky-table",
7674
- sx: { tableLayout },
7675
- children: visibleHeadCells.length === 0 ? /* @__PURE__ */ jsx118(TableDesktopNoColumnsMessage, {}) : /* @__PURE__ */ jsxs80(Fragment12, { children: [
7676
- /* @__PURE__ */ jsx118(
7677
- SmartTableHeader_default,
7678
- {
7679
- headCells: visibleHeadCells,
7680
- order,
7681
- orderBy,
7682
- numSelected: selectedRows.size,
7683
- numRows,
7684
- enableCheckboxSelection,
7685
- headerFilters: headerFilters ?? {},
7686
- onRequestSort: handleRequestSort,
7687
- onSelectAllClick: handleSelectAllClick,
7688
- onApplyFilters: handleApplyFilters,
7689
- shouldShowCheckOnFilter
7690
- }
7691
- ),
7692
- /* @__PURE__ */ jsx118(TableBody3, { children: rowsPerPage !== emptyRows ? /* @__PURE__ */ jsx118(
7693
- TableDesktopRows,
7694
- {
7695
- data,
7696
- RenderItem,
7697
- visibleHeadCells,
7698
- keyField,
7699
- order,
7700
- orderBy,
7701
- rowsPerPage,
7702
- isLoading,
7703
- disableInternalSort,
7704
- enableCheckboxSelection,
7705
- enableEditMode,
7706
- selectedRows,
7707
- handleRowCheckboxChange,
7708
- rowHeight,
7709
- deleteItem
7710
- }
7711
- ) : /* @__PURE__ */ jsx118(
7712
- TableEmptyResult_default,
7713
- {
7714
- colSpan: enableCheckboxSelection ? visibleHeadCells.length + 1 : visibleHeadCells.length,
7715
- showClearFilterButton,
7716
- handleClickOnClearFiltersButton
7717
- }
7718
- ) })
7719
- ] })
7720
- }
7721
- )
7722
- }
7723
- ),
7724
- children,
7725
- footerProps ? /* @__PURE__ */ jsx118(TableDesktopFooter, { ...footerProps, onPageChange: handlePageChange }) : null
7726
- ]
7727
- }
7728
- )
7729
- }
7730
- );
7566
+ headCell.id
7567
+ )) }) }),
7568
+ /* @__PURE__ */ jsxs79(TableBody3, { children: [
7569
+ getTableRows(),
7570
+ rowsPerPage === emptyRows && /* @__PURE__ */ jsx115(TableRow5, { style: { height: rowHeight * emptyRows }, children: /* @__PURE__ */ jsx115(TableCell5, { colSpan: 8, align: "center", children: "Nothing to display" }) })
7571
+ ] })
7572
+ ] }) }) }) });
7731
7573
  };
7574
+ var Table_default = Table2;
7732
7575
 
7733
- // src/components/TableDesktopEditableComponent/TableDesktopEditableComponent.tsx
7734
- import { Checkbox as Checkbox6, FormControlLabel as FormControlLabel4 } from "@mui/material";
7735
-
7736
- // src/components/TableDesktopEditableComponent/TableDesktopNumericField.tsx
7737
- import { useState as useState18 } from "react";
7738
- import { TextField as TextField8 } from "@mui/material";
7739
- import { jsx as jsx119 } from "react/jsx-runtime";
7740
- var TableDesktopNumericField = ({
7741
- rowId,
7742
- initialValue,
7743
- inputLabel,
7744
- disabled,
7745
- field,
7746
- variant = "standard",
7747
- size,
7748
- onUpdateEditableCell
7576
+ // src/components/TableDesktopFooter/TableDesktopFooter.tsx
7577
+ import Refresh3 from "@mui/icons-material/Refresh";
7578
+ import { Box as Box32, Button as Button14, MenuItem as MenuItem4, Pagination as Pagination2, Select as Select4, Stack, Typography as Typography28 } from "@mui/material";
7579
+ import { jsx as jsx116, jsxs as jsxs80 } from "react/jsx-runtime";
7580
+ var TableDesktopFooter = ({
7581
+ numPages,
7582
+ page,
7583
+ pageSize,
7584
+ pageSizeOptions,
7585
+ handlePageChange,
7586
+ handlePageSizeChange,
7587
+ refetch,
7588
+ isFetching
7749
7589
  }) => {
7750
- const [input, setInput] = useState18(initialValue);
7751
- const commitValue = (value) => {
7752
- if (!onUpdateEditableCell) {
7753
- return;
7754
- }
7755
- onUpdateEditableCell(rowId ?? 0, field, value, value);
7756
- };
7757
- const handleKeyDown = (e) => {
7758
- if (e.key === "Enter") {
7759
- e.preventDefault();
7760
- commitValue(input);
7761
- }
7762
- };
7763
- return /* @__PURE__ */ jsx119(
7764
- TextField8,
7590
+ return /* @__PURE__ */ jsxs80(
7591
+ Box32,
7765
7592
  {
7766
- fullWidth: true,
7767
- variant,
7768
- size,
7769
- value: input,
7770
- disabled,
7771
- label: inputLabel,
7772
- onKeyDown: handleKeyDown,
7773
- onChange: (e) => {
7774
- e.target.value = e.target.value.replace(/\D/g, "");
7775
- setInput(e.target.value);
7776
- },
7777
- onBlur: ({ target: { value } }) => {
7778
- commitValue(value);
7779
- },
7780
- slotProps: {
7781
- input: {
7782
- inputMode: "numeric"
7783
- }
7784
- }
7593
+ py: 1,
7594
+ gap: 2,
7595
+ display: "flex",
7596
+ justifyContent: "space-between",
7597
+ alignItems: "center",
7598
+ borderTop: `1px solid ${colors.neutral300}`,
7599
+ bgcolor: (theme) => theme.palette.background.default,
7600
+ children: [
7601
+ /* @__PURE__ */ jsxs80(
7602
+ Button14,
7603
+ {
7604
+ disableRipple: true,
7605
+ variant: "outlined",
7606
+ onClick: () => refetch(),
7607
+ disabled: isFetching,
7608
+ sx: {
7609
+ ml: 1,
7610
+ gap: 1,
7611
+ borderRadius: 25,
7612
+ color: colors.neutral800,
7613
+ borderColor: colors.neutral600
7614
+ },
7615
+ children: [
7616
+ /* @__PURE__ */ jsx116(
7617
+ Refresh3,
7618
+ {
7619
+ fontSize: "small",
7620
+ color: isFetching ? "disabled" : "primary"
7621
+ }
7622
+ ),
7623
+ "REFRESH"
7624
+ ]
7625
+ }
7626
+ ),
7627
+ /* @__PURE__ */ jsxs80(Box32, { display: "flex", children: [
7628
+ /* @__PURE__ */ jsxs80(Stack, { direction: "row", spacing: 2, alignItems: "center", children: [
7629
+ /* @__PURE__ */ jsx116(Typography28, { children: "Rows per page:" }),
7630
+ /* @__PURE__ */ jsx116(
7631
+ Select4,
7632
+ {
7633
+ value: pageSize,
7634
+ onChange: handlePageSizeChange,
7635
+ size: "small",
7636
+ variant: "standard",
7637
+ children: pageSizeOptions.map((size) => /* @__PURE__ */ jsx116(MenuItem4, { value: size, children: size }, size))
7638
+ }
7639
+ )
7640
+ ] }),
7641
+ /* @__PURE__ */ jsx116(
7642
+ Pagination2,
7643
+ {
7644
+ color: "standard",
7645
+ count: numPages,
7646
+ page,
7647
+ onChange: handlePageChange
7648
+ }
7649
+ )
7650
+ ] })
7651
+ ]
7785
7652
  }
7786
7653
  );
7787
7654
  };
7788
7655
 
7789
- // src/components/TableDesktopEditableComponent/TableDesktopSmartSelect.tsx
7790
- import { useState as useState19, memo as memo22, useEffect as useEffect12 } from "react";
7791
- import { jsx as jsx120 } from "react/jsx-runtime";
7792
- var resolveOptionType2 = (option, fieldName) => {
7793
- if (!option || typeof option !== "object") {
7794
- return option;
7795
- }
7796
- return option[fieldName] || "";
7797
- };
7656
+ // src/components/TableDesktopRowCell/TableDesktopRowCell.tsx
7657
+ import { useEffect as useEffect13, useRef as useRef5, useState as useState20 } from "react";
7658
+ import CheckIcon2 from "@mui/icons-material/Check";
7659
+ import CloseIcon from "@mui/icons-material/Close";
7660
+ import EditIcon from "@mui/icons-material/Edit";
7661
+ import { Box as Box33, Checkbox as Checkbox6, IconButton as IconButton5, TableCell as TableCell6, TextField as TextField9, Tooltip as Tooltip8 } from "@mui/material";
7662
+
7663
+ // src/components/TableDesktopRowCell/TableDesktopSmartSelect.tsx
7664
+ import { useState as useState18, memo as memo22, useEffect as useEffect12 } from "react";
7665
+ import { jsx as jsx117 } from "react/jsx-runtime";
7798
7666
  var resolveValue = (value) => {
7799
7667
  if (typeof value === "string") {
7800
7668
  return value;
@@ -7805,31 +7673,28 @@ var TableDesktopSmartSelect = memo22(({
7805
7673
  ref,
7806
7674
  initialValue,
7807
7675
  inputLabel,
7808
- field,
7809
7676
  fieldName,
7810
7677
  rowId,
7811
7678
  disabled,
7812
- variant = "standard",
7813
- size,
7814
7679
  filterOptions,
7815
7680
  refetchFilterOptions,
7816
7681
  isFetchingFilterOptions,
7817
7682
  onUpdateEditableCell
7818
7683
  }) => {
7819
- const [value, setValue] = useState19(initialValue);
7820
- const [options, setOptions] = useState19();
7684
+ const [value, setValue] = useState18(initialValue);
7685
+ const [options, setOptions] = useState18();
7821
7686
  const valueId = resolveValue(value);
7822
- const valueLabel = resolveOptionType2(value, fieldName);
7687
+ const valueLabel = resolveOptionType(value, fieldName);
7823
7688
  useEffect12(() => {
7824
7689
  if (filterOptions) {
7825
7690
  const parsedOptions = filterOptions?.map((option) => ({
7826
7691
  value: resolveValue(option),
7827
- label: String(resolveOptionType2(option, fieldName))
7692
+ label: String(resolveOptionType(option, fieldName))
7828
7693
  }));
7829
7694
  setOptions(parsedOptions);
7830
7695
  }
7831
7696
  }, [filterOptions]);
7832
- return /* @__PURE__ */ jsx120(
7697
+ return /* @__PURE__ */ jsx117(
7833
7698
  SmartSelect_default,
7834
7699
  {
7835
7700
  ref,
@@ -7837,50 +7702,39 @@ var TableDesktopSmartSelect = memo22(({
7837
7702
  inputLabel,
7838
7703
  options,
7839
7704
  disabled,
7840
- variant,
7841
- size,
7842
7705
  refetch: refetchFilterOptions,
7843
7706
  isFetching: isFetchingFilterOptions,
7844
7707
  defaultOption: {
7845
7708
  value: valueId ?? "",
7846
7709
  label: String(valueLabel ?? "")
7847
7710
  },
7848
- onChange: ({ value: id, label: name }) => {
7849
- if (!id || !name) {
7850
- return;
7851
- }
7852
- setValue({ id, name });
7853
- if (!onUpdateEditableCell) {
7854
- return;
7855
- }
7856
- onUpdateEditableCell(rowId ?? 0, field, id, name);
7711
+ onChange: ({ value: value2, label }) => {
7712
+ setValue({ id: value2 ?? "", name: label ?? "" });
7713
+ onUpdateEditableCell?.(rowId, value2 ?? "");
7857
7714
  }
7858
7715
  }
7859
7716
  );
7860
7717
  });
7861
7718
 
7862
- // src/components/TableDesktopEditableComponent/TableDesktopTextField.tsx
7863
- import { useMemo as useMemo4, useState as useState20 } from "react";
7864
- import { TextField as TextField9 } from "@mui/material";
7865
- import { jsx as jsx121 } from "react/jsx-runtime";
7719
+ // src/components/TableDesktopRowCell/TableDesktopTextField.tsx
7720
+ import { useMemo as useMemo4, useState as useState19 } from "react";
7721
+ import { TextField as TextField8 } from "@mui/material";
7722
+ import { jsx as jsx118 } from "react/jsx-runtime";
7866
7723
  var TableDesktopTextField = ({
7867
7724
  rowId,
7868
- initialValue,
7725
+ editInitialValue,
7869
7726
  inputLabel,
7870
7727
  disabled,
7871
- field,
7872
- variant = "standard",
7873
- size,
7874
7728
  validateInput,
7875
7729
  onUpdateEditableCell
7876
7730
  }) => {
7877
- const [input, setInput] = useState20(initialValue);
7731
+ const [input, setInput] = useState19(editInitialValue);
7878
7732
  const hasValidationError = useMemo4(() => !validateInput?.(input), [input, validateInput]);
7879
7733
  const commitValue = (value) => {
7880
- if (hasValidationError || !onUpdateEditableCell) {
7734
+ if (hasValidationError) {
7881
7735
  return;
7882
7736
  }
7883
- onUpdateEditableCell(rowId ?? 0, field, value, value);
7737
+ onUpdateEditableCell?.(rowId, value);
7884
7738
  };
7885
7739
  const handleKeyDown = (e) => {
7886
7740
  if (e.key === "Enter") {
@@ -7888,12 +7742,11 @@ var TableDesktopTextField = ({
7888
7742
  commitValue(input);
7889
7743
  }
7890
7744
  };
7891
- return /* @__PURE__ */ jsx121(
7892
- TextField9,
7745
+ return /* @__PURE__ */ jsx118(
7746
+ TextField8,
7893
7747
  {
7894
7748
  fullWidth: true,
7895
- variant,
7896
- size,
7749
+ variant: "standard",
7897
7750
  value: input,
7898
7751
  label: inputLabel,
7899
7752
  error: hasValidationError,
@@ -7909,104 +7762,11 @@ var TableDesktopTextField = ({
7909
7762
  );
7910
7763
  };
7911
7764
 
7912
- // src/components/TableDesktopEditableComponent/TableDesktopEditableComponent.tsx
7913
- import { jsx as jsx122 } from "react/jsx-runtime";
7914
- var TableDesktopEditableComponent = ({
7915
- editInitialValue,
7916
- rowId,
7917
- field,
7918
- fieldName,
7919
- disabled,
7920
- showCheckboxLabel = false,
7921
- variant = "standard",
7922
- size,
7923
- inputLabel,
7924
- editableCellType,
7925
- filterOptions,
7926
- refetchFilterOptions,
7927
- isFetchingFilterOptions,
7928
- validateInput,
7929
- onUpdateEditableCell
7930
- }) => {
7931
- const editableComponents = {
7932
- "select": /* @__PURE__ */ jsx122(
7933
- TableDesktopSmartSelect,
7934
- {
7935
- rowId,
7936
- field,
7937
- fieldName,
7938
- disabled,
7939
- variant,
7940
- size,
7941
- initialValue: editInitialValue,
7942
- inputLabel,
7943
- filterOptions,
7944
- refetchFilterOptions,
7945
- isFetchingFilterOptions,
7946
- onUpdateEditableCell
7947
- }
7948
- ),
7949
- "checkbox": /* @__PURE__ */ jsx122(
7950
- FormControlLabel4,
7951
- {
7952
- label: showCheckboxLabel ? inputLabel : "",
7953
- control: /* @__PURE__ */ jsx122(
7954
- Checkbox6,
7955
- {
7956
- disableRipple: true,
7957
- disabled,
7958
- defaultChecked: editInitialValue,
7959
- onChange: ({ target: { checked } }) => {
7960
- if (!onUpdateEditableCell) {
7961
- return;
7962
- }
7963
- onUpdateEditableCell(rowId ?? 0, field, checked, checked);
7964
- }
7965
- }
7966
- )
7967
- }
7968
- ),
7969
- "text": /* @__PURE__ */ jsx122(
7970
- TableDesktopTextField,
7971
- {
7972
- rowId,
7973
- disabled,
7974
- variant,
7975
- size,
7976
- field,
7977
- initialValue: editInitialValue,
7978
- inputLabel: inputLabel ?? "",
7979
- validateInput,
7980
- onUpdateEditableCell
7981
- }
7982
- ),
7983
- "numeric": /* @__PURE__ */ jsx122(
7984
- TableDesktopNumericField,
7985
- {
7986
- rowId,
7987
- disabled,
7988
- variant,
7989
- size,
7990
- field,
7991
- initialValue: editInitialValue,
7992
- inputLabel: inputLabel ?? "",
7993
- onUpdateEditableCell
7994
- }
7995
- )
7996
- };
7997
- return editableComponents[editableCellType];
7998
- };
7999
-
8000
- // src/components/TableDesktopCell/TableDesktopCell.tsx
8001
- import { useEffect as useEffect13, useRef as useRef5, useState as useState21 } from "react";
8002
- import CheckIcon2 from "@mui/icons-material/Check";
8003
- import CloseIcon from "@mui/icons-material/Close";
8004
- import EditIcon from "@mui/icons-material/Edit";
8005
- import { Box as Box35, IconButton as IconButton4, TableCell as TableCell6, Tooltip as Tooltip8 } from "@mui/material";
8006
- import { jsx as jsx123, jsxs as jsxs81 } from "react/jsx-runtime";
7765
+ // src/components/TableDesktopRowCell/TableDesktopRowCell.tsx
7766
+ import { jsx as jsx119, jsxs as jsxs81 } from "react/jsx-runtime";
8007
7767
  var getReadOnlyBooleanIcon = (value) => {
8008
7768
  if (value) {
8009
- return /* @__PURE__ */ jsx123(CheckIcon2, { sx: { fontSize: 16 } });
7769
+ return /* @__PURE__ */ jsx119(CheckIcon2, { sx: { fontSize: 16 } });
8010
7770
  }
8011
7771
  return "-";
8012
7772
  };
@@ -8016,17 +7776,12 @@ var renderReadOnlyValue = (value) => {
8016
7776
  }
8017
7777
  return value;
8018
7778
  };
8019
- var getCellBackgroundColor = (isCellInEditMode) => ({
8020
- background: isCellInEditMode ? colors.lightBlueBackground : colors.neutral100
8021
- });
8022
- var TableDesktopCell = ({
7779
+ var TableDesktopRowCell = ({
8023
7780
  inputLabel,
8024
7781
  editInitialValue,
8025
7782
  rowId,
8026
- field,
8027
7783
  fieldName,
8028
7784
  width,
8029
- enableEditMode,
8030
7785
  disabled,
8031
7786
  readOnlyValue,
8032
7787
  editableCellType,
@@ -8038,9 +7793,9 @@ var TableDesktopCell = ({
8038
7793
  onCellClick
8039
7794
  }) => {
8040
7795
  const cellRef = useRef5(null);
8041
- const [isOverflowed, setIsOverflowed] = useState21(false);
8042
- const [isCellHovered, setIsCellHovered] = useState21(false);
8043
- const [isCellInEditMode, setIsCellInEditMode] = useState21(false);
7796
+ const [isOverflowed, setIsOverflowed] = useState20(false);
7797
+ const [isCellHovered, setIsCellHovered] = useState20(false);
7798
+ const [isEditMode, setIsEditMode] = useState20(false);
8044
7799
  useEffect13(() => {
8045
7800
  const ref = cellRef.current;
8046
7801
  if (ref) {
@@ -8050,39 +7805,99 @@ var TableDesktopCell = ({
8050
7805
  useEffect13(() => {
8051
7806
  const handleKeyDown = (e) => {
8052
7807
  if (e.key === "Escape") {
8053
- setIsCellInEditMode(false);
7808
+ setIsEditMode(false);
8054
7809
  }
8055
7810
  };
8056
- if (isCellInEditMode) {
7811
+ if (isEditMode) {
8057
7812
  window.addEventListener("keydown", handleKeyDown);
8058
7813
  }
8059
7814
  return () => {
8060
7815
  window.removeEventListener("keydown", handleKeyDown);
8061
7816
  };
8062
- }, [isCellInEditMode]);
7817
+ }, [isEditMode]);
7818
+ const editableComponents = {
7819
+ "select": /* @__PURE__ */ jsx119(
7820
+ TableDesktopSmartSelect,
7821
+ {
7822
+ rowId,
7823
+ fieldName,
7824
+ disabled,
7825
+ initialValue: editInitialValue,
7826
+ inputLabel: inputLabel ?? "",
7827
+ filterOptions,
7828
+ refetchFilterOptions,
7829
+ isFetchingFilterOptions,
7830
+ onUpdateEditableCell
7831
+ }
7832
+ ),
7833
+ "checkbox": /* @__PURE__ */ jsx119(
7834
+ Checkbox6,
7835
+ {
7836
+ disableRipple: true,
7837
+ disabled,
7838
+ defaultChecked: editInitialValue,
7839
+ onChange: ({ target: { checked } }) => {
7840
+ onUpdateEditableCell?.(rowId, checked);
7841
+ }
7842
+ }
7843
+ ),
7844
+ "text": /* @__PURE__ */ jsx119(
7845
+ TableDesktopTextField,
7846
+ {
7847
+ rowId,
7848
+ disabled,
7849
+ editInitialValue,
7850
+ inputLabel: inputLabel ?? "",
7851
+ validateInput,
7852
+ onUpdateEditableCell
7853
+ }
7854
+ ),
7855
+ "numeric": /* @__PURE__ */ jsx119(
7856
+ TextField9,
7857
+ {
7858
+ fullWidth: true,
7859
+ variant: "standard",
7860
+ disabled,
7861
+ defaultValue: editInitialValue,
7862
+ label: inputLabel,
7863
+ onChange: (e) => {
7864
+ e.target.value = e.target.value.replace(/\D/g, "");
7865
+ },
7866
+ onBlur: ({ target: { value } }) => {
7867
+ onUpdateEditableCell?.(rowId, value);
7868
+ },
7869
+ slotProps: {
7870
+ input: {
7871
+ inputMode: "numeric"
7872
+ }
7873
+ }
7874
+ }
7875
+ )
7876
+ };
8063
7877
  const handleEditClick = (e) => {
8064
7878
  e.stopPropagation();
8065
- setIsCellInEditMode((prev) => !prev);
7879
+ setIsEditMode((prev) => !prev);
8066
7880
  };
8067
- const isCellEditable = !!enableEditMode && !!editableCellType && !disabled;
8068
- return /* @__PURE__ */ jsx123(Tooltip8, { title: isOverflowed ? String(readOnlyValue) : "", arrow: true, children: /* @__PURE__ */ jsx123(
7881
+ return /* @__PURE__ */ jsx119(Tooltip8, { title: isOverflowed ? String(readOnlyValue) : "", arrow: true, children: /* @__PURE__ */ jsx119(
8069
7882
  TableCell6,
8070
7883
  {
8071
7884
  align: "left",
8072
- onMouseEnter: () => isCellEditable && setIsCellHovered(true),
8073
- onMouseLeave: () => isCellEditable && setIsCellHovered(false),
8074
- onClick: (event) => !disabled && onCellClick?.(event, isCellInEditMode),
7885
+ onMouseEnter: () => editableCellType && !disabled && setIsCellHovered(true),
7886
+ onMouseLeave: () => editableCellType && !disabled && setIsCellHovered(false),
7887
+ onClick: (event) => !disabled && onCellClick?.(event, isEditMode),
8075
7888
  sx: {
8076
7889
  padding: 1,
8077
7890
  width: width ?? "auto",
8078
7891
  position: "relative",
8079
- cursor: disabled || !enableEditMode ? "default" : "pointer",
7892
+ cursor: disabled ? "default" : "pointer",
8080
7893
  opacity: disabled ? 0.2 : 1,
8081
- ":hover": isCellEditable ? getCellBackgroundColor(isCellInEditMode) : void 0,
8082
- background: enableEditMode && isCellInEditMode ? colors.lightBlueBackground : void 0
7894
+ ":hover": editableCellType && {
7895
+ background: isEditMode ? colors.lightBlueBackground : colors.neutral100
7896
+ },
7897
+ background: isEditMode ? colors.lightBlueBackground : (theme) => theme.palette.background.default
8083
7898
  },
8084
7899
  children: /* @__PURE__ */ jsxs81(
8085
- Box35,
7900
+ Box33,
8086
7901
  {
8087
7902
  p: 1,
8088
7903
  ref: cellRef,
@@ -8090,8 +7905,8 @@ var TableDesktopCell = ({
8090
7905
  textOverflow: "ellipsis",
8091
7906
  whiteSpace: "nowrap",
8092
7907
  children: [
8093
- enableEditMode && isCellHovered ? /* @__PURE__ */ jsx123(Tooltip8, { title: isCellInEditMode ? "" : "Toggle Edit Mode", children: /* @__PURE__ */ jsx123(
8094
- IconButton4,
7908
+ isCellHovered ? /* @__PURE__ */ jsx119(Tooltip8, { title: isEditMode ? "" : "Toggle Edit Mode", children: /* @__PURE__ */ jsx119(
7909
+ IconButton5,
8095
7910
  {
8096
7911
  onClick: handleEditClick,
8097
7912
  sx: {
@@ -8100,31 +7915,15 @@ var TableDesktopCell = ({
8100
7915
  zIndex: 1,
8101
7916
  borderRadius: 0,
8102
7917
  position: "absolute",
8103
- background: isCellInEditMode ? colors.lightBlueBackground : colors.neutral100,
7918
+ background: isEditMode ? colors.lightBlueBackground : colors.neutral100,
8104
7919
  "&:hover": {
8105
- backgroundColor: isCellInEditMode ? colors.lightBlueBackground : colors.neutral150
7920
+ backgroundColor: isEditMode ? colors.lightBlueBackground : colors.neutral150
8106
7921
  }
8107
7922
  },
8108
- children: isCellInEditMode ? /* @__PURE__ */ jsx123(CloseIcon, { fontSize: "small", color: "error" }) : /* @__PURE__ */ jsx123(EditIcon, { fontSize: "small" })
7923
+ children: isEditMode ? /* @__PURE__ */ jsx119(CloseIcon, { fontSize: "small", color: "error" }) : /* @__PURE__ */ jsx119(EditIcon, { fontSize: "small" })
8109
7924
  }
8110
7925
  ) }) : null,
8111
- enableEditMode && isCellInEditMode && editableCellType ? /* @__PURE__ */ jsx123(
8112
- TableDesktopEditableComponent,
8113
- {
8114
- editInitialValue,
8115
- rowId,
8116
- field,
8117
- fieldName,
8118
- disabled,
8119
- inputLabel: inputLabel ?? "",
8120
- editableCellType,
8121
- filterOptions,
8122
- refetchFilterOptions,
8123
- isFetchingFilterOptions,
8124
- validateInput,
8125
- onUpdateEditableCell
8126
- }
8127
- ) : renderReadOnlyValue(readOnlyValue)
7926
+ isEditMode && editableCellType ? editableComponents[editableCellType] : renderReadOnlyValue(readOnlyValue)
8128
7927
  ]
8129
7928
  }
8130
7929
  )
@@ -8133,12 +7932,12 @@ var TableDesktopCell = ({
8133
7932
  };
8134
7933
 
8135
7934
  // src/components/TableHeader/TableHeader.tsx
8136
- import { memo as memo23, useEffect as useEffect14, useState as useState22 } from "react";
7935
+ import { memo as memo23, useEffect as useEffect14, useState as useState21 } from "react";
8137
7936
  import { ImportExport as ImportExportIcon } from "@mui/icons-material";
8138
7937
  import { TableCell as TableCell7, TableHead as TableHead3, TableRow as TableRow6, TableSortLabel as TableSortLabel3 } from "@mui/material";
8139
- import { makeStyles as makeStyles49 } from "tss-react/mui";
8140
- import { jsx as jsx124 } from "react/jsx-runtime";
8141
- var useStyles49 = makeStyles49()(() => ({
7938
+ import { makeStyles as makeStyles50 } from "tss-react/mui";
7939
+ import { jsx as jsx120 } from "react/jsx-runtime";
7940
+ var useStyles50 = makeStyles50()(() => ({
8142
7941
  sortLabel: {
8143
7942
  "& .MuiTableSortLabel-icon": {
8144
7943
  opacity: 1
@@ -8146,8 +7945,8 @@ var useStyles49 = makeStyles49()(() => ({
8146
7945
  }
8147
7946
  }));
8148
7947
  var TableHeader = ({ cells, onSort = null }) => {
8149
- const [sortableCells, setSortableCells] = useState22([]);
8150
- const { classes } = useStyles49();
7948
+ const [sortableCells, setSortableCells] = useState21([]);
7949
+ const { classes } = useStyles50();
8151
7950
  useEffect14(() => {
8152
7951
  setSortableCells(cells);
8153
7952
  }, []);
@@ -8182,7 +7981,7 @@ var TableHeader = ({ cells, onSort = null }) => {
8182
7981
  });
8183
7982
  setSortableCells(sortedCells);
8184
7983
  };
8185
- return /* @__PURE__ */ jsx124(TableHead3, { children: /* @__PURE__ */ jsx124(TableRow6, { children: sortableCells.map((cell, key) => /* @__PURE__ */ jsx124(TableCell7, { children: cell.isSortable ? /* @__PURE__ */ jsx124(
7984
+ return /* @__PURE__ */ jsx120(TableHead3, { children: /* @__PURE__ */ jsx120(TableRow6, { children: sortableCells.map((cell, key) => /* @__PURE__ */ jsx120(TableCell7, { children: cell.isSortable ? /* @__PURE__ */ jsx120(
8186
7985
  TableSortLabel3,
8187
7986
  {
8188
7987
  className: classes.sortLabel,
@@ -8196,10 +7995,10 @@ var TableHeader = ({ cells, onSort = null }) => {
8196
7995
  var TableHeader_default = memo23(TableHeader);
8197
7996
 
8198
7997
  // src/components/TextDivider/TextDivider.tsx
8199
- import { Box as Box36, Typography as Typography30, Divider as Divider10, Button as Button15 } from "@mui/material";
8200
- import { makeStyles as makeStyles50 } from "tss-react/mui";
8201
- import { jsx as jsx125, jsxs as jsxs82 } from "react/jsx-runtime";
8202
- var useStyles50 = makeStyles50()(() => ({
7998
+ import { Box as Box34, Typography as Typography29, Divider as Divider10, Button as Button15 } from "@mui/material";
7999
+ import { makeStyles as makeStyles51 } from "tss-react/mui";
8000
+ import { jsx as jsx121, jsxs as jsxs82 } from "react/jsx-runtime";
8001
+ var useStyles51 = makeStyles51()(() => ({
8203
8002
  icon: {
8204
8003
  fontSize: 20
8205
8004
  },
@@ -8233,21 +8032,21 @@ var TextDivider = ({
8233
8032
  iconPosition = "left",
8234
8033
  titleWeight = "400"
8235
8034
  }) => {
8236
- const { classes } = useStyles50();
8035
+ const { classes } = useStyles51();
8237
8036
  const iconColor = color ?? colors.neutral900;
8238
8037
  return /* @__PURE__ */ jsxs82(
8239
- Box36,
8038
+ Box34,
8240
8039
  {
8241
8040
  display: "flex",
8242
8041
  alignItems: "center",
8243
8042
  justifyContent: "space-between",
8244
8043
  className: classes.container,
8245
8044
  children: [
8246
- /* @__PURE__ */ jsx125(Divider10, { className: classes.leftDivider }),
8247
- /* @__PURE__ */ jsx125(Button15, { onClick, disabled: !onClick, className: classes.button, children: /* @__PURE__ */ jsxs82(Box36, { className: classes.center, children: [
8248
- Icon2 && iconPosition === "left" && /* @__PURE__ */ jsx125(Icon2, { className: classes.icon, style: { color: iconColor } }),
8249
- /* @__PURE__ */ jsx125(
8250
- Typography30,
8045
+ /* @__PURE__ */ jsx121(Divider10, { className: classes.leftDivider }),
8046
+ /* @__PURE__ */ jsx121(Button15, { onClick, disabled: !onClick, className: classes.button, children: /* @__PURE__ */ jsxs82(Box34, { className: classes.center, children: [
8047
+ Icon2 && iconPosition === "left" && /* @__PURE__ */ jsx121(Icon2, { className: classes.icon, style: { color: iconColor } }),
8048
+ /* @__PURE__ */ jsx121(
8049
+ Typography29,
8251
8050
  {
8252
8051
  color: "textSecondary",
8253
8052
  className: classes.title,
@@ -8255,9 +8054,9 @@ var TextDivider = ({
8255
8054
  children: title
8256
8055
  }
8257
8056
  ),
8258
- Icon2 && iconPosition === "right" && /* @__PURE__ */ jsx125(Icon2, { className: classes.icon, style: { color: iconColor } })
8057
+ Icon2 && iconPosition === "right" && /* @__PURE__ */ jsx121(Icon2, { className: classes.icon, style: { color: iconColor } })
8259
8058
  ] }) }),
8260
- /* @__PURE__ */ jsx125(Divider10, { className: classes.rightDivider })
8059
+ /* @__PURE__ */ jsx121(Divider10, { className: classes.rightDivider })
8261
8060
  ]
8262
8061
  }
8263
8062
  );
@@ -8266,11 +8065,11 @@ var TextDivider_default = TextDivider;
8266
8065
 
8267
8066
  // src/components/ThemedDateRangePicker/ThemedDateRangePicker.tsx
8268
8067
  import { DateRangePicker } from "react-dates";
8269
- import { makeStyles as makeStyles51 } from "tss-react/mui";
8068
+ import { makeStyles as makeStyles52 } from "tss-react/mui";
8270
8069
  import "react-dates/initialize";
8271
8070
  import "react-dates/lib/css/_datepicker.css";
8272
- import { jsx as jsx126 } from "react/jsx-runtime";
8273
- var useStyles51 = makeStyles51()((theme) => ({
8071
+ import { jsx as jsx122 } from "react/jsx-runtime";
8072
+ var useStyles52 = makeStyles52()((theme) => ({
8274
8073
  wrapper: {
8275
8074
  "& .DateRangePicker": {
8276
8075
  backgroundColor: theme.palette.mode === "dark" ? theme.palette.grey[900] : colors.neutral100,
@@ -8364,17 +8163,17 @@ var ThemedDateRangePicker = ({
8364
8163
  className,
8365
8164
  ...props
8366
8165
  }) => {
8367
- const { classes, cx } = useStyles51();
8368
- return /* @__PURE__ */ jsx126("div", { className: cx(classes.wrapper, className), children: /* @__PURE__ */ jsx126(DateRangePicker, { ...props }) });
8166
+ const { classes, cx } = useStyles52();
8167
+ return /* @__PURE__ */ jsx122("div", { className: cx(classes.wrapper, className), children: /* @__PURE__ */ jsx122(DateRangePicker, { ...props }) });
8369
8168
  };
8370
8169
  var ThemedDateRangePicker_default = ThemedDateRangePicker;
8371
8170
 
8372
8171
  // src/components/TheToolbar/TheToolbar.tsx
8373
8172
  import { memo as memo24 } from "react";
8374
- import { AppBar, Box as Box37, Toolbar } from "@mui/material";
8375
- import { makeStyles as makeStyles52 } from "tss-react/mui";
8376
- import { jsx as jsx127, jsxs as jsxs83 } from "react/jsx-runtime";
8377
- var useStyles52 = makeStyles52()((theme) => ({
8173
+ import { AppBar, Box as Box35, Toolbar } from "@mui/material";
8174
+ import { makeStyles as makeStyles53 } from "tss-react/mui";
8175
+ import { jsx as jsx123, jsxs as jsxs83 } from "react/jsx-runtime";
8176
+ var useStyles53 = makeStyles53()((theme) => ({
8378
8177
  menuButton: {
8379
8178
  color: theme.palette.primary.contrastText
8380
8179
  },
@@ -8392,10 +8191,10 @@ var TheToolbar = ({
8392
8191
  leftSection,
8393
8192
  rightSection
8394
8193
  }) => {
8395
- const { classes } = useStyles52();
8396
- return /* @__PURE__ */ jsxs83(Box37, { children: [
8397
- /* @__PURE__ */ jsx127(AppBar, { children: /* @__PURE__ */ jsxs83(Toolbar, { className: classes.topBar, children: [
8398
- /* @__PURE__ */ jsx127(
8194
+ const { classes } = useStyles53();
8195
+ return /* @__PURE__ */ jsxs83(Box35, { children: [
8196
+ /* @__PURE__ */ jsx123(AppBar, { children: /* @__PURE__ */ jsxs83(Toolbar, { className: classes.topBar, children: [
8197
+ /* @__PURE__ */ jsx123(
8399
8198
  RoundButton_default,
8400
8199
  {
8401
8200
  className: classes.menuButton,
@@ -8404,7 +8203,7 @@ var TheToolbar = ({
8404
8203
  onClick: handleOpen
8405
8204
  }
8406
8205
  ),
8407
- /* @__PURE__ */ jsx127(
8206
+ /* @__PURE__ */ jsx123(
8408
8207
  CompanyLogo_default,
8409
8208
  {
8410
8209
  size: "small",
@@ -8413,8 +8212,8 @@ var TheToolbar = ({
8413
8212
  imageLogoLightSmall
8414
8213
  }
8415
8214
  ),
8416
- /* @__PURE__ */ jsx127(Box37, { ml: 2, children: leftSection }),
8417
- /* @__PURE__ */ jsx127(Box37, { ml: "auto", children: rightSection })
8215
+ /* @__PURE__ */ jsx123(Box35, { ml: 2, children: leftSection }),
8216
+ /* @__PURE__ */ jsx123(Box35, { ml: "auto", children: rightSection })
8418
8217
  ] }) }),
8419
8218
  LeftDrawer
8420
8219
  ] });
@@ -8423,20 +8222,20 @@ var TheToolbar_default = memo24(TheToolbar);
8423
8222
 
8424
8223
  // src/components/ToastMessage/ToastMessage.tsx
8425
8224
  import { Alert as MuiAlert, Snackbar } from "@mui/material";
8426
- import { jsx as jsx128 } from "react/jsx-runtime";
8225
+ import { jsx as jsx124 } from "react/jsx-runtime";
8427
8226
  var ToastMessage = ({
8428
8227
  toastType,
8429
8228
  toastMessage,
8430
8229
  open,
8431
8230
  onClose
8432
- }) => /* @__PURE__ */ jsx128(
8231
+ }) => /* @__PURE__ */ jsx124(
8433
8232
  Snackbar,
8434
8233
  {
8435
8234
  open,
8436
8235
  autoHideDuration: 1500,
8437
8236
  onClose,
8438
8237
  anchorOrigin: { vertical: "top", horizontal: "right" },
8439
- children: /* @__PURE__ */ jsx128(
8238
+ children: /* @__PURE__ */ jsx124(
8440
8239
  MuiAlert,
8441
8240
  {
8442
8241
  elevation: 6,
@@ -8464,17 +8263,17 @@ var ToastMessage_default = ToastMessage;
8464
8263
 
8465
8264
  // src/components/TwoButtonDialog/TwoButtonDialog.tsx
8466
8265
  import {
8467
- Typography as Typography31,
8266
+ Typography as Typography30,
8468
8267
  Dialog as Dialog5,
8469
8268
  Backdrop,
8470
- Box as Box38,
8269
+ Box as Box36,
8471
8270
  Divider as Divider11,
8472
8271
  Paper as Paper12,
8473
8272
  Fade as Fade2
8474
8273
  } from "@mui/material";
8475
- import { makeStyles as makeStyles53 } from "tss-react/mui";
8476
- import { jsx as jsx129, jsxs as jsxs84 } from "react/jsx-runtime";
8477
- var useStyles53 = makeStyles53()((theme) => ({
8274
+ import { makeStyles as makeStyles54 } from "tss-react/mui";
8275
+ import { jsx as jsx125, jsxs as jsxs84 } from "react/jsx-runtime";
8276
+ var useStyles54 = makeStyles54()((theme) => ({
8478
8277
  paper: {
8479
8278
  padding: theme.spacing(2)
8480
8279
  },
@@ -8502,8 +8301,8 @@ var TwoButtonDialog = ({
8502
8301
  cancelLabel = "CANCEL",
8503
8302
  cancelButton
8504
8303
  }) => {
8505
- const { classes } = useStyles53();
8506
- return /* @__PURE__ */ jsx129(
8304
+ const { classes } = useStyles54();
8305
+ return /* @__PURE__ */ jsx125(
8507
8306
  Dialog5,
8508
8307
  {
8509
8308
  open,
@@ -8513,10 +8312,10 @@ var TwoButtonDialog = ({
8513
8312
  closeAfterTransition: true,
8514
8313
  BackdropComponent: Backdrop,
8515
8314
  BackdropProps: { timeout: 500 },
8516
- children: /* @__PURE__ */ jsx129(Fade2, { in: open, children: /* @__PURE__ */ jsxs84(Paper12, { className: classes.paper, children: [
8517
- /* @__PURE__ */ jsxs84(Box38, { className: classes.mb, children: [
8518
- /* @__PURE__ */ jsx129(Typography31, { variant: "h5", component: "div", children: /* @__PURE__ */ jsx129(
8519
- Box38,
8315
+ children: /* @__PURE__ */ jsx125(Fade2, { in: open, children: /* @__PURE__ */ jsxs84(Paper12, { className: classes.paper, children: [
8316
+ /* @__PURE__ */ jsxs84(Box36, { className: classes.mb, children: [
8317
+ /* @__PURE__ */ jsx125(Typography30, { variant: "h5", component: "div", children: /* @__PURE__ */ jsx125(
8318
+ Box36,
8520
8319
  {
8521
8320
  sx: {
8522
8321
  fontWeight: 600
@@ -8525,22 +8324,22 @@ var TwoButtonDialog = ({
8525
8324
  }
8526
8325
  ) }),
8527
8326
  /* @__PURE__ */ jsxs84(
8528
- Box38,
8327
+ Box36,
8529
8328
  {
8530
8329
  className: classes.mt,
8531
8330
  sx: {
8532
8331
  fontWeight: 600
8533
8332
  },
8534
8333
  children: [
8535
- subtitle1 && /* @__PURE__ */ jsx129(Typography31, { variant: "subtitle1", children: subtitle1 }),
8536
- subtitle2 && /* @__PURE__ */ jsx129(Typography31, { variant: "subtitle1", children: subtitle2 })
8334
+ subtitle1 && /* @__PURE__ */ jsx125(Typography30, { variant: "subtitle1", children: subtitle1 }),
8335
+ subtitle2 && /* @__PURE__ */ jsx125(Typography30, { variant: "subtitle1", children: subtitle2 })
8537
8336
  ]
8538
8337
  }
8539
8338
  )
8540
8339
  ] }),
8541
- /* @__PURE__ */ jsx129(Divider11, {}),
8542
- /* @__PURE__ */ jsxs84(Box38, { className: classes.buttonContainer, children: [
8543
- /* @__PURE__ */ jsx129(
8340
+ /* @__PURE__ */ jsx125(Divider11, {}),
8341
+ /* @__PURE__ */ jsxs84(Box36, { className: classes.buttonContainer, children: [
8342
+ /* @__PURE__ */ jsx125(
8544
8343
  FilledButton_default,
8545
8344
  {
8546
8345
  copy: cancelLabel,
@@ -8553,7 +8352,7 @@ var TwoButtonDialog = ({
8553
8352
  }
8554
8353
  }
8555
8354
  ),
8556
- /* @__PURE__ */ jsx129(
8355
+ /* @__PURE__ */ jsx125(
8557
8356
  FilledButton_default,
8558
8357
  {
8559
8358
  color: "primary",
@@ -8562,7 +8361,7 @@ var TwoButtonDialog = ({
8562
8361
  }
8563
8362
  )
8564
8363
  ] }),
8565
- /* @__PURE__ */ jsx129(Loading_default, { isLoading: dialogLoading })
8364
+ /* @__PURE__ */ jsx125(Loading_default, { isLoading: dialogLoading })
8566
8365
  ] }) })
8567
8366
  }
8568
8367
  );
@@ -8571,10 +8370,10 @@ var TwoButtonDialog_default = TwoButtonDialog;
8571
8370
 
8572
8371
  // src/components/UserBust/UserBust.tsx
8573
8372
  import { memo as memo25 } from "react";
8574
- import { Avatar as Avatar2, Typography as Typography32 } from "@mui/material";
8575
- import { jsx as jsx130, jsxs as jsxs85 } from "react/jsx-runtime";
8373
+ import { Avatar as Avatar2, Typography as Typography31 } from "@mui/material";
8374
+ import { jsx as jsx126, jsxs as jsxs85 } from "react/jsx-runtime";
8576
8375
  var UserBust = ({ user, avatarProps, typographyProps }) => /* @__PURE__ */ jsxs85("div", { children: [
8577
- /* @__PURE__ */ jsx130(
8376
+ /* @__PURE__ */ jsx126(
8578
8377
  Avatar2,
8579
8378
  {
8580
8379
  src: user.profile_picture,
@@ -8583,17 +8382,17 @@ var UserBust = ({ user, avatarProps, typographyProps }) => /* @__PURE__ */ jsxs8
8583
8382
  }
8584
8383
  ),
8585
8384
  /* @__PURE__ */ jsxs85("div", { style: { paddingTop: 16 }, children: [
8586
- /* @__PURE__ */ jsx130(Typography32, { ...typographyProps.name, children: `${user.first_name} ${user.last_name}` }),
8587
- /* @__PURE__ */ jsx130(Typography32, { ...typographyProps.username, children: user.username })
8385
+ /* @__PURE__ */ jsx126(Typography31, { ...typographyProps.name, children: `${user.first_name} ${user.last_name}` }),
8386
+ /* @__PURE__ */ jsx126(Typography31, { ...typographyProps.username, children: user.username })
8588
8387
  ] })
8589
8388
  ] });
8590
8389
  var UserBust_default = memo25(UserBust);
8591
8390
 
8592
8391
  // src/components/icons/IconChart.tsx
8593
- import { jsx as jsx131 } from "react/jsx-runtime";
8392
+ import { jsx as jsx127 } from "react/jsx-runtime";
8594
8393
  var SvgIconChart = (props) => {
8595
8394
  const { fill } = props;
8596
- return /* @__PURE__ */ jsx131(
8395
+ return /* @__PURE__ */ jsx127(
8597
8396
  "svg",
8598
8397
  {
8599
8398
  width: "20",
@@ -8602,7 +8401,7 @@ var SvgIconChart = (props) => {
8602
8401
  fill: "none",
8603
8402
  xmlns: "http://www.w3.org/2000/svg",
8604
8403
  ...props,
8605
- children: /* @__PURE__ */ jsx131(
8404
+ children: /* @__PURE__ */ jsx127(
8606
8405
  "path",
8607
8406
  {
8608
8407
  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",
@@ -8679,10 +8478,10 @@ export {
8679
8478
  SquareLabel_default as SquareLabel,
8680
8479
  Switch_default as Switch,
8681
8480
  Table_default as Table,
8682
- TableDesktop,
8683
- TableDesktopCell,
8684
- TableDesktopEditableComponent,
8481
+ TableDesktop_default as TableDesktop,
8685
8482
  TableDesktopFooter,
8483
+ TableDesktopRowCell,
8484
+ TableDesktopSmartSelect,
8686
8485
  TableEmptyResult_default as TableEmptyResult,
8687
8486
  TableHeader_default as TableHeader,
8688
8487
  TableLoading_default as TableLoading,