@natoora-libs/core 0.1.9-dev-doug-2 → 0.1.10

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.
@@ -29,9 +29,9 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
29
29
  ));
30
30
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
31
31
 
32
- // node_modules/lodash/isObject.js
32
+ // ../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/isObject.js
33
33
  var require_isObject = __commonJS({
34
- "node_modules/lodash/isObject.js"(exports2, module2) {
34
+ "../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/isObject.js"(exports2, module2) {
35
35
  function isObject(value) {
36
36
  var type = typeof value;
37
37
  return value != null && (type == "object" || type == "function");
@@ -40,17 +40,17 @@ var require_isObject = __commonJS({
40
40
  }
41
41
  });
42
42
 
43
- // node_modules/lodash/_freeGlobal.js
43
+ // ../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_freeGlobal.js
44
44
  var require_freeGlobal = __commonJS({
45
- "node_modules/lodash/_freeGlobal.js"(exports2, module2) {
45
+ "../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_freeGlobal.js"(exports2, module2) {
46
46
  var freeGlobal = typeof global == "object" && global && global.Object === Object && global;
47
47
  module2.exports = freeGlobal;
48
48
  }
49
49
  });
50
50
 
51
- // node_modules/lodash/_root.js
51
+ // ../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_root.js
52
52
  var require_root = __commonJS({
53
- "node_modules/lodash/_root.js"(exports2, module2) {
53
+ "../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_root.js"(exports2, module2) {
54
54
  var freeGlobal = require_freeGlobal();
55
55
  var freeSelf = typeof self == "object" && self && self.Object === Object && self;
56
56
  var root = freeGlobal || freeSelf || Function("return this")();
@@ -58,9 +58,9 @@ var require_root = __commonJS({
58
58
  }
59
59
  });
60
60
 
61
- // node_modules/lodash/now.js
61
+ // ../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/now.js
62
62
  var require_now = __commonJS({
63
- "node_modules/lodash/now.js"(exports2, module2) {
63
+ "../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/now.js"(exports2, module2) {
64
64
  var root = require_root();
65
65
  var now = function() {
66
66
  return root.Date.now();
@@ -69,9 +69,9 @@ var require_now = __commonJS({
69
69
  }
70
70
  });
71
71
 
72
- // node_modules/lodash/_trimmedEndIndex.js
72
+ // ../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_trimmedEndIndex.js
73
73
  var require_trimmedEndIndex = __commonJS({
74
- "node_modules/lodash/_trimmedEndIndex.js"(exports2, module2) {
74
+ "../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_trimmedEndIndex.js"(exports2, module2) {
75
75
  var reWhitespace = /\s/;
76
76
  function trimmedEndIndex(string) {
77
77
  var index = string.length;
@@ -83,9 +83,9 @@ var require_trimmedEndIndex = __commonJS({
83
83
  }
84
84
  });
85
85
 
86
- // node_modules/lodash/_baseTrim.js
86
+ // ../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_baseTrim.js
87
87
  var require_baseTrim = __commonJS({
88
- "node_modules/lodash/_baseTrim.js"(exports2, module2) {
88
+ "../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_baseTrim.js"(exports2, module2) {
89
89
  var trimmedEndIndex = require_trimmedEndIndex();
90
90
  var reTrimStart = /^\s+/;
91
91
  function baseTrim(string) {
@@ -95,18 +95,18 @@ var require_baseTrim = __commonJS({
95
95
  }
96
96
  });
97
97
 
98
- // node_modules/lodash/_Symbol.js
98
+ // ../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_Symbol.js
99
99
  var require_Symbol = __commonJS({
100
- "node_modules/lodash/_Symbol.js"(exports2, module2) {
100
+ "../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_Symbol.js"(exports2, module2) {
101
101
  var root = require_root();
102
102
  var Symbol2 = root.Symbol;
103
103
  module2.exports = Symbol2;
104
104
  }
105
105
  });
106
106
 
107
- // node_modules/lodash/_getRawTag.js
107
+ // ../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_getRawTag.js
108
108
  var require_getRawTag = __commonJS({
109
- "node_modules/lodash/_getRawTag.js"(exports2, module2) {
109
+ "../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_getRawTag.js"(exports2, module2) {
110
110
  var Symbol2 = require_Symbol();
111
111
  var objectProto = Object.prototype;
112
112
  var hasOwnProperty = objectProto.hasOwnProperty;
@@ -133,9 +133,9 @@ var require_getRawTag = __commonJS({
133
133
  }
134
134
  });
135
135
 
136
- // node_modules/lodash/_objectToString.js
136
+ // ../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_objectToString.js
137
137
  var require_objectToString = __commonJS({
138
- "node_modules/lodash/_objectToString.js"(exports2, module2) {
138
+ "../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_objectToString.js"(exports2, module2) {
139
139
  var objectProto = Object.prototype;
140
140
  var nativeObjectToString = objectProto.toString;
141
141
  function objectToString(value) {
@@ -145,9 +145,9 @@ var require_objectToString = __commonJS({
145
145
  }
146
146
  });
147
147
 
148
- // node_modules/lodash/_baseGetTag.js
148
+ // ../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_baseGetTag.js
149
149
  var require_baseGetTag = __commonJS({
150
- "node_modules/lodash/_baseGetTag.js"(exports2, module2) {
150
+ "../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_baseGetTag.js"(exports2, module2) {
151
151
  var Symbol2 = require_Symbol();
152
152
  var getRawTag = require_getRawTag();
153
153
  var objectToString = require_objectToString();
@@ -164,9 +164,9 @@ var require_baseGetTag = __commonJS({
164
164
  }
165
165
  });
166
166
 
167
- // node_modules/lodash/isObjectLike.js
167
+ // ../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/isObjectLike.js
168
168
  var require_isObjectLike = __commonJS({
169
- "node_modules/lodash/isObjectLike.js"(exports2, module2) {
169
+ "../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/isObjectLike.js"(exports2, module2) {
170
170
  function isObjectLike(value) {
171
171
  return value != null && typeof value == "object";
172
172
  }
@@ -174,9 +174,9 @@ var require_isObjectLike = __commonJS({
174
174
  }
175
175
  });
176
176
 
177
- // node_modules/lodash/isSymbol.js
177
+ // ../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/isSymbol.js
178
178
  var require_isSymbol = __commonJS({
179
- "node_modules/lodash/isSymbol.js"(exports2, module2) {
179
+ "../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/isSymbol.js"(exports2, module2) {
180
180
  var baseGetTag = require_baseGetTag();
181
181
  var isObjectLike = require_isObjectLike();
182
182
  var symbolTag = "[object Symbol]";
@@ -187,9 +187,9 @@ var require_isSymbol = __commonJS({
187
187
  }
188
188
  });
189
189
 
190
- // node_modules/lodash/toNumber.js
190
+ // ../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/toNumber.js
191
191
  var require_toNumber = __commonJS({
192
- "node_modules/lodash/toNumber.js"(exports2, module2) {
192
+ "../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/toNumber.js"(exports2, module2) {
193
193
  var baseTrim = require_baseTrim();
194
194
  var isObject = require_isObject();
195
195
  var isSymbol = require_isSymbol();
@@ -220,9 +220,9 @@ var require_toNumber = __commonJS({
220
220
  }
221
221
  });
222
222
 
223
- // node_modules/lodash/debounce.js
223
+ // ../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/debounce.js
224
224
  var require_debounce = __commonJS({
225
- "node_modules/lodash/debounce.js"(exports2, module2) {
225
+ "../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/debounce.js"(exports2, module2) {
226
226
  var isObject = require_isObject();
227
227
  var now = require_now();
228
228
  var toNumber = require_toNumber();
@@ -371,7 +371,6 @@ __export(components_exports, {
371
371
  ScrollableDialog: () => ScrollableDialog_default,
372
372
  SearchAndFilterHeader: () => SearchAndFilterHeader_default,
373
373
  SearchAndFilterHeaderForTable: () => SearchAndFilterHeaderForTable_default,
374
- SearchFieldDebounced: () => SearchFieldDebounced,
375
374
  SearchWithFilters: () => SearchWithFilters_default,
376
375
  SearchWithFiltersForTable: () => SearchWithFiltersForTable_default,
377
376
  SectionName: () => SectionName_default,
@@ -383,9 +382,6 @@ __export(components_exports, {
383
382
  Switch: () => Switch_default,
384
383
  Table: () => Table_default,
385
384
  TableDesktop: () => TableDesktop_default,
386
- TableDesktopRowActions: () => TableDesktopRowActions,
387
- TableDesktopRowCell: () => TableDesktopRowCell,
388
- TableDesktopSmartSelect: () => TableDesktopSmartSelect,
389
385
  TableEmptyResult: () => TableEmptyResult_default,
390
386
  TableHeader: () => TableHeader_default,
391
387
  TableLoading: () => TableLoading_default,
@@ -6036,8 +6032,6 @@ var useStyles38 = (0, import_mui43.makeStyles)()((theme) => ({
6036
6032
  }
6037
6033
  },
6038
6034
  wrapper: {
6039
- overflow: "hidden",
6040
- maxHeight: 728,
6041
6035
  height: "100%",
6042
6036
  backgroundColor: colors.neutral100
6043
6037
  },
@@ -6500,60 +6494,11 @@ var SearchAndFilterHeaderForTable = (props) => {
6500
6494
  };
6501
6495
  var SearchAndFilterHeaderForTable_default = React4.memo(SearchAndFilterHeaderForTable);
6502
6496
 
6503
- // src/components/SearchFieldDebounced/SearchFieldDebounced.tsx
6504
- var import_react28 = require("react");
6505
- var import_material53 = require("@mui/material");
6506
- var import_Search = __toESM(require("@mui/icons-material/Search"), 1);
6507
- var import_jsx_runtime104 = require("react/jsx-runtime");
6508
- var SearchFieldDebounced = ({
6509
- onSearch,
6510
- initialValue = "",
6511
- debounceDelay = 500
6512
- }) => {
6513
- const [value, setValue] = (0, import_react28.useState)(initialValue);
6514
- const debounceRef = (0, import_react28.useRef)(null);
6515
- const handleChange = (e) => {
6516
- setValue(e.target.value);
6517
- if (debounceRef.current) {
6518
- clearTimeout(debounceRef.current);
6519
- }
6520
- ;
6521
- debounceRef.current = window.setTimeout(() => {
6522
- onSearch(e.target.value);
6523
- }, debounceDelay);
6524
- };
6525
- (0, import_react28.useEffect)(() => {
6526
- return () => {
6527
- if (debounceRef.current) clearTimeout(debounceRef.current);
6528
- };
6529
- }, []);
6530
- return /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(import_material53.Box, { width: 285, children: /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(
6531
- import_material53.TextField,
6532
- {
6533
- fullWidth: true,
6534
- variant: "outlined",
6535
- placeholder: "Search",
6536
- value,
6537
- onChange: handleChange,
6538
- slotProps: {
6539
- input: {
6540
- sx: {
6541
- maxHeight: 5,
6542
- px: 2,
6543
- py: 2.5
6544
- },
6545
- startAdornment: /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(import_material53.InputAdornment, { position: "start", children: /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(import_Search.default, { fontSize: "small" }) })
6546
- }
6547
- }
6548
- }
6549
- ) });
6550
- };
6551
-
6552
6497
  // src/components/SectionName/SectionName.tsx
6553
6498
  var import_icons_material11 = require("@mui/icons-material");
6554
- var import_material54 = require("@mui/material");
6499
+ var import_material53 = require("@mui/material");
6555
6500
  var import_mui48 = require("tss-react/mui");
6556
- var import_jsx_runtime105 = require("react/jsx-runtime");
6501
+ var import_jsx_runtime104 = require("react/jsx-runtime");
6557
6502
  var useStyles43 = (0, import_mui48.makeStyles)()((theme) => ({
6558
6503
  container: {
6559
6504
  display: "flex",
@@ -6596,10 +6541,10 @@ var SectionName = ({
6596
6541
  openHistoryLog
6597
6542
  }) => {
6598
6543
  const { classes } = useStyles43();
6599
- return /* @__PURE__ */ (0, import_jsx_runtime105.jsxs)(import_material54.Box, { className: classes.container, children: [
6600
- /* @__PURE__ */ (0, import_jsx_runtime105.jsxs)(import_material54.Box, { className: classes.titleContainer, children: [
6601
- /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(
6602
- import_material54.Typography,
6544
+ return /* @__PURE__ */ (0, import_jsx_runtime104.jsxs)(import_material53.Box, { className: classes.container, children: [
6545
+ /* @__PURE__ */ (0, import_jsx_runtime104.jsxs)(import_material53.Box, { className: classes.titleContainer, children: [
6546
+ /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(
6547
+ import_material53.Typography,
6603
6548
  {
6604
6549
  variant: "h5",
6605
6550
  component: "a",
@@ -6608,7 +6553,7 @@ var SectionName = ({
6608
6553
  children: name
6609
6554
  }
6610
6555
  ),
6611
- tooltipDescription ? /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(import_material54.Tooltip, { title: tooltipDescription, placement: "right", children: /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(
6556
+ tooltipDescription ? /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(import_material53.Tooltip, { title: tooltipDescription, placement: "right", children: /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(
6612
6557
  import_icons_material11.Info,
6613
6558
  {
6614
6559
  fontSize: "small",
@@ -6617,8 +6562,8 @@ var SectionName = ({
6617
6562
  }
6618
6563
  ) }) : null
6619
6564
  ] }),
6620
- /* @__PURE__ */ (0, import_jsx_runtime105.jsxs)(import_material54.Box, { className: classes.actionButtons, children: [
6621
- buttonText ? /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(
6565
+ /* @__PURE__ */ (0, import_jsx_runtime104.jsxs)(import_material53.Box, { className: classes.actionButtons, children: [
6566
+ buttonText ? /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(
6622
6567
  ExtendedButton_default,
6623
6568
  {
6624
6569
  type: buttonType,
@@ -6631,25 +6576,25 @@ var SectionName = ({
6631
6576
  variant: "text"
6632
6577
  }
6633
6578
  ) : null,
6634
- openHistoryLog && buttonText && /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(import_material54.Divider, { orientation: "vertical", sx: { height: "24px" } }),
6635
- openHistoryLog && /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(import_material54.IconButton, { size: "small", onClick: () => openHistoryLog(), children: /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(import_icons_material11.History, {}) })
6579
+ openHistoryLog && buttonText && /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(import_material53.Divider, { orientation: "vertical", sx: { height: "24px" } }),
6580
+ openHistoryLog && /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(import_material53.IconButton, { size: "small", onClick: () => openHistoryLog(), children: /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(import_icons_material11.History, {}) })
6636
6581
  ] })
6637
6582
  ] });
6638
6583
  };
6639
6584
  var SectionName_default = SectionName;
6640
6585
 
6641
6586
  // src/components/SmartSelect/SmartSelect.tsx
6642
- var import_react29 = require("react");
6643
- var import_material55 = require("@mui/material");
6587
+ var import_react28 = require("react");
6588
+ var import_material54 = require("@mui/material");
6644
6589
  var import_mui49 = require("tss-react/mui");
6645
- var import_jsx_runtime106 = require("react/jsx-runtime");
6590
+ var import_jsx_runtime105 = require("react/jsx-runtime");
6646
6591
  var useStyles44 = (0, import_mui49.makeStyles)()(() => ({
6647
6592
  container: {
6648
6593
  display: "flex",
6649
6594
  flexDirection: "column"
6650
6595
  }
6651
6596
  }));
6652
- var SmartSelect = (0, import_react29.forwardRef)(
6597
+ var SmartSelect = (0, import_react28.forwardRef)(
6653
6598
  ({
6654
6599
  value,
6655
6600
  defaultOption,
@@ -6668,9 +6613,9 @@ var SmartSelect = (0, import_react29.forwardRef)(
6668
6613
  menuProps
6669
6614
  }, ref) => {
6670
6615
  const { classes } = useStyles44();
6671
- const [open, setOpen] = (0, import_react29.useState)(false);
6672
- const [localOptions, setLocalOptions] = (0, import_react29.useState)(options || []);
6673
- (0, import_react29.useEffect)(() => {
6616
+ const [open, setOpen] = (0, import_react28.useState)(false);
6617
+ const [localOptions, setLocalOptions] = (0, import_react28.useState)(options || []);
6618
+ (0, import_react28.useEffect)(() => {
6674
6619
  if (options) {
6675
6620
  setLocalOptions(options);
6676
6621
  }
@@ -6709,8 +6654,8 @@ var SmartSelect = (0, import_react29.forwardRef)(
6709
6654
  onChange(selectedOption);
6710
6655
  }
6711
6656
  };
6712
- return /* @__PURE__ */ (0, import_jsx_runtime106.jsxs)(
6713
- import_material55.FormControl,
6657
+ return /* @__PURE__ */ (0, import_jsx_runtime105.jsxs)(
6658
+ import_material54.FormControl,
6714
6659
  {
6715
6660
  fullWidth: true,
6716
6661
  className: classes.container,
@@ -6719,21 +6664,21 @@ var SmartSelect = (0, import_react29.forwardRef)(
6719
6664
  "data-testid": dataTestId,
6720
6665
  disabled,
6721
6666
  children: [
6722
- inputLabel && /* @__PURE__ */ (0, import_jsx_runtime106.jsx)(
6723
- import_material55.InputLabel,
6667
+ inputLabel && /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(
6668
+ import_material54.InputLabel,
6724
6669
  {
6725
6670
  id: "smart-select-label",
6726
6671
  "data-testid": `${dataTestId}-label`,
6727
6672
  children: inputLabel
6728
6673
  }
6729
6674
  ),
6730
- /* @__PURE__ */ (0, import_jsx_runtime106.jsxs)(
6731
- import_material55.Select,
6675
+ /* @__PURE__ */ (0, import_jsx_runtime105.jsxs)(
6676
+ import_material54.Select,
6732
6677
  {
6733
6678
  ref,
6734
6679
  disabled,
6735
6680
  labelId: "smart-select-label",
6736
- value: value ?? "",
6681
+ value,
6737
6682
  onChange: handleChange,
6738
6683
  onOpen: handleOpen,
6739
6684
  error,
@@ -6744,26 +6689,26 @@ var SmartSelect = (0, import_react29.forwardRef)(
6744
6689
  MenuProps: menuProps,
6745
6690
  label: inputLabel,
6746
6691
  children: [
6747
- isFetching && /* @__PURE__ */ (0, import_jsx_runtime106.jsx)(
6748
- import_material55.MenuItem,
6692
+ isFetching && /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(
6693
+ import_material54.MenuItem,
6749
6694
  {
6750
6695
  disabled: true,
6751
6696
  "data-testid": `${dataTestId}-loading`,
6752
6697
  id: `${dataTestId}-loading`,
6753
- children: /* @__PURE__ */ (0, import_jsx_runtime106.jsx)(import_material55.CircularProgress, { size: 24 })
6698
+ children: /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(import_material54.CircularProgress, { size: 24 })
6754
6699
  }
6755
6700
  ),
6756
- (defaultOption === null || !defaultOptionLabelIsValid || !defaultOptionValueIsValid) && !isFetching && options?.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime106.jsx)(import_material55.MenuItem, { disabled: true, "data-testid": `${dataTestId}-empty-message`, children: emptyMessage }),
6757
- localOptions.length === 0 && !isFetching && options?.length !== 0 && defaultOptionLabelIsValid && defaultOptionValueIsValid && /* @__PURE__ */ (0, import_jsx_runtime106.jsx)(
6758
- import_material55.MenuItem,
6701
+ (defaultOption === null || !defaultOptionLabelIsValid || !defaultOptionValueIsValid) && !isFetching && options?.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(import_material54.MenuItem, { disabled: true, "data-testid": `${dataTestId}-empty-message`, children: emptyMessage }),
6702
+ localOptions.length === 0 && !isFetching && options?.length !== 0 && defaultOptionLabelIsValid && defaultOptionValueIsValid && /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(
6703
+ import_material54.MenuItem,
6759
6704
  {
6760
6705
  value: defaultOption?.value,
6761
6706
  "data-testid": `${dataTestId}-default-option`,
6762
6707
  children: defaultOption?.label
6763
6708
  }
6764
6709
  ),
6765
- !isFetching && combinedOptions.length > 0 && combinedOptions.map((option) => /* @__PURE__ */ (0, import_jsx_runtime106.jsx)(
6766
- import_material55.MenuItem,
6710
+ !isFetching && combinedOptions.length > 0 && combinedOptions.map((option) => /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(
6711
+ import_material54.MenuItem,
6767
6712
  {
6768
6713
  value: option?.value,
6769
6714
  "data-testid": `${dataTestId}-option-${option?.value}`,
@@ -6775,7 +6720,7 @@ var SmartSelect = (0, import_react29.forwardRef)(
6775
6720
  ]
6776
6721
  }
6777
6722
  ),
6778
- helperText && /* @__PURE__ */ (0, import_jsx_runtime106.jsx)(import_material55.FormHelperText, { "data-testid": `${dataTestId}-helper-text`, children: helperText })
6723
+ helperText && /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(import_material54.FormHelperText, { "data-testid": `${dataTestId}-helper-text`, children: helperText })
6779
6724
  ]
6780
6725
  }
6781
6726
  );
@@ -6784,11 +6729,11 @@ var SmartSelect = (0, import_react29.forwardRef)(
6784
6729
  var SmartSelect_default = SmartSelect;
6785
6730
 
6786
6731
  // src/components/SquareLabel/SquareLabel.tsx
6787
- var import_react30 = require("react");
6788
- var import_material56 = require("@mui/material");
6732
+ var import_react29 = require("react");
6733
+ var import_material55 = require("@mui/material");
6789
6734
  var import_red2 = __toESM(require("@mui/material/colors/red"), 1);
6790
6735
  var import_mui50 = require("tss-react/mui");
6791
- var import_jsx_runtime107 = require("react/jsx-runtime");
6736
+ var import_jsx_runtime106 = require("react/jsx-runtime");
6792
6737
  var useStyles45 = (0, import_mui50.makeStyles)()((theme) => ({
6793
6738
  red: {
6794
6739
  backgroundColor: import_red2.default["50"],
@@ -6803,15 +6748,15 @@ var useStyles45 = (0, import_mui50.makeStyles)()((theme) => ({
6803
6748
  }));
6804
6749
  var SquareLabel = ({ color, copy }) => {
6805
6750
  const { classes } = useStyles45();
6806
- return /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(import_material56.Typography, { className: classes[color], children: copy });
6751
+ return /* @__PURE__ */ (0, import_jsx_runtime106.jsx)(import_material55.Typography, { className: classes[color], children: copy });
6807
6752
  };
6808
- var SquareLabel_default = (0, import_react30.memo)(SquareLabel);
6753
+ var SquareLabel_default = (0, import_react29.memo)(SquareLabel);
6809
6754
 
6810
6755
  // src/components/Switch/Switch.tsx
6811
- var import_react31 = require("react");
6812
- var import_material57 = require("@mui/material");
6756
+ var import_react30 = require("react");
6757
+ var import_material56 = require("@mui/material");
6813
6758
  var import_mui51 = require("tss-react/mui");
6814
- var import_jsx_runtime108 = require("react/jsx-runtime");
6759
+ var import_jsx_runtime107 = require("react/jsx-runtime");
6815
6760
  var LSwitch = ({
6816
6761
  checked,
6817
6762
  labelOn,
@@ -6819,8 +6764,8 @@ var LSwitch = ({
6819
6764
  handleChange,
6820
6765
  classes,
6821
6766
  disabled
6822
- }) => /* @__PURE__ */ (0, import_jsx_runtime108.jsx)("div", { className: classes.c_switch, children: /* @__PURE__ */ (0, import_jsx_runtime108.jsxs)(
6823
- import_material57.Grid2,
6767
+ }) => /* @__PURE__ */ (0, import_jsx_runtime107.jsx)("div", { className: classes.c_switch, children: /* @__PURE__ */ (0, import_jsx_runtime107.jsxs)(
6768
+ import_material56.Grid2,
6824
6769
  {
6825
6770
  component: "label",
6826
6771
  container: true,
@@ -6829,9 +6774,9 @@ var LSwitch = ({
6829
6774
  alignItems: "center"
6830
6775
  },
6831
6776
  children: [
6832
- labelOff && /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(import_material57.Grid2, { children: labelOff }),
6833
- /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(import_material57.Grid2, { children: /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(
6834
- import_material57.Switch,
6777
+ labelOff && /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(import_material56.Grid2, { children: labelOff }),
6778
+ /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(import_material56.Grid2, { children: /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(
6779
+ import_material56.Switch,
6835
6780
  {
6836
6781
  checked,
6837
6782
  color: "primary",
@@ -6839,7 +6784,7 @@ var LSwitch = ({
6839
6784
  disabled
6840
6785
  }
6841
6786
  ) }),
6842
- labelOn && /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(import_material57.Grid2, { children: labelOn })
6787
+ labelOn && /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(import_material56.Grid2, { children: labelOn })
6843
6788
  ]
6844
6789
  }
6845
6790
  ) });
@@ -6861,26 +6806,245 @@ var LabelledSwitch = (0, import_mui51.withStyles)(LSwitch, (theme) => ({
6861
6806
  fontSize: "1rem"
6862
6807
  }
6863
6808
  }));
6864
- var Switch_default = (0, import_react31.memo)(LabelledSwitch);
6809
+ var Switch_default = (0, import_react30.memo)(LabelledSwitch);
6865
6810
 
6866
6811
  // src/components/SmartTableHeaderFilterMenu/SmartTableHeaderFilterMenu.tsx
6867
- var import_react34 = require("react");
6812
+ var import_react31 = require("react");
6868
6813
  var import_Check = __toESM(require("@mui/icons-material/Check"), 1);
6869
- var import_material61 = require("@mui/material");
6814
+ var import_material57 = require("@mui/material");
6870
6815
  var import_classnames3 = __toESM(require("classnames"), 1);
6871
- var import_mui55 = require("tss-react/mui");
6872
-
6873
- // src/components/TableDesktop/TableDesktop.tsx
6874
- var import_react33 = require("react");
6875
- var import_material60 = require("@mui/material");
6876
- var import_mui54 = require("tss-react/mui");
6816
+ var import_mui52 = require("tss-react/mui");
6817
+ var import_jsx_runtime108 = require("react/jsx-runtime");
6818
+ var useStyles46 = (0, import_mui52.makeStyles)()((theme) => ({
6819
+ filterMenu: {
6820
+ display: "flex",
6821
+ flexDirection: "column"
6822
+ },
6823
+ filterOptions: {
6824
+ maxHeight: theme.spacing(62),
6825
+ overflowY: "auto",
6826
+ "&::-webkit-scrollbar": {
6827
+ width: "8px",
6828
+ height: "8px"
6829
+ },
6830
+ "&::-webkit-scrollbar-track": {
6831
+ backgroundColor: theme.palette.mode === "dark" ? theme.palette.grey[800] : theme.palette.grey[100]
6832
+ },
6833
+ "&::-webkit-scrollbar-thumb": {
6834
+ backgroundColor: theme.palette.mode === "dark" ? theme.palette.grey[900] : theme.palette.grey[400],
6835
+ borderRadius: "10px"
6836
+ },
6837
+ "&::-webkit-scrollbar-thumb:hover": {
6838
+ backgroundColor: theme.palette.mode === "dark" ? theme.palette.common.black : theme.palette.grey[500]
6839
+ }
6840
+ },
6841
+ filter: {
6842
+ display: "flex",
6843
+ alignItems: "center",
6844
+ justifyContent: "space-between",
6845
+ padding: theme.spacing(0, 3)
6846
+ },
6847
+ applyFilterButtonsContainer: {
6848
+ display: "flex",
6849
+ padding: theme.spacing(0, 1)
6850
+ },
6851
+ saveAsDefaultButton: {
6852
+ color: theme.palette.primary.main
6853
+ },
6854
+ skeleton: {
6855
+ height: theme.spacing(3),
6856
+ margin: theme.spacing(1)
6857
+ }
6858
+ }));
6859
+ var resolveFilterOption = (filterOption) => {
6860
+ if (typeof filterOption === "object") {
6861
+ return filterOption?.label || filterOption?.name || "";
6862
+ }
6863
+ return filterOption;
6864
+ };
6865
+ var findFilterIndex = (filters, filterOption) => filters.findIndex((item) => {
6866
+ if (typeof item === "string" && typeof filterOption === "string") {
6867
+ return item === filterOption;
6868
+ }
6869
+ if (typeof item === "object" && typeof filterOption === "object") {
6870
+ return item.id === filterOption.id;
6871
+ }
6872
+ return false;
6873
+ });
6874
+ var SmartTableHeaderFilterMenu = ({
6875
+ headCell,
6876
+ numActiveFilters,
6877
+ headerFilters,
6878
+ shouldShowCheckOnFilter,
6879
+ onApplyFilters
6880
+ }) => {
6881
+ const { classes } = useStyles46();
6882
+ const [anchorEl, setAnchorEl] = (0, import_react31.useState)(null);
6883
+ const [selectedFilters, setSelectedFilters] = (0, import_react31.useState)(
6884
+ headerFilters[headCell.id] ?? []
6885
+ );
6886
+ const filterOptions = headCell.filterOptionsQuery?.data ?? [];
6887
+ const numFilterOptions = filterOptions.length ?? 0;
6888
+ const numCurrentSelectedFilters = selectedFilters.length;
6889
+ const handleFilterMenuOpen = (event) => {
6890
+ if (!numFilterOptions) {
6891
+ headCell.filterOptionsQuery?.refetch();
6892
+ }
6893
+ setAnchorEl(event.currentTarget);
6894
+ };
6895
+ const handleFilterMenuClose = () => {
6896
+ setSelectedFilters(headerFilters[headCell.id]);
6897
+ setAnchorEl(null);
6898
+ };
6899
+ const handleFilterOptionClick = (option) => {
6900
+ const selectedIndex = findFilterIndex(selectedFilters, option);
6901
+ let newSelected;
6902
+ if (selectedIndex === -1) {
6903
+ if (typeof option === "string") {
6904
+ newSelected = [...selectedFilters, option];
6905
+ } else {
6906
+ newSelected = [...selectedFilters, option];
6907
+ }
6908
+ } else {
6909
+ newSelected = selectedFilters.filter(
6910
+ (_, index) => index !== selectedIndex
6911
+ );
6912
+ }
6913
+ setSelectedFilters(newSelected);
6914
+ };
6915
+ const handleApplyFilters = (shouldSave) => {
6916
+ const updatedFilters = {
6917
+ ...headerFilters,
6918
+ [headCell.id]: [...selectedFilters]
6919
+ };
6920
+ onApplyFilters?.(updatedFilters, shouldSave);
6921
+ setAnchorEl(null);
6922
+ };
6923
+ (0, import_react31.useEffect)(() => {
6924
+ setSelectedFilters(headerFilters[headCell.id] ?? []);
6925
+ }, [headerFilters, headCell.id]);
6926
+ const isOptionChecked = (0, import_react31.useMemo)(() => (resolvedOption) => !!selectedFilters?.some(
6927
+ (value) => resolveFilterOption(value) === resolvedOption
6928
+ ), [selectedFilters]);
6929
+ const loadingSkeletons = /* @__PURE__ */ (0, import_jsx_runtime108.jsxs)(import_material57.Box, { "data-testid": "loading-skeletons", width: 272, children: [
6930
+ /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(import_material57.Skeleton, { variant: "rounded", className: classes.skeleton }),
6931
+ /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(import_material57.Divider, {}),
6932
+ /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(import_material57.Skeleton, { variant: "rounded", className: classes.skeleton }),
6933
+ /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(import_material57.Skeleton, { variant: "rounded", className: classes.skeleton }),
6934
+ /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(import_material57.Skeleton, { variant: "rounded", className: classes.skeleton }),
6935
+ /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(import_material57.Skeleton, { variant: "rounded", className: classes.skeleton }),
6936
+ /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(import_material57.Divider, {}),
6937
+ /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(import_material57.Skeleton, { variant: "rounded", className: classes.skeleton })
6938
+ ] });
6939
+ return /* @__PURE__ */ (0, import_jsx_runtime108.jsxs)(import_jsx_runtime108.Fragment, { children: [
6940
+ /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(
6941
+ ActiveFiltersIconButton_default,
6942
+ {
6943
+ numActiveFilters,
6944
+ handleClick: handleFilterMenuOpen,
6945
+ className: (0, import_classnames3.default)("filter-menu-trigger", {
6946
+ "has-active-filters": !!numActiveFilters || !!anchorEl
6947
+ })
6948
+ }
6949
+ ),
6950
+ /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(
6951
+ import_material57.Menu,
6952
+ {
6953
+ open: !!anchorEl,
6954
+ onClose: handleFilterMenuClose,
6955
+ anchorEl,
6956
+ "data-testid": "filter-menu",
6957
+ anchorOrigin: { vertical: "bottom", horizontal: "right" },
6958
+ transformOrigin: { vertical: "top", horizontal: "right" },
6959
+ children: headCell.filterOptionsQuery?.isFetching ? loadingSkeletons : /* @__PURE__ */ (0, import_jsx_runtime108.jsxs)(import_material57.Box, { className: classes.filterMenu, children: [
6960
+ /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(import_material57.Box, { px: 3, mb: 0.5, children: /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(
6961
+ import_material57.FormControlLabel,
6962
+ {
6963
+ label: "Select All",
6964
+ control: /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(
6965
+ import_material57.Checkbox,
6966
+ {
6967
+ disableRipple: true,
6968
+ checked: numCurrentSelectedFilters === numFilterOptions,
6969
+ indeterminate: numCurrentSelectedFilters > 0 && numCurrentSelectedFilters < numFilterOptions,
6970
+ onChange: ({ target: { checked } }) => {
6971
+ if (checked) {
6972
+ setSelectedFilters([...filterOptions]);
6973
+ } else {
6974
+ setSelectedFilters([]);
6975
+ }
6976
+ }
6977
+ }
6978
+ )
6979
+ }
6980
+ ) }),
6981
+ /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(import_material57.Divider, { sx: { mb: 0.5 } }),
6982
+ /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(import_material57.Box, { className: classes.filterOptions, children: filterOptions.map(
6983
+ (option) => {
6984
+ const resolvedOption = resolveFilterOption(option);
6985
+ return /* @__PURE__ */ (0, import_jsx_runtime108.jsxs)(
6986
+ import_material57.Box,
6987
+ {
6988
+ className: classes.filter,
6989
+ children: [
6990
+ /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(
6991
+ import_material57.FormControlLabel,
6992
+ {
6993
+ label: resolvedOption,
6994
+ control: /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(
6995
+ import_material57.Checkbox,
6996
+ {
6997
+ disableRipple: true,
6998
+ onChange: () => handleFilterOptionClick(option),
6999
+ checked: isOptionChecked(resolvedOption)
7000
+ }
7001
+ )
7002
+ },
7003
+ resolvedOption
7004
+ ),
7005
+ shouldShowCheckOnFilter?.(headCell.id, option) ? /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(import_material57.Tooltip, { title: "This filter is saved as default", children: /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(import_Check.default, { fontSize: "small", color: "action" }) }) : null
7006
+ ]
7007
+ },
7008
+ resolvedOption
7009
+ );
7010
+ }
7011
+ ) }),
7012
+ /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(import_material57.Divider, { sx: { mb: 0.5 } }),
7013
+ /* @__PURE__ */ (0, import_jsx_runtime108.jsxs)(import_material57.Box, { className: classes.applyFilterButtonsContainer, children: [
7014
+ /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(
7015
+ ExtendedButton_default,
7016
+ {
7017
+ copy: "Save as Default",
7018
+ buttonType: "button",
7019
+ variant: "text",
7020
+ tooltip: "Persists those filters for future visits",
7021
+ className: classes.saveAsDefaultButton,
7022
+ onClick: () => handleApplyFilters(true)
7023
+ }
7024
+ ),
7025
+ /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(
7026
+ ExtendedButton_default,
7027
+ {
7028
+ copy: "Apply",
7029
+ color: "primary",
7030
+ buttonType: "submit",
7031
+ onClick: () => handleApplyFilters(false)
7032
+ }
7033
+ )
7034
+ ] })
7035
+ ] })
7036
+ }
7037
+ )
7038
+ ] });
7039
+ };
7040
+ var SmartTableHeaderFilterMenu_default = (0, import_react31.memo)(SmartTableHeaderFilterMenu);
6877
7041
 
6878
7042
  // src/components/SmartTableHeader/SmartTableHeader.tsx
6879
7043
  var import_react32 = require("react");
6880
7044
  var import_material58 = require("@mui/material");
6881
- var import_mui52 = require("tss-react/mui");
7045
+ var import_mui53 = require("tss-react/mui");
6882
7046
  var import_jsx_runtime109 = require("react/jsx-runtime");
6883
- var useStyles46 = (0, import_mui52.makeStyles)()((theme) => ({
7047
+ var useStyles47 = (0, import_mui53.makeStyles)()((theme) => ({
6884
7048
  root: {
6885
7049
  backgroundColor: colors.neutral100,
6886
7050
  height: theme.spacing(6),
@@ -6947,7 +7111,7 @@ var SmartTableHeader = ({
6947
7111
  onApplyFilters,
6948
7112
  shouldShowCheckOnFilter
6949
7113
  }) => {
6950
- const { classes } = useStyles46();
7114
+ const { classes } = useStyles47();
6951
7115
  const createSortHandler = (property) => (event) => {
6952
7116
  onRequestSort(event, property);
6953
7117
  };
@@ -6957,64 +7121,237 @@ var SmartTableHeader = ({
6957
7121
  import_material58.Checkbox,
6958
7122
  {
6959
7123
  color: "primary",
6960
- disableRipple: true,
6961
7124
  indeterminate: numSelected > 0 && numSelected < numRows,
6962
7125
  checked: numRows > 0 && numSelected === numRows,
6963
7126
  onChange: onSelectAllClick
6964
7127
  }
6965
7128
  ) }) : null,
6966
- headCells.map((headCell) => /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(
7129
+ headCells.map((headCell) => /* @__PURE__ */ (0, import_jsx_runtime109.jsxs)(
6967
7130
  import_material58.TableCell,
6968
7131
  {
6969
7132
  className: classes.tableHeaderContent,
6970
7133
  align: "left",
6971
- width: headCell.width ?? "auto",
7134
+ sx: { width: headCell.width ?? "auto" },
6972
7135
  sortDirection: orderBy === headCell.id ? order : false,
6973
- children: /* @__PURE__ */ (0, import_jsx_runtime109.jsxs)(
6974
- import_material58.Box,
6975
- {
6976
- display: "flex",
6977
- flexDirection: "row",
6978
- gap: headCell.disableSort ? 1 : 0,
6979
- children: [
6980
- headCell.disableSort ? /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(import_material58.Typography, { variant: "subtitle2", mt: 0.25, fontWeight: 600, children: headCell.label }) : /* @__PURE__ */ (0, import_jsx_runtime109.jsxs)(
6981
- import_material58.TableSortLabel,
6982
- {
6983
- "data-testid": "table-sort-label",
6984
- active: isSortActive(headCell.id),
6985
- direction: orderBy === headCell.id ? order : "asc",
6986
- onClick: createSortHandler(headCell.id),
6987
- children: [
6988
- headCell.RenderHeader ?? headCell.label,
6989
- orderBy === headCell.id ? /* @__PURE__ */ (0, import_jsx_runtime109.jsx)("span", { className: classes.visuallyHidden, children: order === "desc" ? "sorted descending" : "sorted ascending" }) : null
6990
- ]
6991
- }
6992
- ),
6993
- headCell.refetchFilterOptions ? /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(
6994
- SmartTableHeaderFilterMenu_default,
6995
- {
6996
- headCell,
6997
- headerFilters,
6998
- numActiveFilters: headerFilters[headCell.id]?.length ?? 0,
6999
- onApplyFilters,
7000
- shouldShowCheckOnFilter
7001
- }
7002
- ) : null
7003
- ]
7004
- }
7005
- )
7006
- },
7007
- headCell.id
7008
- ))
7009
- ] }) });
7010
- };
7011
- var SmartTableHeader_default = (0, import_react32.memo)(SmartTableHeader);
7012
-
7013
- // src/components/TableEmptyResult/TableEmptyResult.tsx
7136
+ children: [
7137
+ /* @__PURE__ */ (0, import_jsx_runtime109.jsxs)(
7138
+ import_material58.TableSortLabel,
7139
+ {
7140
+ "data-testid": "table-sort-label",
7141
+ active: isSortActive(headCell.id),
7142
+ direction: orderBy === headCell.id ? order : "asc",
7143
+ onClick: createSortHandler(headCell.id),
7144
+ children: [
7145
+ headCell.renderHeader ?? headCell.label,
7146
+ orderBy === headCell.id ? /* @__PURE__ */ (0, import_jsx_runtime109.jsx)("span", { className: classes.visuallyHidden, children: order === "desc" ? "sorted descending" : "sorted ascending" }) : null
7147
+ ]
7148
+ }
7149
+ ),
7150
+ headCell.filterOptionsQuery ? /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(
7151
+ SmartTableHeaderFilterMenu_default,
7152
+ {
7153
+ headCell,
7154
+ headerFilters,
7155
+ numActiveFilters: headerFilters[headCell.id]?.length ?? 0,
7156
+ onApplyFilters,
7157
+ shouldShowCheckOnFilter
7158
+ }
7159
+ ) : null
7160
+ ]
7161
+ },
7162
+ headCell.id
7163
+ ))
7164
+ ] }) });
7165
+ };
7166
+ var SmartTableHeader_default = (0, import_react32.memo)(SmartTableHeader);
7167
+
7168
+ // src/components/Table/Table.tsx
7169
+ var import_react33 = require("react");
7170
+ var import_material60 = require("@mui/material");
7171
+ var import_debounce = __toESM(require_debounce(), 1);
7172
+ var import_mui54 = require("tss-react/mui");
7173
+ var import_uuid = require("uuid");
7174
+
7175
+ // src/components/TableLoading/TableLoading.tsx
7014
7176
  var import_material59 = require("@mui/material");
7015
- var import_mui53 = require("tss-react/mui");
7016
7177
  var import_jsx_runtime110 = require("react/jsx-runtime");
7017
- var useStyles47 = (0, import_mui53.makeStyles)()(() => ({
7178
+ var TableLoading = ({
7179
+ rowsPerPage,
7180
+ rowHeight
7181
+ }) => /* @__PURE__ */ (0, import_jsx_runtime110.jsx)(import_material59.Box, { children: Array.from({ length: rowsPerPage ?? 0 }).map((_, index) => /* @__PURE__ */ (0, import_jsx_runtime110.jsx)(
7182
+ import_material59.Skeleton,
7183
+ {
7184
+ animation: "pulse",
7185
+ "data-testid": "table-loading-skeleton",
7186
+ style: { margin: "8px", opacity: 0.4 },
7187
+ variant: "rectangular",
7188
+ height: rowHeight
7189
+ },
7190
+ index
7191
+ )) });
7192
+ var TableLoading_default = TableLoading;
7193
+
7194
+ // src/components/Table/helpers.tsx
7195
+ function stableSort(array, cmp) {
7196
+ const stabilizedThis = array.map((el, index) => [el, index]);
7197
+ stabilizedThis.sort((a, b) => {
7198
+ const order = cmp(a[0], b[0]);
7199
+ if (order !== 0) {
7200
+ return order;
7201
+ }
7202
+ return a[1] - b[1];
7203
+ });
7204
+ return stabilizedThis.map((el) => el[0]);
7205
+ }
7206
+ function descendingComparator(a, b, orderBy) {
7207
+ if (b[orderBy] < a[orderBy]) {
7208
+ return -1;
7209
+ }
7210
+ if (b[orderBy] > a[orderBy]) {
7211
+ return 1;
7212
+ }
7213
+ return 0;
7214
+ }
7215
+ function getSorting(order, orderBy) {
7216
+ return order === "desc" ? (a, b) => descendingComparator(a, b, orderBy) : (a, b) => -descendingComparator(a, b, orderBy);
7217
+ }
7218
+ function calculateRowsPerPage(rowHeight) {
7219
+ const appContainerDom = document.getElementById("mainContainer");
7220
+ const headerDom = document.getElementById("aboveTableHeader");
7221
+ if (appContainerDom && headerDom) {
7222
+ return Math.floor(
7223
+ (appContainerDom.clientHeight - headerDom.clientHeight - 24) / rowHeight - 2
7224
+ );
7225
+ }
7226
+ return 1;
7227
+ }
7228
+
7229
+ // src/components/Table/Table.tsx
7230
+ var import_jsx_runtime111 = require("react/jsx-runtime");
7231
+ var useStyles48 = (0, import_mui54.makeStyles)()(() => ({
7232
+ root: {
7233
+ height: "calc(100vh - 262px)",
7234
+ overflow: "scroll"
7235
+ },
7236
+ paper: {
7237
+ width: "100%",
7238
+ display: "flex",
7239
+ flexDirection: "column",
7240
+ justifyContent: "space-between"
7241
+ },
7242
+ header: {
7243
+ "& .MuiTableSortLabel-root": {
7244
+ fontWeight: 600,
7245
+ fontSize: ".875rem"
7246
+ }
7247
+ },
7248
+ container: {
7249
+ maxHeight: "calc(100% - 0)"
7250
+ }
7251
+ }));
7252
+ var Table = ({
7253
+ appliedFilters,
7254
+ data,
7255
+ doNotCalculateRows,
7256
+ headCells,
7257
+ isLoading,
7258
+ onRowClick,
7259
+ page = 0,
7260
+ RenderItem = null,
7261
+ rowsPerPage: defaultRowsPerPage = 10,
7262
+ serverRendered,
7263
+ updateSort
7264
+ }) => {
7265
+ const [order, setOrder] = (0, import_react33.useState)(appliedFilters?.sortDir || "desc");
7266
+ const [orderBy, setOrderBy] = (0, import_react33.useState)(
7267
+ appliedFilters?.sortField || "delivery_date"
7268
+ );
7269
+ const [rowsPerPage, setRowsPerPage] = (0, import_react33.useState)(defaultRowsPerPage);
7270
+ const { classes } = useStyles48();
7271
+ const rowHeight = 56;
7272
+ const emptyRows = rowsPerPage - Math.min(rowsPerPage, data.length - page * rowsPerPage);
7273
+ const handleRequestSort = (event, property) => {
7274
+ const isAsc = orderBy === property && order === "asc";
7275
+ const orderDir = isAsc ? "desc" : "asc";
7276
+ setOrder(orderDir);
7277
+ setOrderBy(property);
7278
+ if (updateSort) {
7279
+ updateSort(property, orderDir);
7280
+ }
7281
+ };
7282
+ (0, import_react33.useLayoutEffect)(() => {
7283
+ if (!doNotCalculateRows) {
7284
+ return;
7285
+ }
7286
+ function updateRowsPerPage() {
7287
+ const newRowsPerPage = calculateRowsPerPage(rowHeight);
7288
+ setRowsPerPage(newRowsPerPage);
7289
+ }
7290
+ updateRowsPerPage();
7291
+ const debounced = (0, import_debounce.default)(updateRowsPerPage, 150);
7292
+ window.addEventListener("resize", debounced);
7293
+ return () => {
7294
+ window.removeEventListener("resize", debounced);
7295
+ };
7296
+ }, [doNotCalculateRows]);
7297
+ const createSortHandler = (property) => (event) => {
7298
+ handleRequestSort(event, property);
7299
+ };
7300
+ const getTableRows = () => {
7301
+ const index = page;
7302
+ const rows = serverRendered ? data : stableSort(data, getSorting(order, orderBy)).slice(
7303
+ index * rowsPerPage,
7304
+ index * rowsPerPage + rowsPerPage
7305
+ );
7306
+ const rowsComponents = rows.map((row) => {
7307
+ if (RenderItem) {
7308
+ return /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(RenderItem, { ...row }, row.id);
7309
+ }
7310
+ return /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(import_material60.TableRow, { hover: true, onClick: () => onRowClick?.(row), children: headCells?.map((column) => /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(import_material60.TableCell, { children: row[column.id] }, column.id)) }, row.id);
7311
+ });
7312
+ if (emptyRows > 0 && rowsPerPage > emptyRows) {
7313
+ rowsComponents.push(
7314
+ /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(import_material60.TableRow, { style: { height: rowHeight * emptyRows }, children: /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(import_material60.TableCell, { colSpan: 8 }) }, (0, import_uuid.v4)())
7315
+ );
7316
+ }
7317
+ return rowsComponents;
7318
+ };
7319
+ return /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(import_material60.Paper, { className: classes.root, children: /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(import_material60.Box, { className: classes.paper, children: isLoading ? /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(TableLoading_default, { rowHeight, rowsPerPage }) : /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(import_material60.TableContainer, { className: classes.container, children: /* @__PURE__ */ (0, import_jsx_runtime111.jsxs)(import_material60.Table, { size: "medium", stickyHeader: true, children: [
7320
+ /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(import_material60.TableHead, { className: classes.header, children: /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(import_material60.TableRow, { children: headCells?.map((headCell) => /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(
7321
+ import_material60.TableCell,
7322
+ {
7323
+ align: "left",
7324
+ sortDirection: orderBy === headCell.id ? order : void 0,
7325
+ children: /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(
7326
+ import_material60.TableSortLabel,
7327
+ {
7328
+ active: orderBy === headCell.id,
7329
+ direction: orderBy === headCell.id ? order : "asc",
7330
+ onClick: createSortHandler(headCell.id),
7331
+ children: headCell.label
7332
+ }
7333
+ )
7334
+ },
7335
+ headCell.id
7336
+ )) }) }),
7337
+ /* @__PURE__ */ (0, import_jsx_runtime111.jsxs)(import_material60.TableBody, { children: [
7338
+ getTableRows(),
7339
+ rowsPerPage === emptyRows && /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(import_material60.TableRow, { style: { height: rowHeight * emptyRows }, children: /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(import_material60.TableCell, { colSpan: 8, align: "center", children: "Nothing to display" }) })
7340
+ ] })
7341
+ ] }) }) }) });
7342
+ };
7343
+ var Table_default = Table;
7344
+
7345
+ // src/components/TableDesktop/TableDesktop.tsx
7346
+ var import_react34 = require("react");
7347
+ var import_material62 = require("@mui/material");
7348
+ var import_mui56 = require("tss-react/mui");
7349
+
7350
+ // src/components/TableEmptyResult/TableEmptyResult.tsx
7351
+ var import_material61 = require("@mui/material");
7352
+ var import_mui55 = require("tss-react/mui");
7353
+ var import_jsx_runtime112 = require("react/jsx-runtime");
7354
+ var useStyles49 = (0, import_mui55.makeStyles)()(() => ({
7018
7355
  tableCellIcon: { padding: 24, height: "calc(100vh - 320px)" },
7019
7356
  tableCellDefault: { padding: 24 }
7020
7357
  }));
@@ -7024,18 +7361,18 @@ var TableEmptyResult = ({
7024
7361
  handleClickOnClearFiltersButton = () => {
7025
7362
  }
7026
7363
  }) => {
7027
- const { classes } = useStyles47();
7028
- return showClearFilterButton ? /* @__PURE__ */ (0, import_jsx_runtime110.jsx)(import_material59.TableRow, { children: /* @__PURE__ */ (0, import_jsx_runtime110.jsxs)(
7029
- import_material59.TableCell,
7364
+ const { classes } = useStyles49();
7365
+ return showClearFilterButton ? /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(import_material61.TableRow, { children: /* @__PURE__ */ (0, import_jsx_runtime112.jsxs)(
7366
+ import_material61.TableCell,
7030
7367
  {
7031
7368
  className: classes.tableCellIcon,
7032
7369
  colSpan,
7033
7370
  align: "center",
7034
7371
  children: [
7035
- /* @__PURE__ */ (0, import_jsx_runtime110.jsx)(EmptyGlassIcon_default, {}),
7036
- /* @__PURE__ */ (0, import_jsx_runtime110.jsx)(import_material59.Typography, { variant: "h6", children: "No results found." }),
7037
- /* @__PURE__ */ (0, import_jsx_runtime110.jsx)(import_material59.Typography, { variant: "subtitle1", children: "Search without applied filters?" }),
7038
- /* @__PURE__ */ (0, import_jsx_runtime110.jsx)(
7372
+ /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(EmptyGlassIcon_default, {}),
7373
+ /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(import_material61.Typography, { variant: "h6", children: "No results found." }),
7374
+ /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(import_material61.Typography, { variant: "subtitle1", children: "Search without applied filters?" }),
7375
+ /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(
7039
7376
  FilledButton_default,
7040
7377
  {
7041
7378
  copy: "Search",
@@ -7046,8 +7383,8 @@ var TableEmptyResult = ({
7046
7383
  )
7047
7384
  ]
7048
7385
  }
7049
- ) }) : /* @__PURE__ */ (0, import_jsx_runtime110.jsx)(import_material59.TableRow, { children: /* @__PURE__ */ (0, import_jsx_runtime110.jsx)(
7050
- import_material59.TableCell,
7386
+ ) }) : /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(import_material61.TableRow, { children: /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(
7387
+ import_material61.TableCell,
7051
7388
  {
7052
7389
  className: classes.tableCellDefault,
7053
7390
  colSpan,
@@ -7059,8 +7396,8 @@ var TableEmptyResult = ({
7059
7396
  var TableEmptyResult_default = TableEmptyResult;
7060
7397
 
7061
7398
  // src/components/TableDesktop/TableDesktop.tsx
7062
- var import_jsx_runtime111 = require("react/jsx-runtime");
7063
- var useStyles48 = (0, import_mui54.makeStyles)()((theme) => ({
7399
+ var import_jsx_runtime113 = require("react/jsx-runtime");
7400
+ var useStyles50 = (0, import_mui56.makeStyles)()((theme) => ({
7064
7401
  root: {
7065
7402
  justifyContent: "space-between",
7066
7403
  display: "flex",
@@ -7090,7 +7427,7 @@ var useStyles48 = (0, import_mui54.makeStyles)()((theme) => ({
7090
7427
  }
7091
7428
  }
7092
7429
  }));
7093
- var descendingComparator = (a, b, orderBy) => {
7430
+ var descendingComparator2 = (a, b, orderBy) => {
7094
7431
  const objA = a[orderBy];
7095
7432
  const objB = b[orderBy];
7096
7433
  const valA = typeof objA === "object" ? objA?.name : objA;
@@ -7104,522 +7441,67 @@ var descendingComparator = (a, b, orderBy) => {
7104
7441
  if (!valA && valB) {
7105
7442
  return 1;
7106
7443
  }
7107
- if (valA > valB) {
7108
- return -1;
7109
- }
7110
- if (valA < valB) {
7111
- return 1;
7112
- }
7113
- return 0;
7114
- };
7115
- var stableSort = (array, cmp) => array.map((el, index) => ({ el, index })).sort((a, b) => {
7116
- const order = cmp(a.el, b.el);
7117
- return order !== 0 ? order : a.index - b.index;
7118
- }).map((el) => el.el);
7119
- var getComparator = (order, orderBy) => order === "desc" ? (a, b) => descendingComparator(a, b, orderBy) : (a, b) => -descendingComparator(a, b, orderBy);
7120
- var resolveOptionType = (option, fieldName) => {
7121
- if (!option || typeof option !== "object") {
7122
- return option;
7123
- }
7124
- return option[fieldName] || "";
7125
- };
7126
- var TableDesktop = ({
7127
- data,
7128
- headCells,
7129
- RenderItem,
7130
- appliedFilters,
7131
- headerFilters,
7132
- children,
7133
- height,
7134
- isLoading,
7135
- rowsPerPage = 50,
7136
- enableCheckboxSelection = false,
7137
- enableRowActions = false,
7138
- disableInternalSort = false,
7139
- updateSort,
7140
- showClearFilterButton,
7141
- handleClickOnClearFiltersButton,
7142
- deleteItem,
7143
- keyField = "id",
7144
- tableLayout = "auto",
7145
- onApplyFilters,
7146
- shouldShowCheckOnFilter
7147
- }) => {
7148
- const [order, setOrder] = (0, import_react33.useState)(appliedFilters?.sortDir || "desc");
7149
- const [orderBy, setOrderBy] = (0, import_react33.useState)(
7150
- appliedFilters?.sortField || "delivery_date"
7151
- );
7152
- const [selected, setSelected] = (0, import_react33.useState)(/* @__PURE__ */ new Set());
7153
- const [page] = (0, import_react33.useState)(0);
7154
- const { classes } = useStyles48();
7155
- const rowHeight = 56;
7156
- const emptyRows = (0, import_react33.useMemo)(
7157
- () => rowsPerPage - data.length,
7158
- [rowsPerPage, data]
7159
- );
7160
- const visibleHeadCells = (0, import_react33.useMemo)(
7161
- () => headCells.filter((headCell) => headCell?.enabled ?? true),
7162
- [headCells]
7163
- );
7164
- const handleSelectAllClick = (0, import_react33.useCallback)(
7165
- (event) => {
7166
- if (event.target.checked) {
7167
- const allItems = new Set(data.map((n) => n[keyField]));
7168
- setSelected(allItems);
7169
- } else {
7170
- setSelected(/* @__PURE__ */ new Set());
7171
- }
7172
- },
7173
- [data, keyField]
7174
- );
7175
- const handleRequestSort = (event, property) => {
7176
- const isAsc = orderBy === property && order === "asc";
7177
- const orderDir = isAsc ? "desc" : "asc";
7178
- setOrder(orderDir);
7179
- setOrderBy(property);
7180
- if (updateSort) {
7181
- updateSort(property, orderDir);
7182
- }
7183
- };
7184
- const handleRowCheckboxChange = (0, import_react33.useCallback)(
7185
- (event, keyFieldValue) => {
7186
- event.stopPropagation();
7187
- setSelected((prev) => {
7188
- const newSelected = new Set(prev);
7189
- if (newSelected.has(keyFieldValue)) {
7190
- newSelected.delete(keyFieldValue);
7191
- } else {
7192
- newSelected.add(keyFieldValue);
7193
- }
7194
- return newSelected;
7195
- });
7196
- },
7197
- []
7198
- );
7199
- const renderTableRows = (0, import_react33.useMemo)(() => {
7200
- const sortedData = disableInternalSort ? data : stableSort(data, getComparator(order, orderBy));
7201
- return sortedData.slice(page * rowsPerPage, page * rowsPerPage + rowsPerPage).map((row, index) => {
7202
- const isItemSelected = selected.has(row[keyField]);
7203
- return /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(
7204
- RenderItem,
7205
- {
7206
- ...{
7207
- ...row,
7208
- index,
7209
- deleteItem,
7210
- isItemSelected,
7211
- enableCheckboxSelection,
7212
- enableRowActions,
7213
- keyFieldValue: row[keyField],
7214
- handleRowCheckboxChange,
7215
- visibleHeadCells
7216
- }
7217
- },
7218
- row[keyField] ?? index
7219
- );
7220
- });
7221
- }, [
7222
- data,
7223
- order,
7224
- orderBy,
7225
- page,
7226
- rowsPerPage,
7227
- selected,
7228
- enableCheckboxSelection,
7229
- enableRowActions,
7230
- disableInternalSort,
7231
- deleteItem,
7232
- keyField,
7233
- handleRowCheckboxChange,
7234
- visibleHeadCells,
7235
- RenderItem
7236
- ]);
7237
- (0, import_react33.useEffect)(() => {
7238
- if (!enableCheckboxSelection) {
7239
- setSelected(/* @__PURE__ */ new Set());
7240
- }
7241
- }, [enableCheckboxSelection]);
7242
- return /* @__PURE__ */ (0, import_jsx_runtime111.jsx)("div", { className: classes.root, style: { height }, children: /* @__PURE__ */ (0, import_jsx_runtime111.jsxs)(import_material60.Paper, { className: classes.paper, children: [
7243
- isLoading ? /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(import_material60.Box, { width: "100%", overflow: "hidden", children: [...Array(Math.floor(rowsPerPage ?? 50))].map((_, index) => /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(
7244
- import_material60.Skeleton,
7245
- {
7246
- animation: "pulse",
7247
- variant: "rounded",
7248
- sx: { margin: 1 },
7249
- height: rowHeight,
7250
- "data-testid": "loading-skeleton"
7251
- },
7252
- index
7253
- )) }) : /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(import_material60.TableContainer, { className: classes.container, children: /* @__PURE__ */ (0, import_jsx_runtime111.jsxs)(
7254
- import_material60.Table,
7255
- {
7256
- stickyHeader: true,
7257
- "aria-labelledby": "tableTitle",
7258
- "aria-label": "sticky table",
7259
- style: { tableLayout },
7260
- children: [
7261
- /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(
7262
- SmartTableHeader_default,
7263
- {
7264
- headCells: visibleHeadCells,
7265
- order,
7266
- orderBy,
7267
- numSelected: selected.size,
7268
- numRows: data.length,
7269
- enableCheckboxSelection,
7270
- headerFilters: headerFilters ?? {},
7271
- onRequestSort: handleRequestSort,
7272
- onSelectAllClick: handleSelectAllClick,
7273
- onApplyFilters,
7274
- shouldShowCheckOnFilter
7275
- }
7276
- ),
7277
- /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(import_material60.TableBody, { children: rowsPerPage !== emptyRows ? renderTableRows : /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(
7278
- TableEmptyResult_default,
7279
- {
7280
- colSpan: enableCheckboxSelection ? visibleHeadCells.length + 1 : visibleHeadCells.length,
7281
- showClearFilterButton,
7282
- handleClickOnClearFiltersButton
7283
- }
7284
- ) })
7285
- ]
7286
- }
7287
- ) }),
7288
- children
7289
- ] }) });
7290
- };
7291
- var TableDesktop_default = TableDesktop;
7292
-
7293
- // src/components/SmartTableHeaderFilterMenu/SmartTableHeaderFilterMenu.tsx
7294
- var import_jsx_runtime112 = require("react/jsx-runtime");
7295
- var useStyles49 = (0, import_mui55.makeStyles)()((theme) => ({
7296
- filterMenu: {
7297
- display: "flex",
7298
- flexDirection: "column"
7299
- },
7300
- filterOptions: {
7301
- maxHeight: theme.spacing(62),
7302
- overflowY: "auto",
7303
- "&::-webkit-scrollbar": {
7304
- width: "8px",
7305
- height: "8px"
7306
- },
7307
- "&::-webkit-scrollbar-track": {
7308
- backgroundColor: theme.palette.mode === "dark" ? theme.palette.grey[800] : theme.palette.grey[100]
7309
- },
7310
- "&::-webkit-scrollbar-thumb": {
7311
- backgroundColor: theme.palette.mode === "dark" ? theme.palette.grey[900] : theme.palette.grey[400],
7312
- borderRadius: "10px"
7313
- },
7314
- "&::-webkit-scrollbar-thumb:hover": {
7315
- backgroundColor: theme.palette.mode === "dark" ? theme.palette.common.black : theme.palette.grey[500]
7316
- }
7317
- },
7318
- filter: {
7319
- display: "flex",
7320
- alignItems: "center",
7321
- justifyContent: "space-between",
7322
- padding: theme.spacing(0, 3)
7323
- },
7324
- applyFilterButtonsContainer: {
7325
- display: "flex",
7326
- padding: theme.spacing(0, 1)
7327
- },
7328
- saveAsDefaultButton: {
7329
- color: theme.palette.primary.main
7330
- },
7331
- skeleton: {
7332
- height: theme.spacing(3),
7333
- margin: theme.spacing(1)
7334
- }
7335
- }));
7336
- var findFilterIndex = (filters, filterOption) => filters.findIndex((item) => {
7337
- if (typeof item === "string" && typeof filterOption === "string") {
7338
- return item === filterOption;
7339
- }
7340
- if (typeof item === "object" && typeof filterOption === "object") {
7341
- return item.id === filterOption.id;
7342
- }
7343
- return false;
7344
- });
7345
- var SmartTableHeaderFilterMenu = ({
7346
- headCell,
7347
- numActiveFilters,
7348
- headerFilters,
7349
- shouldShowCheckOnFilter,
7350
- onApplyFilters
7351
- }) => {
7352
- const { classes } = useStyles49();
7353
- const [anchorEl, setAnchorEl] = (0, import_react34.useState)(null);
7354
- const [filterOptionsData, setFilterOptionsData] = (0, import_react34.useState)();
7355
- const [selectedFilters, setSelectedFilters] = (0, import_react34.useState)(
7356
- headerFilters[headCell.id] ?? []
7357
- );
7358
- (0, import_react34.useEffect)(() => {
7359
- if (headCell.filterOptions) {
7360
- setFilterOptionsData(headCell.filterOptions);
7361
- }
7362
- }, [headCell.filterOptions]);
7363
- const numFilterOptions = (0, import_react34.useMemo)(() => filterOptionsData?.length ?? 0, [filterOptionsData?.length]);
7364
- const numCurrentSelectedFilters = selectedFilters.length;
7365
- const handleFilterMenuOpen = (event) => {
7366
- if (!numFilterOptions) {
7367
- headCell.refetchFilterOptions?.();
7368
- }
7369
- setAnchorEl(event.currentTarget);
7370
- };
7371
- const handleFilterMenuClose = () => {
7372
- setSelectedFilters(headerFilters[headCell.id]);
7373
- setAnchorEl(null);
7374
- };
7375
- const handleFilterOptionClick = (option) => {
7376
- const selectedIndex = findFilterIndex(selectedFilters, option);
7377
- let newSelected;
7378
- if (selectedIndex === -1) {
7379
- if (typeof option === "string") {
7380
- newSelected = [...selectedFilters, option];
7381
- } else {
7382
- newSelected = [...selectedFilters, option];
7383
- }
7384
- } else {
7385
- newSelected = selectedFilters.filter(
7386
- (_, index) => index !== selectedIndex
7387
- );
7388
- }
7389
- setSelectedFilters(newSelected);
7390
- };
7391
- const handleApplyFilters = (shouldSave) => {
7392
- const updatedFilters = {
7393
- ...headerFilters,
7394
- [headCell.id]: [...selectedFilters]
7395
- };
7396
- onApplyFilters?.(updatedFilters, shouldSave);
7397
- setAnchorEl(null);
7398
- };
7399
- (0, import_react34.useEffect)(() => {
7400
- setSelectedFilters(headerFilters[headCell.id] ?? []);
7401
- }, [headerFilters, headCell.id]);
7402
- const isOptionChecked = (0, import_react34.useMemo)(() => (resolvedOption) => !!selectedFilters?.some(
7403
- (value) => resolveOptionType(value, headCell.fieldName ?? "") === resolvedOption
7404
- ), [selectedFilters]);
7405
- const loadingSkeletons = /* @__PURE__ */ (0, import_jsx_runtime112.jsxs)(import_material61.Box, { "data-testid": "loading-skeletons", width: 272, children: [
7406
- /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(import_material61.Skeleton, { variant: "rounded", className: classes.skeleton }),
7407
- /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(import_material61.Divider, {}),
7408
- /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(import_material61.Skeleton, { variant: "rounded", className: classes.skeleton }),
7409
- /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(import_material61.Skeleton, { variant: "rounded", className: classes.skeleton }),
7410
- /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(import_material61.Skeleton, { variant: "rounded", className: classes.skeleton }),
7411
- /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(import_material61.Skeleton, { variant: "rounded", className: classes.skeleton }),
7412
- /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(import_material61.Divider, {}),
7413
- /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(import_material61.Skeleton, { variant: "rounded", className: classes.skeleton })
7414
- ] });
7415
- return /* @__PURE__ */ (0, import_jsx_runtime112.jsxs)(import_jsx_runtime112.Fragment, { children: [
7416
- /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(
7417
- ActiveFiltersIconButton_default,
7418
- {
7419
- numActiveFilters,
7420
- handleClick: handleFilterMenuOpen,
7421
- className: (0, import_classnames3.default)("filter-menu-trigger", {
7422
- "has-active-filters": !!numActiveFilters || !!anchorEl
7423
- })
7424
- }
7425
- ),
7426
- /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(
7427
- import_material61.Menu,
7428
- {
7429
- open: !!anchorEl,
7430
- onClose: handleFilterMenuClose,
7431
- anchorEl,
7432
- "data-testid": "filter-menu",
7433
- anchorOrigin: { vertical: "bottom", horizontal: "right" },
7434
- transformOrigin: { vertical: "top", horizontal: "right" },
7435
- children: headCell.isFetchingFilterOptions ? loadingSkeletons : /* @__PURE__ */ (0, import_jsx_runtime112.jsxs)(import_material61.Box, { className: classes.filterMenu, children: [
7436
- /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(import_material61.Box, { px: 3, mb: 0.5, children: /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(
7437
- import_material61.FormControlLabel,
7438
- {
7439
- label: "Select All",
7440
- control: /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(
7441
- import_material61.Checkbox,
7442
- {
7443
- disableRipple: true,
7444
- checked: numCurrentSelectedFilters === numFilterOptions,
7445
- indeterminate: numCurrentSelectedFilters > 0 && numCurrentSelectedFilters < numFilterOptions,
7446
- onChange: ({ target: { checked } }) => {
7447
- if (checked) {
7448
- setSelectedFilters([...filterOptionsData]);
7449
- } else {
7450
- setSelectedFilters([]);
7451
- }
7452
- }
7453
- }
7454
- )
7455
- }
7456
- ) }),
7457
- /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(import_material61.Divider, { sx: { mb: 0.5 } }),
7458
- /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(import_material61.Box, { className: classes.filterOptions, children: filterOptionsData?.map(
7459
- (option) => {
7460
- const resolvedOption = resolveOptionType(option, headCell.fieldName ?? "");
7461
- return /* @__PURE__ */ (0, import_jsx_runtime112.jsxs)(
7462
- import_material61.Box,
7463
- {
7464
- className: classes.filter,
7465
- children: [
7466
- /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(
7467
- import_material61.FormControlLabel,
7468
- {
7469
- label: resolvedOption,
7470
- control: /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(
7471
- import_material61.Checkbox,
7472
- {
7473
- disableRipple: true,
7474
- onChange: () => handleFilterOptionClick(option),
7475
- checked: isOptionChecked(resolvedOption)
7476
- }
7477
- )
7478
- },
7479
- resolvedOption
7480
- ),
7481
- shouldShowCheckOnFilter?.(headCell.id, option) ? /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(import_material61.Tooltip, { title: "This filter is saved as default", children: /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(import_Check.default, { fontSize: "small", color: "action" }) }) : null
7482
- ]
7483
- },
7484
- resolvedOption
7485
- );
7486
- }
7487
- ) }),
7488
- /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(import_material61.Divider, { sx: { mb: 0.5 } }),
7489
- /* @__PURE__ */ (0, import_jsx_runtime112.jsxs)(import_material61.Box, { className: classes.applyFilterButtonsContainer, children: [
7490
- /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(
7491
- ExtendedButton_default,
7492
- {
7493
- copy: "Save as Default",
7494
- buttonType: "button",
7495
- variant: "text",
7496
- tooltip: "Persists those filters for future visits",
7497
- className: classes.saveAsDefaultButton,
7498
- onClick: () => handleApplyFilters(true)
7499
- }
7500
- ),
7501
- /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(
7502
- ExtendedButton_default,
7503
- {
7504
- copy: "Apply",
7505
- color: "primary",
7506
- buttonType: "submit",
7507
- onClick: () => handleApplyFilters(false)
7508
- }
7509
- )
7510
- ] })
7511
- ] })
7512
- }
7513
- )
7514
- ] });
7515
- };
7516
- var SmartTableHeaderFilterMenu_default = (0, import_react34.memo)(SmartTableHeaderFilterMenu);
7517
-
7518
- // src/components/Table/Table.tsx
7519
- var import_react35 = require("react");
7520
- var import_material63 = require("@mui/material");
7521
- var import_debounce = __toESM(require_debounce(), 1);
7522
- var import_mui56 = require("tss-react/mui");
7523
- var import_uuid = require("uuid");
7524
-
7525
- // src/components/TableLoading/TableLoading.tsx
7526
- var import_material62 = require("@mui/material");
7527
- var import_jsx_runtime113 = require("react/jsx-runtime");
7528
- var TableLoading = ({
7529
- rowsPerPage,
7530
- rowHeight
7531
- }) => /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(import_material62.Box, { children: Array.from({ length: rowsPerPage ?? 0 }).map((_, index) => /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(
7532
- import_material62.Skeleton,
7533
- {
7534
- animation: "pulse",
7535
- "data-testid": "table-loading-skeleton",
7536
- style: { margin: "8px", opacity: 0.4 },
7537
- variant: "rectangular",
7538
- height: rowHeight
7539
- },
7540
- index
7541
- )) });
7542
- var TableLoading_default = TableLoading;
7543
-
7544
- // src/components/Table/helpers.tsx
7545
- function stableSort2(array, cmp) {
7546
- const stabilizedThis = array.map((el, index) => [el, index]);
7547
- stabilizedThis.sort((a, b) => {
7548
- const order = cmp(a[0], b[0]);
7549
- if (order !== 0) {
7550
- return order;
7551
- }
7552
- return a[1] - b[1];
7553
- });
7554
- return stabilizedThis.map((el) => el[0]);
7555
- }
7556
- function descendingComparator2(a, b, orderBy) {
7557
- if (b[orderBy] < a[orderBy]) {
7558
- return -1;
7559
- }
7560
- if (b[orderBy] > a[orderBy]) {
7561
- return 1;
7562
- }
7563
- return 0;
7564
- }
7565
- function getSorting(order, orderBy) {
7566
- return order === "desc" ? (a, b) => descendingComparator2(a, b, orderBy) : (a, b) => -descendingComparator2(a, b, orderBy);
7567
- }
7568
- function calculateRowsPerPage(rowHeight) {
7569
- const appContainerDom = document.getElementById("mainContainer");
7570
- const headerDom = document.getElementById("aboveTableHeader");
7571
- if (appContainerDom && headerDom) {
7572
- return Math.floor(
7573
- (appContainerDom.clientHeight - headerDom.clientHeight - 24) / rowHeight - 2
7574
- );
7575
- }
7576
- return 1;
7577
- }
7578
-
7579
- // src/components/Table/Table.tsx
7580
- var import_jsx_runtime114 = require("react/jsx-runtime");
7581
- var useStyles50 = (0, import_mui56.makeStyles)()(() => ({
7582
- root: {
7583
- height: "calc(100vh - 262px)",
7584
- overflow: "scroll"
7585
- },
7586
- paper: {
7587
- width: "100%",
7588
- display: "flex",
7589
- flexDirection: "column",
7590
- justifyContent: "space-between"
7591
- },
7592
- header: {
7593
- "& .MuiTableSortLabel-root": {
7594
- fontWeight: 600,
7595
- fontSize: ".875rem"
7596
- }
7597
- },
7598
- container: {
7599
- maxHeight: "calc(100% - 0)"
7600
- }
7601
- }));
7602
- var Table2 = ({
7603
- appliedFilters,
7444
+ if (valA > valB) {
7445
+ return -1;
7446
+ }
7447
+ if (valA < valB) {
7448
+ return 1;
7449
+ }
7450
+ return 0;
7451
+ };
7452
+ var stableSort2 = (array, cmp) => array.map((el, index) => ({ el, index })).sort((a, b) => {
7453
+ const order = cmp(a.el, b.el);
7454
+ return order !== 0 ? order : a.index - b.index;
7455
+ }).map((el) => el.el);
7456
+ var getComparator = (order, orderBy) => order === "desc" ? (a, b) => descendingComparator2(a, b, orderBy) : (a, b) => -descendingComparator2(a, b, orderBy);
7457
+ var TableDesktop = ({
7604
7458
  data,
7605
- doNotCalculateRows,
7606
7459
  headCells,
7460
+ RenderItem,
7461
+ appliedFilters,
7462
+ headerFilters,
7463
+ children,
7464
+ height,
7607
7465
  isLoading,
7608
- onRowClick,
7609
- page = 0,
7610
- RenderItem = null,
7611
- rowsPerPage: defaultRowsPerPage = 10,
7612
- serverRendered,
7613
- updateSort
7466
+ rowsPerPage = 50,
7467
+ enableCheckboxSelection = false,
7468
+ disableInternalSort = false,
7469
+ updateSort,
7470
+ showClearFilterButton,
7471
+ handleClickOnClearFiltersButton,
7472
+ deleteItem,
7473
+ keyField = "id",
7474
+ tableLayout = "auto",
7475
+ onApplyFilters,
7476
+ shouldShowCheckOnFilter
7614
7477
  }) => {
7615
- const [order, setOrder] = (0, import_react35.useState)(appliedFilters?.sortDir || "desc");
7616
- const [orderBy, setOrderBy] = (0, import_react35.useState)(
7478
+ const [order, setOrder] = (0, import_react34.useState)(appliedFilters?.sortDir || "desc");
7479
+ const [orderBy, setOrderBy] = (0, import_react34.useState)(
7617
7480
  appliedFilters?.sortField || "delivery_date"
7618
7481
  );
7619
- const [rowsPerPage, setRowsPerPage] = (0, import_react35.useState)(defaultRowsPerPage);
7482
+ const [selected, setSelected] = (0, import_react34.useState)([]);
7483
+ const [page] = (0, import_react34.useState)(0);
7620
7484
  const { classes } = useStyles50();
7621
7485
  const rowHeight = 56;
7622
- const emptyRows = rowsPerPage - Math.min(rowsPerPage, data.length - page * rowsPerPage);
7486
+ const emptyRows = (0, import_react34.useMemo)(
7487
+ () => rowsPerPage - data.length,
7488
+ [rowsPerPage, data]
7489
+ );
7490
+ const visibleHeadCells = (0, import_react34.useMemo)(
7491
+ () => headCells.filter((headCell) => headCell?.enabled ?? true),
7492
+ [headCells]
7493
+ );
7494
+ const handleSelectAllClick = (0, import_react34.useCallback)(
7495
+ (event) => {
7496
+ if (event.target.checked) {
7497
+ const newSelected = data.map((n) => n[keyField]);
7498
+ setSelected(newSelected);
7499
+ return;
7500
+ }
7501
+ setSelected([]);
7502
+ },
7503
+ [data, keyField]
7504
+ );
7623
7505
  const handleRequestSort = (event, property) => {
7624
7506
  const isAsc = orderBy === property && order === "asc";
7625
7507
  const orderDir = isAsc ? "desc" : "asc";
@@ -7629,277 +7511,119 @@ var Table2 = ({
7629
7511
  updateSort(property, orderDir);
7630
7512
  }
7631
7513
  };
7632
- (0, import_react35.useLayoutEffect)(() => {
7633
- if (!doNotCalculateRows) {
7634
- return;
7635
- }
7636
- function updateRowsPerPage() {
7637
- const newRowsPerPage = calculateRowsPerPage(rowHeight);
7638
- setRowsPerPage(newRowsPerPage);
7639
- }
7640
- updateRowsPerPage();
7641
- const debounced = (0, import_debounce.default)(updateRowsPerPage, 150);
7642
- window.addEventListener("resize", debounced);
7643
- return () => {
7644
- window.removeEventListener("resize", debounced);
7645
- };
7646
- }, [doNotCalculateRows]);
7647
- const createSortHandler = (property) => (event) => {
7648
- handleRequestSort(event, property);
7649
- };
7650
- const getTableRows = () => {
7651
- const index = page;
7652
- const rows = serverRendered ? data : stableSort2(data, getSorting(order, orderBy)).slice(
7653
- index * rowsPerPage,
7654
- index * rowsPerPage + rowsPerPage
7655
- );
7656
- const rowsComponents = rows.map((row) => {
7657
- if (RenderItem) {
7658
- return /* @__PURE__ */ (0, import_jsx_runtime114.jsx)(RenderItem, { ...row }, row.id);
7514
+ const handleRowCheckboxClick = (0, import_react34.useCallback)(
7515
+ (event, keyFieldValue) => {
7516
+ const selectedIndex = selected.indexOf(keyFieldValue);
7517
+ let newSelected = [];
7518
+ if (selectedIndex === -1) {
7519
+ newSelected = newSelected.concat(selected, keyFieldValue);
7520
+ } else if (selectedIndex === 0) {
7521
+ newSelected = newSelected.concat(selected.slice(1));
7522
+ } else if (selectedIndex === selected.length - 1) {
7523
+ newSelected = newSelected.concat(selected.slice(0, -1));
7524
+ } else if (selectedIndex > 0) {
7525
+ newSelected = newSelected.concat(
7526
+ selected.slice(0, selectedIndex),
7527
+ selected.slice(selectedIndex + 1)
7528
+ );
7659
7529
  }
7660
- return /* @__PURE__ */ (0, import_jsx_runtime114.jsx)(import_material63.TableRow, { hover: true, onClick: () => onRowClick?.(row), children: headCells?.map((column) => /* @__PURE__ */ (0, import_jsx_runtime114.jsx)(import_material63.TableCell, { children: row[column.id] }, column.id)) }, row.id);
7661
- });
7662
- if (emptyRows > 0 && rowsPerPage > emptyRows) {
7663
- rowsComponents.push(
7664
- /* @__PURE__ */ (0, import_jsx_runtime114.jsx)(import_material63.TableRow, { style: { height: rowHeight * emptyRows }, children: /* @__PURE__ */ (0, import_jsx_runtime114.jsx)(import_material63.TableCell, { colSpan: 8 }) }, (0, import_uuid.v4)())
7530
+ setSelected(newSelected);
7531
+ },
7532
+ [selected]
7533
+ );
7534
+ const renderTableRows = (0, import_react34.useMemo)(() => {
7535
+ const sortedData = disableInternalSort ? data : stableSort2(data, getComparator(order, orderBy));
7536
+ return sortedData.slice(page * rowsPerPage, page * rowsPerPage + rowsPerPage).map((row, index) => {
7537
+ const isItemSelected = selected.includes(row[keyField]);
7538
+ return /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(
7539
+ RenderItem,
7540
+ {
7541
+ ...{
7542
+ ...row,
7543
+ index,
7544
+ deleteItem,
7545
+ isItemSelected,
7546
+ enableCheckboxSelection,
7547
+ keyFieldValue: row[keyField],
7548
+ handleRowCheckboxClick,
7549
+ visibleHeadCells
7550
+ }
7551
+ },
7552
+ row[keyField] ?? index
7665
7553
  );
7666
- }
7667
- return rowsComponents;
7668
- };
7669
- return /* @__PURE__ */ (0, import_jsx_runtime114.jsx)(import_material63.Paper, { className: classes.root, children: /* @__PURE__ */ (0, import_jsx_runtime114.jsx)(import_material63.Box, { className: classes.paper, children: isLoading ? /* @__PURE__ */ (0, import_jsx_runtime114.jsx)(TableLoading_default, { rowHeight, rowsPerPage }) : /* @__PURE__ */ (0, import_jsx_runtime114.jsx)(import_material63.TableContainer, { className: classes.container, children: /* @__PURE__ */ (0, import_jsx_runtime114.jsxs)(import_material63.Table, { size: "medium", stickyHeader: true, children: [
7670
- /* @__PURE__ */ (0, import_jsx_runtime114.jsx)(import_material63.TableHead, { className: classes.header, children: /* @__PURE__ */ (0, import_jsx_runtime114.jsx)(import_material63.TableRow, { children: headCells?.map((headCell) => /* @__PURE__ */ (0, import_jsx_runtime114.jsx)(
7671
- import_material63.TableCell,
7554
+ });
7555
+ }, [
7556
+ data,
7557
+ order,
7558
+ orderBy,
7559
+ page,
7560
+ rowsPerPage,
7561
+ selected,
7562
+ enableCheckboxSelection,
7563
+ disableInternalSort,
7564
+ deleteItem,
7565
+ keyField,
7566
+ handleRowCheckboxClick,
7567
+ visibleHeadCells,
7568
+ RenderItem
7569
+ ]);
7570
+ return /* @__PURE__ */ (0, import_jsx_runtime113.jsx)("div", { className: classes.root, style: { height }, children: /* @__PURE__ */ (0, import_jsx_runtime113.jsxs)(import_material62.Paper, { className: classes.paper, children: [
7571
+ isLoading ? /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(import_material62.Box, { width: "100%", overflow: "hidden", children: [...Array(Math.floor(rowsPerPage ?? 50))].map((_, index) => /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(
7572
+ import_material62.Skeleton,
7672
7573
  {
7673
- align: "left",
7674
- sortDirection: orderBy === headCell.id ? order : void 0,
7675
- children: /* @__PURE__ */ (0, import_jsx_runtime114.jsx)(
7676
- import_material63.TableSortLabel,
7677
- {
7678
- active: orderBy === headCell.id,
7679
- direction: orderBy === headCell.id ? order : "asc",
7680
- onClick: createSortHandler(headCell.id),
7681
- children: headCell.label
7682
- }
7683
- )
7684
- },
7685
- headCell.id
7686
- )) }) }),
7687
- /* @__PURE__ */ (0, import_jsx_runtime114.jsxs)(import_material63.TableBody, { children: [
7688
- getTableRows(),
7689
- rowsPerPage === emptyRows && /* @__PURE__ */ (0, import_jsx_runtime114.jsx)(import_material63.TableRow, { style: { height: rowHeight * emptyRows }, children: /* @__PURE__ */ (0, import_jsx_runtime114.jsx)(import_material63.TableCell, { colSpan: 8, align: "center", children: "Nothing to display" }) })
7690
- ] })
7691
- ] }) }) }) });
7692
- };
7693
- var Table_default = Table2;
7694
-
7695
- // src/components/TableDesktopRowActions/TableDesktopRowActions.tsx
7696
- var import_material64 = require("@mui/material");
7697
- var import_jsx_runtime115 = require("react/jsx-runtime");
7698
- var TableDesktopRowActions = ({
7699
- isRowHovered,
7700
- children,
7701
- sx,
7702
- zIndex = 1,
7703
- backgroundColor
7704
- }) => {
7705
- return isRowHovered ? /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(
7706
- import_material64.TableCell,
7707
- {
7708
- padding: "none",
7709
- sx: {
7710
- top: 0,
7711
- right: 0,
7712
- zIndex,
7713
- position: "sticky",
7714
- display: "flex",
7715
- justifyContent: "flex-end",
7716
- alignItems: "center"
7717
- },
7718
- children: /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(
7719
- import_material64.Box,
7720
- {
7721
- sx,
7722
- display: "flex",
7723
- flexDirection: "row",
7724
- borderLeft: `1px solid ${colors.neutral300}`,
7725
- bgcolor: backgroundColor ?? ((theme) => theme.palette.background.default),
7726
- children
7727
- }
7728
- )
7729
- }
7730
- ) : null;
7731
- };
7732
-
7733
- // src/components/TableDesktopRowCell/TableDesktopRowCell.tsx
7734
- var import_react37 = require("react");
7735
- var import_material65 = require("@mui/material");
7736
-
7737
- // src/components/TableDesktopRowCell/TableDesktopSmartSelect.tsx
7738
- var import_react36 = require("react");
7739
- var import_jsx_runtime116 = require("react/jsx-runtime");
7740
- var resolveValue = (value) => {
7741
- if (typeof value === "string") {
7742
- return value;
7743
- }
7744
- return value?.id;
7745
- };
7746
- var TableDesktopSmartSelect = (0, import_react36.memo)(({
7747
- ref,
7748
- initialValue,
7749
- inputLabel,
7750
- fieldName,
7751
- rowId,
7752
- filterOptions,
7753
- refetchFilterOptions,
7754
- isFetchingFilterOptions,
7755
- onUpdateEditableCell
7756
- }) => {
7757
- const [value, setValue] = (0, import_react36.useState)(initialValue);
7758
- const [options, setOptions] = (0, import_react36.useState)();
7759
- const valueId = resolveValue(value);
7760
- const valueLabel = resolveOptionType(value, fieldName);
7761
- (0, import_react36.useEffect)(() => {
7762
- if (filterOptions) {
7763
- const parsedOptions = filterOptions?.map((option) => ({
7764
- value: resolveValue(option),
7765
- label: String(resolveOptionType(option, fieldName))
7766
- }));
7767
- setOptions(parsedOptions);
7768
- }
7769
- }, [filterOptions]);
7770
- return /* @__PURE__ */ (0, import_jsx_runtime116.jsx)(
7771
- SmartSelect_default,
7772
- {
7773
- ref,
7774
- value: valueId,
7775
- inputLabel,
7776
- options,
7777
- refetch: refetchFilterOptions,
7778
- isFetching: isFetchingFilterOptions,
7779
- defaultOption: {
7780
- value: valueId ?? "",
7781
- label: String(valueLabel ?? "")
7574
+ animation: "pulse",
7575
+ variant: "rounded",
7576
+ sx: { margin: 1 },
7577
+ height: rowHeight,
7578
+ "data-testid": "loading-skeleton"
7782
7579
  },
7783
- onChange: ({ value: value2, label }) => {
7784
- setValue({ id: value2 ?? "", name: label ?? "" });
7785
- onUpdateEditableCell?.(rowId, value2 ?? "");
7786
- }
7787
- }
7788
- );
7789
- });
7790
-
7791
- // src/components/TableDesktopRowCell/TableDesktopRowCell.tsx
7792
- var import_Check2 = __toESM(require("@mui/icons-material/Check"), 1);
7793
- var import_jsx_runtime117 = require("react/jsx-runtime");
7794
- var TableDesktopRowCell = ({
7795
- ref,
7796
- inputLabel,
7797
- editInitialValue,
7798
- rowId,
7799
- fieldName,
7800
- width,
7801
- isEditMode,
7802
- readOnlyValue,
7803
- editableCellType,
7804
- filterOptions,
7805
- refetchFilterOptions,
7806
- isFetchingFilterOptions,
7807
- onUpdateEditableCell
7808
- }) => {
7809
- const cellRef = (0, import_react37.useRef)(null);
7810
- const [isOverflowed, setIsOverflowed] = (0, import_react37.useState)(false);
7811
- (0, import_react37.useEffect)(() => {
7812
- const ref2 = cellRef.current;
7813
- if (ref2) {
7814
- setIsOverflowed(ref2.scrollWidth > ref2.clientWidth);
7815
- }
7816
- }, [readOnlyValue, width]);
7817
- const editableComponents = {
7818
- "select": /* @__PURE__ */ (0, import_jsx_runtime117.jsx)(
7819
- TableDesktopSmartSelect,
7820
- {
7821
- ref,
7822
- rowId,
7823
- fieldName,
7824
- initialValue: editInitialValue,
7825
- inputLabel: inputLabel ?? "",
7826
- filterOptions,
7827
- refetchFilterOptions,
7828
- isFetchingFilterOptions,
7829
- onUpdateEditableCell
7830
- }
7831
- ),
7832
- "checkbox": /* @__PURE__ */ (0, import_jsx_runtime117.jsx)(
7833
- import_material65.Checkbox,
7834
- {
7835
- disableRipple: true,
7836
- defaultChecked: editInitialValue,
7837
- onChange: ({ target: { checked } }) => {
7838
- onUpdateEditableCell?.(rowId, checked);
7839
- }
7840
- }
7841
- ),
7842
- "text": /* @__PURE__ */ (0, import_jsx_runtime117.jsx)(
7843
- import_material65.TextField,
7844
- {
7845
- fullWidth: true,
7846
- variant: "standard",
7847
- defaultValue: editInitialValue,
7848
- label: inputLabel,
7849
- onBlur: ({ target: { value } }) => {
7850
- onUpdateEditableCell?.(rowId, value);
7851
- }
7852
- }
7853
- ),
7854
- "numeric": /* @__PURE__ */ (0, import_jsx_runtime117.jsx)(
7855
- import_material65.TextField,
7580
+ index
7581
+ )) }) : /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(import_material62.TableContainer, { className: classes.container, children: /* @__PURE__ */ (0, import_jsx_runtime113.jsxs)(
7582
+ import_material62.Table,
7856
7583
  {
7857
- fullWidth: true,
7858
- variant: "standard",
7859
- defaultValue: editInitialValue,
7860
- label: inputLabel,
7861
- onChange: (e) => {
7862
- e.target.value = e.target.value.replace(/\D/g, "");
7863
- },
7864
- onBlur: ({ target: { value } }) => {
7865
- onUpdateEditableCell?.(rowId, value);
7866
- },
7867
- slotProps: {
7868
- input: {
7869
- inputMode: "numeric"
7870
- }
7871
- }
7584
+ "aria-labelledby": "tableTitle",
7585
+ "aria-label": "sticky table",
7586
+ stickyHeader: true,
7587
+ style: { tableLayout },
7588
+ children: [
7589
+ /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(
7590
+ SmartTableHeader_default,
7591
+ {
7592
+ headCells: visibleHeadCells,
7593
+ order,
7594
+ orderBy,
7595
+ numSelected: selected.length,
7596
+ numRows: data.length,
7597
+ enableCheckboxSelection,
7598
+ headerFilters: headerFilters ?? {},
7599
+ onRequestSort: handleRequestSort,
7600
+ onSelectAllClick: handleSelectAllClick,
7601
+ onApplyFilters,
7602
+ shouldShowCheckOnFilter
7603
+ }
7604
+ ),
7605
+ /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(import_material62.TableBody, { children: rowsPerPage !== emptyRows ? renderTableRows : /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(
7606
+ TableEmptyResult_default,
7607
+ {
7608
+ colSpan: enableCheckboxSelection ? visibleHeadCells.length + 1 : visibleHeadCells.length,
7609
+ showClearFilterButton,
7610
+ handleClickOnClearFiltersButton
7611
+ }
7612
+ ) })
7613
+ ]
7872
7614
  }
7873
- )
7874
- };
7875
- const getReadOnlyBooleanIcon = (value) => {
7876
- if (value) {
7877
- return /* @__PURE__ */ (0, import_jsx_runtime117.jsx)(import_Check2.default, { sx: { fontSize: 16 } });
7878
- }
7879
- return "-";
7880
- };
7881
- return /* @__PURE__ */ (0, import_jsx_runtime117.jsx)(import_material65.Tooltip, { title: isOverflowed ? String(readOnlyValue) : "", arrow: true, children: /* @__PURE__ */ (0, import_jsx_runtime117.jsx)(
7882
- import_material65.TableCell,
7883
- {
7884
- ref: cellRef,
7885
- align: "left",
7886
- sx: {
7887
- width: width ?? "auto",
7888
- overflow: "hidden",
7889
- textOverflow: "ellipsis",
7890
- whiteSpace: "nowrap"
7891
- },
7892
- children: isEditMode && editableCellType ? editableComponents[editableCellType] : typeof readOnlyValue === "boolean" ? getReadOnlyBooleanIcon(readOnlyValue) : readOnlyValue
7893
- }
7894
- ) });
7615
+ ) }),
7616
+ children
7617
+ ] }) });
7895
7618
  };
7619
+ var TableDesktop_default = TableDesktop;
7896
7620
 
7897
7621
  // src/components/TableHeader/TableHeader.tsx
7898
- var import_react38 = require("react");
7622
+ var import_react35 = require("react");
7899
7623
  var import_icons_material12 = require("@mui/icons-material");
7900
- var import_material66 = require("@mui/material");
7624
+ var import_material63 = require("@mui/material");
7901
7625
  var import_mui57 = require("tss-react/mui");
7902
- var import_jsx_runtime118 = require("react/jsx-runtime");
7626
+ var import_jsx_runtime114 = require("react/jsx-runtime");
7903
7627
  var useStyles51 = (0, import_mui57.makeStyles)()(() => ({
7904
7628
  sortLabel: {
7905
7629
  "& .MuiTableSortLabel-icon": {
@@ -7908,9 +7632,9 @@ var useStyles51 = (0, import_mui57.makeStyles)()(() => ({
7908
7632
  }
7909
7633
  }));
7910
7634
  var TableHeader = ({ cells, onSort = null }) => {
7911
- const [sortableCells, setSortableCells] = (0, import_react38.useState)([]);
7635
+ const [sortableCells, setSortableCells] = (0, import_react35.useState)([]);
7912
7636
  const { classes } = useStyles51();
7913
- (0, import_react38.useEffect)(() => {
7637
+ (0, import_react35.useEffect)(() => {
7914
7638
  setSortableCells(cells);
7915
7639
  }, []);
7916
7640
  const getNewSortDirection = (direction) => {
@@ -7944,8 +7668,8 @@ var TableHeader = ({ cells, onSort = null }) => {
7944
7668
  });
7945
7669
  setSortableCells(sortedCells);
7946
7670
  };
7947
- return /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(import_material66.TableHead, { children: /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(import_material66.TableRow, { children: sortableCells.map((cell, key) => /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(import_material66.TableCell, { children: cell.isSortable ? /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(
7948
- import_material66.TableSortLabel,
7671
+ return /* @__PURE__ */ (0, import_jsx_runtime114.jsx)(import_material63.TableHead, { children: /* @__PURE__ */ (0, import_jsx_runtime114.jsx)(import_material63.TableRow, { children: sortableCells.map((cell, key) => /* @__PURE__ */ (0, import_jsx_runtime114.jsx)(import_material63.TableCell, { children: cell.isSortable ? /* @__PURE__ */ (0, import_jsx_runtime114.jsx)(
7672
+ import_material63.TableSortLabel,
7949
7673
  {
7950
7674
  className: classes.sortLabel,
7951
7675
  direction: cell?.direction || "asc",
@@ -7955,12 +7679,12 @@ var TableHeader = ({ cells, onSort = null }) => {
7955
7679
  }
7956
7680
  ) : cell.label }, cell.label || key)) }) });
7957
7681
  };
7958
- var TableHeader_default = (0, import_react38.memo)(TableHeader);
7682
+ var TableHeader_default = (0, import_react35.memo)(TableHeader);
7959
7683
 
7960
7684
  // src/components/TextDivider/TextDivider.tsx
7961
- var import_material67 = require("@mui/material");
7685
+ var import_material64 = require("@mui/material");
7962
7686
  var import_mui58 = require("tss-react/mui");
7963
- var import_jsx_runtime119 = require("react/jsx-runtime");
7687
+ var import_jsx_runtime115 = require("react/jsx-runtime");
7964
7688
  var useStyles52 = (0, import_mui58.makeStyles)()(() => ({
7965
7689
  icon: {
7966
7690
  fontSize: 20
@@ -7997,19 +7721,19 @@ var TextDivider = ({
7997
7721
  }) => {
7998
7722
  const { classes } = useStyles52();
7999
7723
  const iconColor = color ?? colors.neutral900;
8000
- return /* @__PURE__ */ (0, import_jsx_runtime119.jsxs)(
8001
- import_material67.Box,
7724
+ return /* @__PURE__ */ (0, import_jsx_runtime115.jsxs)(
7725
+ import_material64.Box,
8002
7726
  {
8003
7727
  display: "flex",
8004
7728
  alignItems: "center",
8005
7729
  justifyContent: "space-between",
8006
7730
  className: classes.container,
8007
7731
  children: [
8008
- /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(import_material67.Divider, { className: classes.leftDivider }),
8009
- /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(import_material67.Button, { onClick, disabled: !onClick, className: classes.button, children: /* @__PURE__ */ (0, import_jsx_runtime119.jsxs)(import_material67.Box, { className: classes.center, children: [
8010
- Icon2 && iconPosition === "left" && /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(Icon2, { className: classes.icon, style: { color: iconColor } }),
8011
- /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(
8012
- import_material67.Typography,
7732
+ /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(import_material64.Divider, { className: classes.leftDivider }),
7733
+ /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(import_material64.Button, { onClick, disabled: !onClick, className: classes.button, children: /* @__PURE__ */ (0, import_jsx_runtime115.jsxs)(import_material64.Box, { className: classes.center, children: [
7734
+ Icon2 && iconPosition === "left" && /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(Icon2, { className: classes.icon, style: { color: iconColor } }),
7735
+ /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(
7736
+ import_material64.Typography,
8013
7737
  {
8014
7738
  color: "textSecondary",
8015
7739
  className: classes.title,
@@ -8017,9 +7741,9 @@ var TextDivider = ({
8017
7741
  children: title
8018
7742
  }
8019
7743
  ),
8020
- Icon2 && iconPosition === "right" && /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(Icon2, { className: classes.icon, style: { color: iconColor } })
7744
+ Icon2 && iconPosition === "right" && /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(Icon2, { className: classes.icon, style: { color: iconColor } })
8021
7745
  ] }) }),
8022
- /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(import_material67.Divider, { className: classes.rightDivider })
7746
+ /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(import_material64.Divider, { className: classes.rightDivider })
8023
7747
  ]
8024
7748
  }
8025
7749
  );
@@ -8031,7 +7755,7 @@ var import_react_dates = require("react-dates");
8031
7755
  var import_mui59 = require("tss-react/mui");
8032
7756
  var import_initialize = require("react-dates/initialize");
8033
7757
  var import_datepicker = require("react-dates/lib/css/_datepicker.css");
8034
- var import_jsx_runtime120 = require("react/jsx-runtime");
7758
+ var import_jsx_runtime116 = require("react/jsx-runtime");
8035
7759
  var useStyles53 = (0, import_mui59.makeStyles)()((theme) => ({
8036
7760
  wrapper: {
8037
7761
  "& .DateRangePicker": {
@@ -8127,15 +7851,15 @@ var ThemedDateRangePicker = ({
8127
7851
  ...props
8128
7852
  }) => {
8129
7853
  const { classes, cx } = useStyles53();
8130
- return /* @__PURE__ */ (0, import_jsx_runtime120.jsx)("div", { className: cx(classes.wrapper, className), children: /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(import_react_dates.DateRangePicker, { ...props }) });
7854
+ return /* @__PURE__ */ (0, import_jsx_runtime116.jsx)("div", { className: cx(classes.wrapper, className), children: /* @__PURE__ */ (0, import_jsx_runtime116.jsx)(import_react_dates.DateRangePicker, { ...props }) });
8131
7855
  };
8132
7856
  var ThemedDateRangePicker_default = ThemedDateRangePicker;
8133
7857
 
8134
7858
  // src/components/TheToolbar/TheToolbar.tsx
8135
- var import_react39 = require("react");
8136
- var import_material68 = require("@mui/material");
7859
+ var import_react36 = require("react");
7860
+ var import_material65 = require("@mui/material");
8137
7861
  var import_mui60 = require("tss-react/mui");
8138
- var import_jsx_runtime121 = require("react/jsx-runtime");
7862
+ var import_jsx_runtime117 = require("react/jsx-runtime");
8139
7863
  var useStyles54 = (0, import_mui60.makeStyles)()((theme) => ({
8140
7864
  menuButton: {
8141
7865
  color: theme.palette.primary.contrastText
@@ -8155,9 +7879,9 @@ var TheToolbar = ({
8155
7879
  rightSection
8156
7880
  }) => {
8157
7881
  const { classes } = useStyles54();
8158
- return /* @__PURE__ */ (0, import_jsx_runtime121.jsxs)(import_material68.Box, { children: [
8159
- /* @__PURE__ */ (0, import_jsx_runtime121.jsx)(import_material68.AppBar, { children: /* @__PURE__ */ (0, import_jsx_runtime121.jsxs)(import_material68.Toolbar, { className: classes.topBar, children: [
8160
- /* @__PURE__ */ (0, import_jsx_runtime121.jsx)(
7882
+ return /* @__PURE__ */ (0, import_jsx_runtime117.jsxs)(import_material65.Box, { children: [
7883
+ /* @__PURE__ */ (0, import_jsx_runtime117.jsx)(import_material65.AppBar, { children: /* @__PURE__ */ (0, import_jsx_runtime117.jsxs)(import_material65.Toolbar, { className: classes.topBar, children: [
7884
+ /* @__PURE__ */ (0, import_jsx_runtime117.jsx)(
8161
7885
  RoundButton_default,
8162
7886
  {
8163
7887
  className: classes.menuButton,
@@ -8166,7 +7890,7 @@ var TheToolbar = ({
8166
7890
  onClick: handleOpen
8167
7891
  }
8168
7892
  ),
8169
- /* @__PURE__ */ (0, import_jsx_runtime121.jsx)(
7893
+ /* @__PURE__ */ (0, import_jsx_runtime117.jsx)(
8170
7894
  CompanyLogo_default,
8171
7895
  {
8172
7896
  size: "small",
@@ -8175,31 +7899,31 @@ var TheToolbar = ({
8175
7899
  imageLogoLightSmall
8176
7900
  }
8177
7901
  ),
8178
- /* @__PURE__ */ (0, import_jsx_runtime121.jsx)(import_material68.Box, { ml: 2, children: leftSection }),
8179
- /* @__PURE__ */ (0, import_jsx_runtime121.jsx)(import_material68.Box, { ml: "auto", children: rightSection })
7902
+ /* @__PURE__ */ (0, import_jsx_runtime117.jsx)(import_material65.Box, { ml: 2, children: leftSection }),
7903
+ /* @__PURE__ */ (0, import_jsx_runtime117.jsx)(import_material65.Box, { ml: "auto", children: rightSection })
8180
7904
  ] }) }),
8181
7905
  LeftDrawer
8182
7906
  ] });
8183
7907
  };
8184
- var TheToolbar_default = (0, import_react39.memo)(TheToolbar);
7908
+ var TheToolbar_default = (0, import_react36.memo)(TheToolbar);
8185
7909
 
8186
7910
  // src/components/ToastMessage/ToastMessage.tsx
8187
- var import_material69 = require("@mui/material");
8188
- var import_jsx_runtime122 = require("react/jsx-runtime");
7911
+ var import_material66 = require("@mui/material");
7912
+ var import_jsx_runtime118 = require("react/jsx-runtime");
8189
7913
  var ToastMessage = ({
8190
7914
  toastType,
8191
7915
  toastMessage,
8192
7916
  open,
8193
7917
  onClose
8194
- }) => /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(
8195
- import_material69.Snackbar,
7918
+ }) => /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(
7919
+ import_material66.Snackbar,
8196
7920
  {
8197
7921
  open,
8198
7922
  autoHideDuration: 1500,
8199
7923
  onClose,
8200
7924
  anchorOrigin: { vertical: "top", horizontal: "right" },
8201
- children: /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(
8202
- import_material69.Alert,
7925
+ children: /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(
7926
+ import_material66.Alert,
8203
7927
  {
8204
7928
  elevation: 6,
8205
7929
  variant: "filled",
@@ -8225,9 +7949,9 @@ var ToastMessage = ({
8225
7949
  var ToastMessage_default = ToastMessage;
8226
7950
 
8227
7951
  // src/components/TwoButtonDialog/TwoButtonDialog.tsx
8228
- var import_material70 = require("@mui/material");
7952
+ var import_material67 = require("@mui/material");
8229
7953
  var import_mui61 = require("tss-react/mui");
8230
- var import_jsx_runtime123 = require("react/jsx-runtime");
7954
+ var import_jsx_runtime119 = require("react/jsx-runtime");
8231
7955
  var useStyles55 = (0, import_mui61.makeStyles)()((theme) => ({
8232
7956
  paper: {
8233
7957
  padding: theme.spacing(2)
@@ -8257,20 +7981,20 @@ var TwoButtonDialog = ({
8257
7981
  cancelButton
8258
7982
  }) => {
8259
7983
  const { classes } = useStyles55();
8260
- return /* @__PURE__ */ (0, import_jsx_runtime123.jsx)(
8261
- import_material70.Dialog,
7984
+ return /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(
7985
+ import_material67.Dialog,
8262
7986
  {
8263
7987
  open,
8264
7988
  disableEnforceFocus: true,
8265
7989
  maxWidth: "sm",
8266
7990
  fullWidth: true,
8267
7991
  closeAfterTransition: true,
8268
- BackdropComponent: import_material70.Backdrop,
7992
+ BackdropComponent: import_material67.Backdrop,
8269
7993
  BackdropProps: { timeout: 500 },
8270
- children: /* @__PURE__ */ (0, import_jsx_runtime123.jsx)(import_material70.Fade, { in: open, children: /* @__PURE__ */ (0, import_jsx_runtime123.jsxs)(import_material70.Paper, { className: classes.paper, children: [
8271
- /* @__PURE__ */ (0, import_jsx_runtime123.jsxs)(import_material70.Box, { className: classes.mb, children: [
8272
- /* @__PURE__ */ (0, import_jsx_runtime123.jsx)(import_material70.Typography, { variant: "h5", component: "div", children: /* @__PURE__ */ (0, import_jsx_runtime123.jsx)(
8273
- import_material70.Box,
7994
+ children: /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(import_material67.Fade, { in: open, children: /* @__PURE__ */ (0, import_jsx_runtime119.jsxs)(import_material67.Paper, { className: classes.paper, children: [
7995
+ /* @__PURE__ */ (0, import_jsx_runtime119.jsxs)(import_material67.Box, { className: classes.mb, children: [
7996
+ /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(import_material67.Typography, { variant: "h5", component: "div", children: /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(
7997
+ import_material67.Box,
8274
7998
  {
8275
7999
  sx: {
8276
8000
  fontWeight: 600
@@ -8278,23 +8002,23 @@ var TwoButtonDialog = ({
8278
8002
  children: title
8279
8003
  }
8280
8004
  ) }),
8281
- /* @__PURE__ */ (0, import_jsx_runtime123.jsxs)(
8282
- import_material70.Box,
8005
+ /* @__PURE__ */ (0, import_jsx_runtime119.jsxs)(
8006
+ import_material67.Box,
8283
8007
  {
8284
8008
  className: classes.mt,
8285
8009
  sx: {
8286
8010
  fontWeight: 600
8287
8011
  },
8288
8012
  children: [
8289
- subtitle1 && /* @__PURE__ */ (0, import_jsx_runtime123.jsx)(import_material70.Typography, { variant: "subtitle1", children: subtitle1 }),
8290
- subtitle2 && /* @__PURE__ */ (0, import_jsx_runtime123.jsx)(import_material70.Typography, { variant: "subtitle1", children: subtitle2 })
8013
+ subtitle1 && /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(import_material67.Typography, { variant: "subtitle1", children: subtitle1 }),
8014
+ subtitle2 && /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(import_material67.Typography, { variant: "subtitle1", children: subtitle2 })
8291
8015
  ]
8292
8016
  }
8293
8017
  )
8294
8018
  ] }),
8295
- /* @__PURE__ */ (0, import_jsx_runtime123.jsx)(import_material70.Divider, {}),
8296
- /* @__PURE__ */ (0, import_jsx_runtime123.jsxs)(import_material70.Box, { className: classes.buttonContainer, children: [
8297
- /* @__PURE__ */ (0, import_jsx_runtime123.jsx)(
8019
+ /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(import_material67.Divider, {}),
8020
+ /* @__PURE__ */ (0, import_jsx_runtime119.jsxs)(import_material67.Box, { className: classes.buttonContainer, children: [
8021
+ /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(
8298
8022
  FilledButton_default,
8299
8023
  {
8300
8024
  copy: cancelLabel,
@@ -8307,7 +8031,7 @@ var TwoButtonDialog = ({
8307
8031
  }
8308
8032
  }
8309
8033
  ),
8310
- /* @__PURE__ */ (0, import_jsx_runtime123.jsx)(
8034
+ /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(
8311
8035
  FilledButton_default,
8312
8036
  {
8313
8037
  color: "primary",
@@ -8316,7 +8040,7 @@ var TwoButtonDialog = ({
8316
8040
  }
8317
8041
  )
8318
8042
  ] }),
8319
- /* @__PURE__ */ (0, import_jsx_runtime123.jsx)(Loading_default, { isLoading: dialogLoading })
8043
+ /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(Loading_default, { isLoading: dialogLoading })
8320
8044
  ] }) })
8321
8045
  }
8322
8046
  );
@@ -8324,30 +8048,30 @@ var TwoButtonDialog = ({
8324
8048
  var TwoButtonDialog_default = TwoButtonDialog;
8325
8049
 
8326
8050
  // src/components/UserBust/UserBust.tsx
8327
- var import_react40 = require("react");
8328
- var import_material71 = require("@mui/material");
8329
- var import_jsx_runtime124 = require("react/jsx-runtime");
8330
- var UserBust = ({ user, avatarProps, typographyProps }) => /* @__PURE__ */ (0, import_jsx_runtime124.jsxs)("div", { children: [
8331
- /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(
8332
- import_material71.Avatar,
8051
+ var import_react37 = require("react");
8052
+ var import_material68 = require("@mui/material");
8053
+ var import_jsx_runtime120 = require("react/jsx-runtime");
8054
+ var UserBust = ({ user, avatarProps, typographyProps }) => /* @__PURE__ */ (0, import_jsx_runtime120.jsxs)("div", { children: [
8055
+ /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(
8056
+ import_material68.Avatar,
8333
8057
  {
8334
8058
  src: user.profile_picture,
8335
8059
  alt: "user_avatar",
8336
8060
  style: { width: avatarProps.width, height: avatarProps.height }
8337
8061
  }
8338
8062
  ),
8339
- /* @__PURE__ */ (0, import_jsx_runtime124.jsxs)("div", { style: { paddingTop: 16 }, children: [
8340
- /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(import_material71.Typography, { ...typographyProps.name, children: `${user.first_name} ${user.last_name}` }),
8341
- /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(import_material71.Typography, { ...typographyProps.username, children: user.username })
8063
+ /* @__PURE__ */ (0, import_jsx_runtime120.jsxs)("div", { style: { paddingTop: 16 }, children: [
8064
+ /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(import_material68.Typography, { ...typographyProps.name, children: `${user.first_name} ${user.last_name}` }),
8065
+ /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(import_material68.Typography, { ...typographyProps.username, children: user.username })
8342
8066
  ] })
8343
8067
  ] });
8344
- var UserBust_default = (0, import_react40.memo)(UserBust);
8068
+ var UserBust_default = (0, import_react37.memo)(UserBust);
8345
8069
 
8346
8070
  // src/components/icons/IconChart.tsx
8347
- var import_jsx_runtime125 = require("react/jsx-runtime");
8071
+ var import_jsx_runtime121 = require("react/jsx-runtime");
8348
8072
  var SvgIconChart = (props) => {
8349
8073
  const { fill } = props;
8350
- return /* @__PURE__ */ (0, import_jsx_runtime125.jsx)(
8074
+ return /* @__PURE__ */ (0, import_jsx_runtime121.jsx)(
8351
8075
  "svg",
8352
8076
  {
8353
8077
  width: "20",
@@ -8356,7 +8080,7 @@ var SvgIconChart = (props) => {
8356
8080
  fill: "none",
8357
8081
  xmlns: "http://www.w3.org/2000/svg",
8358
8082
  ...props,
8359
- children: /* @__PURE__ */ (0, import_jsx_runtime125.jsx)(
8083
+ children: /* @__PURE__ */ (0, import_jsx_runtime121.jsx)(
8360
8084
  "path",
8361
8085
  {
8362
8086
  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",
@@ -8423,7 +8147,6 @@ var IconChart_default = SvgIconChart;
8423
8147
  ScrollableDialog,
8424
8148
  SearchAndFilterHeader,
8425
8149
  SearchAndFilterHeaderForTable,
8426
- SearchFieldDebounced,
8427
8150
  SearchWithFilters,
8428
8151
  SearchWithFiltersForTable,
8429
8152
  SectionName,
@@ -8435,9 +8158,6 @@ var IconChart_default = SvgIconChart;
8435
8158
  Switch,
8436
8159
  Table,
8437
8160
  TableDesktop,
8438
- TableDesktopRowActions,
8439
- TableDesktopRowCell,
8440
- TableDesktopSmartSelect,
8441
8161
  TableEmptyResult,
8442
8162
  TableHeader,
8443
8163
  TableLoading,