@wavemaker-ai/react-runtime 1.0.0-rc.647684 → 12.0.0-rc.335
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 +3 -0
- package/components/basic/search/index.js +5 -4
- package/components/basic/search/utils.d.ts +1 -0
- package/components/basic/search/utils.js +9 -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/common/index.d.ts +2 -0
- package/components/common/index.js +2 -0
- package/components/common/partial-content-wrapper.d.ts +15 -0
- package/components/common/partial-content-wrapper.js +11 -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 +38 -11
- 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 +12 -8
- 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 +92 -43
- package/components/container/wizard/props.d.ts +2 -2
- 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/dynamic-fields/WmxDynamicFormField.js +9 -23
- package/components/data/form/form-action/index.d.ts +2 -0
- package/components/data/form/form-controller/props.d.ts +2 -0
- package/components/data/form/form-controller/utils.js +3 -2
- package/components/data/form/form-controller/validation-contrustor.js +112 -1
- package/components/data/form/form-controller/withFormController.js +16 -3
- package/components/data/form/form-field/index.js +38 -11
- package/components/data/form/form-field/props.d.ts +8 -2
- package/components/data/list/components/ListItemWithTemplate.js +1 -1
- package/components/data/list/index.d.ts +2 -0
- package/components/data/list/index.js +5 -10
- package/components/data/pagination/hooks/usePagination.js +6 -6
- package/components/data/table/components/EditableCell.js +47 -24
- package/components/data/table/components/FieldValidationError.js +1 -1
- 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 +12 -4
- package/components/data/table/hooks/useFormWidget.js +13 -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 +65 -4
- package/components/data/table/hooks/useTableData.js +10 -2
- package/components/data/table/hooks/useTableEdit.d.ts +1 -1
- package/components/data/table/hooks/useTableEdit.js +115 -75
- package/components/data/table/hooks/useTableEditForms.d.ts +25 -0
- package/components/data/table/hooks/useTableEditForms.js +30 -0
- package/components/data/table/index.d.ts +2 -0
- package/components/data/table/index.js +82 -45
- package/components/data/table/live-table/index.d.ts +1 -0
- package/components/data/table/props.d.ts +43 -23
- 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 +19 -24
- package/components/data/table/utils/columnProxy.d.ts +7 -1
- package/components/data/table/utils/columnProxy.js +21 -1
- package/components/data/table/utils/columnValidation.d.ts +19 -0
- package/components/data/table/utils/columnValidation.js +76 -0
- package/components/data/table/utils/constants.d.ts +2 -0
- package/components/data/table/utils/constants.js +2 -0
- 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 +14 -15
- package/components/data/table/utils/index.js +18 -85
- package/components/data/table/utils/selectionUtils.d.ts +12 -0
- package/components/data/table/utils/selectionUtils.js +23 -5
- 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 +3 -0
- package/components/input/color-picker/index.d.ts +3 -0
- package/components/input/composite/index.d.ts +1 -0
- package/components/input/composite/index.js +32 -6
- package/components/input/currency/index.d.ts +1 -0
- package/components/input/default/checkbox/index.d.ts +3 -0
- package/components/input/default/checkboxset/index.d.ts +3 -0
- package/components/input/default/radioset/index.d.ts +3 -0
- package/components/input/default/switch/index.d.ts +3 -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 +13 -3
- 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 +3 -0
- package/components/input/rating/index.d.ts +3 -0
- package/components/input/select/index.d.ts +1 -0
- package/components/input/slider/index.d.ts +3 -0
- package/components/input/text/index.d.ts +3 -0
- package/components/input/text/index.js +9 -2
- package/components/input/textarea/index.d.ts +3 -0
- package/components/input/upload/index.d.ts +3 -0
- package/components/layout/footer/index.js +4 -2
- package/components/layout/footer/props.d.ts +1 -0
- package/components/layout/header/index.js +29 -3
- package/components/layout/header/props.d.ts +1 -0
- package/components/layout/leftnav/index.js +22 -6
- package/components/layout/leftnav/props.d.ts +1 -0
- package/components/layout/leftnav/utils/page-class-util.d.ts +1 -0
- package/components/layout/leftnav/utils/page-class-util.js +4 -3
- package/components/layout/rightnav/index.js +4 -2
- package/components/layout/rightnav/props.d.ts +1 -0
- package/components/layout/topnav/index.js +4 -2
- package/components/layout/topnav/props.d.ts +1 -0
- package/components/navbar/index.d.ts +1 -0
- package/components/navbar/index.js +32 -7
- 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 +19 -11
- 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/index.js +60 -19
- package/components/page/page-context.d.ts +4 -0
- 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 +132 -22
- package/higherOrder/BaseApp.js +3 -2
- package/higherOrder/BasePage.js +4 -10
- package/higherOrder/props.d.ts +1 -0
- package/higherOrder/useActivePageReactivity.js +1 -4
- package/higherOrder/withBaseWrapper.js +12 -3
- package/hooks/useHttp.d.ts +14 -4
- package/hooks/useHttp.js +47 -9
- package/package-lock.json +332 -325
- package/package.json +3 -3
- package/runtime-dynamic/App.js +21 -2
- package/runtime-dynamic/app-initializer.js +8 -1
- 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 +5 -10
- package/runtime-dynamic/main.d.ts +1 -0
- package/runtime-dynamic/main.js +9 -1
- package/runtime-dynamic/routes.js +17 -8
- package/runtime-dynamic/services/compile-render.js +7 -0
- package/runtime-dynamic/services/css-scoping.d.ts +1 -1
- package/runtime-dynamic/services/css-scoping.js +2 -2
- package/runtime-dynamic/services/variable-factory.js +2 -1
- package/runtime-dynamic/services/variable-transpiler.js +4 -1
- package/runtime-dynamic/wmx-shared.d.ts +40 -0
- package/runtime-dynamic/wmx-shared.js +33 -0
- 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/utils/style-utils.js +1 -1
- package/utils/wmx.utils.d.ts +0 -1
- package/utils/wmx.utils.js +0 -25
- package/variables/crud-variable.d.ts +10 -0
- package/variables/crud-variable.js +53 -2
- package/variables/live-variable.d.ts +1 -0
- package/variables/live-variable.js +2 -1
- package/variables/model-variable.d.ts +2 -0
- package/variables/model-variable.js +14 -0
- package/variables/operation-params.d.ts +29 -0
- package/variables/operation-params.js +69 -0
- package/variables/service-variable.d.ts +9 -0
- package/variables/service-variable.js +21 -2
- package/components/data/table/utils/validation.d.ts +0 -13
- package/components/data/table/utils/validation.js +0 -82
|
@@ -26,6 +26,7 @@ import React, {
|
|
|
26
26
|
useCallback,
|
|
27
27
|
useContext,
|
|
28
28
|
useEffect,
|
|
29
|
+
useLayoutEffect,
|
|
29
30
|
useMemo,
|
|
30
31
|
useRef,
|
|
31
32
|
useState
|
|
@@ -165,10 +166,11 @@ const WmTabs = memo(
|
|
|
165
166
|
return newSet;
|
|
166
167
|
});
|
|
167
168
|
}
|
|
168
|
-
}, [selectedIndex, type, dataset]);
|
|
169
|
+
}, [selectedIndex, type, dataset, dataset == null ? void 0 : dataset.length]);
|
|
169
170
|
const changeTab = (newIndex) => {
|
|
170
171
|
if (newIndex >= 0 && newIndex < panesCount.current && newIndex !== currentSelectedIndex.current) {
|
|
171
172
|
prevSelectedIndex.current = currentSelectedIndex.current;
|
|
173
|
+
currentSelectedIndex.current = newIndex;
|
|
172
174
|
setSelectedIndex(newIndex);
|
|
173
175
|
saveStateToStorage(newIndex);
|
|
174
176
|
return true;
|
|
@@ -257,7 +259,7 @@ const WmTabs = memo(
|
|
|
257
259
|
activeTab: getActiveTab(activeIndex)
|
|
258
260
|
});
|
|
259
261
|
};
|
|
260
|
-
|
|
262
|
+
useLayoutEffect(() => {
|
|
261
263
|
updateListener();
|
|
262
264
|
}, [prev, next, goToTab]);
|
|
263
265
|
const getStateFromStorage = () => {
|
|
@@ -304,7 +306,7 @@ const WmTabs = memo(
|
|
|
304
306
|
item.onHeaderclick(e, Widgets == null ? void 0 : Widgets[name], index);
|
|
305
307
|
}
|
|
306
308
|
},
|
|
307
|
-
[
|
|
309
|
+
[name]
|
|
308
310
|
);
|
|
309
311
|
const renderTabHeader = React.useCallback(
|
|
310
312
|
(item, index) => /* @__PURE__ */ createElement(
|
|
@@ -370,7 +372,7 @@ const WmTabs = memo(
|
|
|
370
372
|
const headers = [];
|
|
371
373
|
let tabIndex = 0;
|
|
372
374
|
const addTabHeader = (itemProps) => {
|
|
373
|
-
const paneName = itemProps
|
|
375
|
+
const paneName = itemProps["item-id"] || itemProps.name;
|
|
374
376
|
const latestWidgetState = paneName ? (Widgets == null ? void 0 : Widgets[paneName]) || {} : {};
|
|
375
377
|
const headerOverrides = paneName ? paneHeaderOverrides[paneName] || {} : {};
|
|
376
378
|
const resolvedItemProps = __spreadValues(__spreadValues(__spreadValues({}, itemProps), latestWidgetState), headerOverrides);
|
|
@@ -395,7 +397,7 @@ const WmTabs = memo(
|
|
|
395
397
|
});
|
|
396
398
|
panesCount.current = tabIndex;
|
|
397
399
|
return headers;
|
|
398
|
-
}, [dataset,
|
|
400
|
+
}, [dataset, paneHeaderOverrides, renderTabHeader]);
|
|
399
401
|
const renderStaticTabs = React.useCallback(() => {
|
|
400
402
|
const visibleChildren = filterVisibleChildren(children, hiddenTabNames);
|
|
401
403
|
panesCount.current = visibleChildren.length;
|
|
@@ -468,7 +470,10 @@ const WmTabs = memo(
|
|
|
468
470
|
setSelectedIndex(newIndex);
|
|
469
471
|
saveStateToStorage(newIndex);
|
|
470
472
|
updateListener(newIndex);
|
|
471
|
-
|
|
473
|
+
setTimeout(
|
|
474
|
+
() => onChange == null ? void 0 : onChange(null, getLatestTabsWidget(newIndex), newIndex, oldIndex),
|
|
475
|
+
0
|
|
476
|
+
);
|
|
472
477
|
},
|
|
473
478
|
orientation,
|
|
474
479
|
className: clsx("app-tabs clearfix", className, {
|
|
@@ -542,7 +547,6 @@ const WmTabs = memo(
|
|
|
542
547
|
"transition",
|
|
543
548
|
"type",
|
|
544
549
|
"iconposition",
|
|
545
|
-
"render",
|
|
546
550
|
"selectedindex",
|
|
547
551
|
"children",
|
|
548
552
|
"loading",
|
|
@@ -553,7 +557,7 @@ const WmTabs = memo(
|
|
|
553
557
|
"styles"
|
|
554
558
|
];
|
|
555
559
|
return keys.every((key) => {
|
|
556
|
-
if (key === "children") {
|
|
560
|
+
if (key === "children" || key === "dataset") {
|
|
557
561
|
return prev[key] === next[key];
|
|
558
562
|
}
|
|
559
563
|
return isEqual(prev[key], next[key]);
|
|
@@ -49,6 +49,7 @@ declare const _default: React.ComponentType<{
|
|
|
49
49
|
width?: number | string;
|
|
50
50
|
height?: number | string;
|
|
51
51
|
className?: string;
|
|
52
|
+
class?: string;
|
|
52
53
|
conditionalstyle?: React.CSSProperties;
|
|
53
54
|
conditionalclass?: string;
|
|
54
55
|
showindevice?: ("xs" | "sm" | "md" | "lg" | "all")[];
|
|
@@ -47,7 +47,7 @@ const WmTabpane = (props) => {
|
|
|
47
47
|
listener.onChange(tabsContainerName, { activeTab: widgetInstance });
|
|
48
48
|
}
|
|
49
49
|
if (isActive) {
|
|
50
|
-
if (!loadedRef.current) {
|
|
50
|
+
if (!loadedRef.current && !renderPartial) {
|
|
51
51
|
(_c = props == null ? void 0 : props.onLoad) == null ? void 0 : _c.call(props, null, widgetInstance);
|
|
52
52
|
loadedRef.current = true;
|
|
53
53
|
}
|
|
@@ -95,7 +95,7 @@ const WmTabpane = (props) => {
|
|
|
95
95
|
return;
|
|
96
96
|
}
|
|
97
97
|
updatePaneHeader(name, headerProps);
|
|
98
|
-
}, [name,
|
|
98
|
+
}, [name, updatePaneHeader]);
|
|
99
99
|
return /* @__PURE__ */ jsx(
|
|
100
100
|
Tabs.Panel,
|
|
101
101
|
__spreadProps(__spreadValues(__spreadValues({
|
|
@@ -38,6 +38,7 @@ declare const WmWizardStandalone: React.ComponentType<{
|
|
|
38
38
|
padding?: string;
|
|
39
39
|
margin?: string;
|
|
40
40
|
className?: string;
|
|
41
|
+
class?: string;
|
|
41
42
|
conditionalstyle?: React.CSSProperties;
|
|
42
43
|
conditionalclass?: string;
|
|
43
44
|
showindevice?: ("xs" | "sm" | "md" | "lg" | "all")[];
|
|
@@ -130,6 +131,7 @@ declare const _default: React.ComponentType<{
|
|
|
130
131
|
padding?: string;
|
|
131
132
|
margin?: string;
|
|
132
133
|
className?: string;
|
|
134
|
+
class?: string;
|
|
133
135
|
conditionalstyle?: React.CSSProperties;
|
|
134
136
|
conditionalclass?: string;
|
|
135
137
|
showindevice?: ("xs" | "sm" | "md" | "lg" | "all")[];
|
|
@@ -51,6 +51,7 @@ import { getFormData } from "../../../utils/form-utils";
|
|
|
51
51
|
import { useParentFormData } from "../../data/form/form-context";
|
|
52
52
|
import isEqual from "lodash-es/isEqual";
|
|
53
53
|
import withStandalone from "../../../higherOrder/withStandalone";
|
|
54
|
+
import { publishPartialNamespaces, toHostWidgetProps } from "../../../utils/partial-host-util";
|
|
54
55
|
import {
|
|
55
56
|
WmSkeleton,
|
|
56
57
|
SKELETON_REGISTRY,
|
|
@@ -89,7 +90,9 @@ const WmWizardComponent = memo(
|
|
|
89
90
|
width,
|
|
90
91
|
height,
|
|
91
92
|
render,
|
|
92
|
-
standalone = false
|
|
93
|
+
standalone = false,
|
|
94
|
+
viewParent,
|
|
95
|
+
prefab
|
|
93
96
|
} = props;
|
|
94
97
|
const [steps, setSteps] = useState([]);
|
|
95
98
|
const [wizardMessage, setWizardMessage] = useState(message || { caption: "", type: "" });
|
|
@@ -99,6 +102,34 @@ const WmWizardComponent = memo(
|
|
|
99
102
|
const navIndexRef = useRef(-1);
|
|
100
103
|
const loadedStepNameRef = useRef(null);
|
|
101
104
|
const [formReady, setFormReady] = useState(false);
|
|
105
|
+
const loadedStepPartialKeysRef = useRef(/* @__PURE__ */ new Set());
|
|
106
|
+
const currentStepRef = useRef(null);
|
|
107
|
+
const currentStepIndexRef = useRef(-1);
|
|
108
|
+
const handleStepPartialOnLoad = useCallback(
|
|
109
|
+
(widget, partialName) => {
|
|
110
|
+
var _a, _b, _c, _d;
|
|
111
|
+
if (!viewParent || !viewParent.Widgets) return;
|
|
112
|
+
const hostKey = ((_a = currentStepRef.current) == null ? void 0 : _a.name) || partialName;
|
|
113
|
+
if (!hostKey || loadedStepPartialKeysRef.current.has(hostKey)) return;
|
|
114
|
+
loadedStepPartialKeysRef.current.add(hostKey);
|
|
115
|
+
if (!widget || prefab) {
|
|
116
|
+
viewParent.Widgets[hostKey] = widget || props;
|
|
117
|
+
} else {
|
|
118
|
+
if (!viewParent.Widgets[hostKey]) {
|
|
119
|
+
viewParent.Widgets[hostKey] = toHostWidgetProps(props);
|
|
120
|
+
}
|
|
121
|
+
publishPartialNamespaces(viewParent.Widgets[hostKey], widget);
|
|
122
|
+
}
|
|
123
|
+
if (((_b = currentStepRef.current) == null ? void 0 : _b.name) === hostKey) {
|
|
124
|
+
(_d = (_c = currentStepRef.current) == null ? void 0 : _c.onLoad) == null ? void 0 : _d.call(
|
|
125
|
+
_c,
|
|
126
|
+
viewParent.Widgets[hostKey],
|
|
127
|
+
currentStepIndexRef.current
|
|
128
|
+
);
|
|
129
|
+
}
|
|
130
|
+
},
|
|
131
|
+
[viewParent, prefab]
|
|
132
|
+
);
|
|
102
133
|
const parentFormContext = useParentFormData();
|
|
103
134
|
const isInsideOuterForm = !!parentFormContext && Object.keys(parentFormContext).length > 0;
|
|
104
135
|
const createDynamicSteps = useCallback(
|
|
@@ -146,13 +177,19 @@ const WmWizardComponent = memo(
|
|
|
146
177
|
[defaultstepindex]
|
|
147
178
|
);
|
|
148
179
|
const currentStep = useMemo(() => steps.find((step) => step.active) || null, [steps]);
|
|
180
|
+
currentStepRef.current = currentStep;
|
|
149
181
|
const visibleSteps = useMemo(() => steps.filter((step) => step.show), [steps]);
|
|
182
|
+
const visibleStepsRef = useRef(visibleSteps);
|
|
183
|
+
visibleStepsRef.current = visibleSteps;
|
|
184
|
+
const stepsRef = useRef(steps);
|
|
185
|
+
stepsRef.current = steps;
|
|
150
186
|
const currentStepIndex = useMemo(() => {
|
|
151
187
|
if (!currentStep) return -1;
|
|
152
188
|
return visibleSteps.findIndex((step) => step.name === currentStep.name);
|
|
153
189
|
}, [currentStep, visibleSteps]);
|
|
154
190
|
useEffect(() => {
|
|
155
191
|
navIndexRef.current = currentStepIndex;
|
|
192
|
+
currentStepIndexRef.current = currentStepIndex;
|
|
156
193
|
}, [currentStepIndex]);
|
|
157
194
|
const hasNextStep = useMemo(
|
|
158
195
|
() => currentStepIndex < visibleSteps.length - 1,
|
|
@@ -284,27 +321,34 @@ const WmWizardComponent = memo(
|
|
|
284
321
|
() => stepstyle === "justified" ? "justified" : "auto",
|
|
285
322
|
[stepstyle]
|
|
286
323
|
);
|
|
324
|
+
const activateStep = useCallback(
|
|
325
|
+
(step) => {
|
|
326
|
+
if (!step.show || step.disabled) return;
|
|
327
|
+
setSteps(
|
|
328
|
+
(prevSteps) => prevSteps.map((s) => {
|
|
329
|
+
const stepIndex = prevSteps.findIndex((ps) => ps.name === s.name);
|
|
330
|
+
const targetIndex = prevSteps.findIndex((ps) => ps.name === step.name);
|
|
331
|
+
return __spreadProps(__spreadValues({}, s), {
|
|
332
|
+
active: s.name === step.name,
|
|
333
|
+
isDone: type === "dynamic" ? stepIndex < targetIndex : stepIndex < targetIndex,
|
|
334
|
+
done: type === "dynamic" ? stepIndex < targetIndex : stepIndex < targetIndex || s.name === step.name && targetIndex > 0,
|
|
335
|
+
disabled: false,
|
|
336
|
+
// Ensure enableNext and isValid are preserved when activating a step
|
|
337
|
+
enableNext: s.name === step.name ? true : s.enableNext,
|
|
338
|
+
isValid: s.name === step.name ? true : s.isValid
|
|
339
|
+
});
|
|
340
|
+
})
|
|
341
|
+
);
|
|
342
|
+
},
|
|
343
|
+
[type]
|
|
344
|
+
);
|
|
287
345
|
const onStepHeaderClick = useCallback(
|
|
288
346
|
(event, step) => {
|
|
289
|
-
if (
|
|
290
|
-
|
|
291
|
-
(prevSteps) => prevSteps.map((s) => {
|
|
292
|
-
const stepIndex = prevSteps.findIndex((ps) => ps.name === s.name);
|
|
293
|
-
const targetIndex = prevSteps.findIndex((ps) => ps.name === step.name);
|
|
294
|
-
return __spreadProps(__spreadValues({}, s), {
|
|
295
|
-
active: s.name === step.name,
|
|
296
|
-
isDone: type === "dynamic" ? stepIndex < targetIndex : stepIndex < targetIndex,
|
|
297
|
-
done: type === "dynamic" ? stepIndex < targetIndex : stepIndex < targetIndex || s.name === step.name && targetIndex > 0,
|
|
298
|
-
disabled: false,
|
|
299
|
-
// Ensure enableNext and isValid are preserved when activating a step
|
|
300
|
-
enableNext: s.name === step.name ? true : s.enableNext,
|
|
301
|
-
isValid: s.name === step.name ? true : s.isValid
|
|
302
|
-
});
|
|
303
|
-
})
|
|
304
|
-
);
|
|
347
|
+
if (step.done || step.isDone || nonLinear && type === "dynamic") {
|
|
348
|
+
activateStep(step);
|
|
305
349
|
}
|
|
306
350
|
},
|
|
307
|
-
[nonLinear, type]
|
|
351
|
+
[nonLinear, type, activateStep]
|
|
308
352
|
);
|
|
309
353
|
const handleStepClick = useCallback(
|
|
310
354
|
(index) => {
|
|
@@ -334,62 +378,64 @@ const WmWizardComponent = memo(
|
|
|
334
378
|
const next = useCallback(
|
|
335
379
|
async (eventName = "next") => {
|
|
336
380
|
var _a, _b;
|
|
381
|
+
const currentVisibleSteps = visibleStepsRef.current;
|
|
337
382
|
const fromIndex = navIndexRef.current >= 0 ? navIndexRef.current : currentStepIndex;
|
|
338
|
-
const fromStep = getStepByIndex(fromIndex,
|
|
383
|
+
const fromStep = getStepByIndex(fromIndex, currentVisibleSteps);
|
|
339
384
|
if (!fromStep) return;
|
|
340
|
-
const nextStep = getNextValidStep(fromIndex + 1,
|
|
385
|
+
const nextStep = getNextValidStep(fromIndex + 1, currentVisibleSteps);
|
|
341
386
|
if (!nextStep) return;
|
|
342
|
-
const nextIndex =
|
|
387
|
+
const nextIndex = currentVisibleSteps.findIndex((s) => s.name === nextStep.name);
|
|
343
388
|
if (eventName === "skip") {
|
|
344
389
|
const response = (_a = fromStep.onSkip) == null ? void 0 : _a.call(fromStep, fromStep, fromStep, fromIndex);
|
|
345
390
|
if (response !== void 0) {
|
|
346
391
|
await handleNavigation(
|
|
347
392
|
response,
|
|
348
|
-
() => extendNextFn(fromStep, fromIndex,
|
|
393
|
+
() => extendNextFn(fromStep, fromIndex, currentVisibleSteps, setSteps)
|
|
349
394
|
);
|
|
350
395
|
} else {
|
|
351
|
-
extendNextFn(fromStep, fromIndex,
|
|
396
|
+
extendNextFn(fromStep, fromIndex, currentVisibleSteps, setSteps);
|
|
352
397
|
}
|
|
353
398
|
} else if (fromStep.isValid && eventName === "next") {
|
|
354
399
|
const response = (_b = fromStep.onNext) == null ? void 0 : _b.call(fromStep, fromStep, fromStep, fromIndex);
|
|
355
400
|
if (response !== void 0) {
|
|
356
401
|
await handleNavigation(
|
|
357
402
|
response,
|
|
358
|
-
() => extendNextFn(fromStep, fromIndex,
|
|
403
|
+
() => extendNextFn(fromStep, fromIndex, currentVisibleSteps, setSteps)
|
|
359
404
|
);
|
|
360
405
|
} else {
|
|
361
|
-
extendNextFn(fromStep, fromIndex,
|
|
406
|
+
extendNextFn(fromStep, fromIndex, currentVisibleSteps, setSteps);
|
|
362
407
|
}
|
|
363
408
|
} else if (enablenext && !fromStep.isValid) {
|
|
364
409
|
console.warn("Cannot proceed: current step is invalid");
|
|
365
410
|
} else {
|
|
366
|
-
extendNextFn(fromStep, fromIndex,
|
|
411
|
+
extendNextFn(fromStep, fromIndex, currentVisibleSteps, setSteps);
|
|
367
412
|
}
|
|
368
413
|
navIndexRef.current = nextIndex;
|
|
369
414
|
setFormReady(false);
|
|
370
415
|
},
|
|
371
|
-
[currentStepIndex,
|
|
416
|
+
[currentStepIndex, enablenext]
|
|
372
417
|
);
|
|
373
418
|
const prev = useCallback(async () => {
|
|
374
419
|
var _a;
|
|
420
|
+
const currentVisibleSteps = visibleStepsRef.current;
|
|
375
421
|
const fromIndex = navIndexRef.current >= 0 ? navIndexRef.current : currentStepIndex;
|
|
376
|
-
const fromStep = getStepByIndex(fromIndex,
|
|
422
|
+
const fromStep = getStepByIndex(fromIndex, currentVisibleSteps);
|
|
377
423
|
if (!fromStep) return;
|
|
378
|
-
const targetStep = getPrevValidStep(fromIndex - 1,
|
|
424
|
+
const targetStep = getPrevValidStep(fromIndex - 1, currentVisibleSteps);
|
|
379
425
|
if (!targetStep) return;
|
|
380
|
-
const prevIndex =
|
|
426
|
+
const prevIndex = currentVisibleSteps.findIndex((s) => s.name === targetStep.name);
|
|
381
427
|
const response = (_a = fromStep.onPrev) == null ? void 0 : _a.call(fromStep, fromStep, fromStep, fromIndex);
|
|
382
428
|
if (response !== void 0) {
|
|
383
429
|
await handleNavigation(
|
|
384
430
|
response,
|
|
385
|
-
() => extendPrevFn(fromStep, fromIndex,
|
|
431
|
+
() => extendPrevFn(fromStep, fromIndex, currentVisibleSteps, setSteps)
|
|
386
432
|
);
|
|
387
433
|
} else {
|
|
388
|
-
extendPrevFn(fromStep, fromIndex,
|
|
434
|
+
extendPrevFn(fromStep, fromIndex, currentVisibleSteps, setSteps);
|
|
389
435
|
}
|
|
390
436
|
navIndexRef.current = prevIndex;
|
|
391
437
|
setFormReady(false);
|
|
392
|
-
}, [currentStepIndex
|
|
438
|
+
}, [currentStepIndex]);
|
|
393
439
|
const registerStep = useCallback((stepData) => {
|
|
394
440
|
setSteps((prevSteps) => {
|
|
395
441
|
const existingIndex = prevSteps.findIndex((step) => step.name === stepData.name);
|
|
@@ -426,31 +472,33 @@ const WmWizardComponent = memo(
|
|
|
426
472
|
}, [onCancel, steps]);
|
|
427
473
|
const gotoStep = useCallback(
|
|
428
474
|
(step) => {
|
|
475
|
+
const currentSteps = stepsRef.current;
|
|
476
|
+
const currentVisibleSteps = visibleStepsRef.current;
|
|
429
477
|
let gotoStepIndex;
|
|
430
478
|
let targetStep = null;
|
|
431
479
|
if (typeof step === "string") {
|
|
432
|
-
gotoStepIndex =
|
|
480
|
+
gotoStepIndex = currentSteps.map((s) => s.name).indexOf(step);
|
|
433
481
|
if (gotoStepIndex === -1) {
|
|
434
482
|
console.error(`Could not find step '${step}'`);
|
|
435
483
|
return;
|
|
436
484
|
}
|
|
437
|
-
targetStep =
|
|
485
|
+
targetStep = currentSteps[gotoStepIndex];
|
|
438
486
|
} else if (typeof step === "number" && step >= 0) {
|
|
439
487
|
gotoStepIndex = step;
|
|
440
|
-
targetStep = getStepByIndex(step,
|
|
488
|
+
targetStep = getStepByIndex(step, currentVisibleSteps);
|
|
441
489
|
} else {
|
|
442
490
|
console.error("Invalid step name or index provided");
|
|
443
491
|
return;
|
|
444
492
|
}
|
|
445
493
|
if (targetStep == null ? void 0 : targetStep.show) {
|
|
446
|
-
const visIndex =
|
|
494
|
+
const visIndex = currentVisibleSteps.findIndex((s) => s.name === (targetStep == null ? void 0 : targetStep.name));
|
|
447
495
|
if (visIndex >= 0) navIndexRef.current = visIndex;
|
|
448
|
-
|
|
496
|
+
activateStep(targetStep);
|
|
449
497
|
} else {
|
|
450
498
|
console.error("The gotoStep function cannot navigate to hidden steps");
|
|
451
499
|
}
|
|
452
500
|
},
|
|
453
|
-
[
|
|
501
|
+
[activateStep]
|
|
454
502
|
);
|
|
455
503
|
const setDefaultStep = useCallback(
|
|
456
504
|
(step) => {
|
|
@@ -547,7 +595,8 @@ const WmWizardComponent = memo(
|
|
|
547
595
|
currentStepIndex,
|
|
548
596
|
isFirstStep,
|
|
549
597
|
isLastStep,
|
|
550
|
-
visibleSteps
|
|
598
|
+
visibleSteps,
|
|
599
|
+
gotoStep
|
|
551
600
|
]);
|
|
552
601
|
useEffect(() => {
|
|
553
602
|
updateListener();
|
|
@@ -754,7 +803,7 @@ const WmWizardComponent = memo(
|
|
|
754
803
|
className: clsx("app-wizard-step-container", {
|
|
755
804
|
active: step.active
|
|
756
805
|
}),
|
|
757
|
-
hidden: !step.active,
|
|
806
|
+
hidden: !step.active || step.show === false || step.show === "false",
|
|
758
807
|
name: step.name,
|
|
759
808
|
children: isInsideOuterForm ? (
|
|
760
809
|
// Inside outer form - use div, fields/forms pass through to outer form context
|
|
@@ -764,7 +813,7 @@ const WmWizardComponent = memo(
|
|
|
764
813
|
className: clsx("app-wizard-step-content", {
|
|
765
814
|
active: step.active
|
|
766
815
|
}),
|
|
767
|
-
children: (currentStep == null ? void 0 : currentStep.name) && step.active && currentStep.render ? currentStep.render(step,
|
|
816
|
+
children: (currentStep == null ? void 0 : currentStep.name) && step.active && currentStep.render ? currentStep.render(step, handleStepPartialOnLoad) : step.children
|
|
768
817
|
}
|
|
769
818
|
)
|
|
770
819
|
) : (
|
|
@@ -780,7 +829,7 @@ const WmWizardComponent = memo(
|
|
|
780
829
|
}),
|
|
781
830
|
listener,
|
|
782
831
|
isInsideWizard: true,
|
|
783
|
-
children: (currentStep == null ? void 0 : currentStep.name) && step.active && currentStep.render ? currentStep.render(step,
|
|
832
|
+
children: (currentStep == null ? void 0 : currentStep.name) && step.active && currentStep.render ? currentStep.render(step, handleStepPartialOnLoad) : step.children
|
|
784
833
|
}
|
|
785
834
|
)
|
|
786
835
|
)
|
|
@@ -49,7 +49,7 @@ export interface WizardStepData extends Record<string, unknown> {
|
|
|
49
49
|
isValid: boolean;
|
|
50
50
|
isInitialized: boolean;
|
|
51
51
|
content?: ReactNode;
|
|
52
|
-
render?: (step: WizardStepData,
|
|
52
|
+
render?: (step: WizardStepData, onLoad?: (widget?: Record<string, unknown>, partialName?: string) => void) => ReactNode;
|
|
53
53
|
dynamicStepIndex?: number;
|
|
54
54
|
isdynamic?: boolean;
|
|
55
55
|
onLoad?: (step: WizardStepData, stepIndex: number) => void;
|
|
@@ -256,7 +256,7 @@ export interface WmWizardStepProps {
|
|
|
256
256
|
ref?: React.Ref<unknown>;
|
|
257
257
|
className?: string;
|
|
258
258
|
props?: Record<string, unknown>;
|
|
259
|
-
render?: (
|
|
259
|
+
render?: (props: Record<string, unknown>, onLoad?: (widget?: Record<string, unknown>, partialName?: string) => void) => ReactNode;
|
|
260
260
|
listener?: Record<string, unknown>;
|
|
261
261
|
}
|
|
262
262
|
/**
|
|
@@ -19,6 +19,7 @@ declare const _default: import("react").ComponentType<{
|
|
|
19
19
|
width?: number | string;
|
|
20
20
|
height?: number | string;
|
|
21
21
|
className?: string;
|
|
22
|
+
class?: string;
|
|
22
23
|
conditionalstyle?: import("react").CSSProperties;
|
|
23
24
|
conditionalclass?: string;
|
|
24
25
|
showindevice?: ("xs" | "sm" | "md" | "lg" | "all")[];
|
|
@@ -23,6 +23,7 @@ declare const _default: React.ComponentType<{
|
|
|
23
23
|
width?: number | string;
|
|
24
24
|
height?: number | string;
|
|
25
25
|
className?: string;
|
|
26
|
+
class?: string;
|
|
26
27
|
conditionalstyle?: React.CSSProperties;
|
|
27
28
|
conditionalclass?: string;
|
|
28
29
|
showindevice?: ("xs" | "sm" | "md" | "lg" | "all")[];
|
|
@@ -23,6 +23,7 @@ declare const _default: React.ComponentType<{
|
|
|
23
23
|
width?: number | string;
|
|
24
24
|
height?: number | string;
|
|
25
25
|
className?: string;
|
|
26
|
+
class?: string;
|
|
26
27
|
conditionalstyle?: React.CSSProperties;
|
|
27
28
|
conditionalclass?: string;
|
|
28
29
|
showindevice?: ("xs" | "sm" | "md" | "lg" | "all")[];
|
|
@@ -23,6 +23,7 @@ declare const _default: React.ComponentType<{
|
|
|
23
23
|
width?: number | string;
|
|
24
24
|
height?: number | string;
|
|
25
25
|
className?: string;
|
|
26
|
+
class?: string;
|
|
26
27
|
conditionalstyle?: React.CSSProperties;
|
|
27
28
|
conditionalclass?: string;
|
|
28
29
|
showindevice?: ("xs" | "sm" | "md" | "lg" | "all")[];
|
|
@@ -46,6 +46,7 @@ declare const _default: React.ComponentType<{
|
|
|
46
46
|
width?: number | string;
|
|
47
47
|
height?: number | string;
|
|
48
48
|
className?: string;
|
|
49
|
+
class?: string;
|
|
49
50
|
conditionalstyle?: React.CSSProperties;
|
|
50
51
|
conditionalclass?: string;
|
|
51
52
|
showindevice?: ("xs" | "sm" | "md" | "lg" | "all")[];
|
|
@@ -10,4 +10,4 @@ import { UseFormOperationsOptions, UseFormOperationsReturn } from "../props";
|
|
|
10
10
|
* - Save and new / Save and view actions
|
|
11
11
|
* - View mode state management
|
|
12
12
|
*/
|
|
13
|
-
export declare function useFormOperations({ formName, formfields, formRef, formReff, formType, fullDataPath, parentFormDataContext, clearFormData, resetFormData, trigger, submit, formProxy, widgetFormType, debouncedFilter, }: UseFormOperationsOptions): UseFormOperationsReturn;
|
|
13
|
+
export declare function useFormOperations({ formName, formfields, formRef, formReff, formType, fullDataPath, parentFormDataContext, clearFormData, resetFormData, trigger, submit, formProxy, widgetFormType, debouncedFilter, onReset, }: UseFormOperationsOptions): UseFormOperationsReturn;
|
|
@@ -16,7 +16,8 @@ function useFormOperations({
|
|
|
16
16
|
submit,
|
|
17
17
|
formProxy,
|
|
18
18
|
widgetFormType,
|
|
19
|
-
debouncedFilter
|
|
19
|
+
debouncedFilter,
|
|
20
|
+
onReset
|
|
20
21
|
}) {
|
|
21
22
|
const hasPrefixedFields = usesPrefixedFields(formType);
|
|
22
23
|
const [showViewMode, setShowViewMode] = useState(false);
|
|
@@ -53,6 +54,7 @@ function useFormOperations({
|
|
|
53
54
|
return (_a = childForm == null ? void 0 : childForm.formreset) == null ? void 0 : _a.call(childForm);
|
|
54
55
|
});
|
|
55
56
|
}
|
|
57
|
+
onReset == null ? void 0 : onReset();
|
|
56
58
|
}, [
|
|
57
59
|
formName,
|
|
58
60
|
formfields,
|
|
@@ -62,7 +64,8 @@ function useFormOperations({
|
|
|
62
64
|
fullDataPath,
|
|
63
65
|
parentFormDataContext,
|
|
64
66
|
formRef,
|
|
65
|
-
formReff
|
|
67
|
+
formReff,
|
|
68
|
+
onReset
|
|
66
69
|
]);
|
|
67
70
|
const create = useCallback(() => {
|
|
68
71
|
formreset();
|
|
@@ -325,7 +325,7 @@ const BaseForm = (WrappedComponent) => {
|
|
|
325
325
|
e == null ? void 0 : e.preventDefault();
|
|
326
326
|
e == null ? void 0 : e.stopPropagation();
|
|
327
327
|
const transformedData = transformRangeFilterData(data);
|
|
328
|
-
return livefilterFn(transformedData, false,
|
|
328
|
+
return livefilterFn(transformedData, false, formProxy == null ? void 0 : formProxy.formfields);
|
|
329
329
|
}),
|
|
330
330
|
[handleSubmit, livefilterFn]
|
|
331
331
|
);
|
|
@@ -334,7 +334,7 @@ const BaseForm = (WrappedComponent) => {
|
|
|
334
334
|
debouncedFn();
|
|
335
335
|
}, [filter]);
|
|
336
336
|
const {
|
|
337
|
-
formreset
|
|
337
|
+
formreset,
|
|
338
338
|
create,
|
|
339
339
|
edit,
|
|
340
340
|
setFormData,
|
|
@@ -356,18 +356,14 @@ const BaseForm = (WrappedComponent) => {
|
|
|
356
356
|
submit,
|
|
357
357
|
formProxy: formProxy || {},
|
|
358
358
|
widgetFormType: props["form-type"],
|
|
359
|
-
debouncedFilter
|
|
359
|
+
debouncedFilter,
|
|
360
|
+
onReset: props.onReset
|
|
360
361
|
});
|
|
361
|
-
const formreset = useCallback(async () => {
|
|
362
|
-
var _a2;
|
|
363
|
-
await formresetFn();
|
|
364
|
-
(_a2 = props.onReset) == null ? void 0 : _a2.call(props);
|
|
365
|
-
}, [formresetFn, props.onReset]);
|
|
366
362
|
const clearFilter = useMemo(
|
|
367
363
|
() => handleSubmit((data, e) => {
|
|
368
364
|
e == null ? void 0 : e.preventDefault();
|
|
369
365
|
e == null ? void 0 : e.stopPropagation();
|
|
370
|
-
|
|
366
|
+
formreset();
|
|
371
367
|
const transformedData = transformRangeFilterData(data);
|
|
372
368
|
livefilterFn(transformedData, true, formfieldsRef.current);
|
|
373
369
|
}),
|
|
@@ -384,8 +380,8 @@ const BaseForm = (WrappedComponent) => {
|
|
|
384
380
|
return;
|
|
385
381
|
}
|
|
386
382
|
setShowViewMode(true);
|
|
387
|
-
|
|
388
|
-
}, [setShowViewMode, props.cancel,
|
|
383
|
+
formreset();
|
|
384
|
+
}, [setShowViewMode, props.cancel, formreset]);
|
|
389
385
|
const highlightInvalidFields = useCallback(async () => {
|
|
390
386
|
await validateFieldsOnSubmit();
|
|
391
387
|
}, [validateFieldsOnSubmit]);
|
|
@@ -452,7 +448,7 @@ const BaseForm = (WrappedComponent) => {
|
|
|
452
448
|
var _a2;
|
|
453
449
|
if (!formName || !formRef.current) return;
|
|
454
450
|
(_a2 = props == null ? void 0 : props.destroy) == null ? void 0 : _a2.call(props, formName);
|
|
455
|
-
|
|
451
|
+
formreset();
|
|
456
452
|
};
|
|
457
453
|
}, []);
|
|
458
454
|
useEffect(() => {
|
|
@@ -559,7 +555,7 @@ const BaseForm = (WrappedComponent) => {
|
|
|
559
555
|
}
|
|
560
556
|
const formId = formIdRef.current;
|
|
561
557
|
parentFormRef.current[formId] = {
|
|
562
|
-
formreset
|
|
558
|
+
formreset,
|
|
563
559
|
validateFieldsOnSubmit
|
|
564
560
|
};
|
|
565
561
|
return () => {
|
|
@@ -567,7 +563,7 @@ const BaseForm = (WrappedComponent) => {
|
|
|
567
563
|
delete parentFormRef.current[formId];
|
|
568
564
|
}
|
|
569
565
|
};
|
|
570
|
-
}, [parentFormRef,
|
|
566
|
+
}, [parentFormRef, formreset, validateFieldsOnSubmit]);
|
|
571
567
|
const computedFormdata = widgetFormData || childFormData || formdata;
|
|
572
568
|
const ref = useMemo(
|
|
573
569
|
() => ({
|
|
@@ -30,38 +30,24 @@ var __objRest = (source, exclude) => {
|
|
|
30
30
|
return target;
|
|
31
31
|
};
|
|
32
32
|
import { jsx } from "react/jsx-runtime";
|
|
33
|
-
import {
|
|
33
|
+
import { useMemo } from "react";
|
|
34
34
|
import WmText from "../../../input/text";
|
|
35
35
|
import withFormController from "../form-controller/withFormController";
|
|
36
|
-
import {
|
|
36
|
+
import { getWmxComponentName, getWmxModule } from "../../../../utils/wmx.utils";
|
|
37
37
|
const WmxDynamicFormField = ({ field, fieldProps }) => {
|
|
38
|
-
var _b;
|
|
38
|
+
var _b, _c, _d;
|
|
39
39
|
const componentName = getWmxComponentName(String((field == null ? void 0 : field.widget) || ""));
|
|
40
40
|
const _a = fieldProps, { class: className } = _a, restProps = __objRest(_a, ["class"]);
|
|
41
41
|
const resolvedClassName = className || fieldProps.className;
|
|
42
|
-
const
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
if (isActive) {
|
|
48
|
-
setRawComponent(component);
|
|
49
|
-
}
|
|
50
|
-
}).catch((e) => {
|
|
51
|
-
console.error(e);
|
|
52
|
-
});
|
|
53
|
-
return () => {
|
|
54
|
-
isActive = false;
|
|
55
|
-
};
|
|
56
|
-
}, [componentName]);
|
|
57
|
-
const EnhancedWmxComponent = useMemo(() => {
|
|
58
|
-
if (!RawComponent) return null;
|
|
59
|
-
return withFormController(RawComponent);
|
|
60
|
-
}, [RawComponent]);
|
|
42
|
+
const RawComponent = componentName ? (_c = (_b = getWmxModule()) == null ? void 0 : _b[`Wmx${componentName}`]) != null ? _c : null : null;
|
|
43
|
+
const EnhancedWmxComponent = useMemo(
|
|
44
|
+
() => RawComponent ? withFormController(RawComponent) : null,
|
|
45
|
+
[RawComponent]
|
|
46
|
+
);
|
|
61
47
|
if (!EnhancedWmxComponent) {
|
|
62
48
|
return /* @__PURE__ */ jsx(WmText, __spreadProps(__spreadValues({ name: field == null ? void 0 : field.name }, restProps), { className: resolvedClassName }));
|
|
63
49
|
}
|
|
64
|
-
const dataset = (
|
|
50
|
+
const dataset = (_d = field == null ? void 0 : field.dataset) != null ? _d : fieldProps == null ? void 0 : fieldProps.dataset;
|
|
65
51
|
return /* @__PURE__ */ jsx(
|
|
66
52
|
EnhancedWmxComponent,
|
|
67
53
|
__spreadProps(__spreadValues({
|
|
@@ -22,6 +22,7 @@ declare const WmFormActionsStandalone: import("react").ComponentType<{
|
|
|
22
22
|
margin?: string;
|
|
23
23
|
width?: number | string;
|
|
24
24
|
height?: number | string;
|
|
25
|
+
class?: string;
|
|
25
26
|
conditionalstyle?: import("react").CSSProperties;
|
|
26
27
|
conditionalclass?: string;
|
|
27
28
|
showindevice?: ("xs" | "sm" | "md" | "lg" | "all")[];
|
|
@@ -98,6 +99,7 @@ declare const _default: import("react").ComponentType<{
|
|
|
98
99
|
margin?: string;
|
|
99
100
|
width?: number | string;
|
|
100
101
|
height?: number | string;
|
|
102
|
+
class?: string;
|
|
101
103
|
conditionalstyle?: import("react").CSSProperties;
|
|
102
104
|
conditionalclass?: string;
|
|
103
105
|
showindevice?: ("xs" | "sm" | "md" | "lg" | "all")[];
|