@wavemaker-ai/react-runtime 1.0.0-rc.332 → 1.0.0-rc.334
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/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 +3 -5
- 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/iframe/index.d.ts +1 -0
- package/components/basic/label/index.d.ts +1 -0
- package/components/basic/picture/index.d.ts +1 -0
- 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/spinner/index.d.ts +1 -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 +1 -0
- package/components/container/accordion/accordion-pane/index.d.ts +1 -0
- package/components/container/accordion/index.d.ts +1 -0
- package/components/container/index.d.ts +4 -0
- package/components/container/index.js +33 -9
- 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/index.d.ts +1 -0
- package/components/container/layout-grid/index.js +1 -1
- 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/index.d.ts +1 -0
- package/components/container/props.d.ts +1 -0
- package/components/container/repeat-template/index.d.ts +1 -0
- package/components/container/repeat-template/index.js +1 -1
- package/components/container/tabs/index.d.ts +1 -0
- package/components/container/tabs/index.js +8 -6
- package/components/container/tabs/tab-pane/index.d.ts +1 -0
- package/components/container/tabs/tab-pane/index.js +2 -2
- package/components/container/wizard/index.d.ts +2 -0
- package/components/container/wizard/index.js +56 -40
- package/components/container/wizard/wizard-step/index.d.ts +1 -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/form/base-form/hooks/useFormOperations.d.ts +1 -1
- package/components/data/form/base-form/hooks/useFormOperations.js +5 -2
- package/components/data/form/base-form/index.js +10 -14
- package/components/data/form/base-form/props.d.ts +1 -0
- package/components/data/form/form-action/index.d.ts +2 -0
- package/components/data/form/form-controller/withFormController.js +16 -3
- package/components/data/form/form-field/index.js +35 -11
- package/components/data/form/form-field/props.d.ts +7 -2
- package/components/data/list/index.d.ts +2 -0
- package/components/data/list/index.js +4 -9
- package/components/data/pagination/hooks/usePagination.js +6 -6
- package/components/data/table/components/RowExpansionButton.js +5 -1
- package/components/data/table/components/TableBody.js +2 -0
- package/components/data/table/components/TableHeader.js +3 -1
- package/components/data/table/hooks/useFormWidget.js +2 -2
- package/components/data/table/hooks/usePanelStructure.js +6 -1
- package/components/data/table/hooks/useResponsiveColumns.d.ts +1 -0
- package/components/data/table/hooks/useRowHandlers.js +1 -1
- package/components/data/table/hooks/useRowSelection.js +7 -3
- package/components/data/table/hooks/useTableData.js +10 -2
- package/components/data/table/index.d.ts +2 -0
- package/components/data/table/index.js +14 -13
- package/components/data/table/live-table/index.d.ts +1 -0
- package/components/data/table/props.d.ts +1 -0
- 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.js +17 -22
- package/components/data/table/utils/crud-handlers.js +3 -1
- package/components/data/table/utils/expansionColumn.js +1 -1
- package/components/data/table/utils/index.d.ts +10 -3
- package/components/data/table/utils/index.js +5 -8
- package/components/data/table/utils/selectionUtils.d.ts +12 -0
- package/components/data/table/utils/selectionUtils.js +10 -0
- 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-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/iframe-dialog/index.d.ts +2 -0
- package/components/dialogs/login-dialog/index.d.ts +2 -0
- package/components/dialogs/page-dialog/index.d.ts +2 -0
- package/components/dialogs/withDialogWrapper.js +12 -2
- package/components/form/button/index.d.ts +1 -0
- 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/color-picker/index.d.ts +2 -0
- package/components/input/composite/index.d.ts +1 -0
- package/components/input/composite/index.js +32 -6
- package/components/input/default/checkbox/index.d.ts +2 -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/switch/index.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/datetime/index.js +3 -1
- package/components/input/epoch/time/index.d.ts +1 -0
- package/components/input/fileupload/index.d.ts +1 -0
- package/components/input/fileupload/index.js +2 -1
- package/components/input/number/index.d.ts +2 -0
- package/components/input/rating/index.d.ts +2 -0
- package/components/input/slider/index.d.ts +2 -0
- package/components/input/text/index.d.ts +2 -0
- package/components/input/text/index.js +9 -2
- package/components/input/textarea/index.d.ts +2 -0
- package/components/input/upload/index.d.ts +2 -0
- package/components/navbar/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 +1 -0
- package/components/navigation/menu/index.js +13 -9
- package/components/navigation/menu/props.d.ts +1 -0
- package/components/navigation/popover/index.d.ts +1 -0
- package/components/navigation/popover/index.js +15 -3
- package/components/page/partial/index.d.ts +1 -0
- package/context/PopoverContext.d.ts +5 -0
- package/context/PopoverContext.js +5 -0
- package/context/WidgetProvider.js +9 -2
- package/core/proxy-service.d.ts +2 -0
- package/core/proxy-service.js +46 -3
- package/higherOrder/BaseApp.js +2 -1
- package/higherOrder/BasePage.js +2 -9
- package/higherOrder/props.d.ts +1 -0
- package/higherOrder/useActivePageReactivity.js +1 -4
- package/higherOrder/withBaseWrapper.js +3 -2
- package/package-lock.json +168 -167
- package/package.json +3 -3
- package/runtime-dynamic/components/PageWrapper.js +1 -1
- package/runtime-dynamic/components/PrefabPreview.js +1 -1
- package/runtime-dynamic/components/partial-content.js +17 -1
- package/runtime-dynamic/factories/build-base-page-like-component.js +11 -7
- package/runtime-dynamic/factories/dynamic-component.js +1 -7
- package/runtime-dynamic/routes.js +17 -8
- package/utils/page-params-util.js +22 -1
- package/utils/partial-host-util.d.ts +40 -0
- package/utils/partial-host-util.js +41 -0
- package/variables/model-variable.d.ts +2 -0
- package/variables/model-variable.js +14 -0
|
@@ -381,7 +381,7 @@ const usePagination = ({
|
|
|
381
381
|
const updatedMaxResults = newMaxResults || prev.currentMaxResults;
|
|
382
382
|
const updatedDataSize = newDataSize !== void 0 ? newDataSize : prev.dataSize;
|
|
383
383
|
const updatedCurrentPage = currentPage !== void 0 ? currentPage : prev.currentPage;
|
|
384
|
-
const newPageCount = (paginationMeta == null ? void 0 : paginationMeta.totalPages) !== void 0 && (
|
|
384
|
+
const newPageCount = (paginationMeta == null ? void 0 : paginationMeta.totalPages) !== void 0 && (isServerSidePagination || paginationMeta.totalPages > 1) ? paginationMeta.totalPages : updatedDataSize > updatedMaxResults ? Math.ceil(updatedDataSize / updatedMaxResults) : updatedDataSize < 0 ? 0 : 1;
|
|
385
385
|
return __spreadProps(__spreadValues({}, prev), {
|
|
386
386
|
currentPage: updatedCurrentPage,
|
|
387
387
|
dataSize: updatedDataSize,
|
|
@@ -390,7 +390,7 @@ const usePagination = ({
|
|
|
390
390
|
}
|
|
391
391
|
});
|
|
392
392
|
},
|
|
393
|
-
[paginationMeta]
|
|
393
|
+
[isServerSidePagination, paginationMeta]
|
|
394
394
|
);
|
|
395
395
|
const disableNavigation = useCallback(() => {
|
|
396
396
|
setDisableStates({
|
|
@@ -551,7 +551,7 @@ const usePagination = ({
|
|
|
551
551
|
totalElements: (paginationMeta == null ? void 0 : paginationMeta.totalElements) || dataState.fullData.length,
|
|
552
552
|
totalPages: paginationState.pageCount
|
|
553
553
|
};
|
|
554
|
-
onSetRecord(
|
|
554
|
+
onSetRecord(createDummyEvent("setrecord"), widgetInstance, data, pageInfo);
|
|
555
555
|
}
|
|
556
556
|
if (setIsLoadingMore) {
|
|
557
557
|
setIsLoadingMore(false);
|
|
@@ -582,7 +582,7 @@ const usePagination = ({
|
|
|
582
582
|
totalElements: (paginationMeta == null ? void 0 : paginationMeta.totalElements) || dataState.fullData.length,
|
|
583
583
|
totalPages: paginationState.pageCount
|
|
584
584
|
};
|
|
585
|
-
onSetRecord(
|
|
585
|
+
onSetRecord(createDummyEvent("setrecord"), widgetInstance, data, pageInfo);
|
|
586
586
|
}
|
|
587
587
|
if (setIsLoadingMore) {
|
|
588
588
|
setIsLoadingMore(false);
|
|
@@ -679,7 +679,7 @@ const usePagination = ({
|
|
|
679
679
|
totalElements: (paginationMeta == null ? void 0 : paginationMeta.totalElements) || fullData.length,
|
|
680
680
|
totalPages: pageCount
|
|
681
681
|
};
|
|
682
|
-
onSetRecord(
|
|
682
|
+
onSetRecord(createDummyEvent("setrecord"), widgetInstance, data, pageInfo);
|
|
683
683
|
}
|
|
684
684
|
goToPage();
|
|
685
685
|
},
|
|
@@ -737,7 +737,7 @@ const usePagination = ({
|
|
|
737
737
|
totalElements: (paginationMeta == null ? void 0 : paginationMeta.totalElements) || dataState.fullData.length,
|
|
738
738
|
totalPages: newPageCount
|
|
739
739
|
};
|
|
740
|
-
onSetRecord(
|
|
740
|
+
onSetRecord(createDummyEvent("setrecord"), widgetInstance, data, pageInfo);
|
|
741
741
|
}
|
|
742
742
|
if (setIsLoadingMore) {
|
|
743
743
|
setIsLoadingMore(false);
|
|
@@ -49,7 +49,11 @@ const RowExpansionButton = ({
|
|
|
49
49
|
"aria-label": ariaLabel,
|
|
50
50
|
"aria-expanded": isExpanded,
|
|
51
51
|
"aria-live": "polite",
|
|
52
|
-
tabIndex: 0
|
|
52
|
+
tabIndex: 0,
|
|
53
|
+
styles: __spreadValues({
|
|
54
|
+
minWidth: 0,
|
|
55
|
+
padding: 0
|
|
56
|
+
}, config.styles)
|
|
53
57
|
};
|
|
54
58
|
if (config.listener) {
|
|
55
59
|
commonProps.listener = config.listener;
|
|
@@ -69,6 +69,8 @@ const ExpansionCell = memo(({ rowId, rowData, isExpanded, onToggle, config }) =>
|
|
|
69
69
|
textAlign: "center",
|
|
70
70
|
position: "relative",
|
|
71
71
|
width: config.columnwidth || DEFAULT_EXPANSION_WIDTH,
|
|
72
|
+
minWidth: config.columnwidth || DEFAULT_EXPANSION_WIDTH,
|
|
73
|
+
maxWidth: config.columnwidth || DEFAULT_EXPANSION_WIDTH,
|
|
72
74
|
padding: "4px"
|
|
73
75
|
},
|
|
74
76
|
children: /* @__PURE__ */ jsx(Box, { component: "span", className: "row-expansion-column", "data-identifier": "rowExpansionButtons", children: /* @__PURE__ */ jsx(
|
|
@@ -147,6 +147,8 @@ const ExpansionHeaderCell = memo(
|
|
|
147
147
|
rowSpan,
|
|
148
148
|
style: __spreadValues({
|
|
149
149
|
width: columnwidth || "50px",
|
|
150
|
+
minWidth: columnwidth || "50px",
|
|
151
|
+
maxWidth: columnwidth || "50px",
|
|
150
152
|
padding: "8px",
|
|
151
153
|
userSelect: "none"
|
|
152
154
|
}, rest.style)
|
|
@@ -330,7 +332,7 @@ const TableHeaderComponent = memo(
|
|
|
330
332
|
role: "columnheader",
|
|
331
333
|
"data-col-id": headerIndex,
|
|
332
334
|
tabIndex: 0,
|
|
333
|
-
"data-col-field":
|
|
335
|
+
"data-col-field": "row-expansion",
|
|
334
336
|
columnwidth: rowExpansionConfig == null ? void 0 : rowExpansionConfig.columnwidth
|
|
335
337
|
},
|
|
336
338
|
`expansion-header-${headerIndex}`
|
|
@@ -62,7 +62,7 @@ const useFormWidget = ({ listener }) => {
|
|
|
62
62
|
const sessionSuffix = (widgetProps == null ? void 0 : widgetProps.sessionKey) ? `_${widgetProps.sessionKey}` : "";
|
|
63
63
|
const uniqueName = `edit_${fieldName}${sessionSuffix}`;
|
|
64
64
|
const disabled = getDisabledValue(widgetProps == null ? void 0 : widgetProps.disabled, widgetProps == null ? void 0 : widgetProps.rowData);
|
|
65
|
-
const commonProps = __spreadValues({
|
|
65
|
+
const commonProps = __spreadProps(__spreadValues({}, widgetProps == null ? void 0 : widgetProps.column), {
|
|
66
66
|
key: uniqueName,
|
|
67
67
|
// Add key to force component recreation
|
|
68
68
|
name: uniqueName,
|
|
@@ -84,7 +84,7 @@ const useFormWidget = ({ listener }) => {
|
|
|
84
84
|
column: widgetProps == null ? void 0 : widgetProps.column,
|
|
85
85
|
updateon: "blur",
|
|
86
86
|
regexp: ((_a = widgetProps == null ? void 0 : widgetProps.column) == null ? void 0 : _a.regexp) || ".*"
|
|
87
|
-
}
|
|
87
|
+
});
|
|
88
88
|
const wrapEventHandler = (handler) => {
|
|
89
89
|
return (event) => {
|
|
90
90
|
handler(event, {}, widgetProps == null ? void 0 : widgetProps.rowData);
|
|
@@ -39,9 +39,14 @@ const usePanelStructure = ({
|
|
|
39
39
|
showrecordcount
|
|
40
40
|
]
|
|
41
41
|
);
|
|
42
|
+
const showFooter = useMemo(
|
|
43
|
+
() => showPagination || footerActions.length > 0,
|
|
44
|
+
[showPagination, footerActions]
|
|
45
|
+
);
|
|
42
46
|
return {
|
|
43
47
|
showPanelHeading,
|
|
44
|
-
showPagination
|
|
48
|
+
showPagination,
|
|
49
|
+
showFooter
|
|
45
50
|
};
|
|
46
51
|
};
|
|
47
52
|
export {
|
|
@@ -52,6 +52,7 @@ export declare const useResponsiveColumns: (columns: WmTableColumnProps[]) => {
|
|
|
52
52
|
padding?: string;
|
|
53
53
|
margin?: string;
|
|
54
54
|
height?: number | string;
|
|
55
|
+
class?: string;
|
|
55
56
|
conditionalstyle?: import("react").CSSProperties;
|
|
56
57
|
conditionalclass?: string;
|
|
57
58
|
showindevice?: ("xs" | "sm" | "md" | "lg" | "all")[];
|
|
@@ -35,6 +35,7 @@ const useRowHandlers = ({
|
|
|
35
35
|
const handleRowClick = useCallback(
|
|
36
36
|
(event, rowData, rowId) => {
|
|
37
37
|
const hasSelectionMode = useRadioSelect || useMultiSelect;
|
|
38
|
+
invokeRowClick(event, rowData);
|
|
38
39
|
let isSelectionHandled = false;
|
|
39
40
|
if (hasSelectionMode && isrowselectable) {
|
|
40
41
|
isSelectionHandled = handleRowSelectionClick(event, rowId, rowData);
|
|
@@ -47,7 +48,6 @@ const useRowHandlers = ({
|
|
|
47
48
|
return;
|
|
48
49
|
}
|
|
49
50
|
handleRowActiveClick(rowId, isSelectionHandled, isEditingOrAdding);
|
|
50
|
-
invokeRowClick(event, rowData);
|
|
51
51
|
},
|
|
52
52
|
[
|
|
53
53
|
editingRowId,
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
2
2
|
import {
|
|
3
3
|
isInteractiveElement,
|
|
4
|
+
isSelectionCheckboxRenamed,
|
|
4
5
|
getRowIdsFromDataset,
|
|
5
6
|
rowExistsInDataset,
|
|
6
7
|
selectionStateHelpers,
|
|
@@ -217,10 +218,13 @@ const useRowSelection = ({
|
|
|
217
218
|
}
|
|
218
219
|
if (useMultiSelect) {
|
|
219
220
|
const isCurrentlySelected = selectionStateHelpers.isRowSelected(cellState, rowId);
|
|
220
|
-
const
|
|
221
|
-
|
|
221
|
+
const isToggled = !isSelectionCheckboxRenamed(event);
|
|
222
|
+
if (isToggled) {
|
|
223
|
+
selectionStateHelpers.toggleSelection(cellState, rowId);
|
|
224
|
+
}
|
|
225
|
+
const isSelected = isToggled ? !isCurrentlySelected : isCurrentlySelected;
|
|
222
226
|
commitSelectionChange();
|
|
223
|
-
triggerSelectionCallback(event, rowData,
|
|
227
|
+
triggerSelectionCallback(event, rowData, isSelected ? onRowselect : onRowdeselect);
|
|
224
228
|
return true;
|
|
225
229
|
}
|
|
226
230
|
handleRadioSelection(rowId, rowData);
|
|
@@ -59,8 +59,13 @@ const useTableData = ({
|
|
|
59
59
|
widgetName
|
|
60
60
|
}) => {
|
|
61
61
|
const rowIdCacheRef = useRef([]);
|
|
62
|
+
const rawDatasetRef = useRef(void 0);
|
|
63
|
+
const processedDatasetRef = useRef([]);
|
|
62
64
|
const processedDataset = useMemo(() => {
|
|
63
65
|
const extracted = extractDataArray(dataset);
|
|
66
|
+
if (isEqual(rawDatasetRef.current, extracted)) {
|
|
67
|
+
return processedDatasetRef.current;
|
|
68
|
+
}
|
|
64
69
|
const cachedIds = rowIdCacheRef.current;
|
|
65
70
|
const prestamped = extracted.map((item, i) => {
|
|
66
71
|
if (!item || typeof item !== "object" || item._wmTableRowId || item.id || item.ID || item.Id || !cachedIds[i]) {
|
|
@@ -70,8 +75,11 @@ const useTableData = ({
|
|
|
70
75
|
});
|
|
71
76
|
const withIds = addUniqueRowIds(prestamped);
|
|
72
77
|
rowIdCacheRef.current = withIds.map((r) => r == null ? void 0 : r._wmTableRowId);
|
|
73
|
-
|
|
74
|
-
|
|
78
|
+
const result = removeEmptyRecords(withIds);
|
|
79
|
+
rawDatasetRef.current = extracted;
|
|
80
|
+
processedDatasetRef.current = result;
|
|
81
|
+
return result;
|
|
82
|
+
}, [dataset, dataset == null ? void 0 : dataset.length]);
|
|
75
83
|
const [internalDataset, setInternalDataset] = useState(processedDataset);
|
|
76
84
|
useEffect(() => {
|
|
77
85
|
if (!isEqual(internalDataset, processedDataset)) {
|
|
@@ -102,6 +102,7 @@ declare const WmTableStandalone: React.ComponentType<{
|
|
|
102
102
|
width?: number | string;
|
|
103
103
|
height?: number | string;
|
|
104
104
|
className?: string;
|
|
105
|
+
class?: string;
|
|
105
106
|
conditionalstyle?: React.CSSProperties;
|
|
106
107
|
conditionalclass?: string;
|
|
107
108
|
showindevice?: ("xs" | "sm" | "md" | "lg" | "all")[];
|
|
@@ -245,6 +246,7 @@ declare const WmTable: React.ComponentType<{
|
|
|
245
246
|
width?: number | string;
|
|
246
247
|
height?: number | string;
|
|
247
248
|
className?: string;
|
|
249
|
+
class?: string;
|
|
248
250
|
conditionalstyle?: React.CSSProperties;
|
|
249
251
|
conditionalclass?: string;
|
|
250
252
|
showindevice?: ("xs" | "sm" | "md" | "lg" | "all")[];
|
|
@@ -638,9 +638,10 @@ const WmTableComponent = memo(
|
|
|
638
638
|
if (onSort && newSorting.length > 0) {
|
|
639
639
|
const sortData = {
|
|
640
640
|
field: newSorting[0].id,
|
|
641
|
-
direction: newSorting[0].desc ? "desc" : "asc"
|
|
641
|
+
direction: newSorting[0].desc ? "desc" : "asc",
|
|
642
|
+
sortDirection: newSorting[0].desc ? "desc" : "asc"
|
|
642
643
|
};
|
|
643
|
-
onSort(null, (_a2 =
|
|
644
|
+
onSort(null, (_a2 = viewParent == null ? void 0 : viewParent.Widgets) == null ? void 0 : _a2[name], sortData);
|
|
644
645
|
}
|
|
645
646
|
},
|
|
646
647
|
[sorting, name]
|
|
@@ -779,7 +780,7 @@ const WmTableComponent = memo(
|
|
|
779
780
|
listener.Widgets[name].nativeElement = tableContainerRef.current;
|
|
780
781
|
}
|
|
781
782
|
const data = internalDataset && internalDataset.length > 0 ? internalDataset : table.getRowModel().rows.map((row) => row.original) || [];
|
|
782
|
-
onDatarender((_a2 =
|
|
783
|
+
onDatarender((_a2 = viewParent == null ? void 0 : viewParent.Widgets) == null ? void 0 : _a2[name], data);
|
|
783
784
|
}, [onDatarender, name]);
|
|
784
785
|
columnsStateRef.current = columns;
|
|
785
786
|
const columnsForTable = useMemo(() => {
|
|
@@ -944,7 +945,7 @@ const WmTableComponent = memo(
|
|
|
944
945
|
listener,
|
|
945
946
|
name
|
|
946
947
|
});
|
|
947
|
-
const { showPanelHeading, showPagination } = usePanelStructure({
|
|
948
|
+
const { showPanelHeading, showPagination, showFooter } = usePanelStructure({
|
|
948
949
|
title,
|
|
949
950
|
subheading,
|
|
950
951
|
iconclass,
|
|
@@ -1026,7 +1027,8 @@ const WmTableComponent = memo(
|
|
|
1026
1027
|
const firstSort = sorting[0];
|
|
1027
1028
|
return {
|
|
1028
1029
|
field: firstSort.id,
|
|
1029
|
-
direction: firstSort.desc ? "desc" : "asc"
|
|
1030
|
+
direction: firstSort.desc ? "desc" : "asc",
|
|
1031
|
+
sortDirection: firstSort.desc ? "desc" : "asc"
|
|
1030
1032
|
};
|
|
1031
1033
|
}
|
|
1032
1034
|
return void 0;
|
|
@@ -1118,8 +1120,8 @@ const WmTableComponent = memo(
|
|
|
1118
1120
|
});
|
|
1119
1121
|
if (onBeforedatarender) {
|
|
1120
1122
|
onBeforedatarender(
|
|
1121
|
-
(_a2 =
|
|
1122
|
-
// widget reference
|
|
1123
|
+
(_a2 = viewParent == null ? void 0 : viewParent.Widgets) == null ? void 0 : _a2[name],
|
|
1124
|
+
// widget reference (reactive proxy, not raw listener)
|
|
1123
1125
|
data,
|
|
1124
1126
|
// data
|
|
1125
1127
|
columnsProxy
|
|
@@ -1133,10 +1135,9 @@ const WmTableComponent = memo(
|
|
|
1133
1135
|
} else {
|
|
1134
1136
|
queueOnDatarenderAfterPaint();
|
|
1135
1137
|
}
|
|
1136
|
-
|
|
1137
|
-
(r) => typeof r === "object" && r !== null ? __spreadValues({}, r) : r
|
|
1138
|
+
setInternalDataset(
|
|
1139
|
+
(prev) => prev.map((r) => typeof r === "object" && r !== null ? __spreadValues({}, r) : r)
|
|
1138
1140
|
);
|
|
1139
|
-
setInternalDataset(nextRows);
|
|
1140
1141
|
} else if (onDatarender) {
|
|
1141
1142
|
queueOnDatarenderAfterPaint();
|
|
1142
1143
|
}
|
|
@@ -1275,7 +1276,7 @@ const WmTableComponent = memo(
|
|
|
1275
1276
|
const rowIndex = internalDataset.findIndex(
|
|
1276
1277
|
(r) => r._wmTableRowId === row._wmTableRowId || r.id !== void 0 && r.id === row.id
|
|
1277
1278
|
);
|
|
1278
|
-
const result = await onBeforerowdelete(event, (_a2 =
|
|
1279
|
+
const result = await onBeforerowdelete(event, (_a2 = viewParent == null ? void 0 : viewParent.Widgets) == null ? void 0 : _a2[name], cleanedRow, {
|
|
1279
1280
|
rowIndex,
|
|
1280
1281
|
data: cleanedRow
|
|
1281
1282
|
});
|
|
@@ -1339,7 +1340,7 @@ const WmTableComponent = memo(
|
|
|
1339
1340
|
showToast("Failed to refresh table data", "Error");
|
|
1340
1341
|
}
|
|
1341
1342
|
if (onError) {
|
|
1342
|
-
onError(null, (_b2 =
|
|
1343
|
+
onError(null, (_b2 = viewParent == null ? void 0 : viewParent.Widgets) == null ? void 0 : _b2[name], error, "refresh");
|
|
1343
1344
|
}
|
|
1344
1345
|
}
|
|
1345
1346
|
},
|
|
@@ -1601,7 +1602,7 @@ const WmTableComponent = memo(
|
|
|
1601
1602
|
}
|
|
1602
1603
|
) }) })
|
|
1603
1604
|
] }),
|
|
1604
|
-
/* @__PURE__ */ jsxs(Box, { className: "panel-footer clearfix", children: [
|
|
1605
|
+
showFooter && /* @__PURE__ */ jsxs(Box, { className: "panel-footer clearfix", children: [
|
|
1605
1606
|
showPagination && /* @__PURE__ */ jsx(Box, { className: "app-datagrid-paginator", children: /* @__PURE__ */ jsx(
|
|
1606
1607
|
WmPagination,
|
|
1607
1608
|
{
|
|
@@ -35,6 +35,7 @@ declare const _default: React.ComponentType<{
|
|
|
35
35
|
width?: number | string;
|
|
36
36
|
height?: number | string;
|
|
37
37
|
className?: string;
|
|
38
|
+
class?: string;
|
|
38
39
|
conditionalstyle?: React.CSSProperties;
|
|
39
40
|
conditionalclass?: string;
|
|
40
41
|
showindevice?: ("xs" | "sm" | "md" | "lg" | "all")[];
|
|
@@ -1095,6 +1095,7 @@ export interface UsePanelStructureProps {
|
|
|
1095
1095
|
export interface UsePanelStructureReturn {
|
|
1096
1096
|
showPanelHeading: boolean;
|
|
1097
1097
|
showPagination: boolean;
|
|
1098
|
+
showFooter: boolean;
|
|
1098
1099
|
}
|
|
1099
1100
|
export interface UseRowSelectionProps {
|
|
1100
1101
|
radioselect?: boolean;
|
|
@@ -21,6 +21,7 @@ declare const _default: React.ComponentType<{
|
|
|
21
21
|
width?: number | string;
|
|
22
22
|
height?: number | string;
|
|
23
23
|
className?: string;
|
|
24
|
+
class?: string;
|
|
24
25
|
conditionalstyle?: React.CSSProperties;
|
|
25
26
|
conditionalclass?: string;
|
|
26
27
|
showindevice?: ("xs" | "sm" | "md" | "lg" | "all")[];
|
|
@@ -21,6 +21,7 @@ declare const _default: React.ComponentType<{
|
|
|
21
21
|
width?: number | string;
|
|
22
22
|
height?: number | string;
|
|
23
23
|
className?: string;
|
|
24
|
+
class?: string;
|
|
24
25
|
conditionalstyle?: React.CSSProperties;
|
|
25
26
|
conditionalclass?: string;
|
|
26
27
|
showindevice?: ("xs" | "sm" | "md" | "lg" | "all")[];
|
|
@@ -21,6 +21,7 @@ declare const _default: React.ComponentType<{
|
|
|
21
21
|
width?: number | string;
|
|
22
22
|
height?: number | string;
|
|
23
23
|
className?: string;
|
|
24
|
+
class?: string;
|
|
24
25
|
conditionalstyle?: React.CSSProperties;
|
|
25
26
|
conditionalclass?: string;
|
|
26
27
|
showindevice?: ("xs" | "sm" | "md" | "lg" | "all")[];
|
|
@@ -29,6 +29,7 @@ export declare const WmTableRowAction: React.FC<{
|
|
|
29
29
|
margin?: string;
|
|
30
30
|
width?: number | string;
|
|
31
31
|
height?: number | string;
|
|
32
|
+
class?: string;
|
|
32
33
|
conditionalstyle?: React.CSSProperties;
|
|
33
34
|
conditionalclass?: string;
|
|
34
35
|
showindevice?: ("xs" | "sm" | "md" | "lg" | "all")[];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Box,
|
|
2
|
+
import { Box, Tooltip } from "@mui/material";
|
|
3
3
|
import { TABLE_MESSAGES } from "./constants";
|
|
4
4
|
const getSelectionMeta = (ctx) => {
|
|
5
5
|
var _a, _b, _c, _d;
|
|
@@ -10,27 +10,22 @@ function RadioSelectCell(ctx) {
|
|
|
10
10
|
const rowId = row.id;
|
|
11
11
|
const isSelected = row.getIsSelected();
|
|
12
12
|
const { handleRadioSelection, radioselecttitle, radioselectarialabel, tableName } = getSelectionMeta(ctx);
|
|
13
|
-
return /* @__PURE__ */ jsx(Box, { sx: { display: "flex", justifyContent: "center" }, children: /* @__PURE__ */ jsx(Tooltip, { title: radioselecttitle != null ? radioselecttitle : "", placement: "top", children: /* @__PURE__ */ jsx(Box, { className: "radio app-radio", children: /* @__PURE__ */
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
),
|
|
30
|
-
label: "",
|
|
31
|
-
className: "caption"
|
|
32
|
-
}
|
|
33
|
-
) }) }) });
|
|
13
|
+
return /* @__PURE__ */ jsx(Box, { sx: { display: "flex", justifyContent: "center" }, children: /* @__PURE__ */ jsx(Tooltip, { title: radioselecttitle != null ? radioselecttitle : "", placement: "top", children: /* @__PURE__ */ jsx(Box, { className: "radio app-radio", children: /* @__PURE__ */ jsxs(Box, { component: "label", children: [
|
|
14
|
+
/* @__PURE__ */ jsx(
|
|
15
|
+
Box,
|
|
16
|
+
{
|
|
17
|
+
component: "input",
|
|
18
|
+
type: "radio",
|
|
19
|
+
checked: isSelected,
|
|
20
|
+
onChange: (e) => handleRadioSelection == null ? void 0 : handleRadioSelection(rowId, row.original, e),
|
|
21
|
+
value: rowId,
|
|
22
|
+
name: `wmRadioselect-${tableName != null ? tableName : "table"}`,
|
|
23
|
+
"aria-label": radioselectarialabel,
|
|
24
|
+
rowselectinput: ""
|
|
25
|
+
}
|
|
26
|
+
),
|
|
27
|
+
/* @__PURE__ */ jsx(Box, { component: "span", className: "caption" })
|
|
28
|
+
] }) }) }) });
|
|
34
29
|
}
|
|
35
30
|
RadioSelectCell.displayName = "RadioSelectCell";
|
|
36
31
|
function MultiSelectCell(ctx) {
|
|
@@ -23,6 +23,7 @@ import findIndex from "lodash-es/findIndex";
|
|
|
23
23
|
import slice from "lodash-es/slice";
|
|
24
24
|
import forEach from "lodash-es/forEach";
|
|
25
25
|
import some from "lodash-es/some";
|
|
26
|
+
import { addUniqueRowIds } from "./index";
|
|
26
27
|
import { DataSource } from "../../types";
|
|
27
28
|
const getDatasourceInfo = async (datasource) => {
|
|
28
29
|
var _a, _b;
|
|
@@ -56,7 +57,8 @@ const createCompleteRecord = (editingData, wmTableColumns, serverResponse) => {
|
|
|
56
57
|
completeRecord[column.field] = (_b = (_a = editingData[column.field]) != null ? _a : column.defaultvalue) != null ? _b : "";
|
|
57
58
|
}
|
|
58
59
|
});
|
|
59
|
-
|
|
60
|
+
const record = __spreadProps(__spreadValues(__spreadValues({}, completeRecord), serverResponse), { _wmTableRowId: uniqueId("new_row_") });
|
|
61
|
+
return addUniqueRowIds([record])[0];
|
|
60
62
|
};
|
|
61
63
|
const hasValidData = (record) => some(record, (value) => value !== void 0 && value !== null && value !== "");
|
|
62
64
|
const updateDataset = (isNewRow, rowId, editingData, wmTableColumns, serverResponse, options) => {
|
|
@@ -51,9 +51,16 @@ export declare const parseTableActions: (children: React.ReactNode) => WmTableAc
|
|
|
51
51
|
export declare const getRowExpansionConfig: (config: WmTableRowProps | null, rowId: string, rowData?: any) => WmTableRowProps | null;
|
|
52
52
|
/**
|
|
53
53
|
* Whether the expansion column should be reserved in the table layout.
|
|
54
|
-
*
|
|
55
|
-
*
|
|
56
|
-
* row-expansion
|
|
54
|
+
*
|
|
55
|
+
* This is a STRUCTURAL check, matching Angular's datatable: the row-expansion
|
|
56
|
+
* column is part of the table layout whenever a row-expansion config exists and
|
|
57
|
+
* is not statically disabled. Per-row `show` (e.g. a hierarchy `children.length`
|
|
58
|
+
* gate via `tableRowProps`) only controls whether the toggle *button* renders
|
|
59
|
+
* inside the cell — see RowExpansionButton — never whether the column exists.
|
|
60
|
+
*
|
|
61
|
+
* Collapsing the column when no current row happens to be expandable would
|
|
62
|
+
* desynchronise header/body/colgroup cell counts and shift every data column by
|
|
63
|
+
* one for leaf-only datasets (e.g. nested child tables in a hierarchy).
|
|
57
64
|
*/
|
|
58
65
|
export declare const isRowExpansionVisible: (config: WmTableRowProps | null | undefined, dataset: any[] | undefined) => boolean;
|
|
59
66
|
export declare const parseTableRowExpansion: (children: React.ReactNode) => WmTableRowProps | null;
|
|
@@ -369,12 +369,7 @@ const isRowExpansionVisible = (config, dataset) => {
|
|
|
369
369
|
if (!config) return false;
|
|
370
370
|
if (typeof config.tableRowProps === "function") {
|
|
371
371
|
if (!Array.isArray(dataset) || dataset.length === 0) return false;
|
|
372
|
-
return
|
|
373
|
-
var _a;
|
|
374
|
-
const overrides = ((_a = config.tableRowProps) == null ? void 0 : _a.call(config, row)) || {};
|
|
375
|
-
const show = overrides.show !== void 0 ? overrides.show : config.show;
|
|
376
|
-
return show !== false;
|
|
377
|
-
});
|
|
372
|
+
return true;
|
|
378
373
|
}
|
|
379
374
|
return config.show !== false;
|
|
380
375
|
};
|
|
@@ -504,9 +499,11 @@ const shouldShowPagination = ({
|
|
|
504
499
|
datasource,
|
|
505
500
|
showrecordcount = false
|
|
506
501
|
}) => {
|
|
507
|
-
var _a;
|
|
502
|
+
var _a, _b, _c;
|
|
508
503
|
if (!shownavigation) return false;
|
|
509
|
-
|
|
504
|
+
const hasRecords = size(internalDataset) > 0 || ((_a = datasource == null ? void 0 : datasource.pagination) == null ? void 0 : _a.totalElements) > 0 || Boolean((_b = datasource == null ? void 0 : datasource.pagination) == null ? void 0 : _b.next);
|
|
505
|
+
if (!hasRecords) return false;
|
|
506
|
+
if (((_c = datasource == null ? void 0 : datasource.pagination) == null ? void 0 : _c.totalElements) > pagesize) return true;
|
|
510
507
|
if (allowpagesizechange) return true;
|
|
511
508
|
if (showrecordcount) return true;
|
|
512
509
|
return onDemandLoad || size(internalDataset) > pagesize;
|
|
@@ -7,6 +7,18 @@ export declare const hasInteractiveClass: (element: HTMLElement) => boolean;
|
|
|
7
7
|
* Check if an element has interactive attributes
|
|
8
8
|
*/
|
|
9
9
|
export declare const hasInteractiveAttributes: (element: HTMLElement) => boolean;
|
|
10
|
+
/** The name datatable.js and the React table use for a row's multiselect checkbox. */
|
|
11
|
+
export declare const MULTI_SELECT_INPUT_NAME = "gridMultiSelect";
|
|
12
|
+
/**
|
|
13
|
+
* True when the clicked row's selection checkbox has been renamed away from
|
|
14
|
+
* `gridMultiSelect`.
|
|
15
|
+
*
|
|
16
|
+
* Mirrors the Angular datatable, whose toggleRowSelection only ever acts on
|
|
17
|
+
* `input[name="gridMultiSelect"]`, so application code that renames the input
|
|
18
|
+
* (e.g. to "gridMultiSelectDisable") opts that row out of click selection.
|
|
19
|
+
* Rows without a selection checkbox are never treated as renamed.
|
|
20
|
+
*/
|
|
21
|
+
export declare const isSelectionCheckboxRenamed: (event: React.MouseEvent) => boolean;
|
|
10
22
|
/**
|
|
11
23
|
* Check if element or its ancestors are interactive
|
|
12
24
|
*/
|
|
@@ -33,6 +33,14 @@ const hasInteractiveAttributes = (element) => {
|
|
|
33
33
|
}
|
|
34
34
|
return false;
|
|
35
35
|
};
|
|
36
|
+
const MULTI_SELECT_INPUT_NAME = "gridMultiSelect";
|
|
37
|
+
const isSelectionCheckboxRenamed = (event) => {
|
|
38
|
+
var _a, _b;
|
|
39
|
+
const target = event == null ? void 0 : event.target;
|
|
40
|
+
const row = (_a = target == null ? void 0 : target.closest) == null ? void 0 : _a.call(target, "tr");
|
|
41
|
+
const checkbox = (_b = row == null ? void 0 : row.querySelector) == null ? void 0 : _b.call(row, 'input[type="checkbox"]');
|
|
42
|
+
return !!checkbox && checkbox.getAttribute("name") !== MULTI_SELECT_INPUT_NAME;
|
|
43
|
+
};
|
|
36
44
|
const isInteractiveElement = (event) => {
|
|
37
45
|
const target = event.target;
|
|
38
46
|
if (INTERACTIVE_TAG_NAMES.includes(target.tagName)) {
|
|
@@ -126,12 +134,14 @@ const selectionStateHelpers = {
|
|
|
126
134
|
}
|
|
127
135
|
};
|
|
128
136
|
export {
|
|
137
|
+
MULTI_SELECT_INPUT_NAME,
|
|
129
138
|
createSelectionEventStub,
|
|
130
139
|
getRowIdsFromDataset,
|
|
131
140
|
getWidgetForCallback,
|
|
132
141
|
hasInteractiveAttributes,
|
|
133
142
|
hasInteractiveClass,
|
|
134
143
|
isInteractiveElement,
|
|
144
|
+
isSelectionCheckboxRenamed,
|
|
135
145
|
rowExistsInDataset,
|
|
136
146
|
selectionStateHelpers,
|
|
137
147
|
toNativeEvent
|
|
@@ -29,6 +29,7 @@ declare const WmAlertDialogStandalone: {
|
|
|
29
29
|
width?: number | string;
|
|
30
30
|
height?: number | string;
|
|
31
31
|
className?: string;
|
|
32
|
+
class?: string;
|
|
32
33
|
conditionalstyle?: React.CSSProperties;
|
|
33
34
|
conditionalclass?: string;
|
|
34
35
|
showindevice?: ("xs" | "sm" | "md" | "lg" | "all")[];
|
|
@@ -115,6 +116,7 @@ declare const _default: {
|
|
|
115
116
|
width?: number | string;
|
|
116
117
|
height?: number | string;
|
|
117
118
|
className?: string;
|
|
119
|
+
class?: string;
|
|
118
120
|
conditionalstyle?: React.CSSProperties;
|
|
119
121
|
conditionalclass?: string;
|
|
120
122
|
showindevice?: ("xs" | "sm" | "md" | "lg" | "all")[];
|
|
@@ -30,6 +30,7 @@ declare const WmConfirmDialogStandalone: {
|
|
|
30
30
|
width?: number | string;
|
|
31
31
|
height?: number | string;
|
|
32
32
|
className?: string;
|
|
33
|
+
class?: string;
|
|
33
34
|
conditionalstyle?: React.CSSProperties;
|
|
34
35
|
conditionalclass?: string;
|
|
35
36
|
showindevice?: ("xs" | "sm" | "md" | "lg" | "all")[];
|
|
@@ -117,6 +118,7 @@ declare const _default: {
|
|
|
117
118
|
width?: number | string;
|
|
118
119
|
height?: number | string;
|
|
119
120
|
className?: string;
|
|
121
|
+
class?: string;
|
|
120
122
|
conditionalstyle?: React.CSSProperties;
|
|
121
123
|
conditionalclass?: string;
|
|
122
124
|
showindevice?: ("xs" | "sm" | "md" | "lg" | "all")[];
|
|
@@ -34,6 +34,7 @@ declare const WmDialogStandalone: {
|
|
|
34
34
|
width?: number | string;
|
|
35
35
|
height?: number | string;
|
|
36
36
|
className?: string;
|
|
37
|
+
class?: string;
|
|
37
38
|
conditionalstyle?: import("react").CSSProperties;
|
|
38
39
|
conditionalclass?: string;
|
|
39
40
|
showindevice?: ("xs" | "sm" | "md" | "lg" | "all")[];
|
|
@@ -127,6 +128,7 @@ declare const _default: {
|
|
|
127
128
|
width?: number | string;
|
|
128
129
|
height?: number | string;
|
|
129
130
|
className?: string;
|
|
131
|
+
class?: string;
|
|
130
132
|
conditionalstyle?: import("react").CSSProperties;
|
|
131
133
|
conditionalclass?: string;
|
|
132
134
|
showindevice?: ("xs" | "sm" | "md" | "lg" | "all")[];
|
|
@@ -24,6 +24,7 @@ declare const _default: import("react").ComponentType<{
|
|
|
24
24
|
width?: number | string;
|
|
25
25
|
height?: number | string;
|
|
26
26
|
className?: string;
|
|
27
|
+
class?: string;
|
|
27
28
|
conditionalstyle?: import("react").CSSProperties;
|
|
28
29
|
conditionalclass?: string;
|
|
29
30
|
showindevice?: ("xs" | "sm" | "md" | "lg" | "all")[];
|
|
@@ -23,6 +23,7 @@ declare const _default: import("react").ComponentType<{
|
|
|
23
23
|
width?: number | string;
|
|
24
24
|
height?: number | string;
|
|
25
25
|
className?: string;
|
|
26
|
+
class?: string;
|
|
26
27
|
conditionalstyle?: import("react").CSSProperties;
|
|
27
28
|
conditionalclass?: string;
|
|
28
29
|
showindevice?: ("xs" | "sm" | "md" | "lg" | "all")[];
|
|
@@ -26,6 +26,7 @@ declare const _default: import("react").ComponentType<{
|
|
|
26
26
|
width?: number | string;
|
|
27
27
|
height?: number | string;
|
|
28
28
|
className?: string;
|
|
29
|
+
class?: string;
|
|
29
30
|
conditionalstyle?: import("react").CSSProperties;
|
|
30
31
|
conditionalclass?: string;
|
|
31
32
|
showindevice?: ("xs" | "sm" | "md" | "lg" | "all")[];
|
|
@@ -40,6 +40,7 @@ declare const _default: React.ComponentType<{
|
|
|
40
40
|
width?: number | string;
|
|
41
41
|
height?: number | string;
|
|
42
42
|
className?: string;
|
|
43
|
+
class?: string;
|
|
43
44
|
conditionalstyle?: React.CSSProperties;
|
|
44
45
|
conditionalclass?: string;
|
|
45
46
|
showindevice?: ("xs" | "sm" | "md" | "lg" | "all")[];
|