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