@natoora-libs/core 0.0.41 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/index.cjs +603 -225
- package/dist/components/index.cjs.map +1 -1
- package/dist/components/index.d.cts +85 -53
- package/dist/components/index.d.ts +85 -53
- package/dist/components/index.js +600 -203
- package/dist/components/index.js.map +1 -1
- package/package.json +2 -2
package/dist/components/index.js
CHANGED
|
@@ -361,7 +361,6 @@ var AlertDialog_default = AlertDialog;
|
|
|
361
361
|
// src/components/AlertDialogFullScreen/AlertDialogFullScreen.tsx
|
|
362
362
|
import { Button as Button2, Dialog as Dialog2, DialogActions, DialogContent } from "@mui/material";
|
|
363
363
|
import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
364
|
-
console.log("wqpkoe");
|
|
365
364
|
var AlertDialogFullScreen = ({
|
|
366
365
|
handleAlertAccept,
|
|
367
366
|
handleAlertReject,
|
|
@@ -4305,7 +4304,7 @@ var drawerAppList = [
|
|
|
4305
4304
|
featureNames: [featureName_default.CUSTOMERS],
|
|
4306
4305
|
pinned: "customers",
|
|
4307
4306
|
icon: /* @__PURE__ */ jsx83(icons_default.SvgIconAccount, {}),
|
|
4308
|
-
url: `/
|
|
4307
|
+
url: `/react/customers`,
|
|
4309
4308
|
children: [
|
|
4310
4309
|
{
|
|
4311
4310
|
name: "Sites",
|
|
@@ -6080,10 +6079,11 @@ var RenderContentList = ({
|
|
|
6080
6079
|
const sections = items.map((item) => ({
|
|
6081
6080
|
id: transformNameToID(item),
|
|
6082
6081
|
element: document.getElementById(transformNameToID(item))
|
|
6083
|
-
}));
|
|
6082
|
+
})).filter(({ element }) => element !== null);
|
|
6084
6083
|
if (observer.current) {
|
|
6085
6084
|
observer.current.disconnect();
|
|
6086
6085
|
}
|
|
6086
|
+
if (sections.length === 0) return;
|
|
6087
6087
|
observer.current = new IntersectionObserver(
|
|
6088
6088
|
(entries) => {
|
|
6089
6089
|
const visibleSection = entries.find((entry) => entry.isIntersecting);
|
|
@@ -6115,11 +6115,18 @@ var RenderContentList = ({
|
|
|
6115
6115
|
return /* @__PURE__ */ jsxs64(
|
|
6116
6116
|
ListItemButton2,
|
|
6117
6117
|
{
|
|
6118
|
-
component: "a",
|
|
6119
|
-
href: `#${id}`,
|
|
6120
|
-
onClick: () => setActive(id),
|
|
6121
6118
|
selected: active === id,
|
|
6122
6119
|
classes: { root: classes.root, selected: classes.selected },
|
|
6120
|
+
onClick: () => {
|
|
6121
|
+
setActive(id);
|
|
6122
|
+
const element = document.getElementById(id);
|
|
6123
|
+
if (element) {
|
|
6124
|
+
element.scrollIntoView({
|
|
6125
|
+
behavior: "smooth",
|
|
6126
|
+
block: "start"
|
|
6127
|
+
});
|
|
6128
|
+
}
|
|
6129
|
+
},
|
|
6123
6130
|
children: [
|
|
6124
6131
|
/* @__PURE__ */ jsx97(ListItemText5, { primary: item }),
|
|
6125
6132
|
warningItems?.includes(item) && /* @__PURE__ */ jsx97(Tooltip4, { title: warningMessage, children: /* @__PURE__ */ jsx97(WarningAmber, { color: "warning" }) })
|
|
@@ -7045,14 +7052,221 @@ var LabelledSwitch = withStyles6(LSwitch, (theme) => ({
|
|
|
7045
7052
|
}));
|
|
7046
7053
|
var Switch_default = memo20(LabelledSwitch);
|
|
7047
7054
|
|
|
7048
|
-
// src/components/
|
|
7049
|
-
import {
|
|
7050
|
-
import {
|
|
7055
|
+
// src/components/SmartTableHeaderFilterMenu/SmartTableHeaderFilterMenu.tsx
|
|
7056
|
+
import React4, { useState as useState15 } from "react";
|
|
7057
|
+
import { FilterList } from "@mui/icons-material";
|
|
7058
|
+
import {
|
|
7059
|
+
Box as Box28,
|
|
7060
|
+
Checkbox as Checkbox4,
|
|
7061
|
+
Chip as Chip2,
|
|
7062
|
+
Divider as Divider9,
|
|
7063
|
+
FormControl as FormControl5,
|
|
7064
|
+
FormControlLabel as FormControlLabel3,
|
|
7065
|
+
FormHelperText as FormHelperText4,
|
|
7066
|
+
IconButton as IconButton3,
|
|
7067
|
+
Menu as Menu4
|
|
7068
|
+
} from "@mui/material";
|
|
7069
|
+
import classNames3 from "classnames";
|
|
7051
7070
|
import { makeStyles as makeStyles44 } from "tss-react/mui";
|
|
7052
|
-
import { jsx as jsx108, jsxs as jsxs74 } from "react/jsx-runtime";
|
|
7053
|
-
var useStyles44 = makeStyles44()(() => ({
|
|
7071
|
+
import { Fragment as Fragment12, jsx as jsx108, jsxs as jsxs74 } from "react/jsx-runtime";
|
|
7072
|
+
var useStyles44 = makeStyles44()((theme) => ({
|
|
7073
|
+
filterMenu: {
|
|
7074
|
+
display: "flex",
|
|
7075
|
+
flexDirection: "column",
|
|
7076
|
+
gap: theme.spacing(0.5)
|
|
7077
|
+
},
|
|
7078
|
+
filterCheckboxDropdown: {
|
|
7079
|
+
display: "flex",
|
|
7080
|
+
flexDirection: "column",
|
|
7081
|
+
padding: theme.spacing(0, 3)
|
|
7082
|
+
},
|
|
7083
|
+
applyFilterButtonsContainer: {
|
|
7084
|
+
display: "flex",
|
|
7085
|
+
padding: theme.spacing(0, 1)
|
|
7086
|
+
}
|
|
7087
|
+
}));
|
|
7088
|
+
var resolveFilterOption = (filterOption) => {
|
|
7089
|
+
if (typeof filterOption === "object") {
|
|
7090
|
+
return filterOption?.label || filterOption?.name || "";
|
|
7091
|
+
}
|
|
7092
|
+
return filterOption;
|
|
7093
|
+
};
|
|
7094
|
+
var findFilterIndex = (filters, filterOption) => filters.findIndex((item) => {
|
|
7095
|
+
if (typeof item === "string" && typeof filterOption === "string") {
|
|
7096
|
+
return item === filterOption;
|
|
7097
|
+
}
|
|
7098
|
+
if (typeof item === "object" && typeof filterOption === "object") {
|
|
7099
|
+
return item.id === filterOption.id;
|
|
7100
|
+
}
|
|
7101
|
+
return false;
|
|
7102
|
+
});
|
|
7103
|
+
var SmartTableHeaderFilterMenu = ({
|
|
7104
|
+
headCell,
|
|
7105
|
+
hasActiveFilters,
|
|
7106
|
+
headerFilters,
|
|
7107
|
+
onApplyFilters
|
|
7108
|
+
}) => {
|
|
7109
|
+
const { classes } = useStyles44();
|
|
7110
|
+
const [anchorEl, setAnchorEl] = useState15(null);
|
|
7111
|
+
const [shouldSave, setShouldSave] = useState15(false);
|
|
7112
|
+
const [selectedFilters, setSelectedFilters] = useState15(
|
|
7113
|
+
headerFilters[headCell.id] ?? []
|
|
7114
|
+
);
|
|
7115
|
+
const handleFilterMenuOpen = (event) => {
|
|
7116
|
+
if (!headCell.filterOptionsQuery?.data?.length) {
|
|
7117
|
+
headCell.filterOptionsQuery?.refetch();
|
|
7118
|
+
}
|
|
7119
|
+
setAnchorEl(event.currentTarget);
|
|
7120
|
+
};
|
|
7121
|
+
const handleFilterMenuClose = () => {
|
|
7122
|
+
setSelectedFilters(headerFilters[headCell.id]);
|
|
7123
|
+
setAnchorEl(null);
|
|
7124
|
+
setShouldSave(false);
|
|
7125
|
+
};
|
|
7126
|
+
const handleFilterOptionClick = (option) => {
|
|
7127
|
+
const selectedIndex = findFilterIndex(selectedFilters, option);
|
|
7128
|
+
let newSelected;
|
|
7129
|
+
if (selectedIndex === -1) {
|
|
7130
|
+
if (typeof option === "string") {
|
|
7131
|
+
newSelected = [...selectedFilters, option];
|
|
7132
|
+
} else {
|
|
7133
|
+
newSelected = [...selectedFilters, option];
|
|
7134
|
+
}
|
|
7135
|
+
} else {
|
|
7136
|
+
newSelected = selectedFilters.filter(
|
|
7137
|
+
(_, index) => index !== selectedIndex
|
|
7138
|
+
);
|
|
7139
|
+
}
|
|
7140
|
+
setSelectedFilters(newSelected);
|
|
7141
|
+
};
|
|
7142
|
+
return /* @__PURE__ */ jsxs74(Fragment12, { children: [
|
|
7143
|
+
/* @__PURE__ */ jsx108(
|
|
7144
|
+
IconButton3,
|
|
7145
|
+
{
|
|
7146
|
+
disableRipple: true,
|
|
7147
|
+
onClick: handleFilterMenuOpen,
|
|
7148
|
+
"data-testid": "filter-menu-button",
|
|
7149
|
+
style: { padding: 0 },
|
|
7150
|
+
className: classNames3("filter-menu-trigger", {
|
|
7151
|
+
"has-active-filters": hasActiveFilters
|
|
7152
|
+
}),
|
|
7153
|
+
children: hasActiveFilters ? /* @__PURE__ */ jsx108(
|
|
7154
|
+
Chip2,
|
|
7155
|
+
{
|
|
7156
|
+
sx: { height: 24 },
|
|
7157
|
+
label: headerFilters[headCell.id]?.length,
|
|
7158
|
+
icon: /* @__PURE__ */ jsx108(FilterList, { style: { fontSize: 18 }, color: "primary" })
|
|
7159
|
+
}
|
|
7160
|
+
) : /* @__PURE__ */ jsx108(FilterList, { style: { fontSize: 18 } })
|
|
7161
|
+
}
|
|
7162
|
+
),
|
|
7163
|
+
/* @__PURE__ */ jsx108(
|
|
7164
|
+
Menu4,
|
|
7165
|
+
{
|
|
7166
|
+
open: !!anchorEl,
|
|
7167
|
+
onClose: handleFilterMenuClose,
|
|
7168
|
+
anchorEl,
|
|
7169
|
+
"data-testid": "filter-menu",
|
|
7170
|
+
anchorOrigin: { vertical: "bottom", horizontal: "right" },
|
|
7171
|
+
transformOrigin: { vertical: "top", horizontal: "right" },
|
|
7172
|
+
children: /* @__PURE__ */ jsxs74(Box28, { className: classes.filterMenu, children: [
|
|
7173
|
+
headCell.filterOptionsQuery?.data?.map(
|
|
7174
|
+
(option) => {
|
|
7175
|
+
const resolvedOption = resolveFilterOption(option);
|
|
7176
|
+
return /* @__PURE__ */ jsx108(
|
|
7177
|
+
FormControl5,
|
|
7178
|
+
{
|
|
7179
|
+
className: classes.filterCheckboxDropdown,
|
|
7180
|
+
children: /* @__PURE__ */ jsx108(
|
|
7181
|
+
FormControlLabel3,
|
|
7182
|
+
{
|
|
7183
|
+
label: resolvedOption,
|
|
7184
|
+
control: /* @__PURE__ */ jsx108(
|
|
7185
|
+
Checkbox4,
|
|
7186
|
+
{
|
|
7187
|
+
disableRipple: true,
|
|
7188
|
+
onChange: () => handleFilterOptionClick(option),
|
|
7189
|
+
checked: selectedFilters?.some(
|
|
7190
|
+
(value) => resolveFilterOption(value) === resolvedOption
|
|
7191
|
+
) ?? false
|
|
7192
|
+
}
|
|
7193
|
+
)
|
|
7194
|
+
}
|
|
7195
|
+
)
|
|
7196
|
+
},
|
|
7197
|
+
resolvedOption
|
|
7198
|
+
);
|
|
7199
|
+
}
|
|
7200
|
+
),
|
|
7201
|
+
/* @__PURE__ */ jsx108(Divider9, {}),
|
|
7202
|
+
/* @__PURE__ */ jsxs74(FormControl5, { className: classes.filterCheckboxDropdown, children: [
|
|
7203
|
+
/* @__PURE__ */ jsx108(
|
|
7204
|
+
FormControlLabel3,
|
|
7205
|
+
{
|
|
7206
|
+
label: "Save Filters",
|
|
7207
|
+
control: /* @__PURE__ */ jsx108(
|
|
7208
|
+
Checkbox4,
|
|
7209
|
+
{
|
|
7210
|
+
disableRipple: true,
|
|
7211
|
+
checked: shouldSave,
|
|
7212
|
+
onChange: (e) => setShouldSave(e.target.checked)
|
|
7213
|
+
}
|
|
7214
|
+
)
|
|
7215
|
+
}
|
|
7216
|
+
),
|
|
7217
|
+
/* @__PURE__ */ jsx108(FormHelperText4, { sx: { margin: 0 }, children: "Filters auto-apply on return." })
|
|
7218
|
+
] }),
|
|
7219
|
+
/* @__PURE__ */ jsx108(Divider9, {}),
|
|
7220
|
+
/* @__PURE__ */ jsxs74(Box28, { className: classes.applyFilterButtonsContainer, children: [
|
|
7221
|
+
/* @__PURE__ */ jsx108(
|
|
7222
|
+
ExtendedButton_default,
|
|
7223
|
+
{
|
|
7224
|
+
buttonType: "button",
|
|
7225
|
+
copy: "Deselect All",
|
|
7226
|
+
variant: "text",
|
|
7227
|
+
onClick: () => setSelectedFilters([])
|
|
7228
|
+
}
|
|
7229
|
+
),
|
|
7230
|
+
/* @__PURE__ */ jsx108(
|
|
7231
|
+
ExtendedButton_default,
|
|
7232
|
+
{
|
|
7233
|
+
copy: "Apply",
|
|
7234
|
+
color: "primary",
|
|
7235
|
+
buttonType: "submit",
|
|
7236
|
+
onClick: () => {
|
|
7237
|
+
const updatedFilters = {
|
|
7238
|
+
...headerFilters,
|
|
7239
|
+
[headCell.id]: [...selectedFilters]
|
|
7240
|
+
};
|
|
7241
|
+
onApplyFilters?.(updatedFilters, shouldSave);
|
|
7242
|
+
setAnchorEl(null);
|
|
7243
|
+
setShouldSave(false);
|
|
7244
|
+
}
|
|
7245
|
+
}
|
|
7246
|
+
)
|
|
7247
|
+
] })
|
|
7248
|
+
] })
|
|
7249
|
+
}
|
|
7250
|
+
)
|
|
7251
|
+
] });
|
|
7252
|
+
};
|
|
7253
|
+
var SmartTableHeaderFilterMenu_default = React4.memo(SmartTableHeaderFilterMenu);
|
|
7254
|
+
|
|
7255
|
+
// src/components/SmartTableHeader/SmartTableHeader.tsx
|
|
7256
|
+
import { memo as memo21 } from "react";
|
|
7257
|
+
import {
|
|
7258
|
+
Checkbox as Checkbox5,
|
|
7259
|
+
TableCell,
|
|
7260
|
+
TableHead,
|
|
7261
|
+
TableRow,
|
|
7262
|
+
TableSortLabel
|
|
7263
|
+
} from "@mui/material";
|
|
7264
|
+
import { makeStyles as makeStyles45 } from "tss-react/mui";
|
|
7265
|
+
import { jsx as jsx109, jsxs as jsxs75 } from "react/jsx-runtime";
|
|
7266
|
+
var useStyles45 = makeStyles45()((theme) => ({
|
|
7054
7267
|
root: {
|
|
7055
7268
|
backgroundColor: colors.neutral100,
|
|
7269
|
+
height: theme.spacing(6),
|
|
7056
7270
|
"& .MuiTableSortLabel-root": {
|
|
7057
7271
|
fontWeight: 600,
|
|
7058
7272
|
fontSize: ".875rem"
|
|
@@ -7069,49 +7283,109 @@ var useStyles44 = makeStyles44()(() => ({
|
|
|
7069
7283
|
top: 20,
|
|
7070
7284
|
width: 1
|
|
7071
7285
|
},
|
|
7072
|
-
|
|
7286
|
+
tableHeaderContent: {
|
|
7073
7287
|
borderBottom: "1px solid",
|
|
7074
7288
|
borderBottomColor: colors.neutral250,
|
|
7075
|
-
|
|
7076
|
-
|
|
7077
|
-
|
|
7289
|
+
whiteSpace: "nowrap",
|
|
7290
|
+
"& .filter-menu-trigger": {
|
|
7291
|
+
visibility: "hidden",
|
|
7292
|
+
opacity: 0,
|
|
7293
|
+
transition: "visibility 0.1s, opacity 0.1s ease-in"
|
|
7294
|
+
},
|
|
7295
|
+
"&:hover .filter-menu-trigger, & .filter-menu-trigger.has-active-filters": {
|
|
7296
|
+
visibility: "visible",
|
|
7297
|
+
opacity: 1
|
|
7298
|
+
},
|
|
7299
|
+
"&:hover .MuiTableSortLabel-root": {
|
|
7300
|
+
"& .MuiTableSortLabel-icon": {
|
|
7301
|
+
opacity: 1
|
|
7302
|
+
}
|
|
7303
|
+
}
|
|
7304
|
+
},
|
|
7305
|
+
filterMenu: {
|
|
7306
|
+
display: "flex",
|
|
7307
|
+
flexDirection: "column",
|
|
7308
|
+
gap: theme.spacing(0.5)
|
|
7309
|
+
},
|
|
7310
|
+
filterCheckboxDropdown: {
|
|
7311
|
+
display: "flex",
|
|
7312
|
+
flexDirection: "column",
|
|
7313
|
+
padding: theme.spacing(0, 3)
|
|
7314
|
+
},
|
|
7315
|
+
applyFilterButtonsContainer: {
|
|
7316
|
+
display: "flex",
|
|
7317
|
+
padding: theme.spacing(0, 1)
|
|
7078
7318
|
}
|
|
7079
7319
|
}));
|
|
7080
|
-
var SmartTableHeader = (
|
|
7081
|
-
|
|
7082
|
-
|
|
7320
|
+
var SmartTableHeader = ({
|
|
7321
|
+
order,
|
|
7322
|
+
orderBy,
|
|
7323
|
+
headCells,
|
|
7324
|
+
numSelected,
|
|
7325
|
+
numRows,
|
|
7326
|
+
enableCheckboxSelection = false,
|
|
7327
|
+
headerFilters,
|
|
7328
|
+
onRequestSort,
|
|
7329
|
+
onSelectAllClick,
|
|
7330
|
+
onApplyFilters
|
|
7331
|
+
}) => {
|
|
7332
|
+
const { classes } = useStyles45();
|
|
7083
7333
|
const createSortHandler = (property) => (event) => {
|
|
7084
|
-
onRequestSort
|
|
7334
|
+
onRequestSort(event, property);
|
|
7085
7335
|
};
|
|
7086
|
-
|
|
7087
|
-
|
|
7088
|
-
{
|
|
7089
|
-
|
|
7090
|
-
|
|
7091
|
-
|
|
7092
|
-
|
|
7093
|
-
|
|
7094
|
-
|
|
7095
|
-
|
|
7096
|
-
|
|
7097
|
-
|
|
7098
|
-
|
|
7099
|
-
|
|
7100
|
-
|
|
7101
|
-
|
|
7102
|
-
|
|
7103
|
-
|
|
7104
|
-
|
|
7105
|
-
|
|
7106
|
-
|
|
7336
|
+
const isSortActive = (headCellId) => orderBy === headCellId;
|
|
7337
|
+
return /* @__PURE__ */ jsx109(TableHead, { className: classes.root, children: /* @__PURE__ */ jsxs75(TableRow, { children: [
|
|
7338
|
+
enableCheckboxSelection ? /* @__PURE__ */ jsx109(TableCell, { padding: "checkbox", children: /* @__PURE__ */ jsx109(
|
|
7339
|
+
Checkbox5,
|
|
7340
|
+
{
|
|
7341
|
+
color: "primary",
|
|
7342
|
+
indeterminate: numSelected > 0 && numSelected < numRows,
|
|
7343
|
+
checked: numRows > 0 && numSelected === numRows,
|
|
7344
|
+
onChange: onSelectAllClick
|
|
7345
|
+
}
|
|
7346
|
+
) }) : null,
|
|
7347
|
+
headCells.map((headCell) => /* @__PURE__ */ jsxs75(
|
|
7348
|
+
TableCell,
|
|
7349
|
+
{
|
|
7350
|
+
className: classes.tableHeaderContent,
|
|
7351
|
+
align: "left",
|
|
7352
|
+
sortDirection: orderBy === headCell.id ? order : false,
|
|
7353
|
+
children: [
|
|
7354
|
+
/* @__PURE__ */ jsxs75(
|
|
7355
|
+
TableSortLabel,
|
|
7356
|
+
{
|
|
7357
|
+
"data-testid": "table-sort-label",
|
|
7358
|
+
active: isSortActive(headCell.id),
|
|
7359
|
+
direction: orderBy === headCell.id ? order : "asc",
|
|
7360
|
+
onClick: createSortHandler(headCell.id),
|
|
7361
|
+
children: [
|
|
7362
|
+
headCell.renderHeader ?? headCell.label,
|
|
7363
|
+
orderBy === headCell.id ? /* @__PURE__ */ jsx109("span", { className: classes.visuallyHidden, children: order === "desc" ? "sorted descending" : "sorted ascending" }) : null
|
|
7364
|
+
]
|
|
7365
|
+
}
|
|
7366
|
+
),
|
|
7367
|
+
headCell.filterOptionsQuery ? /* @__PURE__ */ jsx109(
|
|
7368
|
+
SmartTableHeaderFilterMenu_default,
|
|
7369
|
+
{
|
|
7370
|
+
headCell,
|
|
7371
|
+
headerFilters,
|
|
7372
|
+
hasActiveFilters: !!headerFilters[headCell.id]?.length,
|
|
7373
|
+
onApplyFilters
|
|
7374
|
+
}
|
|
7375
|
+
) : null
|
|
7376
|
+
]
|
|
7377
|
+
},
|
|
7378
|
+
headCell.id
|
|
7379
|
+
))
|
|
7380
|
+
] }) });
|
|
7107
7381
|
};
|
|
7108
7382
|
var SmartTableHeader_default = memo21(SmartTableHeader);
|
|
7109
7383
|
|
|
7110
7384
|
// src/components/Table/Table.tsx
|
|
7111
7385
|
var import_debounce = __toESM(require_debounce(), 1);
|
|
7112
|
-
import { useLayoutEffect, useState as
|
|
7386
|
+
import { useLayoutEffect, useState as useState16 } from "react";
|
|
7113
7387
|
import {
|
|
7114
|
-
Box as
|
|
7388
|
+
Box as Box30,
|
|
7115
7389
|
Paper as Paper10,
|
|
7116
7390
|
Table as MUITable,
|
|
7117
7391
|
TableBody,
|
|
@@ -7121,9 +7395,28 @@ import {
|
|
|
7121
7395
|
TableRow as TableRow2,
|
|
7122
7396
|
TableSortLabel as TableSortLabel2
|
|
7123
7397
|
} from "@mui/material";
|
|
7124
|
-
import { makeStyles as
|
|
7398
|
+
import { makeStyles as makeStyles46 } from "tss-react/mui";
|
|
7125
7399
|
import { v4 as uuidv4 } from "uuid";
|
|
7126
7400
|
|
|
7401
|
+
// src/components/TableLoading/TableLoading.tsx
|
|
7402
|
+
import { Box as Box29, Skeleton as Skeleton2 } from "@mui/material";
|
|
7403
|
+
import { jsx as jsx110 } from "react/jsx-runtime";
|
|
7404
|
+
var TableLoading = ({
|
|
7405
|
+
rowsPerPage,
|
|
7406
|
+
rowHeight
|
|
7407
|
+
}) => /* @__PURE__ */ jsx110(Box29, { children: Array.from({ length: rowsPerPage ?? 0 }).map((_, index) => /* @__PURE__ */ jsx110(
|
|
7408
|
+
Skeleton2,
|
|
7409
|
+
{
|
|
7410
|
+
animation: "pulse",
|
|
7411
|
+
"data-testid": "table-loading-skeleton",
|
|
7412
|
+
style: { margin: "8px", opacity: 0.4 },
|
|
7413
|
+
variant: "rectangular",
|
|
7414
|
+
height: rowHeight
|
|
7415
|
+
},
|
|
7416
|
+
index
|
|
7417
|
+
)) });
|
|
7418
|
+
var TableLoading_default = TableLoading;
|
|
7419
|
+
|
|
7127
7420
|
// src/components/Table/helpers.tsx
|
|
7128
7421
|
function stableSort(array, cmp) {
|
|
7129
7422
|
const stabilizedThis = array.map((el, index) => [el, index]);
|
|
@@ -7159,24 +7452,9 @@ function calculateRowsPerPage(rowHeight) {
|
|
|
7159
7452
|
return 1;
|
|
7160
7453
|
}
|
|
7161
7454
|
|
|
7162
|
-
// src/components/Table/TableLoading.tsx
|
|
7163
|
-
import { Box as Box28, Skeleton as Skeleton2 } from "@mui/material";
|
|
7164
|
-
import { jsx as jsx109 } from "react/jsx-runtime";
|
|
7165
|
-
var TableLoading = ({ rowsPerPage = 0, rowHeight }) => /* @__PURE__ */ jsx109(Box28, { children: Array.from({ length: rowsPerPage }).map((x, i) => /* @__PURE__ */ jsx109(
|
|
7166
|
-
Skeleton2,
|
|
7167
|
-
{
|
|
7168
|
-
animation: "pulse",
|
|
7169
|
-
style: { margin: "8px", opacity: 0.4 },
|
|
7170
|
-
variant: "rectangular",
|
|
7171
|
-
height: rowHeight
|
|
7172
|
-
},
|
|
7173
|
-
i
|
|
7174
|
-
)) });
|
|
7175
|
-
var TableLoading_default = TableLoading;
|
|
7176
|
-
|
|
7177
7455
|
// src/components/Table/Table.tsx
|
|
7178
|
-
import { jsx as
|
|
7179
|
-
var
|
|
7456
|
+
import { jsx as jsx111, jsxs as jsxs76 } from "react/jsx-runtime";
|
|
7457
|
+
var useStyles46 = makeStyles46()(() => ({
|
|
7180
7458
|
root: {
|
|
7181
7459
|
height: "calc(100vh - 262px)",
|
|
7182
7460
|
overflow: "scroll"
|
|
@@ -7210,12 +7488,12 @@ var Table = ({
|
|
|
7210
7488
|
serverRendered,
|
|
7211
7489
|
updateSort
|
|
7212
7490
|
}) => {
|
|
7213
|
-
const [order, setOrder] =
|
|
7214
|
-
const [orderBy, setOrderBy] =
|
|
7491
|
+
const [order, setOrder] = useState16(appliedFilters?.sortDir || "desc");
|
|
7492
|
+
const [orderBy, setOrderBy] = useState16(
|
|
7215
7493
|
appliedFilters?.sortField || "delivery_date"
|
|
7216
7494
|
);
|
|
7217
|
-
const [rowsPerPage, setRowsPerPage] =
|
|
7218
|
-
const { classes } =
|
|
7495
|
+
const [rowsPerPage, setRowsPerPage] = useState16(defaultRowsPerPage);
|
|
7496
|
+
const { classes } = useStyles46();
|
|
7219
7497
|
const rowHeight = 56;
|
|
7220
7498
|
const emptyRows = rowsPerPage - Math.min(rowsPerPage, data.length - page * rowsPerPage);
|
|
7221
7499
|
const handleRequestSort = (event, property) => {
|
|
@@ -7253,24 +7531,24 @@ var Table = ({
|
|
|
7253
7531
|
);
|
|
7254
7532
|
const rowsComponents = rows.map((row) => {
|
|
7255
7533
|
if (RenderItem) {
|
|
7256
|
-
return /* @__PURE__ */
|
|
7534
|
+
return /* @__PURE__ */ jsx111(RenderItem, { ...row }, row.id);
|
|
7257
7535
|
}
|
|
7258
|
-
return /* @__PURE__ */
|
|
7536
|
+
return /* @__PURE__ */ jsx111(TableRow2, { hover: true, onClick: () => onRowClick?.(row), children: headCells?.map((column) => /* @__PURE__ */ jsx111(TableCell2, { children: row[column.id] }, column.id)) }, row.id);
|
|
7259
7537
|
});
|
|
7260
7538
|
if (emptyRows > 0 && rowsPerPage > emptyRows) {
|
|
7261
7539
|
rowsComponents.push(
|
|
7262
|
-
/* @__PURE__ */
|
|
7540
|
+
/* @__PURE__ */ jsx111(TableRow2, { style: { height: rowHeight * emptyRows }, children: /* @__PURE__ */ jsx111(TableCell2, { colSpan: 8 }) }, uuidv4())
|
|
7263
7541
|
);
|
|
7264
7542
|
}
|
|
7265
7543
|
return rowsComponents;
|
|
7266
7544
|
};
|
|
7267
|
-
return /* @__PURE__ */
|
|
7268
|
-
/* @__PURE__ */
|
|
7545
|
+
return /* @__PURE__ */ jsx111(Paper10, { className: classes.root, children: /* @__PURE__ */ jsx111(Box30, { className: classes.paper, children: isLoading ? /* @__PURE__ */ jsx111(TableLoading_default, { rowHeight, rowsPerPage }) : /* @__PURE__ */ jsx111(TableContainer, { className: classes.container, children: /* @__PURE__ */ jsxs76(MUITable, { size: "medium", stickyHeader: true, children: [
|
|
7546
|
+
/* @__PURE__ */ jsx111(TableHead2, { className: classes.header, children: /* @__PURE__ */ jsx111(TableRow2, { children: headCells?.map((headCell) => /* @__PURE__ */ jsx111(
|
|
7269
7547
|
TableCell2,
|
|
7270
7548
|
{
|
|
7271
7549
|
align: "left",
|
|
7272
7550
|
sortDirection: orderBy === headCell.id ? order : void 0,
|
|
7273
|
-
children: /* @__PURE__ */
|
|
7551
|
+
children: /* @__PURE__ */ jsx111(
|
|
7274
7552
|
TableSortLabel2,
|
|
7275
7553
|
{
|
|
7276
7554
|
active: orderBy === headCell.id,
|
|
@@ -7282,16 +7560,20 @@ var Table = ({
|
|
|
7282
7560
|
},
|
|
7283
7561
|
headCell.id
|
|
7284
7562
|
)) }) }),
|
|
7285
|
-
/* @__PURE__ */
|
|
7563
|
+
/* @__PURE__ */ jsxs76(TableBody, { children: [
|
|
7286
7564
|
getTableRows(),
|
|
7287
|
-
rowsPerPage === emptyRows && /* @__PURE__ */
|
|
7565
|
+
rowsPerPage === emptyRows && /* @__PURE__ */ jsx111(TableRow2, { style: { height: rowHeight * emptyRows }, children: /* @__PURE__ */ jsx111(TableCell2, { colSpan: 8, align: "center", children: "Nothing to display" }) })
|
|
7288
7566
|
] })
|
|
7289
7567
|
] }) }) }) });
|
|
7290
7568
|
};
|
|
7291
7569
|
var Table_default = Table;
|
|
7292
7570
|
|
|
7293
|
-
// src/components/
|
|
7294
|
-
import {
|
|
7571
|
+
// src/components/TableDesktop/TableDesktop.tsx
|
|
7572
|
+
import {
|
|
7573
|
+
useCallback as useCallback2,
|
|
7574
|
+
useMemo as useMemo2,
|
|
7575
|
+
useState as useState17
|
|
7576
|
+
} from "react";
|
|
7295
7577
|
import {
|
|
7296
7578
|
Paper as Paper11,
|
|
7297
7579
|
Table as Table2,
|
|
@@ -7299,41 +7581,50 @@ import {
|
|
|
7299
7581
|
TableContainer as TableContainer2,
|
|
7300
7582
|
Skeleton as Skeleton3
|
|
7301
7583
|
} from "@mui/material";
|
|
7302
|
-
import { makeStyles as
|
|
7584
|
+
import { makeStyles as makeStyles48 } from "tss-react/mui";
|
|
7303
7585
|
import { v4 as uuidv42 } from "uuid";
|
|
7304
7586
|
|
|
7305
|
-
// src/components/
|
|
7587
|
+
// src/components/TableEmptyResult/TableEmptyResult.tsx
|
|
7306
7588
|
import { TableCell as TableCell3, TableRow as TableRow3, Typography as Typography25 } from "@mui/material";
|
|
7307
|
-
import { makeStyles as
|
|
7308
|
-
import { jsx as
|
|
7309
|
-
var
|
|
7589
|
+
import { makeStyles as makeStyles47 } from "tss-react/mui";
|
|
7590
|
+
import { jsx as jsx112, jsxs as jsxs77 } from "react/jsx-runtime";
|
|
7591
|
+
var useStyles47 = makeStyles47()(() => ({
|
|
7310
7592
|
tableCellIcon: { padding: 24, height: "calc(100vh - 320px)" },
|
|
7311
7593
|
tableCellDefault: { padding: 24 }
|
|
7312
7594
|
}));
|
|
7313
7595
|
var TableEmptyResult = ({
|
|
7596
|
+
colSpan,
|
|
7314
7597
|
showClearFilterButton = false,
|
|
7315
7598
|
handleClickOnClearFiltersButton = () => {
|
|
7316
7599
|
}
|
|
7317
7600
|
}) => {
|
|
7318
|
-
const { classes } =
|
|
7319
|
-
return showClearFilterButton ? /* @__PURE__ */
|
|
7320
|
-
|
|
7321
|
-
|
|
7322
|
-
|
|
7323
|
-
|
|
7324
|
-
|
|
7325
|
-
|
|
7326
|
-
|
|
7327
|
-
variant: "
|
|
7328
|
-
|
|
7329
|
-
|
|
7330
|
-
|
|
7331
|
-
|
|
7332
|
-
|
|
7601
|
+
const { classes } = useStyles47();
|
|
7602
|
+
return showClearFilterButton ? /* @__PURE__ */ jsx112(TableRow3, { children: /* @__PURE__ */ jsxs77(
|
|
7603
|
+
TableCell3,
|
|
7604
|
+
{
|
|
7605
|
+
className: classes.tableCellIcon,
|
|
7606
|
+
colSpan,
|
|
7607
|
+
align: "center",
|
|
7608
|
+
children: [
|
|
7609
|
+
/* @__PURE__ */ jsx112(EmptyGlassIcon_default, {}),
|
|
7610
|
+
/* @__PURE__ */ jsx112(Typography25, { variant: "h6", children: "No results found." }),
|
|
7611
|
+
/* @__PURE__ */ jsx112(Typography25, { variant: "subtitle1", children: "Search without applied filters?" }),
|
|
7612
|
+
/* @__PURE__ */ jsx112(
|
|
7613
|
+
FilledButton_default,
|
|
7614
|
+
{
|
|
7615
|
+
copy: "Search",
|
|
7616
|
+
variant: "contained",
|
|
7617
|
+
color: "primary",
|
|
7618
|
+
onClick: handleClickOnClearFiltersButton
|
|
7619
|
+
}
|
|
7620
|
+
)
|
|
7621
|
+
]
|
|
7622
|
+
}
|
|
7623
|
+
) }) : /* @__PURE__ */ jsx112(TableRow3, { children: /* @__PURE__ */ jsx112(
|
|
7333
7624
|
TableCell3,
|
|
7334
7625
|
{
|
|
7335
7626
|
className: classes.tableCellDefault,
|
|
7336
|
-
colSpan
|
|
7627
|
+
colSpan,
|
|
7337
7628
|
align: "center",
|
|
7338
7629
|
children: "Nothing to display"
|
|
7339
7630
|
}
|
|
@@ -7341,9 +7632,9 @@ var TableEmptyResult = ({
|
|
|
7341
7632
|
};
|
|
7342
7633
|
var TableEmptyResult_default = TableEmptyResult;
|
|
7343
7634
|
|
|
7344
|
-
// src/components/
|
|
7345
|
-
import { Fragment as
|
|
7346
|
-
var
|
|
7635
|
+
// src/components/TableDesktop/TableDesktop.tsx
|
|
7636
|
+
import { Fragment as Fragment13, jsx as jsx113, jsxs as jsxs78 } from "react/jsx-runtime";
|
|
7637
|
+
var useStyles48 = makeStyles48()((theme) => ({
|
|
7347
7638
|
root: {
|
|
7348
7639
|
justifyContent: "space-between",
|
|
7349
7640
|
display: "flex",
|
|
@@ -7356,97 +7647,202 @@ var useStyles47 = makeStyles47()(() => ({
|
|
|
7356
7647
|
justifyContent: "space-between"
|
|
7357
7648
|
},
|
|
7358
7649
|
container: {
|
|
7359
|
-
maxHeight: "100%"
|
|
7650
|
+
maxHeight: "100%",
|
|
7651
|
+
"&::-webkit-scrollbar": {
|
|
7652
|
+
width: "8px",
|
|
7653
|
+
height: "8px"
|
|
7654
|
+
},
|
|
7655
|
+
"&::-webkit-scrollbar-track": {
|
|
7656
|
+
backgroundColor: theme.palette.mode === "dark" ? theme.palette.grey[800] : theme.palette.grey[100]
|
|
7657
|
+
},
|
|
7658
|
+
"&::-webkit-scrollbar-thumb": {
|
|
7659
|
+
backgroundColor: theme.palette.mode === "dark" ? theme.palette.grey[900] : theme.palette.grey[400],
|
|
7660
|
+
borderRadius: "10px"
|
|
7661
|
+
},
|
|
7662
|
+
"&::-webkit-scrollbar-thumb:hover": {
|
|
7663
|
+
backgroundColor: theme.palette.mode === "dark" ? theme.palette.common.black : theme.palette.grey[500]
|
|
7664
|
+
}
|
|
7360
7665
|
}
|
|
7361
7666
|
}));
|
|
7362
|
-
var
|
|
7363
|
-
|
|
7667
|
+
var descendingComparator2 = (a, b, orderBy) => {
|
|
7668
|
+
const objA = a[orderBy];
|
|
7669
|
+
const objB = b[orderBy];
|
|
7670
|
+
const valA = typeof objA === "object" ? objA?.name : objA;
|
|
7671
|
+
const valB = typeof objB === "object" ? objB?.name : objB;
|
|
7672
|
+
if (!valA && !valB) {
|
|
7673
|
+
return 0;
|
|
7674
|
+
}
|
|
7675
|
+
if (valA && !valB) {
|
|
7364
7676
|
return -1;
|
|
7365
7677
|
}
|
|
7366
|
-
if (
|
|
7678
|
+
if (!valA && valB) {
|
|
7679
|
+
return 1;
|
|
7680
|
+
}
|
|
7681
|
+
if (valA > valB) {
|
|
7682
|
+
return -1;
|
|
7683
|
+
}
|
|
7684
|
+
if (valA < valB) {
|
|
7367
7685
|
return 1;
|
|
7368
7686
|
}
|
|
7369
7687
|
return 0;
|
|
7370
7688
|
};
|
|
7371
|
-
var stableSort2 = (array, cmp) => array.map((el, index) =>
|
|
7372
|
-
const order = cmp(a
|
|
7373
|
-
return order !== 0 ? order : a
|
|
7374
|
-
}).map((el) => el
|
|
7375
|
-
var
|
|
7689
|
+
var stableSort2 = (array, cmp) => array.map((el, index) => ({ el, index })).sort((a, b) => {
|
|
7690
|
+
const order = cmp(a.el, b.el);
|
|
7691
|
+
return order !== 0 ? order : a.index - b.index;
|
|
7692
|
+
}).map((el) => el.el);
|
|
7693
|
+
var getComparator = (order, orderBy) => order === "desc" ? (a, b) => descendingComparator2(a, b, orderBy) : (a, b) => -descendingComparator2(a, b, orderBy);
|
|
7376
7694
|
var TableDesktop = ({
|
|
7377
|
-
appliedFilters,
|
|
7378
|
-
children,
|
|
7379
7695
|
data,
|
|
7380
7696
|
headCells,
|
|
7697
|
+
RenderItem,
|
|
7698
|
+
appliedFilters,
|
|
7699
|
+
headerFilters,
|
|
7700
|
+
children,
|
|
7381
7701
|
height,
|
|
7382
7702
|
isLoading,
|
|
7383
|
-
|
|
7384
|
-
|
|
7703
|
+
rowsPerPage = 50,
|
|
7704
|
+
enableCheckboxSelection = false,
|
|
7705
|
+
disableInternalSort = false,
|
|
7385
7706
|
updateSort,
|
|
7386
7707
|
showClearFilterButton,
|
|
7387
7708
|
handleClickOnClearFiltersButton,
|
|
7388
7709
|
deleteItem,
|
|
7389
|
-
keyField
|
|
7710
|
+
keyField = "id",
|
|
7711
|
+
onApplyFilters
|
|
7390
7712
|
}) => {
|
|
7391
|
-
const [order, setOrder] =
|
|
7392
|
-
|
|
7393
|
-
);
|
|
7394
|
-
const [orderBy, setOrderBy] = useState16(
|
|
7713
|
+
const [order, setOrder] = useState17(appliedFilters?.sortDir || "desc");
|
|
7714
|
+
const [orderBy, setOrderBy] = useState17(
|
|
7395
7715
|
appliedFilters?.sortField || "delivery_date"
|
|
7396
7716
|
);
|
|
7397
|
-
const [
|
|
7398
|
-
const
|
|
7717
|
+
const [selected, setSelected] = useState17([]);
|
|
7718
|
+
const [page] = useState17(0);
|
|
7719
|
+
const { classes } = useStyles48();
|
|
7399
7720
|
const rowHeight = 56;
|
|
7721
|
+
const emptyRows = useMemo2(
|
|
7722
|
+
() => rowsPerPage - data.length,
|
|
7723
|
+
[rowsPerPage, data]
|
|
7724
|
+
);
|
|
7725
|
+
const visibleHeadCells = useMemo2(
|
|
7726
|
+
() => headCells.filter((headCell) => headCell?.enabled ?? true),
|
|
7727
|
+
[headCells]
|
|
7728
|
+
);
|
|
7729
|
+
const handleSelectAllClick = useCallback2(
|
|
7730
|
+
(event) => {
|
|
7731
|
+
if (event.target.checked) {
|
|
7732
|
+
const newSelected = data.map((n) => n[keyField]);
|
|
7733
|
+
setSelected(newSelected);
|
|
7734
|
+
return;
|
|
7735
|
+
}
|
|
7736
|
+
setSelected([]);
|
|
7737
|
+
},
|
|
7738
|
+
[data, keyField]
|
|
7739
|
+
);
|
|
7400
7740
|
const handleRequestSort = (event, property) => {
|
|
7401
7741
|
const isAsc = orderBy === property && order === "asc";
|
|
7402
7742
|
const orderDir = isAsc ? "desc" : "asc";
|
|
7403
7743
|
setOrder(orderDir);
|
|
7404
7744
|
setOrderBy(property);
|
|
7405
|
-
updateSort
|
|
7745
|
+
if (updateSort) {
|
|
7746
|
+
updateSort(property, orderDir);
|
|
7747
|
+
}
|
|
7406
7748
|
};
|
|
7407
|
-
const
|
|
7408
|
-
|
|
7749
|
+
const handleRowCheckboxClick = useCallback2(
|
|
7750
|
+
(event, keyFieldValue) => {
|
|
7751
|
+
const selectedIndex = selected.indexOf(keyFieldValue);
|
|
7752
|
+
let newSelected = [];
|
|
7753
|
+
if (selectedIndex === -1) {
|
|
7754
|
+
newSelected = newSelected.concat(selected, keyFieldValue);
|
|
7755
|
+
} else if (selectedIndex === 0) {
|
|
7756
|
+
newSelected = newSelected.concat(selected.slice(1));
|
|
7757
|
+
} else if (selectedIndex === selected.length - 1) {
|
|
7758
|
+
newSelected = newSelected.concat(selected.slice(0, -1));
|
|
7759
|
+
} else if (selectedIndex > 0) {
|
|
7760
|
+
newSelected = newSelected.concat(
|
|
7761
|
+
selected.slice(0, selectedIndex),
|
|
7762
|
+
selected.slice(selectedIndex + 1)
|
|
7763
|
+
);
|
|
7764
|
+
}
|
|
7765
|
+
setSelected(newSelected);
|
|
7766
|
+
},
|
|
7767
|
+
[selected]
|
|
7768
|
+
);
|
|
7769
|
+
const renderTableRows = useMemo2(() => {
|
|
7770
|
+
const sortedData = disableInternalSort ? data : stableSort2(data, getComparator(order, orderBy));
|
|
7771
|
+
return sortedData.slice(page * rowsPerPage, page * rowsPerPage + rowsPerPage).map((row, index) => {
|
|
7772
|
+
const isItemSelected = selected.includes(row[keyField]);
|
|
7773
|
+
return /* @__PURE__ */ jsx113(
|
|
7774
|
+
RenderItem,
|
|
7775
|
+
{
|
|
7776
|
+
...{
|
|
7777
|
+
...row,
|
|
7778
|
+
index,
|
|
7779
|
+
deleteItem,
|
|
7780
|
+
isItemSelected,
|
|
7781
|
+
enableCheckboxSelection,
|
|
7782
|
+
keyFieldValue: row[keyField],
|
|
7783
|
+
handleRowCheckboxClick,
|
|
7784
|
+
visibleHeadCells
|
|
7785
|
+
}
|
|
7786
|
+
},
|
|
7787
|
+
row[keyField] ?? index
|
|
7788
|
+
);
|
|
7789
|
+
});
|
|
7790
|
+
}, [
|
|
7791
|
+
data,
|
|
7792
|
+
order,
|
|
7793
|
+
orderBy,
|
|
7794
|
+
page,
|
|
7795
|
+
rowsPerPage,
|
|
7796
|
+
selected,
|
|
7797
|
+
enableCheckboxSelection,
|
|
7798
|
+
disableInternalSort,
|
|
7799
|
+
deleteItem,
|
|
7800
|
+
keyField,
|
|
7801
|
+
handleRowCheckboxClick,
|
|
7802
|
+
visibleHeadCells,
|
|
7803
|
+
RenderItem
|
|
7804
|
+
]);
|
|
7805
|
+
return /* @__PURE__ */ jsx113("div", { className: classes.root, style: { height }, children: /* @__PURE__ */ jsx113(Paper11, { className: classes.paper, children: isLoading ? /* @__PURE__ */ jsx113(Fragment13, { children: [...Array(Math.floor(rowsPerPage ?? 50))].map(() => /* @__PURE__ */ jsx113(
|
|
7409
7806
|
Skeleton3,
|
|
7410
7807
|
{
|
|
7411
7808
|
animation: "pulse",
|
|
7412
7809
|
style: { margin: "8px", opacity: 0.4 },
|
|
7413
7810
|
variant: "rectangular",
|
|
7414
|
-
height: rowHeight
|
|
7811
|
+
height: rowHeight,
|
|
7812
|
+
"data-testid": "loading-skeleton"
|
|
7415
7813
|
},
|
|
7416
|
-
|
|
7417
|
-
)) }) : /* @__PURE__ */
|
|
7418
|
-
/* @__PURE__ */
|
|
7814
|
+
uuidv42()
|
|
7815
|
+
)) }) : /* @__PURE__ */ jsxs78(Fragment13, { children: [
|
|
7816
|
+
/* @__PURE__ */ jsx113(TableContainer2, { className: classes.container, children: /* @__PURE__ */ jsxs78(
|
|
7419
7817
|
Table2,
|
|
7420
7818
|
{
|
|
7421
7819
|
"aria-labelledby": "tableTitle",
|
|
7422
7820
|
"aria-label": "sticky table",
|
|
7423
7821
|
stickyHeader: true,
|
|
7424
7822
|
children: [
|
|
7425
|
-
/* @__PURE__ */
|
|
7823
|
+
/* @__PURE__ */ jsx113(
|
|
7426
7824
|
SmartTableHeader_default,
|
|
7427
7825
|
{
|
|
7428
|
-
headCells,
|
|
7826
|
+
headCells: visibleHeadCells,
|
|
7429
7827
|
order,
|
|
7430
7828
|
orderBy,
|
|
7431
|
-
|
|
7829
|
+
numSelected: selected.length,
|
|
7830
|
+
numRows: data.length,
|
|
7831
|
+
enableCheckboxSelection,
|
|
7832
|
+
headerFilters: headerFilters ?? {},
|
|
7833
|
+
onRequestSort: handleRequestSort,
|
|
7834
|
+
onSelectAllClick: handleSelectAllClick,
|
|
7835
|
+
onApplyFilters
|
|
7432
7836
|
}
|
|
7433
7837
|
),
|
|
7434
|
-
/* @__PURE__ */
|
|
7435
|
-
|
|
7436
|
-
|
|
7437
|
-
|
|
7438
|
-
|
|
7439
|
-
|
|
7440
|
-
|
|
7441
|
-
|
|
7442
|
-
rowsPerPage === emptyRows && /* @__PURE__ */ jsx112(
|
|
7443
|
-
TableEmptyResult_default,
|
|
7444
|
-
{
|
|
7445
|
-
showClearFilterButton,
|
|
7446
|
-
handleClickOnClearFiltersButton
|
|
7447
|
-
}
|
|
7448
|
-
)
|
|
7449
|
-
] })
|
|
7838
|
+
/* @__PURE__ */ jsx113(TableBody2, { children: rowsPerPage !== emptyRows ? renderTableRows : /* @__PURE__ */ jsx113(
|
|
7839
|
+
TableEmptyResult_default,
|
|
7840
|
+
{
|
|
7841
|
+
colSpan: enableCheckboxSelection ? visibleHeadCells.length + 1 : visibleHeadCells.length,
|
|
7842
|
+
showClearFilterButton,
|
|
7843
|
+
handleClickOnClearFiltersButton
|
|
7844
|
+
}
|
|
7845
|
+
) })
|
|
7450
7846
|
]
|
|
7451
7847
|
}
|
|
7452
7848
|
) }),
|
|
@@ -7456,12 +7852,12 @@ var TableDesktop = ({
|
|
|
7456
7852
|
var TableDesktop_default = TableDesktop;
|
|
7457
7853
|
|
|
7458
7854
|
// src/components/TableHeader/TableHeader.tsx
|
|
7459
|
-
import { memo as memo22, useEffect as useEffect9, useState as
|
|
7855
|
+
import { memo as memo22, useEffect as useEffect9, useState as useState18 } from "react";
|
|
7460
7856
|
import { ImportExport as ImportExportIcon } from "@mui/icons-material";
|
|
7461
7857
|
import { TableCell as TableCell4, TableHead as TableHead3, TableRow as TableRow4, TableSortLabel as TableSortLabel3 } from "@mui/material";
|
|
7462
|
-
import { makeStyles as
|
|
7463
|
-
import { jsx as
|
|
7464
|
-
var
|
|
7858
|
+
import { makeStyles as makeStyles49 } from "tss-react/mui";
|
|
7859
|
+
import { jsx as jsx114 } from "react/jsx-runtime";
|
|
7860
|
+
var useStyles49 = makeStyles49()(() => ({
|
|
7465
7861
|
sortLabel: {
|
|
7466
7862
|
"& .MuiTableSortLabel-icon": {
|
|
7467
7863
|
opacity: 1
|
|
@@ -7469,8 +7865,8 @@ var useStyles48 = makeStyles48()(() => ({
|
|
|
7469
7865
|
}
|
|
7470
7866
|
}));
|
|
7471
7867
|
var TableHeader = ({ cells, onSort = null }) => {
|
|
7472
|
-
const [sortableCells, setSortableCells] =
|
|
7473
|
-
const { classes } =
|
|
7868
|
+
const [sortableCells, setSortableCells] = useState18([]);
|
|
7869
|
+
const { classes } = useStyles49();
|
|
7474
7870
|
useEffect9(() => {
|
|
7475
7871
|
setSortableCells(cells);
|
|
7476
7872
|
}, []);
|
|
@@ -7505,7 +7901,7 @@ var TableHeader = ({ cells, onSort = null }) => {
|
|
|
7505
7901
|
});
|
|
7506
7902
|
setSortableCells(sortedCells);
|
|
7507
7903
|
};
|
|
7508
|
-
return /* @__PURE__ */
|
|
7904
|
+
return /* @__PURE__ */ jsx114(TableHead3, { children: /* @__PURE__ */ jsx114(TableRow4, { children: sortableCells.map((cell, key) => /* @__PURE__ */ jsx114(TableCell4, { children: cell.isSortable ? /* @__PURE__ */ jsx114(
|
|
7509
7905
|
TableSortLabel3,
|
|
7510
7906
|
{
|
|
7511
7907
|
className: classes.sortLabel,
|
|
@@ -7519,10 +7915,10 @@ var TableHeader = ({ cells, onSort = null }) => {
|
|
|
7519
7915
|
var TableHeader_default = memo22(TableHeader);
|
|
7520
7916
|
|
|
7521
7917
|
// src/components/TextDivider/TextDivider.tsx
|
|
7522
|
-
import { Box as
|
|
7523
|
-
import { makeStyles as
|
|
7524
|
-
import { jsx as
|
|
7525
|
-
var
|
|
7918
|
+
import { Box as Box31, Typography as Typography26, Divider as Divider10, Button as Button13 } from "@mui/material";
|
|
7919
|
+
import { makeStyles as makeStyles50 } from "tss-react/mui";
|
|
7920
|
+
import { jsx as jsx115, jsxs as jsxs79 } from "react/jsx-runtime";
|
|
7921
|
+
var useStyles50 = makeStyles50()(() => ({
|
|
7526
7922
|
icon: {
|
|
7527
7923
|
fontSize: 20
|
|
7528
7924
|
},
|
|
@@ -7556,20 +7952,20 @@ var TextDivider = ({
|
|
|
7556
7952
|
iconPosition = "left",
|
|
7557
7953
|
titleWeight = "400"
|
|
7558
7954
|
}) => {
|
|
7559
|
-
const { classes } =
|
|
7955
|
+
const { classes } = useStyles50();
|
|
7560
7956
|
const iconColor = color ?? colors.neutral900;
|
|
7561
|
-
return /* @__PURE__ */
|
|
7562
|
-
|
|
7957
|
+
return /* @__PURE__ */ jsxs79(
|
|
7958
|
+
Box31,
|
|
7563
7959
|
{
|
|
7564
7960
|
display: "flex",
|
|
7565
7961
|
alignItems: "center",
|
|
7566
7962
|
justifyContent: "space-between",
|
|
7567
7963
|
className: classes.container,
|
|
7568
7964
|
children: [
|
|
7569
|
-
/* @__PURE__ */
|
|
7570
|
-
/* @__PURE__ */
|
|
7571
|
-
Icon3 && iconPosition === "left" && /* @__PURE__ */
|
|
7572
|
-
/* @__PURE__ */
|
|
7965
|
+
/* @__PURE__ */ jsx115(Divider10, { className: classes.leftDivider }),
|
|
7966
|
+
/* @__PURE__ */ jsx115(Button13, { onClick, disabled: !onClick, className: classes.button, children: /* @__PURE__ */ jsxs79(Box31, { className: classes.center, children: [
|
|
7967
|
+
Icon3 && iconPosition === "left" && /* @__PURE__ */ jsx115(Icon3, { className: classes.icon, style: { color: iconColor } }),
|
|
7968
|
+
/* @__PURE__ */ jsx115(
|
|
7573
7969
|
Typography26,
|
|
7574
7970
|
{
|
|
7575
7971
|
color: "textSecondary",
|
|
@@ -7578,9 +7974,9 @@ var TextDivider = ({
|
|
|
7578
7974
|
children: title
|
|
7579
7975
|
}
|
|
7580
7976
|
),
|
|
7581
|
-
Icon3 && iconPosition === "right" && /* @__PURE__ */
|
|
7977
|
+
Icon3 && iconPosition === "right" && /* @__PURE__ */ jsx115(Icon3, { className: classes.icon, style: { color: iconColor } })
|
|
7582
7978
|
] }) }),
|
|
7583
|
-
/* @__PURE__ */
|
|
7979
|
+
/* @__PURE__ */ jsx115(Divider10, { className: classes.rightDivider })
|
|
7584
7980
|
]
|
|
7585
7981
|
}
|
|
7586
7982
|
);
|
|
@@ -7589,12 +7985,12 @@ var TextDivider_default = TextDivider;
|
|
|
7589
7985
|
|
|
7590
7986
|
// src/components/ThemedDateRangePicker/ThemedDateRangePicker.tsx
|
|
7591
7987
|
import { DateRangePicker } from "react-dates";
|
|
7592
|
-
import { makeStyles as
|
|
7988
|
+
import { makeStyles as makeStyles51 } from "tss-react/mui";
|
|
7593
7989
|
import "react-dates/initialize";
|
|
7594
7990
|
import "react-dates/lib/css/_datepicker.css";
|
|
7595
|
-
import
|
|
7596
|
-
import { jsx as
|
|
7597
|
-
var
|
|
7991
|
+
import classNames4 from "classnames";
|
|
7992
|
+
import { jsx as jsx116 } from "react/jsx-runtime";
|
|
7993
|
+
var useStyles51 = makeStyles51()((theme) => ({
|
|
7598
7994
|
wrapper: {
|
|
7599
7995
|
"& .DateRangePicker": {
|
|
7600
7996
|
backgroundColor: theme.palette.mode === "dark" ? theme.palette.grey[900] : colors.neutral100,
|
|
@@ -7687,17 +8083,17 @@ var ThemedDateRangePicker = ({
|
|
|
7687
8083
|
className,
|
|
7688
8084
|
...props
|
|
7689
8085
|
}) => {
|
|
7690
|
-
const { classes } =
|
|
7691
|
-
return /* @__PURE__ */
|
|
8086
|
+
const { classes } = useStyles51();
|
|
8087
|
+
return /* @__PURE__ */ jsx116("div", { className: classNames4(classes.wrapper, className), children: /* @__PURE__ */ jsx116(DateRangePicker, { ...props }) });
|
|
7692
8088
|
};
|
|
7693
8089
|
var ThemedDateRangePicker_default = ThemedDateRangePicker;
|
|
7694
8090
|
|
|
7695
8091
|
// src/components/TheToolbar/TheToolbar.tsx
|
|
7696
8092
|
import { memo as memo23 } from "react";
|
|
7697
|
-
import { AppBar as AppBar2, Box as
|
|
7698
|
-
import { makeStyles as
|
|
7699
|
-
import { jsx as
|
|
7700
|
-
var
|
|
8093
|
+
import { AppBar as AppBar2, Box as Box32, Toolbar as Toolbar2 } from "@mui/material";
|
|
8094
|
+
import { makeStyles as makeStyles52 } from "tss-react/mui";
|
|
8095
|
+
import { jsx as jsx117, jsxs as jsxs80 } from "react/jsx-runtime";
|
|
8096
|
+
var useStyles52 = makeStyles52()((theme) => ({
|
|
7701
8097
|
menuButton: {
|
|
7702
8098
|
color: theme.palette.primary.contrastText
|
|
7703
8099
|
},
|
|
@@ -7734,10 +8130,10 @@ var TheToolbar = ({
|
|
|
7734
8130
|
handleOpen,
|
|
7735
8131
|
LeftDrawer: LeftDrawer2
|
|
7736
8132
|
}) => {
|
|
7737
|
-
const { classes } =
|
|
7738
|
-
return /* @__PURE__ */
|
|
7739
|
-
/* @__PURE__ */
|
|
7740
|
-
/* @__PURE__ */
|
|
8133
|
+
const { classes } = useStyles52();
|
|
8134
|
+
return /* @__PURE__ */ jsxs80(Box32, { children: [
|
|
8135
|
+
/* @__PURE__ */ jsx117(AppBar2, { children: /* @__PURE__ */ jsxs80(Toolbar2, { className: classes.topBar, children: [
|
|
8136
|
+
/* @__PURE__ */ jsx117(
|
|
7741
8137
|
RoundButton_default,
|
|
7742
8138
|
{
|
|
7743
8139
|
className: classes.menuButton,
|
|
@@ -7746,7 +8142,7 @@ var TheToolbar = ({
|
|
|
7746
8142
|
onClick: handleOpen
|
|
7747
8143
|
}
|
|
7748
8144
|
),
|
|
7749
|
-
/* @__PURE__ */
|
|
8145
|
+
/* @__PURE__ */ jsx117(
|
|
7750
8146
|
CompanyLogo_default,
|
|
7751
8147
|
{
|
|
7752
8148
|
size: "small",
|
|
@@ -7756,7 +8152,7 @@ var TheToolbar = ({
|
|
|
7756
8152
|
}
|
|
7757
8153
|
)
|
|
7758
8154
|
] }) }),
|
|
7759
|
-
/* @__PURE__ */
|
|
8155
|
+
/* @__PURE__ */ jsx117(Box32, { className: classes.offset }),
|
|
7760
8156
|
LeftDrawer2
|
|
7761
8157
|
] });
|
|
7762
8158
|
};
|
|
@@ -7764,20 +8160,20 @@ var TheToolbar_default = memo23(TheToolbar);
|
|
|
7764
8160
|
|
|
7765
8161
|
// src/components/ToastMessage/ToastMessage.tsx
|
|
7766
8162
|
import { Alert as MuiAlert, Snackbar } from "@mui/material";
|
|
7767
|
-
import { jsx as
|
|
8163
|
+
import { jsx as jsx118 } from "react/jsx-runtime";
|
|
7768
8164
|
var ToastMessage = ({
|
|
7769
8165
|
toastType,
|
|
7770
8166
|
toastMessage,
|
|
7771
8167
|
open,
|
|
7772
8168
|
onClose
|
|
7773
|
-
}) => /* @__PURE__ */
|
|
8169
|
+
}) => /* @__PURE__ */ jsx118(
|
|
7774
8170
|
Snackbar,
|
|
7775
8171
|
{
|
|
7776
8172
|
open,
|
|
7777
8173
|
autoHideDuration: 1500,
|
|
7778
8174
|
onClose,
|
|
7779
8175
|
anchorOrigin: { vertical: "top", horizontal: "right" },
|
|
7780
|
-
children: /* @__PURE__ */
|
|
8176
|
+
children: /* @__PURE__ */ jsx118(
|
|
7781
8177
|
MuiAlert,
|
|
7782
8178
|
{
|
|
7783
8179
|
elevation: 6,
|
|
@@ -7808,14 +8204,14 @@ import {
|
|
|
7808
8204
|
Typography as Typography27,
|
|
7809
8205
|
Dialog as Dialog5,
|
|
7810
8206
|
Backdrop,
|
|
7811
|
-
Box as
|
|
7812
|
-
Divider as
|
|
8207
|
+
Box as Box33,
|
|
8208
|
+
Divider as Divider11,
|
|
7813
8209
|
Paper as Paper12,
|
|
7814
8210
|
Fade as Fade2
|
|
7815
8211
|
} from "@mui/material";
|
|
7816
|
-
import { makeStyles as
|
|
7817
|
-
import { jsx as
|
|
7818
|
-
var
|
|
8212
|
+
import { makeStyles as makeStyles53 } from "tss-react/mui";
|
|
8213
|
+
import { jsx as jsx119, jsxs as jsxs81 } from "react/jsx-runtime";
|
|
8214
|
+
var useStyles53 = makeStyles53()((theme) => ({
|
|
7819
8215
|
paper: {
|
|
7820
8216
|
padding: theme.spacing(2)
|
|
7821
8217
|
},
|
|
@@ -7843,8 +8239,8 @@ var TwoButtonDialog = ({
|
|
|
7843
8239
|
cancelLabel = "CANCEL",
|
|
7844
8240
|
cancelButton
|
|
7845
8241
|
}) => {
|
|
7846
|
-
const { classes } =
|
|
7847
|
-
return /* @__PURE__ */
|
|
8242
|
+
const { classes } = useStyles53();
|
|
8243
|
+
return /* @__PURE__ */ jsx119(
|
|
7848
8244
|
Dialog5,
|
|
7849
8245
|
{
|
|
7850
8246
|
open,
|
|
@@ -7856,10 +8252,10 @@ var TwoButtonDialog = ({
|
|
|
7856
8252
|
BackdropProps: {
|
|
7857
8253
|
timeout: 500
|
|
7858
8254
|
},
|
|
7859
|
-
children: /* @__PURE__ */
|
|
7860
|
-
/* @__PURE__ */
|
|
7861
|
-
/* @__PURE__ */
|
|
7862
|
-
|
|
8255
|
+
children: /* @__PURE__ */ jsx119(Fade2, { in: open, children: /* @__PURE__ */ jsxs81(Paper12, { className: classes.paper, children: [
|
|
8256
|
+
/* @__PURE__ */ jsxs81(Box33, { className: classes.mb, children: [
|
|
8257
|
+
/* @__PURE__ */ jsx119(Typography27, { variant: "h5", component: "div", children: /* @__PURE__ */ jsx119(
|
|
8258
|
+
Box33,
|
|
7863
8259
|
{
|
|
7864
8260
|
sx: {
|
|
7865
8261
|
fontWeight: 600
|
|
@@ -7867,23 +8263,23 @@ var TwoButtonDialog = ({
|
|
|
7867
8263
|
children: title
|
|
7868
8264
|
}
|
|
7869
8265
|
) }),
|
|
7870
|
-
/* @__PURE__ */
|
|
7871
|
-
|
|
8266
|
+
/* @__PURE__ */ jsxs81(
|
|
8267
|
+
Box33,
|
|
7872
8268
|
{
|
|
7873
8269
|
className: classes.mt,
|
|
7874
8270
|
sx: {
|
|
7875
8271
|
fontWeight: 600
|
|
7876
8272
|
},
|
|
7877
8273
|
children: [
|
|
7878
|
-
subtitle1 && /* @__PURE__ */
|
|
7879
|
-
subtitle2 && /* @__PURE__ */
|
|
8274
|
+
subtitle1 && /* @__PURE__ */ jsx119(Typography27, { variant: "subtitle1", children: subtitle1 }),
|
|
8275
|
+
subtitle2 && /* @__PURE__ */ jsx119(Typography27, { variant: "subtitle1", children: subtitle2 })
|
|
7880
8276
|
]
|
|
7881
8277
|
}
|
|
7882
8278
|
)
|
|
7883
8279
|
] }),
|
|
7884
|
-
/* @__PURE__ */
|
|
7885
|
-
/* @__PURE__ */
|
|
7886
|
-
/* @__PURE__ */
|
|
8280
|
+
/* @__PURE__ */ jsx119(Divider11, {}),
|
|
8281
|
+
/* @__PURE__ */ jsxs81(Box33, { className: classes.buttonContainer, children: [
|
|
8282
|
+
/* @__PURE__ */ jsx119(
|
|
7887
8283
|
FilledButton_default,
|
|
7888
8284
|
{
|
|
7889
8285
|
copy: cancelLabel,
|
|
@@ -7896,7 +8292,7 @@ var TwoButtonDialog = ({
|
|
|
7896
8292
|
}
|
|
7897
8293
|
}
|
|
7898
8294
|
),
|
|
7899
|
-
/* @__PURE__ */
|
|
8295
|
+
/* @__PURE__ */ jsx119(
|
|
7900
8296
|
FilledButton_default,
|
|
7901
8297
|
{
|
|
7902
8298
|
color: "primary",
|
|
@@ -7905,7 +8301,7 @@ var TwoButtonDialog = ({
|
|
|
7905
8301
|
}
|
|
7906
8302
|
)
|
|
7907
8303
|
] }),
|
|
7908
|
-
/* @__PURE__ */
|
|
8304
|
+
/* @__PURE__ */ jsx119(Loading_default, { isLoading: dialogLoading })
|
|
7909
8305
|
] }) })
|
|
7910
8306
|
}
|
|
7911
8307
|
);
|
|
@@ -7969,6 +8365,7 @@ export {
|
|
|
7969
8365
|
SectionName_default as SectionName,
|
|
7970
8366
|
SmartSelect_default as SmartSelect,
|
|
7971
8367
|
SmartTableHeader_default as SmartTableHeader,
|
|
8368
|
+
SmartTableHeaderFilterMenu_default as SmartTableHeaderFilterMenu,
|
|
7972
8369
|
SquareButton_default as SquareButton,
|
|
7973
8370
|
SquareLabel_default as SquareLabel,
|
|
7974
8371
|
Switch_default as Switch,
|