@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
|
@@ -38,7 +38,7 @@ import Link from "@mui/material/Link";
|
|
|
38
38
|
import {
|
|
39
39
|
withBaseWrapper
|
|
40
40
|
} from "../../higherOrder/withBaseWrapper";
|
|
41
|
-
import {
|
|
41
|
+
import { WmAppIcon } from "../common/WmAppIcon";
|
|
42
42
|
import { removeInvalidAttributes } from "../../utils/attr";
|
|
43
43
|
const DEFAULT_CLASS = "navbar navbar-default app-navbar";
|
|
44
44
|
const WmNavbar = memo(
|
|
@@ -51,6 +51,8 @@ const WmNavbar = memo(
|
|
|
51
51
|
title,
|
|
52
52
|
brandHref = "#",
|
|
53
53
|
showToggle = true,
|
|
54
|
+
menuiconclass = "wi wi-more-vert",
|
|
55
|
+
menuiconurl,
|
|
54
56
|
listener
|
|
55
57
|
} = _a, restProps = __objRest(_a, [
|
|
56
58
|
"className",
|
|
@@ -60,6 +62,8 @@ const WmNavbar = memo(
|
|
|
60
62
|
"title",
|
|
61
63
|
"brandHref",
|
|
62
64
|
"showToggle",
|
|
65
|
+
"menuiconclass",
|
|
66
|
+
"menuiconurl",
|
|
63
67
|
"listener"
|
|
64
68
|
]);
|
|
65
69
|
const [isCollapsed, setIsCollapsed] = useState(true);
|
|
@@ -83,16 +87,26 @@ const WmNavbar = memo(
|
|
|
83
87
|
}, removeInvalidAttributes(restProps)), {
|
|
84
88
|
children: /* @__PURE__ */ jsxs(Box, { component: "div", className: "container-fluid", children: [
|
|
85
89
|
/* @__PURE__ */ jsxs(Box, { component: "div", className: "navbar-header", children: [
|
|
86
|
-
showToggle && /* @__PURE__ */
|
|
87
|
-
|
|
90
|
+
showToggle && /* @__PURE__ */ jsxs(
|
|
91
|
+
"button",
|
|
88
92
|
{
|
|
89
|
-
name: "navbar-toggle",
|
|
90
93
|
type: "button",
|
|
91
94
|
className: clsx("btn-transparent navbar-toggle", { collapsed: isCollapsed }),
|
|
92
95
|
onClick: handleToggle,
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
+
"aria-label": "Toggle navigation",
|
|
97
|
+
"aria-expanded": !isCollapsed,
|
|
98
|
+
children: [
|
|
99
|
+
/* @__PURE__ */ jsx("span", { className: "sr-only", children: "Toggle navigation" }),
|
|
100
|
+
/* @__PURE__ */ jsx(
|
|
101
|
+
WmAppIcon,
|
|
102
|
+
{
|
|
103
|
+
iconclass: menuiconclass,
|
|
104
|
+
iconurl: menuiconurl,
|
|
105
|
+
prefabName: props.prefabName,
|
|
106
|
+
alt: "Menu icon"
|
|
107
|
+
}
|
|
108
|
+
)
|
|
109
|
+
]
|
|
96
110
|
}
|
|
97
111
|
),
|
|
98
112
|
title && /* @__PURE__ */ jsx(Link, { className: "navbar-brand", href: brandHref, underline: "none", children: /* @__PURE__ */ jsx("span", { className: "title", children: title }) })
|
|
@@ -30,10 +30,10 @@ declare const _default: React.ComponentType<{
|
|
|
30
30
|
loggedInUser?: import("../../../store/slices/authSlice").LoggedInUserConfig | null;
|
|
31
31
|
type?: "button" | "anchor";
|
|
32
32
|
prefabName?: string;
|
|
33
|
+
caption?: string;
|
|
33
34
|
key?: string;
|
|
34
35
|
loading?: boolean;
|
|
35
36
|
id?: string;
|
|
36
|
-
caption?: string;
|
|
37
37
|
ref?: React.RefObject<HTMLElement> | React.RefObject<null>;
|
|
38
38
|
"data-widget-id"?: string;
|
|
39
39
|
datavalue?: any;
|
|
@@ -75,8 +75,10 @@ declare const _default: React.ComponentType<{
|
|
|
75
75
|
updateon?: string;
|
|
76
76
|
dataset?: any;
|
|
77
77
|
showSkeleton?: boolean;
|
|
78
|
+
widget?: string;
|
|
78
79
|
orderby?: string;
|
|
79
80
|
iconclass?: string;
|
|
81
|
+
iconurl?: string;
|
|
80
82
|
onSelect?: ($event: React.MouseEvent<HTMLElement>, widget: any, $item: any) => void;
|
|
81
83
|
shortcutkey?: string;
|
|
82
84
|
iconposition?: string;
|
|
@@ -36,6 +36,7 @@ import Box from "@mui/material/Box";
|
|
|
36
36
|
import Button from "@mui/material/Button";
|
|
37
37
|
import Tooltip from "@mui/material/Tooltip";
|
|
38
38
|
import { withBaseWrapper } from "../../../higherOrder/withBaseWrapper";
|
|
39
|
+
import { WmAppIcon } from "../../common/WmAppIcon";
|
|
39
40
|
import { transformDataset } from "../../../utils/transformedDataset-utils";
|
|
40
41
|
import {
|
|
41
42
|
POSITION,
|
|
@@ -82,6 +83,7 @@ const WmMenu = memo((props) => {
|
|
|
82
83
|
menuclass,
|
|
83
84
|
linktarget = "_self",
|
|
84
85
|
iconclass,
|
|
86
|
+
iconurl,
|
|
85
87
|
type = "button",
|
|
86
88
|
animateitems,
|
|
87
89
|
disableMenuContext = false,
|
|
@@ -130,6 +132,7 @@ const WmMenu = memo((props) => {
|
|
|
130
132
|
"menuclass",
|
|
131
133
|
"linktarget",
|
|
132
134
|
"iconclass",
|
|
135
|
+
"iconurl",
|
|
133
136
|
"type",
|
|
134
137
|
"animateitems",
|
|
135
138
|
"disableMenuContext",
|
|
@@ -389,7 +392,7 @@ const WmMenu = memo((props) => {
|
|
|
389
392
|
icon: ((_d = item.dataObject) == null ? void 0 : _d.icon) || icon,
|
|
390
393
|
link,
|
|
391
394
|
target: (_e = item.dataObject) == null ? void 0 : _e.target
|
|
392
|
-
}), item == null ? void 0 : item.value);
|
|
395
|
+
}), typeof (item == null ? void 0 : item.value) === "object" && (item == null ? void 0 : item.value) !== null ? item.value : {});
|
|
393
396
|
if (onSelect) {
|
|
394
397
|
onSelect(event, props, simplifiedItem);
|
|
395
398
|
}
|
|
@@ -1009,7 +1012,15 @@ const WmMenu = memo((props) => {
|
|
|
1009
1012
|
}
|
|
1010
1013
|
}, removeInvalidAttributes(restProps)), {
|
|
1011
1014
|
children: [
|
|
1012
|
-
iconclass && /* @__PURE__ */ jsx(
|
|
1015
|
+
(iconclass || iconurl) && /* @__PURE__ */ jsx(
|
|
1016
|
+
WmAppIcon,
|
|
1017
|
+
{
|
|
1018
|
+
iconclass,
|
|
1019
|
+
iconurl,
|
|
1020
|
+
prefabName: props.prefabName,
|
|
1021
|
+
alt: "Menu icon"
|
|
1022
|
+
}
|
|
1023
|
+
),
|
|
1013
1024
|
/* @__PURE__ */ jsx("span", { className: "sr-only", children: `${caption} ${(_c = listener == null ? void 0 : listener.appLocale) == null ? void 0 : _c.LABEL_ICON}` }),
|
|
1014
1025
|
/* @__PURE__ */ jsx("span", { className: "anchor-caption", children: caption || "" }),
|
|
1015
1026
|
/* @__PURE__ */ jsx(
|
|
@@ -1028,7 +1039,6 @@ const WmMenu = memo((props) => {
|
|
|
1028
1039
|
__spreadProps(__spreadValues({
|
|
1029
1040
|
className: clsx(
|
|
1030
1041
|
"btn dropdown-toggle",
|
|
1031
|
-
`icon-position-${iconposition}`,
|
|
1032
1042
|
"app-button",
|
|
1033
1043
|
menuclass,
|
|
1034
1044
|
`menu-layout-${menulayout}`,
|
|
@@ -1050,7 +1060,15 @@ const WmMenu = memo((props) => {
|
|
|
1050
1060
|
}, buttonStyles), menuContainerStyles)
|
|
1051
1061
|
}, removeInvalidAttributes(restProps)), {
|
|
1052
1062
|
children: [
|
|
1053
|
-
iconclass && /* @__PURE__ */ jsx(
|
|
1063
|
+
(iconclass || iconurl) && /* @__PURE__ */ jsx(
|
|
1064
|
+
WmAppIcon,
|
|
1065
|
+
{
|
|
1066
|
+
iconclass,
|
|
1067
|
+
iconurl,
|
|
1068
|
+
prefabName: props.prefabName,
|
|
1069
|
+
alt: "Menu icon"
|
|
1070
|
+
}
|
|
1071
|
+
),
|
|
1054
1072
|
/* @__PURE__ */ jsx("span", { className: "btn-caption", children: caption }),
|
|
1055
1073
|
/* @__PURE__ */ jsx(
|
|
1056
1074
|
"span",
|
|
@@ -18,7 +18,7 @@ var __spreadValues = (a, b) => {
|
|
|
18
18
|
};
|
|
19
19
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
20
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
21
|
-
import { useRef, useState, useEffect, useMemo, Suspense, useCallback } from "react";
|
|
21
|
+
import { useRef, useState, useEffect, useMemo, Suspense, useCallback, useLayoutEffect } from "react";
|
|
22
22
|
import clsx from "clsx";
|
|
23
23
|
import debounce from "lodash-es/debounce";
|
|
24
24
|
import Popover from "@mui/material/Popover";
|
|
@@ -33,6 +33,7 @@ const WmPopover = (Props) => {
|
|
|
33
33
|
const [isDialogOpen, setIsDialogOpen] = useState(false);
|
|
34
34
|
const anchorRef = useRef(null);
|
|
35
35
|
const popoverContentRef = useRef(null);
|
|
36
|
+
const popoverActionsRef = useRef(null);
|
|
36
37
|
const loadedRef = useRef(false);
|
|
37
38
|
const [open, setOpen] = useState(false);
|
|
38
39
|
const isOpen = Boolean(anchorEl);
|
|
@@ -62,13 +63,20 @@ const WmPopover = (Props) => {
|
|
|
62
63
|
openPopover();
|
|
63
64
|
}
|
|
64
65
|
}, [isOpen, openPopover, closePopover]);
|
|
66
|
+
const apiRef = useRef({
|
|
67
|
+
open: openPopover,
|
|
68
|
+
close: closePopover,
|
|
69
|
+
toggle: togglePopover,
|
|
70
|
+
isOpen
|
|
71
|
+
});
|
|
72
|
+
apiRef.current = { open: openPopover, close: closePopover, toggle: togglePopover, isOpen };
|
|
65
73
|
useEffect(() => {
|
|
66
74
|
const { listener, name } = props;
|
|
67
75
|
if ((listener == null ? void 0 : listener.onChange) && name) {
|
|
68
76
|
listener.onChange(name, {
|
|
69
|
-
open:
|
|
70
|
-
close:
|
|
71
|
-
toggle:
|
|
77
|
+
open: () => apiRef.current.open(),
|
|
78
|
+
close: () => apiRef.current.close(),
|
|
79
|
+
toggle: () => apiRef.current.toggle(),
|
|
72
80
|
isOpen
|
|
73
81
|
});
|
|
74
82
|
}
|
|
@@ -85,7 +93,7 @@ const WmPopover = (Props) => {
|
|
|
85
93
|
}
|
|
86
94
|
handleLoad(__spreadValues({ isOpen }, props));
|
|
87
95
|
}, [isOpen]);
|
|
88
|
-
const calculatePlacement = () => {
|
|
96
|
+
const calculatePlacement = useCallback(() => {
|
|
89
97
|
if (!anchorRef.current) return;
|
|
90
98
|
const rect = anchorRef.current.getBoundingClientRect();
|
|
91
99
|
const viewHeight = window.innerHeight;
|
|
@@ -99,7 +107,12 @@ const WmPopover = (Props) => {
|
|
|
99
107
|
else if (props.popoverplacement === "right" && viewWidth - rect.right < width)
|
|
100
108
|
setPlacement("left");
|
|
101
109
|
else setPlacement(props.popoverplacement || "bottom");
|
|
102
|
-
};
|
|
110
|
+
}, [props.popoverplacement, props.popoverheight, props.popoverwidth]);
|
|
111
|
+
useLayoutEffect(() => {
|
|
112
|
+
var _a2, _b2;
|
|
113
|
+
if (!isOpen) return;
|
|
114
|
+
(_b2 = (_a2 = popoverActionsRef.current) == null ? void 0 : _a2.updatePosition) == null ? void 0 : _b2.call(_a2);
|
|
115
|
+
}, [props.children]);
|
|
103
116
|
useEffect(() => {
|
|
104
117
|
if (!isOpen || props.autoclose === "disabled") return;
|
|
105
118
|
const handleOutsideClick = (event) => {
|
|
@@ -191,7 +204,7 @@ const WmPopover = (Props) => {
|
|
|
191
204
|
}), {
|
|
192
205
|
marginLeft: "-4px"
|
|
193
206
|
});
|
|
194
|
-
}, [placement
|
|
207
|
+
}, [placement]);
|
|
195
208
|
const popoverHeight = ((_a = props == null ? void 0 : props.popoverheight) == null ? void 0 : _a.includes("px")) ? props == null ? void 0 : props.popoverheight : `${props == null ? void 0 : props.popoverheight}px`;
|
|
196
209
|
const popoverWidth = ((_b = props == null ? void 0 : props.popoverwidth) == null ? void 0 : _b.includes("px")) ? props == null ? void 0 : props.popoverwidth : `${props == null ? void 0 : props.popoverwidth}px`;
|
|
197
210
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
@@ -202,7 +215,6 @@ const WmPopover = (Props) => {
|
|
|
202
215
|
"disable-popover": props.disabled,
|
|
203
216
|
"app-popover-wrapper": true
|
|
204
217
|
}),
|
|
205
|
-
style: props.styles,
|
|
206
218
|
hidden: props.hidden
|
|
207
219
|
}, { name: props.name }), {
|
|
208
220
|
children: /* @__PURE__ */ jsx(
|
|
@@ -235,13 +247,15 @@ const WmPopover = (Props) => {
|
|
|
235
247
|
encodeurl: props.encodeurl,
|
|
236
248
|
shortcutkey: props.shortcutkey,
|
|
237
249
|
name: props.name
|
|
238
|
-
}
|
|
250
|
+
},
|
|
251
|
+
props.name
|
|
239
252
|
)
|
|
240
253
|
})
|
|
241
254
|
),
|
|
242
255
|
/* @__PURE__ */ jsxs(
|
|
243
256
|
Popover,
|
|
244
257
|
{
|
|
258
|
+
action: popoverActionsRef,
|
|
245
259
|
hidden: props.hidden,
|
|
246
260
|
open: isOpen,
|
|
247
261
|
anchorEl,
|
package/components/page/index.js
CHANGED
|
@@ -38,7 +38,7 @@ import React from "react";
|
|
|
38
38
|
import { removeInvalidAttributes } from "../../utils/attr";
|
|
39
39
|
import { PageLayoutContext } from "./page-context";
|
|
40
40
|
import { getCurrentPath } from "../../core/util/utils";
|
|
41
|
-
const getDefaultClass = (pageName) => clsx("app-page",
|
|
41
|
+
const getDefaultClass = (pageName) => clsx("app-page", "container");
|
|
42
42
|
function WmPage(props) {
|
|
43
43
|
const pathname = getCurrentPath();
|
|
44
44
|
const pageName = pathname.split("/").pop();
|
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx } from "react/jsx-runtime";
|
|
3
3
|
import clsx from "clsx";
|
|
4
|
+
import { useAppState } from "../../../context/WidgetProvider";
|
|
5
|
+
import { getCurrentPath } from "../../../core/util/utils";
|
|
4
6
|
const DEFAULT_CLASS = "app-page-content app-content-column";
|
|
5
7
|
function WmPageContent(props) {
|
|
6
8
|
const { className, columnwidth, styles, layoutClassName } = props;
|
|
7
|
-
|
|
9
|
+
const appState = useAppState();
|
|
10
|
+
const pageName = ((appState == null ? void 0 : appState.componentName) || (appState == null ? void 0 : appState.name) || getCurrentPath().split("/").pop() || "").toLowerCase();
|
|
11
|
+
return /* @__PURE__ */ jsx("div", { className: "app-content-column-wrapper", children: /* @__PURE__ */ jsx("div", { className: clsx(pageName && `app-page-${pageName}`), style: { display: "inline" }, children: /* @__PURE__ */ jsx(
|
|
8
12
|
"div",
|
|
9
13
|
{
|
|
10
14
|
style: styles,
|
|
@@ -16,7 +20,7 @@ function WmPageContent(props) {
|
|
|
16
20
|
),
|
|
17
21
|
children: props.children
|
|
18
22
|
}
|
|
19
|
-
);
|
|
23
|
+
) }) });
|
|
20
24
|
}
|
|
21
25
|
WmPageContent.displayName = "WmPageContent";
|
|
22
26
|
var page_content_default = WmPageContent;
|
|
@@ -19,6 +19,7 @@ var __spreadValues = (a, b) => {
|
|
|
19
19
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
20
|
import { jsx } from "react/jsx-runtime";
|
|
21
21
|
import React, { memo, useCallback } from "react";
|
|
22
|
+
import clsx from "clsx";
|
|
22
23
|
import Container from "@mui/material/Container";
|
|
23
24
|
import appstore from "../../../core/appstore";
|
|
24
25
|
import isEqual from "lodash-es/isEqual";
|
|
@@ -69,7 +70,7 @@ const CodegenPartialContainer = memo((props) => {
|
|
|
69
70
|
const partial = partials.find((p) => p.name === content);
|
|
70
71
|
return partial ? React.createElement(partial.component, __spreadProps(__spreadValues({}, params), { onLoad: handleOnLoad })) : null;
|
|
71
72
|
};
|
|
72
|
-
return /* @__PURE__ */ jsx(Container, { className: "partial-container", children: contentToRender() });
|
|
73
|
+
return /* @__PURE__ */ jsx("div", { className: clsx(content && `app-partial-${content.toLowerCase()}`), children: /* @__PURE__ */ jsx(Container, { className: "partial-container", children: contentToRender() }) });
|
|
73
74
|
}, arePropsEqual);
|
|
74
75
|
CodegenPartialContainer.displayName = "WmPartialContainer";
|
|
75
76
|
const WmPartialContainer = memo((props) => {
|
|
@@ -31,6 +31,7 @@ var __objRest = (source, exclude) => {
|
|
|
31
31
|
};
|
|
32
32
|
import { jsx } from "react/jsx-runtime";
|
|
33
33
|
import { useEffect, useRef } from "react";
|
|
34
|
+
import clsx from "clsx";
|
|
34
35
|
import { removeInvalidAttributes } from "../../utils/attr";
|
|
35
36
|
const WmPrefab = (props) => {
|
|
36
37
|
const _a = props, {
|
|
@@ -69,14 +70,14 @@ const WmPrefab = (props) => {
|
|
|
69
70
|
}
|
|
70
71
|
};
|
|
71
72
|
}, [onLoad, onDestroy]);
|
|
72
|
-
return /* @__PURE__ */ jsx(
|
|
73
|
+
return /* @__PURE__ */ jsx("div", { className: clsx(props.prefabname && `app-prefab-${props.prefabname.toLowerCase()}`), children: /* @__PURE__ */ jsx(
|
|
73
74
|
"div",
|
|
74
75
|
__spreadProps(__spreadValues({}, removeInvalidAttributes(rest, ["hidden"])), {
|
|
75
76
|
style: __spreadValues(__spreadValues(__spreadValues({}, styles), width !== void 0 && { width: parseFloat(width) }), height !== void 0 && { height: parseFloat(height) }),
|
|
76
77
|
ref,
|
|
77
78
|
children
|
|
78
79
|
})
|
|
79
|
-
);
|
|
80
|
+
) });
|
|
80
81
|
};
|
|
81
82
|
var prefab_default = WmPrefab;
|
|
82
83
|
export {
|
|
@@ -87,10 +87,11 @@ const WidgetProvider = ({
|
|
|
87
87
|
Object.keys(value.Widgets).forEach((widgetName) => {
|
|
88
88
|
var _a2;
|
|
89
89
|
const currentWidget = newContext.Widgets[widgetName];
|
|
90
|
-
const incomingWidget = value.Widgets[widgetName];
|
|
90
|
+
const incomingWidget = proxy.Widgets[widgetName] || value.Widgets[widgetName];
|
|
91
91
|
if (currentWidget == null ? void 0 : currentWidget.App) {
|
|
92
92
|
registerMethod(newContext, (_a2 = pageContextRef.current) == null ? void 0 : _a2.Widgets[widgetName], widgetName);
|
|
93
93
|
} else {
|
|
94
|
+
if (incomingWidget.__isProxy) return;
|
|
94
95
|
if (!isPage && (incomingWidget == null ? void 0 : incomingWidget.isLayout)) return;
|
|
95
96
|
const registry = value == null ? void 0 : value.overriddenPropsRegistry;
|
|
96
97
|
const widgetProxy = createWidgetProxy(
|
package/core/appstore.d.ts
CHANGED
|
@@ -1,8 +1,18 @@
|
|
|
1
1
|
interface I18nService {
|
|
2
2
|
selectedLocale?: string;
|
|
3
|
+
messages?: Record<string, string>;
|
|
4
|
+
formats?: {
|
|
5
|
+
currency?: string;
|
|
6
|
+
date?: string;
|
|
7
|
+
time?: string;
|
|
8
|
+
};
|
|
9
|
+
prefabMessages?: Record<string, string>;
|
|
3
10
|
getSelectedLocale: () => string;
|
|
4
11
|
isRTLLocale: (newLocale?: string) => any;
|
|
5
12
|
setRTL: (locale?: string) => any;
|
|
13
|
+
setSelectedLocale: (locale: string | {
|
|
14
|
+
datavalue: string;
|
|
15
|
+
}) => unknown;
|
|
6
16
|
}
|
|
7
17
|
interface DialogServiceInterface {
|
|
8
18
|
registerDialog: (name: string, dialogInstance: any) => void;
|
package/core/appstore.js
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
|
+
import { isObject } from "lodash-es";
|
|
1
2
|
import { getSessionLocaleSafe } from "./util";
|
|
3
|
+
import { store } from "../store";
|
|
4
|
+
import { setSelectedLocaleAndLoadBundle } from "../store/slices/i18nSlice";
|
|
2
5
|
const map = /* @__PURE__ */ new Map();
|
|
3
6
|
const get = (t) => {
|
|
4
7
|
return map.get(t);
|
|
@@ -35,12 +38,13 @@ const appstore = {
|
|
|
35
38
|
remove,
|
|
36
39
|
getDependency,
|
|
37
40
|
getApp,
|
|
38
|
-
I18nService: getInstance("
|
|
41
|
+
I18nService: getInstance("i18nService"),
|
|
39
42
|
DialogService: getInstance("DialogService")
|
|
40
43
|
};
|
|
41
44
|
if (!appstore.I18nService.get()) {
|
|
42
45
|
appstore.I18nService.set({
|
|
43
46
|
selectedLocale: getSessionLocaleSafe() || "en",
|
|
47
|
+
messages: {},
|
|
44
48
|
getSelectedLocale: function() {
|
|
45
49
|
try {
|
|
46
50
|
const sessionLocale = getSessionLocaleSafe();
|
|
@@ -63,6 +67,10 @@ if (!appstore.I18nService.get()) {
|
|
|
63
67
|
const isRTL = (_a = appstore.I18nService.get()) == null ? void 0 : _a.isRTLLocale(locale);
|
|
64
68
|
document.body.style.direction = isRTL ? "rtl" : "ltr";
|
|
65
69
|
}
|
|
70
|
+
},
|
|
71
|
+
setSelectedLocale: (locale) => {
|
|
72
|
+
const localeValue = isObject(locale) ? locale.datavalue : locale;
|
|
73
|
+
return store.dispatch(setSelectedLocaleAndLoadBundle({ locale: localeValue }));
|
|
66
74
|
}
|
|
67
75
|
});
|
|
68
76
|
}
|
|
@@ -21,4 +21,7 @@ export declare const EVENTEMITTER_METHODS: {
|
|
|
21
21
|
layout: Record<string, any>;
|
|
22
22
|
proxy: any;
|
|
23
23
|
}) => boolean;
|
|
24
|
+
ACTIVE_PAGE_SYNC_ON: (callback: () => void) => EventEmitter<[never]>;
|
|
25
|
+
ACTIVE_PAGE_SYNC_OFF: (callback: () => void) => EventEmitter<[never]>;
|
|
26
|
+
ACTIVE_PAGE_SYNC_EMIT: () => boolean;
|
|
24
27
|
};
|
package/core/constants/events.js
CHANGED
|
@@ -2,13 +2,16 @@ import EventEmitter from "events";
|
|
|
2
2
|
const partialStateSyncEmitter = new EventEmitter();
|
|
3
3
|
const prefabStateSyncEmitter = new EventEmitter();
|
|
4
4
|
const layoutSyncEmitter = new EventEmitter();
|
|
5
|
+
const activePageSyncEmitter = new EventEmitter();
|
|
5
6
|
partialStateSyncEmitter.setMaxListeners(50);
|
|
6
7
|
prefabStateSyncEmitter.setMaxListeners(50);
|
|
7
8
|
layoutSyncEmitter.setMaxListeners(50);
|
|
9
|
+
activePageSyncEmitter.setMaxListeners(50);
|
|
8
10
|
const EVENTEMITTER = {
|
|
9
11
|
LAYOUT_STATE_REFRESH: "layout-state-refresh",
|
|
10
12
|
PARTIAL_STATE_SYNC: "partial-state-sync",
|
|
11
|
-
PREFAB_STATE_SYNC: "prefab-state-sync"
|
|
13
|
+
PREFAB_STATE_SYNC: "prefab-state-sync",
|
|
14
|
+
ACTIVE_PAGE_SYNC: "active-page-sync"
|
|
12
15
|
};
|
|
13
16
|
const EVENTEMITTER_METHODS = {
|
|
14
17
|
PREFAB_STATE_SYNC_ON: (name = "", callback) => {
|
|
@@ -46,6 +49,15 @@ const EVENTEMITTER_METHODS = {
|
|
|
46
49
|
},
|
|
47
50
|
LAYOUT_STATE_REFRESH_EMIT: (data) => {
|
|
48
51
|
return layoutSyncEmitter.emit(EVENTEMITTER.LAYOUT_STATE_REFRESH, data);
|
|
52
|
+
},
|
|
53
|
+
ACTIVE_PAGE_SYNC_ON: (callback) => {
|
|
54
|
+
return activePageSyncEmitter.on(EVENTEMITTER.ACTIVE_PAGE_SYNC, callback);
|
|
55
|
+
},
|
|
56
|
+
ACTIVE_PAGE_SYNC_OFF: (callback) => {
|
|
57
|
+
return activePageSyncEmitter.off(EVENTEMITTER.ACTIVE_PAGE_SYNC, callback);
|
|
58
|
+
},
|
|
59
|
+
ACTIVE_PAGE_SYNC_EMIT: () => {
|
|
60
|
+
return activePageSyncEmitter.emit(EVENTEMITTER.ACTIVE_PAGE_SYNC);
|
|
49
61
|
}
|
|
50
62
|
};
|
|
51
63
|
export {
|
package/core/proxy-service.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ 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
|
+
export declare function clearPageWidgetProxyCache(widgetsProxy: object | null | undefined): void;
|
|
5
6
|
export declare const createWidgetProxy: (widget: any, widgetName: string, setPageContext: any, overriddenPropsRegistry?: OverriddenPropsRegistry) => any;
|
|
6
7
|
export declare const createPageProxy: (target: ProxyTarget, setPageContext: React.Dispatch<React.SetStateAction<PageContextState>>, overriddenPropsRegistry?: OverriddenPropsRegistry) => ProxyTarget;
|
|
7
8
|
export declare const createStateProxy: (obj: PageContextState | BaseAppProps, path: string[], setPageContext: React.Dispatch<React.SetStateAction<PageContextState>> | React.Dispatch<React.SetStateAction<BaseAppProps>>, overriddenPropsRegistry?: OverriddenPropsRegistry) => ProxyTarget;
|
package/core/proxy-service.js
CHANGED
|
@@ -28,6 +28,11 @@ import LiveVariable from "../variables/live-variable";
|
|
|
28
28
|
import { ModelVariable } from "../variables/model-variable";
|
|
29
29
|
import CrudVariable from "../variables/crud-variable";
|
|
30
30
|
const proxyMap = /* @__PURE__ */ new WeakMap();
|
|
31
|
+
const pageWidgetProxyCaches = /* @__PURE__ */ new WeakMap();
|
|
32
|
+
function clearPageWidgetProxyCache(widgetsProxy) {
|
|
33
|
+
var _a;
|
|
34
|
+
(_a = pageWidgetProxyCaches.get(widgetsProxy)) == null ? void 0 : _a.clear();
|
|
35
|
+
}
|
|
31
36
|
let pendingWidgetContextUpdates = null;
|
|
32
37
|
let batchedSetPageContextForWidgets = null;
|
|
33
38
|
function flushPendingWidgetContextUpdates() {
|
|
@@ -201,6 +206,7 @@ const createWidgetProxy = (widget, widgetName, setPageContext, overriddenPropsRe
|
|
|
201
206
|
if (widget == null) {
|
|
202
207
|
return widget;
|
|
203
208
|
}
|
|
209
|
+
widget.__isProxy = true;
|
|
204
210
|
const proxy = new Proxy(widget, {
|
|
205
211
|
set(target, prop, value, receiver) {
|
|
206
212
|
if (typeof prop === "symbol" || prop === "prototype") {
|
|
@@ -231,6 +237,7 @@ const createWidgetProxy = (widget, widgetName, setPageContext, overriddenPropsRe
|
|
|
231
237
|
return this;
|
|
232
238
|
};
|
|
233
239
|
}
|
|
240
|
+
if (prop === "__isProxy") return true;
|
|
234
241
|
if (prop === "$element") {
|
|
235
242
|
const rawElement = Reflect.get(target, prop, receiver);
|
|
236
243
|
if (rawElement) {
|
|
@@ -310,7 +317,7 @@ const createWidgetProxy = (widget, widgetName, setPageContext, overriddenPropsRe
|
|
|
310
317
|
};
|
|
311
318
|
const createPageProxy = (target, setPageContext, overriddenPropsRegistry) => {
|
|
312
319
|
const widgetProxies = /* @__PURE__ */ new Map();
|
|
313
|
-
|
|
320
|
+
const widgetsProxy = new Proxy(target, {
|
|
314
321
|
get(widgetsTarget, widgetName) {
|
|
315
322
|
if (widgetName === void 0 || widgetName === "undefined") {
|
|
316
323
|
return void 0;
|
|
@@ -378,6 +385,39 @@ const createPageProxy = (target, setPageContext, overriddenPropsRegistry) => {
|
|
|
378
385
|
return true;
|
|
379
386
|
}
|
|
380
387
|
});
|
|
388
|
+
pageWidgetProxyCaches.set(widgetsProxy, widgetProxies);
|
|
389
|
+
return widgetsProxy;
|
|
390
|
+
};
|
|
391
|
+
const wrapVariableProxy = (variable, path, varName, setPageContext) => {
|
|
392
|
+
if (proxyMap.has(variable)) {
|
|
393
|
+
return variable;
|
|
394
|
+
}
|
|
395
|
+
const varProxy = new Proxy(variable, {
|
|
396
|
+
set(target, prop, value, receiver) {
|
|
397
|
+
if (typeof prop === "symbol") {
|
|
398
|
+
return Reflect.set(target, prop, value, receiver);
|
|
399
|
+
}
|
|
400
|
+
const prevVal = Reflect.get(target, prop, receiver);
|
|
401
|
+
const result = Reflect.set(target, prop, value, receiver);
|
|
402
|
+
if (prevVal !== value) {
|
|
403
|
+
setPageContext((prev) => {
|
|
404
|
+
const newState = __spreadValues({}, prev);
|
|
405
|
+
let current = newState;
|
|
406
|
+
for (let i = 0; i < path.length; i++) {
|
|
407
|
+
const key = path[i];
|
|
408
|
+
const existing = current[key];
|
|
409
|
+
current[key] = existing ? __spreadValues({}, existing) : {};
|
|
410
|
+
current = current[key];
|
|
411
|
+
}
|
|
412
|
+
current[varName] = target;
|
|
413
|
+
return newState;
|
|
414
|
+
});
|
|
415
|
+
}
|
|
416
|
+
return result;
|
|
417
|
+
}
|
|
418
|
+
});
|
|
419
|
+
proxyMap.set(varProxy, true);
|
|
420
|
+
return varProxy;
|
|
381
421
|
};
|
|
382
422
|
const createStateProxy = (obj, path = [], setPageContext, overriddenPropsRegistry) => {
|
|
383
423
|
const nestedProxies = /* @__PURE__ */ new Map();
|
|
@@ -431,8 +471,18 @@ const createStateProxy = (obj, path = [], setPageContext, overriddenPropsRegistr
|
|
|
431
471
|
if (descriptor && !descriptor.configurable && !descriptor.writable) {
|
|
432
472
|
return value;
|
|
433
473
|
}
|
|
434
|
-
if (value instanceof ServiceVariable || value instanceof LiveVariable) {
|
|
435
|
-
|
|
474
|
+
if (value instanceof ServiceVariable || value instanceof LiveVariable || value instanceof ModelVariable || value instanceof CrudVariable) {
|
|
475
|
+
if (nestedProxies.has(prop)) {
|
|
476
|
+
return nestedProxies.get(prop);
|
|
477
|
+
}
|
|
478
|
+
const varProxy = wrapVariableProxy(
|
|
479
|
+
value,
|
|
480
|
+
path,
|
|
481
|
+
prop,
|
|
482
|
+
setPageContext
|
|
483
|
+
);
|
|
484
|
+
nestedProxies.set(prop, varProxy);
|
|
485
|
+
return varProxy;
|
|
436
486
|
}
|
|
437
487
|
if (isDOMElement(value)) {
|
|
438
488
|
return value;
|
|
@@ -525,6 +575,7 @@ const createFormFieldProxy = (formField, setState, overriddenItemsRef, formProxy
|
|
|
525
575
|
return fieldProxy;
|
|
526
576
|
};
|
|
527
577
|
export {
|
|
578
|
+
clearPageWidgetProxyCache,
|
|
528
579
|
createFormFieldProxy,
|
|
529
580
|
createPageProxy,
|
|
530
581
|
createStateProxy,
|
package/core/util/index.d.ts
CHANGED
|
@@ -38,6 +38,8 @@ export declare const getSessionStorageItem: (key: string) => any;
|
|
|
38
38
|
export declare const getSessionLocaleSafe: () => string | undefined;
|
|
39
39
|
export declare const getTimezone: () => string;
|
|
40
40
|
export declare const formatMessage: (fragment: any, expression: string) => any;
|
|
41
|
+
/** Angular parity: same appLocale object, swap message keys in place so bindings stay valid. */
|
|
42
|
+
export declare function syncLocaleMessages(target: Record<string, any> | undefined, messages: Record<string, any>): boolean;
|
|
41
43
|
export declare function reload(): void;
|
|
42
44
|
export declare const toNumber: (value: any) => number;
|
|
43
45
|
export declare const _get: {
|