@natoora-libs/core 0.2.11 → 0.2.12-dev-doug-2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{TableDesktop-CZe649rr.d.cts → TableDesktop-BrpwT-lM.d.cts} +7 -5
- package/dist/{TableDesktop-CZe649rr.d.ts → TableDesktop-BrpwT-lM.d.ts} +7 -5
- package/dist/components/index.cjs +139 -78
- package/dist/components/index.cjs.map +1 -1
- package/dist/components/index.d.cts +8 -5
- package/dist/components/index.d.ts +8 -5
- package/dist/components/index.js +127 -66
- package/dist/components/index.js.map +1 -1
- package/dist/utils/index.d.cts +1 -1
- package/dist/utils/index.d.ts +1 -1
- package/package.json +1 -1
|
@@ -32,7 +32,7 @@ type ExportCsvDialogProps = {
|
|
|
32
32
|
};
|
|
33
33
|
type BulkChangesDialogProps = {
|
|
34
34
|
bulkChanges: BulkChanges;
|
|
35
|
-
selectedRows:
|
|
35
|
+
selectedRows: RowId[];
|
|
36
36
|
shouldUpdateAll: boolean;
|
|
37
37
|
visibleEditableColumns: HeadCell[];
|
|
38
38
|
isBulkChangesDialogOpen: boolean;
|
|
@@ -43,7 +43,7 @@ type TableDesktopToolbarProps = {
|
|
|
43
43
|
toolbarLabel?: string;
|
|
44
44
|
headCells: HeadCell[];
|
|
45
45
|
headerFilters: HeaderFilters;
|
|
46
|
-
selectedRows:
|
|
46
|
+
selectedRows: RowId[];
|
|
47
47
|
isDataEmpty: boolean;
|
|
48
48
|
totalDataCount?: number;
|
|
49
49
|
isRowsFromAllPagesSelected: boolean;
|
|
@@ -55,6 +55,7 @@ type TableDesktopToolbarProps = {
|
|
|
55
55
|
disableBulkChangesMode?: boolean;
|
|
56
56
|
isBulkChangesMode: boolean;
|
|
57
57
|
onChangeBulkChangesMode: (checked: boolean) => void;
|
|
58
|
+
onActivateBulkChangesMode?: () => void;
|
|
58
59
|
renderExportCsvDialog?: (props: ExportCsvDialogProps) => ReactNode;
|
|
59
60
|
renderBulkChangesDialog?: (props: BulkChangesDialogProps) => ReactNode;
|
|
60
61
|
renderTableColumnConfigurationMenu?: (props: TableColumnConfigurationMenuProps) => ReactNode;
|
|
@@ -73,11 +74,12 @@ type HeaderFilters = {
|
|
|
73
74
|
[key: string]: HeaderFilterOptions;
|
|
74
75
|
};
|
|
75
76
|
type UpdateEditableCellParams = {
|
|
76
|
-
rowId?:
|
|
77
|
+
rowId?: RowId;
|
|
77
78
|
columnId: string;
|
|
78
79
|
value: string | number | boolean | (string | number)[] | null;
|
|
79
80
|
label: string | number | boolean | (string | number)[] | null;
|
|
80
81
|
};
|
|
82
|
+
type RowId = string | number;
|
|
81
83
|
type HeadCell = {
|
|
82
84
|
id: string;
|
|
83
85
|
label?: string;
|
|
@@ -122,7 +124,7 @@ type TableDesktopProps = {
|
|
|
122
124
|
showClearFilterButton?: boolean;
|
|
123
125
|
handleClickOnClearFiltersButton?: () => void;
|
|
124
126
|
deleteItem?: (id: number, contentTypeName?: string, appTypeName?: string) => void;
|
|
125
|
-
keyField?: string;
|
|
127
|
+
keyField?: string | ((rowData: any) => string);
|
|
126
128
|
tableLayout?: 'fixed' | 'auto';
|
|
127
129
|
onApplyFilters?: (updatedFilters: HeaderFilters, shouldSave: boolean) => void;
|
|
128
130
|
refetchData?: () => Promise<unknown>;
|
|
@@ -130,4 +132,4 @@ type TableDesktopProps = {
|
|
|
130
132
|
};
|
|
131
133
|
declare const TableDesktop: ({ data, headCells, RenderItem, renderToolbar, renderFooter, appliedFilters, headerFilters, children, height, rowHeight, rowsPerPage, totalDataCount, isLoading, enableEditMode, disableInternalSort, updateSort, showClearFilterButton, handleClickOnClearFiltersButton, deleteItem, keyField, tableLayout, onApplyFilters, shouldShowCheckOnFilter, refetchData, }: TableDesktopProps) => react_jsx_runtime.JSX.Element;
|
|
132
134
|
|
|
133
|
-
export { type BulkChanges as B, type EditableCellType as E, type HeadCell as H, type Order as O, type TableDesktopProps as T, type UpdateEditableCellParams as U, type HeaderFilters as a, type HeaderFilterOptions as b, type HeaderFilterObject as c, TableDesktop as d, TableDesktopFooter as e, type TableDesktopFooterProps as f, TableDesktopToolbar as g, type TableDesktopToolbarProps as h, type TableColumnConfigurationMenuProps as i, type BulkChangesDialogProps as j, type ExportCsvDialogProps as k };
|
|
135
|
+
export { type BulkChanges as B, type EditableCellType as E, type HeadCell as H, type Order as O, type RowId as R, type TableDesktopProps as T, type UpdateEditableCellParams as U, type HeaderFilters as a, type HeaderFilterOptions as b, type HeaderFilterObject as c, TableDesktop as d, TableDesktopFooter as e, type TableDesktopFooterProps as f, TableDesktopToolbar as g, type TableDesktopToolbarProps as h, type TableColumnConfigurationMenuProps as i, type BulkChangesDialogProps as j, type ExportCsvDialogProps as k };
|
|
@@ -32,7 +32,7 @@ type ExportCsvDialogProps = {
|
|
|
32
32
|
};
|
|
33
33
|
type BulkChangesDialogProps = {
|
|
34
34
|
bulkChanges: BulkChanges;
|
|
35
|
-
selectedRows:
|
|
35
|
+
selectedRows: RowId[];
|
|
36
36
|
shouldUpdateAll: boolean;
|
|
37
37
|
visibleEditableColumns: HeadCell[];
|
|
38
38
|
isBulkChangesDialogOpen: boolean;
|
|
@@ -43,7 +43,7 @@ type TableDesktopToolbarProps = {
|
|
|
43
43
|
toolbarLabel?: string;
|
|
44
44
|
headCells: HeadCell[];
|
|
45
45
|
headerFilters: HeaderFilters;
|
|
46
|
-
selectedRows:
|
|
46
|
+
selectedRows: RowId[];
|
|
47
47
|
isDataEmpty: boolean;
|
|
48
48
|
totalDataCount?: number;
|
|
49
49
|
isRowsFromAllPagesSelected: boolean;
|
|
@@ -55,6 +55,7 @@ type TableDesktopToolbarProps = {
|
|
|
55
55
|
disableBulkChangesMode?: boolean;
|
|
56
56
|
isBulkChangesMode: boolean;
|
|
57
57
|
onChangeBulkChangesMode: (checked: boolean) => void;
|
|
58
|
+
onActivateBulkChangesMode?: () => void;
|
|
58
59
|
renderExportCsvDialog?: (props: ExportCsvDialogProps) => ReactNode;
|
|
59
60
|
renderBulkChangesDialog?: (props: BulkChangesDialogProps) => ReactNode;
|
|
60
61
|
renderTableColumnConfigurationMenu?: (props: TableColumnConfigurationMenuProps) => ReactNode;
|
|
@@ -73,11 +74,12 @@ type HeaderFilters = {
|
|
|
73
74
|
[key: string]: HeaderFilterOptions;
|
|
74
75
|
};
|
|
75
76
|
type UpdateEditableCellParams = {
|
|
76
|
-
rowId?:
|
|
77
|
+
rowId?: RowId;
|
|
77
78
|
columnId: string;
|
|
78
79
|
value: string | number | boolean | (string | number)[] | null;
|
|
79
80
|
label: string | number | boolean | (string | number)[] | null;
|
|
80
81
|
};
|
|
82
|
+
type RowId = string | number;
|
|
81
83
|
type HeadCell = {
|
|
82
84
|
id: string;
|
|
83
85
|
label?: string;
|
|
@@ -122,7 +124,7 @@ type TableDesktopProps = {
|
|
|
122
124
|
showClearFilterButton?: boolean;
|
|
123
125
|
handleClickOnClearFiltersButton?: () => void;
|
|
124
126
|
deleteItem?: (id: number, contentTypeName?: string, appTypeName?: string) => void;
|
|
125
|
-
keyField?: string;
|
|
127
|
+
keyField?: string | ((rowData: any) => string);
|
|
126
128
|
tableLayout?: 'fixed' | 'auto';
|
|
127
129
|
onApplyFilters?: (updatedFilters: HeaderFilters, shouldSave: boolean) => void;
|
|
128
130
|
refetchData?: () => Promise<unknown>;
|
|
@@ -130,4 +132,4 @@ type TableDesktopProps = {
|
|
|
130
132
|
};
|
|
131
133
|
declare const TableDesktop: ({ data, headCells, RenderItem, renderToolbar, renderFooter, appliedFilters, headerFilters, children, height, rowHeight, rowsPerPage, totalDataCount, isLoading, enableEditMode, disableInternalSort, updateSort, showClearFilterButton, handleClickOnClearFiltersButton, deleteItem, keyField, tableLayout, onApplyFilters, shouldShowCheckOnFilter, refetchData, }: TableDesktopProps) => react_jsx_runtime.JSX.Element;
|
|
132
134
|
|
|
133
|
-
export { type BulkChanges as B, type EditableCellType as E, type HeadCell as H, type Order as O, type TableDesktopProps as T, type UpdateEditableCellParams as U, type HeaderFilters as a, type HeaderFilterOptions as b, type HeaderFilterObject as c, TableDesktop as d, TableDesktopFooter as e, type TableDesktopFooterProps as f, TableDesktopToolbar as g, type TableDesktopToolbarProps as h, type TableColumnConfigurationMenuProps as i, type BulkChangesDialogProps as j, type ExportCsvDialogProps as k };
|
|
135
|
+
export { type BulkChanges as B, type EditableCellType as E, type HeadCell as H, type Order as O, type RowId as R, type TableDesktopProps as T, type UpdateEditableCellParams as U, type HeaderFilters as a, type HeaderFilterOptions as b, type HeaderFilterObject as c, TableDesktop as d, TableDesktopFooter as e, type TableDesktopFooterProps as f, TableDesktopToolbar as g, type TableDesktopToolbarProps as h, type TableColumnConfigurationMenuProps as i, type BulkChangesDialogProps as j, type ExportCsvDialogProps as k };
|
|
@@ -480,7 +480,9 @@ var AlertDialog = ({
|
|
|
480
480
|
rejectCopy,
|
|
481
481
|
acceptCopy,
|
|
482
482
|
content,
|
|
483
|
-
disabledContentPadding
|
|
483
|
+
disabledContentPadding,
|
|
484
|
+
disableEnforceFocus,
|
|
485
|
+
disableRestoreFocus
|
|
484
486
|
}) => {
|
|
485
487
|
const { classes } = useStyles();
|
|
486
488
|
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
@@ -491,6 +493,8 @@ var AlertDialog = ({
|
|
|
491
493
|
maxWidth,
|
|
492
494
|
fullScreen,
|
|
493
495
|
fullWidth,
|
|
496
|
+
disableEnforceFocus,
|
|
497
|
+
disableRestoreFocus,
|
|
494
498
|
children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_material2.Box, { children: [
|
|
495
499
|
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_material2.Box, { className: classes.topSection, children: [
|
|
496
500
|
alertTitle ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_material2.Typography, { variant: "h5", className: classes.title, children: alertTitle }) : null,
|
|
@@ -3730,7 +3734,7 @@ var CheckboxFilterMenuContent = ({
|
|
|
3730
3734
|
)
|
|
3731
3735
|
}
|
|
3732
3736
|
),
|
|
3733
|
-
/* @__PURE__ */ (0, import_jsx_runtime73.jsx)(import_material23.Divider, {}),
|
|
3737
|
+
/* @__PURE__ */ (0, import_jsx_runtime73.jsx)(import_material23.Divider, { sx: { mt: 0.5 } }),
|
|
3734
3738
|
/* @__PURE__ */ (0, import_jsx_runtime73.jsxs)(
|
|
3735
3739
|
import_material23.Box,
|
|
3736
3740
|
{
|
|
@@ -6504,7 +6508,7 @@ var RenderAvatar_default = RenderAvatar;
|
|
|
6504
6508
|
|
|
6505
6509
|
// src/components/RenderContentList/RenderContentList.tsx
|
|
6506
6510
|
var import_react29 = require("react");
|
|
6507
|
-
var
|
|
6511
|
+
var import_WarningAmber = __toESM(require("@mui/icons-material/WarningAmber"), 1);
|
|
6508
6512
|
var import_material53 = require("@mui/material");
|
|
6509
6513
|
var import_mui41 = require("tss-react/mui");
|
|
6510
6514
|
|
|
@@ -6536,8 +6540,32 @@ var RenderContentList = ({
|
|
|
6536
6540
|
const { classes } = useStyles36();
|
|
6537
6541
|
const [active, setActive] = (0, import_react29.useState)(activeSection);
|
|
6538
6542
|
const observer = (0, import_react29.useRef)(null);
|
|
6543
|
+
const isScrolling = (0, import_react29.useRef)(false);
|
|
6544
|
+
const timeoutScrolling = (0, import_react29.useRef)(null);
|
|
6539
6545
|
(0, import_react29.useEffect)(() => {
|
|
6540
|
-
|
|
6546
|
+
if (!activeSection) {
|
|
6547
|
+
return void 0;
|
|
6548
|
+
}
|
|
6549
|
+
isScrolling.current = true;
|
|
6550
|
+
const targetId = transformNameToID(activeSection);
|
|
6551
|
+
setActive(targetId);
|
|
6552
|
+
const element = document.getElementById(targetId);
|
|
6553
|
+
if (element) {
|
|
6554
|
+
element.scrollIntoView({
|
|
6555
|
+
behavior: "smooth",
|
|
6556
|
+
block: "start"
|
|
6557
|
+
});
|
|
6558
|
+
}
|
|
6559
|
+
if (timeoutScrolling.current) {
|
|
6560
|
+
clearTimeout(timeoutScrolling.current);
|
|
6561
|
+
}
|
|
6562
|
+
;
|
|
6563
|
+
timeoutScrolling.current = setTimeout(() => {
|
|
6564
|
+
isScrolling.current = false;
|
|
6565
|
+
}, 1e3);
|
|
6566
|
+
return () => {
|
|
6567
|
+
if (timeoutScrolling.current) clearTimeout(timeoutScrolling.current);
|
|
6568
|
+
};
|
|
6541
6569
|
}, [activeSection]);
|
|
6542
6570
|
(0, import_react29.useEffect)(() => {
|
|
6543
6571
|
const sections = items.map((item) => ({
|
|
@@ -6547,9 +6575,14 @@ var RenderContentList = ({
|
|
|
6547
6575
|
if (observer.current) {
|
|
6548
6576
|
observer.current.disconnect();
|
|
6549
6577
|
}
|
|
6550
|
-
if (sections.length === 0)
|
|
6578
|
+
if (sections.length === 0) {
|
|
6579
|
+
return void 0;
|
|
6580
|
+
}
|
|
6551
6581
|
observer.current = new IntersectionObserver(
|
|
6552
6582
|
(entries) => {
|
|
6583
|
+
if (isScrolling.current) {
|
|
6584
|
+
return;
|
|
6585
|
+
}
|
|
6553
6586
|
const visibleSection = entries.find((entry) => entry.isIntersecting);
|
|
6554
6587
|
if (visibleSection) {
|
|
6555
6588
|
setActive(visibleSection.target.id);
|
|
@@ -6568,6 +6601,21 @@ var RenderContentList = ({
|
|
|
6568
6601
|
observer.current?.disconnect();
|
|
6569
6602
|
};
|
|
6570
6603
|
}, [items]);
|
|
6604
|
+
const handleMenuClick = (id) => {
|
|
6605
|
+
isScrolling.current = true;
|
|
6606
|
+
setActive(id);
|
|
6607
|
+
const element = document.getElementById(id);
|
|
6608
|
+
if (element) {
|
|
6609
|
+
element.scrollIntoView({
|
|
6610
|
+
behavior: "smooth",
|
|
6611
|
+
block: "start"
|
|
6612
|
+
});
|
|
6613
|
+
}
|
|
6614
|
+
if (timeoutScrolling.current) clearTimeout(timeoutScrolling.current);
|
|
6615
|
+
timeoutScrolling.current = setTimeout(() => {
|
|
6616
|
+
isScrolling.current = false;
|
|
6617
|
+
}, 1e3);
|
|
6618
|
+
};
|
|
6571
6619
|
return /* @__PURE__ */ (0, import_jsx_runtime106.jsx)(
|
|
6572
6620
|
import_material53.List,
|
|
6573
6621
|
{
|
|
@@ -6581,19 +6629,10 @@ var RenderContentList = ({
|
|
|
6581
6629
|
{
|
|
6582
6630
|
selected: active === id,
|
|
6583
6631
|
classes: { root: classes.root, selected: classes.selected },
|
|
6584
|
-
onClick: () =>
|
|
6585
|
-
setActive(id);
|
|
6586
|
-
const element = document.getElementById(id);
|
|
6587
|
-
if (element) {
|
|
6588
|
-
element.scrollIntoView({
|
|
6589
|
-
behavior: "smooth",
|
|
6590
|
-
block: "start"
|
|
6591
|
-
});
|
|
6592
|
-
}
|
|
6593
|
-
},
|
|
6632
|
+
onClick: () => handleMenuClick(id),
|
|
6594
6633
|
children: [
|
|
6595
6634
|
/* @__PURE__ */ (0, import_jsx_runtime106.jsx)(import_material53.ListItemText, { primary: item }),
|
|
6596
|
-
(warningItems?.includes(item) || warningItems?.includes(id)) && /* @__PURE__ */ (0, import_jsx_runtime106.jsx)(import_material53.Tooltip, { title: warningMessage, children: /* @__PURE__ */ (0, import_jsx_runtime106.jsx)(
|
|
6635
|
+
(warningItems?.includes(item) || warningItems?.includes(id)) && /* @__PURE__ */ (0, import_jsx_runtime106.jsx)(import_material53.Tooltip, { title: warningMessage, children: /* @__PURE__ */ (0, import_jsx_runtime106.jsx)(import_WarningAmber.default, { color: "warning" }) })
|
|
6597
6636
|
]
|
|
6598
6637
|
},
|
|
6599
6638
|
id
|
|
@@ -6841,7 +6880,7 @@ var import_mui45 = require("tss-react/mui");
|
|
|
6841
6880
|
// src/components/SearchWithFilters/SearchWithFilters.tsx
|
|
6842
6881
|
var import_react31 = require("react");
|
|
6843
6882
|
var React6 = __toESM(require("react"), 1);
|
|
6844
|
-
var
|
|
6883
|
+
var import_icons_material8 = require("@mui/icons-material");
|
|
6845
6884
|
var import_material56 = require("@mui/material");
|
|
6846
6885
|
var import_mui44 = require("tss-react/mui");
|
|
6847
6886
|
var import_jsx_runtime109 = require("react/jsx-runtime");
|
|
@@ -6905,7 +6944,7 @@ var SearchWithFilters = ({
|
|
|
6905
6944
|
setSearchText(searchValue);
|
|
6906
6945
|
}, [searchValue]);
|
|
6907
6946
|
return /* @__PURE__ */ (0, import_jsx_runtime109.jsxs)(import_material56.Paper, { className: classes.searchContainer, children: [
|
|
6908
|
-
/* @__PURE__ */ (0, import_jsx_runtime109.jsx)(
|
|
6947
|
+
/* @__PURE__ */ (0, import_jsx_runtime109.jsx)(import_icons_material8.Search, { className: classes.icon, fontSize: "small" }),
|
|
6909
6948
|
/* @__PURE__ */ (0, import_jsx_runtime109.jsx)(
|
|
6910
6949
|
import_material56.InputBase,
|
|
6911
6950
|
{
|
|
@@ -6927,7 +6966,7 @@ var SearchWithFilters = ({
|
|
|
6927
6966
|
disabled,
|
|
6928
6967
|
children: [
|
|
6929
6968
|
"Filters",
|
|
6930
|
-
showFilters ? /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(
|
|
6969
|
+
showFilters ? /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(import_icons_material8.ArrowDropUp, {}) : /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(import_icons_material8.ArrowDropDown, {})
|
|
6931
6970
|
]
|
|
6932
6971
|
}
|
|
6933
6972
|
)
|
|
@@ -7002,7 +7041,7 @@ var import_mui47 = require("tss-react/mui");
|
|
|
7002
7041
|
|
|
7003
7042
|
// src/components/SearchWithFilters/SearchWithFiltersForTable.tsx
|
|
7004
7043
|
var import_react32 = require("react");
|
|
7005
|
-
var
|
|
7044
|
+
var import_icons_material9 = require("@mui/icons-material");
|
|
7006
7045
|
var import_material58 = require("@mui/material");
|
|
7007
7046
|
var import_mui46 = require("tss-react/mui");
|
|
7008
7047
|
var import_jsx_runtime111 = require("react/jsx-runtime");
|
|
@@ -7079,9 +7118,9 @@ var SearchWithFiltersForTable = (props) => {
|
|
|
7079
7118
|
enterPressedInSearch();
|
|
7080
7119
|
}
|
|
7081
7120
|
};
|
|
7082
|
-
const ArrowIcon = isOpen ?
|
|
7121
|
+
const ArrowIcon = isOpen ? import_icons_material9.ArrowDropUp : import_icons_material9.ArrowDropDown;
|
|
7083
7122
|
return /* @__PURE__ */ (0, import_jsx_runtime111.jsxs)(import_material58.Paper, { className: classes.c_search, children: [
|
|
7084
|
-
/* @__PURE__ */ (0, import_jsx_runtime111.jsx)(import_material58.Box, { className: classes.c_search__icon, children: /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(
|
|
7123
|
+
/* @__PURE__ */ (0, import_jsx_runtime111.jsx)(import_material58.Box, { className: classes.c_search__icon, children: /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(import_icons_material9.Search, { className: classes.icon, fontSize: "small" }) }),
|
|
7085
7124
|
/* @__PURE__ */ (0, import_jsx_runtime111.jsx)(
|
|
7086
7125
|
import_material58.InputBase,
|
|
7087
7126
|
{
|
|
@@ -7215,7 +7254,7 @@ var SearchHeader = (0, import_react33.memo)(
|
|
|
7215
7254
|
);
|
|
7216
7255
|
|
|
7217
7256
|
// src/components/SectionName/SectionName.tsx
|
|
7218
|
-
var
|
|
7257
|
+
var import_icons_material10 = require("@mui/icons-material");
|
|
7219
7258
|
var import_material61 = require("@mui/material");
|
|
7220
7259
|
var import_mui48 = require("tss-react/mui");
|
|
7221
7260
|
var import_jsx_runtime114 = require("react/jsx-runtime");
|
|
@@ -7274,7 +7313,7 @@ var SectionName = ({
|
|
|
7274
7313
|
}
|
|
7275
7314
|
),
|
|
7276
7315
|
tooltipDescription ? /* @__PURE__ */ (0, import_jsx_runtime114.jsx)(import_material61.Tooltip, { title: tooltipDescription, placement: "right", children: /* @__PURE__ */ (0, import_jsx_runtime114.jsx)(
|
|
7277
|
-
|
|
7316
|
+
import_icons_material10.Info,
|
|
7278
7317
|
{
|
|
7279
7318
|
fontSize: "small",
|
|
7280
7319
|
"data-testid": "InfoIcon",
|
|
@@ -7297,7 +7336,7 @@ var SectionName = ({
|
|
|
7297
7336
|
}
|
|
7298
7337
|
) : null,
|
|
7299
7338
|
openHistoryLog && buttonText && /* @__PURE__ */ (0, import_jsx_runtime114.jsx)(import_material61.Divider, { orientation: "vertical", sx: { height: "24px" } }),
|
|
7300
|
-
openHistoryLog && /* @__PURE__ */ (0, import_jsx_runtime114.jsx)(import_material61.IconButton, { size: "small", onClick: () => openHistoryLog(), children: /* @__PURE__ */ (0, import_jsx_runtime114.jsx)(
|
|
7339
|
+
openHistoryLog && /* @__PURE__ */ (0, import_jsx_runtime114.jsx)(import_material61.IconButton, { size: "small", onClick: () => openHistoryLog(), children: /* @__PURE__ */ (0, import_jsx_runtime114.jsx)(import_icons_material10.History, {}) })
|
|
7301
7340
|
] })
|
|
7302
7341
|
] });
|
|
7303
7342
|
};
|
|
@@ -7311,6 +7350,7 @@ var SmartMultipleSelect = ({
|
|
|
7311
7350
|
inputLabel,
|
|
7312
7351
|
variant = "standard",
|
|
7313
7352
|
size,
|
|
7353
|
+
error,
|
|
7314
7354
|
values,
|
|
7315
7355
|
defaultValues,
|
|
7316
7356
|
onChange,
|
|
@@ -7366,38 +7406,48 @@ var SmartMultipleSelect = ({
|
|
|
7366
7406
|
option.value ?? index
|
|
7367
7407
|
);
|
|
7368
7408
|
}) });
|
|
7369
|
-
return /* @__PURE__ */ (0, import_jsx_runtime115.jsxs)(
|
|
7370
|
-
|
|
7371
|
-
|
|
7372
|
-
|
|
7373
|
-
|
|
7374
|
-
|
|
7375
|
-
|
|
7376
|
-
|
|
7377
|
-
|
|
7378
|
-
|
|
7379
|
-
|
|
7380
|
-
|
|
7381
|
-
onClose: () => onClose?.(localValues),
|
|
7382
|
-
renderValue: (selectedValues) => {
|
|
7383
|
-
const valuesString = selectedValues.map((v) => v.label)?.join(", ");
|
|
7384
|
-
return /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(DynamicOverflowTooltip, { tooltipDescription: valuesString, children: valuesString });
|
|
7385
|
-
},
|
|
7386
|
-
children: isLoading ? /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(
|
|
7387
|
-
import_material62.Box,
|
|
7409
|
+
return /* @__PURE__ */ (0, import_jsx_runtime115.jsxs)(
|
|
7410
|
+
import_material62.FormControl,
|
|
7411
|
+
{
|
|
7412
|
+
fullWidth: true,
|
|
7413
|
+
variant,
|
|
7414
|
+
size,
|
|
7415
|
+
disabled,
|
|
7416
|
+
error,
|
|
7417
|
+
children: [
|
|
7418
|
+
/* @__PURE__ */ (0, import_jsx_runtime115.jsx)(import_material62.InputLabel, { children: inputLabel }),
|
|
7419
|
+
/* @__PURE__ */ (0, import_jsx_runtime115.jsx)(
|
|
7420
|
+
import_material62.Select,
|
|
7388
7421
|
{
|
|
7389
|
-
|
|
7390
|
-
|
|
7391
|
-
|
|
7392
|
-
|
|
7422
|
+
multiple: true,
|
|
7423
|
+
label: inputLabel,
|
|
7424
|
+
error,
|
|
7425
|
+
value: values ?? localValues,
|
|
7426
|
+
defaultValue: defaultValues,
|
|
7427
|
+
MenuProps: menuProps,
|
|
7428
|
+
onOpen,
|
|
7429
|
+
onClose: () => onClose?.(localValues),
|
|
7430
|
+
renderValue: (selectedValues) => {
|
|
7431
|
+
const valuesString = selectedValues.map((v) => v.label)?.join(", ");
|
|
7432
|
+
return /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(DynamicOverflowTooltip, { tooltipDescription: valuesString, children: valuesString });
|
|
7393
7433
|
},
|
|
7394
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(
|
|
7434
|
+
children: isLoading ? /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(
|
|
7435
|
+
import_material62.Box,
|
|
7436
|
+
{
|
|
7437
|
+
sx: {
|
|
7438
|
+
display: "flex",
|
|
7439
|
+
justifyContent: "center",
|
|
7440
|
+
alignItems: "center"
|
|
7441
|
+
},
|
|
7442
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(import_material62.CircularProgress, { size: 24 })
|
|
7443
|
+
}
|
|
7444
|
+
) : renderMenuContent()
|
|
7395
7445
|
}
|
|
7396
|
-
)
|
|
7397
|
-
|
|
7398
|
-
|
|
7399
|
-
|
|
7400
|
-
|
|
7446
|
+
),
|
|
7447
|
+
helperText && /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(import_material62.FormHelperText, { children: helperText })
|
|
7448
|
+
]
|
|
7449
|
+
}
|
|
7450
|
+
);
|
|
7401
7451
|
};
|
|
7402
7452
|
|
|
7403
7453
|
// src/components/SmartSelect/SmartSelect.tsx
|
|
@@ -8190,7 +8240,7 @@ var TableDesktopRows = ({
|
|
|
8190
8240
|
data,
|
|
8191
8241
|
RenderItem,
|
|
8192
8242
|
visibleHeadCells,
|
|
8193
|
-
|
|
8243
|
+
getRowId,
|
|
8194
8244
|
order,
|
|
8195
8245
|
orderBy,
|
|
8196
8246
|
disableInternalSort,
|
|
@@ -8203,7 +8253,8 @@ var TableDesktopRows = ({
|
|
|
8203
8253
|
}) => {
|
|
8204
8254
|
const sortedData = disableInternalSort ? data : stableSort2(data, getComparator(order, orderBy));
|
|
8205
8255
|
return sortedData.map((row, index) => {
|
|
8206
|
-
const
|
|
8256
|
+
const rowId = getRowId(row);
|
|
8257
|
+
const isItemSelected = selectedRows.has(rowId);
|
|
8207
8258
|
return /* @__PURE__ */ (0, import_jsx_runtime126.jsx)(
|
|
8208
8259
|
RenderItem,
|
|
8209
8260
|
{
|
|
@@ -8215,12 +8266,12 @@ var TableDesktopRows = ({
|
|
|
8215
8266
|
enableEditMode,
|
|
8216
8267
|
enableCheckboxSelection,
|
|
8217
8268
|
rowHeight,
|
|
8218
|
-
rowId
|
|
8269
|
+
rowId,
|
|
8219
8270
|
onRowCheckboxChange,
|
|
8220
8271
|
visibleHeadCells
|
|
8221
8272
|
}
|
|
8222
8273
|
},
|
|
8223
|
-
|
|
8274
|
+
rowId ?? index
|
|
8224
8275
|
);
|
|
8225
8276
|
});
|
|
8226
8277
|
};
|
|
@@ -8321,6 +8372,12 @@ var TableEmptyResult_default = TableEmptyResult;
|
|
|
8321
8372
|
|
|
8322
8373
|
// src/components/TableDesktop/TableDesktop.tsx
|
|
8323
8374
|
var import_jsx_runtime129 = require("react/jsx-runtime");
|
|
8375
|
+
var resolveKeyValue = (keyField, rowData) => {
|
|
8376
|
+
if (typeof keyField === "string") {
|
|
8377
|
+
return rowData[keyField];
|
|
8378
|
+
}
|
|
8379
|
+
return keyField?.(rowData);
|
|
8380
|
+
};
|
|
8324
8381
|
var TableDesktop = ({
|
|
8325
8382
|
data = [],
|
|
8326
8383
|
headCells,
|
|
@@ -8353,14 +8410,14 @@ var TableDesktop = ({
|
|
|
8353
8410
|
const [orderBy, setOrderBy] = (0, import_react41.useState)(
|
|
8354
8411
|
appliedFilters?.sortField || "delivery_date"
|
|
8355
8412
|
);
|
|
8356
|
-
const [selectedRows, setSelectedRows] = (0, import_react41.useState)(
|
|
8357
|
-
/* @__PURE__ */ new Set()
|
|
8358
|
-
);
|
|
8413
|
+
const [selectedRows, setSelectedRows] = (0, import_react41.useState)(/* @__PURE__ */ new Set());
|
|
8359
8414
|
const [isRowsFromAllPagesSelected, setIsRowsFromAllPagesSelected] = (0, import_react41.useState)(false);
|
|
8360
8415
|
const [isBulkChangesMode, setIsBulkChangesMode] = (0, import_react41.useState)(false);
|
|
8361
8416
|
const numRows = data.length;
|
|
8362
8417
|
const numSelectedRows = (0, import_react41.useMemo)(() => {
|
|
8363
|
-
const currentPageIds = new Set(
|
|
8418
|
+
const currentPageIds = new Set(
|
|
8419
|
+
data.map((row) => resolveKeyValue(keyField, row))
|
|
8420
|
+
);
|
|
8364
8421
|
return [...selectedRows].filter((id) => currentPageIds.has(id)).length;
|
|
8365
8422
|
}, [data, selectedRows, keyField]);
|
|
8366
8423
|
const isEveryRowInPageSelected = numRows > 0 && numSelectedRows === numRows;
|
|
@@ -8381,7 +8438,9 @@ var TableDesktop = ({
|
|
|
8381
8438
|
}
|
|
8382
8439
|
};
|
|
8383
8440
|
const selectAllRowsInPage = () => {
|
|
8384
|
-
const allRowsIds = new Set(
|
|
8441
|
+
const allRowsIds = new Set(
|
|
8442
|
+
data.map((row) => resolveKeyValue(keyField, row))
|
|
8443
|
+
);
|
|
8385
8444
|
setSelectedRows(allRowsIds);
|
|
8386
8445
|
};
|
|
8387
8446
|
const resetSelectedRows = () => {
|
|
@@ -8425,12 +8484,12 @@ var TableDesktop = ({
|
|
|
8425
8484
|
setIsBulkChangesMode(checked);
|
|
8426
8485
|
if (!checked) {
|
|
8427
8486
|
resetSelectedRows();
|
|
8487
|
+
refetchData?.();
|
|
8428
8488
|
}
|
|
8429
8489
|
};
|
|
8430
8490
|
(0, import_react41.useEffect)(() => {
|
|
8431
8491
|
if (isRowsFromAllPagesSelected) {
|
|
8432
8492
|
selectAllRowsInPage();
|
|
8433
|
-
selectAllRowsInPage();
|
|
8434
8493
|
}
|
|
8435
8494
|
}, [isRowsFromAllPagesSelected, data]);
|
|
8436
8495
|
const renderBody = () => {
|
|
@@ -8460,7 +8519,7 @@ var TableDesktop = ({
|
|
|
8460
8519
|
data,
|
|
8461
8520
|
RenderItem,
|
|
8462
8521
|
visibleHeadCells,
|
|
8463
|
-
keyField,
|
|
8522
|
+
getRowId: (rowData) => resolveKeyValue(keyField, rowData),
|
|
8464
8523
|
order,
|
|
8465
8524
|
orderBy,
|
|
8466
8525
|
disableInternalSort,
|
|
@@ -8603,7 +8662,7 @@ var TableDesktopSmartMultipleSelect = ({
|
|
|
8603
8662
|
onUpdateEditableCell
|
|
8604
8663
|
}) => {
|
|
8605
8664
|
const defaultValues = (0, import_react42.useMemo)(() => {
|
|
8606
|
-
return initialValue
|
|
8665
|
+
return initialValue?.map((val) => ({
|
|
8607
8666
|
value: val.id,
|
|
8608
8667
|
label: val[fieldName].toString()
|
|
8609
8668
|
}));
|
|
@@ -8626,11 +8685,12 @@ var TableDesktopSmartMultipleSelect = ({
|
|
|
8626
8685
|
},
|
|
8627
8686
|
onClose: (values) => {
|
|
8628
8687
|
const optionsValues = values.map((option) => option.value ?? "");
|
|
8688
|
+
const optionsLabels = values.map((option) => option.label ?? "");
|
|
8629
8689
|
onUpdateEditableCell?.({
|
|
8630
8690
|
rowId,
|
|
8631
8691
|
columnId,
|
|
8632
8692
|
value: optionsValues,
|
|
8633
|
-
label:
|
|
8693
|
+
label: optionsLabels
|
|
8634
8694
|
});
|
|
8635
8695
|
}
|
|
8636
8696
|
}
|
|
@@ -8889,10 +8949,9 @@ var TableDesktopEditableField = ({
|
|
|
8889
8949
|
date: /* @__PURE__ */ (0, import_jsx_runtime133.jsx)(
|
|
8890
8950
|
import_x_date_pickers.DatePicker,
|
|
8891
8951
|
{
|
|
8892
|
-
defaultValue: (0, import_moment3.default)(editInitialValue),
|
|
8952
|
+
defaultValue: editInitialValue ? (0, import_moment3.default)(editInitialValue, "HH:mm:ss") : void 0,
|
|
8893
8953
|
label: inputLabel,
|
|
8894
8954
|
format: "DD/MM/YYYY",
|
|
8895
|
-
sx: { overflowY: "hidden" },
|
|
8896
8955
|
onAccept: (value) => {
|
|
8897
8956
|
const formattedValue = value?.format("YYYY-MM-DD") ?? null;
|
|
8898
8957
|
const formattedLabel = value?.format("DD/MM/YYYY") ?? null;
|
|
@@ -8909,7 +8968,8 @@ var TableDesktopEditableField = ({
|
|
|
8909
8968
|
clearButton: { sx: { p: 0.5 } },
|
|
8910
8969
|
openPickerButton: { sx: { p: 0 } },
|
|
8911
8970
|
textField: {
|
|
8912
|
-
variant
|
|
8971
|
+
variant,
|
|
8972
|
+
size,
|
|
8913
8973
|
error: false
|
|
8914
8974
|
}
|
|
8915
8975
|
}
|
|
@@ -8918,9 +8978,8 @@ var TableDesktopEditableField = ({
|
|
|
8918
8978
|
time: /* @__PURE__ */ (0, import_jsx_runtime133.jsx)(
|
|
8919
8979
|
import_x_date_pickers.TimePicker,
|
|
8920
8980
|
{
|
|
8921
|
-
defaultValue: (0, import_moment3.default)(editInitialValue, "HH:mm:ss"),
|
|
8981
|
+
defaultValue: editInitialValue ? (0, import_moment3.default)(editInitialValue, "HH:mm:ss") : void 0,
|
|
8922
8982
|
label: inputLabel,
|
|
8923
|
-
sx: { overflowY: "hidden" },
|
|
8924
8983
|
onAccept: (value) => {
|
|
8925
8984
|
const formattedValue = value?.format("HH:mm") ?? null;
|
|
8926
8985
|
onUpdateEditableCell?.({
|
|
@@ -8936,7 +8995,8 @@ var TableDesktopEditableField = ({
|
|
|
8936
8995
|
clearButton: { sx: { p: 0.5 } },
|
|
8937
8996
|
openPickerButton: { sx: { p: 0 } },
|
|
8938
8997
|
textField: {
|
|
8939
|
-
variant
|
|
8998
|
+
variant,
|
|
8999
|
+
size,
|
|
8940
9000
|
error: false
|
|
8941
9001
|
}
|
|
8942
9002
|
}
|
|
@@ -9148,6 +9208,7 @@ var TableDesktopToolbar = ({
|
|
|
9148
9208
|
disableBulkChangesMode = false,
|
|
9149
9209
|
isBulkChangesMode,
|
|
9150
9210
|
onChangeBulkChangesMode,
|
|
9211
|
+
onActivateBulkChangesMode,
|
|
9151
9212
|
refetchData,
|
|
9152
9213
|
renderExportCsvDialog,
|
|
9153
9214
|
renderBulkChangesDialog,
|
|
@@ -9172,8 +9233,8 @@ var TableDesktopToolbar = ({
|
|
|
9172
9233
|
const handleChangeBulkChangesMode = (_, checked) => {
|
|
9173
9234
|
setBulkChanges([]);
|
|
9174
9235
|
onChangeBulkChangesMode(checked);
|
|
9175
|
-
if (
|
|
9176
|
-
|
|
9236
|
+
if (checked) {
|
|
9237
|
+
onActivateBulkChangesMode?.();
|
|
9177
9238
|
}
|
|
9178
9239
|
};
|
|
9179
9240
|
const handleUpdateEditableCell = ({
|
|
@@ -9329,7 +9390,7 @@ var TableDesktopToolbar = ({
|
|
|
9329
9390
|
)
|
|
9330
9391
|
] }) : /* @__PURE__ */ (0, import_jsx_runtime136.jsxs)(import_material79.Box, { sx: { display: "flex", alignItems: "center", gap: 1 }, children: [
|
|
9331
9392
|
renderInfoIcons,
|
|
9332
|
-
renderExportCsvDialog ? /* @__PURE__ */ (0, import_jsx_runtime136.jsx)(import_material79.Tooltip, { title: "Download
|
|
9393
|
+
renderExportCsvDialog ? /* @__PURE__ */ (0, import_jsx_runtime136.jsx)(import_material79.Tooltip, { title: "Download List", children: /* @__PURE__ */ (0, import_jsx_runtime136.jsx)("span", { style: { display: "flex", alignItems: "center" }, children: /* @__PURE__ */ (0, import_jsx_runtime136.jsx)(
|
|
9333
9394
|
import_material79.IconButton,
|
|
9334
9395
|
{
|
|
9335
9396
|
disableRipple: true,
|
|
@@ -9380,7 +9441,7 @@ var TableDesktopToolbar = ({
|
|
|
9380
9441
|
|
|
9381
9442
|
// src/components/TableHeader/TableHeader.tsx
|
|
9382
9443
|
var import_react48 = require("react");
|
|
9383
|
-
var
|
|
9444
|
+
var import_icons_material11 = require("@mui/icons-material");
|
|
9384
9445
|
var import_material80 = require("@mui/material");
|
|
9385
9446
|
var import_mui53 = require("tss-react/mui");
|
|
9386
9447
|
var import_jsx_runtime137 = require("react/jsx-runtime");
|
|
@@ -9433,7 +9494,7 @@ var TableHeader = ({ cells, onSort = null }) => {
|
|
|
9433
9494
|
{
|
|
9434
9495
|
className: classes.sortLabel,
|
|
9435
9496
|
direction: cell?.direction || "asc",
|
|
9436
|
-
IconComponent:
|
|
9497
|
+
IconComponent: import_icons_material11.ImportExport,
|
|
9437
9498
|
onClick: () => handleSortClick(cell),
|
|
9438
9499
|
children: cell.label
|
|
9439
9500
|
}
|