@wavemaker-ai/react-runtime 1.0.0-rc.647612 → 1.0.0-rc.647655
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 +271 -261
- 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
package/actions/login-action.js
CHANGED
|
@@ -10,7 +10,7 @@ class LoginAction extends BaseAction {
|
|
|
10
10
|
invoke(options, successcb, errorcb) {
|
|
11
11
|
let params;
|
|
12
12
|
if (!get(options, "formData")) {
|
|
13
|
-
params = merge(this.config.paramProvider(), this.dataBinding);
|
|
13
|
+
params = merge(options.input, this.config.paramProvider(), this.dataBinding);
|
|
14
14
|
}
|
|
15
15
|
this.notify(VariableEvents.BEFORE_INVOKE, [this, params]);
|
|
16
16
|
return this.config.securityService().login({
|
|
@@ -31,13 +31,13 @@ var __objRest = (source, exclude) => {
|
|
|
31
31
|
return target;
|
|
32
32
|
};
|
|
33
33
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
34
|
-
import { memo, useMemo, useEffect, useState
|
|
34
|
+
import { memo, useMemo, useEffect, useState } from "react";
|
|
35
35
|
import clsx from "clsx";
|
|
36
|
-
import Image from "next/image";
|
|
37
36
|
import Box from "@mui/material/Box";
|
|
38
37
|
import Link from "@mui/material/Link";
|
|
39
38
|
import Badge from "@mui/material/Badge";
|
|
40
39
|
import withBaseWrapper from "../../../higherOrder/withBaseWrapper";
|
|
40
|
+
import { WmAppIcon } from "../../common/WmAppIcon";
|
|
41
41
|
import { removeInvalidAttributes } from "../../../utils/attr";
|
|
42
42
|
import { getCurrentPath, getGoToPageNameFromClickHandler } from "../../../core/util/utils";
|
|
43
43
|
const DEFAULT_CLASS = "app-anchor";
|
|
@@ -48,6 +48,7 @@ const getCurrentPageName = (pathname) => {
|
|
|
48
48
|
const WmAnchor = (props) => {
|
|
49
49
|
var _b;
|
|
50
50
|
const _a = props, {
|
|
51
|
+
ref,
|
|
51
52
|
caption = "Link",
|
|
52
53
|
iconclass,
|
|
53
54
|
styles,
|
|
@@ -68,6 +69,7 @@ const WmAnchor = (props) => {
|
|
|
68
69
|
itemLink,
|
|
69
70
|
href: _ignoredHref
|
|
70
71
|
} = _a, restProps = __objRest(_a, [
|
|
72
|
+
"ref",
|
|
71
73
|
"caption",
|
|
72
74
|
"iconclass",
|
|
73
75
|
"styles",
|
|
@@ -90,7 +92,6 @@ const WmAnchor = (props) => {
|
|
|
90
92
|
]);
|
|
91
93
|
const path = getCurrentPath();
|
|
92
94
|
const [isActive, setIsActive] = useState(false);
|
|
93
|
-
const linkRef = useRef(null);
|
|
94
95
|
const navigationInfo = useMemo(() => {
|
|
95
96
|
if (!onClick) return { hasGoToPageExpr: false, goToPageName: null, isCurrentPage: false };
|
|
96
97
|
const pageName = getGoToPageNameFromClickHandler(onClick);
|
|
@@ -190,7 +191,6 @@ const WmAnchor = (props) => {
|
|
|
190
191
|
return /* @__PURE__ */ jsxs(
|
|
191
192
|
Link,
|
|
192
193
|
__spreadProps(__spreadValues(__spreadProps(__spreadValues({
|
|
193
|
-
ref: linkRef,
|
|
194
194
|
href: computedHref
|
|
195
195
|
}, domEvents), {
|
|
196
196
|
style: __spreadValues(__spreadValues({}, anchorCssVars), styles),
|
|
@@ -213,21 +213,26 @@ const WmAnchor = (props) => {
|
|
|
213
213
|
"data-identifier": "anchor"
|
|
214
214
|
}), removeInvalidAttributes(restProps)), {
|
|
215
215
|
name: props.name,
|
|
216
|
+
ref,
|
|
216
217
|
children: [
|
|
217
|
-
|
|
218
|
-
|
|
218
|
+
/* @__PURE__ */ jsx(
|
|
219
|
+
WmAppIcon,
|
|
219
220
|
{
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
"
|
|
224
|
-
|
|
225
|
-
|
|
221
|
+
iconclass,
|
|
222
|
+
iconurl,
|
|
223
|
+
prefabName: props.prefabName,
|
|
224
|
+
defaultClasses: iconurl ? "anchor-image-icon wm-anchor-icon-media" : "wm-anchor-icon-media",
|
|
225
|
+
iconStyle: {
|
|
226
|
+
width: iconwidth,
|
|
227
|
+
height: iconheight,
|
|
228
|
+
margin: iconmargin,
|
|
229
|
+
fontSize: iconwidth
|
|
230
|
+
},
|
|
231
|
+
alt: "Anchor icon"
|
|
226
232
|
}
|
|
227
233
|
),
|
|
228
|
-
iconclass && /* @__PURE__ */ jsx("i", { className: clsx("app-icon", "wm-anchor-icon-media", iconclass), "aria-hidden": "true" }),
|
|
229
234
|
caption && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
230
|
-
iconclass && /* @__PURE__ */ jsx(Box, { component: "span", className: "sr-only", children: `${caption} ${(_b = listener == null ? void 0 : listener.appLocale) == null ? void 0 : _b.LABEL_ICON}` }),
|
|
235
|
+
(iconclass || iconurl) && /* @__PURE__ */ jsx(Box, { component: "span", className: "sr-only", children: `${caption} ${(_b = listener == null ? void 0 : listener.appLocale) == null ? void 0 : _b.LABEL_ICON}` }),
|
|
231
236
|
/* @__PURE__ */ jsx(Box, { component: "span", className: "anchor-caption", children: caption })
|
|
232
237
|
] }),
|
|
233
238
|
badgevalue && /* @__PURE__ */ jsx(
|
|
@@ -20,8 +20,7 @@ import clsx from "clsx";
|
|
|
20
20
|
import Box from "@mui/material/Box";
|
|
21
21
|
import { withBaseWrapper } from "../../../higherOrder/withBaseWrapper";
|
|
22
22
|
import Label from "../label";
|
|
23
|
-
import
|
|
24
|
-
import { prefixPrefabResourceUrl } from "../../../utils/resource-url";
|
|
23
|
+
import { WmAppIcon } from "../../common/WmAppIcon";
|
|
25
24
|
const DEFAULT_CLASS = "app-icon-wrapper";
|
|
26
25
|
const WmIcon = memo((props) => {
|
|
27
26
|
const {
|
|
@@ -39,10 +38,6 @@ const WmIcon = memo((props) => {
|
|
|
39
38
|
className,
|
|
40
39
|
id
|
|
41
40
|
} = props;
|
|
42
|
-
const computedIconUrl = useMemo(
|
|
43
|
-
() => prefixPrefabResourceUrl(iconurl || "", prefabName),
|
|
44
|
-
[iconurl, prefabName]
|
|
45
|
-
);
|
|
46
41
|
const wrapperStyle = useMemo(() => {
|
|
47
42
|
const rootStyle = __spreadValues({}, styles || {});
|
|
48
43
|
if (iconsize) {
|
|
@@ -72,18 +67,20 @@ const WmIcon = memo((props) => {
|
|
|
72
67
|
caption,
|
|
73
68
|
" Icon"
|
|
74
69
|
] }),
|
|
75
|
-
|
|
76
|
-
|
|
70
|
+
/* @__PURE__ */ jsx(
|
|
71
|
+
WmAppIcon,
|
|
77
72
|
{
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
73
|
+
iconclass,
|
|
74
|
+
iconurl,
|
|
75
|
+
prefabName,
|
|
76
|
+
defaultClasses: iconurl ? "" : "wm-icon-media",
|
|
77
|
+
iconStyle: iconsize ? {
|
|
78
|
+
width: parseInt(iconsize || "24", 10),
|
|
79
|
+
height: parseInt(iconsize || "24", 10),
|
|
80
|
+
fontSize: iconsize
|
|
81
|
+
} : void 0
|
|
85
82
|
}
|
|
86
|
-
)
|
|
83
|
+
),
|
|
87
84
|
caption && /* @__PURE__ */ jsx(
|
|
88
85
|
Label,
|
|
89
86
|
{
|
|
@@ -39,7 +39,7 @@ import { removeInvalidAttributes } from "../../../utils/attr";
|
|
|
39
39
|
import {
|
|
40
40
|
WmSkeleton,
|
|
41
41
|
SKELETON_REGISTRY,
|
|
42
|
-
|
|
42
|
+
useShouldShowSkeleton
|
|
43
43
|
} from "../../common/wm-skeleton";
|
|
44
44
|
const DEFAULT_CLASS = "app-label";
|
|
45
45
|
const containsHTML = (text) => {
|
|
@@ -66,7 +66,7 @@ const WmLabel = memo(
|
|
|
66
66
|
const _a = props, {
|
|
67
67
|
required = false,
|
|
68
68
|
trustAs = false,
|
|
69
|
-
type = "
|
|
69
|
+
type = "label",
|
|
70
70
|
styles,
|
|
71
71
|
className,
|
|
72
72
|
caption,
|
|
@@ -96,7 +96,8 @@ const WmLabel = memo(
|
|
|
96
96
|
"loading",
|
|
97
97
|
"showSkeleton"
|
|
98
98
|
]);
|
|
99
|
-
|
|
99
|
+
const showSkeletonState = useShouldShowSkeleton(loading, showSkeleton);
|
|
100
|
+
if (showSkeletonState) {
|
|
100
101
|
return /* @__PURE__ */ jsx(WmSkeleton, __spreadProps(__spreadValues({}, SKELETON_REGISTRY["WmLabel"]), { className, styles }));
|
|
101
102
|
}
|
|
102
103
|
const hasCaptionProp = Object.prototype.hasOwnProperty.call(props, "caption");
|
|
@@ -147,6 +148,7 @@ const WmLabel = memo(
|
|
|
147
148
|
hidden: (_d = props.hidden) != null ? _d : false
|
|
148
149
|
}, removeInvalidAttributes(rest)), {
|
|
149
150
|
onClick: handleOnClick,
|
|
151
|
+
htmlFor,
|
|
150
152
|
children: parts.map(
|
|
151
153
|
(part, index) => part.link ? /* @__PURE__ */ jsx("a", { href: part.link, target: "_blank", children: part.text }, index) : /* @__PURE__ */ jsx(Fragment, { children: part.text }, index)
|
|
152
154
|
)
|
|
@@ -2,7 +2,7 @@ import { BaseProps, Prettify } from "@wavemaker-ai/react-runtime/higherOrder/pro
|
|
|
2
2
|
/**
|
|
3
3
|
* Valid HTML tags for the Label component.
|
|
4
4
|
*/
|
|
5
|
-
export type ValidTagType = "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "p";
|
|
5
|
+
export type ValidTagType = "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "p" | "label";
|
|
6
6
|
type TextTagType = "text:primary" | "text:secondary" | "text:tertiary" | "text:success" | "text:warning" | "text:danger" | "text:info" | "text:muted";
|
|
7
7
|
type VariantType = "default:p" | "default:h1" | "default:h2" | "default:h3" | "default:h4" | "default:h5" | "default:h6";
|
|
8
8
|
type LabelTagType = "label:primary" | "label:secondary" | "label:tertiary" | "label:success" | "label:warning" | "label:danger" | "label:info" | "label:muted";
|
|
@@ -36,7 +36,7 @@ import { withBaseWrapper } from "../../../higherOrder/withBaseWrapper";
|
|
|
36
36
|
import {
|
|
37
37
|
WmSkeleton,
|
|
38
38
|
SKELETON_REGISTRY,
|
|
39
|
-
|
|
39
|
+
useShouldShowSkeleton
|
|
40
40
|
} from "../../common/wm-skeleton";
|
|
41
41
|
import { prefixPrefabResourceUrl } from "../../../utils/resource-url";
|
|
42
42
|
import { removeInvalidAttributes } from "../../../utils/attr";
|
|
@@ -79,6 +79,7 @@ const WmPicture = memo(
|
|
|
79
79
|
const [imgSource, setImgSource] = useState(sourceProp);
|
|
80
80
|
const [imageWidth, setImageWidth] = useState(props.width || "auto");
|
|
81
81
|
const [imageHeight, setImageHeight] = useState(props.height || "auto");
|
|
82
|
+
const showSkeleton = useShouldShowSkeleton(props.loading, props.showSkeleton);
|
|
82
83
|
useEffect(() => {
|
|
83
84
|
let source = sourceProp || "";
|
|
84
85
|
if (props.encodeurl) {
|
|
@@ -123,7 +124,7 @@ const WmPicture = memo(
|
|
|
123
124
|
const onMouseLeaveHandler = (event) => {
|
|
124
125
|
onMouseLeave && onMouseLeave(event, props);
|
|
125
126
|
};
|
|
126
|
-
if (
|
|
127
|
+
if (showSkeleton)
|
|
127
128
|
return /* @__PURE__ */ jsx(
|
|
128
129
|
WmSkeleton,
|
|
129
130
|
__spreadProps(__spreadValues({}, SKELETON_REGISTRY["WmPicture"]), {
|
|
@@ -59,6 +59,7 @@ declare const WmRichTextEditorStandalone: React.ComponentType<import("../../data
|
|
|
59
59
|
prefabName?: string;
|
|
60
60
|
loading?: boolean;
|
|
61
61
|
showSkeleton?: boolean;
|
|
62
|
+
widget?: string;
|
|
62
63
|
} & import("@wavemaker-ai/react-runtime/higherOrder/withStandalone").WithStandaloneProps>;
|
|
63
64
|
export { WmRichTextEditorStandalone as WmRichtexteditor };
|
|
64
65
|
/**
|
|
@@ -143,5 +144,6 @@ declare const _default: React.ComponentType<{
|
|
|
143
144
|
prefabName?: string;
|
|
144
145
|
loading?: boolean;
|
|
145
146
|
showSkeleton?: boolean;
|
|
147
|
+
widget?: string;
|
|
146
148
|
}>;
|
|
147
149
|
export default _default;
|
|
@@ -17,8 +17,11 @@ declare const WmSearchStandalone: React.ComponentType<import("../../data/form/fo
|
|
|
17
17
|
datacompletemsg?: string;
|
|
18
18
|
loadingdatamsg?: string;
|
|
19
19
|
clearsearchiconclass?: string;
|
|
20
|
+
clearsearchiconurl?: string;
|
|
20
21
|
backsearchiconclass?: string;
|
|
22
|
+
backsearchiconurl?: string;
|
|
21
23
|
searchiconclass?: string;
|
|
24
|
+
searchiconurl?: string;
|
|
22
25
|
navsearchbar?: boolean;
|
|
23
26
|
shortcutkey?: string;
|
|
24
27
|
id?: string;
|
|
@@ -66,6 +69,7 @@ declare const WmSearchStandalone: React.ComponentType<import("../../data/form/fo
|
|
|
66
69
|
handleHeaderClick?: any;
|
|
67
70
|
toggleAllHeaders?: any;
|
|
68
71
|
isUpdateRequired?: boolean;
|
|
72
|
+
query?: string;
|
|
69
73
|
ref?: React.RefObject<HTMLElement> | React.RefObject<null>;
|
|
70
74
|
animation?: string;
|
|
71
75
|
show?: boolean | string;
|
|
@@ -114,6 +118,7 @@ declare const WmSearchStandalone: React.ComponentType<import("../../data/form/fo
|
|
|
114
118
|
prefabName?: string;
|
|
115
119
|
loading?: boolean;
|
|
116
120
|
showSkeleton?: boolean;
|
|
121
|
+
widget?: string;
|
|
117
122
|
}, "ref"> & React.RefAttributes<any> & import("@wavemaker-ai/react-runtime/higherOrder/withStandalone").WithStandaloneProps>;
|
|
118
123
|
export { WmSearchStandalone as WmSearch };
|
|
119
124
|
/**
|
|
@@ -178,5 +183,6 @@ declare const _default: React.NamedExoticComponent<import("../../data/form/form-
|
|
|
178
183
|
prefabName?: string;
|
|
179
184
|
loading?: boolean;
|
|
180
185
|
showSkeleton?: boolean;
|
|
186
|
+
widget?: string;
|
|
181
187
|
}>;
|
|
182
188
|
export default _default;
|
|
@@ -46,6 +46,7 @@ import CircularProgress from "@mui/material/CircularProgress";
|
|
|
46
46
|
import DOMPurify from "dompurify";
|
|
47
47
|
import { Box, Button } from "@mui/material";
|
|
48
48
|
import withBaseWrapper from "../../../higherOrder/withBaseWrapper";
|
|
49
|
+
import { WmAppIcon } from "../../common/WmAppIcon";
|
|
49
50
|
import { transformDataset } from "../../../utils/transformedDataset-utils";
|
|
50
51
|
import { DataProvider, LocalDataProvider } from "./providers";
|
|
51
52
|
import withFormController from "../../data/form/form-controller/withFormController";
|
|
@@ -74,7 +75,7 @@ const Search = React.forwardRef((props, ref) => {
|
|
|
74
75
|
displayfield,
|
|
75
76
|
disabled = false,
|
|
76
77
|
autofocus = false,
|
|
77
|
-
type = "search",
|
|
78
|
+
type: typeProp = "search",
|
|
78
79
|
showsearchicon: showsearchicon = true,
|
|
79
80
|
showbackbutton = false,
|
|
80
81
|
imagewidth: imagewidth = "16px",
|
|
@@ -85,8 +86,11 @@ const Search = React.forwardRef((props, ref) => {
|
|
|
85
86
|
datacompletemsg = "No more data to load",
|
|
86
87
|
loadingdatamsg = "Loading items...",
|
|
87
88
|
clearsearchiconclass = "wi wi-close",
|
|
89
|
+
clearsearchiconurl,
|
|
88
90
|
backsearchiconclass = "wi wi-arrow-left",
|
|
91
|
+
backsearchiconurl,
|
|
89
92
|
searchiconclass = "sl-search wm-sl-l",
|
|
93
|
+
searchiconurl,
|
|
90
94
|
navsearchbar = false,
|
|
91
95
|
className,
|
|
92
96
|
shortcutkey,
|
|
@@ -122,7 +126,8 @@ const Search = React.forwardRef((props, ref) => {
|
|
|
122
126
|
standalone = false,
|
|
123
127
|
viewParent,
|
|
124
128
|
destroy,
|
|
125
|
-
clearSearch
|
|
129
|
+
clearSearch,
|
|
130
|
+
query: queryProp = ""
|
|
126
131
|
} = _a, restProps = __objRest(_a, [
|
|
127
132
|
"showclear",
|
|
128
133
|
"debouncetime",
|
|
@@ -155,8 +160,11 @@ const Search = React.forwardRef((props, ref) => {
|
|
|
155
160
|
"datacompletemsg",
|
|
156
161
|
"loadingdatamsg",
|
|
157
162
|
"clearsearchiconclass",
|
|
163
|
+
"clearsearchiconurl",
|
|
158
164
|
"backsearchiconclass",
|
|
165
|
+
"backsearchiconurl",
|
|
159
166
|
"searchiconclass",
|
|
167
|
+
"searchiconurl",
|
|
160
168
|
"navsearchbar",
|
|
161
169
|
"className",
|
|
162
170
|
"shortcutkey",
|
|
@@ -195,8 +203,10 @@ const Search = React.forwardRef((props, ref) => {
|
|
|
195
203
|
"standalone",
|
|
196
204
|
"viewParent",
|
|
197
205
|
"destroy",
|
|
198
|
-
"clearSearch"
|
|
206
|
+
"clearSearch",
|
|
207
|
+
"query"
|
|
199
208
|
]);
|
|
209
|
+
const type = typeProp === "autocomplete" ? "autocomplete" : "search";
|
|
200
210
|
const debouncedSearchRef = useRef(null);
|
|
201
211
|
const debouncedSearchItemRef = useRef(null);
|
|
202
212
|
const getDataSourceRef = useRef(
|
|
@@ -245,10 +255,26 @@ const Search = React.forwardRef((props, ref) => {
|
|
|
245
255
|
props.dataPath
|
|
246
256
|
]
|
|
247
257
|
);
|
|
258
|
+
const handleQueryChange = useCallback(
|
|
259
|
+
debounce((queryValue) => {
|
|
260
|
+
if (listener == null ? void 0 : listener.onChange) {
|
|
261
|
+
listener.onChange(name, {
|
|
262
|
+
query: queryValue
|
|
263
|
+
});
|
|
264
|
+
}
|
|
265
|
+
}, 100),
|
|
266
|
+
[name]
|
|
267
|
+
);
|
|
268
|
+
useEffect(() => {
|
|
269
|
+
const queryValue = queryProp != null ? queryProp : "";
|
|
270
|
+
setQuery(queryValue);
|
|
271
|
+
handleQueryChange(queryValue);
|
|
272
|
+
}, [queryProp]);
|
|
248
273
|
useEffect(() => {
|
|
249
274
|
var _a2;
|
|
250
275
|
if (datavalue === void 0 || datavalue === null || datavalue === "") {
|
|
251
276
|
setQuery("");
|
|
277
|
+
handleQueryChange("");
|
|
252
278
|
setSelectedItem(null);
|
|
253
279
|
setFormattedDataset([]);
|
|
254
280
|
return;
|
|
@@ -260,6 +286,7 @@ const Search = React.forwardRef((props, ref) => {
|
|
|
260
286
|
const item = (getDisplayExpression == null ? void 0 : getDisplayExpression(value2)) || value2[key];
|
|
261
287
|
if (item) {
|
|
262
288
|
setQuery(item);
|
|
289
|
+
handleQueryChange(item);
|
|
263
290
|
handleUpdateDatavalue(value2);
|
|
264
291
|
}
|
|
265
292
|
}
|
|
@@ -268,12 +295,14 @@ const Search = React.forwardRef((props, ref) => {
|
|
|
268
295
|
if (findItem) {
|
|
269
296
|
let displayValue2 = (getDisplayExpression == null ? void 0 : getDisplayExpression(getSelectedItem(findItem))) || findItem.label;
|
|
270
297
|
setQuery(displayValue2);
|
|
298
|
+
handleQueryChange(displayValue2);
|
|
271
299
|
handleUpdateDatavalue(findItem);
|
|
272
300
|
} else {
|
|
273
301
|
(_a2 = debouncedSearchItemRef.current) == null ? void 0 : _a2.call(debouncedSearchItemRef, datavalue);
|
|
274
302
|
}
|
|
275
303
|
} else if (!isPlainObject(datavalue)) {
|
|
276
304
|
setQuery(datavalue);
|
|
305
|
+
handleQueryChange(datavalue);
|
|
277
306
|
}
|
|
278
307
|
}, [datavalue]);
|
|
279
308
|
const searchStyle = __spreadValues({
|
|
@@ -292,6 +321,7 @@ const Search = React.forwardRef((props, ref) => {
|
|
|
292
321
|
if (findItem && Object.keys(findItem).length > 0) {
|
|
293
322
|
let displayValue2 = (getDisplayExpression == null ? void 0 : getDisplayExpression(getSelectedItem(findItem))) || findItem[key];
|
|
294
323
|
setQuery(displayValue2);
|
|
324
|
+
handleQueryChange(displayValue2);
|
|
295
325
|
}
|
|
296
326
|
}
|
|
297
327
|
}, 200);
|
|
@@ -550,6 +580,7 @@ const Search = React.forwardRef((props, ref) => {
|
|
|
550
580
|
}
|
|
551
581
|
const queryValue = ((_a2 = event == null ? void 0 : event.target) == null ? void 0 : _a2.value) || "";
|
|
552
582
|
setQuery(queryValue);
|
|
583
|
+
handleQueryChange(queryValue);
|
|
553
584
|
if (onChange && (standalone || (listener == null ? void 0 : listener.Widgets) && name && name in listener.Widgets)) {
|
|
554
585
|
onChange(
|
|
555
586
|
event,
|
|
@@ -603,6 +634,7 @@ const Search = React.forwardRef((props, ref) => {
|
|
|
603
634
|
}
|
|
604
635
|
if (props.isSearchInChips) {
|
|
605
636
|
setQuery("");
|
|
637
|
+
handleQueryChange("");
|
|
606
638
|
}
|
|
607
639
|
}
|
|
608
640
|
} else if (event.key === "ArrowDown") {
|
|
@@ -632,6 +664,7 @@ const Search = React.forwardRef((props, ref) => {
|
|
|
632
664
|
const handleClearSearch = (event) => {
|
|
633
665
|
var _a2;
|
|
634
666
|
setQuery("");
|
|
667
|
+
handleQueryChange("");
|
|
635
668
|
setSelectedItem(null);
|
|
636
669
|
if (onClear && (standalone || (listener == null ? void 0 : listener.Widgets) && name && name in listener.Widgets)) {
|
|
637
670
|
onClear(
|
|
@@ -754,8 +787,10 @@ const Search = React.forwardRef((props, ref) => {
|
|
|
754
787
|
const displayVal = (getDisplayExpression == null ? void 0 : getDisplayExpression(selectedItem2)) || item.displayValue || item.label;
|
|
755
788
|
if (props.isSearchInChips) {
|
|
756
789
|
setQuery("");
|
|
790
|
+
handleQueryChange("");
|
|
757
791
|
} else {
|
|
758
792
|
setQuery(displayVal);
|
|
793
|
+
handleQueryChange(displayVal);
|
|
759
794
|
}
|
|
760
795
|
setIsOpen(false);
|
|
761
796
|
setMenuOpen(false);
|
|
@@ -776,7 +811,8 @@ const Search = React.forwardRef((props, ref) => {
|
|
|
776
811
|
onSelect(
|
|
777
812
|
new MouseEvent("click"),
|
|
778
813
|
props,
|
|
779
|
-
|
|
814
|
+
// Chips expects queryModel (DataSetItem), not the raw dataObject
|
|
815
|
+
props.isSearchInChips ? item : selectedItem2
|
|
780
816
|
);
|
|
781
817
|
props.onSubmit && !props.isSearchInChips && props.onSubmit(
|
|
782
818
|
new MouseEvent("click"),
|
|
@@ -978,12 +1014,20 @@ const Search = React.forwardRef((props, ref) => {
|
|
|
978
1014
|
{
|
|
979
1015
|
type: "button",
|
|
980
1016
|
className: clsx("btn btn-icon form-control-feedback clear-btn", {
|
|
981
|
-
"show-btn":
|
|
1017
|
+
"show-btn": showclear && query !== ""
|
|
982
1018
|
}),
|
|
983
1019
|
"aria-label": "Clear",
|
|
984
1020
|
onClick: handleClearSearch,
|
|
985
1021
|
size: "small",
|
|
986
|
-
children: /* @__PURE__ */ jsx(
|
|
1022
|
+
children: /* @__PURE__ */ jsx(
|
|
1023
|
+
WmAppIcon,
|
|
1024
|
+
{
|
|
1025
|
+
iconclass: clearsearchiconclass,
|
|
1026
|
+
iconurl: clearsearchiconurl,
|
|
1027
|
+
prefabName: props.prefabName,
|
|
1028
|
+
alt: "Clear"
|
|
1029
|
+
}
|
|
1030
|
+
)
|
|
987
1031
|
}
|
|
988
1032
|
);
|
|
989
1033
|
const renderSearchIcon = () => {
|
|
@@ -998,16 +1042,32 @@ const Search = React.forwardRef((props, ref) => {
|
|
|
998
1042
|
onClick: handleSearchClick,
|
|
999
1043
|
disabled,
|
|
1000
1044
|
size: "small",
|
|
1001
|
-
children: /* @__PURE__ */ jsx(
|
|
1045
|
+
children: /* @__PURE__ */ jsx(
|
|
1046
|
+
WmAppIcon,
|
|
1047
|
+
{
|
|
1048
|
+
iconclass: searchiconclass,
|
|
1049
|
+
iconurl: searchiconurl,
|
|
1050
|
+
prefabName: props.prefabName,
|
|
1051
|
+
alt: "Search"
|
|
1052
|
+
}
|
|
1053
|
+
)
|
|
1002
1054
|
}
|
|
1003
1055
|
);
|
|
1004
1056
|
}
|
|
1005
1057
|
return null;
|
|
1006
1058
|
};
|
|
1007
1059
|
const renderBackButton = () => {
|
|
1008
|
-
if (showbackbutton && backsearchiconclass) {
|
|
1060
|
+
if (showbackbutton && (backsearchiconclass || backsearchiconurl)) {
|
|
1009
1061
|
return /* @__PURE__ */ jsxs(IconButton, { className: "back-btn", "aria-label": "Back", onClick: handleClearSearch, size: "small", children: [
|
|
1010
|
-
/* @__PURE__ */ jsx(
|
|
1062
|
+
/* @__PURE__ */ jsx(
|
|
1063
|
+
WmAppIcon,
|
|
1064
|
+
{
|
|
1065
|
+
iconclass: backsearchiconclass,
|
|
1066
|
+
iconurl: backsearchiconurl,
|
|
1067
|
+
prefabName: props.prefabName,
|
|
1068
|
+
alt: "Back"
|
|
1069
|
+
}
|
|
1070
|
+
),
|
|
1011
1071
|
/* @__PURE__ */ jsx(Box, { component: "span", className: "sr-only", children: "Back button" })
|
|
1012
1072
|
] });
|
|
1013
1073
|
}
|
|
@@ -84,14 +84,17 @@ export interface SearchProps extends DatasetAwareFormComponentProps {
|
|
|
84
84
|
* CSS class for the clear search icon.
|
|
85
85
|
*/
|
|
86
86
|
clearsearchiconclass?: string;
|
|
87
|
+
clearsearchiconurl?: string;
|
|
87
88
|
/**
|
|
88
89
|
* CSS class for the back search icon.
|
|
89
90
|
*/
|
|
90
91
|
backsearchiconclass?: string;
|
|
92
|
+
backsearchiconurl?: string;
|
|
91
93
|
/**
|
|
92
94
|
* CSS class for the search icon.
|
|
93
95
|
*/
|
|
94
96
|
searchiconclass?: string;
|
|
97
|
+
searchiconurl?: string;
|
|
95
98
|
/**
|
|
96
99
|
* If true, the search bar will be integrated into the navigation bar.
|
|
97
100
|
*/
|
|
@@ -192,6 +195,7 @@ interface DatasetAwareFormComponentProps {
|
|
|
192
195
|
handleHeaderClick?: any;
|
|
193
196
|
toggleAllHeaders?: any;
|
|
194
197
|
isUpdateRequired?: boolean;
|
|
198
|
+
query?: string;
|
|
195
199
|
}
|
|
196
200
|
export interface DataSetItem {
|
|
197
201
|
key: any;
|
|
@@ -17,6 +17,7 @@ declare const _default: React.ComponentType<{
|
|
|
17
17
|
type?: string;
|
|
18
18
|
servicevariabletotrack?: string;
|
|
19
19
|
iconclass?: string;
|
|
20
|
+
iconurl?: string;
|
|
20
21
|
iconsize?: string;
|
|
21
22
|
image?: string;
|
|
22
23
|
imagewidth?: string;
|
|
@@ -72,5 +73,6 @@ declare const _default: React.ComponentType<{
|
|
|
72
73
|
prefabName?: string;
|
|
73
74
|
loading?: boolean;
|
|
74
75
|
showSkeleton?: boolean;
|
|
76
|
+
widget?: string;
|
|
75
77
|
}>;
|
|
76
78
|
export default _default;
|