@wavemaker-ai/react-runtime 1.0.0-rc.314 → 1.0.0-rc.319

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.
Files changed (207) hide show
  1. package/actions/navigation-action.d.ts +1 -0
  2. package/actions/navigation-action.js +34 -9
  3. package/components/advanced/carousel/index.d.ts +2 -0
  4. package/components/advanced/carousel/template.d.ts +2 -0
  5. package/components/advanced/login/index.d.ts +2 -0
  6. package/components/advanced/marquee/index.d.ts +2 -0
  7. package/components/auth/RoleAuthGuard.d.ts +6 -0
  8. package/components/auth/RoleAuthGuard.js +66 -0
  9. package/components/basic/anchor/index.d.ts +2 -0
  10. package/components/basic/anchor/index.js +1 -1
  11. package/components/basic/audio/index.d.ts +2 -0
  12. package/components/basic/html/index.d.ts +2 -0
  13. package/components/basic/icon/index.d.ts +2 -0
  14. package/components/basic/iframe/index.d.ts +2 -0
  15. package/components/basic/label/index.d.ts +2 -0
  16. package/components/basic/label/index.js +17 -3
  17. package/components/basic/picture/index.d.ts +2 -0
  18. package/components/basic/picture/index.js +20 -1
  19. package/components/basic/progress-bar/index.d.ts +2 -0
  20. package/components/basic/progress-circle/index.d.ts +2 -0
  21. package/components/basic/progress-circle/index.js +2 -1
  22. package/components/basic/richtexteditor/index.d.ts +4 -0
  23. package/components/basic/richtexteditor/index.js +16 -15
  24. package/components/basic/search/index.d.ts +4 -0
  25. package/components/basic/search/index.js +2 -1
  26. package/components/basic/search/providers.js +2 -2
  27. package/components/basic/spinner/index.d.ts +2 -0
  28. package/components/basic/tile/index.d.ts +2 -0
  29. package/components/basic/tree/Components/TreeNodeComponent.d.ts +1 -1
  30. package/components/basic/tree/Components/TreeNodeComponent.js +14 -8
  31. package/components/basic/tree/hooks/useTreePersistedState.d.ts +3 -0
  32. package/components/basic/tree/hooks/useTreePersistedState.js +38 -0
  33. package/components/basic/tree/index.d.ts +3 -0
  34. package/components/basic/tree/index.js +105 -30
  35. package/components/basic/tree/props.d.ts +18 -1
  36. package/components/basic/tree/utils.d.ts +16 -1
  37. package/components/basic/tree/utils.js +111 -0
  38. package/components/basic/video/index.d.ts +2 -0
  39. package/components/chart/index.d.ts +2 -0
  40. package/components/chart/src/dataUtils.js +1 -1
  41. package/components/common/customTemplate/useCustomTemplate.js +1 -1
  42. package/components/common/index.d.ts +2 -0
  43. package/components/common/index.js +5 -1
  44. package/components/common/wm-skeleton.d.ts +95 -0
  45. package/components/common/wm-skeleton.js +346 -0
  46. package/components/container/accordion/accordion-pane/index.d.ts +2 -0
  47. package/components/container/accordion/index.d.ts +4 -0
  48. package/components/container/accordion/index.js +23 -1
  49. package/components/container/accordion/props.d.ts +10 -0
  50. package/components/container/index.d.ts +2 -0
  51. package/components/container/index.js +2 -4
  52. package/components/container/layout-grid/grid-column/index.d.ts +2 -0
  53. package/components/container/layout-grid/grid-column/index.js +2 -1
  54. package/components/container/layout-grid/grid-row/index.d.ts +2 -0
  55. package/components/container/layout-grid/index.d.ts +2 -0
  56. package/components/container/linear-layout/index.d.ts +2 -0
  57. package/components/container/linear-layout/linear-layout-item/index.d.ts +2 -0
  58. package/components/container/panel/index.d.ts +2 -0
  59. package/components/container/repeat-template/index.d.ts +2 -0
  60. package/components/container/tabs/index.d.ts +4 -0
  61. package/components/container/tabs/index.js +23 -1
  62. package/components/container/tabs/props.d.ts +10 -0
  63. package/components/container/tabs/tab-pane/index.d.ts +2 -0
  64. package/components/container/wizard/index.d.ts +8 -0
  65. package/components/container/wizard/index.js +27 -3
  66. package/components/container/wizard/props.d.ts +10 -0
  67. package/components/container/wizard/wizard-step/index.d.ts +2 -0
  68. package/components/data/card/card-actions/index.d.ts +2 -0
  69. package/components/data/card/card-content/index.d.ts +2 -0
  70. package/components/data/card/card-footer/index.d.ts +2 -0
  71. package/components/data/card/index.d.ts +2 -0
  72. package/components/data/card/index.js +12 -6
  73. package/components/data/form/base-form/hooks/useFormOperations.d.ts +1 -1
  74. package/components/data/form/base-form/hooks/useFormOperations.js +3 -3
  75. package/components/data/form/base-form/index.js +33 -26
  76. package/components/data/form/base-form/props.d.ts +1 -1
  77. package/components/data/form/dynamic-fields/index.js +3 -0
  78. package/components/data/form/form-action/index.d.ts +4 -0
  79. package/components/data/form/form-controller/hooks/index.js +2 -1
  80. package/components/data/form/form-controller/withFormController.js +14 -23
  81. package/components/data/form/form-field/base-field.js +0 -5
  82. package/components/data/form/form-field/index.js +99 -13
  83. package/components/data/form/form-field/props.d.ts +8 -0
  84. package/components/data/form/index.js +13 -0
  85. package/components/data/list/index.d.ts +7 -0
  86. package/components/data/list/index.js +18 -0
  87. package/components/data/list/props.d.ts +7 -0
  88. package/components/data/pagination/hooks/usePagination.js +0 -1
  89. package/components/data/table/components/RowCells.js +4 -1
  90. package/components/data/table/hooks/useDynamicColumns.js +3 -1
  91. package/components/data/table/hooks/useResponsiveColumns.d.ts +2 -0
  92. package/components/data/table/index.d.ts +8 -0
  93. package/components/data/table/index.js +20 -2
  94. package/components/data/table/live-table/index.d.ts +2 -0
  95. package/components/data/table/props.d.ts +10 -0
  96. package/components/data/table/table-action/index.d.ts +2 -0
  97. package/components/data/table/table-column/index.d.ts +2 -0
  98. package/components/data/table/table-row/index.d.ts +2 -0
  99. package/components/data/table/table-row-action/index.d.ts +2 -0
  100. package/components/data/table/utils/columnBuilder.d.ts +1 -1
  101. package/components/data/table/utils/columnBuilder.js +7 -4
  102. package/components/data/table/utils/crud-handlers.js +10 -10
  103. package/components/data/table/utils/index.d.ts +11 -8
  104. package/components/data/table/utils/index.js +90 -12
  105. package/components/dialogs/alert-dialog/index.d.ts +4 -0
  106. package/components/dialogs/confirm-dialog/index.d.ts +4 -0
  107. package/components/dialogs/dialog/index.d.ts +4 -0
  108. package/components/dialogs/dialog-actions/index.d.ts +2 -0
  109. package/components/dialogs/dialog-body/index.d.ts +2 -0
  110. package/components/dialogs/dialog-content/index.d.ts +2 -0
  111. package/components/dialogs/dialog-header/index.d.ts +2 -0
  112. package/components/dialogs/iframe-dialog/index.d.ts +4 -0
  113. package/components/dialogs/login-dialog/index.d.ts +4 -0
  114. package/components/dialogs/page-dialog/index.d.ts +4 -0
  115. package/components/form/button/index.d.ts +2 -0
  116. package/components/form/button/index.js +10 -1
  117. package/components/form/button-group/index.d.ts +2 -0
  118. package/components/input/calendar/index.d.ts +4 -0
  119. package/components/input/calendar/index.js +2 -1
  120. package/components/input/chips/index.d.ts +4 -0
  121. package/components/input/color-picker/index.d.ts +4 -0
  122. package/components/input/color-picker/index.js +18 -7
  123. package/components/input/composite/index.d.ts +2 -0
  124. package/components/input/currency/index.d.ts +4 -0
  125. package/components/input/default/checkbox/index.d.ts +4 -0
  126. package/components/input/default/checkboxset/index.d.ts +4 -0
  127. package/components/input/default/checkboxset/index.js +7 -5
  128. package/components/input/default/radioset/index.d.ts +4 -0
  129. package/components/input/default/radioset/index.js +2 -1
  130. package/components/input/default/switch/index.d.ts +4 -0
  131. package/components/input/default/switch/index.js +17 -13
  132. package/components/input/epoch/date/index.d.ts +2 -0
  133. package/components/input/epoch/date/index.js +30 -14
  134. package/components/input/epoch/datetime/index.d.ts +2 -0
  135. package/components/input/epoch/datetime/index.js +12 -8
  136. package/components/input/epoch/time/index.d.ts +2 -0
  137. package/components/input/epoch/time/index.js +21 -15
  138. package/components/input/fileupload/index.d.ts +2 -0
  139. package/components/input/number/index.d.ts +4 -0
  140. package/components/input/number/index.js +4 -3
  141. package/components/input/rating/index.d.ts +4 -0
  142. package/components/input/select/index.d.ts +4 -0
  143. package/components/input/slider/index.d.ts +4 -0
  144. package/components/input/slider/index.js +4 -2
  145. package/components/input/text/index.d.ts +4 -0
  146. package/components/input/text/index.js +16 -8
  147. package/components/input/textarea/index.d.ts +4 -0
  148. package/components/input/upload/index.d.ts +4 -0
  149. package/components/input/upload/index.js +6 -4
  150. package/components/layout/leftnav/index.js +21 -2
  151. package/components/layout/leftnav/props.d.ts +9 -0
  152. package/components/layout/leftnav/utils/page-class-util.d.ts +9 -0
  153. package/components/layout/leftnav/utils/page-class-util.js +28 -0
  154. package/components/navbar/index.d.ts +2 -0
  155. package/components/navbar/nav/index.d.ts +2 -0
  156. package/components/navbar/nav-item/index.d.ts +2 -0
  157. package/components/navigation/breadcrumb/index.d.ts +2 -0
  158. package/components/navigation/menu/index.d.ts +2 -0
  159. package/components/navigation/menu/index.js +2 -2
  160. package/components/navigation/popover/index.d.ts +2 -0
  161. package/components/navigation/popover/index.js +1 -0
  162. package/components/page/index.js +22 -6
  163. package/components/page/page-context.d.ts +4 -0
  164. package/components/page/page-context.js +5 -0
  165. package/components/page/partial/index.d.ts +2 -0
  166. package/components/page/partial-container/index.js +1 -4
  167. package/context/AppContext.d.ts +2 -0
  168. package/context/AppContext.js +20 -1
  169. package/context/WidgetProvider.js +0 -3
  170. package/core/proxy-service.d.ts +2 -0
  171. package/core/proxy-service.js +25 -0
  172. package/higherOrder/BaseApp.js +5 -6
  173. package/higherOrder/BaseAppProps.d.ts +1 -0
  174. package/higherOrder/BasePage.js +4 -12
  175. package/higherOrder/props.d.ts +10 -0
  176. package/higherOrder/withBaseWrapper.js +3 -0
  177. package/hooks/useAuth.js +3 -0
  178. package/hooks/useDataSourceSubscription.js +1 -1
  179. package/hooks/useHttp.js +0 -4
  180. package/hooks/useLayoutSize.d.ts +6 -0
  181. package/hooks/useLayoutSize.js +12 -0
  182. package/package-lock.json +229 -203
  183. package/package.json +3 -3
  184. package/runtime-dynamic/app-initializer.js +1 -1
  185. package/runtime-dynamic/components/use-dynamic-component.js +12 -31
  186. package/runtime-dynamic/factories/build-base-page-like-component.d.ts +1 -1
  187. package/runtime-dynamic/factories/dynamic-component.js +9 -1
  188. package/runtime-dynamic/factories/prefab-factory.d.ts +1 -1
  189. package/runtime-dynamic/factories/utils.d.ts +1 -1
  190. package/runtime-dynamic/main.js +1 -3
  191. package/runtime-dynamic/services/component-ref-provider.d.ts +19 -4
  192. package/runtime-dynamic/services/component-ref-provider.js +18 -38
  193. package/runtime-dynamic/services/index.d.ts +2 -3
  194. package/runtime-dynamic/services/index.js +1 -18
  195. package/runtime-dynamic/services/resource-manager.d.ts +2 -3
  196. package/runtime-dynamic/services/resource-manager.js +13 -17
  197. package/runtime-dynamic/services/script-executor.js +5 -8
  198. package/runtime-dynamic/services/variable-registry.js +3 -4
  199. package/utils/attr.js +1 -9
  200. package/utils/custom-expression/index.js +4 -1
  201. package/utils/custom-expression/parser.js +4 -2
  202. package/utils/format-util.js +2 -3
  203. package/utils/state-persistance.d.ts +1 -1
  204. package/runtime-dynamic/services/cache.d.ts +0 -29
  205. package/runtime-dynamic/services/cache.js +0 -51
  206. package/utils/form-state.util.d.ts +0 -62
  207. package/utils/form-state.util.js +0 -109
@@ -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;
@@ -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
+ };
@@ -77,5 +77,7 @@ declare const _default: React.ComponentType<{
77
77
  updateon?: string;
78
78
  dataset?: any;
79
79
  prefabName?: string;
80
+ loading?: boolean;
81
+ showSkeleton?: boolean;
80
82
  }>;
81
83
  export default _default;
@@ -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.
@@ -80,5 +80,7 @@ declare const _default: React.ComponentType<{
80
80
  updateon?: string;
81
81
  dataset?: any;
82
82
  prefabName?: string;
83
+ loading?: boolean;
84
+ showSkeleton?: boolean;
83
85
  }>;
84
86
  export default _default;
@@ -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 { layoutSizeUtil } from "../../utils/layoutsize-util";
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
  }
@@ -66,5 +66,7 @@ declare const _default: import("react").ComponentType<{
66
66
  updateon?: string;
67
67
  dataset?: any;
68
68
  prefabName?: string;
69
+ loading?: boolean;
70
+ showSkeleton?: boolean;
69
71
  }>;
70
72
  export default _default;
@@ -33,6 +33,7 @@ import { jsx } from "react/jsx-runtime";
33
33
  import clsx from "clsx";
34
34
  import { Container } from "@mui/material";
35
35
  import { withBaseWrapper } from "../../../../higherOrder/withBaseWrapper";
36
+ import { removeInvalidAttributes } from "../../../../utils/attr";
36
37
  const DEFAULT_CLASS = "app-grid-column";
37
38
  const WmGridcolumn = (props) => {
38
39
  const _a = props, {
@@ -57,7 +58,7 @@ const WmGridcolumn = (props) => {
57
58
  maxWidth: false,
58
59
  style: styles,
59
60
  className: clsx(DEFAULT_CLASS, className, columnwidth && `col-sm-${columnwidth}`)
60
- }, otherProps), {
61
+ }, removeInvalidAttributes(otherProps)), {
61
62
  children
62
63
  })
63
64
  );
@@ -62,5 +62,7 @@ declare const _default: import("react").ComponentType<{
62
62
  updateon?: string;
63
63
  dataset?: any;
64
64
  prefabName?: string;
65
+ loading?: boolean;
66
+ showSkeleton?: boolean;
65
67
  }>;
66
68
  export default _default;
@@ -64,5 +64,7 @@ declare const _default: React.ComponentType<{
64
64
  updateon?: string;
65
65
  dataset?: any;
66
66
  prefabName?: string;
67
+ loading?: boolean;
68
+ showSkeleton?: boolean;
67
69
  }>;
68
70
  export default _default;
@@ -63,5 +63,7 @@ declare const _default: React.ComponentType<{
63
63
  updateon?: string;
64
64
  dataset?: any;
65
65
  prefabName?: string;
66
+ loading?: boolean;
67
+ showSkeleton?: boolean;
66
68
  }>;
67
69
  export default _default;
@@ -60,5 +60,7 @@ declare const _default: React.ComponentType<{
60
60
  updateon?: string;
61
61
  dataset?: any;
62
62
  prefabName?: string;
63
+ loading?: boolean;
64
+ showSkeleton?: boolean;
63
65
  }>;
64
66
  export default _default;
@@ -114,5 +114,7 @@ declare const _default: React.ComponentType<{
114
114
  updateon?: string;
115
115
  dataset?: any;
116
116
  prefabName?: string;
117
+ loading?: boolean;
118
+ showSkeleton?: boolean;
117
119
  }>;
118
120
  export default _default;
@@ -78,5 +78,7 @@ declare const _default: import("react").ComponentType<{
78
78
  updateon?: string;
79
79
  dataset?: any;
80
80
  prefabName?: string;
81
+ loading?: boolean;
82
+ showSkeleton?: boolean;
81
83
  }>;
82
84
  export default _default;
@@ -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;