@natoora-libs/core 0.2.7 → 0.2.61-po-confirmation

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.
@@ -383,7 +383,6 @@ __export(components_exports, {
383
383
  SearchWithFilters: () => SearchWithFilters_default,
384
384
  SearchWithFiltersForTable: () => SearchWithFiltersForTable_default,
385
385
  SectionName: () => SectionName_default,
386
- SmartMultipleSelect: () => SmartMultipleSelect,
387
386
  SmartSelect: () => SmartSelect_default,
388
387
  SmartTableHeader: () => SmartTableHeader,
389
388
  SmartTableHeaderFilterMenu: () => SmartTableHeaderFilterMenu,
@@ -1289,7 +1288,7 @@ var AutocompleteFilterMenuContent = ({
1289
1288
  onFilterOptionChange,
1290
1289
  onApplyFiltersClick,
1291
1290
  shouldShowCheckOnFilter,
1292
- onAutocompleteSearch,
1291
+ onAutocompleteFilterChange,
1293
1292
  filterOptions
1294
1293
  }) => {
1295
1294
  const renderLoading = () => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_material10.Skeleton, { variant: "rounded", height: 26, sx: { m: 1 } });
@@ -1322,7 +1321,7 @@ var AutocompleteFilterMenuContent = ({
1322
1321
  minCharacters: 3,
1323
1322
  sx: { backgroundColor: colors.neutral200 },
1324
1323
  onSearch: (value) => {
1325
- onAutocompleteSearch?.(value);
1324
+ onAutocompleteFilterChange?.(value);
1326
1325
  }
1327
1326
  }
1328
1327
  ),
@@ -7303,113 +7302,18 @@ var SectionName = ({
7303
7302
  };
7304
7303
  var SectionName_default = SectionName;
7305
7304
 
7306
- // src/components/SmartMultipleSelect/SmartMultipleSelect.tsx
7305
+ // src/components/SmartSelect/SmartSelect.tsx
7307
7306
  var import_react34 = require("react");
7308
7307
  var import_material62 = require("@mui/material");
7309
- var import_jsx_runtime115 = require("react/jsx-runtime");
7310
- var SmartMultipleSelect = ({
7311
- inputLabel,
7312
- variant = "standard",
7313
- size,
7314
- values,
7315
- defaultValues,
7316
- onChange,
7317
- onOpen,
7318
- onClose,
7319
- menuOptions,
7320
- isLoading,
7321
- disabled,
7322
- emptyMessage = "No options.",
7323
- helperText
7324
- }) => {
7325
- const [localValues, setLocalValues] = (0, import_react34.useState)(defaultValues ?? []);
7326
- const handleChangeOption = (option) => {
7327
- let newValues = [];
7328
- const selectedIndex = localValues.findIndex(
7329
- (val) => val.value === option.value
7330
- );
7331
- if (selectedIndex === -1) {
7332
- newValues = [...localValues, option];
7333
- } else {
7334
- newValues = localValues.filter((_, i) => i !== selectedIndex);
7335
- }
7336
- setLocalValues(newValues);
7337
- onChange?.(newValues);
7338
- };
7339
- const renderMenuContent = () => !menuOptions?.length ? /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(
7340
- import_material62.Box,
7341
- {
7342
- sx: { display: "flex", justifyContent: "center", alignItems: "center" },
7343
- children: /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(import_material62.Typography, { children: emptyMessage })
7344
- }
7345
- ) : /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(import_material62.Box, { sx: { display: "flex", flexDirection: "column" }, children: menuOptions?.map((option, index) => {
7346
- const selectedValues = values ?? localValues ?? [];
7347
- const isSelected = selectedValues.some(
7348
- (selected) => selected.value === option.value
7349
- );
7350
- return /* @__PURE__ */ (0, import_jsx_runtime115.jsxs)(
7351
- import_material62.Box,
7352
- {
7353
- onClick: () => handleChangeOption(option),
7354
- sx: {
7355
- p: 0.5,
7356
- display: "flex",
7357
- cursor: "pointer",
7358
- backgroundColor: isSelected ? colors.lightBlueBackground : void 0
7359
- },
7360
- children: [
7361
- /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(import_material62.Checkbox, { disableRipple: true, sx: { py: 0.5 }, checked: isSelected }),
7362
- /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(import_material62.ListItemText, { primary: option.label })
7363
- ]
7364
- },
7365
- option.value ?? index
7366
- );
7367
- }) });
7368
- return /* @__PURE__ */ (0, import_jsx_runtime115.jsxs)(import_material62.FormControl, { fullWidth: true, variant, children: [
7369
- /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(import_material62.InputLabel, { children: inputLabel }),
7370
- /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(
7371
- import_material62.Select,
7372
- {
7373
- multiple: true,
7374
- size,
7375
- disabled,
7376
- value: values ?? localValues,
7377
- defaultValue: defaultValues,
7378
- onOpen,
7379
- onClose: () => onClose?.(localValues),
7380
- renderValue: (selectedValues) => {
7381
- const valuesString = selectedValues.map((v) => v.label)?.join(", ");
7382
- return /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(DynamicOverflowTooltip, { tooltipDescription: valuesString, children: valuesString });
7383
- },
7384
- children: isLoading ? /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(
7385
- import_material62.Box,
7386
- {
7387
- sx: {
7388
- display: "flex",
7389
- justifyContent: "center",
7390
- alignItems: "center"
7391
- },
7392
- children: /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(import_material62.CircularProgress, { size: 24 })
7393
- }
7394
- ) : renderMenuContent()
7395
- }
7396
- ),
7397
- helperText && /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(import_material62.FormHelperText, { children: helperText })
7398
- ] });
7399
- };
7400
-
7401
- // src/components/SmartSelect/SmartSelect.tsx
7402
- var import_react35 = require("react");
7403
- var import_material63 = require("@mui/material");
7404
7308
  var import_mui49 = require("tss-react/mui");
7405
- var import_jsx_runtime116 = require("react/jsx-runtime");
7309
+ var import_jsx_runtime115 = require("react/jsx-runtime");
7406
7310
  var useStyles44 = (0, import_mui49.makeStyles)()(() => ({
7407
7311
  container: {
7408
7312
  display: "flex",
7409
7313
  flexDirection: "column"
7410
7314
  }
7411
7315
  }));
7412
- var SmartSelect = (0, import_react35.forwardRef)(
7316
+ var SmartSelect = (0, import_react34.forwardRef)(
7413
7317
  ({
7414
7318
  value,
7415
7319
  defaultOption,
@@ -7429,9 +7333,9 @@ var SmartSelect = (0, import_react35.forwardRef)(
7429
7333
  menuProps
7430
7334
  }, ref) => {
7431
7335
  const { classes } = useStyles44();
7432
- const [open, setOpen] = (0, import_react35.useState)(false);
7433
- const [localOptions, setLocalOptions] = (0, import_react35.useState)(options || []);
7434
- (0, import_react35.useEffect)(() => {
7336
+ const [open, setOpen] = (0, import_react34.useState)(false);
7337
+ const [localOptions, setLocalOptions] = (0, import_react34.useState)(options || []);
7338
+ (0, import_react34.useEffect)(() => {
7435
7339
  if (options) {
7436
7340
  setLocalOptions(options);
7437
7341
  }
@@ -7470,8 +7374,8 @@ var SmartSelect = (0, import_react35.forwardRef)(
7470
7374
  onChange(selectedOption);
7471
7375
  }
7472
7376
  };
7473
- return /* @__PURE__ */ (0, import_jsx_runtime116.jsxs)(
7474
- import_material63.FormControl,
7377
+ return /* @__PURE__ */ (0, import_jsx_runtime115.jsxs)(
7378
+ import_material62.FormControl,
7475
7379
  {
7476
7380
  fullWidth: true,
7477
7381
  size,
@@ -7481,16 +7385,16 @@ var SmartSelect = (0, import_react35.forwardRef)(
7481
7385
  "data-testid": dataTestId,
7482
7386
  disabled,
7483
7387
  children: [
7484
- inputLabel && /* @__PURE__ */ (0, import_jsx_runtime116.jsx)(
7485
- import_material63.InputLabel,
7388
+ inputLabel && /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(
7389
+ import_material62.InputLabel,
7486
7390
  {
7487
7391
  id: "smart-select-label",
7488
7392
  "data-testid": `${dataTestId}-label`,
7489
7393
  children: inputLabel
7490
7394
  }
7491
7395
  ),
7492
- /* @__PURE__ */ (0, import_jsx_runtime116.jsxs)(
7493
- import_material63.Select,
7396
+ /* @__PURE__ */ (0, import_jsx_runtime115.jsxs)(
7397
+ import_material62.Select,
7494
7398
  {
7495
7399
  ref,
7496
7400
  size,
@@ -7507,26 +7411,26 @@ var SmartSelect = (0, import_react35.forwardRef)(
7507
7411
  MenuProps: menuProps,
7508
7412
  label: inputLabel,
7509
7413
  children: [
7510
- isFetching && /* @__PURE__ */ (0, import_jsx_runtime116.jsx)(
7511
- import_material63.MenuItem,
7414
+ isFetching && /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(
7415
+ import_material62.MenuItem,
7512
7416
  {
7513
7417
  disabled: true,
7514
7418
  "data-testid": `${dataTestId}-loading`,
7515
7419
  id: `${dataTestId}-loading`,
7516
- children: /* @__PURE__ */ (0, import_jsx_runtime116.jsx)(import_material63.CircularProgress, { size: 24 })
7420
+ children: /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(import_material62.CircularProgress, { size: 24 })
7517
7421
  }
7518
7422
  ),
7519
- (defaultOption === null || !defaultOptionLabelIsValid || !defaultOptionValueIsValid) && !isFetching && options?.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime116.jsx)(import_material63.MenuItem, { disabled: true, "data-testid": `${dataTestId}-empty-message`, children: emptyMessage }),
7520
- localOptions.length === 0 && !isFetching && options?.length !== 0 && defaultOptionLabelIsValid && defaultOptionValueIsValid && /* @__PURE__ */ (0, import_jsx_runtime116.jsx)(
7521
- import_material63.MenuItem,
7423
+ (defaultOption === null || !defaultOptionLabelIsValid || !defaultOptionValueIsValid) && !isFetching && options?.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(import_material62.MenuItem, { disabled: true, "data-testid": `${dataTestId}-empty-message`, children: emptyMessage }),
7424
+ localOptions.length === 0 && !isFetching && options?.length !== 0 && defaultOptionLabelIsValid && defaultOptionValueIsValid && /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(
7425
+ import_material62.MenuItem,
7522
7426
  {
7523
7427
  value: defaultOption?.value,
7524
7428
  "data-testid": `${dataTestId}-default-option`,
7525
7429
  children: defaultOption?.label
7526
7430
  }
7527
7431
  ),
7528
- !isFetching && combinedOptions.length > 0 && combinedOptions.map((option) => /* @__PURE__ */ (0, import_jsx_runtime116.jsx)(
7529
- import_material63.MenuItem,
7432
+ !isFetching && combinedOptions.length > 0 && combinedOptions.map((option) => /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(
7433
+ import_material62.MenuItem,
7530
7434
  {
7531
7435
  value: option?.value,
7532
7436
  "data-testid": `${dataTestId}-option-${option?.value}`,
@@ -7538,7 +7442,7 @@ var SmartSelect = (0, import_react35.forwardRef)(
7538
7442
  ]
7539
7443
  }
7540
7444
  ),
7541
- helperText && /* @__PURE__ */ (0, import_jsx_runtime116.jsx)(import_material63.FormHelperText, { "data-testid": `${dataTestId}-helper-text`, children: helperText })
7445
+ helperText && /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(import_material62.FormHelperText, { "data-testid": `${dataTestId}-helper-text`, children: helperText })
7542
7446
  ]
7543
7447
  }
7544
7448
  );
@@ -7547,15 +7451,15 @@ var SmartSelect = (0, import_react35.forwardRef)(
7547
7451
  var SmartSelect_default = SmartSelect;
7548
7452
 
7549
7453
  // src/components/SquareLabel/SquareLabel.tsx
7550
- var import_react36 = require("react");
7551
- var import_material64 = require("@mui/material");
7552
- var import_colors52 = require("@mui/material/colors");
7454
+ var import_react35 = require("react");
7455
+ var import_material63 = require("@mui/material");
7456
+ var import_colors51 = require("@mui/material/colors");
7553
7457
  var import_mui50 = require("tss-react/mui");
7554
- var import_jsx_runtime117 = require("react/jsx-runtime");
7458
+ var import_jsx_runtime116 = require("react/jsx-runtime");
7555
7459
  var useStyles45 = (0, import_mui50.makeStyles)()((theme) => ({
7556
7460
  red: {
7557
- backgroundColor: import_colors52.red["50"],
7558
- color: import_colors52.red["500"],
7461
+ backgroundColor: import_colors51.red["50"],
7462
+ color: import_colors51.red["500"],
7559
7463
  padding: theme.spacing(1.5),
7560
7464
  borderRadius: "5px",
7561
7465
  marginTop: theme.spacing(1),
@@ -7566,15 +7470,15 @@ var useStyles45 = (0, import_mui50.makeStyles)()((theme) => ({
7566
7470
  }));
7567
7471
  var SquareLabel = ({ color, copy }) => {
7568
7472
  const { classes } = useStyles45();
7569
- return /* @__PURE__ */ (0, import_jsx_runtime117.jsx)(import_material64.Typography, { className: classes[color], children: copy });
7473
+ return /* @__PURE__ */ (0, import_jsx_runtime116.jsx)(import_material63.Typography, { className: classes[color], children: copy });
7570
7474
  };
7571
- var SquareLabel_default = (0, import_react36.memo)(SquareLabel);
7475
+ var SquareLabel_default = (0, import_react35.memo)(SquareLabel);
7572
7476
 
7573
7477
  // src/components/Switch/Switch.tsx
7574
- var import_react37 = require("react");
7575
- var import_material65 = require("@mui/material");
7478
+ var import_react36 = require("react");
7479
+ var import_material64 = require("@mui/material");
7576
7480
  var import_mui51 = require("tss-react/mui");
7577
- var import_jsx_runtime118 = require("react/jsx-runtime");
7481
+ var import_jsx_runtime117 = require("react/jsx-runtime");
7578
7482
  var LSwitch = ({
7579
7483
  checked,
7580
7484
  labelOn,
@@ -7582,8 +7486,8 @@ var LSwitch = ({
7582
7486
  handleChange,
7583
7487
  classes,
7584
7488
  disabled
7585
- }) => /* @__PURE__ */ (0, import_jsx_runtime118.jsx)("div", { className: classes.c_switch, children: /* @__PURE__ */ (0, import_jsx_runtime118.jsxs)(
7586
- import_material65.Grid,
7489
+ }) => /* @__PURE__ */ (0, import_jsx_runtime117.jsx)("div", { className: classes.c_switch, children: /* @__PURE__ */ (0, import_jsx_runtime117.jsxs)(
7490
+ import_material64.Grid,
7587
7491
  {
7588
7492
  component: "label",
7589
7493
  container: true,
@@ -7592,9 +7496,9 @@ var LSwitch = ({
7592
7496
  alignItems: "center"
7593
7497
  },
7594
7498
  children: [
7595
- labelOff && /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(import_material65.Grid, { children: labelOff }),
7596
- /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(import_material65.Grid, { children: /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(
7597
- import_material65.Switch,
7499
+ labelOff && /* @__PURE__ */ (0, import_jsx_runtime117.jsx)(import_material64.Grid, { children: labelOff }),
7500
+ /* @__PURE__ */ (0, import_jsx_runtime117.jsx)(import_material64.Grid, { children: /* @__PURE__ */ (0, import_jsx_runtime117.jsx)(
7501
+ import_material64.Switch,
7598
7502
  {
7599
7503
  checked,
7600
7504
  color: "primary",
@@ -7602,7 +7506,7 @@ var LSwitch = ({
7602
7506
  disabled
7603
7507
  }
7604
7508
  ) }),
7605
- labelOn && /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(import_material65.Grid, { children: labelOn })
7509
+ labelOn && /* @__PURE__ */ (0, import_jsx_runtime117.jsx)(import_material64.Grid, { children: labelOn })
7606
7510
  ]
7607
7511
  }
7608
7512
  ) });
@@ -7624,13 +7528,13 @@ var LabelledSwitch = (0, import_mui51.withStyles)(LSwitch, (theme) => ({
7624
7528
  fontSize: "1rem"
7625
7529
  }
7626
7530
  }));
7627
- var Switch_default = (0, import_react37.memo)(LabelledSwitch);
7531
+ var Switch_default = (0, import_react36.memo)(LabelledSwitch);
7628
7532
 
7629
7533
  // src/components/SmartTableHeaderFilterMenu/SmartTableHeaderFilterMenu.tsx
7630
- var import_react38 = require("react");
7631
- var import_material66 = require("@mui/material");
7534
+ var import_react37 = require("react");
7535
+ var import_material65 = require("@mui/material");
7632
7536
  var import_classnames3 = __toESM(require("classnames"), 1);
7633
- var import_jsx_runtime119 = require("react/jsx-runtime");
7537
+ var import_jsx_runtime118 = require("react/jsx-runtime");
7634
7538
  var MAX_WIDTH = 276;
7635
7539
  var findFilterIndex = (filters, filterOption) => filters.findIndex((item) => {
7636
7540
  if (typeof item === "string" && typeof filterOption === "string") {
@@ -7641,138 +7545,138 @@ var findFilterIndex = (filters, filterOption) => filters.findIndex((item) => {
7641
7545
  }
7642
7546
  return false;
7643
7547
  });
7644
- var SmartTableHeaderFilterMenu = ({
7645
- headCell,
7646
- numActiveFilters,
7647
- headerFilters,
7648
- shouldShowCheckOnFilter,
7649
- onApplyFilters
7650
- }) => {
7651
- const [anchorEl, setAnchorEl] = (0, import_react38.useState)(null);
7652
- const [filterOptionsData, setFilterOptionsData] = (0, import_react38.useState)();
7653
- const [selectedFilterOptions, setSelectedFilterOptions] = (0, import_react38.useState)(headerFilters[headCell.id] ?? []);
7654
- const numFilterOptions = filterOptionsData?.length ?? 0;
7655
- (0, import_react38.useEffect)(() => {
7656
- if (headCell.filterOptions) {
7657
- setFilterOptionsData(headCell.filterOptions);
7658
- } else if (headCell.filterType === "boolean") {
7659
- setFilterOptionsData([
7660
- { id: "true", label: "Yes" },
7661
- { id: "false", label: "No" }
7662
- ]);
7663
- }
7664
- }, [headCell.filterOptions]);
7665
- const handleFilterMenuOpen = (event) => {
7666
- if (!numFilterOptions && headCell.filterType === "default") {
7667
- headCell.refetchFilterOptions?.();
7668
- }
7669
- setAnchorEl(event.currentTarget);
7670
- };
7671
- const handleFilterMenuClose = () => {
7672
- setSelectedFilterOptions(headerFilters[headCell.id]);
7673
- setAnchorEl(null);
7674
- };
7675
- const handleSelectAllChange = (checked) => {
7676
- if (checked) {
7677
- setSelectedFilterOptions([
7678
- ...filterOptionsData ?? []
7679
- ]);
7680
- return;
7681
- }
7682
- setSelectedFilterOptions([]);
7683
- };
7684
- const handleFilterOptionChange = (option) => {
7685
- const selectedIndex = findFilterIndex(selectedFilterOptions, option);
7686
- let newSelected;
7687
- if (selectedIndex === -1) {
7688
- if (typeof option === "string") {
7689
- newSelected = [...selectedFilterOptions, option];
7690
- } else {
7691
- newSelected = [
7692
- ...selectedFilterOptions,
7693
- option
7694
- ];
7548
+ var SmartTableHeaderFilterMenu = (0, import_react37.memo)(
7549
+ ({
7550
+ headCell,
7551
+ numActiveFilters,
7552
+ headerFilters,
7553
+ shouldShowCheckOnFilter,
7554
+ onApplyFilters
7555
+ }) => {
7556
+ const [anchorEl, setAnchorEl] = (0, import_react37.useState)(null);
7557
+ const [filterOptionsData, setFilterOptionsData] = (0, import_react37.useState)();
7558
+ const [selectedFilterOptions, setSelectedFilterOptions] = (0, import_react37.useState)(headerFilters[headCell.id] ?? []);
7559
+ (0, import_react37.useEffect)(() => {
7560
+ if (headCell.filterOptions) {
7561
+ setFilterOptionsData(headCell.filterOptions);
7695
7562
  }
7696
- } else {
7697
- newSelected = selectedFilterOptions.filter(
7698
- (_, index) => index !== selectedIndex
7699
- );
7700
- }
7701
- setSelectedFilterOptions(newSelected);
7702
- };
7703
- const handleApplyFiltersClick = (shouldSave) => {
7704
- const updatedFilters = {
7705
- ...headerFilters,
7706
- [headCell.id]: [...selectedFilterOptions]
7563
+ }, [headCell.filterOptions]);
7564
+ const numFilterOptions = (0, import_react37.useMemo)(
7565
+ () => filterOptionsData?.length ?? 0,
7566
+ [filterOptionsData?.length]
7567
+ );
7568
+ const handleFilterMenuOpen = (event) => {
7569
+ if (!numFilterOptions && !headCell.isAutocompleteFilterMenu) {
7570
+ headCell.refetchFilterOptions?.();
7571
+ }
7572
+ setAnchorEl(event.currentTarget);
7707
7573
  };
7708
- onApplyFilters?.(updatedFilters, shouldSave);
7709
- setAnchorEl(null);
7710
- };
7711
- (0, import_react38.useEffect)(() => {
7712
- setSelectedFilterOptions(headerFilters[headCell.id] ?? []);
7713
- }, [headerFilters, headCell.id]);
7714
- return /* @__PURE__ */ (0, import_jsx_runtime119.jsxs)(import_jsx_runtime119.Fragment, { children: [
7715
- /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(
7716
- ActiveFiltersIconButton,
7717
- {
7718
- numActiveFilters,
7719
- handleClick: handleFilterMenuOpen,
7720
- className: (0, import_classnames3.default)("filter-menu-trigger", {
7721
- "has-active-filters": !!numActiveFilters || !!anchorEl
7722
- })
7574
+ const handleFilterMenuClose = () => {
7575
+ setSelectedFilterOptions(headerFilters[headCell.id]);
7576
+ setAnchorEl(null);
7577
+ };
7578
+ const handleSelectAllChange = (checked) => {
7579
+ if (checked) {
7580
+ setSelectedFilterOptions([
7581
+ ...filterOptionsData ?? []
7582
+ ]);
7583
+ return;
7723
7584
  }
7724
- ),
7725
- /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(
7726
- import_material66.Menu,
7727
- {
7728
- open: !!anchorEl,
7729
- onClose: handleFilterMenuClose,
7730
- anchorEl,
7731
- "data-testid": "filter-menu",
7732
- slotProps: {
7733
- list: {
7734
- sx: { p: 0, maxWidth: MAX_WIDTH }
7735
- }
7736
- },
7737
- anchorOrigin: { vertical: "bottom", horizontal: "right" },
7738
- transformOrigin: { vertical: "top", horizontal: "right" },
7739
- children: headCell.filterType === "autocomplete" ? /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(
7740
- AutocompleteFilterMenuContent,
7741
- {
7742
- columnId: headCell.id,
7743
- labelFieldName: headCell.fieldName ?? "",
7744
- isLoading: headCell.isFetchingFilterOptions,
7745
- filterOptions: filterOptionsData,
7746
- onAutocompleteSearch: headCell.onAutocompleteSearch,
7747
- selectedFilterOptions,
7748
- onFilterOptionChange: handleFilterOptionChange,
7749
- onApplyFiltersClick: handleApplyFiltersClick,
7750
- shouldShowCheckOnFilter
7751
- }
7752
- ) : /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(
7753
- CheckboxFilterMenuContent,
7754
- {
7755
- columnId: headCell.id,
7756
- labelFieldName: headCell.fieldName ?? "",
7757
- isLoading: headCell.isFetchingFilterOptions,
7758
- selectedFilterOptions,
7759
- filterOptions: filterOptionsData ?? [],
7760
- onSelectAllChange: handleSelectAllChange,
7761
- onFilterOptionChange: handleFilterOptionChange,
7762
- onApplyFiltersClick: handleApplyFiltersClick,
7763
- shouldShowCheckOnFilter
7764
- }
7765
- )
7585
+ setSelectedFilterOptions([]);
7586
+ };
7587
+ const handleFilterOptionChange = (option) => {
7588
+ const selectedIndex = findFilterIndex(selectedFilterOptions, option);
7589
+ let newSelected;
7590
+ if (selectedIndex === -1) {
7591
+ if (typeof option === "string") {
7592
+ newSelected = [...selectedFilterOptions, option];
7593
+ } else {
7594
+ newSelected = [
7595
+ ...selectedFilterOptions,
7596
+ option
7597
+ ];
7598
+ }
7599
+ } else {
7600
+ newSelected = selectedFilterOptions.filter(
7601
+ (_, index) => index !== selectedIndex
7602
+ );
7766
7603
  }
7767
- )
7768
- ] });
7769
- };
7604
+ setSelectedFilterOptions(newSelected);
7605
+ };
7606
+ const handleApplyFiltersClick = (shouldSave) => {
7607
+ const updatedFilters = {
7608
+ ...headerFilters,
7609
+ [headCell.id]: [...selectedFilterOptions]
7610
+ };
7611
+ onApplyFilters?.(updatedFilters, shouldSave);
7612
+ setAnchorEl(null);
7613
+ };
7614
+ (0, import_react37.useEffect)(() => {
7615
+ setSelectedFilterOptions(headerFilters[headCell.id] ?? []);
7616
+ }, [headerFilters, headCell.id]);
7617
+ return /* @__PURE__ */ (0, import_jsx_runtime118.jsxs)(import_jsx_runtime118.Fragment, { children: [
7618
+ /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(
7619
+ ActiveFiltersIconButton,
7620
+ {
7621
+ numActiveFilters,
7622
+ handleClick: handleFilterMenuOpen,
7623
+ className: (0, import_classnames3.default)("filter-menu-trigger", {
7624
+ "has-active-filters": !!numActiveFilters || !!anchorEl
7625
+ })
7626
+ }
7627
+ ),
7628
+ /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(
7629
+ import_material65.Menu,
7630
+ {
7631
+ open: !!anchorEl,
7632
+ onClose: handleFilterMenuClose,
7633
+ anchorEl,
7634
+ "data-testid": "filter-menu",
7635
+ slotProps: {
7636
+ list: {
7637
+ sx: { p: 0, maxWidth: MAX_WIDTH }
7638
+ }
7639
+ },
7640
+ anchorOrigin: { vertical: "bottom", horizontal: "right" },
7641
+ transformOrigin: { vertical: "top", horizontal: "right" },
7642
+ children: headCell.isAutocompleteFilterMenu ? /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(
7643
+ AutocompleteFilterMenuContent,
7644
+ {
7645
+ columnId: headCell.id,
7646
+ labelFieldName: headCell.fieldName ?? "",
7647
+ isLoading: headCell.isFetchingFilterOptions,
7648
+ filterOptions: headCell.filterOptions,
7649
+ onAutocompleteFilterChange: headCell.onAutocompleteFilterChange,
7650
+ selectedFilterOptions,
7651
+ onFilterOptionChange: handleFilterOptionChange,
7652
+ onApplyFiltersClick: handleApplyFiltersClick,
7653
+ shouldShowCheckOnFilter
7654
+ }
7655
+ ) : /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(
7656
+ CheckboxFilterMenuContent,
7657
+ {
7658
+ columnId: headCell.id,
7659
+ labelFieldName: headCell.fieldName ?? "",
7660
+ isLoading: headCell.isFetchingFilterOptions,
7661
+ selectedFilterOptions,
7662
+ filterOptions: filterOptionsData ?? [],
7663
+ onSelectAllChange: handleSelectAllChange,
7664
+ onFilterOptionChange: handleFilterOptionChange,
7665
+ onApplyFiltersClick: handleApplyFiltersClick,
7666
+ shouldShowCheckOnFilter
7667
+ }
7668
+ )
7669
+ }
7670
+ )
7671
+ ] });
7672
+ }
7673
+ );
7770
7674
 
7771
7675
  // src/components/SmartTableHeader/SmartTableHeader.tsx
7772
- var import_react39 = require("react");
7773
- var import_material67 = require("@mui/material");
7774
- var import_jsx_runtime120 = require("react/jsx-runtime");
7775
- var SmartTableHeader = (0, import_react39.memo)(
7676
+ var import_react38 = require("react");
7677
+ var import_material66 = require("@mui/material");
7678
+ var import_jsx_runtime119 = require("react/jsx-runtime");
7679
+ var SmartTableHeader = (0, import_react38.memo)(
7776
7680
  ({
7777
7681
  order,
7778
7682
  orderBy,
@@ -7790,26 +7694,19 @@ var SmartTableHeader = (0, import_react39.memo)(
7790
7694
  onRequestSort(event, property);
7791
7695
  };
7792
7696
  const isSortActive = (headCellId) => orderBy === headCellId;
7793
- return /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(import_material67.TableHead, { children: /* @__PURE__ */ (0, import_jsx_runtime120.jsxs)(import_material67.TableRow, { children: [
7794
- enableCheckboxSelection ? /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(
7795
- import_material67.TableCell,
7697
+ return /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(import_material66.TableHead, { children: /* @__PURE__ */ (0, import_jsx_runtime119.jsxs)(import_material66.TableRow, { children: [
7698
+ enableCheckboxSelection ? /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(import_material66.TableCell, { padding: "checkbox", children: /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(
7699
+ import_material66.Checkbox,
7796
7700
  {
7797
- padding: "checkbox",
7798
- sx: { backgroundColor: colors.neutral100 },
7799
- children: /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(
7800
- import_material67.Checkbox,
7801
- {
7802
- color: "primary",
7803
- disableRipple: true,
7804
- indeterminate: numSelectedRows > 0 && numSelectedRows < numRows,
7805
- checked: numRows > 0 && numSelectedRows === numRows,
7806
- onChange: onSelectAllClick
7807
- }
7808
- )
7701
+ color: "primary",
7702
+ disableRipple: true,
7703
+ indeterminate: numSelectedRows > 0 && numSelectedRows < numRows,
7704
+ checked: numRows > 0 && numSelectedRows === numRows,
7705
+ onChange: onSelectAllClick
7809
7706
  }
7810
- ) : null,
7811
- headCells.map((headCell) => /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(
7812
- import_material67.TableCell,
7707
+ ) }) : null,
7708
+ headCells.map((headCell) => /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(
7709
+ import_material66.TableCell,
7813
7710
  {
7814
7711
  align: "left",
7815
7712
  width: headCell.width ?? "auto",
@@ -7832,23 +7729,31 @@ var SmartTableHeader = (0, import_react39.memo)(
7832
7729
  }
7833
7730
  }
7834
7731
  },
7835
- children: /* @__PURE__ */ (0, import_jsx_runtime120.jsxs)(
7836
- import_material67.Box,
7732
+ children: /* @__PURE__ */ (0, import_jsx_runtime119.jsxs)(
7733
+ import_material66.Box,
7837
7734
  {
7838
7735
  display: "flex",
7839
7736
  flexDirection: "row",
7840
7737
  gap: headCell.disableSort ? 1 : 0,
7841
7738
  children: [
7842
- headCell.disableSort ? headCell.renderHeader ?? /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(import_material67.Tooltip, { title: headCell.labelTooltip ?? "", arrow: true, children: /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(import_material67.Typography, { variant: "subtitle2", mt: 0.25, mb: -0.25, children: headCell.label }) }) : /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(import_material67.Tooltip, { title: headCell.labelTooltip ?? "", arrow: true, children: /* @__PURE__ */ (0, import_jsx_runtime120.jsxs)(
7843
- import_material67.TableSortLabel,
7739
+ headCell.disableSort ? headCell.RenderHeader ?? /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(import_material66.Tooltip, { title: headCell.labelTooltip ?? "", arrow: true, children: /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(
7740
+ import_material66.Typography,
7741
+ {
7742
+ variant: "subtitle2",
7743
+ mt: 0.25,
7744
+ fontWeight: 600,
7745
+ children: headCell.label
7746
+ }
7747
+ ) }) : /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(import_material66.Tooltip, { title: headCell.labelTooltip ?? "", arrow: true, children: /* @__PURE__ */ (0, import_jsx_runtime119.jsxs)(
7748
+ import_material66.TableSortLabel,
7844
7749
  {
7845
7750
  "data-testid": "table-sort-label",
7846
7751
  active: isSortActive(headCell.id),
7847
7752
  direction: orderBy === headCell.id ? order : "asc",
7848
7753
  onClick: createSortHandler(headCell.id),
7849
7754
  children: [
7850
- headCell.renderHeader ?? headCell.label,
7851
- orderBy === headCell.id ? /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(
7755
+ headCell.RenderHeader ?? headCell.label,
7756
+ orderBy === headCell.id ? /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(
7852
7757
  "span",
7853
7758
  {
7854
7759
  style: {
@@ -7868,7 +7773,7 @@ var SmartTableHeader = (0, import_react39.memo)(
7868
7773
  ]
7869
7774
  }
7870
7775
  ) }),
7871
- headCell.filterType ? /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(
7776
+ headCell.refetchFilterOptions ? /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(
7872
7777
  SmartTableHeaderFilterMenu,
7873
7778
  {
7874
7779
  headCell,
@@ -7889,20 +7794,20 @@ var SmartTableHeader = (0, import_react39.memo)(
7889
7794
  );
7890
7795
 
7891
7796
  // src/components/Table/Table.tsx
7892
- var import_react40 = require("react");
7893
- var import_material69 = require("@mui/material");
7797
+ var import_react39 = require("react");
7798
+ var import_material68 = require("@mui/material");
7894
7799
  var import_debounce = __toESM(require_debounce(), 1);
7895
7800
  var import_mui52 = require("tss-react/mui");
7896
7801
  var import_uuid = require("uuid");
7897
7802
 
7898
7803
  // src/components/TableLoading/TableLoading.tsx
7899
- var import_material68 = require("@mui/material");
7900
- var import_jsx_runtime121 = require("react/jsx-runtime");
7804
+ var import_material67 = require("@mui/material");
7805
+ var import_jsx_runtime120 = require("react/jsx-runtime");
7901
7806
  var TableLoading = ({
7902
7807
  rowsPerPage,
7903
7808
  rowHeight
7904
- }) => /* @__PURE__ */ (0, import_jsx_runtime121.jsx)(import_material68.Box, { children: Array.from({ length: rowsPerPage ?? 0 }).map((_, index) => /* @__PURE__ */ (0, import_jsx_runtime121.jsx)(
7905
- import_material68.Skeleton,
7809
+ }) => /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(import_material67.Box, { children: Array.from({ length: rowsPerPage ?? 0 }).map((_, index) => /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(
7810
+ import_material67.Skeleton,
7906
7811
  {
7907
7812
  animation: "pulse",
7908
7813
  "data-testid": "table-loading-skeleton",
@@ -7950,7 +7855,7 @@ function calculateRowsPerPage(rowHeight) {
7950
7855
  }
7951
7856
 
7952
7857
  // src/components/Table/Table.tsx
7953
- var import_jsx_runtime122 = require("react/jsx-runtime");
7858
+ var import_jsx_runtime121 = require("react/jsx-runtime");
7954
7859
  var useStyles46 = (0, import_mui52.makeStyles)()(() => ({
7955
7860
  root: {
7956
7861
  height: "calc(100vh - 262px)",
@@ -7985,11 +7890,11 @@ var Table = ({
7985
7890
  serverRendered,
7986
7891
  updateSort
7987
7892
  }) => {
7988
- const [order, setOrder] = (0, import_react40.useState)(appliedFilters?.sortDir || "desc");
7989
- const [orderBy, setOrderBy] = (0, import_react40.useState)(
7893
+ const [order, setOrder] = (0, import_react39.useState)(appliedFilters?.sortDir || "desc");
7894
+ const [orderBy, setOrderBy] = (0, import_react39.useState)(
7990
7895
  appliedFilters?.sortField || "delivery_date"
7991
7896
  );
7992
- const [rowsPerPage, setRowsPerPage] = (0, import_react40.useState)(defaultRowsPerPage);
7897
+ const [rowsPerPage, setRowsPerPage] = (0, import_react39.useState)(defaultRowsPerPage);
7993
7898
  const { classes } = useStyles46();
7994
7899
  const rowHeight = 56;
7995
7900
  const emptyRows = rowsPerPage - Math.min(rowsPerPage, data.length - page * rowsPerPage);
@@ -8002,7 +7907,7 @@ var Table = ({
8002
7907
  updateSort(property, orderDir);
8003
7908
  }
8004
7909
  };
8005
- (0, import_react40.useLayoutEffect)(() => {
7910
+ (0, import_react39.useLayoutEffect)(() => {
8006
7911
  if (!doNotCalculateRows) {
8007
7912
  return;
8008
7913
  }
@@ -8028,25 +7933,25 @@ var Table = ({
8028
7933
  );
8029
7934
  const rowsComponents = rows.map((row) => {
8030
7935
  if (RenderItem) {
8031
- return /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(RenderItem, { ...row }, row.id);
7936
+ return /* @__PURE__ */ (0, import_jsx_runtime121.jsx)(RenderItem, { ...row }, row.id);
8032
7937
  }
8033
- return /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(import_material69.TableRow, { hover: true, onClick: () => onRowClick?.(row), children: headCells?.map((column) => /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(import_material69.TableCell, { children: row[column.id] }, column.id)) }, row.id);
7938
+ return /* @__PURE__ */ (0, import_jsx_runtime121.jsx)(import_material68.TableRow, { hover: true, onClick: () => onRowClick?.(row), children: headCells?.map((column) => /* @__PURE__ */ (0, import_jsx_runtime121.jsx)(import_material68.TableCell, { children: row[column.id] }, column.id)) }, row.id);
8034
7939
  });
8035
7940
  if (emptyRows > 0 && rowsPerPage > emptyRows) {
8036
7941
  rowsComponents.push(
8037
- /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(import_material69.TableRow, { style: { height: rowHeight * emptyRows }, children: /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(import_material69.TableCell, { colSpan: 8 }) }, (0, import_uuid.v4)())
7942
+ /* @__PURE__ */ (0, import_jsx_runtime121.jsx)(import_material68.TableRow, { style: { height: rowHeight * emptyRows }, children: /* @__PURE__ */ (0, import_jsx_runtime121.jsx)(import_material68.TableCell, { colSpan: 8 }) }, (0, import_uuid.v4)())
8038
7943
  );
8039
7944
  }
8040
7945
  return rowsComponents;
8041
7946
  };
8042
- return /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(import_material69.Paper, { className: classes.root, children: /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(import_material69.Box, { className: classes.paper, children: isLoading ? /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(TableLoading_default, { rowHeight, rowsPerPage }) : /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(import_material69.TableContainer, { className: classes.container, children: /* @__PURE__ */ (0, import_jsx_runtime122.jsxs)(import_material69.Table, { size: "medium", stickyHeader: true, children: [
8043
- /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(import_material69.TableHead, { className: classes.header, children: /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(import_material69.TableRow, { children: headCells?.map((headCell) => /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(
8044
- import_material69.TableCell,
7947
+ return /* @__PURE__ */ (0, import_jsx_runtime121.jsx)(import_material68.Paper, { className: classes.root, children: /* @__PURE__ */ (0, import_jsx_runtime121.jsx)(import_material68.Box, { className: classes.paper, children: isLoading ? /* @__PURE__ */ (0, import_jsx_runtime121.jsx)(TableLoading_default, { rowHeight, rowsPerPage }) : /* @__PURE__ */ (0, import_jsx_runtime121.jsx)(import_material68.TableContainer, { className: classes.container, children: /* @__PURE__ */ (0, import_jsx_runtime121.jsxs)(import_material68.Table, { size: "medium", stickyHeader: true, children: [
7948
+ /* @__PURE__ */ (0, import_jsx_runtime121.jsx)(import_material68.TableHead, { className: classes.header, children: /* @__PURE__ */ (0, import_jsx_runtime121.jsx)(import_material68.TableRow, { children: headCells?.map((headCell) => /* @__PURE__ */ (0, import_jsx_runtime121.jsx)(
7949
+ import_material68.TableCell,
8045
7950
  {
8046
7951
  align: "left",
8047
7952
  sortDirection: orderBy === headCell.id ? order : void 0,
8048
- children: /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(
8049
- import_material69.TableSortLabel,
7953
+ children: /* @__PURE__ */ (0, import_jsx_runtime121.jsx)(
7954
+ import_material68.TableSortLabel,
8050
7955
  {
8051
7956
  active: orderBy === headCell.id,
8052
7957
  direction: orderBy === headCell.id ? order : "asc",
@@ -8057,29 +7962,29 @@ var Table = ({
8057
7962
  },
8058
7963
  headCell.id
8059
7964
  )) }) }),
8060
- /* @__PURE__ */ (0, import_jsx_runtime122.jsxs)(import_material69.TableBody, { children: [
7965
+ /* @__PURE__ */ (0, import_jsx_runtime121.jsxs)(import_material68.TableBody, { children: [
8061
7966
  getTableRows(),
8062
- rowsPerPage === emptyRows && /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(import_material69.TableRow, { style: { height: rowHeight * emptyRows }, children: /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(import_material69.TableCell, { colSpan: 8, align: "center", children: "Nothing to display" }) })
7967
+ rowsPerPage === emptyRows && /* @__PURE__ */ (0, import_jsx_runtime121.jsx)(import_material68.TableRow, { style: { height: rowHeight * emptyRows }, children: /* @__PURE__ */ (0, import_jsx_runtime121.jsx)(import_material68.TableCell, { colSpan: 8, align: "center", children: "Nothing to display" }) })
8063
7968
  ] })
8064
7969
  ] }) }) }) });
8065
7970
  };
8066
7971
  var Table_default = Table;
8067
7972
 
8068
7973
  // src/components/TableDesktop/TableDesktop.tsx
8069
- var import_react41 = require("react");
8070
- var import_material74 = require("@mui/material");
7974
+ var import_react40 = require("react");
7975
+ var import_material73 = require("@mui/material");
8071
7976
 
8072
7977
  // src/components/TableDesktopLoadingState/TableDesktopLoadingState.tsx
8073
- var import_material70 = require("@mui/material");
8074
- var import_jsx_runtime123 = require("react/jsx-runtime");
7978
+ var import_material69 = require("@mui/material");
7979
+ var import_jsx_runtime122 = require("react/jsx-runtime");
8075
7980
  var getRange = (n) => Array.from({ length: n }, (_, i) => i + 1);
8076
7981
  var TableDesktopLoadingState = ({
8077
7982
  numRows,
8078
7983
  numColumns,
8079
7984
  rowHeight = 56
8080
7985
  }) => {
8081
- return getRange(numRows).map((rowNum) => /* @__PURE__ */ (0, import_jsx_runtime123.jsx)(import_material70.TableRow, { children: getRange(numColumns).map((colNum) => /* @__PURE__ */ (0, import_jsx_runtime123.jsx)(import_material70.TableCell, { children: /* @__PURE__ */ (0, import_jsx_runtime123.jsx)(
8082
- import_material70.Skeleton,
7986
+ return getRange(numRows).map((rowNum) => /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(import_material69.TableRow, { children: getRange(numColumns).map((colNum) => /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(import_material69.TableCell, { children: /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(
7987
+ import_material69.Skeleton,
8083
7988
  {
8084
7989
  animation: "pulse",
8085
7990
  variant: "rounded",
@@ -8097,11 +8002,11 @@ var import_TableRow = __toESM(require("@mui/material/TableRow"), 1);
8097
8002
  var import_Typography = __toESM(require("@mui/material/Typography"), 1);
8098
8003
 
8099
8004
  // src/components/Buttons/BaseButton/BaseIconButton.tsx
8100
- var import_material71 = require("@mui/material");
8101
- var import_jsx_runtime124 = require("react/jsx-runtime");
8005
+ var import_material70 = require("@mui/material");
8006
+ var import_jsx_runtime123 = require("react/jsx-runtime");
8102
8007
  var BaseIconButton = ({ icon, sx, ...props }) => {
8103
- return /* @__PURE__ */ (0, import_jsx_runtime124.jsxs)(
8104
- import_material71.Button,
8008
+ return /* @__PURE__ */ (0, import_jsx_runtime123.jsxs)(
8009
+ import_material70.Button,
8105
8010
  {
8106
8011
  sx: {
8107
8012
  display: "flex",
@@ -8121,10 +8026,10 @@ var BaseIconButton = ({ icon, sx, ...props }) => {
8121
8026
  };
8122
8027
 
8123
8028
  // src/components/TableDesktopNoColumnsMessage/TableDesktopNoColumnsMessage.tsx
8124
- var import_jsx_runtime125 = require("react/jsx-runtime");
8029
+ var import_jsx_runtime124 = require("react/jsx-runtime");
8125
8030
  var TableDesktopNoColumnsMessage = ({
8126
8031
  onClickNoColumnsMessageOpenMenu
8127
- }) => /* @__PURE__ */ (0, import_jsx_runtime125.jsx)(import_TableBody.default, { children: /* @__PURE__ */ (0, import_jsx_runtime125.jsx)(import_TableRow.default, { children: /* @__PURE__ */ (0, import_jsx_runtime125.jsxs)(
8032
+ }) => /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(import_TableBody.default, { children: /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(import_TableRow.default, { children: /* @__PURE__ */ (0, import_jsx_runtime124.jsxs)(
8128
8033
  import_TableCell.default,
8129
8034
  {
8130
8035
  sx: {
@@ -8137,9 +8042,9 @@ var TableDesktopNoColumnsMessage = ({
8137
8042
  alignItems: "center"
8138
8043
  },
8139
8044
  children: [
8140
- /* @__PURE__ */ (0, import_jsx_runtime125.jsx)(import_Typography.default, { variant: "subtitle2", fontSize: 16, children: "Customise your view" }),
8141
- /* @__PURE__ */ (0, import_jsx_runtime125.jsx)(import_Typography.default, { variant: "subtitle1", align: "center", color: "textSecondary", children: "Open the menu to customise your table and search." }),
8142
- /* @__PURE__ */ (0, import_jsx_runtime125.jsxs)(
8045
+ /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(import_Typography.default, { variant: "subtitle2", fontSize: 16, children: "Customise your view" }),
8046
+ /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(import_Typography.default, { variant: "subtitle1", align: "center", color: "textSecondary", children: "Open the menu to customise your table and search." }),
8047
+ /* @__PURE__ */ (0, import_jsx_runtime124.jsxs)(
8143
8048
  import_Typography.default,
8144
8049
  {
8145
8050
  variant: "subtitle1",
@@ -8152,18 +8057,18 @@ var TableDesktopNoColumnsMessage = ({
8152
8057
  },
8153
8058
  children: [
8154
8059
  "Tips: ",
8155
- /* @__PURE__ */ (0, import_jsx_runtime125.jsx)(import_Typography.default, { component: "strong", children: "Save as default" }),
8060
+ /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(import_Typography.default, { component: "strong", children: "Save as default" }),
8156
8061
  " to keep these columns for future views"
8157
8062
  ]
8158
8063
  }
8159
8064
  ),
8160
- /* @__PURE__ */ (0, import_jsx_runtime125.jsx)(
8065
+ /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(
8161
8066
  BaseIconButton,
8162
8067
  {
8163
8068
  variant: "contained",
8164
8069
  color: "primary",
8165
8070
  onClick: onClickNoColumnsMessageOpenMenu,
8166
- icon: /* @__PURE__ */ (0, import_jsx_runtime125.jsx)(IconTableEdit_default, { fill: colors.white }),
8071
+ icon: /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(IconTableEdit_default, { fill: colors.white }),
8167
8072
  children: "OPEN MENU"
8168
8073
  }
8169
8074
  )
@@ -8172,7 +8077,7 @@ var TableDesktopNoColumnsMessage = ({
8172
8077
  ) }) });
8173
8078
 
8174
8079
  // src/components/TableDesktopRows/TableDesktopRows.tsx
8175
- var import_jsx_runtime126 = require("react/jsx-runtime");
8080
+ var import_jsx_runtime125 = require("react/jsx-runtime");
8176
8081
  var descendingComparator2 = (a, b, orderBy) => {
8177
8082
  const objA = a[orderBy];
8178
8083
  const objB = b[orderBy];
@@ -8218,7 +8123,7 @@ var TableDesktopRows = ({
8218
8123
  const sortedData = disableInternalSort ? data : stableSort2(data, getComparator(order, orderBy));
8219
8124
  return sortedData.map((row, index) => {
8220
8125
  const isItemSelected = selectedRows.has(row[keyField]);
8221
- return /* @__PURE__ */ (0, import_jsx_runtime126.jsx)(
8126
+ return /* @__PURE__ */ (0, import_jsx_runtime125.jsx)(
8222
8127
  RenderItem,
8223
8128
  {
8224
8129
  ...{
@@ -8240,8 +8145,8 @@ var TableDesktopRows = ({
8240
8145
  };
8241
8146
 
8242
8147
  // src/components/TableDesktopRowSelectionBar/TableDesktopRowSelectionBar.tsx
8243
- var import_material72 = require("@mui/material");
8244
- var import_jsx_runtime127 = require("react/jsx-runtime");
8148
+ var import_material71 = require("@mui/material");
8149
+ var import_jsx_runtime126 = require("react/jsx-runtime");
8245
8150
  var TableDesktopRowSelectionBar = ({
8246
8151
  isEveryRowInPageSelected,
8247
8152
  isRowsFromAllPagesSelected,
@@ -8260,8 +8165,8 @@ var TableDesktopRowSelectionBar = ({
8260
8165
  }
8261
8166
  return `${numSelectedRows} row${numSelectedRows > 1 ? "s" : ""} selected.`;
8262
8167
  };
8263
- return isAnyRowSelected ? /* @__PURE__ */ (0, import_jsx_runtime127.jsxs)(
8264
- import_material72.Box,
8168
+ return isAnyRowSelected ? /* @__PURE__ */ (0, import_jsx_runtime126.jsxs)(
8169
+ import_material71.Box,
8265
8170
  {
8266
8171
  sx: {
8267
8172
  p: 1,
@@ -8273,22 +8178,22 @@ var TableDesktopRowSelectionBar = ({
8273
8178
  backgroundColor: colors.neutral150
8274
8179
  },
8275
8180
  children: [
8276
- /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(import_material72.Typography, { children: getSelectedRowsText() }),
8277
- !isRowsFromAllPagesSelected ? /* @__PURE__ */ (0, import_jsx_runtime127.jsxs)(import_material72.Button, { onClick: onSelectRowsFromAllPagesClick, children: [
8181
+ /* @__PURE__ */ (0, import_jsx_runtime126.jsx)(import_material71.Typography, { children: getSelectedRowsText() }),
8182
+ !isRowsFromAllPagesSelected ? /* @__PURE__ */ (0, import_jsx_runtime126.jsxs)(import_material71.Button, { onClick: onSelectRowsFromAllPagesClick, children: [
8278
8183
  "Select all ",
8279
8184
  totalRowCount,
8280
8185
  " rows from all pages based on your filters"
8281
8186
  ] }) : null,
8282
- /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(import_material72.Button, { onClick: onClearSelectionClick, children: "Clear Selection" })
8187
+ /* @__PURE__ */ (0, import_jsx_runtime126.jsx)(import_material71.Button, { onClick: onClearSelectionClick, children: "Clear Selection" })
8283
8188
  ]
8284
8189
  }
8285
8190
  ) : null;
8286
8191
  };
8287
8192
 
8288
8193
  // src/components/TableEmptyResult/TableEmptyResult.tsx
8289
- var import_material73 = require("@mui/material");
8194
+ var import_material72 = require("@mui/material");
8290
8195
  var import_mui53 = require("tss-react/mui");
8291
- var import_jsx_runtime128 = require("react/jsx-runtime");
8196
+ var import_jsx_runtime127 = require("react/jsx-runtime");
8292
8197
  var useStyles47 = (0, import_mui53.makeStyles)()(() => ({
8293
8198
  tableCellIcon: { padding: 24, height: "calc(100vh - 320px)" },
8294
8199
  tableCellDefault: { padding: 24 }
@@ -8300,17 +8205,17 @@ var TableEmptyResult = ({
8300
8205
  }
8301
8206
  }) => {
8302
8207
  const { classes } = useStyles47();
8303
- return showClearFilterButton ? /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(import_material73.TableRow, { children: /* @__PURE__ */ (0, import_jsx_runtime128.jsxs)(
8304
- import_material73.TableCell,
8208
+ return showClearFilterButton ? /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(import_material72.TableRow, { children: /* @__PURE__ */ (0, import_jsx_runtime127.jsxs)(
8209
+ import_material72.TableCell,
8305
8210
  {
8306
8211
  className: classes.tableCellIcon,
8307
8212
  colSpan,
8308
8213
  align: "center",
8309
8214
  children: [
8310
- /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(EmptyGlassIcon_default, {}),
8311
- /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(import_material73.Typography, { variant: "h6", children: "No results found." }),
8312
- /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(import_material73.Typography, { variant: "subtitle1", children: "Search without applied filters?" }),
8313
- /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(
8215
+ /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(EmptyGlassIcon_default, {}),
8216
+ /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(import_material72.Typography, { variant: "h6", children: "No results found." }),
8217
+ /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(import_material72.Typography, { variant: "subtitle1", children: "Search without applied filters?" }),
8218
+ /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(
8314
8219
  FilledButton_default,
8315
8220
  {
8316
8221
  copy: "Search",
@@ -8321,8 +8226,8 @@ var TableEmptyResult = ({
8321
8226
  )
8322
8227
  ]
8323
8228
  }
8324
- ) }) : /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(import_material73.TableRow, { children: /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(
8325
- import_material73.TableCell,
8229
+ ) }) : /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(import_material72.TableRow, { children: /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(
8230
+ import_material72.TableCell,
8326
8231
  {
8327
8232
  className: classes.tableCellDefault,
8328
8233
  colSpan,
@@ -8334,7 +8239,7 @@ var TableEmptyResult = ({
8334
8239
  var TableEmptyResult_default = TableEmptyResult;
8335
8240
 
8336
8241
  // src/components/TableDesktop/TableDesktop.tsx
8337
- var import_jsx_runtime129 = require("react/jsx-runtime");
8242
+ var import_jsx_runtime128 = require("react/jsx-runtime");
8338
8243
  var TableDesktop = ({
8339
8244
  data = [],
8340
8245
  headCells,
@@ -8361,24 +8266,24 @@ var TableDesktop = ({
8361
8266
  shouldShowCheckOnFilter,
8362
8267
  refetchData
8363
8268
  }) => {
8364
- const tableToolbarMenuButtonRef = (0, import_react41.useRef)(null);
8365
- const [tableToolbarMenuAnchor, setTableToolbarMenuAnchor] = (0, import_react41.useState)(null);
8366
- const [order, setOrder] = (0, import_react41.useState)(appliedFilters?.sortDir || "desc");
8367
- const [orderBy, setOrderBy] = (0, import_react41.useState)(
8269
+ const tableToolbarMenuButtonRef = (0, import_react40.useRef)(null);
8270
+ const [tableToolbarMenuAnchor, setTableToolbarMenuAnchor] = (0, import_react40.useState)(null);
8271
+ const [order, setOrder] = (0, import_react40.useState)(appliedFilters?.sortDir || "desc");
8272
+ const [orderBy, setOrderBy] = (0, import_react40.useState)(
8368
8273
  appliedFilters?.sortField || "delivery_date"
8369
8274
  );
8370
- const [selectedRows, setSelectedRows] = (0, import_react41.useState)(
8275
+ const [selectedRows, setSelectedRows] = (0, import_react40.useState)(
8371
8276
  /* @__PURE__ */ new Set()
8372
8277
  );
8373
- const [isRowsFromAllPagesSelected, setIsRowsFromAllPagesSelected] = (0, import_react41.useState)(false);
8374
- const [isBulkChangesMode, setIsBulkChangesMode] = (0, import_react41.useState)(false);
8278
+ const [isRowsFromAllPagesSelected, setIsRowsFromAllPagesSelected] = (0, import_react40.useState)(false);
8279
+ const [isBulkChangesMode, setIsBulkChangesMode] = (0, import_react40.useState)(false);
8375
8280
  const numRows = data.length;
8376
- const numSelectedRows = (0, import_react41.useMemo)(() => {
8281
+ const numSelectedRows = (0, import_react40.useMemo)(() => {
8377
8282
  const currentPageIds = new Set(data.map((row) => row[keyField]));
8378
8283
  return [...selectedRows].filter((id) => currentPageIds.has(id)).length;
8379
8284
  }, [data, selectedRows, keyField]);
8380
8285
  const isEveryRowInPageSelected = numRows > 0 && numSelectedRows === numRows;
8381
- const visibleHeadCells = (0, import_react41.useMemo)(
8286
+ const visibleHeadCells = (0, import_react40.useMemo)(
8382
8287
  () => headCells.filter((headCell) => headCell?.enabled ?? true),
8383
8288
  [headCells]
8384
8289
  );
@@ -8441,7 +8346,7 @@ var TableDesktop = ({
8441
8346
  resetSelectedRows();
8442
8347
  }
8443
8348
  };
8444
- (0, import_react41.useEffect)(() => {
8349
+ (0, import_react40.useEffect)(() => {
8445
8350
  if (isRowsFromAllPagesSelected) {
8446
8351
  selectAllRowsInPage();
8447
8352
  selectAllRowsInPage();
@@ -8449,7 +8354,7 @@ var TableDesktop = ({
8449
8354
  }, [isRowsFromAllPagesSelected, data]);
8450
8355
  const renderBody = () => {
8451
8356
  if (isLoading) {
8452
- return /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(
8357
+ return /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(
8453
8358
  TableDesktopLoadingState,
8454
8359
  {
8455
8360
  numRows: Math.min(rowsPerPage, 10),
@@ -8459,7 +8364,7 @@ var TableDesktop = ({
8459
8364
  );
8460
8365
  }
8461
8366
  if (numRows === 0) {
8462
- return /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(
8367
+ return /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(
8463
8368
  TableEmptyResult_default,
8464
8369
  {
8465
8370
  showClearFilterButton,
@@ -8468,7 +8373,7 @@ var TableDesktop = ({
8468
8373
  }
8469
8374
  );
8470
8375
  }
8471
- return /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(
8376
+ return /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(
8472
8377
  TableDesktopRows,
8473
8378
  {
8474
8379
  data,
@@ -8487,8 +8392,8 @@ var TableDesktop = ({
8487
8392
  }
8488
8393
  );
8489
8394
  };
8490
- return /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(
8491
- import_material74.Box,
8395
+ return /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(
8396
+ import_material73.Box,
8492
8397
  {
8493
8398
  sx: {
8494
8399
  height,
@@ -8496,8 +8401,8 @@ var TableDesktop = ({
8496
8401
  justifyContent: "space-between",
8497
8402
  justifyItems: "stretch"
8498
8403
  },
8499
- children: /* @__PURE__ */ (0, import_jsx_runtime129.jsxs)(
8500
- import_material74.Paper,
8404
+ children: /* @__PURE__ */ (0, import_jsx_runtime128.jsxs)(
8405
+ import_material73.Paper,
8501
8406
  {
8502
8407
  sx: {
8503
8408
  width: "100%",
@@ -8521,7 +8426,7 @@ var TableDesktop = ({
8521
8426
  isBulkChangesMode,
8522
8427
  onChangeBulkChangesMode: handleChangeBulkChangesMode
8523
8428
  }) : null,
8524
- /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(
8429
+ /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(
8525
8430
  TableDesktopRowSelectionBar,
8526
8431
  {
8527
8432
  isEveryRowInPageSelected,
@@ -8532,8 +8437,8 @@ var TableDesktop = ({
8532
8437
  onClearSelectionClick: handleClearSelectionClick
8533
8438
  }
8534
8439
  ),
8535
- /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(
8536
- import_material74.TableContainer,
8440
+ /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(
8441
+ import_material73.TableContainer,
8537
8442
  {
8538
8443
  sx: {
8539
8444
  flexGrow: 1,
@@ -8554,13 +8459,13 @@ var TableDesktop = ({
8554
8459
  backgroundColor: (theme) => theme.palette.grey[500]
8555
8460
  }
8556
8461
  },
8557
- children: /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(import_material74.Table, { stickyHeader: true, "aria-label": "sticky-table", sx: { tableLayout }, children: visibleHeadCells.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(
8462
+ children: /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(import_material73.Table, { stickyHeader: true, "aria-label": "sticky-table", sx: { tableLayout }, children: visibleHeadCells.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(
8558
8463
  TableDesktopNoColumnsMessage,
8559
8464
  {
8560
8465
  onClickNoColumnsMessageOpenMenu: handleClickToolbarMenuOpen
8561
8466
  }
8562
- ) : /* @__PURE__ */ (0, import_jsx_runtime129.jsxs)(import_jsx_runtime129.Fragment, { children: [
8563
- /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(
8467
+ ) : /* @__PURE__ */ (0, import_jsx_runtime128.jsxs)(import_jsx_runtime128.Fragment, { children: [
8468
+ /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(
8564
8469
  SmartTableHeader,
8565
8470
  {
8566
8471
  order,
@@ -8576,7 +8481,7 @@ var TableDesktop = ({
8576
8481
  shouldShowCheckOnFilter
8577
8482
  }
8578
8483
  ),
8579
- /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(import_material74.TableBody, { children: renderBody() })
8484
+ /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(import_material73.TableBody, { children: renderBody() })
8580
8485
  ] }) })
8581
8486
  }
8582
8487
  ),
@@ -8593,141 +8498,99 @@ var TableDesktop = ({
8593
8498
  };
8594
8499
 
8595
8500
  // src/components/TableDesktopEditableField/TableDesktopEditableField.tsx
8596
- var import_react45 = require("react");
8597
- var import_Delete = __toESM(require("@mui/icons-material/Delete"), 1);
8598
- var import_material76 = require("@mui/material");
8599
- var import_x_date_pickers = require("@mui/x-date-pickers");
8600
- var import_moment3 = __toESM(require("moment"), 1);
8601
-
8602
- // src/components/TableDesktopEditableField/TableDesktopSmartMultipleSelect.tsx
8603
- var import_react42 = require("react");
8604
- var import_jsx_runtime130 = require("react/jsx-runtime");
8605
- var TableDesktopSmartMultipleSelect = ({
8606
- initialValue,
8607
- inputLabel,
8608
- columnId,
8609
- fieldName,
8610
- rowId,
8611
- disabled,
8612
- variant = "standard",
8613
- size,
8614
- filterOptions,
8615
- refetchFilterOptions,
8616
- isFetchingFilterOptions,
8617
- onUpdateEditableCell
8618
- }) => {
8619
- const defaultValues = (0, import_react42.useMemo)(() => {
8620
- return initialValue.map((val) => ({
8621
- value: val.id,
8622
- label: val[fieldName].toString()
8623
- }));
8624
- }, [initialValue]);
8625
- return /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(
8626
- SmartMultipleSelect,
8627
- {
8628
- inputLabel,
8629
- size,
8630
- variant,
8631
- disabled,
8632
- defaultValues,
8633
- menuOptions: filterOptions,
8634
- isLoading: isFetchingFilterOptions,
8635
- onOpen: () => {
8636
- if (!filterOptions?.length) {
8637
- refetchFilterOptions?.();
8638
- }
8639
- },
8640
- onClose: (values) => {
8641
- const optionsValues = values.map((option) => option.value ?? "");
8642
- onUpdateEditableCell?.({
8643
- rowId,
8644
- columnId,
8645
- value: optionsValues,
8646
- label: optionsValues
8647
- });
8648
- }
8649
- }
8650
- );
8651
- };
8501
+ var import_material75 = require("@mui/material");
8652
8502
 
8653
8503
  // src/components/TableDesktopEditableField/TableDesktopSmartSelect.tsx
8654
- var import_react43 = require("react");
8655
- var import_jsx_runtime131 = require("react/jsx-runtime");
8656
- var TableDesktopSmartSelect = ({
8657
- ref,
8658
- initialValue,
8659
- inputLabel,
8660
- columnId,
8661
- fieldName,
8662
- rowId,
8663
- disabled,
8664
- variant = "standard",
8665
- size,
8666
- allowBlankOption,
8667
- filterOptions,
8668
- refetchFilterOptions,
8669
- isFetchingFilterOptions,
8670
- onUpdateEditableCell
8671
- }) => {
8672
- const [value, setValue] = (0, import_react43.useState)(
8673
- initialValue
8674
- );
8675
- const valueId = resolveObjectType(value ?? "", "id");
8676
- const valueLabel = resolveObjectType(value ?? "", fieldName);
8677
- return /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(
8678
- SmartSelect_default,
8679
- {
8680
- ref,
8681
- value: valueId,
8682
- allowBlankOption,
8683
- inputLabel,
8684
- options: filterOptions,
8685
- disabled,
8686
- variant,
8687
- size,
8688
- refetch: refetchFilterOptions,
8689
- isFetching: isFetchingFilterOptions,
8690
- defaultOption: {
8691
- value: valueId ?? "",
8692
- label: String(valueLabel ?? "")
8693
- },
8694
- onChange: ({ value: id, label }) => {
8695
- setValue({ id: id ?? "", name: label ?? "" });
8696
- onUpdateEditableCell?.({
8697
- rowId,
8698
- columnId,
8699
- value: id || null,
8700
- label: label ?? ""
8701
- });
8504
+ var import_react41 = require("react");
8505
+ var import_jsx_runtime129 = require("react/jsx-runtime");
8506
+ var TableDesktopSmartSelect = (0, import_react41.memo)(
8507
+ ({
8508
+ ref,
8509
+ initialValue,
8510
+ inputLabel,
8511
+ field,
8512
+ fieldName,
8513
+ rowId,
8514
+ disabled,
8515
+ variant = "standard",
8516
+ size,
8517
+ filterOptions,
8518
+ refetchFilterOptions,
8519
+ isFetchingFilterOptions,
8520
+ onUpdateEditableCell
8521
+ }) => {
8522
+ const [value, setValue] = (0, import_react41.useState)(
8523
+ initialValue
8524
+ );
8525
+ const [options, setOptions] = (0, import_react41.useState)();
8526
+ const valueId = resolveObjectType(value, "id");
8527
+ const valueLabel = resolveObjectType(value, fieldName);
8528
+ (0, import_react41.useEffect)(() => {
8529
+ if (filterOptions) {
8530
+ const parsedOptions = filterOptions?.map(
8531
+ (option) => ({
8532
+ value: resolveObjectType(option, "id"),
8533
+ label: String(resolveObjectType(option, fieldName))
8534
+ })
8535
+ );
8536
+ setOptions(parsedOptions);
8702
8537
  }
8703
- }
8704
- );
8705
- };
8538
+ }, [filterOptions]);
8539
+ return /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(
8540
+ SmartSelect_default,
8541
+ {
8542
+ ref,
8543
+ value: valueId,
8544
+ inputLabel,
8545
+ options,
8546
+ disabled,
8547
+ variant,
8548
+ size,
8549
+ refetch: refetchFilterOptions,
8550
+ isFetching: isFetchingFilterOptions,
8551
+ defaultOption: {
8552
+ value: valueId ?? "",
8553
+ label: String(valueLabel ?? "")
8554
+ },
8555
+ onChange: ({ value: id, label: name }) => {
8556
+ if (!id || !name) {
8557
+ return;
8558
+ }
8559
+ setValue({ id, name });
8560
+ if (!onUpdateEditableCell) {
8561
+ return;
8562
+ }
8563
+ onUpdateEditableCell(rowId ?? 0, field, id, name);
8564
+ }
8565
+ }
8566
+ );
8567
+ }
8568
+ );
8706
8569
 
8707
8570
  // src/components/TableDesktopEditableField/TableDesktopTextField.tsx
8708
- var import_react44 = require("react");
8709
- var import_material75 = require("@mui/material");
8710
- var import_jsx_runtime132 = require("react/jsx-runtime");
8571
+ var import_react42 = require("react");
8572
+ var import_material74 = require("@mui/material");
8573
+ var import_jsx_runtime130 = require("react/jsx-runtime");
8711
8574
  var TableDesktopTextField = ({
8712
8575
  rowId,
8713
8576
  initialValue,
8714
8577
  inputLabel,
8715
8578
  disabled,
8716
- columnId,
8579
+ field,
8717
8580
  type,
8718
8581
  variant = "standard",
8719
8582
  size,
8720
8583
  validateInput,
8721
8584
  onUpdateEditableCell
8722
8585
  }) => {
8723
- const [input, setInput] = (0, import_react44.useState)(initialValue);
8724
- const oldValue = (0, import_react44.useRef)(initialValue);
8725
- const isDirty = (0, import_react44.useMemo)(
8586
+ const [input, setInput] = (0, import_react42.useState)(initialValue);
8587
+ const oldValue = (0, import_react42.useRef)(initialValue);
8588
+ const isDirty = (0, import_react42.useMemo)(
8726
8589
  () => input !== oldValue.current,
8727
8590
  [input, oldValue.current]
8728
8591
  );
8729
- const hasValidationError = (0, import_react44.useMemo)(
8730
- () => isDirty && validateInput && !validateInput(input),
8592
+ const hasValidationError = (0, import_react42.useMemo)(
8593
+ () => isDirty && !validateInput?.(input),
8731
8594
  [input, validateInput]
8732
8595
  );
8733
8596
  const commitValue = (value) => {
@@ -8736,7 +8599,7 @@ var TableDesktopTextField = ({
8736
8599
  return;
8737
8600
  }
8738
8601
  oldValue.current = value;
8739
- onUpdateEditableCell({ rowId, columnId, value, label: value });
8602
+ onUpdateEditableCell(rowId ?? 0, field, value, value);
8740
8603
  };
8741
8604
  const handleKeyDown = (e) => {
8742
8605
  if (e.key === "Enter") {
@@ -8744,8 +8607,8 @@ var TableDesktopTextField = ({
8744
8607
  commitValue(input);
8745
8608
  }
8746
8609
  };
8747
- return /* @__PURE__ */ (0, import_jsx_runtime132.jsx)(
8748
- import_material75.TextField,
8610
+ return /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(
8611
+ import_material74.TextField,
8749
8612
  {
8750
8613
  fullWidth: true,
8751
8614
  variant,
@@ -8767,9 +8630,6 @@ var TableDesktopTextField = ({
8767
8630
  slotProps: {
8768
8631
  input: {
8769
8632
  inputMode: type === "numeric" ? "numeric" : void 0
8770
- },
8771
- htmlInput: {
8772
- maxLength: 1e3
8773
8633
  }
8774
8634
  }
8775
8635
  }
@@ -8777,98 +8637,63 @@ var TableDesktopTextField = ({
8777
8637
  };
8778
8638
 
8779
8639
  // src/components/TableDesktopEditableField/TableDesktopEditableField.tsx
8780
- var import_jsx_runtime133 = require("react/jsx-runtime");
8640
+ var import_jsx_runtime131 = require("react/jsx-runtime");
8781
8641
  var TableDesktopEditableField = ({
8782
8642
  editInitialValue,
8783
8643
  rowId,
8644
+ field,
8645
+ fieldName,
8784
8646
  disabled,
8647
+ inputLabel,
8785
8648
  showCheckboxLabel = false,
8786
8649
  variant = "standard",
8787
8650
  size,
8788
- onUpdateEditableCell,
8789
- headCell: {
8790
- id: columnId,
8791
- fieldName = "",
8792
- label: inputLabel = "",
8793
- editableCellType,
8794
- filterOptions,
8795
- refetchFilterOptions,
8796
- isFetchingFilterOptions,
8797
- validateInput,
8798
- allowBlankSelectOption
8799
- }
8651
+ editableCellType,
8652
+ filterOptions,
8653
+ refetchFilterOptions,
8654
+ isFetchingFilterOptions,
8655
+ validateInput,
8656
+ onUpdateEditableCell
8800
8657
  }) => {
8801
- const [parsedFilterOptions, setParsedFilterOptions] = (0, import_react45.useState)();
8802
- (0, import_react45.useEffect)(() => {
8803
- if (filterOptions && editableCellType === "select" || editableCellType === "multipleSelect") {
8804
- const parsedOptions = filterOptions?.map(
8805
- (option) => ({
8806
- value: resolveObjectType(option, "id"),
8807
- label: String(resolveObjectType(option, fieldName))
8808
- })
8809
- );
8810
- setParsedFilterOptions(parsedOptions);
8811
- }
8812
- }, [filterOptions, editableCellType]);
8813
8658
  const editableComponents = {
8814
- select: /* @__PURE__ */ (0, import_jsx_runtime133.jsx)(
8659
+ select: /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(
8815
8660
  TableDesktopSmartSelect,
8816
8661
  {
8817
8662
  rowId,
8818
- columnId,
8663
+ field,
8819
8664
  fieldName,
8820
8665
  disabled,
8821
8666
  variant,
8822
8667
  size,
8823
- allowBlankOption: allowBlankSelectOption,
8824
8668
  initialValue: editInitialValue,
8825
8669
  inputLabel,
8826
- filterOptions: parsedFilterOptions,
8670
+ filterOptions,
8827
8671
  refetchFilterOptions,
8828
8672
  isFetchingFilterOptions,
8829
8673
  onUpdateEditableCell
8830
8674
  }
8831
8675
  ),
8832
- multipleSelect: /* @__PURE__ */ (0, import_jsx_runtime133.jsx)(
8833
- TableDesktopSmartMultipleSelect,
8834
- {
8835
- rowId,
8836
- columnId,
8837
- fieldName,
8838
- disabled,
8839
- variant,
8840
- size,
8841
- initialValue: editInitialValue,
8842
- inputLabel,
8843
- filterOptions: parsedFilterOptions,
8844
- refetchFilterOptions,
8845
- isFetchingFilterOptions,
8846
- onUpdateEditableCell
8847
- }
8848
- ),
8849
- checkbox: /* @__PURE__ */ (0, import_jsx_runtime133.jsx)(
8850
- import_material76.FormControlLabel,
8676
+ checkbox: /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(
8677
+ import_material75.FormControlLabel,
8851
8678
  {
8852
8679
  label: showCheckboxLabel ? inputLabel : "",
8853
- control: /* @__PURE__ */ (0, import_jsx_runtime133.jsx)(
8854
- import_material76.Checkbox,
8680
+ control: /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(
8681
+ import_material75.Checkbox,
8855
8682
  {
8856
8683
  disableRipple: true,
8857
8684
  disabled,
8858
8685
  defaultChecked: editInitialValue,
8859
8686
  onChange: ({ target: { checked } }) => {
8860
- onUpdateEditableCell?.({
8861
- rowId,
8862
- columnId,
8863
- value: checked,
8864
- label: checked
8865
- });
8687
+ if (!onUpdateEditableCell) {
8688
+ return;
8689
+ }
8690
+ onUpdateEditableCell(rowId ?? 0, field, checked, checked);
8866
8691
  }
8867
8692
  }
8868
8693
  )
8869
8694
  }
8870
8695
  ),
8871
- text: /* @__PURE__ */ (0, import_jsx_runtime133.jsx)(
8696
+ text: /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(
8872
8697
  TableDesktopTextField,
8873
8698
  {
8874
8699
  type: "text",
@@ -8876,14 +8701,14 @@ var TableDesktopEditableField = ({
8876
8701
  disabled,
8877
8702
  variant,
8878
8703
  size,
8879
- columnId,
8704
+ field,
8880
8705
  initialValue: editInitialValue ?? "",
8881
8706
  inputLabel: inputLabel ?? "",
8882
8707
  validateInput,
8883
8708
  onUpdateEditableCell
8884
8709
  }
8885
8710
  ),
8886
- numeric: /* @__PURE__ */ (0, import_jsx_runtime133.jsx)(
8711
+ numeric: /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(
8887
8712
  TableDesktopTextField,
8888
8713
  {
8889
8714
  type: "numeric",
@@ -8891,80 +8716,21 @@ var TableDesktopEditableField = ({
8891
8716
  disabled,
8892
8717
  variant,
8893
8718
  size,
8894
- columnId,
8719
+ field,
8895
8720
  initialValue: editInitialValue ?? "",
8896
8721
  inputLabel: inputLabel ?? "",
8897
8722
  validateInput,
8898
8723
  onUpdateEditableCell
8899
8724
  }
8900
- ),
8901
- date: /* @__PURE__ */ (0, import_jsx_runtime133.jsx)(
8902
- import_x_date_pickers.DatePicker,
8903
- {
8904
- defaultValue: (0, import_moment3.default)(editInitialValue),
8905
- label: inputLabel,
8906
- format: "DD/MM/YYYY",
8907
- sx: { overflowY: "hidden" },
8908
- onAccept: (value) => {
8909
- const formattedValue = value?.format("YYYY-MM-DD") ?? null;
8910
- const formattedLabel = value?.format("DD/MM/YYYY") ?? null;
8911
- onUpdateEditableCell?.({
8912
- rowId,
8913
- columnId,
8914
- value: formattedValue,
8915
- label: formattedLabel
8916
- });
8917
- },
8918
- slots: { clearIcon: import_Delete.default },
8919
- slotProps: {
8920
- field: { clearable: true },
8921
- clearButton: { sx: { p: 0.5 } },
8922
- openPickerButton: { sx: { p: 0 } },
8923
- textField: {
8924
- variant: "standard",
8925
- error: false
8926
- }
8927
- }
8928
- }
8929
- ),
8930
- time: /* @__PURE__ */ (0, import_jsx_runtime133.jsx)(
8931
- import_x_date_pickers.TimePicker,
8932
- {
8933
- defaultValue: (0, import_moment3.default)(editInitialValue, "HH:mm:ss"),
8934
- label: inputLabel,
8935
- sx: { overflowY: "hidden" },
8936
- onAccept: (value) => {
8937
- const formattedValue = value?.format("HH:mm") ?? null;
8938
- onUpdateEditableCell?.({
8939
- rowId,
8940
- columnId,
8941
- value: formattedValue,
8942
- label: formattedValue
8943
- });
8944
- },
8945
- slots: { clearIcon: import_Delete.default },
8946
- slotProps: {
8947
- field: { clearable: true },
8948
- clearButton: { sx: { p: 0.5 } },
8949
- openPickerButton: { sx: { p: 0 } },
8950
- textField: {
8951
- variant: "standard",
8952
- error: false
8953
- }
8954
- }
8955
- }
8956
8725
  )
8957
8726
  };
8958
- if (!editableCellType) {
8959
- return null;
8960
- }
8961
8727
  return editableComponents[editableCellType];
8962
8728
  };
8963
8729
 
8964
8730
  // src/components/TableDesktopFooter/TableDesktopFooter.tsx
8965
8731
  var import_Refresh = __toESM(require("@mui/icons-material/Refresh"), 1);
8966
- var import_material77 = require("@mui/material");
8967
- var import_jsx_runtime134 = require("react/jsx-runtime");
8732
+ var import_material76 = require("@mui/material");
8733
+ var import_jsx_runtime132 = require("react/jsx-runtime");
8968
8734
  var TableDesktopFooter = ({
8969
8735
  numPages,
8970
8736
  page,
@@ -8975,8 +8741,8 @@ var TableDesktopFooter = ({
8975
8741
  refetchData,
8976
8742
  isFetching
8977
8743
  }) => {
8978
- return /* @__PURE__ */ (0, import_jsx_runtime134.jsxs)(
8979
- import_material77.Box,
8744
+ return /* @__PURE__ */ (0, import_jsx_runtime132.jsxs)(
8745
+ import_material76.Box,
8980
8746
  {
8981
8747
  sx: {
8982
8748
  py: 1,
@@ -8987,8 +8753,8 @@ var TableDesktopFooter = ({
8987
8753
  borderTop: `1px solid ${colors.neutral300}`
8988
8754
  },
8989
8755
  children: [
8990
- refetchData ? /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(
8991
- import_material77.Button,
8756
+ refetchData ? /* @__PURE__ */ (0, import_jsx_runtime132.jsx)(
8757
+ import_material76.Button,
8992
8758
  {
8993
8759
  disableRipple: true,
8994
8760
  variant: "text",
@@ -8998,7 +8764,7 @@ var TableDesktopFooter = ({
8998
8764
  ml: 1,
8999
8765
  gap: 1
9000
8766
  },
9001
- children: /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(
8767
+ children: /* @__PURE__ */ (0, import_jsx_runtime132.jsx)(
9002
8768
  import_Refresh.default,
9003
8769
  {
9004
8770
  fontSize: "small",
@@ -9007,22 +8773,22 @@ var TableDesktopFooter = ({
9007
8773
  )
9008
8774
  }
9009
8775
  ) : null,
9010
- /* @__PURE__ */ (0, import_jsx_runtime134.jsxs)(import_material77.Box, { sx: { display: "flex", ml: "auto", py: 1 }, children: [
9011
- pageSize && pageSizeOptions && onPageSizeChange ? /* @__PURE__ */ (0, import_jsx_runtime134.jsxs)(import_material77.Stack, { direction: "row", spacing: 2, alignItems: "center", children: [
9012
- /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(import_material77.Typography, { children: "Rows per page:" }),
9013
- /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(
9014
- import_material77.Select,
8776
+ /* @__PURE__ */ (0, import_jsx_runtime132.jsxs)(import_material76.Box, { sx: { display: "flex", ml: "auto", py: 1 }, children: [
8777
+ pageSize && pageSizeOptions && onPageSizeChange ? /* @__PURE__ */ (0, import_jsx_runtime132.jsxs)(import_material76.Stack, { direction: "row", spacing: 2, alignItems: "center", children: [
8778
+ /* @__PURE__ */ (0, import_jsx_runtime132.jsx)(import_material76.Typography, { fontSize: 12, children: "Rows per page:" }),
8779
+ /* @__PURE__ */ (0, import_jsx_runtime132.jsx)(
8780
+ import_material76.Select,
9015
8781
  {
9016
8782
  value: pageSize,
9017
8783
  onChange: onPageSizeChange,
9018
8784
  size: "small",
9019
8785
  variant: "standard",
9020
- children: pageSizeOptions.map((pageSizeOption) => /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(import_material77.MenuItem, { value: pageSizeOption, children: pageSizeOption }, pageSizeOption))
8786
+ children: pageSizeOptions.map((pageSizeOption) => /* @__PURE__ */ (0, import_jsx_runtime132.jsx)(import_material76.MenuItem, { value: pageSizeOption, children: pageSizeOption }, pageSizeOption))
9021
8787
  }
9022
8788
  )
9023
8789
  ] }) : null,
9024
- /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(
9025
- import_material77.Pagination,
8790
+ /* @__PURE__ */ (0, import_jsx_runtime132.jsx)(
8791
+ import_material76.Pagination,
9026
8792
  {
9027
8793
  color: "standard",
9028
8794
  count: numPages,
@@ -9037,15 +8803,15 @@ var TableDesktopFooter = ({
9037
8803
  };
9038
8804
 
9039
8805
  // src/components/TableDesktopCell/TableDesktopCell.tsx
9040
- var import_react46 = require("react");
8806
+ var import_react43 = require("react");
9041
8807
  var import_Check3 = __toESM(require("@mui/icons-material/Check"), 1);
9042
8808
  var import_Close = __toESM(require("@mui/icons-material/Close"), 1);
9043
8809
  var import_Edit = __toESM(require("@mui/icons-material/Edit"), 1);
9044
- var import_material78 = require("@mui/material");
9045
- var import_jsx_runtime135 = require("react/jsx-runtime");
8810
+ var import_material77 = require("@mui/material");
8811
+ var import_jsx_runtime133 = require("react/jsx-runtime");
9046
8812
  var getReadOnlyBooleanIcon = (value) => {
9047
8813
  if (value) {
9048
- return /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(import_Check3.default, { sx: { fontSize: 16 } });
8814
+ return /* @__PURE__ */ (0, import_jsx_runtime133.jsx)(import_Check3.default, { sx: { fontSize: 16 } });
9049
8815
  }
9050
8816
  return "-";
9051
8817
  };
@@ -9059,28 +8825,36 @@ var getCellBackgroundColor = (isCellInEditMode) => ({
9059
8825
  background: isCellInEditMode ? colors.lightBlueBackground : colors.neutral100
9060
8826
  });
9061
8827
  var TableDesktopCell = ({
8828
+ inputLabel,
9062
8829
  editInitialValue,
9063
8830
  rowId,
9064
- disabled,
8831
+ field,
8832
+ fieldName,
8833
+ width,
9065
8834
  enableEditMode,
8835
+ disabled,
9066
8836
  readOnlyValue,
9067
- onCellClick,
9068
- headCell
8837
+ editableCellType,
8838
+ filterOptions,
8839
+ refetchFilterOptions,
8840
+ isFetchingFilterOptions,
8841
+ validateInput,
8842
+ onUpdateEditableCell,
8843
+ onCellClick
9069
8844
  }) => {
9070
- const [isCellHovered, setIsCellHovered] = (0, import_react46.useState)(false);
9071
- const [isCellInEditMode, setIsCellInEditMode] = (0, import_react46.useState)(false);
9072
- const { width, editableCellType } = headCell;
9073
- (0, import_react46.useEffect)(() => {
8845
+ const [isCellHovered, setIsCellHovered] = (0, import_react43.useState)(false);
8846
+ const [isCellInEditMode, setIsCellInEditMode] = (0, import_react43.useState)(false);
8847
+ (0, import_react43.useEffect)(() => {
9074
8848
  const handleKeyDown = (e) => {
9075
8849
  if (e.key === "Escape") {
9076
8850
  setIsCellInEditMode(false);
9077
8851
  }
9078
8852
  };
9079
8853
  if (isCellInEditMode) {
9080
- globalThis.addEventListener("keydown", handleKeyDown);
8854
+ window.addEventListener("keydown", handleKeyDown);
9081
8855
  }
9082
8856
  return () => {
9083
- globalThis.removeEventListener("keydown", handleKeyDown);
8857
+ window.removeEventListener("keydown", handleKeyDown);
9084
8858
  };
9085
8859
  }, [isCellInEditMode]);
9086
8860
  const handleEditClick = (e) => {
@@ -9088,8 +8862,8 @@ var TableDesktopCell = ({
9088
8862
  setIsCellInEditMode((prev) => !prev);
9089
8863
  };
9090
8864
  const isCellEditable = !!enableEditMode && !!editableCellType && !disabled;
9091
- return /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(
9092
- import_material78.TableCell,
8865
+ return /* @__PURE__ */ (0, import_jsx_runtime133.jsx)(
8866
+ import_material77.TableCell,
9093
8867
  {
9094
8868
  align: "left",
9095
8869
  onMouseEnter: () => isCellEditable && setIsCellHovered(true),
@@ -9100,12 +8874,13 @@ var TableDesktopCell = ({
9100
8874
  width: width ?? "auto",
9101
8875
  position: "relative",
9102
8876
  cursor: disabled || !enableEditMode ? "default" : "pointer",
8877
+ opacity: disabled ? 0.2 : 1,
9103
8878
  ":hover": isCellEditable ? getCellBackgroundColor(isCellInEditMode) : void 0,
9104
8879
  background: enableEditMode && isCellInEditMode ? colors.lightBlueBackground : void 0
9105
8880
  },
9106
- children: /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(DynamicOverflowTooltip, { tooltipDescription: String(readOnlyValue), arrow: true, children: /* @__PURE__ */ (0, import_jsx_runtime135.jsxs)(import_jsx_runtime135.Fragment, { children: [
9107
- enableEditMode && isCellHovered ? /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(import_material78.Tooltip, { title: isCellInEditMode ? "" : "Toggle Edit Mode", children: /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(
9108
- import_material78.IconButton,
8881
+ children: /* @__PURE__ */ (0, import_jsx_runtime133.jsx)(DynamicOverflowTooltip, { tooltipDescription: String(readOnlyValue), arrow: true, children: /* @__PURE__ */ (0, import_jsx_runtime133.jsxs)(import_jsx_runtime133.Fragment, { children: [
8882
+ enableEditMode && isCellHovered ? /* @__PURE__ */ (0, import_jsx_runtime133.jsx)(import_material77.Tooltip, { title: isCellInEditMode ? "" : "Toggle Edit Mode", children: /* @__PURE__ */ (0, import_jsx_runtime133.jsx)(
8883
+ import_material77.IconButton,
9109
8884
  {
9110
8885
  onClick: handleEditClick,
9111
8886
  sx: {
@@ -9119,17 +8894,24 @@ var TableDesktopCell = ({
9119
8894
  backgroundColor: isCellInEditMode ? colors.lightBlueBackground : colors.neutral150
9120
8895
  }
9121
8896
  },
9122
- children: isCellInEditMode ? /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(import_Close.default, { fontSize: "small", color: "error" }) : /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(import_Edit.default, { fontSize: "small" })
8897
+ children: isCellInEditMode ? /* @__PURE__ */ (0, import_jsx_runtime133.jsx)(import_Close.default, { fontSize: "small", color: "error" }) : /* @__PURE__ */ (0, import_jsx_runtime133.jsx)(import_Edit.default, { fontSize: "small" })
9123
8898
  }
9124
8899
  ) }) : null,
9125
- enableEditMode && isCellInEditMode && editableCellType ? /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(
8900
+ enableEditMode && isCellInEditMode && editableCellType ? /* @__PURE__ */ (0, import_jsx_runtime133.jsx)(
9126
8901
  TableDesktopEditableField,
9127
8902
  {
9128
8903
  editInitialValue,
9129
8904
  rowId,
8905
+ field,
8906
+ fieldName,
9130
8907
  disabled,
9131
- headCell,
9132
- onUpdateEditableCell: headCell.onUpdateEditableCell
8908
+ inputLabel: inputLabel ?? "",
8909
+ editableCellType,
8910
+ filterOptions,
8911
+ refetchFilterOptions,
8912
+ isFetchingFilterOptions,
8913
+ validateInput,
8914
+ onUpdateEditableCell
9133
8915
  }
9134
8916
  ) : renderReadOnlyValue(readOnlyValue)
9135
8917
  ] }) })
@@ -9138,12 +8920,12 @@ var TableDesktopCell = ({
9138
8920
  };
9139
8921
 
9140
8922
  // src/components/TableDesktopToolbar/TableDesktopToolbar.tsx
9141
- var import_react47 = require("react");
8923
+ var import_react44 = require("react");
9142
8924
  var import_Download = __toESM(require("@mui/icons-material/Download"), 1);
9143
8925
  var import_KeyboardArrowLeft2 = __toESM(require("@mui/icons-material/KeyboardArrowLeft"), 1);
9144
8926
  var import_KeyboardArrowRight2 = __toESM(require("@mui/icons-material/KeyboardArrowRight"), 1);
9145
- var import_material79 = require("@mui/material");
9146
- var import_jsx_runtime136 = require("react/jsx-runtime");
8927
+ var import_material78 = require("@mui/material");
8928
+ var import_jsx_runtime134 = require("react/jsx-runtime");
9147
8929
  var TableDesktopToolbar = ({
9148
8930
  toolbarLabel,
9149
8931
  headCells,
@@ -9165,12 +8947,12 @@ var TableDesktopToolbar = ({
9165
8947
  renderTableColumnConfigurationMenu,
9166
8948
  renderInfoIcons
9167
8949
  }) => {
9168
- const scrollRef = (0, import_react47.useRef)(null);
9169
- const [bulkChanges, setBulkChanges] = (0, import_react47.useState)([]);
9170
- const [isBulkChangesDialogOpen, setIsBulkChangesDialogOpen] = (0, import_react47.useState)(false);
9171
- const [isExportCsvDialogOpen, setIsExportCsvDialogOpen] = (0, import_react47.useState)(false);
9172
- const [resetCounter, setResetCounter] = (0, import_react47.useState)(0);
9173
- const visibleEditableColumns = (0, import_react47.useMemo)(
8950
+ const scrollRef = (0, import_react44.useRef)(null);
8951
+ const [bulkChanges, setBulkChanges] = (0, import_react44.useState)([]);
8952
+ const [isBulkChangesDialogOpen, setIsBulkChangesDialogOpen] = (0, import_react44.useState)(false);
8953
+ const [isExportCsvDialogOpen, setIsExportCsvDialogOpen] = (0, import_react44.useState)(false);
8954
+ const [resetCounter, setResetCounter] = (0, import_react44.useState)(0);
8955
+ const visibleEditableColumns = (0, import_react44.useMemo)(
9174
8956
  () => headCells.filter(
9175
8957
  (headCell) => headCell?.enabled && !!headCell?.editableCellType
9176
8958
  ),
@@ -9187,17 +8969,13 @@ var TableDesktopToolbar = ({
9187
8969
  refetchData?.();
9188
8970
  }
9189
8971
  };
9190
- const handleUpdateEditableCell = ({
9191
- columnId,
9192
- value,
9193
- label
9194
- }) => {
8972
+ const handleUpdateEditableCell = (_rowId, field, value, label) => {
9195
8973
  setBulkChanges((prev) => {
9196
- return [...prev, { field: columnId, value, label }];
8974
+ return [...prev, { field, value, label }];
9197
8975
  });
9198
8976
  };
9199
- return /* @__PURE__ */ (0, import_jsx_runtime136.jsxs)(
9200
- import_material79.Box,
8977
+ return /* @__PURE__ */ (0, import_jsx_runtime134.jsxs)(
8978
+ import_material78.Box,
9201
8979
  {
9202
8980
  sx: {
9203
8981
  borderBottom: "1px solid",
@@ -9205,8 +8983,8 @@ var TableDesktopToolbar = ({
9205
8983
  maxWidth: "100%"
9206
8984
  },
9207
8985
  children: [
9208
- /* @__PURE__ */ (0, import_jsx_runtime136.jsxs)(
9209
- import_material79.Box,
8986
+ /* @__PURE__ */ (0, import_jsx_runtime134.jsxs)(
8987
+ import_material78.Box,
9210
8988
  {
9211
8989
  sx: {
9212
8990
  py: 1,
@@ -9217,8 +8995,8 @@ var TableDesktopToolbar = ({
9217
8995
  background: isBulkChangesMode ? colors.neutral150 : void 0
9218
8996
  },
9219
8997
  children: [
9220
- /* @__PURE__ */ (0, import_jsx_runtime136.jsxs)(
9221
- import_material79.Box,
8998
+ /* @__PURE__ */ (0, import_jsx_runtime134.jsxs)(
8999
+ import_material78.Box,
9222
9000
  {
9223
9001
  sx: {
9224
9002
  py: 1,
@@ -9228,21 +9006,21 @@ var TableDesktopToolbar = ({
9228
9006
  whiteSpace: "nowrap"
9229
9007
  },
9230
9008
  children: [
9231
- toolbarLabel ? /* @__PURE__ */ (0, import_jsx_runtime136.jsxs)(import_jsx_runtime136.Fragment, { children: [
9232
- /* @__PURE__ */ (0, import_jsx_runtime136.jsx)(import_material79.Typography, { variant: "subtitle2", color: "textSecondary", children: toolbarLabel }),
9233
- /* @__PURE__ */ (0, import_jsx_runtime136.jsx)(import_material79.Divider, { orientation: "vertical", sx: { height: 0.75, py: 2.5 } })
9009
+ toolbarLabel ? /* @__PURE__ */ (0, import_jsx_runtime134.jsxs)(import_jsx_runtime134.Fragment, { children: [
9010
+ /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(import_material78.Typography, { variant: "subtitle2", color: "textSecondary", children: toolbarLabel }),
9011
+ /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(import_material78.Divider, { orientation: "vertical", sx: { height: 0.75, py: 2.5 } })
9234
9012
  ] }) : null,
9235
- renderBulkChangesDialog && refetchData ? /* @__PURE__ */ (0, import_jsx_runtime136.jsx)(
9236
- import_material79.Tooltip,
9013
+ renderBulkChangesDialog && refetchData ? /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(
9014
+ import_material78.Tooltip,
9237
9015
  {
9238
9016
  title: disableBulkChangesMode ? "Access denied, you don\u2019t have permission to use this feature." : "",
9239
- children: /* @__PURE__ */ (0, import_jsx_runtime136.jsx)(
9240
- import_material79.FormControlLabel,
9017
+ children: /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(
9018
+ import_material78.FormControlLabel,
9241
9019
  {
9242
9020
  label: "Bulk Changes Mode",
9243
9021
  disabled: disableBulkChangesMode || !visibleEditableColumns.length,
9244
- control: /* @__PURE__ */ (0, import_jsx_runtime136.jsx)(
9245
- import_material79.Switch,
9022
+ control: /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(
9023
+ import_material78.Switch,
9246
9024
  {
9247
9025
  size: "small",
9248
9026
  "aria-label": "bulk-changes-mode-switch",
@@ -9256,17 +9034,17 @@ var TableDesktopToolbar = ({
9256
9034
  ]
9257
9035
  }
9258
9036
  ),
9259
- isScrollable && /* @__PURE__ */ (0, import_jsx_runtime136.jsx)(
9260
- import_material79.IconButton,
9037
+ isScrollable && /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(
9038
+ import_material78.IconButton,
9261
9039
  {
9262
9040
  "aria-label": "scroll-left",
9263
9041
  sx: { padding: 0, alignSelf: "center" },
9264
9042
  onClick: () => scroll("left"),
9265
- children: /* @__PURE__ */ (0, import_jsx_runtime136.jsx)(import_KeyboardArrowLeft2.default, {})
9043
+ children: /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(import_KeyboardArrowLeft2.default, {})
9266
9044
  }
9267
9045
  ),
9268
- /* @__PURE__ */ (0, import_jsx_runtime136.jsx)(
9269
- import_material79.Box,
9046
+ /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(
9047
+ import_material78.Box,
9270
9048
  {
9271
9049
  ref: scrollRef,
9272
9050
  sx: {
@@ -9282,40 +9060,56 @@ var TableDesktopToolbar = ({
9282
9060
  display: "none"
9283
9061
  }
9284
9062
  },
9285
- children: isBulkChangesMode ? visibleEditableColumns.map((headCell) => {
9286
- const { id, width, editableCellType } = headCell;
9287
- return editableCellType && /* @__PURE__ */ (0, import_jsx_runtime136.jsx)(
9288
- import_material79.Box,
9063
+ children: isBulkChangesMode ? visibleEditableColumns.map(
9064
+ ({
9065
+ id,
9066
+ fieldName,
9067
+ label,
9068
+ editableCellType,
9069
+ filterOptions,
9070
+ refetchFilterOptions,
9071
+ isFetchingFilterOptions,
9072
+ validateInput,
9073
+ width
9074
+ }) => editableCellType && /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(
9075
+ import_material78.Box,
9289
9076
  {
9290
9077
  sx: { width, flex: "0 0 auto" },
9291
- children: /* @__PURE__ */ (0, import_jsx_runtime136.jsx)(
9078
+ children: /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(
9292
9079
  TableDesktopEditableField,
9293
9080
  {
9294
- headCell,
9081
+ field: id,
9295
9082
  size: "small",
9296
9083
  variant: "outlined",
9297
9084
  showCheckboxLabel: true,
9085
+ fieldName: fieldName ?? "",
9086
+ inputLabel: label ?? "",
9087
+ editableCellType,
9088
+ filterOptions,
9089
+ refetchFilterOptions,
9090
+ isFetchingFilterOptions,
9091
+ validateInput,
9298
9092
  onUpdateEditableCell: handleUpdateEditableCell
9299
9093
  }
9300
9094
  )
9301
9095
  },
9302
9096
  `${id}-${resetCounter}`
9303
- );
9304
- }) : null
9097
+ )
9098
+ ) : null
9305
9099
  }
9306
9100
  ),
9307
- isScrollable && /* @__PURE__ */ (0, import_jsx_runtime136.jsx)(
9308
- import_material79.IconButton,
9101
+ isScrollable && /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(
9102
+ import_material78.IconButton,
9309
9103
  {
9310
9104
  "aria-label": "scroll-right",
9311
9105
  sx: { p: 0, alignSelf: "center" },
9312
9106
  onClick: () => scroll("right"),
9313
- children: /* @__PURE__ */ (0, import_jsx_runtime136.jsx)(import_KeyboardArrowRight2.default, {})
9107
+ children: /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(import_KeyboardArrowRight2.default, {})
9314
9108
  }
9315
9109
  ),
9316
- isBulkChangesMode ? /* @__PURE__ */ (0, import_jsx_runtime136.jsxs)(import_jsx_runtime136.Fragment, { children: [
9317
- /* @__PURE__ */ (0, import_jsx_runtime136.jsx)(
9318
- import_material79.Button,
9110
+ isBulkChangesMode ? /* @__PURE__ */ (0, import_jsx_runtime134.jsxs)(import_jsx_runtime134.Fragment, { children: [
9111
+ /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(
9112
+ import_material78.Button,
9319
9113
  {
9320
9114
  variant: "outlined",
9321
9115
  sx: { borderRadius: 25, alignSelf: "center" },
@@ -9327,8 +9121,8 @@ var TableDesktopToolbar = ({
9327
9121
  children: "RESET"
9328
9122
  }
9329
9123
  ),
9330
- /* @__PURE__ */ (0, import_jsx_runtime136.jsx)(
9331
- import_material79.Button,
9124
+ /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(
9125
+ import_material78.Button,
9332
9126
  {
9333
9127
  variant: "contained",
9334
9128
  "aria-label": "bulk-changes-apply-button",
@@ -9338,26 +9132,26 @@ var TableDesktopToolbar = ({
9338
9132
  children: "APPLY"
9339
9133
  }
9340
9134
  )
9341
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime136.jsxs)(import_material79.Box, { sx: { display: "flex", alignItems: "center", gap: 1 }, children: [
9135
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime134.jsxs)(import_material78.Box, { sx: { display: "flex", alignItems: "center", gap: 1 }, children: [
9342
9136
  renderInfoIcons,
9343
- renderExportCsvDialog ? /* @__PURE__ */ (0, import_jsx_runtime136.jsx)(import_material79.Tooltip, { title: "Download Customer List", children: /* @__PURE__ */ (0, import_jsx_runtime136.jsx)("span", { style: { display: "flex", alignItems: "center" }, children: /* @__PURE__ */ (0, import_jsx_runtime136.jsx)(
9344
- import_material79.IconButton,
9137
+ renderExportCsvDialog ? /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(import_material78.Tooltip, { title: "Download Customer List", children: /* @__PURE__ */ (0, import_jsx_runtime134.jsx)("span", { style: { display: "flex", alignItems: "center" }, children: /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(
9138
+ import_material78.IconButton,
9345
9139
  {
9346
9140
  disableRipple: true,
9347
9141
  disabled: isDataEmpty,
9348
9142
  "aria-label": "export-csv-button",
9349
9143
  onClick: () => setIsExportCsvDialogOpen(true),
9350
- children: /* @__PURE__ */ (0, import_jsx_runtime136.jsx)(import_Download.default, { fill: colors.neutral750 })
9144
+ children: /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(import_Download.default, { fill: colors.neutral750 })
9351
9145
  }
9352
9146
  ) }) }) : null,
9353
- renderTableColumnConfigurationMenu ? /* @__PURE__ */ (0, import_jsx_runtime136.jsx)(import_material79.Tooltip, { title: "Table Column Configuration", children: /* @__PURE__ */ (0, import_jsx_runtime136.jsx)(
9354
- import_material79.IconButton,
9147
+ renderTableColumnConfigurationMenu ? /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(import_material78.Tooltip, { title: "Table Column Configuration", children: /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(
9148
+ import_material78.IconButton,
9355
9149
  {
9356
9150
  disableRipple: true,
9357
9151
  "aria-label": "table-column-config-button",
9358
9152
  ref: tableToolbarMenuButtonRef,
9359
9153
  onClick: onClickToolbarMenuOpen,
9360
- children: /* @__PURE__ */ (0, import_jsx_runtime136.jsx)(IconTableEdit_default, { fill: colors.neutral750 })
9154
+ children: /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(IconTableEdit_default, { fill: colors.neutral750 })
9361
9155
  }
9362
9156
  ) }) : null
9363
9157
  ] })
@@ -9390,11 +9184,11 @@ var TableDesktopToolbar = ({
9390
9184
  };
9391
9185
 
9392
9186
  // src/components/TableHeader/TableHeader.tsx
9393
- var import_react48 = require("react");
9187
+ var import_react45 = require("react");
9394
9188
  var import_icons_material12 = require("@mui/icons-material");
9395
- var import_material80 = require("@mui/material");
9189
+ var import_material79 = require("@mui/material");
9396
9190
  var import_mui54 = require("tss-react/mui");
9397
- var import_jsx_runtime137 = require("react/jsx-runtime");
9191
+ var import_jsx_runtime135 = require("react/jsx-runtime");
9398
9192
  var useStyles48 = (0, import_mui54.makeStyles)()(() => ({
9399
9193
  sortLabel: {
9400
9194
  "& .MuiTableSortLabel-icon": {
@@ -9403,9 +9197,9 @@ var useStyles48 = (0, import_mui54.makeStyles)()(() => ({
9403
9197
  }
9404
9198
  }));
9405
9199
  var TableHeader = ({ cells, onSort = null }) => {
9406
- const [sortableCells, setSortableCells] = (0, import_react48.useState)([]);
9200
+ const [sortableCells, setSortableCells] = (0, import_react45.useState)([]);
9407
9201
  const { classes } = useStyles48();
9408
- (0, import_react48.useEffect)(() => {
9202
+ (0, import_react45.useEffect)(() => {
9409
9203
  setSortableCells(cells);
9410
9204
  }, []);
9411
9205
  const getNewSortDirection = (direction) => {
@@ -9439,8 +9233,8 @@ var TableHeader = ({ cells, onSort = null }) => {
9439
9233
  });
9440
9234
  setSortableCells(sortedCells);
9441
9235
  };
9442
- return /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(import_material80.TableHead, { children: /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(import_material80.TableRow, { children: sortableCells.map((cell, key) => /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(import_material80.TableCell, { children: cell.isSortable ? /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(
9443
- import_material80.TableSortLabel,
9236
+ return /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(import_material79.TableHead, { children: /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(import_material79.TableRow, { children: sortableCells.map((cell, key) => /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(import_material79.TableCell, { children: cell.isSortable ? /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(
9237
+ import_material79.TableSortLabel,
9444
9238
  {
9445
9239
  className: classes.sortLabel,
9446
9240
  direction: cell?.direction || "asc",
@@ -9450,12 +9244,12 @@ var TableHeader = ({ cells, onSort = null }) => {
9450
9244
  }
9451
9245
  ) : cell.label }, cell.label || key)) }) });
9452
9246
  };
9453
- var TableHeader_default = (0, import_react48.memo)(TableHeader);
9247
+ var TableHeader_default = (0, import_react45.memo)(TableHeader);
9454
9248
 
9455
9249
  // src/components/TextDivider/TextDivider.tsx
9456
- var import_material81 = require("@mui/material");
9250
+ var import_material80 = require("@mui/material");
9457
9251
  var import_mui55 = require("tss-react/mui");
9458
- var import_jsx_runtime138 = require("react/jsx-runtime");
9252
+ var import_jsx_runtime136 = require("react/jsx-runtime");
9459
9253
  var useStyles49 = (0, import_mui55.makeStyles)()(() => ({
9460
9254
  icon: {
9461
9255
  fontSize: 20
@@ -9492,19 +9286,19 @@ var TextDivider = ({
9492
9286
  }) => {
9493
9287
  const { classes } = useStyles49();
9494
9288
  const iconColor = color ?? colors.neutral900;
9495
- return /* @__PURE__ */ (0, import_jsx_runtime138.jsxs)(
9496
- import_material81.Box,
9289
+ return /* @__PURE__ */ (0, import_jsx_runtime136.jsxs)(
9290
+ import_material80.Box,
9497
9291
  {
9498
9292
  display: "flex",
9499
9293
  alignItems: "center",
9500
9294
  justifyContent: "space-between",
9501
9295
  className: classes.container,
9502
9296
  children: [
9503
- /* @__PURE__ */ (0, import_jsx_runtime138.jsx)(import_material81.Divider, { className: classes.leftDivider }),
9504
- /* @__PURE__ */ (0, import_jsx_runtime138.jsx)(import_material81.Button, { onClick, disabled: !onClick, className: classes.button, children: /* @__PURE__ */ (0, import_jsx_runtime138.jsxs)(import_material81.Box, { className: classes.center, children: [
9505
- Icon2 && iconPosition === "left" && /* @__PURE__ */ (0, import_jsx_runtime138.jsx)(Icon2, { className: classes.icon, style: { color: iconColor } }),
9506
- /* @__PURE__ */ (0, import_jsx_runtime138.jsx)(
9507
- import_material81.Typography,
9297
+ /* @__PURE__ */ (0, import_jsx_runtime136.jsx)(import_material80.Divider, { className: classes.leftDivider }),
9298
+ /* @__PURE__ */ (0, import_jsx_runtime136.jsx)(import_material80.Button, { onClick, disabled: !onClick, className: classes.button, children: /* @__PURE__ */ (0, import_jsx_runtime136.jsxs)(import_material80.Box, { className: classes.center, children: [
9299
+ Icon2 && iconPosition === "left" && /* @__PURE__ */ (0, import_jsx_runtime136.jsx)(Icon2, { className: classes.icon, style: { color: iconColor } }),
9300
+ /* @__PURE__ */ (0, import_jsx_runtime136.jsx)(
9301
+ import_material80.Typography,
9508
9302
  {
9509
9303
  color: "textSecondary",
9510
9304
  className: classes.title,
@@ -9512,9 +9306,9 @@ var TextDivider = ({
9512
9306
  children: title
9513
9307
  }
9514
9308
  ),
9515
- Icon2 && iconPosition === "right" && /* @__PURE__ */ (0, import_jsx_runtime138.jsx)(Icon2, { className: classes.icon, style: { color: iconColor } })
9309
+ Icon2 && iconPosition === "right" && /* @__PURE__ */ (0, import_jsx_runtime136.jsx)(Icon2, { className: classes.icon, style: { color: iconColor } })
9516
9310
  ] }) }),
9517
- /* @__PURE__ */ (0, import_jsx_runtime138.jsx)(import_material81.Divider, { className: classes.rightDivider })
9311
+ /* @__PURE__ */ (0, import_jsx_runtime136.jsx)(import_material80.Divider, { className: classes.rightDivider })
9518
9312
  ]
9519
9313
  }
9520
9314
  );
@@ -9526,7 +9320,7 @@ var import_react_dates = require("react-dates");
9526
9320
  var import_mui56 = require("tss-react/mui");
9527
9321
  var import_initialize = require("react-dates/initialize");
9528
9322
  var import_datepicker = require("react-dates/lib/css/_datepicker.css");
9529
- var import_jsx_runtime139 = require("react/jsx-runtime");
9323
+ var import_jsx_runtime137 = require("react/jsx-runtime");
9530
9324
  var useStyles50 = (0, import_mui56.makeStyles)()((theme) => ({
9531
9325
  wrapper: {
9532
9326
  "& .DateRangePicker": {
@@ -9622,15 +9416,15 @@ var ThemedDateRangePicker = ({
9622
9416
  ...props
9623
9417
  }) => {
9624
9418
  const { classes, cx } = useStyles50();
9625
- return /* @__PURE__ */ (0, import_jsx_runtime139.jsx)("div", { className: cx(classes.wrapper, className), children: /* @__PURE__ */ (0, import_jsx_runtime139.jsx)(import_react_dates.DateRangePicker, { ...props }) });
9419
+ return /* @__PURE__ */ (0, import_jsx_runtime137.jsx)("div", { className: cx(classes.wrapper, className), children: /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(import_react_dates.DateRangePicker, { ...props }) });
9626
9420
  };
9627
9421
  var ThemedDateRangePicker_default = ThemedDateRangePicker;
9628
9422
 
9629
9423
  // src/components/TheToolbar/TheToolbar.tsx
9630
- var import_react49 = require("react");
9631
- var import_material82 = require("@mui/material");
9424
+ var import_react46 = require("react");
9425
+ var import_material81 = require("@mui/material");
9632
9426
  var import_mui57 = require("tss-react/mui");
9633
- var import_jsx_runtime140 = require("react/jsx-runtime");
9427
+ var import_jsx_runtime138 = require("react/jsx-runtime");
9634
9428
  var useStyles51 = (0, import_mui57.makeStyles)()((theme) => ({
9635
9429
  menuButton: {
9636
9430
  color: theme.palette.primary.contrastText
@@ -9650,9 +9444,9 @@ var TheToolbar = ({
9650
9444
  rightSection
9651
9445
  }) => {
9652
9446
  const { classes } = useStyles51();
9653
- return /* @__PURE__ */ (0, import_jsx_runtime140.jsxs)(import_material82.Box, { children: [
9654
- /* @__PURE__ */ (0, import_jsx_runtime140.jsx)(import_material82.AppBar, { children: /* @__PURE__ */ (0, import_jsx_runtime140.jsxs)(import_material82.Toolbar, { className: classes.topBar, children: [
9655
- /* @__PURE__ */ (0, import_jsx_runtime140.jsx)(
9447
+ return /* @__PURE__ */ (0, import_jsx_runtime138.jsxs)(import_material81.Box, { children: [
9448
+ /* @__PURE__ */ (0, import_jsx_runtime138.jsx)(import_material81.AppBar, { children: /* @__PURE__ */ (0, import_jsx_runtime138.jsxs)(import_material81.Toolbar, { className: classes.topBar, children: [
9449
+ /* @__PURE__ */ (0, import_jsx_runtime138.jsx)(
9656
9450
  RoundButton_default,
9657
9451
  {
9658
9452
  className: classes.menuButton,
@@ -9661,7 +9455,7 @@ var TheToolbar = ({
9661
9455
  onClick: handleOpen
9662
9456
  }
9663
9457
  ),
9664
- /* @__PURE__ */ (0, import_jsx_runtime140.jsx)(
9458
+ /* @__PURE__ */ (0, import_jsx_runtime138.jsx)(
9665
9459
  CompanyLogo_default,
9666
9460
  {
9667
9461
  size: "small",
@@ -9670,31 +9464,31 @@ var TheToolbar = ({
9670
9464
  imageLogoLightSmall
9671
9465
  }
9672
9466
  ),
9673
- /* @__PURE__ */ (0, import_jsx_runtime140.jsx)(import_material82.Box, { ml: 2, children: leftSection }),
9674
- /* @__PURE__ */ (0, import_jsx_runtime140.jsx)(import_material82.Box, { ml: "auto", children: rightSection })
9467
+ /* @__PURE__ */ (0, import_jsx_runtime138.jsx)(import_material81.Box, { ml: 2, children: leftSection }),
9468
+ /* @__PURE__ */ (0, import_jsx_runtime138.jsx)(import_material81.Box, { ml: "auto", children: rightSection })
9675
9469
  ] }) }),
9676
9470
  LeftDrawer
9677
9471
  ] });
9678
9472
  };
9679
- var TheToolbar_default = (0, import_react49.memo)(TheToolbar);
9473
+ var TheToolbar_default = (0, import_react46.memo)(TheToolbar);
9680
9474
 
9681
9475
  // src/components/ToastMessage/ToastMessage.tsx
9682
- var import_material83 = require("@mui/material");
9683
- var import_jsx_runtime141 = require("react/jsx-runtime");
9476
+ var import_material82 = require("@mui/material");
9477
+ var import_jsx_runtime139 = require("react/jsx-runtime");
9684
9478
  var ToastMessage = ({
9685
9479
  toastType,
9686
9480
  toastMessage,
9687
9481
  open,
9688
9482
  onClose
9689
- }) => /* @__PURE__ */ (0, import_jsx_runtime141.jsx)(
9690
- import_material83.Snackbar,
9483
+ }) => /* @__PURE__ */ (0, import_jsx_runtime139.jsx)(
9484
+ import_material82.Snackbar,
9691
9485
  {
9692
9486
  open,
9693
9487
  autoHideDuration: 1500,
9694
9488
  onClose,
9695
9489
  anchorOrigin: { vertical: "top", horizontal: "right" },
9696
- children: /* @__PURE__ */ (0, import_jsx_runtime141.jsx)(
9697
- import_material83.Alert,
9490
+ children: /* @__PURE__ */ (0, import_jsx_runtime139.jsx)(
9491
+ import_material82.Alert,
9698
9492
  {
9699
9493
  elevation: 6,
9700
9494
  variant: "filled",
@@ -9720,9 +9514,9 @@ var ToastMessage = ({
9720
9514
  var ToastMessage_default = ToastMessage;
9721
9515
 
9722
9516
  // src/components/TwoButtonDialog/TwoButtonDialog.tsx
9723
- var import_material84 = require("@mui/material");
9517
+ var import_material83 = require("@mui/material");
9724
9518
  var import_mui58 = require("tss-react/mui");
9725
- var import_jsx_runtime142 = require("react/jsx-runtime");
9519
+ var import_jsx_runtime140 = require("react/jsx-runtime");
9726
9520
  var useStyles52 = (0, import_mui58.makeStyles)()((theme) => ({
9727
9521
  paper: {
9728
9522
  padding: theme.spacing(2)
@@ -9752,20 +9546,20 @@ var TwoButtonDialog = ({
9752
9546
  cancelButton
9753
9547
  }) => {
9754
9548
  const { classes } = useStyles52();
9755
- return /* @__PURE__ */ (0, import_jsx_runtime142.jsx)(
9756
- import_material84.Dialog,
9549
+ return /* @__PURE__ */ (0, import_jsx_runtime140.jsx)(
9550
+ import_material83.Dialog,
9757
9551
  {
9758
9552
  open,
9759
9553
  disableEnforceFocus: true,
9760
9554
  maxWidth: "sm",
9761
9555
  fullWidth: true,
9762
9556
  closeAfterTransition: true,
9763
- BackdropComponent: import_material84.Backdrop,
9557
+ BackdropComponent: import_material83.Backdrop,
9764
9558
  BackdropProps: { timeout: 500 },
9765
- children: /* @__PURE__ */ (0, import_jsx_runtime142.jsx)(import_material84.Fade, { in: open, children: /* @__PURE__ */ (0, import_jsx_runtime142.jsxs)(import_material84.Paper, { className: classes.paper, children: [
9766
- /* @__PURE__ */ (0, import_jsx_runtime142.jsxs)(import_material84.Box, { className: classes.mb, children: [
9767
- /* @__PURE__ */ (0, import_jsx_runtime142.jsx)(import_material84.Typography, { variant: "h5", component: "div", children: /* @__PURE__ */ (0, import_jsx_runtime142.jsx)(
9768
- import_material84.Box,
9559
+ children: /* @__PURE__ */ (0, import_jsx_runtime140.jsx)(import_material83.Fade, { in: open, children: /* @__PURE__ */ (0, import_jsx_runtime140.jsxs)(import_material83.Paper, { className: classes.paper, children: [
9560
+ /* @__PURE__ */ (0, import_jsx_runtime140.jsxs)(import_material83.Box, { className: classes.mb, children: [
9561
+ /* @__PURE__ */ (0, import_jsx_runtime140.jsx)(import_material83.Typography, { variant: "h5", component: "div", children: /* @__PURE__ */ (0, import_jsx_runtime140.jsx)(
9562
+ import_material83.Box,
9769
9563
  {
9770
9564
  sx: {
9771
9565
  fontWeight: 600
@@ -9773,23 +9567,23 @@ var TwoButtonDialog = ({
9773
9567
  children: title
9774
9568
  }
9775
9569
  ) }),
9776
- /* @__PURE__ */ (0, import_jsx_runtime142.jsxs)(
9777
- import_material84.Box,
9570
+ /* @__PURE__ */ (0, import_jsx_runtime140.jsxs)(
9571
+ import_material83.Box,
9778
9572
  {
9779
9573
  className: classes.mt,
9780
9574
  sx: {
9781
9575
  fontWeight: 600
9782
9576
  },
9783
9577
  children: [
9784
- subtitle1 && /* @__PURE__ */ (0, import_jsx_runtime142.jsx)(import_material84.Typography, { variant: "subtitle1", children: subtitle1 }),
9785
- subtitle2 && /* @__PURE__ */ (0, import_jsx_runtime142.jsx)(import_material84.Typography, { variant: "subtitle1", children: subtitle2 })
9578
+ subtitle1 && /* @__PURE__ */ (0, import_jsx_runtime140.jsx)(import_material83.Typography, { variant: "subtitle1", children: subtitle1 }),
9579
+ subtitle2 && /* @__PURE__ */ (0, import_jsx_runtime140.jsx)(import_material83.Typography, { variant: "subtitle1", children: subtitle2 })
9786
9580
  ]
9787
9581
  }
9788
9582
  )
9789
9583
  ] }),
9790
- /* @__PURE__ */ (0, import_jsx_runtime142.jsx)(import_material84.Divider, {}),
9791
- /* @__PURE__ */ (0, import_jsx_runtime142.jsxs)(import_material84.Box, { className: classes.buttonContainer, children: [
9792
- /* @__PURE__ */ (0, import_jsx_runtime142.jsx)(
9584
+ /* @__PURE__ */ (0, import_jsx_runtime140.jsx)(import_material83.Divider, {}),
9585
+ /* @__PURE__ */ (0, import_jsx_runtime140.jsxs)(import_material83.Box, { className: classes.buttonContainer, children: [
9586
+ /* @__PURE__ */ (0, import_jsx_runtime140.jsx)(
9793
9587
  FilledButton_default,
9794
9588
  {
9795
9589
  copy: cancelLabel,
@@ -9802,7 +9596,7 @@ var TwoButtonDialog = ({
9802
9596
  }
9803
9597
  }
9804
9598
  ),
9805
- /* @__PURE__ */ (0, import_jsx_runtime142.jsx)(
9599
+ /* @__PURE__ */ (0, import_jsx_runtime140.jsx)(
9806
9600
  FilledButton_default,
9807
9601
  {
9808
9602
  color: "primary",
@@ -9811,7 +9605,7 @@ var TwoButtonDialog = ({
9811
9605
  }
9812
9606
  )
9813
9607
  ] }),
9814
- /* @__PURE__ */ (0, import_jsx_runtime142.jsx)(Loading_default, { isLoading: dialogLoading })
9608
+ /* @__PURE__ */ (0, import_jsx_runtime140.jsx)(Loading_default, { isLoading: dialogLoading })
9815
9609
  ] }) })
9816
9610
  }
9817
9611
  );
@@ -9819,30 +9613,30 @@ var TwoButtonDialog = ({
9819
9613
  var TwoButtonDialog_default = TwoButtonDialog;
9820
9614
 
9821
9615
  // src/components/UserBust/UserBust.tsx
9822
- var import_react50 = require("react");
9823
- var import_material85 = require("@mui/material");
9824
- var import_jsx_runtime143 = require("react/jsx-runtime");
9825
- var UserBust = ({ user, avatarProps, typographyProps }) => /* @__PURE__ */ (0, import_jsx_runtime143.jsxs)("div", { children: [
9826
- /* @__PURE__ */ (0, import_jsx_runtime143.jsx)(
9827
- import_material85.Avatar,
9616
+ var import_react47 = require("react");
9617
+ var import_material84 = require("@mui/material");
9618
+ var import_jsx_runtime141 = require("react/jsx-runtime");
9619
+ var UserBust = ({ user, avatarProps, typographyProps }) => /* @__PURE__ */ (0, import_jsx_runtime141.jsxs)("div", { children: [
9620
+ /* @__PURE__ */ (0, import_jsx_runtime141.jsx)(
9621
+ import_material84.Avatar,
9828
9622
  {
9829
9623
  src: user.profile_picture,
9830
9624
  alt: "user_avatar",
9831
9625
  style: { width: avatarProps.width, height: avatarProps.height }
9832
9626
  }
9833
9627
  ),
9834
- /* @__PURE__ */ (0, import_jsx_runtime143.jsxs)("div", { style: { paddingTop: 16 }, children: [
9835
- /* @__PURE__ */ (0, import_jsx_runtime143.jsx)(import_material85.Typography, { ...typographyProps.name, children: `${user.first_name} ${user.last_name}` }),
9836
- /* @__PURE__ */ (0, import_jsx_runtime143.jsx)(import_material85.Typography, { ...typographyProps.username, children: user.username })
9628
+ /* @__PURE__ */ (0, import_jsx_runtime141.jsxs)("div", { style: { paddingTop: 16 }, children: [
9629
+ /* @__PURE__ */ (0, import_jsx_runtime141.jsx)(import_material84.Typography, { ...typographyProps.name, children: `${user.first_name} ${user.last_name}` }),
9630
+ /* @__PURE__ */ (0, import_jsx_runtime141.jsx)(import_material84.Typography, { ...typographyProps.username, children: user.username })
9837
9631
  ] })
9838
9632
  ] });
9839
- var UserBust_default = (0, import_react50.memo)(UserBust);
9633
+ var UserBust_default = (0, import_react47.memo)(UserBust);
9840
9634
 
9841
9635
  // src/components/icons/IconChart.tsx
9842
- var import_jsx_runtime144 = require("react/jsx-runtime");
9636
+ var import_jsx_runtime142 = require("react/jsx-runtime");
9843
9637
  var SvgIconChart = (props) => {
9844
9638
  const { fill } = props;
9845
- return /* @__PURE__ */ (0, import_jsx_runtime144.jsx)(
9639
+ return /* @__PURE__ */ (0, import_jsx_runtime142.jsx)(
9846
9640
  "svg",
9847
9641
  {
9848
9642
  width: "20",
@@ -9851,7 +9645,7 @@ var SvgIconChart = (props) => {
9851
9645
  fill: "none",
9852
9646
  xmlns: "http://www.w3.org/2000/svg",
9853
9647
  ...props,
9854
- children: /* @__PURE__ */ (0, import_jsx_runtime144.jsx)(
9648
+ children: /* @__PURE__ */ (0, import_jsx_runtime142.jsx)(
9855
9649
  "path",
9856
9650
  {
9857
9651
  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",
@@ -9930,7 +9724,6 @@ var IconChart_default = SvgIconChart;
9930
9724
  SearchWithFilters,
9931
9725
  SearchWithFiltersForTable,
9932
9726
  SectionName,
9933
- SmartMultipleSelect,
9934
9727
  SmartSelect,
9935
9728
  SmartTableHeader,
9936
9729
  SmartTableHeaderFilterMenu,