@natoora-libs/core 0.2.6 → 0.2.61
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/{TableDesktop-CZe649rr.d.cts → TableDesktop-4tjwQjmc.d.cts} +10 -17
- package/dist/{TableDesktop-CZe649rr.d.ts → TableDesktop-4tjwQjmc.d.ts} +10 -17
- package/dist/components/index.cjs +578 -785
- package/dist/components/index.cjs.map +1 -1
- package/dist/components/index.d.cts +30 -31
- package/dist/components/index.d.ts +30 -31
- package/dist/components/index.js +535 -751
- package/dist/components/index.js.map +1 -1
- package/dist/utils/index.d.cts +1 -1
- package/dist/utils/index.d.ts +1 -1
- package/package.json +1 -1
package/dist/components/index.js
CHANGED
|
@@ -985,7 +985,7 @@ var AutocompleteFilterMenuContent = ({
|
|
|
985
985
|
onFilterOptionChange,
|
|
986
986
|
onApplyFiltersClick,
|
|
987
987
|
shouldShowCheckOnFilter,
|
|
988
|
-
|
|
988
|
+
onAutocompleteFilterChange,
|
|
989
989
|
filterOptions
|
|
990
990
|
}) => {
|
|
991
991
|
const renderLoading = () => /* @__PURE__ */ jsx12(Skeleton, { variant: "rounded", height: 26, sx: { m: 1 } });
|
|
@@ -1018,7 +1018,7 @@ var AutocompleteFilterMenuContent = ({
|
|
|
1018
1018
|
minCharacters: 3,
|
|
1019
1019
|
sx: { backgroundColor: colors.neutral200 },
|
|
1020
1020
|
onSearch: (value) => {
|
|
1021
|
-
|
|
1021
|
+
onAutocompleteFilterChange?.(value);
|
|
1022
1022
|
}
|
|
1023
1023
|
}
|
|
1024
1024
|
),
|
|
@@ -3707,7 +3707,7 @@ var CompanyLogo_default = CompanyLogo;
|
|
|
3707
3707
|
|
|
3708
3708
|
// src/components/ControlledCheckbox/ControlledCheckbox.tsx
|
|
3709
3709
|
import { Controller } from "react-hook-form";
|
|
3710
|
-
import { Checkbox as Checkbox3, FormControlLabel as FormControlLabel3, Tooltip as
|
|
3710
|
+
import { Checkbox as Checkbox3, FormControlLabel as FormControlLabel3, Tooltip as Tooltip7 } from "@mui/material";
|
|
3711
3711
|
import { jsx as jsx77 } from "react/jsx-runtime";
|
|
3712
3712
|
var ControlledCheckbox = ({
|
|
3713
3713
|
name,
|
|
@@ -3745,7 +3745,7 @@ var ControlledCheckbox = ({
|
|
|
3745
3745
|
)
|
|
3746
3746
|
}
|
|
3747
3747
|
);
|
|
3748
|
-
return tooltipDescription ? /* @__PURE__ */ jsx77(
|
|
3748
|
+
return tooltipDescription ? /* @__PURE__ */ jsx77(Tooltip7, { title: tooltipDescription, children: /* @__PURE__ */ jsx77("span", { children: checkbox }) }) : checkbox;
|
|
3749
3749
|
}
|
|
3750
3750
|
}
|
|
3751
3751
|
);
|
|
@@ -4897,7 +4897,7 @@ var FilterSimpleSelector = ({
|
|
|
4897
4897
|
var FilterSimpleSelector_default = FilterSimpleSelector;
|
|
4898
4898
|
|
|
4899
4899
|
// src/components/FixedFooter/FixedFooter.tsx
|
|
4900
|
-
import * as
|
|
4900
|
+
import * as React4 from "react";
|
|
4901
4901
|
import { Box as Box23 } from "@mui/material";
|
|
4902
4902
|
import { makeStyles as makeStyles27 } from "tss-react/mui";
|
|
4903
4903
|
import { jsx as jsx91, jsxs as jsxs55 } from "react/jsx-runtime";
|
|
@@ -4935,7 +4935,7 @@ var FixedFooter = ({ justifyContent, children }) => {
|
|
|
4935
4935
|
)
|
|
4936
4936
|
] });
|
|
4937
4937
|
};
|
|
4938
|
-
var FixedFooter_default =
|
|
4938
|
+
var FixedFooter_default = React4.memo(FixedFooter);
|
|
4939
4939
|
|
|
4940
4940
|
// src/components/Header/Header.tsx
|
|
4941
4941
|
import { Paper as Paper3 } from "@mui/material";
|
|
@@ -6256,7 +6256,7 @@ import {
|
|
|
6256
6256
|
ListItemButton,
|
|
6257
6257
|
ListItemText as ListItemText4,
|
|
6258
6258
|
ListSubheader,
|
|
6259
|
-
Tooltip as
|
|
6259
|
+
Tooltip as Tooltip8
|
|
6260
6260
|
} from "@mui/material";
|
|
6261
6261
|
import { makeStyles as makeStyles35 } from "tss-react/mui";
|
|
6262
6262
|
|
|
@@ -6345,7 +6345,7 @@ var RenderContentList = ({
|
|
|
6345
6345
|
},
|
|
6346
6346
|
children: [
|
|
6347
6347
|
/* @__PURE__ */ jsx105(ListItemText4, { primary: item }),
|
|
6348
|
-
(warningItems?.includes(item) || warningItems?.includes(id)) && /* @__PURE__ */ jsx105(
|
|
6348
|
+
(warningItems?.includes(item) || warningItems?.includes(id)) && /* @__PURE__ */ jsx105(Tooltip8, { title: warningMessage, children: /* @__PURE__ */ jsx105(WarningAmber, { color: "warning" }) })
|
|
6349
6349
|
]
|
|
6350
6350
|
},
|
|
6351
6351
|
id
|
|
@@ -6592,7 +6592,7 @@ import { makeStyles as makeStyles39 } from "tss-react/mui";
|
|
|
6592
6592
|
|
|
6593
6593
|
// src/components/SearchWithFilters/SearchWithFilters.tsx
|
|
6594
6594
|
import { useState as useState13, useEffect as useEffect9 } from "react";
|
|
6595
|
-
import * as
|
|
6595
|
+
import * as React6 from "react";
|
|
6596
6596
|
import {
|
|
6597
6597
|
ArrowDropDown as ArrowDropDownIcon,
|
|
6598
6598
|
ArrowDropUp as ArrowDropUpIcon,
|
|
@@ -6689,7 +6689,7 @@ var SearchWithFilters = ({
|
|
|
6689
6689
|
)
|
|
6690
6690
|
] });
|
|
6691
6691
|
};
|
|
6692
|
-
var SearchWithFilters_default =
|
|
6692
|
+
var SearchWithFilters_default = React6.memo(SearchWithFilters);
|
|
6693
6693
|
|
|
6694
6694
|
// src/components/SearchAndFilterHeader/SearchAndFilterHeader.tsx
|
|
6695
6695
|
import { jsx as jsx109, jsxs as jsxs73 } from "react/jsx-runtime";
|
|
@@ -6752,7 +6752,7 @@ var SearchAndFilterHeader = ({
|
|
|
6752
6752
|
var SearchAndFilterHeader_default = SearchAndFilterHeader;
|
|
6753
6753
|
|
|
6754
6754
|
// src/components/SearchAndFilterHeader/SearchAndFilterHeaderForTable.tsx
|
|
6755
|
-
import * as
|
|
6755
|
+
import * as React7 from "react";
|
|
6756
6756
|
import { Box as Box32 } from "@mui/material";
|
|
6757
6757
|
import { makeStyles as makeStyles41 } from "tss-react/mui";
|
|
6758
6758
|
|
|
@@ -6936,7 +6936,7 @@ var SearchAndFilterHeaderForTable = (props) => {
|
|
|
6936
6936
|
/* @__PURE__ */ jsx111(Box32, { children: button })
|
|
6937
6937
|
] });
|
|
6938
6938
|
};
|
|
6939
|
-
var SearchAndFilterHeaderForTable_default =
|
|
6939
|
+
var SearchAndFilterHeaderForTable_default = React7.memo(SearchAndFilterHeaderForTable);
|
|
6940
6940
|
|
|
6941
6941
|
// src/components/SearchHeader/SearchHeader.tsx
|
|
6942
6942
|
import { memo as memo18 } from "react";
|
|
@@ -6976,7 +6976,7 @@ var SearchHeader = memo18(
|
|
|
6976
6976
|
|
|
6977
6977
|
// src/components/SectionName/SectionName.tsx
|
|
6978
6978
|
import { History as History2, Info as InfoIcon } from "@mui/icons-material";
|
|
6979
|
-
import { Box as Box34, Divider as Divider10, IconButton as IconButton4, Tooltip as
|
|
6979
|
+
import { Box as Box34, Divider as Divider10, IconButton as IconButton4, Tooltip as Tooltip9, Typography as Typography27 } from "@mui/material";
|
|
6980
6980
|
import { makeStyles as makeStyles42 } from "tss-react/mui";
|
|
6981
6981
|
import { jsx as jsx113, jsxs as jsxs77 } from "react/jsx-runtime";
|
|
6982
6982
|
var useStyles42 = makeStyles42()((theme) => ({
|
|
@@ -7033,7 +7033,7 @@ var SectionName = ({
|
|
|
7033
7033
|
children: name
|
|
7034
7034
|
}
|
|
7035
7035
|
),
|
|
7036
|
-
tooltipDescription ? /* @__PURE__ */ jsx113(
|
|
7036
|
+
tooltipDescription ? /* @__PURE__ */ jsx113(Tooltip9, { title: tooltipDescription, placement: "right", children: /* @__PURE__ */ jsx113(
|
|
7037
7037
|
InfoIcon,
|
|
7038
7038
|
{
|
|
7039
7039
|
fontSize: "small",
|
|
@@ -7063,123 +7063,18 @@ var SectionName = ({
|
|
|
7063
7063
|
};
|
|
7064
7064
|
var SectionName_default = SectionName;
|
|
7065
7065
|
|
|
7066
|
-
// src/components/
|
|
7067
|
-
import { useState as useState15 } from "react";
|
|
7066
|
+
// src/components/SmartSelect/SmartSelect.tsx
|
|
7067
|
+
import { forwardRef as forwardRef2, useState as useState15, useEffect as useEffect10 } from "react";
|
|
7068
7068
|
import {
|
|
7069
|
-
Box as Box35,
|
|
7070
|
-
Checkbox as Checkbox6,
|
|
7071
7069
|
CircularProgress as CircularProgress4,
|
|
7072
7070
|
FormControl as FormControl4,
|
|
7073
7071
|
FormHelperText as FormHelperText3,
|
|
7074
7072
|
InputLabel as InputLabel4,
|
|
7075
|
-
ListItemText as ListItemText5,
|
|
7076
|
-
Select as Select3,
|
|
7077
|
-
Typography as Typography28
|
|
7078
|
-
} from "@mui/material";
|
|
7079
|
-
import { jsx as jsx114, jsxs as jsxs78 } from "react/jsx-runtime";
|
|
7080
|
-
var SmartMultipleSelect = ({
|
|
7081
|
-
inputLabel,
|
|
7082
|
-
variant = "standard",
|
|
7083
|
-
size,
|
|
7084
|
-
values,
|
|
7085
|
-
defaultValues,
|
|
7086
|
-
onChange,
|
|
7087
|
-
onOpen,
|
|
7088
|
-
onClose,
|
|
7089
|
-
menuOptions,
|
|
7090
|
-
isLoading,
|
|
7091
|
-
disabled,
|
|
7092
|
-
emptyMessage = "No options.",
|
|
7093
|
-
helperText
|
|
7094
|
-
}) => {
|
|
7095
|
-
const [localValues, setLocalValues] = useState15(defaultValues ?? []);
|
|
7096
|
-
const handleChangeOption = (option) => {
|
|
7097
|
-
let newValues = [];
|
|
7098
|
-
const selectedIndex = localValues.findIndex(
|
|
7099
|
-
(val) => val.value === option.value
|
|
7100
|
-
);
|
|
7101
|
-
if (selectedIndex === -1) {
|
|
7102
|
-
newValues = [...localValues, option];
|
|
7103
|
-
} else {
|
|
7104
|
-
newValues = localValues.filter((_, i) => i !== selectedIndex);
|
|
7105
|
-
}
|
|
7106
|
-
setLocalValues(newValues);
|
|
7107
|
-
onChange?.(newValues);
|
|
7108
|
-
};
|
|
7109
|
-
const renderMenuContent = () => !menuOptions?.length ? /* @__PURE__ */ jsx114(
|
|
7110
|
-
Box35,
|
|
7111
|
-
{
|
|
7112
|
-
sx: { display: "flex", justifyContent: "center", alignItems: "center" },
|
|
7113
|
-
children: /* @__PURE__ */ jsx114(Typography28, { children: emptyMessage })
|
|
7114
|
-
}
|
|
7115
|
-
) : /* @__PURE__ */ jsx114(Box35, { sx: { display: "flex", flexDirection: "column" }, children: menuOptions?.map((option, index) => {
|
|
7116
|
-
const selectedValues = values ?? localValues ?? [];
|
|
7117
|
-
const isSelected = selectedValues.some(
|
|
7118
|
-
(selected) => selected.value === option.value
|
|
7119
|
-
);
|
|
7120
|
-
return /* @__PURE__ */ jsxs78(
|
|
7121
|
-
Box35,
|
|
7122
|
-
{
|
|
7123
|
-
onClick: () => handleChangeOption(option),
|
|
7124
|
-
sx: {
|
|
7125
|
-
p: 0.5,
|
|
7126
|
-
display: "flex",
|
|
7127
|
-
cursor: "pointer",
|
|
7128
|
-
backgroundColor: isSelected ? colors.lightBlueBackground : void 0
|
|
7129
|
-
},
|
|
7130
|
-
children: [
|
|
7131
|
-
/* @__PURE__ */ jsx114(Checkbox6, { disableRipple: true, sx: { py: 0.5 }, checked: isSelected }),
|
|
7132
|
-
/* @__PURE__ */ jsx114(ListItemText5, { primary: option.label })
|
|
7133
|
-
]
|
|
7134
|
-
},
|
|
7135
|
-
option.value ?? index
|
|
7136
|
-
);
|
|
7137
|
-
}) });
|
|
7138
|
-
return /* @__PURE__ */ jsxs78(FormControl4, { fullWidth: true, variant, children: [
|
|
7139
|
-
/* @__PURE__ */ jsx114(InputLabel4, { children: inputLabel }),
|
|
7140
|
-
/* @__PURE__ */ jsx114(
|
|
7141
|
-
Select3,
|
|
7142
|
-
{
|
|
7143
|
-
multiple: true,
|
|
7144
|
-
size,
|
|
7145
|
-
disabled,
|
|
7146
|
-
value: values ?? localValues,
|
|
7147
|
-
defaultValue: defaultValues,
|
|
7148
|
-
onOpen,
|
|
7149
|
-
onClose: () => onClose?.(localValues),
|
|
7150
|
-
renderValue: (selectedValues) => {
|
|
7151
|
-
const valuesString = selectedValues.map((v) => v.label)?.join(", ");
|
|
7152
|
-
return /* @__PURE__ */ jsx114(DynamicOverflowTooltip, { tooltipDescription: valuesString, children: valuesString });
|
|
7153
|
-
},
|
|
7154
|
-
children: isLoading ? /* @__PURE__ */ jsx114(
|
|
7155
|
-
Box35,
|
|
7156
|
-
{
|
|
7157
|
-
sx: {
|
|
7158
|
-
display: "flex",
|
|
7159
|
-
justifyContent: "center",
|
|
7160
|
-
alignItems: "center"
|
|
7161
|
-
},
|
|
7162
|
-
children: /* @__PURE__ */ jsx114(CircularProgress4, { size: 24 })
|
|
7163
|
-
}
|
|
7164
|
-
) : renderMenuContent()
|
|
7165
|
-
}
|
|
7166
|
-
),
|
|
7167
|
-
helperText && /* @__PURE__ */ jsx114(FormHelperText3, { children: helperText })
|
|
7168
|
-
] });
|
|
7169
|
-
};
|
|
7170
|
-
|
|
7171
|
-
// src/components/SmartSelect/SmartSelect.tsx
|
|
7172
|
-
import { forwardRef as forwardRef2, useState as useState16, useEffect as useEffect10 } from "react";
|
|
7173
|
-
import {
|
|
7174
|
-
CircularProgress as CircularProgress5,
|
|
7175
|
-
FormControl as FormControl5,
|
|
7176
|
-
FormHelperText as FormHelperText4,
|
|
7177
|
-
InputLabel as InputLabel5,
|
|
7178
7073
|
MenuItem as MenuItem3,
|
|
7179
|
-
Select as
|
|
7074
|
+
Select as Select3
|
|
7180
7075
|
} from "@mui/material";
|
|
7181
7076
|
import { makeStyles as makeStyles43 } from "tss-react/mui";
|
|
7182
|
-
import { jsx as
|
|
7077
|
+
import { jsx as jsx114, jsxs as jsxs78 } from "react/jsx-runtime";
|
|
7183
7078
|
var useStyles43 = makeStyles43()(() => ({
|
|
7184
7079
|
container: {
|
|
7185
7080
|
display: "flex",
|
|
@@ -7206,8 +7101,8 @@ var SmartSelect = forwardRef2(
|
|
|
7206
7101
|
menuProps
|
|
7207
7102
|
}, ref) => {
|
|
7208
7103
|
const { classes } = useStyles43();
|
|
7209
|
-
const [open, setOpen] =
|
|
7210
|
-
const [localOptions, setLocalOptions] =
|
|
7104
|
+
const [open, setOpen] = useState15(false);
|
|
7105
|
+
const [localOptions, setLocalOptions] = useState15(options || []);
|
|
7211
7106
|
useEffect10(() => {
|
|
7212
7107
|
if (options) {
|
|
7213
7108
|
setLocalOptions(options);
|
|
@@ -7247,8 +7142,8 @@ var SmartSelect = forwardRef2(
|
|
|
7247
7142
|
onChange(selectedOption);
|
|
7248
7143
|
}
|
|
7249
7144
|
};
|
|
7250
|
-
return /* @__PURE__ */
|
|
7251
|
-
|
|
7145
|
+
return /* @__PURE__ */ jsxs78(
|
|
7146
|
+
FormControl4,
|
|
7252
7147
|
{
|
|
7253
7148
|
fullWidth: true,
|
|
7254
7149
|
size,
|
|
@@ -7258,16 +7153,16 @@ var SmartSelect = forwardRef2(
|
|
|
7258
7153
|
"data-testid": dataTestId,
|
|
7259
7154
|
disabled,
|
|
7260
7155
|
children: [
|
|
7261
|
-
inputLabel && /* @__PURE__ */
|
|
7262
|
-
|
|
7156
|
+
inputLabel && /* @__PURE__ */ jsx114(
|
|
7157
|
+
InputLabel4,
|
|
7263
7158
|
{
|
|
7264
7159
|
id: "smart-select-label",
|
|
7265
7160
|
"data-testid": `${dataTestId}-label`,
|
|
7266
7161
|
children: inputLabel
|
|
7267
7162
|
}
|
|
7268
7163
|
),
|
|
7269
|
-
/* @__PURE__ */
|
|
7270
|
-
|
|
7164
|
+
/* @__PURE__ */ jsxs78(
|
|
7165
|
+
Select3,
|
|
7271
7166
|
{
|
|
7272
7167
|
ref,
|
|
7273
7168
|
size,
|
|
@@ -7284,17 +7179,17 @@ var SmartSelect = forwardRef2(
|
|
|
7284
7179
|
MenuProps: menuProps,
|
|
7285
7180
|
label: inputLabel,
|
|
7286
7181
|
children: [
|
|
7287
|
-
isFetching && /* @__PURE__ */
|
|
7182
|
+
isFetching && /* @__PURE__ */ jsx114(
|
|
7288
7183
|
MenuItem3,
|
|
7289
7184
|
{
|
|
7290
7185
|
disabled: true,
|
|
7291
7186
|
"data-testid": `${dataTestId}-loading`,
|
|
7292
7187
|
id: `${dataTestId}-loading`,
|
|
7293
|
-
children: /* @__PURE__ */
|
|
7188
|
+
children: /* @__PURE__ */ jsx114(CircularProgress4, { size: 24 })
|
|
7294
7189
|
}
|
|
7295
7190
|
),
|
|
7296
|
-
(defaultOption === null || !defaultOptionLabelIsValid || !defaultOptionValueIsValid) && !isFetching && options?.length === 0 && /* @__PURE__ */
|
|
7297
|
-
localOptions.length === 0 && !isFetching && options?.length !== 0 && defaultOptionLabelIsValid && defaultOptionValueIsValid && /* @__PURE__ */
|
|
7191
|
+
(defaultOption === null || !defaultOptionLabelIsValid || !defaultOptionValueIsValid) && !isFetching && options?.length === 0 && /* @__PURE__ */ jsx114(MenuItem3, { disabled: true, "data-testid": `${dataTestId}-empty-message`, children: emptyMessage }),
|
|
7192
|
+
localOptions.length === 0 && !isFetching && options?.length !== 0 && defaultOptionLabelIsValid && defaultOptionValueIsValid && /* @__PURE__ */ jsx114(
|
|
7298
7193
|
MenuItem3,
|
|
7299
7194
|
{
|
|
7300
7195
|
value: defaultOption?.value,
|
|
@@ -7302,7 +7197,7 @@ var SmartSelect = forwardRef2(
|
|
|
7302
7197
|
children: defaultOption?.label
|
|
7303
7198
|
}
|
|
7304
7199
|
),
|
|
7305
|
-
!isFetching && combinedOptions.length > 0 && combinedOptions.map((option) => /* @__PURE__ */
|
|
7200
|
+
!isFetching && combinedOptions.length > 0 && combinedOptions.map((option) => /* @__PURE__ */ jsx114(
|
|
7306
7201
|
MenuItem3,
|
|
7307
7202
|
{
|
|
7308
7203
|
value: option?.value,
|
|
@@ -7315,7 +7210,7 @@ var SmartSelect = forwardRef2(
|
|
|
7315
7210
|
]
|
|
7316
7211
|
}
|
|
7317
7212
|
),
|
|
7318
|
-
helperText && /* @__PURE__ */
|
|
7213
|
+
helperText && /* @__PURE__ */ jsx114(FormHelperText3, { "data-testid": `${dataTestId}-helper-text`, children: helperText })
|
|
7319
7214
|
]
|
|
7320
7215
|
}
|
|
7321
7216
|
);
|
|
@@ -7325,10 +7220,10 @@ var SmartSelect_default = SmartSelect;
|
|
|
7325
7220
|
|
|
7326
7221
|
// src/components/SquareLabel/SquareLabel.tsx
|
|
7327
7222
|
import { memo as memo19 } from "react";
|
|
7328
|
-
import { Typography as
|
|
7223
|
+
import { Typography as Typography28 } from "@mui/material";
|
|
7329
7224
|
import { red as red2 } from "@mui/material/colors";
|
|
7330
7225
|
import { makeStyles as makeStyles44 } from "tss-react/mui";
|
|
7331
|
-
import { jsx as
|
|
7226
|
+
import { jsx as jsx115 } from "react/jsx-runtime";
|
|
7332
7227
|
var useStyles44 = makeStyles44()((theme) => ({
|
|
7333
7228
|
red: {
|
|
7334
7229
|
backgroundColor: red2["50"],
|
|
@@ -7343,7 +7238,7 @@ var useStyles44 = makeStyles44()((theme) => ({
|
|
|
7343
7238
|
}));
|
|
7344
7239
|
var SquareLabel = ({ color, copy }) => {
|
|
7345
7240
|
const { classes } = useStyles44();
|
|
7346
|
-
return /* @__PURE__ */
|
|
7241
|
+
return /* @__PURE__ */ jsx115(Typography28, { className: classes[color], children: copy });
|
|
7347
7242
|
};
|
|
7348
7243
|
var SquareLabel_default = memo19(SquareLabel);
|
|
7349
7244
|
|
|
@@ -7351,7 +7246,7 @@ var SquareLabel_default = memo19(SquareLabel);
|
|
|
7351
7246
|
import { memo as memo20 } from "react";
|
|
7352
7247
|
import { Grid as Grid2, Switch } from "@mui/material";
|
|
7353
7248
|
import { withStyles as withStyles6 } from "tss-react/mui";
|
|
7354
|
-
import { jsx as
|
|
7249
|
+
import { jsx as jsx116, jsxs as jsxs79 } from "react/jsx-runtime";
|
|
7355
7250
|
var LSwitch = ({
|
|
7356
7251
|
checked,
|
|
7357
7252
|
labelOn,
|
|
@@ -7359,7 +7254,7 @@ var LSwitch = ({
|
|
|
7359
7254
|
handleChange,
|
|
7360
7255
|
classes,
|
|
7361
7256
|
disabled
|
|
7362
|
-
}) => /* @__PURE__ */
|
|
7257
|
+
}) => /* @__PURE__ */ jsx116("div", { className: classes.c_switch, children: /* @__PURE__ */ jsxs79(
|
|
7363
7258
|
Grid2,
|
|
7364
7259
|
{
|
|
7365
7260
|
component: "label",
|
|
@@ -7369,8 +7264,8 @@ var LSwitch = ({
|
|
|
7369
7264
|
alignItems: "center"
|
|
7370
7265
|
},
|
|
7371
7266
|
children: [
|
|
7372
|
-
labelOff && /* @__PURE__ */
|
|
7373
|
-
/* @__PURE__ */
|
|
7267
|
+
labelOff && /* @__PURE__ */ jsx116(Grid2, { children: labelOff }),
|
|
7268
|
+
/* @__PURE__ */ jsx116(Grid2, { children: /* @__PURE__ */ jsx116(
|
|
7374
7269
|
Switch,
|
|
7375
7270
|
{
|
|
7376
7271
|
checked,
|
|
@@ -7379,7 +7274,7 @@ var LSwitch = ({
|
|
|
7379
7274
|
disabled
|
|
7380
7275
|
}
|
|
7381
7276
|
) }),
|
|
7382
|
-
labelOn && /* @__PURE__ */
|
|
7277
|
+
labelOn && /* @__PURE__ */ jsx116(Grid2, { children: labelOn })
|
|
7383
7278
|
]
|
|
7384
7279
|
}
|
|
7385
7280
|
) });
|
|
@@ -7404,10 +7299,10 @@ var LabelledSwitch = withStyles6(LSwitch, (theme) => ({
|
|
|
7404
7299
|
var Switch_default = memo20(LabelledSwitch);
|
|
7405
7300
|
|
|
7406
7301
|
// src/components/SmartTableHeaderFilterMenu/SmartTableHeaderFilterMenu.tsx
|
|
7407
|
-
import { useState as
|
|
7302
|
+
import { useMemo as useMemo3, useState as useState16, useEffect as useEffect11, memo as memo21 } from "react";
|
|
7408
7303
|
import { Menu as Menu4 } from "@mui/material";
|
|
7409
7304
|
import classNames3 from "classnames";
|
|
7410
|
-
import { Fragment as Fragment13, jsx as
|
|
7305
|
+
import { Fragment as Fragment13, jsx as jsx117, jsxs as jsxs80 } from "react/jsx-runtime";
|
|
7411
7306
|
var MAX_WIDTH = 276;
|
|
7412
7307
|
var findFilterIndex = (filters, filterOption) => filters.findIndex((item) => {
|
|
7413
7308
|
if (typeof item === "string" && typeof filterOption === "string") {
|
|
@@ -7418,147 +7313,147 @@ var findFilterIndex = (filters, filterOption) => filters.findIndex((item) => {
|
|
|
7418
7313
|
}
|
|
7419
7314
|
return false;
|
|
7420
7315
|
});
|
|
7421
|
-
var SmartTableHeaderFilterMenu = (
|
|
7422
|
-
|
|
7423
|
-
|
|
7424
|
-
|
|
7425
|
-
|
|
7426
|
-
|
|
7427
|
-
|
|
7428
|
-
|
|
7429
|
-
|
|
7430
|
-
|
|
7431
|
-
|
|
7432
|
-
|
|
7433
|
-
|
|
7434
|
-
|
|
7435
|
-
} else if (headCell.filterType === "boolean") {
|
|
7436
|
-
setFilterOptionsData([
|
|
7437
|
-
{ id: "true", label: "Yes" },
|
|
7438
|
-
{ id: "false", label: "No" }
|
|
7439
|
-
]);
|
|
7440
|
-
}
|
|
7441
|
-
}, [headCell.filterOptions]);
|
|
7442
|
-
const handleFilterMenuOpen = (event) => {
|
|
7443
|
-
if (!numFilterOptions && headCell.filterType === "default") {
|
|
7444
|
-
headCell.refetchFilterOptions?.();
|
|
7445
|
-
}
|
|
7446
|
-
setAnchorEl(event.currentTarget);
|
|
7447
|
-
};
|
|
7448
|
-
const handleFilterMenuClose = () => {
|
|
7449
|
-
setSelectedFilterOptions(headerFilters[headCell.id]);
|
|
7450
|
-
setAnchorEl(null);
|
|
7451
|
-
};
|
|
7452
|
-
const handleSelectAllChange = (checked) => {
|
|
7453
|
-
if (checked) {
|
|
7454
|
-
setSelectedFilterOptions([
|
|
7455
|
-
...filterOptionsData ?? []
|
|
7456
|
-
]);
|
|
7457
|
-
return;
|
|
7458
|
-
}
|
|
7459
|
-
setSelectedFilterOptions([]);
|
|
7460
|
-
};
|
|
7461
|
-
const handleFilterOptionChange = (option) => {
|
|
7462
|
-
const selectedIndex = findFilterIndex(selectedFilterOptions, option);
|
|
7463
|
-
let newSelected;
|
|
7464
|
-
if (selectedIndex === -1) {
|
|
7465
|
-
if (typeof option === "string") {
|
|
7466
|
-
newSelected = [...selectedFilterOptions, option];
|
|
7467
|
-
} else {
|
|
7468
|
-
newSelected = [
|
|
7469
|
-
...selectedFilterOptions,
|
|
7470
|
-
option
|
|
7471
|
-
];
|
|
7316
|
+
var SmartTableHeaderFilterMenu = memo21(
|
|
7317
|
+
({
|
|
7318
|
+
headCell,
|
|
7319
|
+
numActiveFilters,
|
|
7320
|
+
headerFilters,
|
|
7321
|
+
shouldShowCheckOnFilter,
|
|
7322
|
+
onApplyFilters
|
|
7323
|
+
}) => {
|
|
7324
|
+
const [anchorEl, setAnchorEl] = useState16(null);
|
|
7325
|
+
const [filterOptionsData, setFilterOptionsData] = useState16();
|
|
7326
|
+
const [selectedFilterOptions, setSelectedFilterOptions] = useState16(headerFilters[headCell.id] ?? []);
|
|
7327
|
+
useEffect11(() => {
|
|
7328
|
+
if (headCell.filterOptions) {
|
|
7329
|
+
setFilterOptionsData(headCell.filterOptions);
|
|
7472
7330
|
}
|
|
7473
|
-
}
|
|
7474
|
-
|
|
7475
|
-
|
|
7476
|
-
|
|
7477
|
-
|
|
7478
|
-
|
|
7479
|
-
|
|
7480
|
-
|
|
7481
|
-
|
|
7482
|
-
|
|
7483
|
-
[headCell.id]: [...selectedFilterOptions]
|
|
7331
|
+
}, [headCell.filterOptions]);
|
|
7332
|
+
const numFilterOptions = useMemo3(
|
|
7333
|
+
() => filterOptionsData?.length ?? 0,
|
|
7334
|
+
[filterOptionsData?.length]
|
|
7335
|
+
);
|
|
7336
|
+
const handleFilterMenuOpen = (event) => {
|
|
7337
|
+
if (!numFilterOptions && !headCell.isAutocompleteFilterMenu) {
|
|
7338
|
+
headCell.refetchFilterOptions?.();
|
|
7339
|
+
}
|
|
7340
|
+
setAnchorEl(event.currentTarget);
|
|
7484
7341
|
};
|
|
7485
|
-
|
|
7486
|
-
|
|
7487
|
-
|
|
7488
|
-
|
|
7489
|
-
|
|
7490
|
-
|
|
7491
|
-
|
|
7492
|
-
|
|
7493
|
-
|
|
7494
|
-
|
|
7495
|
-
numActiveFilters,
|
|
7496
|
-
handleClick: handleFilterMenuOpen,
|
|
7497
|
-
className: classNames3("filter-menu-trigger", {
|
|
7498
|
-
"has-active-filters": !!numActiveFilters || !!anchorEl
|
|
7499
|
-
})
|
|
7342
|
+
const handleFilterMenuClose = () => {
|
|
7343
|
+
setSelectedFilterOptions(headerFilters[headCell.id]);
|
|
7344
|
+
setAnchorEl(null);
|
|
7345
|
+
};
|
|
7346
|
+
const handleSelectAllChange = (checked) => {
|
|
7347
|
+
if (checked) {
|
|
7348
|
+
setSelectedFilterOptions([
|
|
7349
|
+
...filterOptionsData ?? []
|
|
7350
|
+
]);
|
|
7351
|
+
return;
|
|
7500
7352
|
}
|
|
7501
|
-
|
|
7502
|
-
|
|
7503
|
-
|
|
7504
|
-
|
|
7505
|
-
|
|
7506
|
-
|
|
7507
|
-
|
|
7508
|
-
|
|
7509
|
-
|
|
7510
|
-
|
|
7511
|
-
|
|
7512
|
-
|
|
7513
|
-
|
|
7514
|
-
|
|
7515
|
-
|
|
7516
|
-
|
|
7517
|
-
|
|
7518
|
-
|
|
7519
|
-
columnId: headCell.id,
|
|
7520
|
-
labelFieldName: headCell.fieldName ?? "",
|
|
7521
|
-
isLoading: headCell.isFetchingFilterOptions,
|
|
7522
|
-
filterOptions: filterOptionsData,
|
|
7523
|
-
onAutocompleteSearch: headCell.onAutocompleteSearch,
|
|
7524
|
-
selectedFilterOptions,
|
|
7525
|
-
onFilterOptionChange: handleFilterOptionChange,
|
|
7526
|
-
onApplyFiltersClick: handleApplyFiltersClick,
|
|
7527
|
-
shouldShowCheckOnFilter
|
|
7528
|
-
}
|
|
7529
|
-
) : /* @__PURE__ */ jsx118(
|
|
7530
|
-
CheckboxFilterMenuContent,
|
|
7531
|
-
{
|
|
7532
|
-
columnId: headCell.id,
|
|
7533
|
-
labelFieldName: headCell.fieldName ?? "",
|
|
7534
|
-
isLoading: headCell.isFetchingFilterOptions,
|
|
7535
|
-
selectedFilterOptions,
|
|
7536
|
-
filterOptions: filterOptionsData ?? [],
|
|
7537
|
-
onSelectAllChange: handleSelectAllChange,
|
|
7538
|
-
onFilterOptionChange: handleFilterOptionChange,
|
|
7539
|
-
onApplyFiltersClick: handleApplyFiltersClick,
|
|
7540
|
-
shouldShowCheckOnFilter
|
|
7541
|
-
}
|
|
7542
|
-
)
|
|
7353
|
+
setSelectedFilterOptions([]);
|
|
7354
|
+
};
|
|
7355
|
+
const handleFilterOptionChange = (option) => {
|
|
7356
|
+
const selectedIndex = findFilterIndex(selectedFilterOptions, option);
|
|
7357
|
+
let newSelected;
|
|
7358
|
+
if (selectedIndex === -1) {
|
|
7359
|
+
if (typeof option === "string") {
|
|
7360
|
+
newSelected = [...selectedFilterOptions, option];
|
|
7361
|
+
} else {
|
|
7362
|
+
newSelected = [
|
|
7363
|
+
...selectedFilterOptions,
|
|
7364
|
+
option
|
|
7365
|
+
];
|
|
7366
|
+
}
|
|
7367
|
+
} else {
|
|
7368
|
+
newSelected = selectedFilterOptions.filter(
|
|
7369
|
+
(_, index) => index !== selectedIndex
|
|
7370
|
+
);
|
|
7543
7371
|
}
|
|
7544
|
-
|
|
7545
|
-
|
|
7546
|
-
|
|
7372
|
+
setSelectedFilterOptions(newSelected);
|
|
7373
|
+
};
|
|
7374
|
+
const handleApplyFiltersClick = (shouldSave) => {
|
|
7375
|
+
const updatedFilters = {
|
|
7376
|
+
...headerFilters,
|
|
7377
|
+
[headCell.id]: [...selectedFilterOptions]
|
|
7378
|
+
};
|
|
7379
|
+
onApplyFilters?.(updatedFilters, shouldSave);
|
|
7380
|
+
setAnchorEl(null);
|
|
7381
|
+
};
|
|
7382
|
+
useEffect11(() => {
|
|
7383
|
+
setSelectedFilterOptions(headerFilters[headCell.id] ?? []);
|
|
7384
|
+
}, [headerFilters, headCell.id]);
|
|
7385
|
+
return /* @__PURE__ */ jsxs80(Fragment13, { children: [
|
|
7386
|
+
/* @__PURE__ */ jsx117(
|
|
7387
|
+
ActiveFiltersIconButton,
|
|
7388
|
+
{
|
|
7389
|
+
numActiveFilters,
|
|
7390
|
+
handleClick: handleFilterMenuOpen,
|
|
7391
|
+
className: classNames3("filter-menu-trigger", {
|
|
7392
|
+
"has-active-filters": !!numActiveFilters || !!anchorEl
|
|
7393
|
+
})
|
|
7394
|
+
}
|
|
7395
|
+
),
|
|
7396
|
+
/* @__PURE__ */ jsx117(
|
|
7397
|
+
Menu4,
|
|
7398
|
+
{
|
|
7399
|
+
open: !!anchorEl,
|
|
7400
|
+
onClose: handleFilterMenuClose,
|
|
7401
|
+
anchorEl,
|
|
7402
|
+
"data-testid": "filter-menu",
|
|
7403
|
+
slotProps: {
|
|
7404
|
+
list: {
|
|
7405
|
+
sx: { p: 0, maxWidth: MAX_WIDTH }
|
|
7406
|
+
}
|
|
7407
|
+
},
|
|
7408
|
+
anchorOrigin: { vertical: "bottom", horizontal: "right" },
|
|
7409
|
+
transformOrigin: { vertical: "top", horizontal: "right" },
|
|
7410
|
+
children: headCell.isAutocompleteFilterMenu ? /* @__PURE__ */ jsx117(
|
|
7411
|
+
AutocompleteFilterMenuContent,
|
|
7412
|
+
{
|
|
7413
|
+
columnId: headCell.id,
|
|
7414
|
+
labelFieldName: headCell.fieldName ?? "",
|
|
7415
|
+
isLoading: headCell.isFetchingFilterOptions,
|
|
7416
|
+
filterOptions: headCell.filterOptions,
|
|
7417
|
+
onAutocompleteFilterChange: headCell.onAutocompleteFilterChange,
|
|
7418
|
+
selectedFilterOptions,
|
|
7419
|
+
onFilterOptionChange: handleFilterOptionChange,
|
|
7420
|
+
onApplyFiltersClick: handleApplyFiltersClick,
|
|
7421
|
+
shouldShowCheckOnFilter
|
|
7422
|
+
}
|
|
7423
|
+
) : /* @__PURE__ */ jsx117(
|
|
7424
|
+
CheckboxFilterMenuContent,
|
|
7425
|
+
{
|
|
7426
|
+
columnId: headCell.id,
|
|
7427
|
+
labelFieldName: headCell.fieldName ?? "",
|
|
7428
|
+
isLoading: headCell.isFetchingFilterOptions,
|
|
7429
|
+
selectedFilterOptions,
|
|
7430
|
+
filterOptions: filterOptionsData ?? [],
|
|
7431
|
+
onSelectAllChange: handleSelectAllChange,
|
|
7432
|
+
onFilterOptionChange: handleFilterOptionChange,
|
|
7433
|
+
onApplyFiltersClick: handleApplyFiltersClick,
|
|
7434
|
+
shouldShowCheckOnFilter
|
|
7435
|
+
}
|
|
7436
|
+
)
|
|
7437
|
+
}
|
|
7438
|
+
)
|
|
7439
|
+
] });
|
|
7440
|
+
}
|
|
7441
|
+
);
|
|
7547
7442
|
|
|
7548
7443
|
// src/components/SmartTableHeader/SmartTableHeader.tsx
|
|
7549
|
-
import { memo as
|
|
7444
|
+
import { memo as memo22 } from "react";
|
|
7550
7445
|
import {
|
|
7551
|
-
Box as
|
|
7552
|
-
Checkbox as
|
|
7446
|
+
Box as Box35,
|
|
7447
|
+
Checkbox as Checkbox6,
|
|
7553
7448
|
TableCell,
|
|
7554
7449
|
TableHead,
|
|
7555
7450
|
TableRow,
|
|
7556
7451
|
TableSortLabel,
|
|
7557
|
-
Tooltip as
|
|
7558
|
-
Typography as
|
|
7452
|
+
Tooltip as Tooltip10,
|
|
7453
|
+
Typography as Typography29
|
|
7559
7454
|
} from "@mui/material";
|
|
7560
|
-
import { jsx as
|
|
7561
|
-
var SmartTableHeader =
|
|
7455
|
+
import { jsx as jsx118, jsxs as jsxs81 } from "react/jsx-runtime";
|
|
7456
|
+
var SmartTableHeader = memo22(
|
|
7562
7457
|
({
|
|
7563
7458
|
order,
|
|
7564
7459
|
orderBy,
|
|
@@ -7576,25 +7471,18 @@ var SmartTableHeader = memo21(
|
|
|
7576
7471
|
onRequestSort(event, property);
|
|
7577
7472
|
};
|
|
7578
7473
|
const isSortActive = (headCellId) => orderBy === headCellId;
|
|
7579
|
-
return /* @__PURE__ */
|
|
7580
|
-
enableCheckboxSelection ? /* @__PURE__ */
|
|
7581
|
-
|
|
7474
|
+
return /* @__PURE__ */ jsx118(TableHead, { children: /* @__PURE__ */ jsxs81(TableRow, { children: [
|
|
7475
|
+
enableCheckboxSelection ? /* @__PURE__ */ jsx118(TableCell, { padding: "checkbox", children: /* @__PURE__ */ jsx118(
|
|
7476
|
+
Checkbox6,
|
|
7582
7477
|
{
|
|
7583
|
-
|
|
7584
|
-
|
|
7585
|
-
|
|
7586
|
-
|
|
7587
|
-
|
|
7588
|
-
color: "primary",
|
|
7589
|
-
disableRipple: true,
|
|
7590
|
-
indeterminate: numSelectedRows > 0 && numSelectedRows < numRows,
|
|
7591
|
-
checked: numRows > 0 && numSelectedRows === numRows,
|
|
7592
|
-
onChange: onSelectAllClick
|
|
7593
|
-
}
|
|
7594
|
-
)
|
|
7478
|
+
color: "primary",
|
|
7479
|
+
disableRipple: true,
|
|
7480
|
+
indeterminate: numSelectedRows > 0 && numSelectedRows < numRows,
|
|
7481
|
+
checked: numRows > 0 && numSelectedRows === numRows,
|
|
7482
|
+
onChange: onSelectAllClick
|
|
7595
7483
|
}
|
|
7596
|
-
) : null,
|
|
7597
|
-
headCells.map((headCell) => /* @__PURE__ */
|
|
7484
|
+
) }) : null,
|
|
7485
|
+
headCells.map((headCell) => /* @__PURE__ */ jsx118(
|
|
7598
7486
|
TableCell,
|
|
7599
7487
|
{
|
|
7600
7488
|
align: "left",
|
|
@@ -7618,14 +7506,22 @@ var SmartTableHeader = memo21(
|
|
|
7618
7506
|
}
|
|
7619
7507
|
}
|
|
7620
7508
|
},
|
|
7621
|
-
children: /* @__PURE__ */
|
|
7622
|
-
|
|
7509
|
+
children: /* @__PURE__ */ jsxs81(
|
|
7510
|
+
Box35,
|
|
7623
7511
|
{
|
|
7624
7512
|
display: "flex",
|
|
7625
7513
|
flexDirection: "row",
|
|
7626
7514
|
gap: headCell.disableSort ? 1 : 0,
|
|
7627
7515
|
children: [
|
|
7628
|
-
headCell.disableSort ? headCell.
|
|
7516
|
+
headCell.disableSort ? headCell.RenderHeader ?? /* @__PURE__ */ jsx118(Tooltip10, { title: headCell.labelTooltip ?? "", arrow: true, children: /* @__PURE__ */ jsx118(
|
|
7517
|
+
Typography29,
|
|
7518
|
+
{
|
|
7519
|
+
variant: "subtitle2",
|
|
7520
|
+
mt: 0.25,
|
|
7521
|
+
fontWeight: 600,
|
|
7522
|
+
children: headCell.label
|
|
7523
|
+
}
|
|
7524
|
+
) }) : /* @__PURE__ */ jsx118(Tooltip10, { title: headCell.labelTooltip ?? "", arrow: true, children: /* @__PURE__ */ jsxs81(
|
|
7629
7525
|
TableSortLabel,
|
|
7630
7526
|
{
|
|
7631
7527
|
"data-testid": "table-sort-label",
|
|
@@ -7633,8 +7529,8 @@ var SmartTableHeader = memo21(
|
|
|
7633
7529
|
direction: orderBy === headCell.id ? order : "asc",
|
|
7634
7530
|
onClick: createSortHandler(headCell.id),
|
|
7635
7531
|
children: [
|
|
7636
|
-
headCell.
|
|
7637
|
-
orderBy === headCell.id ? /* @__PURE__ */
|
|
7532
|
+
headCell.RenderHeader ?? headCell.label,
|
|
7533
|
+
orderBy === headCell.id ? /* @__PURE__ */ jsx118(
|
|
7638
7534
|
"span",
|
|
7639
7535
|
{
|
|
7640
7536
|
style: {
|
|
@@ -7654,7 +7550,7 @@ var SmartTableHeader = memo21(
|
|
|
7654
7550
|
]
|
|
7655
7551
|
}
|
|
7656
7552
|
) }),
|
|
7657
|
-
headCell.
|
|
7553
|
+
headCell.refetchFilterOptions ? /* @__PURE__ */ jsx118(
|
|
7658
7554
|
SmartTableHeaderFilterMenu,
|
|
7659
7555
|
{
|
|
7660
7556
|
headCell,
|
|
@@ -7676,9 +7572,9 @@ var SmartTableHeader = memo21(
|
|
|
7676
7572
|
|
|
7677
7573
|
// src/components/Table/Table.tsx
|
|
7678
7574
|
var import_debounce = __toESM(require_debounce(), 1);
|
|
7679
|
-
import { useLayoutEffect, useState as
|
|
7575
|
+
import { useLayoutEffect, useState as useState17 } from "react";
|
|
7680
7576
|
import {
|
|
7681
|
-
Box as
|
|
7577
|
+
Box as Box37,
|
|
7682
7578
|
Paper as Paper11,
|
|
7683
7579
|
Table as MUITable,
|
|
7684
7580
|
TableBody,
|
|
@@ -7692,12 +7588,12 @@ import { makeStyles as makeStyles45 } from "tss-react/mui";
|
|
|
7692
7588
|
import { v4 as uuidv4 } from "uuid";
|
|
7693
7589
|
|
|
7694
7590
|
// src/components/TableLoading/TableLoading.tsx
|
|
7695
|
-
import { Box as
|
|
7696
|
-
import { jsx as
|
|
7591
|
+
import { Box as Box36, Skeleton as Skeleton4 } from "@mui/material";
|
|
7592
|
+
import { jsx as jsx119 } from "react/jsx-runtime";
|
|
7697
7593
|
var TableLoading = ({
|
|
7698
7594
|
rowsPerPage,
|
|
7699
7595
|
rowHeight
|
|
7700
|
-
}) => /* @__PURE__ */
|
|
7596
|
+
}) => /* @__PURE__ */ jsx119(Box36, { children: Array.from({ length: rowsPerPage ?? 0 }).map((_, index) => /* @__PURE__ */ jsx119(
|
|
7701
7597
|
Skeleton4,
|
|
7702
7598
|
{
|
|
7703
7599
|
animation: "pulse",
|
|
@@ -7746,7 +7642,7 @@ function calculateRowsPerPage(rowHeight) {
|
|
|
7746
7642
|
}
|
|
7747
7643
|
|
|
7748
7644
|
// src/components/Table/Table.tsx
|
|
7749
|
-
import { jsx as
|
|
7645
|
+
import { jsx as jsx120, jsxs as jsxs82 } from "react/jsx-runtime";
|
|
7750
7646
|
var useStyles45 = makeStyles45()(() => ({
|
|
7751
7647
|
root: {
|
|
7752
7648
|
height: "calc(100vh - 262px)",
|
|
@@ -7781,11 +7677,11 @@ var Table = ({
|
|
|
7781
7677
|
serverRendered,
|
|
7782
7678
|
updateSort
|
|
7783
7679
|
}) => {
|
|
7784
|
-
const [order, setOrder] =
|
|
7785
|
-
const [orderBy, setOrderBy] =
|
|
7680
|
+
const [order, setOrder] = useState17(appliedFilters?.sortDir || "desc");
|
|
7681
|
+
const [orderBy, setOrderBy] = useState17(
|
|
7786
7682
|
appliedFilters?.sortField || "delivery_date"
|
|
7787
7683
|
);
|
|
7788
|
-
const [rowsPerPage, setRowsPerPage] =
|
|
7684
|
+
const [rowsPerPage, setRowsPerPage] = useState17(defaultRowsPerPage);
|
|
7789
7685
|
const { classes } = useStyles45();
|
|
7790
7686
|
const rowHeight = 56;
|
|
7791
7687
|
const emptyRows = rowsPerPage - Math.min(rowsPerPage, data.length - page * rowsPerPage);
|
|
@@ -7824,24 +7720,24 @@ var Table = ({
|
|
|
7824
7720
|
);
|
|
7825
7721
|
const rowsComponents = rows.map((row) => {
|
|
7826
7722
|
if (RenderItem) {
|
|
7827
|
-
return /* @__PURE__ */
|
|
7723
|
+
return /* @__PURE__ */ jsx120(RenderItem, { ...row }, row.id);
|
|
7828
7724
|
}
|
|
7829
|
-
return /* @__PURE__ */
|
|
7725
|
+
return /* @__PURE__ */ jsx120(TableRow2, { hover: true, onClick: () => onRowClick?.(row), children: headCells?.map((column) => /* @__PURE__ */ jsx120(TableCell2, { children: row[column.id] }, column.id)) }, row.id);
|
|
7830
7726
|
});
|
|
7831
7727
|
if (emptyRows > 0 && rowsPerPage > emptyRows) {
|
|
7832
7728
|
rowsComponents.push(
|
|
7833
|
-
/* @__PURE__ */
|
|
7729
|
+
/* @__PURE__ */ jsx120(TableRow2, { style: { height: rowHeight * emptyRows }, children: /* @__PURE__ */ jsx120(TableCell2, { colSpan: 8 }) }, uuidv4())
|
|
7834
7730
|
);
|
|
7835
7731
|
}
|
|
7836
7732
|
return rowsComponents;
|
|
7837
7733
|
};
|
|
7838
|
-
return /* @__PURE__ */
|
|
7839
|
-
/* @__PURE__ */
|
|
7734
|
+
return /* @__PURE__ */ jsx120(Paper11, { className: classes.root, children: /* @__PURE__ */ jsx120(Box37, { className: classes.paper, children: isLoading ? /* @__PURE__ */ jsx120(TableLoading_default, { rowHeight, rowsPerPage }) : /* @__PURE__ */ jsx120(TableContainer, { className: classes.container, children: /* @__PURE__ */ jsxs82(MUITable, { size: "medium", stickyHeader: true, children: [
|
|
7735
|
+
/* @__PURE__ */ jsx120(TableHead2, { className: classes.header, children: /* @__PURE__ */ jsx120(TableRow2, { children: headCells?.map((headCell) => /* @__PURE__ */ jsx120(
|
|
7840
7736
|
TableCell2,
|
|
7841
7737
|
{
|
|
7842
7738
|
align: "left",
|
|
7843
7739
|
sortDirection: orderBy === headCell.id ? order : void 0,
|
|
7844
|
-
children: /* @__PURE__ */
|
|
7740
|
+
children: /* @__PURE__ */ jsx120(
|
|
7845
7741
|
TableSortLabel2,
|
|
7846
7742
|
{
|
|
7847
7743
|
active: orderBy === headCell.id,
|
|
@@ -7853,9 +7749,9 @@ var Table = ({
|
|
|
7853
7749
|
},
|
|
7854
7750
|
headCell.id
|
|
7855
7751
|
)) }) }),
|
|
7856
|
-
/* @__PURE__ */
|
|
7752
|
+
/* @__PURE__ */ jsxs82(TableBody, { children: [
|
|
7857
7753
|
getTableRows(),
|
|
7858
|
-
rowsPerPage === emptyRows && /* @__PURE__ */
|
|
7754
|
+
rowsPerPage === emptyRows && /* @__PURE__ */ jsx120(TableRow2, { style: { height: rowHeight * emptyRows }, children: /* @__PURE__ */ jsx120(TableCell2, { colSpan: 8, align: "center", children: "Nothing to display" }) })
|
|
7859
7755
|
] })
|
|
7860
7756
|
] }) }) }) });
|
|
7861
7757
|
};
|
|
@@ -7863,23 +7759,23 @@ var Table_default = Table;
|
|
|
7863
7759
|
|
|
7864
7760
|
// src/components/TableDesktop/TableDesktop.tsx
|
|
7865
7761
|
import {
|
|
7866
|
-
useMemo as
|
|
7867
|
-
useState as
|
|
7762
|
+
useMemo as useMemo4,
|
|
7763
|
+
useState as useState18,
|
|
7868
7764
|
useEffect as useEffect12,
|
|
7869
7765
|
useRef as useRef7
|
|
7870
7766
|
} from "react";
|
|
7871
|
-
import { Paper as Paper12, Table as Table2, TableBody as TableBody3, TableContainer as TableContainer2, Box as
|
|
7767
|
+
import { Paper as Paper12, Table as Table2, TableBody as TableBody3, TableContainer as TableContainer2, Box as Box39 } from "@mui/material";
|
|
7872
7768
|
|
|
7873
7769
|
// src/components/TableDesktopLoadingState/TableDesktopLoadingState.tsx
|
|
7874
7770
|
import { Skeleton as Skeleton5, TableCell as TableCell3, TableRow as TableRow3 } from "@mui/material";
|
|
7875
|
-
import { jsx as
|
|
7771
|
+
import { jsx as jsx121 } from "react/jsx-runtime";
|
|
7876
7772
|
var getRange = (n) => Array.from({ length: n }, (_, i) => i + 1);
|
|
7877
7773
|
var TableDesktopLoadingState = ({
|
|
7878
7774
|
numRows,
|
|
7879
7775
|
numColumns,
|
|
7880
7776
|
rowHeight = 56
|
|
7881
7777
|
}) => {
|
|
7882
|
-
return getRange(numRows).map((rowNum) => /* @__PURE__ */
|
|
7778
|
+
return getRange(numRows).map((rowNum) => /* @__PURE__ */ jsx121(TableRow3, { children: getRange(numColumns).map((colNum) => /* @__PURE__ */ jsx121(TableCell3, { children: /* @__PURE__ */ jsx121(
|
|
7883
7779
|
Skeleton5,
|
|
7884
7780
|
{
|
|
7885
7781
|
animation: "pulse",
|
|
@@ -7895,13 +7791,13 @@ var TableDesktopLoadingState = ({
|
|
|
7895
7791
|
import TableBody2 from "@mui/material/TableBody";
|
|
7896
7792
|
import TableCell4 from "@mui/material/TableCell";
|
|
7897
7793
|
import TableRow4 from "@mui/material/TableRow";
|
|
7898
|
-
import
|
|
7794
|
+
import Typography30 from "@mui/material/Typography";
|
|
7899
7795
|
|
|
7900
7796
|
// src/components/Buttons/BaseButton/BaseIconButton.tsx
|
|
7901
7797
|
import { Button as Button16 } from "@mui/material";
|
|
7902
|
-
import { jsxs as
|
|
7798
|
+
import { jsxs as jsxs83 } from "react/jsx-runtime";
|
|
7903
7799
|
var BaseIconButton = ({ icon, sx, ...props }) => {
|
|
7904
|
-
return /* @__PURE__ */
|
|
7800
|
+
return /* @__PURE__ */ jsxs83(
|
|
7905
7801
|
Button16,
|
|
7906
7802
|
{
|
|
7907
7803
|
sx: {
|
|
@@ -7922,10 +7818,10 @@ var BaseIconButton = ({ icon, sx, ...props }) => {
|
|
|
7922
7818
|
};
|
|
7923
7819
|
|
|
7924
7820
|
// src/components/TableDesktopNoColumnsMessage/TableDesktopNoColumnsMessage.tsx
|
|
7925
|
-
import { jsx as
|
|
7821
|
+
import { jsx as jsx122, jsxs as jsxs84 } from "react/jsx-runtime";
|
|
7926
7822
|
var TableDesktopNoColumnsMessage = ({
|
|
7927
7823
|
onClickNoColumnsMessageOpenMenu
|
|
7928
|
-
}) => /* @__PURE__ */
|
|
7824
|
+
}) => /* @__PURE__ */ jsx122(TableBody2, { children: /* @__PURE__ */ jsx122(TableRow4, { children: /* @__PURE__ */ jsxs84(
|
|
7929
7825
|
TableCell4,
|
|
7930
7826
|
{
|
|
7931
7827
|
sx: {
|
|
@@ -7938,10 +7834,10 @@ var TableDesktopNoColumnsMessage = ({
|
|
|
7938
7834
|
alignItems: "center"
|
|
7939
7835
|
},
|
|
7940
7836
|
children: [
|
|
7941
|
-
/* @__PURE__ */
|
|
7942
|
-
/* @__PURE__ */
|
|
7943
|
-
/* @__PURE__ */
|
|
7944
|
-
|
|
7837
|
+
/* @__PURE__ */ jsx122(Typography30, { variant: "subtitle2", fontSize: 16, children: "Customise your view" }),
|
|
7838
|
+
/* @__PURE__ */ jsx122(Typography30, { variant: "subtitle1", align: "center", color: "textSecondary", children: "Open the menu to customise your table and search." }),
|
|
7839
|
+
/* @__PURE__ */ jsxs84(
|
|
7840
|
+
Typography30,
|
|
7945
7841
|
{
|
|
7946
7842
|
variant: "subtitle1",
|
|
7947
7843
|
align: "center",
|
|
@@ -7953,18 +7849,18 @@ var TableDesktopNoColumnsMessage = ({
|
|
|
7953
7849
|
},
|
|
7954
7850
|
children: [
|
|
7955
7851
|
"Tips: ",
|
|
7956
|
-
/* @__PURE__ */
|
|
7852
|
+
/* @__PURE__ */ jsx122(Typography30, { component: "strong", children: "Save as default" }),
|
|
7957
7853
|
" to keep these columns for future views"
|
|
7958
7854
|
]
|
|
7959
7855
|
}
|
|
7960
7856
|
),
|
|
7961
|
-
/* @__PURE__ */
|
|
7857
|
+
/* @__PURE__ */ jsx122(
|
|
7962
7858
|
BaseIconButton,
|
|
7963
7859
|
{
|
|
7964
7860
|
variant: "contained",
|
|
7965
7861
|
color: "primary",
|
|
7966
7862
|
onClick: onClickNoColumnsMessageOpenMenu,
|
|
7967
|
-
icon: /* @__PURE__ */
|
|
7863
|
+
icon: /* @__PURE__ */ jsx122(IconTableEdit_default, { fill: colors.white }),
|
|
7968
7864
|
children: "OPEN MENU"
|
|
7969
7865
|
}
|
|
7970
7866
|
)
|
|
@@ -7973,7 +7869,7 @@ var TableDesktopNoColumnsMessage = ({
|
|
|
7973
7869
|
) }) });
|
|
7974
7870
|
|
|
7975
7871
|
// src/components/TableDesktopRows/TableDesktopRows.tsx
|
|
7976
|
-
import { jsx as
|
|
7872
|
+
import { jsx as jsx123 } from "react/jsx-runtime";
|
|
7977
7873
|
var descendingComparator2 = (a, b, orderBy) => {
|
|
7978
7874
|
const objA = a[orderBy];
|
|
7979
7875
|
const objB = b[orderBy];
|
|
@@ -8019,7 +7915,7 @@ var TableDesktopRows = ({
|
|
|
8019
7915
|
const sortedData = disableInternalSort ? data : stableSort2(data, getComparator(order, orderBy));
|
|
8020
7916
|
return sortedData.map((row, index) => {
|
|
8021
7917
|
const isItemSelected = selectedRows.has(row[keyField]);
|
|
8022
|
-
return /* @__PURE__ */
|
|
7918
|
+
return /* @__PURE__ */ jsx123(
|
|
8023
7919
|
RenderItem,
|
|
8024
7920
|
{
|
|
8025
7921
|
...{
|
|
@@ -8041,8 +7937,8 @@ var TableDesktopRows = ({
|
|
|
8041
7937
|
};
|
|
8042
7938
|
|
|
8043
7939
|
// src/components/TableDesktopRowSelectionBar/TableDesktopRowSelectionBar.tsx
|
|
8044
|
-
import { Box as
|
|
8045
|
-
import { jsx as
|
|
7940
|
+
import { Box as Box38, Button as Button17, Typography as Typography31 } from "@mui/material";
|
|
7941
|
+
import { jsx as jsx124, jsxs as jsxs85 } from "react/jsx-runtime";
|
|
8046
7942
|
var TableDesktopRowSelectionBar = ({
|
|
8047
7943
|
isEveryRowInPageSelected,
|
|
8048
7944
|
isRowsFromAllPagesSelected,
|
|
@@ -8061,8 +7957,8 @@ var TableDesktopRowSelectionBar = ({
|
|
|
8061
7957
|
}
|
|
8062
7958
|
return `${numSelectedRows} row${numSelectedRows > 1 ? "s" : ""} selected.`;
|
|
8063
7959
|
};
|
|
8064
|
-
return isAnyRowSelected ? /* @__PURE__ */
|
|
8065
|
-
|
|
7960
|
+
return isAnyRowSelected ? /* @__PURE__ */ jsxs85(
|
|
7961
|
+
Box38,
|
|
8066
7962
|
{
|
|
8067
7963
|
sx: {
|
|
8068
7964
|
p: 1,
|
|
@@ -8074,22 +7970,22 @@ var TableDesktopRowSelectionBar = ({
|
|
|
8074
7970
|
backgroundColor: colors.neutral150
|
|
8075
7971
|
},
|
|
8076
7972
|
children: [
|
|
8077
|
-
/* @__PURE__ */
|
|
8078
|
-
!isRowsFromAllPagesSelected ? /* @__PURE__ */
|
|
7973
|
+
/* @__PURE__ */ jsx124(Typography31, { children: getSelectedRowsText() }),
|
|
7974
|
+
!isRowsFromAllPagesSelected ? /* @__PURE__ */ jsxs85(Button17, { onClick: onSelectRowsFromAllPagesClick, children: [
|
|
8079
7975
|
"Select all ",
|
|
8080
7976
|
totalRowCount,
|
|
8081
7977
|
" rows from all pages based on your filters"
|
|
8082
7978
|
] }) : null,
|
|
8083
|
-
/* @__PURE__ */
|
|
7979
|
+
/* @__PURE__ */ jsx124(Button17, { onClick: onClearSelectionClick, children: "Clear Selection" })
|
|
8084
7980
|
]
|
|
8085
7981
|
}
|
|
8086
7982
|
) : null;
|
|
8087
7983
|
};
|
|
8088
7984
|
|
|
8089
7985
|
// src/components/TableEmptyResult/TableEmptyResult.tsx
|
|
8090
|
-
import { TableCell as TableCell5, TableRow as TableRow5, Typography as
|
|
7986
|
+
import { TableCell as TableCell5, TableRow as TableRow5, Typography as Typography32 } from "@mui/material";
|
|
8091
7987
|
import { makeStyles as makeStyles46 } from "tss-react/mui";
|
|
8092
|
-
import { jsx as
|
|
7988
|
+
import { jsx as jsx125, jsxs as jsxs86 } from "react/jsx-runtime";
|
|
8093
7989
|
var useStyles46 = makeStyles46()(() => ({
|
|
8094
7990
|
tableCellIcon: { padding: 24, height: "calc(100vh - 320px)" },
|
|
8095
7991
|
tableCellDefault: { padding: 24 }
|
|
@@ -8101,17 +7997,17 @@ var TableEmptyResult = ({
|
|
|
8101
7997
|
}
|
|
8102
7998
|
}) => {
|
|
8103
7999
|
const { classes } = useStyles46();
|
|
8104
|
-
return showClearFilterButton ? /* @__PURE__ */
|
|
8000
|
+
return showClearFilterButton ? /* @__PURE__ */ jsx125(TableRow5, { children: /* @__PURE__ */ jsxs86(
|
|
8105
8001
|
TableCell5,
|
|
8106
8002
|
{
|
|
8107
8003
|
className: classes.tableCellIcon,
|
|
8108
8004
|
colSpan,
|
|
8109
8005
|
align: "center",
|
|
8110
8006
|
children: [
|
|
8111
|
-
/* @__PURE__ */
|
|
8112
|
-
/* @__PURE__ */
|
|
8113
|
-
/* @__PURE__ */
|
|
8114
|
-
/* @__PURE__ */
|
|
8007
|
+
/* @__PURE__ */ jsx125(EmptyGlassIcon_default, {}),
|
|
8008
|
+
/* @__PURE__ */ jsx125(Typography32, { variant: "h6", children: "No results found." }),
|
|
8009
|
+
/* @__PURE__ */ jsx125(Typography32, { variant: "subtitle1", children: "Search without applied filters?" }),
|
|
8010
|
+
/* @__PURE__ */ jsx125(
|
|
8115
8011
|
FilledButton_default,
|
|
8116
8012
|
{
|
|
8117
8013
|
copy: "Search",
|
|
@@ -8122,7 +8018,7 @@ var TableEmptyResult = ({
|
|
|
8122
8018
|
)
|
|
8123
8019
|
]
|
|
8124
8020
|
}
|
|
8125
|
-
) }) : /* @__PURE__ */
|
|
8021
|
+
) }) : /* @__PURE__ */ jsx125(TableRow5, { children: /* @__PURE__ */ jsx125(
|
|
8126
8022
|
TableCell5,
|
|
8127
8023
|
{
|
|
8128
8024
|
className: classes.tableCellDefault,
|
|
@@ -8135,7 +8031,7 @@ var TableEmptyResult = ({
|
|
|
8135
8031
|
var TableEmptyResult_default = TableEmptyResult;
|
|
8136
8032
|
|
|
8137
8033
|
// src/components/TableDesktop/TableDesktop.tsx
|
|
8138
|
-
import { Fragment as Fragment14, jsx as
|
|
8034
|
+
import { Fragment as Fragment14, jsx as jsx126, jsxs as jsxs87 } from "react/jsx-runtime";
|
|
8139
8035
|
var TableDesktop = ({
|
|
8140
8036
|
data = [],
|
|
8141
8037
|
headCells,
|
|
@@ -8163,23 +8059,23 @@ var TableDesktop = ({
|
|
|
8163
8059
|
refetchData
|
|
8164
8060
|
}) => {
|
|
8165
8061
|
const tableToolbarMenuButtonRef = useRef7(null);
|
|
8166
|
-
const [tableToolbarMenuAnchor, setTableToolbarMenuAnchor] =
|
|
8167
|
-
const [order, setOrder] =
|
|
8168
|
-
const [orderBy, setOrderBy] =
|
|
8062
|
+
const [tableToolbarMenuAnchor, setTableToolbarMenuAnchor] = useState18(null);
|
|
8063
|
+
const [order, setOrder] = useState18(appliedFilters?.sortDir || "desc");
|
|
8064
|
+
const [orderBy, setOrderBy] = useState18(
|
|
8169
8065
|
appliedFilters?.sortField || "delivery_date"
|
|
8170
8066
|
);
|
|
8171
|
-
const [selectedRows, setSelectedRows] =
|
|
8067
|
+
const [selectedRows, setSelectedRows] = useState18(
|
|
8172
8068
|
/* @__PURE__ */ new Set()
|
|
8173
8069
|
);
|
|
8174
|
-
const [isRowsFromAllPagesSelected, setIsRowsFromAllPagesSelected] =
|
|
8175
|
-
const [isBulkChangesMode, setIsBulkChangesMode] =
|
|
8070
|
+
const [isRowsFromAllPagesSelected, setIsRowsFromAllPagesSelected] = useState18(false);
|
|
8071
|
+
const [isBulkChangesMode, setIsBulkChangesMode] = useState18(false);
|
|
8176
8072
|
const numRows = data.length;
|
|
8177
|
-
const numSelectedRows =
|
|
8073
|
+
const numSelectedRows = useMemo4(() => {
|
|
8178
8074
|
const currentPageIds = new Set(data.map((row) => row[keyField]));
|
|
8179
8075
|
return [...selectedRows].filter((id) => currentPageIds.has(id)).length;
|
|
8180
8076
|
}, [data, selectedRows, keyField]);
|
|
8181
8077
|
const isEveryRowInPageSelected = numRows > 0 && numSelectedRows === numRows;
|
|
8182
|
-
const visibleHeadCells =
|
|
8078
|
+
const visibleHeadCells = useMemo4(
|
|
8183
8079
|
() => headCells.filter((headCell) => headCell?.enabled ?? true),
|
|
8184
8080
|
[headCells]
|
|
8185
8081
|
);
|
|
@@ -8250,7 +8146,7 @@ var TableDesktop = ({
|
|
|
8250
8146
|
}, [isRowsFromAllPagesSelected, data]);
|
|
8251
8147
|
const renderBody = () => {
|
|
8252
8148
|
if (isLoading) {
|
|
8253
|
-
return /* @__PURE__ */
|
|
8149
|
+
return /* @__PURE__ */ jsx126(
|
|
8254
8150
|
TableDesktopLoadingState,
|
|
8255
8151
|
{
|
|
8256
8152
|
numRows: Math.min(rowsPerPage, 10),
|
|
@@ -8260,7 +8156,7 @@ var TableDesktop = ({
|
|
|
8260
8156
|
);
|
|
8261
8157
|
}
|
|
8262
8158
|
if (numRows === 0) {
|
|
8263
|
-
return /* @__PURE__ */
|
|
8159
|
+
return /* @__PURE__ */ jsx126(
|
|
8264
8160
|
TableEmptyResult_default,
|
|
8265
8161
|
{
|
|
8266
8162
|
showClearFilterButton,
|
|
@@ -8269,7 +8165,7 @@ var TableDesktop = ({
|
|
|
8269
8165
|
}
|
|
8270
8166
|
);
|
|
8271
8167
|
}
|
|
8272
|
-
return /* @__PURE__ */
|
|
8168
|
+
return /* @__PURE__ */ jsx126(
|
|
8273
8169
|
TableDesktopRows,
|
|
8274
8170
|
{
|
|
8275
8171
|
data,
|
|
@@ -8288,8 +8184,8 @@ var TableDesktop = ({
|
|
|
8288
8184
|
}
|
|
8289
8185
|
);
|
|
8290
8186
|
};
|
|
8291
|
-
return /* @__PURE__ */
|
|
8292
|
-
|
|
8187
|
+
return /* @__PURE__ */ jsx126(
|
|
8188
|
+
Box39,
|
|
8293
8189
|
{
|
|
8294
8190
|
sx: {
|
|
8295
8191
|
height,
|
|
@@ -8297,7 +8193,7 @@ var TableDesktop = ({
|
|
|
8297
8193
|
justifyContent: "space-between",
|
|
8298
8194
|
justifyItems: "stretch"
|
|
8299
8195
|
},
|
|
8300
|
-
children: /* @__PURE__ */
|
|
8196
|
+
children: /* @__PURE__ */ jsxs87(
|
|
8301
8197
|
Paper12,
|
|
8302
8198
|
{
|
|
8303
8199
|
sx: {
|
|
@@ -8322,7 +8218,7 @@ var TableDesktop = ({
|
|
|
8322
8218
|
isBulkChangesMode,
|
|
8323
8219
|
onChangeBulkChangesMode: handleChangeBulkChangesMode
|
|
8324
8220
|
}) : null,
|
|
8325
|
-
/* @__PURE__ */
|
|
8221
|
+
/* @__PURE__ */ jsx126(
|
|
8326
8222
|
TableDesktopRowSelectionBar,
|
|
8327
8223
|
{
|
|
8328
8224
|
isEveryRowInPageSelected,
|
|
@@ -8333,7 +8229,7 @@ var TableDesktop = ({
|
|
|
8333
8229
|
onClearSelectionClick: handleClearSelectionClick
|
|
8334
8230
|
}
|
|
8335
8231
|
),
|
|
8336
|
-
/* @__PURE__ */
|
|
8232
|
+
/* @__PURE__ */ jsx126(
|
|
8337
8233
|
TableContainer2,
|
|
8338
8234
|
{
|
|
8339
8235
|
sx: {
|
|
@@ -8355,13 +8251,13 @@ var TableDesktop = ({
|
|
|
8355
8251
|
backgroundColor: (theme) => theme.palette.grey[500]
|
|
8356
8252
|
}
|
|
8357
8253
|
},
|
|
8358
|
-
children: /* @__PURE__ */
|
|
8254
|
+
children: /* @__PURE__ */ jsx126(Table2, { stickyHeader: true, "aria-label": "sticky-table", sx: { tableLayout }, children: visibleHeadCells.length === 0 ? /* @__PURE__ */ jsx126(
|
|
8359
8255
|
TableDesktopNoColumnsMessage,
|
|
8360
8256
|
{
|
|
8361
8257
|
onClickNoColumnsMessageOpenMenu: handleClickToolbarMenuOpen
|
|
8362
8258
|
}
|
|
8363
|
-
) : /* @__PURE__ */
|
|
8364
|
-
/* @__PURE__ */
|
|
8259
|
+
) : /* @__PURE__ */ jsxs87(Fragment14, { children: [
|
|
8260
|
+
/* @__PURE__ */ jsx126(
|
|
8365
8261
|
SmartTableHeader,
|
|
8366
8262
|
{
|
|
8367
8263
|
order,
|
|
@@ -8377,7 +8273,7 @@ var TableDesktop = ({
|
|
|
8377
8273
|
shouldShowCheckOnFilter
|
|
8378
8274
|
}
|
|
8379
8275
|
),
|
|
8380
|
-
/* @__PURE__ */
|
|
8276
|
+
/* @__PURE__ */ jsx126(TableBody3, { children: renderBody() })
|
|
8381
8277
|
] }) })
|
|
8382
8278
|
}
|
|
8383
8279
|
),
|
|
@@ -8394,141 +8290,99 @@ var TableDesktop = ({
|
|
|
8394
8290
|
};
|
|
8395
8291
|
|
|
8396
8292
|
// src/components/TableDesktopEditableField/TableDesktopEditableField.tsx
|
|
8397
|
-
import {
|
|
8398
|
-
import DeleteIcon from "@mui/icons-material/Delete";
|
|
8399
|
-
import { Checkbox as Checkbox8, FormControlLabel as FormControlLabel5 } from "@mui/material";
|
|
8400
|
-
import { DatePicker, TimePicker } from "@mui/x-date-pickers";
|
|
8401
|
-
import moment2 from "moment";
|
|
8402
|
-
|
|
8403
|
-
// src/components/TableDesktopEditableField/TableDesktopSmartMultipleSelect.tsx
|
|
8404
|
-
import { useMemo as useMemo4 } from "react";
|
|
8405
|
-
import { jsx as jsx128 } from "react/jsx-runtime";
|
|
8406
|
-
var TableDesktopSmartMultipleSelect = ({
|
|
8407
|
-
initialValue,
|
|
8408
|
-
inputLabel,
|
|
8409
|
-
columnId,
|
|
8410
|
-
fieldName,
|
|
8411
|
-
rowId,
|
|
8412
|
-
disabled,
|
|
8413
|
-
variant = "standard",
|
|
8414
|
-
size,
|
|
8415
|
-
filterOptions,
|
|
8416
|
-
refetchFilterOptions,
|
|
8417
|
-
isFetchingFilterOptions,
|
|
8418
|
-
onUpdateEditableCell
|
|
8419
|
-
}) => {
|
|
8420
|
-
const defaultValues = useMemo4(() => {
|
|
8421
|
-
return initialValue.map((val) => ({
|
|
8422
|
-
value: val.id,
|
|
8423
|
-
label: val[fieldName].toString()
|
|
8424
|
-
}));
|
|
8425
|
-
}, [initialValue]);
|
|
8426
|
-
return /* @__PURE__ */ jsx128(
|
|
8427
|
-
SmartMultipleSelect,
|
|
8428
|
-
{
|
|
8429
|
-
inputLabel,
|
|
8430
|
-
size,
|
|
8431
|
-
variant,
|
|
8432
|
-
disabled,
|
|
8433
|
-
defaultValues,
|
|
8434
|
-
menuOptions: filterOptions,
|
|
8435
|
-
isLoading: isFetchingFilterOptions,
|
|
8436
|
-
onOpen: () => {
|
|
8437
|
-
if (!filterOptions?.length) {
|
|
8438
|
-
refetchFilterOptions?.();
|
|
8439
|
-
}
|
|
8440
|
-
},
|
|
8441
|
-
onClose: (values) => {
|
|
8442
|
-
const optionsValues = values.map((option) => option.value ?? "");
|
|
8443
|
-
onUpdateEditableCell?.({
|
|
8444
|
-
rowId,
|
|
8445
|
-
columnId,
|
|
8446
|
-
value: optionsValues,
|
|
8447
|
-
label: optionsValues
|
|
8448
|
-
});
|
|
8449
|
-
}
|
|
8450
|
-
}
|
|
8451
|
-
);
|
|
8452
|
-
};
|
|
8293
|
+
import { Checkbox as Checkbox7, FormControlLabel as FormControlLabel5 } from "@mui/material";
|
|
8453
8294
|
|
|
8454
8295
|
// src/components/TableDesktopEditableField/TableDesktopSmartSelect.tsx
|
|
8455
|
-
import { useState as
|
|
8456
|
-
import { jsx as
|
|
8457
|
-
var TableDesktopSmartSelect = (
|
|
8458
|
-
|
|
8459
|
-
|
|
8460
|
-
|
|
8461
|
-
|
|
8462
|
-
|
|
8463
|
-
|
|
8464
|
-
|
|
8465
|
-
|
|
8466
|
-
|
|
8467
|
-
|
|
8468
|
-
|
|
8469
|
-
|
|
8470
|
-
|
|
8471
|
-
|
|
8472
|
-
}) => {
|
|
8473
|
-
|
|
8474
|
-
|
|
8475
|
-
|
|
8476
|
-
|
|
8477
|
-
|
|
8478
|
-
|
|
8479
|
-
|
|
8480
|
-
|
|
8481
|
-
|
|
8482
|
-
|
|
8483
|
-
|
|
8484
|
-
|
|
8485
|
-
|
|
8486
|
-
|
|
8487
|
-
|
|
8488
|
-
size,
|
|
8489
|
-
refetch: refetchFilterOptions,
|
|
8490
|
-
isFetching: isFetchingFilterOptions,
|
|
8491
|
-
defaultOption: {
|
|
8492
|
-
value: valueId ?? "",
|
|
8493
|
-
label: String(valueLabel ?? "")
|
|
8494
|
-
},
|
|
8495
|
-
onChange: ({ value: id, label }) => {
|
|
8496
|
-
setValue({ id: id ?? "", name: label ?? "" });
|
|
8497
|
-
onUpdateEditableCell?.({
|
|
8498
|
-
rowId,
|
|
8499
|
-
columnId,
|
|
8500
|
-
value: id || null,
|
|
8501
|
-
label: label ?? ""
|
|
8502
|
-
});
|
|
8296
|
+
import { useState as useState19, memo as memo23, useEffect as useEffect13 } from "react";
|
|
8297
|
+
import { jsx as jsx127 } from "react/jsx-runtime";
|
|
8298
|
+
var TableDesktopSmartSelect = memo23(
|
|
8299
|
+
({
|
|
8300
|
+
ref,
|
|
8301
|
+
initialValue,
|
|
8302
|
+
inputLabel,
|
|
8303
|
+
field,
|
|
8304
|
+
fieldName,
|
|
8305
|
+
rowId,
|
|
8306
|
+
disabled,
|
|
8307
|
+
variant = "standard",
|
|
8308
|
+
size,
|
|
8309
|
+
filterOptions,
|
|
8310
|
+
refetchFilterOptions,
|
|
8311
|
+
isFetchingFilterOptions,
|
|
8312
|
+
onUpdateEditableCell
|
|
8313
|
+
}) => {
|
|
8314
|
+
const [value, setValue] = useState19(
|
|
8315
|
+
initialValue
|
|
8316
|
+
);
|
|
8317
|
+
const [options, setOptions] = useState19();
|
|
8318
|
+
const valueId = resolveObjectType(value, "id");
|
|
8319
|
+
const valueLabel = resolveObjectType(value, fieldName);
|
|
8320
|
+
useEffect13(() => {
|
|
8321
|
+
if (filterOptions) {
|
|
8322
|
+
const parsedOptions = filterOptions?.map(
|
|
8323
|
+
(option) => ({
|
|
8324
|
+
value: resolveObjectType(option, "id"),
|
|
8325
|
+
label: String(resolveObjectType(option, fieldName))
|
|
8326
|
+
})
|
|
8327
|
+
);
|
|
8328
|
+
setOptions(parsedOptions);
|
|
8503
8329
|
}
|
|
8504
|
-
}
|
|
8505
|
-
|
|
8506
|
-
|
|
8330
|
+
}, [filterOptions]);
|
|
8331
|
+
return /* @__PURE__ */ jsx127(
|
|
8332
|
+
SmartSelect_default,
|
|
8333
|
+
{
|
|
8334
|
+
ref,
|
|
8335
|
+
value: valueId,
|
|
8336
|
+
inputLabel,
|
|
8337
|
+
options,
|
|
8338
|
+
disabled,
|
|
8339
|
+
variant,
|
|
8340
|
+
size,
|
|
8341
|
+
refetch: refetchFilterOptions,
|
|
8342
|
+
isFetching: isFetchingFilterOptions,
|
|
8343
|
+
defaultOption: {
|
|
8344
|
+
value: valueId ?? "",
|
|
8345
|
+
label: String(valueLabel ?? "")
|
|
8346
|
+
},
|
|
8347
|
+
onChange: ({ value: id, label: name }) => {
|
|
8348
|
+
if (!id || !name) {
|
|
8349
|
+
return;
|
|
8350
|
+
}
|
|
8351
|
+
setValue({ id, name });
|
|
8352
|
+
if (!onUpdateEditableCell) {
|
|
8353
|
+
return;
|
|
8354
|
+
}
|
|
8355
|
+
onUpdateEditableCell(rowId ?? 0, field, id, name);
|
|
8356
|
+
}
|
|
8357
|
+
}
|
|
8358
|
+
);
|
|
8359
|
+
}
|
|
8360
|
+
);
|
|
8507
8361
|
|
|
8508
8362
|
// src/components/TableDesktopEditableField/TableDesktopTextField.tsx
|
|
8509
|
-
import { useMemo as useMemo5, useState as
|
|
8363
|
+
import { useMemo as useMemo5, useState as useState20, useRef as useRef8 } from "react";
|
|
8510
8364
|
import { TextField as TextField8 } from "@mui/material";
|
|
8511
|
-
import { jsx as
|
|
8365
|
+
import { jsx as jsx128 } from "react/jsx-runtime";
|
|
8512
8366
|
var TableDesktopTextField = ({
|
|
8513
8367
|
rowId,
|
|
8514
8368
|
initialValue,
|
|
8515
8369
|
inputLabel,
|
|
8516
8370
|
disabled,
|
|
8517
|
-
|
|
8371
|
+
field,
|
|
8518
8372
|
type,
|
|
8519
8373
|
variant = "standard",
|
|
8520
8374
|
size,
|
|
8521
8375
|
validateInput,
|
|
8522
8376
|
onUpdateEditableCell
|
|
8523
8377
|
}) => {
|
|
8524
|
-
const [input, setInput] =
|
|
8378
|
+
const [input, setInput] = useState20(initialValue);
|
|
8525
8379
|
const oldValue = useRef8(initialValue);
|
|
8526
8380
|
const isDirty = useMemo5(
|
|
8527
8381
|
() => input !== oldValue.current,
|
|
8528
8382
|
[input, oldValue.current]
|
|
8529
8383
|
);
|
|
8530
8384
|
const hasValidationError = useMemo5(
|
|
8531
|
-
() => isDirty &&
|
|
8385
|
+
() => isDirty && !validateInput?.(input),
|
|
8532
8386
|
[input, validateInput]
|
|
8533
8387
|
);
|
|
8534
8388
|
const commitValue = (value) => {
|
|
@@ -8537,7 +8391,7 @@ var TableDesktopTextField = ({
|
|
|
8537
8391
|
return;
|
|
8538
8392
|
}
|
|
8539
8393
|
oldValue.current = value;
|
|
8540
|
-
onUpdateEditableCell(
|
|
8394
|
+
onUpdateEditableCell(rowId ?? 0, field, value, value);
|
|
8541
8395
|
};
|
|
8542
8396
|
const handleKeyDown = (e) => {
|
|
8543
8397
|
if (e.key === "Enter") {
|
|
@@ -8545,7 +8399,7 @@ var TableDesktopTextField = ({
|
|
|
8545
8399
|
commitValue(input);
|
|
8546
8400
|
}
|
|
8547
8401
|
};
|
|
8548
|
-
return /* @__PURE__ */
|
|
8402
|
+
return /* @__PURE__ */ jsx128(
|
|
8549
8403
|
TextField8,
|
|
8550
8404
|
{
|
|
8551
8405
|
fullWidth: true,
|
|
@@ -8568,9 +8422,6 @@ var TableDesktopTextField = ({
|
|
|
8568
8422
|
slotProps: {
|
|
8569
8423
|
input: {
|
|
8570
8424
|
inputMode: type === "numeric" ? "numeric" : void 0
|
|
8571
|
-
},
|
|
8572
|
-
htmlInput: {
|
|
8573
|
-
maxLength: 1e3
|
|
8574
8425
|
}
|
|
8575
8426
|
}
|
|
8576
8427
|
}
|
|
@@ -8578,98 +8429,63 @@ var TableDesktopTextField = ({
|
|
|
8578
8429
|
};
|
|
8579
8430
|
|
|
8580
8431
|
// src/components/TableDesktopEditableField/TableDesktopEditableField.tsx
|
|
8581
|
-
import { jsx as
|
|
8432
|
+
import { jsx as jsx129 } from "react/jsx-runtime";
|
|
8582
8433
|
var TableDesktopEditableField = ({
|
|
8583
8434
|
editInitialValue,
|
|
8584
8435
|
rowId,
|
|
8436
|
+
field,
|
|
8437
|
+
fieldName,
|
|
8585
8438
|
disabled,
|
|
8439
|
+
inputLabel,
|
|
8586
8440
|
showCheckboxLabel = false,
|
|
8587
8441
|
variant = "standard",
|
|
8588
8442
|
size,
|
|
8589
|
-
|
|
8590
|
-
|
|
8591
|
-
|
|
8592
|
-
|
|
8593
|
-
|
|
8594
|
-
|
|
8595
|
-
filterOptions,
|
|
8596
|
-
refetchFilterOptions,
|
|
8597
|
-
isFetchingFilterOptions,
|
|
8598
|
-
validateInput,
|
|
8599
|
-
allowBlankSelectOption
|
|
8600
|
-
}
|
|
8443
|
+
editableCellType,
|
|
8444
|
+
filterOptions,
|
|
8445
|
+
refetchFilterOptions,
|
|
8446
|
+
isFetchingFilterOptions,
|
|
8447
|
+
validateInput,
|
|
8448
|
+
onUpdateEditableCell
|
|
8601
8449
|
}) => {
|
|
8602
|
-
const [parsedFilterOptions, setParsedFilterOptions] = useState22();
|
|
8603
|
-
useEffect13(() => {
|
|
8604
|
-
if (filterOptions && editableCellType === "select" || editableCellType === "multipleSelect") {
|
|
8605
|
-
const parsedOptions = filterOptions?.map(
|
|
8606
|
-
(option) => ({
|
|
8607
|
-
value: resolveObjectType(option, "id"),
|
|
8608
|
-
label: String(resolveObjectType(option, fieldName))
|
|
8609
|
-
})
|
|
8610
|
-
);
|
|
8611
|
-
setParsedFilterOptions(parsedOptions);
|
|
8612
|
-
}
|
|
8613
|
-
}, [filterOptions, editableCellType]);
|
|
8614
8450
|
const editableComponents = {
|
|
8615
|
-
select: /* @__PURE__ */
|
|
8451
|
+
select: /* @__PURE__ */ jsx129(
|
|
8616
8452
|
TableDesktopSmartSelect,
|
|
8617
8453
|
{
|
|
8618
8454
|
rowId,
|
|
8619
|
-
|
|
8620
|
-
fieldName,
|
|
8621
|
-
disabled,
|
|
8622
|
-
variant,
|
|
8623
|
-
size,
|
|
8624
|
-
allowBlankOption: allowBlankSelectOption,
|
|
8625
|
-
initialValue: editInitialValue,
|
|
8626
|
-
inputLabel,
|
|
8627
|
-
filterOptions: parsedFilterOptions,
|
|
8628
|
-
refetchFilterOptions,
|
|
8629
|
-
isFetchingFilterOptions,
|
|
8630
|
-
onUpdateEditableCell
|
|
8631
|
-
}
|
|
8632
|
-
),
|
|
8633
|
-
multipleSelect: /* @__PURE__ */ jsx131(
|
|
8634
|
-
TableDesktopSmartMultipleSelect,
|
|
8635
|
-
{
|
|
8636
|
-
rowId,
|
|
8637
|
-
columnId,
|
|
8455
|
+
field,
|
|
8638
8456
|
fieldName,
|
|
8639
8457
|
disabled,
|
|
8640
8458
|
variant,
|
|
8641
8459
|
size,
|
|
8642
8460
|
initialValue: editInitialValue,
|
|
8643
8461
|
inputLabel,
|
|
8644
|
-
filterOptions
|
|
8462
|
+
filterOptions,
|
|
8645
8463
|
refetchFilterOptions,
|
|
8646
8464
|
isFetchingFilterOptions,
|
|
8647
8465
|
onUpdateEditableCell
|
|
8648
8466
|
}
|
|
8649
8467
|
),
|
|
8650
|
-
checkbox: /* @__PURE__ */
|
|
8468
|
+
checkbox: /* @__PURE__ */ jsx129(
|
|
8651
8469
|
FormControlLabel5,
|
|
8652
8470
|
{
|
|
8653
8471
|
label: showCheckboxLabel ? inputLabel : "",
|
|
8654
|
-
control: /* @__PURE__ */
|
|
8655
|
-
|
|
8472
|
+
control: /* @__PURE__ */ jsx129(
|
|
8473
|
+
Checkbox7,
|
|
8656
8474
|
{
|
|
8657
8475
|
disableRipple: true,
|
|
8658
8476
|
disabled,
|
|
8659
8477
|
defaultChecked: editInitialValue,
|
|
8660
8478
|
onChange: ({ target: { checked } }) => {
|
|
8661
|
-
onUpdateEditableCell
|
|
8662
|
-
|
|
8663
|
-
|
|
8664
|
-
|
|
8665
|
-
label: checked
|
|
8666
|
-
});
|
|
8479
|
+
if (!onUpdateEditableCell) {
|
|
8480
|
+
return;
|
|
8481
|
+
}
|
|
8482
|
+
onUpdateEditableCell(rowId ?? 0, field, checked, checked);
|
|
8667
8483
|
}
|
|
8668
8484
|
}
|
|
8669
8485
|
)
|
|
8670
8486
|
}
|
|
8671
8487
|
),
|
|
8672
|
-
text: /* @__PURE__ */
|
|
8488
|
+
text: /* @__PURE__ */ jsx129(
|
|
8673
8489
|
TableDesktopTextField,
|
|
8674
8490
|
{
|
|
8675
8491
|
type: "text",
|
|
@@ -8677,14 +8493,14 @@ var TableDesktopEditableField = ({
|
|
|
8677
8493
|
disabled,
|
|
8678
8494
|
variant,
|
|
8679
8495
|
size,
|
|
8680
|
-
|
|
8496
|
+
field,
|
|
8681
8497
|
initialValue: editInitialValue ?? "",
|
|
8682
8498
|
inputLabel: inputLabel ?? "",
|
|
8683
8499
|
validateInput,
|
|
8684
8500
|
onUpdateEditableCell
|
|
8685
8501
|
}
|
|
8686
8502
|
),
|
|
8687
|
-
numeric: /* @__PURE__ */
|
|
8503
|
+
numeric: /* @__PURE__ */ jsx129(
|
|
8688
8504
|
TableDesktopTextField,
|
|
8689
8505
|
{
|
|
8690
8506
|
type: "numeric",
|
|
@@ -8692,88 +8508,29 @@ var TableDesktopEditableField = ({
|
|
|
8692
8508
|
disabled,
|
|
8693
8509
|
variant,
|
|
8694
8510
|
size,
|
|
8695
|
-
|
|
8511
|
+
field,
|
|
8696
8512
|
initialValue: editInitialValue ?? "",
|
|
8697
8513
|
inputLabel: inputLabel ?? "",
|
|
8698
8514
|
validateInput,
|
|
8699
8515
|
onUpdateEditableCell
|
|
8700
8516
|
}
|
|
8701
|
-
),
|
|
8702
|
-
date: /* @__PURE__ */ jsx131(
|
|
8703
|
-
DatePicker,
|
|
8704
|
-
{
|
|
8705
|
-
defaultValue: moment2(editInitialValue),
|
|
8706
|
-
label: inputLabel,
|
|
8707
|
-
format: "DD/MM/YYYY",
|
|
8708
|
-
sx: { overflowY: "hidden" },
|
|
8709
|
-
onAccept: (value) => {
|
|
8710
|
-
const formattedValue = value?.format("YYYY-MM-DD") ?? null;
|
|
8711
|
-
const formattedLabel = value?.format("DD/MM/YYYY") ?? null;
|
|
8712
|
-
onUpdateEditableCell?.({
|
|
8713
|
-
rowId,
|
|
8714
|
-
columnId,
|
|
8715
|
-
value: formattedValue,
|
|
8716
|
-
label: formattedLabel
|
|
8717
|
-
});
|
|
8718
|
-
},
|
|
8719
|
-
slots: { clearIcon: DeleteIcon },
|
|
8720
|
-
slotProps: {
|
|
8721
|
-
field: { clearable: true },
|
|
8722
|
-
clearButton: { sx: { p: 0.5 } },
|
|
8723
|
-
openPickerButton: { sx: { p: 0 } },
|
|
8724
|
-
textField: {
|
|
8725
|
-
variant: "standard",
|
|
8726
|
-
error: false
|
|
8727
|
-
}
|
|
8728
|
-
}
|
|
8729
|
-
}
|
|
8730
|
-
),
|
|
8731
|
-
time: /* @__PURE__ */ jsx131(
|
|
8732
|
-
TimePicker,
|
|
8733
|
-
{
|
|
8734
|
-
defaultValue: moment2(editInitialValue, "HH:mm:ss"),
|
|
8735
|
-
label: inputLabel,
|
|
8736
|
-
sx: { overflowY: "hidden" },
|
|
8737
|
-
onAccept: (value) => {
|
|
8738
|
-
const formattedValue = value?.format("HH:mm") ?? null;
|
|
8739
|
-
onUpdateEditableCell?.({
|
|
8740
|
-
rowId,
|
|
8741
|
-
columnId,
|
|
8742
|
-
value: formattedValue,
|
|
8743
|
-
label: formattedValue
|
|
8744
|
-
});
|
|
8745
|
-
},
|
|
8746
|
-
slots: { clearIcon: DeleteIcon },
|
|
8747
|
-
slotProps: {
|
|
8748
|
-
field: { clearable: true },
|
|
8749
|
-
clearButton: { sx: { p: 0.5 } },
|
|
8750
|
-
openPickerButton: { sx: { p: 0 } },
|
|
8751
|
-
textField: {
|
|
8752
|
-
variant: "standard",
|
|
8753
|
-
error: false
|
|
8754
|
-
}
|
|
8755
|
-
}
|
|
8756
|
-
}
|
|
8757
8517
|
)
|
|
8758
8518
|
};
|
|
8759
|
-
if (!editableCellType) {
|
|
8760
|
-
return null;
|
|
8761
|
-
}
|
|
8762
8519
|
return editableComponents[editableCellType];
|
|
8763
8520
|
};
|
|
8764
8521
|
|
|
8765
8522
|
// src/components/TableDesktopFooter/TableDesktopFooter.tsx
|
|
8766
8523
|
import Refresh3 from "@mui/icons-material/Refresh";
|
|
8767
8524
|
import {
|
|
8768
|
-
Box as
|
|
8525
|
+
Box as Box40,
|
|
8769
8526
|
Button as Button18,
|
|
8770
8527
|
MenuItem as MenuItem4,
|
|
8771
8528
|
Pagination as Pagination2,
|
|
8772
|
-
Select as
|
|
8529
|
+
Select as Select4,
|
|
8773
8530
|
Stack,
|
|
8774
|
-
Typography as
|
|
8531
|
+
Typography as Typography33
|
|
8775
8532
|
} from "@mui/material";
|
|
8776
|
-
import { jsx as
|
|
8533
|
+
import { jsx as jsx130, jsxs as jsxs88 } from "react/jsx-runtime";
|
|
8777
8534
|
var TableDesktopFooter = ({
|
|
8778
8535
|
numPages,
|
|
8779
8536
|
page,
|
|
@@ -8784,8 +8541,8 @@ var TableDesktopFooter = ({
|
|
|
8784
8541
|
refetchData,
|
|
8785
8542
|
isFetching
|
|
8786
8543
|
}) => {
|
|
8787
|
-
return /* @__PURE__ */
|
|
8788
|
-
|
|
8544
|
+
return /* @__PURE__ */ jsxs88(
|
|
8545
|
+
Box40,
|
|
8789
8546
|
{
|
|
8790
8547
|
sx: {
|
|
8791
8548
|
py: 1,
|
|
@@ -8796,7 +8553,7 @@ var TableDesktopFooter = ({
|
|
|
8796
8553
|
borderTop: `1px solid ${colors.neutral300}`
|
|
8797
8554
|
},
|
|
8798
8555
|
children: [
|
|
8799
|
-
refetchData ? /* @__PURE__ */
|
|
8556
|
+
refetchData ? /* @__PURE__ */ jsxs88(
|
|
8800
8557
|
Button18,
|
|
8801
8558
|
{
|
|
8802
8559
|
disableRipple: true,
|
|
@@ -8811,7 +8568,7 @@ var TableDesktopFooter = ({
|
|
|
8811
8568
|
borderColor: colors.neutral600
|
|
8812
8569
|
},
|
|
8813
8570
|
children: [
|
|
8814
|
-
/* @__PURE__ */
|
|
8571
|
+
/* @__PURE__ */ jsx130(
|
|
8815
8572
|
Refresh3,
|
|
8816
8573
|
{
|
|
8817
8574
|
fontSize: "small",
|
|
@@ -8822,21 +8579,21 @@ var TableDesktopFooter = ({
|
|
|
8822
8579
|
]
|
|
8823
8580
|
}
|
|
8824
8581
|
) : null,
|
|
8825
|
-
/* @__PURE__ */
|
|
8826
|
-
pageSize && pageSizeOptions && onPageSizeChange ? /* @__PURE__ */
|
|
8827
|
-
/* @__PURE__ */
|
|
8828
|
-
/* @__PURE__ */
|
|
8829
|
-
|
|
8582
|
+
/* @__PURE__ */ jsxs88(Box40, { sx: { display: "flex", ml: "auto", py: 1 }, children: [
|
|
8583
|
+
pageSize && pageSizeOptions && onPageSizeChange ? /* @__PURE__ */ jsxs88(Stack, { direction: "row", spacing: 2, alignItems: "center", children: [
|
|
8584
|
+
/* @__PURE__ */ jsx130(Typography33, { children: "Rows per page:" }),
|
|
8585
|
+
/* @__PURE__ */ jsx130(
|
|
8586
|
+
Select4,
|
|
8830
8587
|
{
|
|
8831
8588
|
value: pageSize,
|
|
8832
8589
|
onChange: onPageSizeChange,
|
|
8833
8590
|
size: "small",
|
|
8834
8591
|
variant: "standard",
|
|
8835
|
-
children: pageSizeOptions.map((pageSizeOption) => /* @__PURE__ */
|
|
8592
|
+
children: pageSizeOptions.map((pageSizeOption) => /* @__PURE__ */ jsx130(MenuItem4, { value: pageSizeOption, children: pageSizeOption }, pageSizeOption))
|
|
8836
8593
|
}
|
|
8837
8594
|
)
|
|
8838
8595
|
] }) : null,
|
|
8839
|
-
/* @__PURE__ */
|
|
8596
|
+
/* @__PURE__ */ jsx130(
|
|
8840
8597
|
Pagination2,
|
|
8841
8598
|
{
|
|
8842
8599
|
color: "standard",
|
|
@@ -8852,15 +8609,15 @@ var TableDesktopFooter = ({
|
|
|
8852
8609
|
};
|
|
8853
8610
|
|
|
8854
8611
|
// src/components/TableDesktopCell/TableDesktopCell.tsx
|
|
8855
|
-
import { useEffect as useEffect14, useState as
|
|
8612
|
+
import { useEffect as useEffect14, useState as useState21 } from "react";
|
|
8856
8613
|
import CheckIcon3 from "@mui/icons-material/Check";
|
|
8857
8614
|
import CloseIcon from "@mui/icons-material/Close";
|
|
8858
8615
|
import EditIcon from "@mui/icons-material/Edit";
|
|
8859
|
-
import { IconButton as IconButton5, TableCell as TableCell6, Tooltip as
|
|
8860
|
-
import { Fragment as Fragment15, jsx as
|
|
8616
|
+
import { IconButton as IconButton5, TableCell as TableCell6, Tooltip as Tooltip11 } from "@mui/material";
|
|
8617
|
+
import { Fragment as Fragment15, jsx as jsx131, jsxs as jsxs89 } from "react/jsx-runtime";
|
|
8861
8618
|
var getReadOnlyBooleanIcon = (value) => {
|
|
8862
8619
|
if (value) {
|
|
8863
|
-
return /* @__PURE__ */
|
|
8620
|
+
return /* @__PURE__ */ jsx131(CheckIcon3, { sx: { fontSize: 16 } });
|
|
8864
8621
|
}
|
|
8865
8622
|
return "-";
|
|
8866
8623
|
};
|
|
@@ -8874,17 +8631,25 @@ var getCellBackgroundColor = (isCellInEditMode) => ({
|
|
|
8874
8631
|
background: isCellInEditMode ? colors.lightBlueBackground : colors.neutral100
|
|
8875
8632
|
});
|
|
8876
8633
|
var TableDesktopCell = ({
|
|
8634
|
+
inputLabel,
|
|
8877
8635
|
editInitialValue,
|
|
8878
8636
|
rowId,
|
|
8879
|
-
|
|
8637
|
+
field,
|
|
8638
|
+
fieldName,
|
|
8639
|
+
width,
|
|
8880
8640
|
enableEditMode,
|
|
8641
|
+
disabled,
|
|
8881
8642
|
readOnlyValue,
|
|
8882
|
-
|
|
8883
|
-
|
|
8643
|
+
editableCellType,
|
|
8644
|
+
filterOptions,
|
|
8645
|
+
refetchFilterOptions,
|
|
8646
|
+
isFetchingFilterOptions,
|
|
8647
|
+
validateInput,
|
|
8648
|
+
onUpdateEditableCell,
|
|
8649
|
+
onCellClick
|
|
8884
8650
|
}) => {
|
|
8885
|
-
const [isCellHovered, setIsCellHovered] =
|
|
8886
|
-
const [isCellInEditMode, setIsCellInEditMode] =
|
|
8887
|
-
const { width, editableCellType } = headCell;
|
|
8651
|
+
const [isCellHovered, setIsCellHovered] = useState21(false);
|
|
8652
|
+
const [isCellInEditMode, setIsCellInEditMode] = useState21(false);
|
|
8888
8653
|
useEffect14(() => {
|
|
8889
8654
|
const handleKeyDown = (e) => {
|
|
8890
8655
|
if (e.key === "Escape") {
|
|
@@ -8892,10 +8657,10 @@ var TableDesktopCell = ({
|
|
|
8892
8657
|
}
|
|
8893
8658
|
};
|
|
8894
8659
|
if (isCellInEditMode) {
|
|
8895
|
-
|
|
8660
|
+
window.addEventListener("keydown", handleKeyDown);
|
|
8896
8661
|
}
|
|
8897
8662
|
return () => {
|
|
8898
|
-
|
|
8663
|
+
window.removeEventListener("keydown", handleKeyDown);
|
|
8899
8664
|
};
|
|
8900
8665
|
}, [isCellInEditMode]);
|
|
8901
8666
|
const handleEditClick = (e) => {
|
|
@@ -8903,7 +8668,7 @@ var TableDesktopCell = ({
|
|
|
8903
8668
|
setIsCellInEditMode((prev) => !prev);
|
|
8904
8669
|
};
|
|
8905
8670
|
const isCellEditable = !!enableEditMode && !!editableCellType && !disabled;
|
|
8906
|
-
return /* @__PURE__ */
|
|
8671
|
+
return /* @__PURE__ */ jsx131(
|
|
8907
8672
|
TableCell6,
|
|
8908
8673
|
{
|
|
8909
8674
|
align: "left",
|
|
@@ -8915,11 +8680,12 @@ var TableDesktopCell = ({
|
|
|
8915
8680
|
width: width ?? "auto",
|
|
8916
8681
|
position: "relative",
|
|
8917
8682
|
cursor: disabled || !enableEditMode ? "default" : "pointer",
|
|
8683
|
+
opacity: disabled ? 0.2 : 1,
|
|
8918
8684
|
":hover": isCellEditable ? getCellBackgroundColor(isCellInEditMode) : void 0,
|
|
8919
8685
|
background: enableEditMode && isCellInEditMode ? colors.lightBlueBackground : void 0
|
|
8920
8686
|
},
|
|
8921
|
-
children: /* @__PURE__ */
|
|
8922
|
-
enableEditMode && isCellHovered ? /* @__PURE__ */
|
|
8687
|
+
children: /* @__PURE__ */ jsx131(DynamicOverflowTooltip, { tooltipDescription: String(readOnlyValue), arrow: true, children: /* @__PURE__ */ jsxs89(Fragment15, { children: [
|
|
8688
|
+
enableEditMode && isCellHovered ? /* @__PURE__ */ jsx131(Tooltip11, { title: isCellInEditMode ? "" : "Toggle Edit Mode", children: /* @__PURE__ */ jsx131(
|
|
8923
8689
|
IconButton5,
|
|
8924
8690
|
{
|
|
8925
8691
|
onClick: handleEditClick,
|
|
@@ -8934,17 +8700,24 @@ var TableDesktopCell = ({
|
|
|
8934
8700
|
backgroundColor: isCellInEditMode ? colors.lightBlueBackground : colors.neutral150
|
|
8935
8701
|
}
|
|
8936
8702
|
},
|
|
8937
|
-
children: isCellInEditMode ? /* @__PURE__ */
|
|
8703
|
+
children: isCellInEditMode ? /* @__PURE__ */ jsx131(CloseIcon, { fontSize: "small", color: "error" }) : /* @__PURE__ */ jsx131(EditIcon, { fontSize: "small" })
|
|
8938
8704
|
}
|
|
8939
8705
|
) }) : null,
|
|
8940
|
-
enableEditMode && isCellInEditMode && editableCellType ? /* @__PURE__ */
|
|
8706
|
+
enableEditMode && isCellInEditMode && editableCellType ? /* @__PURE__ */ jsx131(
|
|
8941
8707
|
TableDesktopEditableField,
|
|
8942
8708
|
{
|
|
8943
8709
|
editInitialValue,
|
|
8944
8710
|
rowId,
|
|
8711
|
+
field,
|
|
8712
|
+
fieldName,
|
|
8945
8713
|
disabled,
|
|
8946
|
-
|
|
8947
|
-
|
|
8714
|
+
inputLabel: inputLabel ?? "",
|
|
8715
|
+
editableCellType,
|
|
8716
|
+
filterOptions,
|
|
8717
|
+
refetchFilterOptions,
|
|
8718
|
+
isFetchingFilterOptions,
|
|
8719
|
+
validateInput,
|
|
8720
|
+
onUpdateEditableCell
|
|
8948
8721
|
}
|
|
8949
8722
|
) : renderReadOnlyValue(readOnlyValue)
|
|
8950
8723
|
] }) })
|
|
@@ -8954,7 +8727,7 @@ var TableDesktopCell = ({
|
|
|
8954
8727
|
|
|
8955
8728
|
// src/components/TableDesktopToolbar/TableDesktopToolbar.tsx
|
|
8956
8729
|
import {
|
|
8957
|
-
useState as
|
|
8730
|
+
useState as useState22,
|
|
8958
8731
|
useMemo as useMemo6,
|
|
8959
8732
|
useRef as useRef9
|
|
8960
8733
|
} from "react";
|
|
@@ -8962,16 +8735,16 @@ import Download from "@mui/icons-material/Download";
|
|
|
8962
8735
|
import KeyboardArrowLeft2 from "@mui/icons-material/KeyboardArrowLeft";
|
|
8963
8736
|
import KeyboardArrowRight2 from "@mui/icons-material/KeyboardArrowRight";
|
|
8964
8737
|
import {
|
|
8965
|
-
Box as
|
|
8738
|
+
Box as Box41,
|
|
8966
8739
|
Button as Button19,
|
|
8967
8740
|
Divider as Divider11,
|
|
8968
8741
|
FormControlLabel as FormControlLabel6,
|
|
8969
8742
|
IconButton as IconButton6,
|
|
8970
8743
|
Switch as Switch2,
|
|
8971
|
-
Tooltip as
|
|
8972
|
-
Typography as
|
|
8744
|
+
Tooltip as Tooltip12,
|
|
8745
|
+
Typography as Typography34
|
|
8973
8746
|
} from "@mui/material";
|
|
8974
|
-
import { Fragment as Fragment16, jsx as
|
|
8747
|
+
import { Fragment as Fragment16, jsx as jsx132, jsxs as jsxs90 } from "react/jsx-runtime";
|
|
8975
8748
|
var TableDesktopToolbar = ({
|
|
8976
8749
|
toolbarLabel,
|
|
8977
8750
|
headCells,
|
|
@@ -8994,10 +8767,10 @@ var TableDesktopToolbar = ({
|
|
|
8994
8767
|
renderInfoIcons
|
|
8995
8768
|
}) => {
|
|
8996
8769
|
const scrollRef = useRef9(null);
|
|
8997
|
-
const [bulkChanges, setBulkChanges] =
|
|
8998
|
-
const [isBulkChangesDialogOpen, setIsBulkChangesDialogOpen] =
|
|
8999
|
-
const [isExportCsvDialogOpen, setIsExportCsvDialogOpen] =
|
|
9000
|
-
const [resetCounter, setResetCounter] =
|
|
8770
|
+
const [bulkChanges, setBulkChanges] = useState22([]);
|
|
8771
|
+
const [isBulkChangesDialogOpen, setIsBulkChangesDialogOpen] = useState22(false);
|
|
8772
|
+
const [isExportCsvDialogOpen, setIsExportCsvDialogOpen] = useState22(false);
|
|
8773
|
+
const [resetCounter, setResetCounter] = useState22(0);
|
|
9001
8774
|
const visibleEditableColumns = useMemo6(
|
|
9002
8775
|
() => headCells.filter(
|
|
9003
8776
|
(headCell) => headCell?.enabled && !!headCell?.editableCellType
|
|
@@ -9015,17 +8788,13 @@ var TableDesktopToolbar = ({
|
|
|
9015
8788
|
refetchData?.();
|
|
9016
8789
|
}
|
|
9017
8790
|
};
|
|
9018
|
-
const handleUpdateEditableCell = ({
|
|
9019
|
-
columnId,
|
|
9020
|
-
value,
|
|
9021
|
-
label
|
|
9022
|
-
}) => {
|
|
8791
|
+
const handleUpdateEditableCell = (_rowId, field, value, label) => {
|
|
9023
8792
|
setBulkChanges((prev) => {
|
|
9024
|
-
return [...prev, { field
|
|
8793
|
+
return [...prev, { field, value, label }];
|
|
9025
8794
|
});
|
|
9026
8795
|
};
|
|
9027
|
-
return /* @__PURE__ */
|
|
9028
|
-
|
|
8796
|
+
return /* @__PURE__ */ jsxs90(
|
|
8797
|
+
Box41,
|
|
9029
8798
|
{
|
|
9030
8799
|
sx: {
|
|
9031
8800
|
borderBottom: "1px solid",
|
|
@@ -9033,8 +8802,8 @@ var TableDesktopToolbar = ({
|
|
|
9033
8802
|
maxWidth: "100%"
|
|
9034
8803
|
},
|
|
9035
8804
|
children: [
|
|
9036
|
-
/* @__PURE__ */
|
|
9037
|
-
|
|
8805
|
+
/* @__PURE__ */ jsxs90(
|
|
8806
|
+
Box41,
|
|
9038
8807
|
{
|
|
9039
8808
|
sx: {
|
|
9040
8809
|
py: 1,
|
|
@@ -9045,8 +8814,8 @@ var TableDesktopToolbar = ({
|
|
|
9045
8814
|
background: isBulkChangesMode ? colors.neutral150 : void 0
|
|
9046
8815
|
},
|
|
9047
8816
|
children: [
|
|
9048
|
-
/* @__PURE__ */
|
|
9049
|
-
|
|
8817
|
+
/* @__PURE__ */ jsxs90(
|
|
8818
|
+
Box41,
|
|
9050
8819
|
{
|
|
9051
8820
|
sx: {
|
|
9052
8821
|
py: 1,
|
|
@@ -9056,20 +8825,20 @@ var TableDesktopToolbar = ({
|
|
|
9056
8825
|
whiteSpace: "nowrap"
|
|
9057
8826
|
},
|
|
9058
8827
|
children: [
|
|
9059
|
-
toolbarLabel ? /* @__PURE__ */
|
|
9060
|
-
/* @__PURE__ */
|
|
9061
|
-
/* @__PURE__ */
|
|
8828
|
+
toolbarLabel ? /* @__PURE__ */ jsxs90(Fragment16, { children: [
|
|
8829
|
+
/* @__PURE__ */ jsx132(Typography34, { variant: "subtitle2", color: "textSecondary", children: toolbarLabel }),
|
|
8830
|
+
/* @__PURE__ */ jsx132(Divider11, { orientation: "vertical", sx: { height: 0.75, py: 2.5 } })
|
|
9062
8831
|
] }) : null,
|
|
9063
|
-
renderBulkChangesDialog && refetchData ? /* @__PURE__ */
|
|
9064
|
-
|
|
8832
|
+
renderBulkChangesDialog && refetchData ? /* @__PURE__ */ jsx132(
|
|
8833
|
+
Tooltip12,
|
|
9065
8834
|
{
|
|
9066
8835
|
title: disableBulkChangesMode ? "Access denied, you don\u2019t have permission to use this feature." : "",
|
|
9067
|
-
children: /* @__PURE__ */
|
|
8836
|
+
children: /* @__PURE__ */ jsx132(
|
|
9068
8837
|
FormControlLabel6,
|
|
9069
8838
|
{
|
|
9070
8839
|
label: "Bulk Changes Mode",
|
|
9071
8840
|
disabled: disableBulkChangesMode || !visibleEditableColumns.length,
|
|
9072
|
-
control: /* @__PURE__ */
|
|
8841
|
+
control: /* @__PURE__ */ jsx132(
|
|
9073
8842
|
Switch2,
|
|
9074
8843
|
{
|
|
9075
8844
|
size: "small",
|
|
@@ -9084,17 +8853,17 @@ var TableDesktopToolbar = ({
|
|
|
9084
8853
|
]
|
|
9085
8854
|
}
|
|
9086
8855
|
),
|
|
9087
|
-
isScrollable && /* @__PURE__ */
|
|
8856
|
+
isScrollable && /* @__PURE__ */ jsx132(
|
|
9088
8857
|
IconButton6,
|
|
9089
8858
|
{
|
|
9090
8859
|
"aria-label": "scroll-left",
|
|
9091
8860
|
sx: { padding: 0, alignSelf: "center" },
|
|
9092
8861
|
onClick: () => scroll("left"),
|
|
9093
|
-
children: /* @__PURE__ */
|
|
8862
|
+
children: /* @__PURE__ */ jsx132(KeyboardArrowLeft2, {})
|
|
9094
8863
|
}
|
|
9095
8864
|
),
|
|
9096
|
-
/* @__PURE__ */
|
|
9097
|
-
|
|
8865
|
+
/* @__PURE__ */ jsx132(
|
|
8866
|
+
Box41,
|
|
9098
8867
|
{
|
|
9099
8868
|
ref: scrollRef,
|
|
9100
8869
|
sx: {
|
|
@@ -9110,39 +8879,55 @@ var TableDesktopToolbar = ({
|
|
|
9110
8879
|
display: "none"
|
|
9111
8880
|
}
|
|
9112
8881
|
},
|
|
9113
|
-
children: isBulkChangesMode ? visibleEditableColumns.map(
|
|
9114
|
-
|
|
9115
|
-
|
|
9116
|
-
|
|
8882
|
+
children: isBulkChangesMode ? visibleEditableColumns.map(
|
|
8883
|
+
({
|
|
8884
|
+
id,
|
|
8885
|
+
fieldName,
|
|
8886
|
+
label,
|
|
8887
|
+
editableCellType,
|
|
8888
|
+
filterOptions,
|
|
8889
|
+
refetchFilterOptions,
|
|
8890
|
+
isFetchingFilterOptions,
|
|
8891
|
+
validateInput,
|
|
8892
|
+
width
|
|
8893
|
+
}) => editableCellType && /* @__PURE__ */ jsx132(
|
|
8894
|
+
Box41,
|
|
9117
8895
|
{
|
|
9118
8896
|
sx: { width, flex: "0 0 auto" },
|
|
9119
|
-
children: /* @__PURE__ */
|
|
8897
|
+
children: /* @__PURE__ */ jsx132(
|
|
9120
8898
|
TableDesktopEditableField,
|
|
9121
8899
|
{
|
|
9122
|
-
|
|
8900
|
+
field: id,
|
|
9123
8901
|
size: "small",
|
|
9124
8902
|
variant: "outlined",
|
|
9125
8903
|
showCheckboxLabel: true,
|
|
8904
|
+
fieldName: fieldName ?? "",
|
|
8905
|
+
inputLabel: label ?? "",
|
|
8906
|
+
editableCellType,
|
|
8907
|
+
filterOptions,
|
|
8908
|
+
refetchFilterOptions,
|
|
8909
|
+
isFetchingFilterOptions,
|
|
8910
|
+
validateInput,
|
|
9126
8911
|
onUpdateEditableCell: handleUpdateEditableCell
|
|
9127
8912
|
}
|
|
9128
8913
|
)
|
|
9129
8914
|
},
|
|
9130
8915
|
`${id}-${resetCounter}`
|
|
9131
|
-
)
|
|
9132
|
-
|
|
8916
|
+
)
|
|
8917
|
+
) : null
|
|
9133
8918
|
}
|
|
9134
8919
|
),
|
|
9135
|
-
isScrollable && /* @__PURE__ */
|
|
8920
|
+
isScrollable && /* @__PURE__ */ jsx132(
|
|
9136
8921
|
IconButton6,
|
|
9137
8922
|
{
|
|
9138
8923
|
"aria-label": "scroll-right",
|
|
9139
8924
|
sx: { p: 0, alignSelf: "center" },
|
|
9140
8925
|
onClick: () => scroll("right"),
|
|
9141
|
-
children: /* @__PURE__ */
|
|
8926
|
+
children: /* @__PURE__ */ jsx132(KeyboardArrowRight2, {})
|
|
9142
8927
|
}
|
|
9143
8928
|
),
|
|
9144
|
-
isBulkChangesMode ? /* @__PURE__ */
|
|
9145
|
-
/* @__PURE__ */
|
|
8929
|
+
isBulkChangesMode ? /* @__PURE__ */ jsxs90(Fragment16, { children: [
|
|
8930
|
+
/* @__PURE__ */ jsx132(
|
|
9146
8931
|
Button19,
|
|
9147
8932
|
{
|
|
9148
8933
|
variant: "outlined",
|
|
@@ -9155,7 +8940,7 @@ var TableDesktopToolbar = ({
|
|
|
9155
8940
|
children: "RESET"
|
|
9156
8941
|
}
|
|
9157
8942
|
),
|
|
9158
|
-
/* @__PURE__ */
|
|
8943
|
+
/* @__PURE__ */ jsx132(
|
|
9159
8944
|
Button19,
|
|
9160
8945
|
{
|
|
9161
8946
|
variant: "contained",
|
|
@@ -9166,26 +8951,26 @@ var TableDesktopToolbar = ({
|
|
|
9166
8951
|
children: "APPLY"
|
|
9167
8952
|
}
|
|
9168
8953
|
)
|
|
9169
|
-
] }) : /* @__PURE__ */
|
|
8954
|
+
] }) : /* @__PURE__ */ jsxs90(Box41, { sx: { display: "flex", alignItems: "center", gap: 1 }, children: [
|
|
9170
8955
|
renderInfoIcons,
|
|
9171
|
-
renderExportCsvDialog ? /* @__PURE__ */
|
|
8956
|
+
renderExportCsvDialog ? /* @__PURE__ */ jsx132(Tooltip12, { title: "Download Customer List", children: /* @__PURE__ */ jsx132("span", { style: { display: "flex", alignItems: "center" }, children: /* @__PURE__ */ jsx132(
|
|
9172
8957
|
IconButton6,
|
|
9173
8958
|
{
|
|
9174
8959
|
disableRipple: true,
|
|
9175
8960
|
disabled: isDataEmpty,
|
|
9176
8961
|
"aria-label": "export-csv-button",
|
|
9177
8962
|
onClick: () => setIsExportCsvDialogOpen(true),
|
|
9178
|
-
children: /* @__PURE__ */
|
|
8963
|
+
children: /* @__PURE__ */ jsx132(Download, { fill: colors.neutral750 })
|
|
9179
8964
|
}
|
|
9180
8965
|
) }) }) : null,
|
|
9181
|
-
renderTableColumnConfigurationMenu ? /* @__PURE__ */
|
|
8966
|
+
renderTableColumnConfigurationMenu ? /* @__PURE__ */ jsx132(Tooltip12, { title: "Table Column Configuration", children: /* @__PURE__ */ jsx132(
|
|
9182
8967
|
IconButton6,
|
|
9183
8968
|
{
|
|
9184
8969
|
disableRipple: true,
|
|
9185
8970
|
"aria-label": "table-column-config-button",
|
|
9186
8971
|
ref: tableToolbarMenuButtonRef,
|
|
9187
8972
|
onClick: onClickToolbarMenuOpen,
|
|
9188
|
-
children: /* @__PURE__ */
|
|
8973
|
+
children: /* @__PURE__ */ jsx132(IconTableEdit_default, { fill: colors.neutral750 })
|
|
9189
8974
|
}
|
|
9190
8975
|
) }) : null
|
|
9191
8976
|
] })
|
|
@@ -9218,11 +9003,11 @@ var TableDesktopToolbar = ({
|
|
|
9218
9003
|
};
|
|
9219
9004
|
|
|
9220
9005
|
// src/components/TableHeader/TableHeader.tsx
|
|
9221
|
-
import { memo as
|
|
9006
|
+
import { memo as memo24, useEffect as useEffect15, useState as useState23 } from "react";
|
|
9222
9007
|
import { ImportExport as ImportExportIcon } from "@mui/icons-material";
|
|
9223
9008
|
import { TableCell as TableCell7, TableHead as TableHead3, TableRow as TableRow6, TableSortLabel as TableSortLabel3 } from "@mui/material";
|
|
9224
9009
|
import { makeStyles as makeStyles47 } from "tss-react/mui";
|
|
9225
|
-
import { jsx as
|
|
9010
|
+
import { jsx as jsx133 } from "react/jsx-runtime";
|
|
9226
9011
|
var useStyles47 = makeStyles47()(() => ({
|
|
9227
9012
|
sortLabel: {
|
|
9228
9013
|
"& .MuiTableSortLabel-icon": {
|
|
@@ -9231,7 +9016,7 @@ var useStyles47 = makeStyles47()(() => ({
|
|
|
9231
9016
|
}
|
|
9232
9017
|
}));
|
|
9233
9018
|
var TableHeader = ({ cells, onSort = null }) => {
|
|
9234
|
-
const [sortableCells, setSortableCells] =
|
|
9019
|
+
const [sortableCells, setSortableCells] = useState23([]);
|
|
9235
9020
|
const { classes } = useStyles47();
|
|
9236
9021
|
useEffect15(() => {
|
|
9237
9022
|
setSortableCells(cells);
|
|
@@ -9267,7 +9052,7 @@ var TableHeader = ({ cells, onSort = null }) => {
|
|
|
9267
9052
|
});
|
|
9268
9053
|
setSortableCells(sortedCells);
|
|
9269
9054
|
};
|
|
9270
|
-
return /* @__PURE__ */
|
|
9055
|
+
return /* @__PURE__ */ jsx133(TableHead3, { children: /* @__PURE__ */ jsx133(TableRow6, { children: sortableCells.map((cell, key) => /* @__PURE__ */ jsx133(TableCell7, { children: cell.isSortable ? /* @__PURE__ */ jsx133(
|
|
9271
9056
|
TableSortLabel3,
|
|
9272
9057
|
{
|
|
9273
9058
|
className: classes.sortLabel,
|
|
@@ -9278,12 +9063,12 @@ var TableHeader = ({ cells, onSort = null }) => {
|
|
|
9278
9063
|
}
|
|
9279
9064
|
) : cell.label }, cell.label || key)) }) });
|
|
9280
9065
|
};
|
|
9281
|
-
var TableHeader_default =
|
|
9066
|
+
var TableHeader_default = memo24(TableHeader);
|
|
9282
9067
|
|
|
9283
9068
|
// src/components/TextDivider/TextDivider.tsx
|
|
9284
|
-
import { Box as
|
|
9069
|
+
import { Box as Box42, Typography as Typography35, Divider as Divider12, Button as Button20 } from "@mui/material";
|
|
9285
9070
|
import { makeStyles as makeStyles48 } from "tss-react/mui";
|
|
9286
|
-
import { jsx as
|
|
9071
|
+
import { jsx as jsx134, jsxs as jsxs91 } from "react/jsx-runtime";
|
|
9287
9072
|
var useStyles48 = makeStyles48()(() => ({
|
|
9288
9073
|
icon: {
|
|
9289
9074
|
fontSize: 20
|
|
@@ -9320,19 +9105,19 @@ var TextDivider = ({
|
|
|
9320
9105
|
}) => {
|
|
9321
9106
|
const { classes } = useStyles48();
|
|
9322
9107
|
const iconColor = color ?? colors.neutral900;
|
|
9323
|
-
return /* @__PURE__ */
|
|
9324
|
-
|
|
9108
|
+
return /* @__PURE__ */ jsxs91(
|
|
9109
|
+
Box42,
|
|
9325
9110
|
{
|
|
9326
9111
|
display: "flex",
|
|
9327
9112
|
alignItems: "center",
|
|
9328
9113
|
justifyContent: "space-between",
|
|
9329
9114
|
className: classes.container,
|
|
9330
9115
|
children: [
|
|
9331
|
-
/* @__PURE__ */
|
|
9332
|
-
/* @__PURE__ */
|
|
9333
|
-
Icon2 && iconPosition === "left" && /* @__PURE__ */
|
|
9334
|
-
/* @__PURE__ */
|
|
9335
|
-
|
|
9116
|
+
/* @__PURE__ */ jsx134(Divider12, { className: classes.leftDivider }),
|
|
9117
|
+
/* @__PURE__ */ jsx134(Button20, { onClick, disabled: !onClick, className: classes.button, children: /* @__PURE__ */ jsxs91(Box42, { className: classes.center, children: [
|
|
9118
|
+
Icon2 && iconPosition === "left" && /* @__PURE__ */ jsx134(Icon2, { className: classes.icon, style: { color: iconColor } }),
|
|
9119
|
+
/* @__PURE__ */ jsx134(
|
|
9120
|
+
Typography35,
|
|
9336
9121
|
{
|
|
9337
9122
|
color: "textSecondary",
|
|
9338
9123
|
className: classes.title,
|
|
@@ -9340,9 +9125,9 @@ var TextDivider = ({
|
|
|
9340
9125
|
children: title
|
|
9341
9126
|
}
|
|
9342
9127
|
),
|
|
9343
|
-
Icon2 && iconPosition === "right" && /* @__PURE__ */
|
|
9128
|
+
Icon2 && iconPosition === "right" && /* @__PURE__ */ jsx134(Icon2, { className: classes.icon, style: { color: iconColor } })
|
|
9344
9129
|
] }) }),
|
|
9345
|
-
/* @__PURE__ */
|
|
9130
|
+
/* @__PURE__ */ jsx134(Divider12, { className: classes.rightDivider })
|
|
9346
9131
|
]
|
|
9347
9132
|
}
|
|
9348
9133
|
);
|
|
@@ -9354,7 +9139,7 @@ import { DateRangePicker } from "react-dates";
|
|
|
9354
9139
|
import { makeStyles as makeStyles49 } from "tss-react/mui";
|
|
9355
9140
|
import "react-dates/initialize";
|
|
9356
9141
|
import "react-dates/lib/css/_datepicker.css";
|
|
9357
|
-
import { jsx as
|
|
9142
|
+
import { jsx as jsx135 } from "react/jsx-runtime";
|
|
9358
9143
|
var useStyles49 = makeStyles49()((theme) => ({
|
|
9359
9144
|
wrapper: {
|
|
9360
9145
|
"& .DateRangePicker": {
|
|
@@ -9450,15 +9235,15 @@ var ThemedDateRangePicker = ({
|
|
|
9450
9235
|
...props
|
|
9451
9236
|
}) => {
|
|
9452
9237
|
const { classes, cx } = useStyles49();
|
|
9453
|
-
return /* @__PURE__ */
|
|
9238
|
+
return /* @__PURE__ */ jsx135("div", { className: cx(classes.wrapper, className), children: /* @__PURE__ */ jsx135(DateRangePicker, { ...props }) });
|
|
9454
9239
|
};
|
|
9455
9240
|
var ThemedDateRangePicker_default = ThemedDateRangePicker;
|
|
9456
9241
|
|
|
9457
9242
|
// src/components/TheToolbar/TheToolbar.tsx
|
|
9458
|
-
import { memo as
|
|
9459
|
-
import { AppBar, Box as
|
|
9243
|
+
import { memo as memo25 } from "react";
|
|
9244
|
+
import { AppBar, Box as Box43, Toolbar } from "@mui/material";
|
|
9460
9245
|
import { makeStyles as makeStyles50 } from "tss-react/mui";
|
|
9461
|
-
import { jsx as
|
|
9246
|
+
import { jsx as jsx136, jsxs as jsxs92 } from "react/jsx-runtime";
|
|
9462
9247
|
var useStyles50 = makeStyles50()((theme) => ({
|
|
9463
9248
|
menuButton: {
|
|
9464
9249
|
color: theme.palette.primary.contrastText
|
|
@@ -9478,9 +9263,9 @@ var TheToolbar = ({
|
|
|
9478
9263
|
rightSection
|
|
9479
9264
|
}) => {
|
|
9480
9265
|
const { classes } = useStyles50();
|
|
9481
|
-
return /* @__PURE__ */
|
|
9482
|
-
/* @__PURE__ */
|
|
9483
|
-
/* @__PURE__ */
|
|
9266
|
+
return /* @__PURE__ */ jsxs92(Box43, { children: [
|
|
9267
|
+
/* @__PURE__ */ jsx136(AppBar, { children: /* @__PURE__ */ jsxs92(Toolbar, { className: classes.topBar, children: [
|
|
9268
|
+
/* @__PURE__ */ jsx136(
|
|
9484
9269
|
RoundButton_default,
|
|
9485
9270
|
{
|
|
9486
9271
|
className: classes.menuButton,
|
|
@@ -9489,7 +9274,7 @@ var TheToolbar = ({
|
|
|
9489
9274
|
onClick: handleOpen
|
|
9490
9275
|
}
|
|
9491
9276
|
),
|
|
9492
|
-
/* @__PURE__ */
|
|
9277
|
+
/* @__PURE__ */ jsx136(
|
|
9493
9278
|
CompanyLogo_default,
|
|
9494
9279
|
{
|
|
9495
9280
|
size: "small",
|
|
@@ -9498,30 +9283,30 @@ var TheToolbar = ({
|
|
|
9498
9283
|
imageLogoLightSmall
|
|
9499
9284
|
}
|
|
9500
9285
|
),
|
|
9501
|
-
/* @__PURE__ */
|
|
9502
|
-
/* @__PURE__ */
|
|
9286
|
+
/* @__PURE__ */ jsx136(Box43, { ml: 2, children: leftSection }),
|
|
9287
|
+
/* @__PURE__ */ jsx136(Box43, { ml: "auto", children: rightSection })
|
|
9503
9288
|
] }) }),
|
|
9504
9289
|
LeftDrawer
|
|
9505
9290
|
] });
|
|
9506
9291
|
};
|
|
9507
|
-
var TheToolbar_default =
|
|
9292
|
+
var TheToolbar_default = memo25(TheToolbar);
|
|
9508
9293
|
|
|
9509
9294
|
// src/components/ToastMessage/ToastMessage.tsx
|
|
9510
9295
|
import { Alert as MuiAlert, Snackbar } from "@mui/material";
|
|
9511
|
-
import { jsx as
|
|
9296
|
+
import { jsx as jsx137 } from "react/jsx-runtime";
|
|
9512
9297
|
var ToastMessage = ({
|
|
9513
9298
|
toastType,
|
|
9514
9299
|
toastMessage,
|
|
9515
9300
|
open,
|
|
9516
9301
|
onClose
|
|
9517
|
-
}) => /* @__PURE__ */
|
|
9302
|
+
}) => /* @__PURE__ */ jsx137(
|
|
9518
9303
|
Snackbar,
|
|
9519
9304
|
{
|
|
9520
9305
|
open,
|
|
9521
9306
|
autoHideDuration: 1500,
|
|
9522
9307
|
onClose,
|
|
9523
9308
|
anchorOrigin: { vertical: "top", horizontal: "right" },
|
|
9524
|
-
children: /* @__PURE__ */
|
|
9309
|
+
children: /* @__PURE__ */ jsx137(
|
|
9525
9310
|
MuiAlert,
|
|
9526
9311
|
{
|
|
9527
9312
|
elevation: 6,
|
|
@@ -9549,16 +9334,16 @@ var ToastMessage_default = ToastMessage;
|
|
|
9549
9334
|
|
|
9550
9335
|
// src/components/TwoButtonDialog/TwoButtonDialog.tsx
|
|
9551
9336
|
import {
|
|
9552
|
-
Typography as
|
|
9337
|
+
Typography as Typography36,
|
|
9553
9338
|
Dialog as Dialog5,
|
|
9554
9339
|
Backdrop,
|
|
9555
|
-
Box as
|
|
9340
|
+
Box as Box44,
|
|
9556
9341
|
Divider as Divider13,
|
|
9557
9342
|
Paper as Paper13,
|
|
9558
9343
|
Fade as Fade2
|
|
9559
9344
|
} from "@mui/material";
|
|
9560
9345
|
import { makeStyles as makeStyles51 } from "tss-react/mui";
|
|
9561
|
-
import { jsx as
|
|
9346
|
+
import { jsx as jsx138, jsxs as jsxs93 } from "react/jsx-runtime";
|
|
9562
9347
|
var useStyles51 = makeStyles51()((theme) => ({
|
|
9563
9348
|
paper: {
|
|
9564
9349
|
padding: theme.spacing(2)
|
|
@@ -9588,7 +9373,7 @@ var TwoButtonDialog = ({
|
|
|
9588
9373
|
cancelButton
|
|
9589
9374
|
}) => {
|
|
9590
9375
|
const { classes } = useStyles51();
|
|
9591
|
-
return /* @__PURE__ */
|
|
9376
|
+
return /* @__PURE__ */ jsx138(
|
|
9592
9377
|
Dialog5,
|
|
9593
9378
|
{
|
|
9594
9379
|
open,
|
|
@@ -9598,10 +9383,10 @@ var TwoButtonDialog = ({
|
|
|
9598
9383
|
closeAfterTransition: true,
|
|
9599
9384
|
BackdropComponent: Backdrop,
|
|
9600
9385
|
BackdropProps: { timeout: 500 },
|
|
9601
|
-
children: /* @__PURE__ */
|
|
9602
|
-
/* @__PURE__ */
|
|
9603
|
-
/* @__PURE__ */
|
|
9604
|
-
|
|
9386
|
+
children: /* @__PURE__ */ jsx138(Fade2, { in: open, children: /* @__PURE__ */ jsxs93(Paper13, { className: classes.paper, children: [
|
|
9387
|
+
/* @__PURE__ */ jsxs93(Box44, { className: classes.mb, children: [
|
|
9388
|
+
/* @__PURE__ */ jsx138(Typography36, { variant: "h5", component: "div", children: /* @__PURE__ */ jsx138(
|
|
9389
|
+
Box44,
|
|
9605
9390
|
{
|
|
9606
9391
|
sx: {
|
|
9607
9392
|
fontWeight: 600
|
|
@@ -9609,23 +9394,23 @@ var TwoButtonDialog = ({
|
|
|
9609
9394
|
children: title
|
|
9610
9395
|
}
|
|
9611
9396
|
) }),
|
|
9612
|
-
/* @__PURE__ */
|
|
9613
|
-
|
|
9397
|
+
/* @__PURE__ */ jsxs93(
|
|
9398
|
+
Box44,
|
|
9614
9399
|
{
|
|
9615
9400
|
className: classes.mt,
|
|
9616
9401
|
sx: {
|
|
9617
9402
|
fontWeight: 600
|
|
9618
9403
|
},
|
|
9619
9404
|
children: [
|
|
9620
|
-
subtitle1 && /* @__PURE__ */
|
|
9621
|
-
subtitle2 && /* @__PURE__ */
|
|
9405
|
+
subtitle1 && /* @__PURE__ */ jsx138(Typography36, { variant: "subtitle1", children: subtitle1 }),
|
|
9406
|
+
subtitle2 && /* @__PURE__ */ jsx138(Typography36, { variant: "subtitle1", children: subtitle2 })
|
|
9622
9407
|
]
|
|
9623
9408
|
}
|
|
9624
9409
|
)
|
|
9625
9410
|
] }),
|
|
9626
|
-
/* @__PURE__ */
|
|
9627
|
-
/* @__PURE__ */
|
|
9628
|
-
/* @__PURE__ */
|
|
9411
|
+
/* @__PURE__ */ jsx138(Divider13, {}),
|
|
9412
|
+
/* @__PURE__ */ jsxs93(Box44, { className: classes.buttonContainer, children: [
|
|
9413
|
+
/* @__PURE__ */ jsx138(
|
|
9629
9414
|
FilledButton_default,
|
|
9630
9415
|
{
|
|
9631
9416
|
copy: cancelLabel,
|
|
@@ -9638,7 +9423,7 @@ var TwoButtonDialog = ({
|
|
|
9638
9423
|
}
|
|
9639
9424
|
}
|
|
9640
9425
|
),
|
|
9641
|
-
/* @__PURE__ */
|
|
9426
|
+
/* @__PURE__ */ jsx138(
|
|
9642
9427
|
FilledButton_default,
|
|
9643
9428
|
{
|
|
9644
9429
|
color: "primary",
|
|
@@ -9647,7 +9432,7 @@ var TwoButtonDialog = ({
|
|
|
9647
9432
|
}
|
|
9648
9433
|
)
|
|
9649
9434
|
] }),
|
|
9650
|
-
/* @__PURE__ */
|
|
9435
|
+
/* @__PURE__ */ jsx138(Loading_default, { isLoading: dialogLoading })
|
|
9651
9436
|
] }) })
|
|
9652
9437
|
}
|
|
9653
9438
|
);
|
|
@@ -9655,11 +9440,11 @@ var TwoButtonDialog = ({
|
|
|
9655
9440
|
var TwoButtonDialog_default = TwoButtonDialog;
|
|
9656
9441
|
|
|
9657
9442
|
// src/components/UserBust/UserBust.tsx
|
|
9658
|
-
import { memo as
|
|
9659
|
-
import { Avatar as Avatar2, Typography as
|
|
9660
|
-
import { jsx as
|
|
9661
|
-
var UserBust = ({ user, avatarProps, typographyProps }) => /* @__PURE__ */
|
|
9662
|
-
/* @__PURE__ */
|
|
9443
|
+
import { memo as memo26 } from "react";
|
|
9444
|
+
import { Avatar as Avatar2, Typography as Typography37 } from "@mui/material";
|
|
9445
|
+
import { jsx as jsx139, jsxs as jsxs94 } from "react/jsx-runtime";
|
|
9446
|
+
var UserBust = ({ user, avatarProps, typographyProps }) => /* @__PURE__ */ jsxs94("div", { children: [
|
|
9447
|
+
/* @__PURE__ */ jsx139(
|
|
9663
9448
|
Avatar2,
|
|
9664
9449
|
{
|
|
9665
9450
|
src: user.profile_picture,
|
|
@@ -9667,18 +9452,18 @@ var UserBust = ({ user, avatarProps, typographyProps }) => /* @__PURE__ */ jsxs9
|
|
|
9667
9452
|
style: { width: avatarProps.width, height: avatarProps.height }
|
|
9668
9453
|
}
|
|
9669
9454
|
),
|
|
9670
|
-
/* @__PURE__ */
|
|
9671
|
-
/* @__PURE__ */
|
|
9672
|
-
/* @__PURE__ */
|
|
9455
|
+
/* @__PURE__ */ jsxs94("div", { style: { paddingTop: 16 }, children: [
|
|
9456
|
+
/* @__PURE__ */ jsx139(Typography37, { ...typographyProps.name, children: `${user.first_name} ${user.last_name}` }),
|
|
9457
|
+
/* @__PURE__ */ jsx139(Typography37, { ...typographyProps.username, children: user.username })
|
|
9673
9458
|
] })
|
|
9674
9459
|
] });
|
|
9675
|
-
var UserBust_default =
|
|
9460
|
+
var UserBust_default = memo26(UserBust);
|
|
9676
9461
|
|
|
9677
9462
|
// src/components/icons/IconChart.tsx
|
|
9678
|
-
import { jsx as
|
|
9463
|
+
import { jsx as jsx140 } from "react/jsx-runtime";
|
|
9679
9464
|
var SvgIconChart = (props) => {
|
|
9680
9465
|
const { fill } = props;
|
|
9681
|
-
return /* @__PURE__ */
|
|
9466
|
+
return /* @__PURE__ */ jsx140(
|
|
9682
9467
|
"svg",
|
|
9683
9468
|
{
|
|
9684
9469
|
width: "20",
|
|
@@ -9687,7 +9472,7 @@ var SvgIconChart = (props) => {
|
|
|
9687
9472
|
fill: "none",
|
|
9688
9473
|
xmlns: "http://www.w3.org/2000/svg",
|
|
9689
9474
|
...props,
|
|
9690
|
-
children: /* @__PURE__ */
|
|
9475
|
+
children: /* @__PURE__ */ jsx140(
|
|
9691
9476
|
"path",
|
|
9692
9477
|
{
|
|
9693
9478
|
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",
|
|
@@ -9765,7 +9550,6 @@ export {
|
|
|
9765
9550
|
SearchWithFilters_default as SearchWithFilters,
|
|
9766
9551
|
SearchWithFiltersForTable_default as SearchWithFiltersForTable,
|
|
9767
9552
|
SectionName_default as SectionName,
|
|
9768
|
-
SmartMultipleSelect,
|
|
9769
9553
|
SmartSelect_default as SmartSelect,
|
|
9770
9554
|
SmartTableHeader,
|
|
9771
9555
|
SmartTableHeaderFilterMenu,
|