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