@wavemaker-ai/react-runtime 1.0.0-rc.322 → 1.0.0-rc.326
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/actions/login-action.js +1 -1
- package/components/advanced/carousel/index.d.ts +1 -0
- package/components/advanced/carousel/template.d.ts +1 -0
- package/components/advanced/login/index.d.ts +1 -0
- package/components/advanced/marquee/index.d.ts +1 -0
- package/components/basic/anchor/index.d.ts +1 -0
- package/components/basic/anchor/index.js +19 -14
- package/components/basic/audio/index.d.ts +1 -0
- package/components/basic/html/index.d.ts +1 -0
- package/components/basic/icon/index.d.ts +1 -0
- package/components/basic/icon/index.js +13 -16
- package/components/basic/iframe/index.d.ts +1 -0
- package/components/basic/label/index.d.ts +1 -0
- package/components/basic/label/index.js +5 -3
- package/components/basic/label/props.d.ts +1 -1
- package/components/basic/picture/index.d.ts +1 -0
- package/components/basic/picture/index.js +3 -2
- package/components/basic/progress-bar/index.d.ts +1 -0
- package/components/basic/progress-circle/index.d.ts +1 -0
- package/components/basic/richtexteditor/index.d.ts +2 -0
- package/components/basic/search/index.d.ts +6 -0
- package/components/basic/search/index.js +69 -9
- package/components/basic/search/props.d.ts +4 -0
- package/components/basic/spinner/index.d.ts +2 -0
- package/components/basic/spinner/index.js +11 -9
- package/components/basic/spinner/props.d.ts +5 -0
- package/components/basic/tile/index.d.ts +1 -0
- package/components/basic/tree/index.d.ts +1 -0
- package/components/basic/video/index.d.ts +1 -0
- package/components/chart/index.d.ts +2 -0
- package/components/chart/props.d.ts +1 -0
- package/components/chart/src/chart.js +12 -1
- package/components/chart/src/types.d.ts +2 -0
- package/components/common/WmAppIcon/index.d.ts +15 -0
- package/components/common/WmAppIcon/index.js +130 -0
- package/components/common/WmAppIcon/props.d.ts +17 -0
- package/components/common/WmAppIcon/props.js +0 -0
- package/components/common/index.d.ts +3 -1
- package/components/common/index.js +10 -2
- package/components/common/wm-skeleton.d.ts +7 -0
- package/components/common/wm-skeleton.js +11 -1
- package/components/container/accordion/accordion-pane/index.d.ts +2 -0
- package/components/container/accordion/accordion-pane/index.js +10 -1
- package/components/container/accordion/accordion-pane/props.d.ts +1 -0
- package/components/container/accordion/index.d.ts +1 -0
- package/components/container/accordion/index.js +2 -2
- package/components/container/index.d.ts +1 -0
- package/components/container/index.js +6 -1
- package/components/container/layout-grid/grid-column/index.d.ts +1 -0
- package/components/container/layout-grid/grid-row/index.d.ts +1 -0
- package/components/container/layout-grid/grid-row/index.js +1 -1
- package/components/container/layout-grid/index.d.ts +1 -0
- package/components/container/linear-layout/index.d.ts +1 -0
- package/components/container/linear-layout/linear-layout-item/index.d.ts +1 -0
- package/components/container/panel/components/panel-header/index.js +16 -16
- package/components/container/panel/index.d.ts +1 -0
- package/components/container/repeat-template/index.d.ts +1 -0
- package/components/container/tabs/index.d.ts +1 -0
- package/components/container/tabs/index.js +18 -18
- package/components/container/tabs/props.d.ts +1 -0
- package/components/container/tabs/tab-pane/index.d.ts +2 -0
- package/components/container/tabs/tab-pane/index.js +2 -0
- package/components/container/tabs/tab-pane/props.d.ts +1 -0
- package/components/container/wizard/components/StepComponents.js +14 -6
- package/components/container/wizard/index.d.ts +2 -0
- package/components/container/wizard/index.js +2 -2
- package/components/container/wizard/props.d.ts +4 -0
- package/components/container/wizard/wizard-step/index.d.ts +1 -0
- package/components/container/wizard/wizard-step/index.js +6 -0
- package/components/data/card/card-actions/index.d.ts +1 -0
- package/components/data/card/card-content/index.d.ts +1 -0
- package/components/data/card/card-footer/index.d.ts +1 -0
- package/components/data/card/index.d.ts +1 -0
- package/components/data/card/index.js +13 -6
- package/components/data/form/base-form/hooks/useFormSubmission.d.ts +1 -1
- package/components/data/form/base-form/hooks/useFormSubmission.js +3 -1
- package/components/data/form/base-form/index.js +11 -14
- package/components/data/form/base-form/props.d.ts +3 -0
- package/components/data/form/dynamic-fields/index.js +1 -0
- package/components/data/form/form-action/index.d.ts +2 -0
- package/components/data/form/form-action/index.js +6 -4
- package/components/data/form/form-controller/withFormController.js +19 -2
- package/components/data/form/form-field/base-field.js +8 -5
- package/components/data/form/form-field/index.js +14 -9
- package/components/data/form/form-field/props.d.ts +1 -0
- package/components/data/form/form-header/index.d.ts +1 -1
- package/components/data/form/form-header/index.js +10 -1
- package/components/data/form/index.js +5 -3
- package/components/data/form/props.d.ts +1 -0
- package/components/data/list/components/ListHeader.js +19 -3
- package/components/data/list/components/ListItemWithTemplate.js +10 -3
- package/components/data/list/components/ListItems.d.ts +1 -1
- package/components/data/list/components/ListItems.js +5 -1
- package/components/data/list/components/LoadMoreButton.js +14 -2
- package/components/data/list/components/StandardListItems.js +1 -1
- package/components/data/list/components/props.d.ts +11 -5
- package/components/data/list/hooks/props.d.ts +2 -2
- package/components/data/list/hooks/useListEffects.js +1 -1
- package/components/data/list/hooks/useListEventHandlers.js +3 -2
- package/components/data/list/index.d.ts +5 -1
- package/components/data/list/index.js +28 -7
- package/components/data/list/props.d.ts +14 -2
- package/components/data/list/utils/constants.d.ts +0 -1
- package/components/data/list/utils/constants.js +0 -2
- package/components/data/list/utils/list-helpers.d.ts +5 -1
- package/components/data/list/utils/list-helpers.js +10 -0
- package/components/data/pagination/components/PageSizeSelector.js +49 -155
- package/components/data/pagination/hooks/usePagination.js +24 -1
- package/components/data/table/components/RowCells.js +18 -4
- package/components/data/table/components/TableBody.js +5 -3
- package/components/data/table/components/TableDataRow.js +16 -3
- package/components/data/table/components/TableHeader.js +10 -8
- package/components/data/table/components/TablePanelHeading.js +15 -3
- package/components/data/table/hooks/useDynamicColumns.js +1 -1
- package/components/data/table/hooks/useResponsiveColumns.d.ts +1 -0
- package/components/data/table/hooks/useRowExpansion.js +41 -31
- package/components/data/table/hooks/useRowHandlers.js +0 -1
- package/components/data/table/hooks/useServerSideSorting.js +0 -1
- package/components/data/table/hooks/useTableColumns.js +17 -9
- package/components/data/table/hooks/useTableData.js +30 -2
- package/components/data/table/hooks/useTableEdit.js +0 -1
- package/components/data/table/index.d.ts +4 -0
- package/components/data/table/index.js +93 -47
- package/components/data/table/live-table/index.d.ts +1 -0
- package/components/data/table/live-table/index.js +0 -1
- package/components/data/table/props.d.ts +15 -2
- package/components/data/table/table-action/index.d.ts +1 -0
- package/components/data/table/table-column/index.d.ts +1 -0
- package/components/data/table/table-row/index.d.ts +1 -0
- package/components/data/table/table-row-action/index.d.ts +1 -0
- package/components/data/table/utils/buildSelectionColumns.d.ts +1 -1
- package/components/data/table/utils/buildSelectionColumns.js +95 -71
- package/components/data/table/utils/columnBuilder.d.ts +29 -2
- package/components/data/table/utils/columnBuilder.js +40 -26
- package/components/data/table/utils/columnWidthDistribution.d.ts +1 -1
- package/components/data/table/utils/columnWidthDistribution.js +14 -1
- package/components/data/table/utils/constants.d.ts +0 -4
- package/components/data/table/utils/constants.js +0 -7
- package/components/data/table/utils/dynamic-columns.d.ts +1 -1
- package/components/data/table/utils/dynamic-columns.js +3 -8
- package/components/data/table/utils/expansionColumn.d.ts +23 -0
- package/components/data/table/utils/expansionColumn.js +56 -0
- package/components/data/table/utils/index.d.ts +14 -2
- package/components/data/table/utils/index.js +45 -19
- package/components/dialogs/alert-dialog/index.d.ts +2 -0
- package/components/dialogs/confirm-dialog/index.d.ts +2 -0
- package/components/dialogs/dialog/index.d.ts +2 -0
- package/components/dialogs/dialog/index.js +3 -2
- package/components/dialogs/dialog-actions/index.d.ts +1 -0
- package/components/dialogs/dialog-body/index.d.ts +1 -0
- package/components/dialogs/dialog-content/index.d.ts +1 -0
- package/components/dialogs/dialog-header/index.d.ts +1 -0
- package/components/dialogs/dialog-header/index.js +11 -12
- package/components/dialogs/iframe-dialog/index.d.ts +2 -0
- package/components/dialogs/login-dialog/index.d.ts +4 -0
- package/components/dialogs/login-dialog/index.js +2 -1
- package/components/dialogs/login-dialog/props.d.ts +1 -0
- package/components/dialogs/page-dialog/index.d.ts +4 -0
- package/components/dialogs/page-dialog/index.js +2 -1
- package/components/dialogs/page-dialog/props.d.ts +1 -0
- package/components/form/button/index.d.ts +1 -0
- package/components/form/button/index.js +29 -33
- package/components/form/button-group/index.d.ts +1 -0
- package/components/input/calendar/index.d.ts +2 -0
- package/components/input/chips/index.d.ts +2 -0
- package/components/input/chips/index.js +9 -3
- package/components/input/chips/utils.d.ts +5 -0
- package/components/input/chips/utils.js +29 -0
- package/components/input/color-picker/index.d.ts +2 -0
- package/components/input/composite/index.d.ts +1 -0
- package/components/input/composite/index.js +1 -0
- package/components/input/currency/index.d.ts +2 -0
- package/components/input/default/checkbox/index.d.ts +6 -0
- package/components/input/default/checkbox/index.js +48 -18
- package/components/input/default/checkbox/props.d.ts +8 -0
- package/components/input/default/checkboxset/index.d.ts +2 -0
- package/components/input/default/radioset/index.d.ts +2 -0
- package/components/input/default/radioset/index.js +2 -1
- package/components/input/default/switch/index.d.ts +6 -0
- package/components/input/default/switch/index.js +36 -9
- package/components/input/default/switch/prop.d.ts +2 -0
- package/components/input/epoch/date/index.d.ts +1 -0
- package/components/input/epoch/datetime/index.d.ts +1 -0
- package/components/input/epoch/time/index.d.ts +1 -0
- package/components/input/fileupload/components/ListItems.d.ts +5 -1
- package/components/input/fileupload/components/ListItems.js +27 -5
- package/components/input/fileupload/components/MultiUpload.js +12 -1
- package/components/input/fileupload/components/SingleUpload.js +12 -1
- package/components/input/fileupload/index.d.ts +3 -0
- package/components/input/fileupload/index.js +11 -0
- package/components/input/fileupload/props.d.ts +10 -0
- package/components/input/number/index.d.ts +2 -0
- package/components/input/rating/index.d.ts +6 -0
- package/components/input/rating/index.js +10 -5
- package/components/input/rating/props.d.ts +8 -0
- package/components/input/select/index.d.ts +2 -0
- package/components/input/select/index.js +1 -2
- package/components/input/slider/index.d.ts +6 -0
- package/components/input/slider/index.js +19 -2
- package/components/input/slider/props.d.ts +2 -0
- package/components/input/text/index.d.ts +7 -1
- package/components/input/text/index.js +25 -6
- package/components/input/text/props.d.ts +8 -0
- package/components/input/textarea/index.d.ts +2 -0
- package/components/input/textarea/index.js +10 -5
- package/components/input/textarea/util.d.ts +1 -0
- package/components/input/textarea/util.js +17 -0
- package/components/input/upload/index.d.ts +2 -0
- package/components/navbar/index.d.ts +7 -0
- package/components/navbar/index.js +21 -7
- package/components/navbar/nav/index.d.ts +1 -0
- package/components/navbar/nav-item/index.d.ts +1 -0
- package/components/navigation/breadcrumb/index.d.ts +1 -0
- package/components/navigation/menu/index.d.ts +3 -1
- package/components/navigation/menu/index.js +22 -4
- package/components/navigation/menu/props.d.ts +1 -0
- package/components/navigation/popover/index.d.ts +1 -0
- package/components/navigation/popover/index.js +23 -9
- package/components/page/index.js +1 -1
- package/components/page/page-content/index.js +6 -2
- package/components/page/partial/index.d.ts +1 -0
- package/components/page/partial-container/index.js +2 -1
- package/components/prefab/index.js +3 -2
- package/components/prefab/props.d.ts +1 -0
- package/context/WidgetProvider.js +2 -1
- package/core/appstore.d.ts +10 -0
- package/core/appstore.js +9 -1
- package/core/constants/events.d.ts +3 -0
- package/core/constants/events.js +13 -1
- package/core/proxy-service.d.ts +1 -0
- package/core/proxy-service.js +54 -3
- package/core/util/index.d.ts +2 -0
- package/core/util/index.js +32 -1
- package/higherOrder/BasePage.js +106 -30
- package/higherOrder/props.d.ts +1 -0
- package/higherOrder/useActivePageReactivity.d.ts +21 -0
- package/higherOrder/useActivePageReactivity.js +57 -0
- package/higherOrder/withBaseWrapper.js +11 -7
- package/higherOrder/withRenderLogger.d.ts +15 -0
- package/higherOrder/withRenderLogger.js +53 -0
- package/hooks/useAuth.js +7 -1
- package/package-lock.json +273 -263
- package/package.json +4 -3
- package/runtime-dynamic/components/partial-content.js +3 -1
- package/runtime-dynamic/factories/dynamic-component.js +44 -8
- package/runtime-dynamic/factories/utils.js +7 -1
- package/runtime-dynamic/services/compile-render.js +2 -1
- package/runtime-dynamic/services/css-scoping.d.ts +2 -0
- package/runtime-dynamic/services/css-scoping.js +39 -20
- package/store/slices/i18nSlice.d.ts +2 -0
- package/store/slices/i18nSlice.js +3 -1
- package/types/index.d.ts +6 -0
- package/utils/attr.js +4 -1
- package/utils/custom-expression/parser.js +11 -8
- package/utils/svg-icon.d.ts +27 -0
- package/utils/svg-icon.js +75 -0
- package/utils/transformedDataset-utils.d.ts +3 -3
- package/utils/transformedDataset-utils.js +1 -2
|
@@ -42,6 +42,15 @@ function hasListGroupAutoLayoutClass(layoutProps) {
|
|
|
42
42
|
const extra_LayoutAttrs = [wrap, alignment, gap, columngap];
|
|
43
43
|
return extra_LayoutAttrs.some((v) => v !== void 0 && v !== null);
|
|
44
44
|
}
|
|
45
|
+
const resolveDisableItem = (disableitem, item, index) => {
|
|
46
|
+
if (!disableitem) {
|
|
47
|
+
return false;
|
|
48
|
+
}
|
|
49
|
+
if (typeof disableitem === "function") {
|
|
50
|
+
return !!disableitem(item, index);
|
|
51
|
+
}
|
|
52
|
+
return disableitem;
|
|
53
|
+
};
|
|
45
54
|
const flattenIfArrayOfArrays = (arr) => {
|
|
46
55
|
if (arr.length === 0) return arr;
|
|
47
56
|
const first = arr[0];
|
|
@@ -139,5 +148,6 @@ export {
|
|
|
139
148
|
getSelectedItemWidgets,
|
|
140
149
|
getTextAlignClass,
|
|
141
150
|
hasListGroupAutoLayoutClass,
|
|
151
|
+
resolveDisableItem,
|
|
142
152
|
saveListState
|
|
143
153
|
};
|
|
@@ -1,12 +1,10 @@
|
|
|
1
|
-
import { jsx
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useMemo, memo } from "react";
|
|
3
|
-
import
|
|
4
|
-
import Typography from "@mui/material/Typography";
|
|
5
|
-
import Select from "@mui/material/Select";
|
|
6
|
-
import MenuItem from "@mui/material/MenuItem";
|
|
7
|
-
import FormControl from "@mui/material/FormControl";
|
|
3
|
+
import TablePagination from "@mui/material/TablePagination";
|
|
8
4
|
import { APP_LOCALE } from "../../list/utils/constants";
|
|
9
5
|
import { useAppSelector } from "../../../../store";
|
|
6
|
+
const EmptyPaginationActions = () => null;
|
|
7
|
+
EmptyPaginationActions.displayName = "EmptyPaginationActions";
|
|
10
8
|
const PageSizeSelectorComponent = ({
|
|
11
9
|
pagesizeoptions = "5,10,20,50,100",
|
|
12
10
|
maxResults = 10,
|
|
@@ -25,164 +23,60 @@ const PageSizeSelectorComponent = ({
|
|
|
25
23
|
}
|
|
26
24
|
return parsedOptions;
|
|
27
25
|
}, [pagesizeoptions, paginationMeta == null ? void 0 : paginationMeta.size]);
|
|
28
|
-
const effectiveMaxResults =
|
|
29
|
-
|
|
30
|
-
}, [paginationMeta == null ? void 0 : paginationMeta.size, maxResults]);
|
|
31
|
-
const rowSummary = useMemo(() => {
|
|
32
|
-
if (!dataSize) {
|
|
33
|
-
return null;
|
|
34
|
-
}
|
|
35
|
-
const startIndex = Math.min((currentPage - 1) * effectiveMaxResults + 1, dataSize);
|
|
36
|
-
const endIndex = Math.min(currentPage * effectiveMaxResults, dataSize);
|
|
37
|
-
return {
|
|
38
|
-
startIndex,
|
|
39
|
-
endIndex,
|
|
40
|
-
totalRecords: dataSize
|
|
41
|
-
};
|
|
42
|
-
}, [currentPage, effectiveMaxResults, dataSize]);
|
|
43
|
-
const handleChange = (event) => {
|
|
26
|
+
const effectiveMaxResults = (paginationMeta == null ? void 0 : paginationMeta.size) || maxResults;
|
|
27
|
+
const handleRowsPerPageChange = (event) => {
|
|
44
28
|
const newValue = Number(event.target.value);
|
|
45
29
|
if (onPageSizeChange) {
|
|
46
30
|
onPageSizeChange(event, newValue);
|
|
47
31
|
}
|
|
48
32
|
};
|
|
49
|
-
return /* @__PURE__ */
|
|
50
|
-
|
|
33
|
+
return /* @__PURE__ */ jsx(
|
|
34
|
+
TablePagination,
|
|
51
35
|
{
|
|
52
|
-
|
|
53
|
-
display: "flex",
|
|
54
|
-
flexWrap: "wrap",
|
|
55
|
-
alignItems: "center",
|
|
56
|
-
gap: 2
|
|
57
|
-
},
|
|
36
|
+
component: "div",
|
|
58
37
|
className: "pagination page-size-selector",
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
size: "small",
|
|
89
|
-
sx: {
|
|
90
|
-
minWidth: 70,
|
|
91
|
-
"& .MuiInputBase-root": {
|
|
92
|
-
height: "auto"
|
|
93
|
-
}
|
|
94
|
-
},
|
|
95
|
-
children: /* @__PURE__ */ jsx(
|
|
96
|
-
Select,
|
|
97
|
-
{
|
|
98
|
-
id: "page-size-select",
|
|
99
|
-
value: effectiveMaxResults,
|
|
100
|
-
onChange: handleChange,
|
|
101
|
-
sx: {
|
|
102
|
-
fontSize: "14px",
|
|
103
|
-
minHeight: "auto",
|
|
104
|
-
"& .MuiSelect-select": {
|
|
105
|
-
paddingTop: "6px",
|
|
106
|
-
paddingBottom: "6px",
|
|
107
|
-
paddingLeft: "10px",
|
|
108
|
-
paddingRight: "32px",
|
|
109
|
-
// Space for dropdown arrow
|
|
110
|
-
minHeight: "auto"
|
|
111
|
-
},
|
|
112
|
-
"& .MuiOutlinedInput-notchedOutline": {
|
|
113
|
-
borderColor: "rgba(0, 0, 0, 0.23)"
|
|
114
|
-
}
|
|
115
|
-
},
|
|
116
|
-
MenuProps: {
|
|
117
|
-
PaperProps: {
|
|
118
|
-
sx: {
|
|
119
|
-
maxHeight: 300,
|
|
120
|
-
"& .MuiMenuItem-root": {
|
|
121
|
-
fontSize: "14px",
|
|
122
|
-
padding: "6px 16px",
|
|
123
|
-
// Override any global padding
|
|
124
|
-
margin: 0
|
|
125
|
-
// Override any global margin
|
|
126
|
-
},
|
|
127
|
-
"& .MuiList-root": {
|
|
128
|
-
padding: "8px 0"
|
|
129
|
-
// Ensure proper list padding
|
|
130
|
-
},
|
|
131
|
-
"& li": {
|
|
132
|
-
padding: 0,
|
|
133
|
-
// Override global li padding
|
|
134
|
-
margin: 0
|
|
135
|
-
// Override global li margin
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
},
|
|
139
|
-
anchorOrigin: {
|
|
140
|
-
vertical: "bottom",
|
|
141
|
-
horizontal: "center"
|
|
142
|
-
},
|
|
143
|
-
transformOrigin: {
|
|
144
|
-
vertical: "top",
|
|
145
|
-
horizontal: "center"
|
|
146
|
-
}
|
|
147
|
-
},
|
|
148
|
-
children: options.map((option) => /* @__PURE__ */ jsx(MenuItem, { value: option, children: option }, option))
|
|
149
|
-
}
|
|
150
|
-
)
|
|
151
|
-
}
|
|
152
|
-
)
|
|
153
|
-
]
|
|
154
|
-
}
|
|
155
|
-
),
|
|
156
|
-
rowSummary && /* @__PURE__ */ jsx(
|
|
157
|
-
Box,
|
|
158
|
-
{
|
|
159
|
-
sx: {
|
|
160
|
-
display: "flex",
|
|
161
|
-
alignItems: "center",
|
|
162
|
-
gap: 0.5
|
|
163
|
-
},
|
|
164
|
-
className: "item-range",
|
|
165
|
-
children: /* @__PURE__ */ jsxs(
|
|
166
|
-
Typography,
|
|
167
|
-
{
|
|
168
|
-
sx: {
|
|
169
|
-
fontSize: "14px",
|
|
170
|
-
color: "text.primary"
|
|
171
|
-
},
|
|
172
|
-
children: [
|
|
173
|
-
/* @__PURE__ */ jsxs(Box, { component: "span", children: [
|
|
174
|
-
rowSummary.startIndex,
|
|
175
|
-
" - ",
|
|
176
|
-
rowSummary.endIndex
|
|
177
|
-
] }),
|
|
178
|
-
/* @__PURE__ */ jsx(Box, { component: "span", sx: { mx: 0.5 }, children: "\xA0\xA0of\xA0\xA0" }),
|
|
179
|
-
/* @__PURE__ */ jsx(Box, { component: "span", children: rowSummary.totalRecords })
|
|
180
|
-
]
|
|
38
|
+
count: dataSize,
|
|
39
|
+
page: Math.max(0, currentPage - 1),
|
|
40
|
+
onPageChange: () => {
|
|
41
|
+
},
|
|
42
|
+
rowsPerPage: effectiveMaxResults,
|
|
43
|
+
onRowsPerPageChange: handleRowsPerPageChange,
|
|
44
|
+
rowsPerPageOptions: options,
|
|
45
|
+
labelRowsPerPage: `${itemsPerPageLabel} :`,
|
|
46
|
+
ActionsComponent: EmptyPaginationActions,
|
|
47
|
+
slotProps: {
|
|
48
|
+
toolbar: {
|
|
49
|
+
className: "items-per-page"
|
|
50
|
+
},
|
|
51
|
+
selectLabel: {
|
|
52
|
+
className: "app-label",
|
|
53
|
+
title: itemsPerPageLabel
|
|
54
|
+
},
|
|
55
|
+
select: {
|
|
56
|
+
id: "page-size-select",
|
|
57
|
+
size: "small",
|
|
58
|
+
className: "btn app-button dropdown-toggle page-size-select",
|
|
59
|
+
MenuProps: {
|
|
60
|
+
disableScrollLock: true,
|
|
61
|
+
anchorOrigin: { vertical: "top", horizontal: "left" },
|
|
62
|
+
transformOrigin: { vertical: "bottom", horizontal: "left" },
|
|
63
|
+
slotProps: {
|
|
64
|
+
paper: {
|
|
65
|
+
elevation: 0,
|
|
66
|
+
className: "dropdown-menu pagesize-options"
|
|
181
67
|
}
|
|
182
|
-
|
|
68
|
+
}
|
|
183
69
|
}
|
|
184
|
-
|
|
185
|
-
|
|
70
|
+
},
|
|
71
|
+
menuItem: {
|
|
72
|
+
className: "dropdown-item"
|
|
73
|
+
},
|
|
74
|
+
displayedRows: dataSize ? {
|
|
75
|
+
className: "item-range"
|
|
76
|
+
} : {
|
|
77
|
+
className: "page-size-no-range"
|
|
78
|
+
}
|
|
79
|
+
}
|
|
186
80
|
}
|
|
187
81
|
);
|
|
188
82
|
};
|
|
@@ -821,12 +821,35 @@ const usePagination = ({
|
|
|
821
821
|
}
|
|
822
822
|
}
|
|
823
823
|
}, [isServerSidePagination, totalItems, paginationMeta]);
|
|
824
|
+
const hasServerReportedPage = isServerSidePagination && (paginationMeta == null ? void 0 : paginationMeta.number) !== void 0 && (paginationMeta == null ? void 0 : paginationMeta.number) !== null;
|
|
824
825
|
useEffect(() => {
|
|
826
|
+
if (hasServerReportedPage) {
|
|
827
|
+
return;
|
|
828
|
+
}
|
|
825
829
|
if (initialPage !== void 0 && initialPage !== paginationState.currentPage) {
|
|
826
830
|
setPaginationState((prev) => __spreadProps(__spreadValues({}, prev), { currentPage: initialPage }));
|
|
827
831
|
disableNavigation();
|
|
828
832
|
}
|
|
829
|
-
}, [initialPage, paginationState.currentPage, disableNavigation]);
|
|
833
|
+
}, [initialPage, paginationState.currentPage, disableNavigation, hasServerReportedPage]);
|
|
834
|
+
useEffect(() => {
|
|
835
|
+
if (!isServerSidePagination) {
|
|
836
|
+
return;
|
|
837
|
+
}
|
|
838
|
+
const metaPageNumber = paginationMeta == null ? void 0 : paginationMeta.number;
|
|
839
|
+
if (metaPageNumber === void 0 || metaPageNumber === null) {
|
|
840
|
+
return;
|
|
841
|
+
}
|
|
842
|
+
const serverCurrentPage = metaPageNumber + 1;
|
|
843
|
+
if (serverCurrentPage > 0 && serverCurrentPage !== paginationState.currentPage) {
|
|
844
|
+
setPaginationState((prev) => __spreadProps(__spreadValues({}, prev), { currentPage: serverCurrentPage }));
|
|
845
|
+
disableNavigation();
|
|
846
|
+
}
|
|
847
|
+
}, [
|
|
848
|
+
isServerSidePagination,
|
|
849
|
+
paginationMeta == null ? void 0 : paginationMeta.number,
|
|
850
|
+
paginationState.currentPage,
|
|
851
|
+
disableNavigation
|
|
852
|
+
]);
|
|
830
853
|
useEffect(() => {
|
|
831
854
|
if (maxResults !== paginationState.currentMaxResults) {
|
|
832
855
|
setPaginationState((prev) => __spreadProps(__spreadValues({}, prev), { currentMaxResults: maxResults }));
|
|
@@ -33,7 +33,7 @@ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
|
33
33
|
import { memo, Fragment as Fragment2 } from "react";
|
|
34
34
|
import { TableCell } from "@mui/material";
|
|
35
35
|
import { flexRender } from "@tanstack/react-table";
|
|
36
|
-
import { getColClass, TABLE_CSS_CLASSES } from "../utils";
|
|
36
|
+
import { getColClass, TABLE_CSS_CLASSES, getDomHiddenCellStyle } from "../utils";
|
|
37
37
|
const CustomExpressionRenderBody = memo(
|
|
38
38
|
function CustomExpressionRenderBody2({ rowData, render }) {
|
|
39
39
|
return /* @__PURE__ */ jsx(Fragment, { children: render(rowData) });
|
|
@@ -71,14 +71,28 @@ const RowCells = memo(
|
|
|
71
71
|
tabIndex: 0,
|
|
72
72
|
"data-col-id": cellIndex,
|
|
73
73
|
className: `${TABLE_CSS_CLASSES.tableCell} ${colClass || ""} ${((_e = cell.column.columnDef.meta) == null ? void 0 : _e.className) || ""}`.trim(),
|
|
74
|
-
style: __spreadProps(__spreadValues({
|
|
74
|
+
style: __spreadProps(__spreadValues(__spreadValues({
|
|
75
75
|
width: cell.column.getSize(),
|
|
76
76
|
textAlign: (_f = cell.column.columnDef.meta) == null ? void 0 : _f.textAlign,
|
|
77
77
|
backgroundColor: (_g = cell.column.columnDef.meta) == null ? void 0 : _g.backgroundColor
|
|
78
78
|
}, (() => {
|
|
79
|
-
const _a2 = cell.column.columnDef.meta || {}, {
|
|
79
|
+
const _a2 = cell.column.columnDef.meta || {}, {
|
|
80
|
+
className,
|
|
81
|
+
textAlign,
|
|
82
|
+
backgroundColor,
|
|
83
|
+
_cell,
|
|
84
|
+
_actions,
|
|
85
|
+
domHidden
|
|
86
|
+
} = _a2, otherMeta = __objRest(_a2, [
|
|
87
|
+
"className",
|
|
88
|
+
"textAlign",
|
|
89
|
+
"backgroundColor",
|
|
90
|
+
"_cell",
|
|
91
|
+
"_actions",
|
|
92
|
+
"domHidden"
|
|
93
|
+
]);
|
|
80
94
|
return otherMeta;
|
|
81
|
-
})()), {
|
|
95
|
+
})()), getDomHiddenCellStyle(cell.column.columnDef.meta)), {
|
|
82
96
|
fontSize: "inherit",
|
|
83
97
|
color: "inherit"
|
|
84
98
|
}),
|
|
@@ -29,7 +29,7 @@ var __objRest = (source, exclude) => {
|
|
|
29
29
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
30
30
|
import { memo, useMemo, useCallback } from "react";
|
|
31
31
|
import { TableBody, TableRow, TableCell, Box } from "@mui/material";
|
|
32
|
-
import { TABLE_CSS_CLASSES, TABLE_MESSAGES } from "../utils";
|
|
32
|
+
import { TABLE_CSS_CLASSES, TABLE_MESSAGES, getRowExpansionConfig } from "../utils";
|
|
33
33
|
import { RowExpansionButton } from "./RowExpansionButton";
|
|
34
34
|
import isEqual from "lodash-es/isEqual";
|
|
35
35
|
import { TableDataRow } from "./TableDataRow";
|
|
@@ -180,7 +180,7 @@ const TableBodyComponentBase = ({
|
|
|
180
180
|
customColumnsRevision = 0,
|
|
181
181
|
columnsVersion = 0
|
|
182
182
|
}) => {
|
|
183
|
-
const hasExpansion =
|
|
183
|
+
const hasExpansion = rowExpansionConfig ? true : false;
|
|
184
184
|
const expansionInsertIndex = useExpansionPosition(
|
|
185
185
|
hasExpansion,
|
|
186
186
|
rowExpansionConfig || null,
|
|
@@ -190,6 +190,8 @@ const TableBodyComponentBase = ({
|
|
|
190
190
|
const renderExpansionCell = useCallback(
|
|
191
191
|
(rowId, rowData) => {
|
|
192
192
|
if (!hasExpansion || !rowExpansionConfig) return null;
|
|
193
|
+
const rowConfig = getRowExpansionConfig(rowExpansionConfig, rowId, rowData);
|
|
194
|
+
if (!rowConfig) return null;
|
|
193
195
|
return /* @__PURE__ */ jsx(
|
|
194
196
|
ExpansionCell,
|
|
195
197
|
{
|
|
@@ -197,7 +199,7 @@ const TableBodyComponentBase = ({
|
|
|
197
199
|
rowData,
|
|
198
200
|
isExpanded: isRowExpanded(rowId),
|
|
199
201
|
onToggle: toggleRowExpansion,
|
|
200
|
-
config:
|
|
202
|
+
config: rowConfig
|
|
201
203
|
},
|
|
202
204
|
`expansion-${rowId}`
|
|
203
205
|
);
|
|
@@ -15,7 +15,7 @@ var __spreadValues = (a, b) => {
|
|
|
15
15
|
return a;
|
|
16
16
|
};
|
|
17
17
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
18
|
-
import { memo, Fragment, useMemo } from "react";
|
|
18
|
+
import { memo, Fragment, useMemo, useCallback } from "react";
|
|
19
19
|
import { TableRow } from "@mui/material";
|
|
20
20
|
import { RowCells } from "./RowCells";
|
|
21
21
|
import { useEditedRow } from "../hooks/use-edited-rows";
|
|
@@ -44,6 +44,10 @@ const TableDataRowComponent = ({
|
|
|
44
44
|
customColumnsRevision = 0,
|
|
45
45
|
columnsVersion = 0
|
|
46
46
|
}) => {
|
|
47
|
+
const handleClick = useCallback(
|
|
48
|
+
(event) => onRowClick(event, row.original, rowId),
|
|
49
|
+
[onRowClick, row.original, rowId]
|
|
50
|
+
);
|
|
47
51
|
const editedTableData = useEditedRow(rowId);
|
|
48
52
|
const mergedRowData = useMemo(() => {
|
|
49
53
|
if (!editedTableData) {
|
|
@@ -65,7 +69,7 @@ const TableDataRowComponent = ({
|
|
|
65
69
|
TableRow,
|
|
66
70
|
{
|
|
67
71
|
className: `${TABLE_CSS_CLASSES.tableRow} ${isActive ? "active" : ""} ${rowClass}`,
|
|
68
|
-
onClick:
|
|
72
|
+
onClick: handleClick,
|
|
69
73
|
"data-row-id": row.index,
|
|
70
74
|
role: "row",
|
|
71
75
|
tabIndex: 0,
|
|
@@ -117,7 +121,16 @@ const TableDataRow = memo(TableDataRowComponent, (prev, next) => {
|
|
|
117
121
|
"index",
|
|
118
122
|
"customExpressionColumns",
|
|
119
123
|
"customColumnsRevision",
|
|
120
|
-
"columnsVersion"
|
|
124
|
+
"columnsVersion",
|
|
125
|
+
// closure-captured props — stale closure if memo skips when these change
|
|
126
|
+
"onRowClick",
|
|
127
|
+
"renderExpansionCell",
|
|
128
|
+
"hasExpansion",
|
|
129
|
+
"expansionInsertIndex",
|
|
130
|
+
"ExpandedContent",
|
|
131
|
+
"onInstanceLoad",
|
|
132
|
+
"rowExpansionConfig",
|
|
133
|
+
"totalColumns"
|
|
121
134
|
];
|
|
122
135
|
return keys.every((key) => prev[key] === next[key]);
|
|
123
136
|
});
|
|
@@ -33,7 +33,7 @@ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
|
33
33
|
import React, { memo, useMemo } from "react";
|
|
34
34
|
import { TableHead, TableRow, TableCell, Box } from "@mui/material";
|
|
35
35
|
import { flexRender } from "@tanstack/react-table";
|
|
36
|
-
import { TABLE_CSS_CLASSES } from "../utils";
|
|
36
|
+
import { TABLE_CSS_CLASSES, getDomHiddenCellStyle } from "../utils";
|
|
37
37
|
import { TableFilterRow } from "./TableFilters";
|
|
38
38
|
import { calculateMaxDepth, generateHeaderRows, hasTableGroups } from "../utils/groupHeaderUtils";
|
|
39
39
|
const StandardHeaderCell = memo(
|
|
@@ -57,18 +57,19 @@ const StandardHeaderCell = memo(
|
|
|
57
57
|
"title",
|
|
58
58
|
"onClick"
|
|
59
59
|
]);
|
|
60
|
-
var _a2, _b2;
|
|
60
|
+
var _a2, _b2, _c;
|
|
61
61
|
const canSort = enablesort && header.column.getCanSort();
|
|
62
62
|
const isSorted = header.column.getIsSorted();
|
|
63
63
|
const metaClassName = ((_b2 = (_a2 = header.column.columnDef) == null ? void 0 : _a2.meta) == null ? void 0 : _b2.className) || "";
|
|
64
64
|
const resizableClass = header.column.getCanResize() ? " ui-resizable" : "";
|
|
65
65
|
const mergedClassName = `${TABLE_CSS_CLASSES.headerCell} ${metaClassName} ${className || ""} ${resizableClass}`.trim();
|
|
66
|
-
const
|
|
66
|
+
const headerMeta = (_c = header.column.columnDef) == null ? void 0 : _c.meta;
|
|
67
|
+
const mergedStyle = __spreadValues(__spreadValues({
|
|
67
68
|
cursor: canSort ? "pointer" : "default",
|
|
68
69
|
userSelect: "none",
|
|
69
70
|
width: header.getSize(),
|
|
70
71
|
position: "relative"
|
|
71
|
-
}, style);
|
|
72
|
+
}, getDomHiddenCellStyle(headerMeta)), style);
|
|
72
73
|
const headerTitle = header.column.columnDef.header && typeof header.column.columnDef.header !== "function" ? header.column.columnDef.header.toString() : "";
|
|
73
74
|
return /* @__PURE__ */ jsx(
|
|
74
75
|
TableCell,
|
|
@@ -172,7 +173,7 @@ const TableHeaderComponent = memo(
|
|
|
172
173
|
onHeaderclick,
|
|
173
174
|
tableName
|
|
174
175
|
}) => {
|
|
175
|
-
const hasExpansion = rowExpansionConfig
|
|
176
|
+
const hasExpansion = rowExpansionConfig ? true : false;
|
|
176
177
|
const hasGroups = useMemo(() => {
|
|
177
178
|
return tableStructure && hasTableGroups(tableStructure);
|
|
178
179
|
}, [tableStructure]);
|
|
@@ -378,12 +379,13 @@ const TableHeaderComponent = memo(
|
|
|
378
379
|
};
|
|
379
380
|
const isClickable = enablecolumnselection && !isSystemColumn || enablesort && header.column.getCanSort();
|
|
380
381
|
const headerCellResizableClass = header.column.getCanResize() ? " ui-resizable" : "";
|
|
382
|
+
const headerMeta = header.column.columnDef.meta;
|
|
381
383
|
cells.push(
|
|
382
384
|
/* @__PURE__ */ jsxs(
|
|
383
385
|
TableCell,
|
|
384
386
|
{
|
|
385
387
|
className: `${TABLE_CSS_CLASSES.headerCell} ${((_b = (_a = header.column.columnDef) == null ? void 0 : _a.meta) == null ? void 0 : _b.className) || ""} ${headerCellResizableClass}`.trim(),
|
|
386
|
-
style: {
|
|
388
|
+
style: __spreadValues({
|
|
387
389
|
cursor: isClickable ? "pointer" : "default",
|
|
388
390
|
userSelect: "none",
|
|
389
391
|
width: header.getSize(),
|
|
@@ -392,7 +394,7 @@ const TableHeaderComponent = memo(
|
|
|
392
394
|
color: "inherit",
|
|
393
395
|
fontWeight: "bold",
|
|
394
396
|
lineHeight: "inherit"
|
|
395
|
-
},
|
|
397
|
+
}, getDomHiddenCellStyle(headerMeta)),
|
|
396
398
|
title: header.column.columnDef.header && typeof header.column.columnDef.header !== "function" ? header.column.columnDef.header.toString() : "",
|
|
397
399
|
onClick: handleHeaderClick,
|
|
398
400
|
role: "columnheader",
|
|
@@ -400,7 +402,7 @@ const TableHeaderComponent = memo(
|
|
|
400
402
|
tabIndex: 0,
|
|
401
403
|
"data-col-field": header.column.id,
|
|
402
404
|
children: [
|
|
403
|
-
header.isPlaceholder ? null : flexRender(header.column.columnDef.header, header.getContext()),
|
|
405
|
+
/* @__PURE__ */ jsx("span", { className: "header-data", children: header.isPlaceholder ? null : flexRender(header.column.columnDef.header, header.getContext()) }),
|
|
404
406
|
enablesort && !enablecolumnselection && header.column.getCanSort() && /* @__PURE__ */ jsx(
|
|
405
407
|
Box,
|
|
406
408
|
{
|
|
@@ -25,10 +25,13 @@ import { getButtonClasses } from "../utils";
|
|
|
25
25
|
import WmMenu from "../../../navigation/menu";
|
|
26
26
|
import { DataSource } from "../../types";
|
|
27
27
|
import { isEmpty, values } from "lodash";
|
|
28
|
+
import { WmAppIcon } from "../../../common/WmAppIcon";
|
|
28
29
|
const TablePanelHeadingComponent = ({
|
|
29
30
|
title,
|
|
30
31
|
subheading,
|
|
31
32
|
iconclass,
|
|
33
|
+
iconurl,
|
|
34
|
+
prefabName,
|
|
32
35
|
exportformat = [],
|
|
33
36
|
headerActions,
|
|
34
37
|
spacing = "normal",
|
|
@@ -118,10 +121,19 @@ const TablePanelHeadingComponent = ({
|
|
|
118
121
|
}
|
|
119
122
|
}
|
|
120
123
|
},
|
|
121
|
-
[datasource, columns, sortInfo, filterInfo, exportdatasize, onBeforeExport
|
|
124
|
+
[datasource, columns, sortInfo, filterInfo, exportdatasize, onBeforeExport]
|
|
122
125
|
);
|
|
123
126
|
return /* @__PURE__ */ jsx(Box, { className: "panel-heading", children: /* @__PURE__ */ jsxs(Box, { component: "h3", className: "panel-title", children: [
|
|
124
|
-
/* @__PURE__ */ jsx(Box, { className: "pull-left", children:
|
|
127
|
+
/* @__PURE__ */ jsx(Box, { className: "pull-left", children: /* @__PURE__ */ jsx(
|
|
128
|
+
WmAppIcon,
|
|
129
|
+
{
|
|
130
|
+
iconclass,
|
|
131
|
+
iconurl,
|
|
132
|
+
prefabName,
|
|
133
|
+
defaultClasses: iconurl ? "panel-image-icon" : "panel-icon",
|
|
134
|
+
alt: "Table icon"
|
|
135
|
+
}
|
|
136
|
+
) }),
|
|
125
137
|
/* @__PURE__ */ jsxs(Box, { className: "pull-left", children: [
|
|
126
138
|
title && /* @__PURE__ */ jsx(Box, { component: "div", className: "heading", children: title }),
|
|
127
139
|
subheading && /* @__PURE__ */ jsx(Box, { component: "div", className: "description", children: subheading })
|
|
@@ -171,7 +183,7 @@ const TablePanelHeadingComponent = ({
|
|
|
171
183
|
};
|
|
172
184
|
TablePanelHeadingComponent.displayName = "TablePanelHeading";
|
|
173
185
|
const TablePanelHeading = memo(TablePanelHeadingComponent, (prevProps, nextProps) => {
|
|
174
|
-
return prevProps.title === nextProps.title && prevProps.subheading === nextProps.subheading && prevProps.iconclass === nextProps.iconclass && prevProps.exportformat === nextProps.exportformat && prevProps.headerActions === nextProps.headerActions && prevProps.spacing === nextProps.spacing && prevProps.isGridEditMode === nextProps.isGridEditMode && prevProps.isLoading === nextProps.isLoading && prevProps.listener === nextProps.listener && prevProps.datasource === nextProps.datasource && prevProps.columns === nextProps.columns && prevProps.sortInfo === nextProps.sortInfo && prevProps.filterInfo === nextProps.filterInfo && prevProps.exportdatasize === nextProps.exportdatasize && prevProps.onBeforeExport === nextProps.onBeforeExport;
|
|
186
|
+
return prevProps.title === nextProps.title && prevProps.subheading === nextProps.subheading && prevProps.iconclass === nextProps.iconclass && prevProps.iconurl === nextProps.iconurl && prevProps.exportformat === nextProps.exportformat && prevProps.headerActions === nextProps.headerActions && prevProps.spacing === nextProps.spacing && prevProps.isGridEditMode === nextProps.isGridEditMode && prevProps.isLoading === nextProps.isLoading && prevProps.listener === nextProps.listener && prevProps.datasource === nextProps.datasource && prevProps.columns === nextProps.columns && prevProps.sortInfo === nextProps.sortInfo && prevProps.filterInfo === nextProps.filterInfo && prevProps.exportdatasize === nextProps.exportdatasize && prevProps.onBeforeExport === nextProps.onBeforeExport;
|
|
175
187
|
});
|
|
176
188
|
export {
|
|
177
189
|
TablePanelHeading
|
|
@@ -64,7 +64,7 @@ const useDynamicColumns = ({
|
|
|
64
64
|
dynamicColumns: columnsWithListener,
|
|
65
65
|
isDynamicTable: true
|
|
66
66
|
};
|
|
67
|
-
}, [dataset, children
|
|
67
|
+
}, [dataset, children]);
|
|
68
68
|
return { dynamicColumns, isDynamicTable };
|
|
69
69
|
};
|
|
70
70
|
var useDynamicColumns_default = useDynamicColumns;
|