@wavemaker-ai/react-runtime 1.0.0-rc.317 → 1.0.0-rc.322
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 +230 -204
- 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
|
@@ -0,0 +1,346 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __defProps = Object.defineProperties;
|
|
3
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
+
var __spreadValues = (a, b) => {
|
|
9
|
+
for (var prop in b || (b = {}))
|
|
10
|
+
if (__hasOwnProp.call(b, prop))
|
|
11
|
+
__defNormalProp(a, prop, b[prop]);
|
|
12
|
+
if (__getOwnPropSymbols)
|
|
13
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
+
if (__propIsEnum.call(b, prop))
|
|
15
|
+
__defNormalProp(a, prop, b[prop]);
|
|
16
|
+
}
|
|
17
|
+
return a;
|
|
18
|
+
};
|
|
19
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
+
var __objRest = (source, exclude) => {
|
|
21
|
+
var target = {};
|
|
22
|
+
for (var prop in source)
|
|
23
|
+
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
24
|
+
target[prop] = source[prop];
|
|
25
|
+
if (source != null && __getOwnPropSymbols)
|
|
26
|
+
for (var prop of __getOwnPropSymbols(source)) {
|
|
27
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
28
|
+
target[prop] = source[prop];
|
|
29
|
+
}
|
|
30
|
+
return target;
|
|
31
|
+
};
|
|
32
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
33
|
+
import Skeleton from "@mui/material/Skeleton";
|
|
34
|
+
import Box from "@mui/material/Box";
|
|
35
|
+
import Stack from "@mui/material/Stack";
|
|
36
|
+
import Table from "@mui/material/Table";
|
|
37
|
+
import TableHead from "@mui/material/TableHead";
|
|
38
|
+
import TableBody from "@mui/material/TableBody";
|
|
39
|
+
import TableRow from "@mui/material/TableRow";
|
|
40
|
+
import TableCell from "@mui/material/TableCell";
|
|
41
|
+
const LAYOUT_DEFAULTS = {
|
|
42
|
+
table: { rows: 5, columns: 4 },
|
|
43
|
+
list: { rows: 5 },
|
|
44
|
+
form: { rows: 4 },
|
|
45
|
+
tabs: { rows: 4, columns: 3 },
|
|
46
|
+
wizard: { rows: 4, columns: 3 },
|
|
47
|
+
accordion: { rows: 4, columns: 3 }
|
|
48
|
+
};
|
|
49
|
+
const shouldShowSkeleton = (loading, showSkeleton) => {
|
|
50
|
+
if (showSkeleton === false) return false;
|
|
51
|
+
return Boolean(loading);
|
|
52
|
+
};
|
|
53
|
+
const SKELETON_REGISTRY = {
|
|
54
|
+
WmButton: { variant: "rounded", height: 36, width: 100 },
|
|
55
|
+
WmLabel: { variant: "text", width: 160 },
|
|
56
|
+
WmPicture: { variant: "rectangular", height: 200, width: 200 },
|
|
57
|
+
WmTable: __spreadValues({ type: "table" }, LAYOUT_DEFAULTS.table),
|
|
58
|
+
WmList: __spreadValues({ type: "list" }, LAYOUT_DEFAULTS.list),
|
|
59
|
+
WmForm: __spreadValues({ type: "form" }, LAYOUT_DEFAULTS.form),
|
|
60
|
+
WmTabs: __spreadValues({ type: "tabs" }, LAYOUT_DEFAULTS.tabs),
|
|
61
|
+
WmWizard: __spreadValues({ type: "wizard" }, LAYOUT_DEFAULTS.wizard),
|
|
62
|
+
WmAccordion: __spreadValues({ type: "accordion" }, LAYOUT_DEFAULTS.accordion)
|
|
63
|
+
};
|
|
64
|
+
const repeat = (n, fn) => Array.from({ length: n }, (_, i) => fn(i));
|
|
65
|
+
const wrapperStyle = (width, styles) => __spreadValues({
|
|
66
|
+
width: width != null ? width : "100%"
|
|
67
|
+
}, styles);
|
|
68
|
+
const FormFieldRow = ({ animation }) => /* @__PURE__ */ jsxs(Box, { children: [
|
|
69
|
+
/* @__PURE__ */ jsx(Skeleton, { variant: "text", width: "30%", animation, sx: { mb: 0.5 } }),
|
|
70
|
+
/* @__PURE__ */ jsx(Skeleton, { variant: "rounded", width: "100%", height: 36, animation })
|
|
71
|
+
] });
|
|
72
|
+
const ContentLines = ({
|
|
73
|
+
count,
|
|
74
|
+
animation
|
|
75
|
+
}) => /* @__PURE__ */ jsx(Fragment, { children: repeat(count, (i) => /* @__PURE__ */ jsx(
|
|
76
|
+
Skeleton,
|
|
77
|
+
{
|
|
78
|
+
variant: "text",
|
|
79
|
+
width: `${Math.max(40, 75 - i * 8)}%`,
|
|
80
|
+
animation,
|
|
81
|
+
sx: { fontSize: "1rem" }
|
|
82
|
+
},
|
|
83
|
+
i
|
|
84
|
+
)) });
|
|
85
|
+
const TableSkeleton = ({
|
|
86
|
+
rows = LAYOUT_DEFAULTS.table.rows,
|
|
87
|
+
columns = LAYOUT_DEFAULTS.table.columns,
|
|
88
|
+
width,
|
|
89
|
+
animation,
|
|
90
|
+
className,
|
|
91
|
+
styles
|
|
92
|
+
}) => /* @__PURE__ */ jsxs(
|
|
93
|
+
Table,
|
|
94
|
+
{
|
|
95
|
+
className,
|
|
96
|
+
style: __spreadProps(__spreadValues({}, wrapperStyle(width, styles)), { tableLayout: "fixed" }),
|
|
97
|
+
"aria-hidden": "true",
|
|
98
|
+
children: [
|
|
99
|
+
/* @__PURE__ */ jsx(TableHead, { children: /* @__PURE__ */ jsx(TableRow, { children: repeat(columns, (i) => /* @__PURE__ */ jsx(TableCell, { children: /* @__PURE__ */ jsx(Skeleton, { variant: "text", animation }) }, i)) }) }),
|
|
100
|
+
/* @__PURE__ */ jsx(TableBody, { children: repeat(rows, (r) => /* @__PURE__ */ jsx(TableRow, { children: repeat(columns, (c) => /* @__PURE__ */ jsx(TableCell, { children: /* @__PURE__ */ jsx(Skeleton, { variant: "text", animation }) }, c)) }, r)) })
|
|
101
|
+
]
|
|
102
|
+
}
|
|
103
|
+
);
|
|
104
|
+
const ListSkeleton = ({
|
|
105
|
+
rows = LAYOUT_DEFAULTS.list.rows,
|
|
106
|
+
width,
|
|
107
|
+
animation,
|
|
108
|
+
className,
|
|
109
|
+
styles
|
|
110
|
+
}) => /* @__PURE__ */ jsx(Stack, { className, style: wrapperStyle(width, styles), "aria-hidden": "true", children: repeat(rows, (i) => /* @__PURE__ */ jsxs(
|
|
111
|
+
Box,
|
|
112
|
+
{
|
|
113
|
+
sx: __spreadValues({
|
|
114
|
+
display: "flex",
|
|
115
|
+
alignItems: "flex-start",
|
|
116
|
+
gap: 1.5,
|
|
117
|
+
py: 1.25
|
|
118
|
+
}, i < rows - 1 && { borderBottom: 1, borderColor: "divider" }),
|
|
119
|
+
children: [
|
|
120
|
+
/* @__PURE__ */ jsx(
|
|
121
|
+
Skeleton,
|
|
122
|
+
{
|
|
123
|
+
variant: "circular",
|
|
124
|
+
width: 40,
|
|
125
|
+
height: 40,
|
|
126
|
+
animation,
|
|
127
|
+
sx: { flexShrink: 0 }
|
|
128
|
+
}
|
|
129
|
+
),
|
|
130
|
+
/* @__PURE__ */ jsxs(Stack, { spacing: 0.75, sx: { flex: 1, minWidth: 0 }, children: [
|
|
131
|
+
/* @__PURE__ */ jsx(Skeleton, { variant: "text", width: "75%", animation, sx: { fontSize: "1rem" } }),
|
|
132
|
+
/* @__PURE__ */ jsx(
|
|
133
|
+
Skeleton,
|
|
134
|
+
{
|
|
135
|
+
variant: "text",
|
|
136
|
+
width: "50%",
|
|
137
|
+
animation,
|
|
138
|
+
sx: { fontSize: "0.875rem" }
|
|
139
|
+
}
|
|
140
|
+
)
|
|
141
|
+
] })
|
|
142
|
+
]
|
|
143
|
+
},
|
|
144
|
+
i
|
|
145
|
+
)) });
|
|
146
|
+
const FormSkeleton = ({ rows = 4, width, animation, className, styles }) => /* @__PURE__ */ jsx(Stack, { spacing: 2, className, style: wrapperStyle(width, styles), "aria-hidden": "true", children: repeat(rows, (i) => /* @__PURE__ */ jsx(FormFieldRow, { animation }, i)) });
|
|
147
|
+
const TAB_WIDTHS = [96, 72, 88, 64, 80];
|
|
148
|
+
const TabsSkeleton = ({
|
|
149
|
+
rows = LAYOUT_DEFAULTS.tabs.rows,
|
|
150
|
+
columns = LAYOUT_DEFAULTS.tabs.columns,
|
|
151
|
+
width,
|
|
152
|
+
animation,
|
|
153
|
+
className,
|
|
154
|
+
styles
|
|
155
|
+
}) => /* @__PURE__ */ jsxs(Stack, { className, style: wrapperStyle(width, styles), "aria-hidden": "true", children: [
|
|
156
|
+
/* @__PURE__ */ jsx(Stack, { direction: "row", sx: { borderBottom: 2, borderColor: "divider" }, children: repeat(rows, (i) => /* @__PURE__ */ jsxs(
|
|
157
|
+
Box,
|
|
158
|
+
{
|
|
159
|
+
sx: {
|
|
160
|
+
position: "relative",
|
|
161
|
+
px: 1.25,
|
|
162
|
+
pb: 1.5,
|
|
163
|
+
opacity: i === 0 ? 1 : 0.4
|
|
164
|
+
},
|
|
165
|
+
children: [
|
|
166
|
+
/* @__PURE__ */ jsx(
|
|
167
|
+
Skeleton,
|
|
168
|
+
{
|
|
169
|
+
variant: "rounded",
|
|
170
|
+
width: TAB_WIDTHS[i % TAB_WIDTHS.length],
|
|
171
|
+
height: 20,
|
|
172
|
+
animation
|
|
173
|
+
}
|
|
174
|
+
),
|
|
175
|
+
i === 0 && /* @__PURE__ */ jsx(
|
|
176
|
+
Box,
|
|
177
|
+
{
|
|
178
|
+
sx: {
|
|
179
|
+
position: "absolute",
|
|
180
|
+
bottom: -2,
|
|
181
|
+
left: 0,
|
|
182
|
+
right: 0,
|
|
183
|
+
height: 2,
|
|
184
|
+
bgcolor: "primary.main",
|
|
185
|
+
borderRadius: "2px 2px 0 0"
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
)
|
|
189
|
+
]
|
|
190
|
+
},
|
|
191
|
+
i
|
|
192
|
+
)) }),
|
|
193
|
+
/* @__PURE__ */ jsxs(Stack, { spacing: 1.5, sx: { pt: 2.5 }, children: [
|
|
194
|
+
/* @__PURE__ */ jsx(Skeleton, { variant: "text", width: "40%", animation, sx: { fontSize: "1.25rem" } }),
|
|
195
|
+
/* @__PURE__ */ jsx(ContentLines, { count: columns, animation }),
|
|
196
|
+
/* @__PURE__ */ jsx(Skeleton, { variant: "rounded", width: "100%", height: 80, animation, sx: { mt: 0.5 } })
|
|
197
|
+
] })
|
|
198
|
+
] });
|
|
199
|
+
const WizardSkeleton = ({
|
|
200
|
+
rows = LAYOUT_DEFAULTS.wizard.rows,
|
|
201
|
+
columns = LAYOUT_DEFAULTS.wizard.columns,
|
|
202
|
+
width,
|
|
203
|
+
animation,
|
|
204
|
+
className,
|
|
205
|
+
styles
|
|
206
|
+
}) => /* @__PURE__ */ jsxs(Stack, { className, style: wrapperStyle(width, styles), "aria-hidden": "true", children: [
|
|
207
|
+
/* @__PURE__ */ jsx(Stack, { direction: "row", alignItems: "flex-start", sx: { mb: 3 }, children: repeat(rows, (i) => /* @__PURE__ */ jsxs(
|
|
208
|
+
Box,
|
|
209
|
+
{
|
|
210
|
+
sx: {
|
|
211
|
+
display: "flex",
|
|
212
|
+
alignItems: "center",
|
|
213
|
+
flex: i < rows - 1 ? 1 : "none"
|
|
214
|
+
},
|
|
215
|
+
children: [
|
|
216
|
+
/* @__PURE__ */ jsxs(Stack, { alignItems: "center", spacing: 0.75, sx: { minWidth: 72 }, children: [
|
|
217
|
+
/* @__PURE__ */ jsx(Skeleton, { variant: "circular", width: 32, height: 32, animation }),
|
|
218
|
+
/* @__PURE__ */ jsx(Skeleton, { variant: "text", width: 56, animation })
|
|
219
|
+
] }),
|
|
220
|
+
i < rows - 1 && /* @__PURE__ */ jsx(
|
|
221
|
+
Skeleton,
|
|
222
|
+
{
|
|
223
|
+
variant: "rectangular",
|
|
224
|
+
animation,
|
|
225
|
+
sx: { flex: 1, height: 2, mx: 1, mt: 2 }
|
|
226
|
+
}
|
|
227
|
+
)
|
|
228
|
+
]
|
|
229
|
+
},
|
|
230
|
+
i
|
|
231
|
+
)) }),
|
|
232
|
+
/* @__PURE__ */ jsx(Stack, { spacing: 2, sx: { mb: 3 }, children: repeat(columns, (i) => /* @__PURE__ */ jsx(FormFieldRow, { animation }, i)) }),
|
|
233
|
+
/* @__PURE__ */ jsxs(Stack, { direction: "row", spacing: 1, justifyContent: "flex-end", children: [
|
|
234
|
+
/* @__PURE__ */ jsx(Skeleton, { variant: "rounded", width: 80, height: 36, animation }),
|
|
235
|
+
/* @__PURE__ */ jsx(Skeleton, { variant: "rounded", width: 80, height: 36, animation })
|
|
236
|
+
] })
|
|
237
|
+
] });
|
|
238
|
+
const ACCORDION_HEADER_WIDTHS = ["60%", "45%", "70%", "50%"];
|
|
239
|
+
const AccordionSkeleton = ({
|
|
240
|
+
rows = LAYOUT_DEFAULTS.accordion.rows,
|
|
241
|
+
columns = LAYOUT_DEFAULTS.accordion.columns,
|
|
242
|
+
width,
|
|
243
|
+
animation,
|
|
244
|
+
className,
|
|
245
|
+
styles
|
|
246
|
+
}) => /* @__PURE__ */ jsx(
|
|
247
|
+
Stack,
|
|
248
|
+
{
|
|
249
|
+
spacing: 0.75,
|
|
250
|
+
className,
|
|
251
|
+
style: wrapperStyle(width, styles),
|
|
252
|
+
"aria-hidden": "true",
|
|
253
|
+
children: repeat(rows, (i) => {
|
|
254
|
+
const isExpanded = i === 0;
|
|
255
|
+
return /* @__PURE__ */ jsxs(
|
|
256
|
+
Box,
|
|
257
|
+
{
|
|
258
|
+
sx: { border: 1, borderColor: "divider", borderRadius: 1, overflow: "hidden" },
|
|
259
|
+
children: [
|
|
260
|
+
/* @__PURE__ */ jsxs(
|
|
261
|
+
Box,
|
|
262
|
+
{
|
|
263
|
+
sx: {
|
|
264
|
+
display: "flex",
|
|
265
|
+
alignItems: "center",
|
|
266
|
+
justifyContent: "space-between",
|
|
267
|
+
gap: 1,
|
|
268
|
+
px: 2,
|
|
269
|
+
py: 1.5,
|
|
270
|
+
bgcolor: isExpanded ? "action.selected" : "transparent"
|
|
271
|
+
},
|
|
272
|
+
children: [
|
|
273
|
+
/* @__PURE__ */ jsx(
|
|
274
|
+
Skeleton,
|
|
275
|
+
{
|
|
276
|
+
variant: "text",
|
|
277
|
+
width: ACCORDION_HEADER_WIDTHS[i % ACCORDION_HEADER_WIDTHS.length],
|
|
278
|
+
animation,
|
|
279
|
+
sx: { fontSize: "1rem" }
|
|
280
|
+
}
|
|
281
|
+
),
|
|
282
|
+
/* @__PURE__ */ jsx(
|
|
283
|
+
Skeleton,
|
|
284
|
+
{
|
|
285
|
+
variant: "rounded",
|
|
286
|
+
width: 16,
|
|
287
|
+
height: 8,
|
|
288
|
+
animation,
|
|
289
|
+
sx: { flexShrink: 0 }
|
|
290
|
+
}
|
|
291
|
+
)
|
|
292
|
+
]
|
|
293
|
+
}
|
|
294
|
+
),
|
|
295
|
+
isExpanded && /* @__PURE__ */ jsx(Stack, { spacing: 1, sx: { px: 2, py: 1.5, borderTop: 1, borderColor: "divider" }, children: /* @__PURE__ */ jsx(ContentLines, { count: columns, animation }) })
|
|
296
|
+
]
|
|
297
|
+
},
|
|
298
|
+
i
|
|
299
|
+
);
|
|
300
|
+
})
|
|
301
|
+
}
|
|
302
|
+
);
|
|
303
|
+
const LAYOUT_MAP = {
|
|
304
|
+
table: TableSkeleton,
|
|
305
|
+
list: ListSkeleton,
|
|
306
|
+
form: FormSkeleton,
|
|
307
|
+
tabs: TabsSkeleton,
|
|
308
|
+
wizard: WizardSkeleton,
|
|
309
|
+
accordion: AccordionSkeleton
|
|
310
|
+
};
|
|
311
|
+
const WmSkeleton = (_a) => {
|
|
312
|
+
var _b = _a, {
|
|
313
|
+
type,
|
|
314
|
+
variant = "rectangular",
|
|
315
|
+
height,
|
|
316
|
+
animation = "pulse"
|
|
317
|
+
} = _b, layoutProps = __objRest(_b, [
|
|
318
|
+
"type",
|
|
319
|
+
"variant",
|
|
320
|
+
"height",
|
|
321
|
+
"animation"
|
|
322
|
+
]);
|
|
323
|
+
if (type) {
|
|
324
|
+
const Layout = LAYOUT_MAP[type];
|
|
325
|
+
return /* @__PURE__ */ jsx(Layout, __spreadValues({ animation }, layoutProps));
|
|
326
|
+
}
|
|
327
|
+
return /* @__PURE__ */ jsx(
|
|
328
|
+
Skeleton,
|
|
329
|
+
{
|
|
330
|
+
variant,
|
|
331
|
+
width: layoutProps.width,
|
|
332
|
+
height,
|
|
333
|
+
animation,
|
|
334
|
+
className: layoutProps.className,
|
|
335
|
+
style: layoutProps.styles
|
|
336
|
+
}
|
|
337
|
+
);
|
|
338
|
+
};
|
|
339
|
+
var wm_skeleton_default = WmSkeleton;
|
|
340
|
+
export {
|
|
341
|
+
LAYOUT_DEFAULTS,
|
|
342
|
+
SKELETON_REGISTRY,
|
|
343
|
+
WmSkeleton,
|
|
344
|
+
wm_skeleton_default as default,
|
|
345
|
+
shouldShowSkeleton
|
|
346
|
+
};
|
|
@@ -24,6 +24,8 @@ declare const _default: React.ComponentType<{
|
|
|
24
24
|
}) => void;
|
|
25
25
|
onLoad?: (props: WmAccordionProps, onLoadCallback?: () => void) => void;
|
|
26
26
|
render?: (item: Record<string, unknown>, index: number, dataset: Record<string, unknown>[]) => React.ReactNode;
|
|
27
|
+
skeletonRows?: number;
|
|
28
|
+
skeletonColumns?: number;
|
|
27
29
|
standalone?: boolean;
|
|
28
30
|
ref?: React.RefObject<HTMLElement> | React.RefObject<null>;
|
|
29
31
|
animation?: string;
|
|
@@ -72,5 +74,7 @@ declare const _default: React.ComponentType<{
|
|
|
72
74
|
formfield?: boolean;
|
|
73
75
|
updateon?: string;
|
|
74
76
|
prefabName?: string;
|
|
77
|
+
loading?: boolean;
|
|
78
|
+
showSkeleton?: boolean;
|
|
75
79
|
}>;
|
|
76
80
|
export default _default;
|
|
@@ -28,6 +28,11 @@ import {
|
|
|
28
28
|
getWidgetState,
|
|
29
29
|
setWidgetState
|
|
30
30
|
} from "../../../utils/state-persistance";
|
|
31
|
+
import {
|
|
32
|
+
WmSkeleton,
|
|
33
|
+
SKELETON_REGISTRY,
|
|
34
|
+
shouldShowSkeleton
|
|
35
|
+
} from "../../common/wm-skeleton";
|
|
31
36
|
const DEFAULT_CLASS = "app-accordion panel-group";
|
|
32
37
|
function isStaticAccordionPane(child) {
|
|
33
38
|
return React.isValidElement(child) && (child.type === WmAccordionPaneWithBase || child.type === WmAccordionPane);
|
|
@@ -201,6 +206,17 @@ const WmAccordion = memo(
|
|
|
201
206
|
return child;
|
|
202
207
|
}) : null;
|
|
203
208
|
};
|
|
209
|
+
if (shouldShowSkeleton(props.loading, props.showSkeleton)) {
|
|
210
|
+
return /* @__PURE__ */ jsx(
|
|
211
|
+
WmSkeleton,
|
|
212
|
+
__spreadProps(__spreadValues({}, SKELETON_REGISTRY["WmAccordion"]), {
|
|
213
|
+
rows: props.skeletonRows,
|
|
214
|
+
columns: props.skeletonColumns,
|
|
215
|
+
className: clsx(DEFAULT_CLASS, props.className),
|
|
216
|
+
styles: props.styles
|
|
217
|
+
})
|
|
218
|
+
);
|
|
219
|
+
}
|
|
204
220
|
return /* @__PURE__ */ jsx(
|
|
205
221
|
"div",
|
|
206
222
|
{
|
|
@@ -223,7 +239,13 @@ const WmAccordion = memo(
|
|
|
223
239
|
"closeothers",
|
|
224
240
|
"children",
|
|
225
241
|
"hidden",
|
|
226
|
-
"show"
|
|
242
|
+
"show",
|
|
243
|
+
"loading",
|
|
244
|
+
"showSkeleton",
|
|
245
|
+
"skeletonRows",
|
|
246
|
+
"skeletonColumns",
|
|
247
|
+
"className",
|
|
248
|
+
"styles"
|
|
227
249
|
];
|
|
228
250
|
return keys.every((key) => prevProps[key] === nextProps[key]);
|
|
229
251
|
}
|
|
@@ -49,6 +49,16 @@ export interface AccordionPropsBase {
|
|
|
49
49
|
* Render function for dynamic accordion. Receives item, index, and full dataset.
|
|
50
50
|
*/
|
|
51
51
|
render?: (item: Record<string, unknown>, index: number, dataset: Record<string, unknown>[]) => ReactNode;
|
|
52
|
+
/**
|
|
53
|
+
* Number of skeleton accordion panes shown while loading.
|
|
54
|
+
* @default 4
|
|
55
|
+
*/
|
|
56
|
+
skeletonRows?: number;
|
|
57
|
+
/**
|
|
58
|
+
* Number of skeleton content lines shown in the expanded pane while loading.
|
|
59
|
+
* @default 3
|
|
60
|
+
*/
|
|
61
|
+
skeletonColumns?: number;
|
|
52
62
|
}
|
|
53
63
|
/**
|
|
54
64
|
* Combined props for the WmAccordion component, including base WaveMaker props.
|
|
@@ -33,7 +33,7 @@ import { jsx } from "react/jsx-runtime";
|
|
|
33
33
|
import { useEffect, useRef, useMemo, useCallback } from "react";
|
|
34
34
|
import { clsx } from "clsx";
|
|
35
35
|
import { withBaseWrapper } from "../../higherOrder/withBaseWrapper";
|
|
36
|
-
import {
|
|
36
|
+
import { useLayoutSize } from "../../hooks/useLayoutSize";
|
|
37
37
|
import { removeInvalidAttributes } from "../../utils/attr";
|
|
38
38
|
import { normalizeBackgroundImage } from "../../utils/style-utils";
|
|
39
39
|
const DEFAULT_CLASS = "app-container";
|
|
@@ -161,10 +161,8 @@ const WmContainer = (props) => {
|
|
|
161
161
|
if (containerRef.current && (props == null ? void 0 : props.name) && ((_a2 = listener == null ? void 0 : listener.Widgets) == null ? void 0 : _a2[props.name])) {
|
|
162
162
|
listener.Widgets[props.name].nativeElement = containerRef.current;
|
|
163
163
|
}
|
|
164
|
-
if (containerRef.current && (props.layoutWidth || props.layoutHeight)) {
|
|
165
|
-
layoutSizeUtil(containerRef.current, props.layoutWidth, props.layoutHeight);
|
|
166
|
-
}
|
|
167
164
|
}, [containerRef.current]);
|
|
165
|
+
useLayoutSize(containerRef, props.layoutWidth, props.layoutHeight);
|
|
168
166
|
function handleClick(event) {
|
|
169
167
|
onClick == null ? void 0 : onClick(event, widget_instance);
|
|
170
168
|
}
|
|
@@ -32,6 +32,8 @@ declare const _default: React.ComponentType<{
|
|
|
32
32
|
render?: (item: Record<string, unknown>, index: number, dataset: Record<string, unknown>[], isActive?: boolean) => React.ReactNode;
|
|
33
33
|
selectedindex?: number;
|
|
34
34
|
onChange?: (event: React.SyntheticEvent | null, props: WmTabsProps, newPaneIndex: number, oldPaneIndex: number) => void;
|
|
35
|
+
skeletonRows?: number;
|
|
36
|
+
skeletonColumns?: number;
|
|
35
37
|
standalone?: boolean;
|
|
36
38
|
ref?: React.RefObject<HTMLElement> | React.RefObject<null>;
|
|
37
39
|
animation?: string;
|
|
@@ -80,5 +82,7 @@ declare const _default: React.ComponentType<{
|
|
|
80
82
|
formfield?: boolean;
|
|
81
83
|
updateon?: string;
|
|
82
84
|
prefabName?: string;
|
|
85
|
+
loading?: boolean;
|
|
86
|
+
showSkeleton?: boolean;
|
|
83
87
|
}>;
|
|
84
88
|
export default _default;
|
|
@@ -36,6 +36,11 @@ import Typography from "@mui/material/Typography";
|
|
|
36
36
|
import withBaseWrapper from "../../../higherOrder/withBaseWrapper";
|
|
37
37
|
import WmTabPane from "./tab-pane";
|
|
38
38
|
import { DEFAULT_PROPS } from "./props";
|
|
39
|
+
import {
|
|
40
|
+
WmSkeleton,
|
|
41
|
+
SKELETON_REGISTRY,
|
|
42
|
+
shouldShowSkeleton
|
|
43
|
+
} from "../../common/wm-skeleton";
|
|
39
44
|
import {
|
|
40
45
|
getWidgetState,
|
|
41
46
|
setWidgetState
|
|
@@ -90,6 +95,17 @@ const useTabsContext = () => {
|
|
|
90
95
|
const WmTabs = memo(
|
|
91
96
|
(Props) => {
|
|
92
97
|
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
|
+
}
|
|
93
109
|
const {
|
|
94
110
|
defaultpaneindex,
|
|
95
111
|
statehandler,
|
|
@@ -528,7 +544,13 @@ const WmTabs = memo(
|
|
|
528
544
|
"iconposition",
|
|
529
545
|
"render",
|
|
530
546
|
"selectedindex",
|
|
531
|
-
"children"
|
|
547
|
+
"children",
|
|
548
|
+
"loading",
|
|
549
|
+
"showSkeleton",
|
|
550
|
+
"skeletonRows",
|
|
551
|
+
"skeletonColumns",
|
|
552
|
+
"className",
|
|
553
|
+
"styles"
|
|
532
554
|
];
|
|
533
555
|
return keys.every((key) => {
|
|
534
556
|
if (key === "children") {
|
|
@@ -96,6 +96,16 @@ export interface TabsPropsBase {
|
|
|
96
96
|
* Called when the active tab changes.
|
|
97
97
|
*/
|
|
98
98
|
onChange?: (event: React.SyntheticEvent | null, props: WmTabsProps, newPaneIndex: number, oldPaneIndex: number) => void;
|
|
99
|
+
/**
|
|
100
|
+
* Number of skeleton tab headers shown while loading.
|
|
101
|
+
* @default 4
|
|
102
|
+
*/
|
|
103
|
+
skeletonRows?: number;
|
|
104
|
+
/**
|
|
105
|
+
* Number of skeleton content lines shown in the active tab panel while loading.
|
|
106
|
+
* @default 3
|
|
107
|
+
*/
|
|
108
|
+
skeletonColumns?: number;
|
|
99
109
|
}
|
|
100
110
|
/**
|
|
101
111
|
* Combined props for the WmTabs component, including base WaveMaker props.
|
|
@@ -30,6 +30,8 @@ declare const WmWizardStandalone: React.ComponentType<{
|
|
|
30
30
|
onCancel?: (currentStep: WizardStepData | null, steps: WizardStepData[]) => void;
|
|
31
31
|
onDone?: (currentStep: WizardStepData, steps: WizardStepData[]) => void;
|
|
32
32
|
standalone?: boolean;
|
|
33
|
+
skeletonRows?: number;
|
|
34
|
+
skeletonColumns?: number;
|
|
33
35
|
ref?: React.RefObject<HTMLElement> | React.RefObject<null>;
|
|
34
36
|
animation?: string;
|
|
35
37
|
show?: boolean | string;
|
|
@@ -75,6 +77,8 @@ declare const WmWizardStandalone: React.ComponentType<{
|
|
|
75
77
|
formfield?: boolean;
|
|
76
78
|
updateon?: string;
|
|
77
79
|
prefabName?: string;
|
|
80
|
+
loading?: boolean;
|
|
81
|
+
showSkeleton?: boolean;
|
|
78
82
|
} & import("@wavemaker-ai/react-runtime/higherOrder/withStandalone").WithStandaloneProps>;
|
|
79
83
|
export { WmWizardStandalone as WmWizard };
|
|
80
84
|
/**
|
|
@@ -117,6 +121,8 @@ declare const _default: React.ComponentType<{
|
|
|
117
121
|
onCancel?: (currentStep: WizardStepData | null, steps: WizardStepData[]) => void;
|
|
118
122
|
onDone?: (currentStep: WizardStepData, steps: WizardStepData[]) => void;
|
|
119
123
|
standalone?: boolean;
|
|
124
|
+
skeletonRows?: number;
|
|
125
|
+
skeletonColumns?: number;
|
|
120
126
|
ref?: React.RefObject<HTMLElement> | React.RefObject<null>;
|
|
121
127
|
animation?: string;
|
|
122
128
|
show?: boolean | string;
|
|
@@ -162,5 +168,7 @@ declare const _default: React.ComponentType<{
|
|
|
162
168
|
formfield?: boolean;
|
|
163
169
|
updateon?: string;
|
|
164
170
|
prefabName?: string;
|
|
171
|
+
loading?: boolean;
|
|
172
|
+
showSkeleton?: boolean;
|
|
165
173
|
}>;
|
|
166
174
|
export default _default;
|