@natoora-libs/core 0.1.20 → 0.2.0-vini-dev-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 +472 -448
- package/dist/components/index.cjs.map +1 -1
- package/dist/components/index.d.cts +24 -24
- package/dist/components/index.d.ts +24 -24
- package/dist/components/index.js +482 -445
- package/dist/components/index.js.map +1 -1
- package/package.json +13 -12
|
@@ -409,33 +409,35 @@ var import_react = require("react");
|
|
|
409
409
|
var import_icons_material = require("@mui/icons-material");
|
|
410
410
|
var import_material = require("@mui/material");
|
|
411
411
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
412
|
-
var ActiveFiltersIconButton = (0, import_react.memo)(
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
enableRipple = false,
|
|
416
|
-
numActiveFilters,
|
|
417
|
-
handleClick
|
|
418
|
-
}) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
419
|
-
import_material.IconButton,
|
|
420
|
-
{
|
|
421
|
-
disableRipple: !enableRipple,
|
|
422
|
-
onClick: handleClick,
|
|
423
|
-
"data-testid": "filter-menu-button",
|
|
424
|
-
sx: { padding: 0, gap: 1 },
|
|
412
|
+
var ActiveFiltersIconButton = (0, import_react.memo)(
|
|
413
|
+
({
|
|
414
|
+
label,
|
|
425
415
|
className,
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
))
|
|
416
|
+
enableRipple = false,
|
|
417
|
+
numActiveFilters,
|
|
418
|
+
handleClick
|
|
419
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
420
|
+
import_material.IconButton,
|
|
421
|
+
{
|
|
422
|
+
disableRipple: !enableRipple,
|
|
423
|
+
onClick: handleClick,
|
|
424
|
+
"data-testid": "filter-menu-button",
|
|
425
|
+
sx: { padding: 0, gap: 1 },
|
|
426
|
+
className,
|
|
427
|
+
children: [
|
|
428
|
+
label ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_material.Typography, { variant: "button", fontSize: 12, marginTop: 0.5, children: label }) : null,
|
|
429
|
+
numActiveFilters > 0 ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
430
|
+
import_material.Chip,
|
|
431
|
+
{
|
|
432
|
+
sx: { height: 24 },
|
|
433
|
+
label: numActiveFilters,
|
|
434
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons_material.FilterList, { style: { fontSize: 18 }, color: "primary" })
|
|
435
|
+
}
|
|
436
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons_material.FilterList, { style: { fontSize: 18 } })
|
|
437
|
+
]
|
|
438
|
+
}
|
|
439
|
+
)
|
|
440
|
+
);
|
|
439
441
|
|
|
440
442
|
// src/components/AlertDialog/AlertDialog.tsx
|
|
441
443
|
var import_material2 = require("@mui/material");
|
|
@@ -749,7 +751,6 @@ var resolveObjectType = (object, fieldName) => {
|
|
|
749
751
|
if (!object || typeof object !== "object") {
|
|
750
752
|
return object;
|
|
751
753
|
}
|
|
752
|
-
;
|
|
753
754
|
return object[fieldName] ?? "";
|
|
754
755
|
};
|
|
755
756
|
|
|
@@ -950,27 +951,23 @@ var DynamicOverflowTooltip = ({
|
|
|
950
951
|
tooltipDescription
|
|
951
952
|
}) => {
|
|
952
953
|
const ref = (0, import_react4.useRef)(null);
|
|
953
|
-
const { isOverflowed } = useCheckOverflow({
|
|
954
|
-
|
|
955
|
-
|
|
954
|
+
const { isOverflowed } = useCheckOverflow({
|
|
955
|
+
targetRef: ref,
|
|
956
|
+
effectDependencies: [children, tooltipDescription]
|
|
957
|
+
});
|
|
958
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_material6.Tooltip, { arrow, title: isOverflowed ? tooltipDescription : "", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
959
|
+
import_material6.Box,
|
|
956
960
|
{
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
overflowX: "hidden",
|
|
966
|
-
whiteSpace: "nowrap",
|
|
967
|
-
textOverflow: "ellipsis"
|
|
968
|
-
},
|
|
969
|
-
children
|
|
970
|
-
}
|
|
971
|
-
)
|
|
961
|
+
ref,
|
|
962
|
+
sx: {
|
|
963
|
+
maxWidth,
|
|
964
|
+
overflowX: "hidden",
|
|
965
|
+
whiteSpace: "nowrap",
|
|
966
|
+
textOverflow: "ellipsis"
|
|
967
|
+
},
|
|
968
|
+
children
|
|
972
969
|
}
|
|
973
|
-
);
|
|
970
|
+
) });
|
|
974
971
|
};
|
|
975
972
|
|
|
976
973
|
// src/components/FilterOptionsCheckboxes/FilterOptionsCheckboxes.tsx
|
|
@@ -1019,7 +1016,14 @@ var FilterOptionsCheckboxes = ({
|
|
|
1019
1016
|
justifyContent: "space-between"
|
|
1020
1017
|
},
|
|
1021
1018
|
children: [
|
|
1022
|
-
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1019
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1020
|
+
DynamicOverflowTooltip,
|
|
1021
|
+
{
|
|
1022
|
+
tooltipDescription: String(filterLabel),
|
|
1023
|
+
arrow: true,
|
|
1024
|
+
children: filterLabel
|
|
1025
|
+
}
|
|
1026
|
+
),
|
|
1023
1027
|
shouldShowCheckOnFilter?.(columnId, option) ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_material7.Tooltip, { title: "This filter is saved as default", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_Check.default, { fontSize: "small", color: "action" }) }) : null
|
|
1024
1028
|
]
|
|
1025
1029
|
}
|
|
@@ -1055,7 +1059,6 @@ var SearchFieldDebounced = ({
|
|
|
1055
1059
|
if (debounceRef.current) {
|
|
1056
1060
|
clearTimeout(debounceRef.current);
|
|
1057
1061
|
}
|
|
1058
|
-
;
|
|
1059
1062
|
debounceRef.current = window.setTimeout(() => {
|
|
1060
1063
|
const trimmedInput = input.trim();
|
|
1061
1064
|
if (trimmedInput.length < minCharacters) {
|
|
@@ -1181,35 +1184,37 @@ var AutocompleteFilterMenuContent = ({
|
|
|
1181
1184
|
display: "flex",
|
|
1182
1185
|
flexDirection: "column"
|
|
1183
1186
|
},
|
|
1184
|
-
children: selectedFilterOptions?.map(
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1187
|
+
children: selectedFilterOptions?.map(
|
|
1188
|
+
(option) => {
|
|
1189
|
+
const filterId = resolveObjectType(option, "id");
|
|
1190
|
+
const filterLabel = resolveObjectType(option, labelFieldName);
|
|
1191
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
1192
|
+
import_material9.Box,
|
|
1193
|
+
{
|
|
1194
|
+
sx: {
|
|
1195
|
+
pl: 1,
|
|
1196
|
+
pr: 1.25,
|
|
1197
|
+
flexGrow: 1,
|
|
1198
|
+
display: "flex",
|
|
1199
|
+
alignItems: "center",
|
|
1200
|
+
justifyContent: "space-between"
|
|
1201
|
+
},
|
|
1202
|
+
children: [
|
|
1203
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_material9.Box, { sx: { maxWidth }, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1204
|
+
import_material9.Chip,
|
|
1205
|
+
{
|
|
1206
|
+
size: "small",
|
|
1207
|
+
label: filterLabel,
|
|
1208
|
+
onDelete: () => onFilterOptionChange(option)
|
|
1209
|
+
}
|
|
1210
|
+
) }),
|
|
1211
|
+
shouldShowCheckOnFilter?.(columnId, option) ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_material9.Tooltip, { title: "This filter is saved as default", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_Check2.default, { fontSize: "small", color: "action" }) }) : null
|
|
1212
|
+
]
|
|
1197
1213
|
},
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
size: "small",
|
|
1203
|
-
label: filterLabel,
|
|
1204
|
-
onDelete: () => onFilterOptionChange(option)
|
|
1205
|
-
}
|
|
1206
|
-
) }),
|
|
1207
|
-
shouldShowCheckOnFilter?.(columnId, option) ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_material9.Tooltip, { title: "This filter is saved as default", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_Check2.default, { fontSize: "small", color: "action" }) }) : null
|
|
1208
|
-
]
|
|
1209
|
-
},
|
|
1210
|
-
filterId
|
|
1211
|
-
);
|
|
1212
|
-
})
|
|
1214
|
+
filterId
|
|
1215
|
+
);
|
|
1216
|
+
}
|
|
1217
|
+
)
|
|
1213
1218
|
}
|
|
1214
1219
|
),
|
|
1215
1220
|
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_material9.Divider, { sx: { my: 0.5 } })
|
|
@@ -1355,9 +1360,7 @@ var BottomBar_default = BottomBar;
|
|
|
1355
1360
|
// src/components/BoxButton/BoxButton.tsx
|
|
1356
1361
|
var import_react6 = require("react");
|
|
1357
1362
|
var import_material12 = require("@mui/material");
|
|
1358
|
-
var
|
|
1359
|
-
var import_orange = __toESM(require("@mui/material/colors/orange"), 1);
|
|
1360
|
-
var import_red = __toESM(require("@mui/material/colors/red"), 1);
|
|
1363
|
+
var import_colors6 = require("@mui/material/colors");
|
|
1361
1364
|
var import_mui6 = require("tss-react/mui");
|
|
1362
1365
|
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
1363
1366
|
var useStyles6 = (0, import_mui6.makeStyles)()((theme) => ({
|
|
@@ -1384,17 +1387,17 @@ var useStyles6 = (0, import_mui6.makeStyles)()((theme) => ({
|
|
|
1384
1387
|
borderStyle: "solid"
|
|
1385
1388
|
},
|
|
1386
1389
|
green: {
|
|
1387
|
-
borderColor:
|
|
1390
|
+
borderColor: import_colors6.green["500"],
|
|
1388
1391
|
borderWidth: 3,
|
|
1389
1392
|
borderStyle: "solid"
|
|
1390
1393
|
},
|
|
1391
1394
|
red: {
|
|
1392
|
-
borderColor:
|
|
1395
|
+
borderColor: import_colors6.red["500"],
|
|
1393
1396
|
borderWidth: 3,
|
|
1394
1397
|
borderStyle: "solid"
|
|
1395
1398
|
},
|
|
1396
1399
|
orange: {
|
|
1397
|
-
borderColor:
|
|
1400
|
+
borderColor: import_colors6.orange["500"],
|
|
1398
1401
|
borderWidth: 3,
|
|
1399
1402
|
borderStyle: "solid"
|
|
1400
1403
|
},
|
|
@@ -1415,7 +1418,7 @@ var BoxButton = (props) => {
|
|
|
1415
1418
|
children: [
|
|
1416
1419
|
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_material12.Typography, { variant: "button", children: label }),
|
|
1417
1420
|
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
1418
|
-
import_material12.
|
|
1421
|
+
import_material12.Grid,
|
|
1419
1422
|
{
|
|
1420
1423
|
container: true,
|
|
1421
1424
|
direction: "row",
|
|
@@ -1424,8 +1427,8 @@ var BoxButton = (props) => {
|
|
|
1424
1427
|
alignItems: "center"
|
|
1425
1428
|
},
|
|
1426
1429
|
children: [
|
|
1427
|
-
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_material12.
|
|
1428
|
-
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_material12.
|
|
1430
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_material12.Grid, { size: 9, children: main }),
|
|
1431
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_material12.Grid, { className: classes.c_box_button__extra, size: 3, children: extra })
|
|
1429
1432
|
]
|
|
1430
1433
|
}
|
|
1431
1434
|
)
|
|
@@ -4374,7 +4377,7 @@ var DataGrid_default = DataGrid;
|
|
|
4374
4377
|
var import_moment = __toESM(require("moment"), 1);
|
|
4375
4378
|
|
|
4376
4379
|
// src/resources/styles/themes/default.js
|
|
4377
|
-
var
|
|
4380
|
+
var import_colors26 = require("@mui/material/colors");
|
|
4378
4381
|
var import_styles = require("@mui/material/styles");
|
|
4379
4382
|
var defaultTheme = (0, import_styles.createTheme)({
|
|
4380
4383
|
typography: {
|
|
@@ -4389,14 +4392,14 @@ var defaultTheme = (0, import_styles.createTheme)({
|
|
|
4389
4392
|
primary: {
|
|
4390
4393
|
main: colors.muiPrimary,
|
|
4391
4394
|
alternate: colors.muiPrimaryAlternate,
|
|
4392
|
-
light:
|
|
4393
|
-
contrastText:
|
|
4395
|
+
light: import_colors26.grey["100"],
|
|
4396
|
+
contrastText: import_colors26.grey["50"]
|
|
4394
4397
|
},
|
|
4395
4398
|
secondary: {
|
|
4396
4399
|
main: colors.muiSecondary,
|
|
4397
4400
|
alternate: colors.muiSecondaryAlternate,
|
|
4398
|
-
dark:
|
|
4399
|
-
light:
|
|
4401
|
+
dark: import_colors26.grey["900"],
|
|
4402
|
+
light: import_colors26.grey["50"]
|
|
4400
4403
|
},
|
|
4401
4404
|
success: {
|
|
4402
4405
|
main: colors.muiSuccess,
|
|
@@ -4623,14 +4626,13 @@ var FileCard_default = FileCard;
|
|
|
4623
4626
|
// src/components/FilledLabel/FilledLabel.tsx
|
|
4624
4627
|
var import_react18 = require("react");
|
|
4625
4628
|
var import_material34 = require("@mui/material");
|
|
4626
|
-
var
|
|
4627
|
-
var import_teal = __toESM(require("@mui/material/colors/teal"), 1);
|
|
4629
|
+
var import_colors30 = require("@mui/material/colors");
|
|
4628
4630
|
var import_mui26 = require("tss-react/mui");
|
|
4629
4631
|
var import_jsx_runtime85 = require("react/jsx-runtime");
|
|
4630
4632
|
var useStyles24 = (0, import_mui26.makeStyles)()((theme) => ({
|
|
4631
4633
|
siteOne: {
|
|
4632
|
-
backgroundColor:
|
|
4633
|
-
color:
|
|
4634
|
+
backgroundColor: import_colors30.teal["50"],
|
|
4635
|
+
color: import_colors30.teal["500"],
|
|
4634
4636
|
padding: theme.spacing(0.5),
|
|
4635
4637
|
paddingLeft: theme.spacing(2),
|
|
4636
4638
|
paddingRight: theme.spacing(2),
|
|
@@ -4640,8 +4642,8 @@ var useStyles24 = (0, import_mui26.makeStyles)()((theme) => ({
|
|
|
4640
4642
|
width: "fit-content"
|
|
4641
4643
|
},
|
|
4642
4644
|
siteTwo: {
|
|
4643
|
-
backgroundColor:
|
|
4644
|
-
color:
|
|
4645
|
+
backgroundColor: import_colors30.brown["50"],
|
|
4646
|
+
color: import_colors30.brown["500"],
|
|
4645
4647
|
padding: theme.spacing(0.5),
|
|
4646
4648
|
paddingLeft: theme.spacing(2),
|
|
4647
4649
|
paddingRight: theme.spacing(2),
|
|
@@ -5031,7 +5033,7 @@ var Loading_default = Loading;
|
|
|
5031
5033
|
// src/components/LocationsSectionInfo/LocationsSectionInfo.tsx
|
|
5032
5034
|
var import_react21 = require("react");
|
|
5033
5035
|
var import_material41 = require("@mui/material");
|
|
5034
|
-
var
|
|
5036
|
+
var import_colors35 = require("@mui/material/colors");
|
|
5035
5037
|
var import_classnames2 = __toESM(require("classnames"), 1);
|
|
5036
5038
|
var import_mui32 = require("tss-react/mui");
|
|
5037
5039
|
var import_jsx_runtime92 = require("react/jsx-runtime");
|
|
@@ -5060,8 +5062,8 @@ var useStyles30 = (0, import_mui32.makeStyles)()(() => ({
|
|
|
5060
5062
|
borderColor: colors.neutral100
|
|
5061
5063
|
},
|
|
5062
5064
|
pickingStockChip: {
|
|
5063
|
-
backgroundColor:
|
|
5064
|
-
color:
|
|
5065
|
+
backgroundColor: import_colors35.purple[50],
|
|
5066
|
+
color: import_colors35.purple[500]
|
|
5065
5067
|
}
|
|
5066
5068
|
}));
|
|
5067
5069
|
var LocationsSectionInfo = ({
|
|
@@ -6270,7 +6272,7 @@ var import_mui41 = require("tss-react/mui");
|
|
|
6270
6272
|
|
|
6271
6273
|
// src/utils/useGetActiveSection.ts
|
|
6272
6274
|
var import_react26 = require("react");
|
|
6273
|
-
var transformNameToID = (name) => name.replaceAll(" ", "
|
|
6275
|
+
var transformNameToID = (name) => name.replaceAll(" ", "_").toLocaleLowerCase();
|
|
6274
6276
|
|
|
6275
6277
|
// src/components/RenderContentList/RenderContentList.tsx
|
|
6276
6278
|
var import_jsx_runtime103 = require("react/jsx-runtime");
|
|
@@ -6353,7 +6355,7 @@ var RenderContentList = ({
|
|
|
6353
6355
|
},
|
|
6354
6356
|
children: [
|
|
6355
6357
|
/* @__PURE__ */ (0, import_jsx_runtime103.jsx)(import_material51.ListItemText, { primary: item }),
|
|
6356
|
-
warningItems?.includes(item) && /* @__PURE__ */ (0, import_jsx_runtime103.jsx)(import_material51.Tooltip, { title: warningMessage, children: /* @__PURE__ */ (0, import_jsx_runtime103.jsx)(import_icons_material8.WarningAmber, { color: "warning" }) })
|
|
6358
|
+
(warningItems?.includes(item) || warningItems?.includes(id)) && /* @__PURE__ */ (0, import_jsx_runtime103.jsx)(import_material51.Tooltip, { title: warningMessage, children: /* @__PURE__ */ (0, import_jsx_runtime103.jsx)(import_icons_material8.WarningAmber, { color: "warning" }) })
|
|
6357
6359
|
]
|
|
6358
6360
|
},
|
|
6359
6361
|
id
|
|
@@ -7178,13 +7180,13 @@ var SmartSelect_default = SmartSelect;
|
|
|
7178
7180
|
// src/components/SquareLabel/SquareLabel.tsx
|
|
7179
7181
|
var import_react32 = require("react");
|
|
7180
7182
|
var import_material60 = require("@mui/material");
|
|
7181
|
-
var
|
|
7183
|
+
var import_colors50 = require("@mui/material/colors");
|
|
7182
7184
|
var import_mui50 = require("tss-react/mui");
|
|
7183
7185
|
var import_jsx_runtime112 = require("react/jsx-runtime");
|
|
7184
7186
|
var useStyles45 = (0, import_mui50.makeStyles)()((theme) => ({
|
|
7185
7187
|
red: {
|
|
7186
|
-
backgroundColor:
|
|
7187
|
-
color:
|
|
7188
|
+
backgroundColor: import_colors50.red["50"],
|
|
7189
|
+
color: import_colors50.red["500"],
|
|
7188
7190
|
padding: theme.spacing(1.5),
|
|
7189
7191
|
borderRadius: "5px",
|
|
7190
7192
|
marginTop: theme.spacing(1),
|
|
@@ -7212,7 +7214,7 @@ var LSwitch = ({
|
|
|
7212
7214
|
classes,
|
|
7213
7215
|
disabled
|
|
7214
7216
|
}) => /* @__PURE__ */ (0, import_jsx_runtime113.jsx)("div", { className: classes.c_switch, children: /* @__PURE__ */ (0, import_jsx_runtime113.jsxs)(
|
|
7215
|
-
import_material61.
|
|
7217
|
+
import_material61.Grid,
|
|
7216
7218
|
{
|
|
7217
7219
|
component: "label",
|
|
7218
7220
|
container: true,
|
|
@@ -7221,8 +7223,8 @@ var LSwitch = ({
|
|
|
7221
7223
|
alignItems: "center"
|
|
7222
7224
|
},
|
|
7223
7225
|
children: [
|
|
7224
|
-
labelOff && /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(import_material61.
|
|
7225
|
-
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)(import_material61.
|
|
7226
|
+
labelOff && /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(import_material61.Grid, { children: labelOff }),
|
|
7227
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)(import_material61.Grid, { children: /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(
|
|
7226
7228
|
import_material61.Switch,
|
|
7227
7229
|
{
|
|
7228
7230
|
checked,
|
|
@@ -7231,7 +7233,7 @@ var LSwitch = ({
|
|
|
7231
7233
|
disabled
|
|
7232
7234
|
}
|
|
7233
7235
|
) }),
|
|
7234
|
-
labelOn && /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(import_material61.
|
|
7236
|
+
labelOn && /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(import_material61.Grid, { children: labelOn })
|
|
7235
7237
|
]
|
|
7236
7238
|
}
|
|
7237
7239
|
) });
|
|
@@ -7270,244 +7272,262 @@ var findFilterIndex = (filters, filterOption) => filters.findIndex((item) => {
|
|
|
7270
7272
|
}
|
|
7271
7273
|
return false;
|
|
7272
7274
|
});
|
|
7273
|
-
var SmartTableHeaderFilterMenu = (0, import_react34.memo)(
|
|
7274
|
-
|
|
7275
|
-
|
|
7276
|
-
|
|
7277
|
-
|
|
7278
|
-
|
|
7279
|
-
|
|
7280
|
-
|
|
7281
|
-
|
|
7282
|
-
|
|
7283
|
-
headerFilters[headCell.id] ?? []
|
|
7284
|
-
|
|
7285
|
-
|
|
7286
|
-
|
|
7287
|
-
setFilterOptionsData(headCell.filterOptions);
|
|
7288
|
-
}
|
|
7289
|
-
}, [headCell.filterOptions]);
|
|
7290
|
-
const numFilterOptions = (0, import_react34.useMemo)(() => filterOptionsData?.length ?? 0, [filterOptionsData?.length]);
|
|
7291
|
-
const handleFilterMenuOpen = (event) => {
|
|
7292
|
-
if (!numFilterOptions && !headCell.isAutocompleteFilterMenu) {
|
|
7293
|
-
headCell.refetchFilterOptions?.();
|
|
7294
|
-
}
|
|
7295
|
-
setAnchorEl(event.currentTarget);
|
|
7296
|
-
};
|
|
7297
|
-
const handleFilterMenuClose = () => {
|
|
7298
|
-
setSelectedFilterOptions(headerFilters[headCell.id]);
|
|
7299
|
-
setAnchorEl(null);
|
|
7300
|
-
};
|
|
7301
|
-
const handleSelectAllChange = (checked) => {
|
|
7302
|
-
if (checked) {
|
|
7303
|
-
setSelectedFilterOptions([...filterOptionsData ?? []]);
|
|
7304
|
-
return;
|
|
7305
|
-
}
|
|
7306
|
-
setSelectedFilterOptions([]);
|
|
7307
|
-
};
|
|
7308
|
-
const handleFilterOptionChange = (option) => {
|
|
7309
|
-
const selectedIndex = findFilterIndex(selectedFilterOptions, option);
|
|
7310
|
-
let newSelected;
|
|
7311
|
-
if (selectedIndex === -1) {
|
|
7312
|
-
if (typeof option === "string") {
|
|
7313
|
-
newSelected = [...selectedFilterOptions, option];
|
|
7314
|
-
} else {
|
|
7315
|
-
newSelected = [...selectedFilterOptions, option];
|
|
7275
|
+
var SmartTableHeaderFilterMenu = (0, import_react34.memo)(
|
|
7276
|
+
({
|
|
7277
|
+
headCell,
|
|
7278
|
+
numActiveFilters,
|
|
7279
|
+
headerFilters,
|
|
7280
|
+
shouldShowCheckOnFilter,
|
|
7281
|
+
onApplyFilters
|
|
7282
|
+
}) => {
|
|
7283
|
+
const [anchorEl, setAnchorEl] = (0, import_react34.useState)(null);
|
|
7284
|
+
const [filterOptionsData, setFilterOptionsData] = (0, import_react34.useState)();
|
|
7285
|
+
const [selectedFilterOptions, setSelectedFilterOptions] = (0, import_react34.useState)(headerFilters[headCell.id] ?? []);
|
|
7286
|
+
(0, import_react34.useEffect)(() => {
|
|
7287
|
+
if (headCell.filterOptions) {
|
|
7288
|
+
setFilterOptionsData(headCell.filterOptions);
|
|
7316
7289
|
}
|
|
7317
|
-
}
|
|
7318
|
-
|
|
7319
|
-
|
|
7320
|
-
|
|
7321
|
-
|
|
7322
|
-
|
|
7323
|
-
|
|
7324
|
-
|
|
7325
|
-
|
|
7326
|
-
|
|
7327
|
-
[headCell.id]: [...selectedFilterOptions]
|
|
7290
|
+
}, [headCell.filterOptions]);
|
|
7291
|
+
const numFilterOptions = (0, import_react34.useMemo)(
|
|
7292
|
+
() => filterOptionsData?.length ?? 0,
|
|
7293
|
+
[filterOptionsData?.length]
|
|
7294
|
+
);
|
|
7295
|
+
const handleFilterMenuOpen = (event) => {
|
|
7296
|
+
if (!numFilterOptions && !headCell.isAutocompleteFilterMenu) {
|
|
7297
|
+
headCell.refetchFilterOptions?.();
|
|
7298
|
+
}
|
|
7299
|
+
setAnchorEl(event.currentTarget);
|
|
7328
7300
|
};
|
|
7329
|
-
|
|
7330
|
-
|
|
7331
|
-
|
|
7332
|
-
|
|
7333
|
-
|
|
7334
|
-
|
|
7335
|
-
|
|
7336
|
-
|
|
7337
|
-
|
|
7338
|
-
|
|
7339
|
-
numActiveFilters,
|
|
7340
|
-
handleClick: handleFilterMenuOpen,
|
|
7341
|
-
className: (0, import_classnames3.default)("filter-menu-trigger", {
|
|
7342
|
-
"has-active-filters": !!numActiveFilters || !!anchorEl
|
|
7343
|
-
})
|
|
7301
|
+
const handleFilterMenuClose = () => {
|
|
7302
|
+
setSelectedFilterOptions(headerFilters[headCell.id]);
|
|
7303
|
+
setAnchorEl(null);
|
|
7304
|
+
};
|
|
7305
|
+
const handleSelectAllChange = (checked) => {
|
|
7306
|
+
if (checked) {
|
|
7307
|
+
setSelectedFilterOptions([
|
|
7308
|
+
...filterOptionsData ?? []
|
|
7309
|
+
]);
|
|
7310
|
+
return;
|
|
7344
7311
|
}
|
|
7345
|
-
|
|
7346
|
-
|
|
7347
|
-
|
|
7348
|
-
|
|
7349
|
-
|
|
7350
|
-
|
|
7351
|
-
|
|
7352
|
-
|
|
7353
|
-
|
|
7354
|
-
|
|
7355
|
-
|
|
7356
|
-
|
|
7357
|
-
|
|
7358
|
-
|
|
7359
|
-
|
|
7360
|
-
|
|
7361
|
-
|
|
7362
|
-
|
|
7363
|
-
columnId: headCell.id,
|
|
7364
|
-
labelFieldName: headCell.fieldName ?? "",
|
|
7365
|
-
isLoading: headCell.isFetchingFilterOptions,
|
|
7366
|
-
filterOptions: headCell.filterOptions,
|
|
7367
|
-
onAutocompleteFilterChange: headCell.onAutocompleteFilterChange,
|
|
7368
|
-
selectedFilterOptions,
|
|
7369
|
-
onFilterOptionChange: handleFilterOptionChange,
|
|
7370
|
-
onApplyFiltersClick: handleApplyFiltersClick,
|
|
7371
|
-
shouldShowCheckOnFilter
|
|
7372
|
-
}
|
|
7373
|
-
) : /* @__PURE__ */ (0, import_jsx_runtime114.jsx)(
|
|
7374
|
-
CheckboxFilterMenuContent,
|
|
7375
|
-
{
|
|
7376
|
-
columnId: headCell.id,
|
|
7377
|
-
labelFieldName: headCell.fieldName ?? "",
|
|
7378
|
-
isLoading: headCell.isFetchingFilterOptions,
|
|
7379
|
-
selectedFilterOptions,
|
|
7380
|
-
filterOptions: filterOptionsData ?? [],
|
|
7381
|
-
onSelectAllChange: handleSelectAllChange,
|
|
7382
|
-
onFilterOptionChange: handleFilterOptionChange,
|
|
7383
|
-
onApplyFiltersClick: handleApplyFiltersClick,
|
|
7384
|
-
shouldShowCheckOnFilter
|
|
7385
|
-
}
|
|
7386
|
-
)
|
|
7312
|
+
setSelectedFilterOptions([]);
|
|
7313
|
+
};
|
|
7314
|
+
const handleFilterOptionChange = (option) => {
|
|
7315
|
+
const selectedIndex = findFilterIndex(selectedFilterOptions, option);
|
|
7316
|
+
let newSelected;
|
|
7317
|
+
if (selectedIndex === -1) {
|
|
7318
|
+
if (typeof option === "string") {
|
|
7319
|
+
newSelected = [...selectedFilterOptions, option];
|
|
7320
|
+
} else {
|
|
7321
|
+
newSelected = [
|
|
7322
|
+
...selectedFilterOptions,
|
|
7323
|
+
option
|
|
7324
|
+
];
|
|
7325
|
+
}
|
|
7326
|
+
} else {
|
|
7327
|
+
newSelected = selectedFilterOptions.filter(
|
|
7328
|
+
(_, index) => index !== selectedIndex
|
|
7329
|
+
);
|
|
7387
7330
|
}
|
|
7388
|
-
|
|
7389
|
-
|
|
7390
|
-
|
|
7331
|
+
setSelectedFilterOptions(newSelected);
|
|
7332
|
+
};
|
|
7333
|
+
const handleApplyFiltersClick = (shouldSave) => {
|
|
7334
|
+
const updatedFilters = {
|
|
7335
|
+
...headerFilters,
|
|
7336
|
+
[headCell.id]: [...selectedFilterOptions]
|
|
7337
|
+
};
|
|
7338
|
+
onApplyFilters?.(updatedFilters, shouldSave);
|
|
7339
|
+
setAnchorEl(null);
|
|
7340
|
+
};
|
|
7341
|
+
(0, import_react34.useEffect)(() => {
|
|
7342
|
+
setSelectedFilterOptions(headerFilters[headCell.id] ?? []);
|
|
7343
|
+
}, [headerFilters, headCell.id]);
|
|
7344
|
+
return /* @__PURE__ */ (0, import_jsx_runtime114.jsxs)(import_jsx_runtime114.Fragment, { children: [
|
|
7345
|
+
/* @__PURE__ */ (0, import_jsx_runtime114.jsx)(
|
|
7346
|
+
ActiveFiltersIconButton,
|
|
7347
|
+
{
|
|
7348
|
+
numActiveFilters,
|
|
7349
|
+
handleClick: handleFilterMenuOpen,
|
|
7350
|
+
className: (0, import_classnames3.default)("filter-menu-trigger", {
|
|
7351
|
+
"has-active-filters": !!numActiveFilters || !!anchorEl
|
|
7352
|
+
})
|
|
7353
|
+
}
|
|
7354
|
+
),
|
|
7355
|
+
/* @__PURE__ */ (0, import_jsx_runtime114.jsx)(
|
|
7356
|
+
import_material62.Menu,
|
|
7357
|
+
{
|
|
7358
|
+
open: !!anchorEl,
|
|
7359
|
+
onClose: handleFilterMenuClose,
|
|
7360
|
+
anchorEl,
|
|
7361
|
+
"data-testid": "filter-menu",
|
|
7362
|
+
slotProps: {
|
|
7363
|
+
list: {
|
|
7364
|
+
sx: { p: 0, maxWidth: MAX_WIDTH }
|
|
7365
|
+
}
|
|
7366
|
+
},
|
|
7367
|
+
anchorOrigin: { vertical: "bottom", horizontal: "right" },
|
|
7368
|
+
transformOrigin: { vertical: "top", horizontal: "right" },
|
|
7369
|
+
children: headCell.isAutocompleteFilterMenu ? /* @__PURE__ */ (0, import_jsx_runtime114.jsx)(
|
|
7370
|
+
AutocompleteFilterMenuContent,
|
|
7371
|
+
{
|
|
7372
|
+
columnId: headCell.id,
|
|
7373
|
+
labelFieldName: headCell.fieldName ?? "",
|
|
7374
|
+
isLoading: headCell.isFetchingFilterOptions,
|
|
7375
|
+
filterOptions: headCell.filterOptions,
|
|
7376
|
+
onAutocompleteFilterChange: headCell.onAutocompleteFilterChange,
|
|
7377
|
+
selectedFilterOptions,
|
|
7378
|
+
onFilterOptionChange: handleFilterOptionChange,
|
|
7379
|
+
onApplyFiltersClick: handleApplyFiltersClick,
|
|
7380
|
+
shouldShowCheckOnFilter
|
|
7381
|
+
}
|
|
7382
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime114.jsx)(
|
|
7383
|
+
CheckboxFilterMenuContent,
|
|
7384
|
+
{
|
|
7385
|
+
columnId: headCell.id,
|
|
7386
|
+
labelFieldName: headCell.fieldName ?? "",
|
|
7387
|
+
isLoading: headCell.isFetchingFilterOptions,
|
|
7388
|
+
selectedFilterOptions,
|
|
7389
|
+
filterOptions: filterOptionsData ?? [],
|
|
7390
|
+
onSelectAllChange: handleSelectAllChange,
|
|
7391
|
+
onFilterOptionChange: handleFilterOptionChange,
|
|
7392
|
+
onApplyFiltersClick: handleApplyFiltersClick,
|
|
7393
|
+
shouldShowCheckOnFilter
|
|
7394
|
+
}
|
|
7395
|
+
)
|
|
7396
|
+
}
|
|
7397
|
+
)
|
|
7398
|
+
] });
|
|
7399
|
+
}
|
|
7400
|
+
);
|
|
7391
7401
|
|
|
7392
7402
|
// src/components/SmartTableHeader/SmartTableHeader.tsx
|
|
7393
7403
|
var import_react35 = require("react");
|
|
7394
7404
|
var import_material63 = require("@mui/material");
|
|
7395
7405
|
var import_jsx_runtime115 = require("react/jsx-runtime");
|
|
7396
|
-
var SmartTableHeader = (0, import_react35.memo)(
|
|
7397
|
-
|
|
7398
|
-
|
|
7399
|
-
|
|
7400
|
-
|
|
7401
|
-
|
|
7402
|
-
|
|
7403
|
-
|
|
7404
|
-
|
|
7405
|
-
|
|
7406
|
-
|
|
7407
|
-
|
|
7408
|
-
|
|
7409
|
-
|
|
7410
|
-
|
|
7411
|
-
|
|
7412
|
-
|
|
7413
|
-
|
|
7414
|
-
|
|
7415
|
-
|
|
7416
|
-
|
|
7417
|
-
|
|
7418
|
-
|
|
7419
|
-
|
|
7420
|
-
},
|
|
7421
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime115.jsxs)(import_material63.TableRow, { children: [
|
|
7422
|
-
enableCheckboxSelection ? /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(import_material63.TableCell, { padding: "checkbox", children: /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(
|
|
7423
|
-
import_material63.Checkbox,
|
|
7424
|
-
{
|
|
7425
|
-
color: "primary",
|
|
7426
|
-
disableRipple: true,
|
|
7427
|
-
indeterminate: numSelectedRows > 0 && numSelectedRows < numRows,
|
|
7428
|
-
checked: numRows > 0 && numSelectedRows === numRows,
|
|
7429
|
-
onChange: onSelectAllClick
|
|
7406
|
+
var SmartTableHeader = (0, import_react35.memo)(
|
|
7407
|
+
({
|
|
7408
|
+
order,
|
|
7409
|
+
orderBy,
|
|
7410
|
+
headCells,
|
|
7411
|
+
numSelectedRows,
|
|
7412
|
+
numRows,
|
|
7413
|
+
enableCheckboxSelection = false,
|
|
7414
|
+
headerFilters,
|
|
7415
|
+
onRequestSort,
|
|
7416
|
+
onSelectAllClick,
|
|
7417
|
+
onApplyFilters,
|
|
7418
|
+
shouldShowCheckOnFilter
|
|
7419
|
+
}) => {
|
|
7420
|
+
const createSortHandler = (property) => (event) => {
|
|
7421
|
+
onRequestSort(event, property);
|
|
7422
|
+
};
|
|
7423
|
+
const isSortActive = (headCellId) => orderBy === headCellId;
|
|
7424
|
+
return /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(
|
|
7425
|
+
import_material63.TableHead,
|
|
7426
|
+
{
|
|
7427
|
+
sx: {
|
|
7428
|
+
"& .MuiTableSortLabel-root": {
|
|
7429
|
+
fontWeight: 600
|
|
7430
7430
|
}
|
|
7431
|
-
|
|
7432
|
-
|
|
7433
|
-
import_material63.TableCell,
|
|
7434
|
-
|
|
7435
|
-
|
|
7436
|
-
|
|
7437
|
-
|
|
7438
|
-
|
|
7439
|
-
|
|
7440
|
-
|
|
7441
|
-
|
|
7442
|
-
|
|
7443
|
-
|
|
7444
|
-
|
|
7445
|
-
|
|
7446
|
-
|
|
7447
|
-
|
|
7448
|
-
|
|
7449
|
-
|
|
7450
|
-
|
|
7431
|
+
},
|
|
7432
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime115.jsxs)(import_material63.TableRow, { children: [
|
|
7433
|
+
enableCheckboxSelection ? /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(import_material63.TableCell, { padding: "checkbox", children: /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(
|
|
7434
|
+
import_material63.Checkbox,
|
|
7435
|
+
{
|
|
7436
|
+
color: "primary",
|
|
7437
|
+
disableRipple: true,
|
|
7438
|
+
indeterminate: numSelectedRows > 0 && numSelectedRows < numRows,
|
|
7439
|
+
checked: numRows > 0 && numSelectedRows === numRows,
|
|
7440
|
+
onChange: onSelectAllClick
|
|
7441
|
+
}
|
|
7442
|
+
) }) : null,
|
|
7443
|
+
headCells.map((headCell) => /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(
|
|
7444
|
+
import_material63.TableCell,
|
|
7445
|
+
{
|
|
7446
|
+
align: "left",
|
|
7447
|
+
width: headCell.width ?? "auto",
|
|
7448
|
+
sortDirection: orderBy === headCell.id ? order : false,
|
|
7449
|
+
sx: {
|
|
7450
|
+
whiteSpace: "nowrap",
|
|
7451
|
+
"& .filter-menu-trigger": {
|
|
7452
|
+
visibility: "hidden",
|
|
7453
|
+
opacity: 0,
|
|
7454
|
+
transition: "visibility 0.1s, opacity 0.1s ease-in"
|
|
7455
|
+
},
|
|
7456
|
+
"&:hover .filter-menu-trigger, & .filter-menu-trigger.has-active-filters": {
|
|
7457
|
+
visibility: "visible",
|
|
7451
7458
|
opacity: 1
|
|
7459
|
+
},
|
|
7460
|
+
"&:hover .MuiTableSortLabel-root": {
|
|
7461
|
+
"& .MuiTableSortLabel-icon": {
|
|
7462
|
+
opacity: 1
|
|
7463
|
+
}
|
|
7452
7464
|
}
|
|
7453
|
-
}
|
|
7465
|
+
},
|
|
7466
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime115.jsxs)(
|
|
7467
|
+
import_material63.Box,
|
|
7468
|
+
{
|
|
7469
|
+
display: "flex",
|
|
7470
|
+
flexDirection: "row",
|
|
7471
|
+
gap: headCell.disableSort ? 1 : 0,
|
|
7472
|
+
children: [
|
|
7473
|
+
headCell.disableSort ? headCell.RenderHeader ?? /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(import_material63.Tooltip, { title: headCell.labelTooltip ?? "", arrow: true, children: /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(
|
|
7474
|
+
import_material63.Typography,
|
|
7475
|
+
{
|
|
7476
|
+
variant: "subtitle2",
|
|
7477
|
+
mt: 0.25,
|
|
7478
|
+
fontWeight: 600,
|
|
7479
|
+
children: headCell.label
|
|
7480
|
+
}
|
|
7481
|
+
) }) : /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(import_material63.Tooltip, { title: headCell.labelTooltip ?? "", arrow: true, children: /* @__PURE__ */ (0, import_jsx_runtime115.jsxs)(
|
|
7482
|
+
import_material63.TableSortLabel,
|
|
7483
|
+
{
|
|
7484
|
+
"data-testid": "table-sort-label",
|
|
7485
|
+
active: isSortActive(headCell.id),
|
|
7486
|
+
direction: orderBy === headCell.id ? order : "asc",
|
|
7487
|
+
onClick: createSortHandler(headCell.id),
|
|
7488
|
+
children: [
|
|
7489
|
+
headCell.RenderHeader ?? headCell.label,
|
|
7490
|
+
orderBy === headCell.id ? /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(
|
|
7491
|
+
"span",
|
|
7492
|
+
{
|
|
7493
|
+
style: {
|
|
7494
|
+
border: 0,
|
|
7495
|
+
clip: "rect(0 0 0 0)",
|
|
7496
|
+
height: 1,
|
|
7497
|
+
margin: -1,
|
|
7498
|
+
overflow: "hidden",
|
|
7499
|
+
padding: 0,
|
|
7500
|
+
position: "absolute",
|
|
7501
|
+
top: 20,
|
|
7502
|
+
width: 1
|
|
7503
|
+
},
|
|
7504
|
+
children: order === "desc" ? "sorted descending" : "sorted ascending"
|
|
7505
|
+
}
|
|
7506
|
+
) : null
|
|
7507
|
+
]
|
|
7508
|
+
}
|
|
7509
|
+
) }),
|
|
7510
|
+
headCell.refetchFilterOptions ? /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(
|
|
7511
|
+
SmartTableHeaderFilterMenu,
|
|
7512
|
+
{
|
|
7513
|
+
headCell,
|
|
7514
|
+
headerFilters,
|
|
7515
|
+
numActiveFilters: headerFilters[headCell.id]?.length ?? 0,
|
|
7516
|
+
onApplyFilters,
|
|
7517
|
+
shouldShowCheckOnFilter
|
|
7518
|
+
}
|
|
7519
|
+
) : null
|
|
7520
|
+
]
|
|
7521
|
+
}
|
|
7522
|
+
)
|
|
7454
7523
|
},
|
|
7455
|
-
|
|
7456
|
-
|
|
7457
|
-
|
|
7458
|
-
|
|
7459
|
-
|
|
7460
|
-
|
|
7461
|
-
|
|
7462
|
-
headCell.disableSort ? headCell.RenderHeader ?? /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(import_material63.Tooltip, { title: headCell.labelTooltip ?? "", arrow: true, children: /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(import_material63.Typography, { variant: "subtitle2", mt: 0.25, fontWeight: 600, children: headCell.label }) }) : /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(import_material63.Tooltip, { title: headCell.labelTooltip ?? "", arrow: true, children: /* @__PURE__ */ (0, import_jsx_runtime115.jsxs)(
|
|
7463
|
-
import_material63.TableSortLabel,
|
|
7464
|
-
{
|
|
7465
|
-
"data-testid": "table-sort-label",
|
|
7466
|
-
active: isSortActive(headCell.id),
|
|
7467
|
-
direction: orderBy === headCell.id ? order : "asc",
|
|
7468
|
-
onClick: createSortHandler(headCell.id),
|
|
7469
|
-
children: [
|
|
7470
|
-
headCell.RenderHeader ?? headCell.label,
|
|
7471
|
-
orderBy === headCell.id ? /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(
|
|
7472
|
-
"span",
|
|
7473
|
-
{
|
|
7474
|
-
style: {
|
|
7475
|
-
border: 0,
|
|
7476
|
-
clip: "rect(0 0 0 0)",
|
|
7477
|
-
height: 1,
|
|
7478
|
-
margin: -1,
|
|
7479
|
-
overflow: "hidden",
|
|
7480
|
-
padding: 0,
|
|
7481
|
-
position: "absolute",
|
|
7482
|
-
top: 20,
|
|
7483
|
-
width: 1
|
|
7484
|
-
},
|
|
7485
|
-
children: order === "desc" ? "sorted descending" : "sorted ascending"
|
|
7486
|
-
}
|
|
7487
|
-
) : null
|
|
7488
|
-
]
|
|
7489
|
-
}
|
|
7490
|
-
) }),
|
|
7491
|
-
headCell.refetchFilterOptions ? /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(
|
|
7492
|
-
SmartTableHeaderFilterMenu,
|
|
7493
|
-
{
|
|
7494
|
-
headCell,
|
|
7495
|
-
headerFilters,
|
|
7496
|
-
numActiveFilters: headerFilters[headCell.id]?.length ?? 0,
|
|
7497
|
-
onApplyFilters,
|
|
7498
|
-
shouldShowCheckOnFilter
|
|
7499
|
-
}
|
|
7500
|
-
) : null
|
|
7501
|
-
]
|
|
7502
|
-
}
|
|
7503
|
-
)
|
|
7504
|
-
},
|
|
7505
|
-
headCell.id
|
|
7506
|
-
))
|
|
7507
|
-
] })
|
|
7508
|
-
}
|
|
7509
|
-
);
|
|
7510
|
-
});
|
|
7524
|
+
headCell.id
|
|
7525
|
+
))
|
|
7526
|
+
] })
|
|
7527
|
+
}
|
|
7528
|
+
);
|
|
7529
|
+
}
|
|
7530
|
+
);
|
|
7511
7531
|
|
|
7512
7532
|
// src/components/Table/Table.tsx
|
|
7513
7533
|
var import_react36 = require("react");
|
|
@@ -7730,13 +7750,7 @@ var TableDesktopFooter = ({
|
|
|
7730
7750
|
borderColor: colors.neutral600
|
|
7731
7751
|
},
|
|
7732
7752
|
children: [
|
|
7733
|
-
/* @__PURE__ */ (0, import_jsx_runtime118.jsx)(
|
|
7734
|
-
import_Refresh.default,
|
|
7735
|
-
{
|
|
7736
|
-
fontSize: "small",
|
|
7737
|
-
color: isFetching ? "disabled" : "primary"
|
|
7738
|
-
}
|
|
7739
|
-
),
|
|
7753
|
+
/* @__PURE__ */ (0, import_jsx_runtime118.jsx)(import_Refresh.default, { fontSize: "small", color: isFetching ? "disabled" : "primary" }),
|
|
7740
7754
|
"REFRESH"
|
|
7741
7755
|
]
|
|
7742
7756
|
}
|
|
@@ -8067,14 +8081,13 @@ var TableDesktop = ({
|
|
|
8067
8081
|
const [orderBy, setOrderBy] = (0, import_react37.useState)(
|
|
8068
8082
|
appliedFilters?.sortField || "delivery_date"
|
|
8069
8083
|
);
|
|
8070
|
-
const [selectedRows, setSelectedRows] = (0, import_react37.useState)(
|
|
8084
|
+
const [selectedRows, setSelectedRows] = (0, import_react37.useState)(
|
|
8085
|
+
/* @__PURE__ */ new Set()
|
|
8086
|
+
);
|
|
8071
8087
|
const [isRowsFromAllPagesSelected, setIsRowsFromAllPagesSelected] = (0, import_react37.useState)(false);
|
|
8072
8088
|
const { toolbar: Toolbar2 } = components ?? {};
|
|
8073
8089
|
const { toolbarProps, footerProps } = componentsProps ?? {};
|
|
8074
|
-
const numRows = (0, import_react37.useMemo)(
|
|
8075
|
-
() => data.length,
|
|
8076
|
-
[data.length]
|
|
8077
|
-
);
|
|
8090
|
+
const numRows = (0, import_react37.useMemo)(() => data.length, [data.length]);
|
|
8078
8091
|
const emptyRows = (0, import_react37.useMemo)(
|
|
8079
8092
|
() => rowsPerPage - numRows,
|
|
8080
8093
|
[rowsPerPage, numRows]
|
|
@@ -8102,7 +8115,6 @@ var TableDesktop = ({
|
|
|
8102
8115
|
};
|
|
8103
8116
|
const selectAllRowsInPage = () => {
|
|
8104
8117
|
const allRowsIds = new Set(data.map((obj) => obj[keyField]));
|
|
8105
|
-
;
|
|
8106
8118
|
setSelectedRows(allRowsIds);
|
|
8107
8119
|
};
|
|
8108
8120
|
const resetSelectedRows = () => {
|
|
@@ -8264,46 +8276,38 @@ var TableDesktop = ({
|
|
|
8264
8276
|
backgroundColor: (theme) => theme.palette.grey[500]
|
|
8265
8277
|
}
|
|
8266
8278
|
},
|
|
8267
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime125.jsx)(
|
|
8268
|
-
|
|
8279
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime125.jsx)(import_material71.Table, { stickyHeader: true, "aria-label": "sticky-table", sx: { tableLayout }, children: visibleHeadCells.length === 0 && !isLoading ? /* @__PURE__ */ (0, import_jsx_runtime125.jsx)(
|
|
8280
|
+
TableDesktopNoColumnsMessage,
|
|
8269
8281
|
{
|
|
8270
|
-
|
|
8271
|
-
"aria-label": "sticky-table",
|
|
8272
|
-
sx: { tableLayout },
|
|
8273
|
-
children: visibleHeadCells.length === 0 && !isLoading ? /* @__PURE__ */ (0, import_jsx_runtime125.jsx)(
|
|
8274
|
-
TableDesktopNoColumnsMessage,
|
|
8275
|
-
{
|
|
8276
|
-
onClickNoColumnsMessageOpenMenu: toolbarProps?.onClickToolbarMenuOpen
|
|
8277
|
-
}
|
|
8278
|
-
) : /* @__PURE__ */ (0, import_jsx_runtime125.jsxs)(import_jsx_runtime125.Fragment, { children: [
|
|
8279
|
-
/* @__PURE__ */ (0, import_jsx_runtime125.jsx)(
|
|
8280
|
-
SmartTableHeader,
|
|
8281
|
-
{
|
|
8282
|
-
headCells: visibleHeadCells,
|
|
8283
|
-
order,
|
|
8284
|
-
orderBy,
|
|
8285
|
-
numSelectedRows,
|
|
8286
|
-
numRows,
|
|
8287
|
-
enableCheckboxSelection,
|
|
8288
|
-
headerFilters: headerFilters ?? {},
|
|
8289
|
-
onRequestSort: handleRequestSort,
|
|
8290
|
-
onSelectAllClick: handleSelectAllClick,
|
|
8291
|
-
onApplyFilters: handleApplyFilters,
|
|
8292
|
-
shouldShowCheckOnFilter
|
|
8293
|
-
}
|
|
8294
|
-
),
|
|
8295
|
-
/* @__PURE__ */ (0, import_jsx_runtime125.jsx)(import_material71.TableBody, { children: !isLoading ? renderBody : /* @__PURE__ */ (0, import_jsx_runtime125.jsx)(
|
|
8296
|
-
TableDesktopLoadingState,
|
|
8297
|
-
{
|
|
8298
|
-
numRows: data.length,
|
|
8299
|
-
rowsPerPage,
|
|
8300
|
-
numColumns: visibleHeadCells.length + (enableCheckboxSelection ? 1 : 0),
|
|
8301
|
-
rowHeight
|
|
8302
|
-
}
|
|
8303
|
-
) })
|
|
8304
|
-
] })
|
|
8282
|
+
onClickNoColumnsMessageOpenMenu: toolbarProps?.onClickToolbarMenuOpen
|
|
8305
8283
|
}
|
|
8306
|
-
)
|
|
8284
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime125.jsxs)(import_jsx_runtime125.Fragment, { children: [
|
|
8285
|
+
/* @__PURE__ */ (0, import_jsx_runtime125.jsx)(
|
|
8286
|
+
SmartTableHeader,
|
|
8287
|
+
{
|
|
8288
|
+
headCells: visibleHeadCells,
|
|
8289
|
+
order,
|
|
8290
|
+
orderBy,
|
|
8291
|
+
numSelectedRows,
|
|
8292
|
+
numRows,
|
|
8293
|
+
enableCheckboxSelection,
|
|
8294
|
+
headerFilters: headerFilters ?? {},
|
|
8295
|
+
onRequestSort: handleRequestSort,
|
|
8296
|
+
onSelectAllClick: handleSelectAllClick,
|
|
8297
|
+
onApplyFilters: handleApplyFilters,
|
|
8298
|
+
shouldShowCheckOnFilter
|
|
8299
|
+
}
|
|
8300
|
+
),
|
|
8301
|
+
/* @__PURE__ */ (0, import_jsx_runtime125.jsx)(import_material71.TableBody, { children: !isLoading ? renderBody : /* @__PURE__ */ (0, import_jsx_runtime125.jsx)(
|
|
8302
|
+
TableDesktopLoadingState,
|
|
8303
|
+
{
|
|
8304
|
+
numRows: data.length,
|
|
8305
|
+
rowsPerPage,
|
|
8306
|
+
numColumns: visibleHeadCells.length + (enableCheckboxSelection ? 1 : 0),
|
|
8307
|
+
rowHeight
|
|
8308
|
+
}
|
|
8309
|
+
) })
|
|
8310
|
+
] }) })
|
|
8307
8311
|
}
|
|
8308
8312
|
),
|
|
8309
8313
|
children,
|
|
@@ -8336,8 +8340,14 @@ var TableDesktopNumericField = ({
|
|
|
8336
8340
|
}) => {
|
|
8337
8341
|
const [input, setInput] = (0, import_react38.useState)(initialValue);
|
|
8338
8342
|
const oldValue = (0, import_react38.useRef)(initialValue);
|
|
8339
|
-
const isDirty = (0, import_react38.useMemo)(
|
|
8340
|
-
|
|
8343
|
+
const isDirty = (0, import_react38.useMemo)(
|
|
8344
|
+
() => input !== oldValue.current,
|
|
8345
|
+
[input, oldValue.current]
|
|
8346
|
+
);
|
|
8347
|
+
const hasValidationError = (0, import_react38.useMemo)(
|
|
8348
|
+
() => isDirty && !validateInput?.(input),
|
|
8349
|
+
[input, validateInput, isDirty]
|
|
8350
|
+
);
|
|
8341
8351
|
const commitValue = (value) => {
|
|
8342
8352
|
if (hasValidationError || !onUpdateEditableCell || !isDirty) {
|
|
8343
8353
|
setInput(oldValue.current);
|
|
@@ -8382,63 +8392,69 @@ var TableDesktopNumericField = ({
|
|
|
8382
8392
|
// src/components/TableDesktopEditableField/TableDesktopSmartSelect.tsx
|
|
8383
8393
|
var import_react39 = require("react");
|
|
8384
8394
|
var import_jsx_runtime127 = require("react/jsx-runtime");
|
|
8385
|
-
var TableDesktopSmartSelect = (0, import_react39.memo)(
|
|
8386
|
-
|
|
8387
|
-
|
|
8388
|
-
|
|
8389
|
-
|
|
8390
|
-
|
|
8391
|
-
|
|
8392
|
-
|
|
8393
|
-
|
|
8394
|
-
|
|
8395
|
-
|
|
8396
|
-
|
|
8397
|
-
|
|
8398
|
-
|
|
8399
|
-
|
|
8400
|
-
|
|
8401
|
-
|
|
8402
|
-
|
|
8403
|
-
|
|
8404
|
-
|
|
8405
|
-
|
|
8406
|
-
|
|
8407
|
-
|
|
8408
|
-
|
|
8409
|
-
|
|
8410
|
-
|
|
8411
|
-
|
|
8412
|
-
|
|
8413
|
-
|
|
8414
|
-
|
|
8415
|
-
|
|
8416
|
-
|
|
8417
|
-
|
|
8418
|
-
|
|
8419
|
-
|
|
8420
|
-
|
|
8421
|
-
|
|
8422
|
-
|
|
8423
|
-
|
|
8424
|
-
|
|
8425
|
-
|
|
8426
|
-
|
|
8427
|
-
|
|
8428
|
-
|
|
8429
|
-
|
|
8430
|
-
|
|
8431
|
-
|
|
8432
|
-
|
|
8433
|
-
|
|
8434
|
-
|
|
8435
|
-
|
|
8395
|
+
var TableDesktopSmartSelect = (0, import_react39.memo)(
|
|
8396
|
+
({
|
|
8397
|
+
ref,
|
|
8398
|
+
initialValue,
|
|
8399
|
+
inputLabel,
|
|
8400
|
+
field,
|
|
8401
|
+
fieldName,
|
|
8402
|
+
rowId,
|
|
8403
|
+
disabled,
|
|
8404
|
+
variant = "standard",
|
|
8405
|
+
size,
|
|
8406
|
+
filterOptions,
|
|
8407
|
+
refetchFilterOptions,
|
|
8408
|
+
isFetchingFilterOptions,
|
|
8409
|
+
onUpdateEditableCell
|
|
8410
|
+
}) => {
|
|
8411
|
+
const [value, setValue] = (0, import_react39.useState)(
|
|
8412
|
+
initialValue
|
|
8413
|
+
);
|
|
8414
|
+
const [options, setOptions] = (0, import_react39.useState)();
|
|
8415
|
+
const valueId = resolveObjectType(value, "id");
|
|
8416
|
+
const valueLabel = resolveObjectType(value, fieldName);
|
|
8417
|
+
(0, import_react39.useEffect)(() => {
|
|
8418
|
+
if (filterOptions) {
|
|
8419
|
+
const parsedOptions = filterOptions?.map(
|
|
8420
|
+
(option) => ({
|
|
8421
|
+
value: resolveObjectType(option, "id"),
|
|
8422
|
+
label: String(resolveObjectType(option, fieldName))
|
|
8423
|
+
})
|
|
8424
|
+
);
|
|
8425
|
+
setOptions(parsedOptions);
|
|
8426
|
+
}
|
|
8427
|
+
}, [filterOptions]);
|
|
8428
|
+
return /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(
|
|
8429
|
+
SmartSelect_default,
|
|
8430
|
+
{
|
|
8431
|
+
ref,
|
|
8432
|
+
value: valueId,
|
|
8433
|
+
inputLabel,
|
|
8434
|
+
options,
|
|
8435
|
+
disabled,
|
|
8436
|
+
variant,
|
|
8437
|
+
size,
|
|
8438
|
+
refetch: refetchFilterOptions,
|
|
8439
|
+
isFetching: isFetchingFilterOptions,
|
|
8440
|
+
defaultOption: {
|
|
8441
|
+
value: valueId ?? "",
|
|
8442
|
+
label: String(valueLabel ?? "")
|
|
8443
|
+
},
|
|
8444
|
+
onChange: ({ value: id, label: name }) => {
|
|
8445
|
+
if (!id || !name) {
|
|
8446
|
+
return;
|
|
8447
|
+
}
|
|
8448
|
+
setValue({ id, name });
|
|
8449
|
+
if (!onUpdateEditableCell) {
|
|
8450
|
+
return;
|
|
8451
|
+
}
|
|
8452
|
+
onUpdateEditableCell(rowId ?? 0, field, id, name);
|
|
8436
8453
|
}
|
|
8437
|
-
onUpdateEditableCell(rowId ?? 0, field, id, name);
|
|
8438
8454
|
}
|
|
8439
|
-
|
|
8440
|
-
|
|
8441
|
-
|
|
8455
|
+
);
|
|
8456
|
+
}
|
|
8457
|
+
);
|
|
8442
8458
|
|
|
8443
8459
|
// src/components/TableDesktopEditableField/TableDesktopTextField.tsx
|
|
8444
8460
|
var import_react40 = require("react");
|
|
@@ -8457,8 +8473,14 @@ var TableDesktopTextField = ({
|
|
|
8457
8473
|
}) => {
|
|
8458
8474
|
const [input, setInput] = (0, import_react40.useState)(initialValue);
|
|
8459
8475
|
const oldValue = (0, import_react40.useRef)(initialValue);
|
|
8460
|
-
const isDirty = (0, import_react40.useMemo)(
|
|
8461
|
-
|
|
8476
|
+
const isDirty = (0, import_react40.useMemo)(
|
|
8477
|
+
() => input !== oldValue.current,
|
|
8478
|
+
[input, oldValue.current]
|
|
8479
|
+
);
|
|
8480
|
+
const hasValidationError = (0, import_react40.useMemo)(
|
|
8481
|
+
() => isDirty && !validateInput?.(input),
|
|
8482
|
+
[input, validateInput]
|
|
8483
|
+
);
|
|
8462
8484
|
const commitValue = (value) => {
|
|
8463
8485
|
if (hasValidationError || !onUpdateEditableCell || !isDirty) {
|
|
8464
8486
|
setInput(oldValue.current);
|
|
@@ -8514,7 +8536,7 @@ var TableDesktopEditableFieldComponent = ({
|
|
|
8514
8536
|
onUpdateEditableCell
|
|
8515
8537
|
}) => {
|
|
8516
8538
|
const editableComponents = {
|
|
8517
|
-
|
|
8539
|
+
select: /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(
|
|
8518
8540
|
TableDesktopSmartSelect,
|
|
8519
8541
|
{
|
|
8520
8542
|
rowId,
|
|
@@ -8531,7 +8553,7 @@ var TableDesktopEditableFieldComponent = ({
|
|
|
8531
8553
|
onUpdateEditableCell
|
|
8532
8554
|
}
|
|
8533
8555
|
),
|
|
8534
|
-
|
|
8556
|
+
checkbox: /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(
|
|
8535
8557
|
import_material74.FormControlLabel,
|
|
8536
8558
|
{
|
|
8537
8559
|
label: showCheckboxLabel ? inputLabel : "",
|
|
@@ -8551,7 +8573,7 @@ var TableDesktopEditableFieldComponent = ({
|
|
|
8551
8573
|
)
|
|
8552
8574
|
}
|
|
8553
8575
|
),
|
|
8554
|
-
|
|
8576
|
+
text: /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(
|
|
8555
8577
|
TableDesktopTextField,
|
|
8556
8578
|
{
|
|
8557
8579
|
rowId,
|
|
@@ -8565,7 +8587,7 @@ var TableDesktopEditableFieldComponent = ({
|
|
|
8565
8587
|
onUpdateEditableCell
|
|
8566
8588
|
}
|
|
8567
8589
|
),
|
|
8568
|
-
|
|
8590
|
+
numeric: /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(
|
|
8569
8591
|
TableDesktopNumericField,
|
|
8570
8592
|
{
|
|
8571
8593
|
rowId,
|
|
@@ -8582,7 +8604,9 @@ var TableDesktopEditableFieldComponent = ({
|
|
|
8582
8604
|
};
|
|
8583
8605
|
return editableComponents[editableCellType];
|
|
8584
8606
|
};
|
|
8585
|
-
var TableDesktopEditableField = (0, import_react41.memo)(
|
|
8607
|
+
var TableDesktopEditableField = (0, import_react41.memo)(
|
|
8608
|
+
TableDesktopEditableFieldComponent
|
|
8609
|
+
);
|
|
8586
8610
|
|
|
8587
8611
|
// src/components/TableDesktopCell/TableDesktopCell.tsx
|
|
8588
8612
|
var import_react42 = require("react");
|