@wavemaker-ai/react-runtime 1.0.0-rc.330 → 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/actions/notification-action.js +3 -3
- package/actions/toast.js +2 -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 +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/message/index.js +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/search/index.js +9 -11
- package/components/basic/search/providers.d.ts +1 -1
- package/components/basic/search/providers.js +6 -3
- 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 +2 -1
- package/components/container/linear-layout/index.d.ts +1 -0
- package/components/container/linear-layout/index.js +0 -1
- 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 +14 -17
- package/components/data/form/base-form/index.js +22 -23
- package/components/data/form/base-form/props.d.ts +1 -0
- package/components/data/form/base-form/utils.js +5 -4
- package/components/data/form/form-action/index.d.ts +4 -2
- package/components/data/form/form-action/index.js +2 -2
- package/components/data/form/form-context.d.ts +12 -13
- package/components/data/form/form-context.js +4 -6
- package/components/data/form/form-controller/withFormController.js +20 -7
- package/components/data/form/form-field/index.js +40 -15
- package/components/data/form/form-field/props.d.ts +7 -2
- package/components/data/list/components/ListItems.js +1 -3
- package/components/data/list/index.d.ts +2 -0
- package/components/data/list/index.js +6 -11
- package/components/data/pagination/hooks/usePagination.js +8 -8
- package/components/data/table/components/RowExpansionButton.js +5 -1
- package/components/data/table/components/TableBody.js +4 -1
- package/components/data/table/components/TableDataRow.js +1 -1
- 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 +3 -3
- package/components/data/table/hooks/useRowSelection.js +22 -13
- package/components/data/table/hooks/useTableColumns.js +5 -5
- package/components/data/table/hooks/useTableData.js +10 -2
- package/components/data/table/index.d.ts +2 -0
- package/components/data/table/index.js +15 -14
- package/components/data/table/live-table/index.d.ts +1 -0
- package/components/data/table/props.d.ts +9 -8
- 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 +45 -50
- 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 +20 -9
- package/components/data/table/utils/selectionUtils.d.ts +14 -0
- package/components/data/table/utils/selectionUtils.js +33 -1
- 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-actions/index.js +11 -2
- 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/date/index.js +2 -1
- package/components/input/epoch/date/utils.js +4 -2
- package/components/input/epoch/datetime/index.d.ts +1 -0
- package/components/input/epoch/datetime/index.js +5 -3
- package/components/input/epoch/datetime/props.d.ts +2 -2
- package/components/input/epoch/time/index.d.ts +1 -0
- package/components/input/epoch/time/utils.d.ts +1 -1
- package/components/input/epoch/time/utils.js +2 -2
- package/components/input/fileupload/index.d.ts +1 -0
- package/components/input/fileupload/index.js +2 -1
- package/components/input/fileupload/useFileUpload.js +19 -24
- package/components/input/number/index.d.ts +2 -0
- package/components/input/rating/index.d.ts +2 -0
- package/components/input/select/index.js +6 -3
- 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 +2 -1
- package/components/navigation/popover/index.js +16 -4
- package/components/navigation/popover/props.d.ts +1 -1
- 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 +18 -1
- package/core/proxy-service.js +84 -14
- package/higherOrder/BaseApp.js +2 -1
- package/higherOrder/BaseDateTime.js +8 -1
- package/higherOrder/BasePage.js +9 -11
- package/higherOrder/props.d.ts +1 -0
- package/higherOrder/useActivePageReactivity.js +1 -4
- package/higherOrder/withBaseWrapper.js +6 -6
- package/package-lock.json +203 -185
- 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
|
@@ -334,7 +334,7 @@ const WmSelect = React.memo(
|
|
|
334
334
|
}
|
|
335
335
|
prevComputedValueRef.current = currentValue;
|
|
336
336
|
}, [computedSelectValue, multiple, listener, props.fieldName, name, localDatavalue]);
|
|
337
|
-
return /* @__PURE__ */ jsx("div", { className: clsx(DEFAULT_CLASS
|
|
337
|
+
return /* @__PURE__ */ jsx("div", { className: clsx(DEFAULT_CLASS), hidden: props.hidden, style: styles, children: /* @__PURE__ */ jsxs(
|
|
338
338
|
NativeSelect,
|
|
339
339
|
__spreadProps(__spreadValues({
|
|
340
340
|
name,
|
|
@@ -342,7 +342,6 @@ const WmSelect = React.memo(
|
|
|
342
342
|
className: clsx(
|
|
343
343
|
isTouched ? "ng-touched" : "ng-untouched",
|
|
344
344
|
isDirty ? "ng-invalid" : "ng-valid",
|
|
345
|
-
className,
|
|
346
345
|
"wm-native-select-root"
|
|
347
346
|
),
|
|
348
347
|
value: multiple ? computedSelectValue : (_b = (_a = computedSelectValue.key) != null ? _a : placeholder) != null ? _b : ""
|
|
@@ -365,7 +364,11 @@ const WmSelect = React.memo(
|
|
|
365
364
|
multiple,
|
|
366
365
|
disabled,
|
|
367
366
|
"aria-readonly": readonly,
|
|
368
|
-
className:
|
|
367
|
+
className: clsx(
|
|
368
|
+
"app-select",
|
|
369
|
+
className || "",
|
|
370
|
+
"form-control ng-valid ng-touched ng-dirty wm-app"
|
|
371
|
+
),
|
|
369
372
|
accessKey: shortcutkey,
|
|
370
373
|
title: hint
|
|
371
374
|
},
|
|
@@ -30,6 +30,7 @@ declare const WmSliderStandalone: React.ComponentType<import("../../data/form/fo
|
|
|
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")[];
|
|
@@ -129,6 +130,7 @@ declare const _default: React.ComponentType<{
|
|
|
129
130
|
width?: number | string;
|
|
130
131
|
height?: number | string;
|
|
131
132
|
className?: string;
|
|
133
|
+
class?: string;
|
|
132
134
|
conditionalstyle?: React.CSSProperties;
|
|
133
135
|
conditionalclass?: string;
|
|
134
136
|
showindevice?: ("xs" | "sm" | "md" | "lg" | "all")[];
|
|
@@ -41,6 +41,7 @@ declare const WmTextStandalone: import("react").ComponentType<import("../../data
|
|
|
41
41
|
width?: number | string;
|
|
42
42
|
height?: number | string;
|
|
43
43
|
className?: string;
|
|
44
|
+
class?: string;
|
|
44
45
|
conditionalstyle?: import("react").CSSProperties;
|
|
45
46
|
conditionalclass?: string;
|
|
46
47
|
showindevice?: ("xs" | "sm" | "md" | "lg" | "all")[];
|
|
@@ -146,6 +147,7 @@ declare const _default: import("react").ComponentType<{
|
|
|
146
147
|
width?: number | string;
|
|
147
148
|
height?: number | string;
|
|
148
149
|
className?: string;
|
|
150
|
+
class?: string;
|
|
149
151
|
conditionalstyle?: import("react").CSSProperties;
|
|
150
152
|
conditionalclass?: string;
|
|
151
153
|
showindevice?: ("xs" | "sm" | "md" | "lg" | "all")[];
|
|
@@ -84,11 +84,13 @@ const WmText = memo(
|
|
|
84
84
|
const [isTouched, setIsTouched] = useState(false);
|
|
85
85
|
const [isAutofilled, setIsAutofilled] = useState(false);
|
|
86
86
|
const ref = useRef(null);
|
|
87
|
+
const wrapperRef = useRef(null);
|
|
87
88
|
const cursorPositionRef = useRef(0);
|
|
88
89
|
const displayError = error || isDirty && showError;
|
|
89
90
|
const isInternalChange = useRef(false);
|
|
90
91
|
const prevValueRef = useRef(datavalue);
|
|
91
92
|
useEffect(() => {
|
|
93
|
+
var _a, _b, _c;
|
|
92
94
|
const normalizedValue = sanitizeInputValue(datavalue);
|
|
93
95
|
if (!isInternalChange.current && normalizedValue !== rawValue) {
|
|
94
96
|
setRawValue(normalizedValue);
|
|
@@ -100,6 +102,12 @@ const WmText = memo(
|
|
|
100
102
|
if (datavalue === "" || datavalue === null || datavalue === void 0) {
|
|
101
103
|
setIsAutofilled(false);
|
|
102
104
|
}
|
|
105
|
+
const type_attr = (_a = wrapperRef.current) == null ? void 0 : _a.getAttribute("type");
|
|
106
|
+
if (type && !type_attr) {
|
|
107
|
+
(_b = wrapperRef.current) == null ? void 0 : _b.setAttribute("type", type);
|
|
108
|
+
} else {
|
|
109
|
+
(_c = wrapperRef.current) == null ? void 0 : _c.removeAttribute("type");
|
|
110
|
+
}
|
|
103
111
|
}, [datavalue]);
|
|
104
112
|
const validateInput = useCallback(
|
|
105
113
|
(value) => {
|
|
@@ -360,6 +368,7 @@ const WmText = memo(
|
|
|
360
368
|
return /* @__PURE__ */ jsx(
|
|
361
369
|
TextField,
|
|
362
370
|
__spreadProps(__spreadValues({}, events), {
|
|
371
|
+
ref: wrapperRef,
|
|
363
372
|
hidden: props.hidden,
|
|
364
373
|
title: hint || "Text Input",
|
|
365
374
|
name,
|
|
@@ -399,7 +408,6 @@ const WmText = memo(
|
|
|
399
408
|
name: "leadingIcon",
|
|
400
409
|
className: "btn-leading-icon",
|
|
401
410
|
onClick: handleLeadingIconClick,
|
|
402
|
-
"aria-hidden": "true",
|
|
403
411
|
tabIndex: -1,
|
|
404
412
|
children: /* @__PURE__ */ jsx(
|
|
405
413
|
WmAppIcon,
|
|
@@ -418,7 +426,6 @@ const WmText = memo(
|
|
|
418
426
|
name: "trailingIcon",
|
|
419
427
|
className: "btn-trailing-icon",
|
|
420
428
|
onClick: handleTrailingIconClick,
|
|
421
|
-
"aria-hidden": "true",
|
|
422
429
|
tabIndex: -1,
|
|
423
430
|
children: /* @__PURE__ */ jsx(
|
|
424
431
|
WmAppIcon,
|
|
@@ -27,6 +27,7 @@ declare const WmTextareaStandalone: React.ComponentType<import("../../data/form/
|
|
|
27
27
|
width?: number | string;
|
|
28
28
|
height?: number | string;
|
|
29
29
|
className?: string;
|
|
30
|
+
class?: string;
|
|
30
31
|
conditionalstyle?: React.CSSProperties;
|
|
31
32
|
conditionalclass?: string;
|
|
32
33
|
showindevice?: ("xs" | "sm" | "md" | "lg" | "all")[];
|
|
@@ -117,6 +118,7 @@ declare const _default: React.ComponentType<{
|
|
|
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")[];
|
|
@@ -21,6 +21,7 @@ declare const WithForm: React.NamedExoticComponent<import("../../data/form/form-
|
|
|
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")[];
|
|
@@ -106,6 +107,7 @@ declare const _default: React.ComponentType<{
|
|
|
106
107
|
width?: number | string;
|
|
107
108
|
height?: number | string;
|
|
108
109
|
className?: string;
|
|
110
|
+
class?: string;
|
|
109
111
|
conditionalstyle?: React.CSSProperties;
|
|
110
112
|
conditionalclass?: string;
|
|
111
113
|
showindevice?: ("xs" | "sm" | "md" | "lg" | "all")[];
|
|
@@ -26,6 +26,7 @@ declare const _default: import("react").MemoExoticComponent<import("react").Comp
|
|
|
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")[];
|
|
@@ -19,6 +19,7 @@ declare const _default: import("react").MemoExoticComponent<import("react").Comp
|
|
|
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")[];
|
|
@@ -22,6 +22,7 @@ declare const _default: React.ComponentType<{
|
|
|
22
22
|
width?: number | string;
|
|
23
23
|
height?: number | string;
|
|
24
24
|
className?: string;
|
|
25
|
+
class?: string;
|
|
25
26
|
conditionalstyle?: React.CSSProperties;
|
|
26
27
|
conditionalclass?: string;
|
|
27
28
|
showindevice?: ("xs" | "sm" | "md" | "lg" | "all")[];
|
|
@@ -39,6 +39,7 @@ declare const _default: React.ComponentType<{
|
|
|
39
39
|
datavalue?: any;
|
|
40
40
|
width?: string | number;
|
|
41
41
|
height?: string | number;
|
|
42
|
+
class?: string;
|
|
42
43
|
onClick?: (event?: React.MouseEvent<HTMLElement>, widget?: Record<string, any>, newVal?: string | number | null, oldVal?: string | number | null) => void;
|
|
43
44
|
onDoubleClick?: (event: React.MouseEvent<HTMLElement>, widget?: Record<string, any>, newVal?: string | number | null, oldVal?: string | number | null) => void;
|
|
44
45
|
onMouseEnter?: (event: React.MouseEvent<HTMLElement>, widget?: Record<string, any>, newVal?: string | number | null, oldVal?: string | number | null) => void;
|
|
@@ -314,7 +314,8 @@ const WmMenu = memo((props) => {
|
|
|
314
314
|
link: (node == null ? void 0 : node[itemlink]) || dataObject[itemlink] || dataObject["link"],
|
|
315
315
|
hint: (node == null ? void 0 : node[hint]) || dataObject[hint],
|
|
316
316
|
disabled: (node == null ? void 0 : node.disabled) || dataObject.disabled,
|
|
317
|
-
children: children2
|
|
317
|
+
children: children2,
|
|
318
|
+
itemClass: (node == null ? void 0 : node.class) || dataObject["class"]
|
|
318
319
|
};
|
|
319
320
|
},
|
|
320
321
|
[itemlabel, itemicon, itemlink, hint, itemchildren]
|
|
@@ -331,23 +332,25 @@ const WmMenu = memo((props) => {
|
|
|
331
332
|
[menualign]
|
|
332
333
|
);
|
|
333
334
|
const getMenuLayoutStyles = useCallback(() => {
|
|
335
|
+
const positionStyles = {
|
|
336
|
+
inset: "100% auto auto 0px",
|
|
337
|
+
transform: "translateY(0px)"
|
|
338
|
+
};
|
|
334
339
|
switch (menulayout) {
|
|
335
340
|
case LAYOUT.HORIZONTAL:
|
|
336
|
-
return {
|
|
341
|
+
return __spreadProps(__spreadValues({}, positionStyles), {
|
|
337
342
|
display: "flex",
|
|
338
343
|
flexDirection: "row"
|
|
339
|
-
};
|
|
344
|
+
});
|
|
340
345
|
case LAYOUT.GRID:
|
|
341
|
-
return {
|
|
346
|
+
return __spreadProps(__spreadValues({}, positionStyles), {
|
|
342
347
|
display: "grid",
|
|
343
348
|
gridTemplateColumns: "repeat(auto-fill, minmax(150px, 1fr))",
|
|
344
349
|
gap: "8px"
|
|
345
|
-
};
|
|
350
|
+
});
|
|
346
351
|
case LAYOUT.VERTICAL:
|
|
347
352
|
default:
|
|
348
|
-
return {
|
|
349
|
-
display: "block"
|
|
350
|
-
};
|
|
353
|
+
return __spreadValues({}, positionStyles);
|
|
351
354
|
}
|
|
352
355
|
}, [menulayout]);
|
|
353
356
|
const handleMenuClick = useCallback(
|
|
@@ -636,7 +639,7 @@ const WmMenu = memo((props) => {
|
|
|
636
639
|
if (!nodes || !Array.isArray(nodes)) return null;
|
|
637
640
|
return nodes.map((node, index) => {
|
|
638
641
|
var _a2;
|
|
639
|
-
const { label, icon, link, hint: hint2, disabled, children: children2 } = getNodeProperties(node);
|
|
642
|
+
const { label, icon, link, hint: hint2, disabled, children: children2, itemClass } = getNodeProperties(node);
|
|
640
643
|
const itemPath = pathPrefix ? `${pathPrefix}-${index}` : `${index}`;
|
|
641
644
|
const nodeValueLink = (_a2 = node == null ? void 0 : node.value) == null ? void 0 : _a2.link;
|
|
642
645
|
const isActive = nodeValueLink && typeof nodeValueLink === "string" ? isPathMatchingLink(path, nodeValueLink) : link ? isPathMatchingLink(path, link) : false;
|
|
@@ -659,6 +662,7 @@ const WmMenu = memo((props) => {
|
|
|
659
662
|
className: clsx(
|
|
660
663
|
children2 && children2.length > 0 && "dropdown-submenu",
|
|
661
664
|
"app-menu-item",
|
|
665
|
+
itemClass,
|
|
662
666
|
{
|
|
663
667
|
active: isActive,
|
|
664
668
|
hovered: isHovered
|
|
@@ -25,7 +25,7 @@ declare const _default: React.ComponentType<{
|
|
|
25
25
|
onLoad?: (widget: WmPopoverProps) => void | Function;
|
|
26
26
|
onShow?: (event: Event, widget: WmPopoverProps) => void;
|
|
27
27
|
onHide?: (event: Event, widget: WmPopoverProps) => void;
|
|
28
|
-
render?: (props: WmPopoverProps, onLoad: () => void) => React.ReactNode;
|
|
28
|
+
render?: (props: WmPopoverProps, onLoad: (widget?: any) => void) => React.ReactNode;
|
|
29
29
|
disabled?: boolean;
|
|
30
30
|
isOpen?: boolean;
|
|
31
31
|
caption: string;
|
|
@@ -54,6 +54,7 @@ declare const _default: React.ComponentType<{
|
|
|
54
54
|
width?: number | string;
|
|
55
55
|
height?: number | string;
|
|
56
56
|
className?: string;
|
|
57
|
+
class?: string;
|
|
57
58
|
conditionalstyle?: React.CSSProperties;
|
|
58
59
|
conditionalclass?: string;
|
|
59
60
|
showindevice?: ("xs" | "sm" | "md" | "lg" | "all")[];
|
|
@@ -32,6 +32,7 @@ import debounce from "lodash-es/debounce";
|
|
|
32
32
|
import Popover from "@mui/material/Popover";
|
|
33
33
|
import withBaseWrapper from "../../../higherOrder/withBaseWrapper";
|
|
34
34
|
import { WmAnchor } from "../../basic/anchor";
|
|
35
|
+
import { PopoverContext } from "../../../context/PopoverContext";
|
|
35
36
|
import { DEFAULT_PROPS } from "./props";
|
|
36
37
|
const WmPopover = (Props) => {
|
|
37
38
|
var _a, _b, _c;
|
|
@@ -44,6 +45,7 @@ const WmPopover = (Props) => {
|
|
|
44
45
|
const popoverActionsRef = useRef(null);
|
|
45
46
|
const loadedRef = useRef(false);
|
|
46
47
|
const [open, setOpen] = useState(false);
|
|
48
|
+
const [keepContentMounted, setKeepContentMounted] = useState(false);
|
|
47
49
|
const isOpen = Boolean(anchorEl);
|
|
48
50
|
const openPopover = useCallback(() => {
|
|
49
51
|
var _a2;
|
|
@@ -64,6 +66,16 @@ const WmPopover = (Props) => {
|
|
|
64
66
|
setIsDialogOpen(false);
|
|
65
67
|
(_a2 = props == null ? void 0 : props.onHide) == null ? void 0 : _a2.call(props, {}, __spreadValues({ isOpen: false }, props));
|
|
66
68
|
}, [isOpen]);
|
|
69
|
+
const popoverContext = useMemo(
|
|
70
|
+
() => ({
|
|
71
|
+
closeForDialog: () => {
|
|
72
|
+
setKeepContentMounted(true);
|
|
73
|
+
closePopover();
|
|
74
|
+
},
|
|
75
|
+
onDialogClose: () => setKeepContentMounted(false)
|
|
76
|
+
}),
|
|
77
|
+
[closePopover]
|
|
78
|
+
);
|
|
67
79
|
const togglePopover = useCallback(() => {
|
|
68
80
|
if (isOpen) {
|
|
69
81
|
closePopover();
|
|
@@ -260,7 +272,7 @@ const WmPopover = (Props) => {
|
|
|
260
272
|
)
|
|
261
273
|
})
|
|
262
274
|
),
|
|
263
|
-
/* @__PURE__ */ jsxs(
|
|
275
|
+
/* @__PURE__ */ jsx(PopoverContext.Provider, { value: popoverContext, children: /* @__PURE__ */ jsxs(
|
|
264
276
|
Popover,
|
|
265
277
|
{
|
|
266
278
|
action: popoverActionsRef,
|
|
@@ -274,6 +286,7 @@ const WmPopover = (Props) => {
|
|
|
274
286
|
enter: 0,
|
|
275
287
|
exit: 0
|
|
276
288
|
},
|
|
289
|
+
keepMounted: keepContentMounted,
|
|
277
290
|
disableScrollLock: true,
|
|
278
291
|
disableAutoFocus: true,
|
|
279
292
|
disableEnforceFocus: true,
|
|
@@ -288,7 +301,6 @@ const WmPopover = (Props) => {
|
|
|
288
301
|
},
|
|
289
302
|
className: clsx(
|
|
290
303
|
placement,
|
|
291
|
-
props.className,
|
|
292
304
|
"app-popover in popover",
|
|
293
305
|
props.contentanimation && `animated ${props.contentanimation}`,
|
|
294
306
|
`popover-${placement}`,
|
|
@@ -306,10 +318,10 @@ const WmPopover = (Props) => {
|
|
|
306
318
|
}
|
|
307
319
|
),
|
|
308
320
|
props.title && /* @__PURE__ */ jsx("div", { className: "popover-title popover-header", children: props.title }),
|
|
309
|
-
/* @__PURE__ */ jsx("div", { className: "popover-content popover-body", children: props.render && props.content ? /* @__PURE__ */ jsx(Suspense, { fallback: null, children: props.render(props, () => handleLoad(
|
|
321
|
+
/* @__PURE__ */ jsx("div", { className: "popover-content popover-body", children: props.render && props.content ? /* @__PURE__ */ jsx(Suspense, { fallback: null, children: props.render(props, (widget) => handleLoad(widget)) }) : props.children })
|
|
310
322
|
]
|
|
311
323
|
}
|
|
312
|
-
)
|
|
324
|
+
) })
|
|
313
325
|
] });
|
|
314
326
|
};
|
|
315
327
|
var popover_default = withBaseWrapper(WmPopover);
|
|
@@ -19,7 +19,7 @@ interface PopoverProps extends WmAnchorProps {
|
|
|
19
19
|
onLoad?: (widget: WmPopoverProps) => void | Function;
|
|
20
20
|
onShow?: (event: Event, widget: WmPopoverProps) => void;
|
|
21
21
|
onHide?: (event: Event, widget: WmPopoverProps) => void;
|
|
22
|
-
render?: (props: WmPopoverProps, onLoad: () => void) => React.ReactNode;
|
|
22
|
+
render?: (props: WmPopoverProps, onLoad: (widget?: any) => void) => React.ReactNode;
|
|
23
23
|
disabled?: boolean;
|
|
24
24
|
isOpen?: boolean;
|
|
25
25
|
}
|
|
@@ -17,6 +17,7 @@ declare const _default: import("react").ComponentType<{
|
|
|
17
17
|
width?: number | string;
|
|
18
18
|
height?: number | string;
|
|
19
19
|
className?: string;
|
|
20
|
+
class?: string;
|
|
20
21
|
conditionalstyle?: import("react").CSSProperties;
|
|
21
22
|
conditionalclass?: string;
|
|
22
23
|
showindevice?: ("xs" | "sm" | "md" | "lg" | "all")[];
|
|
@@ -35,6 +35,7 @@ import { HttpProvider } from "../hooks/useHttp";
|
|
|
35
35
|
import { removeWidgetsFromContext } from "../utils/widget-cleanup-util";
|
|
36
36
|
import { EVENTEMITTER_METHODS } from "../core/constants/events";
|
|
37
37
|
import { createWidgetProxy } from "../core/proxy-service";
|
|
38
|
+
import { isPrefabScope, publishPartialNamespaces } from "../utils/partial-host-util";
|
|
38
39
|
import { useLayout } from "./LayoutProvider";
|
|
39
40
|
import isPlainObject from "lodash-es/isPlainObject";
|
|
40
41
|
const WidgetContext = createContext(void 0);
|
|
@@ -176,8 +177,14 @@ const WidgetProvider = ({
|
|
|
176
177
|
var _a2;
|
|
177
178
|
if (!data.pageContext) return;
|
|
178
179
|
if ((_a2 = data.pageContext) == null ? void 0 : _a2.isLayout) return;
|
|
179
|
-
|
|
180
|
-
|
|
180
|
+
const registerHost = (widgets) => {
|
|
181
|
+
if (!widgets) return;
|
|
182
|
+
if (isPrefabScope(data.pageContext) || !publishPartialNamespaces(widgets[data.partialName], data.proxy)) {
|
|
183
|
+
widgets[data.partialName] = data.proxy;
|
|
184
|
+
}
|
|
185
|
+
};
|
|
186
|
+
registerHost(proxy.Widgets);
|
|
187
|
+
if (isAppWidgetRegisterNeeded) registerHost(proxy.App.Widgets);
|
|
181
188
|
};
|
|
182
189
|
EVENTEMITTER_METHODS.PARTIAL_STATE_SYNC_ON(handlePartialStateSync);
|
|
183
190
|
return () => {
|
package/core/proxy-service.d.ts
CHANGED
|
@@ -2,8 +2,25 @@ import { PageContextState, ProxyTarget } from "@wavemaker-ai/react-runtime/types
|
|
|
2
2
|
import { OverriddenPropsRegistry } from "@wavemaker-ai/react-runtime/core/script-registry";
|
|
3
3
|
import BaseAppProps from "../higherOrder/BaseAppProps";
|
|
4
4
|
import { FormFieldProps } from "../components/data/form/form-field/props";
|
|
5
|
+
import type { UseFormSetValue } from "react-hook-form";
|
|
6
|
+
/** True when `value` is a built-in that breaks if wrapped in a reactivity Proxy. */
|
|
7
|
+
export declare const isNonProxyableBuiltin: (value: object) => boolean;
|
|
5
8
|
export declare function clearPageWidgetProxyCache(widgetsProxy: object | null | undefined): void;
|
|
6
9
|
export declare const createWidgetProxy: (widget: any, widgetName: string, setPageContext: any, overriddenPropsRegistry?: OverriddenPropsRegistry) => any;
|
|
7
10
|
export declare const createPageProxy: (target: ProxyTarget, setPageContext: React.Dispatch<React.SetStateAction<PageContextState>>, overriddenPropsRegistry?: OverriddenPropsRegistry) => ProxyTarget;
|
|
8
11
|
export declare const createStateProxy: (obj: PageContextState | BaseAppProps, path: string[], setPageContext: React.Dispatch<React.SetStateAction<PageContextState>> | React.Dispatch<React.SetStateAction<BaseAppProps>>, overriddenPropsRegistry?: OverriddenPropsRegistry) => ProxyTarget;
|
|
9
|
-
|
|
12
|
+
/**
|
|
13
|
+
* Distinct fields with their canonical registry key - a field is stored under several keys,
|
|
14
|
+
* so dedupe by identity and keep the first (canonical) key. Iterate this, not Object.keys().
|
|
15
|
+
*/
|
|
16
|
+
export declare const getFormFieldEntries: (formfields: Record<string, any> | undefined) => {
|
|
17
|
+
key: string;
|
|
18
|
+
field: any;
|
|
19
|
+
}[];
|
|
20
|
+
/** Distinct field objects in registration order. */
|
|
21
|
+
export declare const getFormFieldList: (formfields: Record<string, any> | undefined) => any[];
|
|
22
|
+
/** Hidden `<name>_formWidget` lookup alias, so registry iteration yields one entry per field (as in Angular). */
|
|
23
|
+
export declare const defineFieldAlias: (alias: string, widget: any, ...registries: any[]) => void;
|
|
24
|
+
export declare const createFormFieldProxy: (formField: FormFieldProps, setState: React.Dispatch<React.SetStateAction<FormFieldProps>>, overriddenItemsRef: React.MutableRefObject<Record<string, any>>, formProxy: any, formRef?: {
|
|
25
|
+
setValue?: UseFormSetValue<any>;
|
|
26
|
+
}) => any;
|
package/core/proxy-service.js
CHANGED
|
@@ -27,6 +27,32 @@ import { ServiceVariable } from "../variables/service-variable";
|
|
|
27
27
|
import LiveVariable from "../variables/live-variable";
|
|
28
28
|
import { ModelVariable } from "../variables/model-variable";
|
|
29
29
|
import CrudVariable from "../variables/crud-variable";
|
|
30
|
+
const NON_PROXYABLE_TAGS = /* @__PURE__ */ new Set([
|
|
31
|
+
"[object AbortController]",
|
|
32
|
+
"[object AbortSignal]",
|
|
33
|
+
"[object ArrayBuffer]",
|
|
34
|
+
"[object Blob]",
|
|
35
|
+
"[object Date]",
|
|
36
|
+
"[object Error]",
|
|
37
|
+
"[object File]",
|
|
38
|
+
"[object FileList]",
|
|
39
|
+
"[object FormData]",
|
|
40
|
+
"[object Headers]",
|
|
41
|
+
"[object Map]",
|
|
42
|
+
"[object Promise]",
|
|
43
|
+
"[object RegExp]",
|
|
44
|
+
"[object Request]",
|
|
45
|
+
"[object Response]",
|
|
46
|
+
"[object Set]",
|
|
47
|
+
"[object SharedArrayBuffer]",
|
|
48
|
+
"[object URL]",
|
|
49
|
+
"[object URLSearchParams]",
|
|
50
|
+
"[object WeakMap]",
|
|
51
|
+
"[object WeakRef]",
|
|
52
|
+
"[object WeakSet]"
|
|
53
|
+
]);
|
|
54
|
+
const isNonProxyableBuiltin = (value) => NON_PROXYABLE_TAGS.has(Object.prototype.toString.call(value)) || // Covers every TypedArray flavour plus DataView in one check.
|
|
55
|
+
ArrayBuffer.isView(value);
|
|
30
56
|
const proxyMap = /* @__PURE__ */ new WeakMap();
|
|
31
57
|
const pageWidgetProxyCaches = /* @__PURE__ */ new WeakMap();
|
|
32
58
|
function clearPageWidgetProxyCache(widgetsProxy) {
|
|
@@ -209,6 +235,7 @@ const createWidgetProxy = (widget, widgetName, setPageContext, overriddenPropsRe
|
|
|
209
235
|
widget.__isProxy = true;
|
|
210
236
|
const proxy = new Proxy(widget, {
|
|
211
237
|
set(target, prop, value, receiver) {
|
|
238
|
+
var _a;
|
|
212
239
|
if (typeof prop === "symbol" || prop === "prototype") {
|
|
213
240
|
return Reflect.set(target, prop, value, receiver);
|
|
214
241
|
}
|
|
@@ -224,10 +251,21 @@ const createWidgetProxy = (widget, widgetName, setPageContext, overriddenPropsRe
|
|
|
224
251
|
}
|
|
225
252
|
Reflect.set(target, prop, value, receiver);
|
|
226
253
|
queueBatchedWidgetContextUpdate(widgetName, widget, prop, value, setPageContext);
|
|
254
|
+
if (prop === "className") {
|
|
255
|
+
Reflect.set(target, "class", value);
|
|
256
|
+
(_a = overriddenPropsRegistry == null ? void 0 : overriddenPropsRegistry.trackOverriddenProps) == null ? void 0 : _a.call(
|
|
257
|
+
overriddenPropsRegistry,
|
|
258
|
+
widgetName,
|
|
259
|
+
"class",
|
|
260
|
+
value,
|
|
261
|
+
widget["data-widget-id"]
|
|
262
|
+
);
|
|
263
|
+
queueBatchedWidgetContextUpdate(widgetName, widget, "class", value, setPageContext);
|
|
264
|
+
}
|
|
227
265
|
return true;
|
|
228
266
|
},
|
|
229
267
|
get(target, prop, receiver) {
|
|
230
|
-
var _a;
|
|
268
|
+
var _a, _b, _c, _d;
|
|
231
269
|
if (typeof prop === "symbol" || prop === "prototype") {
|
|
232
270
|
return Reflect.get(target, prop, receiver);
|
|
233
271
|
}
|
|
@@ -302,6 +340,10 @@ const createWidgetProxy = (widget, widgetName, setPageContext, overriddenPropsRe
|
|
|
302
340
|
);
|
|
303
341
|
return internalValue !== void 0 ? internalValue : widgetOverrides[prop];
|
|
304
342
|
}
|
|
343
|
+
if (prop === "class" || prop === "className") {
|
|
344
|
+
const resolved = (_d = (_c = (_b = widgetOverrides == null ? void 0 : widgetOverrides.class) != null ? _b : Reflect.get(target, "class", receiver)) != null ? _c : widgetOverrides == null ? void 0 : widgetOverrides.className) != null ? _d : Reflect.get(target, "className", receiver);
|
|
345
|
+
return resolved != null ? resolved : "";
|
|
346
|
+
}
|
|
305
347
|
if (isDOMElement(value)) {
|
|
306
348
|
return value;
|
|
307
349
|
}
|
|
@@ -487,7 +529,7 @@ const createStateProxy = (obj, path = [], setPageContext, overriddenPropsRegistr
|
|
|
487
529
|
if (isDOMElement(value)) {
|
|
488
530
|
return value;
|
|
489
531
|
}
|
|
490
|
-
if (value
|
|
532
|
+
if (isNonProxyableBuiltin(value)) {
|
|
491
533
|
return value;
|
|
492
534
|
}
|
|
493
535
|
if (Array.isArray(value)) {
|
|
@@ -550,28 +592,52 @@ const createStateProxy = (obj, path = [], setPageContext, overriddenPropsRegistr
|
|
|
550
592
|
}
|
|
551
593
|
});
|
|
552
594
|
};
|
|
553
|
-
const
|
|
595
|
+
const getFormFieldEntries = (formfields) => {
|
|
596
|
+
const canonicalKeyByField = /* @__PURE__ */ new Map();
|
|
597
|
+
Object.entries(formfields != null ? formfields : {}).forEach(([key, field]) => {
|
|
598
|
+
if (field && !canonicalKeyByField.has(field)) canonicalKeyByField.set(field, key);
|
|
599
|
+
});
|
|
600
|
+
return [...canonicalKeyByField].map(([field, key]) => ({ key, field }));
|
|
601
|
+
};
|
|
602
|
+
const getFormFieldList = (formfields) => getFormFieldEntries(formfields).map(({ field }) => field);
|
|
603
|
+
const defineFieldAlias = (alias, widget, ...registries) => registries.forEach(
|
|
604
|
+
(registry) => registry && Object.defineProperty(registry, alias, {
|
|
605
|
+
value: widget,
|
|
606
|
+
enumerable: false,
|
|
607
|
+
configurable: true,
|
|
608
|
+
writable: true
|
|
609
|
+
})
|
|
610
|
+
);
|
|
611
|
+
const createFormFieldProxy = (formField, setState, overriddenItemsRef, formProxy, formRef) => {
|
|
612
|
+
const { name, formKey } = formField;
|
|
613
|
+
const rhfKey = formKey || name;
|
|
554
614
|
const fieldProxy = new Proxy(formField, {
|
|
555
615
|
get: (target, prop) => {
|
|
616
|
+
if (prop === "setProperty") {
|
|
617
|
+
return function(key, value) {
|
|
618
|
+
fieldProxy[key] = value;
|
|
619
|
+
return this;
|
|
620
|
+
};
|
|
621
|
+
}
|
|
556
622
|
return target[prop];
|
|
557
623
|
},
|
|
558
624
|
set: (target, prop, value) => {
|
|
559
625
|
target[prop] = value;
|
|
560
626
|
overriddenItemsRef.current[prop] = value;
|
|
561
627
|
setState(__spreadValues({}, target));
|
|
628
|
+
if ((prop === "datavalue" || prop === "value") && rhfKey && (formRef == null ? void 0 : formRef.setValue)) {
|
|
629
|
+
formRef.setValue(rhfKey, value, { shouldValidate: false, shouldDirty: true });
|
|
630
|
+
}
|
|
562
631
|
return true;
|
|
563
632
|
}
|
|
564
633
|
});
|
|
565
|
-
const
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
}
|
|
571
|
-
|
|
572
|
-
formProxy.formWidgets[`${name}_formWidget`] = fieldProxy;
|
|
573
|
-
formProxy.formfields[`${name}`] = fieldProxy;
|
|
574
|
-
formProxy.formWidgets[`${name}`] = fieldProxy;
|
|
634
|
+
const { formfields, formWidgets } = formProxy;
|
|
635
|
+
[formKey, name].forEach((fieldKey) => {
|
|
636
|
+
if (!fieldKey) return;
|
|
637
|
+
formfields[fieldKey] = fieldProxy;
|
|
638
|
+
formWidgets[fieldKey] = fieldProxy;
|
|
639
|
+
});
|
|
640
|
+
defineFieldAlias(`${name}_formWidget`, fieldProxy, formfields, formWidgets);
|
|
575
641
|
return fieldProxy;
|
|
576
642
|
};
|
|
577
643
|
export {
|
|
@@ -579,5 +645,9 @@ export {
|
|
|
579
645
|
createFormFieldProxy,
|
|
580
646
|
createPageProxy,
|
|
581
647
|
createStateProxy,
|
|
582
|
-
createWidgetProxy
|
|
648
|
+
createWidgetProxy,
|
|
649
|
+
defineFieldAlias,
|
|
650
|
+
getFormFieldEntries,
|
|
651
|
+
getFormFieldList,
|
|
652
|
+
isNonProxyableBuiltin
|
|
583
653
|
};
|
package/higherOrder/BaseApp.js
CHANGED
|
@@ -79,7 +79,8 @@ const BaseApp = (WrappedComponent, addAppScript, getAppVariables, appInfo = {})
|
|
|
79
79
|
subscribe,
|
|
80
80
|
targetPlatform: "WEB",
|
|
81
81
|
hasOwnObjectProperty,
|
|
82
|
-
formatters
|
|
82
|
+
formatters,
|
|
83
|
+
i18nService
|
|
83
84
|
}), appInfo), i18nServiceActions), i18nService));
|
|
84
85
|
const appProxyRef = useRef(null);
|
|
85
86
|
const sessionFailureRequestsRef = useRef([]);
|
|
@@ -235,7 +235,14 @@ const withBaseDateTime = (WrappedComponent) => {
|
|
|
235
235
|
if (date == "CURRENT_DATE") {
|
|
236
236
|
return /* @__PURE__ */ new Date();
|
|
237
237
|
}
|
|
238
|
-
|
|
238
|
+
if (typeof date === "string") {
|
|
239
|
+
const parsed = moment(date).toDate();
|
|
240
|
+
return isNaN(parsed.getTime()) ? void 0 : parsed;
|
|
241
|
+
}
|
|
242
|
+
if (date instanceof Date) {
|
|
243
|
+
return isNaN(date.getTime()) ? void 0 : date;
|
|
244
|
+
}
|
|
245
|
+
return date;
|
|
239
246
|
}, []);
|
|
240
247
|
const handleKeyDown = useCallback((event) => {
|
|
241
248
|
const arrowKeys = Object.values(ARROW_KEYS);
|