@natoora-libs/core 0.1.14 → 0.1.16-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/components/index.cjs +1045 -771
- package/dist/components/index.cjs.map +1 -1
- package/dist/components/index.d.cts +52 -30
- package/dist/components/index.d.ts +52 -30
- package/dist/components/index.js +1222 -950
- package/dist/components/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -382,10 +382,10 @@ __export(components_exports, {
|
|
|
382
382
|
SquareLabel: () => SquareLabel_default,
|
|
383
383
|
Switch: () => Switch_default,
|
|
384
384
|
Table: () => Table_default,
|
|
385
|
-
TableDesktop: () =>
|
|
385
|
+
TableDesktop: () => TableDesktop,
|
|
386
|
+
TableDesktopCell: () => TableDesktopCell,
|
|
387
|
+
TableDesktopEditableComponent: () => TableDesktopEditableComponent,
|
|
386
388
|
TableDesktopFooter: () => TableDesktopFooter,
|
|
387
|
-
TableDesktopRowCell: () => TableDesktopRowCell,
|
|
388
|
-
TableDesktopSmartSelect: () => TableDesktopSmartSelect,
|
|
389
389
|
TableEmptyResult: () => TableEmptyResult_default,
|
|
390
390
|
TableHeader: () => TableHeader_default,
|
|
391
391
|
TableLoading: () => TableLoading_default,
|
|
@@ -3017,7 +3017,7 @@ var RoundButton = ({
|
|
|
3017
3017
|
onClick(e);
|
|
3018
3018
|
}
|
|
3019
3019
|
};
|
|
3020
|
-
const
|
|
3020
|
+
const Button16 = /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
3021
3021
|
import_material16.Fab,
|
|
3022
3022
|
{
|
|
3023
3023
|
className: cx(
|
|
@@ -3041,7 +3041,7 @@ var RoundButton = ({
|
|
|
3041
3041
|
children: icon ? iconComponentMap[icon] : children || ""
|
|
3042
3042
|
}
|
|
3043
3043
|
);
|
|
3044
|
-
return tooltip ? /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(import_material16.Tooltip, { title: tooltip, children:
|
|
3044
|
+
return tooltip ? /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(import_material16.Tooltip, { title: tooltip, children: Button16 }) : Button16;
|
|
3045
3045
|
};
|
|
3046
3046
|
var RoundButton_default = RoundButton;
|
|
3047
3047
|
|
|
@@ -6592,6 +6592,7 @@ var SmartSelect = (0, import_react29.forwardRef)(
|
|
|
6592
6592
|
onChange,
|
|
6593
6593
|
inputLabel,
|
|
6594
6594
|
variant = "standard",
|
|
6595
|
+
size,
|
|
6595
6596
|
error,
|
|
6596
6597
|
helperText,
|
|
6597
6598
|
disabled,
|
|
@@ -6646,6 +6647,7 @@ var SmartSelect = (0, import_react29.forwardRef)(
|
|
|
6646
6647
|
import_material55.FormControl,
|
|
6647
6648
|
{
|
|
6648
6649
|
fullWidth: true,
|
|
6650
|
+
size,
|
|
6649
6651
|
className: classes.container,
|
|
6650
6652
|
error,
|
|
6651
6653
|
variant,
|
|
@@ -6664,6 +6666,7 @@ var SmartSelect = (0, import_react29.forwardRef)(
|
|
|
6664
6666
|
import_material55.Select,
|
|
6665
6667
|
{
|
|
6666
6668
|
ref,
|
|
6669
|
+
size,
|
|
6667
6670
|
disabled,
|
|
6668
6671
|
labelId: "smart-select-label",
|
|
6669
6672
|
value: value ?? "",
|
|
@@ -6797,467 +6800,13 @@ var LabelledSwitch = (0, import_mui51.withStyles)(LSwitch, (theme) => ({
|
|
|
6797
6800
|
var Switch_default = (0, import_react31.memo)(LabelledSwitch);
|
|
6798
6801
|
|
|
6799
6802
|
// src/components/SmartTableHeaderFilterMenu/SmartTableHeaderFilterMenu.tsx
|
|
6800
|
-
var import_react34 = require("react");
|
|
6801
|
-
var import_Check = __toESM(require("@mui/icons-material/Check"), 1);
|
|
6802
|
-
var import_material61 = require("@mui/material");
|
|
6803
|
-
var import_classnames3 = __toESM(require("classnames"), 1);
|
|
6804
|
-
var import_mui55 = require("tss-react/mui");
|
|
6805
|
-
|
|
6806
|
-
// src/components/TableDesktop/TableDesktop.tsx
|
|
6807
|
-
var import_react33 = require("react");
|
|
6808
|
-
var import_material60 = require("@mui/material");
|
|
6809
|
-
var import_mui54 = require("tss-react/mui");
|
|
6810
|
-
|
|
6811
|
-
// src/components/SmartTableHeader/SmartTableHeader.tsx
|
|
6812
6803
|
var import_react32 = require("react");
|
|
6804
|
+
var import_Check = __toESM(require("@mui/icons-material/Check"), 1);
|
|
6813
6805
|
var import_material58 = require("@mui/material");
|
|
6806
|
+
var import_classnames3 = __toESM(require("classnames"), 1);
|
|
6814
6807
|
var import_mui52 = require("tss-react/mui");
|
|
6815
6808
|
var import_jsx_runtime109 = require("react/jsx-runtime");
|
|
6816
6809
|
var useStyles46 = (0, import_mui52.makeStyles)()((theme) => ({
|
|
6817
|
-
root: {
|
|
6818
|
-
backgroundColor: colors.neutral100,
|
|
6819
|
-
height: theme.spacing(6),
|
|
6820
|
-
"& .MuiTableSortLabel-root": {
|
|
6821
|
-
fontWeight: 600,
|
|
6822
|
-
fontSize: ".875rem"
|
|
6823
|
-
}
|
|
6824
|
-
},
|
|
6825
|
-
visuallyHidden: {
|
|
6826
|
-
border: 0,
|
|
6827
|
-
clip: "rect(0 0 0 0)",
|
|
6828
|
-
height: 1,
|
|
6829
|
-
margin: -1,
|
|
6830
|
-
overflow: "hidden",
|
|
6831
|
-
padding: 0,
|
|
6832
|
-
position: "absolute",
|
|
6833
|
-
top: 20,
|
|
6834
|
-
width: 1
|
|
6835
|
-
},
|
|
6836
|
-
tableHeaderContent: {
|
|
6837
|
-
borderBottom: "1px solid",
|
|
6838
|
-
borderBottomColor: colors.neutral300,
|
|
6839
|
-
whiteSpace: "nowrap",
|
|
6840
|
-
"& .filter-menu-trigger": {
|
|
6841
|
-
visibility: "hidden",
|
|
6842
|
-
opacity: 0,
|
|
6843
|
-
transition: "visibility 0.1s, opacity 0.1s ease-in"
|
|
6844
|
-
},
|
|
6845
|
-
"&:hover .filter-menu-trigger, & .filter-menu-trigger.has-active-filters": {
|
|
6846
|
-
visibility: "visible",
|
|
6847
|
-
opacity: 1
|
|
6848
|
-
},
|
|
6849
|
-
"&:hover .MuiTableSortLabel-root": {
|
|
6850
|
-
"& .MuiTableSortLabel-icon": {
|
|
6851
|
-
opacity: 1
|
|
6852
|
-
}
|
|
6853
|
-
}
|
|
6854
|
-
},
|
|
6855
|
-
filterMenu: {
|
|
6856
|
-
display: "flex",
|
|
6857
|
-
flexDirection: "column",
|
|
6858
|
-
gap: theme.spacing(0.5)
|
|
6859
|
-
},
|
|
6860
|
-
filterCheckboxDropdown: {
|
|
6861
|
-
display: "flex",
|
|
6862
|
-
flexDirection: "column",
|
|
6863
|
-
padding: theme.spacing(0, 3)
|
|
6864
|
-
},
|
|
6865
|
-
applyFilterButtonsContainer: {
|
|
6866
|
-
display: "flex",
|
|
6867
|
-
padding: theme.spacing(0, 1)
|
|
6868
|
-
}
|
|
6869
|
-
}));
|
|
6870
|
-
var SmartTableHeader = ({
|
|
6871
|
-
order,
|
|
6872
|
-
orderBy,
|
|
6873
|
-
headCells,
|
|
6874
|
-
numSelected,
|
|
6875
|
-
numRows,
|
|
6876
|
-
enableCheckboxSelection = false,
|
|
6877
|
-
headerFilters,
|
|
6878
|
-
onRequestSort,
|
|
6879
|
-
onSelectAllClick,
|
|
6880
|
-
onApplyFilters,
|
|
6881
|
-
shouldShowCheckOnFilter
|
|
6882
|
-
}) => {
|
|
6883
|
-
const { classes } = useStyles46();
|
|
6884
|
-
const createSortHandler = (property) => (event) => {
|
|
6885
|
-
onRequestSort(event, property);
|
|
6886
|
-
};
|
|
6887
|
-
const isSortActive = (headCellId) => orderBy === headCellId;
|
|
6888
|
-
return /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(import_material58.TableHead, { className: classes.root, children: /* @__PURE__ */ (0, import_jsx_runtime109.jsxs)(import_material58.TableRow, { children: [
|
|
6889
|
-
enableCheckboxSelection ? /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(import_material58.TableCell, { padding: "checkbox", children: /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(
|
|
6890
|
-
import_material58.Checkbox,
|
|
6891
|
-
{
|
|
6892
|
-
color: "primary",
|
|
6893
|
-
disableRipple: true,
|
|
6894
|
-
indeterminate: numSelected > 0 && numSelected < numRows,
|
|
6895
|
-
checked: numRows > 0 && numSelected === numRows,
|
|
6896
|
-
onChange: onSelectAllClick
|
|
6897
|
-
}
|
|
6898
|
-
) }) : null,
|
|
6899
|
-
headCells.map((headCell) => /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(
|
|
6900
|
-
import_material58.TableCell,
|
|
6901
|
-
{
|
|
6902
|
-
className: classes.tableHeaderContent,
|
|
6903
|
-
align: "left",
|
|
6904
|
-
width: headCell.width ?? "auto",
|
|
6905
|
-
sortDirection: orderBy === headCell.id ? order : false,
|
|
6906
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime109.jsxs)(
|
|
6907
|
-
import_material58.Box,
|
|
6908
|
-
{
|
|
6909
|
-
display: "flex",
|
|
6910
|
-
flexDirection: "row",
|
|
6911
|
-
gap: headCell.disableSort ? 1 : 0,
|
|
6912
|
-
children: [
|
|
6913
|
-
headCell.disableSort ? /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(import_material58.Typography, { variant: "subtitle2", mt: 0.25, fontWeight: 600, children: headCell.label }) : /* @__PURE__ */ (0, import_jsx_runtime109.jsxs)(
|
|
6914
|
-
import_material58.TableSortLabel,
|
|
6915
|
-
{
|
|
6916
|
-
"data-testid": "table-sort-label",
|
|
6917
|
-
active: isSortActive(headCell.id),
|
|
6918
|
-
direction: orderBy === headCell.id ? order : "asc",
|
|
6919
|
-
onClick: createSortHandler(headCell.id),
|
|
6920
|
-
children: [
|
|
6921
|
-
headCell.RenderHeader ?? headCell.label,
|
|
6922
|
-
orderBy === headCell.id ? /* @__PURE__ */ (0, import_jsx_runtime109.jsx)("span", { className: classes.visuallyHidden, children: order === "desc" ? "sorted descending" : "sorted ascending" }) : null
|
|
6923
|
-
]
|
|
6924
|
-
}
|
|
6925
|
-
),
|
|
6926
|
-
headCell.refetchFilterOptions ? /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(
|
|
6927
|
-
SmartTableHeaderFilterMenu_default,
|
|
6928
|
-
{
|
|
6929
|
-
headCell,
|
|
6930
|
-
headerFilters,
|
|
6931
|
-
numActiveFilters: headerFilters[headCell.id]?.length ?? 0,
|
|
6932
|
-
onApplyFilters,
|
|
6933
|
-
shouldShowCheckOnFilter
|
|
6934
|
-
}
|
|
6935
|
-
) : null
|
|
6936
|
-
]
|
|
6937
|
-
}
|
|
6938
|
-
)
|
|
6939
|
-
},
|
|
6940
|
-
headCell.id
|
|
6941
|
-
))
|
|
6942
|
-
] }) });
|
|
6943
|
-
};
|
|
6944
|
-
var SmartTableHeader_default = (0, import_react32.memo)(SmartTableHeader);
|
|
6945
|
-
|
|
6946
|
-
// src/components/TableDesktopNoColumnsMessage/TableDesktopNoColumnsMessage.tsx
|
|
6947
|
-
var import_TableBody = __toESM(require("@mui/material/TableBody"), 1);
|
|
6948
|
-
var import_TableCell = __toESM(require("@mui/material/TableCell"), 1);
|
|
6949
|
-
var import_TableRow = __toESM(require("@mui/material/TableRow"), 1);
|
|
6950
|
-
var import_Typography = __toESM(require("@mui/material/Typography"), 1);
|
|
6951
|
-
var import_jsx_runtime110 = require("react/jsx-runtime");
|
|
6952
|
-
var TableDesktopNoColumnsMessage = () => /* @__PURE__ */ (0, import_jsx_runtime110.jsx)(import_TableBody.default, { children: /* @__PURE__ */ (0, import_jsx_runtime110.jsx)(import_TableRow.default, { children: /* @__PURE__ */ (0, import_jsx_runtime110.jsxs)(
|
|
6953
|
-
import_TableCell.default,
|
|
6954
|
-
{
|
|
6955
|
-
sx: {
|
|
6956
|
-
py: 8,
|
|
6957
|
-
gap: 2,
|
|
6958
|
-
borderBottom: "none",
|
|
6959
|
-
display: "flex",
|
|
6960
|
-
flexDirection: "column",
|
|
6961
|
-
justifyContent: "center",
|
|
6962
|
-
alignItems: "center"
|
|
6963
|
-
},
|
|
6964
|
-
children: [
|
|
6965
|
-
/* @__PURE__ */ (0, import_jsx_runtime110.jsx)(import_Typography.default, { variant: "subtitle2", fontSize: 16, children: "Customise your view" }),
|
|
6966
|
-
/* @__PURE__ */ (0, import_jsx_runtime110.jsxs)(import_Typography.default, { variant: "subtitle1", align: "center", color: "textSecondary", children: [
|
|
6967
|
-
"Use the column selector on the right to choose which fields",
|
|
6968
|
-
/* @__PURE__ */ (0, import_jsx_runtime110.jsx)("br", {}),
|
|
6969
|
-
"you want to display in the table"
|
|
6970
|
-
] })
|
|
6971
|
-
]
|
|
6972
|
-
}
|
|
6973
|
-
) }) });
|
|
6974
|
-
|
|
6975
|
-
// src/components/TableEmptyResult/TableEmptyResult.tsx
|
|
6976
|
-
var import_material59 = require("@mui/material");
|
|
6977
|
-
var import_mui53 = require("tss-react/mui");
|
|
6978
|
-
var import_jsx_runtime111 = require("react/jsx-runtime");
|
|
6979
|
-
var useStyles47 = (0, import_mui53.makeStyles)()(() => ({
|
|
6980
|
-
tableCellIcon: { padding: 24, height: "calc(100vh - 320px)" },
|
|
6981
|
-
tableCellDefault: { padding: 24 }
|
|
6982
|
-
}));
|
|
6983
|
-
var TableEmptyResult = ({
|
|
6984
|
-
colSpan,
|
|
6985
|
-
showClearFilterButton = false,
|
|
6986
|
-
handleClickOnClearFiltersButton = () => {
|
|
6987
|
-
}
|
|
6988
|
-
}) => {
|
|
6989
|
-
const { classes } = useStyles47();
|
|
6990
|
-
return showClearFilterButton ? /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(import_material59.TableRow, { children: /* @__PURE__ */ (0, import_jsx_runtime111.jsxs)(
|
|
6991
|
-
import_material59.TableCell,
|
|
6992
|
-
{
|
|
6993
|
-
className: classes.tableCellIcon,
|
|
6994
|
-
colSpan,
|
|
6995
|
-
align: "center",
|
|
6996
|
-
children: [
|
|
6997
|
-
/* @__PURE__ */ (0, import_jsx_runtime111.jsx)(EmptyGlassIcon_default, {}),
|
|
6998
|
-
/* @__PURE__ */ (0, import_jsx_runtime111.jsx)(import_material59.Typography, { variant: "h6", children: "No results found." }),
|
|
6999
|
-
/* @__PURE__ */ (0, import_jsx_runtime111.jsx)(import_material59.Typography, { variant: "subtitle1", children: "Search without applied filters?" }),
|
|
7000
|
-
/* @__PURE__ */ (0, import_jsx_runtime111.jsx)(
|
|
7001
|
-
FilledButton_default,
|
|
7002
|
-
{
|
|
7003
|
-
copy: "Search",
|
|
7004
|
-
variant: "contained",
|
|
7005
|
-
color: "primary",
|
|
7006
|
-
onClick: handleClickOnClearFiltersButton
|
|
7007
|
-
}
|
|
7008
|
-
)
|
|
7009
|
-
]
|
|
7010
|
-
}
|
|
7011
|
-
) }) : /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(import_material59.TableRow, { children: /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(
|
|
7012
|
-
import_material59.TableCell,
|
|
7013
|
-
{
|
|
7014
|
-
className: classes.tableCellDefault,
|
|
7015
|
-
colSpan,
|
|
7016
|
-
align: "center",
|
|
7017
|
-
children: "Nothing to display"
|
|
7018
|
-
}
|
|
7019
|
-
) });
|
|
7020
|
-
};
|
|
7021
|
-
var TableEmptyResult_default = TableEmptyResult;
|
|
7022
|
-
|
|
7023
|
-
// src/components/TableDesktop/TableDesktop.tsx
|
|
7024
|
-
var import_jsx_runtime112 = require("react/jsx-runtime");
|
|
7025
|
-
var ROW_HEIGHT = 56;
|
|
7026
|
-
var useStyles48 = (0, import_mui54.makeStyles)()((theme) => ({
|
|
7027
|
-
root: {
|
|
7028
|
-
justifyContent: "space-between",
|
|
7029
|
-
display: "flex",
|
|
7030
|
-
justifyItems: "stretch"
|
|
7031
|
-
},
|
|
7032
|
-
paper: {
|
|
7033
|
-
width: "100%",
|
|
7034
|
-
display: "flex",
|
|
7035
|
-
flexDirection: "column",
|
|
7036
|
-
justifyContent: "space-between"
|
|
7037
|
-
},
|
|
7038
|
-
container: {
|
|
7039
|
-
maxHeight: "100%",
|
|
7040
|
-
"&::-webkit-scrollbar": {
|
|
7041
|
-
width: "8px",
|
|
7042
|
-
height: "8px"
|
|
7043
|
-
},
|
|
7044
|
-
"&::-webkit-scrollbar-track": {
|
|
7045
|
-
backgroundColor: theme.palette.mode === "dark" ? theme.palette.grey[800] : theme.palette.grey[100]
|
|
7046
|
-
},
|
|
7047
|
-
"&::-webkit-scrollbar-thumb": {
|
|
7048
|
-
backgroundColor: theme.palette.mode === "dark" ? theme.palette.grey[900] : theme.palette.grey[400],
|
|
7049
|
-
borderRadius: "10px"
|
|
7050
|
-
},
|
|
7051
|
-
"&::-webkit-scrollbar-thumb:hover": {
|
|
7052
|
-
backgroundColor: theme.palette.mode === "dark" ? theme.palette.common.black : theme.palette.grey[500]
|
|
7053
|
-
}
|
|
7054
|
-
}
|
|
7055
|
-
}));
|
|
7056
|
-
var descendingComparator = (a, b, orderBy) => {
|
|
7057
|
-
const objA = a[orderBy];
|
|
7058
|
-
const objB = b[orderBy];
|
|
7059
|
-
const valA = typeof objA === "object" ? objA?.name : objA;
|
|
7060
|
-
const valB = typeof objB === "object" ? objB?.name : objB;
|
|
7061
|
-
if (!valA && !valB) {
|
|
7062
|
-
return 0;
|
|
7063
|
-
}
|
|
7064
|
-
if (valA && !valB) {
|
|
7065
|
-
return -1;
|
|
7066
|
-
}
|
|
7067
|
-
if (!valA && valB) {
|
|
7068
|
-
return 1;
|
|
7069
|
-
}
|
|
7070
|
-
if (valA > valB) {
|
|
7071
|
-
return -1;
|
|
7072
|
-
}
|
|
7073
|
-
if (valA < valB) {
|
|
7074
|
-
return 1;
|
|
7075
|
-
}
|
|
7076
|
-
return 0;
|
|
7077
|
-
};
|
|
7078
|
-
var stableSort = (array, cmp) => array.map((el, index) => ({ el, index })).sort((a, b) => {
|
|
7079
|
-
const order = cmp(a.el, b.el);
|
|
7080
|
-
return order !== 0 ? order : a.index - b.index;
|
|
7081
|
-
}).map((el) => el.el);
|
|
7082
|
-
var getComparator = (order, orderBy) => order === "desc" ? (a, b) => descendingComparator(a, b, orderBy) : (a, b) => -descendingComparator(a, b, orderBy);
|
|
7083
|
-
var resolveOptionType = (option, fieldName) => {
|
|
7084
|
-
if (!option || typeof option !== "object") {
|
|
7085
|
-
return option;
|
|
7086
|
-
}
|
|
7087
|
-
return option[fieldName] || "";
|
|
7088
|
-
};
|
|
7089
|
-
var TableDesktop = ({
|
|
7090
|
-
data,
|
|
7091
|
-
headCells,
|
|
7092
|
-
RenderItem,
|
|
7093
|
-
appliedFilters,
|
|
7094
|
-
headerFilters,
|
|
7095
|
-
children,
|
|
7096
|
-
height,
|
|
7097
|
-
isLoading,
|
|
7098
|
-
rowsPerPage = 50,
|
|
7099
|
-
enableCheckboxSelection = false,
|
|
7100
|
-
disableInternalSort = false,
|
|
7101
|
-
updateSort,
|
|
7102
|
-
showClearFilterButton,
|
|
7103
|
-
handleClickOnClearFiltersButton,
|
|
7104
|
-
deleteItem,
|
|
7105
|
-
keyField = "id",
|
|
7106
|
-
tableLayout = "auto",
|
|
7107
|
-
onApplyFilters,
|
|
7108
|
-
shouldShowCheckOnFilter
|
|
7109
|
-
}) => {
|
|
7110
|
-
const { classes } = useStyles48();
|
|
7111
|
-
const [order, setOrder] = (0, import_react33.useState)(appliedFilters?.sortDir || "desc");
|
|
7112
|
-
const [orderBy, setOrderBy] = (0, import_react33.useState)(
|
|
7113
|
-
appliedFilters?.sortField || "delivery_date"
|
|
7114
|
-
);
|
|
7115
|
-
const [selected, setSelected] = (0, import_react33.useState)(/* @__PURE__ */ new Set());
|
|
7116
|
-
const [page] = (0, import_react33.useState)(0);
|
|
7117
|
-
const numRows = data.length;
|
|
7118
|
-
const emptyRows = (0, import_react33.useMemo)(
|
|
7119
|
-
() => rowsPerPage - data.length,
|
|
7120
|
-
[rowsPerPage, data]
|
|
7121
|
-
);
|
|
7122
|
-
const visibleHeadCells = (0, import_react33.useMemo)(
|
|
7123
|
-
() => headCells.filter((headCell) => headCell?.enabled ?? true),
|
|
7124
|
-
[headCells]
|
|
7125
|
-
);
|
|
7126
|
-
const handleSelectAllClick = (0, import_react33.useCallback)(
|
|
7127
|
-
(event) => {
|
|
7128
|
-
if (event.target.checked) {
|
|
7129
|
-
const allItems = new Set(data.map((n) => n[keyField]));
|
|
7130
|
-
setSelected(allItems);
|
|
7131
|
-
} else {
|
|
7132
|
-
setSelected(/* @__PURE__ */ new Set());
|
|
7133
|
-
}
|
|
7134
|
-
},
|
|
7135
|
-
[data, keyField]
|
|
7136
|
-
);
|
|
7137
|
-
const handleRequestSort = (event, property) => {
|
|
7138
|
-
const isAsc = orderBy === property && order === "asc";
|
|
7139
|
-
const orderDir = isAsc ? "desc" : "asc";
|
|
7140
|
-
setOrder(orderDir);
|
|
7141
|
-
setOrderBy(property);
|
|
7142
|
-
if (updateSort) {
|
|
7143
|
-
updateSort(property, orderDir);
|
|
7144
|
-
}
|
|
7145
|
-
};
|
|
7146
|
-
const handleRowCheckboxChange = (0, import_react33.useCallback)(
|
|
7147
|
-
(event, keyFieldValue) => {
|
|
7148
|
-
event.stopPropagation();
|
|
7149
|
-
setSelected((prev) => {
|
|
7150
|
-
const newSelected = new Set(prev);
|
|
7151
|
-
if (newSelected.has(keyFieldValue)) {
|
|
7152
|
-
newSelected.delete(keyFieldValue);
|
|
7153
|
-
} else {
|
|
7154
|
-
newSelected.add(keyFieldValue);
|
|
7155
|
-
}
|
|
7156
|
-
return newSelected;
|
|
7157
|
-
});
|
|
7158
|
-
},
|
|
7159
|
-
[]
|
|
7160
|
-
);
|
|
7161
|
-
const renderTableRows = (0, import_react33.useMemo)(() => {
|
|
7162
|
-
if (isLoading) {
|
|
7163
|
-
return [...Array(Math.min(numRows, rowsPerPage))].map((_, rowIndex) => /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(import_material60.TableRow, { children: [...Array(visibleHeadCells.length)].map((_2, cellIndex) => /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(import_material60.TableCell, { children: /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(
|
|
7164
|
-
import_material60.Skeleton,
|
|
7165
|
-
{
|
|
7166
|
-
animation: "pulse",
|
|
7167
|
-
variant: "rounded",
|
|
7168
|
-
height: ROW_HEIGHT - 33,
|
|
7169
|
-
sx: { bgcolor: colors.neutral100 },
|
|
7170
|
-
"data-testid": "loading-skeleton"
|
|
7171
|
-
}
|
|
7172
|
-
) }, cellIndex)) }, rowIndex));
|
|
7173
|
-
}
|
|
7174
|
-
const sortedData = disableInternalSort ? data : stableSort(data, getComparator(order, orderBy));
|
|
7175
|
-
return sortedData.slice(page * rowsPerPage, page * rowsPerPage + rowsPerPage).map((row, index) => {
|
|
7176
|
-
const isItemSelected = selected.has(row[keyField]);
|
|
7177
|
-
return /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(
|
|
7178
|
-
RenderItem,
|
|
7179
|
-
{
|
|
7180
|
-
...{
|
|
7181
|
-
...row,
|
|
7182
|
-
index,
|
|
7183
|
-
deleteItem,
|
|
7184
|
-
isItemSelected,
|
|
7185
|
-
enableCheckboxSelection,
|
|
7186
|
-
rowHeight: ROW_HEIGHT,
|
|
7187
|
-
rowId: row[keyField],
|
|
7188
|
-
handleRowCheckboxChange,
|
|
7189
|
-
visibleHeadCells
|
|
7190
|
-
}
|
|
7191
|
-
},
|
|
7192
|
-
row[keyField] ?? index
|
|
7193
|
-
);
|
|
7194
|
-
});
|
|
7195
|
-
}, [
|
|
7196
|
-
data,
|
|
7197
|
-
order,
|
|
7198
|
-
orderBy,
|
|
7199
|
-
page,
|
|
7200
|
-
rowsPerPage,
|
|
7201
|
-
selected,
|
|
7202
|
-
isLoading,
|
|
7203
|
-
numRows,
|
|
7204
|
-
enableCheckboxSelection,
|
|
7205
|
-
disableInternalSort,
|
|
7206
|
-
deleteItem,
|
|
7207
|
-
keyField,
|
|
7208
|
-
handleRowCheckboxChange,
|
|
7209
|
-
visibleHeadCells,
|
|
7210
|
-
RenderItem
|
|
7211
|
-
]);
|
|
7212
|
-
(0, import_react33.useEffect)(() => {
|
|
7213
|
-
if (!enableCheckboxSelection) {
|
|
7214
|
-
setSelected(/* @__PURE__ */ new Set());
|
|
7215
|
-
}
|
|
7216
|
-
}, [enableCheckboxSelection]);
|
|
7217
|
-
return /* @__PURE__ */ (0, import_jsx_runtime112.jsx)("div", { className: classes.root, style: { height }, children: /* @__PURE__ */ (0, import_jsx_runtime112.jsxs)(import_material60.Paper, { className: classes.paper, children: [
|
|
7218
|
-
/* @__PURE__ */ (0, import_jsx_runtime112.jsx)(import_material60.TableContainer, { className: classes.container, children: /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(
|
|
7219
|
-
import_material60.Table,
|
|
7220
|
-
{
|
|
7221
|
-
stickyHeader: true,
|
|
7222
|
-
"aria-labelledby": "tableTitle",
|
|
7223
|
-
"aria-label": "sticky table",
|
|
7224
|
-
style: { tableLayout },
|
|
7225
|
-
children: visibleHeadCells.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(TableDesktopNoColumnsMessage, {}) : /* @__PURE__ */ (0, import_jsx_runtime112.jsxs)(import_jsx_runtime112.Fragment, { children: [
|
|
7226
|
-
/* @__PURE__ */ (0, import_jsx_runtime112.jsx)(
|
|
7227
|
-
SmartTableHeader_default,
|
|
7228
|
-
{
|
|
7229
|
-
headCells: visibleHeadCells,
|
|
7230
|
-
order,
|
|
7231
|
-
orderBy,
|
|
7232
|
-
numSelected: selected.size,
|
|
7233
|
-
numRows,
|
|
7234
|
-
enableCheckboxSelection,
|
|
7235
|
-
headerFilters: headerFilters ?? {},
|
|
7236
|
-
onRequestSort: handleRequestSort,
|
|
7237
|
-
onSelectAllClick: handleSelectAllClick,
|
|
7238
|
-
onApplyFilters,
|
|
7239
|
-
shouldShowCheckOnFilter
|
|
7240
|
-
}
|
|
7241
|
-
),
|
|
7242
|
-
/* @__PURE__ */ (0, import_jsx_runtime112.jsx)(import_material60.TableBody, { children: rowsPerPage !== emptyRows ? renderTableRows : /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(
|
|
7243
|
-
TableEmptyResult_default,
|
|
7244
|
-
{
|
|
7245
|
-
colSpan: enableCheckboxSelection ? visibleHeadCells.length + 1 : visibleHeadCells.length,
|
|
7246
|
-
showClearFilterButton,
|
|
7247
|
-
handleClickOnClearFiltersButton
|
|
7248
|
-
}
|
|
7249
|
-
) })
|
|
7250
|
-
] })
|
|
7251
|
-
}
|
|
7252
|
-
) }),
|
|
7253
|
-
children
|
|
7254
|
-
] }) });
|
|
7255
|
-
};
|
|
7256
|
-
var TableDesktop_default = TableDesktop;
|
|
7257
|
-
|
|
7258
|
-
// src/components/SmartTableHeaderFilterMenu/SmartTableHeaderFilterMenu.tsx
|
|
7259
|
-
var import_jsx_runtime113 = require("react/jsx-runtime");
|
|
7260
|
-
var useStyles49 = (0, import_mui55.makeStyles)()((theme) => ({
|
|
7261
6810
|
filterMenu: {
|
|
7262
6811
|
display: "flex",
|
|
7263
6812
|
flexDirection: "column"
|
|
@@ -7299,6 +6848,12 @@ var useStyles49 = (0, import_mui55.makeStyles)()((theme) => ({
|
|
|
7299
6848
|
margin: theme.spacing(1)
|
|
7300
6849
|
}
|
|
7301
6850
|
}));
|
|
6851
|
+
var resolveOptionType = (option, fieldName) => {
|
|
6852
|
+
if (!option || typeof option !== "object") {
|
|
6853
|
+
return option;
|
|
6854
|
+
}
|
|
6855
|
+
return option[fieldName] || "";
|
|
6856
|
+
};
|
|
7302
6857
|
var findFilterIndex = (filters, filterOption) => filters.findIndex((item) => {
|
|
7303
6858
|
if (typeof item === "string" && typeof filterOption === "string") {
|
|
7304
6859
|
return item === filterOption;
|
|
@@ -7315,18 +6870,18 @@ var SmartTableHeaderFilterMenu = ({
|
|
|
7315
6870
|
shouldShowCheckOnFilter,
|
|
7316
6871
|
onApplyFilters
|
|
7317
6872
|
}) => {
|
|
7318
|
-
const { classes } =
|
|
7319
|
-
const [anchorEl, setAnchorEl] = (0,
|
|
7320
|
-
const [filterOptionsData, setFilterOptionsData] = (0,
|
|
7321
|
-
const [selectedFilters, setSelectedFilters] = (0,
|
|
6873
|
+
const { classes } = useStyles46();
|
|
6874
|
+
const [anchorEl, setAnchorEl] = (0, import_react32.useState)(null);
|
|
6875
|
+
const [filterOptionsData, setFilterOptionsData] = (0, import_react32.useState)();
|
|
6876
|
+
const [selectedFilters, setSelectedFilters] = (0, import_react32.useState)(
|
|
7322
6877
|
headerFilters[headCell.id] ?? []
|
|
7323
6878
|
);
|
|
7324
|
-
(0,
|
|
6879
|
+
(0, import_react32.useEffect)(() => {
|
|
7325
6880
|
if (headCell.filterOptions) {
|
|
7326
6881
|
setFilterOptionsData(headCell.filterOptions);
|
|
7327
6882
|
}
|
|
7328
6883
|
}, [headCell.filterOptions]);
|
|
7329
|
-
const numFilterOptions = (0,
|
|
6884
|
+
const numFilterOptions = (0, import_react32.useMemo)(() => filterOptionsData?.length ?? 0, [filterOptionsData?.length]);
|
|
7330
6885
|
const numCurrentSelectedFilters = selectedFilters.length;
|
|
7331
6886
|
const handleFilterMenuOpen = (event) => {
|
|
7332
6887
|
if (!numFilterOptions) {
|
|
@@ -7362,24 +6917,24 @@ var SmartTableHeaderFilterMenu = ({
|
|
|
7362
6917
|
onApplyFilters?.(updatedFilters, shouldSave);
|
|
7363
6918
|
setAnchorEl(null);
|
|
7364
6919
|
};
|
|
7365
|
-
(0,
|
|
6920
|
+
(0, import_react32.useEffect)(() => {
|
|
7366
6921
|
setSelectedFilters(headerFilters[headCell.id] ?? []);
|
|
7367
6922
|
}, [headerFilters, headCell.id]);
|
|
7368
|
-
const isOptionChecked = (0,
|
|
6923
|
+
const isOptionChecked = (0, import_react32.useMemo)(() => (resolvedOption) => !!selectedFilters?.some(
|
|
7369
6924
|
(value) => resolveOptionType(value, headCell.fieldName ?? "") === resolvedOption
|
|
7370
6925
|
), [selectedFilters]);
|
|
7371
|
-
const loadingSkeletons = /* @__PURE__ */ (0,
|
|
7372
|
-
/* @__PURE__ */ (0,
|
|
7373
|
-
/* @__PURE__ */ (0,
|
|
7374
|
-
/* @__PURE__ */ (0,
|
|
7375
|
-
/* @__PURE__ */ (0,
|
|
7376
|
-
/* @__PURE__ */ (0,
|
|
7377
|
-
/* @__PURE__ */ (0,
|
|
7378
|
-
/* @__PURE__ */ (0,
|
|
7379
|
-
/* @__PURE__ */ (0,
|
|
6926
|
+
const loadingSkeletons = /* @__PURE__ */ (0, import_jsx_runtime109.jsxs)(import_material58.Box, { "data-testid": "loading-skeletons", width: 272, children: [
|
|
6927
|
+
/* @__PURE__ */ (0, import_jsx_runtime109.jsx)(import_material58.Skeleton, { variant: "rounded", className: classes.skeleton }),
|
|
6928
|
+
/* @__PURE__ */ (0, import_jsx_runtime109.jsx)(import_material58.Divider, {}),
|
|
6929
|
+
/* @__PURE__ */ (0, import_jsx_runtime109.jsx)(import_material58.Skeleton, { variant: "rounded", className: classes.skeleton }),
|
|
6930
|
+
/* @__PURE__ */ (0, import_jsx_runtime109.jsx)(import_material58.Skeleton, { variant: "rounded", className: classes.skeleton }),
|
|
6931
|
+
/* @__PURE__ */ (0, import_jsx_runtime109.jsx)(import_material58.Skeleton, { variant: "rounded", className: classes.skeleton }),
|
|
6932
|
+
/* @__PURE__ */ (0, import_jsx_runtime109.jsx)(import_material58.Skeleton, { variant: "rounded", className: classes.skeleton }),
|
|
6933
|
+
/* @__PURE__ */ (0, import_jsx_runtime109.jsx)(import_material58.Divider, {}),
|
|
6934
|
+
/* @__PURE__ */ (0, import_jsx_runtime109.jsx)(import_material58.Skeleton, { variant: "rounded", className: classes.skeleton })
|
|
7380
6935
|
] });
|
|
7381
|
-
return /* @__PURE__ */ (0,
|
|
7382
|
-
/* @__PURE__ */ (0,
|
|
6936
|
+
return /* @__PURE__ */ (0, import_jsx_runtime109.jsxs)(import_jsx_runtime109.Fragment, { children: [
|
|
6937
|
+
/* @__PURE__ */ (0, import_jsx_runtime109.jsx)(
|
|
7383
6938
|
ActiveFiltersIconButton_default,
|
|
7384
6939
|
{
|
|
7385
6940
|
numActiveFilters,
|
|
@@ -7389,8 +6944,8 @@ var SmartTableHeaderFilterMenu = ({
|
|
|
7389
6944
|
})
|
|
7390
6945
|
}
|
|
7391
6946
|
),
|
|
7392
|
-
/* @__PURE__ */ (0,
|
|
7393
|
-
|
|
6947
|
+
/* @__PURE__ */ (0, import_jsx_runtime109.jsx)(
|
|
6948
|
+
import_material58.Menu,
|
|
7394
6949
|
{
|
|
7395
6950
|
open: !!anchorEl,
|
|
7396
6951
|
onClose: handleFilterMenuClose,
|
|
@@ -7398,13 +6953,13 @@ var SmartTableHeaderFilterMenu = ({
|
|
|
7398
6953
|
"data-testid": "filter-menu",
|
|
7399
6954
|
anchorOrigin: { vertical: "bottom", horizontal: "right" },
|
|
7400
6955
|
transformOrigin: { vertical: "top", horizontal: "right" },
|
|
7401
|
-
children: headCell.isFetchingFilterOptions ? loadingSkeletons : /* @__PURE__ */ (0,
|
|
7402
|
-
/* @__PURE__ */ (0,
|
|
7403
|
-
|
|
6956
|
+
children: headCell.isFetchingFilterOptions ? loadingSkeletons : /* @__PURE__ */ (0, import_jsx_runtime109.jsxs)(import_material58.Box, { className: classes.filterMenu, children: [
|
|
6957
|
+
/* @__PURE__ */ (0, import_jsx_runtime109.jsx)(import_material58.Box, { px: 3, mb: 0.5, children: /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(
|
|
6958
|
+
import_material58.FormControlLabel,
|
|
7404
6959
|
{
|
|
7405
6960
|
label: "Select All",
|
|
7406
|
-
control: /* @__PURE__ */ (0,
|
|
7407
|
-
|
|
6961
|
+
control: /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(
|
|
6962
|
+
import_material58.Checkbox,
|
|
7408
6963
|
{
|
|
7409
6964
|
disableRipple: true,
|
|
7410
6965
|
checked: numCurrentSelectedFilters === numFilterOptions,
|
|
@@ -7420,21 +6975,21 @@ var SmartTableHeaderFilterMenu = ({
|
|
|
7420
6975
|
)
|
|
7421
6976
|
}
|
|
7422
6977
|
) }),
|
|
7423
|
-
/* @__PURE__ */ (0,
|
|
7424
|
-
/* @__PURE__ */ (0,
|
|
6978
|
+
/* @__PURE__ */ (0, import_jsx_runtime109.jsx)(import_material58.Divider, { sx: { mb: 0.5 } }),
|
|
6979
|
+
/* @__PURE__ */ (0, import_jsx_runtime109.jsx)(import_material58.Box, { className: classes.filterOptions, children: filterOptionsData?.map(
|
|
7425
6980
|
(option) => {
|
|
7426
6981
|
const resolvedOption = resolveOptionType(option, headCell.fieldName ?? "");
|
|
7427
|
-
return /* @__PURE__ */ (0,
|
|
7428
|
-
|
|
6982
|
+
return /* @__PURE__ */ (0, import_jsx_runtime109.jsxs)(
|
|
6983
|
+
import_material58.Box,
|
|
7429
6984
|
{
|
|
7430
6985
|
className: classes.filter,
|
|
7431
6986
|
children: [
|
|
7432
|
-
/* @__PURE__ */ (0,
|
|
7433
|
-
|
|
6987
|
+
/* @__PURE__ */ (0, import_jsx_runtime109.jsx)(
|
|
6988
|
+
import_material58.FormControlLabel,
|
|
7434
6989
|
{
|
|
7435
6990
|
label: resolvedOption,
|
|
7436
|
-
control: /* @__PURE__ */ (0,
|
|
7437
|
-
|
|
6991
|
+
control: /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(
|
|
6992
|
+
import_material58.Checkbox,
|
|
7438
6993
|
{
|
|
7439
6994
|
disableRipple: true,
|
|
7440
6995
|
onChange: () => handleFilterOptionClick(option),
|
|
@@ -7444,16 +6999,16 @@ var SmartTableHeaderFilterMenu = ({
|
|
|
7444
6999
|
},
|
|
7445
7000
|
resolvedOption
|
|
7446
7001
|
),
|
|
7447
|
-
shouldShowCheckOnFilter?.(headCell.id, option) ? /* @__PURE__ */ (0,
|
|
7002
|
+
shouldShowCheckOnFilter?.(headCell.id, option) ? /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(import_material58.Tooltip, { title: "This filter is saved as default", children: /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(import_Check.default, { fontSize: "small", color: "action" }) }) : null
|
|
7448
7003
|
]
|
|
7449
7004
|
},
|
|
7450
7005
|
resolvedOption
|
|
7451
7006
|
);
|
|
7452
7007
|
}
|
|
7453
7008
|
) }),
|
|
7454
|
-
/* @__PURE__ */ (0,
|
|
7455
|
-
/* @__PURE__ */ (0,
|
|
7456
|
-
/* @__PURE__ */ (0,
|
|
7009
|
+
/* @__PURE__ */ (0, import_jsx_runtime109.jsx)(import_material58.Divider, { sx: { mb: 0.5 } }),
|
|
7010
|
+
/* @__PURE__ */ (0, import_jsx_runtime109.jsxs)(import_material58.Box, { className: classes.applyFilterButtonsContainer, children: [
|
|
7011
|
+
/* @__PURE__ */ (0, import_jsx_runtime109.jsx)(
|
|
7457
7012
|
ExtendedButton_default,
|
|
7458
7013
|
{
|
|
7459
7014
|
copy: "Save as Default",
|
|
@@ -7464,7 +7019,7 @@ var SmartTableHeaderFilterMenu = ({
|
|
|
7464
7019
|
onClick: () => handleApplyFilters(true)
|
|
7465
7020
|
}
|
|
7466
7021
|
),
|
|
7467
|
-
/* @__PURE__ */ (0,
|
|
7022
|
+
/* @__PURE__ */ (0, import_jsx_runtime109.jsx)(
|
|
7468
7023
|
ExtendedButton_default,
|
|
7469
7024
|
{
|
|
7470
7025
|
copy: "Apply",
|
|
@@ -7479,23 +7034,158 @@ var SmartTableHeaderFilterMenu = ({
|
|
|
7479
7034
|
)
|
|
7480
7035
|
] });
|
|
7481
7036
|
};
|
|
7482
|
-
var SmartTableHeaderFilterMenu_default = (0,
|
|
7037
|
+
var SmartTableHeaderFilterMenu_default = (0, import_react32.memo)(SmartTableHeaderFilterMenu);
|
|
7038
|
+
|
|
7039
|
+
// src/components/SmartTableHeader/SmartTableHeader.tsx
|
|
7040
|
+
var import_react33 = require("react");
|
|
7041
|
+
var import_material59 = require("@mui/material");
|
|
7042
|
+
var import_mui53 = require("tss-react/mui");
|
|
7043
|
+
var import_jsx_runtime110 = require("react/jsx-runtime");
|
|
7044
|
+
var useStyles47 = (0, import_mui53.makeStyles)()((theme) => ({
|
|
7045
|
+
root: {
|
|
7046
|
+
backgroundColor: colors.neutral100,
|
|
7047
|
+
height: theme.spacing(6),
|
|
7048
|
+
"& .MuiTableSortLabel-root": {
|
|
7049
|
+
fontWeight: 600,
|
|
7050
|
+
fontSize: ".875rem"
|
|
7051
|
+
}
|
|
7052
|
+
},
|
|
7053
|
+
visuallyHidden: {
|
|
7054
|
+
border: 0,
|
|
7055
|
+
clip: "rect(0 0 0 0)",
|
|
7056
|
+
height: 1,
|
|
7057
|
+
margin: -1,
|
|
7058
|
+
overflow: "hidden",
|
|
7059
|
+
padding: 0,
|
|
7060
|
+
position: "absolute",
|
|
7061
|
+
top: 20,
|
|
7062
|
+
width: 1
|
|
7063
|
+
},
|
|
7064
|
+
tableHeaderContent: {
|
|
7065
|
+
borderBottom: "1px solid",
|
|
7066
|
+
borderBottomColor: colors.neutral300,
|
|
7067
|
+
whiteSpace: "nowrap",
|
|
7068
|
+
"& .filter-menu-trigger": {
|
|
7069
|
+
visibility: "hidden",
|
|
7070
|
+
opacity: 0,
|
|
7071
|
+
transition: "visibility 0.1s, opacity 0.1s ease-in"
|
|
7072
|
+
},
|
|
7073
|
+
"&:hover .filter-menu-trigger, & .filter-menu-trigger.has-active-filters": {
|
|
7074
|
+
visibility: "visible",
|
|
7075
|
+
opacity: 1
|
|
7076
|
+
},
|
|
7077
|
+
"&:hover .MuiTableSortLabel-root": {
|
|
7078
|
+
"& .MuiTableSortLabel-icon": {
|
|
7079
|
+
opacity: 1
|
|
7080
|
+
}
|
|
7081
|
+
}
|
|
7082
|
+
},
|
|
7083
|
+
filterMenu: {
|
|
7084
|
+
display: "flex",
|
|
7085
|
+
flexDirection: "column",
|
|
7086
|
+
gap: theme.spacing(0.5)
|
|
7087
|
+
},
|
|
7088
|
+
filterCheckboxDropdown: {
|
|
7089
|
+
display: "flex",
|
|
7090
|
+
flexDirection: "column",
|
|
7091
|
+
padding: theme.spacing(0, 3)
|
|
7092
|
+
},
|
|
7093
|
+
applyFilterButtonsContainer: {
|
|
7094
|
+
display: "flex",
|
|
7095
|
+
padding: theme.spacing(0, 1)
|
|
7096
|
+
}
|
|
7097
|
+
}));
|
|
7098
|
+
var SmartTableHeader = ({
|
|
7099
|
+
order,
|
|
7100
|
+
orderBy,
|
|
7101
|
+
headCells,
|
|
7102
|
+
numSelected,
|
|
7103
|
+
numRows,
|
|
7104
|
+
enableCheckboxSelection = false,
|
|
7105
|
+
headerFilters,
|
|
7106
|
+
onRequestSort,
|
|
7107
|
+
onSelectAllClick,
|
|
7108
|
+
onApplyFilters,
|
|
7109
|
+
shouldShowCheckOnFilter
|
|
7110
|
+
}) => {
|
|
7111
|
+
const { classes } = useStyles47();
|
|
7112
|
+
const createSortHandler = (property) => (event) => {
|
|
7113
|
+
onRequestSort(event, property);
|
|
7114
|
+
};
|
|
7115
|
+
const isSortActive = (headCellId) => orderBy === headCellId;
|
|
7116
|
+
return /* @__PURE__ */ (0, import_jsx_runtime110.jsx)(import_material59.TableHead, { className: classes.root, children: /* @__PURE__ */ (0, import_jsx_runtime110.jsxs)(import_material59.TableRow, { children: [
|
|
7117
|
+
enableCheckboxSelection ? /* @__PURE__ */ (0, import_jsx_runtime110.jsx)(import_material59.TableCell, { padding: "checkbox", children: /* @__PURE__ */ (0, import_jsx_runtime110.jsx)(
|
|
7118
|
+
import_material59.Checkbox,
|
|
7119
|
+
{
|
|
7120
|
+
color: "primary",
|
|
7121
|
+
disableRipple: true,
|
|
7122
|
+
indeterminate: numSelected > 0 && numSelected < numRows,
|
|
7123
|
+
checked: numRows > 0 && numSelected === numRows,
|
|
7124
|
+
onChange: onSelectAllClick
|
|
7125
|
+
}
|
|
7126
|
+
) }) : null,
|
|
7127
|
+
headCells.map((headCell) => /* @__PURE__ */ (0, import_jsx_runtime110.jsx)(
|
|
7128
|
+
import_material59.TableCell,
|
|
7129
|
+
{
|
|
7130
|
+
className: classes.tableHeaderContent,
|
|
7131
|
+
align: "left",
|
|
7132
|
+
width: headCell.width ?? "auto",
|
|
7133
|
+
sortDirection: orderBy === headCell.id ? order : false,
|
|
7134
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime110.jsxs)(
|
|
7135
|
+
import_material59.Box,
|
|
7136
|
+
{
|
|
7137
|
+
display: "flex",
|
|
7138
|
+
flexDirection: "row",
|
|
7139
|
+
gap: headCell.disableSort ? 1 : 0,
|
|
7140
|
+
children: [
|
|
7141
|
+
headCell.disableSort ? headCell.RenderHeader ?? /* @__PURE__ */ (0, import_jsx_runtime110.jsx)(import_material59.Tooltip, { title: headCell.labelTooltip ?? "", arrow: true, children: /* @__PURE__ */ (0, import_jsx_runtime110.jsx)(import_material59.Typography, { variant: "subtitle2", mt: 0.25, fontWeight: 600, children: headCell.label }) }) : /* @__PURE__ */ (0, import_jsx_runtime110.jsx)(import_material59.Tooltip, { title: headCell.labelTooltip ?? "", arrow: true, children: /* @__PURE__ */ (0, import_jsx_runtime110.jsxs)(
|
|
7142
|
+
import_material59.TableSortLabel,
|
|
7143
|
+
{
|
|
7144
|
+
"data-testid": "table-sort-label",
|
|
7145
|
+
active: isSortActive(headCell.id),
|
|
7146
|
+
direction: orderBy === headCell.id ? order : "asc",
|
|
7147
|
+
onClick: createSortHandler(headCell.id),
|
|
7148
|
+
children: [
|
|
7149
|
+
headCell.RenderHeader ?? headCell.label,
|
|
7150
|
+
orderBy === headCell.id ? /* @__PURE__ */ (0, import_jsx_runtime110.jsx)("span", { className: classes.visuallyHidden, children: order === "desc" ? "sorted descending" : "sorted ascending" }) : null
|
|
7151
|
+
]
|
|
7152
|
+
}
|
|
7153
|
+
) }),
|
|
7154
|
+
headCell.refetchFilterOptions ? /* @__PURE__ */ (0, import_jsx_runtime110.jsx)(
|
|
7155
|
+
SmartTableHeaderFilterMenu_default,
|
|
7156
|
+
{
|
|
7157
|
+
headCell,
|
|
7158
|
+
headerFilters,
|
|
7159
|
+
numActiveFilters: headerFilters[headCell.id]?.length ?? 0,
|
|
7160
|
+
onApplyFilters,
|
|
7161
|
+
shouldShowCheckOnFilter
|
|
7162
|
+
}
|
|
7163
|
+
) : null
|
|
7164
|
+
]
|
|
7165
|
+
}
|
|
7166
|
+
)
|
|
7167
|
+
},
|
|
7168
|
+
headCell.id
|
|
7169
|
+
))
|
|
7170
|
+
] }) });
|
|
7171
|
+
};
|
|
7172
|
+
var SmartTableHeader_default = (0, import_react33.memo)(SmartTableHeader);
|
|
7483
7173
|
|
|
7484
7174
|
// src/components/Table/Table.tsx
|
|
7485
|
-
var
|
|
7486
|
-
var
|
|
7175
|
+
var import_react34 = require("react");
|
|
7176
|
+
var import_material61 = require("@mui/material");
|
|
7487
7177
|
var import_debounce = __toESM(require_debounce(), 1);
|
|
7488
|
-
var
|
|
7178
|
+
var import_mui54 = require("tss-react/mui");
|
|
7489
7179
|
var import_uuid = require("uuid");
|
|
7490
7180
|
|
|
7491
7181
|
// src/components/TableLoading/TableLoading.tsx
|
|
7492
|
-
var
|
|
7493
|
-
var
|
|
7182
|
+
var import_material60 = require("@mui/material");
|
|
7183
|
+
var import_jsx_runtime111 = require("react/jsx-runtime");
|
|
7494
7184
|
var TableLoading = ({
|
|
7495
7185
|
rowsPerPage,
|
|
7496
7186
|
rowHeight
|
|
7497
|
-
}) => /* @__PURE__ */ (0,
|
|
7498
|
-
|
|
7187
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(import_material60.Box, { children: Array.from({ length: rowsPerPage ?? 0 }).map((_, index) => /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(
|
|
7188
|
+
import_material60.Skeleton,
|
|
7499
7189
|
{
|
|
7500
7190
|
animation: "pulse",
|
|
7501
7191
|
"data-testid": "table-loading-skeleton",
|
|
@@ -7508,7 +7198,7 @@ var TableLoading = ({
|
|
|
7508
7198
|
var TableLoading_default = TableLoading;
|
|
7509
7199
|
|
|
7510
7200
|
// src/components/Table/helpers.tsx
|
|
7511
|
-
function
|
|
7201
|
+
function stableSort(array, cmp) {
|
|
7512
7202
|
const stabilizedThis = array.map((el, index) => [el, index]);
|
|
7513
7203
|
stabilizedThis.sort((a, b) => {
|
|
7514
7204
|
const order = cmp(a[0], b[0]);
|
|
@@ -7519,7 +7209,7 @@ function stableSort2(array, cmp) {
|
|
|
7519
7209
|
});
|
|
7520
7210
|
return stabilizedThis.map((el) => el[0]);
|
|
7521
7211
|
}
|
|
7522
|
-
function
|
|
7212
|
+
function descendingComparator(a, b, orderBy) {
|
|
7523
7213
|
if (b[orderBy] < a[orderBy]) {
|
|
7524
7214
|
return -1;
|
|
7525
7215
|
}
|
|
@@ -7529,7 +7219,7 @@ function descendingComparator2(a, b, orderBy) {
|
|
|
7529
7219
|
return 0;
|
|
7530
7220
|
}
|
|
7531
7221
|
function getSorting(order, orderBy) {
|
|
7532
|
-
return order === "desc" ? (a, b) =>
|
|
7222
|
+
return order === "desc" ? (a, b) => descendingComparator(a, b, orderBy) : (a, b) => -descendingComparator(a, b, orderBy);
|
|
7533
7223
|
}
|
|
7534
7224
|
function calculateRowsPerPage(rowHeight) {
|
|
7535
7225
|
const appContainerDom = document.getElementById("mainContainer");
|
|
@@ -7543,8 +7233,8 @@ function calculateRowsPerPage(rowHeight) {
|
|
|
7543
7233
|
}
|
|
7544
7234
|
|
|
7545
7235
|
// src/components/Table/Table.tsx
|
|
7546
|
-
var
|
|
7547
|
-
var
|
|
7236
|
+
var import_jsx_runtime112 = require("react/jsx-runtime");
|
|
7237
|
+
var useStyles48 = (0, import_mui54.makeStyles)()(() => ({
|
|
7548
7238
|
root: {
|
|
7549
7239
|
height: "calc(100vh - 262px)",
|
|
7550
7240
|
overflow: "scroll"
|
|
@@ -7565,7 +7255,7 @@ var useStyles50 = (0, import_mui56.makeStyles)()(() => ({
|
|
|
7565
7255
|
maxHeight: "calc(100% - 0)"
|
|
7566
7256
|
}
|
|
7567
7257
|
}));
|
|
7568
|
-
var
|
|
7258
|
+
var Table = ({
|
|
7569
7259
|
appliedFilters,
|
|
7570
7260
|
data,
|
|
7571
7261
|
doNotCalculateRows,
|
|
@@ -7578,12 +7268,12 @@ var Table2 = ({
|
|
|
7578
7268
|
serverRendered,
|
|
7579
7269
|
updateSort
|
|
7580
7270
|
}) => {
|
|
7581
|
-
const [order, setOrder] = (0,
|
|
7582
|
-
const [orderBy, setOrderBy] = (0,
|
|
7271
|
+
const [order, setOrder] = (0, import_react34.useState)(appliedFilters?.sortDir || "desc");
|
|
7272
|
+
const [orderBy, setOrderBy] = (0, import_react34.useState)(
|
|
7583
7273
|
appliedFilters?.sortField || "delivery_date"
|
|
7584
7274
|
);
|
|
7585
|
-
const [rowsPerPage, setRowsPerPage] = (0,
|
|
7586
|
-
const { classes } =
|
|
7275
|
+
const [rowsPerPage, setRowsPerPage] = (0, import_react34.useState)(defaultRowsPerPage);
|
|
7276
|
+
const { classes } = useStyles48();
|
|
7587
7277
|
const rowHeight = 56;
|
|
7588
7278
|
const emptyRows = rowsPerPage - Math.min(rowsPerPage, data.length - page * rowsPerPage);
|
|
7589
7279
|
const handleRequestSort = (event, property) => {
|
|
@@ -7595,7 +7285,7 @@ var Table2 = ({
|
|
|
7595
7285
|
updateSort(property, orderDir);
|
|
7596
7286
|
}
|
|
7597
7287
|
};
|
|
7598
|
-
(0,
|
|
7288
|
+
(0, import_react34.useLayoutEffect)(() => {
|
|
7599
7289
|
if (!doNotCalculateRows) {
|
|
7600
7290
|
return;
|
|
7601
7291
|
}
|
|
@@ -7615,31 +7305,31 @@ var Table2 = ({
|
|
|
7615
7305
|
};
|
|
7616
7306
|
const getTableRows = () => {
|
|
7617
7307
|
const index = page;
|
|
7618
|
-
const rows = serverRendered ? data :
|
|
7308
|
+
const rows = serverRendered ? data : stableSort(data, getSorting(order, orderBy)).slice(
|
|
7619
7309
|
index * rowsPerPage,
|
|
7620
7310
|
index * rowsPerPage + rowsPerPage
|
|
7621
7311
|
);
|
|
7622
7312
|
const rowsComponents = rows.map((row) => {
|
|
7623
7313
|
if (RenderItem) {
|
|
7624
|
-
return /* @__PURE__ */ (0,
|
|
7314
|
+
return /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(RenderItem, { ...row }, row.id);
|
|
7625
7315
|
}
|
|
7626
|
-
return /* @__PURE__ */ (0,
|
|
7316
|
+
return /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(import_material61.TableRow, { hover: true, onClick: () => onRowClick?.(row), children: headCells?.map((column) => /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(import_material61.TableCell, { children: row[column.id] }, column.id)) }, row.id);
|
|
7627
7317
|
});
|
|
7628
7318
|
if (emptyRows > 0 && rowsPerPage > emptyRows) {
|
|
7629
7319
|
rowsComponents.push(
|
|
7630
|
-
/* @__PURE__ */ (0,
|
|
7320
|
+
/* @__PURE__ */ (0, import_jsx_runtime112.jsx)(import_material61.TableRow, { style: { height: rowHeight * emptyRows }, children: /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(import_material61.TableCell, { colSpan: 8 }) }, (0, import_uuid.v4)())
|
|
7631
7321
|
);
|
|
7632
7322
|
}
|
|
7633
7323
|
return rowsComponents;
|
|
7634
7324
|
};
|
|
7635
|
-
return /* @__PURE__ */ (0,
|
|
7636
|
-
/* @__PURE__ */ (0,
|
|
7637
|
-
|
|
7325
|
+
return /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(import_material61.Paper, { className: classes.root, children: /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(import_material61.Box, { className: classes.paper, children: isLoading ? /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(TableLoading_default, { rowHeight, rowsPerPage }) : /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(import_material61.TableContainer, { className: classes.container, children: /* @__PURE__ */ (0, import_jsx_runtime112.jsxs)(import_material61.Table, { size: "medium", stickyHeader: true, children: [
|
|
7326
|
+
/* @__PURE__ */ (0, import_jsx_runtime112.jsx)(import_material61.TableHead, { className: classes.header, children: /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(import_material61.TableRow, { children: headCells?.map((headCell) => /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(
|
|
7327
|
+
import_material61.TableCell,
|
|
7638
7328
|
{
|
|
7639
7329
|
align: "left",
|
|
7640
7330
|
sortDirection: orderBy === headCell.id ? order : void 0,
|
|
7641
|
-
children: /* @__PURE__ */ (0,
|
|
7642
|
-
|
|
7331
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(
|
|
7332
|
+
import_material61.TableSortLabel,
|
|
7643
7333
|
{
|
|
7644
7334
|
active: orderBy === headCell.id,
|
|
7645
7335
|
direction: orderBy === headCell.id ? order : "asc",
|
|
@@ -7650,30 +7340,34 @@ var Table2 = ({
|
|
|
7650
7340
|
},
|
|
7651
7341
|
headCell.id
|
|
7652
7342
|
)) }) }),
|
|
7653
|
-
/* @__PURE__ */ (0,
|
|
7343
|
+
/* @__PURE__ */ (0, import_jsx_runtime112.jsxs)(import_material61.TableBody, { children: [
|
|
7654
7344
|
getTableRows(),
|
|
7655
|
-
rowsPerPage === emptyRows && /* @__PURE__ */ (0,
|
|
7345
|
+
rowsPerPage === emptyRows && /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(import_material61.TableRow, { style: { height: rowHeight * emptyRows }, children: /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(import_material61.TableCell, { colSpan: 8, align: "center", children: "Nothing to display" }) })
|
|
7656
7346
|
] })
|
|
7657
7347
|
] }) }) }) });
|
|
7658
7348
|
};
|
|
7659
|
-
var Table_default =
|
|
7349
|
+
var Table_default = Table;
|
|
7350
|
+
|
|
7351
|
+
// src/components/TableDesktop/TableDesktop.tsx
|
|
7352
|
+
var import_react35 = require("react");
|
|
7353
|
+
var import_material66 = require("@mui/material");
|
|
7660
7354
|
|
|
7661
7355
|
// src/components/TableDesktopFooter/TableDesktopFooter.tsx
|
|
7662
7356
|
var import_Refresh = __toESM(require("@mui/icons-material/Refresh"), 1);
|
|
7663
|
-
var
|
|
7664
|
-
var
|
|
7357
|
+
var import_material62 = require("@mui/material");
|
|
7358
|
+
var import_jsx_runtime113 = require("react/jsx-runtime");
|
|
7665
7359
|
var TableDesktopFooter = ({
|
|
7666
7360
|
numPages,
|
|
7667
7361
|
page,
|
|
7668
7362
|
pageSize,
|
|
7669
7363
|
pageSizeOptions,
|
|
7670
|
-
|
|
7671
|
-
|
|
7364
|
+
onPageChange,
|
|
7365
|
+
onPageSizeChange,
|
|
7672
7366
|
refetch,
|
|
7673
7367
|
isFetching
|
|
7674
7368
|
}) => {
|
|
7675
|
-
return /* @__PURE__ */ (0,
|
|
7676
|
-
|
|
7369
|
+
return /* @__PURE__ */ (0, import_jsx_runtime113.jsxs)(
|
|
7370
|
+
import_material62.Box,
|
|
7677
7371
|
{
|
|
7678
7372
|
py: 1,
|
|
7679
7373
|
gap: 2,
|
|
@@ -7683,8 +7377,8 @@ var TableDesktopFooter = ({
|
|
|
7683
7377
|
borderTop: `1px solid ${colors.neutral300}`,
|
|
7684
7378
|
bgcolor: (theme) => theme.palette.background.default,
|
|
7685
7379
|
children: [
|
|
7686
|
-
/* @__PURE__ */ (0,
|
|
7687
|
-
|
|
7380
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsxs)(
|
|
7381
|
+
import_material62.Button,
|
|
7688
7382
|
{
|
|
7689
7383
|
disableRipple: true,
|
|
7690
7384
|
variant: "outlined",
|
|
@@ -7698,7 +7392,7 @@ var TableDesktopFooter = ({
|
|
|
7698
7392
|
borderColor: colors.neutral600
|
|
7699
7393
|
},
|
|
7700
7394
|
children: [
|
|
7701
|
-
/* @__PURE__ */ (0,
|
|
7395
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)(
|
|
7702
7396
|
import_Refresh.default,
|
|
7703
7397
|
{
|
|
7704
7398
|
fontSize: "small",
|
|
@@ -7709,74 +7403,577 @@ var TableDesktopFooter = ({
|
|
|
7709
7403
|
]
|
|
7710
7404
|
}
|
|
7711
7405
|
),
|
|
7712
|
-
/* @__PURE__ */ (0,
|
|
7713
|
-
/* @__PURE__ */ (0,
|
|
7714
|
-
/* @__PURE__ */ (0,
|
|
7715
|
-
/* @__PURE__ */ (0,
|
|
7716
|
-
|
|
7406
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsxs)(import_material62.Box, { display: "flex", children: [
|
|
7407
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsxs)(import_material62.Stack, { direction: "row", spacing: 2, alignItems: "center", children: [
|
|
7408
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)(import_material62.Typography, { children: "Rows per page:" }),
|
|
7409
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)(
|
|
7410
|
+
import_material62.Select,
|
|
7411
|
+
{
|
|
7412
|
+
value: pageSize,
|
|
7413
|
+
onChange: onPageSizeChange,
|
|
7414
|
+
size: "small",
|
|
7415
|
+
variant: "standard",
|
|
7416
|
+
children: pageSizeOptions.map((size) => /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(import_material62.MenuItem, { value: size, children: size }, size))
|
|
7417
|
+
}
|
|
7418
|
+
)
|
|
7419
|
+
] }),
|
|
7420
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)(
|
|
7421
|
+
import_material62.Pagination,
|
|
7422
|
+
{
|
|
7423
|
+
color: "standard",
|
|
7424
|
+
count: numPages,
|
|
7425
|
+
page,
|
|
7426
|
+
onChange: onPageChange
|
|
7427
|
+
}
|
|
7428
|
+
)
|
|
7429
|
+
] })
|
|
7430
|
+
]
|
|
7431
|
+
}
|
|
7432
|
+
);
|
|
7433
|
+
};
|
|
7434
|
+
|
|
7435
|
+
// src/components/TableDesktopNoColumnsMessage/TableDesktopNoColumnsMessage.tsx
|
|
7436
|
+
var import_TableBody = __toESM(require("@mui/material/TableBody"), 1);
|
|
7437
|
+
var import_TableCell = __toESM(require("@mui/material/TableCell"), 1);
|
|
7438
|
+
var import_TableRow = __toESM(require("@mui/material/TableRow"), 1);
|
|
7439
|
+
var import_Typography = __toESM(require("@mui/material/Typography"), 1);
|
|
7440
|
+
var import_jsx_runtime114 = require("react/jsx-runtime");
|
|
7441
|
+
var TableDesktopNoColumnsMessage = () => /* @__PURE__ */ (0, import_jsx_runtime114.jsx)(import_TableBody.default, { children: /* @__PURE__ */ (0, import_jsx_runtime114.jsx)(import_TableRow.default, { children: /* @__PURE__ */ (0, import_jsx_runtime114.jsxs)(
|
|
7442
|
+
import_TableCell.default,
|
|
7443
|
+
{
|
|
7444
|
+
sx: {
|
|
7445
|
+
py: 8,
|
|
7446
|
+
gap: 2,
|
|
7447
|
+
borderBottom: "none",
|
|
7448
|
+
display: "flex",
|
|
7449
|
+
flexDirection: "column",
|
|
7450
|
+
justifyContent: "center",
|
|
7451
|
+
alignItems: "center"
|
|
7452
|
+
},
|
|
7453
|
+
children: [
|
|
7454
|
+
/* @__PURE__ */ (0, import_jsx_runtime114.jsx)(import_Typography.default, { variant: "subtitle2", fontSize: 16, children: "Customise your view" }),
|
|
7455
|
+
/* @__PURE__ */ (0, import_jsx_runtime114.jsxs)(import_Typography.default, { variant: "subtitle1", align: "center", color: "textSecondary", children: [
|
|
7456
|
+
"Use the column selector on the right to choose which fields",
|
|
7457
|
+
/* @__PURE__ */ (0, import_jsx_runtime114.jsx)("br", {}),
|
|
7458
|
+
"you want to display in the table"
|
|
7459
|
+
] })
|
|
7460
|
+
]
|
|
7461
|
+
}
|
|
7462
|
+
) }) });
|
|
7463
|
+
|
|
7464
|
+
// src/components/TableDesktopLoadingState/TableDesktopLoadingState.tsx
|
|
7465
|
+
var import_material63 = require("@mui/material");
|
|
7466
|
+
var import_jsx_runtime115 = require("react/jsx-runtime");
|
|
7467
|
+
var getRange = (n) => Array.from({ length: n }, (_, i) => i + 1);
|
|
7468
|
+
var TableDesktopLoadingState = ({
|
|
7469
|
+
numRows,
|
|
7470
|
+
rowsPerPage,
|
|
7471
|
+
numColumns,
|
|
7472
|
+
rowHeight
|
|
7473
|
+
}) => {
|
|
7474
|
+
return getRange(Math.min(numRows, rowsPerPage)).map((rowNum) => /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(import_material63.TableRow, { children: getRange(numColumns).map((colNum) => /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(import_material63.TableCell, { children: /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(
|
|
7475
|
+
import_material63.Skeleton,
|
|
7476
|
+
{
|
|
7477
|
+
animation: "pulse",
|
|
7478
|
+
variant: "rounded",
|
|
7479
|
+
height: rowHeight - 33,
|
|
7480
|
+
sx: { bgcolor: colors.neutral100 },
|
|
7481
|
+
"data-testid": "loading-skeleton"
|
|
7482
|
+
}
|
|
7483
|
+
) }, colNum)) }, rowNum));
|
|
7484
|
+
};
|
|
7485
|
+
|
|
7486
|
+
// src/components/TableDesktopRows/TableDesktopRows.tsx
|
|
7487
|
+
var import_jsx_runtime116 = require("react/jsx-runtime");
|
|
7488
|
+
var descendingComparator2 = (a, b, orderBy) => {
|
|
7489
|
+
const objA = a[orderBy];
|
|
7490
|
+
const objB = b[orderBy];
|
|
7491
|
+
const valA = typeof objA === "object" ? objA?.name : objA;
|
|
7492
|
+
const valB = typeof objB === "object" ? objB?.name : objB;
|
|
7493
|
+
if (!valA && !valB) {
|
|
7494
|
+
return 0;
|
|
7495
|
+
}
|
|
7496
|
+
if (valA && !valB) {
|
|
7497
|
+
return -1;
|
|
7498
|
+
}
|
|
7499
|
+
if (!valA && valB) {
|
|
7500
|
+
return 1;
|
|
7501
|
+
}
|
|
7502
|
+
if (valA > valB) {
|
|
7503
|
+
return -1;
|
|
7504
|
+
}
|
|
7505
|
+
if (valA < valB) {
|
|
7506
|
+
return 1;
|
|
7507
|
+
}
|
|
7508
|
+
return 0;
|
|
7509
|
+
};
|
|
7510
|
+
var stableSort2 = (array, cmp) => array.map((el, index) => ({ el, index })).sort((a, b) => {
|
|
7511
|
+
const order = cmp(a.el, b.el);
|
|
7512
|
+
return order !== 0 ? order : a.index - b.index;
|
|
7513
|
+
}).map((el) => el.el);
|
|
7514
|
+
var getComparator = (order, orderBy) => order === "desc" ? (a, b) => descendingComparator2(a, b, orderBy) : (a, b) => -descendingComparator2(a, b, orderBy);
|
|
7515
|
+
var TableDesktopRows = ({
|
|
7516
|
+
data,
|
|
7517
|
+
RenderItem,
|
|
7518
|
+
visibleHeadCells,
|
|
7519
|
+
keyField,
|
|
7520
|
+
order,
|
|
7521
|
+
orderBy,
|
|
7522
|
+
rowsPerPage,
|
|
7523
|
+
isLoading,
|
|
7524
|
+
disableInternalSort,
|
|
7525
|
+
enableCheckboxSelection,
|
|
7526
|
+
enableEditMode,
|
|
7527
|
+
selectedRows,
|
|
7528
|
+
handleRowCheckboxChange,
|
|
7529
|
+
rowHeight,
|
|
7530
|
+
deleteItem
|
|
7531
|
+
}) => {
|
|
7532
|
+
const sortedData = disableInternalSort ? data : stableSort2(data, getComparator(order, orderBy));
|
|
7533
|
+
if (isLoading) {
|
|
7534
|
+
return /* @__PURE__ */ (0, import_jsx_runtime116.jsx)(
|
|
7535
|
+
TableDesktopLoadingState,
|
|
7536
|
+
{
|
|
7537
|
+
numRows: data.length,
|
|
7538
|
+
rowsPerPage,
|
|
7539
|
+
numColumns: visibleHeadCells.length + (enableCheckboxSelection ? 1 : 0),
|
|
7540
|
+
rowHeight
|
|
7541
|
+
}
|
|
7542
|
+
);
|
|
7543
|
+
}
|
|
7544
|
+
return sortedData.map((row, index) => {
|
|
7545
|
+
const isItemSelected = selectedRows.has(row[keyField]);
|
|
7546
|
+
return /* @__PURE__ */ (0, import_jsx_runtime116.jsx)(
|
|
7547
|
+
RenderItem,
|
|
7548
|
+
{
|
|
7549
|
+
...{
|
|
7550
|
+
...row,
|
|
7551
|
+
index,
|
|
7552
|
+
deleteItem,
|
|
7553
|
+
isItemSelected,
|
|
7554
|
+
enableEditMode,
|
|
7555
|
+
enableCheckboxSelection,
|
|
7556
|
+
rowHeight,
|
|
7557
|
+
rowId: row[keyField],
|
|
7558
|
+
handleRowCheckboxChange,
|
|
7559
|
+
visibleHeadCells
|
|
7560
|
+
}
|
|
7561
|
+
},
|
|
7562
|
+
row[keyField] ?? index
|
|
7563
|
+
);
|
|
7564
|
+
});
|
|
7565
|
+
};
|
|
7566
|
+
|
|
7567
|
+
// src/components/TableDesktopRowSelectionBar/TableDesktopRowSelectionBar.tsx
|
|
7568
|
+
var import_material64 = require("@mui/material");
|
|
7569
|
+
var import_jsx_runtime117 = require("react/jsx-runtime");
|
|
7570
|
+
var TableDesktopRowSelectionBar = ({
|
|
7571
|
+
isEveryRowInPageSelected,
|
|
7572
|
+
isRowsInAllPagesSelected,
|
|
7573
|
+
numSelectedRows,
|
|
7574
|
+
totalRowCount,
|
|
7575
|
+
handleRowSelectionBarClick
|
|
7576
|
+
}) => {
|
|
7577
|
+
return isEveryRowInPageSelected ? /* @__PURE__ */ (0, import_jsx_runtime117.jsxs)(
|
|
7578
|
+
import_material64.Box,
|
|
7579
|
+
{
|
|
7580
|
+
sx: {
|
|
7581
|
+
p: 1,
|
|
7582
|
+
gap: 2,
|
|
7583
|
+
display: "flex",
|
|
7584
|
+
justifyContent: "center",
|
|
7585
|
+
alignItems: "center",
|
|
7586
|
+
backgroundColor: colors.neutral150
|
|
7587
|
+
},
|
|
7588
|
+
children: [
|
|
7589
|
+
/* @__PURE__ */ (0, import_jsx_runtime117.jsx)(import_material64.Typography, { children: isRowsInAllPagesSelected ? `All ${totalRowCount} rows are selected based on your filters.` : `All ${numSelectedRows} rows on this page are selected.` }),
|
|
7590
|
+
/* @__PURE__ */ (0, import_jsx_runtime117.jsx)(import_material64.Button, { onClick: handleRowSelectionBarClick, children: isRowsInAllPagesSelected ? "Clear Selection" : `Select all ${totalRowCount} rows from all pages based on your filters.` })
|
|
7591
|
+
]
|
|
7592
|
+
}
|
|
7593
|
+
) : null;
|
|
7594
|
+
};
|
|
7595
|
+
|
|
7596
|
+
// src/components/TableEmptyResult/TableEmptyResult.tsx
|
|
7597
|
+
var import_material65 = require("@mui/material");
|
|
7598
|
+
var import_mui55 = require("tss-react/mui");
|
|
7599
|
+
var import_jsx_runtime118 = require("react/jsx-runtime");
|
|
7600
|
+
var useStyles49 = (0, import_mui55.makeStyles)()(() => ({
|
|
7601
|
+
tableCellIcon: { padding: 24, height: "calc(100vh - 320px)" },
|
|
7602
|
+
tableCellDefault: { padding: 24 }
|
|
7603
|
+
}));
|
|
7604
|
+
var TableEmptyResult = ({
|
|
7605
|
+
colSpan,
|
|
7606
|
+
showClearFilterButton = false,
|
|
7607
|
+
handleClickOnClearFiltersButton = () => {
|
|
7608
|
+
}
|
|
7609
|
+
}) => {
|
|
7610
|
+
const { classes } = useStyles49();
|
|
7611
|
+
return showClearFilterButton ? /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(import_material65.TableRow, { children: /* @__PURE__ */ (0, import_jsx_runtime118.jsxs)(
|
|
7612
|
+
import_material65.TableCell,
|
|
7613
|
+
{
|
|
7614
|
+
className: classes.tableCellIcon,
|
|
7615
|
+
colSpan,
|
|
7616
|
+
align: "center",
|
|
7617
|
+
children: [
|
|
7618
|
+
/* @__PURE__ */ (0, import_jsx_runtime118.jsx)(EmptyGlassIcon_default, {}),
|
|
7619
|
+
/* @__PURE__ */ (0, import_jsx_runtime118.jsx)(import_material65.Typography, { variant: "h6", children: "No results found." }),
|
|
7620
|
+
/* @__PURE__ */ (0, import_jsx_runtime118.jsx)(import_material65.Typography, { variant: "subtitle1", children: "Search without applied filters?" }),
|
|
7621
|
+
/* @__PURE__ */ (0, import_jsx_runtime118.jsx)(
|
|
7622
|
+
FilledButton_default,
|
|
7623
|
+
{
|
|
7624
|
+
copy: "Search",
|
|
7625
|
+
variant: "contained",
|
|
7626
|
+
color: "primary",
|
|
7627
|
+
onClick: handleClickOnClearFiltersButton
|
|
7628
|
+
}
|
|
7629
|
+
)
|
|
7630
|
+
]
|
|
7631
|
+
}
|
|
7632
|
+
) }) : /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(import_material65.TableRow, { children: /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(
|
|
7633
|
+
import_material65.TableCell,
|
|
7634
|
+
{
|
|
7635
|
+
className: classes.tableCellDefault,
|
|
7636
|
+
colSpan,
|
|
7637
|
+
align: "center",
|
|
7638
|
+
children: "Nothing to display"
|
|
7639
|
+
}
|
|
7640
|
+
) });
|
|
7641
|
+
};
|
|
7642
|
+
var TableEmptyResult_default = TableEmptyResult;
|
|
7643
|
+
|
|
7644
|
+
// src/components/TableDesktop/TableDesktop.tsx
|
|
7645
|
+
var import_jsx_runtime119 = require("react/jsx-runtime");
|
|
7646
|
+
var TableDesktop = ({
|
|
7647
|
+
data,
|
|
7648
|
+
headCells,
|
|
7649
|
+
RenderItem,
|
|
7650
|
+
appliedFilters,
|
|
7651
|
+
headerFilters,
|
|
7652
|
+
children,
|
|
7653
|
+
height,
|
|
7654
|
+
rowHeight = 56,
|
|
7655
|
+
totalDataCount,
|
|
7656
|
+
isLoading,
|
|
7657
|
+
rowsPerPage = 50,
|
|
7658
|
+
enableEditMode = false,
|
|
7659
|
+
enableCheckboxSelection = false,
|
|
7660
|
+
disableInternalSort = false,
|
|
7661
|
+
updateSort,
|
|
7662
|
+
showClearFilterButton,
|
|
7663
|
+
handleClickOnClearFiltersButton,
|
|
7664
|
+
deleteItem,
|
|
7665
|
+
keyField = "id",
|
|
7666
|
+
tableLayout = "auto",
|
|
7667
|
+
onApplyFilters,
|
|
7668
|
+
shouldShowCheckOnFilter,
|
|
7669
|
+
components,
|
|
7670
|
+
componentsProps
|
|
7671
|
+
}) => {
|
|
7672
|
+
const [order, setOrder] = (0, import_react35.useState)(appliedFilters?.sortDir || "desc");
|
|
7673
|
+
const [orderBy, setOrderBy] = (0, import_react35.useState)(
|
|
7674
|
+
appliedFilters?.sortField || "delivery_date"
|
|
7675
|
+
);
|
|
7676
|
+
const [selectedRows, setSelectedRows] = (0, import_react35.useState)(/* @__PURE__ */ new Set());
|
|
7677
|
+
const [isRowsInAllPagesSelected, setIsRowsInAllPagesSelected] = (0, import_react35.useState)(false);
|
|
7678
|
+
const { toolbar: Toolbar2 } = components ?? {};
|
|
7679
|
+
const { toolbarProps, footerProps } = componentsProps ?? {};
|
|
7680
|
+
const numRows = (0, import_react35.useMemo)(
|
|
7681
|
+
() => data.length,
|
|
7682
|
+
[data.length]
|
|
7683
|
+
);
|
|
7684
|
+
const emptyRows = (0, import_react35.useMemo)(
|
|
7685
|
+
() => rowsPerPage - numRows,
|
|
7686
|
+
[rowsPerPage, numRows]
|
|
7687
|
+
);
|
|
7688
|
+
const isEveryRowInPageSelected = (0, import_react35.useMemo)(
|
|
7689
|
+
() => numRows > 0 && selectedRows.size === numRows,
|
|
7690
|
+
[selectedRows, numRows]
|
|
7691
|
+
);
|
|
7692
|
+
const visibleHeadCells = (0, import_react35.useMemo)(
|
|
7693
|
+
() => headCells.filter((headCell) => headCell?.enabled ?? true),
|
|
7694
|
+
[headCells]
|
|
7695
|
+
);
|
|
7696
|
+
const handleRequestSort = (event, property) => {
|
|
7697
|
+
const isAsc = orderBy === property && order === "asc";
|
|
7698
|
+
const orderDir = isAsc ? "desc" : "asc";
|
|
7699
|
+
setOrder(orderDir);
|
|
7700
|
+
setOrderBy(property);
|
|
7701
|
+
if (updateSort) {
|
|
7702
|
+
updateSort(property, orderDir);
|
|
7703
|
+
}
|
|
7704
|
+
};
|
|
7705
|
+
const resetSelectedRows = () => {
|
|
7706
|
+
setSelectedRows(/* @__PURE__ */ new Set());
|
|
7707
|
+
setIsRowsInAllPagesSelected(false);
|
|
7708
|
+
};
|
|
7709
|
+
const handleSelectAllClick = (event) => {
|
|
7710
|
+
if (event.target.checked) {
|
|
7711
|
+
const allRowsIds = new Set(data.map((n) => n[keyField]));
|
|
7712
|
+
;
|
|
7713
|
+
setSelectedRows(allRowsIds);
|
|
7714
|
+
return;
|
|
7715
|
+
}
|
|
7716
|
+
resetSelectedRows();
|
|
7717
|
+
};
|
|
7718
|
+
const handleRowCheckboxChange = (event, rowId) => {
|
|
7719
|
+
event.stopPropagation();
|
|
7720
|
+
setSelectedRows((prev) => {
|
|
7721
|
+
const newSelected = new Set(prev);
|
|
7722
|
+
if (newSelected.has(rowId)) {
|
|
7723
|
+
newSelected.delete(rowId);
|
|
7724
|
+
} else {
|
|
7725
|
+
newSelected.add(rowId);
|
|
7726
|
+
}
|
|
7727
|
+
return newSelected;
|
|
7728
|
+
});
|
|
7729
|
+
};
|
|
7730
|
+
const handleRowSelectionBarClick = () => {
|
|
7731
|
+
if (isRowsInAllPagesSelected) {
|
|
7732
|
+
resetSelectedRows();
|
|
7733
|
+
return;
|
|
7734
|
+
}
|
|
7735
|
+
setIsRowsInAllPagesSelected(true);
|
|
7736
|
+
};
|
|
7737
|
+
const handlePageChange = (event, page) => {
|
|
7738
|
+
resetSelectedRows();
|
|
7739
|
+
footerProps?.onPageChange?.(event, page);
|
|
7740
|
+
};
|
|
7741
|
+
(0, import_react35.useEffect)(() => {
|
|
7742
|
+
if (!enableCheckboxSelection) {
|
|
7743
|
+
resetSelectedRows();
|
|
7744
|
+
}
|
|
7745
|
+
}, [enableCheckboxSelection]);
|
|
7746
|
+
(0, import_react35.useEffect)(() => {
|
|
7747
|
+
if (isEveryRowInPageSelected || isRowsInAllPagesSelected) {
|
|
7748
|
+
const rowsIdsSet = new Set(data.map((obj) => obj[keyField]));
|
|
7749
|
+
setSelectedRows(
|
|
7750
|
+
(prev) => new Set([...prev].filter((value) => rowsIdsSet.has(value)))
|
|
7751
|
+
);
|
|
7752
|
+
}
|
|
7753
|
+
}, [data, setSelectedRows, isEveryRowInPageSelected, isRowsInAllPagesSelected]);
|
|
7754
|
+
return /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(
|
|
7755
|
+
import_material66.Box,
|
|
7756
|
+
{
|
|
7757
|
+
sx: {
|
|
7758
|
+
height,
|
|
7759
|
+
display: "flex",
|
|
7760
|
+
justifyContent: "space-between",
|
|
7761
|
+
justifyItems: "stretch"
|
|
7762
|
+
},
|
|
7763
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime119.jsxs)(
|
|
7764
|
+
import_material66.Paper,
|
|
7765
|
+
{
|
|
7766
|
+
sx: {
|
|
7767
|
+
width: "100%",
|
|
7768
|
+
display: "flex",
|
|
7769
|
+
flexDirection: "column",
|
|
7770
|
+
justifyContent: "space-between"
|
|
7771
|
+
},
|
|
7772
|
+
children: [
|
|
7773
|
+
Toolbar2 ? /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(
|
|
7774
|
+
Toolbar2,
|
|
7717
7775
|
{
|
|
7718
|
-
|
|
7719
|
-
|
|
7720
|
-
|
|
7721
|
-
variant: "standard",
|
|
7722
|
-
children: pageSizeOptions.map((size) => /* @__PURE__ */ (0, import_jsx_runtime116.jsx)(import_material64.MenuItem, { value: size, children: size }, size))
|
|
7776
|
+
selectedRows: [...selectedRows],
|
|
7777
|
+
isRowsInAllPagesSelected,
|
|
7778
|
+
...toolbarProps
|
|
7723
7779
|
}
|
|
7724
|
-
)
|
|
7725
|
-
|
|
7726
|
-
|
|
7727
|
-
|
|
7728
|
-
|
|
7729
|
-
|
|
7730
|
-
|
|
7731
|
-
|
|
7732
|
-
|
|
7733
|
-
|
|
7734
|
-
|
|
7735
|
-
|
|
7736
|
-
|
|
7780
|
+
) : null,
|
|
7781
|
+
/* @__PURE__ */ (0, import_jsx_runtime119.jsx)(
|
|
7782
|
+
TableDesktopRowSelectionBar,
|
|
7783
|
+
{
|
|
7784
|
+
isEveryRowInPageSelected,
|
|
7785
|
+
isRowsInAllPagesSelected,
|
|
7786
|
+
numSelectedRows: selectedRows.size,
|
|
7787
|
+
totalRowCount: totalDataCount ?? 0,
|
|
7788
|
+
handleRowSelectionBarClick
|
|
7789
|
+
}
|
|
7790
|
+
),
|
|
7791
|
+
/* @__PURE__ */ (0, import_jsx_runtime119.jsx)(
|
|
7792
|
+
import_material66.TableContainer,
|
|
7793
|
+
{
|
|
7794
|
+
sx: {
|
|
7795
|
+
flexGrow: 1,
|
|
7796
|
+
minHeight: 0,
|
|
7797
|
+
maxHeight: "100%",
|
|
7798
|
+
"&::-webkit-scrollbar": {
|
|
7799
|
+
width: "8px",
|
|
7800
|
+
height: "8px"
|
|
7801
|
+
},
|
|
7802
|
+
"&::-webkit-scrollbar-track": {
|
|
7803
|
+
backgroundColor: (theme) => theme.palette.grey[100]
|
|
7804
|
+
},
|
|
7805
|
+
"&::-webkit-scrollbar-thumb": {
|
|
7806
|
+
backgroundColor: (theme) => theme.palette.grey[400],
|
|
7807
|
+
borderRadius: "10px"
|
|
7808
|
+
},
|
|
7809
|
+
"&::-webkit-scrollbar-thumb:hover": {
|
|
7810
|
+
backgroundColor: (theme) => theme.palette.grey[500]
|
|
7811
|
+
}
|
|
7812
|
+
},
|
|
7813
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(
|
|
7814
|
+
import_material66.Table,
|
|
7815
|
+
{
|
|
7816
|
+
stickyHeader: true,
|
|
7817
|
+
"aria-label": "sticky-table",
|
|
7818
|
+
sx: { tableLayout },
|
|
7819
|
+
children: visibleHeadCells.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(TableDesktopNoColumnsMessage, {}) : /* @__PURE__ */ (0, import_jsx_runtime119.jsxs)(import_jsx_runtime119.Fragment, { children: [
|
|
7820
|
+
/* @__PURE__ */ (0, import_jsx_runtime119.jsx)(
|
|
7821
|
+
SmartTableHeader_default,
|
|
7822
|
+
{
|
|
7823
|
+
headCells: visibleHeadCells,
|
|
7824
|
+
order,
|
|
7825
|
+
orderBy,
|
|
7826
|
+
numSelected: selectedRows.size,
|
|
7827
|
+
numRows,
|
|
7828
|
+
enableCheckboxSelection,
|
|
7829
|
+
headerFilters: headerFilters ?? {},
|
|
7830
|
+
onRequestSort: handleRequestSort,
|
|
7831
|
+
onSelectAllClick: handleSelectAllClick,
|
|
7832
|
+
onApplyFilters,
|
|
7833
|
+
shouldShowCheckOnFilter
|
|
7834
|
+
}
|
|
7835
|
+
),
|
|
7836
|
+
/* @__PURE__ */ (0, import_jsx_runtime119.jsx)(import_material66.TableBody, { children: rowsPerPage !== emptyRows ? /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(
|
|
7837
|
+
TableDesktopRows,
|
|
7838
|
+
{
|
|
7839
|
+
data,
|
|
7840
|
+
RenderItem,
|
|
7841
|
+
visibleHeadCells,
|
|
7842
|
+
keyField,
|
|
7843
|
+
order,
|
|
7844
|
+
orderBy,
|
|
7845
|
+
rowsPerPage,
|
|
7846
|
+
isLoading,
|
|
7847
|
+
disableInternalSort,
|
|
7848
|
+
enableCheckboxSelection,
|
|
7849
|
+
enableEditMode,
|
|
7850
|
+
selectedRows,
|
|
7851
|
+
handleRowCheckboxChange,
|
|
7852
|
+
rowHeight,
|
|
7853
|
+
deleteItem
|
|
7854
|
+
}
|
|
7855
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(
|
|
7856
|
+
TableEmptyResult_default,
|
|
7857
|
+
{
|
|
7858
|
+
colSpan: enableCheckboxSelection ? visibleHeadCells.length + 1 : visibleHeadCells.length,
|
|
7859
|
+
showClearFilterButton,
|
|
7860
|
+
handleClickOnClearFiltersButton
|
|
7861
|
+
}
|
|
7862
|
+
) })
|
|
7863
|
+
] })
|
|
7864
|
+
}
|
|
7865
|
+
)
|
|
7866
|
+
}
|
|
7867
|
+
),
|
|
7868
|
+
children,
|
|
7869
|
+
footerProps ? /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(TableDesktopFooter, { ...footerProps, onPageChange: handlePageChange }) : null
|
|
7870
|
+
]
|
|
7871
|
+
}
|
|
7872
|
+
)
|
|
7737
7873
|
}
|
|
7738
7874
|
);
|
|
7739
7875
|
};
|
|
7740
7876
|
|
|
7741
|
-
// src/components/
|
|
7742
|
-
var
|
|
7743
|
-
var import_material65 = require("@mui/material");
|
|
7877
|
+
// src/components/TableDesktopEditableComponent/TableDesktopEditableComponent.tsx
|
|
7878
|
+
var import_material69 = require("@mui/material");
|
|
7744
7879
|
|
|
7745
|
-
// src/components/
|
|
7880
|
+
// src/components/TableDesktopEditableComponent/TableDesktopNumericField.tsx
|
|
7746
7881
|
var import_react36 = require("react");
|
|
7747
|
-
var
|
|
7882
|
+
var import_material67 = require("@mui/material");
|
|
7883
|
+
var import_jsx_runtime120 = require("react/jsx-runtime");
|
|
7884
|
+
var TableDesktopNumericField = ({
|
|
7885
|
+
rowId,
|
|
7886
|
+
initialValue,
|
|
7887
|
+
inputLabel,
|
|
7888
|
+
disabled,
|
|
7889
|
+
field,
|
|
7890
|
+
variant = "standard",
|
|
7891
|
+
size,
|
|
7892
|
+
onUpdateEditableCell
|
|
7893
|
+
}) => {
|
|
7894
|
+
const [input, setInput] = (0, import_react36.useState)(initialValue);
|
|
7895
|
+
const commitValue = (value) => {
|
|
7896
|
+
if (!onUpdateEditableCell) {
|
|
7897
|
+
return;
|
|
7898
|
+
}
|
|
7899
|
+
onUpdateEditableCell(rowId ?? 0, field, value, value);
|
|
7900
|
+
};
|
|
7901
|
+
const handleKeyDown = (e) => {
|
|
7902
|
+
if (e.key === "Enter") {
|
|
7903
|
+
e.preventDefault();
|
|
7904
|
+
commitValue(input);
|
|
7905
|
+
}
|
|
7906
|
+
};
|
|
7907
|
+
return /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(
|
|
7908
|
+
import_material67.TextField,
|
|
7909
|
+
{
|
|
7910
|
+
fullWidth: true,
|
|
7911
|
+
variant,
|
|
7912
|
+
size,
|
|
7913
|
+
value: input,
|
|
7914
|
+
disabled,
|
|
7915
|
+
label: inputLabel,
|
|
7916
|
+
onKeyDown: handleKeyDown,
|
|
7917
|
+
onChange: (e) => {
|
|
7918
|
+
e.target.value = e.target.value.replace(/\D/g, "");
|
|
7919
|
+
setInput(e.target.value);
|
|
7920
|
+
},
|
|
7921
|
+
onBlur: ({ target: { value } }) => {
|
|
7922
|
+
commitValue(value);
|
|
7923
|
+
},
|
|
7924
|
+
slotProps: {
|
|
7925
|
+
input: {
|
|
7926
|
+
inputMode: "numeric"
|
|
7927
|
+
}
|
|
7928
|
+
}
|
|
7929
|
+
}
|
|
7930
|
+
);
|
|
7931
|
+
};
|
|
7932
|
+
|
|
7933
|
+
// src/components/TableDesktopEditableComponent/TableDesktopSmartSelect.tsx
|
|
7934
|
+
var import_react37 = require("react");
|
|
7935
|
+
var import_jsx_runtime121 = require("react/jsx-runtime");
|
|
7936
|
+
var resolveOptionType2 = (option, fieldName) => {
|
|
7937
|
+
if (!option || typeof option !== "object") {
|
|
7938
|
+
return option;
|
|
7939
|
+
}
|
|
7940
|
+
return option[fieldName] || "";
|
|
7941
|
+
};
|
|
7748
7942
|
var resolveValue = (value) => {
|
|
7749
7943
|
if (typeof value === "string") {
|
|
7750
7944
|
return value;
|
|
7751
7945
|
}
|
|
7752
7946
|
return value?.id;
|
|
7753
7947
|
};
|
|
7754
|
-
var TableDesktopSmartSelect = (0,
|
|
7948
|
+
var TableDesktopSmartSelect = (0, import_react37.memo)(({
|
|
7755
7949
|
ref,
|
|
7756
7950
|
initialValue,
|
|
7757
7951
|
inputLabel,
|
|
7952
|
+
field,
|
|
7758
7953
|
fieldName,
|
|
7759
7954
|
rowId,
|
|
7760
7955
|
disabled,
|
|
7956
|
+
variant = "standard",
|
|
7957
|
+
size,
|
|
7761
7958
|
filterOptions,
|
|
7762
7959
|
refetchFilterOptions,
|
|
7763
7960
|
isFetchingFilterOptions,
|
|
7764
7961
|
onUpdateEditableCell
|
|
7765
7962
|
}) => {
|
|
7766
|
-
const [value, setValue] = (0,
|
|
7767
|
-
const [options, setOptions] = (0,
|
|
7963
|
+
const [value, setValue] = (0, import_react37.useState)(initialValue);
|
|
7964
|
+
const [options, setOptions] = (0, import_react37.useState)();
|
|
7768
7965
|
const valueId = resolveValue(value);
|
|
7769
|
-
const valueLabel =
|
|
7770
|
-
(0,
|
|
7966
|
+
const valueLabel = resolveOptionType2(value, fieldName);
|
|
7967
|
+
(0, import_react37.useEffect)(() => {
|
|
7771
7968
|
if (filterOptions) {
|
|
7772
7969
|
const parsedOptions = filterOptions?.map((option) => ({
|
|
7773
7970
|
value: resolveValue(option),
|
|
7774
|
-
label: String(
|
|
7971
|
+
label: String(resolveOptionType2(option, fieldName))
|
|
7775
7972
|
}));
|
|
7776
7973
|
setOptions(parsedOptions);
|
|
7777
7974
|
}
|
|
7778
7975
|
}, [filterOptions]);
|
|
7779
|
-
return /* @__PURE__ */ (0,
|
|
7976
|
+
return /* @__PURE__ */ (0, import_jsx_runtime121.jsx)(
|
|
7780
7977
|
SmartSelect_default,
|
|
7781
7978
|
{
|
|
7782
7979
|
ref,
|
|
@@ -7784,191 +7981,252 @@ var TableDesktopSmartSelect = (0, import_react36.memo)(({
|
|
|
7784
7981
|
inputLabel,
|
|
7785
7982
|
options,
|
|
7786
7983
|
disabled,
|
|
7984
|
+
variant,
|
|
7985
|
+
size,
|
|
7787
7986
|
refetch: refetchFilterOptions,
|
|
7788
7987
|
isFetching: isFetchingFilterOptions,
|
|
7789
7988
|
defaultOption: {
|
|
7790
7989
|
value: valueId ?? "",
|
|
7791
7990
|
label: String(valueLabel ?? "")
|
|
7792
7991
|
},
|
|
7793
|
-
onChange: ({ value:
|
|
7794
|
-
|
|
7795
|
-
|
|
7992
|
+
onChange: ({ value: id, label: name }) => {
|
|
7993
|
+
if (!id || !name) {
|
|
7994
|
+
return;
|
|
7995
|
+
}
|
|
7996
|
+
setValue({ id, name });
|
|
7997
|
+
if (!onUpdateEditableCell) {
|
|
7998
|
+
return;
|
|
7999
|
+
}
|
|
8000
|
+
onUpdateEditableCell(rowId ?? 0, field, id, name);
|
|
7796
8001
|
}
|
|
7797
8002
|
}
|
|
7798
8003
|
);
|
|
7799
8004
|
});
|
|
7800
8005
|
|
|
7801
|
-
// src/components/
|
|
7802
|
-
var
|
|
7803
|
-
|
|
7804
|
-
|
|
7805
|
-
var import_TextField = __toESM(require("@mui/material/TextField"), 1);
|
|
7806
|
-
var import_react37 = require("react");
|
|
7807
|
-
var import_jsx_runtime118 = require("react/jsx-runtime");
|
|
8006
|
+
// src/components/TableDesktopEditableComponent/TableDesktopTextField.tsx
|
|
8007
|
+
var import_react38 = require("react");
|
|
8008
|
+
var import_material68 = require("@mui/material");
|
|
8009
|
+
var import_jsx_runtime122 = require("react/jsx-runtime");
|
|
7808
8010
|
var TableDesktopTextField = ({
|
|
7809
8011
|
rowId,
|
|
7810
|
-
|
|
8012
|
+
initialValue,
|
|
7811
8013
|
inputLabel,
|
|
7812
8014
|
disabled,
|
|
8015
|
+
field,
|
|
8016
|
+
variant = "standard",
|
|
8017
|
+
size,
|
|
7813
8018
|
validateInput,
|
|
7814
8019
|
onUpdateEditableCell
|
|
7815
8020
|
}) => {
|
|
7816
|
-
const [
|
|
7817
|
-
const
|
|
7818
|
-
|
|
7819
|
-
|
|
8021
|
+
const [input, setInput] = (0, import_react38.useState)(initialValue);
|
|
8022
|
+
const hasValidationError = (0, import_react38.useMemo)(() => !validateInput?.(input), [input, validateInput]);
|
|
8023
|
+
const commitValue = (value) => {
|
|
8024
|
+
if (hasValidationError || !onUpdateEditableCell) {
|
|
8025
|
+
return;
|
|
8026
|
+
}
|
|
8027
|
+
onUpdateEditableCell(rowId ?? 0, field, value, value);
|
|
8028
|
+
};
|
|
8029
|
+
const handleKeyDown = (e) => {
|
|
8030
|
+
if (e.key === "Enter") {
|
|
8031
|
+
e.preventDefault();
|
|
8032
|
+
commitValue(input);
|
|
8033
|
+
}
|
|
8034
|
+
};
|
|
8035
|
+
return /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(
|
|
8036
|
+
import_material68.TextField,
|
|
7820
8037
|
{
|
|
7821
8038
|
fullWidth: true,
|
|
7822
|
-
variant
|
|
7823
|
-
|
|
8039
|
+
variant,
|
|
8040
|
+
size,
|
|
8041
|
+
value: input,
|
|
7824
8042
|
label: inputLabel,
|
|
7825
|
-
error:
|
|
8043
|
+
error: hasValidationError,
|
|
7826
8044
|
disabled,
|
|
7827
|
-
|
|
7828
|
-
|
|
8045
|
+
onKeyDown: handleKeyDown,
|
|
8046
|
+
onChange: ({ target: { value } }) => {
|
|
8047
|
+
setInput(value);
|
|
7829
8048
|
},
|
|
7830
|
-
onBlur: ({ target: { value
|
|
7831
|
-
|
|
7832
|
-
return;
|
|
7833
|
-
}
|
|
7834
|
-
onUpdateEditableCell?.(rowId, value2);
|
|
8049
|
+
onBlur: ({ target: { value } }) => {
|
|
8050
|
+
commitValue(value);
|
|
7835
8051
|
}
|
|
7836
8052
|
}
|
|
7837
8053
|
);
|
|
7838
8054
|
};
|
|
7839
8055
|
|
|
7840
|
-
// src/components/
|
|
7841
|
-
var
|
|
7842
|
-
var
|
|
7843
|
-
var import_jsx_runtime119 = require("react/jsx-runtime");
|
|
7844
|
-
var TableDesktopRowCell = ({
|
|
7845
|
-
inputLabel,
|
|
8056
|
+
// src/components/TableDesktopEditableComponent/TableDesktopEditableComponent.tsx
|
|
8057
|
+
var import_jsx_runtime123 = require("react/jsx-runtime");
|
|
8058
|
+
var TableDesktopEditableComponent = ({
|
|
7846
8059
|
editInitialValue,
|
|
7847
8060
|
rowId,
|
|
8061
|
+
field,
|
|
7848
8062
|
fieldName,
|
|
7849
|
-
width,
|
|
7850
8063
|
disabled,
|
|
7851
|
-
|
|
8064
|
+
showCheckboxLabel = false,
|
|
8065
|
+
variant = "standard",
|
|
8066
|
+
size,
|
|
8067
|
+
inputLabel,
|
|
7852
8068
|
editableCellType,
|
|
7853
8069
|
filterOptions,
|
|
7854
8070
|
refetchFilterOptions,
|
|
7855
8071
|
isFetchingFilterOptions,
|
|
7856
8072
|
validateInput,
|
|
7857
|
-
onUpdateEditableCell
|
|
7858
|
-
onCellClick
|
|
8073
|
+
onUpdateEditableCell
|
|
7859
8074
|
}) => {
|
|
7860
|
-
const cellRef = (0, import_react38.useRef)(null);
|
|
7861
|
-
const [isOverflowed, setIsOverflowed] = (0, import_react38.useState)(false);
|
|
7862
|
-
const [isCellHovered, setIsCellHovered] = (0, import_react38.useState)(false);
|
|
7863
|
-
const [isEditMode, setIsEditMode] = (0, import_react38.useState)(false);
|
|
7864
|
-
(0, import_react38.useEffect)(() => {
|
|
7865
|
-
const ref = cellRef.current;
|
|
7866
|
-
if (ref) {
|
|
7867
|
-
setIsOverflowed(ref.scrollWidth > ref.clientWidth);
|
|
7868
|
-
}
|
|
7869
|
-
}, [readOnlyValue, width]);
|
|
7870
|
-
(0, import_react38.useEffect)(() => {
|
|
7871
|
-
const handleKeyDown = (e) => {
|
|
7872
|
-
if (e.key === "Escape") {
|
|
7873
|
-
setIsEditMode(false);
|
|
7874
|
-
}
|
|
7875
|
-
};
|
|
7876
|
-
if (isEditMode) {
|
|
7877
|
-
window.addEventListener("keydown", handleKeyDown);
|
|
7878
|
-
}
|
|
7879
|
-
return () => {
|
|
7880
|
-
window.removeEventListener("keydown", handleKeyDown);
|
|
7881
|
-
};
|
|
7882
|
-
}, [isEditMode]);
|
|
7883
8075
|
const editableComponents = {
|
|
7884
|
-
"select": /* @__PURE__ */ (0,
|
|
8076
|
+
"select": /* @__PURE__ */ (0, import_jsx_runtime123.jsx)(
|
|
7885
8077
|
TableDesktopSmartSelect,
|
|
7886
8078
|
{
|
|
7887
8079
|
rowId,
|
|
8080
|
+
field,
|
|
7888
8081
|
fieldName,
|
|
7889
8082
|
disabled,
|
|
8083
|
+
variant,
|
|
8084
|
+
size,
|
|
7890
8085
|
initialValue: editInitialValue,
|
|
7891
|
-
inputLabel
|
|
8086
|
+
inputLabel,
|
|
7892
8087
|
filterOptions,
|
|
7893
8088
|
refetchFilterOptions,
|
|
7894
8089
|
isFetchingFilterOptions,
|
|
7895
8090
|
onUpdateEditableCell
|
|
7896
8091
|
}
|
|
7897
8092
|
),
|
|
7898
|
-
"checkbox": /* @__PURE__ */ (0,
|
|
7899
|
-
|
|
8093
|
+
"checkbox": /* @__PURE__ */ (0, import_jsx_runtime123.jsx)(
|
|
8094
|
+
import_material69.FormControlLabel,
|
|
7900
8095
|
{
|
|
7901
|
-
|
|
7902
|
-
|
|
7903
|
-
|
|
7904
|
-
|
|
7905
|
-
|
|
7906
|
-
|
|
8096
|
+
label: showCheckboxLabel ? inputLabel : "",
|
|
8097
|
+
control: /* @__PURE__ */ (0, import_jsx_runtime123.jsx)(
|
|
8098
|
+
import_material69.Checkbox,
|
|
8099
|
+
{
|
|
8100
|
+
disableRipple: true,
|
|
8101
|
+
disabled,
|
|
8102
|
+
defaultChecked: editInitialValue,
|
|
8103
|
+
onChange: ({ target: { checked } }) => {
|
|
8104
|
+
if (!onUpdateEditableCell) {
|
|
8105
|
+
return;
|
|
8106
|
+
}
|
|
8107
|
+
onUpdateEditableCell(rowId ?? 0, field, checked, checked);
|
|
8108
|
+
}
|
|
8109
|
+
}
|
|
8110
|
+
)
|
|
7907
8111
|
}
|
|
7908
8112
|
),
|
|
7909
|
-
"text": /* @__PURE__ */ (0,
|
|
8113
|
+
"text": /* @__PURE__ */ (0, import_jsx_runtime123.jsx)(
|
|
7910
8114
|
TableDesktopTextField,
|
|
7911
8115
|
{
|
|
7912
8116
|
rowId,
|
|
7913
8117
|
disabled,
|
|
7914
|
-
|
|
8118
|
+
variant,
|
|
8119
|
+
size,
|
|
8120
|
+
field,
|
|
8121
|
+
initialValue: editInitialValue,
|
|
7915
8122
|
inputLabel: inputLabel ?? "",
|
|
7916
8123
|
validateInput,
|
|
7917
8124
|
onUpdateEditableCell
|
|
7918
8125
|
}
|
|
7919
8126
|
),
|
|
7920
|
-
"numeric": /* @__PURE__ */ (0,
|
|
7921
|
-
|
|
8127
|
+
"numeric": /* @__PURE__ */ (0, import_jsx_runtime123.jsx)(
|
|
8128
|
+
TableDesktopNumericField,
|
|
7922
8129
|
{
|
|
7923
|
-
|
|
7924
|
-
variant: "standard",
|
|
8130
|
+
rowId,
|
|
7925
8131
|
disabled,
|
|
7926
|
-
|
|
7927
|
-
|
|
7928
|
-
|
|
7929
|
-
|
|
7930
|
-
|
|
7931
|
-
|
|
7932
|
-
onUpdateEditableCell?.(rowId, value);
|
|
7933
|
-
},
|
|
7934
|
-
slotProps: {
|
|
7935
|
-
input: {
|
|
7936
|
-
inputMode: "numeric"
|
|
7937
|
-
}
|
|
7938
|
-
}
|
|
8132
|
+
variant,
|
|
8133
|
+
size,
|
|
8134
|
+
field,
|
|
8135
|
+
initialValue: editInitialValue,
|
|
8136
|
+
inputLabel: inputLabel ?? "",
|
|
8137
|
+
onUpdateEditableCell
|
|
7939
8138
|
}
|
|
7940
8139
|
)
|
|
7941
8140
|
};
|
|
7942
|
-
|
|
7943
|
-
|
|
7944
|
-
|
|
8141
|
+
return editableComponents[editableCellType];
|
|
8142
|
+
};
|
|
8143
|
+
|
|
8144
|
+
// src/components/TableDesktopCell/TableDesktopCell.tsx
|
|
8145
|
+
var import_react39 = require("react");
|
|
8146
|
+
var import_Check2 = __toESM(require("@mui/icons-material/Check"), 1);
|
|
8147
|
+
var import_Close = __toESM(require("@mui/icons-material/Close"), 1);
|
|
8148
|
+
var import_Edit = __toESM(require("@mui/icons-material/Edit"), 1);
|
|
8149
|
+
var import_material70 = require("@mui/material");
|
|
8150
|
+
var import_jsx_runtime124 = require("react/jsx-runtime");
|
|
8151
|
+
var getReadOnlyBooleanIcon = (value) => {
|
|
8152
|
+
if (value) {
|
|
8153
|
+
return /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(import_Check2.default, { sx: { fontSize: 16 } });
|
|
8154
|
+
}
|
|
8155
|
+
return "-";
|
|
8156
|
+
};
|
|
8157
|
+
var renderReadOnlyValue = (value) => {
|
|
8158
|
+
if (typeof value === "boolean") {
|
|
8159
|
+
return getReadOnlyBooleanIcon(value);
|
|
8160
|
+
}
|
|
8161
|
+
return value;
|
|
8162
|
+
};
|
|
8163
|
+
var getCellBackgroundColor = (isCellInEditMode) => ({
|
|
8164
|
+
background: isCellInEditMode ? colors.lightBlueBackground : colors.neutral100
|
|
8165
|
+
});
|
|
8166
|
+
var TableDesktopCell = ({
|
|
8167
|
+
inputLabel,
|
|
8168
|
+
editInitialValue,
|
|
8169
|
+
rowId,
|
|
8170
|
+
field,
|
|
8171
|
+
fieldName,
|
|
8172
|
+
width,
|
|
8173
|
+
enableEditMode,
|
|
8174
|
+
disabled,
|
|
8175
|
+
readOnlyValue,
|
|
8176
|
+
editableCellType,
|
|
8177
|
+
filterOptions,
|
|
8178
|
+
refetchFilterOptions,
|
|
8179
|
+
isFetchingFilterOptions,
|
|
8180
|
+
validateInput,
|
|
8181
|
+
onUpdateEditableCell,
|
|
8182
|
+
onCellClick
|
|
8183
|
+
}) => {
|
|
8184
|
+
const cellRef = (0, import_react39.useRef)(null);
|
|
8185
|
+
const [isOverflowed, setIsOverflowed] = (0, import_react39.useState)(false);
|
|
8186
|
+
const [isCellHovered, setIsCellHovered] = (0, import_react39.useState)(false);
|
|
8187
|
+
const [isCellInEditMode, setIsCellInEditMode] = (0, import_react39.useState)(false);
|
|
8188
|
+
(0, import_react39.useEffect)(() => {
|
|
8189
|
+
const ref = cellRef.current;
|
|
8190
|
+
if (ref) {
|
|
8191
|
+
setIsOverflowed(ref.scrollWidth > ref.clientWidth);
|
|
7945
8192
|
}
|
|
7946
|
-
|
|
7947
|
-
|
|
8193
|
+
}, [readOnlyValue, width]);
|
|
8194
|
+
(0, import_react39.useEffect)(() => {
|
|
8195
|
+
const handleKeyDown = (e) => {
|
|
8196
|
+
if (e.key === "Escape") {
|
|
8197
|
+
setIsCellInEditMode(false);
|
|
8198
|
+
}
|
|
8199
|
+
};
|
|
8200
|
+
if (isCellInEditMode) {
|
|
8201
|
+
window.addEventListener("keydown", handleKeyDown);
|
|
8202
|
+
}
|
|
8203
|
+
return () => {
|
|
8204
|
+
window.removeEventListener("keydown", handleKeyDown);
|
|
8205
|
+
};
|
|
8206
|
+
}, [isCellInEditMode]);
|
|
7948
8207
|
const handleEditClick = (e) => {
|
|
7949
8208
|
e.stopPropagation();
|
|
7950
|
-
|
|
8209
|
+
setIsCellInEditMode((prev) => !prev);
|
|
7951
8210
|
};
|
|
7952
|
-
|
|
7953
|
-
|
|
8211
|
+
const isCellEditable = !!enableEditMode && !!editableCellType && !disabled;
|
|
8212
|
+
return /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(import_material70.Tooltip, { title: isOverflowed ? String(readOnlyValue) : "", arrow: true, children: /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(
|
|
8213
|
+
import_material70.TableCell,
|
|
7954
8214
|
{
|
|
7955
8215
|
align: "left",
|
|
7956
|
-
onMouseEnter: () =>
|
|
7957
|
-
onMouseLeave: () =>
|
|
7958
|
-
onClick: (event) => !disabled && onCellClick?.(event,
|
|
8216
|
+
onMouseEnter: () => isCellEditable && setIsCellHovered(true),
|
|
8217
|
+
onMouseLeave: () => isCellEditable && setIsCellHovered(false),
|
|
8218
|
+
onClick: (event) => !disabled && onCellClick?.(event, isCellInEditMode),
|
|
7959
8219
|
sx: {
|
|
7960
8220
|
padding: 1,
|
|
7961
8221
|
width: width ?? "auto",
|
|
7962
8222
|
position: "relative",
|
|
7963
|
-
cursor: disabled ? "default" : "pointer",
|
|
8223
|
+
cursor: disabled || !enableEditMode ? "default" : "pointer",
|
|
7964
8224
|
opacity: disabled ? 0.2 : 1,
|
|
7965
|
-
":hover":
|
|
7966
|
-
|
|
7967
|
-
},
|
|
7968
|
-
background: isEditMode ? colors.lightBlueBackground : (theme) => theme.palette.background.default
|
|
8225
|
+
":hover": isCellEditable ? getCellBackgroundColor(isCellInEditMode) : void 0,
|
|
8226
|
+
background: enableEditMode && isCellInEditMode ? colors.lightBlueBackground : void 0
|
|
7969
8227
|
},
|
|
7970
|
-
children: /* @__PURE__ */ (0,
|
|
7971
|
-
|
|
8228
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime124.jsxs)(
|
|
8229
|
+
import_material70.Box,
|
|
7972
8230
|
{
|
|
7973
8231
|
p: 1,
|
|
7974
8232
|
ref: cellRef,
|
|
@@ -7976,8 +8234,8 @@ var TableDesktopRowCell = ({
|
|
|
7976
8234
|
textOverflow: "ellipsis",
|
|
7977
8235
|
whiteSpace: "nowrap",
|
|
7978
8236
|
children: [
|
|
7979
|
-
isCellHovered ? /* @__PURE__ */ (0,
|
|
7980
|
-
|
|
8237
|
+
enableEditMode && isCellHovered ? /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(import_material70.Tooltip, { title: isCellInEditMode ? "" : "Toggle Edit Mode", children: /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(
|
|
8238
|
+
import_material70.IconButton,
|
|
7981
8239
|
{
|
|
7982
8240
|
onClick: handleEditClick,
|
|
7983
8241
|
sx: {
|
|
@@ -7986,15 +8244,31 @@ var TableDesktopRowCell = ({
|
|
|
7986
8244
|
zIndex: 1,
|
|
7987
8245
|
borderRadius: 0,
|
|
7988
8246
|
position: "absolute",
|
|
7989
|
-
background:
|
|
8247
|
+
background: isCellInEditMode ? colors.lightBlueBackground : colors.neutral100,
|
|
7990
8248
|
"&:hover": {
|
|
7991
|
-
backgroundColor:
|
|
8249
|
+
backgroundColor: isCellInEditMode ? colors.lightBlueBackground : colors.neutral150
|
|
7992
8250
|
}
|
|
7993
8251
|
},
|
|
7994
|
-
children:
|
|
8252
|
+
children: isCellInEditMode ? /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(import_Close.default, { fontSize: "small", color: "error" }) : /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(import_Edit.default, { fontSize: "small" })
|
|
7995
8253
|
}
|
|
7996
8254
|
) }) : null,
|
|
7997
|
-
|
|
8255
|
+
enableEditMode && isCellInEditMode && editableCellType ? /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(
|
|
8256
|
+
TableDesktopEditableComponent,
|
|
8257
|
+
{
|
|
8258
|
+
editInitialValue,
|
|
8259
|
+
rowId,
|
|
8260
|
+
field,
|
|
8261
|
+
fieldName,
|
|
8262
|
+
disabled,
|
|
8263
|
+
inputLabel: inputLabel ?? "",
|
|
8264
|
+
editableCellType,
|
|
8265
|
+
filterOptions,
|
|
8266
|
+
refetchFilterOptions,
|
|
8267
|
+
isFetchingFilterOptions,
|
|
8268
|
+
validateInput,
|
|
8269
|
+
onUpdateEditableCell
|
|
8270
|
+
}
|
|
8271
|
+
) : renderReadOnlyValue(readOnlyValue)
|
|
7998
8272
|
]
|
|
7999
8273
|
}
|
|
8000
8274
|
)
|
|
@@ -8003,12 +8277,12 @@ var TableDesktopRowCell = ({
|
|
|
8003
8277
|
};
|
|
8004
8278
|
|
|
8005
8279
|
// src/components/TableHeader/TableHeader.tsx
|
|
8006
|
-
var
|
|
8280
|
+
var import_react40 = require("react");
|
|
8007
8281
|
var import_icons_material12 = require("@mui/icons-material");
|
|
8008
|
-
var
|
|
8009
|
-
var
|
|
8010
|
-
var
|
|
8011
|
-
var
|
|
8282
|
+
var import_material71 = require("@mui/material");
|
|
8283
|
+
var import_mui56 = require("tss-react/mui");
|
|
8284
|
+
var import_jsx_runtime125 = require("react/jsx-runtime");
|
|
8285
|
+
var useStyles50 = (0, import_mui56.makeStyles)()(() => ({
|
|
8012
8286
|
sortLabel: {
|
|
8013
8287
|
"& .MuiTableSortLabel-icon": {
|
|
8014
8288
|
opacity: 1
|
|
@@ -8016,9 +8290,9 @@ var useStyles51 = (0, import_mui57.makeStyles)()(() => ({
|
|
|
8016
8290
|
}
|
|
8017
8291
|
}));
|
|
8018
8292
|
var TableHeader = ({ cells, onSort = null }) => {
|
|
8019
|
-
const [sortableCells, setSortableCells] = (0,
|
|
8020
|
-
const { classes } =
|
|
8021
|
-
(0,
|
|
8293
|
+
const [sortableCells, setSortableCells] = (0, import_react40.useState)([]);
|
|
8294
|
+
const { classes } = useStyles50();
|
|
8295
|
+
(0, import_react40.useEffect)(() => {
|
|
8022
8296
|
setSortableCells(cells);
|
|
8023
8297
|
}, []);
|
|
8024
8298
|
const getNewSortDirection = (direction) => {
|
|
@@ -8052,8 +8326,8 @@ var TableHeader = ({ cells, onSort = null }) => {
|
|
|
8052
8326
|
});
|
|
8053
8327
|
setSortableCells(sortedCells);
|
|
8054
8328
|
};
|
|
8055
|
-
return /* @__PURE__ */ (0,
|
|
8056
|
-
|
|
8329
|
+
return /* @__PURE__ */ (0, import_jsx_runtime125.jsx)(import_material71.TableHead, { children: /* @__PURE__ */ (0, import_jsx_runtime125.jsx)(import_material71.TableRow, { children: sortableCells.map((cell, key) => /* @__PURE__ */ (0, import_jsx_runtime125.jsx)(import_material71.TableCell, { children: cell.isSortable ? /* @__PURE__ */ (0, import_jsx_runtime125.jsx)(
|
|
8330
|
+
import_material71.TableSortLabel,
|
|
8057
8331
|
{
|
|
8058
8332
|
className: classes.sortLabel,
|
|
8059
8333
|
direction: cell?.direction || "asc",
|
|
@@ -8063,13 +8337,13 @@ var TableHeader = ({ cells, onSort = null }) => {
|
|
|
8063
8337
|
}
|
|
8064
8338
|
) : cell.label }, cell.label || key)) }) });
|
|
8065
8339
|
};
|
|
8066
|
-
var TableHeader_default = (0,
|
|
8340
|
+
var TableHeader_default = (0, import_react40.memo)(TableHeader);
|
|
8067
8341
|
|
|
8068
8342
|
// src/components/TextDivider/TextDivider.tsx
|
|
8069
|
-
var
|
|
8070
|
-
var
|
|
8071
|
-
var
|
|
8072
|
-
var
|
|
8343
|
+
var import_material72 = require("@mui/material");
|
|
8344
|
+
var import_mui57 = require("tss-react/mui");
|
|
8345
|
+
var import_jsx_runtime126 = require("react/jsx-runtime");
|
|
8346
|
+
var useStyles51 = (0, import_mui57.makeStyles)()(() => ({
|
|
8073
8347
|
icon: {
|
|
8074
8348
|
fontSize: 20
|
|
8075
8349
|
},
|
|
@@ -8103,21 +8377,21 @@ var TextDivider = ({
|
|
|
8103
8377
|
iconPosition = "left",
|
|
8104
8378
|
titleWeight = "400"
|
|
8105
8379
|
}) => {
|
|
8106
|
-
const { classes } =
|
|
8380
|
+
const { classes } = useStyles51();
|
|
8107
8381
|
const iconColor = color ?? colors.neutral900;
|
|
8108
|
-
return /* @__PURE__ */ (0,
|
|
8109
|
-
|
|
8382
|
+
return /* @__PURE__ */ (0, import_jsx_runtime126.jsxs)(
|
|
8383
|
+
import_material72.Box,
|
|
8110
8384
|
{
|
|
8111
8385
|
display: "flex",
|
|
8112
8386
|
alignItems: "center",
|
|
8113
8387
|
justifyContent: "space-between",
|
|
8114
8388
|
className: classes.container,
|
|
8115
8389
|
children: [
|
|
8116
|
-
/* @__PURE__ */ (0,
|
|
8117
|
-
/* @__PURE__ */ (0,
|
|
8118
|
-
Icon2 && iconPosition === "left" && /* @__PURE__ */ (0,
|
|
8119
|
-
/* @__PURE__ */ (0,
|
|
8120
|
-
|
|
8390
|
+
/* @__PURE__ */ (0, import_jsx_runtime126.jsx)(import_material72.Divider, { className: classes.leftDivider }),
|
|
8391
|
+
/* @__PURE__ */ (0, import_jsx_runtime126.jsx)(import_material72.Button, { onClick, disabled: !onClick, className: classes.button, children: /* @__PURE__ */ (0, import_jsx_runtime126.jsxs)(import_material72.Box, { className: classes.center, children: [
|
|
8392
|
+
Icon2 && iconPosition === "left" && /* @__PURE__ */ (0, import_jsx_runtime126.jsx)(Icon2, { className: classes.icon, style: { color: iconColor } }),
|
|
8393
|
+
/* @__PURE__ */ (0, import_jsx_runtime126.jsx)(
|
|
8394
|
+
import_material72.Typography,
|
|
8121
8395
|
{
|
|
8122
8396
|
color: "textSecondary",
|
|
8123
8397
|
className: classes.title,
|
|
@@ -8125,9 +8399,9 @@ var TextDivider = ({
|
|
|
8125
8399
|
children: title
|
|
8126
8400
|
}
|
|
8127
8401
|
),
|
|
8128
|
-
Icon2 && iconPosition === "right" && /* @__PURE__ */ (0,
|
|
8402
|
+
Icon2 && iconPosition === "right" && /* @__PURE__ */ (0, import_jsx_runtime126.jsx)(Icon2, { className: classes.icon, style: { color: iconColor } })
|
|
8129
8403
|
] }) }),
|
|
8130
|
-
/* @__PURE__ */ (0,
|
|
8404
|
+
/* @__PURE__ */ (0, import_jsx_runtime126.jsx)(import_material72.Divider, { className: classes.rightDivider })
|
|
8131
8405
|
]
|
|
8132
8406
|
}
|
|
8133
8407
|
);
|
|
@@ -8136,11 +8410,11 @@ var TextDivider_default = TextDivider;
|
|
|
8136
8410
|
|
|
8137
8411
|
// src/components/ThemedDateRangePicker/ThemedDateRangePicker.tsx
|
|
8138
8412
|
var import_react_dates = require("react-dates");
|
|
8139
|
-
var
|
|
8413
|
+
var import_mui58 = require("tss-react/mui");
|
|
8140
8414
|
var import_initialize = require("react-dates/initialize");
|
|
8141
8415
|
var import_datepicker = require("react-dates/lib/css/_datepicker.css");
|
|
8142
|
-
var
|
|
8143
|
-
var
|
|
8416
|
+
var import_jsx_runtime127 = require("react/jsx-runtime");
|
|
8417
|
+
var useStyles52 = (0, import_mui58.makeStyles)()((theme) => ({
|
|
8144
8418
|
wrapper: {
|
|
8145
8419
|
"& .DateRangePicker": {
|
|
8146
8420
|
backgroundColor: theme.palette.mode === "dark" ? theme.palette.grey[900] : colors.neutral100,
|
|
@@ -8234,17 +8508,17 @@ var ThemedDateRangePicker = ({
|
|
|
8234
8508
|
className,
|
|
8235
8509
|
...props
|
|
8236
8510
|
}) => {
|
|
8237
|
-
const { classes, cx } =
|
|
8238
|
-
return /* @__PURE__ */ (0,
|
|
8511
|
+
const { classes, cx } = useStyles52();
|
|
8512
|
+
return /* @__PURE__ */ (0, import_jsx_runtime127.jsx)("div", { className: cx(classes.wrapper, className), children: /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(import_react_dates.DateRangePicker, { ...props }) });
|
|
8239
8513
|
};
|
|
8240
8514
|
var ThemedDateRangePicker_default = ThemedDateRangePicker;
|
|
8241
8515
|
|
|
8242
8516
|
// src/components/TheToolbar/TheToolbar.tsx
|
|
8243
|
-
var
|
|
8244
|
-
var
|
|
8245
|
-
var
|
|
8246
|
-
var
|
|
8247
|
-
var
|
|
8517
|
+
var import_react41 = require("react");
|
|
8518
|
+
var import_material73 = require("@mui/material");
|
|
8519
|
+
var import_mui59 = require("tss-react/mui");
|
|
8520
|
+
var import_jsx_runtime128 = require("react/jsx-runtime");
|
|
8521
|
+
var useStyles53 = (0, import_mui59.makeStyles)()((theme) => ({
|
|
8248
8522
|
menuButton: {
|
|
8249
8523
|
color: theme.palette.primary.contrastText
|
|
8250
8524
|
},
|
|
@@ -8262,10 +8536,10 @@ var TheToolbar = ({
|
|
|
8262
8536
|
leftSection,
|
|
8263
8537
|
rightSection
|
|
8264
8538
|
}) => {
|
|
8265
|
-
const { classes } =
|
|
8266
|
-
return /* @__PURE__ */ (0,
|
|
8267
|
-
/* @__PURE__ */ (0,
|
|
8268
|
-
/* @__PURE__ */ (0,
|
|
8539
|
+
const { classes } = useStyles53();
|
|
8540
|
+
return /* @__PURE__ */ (0, import_jsx_runtime128.jsxs)(import_material73.Box, { children: [
|
|
8541
|
+
/* @__PURE__ */ (0, import_jsx_runtime128.jsx)(import_material73.AppBar, { children: /* @__PURE__ */ (0, import_jsx_runtime128.jsxs)(import_material73.Toolbar, { className: classes.topBar, children: [
|
|
8542
|
+
/* @__PURE__ */ (0, import_jsx_runtime128.jsx)(
|
|
8269
8543
|
RoundButton_default,
|
|
8270
8544
|
{
|
|
8271
8545
|
className: classes.menuButton,
|
|
@@ -8274,7 +8548,7 @@ var TheToolbar = ({
|
|
|
8274
8548
|
onClick: handleOpen
|
|
8275
8549
|
}
|
|
8276
8550
|
),
|
|
8277
|
-
/* @__PURE__ */ (0,
|
|
8551
|
+
/* @__PURE__ */ (0, import_jsx_runtime128.jsx)(
|
|
8278
8552
|
CompanyLogo_default,
|
|
8279
8553
|
{
|
|
8280
8554
|
size: "small",
|
|
@@ -8283,31 +8557,31 @@ var TheToolbar = ({
|
|
|
8283
8557
|
imageLogoLightSmall
|
|
8284
8558
|
}
|
|
8285
8559
|
),
|
|
8286
|
-
/* @__PURE__ */ (0,
|
|
8287
|
-
/* @__PURE__ */ (0,
|
|
8560
|
+
/* @__PURE__ */ (0, import_jsx_runtime128.jsx)(import_material73.Box, { ml: 2, children: leftSection }),
|
|
8561
|
+
/* @__PURE__ */ (0, import_jsx_runtime128.jsx)(import_material73.Box, { ml: "auto", children: rightSection })
|
|
8288
8562
|
] }) }),
|
|
8289
8563
|
LeftDrawer
|
|
8290
8564
|
] });
|
|
8291
8565
|
};
|
|
8292
|
-
var TheToolbar_default = (0,
|
|
8566
|
+
var TheToolbar_default = (0, import_react41.memo)(TheToolbar);
|
|
8293
8567
|
|
|
8294
8568
|
// src/components/ToastMessage/ToastMessage.tsx
|
|
8295
|
-
var
|
|
8296
|
-
var
|
|
8569
|
+
var import_material74 = require("@mui/material");
|
|
8570
|
+
var import_jsx_runtime129 = require("react/jsx-runtime");
|
|
8297
8571
|
var ToastMessage = ({
|
|
8298
8572
|
toastType,
|
|
8299
8573
|
toastMessage,
|
|
8300
8574
|
open,
|
|
8301
8575
|
onClose
|
|
8302
|
-
}) => /* @__PURE__ */ (0,
|
|
8303
|
-
|
|
8576
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(
|
|
8577
|
+
import_material74.Snackbar,
|
|
8304
8578
|
{
|
|
8305
8579
|
open,
|
|
8306
8580
|
autoHideDuration: 1500,
|
|
8307
8581
|
onClose,
|
|
8308
8582
|
anchorOrigin: { vertical: "top", horizontal: "right" },
|
|
8309
|
-
children: /* @__PURE__ */ (0,
|
|
8310
|
-
|
|
8583
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(
|
|
8584
|
+
import_material74.Alert,
|
|
8311
8585
|
{
|
|
8312
8586
|
elevation: 6,
|
|
8313
8587
|
variant: "filled",
|
|
@@ -8333,10 +8607,10 @@ var ToastMessage = ({
|
|
|
8333
8607
|
var ToastMessage_default = ToastMessage;
|
|
8334
8608
|
|
|
8335
8609
|
// src/components/TwoButtonDialog/TwoButtonDialog.tsx
|
|
8336
|
-
var
|
|
8337
|
-
var
|
|
8338
|
-
var
|
|
8339
|
-
var
|
|
8610
|
+
var import_material75 = require("@mui/material");
|
|
8611
|
+
var import_mui60 = require("tss-react/mui");
|
|
8612
|
+
var import_jsx_runtime130 = require("react/jsx-runtime");
|
|
8613
|
+
var useStyles54 = (0, import_mui60.makeStyles)()((theme) => ({
|
|
8340
8614
|
paper: {
|
|
8341
8615
|
padding: theme.spacing(2)
|
|
8342
8616
|
},
|
|
@@ -8364,21 +8638,21 @@ var TwoButtonDialog = ({
|
|
|
8364
8638
|
cancelLabel = "CANCEL",
|
|
8365
8639
|
cancelButton
|
|
8366
8640
|
}) => {
|
|
8367
|
-
const { classes } =
|
|
8368
|
-
return /* @__PURE__ */ (0,
|
|
8369
|
-
|
|
8641
|
+
const { classes } = useStyles54();
|
|
8642
|
+
return /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(
|
|
8643
|
+
import_material75.Dialog,
|
|
8370
8644
|
{
|
|
8371
8645
|
open,
|
|
8372
8646
|
disableEnforceFocus: true,
|
|
8373
8647
|
maxWidth: "sm",
|
|
8374
8648
|
fullWidth: true,
|
|
8375
8649
|
closeAfterTransition: true,
|
|
8376
|
-
BackdropComponent:
|
|
8650
|
+
BackdropComponent: import_material75.Backdrop,
|
|
8377
8651
|
BackdropProps: { timeout: 500 },
|
|
8378
|
-
children: /* @__PURE__ */ (0,
|
|
8379
|
-
/* @__PURE__ */ (0,
|
|
8380
|
-
/* @__PURE__ */ (0,
|
|
8381
|
-
|
|
8652
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(import_material75.Fade, { in: open, children: /* @__PURE__ */ (0, import_jsx_runtime130.jsxs)(import_material75.Paper, { className: classes.paper, children: [
|
|
8653
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsxs)(import_material75.Box, { className: classes.mb, children: [
|
|
8654
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsx)(import_material75.Typography, { variant: "h5", component: "div", children: /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(
|
|
8655
|
+
import_material75.Box,
|
|
8382
8656
|
{
|
|
8383
8657
|
sx: {
|
|
8384
8658
|
fontWeight: 600
|
|
@@ -8386,23 +8660,23 @@ var TwoButtonDialog = ({
|
|
|
8386
8660
|
children: title
|
|
8387
8661
|
}
|
|
8388
8662
|
) }),
|
|
8389
|
-
/* @__PURE__ */ (0,
|
|
8390
|
-
|
|
8663
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsxs)(
|
|
8664
|
+
import_material75.Box,
|
|
8391
8665
|
{
|
|
8392
8666
|
className: classes.mt,
|
|
8393
8667
|
sx: {
|
|
8394
8668
|
fontWeight: 600
|
|
8395
8669
|
},
|
|
8396
8670
|
children: [
|
|
8397
|
-
subtitle1 && /* @__PURE__ */ (0,
|
|
8398
|
-
subtitle2 && /* @__PURE__ */ (0,
|
|
8671
|
+
subtitle1 && /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(import_material75.Typography, { variant: "subtitle1", children: subtitle1 }),
|
|
8672
|
+
subtitle2 && /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(import_material75.Typography, { variant: "subtitle1", children: subtitle2 })
|
|
8399
8673
|
]
|
|
8400
8674
|
}
|
|
8401
8675
|
)
|
|
8402
8676
|
] }),
|
|
8403
|
-
/* @__PURE__ */ (0,
|
|
8404
|
-
/* @__PURE__ */ (0,
|
|
8405
|
-
/* @__PURE__ */ (0,
|
|
8677
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsx)(import_material75.Divider, {}),
|
|
8678
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsxs)(import_material75.Box, { className: classes.buttonContainer, children: [
|
|
8679
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsx)(
|
|
8406
8680
|
FilledButton_default,
|
|
8407
8681
|
{
|
|
8408
8682
|
copy: cancelLabel,
|
|
@@ -8415,7 +8689,7 @@ var TwoButtonDialog = ({
|
|
|
8415
8689
|
}
|
|
8416
8690
|
}
|
|
8417
8691
|
),
|
|
8418
|
-
/* @__PURE__ */ (0,
|
|
8692
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsx)(
|
|
8419
8693
|
FilledButton_default,
|
|
8420
8694
|
{
|
|
8421
8695
|
color: "primary",
|
|
@@ -8424,7 +8698,7 @@ var TwoButtonDialog = ({
|
|
|
8424
8698
|
}
|
|
8425
8699
|
)
|
|
8426
8700
|
] }),
|
|
8427
|
-
/* @__PURE__ */ (0,
|
|
8701
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsx)(Loading_default, { isLoading: dialogLoading })
|
|
8428
8702
|
] }) })
|
|
8429
8703
|
}
|
|
8430
8704
|
);
|
|
@@ -8432,30 +8706,30 @@ var TwoButtonDialog = ({
|
|
|
8432
8706
|
var TwoButtonDialog_default = TwoButtonDialog;
|
|
8433
8707
|
|
|
8434
8708
|
// src/components/UserBust/UserBust.tsx
|
|
8435
|
-
var
|
|
8436
|
-
var
|
|
8437
|
-
var
|
|
8438
|
-
var UserBust = ({ user, avatarProps, typographyProps }) => /* @__PURE__ */ (0,
|
|
8439
|
-
/* @__PURE__ */ (0,
|
|
8440
|
-
|
|
8709
|
+
var import_react42 = require("react");
|
|
8710
|
+
var import_material76 = require("@mui/material");
|
|
8711
|
+
var import_jsx_runtime131 = require("react/jsx-runtime");
|
|
8712
|
+
var UserBust = ({ user, avatarProps, typographyProps }) => /* @__PURE__ */ (0, import_jsx_runtime131.jsxs)("div", { children: [
|
|
8713
|
+
/* @__PURE__ */ (0, import_jsx_runtime131.jsx)(
|
|
8714
|
+
import_material76.Avatar,
|
|
8441
8715
|
{
|
|
8442
8716
|
src: user.profile_picture,
|
|
8443
8717
|
alt: "user_avatar",
|
|
8444
8718
|
style: { width: avatarProps.width, height: avatarProps.height }
|
|
8445
8719
|
}
|
|
8446
8720
|
),
|
|
8447
|
-
/* @__PURE__ */ (0,
|
|
8448
|
-
/* @__PURE__ */ (0,
|
|
8449
|
-
/* @__PURE__ */ (0,
|
|
8721
|
+
/* @__PURE__ */ (0, import_jsx_runtime131.jsxs)("div", { style: { paddingTop: 16 }, children: [
|
|
8722
|
+
/* @__PURE__ */ (0, import_jsx_runtime131.jsx)(import_material76.Typography, { ...typographyProps.name, children: `${user.first_name} ${user.last_name}` }),
|
|
8723
|
+
/* @__PURE__ */ (0, import_jsx_runtime131.jsx)(import_material76.Typography, { ...typographyProps.username, children: user.username })
|
|
8450
8724
|
] })
|
|
8451
8725
|
] });
|
|
8452
|
-
var UserBust_default = (0,
|
|
8726
|
+
var UserBust_default = (0, import_react42.memo)(UserBust);
|
|
8453
8727
|
|
|
8454
8728
|
// src/components/icons/IconChart.tsx
|
|
8455
|
-
var
|
|
8729
|
+
var import_jsx_runtime132 = require("react/jsx-runtime");
|
|
8456
8730
|
var SvgIconChart = (props) => {
|
|
8457
8731
|
const { fill } = props;
|
|
8458
|
-
return /* @__PURE__ */ (0,
|
|
8732
|
+
return /* @__PURE__ */ (0, import_jsx_runtime132.jsx)(
|
|
8459
8733
|
"svg",
|
|
8460
8734
|
{
|
|
8461
8735
|
width: "20",
|
|
@@ -8464,7 +8738,7 @@ var SvgIconChart = (props) => {
|
|
|
8464
8738
|
fill: "none",
|
|
8465
8739
|
xmlns: "http://www.w3.org/2000/svg",
|
|
8466
8740
|
...props,
|
|
8467
|
-
children: /* @__PURE__ */ (0,
|
|
8741
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime132.jsx)(
|
|
8468
8742
|
"path",
|
|
8469
8743
|
{
|
|
8470
8744
|
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",
|
|
@@ -8543,9 +8817,9 @@ var IconChart_default = SvgIconChart;
|
|
|
8543
8817
|
Switch,
|
|
8544
8818
|
Table,
|
|
8545
8819
|
TableDesktop,
|
|
8820
|
+
TableDesktopCell,
|
|
8821
|
+
TableDesktopEditableComponent,
|
|
8546
8822
|
TableDesktopFooter,
|
|
8547
|
-
TableDesktopRowCell,
|
|
8548
|
-
TableDesktopSmartSelect,
|
|
8549
8823
|
TableEmptyResult,
|
|
8550
8824
|
TableHeader,
|
|
8551
8825
|
TableLoading,
|