@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
|
@@ -2,12 +2,17 @@ import { jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { useContext, useEffect } from "react";
|
|
3
3
|
import clsx from "clsx";
|
|
4
4
|
import Box from "@mui/material/Box";
|
|
5
|
+
import { PartialContentWrapper } from "../../common";
|
|
5
6
|
import { PageLayoutContext } from "../../page/page-context";
|
|
6
7
|
import { getLeftPanelPageClasses } from "./utils/page-class-util";
|
|
7
|
-
const DEFAULT_CLASS = "app-nav-drawer app-left-panel
|
|
8
|
+
const DEFAULT_CLASS = "app-nav-drawer app-left-panel";
|
|
8
9
|
const SLIDE_IN = "slide-in";
|
|
9
10
|
const WmLeftPanel = (props) => {
|
|
10
|
-
const {
|
|
11
|
+
const {
|
|
12
|
+
onLeftPanelPageClassesChange,
|
|
13
|
+
onLeftPanelPresenceChange,
|
|
14
|
+
leftPanelExpanded = false
|
|
15
|
+
} = useContext(PageLayoutContext);
|
|
11
16
|
const {
|
|
12
17
|
styles,
|
|
13
18
|
children,
|
|
@@ -19,7 +24,8 @@ const WmLeftPanel = (props) => {
|
|
|
19
24
|
navtype,
|
|
20
25
|
navheight,
|
|
21
26
|
animation = SLIDE_IN,
|
|
22
|
-
onNavHeightChange
|
|
27
|
+
onNavHeightChange,
|
|
28
|
+
content
|
|
23
29
|
} = props;
|
|
24
30
|
useEffect(() => {
|
|
25
31
|
if (onNavHeightChange) {
|
|
@@ -31,18 +37,27 @@ const WmLeftPanel = (props) => {
|
|
|
31
37
|
}
|
|
32
38
|
};
|
|
33
39
|
}, [navheight, onNavHeightChange]);
|
|
40
|
+
useEffect(() => {
|
|
41
|
+
onLeftPanelPresenceChange == null ? void 0 : onLeftPanelPresenceChange(true);
|
|
42
|
+
return () => {
|
|
43
|
+
onLeftPanelPresenceChange == null ? void 0 : onLeftPanelPresenceChange(false);
|
|
44
|
+
};
|
|
45
|
+
}, [onLeftPanelPresenceChange]);
|
|
34
46
|
useEffect(() => {
|
|
35
47
|
onLeftPanelPageClassesChange == null ? void 0 : onLeftPanelPageClassesChange(
|
|
36
48
|
getLeftPanelPageClasses({
|
|
37
49
|
animation,
|
|
38
50
|
columnwidth,
|
|
39
|
-
xscolumnwidth
|
|
51
|
+
xscolumnwidth,
|
|
52
|
+
expanded: leftPanelExpanded
|
|
40
53
|
})
|
|
41
54
|
);
|
|
55
|
+
}, [animation, columnwidth, xscolumnwidth, leftPanelExpanded, onLeftPanelPageClassesChange]);
|
|
56
|
+
useEffect(() => {
|
|
42
57
|
return () => {
|
|
43
58
|
onLeftPanelPageClassesChange == null ? void 0 : onLeftPanelPageClassesChange(void 0);
|
|
44
59
|
};
|
|
45
|
-
}, [
|
|
60
|
+
}, [onLeftPanelPageClassesChange]);
|
|
46
61
|
return /* @__PURE__ */ jsx(
|
|
47
62
|
Box,
|
|
48
63
|
{
|
|
@@ -51,11 +66,12 @@ const WmLeftPanel = (props) => {
|
|
|
51
66
|
sx: styles,
|
|
52
67
|
className: clsx(
|
|
53
68
|
DEFAULT_CLASS,
|
|
69
|
+
leftPanelExpanded ? "left-panel-expanded" : "left-panel-collapsed",
|
|
54
70
|
className,
|
|
55
71
|
animation,
|
|
56
72
|
`col-md-${columnwidth} col-sm-${columnwidth} col-xs-${xscolumnwidth} ${navtype ? `app-nav-${navtype}` : ""} ${navheight ? `app-nav-${navheight}` : ""}`
|
|
57
73
|
),
|
|
58
|
-
children: render ? render(props) : children
|
|
74
|
+
children: /* @__PURE__ */ jsx(PartialContentWrapper, { content, children: render ? render(props) : children })
|
|
59
75
|
}
|
|
60
76
|
);
|
|
61
77
|
};
|
|
@@ -9,9 +9,10 @@ const getPageWidthClass = (device, panelWidth) => {
|
|
|
9
9
|
return `left-panel-container-${device}-${12 - width}`;
|
|
10
10
|
};
|
|
11
11
|
const getLeftPanelPageClasses = (layout) => {
|
|
12
|
+
const containerClass = layout.expanded ? "left-panel-expanded-container" : "left-panel-collapsed-container";
|
|
12
13
|
if (layout.animation === SLIDE_IN) {
|
|
13
14
|
return clsx(
|
|
14
|
-
|
|
15
|
+
containerClass,
|
|
15
16
|
"slide-in-left-panel-container",
|
|
16
17
|
getPageWidthClass("md", layout.columnwidth),
|
|
17
18
|
getPageWidthClass("sm", layout.columnwidth),
|
|
@@ -19,9 +20,9 @@ const getLeftPanelPageClasses = (layout) => {
|
|
|
19
20
|
);
|
|
20
21
|
}
|
|
21
22
|
if (layout.animation === SLIDE_OVER) {
|
|
22
|
-
return clsx(
|
|
23
|
+
return clsx(containerClass, "slide-over-left-panel-container");
|
|
23
24
|
}
|
|
24
|
-
return
|
|
25
|
+
return containerClass;
|
|
25
26
|
};
|
|
26
27
|
export {
|
|
27
28
|
getLeftPanelPageClasses
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import clsx from "clsx";
|
|
3
3
|
import Box from "@mui/material/Box";
|
|
4
|
+
import { PartialContentWrapper } from "../../common";
|
|
4
5
|
const DEFAULT_CLASS = "app-right-panel";
|
|
5
6
|
const WmRightPanel = (props) => {
|
|
6
|
-
const { styles, children, render, className, columnwidth = 2, id } = props;
|
|
7
|
-
|
|
7
|
+
const { styles, children, render, className, columnwidth = 2, id, content } = props;
|
|
8
|
+
const rendered = render ? render(props) : children;
|
|
9
|
+
return /* @__PURE__ */ jsx(Box, { id, sx: styles, className: clsx(DEFAULT_CLASS, className, `col-sm-${columnwidth}`), children: /* @__PURE__ */ jsx(PartialContentWrapper, { content, children: rendered }) });
|
|
8
10
|
};
|
|
9
11
|
WmRightPanel.displayName = "WmRightPanel";
|
|
10
12
|
var rightnav_default = WmRightPanel;
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import clsx from "clsx";
|
|
3
3
|
import Box from "@mui/material/Box";
|
|
4
|
+
import { PartialContentWrapper } from "../../common";
|
|
4
5
|
const DEFAULT_CLASS = "app-top-nav";
|
|
5
6
|
const WmTopNav = (props) => {
|
|
6
|
-
const { styles, children, render, className, id } = props;
|
|
7
|
+
const { styles, children, render, className, id, content } = props;
|
|
8
|
+
const rendered = render ? render(props) : children;
|
|
7
9
|
return /* @__PURE__ */ jsx(
|
|
8
10
|
Box,
|
|
9
11
|
{
|
|
@@ -14,7 +16,7 @@ const WmTopNav = (props) => {
|
|
|
14
16
|
role: "navigation",
|
|
15
17
|
"aria-label": "Second level navigation",
|
|
16
18
|
"data-role": "page-topnav",
|
|
17
|
-
children:
|
|
19
|
+
children: /* @__PURE__ */ jsx(PartialContentWrapper, { content, children: rendered })
|
|
18
20
|
}
|
|
19
21
|
);
|
|
20
22
|
};
|
|
@@ -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")[];
|
|
@@ -31,7 +31,7 @@ var __objRest = (source, exclude) => {
|
|
|
31
31
|
return target;
|
|
32
32
|
};
|
|
33
33
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
34
|
-
import { memo, useMemo, useState } from "react";
|
|
34
|
+
import { memo, useEffect, useMemo, useRef, useState } from "react";
|
|
35
35
|
import clsx from "clsx";
|
|
36
36
|
import Box from "@mui/material/Box";
|
|
37
37
|
import Link from "@mui/material/Link";
|
|
@@ -66,7 +66,10 @@ const WmNavbar = memo(
|
|
|
66
66
|
"menuiconurl",
|
|
67
67
|
"listener"
|
|
68
68
|
]);
|
|
69
|
+
const collapseRef = useRef(null);
|
|
70
|
+
const timersRef = useRef([]);
|
|
69
71
|
const [isCollapsed, setIsCollapsed] = useState(true);
|
|
72
|
+
useEffect(() => () => timersRef.current.forEach(clearTimeout), []);
|
|
70
73
|
const processedStyles = useMemo(() => {
|
|
71
74
|
if (!styles) return styles;
|
|
72
75
|
if (styles == null ? void 0 : styles.backgroundImage) {
|
|
@@ -74,8 +77,32 @@ const WmNavbar = memo(
|
|
|
74
77
|
}
|
|
75
78
|
return __spreadValues({}, styles);
|
|
76
79
|
}, [styles]);
|
|
77
|
-
const handleToggle = () => {
|
|
78
|
-
|
|
80
|
+
const handleToggle = (event) => {
|
|
81
|
+
var _a2, _b;
|
|
82
|
+
event.stopPropagation();
|
|
83
|
+
const el = collapseRef.current;
|
|
84
|
+
if (!el) return;
|
|
85
|
+
const open = isCollapsed;
|
|
86
|
+
(_a2 = el.getAnimations) == null ? void 0 : _a2.call(el).forEach((a) => a.cancel());
|
|
87
|
+
el.style.overflow = "hidden";
|
|
88
|
+
el.style.display = "block";
|
|
89
|
+
const h = `${el.scrollHeight}px`;
|
|
90
|
+
el.style.height = open ? "0" : h;
|
|
91
|
+
timersRef.current.forEach(clearTimeout);
|
|
92
|
+
const finalize = () => {
|
|
93
|
+
animation == null ? void 0 : animation.cancel();
|
|
94
|
+
Object.assign(el.style, { display: open ? "block" : "none", height: "", overflow: "" });
|
|
95
|
+
};
|
|
96
|
+
const animation = (_b = el.animate) == null ? void 0 : _b.call(el, [{ height: open ? "0" : h }, { height: open ? h : "0" }], {
|
|
97
|
+
duration: 400,
|
|
98
|
+
fill: "forwards"
|
|
99
|
+
});
|
|
100
|
+
if (animation) {
|
|
101
|
+
animation.onfinish = finalize;
|
|
102
|
+
} else {
|
|
103
|
+
timersRef.current[0] = setTimeout(finalize, 400);
|
|
104
|
+
}
|
|
105
|
+
open ? setIsCollapsed(false) : timersRef.current[1] = setTimeout(() => setIsCollapsed(true), 500);
|
|
79
106
|
};
|
|
80
107
|
return /* @__PURE__ */ jsx(
|
|
81
108
|
Box,
|
|
@@ -114,11 +141,9 @@ const WmNavbar = memo(
|
|
|
114
141
|
/* @__PURE__ */ jsx(
|
|
115
142
|
Box,
|
|
116
143
|
{
|
|
144
|
+
ref: collapseRef,
|
|
117
145
|
component: "div",
|
|
118
|
-
className: clsx("navbar-collapse", {
|
|
119
|
-
collapse: isCollapsed,
|
|
120
|
-
in: !isCollapsed
|
|
121
|
-
}),
|
|
146
|
+
className: clsx("navbar-collapse collapse", { in: !isCollapsed }),
|
|
122
147
|
children
|
|
123
148
|
}
|
|
124
149
|
)
|
|
@@ -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
|
|
@@ -740,10 +744,13 @@ const WmMenu = memo((props) => {
|
|
|
740
744
|
]
|
|
741
745
|
);
|
|
742
746
|
useEffect(() => {
|
|
747
|
+
if (props.hidden) {
|
|
748
|
+
setOpen(false);
|
|
749
|
+
}
|
|
743
750
|
if (!open) return;
|
|
744
751
|
setActiveItem(null);
|
|
745
752
|
setFocusedIndex(-1);
|
|
746
|
-
}, [open]);
|
|
753
|
+
}, [open, props.hidden]);
|
|
747
754
|
useEffect(() => {
|
|
748
755
|
if (autoopen === AUTO_OPEN.ALWAYS) {
|
|
749
756
|
setOpen(true);
|
|
@@ -990,7 +997,8 @@ const WmMenu = memo((props) => {
|
|
|
990
997
|
onKeyDown: handleKeyDown,
|
|
991
998
|
role: "menu",
|
|
992
999
|
"aria-label": arialabel || "Menu",
|
|
993
|
-
"aria-expanded": open
|
|
1000
|
+
"aria-expanded": open,
|
|
1001
|
+
hidden: props.hidden
|
|
994
1002
|
}), { type, name }), {
|
|
995
1003
|
children: [
|
|
996
1004
|
/* @__PURE__ */ jsx(Tooltip, { title: hint || "", enterDelay: TOOLTIP_ENTER_DELAY, disableHoverListener: !hint, children: type === "anchor" ? /* @__PURE__ */ jsxs(
|
|
@@ -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}`,
|
|
@@ -309,7 +321,7 @@ const WmPopover = (Props) => {
|
|
|
309
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);
|
package/components/page/index.js
CHANGED
|
@@ -50,12 +50,58 @@ function WmPage(props) {
|
|
|
50
50
|
}));
|
|
51
51
|
const [hasFullNavHeight, setHasFullNavHeight] = useState(false);
|
|
52
52
|
const [leftPanelPageClasses, setLeftPanelPageClasses] = useState();
|
|
53
|
+
const [hasLeftPanel, setHasLeftPanel] = useState(false);
|
|
54
|
+
const [leftPanelExpanded, setLeftPanelExpanded] = useState(false);
|
|
53
55
|
const handleNavHeightChange = useCallback((isFull) => {
|
|
54
56
|
setHasFullNavHeight(isFull);
|
|
55
57
|
}, []);
|
|
56
58
|
const handleLeftPanelPageClassesChange = useCallback((pageClasses) => {
|
|
57
59
|
setLeftPanelPageClasses(pageClasses);
|
|
58
60
|
}, []);
|
|
61
|
+
const handleLeftPanelPresenceChange = useCallback((present) => {
|
|
62
|
+
setHasLeftPanel(present);
|
|
63
|
+
if (!present) {
|
|
64
|
+
setLeftPanelExpanded(false);
|
|
65
|
+
}
|
|
66
|
+
}, []);
|
|
67
|
+
const toggleLeftPanel = useCallback(() => {
|
|
68
|
+
setLeftPanelExpanded((expanded) => !expanded);
|
|
69
|
+
}, []);
|
|
70
|
+
const handlePageClick = useCallback(
|
|
71
|
+
(event) => {
|
|
72
|
+
if (!leftPanelExpanded) {
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
const target = event.target;
|
|
76
|
+
if (!target) {
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
if (target.closest(".app-left-panel")) {
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
if (target.closest("[data-role='page-left-panel-icon']")) {
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
setLeftPanelExpanded(false);
|
|
86
|
+
},
|
|
87
|
+
[leftPanelExpanded]
|
|
88
|
+
);
|
|
89
|
+
const pageLayoutContextValue = useMemo(
|
|
90
|
+
() => ({
|
|
91
|
+
onLeftPanelPageClassesChange: handleLeftPanelPageClassesChange,
|
|
92
|
+
onLeftPanelPresenceChange: handleLeftPanelPresenceChange,
|
|
93
|
+
hasLeftPanel,
|
|
94
|
+
leftPanelExpanded,
|
|
95
|
+
toggleLeftPanel
|
|
96
|
+
}),
|
|
97
|
+
[
|
|
98
|
+
handleLeftPanelPageClassesChange,
|
|
99
|
+
handleLeftPanelPresenceChange,
|
|
100
|
+
hasLeftPanel,
|
|
101
|
+
leftPanelExpanded,
|
|
102
|
+
toggleLeftPanel
|
|
103
|
+
]
|
|
104
|
+
);
|
|
59
105
|
const handleResize = useCallback(() => {
|
|
60
106
|
const newSize = {
|
|
61
107
|
width: window.innerWidth,
|
|
@@ -122,25 +168,20 @@ function WmPage(props) {
|
|
|
122
168
|
return child;
|
|
123
169
|
});
|
|
124
170
|
}, [children, handleNavHeightChange]);
|
|
125
|
-
return /* @__PURE__ */ jsx(
|
|
126
|
-
|
|
127
|
-
{
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
children: childrenWithCallback
|
|
140
|
-
})
|
|
141
|
-
)
|
|
142
|
-
}
|
|
143
|
-
);
|
|
171
|
+
return /* @__PURE__ */ jsx(PageLayoutContext.Provider, { value: pageLayoutContextValue, children: /* @__PURE__ */ jsx(
|
|
172
|
+
Container,
|
|
173
|
+
__spreadProps(__spreadValues({}, removeInvalidAttributes(restProps)), {
|
|
174
|
+
onClick: handlePageClick,
|
|
175
|
+
className: clsx(
|
|
176
|
+
getDefaultClass(pageName),
|
|
177
|
+
{ "app-nav-full": hasFullNavHeight },
|
|
178
|
+
leftPanelPageClasses,
|
|
179
|
+
className
|
|
180
|
+
),
|
|
181
|
+
sx: __spreadValues({}, styles),
|
|
182
|
+
children: childrenWithCallback
|
|
183
|
+
})
|
|
184
|
+
) });
|
|
144
185
|
}
|
|
145
186
|
WmPage.displayName = "WmPage";
|
|
146
187
|
var page_default = WmPage;
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
export interface PageLayoutContextValue {
|
|
2
2
|
onLeftPanelPageClassesChange?: (pageClasses?: string) => void;
|
|
3
|
+
onLeftPanelPresenceChange?: (present: boolean) => void;
|
|
4
|
+
hasLeftPanel?: boolean;
|
|
5
|
+
leftPanelExpanded?: boolean;
|
|
6
|
+
toggleLeftPanel?: () => void;
|
|
3
7
|
}
|
|
4
8
|
export declare const PageLayoutContext: import("react").Context<PageLayoutContextValue>;
|
|
@@ -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
|
@@ -3,6 +3,8 @@ import { OverriddenPropsRegistry } from "@wavemaker-ai/react-runtime/core/script
|
|
|
3
3
|
import BaseAppProps from "../higherOrder/BaseAppProps";
|
|
4
4
|
import { FormFieldProps } from "../components/data/form/form-field/props";
|
|
5
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;
|
|
6
8
|
export declare function clearPageWidgetProxyCache(widgetsProxy: object | null | undefined): void;
|
|
7
9
|
export declare const createWidgetProxy: (widget: any, widgetName: string, setPageContext: any, overriddenPropsRegistry?: OverriddenPropsRegistry) => any;
|
|
8
10
|
export declare const createPageProxy: (target: ProxyTarget, setPageContext: React.Dispatch<React.SetStateAction<PageContextState>>, overriddenPropsRegistry?: OverriddenPropsRegistry) => ProxyTarget;
|