@natoora-libs/core 0.1.11 → 0.1.13-dev-doug-3
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.
- package/dist/components/index.cjs +1142 -689
- package/dist/components/index.cjs.map +1 -1
- package/dist/components/index.d.cts +72 -14
- package/dist/components/index.d.ts +72 -14
- package/dist/components/index.js +1165 -712
- package/dist/components/index.js.map +1 -1
- package/package.json +1 -1
package/dist/components/index.js
CHANGED
|
@@ -617,7 +617,7 @@ var ExtendedButton = ({
|
|
|
617
617
|
buttonType = "button",
|
|
618
618
|
color = "noOutline",
|
|
619
619
|
disabled = false,
|
|
620
|
-
href,
|
|
620
|
+
href = "",
|
|
621
621
|
tooltip = "",
|
|
622
622
|
component = "button",
|
|
623
623
|
type,
|
|
@@ -654,7 +654,7 @@ var ExtendedButton = ({
|
|
|
654
654
|
component,
|
|
655
655
|
"data-testid": copy ? `extended-button-${copy.toLowerCase()}` : "extended-button",
|
|
656
656
|
disabled,
|
|
657
|
-
href
|
|
657
|
+
href,
|
|
658
658
|
onClick,
|
|
659
659
|
type: buttonType,
|
|
660
660
|
variant,
|
|
@@ -2781,7 +2781,7 @@ var RoundButton = ({
|
|
|
2781
2781
|
onClick(e);
|
|
2782
2782
|
}
|
|
2783
2783
|
};
|
|
2784
|
-
const
|
|
2784
|
+
const Button15 = /* @__PURE__ */ jsx63(
|
|
2785
2785
|
Fab,
|
|
2786
2786
|
{
|
|
2787
2787
|
className: cx(
|
|
@@ -2805,7 +2805,7 @@ var RoundButton = ({
|
|
|
2805
2805
|
children: icon ? iconComponentMap[icon] : children || ""
|
|
2806
2806
|
}
|
|
2807
2807
|
);
|
|
2808
|
-
return tooltip ? /* @__PURE__ */ jsx63(Tooltip2, { title: tooltip, children:
|
|
2808
|
+
return tooltip ? /* @__PURE__ */ jsx63(Tooltip2, { title: tooltip, children: Button15 }) : Button15;
|
|
2809
2809
|
};
|
|
2810
2810
|
var RoundButton_default = RoundButton;
|
|
2811
2811
|
|
|
@@ -6216,11 +6216,60 @@ var SearchAndFilterHeaderForTable = (props) => {
|
|
|
6216
6216
|
};
|
|
6217
6217
|
var SearchAndFilterHeaderForTable_default = React4.memo(SearchAndFilterHeaderForTable);
|
|
6218
6218
|
|
|
6219
|
+
// src/components/SearchFieldDebounced/SearchFieldDebounced.tsx
|
|
6220
|
+
import { useState as useState13, useRef as useRef4, useEffect as useEffect8 } from "react";
|
|
6221
|
+
import { TextField as TextField7, InputAdornment as InputAdornment3, Box as Box26 } from "@mui/material";
|
|
6222
|
+
import Search2 from "@mui/icons-material/Search";
|
|
6223
|
+
import { jsx as jsx103 } from "react/jsx-runtime";
|
|
6224
|
+
var SearchFieldDebounced = ({
|
|
6225
|
+
onSearch,
|
|
6226
|
+
initialValue = "",
|
|
6227
|
+
debounceDelay = 500
|
|
6228
|
+
}) => {
|
|
6229
|
+
const [value, setValue] = useState13(initialValue);
|
|
6230
|
+
const debounceRef = useRef4(null);
|
|
6231
|
+
const handleChange = (e) => {
|
|
6232
|
+
setValue(e.target.value);
|
|
6233
|
+
if (debounceRef.current) {
|
|
6234
|
+
clearTimeout(debounceRef.current);
|
|
6235
|
+
}
|
|
6236
|
+
;
|
|
6237
|
+
debounceRef.current = window.setTimeout(() => {
|
|
6238
|
+
onSearch(e.target.value);
|
|
6239
|
+
}, debounceDelay);
|
|
6240
|
+
};
|
|
6241
|
+
useEffect8(() => {
|
|
6242
|
+
return () => {
|
|
6243
|
+
if (debounceRef.current) clearTimeout(debounceRef.current);
|
|
6244
|
+
};
|
|
6245
|
+
}, []);
|
|
6246
|
+
return /* @__PURE__ */ jsx103(Box26, { width: 285, children: /* @__PURE__ */ jsx103(
|
|
6247
|
+
TextField7,
|
|
6248
|
+
{
|
|
6249
|
+
fullWidth: true,
|
|
6250
|
+
variant: "outlined",
|
|
6251
|
+
placeholder: "Search",
|
|
6252
|
+
value,
|
|
6253
|
+
onChange: handleChange,
|
|
6254
|
+
slotProps: {
|
|
6255
|
+
input: {
|
|
6256
|
+
sx: {
|
|
6257
|
+
maxHeight: 5,
|
|
6258
|
+
px: 2,
|
|
6259
|
+
py: 2.5
|
|
6260
|
+
},
|
|
6261
|
+
startAdornment: /* @__PURE__ */ jsx103(InputAdornment3, { position: "start", children: /* @__PURE__ */ jsx103(Search2, { fontSize: "small" }) })
|
|
6262
|
+
}
|
|
6263
|
+
}
|
|
6264
|
+
}
|
|
6265
|
+
) });
|
|
6266
|
+
};
|
|
6267
|
+
|
|
6219
6268
|
// src/components/SectionName/SectionName.tsx
|
|
6220
6269
|
import { History as History2, Info as InfoIcon } from "@mui/icons-material";
|
|
6221
|
-
import { Box as
|
|
6270
|
+
import { Box as Box27, Divider as Divider8, IconButton as IconButton3, Tooltip as Tooltip5, Typography as Typography23 } from "@mui/material";
|
|
6222
6271
|
import { makeStyles as makeStyles42 } from "tss-react/mui";
|
|
6223
|
-
import { jsx as
|
|
6272
|
+
import { jsx as jsx104, jsxs as jsxs70 } from "react/jsx-runtime";
|
|
6224
6273
|
var useStyles42 = makeStyles42()((theme) => ({
|
|
6225
6274
|
container: {
|
|
6226
6275
|
display: "flex",
|
|
@@ -6263,9 +6312,9 @@ var SectionName = ({
|
|
|
6263
6312
|
openHistoryLog
|
|
6264
6313
|
}) => {
|
|
6265
6314
|
const { classes } = useStyles42();
|
|
6266
|
-
return /* @__PURE__ */ jsxs70(
|
|
6267
|
-
/* @__PURE__ */ jsxs70(
|
|
6268
|
-
/* @__PURE__ */
|
|
6315
|
+
return /* @__PURE__ */ jsxs70(Box27, { className: classes.container, children: [
|
|
6316
|
+
/* @__PURE__ */ jsxs70(Box27, { className: classes.titleContainer, children: [
|
|
6317
|
+
/* @__PURE__ */ jsx104(
|
|
6269
6318
|
Typography23,
|
|
6270
6319
|
{
|
|
6271
6320
|
variant: "h5",
|
|
@@ -6275,7 +6324,7 @@ var SectionName = ({
|
|
|
6275
6324
|
children: name
|
|
6276
6325
|
}
|
|
6277
6326
|
),
|
|
6278
|
-
tooltipDescription ? /* @__PURE__ */
|
|
6327
|
+
tooltipDescription ? /* @__PURE__ */ jsx104(Tooltip5, { title: tooltipDescription, placement: "right", children: /* @__PURE__ */ jsx104(
|
|
6279
6328
|
InfoIcon,
|
|
6280
6329
|
{
|
|
6281
6330
|
fontSize: "small",
|
|
@@ -6284,8 +6333,8 @@ var SectionName = ({
|
|
|
6284
6333
|
}
|
|
6285
6334
|
) }) : null
|
|
6286
6335
|
] }),
|
|
6287
|
-
/* @__PURE__ */ jsxs70(
|
|
6288
|
-
buttonText ? /* @__PURE__ */
|
|
6336
|
+
/* @__PURE__ */ jsxs70(Box27, { className: classes.actionButtons, children: [
|
|
6337
|
+
buttonText ? /* @__PURE__ */ jsx104(
|
|
6289
6338
|
ExtendedButton_default,
|
|
6290
6339
|
{
|
|
6291
6340
|
type: buttonType,
|
|
@@ -6298,15 +6347,15 @@ var SectionName = ({
|
|
|
6298
6347
|
variant: "text"
|
|
6299
6348
|
}
|
|
6300
6349
|
) : null,
|
|
6301
|
-
openHistoryLog && buttonText && /* @__PURE__ */
|
|
6302
|
-
openHistoryLog && /* @__PURE__ */
|
|
6350
|
+
openHistoryLog && buttonText && /* @__PURE__ */ jsx104(Divider8, { orientation: "vertical", sx: { height: "24px" } }),
|
|
6351
|
+
openHistoryLog && /* @__PURE__ */ jsx104(IconButton3, { size: "small", onClick: () => openHistoryLog(), children: /* @__PURE__ */ jsx104(History2, {}) })
|
|
6303
6352
|
] })
|
|
6304
6353
|
] });
|
|
6305
6354
|
};
|
|
6306
6355
|
var SectionName_default = SectionName;
|
|
6307
6356
|
|
|
6308
6357
|
// src/components/SmartSelect/SmartSelect.tsx
|
|
6309
|
-
import { forwardRef as forwardRef2, useState as
|
|
6358
|
+
import { forwardRef as forwardRef2, useState as useState14, useEffect as useEffect9 } from "react";
|
|
6310
6359
|
import {
|
|
6311
6360
|
CircularProgress as CircularProgress4,
|
|
6312
6361
|
FormControl as FormControl4,
|
|
@@ -6316,7 +6365,7 @@ import {
|
|
|
6316
6365
|
Select as Select3
|
|
6317
6366
|
} from "@mui/material";
|
|
6318
6367
|
import { makeStyles as makeStyles43 } from "tss-react/mui";
|
|
6319
|
-
import { jsx as
|
|
6368
|
+
import { jsx as jsx105, jsxs as jsxs71 } from "react/jsx-runtime";
|
|
6320
6369
|
var useStyles43 = makeStyles43()(() => ({
|
|
6321
6370
|
container: {
|
|
6322
6371
|
display: "flex",
|
|
@@ -6342,9 +6391,9 @@ var SmartSelect = forwardRef2(
|
|
|
6342
6391
|
menuProps
|
|
6343
6392
|
}, ref) => {
|
|
6344
6393
|
const { classes } = useStyles43();
|
|
6345
|
-
const [open, setOpen] =
|
|
6346
|
-
const [localOptions, setLocalOptions] =
|
|
6347
|
-
|
|
6394
|
+
const [open, setOpen] = useState14(false);
|
|
6395
|
+
const [localOptions, setLocalOptions] = useState14(options || []);
|
|
6396
|
+
useEffect9(() => {
|
|
6348
6397
|
if (options) {
|
|
6349
6398
|
setLocalOptions(options);
|
|
6350
6399
|
}
|
|
@@ -6393,7 +6442,7 @@ var SmartSelect = forwardRef2(
|
|
|
6393
6442
|
"data-testid": dataTestId,
|
|
6394
6443
|
disabled,
|
|
6395
6444
|
children: [
|
|
6396
|
-
inputLabel && /* @__PURE__ */
|
|
6445
|
+
inputLabel && /* @__PURE__ */ jsx105(
|
|
6397
6446
|
InputLabel4,
|
|
6398
6447
|
{
|
|
6399
6448
|
id: "smart-select-label",
|
|
@@ -6407,7 +6456,7 @@ var SmartSelect = forwardRef2(
|
|
|
6407
6456
|
ref,
|
|
6408
6457
|
disabled,
|
|
6409
6458
|
labelId: "smart-select-label",
|
|
6410
|
-
value,
|
|
6459
|
+
value: value ?? "",
|
|
6411
6460
|
onChange: handleChange,
|
|
6412
6461
|
onOpen: handleOpen,
|
|
6413
6462
|
error,
|
|
@@ -6418,17 +6467,17 @@ var SmartSelect = forwardRef2(
|
|
|
6418
6467
|
MenuProps: menuProps,
|
|
6419
6468
|
label: inputLabel,
|
|
6420
6469
|
children: [
|
|
6421
|
-
isFetching && /* @__PURE__ */
|
|
6470
|
+
isFetching && /* @__PURE__ */ jsx105(
|
|
6422
6471
|
MenuItem3,
|
|
6423
6472
|
{
|
|
6424
6473
|
disabled: true,
|
|
6425
6474
|
"data-testid": `${dataTestId}-loading`,
|
|
6426
6475
|
id: `${dataTestId}-loading`,
|
|
6427
|
-
children: /* @__PURE__ */
|
|
6476
|
+
children: /* @__PURE__ */ jsx105(CircularProgress4, { size: 24 })
|
|
6428
6477
|
}
|
|
6429
6478
|
),
|
|
6430
|
-
(defaultOption === null || !defaultOptionLabelIsValid || !defaultOptionValueIsValid) && !isFetching && options?.length === 0 && /* @__PURE__ */
|
|
6431
|
-
localOptions.length === 0 && !isFetching && options?.length !== 0 && defaultOptionLabelIsValid && defaultOptionValueIsValid && /* @__PURE__ */
|
|
6479
|
+
(defaultOption === null || !defaultOptionLabelIsValid || !defaultOptionValueIsValid) && !isFetching && options?.length === 0 && /* @__PURE__ */ jsx105(MenuItem3, { disabled: true, "data-testid": `${dataTestId}-empty-message`, children: emptyMessage }),
|
|
6480
|
+
localOptions.length === 0 && !isFetching && options?.length !== 0 && defaultOptionLabelIsValid && defaultOptionValueIsValid && /* @__PURE__ */ jsx105(
|
|
6432
6481
|
MenuItem3,
|
|
6433
6482
|
{
|
|
6434
6483
|
value: defaultOption?.value,
|
|
@@ -6436,7 +6485,7 @@ var SmartSelect = forwardRef2(
|
|
|
6436
6485
|
children: defaultOption?.label
|
|
6437
6486
|
}
|
|
6438
6487
|
),
|
|
6439
|
-
!isFetching && combinedOptions.length > 0 && combinedOptions.map((option) => /* @__PURE__ */
|
|
6488
|
+
!isFetching && combinedOptions.length > 0 && combinedOptions.map((option) => /* @__PURE__ */ jsx105(
|
|
6440
6489
|
MenuItem3,
|
|
6441
6490
|
{
|
|
6442
6491
|
value: option?.value,
|
|
@@ -6449,7 +6498,7 @@ var SmartSelect = forwardRef2(
|
|
|
6449
6498
|
]
|
|
6450
6499
|
}
|
|
6451
6500
|
),
|
|
6452
|
-
helperText && /* @__PURE__ */
|
|
6501
|
+
helperText && /* @__PURE__ */ jsx105(FormHelperText3, { "data-testid": `${dataTestId}-helper-text`, children: helperText })
|
|
6453
6502
|
]
|
|
6454
6503
|
}
|
|
6455
6504
|
);
|
|
@@ -6462,7 +6511,7 @@ import { memo as memo18 } from "react";
|
|
|
6462
6511
|
import { Typography as Typography24 } from "@mui/material";
|
|
6463
6512
|
import red2 from "@mui/material/colors/red";
|
|
6464
6513
|
import { makeStyles as makeStyles44 } from "tss-react/mui";
|
|
6465
|
-
import { jsx as
|
|
6514
|
+
import { jsx as jsx106 } from "react/jsx-runtime";
|
|
6466
6515
|
var useStyles44 = makeStyles44()((theme) => ({
|
|
6467
6516
|
red: {
|
|
6468
6517
|
backgroundColor: red2["50"],
|
|
@@ -6477,7 +6526,7 @@ var useStyles44 = makeStyles44()((theme) => ({
|
|
|
6477
6526
|
}));
|
|
6478
6527
|
var SquareLabel = ({ color, copy }) => {
|
|
6479
6528
|
const { classes } = useStyles44();
|
|
6480
|
-
return /* @__PURE__ */
|
|
6529
|
+
return /* @__PURE__ */ jsx106(Typography24, { className: classes[color], children: copy });
|
|
6481
6530
|
};
|
|
6482
6531
|
var SquareLabel_default = memo18(SquareLabel);
|
|
6483
6532
|
|
|
@@ -6485,7 +6534,7 @@ var SquareLabel_default = memo18(SquareLabel);
|
|
|
6485
6534
|
import { memo as memo19 } from "react";
|
|
6486
6535
|
import { Grid2, Switch } from "@mui/material";
|
|
6487
6536
|
import { withStyles as withStyles6 } from "tss-react/mui";
|
|
6488
|
-
import { jsx as
|
|
6537
|
+
import { jsx as jsx107, jsxs as jsxs72 } from "react/jsx-runtime";
|
|
6489
6538
|
var LSwitch = ({
|
|
6490
6539
|
checked,
|
|
6491
6540
|
labelOn,
|
|
@@ -6493,7 +6542,7 @@ var LSwitch = ({
|
|
|
6493
6542
|
handleChange,
|
|
6494
6543
|
classes,
|
|
6495
6544
|
disabled
|
|
6496
|
-
}) => /* @__PURE__ */
|
|
6545
|
+
}) => /* @__PURE__ */ jsx107("div", { className: classes.c_switch, children: /* @__PURE__ */ jsxs72(
|
|
6497
6546
|
Grid2,
|
|
6498
6547
|
{
|
|
6499
6548
|
component: "label",
|
|
@@ -6503,8 +6552,8 @@ var LSwitch = ({
|
|
|
6503
6552
|
alignItems: "center"
|
|
6504
6553
|
},
|
|
6505
6554
|
children: [
|
|
6506
|
-
labelOff && /* @__PURE__ */
|
|
6507
|
-
/* @__PURE__ */
|
|
6555
|
+
labelOff && /* @__PURE__ */ jsx107(Grid2, { children: labelOff }),
|
|
6556
|
+
/* @__PURE__ */ jsx107(Grid2, { children: /* @__PURE__ */ jsx107(
|
|
6508
6557
|
Switch,
|
|
6509
6558
|
{
|
|
6510
6559
|
checked,
|
|
@@ -6513,7 +6562,7 @@ var LSwitch = ({
|
|
|
6513
6562
|
disabled
|
|
6514
6563
|
}
|
|
6515
6564
|
) }),
|
|
6516
|
-
labelOn && /* @__PURE__ */
|
|
6565
|
+
labelOn && /* @__PURE__ */ jsx107(Grid2, { children: labelOn })
|
|
6517
6566
|
]
|
|
6518
6567
|
}
|
|
6519
6568
|
) });
|
|
@@ -6538,256 +6587,52 @@ var LabelledSwitch = withStyles6(LSwitch, (theme) => ({
|
|
|
6538
6587
|
var Switch_default = memo19(LabelledSwitch);
|
|
6539
6588
|
|
|
6540
6589
|
// src/components/SmartTableHeaderFilterMenu/SmartTableHeaderFilterMenu.tsx
|
|
6541
|
-
import { useMemo as
|
|
6590
|
+
import { useMemo as useMemo3, useState as useState16, useEffect as useEffect11, memo as memo21 } from "react";
|
|
6542
6591
|
import CheckIcon from "@mui/icons-material/Check";
|
|
6543
6592
|
import {
|
|
6544
|
-
Box as
|
|
6545
|
-
Checkbox as
|
|
6593
|
+
Box as Box29,
|
|
6594
|
+
Checkbox as Checkbox5,
|
|
6546
6595
|
Divider as Divider9,
|
|
6547
6596
|
FormControlLabel as FormControlLabel3,
|
|
6548
6597
|
Menu as Menu4,
|
|
6549
|
-
Skeleton as
|
|
6598
|
+
Skeleton as Skeleton3,
|
|
6550
6599
|
Tooltip as Tooltip6
|
|
6551
6600
|
} from "@mui/material";
|
|
6552
6601
|
import classNames3 from "classnames";
|
|
6553
|
-
import { makeStyles as
|
|
6554
|
-
|
|
6555
|
-
|
|
6556
|
-
|
|
6557
|
-
|
|
6558
|
-
|
|
6559
|
-
|
|
6560
|
-
|
|
6561
|
-
|
|
6562
|
-
|
|
6563
|
-
|
|
6564
|
-
|
|
6565
|
-
|
|
6566
|
-
|
|
6567
|
-
|
|
6568
|
-
|
|
6569
|
-
|
|
6570
|
-
|
|
6571
|
-
|
|
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);
|
|
6602
|
+
import { makeStyles as makeStyles48 } from "tss-react/mui";
|
|
6603
|
+
|
|
6604
|
+
// src/components/TableDesktop/TableDesktop.tsx
|
|
6605
|
+
import {
|
|
6606
|
+
useCallback as useCallback2,
|
|
6607
|
+
useMemo as useMemo2,
|
|
6608
|
+
useState as useState15,
|
|
6609
|
+
useEffect as useEffect10
|
|
6610
|
+
} from "react";
|
|
6611
|
+
import {
|
|
6612
|
+
Paper as Paper10,
|
|
6613
|
+
Table,
|
|
6614
|
+
TableBody as TableBody2,
|
|
6615
|
+
TableContainer,
|
|
6616
|
+
Skeleton as Skeleton2,
|
|
6617
|
+
TableRow as TableRow4,
|
|
6618
|
+
TableCell as TableCell4
|
|
6619
|
+
} from "@mui/material";
|
|
6620
|
+
import { makeStyles as makeStyles47 } from "tss-react/mui";
|
|
6778
6621
|
|
|
6779
6622
|
// src/components/SmartTableHeader/SmartTableHeader.tsx
|
|
6780
|
-
import { memo as
|
|
6623
|
+
import { memo as memo20 } from "react";
|
|
6781
6624
|
import {
|
|
6782
|
-
|
|
6625
|
+
Box as Box28,
|
|
6626
|
+
Checkbox as Checkbox4,
|
|
6783
6627
|
TableCell,
|
|
6784
6628
|
TableHead,
|
|
6785
6629
|
TableRow,
|
|
6786
|
-
TableSortLabel
|
|
6630
|
+
TableSortLabel,
|
|
6631
|
+
Typography as Typography25
|
|
6787
6632
|
} from "@mui/material";
|
|
6788
|
-
import { makeStyles as
|
|
6789
|
-
import { jsx as jsx108, jsxs as
|
|
6790
|
-
var
|
|
6633
|
+
import { makeStyles as makeStyles45 } from "tss-react/mui";
|
|
6634
|
+
import { jsx as jsx108, jsxs as jsxs73 } from "react/jsx-runtime";
|
|
6635
|
+
var useStyles45 = makeStyles45()((theme) => ({
|
|
6791
6636
|
root: {
|
|
6792
6637
|
backgroundColor: colors.neutral100,
|
|
6793
6638
|
height: theme.spacing(6),
|
|
@@ -6809,7 +6654,7 @@ var useStyles46 = makeStyles46()((theme) => ({
|
|
|
6809
6654
|
},
|
|
6810
6655
|
tableHeaderContent: {
|
|
6811
6656
|
borderBottom: "1px solid",
|
|
6812
|
-
borderBottomColor: colors.
|
|
6657
|
+
borderBottomColor: colors.neutral300,
|
|
6813
6658
|
whiteSpace: "nowrap",
|
|
6814
6659
|
"& .filter-menu-trigger": {
|
|
6815
6660
|
visibility: "hidden",
|
|
@@ -6854,268 +6699,103 @@ var SmartTableHeader = ({
|
|
|
6854
6699
|
onApplyFilters,
|
|
6855
6700
|
shouldShowCheckOnFilter
|
|
6856
6701
|
}) => {
|
|
6857
|
-
const { classes } =
|
|
6702
|
+
const { classes } = useStyles45();
|
|
6858
6703
|
const createSortHandler = (property) => (event) => {
|
|
6859
6704
|
onRequestSort(event, property);
|
|
6860
6705
|
};
|
|
6861
6706
|
const isSortActive = (headCellId) => orderBy === headCellId;
|
|
6862
|
-
return /* @__PURE__ */ jsx108(TableHead, { className: classes.root, children: /* @__PURE__ */
|
|
6707
|
+
return /* @__PURE__ */ jsx108(TableHead, { className: classes.root, children: /* @__PURE__ */ jsxs73(TableRow, { children: [
|
|
6863
6708
|
enableCheckboxSelection ? /* @__PURE__ */ jsx108(TableCell, { padding: "checkbox", children: /* @__PURE__ */ jsx108(
|
|
6864
|
-
|
|
6709
|
+
Checkbox4,
|
|
6865
6710
|
{
|
|
6866
6711
|
color: "primary",
|
|
6712
|
+
disableRipple: true,
|
|
6867
6713
|
indeterminate: numSelected > 0 && numSelected < numRows,
|
|
6868
6714
|
checked: numRows > 0 && numSelected === numRows,
|
|
6869
6715
|
onChange: onSelectAllClick
|
|
6870
6716
|
}
|
|
6871
6717
|
) }) : null,
|
|
6872
|
-
headCells.map((headCell) => /* @__PURE__ */
|
|
6718
|
+
headCells.map((headCell) => /* @__PURE__ */ jsx108(
|
|
6873
6719
|
TableCell,
|
|
6874
6720
|
{
|
|
6875
6721
|
className: classes.tableHeaderContent,
|
|
6876
6722
|
align: "left",
|
|
6877
|
-
|
|
6723
|
+
width: headCell.width ?? "auto",
|
|
6878
6724
|
sortDirection: orderBy === headCell.id ? order : false,
|
|
6879
|
-
children:
|
|
6880
|
-
|
|
6881
|
-
|
|
6882
|
-
|
|
6883
|
-
|
|
6884
|
-
|
|
6885
|
-
|
|
6886
|
-
|
|
6887
|
-
|
|
6888
|
-
|
|
6889
|
-
|
|
6890
|
-
|
|
6891
|
-
|
|
6892
|
-
|
|
6893
|
-
|
|
6894
|
-
|
|
6895
|
-
|
|
6896
|
-
|
|
6897
|
-
|
|
6898
|
-
|
|
6899
|
-
|
|
6900
|
-
|
|
6901
|
-
|
|
6902
|
-
|
|
6903
|
-
|
|
6725
|
+
children: /* @__PURE__ */ jsxs73(
|
|
6726
|
+
Box28,
|
|
6727
|
+
{
|
|
6728
|
+
display: "flex",
|
|
6729
|
+
flexDirection: "row",
|
|
6730
|
+
gap: headCell.disableSort ? 1 : 0,
|
|
6731
|
+
children: [
|
|
6732
|
+
headCell.disableSort ? /* @__PURE__ */ jsx108(Typography25, { variant: "subtitle2", mt: 0.25, fontWeight: 600, children: headCell.label }) : /* @__PURE__ */ jsxs73(
|
|
6733
|
+
TableSortLabel,
|
|
6734
|
+
{
|
|
6735
|
+
"data-testid": "table-sort-label",
|
|
6736
|
+
active: isSortActive(headCell.id),
|
|
6737
|
+
direction: orderBy === headCell.id ? order : "asc",
|
|
6738
|
+
onClick: createSortHandler(headCell.id),
|
|
6739
|
+
children: [
|
|
6740
|
+
headCell.RenderHeader ?? headCell.label,
|
|
6741
|
+
orderBy === headCell.id ? /* @__PURE__ */ jsx108("span", { className: classes.visuallyHidden, children: order === "desc" ? "sorted descending" : "sorted ascending" }) : null
|
|
6742
|
+
]
|
|
6743
|
+
}
|
|
6744
|
+
),
|
|
6745
|
+
headCell.refetchFilterOptions ? /* @__PURE__ */ jsx108(
|
|
6746
|
+
SmartTableHeaderFilterMenu_default,
|
|
6747
|
+
{
|
|
6748
|
+
headCell,
|
|
6749
|
+
headerFilters,
|
|
6750
|
+
numActiveFilters: headerFilters[headCell.id]?.length ?? 0,
|
|
6751
|
+
onApplyFilters,
|
|
6752
|
+
shouldShowCheckOnFilter
|
|
6753
|
+
}
|
|
6754
|
+
) : null
|
|
6755
|
+
]
|
|
6756
|
+
}
|
|
6757
|
+
)
|
|
6904
6758
|
},
|
|
6905
6759
|
headCell.id
|
|
6906
6760
|
))
|
|
6907
6761
|
] }) });
|
|
6908
6762
|
};
|
|
6909
|
-
var SmartTableHeader_default =
|
|
6910
|
-
|
|
6911
|
-
// src/components/
|
|
6912
|
-
|
|
6913
|
-
import
|
|
6914
|
-
import
|
|
6915
|
-
|
|
6916
|
-
|
|
6917
|
-
|
|
6918
|
-
|
|
6919
|
-
TableCell as TableCell2,
|
|
6920
|
-
TableContainer,
|
|
6921
|
-
TableHead as TableHead2,
|
|
6922
|
-
TableRow as TableRow2,
|
|
6923
|
-
TableSortLabel as TableSortLabel2
|
|
6924
|
-
} from "@mui/material";
|
|
6925
|
-
import { makeStyles as makeStyles47 } from "tss-react/mui";
|
|
6926
|
-
import { v4 as uuidv4 } from "uuid";
|
|
6927
|
-
|
|
6928
|
-
// src/components/TableLoading/TableLoading.tsx
|
|
6929
|
-
import { Box as Box28, Skeleton as Skeleton3 } from "@mui/material";
|
|
6930
|
-
import { jsx as jsx109 } from "react/jsx-runtime";
|
|
6931
|
-
var TableLoading = ({
|
|
6932
|
-
rowsPerPage,
|
|
6933
|
-
rowHeight
|
|
6934
|
-
}) => /* @__PURE__ */ jsx109(Box28, { children: Array.from({ length: rowsPerPage ?? 0 }).map((_, index) => /* @__PURE__ */ jsx109(
|
|
6935
|
-
Skeleton3,
|
|
6763
|
+
var SmartTableHeader_default = memo20(SmartTableHeader);
|
|
6764
|
+
|
|
6765
|
+
// src/components/TableDesktopNoColumnsMessage/TableDesktopNoColumnsMessage.tsx
|
|
6766
|
+
import TableBody from "@mui/material/TableBody";
|
|
6767
|
+
import TableCell2 from "@mui/material/TableCell";
|
|
6768
|
+
import TableRow2 from "@mui/material/TableRow";
|
|
6769
|
+
import Typography26 from "@mui/material/Typography";
|
|
6770
|
+
import { jsx as jsx109, jsxs as jsxs74 } from "react/jsx-runtime";
|
|
6771
|
+
var TableDesktopNoColumnsMessage = () => /* @__PURE__ */ jsx109(TableBody, { children: /* @__PURE__ */ jsx109(TableRow2, { children: /* @__PURE__ */ jsxs74(
|
|
6772
|
+
TableCell2,
|
|
6936
6773
|
{
|
|
6937
|
-
|
|
6938
|
-
|
|
6939
|
-
|
|
6940
|
-
|
|
6941
|
-
|
|
6942
|
-
|
|
6943
|
-
|
|
6944
|
-
|
|
6945
|
-
|
|
6946
|
-
|
|
6947
|
-
|
|
6948
|
-
|
|
6949
|
-
|
|
6950
|
-
|
|
6951
|
-
|
|
6952
|
-
|
|
6953
|
-
|
|
6954
|
-
}
|
|
6955
|
-
return a[1] - b[1];
|
|
6956
|
-
});
|
|
6957
|
-
return stabilizedThis.map((el) => el[0]);
|
|
6958
|
-
}
|
|
6959
|
-
function descendingComparator(a, b, orderBy) {
|
|
6960
|
-
if (b[orderBy] < a[orderBy]) {
|
|
6961
|
-
return -1;
|
|
6962
|
-
}
|
|
6963
|
-
if (b[orderBy] > a[orderBy]) {
|
|
6964
|
-
return 1;
|
|
6965
|
-
}
|
|
6966
|
-
return 0;
|
|
6967
|
-
}
|
|
6968
|
-
function getSorting(order, orderBy) {
|
|
6969
|
-
return order === "desc" ? (a, b) => descendingComparator(a, b, orderBy) : (a, b) => -descendingComparator(a, b, orderBy);
|
|
6970
|
-
}
|
|
6971
|
-
function calculateRowsPerPage(rowHeight) {
|
|
6972
|
-
const appContainerDom = document.getElementById("mainContainer");
|
|
6973
|
-
const headerDom = document.getElementById("aboveTableHeader");
|
|
6974
|
-
if (appContainerDom && headerDom) {
|
|
6975
|
-
return Math.floor(
|
|
6976
|
-
(appContainerDom.clientHeight - headerDom.clientHeight - 24) / rowHeight - 2
|
|
6977
|
-
);
|
|
6978
|
-
}
|
|
6979
|
-
return 1;
|
|
6980
|
-
}
|
|
6981
|
-
|
|
6982
|
-
// src/components/Table/Table.tsx
|
|
6983
|
-
import { jsx as jsx110, jsxs as jsxs75 } from "react/jsx-runtime";
|
|
6984
|
-
var useStyles47 = makeStyles47()(() => ({
|
|
6985
|
-
root: {
|
|
6986
|
-
height: "calc(100vh - 262px)",
|
|
6987
|
-
overflow: "scroll"
|
|
6988
|
-
},
|
|
6989
|
-
paper: {
|
|
6990
|
-
width: "100%",
|
|
6991
|
-
display: "flex",
|
|
6992
|
-
flexDirection: "column",
|
|
6993
|
-
justifyContent: "space-between"
|
|
6994
|
-
},
|
|
6995
|
-
header: {
|
|
6996
|
-
"& .MuiTableSortLabel-root": {
|
|
6997
|
-
fontWeight: 600,
|
|
6998
|
-
fontSize: ".875rem"
|
|
6999
|
-
}
|
|
7000
|
-
},
|
|
7001
|
-
container: {
|
|
7002
|
-
maxHeight: "calc(100% - 0)"
|
|
6774
|
+
sx: {
|
|
6775
|
+
py: 8,
|
|
6776
|
+
gap: 2,
|
|
6777
|
+
borderBottom: "none",
|
|
6778
|
+
display: "flex",
|
|
6779
|
+
flexDirection: "column",
|
|
6780
|
+
justifyContent: "center",
|
|
6781
|
+
alignItems: "center"
|
|
6782
|
+
},
|
|
6783
|
+
children: [
|
|
6784
|
+
/* @__PURE__ */ jsx109(Typography26, { variant: "subtitle2", fontSize: 16, children: "Customise your view" }),
|
|
6785
|
+
/* @__PURE__ */ jsxs74(Typography26, { variant: "subtitle1", align: "center", color: "textSecondary", children: [
|
|
6786
|
+
"Use the column selector on the right to choose which fields",
|
|
6787
|
+
/* @__PURE__ */ jsx109("br", {}),
|
|
6788
|
+
"you want to display in the table"
|
|
6789
|
+
] })
|
|
6790
|
+
]
|
|
7003
6791
|
}
|
|
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";
|
|
6792
|
+
) }) });
|
|
7113
6793
|
|
|
7114
6794
|
// src/components/TableEmptyResult/TableEmptyResult.tsx
|
|
7115
|
-
import { TableCell as TableCell3, TableRow as TableRow3, Typography as
|
|
7116
|
-
import { makeStyles as
|
|
7117
|
-
import { jsx as
|
|
7118
|
-
var
|
|
6795
|
+
import { TableCell as TableCell3, TableRow as TableRow3, Typography as Typography27 } from "@mui/material";
|
|
6796
|
+
import { makeStyles as makeStyles46 } from "tss-react/mui";
|
|
6797
|
+
import { jsx as jsx110, jsxs as jsxs75 } from "react/jsx-runtime";
|
|
6798
|
+
var useStyles46 = makeStyles46()(() => ({
|
|
7119
6799
|
tableCellIcon: { padding: 24, height: "calc(100vh - 320px)" },
|
|
7120
6800
|
tableCellDefault: { padding: 24 }
|
|
7121
6801
|
}));
|
|
@@ -7125,18 +6805,18 @@ var TableEmptyResult = ({
|
|
|
7125
6805
|
handleClickOnClearFiltersButton = () => {
|
|
7126
6806
|
}
|
|
7127
6807
|
}) => {
|
|
7128
|
-
const { classes } =
|
|
7129
|
-
return showClearFilterButton ? /* @__PURE__ */
|
|
6808
|
+
const { classes } = useStyles46();
|
|
6809
|
+
return showClearFilterButton ? /* @__PURE__ */ jsx110(TableRow3, { children: /* @__PURE__ */ jsxs75(
|
|
7130
6810
|
TableCell3,
|
|
7131
6811
|
{
|
|
7132
6812
|
className: classes.tableCellIcon,
|
|
7133
6813
|
colSpan,
|
|
7134
6814
|
align: "center",
|
|
7135
6815
|
children: [
|
|
7136
|
-
/* @__PURE__ */
|
|
7137
|
-
/* @__PURE__ */
|
|
7138
|
-
/* @__PURE__ */
|
|
7139
|
-
/* @__PURE__ */
|
|
6816
|
+
/* @__PURE__ */ jsx110(EmptyGlassIcon_default, {}),
|
|
6817
|
+
/* @__PURE__ */ jsx110(Typography27, { variant: "h6", children: "No results found." }),
|
|
6818
|
+
/* @__PURE__ */ jsx110(Typography27, { variant: "subtitle1", children: "Search without applied filters?" }),
|
|
6819
|
+
/* @__PURE__ */ jsx110(
|
|
7140
6820
|
FilledButton_default,
|
|
7141
6821
|
{
|
|
7142
6822
|
copy: "Search",
|
|
@@ -7147,7 +6827,7 @@ var TableEmptyResult = ({
|
|
|
7147
6827
|
)
|
|
7148
6828
|
]
|
|
7149
6829
|
}
|
|
7150
|
-
) }) : /* @__PURE__ */
|
|
6830
|
+
) }) : /* @__PURE__ */ jsx110(TableRow3, { children: /* @__PURE__ */ jsx110(
|
|
7151
6831
|
TableCell3,
|
|
7152
6832
|
{
|
|
7153
6833
|
className: classes.tableCellDefault,
|
|
@@ -7160,8 +6840,9 @@ var TableEmptyResult = ({
|
|
|
7160
6840
|
var TableEmptyResult_default = TableEmptyResult;
|
|
7161
6841
|
|
|
7162
6842
|
// src/components/TableDesktop/TableDesktop.tsx
|
|
7163
|
-
import { jsx as
|
|
7164
|
-
var
|
|
6843
|
+
import { Fragment as Fragment11, jsx as jsx111, jsxs as jsxs76 } from "react/jsx-runtime";
|
|
6844
|
+
var ROW_HEIGHT = 56;
|
|
6845
|
+
var useStyles47 = makeStyles47()((theme) => ({
|
|
7165
6846
|
root: {
|
|
7166
6847
|
justifyContent: "space-between",
|
|
7167
6848
|
display: "flex",
|
|
@@ -7191,7 +6872,7 @@ var useStyles49 = makeStyles49()((theme) => ({
|
|
|
7191
6872
|
}
|
|
7192
6873
|
}
|
|
7193
6874
|
}));
|
|
7194
|
-
var
|
|
6875
|
+
var descendingComparator = (a, b, orderBy) => {
|
|
7195
6876
|
const objA = a[orderBy];
|
|
7196
6877
|
const objB = b[orderBy];
|
|
7197
6878
|
const valA = typeof objA === "object" ? objA?.name : objA;
|
|
@@ -7213,11 +6894,17 @@ var descendingComparator2 = (a, b, orderBy) => {
|
|
|
7213
6894
|
}
|
|
7214
6895
|
return 0;
|
|
7215
6896
|
};
|
|
7216
|
-
var
|
|
6897
|
+
var stableSort = (array, cmp) => array.map((el, index) => ({ el, index })).sort((a, b) => {
|
|
7217
6898
|
const order = cmp(a.el, b.el);
|
|
7218
6899
|
return order !== 0 ? order : a.index - b.index;
|
|
7219
6900
|
}).map((el) => el.el);
|
|
7220
|
-
var getComparator = (order, orderBy) => order === "desc" ? (a, b) =>
|
|
6901
|
+
var getComparator = (order, orderBy) => order === "desc" ? (a, b) => descendingComparator(a, b, orderBy) : (a, b) => -descendingComparator(a, b, orderBy);
|
|
6902
|
+
var resolveOptionType = (option, fieldName) => {
|
|
6903
|
+
if (!option || typeof option !== "object") {
|
|
6904
|
+
return option;
|
|
6905
|
+
}
|
|
6906
|
+
return option[fieldName] || "";
|
|
6907
|
+
};
|
|
7221
6908
|
var TableDesktop = ({
|
|
7222
6909
|
data,
|
|
7223
6910
|
headCells,
|
|
@@ -7227,45 +6914,507 @@ var TableDesktop = ({
|
|
|
7227
6914
|
children,
|
|
7228
6915
|
height,
|
|
7229
6916
|
isLoading,
|
|
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
|
|
6917
|
+
rowsPerPage = 50,
|
|
6918
|
+
enableCheckboxSelection = false,
|
|
6919
|
+
disableInternalSort = false,
|
|
6920
|
+
updateSort,
|
|
6921
|
+
showClearFilterButton,
|
|
6922
|
+
handleClickOnClearFiltersButton,
|
|
6923
|
+
deleteItem,
|
|
6924
|
+
keyField = "id",
|
|
6925
|
+
tableLayout = "auto",
|
|
6926
|
+
onApplyFilters,
|
|
6927
|
+
shouldShowCheckOnFilter
|
|
6928
|
+
}) => {
|
|
6929
|
+
const { classes } = useStyles47();
|
|
6930
|
+
const [order, setOrder] = useState15(appliedFilters?.sortDir || "desc");
|
|
6931
|
+
const [orderBy, setOrderBy] = useState15(
|
|
6932
|
+
appliedFilters?.sortField || "delivery_date"
|
|
6933
|
+
);
|
|
6934
|
+
const [selected, setSelected] = useState15(/* @__PURE__ */ new Set());
|
|
6935
|
+
const [page] = useState15(0);
|
|
6936
|
+
const numRows = data.length;
|
|
6937
|
+
const emptyRows = useMemo2(
|
|
6938
|
+
() => rowsPerPage - data.length,
|
|
6939
|
+
[rowsPerPage, data]
|
|
6940
|
+
);
|
|
6941
|
+
const visibleHeadCells = useMemo2(
|
|
6942
|
+
() => headCells.filter((headCell) => headCell?.enabled ?? true),
|
|
6943
|
+
[headCells]
|
|
6944
|
+
);
|
|
6945
|
+
const handleSelectAllClick = useCallback2(
|
|
6946
|
+
(event) => {
|
|
6947
|
+
if (event.target.checked) {
|
|
6948
|
+
const allItems = new Set(data.map((n) => n[keyField]));
|
|
6949
|
+
setSelected(allItems);
|
|
6950
|
+
} else {
|
|
6951
|
+
setSelected(/* @__PURE__ */ new Set());
|
|
6952
|
+
}
|
|
6953
|
+
},
|
|
6954
|
+
[data, keyField]
|
|
6955
|
+
);
|
|
6956
|
+
const handleRequestSort = (event, property) => {
|
|
6957
|
+
const isAsc = orderBy === property && order === "asc";
|
|
6958
|
+
const orderDir = isAsc ? "desc" : "asc";
|
|
6959
|
+
setOrder(orderDir);
|
|
6960
|
+
setOrderBy(property);
|
|
6961
|
+
if (updateSort) {
|
|
6962
|
+
updateSort(property, orderDir);
|
|
6963
|
+
}
|
|
6964
|
+
};
|
|
6965
|
+
const handleRowCheckboxChange = useCallback2(
|
|
6966
|
+
(event, keyFieldValue) => {
|
|
6967
|
+
event.stopPropagation();
|
|
6968
|
+
setSelected((prev) => {
|
|
6969
|
+
const newSelected = new Set(prev);
|
|
6970
|
+
if (newSelected.has(keyFieldValue)) {
|
|
6971
|
+
newSelected.delete(keyFieldValue);
|
|
6972
|
+
} else {
|
|
6973
|
+
newSelected.add(keyFieldValue);
|
|
6974
|
+
}
|
|
6975
|
+
return newSelected;
|
|
6976
|
+
});
|
|
6977
|
+
},
|
|
6978
|
+
[]
|
|
6979
|
+
);
|
|
6980
|
+
const renderTableRows = useMemo2(() => {
|
|
6981
|
+
if (isLoading) {
|
|
6982
|
+
return [...Array(Math.min(numRows, rowsPerPage))].map((_, rowIndex) => /* @__PURE__ */ jsx111(TableRow4, { children: [...Array(visibleHeadCells.length)].map((_2, cellIndex) => /* @__PURE__ */ jsx111(TableCell4, { children: /* @__PURE__ */ jsx111(
|
|
6983
|
+
Skeleton2,
|
|
6984
|
+
{
|
|
6985
|
+
animation: "pulse",
|
|
6986
|
+
variant: "rounded",
|
|
6987
|
+
height: ROW_HEIGHT - 33,
|
|
6988
|
+
sx: { bgcolor: colors.neutral100 },
|
|
6989
|
+
"data-testid": "loading-skeleton"
|
|
6990
|
+
}
|
|
6991
|
+
) }, cellIndex)) }, rowIndex));
|
|
6992
|
+
}
|
|
6993
|
+
const sortedData = disableInternalSort ? data : stableSort(data, getComparator(order, orderBy));
|
|
6994
|
+
return sortedData.slice(page * rowsPerPage, page * rowsPerPage + rowsPerPage).map((row, index) => {
|
|
6995
|
+
const isItemSelected = selected.has(row[keyField]);
|
|
6996
|
+
return /* @__PURE__ */ jsx111(
|
|
6997
|
+
RenderItem,
|
|
6998
|
+
{
|
|
6999
|
+
...{
|
|
7000
|
+
...row,
|
|
7001
|
+
index,
|
|
7002
|
+
deleteItem,
|
|
7003
|
+
isItemSelected,
|
|
7004
|
+
enableCheckboxSelection,
|
|
7005
|
+
rowHeight: ROW_HEIGHT,
|
|
7006
|
+
rowId: row[keyField],
|
|
7007
|
+
handleRowCheckboxChange,
|
|
7008
|
+
visibleHeadCells
|
|
7009
|
+
}
|
|
7010
|
+
},
|
|
7011
|
+
row[keyField] ?? index
|
|
7012
|
+
);
|
|
7013
|
+
});
|
|
7014
|
+
}, [
|
|
7015
|
+
data,
|
|
7016
|
+
order,
|
|
7017
|
+
orderBy,
|
|
7018
|
+
page,
|
|
7019
|
+
rowsPerPage,
|
|
7020
|
+
selected,
|
|
7021
|
+
isLoading,
|
|
7022
|
+
numRows,
|
|
7023
|
+
enableCheckboxSelection,
|
|
7024
|
+
disableInternalSort,
|
|
7025
|
+
deleteItem,
|
|
7026
|
+
keyField,
|
|
7027
|
+
handleRowCheckboxChange,
|
|
7028
|
+
visibleHeadCells,
|
|
7029
|
+
RenderItem
|
|
7030
|
+
]);
|
|
7031
|
+
useEffect10(() => {
|
|
7032
|
+
if (!enableCheckboxSelection) {
|
|
7033
|
+
setSelected(/* @__PURE__ */ new Set());
|
|
7034
|
+
}
|
|
7035
|
+
}, [enableCheckboxSelection]);
|
|
7036
|
+
return /* @__PURE__ */ jsx111("div", { className: classes.root, style: { height }, children: /* @__PURE__ */ jsxs76(Paper10, { className: classes.paper, children: [
|
|
7037
|
+
/* @__PURE__ */ jsx111(TableContainer, { className: classes.container, children: /* @__PURE__ */ jsx111(
|
|
7038
|
+
Table,
|
|
7039
|
+
{
|
|
7040
|
+
stickyHeader: true,
|
|
7041
|
+
"aria-labelledby": "tableTitle",
|
|
7042
|
+
"aria-label": "sticky table",
|
|
7043
|
+
style: { tableLayout },
|
|
7044
|
+
children: visibleHeadCells.length === 0 ? /* @__PURE__ */ jsx111(TableDesktopNoColumnsMessage, {}) : /* @__PURE__ */ jsxs76(Fragment11, { children: [
|
|
7045
|
+
/* @__PURE__ */ jsx111(
|
|
7046
|
+
SmartTableHeader_default,
|
|
7047
|
+
{
|
|
7048
|
+
headCells: visibleHeadCells,
|
|
7049
|
+
order,
|
|
7050
|
+
orderBy,
|
|
7051
|
+
numSelected: selected.size,
|
|
7052
|
+
numRows,
|
|
7053
|
+
enableCheckboxSelection,
|
|
7054
|
+
headerFilters: headerFilters ?? {},
|
|
7055
|
+
onRequestSort: handleRequestSort,
|
|
7056
|
+
onSelectAllClick: handleSelectAllClick,
|
|
7057
|
+
onApplyFilters,
|
|
7058
|
+
shouldShowCheckOnFilter
|
|
7059
|
+
}
|
|
7060
|
+
),
|
|
7061
|
+
/* @__PURE__ */ jsx111(TableBody2, { children: rowsPerPage !== emptyRows ? renderTableRows : /* @__PURE__ */ jsx111(
|
|
7062
|
+
TableEmptyResult_default,
|
|
7063
|
+
{
|
|
7064
|
+
colSpan: enableCheckboxSelection ? visibleHeadCells.length + 1 : visibleHeadCells.length,
|
|
7065
|
+
showClearFilterButton,
|
|
7066
|
+
handleClickOnClearFiltersButton
|
|
7067
|
+
}
|
|
7068
|
+
) })
|
|
7069
|
+
] })
|
|
7070
|
+
}
|
|
7071
|
+
) }),
|
|
7072
|
+
children
|
|
7073
|
+
] }) });
|
|
7074
|
+
};
|
|
7075
|
+
var TableDesktop_default = TableDesktop;
|
|
7076
|
+
|
|
7077
|
+
// src/components/SmartTableHeaderFilterMenu/SmartTableHeaderFilterMenu.tsx
|
|
7078
|
+
import { Fragment as Fragment12, jsx as jsx112, jsxs as jsxs77 } from "react/jsx-runtime";
|
|
7079
|
+
var useStyles48 = makeStyles48()((theme) => ({
|
|
7080
|
+
filterMenu: {
|
|
7081
|
+
display: "flex",
|
|
7082
|
+
flexDirection: "column"
|
|
7083
|
+
},
|
|
7084
|
+
filterOptions: {
|
|
7085
|
+
maxHeight: theme.spacing(62),
|
|
7086
|
+
overflowY: "auto",
|
|
7087
|
+
"&::-webkit-scrollbar": {
|
|
7088
|
+
width: "8px",
|
|
7089
|
+
height: "8px"
|
|
7090
|
+
},
|
|
7091
|
+
"&::-webkit-scrollbar-track": {
|
|
7092
|
+
backgroundColor: theme.palette.mode === "dark" ? theme.palette.grey[800] : theme.palette.grey[100]
|
|
7093
|
+
},
|
|
7094
|
+
"&::-webkit-scrollbar-thumb": {
|
|
7095
|
+
backgroundColor: theme.palette.mode === "dark" ? theme.palette.grey[900] : theme.palette.grey[400],
|
|
7096
|
+
borderRadius: "10px"
|
|
7097
|
+
},
|
|
7098
|
+
"&::-webkit-scrollbar-thumb:hover": {
|
|
7099
|
+
backgroundColor: theme.palette.mode === "dark" ? theme.palette.common.black : theme.palette.grey[500]
|
|
7100
|
+
}
|
|
7101
|
+
},
|
|
7102
|
+
filter: {
|
|
7103
|
+
display: "flex",
|
|
7104
|
+
alignItems: "center",
|
|
7105
|
+
justifyContent: "space-between",
|
|
7106
|
+
padding: theme.spacing(0, 3)
|
|
7107
|
+
},
|
|
7108
|
+
applyFilterButtonsContainer: {
|
|
7109
|
+
display: "flex",
|
|
7110
|
+
padding: theme.spacing(0, 1),
|
|
7111
|
+
justifyContent: "space-between"
|
|
7112
|
+
},
|
|
7113
|
+
saveAsDefaultButton: {
|
|
7114
|
+
color: theme.palette.primary.main
|
|
7115
|
+
},
|
|
7116
|
+
skeleton: {
|
|
7117
|
+
height: theme.spacing(3),
|
|
7118
|
+
margin: theme.spacing(1)
|
|
7119
|
+
}
|
|
7120
|
+
}));
|
|
7121
|
+
var findFilterIndex = (filters, filterOption) => filters.findIndex((item) => {
|
|
7122
|
+
if (typeof item === "string" && typeof filterOption === "string") {
|
|
7123
|
+
return item === filterOption;
|
|
7124
|
+
}
|
|
7125
|
+
if (typeof item === "object" && typeof filterOption === "object") {
|
|
7126
|
+
return item.id === filterOption.id;
|
|
7127
|
+
}
|
|
7128
|
+
return false;
|
|
7129
|
+
});
|
|
7130
|
+
var SmartTableHeaderFilterMenu = ({
|
|
7131
|
+
headCell,
|
|
7132
|
+
numActiveFilters,
|
|
7133
|
+
headerFilters,
|
|
7134
|
+
shouldShowCheckOnFilter,
|
|
7135
|
+
onApplyFilters
|
|
7136
|
+
}) => {
|
|
7137
|
+
const { classes } = useStyles48();
|
|
7138
|
+
const [anchorEl, setAnchorEl] = useState16(null);
|
|
7139
|
+
const [filterOptionsData, setFilterOptionsData] = useState16();
|
|
7140
|
+
const [selectedFilters, setSelectedFilters] = useState16(
|
|
7141
|
+
headerFilters[headCell.id] ?? []
|
|
7142
|
+
);
|
|
7143
|
+
useEffect11(() => {
|
|
7144
|
+
if (headCell.filterOptions) {
|
|
7145
|
+
setFilterOptionsData(headCell.filterOptions);
|
|
7146
|
+
}
|
|
7147
|
+
}, [headCell.filterOptions]);
|
|
7148
|
+
const numFilterOptions = useMemo3(() => filterOptionsData?.length ?? 0, [filterOptionsData?.length]);
|
|
7149
|
+
const numCurrentSelectedFilters = selectedFilters.length;
|
|
7150
|
+
const handleFilterMenuOpen = (event) => {
|
|
7151
|
+
if (!numFilterOptions) {
|
|
7152
|
+
headCell.refetchFilterOptions?.();
|
|
7153
|
+
}
|
|
7154
|
+
setAnchorEl(event.currentTarget);
|
|
7155
|
+
};
|
|
7156
|
+
const handleFilterMenuClose = () => {
|
|
7157
|
+
setSelectedFilters(headerFilters[headCell.id]);
|
|
7158
|
+
setAnchorEl(null);
|
|
7159
|
+
};
|
|
7160
|
+
const handleFilterOptionClick = (option) => {
|
|
7161
|
+
const selectedIndex = findFilterIndex(selectedFilters, option);
|
|
7162
|
+
let newSelected;
|
|
7163
|
+
if (selectedIndex === -1) {
|
|
7164
|
+
if (typeof option === "string") {
|
|
7165
|
+
newSelected = [...selectedFilters, option];
|
|
7166
|
+
} else {
|
|
7167
|
+
newSelected = [...selectedFilters, option];
|
|
7168
|
+
}
|
|
7169
|
+
} else {
|
|
7170
|
+
newSelected = selectedFilters.filter(
|
|
7171
|
+
(_, index) => index !== selectedIndex
|
|
7172
|
+
);
|
|
7173
|
+
}
|
|
7174
|
+
setSelectedFilters(newSelected);
|
|
7175
|
+
};
|
|
7176
|
+
const handleApplyFilters = (shouldSave) => {
|
|
7177
|
+
const updatedFilters = {
|
|
7178
|
+
...headerFilters,
|
|
7179
|
+
[headCell.id]: [...selectedFilters]
|
|
7180
|
+
};
|
|
7181
|
+
onApplyFilters?.(updatedFilters, shouldSave);
|
|
7182
|
+
setAnchorEl(null);
|
|
7183
|
+
};
|
|
7184
|
+
useEffect11(() => {
|
|
7185
|
+
setSelectedFilters(headerFilters[headCell.id] ?? []);
|
|
7186
|
+
}, [headerFilters, headCell.id]);
|
|
7187
|
+
const isOptionChecked = useMemo3(() => (resolvedOption) => !!selectedFilters?.some(
|
|
7188
|
+
(value) => resolveOptionType(value, headCell.fieldName ?? "") === resolvedOption
|
|
7189
|
+
), [selectedFilters]);
|
|
7190
|
+
const loadingSkeletons = /* @__PURE__ */ jsxs77(Box29, { "data-testid": "loading-skeletons", width: 272, children: [
|
|
7191
|
+
/* @__PURE__ */ jsx112(Skeleton3, { variant: "rounded", className: classes.skeleton }),
|
|
7192
|
+
/* @__PURE__ */ jsx112(Divider9, {}),
|
|
7193
|
+
/* @__PURE__ */ jsx112(Skeleton3, { variant: "rounded", className: classes.skeleton }),
|
|
7194
|
+
/* @__PURE__ */ jsx112(Skeleton3, { variant: "rounded", className: classes.skeleton }),
|
|
7195
|
+
/* @__PURE__ */ jsx112(Skeleton3, { variant: "rounded", className: classes.skeleton }),
|
|
7196
|
+
/* @__PURE__ */ jsx112(Skeleton3, { variant: "rounded", className: classes.skeleton }),
|
|
7197
|
+
/* @__PURE__ */ jsx112(Divider9, {}),
|
|
7198
|
+
/* @__PURE__ */ jsx112(Skeleton3, { variant: "rounded", className: classes.skeleton })
|
|
7199
|
+
] });
|
|
7200
|
+
return /* @__PURE__ */ jsxs77(Fragment12, { children: [
|
|
7201
|
+
/* @__PURE__ */ jsx112(
|
|
7202
|
+
ActiveFiltersIconButton_default,
|
|
7203
|
+
{
|
|
7204
|
+
numActiveFilters,
|
|
7205
|
+
handleClick: handleFilterMenuOpen,
|
|
7206
|
+
className: classNames3("filter-menu-trigger", {
|
|
7207
|
+
"has-active-filters": !!numActiveFilters || !!anchorEl
|
|
7208
|
+
})
|
|
7209
|
+
}
|
|
7210
|
+
),
|
|
7211
|
+
/* @__PURE__ */ jsx112(
|
|
7212
|
+
Menu4,
|
|
7213
|
+
{
|
|
7214
|
+
open: !!anchorEl,
|
|
7215
|
+
onClose: handleFilterMenuClose,
|
|
7216
|
+
anchorEl,
|
|
7217
|
+
"data-testid": "filter-menu",
|
|
7218
|
+
anchorOrigin: { vertical: "bottom", horizontal: "right" },
|
|
7219
|
+
transformOrigin: { vertical: "top", horizontal: "right" },
|
|
7220
|
+
children: headCell.isFetchingFilterOptions ? loadingSkeletons : /* @__PURE__ */ jsxs77(Box29, { className: classes.filterMenu, children: [
|
|
7221
|
+
/* @__PURE__ */ jsx112(Box29, { px: 3, mb: 0.5, children: /* @__PURE__ */ jsx112(
|
|
7222
|
+
FormControlLabel3,
|
|
7223
|
+
{
|
|
7224
|
+
label: "Select All",
|
|
7225
|
+
control: /* @__PURE__ */ jsx112(
|
|
7226
|
+
Checkbox5,
|
|
7227
|
+
{
|
|
7228
|
+
disableRipple: true,
|
|
7229
|
+
checked: numCurrentSelectedFilters === numFilterOptions,
|
|
7230
|
+
indeterminate: numCurrentSelectedFilters > 0 && numCurrentSelectedFilters < numFilterOptions,
|
|
7231
|
+
onChange: ({ target: { checked } }) => {
|
|
7232
|
+
if (checked) {
|
|
7233
|
+
setSelectedFilters([...filterOptionsData]);
|
|
7234
|
+
} else {
|
|
7235
|
+
setSelectedFilters([]);
|
|
7236
|
+
}
|
|
7237
|
+
}
|
|
7238
|
+
}
|
|
7239
|
+
)
|
|
7240
|
+
}
|
|
7241
|
+
) }),
|
|
7242
|
+
/* @__PURE__ */ jsx112(Divider9, { sx: { mb: 0.5 } }),
|
|
7243
|
+
/* @__PURE__ */ jsx112(Box29, { className: classes.filterOptions, children: filterOptionsData?.map(
|
|
7244
|
+
(option) => {
|
|
7245
|
+
const resolvedOption = resolveOptionType(option, headCell.fieldName ?? "");
|
|
7246
|
+
return /* @__PURE__ */ jsxs77(
|
|
7247
|
+
Box29,
|
|
7248
|
+
{
|
|
7249
|
+
className: classes.filter,
|
|
7250
|
+
children: [
|
|
7251
|
+
/* @__PURE__ */ jsx112(
|
|
7252
|
+
FormControlLabel3,
|
|
7253
|
+
{
|
|
7254
|
+
label: resolvedOption,
|
|
7255
|
+
control: /* @__PURE__ */ jsx112(
|
|
7256
|
+
Checkbox5,
|
|
7257
|
+
{
|
|
7258
|
+
disableRipple: true,
|
|
7259
|
+
onChange: () => handleFilterOptionClick(option),
|
|
7260
|
+
checked: isOptionChecked(resolvedOption)
|
|
7261
|
+
}
|
|
7262
|
+
)
|
|
7263
|
+
},
|
|
7264
|
+
resolvedOption
|
|
7265
|
+
),
|
|
7266
|
+
shouldShowCheckOnFilter?.(headCell.id, option) ? /* @__PURE__ */ jsx112(Tooltip6, { title: "This filter is saved as default", children: /* @__PURE__ */ jsx112(CheckIcon, { fontSize: "small", color: "action" }) }) : null
|
|
7267
|
+
]
|
|
7268
|
+
},
|
|
7269
|
+
resolvedOption
|
|
7270
|
+
);
|
|
7271
|
+
}
|
|
7272
|
+
) }),
|
|
7273
|
+
/* @__PURE__ */ jsx112(Divider9, { sx: { mb: 0.5 } }),
|
|
7274
|
+
/* @__PURE__ */ jsxs77(Box29, { className: classes.applyFilterButtonsContainer, children: [
|
|
7275
|
+
/* @__PURE__ */ jsx112(
|
|
7276
|
+
ExtendedButton_default,
|
|
7277
|
+
{
|
|
7278
|
+
copy: "Save as Default",
|
|
7279
|
+
buttonType: "button",
|
|
7280
|
+
variant: "text",
|
|
7281
|
+
tooltip: "Persists those filters for future visits",
|
|
7282
|
+
className: classes.saveAsDefaultButton,
|
|
7283
|
+
onClick: () => handleApplyFilters(true)
|
|
7284
|
+
}
|
|
7285
|
+
),
|
|
7286
|
+
/* @__PURE__ */ jsx112(
|
|
7287
|
+
ExtendedButton_default,
|
|
7288
|
+
{
|
|
7289
|
+
copy: "Apply",
|
|
7290
|
+
color: "primary",
|
|
7291
|
+
buttonType: "submit",
|
|
7292
|
+
onClick: () => handleApplyFilters(false)
|
|
7293
|
+
}
|
|
7294
|
+
)
|
|
7295
|
+
] })
|
|
7296
|
+
] })
|
|
7297
|
+
}
|
|
7298
|
+
)
|
|
7299
|
+
] });
|
|
7300
|
+
};
|
|
7301
|
+
var SmartTableHeaderFilterMenu_default = memo21(SmartTableHeaderFilterMenu);
|
|
7302
|
+
|
|
7303
|
+
// src/components/Table/Table.tsx
|
|
7304
|
+
var import_debounce = __toESM(require_debounce(), 1);
|
|
7305
|
+
import { useLayoutEffect, useState as useState17 } from "react";
|
|
7306
|
+
import {
|
|
7307
|
+
Box as Box31,
|
|
7308
|
+
Paper as Paper11,
|
|
7309
|
+
Table as MUITable,
|
|
7310
|
+
TableBody as TableBody3,
|
|
7311
|
+
TableCell as TableCell5,
|
|
7312
|
+
TableContainer as TableContainer2,
|
|
7313
|
+
TableHead as TableHead2,
|
|
7314
|
+
TableRow as TableRow5,
|
|
7315
|
+
TableSortLabel as TableSortLabel2
|
|
7316
|
+
} from "@mui/material";
|
|
7317
|
+
import { makeStyles as makeStyles49 } from "tss-react/mui";
|
|
7318
|
+
import { v4 as uuidv4 } from "uuid";
|
|
7319
|
+
|
|
7320
|
+
// src/components/TableLoading/TableLoading.tsx
|
|
7321
|
+
import { Box as Box30, Skeleton as Skeleton4 } from "@mui/material";
|
|
7322
|
+
import { jsx as jsx113 } from "react/jsx-runtime";
|
|
7323
|
+
var TableLoading = ({
|
|
7324
|
+
rowsPerPage,
|
|
7325
|
+
rowHeight
|
|
7326
|
+
}) => /* @__PURE__ */ jsx113(Box30, { children: Array.from({ length: rowsPerPage ?? 0 }).map((_, index) => /* @__PURE__ */ jsx113(
|
|
7327
|
+
Skeleton4,
|
|
7328
|
+
{
|
|
7329
|
+
animation: "pulse",
|
|
7330
|
+
"data-testid": "table-loading-skeleton",
|
|
7331
|
+
style: { margin: "8px", opacity: 0.4 },
|
|
7332
|
+
variant: "rectangular",
|
|
7333
|
+
height: rowHeight
|
|
7334
|
+
},
|
|
7335
|
+
index
|
|
7336
|
+
)) });
|
|
7337
|
+
var TableLoading_default = TableLoading;
|
|
7338
|
+
|
|
7339
|
+
// src/components/Table/helpers.tsx
|
|
7340
|
+
function stableSort2(array, cmp) {
|
|
7341
|
+
const stabilizedThis = array.map((el, index) => [el, index]);
|
|
7342
|
+
stabilizedThis.sort((a, b) => {
|
|
7343
|
+
const order = cmp(a[0], b[0]);
|
|
7344
|
+
if (order !== 0) {
|
|
7345
|
+
return order;
|
|
7346
|
+
}
|
|
7347
|
+
return a[1] - b[1];
|
|
7348
|
+
});
|
|
7349
|
+
return stabilizedThis.map((el) => el[0]);
|
|
7350
|
+
}
|
|
7351
|
+
function descendingComparator2(a, b, orderBy) {
|
|
7352
|
+
if (b[orderBy] < a[orderBy]) {
|
|
7353
|
+
return -1;
|
|
7354
|
+
}
|
|
7355
|
+
if (b[orderBy] > a[orderBy]) {
|
|
7356
|
+
return 1;
|
|
7357
|
+
}
|
|
7358
|
+
return 0;
|
|
7359
|
+
}
|
|
7360
|
+
function getSorting(order, orderBy) {
|
|
7361
|
+
return order === "desc" ? (a, b) => descendingComparator2(a, b, orderBy) : (a, b) => -descendingComparator2(a, b, orderBy);
|
|
7362
|
+
}
|
|
7363
|
+
function calculateRowsPerPage(rowHeight) {
|
|
7364
|
+
const appContainerDom = document.getElementById("mainContainer");
|
|
7365
|
+
const headerDom = document.getElementById("aboveTableHeader");
|
|
7366
|
+
if (appContainerDom && headerDom) {
|
|
7367
|
+
return Math.floor(
|
|
7368
|
+
(appContainerDom.clientHeight - headerDom.clientHeight - 24) / rowHeight - 2
|
|
7369
|
+
);
|
|
7370
|
+
}
|
|
7371
|
+
return 1;
|
|
7372
|
+
}
|
|
7373
|
+
|
|
7374
|
+
// src/components/Table/Table.tsx
|
|
7375
|
+
import { jsx as jsx114, jsxs as jsxs78 } from "react/jsx-runtime";
|
|
7376
|
+
var useStyles49 = makeStyles49()(() => ({
|
|
7377
|
+
root: {
|
|
7378
|
+
height: "calc(100vh - 262px)",
|
|
7379
|
+
overflow: "scroll"
|
|
7380
|
+
},
|
|
7381
|
+
paper: {
|
|
7382
|
+
width: "100%",
|
|
7383
|
+
display: "flex",
|
|
7384
|
+
flexDirection: "column",
|
|
7385
|
+
justifyContent: "space-between"
|
|
7386
|
+
},
|
|
7387
|
+
header: {
|
|
7388
|
+
"& .MuiTableSortLabel-root": {
|
|
7389
|
+
fontWeight: 600,
|
|
7390
|
+
fontSize: ".875rem"
|
|
7391
|
+
}
|
|
7392
|
+
},
|
|
7393
|
+
container: {
|
|
7394
|
+
maxHeight: "calc(100% - 0)"
|
|
7395
|
+
}
|
|
7396
|
+
}));
|
|
7397
|
+
var Table2 = ({
|
|
7398
|
+
appliedFilters,
|
|
7399
|
+
data,
|
|
7400
|
+
doNotCalculateRows,
|
|
7401
|
+
headCells,
|
|
7402
|
+
isLoading,
|
|
7403
|
+
onRowClick,
|
|
7404
|
+
page = 0,
|
|
7405
|
+
RenderItem = null,
|
|
7406
|
+
rowsPerPage: defaultRowsPerPage = 10,
|
|
7407
|
+
serverRendered,
|
|
7408
|
+
updateSort
|
|
7241
7409
|
}) => {
|
|
7242
|
-
const [order, setOrder] =
|
|
7243
|
-
const [orderBy, setOrderBy] =
|
|
7410
|
+
const [order, setOrder] = useState17(appliedFilters?.sortDir || "desc");
|
|
7411
|
+
const [orderBy, setOrderBy] = useState17(
|
|
7244
7412
|
appliedFilters?.sortField || "delivery_date"
|
|
7245
7413
|
);
|
|
7246
|
-
const [
|
|
7247
|
-
const [page] = useState16(0);
|
|
7414
|
+
const [rowsPerPage, setRowsPerPage] = useState17(defaultRowsPerPage);
|
|
7248
7415
|
const { classes } = useStyles49();
|
|
7249
7416
|
const rowHeight = 56;
|
|
7250
|
-
const emptyRows =
|
|
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
|
-
);
|
|
7417
|
+
const emptyRows = rowsPerPage - Math.min(rowsPerPage, data.length - page * rowsPerPage);
|
|
7269
7418
|
const handleRequestSort = (event, property) => {
|
|
7270
7419
|
const isAsc = orderBy === property && order === "asc";
|
|
7271
7420
|
const orderDir = isAsc ? "desc" : "asc";
|
|
@@ -7275,119 +7424,419 @@ var TableDesktop = ({
|
|
|
7275
7424
|
updateSort(property, orderDir);
|
|
7276
7425
|
}
|
|
7277
7426
|
};
|
|
7278
|
-
|
|
7279
|
-
(
|
|
7280
|
-
|
|
7281
|
-
|
|
7282
|
-
|
|
7283
|
-
|
|
7284
|
-
|
|
7285
|
-
|
|
7286
|
-
|
|
7287
|
-
|
|
7288
|
-
|
|
7289
|
-
|
|
7290
|
-
|
|
7291
|
-
|
|
7292
|
-
|
|
7427
|
+
useLayoutEffect(() => {
|
|
7428
|
+
if (!doNotCalculateRows) {
|
|
7429
|
+
return;
|
|
7430
|
+
}
|
|
7431
|
+
function updateRowsPerPage() {
|
|
7432
|
+
const newRowsPerPage = calculateRowsPerPage(rowHeight);
|
|
7433
|
+
setRowsPerPage(newRowsPerPage);
|
|
7434
|
+
}
|
|
7435
|
+
updateRowsPerPage();
|
|
7436
|
+
const debounced = (0, import_debounce.default)(updateRowsPerPage, 150);
|
|
7437
|
+
window.addEventListener("resize", debounced);
|
|
7438
|
+
return () => {
|
|
7439
|
+
window.removeEventListener("resize", debounced);
|
|
7440
|
+
};
|
|
7441
|
+
}, [doNotCalculateRows]);
|
|
7442
|
+
const createSortHandler = (property) => (event) => {
|
|
7443
|
+
handleRequestSort(event, property);
|
|
7444
|
+
};
|
|
7445
|
+
const getTableRows = () => {
|
|
7446
|
+
const index = page;
|
|
7447
|
+
const rows = serverRendered ? data : stableSort2(data, getSorting(order, orderBy)).slice(
|
|
7448
|
+
index * rowsPerPage,
|
|
7449
|
+
index * rowsPerPage + rowsPerPage
|
|
7450
|
+
);
|
|
7451
|
+
const rowsComponents = rows.map((row) => {
|
|
7452
|
+
if (RenderItem) {
|
|
7453
|
+
return /* @__PURE__ */ jsx114(RenderItem, { ...row }, row.id);
|
|
7293
7454
|
}
|
|
7294
|
-
|
|
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
|
|
7317
|
-
);
|
|
7455
|
+
return /* @__PURE__ */ jsx114(TableRow5, { hover: true, onClick: () => onRowClick?.(row), children: headCells?.map((column) => /* @__PURE__ */ jsx114(TableCell5, { children: row[column.id] }, column.id)) }, row.id);
|
|
7318
7456
|
});
|
|
7319
|
-
|
|
7320
|
-
|
|
7321
|
-
|
|
7322
|
-
|
|
7323
|
-
|
|
7324
|
-
|
|
7325
|
-
|
|
7326
|
-
|
|
7327
|
-
|
|
7328
|
-
|
|
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,
|
|
7457
|
+
if (emptyRows > 0 && rowsPerPage > emptyRows) {
|
|
7458
|
+
rowsComponents.push(
|
|
7459
|
+
/* @__PURE__ */ jsx114(TableRow5, { style: { height: rowHeight * emptyRows }, children: /* @__PURE__ */ jsx114(TableCell5, { colSpan: 8 }) }, uuidv4())
|
|
7460
|
+
);
|
|
7461
|
+
}
|
|
7462
|
+
return rowsComponents;
|
|
7463
|
+
};
|
|
7464
|
+
return /* @__PURE__ */ jsx114(Paper11, { className: classes.root, children: /* @__PURE__ */ jsx114(Box31, { className: classes.paper, children: isLoading ? /* @__PURE__ */ jsx114(TableLoading_default, { rowHeight, rowsPerPage }) : /* @__PURE__ */ jsx114(TableContainer2, { className: classes.container, children: /* @__PURE__ */ jsxs78(MUITable, { size: "medium", stickyHeader: true, children: [
|
|
7465
|
+
/* @__PURE__ */ jsx114(TableHead2, { className: classes.header, children: /* @__PURE__ */ jsx114(TableRow5, { children: headCells?.map((headCell) => /* @__PURE__ */ jsx114(
|
|
7466
|
+
TableCell5,
|
|
7337
7467
|
{
|
|
7338
|
-
|
|
7339
|
-
|
|
7340
|
-
|
|
7341
|
-
|
|
7342
|
-
|
|
7468
|
+
align: "left",
|
|
7469
|
+
sortDirection: orderBy === headCell.id ? order : void 0,
|
|
7470
|
+
children: /* @__PURE__ */ jsx114(
|
|
7471
|
+
TableSortLabel2,
|
|
7472
|
+
{
|
|
7473
|
+
active: orderBy === headCell.id,
|
|
7474
|
+
direction: orderBy === headCell.id ? order : "asc",
|
|
7475
|
+
onClick: createSortHandler(headCell.id),
|
|
7476
|
+
children: headCell.label
|
|
7477
|
+
}
|
|
7478
|
+
)
|
|
7343
7479
|
},
|
|
7344
|
-
|
|
7345
|
-
)) })
|
|
7346
|
-
|
|
7347
|
-
|
|
7348
|
-
|
|
7349
|
-
|
|
7350
|
-
|
|
7351
|
-
|
|
7352
|
-
|
|
7353
|
-
|
|
7354
|
-
|
|
7355
|
-
|
|
7356
|
-
|
|
7357
|
-
|
|
7358
|
-
|
|
7359
|
-
|
|
7360
|
-
|
|
7361
|
-
|
|
7362
|
-
|
|
7363
|
-
|
|
7364
|
-
|
|
7365
|
-
|
|
7366
|
-
|
|
7367
|
-
|
|
7368
|
-
|
|
7369
|
-
|
|
7370
|
-
|
|
7480
|
+
headCell.id
|
|
7481
|
+
)) }) }),
|
|
7482
|
+
/* @__PURE__ */ jsxs78(TableBody3, { children: [
|
|
7483
|
+
getTableRows(),
|
|
7484
|
+
rowsPerPage === emptyRows && /* @__PURE__ */ jsx114(TableRow5, { style: { height: rowHeight * emptyRows }, children: /* @__PURE__ */ jsx114(TableCell5, { colSpan: 8, align: "center", children: "Nothing to display" }) })
|
|
7485
|
+
] })
|
|
7486
|
+
] }) }) }) });
|
|
7487
|
+
};
|
|
7488
|
+
var Table_default = Table2;
|
|
7489
|
+
|
|
7490
|
+
// src/components/TableDesktopFooter/TableDesktopFooter.tsx
|
|
7491
|
+
import Refresh3 from "@mui/icons-material/Refresh";
|
|
7492
|
+
import { Box as Box32, Button as Button13, MenuItem as MenuItem4, Pagination as Pagination2, Select as Select4, Stack, Typography as Typography28 } from "@mui/material";
|
|
7493
|
+
import { jsx as jsx115, jsxs as jsxs79 } from "react/jsx-runtime";
|
|
7494
|
+
var TableDesktopFooter = ({
|
|
7495
|
+
numPages,
|
|
7496
|
+
page,
|
|
7497
|
+
pageSize,
|
|
7498
|
+
pageSizeOptions,
|
|
7499
|
+
handlePageChange,
|
|
7500
|
+
handlePageSizeChange,
|
|
7501
|
+
refetch,
|
|
7502
|
+
isFetching
|
|
7503
|
+
}) => {
|
|
7504
|
+
return /* @__PURE__ */ jsxs79(
|
|
7505
|
+
Box32,
|
|
7506
|
+
{
|
|
7507
|
+
py: 1,
|
|
7508
|
+
gap: 2,
|
|
7509
|
+
display: "flex",
|
|
7510
|
+
justifyContent: "space-between",
|
|
7511
|
+
alignItems: "center",
|
|
7512
|
+
borderTop: `1px solid ${colors.neutral300}`,
|
|
7513
|
+
bgcolor: (theme) => theme.palette.background.default,
|
|
7514
|
+
children: [
|
|
7515
|
+
/* @__PURE__ */ jsxs79(
|
|
7516
|
+
Button13,
|
|
7517
|
+
{
|
|
7518
|
+
disableRipple: true,
|
|
7519
|
+
variant: "outlined",
|
|
7520
|
+
onClick: () => refetch(),
|
|
7521
|
+
disabled: isFetching,
|
|
7522
|
+
sx: {
|
|
7523
|
+
ml: 1,
|
|
7524
|
+
gap: 1,
|
|
7525
|
+
borderRadius: 25,
|
|
7526
|
+
color: colors.neutral800,
|
|
7527
|
+
borderColor: colors.neutral600
|
|
7528
|
+
},
|
|
7529
|
+
children: [
|
|
7530
|
+
/* @__PURE__ */ jsx115(
|
|
7531
|
+
Refresh3,
|
|
7532
|
+
{
|
|
7533
|
+
fontSize: "small",
|
|
7534
|
+
color: isFetching ? "disabled" : "primary"
|
|
7535
|
+
}
|
|
7536
|
+
),
|
|
7537
|
+
"REFRESH"
|
|
7538
|
+
]
|
|
7539
|
+
}
|
|
7540
|
+
),
|
|
7541
|
+
/* @__PURE__ */ jsxs79(Box32, { display: "flex", children: [
|
|
7542
|
+
/* @__PURE__ */ jsxs79(Stack, { direction: "row", spacing: 2, alignItems: "center", children: [
|
|
7543
|
+
/* @__PURE__ */ jsx115(Typography28, { children: "Rows per page:" }),
|
|
7544
|
+
/* @__PURE__ */ jsx115(
|
|
7545
|
+
Select4,
|
|
7546
|
+
{
|
|
7547
|
+
value: pageSize,
|
|
7548
|
+
onChange: handlePageSizeChange,
|
|
7549
|
+
size: "small",
|
|
7550
|
+
variant: "standard",
|
|
7551
|
+
children: pageSizeOptions.map((size) => /* @__PURE__ */ jsx115(MenuItem4, { value: size, children: size }, size))
|
|
7552
|
+
}
|
|
7553
|
+
)
|
|
7554
|
+
] }),
|
|
7555
|
+
/* @__PURE__ */ jsx115(
|
|
7556
|
+
Pagination2,
|
|
7371
7557
|
{
|
|
7372
|
-
|
|
7373
|
-
|
|
7374
|
-
|
|
7558
|
+
color: "standard",
|
|
7559
|
+
count: numPages,
|
|
7560
|
+
page,
|
|
7561
|
+
onChange: handlePageChange
|
|
7375
7562
|
}
|
|
7376
|
-
)
|
|
7377
|
-
]
|
|
7563
|
+
)
|
|
7564
|
+
] })
|
|
7565
|
+
]
|
|
7566
|
+
}
|
|
7567
|
+
);
|
|
7568
|
+
};
|
|
7569
|
+
|
|
7570
|
+
// src/components/TableDesktopRowCell/TableDesktopRowCell.tsx
|
|
7571
|
+
import { useEffect as useEffect13, useRef as useRef5, useState as useState20 } from "react";
|
|
7572
|
+
import { Box as Box33, Checkbox as Checkbox6, IconButton as IconButton4, TableCell as TableCell6, TextField as TextField9, Tooltip as Tooltip7 } from "@mui/material";
|
|
7573
|
+
|
|
7574
|
+
// src/components/TableDesktopRowCell/TableDesktopSmartSelect.tsx
|
|
7575
|
+
import { useState as useState18, memo as memo22, useEffect as useEffect12 } from "react";
|
|
7576
|
+
import { jsx as jsx116 } from "react/jsx-runtime";
|
|
7577
|
+
var resolveValue = (value) => {
|
|
7578
|
+
if (typeof value === "string") {
|
|
7579
|
+
return value;
|
|
7580
|
+
}
|
|
7581
|
+
return value?.id;
|
|
7582
|
+
};
|
|
7583
|
+
var TableDesktopSmartSelect = memo22(({
|
|
7584
|
+
ref,
|
|
7585
|
+
initialValue,
|
|
7586
|
+
inputLabel,
|
|
7587
|
+
fieldName,
|
|
7588
|
+
rowId,
|
|
7589
|
+
disabled,
|
|
7590
|
+
filterOptions,
|
|
7591
|
+
refetchFilterOptions,
|
|
7592
|
+
isFetchingFilterOptions,
|
|
7593
|
+
onUpdateEditableCell
|
|
7594
|
+
}) => {
|
|
7595
|
+
const [value, setValue] = useState18(initialValue);
|
|
7596
|
+
const [options, setOptions] = useState18();
|
|
7597
|
+
const valueId = resolveValue(value);
|
|
7598
|
+
const valueLabel = resolveOptionType(value, fieldName);
|
|
7599
|
+
useEffect12(() => {
|
|
7600
|
+
if (filterOptions) {
|
|
7601
|
+
const parsedOptions = filterOptions?.map((option) => ({
|
|
7602
|
+
value: resolveValue(option),
|
|
7603
|
+
label: String(resolveOptionType(option, fieldName))
|
|
7604
|
+
}));
|
|
7605
|
+
setOptions(parsedOptions);
|
|
7606
|
+
}
|
|
7607
|
+
}, [filterOptions]);
|
|
7608
|
+
return /* @__PURE__ */ jsx116(
|
|
7609
|
+
SmartSelect_default,
|
|
7610
|
+
{
|
|
7611
|
+
ref,
|
|
7612
|
+
value: valueId,
|
|
7613
|
+
inputLabel,
|
|
7614
|
+
options,
|
|
7615
|
+
disabled,
|
|
7616
|
+
refetch: refetchFilterOptions,
|
|
7617
|
+
isFetching: isFetchingFilterOptions,
|
|
7618
|
+
defaultOption: {
|
|
7619
|
+
value: valueId ?? "",
|
|
7620
|
+
label: String(valueLabel ?? "")
|
|
7621
|
+
},
|
|
7622
|
+
onChange: ({ value: value2, label }) => {
|
|
7623
|
+
setValue({ id: value2 ?? "", name: label ?? "" });
|
|
7624
|
+
onUpdateEditableCell?.(rowId, value2 ?? "");
|
|
7378
7625
|
}
|
|
7379
|
-
|
|
7380
|
-
|
|
7381
|
-
|
|
7626
|
+
}
|
|
7627
|
+
);
|
|
7628
|
+
});
|
|
7629
|
+
|
|
7630
|
+
// src/components/TableDesktopRowCell/TableDesktopRowCell.tsx
|
|
7631
|
+
import CheckIcon2 from "@mui/icons-material/Check";
|
|
7632
|
+
|
|
7633
|
+
// src/components/TableDesktopRowCell/TableDesktopTextField.tsx
|
|
7634
|
+
import TextField8 from "@mui/material/TextField";
|
|
7635
|
+
import { useMemo as useMemo4, useState as useState19 } from "react";
|
|
7636
|
+
import { jsx as jsx117 } from "react/jsx-runtime";
|
|
7637
|
+
var TableDesktopTextField = ({
|
|
7638
|
+
rowId,
|
|
7639
|
+
editInitialValue,
|
|
7640
|
+
inputLabel,
|
|
7641
|
+
disabled,
|
|
7642
|
+
validateInput,
|
|
7643
|
+
onUpdateEditableCell
|
|
7644
|
+
}) => {
|
|
7645
|
+
const [value, setValue] = useState19(editInitialValue);
|
|
7646
|
+
const hasError = useMemo4(() => !validateInput?.(value), [value, validateInput]);
|
|
7647
|
+
return /* @__PURE__ */ jsx117(
|
|
7648
|
+
TextField8,
|
|
7649
|
+
{
|
|
7650
|
+
fullWidth: true,
|
|
7651
|
+
variant: "standard",
|
|
7652
|
+
defaultValue: value,
|
|
7653
|
+
label: inputLabel,
|
|
7654
|
+
error: hasError,
|
|
7655
|
+
disabled,
|
|
7656
|
+
onChange: ({ target: { value: value2 } }) => {
|
|
7657
|
+
setValue(value2);
|
|
7658
|
+
},
|
|
7659
|
+
onBlur: ({ target: { value: value2 } }) => {
|
|
7660
|
+
if (hasError) {
|
|
7661
|
+
return;
|
|
7662
|
+
}
|
|
7663
|
+
onUpdateEditableCell?.(rowId, value2);
|
|
7664
|
+
}
|
|
7665
|
+
}
|
|
7666
|
+
);
|
|
7667
|
+
};
|
|
7668
|
+
|
|
7669
|
+
// src/components/TableDesktopRowCell/TableDesktopRowCell.tsx
|
|
7670
|
+
import Close2 from "@mui/icons-material/Close";
|
|
7671
|
+
import Edit3 from "@mui/icons-material/Edit";
|
|
7672
|
+
import { jsx as jsx118, jsxs as jsxs80 } from "react/jsx-runtime";
|
|
7673
|
+
var TableDesktopRowCell = ({
|
|
7674
|
+
inputLabel,
|
|
7675
|
+
editInitialValue,
|
|
7676
|
+
rowId,
|
|
7677
|
+
fieldName,
|
|
7678
|
+
width,
|
|
7679
|
+
disabled,
|
|
7680
|
+
readOnlyValue,
|
|
7681
|
+
editableCellType,
|
|
7682
|
+
filterOptions,
|
|
7683
|
+
refetchFilterOptions,
|
|
7684
|
+
isFetchingFilterOptions,
|
|
7685
|
+
validateInput,
|
|
7686
|
+
onUpdateEditableCell,
|
|
7687
|
+
onCellClick
|
|
7688
|
+
}) => {
|
|
7689
|
+
const cellRef = useRef5(null);
|
|
7690
|
+
const [isOverflowed, setIsOverflowed] = useState20(false);
|
|
7691
|
+
const [isCellHovered, setIsCellHovered] = useState20(false);
|
|
7692
|
+
const [isEditMode, setIsEditMode] = useState20(false);
|
|
7693
|
+
useEffect13(() => {
|
|
7694
|
+
const ref = cellRef.current;
|
|
7695
|
+
if (ref) {
|
|
7696
|
+
setIsOverflowed(ref.scrollWidth > ref.clientWidth);
|
|
7697
|
+
}
|
|
7698
|
+
}, [readOnlyValue, width]);
|
|
7699
|
+
useEffect13(() => {
|
|
7700
|
+
const handleKeyDown = (e) => {
|
|
7701
|
+
if (e.key === "Escape") {
|
|
7702
|
+
setIsEditMode(false);
|
|
7703
|
+
}
|
|
7704
|
+
};
|
|
7705
|
+
if (isEditMode) {
|
|
7706
|
+
window.addEventListener("keydown", handleKeyDown);
|
|
7707
|
+
}
|
|
7708
|
+
return () => {
|
|
7709
|
+
window.removeEventListener("keydown", handleKeyDown);
|
|
7710
|
+
};
|
|
7711
|
+
}, [isEditMode]);
|
|
7712
|
+
const editableComponents = {
|
|
7713
|
+
"select": /* @__PURE__ */ jsx118(
|
|
7714
|
+
TableDesktopSmartSelect,
|
|
7715
|
+
{
|
|
7716
|
+
rowId,
|
|
7717
|
+
fieldName,
|
|
7718
|
+
disabled,
|
|
7719
|
+
initialValue: editInitialValue,
|
|
7720
|
+
inputLabel: inputLabel ?? "",
|
|
7721
|
+
filterOptions,
|
|
7722
|
+
refetchFilterOptions,
|
|
7723
|
+
isFetchingFilterOptions,
|
|
7724
|
+
onUpdateEditableCell
|
|
7725
|
+
}
|
|
7726
|
+
),
|
|
7727
|
+
"checkbox": /* @__PURE__ */ jsx118(
|
|
7728
|
+
Checkbox6,
|
|
7729
|
+
{
|
|
7730
|
+
disableRipple: true,
|
|
7731
|
+
disabled,
|
|
7732
|
+
defaultChecked: editInitialValue,
|
|
7733
|
+
onChange: ({ target: { checked } }) => {
|
|
7734
|
+
onUpdateEditableCell?.(rowId, checked);
|
|
7735
|
+
}
|
|
7736
|
+
}
|
|
7737
|
+
),
|
|
7738
|
+
"text": /* @__PURE__ */ jsx118(
|
|
7739
|
+
TableDesktopTextField,
|
|
7740
|
+
{
|
|
7741
|
+
rowId,
|
|
7742
|
+
disabled,
|
|
7743
|
+
editInitialValue,
|
|
7744
|
+
inputLabel: inputLabel ?? "",
|
|
7745
|
+
validateInput,
|
|
7746
|
+
onUpdateEditableCell
|
|
7747
|
+
}
|
|
7748
|
+
),
|
|
7749
|
+
"numeric": /* @__PURE__ */ jsx118(
|
|
7750
|
+
TextField9,
|
|
7751
|
+
{
|
|
7752
|
+
fullWidth: true,
|
|
7753
|
+
variant: "standard",
|
|
7754
|
+
disabled,
|
|
7755
|
+
defaultValue: editInitialValue,
|
|
7756
|
+
label: inputLabel,
|
|
7757
|
+
onChange: (e) => {
|
|
7758
|
+
e.target.value = e.target.value.replace(/\D/g, "");
|
|
7759
|
+
},
|
|
7760
|
+
onBlur: ({ target: { value } }) => {
|
|
7761
|
+
onUpdateEditableCell?.(rowId, value);
|
|
7762
|
+
},
|
|
7763
|
+
slotProps: {
|
|
7764
|
+
input: {
|
|
7765
|
+
inputMode: "numeric"
|
|
7766
|
+
}
|
|
7767
|
+
}
|
|
7768
|
+
}
|
|
7769
|
+
)
|
|
7770
|
+
};
|
|
7771
|
+
const getReadOnlyBooleanIcon = (value) => {
|
|
7772
|
+
if (value) {
|
|
7773
|
+
return /* @__PURE__ */ jsx118(CheckIcon2, { sx: { fontSize: 16 } });
|
|
7774
|
+
}
|
|
7775
|
+
return "-";
|
|
7776
|
+
};
|
|
7777
|
+
const handleEditClick = (e) => {
|
|
7778
|
+
e.stopPropagation();
|
|
7779
|
+
setIsEditMode((prev) => !prev);
|
|
7780
|
+
};
|
|
7781
|
+
return /* @__PURE__ */ jsx118(Tooltip7, { title: isOverflowed ? String(readOnlyValue) : "", arrow: true, children: /* @__PURE__ */ jsx118(
|
|
7782
|
+
TableCell6,
|
|
7783
|
+
{
|
|
7784
|
+
align: "left",
|
|
7785
|
+
onMouseEnter: () => editableCellType && !disabled && setIsCellHovered(true),
|
|
7786
|
+
onMouseLeave: () => editableCellType && !disabled && setIsCellHovered(false),
|
|
7787
|
+
onClick: (event) => !disabled && onCellClick?.(event, isEditMode),
|
|
7788
|
+
sx: {
|
|
7789
|
+
padding: 1,
|
|
7790
|
+
width: width ?? "auto",
|
|
7791
|
+
position: "relative",
|
|
7792
|
+
cursor: disabled ? "default" : "pointer",
|
|
7793
|
+
opacity: disabled ? 0.2 : 1,
|
|
7794
|
+
":hover": editableCellType && {
|
|
7795
|
+
background: isEditMode ? colors.lightBlueBackground : colors.neutral100
|
|
7796
|
+
},
|
|
7797
|
+
background: isEditMode ? colors.lightBlueBackground : (theme) => theme.palette.background.default
|
|
7798
|
+
},
|
|
7799
|
+
children: /* @__PURE__ */ jsxs80(
|
|
7800
|
+
Box33,
|
|
7801
|
+
{
|
|
7802
|
+
p: 1,
|
|
7803
|
+
ref: cellRef,
|
|
7804
|
+
overflow: "hidden",
|
|
7805
|
+
textOverflow: "ellipsis",
|
|
7806
|
+
whiteSpace: "nowrap",
|
|
7807
|
+
children: [
|
|
7808
|
+
isCellHovered ? /* @__PURE__ */ jsx118(Tooltip7, { title: isEditMode ? "" : "Toggle Edit Mode", children: /* @__PURE__ */ jsx118(
|
|
7809
|
+
IconButton4,
|
|
7810
|
+
{
|
|
7811
|
+
onClick: handleEditClick,
|
|
7812
|
+
sx: {
|
|
7813
|
+
top: 0,
|
|
7814
|
+
right: 0,
|
|
7815
|
+
zIndex: 1,
|
|
7816
|
+
borderRadius: 0,
|
|
7817
|
+
position: "absolute",
|
|
7818
|
+
background: isEditMode ? colors.lightBlueBackground : colors.neutral100,
|
|
7819
|
+
"&:hover": {
|
|
7820
|
+
backgroundColor: isEditMode ? colors.lightBlueBackground : colors.neutral150
|
|
7821
|
+
}
|
|
7822
|
+
},
|
|
7823
|
+
children: isEditMode ? /* @__PURE__ */ jsx118(Close2, { fontSize: "small", color: "error" }) : /* @__PURE__ */ jsx118(Edit3, { fontSize: "small" })
|
|
7824
|
+
}
|
|
7825
|
+
) }) : null,
|
|
7826
|
+
isEditMode && editableCellType ? editableComponents[editableCellType] : typeof readOnlyValue === "boolean" ? getReadOnlyBooleanIcon(readOnlyValue) : readOnlyValue
|
|
7827
|
+
]
|
|
7828
|
+
}
|
|
7829
|
+
)
|
|
7830
|
+
}
|
|
7831
|
+
) });
|
|
7382
7832
|
};
|
|
7383
|
-
var TableDesktop_default = TableDesktop;
|
|
7384
7833
|
|
|
7385
7834
|
// src/components/TableHeader/TableHeader.tsx
|
|
7386
|
-
import { memo as
|
|
7835
|
+
import { memo as memo23, useEffect as useEffect14, useState as useState21 } from "react";
|
|
7387
7836
|
import { ImportExport as ImportExportIcon } from "@mui/icons-material";
|
|
7388
|
-
import { TableCell as
|
|
7837
|
+
import { TableCell as TableCell7, TableHead as TableHead3, TableRow as TableRow6, TableSortLabel as TableSortLabel3 } from "@mui/material";
|
|
7389
7838
|
import { makeStyles as makeStyles50 } from "tss-react/mui";
|
|
7390
|
-
import { jsx as
|
|
7839
|
+
import { jsx as jsx119 } from "react/jsx-runtime";
|
|
7391
7840
|
var useStyles50 = makeStyles50()(() => ({
|
|
7392
7841
|
sortLabel: {
|
|
7393
7842
|
"& .MuiTableSortLabel-icon": {
|
|
@@ -7396,9 +7845,9 @@ var useStyles50 = makeStyles50()(() => ({
|
|
|
7396
7845
|
}
|
|
7397
7846
|
}));
|
|
7398
7847
|
var TableHeader = ({ cells, onSort = null }) => {
|
|
7399
|
-
const [sortableCells, setSortableCells] =
|
|
7848
|
+
const [sortableCells, setSortableCells] = useState21([]);
|
|
7400
7849
|
const { classes } = useStyles50();
|
|
7401
|
-
|
|
7850
|
+
useEffect14(() => {
|
|
7402
7851
|
setSortableCells(cells);
|
|
7403
7852
|
}, []);
|
|
7404
7853
|
const getNewSortDirection = (direction) => {
|
|
@@ -7432,7 +7881,7 @@ var TableHeader = ({ cells, onSort = null }) => {
|
|
|
7432
7881
|
});
|
|
7433
7882
|
setSortableCells(sortedCells);
|
|
7434
7883
|
};
|
|
7435
|
-
return /* @__PURE__ */
|
|
7884
|
+
return /* @__PURE__ */ jsx119(TableHead3, { children: /* @__PURE__ */ jsx119(TableRow6, { children: sortableCells.map((cell, key) => /* @__PURE__ */ jsx119(TableCell7, { children: cell.isSortable ? /* @__PURE__ */ jsx119(
|
|
7436
7885
|
TableSortLabel3,
|
|
7437
7886
|
{
|
|
7438
7887
|
className: classes.sortLabel,
|
|
@@ -7443,12 +7892,12 @@ var TableHeader = ({ cells, onSort = null }) => {
|
|
|
7443
7892
|
}
|
|
7444
7893
|
) : cell.label }, cell.label || key)) }) });
|
|
7445
7894
|
};
|
|
7446
|
-
var TableHeader_default =
|
|
7895
|
+
var TableHeader_default = memo23(TableHeader);
|
|
7447
7896
|
|
|
7448
7897
|
// src/components/TextDivider/TextDivider.tsx
|
|
7449
|
-
import { Box as
|
|
7898
|
+
import { Box as Box34, Typography as Typography29, Divider as Divider10, Button as Button14 } from "@mui/material";
|
|
7450
7899
|
import { makeStyles as makeStyles51 } from "tss-react/mui";
|
|
7451
|
-
import { jsx as
|
|
7900
|
+
import { jsx as jsx120, jsxs as jsxs81 } from "react/jsx-runtime";
|
|
7452
7901
|
var useStyles51 = makeStyles51()(() => ({
|
|
7453
7902
|
icon: {
|
|
7454
7903
|
fontSize: 20
|
|
@@ -7485,19 +7934,19 @@ var TextDivider = ({
|
|
|
7485
7934
|
}) => {
|
|
7486
7935
|
const { classes } = useStyles51();
|
|
7487
7936
|
const iconColor = color ?? colors.neutral900;
|
|
7488
|
-
return /* @__PURE__ */
|
|
7489
|
-
|
|
7937
|
+
return /* @__PURE__ */ jsxs81(
|
|
7938
|
+
Box34,
|
|
7490
7939
|
{
|
|
7491
7940
|
display: "flex",
|
|
7492
7941
|
alignItems: "center",
|
|
7493
7942
|
justifyContent: "space-between",
|
|
7494
7943
|
className: classes.container,
|
|
7495
7944
|
children: [
|
|
7496
|
-
/* @__PURE__ */
|
|
7497
|
-
/* @__PURE__ */
|
|
7498
|
-
Icon2 && iconPosition === "left" && /* @__PURE__ */
|
|
7499
|
-
/* @__PURE__ */
|
|
7500
|
-
|
|
7945
|
+
/* @__PURE__ */ jsx120(Divider10, { className: classes.leftDivider }),
|
|
7946
|
+
/* @__PURE__ */ jsx120(Button14, { onClick, disabled: !onClick, className: classes.button, children: /* @__PURE__ */ jsxs81(Box34, { className: classes.center, children: [
|
|
7947
|
+
Icon2 && iconPosition === "left" && /* @__PURE__ */ jsx120(Icon2, { className: classes.icon, style: { color: iconColor } }),
|
|
7948
|
+
/* @__PURE__ */ jsx120(
|
|
7949
|
+
Typography29,
|
|
7501
7950
|
{
|
|
7502
7951
|
color: "textSecondary",
|
|
7503
7952
|
className: classes.title,
|
|
@@ -7505,9 +7954,9 @@ var TextDivider = ({
|
|
|
7505
7954
|
children: title
|
|
7506
7955
|
}
|
|
7507
7956
|
),
|
|
7508
|
-
Icon2 && iconPosition === "right" && /* @__PURE__ */
|
|
7957
|
+
Icon2 && iconPosition === "right" && /* @__PURE__ */ jsx120(Icon2, { className: classes.icon, style: { color: iconColor } })
|
|
7509
7958
|
] }) }),
|
|
7510
|
-
/* @__PURE__ */
|
|
7959
|
+
/* @__PURE__ */ jsx120(Divider10, { className: classes.rightDivider })
|
|
7511
7960
|
]
|
|
7512
7961
|
}
|
|
7513
7962
|
);
|
|
@@ -7519,7 +7968,7 @@ import { DateRangePicker } from "react-dates";
|
|
|
7519
7968
|
import { makeStyles as makeStyles52 } from "tss-react/mui";
|
|
7520
7969
|
import "react-dates/initialize";
|
|
7521
7970
|
import "react-dates/lib/css/_datepicker.css";
|
|
7522
|
-
import { jsx as
|
|
7971
|
+
import { jsx as jsx121 } from "react/jsx-runtime";
|
|
7523
7972
|
var useStyles52 = makeStyles52()((theme) => ({
|
|
7524
7973
|
wrapper: {
|
|
7525
7974
|
"& .DateRangePicker": {
|
|
@@ -7615,15 +8064,15 @@ var ThemedDateRangePicker = ({
|
|
|
7615
8064
|
...props
|
|
7616
8065
|
}) => {
|
|
7617
8066
|
const { classes, cx } = useStyles52();
|
|
7618
|
-
return /* @__PURE__ */
|
|
8067
|
+
return /* @__PURE__ */ jsx121("div", { className: cx(classes.wrapper, className), children: /* @__PURE__ */ jsx121(DateRangePicker, { ...props }) });
|
|
7619
8068
|
};
|
|
7620
8069
|
var ThemedDateRangePicker_default = ThemedDateRangePicker;
|
|
7621
8070
|
|
|
7622
8071
|
// src/components/TheToolbar/TheToolbar.tsx
|
|
7623
|
-
import { memo as
|
|
7624
|
-
import { AppBar, Box as
|
|
8072
|
+
import { memo as memo24 } from "react";
|
|
8073
|
+
import { AppBar, Box as Box35, Toolbar } from "@mui/material";
|
|
7625
8074
|
import { makeStyles as makeStyles53 } from "tss-react/mui";
|
|
7626
|
-
import { jsx as
|
|
8075
|
+
import { jsx as jsx122, jsxs as jsxs82 } from "react/jsx-runtime";
|
|
7627
8076
|
var useStyles53 = makeStyles53()((theme) => ({
|
|
7628
8077
|
menuButton: {
|
|
7629
8078
|
color: theme.palette.primary.contrastText
|
|
@@ -7643,9 +8092,9 @@ var TheToolbar = ({
|
|
|
7643
8092
|
rightSection
|
|
7644
8093
|
}) => {
|
|
7645
8094
|
const { classes } = useStyles53();
|
|
7646
|
-
return /* @__PURE__ */
|
|
7647
|
-
/* @__PURE__ */
|
|
7648
|
-
/* @__PURE__ */
|
|
8095
|
+
return /* @__PURE__ */ jsxs82(Box35, { children: [
|
|
8096
|
+
/* @__PURE__ */ jsx122(AppBar, { children: /* @__PURE__ */ jsxs82(Toolbar, { className: classes.topBar, children: [
|
|
8097
|
+
/* @__PURE__ */ jsx122(
|
|
7649
8098
|
RoundButton_default,
|
|
7650
8099
|
{
|
|
7651
8100
|
className: classes.menuButton,
|
|
@@ -7654,7 +8103,7 @@ var TheToolbar = ({
|
|
|
7654
8103
|
onClick: handleOpen
|
|
7655
8104
|
}
|
|
7656
8105
|
),
|
|
7657
|
-
/* @__PURE__ */
|
|
8106
|
+
/* @__PURE__ */ jsx122(
|
|
7658
8107
|
CompanyLogo_default,
|
|
7659
8108
|
{
|
|
7660
8109
|
size: "small",
|
|
@@ -7663,30 +8112,30 @@ var TheToolbar = ({
|
|
|
7663
8112
|
imageLogoLightSmall
|
|
7664
8113
|
}
|
|
7665
8114
|
),
|
|
7666
|
-
/* @__PURE__ */
|
|
7667
|
-
/* @__PURE__ */
|
|
8115
|
+
/* @__PURE__ */ jsx122(Box35, { ml: 2, children: leftSection }),
|
|
8116
|
+
/* @__PURE__ */ jsx122(Box35, { ml: "auto", children: rightSection })
|
|
7668
8117
|
] }) }),
|
|
7669
8118
|
LeftDrawer
|
|
7670
8119
|
] });
|
|
7671
8120
|
};
|
|
7672
|
-
var TheToolbar_default =
|
|
8121
|
+
var TheToolbar_default = memo24(TheToolbar);
|
|
7673
8122
|
|
|
7674
8123
|
// src/components/ToastMessage/ToastMessage.tsx
|
|
7675
8124
|
import { Alert as MuiAlert, Snackbar } from "@mui/material";
|
|
7676
|
-
import { jsx as
|
|
8125
|
+
import { jsx as jsx123 } from "react/jsx-runtime";
|
|
7677
8126
|
var ToastMessage = ({
|
|
7678
8127
|
toastType,
|
|
7679
8128
|
toastMessage,
|
|
7680
8129
|
open,
|
|
7681
8130
|
onClose
|
|
7682
|
-
}) => /* @__PURE__ */
|
|
8131
|
+
}) => /* @__PURE__ */ jsx123(
|
|
7683
8132
|
Snackbar,
|
|
7684
8133
|
{
|
|
7685
8134
|
open,
|
|
7686
8135
|
autoHideDuration: 1500,
|
|
7687
8136
|
onClose,
|
|
7688
8137
|
anchorOrigin: { vertical: "top", horizontal: "right" },
|
|
7689
|
-
children: /* @__PURE__ */
|
|
8138
|
+
children: /* @__PURE__ */ jsx123(
|
|
7690
8139
|
MuiAlert,
|
|
7691
8140
|
{
|
|
7692
8141
|
elevation: 6,
|
|
@@ -7714,16 +8163,16 @@ var ToastMessage_default = ToastMessage;
|
|
|
7714
8163
|
|
|
7715
8164
|
// src/components/TwoButtonDialog/TwoButtonDialog.tsx
|
|
7716
8165
|
import {
|
|
7717
|
-
Typography as
|
|
8166
|
+
Typography as Typography30,
|
|
7718
8167
|
Dialog as Dialog5,
|
|
7719
8168
|
Backdrop,
|
|
7720
|
-
Box as
|
|
8169
|
+
Box as Box36,
|
|
7721
8170
|
Divider as Divider11,
|
|
7722
8171
|
Paper as Paper12,
|
|
7723
8172
|
Fade as Fade2
|
|
7724
8173
|
} from "@mui/material";
|
|
7725
8174
|
import { makeStyles as makeStyles54 } from "tss-react/mui";
|
|
7726
|
-
import { jsx as
|
|
8175
|
+
import { jsx as jsx124, jsxs as jsxs83 } from "react/jsx-runtime";
|
|
7727
8176
|
var useStyles54 = makeStyles54()((theme) => ({
|
|
7728
8177
|
paper: {
|
|
7729
8178
|
padding: theme.spacing(2)
|
|
@@ -7753,7 +8202,7 @@ var TwoButtonDialog = ({
|
|
|
7753
8202
|
cancelButton
|
|
7754
8203
|
}) => {
|
|
7755
8204
|
const { classes } = useStyles54();
|
|
7756
|
-
return /* @__PURE__ */
|
|
8205
|
+
return /* @__PURE__ */ jsx124(
|
|
7757
8206
|
Dialog5,
|
|
7758
8207
|
{
|
|
7759
8208
|
open,
|
|
@@ -7763,10 +8212,10 @@ var TwoButtonDialog = ({
|
|
|
7763
8212
|
closeAfterTransition: true,
|
|
7764
8213
|
BackdropComponent: Backdrop,
|
|
7765
8214
|
BackdropProps: { timeout: 500 },
|
|
7766
|
-
children: /* @__PURE__ */
|
|
7767
|
-
/* @__PURE__ */
|
|
7768
|
-
/* @__PURE__ */
|
|
7769
|
-
|
|
8215
|
+
children: /* @__PURE__ */ jsx124(Fade2, { in: open, children: /* @__PURE__ */ jsxs83(Paper12, { className: classes.paper, children: [
|
|
8216
|
+
/* @__PURE__ */ jsxs83(Box36, { className: classes.mb, children: [
|
|
8217
|
+
/* @__PURE__ */ jsx124(Typography30, { variant: "h5", component: "div", children: /* @__PURE__ */ jsx124(
|
|
8218
|
+
Box36,
|
|
7770
8219
|
{
|
|
7771
8220
|
sx: {
|
|
7772
8221
|
fontWeight: 600
|
|
@@ -7774,23 +8223,23 @@ var TwoButtonDialog = ({
|
|
|
7774
8223
|
children: title
|
|
7775
8224
|
}
|
|
7776
8225
|
) }),
|
|
7777
|
-
/* @__PURE__ */
|
|
7778
|
-
|
|
8226
|
+
/* @__PURE__ */ jsxs83(
|
|
8227
|
+
Box36,
|
|
7779
8228
|
{
|
|
7780
8229
|
className: classes.mt,
|
|
7781
8230
|
sx: {
|
|
7782
8231
|
fontWeight: 600
|
|
7783
8232
|
},
|
|
7784
8233
|
children: [
|
|
7785
|
-
subtitle1 && /* @__PURE__ */
|
|
7786
|
-
subtitle2 && /* @__PURE__ */
|
|
8234
|
+
subtitle1 && /* @__PURE__ */ jsx124(Typography30, { variant: "subtitle1", children: subtitle1 }),
|
|
8235
|
+
subtitle2 && /* @__PURE__ */ jsx124(Typography30, { variant: "subtitle1", children: subtitle2 })
|
|
7787
8236
|
]
|
|
7788
8237
|
}
|
|
7789
8238
|
)
|
|
7790
8239
|
] }),
|
|
7791
|
-
/* @__PURE__ */
|
|
7792
|
-
/* @__PURE__ */
|
|
7793
|
-
/* @__PURE__ */
|
|
8240
|
+
/* @__PURE__ */ jsx124(Divider11, {}),
|
|
8241
|
+
/* @__PURE__ */ jsxs83(Box36, { className: classes.buttonContainer, children: [
|
|
8242
|
+
/* @__PURE__ */ jsx124(
|
|
7794
8243
|
FilledButton_default,
|
|
7795
8244
|
{
|
|
7796
8245
|
copy: cancelLabel,
|
|
@@ -7803,7 +8252,7 @@ var TwoButtonDialog = ({
|
|
|
7803
8252
|
}
|
|
7804
8253
|
}
|
|
7805
8254
|
),
|
|
7806
|
-
/* @__PURE__ */
|
|
8255
|
+
/* @__PURE__ */ jsx124(
|
|
7807
8256
|
FilledButton_default,
|
|
7808
8257
|
{
|
|
7809
8258
|
color: "primary",
|
|
@@ -7812,7 +8261,7 @@ var TwoButtonDialog = ({
|
|
|
7812
8261
|
}
|
|
7813
8262
|
)
|
|
7814
8263
|
] }),
|
|
7815
|
-
/* @__PURE__ */
|
|
8264
|
+
/* @__PURE__ */ jsx124(Loading_default, { isLoading: dialogLoading })
|
|
7816
8265
|
] }) })
|
|
7817
8266
|
}
|
|
7818
8267
|
);
|
|
@@ -7820,11 +8269,11 @@ var TwoButtonDialog = ({
|
|
|
7820
8269
|
var TwoButtonDialog_default = TwoButtonDialog;
|
|
7821
8270
|
|
|
7822
8271
|
// src/components/UserBust/UserBust.tsx
|
|
7823
|
-
import { memo as
|
|
7824
|
-
import { Avatar as Avatar2, Typography as
|
|
7825
|
-
import { jsx as
|
|
7826
|
-
var UserBust = ({ user, avatarProps, typographyProps }) => /* @__PURE__ */
|
|
7827
|
-
/* @__PURE__ */
|
|
8272
|
+
import { memo as memo25 } from "react";
|
|
8273
|
+
import { Avatar as Avatar2, Typography as Typography31 } from "@mui/material";
|
|
8274
|
+
import { jsx as jsx125, jsxs as jsxs84 } from "react/jsx-runtime";
|
|
8275
|
+
var UserBust = ({ user, avatarProps, typographyProps }) => /* @__PURE__ */ jsxs84("div", { children: [
|
|
8276
|
+
/* @__PURE__ */ jsx125(
|
|
7828
8277
|
Avatar2,
|
|
7829
8278
|
{
|
|
7830
8279
|
src: user.profile_picture,
|
|
@@ -7832,18 +8281,18 @@ var UserBust = ({ user, avatarProps, typographyProps }) => /* @__PURE__ */ jsxs8
|
|
|
7832
8281
|
style: { width: avatarProps.width, height: avatarProps.height }
|
|
7833
8282
|
}
|
|
7834
8283
|
),
|
|
7835
|
-
/* @__PURE__ */
|
|
7836
|
-
/* @__PURE__ */
|
|
7837
|
-
/* @__PURE__ */
|
|
8284
|
+
/* @__PURE__ */ jsxs84("div", { style: { paddingTop: 16 }, children: [
|
|
8285
|
+
/* @__PURE__ */ jsx125(Typography31, { ...typographyProps.name, children: `${user.first_name} ${user.last_name}` }),
|
|
8286
|
+
/* @__PURE__ */ jsx125(Typography31, { ...typographyProps.username, children: user.username })
|
|
7838
8287
|
] })
|
|
7839
8288
|
] });
|
|
7840
|
-
var UserBust_default =
|
|
8289
|
+
var UserBust_default = memo25(UserBust);
|
|
7841
8290
|
|
|
7842
8291
|
// src/components/icons/IconChart.tsx
|
|
7843
|
-
import { jsx as
|
|
8292
|
+
import { jsx as jsx126 } from "react/jsx-runtime";
|
|
7844
8293
|
var SvgIconChart = (props) => {
|
|
7845
8294
|
const { fill } = props;
|
|
7846
|
-
return /* @__PURE__ */
|
|
8295
|
+
return /* @__PURE__ */ jsx126(
|
|
7847
8296
|
"svg",
|
|
7848
8297
|
{
|
|
7849
8298
|
width: "20",
|
|
@@ -7852,7 +8301,7 @@ var SvgIconChart = (props) => {
|
|
|
7852
8301
|
fill: "none",
|
|
7853
8302
|
xmlns: "http://www.w3.org/2000/svg",
|
|
7854
8303
|
...props,
|
|
7855
|
-
children: /* @__PURE__ */
|
|
8304
|
+
children: /* @__PURE__ */ jsx126(
|
|
7856
8305
|
"path",
|
|
7857
8306
|
{
|
|
7858
8307
|
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",
|
|
@@ -7918,6 +8367,7 @@ export {
|
|
|
7918
8367
|
ScrollableDialog_default as ScrollableDialog,
|
|
7919
8368
|
SearchAndFilterHeader_default as SearchAndFilterHeader,
|
|
7920
8369
|
SearchAndFilterHeaderForTable_default as SearchAndFilterHeaderForTable,
|
|
8370
|
+
SearchFieldDebounced,
|
|
7921
8371
|
SearchWithFilters_default as SearchWithFilters,
|
|
7922
8372
|
SearchWithFiltersForTable_default as SearchWithFiltersForTable,
|
|
7923
8373
|
SectionName_default as SectionName,
|
|
@@ -7929,6 +8379,9 @@ export {
|
|
|
7929
8379
|
Switch_default as Switch,
|
|
7930
8380
|
Table_default as Table,
|
|
7931
8381
|
TableDesktop_default as TableDesktop,
|
|
8382
|
+
TableDesktopFooter,
|
|
8383
|
+
TableDesktopRowCell,
|
|
8384
|
+
TableDesktopSmartSelect,
|
|
7932
8385
|
TableEmptyResult_default as TableEmptyResult,
|
|
7933
8386
|
TableHeader_default as TableHeader,
|
|
7934
8387
|
TableLoading_default as TableLoading,
|