@wavemaker-ai/react-runtime 1.0.0-rc.647582 → 1.0.0-rc.647612
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 +2 -0
- package/components/advanced/carousel/template.d.ts +2 -0
- package/components/advanced/login/index.d.ts +2 -0
- package/components/advanced/marquee/index.d.ts +2 -0
- package/components/auth/RoleAuthGuard.js +1 -0
- package/components/basic/anchor/index.d.ts +2 -0
- package/components/basic/anchor/index.js +1 -1
- package/components/basic/audio/index.d.ts +2 -0
- package/components/basic/html/index.d.ts +2 -0
- package/components/basic/icon/index.d.ts +2 -0
- package/components/basic/iframe/index.d.ts +2 -0
- package/components/basic/label/index.d.ts +2 -0
- package/components/basic/label/index.js +17 -3
- package/components/basic/picture/index.d.ts +2 -0
- package/components/basic/picture/index.js +20 -1
- package/components/basic/progress-bar/index.d.ts +2 -0
- package/components/basic/progress-circle/index.d.ts +2 -0
- package/components/basic/progress-circle/index.js +2 -1
- package/components/basic/richtexteditor/index.d.ts +4 -0
- package/components/basic/richtexteditor/index.js +16 -15
- package/components/basic/search/index.d.ts +4 -0
- package/components/basic/spinner/index.d.ts +2 -0
- package/components/basic/tile/index.d.ts +2 -0
- package/components/basic/tree/index.d.ts +2 -0
- package/components/basic/video/index.d.ts +2 -0
- package/components/chart/index.d.ts +2 -0
- package/components/common/index.d.ts +2 -0
- package/components/common/index.js +5 -1
- package/components/common/wm-skeleton.d.ts +95 -0
- package/components/common/wm-skeleton.js +346 -0
- package/components/container/accordion/accordion-pane/index.d.ts +2 -0
- package/components/container/accordion/index.d.ts +4 -0
- package/components/container/accordion/index.js +23 -1
- package/components/container/accordion/props.d.ts +10 -0
- package/components/container/index.d.ts +2 -0
- package/components/container/index.js +2 -4
- package/components/container/layout-grid/grid-column/index.d.ts +2 -0
- package/components/container/layout-grid/grid-row/index.d.ts +2 -0
- package/components/container/layout-grid/index.d.ts +2 -0
- package/components/container/linear-layout/index.d.ts +2 -0
- package/components/container/linear-layout/linear-layout-item/index.d.ts +2 -0
- package/components/container/panel/index.d.ts +2 -0
- package/components/container/repeat-template/index.d.ts +2 -0
- package/components/container/tabs/index.d.ts +4 -0
- package/components/container/tabs/index.js +23 -1
- package/components/container/tabs/props.d.ts +10 -0
- package/components/container/tabs/tab-pane/index.d.ts +2 -0
- package/components/container/wizard/index.d.ts +8 -0
- package/components/container/wizard/index.js +27 -3
- package/components/container/wizard/props.d.ts +10 -0
- package/components/container/wizard/wizard-step/index.d.ts +2 -0
- package/components/data/card/card-actions/index.d.ts +2 -0
- package/components/data/card/card-content/index.d.ts +2 -0
- package/components/data/card/card-footer/index.d.ts +2 -0
- package/components/data/card/index.d.ts +2 -0
- package/components/data/card/index.js +12 -6
- package/components/data/form/base-form/hooks/useFormOperations.d.ts +1 -1
- package/components/data/form/base-form/hooks/useFormOperations.js +3 -3
- package/components/data/form/base-form/index.js +30 -25
- package/components/data/form/base-form/props.d.ts +1 -1
- package/components/data/form/dynamic-fields/index.js +3 -0
- package/components/data/form/form-action/index.d.ts +4 -0
- package/components/data/form/form-controller/hooks/index.js +2 -1
- package/components/data/form/form-controller/withFormController.js +11 -16
- package/components/data/form/form-field/base-field.js +0 -5
- package/components/data/form/form-field/index.js +99 -13
- package/components/data/form/form-field/props.d.ts +8 -0
- package/components/data/form/index.js +13 -0
- package/components/data/list/index.d.ts +7 -0
- package/components/data/list/index.js +18 -0
- package/components/data/list/props.d.ts +7 -0
- package/components/data/table/components/RowCells.js +4 -1
- package/components/data/table/hooks/useDynamicColumns.js +3 -1
- package/components/data/table/hooks/useResponsiveColumns.d.ts +2 -0
- package/components/data/table/index.d.ts +8 -0
- package/components/data/table/index.js +15 -0
- package/components/data/table/live-table/index.d.ts +2 -0
- package/components/data/table/props.d.ts +10 -0
- package/components/data/table/table-action/index.d.ts +2 -0
- package/components/data/table/table-column/index.d.ts +2 -0
- package/components/data/table/table-row/index.d.ts +2 -0
- package/components/data/table/table-row-action/index.d.ts +2 -0
- package/components/data/table/utils/index.d.ts +2 -0
- package/components/data/table/utils/index.js +17 -3
- package/components/dialogs/alert-dialog/index.d.ts +4 -0
- package/components/dialogs/confirm-dialog/index.d.ts +4 -0
- package/components/dialogs/dialog/index.d.ts +4 -0
- package/components/dialogs/dialog-actions/index.d.ts +2 -0
- package/components/dialogs/dialog-body/index.d.ts +2 -0
- package/components/dialogs/dialog-content/index.d.ts +2 -0
- package/components/dialogs/dialog-header/index.d.ts +2 -0
- package/components/dialogs/iframe-dialog/index.d.ts +4 -0
- package/components/dialogs/login-dialog/index.d.ts +4 -0
- package/components/dialogs/page-dialog/index.d.ts +4 -0
- package/components/form/button/index.d.ts +2 -0
- package/components/form/button/index.js +10 -1
- package/components/form/button-group/index.d.ts +2 -0
- package/components/input/calendar/index.d.ts +4 -0
- package/components/input/calendar/index.js +2 -1
- package/components/input/chips/index.d.ts +4 -0
- package/components/input/color-picker/index.d.ts +4 -0
- package/components/input/color-picker/index.js +18 -7
- package/components/input/composite/index.d.ts +2 -0
- package/components/input/currency/index.d.ts +4 -0
- package/components/input/default/checkbox/index.d.ts +4 -0
- package/components/input/default/checkboxset/index.d.ts +4 -0
- package/components/input/default/checkboxset/index.js +7 -5
- package/components/input/default/radioset/index.d.ts +4 -0
- package/components/input/default/radioset/index.js +2 -1
- package/components/input/default/switch/index.d.ts +4 -0
- package/components/input/default/switch/index.js +17 -13
- package/components/input/epoch/date/index.d.ts +2 -0
- package/components/input/epoch/date/index.js +30 -14
- package/components/input/epoch/datetime/index.d.ts +2 -0
- package/components/input/epoch/datetime/index.js +12 -8
- package/components/input/epoch/time/index.d.ts +2 -0
- package/components/input/epoch/time/index.js +21 -15
- package/components/input/fileupload/index.d.ts +2 -0
- package/components/input/number/index.d.ts +4 -0
- package/components/input/number/index.js +4 -3
- package/components/input/rating/index.d.ts +4 -0
- package/components/input/select/index.d.ts +4 -0
- package/components/input/slider/index.d.ts +4 -0
- package/components/input/slider/index.js +4 -2
- package/components/input/text/index.d.ts +4 -0
- package/components/input/text/index.js +16 -8
- package/components/input/textarea/index.d.ts +4 -0
- package/components/input/upload/index.d.ts +4 -0
- package/components/input/upload/index.js +6 -4
- package/components/navbar/index.d.ts +2 -0
- package/components/navbar/nav/index.d.ts +2 -0
- package/components/navbar/nav-item/index.d.ts +2 -0
- package/components/navigation/breadcrumb/index.d.ts +2 -0
- package/components/navigation/menu/index.d.ts +2 -0
- package/components/navigation/menu/index.js +2 -2
- package/components/navigation/popover/index.d.ts +2 -0
- package/components/page/partial/index.d.ts +2 -0
- package/context/AppContext.d.ts +2 -0
- package/context/AppContext.js +20 -1
- package/context/WidgetProvider.js +0 -3
- package/core/proxy-service.d.ts +2 -0
- package/core/proxy-service.js +25 -0
- package/higherOrder/BaseApp.js +1 -3
- package/higherOrder/BaseAppProps.d.ts +1 -1
- package/higherOrder/BasePage.js +4 -2
- package/higherOrder/props.d.ts +10 -0
- package/higherOrder/withBaseWrapper.js +3 -0
- package/hooks/useAuth.js +3 -0
- package/hooks/useLayoutSize.d.ts +6 -0
- package/hooks/useLayoutSize.js +12 -0
- package/package-lock.json +205 -190
- package/package.json +3 -3
- package/runtime-dynamic/components/use-dynamic-component.js +6 -11
- package/runtime-dynamic/main.js +1 -3
- package/runtime-dynamic/services/component-ref-provider.d.ts +1 -1
- package/runtime-dynamic/services/component-ref-provider.js +14 -11
- package/runtime-dynamic/services/resource-manager.js +10 -4
- package/runtime-dynamic/services/script-executor.js +4 -1
- package/runtime-dynamic/services/variable-registry.js +3 -0
- package/utils/attr.js +0 -1
- package/utils/format-util.js +2 -3
- package/utils/form-state.util.d.ts +0 -62
- package/utils/form-state.util.js +0 -109
|
@@ -227,7 +227,7 @@ const WmAnchor = (props) => {
|
|
|
227
227
|
),
|
|
228
228
|
iconclass && /* @__PURE__ */ jsx("i", { className: clsx("app-icon", "wm-anchor-icon-media", iconclass), "aria-hidden": "true" }),
|
|
229
229
|
caption && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
230
|
-
/* @__PURE__ */ jsx(Box, { component: "span", className: "sr-only", children: `${caption} ${(_b = listener == null ? void 0 : listener.appLocale) == null ? void 0 : _b.LABEL_ICON}` }),
|
|
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}` }),
|
|
231
231
|
/* @__PURE__ */ jsx(Box, { component: "span", className: "anchor-caption", children: caption })
|
|
232
232
|
] }),
|
|
233
233
|
badgevalue && /* @__PURE__ */ jsx(
|
|
@@ -36,6 +36,11 @@ import DOMPurify from "dompurify";
|
|
|
36
36
|
import Box from "@mui/material/Box";
|
|
37
37
|
import { withBaseWrapper } from "../../../higherOrder/withBaseWrapper";
|
|
38
38
|
import { removeInvalidAttributes } from "../../../utils/attr";
|
|
39
|
+
import {
|
|
40
|
+
WmSkeleton,
|
|
41
|
+
SKELETON_REGISTRY,
|
|
42
|
+
shouldShowSkeleton
|
|
43
|
+
} from "../../common/wm-skeleton";
|
|
39
44
|
const DEFAULT_CLASS = "app-label";
|
|
40
45
|
const containsHTML = (text) => {
|
|
41
46
|
return /<[^>]*>/g.test(text);
|
|
@@ -71,7 +76,9 @@ const WmLabel = memo(
|
|
|
71
76
|
onClick,
|
|
72
77
|
listener,
|
|
73
78
|
variant = "default:p",
|
|
74
|
-
viewParent
|
|
79
|
+
viewParent,
|
|
80
|
+
loading,
|
|
81
|
+
showSkeleton
|
|
75
82
|
} = _a, rest = __objRest(_a, [
|
|
76
83
|
"required",
|
|
77
84
|
"trustAs",
|
|
@@ -85,8 +92,13 @@ const WmLabel = memo(
|
|
|
85
92
|
"onClick",
|
|
86
93
|
"listener",
|
|
87
94
|
"variant",
|
|
88
|
-
"viewParent"
|
|
95
|
+
"viewParent",
|
|
96
|
+
"loading",
|
|
97
|
+
"showSkeleton"
|
|
89
98
|
]);
|
|
99
|
+
if (shouldShowSkeleton(loading, showSkeleton)) {
|
|
100
|
+
return /* @__PURE__ */ jsx(WmSkeleton, __spreadProps(__spreadValues({}, SKELETON_REGISTRY["WmLabel"]), { className, styles }));
|
|
101
|
+
}
|
|
90
102
|
const hasCaptionProp = Object.prototype.hasOwnProperty.call(props, "caption");
|
|
91
103
|
const safeCaption = hasCaptionProp ? caption : "Label";
|
|
92
104
|
const captionString = (_c = typeof safeCaption === "string" ? safeCaption : (_b = JSON.stringify(safeCaption)) != null ? _b : "") == null ? void 0 : _c.replace(/ |undefined|null/gi, " ");
|
|
@@ -154,7 +166,9 @@ const WmLabel = memo(
|
|
|
154
166
|
"styles",
|
|
155
167
|
"className",
|
|
156
168
|
"hint",
|
|
157
|
-
"hidden"
|
|
169
|
+
"hidden",
|
|
170
|
+
"loading",
|
|
171
|
+
"showSkeleton"
|
|
158
172
|
];
|
|
159
173
|
return keys.every((key) => prev[key] === current[key]);
|
|
160
174
|
}
|
|
@@ -33,6 +33,11 @@ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
|
33
33
|
import { memo, useEffect, useState } from "react";
|
|
34
34
|
import clsx from "clsx";
|
|
35
35
|
import { withBaseWrapper } from "../../../higherOrder/withBaseWrapper";
|
|
36
|
+
import {
|
|
37
|
+
WmSkeleton,
|
|
38
|
+
SKELETON_REGISTRY,
|
|
39
|
+
shouldShowSkeleton
|
|
40
|
+
} from "../../common/wm-skeleton";
|
|
36
41
|
import { prefixPrefabResourceUrl } from "../../../utils/resource-url";
|
|
37
42
|
import { removeInvalidAttributes } from "../../../utils/attr";
|
|
38
43
|
const DEFAULT_CLASS = "app-picture";
|
|
@@ -118,6 +123,14 @@ const WmPicture = memo(
|
|
|
118
123
|
const onMouseLeaveHandler = (event) => {
|
|
119
124
|
onMouseLeave && onMouseLeave(event, props);
|
|
120
125
|
};
|
|
126
|
+
if (shouldShowSkeleton(props.loading, props.showSkeleton))
|
|
127
|
+
return /* @__PURE__ */ jsx(
|
|
128
|
+
WmSkeleton,
|
|
129
|
+
__spreadProps(__spreadValues({}, SKELETON_REGISTRY["WmPicture"]), {
|
|
130
|
+
className: props.className,
|
|
131
|
+
styles: props.styles
|
|
132
|
+
})
|
|
133
|
+
);
|
|
121
134
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
122
135
|
/* @__PURE__ */ jsx(
|
|
123
136
|
"img",
|
|
@@ -148,7 +161,13 @@ const WmPicture = memo(
|
|
|
148
161
|
] });
|
|
149
162
|
},
|
|
150
163
|
(prev, current) => {
|
|
151
|
-
const keysToCompare = [
|
|
164
|
+
const keysToCompare = [
|
|
165
|
+
"picturesource",
|
|
166
|
+
"imgSource",
|
|
167
|
+
"show",
|
|
168
|
+
"loading",
|
|
169
|
+
"showSkeleton"
|
|
170
|
+
];
|
|
152
171
|
return keysToCompare.every((key) => prev[key] === current[key]);
|
|
153
172
|
}
|
|
154
173
|
);
|
|
@@ -65,11 +65,12 @@ const WmProgressCircle = (props) => {
|
|
|
65
65
|
};
|
|
66
66
|
}, [datavalue, minvalue, maxvalue, type, displayformat, props.strokeWidth, props.radius]);
|
|
67
67
|
useEffect(() => {
|
|
68
|
+
var _a;
|
|
68
69
|
if (listener && name) {
|
|
69
70
|
listener.onChange(name, {
|
|
70
71
|
percentagevalue: percentageValue
|
|
71
72
|
});
|
|
72
|
-
onBeforerender == null ? void 0 : onBeforerender(listener, listener == null ? void 0 : listener.Widgets[name]);
|
|
73
|
+
onBeforerender == null ? void 0 : onBeforerender(listener, (_a = listener == null ? void 0 : listener.Widgets) == null ? void 0 : _a[name]);
|
|
73
74
|
}
|
|
74
75
|
}, [percentageValue]);
|
|
75
76
|
useEffect(() => {
|
|
@@ -57,6 +57,8 @@ declare const WmRichTextEditorStandalone: React.ComponentType<import("../../data
|
|
|
57
57
|
updateon?: string;
|
|
58
58
|
dataset?: any;
|
|
59
59
|
prefabName?: string;
|
|
60
|
+
loading?: boolean;
|
|
61
|
+
showSkeleton?: boolean;
|
|
60
62
|
} & import("@wavemaker-ai/react-runtime/higherOrder/withStandalone").WithStandaloneProps>;
|
|
61
63
|
export { WmRichTextEditorStandalone as WmRichtexteditor };
|
|
62
64
|
/**
|
|
@@ -139,5 +141,7 @@ declare const _default: React.ComponentType<{
|
|
|
139
141
|
updateon?: string;
|
|
140
142
|
dataset?: any;
|
|
141
143
|
prefabName?: string;
|
|
144
|
+
loading?: boolean;
|
|
145
|
+
showSkeleton?: boolean;
|
|
142
146
|
}>;
|
|
143
147
|
export default _default;
|
|
@@ -50,6 +50,7 @@ const EditorPlaceholder = ({
|
|
|
50
50
|
}
|
|
51
51
|
);
|
|
52
52
|
const WmRichTextEditorBase = (props) => {
|
|
53
|
+
var _a;
|
|
53
54
|
const {
|
|
54
55
|
name,
|
|
55
56
|
className,
|
|
@@ -88,7 +89,7 @@ const WmRichTextEditorBase = (props) => {
|
|
|
88
89
|
const lastValueRef = useRef(actualValue || "");
|
|
89
90
|
const isMountedRef = useRef(true);
|
|
90
91
|
const internalValueRef = useRef(actualValue || "");
|
|
91
|
-
const widgetInstance = listener == null ? void 0 : listener.Widgets[name || ""];
|
|
92
|
+
const widgetInstance = (_a = listener == null ? void 0 : listener.Widgets) == null ? void 0 : _a[name || ""];
|
|
92
93
|
const editorOptions = useMemo(
|
|
93
94
|
() => ({
|
|
94
95
|
toolbar: true,
|
|
@@ -165,7 +166,7 @@ const WmRichTextEditorBase = (props) => {
|
|
|
165
166
|
}, []);
|
|
166
167
|
const handleEditorChange = useCallback(
|
|
167
168
|
(newContent, isFromUser = true) => {
|
|
168
|
-
var
|
|
169
|
+
var _a2, _b;
|
|
169
170
|
if (!isMountedRef.current || isInternalChange) {
|
|
170
171
|
return;
|
|
171
172
|
}
|
|
@@ -184,7 +185,7 @@ const WmRichTextEditorBase = (props) => {
|
|
|
184
185
|
value: sanitizedContent,
|
|
185
186
|
name
|
|
186
187
|
},
|
|
187
|
-
currentTarget: (_b = (
|
|
188
|
+
currentTarget: (_b = (_a2 = editorRef.current) == null ? void 0 : _a2.editor) == null ? void 0 : _b.workplace
|
|
188
189
|
};
|
|
189
190
|
onChange(syntheticEvent, widgetInstance, newContent, sanitizedContent);
|
|
190
191
|
}
|
|
@@ -204,8 +205,8 @@ const WmRichTextEditorBase = (props) => {
|
|
|
204
205
|
);
|
|
205
206
|
const performEditorOperation = useCallback(
|
|
206
207
|
(operation, value) => {
|
|
207
|
-
var
|
|
208
|
-
if (!isEditorLoaded || !((
|
|
208
|
+
var _a2;
|
|
209
|
+
if (!isEditorLoaded || !((_a2 = editorRef.current) == null ? void 0 : _a2.editor)) {
|
|
209
210
|
setOperationStack((prev) => [...prev, { type: operation, value }]);
|
|
210
211
|
return;
|
|
211
212
|
}
|
|
@@ -270,13 +271,13 @@ const WmRichTextEditorBase = (props) => {
|
|
|
270
271
|
[isEditorLoaded, sanitizeHtml]
|
|
271
272
|
);
|
|
272
273
|
useEffect(() => {
|
|
273
|
-
var
|
|
274
|
+
var _a2, _b;
|
|
274
275
|
if (onBeforerender) {
|
|
275
276
|
const syntheticEvent = {
|
|
276
277
|
target: {
|
|
277
278
|
value: ""
|
|
278
279
|
},
|
|
279
|
-
currentTarget: (_b = (
|
|
280
|
+
currentTarget: (_b = (_a2 = editorRef.current) == null ? void 0 : _a2.editor) == null ? void 0 : _b.workplace
|
|
280
281
|
};
|
|
281
282
|
onBeforerender(syntheticEvent, widgetInstance);
|
|
282
283
|
}
|
|
@@ -284,7 +285,7 @@ const WmRichTextEditorBase = (props) => {
|
|
|
284
285
|
const debouncedHandleOnChange = useMemo(
|
|
285
286
|
() => lodash.debounce(
|
|
286
287
|
(newContent) => {
|
|
287
|
-
var
|
|
288
|
+
var _a2, _b;
|
|
288
289
|
const sanitizedContent = sanitizeHtml(newContent);
|
|
289
290
|
const tempDiv = document.createElement("div");
|
|
290
291
|
tempDiv.innerHTML = newContent;
|
|
@@ -302,7 +303,7 @@ const WmRichTextEditorBase = (props) => {
|
|
|
302
303
|
value: new_text_content,
|
|
303
304
|
name
|
|
304
305
|
},
|
|
305
|
-
currentTarget: (_b = (
|
|
306
|
+
currentTarget: (_b = (_a2 = editorRef.current) == null ? void 0 : _a2.editor) == null ? void 0 : _b.workplace
|
|
306
307
|
};
|
|
307
308
|
onChange(syntheticEvent, widgetInstance, new_text_content, old_text_context);
|
|
308
309
|
}
|
|
@@ -325,9 +326,9 @@ const WmRichTextEditorBase = (props) => {
|
|
|
325
326
|
};
|
|
326
327
|
}, [debouncedHandleOnChange]);
|
|
327
328
|
const handleEditorInit = useCallback(() => {
|
|
328
|
-
var
|
|
329
|
+
var _a2;
|
|
329
330
|
setIsEditorLoaded(true);
|
|
330
|
-
if ((
|
|
331
|
+
if ((_a2 = editorRef.current) == null ? void 0 : _a2.editor) {
|
|
331
332
|
if (content !== void 0 && content !== null) {
|
|
332
333
|
editorRef.current.editor.value = content == null ? void 0 : content.toString();
|
|
333
334
|
}
|
|
@@ -483,8 +484,8 @@ const WmRichTextEditorBase = (props) => {
|
|
|
483
484
|
}
|
|
484
485
|
}, [datavalue]);
|
|
485
486
|
useEffect(() => {
|
|
486
|
-
var
|
|
487
|
-
if (((
|
|
487
|
+
var _a2;
|
|
488
|
+
if (((_a2 = editorRef.current) == null ? void 0 : _a2.editor) && isEditorLoaded) {
|
|
488
489
|
if (readonly || disabled) {
|
|
489
490
|
performEditorOperation("disable");
|
|
490
491
|
} else {
|
|
@@ -505,9 +506,9 @@ const WmRichTextEditorBase = (props) => {
|
|
|
505
506
|
useEffect(() => {
|
|
506
507
|
isMountedRef.current = true;
|
|
507
508
|
return () => {
|
|
508
|
-
var
|
|
509
|
+
var _a2, _b, _c;
|
|
509
510
|
isMountedRef.current = false;
|
|
510
|
-
if ((
|
|
511
|
+
if ((_a2 = editorRef.current) == null ? void 0 : _a2.editor) {
|
|
511
512
|
try {
|
|
512
513
|
(_c = (_b = editorRef == null ? void 0 : editorRef.current) == null ? void 0 : _b.editor) == null ? void 0 : _c.destruct();
|
|
513
514
|
} catch (error) {
|
|
@@ -112,6 +112,8 @@ declare const WmSearchStandalone: React.ComponentType<import("../../data/form/fo
|
|
|
112
112
|
updateon?: string;
|
|
113
113
|
dataset?: any;
|
|
114
114
|
prefabName?: string;
|
|
115
|
+
loading?: boolean;
|
|
116
|
+
showSkeleton?: boolean;
|
|
115
117
|
}, "ref"> & React.RefAttributes<any> & import("@wavemaker-ai/react-runtime/higherOrder/withStandalone").WithStandaloneProps>;
|
|
116
118
|
export { WmSearchStandalone as WmSearch };
|
|
117
119
|
/**
|
|
@@ -174,5 +176,7 @@ declare const _default: React.NamedExoticComponent<import("../../data/form/form-
|
|
|
174
176
|
updateon?: string;
|
|
175
177
|
dataset?: any;
|
|
176
178
|
prefabName?: string;
|
|
179
|
+
loading?: boolean;
|
|
180
|
+
showSkeleton?: boolean;
|
|
177
181
|
}>;
|
|
178
182
|
export default _default;
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { CSSProperties } from "react";
|
|
2
|
+
import { SkeletonProps } from "@mui/material/Skeleton";
|
|
3
|
+
export type SkeletonLayout = "table" | "list" | "form" | "tabs" | "wizard" | "accordion";
|
|
4
|
+
export interface WmSkeletonProps {
|
|
5
|
+
/** Selects a multi-element layout. Omit to render a single MUI `Skeleton`. */
|
|
6
|
+
type?: SkeletonLayout;
|
|
7
|
+
/** MUI Skeleton variant — only used when `type` is omitted. @default "rectangular" */
|
|
8
|
+
variant?: SkeletonProps["variant"];
|
|
9
|
+
width?: number | string;
|
|
10
|
+
height?: number | string;
|
|
11
|
+
/** @default "pulse" */
|
|
12
|
+
animation?: SkeletonProps["animation"];
|
|
13
|
+
/** Row count for `table`/`list` (default 5), tab/step/pane count for `tabs`/`wizard`/`accordion` (default 4), or field count for `form` (default 4). */
|
|
14
|
+
rows?: number;
|
|
15
|
+
/** Column count for `type="table"` (default 4) or content line count for `tabs`/`wizard`/`accordion` (default 3). */
|
|
16
|
+
columns?: number;
|
|
17
|
+
className?: string;
|
|
18
|
+
styles?: CSSProperties;
|
|
19
|
+
}
|
|
20
|
+
export type SkeletonConfig = Pick<WmSkeletonProps, "type" | "variant" | "width" | "height" | "animation" | "rows" | "columns">;
|
|
21
|
+
/** Default row/column counts per layout type — single source of truth. */
|
|
22
|
+
export declare const LAYOUT_DEFAULTS: {
|
|
23
|
+
table: {
|
|
24
|
+
rows: number;
|
|
25
|
+
columns: number;
|
|
26
|
+
};
|
|
27
|
+
list: {
|
|
28
|
+
rows: number;
|
|
29
|
+
};
|
|
30
|
+
form: {
|
|
31
|
+
rows: number;
|
|
32
|
+
};
|
|
33
|
+
tabs: {
|
|
34
|
+
rows: number;
|
|
35
|
+
columns: number;
|
|
36
|
+
};
|
|
37
|
+
wizard: {
|
|
38
|
+
rows: number;
|
|
39
|
+
columns: number;
|
|
40
|
+
};
|
|
41
|
+
accordion: {
|
|
42
|
+
rows: number;
|
|
43
|
+
columns: number;
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
/** Show skeleton while `loading` is true. Opt out only with explicit `showSkeleton={false}`. */
|
|
47
|
+
export declare const shouldShowSkeleton: (loading?: boolean | string, showSkeleton?: boolean) => boolean;
|
|
48
|
+
export declare const SKELETON_REGISTRY: {
|
|
49
|
+
WmButton: {
|
|
50
|
+
variant: "rounded";
|
|
51
|
+
height: number;
|
|
52
|
+
width: number;
|
|
53
|
+
};
|
|
54
|
+
WmLabel: {
|
|
55
|
+
variant: "text";
|
|
56
|
+
width: number;
|
|
57
|
+
};
|
|
58
|
+
WmPicture: {
|
|
59
|
+
variant: "rectangular";
|
|
60
|
+
height: number;
|
|
61
|
+
width: number;
|
|
62
|
+
};
|
|
63
|
+
WmTable: {
|
|
64
|
+
rows: number;
|
|
65
|
+
columns: number;
|
|
66
|
+
type: "table";
|
|
67
|
+
};
|
|
68
|
+
WmList: {
|
|
69
|
+
rows: number;
|
|
70
|
+
type: "list";
|
|
71
|
+
};
|
|
72
|
+
WmForm: {
|
|
73
|
+
rows: number;
|
|
74
|
+
type: "form";
|
|
75
|
+
};
|
|
76
|
+
WmTabs: {
|
|
77
|
+
rows: number;
|
|
78
|
+
columns: number;
|
|
79
|
+
type: "tabs";
|
|
80
|
+
};
|
|
81
|
+
WmWizard: {
|
|
82
|
+
rows: number;
|
|
83
|
+
columns: number;
|
|
84
|
+
type: "wizard";
|
|
85
|
+
};
|
|
86
|
+
WmAccordion: {
|
|
87
|
+
rows: number;
|
|
88
|
+
columns: number;
|
|
89
|
+
type: "accordion";
|
|
90
|
+
};
|
|
91
|
+
};
|
|
92
|
+
/** Derived from the registry — never needs manual updates. */
|
|
93
|
+
export type SkeletonRegistryKey = keyof typeof SKELETON_REGISTRY;
|
|
94
|
+
export declare const WmSkeleton: ({ type, variant, height, animation, ...layoutProps }: WmSkeletonProps) => import("react/jsx-runtime").JSX.Element;
|
|
95
|
+
export default WmSkeleton;
|