@wavemaker-ai/react-runtime 1.0.0-rc.647469 → 1.0.0-rc.647499

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 (315) hide show
  1. package/actions/base-action.d.ts +7 -0
  2. package/actions/login-action.d.ts +11 -0
  3. package/actions/logout-action.d.ts +10 -0
  4. package/actions/navigation-action.d.ts +35 -0
  5. package/actions/navigation-action.js +23 -5
  6. package/actions/notification-action.d.ts +20 -0
  7. package/actions/timer-action.d.ts +27 -0
  8. package/components/advanced/carousel/index.d.ts +1 -0
  9. package/components/advanced/carousel/index.js +2 -1
  10. package/components/advanced/carousel/template.d.ts +1 -0
  11. package/components/advanced/carousel/template.js +2 -1
  12. package/components/advanced/login/index.d.ts +1 -0
  13. package/components/advanced/marquee/index.d.ts +1 -0
  14. package/components/advanced/marquee/index.js +2 -1
  15. package/components/basic/anchor/index.d.ts +1 -0
  16. package/components/basic/anchor/index.js +4 -3
  17. package/components/basic/audio/index.d.ts +1 -0
  18. package/components/basic/audio/index.js +3 -2
  19. package/components/basic/html/index.d.ts +1 -0
  20. package/components/basic/icon/index.d.ts +1 -0
  21. package/components/basic/icon/index.js +4 -7
  22. package/components/basic/iframe/iframe.utils.d.ts +1 -1
  23. package/components/basic/iframe/iframe.utils.js +8 -4
  24. package/components/basic/iframe/index.d.ts +1 -0
  25. package/components/basic/label/index.d.ts +1 -0
  26. package/components/basic/label/index.js +3 -2
  27. package/components/basic/message/index.js +1 -1
  28. package/components/basic/picture/index.d.ts +1 -0
  29. package/components/basic/picture/index.js +3 -4
  30. package/components/basic/progress-bar/index.d.ts +1 -0
  31. package/components/basic/progress-bar/index.js +2 -1
  32. package/components/basic/progress-circle/index.d.ts +1 -0
  33. package/components/basic/richtexteditor/index.d.ts +2 -0
  34. package/components/basic/search/index.d.ts +3 -0
  35. package/components/basic/search/index.js +7 -4
  36. package/components/basic/search/props.d.ts +2 -0
  37. package/components/basic/spinner/index.d.ts +1 -0
  38. package/components/basic/tile/index.d.ts +1 -0
  39. package/components/basic/tile/index.js +2 -1
  40. package/components/basic/tree/Components/TreeNodeComponent.js +9 -5
  41. package/components/basic/tree/index.d.ts +1 -0
  42. package/components/basic/tree/index.js +14 -3
  43. package/components/basic/tree/utils.d.ts +2 -0
  44. package/components/basic/tree/utils.js +11 -1
  45. package/components/basic/video/index.d.ts +1 -0
  46. package/components/basic/video/index.js +40 -23
  47. package/components/chart/index.d.ts +1 -0
  48. package/components/common/AppSpinner.js +2 -5
  49. package/components/container/accordion/accordion-pane/index.d.ts +1 -0
  50. package/components/container/accordion/accordion-pane/index.js +1 -4
  51. package/components/container/accordion/index.d.ts +1 -0
  52. package/components/container/index.d.ts +3 -0
  53. package/components/container/index.js +6 -1
  54. package/components/container/layout-grid/grid-column/index.d.ts +1 -0
  55. package/components/container/layout-grid/grid-row/index.d.ts +1 -0
  56. package/components/container/layout-grid/index.d.ts +1 -0
  57. package/components/container/layout-grid/index.js +4 -8
  58. package/components/container/linear-layout/index.d.ts +1 -0
  59. package/components/container/linear-layout/linear-layout-item/index.d.ts +1 -0
  60. package/components/container/panel/components/panel-header/index.js +11 -6
  61. package/components/container/panel/components/panel-header/props.d.ts +5 -0
  62. package/components/container/panel/index.d.ts +1 -0
  63. package/components/container/panel/index.js +2 -1
  64. package/components/container/props.d.ts +2 -0
  65. package/components/container/repeat-template/index.d.ts +22 -1
  66. package/components/container/repeat-template/index.js +2 -1
  67. package/components/container/tabs/index.d.ts +3 -1
  68. package/components/container/tabs/index.js +102 -51
  69. package/components/container/tabs/props.d.ts +12 -0
  70. package/components/container/tabs/tab-pane/index.d.ts +1 -0
  71. package/components/container/tabs/tab-pane/index.js +28 -11
  72. package/components/container/wizard/index.d.ts +2 -0
  73. package/components/container/wizard/wizard-step/index.d.ts +1 -0
  74. package/components/container/wizard/wizard-step/index.js +2 -2
  75. package/components/data/card/card-actions/index.d.ts +1 -0
  76. package/components/data/card/card-actions/index.js +3 -5
  77. package/components/data/card/card-content/index.d.ts +1 -0
  78. package/components/data/card/card-content/index.js +3 -13
  79. package/components/data/card/card-footer/index.d.ts +1 -0
  80. package/components/data/card/card-footer/index.js +3 -5
  81. package/components/data/card/index.d.ts +1 -0
  82. package/components/data/card/index.js +3 -14
  83. package/components/data/form/dynamic-fields/index.js +7 -1
  84. package/components/data/form/dynamic-fields/props.d.ts +1 -0
  85. package/components/data/form/form-action/index.d.ts +2 -0
  86. package/components/data/form/form-body/index.js +2 -1
  87. package/components/data/form/form-field/base-field.js +4 -3
  88. package/components/data/form/form-footer/index.js +2 -1
  89. package/components/data/list/components/ListItemWithTemplate.js +4 -2
  90. package/components/data/list/hooks/props.d.ts +2 -2
  91. package/components/data/list/hooks/useListEventHandlers.js +6 -6
  92. package/components/data/list/index.d.ts +2 -0
  93. package/components/data/list/index.js +3 -4
  94. package/components/data/list/props.d.ts +2 -1
  95. package/components/data/list/utils/list-widget-methods.d.ts +2 -1
  96. package/components/data/table/components/RowCells.d.ts +16 -2
  97. package/components/data/table/components/RowCells.js +38 -24
  98. package/components/data/table/components/TableBody.js +11 -3
  99. package/components/data/table/components/TableDataRow.d.ts +3 -0
  100. package/components/data/table/components/TableDataRow.js +11 -3
  101. package/components/data/table/components/TableHeader.js +1 -4
  102. package/components/data/table/hooks/index.d.ts +1 -0
  103. package/components/data/table/hooks/index.js +12 -0
  104. package/components/data/table/hooks/useCustomExpressionColumns.d.ts +16 -0
  105. package/components/data/table/hooks/useCustomExpressionColumns.js +88 -0
  106. package/components/data/table/hooks/useDynamicColumns.js +1 -1
  107. package/components/data/table/hooks/useResponsiveColumns.d.ts +1 -0
  108. package/components/data/table/hooks/useRowSelection.d.ts +1 -1
  109. package/components/data/table/hooks/useRowSelection.js +26 -5
  110. package/components/data/table/hooks/useTableInitialization.js +2 -1
  111. package/components/data/table/index.d.ts +4 -0
  112. package/components/data/table/index.js +77 -12
  113. package/components/data/table/live-table/index.d.ts +1 -0
  114. package/components/data/table/props.d.ts +7 -0
  115. package/components/data/table/table-action/index.d.ts +1 -0
  116. package/components/data/table/table-column/index.d.ts +1 -0
  117. package/components/data/table/table-row/index.d.ts +1 -0
  118. package/components/data/table/table-row-action/index.d.ts +1 -0
  119. package/components/data/table/utils/buildSelectionColumns.js +7 -1
  120. package/components/data/table/utils/columnBuilder.js +1 -1
  121. package/components/data/table/utils/index.js +2 -2
  122. package/components/data/table/utils/renderDisplayCell.js +1 -1
  123. package/components/dialogs/alert-dialog/index.d.ts +2 -0
  124. package/components/dialogs/confirm-dialog/index.d.ts +2 -0
  125. package/components/dialogs/dialog/index.d.ts +2 -0
  126. package/components/dialogs/dialog/index.js +2 -4
  127. package/components/dialogs/dialog-actions/index.d.ts +1 -0
  128. package/components/dialogs/dialog-body/index.d.ts +1 -0
  129. package/components/dialogs/dialog-content/index.d.ts +1 -0
  130. package/components/dialogs/dialog-header/index.d.ts +1 -0
  131. package/components/dialogs/iframe-dialog/index.d.ts +2 -0
  132. package/components/dialogs/login-dialog/index.d.ts +2 -0
  133. package/components/dialogs/page-dialog/index.d.ts +2 -0
  134. package/components/form/button/index.d.ts +1 -0
  135. package/components/form/button/index.js +4 -3
  136. package/components/form/button-group/index.d.ts +1 -0
  137. package/components/form/button-group/index.js +2 -1
  138. package/components/input/calendar/index.d.ts +2 -0
  139. package/components/input/chips/index.d.ts +2 -0
  140. package/components/input/color-picker/index.d.ts +2 -0
  141. package/components/input/composite/index.d.ts +1 -0
  142. package/components/input/currency/index.d.ts +2 -0
  143. package/components/input/default/checkbox/index.d.ts +2 -0
  144. package/components/input/default/checkboxset/index.d.ts +2 -0
  145. package/components/input/default/radioset/index.d.ts +2 -0
  146. package/components/input/default/switch/index.d.ts +2 -0
  147. package/components/input/epoch/date/components/DatePickerPopover.js +11 -29
  148. package/components/input/epoch/date/index.d.ts +1 -0
  149. package/components/input/epoch/datetime/index.d.ts +1 -0
  150. package/components/input/epoch/datetime/index.js +10 -25
  151. package/components/input/epoch/time/index.d.ts +1 -0
  152. package/components/input/epoch/time/index.js +1 -1
  153. package/components/input/epoch/time/utils.d.ts +0 -17
  154. package/components/input/epoch/time/utils.js +1 -18
  155. package/components/input/fileupload/index.d.ts +1 -0
  156. package/components/input/number/index.d.ts +2 -0
  157. package/components/input/rating/index.d.ts +2 -0
  158. package/components/input/rating/index.js +14 -17
  159. package/components/input/select/index.d.ts +2 -0
  160. package/components/input/select/index.js +1 -4
  161. package/components/input/slider/index.d.ts +2 -0
  162. package/components/input/slider/index.js +13 -12
  163. package/components/input/text/index.d.ts +2 -0
  164. package/components/input/text/index.js +3 -14
  165. package/components/input/textarea/index.d.ts +2 -0
  166. package/components/input/textarea/index.js +7 -10
  167. package/components/input/upload/index.d.ts +2 -0
  168. package/components/input/upload/index.js +3 -5
  169. package/components/layout/footer/index.js +2 -1
  170. package/components/layout/footer/props.d.ts +1 -0
  171. package/components/layout/header/index.js +2 -1
  172. package/components/layout/header/props.d.ts +1 -0
  173. package/components/layout/leftnav/index.js +2 -1
  174. package/components/layout/leftnav/props.d.ts +1 -0
  175. package/components/layout/rightnav/index.js +2 -1
  176. package/components/layout/rightnav/props.d.ts +1 -0
  177. package/components/layout/topnav/index.js +2 -1
  178. package/components/layout/topnav/props.d.ts +1 -0
  179. package/components/navbar/index.d.ts +1 -0
  180. package/components/navbar/index.js +2 -1
  181. package/components/navbar/nav/index.d.ts +1 -0
  182. package/components/navbar/nav-item/index.d.ts +1 -0
  183. package/components/navbar/nav-item/index.js +2 -1
  184. package/components/navigation/breadcrumb/index.d.ts +1 -0
  185. package/components/navigation/menu/index.d.ts +1 -0
  186. package/components/navigation/menu/index.js +5 -4
  187. package/components/navigation/popover/index.d.ts +2 -1
  188. package/components/navigation/popover/index.js +1 -1
  189. package/components/page/error-boundary/index.js +5 -5
  190. package/components/page/index.js +13 -9
  191. package/components/page/partial/index.d.ts +1 -0
  192. package/components/prefab/container/index.js +2 -1
  193. package/context/WidgetProvider.js +2 -2
  194. package/core/app.service.js +40 -35
  195. package/core/constants/events.js +6 -0
  196. package/core/constants/index.d.ts +9 -1
  197. package/core/constants/index.js +32 -5
  198. package/core/formatter/date-formatters.d.ts +1 -1
  199. package/core/formatter/date-formatters.js +38 -13
  200. package/core/formatter/types.d.ts +1 -1
  201. package/core/proxy-service.js +15 -5
  202. package/core/security.service.d.ts +12 -0
  203. package/core/util/index.js +3 -2
  204. package/higherOrder/BaseApp.js +2 -2
  205. package/higherOrder/BasePage.d.ts +0 -17
  206. package/higherOrder/BasePage.js +53 -104
  207. package/higherOrder/BasePrefab.js +69 -59
  208. package/higherOrder/props.d.ts +1 -0
  209. package/higherOrder/withBaseWrapper.js +3 -4
  210. package/hooks/useAccess.js +13 -0
  211. package/mui-config/theme-provider.d.ts +3 -0
  212. package/mui-config/theme.d.ts +2 -0
  213. package/mui-config/theme.js +1 -4
  214. package/package-lock.json +2640 -615
  215. package/package.json +23 -4
  216. package/runtime-dynamic/App.d.ts +7 -0
  217. package/runtime-dynamic/App.js +144 -0
  218. package/runtime-dynamic/app-initializer.d.ts +15 -0
  219. package/runtime-dynamic/app-initializer.js +447 -0
  220. package/runtime-dynamic/components/ErrorBoundary.d.ts +18 -0
  221. package/runtime-dynamic/components/ErrorBoundary.js +93 -0
  222. package/runtime-dynamic/components/PageWrapper.d.ts +1 -0
  223. package/runtime-dynamic/components/PageWrapper.js +43 -0
  224. package/runtime-dynamic/components/PrefabPreview.d.ts +1 -0
  225. package/runtime-dynamic/components/PrefabPreview.js +84 -0
  226. package/runtime-dynamic/components/partial-content.d.ts +15 -0
  227. package/runtime-dynamic/components/partial-content.js +50 -0
  228. package/runtime-dynamic/components/prefab-content.d.ts +10 -0
  229. package/runtime-dynamic/components/prefab-content.js +31 -0
  230. package/runtime-dynamic/components/use-dynamic-component.d.ts +10 -0
  231. package/runtime-dynamic/components/use-dynamic-component.js +165 -0
  232. package/runtime-dynamic/factories/build-base-page-like-component.d.ts +8 -0
  233. package/runtime-dynamic/factories/build-base-page-like-component.js +59 -0
  234. package/runtime-dynamic/factories/prefab-factory.d.ts +3 -0
  235. package/runtime-dynamic/factories/prefab-factory.js +82 -0
  236. package/runtime-dynamic/factories/startup-info.d.ts +6 -0
  237. package/runtime-dynamic/factories/startup-info.js +28 -0
  238. package/runtime-dynamic/factories/utils.d.ts +23 -0
  239. package/runtime-dynamic/factories/utils.js +131 -0
  240. package/runtime-dynamic/index.d.ts +14 -0
  241. package/runtime-dynamic/index.js +191 -0
  242. package/runtime-dynamic/main.d.ts +2 -0
  243. package/runtime-dynamic/main.js +84 -0
  244. package/runtime-dynamic/preview-mode.d.ts +15 -0
  245. package/runtime-dynamic/preview-mode.js +31 -0
  246. package/runtime-dynamic/preview-navigation.d.ts +6 -0
  247. package/runtime-dynamic/preview-navigation.js +38 -0
  248. package/runtime-dynamic/preview-resource-base.d.ts +12 -0
  249. package/runtime-dynamic/preview-resource-base.js +65 -0
  250. package/runtime-dynamic/registry/component-registry.d.ts +3 -0
  251. package/runtime-dynamic/registry/component-registry.js +353 -0
  252. package/runtime-dynamic/registry/custom-widget-registry.d.ts +7 -0
  253. package/runtime-dynamic/registry/custom-widget-registry.js +18 -0
  254. package/runtime-dynamic/registry/index.d.ts +2 -0
  255. package/runtime-dynamic/registry/index.js +63 -0
  256. package/runtime-dynamic/registry/store.d.ts +9 -0
  257. package/runtime-dynamic/registry/store.js +26 -0
  258. package/runtime-dynamic/routes.d.ts +2 -0
  259. package/runtime-dynamic/routes.js +107 -0
  260. package/runtime-dynamic/services/app-extension-provider.d.ts +1 -0
  261. package/runtime-dynamic/services/app-extension-provider.js +45 -0
  262. package/runtime-dynamic/services/cache.d.ts +29 -0
  263. package/runtime-dynamic/services/cache.js +57 -0
  264. package/runtime-dynamic/services/component-ref-provider.d.ts +12 -0
  265. package/runtime-dynamic/services/component-ref-provider.js +149 -0
  266. package/runtime-dynamic/services/css-scoping.d.ts +2 -0
  267. package/runtime-dynamic/services/css-scoping.js +53 -0
  268. package/runtime-dynamic/services/fragment-url.d.ts +16 -0
  269. package/runtime-dynamic/services/fragment-url.js +74 -0
  270. package/runtime-dynamic/services/index.d.ts +10 -0
  271. package/runtime-dynamic/services/index.js +152 -0
  272. package/runtime-dynamic/services/markup-transpiler.d.ts +12 -0
  273. package/runtime-dynamic/services/markup-transpiler.js +250 -0
  274. package/runtime-dynamic/services/prefab-resources.d.ts +18 -0
  275. package/runtime-dynamic/services/prefab-resources.js +159 -0
  276. package/runtime-dynamic/services/resource-manager.d.ts +2 -0
  277. package/runtime-dynamic/services/resource-manager.js +66 -0
  278. package/runtime-dynamic/services/script-executor.d.ts +8 -0
  279. package/runtime-dynamic/services/script-executor.js +90 -0
  280. package/runtime-dynamic/services/variable-factory.d.ts +2 -0
  281. package/runtime-dynamic/services/variable-factory.js +260 -0
  282. package/runtime-dynamic/services/variable-registry.d.ts +12 -0
  283. package/runtime-dynamic/services/variable-registry.js +118 -0
  284. package/runtime-dynamic/services/variable-transpiler.d.ts +5 -0
  285. package/runtime-dynamic/services/variable-transpiler.js +159 -0
  286. package/runtime-dynamic/shims/next-image.d.ts +35 -0
  287. package/runtime-dynamic/shims/next-image.js +60 -0
  288. package/runtime-dynamic/shims/next-link.d.ts +25 -0
  289. package/runtime-dynamic/shims/next-link.js +33 -0
  290. package/runtime-dynamic/shims/next-navigation.d.ts +16 -0
  291. package/runtime-dynamic/shims/next-navigation.js +52 -0
  292. package/runtime-dynamic/utils/index.d.ts +9 -0
  293. package/runtime-dynamic/utils/index.js +40 -0
  294. package/store/middleware/navigationMiddleware.js +1 -1
  295. package/store/slices/appConfigSlice.js +10 -8
  296. package/store/slices/authSlice.js +46 -32
  297. package/tsconfig.declaration.tsbuildinfo +1 -1
  298. package/types/index.d.ts +1 -0
  299. package/utils/attr.js +71 -14
  300. package/utils/custom-expression/index.d.ts +43 -0
  301. package/utils/custom-expression/index.js +161 -0
  302. package/utils/custom-expression/parser.d.ts +15 -0
  303. package/utils/custom-expression/parser.js +208 -0
  304. package/utils/layoutsize-util.d.ts +1 -0
  305. package/utils/layoutsize-util.js +57 -0
  306. package/utils/lib-error-skipper.d.ts +4 -26
  307. package/utils/lib-error-skipper.js +41 -165
  308. package/utils/style-utils.d.ts +6 -0
  309. package/utils/style-utils.js +10 -1
  310. package/variables/metadata.service.js +2 -3
  311. package/variables/model-variable.js +10 -7
  312. package/variables/service-variable.d.ts +1 -0
  313. package/variables/service-variable.js +26 -6
  314. package/components/input/epoch/datetime/styled.d.ts +0 -78
  315. package/components/input/epoch/datetime/styled.js +0 -90
@@ -6,194 +6,70 @@ Object.defineProperty(exports, "__esModule", {
6
6
  });
7
7
  exports.wrapWithThirdPartyErrorGuard = exports.isJQueryError = void 0;
8
8
  var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
9
- function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
10
- function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
11
- function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
12
9
  /**
13
- * Utility to wrap all methods in a script object with jQuery error handling
14
- * This prevents jQuery usage from breaking the React application
15
- */
16
-
17
- /**
18
- * Configuration for unsupported libraries
10
+ * Wraps page/prefab script methods with error handling that detects
11
+ * unsupported library usage (e.g. jQuery) and surfaces all other errors
12
+ * with full context instead of swallowing them.
19
13
  */
20
14
 
21
15
  var UNSUPPORTED_LIBRARIES = {
22
16
  jquery: {
23
- // Use specific jQuery patterns - avoid matching Wavemaker vars like $index, $data
24
17
  identifiers: ["jQuery", "$(", "$."],
25
18
  errorMessage: "jQuery is not supported in React App",
26
19
  notificationMessage: "jQuery functionality is not supported. Check console for details."
27
20
  }
28
- // Add more libraries here in future
29
21
  };
30
-
31
- /**
32
- * Result of unsupported library detection
33
- */
34
-
35
- /**
36
- * Detects if an error is related to any unsupported library
37
- * @param error - The error object to check
38
- * @returns Object with isUnsupported flag and library info
39
- */
40
22
  function detectUnsupportedLibrary(error) {
41
- if (!error || !error.stack) {
42
- return {
43
- isUnsupported: false,
44
- library: null
45
- };
46
- }
47
- var errorMessage = error.message || "";
48
- var stackTrace = String(error.stack);
49
-
50
- // Check each configured library
23
+ if (!(error !== null && error !== void 0 && error.stack)) return null;
24
+ var haystack = "".concat(error.message || "", "\n").concat(error.stack);
51
25
  for (var _i = 0, _Object$entries = Object.entries(UNSUPPORTED_LIBRARIES); _i < _Object$entries.length; _i++) {
52
26
  var _Object$entries$_i = (0, _slicedToArray2["default"])(_Object$entries[_i], 2),
53
- libraryName = _Object$entries$_i[0],
27
+ name = _Object$entries$_i[0],
54
28
  config = _Object$entries$_i[1];
55
- var identifiers = config.identifiers;
56
-
57
- // Check if error message contains library identifiers
58
- if (identifiers.some(function (identifier) {
59
- return errorMessage.includes(identifier);
29
+ if (config.identifiers.some(function (id) {
30
+ return haystack.includes(id);
60
31
  })) {
61
32
  return {
62
- isUnsupported: true,
63
- library: libraryName,
33
+ library: name,
64
34
  config: config
65
35
  };
66
36
  }
67
-
68
- // Check if stack trace contains library identifiers
69
- var stackLines = stackTrace.split("\n");
70
- var _iterator = _createForOfIteratorHelper(stackLines),
71
- _step;
72
- try {
73
- var _loop = function _loop() {
74
- var line = _step.value;
75
- if (identifiers.some(function (identifier) {
76
- return line.includes(identifier);
77
- })) {
78
- return {
79
- v: {
80
- isUnsupported: true,
81
- library: libraryName,
82
- config: config
83
- }
84
- };
85
- }
86
- },
87
- _ret;
88
- for (_iterator.s(); !(_step = _iterator.n()).done;) {
89
- _ret = _loop();
90
- if (_ret) return _ret.v;
91
- }
92
- } catch (err) {
93
- _iterator.e(err);
94
- } finally {
95
- _iterator.f();
96
- }
97
37
  }
98
- return {
99
- isUnsupported: false,
100
- library: null
101
- };
38
+ return null;
102
39
  }
103
-
104
- /**
105
- * Checks if an error is related to jQuery usage
106
- * @param error - The error object to check
107
- * @returns true if the error is jQuery-related
108
- */
109
40
  var isJQueryError = exports.isJQueryError = function isJQueryError(error) {
110
- if (!(error !== null && error !== void 0 && error.stack)) return false;
111
-
112
- // Use specific jQuery patterns - avoid matching Wavemaker vars like $index, $data
113
- var UnSupportedFunctionality = ["jQuery", "$(", "$."];
114
-
115
- // Check if error message contains jQuery references
116
- if (error.message && UnSupportedFunctionality.some(function (func) {
117
- return error.message.includes(func);
118
- })) {
119
- return true;
120
- }
121
-
122
- // Check stack trace for jQuery references
123
- var stackLines = error.stack.split("\n");
124
- var _iterator2 = _createForOfIteratorHelper(stackLines),
125
- _step2;
126
- try {
127
- var _loop2 = function _loop2() {
128
- var line = _step2.value;
129
- if (UnSupportedFunctionality.some(function (func) {
130
- return line.includes(func);
131
- })) {
132
- return {
133
- v: true
134
- };
135
- }
136
- },
137
- _ret2;
138
- for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
139
- _ret2 = _loop2();
140
- if (_ret2) return _ret2.v;
141
- }
142
- } catch (err) {
143
- _iterator2.e(err);
144
- } finally {
145
- _iterator2.f();
146
- }
147
- return false;
41
+ var _detectUnsupportedLib;
42
+ return ((_detectUnsupportedLib = detectUnsupportedLibrary(error)) === null || _detectUnsupportedLib === void 0 ? void 0 : _detectUnsupportedLib.library) === "jquery";
148
43
  };
149
- /**
150
- * Wraps all methods with unsupported library error handling
151
- * @param pageProxy - The page/prefab proxy object
152
- * @param appContext - App context for notifications
153
- * @param componentName - Name of component for logging
154
- * @param libraryConfig - Optional: specific libraries to check (default: all)
155
- */
44
+ var SKIP_PROPERTIES = new Set(["Variables", "Actions", "Widgets", "App", "pageParams", "serviceDefinitions", "baseUrl", "appConfig", "notification", "toaster", "onContentReady", "onChange", "cleanup", "eval", "appLocale", "executeStartup", "formatters", "type", "componentName", "componentType", "prefabname", "onPropertyChange"]);
156
45
  var wrapWithThirdPartyErrorGuard = exports.wrapWithThirdPartyErrorGuard = function wrapWithThirdPartyErrorGuard(pageProxy, appContext, componentName) {
157
- var libraryConfig = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : UNSUPPORTED_LIBRARIES;
158
- var skipProperties = ["Variables", "Actions", "Widgets", "App", "pageParams", "serviceDefinitions", "baseUrl", "appConfig", "notification", "toaster", "onContentReady", "onChange", "cleanup", "eval", "appLocale", "executeStartup", "formatters", "type", "componentName", "componentType", "prefabname", "onPropertyChange"];
159
- Object.keys(pageProxy).forEach(function (methodName) {
160
- if (typeof pageProxy[methodName] === "function" && !skipProperties.includes(methodName)) {
161
- var originalMethod = pageProxy[methodName];
162
- pageProxy[methodName] = function () {
163
- try {
164
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
165
- args[_key] = arguments[_key];
166
- }
167
- return originalMethod.apply(this, args);
168
- } catch (error) {
169
- // Detect which unsupported library caused the error
170
- var detection = detectUnsupportedLibrary(error);
171
- if (detection.isUnsupported && detection.library && detection.config) {
172
- var library = detection.library;
173
- var config = detection.config;
174
-
175
- // Log detailed error
176
- console.error("[".concat(library.toUpperCase(), " ERROR] in ").concat(componentName, ".").concat(methodName, "()"), "\n".concat(config.errorMessage), "\nError:", error);
177
-
178
- // Show user notification
179
- if (appContext !== null && appContext !== void 0 && appContext.notifyApp) {
180
- appContext.notifyApp(config.notificationMessage, "Error");
181
- }
182
-
183
- // Return undefined to prevent further errors
184
- return undefined;
185
- } else {
186
- // Not an unsupported library error - log normally
187
- console.log("Error in ".concat(componentName, ".").concat(methodName, "():"));
188
- }
46
+ var _loop = function _loop() {
47
+ var methodName = _Object$keys[_i2];
48
+ if (typeof pageProxy[methodName] !== "function" || SKIP_PROPERTIES.has(methodName)) return 1; // continue
49
+ var originalMethod = pageProxy[methodName];
50
+ pageProxy[methodName] = function () {
51
+ try {
52
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
53
+ args[_key] = arguments[_key];
189
54
  }
190
- };
191
-
192
- // Preserve function name for debugging
193
- Object.defineProperty(pageProxy[methodName], "name", {
194
- value: "wrapped_".concat(methodName),
195
- writable: false
196
- });
197
- }
198
- });
55
+ return originalMethod.apply(this, args);
56
+ } catch (error) {
57
+ var detection = detectUnsupportedLibrary(error);
58
+ if (detection) {
59
+ var _appContext$notifyApp;
60
+ console.error("[".concat(detection.library.toUpperCase(), "] ").concat(componentName, ".").concat(methodName, "(): ").concat(detection.config.errorMessage), error);
61
+ appContext === null || appContext === void 0 || (_appContext$notifyApp = appContext.notifyApp) === null || _appContext$notifyApp === void 0 || _appContext$notifyApp.call(appContext, detection.config.notificationMessage, "Error");
62
+ return undefined;
63
+ }
64
+ console.error("[script] ".concat(componentName, ".").concat(methodName, "():"), error);
65
+ }
66
+ };
67
+ Object.defineProperty(pageProxy[methodName], "name", {
68
+ value: "wrapped_".concat(methodName),
69
+ writable: false
70
+ });
71
+ };
72
+ for (var _i2 = 0, _Object$keys = Object.keys(pageProxy); _i2 < _Object$keys.length; _i2++) {
73
+ if (_loop()) continue;
74
+ }
199
75
  };
@@ -20,3 +20,9 @@ export declare const mergeStyleObjects: (...styleObjects: any[]) => Record<strin
20
20
  */
21
21
  export declare const isValidStyleObject: (value: any) => boolean;
22
22
  export declare const filterAutoLayoutClasses: (layoutClassName: string | undefined, prefixesToGet: string[], mode?: "include" | "exclude") => string;
23
+ /**
24
+ * Normalizes a React style length (width, height, margin, etc.): numbers become pixel
25
+ * values (`${n}px`), matching common React `style` behavior; strings pass through
26
+ * (e.g. `100%`, `2rem`, `10px`).
27
+ */
28
+ export declare const toCssLength: (value: string | number) => string;
@@ -4,7 +4,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
4
4
  Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
- exports.sanitizeStyleObject = exports.mergeStyleObjects = exports.isValidStyleObject = exports.filterAutoLayoutClasses = void 0;
7
+ exports.toCssLength = exports.sanitizeStyleObject = exports.mergeStyleObjects = exports.isValidStyleObject = exports.filterAutoLayoutClasses = void 0;
8
8
  var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
9
9
  var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
10
10
  var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
@@ -80,4 +80,13 @@ var filterAutoLayoutClasses = exports.filterAutoLayoutClasses = function filterA
80
80
  });
81
81
  return mode === "include" ? matches : !matches;
82
82
  }).join(" ");
83
+ };
84
+
85
+ /**
86
+ * Normalizes a React style length (width, height, margin, etc.): numbers become pixel
87
+ * values (`${n}px`), matching common React `style` behavior; strings pass through
88
+ * (e.g. `100%`, `2rem`, `10px`).
89
+ */
90
+ var toCssLength = exports.toCssLength = function toCssLength(value) {
91
+ return typeof value === "number" ? "".concat(value, "px") : String(value);
83
92
  };
@@ -33,7 +33,7 @@ var MetadataService = exports.MetadataService = /*#__PURE__*/function () {
33
33
  _ref,
34
34
  _WM_APP_PROPERTIES,
35
35
  _this = this;
36
- var state, appConfig, baseUrl, isPreview, serviceDefSources, url, serviceDefFileName, previewPath;
36
+ var state, appConfig, baseUrl, isPreview, serviceDefSources, url, serviceDefFileName;
37
37
  return _regenerator["default"].wrap(function _callee$(_context) {
38
38
  while (1) switch (_context.prev = _context.next) {
39
39
  case 0:
@@ -44,8 +44,7 @@ var MetadataService = exports.MetadataService = /*#__PURE__*/function () {
44
44
  serviceDefSources = ((_WM_APP_PROPERTIES = window._WM_APP_PROPERTIES) === null || _WM_APP_PROPERTIES === void 0 ? void 0 : _WM_APP_PROPERTIES.serviceDefSources) || "DYNAMIC";
45
45
  serviceDefFileName = prefabName ? "".concat(prefabName, "-prefab-servicedefs.json") : "app-servicedefs.json";
46
46
  if (isPreview || serviceDefSources === "DYNAMIC") {
47
- previewPath = prefabName ? "prefabs/".concat(prefabName) : "";
48
- url = "".concat(baseUrl, "/services/").concat(previewPath, "/servicedefs");
47
+ url = prefabName && prefabName !== "__self__" ? "".concat(baseUrl, "/services/prefabs/").concat(prefabName, "/servicedefs") : "".concat(baseUrl, "/services/servicedefs");
49
48
  } else {
50
49
  url = "".concat(baseUrl, "/services/servicedefs/").concat(serviceDefFileName);
51
50
  }
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
7
  exports.ModelVariable = void 0;
8
+ var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
8
9
  var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
9
10
  var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
10
11
  var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
@@ -24,13 +25,12 @@ var ModelVariable = exports.ModelVariable = /*#__PURE__*/function (_ref) {
24
25
  function ModelVariable(config) {
25
26
  var _this;
26
27
  (0, _classCallCheck2["default"])(this, ModelVariable);
27
- // Initialize with empty dataset first
28
+ var initialData = config.paramProvider();
28
29
  var variable = {
29
30
  name: config.name,
30
- dataSet: config.paramProvider() || {
31
+ dataSet: initialData != null ? initialData : config.isList ? [] : {
31
32
  dataValue: ""
32
33
  },
33
- // Default empty value
34
34
  isList: config.isList,
35
35
  twoWayBinding: config.twoWayBinding
36
36
  };
@@ -49,12 +49,15 @@ var ModelVariable = exports.ModelVariable = /*#__PURE__*/function (_ref) {
49
49
  value: function invoke(params, onSuccess, onError) {
50
50
  var result;
51
51
  try {
52
- if (this.dataSet && this.config.paramProvider()) {
53
- this.dataSet = _objectSpread(_objectSpread({}, this.dataSet), this.config.paramProvider());
52
+ var provided = this.config.paramProvider();
53
+ if (Array.isArray(provided)) {
54
+ this.dataSet = provided;
55
+ } else if (this.dataSet && provided) {
56
+ this.dataSet = Array.isArray(this.dataSet) ? provided : _objectSpread(_objectSpread({}, this.dataSet), provided);
54
57
  } else if (this.dataSet && Object.keys(this.dataSet).length !== 0) {
55
- this.dataSet = _objectSpread({}, this.dataSet);
58
+ this.dataSet = Array.isArray(this.dataSet) ? (0, _toConsumableArray2["default"])(this.dataSet) : _objectSpread({}, this.dataSet);
56
59
  } else {
57
- this.dataSet = this.config.paramProvider();
60
+ this.dataSet = provided;
58
61
  }
59
62
  this.notify(_baseVariable.VariableEvents.BEFORE_INVOKE, [this, this.dataSet]);
60
63
  result = _superPropGet(ModelVariable, "execute", this, 3)([params, function () {}]);
@@ -27,6 +27,7 @@ export declare class ServiceVariable extends ServiceVariable_base {
27
27
  private dateFormatter;
28
28
  private lastParams;
29
29
  private lastParamProviderValues;
30
+ private dataBindingRequestBody;
30
31
  constructor(config: ServiceVariableConfig);
31
32
  private updateFirstAndLastRecord;
32
33
  private setupEventHandlers;
@@ -61,6 +61,7 @@ var ServiceVariable = exports.ServiceVariable = /*#__PURE__*/function (_ref) {
61
61
  spinnerMessage: config.spinnerMessage,
62
62
  spinnerContext: config.spinnerContext,
63
63
  onSuccess: function onSuccess(context, args) {
64
+ _this.dataBindingRequestBody(args, _this.lastInvokedParams);
64
65
  _this.notify(_baseVariable.VariableEvents.AFTER_INVOKE, [args.variable, args.data, args.options]);
65
66
  _this.notify(_baseVariable.VariableEvents.SUCCESS, [args.variable, args.data, args.options]);
66
67
  _this.updateFirstAndLastRecord(args.data);
@@ -113,6 +114,22 @@ var ServiceVariable = exports.ServiceVariable = /*#__PURE__*/function (_ref) {
113
114
  // Method to update firstRecord and lastRecord from the current dataset
114
115
  (0, _inherits2["default"])(ServiceVariable, _ref);
115
116
  return (0, _createClass2["default"])(ServiceVariable, [{
117
+ key: "dataBindingRequestBody",
118
+ value: function dataBindingRequestBody(args, invokedParams) {
119
+ var _invokedParams$Reques;
120
+ var v = args === null || args === void 0 ? void 0 : args.variable;
121
+ if (!v) return;
122
+ v.dataBinding = v.dataBinding || {};
123
+
124
+ // Keep both casings for compatibility with app scripts and Angular runtime expectations.
125
+ // Prefer existing values, otherwise fallback to the request payload used for invocation.
126
+ var existingBody = v.dataBinding.RequestBody;
127
+ var payload = (_invokedParams$Reques = invokedParams === null || invokedParams === void 0 ? void 0 : invokedParams.RequestBody) !== null && _invokedParams$Reques !== void 0 ? _invokedParams$Reques : invokedParams;
128
+ if (existingBody === undefined && payload !== undefined) {
129
+ v.dataBinding.RequestBody = payload;
130
+ }
131
+ }
132
+ }, {
116
133
  key: "updateFirstAndLastRecord",
117
134
  value: function updateFirstAndLastRecord(data) {
118
135
  try {
@@ -264,14 +281,17 @@ var ServiceVariable = exports.ServiceVariable = /*#__PURE__*/function (_ref) {
264
281
  }, {
265
282
  key: "invoke",
266
283
  value: function invoke(options, onSuccess, onError) {
267
- this.params = (0, _lodashEs.merge)({}, this.config.paramProvider(), this.params);
268
- this.params = (0, _util.deepCopy)({}, this.params, this.dataBinding);
284
+ // Build request params locally never mutate this.params, this.dataBinding, or options.inputFields
285
+ var inputFields = (0, _lodashEs.merge)({}, this.config.paramProvider(), this.dataBinding, this.params);
269
286
  if (options) {
270
- this.params = (0, _util.deepCopy)({}, this.params, options.inputFields ? options.inputFields : options);
287
+ var _options$inputFields;
288
+ var overrides = (_options$inputFields = options.inputFields) !== null && _options$inputFields !== void 0 ? _options$inputFields : options;
289
+ inputFields = (0, _lodashEs.merge)({}, inputFields, overrides);
290
+ } else {
291
+ options = {};
271
292
  }
272
- options = options || {};
273
- options.inputFields = this.params;
274
- this.lastInvokedParams = this.params;
293
+ options.inputFields = inputFields;
294
+ this.lastInvokedParams = inputFields;
275
295
 
276
296
  // Normalize orderBy option
277
297
  if (!options.orderBy) {
@@ -1,78 +0,0 @@
1
- export declare const datePickerSx: (showweeks: boolean) => {
2
- "& .MuiPaper-root": {
3
- background: string;
4
- padding: string;
5
- borderRadius: string;
6
- };
7
- "& .MuiDateCalendar-root": {
8
- width: string;
9
- };
10
- "& .MuiDayCalendar-header": {
11
- justifyContent: string;
12
- };
13
- "& .MuiDayCalendar-weekNumber": {
14
- marginTop: string;
15
- textAlign: string;
16
- };
17
- "& .MuiDayCalendar-slideTransition": {
18
- minHeight: string;
19
- };
20
- "& .MuiDayCalendar-weekNumberLabel": {
21
- width: string;
22
- padding: string;
23
- };
24
- "& .MuiTypography-caption": {
25
- padding: string;
26
- };
27
- "& .MuiYearCalendar-root": {
28
- width: string;
29
- };
30
- "& .MuiPickersDay-root.Mui-selected": {
31
- backgroundColor: string;
32
- color: string;
33
- fontWeight: string;
34
- };
35
- "& .MuiMonthCalendar-button.Mui-selected": {
36
- backgroundColor: string;
37
- color: string;
38
- fontWeight: string;
39
- };
40
- "& .MuiPickersDay-root.Mui-selected:hover": {
41
- backgroundColor: string;
42
- color: string;
43
- };
44
- "& .MuiYearCalendar-button.Mui-selected": {
45
- backgroundColor: string;
46
- color: string;
47
- fontWeight: string;
48
- };
49
- "& .MuiPickersDay-today": {
50
- backgroundColor: string;
51
- };
52
- };
53
- export declare const timePickerSx: () => {
54
- "& .css-1y6l765-MuiPickersLayout-root": {
55
- display: string;
56
- };
57
- "& .MuiPaper-root": {
58
- background: string;
59
- padding: string;
60
- borderRadius: string;
61
- };
62
- "& .Mui-selected": {
63
- backgroundColor: string;
64
- color: string;
65
- };
66
- "& .Mui-selected:hover": {
67
- backgroundColor: string;
68
- color: string;
69
- };
70
- };
71
- export declare const buttonStyles: () => {
72
- "& .MuiButton-root": {
73
- "--wm-btn-color": string;
74
- "--wm-btn-state-layer-color": string;
75
- background: string;
76
- border: string;
77
- };
78
- };
@@ -1,90 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.timePickerSx = exports.datePickerSx = exports.buttonStyles = void 0;
7
- var datePickerSx = exports.datePickerSx = function datePickerSx(showweeks) {
8
- return {
9
- "& .MuiPaper-root": {
10
- background: "var(--wm-datepicker-background)",
11
- padding: "var(--wm-datepicker-padding)",
12
- borderRadius: "var(--wm-datepicker-border-radius)"
13
- },
14
- "& .MuiDateCalendar-root": {
15
- width: showweeks ? "420px" : "370px"
16
- },
17
- "& .MuiDayCalendar-header": {
18
- justifyContent: "space-evenly"
19
- },
20
- "& .MuiDayCalendar-weekNumber": {
21
- marginTop: "10px",
22
- textAlign: "center"
23
- },
24
- "& .MuiDayCalendar-slideTransition": {
25
- minHeight: "260px"
26
- },
27
- "& .MuiDayCalendar-weekNumberLabel": {
28
- width: "32px !important",
29
- padding: "0px 0px !important"
30
- },
31
- "& .MuiTypography-caption": {
32
- padding: "0px 24px"
33
- },
34
- "& .MuiYearCalendar-root": {
35
- width: "auto"
36
- },
37
- "& .MuiPickersDay-root.Mui-selected": {
38
- backgroundColor: "var(--wm-btn-secondary-background) !important",
39
- color: "var(--wm-btn-secondary-color)",
40
- fontWeight: "bold"
41
- },
42
- "& .MuiMonthCalendar-button.Mui-selected": {
43
- backgroundColor: "var(--wm-btn-secondary-background) !important",
44
- color: "var(--wm-btn-secondary-color)",
45
- fontWeight: "bold"
46
- },
47
- "& .MuiPickersDay-root.Mui-selected:hover": {
48
- backgroundColor: "var(--wm-btn-secondary-background)",
49
- color: "var(--wm-btn-secondary-color)"
50
- },
51
- "& .MuiYearCalendar-button.Mui-selected": {
52
- backgroundColor: "var(--wm-btn-secondary-background) !important",
53
- color: "var(--wm-btn-secondary-color)",
54
- fontWeight: "bold"
55
- },
56
- "& .MuiPickersDay-today": {
57
- backgroundColor: "transparent !important"
58
- }
59
- };
60
- };
61
- var timePickerSx = exports.timePickerSx = function timePickerSx() {
62
- return {
63
- "& .css-1y6l765-MuiPickersLayout-root": {
64
- display: "inline-block"
65
- },
66
- "& .MuiPaper-root": {
67
- background: "var(--wm-timepicker-background)",
68
- padding: "var(--wm-timepicker-padding)",
69
- borderRadius: "var(--wm-timepicker-border-radius)"
70
- },
71
- "& .Mui-selected": {
72
- backgroundColor: "var(--wm-btn-secondary-background) !important",
73
- color: "var(--wm-btn-secondary-color) !important"
74
- },
75
- "& .Mui-selected:hover": {
76
- backgroundColor: "var(--wm-btn-secondary-background) !important",
77
- color: "var(--wm-btn-secondary-color) !important"
78
- }
79
- };
80
- };
81
- var buttonStyles = exports.buttonStyles = function buttonStyles() {
82
- return {
83
- "& .MuiButton-root": {
84
- "--wm-btn-color": "var(--wm-color-primary)",
85
- "--wm-btn-state-layer-color": "var(--wm-color-primary)",
86
- background: "none",
87
- border: "none"
88
- }
89
- };
90
- };