@wavemaker/app-ng-runtime 12.0.0-next.45752 → 12.0.0-next.46502

Sign up to get free protection for your applications and to get access to all the features.
Files changed (318) hide show
  1. app-ng-runtime/build-task/bundles/index.umd.js +53 -45
  2. app-ng-runtime/build-task/esm2022/basic/default/anchor/anchor.build.mjs +2 -2
  3. app-ng-runtime/build-task/esm2022/basic/default/html/html.build.mjs +2 -2
  4. app-ng-runtime/build-task/esm2022/basic/default/icon/icon.build.mjs +2 -2
  5. app-ng-runtime/build-task/esm2022/basic/default/label/label.build.mjs +2 -2
  6. app-ng-runtime/build-task/esm2022/basic/default/picture/picture.build.mjs +2 -2
  7. app-ng-runtime/build-task/esm2022/basic/default/spinner/spinner.build.mjs +2 -2
  8. app-ng-runtime/build-task/esm2022/basic/progress/progress-circle/progress-circle.build.mjs +7 -2
  9. app-ng-runtime/build-task/esm2022/basic/rich-text-editor/rich-text-editor.build.mjs +2 -2
  10. app-ng-runtime/build-task/esm2022/containers/accordion/accordion-pane/accordion-pane.build.mjs +2 -2
  11. app-ng-runtime/build-task/esm2022/containers/accordion/accordion.build.mjs +3 -3
  12. app-ng-runtime/build-task/esm2022/containers/tile/tile.build.mjs +2 -2
  13. app-ng-runtime/build-task/esm2022/containers/wizard/wizard.build.mjs +2 -2
  14. app-ng-runtime/build-task/esm2022/data/form/form-field/form-field.build.mjs +4 -4
  15. app-ng-runtime/build-task/esm2022/device/barcode-scanner/barcode-scanner.build.mjs +2 -2
  16. app-ng-runtime/build-task/esm2022/device/camera/camera.build.mjs +2 -2
  17. app-ng-runtime/build-task/esm2022/dialogs/alert-dialog/alert-dialog.build.mjs +2 -2
  18. app-ng-runtime/build-task/esm2022/input/calendar/calendar.build.mjs +2 -2
  19. app-ng-runtime/build-task/esm2022/input/chips/chips.build.mjs +2 -2
  20. app-ng-runtime/build-task/esm2022/input/color-picker/color-picker.build.mjs +3 -3
  21. app-ng-runtime/build-task/esm2022/input/currency/currency.build.mjs +3 -3
  22. app-ng-runtime/build-task/esm2022/input/default/button/button.build.mjs +2 -2
  23. app-ng-runtime/build-task/esm2022/input/default/button-group/button-group.build.mjs +2 -2
  24. app-ng-runtime/build-task/esm2022/input/default/switch/switch.build.mjs +2 -2
  25. app-ng-runtime/build-task/esm2022/input/file-upload/file-upload.build.mjs +6 -2
  26. app-ng-runtime/build-task/esm2022/page/footer/footer.build.mjs +2 -2
  27. app-ng-runtime/build-task/esm2022/page/header/header.build.mjs +2 -2
  28. app-ng-runtime/build-task/esm2022/page/layout.build.mjs +2 -2
  29. app-ng-runtime/build-task/esm2022/page/left-panel/left-panel.build.mjs +2 -2
  30. app-ng-runtime/build-task/esm2022/page/page.build.mjs +2 -2
  31. app-ng-runtime/build-task/esm2022/page/right-panel/right-panel.build.mjs +2 -2
  32. app-ng-runtime/build-task/esm2022/page/top-nav/top-nav.build.mjs +2 -2
  33. app-ng-runtime/build-task/fesm2022/index.mjs +53 -45
  34. app-ng-runtime/build-task/fesm2022/index.mjs.map +1 -1
  35. app-ng-runtime/components/advanced/carousel/bundles/index.umd.js +1 -1
  36. app-ng-runtime/components/advanced/carousel/esm2022/carousel.animator.mjs +2 -2
  37. app-ng-runtime/components/advanced/carousel/fesm2022/index.mjs +1 -1
  38. app-ng-runtime/components/advanced/carousel/fesm2022/index.mjs.map +1 -1
  39. app-ng-runtime/components/base/bundles/index.umd.js +1 -6
  40. app-ng-runtime/components/base/esm2022/pipes/custom-pipes.mjs +3 -3
  41. app-ng-runtime/components/base/esm2022/widgets/common/base/base.component.mjs +1 -6
  42. app-ng-runtime/components/base/fesm2022/index.mjs +1 -6
  43. app-ng-runtime/components/base/fesm2022/index.mjs.map +1 -1
  44. app-ng-runtime/components/base/pipes/custom-pipes.d.ts +1 -1
  45. app-ng-runtime/components/basic/default/anchor/anchor.component.d.ts +1 -0
  46. app-ng-runtime/components/basic/default/audio/audio.component.d.ts +3 -0
  47. app-ng-runtime/components/basic/default/bundles/index.umd.js +39 -19
  48. app-ng-runtime/components/basic/default/esm2022/anchor/anchor.component.mjs +4 -4
  49. app-ng-runtime/components/basic/default/esm2022/anchor/anchor.props.mjs +2 -1
  50. app-ng-runtime/components/basic/default/esm2022/audio/audio.component.mjs +14 -6
  51. app-ng-runtime/components/basic/default/esm2022/audio/audio.props.mjs +2 -1
  52. app-ng-runtime/components/basic/default/esm2022/html/html.props.mjs +2 -1
  53. app-ng-runtime/components/basic/default/esm2022/icon/icon.component.mjs +6 -7
  54. app-ng-runtime/components/basic/default/esm2022/icon/icon.props.mjs +2 -1
  55. app-ng-runtime/components/basic/default/esm2022/iframe/iframe.component.mjs +3 -3
  56. app-ng-runtime/components/basic/default/esm2022/iframe/iframe.props.mjs +3 -2
  57. app-ng-runtime/components/basic/default/esm2022/label/label.props.mjs +1 -1
  58. app-ng-runtime/components/basic/default/esm2022/picture/picture.directive.mjs +2 -2
  59. app-ng-runtime/components/basic/default/esm2022/picture/picture.props.mjs +3 -1
  60. app-ng-runtime/components/basic/default/esm2022/spinner/spinner.props.mjs +3 -2
  61. app-ng-runtime/components/basic/default/esm2022/video/video.component.mjs +8 -4
  62. app-ng-runtime/components/basic/default/esm2022/video/video.props.mjs +2 -1
  63. app-ng-runtime/components/basic/default/fesm2022/index.mjs +39 -19
  64. app-ng-runtime/components/basic/default/fesm2022/index.mjs.map +1 -1
  65. app-ng-runtime/components/basic/default/icon/icon.component.d.ts +1 -0
  66. app-ng-runtime/components/basic/default/iframe/iframe.component.d.ts +1 -0
  67. app-ng-runtime/components/basic/default/picture/picture.directive.d.ts +2 -1
  68. app-ng-runtime/components/basic/default/video/video.component.d.ts +2 -0
  69. app-ng-runtime/components/basic/progress/bundles/index.umd.js +17 -9
  70. app-ng-runtime/components/basic/progress/esm2022/progress-bar/progress-bar.component.mjs +9 -5
  71. app-ng-runtime/components/basic/progress/esm2022/progress-bar/progress-bar.props.mjs +2 -1
  72. app-ng-runtime/components/basic/progress/esm2022/progress-circle/progress-circle.component.mjs +8 -6
  73. app-ng-runtime/components/basic/progress/esm2022/progress-circle/progress-circle.props.mjs +2 -1
  74. app-ng-runtime/components/basic/progress/fesm2022/index.mjs +17 -9
  75. app-ng-runtime/components/basic/progress/fesm2022/index.mjs.map +1 -1
  76. app-ng-runtime/components/basic/progress/progress-bar/progress-bar.component.d.ts +2 -0
  77. app-ng-runtime/components/basic/progress/progress-circle/progress-circle.component.d.ts +3 -1
  78. app-ng-runtime/components/basic/rich-text-editor/bundles/index.umd.js +2 -0
  79. app-ng-runtime/components/basic/rich-text-editor/esm2022/rich-text-editor.component.mjs +2 -1
  80. app-ng-runtime/components/basic/rich-text-editor/esm2022/rich-text-editor.props.mjs +2 -1
  81. app-ng-runtime/components/basic/rich-text-editor/fesm2022/index.mjs +2 -0
  82. app-ng-runtime/components/basic/rich-text-editor/fesm2022/index.mjs.map +1 -1
  83. app-ng-runtime/components/basic/search/bundles/index.umd.js +16 -9
  84. app-ng-runtime/components/basic/search/esm2022/search.component.mjs +19 -13
  85. app-ng-runtime/components/basic/search/esm2022/search.props.mjs +2 -1
  86. app-ng-runtime/components/basic/search/fesm2022/index.mjs +16 -9
  87. app-ng-runtime/components/basic/search/fesm2022/index.mjs.map +1 -1
  88. app-ng-runtime/components/basic/search/search.component.d.ts +4 -2
  89. app-ng-runtime/components/chart/bundles/index.umd.js +1 -0
  90. app-ng-runtime/components/chart/esm2022/chart.utils.mjs +2 -1
  91. app-ng-runtime/components/chart/fesm2022/index.mjs +1 -0
  92. app-ng-runtime/components/chart/fesm2022/index.mjs.map +1 -1
  93. app-ng-runtime/components/containers/accordion/accordion-pane/accordion-pane.component.d.ts +1 -0
  94. app-ng-runtime/components/containers/accordion/bundles/index.umd.js +15 -9
  95. app-ng-runtime/components/containers/accordion/esm2022/accordion-pane/accordion-pane.component.mjs +13 -10
  96. app-ng-runtime/components/containers/accordion/esm2022/accordion.directive.mjs +4 -1
  97. app-ng-runtime/components/containers/accordion/fesm2022/index.mjs +15 -9
  98. app-ng-runtime/components/containers/accordion/fesm2022/index.mjs.map +1 -1
  99. app-ng-runtime/components/containers/panel/bundles/index.umd.js +14 -14
  100. app-ng-runtime/components/containers/panel/esm2022/panel.component.mjs +15 -15
  101. app-ng-runtime/components/containers/panel/fesm2022/index.mjs +14 -14
  102. app-ng-runtime/components/containers/panel/fesm2022/index.mjs.map +1 -1
  103. app-ng-runtime/components/containers/tabs/bundles/index.umd.js +2 -2
  104. app-ng-runtime/components/containers/tabs/esm2022/tabs.component.mjs +3 -3
  105. app-ng-runtime/components/containers/tabs/fesm2022/index.mjs +2 -2
  106. app-ng-runtime/components/containers/tabs/fesm2022/index.mjs.map +1 -1
  107. app-ng-runtime/components/containers/wizard/bundles/index.umd.js +6 -6
  108. app-ng-runtime/components/containers/wizard/esm2022/wizard.component.mjs +7 -7
  109. app-ng-runtime/components/containers/wizard/fesm2022/index.mjs +6 -6
  110. app-ng-runtime/components/containers/wizard/fesm2022/index.mjs.map +1 -1
  111. app-ng-runtime/components/data/list/bundles/index.umd.js +19 -11
  112. app-ng-runtime/components/data/list/esm2022/list-item.directive.mjs +10 -1
  113. app-ng-runtime/components/data/list/esm2022/list.component.mjs +12 -12
  114. app-ng-runtime/components/data/list/fesm2022/index.mjs +20 -12
  115. app-ng-runtime/components/data/list/fesm2022/index.mjs.map +1 -1
  116. app-ng-runtime/components/data/live-table/bundles/index.umd.js +2 -2
  117. app-ng-runtime/components/data/live-table/esm2022/live-table.component.mjs +3 -3
  118. app-ng-runtime/components/data/live-table/fesm2022/index.mjs +2 -2
  119. app-ng-runtime/components/data/live-table/fesm2022/index.mjs.map +1 -1
  120. app-ng-runtime/components/data/pagination/bundles/index.umd.js +2 -0
  121. app-ng-runtime/components/data/pagination/esm2022/pagination.component.mjs +3 -1
  122. app-ng-runtime/components/data/pagination/fesm2022/index.mjs +2 -0
  123. app-ng-runtime/components/data/pagination/fesm2022/index.mjs.map +1 -1
  124. app-ng-runtime/components/data/table/bundles/index.umd.js +42 -8
  125. app-ng-runtime/components/data/table/esm2022/table-column/table-column.directive.mjs +14 -5
  126. app-ng-runtime/components/data/table/esm2022/table.component.mjs +28 -5
  127. app-ng-runtime/components/data/table/esm2022/table.props.mjs +3 -1
  128. app-ng-runtime/components/data/table/fesm2022/index.mjs +43 -9
  129. app-ng-runtime/components/data/table/fesm2022/index.mjs.map +1 -1
  130. app-ng-runtime/components/data/table/table.component.d.ts +7 -0
  131. app-ng-runtime/components/dialogs/alert-dialog/bundles/index.umd.js +6 -4
  132. app-ng-runtime/components/dialogs/alert-dialog/esm2022/alert-dialog.component.mjs +7 -5
  133. app-ng-runtime/components/dialogs/alert-dialog/fesm2022/index.mjs +6 -4
  134. app-ng-runtime/components/dialogs/alert-dialog/fesm2022/index.mjs.map +1 -1
  135. app-ng-runtime/components/dialogs/confirm-dialog/bundles/index.umd.js +8 -5
  136. app-ng-runtime/components/dialogs/confirm-dialog/esm2022/confirm-dialog.component.mjs +9 -6
  137. app-ng-runtime/components/dialogs/confirm-dialog/fesm2022/index.mjs +8 -5
  138. app-ng-runtime/components/dialogs/confirm-dialog/fesm2022/index.mjs.map +1 -1
  139. app-ng-runtime/components/dialogs/default/bundles/index.umd.js +9 -3
  140. app-ng-runtime/components/dialogs/default/dialog-header/dialog-header.component.d.ts +2 -1
  141. app-ng-runtime/components/dialogs/default/esm2022/base-dialog.mjs +2 -1
  142. app-ng-runtime/components/dialogs/default/esm2022/dialog-header/dialog-header.component.mjs +9 -4
  143. app-ng-runtime/components/dialogs/default/fesm2022/index.mjs +9 -3
  144. app-ng-runtime/components/dialogs/default/fesm2022/index.mjs.map +1 -1
  145. app-ng-runtime/components/dialogs/design-dialog/bundles/index.umd.js +4 -4
  146. app-ng-runtime/components/dialogs/design-dialog/esm2022/dialog.component.mjs +5 -5
  147. app-ng-runtime/components/dialogs/design-dialog/fesm2022/index.mjs +4 -4
  148. app-ng-runtime/components/dialogs/design-dialog/fesm2022/index.mjs.map +1 -1
  149. app-ng-runtime/components/dialogs/iframe-dialog/bundles/index.umd.js +9 -5
  150. app-ng-runtime/components/dialogs/iframe-dialog/esm2022/iframe-dialog.component.mjs +10 -6
  151. app-ng-runtime/components/dialogs/iframe-dialog/fesm2022/index.mjs +9 -5
  152. app-ng-runtime/components/dialogs/iframe-dialog/fesm2022/index.mjs.map +1 -1
  153. app-ng-runtime/components/dialogs/partial-dialog/bundles/index.umd.js +9 -5
  154. app-ng-runtime/components/dialogs/partial-dialog/esm2022/partial-dialog.component.mjs +10 -6
  155. app-ng-runtime/components/dialogs/partial-dialog/fesm2022/index.mjs +9 -5
  156. app-ng-runtime/components/dialogs/partial-dialog/fesm2022/index.mjs.map +1 -1
  157. app-ng-runtime/components/input/calendar/bundles/index.umd.js +2 -4
  158. app-ng-runtime/components/input/calendar/esm2022/calendar.component.mjs +3 -5
  159. app-ng-runtime/components/input/calendar/fesm2022/index.mjs +2 -4
  160. app-ng-runtime/components/input/calendar/fesm2022/index.mjs.map +1 -1
  161. app-ng-runtime/components/input/chips/bundles/index.umd.js +25 -7
  162. app-ng-runtime/components/input/chips/esm2022/chips.component.mjs +25 -8
  163. app-ng-runtime/components/input/chips/esm2022/chips.props.mjs +2 -1
  164. app-ng-runtime/components/input/chips/fesm2022/index.mjs +25 -7
  165. app-ng-runtime/components/input/chips/fesm2022/index.mjs.map +1 -1
  166. app-ng-runtime/components/input/color-picker/bundles/index.umd.js +5 -3
  167. app-ng-runtime/components/input/color-picker/color-picker.component.d.ts +1 -0
  168. app-ng-runtime/components/input/color-picker/esm2022/color-picker.component.mjs +6 -5
  169. app-ng-runtime/components/input/color-picker/esm2022/color-picker.props.mjs +2 -1
  170. app-ng-runtime/components/input/color-picker/fesm2022/index.mjs +5 -3
  171. app-ng-runtime/components/input/color-picker/fesm2022/index.mjs.map +1 -1
  172. app-ng-runtime/components/input/currency/bundles/index.umd.js +4 -3
  173. app-ng-runtime/components/input/currency/currency.component.d.ts +1 -0
  174. app-ng-runtime/components/input/currency/esm2022/currency.component.mjs +6 -6
  175. app-ng-runtime/components/input/currency/esm2022/currency.props.mjs +2 -1
  176. app-ng-runtime/components/input/currency/fesm2022/index.mjs +4 -3
  177. app-ng-runtime/components/input/currency/fesm2022/index.mjs.map +1 -1
  178. app-ng-runtime/components/input/default/bundles/index.umd.js +171 -94
  179. app-ng-runtime/components/input/default/button/button.component.d.ts +1 -0
  180. app-ng-runtime/components/input/default/checkbox/checkbox.component.d.ts +1 -0
  181. app-ng-runtime/components/input/default/esm2022/base-form.component.mjs +3 -3
  182. app-ng-runtime/components/input/default/esm2022/button/button.component.mjs +1 -1
  183. app-ng-runtime/components/input/default/esm2022/button/button.props.mjs +2 -1
  184. app-ng-runtime/components/input/default/esm2022/caption-position.directive.mjs +8 -7
  185. app-ng-runtime/components/input/default/esm2022/checkbox/checkbox.component.mjs +7 -7
  186. app-ng-runtime/components/input/default/esm2022/checkbox/checkbox.props.mjs +2 -1
  187. app-ng-runtime/components/input/default/esm2022/checkboxset/checkboxset.component.mjs +21 -16
  188. app-ng-runtime/components/input/default/esm2022/number/number.component.mjs +5 -5
  189. app-ng-runtime/components/input/default/esm2022/number/number.props.mjs +3 -1
  190. app-ng-runtime/components/input/default/esm2022/radioset/radioset.component.mjs +28 -23
  191. app-ng-runtime/components/input/default/esm2022/select/select.component.mjs +7 -7
  192. app-ng-runtime/components/input/default/esm2022/select/select.props.mjs +2 -1
  193. app-ng-runtime/components/input/default/esm2022/switch/switch.component.mjs +6 -5
  194. app-ng-runtime/components/input/default/esm2022/switch/switch.props.mjs +2 -1
  195. app-ng-runtime/components/input/default/esm2022/text/calendar/input-calendar.component.mjs +5 -5
  196. app-ng-runtime/components/input/default/esm2022/text/calendar/input-calendar.props.mjs +2 -1
  197. app-ng-runtime/components/input/default/esm2022/text/color/input-color.component.mjs +5 -5
  198. app-ng-runtime/components/input/default/esm2022/text/color/input-color.props.mjs +2 -1
  199. app-ng-runtime/components/input/default/esm2022/text/email/input-email.component.mjs +5 -5
  200. app-ng-runtime/components/input/default/esm2022/text/email/input-email.props.mjs +2 -1
  201. app-ng-runtime/components/input/default/esm2022/text/locale/number-locale.mjs +66 -13
  202. app-ng-runtime/components/input/default/esm2022/text/number/input-number.component.mjs +5 -5
  203. app-ng-runtime/components/input/default/esm2022/text/number/input-number.props.mjs +2 -1
  204. app-ng-runtime/components/input/default/esm2022/text/text/input-text.component.mjs +5 -5
  205. app-ng-runtime/components/input/default/esm2022/text/text/input-text.props.mjs +2 -1
  206. app-ng-runtime/components/input/default/esm2022/textarea/textarea.component.mjs +6 -6
  207. app-ng-runtime/components/input/default/esm2022/textarea/textarea.props.mjs +2 -1
  208. app-ng-runtime/components/input/default/fesm2022/index.mjs +171 -94
  209. app-ng-runtime/components/input/default/fesm2022/index.mjs.map +1 -1
  210. app-ng-runtime/components/input/default/number/number.component.d.ts +1 -0
  211. app-ng-runtime/components/input/default/select/select.component.d.ts +2 -0
  212. app-ng-runtime/components/input/default/text/calendar/input-calendar.component.d.ts +1 -0
  213. app-ng-runtime/components/input/default/text/color/input-color.component.d.ts +1 -0
  214. app-ng-runtime/components/input/default/text/email/input-email.component.d.ts +1 -0
  215. app-ng-runtime/components/input/default/text/locale/number-locale.d.ts +1 -0
  216. app-ng-runtime/components/input/default/text/number/input-number.component.d.ts +1 -0
  217. app-ng-runtime/components/input/default/text/text/input-text.component.d.ts +1 -0
  218. app-ng-runtime/components/input/default/textarea/textarea.component.d.ts +1 -0
  219. app-ng-runtime/components/input/epoch/base-date-time.component.d.ts +2 -1
  220. app-ng-runtime/components/input/epoch/bundles/index.umd.js +28 -21
  221. app-ng-runtime/components/input/epoch/date/date.component.d.ts +1 -0
  222. app-ng-runtime/components/input/epoch/date-time/date-time.component.d.ts +2 -1
  223. app-ng-runtime/components/input/epoch/esm2022/base-date-time.component.mjs +10 -6
  224. app-ng-runtime/components/input/epoch/esm2022/date/date.component.mjs +8 -8
  225. app-ng-runtime/components/input/epoch/esm2022/date/date.props.mjs +2 -1
  226. app-ng-runtime/components/input/epoch/esm2022/date-time/date-time.component.mjs +9 -9
  227. app-ng-runtime/components/input/epoch/esm2022/date-time/date-time.props.mjs +2 -1
  228. app-ng-runtime/components/input/epoch/esm2022/time/time.component.mjs +7 -7
  229. app-ng-runtime/components/input/epoch/esm2022/time/time.props.mjs +2 -1
  230. app-ng-runtime/components/input/epoch/fesm2022/index.mjs +25 -18
  231. app-ng-runtime/components/input/epoch/fesm2022/index.mjs.map +1 -1
  232. app-ng-runtime/components/input/epoch/time/time.component.d.ts +1 -0
  233. app-ng-runtime/components/input/file-upload/bundles/index.umd.js +224 -121
  234. app-ng-runtime/components/input/file-upload/esm2022/file-upload.component.mjs +220 -123
  235. app-ng-runtime/components/input/file-upload/esm2022/file-upload.props.mjs +7 -1
  236. app-ng-runtime/components/input/file-upload/fesm2022/index.mjs +225 -122
  237. app-ng-runtime/components/input/file-upload/fesm2022/index.mjs.map +1 -1
  238. app-ng-runtime/components/input/file-upload/file-upload.component.d.ts +18 -11
  239. app-ng-runtime/components/input/rating/bundles/index.umd.js +2 -2
  240. app-ng-runtime/components/input/rating/esm2022/rating.component.mjs +3 -3
  241. app-ng-runtime/components/input/rating/fesm2022/index.mjs +2 -2
  242. app-ng-runtime/components/input/rating/fesm2022/index.mjs.map +1 -1
  243. app-ng-runtime/components/input/slider/bundles/index.umd.js +5 -6
  244. app-ng-runtime/components/input/slider/esm2022/slider.component.mjs +6 -8
  245. app-ng-runtime/components/input/slider/esm2022/slider.props.mjs +2 -1
  246. app-ng-runtime/components/input/slider/fesm2022/index.mjs +5 -6
  247. app-ng-runtime/components/input/slider/fesm2022/index.mjs.map +1 -1
  248. app-ng-runtime/components/input/slider/slider.component.d.ts +1 -0
  249. app-ng-runtime/components/navigation/breadcrumb/bundles/index.umd.js +6 -6
  250. app-ng-runtime/components/navigation/breadcrumb/esm2022/breadcrumb.component.mjs +7 -7
  251. app-ng-runtime/components/navigation/breadcrumb/fesm2022/index.mjs +6 -6
  252. app-ng-runtime/components/navigation/breadcrumb/fesm2022/index.mjs.map +1 -1
  253. app-ng-runtime/components/navigation/menu/bundles/index.umd.js +8 -6
  254. app-ng-runtime/components/navigation/menu/esm2022/menu.component.mjs +8 -7
  255. app-ng-runtime/components/navigation/menu/esm2022/menu.props.mjs +2 -1
  256. app-ng-runtime/components/navigation/menu/fesm2022/index.mjs +8 -6
  257. app-ng-runtime/components/navigation/menu/fesm2022/index.mjs.map +1 -1
  258. app-ng-runtime/components/navigation/menu/menu.component.d.ts +1 -0
  259. app-ng-runtime/components/navigation/popover/bundles/index.umd.js +121 -13
  260. app-ng-runtime/components/navigation/popover/esm2022/popover.component.mjs +122 -15
  261. app-ng-runtime/components/navigation/popover/esm2022/popover.props.mjs +2 -1
  262. app-ng-runtime/components/navigation/popover/fesm2022/index.mjs +121 -13
  263. app-ng-runtime/components/navigation/popover/fesm2022/index.mjs.map +1 -1
  264. app-ng-runtime/components/navigation/popover/popover.component.d.ts +15 -3
  265. app-ng-runtime/components/page/default/bundles/index.umd.js +2 -1
  266. app-ng-runtime/components/page/default/esm2022/page.props.mjs +4 -3
  267. app-ng-runtime/components/page/default/fesm2022/index.mjs +2 -1
  268. app-ng-runtime/components/page/default/fesm2022/index.mjs.map +1 -1
  269. app-ng-runtime/components/page/footer/bundles/index.umd.js +2 -1
  270. app-ng-runtime/components/page/footer/esm2022/footer.props.mjs +3 -2
  271. app-ng-runtime/components/page/footer/fesm2022/index.mjs +2 -1
  272. app-ng-runtime/components/page/footer/fesm2022/index.mjs.map +1 -1
  273. app-ng-runtime/components/page/header/bundles/index.umd.js +2 -1
  274. app-ng-runtime/components/page/header/esm2022/header.props.mjs +3 -2
  275. app-ng-runtime/components/page/header/fesm2022/index.mjs +2 -1
  276. app-ng-runtime/components/page/header/fesm2022/index.mjs.map +1 -1
  277. app-ng-runtime/components/page/left-panel/bundles/index.umd.js +2 -1
  278. app-ng-runtime/components/page/left-panel/esm2022/left-panel.props.mjs +3 -2
  279. app-ng-runtime/components/page/left-panel/fesm2022/index.mjs +2 -1
  280. app-ng-runtime/components/page/left-panel/fesm2022/index.mjs.map +1 -1
  281. app-ng-runtime/components/page/right-panel/bundles/index.umd.js +2 -1
  282. app-ng-runtime/components/page/right-panel/esm2022/right-panel.props.mjs +3 -2
  283. app-ng-runtime/components/page/right-panel/fesm2022/index.mjs +2 -1
  284. app-ng-runtime/components/page/right-panel/fesm2022/index.mjs.map +1 -1
  285. app-ng-runtime/components/page/top-nav/bundles/index.umd.js +2 -1
  286. app-ng-runtime/components/page/top-nav/esm2022/top-nav.props.mjs +3 -2
  287. app-ng-runtime/components/page/top-nav/fesm2022/index.mjs +2 -1
  288. app-ng-runtime/components/page/top-nav/fesm2022/index.mjs.map +1 -1
  289. app-ng-runtime/core/bundles/index.umd.js +15 -13
  290. app-ng-runtime/core/esm2022/public_api.mjs +2 -2
  291. app-ng-runtime/core/esm2022/utils/build-utils.mjs +7 -7
  292. app-ng-runtime/core/esm2022/utils/utils.mjs +4 -5
  293. app-ng-runtime/core/fesm2022/index.mjs +11 -11
  294. app-ng-runtime/core/fesm2022/index.mjs.map +1 -1
  295. app-ng-runtime/core/public_api.d.ts +1 -1
  296. app-ng-runtime/core/utils/utils.d.ts +1 -1
  297. app-ng-runtime/mobile/components/device/barcode-scanner/bundles/index.umd.js +2 -1
  298. app-ng-runtime/mobile/components/device/barcode-scanner/esm2022/barcode-scanner.props.mjs +3 -2
  299. app-ng-runtime/mobile/components/device/barcode-scanner/fesm2022/index.mjs +2 -1
  300. app-ng-runtime/mobile/components/device/barcode-scanner/fesm2022/index.mjs.map +1 -1
  301. app-ng-runtime/mobile/components/device/camera/bundles/index.umd.js +2 -1
  302. app-ng-runtime/mobile/components/device/camera/esm2022/camera.props.mjs +3 -2
  303. app-ng-runtime/mobile/components/device/camera/fesm2022/index.mjs +2 -1
  304. app-ng-runtime/mobile/components/device/camera/fesm2022/index.mjs.map +1 -1
  305. app-ng-runtime/package.json +1 -1
  306. app-ng-runtime/runtime/base/bundles/index.umd.js +6 -4
  307. app-ng-runtime/runtime/base/components/app-component/app.component.d.ts +2 -3
  308. app-ng-runtime/runtime/base/esm2022/components/app-component/app.component.mjs +5 -5
  309. app-ng-runtime/runtime/base/esm2022/guards/can-deactivate-page.guard.mjs +5 -4
  310. app-ng-runtime/runtime/base/fesm2022/index.mjs +6 -4
  311. app-ng-runtime/runtime/base/fesm2022/index.mjs.map +1 -1
  312. app-ng-runtime/runtime/base/guards/can-deactivate-page.guard.d.ts +2 -1
  313. app-ng-runtime/scripts/datatable/datatable.js +32 -31
  314. app-ng-runtime/variables/bundles/index.umd.js +34 -16
  315. app-ng-runtime/variables/esm2022/manager/variable/web-socket-variable.manager.mjs +35 -17
  316. app-ng-runtime/variables/fesm2022/index.mjs +34 -16
  317. app-ng-runtime/variables/fesm2022/index.mjs.map +1 -1
  318. app-ng-runtime/variables/manager/variable/web-socket-variable.manager.d.ts +0 -4
@@ -1,10 +1,11 @@
1
1
  import { Observable } from 'rxjs';
2
+ import { ActivatedRouteSnapshot, RouterStateSnapshot } from '@angular/router';
2
3
  import * as i0 from "@angular/core";
3
4
  export interface CanComponentDeactivate {
4
5
  canDeactivate: () => Observable<boolean> | Promise<boolean> | boolean;
5
6
  }
6
7
  export declare class CanDeactivatePageGuard {
7
- canDeactivate(component: CanComponentDeactivate): any;
8
+ canDeactivate(component: CanComponentDeactivate, currentRoute: ActivatedRouteSnapshot, currentState: RouterStateSnapshot, nextState?: RouterStateSnapshot): any;
8
9
  static ɵfac: i0.ɵɵFactoryDeclaration<CanDeactivatePageGuard, never>;
9
10
  static ɵprov: i0.ɵɵInjectableDeclaration<CanDeactivatePageGuard>;
10
11
  }
@@ -21,6 +21,7 @@ $.widget('wm.datatable', {
21
21
  filtermode: '',
22
22
  filteronkeypress: false,
23
23
  activeRow: undefined,
24
+ isrowselectable: false,
24
25
  height: '100%',
25
26
  showHeader: true,
26
27
  selectFirstRow: false,
@@ -319,7 +320,10 @@ $.widget('wm.datatable', {
319
320
  $th.attr({
320
321
  'data-col-id': id,
321
322
  'data-col-field': field,
322
- 'title': titleLabel
323
+ 'title': titleLabel,
324
+ 'tabindex': 0,
325
+ 'scope': 'col',
326
+ 'role':'columnheader'
323
327
  });
324
328
  self._setStyles($th, 'text-align: ' + value.textAlignment)
325
329
  $th.addClass(headerClasses);
@@ -358,7 +362,8 @@ $.widget('wm.datatable', {
358
362
  $groupTl.attr({
359
363
  'data-col-group': col.field,
360
364
  'class': classes,
361
- 'title': col.displayName
365
+ 'title': col.displayName,
366
+ 'tabindex': 0
362
367
  });
363
368
  self._setStyles($groupTl, styles);
364
369
  $groupTl.append('<span class="header-data">' + col.displayName + '</span>');
@@ -661,7 +666,7 @@ $.widget('wm.datatable', {
661
666
  colExpression = colDef.customExpression,
662
667
  styles = "text-align: " + colDef.textAlignment + ";position: relative;"
663
668
 
664
- $htm = $('<td class="' + classes + '" data-col-id="' + colId + '" role="cell"></td>');
669
+ $htm = $('<td class="' + classes + '" data-col-id="' + colId + '" role="cell" tabindex="0"></td>');
665
670
  this._setStyles($htm, styles);
666
671
 
667
672
  columnValue = _.get(row, colDef.field);
@@ -1501,6 +1506,7 @@ $.widget('wm.datatable', {
1501
1506
  }
1502
1507
  case 'multiselect': // Fallthrough
1503
1508
  case 'showRadioColumn':
1509
+ case 'isrowselectable' :
1504
1510
  case 'rowActions':
1505
1511
  case 'filterNullRecords':
1506
1512
  case 'showRowIndex':
@@ -1664,8 +1670,16 @@ $.widget('wm.datatable', {
1664
1670
  // triggered on capture phase of click listener.
1665
1671
  // sets the selected rowdata on click.
1666
1672
  rowClickHandlerOnCapture: function (e, $row, options) {
1667
- if(this.getColInfo(e) && (e.target.type != 'checkbox' && e.target.type != 'radio')) {
1668
- return;
1673
+ // If 'isrowselectable' property is enabled, clicking anywhere on the row will trigger its selection. Otherwise, the row will not be selected on click.
1674
+ // Also this flag works if mutliselect or radioselect is enabled.
1675
+ // In quick edit mode, clicking any part of the row switches it to edit mode, regardless of the flag setting.
1676
+ if (this.options.editmode !== this.CONSTANTS.QUICK_EDIT) {
1677
+ if ((this.options.multiselect || this.options.showRadioColumn) && !this.options.isrowselectable) {
1678
+ if (Number(this.getColInfo(e))) {
1679
+ e.stopPropagation();
1680
+ return;
1681
+ }
1682
+ }
1669
1683
  }
1670
1684
  $row = $row || $(e.target).closest('tr.app-datagrid-row');
1671
1685
  var gridRow = this.gridElement.find($row);
@@ -1680,8 +1694,16 @@ $.widget('wm.datatable', {
1680
1694
 
1681
1695
  /* Handles row selection. */
1682
1696
  rowSelectionHandler: function (e, $row, options) {
1683
- if(this.getColInfo(e) && (e.target.type != 'checkbox' && e.target.type != 'radio')) {
1684
- return;
1697
+ // If 'isrowselectable' property is enabled, clicking anywhere on the row will trigger its selection. Otherwise, the row will not be selected on click.
1698
+ // Also this flag works if mutliselect or radioselect is enabled.
1699
+ // In quick edit mode, clicking any part of the row switches it to edit mode, regardless of the flag setting.
1700
+ if (this.options.editmode !== this.CONSTANTS.QUICK_EDIT) {
1701
+ if ((this.options.multiselect || this.options.showRadioColumn) && !this.options.isrowselectable) {
1702
+ if (Number(this.getColInfo(e))) {
1703
+ e.stopPropagation();
1704
+ return;
1705
+ }
1706
+ }
1685
1707
  }
1686
1708
  options = options || {};
1687
1709
  var rowId,
@@ -2694,14 +2716,9 @@ $.widget('wm.datatable', {
2694
2716
  return false;
2695
2717
  },
2696
2718
  getColInfo: function(event) {
2697
- var row = $(event.target).closest('tr.app-datagrid-row');
2698
- var rowId = row.attr('data-row-id');
2699
2719
  var column = $(event.target).closest('td.app-datagrid-cell');
2700
2720
  var colId = column.attr('data-col-id');
2701
- if(this.columnClickInfo && this.columnClickInfo[rowId] && this.columnClickInfo[rowId][colId]) {
2702
- return this.columnClickInfo[rowId][colId];
2703
- }
2704
- return false;
2721
+ return colId;
2705
2722
  },
2706
2723
  /* Attaches all event handlers for the table. */
2707
2724
  attachEventHandlers: function ($htm) {
@@ -2715,22 +2732,6 @@ $.widget('wm.datatable', {
2715
2732
  // add js click handler for capture phase in order to first listen on grid and
2716
2733
  // assign selectedItems so that any child actions can have access to the selectedItems.
2717
2734
  $htm.on('click', this.rowSelectionHandler.bind(this));
2718
- $htm.on("click", "td *", function(event) {
2719
-
2720
- // Prevent propagation to parent elements
2721
- if(event.target.type != 'checkbox'){
2722
- var row = $(event.target).closest('tr.app-datagrid-row');
2723
- var rowId = row.attr('data-row-id');
2724
- var column = $(event.target).closest('td.app-datagrid-cell');
2725
- var colId = column.attr('data-col-id');
2726
- var id = Number(colId);
2727
- var colDefination = self.preparedHeaderData[id];
2728
- if (colDefination && colDefination.readonly && colDefination.field !== 'rowOperations') {
2729
- self.columnClickInfo[rowId] = {};
2730
- self.columnClickInfo[rowId][colId] = true;
2731
- }
2732
- }
2733
- });
2734
2735
  $htm.on('dblclick', this.rowDblClickHandler.bind(this));
2735
2736
  $htm.on('keydown', this.onKeyDown.bind(this));
2736
2737
  }
@@ -3244,8 +3245,8 @@ $.widget('wm.datatable', {
3244
3245
  '<div class="app-grid-header">' +
3245
3246
  '<div class="app-grid-header-inner">' +
3246
3247
  '<table tabindex="0" class="' + this.options.cssClassNames.gridDefault + ' ' + this.options.cssClassNames.grid + '">' +
3247
- '<thead tabindex="0" class="table-header thead-sticky" id="table_header_' + this.tableId + '">' +
3248
- '</thead><tbody class="app-grid-content app-datagrid-body" id="table_' + this.tableId + '">' +
3248
+ '<thead class="table-header thead-sticky" id="table_header_' + this.tableId + '" role="rowgroup">' +
3249
+ '</thead><tbody class="app-grid-content app-datagrid-body" id="table_' + this.tableId + '" role="rowgroup">' +
3249
3250
  '</tbody></table>' +
3250
3251
  '</div></div></div>',
3251
3252
  $statusContainer = $(statusContainer),
@@ -2449,9 +2449,10 @@
2449
2449
  */
2450
2450
  getURL(variable) {
2451
2451
  const prefabName = variable.getPrefabName();
2452
- const opInfo = prefabName ? lodashEs.get(exports.metadataService.getByOperationId(variable.operationId, prefabName), 'wmServiceOperationInfo') : lodashEs.get(exports.metadataService.getByOperationId(variable.operationId), 'wmServiceOperationInfo');
2452
+ const opInfo = prefabName ?
2453
+ lodashEs.get(exports.metadataService.getByOperationId(variable.operationId, prefabName), 'wmServiceOperationInfo') :
2454
+ lodashEs.get(exports.metadataService.getByOperationId(variable.operationId), 'wmServiceOperationInfo');
2453
2455
  const inputFields = variable.dataBinding;
2454
- let config;
2455
2456
  // add sample values to the params (url and path)
2456
2457
  lodashEs.forEach(opInfo.parameters, function (param) {
2457
2458
  param.sampleValue = inputFields[param.name];
@@ -2461,7 +2462,7 @@
2461
2462
  skipCloakHeaders: true
2462
2463
  });
2463
2464
  // call common method to prepare config for the service operation info.
2464
- config = ServiceVariableUtils.constructRequestParams(variable, opInfo, inputFields);
2465
+ const config = ServiceVariableUtils.constructRequestParams(variable, opInfo, inputFields);
2465
2466
  /* if error found, return */
2466
2467
  if (config.error && config.error.message) {
2467
2468
  this._onSocketError(variable, { data: config.error.message });
@@ -2479,10 +2480,10 @@
2479
2480
  * @private
2480
2481
  */
2481
2482
  _onSocketMessage(variable, evt) {
2482
- let data = lodashEs.get(evt, 'data'), value, dataLength, dataLimit, shouldAddToLast, insertIdx;
2483
+ let data = lodashEs.get(evt, 'data'), dataLength, dataLimit, shouldAddToLast, insertIdx;
2483
2484
  data = i1.getValidJSON(data) || i1.xmlToJson(data) || data;
2484
2485
  // EVENT: ON_MESSAGE
2485
- value = initiateCallback(VARIABLE_CONSTANTS.EVENT.MESSAGE_RECEIVE, variable, data, evt);
2486
+ const value = initiateCallback(VARIABLE_CONSTANTS.EVENT.MESSAGE_RECEIVE, variable, data, evt);
2486
2487
  data = i1.isDefined(value) ? value : data;
2487
2488
  if (this.shouldAppendData(variable)) {
2488
2489
  variable.dataSet = variable.dataSet || [];
@@ -2549,11 +2550,16 @@
2549
2550
  variable._socketConnected = true;
2550
2551
  // EVENT: ON_OPEN
2551
2552
  initiateCallback(VARIABLE_CONSTANTS.EVENT.OPEN, variable, lodashEs.get(evt, 'data'), evt);
2553
+ // Send initial request body if it exists and connectOnPageLoad is true
2554
+ if (variable.startUpdate) {
2555
+ const requestBody = lodashEs.get(variable, 'dataBinding.RequestBody');
2556
+ if (requestBody) {
2557
+ setTimeout(() => {
2558
+ this.send(variable, requestBody);
2559
+ }, 0); // Using setTimeout to ensure connection is fully established
2560
+ }
2561
+ }
2552
2562
  }
2553
- /**
2554
- * clears the socket variable against the variable in a scope
2555
- * @param variable
2556
- */
2557
2563
  freeSocket(variable) {
2558
2564
  this.scope_var_socket_map.set(variable, undefined);
2559
2565
  }
@@ -2595,7 +2601,6 @@
2595
2601
  if (_socket) {
2596
2602
  return _socket;
2597
2603
  }
2598
- // Trigger error if unsecured webSocket is used in secured domain, ignore in mobile device
2599
2604
  if (!CONSTANTS.hasCordova && i1.isInsecureContentRequest(url)) {
2600
2605
  i1.triggerFn(this._onSocketError.bind(this, variable));
2601
2606
  return;
@@ -2616,12 +2621,11 @@
2616
2621
  */
2617
2622
  open(variable, success, error) {
2618
2623
  const shouldOpen = this._onBeforeSocketOpen(variable);
2619
- let socket;
2620
2624
  if (shouldOpen === false) {
2621
2625
  i1.triggerFn(error);
2622
2626
  return;
2623
2627
  }
2624
- socket = this.getSocket(variable);
2628
+ const socket = this.getSocket(variable);
2625
2629
  i1.triggerFn(success);
2626
2630
  return socket;
2627
2631
  }
@@ -2629,7 +2633,8 @@
2629
2633
  * closes an existing socket connection on variable
2630
2634
  */
2631
2635
  close(variable) {
2632
- const shouldClose = this._onBeforeSocketClose(variable), socket = this.getSocket(variable);
2636
+ const shouldClose = this._onBeforeSocketClose(variable);
2637
+ const socket = this.getSocket(variable);
2633
2638
  if (shouldClose === false) {
2634
2639
  return;
2635
2640
  }
@@ -2643,15 +2648,28 @@
2643
2648
  */
2644
2649
  send(variable, message) {
2645
2650
  const socket = this.getSocket(variable);
2646
- let response;
2651
+ if (!socket) {
2652
+ console.error('WebSocket connection not established');
2653
+ return;
2654
+ }
2647
2655
  message = message || lodashEs.get(variable, 'dataBinding.RequestBody');
2648
- response = this._onBeforeSend(variable, message);
2656
+ if (!message) {
2657
+ console.warn('No message to send');
2658
+ return;
2659
+ }
2660
+ const response = this._onBeforeSend(variable, message);
2649
2661
  if (response === false) {
2650
2662
  return;
2651
2663
  }
2652
2664
  message = i1.isDefined(response) ? response : message;
2653
2665
  message = i1.isObject(message) ? JSON.stringify(message) : message;
2654
- socket.send(message, 0);
2666
+ try {
2667
+ socket.send(message, 0);
2668
+ }
2669
+ catch (error) {
2670
+ console.error('Error sending message:', error);
2671
+ this._onSocketError(variable, { data: error.message });
2672
+ }
2655
2673
  }
2656
2674
  }
2657
2675
 
@@ -53,9 +53,10 @@ export class WebSocketVariableManager extends BaseVariableManager {
53
53
  */
54
54
  getURL(variable) {
55
55
  const prefabName = variable.getPrefabName();
56
- const opInfo = prefabName ? get(metadataService.getByOperationId(variable.operationId, prefabName), 'wmServiceOperationInfo') : get(metadataService.getByOperationId(variable.operationId), 'wmServiceOperationInfo');
56
+ const opInfo = prefabName ?
57
+ get(metadataService.getByOperationId(variable.operationId, prefabName), 'wmServiceOperationInfo') :
58
+ get(metadataService.getByOperationId(variable.operationId), 'wmServiceOperationInfo');
57
59
  const inputFields = variable.dataBinding;
58
- let config;
59
60
  // add sample values to the params (url and path)
60
61
  forEach(opInfo.parameters, function (param) {
61
62
  param.sampleValue = inputFields[param.name];
@@ -65,7 +66,7 @@ export class WebSocketVariableManager extends BaseVariableManager {
65
66
  skipCloakHeaders: true
66
67
  });
67
68
  // call common method to prepare config for the service operation info.
68
- config = ServiceVariableUtils.constructRequestParams(variable, opInfo, inputFields);
69
+ const config = ServiceVariableUtils.constructRequestParams(variable, opInfo, inputFields);
69
70
  /* if error found, return */
70
71
  if (config.error && config.error.message) {
71
72
  this._onSocketError(variable, { data: config.error.message });
@@ -83,10 +84,10 @@ export class WebSocketVariableManager extends BaseVariableManager {
83
84
  * @private
84
85
  */
85
86
  _onSocketMessage(variable, evt) {
86
- let data = get(evt, 'data'), value, dataLength, dataLimit, shouldAddToLast, insertIdx;
87
+ let data = get(evt, 'data'), dataLength, dataLimit, shouldAddToLast, insertIdx;
87
88
  data = getValidJSON(data) || xmlToJson(data) || data;
88
89
  // EVENT: ON_MESSAGE
89
- value = initiateCallback(VARIABLE_CONSTANTS.EVENT.MESSAGE_RECEIVE, variable, data, evt);
90
+ const value = initiateCallback(VARIABLE_CONSTANTS.EVENT.MESSAGE_RECEIVE, variable, data, evt);
90
91
  data = isDefined(value) ? value : data;
91
92
  if (this.shouldAppendData(variable)) {
92
93
  variable.dataSet = variable.dataSet || [];
@@ -153,11 +154,16 @@ export class WebSocketVariableManager extends BaseVariableManager {
153
154
  variable._socketConnected = true;
154
155
  // EVENT: ON_OPEN
155
156
  initiateCallback(VARIABLE_CONSTANTS.EVENT.OPEN, variable, get(evt, 'data'), evt);
157
+ // Send initial request body if it exists and connectOnPageLoad is true
158
+ if (variable.startUpdate) {
159
+ const requestBody = get(variable, 'dataBinding.RequestBody');
160
+ if (requestBody) {
161
+ setTimeout(() => {
162
+ this.send(variable, requestBody);
163
+ }, 0); // Using setTimeout to ensure connection is fully established
164
+ }
165
+ }
156
166
  }
157
- /**
158
- * clears the socket variable against the variable in a scope
159
- * @param variable
160
- */
161
167
  freeSocket(variable) {
162
168
  this.scope_var_socket_map.set(variable, undefined);
163
169
  }
@@ -199,7 +205,6 @@ export class WebSocketVariableManager extends BaseVariableManager {
199
205
  if (_socket) {
200
206
  return _socket;
201
207
  }
202
- // Trigger error if unsecured webSocket is used in secured domain, ignore in mobile device
203
208
  if (!CONSTANTS.hasCordova && isInsecureContentRequest(url)) {
204
209
  triggerFn(this._onSocketError.bind(this, variable));
205
210
  return;
@@ -220,12 +225,11 @@ export class WebSocketVariableManager extends BaseVariableManager {
220
225
  */
221
226
  open(variable, success, error) {
222
227
  const shouldOpen = this._onBeforeSocketOpen(variable);
223
- let socket;
224
228
  if (shouldOpen === false) {
225
229
  triggerFn(error);
226
230
  return;
227
231
  }
228
- socket = this.getSocket(variable);
232
+ const socket = this.getSocket(variable);
229
233
  triggerFn(success);
230
234
  return socket;
231
235
  }
@@ -233,7 +237,8 @@ export class WebSocketVariableManager extends BaseVariableManager {
233
237
  * closes an existing socket connection on variable
234
238
  */
235
239
  close(variable) {
236
- const shouldClose = this._onBeforeSocketClose(variable), socket = this.getSocket(variable);
240
+ const shouldClose = this._onBeforeSocketClose(variable);
241
+ const socket = this.getSocket(variable);
237
242
  if (shouldClose === false) {
238
243
  return;
239
244
  }
@@ -247,15 +252,28 @@ export class WebSocketVariableManager extends BaseVariableManager {
247
252
  */
248
253
  send(variable, message) {
249
254
  const socket = this.getSocket(variable);
250
- let response;
255
+ if (!socket) {
256
+ console.error('WebSocket connection not established');
257
+ return;
258
+ }
251
259
  message = message || get(variable, 'dataBinding.RequestBody');
252
- response = this._onBeforeSend(variable, message);
260
+ if (!message) {
261
+ console.warn('No message to send');
262
+ return;
263
+ }
264
+ const response = this._onBeforeSend(variable, message);
253
265
  if (response === false) {
254
266
  return;
255
267
  }
256
268
  message = isDefined(response) ? response : message;
257
269
  message = isObject(message) ? JSON.stringify(message) : message;
258
- socket.send(message, 0);
270
+ try {
271
+ socket.send(message, 0);
272
+ }
273
+ catch (error) {
274
+ console.error('Error sending message:', error);
275
+ this._onSocketError(variable, { data: error.message });
276
+ }
259
277
  }
260
278
  }
261
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoid2ViLXNvY2tldC12YXJpYWJsZS5tYW5hZ2VyLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvdmFyaWFibGVzL3NyYy9tYW5hZ2VyL3ZhcmlhYmxlL3dlYi1zb2NrZXQtdmFyaWFibGUubWFuYWdlci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsVUFBVSxFQUFFLE1BQU0sdUNBQXVDLENBQUM7QUFFbkUsT0FBTyxFQUFFLFlBQVksRUFBRSxTQUFTLEVBQUUsd0JBQXdCLEVBQUUsUUFBUSxFQUFFLFNBQVMsRUFBRSxTQUFTLEVBQUUsTUFBTSxVQUFVLENBQUM7QUFFN0csT0FBTy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bnNlID09PSBmYWxzZSkge1xuICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICB9XG4gICAgICAgIG1lc3NhZ2UgPSBpc0RlZmluZWQocmVzcG9uc2UpID8gcmVzcG9uc2UgOiBtZXNzYWdlO1xuICAgICAgICBtZXNzYWdlID0gaXNPYmplY3QobWVzc2FnZSkgPyBKU09OLnN0cmluZ2lmeShtZXNzYWdlKSA6IG1lc3NhZ2U7XG4gICAgICAgIFxuICAgICAgICB0cnkge1xuICAgICAgICAgICAgc29ja2V0LnNlbmQobWVzc2FnZSwgMCk7XG4gICAgICAgIH0gY2F0Y2ggKGVycm9yKSB7XG4gICAgICAgICAgICBjb25zb2xlLmVycm9yKCdFcnJvciBzZW5kaW5nIG1lc3NhZ2U6JywgZXJyb3IpO1xuICAgICAgICAgICAgdGhpcy5fb25Tb2NrZXRFcnJvcih2YXJpYWJsZSwgeyBkYXRhOiBlcnJvci5tZXNzYWdlIH0pO1xuICAgICAgICB9XG4gICAgfVxufSJdfQ==
@@ -2532,9 +2532,10 @@ class WebSocketVariableManager extends BaseVariableManager {
2532
2532
  */
2533
2533
  getURL(variable) {
2534
2534
  const prefabName = variable.getPrefabName();
2535
- const opInfo = prefabName ? get(metadataService.getByOperationId(variable.operationId, prefabName), 'wmServiceOperationInfo') : get(metadataService.getByOperationId(variable.operationId), 'wmServiceOperationInfo');
2535
+ const opInfo = prefabName ?
2536
+ get(metadataService.getByOperationId(variable.operationId, prefabName), 'wmServiceOperationInfo') :
2537
+ get(metadataService.getByOperationId(variable.operationId), 'wmServiceOperationInfo');
2536
2538
  const inputFields = variable.dataBinding;
2537
- let config;
2538
2539
  // add sample values to the params (url and path)
2539
2540
  forEach(opInfo.parameters, function (param) {
2540
2541
  param.sampleValue = inputFields[param.name];
@@ -2544,7 +2545,7 @@ class WebSocketVariableManager extends BaseVariableManager {
2544
2545
  skipCloakHeaders: true
2545
2546
  });
2546
2547
  // call common method to prepare config for the service operation info.
2547
- config = ServiceVariableUtils.constructRequestParams(variable, opInfo, inputFields);
2548
+ const config = ServiceVariableUtils.constructRequestParams(variable, opInfo, inputFields);
2548
2549
  /* if error found, return */
2549
2550
  if (config.error && config.error.message) {
2550
2551
  this._onSocketError(variable, { data: config.error.message });
@@ -2562,10 +2563,10 @@ class WebSocketVariableManager extends BaseVariableManager {
2562
2563
  * @private
2563
2564
  */
2564
2565
  _onSocketMessage(variable, evt) {
2565
- let data = get(evt, 'data'), value, dataLength, dataLimit, shouldAddToLast, insertIdx;
2566
+ let data = get(evt, 'data'), dataLength, dataLimit, shouldAddToLast, insertIdx;
2566
2567
  data = getValidJSON(data) || xmlToJson(data) || data;
2567
2568
  // EVENT: ON_MESSAGE
2568
- value = initiateCallback(VARIABLE_CONSTANTS.EVENT.MESSAGE_RECEIVE, variable, data, evt);
2569
+ const value = initiateCallback(VARIABLE_CONSTANTS.EVENT.MESSAGE_RECEIVE, variable, data, evt);
2569
2570
  data = isDefined(value) ? value : data;
2570
2571
  if (this.shouldAppendData(variable)) {
2571
2572
  variable.dataSet = variable.dataSet || [];
@@ -2632,11 +2633,16 @@ class WebSocketVariableManager extends BaseVariableManager {
2632
2633
  variable._socketConnected = true;
2633
2634
  // EVENT: ON_OPEN
2634
2635
  initiateCallback(VARIABLE_CONSTANTS.EVENT.OPEN, variable, get(evt, 'data'), evt);
2636
+ // Send initial request body if it exists and connectOnPageLoad is true
2637
+ if (variable.startUpdate) {
2638
+ const requestBody = get(variable, 'dataBinding.RequestBody');
2639
+ if (requestBody) {
2640
+ setTimeout(() => {
2641
+ this.send(variable, requestBody);
2642
+ }, 0); // Using setTimeout to ensure connection is fully established
2643
+ }
2644
+ }
2635
2645
  }
2636
- /**
2637
- * clears the socket variable against the variable in a scope
2638
- * @param variable
2639
- */
2640
2646
  freeSocket(variable) {
2641
2647
  this.scope_var_socket_map.set(variable, undefined);
2642
2648
  }
@@ -2678,7 +2684,6 @@ class WebSocketVariableManager extends BaseVariableManager {
2678
2684
  if (_socket) {
2679
2685
  return _socket;
2680
2686
  }
2681
- // Trigger error if unsecured webSocket is used in secured domain, ignore in mobile device
2682
2687
  if (!CONSTANTS.hasCordova && isInsecureContentRequest(url)) {
2683
2688
  triggerFn(this._onSocketError.bind(this, variable));
2684
2689
  return;
@@ -2699,12 +2704,11 @@ class WebSocketVariableManager extends BaseVariableManager {
2699
2704
  */
2700
2705
  open(variable, success, error) {
2701
2706
  const shouldOpen = this._onBeforeSocketOpen(variable);
2702
- let socket;
2703
2707
  if (shouldOpen === false) {
2704
2708
  triggerFn(error);
2705
2709
  return;
2706
2710
  }
2707
- socket = this.getSocket(variable);
2711
+ const socket = this.getSocket(variable);
2708
2712
  triggerFn(success);
2709
2713
  return socket;
2710
2714
  }
@@ -2712,7 +2716,8 @@ class WebSocketVariableManager extends BaseVariableManager {
2712
2716
  * closes an existing socket connection on variable
2713
2717
  */
2714
2718
  close(variable) {
2715
- const shouldClose = this._onBeforeSocketClose(variable), socket = this.getSocket(variable);
2719
+ const shouldClose = this._onBeforeSocketClose(variable);
2720
+ const socket = this.getSocket(variable);
2716
2721
  if (shouldClose === false) {
2717
2722
  return;
2718
2723
  }
@@ -2726,15 +2731,28 @@ class WebSocketVariableManager extends BaseVariableManager {
2726
2731
  */
2727
2732
  send(variable, message) {
2728
2733
  const socket = this.getSocket(variable);
2729
- let response;
2734
+ if (!socket) {
2735
+ console.error('WebSocket connection not established');
2736
+ return;
2737
+ }
2730
2738
  message = message || get(variable, 'dataBinding.RequestBody');
2731
- response = this._onBeforeSend(variable, message);
2739
+ if (!message) {
2740
+ console.warn('No message to send');
2741
+ return;
2742
+ }
2743
+ const response = this._onBeforeSend(variable, message);
2732
2744
  if (response === false) {
2733
2745
  return;
2734
2746
  }
2735
2747
  message = isDefined(response) ? response : message;
2736
2748
  message = isObject$1(message) ? JSON.stringify(message) : message;
2737
- socket.send(message, 0);
2749
+ try {
2750
+ socket.send(message, 0);
2751
+ }
2752
+ catch (error) {
2753
+ console.error('Error sending message:', error);
2754
+ this._onSocketError(variable, { data: error.message });
2755
+ }
2738
2756
  }
2739
2757
  }
2740
2758