@natoora-libs/core 0.1.9-dev-doug-4 → 0.1.9-dev-doug-6

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.
@@ -2781,7 +2781,7 @@ var RoundButton = ({
2781
2781
  onClick(e);
2782
2782
  }
2783
2783
  };
2784
- const Button14 = /* @__PURE__ */ jsx63(
2784
+ const Button15 = /* @__PURE__ */ jsx63(
2785
2785
  Fab,
2786
2786
  {
2787
2787
  className: cx(
@@ -2805,7 +2805,7 @@ var RoundButton = ({
2805
2805
  children: icon ? iconComponentMap[icon] : children || ""
2806
2806
  }
2807
2807
  );
2808
- return tooltip ? /* @__PURE__ */ jsx63(Tooltip2, { title: tooltip, children: Button14 }) : Button14;
2808
+ return tooltip ? /* @__PURE__ */ jsx63(Tooltip2, { title: tooltip, children: Button15 }) : Button15;
2809
2809
  };
2810
2810
  var RoundButton_default = RoundButton;
2811
2811
 
@@ -6592,7 +6592,7 @@ var Switch_default = memo19(LabelledSwitch);
6592
6592
  import { useMemo as useMemo3, useState as useState16, useEffect as useEffect11, memo as memo21 } from "react";
6593
6593
  import CheckIcon from "@mui/icons-material/Check";
6594
6594
  import {
6595
- Box as Box30,
6595
+ Box as Box29,
6596
6596
  Checkbox as Checkbox5,
6597
6597
  Divider as Divider9,
6598
6598
  FormControlLabel as FormControlLabel3,
@@ -6616,7 +6616,8 @@ import {
6616
6616
  TableBody,
6617
6617
  TableContainer,
6618
6618
  Skeleton as Skeleton2,
6619
- Box as Box29
6619
+ TableRow as TableRow3,
6620
+ TableCell as TableCell3
6620
6621
  } from "@mui/material";
6621
6622
  import { makeStyles as makeStyles47 } from "tss-react/mui";
6622
6623
 
@@ -6813,6 +6814,7 @@ var TableEmptyResult_default = TableEmptyResult;
6813
6814
 
6814
6815
  // src/components/TableDesktop/TableDesktop.tsx
6815
6816
  import { jsx as jsx110, jsxs as jsxs75 } from "react/jsx-runtime";
6817
+ var ROW_HEIGHT = 56;
6816
6818
  var useStyles47 = makeStyles47()((theme) => ({
6817
6819
  root: {
6818
6820
  justifyContent: "space-between",
@@ -6898,14 +6900,14 @@ var TableDesktop = ({
6898
6900
  onApplyFilters,
6899
6901
  shouldShowCheckOnFilter
6900
6902
  }) => {
6903
+ const { classes } = useStyles47();
6901
6904
  const [order, setOrder] = useState15(appliedFilters?.sortDir || "desc");
6902
6905
  const [orderBy, setOrderBy] = useState15(
6903
6906
  appliedFilters?.sortField || "delivery_date"
6904
6907
  );
6905
6908
  const [selected, setSelected] = useState15(/* @__PURE__ */ new Set());
6906
6909
  const [page] = useState15(0);
6907
- const { classes } = useStyles47();
6908
- const rowHeight = 56;
6910
+ const numRows = data.length;
6909
6911
  const emptyRows = useMemo2(
6910
6912
  () => rowsPerPage - data.length,
6911
6913
  [rowsPerPage, data]
@@ -6951,6 +6953,18 @@ var TableDesktop = ({
6951
6953
  );
6952
6954
  const renderTableRows = useMemo2(() => {
6953
6955
  const sortedData = disableInternalSort ? data : stableSort(data, getComparator(order, orderBy));
6956
+ if (isLoading) {
6957
+ return [...Array(Math.min(numRows, rowsPerPage))].map((_, rowIndex) => /* @__PURE__ */ jsx110(TableRow3, { children: [...Array(visibleHeadCells.length)].map((_2, cellIndex) => /* @__PURE__ */ jsx110(TableCell3, { children: /* @__PURE__ */ jsx110(
6958
+ Skeleton2,
6959
+ {
6960
+ animation: "pulse",
6961
+ variant: "rounded",
6962
+ height: ROW_HEIGHT - 33,
6963
+ sx: { bgcolor: colors.neutral150 },
6964
+ "data-testid": "loading-skeleton"
6965
+ }
6966
+ ) }, cellIndex)) }, rowIndex));
6967
+ }
6954
6968
  return sortedData.slice(page * rowsPerPage, page * rowsPerPage + rowsPerPage).map((row, index) => {
6955
6969
  const isItemSelected = selected.has(row[keyField]);
6956
6970
  return /* @__PURE__ */ jsx110(
@@ -6962,8 +6976,8 @@ var TableDesktop = ({
6962
6976
  deleteItem,
6963
6977
  isItemSelected,
6964
6978
  enableCheckboxSelection,
6965
- enableRowActions,
6966
- keyFieldValue: row[keyField],
6979
+ rowHeight: ROW_HEIGHT,
6980
+ rowId: row[keyField],
6967
6981
  handleRowCheckboxChange,
6968
6982
  visibleHeadCells
6969
6983
  }
@@ -6993,17 +7007,7 @@ var TableDesktop = ({
6993
7007
  }
6994
7008
  }, [enableCheckboxSelection]);
6995
7009
  return /* @__PURE__ */ jsx110("div", { className: classes.root, style: { height }, children: /* @__PURE__ */ jsxs75(Paper10, { className: classes.paper, children: [
6996
- isLoading ? /* @__PURE__ */ jsx110(Box29, { width: "100%", overflow: "hidden", children: [...Array(Math.floor(rowsPerPage ?? 50))].map((_, index) => /* @__PURE__ */ jsx110(
6997
- Skeleton2,
6998
- {
6999
- animation: "pulse",
7000
- variant: "rounded",
7001
- sx: { margin: 1 },
7002
- height: rowHeight,
7003
- "data-testid": "loading-skeleton"
7004
- },
7005
- index
7006
- )) }) : /* @__PURE__ */ jsx110(TableContainer, { className: classes.container, children: /* @__PURE__ */ jsxs75(
7010
+ /* @__PURE__ */ jsx110(TableContainer, { className: classes.container, children: /* @__PURE__ */ jsxs75(
7007
7011
  Table,
7008
7012
  {
7009
7013
  stickyHeader: true,
@@ -7018,7 +7022,7 @@ var TableDesktop = ({
7018
7022
  order,
7019
7023
  orderBy,
7020
7024
  numSelected: selected.size,
7021
- numRows: data.length,
7025
+ numRows,
7022
7026
  enableCheckboxSelection,
7023
7027
  headerFilters: headerFilters ?? {},
7024
7028
  onRequestSort: handleRequestSort,
@@ -7156,7 +7160,7 @@ var SmartTableHeaderFilterMenu = ({
7156
7160
  const isOptionChecked = useMemo3(() => (resolvedOption) => !!selectedFilters?.some(
7157
7161
  (value) => resolveOptionType(value, headCell.fieldName ?? "") === resolvedOption
7158
7162
  ), [selectedFilters]);
7159
- const loadingSkeletons = /* @__PURE__ */ jsxs76(Box30, { "data-testid": "loading-skeletons", width: 272, children: [
7163
+ const loadingSkeletons = /* @__PURE__ */ jsxs76(Box29, { "data-testid": "loading-skeletons", width: 272, children: [
7160
7164
  /* @__PURE__ */ jsx111(Skeleton3, { variant: "rounded", className: classes.skeleton }),
7161
7165
  /* @__PURE__ */ jsx111(Divider9, {}),
7162
7166
  /* @__PURE__ */ jsx111(Skeleton3, { variant: "rounded", className: classes.skeleton }),
@@ -7186,8 +7190,8 @@ var SmartTableHeaderFilterMenu = ({
7186
7190
  "data-testid": "filter-menu",
7187
7191
  anchorOrigin: { vertical: "bottom", horizontal: "right" },
7188
7192
  transformOrigin: { vertical: "top", horizontal: "right" },
7189
- children: headCell.isFetchingFilterOptions ? loadingSkeletons : /* @__PURE__ */ jsxs76(Box30, { className: classes.filterMenu, children: [
7190
- /* @__PURE__ */ jsx111(Box30, { px: 3, mb: 0.5, children: /* @__PURE__ */ jsx111(
7193
+ children: headCell.isFetchingFilterOptions ? loadingSkeletons : /* @__PURE__ */ jsxs76(Box29, { className: classes.filterMenu, children: [
7194
+ /* @__PURE__ */ jsx111(Box29, { px: 3, mb: 0.5, children: /* @__PURE__ */ jsx111(
7191
7195
  FormControlLabel3,
7192
7196
  {
7193
7197
  label: "Select All",
@@ -7209,11 +7213,11 @@ var SmartTableHeaderFilterMenu = ({
7209
7213
  }
7210
7214
  ) }),
7211
7215
  /* @__PURE__ */ jsx111(Divider9, { sx: { mb: 0.5 } }),
7212
- /* @__PURE__ */ jsx111(Box30, { className: classes.filterOptions, children: filterOptionsData?.map(
7216
+ /* @__PURE__ */ jsx111(Box29, { className: classes.filterOptions, children: filterOptionsData?.map(
7213
7217
  (option) => {
7214
7218
  const resolvedOption = resolveOptionType(option, headCell.fieldName ?? "");
7215
7219
  return /* @__PURE__ */ jsxs76(
7216
- Box30,
7220
+ Box29,
7217
7221
  {
7218
7222
  className: classes.filter,
7219
7223
  children: [
@@ -7240,7 +7244,7 @@ var SmartTableHeaderFilterMenu = ({
7240
7244
  }
7241
7245
  ) }),
7242
7246
  /* @__PURE__ */ jsx111(Divider9, { sx: { mb: 0.5 } }),
7243
- /* @__PURE__ */ jsxs76(Box30, { className: classes.applyFilterButtonsContainer, children: [
7247
+ /* @__PURE__ */ jsxs76(Box29, { className: classes.applyFilterButtonsContainer, children: [
7244
7248
  /* @__PURE__ */ jsx111(
7245
7249
  ExtendedButton_default,
7246
7250
  {
@@ -7273,26 +7277,26 @@ var SmartTableHeaderFilterMenu_default = memo21(SmartTableHeaderFilterMenu);
7273
7277
  var import_debounce = __toESM(require_debounce(), 1);
7274
7278
  import { useLayoutEffect, useState as useState17 } from "react";
7275
7279
  import {
7276
- Box as Box32,
7280
+ Box as Box31,
7277
7281
  Paper as Paper11,
7278
7282
  Table as MUITable,
7279
7283
  TableBody as TableBody2,
7280
- TableCell as TableCell3,
7284
+ TableCell as TableCell4,
7281
7285
  TableContainer as TableContainer2,
7282
7286
  TableHead as TableHead2,
7283
- TableRow as TableRow3,
7287
+ TableRow as TableRow4,
7284
7288
  TableSortLabel as TableSortLabel2
7285
7289
  } from "@mui/material";
7286
7290
  import { makeStyles as makeStyles49 } from "tss-react/mui";
7287
7291
  import { v4 as uuidv4 } from "uuid";
7288
7292
 
7289
7293
  // src/components/TableLoading/TableLoading.tsx
7290
- import { Box as Box31, Skeleton as Skeleton4 } from "@mui/material";
7294
+ import { Box as Box30, Skeleton as Skeleton4 } from "@mui/material";
7291
7295
  import { jsx as jsx112 } from "react/jsx-runtime";
7292
7296
  var TableLoading = ({
7293
7297
  rowsPerPage,
7294
7298
  rowHeight
7295
- }) => /* @__PURE__ */ jsx112(Box31, { children: Array.from({ length: rowsPerPage ?? 0 }).map((_, index) => /* @__PURE__ */ jsx112(
7299
+ }) => /* @__PURE__ */ jsx112(Box30, { children: Array.from({ length: rowsPerPage ?? 0 }).map((_, index) => /* @__PURE__ */ jsx112(
7296
7300
  Skeleton4,
7297
7301
  {
7298
7302
  animation: "pulse",
@@ -7421,18 +7425,18 @@ var Table2 = ({
7421
7425
  if (RenderItem) {
7422
7426
  return /* @__PURE__ */ jsx113(RenderItem, { ...row }, row.id);
7423
7427
  }
7424
- return /* @__PURE__ */ jsx113(TableRow3, { hover: true, onClick: () => onRowClick?.(row), children: headCells?.map((column) => /* @__PURE__ */ jsx113(TableCell3, { children: row[column.id] }, column.id)) }, row.id);
7428
+ return /* @__PURE__ */ jsx113(TableRow4, { hover: true, onClick: () => onRowClick?.(row), children: headCells?.map((column) => /* @__PURE__ */ jsx113(TableCell4, { children: row[column.id] }, column.id)) }, row.id);
7425
7429
  });
7426
7430
  if (emptyRows > 0 && rowsPerPage > emptyRows) {
7427
7431
  rowsComponents.push(
7428
- /* @__PURE__ */ jsx113(TableRow3, { style: { height: rowHeight * emptyRows }, children: /* @__PURE__ */ jsx113(TableCell3, { colSpan: 8 }) }, uuidv4())
7432
+ /* @__PURE__ */ jsx113(TableRow4, { style: { height: rowHeight * emptyRows }, children: /* @__PURE__ */ jsx113(TableCell4, { colSpan: 8 }) }, uuidv4())
7429
7433
  );
7430
7434
  }
7431
7435
  return rowsComponents;
7432
7436
  };
7433
- return /* @__PURE__ */ jsx113(Paper11, { className: classes.root, children: /* @__PURE__ */ jsx113(Box32, { className: classes.paper, children: isLoading ? /* @__PURE__ */ jsx113(TableLoading_default, { rowHeight, rowsPerPage }) : /* @__PURE__ */ jsx113(TableContainer2, { className: classes.container, children: /* @__PURE__ */ jsxs77(MUITable, { size: "medium", stickyHeader: true, children: [
7434
- /* @__PURE__ */ jsx113(TableHead2, { className: classes.header, children: /* @__PURE__ */ jsx113(TableRow3, { children: headCells?.map((headCell) => /* @__PURE__ */ jsx113(
7435
- TableCell3,
7437
+ return /* @__PURE__ */ jsx113(Paper11, { className: classes.root, children: /* @__PURE__ */ jsx113(Box31, { className: classes.paper, children: isLoading ? /* @__PURE__ */ jsx113(TableLoading_default, { rowHeight, rowsPerPage }) : /* @__PURE__ */ jsx113(TableContainer2, { className: classes.container, children: /* @__PURE__ */ jsxs77(MUITable, { size: "medium", stickyHeader: true, children: [
7438
+ /* @__PURE__ */ jsx113(TableHead2, { className: classes.header, children: /* @__PURE__ */ jsx113(TableRow4, { children: headCells?.map((headCell) => /* @__PURE__ */ jsx113(
7439
+ TableCell4,
7436
7440
  {
7437
7441
  align: "left",
7438
7442
  sortDirection: orderBy === headCell.id ? order : void 0,
@@ -7450,52 +7454,95 @@ var Table2 = ({
7450
7454
  )) }) }),
7451
7455
  /* @__PURE__ */ jsxs77(TableBody2, { children: [
7452
7456
  getTableRows(),
7453
- rowsPerPage === emptyRows && /* @__PURE__ */ jsx113(TableRow3, { style: { height: rowHeight * emptyRows }, children: /* @__PURE__ */ jsx113(TableCell3, { colSpan: 8, align: "center", children: "Nothing to display" }) })
7457
+ rowsPerPage === emptyRows && /* @__PURE__ */ jsx113(TableRow4, { style: { height: rowHeight * emptyRows }, children: /* @__PURE__ */ jsx113(TableCell4, { colSpan: 8, align: "center", children: "Nothing to display" }) })
7454
7458
  ] })
7455
7459
  ] }) }) }) });
7456
7460
  };
7457
7461
  var Table_default = Table2;
7458
7462
 
7459
- // src/components/TableDesktopRowActions/TableDesktopRowActions.tsx
7460
- import { Box as Box33, TableCell as TableCell4 } from "@mui/material";
7461
- import { jsx as jsx114 } from "react/jsx-runtime";
7462
- var TableDesktopRowActions = ({
7463
- isRowHovered,
7464
- children,
7465
- sx,
7466
- zIndex = 1,
7467
- backgroundColor
7463
+ // src/components/TableDesktopFooter/TableDesktopFooter.tsx
7464
+ import Refresh3 from "@mui/icons-material/Refresh";
7465
+ import { Box as Box32, Button as Button13, MenuItem as MenuItem4, Pagination as Pagination2, Select as Select4, Stack, Typography as Typography27 } from "@mui/material";
7466
+ import { jsx as jsx114, jsxs as jsxs78 } from "react/jsx-runtime";
7467
+ var TableDesktopFooter = ({
7468
+ numPages,
7469
+ page,
7470
+ pageSize,
7471
+ pageSizeOptions,
7472
+ handlePageChange,
7473
+ handlePageSizeChange,
7474
+ refetch,
7475
+ isFetching
7468
7476
  }) => {
7469
- return isRowHovered ? /* @__PURE__ */ jsx114(
7470
- TableCell4,
7477
+ return /* @__PURE__ */ jsxs78(
7478
+ Box32,
7471
7479
  {
7472
- padding: "none",
7473
- sx: {
7474
- top: 0,
7475
- right: 0,
7476
- zIndex,
7477
- position: "sticky",
7478
- display: "flex",
7479
- justifyContent: "flex-end",
7480
- alignItems: "center"
7481
- },
7482
- children: /* @__PURE__ */ jsx114(
7483
- Box33,
7484
- {
7485
- sx,
7486
- display: "flex",
7487
- flexDirection: "row",
7488
- bgcolor: backgroundColor ?? colors.neutral100,
7489
- children
7490
- }
7491
- )
7480
+ py: 1,
7481
+ gap: 2,
7482
+ display: "flex",
7483
+ justifyContent: "space-between",
7484
+ alignItems: "center",
7485
+ borderTop: `1px solid ${colors.neutral300}`,
7486
+ bgcolor: (theme) => theme.palette.background.default,
7487
+ children: [
7488
+ /* @__PURE__ */ jsxs78(
7489
+ Button13,
7490
+ {
7491
+ disableRipple: true,
7492
+ variant: "outlined",
7493
+ onClick: () => refetch(),
7494
+ disabled: isFetching,
7495
+ sx: {
7496
+ ml: 1,
7497
+ gap: 1,
7498
+ borderRadius: 25,
7499
+ color: colors.neutral800,
7500
+ borderColor: colors.neutral600
7501
+ },
7502
+ children: [
7503
+ /* @__PURE__ */ jsx114(
7504
+ Refresh3,
7505
+ {
7506
+ fontSize: "small",
7507
+ color: isFetching ? "disabled" : "primary"
7508
+ }
7509
+ ),
7510
+ "REFRESH"
7511
+ ]
7512
+ }
7513
+ ),
7514
+ /* @__PURE__ */ jsxs78(Box32, { display: "flex", children: [
7515
+ /* @__PURE__ */ jsxs78(Stack, { direction: "row", spacing: 2, alignItems: "center", children: [
7516
+ /* @__PURE__ */ jsx114(Typography27, { children: "Rows per page:" }),
7517
+ /* @__PURE__ */ jsx114(
7518
+ Select4,
7519
+ {
7520
+ value: pageSize,
7521
+ onChange: handlePageSizeChange,
7522
+ size: "small",
7523
+ variant: "standard",
7524
+ children: pageSizeOptions.map((size) => /* @__PURE__ */ jsx114(MenuItem4, { value: size, children: size }, size))
7525
+ }
7526
+ )
7527
+ ] }),
7528
+ /* @__PURE__ */ jsx114(
7529
+ Pagination2,
7530
+ {
7531
+ color: "standard",
7532
+ count: numPages,
7533
+ page,
7534
+ onChange: handlePageChange
7535
+ }
7536
+ )
7537
+ ] })
7538
+ ]
7492
7539
  }
7493
- ) : null;
7540
+ );
7494
7541
  };
7495
7542
 
7496
7543
  // src/components/TableDesktopRowCell/TableDesktopRowCell.tsx
7497
7544
  import { useEffect as useEffect13, useRef as useRef5, useState as useState20 } from "react";
7498
- import { Checkbox as Checkbox6, TableCell as TableCell5, TextField as TextField9, Tooltip as Tooltip7 } from "@mui/material";
7545
+ import { Box as Box33, Checkbox as Checkbox6, IconButton as IconButton4, TableCell as TableCell5, TextField as TextField9, Tooltip as Tooltip7 } from "@mui/material";
7499
7546
 
7500
7547
  // src/components/TableDesktopRowCell/TableDesktopSmartSelect.tsx
7501
7548
  import { useState as useState18, memo as memo22, useEffect as useEffect12 } from "react";
@@ -7512,6 +7559,7 @@ var TableDesktopSmartSelect = memo22(({
7512
7559
  inputLabel,
7513
7560
  fieldName,
7514
7561
  rowId,
7562
+ disabled,
7515
7563
  filterOptions,
7516
7564
  refetchFilterOptions,
7517
7565
  isFetchingFilterOptions,
@@ -7537,6 +7585,7 @@ var TableDesktopSmartSelect = memo22(({
7537
7585
  value: valueId,
7538
7586
  inputLabel,
7539
7587
  options,
7588
+ disabled,
7540
7589
  refetch: refetchFilterOptions,
7541
7590
  isFetching: isFetchingFilterOptions,
7542
7591
  defaultOption: {
@@ -7562,11 +7611,12 @@ var TableDesktopTextField = ({
7562
7611
  rowId,
7563
7612
  editInitialValue,
7564
7613
  inputLabel,
7614
+ disabled,
7565
7615
  validateInput,
7566
7616
  onUpdateEditableCell
7567
7617
  }) => {
7568
7618
  const [value, setValue] = useState19(editInitialValue);
7569
- const hasError = useMemo4(() => validateInput?.(value), [value, validateInput]);
7619
+ const hasError = useMemo4(() => !validateInput?.(value), [value, validateInput]);
7570
7620
  return /* @__PURE__ */ jsx116(
7571
7621
  TextField8,
7572
7622
  {
@@ -7575,6 +7625,7 @@ var TableDesktopTextField = ({
7575
7625
  defaultValue: value,
7576
7626
  label: inputLabel,
7577
7627
  error: hasError,
7628
+ disabled,
7578
7629
  onChange: ({ target: { value: value2 } }) => {
7579
7630
  setValue(value2);
7580
7631
  },
@@ -7589,38 +7640,55 @@ var TableDesktopTextField = ({
7589
7640
  };
7590
7641
 
7591
7642
  // src/components/TableDesktopRowCell/TableDesktopRowCell.tsx
7592
- import { jsx as jsx117 } from "react/jsx-runtime";
7643
+ import Close2 from "@mui/icons-material/Close";
7644
+ import Edit3 from "@mui/icons-material/Edit";
7645
+ import { jsx as jsx117, jsxs as jsxs79 } from "react/jsx-runtime";
7593
7646
  var TableDesktopRowCell = ({
7594
- ref,
7595
7647
  inputLabel,
7596
7648
  editInitialValue,
7597
7649
  rowId,
7598
7650
  fieldName,
7599
7651
  width,
7600
- isEditMode,
7652
+ disabled,
7601
7653
  readOnlyValue,
7602
7654
  editableCellType,
7603
7655
  filterOptions,
7604
7656
  refetchFilterOptions,
7605
7657
  isFetchingFilterOptions,
7606
7658
  validateInput,
7607
- onUpdateEditableCell
7659
+ onUpdateEditableCell,
7660
+ onCellClick
7608
7661
  }) => {
7609
7662
  const cellRef = useRef5(null);
7610
7663
  const [isOverflowed, setIsOverflowed] = useState20(false);
7664
+ const [isCellHovered, setIsCellHovered] = useState20(false);
7665
+ const [isEditMode, setIsEditMode] = useState20(false);
7611
7666
  useEffect13(() => {
7612
- const ref2 = cellRef.current;
7613
- if (ref2) {
7614
- setIsOverflowed(ref2.scrollWidth > ref2.clientWidth);
7667
+ const ref = cellRef.current;
7668
+ if (ref) {
7669
+ setIsOverflowed(ref.scrollWidth > ref.clientWidth);
7615
7670
  }
7616
7671
  }, [readOnlyValue, width]);
7672
+ useEffect13(() => {
7673
+ const handleKeyDown = (e) => {
7674
+ if (e.key === "Escape") {
7675
+ setIsEditMode(false);
7676
+ }
7677
+ };
7678
+ if (isEditMode) {
7679
+ window.addEventListener("keydown", handleKeyDown);
7680
+ }
7681
+ return () => {
7682
+ window.removeEventListener("keydown", handleKeyDown);
7683
+ };
7684
+ }, [isEditMode]);
7617
7685
  const editableComponents = {
7618
7686
  "select": /* @__PURE__ */ jsx117(
7619
7687
  TableDesktopSmartSelect,
7620
7688
  {
7621
- ref,
7622
7689
  rowId,
7623
7690
  fieldName,
7691
+ disabled,
7624
7692
  initialValue: editInitialValue,
7625
7693
  inputLabel: inputLabel ?? "",
7626
7694
  filterOptions,
@@ -7633,6 +7701,7 @@ var TableDesktopRowCell = ({
7633
7701
  Checkbox6,
7634
7702
  {
7635
7703
  disableRipple: true,
7704
+ disabled,
7636
7705
  defaultChecked: editInitialValue,
7637
7706
  onChange: ({ target: { checked } }) => {
7638
7707
  onUpdateEditableCell?.(rowId, checked);
@@ -7643,6 +7712,7 @@ var TableDesktopRowCell = ({
7643
7712
  TableDesktopTextField,
7644
7713
  {
7645
7714
  rowId,
7715
+ disabled,
7646
7716
  editInitialValue,
7647
7717
  inputLabel: inputLabel ?? "",
7648
7718
  validateInput,
@@ -7654,6 +7724,7 @@ var TableDesktopRowCell = ({
7654
7724
  {
7655
7725
  fullWidth: true,
7656
7726
  variant: "standard",
7727
+ disabled,
7657
7728
  defaultValue: editInitialValue,
7658
7729
  label: inputLabel,
7659
7730
  onChange: (e) => {
@@ -7676,18 +7747,49 @@ var TableDesktopRowCell = ({
7676
7747
  }
7677
7748
  return "-";
7678
7749
  };
7750
+ const handleEditClick = (e) => {
7751
+ e.stopPropagation();
7752
+ setIsEditMode((prev) => !prev);
7753
+ };
7679
7754
  return /* @__PURE__ */ jsx117(Tooltip7, { title: isOverflowed ? String(readOnlyValue) : "", arrow: true, children: /* @__PURE__ */ jsx117(
7680
7755
  TableCell5,
7681
7756
  {
7682
7757
  ref: cellRef,
7683
7758
  align: "left",
7759
+ onMouseEnter: () => editableCellType && !disabled && setIsCellHovered(true),
7760
+ onMouseLeave: () => editableCellType && !disabled && setIsCellHovered(false),
7761
+ onClick: (event) => !disabled && onCellClick?.(event, isEditMode),
7684
7762
  sx: {
7763
+ padding: 1,
7685
7764
  width: width ?? "auto",
7686
7765
  overflow: "hidden",
7687
7766
  textOverflow: "ellipsis",
7688
- whiteSpace: "nowrap"
7767
+ whiteSpace: "nowrap",
7768
+ position: "relative",
7769
+ cursor: disabled ? "default" : "pointer",
7770
+ opacity: disabled ? 0.2 : 1,
7771
+ ":hover": editableCellType && {
7772
+ background: isEditMode ? colors.lightBlueBackground : colors.neutral100
7773
+ },
7774
+ background: isEditMode ? colors.lightBlueBackground : (theme) => theme.palette.background.default
7689
7775
  },
7690
- children: isEditMode && editableCellType ? editableComponents[editableCellType] : typeof readOnlyValue === "boolean" ? getReadOnlyBooleanIcon(readOnlyValue) : readOnlyValue
7776
+ children: /* @__PURE__ */ jsxs79(Box33, { p: 1, children: [
7777
+ isCellHovered ? /* @__PURE__ */ jsx117(Tooltip7, { title: "Toggle Edit Mode", children: /* @__PURE__ */ jsx117(
7778
+ IconButton4,
7779
+ {
7780
+ onClick: handleEditClick,
7781
+ sx: {
7782
+ position: "absolute",
7783
+ top: 0,
7784
+ right: 0,
7785
+ zIndex: 1,
7786
+ borderRadius: 0
7787
+ },
7788
+ children: isEditMode ? /* @__PURE__ */ jsx117(Close2, { fontSize: "small", color: "error" }) : /* @__PURE__ */ jsx117(Edit3, { fontSize: "small" })
7789
+ }
7790
+ ) }) : null,
7791
+ isEditMode && editableCellType ? editableComponents[editableCellType] : typeof readOnlyValue === "boolean" ? getReadOnlyBooleanIcon(readOnlyValue) : readOnlyValue
7792
+ ] })
7691
7793
  }
7692
7794
  ) });
7693
7795
  };
@@ -7695,7 +7797,7 @@ var TableDesktopRowCell = ({
7695
7797
  // src/components/TableHeader/TableHeader.tsx
7696
7798
  import { memo as memo23, useEffect as useEffect14, useState as useState21 } from "react";
7697
7799
  import { ImportExport as ImportExportIcon } from "@mui/icons-material";
7698
- import { TableCell as TableCell6, TableHead as TableHead3, TableRow as TableRow4, TableSortLabel as TableSortLabel3 } from "@mui/material";
7800
+ import { TableCell as TableCell6, TableHead as TableHead3, TableRow as TableRow5, TableSortLabel as TableSortLabel3 } from "@mui/material";
7699
7801
  import { makeStyles as makeStyles50 } from "tss-react/mui";
7700
7802
  import { jsx as jsx118 } from "react/jsx-runtime";
7701
7803
  var useStyles50 = makeStyles50()(() => ({
@@ -7742,7 +7844,7 @@ var TableHeader = ({ cells, onSort = null }) => {
7742
7844
  });
7743
7845
  setSortableCells(sortedCells);
7744
7846
  };
7745
- return /* @__PURE__ */ jsx118(TableHead3, { children: /* @__PURE__ */ jsx118(TableRow4, { children: sortableCells.map((cell, key) => /* @__PURE__ */ jsx118(TableCell6, { children: cell.isSortable ? /* @__PURE__ */ jsx118(
7847
+ return /* @__PURE__ */ jsx118(TableHead3, { children: /* @__PURE__ */ jsx118(TableRow5, { children: sortableCells.map((cell, key) => /* @__PURE__ */ jsx118(TableCell6, { children: cell.isSortable ? /* @__PURE__ */ jsx118(
7746
7848
  TableSortLabel3,
7747
7849
  {
7748
7850
  className: classes.sortLabel,
@@ -7756,9 +7858,9 @@ var TableHeader = ({ cells, onSort = null }) => {
7756
7858
  var TableHeader_default = memo23(TableHeader);
7757
7859
 
7758
7860
  // src/components/TextDivider/TextDivider.tsx
7759
- import { Box as Box34, Typography as Typography27, Divider as Divider10, Button as Button13 } from "@mui/material";
7861
+ import { Box as Box34, Typography as Typography28, Divider as Divider10, Button as Button14 } from "@mui/material";
7760
7862
  import { makeStyles as makeStyles51 } from "tss-react/mui";
7761
- import { jsx as jsx119, jsxs as jsxs78 } from "react/jsx-runtime";
7863
+ import { jsx as jsx119, jsxs as jsxs80 } from "react/jsx-runtime";
7762
7864
  var useStyles51 = makeStyles51()(() => ({
7763
7865
  icon: {
7764
7866
  fontSize: 20
@@ -7795,7 +7897,7 @@ var TextDivider = ({
7795
7897
  }) => {
7796
7898
  const { classes } = useStyles51();
7797
7899
  const iconColor = color ?? colors.neutral900;
7798
- return /* @__PURE__ */ jsxs78(
7900
+ return /* @__PURE__ */ jsxs80(
7799
7901
  Box34,
7800
7902
  {
7801
7903
  display: "flex",
@@ -7804,10 +7906,10 @@ var TextDivider = ({
7804
7906
  className: classes.container,
7805
7907
  children: [
7806
7908
  /* @__PURE__ */ jsx119(Divider10, { className: classes.leftDivider }),
7807
- /* @__PURE__ */ jsx119(Button13, { onClick, disabled: !onClick, className: classes.button, children: /* @__PURE__ */ jsxs78(Box34, { className: classes.center, children: [
7909
+ /* @__PURE__ */ jsx119(Button14, { onClick, disabled: !onClick, className: classes.button, children: /* @__PURE__ */ jsxs80(Box34, { className: classes.center, children: [
7808
7910
  Icon2 && iconPosition === "left" && /* @__PURE__ */ jsx119(Icon2, { className: classes.icon, style: { color: iconColor } }),
7809
7911
  /* @__PURE__ */ jsx119(
7810
- Typography27,
7912
+ Typography28,
7811
7913
  {
7812
7914
  color: "textSecondary",
7813
7915
  className: classes.title,
@@ -7933,7 +8035,7 @@ var ThemedDateRangePicker_default = ThemedDateRangePicker;
7933
8035
  import { memo as memo24 } from "react";
7934
8036
  import { AppBar, Box as Box35, Toolbar } from "@mui/material";
7935
8037
  import { makeStyles as makeStyles53 } from "tss-react/mui";
7936
- import { jsx as jsx121, jsxs as jsxs79 } from "react/jsx-runtime";
8038
+ import { jsx as jsx121, jsxs as jsxs81 } from "react/jsx-runtime";
7937
8039
  var useStyles53 = makeStyles53()((theme) => ({
7938
8040
  menuButton: {
7939
8041
  color: theme.palette.primary.contrastText
@@ -7953,8 +8055,8 @@ var TheToolbar = ({
7953
8055
  rightSection
7954
8056
  }) => {
7955
8057
  const { classes } = useStyles53();
7956
- return /* @__PURE__ */ jsxs79(Box35, { children: [
7957
- /* @__PURE__ */ jsx121(AppBar, { children: /* @__PURE__ */ jsxs79(Toolbar, { className: classes.topBar, children: [
8058
+ return /* @__PURE__ */ jsxs81(Box35, { children: [
8059
+ /* @__PURE__ */ jsx121(AppBar, { children: /* @__PURE__ */ jsxs81(Toolbar, { className: classes.topBar, children: [
7958
8060
  /* @__PURE__ */ jsx121(
7959
8061
  RoundButton_default,
7960
8062
  {
@@ -8024,7 +8126,7 @@ var ToastMessage_default = ToastMessage;
8024
8126
 
8025
8127
  // src/components/TwoButtonDialog/TwoButtonDialog.tsx
8026
8128
  import {
8027
- Typography as Typography28,
8129
+ Typography as Typography29,
8028
8130
  Dialog as Dialog5,
8029
8131
  Backdrop,
8030
8132
  Box as Box36,
@@ -8033,7 +8135,7 @@ import {
8033
8135
  Fade as Fade2
8034
8136
  } from "@mui/material";
8035
8137
  import { makeStyles as makeStyles54 } from "tss-react/mui";
8036
- import { jsx as jsx123, jsxs as jsxs80 } from "react/jsx-runtime";
8138
+ import { jsx as jsx123, jsxs as jsxs82 } from "react/jsx-runtime";
8037
8139
  var useStyles54 = makeStyles54()((theme) => ({
8038
8140
  paper: {
8039
8141
  padding: theme.spacing(2)
@@ -8073,9 +8175,9 @@ var TwoButtonDialog = ({
8073
8175
  closeAfterTransition: true,
8074
8176
  BackdropComponent: Backdrop,
8075
8177
  BackdropProps: { timeout: 500 },
8076
- children: /* @__PURE__ */ jsx123(Fade2, { in: open, children: /* @__PURE__ */ jsxs80(Paper12, { className: classes.paper, children: [
8077
- /* @__PURE__ */ jsxs80(Box36, { className: classes.mb, children: [
8078
- /* @__PURE__ */ jsx123(Typography28, { variant: "h5", component: "div", children: /* @__PURE__ */ jsx123(
8178
+ children: /* @__PURE__ */ jsx123(Fade2, { in: open, children: /* @__PURE__ */ jsxs82(Paper12, { className: classes.paper, children: [
8179
+ /* @__PURE__ */ jsxs82(Box36, { className: classes.mb, children: [
8180
+ /* @__PURE__ */ jsx123(Typography29, { variant: "h5", component: "div", children: /* @__PURE__ */ jsx123(
8079
8181
  Box36,
8080
8182
  {
8081
8183
  sx: {
@@ -8084,7 +8186,7 @@ var TwoButtonDialog = ({
8084
8186
  children: title
8085
8187
  }
8086
8188
  ) }),
8087
- /* @__PURE__ */ jsxs80(
8189
+ /* @__PURE__ */ jsxs82(
8088
8190
  Box36,
8089
8191
  {
8090
8192
  className: classes.mt,
@@ -8092,14 +8194,14 @@ var TwoButtonDialog = ({
8092
8194
  fontWeight: 600
8093
8195
  },
8094
8196
  children: [
8095
- subtitle1 && /* @__PURE__ */ jsx123(Typography28, { variant: "subtitle1", children: subtitle1 }),
8096
- subtitle2 && /* @__PURE__ */ jsx123(Typography28, { variant: "subtitle1", children: subtitle2 })
8197
+ subtitle1 && /* @__PURE__ */ jsx123(Typography29, { variant: "subtitle1", children: subtitle1 }),
8198
+ subtitle2 && /* @__PURE__ */ jsx123(Typography29, { variant: "subtitle1", children: subtitle2 })
8097
8199
  ]
8098
8200
  }
8099
8201
  )
8100
8202
  ] }),
8101
8203
  /* @__PURE__ */ jsx123(Divider11, {}),
8102
- /* @__PURE__ */ jsxs80(Box36, { className: classes.buttonContainer, children: [
8204
+ /* @__PURE__ */ jsxs82(Box36, { className: classes.buttonContainer, children: [
8103
8205
  /* @__PURE__ */ jsx123(
8104
8206
  FilledButton_default,
8105
8207
  {
@@ -8131,9 +8233,9 @@ var TwoButtonDialog_default = TwoButtonDialog;
8131
8233
 
8132
8234
  // src/components/UserBust/UserBust.tsx
8133
8235
  import { memo as memo25 } from "react";
8134
- import { Avatar as Avatar2, Typography as Typography29 } from "@mui/material";
8135
- import { jsx as jsx124, jsxs as jsxs81 } from "react/jsx-runtime";
8136
- var UserBust = ({ user, avatarProps, typographyProps }) => /* @__PURE__ */ jsxs81("div", { children: [
8236
+ import { Avatar as Avatar2, Typography as Typography30 } from "@mui/material";
8237
+ import { jsx as jsx124, jsxs as jsxs83 } from "react/jsx-runtime";
8238
+ var UserBust = ({ user, avatarProps, typographyProps }) => /* @__PURE__ */ jsxs83("div", { children: [
8137
8239
  /* @__PURE__ */ jsx124(
8138
8240
  Avatar2,
8139
8241
  {
@@ -8142,9 +8244,9 @@ var UserBust = ({ user, avatarProps, typographyProps }) => /* @__PURE__ */ jsxs8
8142
8244
  style: { width: avatarProps.width, height: avatarProps.height }
8143
8245
  }
8144
8246
  ),
8145
- /* @__PURE__ */ jsxs81("div", { style: { paddingTop: 16 }, children: [
8146
- /* @__PURE__ */ jsx124(Typography29, { ...typographyProps.name, children: `${user.first_name} ${user.last_name}` }),
8147
- /* @__PURE__ */ jsx124(Typography29, { ...typographyProps.username, children: user.username })
8247
+ /* @__PURE__ */ jsxs83("div", { style: { paddingTop: 16 }, children: [
8248
+ /* @__PURE__ */ jsx124(Typography30, { ...typographyProps.name, children: `${user.first_name} ${user.last_name}` }),
8249
+ /* @__PURE__ */ jsx124(Typography30, { ...typographyProps.username, children: user.username })
8148
8250
  ] })
8149
8251
  ] });
8150
8252
  var UserBust_default = memo25(UserBust);
@@ -8240,7 +8342,7 @@ export {
8240
8342
  Switch_default as Switch,
8241
8343
  Table_default as Table,
8242
8344
  TableDesktop_default as TableDesktop,
8243
- TableDesktopRowActions,
8345
+ TableDesktopFooter,
8244
8346
  TableDesktopRowCell,
8245
8347
  TableDesktopSmartSelect,
8246
8348
  TableEmptyResult_default as TableEmptyResult,