@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
@@ -1,62 +0,0 @@
1
- /**
2
- * Form State Utility
3
- *
4
- * Handles form field registration and management within the widget context.
5
- * This utility provides centralized logic for registering form fields and form widgets
6
- * to their parent form context.
7
- */
8
- /**
9
- * Interface for widget properties related to form field registration
10
- */
11
- interface FormFieldWidget {
12
- name?: string;
13
- formName?: string;
14
- field?: string;
15
- fieldName?: string;
16
- formKey?: string;
17
- parentForm?: string;
18
- [key: string]: any;
19
- }
20
- /**
21
- * Interface for the context structure where form fields are registered
22
- */
23
- interface WidgetsContext {
24
- [formName: string]: {
25
- formfields: Record<string, any>;
26
- formWidgets: Record<string, any>;
27
- [key: string]: any;
28
- };
29
- }
30
- /**
31
- * Checks if a widget should be registered as a form field
32
- * @param widget - The widget object to check
33
- * @returns true if the widget should be registered as a form field
34
- */
35
- export declare const shouldRegisterFormField: (widget: FormFieldWidget) => boolean;
36
- /**
37
- * Registers a form field widget with its parent form in the context
38
- * This creates references in both formfields and formWidgets collections
39
- *
40
- * @param widgetsContext - The Widgets context object where forms are stored
41
- * @param widget - The widget/proxy to register
42
- * @param widgetProps - The widget properties containing form metadata
43
- */
44
- export declare const registerFormField: (widgetsContext: WidgetsContext, widget: any, widgetProps: FormFieldWidget, newContext: any) => void;
45
- /**
46
- * Ensures the form structure exists in the widgets context and registers a form field
47
- * with safe object spreading to merge properties
48
- *
49
- * @param widgetsContext - The Widgets context object where forms are stored
50
- * @param fieldProps - The field properties to register
51
- */
52
- export declare const registerFormFieldSafe: (widgetsContext: WidgetsContext, fieldProps: FormFieldWidget) => void;
53
- /**
54
- * Unregisters a form field from its parent form
55
- *
56
- * @param widgetsContext - The Widgets context object where forms are stored
57
- * @param formName - The name of the parent form
58
- * @param fieldName - The name of the field to unregister
59
- * @param formKey - Optional form key (defaults to fieldName if not provided)
60
- */
61
- export declare const unregisterFormField: (widgetsContext: WidgetsContext, formName: string, fieldName: string, formKey?: string) => void;
62
- export {};
@@ -1,109 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropSymbols = Object.getOwnPropertySymbols;
3
- var __hasOwnProp = Object.prototype.hasOwnProperty;
4
- var __propIsEnum = Object.prototype.propertyIsEnumerable;
5
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
6
- var __spreadValues = (a, b) => {
7
- for (var prop in b || (b = {}))
8
- if (__hasOwnProp.call(b, prop))
9
- __defNormalProp(a, prop, b[prop]);
10
- if (__getOwnPropSymbols)
11
- for (var prop of __getOwnPropSymbols(b)) {
12
- if (__propIsEnum.call(b, prop))
13
- __defNormalProp(a, prop, b[prop]);
14
- }
15
- return a;
16
- };
17
- import get from "lodash-es/get";
18
- const isFormField = (widgetName) => {
19
- return !(widgetName == null ? void 0 : widgetName.includes("formWidget"));
20
- };
21
- const shouldRegisterFormField = (widget) => {
22
- const isField = get(widget, "field", "false") === "true";
23
- const hasFormName = Boolean(widget.formName);
24
- const isNotFormWidget = isFormField(widget.name);
25
- return isField && hasFormName && isNotFormWidget;
26
- };
27
- const hasParentForm = (formName) => {
28
- return Boolean();
29
- };
30
- const registerFormField = (widgetsContext, widget, widgetProps, newContext) => {
31
- var _a;
32
- const formName = widgetProps == null ? void 0 : widgetProps.formName;
33
- if (!formName || !shouldRegisterFormField(widgetProps)) {
34
- return;
35
- }
36
- const formKey = widgetProps.formKey || widgetProps.fieldName;
37
- const fieldName = widgetProps.fieldName;
38
- if (!formKey || !fieldName) {
39
- return;
40
- }
41
- if (!widgetsContext[formName]) {
42
- return;
43
- }
44
- widgetsContext[formName].formfields = widgetsContext[formName].formfields || {};
45
- widgetsContext[formName].formWidgets = widgetsContext[formName].formWidgets || {};
46
- widgetsContext[formName].formfields[formKey] = widget;
47
- widgetsContext[formName].formWidgets[fieldName] = widget;
48
- widgetsContext[formName].formfields[`${fieldName}_formWidget`] = widget;
49
- widgetsContext[formName].formWidgets[`${fieldName}_formWidget`] = widget;
50
- const parentFormName = (_a = widgetsContext[formName]) == null ? void 0 : _a.parentForm;
51
- if (parentFormName && widgetsContext[parentFormName]) {
52
- widgetsContext[parentFormName].formfields = widgetsContext[parentFormName].formfields || {};
53
- widgetsContext[parentFormName].formWidgets = widgetsContext[parentFormName].formWidgets || {};
54
- widgetsContext[parentFormName].formfields[formKey] = widget;
55
- widgetsContext[parentFormName].formWidgets[fieldName] = widget;
56
- widgetsContext[parentFormName].formfields[`${formKey}_formWidget`] = widget;
57
- widgetsContext[parentFormName].formWidgets[`${fieldName}_formWidget`] = widget;
58
- }
59
- };
60
- const registerFormFieldSafe = (widgetsContext, fieldProps) => {
61
- var _a;
62
- const formName = fieldProps == null ? void 0 : fieldProps.formName;
63
- if (!formName || !shouldRegisterFormField(fieldProps)) {
64
- return;
65
- }
66
- const formKey = fieldProps.formKey || fieldProps.fieldName;
67
- const fieldName = fieldProps.fieldName;
68
- if (!formKey || !fieldName) {
69
- return;
70
- }
71
- function register(formName2, formKey2, fieldName2, fieldProps2) {
72
- var _a2, _b, _c, _d, _e;
73
- (_a2 = widgetsContext[formName2]) != null ? _a2 : widgetsContext[formName2] = {
74
- formfields: {},
75
- formWidgets: {}
76
- };
77
- (_c = (_b = widgetsContext[formName2]).formfields) != null ? _c : _b.formfields = {};
78
- (_e = (_d = widgetsContext[formName2]).formWidgets) != null ? _e : _d.formWidgets = {};
79
- widgetsContext[formName2].formfields[formKey2] = __spreadValues({}, fieldProps2);
80
- widgetsContext[formName2].formWidgets[fieldName2] = __spreadValues({}, fieldProps2);
81
- widgetsContext[formName2].formfields[`${fieldName2}_formWidget`] = __spreadValues({}, fieldProps2);
82
- widgetsContext[formName2].formWidgets[`${fieldName2}_formWidget`] = __spreadValues({}, fieldProps2);
83
- }
84
- register(formName, formKey, fieldName, fieldProps);
85
- const parentForm = (_a = widgetsContext[formName]) == null ? void 0 : _a.parentForm;
86
- if (parentForm) {
87
- register(parentForm, formKey, fieldName, fieldProps);
88
- }
89
- };
90
- const unregisterFormField = (widgetsContext, formName, fieldName, formKey) => {
91
- if (!widgetsContext[formName]) {
92
- return;
93
- }
94
- const keyToRemove = formKey || fieldName;
95
- if (widgetsContext[formName].formfields) {
96
- delete widgetsContext[formName].formfields[keyToRemove];
97
- delete widgetsContext[formName].formfields[`${fieldName}_formWidget`];
98
- }
99
- if (widgetsContext[formName].formWidgets) {
100
- delete widgetsContext[formName].formWidgets[fieldName];
101
- delete widgetsContext[formName].formWidgets[`${fieldName}_formWidget`];
102
- }
103
- };
104
- export {
105
- registerFormField,
106
- registerFormFieldSafe,
107
- shouldRegisterFormField,
108
- unregisterFormField
109
- };