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