@natoora-libs/core 0.2.4 → 0.2.5-dev-prod-list-bulk-changes-1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{TableDesktop-4tjwQjmc.d.cts → TableDesktop-Z0KE59L4.d.cts} +21 -13
- package/dist/{TableDesktop-4tjwQjmc.d.ts → TableDesktop-Z0KE59L4.d.ts} +21 -13
- package/dist/components/index.cjs +810 -582
- package/dist/components/index.cjs.map +1 -1
- package/dist/components/index.d.cts +28 -26
- package/dist/components/index.d.ts +28 -26
- package/dist/components/index.js +776 -539
- 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 +10 -9
package/dist/components/index.js
CHANGED
|
@@ -985,7 +985,7 @@ var AutocompleteFilterMenuContent = ({
|
|
|
985
985
|
onFilterOptionChange,
|
|
986
986
|
onApplyFiltersClick,
|
|
987
987
|
shouldShowCheckOnFilter,
|
|
988
|
-
|
|
988
|
+
onAutocompleteSearch,
|
|
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
|
+
onAutocompleteSearch?.(value);
|
|
1022
1022
|
}
|
|
1023
1023
|
}
|
|
1024
1024
|
),
|
|
@@ -3463,7 +3463,7 @@ var CheckboxFilterMenuContent = ({
|
|
|
3463
3463
|
)
|
|
3464
3464
|
}
|
|
3465
3465
|
),
|
|
3466
|
-
/* @__PURE__ */ jsx73(Divider2, {}),
|
|
3466
|
+
/* @__PURE__ */ jsx73(Divider2, { sx: { mt: 0.5 } }),
|
|
3467
3467
|
/* @__PURE__ */ jsxs42(
|
|
3468
3468
|
Box13,
|
|
3469
3469
|
{
|
|
@@ -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 Tooltip6 } 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(Tooltip6, { title: tooltipDescription, children: /* @__PURE__ */ jsx77("span", { children: checkbox }) }) : checkbox;
|
|
3749
3749
|
}
|
|
3750
3750
|
}
|
|
3751
3751
|
);
|
|
@@ -6256,7 +6256,7 @@ import {
|
|
|
6256
6256
|
ListItemButton,
|
|
6257
6257
|
ListItemText as ListItemText4,
|
|
6258
6258
|
ListSubheader,
|
|
6259
|
-
Tooltip as
|
|
6259
|
+
Tooltip as Tooltip7
|
|
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(Tooltip7, { title: warningMessage, children: /* @__PURE__ */ jsx105(WarningAmber, { color: "warning" }) })
|
|
6349
6349
|
]
|
|
6350
6350
|
},
|
|
6351
6351
|
id
|
|
@@ -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 Tooltip8, 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(Tooltip8, { title: tooltipDescription, placement: "right", children: /* @__PURE__ */ jsx113(
|
|
7037
7037
|
InfoIcon,
|
|
7038
7038
|
{
|
|
7039
7039
|
fontSize: "small",
|
|
@@ -7063,18 +7063,134 @@ var SectionName = ({
|
|
|
7063
7063
|
};
|
|
7064
7064
|
var SectionName_default = SectionName;
|
|
7065
7065
|
|
|
7066
|
-
// src/components/
|
|
7067
|
-
import {
|
|
7066
|
+
// src/components/SmartMultipleSelect/SmartMultipleSelect.tsx
|
|
7067
|
+
import { useState as useState15 } from "react";
|
|
7068
7068
|
import {
|
|
7069
|
+
Box as Box35,
|
|
7070
|
+
Checkbox as Checkbox6,
|
|
7069
7071
|
CircularProgress as CircularProgress4,
|
|
7070
7072
|
FormControl as FormControl4,
|
|
7071
7073
|
FormHelperText as FormHelperText3,
|
|
7072
7074
|
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
|
+
error,
|
|
7085
|
+
values,
|
|
7086
|
+
defaultValues,
|
|
7087
|
+
onChange,
|
|
7088
|
+
onOpen,
|
|
7089
|
+
onClose,
|
|
7090
|
+
menuOptions,
|
|
7091
|
+
isLoading,
|
|
7092
|
+
disabled,
|
|
7093
|
+
emptyMessage = "No options.",
|
|
7094
|
+
helperText
|
|
7095
|
+
}) => {
|
|
7096
|
+
const [localValues, setLocalValues] = useState15(defaultValues ?? []);
|
|
7097
|
+
const handleChangeOption = (option) => {
|
|
7098
|
+
let newValues = [];
|
|
7099
|
+
const selectedIndex = localValues.findIndex(
|
|
7100
|
+
(val) => val.value === option.value
|
|
7101
|
+
);
|
|
7102
|
+
if (selectedIndex === -1) {
|
|
7103
|
+
newValues = [...localValues, option];
|
|
7104
|
+
} else {
|
|
7105
|
+
newValues = localValues.filter((_, i) => i !== selectedIndex);
|
|
7106
|
+
}
|
|
7107
|
+
setLocalValues(newValues);
|
|
7108
|
+
onChange?.(newValues);
|
|
7109
|
+
};
|
|
7110
|
+
const renderMenuContent = () => !menuOptions?.length ? /* @__PURE__ */ jsx114(
|
|
7111
|
+
Box35,
|
|
7112
|
+
{
|
|
7113
|
+
sx: { display: "flex", justifyContent: "center", alignItems: "center" },
|
|
7114
|
+
children: /* @__PURE__ */ jsx114(Typography28, { children: emptyMessage })
|
|
7115
|
+
}
|
|
7116
|
+
) : /* @__PURE__ */ jsx114(Box35, { sx: { display: "flex", flexDirection: "column" }, children: menuOptions?.map((option, index) => {
|
|
7117
|
+
const selectedValues = values ?? localValues ?? [];
|
|
7118
|
+
const isSelected = selectedValues.some(
|
|
7119
|
+
(selected) => selected.value === option.value
|
|
7120
|
+
);
|
|
7121
|
+
return /* @__PURE__ */ jsxs78(
|
|
7122
|
+
Box35,
|
|
7123
|
+
{
|
|
7124
|
+
onClick: () => handleChangeOption(option),
|
|
7125
|
+
sx: {
|
|
7126
|
+
p: 0.5,
|
|
7127
|
+
display: "flex",
|
|
7128
|
+
cursor: "pointer",
|
|
7129
|
+
backgroundColor: isSelected ? colors.lightBlueBackground : void 0
|
|
7130
|
+
},
|
|
7131
|
+
children: [
|
|
7132
|
+
/* @__PURE__ */ jsx114(Checkbox6, { disableRipple: true, sx: { py: 0.5 }, checked: isSelected }),
|
|
7133
|
+
/* @__PURE__ */ jsx114(ListItemText5, { primary: option.label })
|
|
7134
|
+
]
|
|
7135
|
+
},
|
|
7136
|
+
option.value ?? index
|
|
7137
|
+
);
|
|
7138
|
+
}) });
|
|
7139
|
+
return /* @__PURE__ */ jsxs78(
|
|
7140
|
+
FormControl4,
|
|
7141
|
+
{
|
|
7142
|
+
fullWidth: true,
|
|
7143
|
+
variant,
|
|
7144
|
+
size,
|
|
7145
|
+
disabled,
|
|
7146
|
+
error,
|
|
7147
|
+
children: [
|
|
7148
|
+
/* @__PURE__ */ jsx114(InputLabel4, { children: inputLabel }),
|
|
7149
|
+
/* @__PURE__ */ jsx114(
|
|
7150
|
+
Select3,
|
|
7151
|
+
{
|
|
7152
|
+
multiple: true,
|
|
7153
|
+
label: inputLabel,
|
|
7154
|
+
error,
|
|
7155
|
+
value: values ?? localValues,
|
|
7156
|
+
defaultValue: defaultValues,
|
|
7157
|
+
onOpen,
|
|
7158
|
+
onClose: () => onClose?.(localValues),
|
|
7159
|
+
renderValue: (selectedValues) => {
|
|
7160
|
+
const valuesString = selectedValues.map((v) => v.label)?.join(", ");
|
|
7161
|
+
return /* @__PURE__ */ jsx114(DynamicOverflowTooltip, { tooltipDescription: valuesString, children: valuesString });
|
|
7162
|
+
},
|
|
7163
|
+
children: isLoading ? /* @__PURE__ */ jsx114(
|
|
7164
|
+
Box35,
|
|
7165
|
+
{
|
|
7166
|
+
sx: {
|
|
7167
|
+
display: "flex",
|
|
7168
|
+
justifyContent: "center",
|
|
7169
|
+
alignItems: "center"
|
|
7170
|
+
},
|
|
7171
|
+
children: /* @__PURE__ */ jsx114(CircularProgress4, { size: 24 })
|
|
7172
|
+
}
|
|
7173
|
+
) : renderMenuContent()
|
|
7174
|
+
}
|
|
7175
|
+
),
|
|
7176
|
+
helperText && /* @__PURE__ */ jsx114(FormHelperText3, { children: helperText })
|
|
7177
|
+
]
|
|
7178
|
+
}
|
|
7179
|
+
);
|
|
7180
|
+
};
|
|
7181
|
+
|
|
7182
|
+
// src/components/SmartSelect/SmartSelect.tsx
|
|
7183
|
+
import { forwardRef as forwardRef2, useState as useState16, useEffect as useEffect10 } from "react";
|
|
7184
|
+
import {
|
|
7185
|
+
CircularProgress as CircularProgress5,
|
|
7186
|
+
FormControl as FormControl5,
|
|
7187
|
+
FormHelperText as FormHelperText4,
|
|
7188
|
+
InputLabel as InputLabel5,
|
|
7073
7189
|
MenuItem as MenuItem3,
|
|
7074
|
-
Select as
|
|
7190
|
+
Select as Select4
|
|
7075
7191
|
} from "@mui/material";
|
|
7076
7192
|
import { makeStyles as makeStyles43 } from "tss-react/mui";
|
|
7077
|
-
import { jsx as
|
|
7193
|
+
import { jsx as jsx115, jsxs as jsxs79 } from "react/jsx-runtime";
|
|
7078
7194
|
var useStyles43 = makeStyles43()(() => ({
|
|
7079
7195
|
container: {
|
|
7080
7196
|
display: "flex",
|
|
@@ -7101,8 +7217,8 @@ var SmartSelect = forwardRef2(
|
|
|
7101
7217
|
menuProps
|
|
7102
7218
|
}, ref) => {
|
|
7103
7219
|
const { classes } = useStyles43();
|
|
7104
|
-
const [open, setOpen] =
|
|
7105
|
-
const [localOptions, setLocalOptions] =
|
|
7220
|
+
const [open, setOpen] = useState16(false);
|
|
7221
|
+
const [localOptions, setLocalOptions] = useState16(options || []);
|
|
7106
7222
|
useEffect10(() => {
|
|
7107
7223
|
if (options) {
|
|
7108
7224
|
setLocalOptions(options);
|
|
@@ -7142,8 +7258,8 @@ var SmartSelect = forwardRef2(
|
|
|
7142
7258
|
onChange(selectedOption);
|
|
7143
7259
|
}
|
|
7144
7260
|
};
|
|
7145
|
-
return /* @__PURE__ */
|
|
7146
|
-
|
|
7261
|
+
return /* @__PURE__ */ jsxs79(
|
|
7262
|
+
FormControl5,
|
|
7147
7263
|
{
|
|
7148
7264
|
fullWidth: true,
|
|
7149
7265
|
size,
|
|
@@ -7153,16 +7269,16 @@ var SmartSelect = forwardRef2(
|
|
|
7153
7269
|
"data-testid": dataTestId,
|
|
7154
7270
|
disabled,
|
|
7155
7271
|
children: [
|
|
7156
|
-
inputLabel && /* @__PURE__ */
|
|
7157
|
-
|
|
7272
|
+
inputLabel && /* @__PURE__ */ jsx115(
|
|
7273
|
+
InputLabel5,
|
|
7158
7274
|
{
|
|
7159
7275
|
id: "smart-select-label",
|
|
7160
7276
|
"data-testid": `${dataTestId}-label`,
|
|
7161
7277
|
children: inputLabel
|
|
7162
7278
|
}
|
|
7163
7279
|
),
|
|
7164
|
-
/* @__PURE__ */
|
|
7165
|
-
|
|
7280
|
+
/* @__PURE__ */ jsxs79(
|
|
7281
|
+
Select4,
|
|
7166
7282
|
{
|
|
7167
7283
|
ref,
|
|
7168
7284
|
size,
|
|
@@ -7179,17 +7295,17 @@ var SmartSelect = forwardRef2(
|
|
|
7179
7295
|
MenuProps: menuProps,
|
|
7180
7296
|
label: inputLabel,
|
|
7181
7297
|
children: [
|
|
7182
|
-
isFetching && /* @__PURE__ */
|
|
7298
|
+
isFetching && /* @__PURE__ */ jsx115(
|
|
7183
7299
|
MenuItem3,
|
|
7184
7300
|
{
|
|
7185
7301
|
disabled: true,
|
|
7186
7302
|
"data-testid": `${dataTestId}-loading`,
|
|
7187
7303
|
id: `${dataTestId}-loading`,
|
|
7188
|
-
children: /* @__PURE__ */
|
|
7304
|
+
children: /* @__PURE__ */ jsx115(CircularProgress5, { size: 24 })
|
|
7189
7305
|
}
|
|
7190
7306
|
),
|
|
7191
|
-
(defaultOption === null || !defaultOptionLabelIsValid || !defaultOptionValueIsValid) && !isFetching && options?.length === 0 && /* @__PURE__ */
|
|
7192
|
-
localOptions.length === 0 && !isFetching && options?.length !== 0 && defaultOptionLabelIsValid && defaultOptionValueIsValid && /* @__PURE__ */
|
|
7307
|
+
(defaultOption === null || !defaultOptionLabelIsValid || !defaultOptionValueIsValid) && !isFetching && options?.length === 0 && /* @__PURE__ */ jsx115(MenuItem3, { disabled: true, "data-testid": `${dataTestId}-empty-message`, children: emptyMessage }),
|
|
7308
|
+
localOptions.length === 0 && !isFetching && options?.length !== 0 && defaultOptionLabelIsValid && defaultOptionValueIsValid && /* @__PURE__ */ jsx115(
|
|
7193
7309
|
MenuItem3,
|
|
7194
7310
|
{
|
|
7195
7311
|
value: defaultOption?.value,
|
|
@@ -7197,7 +7313,7 @@ var SmartSelect = forwardRef2(
|
|
|
7197
7313
|
children: defaultOption?.label
|
|
7198
7314
|
}
|
|
7199
7315
|
),
|
|
7200
|
-
!isFetching && combinedOptions.length > 0 && combinedOptions.map((option) => /* @__PURE__ */
|
|
7316
|
+
!isFetching && combinedOptions.length > 0 && combinedOptions.map((option) => /* @__PURE__ */ jsx115(
|
|
7201
7317
|
MenuItem3,
|
|
7202
7318
|
{
|
|
7203
7319
|
value: option?.value,
|
|
@@ -7210,7 +7326,7 @@ var SmartSelect = forwardRef2(
|
|
|
7210
7326
|
]
|
|
7211
7327
|
}
|
|
7212
7328
|
),
|
|
7213
|
-
helperText && /* @__PURE__ */
|
|
7329
|
+
helperText && /* @__PURE__ */ jsx115(FormHelperText4, { "data-testid": `${dataTestId}-helper-text`, children: helperText })
|
|
7214
7330
|
]
|
|
7215
7331
|
}
|
|
7216
7332
|
);
|
|
@@ -7220,10 +7336,10 @@ var SmartSelect_default = SmartSelect;
|
|
|
7220
7336
|
|
|
7221
7337
|
// src/components/SquareLabel/SquareLabel.tsx
|
|
7222
7338
|
import { memo as memo19 } from "react";
|
|
7223
|
-
import { Typography as
|
|
7339
|
+
import { Typography as Typography29 } from "@mui/material";
|
|
7224
7340
|
import { red as red2 } from "@mui/material/colors";
|
|
7225
7341
|
import { makeStyles as makeStyles44 } from "tss-react/mui";
|
|
7226
|
-
import { jsx as
|
|
7342
|
+
import { jsx as jsx116 } from "react/jsx-runtime";
|
|
7227
7343
|
var useStyles44 = makeStyles44()((theme) => ({
|
|
7228
7344
|
red: {
|
|
7229
7345
|
backgroundColor: red2["50"],
|
|
@@ -7238,7 +7354,7 @@ var useStyles44 = makeStyles44()((theme) => ({
|
|
|
7238
7354
|
}));
|
|
7239
7355
|
var SquareLabel = ({ color, copy }) => {
|
|
7240
7356
|
const { classes } = useStyles44();
|
|
7241
|
-
return /* @__PURE__ */
|
|
7357
|
+
return /* @__PURE__ */ jsx116(Typography29, { className: classes[color], children: copy });
|
|
7242
7358
|
};
|
|
7243
7359
|
var SquareLabel_default = memo19(SquareLabel);
|
|
7244
7360
|
|
|
@@ -7246,7 +7362,7 @@ var SquareLabel_default = memo19(SquareLabel);
|
|
|
7246
7362
|
import { memo as memo20 } from "react";
|
|
7247
7363
|
import { Grid as Grid2, Switch } from "@mui/material";
|
|
7248
7364
|
import { withStyles as withStyles6 } from "tss-react/mui";
|
|
7249
|
-
import { jsx as
|
|
7365
|
+
import { jsx as jsx117, jsxs as jsxs80 } from "react/jsx-runtime";
|
|
7250
7366
|
var LSwitch = ({
|
|
7251
7367
|
checked,
|
|
7252
7368
|
labelOn,
|
|
@@ -7254,7 +7370,7 @@ var LSwitch = ({
|
|
|
7254
7370
|
handleChange,
|
|
7255
7371
|
classes,
|
|
7256
7372
|
disabled
|
|
7257
|
-
}) => /* @__PURE__ */
|
|
7373
|
+
}) => /* @__PURE__ */ jsx117("div", { className: classes.c_switch, children: /* @__PURE__ */ jsxs80(
|
|
7258
7374
|
Grid2,
|
|
7259
7375
|
{
|
|
7260
7376
|
component: "label",
|
|
@@ -7264,8 +7380,8 @@ var LSwitch = ({
|
|
|
7264
7380
|
alignItems: "center"
|
|
7265
7381
|
},
|
|
7266
7382
|
children: [
|
|
7267
|
-
labelOff && /* @__PURE__ */
|
|
7268
|
-
/* @__PURE__ */
|
|
7383
|
+
labelOff && /* @__PURE__ */ jsx117(Grid2, { children: labelOff }),
|
|
7384
|
+
/* @__PURE__ */ jsx117(Grid2, { children: /* @__PURE__ */ jsx117(
|
|
7269
7385
|
Switch,
|
|
7270
7386
|
{
|
|
7271
7387
|
checked,
|
|
@@ -7274,7 +7390,7 @@ var LSwitch = ({
|
|
|
7274
7390
|
disabled
|
|
7275
7391
|
}
|
|
7276
7392
|
) }),
|
|
7277
|
-
labelOn && /* @__PURE__ */
|
|
7393
|
+
labelOn && /* @__PURE__ */ jsx117(Grid2, { children: labelOn })
|
|
7278
7394
|
]
|
|
7279
7395
|
}
|
|
7280
7396
|
) });
|
|
@@ -7299,10 +7415,10 @@ var LabelledSwitch = withStyles6(LSwitch, (theme) => ({
|
|
|
7299
7415
|
var Switch_default = memo20(LabelledSwitch);
|
|
7300
7416
|
|
|
7301
7417
|
// src/components/SmartTableHeaderFilterMenu/SmartTableHeaderFilterMenu.tsx
|
|
7302
|
-
import {
|
|
7418
|
+
import { useState as useState17, useEffect as useEffect11 } from "react";
|
|
7303
7419
|
import { Menu as Menu4 } from "@mui/material";
|
|
7304
7420
|
import classNames3 from "classnames";
|
|
7305
|
-
import { Fragment as Fragment13, jsx as
|
|
7421
|
+
import { Fragment as Fragment13, jsx as jsx118, jsxs as jsxs81 } from "react/jsx-runtime";
|
|
7306
7422
|
var MAX_WIDTH = 276;
|
|
7307
7423
|
var findFilterIndex = (filters, filterOption) => filters.findIndex((item) => {
|
|
7308
7424
|
if (typeof item === "string" && typeof filterOption === "string") {
|
|
@@ -7313,147 +7429,147 @@ var findFilterIndex = (filters, filterOption) => filters.findIndex((item) => {
|
|
|
7313
7429
|
}
|
|
7314
7430
|
return false;
|
|
7315
7431
|
});
|
|
7316
|
-
var SmartTableHeaderFilterMenu =
|
|
7317
|
-
|
|
7318
|
-
|
|
7319
|
-
|
|
7320
|
-
|
|
7321
|
-
|
|
7322
|
-
|
|
7323
|
-
|
|
7324
|
-
|
|
7325
|
-
|
|
7326
|
-
|
|
7327
|
-
|
|
7328
|
-
|
|
7329
|
-
|
|
7330
|
-
|
|
7331
|
-
|
|
7332
|
-
|
|
7333
|
-
|
|
7334
|
-
|
|
7335
|
-
|
|
7336
|
-
|
|
7337
|
-
|
|
7338
|
-
|
|
7432
|
+
var SmartTableHeaderFilterMenu = ({
|
|
7433
|
+
headCell,
|
|
7434
|
+
numActiveFilters,
|
|
7435
|
+
headerFilters,
|
|
7436
|
+
shouldShowCheckOnFilter,
|
|
7437
|
+
onApplyFilters
|
|
7438
|
+
}) => {
|
|
7439
|
+
const [anchorEl, setAnchorEl] = useState17(null);
|
|
7440
|
+
const [filterOptionsData, setFilterOptionsData] = useState17();
|
|
7441
|
+
const [selectedFilterOptions, setSelectedFilterOptions] = useState17(headerFilters[headCell.id] ?? []);
|
|
7442
|
+
const numFilterOptions = filterOptionsData?.length ?? 0;
|
|
7443
|
+
useEffect11(() => {
|
|
7444
|
+
if (headCell.filterOptions) {
|
|
7445
|
+
setFilterOptionsData(headCell.filterOptions);
|
|
7446
|
+
} else if (headCell.filterType === "boolean") {
|
|
7447
|
+
setFilterOptionsData([
|
|
7448
|
+
{ id: "true", label: "Yes" },
|
|
7449
|
+
{ id: "false", label: "No" }
|
|
7450
|
+
]);
|
|
7451
|
+
}
|
|
7452
|
+
}, [headCell.filterOptions]);
|
|
7453
|
+
const handleFilterMenuOpen = (event) => {
|
|
7454
|
+
if (!numFilterOptions && headCell.filterType === "default") {
|
|
7455
|
+
headCell.refetchFilterOptions?.();
|
|
7456
|
+
}
|
|
7457
|
+
setAnchorEl(event.currentTarget);
|
|
7458
|
+
};
|
|
7459
|
+
const handleFilterMenuClose = () => {
|
|
7460
|
+
setSelectedFilterOptions(headerFilters[headCell.id]);
|
|
7461
|
+
setAnchorEl(null);
|
|
7462
|
+
};
|
|
7463
|
+
const handleSelectAllChange = (checked) => {
|
|
7464
|
+
if (checked) {
|
|
7465
|
+
setSelectedFilterOptions([
|
|
7466
|
+
...filterOptionsData ?? []
|
|
7467
|
+
]);
|
|
7468
|
+
return;
|
|
7469
|
+
}
|
|
7470
|
+
setSelectedFilterOptions([]);
|
|
7471
|
+
};
|
|
7472
|
+
const handleFilterOptionChange = (option) => {
|
|
7473
|
+
const selectedIndex = findFilterIndex(selectedFilterOptions, option);
|
|
7474
|
+
let newSelected;
|
|
7475
|
+
if (selectedIndex === -1) {
|
|
7476
|
+
if (typeof option === "string") {
|
|
7477
|
+
newSelected = [...selectedFilterOptions, option];
|
|
7478
|
+
} else {
|
|
7479
|
+
newSelected = [
|
|
7480
|
+
...selectedFilterOptions,
|
|
7481
|
+
option
|
|
7482
|
+
];
|
|
7339
7483
|
}
|
|
7340
|
-
|
|
7341
|
-
|
|
7342
|
-
|
|
7343
|
-
|
|
7344
|
-
|
|
7484
|
+
} else {
|
|
7485
|
+
newSelected = selectedFilterOptions.filter(
|
|
7486
|
+
(_, index) => index !== selectedIndex
|
|
7487
|
+
);
|
|
7488
|
+
}
|
|
7489
|
+
setSelectedFilterOptions(newSelected);
|
|
7490
|
+
};
|
|
7491
|
+
const handleApplyFiltersClick = (shouldSave) => {
|
|
7492
|
+
const updatedFilters = {
|
|
7493
|
+
...headerFilters,
|
|
7494
|
+
[headCell.id]: [...selectedFilterOptions]
|
|
7345
7495
|
};
|
|
7346
|
-
|
|
7347
|
-
|
|
7348
|
-
|
|
7349
|
-
|
|
7350
|
-
|
|
7351
|
-
|
|
7496
|
+
onApplyFilters?.(updatedFilters, shouldSave);
|
|
7497
|
+
setAnchorEl(null);
|
|
7498
|
+
};
|
|
7499
|
+
useEffect11(() => {
|
|
7500
|
+
setSelectedFilterOptions(headerFilters[headCell.id] ?? []);
|
|
7501
|
+
}, [headerFilters, headCell.id]);
|
|
7502
|
+
return /* @__PURE__ */ jsxs81(Fragment13, { children: [
|
|
7503
|
+
/* @__PURE__ */ jsx118(
|
|
7504
|
+
ActiveFiltersIconButton,
|
|
7505
|
+
{
|
|
7506
|
+
numActiveFilters,
|
|
7507
|
+
handleClick: handleFilterMenuOpen,
|
|
7508
|
+
className: classNames3("filter-menu-trigger", {
|
|
7509
|
+
"has-active-filters": !!numActiveFilters || !!anchorEl
|
|
7510
|
+
})
|
|
7352
7511
|
}
|
|
7353
|
-
|
|
7354
|
-
|
|
7355
|
-
|
|
7356
|
-
|
|
7357
|
-
|
|
7358
|
-
|
|
7359
|
-
|
|
7360
|
-
|
|
7361
|
-
|
|
7362
|
-
|
|
7363
|
-
|
|
7364
|
-
|
|
7365
|
-
|
|
7366
|
-
}
|
|
7367
|
-
|
|
7368
|
-
|
|
7369
|
-
|
|
7370
|
-
|
|
7512
|
+
),
|
|
7513
|
+
/* @__PURE__ */ jsx118(
|
|
7514
|
+
Menu4,
|
|
7515
|
+
{
|
|
7516
|
+
open: !!anchorEl,
|
|
7517
|
+
onClose: handleFilterMenuClose,
|
|
7518
|
+
anchorEl,
|
|
7519
|
+
"data-testid": "filter-menu",
|
|
7520
|
+
slotProps: {
|
|
7521
|
+
list: {
|
|
7522
|
+
sx: { p: 0, maxWidth: MAX_WIDTH }
|
|
7523
|
+
}
|
|
7524
|
+
},
|
|
7525
|
+
anchorOrigin: { vertical: "bottom", horizontal: "right" },
|
|
7526
|
+
transformOrigin: { vertical: "top", horizontal: "right" },
|
|
7527
|
+
children: headCell.filterType === "autocomplete" ? /* @__PURE__ */ jsx118(
|
|
7528
|
+
AutocompleteFilterMenuContent,
|
|
7529
|
+
{
|
|
7530
|
+
columnId: headCell.id,
|
|
7531
|
+
labelFieldName: headCell.fieldName ?? "",
|
|
7532
|
+
isLoading: headCell.isFetchingFilterOptions,
|
|
7533
|
+
filterOptions: filterOptionsData,
|
|
7534
|
+
onAutocompleteSearch: headCell.onAutocompleteSearch,
|
|
7535
|
+
selectedFilterOptions,
|
|
7536
|
+
onFilterOptionChange: handleFilterOptionChange,
|
|
7537
|
+
onApplyFiltersClick: handleApplyFiltersClick,
|
|
7538
|
+
shouldShowCheckOnFilter
|
|
7539
|
+
}
|
|
7540
|
+
) : /* @__PURE__ */ jsx118(
|
|
7541
|
+
CheckboxFilterMenuContent,
|
|
7542
|
+
{
|
|
7543
|
+
columnId: headCell.id,
|
|
7544
|
+
labelFieldName: headCell.fieldName ?? "",
|
|
7545
|
+
isLoading: headCell.isFetchingFilterOptions,
|
|
7546
|
+
selectedFilterOptions,
|
|
7547
|
+
filterOptions: filterOptionsData ?? [],
|
|
7548
|
+
onSelectAllChange: handleSelectAllChange,
|
|
7549
|
+
onFilterOptionChange: handleFilterOptionChange,
|
|
7550
|
+
onApplyFiltersClick: handleApplyFiltersClick,
|
|
7551
|
+
shouldShowCheckOnFilter
|
|
7552
|
+
}
|
|
7553
|
+
)
|
|
7371
7554
|
}
|
|
7372
|
-
|
|
7373
|
-
|
|
7374
|
-
|
|
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
|
-
);
|
|
7555
|
+
)
|
|
7556
|
+
] });
|
|
7557
|
+
};
|
|
7442
7558
|
|
|
7443
7559
|
// src/components/SmartTableHeader/SmartTableHeader.tsx
|
|
7444
|
-
import { memo as
|
|
7560
|
+
import { memo as memo21 } from "react";
|
|
7445
7561
|
import {
|
|
7446
|
-
Box as
|
|
7447
|
-
Checkbox as
|
|
7562
|
+
Box as Box36,
|
|
7563
|
+
Checkbox as Checkbox7,
|
|
7448
7564
|
TableCell,
|
|
7449
7565
|
TableHead,
|
|
7450
7566
|
TableRow,
|
|
7451
7567
|
TableSortLabel,
|
|
7452
|
-
Tooltip as
|
|
7453
|
-
Typography as
|
|
7568
|
+
Tooltip as Tooltip9,
|
|
7569
|
+
Typography as Typography30
|
|
7454
7570
|
} from "@mui/material";
|
|
7455
|
-
import { jsx as
|
|
7456
|
-
var SmartTableHeader =
|
|
7571
|
+
import { jsx as jsx119, jsxs as jsxs82 } from "react/jsx-runtime";
|
|
7572
|
+
var SmartTableHeader = memo21(
|
|
7457
7573
|
({
|
|
7458
7574
|
order,
|
|
7459
7575
|
orderBy,
|
|
@@ -7471,18 +7587,25 @@ var SmartTableHeader = memo22(
|
|
|
7471
7587
|
onRequestSort(event, property);
|
|
7472
7588
|
};
|
|
7473
7589
|
const isSortActive = (headCellId) => orderBy === headCellId;
|
|
7474
|
-
return /* @__PURE__ */
|
|
7475
|
-
enableCheckboxSelection ? /* @__PURE__ */
|
|
7476
|
-
|
|
7590
|
+
return /* @__PURE__ */ jsx119(TableHead, { children: /* @__PURE__ */ jsxs82(TableRow, { children: [
|
|
7591
|
+
enableCheckboxSelection ? /* @__PURE__ */ jsx119(
|
|
7592
|
+
TableCell,
|
|
7477
7593
|
{
|
|
7478
|
-
|
|
7479
|
-
|
|
7480
|
-
|
|
7481
|
-
|
|
7482
|
-
|
|
7594
|
+
padding: "checkbox",
|
|
7595
|
+
sx: { backgroundColor: colors.neutral100 },
|
|
7596
|
+
children: /* @__PURE__ */ jsx119(
|
|
7597
|
+
Checkbox7,
|
|
7598
|
+
{
|
|
7599
|
+
color: "primary",
|
|
7600
|
+
disableRipple: true,
|
|
7601
|
+
indeterminate: numSelectedRows > 0 && numSelectedRows < numRows,
|
|
7602
|
+
checked: numRows > 0 && numSelectedRows === numRows,
|
|
7603
|
+
onChange: onSelectAllClick
|
|
7604
|
+
}
|
|
7605
|
+
)
|
|
7483
7606
|
}
|
|
7484
|
-
)
|
|
7485
|
-
headCells.map((headCell) => /* @__PURE__ */
|
|
7607
|
+
) : null,
|
|
7608
|
+
headCells.map((headCell) => /* @__PURE__ */ jsx119(
|
|
7486
7609
|
TableCell,
|
|
7487
7610
|
{
|
|
7488
7611
|
align: "left",
|
|
@@ -7506,22 +7629,14 @@ var SmartTableHeader = memo22(
|
|
|
7506
7629
|
}
|
|
7507
7630
|
}
|
|
7508
7631
|
},
|
|
7509
|
-
children: /* @__PURE__ */
|
|
7510
|
-
|
|
7632
|
+
children: /* @__PURE__ */ jsxs82(
|
|
7633
|
+
Box36,
|
|
7511
7634
|
{
|
|
7512
7635
|
display: "flex",
|
|
7513
7636
|
flexDirection: "row",
|
|
7514
7637
|
gap: headCell.disableSort ? 1 : 0,
|
|
7515
7638
|
children: [
|
|
7516
|
-
headCell.disableSort ? headCell.
|
|
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(
|
|
7639
|
+
headCell.disableSort ? headCell.renderHeader ?? /* @__PURE__ */ jsx119(Tooltip9, { title: headCell.labelTooltip ?? "", arrow: true, children: /* @__PURE__ */ jsx119(Typography30, { variant: "subtitle2", mt: 0.25, mb: -0.25, children: headCell.label }) }) : /* @__PURE__ */ jsx119(Tooltip9, { title: headCell.labelTooltip ?? "", arrow: true, children: /* @__PURE__ */ jsxs82(
|
|
7525
7640
|
TableSortLabel,
|
|
7526
7641
|
{
|
|
7527
7642
|
"data-testid": "table-sort-label",
|
|
@@ -7529,8 +7644,8 @@ var SmartTableHeader = memo22(
|
|
|
7529
7644
|
direction: orderBy === headCell.id ? order : "asc",
|
|
7530
7645
|
onClick: createSortHandler(headCell.id),
|
|
7531
7646
|
children: [
|
|
7532
|
-
headCell.
|
|
7533
|
-
orderBy === headCell.id ? /* @__PURE__ */
|
|
7647
|
+
headCell.renderHeader ?? headCell.label,
|
|
7648
|
+
orderBy === headCell.id ? /* @__PURE__ */ jsx119(
|
|
7534
7649
|
"span",
|
|
7535
7650
|
{
|
|
7536
7651
|
style: {
|
|
@@ -7550,7 +7665,7 @@ var SmartTableHeader = memo22(
|
|
|
7550
7665
|
]
|
|
7551
7666
|
}
|
|
7552
7667
|
) }),
|
|
7553
|
-
headCell.
|
|
7668
|
+
headCell.filterType ? /* @__PURE__ */ jsx119(
|
|
7554
7669
|
SmartTableHeaderFilterMenu,
|
|
7555
7670
|
{
|
|
7556
7671
|
headCell,
|
|
@@ -7572,9 +7687,9 @@ var SmartTableHeader = memo22(
|
|
|
7572
7687
|
|
|
7573
7688
|
// src/components/Table/Table.tsx
|
|
7574
7689
|
var import_debounce = __toESM(require_debounce(), 1);
|
|
7575
|
-
import { useLayoutEffect, useState as
|
|
7690
|
+
import { useLayoutEffect, useState as useState18 } from "react";
|
|
7576
7691
|
import {
|
|
7577
|
-
Box as
|
|
7692
|
+
Box as Box38,
|
|
7578
7693
|
Paper as Paper11,
|
|
7579
7694
|
Table as MUITable,
|
|
7580
7695
|
TableBody,
|
|
@@ -7588,12 +7703,12 @@ import { makeStyles as makeStyles45 } from "tss-react/mui";
|
|
|
7588
7703
|
import { v4 as uuidv4 } from "uuid";
|
|
7589
7704
|
|
|
7590
7705
|
// src/components/TableLoading/TableLoading.tsx
|
|
7591
|
-
import { Box as
|
|
7592
|
-
import { jsx as
|
|
7706
|
+
import { Box as Box37, Skeleton as Skeleton4 } from "@mui/material";
|
|
7707
|
+
import { jsx as jsx120 } from "react/jsx-runtime";
|
|
7593
7708
|
var TableLoading = ({
|
|
7594
7709
|
rowsPerPage,
|
|
7595
7710
|
rowHeight
|
|
7596
|
-
}) => /* @__PURE__ */
|
|
7711
|
+
}) => /* @__PURE__ */ jsx120(Box37, { children: Array.from({ length: rowsPerPage ?? 0 }).map((_, index) => /* @__PURE__ */ jsx120(
|
|
7597
7712
|
Skeleton4,
|
|
7598
7713
|
{
|
|
7599
7714
|
animation: "pulse",
|
|
@@ -7642,7 +7757,7 @@ function calculateRowsPerPage(rowHeight) {
|
|
|
7642
7757
|
}
|
|
7643
7758
|
|
|
7644
7759
|
// src/components/Table/Table.tsx
|
|
7645
|
-
import { jsx as
|
|
7760
|
+
import { jsx as jsx121, jsxs as jsxs83 } from "react/jsx-runtime";
|
|
7646
7761
|
var useStyles45 = makeStyles45()(() => ({
|
|
7647
7762
|
root: {
|
|
7648
7763
|
height: "calc(100vh - 262px)",
|
|
@@ -7677,11 +7792,11 @@ var Table = ({
|
|
|
7677
7792
|
serverRendered,
|
|
7678
7793
|
updateSort
|
|
7679
7794
|
}) => {
|
|
7680
|
-
const [order, setOrder] =
|
|
7681
|
-
const [orderBy, setOrderBy] =
|
|
7795
|
+
const [order, setOrder] = useState18(appliedFilters?.sortDir || "desc");
|
|
7796
|
+
const [orderBy, setOrderBy] = useState18(
|
|
7682
7797
|
appliedFilters?.sortField || "delivery_date"
|
|
7683
7798
|
);
|
|
7684
|
-
const [rowsPerPage, setRowsPerPage] =
|
|
7799
|
+
const [rowsPerPage, setRowsPerPage] = useState18(defaultRowsPerPage);
|
|
7685
7800
|
const { classes } = useStyles45();
|
|
7686
7801
|
const rowHeight = 56;
|
|
7687
7802
|
const emptyRows = rowsPerPage - Math.min(rowsPerPage, data.length - page * rowsPerPage);
|
|
@@ -7720,24 +7835,24 @@ var Table = ({
|
|
|
7720
7835
|
);
|
|
7721
7836
|
const rowsComponents = rows.map((row) => {
|
|
7722
7837
|
if (RenderItem) {
|
|
7723
|
-
return /* @__PURE__ */
|
|
7838
|
+
return /* @__PURE__ */ jsx121(RenderItem, { ...row }, row.id);
|
|
7724
7839
|
}
|
|
7725
|
-
return /* @__PURE__ */
|
|
7840
|
+
return /* @__PURE__ */ jsx121(TableRow2, { hover: true, onClick: () => onRowClick?.(row), children: headCells?.map((column) => /* @__PURE__ */ jsx121(TableCell2, { children: row[column.id] }, column.id)) }, row.id);
|
|
7726
7841
|
});
|
|
7727
7842
|
if (emptyRows > 0 && rowsPerPage > emptyRows) {
|
|
7728
7843
|
rowsComponents.push(
|
|
7729
|
-
/* @__PURE__ */
|
|
7844
|
+
/* @__PURE__ */ jsx121(TableRow2, { style: { height: rowHeight * emptyRows }, children: /* @__PURE__ */ jsx121(TableCell2, { colSpan: 8 }) }, uuidv4())
|
|
7730
7845
|
);
|
|
7731
7846
|
}
|
|
7732
7847
|
return rowsComponents;
|
|
7733
7848
|
};
|
|
7734
|
-
return /* @__PURE__ */
|
|
7735
|
-
/* @__PURE__ */
|
|
7849
|
+
return /* @__PURE__ */ jsx121(Paper11, { className: classes.root, children: /* @__PURE__ */ jsx121(Box38, { className: classes.paper, children: isLoading ? /* @__PURE__ */ jsx121(TableLoading_default, { rowHeight, rowsPerPage }) : /* @__PURE__ */ jsx121(TableContainer, { className: classes.container, children: /* @__PURE__ */ jsxs83(MUITable, { size: "medium", stickyHeader: true, children: [
|
|
7850
|
+
/* @__PURE__ */ jsx121(TableHead2, { className: classes.header, children: /* @__PURE__ */ jsx121(TableRow2, { children: headCells?.map((headCell) => /* @__PURE__ */ jsx121(
|
|
7736
7851
|
TableCell2,
|
|
7737
7852
|
{
|
|
7738
7853
|
align: "left",
|
|
7739
7854
|
sortDirection: orderBy === headCell.id ? order : void 0,
|
|
7740
|
-
children: /* @__PURE__ */
|
|
7855
|
+
children: /* @__PURE__ */ jsx121(
|
|
7741
7856
|
TableSortLabel2,
|
|
7742
7857
|
{
|
|
7743
7858
|
active: orderBy === headCell.id,
|
|
@@ -7749,9 +7864,9 @@ var Table = ({
|
|
|
7749
7864
|
},
|
|
7750
7865
|
headCell.id
|
|
7751
7866
|
)) }) }),
|
|
7752
|
-
/* @__PURE__ */
|
|
7867
|
+
/* @__PURE__ */ jsxs83(TableBody, { children: [
|
|
7753
7868
|
getTableRows(),
|
|
7754
|
-
rowsPerPage === emptyRows && /* @__PURE__ */
|
|
7869
|
+
rowsPerPage === emptyRows && /* @__PURE__ */ jsx121(TableRow2, { style: { height: rowHeight * emptyRows }, children: /* @__PURE__ */ jsx121(TableCell2, { colSpan: 8, align: "center", children: "Nothing to display" }) })
|
|
7755
7870
|
] })
|
|
7756
7871
|
] }) }) }) });
|
|
7757
7872
|
};
|
|
@@ -7759,23 +7874,23 @@ var Table_default = Table;
|
|
|
7759
7874
|
|
|
7760
7875
|
// src/components/TableDesktop/TableDesktop.tsx
|
|
7761
7876
|
import {
|
|
7762
|
-
useMemo as
|
|
7763
|
-
useState as
|
|
7877
|
+
useMemo as useMemo3,
|
|
7878
|
+
useState as useState19,
|
|
7764
7879
|
useEffect as useEffect12,
|
|
7765
7880
|
useRef as useRef7
|
|
7766
7881
|
} from "react";
|
|
7767
|
-
import { Paper as Paper12, Table as Table2, TableBody as TableBody3, TableContainer as TableContainer2, Box as
|
|
7882
|
+
import { Paper as Paper12, Table as Table2, TableBody as TableBody3, TableContainer as TableContainer2, Box as Box40 } from "@mui/material";
|
|
7768
7883
|
|
|
7769
7884
|
// src/components/TableDesktopLoadingState/TableDesktopLoadingState.tsx
|
|
7770
7885
|
import { Skeleton as Skeleton5, TableCell as TableCell3, TableRow as TableRow3 } from "@mui/material";
|
|
7771
|
-
import { jsx as
|
|
7886
|
+
import { jsx as jsx122 } from "react/jsx-runtime";
|
|
7772
7887
|
var getRange = (n) => Array.from({ length: n }, (_, i) => i + 1);
|
|
7773
7888
|
var TableDesktopLoadingState = ({
|
|
7774
7889
|
numRows,
|
|
7775
7890
|
numColumns,
|
|
7776
7891
|
rowHeight = 56
|
|
7777
7892
|
}) => {
|
|
7778
|
-
return getRange(numRows).map((rowNum) => /* @__PURE__ */
|
|
7893
|
+
return getRange(numRows).map((rowNum) => /* @__PURE__ */ jsx122(TableRow3, { children: getRange(numColumns).map((colNum) => /* @__PURE__ */ jsx122(TableCell3, { children: /* @__PURE__ */ jsx122(
|
|
7779
7894
|
Skeleton5,
|
|
7780
7895
|
{
|
|
7781
7896
|
animation: "pulse",
|
|
@@ -7791,13 +7906,13 @@ var TableDesktopLoadingState = ({
|
|
|
7791
7906
|
import TableBody2 from "@mui/material/TableBody";
|
|
7792
7907
|
import TableCell4 from "@mui/material/TableCell";
|
|
7793
7908
|
import TableRow4 from "@mui/material/TableRow";
|
|
7794
|
-
import
|
|
7909
|
+
import Typography31 from "@mui/material/Typography";
|
|
7795
7910
|
|
|
7796
7911
|
// src/components/Buttons/BaseButton/BaseIconButton.tsx
|
|
7797
7912
|
import { Button as Button16 } from "@mui/material";
|
|
7798
|
-
import { jsxs as
|
|
7913
|
+
import { jsxs as jsxs84 } from "react/jsx-runtime";
|
|
7799
7914
|
var BaseIconButton = ({ icon, sx, ...props }) => {
|
|
7800
|
-
return /* @__PURE__ */
|
|
7915
|
+
return /* @__PURE__ */ jsxs84(
|
|
7801
7916
|
Button16,
|
|
7802
7917
|
{
|
|
7803
7918
|
sx: {
|
|
@@ -7818,10 +7933,10 @@ var BaseIconButton = ({ icon, sx, ...props }) => {
|
|
|
7818
7933
|
};
|
|
7819
7934
|
|
|
7820
7935
|
// src/components/TableDesktopNoColumnsMessage/TableDesktopNoColumnsMessage.tsx
|
|
7821
|
-
import { jsx as
|
|
7936
|
+
import { jsx as jsx123, jsxs as jsxs85 } from "react/jsx-runtime";
|
|
7822
7937
|
var TableDesktopNoColumnsMessage = ({
|
|
7823
7938
|
onClickNoColumnsMessageOpenMenu
|
|
7824
|
-
}) => /* @__PURE__ */
|
|
7939
|
+
}) => /* @__PURE__ */ jsx123(TableBody2, { children: /* @__PURE__ */ jsx123(TableRow4, { children: /* @__PURE__ */ jsxs85(
|
|
7825
7940
|
TableCell4,
|
|
7826
7941
|
{
|
|
7827
7942
|
sx: {
|
|
@@ -7834,10 +7949,10 @@ var TableDesktopNoColumnsMessage = ({
|
|
|
7834
7949
|
alignItems: "center"
|
|
7835
7950
|
},
|
|
7836
7951
|
children: [
|
|
7837
|
-
/* @__PURE__ */
|
|
7838
|
-
/* @__PURE__ */
|
|
7839
|
-
/* @__PURE__ */
|
|
7840
|
-
|
|
7952
|
+
/* @__PURE__ */ jsx123(Typography31, { variant: "subtitle2", fontSize: 16, children: "Customise your view" }),
|
|
7953
|
+
/* @__PURE__ */ jsx123(Typography31, { variant: "subtitle1", align: "center", color: "textSecondary", children: "Open the menu to customise your table and search." }),
|
|
7954
|
+
/* @__PURE__ */ jsxs85(
|
|
7955
|
+
Typography31,
|
|
7841
7956
|
{
|
|
7842
7957
|
variant: "subtitle1",
|
|
7843
7958
|
align: "center",
|
|
@@ -7849,18 +7964,18 @@ var TableDesktopNoColumnsMessage = ({
|
|
|
7849
7964
|
},
|
|
7850
7965
|
children: [
|
|
7851
7966
|
"Tips: ",
|
|
7852
|
-
/* @__PURE__ */
|
|
7967
|
+
/* @__PURE__ */ jsx123(Typography31, { component: "strong", children: "Save as default" }),
|
|
7853
7968
|
" to keep these columns for future views"
|
|
7854
7969
|
]
|
|
7855
7970
|
}
|
|
7856
7971
|
),
|
|
7857
|
-
/* @__PURE__ */
|
|
7972
|
+
/* @__PURE__ */ jsx123(
|
|
7858
7973
|
BaseIconButton,
|
|
7859
7974
|
{
|
|
7860
7975
|
variant: "contained",
|
|
7861
7976
|
color: "primary",
|
|
7862
7977
|
onClick: onClickNoColumnsMessageOpenMenu,
|
|
7863
|
-
icon: /* @__PURE__ */
|
|
7978
|
+
icon: /* @__PURE__ */ jsx123(IconTableEdit_default, { fill: colors.white }),
|
|
7864
7979
|
children: "OPEN MENU"
|
|
7865
7980
|
}
|
|
7866
7981
|
)
|
|
@@ -7869,7 +7984,7 @@ var TableDesktopNoColumnsMessage = ({
|
|
|
7869
7984
|
) }) });
|
|
7870
7985
|
|
|
7871
7986
|
// src/components/TableDesktopRows/TableDesktopRows.tsx
|
|
7872
|
-
import { jsx as
|
|
7987
|
+
import { jsx as jsx124 } from "react/jsx-runtime";
|
|
7873
7988
|
var descendingComparator2 = (a, b, orderBy) => {
|
|
7874
7989
|
const objA = a[orderBy];
|
|
7875
7990
|
const objB = b[orderBy];
|
|
@@ -7901,7 +8016,7 @@ var TableDesktopRows = ({
|
|
|
7901
8016
|
data,
|
|
7902
8017
|
RenderItem,
|
|
7903
8018
|
visibleHeadCells,
|
|
7904
|
-
|
|
8019
|
+
getRowId,
|
|
7905
8020
|
order,
|
|
7906
8021
|
orderBy,
|
|
7907
8022
|
disableInternalSort,
|
|
@@ -7914,8 +8029,9 @@ var TableDesktopRows = ({
|
|
|
7914
8029
|
}) => {
|
|
7915
8030
|
const sortedData = disableInternalSort ? data : stableSort2(data, getComparator(order, orderBy));
|
|
7916
8031
|
return sortedData.map((row, index) => {
|
|
7917
|
-
const
|
|
7918
|
-
|
|
8032
|
+
const rowId = getRowId(row);
|
|
8033
|
+
const isItemSelected = selectedRows.has(rowId);
|
|
8034
|
+
return /* @__PURE__ */ jsx124(
|
|
7919
8035
|
RenderItem,
|
|
7920
8036
|
{
|
|
7921
8037
|
...{
|
|
@@ -7926,19 +8042,19 @@ var TableDesktopRows = ({
|
|
|
7926
8042
|
enableEditMode,
|
|
7927
8043
|
enableCheckboxSelection,
|
|
7928
8044
|
rowHeight,
|
|
7929
|
-
rowId
|
|
8045
|
+
rowId,
|
|
7930
8046
|
onRowCheckboxChange,
|
|
7931
8047
|
visibleHeadCells
|
|
7932
8048
|
}
|
|
7933
8049
|
},
|
|
7934
|
-
|
|
8050
|
+
rowId ?? index
|
|
7935
8051
|
);
|
|
7936
8052
|
});
|
|
7937
8053
|
};
|
|
7938
8054
|
|
|
7939
8055
|
// src/components/TableDesktopRowSelectionBar/TableDesktopRowSelectionBar.tsx
|
|
7940
|
-
import { Box as
|
|
7941
|
-
import { jsx as
|
|
8056
|
+
import { Box as Box39, Button as Button17, Typography as Typography32 } from "@mui/material";
|
|
8057
|
+
import { jsx as jsx125, jsxs as jsxs86 } from "react/jsx-runtime";
|
|
7942
8058
|
var TableDesktopRowSelectionBar = ({
|
|
7943
8059
|
isEveryRowInPageSelected,
|
|
7944
8060
|
isRowsFromAllPagesSelected,
|
|
@@ -7957,8 +8073,8 @@ var TableDesktopRowSelectionBar = ({
|
|
|
7957
8073
|
}
|
|
7958
8074
|
return `${numSelectedRows} row${numSelectedRows > 1 ? "s" : ""} selected.`;
|
|
7959
8075
|
};
|
|
7960
|
-
return isAnyRowSelected ? /* @__PURE__ */
|
|
7961
|
-
|
|
8076
|
+
return isAnyRowSelected ? /* @__PURE__ */ jsxs86(
|
|
8077
|
+
Box39,
|
|
7962
8078
|
{
|
|
7963
8079
|
sx: {
|
|
7964
8080
|
p: 1,
|
|
@@ -7970,22 +8086,22 @@ var TableDesktopRowSelectionBar = ({
|
|
|
7970
8086
|
backgroundColor: colors.neutral150
|
|
7971
8087
|
},
|
|
7972
8088
|
children: [
|
|
7973
|
-
/* @__PURE__ */
|
|
7974
|
-
!isRowsFromAllPagesSelected ? /* @__PURE__ */
|
|
8089
|
+
/* @__PURE__ */ jsx125(Typography32, { children: getSelectedRowsText() }),
|
|
8090
|
+
!isRowsFromAllPagesSelected ? /* @__PURE__ */ jsxs86(Button17, { onClick: onSelectRowsFromAllPagesClick, children: [
|
|
7975
8091
|
"Select all ",
|
|
7976
8092
|
totalRowCount,
|
|
7977
8093
|
" rows from all pages based on your filters"
|
|
7978
8094
|
] }) : null,
|
|
7979
|
-
/* @__PURE__ */
|
|
8095
|
+
/* @__PURE__ */ jsx125(Button17, { onClick: onClearSelectionClick, children: "Clear Selection" })
|
|
7980
8096
|
]
|
|
7981
8097
|
}
|
|
7982
8098
|
) : null;
|
|
7983
8099
|
};
|
|
7984
8100
|
|
|
7985
8101
|
// src/components/TableEmptyResult/TableEmptyResult.tsx
|
|
7986
|
-
import { TableCell as TableCell5, TableRow as TableRow5, Typography as
|
|
8102
|
+
import { TableCell as TableCell5, TableRow as TableRow5, Typography as Typography33 } from "@mui/material";
|
|
7987
8103
|
import { makeStyles as makeStyles46 } from "tss-react/mui";
|
|
7988
|
-
import { jsx as
|
|
8104
|
+
import { jsx as jsx126, jsxs as jsxs87 } from "react/jsx-runtime";
|
|
7989
8105
|
var useStyles46 = makeStyles46()(() => ({
|
|
7990
8106
|
tableCellIcon: { padding: 24, height: "calc(100vh - 320px)" },
|
|
7991
8107
|
tableCellDefault: { padding: 24 }
|
|
@@ -7997,17 +8113,17 @@ var TableEmptyResult = ({
|
|
|
7997
8113
|
}
|
|
7998
8114
|
}) => {
|
|
7999
8115
|
const { classes } = useStyles46();
|
|
8000
|
-
return showClearFilterButton ? /* @__PURE__ */
|
|
8116
|
+
return showClearFilterButton ? /* @__PURE__ */ jsx126(TableRow5, { children: /* @__PURE__ */ jsxs87(
|
|
8001
8117
|
TableCell5,
|
|
8002
8118
|
{
|
|
8003
8119
|
className: classes.tableCellIcon,
|
|
8004
8120
|
colSpan,
|
|
8005
8121
|
align: "center",
|
|
8006
8122
|
children: [
|
|
8007
|
-
/* @__PURE__ */
|
|
8008
|
-
/* @__PURE__ */
|
|
8009
|
-
/* @__PURE__ */
|
|
8010
|
-
/* @__PURE__ */
|
|
8123
|
+
/* @__PURE__ */ jsx126(EmptyGlassIcon_default, {}),
|
|
8124
|
+
/* @__PURE__ */ jsx126(Typography33, { variant: "h6", children: "No results found." }),
|
|
8125
|
+
/* @__PURE__ */ jsx126(Typography33, { variant: "subtitle1", children: "Search without applied filters?" }),
|
|
8126
|
+
/* @__PURE__ */ jsx126(
|
|
8011
8127
|
FilledButton_default,
|
|
8012
8128
|
{
|
|
8013
8129
|
copy: "Search",
|
|
@@ -8018,7 +8134,7 @@ var TableEmptyResult = ({
|
|
|
8018
8134
|
)
|
|
8019
8135
|
]
|
|
8020
8136
|
}
|
|
8021
|
-
) }) : /* @__PURE__ */
|
|
8137
|
+
) }) : /* @__PURE__ */ jsx126(TableRow5, { children: /* @__PURE__ */ jsx126(
|
|
8022
8138
|
TableCell5,
|
|
8023
8139
|
{
|
|
8024
8140
|
className: classes.tableCellDefault,
|
|
@@ -8031,7 +8147,13 @@ var TableEmptyResult = ({
|
|
|
8031
8147
|
var TableEmptyResult_default = TableEmptyResult;
|
|
8032
8148
|
|
|
8033
8149
|
// src/components/TableDesktop/TableDesktop.tsx
|
|
8034
|
-
import { Fragment as Fragment14, jsx as
|
|
8150
|
+
import { Fragment as Fragment14, jsx as jsx127, jsxs as jsxs88 } from "react/jsx-runtime";
|
|
8151
|
+
var resolveKeyValue = (keyField, rowData) => {
|
|
8152
|
+
if (typeof keyField === "string") {
|
|
8153
|
+
return rowData[keyField];
|
|
8154
|
+
}
|
|
8155
|
+
return keyField?.(rowData);
|
|
8156
|
+
};
|
|
8035
8157
|
var TableDesktop = ({
|
|
8036
8158
|
data = [],
|
|
8037
8159
|
headCells,
|
|
@@ -8059,23 +8181,23 @@ var TableDesktop = ({
|
|
|
8059
8181
|
refetchData
|
|
8060
8182
|
}) => {
|
|
8061
8183
|
const tableToolbarMenuButtonRef = useRef7(null);
|
|
8062
|
-
const [tableToolbarMenuAnchor, setTableToolbarMenuAnchor] =
|
|
8063
|
-
const [order, setOrder] =
|
|
8064
|
-
const [orderBy, setOrderBy] =
|
|
8184
|
+
const [tableToolbarMenuAnchor, setTableToolbarMenuAnchor] = useState19(null);
|
|
8185
|
+
const [order, setOrder] = useState19(appliedFilters?.sortDir || "desc");
|
|
8186
|
+
const [orderBy, setOrderBy] = useState19(
|
|
8065
8187
|
appliedFilters?.sortField || "delivery_date"
|
|
8066
8188
|
);
|
|
8067
|
-
const [selectedRows, setSelectedRows] =
|
|
8068
|
-
|
|
8069
|
-
);
|
|
8070
|
-
const [isRowsFromAllPagesSelected, setIsRowsFromAllPagesSelected] = useState18(false);
|
|
8071
|
-
const [isBulkChangesMode, setIsBulkChangesMode] = useState18(false);
|
|
8189
|
+
const [selectedRows, setSelectedRows] = useState19(/* @__PURE__ */ new Set());
|
|
8190
|
+
const [isRowsFromAllPagesSelected, setIsRowsFromAllPagesSelected] = useState19(false);
|
|
8191
|
+
const [isBulkChangesMode, setIsBulkChangesMode] = useState19(false);
|
|
8072
8192
|
const numRows = data.length;
|
|
8073
|
-
const numSelectedRows =
|
|
8074
|
-
const currentPageIds = new Set(
|
|
8193
|
+
const numSelectedRows = useMemo3(() => {
|
|
8194
|
+
const currentPageIds = new Set(
|
|
8195
|
+
data.map((row) => resolveKeyValue(keyField, row))
|
|
8196
|
+
);
|
|
8075
8197
|
return [...selectedRows].filter((id) => currentPageIds.has(id)).length;
|
|
8076
8198
|
}, [data, selectedRows, keyField]);
|
|
8077
8199
|
const isEveryRowInPageSelected = numRows > 0 && numSelectedRows === numRows;
|
|
8078
|
-
const visibleHeadCells =
|
|
8200
|
+
const visibleHeadCells = useMemo3(
|
|
8079
8201
|
() => headCells.filter((headCell) => headCell?.enabled ?? true),
|
|
8080
8202
|
[headCells]
|
|
8081
8203
|
);
|
|
@@ -8092,7 +8214,9 @@ var TableDesktop = ({
|
|
|
8092
8214
|
}
|
|
8093
8215
|
};
|
|
8094
8216
|
const selectAllRowsInPage = () => {
|
|
8095
|
-
const allRowsIds = new Set(
|
|
8217
|
+
const allRowsIds = new Set(
|
|
8218
|
+
data.map((row) => resolveKeyValue(keyField, row))
|
|
8219
|
+
);
|
|
8096
8220
|
setSelectedRows(allRowsIds);
|
|
8097
8221
|
};
|
|
8098
8222
|
const resetSelectedRows = () => {
|
|
@@ -8146,7 +8270,7 @@ var TableDesktop = ({
|
|
|
8146
8270
|
}, [isRowsFromAllPagesSelected, data]);
|
|
8147
8271
|
const renderBody = () => {
|
|
8148
8272
|
if (isLoading) {
|
|
8149
|
-
return /* @__PURE__ */
|
|
8273
|
+
return /* @__PURE__ */ jsx127(
|
|
8150
8274
|
TableDesktopLoadingState,
|
|
8151
8275
|
{
|
|
8152
8276
|
numRows: Math.min(rowsPerPage, 10),
|
|
@@ -8156,7 +8280,7 @@ var TableDesktop = ({
|
|
|
8156
8280
|
);
|
|
8157
8281
|
}
|
|
8158
8282
|
if (numRows === 0) {
|
|
8159
|
-
return /* @__PURE__ */
|
|
8283
|
+
return /* @__PURE__ */ jsx127(
|
|
8160
8284
|
TableEmptyResult_default,
|
|
8161
8285
|
{
|
|
8162
8286
|
showClearFilterButton,
|
|
@@ -8165,13 +8289,13 @@ var TableDesktop = ({
|
|
|
8165
8289
|
}
|
|
8166
8290
|
);
|
|
8167
8291
|
}
|
|
8168
|
-
return /* @__PURE__ */
|
|
8292
|
+
return /* @__PURE__ */ jsx127(
|
|
8169
8293
|
TableDesktopRows,
|
|
8170
8294
|
{
|
|
8171
8295
|
data,
|
|
8172
8296
|
RenderItem,
|
|
8173
8297
|
visibleHeadCells,
|
|
8174
|
-
keyField,
|
|
8298
|
+
getRowId: (rowData) => resolveKeyValue(keyField, rowData),
|
|
8175
8299
|
order,
|
|
8176
8300
|
orderBy,
|
|
8177
8301
|
disableInternalSort,
|
|
@@ -8184,8 +8308,8 @@ var TableDesktop = ({
|
|
|
8184
8308
|
}
|
|
8185
8309
|
);
|
|
8186
8310
|
};
|
|
8187
|
-
return /* @__PURE__ */
|
|
8188
|
-
|
|
8311
|
+
return /* @__PURE__ */ jsx127(
|
|
8312
|
+
Box40,
|
|
8189
8313
|
{
|
|
8190
8314
|
sx: {
|
|
8191
8315
|
height,
|
|
@@ -8193,7 +8317,7 @@ var TableDesktop = ({
|
|
|
8193
8317
|
justifyContent: "space-between",
|
|
8194
8318
|
justifyItems: "stretch"
|
|
8195
8319
|
},
|
|
8196
|
-
children: /* @__PURE__ */
|
|
8320
|
+
children: /* @__PURE__ */ jsxs88(
|
|
8197
8321
|
Paper12,
|
|
8198
8322
|
{
|
|
8199
8323
|
sx: {
|
|
@@ -8218,7 +8342,7 @@ var TableDesktop = ({
|
|
|
8218
8342
|
isBulkChangesMode,
|
|
8219
8343
|
onChangeBulkChangesMode: handleChangeBulkChangesMode
|
|
8220
8344
|
}) : null,
|
|
8221
|
-
/* @__PURE__ */
|
|
8345
|
+
/* @__PURE__ */ jsx127(
|
|
8222
8346
|
TableDesktopRowSelectionBar,
|
|
8223
8347
|
{
|
|
8224
8348
|
isEveryRowInPageSelected,
|
|
@@ -8229,7 +8353,7 @@ var TableDesktop = ({
|
|
|
8229
8353
|
onClearSelectionClick: handleClearSelectionClick
|
|
8230
8354
|
}
|
|
8231
8355
|
),
|
|
8232
|
-
/* @__PURE__ */
|
|
8356
|
+
/* @__PURE__ */ jsx127(
|
|
8233
8357
|
TableContainer2,
|
|
8234
8358
|
{
|
|
8235
8359
|
sx: {
|
|
@@ -8251,13 +8375,13 @@ var TableDesktop = ({
|
|
|
8251
8375
|
backgroundColor: (theme) => theme.palette.grey[500]
|
|
8252
8376
|
}
|
|
8253
8377
|
},
|
|
8254
|
-
children: /* @__PURE__ */
|
|
8378
|
+
children: /* @__PURE__ */ jsx127(Table2, { stickyHeader: true, "aria-label": "sticky-table", sx: { tableLayout }, children: visibleHeadCells.length === 0 ? /* @__PURE__ */ jsx127(
|
|
8255
8379
|
TableDesktopNoColumnsMessage,
|
|
8256
8380
|
{
|
|
8257
8381
|
onClickNoColumnsMessageOpenMenu: handleClickToolbarMenuOpen
|
|
8258
8382
|
}
|
|
8259
|
-
) : /* @__PURE__ */
|
|
8260
|
-
/* @__PURE__ */
|
|
8383
|
+
) : /* @__PURE__ */ jsxs88(Fragment14, { children: [
|
|
8384
|
+
/* @__PURE__ */ jsx127(
|
|
8261
8385
|
SmartTableHeader,
|
|
8262
8386
|
{
|
|
8263
8387
|
order,
|
|
@@ -8273,7 +8397,7 @@ var TableDesktop = ({
|
|
|
8273
8397
|
shouldShowCheckOnFilter
|
|
8274
8398
|
}
|
|
8275
8399
|
),
|
|
8276
|
-
/* @__PURE__ */
|
|
8400
|
+
/* @__PURE__ */ jsx127(TableBody3, { children: renderBody() })
|
|
8277
8401
|
] }) })
|
|
8278
8402
|
}
|
|
8279
8403
|
),
|
|
@@ -8290,99 +8414,142 @@ var TableDesktop = ({
|
|
|
8290
8414
|
};
|
|
8291
8415
|
|
|
8292
8416
|
// src/components/TableDesktopEditableField/TableDesktopEditableField.tsx
|
|
8293
|
-
import {
|
|
8417
|
+
import { useEffect as useEffect13, useState as useState22 } from "react";
|
|
8418
|
+
import DeleteIcon from "@mui/icons-material/Delete";
|
|
8419
|
+
import { Checkbox as Checkbox8, FormControlLabel as FormControlLabel5 } from "@mui/material";
|
|
8420
|
+
import { DatePicker, TimePicker } from "@mui/x-date-pickers";
|
|
8421
|
+
import moment2 from "moment";
|
|
8422
|
+
|
|
8423
|
+
// src/components/TableDesktopEditableField/TableDesktopSmartMultipleSelect.tsx
|
|
8424
|
+
import { useMemo as useMemo4 } from "react";
|
|
8425
|
+
import { jsx as jsx128 } from "react/jsx-runtime";
|
|
8426
|
+
var TableDesktopSmartMultipleSelect = ({
|
|
8427
|
+
initialValue,
|
|
8428
|
+
inputLabel,
|
|
8429
|
+
columnId,
|
|
8430
|
+
fieldName,
|
|
8431
|
+
rowId,
|
|
8432
|
+
disabled,
|
|
8433
|
+
variant = "standard",
|
|
8434
|
+
size,
|
|
8435
|
+
filterOptions,
|
|
8436
|
+
refetchFilterOptions,
|
|
8437
|
+
isFetchingFilterOptions,
|
|
8438
|
+
onUpdateEditableCell
|
|
8439
|
+
}) => {
|
|
8440
|
+
const defaultValues = useMemo4(() => {
|
|
8441
|
+
return initialValue?.map((val) => ({
|
|
8442
|
+
value: val.id,
|
|
8443
|
+
label: val[fieldName].toString()
|
|
8444
|
+
}));
|
|
8445
|
+
}, [initialValue]);
|
|
8446
|
+
return /* @__PURE__ */ jsx128(
|
|
8447
|
+
SmartMultipleSelect,
|
|
8448
|
+
{
|
|
8449
|
+
inputLabel,
|
|
8450
|
+
size,
|
|
8451
|
+
variant,
|
|
8452
|
+
disabled,
|
|
8453
|
+
defaultValues,
|
|
8454
|
+
menuOptions: filterOptions,
|
|
8455
|
+
isLoading: isFetchingFilterOptions,
|
|
8456
|
+
onOpen: () => {
|
|
8457
|
+
if (!filterOptions?.length) {
|
|
8458
|
+
refetchFilterOptions?.();
|
|
8459
|
+
}
|
|
8460
|
+
},
|
|
8461
|
+
onClose: (values) => {
|
|
8462
|
+
const optionsValues = values.map((option) => option.value ?? "");
|
|
8463
|
+
const optionsLabels = values.map((option) => option.label ?? "");
|
|
8464
|
+
onUpdateEditableCell?.({
|
|
8465
|
+
rowId,
|
|
8466
|
+
columnId,
|
|
8467
|
+
value: optionsValues,
|
|
8468
|
+
label: optionsLabels
|
|
8469
|
+
});
|
|
8470
|
+
}
|
|
8471
|
+
}
|
|
8472
|
+
);
|
|
8473
|
+
};
|
|
8294
8474
|
|
|
8295
8475
|
// src/components/TableDesktopEditableField/TableDesktopSmartSelect.tsx
|
|
8296
|
-
import { useState as
|
|
8297
|
-
import { jsx as
|
|
8298
|
-
var TableDesktopSmartSelect =
|
|
8299
|
-
|
|
8300
|
-
|
|
8301
|
-
|
|
8302
|
-
|
|
8303
|
-
|
|
8304
|
-
|
|
8305
|
-
|
|
8306
|
-
|
|
8307
|
-
|
|
8308
|
-
|
|
8309
|
-
|
|
8310
|
-
|
|
8311
|
-
|
|
8312
|
-
|
|
8313
|
-
|
|
8314
|
-
|
|
8315
|
-
|
|
8316
|
-
|
|
8317
|
-
|
|
8318
|
-
|
|
8319
|
-
|
|
8320
|
-
|
|
8321
|
-
|
|
8322
|
-
|
|
8323
|
-
|
|
8324
|
-
|
|
8325
|
-
|
|
8326
|
-
|
|
8327
|
-
|
|
8328
|
-
|
|
8329
|
-
|
|
8330
|
-
|
|
8331
|
-
|
|
8332
|
-
|
|
8333
|
-
|
|
8334
|
-
|
|
8335
|
-
|
|
8336
|
-
|
|
8337
|
-
|
|
8338
|
-
|
|
8339
|
-
|
|
8340
|
-
|
|
8341
|
-
|
|
8342
|
-
|
|
8343
|
-
|
|
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
|
-
}
|
|
8476
|
+
import { useState as useState20 } from "react";
|
|
8477
|
+
import { jsx as jsx129 } from "react/jsx-runtime";
|
|
8478
|
+
var TableDesktopSmartSelect = ({
|
|
8479
|
+
ref,
|
|
8480
|
+
initialValue,
|
|
8481
|
+
inputLabel,
|
|
8482
|
+
columnId,
|
|
8483
|
+
fieldName,
|
|
8484
|
+
rowId,
|
|
8485
|
+
disabled,
|
|
8486
|
+
variant = "standard",
|
|
8487
|
+
size,
|
|
8488
|
+
allowBlankOption,
|
|
8489
|
+
filterOptions,
|
|
8490
|
+
refetchFilterOptions,
|
|
8491
|
+
isFetchingFilterOptions,
|
|
8492
|
+
onUpdateEditableCell
|
|
8493
|
+
}) => {
|
|
8494
|
+
const [value, setValue] = useState20(
|
|
8495
|
+
initialValue
|
|
8496
|
+
);
|
|
8497
|
+
const valueId = resolveObjectType(value ?? "", "id");
|
|
8498
|
+
const valueLabel = resolveObjectType(value ?? "", fieldName);
|
|
8499
|
+
return /* @__PURE__ */ jsx129(
|
|
8500
|
+
SmartSelect_default,
|
|
8501
|
+
{
|
|
8502
|
+
ref,
|
|
8503
|
+
value: valueId,
|
|
8504
|
+
allowBlankOption,
|
|
8505
|
+
inputLabel,
|
|
8506
|
+
options: filterOptions,
|
|
8507
|
+
disabled,
|
|
8508
|
+
variant,
|
|
8509
|
+
size,
|
|
8510
|
+
refetch: refetchFilterOptions,
|
|
8511
|
+
isFetching: isFetchingFilterOptions,
|
|
8512
|
+
defaultOption: {
|
|
8513
|
+
value: valueId ?? "",
|
|
8514
|
+
label: String(valueLabel ?? "")
|
|
8515
|
+
},
|
|
8516
|
+
onChange: ({ value: id, label }) => {
|
|
8517
|
+
setValue({ id: id ?? "", name: label ?? "" });
|
|
8518
|
+
onUpdateEditableCell?.({
|
|
8519
|
+
rowId,
|
|
8520
|
+
columnId,
|
|
8521
|
+
value: id || null,
|
|
8522
|
+
label: label ?? ""
|
|
8523
|
+
});
|
|
8357
8524
|
}
|
|
8358
|
-
|
|
8359
|
-
|
|
8360
|
-
|
|
8525
|
+
}
|
|
8526
|
+
);
|
|
8527
|
+
};
|
|
8361
8528
|
|
|
8362
8529
|
// src/components/TableDesktopEditableField/TableDesktopTextField.tsx
|
|
8363
|
-
import { useMemo as useMemo5, useState as
|
|
8530
|
+
import { useMemo as useMemo5, useState as useState21, useRef as useRef8 } from "react";
|
|
8364
8531
|
import { TextField as TextField8 } from "@mui/material";
|
|
8365
|
-
import { jsx as
|
|
8532
|
+
import { jsx as jsx130 } from "react/jsx-runtime";
|
|
8366
8533
|
var TableDesktopTextField = ({
|
|
8367
8534
|
rowId,
|
|
8368
8535
|
initialValue,
|
|
8369
8536
|
inputLabel,
|
|
8370
8537
|
disabled,
|
|
8371
|
-
|
|
8538
|
+
columnId,
|
|
8372
8539
|
type,
|
|
8373
8540
|
variant = "standard",
|
|
8374
8541
|
size,
|
|
8375
8542
|
validateInput,
|
|
8376
8543
|
onUpdateEditableCell
|
|
8377
8544
|
}) => {
|
|
8378
|
-
const [input, setInput] =
|
|
8545
|
+
const [input, setInput] = useState21(initialValue);
|
|
8379
8546
|
const oldValue = useRef8(initialValue);
|
|
8380
8547
|
const isDirty = useMemo5(
|
|
8381
8548
|
() => input !== oldValue.current,
|
|
8382
8549
|
[input, oldValue.current]
|
|
8383
8550
|
);
|
|
8384
8551
|
const hasValidationError = useMemo5(
|
|
8385
|
-
() => isDirty && !validateInput
|
|
8552
|
+
() => isDirty && validateInput && !validateInput(input),
|
|
8386
8553
|
[input, validateInput]
|
|
8387
8554
|
);
|
|
8388
8555
|
const commitValue = (value) => {
|
|
@@ -8391,7 +8558,7 @@ var TableDesktopTextField = ({
|
|
|
8391
8558
|
return;
|
|
8392
8559
|
}
|
|
8393
8560
|
oldValue.current = value;
|
|
8394
|
-
onUpdateEditableCell(rowId
|
|
8561
|
+
onUpdateEditableCell({ rowId, columnId, value, label: value });
|
|
8395
8562
|
};
|
|
8396
8563
|
const handleKeyDown = (e) => {
|
|
8397
8564
|
if (e.key === "Enter") {
|
|
@@ -8399,7 +8566,7 @@ var TableDesktopTextField = ({
|
|
|
8399
8566
|
commitValue(input);
|
|
8400
8567
|
}
|
|
8401
8568
|
};
|
|
8402
|
-
return /* @__PURE__ */
|
|
8569
|
+
return /* @__PURE__ */ jsx130(
|
|
8403
8570
|
TextField8,
|
|
8404
8571
|
{
|
|
8405
8572
|
fullWidth: true,
|
|
@@ -8422,6 +8589,9 @@ var TableDesktopTextField = ({
|
|
|
8422
8589
|
slotProps: {
|
|
8423
8590
|
input: {
|
|
8424
8591
|
inputMode: type === "numeric" ? "numeric" : void 0
|
|
8592
|
+
},
|
|
8593
|
+
htmlInput: {
|
|
8594
|
+
maxLength: 1e3
|
|
8425
8595
|
}
|
|
8426
8596
|
}
|
|
8427
8597
|
}
|
|
@@ -8429,63 +8599,98 @@ var TableDesktopTextField = ({
|
|
|
8429
8599
|
};
|
|
8430
8600
|
|
|
8431
8601
|
// src/components/TableDesktopEditableField/TableDesktopEditableField.tsx
|
|
8432
|
-
import { jsx as
|
|
8602
|
+
import { jsx as jsx131 } from "react/jsx-runtime";
|
|
8433
8603
|
var TableDesktopEditableField = ({
|
|
8434
8604
|
editInitialValue,
|
|
8435
8605
|
rowId,
|
|
8436
|
-
field,
|
|
8437
|
-
fieldName,
|
|
8438
8606
|
disabled,
|
|
8439
|
-
inputLabel,
|
|
8440
8607
|
showCheckboxLabel = false,
|
|
8441
8608
|
variant = "standard",
|
|
8442
8609
|
size,
|
|
8443
|
-
|
|
8444
|
-
|
|
8445
|
-
|
|
8446
|
-
|
|
8447
|
-
|
|
8448
|
-
|
|
8610
|
+
onUpdateEditableCell,
|
|
8611
|
+
headCell: {
|
|
8612
|
+
id: columnId,
|
|
8613
|
+
fieldName = "",
|
|
8614
|
+
label: inputLabel = "",
|
|
8615
|
+
editableCellType,
|
|
8616
|
+
filterOptions,
|
|
8617
|
+
refetchFilterOptions,
|
|
8618
|
+
isFetchingFilterOptions,
|
|
8619
|
+
validateInput,
|
|
8620
|
+
allowBlankSelectOption
|
|
8621
|
+
}
|
|
8449
8622
|
}) => {
|
|
8623
|
+
const [parsedFilterOptions, setParsedFilterOptions] = useState22();
|
|
8624
|
+
useEffect13(() => {
|
|
8625
|
+
if (filterOptions && editableCellType === "select" || editableCellType === "multipleSelect") {
|
|
8626
|
+
const parsedOptions = filterOptions?.map(
|
|
8627
|
+
(option) => ({
|
|
8628
|
+
value: resolveObjectType(option, "id"),
|
|
8629
|
+
label: String(resolveObjectType(option, fieldName))
|
|
8630
|
+
})
|
|
8631
|
+
);
|
|
8632
|
+
setParsedFilterOptions(parsedOptions);
|
|
8633
|
+
}
|
|
8634
|
+
}, [filterOptions, editableCellType]);
|
|
8450
8635
|
const editableComponents = {
|
|
8451
|
-
select: /* @__PURE__ */
|
|
8636
|
+
select: /* @__PURE__ */ jsx131(
|
|
8452
8637
|
TableDesktopSmartSelect,
|
|
8453
8638
|
{
|
|
8454
8639
|
rowId,
|
|
8455
|
-
|
|
8640
|
+
columnId,
|
|
8456
8641
|
fieldName,
|
|
8457
8642
|
disabled,
|
|
8458
8643
|
variant,
|
|
8459
8644
|
size,
|
|
8645
|
+
allowBlankOption: allowBlankSelectOption,
|
|
8460
8646
|
initialValue: editInitialValue,
|
|
8461
8647
|
inputLabel,
|
|
8462
|
-
filterOptions,
|
|
8648
|
+
filterOptions: parsedFilterOptions,
|
|
8463
8649
|
refetchFilterOptions,
|
|
8464
8650
|
isFetchingFilterOptions,
|
|
8465
8651
|
onUpdateEditableCell
|
|
8466
8652
|
}
|
|
8467
8653
|
),
|
|
8468
|
-
|
|
8654
|
+
multipleSelect: /* @__PURE__ */ jsx131(
|
|
8655
|
+
TableDesktopSmartMultipleSelect,
|
|
8656
|
+
{
|
|
8657
|
+
rowId,
|
|
8658
|
+
columnId,
|
|
8659
|
+
fieldName,
|
|
8660
|
+
disabled,
|
|
8661
|
+
variant,
|
|
8662
|
+
size,
|
|
8663
|
+
initialValue: editInitialValue,
|
|
8664
|
+
inputLabel,
|
|
8665
|
+
filterOptions: parsedFilterOptions,
|
|
8666
|
+
refetchFilterOptions,
|
|
8667
|
+
isFetchingFilterOptions,
|
|
8668
|
+
onUpdateEditableCell
|
|
8669
|
+
}
|
|
8670
|
+
),
|
|
8671
|
+
checkbox: /* @__PURE__ */ jsx131(
|
|
8469
8672
|
FormControlLabel5,
|
|
8470
8673
|
{
|
|
8471
8674
|
label: showCheckboxLabel ? inputLabel : "",
|
|
8472
|
-
control: /* @__PURE__ */
|
|
8473
|
-
|
|
8675
|
+
control: /* @__PURE__ */ jsx131(
|
|
8676
|
+
Checkbox8,
|
|
8474
8677
|
{
|
|
8475
8678
|
disableRipple: true,
|
|
8476
8679
|
disabled,
|
|
8477
8680
|
defaultChecked: editInitialValue,
|
|
8478
8681
|
onChange: ({ target: { checked } }) => {
|
|
8479
|
-
|
|
8480
|
-
|
|
8481
|
-
|
|
8482
|
-
|
|
8682
|
+
onUpdateEditableCell?.({
|
|
8683
|
+
rowId,
|
|
8684
|
+
columnId,
|
|
8685
|
+
value: checked,
|
|
8686
|
+
label: checked
|
|
8687
|
+
});
|
|
8483
8688
|
}
|
|
8484
8689
|
}
|
|
8485
8690
|
)
|
|
8486
8691
|
}
|
|
8487
8692
|
),
|
|
8488
|
-
text: /* @__PURE__ */
|
|
8693
|
+
text: /* @__PURE__ */ jsx131(
|
|
8489
8694
|
TableDesktopTextField,
|
|
8490
8695
|
{
|
|
8491
8696
|
type: "text",
|
|
@@ -8493,14 +8698,14 @@ var TableDesktopEditableField = ({
|
|
|
8493
8698
|
disabled,
|
|
8494
8699
|
variant,
|
|
8495
8700
|
size,
|
|
8496
|
-
|
|
8701
|
+
columnId,
|
|
8497
8702
|
initialValue: editInitialValue ?? "",
|
|
8498
8703
|
inputLabel: inputLabel ?? "",
|
|
8499
8704
|
validateInput,
|
|
8500
8705
|
onUpdateEditableCell
|
|
8501
8706
|
}
|
|
8502
8707
|
),
|
|
8503
|
-
numeric: /* @__PURE__ */
|
|
8708
|
+
numeric: /* @__PURE__ */ jsx131(
|
|
8504
8709
|
TableDesktopTextField,
|
|
8505
8710
|
{
|
|
8506
8711
|
type: "numeric",
|
|
@@ -8508,29 +8713,88 @@ var TableDesktopEditableField = ({
|
|
|
8508
8713
|
disabled,
|
|
8509
8714
|
variant,
|
|
8510
8715
|
size,
|
|
8511
|
-
|
|
8716
|
+
columnId,
|
|
8512
8717
|
initialValue: editInitialValue ?? "",
|
|
8513
8718
|
inputLabel: inputLabel ?? "",
|
|
8514
8719
|
validateInput,
|
|
8515
8720
|
onUpdateEditableCell
|
|
8516
8721
|
}
|
|
8722
|
+
),
|
|
8723
|
+
date: /* @__PURE__ */ jsx131(
|
|
8724
|
+
DatePicker,
|
|
8725
|
+
{
|
|
8726
|
+
defaultValue: editInitialValue ? moment2(editInitialValue, "HH:mm:ss") : void 0,
|
|
8727
|
+
label: inputLabel,
|
|
8728
|
+
format: "DD/MM/YYYY",
|
|
8729
|
+
onAccept: (value) => {
|
|
8730
|
+
const formattedValue = value?.format("YYYY-MM-DD") ?? null;
|
|
8731
|
+
const formattedLabel = value?.format("DD/MM/YYYY") ?? null;
|
|
8732
|
+
onUpdateEditableCell?.({
|
|
8733
|
+
rowId,
|
|
8734
|
+
columnId,
|
|
8735
|
+
value: formattedValue,
|
|
8736
|
+
label: formattedLabel
|
|
8737
|
+
});
|
|
8738
|
+
},
|
|
8739
|
+
slots: { clearIcon: DeleteIcon },
|
|
8740
|
+
slotProps: {
|
|
8741
|
+
field: { clearable: true },
|
|
8742
|
+
clearButton: { sx: { p: 0.5 } },
|
|
8743
|
+
openPickerButton: { sx: { p: 0 } },
|
|
8744
|
+
textField: {
|
|
8745
|
+
variant,
|
|
8746
|
+
size,
|
|
8747
|
+
error: false
|
|
8748
|
+
}
|
|
8749
|
+
}
|
|
8750
|
+
}
|
|
8751
|
+
),
|
|
8752
|
+
time: /* @__PURE__ */ jsx131(
|
|
8753
|
+
TimePicker,
|
|
8754
|
+
{
|
|
8755
|
+
defaultValue: editInitialValue ? moment2(editInitialValue, "HH:mm:ss") : void 0,
|
|
8756
|
+
label: inputLabel,
|
|
8757
|
+
onAccept: (value) => {
|
|
8758
|
+
const formattedValue = value?.format("HH:mm") ?? null;
|
|
8759
|
+
onUpdateEditableCell?.({
|
|
8760
|
+
rowId,
|
|
8761
|
+
columnId,
|
|
8762
|
+
value: formattedValue,
|
|
8763
|
+
label: formattedValue
|
|
8764
|
+
});
|
|
8765
|
+
},
|
|
8766
|
+
slots: { clearIcon: DeleteIcon },
|
|
8767
|
+
slotProps: {
|
|
8768
|
+
field: { clearable: true },
|
|
8769
|
+
clearButton: { sx: { p: 0.5 } },
|
|
8770
|
+
openPickerButton: { sx: { p: 0 } },
|
|
8771
|
+
textField: {
|
|
8772
|
+
variant,
|
|
8773
|
+
size,
|
|
8774
|
+
error: false
|
|
8775
|
+
}
|
|
8776
|
+
}
|
|
8777
|
+
}
|
|
8517
8778
|
)
|
|
8518
8779
|
};
|
|
8780
|
+
if (!editableCellType) {
|
|
8781
|
+
return null;
|
|
8782
|
+
}
|
|
8519
8783
|
return editableComponents[editableCellType];
|
|
8520
8784
|
};
|
|
8521
8785
|
|
|
8522
8786
|
// src/components/TableDesktopFooter/TableDesktopFooter.tsx
|
|
8523
8787
|
import Refresh3 from "@mui/icons-material/Refresh";
|
|
8524
8788
|
import {
|
|
8525
|
-
Box as
|
|
8789
|
+
Box as Box41,
|
|
8526
8790
|
Button as Button18,
|
|
8527
8791
|
MenuItem as MenuItem4,
|
|
8528
8792
|
Pagination as Pagination2,
|
|
8529
|
-
Select as
|
|
8793
|
+
Select as Select5,
|
|
8530
8794
|
Stack,
|
|
8531
|
-
Typography as
|
|
8795
|
+
Typography as Typography34
|
|
8532
8796
|
} from "@mui/material";
|
|
8533
|
-
import { jsx as
|
|
8797
|
+
import { jsx as jsx132, jsxs as jsxs89 } from "react/jsx-runtime";
|
|
8534
8798
|
var TableDesktopFooter = ({
|
|
8535
8799
|
numPages,
|
|
8536
8800
|
page,
|
|
@@ -8541,8 +8805,8 @@ var TableDesktopFooter = ({
|
|
|
8541
8805
|
refetchData,
|
|
8542
8806
|
isFetching
|
|
8543
8807
|
}) => {
|
|
8544
|
-
return /* @__PURE__ */
|
|
8545
|
-
|
|
8808
|
+
return /* @__PURE__ */ jsxs89(
|
|
8809
|
+
Box41,
|
|
8546
8810
|
{
|
|
8547
8811
|
sx: {
|
|
8548
8812
|
py: 1,
|
|
@@ -8553,7 +8817,7 @@ var TableDesktopFooter = ({
|
|
|
8553
8817
|
borderTop: `1px solid ${colors.neutral300}`
|
|
8554
8818
|
},
|
|
8555
8819
|
children: [
|
|
8556
|
-
refetchData ? /* @__PURE__ */
|
|
8820
|
+
refetchData ? /* @__PURE__ */ jsxs89(
|
|
8557
8821
|
Button18,
|
|
8558
8822
|
{
|
|
8559
8823
|
disableRipple: true,
|
|
@@ -8568,7 +8832,7 @@ var TableDesktopFooter = ({
|
|
|
8568
8832
|
borderColor: colors.neutral600
|
|
8569
8833
|
},
|
|
8570
8834
|
children: [
|
|
8571
|
-
/* @__PURE__ */
|
|
8835
|
+
/* @__PURE__ */ jsx132(
|
|
8572
8836
|
Refresh3,
|
|
8573
8837
|
{
|
|
8574
8838
|
fontSize: "small",
|
|
@@ -8579,21 +8843,21 @@ var TableDesktopFooter = ({
|
|
|
8579
8843
|
]
|
|
8580
8844
|
}
|
|
8581
8845
|
) : null,
|
|
8582
|
-
/* @__PURE__ */
|
|
8583
|
-
pageSize && pageSizeOptions && onPageSizeChange ? /* @__PURE__ */
|
|
8584
|
-
/* @__PURE__ */
|
|
8585
|
-
/* @__PURE__ */
|
|
8586
|
-
|
|
8846
|
+
/* @__PURE__ */ jsxs89(Box41, { sx: { display: "flex", ml: "auto", py: 1 }, children: [
|
|
8847
|
+
pageSize && pageSizeOptions && onPageSizeChange ? /* @__PURE__ */ jsxs89(Stack, { direction: "row", spacing: 2, alignItems: "center", children: [
|
|
8848
|
+
/* @__PURE__ */ jsx132(Typography34, { children: "Rows per page:" }),
|
|
8849
|
+
/* @__PURE__ */ jsx132(
|
|
8850
|
+
Select5,
|
|
8587
8851
|
{
|
|
8588
8852
|
value: pageSize,
|
|
8589
8853
|
onChange: onPageSizeChange,
|
|
8590
8854
|
size: "small",
|
|
8591
8855
|
variant: "standard",
|
|
8592
|
-
children: pageSizeOptions.map((pageSizeOption) => /* @__PURE__ */
|
|
8856
|
+
children: pageSizeOptions.map((pageSizeOption) => /* @__PURE__ */ jsx132(MenuItem4, { value: pageSizeOption, children: pageSizeOption }, pageSizeOption))
|
|
8593
8857
|
}
|
|
8594
8858
|
)
|
|
8595
8859
|
] }) : null,
|
|
8596
|
-
/* @__PURE__ */
|
|
8860
|
+
/* @__PURE__ */ jsx132(
|
|
8597
8861
|
Pagination2,
|
|
8598
8862
|
{
|
|
8599
8863
|
color: "standard",
|
|
@@ -8609,15 +8873,15 @@ var TableDesktopFooter = ({
|
|
|
8609
8873
|
};
|
|
8610
8874
|
|
|
8611
8875
|
// src/components/TableDesktopCell/TableDesktopCell.tsx
|
|
8612
|
-
import { useEffect as useEffect14, useState as
|
|
8876
|
+
import { useEffect as useEffect14, useState as useState23 } from "react";
|
|
8613
8877
|
import CheckIcon3 from "@mui/icons-material/Check";
|
|
8614
8878
|
import CloseIcon from "@mui/icons-material/Close";
|
|
8615
8879
|
import EditIcon from "@mui/icons-material/Edit";
|
|
8616
|
-
import { IconButton as IconButton5, TableCell as TableCell6, Tooltip as
|
|
8617
|
-
import { Fragment as Fragment15, jsx as
|
|
8880
|
+
import { IconButton as IconButton5, TableCell as TableCell6, Tooltip as Tooltip10 } from "@mui/material";
|
|
8881
|
+
import { Fragment as Fragment15, jsx as jsx133, jsxs as jsxs90 } from "react/jsx-runtime";
|
|
8618
8882
|
var getReadOnlyBooleanIcon = (value) => {
|
|
8619
8883
|
if (value) {
|
|
8620
|
-
return /* @__PURE__ */
|
|
8884
|
+
return /* @__PURE__ */ jsx133(CheckIcon3, { sx: { fontSize: 16 } });
|
|
8621
8885
|
}
|
|
8622
8886
|
return "-";
|
|
8623
8887
|
};
|
|
@@ -8631,25 +8895,17 @@ var getCellBackgroundColor = (isCellInEditMode) => ({
|
|
|
8631
8895
|
background: isCellInEditMode ? colors.lightBlueBackground : colors.neutral100
|
|
8632
8896
|
});
|
|
8633
8897
|
var TableDesktopCell = ({
|
|
8634
|
-
inputLabel,
|
|
8635
8898
|
editInitialValue,
|
|
8636
8899
|
rowId,
|
|
8637
|
-
field,
|
|
8638
|
-
fieldName,
|
|
8639
|
-
width,
|
|
8640
|
-
enableEditMode,
|
|
8641
8900
|
disabled,
|
|
8901
|
+
enableEditMode,
|
|
8642
8902
|
readOnlyValue,
|
|
8643
|
-
|
|
8644
|
-
|
|
8645
|
-
refetchFilterOptions,
|
|
8646
|
-
isFetchingFilterOptions,
|
|
8647
|
-
validateInput,
|
|
8648
|
-
onUpdateEditableCell,
|
|
8649
|
-
onCellClick
|
|
8903
|
+
onCellClick,
|
|
8904
|
+
headCell
|
|
8650
8905
|
}) => {
|
|
8651
|
-
const [isCellHovered, setIsCellHovered] =
|
|
8652
|
-
const [isCellInEditMode, setIsCellInEditMode] =
|
|
8906
|
+
const [isCellHovered, setIsCellHovered] = useState23(false);
|
|
8907
|
+
const [isCellInEditMode, setIsCellInEditMode] = useState23(false);
|
|
8908
|
+
const { width, editableCellType } = headCell;
|
|
8653
8909
|
useEffect14(() => {
|
|
8654
8910
|
const handleKeyDown = (e) => {
|
|
8655
8911
|
if (e.key === "Escape") {
|
|
@@ -8657,10 +8913,10 @@ var TableDesktopCell = ({
|
|
|
8657
8913
|
}
|
|
8658
8914
|
};
|
|
8659
8915
|
if (isCellInEditMode) {
|
|
8660
|
-
|
|
8916
|
+
globalThis.addEventListener("keydown", handleKeyDown);
|
|
8661
8917
|
}
|
|
8662
8918
|
return () => {
|
|
8663
|
-
|
|
8919
|
+
globalThis.removeEventListener("keydown", handleKeyDown);
|
|
8664
8920
|
};
|
|
8665
8921
|
}, [isCellInEditMode]);
|
|
8666
8922
|
const handleEditClick = (e) => {
|
|
@@ -8668,7 +8924,7 @@ var TableDesktopCell = ({
|
|
|
8668
8924
|
setIsCellInEditMode((prev) => !prev);
|
|
8669
8925
|
};
|
|
8670
8926
|
const isCellEditable = !!enableEditMode && !!editableCellType && !disabled;
|
|
8671
|
-
return /* @__PURE__ */
|
|
8927
|
+
return /* @__PURE__ */ jsx133(
|
|
8672
8928
|
TableCell6,
|
|
8673
8929
|
{
|
|
8674
8930
|
align: "left",
|
|
@@ -8680,12 +8936,11 @@ var TableDesktopCell = ({
|
|
|
8680
8936
|
width: width ?? "auto",
|
|
8681
8937
|
position: "relative",
|
|
8682
8938
|
cursor: disabled || !enableEditMode ? "default" : "pointer",
|
|
8683
|
-
opacity: disabled ? 0.2 : 1,
|
|
8684
8939
|
":hover": isCellEditable ? getCellBackgroundColor(isCellInEditMode) : void 0,
|
|
8685
8940
|
background: enableEditMode && isCellInEditMode ? colors.lightBlueBackground : void 0
|
|
8686
8941
|
},
|
|
8687
|
-
children: /* @__PURE__ */
|
|
8688
|
-
enableEditMode && isCellHovered ? /* @__PURE__ */
|
|
8942
|
+
children: /* @__PURE__ */ jsx133(DynamicOverflowTooltip, { tooltipDescription: String(readOnlyValue), arrow: true, children: /* @__PURE__ */ jsxs90(Fragment15, { children: [
|
|
8943
|
+
enableEditMode && isCellHovered ? /* @__PURE__ */ jsx133(Tooltip10, { title: isCellInEditMode ? "" : "Toggle Edit Mode", children: /* @__PURE__ */ jsx133(
|
|
8689
8944
|
IconButton5,
|
|
8690
8945
|
{
|
|
8691
8946
|
onClick: handleEditClick,
|
|
@@ -8700,24 +8955,17 @@ var TableDesktopCell = ({
|
|
|
8700
8955
|
backgroundColor: isCellInEditMode ? colors.lightBlueBackground : colors.neutral150
|
|
8701
8956
|
}
|
|
8702
8957
|
},
|
|
8703
|
-
children: isCellInEditMode ? /* @__PURE__ */
|
|
8958
|
+
children: isCellInEditMode ? /* @__PURE__ */ jsx133(CloseIcon, { fontSize: "small", color: "error" }) : /* @__PURE__ */ jsx133(EditIcon, { fontSize: "small" })
|
|
8704
8959
|
}
|
|
8705
8960
|
) }) : null,
|
|
8706
|
-
enableEditMode && isCellInEditMode && editableCellType ? /* @__PURE__ */
|
|
8961
|
+
enableEditMode && isCellInEditMode && editableCellType ? /* @__PURE__ */ jsx133(
|
|
8707
8962
|
TableDesktopEditableField,
|
|
8708
8963
|
{
|
|
8709
8964
|
editInitialValue,
|
|
8710
8965
|
rowId,
|
|
8711
|
-
field,
|
|
8712
|
-
fieldName,
|
|
8713
8966
|
disabled,
|
|
8714
|
-
|
|
8715
|
-
|
|
8716
|
-
filterOptions,
|
|
8717
|
-
refetchFilterOptions,
|
|
8718
|
-
isFetchingFilterOptions,
|
|
8719
|
-
validateInput,
|
|
8720
|
-
onUpdateEditableCell
|
|
8967
|
+
headCell,
|
|
8968
|
+
onUpdateEditableCell: headCell.onUpdateEditableCell
|
|
8721
8969
|
}
|
|
8722
8970
|
) : renderReadOnlyValue(readOnlyValue)
|
|
8723
8971
|
] }) })
|
|
@@ -8727,7 +8975,7 @@ var TableDesktopCell = ({
|
|
|
8727
8975
|
|
|
8728
8976
|
// src/components/TableDesktopToolbar/TableDesktopToolbar.tsx
|
|
8729
8977
|
import {
|
|
8730
|
-
useState as
|
|
8978
|
+
useState as useState24,
|
|
8731
8979
|
useMemo as useMemo6,
|
|
8732
8980
|
useRef as useRef9
|
|
8733
8981
|
} from "react";
|
|
@@ -8735,16 +8983,16 @@ import Download from "@mui/icons-material/Download";
|
|
|
8735
8983
|
import KeyboardArrowLeft2 from "@mui/icons-material/KeyboardArrowLeft";
|
|
8736
8984
|
import KeyboardArrowRight2 from "@mui/icons-material/KeyboardArrowRight";
|
|
8737
8985
|
import {
|
|
8738
|
-
Box as
|
|
8986
|
+
Box as Box42,
|
|
8739
8987
|
Button as Button19,
|
|
8740
8988
|
Divider as Divider11,
|
|
8741
8989
|
FormControlLabel as FormControlLabel6,
|
|
8742
8990
|
IconButton as IconButton6,
|
|
8743
8991
|
Switch as Switch2,
|
|
8744
|
-
Tooltip as
|
|
8745
|
-
Typography as
|
|
8992
|
+
Tooltip as Tooltip11,
|
|
8993
|
+
Typography as Typography35
|
|
8746
8994
|
} from "@mui/material";
|
|
8747
|
-
import { Fragment as Fragment16, jsx as
|
|
8995
|
+
import { Fragment as Fragment16, jsx as jsx134, jsxs as jsxs91 } from "react/jsx-runtime";
|
|
8748
8996
|
var TableDesktopToolbar = ({
|
|
8749
8997
|
toolbarLabel,
|
|
8750
8998
|
headCells,
|
|
@@ -8767,10 +9015,10 @@ var TableDesktopToolbar = ({
|
|
|
8767
9015
|
renderInfoIcons
|
|
8768
9016
|
}) => {
|
|
8769
9017
|
const scrollRef = useRef9(null);
|
|
8770
|
-
const [bulkChanges, setBulkChanges] =
|
|
8771
|
-
const [isBulkChangesDialogOpen, setIsBulkChangesDialogOpen] =
|
|
8772
|
-
const [isExportCsvDialogOpen, setIsExportCsvDialogOpen] =
|
|
8773
|
-
const [resetCounter, setResetCounter] =
|
|
9018
|
+
const [bulkChanges, setBulkChanges] = useState24([]);
|
|
9019
|
+
const [isBulkChangesDialogOpen, setIsBulkChangesDialogOpen] = useState24(false);
|
|
9020
|
+
const [isExportCsvDialogOpen, setIsExportCsvDialogOpen] = useState24(false);
|
|
9021
|
+
const [resetCounter, setResetCounter] = useState24(0);
|
|
8774
9022
|
const visibleEditableColumns = useMemo6(
|
|
8775
9023
|
() => headCells.filter(
|
|
8776
9024
|
(headCell) => headCell?.enabled && !!headCell?.editableCellType
|
|
@@ -8788,13 +9036,17 @@ var TableDesktopToolbar = ({
|
|
|
8788
9036
|
refetchData?.();
|
|
8789
9037
|
}
|
|
8790
9038
|
};
|
|
8791
|
-
const handleUpdateEditableCell = (
|
|
9039
|
+
const handleUpdateEditableCell = ({
|
|
9040
|
+
columnId,
|
|
9041
|
+
value,
|
|
9042
|
+
label
|
|
9043
|
+
}) => {
|
|
8792
9044
|
setBulkChanges((prev) => {
|
|
8793
|
-
return [...prev, { field, value, label }];
|
|
9045
|
+
return [...prev, { field: columnId, value, label }];
|
|
8794
9046
|
});
|
|
8795
9047
|
};
|
|
8796
|
-
return /* @__PURE__ */
|
|
8797
|
-
|
|
9048
|
+
return /* @__PURE__ */ jsxs91(
|
|
9049
|
+
Box42,
|
|
8798
9050
|
{
|
|
8799
9051
|
sx: {
|
|
8800
9052
|
borderBottom: "1px solid",
|
|
@@ -8802,8 +9054,8 @@ var TableDesktopToolbar = ({
|
|
|
8802
9054
|
maxWidth: "100%"
|
|
8803
9055
|
},
|
|
8804
9056
|
children: [
|
|
8805
|
-
/* @__PURE__ */
|
|
8806
|
-
|
|
9057
|
+
/* @__PURE__ */ jsxs91(
|
|
9058
|
+
Box42,
|
|
8807
9059
|
{
|
|
8808
9060
|
sx: {
|
|
8809
9061
|
py: 1,
|
|
@@ -8814,8 +9066,8 @@ var TableDesktopToolbar = ({
|
|
|
8814
9066
|
background: isBulkChangesMode ? colors.neutral150 : void 0
|
|
8815
9067
|
},
|
|
8816
9068
|
children: [
|
|
8817
|
-
/* @__PURE__ */
|
|
8818
|
-
|
|
9069
|
+
/* @__PURE__ */ jsxs91(
|
|
9070
|
+
Box42,
|
|
8819
9071
|
{
|
|
8820
9072
|
sx: {
|
|
8821
9073
|
py: 1,
|
|
@@ -8825,20 +9077,20 @@ var TableDesktopToolbar = ({
|
|
|
8825
9077
|
whiteSpace: "nowrap"
|
|
8826
9078
|
},
|
|
8827
9079
|
children: [
|
|
8828
|
-
toolbarLabel ? /* @__PURE__ */
|
|
8829
|
-
/* @__PURE__ */
|
|
8830
|
-
/* @__PURE__ */
|
|
9080
|
+
toolbarLabel ? /* @__PURE__ */ jsxs91(Fragment16, { children: [
|
|
9081
|
+
/* @__PURE__ */ jsx134(Typography35, { variant: "subtitle2", color: "textSecondary", children: toolbarLabel }),
|
|
9082
|
+
/* @__PURE__ */ jsx134(Divider11, { orientation: "vertical", sx: { height: 0.75, py: 2.5 } })
|
|
8831
9083
|
] }) : null,
|
|
8832
|
-
renderBulkChangesDialog && refetchData ? /* @__PURE__ */
|
|
8833
|
-
|
|
9084
|
+
renderBulkChangesDialog && refetchData ? /* @__PURE__ */ jsx134(
|
|
9085
|
+
Tooltip11,
|
|
8834
9086
|
{
|
|
8835
9087
|
title: disableBulkChangesMode ? "Access denied, you don\u2019t have permission to use this feature." : "",
|
|
8836
|
-
children: /* @__PURE__ */
|
|
9088
|
+
children: /* @__PURE__ */ jsx134(
|
|
8837
9089
|
FormControlLabel6,
|
|
8838
9090
|
{
|
|
8839
9091
|
label: "Bulk Changes Mode",
|
|
8840
9092
|
disabled: disableBulkChangesMode || !visibleEditableColumns.length,
|
|
8841
|
-
control: /* @__PURE__ */
|
|
9093
|
+
control: /* @__PURE__ */ jsx134(
|
|
8842
9094
|
Switch2,
|
|
8843
9095
|
{
|
|
8844
9096
|
size: "small",
|
|
@@ -8853,17 +9105,17 @@ var TableDesktopToolbar = ({
|
|
|
8853
9105
|
]
|
|
8854
9106
|
}
|
|
8855
9107
|
),
|
|
8856
|
-
isScrollable && /* @__PURE__ */
|
|
9108
|
+
isScrollable && /* @__PURE__ */ jsx134(
|
|
8857
9109
|
IconButton6,
|
|
8858
9110
|
{
|
|
8859
9111
|
"aria-label": "scroll-left",
|
|
8860
9112
|
sx: { padding: 0, alignSelf: "center" },
|
|
8861
9113
|
onClick: () => scroll("left"),
|
|
8862
|
-
children: /* @__PURE__ */
|
|
9114
|
+
children: /* @__PURE__ */ jsx134(KeyboardArrowLeft2, {})
|
|
8863
9115
|
}
|
|
8864
9116
|
),
|
|
8865
|
-
/* @__PURE__ */
|
|
8866
|
-
|
|
9117
|
+
/* @__PURE__ */ jsx134(
|
|
9118
|
+
Box42,
|
|
8867
9119
|
{
|
|
8868
9120
|
ref: scrollRef,
|
|
8869
9121
|
sx: {
|
|
@@ -8879,55 +9131,39 @@ var TableDesktopToolbar = ({
|
|
|
8879
9131
|
display: "none"
|
|
8880
9132
|
}
|
|
8881
9133
|
},
|
|
8882
|
-
children: isBulkChangesMode ? visibleEditableColumns.map(
|
|
8883
|
-
|
|
8884
|
-
|
|
8885
|
-
|
|
8886
|
-
label,
|
|
8887
|
-
editableCellType,
|
|
8888
|
-
filterOptions,
|
|
8889
|
-
refetchFilterOptions,
|
|
8890
|
-
isFetchingFilterOptions,
|
|
8891
|
-
validateInput,
|
|
8892
|
-
width
|
|
8893
|
-
}) => editableCellType && /* @__PURE__ */ jsx132(
|
|
8894
|
-
Box41,
|
|
9134
|
+
children: isBulkChangesMode ? visibleEditableColumns.map((headCell) => {
|
|
9135
|
+
const { id, width, editableCellType } = headCell;
|
|
9136
|
+
return editableCellType && /* @__PURE__ */ jsx134(
|
|
9137
|
+
Box42,
|
|
8895
9138
|
{
|
|
8896
9139
|
sx: { width, flex: "0 0 auto" },
|
|
8897
|
-
children: /* @__PURE__ */
|
|
9140
|
+
children: /* @__PURE__ */ jsx134(
|
|
8898
9141
|
TableDesktopEditableField,
|
|
8899
9142
|
{
|
|
8900
|
-
|
|
9143
|
+
headCell,
|
|
8901
9144
|
size: "small",
|
|
8902
9145
|
variant: "outlined",
|
|
8903
9146
|
showCheckboxLabel: true,
|
|
8904
|
-
fieldName: fieldName ?? "",
|
|
8905
|
-
inputLabel: label ?? "",
|
|
8906
|
-
editableCellType,
|
|
8907
|
-
filterOptions,
|
|
8908
|
-
refetchFilterOptions,
|
|
8909
|
-
isFetchingFilterOptions,
|
|
8910
|
-
validateInput,
|
|
8911
9147
|
onUpdateEditableCell: handleUpdateEditableCell
|
|
8912
9148
|
}
|
|
8913
9149
|
)
|
|
8914
9150
|
},
|
|
8915
9151
|
`${id}-${resetCounter}`
|
|
8916
|
-
)
|
|
8917
|
-
) : null
|
|
9152
|
+
);
|
|
9153
|
+
}) : null
|
|
8918
9154
|
}
|
|
8919
9155
|
),
|
|
8920
|
-
isScrollable && /* @__PURE__ */
|
|
9156
|
+
isScrollable && /* @__PURE__ */ jsx134(
|
|
8921
9157
|
IconButton6,
|
|
8922
9158
|
{
|
|
8923
9159
|
"aria-label": "scroll-right",
|
|
8924
9160
|
sx: { p: 0, alignSelf: "center" },
|
|
8925
9161
|
onClick: () => scroll("right"),
|
|
8926
|
-
children: /* @__PURE__ */
|
|
9162
|
+
children: /* @__PURE__ */ jsx134(KeyboardArrowRight2, {})
|
|
8927
9163
|
}
|
|
8928
9164
|
),
|
|
8929
|
-
isBulkChangesMode ? /* @__PURE__ */
|
|
8930
|
-
/* @__PURE__ */
|
|
9165
|
+
isBulkChangesMode ? /* @__PURE__ */ jsxs91(Fragment16, { children: [
|
|
9166
|
+
/* @__PURE__ */ jsx134(
|
|
8931
9167
|
Button19,
|
|
8932
9168
|
{
|
|
8933
9169
|
variant: "outlined",
|
|
@@ -8940,7 +9176,7 @@ var TableDesktopToolbar = ({
|
|
|
8940
9176
|
children: "RESET"
|
|
8941
9177
|
}
|
|
8942
9178
|
),
|
|
8943
|
-
/* @__PURE__ */
|
|
9179
|
+
/* @__PURE__ */ jsx134(
|
|
8944
9180
|
Button19,
|
|
8945
9181
|
{
|
|
8946
9182
|
variant: "contained",
|
|
@@ -8951,26 +9187,26 @@ var TableDesktopToolbar = ({
|
|
|
8951
9187
|
children: "APPLY"
|
|
8952
9188
|
}
|
|
8953
9189
|
)
|
|
8954
|
-
] }) : /* @__PURE__ */
|
|
9190
|
+
] }) : /* @__PURE__ */ jsxs91(Box42, { sx: { display: "flex", alignItems: "center", gap: 1 }, children: [
|
|
8955
9191
|
renderInfoIcons,
|
|
8956
|
-
renderExportCsvDialog ? /* @__PURE__ */
|
|
9192
|
+
renderExportCsvDialog ? /* @__PURE__ */ jsx134(Tooltip11, { title: "Download List", children: /* @__PURE__ */ jsx134("span", { style: { display: "flex", alignItems: "center" }, children: /* @__PURE__ */ jsx134(
|
|
8957
9193
|
IconButton6,
|
|
8958
9194
|
{
|
|
8959
9195
|
disableRipple: true,
|
|
8960
9196
|
disabled: isDataEmpty,
|
|
8961
9197
|
"aria-label": "export-csv-button",
|
|
8962
9198
|
onClick: () => setIsExportCsvDialogOpen(true),
|
|
8963
|
-
children: /* @__PURE__ */
|
|
9199
|
+
children: /* @__PURE__ */ jsx134(Download, { fill: colors.neutral750 })
|
|
8964
9200
|
}
|
|
8965
9201
|
) }) }) : null,
|
|
8966
|
-
renderTableColumnConfigurationMenu ? /* @__PURE__ */
|
|
9202
|
+
renderTableColumnConfigurationMenu ? /* @__PURE__ */ jsx134(Tooltip11, { title: "Table Column Configuration", children: /* @__PURE__ */ jsx134(
|
|
8967
9203
|
IconButton6,
|
|
8968
9204
|
{
|
|
8969
9205
|
disableRipple: true,
|
|
8970
9206
|
"aria-label": "table-column-config-button",
|
|
8971
9207
|
ref: tableToolbarMenuButtonRef,
|
|
8972
9208
|
onClick: onClickToolbarMenuOpen,
|
|
8973
|
-
children: /* @__PURE__ */
|
|
9209
|
+
children: /* @__PURE__ */ jsx134(IconTableEdit_default, { fill: colors.neutral750 })
|
|
8974
9210
|
}
|
|
8975
9211
|
) }) : null
|
|
8976
9212
|
] })
|
|
@@ -9003,11 +9239,11 @@ var TableDesktopToolbar = ({
|
|
|
9003
9239
|
};
|
|
9004
9240
|
|
|
9005
9241
|
// src/components/TableHeader/TableHeader.tsx
|
|
9006
|
-
import { memo as
|
|
9242
|
+
import { memo as memo22, useEffect as useEffect15, useState as useState25 } from "react";
|
|
9007
9243
|
import { ImportExport as ImportExportIcon } from "@mui/icons-material";
|
|
9008
9244
|
import { TableCell as TableCell7, TableHead as TableHead3, TableRow as TableRow6, TableSortLabel as TableSortLabel3 } from "@mui/material";
|
|
9009
9245
|
import { makeStyles as makeStyles47 } from "tss-react/mui";
|
|
9010
|
-
import { jsx as
|
|
9246
|
+
import { jsx as jsx135 } from "react/jsx-runtime";
|
|
9011
9247
|
var useStyles47 = makeStyles47()(() => ({
|
|
9012
9248
|
sortLabel: {
|
|
9013
9249
|
"& .MuiTableSortLabel-icon": {
|
|
@@ -9016,7 +9252,7 @@ var useStyles47 = makeStyles47()(() => ({
|
|
|
9016
9252
|
}
|
|
9017
9253
|
}));
|
|
9018
9254
|
var TableHeader = ({ cells, onSort = null }) => {
|
|
9019
|
-
const [sortableCells, setSortableCells] =
|
|
9255
|
+
const [sortableCells, setSortableCells] = useState25([]);
|
|
9020
9256
|
const { classes } = useStyles47();
|
|
9021
9257
|
useEffect15(() => {
|
|
9022
9258
|
setSortableCells(cells);
|
|
@@ -9052,7 +9288,7 @@ var TableHeader = ({ cells, onSort = null }) => {
|
|
|
9052
9288
|
});
|
|
9053
9289
|
setSortableCells(sortedCells);
|
|
9054
9290
|
};
|
|
9055
|
-
return /* @__PURE__ */
|
|
9291
|
+
return /* @__PURE__ */ jsx135(TableHead3, { children: /* @__PURE__ */ jsx135(TableRow6, { children: sortableCells.map((cell, key) => /* @__PURE__ */ jsx135(TableCell7, { children: cell.isSortable ? /* @__PURE__ */ jsx135(
|
|
9056
9292
|
TableSortLabel3,
|
|
9057
9293
|
{
|
|
9058
9294
|
className: classes.sortLabel,
|
|
@@ -9063,12 +9299,12 @@ var TableHeader = ({ cells, onSort = null }) => {
|
|
|
9063
9299
|
}
|
|
9064
9300
|
) : cell.label }, cell.label || key)) }) });
|
|
9065
9301
|
};
|
|
9066
|
-
var TableHeader_default =
|
|
9302
|
+
var TableHeader_default = memo22(TableHeader);
|
|
9067
9303
|
|
|
9068
9304
|
// src/components/TextDivider/TextDivider.tsx
|
|
9069
|
-
import { Box as
|
|
9305
|
+
import { Box as Box43, Typography as Typography36, Divider as Divider12, Button as Button20 } from "@mui/material";
|
|
9070
9306
|
import { makeStyles as makeStyles48 } from "tss-react/mui";
|
|
9071
|
-
import { jsx as
|
|
9307
|
+
import { jsx as jsx136, jsxs as jsxs92 } from "react/jsx-runtime";
|
|
9072
9308
|
var useStyles48 = makeStyles48()(() => ({
|
|
9073
9309
|
icon: {
|
|
9074
9310
|
fontSize: 20
|
|
@@ -9105,19 +9341,19 @@ var TextDivider = ({
|
|
|
9105
9341
|
}) => {
|
|
9106
9342
|
const { classes } = useStyles48();
|
|
9107
9343
|
const iconColor = color ?? colors.neutral900;
|
|
9108
|
-
return /* @__PURE__ */
|
|
9109
|
-
|
|
9344
|
+
return /* @__PURE__ */ jsxs92(
|
|
9345
|
+
Box43,
|
|
9110
9346
|
{
|
|
9111
9347
|
display: "flex",
|
|
9112
9348
|
alignItems: "center",
|
|
9113
9349
|
justifyContent: "space-between",
|
|
9114
9350
|
className: classes.container,
|
|
9115
9351
|
children: [
|
|
9116
|
-
/* @__PURE__ */
|
|
9117
|
-
/* @__PURE__ */
|
|
9118
|
-
Icon2 && iconPosition === "left" && /* @__PURE__ */
|
|
9119
|
-
/* @__PURE__ */
|
|
9120
|
-
|
|
9352
|
+
/* @__PURE__ */ jsx136(Divider12, { className: classes.leftDivider }),
|
|
9353
|
+
/* @__PURE__ */ jsx136(Button20, { onClick, disabled: !onClick, className: classes.button, children: /* @__PURE__ */ jsxs92(Box43, { className: classes.center, children: [
|
|
9354
|
+
Icon2 && iconPosition === "left" && /* @__PURE__ */ jsx136(Icon2, { className: classes.icon, style: { color: iconColor } }),
|
|
9355
|
+
/* @__PURE__ */ jsx136(
|
|
9356
|
+
Typography36,
|
|
9121
9357
|
{
|
|
9122
9358
|
color: "textSecondary",
|
|
9123
9359
|
className: classes.title,
|
|
@@ -9125,9 +9361,9 @@ var TextDivider = ({
|
|
|
9125
9361
|
children: title
|
|
9126
9362
|
}
|
|
9127
9363
|
),
|
|
9128
|
-
Icon2 && iconPosition === "right" && /* @__PURE__ */
|
|
9364
|
+
Icon2 && iconPosition === "right" && /* @__PURE__ */ jsx136(Icon2, { className: classes.icon, style: { color: iconColor } })
|
|
9129
9365
|
] }) }),
|
|
9130
|
-
/* @__PURE__ */
|
|
9366
|
+
/* @__PURE__ */ jsx136(Divider12, { className: classes.rightDivider })
|
|
9131
9367
|
]
|
|
9132
9368
|
}
|
|
9133
9369
|
);
|
|
@@ -9139,7 +9375,7 @@ import { DateRangePicker } from "react-dates";
|
|
|
9139
9375
|
import { makeStyles as makeStyles49 } from "tss-react/mui";
|
|
9140
9376
|
import "react-dates/initialize";
|
|
9141
9377
|
import "react-dates/lib/css/_datepicker.css";
|
|
9142
|
-
import { jsx as
|
|
9378
|
+
import { jsx as jsx137 } from "react/jsx-runtime";
|
|
9143
9379
|
var useStyles49 = makeStyles49()((theme) => ({
|
|
9144
9380
|
wrapper: {
|
|
9145
9381
|
"& .DateRangePicker": {
|
|
@@ -9235,15 +9471,15 @@ var ThemedDateRangePicker = ({
|
|
|
9235
9471
|
...props
|
|
9236
9472
|
}) => {
|
|
9237
9473
|
const { classes, cx } = useStyles49();
|
|
9238
|
-
return /* @__PURE__ */
|
|
9474
|
+
return /* @__PURE__ */ jsx137("div", { className: cx(classes.wrapper, className), children: /* @__PURE__ */ jsx137(DateRangePicker, { ...props }) });
|
|
9239
9475
|
};
|
|
9240
9476
|
var ThemedDateRangePicker_default = ThemedDateRangePicker;
|
|
9241
9477
|
|
|
9242
9478
|
// src/components/TheToolbar/TheToolbar.tsx
|
|
9243
|
-
import { memo as
|
|
9244
|
-
import { AppBar, Box as
|
|
9479
|
+
import { memo as memo23 } from "react";
|
|
9480
|
+
import { AppBar, Box as Box44, Toolbar } from "@mui/material";
|
|
9245
9481
|
import { makeStyles as makeStyles50 } from "tss-react/mui";
|
|
9246
|
-
import { jsx as
|
|
9482
|
+
import { jsx as jsx138, jsxs as jsxs93 } from "react/jsx-runtime";
|
|
9247
9483
|
var useStyles50 = makeStyles50()((theme) => ({
|
|
9248
9484
|
menuButton: {
|
|
9249
9485
|
color: theme.palette.primary.contrastText
|
|
@@ -9263,9 +9499,9 @@ var TheToolbar = ({
|
|
|
9263
9499
|
rightSection
|
|
9264
9500
|
}) => {
|
|
9265
9501
|
const { classes } = useStyles50();
|
|
9266
|
-
return /* @__PURE__ */
|
|
9267
|
-
/* @__PURE__ */
|
|
9268
|
-
/* @__PURE__ */
|
|
9502
|
+
return /* @__PURE__ */ jsxs93(Box44, { children: [
|
|
9503
|
+
/* @__PURE__ */ jsx138(AppBar, { children: /* @__PURE__ */ jsxs93(Toolbar, { className: classes.topBar, children: [
|
|
9504
|
+
/* @__PURE__ */ jsx138(
|
|
9269
9505
|
RoundButton_default,
|
|
9270
9506
|
{
|
|
9271
9507
|
className: classes.menuButton,
|
|
@@ -9274,7 +9510,7 @@ var TheToolbar = ({
|
|
|
9274
9510
|
onClick: handleOpen
|
|
9275
9511
|
}
|
|
9276
9512
|
),
|
|
9277
|
-
/* @__PURE__ */
|
|
9513
|
+
/* @__PURE__ */ jsx138(
|
|
9278
9514
|
CompanyLogo_default,
|
|
9279
9515
|
{
|
|
9280
9516
|
size: "small",
|
|
@@ -9283,30 +9519,30 @@ var TheToolbar = ({
|
|
|
9283
9519
|
imageLogoLightSmall
|
|
9284
9520
|
}
|
|
9285
9521
|
),
|
|
9286
|
-
/* @__PURE__ */
|
|
9287
|
-
/* @__PURE__ */
|
|
9522
|
+
/* @__PURE__ */ jsx138(Box44, { ml: 2, children: leftSection }),
|
|
9523
|
+
/* @__PURE__ */ jsx138(Box44, { ml: "auto", children: rightSection })
|
|
9288
9524
|
] }) }),
|
|
9289
9525
|
LeftDrawer
|
|
9290
9526
|
] });
|
|
9291
9527
|
};
|
|
9292
|
-
var TheToolbar_default =
|
|
9528
|
+
var TheToolbar_default = memo23(TheToolbar);
|
|
9293
9529
|
|
|
9294
9530
|
// src/components/ToastMessage/ToastMessage.tsx
|
|
9295
9531
|
import { Alert as MuiAlert, Snackbar } from "@mui/material";
|
|
9296
|
-
import { jsx as
|
|
9532
|
+
import { jsx as jsx139 } from "react/jsx-runtime";
|
|
9297
9533
|
var ToastMessage = ({
|
|
9298
9534
|
toastType,
|
|
9299
9535
|
toastMessage,
|
|
9300
9536
|
open,
|
|
9301
9537
|
onClose
|
|
9302
|
-
}) => /* @__PURE__ */
|
|
9538
|
+
}) => /* @__PURE__ */ jsx139(
|
|
9303
9539
|
Snackbar,
|
|
9304
9540
|
{
|
|
9305
9541
|
open,
|
|
9306
9542
|
autoHideDuration: 1500,
|
|
9307
9543
|
onClose,
|
|
9308
9544
|
anchorOrigin: { vertical: "top", horizontal: "right" },
|
|
9309
|
-
children: /* @__PURE__ */
|
|
9545
|
+
children: /* @__PURE__ */ jsx139(
|
|
9310
9546
|
MuiAlert,
|
|
9311
9547
|
{
|
|
9312
9548
|
elevation: 6,
|
|
@@ -9334,16 +9570,16 @@ var ToastMessage_default = ToastMessage;
|
|
|
9334
9570
|
|
|
9335
9571
|
// src/components/TwoButtonDialog/TwoButtonDialog.tsx
|
|
9336
9572
|
import {
|
|
9337
|
-
Typography as
|
|
9573
|
+
Typography as Typography37,
|
|
9338
9574
|
Dialog as Dialog5,
|
|
9339
9575
|
Backdrop,
|
|
9340
|
-
Box as
|
|
9576
|
+
Box as Box45,
|
|
9341
9577
|
Divider as Divider13,
|
|
9342
9578
|
Paper as Paper13,
|
|
9343
9579
|
Fade as Fade2
|
|
9344
9580
|
} from "@mui/material";
|
|
9345
9581
|
import { makeStyles as makeStyles51 } from "tss-react/mui";
|
|
9346
|
-
import { jsx as
|
|
9582
|
+
import { jsx as jsx140, jsxs as jsxs94 } from "react/jsx-runtime";
|
|
9347
9583
|
var useStyles51 = makeStyles51()((theme) => ({
|
|
9348
9584
|
paper: {
|
|
9349
9585
|
padding: theme.spacing(2)
|
|
@@ -9373,7 +9609,7 @@ var TwoButtonDialog = ({
|
|
|
9373
9609
|
cancelButton
|
|
9374
9610
|
}) => {
|
|
9375
9611
|
const { classes } = useStyles51();
|
|
9376
|
-
return /* @__PURE__ */
|
|
9612
|
+
return /* @__PURE__ */ jsx140(
|
|
9377
9613
|
Dialog5,
|
|
9378
9614
|
{
|
|
9379
9615
|
open,
|
|
@@ -9383,10 +9619,10 @@ var TwoButtonDialog = ({
|
|
|
9383
9619
|
closeAfterTransition: true,
|
|
9384
9620
|
BackdropComponent: Backdrop,
|
|
9385
9621
|
BackdropProps: { timeout: 500 },
|
|
9386
|
-
children: /* @__PURE__ */
|
|
9387
|
-
/* @__PURE__ */
|
|
9388
|
-
/* @__PURE__ */
|
|
9389
|
-
|
|
9622
|
+
children: /* @__PURE__ */ jsx140(Fade2, { in: open, children: /* @__PURE__ */ jsxs94(Paper13, { className: classes.paper, children: [
|
|
9623
|
+
/* @__PURE__ */ jsxs94(Box45, { className: classes.mb, children: [
|
|
9624
|
+
/* @__PURE__ */ jsx140(Typography37, { variant: "h5", component: "div", children: /* @__PURE__ */ jsx140(
|
|
9625
|
+
Box45,
|
|
9390
9626
|
{
|
|
9391
9627
|
sx: {
|
|
9392
9628
|
fontWeight: 600
|
|
@@ -9394,23 +9630,23 @@ var TwoButtonDialog = ({
|
|
|
9394
9630
|
children: title
|
|
9395
9631
|
}
|
|
9396
9632
|
) }),
|
|
9397
|
-
/* @__PURE__ */
|
|
9398
|
-
|
|
9633
|
+
/* @__PURE__ */ jsxs94(
|
|
9634
|
+
Box45,
|
|
9399
9635
|
{
|
|
9400
9636
|
className: classes.mt,
|
|
9401
9637
|
sx: {
|
|
9402
9638
|
fontWeight: 600
|
|
9403
9639
|
},
|
|
9404
9640
|
children: [
|
|
9405
|
-
subtitle1 && /* @__PURE__ */
|
|
9406
|
-
subtitle2 && /* @__PURE__ */
|
|
9641
|
+
subtitle1 && /* @__PURE__ */ jsx140(Typography37, { variant: "subtitle1", children: subtitle1 }),
|
|
9642
|
+
subtitle2 && /* @__PURE__ */ jsx140(Typography37, { variant: "subtitle1", children: subtitle2 })
|
|
9407
9643
|
]
|
|
9408
9644
|
}
|
|
9409
9645
|
)
|
|
9410
9646
|
] }),
|
|
9411
|
-
/* @__PURE__ */
|
|
9412
|
-
/* @__PURE__ */
|
|
9413
|
-
/* @__PURE__ */
|
|
9647
|
+
/* @__PURE__ */ jsx140(Divider13, {}),
|
|
9648
|
+
/* @__PURE__ */ jsxs94(Box45, { className: classes.buttonContainer, children: [
|
|
9649
|
+
/* @__PURE__ */ jsx140(
|
|
9414
9650
|
FilledButton_default,
|
|
9415
9651
|
{
|
|
9416
9652
|
copy: cancelLabel,
|
|
@@ -9423,7 +9659,7 @@ var TwoButtonDialog = ({
|
|
|
9423
9659
|
}
|
|
9424
9660
|
}
|
|
9425
9661
|
),
|
|
9426
|
-
/* @__PURE__ */
|
|
9662
|
+
/* @__PURE__ */ jsx140(
|
|
9427
9663
|
FilledButton_default,
|
|
9428
9664
|
{
|
|
9429
9665
|
color: "primary",
|
|
@@ -9432,7 +9668,7 @@ var TwoButtonDialog = ({
|
|
|
9432
9668
|
}
|
|
9433
9669
|
)
|
|
9434
9670
|
] }),
|
|
9435
|
-
/* @__PURE__ */
|
|
9671
|
+
/* @__PURE__ */ jsx140(Loading_default, { isLoading: dialogLoading })
|
|
9436
9672
|
] }) })
|
|
9437
9673
|
}
|
|
9438
9674
|
);
|
|
@@ -9440,11 +9676,11 @@ var TwoButtonDialog = ({
|
|
|
9440
9676
|
var TwoButtonDialog_default = TwoButtonDialog;
|
|
9441
9677
|
|
|
9442
9678
|
// src/components/UserBust/UserBust.tsx
|
|
9443
|
-
import { memo as
|
|
9444
|
-
import { Avatar as Avatar2, Typography as
|
|
9445
|
-
import { jsx as
|
|
9446
|
-
var UserBust = ({ user, avatarProps, typographyProps }) => /* @__PURE__ */
|
|
9447
|
-
/* @__PURE__ */
|
|
9679
|
+
import { memo as memo24 } from "react";
|
|
9680
|
+
import { Avatar as Avatar2, Typography as Typography38 } from "@mui/material";
|
|
9681
|
+
import { jsx as jsx141, jsxs as jsxs95 } from "react/jsx-runtime";
|
|
9682
|
+
var UserBust = ({ user, avatarProps, typographyProps }) => /* @__PURE__ */ jsxs95("div", { children: [
|
|
9683
|
+
/* @__PURE__ */ jsx141(
|
|
9448
9684
|
Avatar2,
|
|
9449
9685
|
{
|
|
9450
9686
|
src: user.profile_picture,
|
|
@@ -9452,18 +9688,18 @@ var UserBust = ({ user, avatarProps, typographyProps }) => /* @__PURE__ */ jsxs9
|
|
|
9452
9688
|
style: { width: avatarProps.width, height: avatarProps.height }
|
|
9453
9689
|
}
|
|
9454
9690
|
),
|
|
9455
|
-
/* @__PURE__ */
|
|
9456
|
-
/* @__PURE__ */
|
|
9457
|
-
/* @__PURE__ */
|
|
9691
|
+
/* @__PURE__ */ jsxs95("div", { style: { paddingTop: 16 }, children: [
|
|
9692
|
+
/* @__PURE__ */ jsx141(Typography38, { ...typographyProps.name, children: `${user.first_name} ${user.last_name}` }),
|
|
9693
|
+
/* @__PURE__ */ jsx141(Typography38, { ...typographyProps.username, children: user.username })
|
|
9458
9694
|
] })
|
|
9459
9695
|
] });
|
|
9460
|
-
var UserBust_default =
|
|
9696
|
+
var UserBust_default = memo24(UserBust);
|
|
9461
9697
|
|
|
9462
9698
|
// src/components/icons/IconChart.tsx
|
|
9463
|
-
import { jsx as
|
|
9699
|
+
import { jsx as jsx142 } from "react/jsx-runtime";
|
|
9464
9700
|
var SvgIconChart = (props) => {
|
|
9465
9701
|
const { fill } = props;
|
|
9466
|
-
return /* @__PURE__ */
|
|
9702
|
+
return /* @__PURE__ */ jsx142(
|
|
9467
9703
|
"svg",
|
|
9468
9704
|
{
|
|
9469
9705
|
width: "20",
|
|
@@ -9472,7 +9708,7 @@ var SvgIconChart = (props) => {
|
|
|
9472
9708
|
fill: "none",
|
|
9473
9709
|
xmlns: "http://www.w3.org/2000/svg",
|
|
9474
9710
|
...props,
|
|
9475
|
-
children: /* @__PURE__ */
|
|
9711
|
+
children: /* @__PURE__ */ jsx142(
|
|
9476
9712
|
"path",
|
|
9477
9713
|
{
|
|
9478
9714
|
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",
|
|
@@ -9550,6 +9786,7 @@ export {
|
|
|
9550
9786
|
SearchWithFilters_default as SearchWithFilters,
|
|
9551
9787
|
SearchWithFiltersForTable_default as SearchWithFiltersForTable,
|
|
9552
9788
|
SectionName_default as SectionName,
|
|
9789
|
+
SmartMultipleSelect,
|
|
9553
9790
|
SmartSelect_default as SmartSelect,
|
|
9554
9791
|
SmartTableHeader,
|
|
9555
9792
|
SmartTableHeaderFilterMenu,
|