@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.
@@ -8,9 +8,9 @@ import {
8
8
  __toESM
9
9
  } from "../chunk-5WRI5ZAA.js";
10
10
 
11
- // node_modules/lodash/isObject.js
11
+ // ../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/isObject.js
12
12
  var require_isObject = __commonJS({
13
- "node_modules/lodash/isObject.js"(exports, module) {
13
+ "../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/isObject.js"(exports, module) {
14
14
  function isObject(value) {
15
15
  var type = typeof value;
16
16
  return value != null && (type == "object" || type == "function");
@@ -19,17 +19,17 @@ var require_isObject = __commonJS({
19
19
  }
20
20
  });
21
21
 
22
- // node_modules/lodash/_freeGlobal.js
22
+ // ../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_freeGlobal.js
23
23
  var require_freeGlobal = __commonJS({
24
- "node_modules/lodash/_freeGlobal.js"(exports, module) {
24
+ "../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_freeGlobal.js"(exports, module) {
25
25
  var freeGlobal = typeof global == "object" && global && global.Object === Object && global;
26
26
  module.exports = freeGlobal;
27
27
  }
28
28
  });
29
29
 
30
- // node_modules/lodash/_root.js
30
+ // ../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_root.js
31
31
  var require_root = __commonJS({
32
- "node_modules/lodash/_root.js"(exports, module) {
32
+ "../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_root.js"(exports, module) {
33
33
  var freeGlobal = require_freeGlobal();
34
34
  var freeSelf = typeof self == "object" && self && self.Object === Object && self;
35
35
  var root = freeGlobal || freeSelf || Function("return this")();
@@ -37,9 +37,9 @@ var require_root = __commonJS({
37
37
  }
38
38
  });
39
39
 
40
- // node_modules/lodash/now.js
40
+ // ../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/now.js
41
41
  var require_now = __commonJS({
42
- "node_modules/lodash/now.js"(exports, module) {
42
+ "../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/now.js"(exports, module) {
43
43
  var root = require_root();
44
44
  var now = function() {
45
45
  return root.Date.now();
@@ -48,9 +48,9 @@ var require_now = __commonJS({
48
48
  }
49
49
  });
50
50
 
51
- // node_modules/lodash/_trimmedEndIndex.js
51
+ // ../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_trimmedEndIndex.js
52
52
  var require_trimmedEndIndex = __commonJS({
53
- "node_modules/lodash/_trimmedEndIndex.js"(exports, module) {
53
+ "../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_trimmedEndIndex.js"(exports, module) {
54
54
  var reWhitespace = /\s/;
55
55
  function trimmedEndIndex(string) {
56
56
  var index = string.length;
@@ -62,9 +62,9 @@ var require_trimmedEndIndex = __commonJS({
62
62
  }
63
63
  });
64
64
 
65
- // node_modules/lodash/_baseTrim.js
65
+ // ../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_baseTrim.js
66
66
  var require_baseTrim = __commonJS({
67
- "node_modules/lodash/_baseTrim.js"(exports, module) {
67
+ "../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_baseTrim.js"(exports, module) {
68
68
  var trimmedEndIndex = require_trimmedEndIndex();
69
69
  var reTrimStart = /^\s+/;
70
70
  function baseTrim(string) {
@@ -74,18 +74,18 @@ var require_baseTrim = __commonJS({
74
74
  }
75
75
  });
76
76
 
77
- // node_modules/lodash/_Symbol.js
77
+ // ../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_Symbol.js
78
78
  var require_Symbol = __commonJS({
79
- "node_modules/lodash/_Symbol.js"(exports, module) {
79
+ "../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_Symbol.js"(exports, module) {
80
80
  var root = require_root();
81
81
  var Symbol = root.Symbol;
82
82
  module.exports = Symbol;
83
83
  }
84
84
  });
85
85
 
86
- // node_modules/lodash/_getRawTag.js
86
+ // ../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_getRawTag.js
87
87
  var require_getRawTag = __commonJS({
88
- "node_modules/lodash/_getRawTag.js"(exports, module) {
88
+ "../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_getRawTag.js"(exports, module) {
89
89
  var Symbol = require_Symbol();
90
90
  var objectProto = Object.prototype;
91
91
  var hasOwnProperty = objectProto.hasOwnProperty;
@@ -112,9 +112,9 @@ var require_getRawTag = __commonJS({
112
112
  }
113
113
  });
114
114
 
115
- // node_modules/lodash/_objectToString.js
115
+ // ../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_objectToString.js
116
116
  var require_objectToString = __commonJS({
117
- "node_modules/lodash/_objectToString.js"(exports, module) {
117
+ "../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_objectToString.js"(exports, module) {
118
118
  var objectProto = Object.prototype;
119
119
  var nativeObjectToString = objectProto.toString;
120
120
  function objectToString(value) {
@@ -124,9 +124,9 @@ var require_objectToString = __commonJS({
124
124
  }
125
125
  });
126
126
 
127
- // node_modules/lodash/_baseGetTag.js
127
+ // ../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_baseGetTag.js
128
128
  var require_baseGetTag = __commonJS({
129
- "node_modules/lodash/_baseGetTag.js"(exports, module) {
129
+ "../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_baseGetTag.js"(exports, module) {
130
130
  var Symbol = require_Symbol();
131
131
  var getRawTag = require_getRawTag();
132
132
  var objectToString = require_objectToString();
@@ -143,9 +143,9 @@ var require_baseGetTag = __commonJS({
143
143
  }
144
144
  });
145
145
 
146
- // node_modules/lodash/isObjectLike.js
146
+ // ../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/isObjectLike.js
147
147
  var require_isObjectLike = __commonJS({
148
- "node_modules/lodash/isObjectLike.js"(exports, module) {
148
+ "../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/isObjectLike.js"(exports, module) {
149
149
  function isObjectLike(value) {
150
150
  return value != null && typeof value == "object";
151
151
  }
@@ -153,9 +153,9 @@ var require_isObjectLike = __commonJS({
153
153
  }
154
154
  });
155
155
 
156
- // node_modules/lodash/isSymbol.js
156
+ // ../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/isSymbol.js
157
157
  var require_isSymbol = __commonJS({
158
- "node_modules/lodash/isSymbol.js"(exports, module) {
158
+ "../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/isSymbol.js"(exports, module) {
159
159
  var baseGetTag = require_baseGetTag();
160
160
  var isObjectLike = require_isObjectLike();
161
161
  var symbolTag = "[object Symbol]";
@@ -166,9 +166,9 @@ var require_isSymbol = __commonJS({
166
166
  }
167
167
  });
168
168
 
169
- // node_modules/lodash/toNumber.js
169
+ // ../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/toNumber.js
170
170
  var require_toNumber = __commonJS({
171
- "node_modules/lodash/toNumber.js"(exports, module) {
171
+ "../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/toNumber.js"(exports, module) {
172
172
  var baseTrim = require_baseTrim();
173
173
  var isObject = require_isObject();
174
174
  var isSymbol = require_isSymbol();
@@ -199,9 +199,9 @@ var require_toNumber = __commonJS({
199
199
  }
200
200
  });
201
201
 
202
- // node_modules/lodash/debounce.js
202
+ // ../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/debounce.js
203
203
  var require_debounce = __commonJS({
204
- "node_modules/lodash/debounce.js"(exports, module) {
204
+ "../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/debounce.js"(exports, module) {
205
205
  var isObject = require_isObject();
206
206
  var now = require_now();
207
207
  var toNumber = require_toNumber();
@@ -5746,8 +5746,6 @@ var useStyles37 = makeStyles37()((theme) => ({
5746
5746
  }
5747
5747
  },
5748
5748
  wrapper: {
5749
- overflow: "hidden",
5750
- maxHeight: 728,
5751
5749
  height: "100%",
5752
5750
  backgroundColor: colors.neutral100
5753
5751
  },
@@ -6218,60 +6216,11 @@ var SearchAndFilterHeaderForTable = (props) => {
6218
6216
  };
6219
6217
  var SearchAndFilterHeaderForTable_default = React4.memo(SearchAndFilterHeaderForTable);
6220
6218
 
6221
- // src/components/SearchFieldDebounced/SearchFieldDebounced.tsx
6222
- import { useState as useState13, useRef as useRef4, useEffect as useEffect8 } from "react";
6223
- import { TextField as TextField7, InputAdornment as InputAdornment3, Box as Box26 } from "@mui/material";
6224
- import Search2 from "@mui/icons-material/Search";
6225
- import { jsx as jsx103 } from "react/jsx-runtime";
6226
- var SearchFieldDebounced = ({
6227
- onSearch,
6228
- initialValue = "",
6229
- debounceDelay = 500
6230
- }) => {
6231
- const [value, setValue] = useState13(initialValue);
6232
- const debounceRef = useRef4(null);
6233
- const handleChange = (e) => {
6234
- setValue(e.target.value);
6235
- if (debounceRef.current) {
6236
- clearTimeout(debounceRef.current);
6237
- }
6238
- ;
6239
- debounceRef.current = window.setTimeout(() => {
6240
- onSearch(e.target.value);
6241
- }, debounceDelay);
6242
- };
6243
- useEffect8(() => {
6244
- return () => {
6245
- if (debounceRef.current) clearTimeout(debounceRef.current);
6246
- };
6247
- }, []);
6248
- return /* @__PURE__ */ jsx103(Box26, { width: 285, children: /* @__PURE__ */ jsx103(
6249
- TextField7,
6250
- {
6251
- fullWidth: true,
6252
- variant: "outlined",
6253
- placeholder: "Search",
6254
- value,
6255
- onChange: handleChange,
6256
- slotProps: {
6257
- input: {
6258
- sx: {
6259
- maxHeight: 5,
6260
- px: 2,
6261
- py: 2.5
6262
- },
6263
- startAdornment: /* @__PURE__ */ jsx103(InputAdornment3, { position: "start", children: /* @__PURE__ */ jsx103(Search2, { fontSize: "small" }) })
6264
- }
6265
- }
6266
- }
6267
- ) });
6268
- };
6269
-
6270
6219
  // src/components/SectionName/SectionName.tsx
6271
6220
  import { History as History2, Info as InfoIcon } from "@mui/icons-material";
6272
- import { Box as Box27, Divider as Divider8, IconButton as IconButton3, Tooltip as Tooltip5, Typography as Typography23 } from "@mui/material";
6221
+ import { Box as Box26, Divider as Divider8, IconButton as IconButton3, Tooltip as Tooltip5, Typography as Typography23 } from "@mui/material";
6273
6222
  import { makeStyles as makeStyles42 } from "tss-react/mui";
6274
- import { jsx as jsx104, jsxs as jsxs70 } from "react/jsx-runtime";
6223
+ import { jsx as jsx103, jsxs as jsxs70 } from "react/jsx-runtime";
6275
6224
  var useStyles42 = makeStyles42()((theme) => ({
6276
6225
  container: {
6277
6226
  display: "flex",
@@ -6314,9 +6263,9 @@ var SectionName = ({
6314
6263
  openHistoryLog
6315
6264
  }) => {
6316
6265
  const { classes } = useStyles42();
6317
- return /* @__PURE__ */ jsxs70(Box27, { className: classes.container, children: [
6318
- /* @__PURE__ */ jsxs70(Box27, { className: classes.titleContainer, children: [
6319
- /* @__PURE__ */ jsx104(
6266
+ return /* @__PURE__ */ jsxs70(Box26, { className: classes.container, children: [
6267
+ /* @__PURE__ */ jsxs70(Box26, { className: classes.titleContainer, children: [
6268
+ /* @__PURE__ */ jsx103(
6320
6269
  Typography23,
6321
6270
  {
6322
6271
  variant: "h5",
@@ -6326,7 +6275,7 @@ var SectionName = ({
6326
6275
  children: name
6327
6276
  }
6328
6277
  ),
6329
- tooltipDescription ? /* @__PURE__ */ jsx104(Tooltip5, { title: tooltipDescription, placement: "right", children: /* @__PURE__ */ jsx104(
6278
+ tooltipDescription ? /* @__PURE__ */ jsx103(Tooltip5, { title: tooltipDescription, placement: "right", children: /* @__PURE__ */ jsx103(
6330
6279
  InfoIcon,
6331
6280
  {
6332
6281
  fontSize: "small",
@@ -6335,8 +6284,8 @@ var SectionName = ({
6335
6284
  }
6336
6285
  ) }) : null
6337
6286
  ] }),
6338
- /* @__PURE__ */ jsxs70(Box27, { className: classes.actionButtons, children: [
6339
- buttonText ? /* @__PURE__ */ jsx104(
6287
+ /* @__PURE__ */ jsxs70(Box26, { className: classes.actionButtons, children: [
6288
+ buttonText ? /* @__PURE__ */ jsx103(
6340
6289
  ExtendedButton_default,
6341
6290
  {
6342
6291
  type: buttonType,
@@ -6349,15 +6298,15 @@ var SectionName = ({
6349
6298
  variant: "text"
6350
6299
  }
6351
6300
  ) : null,
6352
- openHistoryLog && buttonText && /* @__PURE__ */ jsx104(Divider8, { orientation: "vertical", sx: { height: "24px" } }),
6353
- openHistoryLog && /* @__PURE__ */ jsx104(IconButton3, { size: "small", onClick: () => openHistoryLog(), children: /* @__PURE__ */ jsx104(History2, {}) })
6301
+ openHistoryLog && buttonText && /* @__PURE__ */ jsx103(Divider8, { orientation: "vertical", sx: { height: "24px" } }),
6302
+ openHistoryLog && /* @__PURE__ */ jsx103(IconButton3, { size: "small", onClick: () => openHistoryLog(), children: /* @__PURE__ */ jsx103(History2, {}) })
6354
6303
  ] })
6355
6304
  ] });
6356
6305
  };
6357
6306
  var SectionName_default = SectionName;
6358
6307
 
6359
6308
  // src/components/SmartSelect/SmartSelect.tsx
6360
- import { forwardRef as forwardRef2, useState as useState14, useEffect as useEffect9 } from "react";
6309
+ import { forwardRef as forwardRef2, useState as useState13, useEffect as useEffect8 } from "react";
6361
6310
  import {
6362
6311
  CircularProgress as CircularProgress4,
6363
6312
  FormControl as FormControl4,
@@ -6367,7 +6316,7 @@ import {
6367
6316
  Select as Select3
6368
6317
  } from "@mui/material";
6369
6318
  import { makeStyles as makeStyles43 } from "tss-react/mui";
6370
- import { jsx as jsx105, jsxs as jsxs71 } from "react/jsx-runtime";
6319
+ import { jsx as jsx104, jsxs as jsxs71 } from "react/jsx-runtime";
6371
6320
  var useStyles43 = makeStyles43()(() => ({
6372
6321
  container: {
6373
6322
  display: "flex",
@@ -6393,9 +6342,9 @@ var SmartSelect = forwardRef2(
6393
6342
  menuProps
6394
6343
  }, ref) => {
6395
6344
  const { classes } = useStyles43();
6396
- const [open, setOpen] = useState14(false);
6397
- const [localOptions, setLocalOptions] = useState14(options || []);
6398
- useEffect9(() => {
6345
+ const [open, setOpen] = useState13(false);
6346
+ const [localOptions, setLocalOptions] = useState13(options || []);
6347
+ useEffect8(() => {
6399
6348
  if (options) {
6400
6349
  setLocalOptions(options);
6401
6350
  }
@@ -6444,7 +6393,7 @@ var SmartSelect = forwardRef2(
6444
6393
  "data-testid": dataTestId,
6445
6394
  disabled,
6446
6395
  children: [
6447
- inputLabel && /* @__PURE__ */ jsx105(
6396
+ inputLabel && /* @__PURE__ */ jsx104(
6448
6397
  InputLabel4,
6449
6398
  {
6450
6399
  id: "smart-select-label",
@@ -6458,7 +6407,7 @@ var SmartSelect = forwardRef2(
6458
6407
  ref,
6459
6408
  disabled,
6460
6409
  labelId: "smart-select-label",
6461
- value: value ?? "",
6410
+ value,
6462
6411
  onChange: handleChange,
6463
6412
  onOpen: handleOpen,
6464
6413
  error,
@@ -6469,17 +6418,17 @@ var SmartSelect = forwardRef2(
6469
6418
  MenuProps: menuProps,
6470
6419
  label: inputLabel,
6471
6420
  children: [
6472
- isFetching && /* @__PURE__ */ jsx105(
6421
+ isFetching && /* @__PURE__ */ jsx104(
6473
6422
  MenuItem3,
6474
6423
  {
6475
6424
  disabled: true,
6476
6425
  "data-testid": `${dataTestId}-loading`,
6477
6426
  id: `${dataTestId}-loading`,
6478
- children: /* @__PURE__ */ jsx105(CircularProgress4, { size: 24 })
6427
+ children: /* @__PURE__ */ jsx104(CircularProgress4, { size: 24 })
6479
6428
  }
6480
6429
  ),
6481
- (defaultOption === null || !defaultOptionLabelIsValid || !defaultOptionValueIsValid) && !isFetching && options?.length === 0 && /* @__PURE__ */ jsx105(MenuItem3, { disabled: true, "data-testid": `${dataTestId}-empty-message`, children: emptyMessage }),
6482
- localOptions.length === 0 && !isFetching && options?.length !== 0 && defaultOptionLabelIsValid && defaultOptionValueIsValid && /* @__PURE__ */ jsx105(
6430
+ (defaultOption === null || !defaultOptionLabelIsValid || !defaultOptionValueIsValid) && !isFetching && options?.length === 0 && /* @__PURE__ */ jsx104(MenuItem3, { disabled: true, "data-testid": `${dataTestId}-empty-message`, children: emptyMessage }),
6431
+ localOptions.length === 0 && !isFetching && options?.length !== 0 && defaultOptionLabelIsValid && defaultOptionValueIsValid && /* @__PURE__ */ jsx104(
6483
6432
  MenuItem3,
6484
6433
  {
6485
6434
  value: defaultOption?.value,
@@ -6487,7 +6436,7 @@ var SmartSelect = forwardRef2(
6487
6436
  children: defaultOption?.label
6488
6437
  }
6489
6438
  ),
6490
- !isFetching && combinedOptions.length > 0 && combinedOptions.map((option) => /* @__PURE__ */ jsx105(
6439
+ !isFetching && combinedOptions.length > 0 && combinedOptions.map((option) => /* @__PURE__ */ jsx104(
6491
6440
  MenuItem3,
6492
6441
  {
6493
6442
  value: option?.value,
@@ -6500,7 +6449,7 @@ var SmartSelect = forwardRef2(
6500
6449
  ]
6501
6450
  }
6502
6451
  ),
6503
- helperText && /* @__PURE__ */ jsx105(FormHelperText3, { "data-testid": `${dataTestId}-helper-text`, children: helperText })
6452
+ helperText && /* @__PURE__ */ jsx104(FormHelperText3, { "data-testid": `${dataTestId}-helper-text`, children: helperText })
6504
6453
  ]
6505
6454
  }
6506
6455
  );
@@ -6513,7 +6462,7 @@ import { memo as memo18 } from "react";
6513
6462
  import { Typography as Typography24 } from "@mui/material";
6514
6463
  import red2 from "@mui/material/colors/red";
6515
6464
  import { makeStyles as makeStyles44 } from "tss-react/mui";
6516
- import { jsx as jsx106 } from "react/jsx-runtime";
6465
+ import { jsx as jsx105 } from "react/jsx-runtime";
6517
6466
  var useStyles44 = makeStyles44()((theme) => ({
6518
6467
  red: {
6519
6468
  backgroundColor: red2["50"],
@@ -6528,7 +6477,7 @@ var useStyles44 = makeStyles44()((theme) => ({
6528
6477
  }));
6529
6478
  var SquareLabel = ({ color, copy }) => {
6530
6479
  const { classes } = useStyles44();
6531
- return /* @__PURE__ */ jsx106(Typography24, { className: classes[color], children: copy });
6480
+ return /* @__PURE__ */ jsx105(Typography24, { className: classes[color], children: copy });
6532
6481
  };
6533
6482
  var SquareLabel_default = memo18(SquareLabel);
6534
6483
 
@@ -6536,7 +6485,7 @@ var SquareLabel_default = memo18(SquareLabel);
6536
6485
  import { memo as memo19 } from "react";
6537
6486
  import { Grid2, Switch } from "@mui/material";
6538
6487
  import { withStyles as withStyles6 } from "tss-react/mui";
6539
- import { jsx as jsx107, jsxs as jsxs72 } from "react/jsx-runtime";
6488
+ import { jsx as jsx106, jsxs as jsxs72 } from "react/jsx-runtime";
6540
6489
  var LSwitch = ({
6541
6490
  checked,
6542
6491
  labelOn,
@@ -6544,7 +6493,7 @@ var LSwitch = ({
6544
6493
  handleChange,
6545
6494
  classes,
6546
6495
  disabled
6547
- }) => /* @__PURE__ */ jsx107("div", { className: classes.c_switch, children: /* @__PURE__ */ jsxs72(
6496
+ }) => /* @__PURE__ */ jsx106("div", { className: classes.c_switch, children: /* @__PURE__ */ jsxs72(
6548
6497
  Grid2,
6549
6498
  {
6550
6499
  component: "label",
@@ -6554,8 +6503,8 @@ var LSwitch = ({
6554
6503
  alignItems: "center"
6555
6504
  },
6556
6505
  children: [
6557
- labelOff && /* @__PURE__ */ jsx107(Grid2, { children: labelOff }),
6558
- /* @__PURE__ */ jsx107(Grid2, { children: /* @__PURE__ */ jsx107(
6506
+ labelOff && /* @__PURE__ */ jsx106(Grid2, { children: labelOff }),
6507
+ /* @__PURE__ */ jsx106(Grid2, { children: /* @__PURE__ */ jsx106(
6559
6508
  Switch,
6560
6509
  {
6561
6510
  checked,
@@ -6564,7 +6513,7 @@ var LSwitch = ({
6564
6513
  disabled
6565
6514
  }
6566
6515
  ) }),
6567
- labelOn && /* @__PURE__ */ jsx107(Grid2, { children: labelOn })
6516
+ labelOn && /* @__PURE__ */ jsx106(Grid2, { children: labelOn })
6568
6517
  ]
6569
6518
  }
6570
6519
  ) });
@@ -6589,51 +6538,256 @@ var LabelledSwitch = withStyles6(LSwitch, (theme) => ({
6589
6538
  var Switch_default = memo19(LabelledSwitch);
6590
6539
 
6591
6540
  // src/components/SmartTableHeaderFilterMenu/SmartTableHeaderFilterMenu.tsx
6592
- import { useMemo as useMemo3, useState as useState16, useEffect as useEffect11, memo as memo21 } from "react";
6541
+ import { useMemo as useMemo2, useState as useState14, useEffect as useEffect9, memo as memo20 } from "react";
6593
6542
  import CheckIcon from "@mui/icons-material/Check";
6594
6543
  import {
6595
- Box as Box30,
6596
- Checkbox as Checkbox5,
6544
+ Box as Box27,
6545
+ Checkbox as Checkbox4,
6597
6546
  Divider as Divider9,
6598
6547
  FormControlLabel as FormControlLabel3,
6599
6548
  Menu as Menu4,
6600
- Skeleton as Skeleton3,
6549
+ Skeleton as Skeleton2,
6601
6550
  Tooltip as Tooltip6
6602
6551
  } from "@mui/material";
6603
6552
  import classNames3 from "classnames";
6604
- import { makeStyles as makeStyles48 } from "tss-react/mui";
6605
-
6606
- // src/components/TableDesktop/TableDesktop.tsx
6607
- import {
6608
- useCallback as useCallback2,
6609
- useMemo as useMemo2,
6610
- useState as useState15,
6611
- useEffect as useEffect10
6612
- } from "react";
6613
- import {
6614
- Paper as Paper10,
6615
- Table,
6616
- TableBody,
6617
- TableContainer,
6618
- Skeleton as Skeleton2,
6619
- Box as Box29
6620
- } from "@mui/material";
6621
- import { makeStyles as makeStyles47 } from "tss-react/mui";
6553
+ import { makeStyles as makeStyles45 } from "tss-react/mui";
6554
+ import { Fragment as Fragment11, jsx as jsx107, jsxs as jsxs73 } from "react/jsx-runtime";
6555
+ var useStyles45 = makeStyles45()((theme) => ({
6556
+ filterMenu: {
6557
+ display: "flex",
6558
+ flexDirection: "column"
6559
+ },
6560
+ filterOptions: {
6561
+ maxHeight: theme.spacing(62),
6562
+ overflowY: "auto",
6563
+ "&::-webkit-scrollbar": {
6564
+ width: "8px",
6565
+ height: "8px"
6566
+ },
6567
+ "&::-webkit-scrollbar-track": {
6568
+ backgroundColor: theme.palette.mode === "dark" ? theme.palette.grey[800] : theme.palette.grey[100]
6569
+ },
6570
+ "&::-webkit-scrollbar-thumb": {
6571
+ backgroundColor: theme.palette.mode === "dark" ? theme.palette.grey[900] : theme.palette.grey[400],
6572
+ borderRadius: "10px"
6573
+ },
6574
+ "&::-webkit-scrollbar-thumb:hover": {
6575
+ backgroundColor: theme.palette.mode === "dark" ? theme.palette.common.black : theme.palette.grey[500]
6576
+ }
6577
+ },
6578
+ filter: {
6579
+ display: "flex",
6580
+ alignItems: "center",
6581
+ justifyContent: "space-between",
6582
+ padding: theme.spacing(0, 3)
6583
+ },
6584
+ applyFilterButtonsContainer: {
6585
+ display: "flex",
6586
+ padding: theme.spacing(0, 1)
6587
+ },
6588
+ saveAsDefaultButton: {
6589
+ color: theme.palette.primary.main
6590
+ },
6591
+ skeleton: {
6592
+ height: theme.spacing(3),
6593
+ margin: theme.spacing(1)
6594
+ }
6595
+ }));
6596
+ var resolveFilterOption = (filterOption) => {
6597
+ if (typeof filterOption === "object") {
6598
+ return filterOption?.label || filterOption?.name || "";
6599
+ }
6600
+ return filterOption;
6601
+ };
6602
+ var findFilterIndex = (filters, filterOption) => filters.findIndex((item) => {
6603
+ if (typeof item === "string" && typeof filterOption === "string") {
6604
+ return item === filterOption;
6605
+ }
6606
+ if (typeof item === "object" && typeof filterOption === "object") {
6607
+ return item.id === filterOption.id;
6608
+ }
6609
+ return false;
6610
+ });
6611
+ var SmartTableHeaderFilterMenu = ({
6612
+ headCell,
6613
+ numActiveFilters,
6614
+ headerFilters,
6615
+ shouldShowCheckOnFilter,
6616
+ onApplyFilters
6617
+ }) => {
6618
+ const { classes } = useStyles45();
6619
+ const [anchorEl, setAnchorEl] = useState14(null);
6620
+ const [selectedFilters, setSelectedFilters] = useState14(
6621
+ headerFilters[headCell.id] ?? []
6622
+ );
6623
+ const filterOptions = headCell.filterOptionsQuery?.data ?? [];
6624
+ const numFilterOptions = filterOptions.length ?? 0;
6625
+ const numCurrentSelectedFilters = selectedFilters.length;
6626
+ const handleFilterMenuOpen = (event) => {
6627
+ if (!numFilterOptions) {
6628
+ headCell.filterOptionsQuery?.refetch();
6629
+ }
6630
+ setAnchorEl(event.currentTarget);
6631
+ };
6632
+ const handleFilterMenuClose = () => {
6633
+ setSelectedFilters(headerFilters[headCell.id]);
6634
+ setAnchorEl(null);
6635
+ };
6636
+ const handleFilterOptionClick = (option) => {
6637
+ const selectedIndex = findFilterIndex(selectedFilters, option);
6638
+ let newSelected;
6639
+ if (selectedIndex === -1) {
6640
+ if (typeof option === "string") {
6641
+ newSelected = [...selectedFilters, option];
6642
+ } else {
6643
+ newSelected = [...selectedFilters, option];
6644
+ }
6645
+ } else {
6646
+ newSelected = selectedFilters.filter(
6647
+ (_, index) => index !== selectedIndex
6648
+ );
6649
+ }
6650
+ setSelectedFilters(newSelected);
6651
+ };
6652
+ const handleApplyFilters = (shouldSave) => {
6653
+ const updatedFilters = {
6654
+ ...headerFilters,
6655
+ [headCell.id]: [...selectedFilters]
6656
+ };
6657
+ onApplyFilters?.(updatedFilters, shouldSave);
6658
+ setAnchorEl(null);
6659
+ };
6660
+ useEffect9(() => {
6661
+ setSelectedFilters(headerFilters[headCell.id] ?? []);
6662
+ }, [headerFilters, headCell.id]);
6663
+ const isOptionChecked = useMemo2(() => (resolvedOption) => !!selectedFilters?.some(
6664
+ (value) => resolveFilterOption(value) === resolvedOption
6665
+ ), [selectedFilters]);
6666
+ const loadingSkeletons = /* @__PURE__ */ jsxs73(Box27, { "data-testid": "loading-skeletons", width: 272, children: [
6667
+ /* @__PURE__ */ jsx107(Skeleton2, { variant: "rounded", className: classes.skeleton }),
6668
+ /* @__PURE__ */ jsx107(Divider9, {}),
6669
+ /* @__PURE__ */ jsx107(Skeleton2, { variant: "rounded", className: classes.skeleton }),
6670
+ /* @__PURE__ */ jsx107(Skeleton2, { variant: "rounded", className: classes.skeleton }),
6671
+ /* @__PURE__ */ jsx107(Skeleton2, { variant: "rounded", className: classes.skeleton }),
6672
+ /* @__PURE__ */ jsx107(Skeleton2, { variant: "rounded", className: classes.skeleton }),
6673
+ /* @__PURE__ */ jsx107(Divider9, {}),
6674
+ /* @__PURE__ */ jsx107(Skeleton2, { variant: "rounded", className: classes.skeleton })
6675
+ ] });
6676
+ return /* @__PURE__ */ jsxs73(Fragment11, { children: [
6677
+ /* @__PURE__ */ jsx107(
6678
+ ActiveFiltersIconButton_default,
6679
+ {
6680
+ numActiveFilters,
6681
+ handleClick: handleFilterMenuOpen,
6682
+ className: classNames3("filter-menu-trigger", {
6683
+ "has-active-filters": !!numActiveFilters || !!anchorEl
6684
+ })
6685
+ }
6686
+ ),
6687
+ /* @__PURE__ */ jsx107(
6688
+ Menu4,
6689
+ {
6690
+ open: !!anchorEl,
6691
+ onClose: handleFilterMenuClose,
6692
+ anchorEl,
6693
+ "data-testid": "filter-menu",
6694
+ anchorOrigin: { vertical: "bottom", horizontal: "right" },
6695
+ transformOrigin: { vertical: "top", horizontal: "right" },
6696
+ children: headCell.filterOptionsQuery?.isFetching ? loadingSkeletons : /* @__PURE__ */ jsxs73(Box27, { className: classes.filterMenu, children: [
6697
+ /* @__PURE__ */ jsx107(Box27, { px: 3, mb: 0.5, children: /* @__PURE__ */ jsx107(
6698
+ FormControlLabel3,
6699
+ {
6700
+ label: "Select All",
6701
+ control: /* @__PURE__ */ jsx107(
6702
+ Checkbox4,
6703
+ {
6704
+ disableRipple: true,
6705
+ checked: numCurrentSelectedFilters === numFilterOptions,
6706
+ indeterminate: numCurrentSelectedFilters > 0 && numCurrentSelectedFilters < numFilterOptions,
6707
+ onChange: ({ target: { checked } }) => {
6708
+ if (checked) {
6709
+ setSelectedFilters([...filterOptions]);
6710
+ } else {
6711
+ setSelectedFilters([]);
6712
+ }
6713
+ }
6714
+ }
6715
+ )
6716
+ }
6717
+ ) }),
6718
+ /* @__PURE__ */ jsx107(Divider9, { sx: { mb: 0.5 } }),
6719
+ /* @__PURE__ */ jsx107(Box27, { className: classes.filterOptions, children: filterOptions.map(
6720
+ (option) => {
6721
+ const resolvedOption = resolveFilterOption(option);
6722
+ return /* @__PURE__ */ jsxs73(
6723
+ Box27,
6724
+ {
6725
+ className: classes.filter,
6726
+ children: [
6727
+ /* @__PURE__ */ jsx107(
6728
+ FormControlLabel3,
6729
+ {
6730
+ label: resolvedOption,
6731
+ control: /* @__PURE__ */ jsx107(
6732
+ Checkbox4,
6733
+ {
6734
+ disableRipple: true,
6735
+ onChange: () => handleFilterOptionClick(option),
6736
+ checked: isOptionChecked(resolvedOption)
6737
+ }
6738
+ )
6739
+ },
6740
+ resolvedOption
6741
+ ),
6742
+ shouldShowCheckOnFilter?.(headCell.id, option) ? /* @__PURE__ */ jsx107(Tooltip6, { title: "This filter is saved as default", children: /* @__PURE__ */ jsx107(CheckIcon, { fontSize: "small", color: "action" }) }) : null
6743
+ ]
6744
+ },
6745
+ resolvedOption
6746
+ );
6747
+ }
6748
+ ) }),
6749
+ /* @__PURE__ */ jsx107(Divider9, { sx: { mb: 0.5 } }),
6750
+ /* @__PURE__ */ jsxs73(Box27, { className: classes.applyFilterButtonsContainer, children: [
6751
+ /* @__PURE__ */ jsx107(
6752
+ ExtendedButton_default,
6753
+ {
6754
+ copy: "Save as Default",
6755
+ buttonType: "button",
6756
+ variant: "text",
6757
+ tooltip: "Persists those filters for future visits",
6758
+ className: classes.saveAsDefaultButton,
6759
+ onClick: () => handleApplyFilters(true)
6760
+ }
6761
+ ),
6762
+ /* @__PURE__ */ jsx107(
6763
+ ExtendedButton_default,
6764
+ {
6765
+ copy: "Apply",
6766
+ color: "primary",
6767
+ buttonType: "submit",
6768
+ onClick: () => handleApplyFilters(false)
6769
+ }
6770
+ )
6771
+ ] })
6772
+ ] })
6773
+ }
6774
+ )
6775
+ ] });
6776
+ };
6777
+ var SmartTableHeaderFilterMenu_default = memo20(SmartTableHeaderFilterMenu);
6622
6778
 
6623
6779
  // src/components/SmartTableHeader/SmartTableHeader.tsx
6624
- import { memo as memo20 } from "react";
6780
+ import { memo as memo21 } from "react";
6625
6781
  import {
6626
- Box as Box28,
6627
- Checkbox as Checkbox4,
6782
+ Checkbox as Checkbox5,
6628
6783
  TableCell,
6629
6784
  TableHead,
6630
6785
  TableRow,
6631
- TableSortLabel,
6632
- Typography as Typography25
6786
+ TableSortLabel
6633
6787
  } from "@mui/material";
6634
- import { makeStyles as makeStyles45 } from "tss-react/mui";
6635
- import { jsx as jsx108, jsxs as jsxs73 } from "react/jsx-runtime";
6636
- var useStyles45 = makeStyles45()((theme) => ({
6788
+ import { makeStyles as makeStyles46 } from "tss-react/mui";
6789
+ import { jsx as jsx108, jsxs as jsxs74 } from "react/jsx-runtime";
6790
+ var useStyles46 = makeStyles46()((theme) => ({
6637
6791
  root: {
6638
6792
  backgroundColor: colors.neutral100,
6639
6793
  height: theme.spacing(6),
@@ -6700,599 +6854,85 @@ var SmartTableHeader = ({
6700
6854
  onApplyFilters,
6701
6855
  shouldShowCheckOnFilter
6702
6856
  }) => {
6703
- const { classes } = useStyles45();
6857
+ const { classes } = useStyles46();
6704
6858
  const createSortHandler = (property) => (event) => {
6705
6859
  onRequestSort(event, property);
6706
6860
  };
6707
6861
  const isSortActive = (headCellId) => orderBy === headCellId;
6708
- return /* @__PURE__ */ jsx108(TableHead, { className: classes.root, children: /* @__PURE__ */ jsxs73(TableRow, { children: [
6862
+ return /* @__PURE__ */ jsx108(TableHead, { className: classes.root, children: /* @__PURE__ */ jsxs74(TableRow, { children: [
6709
6863
  enableCheckboxSelection ? /* @__PURE__ */ jsx108(TableCell, { padding: "checkbox", children: /* @__PURE__ */ jsx108(
6710
- Checkbox4,
6864
+ Checkbox5,
6711
6865
  {
6712
6866
  color: "primary",
6713
- disableRipple: true,
6714
6867
  indeterminate: numSelected > 0 && numSelected < numRows,
6715
6868
  checked: numRows > 0 && numSelected === numRows,
6716
6869
  onChange: onSelectAllClick
6717
6870
  }
6718
6871
  ) }) : null,
6719
- headCells.map((headCell) => /* @__PURE__ */ jsx108(
6872
+ headCells.map((headCell) => /* @__PURE__ */ jsxs74(
6720
6873
  TableCell,
6721
6874
  {
6722
6875
  className: classes.tableHeaderContent,
6723
6876
  align: "left",
6724
- width: headCell.width ?? "auto",
6877
+ sx: { width: headCell.width ?? "auto" },
6725
6878
  sortDirection: orderBy === headCell.id ? order : false,
6726
- children: /* @__PURE__ */ jsxs73(
6727
- Box28,
6728
- {
6729
- display: "flex",
6730
- flexDirection: "row",
6731
- gap: headCell.disableSort ? 1 : 0,
6732
- children: [
6733
- headCell.disableSort ? /* @__PURE__ */ jsx108(Typography25, { variant: "subtitle2", mt: 0.25, fontWeight: 600, children: headCell.label }) : /* @__PURE__ */ jsxs73(
6734
- TableSortLabel,
6735
- {
6736
- "data-testid": "table-sort-label",
6737
- active: isSortActive(headCell.id),
6738
- direction: orderBy === headCell.id ? order : "asc",
6739
- onClick: createSortHandler(headCell.id),
6740
- children: [
6741
- headCell.RenderHeader ?? headCell.label,
6742
- orderBy === headCell.id ? /* @__PURE__ */ jsx108("span", { className: classes.visuallyHidden, children: order === "desc" ? "sorted descending" : "sorted ascending" }) : null
6743
- ]
6744
- }
6745
- ),
6746
- headCell.refetchFilterOptions ? /* @__PURE__ */ jsx108(
6747
- SmartTableHeaderFilterMenu_default,
6748
- {
6749
- headCell,
6750
- headerFilters,
6751
- numActiveFilters: headerFilters[headCell.id]?.length ?? 0,
6752
- onApplyFilters,
6753
- shouldShowCheckOnFilter
6754
- }
6755
- ) : null
6756
- ]
6757
- }
6758
- )
6879
+ children: [
6880
+ /* @__PURE__ */ jsxs74(
6881
+ TableSortLabel,
6882
+ {
6883
+ "data-testid": "table-sort-label",
6884
+ active: isSortActive(headCell.id),
6885
+ direction: orderBy === headCell.id ? order : "asc",
6886
+ onClick: createSortHandler(headCell.id),
6887
+ children: [
6888
+ headCell.renderHeader ?? headCell.label,
6889
+ orderBy === headCell.id ? /* @__PURE__ */ jsx108("span", { className: classes.visuallyHidden, children: order === "desc" ? "sorted descending" : "sorted ascending" }) : null
6890
+ ]
6891
+ }
6892
+ ),
6893
+ headCell.filterOptionsQuery ? /* @__PURE__ */ jsx108(
6894
+ SmartTableHeaderFilterMenu_default,
6895
+ {
6896
+ headCell,
6897
+ headerFilters,
6898
+ numActiveFilters: headerFilters[headCell.id]?.length ?? 0,
6899
+ onApplyFilters,
6900
+ shouldShowCheckOnFilter
6901
+ }
6902
+ ) : null
6903
+ ]
6759
6904
  },
6760
6905
  headCell.id
6761
6906
  ))
6762
6907
  ] }) });
6763
6908
  };
6764
- var SmartTableHeader_default = memo20(SmartTableHeader);
6765
-
6766
- // src/components/TableEmptyResult/TableEmptyResult.tsx
6767
- import { TableCell as TableCell2, TableRow as TableRow2, Typography as Typography26 } from "@mui/material";
6768
- import { makeStyles as makeStyles46 } from "tss-react/mui";
6769
- import { jsx as jsx109, jsxs as jsxs74 } from "react/jsx-runtime";
6770
- var useStyles46 = makeStyles46()(() => ({
6771
- tableCellIcon: { padding: 24, height: "calc(100vh - 320px)" },
6772
- tableCellDefault: { padding: 24 }
6773
- }));
6774
- var TableEmptyResult = ({
6775
- colSpan,
6776
- showClearFilterButton = false,
6777
- handleClickOnClearFiltersButton = () => {
6778
- }
6779
- }) => {
6780
- const { classes } = useStyles46();
6781
- return showClearFilterButton ? /* @__PURE__ */ jsx109(TableRow2, { children: /* @__PURE__ */ jsxs74(
6782
- TableCell2,
6783
- {
6784
- className: classes.tableCellIcon,
6785
- colSpan,
6786
- align: "center",
6787
- children: [
6788
- /* @__PURE__ */ jsx109(EmptyGlassIcon_default, {}),
6789
- /* @__PURE__ */ jsx109(Typography26, { variant: "h6", children: "No results found." }),
6790
- /* @__PURE__ */ jsx109(Typography26, { variant: "subtitle1", children: "Search without applied filters?" }),
6791
- /* @__PURE__ */ jsx109(
6792
- FilledButton_default,
6793
- {
6794
- copy: "Search",
6795
- variant: "contained",
6796
- color: "primary",
6797
- onClick: handleClickOnClearFiltersButton
6798
- }
6799
- )
6800
- ]
6801
- }
6802
- ) }) : /* @__PURE__ */ jsx109(TableRow2, { children: /* @__PURE__ */ jsx109(
6803
- TableCell2,
6804
- {
6805
- className: classes.tableCellDefault,
6806
- colSpan,
6807
- align: "center",
6808
- children: "Nothing to display"
6809
- }
6810
- ) });
6811
- };
6812
- var TableEmptyResult_default = TableEmptyResult;
6813
-
6814
- // src/components/TableDesktop/TableDesktop.tsx
6815
- import { jsx as jsx110, jsxs as jsxs75 } from "react/jsx-runtime";
6816
- var useStyles47 = makeStyles47()((theme) => ({
6817
- root: {
6818
- justifyContent: "space-between",
6819
- display: "flex",
6820
- justifyItems: "stretch"
6821
- },
6822
- paper: {
6823
- width: "100%",
6824
- display: "flex",
6825
- flexDirection: "column",
6826
- justifyContent: "space-between"
6827
- },
6828
- container: {
6829
- maxHeight: "100%",
6830
- "&::-webkit-scrollbar": {
6831
- width: "8px",
6832
- height: "8px"
6833
- },
6834
- "&::-webkit-scrollbar-track": {
6835
- backgroundColor: theme.palette.mode === "dark" ? theme.palette.grey[800] : theme.palette.grey[100]
6836
- },
6837
- "&::-webkit-scrollbar-thumb": {
6838
- backgroundColor: theme.palette.mode === "dark" ? theme.palette.grey[900] : theme.palette.grey[400],
6839
- borderRadius: "10px"
6840
- },
6841
- "&::-webkit-scrollbar-thumb:hover": {
6842
- backgroundColor: theme.palette.mode === "dark" ? theme.palette.common.black : theme.palette.grey[500]
6843
- }
6844
- }
6845
- }));
6846
- var descendingComparator = (a, b, orderBy) => {
6847
- const objA = a[orderBy];
6848
- const objB = b[orderBy];
6849
- const valA = typeof objA === "object" ? objA?.name : objA;
6850
- const valB = typeof objB === "object" ? objB?.name : objB;
6851
- if (!valA && !valB) {
6852
- return 0;
6853
- }
6854
- if (valA && !valB) {
6855
- return -1;
6856
- }
6857
- if (!valA && valB) {
6858
- return 1;
6859
- }
6860
- if (valA > valB) {
6861
- return -1;
6862
- }
6863
- if (valA < valB) {
6864
- return 1;
6865
- }
6866
- return 0;
6867
- };
6868
- var stableSort = (array, cmp) => array.map((el, index) => ({ el, index })).sort((a, b) => {
6869
- const order = cmp(a.el, b.el);
6870
- return order !== 0 ? order : a.index - b.index;
6871
- }).map((el) => el.el);
6872
- var getComparator = (order, orderBy) => order === "desc" ? (a, b) => descendingComparator(a, b, orderBy) : (a, b) => -descendingComparator(a, b, orderBy);
6873
- var resolveOptionType = (option, fieldName) => {
6874
- if (!option || typeof option !== "object") {
6875
- return option;
6876
- }
6877
- return option[fieldName] || "";
6878
- };
6879
- var TableDesktop = ({
6880
- data,
6881
- headCells,
6882
- RenderItem,
6883
- appliedFilters,
6884
- headerFilters,
6885
- children,
6886
- height,
6887
- isLoading,
6888
- rowsPerPage = 50,
6889
- enableCheckboxSelection = false,
6890
- enableRowActions = false,
6891
- disableInternalSort = false,
6892
- updateSort,
6893
- showClearFilterButton,
6894
- handleClickOnClearFiltersButton,
6895
- deleteItem,
6896
- keyField = "id",
6897
- tableLayout = "auto",
6898
- onApplyFilters,
6899
- shouldShowCheckOnFilter
6900
- }) => {
6901
- const [order, setOrder] = useState15(appliedFilters?.sortDir || "desc");
6902
- const [orderBy, setOrderBy] = useState15(
6903
- appliedFilters?.sortField || "delivery_date"
6904
- );
6905
- const [selected, setSelected] = useState15(/* @__PURE__ */ new Set());
6906
- const [page] = useState15(0);
6907
- const { classes } = useStyles47();
6908
- const rowHeight = 56;
6909
- const emptyRows = useMemo2(
6910
- () => rowsPerPage - data.length,
6911
- [rowsPerPage, data]
6912
- );
6913
- const visibleHeadCells = useMemo2(
6914
- () => headCells.filter((headCell) => headCell?.enabled ?? true),
6915
- [headCells]
6916
- );
6917
- const handleSelectAllClick = useCallback2(
6918
- (event) => {
6919
- if (event.target.checked) {
6920
- const allItems = new Set(data.map((n) => n[keyField]));
6921
- setSelected(allItems);
6922
- } else {
6923
- setSelected(/* @__PURE__ */ new Set());
6924
- }
6925
- },
6926
- [data, keyField]
6927
- );
6928
- const handleRequestSort = (event, property) => {
6929
- const isAsc = orderBy === property && order === "asc";
6930
- const orderDir = isAsc ? "desc" : "asc";
6931
- setOrder(orderDir);
6932
- setOrderBy(property);
6933
- if (updateSort) {
6934
- updateSort(property, orderDir);
6935
- }
6936
- };
6937
- const handleRowCheckboxChange = useCallback2(
6938
- (event, keyFieldValue) => {
6939
- event.stopPropagation();
6940
- setSelected((prev) => {
6941
- const newSelected = new Set(prev);
6942
- if (newSelected.has(keyFieldValue)) {
6943
- newSelected.delete(keyFieldValue);
6944
- } else {
6945
- newSelected.add(keyFieldValue);
6946
- }
6947
- return newSelected;
6948
- });
6949
- },
6950
- []
6951
- );
6952
- const renderTableRows = useMemo2(() => {
6953
- const sortedData = disableInternalSort ? data : stableSort(data, getComparator(order, orderBy));
6954
- return sortedData.slice(page * rowsPerPage, page * rowsPerPage + rowsPerPage).map((row, index) => {
6955
- const isItemSelected = selected.has(row[keyField]);
6956
- return /* @__PURE__ */ jsx110(
6957
- RenderItem,
6958
- {
6959
- ...{
6960
- ...row,
6961
- index,
6962
- deleteItem,
6963
- isItemSelected,
6964
- enableCheckboxSelection,
6965
- enableRowActions,
6966
- keyFieldValue: row[keyField],
6967
- handleRowCheckboxChange,
6968
- visibleHeadCells
6969
- }
6970
- },
6971
- row[keyField] ?? index
6972
- );
6973
- });
6974
- }, [
6975
- data,
6976
- order,
6977
- orderBy,
6978
- page,
6979
- rowsPerPage,
6980
- selected,
6981
- enableCheckboxSelection,
6982
- enableRowActions,
6983
- disableInternalSort,
6984
- deleteItem,
6985
- keyField,
6986
- handleRowCheckboxChange,
6987
- visibleHeadCells,
6988
- RenderItem
6989
- ]);
6990
- useEffect10(() => {
6991
- if (!enableCheckboxSelection) {
6992
- setSelected(/* @__PURE__ */ new Set());
6993
- }
6994
- }, [enableCheckboxSelection]);
6995
- return /* @__PURE__ */ jsx110("div", { className: classes.root, style: { height }, children: /* @__PURE__ */ jsxs75(Paper10, { className: classes.paper, children: [
6996
- isLoading ? /* @__PURE__ */ jsx110(Box29, { width: "100%", overflow: "hidden", children: [...Array(Math.floor(rowsPerPage ?? 50))].map((_, index) => /* @__PURE__ */ jsx110(
6997
- Skeleton2,
6998
- {
6999
- animation: "pulse",
7000
- variant: "rounded",
7001
- sx: { margin: 1 },
7002
- height: rowHeight,
7003
- "data-testid": "loading-skeleton"
7004
- },
7005
- index
7006
- )) }) : /* @__PURE__ */ jsx110(TableContainer, { className: classes.container, children: /* @__PURE__ */ jsxs75(
7007
- Table,
7008
- {
7009
- stickyHeader: true,
7010
- "aria-labelledby": "tableTitle",
7011
- "aria-label": "sticky table",
7012
- style: { tableLayout },
7013
- children: [
7014
- /* @__PURE__ */ jsx110(
7015
- SmartTableHeader_default,
7016
- {
7017
- headCells: visibleHeadCells,
7018
- order,
7019
- orderBy,
7020
- numSelected: selected.size,
7021
- numRows: data.length,
7022
- enableCheckboxSelection,
7023
- headerFilters: headerFilters ?? {},
7024
- onRequestSort: handleRequestSort,
7025
- onSelectAllClick: handleSelectAllClick,
7026
- onApplyFilters,
7027
- shouldShowCheckOnFilter
7028
- }
7029
- ),
7030
- /* @__PURE__ */ jsx110(TableBody, { children: rowsPerPage !== emptyRows ? renderTableRows : /* @__PURE__ */ jsx110(
7031
- TableEmptyResult_default,
7032
- {
7033
- colSpan: enableCheckboxSelection ? visibleHeadCells.length + 1 : visibleHeadCells.length,
7034
- showClearFilterButton,
7035
- handleClickOnClearFiltersButton
7036
- }
7037
- ) })
7038
- ]
7039
- }
7040
- ) }),
7041
- children
7042
- ] }) });
7043
- };
7044
- var TableDesktop_default = TableDesktop;
7045
-
7046
- // src/components/SmartTableHeaderFilterMenu/SmartTableHeaderFilterMenu.tsx
7047
- import { Fragment as Fragment11, jsx as jsx111, jsxs as jsxs76 } from "react/jsx-runtime";
7048
- var useStyles48 = makeStyles48()((theme) => ({
7049
- filterMenu: {
7050
- display: "flex",
7051
- flexDirection: "column"
7052
- },
7053
- filterOptions: {
7054
- maxHeight: theme.spacing(62),
7055
- overflowY: "auto",
7056
- "&::-webkit-scrollbar": {
7057
- width: "8px",
7058
- height: "8px"
7059
- },
7060
- "&::-webkit-scrollbar-track": {
7061
- backgroundColor: theme.palette.mode === "dark" ? theme.palette.grey[800] : theme.palette.grey[100]
7062
- },
7063
- "&::-webkit-scrollbar-thumb": {
7064
- backgroundColor: theme.palette.mode === "dark" ? theme.palette.grey[900] : theme.palette.grey[400],
7065
- borderRadius: "10px"
7066
- },
7067
- "&::-webkit-scrollbar-thumb:hover": {
7068
- backgroundColor: theme.palette.mode === "dark" ? theme.palette.common.black : theme.palette.grey[500]
7069
- }
7070
- },
7071
- filter: {
7072
- display: "flex",
7073
- alignItems: "center",
7074
- justifyContent: "space-between",
7075
- padding: theme.spacing(0, 3)
7076
- },
7077
- applyFilterButtonsContainer: {
7078
- display: "flex",
7079
- padding: theme.spacing(0, 1)
7080
- },
7081
- saveAsDefaultButton: {
7082
- color: theme.palette.primary.main
7083
- },
7084
- skeleton: {
7085
- height: theme.spacing(3),
7086
- margin: theme.spacing(1)
7087
- }
7088
- }));
7089
- var findFilterIndex = (filters, filterOption) => filters.findIndex((item) => {
7090
- if (typeof item === "string" && typeof filterOption === "string") {
7091
- return item === filterOption;
7092
- }
7093
- if (typeof item === "object" && typeof filterOption === "object") {
7094
- return item.id === filterOption.id;
7095
- }
7096
- return false;
7097
- });
7098
- var SmartTableHeaderFilterMenu = ({
7099
- headCell,
7100
- numActiveFilters,
7101
- headerFilters,
7102
- shouldShowCheckOnFilter,
7103
- onApplyFilters
7104
- }) => {
7105
- const { classes } = useStyles48();
7106
- const [anchorEl, setAnchorEl] = useState16(null);
7107
- const [filterOptionsData, setFilterOptionsData] = useState16();
7108
- const [selectedFilters, setSelectedFilters] = useState16(
7109
- headerFilters[headCell.id] ?? []
7110
- );
7111
- useEffect11(() => {
7112
- if (headCell.filterOptions) {
7113
- setFilterOptionsData(headCell.filterOptions);
7114
- }
7115
- }, [headCell.filterOptions]);
7116
- const numFilterOptions = useMemo3(() => filterOptionsData?.length ?? 0, [filterOptionsData?.length]);
7117
- const numCurrentSelectedFilters = selectedFilters.length;
7118
- const handleFilterMenuOpen = (event) => {
7119
- if (!numFilterOptions) {
7120
- headCell.refetchFilterOptions?.();
7121
- }
7122
- setAnchorEl(event.currentTarget);
7123
- };
7124
- const handleFilterMenuClose = () => {
7125
- setSelectedFilters(headerFilters[headCell.id]);
7126
- setAnchorEl(null);
7127
- };
7128
- const handleFilterOptionClick = (option) => {
7129
- const selectedIndex = findFilterIndex(selectedFilters, option);
7130
- let newSelected;
7131
- if (selectedIndex === -1) {
7132
- if (typeof option === "string") {
7133
- newSelected = [...selectedFilters, option];
7134
- } else {
7135
- newSelected = [...selectedFilters, option];
7136
- }
7137
- } else {
7138
- newSelected = selectedFilters.filter(
7139
- (_, index) => index !== selectedIndex
7140
- );
7141
- }
7142
- setSelectedFilters(newSelected);
7143
- };
7144
- const handleApplyFilters = (shouldSave) => {
7145
- const updatedFilters = {
7146
- ...headerFilters,
7147
- [headCell.id]: [...selectedFilters]
7148
- };
7149
- onApplyFilters?.(updatedFilters, shouldSave);
7150
- setAnchorEl(null);
7151
- };
7152
- useEffect11(() => {
7153
- setSelectedFilters(headerFilters[headCell.id] ?? []);
7154
- }, [headerFilters, headCell.id]);
7155
- const isOptionChecked = useMemo3(() => (resolvedOption) => !!selectedFilters?.some(
7156
- (value) => resolveOptionType(value, headCell.fieldName ?? "") === resolvedOption
7157
- ), [selectedFilters]);
7158
- const loadingSkeletons = /* @__PURE__ */ jsxs76(Box30, { "data-testid": "loading-skeletons", width: 272, children: [
7159
- /* @__PURE__ */ jsx111(Skeleton3, { variant: "rounded", className: classes.skeleton }),
7160
- /* @__PURE__ */ jsx111(Divider9, {}),
7161
- /* @__PURE__ */ jsx111(Skeleton3, { variant: "rounded", className: classes.skeleton }),
7162
- /* @__PURE__ */ jsx111(Skeleton3, { variant: "rounded", className: classes.skeleton }),
7163
- /* @__PURE__ */ jsx111(Skeleton3, { variant: "rounded", className: classes.skeleton }),
7164
- /* @__PURE__ */ jsx111(Skeleton3, { variant: "rounded", className: classes.skeleton }),
7165
- /* @__PURE__ */ jsx111(Divider9, {}),
7166
- /* @__PURE__ */ jsx111(Skeleton3, { variant: "rounded", className: classes.skeleton })
7167
- ] });
7168
- return /* @__PURE__ */ jsxs76(Fragment11, { children: [
7169
- /* @__PURE__ */ jsx111(
7170
- ActiveFiltersIconButton_default,
7171
- {
7172
- numActiveFilters,
7173
- handleClick: handleFilterMenuOpen,
7174
- className: classNames3("filter-menu-trigger", {
7175
- "has-active-filters": !!numActiveFilters || !!anchorEl
7176
- })
7177
- }
7178
- ),
7179
- /* @__PURE__ */ jsx111(
7180
- Menu4,
7181
- {
7182
- open: !!anchorEl,
7183
- onClose: handleFilterMenuClose,
7184
- anchorEl,
7185
- "data-testid": "filter-menu",
7186
- anchorOrigin: { vertical: "bottom", horizontal: "right" },
7187
- transformOrigin: { vertical: "top", horizontal: "right" },
7188
- children: headCell.isFetchingFilterOptions ? loadingSkeletons : /* @__PURE__ */ jsxs76(Box30, { className: classes.filterMenu, children: [
7189
- /* @__PURE__ */ jsx111(Box30, { px: 3, mb: 0.5, children: /* @__PURE__ */ jsx111(
7190
- FormControlLabel3,
7191
- {
7192
- label: "Select All",
7193
- control: /* @__PURE__ */ jsx111(
7194
- Checkbox5,
7195
- {
7196
- disableRipple: true,
7197
- checked: numCurrentSelectedFilters === numFilterOptions,
7198
- indeterminate: numCurrentSelectedFilters > 0 && numCurrentSelectedFilters < numFilterOptions,
7199
- onChange: ({ target: { checked } }) => {
7200
- if (checked) {
7201
- setSelectedFilters([...filterOptionsData]);
7202
- } else {
7203
- setSelectedFilters([]);
7204
- }
7205
- }
7206
- }
7207
- )
7208
- }
7209
- ) }),
7210
- /* @__PURE__ */ jsx111(Divider9, { sx: { mb: 0.5 } }),
7211
- /* @__PURE__ */ jsx111(Box30, { className: classes.filterOptions, children: filterOptionsData?.map(
7212
- (option) => {
7213
- const resolvedOption = resolveOptionType(option, headCell.fieldName ?? "");
7214
- return /* @__PURE__ */ jsxs76(
7215
- Box30,
7216
- {
7217
- className: classes.filter,
7218
- children: [
7219
- /* @__PURE__ */ jsx111(
7220
- FormControlLabel3,
7221
- {
7222
- label: resolvedOption,
7223
- control: /* @__PURE__ */ jsx111(
7224
- Checkbox5,
7225
- {
7226
- disableRipple: true,
7227
- onChange: () => handleFilterOptionClick(option),
7228
- checked: isOptionChecked(resolvedOption)
7229
- }
7230
- )
7231
- },
7232
- resolvedOption
7233
- ),
7234
- shouldShowCheckOnFilter?.(headCell.id, option) ? /* @__PURE__ */ jsx111(Tooltip6, { title: "This filter is saved as default", children: /* @__PURE__ */ jsx111(CheckIcon, { fontSize: "small", color: "action" }) }) : null
7235
- ]
7236
- },
7237
- resolvedOption
7238
- );
7239
- }
7240
- ) }),
7241
- /* @__PURE__ */ jsx111(Divider9, { sx: { mb: 0.5 } }),
7242
- /* @__PURE__ */ jsxs76(Box30, { className: classes.applyFilterButtonsContainer, children: [
7243
- /* @__PURE__ */ jsx111(
7244
- ExtendedButton_default,
7245
- {
7246
- copy: "Save as Default",
7247
- buttonType: "button",
7248
- variant: "text",
7249
- tooltip: "Persists those filters for future visits",
7250
- className: classes.saveAsDefaultButton,
7251
- onClick: () => handleApplyFilters(true)
7252
- }
7253
- ),
7254
- /* @__PURE__ */ jsx111(
7255
- ExtendedButton_default,
7256
- {
7257
- copy: "Apply",
7258
- color: "primary",
7259
- buttonType: "submit",
7260
- onClick: () => handleApplyFilters(false)
7261
- }
7262
- )
7263
- ] })
7264
- ] })
7265
- }
7266
- )
7267
- ] });
7268
- };
7269
- var SmartTableHeaderFilterMenu_default = memo21(SmartTableHeaderFilterMenu);
6909
+ var SmartTableHeader_default = memo21(SmartTableHeader);
7270
6910
 
7271
6911
  // src/components/Table/Table.tsx
7272
6912
  var import_debounce = __toESM(require_debounce(), 1);
7273
- import { useLayoutEffect, useState as useState17 } from "react";
6913
+ import { useLayoutEffect, useState as useState15 } from "react";
7274
6914
  import {
7275
- Box as Box32,
7276
- Paper as Paper11,
6915
+ Box as Box29,
6916
+ Paper as Paper10,
7277
6917
  Table as MUITable,
7278
- TableBody as TableBody2,
7279
- TableCell as TableCell3,
7280
- TableContainer as TableContainer2,
6918
+ TableBody,
6919
+ TableCell as TableCell2,
6920
+ TableContainer,
7281
6921
  TableHead as TableHead2,
7282
- TableRow as TableRow3,
6922
+ TableRow as TableRow2,
7283
6923
  TableSortLabel as TableSortLabel2
7284
6924
  } from "@mui/material";
7285
- import { makeStyles as makeStyles49 } from "tss-react/mui";
6925
+ import { makeStyles as makeStyles47 } from "tss-react/mui";
7286
6926
  import { v4 as uuidv4 } from "uuid";
7287
6927
 
7288
6928
  // src/components/TableLoading/TableLoading.tsx
7289
- import { Box as Box31, Skeleton as Skeleton4 } from "@mui/material";
7290
- import { jsx as jsx112 } from "react/jsx-runtime";
6929
+ import { Box as Box28, Skeleton as Skeleton3 } from "@mui/material";
6930
+ import { jsx as jsx109 } from "react/jsx-runtime";
7291
6931
  var TableLoading = ({
7292
6932
  rowsPerPage,
7293
6933
  rowHeight
7294
- }) => /* @__PURE__ */ jsx112(Box31, { children: Array.from({ length: rowsPerPage ?? 0 }).map((_, index) => /* @__PURE__ */ jsx112(
7295
- Skeleton4,
6934
+ }) => /* @__PURE__ */ jsx109(Box28, { children: Array.from({ length: rowsPerPage ?? 0 }).map((_, index) => /* @__PURE__ */ jsx109(
6935
+ Skeleton3,
7296
6936
  {
7297
6937
  animation: "pulse",
7298
6938
  "data-testid": "table-loading-skeleton",
@@ -7305,7 +6945,7 @@ var TableLoading = ({
7305
6945
  var TableLoading_default = TableLoading;
7306
6946
 
7307
6947
  // src/components/Table/helpers.tsx
7308
- function stableSort2(array, cmp) {
6948
+ function stableSort(array, cmp) {
7309
6949
  const stabilizedThis = array.map((el, index) => [el, index]);
7310
6950
  stabilizedThis.sort((a, b) => {
7311
6951
  const order = cmp(a[0], b[0]);
@@ -7316,7 +6956,7 @@ function stableSort2(array, cmp) {
7316
6956
  });
7317
6957
  return stabilizedThis.map((el) => el[0]);
7318
6958
  }
7319
- function descendingComparator2(a, b, orderBy) {
6959
+ function descendingComparator(a, b, orderBy) {
7320
6960
  if (b[orderBy] < a[orderBy]) {
7321
6961
  return -1;
7322
6962
  }
@@ -7326,7 +6966,7 @@ function descendingComparator2(a, b, orderBy) {
7326
6966
  return 0;
7327
6967
  }
7328
6968
  function getSorting(order, orderBy) {
7329
- return order === "desc" ? (a, b) => descendingComparator2(a, b, orderBy) : (a, b) => -descendingComparator2(a, b, orderBy);
6969
+ return order === "desc" ? (a, b) => descendingComparator(a, b, orderBy) : (a, b) => -descendingComparator(a, b, orderBy);
7330
6970
  }
7331
6971
  function calculateRowsPerPage(rowHeight) {
7332
6972
  const appContainerDom = document.getElementById("mainContainer");
@@ -7340,8 +6980,8 @@ function calculateRowsPerPage(rowHeight) {
7340
6980
  }
7341
6981
 
7342
6982
  // src/components/Table/Table.tsx
7343
- import { jsx as jsx113, jsxs as jsxs77 } from "react/jsx-runtime";
7344
- var useStyles49 = makeStyles49()(() => ({
6983
+ import { jsx as jsx110, jsxs as jsxs75 } from "react/jsx-runtime";
6984
+ var useStyles47 = makeStyles47()(() => ({
7345
6985
  root: {
7346
6986
  height: "calc(100vh - 262px)",
7347
6987
  overflow: "scroll"
@@ -7357,32 +6997,275 @@ var useStyles49 = makeStyles49()(() => ({
7357
6997
  fontWeight: 600,
7358
6998
  fontSize: ".875rem"
7359
6999
  }
7360
- },
7361
- container: {
7362
- maxHeight: "calc(100% - 0)"
7000
+ },
7001
+ container: {
7002
+ maxHeight: "calc(100% - 0)"
7003
+ }
7004
+ }));
7005
+ var Table = ({
7006
+ appliedFilters,
7007
+ data,
7008
+ doNotCalculateRows,
7009
+ headCells,
7010
+ isLoading,
7011
+ onRowClick,
7012
+ page = 0,
7013
+ RenderItem = null,
7014
+ rowsPerPage: defaultRowsPerPage = 10,
7015
+ serverRendered,
7016
+ updateSort
7017
+ }) => {
7018
+ const [order, setOrder] = useState15(appliedFilters?.sortDir || "desc");
7019
+ const [orderBy, setOrderBy] = useState15(
7020
+ appliedFilters?.sortField || "delivery_date"
7021
+ );
7022
+ const [rowsPerPage, setRowsPerPage] = useState15(defaultRowsPerPage);
7023
+ const { classes } = useStyles47();
7024
+ const rowHeight = 56;
7025
+ const emptyRows = rowsPerPage - Math.min(rowsPerPage, data.length - page * rowsPerPage);
7026
+ const handleRequestSort = (event, property) => {
7027
+ const isAsc = orderBy === property && order === "asc";
7028
+ const orderDir = isAsc ? "desc" : "asc";
7029
+ setOrder(orderDir);
7030
+ setOrderBy(property);
7031
+ if (updateSort) {
7032
+ updateSort(property, orderDir);
7033
+ }
7034
+ };
7035
+ useLayoutEffect(() => {
7036
+ if (!doNotCalculateRows) {
7037
+ return;
7038
+ }
7039
+ function updateRowsPerPage() {
7040
+ const newRowsPerPage = calculateRowsPerPage(rowHeight);
7041
+ setRowsPerPage(newRowsPerPage);
7042
+ }
7043
+ updateRowsPerPage();
7044
+ const debounced = (0, import_debounce.default)(updateRowsPerPage, 150);
7045
+ window.addEventListener("resize", debounced);
7046
+ return () => {
7047
+ window.removeEventListener("resize", debounced);
7048
+ };
7049
+ }, [doNotCalculateRows]);
7050
+ const createSortHandler = (property) => (event) => {
7051
+ handleRequestSort(event, property);
7052
+ };
7053
+ const getTableRows = () => {
7054
+ const index = page;
7055
+ const rows = serverRendered ? data : stableSort(data, getSorting(order, orderBy)).slice(
7056
+ index * rowsPerPage,
7057
+ index * rowsPerPage + rowsPerPage
7058
+ );
7059
+ const rowsComponents = rows.map((row) => {
7060
+ if (RenderItem) {
7061
+ return /* @__PURE__ */ jsx110(RenderItem, { ...row }, row.id);
7062
+ }
7063
+ return /* @__PURE__ */ jsx110(TableRow2, { hover: true, onClick: () => onRowClick?.(row), children: headCells?.map((column) => /* @__PURE__ */ jsx110(TableCell2, { children: row[column.id] }, column.id)) }, row.id);
7064
+ });
7065
+ if (emptyRows > 0 && rowsPerPage > emptyRows) {
7066
+ rowsComponents.push(
7067
+ /* @__PURE__ */ jsx110(TableRow2, { style: { height: rowHeight * emptyRows }, children: /* @__PURE__ */ jsx110(TableCell2, { colSpan: 8 }) }, uuidv4())
7068
+ );
7069
+ }
7070
+ return rowsComponents;
7071
+ };
7072
+ return /* @__PURE__ */ jsx110(Paper10, { className: classes.root, children: /* @__PURE__ */ jsx110(Box29, { className: classes.paper, children: isLoading ? /* @__PURE__ */ jsx110(TableLoading_default, { rowHeight, rowsPerPage }) : /* @__PURE__ */ jsx110(TableContainer, { className: classes.container, children: /* @__PURE__ */ jsxs75(MUITable, { size: "medium", stickyHeader: true, children: [
7073
+ /* @__PURE__ */ jsx110(TableHead2, { className: classes.header, children: /* @__PURE__ */ jsx110(TableRow2, { children: headCells?.map((headCell) => /* @__PURE__ */ jsx110(
7074
+ TableCell2,
7075
+ {
7076
+ align: "left",
7077
+ sortDirection: orderBy === headCell.id ? order : void 0,
7078
+ children: /* @__PURE__ */ jsx110(
7079
+ TableSortLabel2,
7080
+ {
7081
+ active: orderBy === headCell.id,
7082
+ direction: orderBy === headCell.id ? order : "asc",
7083
+ onClick: createSortHandler(headCell.id),
7084
+ children: headCell.label
7085
+ }
7086
+ )
7087
+ },
7088
+ headCell.id
7089
+ )) }) }),
7090
+ /* @__PURE__ */ jsxs75(TableBody, { children: [
7091
+ getTableRows(),
7092
+ rowsPerPage === emptyRows && /* @__PURE__ */ jsx110(TableRow2, { style: { height: rowHeight * emptyRows }, children: /* @__PURE__ */ jsx110(TableCell2, { colSpan: 8, align: "center", children: "Nothing to display" }) })
7093
+ ] })
7094
+ ] }) }) }) });
7095
+ };
7096
+ var Table_default = Table;
7097
+
7098
+ // src/components/TableDesktop/TableDesktop.tsx
7099
+ import {
7100
+ useCallback as useCallback2,
7101
+ useMemo as useMemo3,
7102
+ useState as useState16
7103
+ } from "react";
7104
+ import {
7105
+ Paper as Paper11,
7106
+ Table as Table2,
7107
+ TableBody as TableBody2,
7108
+ TableContainer as TableContainer2,
7109
+ Skeleton as Skeleton4,
7110
+ Box as Box30
7111
+ } from "@mui/material";
7112
+ import { makeStyles as makeStyles49 } from "tss-react/mui";
7113
+
7114
+ // src/components/TableEmptyResult/TableEmptyResult.tsx
7115
+ import { TableCell as TableCell3, TableRow as TableRow3, Typography as Typography25 } from "@mui/material";
7116
+ import { makeStyles as makeStyles48 } from "tss-react/mui";
7117
+ import { jsx as jsx111, jsxs as jsxs76 } from "react/jsx-runtime";
7118
+ var useStyles48 = makeStyles48()(() => ({
7119
+ tableCellIcon: { padding: 24, height: "calc(100vh - 320px)" },
7120
+ tableCellDefault: { padding: 24 }
7121
+ }));
7122
+ var TableEmptyResult = ({
7123
+ colSpan,
7124
+ showClearFilterButton = false,
7125
+ handleClickOnClearFiltersButton = () => {
7126
+ }
7127
+ }) => {
7128
+ const { classes } = useStyles48();
7129
+ return showClearFilterButton ? /* @__PURE__ */ jsx111(TableRow3, { children: /* @__PURE__ */ jsxs76(
7130
+ TableCell3,
7131
+ {
7132
+ className: classes.tableCellIcon,
7133
+ colSpan,
7134
+ align: "center",
7135
+ children: [
7136
+ /* @__PURE__ */ jsx111(EmptyGlassIcon_default, {}),
7137
+ /* @__PURE__ */ jsx111(Typography25, { variant: "h6", children: "No results found." }),
7138
+ /* @__PURE__ */ jsx111(Typography25, { variant: "subtitle1", children: "Search without applied filters?" }),
7139
+ /* @__PURE__ */ jsx111(
7140
+ FilledButton_default,
7141
+ {
7142
+ copy: "Search",
7143
+ variant: "contained",
7144
+ color: "primary",
7145
+ onClick: handleClickOnClearFiltersButton
7146
+ }
7147
+ )
7148
+ ]
7149
+ }
7150
+ ) }) : /* @__PURE__ */ jsx111(TableRow3, { children: /* @__PURE__ */ jsx111(
7151
+ TableCell3,
7152
+ {
7153
+ className: classes.tableCellDefault,
7154
+ colSpan,
7155
+ align: "center",
7156
+ children: "Nothing to display"
7157
+ }
7158
+ ) });
7159
+ };
7160
+ var TableEmptyResult_default = TableEmptyResult;
7161
+
7162
+ // src/components/TableDesktop/TableDesktop.tsx
7163
+ import { jsx as jsx112, jsxs as jsxs77 } from "react/jsx-runtime";
7164
+ var useStyles49 = makeStyles49()((theme) => ({
7165
+ root: {
7166
+ justifyContent: "space-between",
7167
+ display: "flex",
7168
+ justifyItems: "stretch"
7169
+ },
7170
+ paper: {
7171
+ width: "100%",
7172
+ display: "flex",
7173
+ flexDirection: "column",
7174
+ justifyContent: "space-between"
7175
+ },
7176
+ container: {
7177
+ maxHeight: "100%",
7178
+ "&::-webkit-scrollbar": {
7179
+ width: "8px",
7180
+ height: "8px"
7181
+ },
7182
+ "&::-webkit-scrollbar-track": {
7183
+ backgroundColor: theme.palette.mode === "dark" ? theme.palette.grey[800] : theme.palette.grey[100]
7184
+ },
7185
+ "&::-webkit-scrollbar-thumb": {
7186
+ backgroundColor: theme.palette.mode === "dark" ? theme.palette.grey[900] : theme.palette.grey[400],
7187
+ borderRadius: "10px"
7188
+ },
7189
+ "&::-webkit-scrollbar-thumb:hover": {
7190
+ backgroundColor: theme.palette.mode === "dark" ? theme.palette.common.black : theme.palette.grey[500]
7191
+ }
7363
7192
  }
7364
7193
  }));
7365
- var Table2 = ({
7366
- appliedFilters,
7194
+ var descendingComparator2 = (a, b, orderBy) => {
7195
+ const objA = a[orderBy];
7196
+ const objB = b[orderBy];
7197
+ const valA = typeof objA === "object" ? objA?.name : objA;
7198
+ const valB = typeof objB === "object" ? objB?.name : objB;
7199
+ if (!valA && !valB) {
7200
+ return 0;
7201
+ }
7202
+ if (valA && !valB) {
7203
+ return -1;
7204
+ }
7205
+ if (!valA && valB) {
7206
+ return 1;
7207
+ }
7208
+ if (valA > valB) {
7209
+ return -1;
7210
+ }
7211
+ if (valA < valB) {
7212
+ return 1;
7213
+ }
7214
+ return 0;
7215
+ };
7216
+ var stableSort2 = (array, cmp) => array.map((el, index) => ({ el, index })).sort((a, b) => {
7217
+ const order = cmp(a.el, b.el);
7218
+ return order !== 0 ? order : a.index - b.index;
7219
+ }).map((el) => el.el);
7220
+ var getComparator = (order, orderBy) => order === "desc" ? (a, b) => descendingComparator2(a, b, orderBy) : (a, b) => -descendingComparator2(a, b, orderBy);
7221
+ var TableDesktop = ({
7367
7222
  data,
7368
- doNotCalculateRows,
7369
7223
  headCells,
7224
+ RenderItem,
7225
+ appliedFilters,
7226
+ headerFilters,
7227
+ children,
7228
+ height,
7370
7229
  isLoading,
7371
- onRowClick,
7372
- page = 0,
7373
- RenderItem = null,
7374
- rowsPerPage: defaultRowsPerPage = 10,
7375
- serverRendered,
7376
- updateSort
7230
+ rowsPerPage = 50,
7231
+ enableCheckboxSelection = false,
7232
+ disableInternalSort = false,
7233
+ updateSort,
7234
+ showClearFilterButton,
7235
+ handleClickOnClearFiltersButton,
7236
+ deleteItem,
7237
+ keyField = "id",
7238
+ tableLayout = "auto",
7239
+ onApplyFilters,
7240
+ shouldShowCheckOnFilter
7377
7241
  }) => {
7378
- const [order, setOrder] = useState17(appliedFilters?.sortDir || "desc");
7379
- const [orderBy, setOrderBy] = useState17(
7242
+ const [order, setOrder] = useState16(appliedFilters?.sortDir || "desc");
7243
+ const [orderBy, setOrderBy] = useState16(
7380
7244
  appliedFilters?.sortField || "delivery_date"
7381
7245
  );
7382
- const [rowsPerPage, setRowsPerPage] = useState17(defaultRowsPerPage);
7246
+ const [selected, setSelected] = useState16([]);
7247
+ const [page] = useState16(0);
7383
7248
  const { classes } = useStyles49();
7384
7249
  const rowHeight = 56;
7385
- const emptyRows = rowsPerPage - Math.min(rowsPerPage, data.length - page * rowsPerPage);
7250
+ const emptyRows = useMemo3(
7251
+ () => rowsPerPage - data.length,
7252
+ [rowsPerPage, data]
7253
+ );
7254
+ const visibleHeadCells = useMemo3(
7255
+ () => headCells.filter((headCell) => headCell?.enabled ?? true),
7256
+ [headCells]
7257
+ );
7258
+ const handleSelectAllClick = useCallback2(
7259
+ (event) => {
7260
+ if (event.target.checked) {
7261
+ const newSelected = data.map((n) => n[keyField]);
7262
+ setSelected(newSelected);
7263
+ return;
7264
+ }
7265
+ setSelected([]);
7266
+ },
7267
+ [data, keyField]
7268
+ );
7386
7269
  const handleRequestSort = (event, property) => {
7387
7270
  const isAsc = orderBy === property && order === "asc";
7388
7271
  const orderDir = isAsc ? "desc" : "asc";
@@ -7392,277 +7275,119 @@ var Table2 = ({
7392
7275
  updateSort(property, orderDir);
7393
7276
  }
7394
7277
  };
7395
- useLayoutEffect(() => {
7396
- if (!doNotCalculateRows) {
7397
- return;
7398
- }
7399
- function updateRowsPerPage() {
7400
- const newRowsPerPage = calculateRowsPerPage(rowHeight);
7401
- setRowsPerPage(newRowsPerPage);
7402
- }
7403
- updateRowsPerPage();
7404
- const debounced = (0, import_debounce.default)(updateRowsPerPage, 150);
7405
- window.addEventListener("resize", debounced);
7406
- return () => {
7407
- window.removeEventListener("resize", debounced);
7408
- };
7409
- }, [doNotCalculateRows]);
7410
- const createSortHandler = (property) => (event) => {
7411
- handleRequestSort(event, property);
7412
- };
7413
- const getTableRows = () => {
7414
- const index = page;
7415
- const rows = serverRendered ? data : stableSort2(data, getSorting(order, orderBy)).slice(
7416
- index * rowsPerPage,
7417
- index * rowsPerPage + rowsPerPage
7418
- );
7419
- const rowsComponents = rows.map((row) => {
7420
- if (RenderItem) {
7421
- return /* @__PURE__ */ jsx113(RenderItem, { ...row }, row.id);
7278
+ const handleRowCheckboxClick = useCallback2(
7279
+ (event, keyFieldValue) => {
7280
+ const selectedIndex = selected.indexOf(keyFieldValue);
7281
+ let newSelected = [];
7282
+ if (selectedIndex === -1) {
7283
+ newSelected = newSelected.concat(selected, keyFieldValue);
7284
+ } else if (selectedIndex === 0) {
7285
+ newSelected = newSelected.concat(selected.slice(1));
7286
+ } else if (selectedIndex === selected.length - 1) {
7287
+ newSelected = newSelected.concat(selected.slice(0, -1));
7288
+ } else if (selectedIndex > 0) {
7289
+ newSelected = newSelected.concat(
7290
+ selected.slice(0, selectedIndex),
7291
+ selected.slice(selectedIndex + 1)
7292
+ );
7422
7293
  }
7423
- return /* @__PURE__ */ jsx113(TableRow3, { hover: true, onClick: () => onRowClick?.(row), children: headCells?.map((column) => /* @__PURE__ */ jsx113(TableCell3, { children: row[column.id] }, column.id)) }, row.id);
7424
- });
7425
- if (emptyRows > 0 && rowsPerPage > emptyRows) {
7426
- rowsComponents.push(
7427
- /* @__PURE__ */ jsx113(TableRow3, { style: { height: rowHeight * emptyRows }, children: /* @__PURE__ */ jsx113(TableCell3, { colSpan: 8 }) }, uuidv4())
7294
+ setSelected(newSelected);
7295
+ },
7296
+ [selected]
7297
+ );
7298
+ const renderTableRows = useMemo3(() => {
7299
+ const sortedData = disableInternalSort ? data : stableSort2(data, getComparator(order, orderBy));
7300
+ return sortedData.slice(page * rowsPerPage, page * rowsPerPage + rowsPerPage).map((row, index) => {
7301
+ const isItemSelected = selected.includes(row[keyField]);
7302
+ return /* @__PURE__ */ jsx112(
7303
+ RenderItem,
7304
+ {
7305
+ ...{
7306
+ ...row,
7307
+ index,
7308
+ deleteItem,
7309
+ isItemSelected,
7310
+ enableCheckboxSelection,
7311
+ keyFieldValue: row[keyField],
7312
+ handleRowCheckboxClick,
7313
+ visibleHeadCells
7314
+ }
7315
+ },
7316
+ row[keyField] ?? index
7428
7317
  );
7429
- }
7430
- return rowsComponents;
7431
- };
7432
- return /* @__PURE__ */ jsx113(Paper11, { className: classes.root, children: /* @__PURE__ */ jsx113(Box32, { className: classes.paper, children: isLoading ? /* @__PURE__ */ jsx113(TableLoading_default, { rowHeight, rowsPerPage }) : /* @__PURE__ */ jsx113(TableContainer2, { className: classes.container, children: /* @__PURE__ */ jsxs77(MUITable, { size: "medium", stickyHeader: true, children: [
7433
- /* @__PURE__ */ jsx113(TableHead2, { className: classes.header, children: /* @__PURE__ */ jsx113(TableRow3, { children: headCells?.map((headCell) => /* @__PURE__ */ jsx113(
7434
- TableCell3,
7318
+ });
7319
+ }, [
7320
+ data,
7321
+ order,
7322
+ orderBy,
7323
+ page,
7324
+ rowsPerPage,
7325
+ selected,
7326
+ enableCheckboxSelection,
7327
+ disableInternalSort,
7328
+ deleteItem,
7329
+ keyField,
7330
+ handleRowCheckboxClick,
7331
+ visibleHeadCells,
7332
+ RenderItem
7333
+ ]);
7334
+ return /* @__PURE__ */ jsx112("div", { className: classes.root, style: { height }, children: /* @__PURE__ */ jsxs77(Paper11, { className: classes.paper, children: [
7335
+ isLoading ? /* @__PURE__ */ jsx112(Box30, { width: "100%", overflow: "hidden", children: [...Array(Math.floor(rowsPerPage ?? 50))].map((_, index) => /* @__PURE__ */ jsx112(
7336
+ Skeleton4,
7435
7337
  {
7436
- align: "left",
7437
- sortDirection: orderBy === headCell.id ? order : void 0,
7438
- children: /* @__PURE__ */ jsx113(
7439
- TableSortLabel2,
7440
- {
7441
- active: orderBy === headCell.id,
7442
- direction: orderBy === headCell.id ? order : "asc",
7443
- onClick: createSortHandler(headCell.id),
7444
- children: headCell.label
7445
- }
7446
- )
7447
- },
7448
- headCell.id
7449
- )) }) }),
7450
- /* @__PURE__ */ jsxs77(TableBody2, { children: [
7451
- getTableRows(),
7452
- rowsPerPage === emptyRows && /* @__PURE__ */ jsx113(TableRow3, { style: { height: rowHeight * emptyRows }, children: /* @__PURE__ */ jsx113(TableCell3, { colSpan: 8, align: "center", children: "Nothing to display" }) })
7453
- ] })
7454
- ] }) }) }) });
7455
- };
7456
- var Table_default = Table2;
7457
-
7458
- // src/components/TableDesktopRowActions/TableDesktopRowActions.tsx
7459
- import { Box as Box33, TableCell as TableCell4 } from "@mui/material";
7460
- import { jsx as jsx114 } from "react/jsx-runtime";
7461
- var TableDesktopRowActions = ({
7462
- isRowHovered,
7463
- children,
7464
- sx,
7465
- zIndex = 1,
7466
- backgroundColor
7467
- }) => {
7468
- return isRowHovered ? /* @__PURE__ */ jsx114(
7469
- TableCell4,
7470
- {
7471
- padding: "none",
7472
- sx: {
7473
- top: 0,
7474
- right: 0,
7475
- zIndex,
7476
- position: "sticky",
7477
- display: "flex",
7478
- justifyContent: "flex-end",
7479
- alignItems: "center"
7480
- },
7481
- children: /* @__PURE__ */ jsx114(
7482
- Box33,
7483
- {
7484
- sx,
7485
- display: "flex",
7486
- flexDirection: "row",
7487
- borderLeft: `1px solid ${colors.neutral300}`,
7488
- bgcolor: backgroundColor ?? ((theme) => theme.palette.background.default),
7489
- children
7490
- }
7491
- )
7492
- }
7493
- ) : null;
7494
- };
7495
-
7496
- // src/components/TableDesktopRowCell/TableDesktopRowCell.tsx
7497
- import { useEffect as useEffect13, useRef as useRef5, useState as useState19 } from "react";
7498
- import { Checkbox as Checkbox6, TableCell as TableCell5, TextField as TextField8, Tooltip as Tooltip7 } from "@mui/material";
7499
-
7500
- // src/components/TableDesktopRowCell/TableDesktopSmartSelect.tsx
7501
- import { useState as useState18, memo as memo22, useEffect as useEffect12 } from "react";
7502
- import { jsx as jsx115 } from "react/jsx-runtime";
7503
- var resolveValue = (value) => {
7504
- if (typeof value === "string") {
7505
- return value;
7506
- }
7507
- return value?.id;
7508
- };
7509
- var TableDesktopSmartSelect = memo22(({
7510
- ref,
7511
- initialValue,
7512
- inputLabel,
7513
- fieldName,
7514
- rowId,
7515
- filterOptions,
7516
- refetchFilterOptions,
7517
- isFetchingFilterOptions,
7518
- onUpdateEditableCell
7519
- }) => {
7520
- const [value, setValue] = useState18(initialValue);
7521
- const [options, setOptions] = useState18();
7522
- const valueId = resolveValue(value);
7523
- const valueLabel = resolveOptionType(value, fieldName);
7524
- useEffect12(() => {
7525
- if (filterOptions) {
7526
- const parsedOptions = filterOptions?.map((option) => ({
7527
- value: resolveValue(option),
7528
- label: String(resolveOptionType(option, fieldName))
7529
- }));
7530
- setOptions(parsedOptions);
7531
- }
7532
- }, [filterOptions]);
7533
- return /* @__PURE__ */ jsx115(
7534
- SmartSelect_default,
7535
- {
7536
- ref,
7537
- value: valueId,
7538
- inputLabel,
7539
- options,
7540
- refetch: refetchFilterOptions,
7541
- isFetching: isFetchingFilterOptions,
7542
- defaultOption: {
7543
- value: valueId ?? "",
7544
- label: String(valueLabel ?? "")
7338
+ animation: "pulse",
7339
+ variant: "rounded",
7340
+ sx: { margin: 1 },
7341
+ height: rowHeight,
7342
+ "data-testid": "loading-skeleton"
7545
7343
  },
7546
- onChange: ({ value: value2, label }) => {
7547
- setValue({ id: value2 ?? "", name: label ?? "" });
7548
- onUpdateEditableCell?.(rowId, value2 ?? "");
7549
- }
7550
- }
7551
- );
7552
- });
7553
-
7554
- // src/components/TableDesktopRowCell/TableDesktopRowCell.tsx
7555
- import CheckIcon2 from "@mui/icons-material/Check";
7556
- import { jsx as jsx116 } from "react/jsx-runtime";
7557
- var TableDesktopRowCell = ({
7558
- ref,
7559
- inputLabel,
7560
- editInitialValue,
7561
- rowId,
7562
- fieldName,
7563
- width,
7564
- isEditMode,
7565
- readOnlyValue,
7566
- editableCellType,
7567
- filterOptions,
7568
- refetchFilterOptions,
7569
- isFetchingFilterOptions,
7570
- onUpdateEditableCell
7571
- }) => {
7572
- const cellRef = useRef5(null);
7573
- const [isOverflowed, setIsOverflowed] = useState19(false);
7574
- useEffect13(() => {
7575
- const ref2 = cellRef.current;
7576
- if (ref2) {
7577
- setIsOverflowed(ref2.scrollWidth > ref2.clientWidth);
7578
- }
7579
- }, [readOnlyValue, width]);
7580
- const editableComponents = {
7581
- "select": /* @__PURE__ */ jsx116(
7582
- TableDesktopSmartSelect,
7583
- {
7584
- ref,
7585
- rowId,
7586
- fieldName,
7587
- initialValue: editInitialValue,
7588
- inputLabel: inputLabel ?? "",
7589
- filterOptions,
7590
- refetchFilterOptions,
7591
- isFetchingFilterOptions,
7592
- onUpdateEditableCell
7593
- }
7594
- ),
7595
- "checkbox": /* @__PURE__ */ jsx116(
7596
- Checkbox6,
7597
- {
7598
- disableRipple: true,
7599
- defaultChecked: editInitialValue,
7600
- onChange: ({ target: { checked } }) => {
7601
- onUpdateEditableCell?.(rowId, checked);
7602
- }
7603
- }
7604
- ),
7605
- "text": /* @__PURE__ */ jsx116(
7606
- TextField8,
7607
- {
7608
- fullWidth: true,
7609
- variant: "standard",
7610
- defaultValue: editInitialValue,
7611
- label: inputLabel,
7612
- onBlur: ({ target: { value } }) => {
7613
- onUpdateEditableCell?.(rowId, value);
7614
- }
7615
- }
7616
- ),
7617
- "numeric": /* @__PURE__ */ jsx116(
7618
- TextField8,
7344
+ index
7345
+ )) }) : /* @__PURE__ */ jsx112(TableContainer2, { className: classes.container, children: /* @__PURE__ */ jsxs77(
7346
+ Table2,
7619
7347
  {
7620
- fullWidth: true,
7621
- variant: "standard",
7622
- defaultValue: editInitialValue,
7623
- label: inputLabel,
7624
- onChange: (e) => {
7625
- e.target.value = e.target.value.replace(/\D/g, "");
7626
- },
7627
- onBlur: ({ target: { value } }) => {
7628
- onUpdateEditableCell?.(rowId, value);
7629
- },
7630
- slotProps: {
7631
- input: {
7632
- inputMode: "numeric"
7633
- }
7634
- }
7348
+ "aria-labelledby": "tableTitle",
7349
+ "aria-label": "sticky table",
7350
+ stickyHeader: true,
7351
+ style: { tableLayout },
7352
+ children: [
7353
+ /* @__PURE__ */ jsx112(
7354
+ SmartTableHeader_default,
7355
+ {
7356
+ headCells: visibleHeadCells,
7357
+ order,
7358
+ orderBy,
7359
+ numSelected: selected.length,
7360
+ numRows: data.length,
7361
+ enableCheckboxSelection,
7362
+ headerFilters: headerFilters ?? {},
7363
+ onRequestSort: handleRequestSort,
7364
+ onSelectAllClick: handleSelectAllClick,
7365
+ onApplyFilters,
7366
+ shouldShowCheckOnFilter
7367
+ }
7368
+ ),
7369
+ /* @__PURE__ */ jsx112(TableBody2, { children: rowsPerPage !== emptyRows ? renderTableRows : /* @__PURE__ */ jsx112(
7370
+ TableEmptyResult_default,
7371
+ {
7372
+ colSpan: enableCheckboxSelection ? visibleHeadCells.length + 1 : visibleHeadCells.length,
7373
+ showClearFilterButton,
7374
+ handleClickOnClearFiltersButton
7375
+ }
7376
+ ) })
7377
+ ]
7635
7378
  }
7636
- )
7637
- };
7638
- const getReadOnlyBooleanIcon = (value) => {
7639
- if (value) {
7640
- return /* @__PURE__ */ jsx116(CheckIcon2, { sx: { fontSize: 16 } });
7641
- }
7642
- return "-";
7643
- };
7644
- return /* @__PURE__ */ jsx116(Tooltip7, { title: isOverflowed ? String(readOnlyValue) : "", arrow: true, children: /* @__PURE__ */ jsx116(
7645
- TableCell5,
7646
- {
7647
- ref: cellRef,
7648
- align: "left",
7649
- sx: {
7650
- width: width ?? "auto",
7651
- overflow: "hidden",
7652
- textOverflow: "ellipsis",
7653
- whiteSpace: "nowrap"
7654
- },
7655
- children: isEditMode && editableCellType ? editableComponents[editableCellType] : typeof readOnlyValue === "boolean" ? getReadOnlyBooleanIcon(readOnlyValue) : readOnlyValue
7656
- }
7657
- ) });
7379
+ ) }),
7380
+ children
7381
+ ] }) });
7658
7382
  };
7383
+ var TableDesktop_default = TableDesktop;
7659
7384
 
7660
7385
  // src/components/TableHeader/TableHeader.tsx
7661
- import { memo as memo23, useEffect as useEffect14, useState as useState20 } from "react";
7386
+ import { memo as memo22, useEffect as useEffect10, useState as useState17 } from "react";
7662
7387
  import { ImportExport as ImportExportIcon } from "@mui/icons-material";
7663
- import { TableCell as TableCell6, TableHead as TableHead3, TableRow as TableRow4, TableSortLabel as TableSortLabel3 } from "@mui/material";
7388
+ import { TableCell as TableCell4, TableHead as TableHead3, TableRow as TableRow4, TableSortLabel as TableSortLabel3 } from "@mui/material";
7664
7389
  import { makeStyles as makeStyles50 } from "tss-react/mui";
7665
- import { jsx as jsx117 } from "react/jsx-runtime";
7390
+ import { jsx as jsx113 } from "react/jsx-runtime";
7666
7391
  var useStyles50 = makeStyles50()(() => ({
7667
7392
  sortLabel: {
7668
7393
  "& .MuiTableSortLabel-icon": {
@@ -7671,9 +7396,9 @@ var useStyles50 = makeStyles50()(() => ({
7671
7396
  }
7672
7397
  }));
7673
7398
  var TableHeader = ({ cells, onSort = null }) => {
7674
- const [sortableCells, setSortableCells] = useState20([]);
7399
+ const [sortableCells, setSortableCells] = useState17([]);
7675
7400
  const { classes } = useStyles50();
7676
- useEffect14(() => {
7401
+ useEffect10(() => {
7677
7402
  setSortableCells(cells);
7678
7403
  }, []);
7679
7404
  const getNewSortDirection = (direction) => {
@@ -7707,7 +7432,7 @@ var TableHeader = ({ cells, onSort = null }) => {
7707
7432
  });
7708
7433
  setSortableCells(sortedCells);
7709
7434
  };
7710
- return /* @__PURE__ */ jsx117(TableHead3, { children: /* @__PURE__ */ jsx117(TableRow4, { children: sortableCells.map((cell, key) => /* @__PURE__ */ jsx117(TableCell6, { children: cell.isSortable ? /* @__PURE__ */ jsx117(
7435
+ return /* @__PURE__ */ jsx113(TableHead3, { children: /* @__PURE__ */ jsx113(TableRow4, { children: sortableCells.map((cell, key) => /* @__PURE__ */ jsx113(TableCell4, { children: cell.isSortable ? /* @__PURE__ */ jsx113(
7711
7436
  TableSortLabel3,
7712
7437
  {
7713
7438
  className: classes.sortLabel,
@@ -7718,12 +7443,12 @@ var TableHeader = ({ cells, onSort = null }) => {
7718
7443
  }
7719
7444
  ) : cell.label }, cell.label || key)) }) });
7720
7445
  };
7721
- var TableHeader_default = memo23(TableHeader);
7446
+ var TableHeader_default = memo22(TableHeader);
7722
7447
 
7723
7448
  // src/components/TextDivider/TextDivider.tsx
7724
- import { Box as Box34, Typography as Typography27, Divider as Divider10, Button as Button13 } from "@mui/material";
7449
+ import { Box as Box31, Typography as Typography26, Divider as Divider10, Button as Button13 } from "@mui/material";
7725
7450
  import { makeStyles as makeStyles51 } from "tss-react/mui";
7726
- import { jsx as jsx118, jsxs as jsxs78 } from "react/jsx-runtime";
7451
+ import { jsx as jsx114, jsxs as jsxs78 } from "react/jsx-runtime";
7727
7452
  var useStyles51 = makeStyles51()(() => ({
7728
7453
  icon: {
7729
7454
  fontSize: 20
@@ -7761,18 +7486,18 @@ var TextDivider = ({
7761
7486
  const { classes } = useStyles51();
7762
7487
  const iconColor = color ?? colors.neutral900;
7763
7488
  return /* @__PURE__ */ jsxs78(
7764
- Box34,
7489
+ Box31,
7765
7490
  {
7766
7491
  display: "flex",
7767
7492
  alignItems: "center",
7768
7493
  justifyContent: "space-between",
7769
7494
  className: classes.container,
7770
7495
  children: [
7771
- /* @__PURE__ */ jsx118(Divider10, { className: classes.leftDivider }),
7772
- /* @__PURE__ */ jsx118(Button13, { onClick, disabled: !onClick, className: classes.button, children: /* @__PURE__ */ jsxs78(Box34, { className: classes.center, children: [
7773
- Icon2 && iconPosition === "left" && /* @__PURE__ */ jsx118(Icon2, { className: classes.icon, style: { color: iconColor } }),
7774
- /* @__PURE__ */ jsx118(
7775
- Typography27,
7496
+ /* @__PURE__ */ jsx114(Divider10, { className: classes.leftDivider }),
7497
+ /* @__PURE__ */ jsx114(Button13, { onClick, disabled: !onClick, className: classes.button, children: /* @__PURE__ */ jsxs78(Box31, { className: classes.center, children: [
7498
+ Icon2 && iconPosition === "left" && /* @__PURE__ */ jsx114(Icon2, { className: classes.icon, style: { color: iconColor } }),
7499
+ /* @__PURE__ */ jsx114(
7500
+ Typography26,
7776
7501
  {
7777
7502
  color: "textSecondary",
7778
7503
  className: classes.title,
@@ -7780,9 +7505,9 @@ var TextDivider = ({
7780
7505
  children: title
7781
7506
  }
7782
7507
  ),
7783
- Icon2 && iconPosition === "right" && /* @__PURE__ */ jsx118(Icon2, { className: classes.icon, style: { color: iconColor } })
7508
+ Icon2 && iconPosition === "right" && /* @__PURE__ */ jsx114(Icon2, { className: classes.icon, style: { color: iconColor } })
7784
7509
  ] }) }),
7785
- /* @__PURE__ */ jsx118(Divider10, { className: classes.rightDivider })
7510
+ /* @__PURE__ */ jsx114(Divider10, { className: classes.rightDivider })
7786
7511
  ]
7787
7512
  }
7788
7513
  );
@@ -7794,7 +7519,7 @@ import { DateRangePicker } from "react-dates";
7794
7519
  import { makeStyles as makeStyles52 } from "tss-react/mui";
7795
7520
  import "react-dates/initialize";
7796
7521
  import "react-dates/lib/css/_datepicker.css";
7797
- import { jsx as jsx119 } from "react/jsx-runtime";
7522
+ import { jsx as jsx115 } from "react/jsx-runtime";
7798
7523
  var useStyles52 = makeStyles52()((theme) => ({
7799
7524
  wrapper: {
7800
7525
  "& .DateRangePicker": {
@@ -7890,15 +7615,15 @@ var ThemedDateRangePicker = ({
7890
7615
  ...props
7891
7616
  }) => {
7892
7617
  const { classes, cx } = useStyles52();
7893
- return /* @__PURE__ */ jsx119("div", { className: cx(classes.wrapper, className), children: /* @__PURE__ */ jsx119(DateRangePicker, { ...props }) });
7618
+ return /* @__PURE__ */ jsx115("div", { className: cx(classes.wrapper, className), children: /* @__PURE__ */ jsx115(DateRangePicker, { ...props }) });
7894
7619
  };
7895
7620
  var ThemedDateRangePicker_default = ThemedDateRangePicker;
7896
7621
 
7897
7622
  // src/components/TheToolbar/TheToolbar.tsx
7898
- import { memo as memo24 } from "react";
7899
- import { AppBar, Box as Box35, Toolbar } from "@mui/material";
7623
+ import { memo as memo23 } from "react";
7624
+ import { AppBar, Box as Box32, Toolbar } from "@mui/material";
7900
7625
  import { makeStyles as makeStyles53 } from "tss-react/mui";
7901
- import { jsx as jsx120, jsxs as jsxs79 } from "react/jsx-runtime";
7626
+ import { jsx as jsx116, jsxs as jsxs79 } from "react/jsx-runtime";
7902
7627
  var useStyles53 = makeStyles53()((theme) => ({
7903
7628
  menuButton: {
7904
7629
  color: theme.palette.primary.contrastText
@@ -7918,9 +7643,9 @@ var TheToolbar = ({
7918
7643
  rightSection
7919
7644
  }) => {
7920
7645
  const { classes } = useStyles53();
7921
- return /* @__PURE__ */ jsxs79(Box35, { children: [
7922
- /* @__PURE__ */ jsx120(AppBar, { children: /* @__PURE__ */ jsxs79(Toolbar, { className: classes.topBar, children: [
7923
- /* @__PURE__ */ jsx120(
7646
+ return /* @__PURE__ */ jsxs79(Box32, { children: [
7647
+ /* @__PURE__ */ jsx116(AppBar, { children: /* @__PURE__ */ jsxs79(Toolbar, { className: classes.topBar, children: [
7648
+ /* @__PURE__ */ jsx116(
7924
7649
  RoundButton_default,
7925
7650
  {
7926
7651
  className: classes.menuButton,
@@ -7929,7 +7654,7 @@ var TheToolbar = ({
7929
7654
  onClick: handleOpen
7930
7655
  }
7931
7656
  ),
7932
- /* @__PURE__ */ jsx120(
7657
+ /* @__PURE__ */ jsx116(
7933
7658
  CompanyLogo_default,
7934
7659
  {
7935
7660
  size: "small",
@@ -7938,30 +7663,30 @@ var TheToolbar = ({
7938
7663
  imageLogoLightSmall
7939
7664
  }
7940
7665
  ),
7941
- /* @__PURE__ */ jsx120(Box35, { ml: 2, children: leftSection }),
7942
- /* @__PURE__ */ jsx120(Box35, { ml: "auto", children: rightSection })
7666
+ /* @__PURE__ */ jsx116(Box32, { ml: 2, children: leftSection }),
7667
+ /* @__PURE__ */ jsx116(Box32, { ml: "auto", children: rightSection })
7943
7668
  ] }) }),
7944
7669
  LeftDrawer
7945
7670
  ] });
7946
7671
  };
7947
- var TheToolbar_default = memo24(TheToolbar);
7672
+ var TheToolbar_default = memo23(TheToolbar);
7948
7673
 
7949
7674
  // src/components/ToastMessage/ToastMessage.tsx
7950
7675
  import { Alert as MuiAlert, Snackbar } from "@mui/material";
7951
- import { jsx as jsx121 } from "react/jsx-runtime";
7676
+ import { jsx as jsx117 } from "react/jsx-runtime";
7952
7677
  var ToastMessage = ({
7953
7678
  toastType,
7954
7679
  toastMessage,
7955
7680
  open,
7956
7681
  onClose
7957
- }) => /* @__PURE__ */ jsx121(
7682
+ }) => /* @__PURE__ */ jsx117(
7958
7683
  Snackbar,
7959
7684
  {
7960
7685
  open,
7961
7686
  autoHideDuration: 1500,
7962
7687
  onClose,
7963
7688
  anchorOrigin: { vertical: "top", horizontal: "right" },
7964
- children: /* @__PURE__ */ jsx121(
7689
+ children: /* @__PURE__ */ jsx117(
7965
7690
  MuiAlert,
7966
7691
  {
7967
7692
  elevation: 6,
@@ -7989,16 +7714,16 @@ var ToastMessage_default = ToastMessage;
7989
7714
 
7990
7715
  // src/components/TwoButtonDialog/TwoButtonDialog.tsx
7991
7716
  import {
7992
- Typography as Typography28,
7717
+ Typography as Typography27,
7993
7718
  Dialog as Dialog5,
7994
7719
  Backdrop,
7995
- Box as Box36,
7720
+ Box as Box33,
7996
7721
  Divider as Divider11,
7997
7722
  Paper as Paper12,
7998
7723
  Fade as Fade2
7999
7724
  } from "@mui/material";
8000
7725
  import { makeStyles as makeStyles54 } from "tss-react/mui";
8001
- import { jsx as jsx122, jsxs as jsxs80 } from "react/jsx-runtime";
7726
+ import { jsx as jsx118, jsxs as jsxs80 } from "react/jsx-runtime";
8002
7727
  var useStyles54 = makeStyles54()((theme) => ({
8003
7728
  paper: {
8004
7729
  padding: theme.spacing(2)
@@ -8028,7 +7753,7 @@ var TwoButtonDialog = ({
8028
7753
  cancelButton
8029
7754
  }) => {
8030
7755
  const { classes } = useStyles54();
8031
- return /* @__PURE__ */ jsx122(
7756
+ return /* @__PURE__ */ jsx118(
8032
7757
  Dialog5,
8033
7758
  {
8034
7759
  open,
@@ -8038,10 +7763,10 @@ var TwoButtonDialog = ({
8038
7763
  closeAfterTransition: true,
8039
7764
  BackdropComponent: Backdrop,
8040
7765
  BackdropProps: { timeout: 500 },
8041
- children: /* @__PURE__ */ jsx122(Fade2, { in: open, children: /* @__PURE__ */ jsxs80(Paper12, { className: classes.paper, children: [
8042
- /* @__PURE__ */ jsxs80(Box36, { className: classes.mb, children: [
8043
- /* @__PURE__ */ jsx122(Typography28, { variant: "h5", component: "div", children: /* @__PURE__ */ jsx122(
8044
- Box36,
7766
+ children: /* @__PURE__ */ jsx118(Fade2, { in: open, children: /* @__PURE__ */ jsxs80(Paper12, { className: classes.paper, children: [
7767
+ /* @__PURE__ */ jsxs80(Box33, { className: classes.mb, children: [
7768
+ /* @__PURE__ */ jsx118(Typography27, { variant: "h5", component: "div", children: /* @__PURE__ */ jsx118(
7769
+ Box33,
8045
7770
  {
8046
7771
  sx: {
8047
7772
  fontWeight: 600
@@ -8050,22 +7775,22 @@ var TwoButtonDialog = ({
8050
7775
  }
8051
7776
  ) }),
8052
7777
  /* @__PURE__ */ jsxs80(
8053
- Box36,
7778
+ Box33,
8054
7779
  {
8055
7780
  className: classes.mt,
8056
7781
  sx: {
8057
7782
  fontWeight: 600
8058
7783
  },
8059
7784
  children: [
8060
- subtitle1 && /* @__PURE__ */ jsx122(Typography28, { variant: "subtitle1", children: subtitle1 }),
8061
- subtitle2 && /* @__PURE__ */ jsx122(Typography28, { variant: "subtitle1", children: subtitle2 })
7785
+ subtitle1 && /* @__PURE__ */ jsx118(Typography27, { variant: "subtitle1", children: subtitle1 }),
7786
+ subtitle2 && /* @__PURE__ */ jsx118(Typography27, { variant: "subtitle1", children: subtitle2 })
8062
7787
  ]
8063
7788
  }
8064
7789
  )
8065
7790
  ] }),
8066
- /* @__PURE__ */ jsx122(Divider11, {}),
8067
- /* @__PURE__ */ jsxs80(Box36, { className: classes.buttonContainer, children: [
8068
- /* @__PURE__ */ jsx122(
7791
+ /* @__PURE__ */ jsx118(Divider11, {}),
7792
+ /* @__PURE__ */ jsxs80(Box33, { className: classes.buttonContainer, children: [
7793
+ /* @__PURE__ */ jsx118(
8069
7794
  FilledButton_default,
8070
7795
  {
8071
7796
  copy: cancelLabel,
@@ -8078,7 +7803,7 @@ var TwoButtonDialog = ({
8078
7803
  }
8079
7804
  }
8080
7805
  ),
8081
- /* @__PURE__ */ jsx122(
7806
+ /* @__PURE__ */ jsx118(
8082
7807
  FilledButton_default,
8083
7808
  {
8084
7809
  color: "primary",
@@ -8087,7 +7812,7 @@ var TwoButtonDialog = ({
8087
7812
  }
8088
7813
  )
8089
7814
  ] }),
8090
- /* @__PURE__ */ jsx122(Loading_default, { isLoading: dialogLoading })
7815
+ /* @__PURE__ */ jsx118(Loading_default, { isLoading: dialogLoading })
8091
7816
  ] }) })
8092
7817
  }
8093
7818
  );
@@ -8095,11 +7820,11 @@ var TwoButtonDialog = ({
8095
7820
  var TwoButtonDialog_default = TwoButtonDialog;
8096
7821
 
8097
7822
  // src/components/UserBust/UserBust.tsx
8098
- import { memo as memo25 } from "react";
8099
- import { Avatar as Avatar2, Typography as Typography29 } from "@mui/material";
8100
- import { jsx as jsx123, jsxs as jsxs81 } from "react/jsx-runtime";
7823
+ import { memo as memo24 } from "react";
7824
+ import { Avatar as Avatar2, Typography as Typography28 } from "@mui/material";
7825
+ import { jsx as jsx119, jsxs as jsxs81 } from "react/jsx-runtime";
8101
7826
  var UserBust = ({ user, avatarProps, typographyProps }) => /* @__PURE__ */ jsxs81("div", { children: [
8102
- /* @__PURE__ */ jsx123(
7827
+ /* @__PURE__ */ jsx119(
8103
7828
  Avatar2,
8104
7829
  {
8105
7830
  src: user.profile_picture,
@@ -8108,17 +7833,17 @@ var UserBust = ({ user, avatarProps, typographyProps }) => /* @__PURE__ */ jsxs8
8108
7833
  }
8109
7834
  ),
8110
7835
  /* @__PURE__ */ jsxs81("div", { style: { paddingTop: 16 }, children: [
8111
- /* @__PURE__ */ jsx123(Typography29, { ...typographyProps.name, children: `${user.first_name} ${user.last_name}` }),
8112
- /* @__PURE__ */ jsx123(Typography29, { ...typographyProps.username, children: user.username })
7836
+ /* @__PURE__ */ jsx119(Typography28, { ...typographyProps.name, children: `${user.first_name} ${user.last_name}` }),
7837
+ /* @__PURE__ */ jsx119(Typography28, { ...typographyProps.username, children: user.username })
8113
7838
  ] })
8114
7839
  ] });
8115
- var UserBust_default = memo25(UserBust);
7840
+ var UserBust_default = memo24(UserBust);
8116
7841
 
8117
7842
  // src/components/icons/IconChart.tsx
8118
- import { jsx as jsx124 } from "react/jsx-runtime";
7843
+ import { jsx as jsx120 } from "react/jsx-runtime";
8119
7844
  var SvgIconChart = (props) => {
8120
7845
  const { fill } = props;
8121
- return /* @__PURE__ */ jsx124(
7846
+ return /* @__PURE__ */ jsx120(
8122
7847
  "svg",
8123
7848
  {
8124
7849
  width: "20",
@@ -8127,7 +7852,7 @@ var SvgIconChart = (props) => {
8127
7852
  fill: "none",
8128
7853
  xmlns: "http://www.w3.org/2000/svg",
8129
7854
  ...props,
8130
- children: /* @__PURE__ */ jsx124(
7855
+ children: /* @__PURE__ */ jsx120(
8131
7856
  "path",
8132
7857
  {
8133
7858
  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",
@@ -8193,7 +7918,6 @@ export {
8193
7918
  ScrollableDialog_default as ScrollableDialog,
8194
7919
  SearchAndFilterHeader_default as SearchAndFilterHeader,
8195
7920
  SearchAndFilterHeaderForTable_default as SearchAndFilterHeaderForTable,
8196
- SearchFieldDebounced,
8197
7921
  SearchWithFilters_default as SearchWithFilters,
8198
7922
  SearchWithFiltersForTable_default as SearchWithFiltersForTable,
8199
7923
  SectionName_default as SectionName,
@@ -8205,9 +7929,6 @@ export {
8205
7929
  Switch_default as Switch,
8206
7930
  Table_default as Table,
8207
7931
  TableDesktop_default as TableDesktop,
8208
- TableDesktopRowActions,
8209
- TableDesktopRowCell,
8210
- TableDesktopSmartSelect,
8211
7932
  TableEmptyResult_default as TableEmptyResult,
8212
7933
  TableHeader_default as TableHeader,
8213
7934
  TableLoading_default as TableLoading,