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