@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
|
@@ -22,6 +22,7 @@ import { createElement } from "react";
|
|
|
22
22
|
import React, {
|
|
23
23
|
createContext,
|
|
24
24
|
memo,
|
|
25
|
+
Suspense,
|
|
25
26
|
useCallback,
|
|
26
27
|
useContext,
|
|
27
28
|
useEffect,
|
|
@@ -34,12 +35,12 @@ import isEqual from "lodash-es/isEqual";
|
|
|
34
35
|
import { Tabs } from "@base-ui-components/react/tabs";
|
|
35
36
|
import Typography from "@mui/material/Typography";
|
|
36
37
|
import withBaseWrapper from "../../../higherOrder/withBaseWrapper";
|
|
38
|
+
import { WmAppIcon } from "../../common/WmAppIcon";
|
|
37
39
|
import WmTabPane from "./tab-pane";
|
|
38
40
|
import { DEFAULT_PROPS } from "./props";
|
|
39
41
|
import {
|
|
40
42
|
WmSkeleton,
|
|
41
|
-
SKELETON_REGISTRY
|
|
42
|
-
shouldShowSkeleton
|
|
43
|
+
SKELETON_REGISTRY
|
|
43
44
|
} from "../../common/wm-skeleton";
|
|
44
45
|
import {
|
|
45
46
|
getWidgetState,
|
|
@@ -55,6 +56,7 @@ const PANE_HEADER_PROP_KEYS = [
|
|
|
55
56
|
"disabled",
|
|
56
57
|
"show",
|
|
57
58
|
"paneicon",
|
|
59
|
+
"paneiconurl",
|
|
58
60
|
"badgevalue",
|
|
59
61
|
"badgetype",
|
|
60
62
|
"className",
|
|
@@ -67,6 +69,7 @@ const getPaneHeaderProps = (props) => ({
|
|
|
67
69
|
disabled: props == null ? void 0 : props.disabled,
|
|
68
70
|
show: props == null ? void 0 : props.show,
|
|
69
71
|
paneicon: props == null ? void 0 : props.paneicon,
|
|
72
|
+
paneiconurl: props == null ? void 0 : props.paneiconurl,
|
|
70
73
|
badgevalue: props == null ? void 0 : props.badgevalue,
|
|
71
74
|
badgetype: props == null ? void 0 : props.badgetype,
|
|
72
75
|
className: props == null ? void 0 : props.className,
|
|
@@ -95,17 +98,6 @@ const useTabsContext = () => {
|
|
|
95
98
|
const WmTabs = memo(
|
|
96
99
|
(Props) => {
|
|
97
100
|
const props = __spreadValues(__spreadValues({}, DEFAULT_PROPS), Props);
|
|
98
|
-
if (shouldShowSkeleton(props.loading, props.showSkeleton)) {
|
|
99
|
-
return /* @__PURE__ */ jsx(
|
|
100
|
-
WmSkeleton,
|
|
101
|
-
__spreadProps(__spreadValues({}, SKELETON_REGISTRY["WmTabs"]), {
|
|
102
|
-
rows: props.skeletonRows,
|
|
103
|
-
columns: props.skeletonColumns,
|
|
104
|
-
className: clsx("app-tabs clearfix", props.className),
|
|
105
|
-
styles: props.styles
|
|
106
|
-
})
|
|
107
|
-
);
|
|
108
|
-
}
|
|
109
101
|
const {
|
|
110
102
|
defaultpaneindex,
|
|
111
103
|
statehandler,
|
|
@@ -329,7 +321,7 @@ const WmTabs = memo(
|
|
|
329
321
|
active: selectedIndex === index,
|
|
330
322
|
disabled: item == null ? void 0 : item.disabled
|
|
331
323
|
}),
|
|
332
|
-
hidden: item.show === false,
|
|
324
|
+
hidden: item.show === false || item.show === "false",
|
|
333
325
|
role: "tab",
|
|
334
326
|
"aria-selected": selectedIndex === index,
|
|
335
327
|
tabIndex: selectedIndex === index ? 0 : -1,
|
|
@@ -343,11 +335,19 @@ const WmTabs = memo(
|
|
|
343
335
|
title: item.title || item.name || `Tab ${index + 1}`,
|
|
344
336
|
"aria-selected": selectedIndex === index,
|
|
345
337
|
"aria-disabled": item.disabled,
|
|
346
|
-
"aria-hidden": item.show === false,
|
|
338
|
+
"aria-hidden": item.show === false || item.show === "false",
|
|
347
339
|
"aria-controls": `tabpanel-${index}`,
|
|
348
340
|
onClick: (e) => handleTabHeaderClick(e, item, index),
|
|
349
341
|
children: [
|
|
350
|
-
item.paneicon && /* @__PURE__ */ jsx(
|
|
342
|
+
(item.paneicon || item.paneiconurl) && /* @__PURE__ */ jsx(
|
|
343
|
+
WmAppIcon,
|
|
344
|
+
{
|
|
345
|
+
iconclass: item.paneicon,
|
|
346
|
+
iconurl: item.paneiconurl,
|
|
347
|
+
prefabName: props.prefabName,
|
|
348
|
+
alt: "Tab icon"
|
|
349
|
+
}
|
|
350
|
+
),
|
|
351
351
|
/* @__PURE__ */ jsx(Typography, { variant: "body2", component: "span", children: item.title || item.name || `Tab ${index + 1}` }),
|
|
352
352
|
item.badgevalue && /* @__PURE__ */ jsx(
|
|
353
353
|
Typography,
|
|
@@ -427,7 +427,7 @@ const WmTabs = memo(
|
|
|
427
427
|
return Array.from(renderedTabIndices).filter((index) => index >= 0 && index < dataset.length).map((index) => {
|
|
428
428
|
const item = dataset[index];
|
|
429
429
|
const isActive = selectedIndex === index;
|
|
430
|
-
return /* @__PURE__ */ jsx(React.Fragment, { children: render ? /* @__PURE__ */ jsx(Fragment, { children: render(item, index, dataset, isActive) }) : /* @__PURE__ */ createElement(
|
|
430
|
+
return /* @__PURE__ */ jsx(React.Fragment, { children: render ? /* @__PURE__ */ jsx(Fragment, { children: render(item, index, dataset, isActive) }) : /* @__PURE__ */ jsx(Suspense, { fallback: /* @__PURE__ */ jsx(WmSkeleton, __spreadValues({}, SKELETON_REGISTRY["WmTabs"])), children: /* @__PURE__ */ createElement(
|
|
431
431
|
WmTabPane,
|
|
432
432
|
__spreadProps(__spreadValues({}, item), {
|
|
433
433
|
key: index,
|
|
@@ -440,7 +440,7 @@ const WmTabs = memo(
|
|
|
440
440
|
}),
|
|
441
441
|
index
|
|
442
442
|
})
|
|
443
|
-
) }, index);
|
|
443
|
+
) }) }, index);
|
|
444
444
|
});
|
|
445
445
|
}
|
|
446
446
|
const visibleChildren = filterVisibleChildren(children, hiddenTabNames);
|
|
@@ -29,6 +29,7 @@ declare const _default: React.ComponentType<{
|
|
|
29
29
|
badgevalue?: string | number;
|
|
30
30
|
badgetype?: string;
|
|
31
31
|
paneicon?: string;
|
|
32
|
+
paneiconurl?: string;
|
|
32
33
|
isdynamic?: boolean;
|
|
33
34
|
index?: number;
|
|
34
35
|
item?: Record<string, unknown>;
|
|
@@ -89,5 +90,6 @@ declare const _default: React.ComponentType<{
|
|
|
89
90
|
prefabName?: string;
|
|
90
91
|
loading?: boolean;
|
|
91
92
|
showSkeleton?: boolean;
|
|
93
|
+
widget?: string;
|
|
92
94
|
}>;
|
|
93
95
|
export default _default;
|
|
@@ -68,6 +68,7 @@ const WmTabpane = (props) => {
|
|
|
68
68
|
disabled,
|
|
69
69
|
show: props.show,
|
|
70
70
|
paneicon: props.paneicon,
|
|
71
|
+
paneiconurl: props.paneiconurl,
|
|
71
72
|
badgevalue: props.badgevalue,
|
|
72
73
|
badgetype: props.badgetype,
|
|
73
74
|
className,
|
|
@@ -80,6 +81,7 @@ const WmTabpane = (props) => {
|
|
|
80
81
|
disabled,
|
|
81
82
|
props.show,
|
|
82
83
|
props.paneicon,
|
|
84
|
+
props.paneiconurl,
|
|
83
85
|
props.badgevalue,
|
|
84
86
|
props.badgetype,
|
|
85
87
|
className,
|
|
@@ -2,6 +2,7 @@ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { memo, useMemo } from "react";
|
|
3
3
|
import { Box, Typography } from "@mui/material";
|
|
4
4
|
import clsx from "clsx";
|
|
5
|
+
import { WmAppIcon } from "../../../common/WmAppIcon";
|
|
5
6
|
const CustomStepIcon = memo(
|
|
6
7
|
(props) => {
|
|
7
8
|
const { step, index = 0, wizardClass = "", active, completed } = props;
|
|
@@ -12,20 +13,27 @@ const CustomStepIcon = memo(
|
|
|
12
13
|
const isIconStepper = (wizardClass == null ? void 0 : wizardClass.includes("iconstepper")) || (wizardClass == null ? void 0 : wizardClass.includes("tabstepper"));
|
|
13
14
|
const isCompleted = step.isDone;
|
|
14
15
|
const iconContent = useMemo(() => {
|
|
15
|
-
if (isCompleted && (isDottedStepper || isNumber)) {
|
|
16
|
+
if (isCompleted && (isDottedStepper || isNumber) && !isIconStepper) {
|
|
16
17
|
return /* @__PURE__ */ jsx(Box, { component: "i", className: "app-icon wi wi-done" });
|
|
17
18
|
}
|
|
18
|
-
if (isNumber && !isCompleted) {
|
|
19
|
+
if (isNumber && !isCompleted && !isIconStepper) {
|
|
19
20
|
return /* @__PURE__ */ jsx(Box, { component: "span", className: "count", children: index + 1 });
|
|
20
21
|
}
|
|
21
22
|
if ((isDottedStepper || isTextInline && !isIconStepper) && !isCompleted) {
|
|
22
23
|
return /* @__PURE__ */ jsx(Box, { component: "span", className: "dottedstepper" });
|
|
23
24
|
}
|
|
24
|
-
if (isIconStepper && step.iconclass && (!isCompleted || isCompleted && !step.doneiconclass)) {
|
|
25
|
-
return /* @__PURE__ */ jsx(
|
|
25
|
+
if (isIconStepper && (step.iconclass || step.iconurl) && (!isCompleted || isCompleted && !step.doneiconclass && !step.doneiconurl)) {
|
|
26
|
+
return /* @__PURE__ */ jsx(WmAppIcon, { iconclass: step.iconclass, iconurl: step.iconurl, alt: "Wizard step icon" });
|
|
26
27
|
}
|
|
27
|
-
if (step.doneiconclass && isCompleted && isIconStepper) {
|
|
28
|
-
return /* @__PURE__ */ jsx(
|
|
28
|
+
if ((step.doneiconclass || step.doneiconurl) && isCompleted && isIconStepper) {
|
|
29
|
+
return /* @__PURE__ */ jsx(
|
|
30
|
+
WmAppIcon,
|
|
31
|
+
{
|
|
32
|
+
iconclass: step.doneiconclass,
|
|
33
|
+
iconurl: step.doneiconurl,
|
|
34
|
+
alt: "Wizard done icon"
|
|
35
|
+
}
|
|
36
|
+
);
|
|
29
37
|
}
|
|
30
38
|
return null;
|
|
31
39
|
}, [step, index, isCompleted, isDottedStepper, isNumber, isTextInline, isIconStepper]);
|
|
@@ -79,6 +79,7 @@ declare const WmWizardStandalone: React.ComponentType<{
|
|
|
79
79
|
prefabName?: string;
|
|
80
80
|
loading?: boolean;
|
|
81
81
|
showSkeleton?: boolean;
|
|
82
|
+
widget?: string;
|
|
82
83
|
} & import("@wavemaker-ai/react-runtime/higherOrder/withStandalone").WithStandaloneProps>;
|
|
83
84
|
export { WmWizardStandalone as WmWizard };
|
|
84
85
|
/**
|
|
@@ -170,5 +171,6 @@ declare const _default: React.ComponentType<{
|
|
|
170
171
|
prefabName?: string;
|
|
171
172
|
loading?: boolean;
|
|
172
173
|
showSkeleton?: boolean;
|
|
174
|
+
widget?: string;
|
|
173
175
|
}>;
|
|
174
176
|
export default _default;
|
|
@@ -54,7 +54,7 @@ import withStandalone from "../../../higherOrder/withStandalone";
|
|
|
54
54
|
import {
|
|
55
55
|
WmSkeleton,
|
|
56
56
|
SKELETON_REGISTRY,
|
|
57
|
-
|
|
57
|
+
useShouldShowSkeleton
|
|
58
58
|
} from "../../common/wm-skeleton";
|
|
59
59
|
const DEFAULT_CLS = "app-wizard panel clearfix";
|
|
60
60
|
const BODY_CLASS = "app-wizard-body panel-body";
|
|
@@ -838,7 +838,7 @@ const WmWizardComponent = memo(
|
|
|
838
838
|
}
|
|
839
839
|
);
|
|
840
840
|
const WmWizard = (props) => {
|
|
841
|
-
if (
|
|
841
|
+
if (useShouldShowSkeleton(props.loading, props.showSkeleton)) {
|
|
842
842
|
return /* @__PURE__ */ jsx(
|
|
843
843
|
WmSkeleton,
|
|
844
844
|
__spreadProps(__spreadValues({}, SKELETON_REGISTRY["WmWizard"]), {
|
|
@@ -34,7 +34,9 @@ export interface WizardStepData extends Record<string, unknown> {
|
|
|
34
34
|
title: string;
|
|
35
35
|
subtitle?: string;
|
|
36
36
|
iconclass: string;
|
|
37
|
+
iconurl?: string;
|
|
37
38
|
doneiconclass: string;
|
|
39
|
+
doneiconurl?: string;
|
|
38
40
|
show: boolean | string;
|
|
39
41
|
enableskip: boolean;
|
|
40
42
|
enableNext: boolean;
|
|
@@ -235,7 +237,9 @@ export interface WmWizardStepProps {
|
|
|
235
237
|
title?: string;
|
|
236
238
|
subtitle?: string;
|
|
237
239
|
iconclass?: string;
|
|
240
|
+
iconurl?: string;
|
|
238
241
|
doneiconclass?: string;
|
|
242
|
+
doneiconurl?: string;
|
|
239
243
|
enableskip?: boolean;
|
|
240
244
|
disablenext?: boolean;
|
|
241
245
|
disabledone?: boolean;
|
|
@@ -12,7 +12,9 @@ const WmWizardstep = memo(
|
|
|
12
12
|
title = "Step Title",
|
|
13
13
|
subtitle,
|
|
14
14
|
iconclass = "wi wi-person",
|
|
15
|
+
iconurl,
|
|
15
16
|
doneiconclass = "wi wi-done",
|
|
17
|
+
doneiconurl,
|
|
16
18
|
enableskip = false,
|
|
17
19
|
disablenext = false,
|
|
18
20
|
disabledone = false,
|
|
@@ -40,7 +42,9 @@ const WmWizardstep = memo(
|
|
|
40
42
|
title,
|
|
41
43
|
subtitle,
|
|
42
44
|
iconclass,
|
|
45
|
+
iconurl,
|
|
43
46
|
doneiconclass,
|
|
47
|
+
doneiconurl,
|
|
44
48
|
show,
|
|
45
49
|
enableskip,
|
|
46
50
|
enableNext: !disablenext,
|
|
@@ -70,7 +74,9 @@ const WmWizardstep = memo(
|
|
|
70
74
|
title,
|
|
71
75
|
subtitle,
|
|
72
76
|
iconclass,
|
|
77
|
+
iconurl,
|
|
73
78
|
doneiconclass,
|
|
79
|
+
doneiconurl,
|
|
74
80
|
show,
|
|
75
81
|
enableskip,
|
|
76
82
|
disablenext,
|
|
@@ -23,6 +23,7 @@ import withBaseWrapper from "../../../higherOrder/withBaseWrapper";
|
|
|
23
23
|
import { Card, CardHeader, CardMedia, Avatar, Typography, Box } from "@mui/material";
|
|
24
24
|
import Image from "next/image";
|
|
25
25
|
import { WmMenu } from "../../navigation/menu";
|
|
26
|
+
import { WmAppIcon } from "../../common/WmAppIcon";
|
|
26
27
|
import clsx from "clsx";
|
|
27
28
|
import WmCardContentWithWrapper, { WmCardContent } from "./card-content";
|
|
28
29
|
import WmCardActionsWithWrapper, { WmCardActions } from "./card-actions";
|
|
@@ -156,13 +157,19 @@ const WmCard = (props) => {
|
|
|
156
157
|
}
|
|
157
158
|
};
|
|
158
159
|
const renderAvatar = () => {
|
|
159
|
-
if (iconclass && !iconurl) {
|
|
160
|
-
return
|
|
161
|
-
}
|
|
162
|
-
if (iconurl) {
|
|
163
|
-
return /* @__PURE__ */ jsx(Avatar, { className: "app-card-avatar", children: /* @__PURE__ */ jsx(Image, { src: iconurl, alt: "", width: 40, height: 40, className: "wm-card-avatar-img" }) });
|
|
160
|
+
if (!iconclass && !iconurl) {
|
|
161
|
+
return null;
|
|
164
162
|
}
|
|
165
|
-
return
|
|
163
|
+
return /* @__PURE__ */ jsx(Avatar, { className: "app-card-avatar", children: /* @__PURE__ */ jsx(
|
|
164
|
+
WmAppIcon,
|
|
165
|
+
{
|
|
166
|
+
iconclass,
|
|
167
|
+
iconurl,
|
|
168
|
+
prefabName: props.prefabName,
|
|
169
|
+
defaultClasses: iconurl ? "wm-card-avatar-img img-circle" : "",
|
|
170
|
+
alt: ""
|
|
171
|
+
}
|
|
172
|
+
) });
|
|
166
173
|
};
|
|
167
174
|
const renderActionMenu = () => {
|
|
168
175
|
if (!actions) return null;
|
|
@@ -8,4 +8,4 @@ import { UseFormSubmissionOptions, UseFormSubmissionReturn } from "../props";
|
|
|
8
8
|
* - Success/error callbacks
|
|
9
9
|
* - Data output notification
|
|
10
10
|
*/
|
|
11
|
-
export declare function useFormSubmission({ formName, formfields, formDataref: externalFormDataref, getValues, formType, validateFieldsOnSubmit, resetFormData, toggleMessage, setShowViewMode, listener, datasource, formSubmit, widgettype, onBeforeSubmit, onSubmit, onResult, onSuccess, onError, insertmessage, updatemessage, deletemessage, postmessage, errormessage, messagelayout, standalone, }: UseFormSubmissionOptions): UseFormSubmissionReturn;
|
|
11
|
+
export declare function useFormSubmission({ formName, formfields, formDataref: externalFormDataref, getValues, formType, validateFieldsOnSubmit, resetFormData, toggleMessage, setShowViewMode, listener, datasource, formSubmit, widgettype, onBeforeSubmit, onSubmit, onResult, onSuccess, formSuccess, onError, insertmessage, updatemessage, deletemessage, postmessage, errormessage, messagelayout, standalone, }: UseFormSubmissionOptions): UseFormSubmissionReturn;
|
|
@@ -43,6 +43,7 @@ function useFormSubmission({
|
|
|
43
43
|
onSubmit,
|
|
44
44
|
onResult,
|
|
45
45
|
onSuccess,
|
|
46
|
+
formSuccess,
|
|
46
47
|
onError,
|
|
47
48
|
insertmessage,
|
|
48
49
|
updatemessage,
|
|
@@ -102,6 +103,7 @@ function useFormSubmission({
|
|
|
102
103
|
}
|
|
103
104
|
if (status) {
|
|
104
105
|
onSuccess == null ? void 0 : onSuccess(event, {}, data);
|
|
106
|
+
formSuccess == null ? void 0 : formSuccess(event, {}, data);
|
|
105
107
|
if (messagelayout === "Inline") {
|
|
106
108
|
toggleMessage(true, "Data saved successfully", "success");
|
|
107
109
|
}
|
|
@@ -113,7 +115,7 @@ function useFormSubmission({
|
|
|
113
115
|
}
|
|
114
116
|
}
|
|
115
117
|
},
|
|
116
|
-
[onResult, onSuccess, onError, messagelayout, errormessage, toggleMessage]
|
|
118
|
+
[onResult, onSuccess, formSuccess, onError, messagelayout, errormessage, toggleMessage]
|
|
117
119
|
);
|
|
118
120
|
const handleSubmitSuccess = useCallback(
|
|
119
121
|
(data, resolve) => {
|
|
@@ -159,17 +159,7 @@ const BaseForm = (WrappedComponent) => {
|
|
|
159
159
|
const formClassName = useMemo(() => {
|
|
160
160
|
return isInsideWizard ? clsx(className) : clsx(DEFAULT_CLASS, className);
|
|
161
161
|
}, [isInsideWizard, className]);
|
|
162
|
-
const
|
|
163
|
-
const newFields = [];
|
|
164
|
-
if (!formName) return newFields;
|
|
165
|
-
const Widgets = (formProxy == null ? void 0 : formProxy.formfields) || {};
|
|
166
|
-
Object.keys(Widgets).forEach((key) => {
|
|
167
|
-
if (!key.includes("formWidget") && Widgets[key]) {
|
|
168
|
-
newFields.push(Widgets[key]);
|
|
169
|
-
}
|
|
170
|
-
});
|
|
171
|
-
return newFields;
|
|
172
|
-
}, [formName]);
|
|
162
|
+
const onDataSourceChangeFiredRef = useRef(false);
|
|
173
163
|
const registerHeaderAction = useCallback((actionName, action) => {
|
|
174
164
|
if (!action || !actionName) return;
|
|
175
165
|
setHeaderActions((prev) => {
|
|
@@ -317,6 +307,7 @@ const BaseForm = (WrappedComponent) => {
|
|
|
317
307
|
onSubmit: props.onSubmit,
|
|
318
308
|
onResult: props.onResult,
|
|
319
309
|
onSuccess: props.onSuccess,
|
|
310
|
+
formSuccess: props.formSuccess,
|
|
320
311
|
onError: props.onError,
|
|
321
312
|
insertmessage: props.insertmessage,
|
|
322
313
|
updatemessage: props.updatemessage,
|
|
@@ -539,10 +530,15 @@ const BaseForm = (WrappedComponent) => {
|
|
|
539
530
|
debouncedFilter
|
|
540
531
|
]);
|
|
541
532
|
useEffect(() => {
|
|
542
|
-
if (props.onDataSourceChange
|
|
543
|
-
|
|
533
|
+
if (!props.onDataSourceChange || !formName) return;
|
|
534
|
+
if (onDataSourceChangeFiredRef.current) return;
|
|
535
|
+
const Widgets = (formProxy == null ? void 0 : formProxy.formfields) || {};
|
|
536
|
+
const currentFields = Object.keys(Widgets).filter((key) => !key.includes("formWidget") && Widgets[key]).map((key) => Widgets[key]);
|
|
537
|
+
if (currentFields.length > 0) {
|
|
538
|
+
onDataSourceChangeFiredRef.current = true;
|
|
539
|
+
props.onDataSourceChange(currentFields);
|
|
544
540
|
}
|
|
545
|
-
}, [
|
|
541
|
+
}, [props.onDataSourceChange, formName]);
|
|
546
542
|
useEffect(() => {
|
|
547
543
|
if (formRef.current) {
|
|
548
544
|
const formEl = formRef.current;
|
|
@@ -661,6 +657,7 @@ const BaseForm = (WrappedComponent) => {
|
|
|
661
657
|
return {
|
|
662
658
|
formdata: (_a2 = currentFormData != null ? currentFormData : widgetFormData) != null ? _a2 : formdata,
|
|
663
659
|
formName: formName || "",
|
|
660
|
+
isValid,
|
|
664
661
|
rootParentForm: isChildForm ? rootParentForm || "" : formName || "",
|
|
665
662
|
parentDataPath: isChildForm ? fullDataPath : void 0,
|
|
666
663
|
lastUpdateOrigin: isChildForm ? parentFormDataContext == null ? void 0 : parentFormDataContext.lastUpdateOrigin : lastUpdateOriginRef.current,
|
|
@@ -97,6 +97,8 @@ interface BaseFormProps extends BaseProps {
|
|
|
97
97
|
onSubmit: (event: React.FormEvent<HTMLFormElement>, widget: any, data: any) => void;
|
|
98
98
|
onError: (event: React.FormEvent<HTMLFormElement>, widget: any, error: any) => void;
|
|
99
99
|
onSuccess: (event: React.FormEvent<HTMLFormElement>, widget?: any, data?: any) => void;
|
|
100
|
+
/** @deprecated Use onSuccess instead. Fired with the same args as onSuccess for backward compatibility. */
|
|
101
|
+
formSuccess?: (event: React.FormEvent<HTMLFormElement>, widget?: any, data?: any) => void;
|
|
100
102
|
formSubmit: (event: React.FormEvent<HTMLFormElement>, widget: any, data: any, operation?: any) => void;
|
|
101
103
|
onChange: (event: React.FormEvent<HTMLFormElement>, widget: any, data: any) => void;
|
|
102
104
|
onBeforeSubmit: (event: React.FormEvent<HTMLFormElement>, widget: any, data: any) => boolean | string | object | Promise<boolean | string | object>;
|
|
@@ -280,6 +282,7 @@ export interface UseFormSubmissionOptions {
|
|
|
280
282
|
onSubmit?: Function;
|
|
281
283
|
onResult?: Function;
|
|
282
284
|
onSuccess?: Function;
|
|
285
|
+
formSuccess?: Function;
|
|
283
286
|
onError?: Function;
|
|
284
287
|
insertmessage?: string;
|
|
285
288
|
updatemessage?: string;
|
|
@@ -120,6 +120,7 @@ function DynamicForm(props) {
|
|
|
120
120
|
caption: $formField.displayname,
|
|
121
121
|
required: $formField.required,
|
|
122
122
|
listener,
|
|
123
|
+
hidden: !$formField.displayname,
|
|
123
124
|
className: clsx(
|
|
124
125
|
"app-label control-label formfield-label",
|
|
125
126
|
(formRef == null ? void 0 : formRef.captionCls) || ""
|
|
@@ -62,6 +62,7 @@ declare const WmFormActionsStandalone: import("react").ComponentType<{
|
|
|
62
62
|
prefabName?: string;
|
|
63
63
|
loading?: boolean;
|
|
64
64
|
showSkeleton?: boolean;
|
|
65
|
+
widget?: string;
|
|
65
66
|
} & import("@wavemaker-ai/react-runtime/higherOrder/withStandalone").WithStandaloneProps>;
|
|
66
67
|
export { WmFormActionsStandalone as WmFormAction };
|
|
67
68
|
/**
|
|
@@ -137,5 +138,6 @@ declare const _default: import("react").ComponentType<{
|
|
|
137
138
|
prefabName?: string;
|
|
138
139
|
loading?: boolean;
|
|
139
140
|
showSkeleton?: boolean;
|
|
141
|
+
widget?: string;
|
|
140
142
|
}>;
|
|
141
143
|
export default _default;
|
|
@@ -41,6 +41,7 @@ const WmFormActions = memo((props) => {
|
|
|
41
41
|
var _b;
|
|
42
42
|
const _a = props, {
|
|
43
43
|
position = "footer",
|
|
44
|
+
type = "button",
|
|
44
45
|
btnClass,
|
|
45
46
|
updateMode,
|
|
46
47
|
displayName,
|
|
@@ -48,6 +49,7 @@ const WmFormActions = memo((props) => {
|
|
|
48
49
|
showViewMode
|
|
49
50
|
} = _a, rest = __objRest(_a, [
|
|
50
51
|
"position",
|
|
52
|
+
"type",
|
|
51
53
|
"btnClass",
|
|
52
54
|
"updateMode",
|
|
53
55
|
"displayName",
|
|
@@ -60,15 +62,15 @@ const WmFormActions = memo((props) => {
|
|
|
60
62
|
(event) => {
|
|
61
63
|
var _a2, _b2, _c;
|
|
62
64
|
if (props.standalone) {
|
|
63
|
-
if (
|
|
65
|
+
if (type === "submit") {
|
|
64
66
|
(_a2 = formRef == null ? void 0 : formRef.submit) == null ? void 0 : _a2.call(formRef, event);
|
|
65
|
-
} else if (
|
|
67
|
+
} else if (type === "reset") {
|
|
66
68
|
(_b2 = formRef == null ? void 0 : formRef.formreset) == null ? void 0 : _b2.call(formRef);
|
|
67
69
|
}
|
|
68
70
|
}
|
|
69
71
|
(_c = props.onClick) == null ? void 0 : _c.call(props, event);
|
|
70
72
|
},
|
|
71
|
-
[formRef, props.onClick,
|
|
73
|
+
[formRef, props.onClick, type]
|
|
72
74
|
);
|
|
73
75
|
useEffect(() => {
|
|
74
76
|
if (formRef && position.includes("header") && formRef.registerHeaderAction) {
|
|
@@ -93,7 +95,7 @@ const WmFormActions = memo((props) => {
|
|
|
93
95
|
className: clsx(btnClass, rest.className),
|
|
94
96
|
caption: displayName,
|
|
95
97
|
iconclass: props.iconclass,
|
|
96
|
-
type
|
|
98
|
+
type,
|
|
97
99
|
disabled: props.disabled,
|
|
98
100
|
onClick: handleClick,
|
|
99
101
|
name: props.name,
|
|
@@ -73,6 +73,7 @@ const withFormController = (WrappedComponent) => {
|
|
|
73
73
|
observe,
|
|
74
74
|
onBlur,
|
|
75
75
|
fieldName,
|
|
76
|
+
updateon,
|
|
76
77
|
standalone = false
|
|
77
78
|
} = _a, wrappedComponentProps = __objRest(_a, [
|
|
78
79
|
"formRef",
|
|
@@ -97,6 +98,7 @@ const withFormController = (WrappedComponent) => {
|
|
|
97
98
|
"observe",
|
|
98
99
|
"onBlur",
|
|
99
100
|
"fieldName",
|
|
101
|
+
"updateon",
|
|
100
102
|
"standalone"
|
|
101
103
|
]);
|
|
102
104
|
const [touched, setTouched] = useState(false);
|
|
@@ -193,10 +195,14 @@ const withFormController = (WrappedComponent) => {
|
|
|
193
195
|
if (isValid === false) {
|
|
194
196
|
return;
|
|
195
197
|
}
|
|
198
|
+
if (updateon === "keypress" && effectiveFormKey) {
|
|
199
|
+
setTouched(true);
|
|
200
|
+
trigger(effectiveFormKey);
|
|
201
|
+
}
|
|
196
202
|
(_a2 = props.onChange) == null ? void 0 : _a2.call(props, e, componentProps, newValue, oldValue);
|
|
197
203
|
};
|
|
198
204
|
},
|
|
199
|
-
[type, props.datafield]
|
|
205
|
+
[type, props.datafield, updateon, effectiveFormKey]
|
|
200
206
|
);
|
|
201
207
|
const createOnBlurHandler = useCallback(
|
|
202
208
|
(field, fieldState) => {
|
|
@@ -275,7 +281,18 @@ const withFormController = (WrappedComponent) => {
|
|
|
275
281
|
})
|
|
276
282
|
}), {
|
|
277
283
|
listener: {
|
|
278
|
-
onChange: props.onChangeHandler,
|
|
284
|
+
onChange: isMaxWidget && props.onChangeHandler ? (name2, data) => {
|
|
285
|
+
const remapped = __spreadValues({}, data);
|
|
286
|
+
if ("datavalue" in remapped) {
|
|
287
|
+
remapped.maxDataValue = remapped.datavalue;
|
|
288
|
+
delete remapped.datavalue;
|
|
289
|
+
}
|
|
290
|
+
if ("displayValue" in remapped) {
|
|
291
|
+
remapped.maxDisplayValue = remapped.displayValue;
|
|
292
|
+
delete remapped.displayValue;
|
|
293
|
+
}
|
|
294
|
+
props.onChangeHandler(name2, remapped);
|
|
295
|
+
} : props.onChangeHandler,
|
|
279
296
|
Widgets: ((_a2 = props.listener) == null ? void 0 : _a2.Widgets) || {}
|
|
280
297
|
}
|
|
281
298
|
});
|
|
@@ -57,13 +57,15 @@ const BaseField = (WrappedComponent) => {
|
|
|
57
57
|
}
|
|
58
58
|
}
|
|
59
59
|
function setFieldDataSet(dataset, options) {
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
60
|
+
const aliasDisplayField = options.aliasColumn || LIVE_CONSTANTS.LABEL_VALUE;
|
|
61
|
+
const newRelatedData = {
|
|
62
|
+
displaylabel: aliasDisplayField,
|
|
63
|
+
displayfield: aliasDisplayField,
|
|
63
64
|
datafield: options.aliasColumn || LIVE_CONSTANTS.LABEL_KEY,
|
|
64
65
|
searchkey: options.distinctField || LIVE_CONSTANTS.LABEL_KEY,
|
|
65
66
|
dataset
|
|
66
|
-
}
|
|
67
|
+
};
|
|
68
|
+
setRelatedData(newRelatedData);
|
|
67
69
|
}
|
|
68
70
|
const hasRequiredValidator = () => {
|
|
69
71
|
const checkRequiredValidator = (validator) => {
|
|
@@ -134,7 +136,8 @@ const BaseField = (WrappedComponent) => {
|
|
|
134
136
|
relatedData,
|
|
135
137
|
isRequired,
|
|
136
138
|
transformedFormKey,
|
|
137
|
-
customValidationMsg
|
|
139
|
+
customValidationMsg,
|
|
140
|
+
formContext
|
|
138
141
|
]);
|
|
139
142
|
return /* @__PURE__ */ createElement(
|
|
140
143
|
WrappedComponent,
|