@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
package/dist/components/index.js
CHANGED
|
@@ -296,39 +296,37 @@ var require_debounce = __commonJS({
|
|
|
296
296
|
// src/components/ActiveFiltersIconButton/ActiveFiltersIconButton.tsx
|
|
297
297
|
import { memo } from "react";
|
|
298
298
|
import { FilterList } from "@mui/icons-material";
|
|
299
|
-
import {
|
|
300
|
-
Typography,
|
|
301
|
-
Chip,
|
|
302
|
-
IconButton
|
|
303
|
-
} from "@mui/material";
|
|
299
|
+
import { Typography, Chip, IconButton } from "@mui/material";
|
|
304
300
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
305
|
-
var ActiveFiltersIconButton = memo(
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
enableRipple = false,
|
|
309
|
-
numActiveFilters,
|
|
310
|
-
handleClick
|
|
311
|
-
}) => /* @__PURE__ */ jsxs(
|
|
312
|
-
IconButton,
|
|
313
|
-
{
|
|
314
|
-
disableRipple: !enableRipple,
|
|
315
|
-
onClick: handleClick,
|
|
316
|
-
"data-testid": "filter-menu-button",
|
|
317
|
-
sx: { padding: 0, gap: 1 },
|
|
301
|
+
var ActiveFiltersIconButton = memo(
|
|
302
|
+
({
|
|
303
|
+
label,
|
|
318
304
|
className,
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
)
|
|
305
|
+
enableRipple = false,
|
|
306
|
+
numActiveFilters,
|
|
307
|
+
handleClick
|
|
308
|
+
}) => /* @__PURE__ */ jsxs(
|
|
309
|
+
IconButton,
|
|
310
|
+
{
|
|
311
|
+
disableRipple: !enableRipple,
|
|
312
|
+
onClick: handleClick,
|
|
313
|
+
"data-testid": "filter-menu-button",
|
|
314
|
+
sx: { padding: 0, gap: 1 },
|
|
315
|
+
className,
|
|
316
|
+
children: [
|
|
317
|
+
label ? /* @__PURE__ */ jsx(Typography, { variant: "button", fontSize: 12, marginTop: 0.5, children: label }) : null,
|
|
318
|
+
numActiveFilters > 0 ? /* @__PURE__ */ jsx(
|
|
319
|
+
Chip,
|
|
320
|
+
{
|
|
321
|
+
sx: { height: 24 },
|
|
322
|
+
label: numActiveFilters,
|
|
323
|
+
icon: /* @__PURE__ */ jsx(FilterList, { style: { fontSize: 18 }, color: "primary" })
|
|
324
|
+
}
|
|
325
|
+
) : /* @__PURE__ */ jsx(FilterList, { style: { fontSize: 18 } })
|
|
326
|
+
]
|
|
327
|
+
}
|
|
328
|
+
)
|
|
329
|
+
);
|
|
332
330
|
|
|
333
331
|
// src/components/AlertDialog/AlertDialog.tsx
|
|
334
332
|
import { Box, Button, Dialog, Typography as Typography2 } from "@mui/material";
|
|
@@ -459,14 +457,21 @@ var AppLabel_default = AppLabel;
|
|
|
459
457
|
|
|
460
458
|
// src/components/AutocompleteFilterMenuContent/AutocompleteFilterMenuContent.tsx
|
|
461
459
|
import CheckIcon2 from "@mui/icons-material/Check";
|
|
462
|
-
import {
|
|
460
|
+
import {
|
|
461
|
+
Box as Box7,
|
|
462
|
+
Button as Button4,
|
|
463
|
+
Chip as Chip2,
|
|
464
|
+
Divider,
|
|
465
|
+
Skeleton,
|
|
466
|
+
Tooltip as Tooltip4,
|
|
467
|
+
Typography as Typography4
|
|
468
|
+
} from "@mui/material";
|
|
463
469
|
|
|
464
470
|
// src/utils/resolveObjectType.ts
|
|
465
471
|
var resolveObjectType = (object, fieldName) => {
|
|
466
472
|
if (!object || typeof object !== "object") {
|
|
467
473
|
return object;
|
|
468
474
|
}
|
|
469
|
-
;
|
|
470
475
|
return object[fieldName] ?? "";
|
|
471
476
|
};
|
|
472
477
|
|
|
@@ -681,27 +686,23 @@ var DynamicOverflowTooltip = ({
|
|
|
681
686
|
tooltipDescription
|
|
682
687
|
}) => {
|
|
683
688
|
const ref = useRef(null);
|
|
684
|
-
const { isOverflowed } = useCheckOverflow({
|
|
685
|
-
|
|
686
|
-
|
|
689
|
+
const { isOverflowed } = useCheckOverflow({
|
|
690
|
+
targetRef: ref,
|
|
691
|
+
effectDependencies: [children, tooltipDescription]
|
|
692
|
+
});
|
|
693
|
+
return /* @__PURE__ */ jsx7(Tooltip2, { arrow, title: isOverflowed ? tooltipDescription : "", children: /* @__PURE__ */ jsx7(
|
|
694
|
+
Box4,
|
|
687
695
|
{
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
overflowX: "hidden",
|
|
697
|
-
whiteSpace: "nowrap",
|
|
698
|
-
textOverflow: "ellipsis"
|
|
699
|
-
},
|
|
700
|
-
children
|
|
701
|
-
}
|
|
702
|
-
)
|
|
696
|
+
ref,
|
|
697
|
+
sx: {
|
|
698
|
+
maxWidth,
|
|
699
|
+
overflowX: "hidden",
|
|
700
|
+
whiteSpace: "nowrap",
|
|
701
|
+
textOverflow: "ellipsis"
|
|
702
|
+
},
|
|
703
|
+
children
|
|
703
704
|
}
|
|
704
|
-
);
|
|
705
|
+
) });
|
|
705
706
|
};
|
|
706
707
|
|
|
707
708
|
// src/components/FilterOptionsCheckboxes/FilterOptionsCheckboxes.tsx
|
|
@@ -750,7 +751,14 @@ var FilterOptionsCheckboxes = ({
|
|
|
750
751
|
justifyContent: "space-between"
|
|
751
752
|
},
|
|
752
753
|
children: [
|
|
753
|
-
/* @__PURE__ */ jsx8(
|
|
754
|
+
/* @__PURE__ */ jsx8(
|
|
755
|
+
DynamicOverflowTooltip,
|
|
756
|
+
{
|
|
757
|
+
tooltipDescription: String(filterLabel),
|
|
758
|
+
arrow: true,
|
|
759
|
+
children: filterLabel
|
|
760
|
+
}
|
|
761
|
+
),
|
|
754
762
|
shouldShowCheckOnFilter?.(columnId, option) ? /* @__PURE__ */ jsx8(Tooltip3, { title: "This filter is saved as default", children: /* @__PURE__ */ jsx8(CheckIcon, { fontSize: "small", color: "action" }) }) : null
|
|
755
763
|
]
|
|
756
764
|
}
|
|
@@ -786,7 +794,6 @@ var SearchFieldDebounced = ({
|
|
|
786
794
|
if (debounceRef.current) {
|
|
787
795
|
clearTimeout(debounceRef.current);
|
|
788
796
|
}
|
|
789
|
-
;
|
|
790
797
|
debounceRef.current = window.setTimeout(() => {
|
|
791
798
|
const trimmedInput = input.trim();
|
|
792
799
|
if (trimmedInput.length < minCharacters) {
|
|
@@ -912,35 +919,37 @@ var AutocompleteFilterMenuContent = ({
|
|
|
912
919
|
display: "flex",
|
|
913
920
|
flexDirection: "column"
|
|
914
921
|
},
|
|
915
|
-
children: selectedFilterOptions?.map(
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
922
|
+
children: selectedFilterOptions?.map(
|
|
923
|
+
(option) => {
|
|
924
|
+
const filterId = resolveObjectType(option, "id");
|
|
925
|
+
const filterLabel = resolveObjectType(option, labelFieldName);
|
|
926
|
+
return /* @__PURE__ */ jsxs6(
|
|
927
|
+
Box7,
|
|
928
|
+
{
|
|
929
|
+
sx: {
|
|
930
|
+
pl: 1,
|
|
931
|
+
pr: 1.25,
|
|
932
|
+
flexGrow: 1,
|
|
933
|
+
display: "flex",
|
|
934
|
+
alignItems: "center",
|
|
935
|
+
justifyContent: "space-between"
|
|
936
|
+
},
|
|
937
|
+
children: [
|
|
938
|
+
/* @__PURE__ */ jsx10(Box7, { sx: { maxWidth }, children: /* @__PURE__ */ jsx10(
|
|
939
|
+
Chip2,
|
|
940
|
+
{
|
|
941
|
+
size: "small",
|
|
942
|
+
label: filterLabel,
|
|
943
|
+
onDelete: () => onFilterOptionChange(option)
|
|
944
|
+
}
|
|
945
|
+
) }),
|
|
946
|
+
shouldShowCheckOnFilter?.(columnId, option) ? /* @__PURE__ */ jsx10(Tooltip4, { title: "This filter is saved as default", children: /* @__PURE__ */ jsx10(CheckIcon2, { fontSize: "small", color: "action" }) }) : null
|
|
947
|
+
]
|
|
928
948
|
},
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
size: "small",
|
|
934
|
-
label: filterLabel,
|
|
935
|
-
onDelete: () => onFilterOptionChange(option)
|
|
936
|
-
}
|
|
937
|
-
) }),
|
|
938
|
-
shouldShowCheckOnFilter?.(columnId, option) ? /* @__PURE__ */ jsx10(Tooltip4, { title: "This filter is saved as default", children: /* @__PURE__ */ jsx10(CheckIcon2, { fontSize: "small", color: "action" }) }) : null
|
|
939
|
-
]
|
|
940
|
-
},
|
|
941
|
-
filterId
|
|
942
|
-
);
|
|
943
|
-
})
|
|
949
|
+
filterId
|
|
950
|
+
);
|
|
951
|
+
}
|
|
952
|
+
)
|
|
944
953
|
}
|
|
945
954
|
),
|
|
946
955
|
/* @__PURE__ */ jsx10(Divider, { sx: { my: 0.5 } })
|
|
@@ -1085,10 +1094,8 @@ var BottomBar_default = BottomBar;
|
|
|
1085
1094
|
|
|
1086
1095
|
// src/components/BoxButton/BoxButton.tsx
|
|
1087
1096
|
import { memo as memo3 } from "react";
|
|
1088
|
-
import {
|
|
1089
|
-
import green from "@mui/material/colors
|
|
1090
|
-
import orange from "@mui/material/colors/orange";
|
|
1091
|
-
import red from "@mui/material/colors/red";
|
|
1097
|
+
import { Grid, Typography as Typography6, ButtonBase } from "@mui/material";
|
|
1098
|
+
import { green, orange, red } from "@mui/material/colors";
|
|
1092
1099
|
import { makeStyles as makeStyles6 } from "tss-react/mui";
|
|
1093
1100
|
import { jsx as jsx13, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
1094
1101
|
var useStyles6 = makeStyles6()((theme) => ({
|
|
@@ -3213,7 +3220,16 @@ function ActionButton(props) {
|
|
|
3213
3220
|
}
|
|
3214
3221
|
|
|
3215
3222
|
// src/components/CheckboxFilterMenuContent/CheckboxFilterMenuContent.tsx
|
|
3216
|
-
import {
|
|
3223
|
+
import {
|
|
3224
|
+
Box as Box12,
|
|
3225
|
+
Button as Button12,
|
|
3226
|
+
Checkbox as Checkbox2,
|
|
3227
|
+
Divider as Divider2,
|
|
3228
|
+
FormControlLabel,
|
|
3229
|
+
Skeleton as Skeleton2,
|
|
3230
|
+
Tooltip as Tooltip6,
|
|
3231
|
+
Typography as Typography8
|
|
3232
|
+
} from "@mui/material";
|
|
3217
3233
|
import { jsx as jsx71, jsxs as jsxs40 } from "react/jsx-runtime";
|
|
3218
3234
|
var CheckboxFilterMenuContent = ({
|
|
3219
3235
|
columnId,
|
|
@@ -4146,7 +4162,7 @@ var DataGrid_default = DataGrid;
|
|
|
4146
4162
|
import moment from "moment";
|
|
4147
4163
|
|
|
4148
4164
|
// src/resources/styles/themes/default.js
|
|
4149
|
-
import grey from "@mui/material/colors
|
|
4165
|
+
import { grey } from "@mui/material/colors";
|
|
4150
4166
|
import { createTheme } from "@mui/material/styles";
|
|
4151
4167
|
var defaultTheme = createTheme({
|
|
4152
4168
|
typography: {
|
|
@@ -4395,8 +4411,7 @@ var FileCard_default = FileCard;
|
|
|
4395
4411
|
// src/components/FilledLabel/FilledLabel.tsx
|
|
4396
4412
|
import { memo as memo12 } from "react";
|
|
4397
4413
|
import { Typography as Typography13 } from "@mui/material";
|
|
4398
|
-
import brown from "@mui/material/colors
|
|
4399
|
-
import teal from "@mui/material/colors/teal";
|
|
4414
|
+
import { brown, teal } from "@mui/material/colors";
|
|
4400
4415
|
import { makeStyles as makeStyles24 } from "tss-react/mui";
|
|
4401
4416
|
import { jsx as jsx85 } from "react/jsx-runtime";
|
|
4402
4417
|
var useStyles24 = makeStyles24()((theme) => ({
|
|
@@ -6041,7 +6056,7 @@ import { makeStyles as makeStyles35 } from "tss-react/mui";
|
|
|
6041
6056
|
|
|
6042
6057
|
// src/utils/useGetActiveSection.ts
|
|
6043
6058
|
import { useEffect as useEffect6, useState as useState10 } from "react";
|
|
6044
|
-
var transformNameToID = (name) => name.replaceAll(" ", "
|
|
6059
|
+
var transformNameToID = (name) => name.replaceAll(" ", "_").toLocaleLowerCase();
|
|
6045
6060
|
|
|
6046
6061
|
// src/components/RenderContentList/RenderContentList.tsx
|
|
6047
6062
|
import { jsx as jsx102, jsxs as jsxs66 } from "react/jsx-runtime";
|
|
@@ -6124,7 +6139,7 @@ var RenderContentList = ({
|
|
|
6124
6139
|
},
|
|
6125
6140
|
children: [
|
|
6126
6141
|
/* @__PURE__ */ jsx102(ListItemText4, { primary: item }),
|
|
6127
|
-
warningItems?.includes(item) && /* @__PURE__ */ jsx102(Tooltip8, { title: warningMessage, children: /* @__PURE__ */ jsx102(WarningAmber, { color: "warning" }) })
|
|
6142
|
+
(warningItems?.includes(item) || warningItems?.includes(id)) && /* @__PURE__ */ jsx102(Tooltip8, { title: warningMessage, children: /* @__PURE__ */ jsx102(WarningAmber, { color: "warning" }) })
|
|
6128
6143
|
]
|
|
6129
6144
|
},
|
|
6130
6145
|
id
|
|
@@ -6964,7 +6979,7 @@ var SmartSelect_default = SmartSelect;
|
|
|
6964
6979
|
// src/components/SquareLabel/SquareLabel.tsx
|
|
6965
6980
|
import { memo as memo18 } from "react";
|
|
6966
6981
|
import { Typography as Typography26 } from "@mui/material";
|
|
6967
|
-
import red2 from "@mui/material/colors
|
|
6982
|
+
import { red as red2 } from "@mui/material/colors";
|
|
6968
6983
|
import { makeStyles as makeStyles44 } from "tss-react/mui";
|
|
6969
6984
|
import { jsx as jsx111 } from "react/jsx-runtime";
|
|
6970
6985
|
var useStyles44 = makeStyles44()((theme) => ({
|
|
@@ -6987,7 +7002,7 @@ var SquareLabel_default = memo18(SquareLabel);
|
|
|
6987
7002
|
|
|
6988
7003
|
// src/components/Switch/Switch.tsx
|
|
6989
7004
|
import { memo as memo19 } from "react";
|
|
6990
|
-
import { Grid2, Switch } from "@mui/material";
|
|
7005
|
+
import { Grid as Grid2, Switch } from "@mui/material";
|
|
6991
7006
|
import { withStyles as withStyles6 } from "tss-react/mui";
|
|
6992
7007
|
import { jsx as jsx112, jsxs as jsxs75 } from "react/jsx-runtime";
|
|
6993
7008
|
var LSwitch = ({
|
|
@@ -7043,9 +7058,7 @@ var Switch_default = memo19(LabelledSwitch);
|
|
|
7043
7058
|
|
|
7044
7059
|
// src/components/SmartTableHeaderFilterMenu/SmartTableHeaderFilterMenu.tsx
|
|
7045
7060
|
import { useMemo as useMemo2, useState as useState16, useEffect as useEffect11, memo as memo20 } from "react";
|
|
7046
|
-
import {
|
|
7047
|
-
Menu as Menu4
|
|
7048
|
-
} from "@mui/material";
|
|
7061
|
+
import { Menu as Menu4 } from "@mui/material";
|
|
7049
7062
|
import classNames3 from "classnames";
|
|
7050
7063
|
import { Fragment as Fragment12, jsx as jsx113, jsxs as jsxs76 } from "react/jsx-runtime";
|
|
7051
7064
|
var MAX_WIDTH = 276;
|
|
@@ -7058,124 +7071,132 @@ var findFilterIndex = (filters, filterOption) => filters.findIndex((item) => {
|
|
|
7058
7071
|
}
|
|
7059
7072
|
return false;
|
|
7060
7073
|
});
|
|
7061
|
-
var SmartTableHeaderFilterMenu = memo20(
|
|
7062
|
-
|
|
7063
|
-
|
|
7064
|
-
|
|
7065
|
-
|
|
7066
|
-
|
|
7067
|
-
|
|
7068
|
-
|
|
7069
|
-
|
|
7070
|
-
|
|
7071
|
-
headerFilters[headCell.id] ?? []
|
|
7072
|
-
|
|
7073
|
-
|
|
7074
|
-
|
|
7075
|
-
setFilterOptionsData(headCell.filterOptions);
|
|
7076
|
-
}
|
|
7077
|
-
}, [headCell.filterOptions]);
|
|
7078
|
-
const numFilterOptions = useMemo2(() => filterOptionsData?.length ?? 0, [filterOptionsData?.length]);
|
|
7079
|
-
const handleFilterMenuOpen = (event) => {
|
|
7080
|
-
if (!numFilterOptions && !headCell.isAutocompleteFilterMenu) {
|
|
7081
|
-
headCell.refetchFilterOptions?.();
|
|
7082
|
-
}
|
|
7083
|
-
setAnchorEl(event.currentTarget);
|
|
7084
|
-
};
|
|
7085
|
-
const handleFilterMenuClose = () => {
|
|
7086
|
-
setSelectedFilterOptions(headerFilters[headCell.id]);
|
|
7087
|
-
setAnchorEl(null);
|
|
7088
|
-
};
|
|
7089
|
-
const handleSelectAllChange = (checked) => {
|
|
7090
|
-
if (checked) {
|
|
7091
|
-
setSelectedFilterOptions([...filterOptionsData ?? []]);
|
|
7092
|
-
return;
|
|
7093
|
-
}
|
|
7094
|
-
setSelectedFilterOptions([]);
|
|
7095
|
-
};
|
|
7096
|
-
const handleFilterOptionChange = (option) => {
|
|
7097
|
-
const selectedIndex = findFilterIndex(selectedFilterOptions, option);
|
|
7098
|
-
let newSelected;
|
|
7099
|
-
if (selectedIndex === -1) {
|
|
7100
|
-
if (typeof option === "string") {
|
|
7101
|
-
newSelected = [...selectedFilterOptions, option];
|
|
7102
|
-
} else {
|
|
7103
|
-
newSelected = [...selectedFilterOptions, option];
|
|
7074
|
+
var SmartTableHeaderFilterMenu = memo20(
|
|
7075
|
+
({
|
|
7076
|
+
headCell,
|
|
7077
|
+
numActiveFilters,
|
|
7078
|
+
headerFilters,
|
|
7079
|
+
shouldShowCheckOnFilter,
|
|
7080
|
+
onApplyFilters
|
|
7081
|
+
}) => {
|
|
7082
|
+
const [anchorEl, setAnchorEl] = useState16(null);
|
|
7083
|
+
const [filterOptionsData, setFilterOptionsData] = useState16();
|
|
7084
|
+
const [selectedFilterOptions, setSelectedFilterOptions] = useState16(headerFilters[headCell.id] ?? []);
|
|
7085
|
+
useEffect11(() => {
|
|
7086
|
+
if (headCell.filterOptions) {
|
|
7087
|
+
setFilterOptionsData(headCell.filterOptions);
|
|
7104
7088
|
}
|
|
7105
|
-
}
|
|
7106
|
-
|
|
7107
|
-
|
|
7108
|
-
|
|
7109
|
-
|
|
7110
|
-
|
|
7111
|
-
|
|
7112
|
-
|
|
7113
|
-
|
|
7114
|
-
|
|
7115
|
-
[headCell.id]: [...selectedFilterOptions]
|
|
7089
|
+
}, [headCell.filterOptions]);
|
|
7090
|
+
const numFilterOptions = useMemo2(
|
|
7091
|
+
() => filterOptionsData?.length ?? 0,
|
|
7092
|
+
[filterOptionsData?.length]
|
|
7093
|
+
);
|
|
7094
|
+
const handleFilterMenuOpen = (event) => {
|
|
7095
|
+
if (!numFilterOptions && !headCell.isAutocompleteFilterMenu) {
|
|
7096
|
+
headCell.refetchFilterOptions?.();
|
|
7097
|
+
}
|
|
7098
|
+
setAnchorEl(event.currentTarget);
|
|
7116
7099
|
};
|
|
7117
|
-
|
|
7118
|
-
|
|
7119
|
-
|
|
7120
|
-
|
|
7121
|
-
|
|
7122
|
-
|
|
7123
|
-
|
|
7124
|
-
|
|
7125
|
-
|
|
7126
|
-
|
|
7127
|
-
numActiveFilters,
|
|
7128
|
-
handleClick: handleFilterMenuOpen,
|
|
7129
|
-
className: classNames3("filter-menu-trigger", {
|
|
7130
|
-
"has-active-filters": !!numActiveFilters || !!anchorEl
|
|
7131
|
-
})
|
|
7100
|
+
const handleFilterMenuClose = () => {
|
|
7101
|
+
setSelectedFilterOptions(headerFilters[headCell.id]);
|
|
7102
|
+
setAnchorEl(null);
|
|
7103
|
+
};
|
|
7104
|
+
const handleSelectAllChange = (checked) => {
|
|
7105
|
+
if (checked) {
|
|
7106
|
+
setSelectedFilterOptions([
|
|
7107
|
+
...filterOptionsData ?? []
|
|
7108
|
+
]);
|
|
7109
|
+
return;
|
|
7132
7110
|
}
|
|
7133
|
-
|
|
7134
|
-
|
|
7135
|
-
|
|
7136
|
-
|
|
7137
|
-
|
|
7138
|
-
|
|
7139
|
-
|
|
7140
|
-
|
|
7141
|
-
|
|
7142
|
-
|
|
7143
|
-
|
|
7144
|
-
|
|
7145
|
-
|
|
7146
|
-
|
|
7147
|
-
|
|
7148
|
-
|
|
7149
|
-
|
|
7150
|
-
|
|
7151
|
-
columnId: headCell.id,
|
|
7152
|
-
labelFieldName: headCell.fieldName ?? "",
|
|
7153
|
-
isLoading: headCell.isFetchingFilterOptions,
|
|
7154
|
-
filterOptions: headCell.filterOptions,
|
|
7155
|
-
onAutocompleteFilterChange: headCell.onAutocompleteFilterChange,
|
|
7156
|
-
selectedFilterOptions,
|
|
7157
|
-
onFilterOptionChange: handleFilterOptionChange,
|
|
7158
|
-
onApplyFiltersClick: handleApplyFiltersClick,
|
|
7159
|
-
shouldShowCheckOnFilter
|
|
7160
|
-
}
|
|
7161
|
-
) : /* @__PURE__ */ jsx113(
|
|
7162
|
-
CheckboxFilterMenuContent,
|
|
7163
|
-
{
|
|
7164
|
-
columnId: headCell.id,
|
|
7165
|
-
labelFieldName: headCell.fieldName ?? "",
|
|
7166
|
-
isLoading: headCell.isFetchingFilterOptions,
|
|
7167
|
-
selectedFilterOptions,
|
|
7168
|
-
filterOptions: filterOptionsData ?? [],
|
|
7169
|
-
onSelectAllChange: handleSelectAllChange,
|
|
7170
|
-
onFilterOptionChange: handleFilterOptionChange,
|
|
7171
|
-
onApplyFiltersClick: handleApplyFiltersClick,
|
|
7172
|
-
shouldShowCheckOnFilter
|
|
7173
|
-
}
|
|
7174
|
-
)
|
|
7111
|
+
setSelectedFilterOptions([]);
|
|
7112
|
+
};
|
|
7113
|
+
const handleFilterOptionChange = (option) => {
|
|
7114
|
+
const selectedIndex = findFilterIndex(selectedFilterOptions, option);
|
|
7115
|
+
let newSelected;
|
|
7116
|
+
if (selectedIndex === -1) {
|
|
7117
|
+
if (typeof option === "string") {
|
|
7118
|
+
newSelected = [...selectedFilterOptions, option];
|
|
7119
|
+
} else {
|
|
7120
|
+
newSelected = [
|
|
7121
|
+
...selectedFilterOptions,
|
|
7122
|
+
option
|
|
7123
|
+
];
|
|
7124
|
+
}
|
|
7125
|
+
} else {
|
|
7126
|
+
newSelected = selectedFilterOptions.filter(
|
|
7127
|
+
(_, index) => index !== selectedIndex
|
|
7128
|
+
);
|
|
7175
7129
|
}
|
|
7176
|
-
|
|
7177
|
-
|
|
7178
|
-
|
|
7130
|
+
setSelectedFilterOptions(newSelected);
|
|
7131
|
+
};
|
|
7132
|
+
const handleApplyFiltersClick = (shouldSave) => {
|
|
7133
|
+
const updatedFilters = {
|
|
7134
|
+
...headerFilters,
|
|
7135
|
+
[headCell.id]: [...selectedFilterOptions]
|
|
7136
|
+
};
|
|
7137
|
+
onApplyFilters?.(updatedFilters, shouldSave);
|
|
7138
|
+
setAnchorEl(null);
|
|
7139
|
+
};
|
|
7140
|
+
useEffect11(() => {
|
|
7141
|
+
setSelectedFilterOptions(headerFilters[headCell.id] ?? []);
|
|
7142
|
+
}, [headerFilters, headCell.id]);
|
|
7143
|
+
return /* @__PURE__ */ jsxs76(Fragment12, { children: [
|
|
7144
|
+
/* @__PURE__ */ jsx113(
|
|
7145
|
+
ActiveFiltersIconButton,
|
|
7146
|
+
{
|
|
7147
|
+
numActiveFilters,
|
|
7148
|
+
handleClick: handleFilterMenuOpen,
|
|
7149
|
+
className: classNames3("filter-menu-trigger", {
|
|
7150
|
+
"has-active-filters": !!numActiveFilters || !!anchorEl
|
|
7151
|
+
})
|
|
7152
|
+
}
|
|
7153
|
+
),
|
|
7154
|
+
/* @__PURE__ */ jsx113(
|
|
7155
|
+
Menu4,
|
|
7156
|
+
{
|
|
7157
|
+
open: !!anchorEl,
|
|
7158
|
+
onClose: handleFilterMenuClose,
|
|
7159
|
+
anchorEl,
|
|
7160
|
+
"data-testid": "filter-menu",
|
|
7161
|
+
slotProps: {
|
|
7162
|
+
list: {
|
|
7163
|
+
sx: { p: 0, maxWidth: MAX_WIDTH }
|
|
7164
|
+
}
|
|
7165
|
+
},
|
|
7166
|
+
anchorOrigin: { vertical: "bottom", horizontal: "right" },
|
|
7167
|
+
transformOrigin: { vertical: "top", horizontal: "right" },
|
|
7168
|
+
children: headCell.isAutocompleteFilterMenu ? /* @__PURE__ */ jsx113(
|
|
7169
|
+
AutocompleteFilterMenuContent,
|
|
7170
|
+
{
|
|
7171
|
+
columnId: headCell.id,
|
|
7172
|
+
labelFieldName: headCell.fieldName ?? "",
|
|
7173
|
+
isLoading: headCell.isFetchingFilterOptions,
|
|
7174
|
+
filterOptions: headCell.filterOptions,
|
|
7175
|
+
onAutocompleteFilterChange: headCell.onAutocompleteFilterChange,
|
|
7176
|
+
selectedFilterOptions,
|
|
7177
|
+
onFilterOptionChange: handleFilterOptionChange,
|
|
7178
|
+
onApplyFiltersClick: handleApplyFiltersClick,
|
|
7179
|
+
shouldShowCheckOnFilter
|
|
7180
|
+
}
|
|
7181
|
+
) : /* @__PURE__ */ jsx113(
|
|
7182
|
+
CheckboxFilterMenuContent,
|
|
7183
|
+
{
|
|
7184
|
+
columnId: headCell.id,
|
|
7185
|
+
labelFieldName: headCell.fieldName ?? "",
|
|
7186
|
+
isLoading: headCell.isFetchingFilterOptions,
|
|
7187
|
+
selectedFilterOptions,
|
|
7188
|
+
filterOptions: filterOptionsData ?? [],
|
|
7189
|
+
onSelectAllChange: handleSelectAllChange,
|
|
7190
|
+
onFilterOptionChange: handleFilterOptionChange,
|
|
7191
|
+
onApplyFiltersClick: handleApplyFiltersClick,
|
|
7192
|
+
shouldShowCheckOnFilter
|
|
7193
|
+
}
|
|
7194
|
+
)
|
|
7195
|
+
}
|
|
7196
|
+
)
|
|
7197
|
+
] });
|
|
7198
|
+
}
|
|
7199
|
+
);
|
|
7179
7200
|
|
|
7180
7201
|
// src/components/SmartTableHeader/SmartTableHeader.tsx
|
|
7181
7202
|
import { memo as memo21 } from "react";
|
|
@@ -7190,121 +7211,131 @@ import {
|
|
|
7190
7211
|
Typography as Typography27
|
|
7191
7212
|
} from "@mui/material";
|
|
7192
7213
|
import { jsx as jsx114, jsxs as jsxs77 } from "react/jsx-runtime";
|
|
7193
|
-
var SmartTableHeader = memo21(
|
|
7194
|
-
|
|
7195
|
-
|
|
7196
|
-
|
|
7197
|
-
|
|
7198
|
-
|
|
7199
|
-
|
|
7200
|
-
|
|
7201
|
-
|
|
7202
|
-
|
|
7203
|
-
|
|
7204
|
-
|
|
7205
|
-
|
|
7206
|
-
|
|
7207
|
-
|
|
7208
|
-
|
|
7209
|
-
|
|
7210
|
-
|
|
7211
|
-
|
|
7212
|
-
|
|
7213
|
-
|
|
7214
|
-
|
|
7215
|
-
|
|
7216
|
-
|
|
7217
|
-
},
|
|
7218
|
-
children: /* @__PURE__ */ jsxs77(TableRow, { children: [
|
|
7219
|
-
enableCheckboxSelection ? /* @__PURE__ */ jsx114(TableCell, { padding: "checkbox", children: /* @__PURE__ */ jsx114(
|
|
7220
|
-
Checkbox6,
|
|
7221
|
-
{
|
|
7222
|
-
color: "primary",
|
|
7223
|
-
disableRipple: true,
|
|
7224
|
-
indeterminate: numSelectedRows > 0 && numSelectedRows < numRows,
|
|
7225
|
-
checked: numRows > 0 && numSelectedRows === numRows,
|
|
7226
|
-
onChange: onSelectAllClick
|
|
7214
|
+
var SmartTableHeader = memo21(
|
|
7215
|
+
({
|
|
7216
|
+
order,
|
|
7217
|
+
orderBy,
|
|
7218
|
+
headCells,
|
|
7219
|
+
numSelectedRows,
|
|
7220
|
+
numRows,
|
|
7221
|
+
enableCheckboxSelection = false,
|
|
7222
|
+
headerFilters,
|
|
7223
|
+
onRequestSort,
|
|
7224
|
+
onSelectAllClick,
|
|
7225
|
+
onApplyFilters,
|
|
7226
|
+
shouldShowCheckOnFilter
|
|
7227
|
+
}) => {
|
|
7228
|
+
const createSortHandler = (property) => (event) => {
|
|
7229
|
+
onRequestSort(event, property);
|
|
7230
|
+
};
|
|
7231
|
+
const isSortActive = (headCellId) => orderBy === headCellId;
|
|
7232
|
+
return /* @__PURE__ */ jsx114(
|
|
7233
|
+
TableHead,
|
|
7234
|
+
{
|
|
7235
|
+
sx: {
|
|
7236
|
+
"& .MuiTableSortLabel-root": {
|
|
7237
|
+
fontWeight: 600
|
|
7227
7238
|
}
|
|
7228
|
-
|
|
7229
|
-
|
|
7230
|
-
TableCell,
|
|
7231
|
-
|
|
7232
|
-
|
|
7233
|
-
|
|
7234
|
-
|
|
7235
|
-
|
|
7236
|
-
|
|
7237
|
-
|
|
7238
|
-
|
|
7239
|
-
|
|
7240
|
-
|
|
7241
|
-
|
|
7242
|
-
|
|
7243
|
-
|
|
7244
|
-
|
|
7245
|
-
|
|
7246
|
-
|
|
7247
|
-
|
|
7239
|
+
},
|
|
7240
|
+
children: /* @__PURE__ */ jsxs77(TableRow, { children: [
|
|
7241
|
+
enableCheckboxSelection ? /* @__PURE__ */ jsx114(TableCell, { padding: "checkbox", children: /* @__PURE__ */ jsx114(
|
|
7242
|
+
Checkbox6,
|
|
7243
|
+
{
|
|
7244
|
+
color: "primary",
|
|
7245
|
+
disableRipple: true,
|
|
7246
|
+
indeterminate: numSelectedRows > 0 && numSelectedRows < numRows,
|
|
7247
|
+
checked: numRows > 0 && numSelectedRows === numRows,
|
|
7248
|
+
onChange: onSelectAllClick
|
|
7249
|
+
}
|
|
7250
|
+
) }) : null,
|
|
7251
|
+
headCells.map((headCell) => /* @__PURE__ */ jsx114(
|
|
7252
|
+
TableCell,
|
|
7253
|
+
{
|
|
7254
|
+
align: "left",
|
|
7255
|
+
width: headCell.width ?? "auto",
|
|
7256
|
+
sortDirection: orderBy === headCell.id ? order : false,
|
|
7257
|
+
sx: {
|
|
7258
|
+
whiteSpace: "nowrap",
|
|
7259
|
+
"& .filter-menu-trigger": {
|
|
7260
|
+
visibility: "hidden",
|
|
7261
|
+
opacity: 0,
|
|
7262
|
+
transition: "visibility 0.1s, opacity 0.1s ease-in"
|
|
7263
|
+
},
|
|
7264
|
+
"&:hover .filter-menu-trigger, & .filter-menu-trigger.has-active-filters": {
|
|
7265
|
+
visibility: "visible",
|
|
7248
7266
|
opacity: 1
|
|
7267
|
+
},
|
|
7268
|
+
"&:hover .MuiTableSortLabel-root": {
|
|
7269
|
+
"& .MuiTableSortLabel-icon": {
|
|
7270
|
+
opacity: 1
|
|
7271
|
+
}
|
|
7249
7272
|
}
|
|
7250
|
-
}
|
|
7273
|
+
},
|
|
7274
|
+
children: /* @__PURE__ */ jsxs77(
|
|
7275
|
+
Box32,
|
|
7276
|
+
{
|
|
7277
|
+
display: "flex",
|
|
7278
|
+
flexDirection: "row",
|
|
7279
|
+
gap: headCell.disableSort ? 1 : 0,
|
|
7280
|
+
children: [
|
|
7281
|
+
headCell.disableSort ? headCell.RenderHeader ?? /* @__PURE__ */ jsx114(Tooltip10, { title: headCell.labelTooltip ?? "", arrow: true, children: /* @__PURE__ */ jsx114(
|
|
7282
|
+
Typography27,
|
|
7283
|
+
{
|
|
7284
|
+
variant: "subtitle2",
|
|
7285
|
+
mt: 0.25,
|
|
7286
|
+
fontWeight: 600,
|
|
7287
|
+
children: headCell.label
|
|
7288
|
+
}
|
|
7289
|
+
) }) : /* @__PURE__ */ jsx114(Tooltip10, { title: headCell.labelTooltip ?? "", arrow: true, children: /* @__PURE__ */ jsxs77(
|
|
7290
|
+
TableSortLabel,
|
|
7291
|
+
{
|
|
7292
|
+
"data-testid": "table-sort-label",
|
|
7293
|
+
active: isSortActive(headCell.id),
|
|
7294
|
+
direction: orderBy === headCell.id ? order : "asc",
|
|
7295
|
+
onClick: createSortHandler(headCell.id),
|
|
7296
|
+
children: [
|
|
7297
|
+
headCell.RenderHeader ?? headCell.label,
|
|
7298
|
+
orderBy === headCell.id ? /* @__PURE__ */ jsx114(
|
|
7299
|
+
"span",
|
|
7300
|
+
{
|
|
7301
|
+
style: {
|
|
7302
|
+
border: 0,
|
|
7303
|
+
clip: "rect(0 0 0 0)",
|
|
7304
|
+
height: 1,
|
|
7305
|
+
margin: -1,
|
|
7306
|
+
overflow: "hidden",
|
|
7307
|
+
padding: 0,
|
|
7308
|
+
position: "absolute",
|
|
7309
|
+
top: 20,
|
|
7310
|
+
width: 1
|
|
7311
|
+
},
|
|
7312
|
+
children: order === "desc" ? "sorted descending" : "sorted ascending"
|
|
7313
|
+
}
|
|
7314
|
+
) : null
|
|
7315
|
+
]
|
|
7316
|
+
}
|
|
7317
|
+
) }),
|
|
7318
|
+
headCell.refetchFilterOptions ? /* @__PURE__ */ jsx114(
|
|
7319
|
+
SmartTableHeaderFilterMenu,
|
|
7320
|
+
{
|
|
7321
|
+
headCell,
|
|
7322
|
+
headerFilters,
|
|
7323
|
+
numActiveFilters: headerFilters[headCell.id]?.length ?? 0,
|
|
7324
|
+
onApplyFilters,
|
|
7325
|
+
shouldShowCheckOnFilter
|
|
7326
|
+
}
|
|
7327
|
+
) : null
|
|
7328
|
+
]
|
|
7329
|
+
}
|
|
7330
|
+
)
|
|
7251
7331
|
},
|
|
7252
|
-
|
|
7253
|
-
|
|
7254
|
-
|
|
7255
|
-
|
|
7256
|
-
|
|
7257
|
-
|
|
7258
|
-
|
|
7259
|
-
headCell.disableSort ? headCell.RenderHeader ?? /* @__PURE__ */ jsx114(Tooltip10, { title: headCell.labelTooltip ?? "", arrow: true, children: /* @__PURE__ */ jsx114(Typography27, { variant: "subtitle2", mt: 0.25, fontWeight: 600, children: headCell.label }) }) : /* @__PURE__ */ jsx114(Tooltip10, { title: headCell.labelTooltip ?? "", arrow: true, children: /* @__PURE__ */ jsxs77(
|
|
7260
|
-
TableSortLabel,
|
|
7261
|
-
{
|
|
7262
|
-
"data-testid": "table-sort-label",
|
|
7263
|
-
active: isSortActive(headCell.id),
|
|
7264
|
-
direction: orderBy === headCell.id ? order : "asc",
|
|
7265
|
-
onClick: createSortHandler(headCell.id),
|
|
7266
|
-
children: [
|
|
7267
|
-
headCell.RenderHeader ?? headCell.label,
|
|
7268
|
-
orderBy === headCell.id ? /* @__PURE__ */ jsx114(
|
|
7269
|
-
"span",
|
|
7270
|
-
{
|
|
7271
|
-
style: {
|
|
7272
|
-
border: 0,
|
|
7273
|
-
clip: "rect(0 0 0 0)",
|
|
7274
|
-
height: 1,
|
|
7275
|
-
margin: -1,
|
|
7276
|
-
overflow: "hidden",
|
|
7277
|
-
padding: 0,
|
|
7278
|
-
position: "absolute",
|
|
7279
|
-
top: 20,
|
|
7280
|
-
width: 1
|
|
7281
|
-
},
|
|
7282
|
-
children: order === "desc" ? "sorted descending" : "sorted ascending"
|
|
7283
|
-
}
|
|
7284
|
-
) : null
|
|
7285
|
-
]
|
|
7286
|
-
}
|
|
7287
|
-
) }),
|
|
7288
|
-
headCell.refetchFilterOptions ? /* @__PURE__ */ jsx114(
|
|
7289
|
-
SmartTableHeaderFilterMenu,
|
|
7290
|
-
{
|
|
7291
|
-
headCell,
|
|
7292
|
-
headerFilters,
|
|
7293
|
-
numActiveFilters: headerFilters[headCell.id]?.length ?? 0,
|
|
7294
|
-
onApplyFilters,
|
|
7295
|
-
shouldShowCheckOnFilter
|
|
7296
|
-
}
|
|
7297
|
-
) : null
|
|
7298
|
-
]
|
|
7299
|
-
}
|
|
7300
|
-
)
|
|
7301
|
-
},
|
|
7302
|
-
headCell.id
|
|
7303
|
-
))
|
|
7304
|
-
] })
|
|
7305
|
-
}
|
|
7306
|
-
);
|
|
7307
|
-
});
|
|
7332
|
+
headCell.id
|
|
7333
|
+
))
|
|
7334
|
+
] })
|
|
7335
|
+
}
|
|
7336
|
+
);
|
|
7337
|
+
}
|
|
7338
|
+
);
|
|
7308
7339
|
|
|
7309
7340
|
// src/components/Table/Table.tsx
|
|
7310
7341
|
var import_debounce = __toESM(require_debounce(), 1);
|
|
@@ -7499,17 +7530,19 @@ import {
|
|
|
7499
7530
|
useState as useState18,
|
|
7500
7531
|
useEffect as useEffect12
|
|
7501
7532
|
} from "react";
|
|
7502
|
-
import {
|
|
7503
|
-
Paper as Paper11,
|
|
7504
|
-
Table as Table2,
|
|
7505
|
-
TableBody as TableBody3,
|
|
7506
|
-
TableContainer as TableContainer2,
|
|
7507
|
-
Box as Box37
|
|
7508
|
-
} from "@mui/material";
|
|
7533
|
+
import { Paper as Paper11, Table as Table2, TableBody as TableBody3, TableContainer as TableContainer2, Box as Box37 } from "@mui/material";
|
|
7509
7534
|
|
|
7510
7535
|
// src/components/TableDesktopFooter/TableDesktopFooter.tsx
|
|
7511
7536
|
import Refresh3 from "@mui/icons-material/Refresh";
|
|
7512
|
-
import {
|
|
7537
|
+
import {
|
|
7538
|
+
Box as Box35,
|
|
7539
|
+
Button as Button15,
|
|
7540
|
+
MenuItem as MenuItem4,
|
|
7541
|
+
Pagination as Pagination2,
|
|
7542
|
+
Select as Select4,
|
|
7543
|
+
Stack,
|
|
7544
|
+
Typography as Typography28
|
|
7545
|
+
} from "@mui/material";
|
|
7513
7546
|
import { jsx as jsx117, jsxs as jsxs79 } from "react/jsx-runtime";
|
|
7514
7547
|
var TableDesktopFooter = ({
|
|
7515
7548
|
numPages,
|
|
@@ -7547,13 +7580,7 @@ var TableDesktopFooter = ({
|
|
|
7547
7580
|
borderColor: colors.neutral600
|
|
7548
7581
|
},
|
|
7549
7582
|
children: [
|
|
7550
|
-
/* @__PURE__ */ jsx117(
|
|
7551
|
-
Refresh3,
|
|
7552
|
-
{
|
|
7553
|
-
fontSize: "small",
|
|
7554
|
-
color: isFetching ? "disabled" : "primary"
|
|
7555
|
-
}
|
|
7556
|
-
),
|
|
7583
|
+
/* @__PURE__ */ jsx117(Refresh3, { fontSize: "small", color: isFetching ? "disabled" : "primary" }),
|
|
7557
7584
|
"REFRESH"
|
|
7558
7585
|
]
|
|
7559
7586
|
}
|
|
@@ -7884,14 +7911,13 @@ var TableDesktop = ({
|
|
|
7884
7911
|
const [orderBy, setOrderBy] = useState18(
|
|
7885
7912
|
appliedFilters?.sortField || "delivery_date"
|
|
7886
7913
|
);
|
|
7887
|
-
const [selectedRows, setSelectedRows] = useState18(
|
|
7914
|
+
const [selectedRows, setSelectedRows] = useState18(
|
|
7915
|
+
/* @__PURE__ */ new Set()
|
|
7916
|
+
);
|
|
7888
7917
|
const [isRowsFromAllPagesSelected, setIsRowsFromAllPagesSelected] = useState18(false);
|
|
7889
7918
|
const { toolbar: Toolbar2 } = components ?? {};
|
|
7890
7919
|
const { toolbarProps, footerProps } = componentsProps ?? {};
|
|
7891
|
-
const numRows = useMemo3(
|
|
7892
|
-
() => data.length,
|
|
7893
|
-
[data.length]
|
|
7894
|
-
);
|
|
7920
|
+
const numRows = useMemo3(() => data.length, [data.length]);
|
|
7895
7921
|
const emptyRows = useMemo3(
|
|
7896
7922
|
() => rowsPerPage - numRows,
|
|
7897
7923
|
[rowsPerPage, numRows]
|
|
@@ -7919,7 +7945,6 @@ var TableDesktop = ({
|
|
|
7919
7945
|
};
|
|
7920
7946
|
const selectAllRowsInPage = () => {
|
|
7921
7947
|
const allRowsIds = new Set(data.map((obj) => obj[keyField]));
|
|
7922
|
-
;
|
|
7923
7948
|
setSelectedRows(allRowsIds);
|
|
7924
7949
|
};
|
|
7925
7950
|
const resetSelectedRows = () => {
|
|
@@ -8081,46 +8106,38 @@ var TableDesktop = ({
|
|
|
8081
8106
|
backgroundColor: (theme) => theme.palette.grey[500]
|
|
8082
8107
|
}
|
|
8083
8108
|
},
|
|
8084
|
-
children: /* @__PURE__ */ jsx123(
|
|
8085
|
-
|
|
8109
|
+
children: /* @__PURE__ */ jsx123(Table2, { stickyHeader: true, "aria-label": "sticky-table", sx: { tableLayout }, children: visibleHeadCells.length === 0 && !isLoading ? /* @__PURE__ */ jsx123(
|
|
8110
|
+
TableDesktopNoColumnsMessage,
|
|
8086
8111
|
{
|
|
8087
|
-
|
|
8088
|
-
"aria-label": "sticky-table",
|
|
8089
|
-
sx: { tableLayout },
|
|
8090
|
-
children: visibleHeadCells.length === 0 && !isLoading ? /* @__PURE__ */ jsx123(
|
|
8091
|
-
TableDesktopNoColumnsMessage,
|
|
8092
|
-
{
|
|
8093
|
-
onClickNoColumnsMessageOpenMenu: toolbarProps?.onClickToolbarMenuOpen
|
|
8094
|
-
}
|
|
8095
|
-
) : /* @__PURE__ */ jsxs84(Fragment13, { children: [
|
|
8096
|
-
/* @__PURE__ */ jsx123(
|
|
8097
|
-
SmartTableHeader,
|
|
8098
|
-
{
|
|
8099
|
-
headCells: visibleHeadCells,
|
|
8100
|
-
order,
|
|
8101
|
-
orderBy,
|
|
8102
|
-
numSelectedRows,
|
|
8103
|
-
numRows,
|
|
8104
|
-
enableCheckboxSelection,
|
|
8105
|
-
headerFilters: headerFilters ?? {},
|
|
8106
|
-
onRequestSort: handleRequestSort,
|
|
8107
|
-
onSelectAllClick: handleSelectAllClick,
|
|
8108
|
-
onApplyFilters: handleApplyFilters,
|
|
8109
|
-
shouldShowCheckOnFilter
|
|
8110
|
-
}
|
|
8111
|
-
),
|
|
8112
|
-
/* @__PURE__ */ jsx123(TableBody3, { children: !isLoading ? renderBody : /* @__PURE__ */ jsx123(
|
|
8113
|
-
TableDesktopLoadingState,
|
|
8114
|
-
{
|
|
8115
|
-
numRows: data.length,
|
|
8116
|
-
rowsPerPage,
|
|
8117
|
-
numColumns: visibleHeadCells.length + (enableCheckboxSelection ? 1 : 0),
|
|
8118
|
-
rowHeight
|
|
8119
|
-
}
|
|
8120
|
-
) })
|
|
8121
|
-
] })
|
|
8112
|
+
onClickNoColumnsMessageOpenMenu: toolbarProps?.onClickToolbarMenuOpen
|
|
8122
8113
|
}
|
|
8123
|
-
)
|
|
8114
|
+
) : /* @__PURE__ */ jsxs84(Fragment13, { children: [
|
|
8115
|
+
/* @__PURE__ */ jsx123(
|
|
8116
|
+
SmartTableHeader,
|
|
8117
|
+
{
|
|
8118
|
+
headCells: visibleHeadCells,
|
|
8119
|
+
order,
|
|
8120
|
+
orderBy,
|
|
8121
|
+
numSelectedRows,
|
|
8122
|
+
numRows,
|
|
8123
|
+
enableCheckboxSelection,
|
|
8124
|
+
headerFilters: headerFilters ?? {},
|
|
8125
|
+
onRequestSort: handleRequestSort,
|
|
8126
|
+
onSelectAllClick: handleSelectAllClick,
|
|
8127
|
+
onApplyFilters: handleApplyFilters,
|
|
8128
|
+
shouldShowCheckOnFilter
|
|
8129
|
+
}
|
|
8130
|
+
),
|
|
8131
|
+
/* @__PURE__ */ jsx123(TableBody3, { children: !isLoading ? renderBody : /* @__PURE__ */ jsx123(
|
|
8132
|
+
TableDesktopLoadingState,
|
|
8133
|
+
{
|
|
8134
|
+
numRows: data.length,
|
|
8135
|
+
rowsPerPage,
|
|
8136
|
+
numColumns: visibleHeadCells.length + (enableCheckboxSelection ? 1 : 0),
|
|
8137
|
+
rowHeight
|
|
8138
|
+
}
|
|
8139
|
+
) })
|
|
8140
|
+
] }) })
|
|
8124
8141
|
}
|
|
8125
8142
|
),
|
|
8126
8143
|
children,
|
|
@@ -8153,8 +8170,14 @@ var TableDesktopNumericField = ({
|
|
|
8153
8170
|
}) => {
|
|
8154
8171
|
const [input, setInput] = useState19(initialValue);
|
|
8155
8172
|
const oldValue = useRef6(initialValue);
|
|
8156
|
-
const isDirty = useMemo4(
|
|
8157
|
-
|
|
8173
|
+
const isDirty = useMemo4(
|
|
8174
|
+
() => input !== oldValue.current,
|
|
8175
|
+
[input, oldValue.current]
|
|
8176
|
+
);
|
|
8177
|
+
const hasValidationError = useMemo4(
|
|
8178
|
+
() => isDirty && !validateInput?.(input),
|
|
8179
|
+
[input, validateInput, isDirty]
|
|
8180
|
+
);
|
|
8158
8181
|
const commitValue = (value) => {
|
|
8159
8182
|
if (hasValidationError || !onUpdateEditableCell || !isDirty) {
|
|
8160
8183
|
setInput(oldValue.current);
|
|
@@ -8199,63 +8222,69 @@ var TableDesktopNumericField = ({
|
|
|
8199
8222
|
// src/components/TableDesktopEditableField/TableDesktopSmartSelect.tsx
|
|
8200
8223
|
import { useState as useState20, memo as memo22, useEffect as useEffect13 } from "react";
|
|
8201
8224
|
import { jsx as jsx125 } from "react/jsx-runtime";
|
|
8202
|
-
var TableDesktopSmartSelect = memo22(
|
|
8203
|
-
|
|
8204
|
-
|
|
8205
|
-
|
|
8206
|
-
|
|
8207
|
-
|
|
8208
|
-
|
|
8209
|
-
|
|
8210
|
-
|
|
8211
|
-
|
|
8212
|
-
|
|
8213
|
-
|
|
8214
|
-
|
|
8215
|
-
|
|
8216
|
-
|
|
8217
|
-
|
|
8218
|
-
|
|
8219
|
-
|
|
8220
|
-
|
|
8221
|
-
|
|
8222
|
-
|
|
8223
|
-
|
|
8224
|
-
|
|
8225
|
-
|
|
8226
|
-
|
|
8227
|
-
|
|
8228
|
-
|
|
8229
|
-
|
|
8230
|
-
|
|
8231
|
-
|
|
8232
|
-
|
|
8233
|
-
|
|
8234
|
-
|
|
8235
|
-
|
|
8236
|
-
|
|
8237
|
-
|
|
8238
|
-
|
|
8239
|
-
|
|
8240
|
-
|
|
8241
|
-
|
|
8242
|
-
|
|
8243
|
-
|
|
8244
|
-
|
|
8245
|
-
|
|
8246
|
-
|
|
8247
|
-
|
|
8248
|
-
|
|
8249
|
-
|
|
8250
|
-
|
|
8251
|
-
|
|
8252
|
-
|
|
8225
|
+
var TableDesktopSmartSelect = memo22(
|
|
8226
|
+
({
|
|
8227
|
+
ref,
|
|
8228
|
+
initialValue,
|
|
8229
|
+
inputLabel,
|
|
8230
|
+
field,
|
|
8231
|
+
fieldName,
|
|
8232
|
+
rowId,
|
|
8233
|
+
disabled,
|
|
8234
|
+
variant = "standard",
|
|
8235
|
+
size,
|
|
8236
|
+
filterOptions,
|
|
8237
|
+
refetchFilterOptions,
|
|
8238
|
+
isFetchingFilterOptions,
|
|
8239
|
+
onUpdateEditableCell
|
|
8240
|
+
}) => {
|
|
8241
|
+
const [value, setValue] = useState20(
|
|
8242
|
+
initialValue
|
|
8243
|
+
);
|
|
8244
|
+
const [options, setOptions] = useState20();
|
|
8245
|
+
const valueId = resolveObjectType(value, "id");
|
|
8246
|
+
const valueLabel = resolveObjectType(value, fieldName);
|
|
8247
|
+
useEffect13(() => {
|
|
8248
|
+
if (filterOptions) {
|
|
8249
|
+
const parsedOptions = filterOptions?.map(
|
|
8250
|
+
(option) => ({
|
|
8251
|
+
value: resolveObjectType(option, "id"),
|
|
8252
|
+
label: String(resolveObjectType(option, fieldName))
|
|
8253
|
+
})
|
|
8254
|
+
);
|
|
8255
|
+
setOptions(parsedOptions);
|
|
8256
|
+
}
|
|
8257
|
+
}, [filterOptions]);
|
|
8258
|
+
return /* @__PURE__ */ jsx125(
|
|
8259
|
+
SmartSelect_default,
|
|
8260
|
+
{
|
|
8261
|
+
ref,
|
|
8262
|
+
value: valueId,
|
|
8263
|
+
inputLabel,
|
|
8264
|
+
options,
|
|
8265
|
+
disabled,
|
|
8266
|
+
variant,
|
|
8267
|
+
size,
|
|
8268
|
+
refetch: refetchFilterOptions,
|
|
8269
|
+
isFetching: isFetchingFilterOptions,
|
|
8270
|
+
defaultOption: {
|
|
8271
|
+
value: valueId ?? "",
|
|
8272
|
+
label: String(valueLabel ?? "")
|
|
8273
|
+
},
|
|
8274
|
+
onChange: ({ value: id, label: name }) => {
|
|
8275
|
+
if (!id || !name) {
|
|
8276
|
+
return;
|
|
8277
|
+
}
|
|
8278
|
+
setValue({ id, name });
|
|
8279
|
+
if (!onUpdateEditableCell) {
|
|
8280
|
+
return;
|
|
8281
|
+
}
|
|
8282
|
+
onUpdateEditableCell(rowId ?? 0, field, id, name);
|
|
8253
8283
|
}
|
|
8254
|
-
onUpdateEditableCell(rowId ?? 0, field, id, name);
|
|
8255
8284
|
}
|
|
8256
|
-
|
|
8257
|
-
|
|
8258
|
-
|
|
8285
|
+
);
|
|
8286
|
+
}
|
|
8287
|
+
);
|
|
8259
8288
|
|
|
8260
8289
|
// src/components/TableDesktopEditableField/TableDesktopTextField.tsx
|
|
8261
8290
|
import { useMemo as useMemo5, useState as useState21, useRef as useRef7 } from "react";
|
|
@@ -8274,8 +8303,14 @@ var TableDesktopTextField = ({
|
|
|
8274
8303
|
}) => {
|
|
8275
8304
|
const [input, setInput] = useState21(initialValue);
|
|
8276
8305
|
const oldValue = useRef7(initialValue);
|
|
8277
|
-
const isDirty = useMemo5(
|
|
8278
|
-
|
|
8306
|
+
const isDirty = useMemo5(
|
|
8307
|
+
() => input !== oldValue.current,
|
|
8308
|
+
[input, oldValue.current]
|
|
8309
|
+
);
|
|
8310
|
+
const hasValidationError = useMemo5(
|
|
8311
|
+
() => isDirty && !validateInput?.(input),
|
|
8312
|
+
[input, validateInput]
|
|
8313
|
+
);
|
|
8279
8314
|
const commitValue = (value) => {
|
|
8280
8315
|
if (hasValidationError || !onUpdateEditableCell || !isDirty) {
|
|
8281
8316
|
setInput(oldValue.current);
|
|
@@ -8331,7 +8366,7 @@ var TableDesktopEditableFieldComponent = ({
|
|
|
8331
8366
|
onUpdateEditableCell
|
|
8332
8367
|
}) => {
|
|
8333
8368
|
const editableComponents = {
|
|
8334
|
-
|
|
8369
|
+
select: /* @__PURE__ */ jsx127(
|
|
8335
8370
|
TableDesktopSmartSelect,
|
|
8336
8371
|
{
|
|
8337
8372
|
rowId,
|
|
@@ -8348,7 +8383,7 @@ var TableDesktopEditableFieldComponent = ({
|
|
|
8348
8383
|
onUpdateEditableCell
|
|
8349
8384
|
}
|
|
8350
8385
|
),
|
|
8351
|
-
|
|
8386
|
+
checkbox: /* @__PURE__ */ jsx127(
|
|
8352
8387
|
FormControlLabel4,
|
|
8353
8388
|
{
|
|
8354
8389
|
label: showCheckboxLabel ? inputLabel : "",
|
|
@@ -8368,7 +8403,7 @@ var TableDesktopEditableFieldComponent = ({
|
|
|
8368
8403
|
)
|
|
8369
8404
|
}
|
|
8370
8405
|
),
|
|
8371
|
-
|
|
8406
|
+
text: /* @__PURE__ */ jsx127(
|
|
8372
8407
|
TableDesktopTextField,
|
|
8373
8408
|
{
|
|
8374
8409
|
rowId,
|
|
@@ -8382,7 +8417,7 @@ var TableDesktopEditableFieldComponent = ({
|
|
|
8382
8417
|
onUpdateEditableCell
|
|
8383
8418
|
}
|
|
8384
8419
|
),
|
|
8385
|
-
|
|
8420
|
+
numeric: /* @__PURE__ */ jsx127(
|
|
8386
8421
|
TableDesktopNumericField,
|
|
8387
8422
|
{
|
|
8388
8423
|
rowId,
|
|
@@ -8399,7 +8434,9 @@ var TableDesktopEditableFieldComponent = ({
|
|
|
8399
8434
|
};
|
|
8400
8435
|
return editableComponents[editableCellType];
|
|
8401
8436
|
};
|
|
8402
|
-
var TableDesktopEditableField = memo23(
|
|
8437
|
+
var TableDesktopEditableField = memo23(
|
|
8438
|
+
TableDesktopEditableFieldComponent
|
|
8439
|
+
);
|
|
8403
8440
|
|
|
8404
8441
|
// src/components/TableDesktopCell/TableDesktopCell.tsx
|
|
8405
8442
|
import { useEffect as useEffect14, useState as useState22 } from "react";
|