@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
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useCallback, useEffect, useRef, useState } from "react";
|
|
2
|
-
import { cleanRowData } from "../utils";
|
|
2
|
+
import { cleanRowData, getRowExpansionConfig } from "../utils";
|
|
3
3
|
const useRowExpansion = ({
|
|
4
4
|
rowExpansionConfig,
|
|
5
5
|
internalDataset
|
|
@@ -8,36 +8,48 @@ const useRowExpansion = ({
|
|
|
8
8
|
const expandedRowsRef = useRef(expandedRows);
|
|
9
9
|
const rowDefInstancesRef = useRef({});
|
|
10
10
|
const pendingRowExpandRef = useRef(/* @__PURE__ */ new Set());
|
|
11
|
+
const indexExpandedInstances = useCallback(() => {
|
|
12
|
+
const instances = rowDefInstancesRef.current;
|
|
13
|
+
Object.keys(instances).forEach((key) => {
|
|
14
|
+
if (/^\d+$/.test(key)) delete instances[key];
|
|
15
|
+
});
|
|
16
|
+
Array.from(expandedRowsRef.current).forEach((rowId, index) => {
|
|
17
|
+
if (instances[rowId]) instances[index] = instances[rowId];
|
|
18
|
+
});
|
|
19
|
+
}, []);
|
|
11
20
|
useEffect(() => {
|
|
12
21
|
expandedRowsRef.current = expandedRows;
|
|
13
|
-
|
|
22
|
+
indexExpandedInstances();
|
|
23
|
+
}, [expandedRows, indexExpandedInstances]);
|
|
14
24
|
useEffect(() => {
|
|
15
|
-
|
|
16
|
-
Object.keys(instances).forEach((k) => delete instances[k]);
|
|
25
|
+
rowDefInstancesRef.current = {};
|
|
17
26
|
pendingRowExpandRef.current = /* @__PURE__ */ new Set();
|
|
18
27
|
}, [internalDataset]);
|
|
19
28
|
const registerRowDefInstance = useCallback(
|
|
20
29
|
(rowId, instance, rowData) => {
|
|
21
30
|
rowDefInstancesRef.current[rowId] = instance;
|
|
22
|
-
|
|
31
|
+
indexExpandedInstances();
|
|
32
|
+
if ((rowExpansionConfig == null ? void 0 : rowExpansionConfig.closeothers) || pendingRowExpandRef.current.has(rowId) && expandedRowsRef.current.has(rowId)) {
|
|
23
33
|
pendingRowExpandRef.current.delete(rowId);
|
|
24
34
|
if (rowExpansionConfig == null ? void 0 : rowExpansionConfig.onRowexpand) {
|
|
25
35
|
setTimeout(() => {
|
|
26
36
|
var _a;
|
|
27
37
|
(_a = rowExpansionConfig.onRowexpand) == null ? void 0 : _a.call(rowExpansionConfig, {}, {}, cleanRowData(rowData), instance);
|
|
28
|
-
},
|
|
38
|
+
}, 0);
|
|
29
39
|
}
|
|
30
40
|
}
|
|
31
41
|
},
|
|
32
|
-
[rowExpansionConfig]
|
|
42
|
+
[rowExpansionConfig, indexExpandedInstances]
|
|
33
43
|
);
|
|
34
44
|
const toggleRowExpansion = useCallback(
|
|
35
45
|
(rowId, rowData) => {
|
|
36
46
|
var _a, _b;
|
|
37
|
-
if (!rowExpansionConfig
|
|
47
|
+
if (!rowExpansionConfig) return;
|
|
48
|
+
const rowConfig = getRowExpansionConfig(rowExpansionConfig, rowId, rowData);
|
|
49
|
+
if (!(rowConfig == null ? void 0 : rowConfig.show)) return;
|
|
38
50
|
const isCurrentlyExpanded = expandedRowsRef.current.has(rowId);
|
|
39
51
|
if (!isCurrentlyExpanded) {
|
|
40
|
-
if (
|
|
52
|
+
if (rowConfig.onBeforerowexpand) {
|
|
41
53
|
let defaultPrevented = false;
|
|
42
54
|
const event = {
|
|
43
55
|
preventDefault: () => {
|
|
@@ -47,8 +59,8 @@ const useRowExpansion = ({
|
|
|
47
59
|
return defaultPrevented;
|
|
48
60
|
}
|
|
49
61
|
};
|
|
50
|
-
(_a =
|
|
51
|
-
|
|
62
|
+
(_a = rowConfig.onBeforerowexpand) == null ? void 0 : _a.call(
|
|
63
|
+
rowConfig,
|
|
52
64
|
event,
|
|
53
65
|
{},
|
|
54
66
|
cleanRowData(rowData),
|
|
@@ -58,33 +70,31 @@ const useRowExpansion = ({
|
|
|
58
70
|
}
|
|
59
71
|
setExpandedRows((prev) => {
|
|
60
72
|
const newExpandedRows = new Set(prev);
|
|
61
|
-
if (
|
|
73
|
+
if (rowConfig.closeothers) {
|
|
62
74
|
newExpandedRows.forEach((otherId) => {
|
|
63
75
|
pendingRowExpandRef.current.delete(otherId);
|
|
64
76
|
});
|
|
65
77
|
newExpandedRows.clear();
|
|
66
78
|
}
|
|
67
79
|
newExpandedRows.add(rowId);
|
|
68
|
-
if (
|
|
80
|
+
if (rowConfig.renderPartial) {
|
|
69
81
|
pendingRowExpandRef.current.add(rowId);
|
|
70
|
-
} else {
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
}, 0);
|
|
82
|
-
}
|
|
82
|
+
} else if (rowConfig.onRowexpand) {
|
|
83
|
+
setTimeout(() => {
|
|
84
|
+
var _a2;
|
|
85
|
+
(_a2 = rowConfig.onRowexpand) == null ? void 0 : _a2.call(
|
|
86
|
+
rowConfig,
|
|
87
|
+
{},
|
|
88
|
+
{},
|
|
89
|
+
cleanRowData(rowData),
|
|
90
|
+
rowDefInstancesRef.current[rowId] || {}
|
|
91
|
+
);
|
|
92
|
+
}, 0);
|
|
83
93
|
}
|
|
84
94
|
return newExpandedRows;
|
|
85
95
|
});
|
|
86
96
|
} else {
|
|
87
|
-
if (
|
|
97
|
+
if (rowConfig.onBeforerowcollapse) {
|
|
88
98
|
let defaultPrevented = false;
|
|
89
99
|
const event = {
|
|
90
100
|
preventDefault: () => {
|
|
@@ -94,8 +104,8 @@ const useRowExpansion = ({
|
|
|
94
104
|
return defaultPrevented;
|
|
95
105
|
}
|
|
96
106
|
};
|
|
97
|
-
(_b =
|
|
98
|
-
|
|
107
|
+
(_b = rowConfig.onBeforerowcollapse) == null ? void 0 : _b.call(
|
|
108
|
+
rowConfig,
|
|
99
109
|
event,
|
|
100
110
|
{},
|
|
101
111
|
cleanRowData(rowData),
|
|
@@ -107,10 +117,10 @@ const useRowExpansion = ({
|
|
|
107
117
|
const newExpandedRows = new Set(prev);
|
|
108
118
|
newExpandedRows.delete(rowId);
|
|
109
119
|
pendingRowExpandRef.current.delete(rowId);
|
|
110
|
-
if (
|
|
120
|
+
if (rowConfig.onRowcollapse) {
|
|
111
121
|
setTimeout(() => {
|
|
112
122
|
var _a2;
|
|
113
|
-
(_a2 =
|
|
123
|
+
(_a2 = rowConfig.onRowcollapse) == null ? void 0 : _a2.call(rowConfig, {}, {}, cleanRowData(rowData));
|
|
114
124
|
}, 0);
|
|
115
125
|
}
|
|
116
126
|
return newExpandedRows;
|
|
@@ -39,7 +39,8 @@ import {
|
|
|
39
39
|
createRowIndexColumn,
|
|
40
40
|
createDataColumns,
|
|
41
41
|
createEditingActionButtons,
|
|
42
|
-
getActionColumnSize
|
|
42
|
+
getActionColumnSize,
|
|
43
|
+
ActionCell
|
|
43
44
|
} from "../utils/columnBuilder";
|
|
44
45
|
import { distributeColumnWidths } from "../utils/columnWidthDistribution";
|
|
45
46
|
import { useResponsiveColumns } from "./useResponsiveColumns";
|
|
@@ -208,13 +209,16 @@ const useTableColumns = ({
|
|
|
208
209
|
const rowId = ((_a = row == null ? void 0 : row.original) == null ? void 0 : _a._wmTableRowId) || (row == null ? void 0 : row.id);
|
|
209
210
|
const isEditingThisRow = isRowEditing(rowId);
|
|
210
211
|
const shouldRenderEditableCell = (editmode === "inline" || editmode === "quickedit") && isEditingThisRow && !wmColumn.readonly;
|
|
211
|
-
return /* @__PURE__ */ jsx(
|
|
212
|
+
return /* @__PURE__ */ jsx("span", { "data-col-identifier": wmColumn.field, children: shouldRenderEditableCell ? renderEditableCell(wmColumn, row.original, rowId) : renderDisplayCell(wmColumn, row.original, listener, cellState) });
|
|
212
213
|
},
|
|
213
|
-
[editmode,
|
|
214
|
+
[editmode, isRowEditing, renderEditableCell, cellState]
|
|
214
215
|
);
|
|
215
216
|
const filteredRowActions = useMemo(() => {
|
|
216
217
|
if (editmode === "quickedit") {
|
|
217
|
-
return filter(
|
|
218
|
+
return filter(
|
|
219
|
+
rowActions,
|
|
220
|
+
(action) => action.key === "deleterow" || action.action === "delete" || action.key === "updaterow"
|
|
221
|
+
);
|
|
218
222
|
}
|
|
219
223
|
return rowActions;
|
|
220
224
|
}, [rowActions, editmode]);
|
|
@@ -256,7 +260,6 @@ const useTableColumns = ({
|
|
|
256
260
|
saveEditing,
|
|
257
261
|
cancelEditing,
|
|
258
262
|
deleteRowAction,
|
|
259
|
-
listener,
|
|
260
263
|
selectionHandlers
|
|
261
264
|
]
|
|
262
265
|
);
|
|
@@ -277,13 +280,15 @@ const useTableColumns = ({
|
|
|
277
280
|
size: columnSize,
|
|
278
281
|
minSize,
|
|
279
282
|
enableResizing: true,
|
|
280
|
-
cell:
|
|
283
|
+
cell: ActionCell,
|
|
281
284
|
enableSorting: manualActionColumn.sortable !== false,
|
|
282
|
-
meta: __spreadValues({
|
|
285
|
+
meta: __spreadProps(__spreadValues({
|
|
283
286
|
textAlign: manualActionColumn.textalignment,
|
|
284
287
|
backgroundColor: manualActionColumn.backgroundcolor,
|
|
285
288
|
className: manualActionColumn.colClass
|
|
286
|
-
}, manualActionColumn.styles)
|
|
289
|
+
}, manualActionColumn.styles), {
|
|
290
|
+
_actions: { renderActionCell }
|
|
291
|
+
})
|
|
287
292
|
};
|
|
288
293
|
} else if (rowActions.length > 0 && (isDynamicTable || editmode !== "none")) {
|
|
289
294
|
return {
|
|
@@ -293,7 +298,10 @@ const useTableColumns = ({
|
|
|
293
298
|
minSize,
|
|
294
299
|
maxSize: size,
|
|
295
300
|
enableResizing: false,
|
|
296
|
-
cell:
|
|
301
|
+
cell: ActionCell,
|
|
302
|
+
meta: {
|
|
303
|
+
_actions: { renderActionCell }
|
|
304
|
+
}
|
|
297
305
|
};
|
|
298
306
|
}
|
|
299
307
|
return null;
|
|
@@ -1,3 +1,22 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __defProps = Object.defineProperties;
|
|
3
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
+
var __spreadValues = (a, b) => {
|
|
9
|
+
for (var prop in b || (b = {}))
|
|
10
|
+
if (__hasOwnProp.call(b, prop))
|
|
11
|
+
__defNormalProp(a, prop, b[prop]);
|
|
12
|
+
if (__getOwnPropSymbols)
|
|
13
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
+
if (__propIsEnum.call(b, prop))
|
|
15
|
+
__defNormalProp(a, prop, b[prop]);
|
|
16
|
+
}
|
|
17
|
+
return a;
|
|
18
|
+
};
|
|
19
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
1
20
|
import React, { useState, useCallback, useRef, useMemo, useEffect } from "react";
|
|
2
21
|
import { isEqual } from "lodash-es";
|
|
3
22
|
import { addUniqueRowIds, extractDataArray, TABLE_MESSAGES, INTERNAL_PROPERTIES } from "../utils";
|
|
@@ -39,8 +58,18 @@ const useTableData = ({
|
|
|
39
58
|
listener,
|
|
40
59
|
widgetName
|
|
41
60
|
}) => {
|
|
61
|
+
const rowIdCacheRef = useRef([]);
|
|
42
62
|
const processedDataset = useMemo(() => {
|
|
43
|
-
const
|
|
63
|
+
const extracted = extractDataArray(dataset);
|
|
64
|
+
const cachedIds = rowIdCacheRef.current;
|
|
65
|
+
const prestamped = extracted.map((item, i) => {
|
|
66
|
+
if (!item || typeof item !== "object" || item._wmTableRowId || item.id || item.ID || item.Id || !cachedIds[i]) {
|
|
67
|
+
return item;
|
|
68
|
+
}
|
|
69
|
+
return __spreadProps(__spreadValues({}, item), { _wmTableRowId: cachedIds[i] });
|
|
70
|
+
});
|
|
71
|
+
const withIds = addUniqueRowIds(prestamped);
|
|
72
|
+
rowIdCacheRef.current = withIds.map((r) => r == null ? void 0 : r._wmTableRowId);
|
|
44
73
|
return removeEmptyRecords(withIds);
|
|
45
74
|
}, [dataset]);
|
|
46
75
|
const [internalDataset, setInternalDataset] = useState(processedDataset);
|
|
@@ -89,7 +118,6 @@ const useTableData = ({
|
|
|
89
118
|
deletemessage,
|
|
90
119
|
errormessage,
|
|
91
120
|
isServerSidePagination,
|
|
92
|
-
listener,
|
|
93
121
|
widgetName
|
|
94
122
|
]);
|
|
95
123
|
const handleCancelDelete = useCallback(() => {
|
|
@@ -26,6 +26,7 @@ declare const WmTableStandalone: React.ComponentType<{
|
|
|
26
26
|
title?: string;
|
|
27
27
|
subheading?: string;
|
|
28
28
|
iconclass?: string;
|
|
29
|
+
iconurl?: string;
|
|
29
30
|
dataset?: any;
|
|
30
31
|
navigation?: import("../list/props").INavigation;
|
|
31
32
|
isdynamictable?: boolean;
|
|
@@ -141,6 +142,7 @@ declare const WmTableStandalone: React.ComponentType<{
|
|
|
141
142
|
prefabName?: string;
|
|
142
143
|
loading?: boolean;
|
|
143
144
|
showSkeleton?: boolean;
|
|
145
|
+
widget?: string;
|
|
144
146
|
} & import("@wavemaker-ai/react-runtime/higherOrder/withStandalone").WithStandaloneProps>;
|
|
145
147
|
export { WmTableStandalone as WmTable };
|
|
146
148
|
declare const WmTable: React.ComponentType<{
|
|
@@ -167,6 +169,7 @@ declare const WmTable: React.ComponentType<{
|
|
|
167
169
|
title?: string;
|
|
168
170
|
subheading?: string;
|
|
169
171
|
iconclass?: string;
|
|
172
|
+
iconurl?: string;
|
|
170
173
|
dataset?: any;
|
|
171
174
|
navigation?: import("../list/props").INavigation;
|
|
172
175
|
isdynamictable?: boolean;
|
|
@@ -282,6 +285,7 @@ declare const WmTable: React.ComponentType<{
|
|
|
282
285
|
prefabName?: string;
|
|
283
286
|
loading?: boolean;
|
|
284
287
|
showSkeleton?: boolean;
|
|
288
|
+
widget?: string;
|
|
285
289
|
}>;
|
|
286
290
|
/**
|
|
287
291
|
* The WmTable component is used to display data in a tabular format.
|
|
@@ -35,6 +35,7 @@ import React, {
|
|
|
35
35
|
memo,
|
|
36
36
|
useCallback,
|
|
37
37
|
useEffect,
|
|
38
|
+
useLayoutEffect,
|
|
38
39
|
useMemo,
|
|
39
40
|
useState,
|
|
40
41
|
useRef
|
|
@@ -42,7 +43,7 @@ import React, {
|
|
|
42
43
|
import {
|
|
43
44
|
WmSkeleton,
|
|
44
45
|
SKELETON_REGISTRY,
|
|
45
|
-
|
|
46
|
+
useShouldShowSkeleton
|
|
46
47
|
} from "../../common/wm-skeleton";
|
|
47
48
|
import {
|
|
48
49
|
useReactTable,
|
|
@@ -88,9 +89,14 @@ import {
|
|
|
88
89
|
saveTableState,
|
|
89
90
|
clearTableState,
|
|
90
91
|
addUniqueRowIds,
|
|
91
|
-
cleanRowData
|
|
92
|
+
cleanRowData,
|
|
93
|
+
getDomHiddenColStyle
|
|
92
94
|
} from "./utils";
|
|
93
95
|
import { hasTableGroups } from "./utils/groupHeaderUtils";
|
|
96
|
+
import {
|
|
97
|
+
buildExpansionColSpec,
|
|
98
|
+
getExpansionColumnInsertIndex
|
|
99
|
+
} from "./utils/expansionColumn";
|
|
94
100
|
import { handleNewRowNavigation } from "./utils";
|
|
95
101
|
import {
|
|
96
102
|
TablePanelHeading,
|
|
@@ -134,6 +140,7 @@ const WmTableComponent = memo(
|
|
|
134
140
|
title,
|
|
135
141
|
subheading,
|
|
136
142
|
iconclass,
|
|
143
|
+
iconurl,
|
|
137
144
|
exportOptions = [],
|
|
138
145
|
shownavigation = true,
|
|
139
146
|
onDemandLoad = false,
|
|
@@ -214,6 +221,7 @@ const WmTableComponent = memo(
|
|
|
214
221
|
"title",
|
|
215
222
|
"subheading",
|
|
216
223
|
"iconclass",
|
|
224
|
+
"iconurl",
|
|
217
225
|
"exportOptions",
|
|
218
226
|
"shownavigation",
|
|
219
227
|
"onDemandLoad",
|
|
@@ -470,14 +478,7 @@ const WmTableComponent = memo(
|
|
|
470
478
|
children,
|
|
471
479
|
listener
|
|
472
480
|
});
|
|
473
|
-
const {
|
|
474
|
-
wmTableColumns,
|
|
475
|
-
tableStructure,
|
|
476
|
-
rowActions,
|
|
477
|
-
headerActions,
|
|
478
|
-
footerActions,
|
|
479
|
-
rowExpansionConfig
|
|
480
|
-
} = useMemo(() => {
|
|
481
|
+
const { wmTableColumns, tableStructure, headerActions, footerActions, rowExpansionConfig } = useMemo(() => {
|
|
481
482
|
const allTableActions = parseTableActions(children);
|
|
482
483
|
const headerActions2 = allTableActions.filter((action) => {
|
|
483
484
|
const position = action.position || "footer";
|
|
@@ -495,13 +496,13 @@ const WmTableComponent = memo(
|
|
|
495
496
|
return {
|
|
496
497
|
wmTableColumns: finalColumns,
|
|
497
498
|
tableStructure: structure,
|
|
498
|
-
rowActions: parseTableRowActions(children),
|
|
499
499
|
tableActions: allTableActions,
|
|
500
500
|
headerActions: headerActions2,
|
|
501
501
|
footerActions: footerActions2,
|
|
502
502
|
rowExpansionConfig: parseTableRowExpansion(children)
|
|
503
503
|
};
|
|
504
504
|
}, [children, internalDataset, isDynamicTable, dynamicColumns]);
|
|
505
|
+
const rowActions = useMemo(() => parseTableRowActions(children), [children]);
|
|
505
506
|
const [columnsVersion, setColumnsVersion] = useState(0);
|
|
506
507
|
const [columnOverrides, setColumnOverrides] = useState(
|
|
507
508
|
{}
|
|
@@ -555,7 +556,7 @@ const WmTableComponent = memo(
|
|
|
555
556
|
updatemessage,
|
|
556
557
|
errormessage,
|
|
557
558
|
showToast,
|
|
558
|
-
hasRowExpansion: rowExpansionConfig ?
|
|
559
|
+
hasRowExpansion: rowExpansionConfig ? true : false,
|
|
559
560
|
expansionPosition: rowExpansionConfig ? parseInt(String(rowExpansionConfig.position || "0"), 10) : 0,
|
|
560
561
|
datasource,
|
|
561
562
|
binddataset,
|
|
@@ -683,11 +684,9 @@ const WmTableComponent = memo(
|
|
|
683
684
|
const selectionColumn = buildSelectionColumns({
|
|
684
685
|
useRadioSelect,
|
|
685
686
|
useMultiSelect,
|
|
686
|
-
selectedRowIds,
|
|
687
687
|
handleRadioSelection,
|
|
688
688
|
handleMultiSelection,
|
|
689
689
|
handleSelectAll,
|
|
690
|
-
internalDataset,
|
|
691
690
|
radioselecttitle,
|
|
692
691
|
radioselectarialabel,
|
|
693
692
|
multiselecttitle,
|
|
@@ -702,8 +701,6 @@ const WmTableComponent = memo(
|
|
|
702
701
|
baseColumns,
|
|
703
702
|
useRadioSelect,
|
|
704
703
|
useMultiSelect,
|
|
705
|
-
selectedRowIds,
|
|
706
|
-
internalDataset,
|
|
707
704
|
handleRadioSelection,
|
|
708
705
|
handleMultiSelection,
|
|
709
706
|
handleSelectAll,
|
|
@@ -758,6 +755,20 @@ const WmTableComponent = memo(
|
|
|
758
755
|
columnSource: columnsProxy,
|
|
759
756
|
listenerRef
|
|
760
757
|
});
|
|
758
|
+
const [pendingDatarender, setPendingDatarender] = useState(false);
|
|
759
|
+
const queueOnDatarenderAfterPaint = useCallback(() => {
|
|
760
|
+
if (!onDatarender) return;
|
|
761
|
+
setPendingDatarender(true);
|
|
762
|
+
}, [onDatarender]);
|
|
763
|
+
const invokeOnDatarender = useCallback(() => {
|
|
764
|
+
var _a2;
|
|
765
|
+
if (!onDatarender) return;
|
|
766
|
+
if (name && (listener == null ? void 0 : listener.Widgets[name]) && tableContainerRef.current) {
|
|
767
|
+
listener.Widgets[name].nativeElement = tableContainerRef.current;
|
|
768
|
+
}
|
|
769
|
+
const data = internalDataset;
|
|
770
|
+
onDatarender((_a2 = listener == null ? void 0 : listener.Widgets) == null ? void 0 : _a2[name], { $data: data, data });
|
|
771
|
+
}, [onDatarender, name]);
|
|
761
772
|
columnsStateRef.current = columns;
|
|
762
773
|
const columnsForTable = useMemo(() => {
|
|
763
774
|
const base = columnsStateRef.current || [];
|
|
@@ -766,7 +777,7 @@ const WmTableComponent = memo(
|
|
|
766
777
|
const override = field ? columnOverrides[field] || {} : {};
|
|
767
778
|
return __spreadValues(__spreadValues(__spreadValues({}, col), override), Object.keys(override).length > 0 ? { meta: __spreadValues(__spreadValues({}, col.meta), override) } : {});
|
|
768
779
|
});
|
|
769
|
-
}, [columns, columnOverrides, columnsVersion
|
|
780
|
+
}, [columns, columnOverrides, columnsVersion]);
|
|
770
781
|
const ColClassSignature = useMemo(() => {
|
|
771
782
|
try {
|
|
772
783
|
return (columnsForTable || []).map((col) => {
|
|
@@ -943,7 +954,7 @@ const WmTableComponent = memo(
|
|
|
943
954
|
listener.Widgets[name].dataNavigator = paginationWidget;
|
|
944
955
|
}
|
|
945
956
|
},
|
|
946
|
-
[name
|
|
957
|
+
[name]
|
|
947
958
|
);
|
|
948
959
|
const sortInfoForExport = useMemo(() => {
|
|
949
960
|
if (sorting.length > 0) {
|
|
@@ -1086,11 +1097,18 @@ const WmTableComponent = memo(
|
|
|
1086
1097
|
prevPageIndexRef.current = currentPageIndex;
|
|
1087
1098
|
if (!isEqual(prevDatasetRef.current, internalDataset)) {
|
|
1088
1099
|
prevDatasetRef.current = internalDataset;
|
|
1100
|
+
const data = internalDataset.map((row) => {
|
|
1101
|
+
if (row && typeof row === "object") {
|
|
1102
|
+
const _a3 = row, { _wmTableRowId, getProperty } = _a3, rest2 = __objRest(_a3, ["_wmTableRowId", "getProperty"]);
|
|
1103
|
+
return rest2;
|
|
1104
|
+
}
|
|
1105
|
+
return row;
|
|
1106
|
+
});
|
|
1089
1107
|
if (onBeforedatarender) {
|
|
1090
1108
|
onBeforedatarender(
|
|
1091
1109
|
(_a2 = listener == null ? void 0 : listener.Widgets) == null ? void 0 : _a2[name],
|
|
1092
1110
|
// widget reference
|
|
1093
|
-
|
|
1111
|
+
data,
|
|
1094
1112
|
// data
|
|
1095
1113
|
columnsProxy
|
|
1096
1114
|
// columns (including dynamic ones)
|
|
@@ -1099,28 +1117,17 @@ const WmTableComponent = memo(
|
|
|
1099
1117
|
(key) => columnsProxy[key].customExpression
|
|
1100
1118
|
);
|
|
1101
1119
|
if (customExprKeys.length > 0) {
|
|
1102
|
-
void mergeParsedCustomColumns().finally(
|
|
1103
|
-
|
|
1120
|
+
void mergeParsedCustomColumns().finally(queueOnDatarenderAfterPaint);
|
|
1121
|
+
} else {
|
|
1122
|
+
queueOnDatarenderAfterPaint();
|
|
1104
1123
|
}
|
|
1105
1124
|
const nextRows = internalDataset.map(
|
|
1106
1125
|
(r) => typeof r === "object" && r !== null ? __spreadValues({}, r) : r
|
|
1107
1126
|
);
|
|
1108
1127
|
setInternalDataset(nextRows);
|
|
1128
|
+
} else if (onDatarender) {
|
|
1129
|
+
queueOnDatarenderAfterPaint();
|
|
1109
1130
|
}
|
|
1110
|
-
requestAnimationFrame(() => {
|
|
1111
|
-
var _a3;
|
|
1112
|
-
if (onDatarender) {
|
|
1113
|
-
if (name && (listener == null ? void 0 : listener.Widgets[name]) && tableContainerRef.current) {
|
|
1114
|
-
listener.Widgets[name].nativeElement = tableContainerRef.current;
|
|
1115
|
-
}
|
|
1116
|
-
onDatarender(
|
|
1117
|
-
(_a3 = listener == null ? void 0 : listener.Widgets) == null ? void 0 : _a3[name],
|
|
1118
|
-
// widget reference to match Angular format
|
|
1119
|
-
{ $data: internalDataset, data: internalDataset }
|
|
1120
|
-
// match Angular's format with both $data and data
|
|
1121
|
-
);
|
|
1122
|
-
}
|
|
1123
|
-
});
|
|
1124
1131
|
}
|
|
1125
1132
|
}
|
|
1126
1133
|
}, [
|
|
@@ -1133,8 +1140,14 @@ const WmTableComponent = memo(
|
|
|
1133
1140
|
table.getState().pagination.pageIndex,
|
|
1134
1141
|
setInternalDataset,
|
|
1135
1142
|
columnsProxy,
|
|
1136
|
-
mergeParsedCustomColumns
|
|
1143
|
+
mergeParsedCustomColumns,
|
|
1144
|
+
queueOnDatarenderAfterPaint
|
|
1137
1145
|
]);
|
|
1146
|
+
useLayoutEffect(() => {
|
|
1147
|
+
if (!onDatarender || !pendingDatarender) return;
|
|
1148
|
+
setPendingDatarender(false);
|
|
1149
|
+
invokeOnDatarender();
|
|
1150
|
+
}, [pendingDatarender, invokeOnDatarender, onDatarender]);
|
|
1138
1151
|
useEffect(() => {
|
|
1139
1152
|
if (!onBeforedatarender) return;
|
|
1140
1153
|
if (internalDataset.length === 0) return;
|
|
@@ -1260,7 +1273,7 @@ const WmTableComponent = memo(
|
|
|
1260
1273
|
}
|
|
1261
1274
|
deleteRecord(row, tableRef.current);
|
|
1262
1275
|
},
|
|
1263
|
-
[deleteRecord, onBeforerowdelete,
|
|
1276
|
+
[deleteRecord, onBeforerowdelete, name, internalDataset]
|
|
1264
1277
|
);
|
|
1265
1278
|
const refresh = useCallback(
|
|
1266
1279
|
async (newData = false) => {
|
|
@@ -1404,18 +1417,48 @@ const WmTableComponent = memo(
|
|
|
1404
1417
|
const headerGroups = table.getHeaderGroups();
|
|
1405
1418
|
const leafHeaderGroup = headerGroups.length ? headerGroups[headerGroups.length - 1] : void 0;
|
|
1406
1419
|
const leafHeaders = ((leafHeaderGroup == null ? void 0 : leafHeaderGroup.headers) || []).filter((h) => !h.isPlaceholder);
|
|
1407
|
-
const base = leafHeaders.map((h) =>
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1420
|
+
const base = leafHeaders.map((h) => {
|
|
1421
|
+
const meta = h.column.columnDef.meta;
|
|
1422
|
+
const hiddenColStyle = getDomHiddenColStyle(meta);
|
|
1423
|
+
const w = `${h.column.getSize()}px`;
|
|
1424
|
+
return {
|
|
1425
|
+
key: h.column.id,
|
|
1426
|
+
width: hiddenColStyle ? void 0 : w,
|
|
1427
|
+
style: hiddenColStyle != null ? hiddenColStyle : { width: w },
|
|
1428
|
+
domHidden: !!hiddenColStyle
|
|
1429
|
+
};
|
|
1430
|
+
});
|
|
1431
|
+
if (rowExpansionConfig) {
|
|
1432
|
+
const expansionInsertIndex = getExpansionColumnInsertIndex(
|
|
1433
|
+
leafHeaders,
|
|
1434
|
+
rowExpansionConfig,
|
|
1435
|
+
{
|
|
1436
|
+
appendForGroupedTable: !!(tableStructure && hasTableGroups(tableStructure))
|
|
1437
|
+
}
|
|
1438
|
+
);
|
|
1439
|
+
if (expansionInsertIndex >= 0) {
|
|
1440
|
+
base.splice(expansionInsertIndex, 0, __spreadProps(__spreadValues({}, buildExpansionColSpec(rowExpansionConfig.columnwidth)), {
|
|
1441
|
+
domHidden: false
|
|
1442
|
+
}));
|
|
1443
|
+
}
|
|
1444
|
+
}
|
|
1411
1445
|
return base;
|
|
1412
|
-
}, [
|
|
1446
|
+
}, [
|
|
1447
|
+
table,
|
|
1448
|
+
columnSizing,
|
|
1449
|
+
columnsVersion,
|
|
1450
|
+
showheader,
|
|
1451
|
+
ColClassSignature,
|
|
1452
|
+
rowExpansionConfig,
|
|
1453
|
+
tableStructure
|
|
1454
|
+
]);
|
|
1413
1455
|
return /* @__PURE__ */ jsxs(
|
|
1414
1456
|
Box,
|
|
1415
1457
|
__spreadProps(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues({
|
|
1416
1458
|
ref: tableContainerRef,
|
|
1417
1459
|
hidden: props.hidden,
|
|
1418
|
-
className: `app-grid app-panel panel app-datagrid ${className}`.trim()
|
|
1460
|
+
className: `app-grid app-panel panel app-datagrid ${className}`.trim(),
|
|
1461
|
+
"data-widget-id": props["data-widget-id"]
|
|
1419
1462
|
}, { name }), { editmode }), { navigation }), { title }), {
|
|
1420
1463
|
currentpage: table.getState().pagination.pageIndex + 1
|
|
1421
1464
|
}), {
|
|
@@ -1427,6 +1470,8 @@ const WmTableComponent = memo(
|
|
|
1427
1470
|
title,
|
|
1428
1471
|
subheading,
|
|
1429
1472
|
iconclass,
|
|
1473
|
+
iconurl,
|
|
1474
|
+
prefabName: props.prefabName,
|
|
1430
1475
|
exportformat,
|
|
1431
1476
|
headerActions,
|
|
1432
1477
|
spacing,
|
|
@@ -1501,9 +1546,9 @@ const WmTableComponent = memo(
|
|
|
1501
1546
|
tableName: name
|
|
1502
1547
|
}
|
|
1503
1548
|
),
|
|
1504
|
-
/* @__PURE__ */ jsx("colgroup", { children: colGroupSpec.map((c) => /* @__PURE__ */ jsx("col", { style:
|
|
1549
|
+
/* @__PURE__ */ jsx("colgroup", { children: colGroupSpec.map((c) => /* @__PURE__ */ jsx("col", { style: c.style, width: c.width }, c.key)) })
|
|
1505
1550
|
] }),
|
|
1506
|
-
internalDataset.length > 0 && /* @__PURE__ */ jsx(
|
|
1551
|
+
(internalDataset.length > 0 || !isTableLoading) && /* @__PURE__ */ jsx(
|
|
1507
1552
|
TableBodyComponent,
|
|
1508
1553
|
{
|
|
1509
1554
|
table,
|
|
@@ -1530,7 +1575,8 @@ const WmTableComponent = memo(
|
|
|
1530
1575
|
isAddingNewRow,
|
|
1531
1576
|
customExpressionColumns: customColumns,
|
|
1532
1577
|
customColumnsRevision,
|
|
1533
|
-
columnsVersion
|
|
1578
|
+
columnsVersion,
|
|
1579
|
+
registerRowDefInstance
|
|
1534
1580
|
}
|
|
1535
1581
|
),
|
|
1536
1582
|
summaryRowEnabled && summaryRowDefs.length > 0 && /* @__PURE__ */ jsx(
|
|
@@ -1664,7 +1710,7 @@ const WmTableComponent = memo(
|
|
|
1664
1710
|
);
|
|
1665
1711
|
WmTableComponent.displayName = "WmTableComponent";
|
|
1666
1712
|
const WmTableWithProvider = (props) => {
|
|
1667
|
-
if (
|
|
1713
|
+
if (useShouldShowSkeleton(props.loading, props.showSkeleton))
|
|
1668
1714
|
return /* @__PURE__ */ jsx(
|
|
1669
1715
|
WmSkeleton,
|
|
1670
1716
|
__spreadProps(__spreadValues({}, SKELETON_REGISTRY["WmTable"]), {
|
|
@@ -34,7 +34,6 @@ import Box from "@mui/material/Box";
|
|
|
34
34
|
import { useWidgetProxy } from "../../../../context/WidgetProvider";
|
|
35
35
|
import withStandalone from "../../../../higherOrder/withStandalone";
|
|
36
36
|
function isWmTableChildType(displayName) {
|
|
37
|
-
console.log("displayName", displayName);
|
|
38
37
|
return displayName === "WmTable" || displayName === "WmTableStandalone" || displayName === "withStandalone(WmTable)";
|
|
39
38
|
}
|
|
40
39
|
const WmLiveTable = (props) => {
|