@wavemaker/app-rn-runtime 12.0.0-next.141131 → 12.0.0-next.141138

Sign up to get free protection for your applications and to get access to all the features.
Files changed (321) hide show
  1. app-rn-runtime/components/advanced/carousel/carousel.component.js +32 -5
  2. app-rn-runtime/components/advanced/carousel/carousel.component.js.map +1 -1
  3. app-rn-runtime/components/advanced/carousel/carousel.props.js +1 -0
  4. app-rn-runtime/components/advanced/carousel/carousel.props.js.map +1 -1
  5. app-rn-runtime/components/advanced/carousel/carousel.styles.js +15 -0
  6. app-rn-runtime/components/advanced/carousel/carousel.styles.js.map +1 -1
  7. app-rn-runtime/components/advanced/webview/webview.component.js.map +1 -1
  8. app-rn-runtime/components/basic/anchor/anchor.component.js +15 -5
  9. app-rn-runtime/components/basic/anchor/anchor.component.js.map +1 -1
  10. app-rn-runtime/components/basic/anchor/anchor.styles.js +3 -0
  11. app-rn-runtime/components/basic/anchor/anchor.styles.js.map +1 -1
  12. app-rn-runtime/components/basic/animatedview.component.js +6 -2
  13. app-rn-runtime/components/basic/animatedview.component.js.map +1 -1
  14. app-rn-runtime/components/basic/audio/audio.component.js.map +1 -1
  15. app-rn-runtime/components/basic/button/button.component.js +20 -6
  16. app-rn-runtime/components/basic/button/button.component.js.map +1 -1
  17. app-rn-runtime/components/basic/custom/custom.component.js +1 -1
  18. app-rn-runtime/components/basic/custom/custom.component.js.map +1 -1
  19. app-rn-runtime/components/basic/icon/icon.component.js +14 -6
  20. app-rn-runtime/components/basic/icon/icon.component.js.map +1 -1
  21. app-rn-runtime/components/basic/label/label.component.js +13 -3
  22. app-rn-runtime/components/basic/label/label.component.js.map +1 -1
  23. app-rn-runtime/components/basic/label/label.styles.js.map +1 -1
  24. app-rn-runtime/components/basic/lottie/lottie.component.js +3 -1
  25. app-rn-runtime/components/basic/lottie/lottie.component.js.map +1 -1
  26. app-rn-runtime/components/basic/message/message.component.js.map +1 -1
  27. app-rn-runtime/components/basic/picture/picture.component.js +1 -2
  28. app-rn-runtime/components/basic/picture/picture.component.js.map +1 -1
  29. app-rn-runtime/components/basic/progress-bar/progress-bar.component.js +2 -2
  30. app-rn-runtime/components/basic/progress-bar/progress-bar.component.js.map +1 -1
  31. app-rn-runtime/components/basic/progress-circle/progress-circle.component.js +5 -5
  32. app-rn-runtime/components/basic/progress-circle/progress-circle.component.js.map +1 -1
  33. app-rn-runtime/components/basic/search/search.component.js +10 -1
  34. app-rn-runtime/components/basic/search/search.component.js.map +1 -1
  35. app-rn-runtime/components/basic/search/search.props.js +3 -0
  36. app-rn-runtime/components/basic/search/search.props.js.map +1 -1
  37. app-rn-runtime/components/basic/search/search.styles.js +5 -0
  38. app-rn-runtime/components/basic/search/search.styles.js.map +1 -1
  39. app-rn-runtime/components/basic/skeleton/skeleton.component.js +6 -3
  40. app-rn-runtime/components/basic/skeleton/skeleton.component.js.map +1 -1
  41. app-rn-runtime/components/basic/skeleton/skeleton.props.js +9 -1
  42. app-rn-runtime/components/basic/skeleton/skeleton.props.js.map +1 -1
  43. app-rn-runtime/components/basic/spinner/spinner.component.js +2 -3
  44. app-rn-runtime/components/basic/spinner/spinner.component.js.map +1 -1
  45. app-rn-runtime/components/basic/spinner/spinner.styles.js +3 -2
  46. app-rn-runtime/components/basic/spinner/spinner.styles.js.map +1 -1
  47. app-rn-runtime/components/basic/video/video.component.js.map +1 -1
  48. app-rn-runtime/components/basic/video/video.styles.js +4 -1
  49. app-rn-runtime/components/basic/video/video.styles.js.map +1 -1
  50. app-rn-runtime/components/chart/area-chart/area-chart.component.js +2 -1
  51. app-rn-runtime/components/chart/area-chart/area-chart.component.js.map +1 -1
  52. app-rn-runtime/components/chart/area-chart/area-chart.styles.js +7 -1
  53. app-rn-runtime/components/chart/area-chart/area-chart.styles.js.map +1 -1
  54. app-rn-runtime/components/chart/bar-chart/bar-chart.styles.js +7 -1
  55. app-rn-runtime/components/chart/bar-chart/bar-chart.styles.js.map +1 -1
  56. app-rn-runtime/components/chart/basechart.component.js +54 -2
  57. app-rn-runtime/components/chart/basechart.component.js.map +1 -1
  58. app-rn-runtime/components/chart/basechart.props.js +3 -2
  59. app-rn-runtime/components/chart/basechart.props.js.map +1 -1
  60. app-rn-runtime/components/chart/basechart.styles.js +4 -0
  61. app-rn-runtime/components/chart/basechart.styles.js.map +1 -1
  62. app-rn-runtime/components/chart/bubble-chart/bubble-chart.component.js +15 -3
  63. app-rn-runtime/components/chart/bubble-chart/bubble-chart.component.js.map +1 -1
  64. app-rn-runtime/components/chart/bubble-chart/bubble-chart.styles.js +7 -1
  65. app-rn-runtime/components/chart/bubble-chart/bubble-chart.styles.js.map +1 -1
  66. app-rn-runtime/components/chart/column-chart/column-chart.styles.js +7 -1
  67. app-rn-runtime/components/chart/column-chart/column-chart.styles.js.map +1 -1
  68. app-rn-runtime/components/chart/donut-chart/donut-chart.styles.js +7 -1
  69. app-rn-runtime/components/chart/donut-chart/donut-chart.styles.js.map +1 -1
  70. app-rn-runtime/components/chart/line-chart/line-chart.props.js +2 -0
  71. app-rn-runtime/components/chart/line-chart/line-chart.props.js.map +1 -1
  72. app-rn-runtime/components/chart/line-chart/line-chart.styles.js +7 -1
  73. app-rn-runtime/components/chart/line-chart/line-chart.styles.js.map +1 -1
  74. app-rn-runtime/components/chart/pie-chart/pie-chart.component.js +6 -2
  75. app-rn-runtime/components/chart/pie-chart/pie-chart.component.js.map +1 -1
  76. app-rn-runtime/components/chart/pie-chart/pie-chart.styles.js +7 -1
  77. app-rn-runtime/components/chart/pie-chart/pie-chart.styles.js.map +1 -1
  78. app-rn-runtime/components/chart/stack-chart/stack-chart.component.js +37 -11
  79. app-rn-runtime/components/chart/stack-chart/stack-chart.component.js.map +1 -1
  80. app-rn-runtime/components/container/accordion/accordion.component.js +61 -12
  81. app-rn-runtime/components/container/accordion/accordion.component.js.map +1 -1
  82. app-rn-runtime/components/container/accordion/accordion.props.js.map +1 -1
  83. app-rn-runtime/components/container/accordion/accordion.styles.js +5 -0
  84. app-rn-runtime/components/container/accordion/accordion.styles.js.map +1 -1
  85. app-rn-runtime/components/container/accordion/accordionpane/accordionpane.component.js +11 -1
  86. app-rn-runtime/components/container/accordion/accordionpane/accordionpane.component.js.map +1 -1
  87. app-rn-runtime/components/container/container.component.js +44 -3
  88. app-rn-runtime/components/container/container.component.js.map +1 -1
  89. app-rn-runtime/components/container/container.props.js +1 -0
  90. app-rn-runtime/components/container/container.props.js.map +1 -1
  91. app-rn-runtime/components/container/container.styles.js +7 -0
  92. app-rn-runtime/components/container/container.styles.js.map +1 -1
  93. app-rn-runtime/components/container/layoutgrid/gridcolumn/gridcolumn.component.js.map +1 -1
  94. app-rn-runtime/components/container/layoutgrid/gridrow/gridrow.component.js +5 -1
  95. app-rn-runtime/components/container/layoutgrid/gridrow/gridrow.component.js.map +1 -1
  96. app-rn-runtime/components/container/layoutgrid/gridrow/gridrow.styles.js +6 -1
  97. app-rn-runtime/components/container/layoutgrid/gridrow/gridrow.styles.js.map +1 -1
  98. app-rn-runtime/components/container/layoutgrid/layoutgrid.component.js +28 -2
  99. app-rn-runtime/components/container/layoutgrid/layoutgrid.component.js.map +1 -1
  100. app-rn-runtime/components/container/layoutgrid/layoutgrid.props.js.map +1 -1
  101. app-rn-runtime/components/container/layoutgrid/layoutgrid.styles.js +4 -1
  102. app-rn-runtime/components/container/layoutgrid/layoutgrid.styles.js.map +1 -1
  103. app-rn-runtime/components/container/linearlayout/linearlayout.component.js +31 -5
  104. app-rn-runtime/components/container/linearlayout/linearlayout.component.js.map +1 -1
  105. app-rn-runtime/components/container/linearlayout/linearlayout.props.js.map +1 -1
  106. app-rn-runtime/components/container/linearlayout/linearlayout.styles.js +4 -1
  107. app-rn-runtime/components/container/linearlayout/linearlayout.styles.js.map +1 -1
  108. app-rn-runtime/components/container/panel/panel.component.js +47 -6
  109. app-rn-runtime/components/container/panel/panel.component.js.map +1 -1
  110. app-rn-runtime/components/container/panel/panel.props.js.map +1 -1
  111. app-rn-runtime/components/container/panel/panel.styles.js +3 -0
  112. app-rn-runtime/components/container/panel/panel.styles.js.map +1 -1
  113. app-rn-runtime/components/container/partial-host.component.js.map +1 -1
  114. app-rn-runtime/components/container/tabs/tabheader/tabheader.component.js +3 -4
  115. app-rn-runtime/components/container/tabs/tabheader/tabheader.component.js.map +1 -1
  116. app-rn-runtime/components/container/tabs/tabheader/tabheader.props.js.map +1 -1
  117. app-rn-runtime/components/container/tabs/tabpane/tabpane.component.js +11 -1
  118. app-rn-runtime/components/container/tabs/tabpane/tabpane.component.js.map +1 -1
  119. app-rn-runtime/components/container/tabs/tabpane/tabpane.props.js +1 -0
  120. app-rn-runtime/components/container/tabs/tabpane/tabpane.props.js.map +1 -1
  121. app-rn-runtime/components/container/tabs/tabs.component.js +44 -6
  122. app-rn-runtime/components/container/tabs/tabs.component.js.map +1 -1
  123. app-rn-runtime/components/container/tabs/tabs.props.js.map +1 -1
  124. app-rn-runtime/components/container/tabs/tabs.styles.js +4 -1
  125. app-rn-runtime/components/container/tabs/tabs.styles.js.map +1 -1
  126. app-rn-runtime/components/container/tile/tile.component.js +28 -2
  127. app-rn-runtime/components/container/tile/tile.component.js.map +1 -1
  128. app-rn-runtime/components/container/tile/tile.props.js.map +1 -1
  129. app-rn-runtime/components/container/tile/tile.styles.js +6 -1
  130. app-rn-runtime/components/container/tile/tile.styles.js.map +1 -1
  131. app-rn-runtime/components/container/wizard/wizard.component.js +62 -13
  132. app-rn-runtime/components/container/wizard/wizard.component.js.map +1 -1
  133. app-rn-runtime/components/container/wizard/wizard.props.js.map +1 -1
  134. app-rn-runtime/components/container/wizard/wizard.styles.js +3 -0
  135. app-rn-runtime/components/container/wizard/wizard.styles.js.map +1 -1
  136. app-rn-runtime/components/container/wizard/wizardstep/wizardstep.component.js +4 -1
  137. app-rn-runtime/components/container/wizard/wizardstep/wizardstep.component.js.map +1 -1
  138. app-rn-runtime/components/data/card/card-content/card-content.component.js +6 -2
  139. app-rn-runtime/components/data/card/card-content/card-content.component.js.map +1 -1
  140. app-rn-runtime/components/data/card/card-content/card-content.styles.js +4 -1
  141. app-rn-runtime/components/data/card/card-content/card-content.styles.js.map +1 -1
  142. app-rn-runtime/components/data/card/card.component.js +18 -0
  143. app-rn-runtime/components/data/card/card.component.js.map +1 -1
  144. app-rn-runtime/components/data/card/card.styles.js +3 -0
  145. app-rn-runtime/components/data/card/card.styles.js.map +1 -1
  146. app-rn-runtime/components/data/form/form-field/form-field.component.js.map +1 -1
  147. app-rn-runtime/components/data/form/form.component.js +1 -1
  148. app-rn-runtime/components/data/form/form.component.js.map +1 -1
  149. app-rn-runtime/components/data/form/form.props.js +1 -0
  150. app-rn-runtime/components/data/form/form.props.js.map +1 -1
  151. app-rn-runtime/components/data/list/list-template/list-template.component.js +15 -1
  152. app-rn-runtime/components/data/list/list-template/list-template.component.js.map +1 -1
  153. app-rn-runtime/components/data/list/list-template/list-template.props.js +1 -0
  154. app-rn-runtime/components/data/list/list-template/list-template.props.js.map +1 -1
  155. app-rn-runtime/components/data/list/list-template/list-template.styles.js +11 -1
  156. app-rn-runtime/components/data/list/list-template/list-template.styles.js.map +1 -1
  157. app-rn-runtime/components/data/list/list.component.js +54 -33
  158. app-rn-runtime/components/data/list/list.component.js.map +1 -1
  159. app-rn-runtime/components/data/list/list.props.js +1 -0
  160. app-rn-runtime/components/data/list/list.props.js.map +1 -1
  161. app-rn-runtime/components/data/list/list.styles.js +9 -0
  162. app-rn-runtime/components/data/list/list.styles.js.map +1 -1
  163. app-rn-runtime/components/dialogs/dialog/dialog.component.js +5 -3
  164. app-rn-runtime/components/dialogs/dialog/dialog.component.js.map +1 -1
  165. app-rn-runtime/components/dialogs/dialog/dialog.styles.js.map +1 -1
  166. app-rn-runtime/components/input/basedataset/basedataset.component.js.map +1 -1
  167. app-rn-runtime/components/input/baseinput/baseinput.component.js +57 -14
  168. app-rn-runtime/components/input/baseinput/baseinput.component.js.map +1 -1
  169. app-rn-runtime/components/input/baseinput/baseinput.props.js +1 -0
  170. app-rn-runtime/components/input/baseinput/baseinput.props.js.map +1 -1
  171. app-rn-runtime/components/input/basenumber/basenumber.component.js +40 -14
  172. app-rn-runtime/components/input/basenumber/basenumber.component.js.map +1 -1
  173. app-rn-runtime/components/input/basenumber/basenumber.props.js +2 -0
  174. app-rn-runtime/components/input/basenumber/basenumber.props.js.map +1 -1
  175. app-rn-runtime/components/input/checkbox/checkbox.component.js +7 -8
  176. app-rn-runtime/components/input/checkbox/checkbox.component.js.map +1 -1
  177. app-rn-runtime/components/input/checkbox/checkbox.styles.js +3 -1
  178. app-rn-runtime/components/input/checkbox/checkbox.styles.js.map +1 -1
  179. app-rn-runtime/components/input/checkboxset/checkboxset.component.js +24 -3
  180. app-rn-runtime/components/input/checkboxset/checkboxset.component.js.map +1 -1
  181. app-rn-runtime/components/input/checkboxset/checkboxset.props.js +1 -0
  182. app-rn-runtime/components/input/checkboxset/checkboxset.props.js.map +1 -1
  183. app-rn-runtime/components/input/checkboxset/checkboxset.styles.js +1 -0
  184. app-rn-runtime/components/input/checkboxset/checkboxset.styles.js.map +1 -1
  185. app-rn-runtime/components/input/chips/chips.component.js +3 -2
  186. app-rn-runtime/components/input/chips/chips.component.js.map +1 -1
  187. app-rn-runtime/components/input/currency/currency.component.js +19 -2
  188. app-rn-runtime/components/input/currency/currency.component.js.map +1 -1
  189. app-rn-runtime/components/input/currency/currency.styles.js +6 -1
  190. app-rn-runtime/components/input/currency/currency.styles.js.map +1 -1
  191. app-rn-runtime/components/input/epoch/base-datetime.component.js +26 -8
  192. app-rn-runtime/components/input/epoch/base-datetime.component.js.map +1 -1
  193. app-rn-runtime/components/input/epoch/wheel-date-picker.component.js +123 -12
  194. app-rn-runtime/components/input/epoch/wheel-date-picker.component.js.map +1 -1
  195. app-rn-runtime/components/input/epoch/wheelpicker/wheelpicker.component.js.map +1 -1
  196. app-rn-runtime/components/input/epoch/wheelpickermodal/date/date-picker-modal.component.js +4 -0
  197. app-rn-runtime/components/input/epoch/wheelpickermodal/date/date-picker-modal.component.js.map +1 -1
  198. app-rn-runtime/components/input/epoch/wheelpickermodal/date/date-picker-modal.props.js +2 -0
  199. app-rn-runtime/components/input/epoch/wheelpickermodal/date/date-picker-modal.props.js.map +1 -1
  200. app-rn-runtime/components/input/fileupload/fileupload.component.js +4 -2
  201. app-rn-runtime/components/input/fileupload/fileupload.component.js.map +1 -1
  202. app-rn-runtime/components/input/fileupload/fileupload.props.js +1 -0
  203. app-rn-runtime/components/input/fileupload/fileupload.props.js.map +1 -1
  204. app-rn-runtime/components/input/number/number.component.js +9 -4
  205. app-rn-runtime/components/input/number/number.component.js.map +1 -1
  206. app-rn-runtime/components/input/number/number.styles.js +3 -0
  207. app-rn-runtime/components/input/number/number.styles.js.map +1 -1
  208. app-rn-runtime/components/input/radioset/radioset.component.js +39 -14
  209. app-rn-runtime/components/input/radioset/radioset.component.js.map +1 -1
  210. app-rn-runtime/components/input/radioset/radioset.props.js +2 -0
  211. app-rn-runtime/components/input/radioset/radioset.props.js.map +1 -1
  212. app-rn-runtime/components/input/radioset/radioset.styles.js +7 -0
  213. app-rn-runtime/components/input/radioset/radioset.styles.js.map +1 -1
  214. app-rn-runtime/components/input/select/select.component.js +23 -9
  215. app-rn-runtime/components/input/select/select.component.js.map +1 -1
  216. app-rn-runtime/components/input/switch/switch.component.js +2 -2
  217. app-rn-runtime/components/input/switch/switch.component.js.map +1 -1
  218. app-rn-runtime/components/input/text/text.component.js +26 -2
  219. app-rn-runtime/components/input/text/text.component.js.map +1 -1
  220. app-rn-runtime/components/input/text/text.props.js +3 -0
  221. app-rn-runtime/components/input/text/text.props.js.map +1 -1
  222. app-rn-runtime/components/input/text/text.styles.js +3 -0
  223. app-rn-runtime/components/input/text/text.styles.js.map +1 -1
  224. app-rn-runtime/components/input/textarea/textarea.component.js +24 -1
  225. app-rn-runtime/components/input/textarea/textarea.component.js.map +1 -1
  226. app-rn-runtime/components/input/textarea/textarea.props.js +2 -0
  227. app-rn-runtime/components/input/textarea/textarea.props.js.map +1 -1
  228. app-rn-runtime/components/input/textarea/textarea.styles.js +3 -0
  229. app-rn-runtime/components/input/textarea/textarea.styles.js.map +1 -1
  230. app-rn-runtime/components/input/toggle/toggle.component.js +2 -4
  231. app-rn-runtime/components/input/toggle/toggle.component.js.map +1 -1
  232. app-rn-runtime/components/navigation/appnavbar/appnavbar.component.js +2 -2
  233. app-rn-runtime/components/navigation/appnavbar/appnavbar.component.js.map +1 -1
  234. app-rn-runtime/components/navigation/basenav/basenav.component.js.map +1 -1
  235. app-rn-runtime/components/navigation/navitem/navitem.component.js +2 -3
  236. app-rn-runtime/components/navigation/navitem/navitem.component.js.map +1 -1
  237. app-rn-runtime/components/navigation/popover/popover.component.js.map +1 -1
  238. app-rn-runtime/components/page/content/content.component.js.map +1 -1
  239. app-rn-runtime/components/page/left-panel/left-panel.component.js +4 -1
  240. app-rn-runtime/components/page/left-panel/left-panel.component.js.map +1 -1
  241. app-rn-runtime/components/page/page-content/page-content.component.js +70 -14
  242. app-rn-runtime/components/page/page-content/page-content.component.js.map +1 -1
  243. app-rn-runtime/components/page/page-content/page-content.props.js +2 -2
  244. app-rn-runtime/components/page/page-content/page-content.props.js.map +1 -1
  245. app-rn-runtime/components/page/page-content/page-content.styles.js +6 -1
  246. app-rn-runtime/components/page/page-content/page-content.styles.js.map +1 -1
  247. app-rn-runtime/components/page/page.component.js.map +1 -1
  248. app-rn-runtime/components/page/page.props.js.map +1 -1
  249. app-rn-runtime/components/page/page.styles.js +7 -1
  250. app-rn-runtime/components/page/page.styles.js.map +1 -1
  251. app-rn-runtime/components/page/partial/partial.component.js +27 -1
  252. app-rn-runtime/components/page/partial/partial.component.js.map +1 -1
  253. app-rn-runtime/components/page/partial/partial.props.js.map +1 -1
  254. app-rn-runtime/components/page/partial/partial.styles.js +6 -1
  255. app-rn-runtime/components/page/partial/partial.styles.js.map +1 -1
  256. app-rn-runtime/components/page/tabbar/curve.js.map +1 -1
  257. app-rn-runtime/components/page/tabbar/tabbar.component.js.map +1 -1
  258. app-rn-runtime/components/page/tabbar/tabbar.props.js +1 -0
  259. app-rn-runtime/components/page/tabbar/tabbar.props.js.map +1 -1
  260. app-rn-runtime/components/prefab/prefab-container.component.js +27 -1
  261. app-rn-runtime/components/prefab/prefab-container.component.js.map +1 -1
  262. app-rn-runtime/components/prefab/prefab-container.props.js.map +1 -1
  263. app-rn-runtime/components/prefab/prefab-container.styles.js +6 -1
  264. app-rn-runtime/components/prefab/prefab-container.styles.js.map +1 -1
  265. app-rn-runtime/core/AppConfig.js.map +1 -1
  266. app-rn-runtime/core/base.component.js +35 -7
  267. app-rn-runtime/core/base.component.js.map +1 -1
  268. app-rn-runtime/core/components/textinput.component.js +13 -10
  269. app-rn-runtime/core/components/textinput.component.js.map +1 -1
  270. app-rn-runtime/core/formatters.js.map +1 -1
  271. app-rn-runtime/core/key.extractor.js.map +1 -1
  272. app-rn-runtime/core/props.provider.js +4 -1
  273. app-rn-runtime/core/props.provider.js.map +1 -1
  274. app-rn-runtime/core/storage.service.js +15 -0
  275. app-rn-runtime/core/storage.service.js.map +1 -1
  276. app-rn-runtime/core/tappable.component.js +34 -27
  277. app-rn-runtime/core/tappable.component.js.map +1 -1
  278. app-rn-runtime/core/ui-preferences.context.js +7 -0
  279. app-rn-runtime/core/ui-preferences.context.js.map +1 -0
  280. app-rn-runtime/core/utils.js +87 -4
  281. app-rn-runtime/core/utils.js.map +1 -1
  282. app-rn-runtime/core/wm-component-tree.js +58 -0
  283. app-rn-runtime/core/wm-component-tree.js.map +1 -0
  284. app-rn-runtime/package.json +39 -9
  285. app-rn-runtime/runtime/App.js +21 -10
  286. app-rn-runtime/runtime/App.js.map +1 -1
  287. app-rn-runtime/runtime/App.navigator.js +1 -0
  288. app-rn-runtime/runtime/App.navigator.js.map +1 -1
  289. app-rn-runtime/runtime/base-fragment.component.js +61 -13
  290. app-rn-runtime/runtime/base-fragment.component.js.map +1 -1
  291. app-rn-runtime/runtime/base-page.component.js +10 -0
  292. app-rn-runtime/runtime/base-page.component.js.map +1 -1
  293. app-rn-runtime/runtime/base-partial.component.js +3 -0
  294. app-rn-runtime/runtime/base-partial.component.js.map +1 -1
  295. app-rn-runtime/runtime/base-prefab.component.js.map +1 -1
  296. app-rn-runtime/runtime/navigator/drawer.navigator.js +19 -10
  297. app-rn-runtime/runtime/navigator/drawer.navigator.js.map +1 -1
  298. app-rn-runtime/runtime/navigator/stack.navigator.js.map +1 -1
  299. app-rn-runtime/runtime/services/app-i18n.service.js +10 -0
  300. app-rn-runtime/runtime/services/app-i18n.service.js.map +1 -1
  301. app-rn-runtime/runtime/services/app-security.service.js +42 -2
  302. app-rn-runtime/runtime/services/app-security.service.js.map +1 -1
  303. app-rn-runtime/runtime/services/app-spinner.service.js +1 -1
  304. app-rn-runtime/runtime/services/app-spinner.service.js.map +1 -1
  305. app-rn-runtime/runtime/services/webprocess.service.js.map +1 -1
  306. app-rn-runtime/runtime/watcher.js.map +1 -1
  307. app-rn-runtime/styles/background.component.js +1 -0
  308. app-rn-runtime/styles/background.component.js.map +1 -1
  309. app-rn-runtime/styles/style-prop.validator.js.map +1 -1
  310. app-rn-runtime/styles/theme.js +10 -0
  311. app-rn-runtime/styles/theme.js.map +1 -1
  312. app-rn-runtime/styles/theme.variables.js +2 -1
  313. app-rn-runtime/styles/theme.variables.js.map +1 -1
  314. app-rn-runtime/variables/base-variable.js.map +1 -1
  315. app-rn-runtime/variables/device/file/upload-file.operation.js.map +1 -1
  316. app-rn-runtime/variables/device-variable.js.map +1 -1
  317. app-rn-runtime/variables/http.service.js +5 -1
  318. app-rn-runtime/variables/http.service.js.map +1 -1
  319. app-rn-runtime/variables/live-variable.js +14 -0
  320. app-rn-runtime/variables/live-variable.js.map +1 -1
  321. app-rn-runtime/variables/service-variable.js.map +1 -1
@@ -36,6 +36,9 @@ export default class BasePage extends BaseFragment {
36
36
  AppSecurityService.redirectToLogin(this.toHashURL());
37
37
  }
38
38
  });
39
+ if (this.App.appConfig.diagnostics.pageStartTime < 0) {
40
+ this.App.appConfig.diagnostics.pageStartTime = Date.now();
41
+ }
39
42
  }
40
43
  onComponentInit(w) {
41
44
  super.onComponentInit(w);
@@ -73,11 +76,15 @@ export default class BasePage extends BaseFragment {
73
76
  onAttach() {
74
77
  super.onAttach();
75
78
  this.setDrawerContent();
79
+ this.App.appConfig.diagnostics.pageReadyTime = Date.now();
80
+ this.App.notify('pageAttached', this);
76
81
  }
77
82
  onFragmentReady() {
78
83
  return super.onFragmentReady().then(() => {
79
84
  this.onContentReady();
80
85
  this.App.triggerPageReady(this.pageName, this.proxy);
86
+ this.App.appConfig.diagnostics.pageReadyTime = Date.now();
87
+ this.App.notify('pageReady', this);
81
88
  AppSpinnerService.hide();
82
89
  this.cleanup.push(this.props.navigation.addListener('focus', () => {
83
90
  if (this.appConfig.currentPage !== this) {
@@ -90,11 +97,13 @@ export default class BasePage extends BaseFragment {
90
97
  }
91
98
  componentWillUnmount() {
92
99
  super.componentWillUnmount();
100
+ this.App.notify('pageDestroyed', this);
93
101
  }
94
102
  goToPage(pageName, params, clearCahe = false) {
95
103
  const navigation = this.props.navigation;
96
104
  const _params = clone(params);
97
105
  _params && delete _params['pageName'];
106
+ this.App.appConfig.diagnostics.pageStartTime = Date.now();
98
107
  if (pageName !== this.pageName || !isEqual(_params || null, this.pageParams || null)) {
99
108
  if (pageName === this.pageName) {
100
109
  navigation.push(pageName, _params);
@@ -129,6 +138,7 @@ export default class BasePage extends BaseFragment {
129
138
  }
130
139
  goBack() {
131
140
  const navigation = this.props.navigation;
141
+ this.App.appConfig.diagnostics.pageStartTime = Date.now();
132
142
  if (navigation.canGoBack()) {
133
143
  navigation.goBack();
134
144
  } else if (window && window.history) {
@@ -1 +1 @@
1
- {"version":3,"names":["clone","isEqual","React","CommonActions","SplashScreen","WmPage","NavigationServiceProvider","AppSecurityService","AppSpinnerService","BaseFragment","Watcher","BasePage","constructor","props","_this$appConfig$drawe","_defineProperty","setTimeout","hideAsync","pageName","route","name","pageParams","params","appConfig","currentPage","drawer","setContent","serviceDefinitions","App","watcher","ROOT","create","canUserAccessPage","then","flag","cache","redirectToLogin","toHashURL","onComponentInit","w","targetWidget","refreshdataonattach","toggleDrawer","navigation","setDrawerContent","content","drawerContent","drawerType","hasDrawer","proxy","_this$appConfig$drawe2","_this$appConfig$drawe4","_this$appConfig$drawe3","createElement","value","setAnimation","onAttach","onFragmentReady","onContentReady","triggerPageReady","hide","cleanup","push","addListener","refresh","componentWillUnmount","goToPage","clearCahe","_params","dispatch","reset","index","routes","navigate","onDetach","destroyMe","closeDrawer","Promise","resolve","navigateToLandingPage","hash","paramStr","Object","keys","map","k","join","goBack","canGoBack","window","history","back","openUrl","url","startsWith","substring","splits","split","length","p","forEach","openBrowser","isActiveTabbarItem","label","link","links","possibleLinks","find","l","includes","renderWidget","renderPage"],"sources":["base-page.component.tsx"],"sourcesContent":["import { clone, isEqual } from 'lodash';\nimport React, { ReactNode } from 'react';\nimport { CommonActions } from '@react-navigation/native';\nimport * as SplashScreen from 'expo-splash-screen';\nimport { BaseComponent } from '@wavemaker/app-rn-runtime/core/base.component';\n\nimport WmPage from '@wavemaker/app-rn-runtime/components/page/page.component';\nimport NavigationService, { NavigationServiceProvider } from '@wavemaker/app-rn-runtime/core/navigation.service';\n\nimport AppSecurityService from './services/app-security.service';\nimport AppSpinnerService from './services/app-spinner.service';\nimport BaseFragment, { FragmentProps, FragmentState } from './base-fragment.component';\nimport { Watcher } from './watcher';\n\ndeclare const window: any;\n\nexport interface PageProps extends FragmentProps {\n route: any;\n navigation: any;\n destroyMe: Function;\n}\n\nexport interface PageState extends FragmentState<PageProps> {}\n\nexport default abstract class BasePage extends BaseFragment<PageProps, PageState> implements NavigationService {\n private pageName = null as unknown as string;\n private pageParams: any = {};\n private hasDrawer = false;\n private hasTabbar = false;\n private drawerContent = null as React.ReactNode;\n private drawerType = '';\n\n constructor(props: PageProps) {\n super(props);\n setTimeout(() => {\n SplashScreen.hideAsync();\n }, 300);\n this.pageName = props.route.name;\n this.pageParams = props.route.params;\n this.appConfig.currentPage = this;\n this.appConfig.drawer?.setContent(null);\n this.serviceDefinitions = this.App.serviceDefinitions;\n this.watcher = Watcher.ROOT.create();\n AppSecurityService.canUserAccessPage(this.pageName)\n .then(flag => {\n if (!flag) {\n this.cache = false;\n AppSecurityService.redirectToLogin(this.toHashURL());\n }\n });\n }\n\n onComponentInit(w: BaseComponent<any, any, any>) {\n super.onComponentInit(w);\n if (w instanceof WmPage) {\n this.targetWidget = w;\n const props = w.props as any;\n this.cache = !(props.cache === false);\n this.refreshdataonattach = !(props.refreshdataonattach === false);\n }\n }\n\n toggleDrawer() {\n (this.props as PageProps).navigation.toggleDrawer();\n }\n\n setDrawerContent(content = this.drawerContent, drawerType = this.drawerType) {\n if (!content) {\n return;\n }\n this.drawerContent = content;\n this.drawerType = drawerType;\n this.hasDrawer = true;\n setTimeout(() => {\n if (this.appConfig.currentPage === this \n || this.appConfig.currentPage.proxy === this) {\n this.appConfig.drawer?.setContent(null);\n setTimeout(() => {\n this.appConfig.drawer?.setContent((\n <NavigationServiceProvider value={this}>\n {content}\n </NavigationServiceProvider>));\n }, 500);\n this.appConfig.drawer?.setAnimation(drawerType);\n }\n }, 10);\n }\n\n onAttach() {\n super.onAttach();\n this.setDrawerContent();\n }\n\n onFragmentReady() {\n return super.onFragmentReady().then(() => {\n this.onContentReady();\n this.App.triggerPageReady(this.pageName, this.proxy as BasePage);\n AppSpinnerService.hide();\n this.cleanup.push((this.props as PageProps).navigation.addListener('focus', () => {\n if (this.appConfig.currentPage !== this) {\n this.appConfig.currentPage = this;\n this.onAttach();\n this.appConfig.refresh();\n }\n }));\n });\n }\n\n componentWillUnmount() {\n super.componentWillUnmount();\n }\n\n goToPage(pageName: string, params: any, clearCahe = false) {\n const navigation = (this.props as PageProps).navigation;\n const _params = clone(params);\n _params && delete _params['pageName'];\n if (pageName !== this.pageName || !isEqual(_params || null, this.pageParams || null)) {\n if (pageName === this.pageName) {\n navigation.push(pageName, _params);\n } else if (clearCahe) {\n navigation.dispatch(CommonActions.reset({\n index: 0,\n routes: [\n { name: pageName, params: params }\n ]}));\n } else {\n navigation.navigate(pageName, _params);\n }\n if (this.cache) {\n this.onDetach();\n } else {\n this.props.destroyMe();\n }\n } else {\n (this.props as PageProps).navigation.closeDrawer();\n }\n return Promise.resolve();\n }\n\n public navigateToLandingPage() {\n AppSecurityService.navigateToLandingPage();\n }\n\n public toHashURL() {\n const hash = `#/${this.pageName}`;\n const paramStr = Object.keys(this.pageParams || [])\n .map(k => k && `${k}=${this.pageParams[k]}`)\n .join('&');\n return hash + (paramStr ? `?${paramStr}` : '');\n }\n\n goBack() {\n const navigation = (this.props as PageProps).navigation;\n if (navigation.canGoBack()) {\n navigation.goBack();\n } else if (window && window.history) {\n window.history.back();\n }\n return Promise.resolve();\n }\n\n openUrl(url: string, params = {} as any) {\n if (url) {\n if (url.startsWith('#')) {\n url = url.substring(1);\n url = url.startsWith('/') ? url.substring(1) : url;\n const splits = url.split('?');\n const pageName = splits[0];\n let params = {} as any;\n if (splits.length > 1) {\n splits[1].split('&')\n .map(p => p.split('='))\n .forEach(p => params[p[0]] = p[1]);\n }\n return this.goToPage(pageName, params);\n } else {\n this.App.openBrowser(url, params);\n }\n }\n return Promise.resolve();\n }\n\n isActiveTabbarItem({label, link, links}: {label: string, link: string, links: string[]}) {\n const pageName = this.pageName;\n const possibleLinks = [pageName, '#' + pageName, '#/' + pageName];\n return links && links.find(l => possibleLinks.includes(l));\n }\n\n abstract renderPage(): ReactNode;\n\n renderWidget(props: PageProps) {\n return this.renderPage();\n }\n}\n"],"mappings":";;;AAAA,SAASA,KAAK,EAAEC,OAAO,QAAQ,QAAQ;AACvC,OAAOC,KAAK,MAAqB,OAAO;AACxC,SAASC,aAAa,QAAQ,0BAA0B;AACxD,OAAO,KAAKC,YAAY,MAAM,oBAAoB;AAGlD,OAAOC,MAAM,MAAM,0DAA0D;AAC7E,SAA4BC,yBAAyB,QAAQ,mDAAmD;AAEhH,OAAOC,kBAAkB,MAAM,iCAAiC;AAChE,OAAOC,iBAAiB,MAAM,gCAAgC;AAC9D,OAAOC,YAAY,MAAwC,2BAA2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AM,CAAC;MACxC,CAAC,MAAM;QACL,IAAI,CAACM,GAAG,CAACyE,WAAW,CAACR,GAAG,EAAEvE,MAAM,CAAC;MACnC;IACF;IACA,OAAOuD,OAAO,CAACC,OAAO,CAAC,CAAC;EAC1B;EAEAwB,kBAAkBA,CAAC;IAACC,KAAK;IAAEC,IAAI;IAAEC;EAAqD,CAAC,EAAE;IACvF,MAAMvF,QAAQ,GAAG,IAAI,CAACA,QAAQ;IAC9B,MAAMwF,aAAa,GAAG,CAACxF,QAAQ,EAAE,GAAG,GAAGA,QAAQ,EAAE,IAAI,GAAGA,QAAQ,CAAC;IACjE,OAAOuF,KAAK,IAAIA,KAAK,CAACE,IAAI,CAACC,CAAC,IAAIF,aAAa,CAACG,QAAQ,CAACD,CAAC,CAAC,CAAC;EAC5D;EAIAE,YAAYA,CAACjG,KAAgB,EAAE;IAC7B,OAAO,IAAI,CAACkG,UAAU,CAAC,CAAC;EAC1B;AACJ","ignoreList":[]}
1
+ {"version":3,"names":["clone","isEqual","React","CommonActions","SplashScreen","WmPage","NavigationServiceProvider","AppSecurityService","AppSpinnerService","BaseFragment","Watcher","BasePage","constructor","props","_this$appConfig$drawe","_defineProperty","setTimeout","hideAsync","pageName","route","name","pageParams","params","appConfig","currentPage","drawer","setContent","serviceDefinitions","App","watcher","ROOT","create","canUserAccessPage","then","flag","cache","redirectToLogin","toHashURL","diagnostics","pageStartTime","Date","now","onComponentInit","w","targetWidget","refreshdataonattach","toggleDrawer","navigation","setDrawerContent","content","drawerContent","drawerType","hasDrawer","proxy","_this$appConfig$drawe2","_this$appConfig$drawe4","_this$appConfig$drawe3","createElement","value","setAnimation","onAttach","pageReadyTime","notify","onFragmentReady","onContentReady","triggerPageReady","hide","cleanup","push","addListener","refresh","componentWillUnmount","goToPage","clearCahe","_params","dispatch","reset","index","routes","navigate","onDetach","destroyMe","closeDrawer","Promise","resolve","navigateToLandingPage","hash","paramStr","Object","keys","map","k","join","goBack","canGoBack","window","history","back","openUrl","url","startsWith","substring","splits","split","length","p","forEach","openBrowser","isActiveTabbarItem","label","link","links","possibleLinks","find","l","includes","renderWidget","renderPage"],"sources":["base-page.component.tsx"],"sourcesContent":["import { clone, isEqual } from 'lodash';\nimport React, { ReactNode } from 'react';\nimport { CommonActions } from '@react-navigation/native';\nimport * as SplashScreen from 'expo-splash-screen';\nimport { BaseComponent } from '@wavemaker/app-rn-runtime/core/base.component';\n\nimport WmPage from '@wavemaker/app-rn-runtime/components/page/page.component';\nimport NavigationService, { NavigationServiceProvider } from '@wavemaker/app-rn-runtime/core/navigation.service';\n\nimport AppSecurityService from './services/app-security.service';\nimport AppSpinnerService from './services/app-spinner.service';\nimport BaseFragment, { FragmentProps, FragmentState } from './base-fragment.component';\nimport { Watcher } from './watcher';\n\ndeclare const window: any;\n\nexport interface PageProps extends FragmentProps {\n route: any;\n navigation: any;\n destroyMe: Function;\n}\n\nexport interface PageState extends FragmentState<PageProps> {}\n\nexport default abstract class BasePage extends BaseFragment<PageProps, PageState> implements NavigationService {\n private pageName = null as unknown as string;\n private pageParams: any = {};\n private hasDrawer = false;\n private hasTabbar = false;\n private drawerContent = null as React.ReactNode;\n private drawerType = '';\n\n constructor(props: PageProps) {\n super(props);\n setTimeout(() => {\n SplashScreen.hideAsync();\n }, 300);\n this.pageName = props.route.name;\n this.pageParams = props.route.params;\n this.appConfig.currentPage = this;\n this.appConfig.drawer?.setContent(null);\n this.serviceDefinitions = this.App.serviceDefinitions;\n this.watcher = Watcher.ROOT.create();\n AppSecurityService.canUserAccessPage(this.pageName)\n .then(flag => {\n if (!flag) {\n this.cache = false;\n AppSecurityService.redirectToLogin(this.toHashURL());\n }\n });\n if (this.App.appConfig.diagnostics.pageStartTime < 0) {\n this.App.appConfig.diagnostics.pageStartTime = Date.now();\n }\n }\n\n onComponentInit(w: BaseComponent<any, any, any>) {\n super.onComponentInit(w);\n if (w instanceof WmPage) {\n this.targetWidget = w;\n const props = w.props as any;\n this.cache = !(props.cache === false);\n this.refreshdataonattach = !(props.refreshdataonattach === false);\n }\n }\n\n toggleDrawer() {\n (this.props as PageProps).navigation.toggleDrawer();\n }\n\n setDrawerContent(content = this.drawerContent, drawerType = this.drawerType) {\n if (!content) {\n return;\n }\n this.drawerContent = content;\n this.drawerType = drawerType;\n this.hasDrawer = true;\n setTimeout(() => {\n if (this.appConfig.currentPage === this \n || this.appConfig.currentPage.proxy === this) {\n this.appConfig.drawer?.setContent(null);\n setTimeout(() => {\n this.appConfig.drawer?.setContent((\n <NavigationServiceProvider value={this}>\n {content}\n </NavigationServiceProvider>));\n }, 500);\n this.appConfig.drawer?.setAnimation(drawerType);\n }\n }, 10);\n }\n\n onAttach() {\n super.onAttach();\n this.setDrawerContent();\n this.App.appConfig.diagnostics.pageReadyTime = Date.now();\n this.App.notify('pageAttached', this);\n }\n\n onFragmentReady() {\n return super.onFragmentReady().then(() => {\n this.onContentReady();\n this.App.triggerPageReady(this.pageName, this.proxy as BasePage);\n this.App.appConfig.diagnostics.pageReadyTime = Date.now(); \n this.App.notify('pageReady', this);\n AppSpinnerService.hide();\n this.cleanup.push((this.props as PageProps).navigation.addListener('focus', () => {\n if (this.appConfig.currentPage !== this) {\n this.appConfig.currentPage = this;\n this.onAttach();\n this.appConfig.refresh();\n }\n }));\n });\n }\n\n componentWillUnmount() {\n super.componentWillUnmount();\n this.App.notify('pageDestroyed', this);\n }\n\n goToPage(pageName: string, params: any, clearCahe = false) {\n const navigation = (this.props as PageProps).navigation;\n const _params = clone(params);\n _params && delete _params['pageName'];\n this.App.appConfig.diagnostics.pageStartTime = Date.now();\n if (pageName !== this.pageName || !isEqual(_params || null, this.pageParams || null)) {\n if (pageName === this.pageName) {\n navigation.push(pageName, _params);\n } else if (clearCahe) {\n navigation.dispatch(CommonActions.reset({\n index: 0,\n routes: [\n { name: pageName, params: params }\n ]}));\n } else {\n navigation.navigate(pageName, _params);\n }\n if (this.cache) {\n this.onDetach();\n } else {\n this.props.destroyMe();\n }\n } else {\n (this.props as PageProps).navigation.closeDrawer();\n }\n return Promise.resolve();\n }\n\n public navigateToLandingPage() {\n AppSecurityService.navigateToLandingPage();\n }\n\n public toHashURL() {\n const hash = `#/${this.pageName}`;\n const paramStr = Object.keys(this.pageParams || [])\n .map(k => k && `${k}=${this.pageParams[k]}`)\n .join('&');\n return hash + (paramStr ? `?${paramStr}` : '');\n }\n\n goBack() {\n const navigation = (this.props as PageProps).navigation;\n this.App.appConfig.diagnostics.pageStartTime = Date.now();\n if (navigation.canGoBack()) {\n navigation.goBack();\n } else if (window && window.history) {\n window.history.back();\n }\n return Promise.resolve();\n }\n\n openUrl(url: string, params = {} as any) {\n if (url) {\n if (url.startsWith('#')) {\n url = url.substring(1);\n url = url.startsWith('/') ? url.substring(1) : url;\n const splits = url.split('?');\n const pageName = splits[0];\n let params = {} as any;\n if (splits.length > 1) {\n splits[1].split('&')\n .map(p => p.split('='))\n .forEach(p => params[p[0]] = p[1]);\n }\n return this.goToPage(pageName, params);\n } else {\n this.App.openBrowser(url, params);\n }\n }\n return Promise.resolve();\n }\n\n isActiveTabbarItem({label, link, links}: {label: string, link: string, links: string[]}) {\n const pageName = this.pageName;\n const possibleLinks = [pageName, '#' + pageName, '#/' + pageName];\n return links && links.find(l => possibleLinks.includes(l));\n }\n\n abstract renderPage(): ReactNode;\n\n renderWidget(props: PageProps) {\n return this.renderPage();\n }\n}\n"],"mappings":";;;AAAA,SAASA,KAAK,EAAEC,OAAO,QAAQ,QAAQ;AACvC,OAAOC,KAAK,MAAqB,OAAO;AACxC,SAASC,aAAa,QAAQ,0BAA0B;AACxD,OAAO,KAAKC,YAAY,MAAM,oBAAoB;AAGlD,OAAOC,MAAM,MAAM,0DAA0D;AAC7E,SAA4BC,yBAAyB,QAAQ,mDAAmD;AAEhH,OAAOC,kBAAkB,MAAM,iCAAiC;AAChE,OAAOC,iBAAiB,MAAM,gCAAgC;AAC9D,OAAOC,YAAY,MAAwC,2BAA2B;AACtF,SAASC,OAAO,QAAQ,WAAW;AAYnC,eAAe,MAA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E,YAAYA,CAACvG,KAAgB,EAAE;IAC7B,OAAO,IAAI,CAACwG,UAAU,CAAC,CAAC;EAC1B;AACJ","ignoreList":[]}
@@ -20,6 +20,9 @@ export default class BasePartial extends BaseFragment {
20
20
  this.watcher = props.parentWatcher.create();
21
21
  }
22
22
  onFragmentReady() {
23
+ if (this.props.invokeVariables === false) {
24
+ return Promise.resolve();
25
+ }
23
26
  return super.onFragmentReady().then(() => {
24
27
  this.onContentReady();
25
28
  this.invokeEventCallback('onLoad', [this]);
@@ -1 +1 @@
1
- {"version":3,"names":["WmPartial","BaseFragment","BasePartial","constructor","props","_defineProperty","isPartOfPrefab","prefab","App","appConfig","app","Actions","Object","assign","Variables","serviceDefinitions","Prefab","baseUrl","watcher","parentWatcher","create","onFragmentReady","then","onContentReady","invokeEventCallback","prefabname","_this$Prefab","onComponentInit","w","targetWidget","onComponentDestroy","parent","Widgets","componentDidUpdate","prevProps","prevState","snapshot","pageParams","partialParams","fragmentVariables","renderWidget","renderPartial"],"sources":["base-partial.component.tsx"],"sourcesContent":["import { BaseComponent } from '@wavemaker/app-rn-runtime/core/base.component';\nimport WmPartial from '@wavemaker/app-rn-runtime/components/page/partial/partial.component';\nimport BaseFragment, { FragmentProps, FragmentState } from './base-fragment.component';\nimport { ReactNode } from 'react';\nimport BasePrefab from './base-prefab.component';\nimport { Watcher } from './watcher';\nexport interface PartialProps extends FragmentProps {\n serviceDefinitions: any;\n prefab: any;\n parent: any;\n onLoad?: Function;\n parentWatcher: Watcher;\n}\n\nexport interface PartialState extends FragmentState<PartialProps> {}\n\nexport default abstract class BasePartial extends BaseFragment<PartialProps, PartialState> {\n private partialParams: any = {};\n Prefab: BasePrefab = null as any;\n\n constructor(props: PartialProps) {\n super(props);\n const isPartOfPrefab = !!this.props.prefab;\n this.App = this.appConfig.app;\n this.Actions = Object.assign({}, isPartOfPrefab ? {} : this.App.Actions);\n this.Variables = Object.assign({}, isPartOfPrefab ? {} : this.App.Variables);\n this.serviceDefinitions = this.props.serviceDefinitions;\n if (isPartOfPrefab) {\n this.Prefab = this.props.prefab;\n this.baseUrl =this.Prefab.baseUrl;\n }\n this.watcher = props.parentWatcher.create();\n }\n\n onFragmentReady() {\n return super.onFragmentReady().then(() => {\n this.onContentReady();\n this.invokeEventCallback('onLoad', [this]);\n });\n }\n\n get prefabname() {\n return this.Prefab?.props.prefabname;\n }\n\n onComponentInit(w: BaseComponent<any, any, any>) {\n super.onComponentInit(w);\n if (w instanceof WmPartial) {\n this.targetWidget = w;\n }\n }\n\n onComponentDestroy(w: BaseComponent<any, any, any>): void {\n super.onComponentDestroy(w);\n const parent: any = this.props.parent;\n if (parent) {\n delete (parent as any).Widgets;\n delete (parent as any).Variables;\n }\n }\n\n componentDidUpdate(prevProps: Readonly<PartialProps>, prevState: Readonly<PartialState>, snapshot?: any): void {\n super.componentDidUpdate(prevProps, prevState, snapshot);\n const parent: any = this.props.parent;\n if (parent) {\n parent.pageParams = (this as any).pageParams;\n parent.partialParams = (this as any).pageParams;\n parent.Widgets = this.Widgets;\n parent.Variables = this.fragmentVariables;\n }\n }\n\n abstract renderPartial(): ReactNode;\n\n renderWidget(props: PartialProps) {\n return this.renderPartial();\n }\n}\n"],"mappings":";;;AACA,OAAOA,SAAS,MAAM,qEAAqE;AAC3F,OAAOC,YAAY,MAAwC,2BAA2B;AActF,eAAe,MAAeC,WAAW,SAASD,YAAY,CAA6B;EAIvFE,WAAWA,CAACC,KAAmB,EAAE;IAC7B,KAAK,CAACA,KAAK,CAAC;IAACC,eAAA,wBAJY,CAAC,CAAC;IAAAA,eAAA,iBACV,IAAI;IAIrB,MAAMC,cAAc,GAAG,CAAC,CAAC,IAAI,CAACF,KAAK,CAACG,MAAM;IAC1C,IAAI,CAACC,GAAG,GAAG,IAAI,CAACC,SAAS,CAACC,GAAG;IAC7B,IAAI,CAACC,OAAO,GAAGC,MAAM,CAACC,MAAM,CAAC,CAAC,CAAC,EAAEP,cAAc,GAAG,CAAC,CAAC,GAAG,IAAI,CA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,CAASjB,SAAS;IAClC;EACF;EAEAmB,kBAAkBA,CAACC,SAAiC,EAAEC,SAAiC,EAAEC,QAAc,EAAQ;IAC7G,KAAK,CAACH,kBAAkB,CAACC,SAAS,EAAEC,SAAS,EAAEC,QAAQ,CAAC;IACxD,MAAML,MAAW,GAAG,IAAI,CAAC3B,KAAK,CAAC2B,MAAM;IACrC,IAAIA,MAAM,EAAE;MACVA,MAAM,CAACM,UAAU,GAAI,IAAI,CAASA,UAAU;MAC5CN,MAAM,CAACO,aAAa,GAAK,IAAI,CAASD,UAAU;MAChDN,MAAM,CAACC,OAAO,GAAG,IAAI,CAACA,OAAO;MAC7BD,MAAM,CAACjB,SAAS,GAAG,IAAI,CAACyB,iBAAiB;IAC3C;EACF;EAIAC,YAAYA,CAACpC,KAAmB,EAAE;IAChC,OAAO,IAAI,CAACqC,aAAa,CAAC,CAAC;EAC7B;AACJ","ignoreList":[]}
1
+ {"version":3,"names":["WmPartial","BaseFragment","BasePartial","constructor","props","_defineProperty","isPartOfPrefab","prefab","App","appConfig","app","Actions","Object","assign","Variables","serviceDefinitions","Prefab","baseUrl","watcher","parentWatcher","create","onFragmentReady","invokeVariables","Promise","resolve","then","onContentReady","invokeEventCallback","prefabname","_this$Prefab","onComponentInit","w","targetWidget","onComponentDestroy","parent","Widgets","componentDidUpdate","prevProps","prevState","snapshot","pageParams","partialParams","fragmentVariables","renderWidget","renderPartial"],"sources":["base-partial.component.tsx"],"sourcesContent":["import React from 'react';\nimport { BaseComponent } from '@wavemaker/app-rn-runtime/core/base.component';\nimport WmPartial from '@wavemaker/app-rn-runtime/components/page/partial/partial.component';\nimport BaseFragment, { FragmentProps, FragmentState } from './base-fragment.component';\nimport { ReactNode } from 'react';\nimport BasePrefab from './base-prefab.component';\nimport { Watcher } from './watcher';\nimport { View } from 'react-native';\nimport WmLottie from '../components/basic/lottie/lottie.component';\n\nexport interface PartialProps extends FragmentProps {\n serviceDefinitions: any;\n prefab: any;\n parent: any;\n onLoad?: Function;\n parentWatcher: Watcher;\n invokeVariables: boolean;\n}\n\nexport interface PartialState extends FragmentState<PartialProps> {}\n\nexport default abstract class BasePartial extends BaseFragment<PartialProps, PartialState> {\n private partialParams: any = {};\n Prefab: BasePrefab = null as any;\n\n constructor(props: PartialProps) {\n super(props);\n const isPartOfPrefab = !!this.props.prefab;\n this.App = this.appConfig.app;\n this.Actions = Object.assign({}, isPartOfPrefab ? {} : this.App.Actions);\n this.Variables = Object.assign({}, isPartOfPrefab ? {} : this.App.Variables);\n this.serviceDefinitions = this.props.serviceDefinitions;\n if (isPartOfPrefab) {\n this.Prefab = this.props.prefab;\n this.baseUrl =this.Prefab.baseUrl;\n }\n this.watcher = props.parentWatcher.create();\n }\n\n onFragmentReady() {\n if(this.props.invokeVariables === false) {\n return Promise.resolve();\n }\n return super.onFragmentReady().then(() => {\n this.onContentReady();\n this.invokeEventCallback('onLoad', [this]);\n });\n }\n\n get prefabname() {\n return this.Prefab?.props.prefabname;\n }\n\n onComponentInit(w: BaseComponent<any, any, any>) {\n super.onComponentInit(w);\n if (w instanceof WmPartial) {\n this.targetWidget = w;\n }\n }\n\n onComponentDestroy(w: BaseComponent<any, any, any>): void {\n super.onComponentDestroy(w);\n const parent: any = this.props.parent;\n if (parent) {\n delete (parent as any).Widgets;\n delete (parent as any).Variables;\n }\n }\n\n componentDidUpdate(prevProps: Readonly<PartialProps>, prevState: Readonly<PartialState>, snapshot?: any): void {\n super.componentDidUpdate(prevProps, prevState, snapshot);\n const parent: any = this.props.parent;\n if (parent) {\n parent.pageParams = (this as any).pageParams;\n parent.partialParams = (this as any).pageParams;\n parent.Widgets = this.Widgets;\n parent.Variables = this.fragmentVariables;\n }\n }\n \n abstract renderPartial(): ReactNode;\n\n renderWidget(props: PartialProps) {\n return this.renderPartial();\n }\n}\n"],"mappings":";;;AAEA,OAAOA,SAAS,MAAM,qEAAqE;AAC3F,OAAOC,YAAY,MAAwC,2BAA2B;AAkBtF,eAAe,MAAeC,WAAW,SAASD,YAA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IACf,QAAAA,YAAA,GAAO,IAAI,CAACb,MAAM,cAAAa,YAAA,uBAAXA,YAAA,CAAazB,KAAK,CAACwB,UAAU;EACtC;EAEAE,eAAeA,CAACC,CAA+B,EAAE;IAC/C,KAAK,CAACD,eAAe,CAACC,CAAC,CAAC;IACxB,IAAIA,CAAC,YAAY/B,SAAS,EAAE;MAC1B,IAAI,CAACgC,YAAY,GAAGD,CAAC;IACvB;EACF;EAEAE,kBAAkBA,CAACF,CAA+B,EAAQ;IACxD,KAAK,CAACE,kBAAkB,CAACF,CAAC,CAAC;IAC3B,MAAMG,MAAW,GAAG,IAAI,CAAC9B,KAAK,CAAC8B,MAAM;IACrC,IAAIA,MAAM,EAAE;MACV,OAAQA,MAAM,CAASC,OAAO;MAC9B,OAAQD,MAAM,CAASpB,SAAS;IAClC;EACF;EAEAsB,kBAAkBA,CAACC,SAAiC,EAAEC,SAAiC,EAAEC,QAAc,EAAQ;IAC7G,KAAK,CAACH,kBAAkB,CAACC,SAAS,EAAEC,SAAS,EAAEC,QAAQ,CAAC;IACxD,MAAML,MAAW,GAAG,IAAI,CAAC9B,KAAK,CAAC8B,MAAM;IACrC,IAAIA,MAAM,EAAE;MACVA,MAAM,CAACM,UAAU,GAAI,IAAI,CAASA,UAAU;MAC5CN,MAAM,CAACO,aAAa,GAAK,IAAI,CAASD,UAAU;MAChDN,MAAM,CAACC,OAAO,GAAG,IAAI,CAACA,OAAO;MAC7BD,MAAM,CAACpB,SAAS,GAAG,IAAI,CAAC4B,iBAAiB;IAC3C;EACF;EAIAC,YAAYA,CAACvC,KAAmB,EAAE;IAChC,OAAO,IAAI,CAACwC,aAAa,CAAC,CAAC;EAC7B;AACJ","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["React","View","merge","PartialProvider","WmPrefabContainer","BaseFragment","axios","BasePrefab","constructor","props","defualtProps","partialService","_defineProperty","App","appConfig","app","Actions","Variables","appUrl","url","resourceBaseUrl","baseUrl","prefabname","watcher","parentWatcher","create","getServiceDefinitions","onComponentInit","w","targetWidget","onFragmentReady","_renderPrefab","component","renderPrefab","then","onContentReady","invokeEventCallback","refresh","Promise","resolve","resetAppLocale","appLocale","messages","prefabMessages","Object","values","fragments","forEach","f","componentWillUnmount","renderWidget","_props$styles","createElement","value","style","width","styles","root","_BasePrefab","prefabName","defs","SERVICE_DEFINITION_CACHE","get","catch","response","_response$data","serviceDefinitions","data","serviceDefs"],"sources":["base-prefab.component.tsx"],"sourcesContent":["import React from 'react';\nimport { View } from 'react-native';\nimport { merge } from 'lodash-es';\n\nimport { BaseComponent } from '@wavemaker/app-rn-runtime/core/base.component';\nimport PartialService, { PartialProvider } from '@wavemaker/app-rn-runtime/core/partial.service';\nimport WmPrefabContainer from '@wavemaker/app-rn-runtime/components/prefab/prefab-container.component';\nimport BaseFragment, { FragmentProps, FragmentState } from './base-fragment.component';\nimport axios from 'axios';\nimport { Watcher } from './watcher';\n\n\nexport interface PrefabProps extends FragmentProps {\n prefabname: string;\n parentWatcher: Watcher;\n}\n\nexport interface PrefabState extends FragmentState<PrefabProps> {}\n\nexport default abstract class BasePrefab extends BaseFragment<PrefabProps, PrefabState> {\n\n private static SERVICE_DEFINITION_CACHE = {} as any;\n\n public static getServiceDefinitions = (prefabName: string, url: string) => {\n const defs = BasePrefab.SERVICE_DEFINITION_CACHE[prefabName];\n if (defs) {\n return Promise.resolve(defs);\n } else {\n return axios.get(url + '/servicedefs')\n .catch(() => ({}))\n .then((response: any) => {\n const serviceDefinitions = response?.data?.serviceDefs || {};\n BasePrefab.SERVICE_DEFINITION_CACHE[prefabName] = serviceDefinitions;\n return Promise.resolve(serviceDefinitions);\n });\n }\n };\n\n private appUrl = '';\n private prefabParams: any = {};\n private _renderPrefab:() => React.ReactNode = null as any;\n\n constructor(props: PrefabProps, defualtProps: PrefabProps, private partialService: PartialService) {\n super(props, defualtProps);\n this.App = this.appConfig.app;\n this.Actions = {};\n this.Variables = {};\n this.appUrl = this.appConfig.url;\n this.resourceBaseUrl = `${this.baseUrl}/app/prefabs/${props.prefabname}`;\n this.baseUrl = `${this.baseUrl}/prefabs/${props.prefabname}`;\n this.watcher = props.parentWatcher.create();\n }\n\n getServiceDefinitions() {\n return BasePrefab.getServiceDefinitions(this.props.prefabname, `${this.appUrl}/services/prefabs/${this.props.prefabname}`);\n }\n\n onComponentInit(w: BaseComponent<any, any, any>) {\n super.onComponentInit(w);\n if (w instanceof WmPrefabContainer) {\n this.targetWidget = w;\n }\n }\n\n onFragmentReady(): Promise<void> {\n this._renderPrefab = () => {\n const component = this.renderPrefab();\n super.onFragmentReady()\n .then(() => {\n this.onContentReady();\n this.invokeEventCallback('onLoad', [null, this]);\n });\n this._renderPrefab = () => this.renderPrefab();\n return component;\n };\n this.refresh();\n return Promise.resolve();\n }\n\n resetAppLocale() {\n this.appLocale = merge({ }, this.appConfig.appLocale.messages, this.appConfig.appLocale.prefabMessages[this.props.prefabname]);\n Object.values(this.fragments).forEach((f: any) => (f as BaseFragment<any, any>).resetAppLocale());\n }\n\n componentWillUnmount() {\n super.componentWillUnmount();\n this.invokeEventCallback('onDestroy', [null, this]);\n }\n\n abstract renderPrefab(): React.ReactNode;\n\n renderWidget(props: PrefabProps) {\n return (\n <PartialProvider value={this.partialService}>\n <View style={[{width: '100%'}, props.styles?.root]}>\n {this._renderPrefab ? this._renderPrefab(): null}\n </View>\n </PartialProvider>\n );\n }\n}\n"],"mappings":";;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,IAAI,QAAQ,cAAc;AACnC,SAASC,KAAK,QAAQ,WAAW;AAGjC,SAAyBC,eAAe,QAAQ,gDAAgD;AAChG,OAAOC,iBAAiB,MAAM,wEAAwE;AACtG,OAAOC,YAAY,MAAwC,2BAA2B;AACtF,OAAOC,KAAK,MAAM,OAAO;AAWzB,eAAe,MAAeC,UAAU,SAASF,YAAY,CAA2B;EAuBpFG,WAAWA,CAACC,KAAkB,EAAEC,YAAyB,EAAUC,cAA8B,EAAE;IACjG,KAAK,CA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AAAAK,eAAA,CAAVL,UAAU,8BAEM,CAAC,CAAC;AAAAK,eAAA,CAFlBL,UAAU,2BAIE,CAACoD,UAAkB,EAAExC,GAAW,KAAK;EACzE,MAAMyC,IAAI,GAAGrD,WAAU,CAACsD,wBAAwB,CAACF,UAAU,CAAC;EAC5D,IAAIC,IAAI,EAAE;IACR,OAAOtB,OAAO,CAACC,OAAO,CAACqB,IAAI,CAAC;EAC9B,CAAC,MAAM;IACL,OAAOtD,KAAK,CAACwD,GAAG,CAAC3C,GAAG,GAAG,cAAc,CAAC,CACnC4C,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CACjB7B,IAAI,CAAE8B,QAAa,IAAK;MAAA,IAAAC,cAAA;MACrB,MAAMC,kBAAkB,GAAG,CAAAF,QAAQ,aAARA,QAAQ,gBAAAC,cAAA,GAARD,QAAQ,CAAEG,IAAI,cAAAF,cAAA,uBAAdA,cAAA,CAAgBG,WAAW,KAAI,CAAC,CAAC;MAC5D7D,WAAU,CAACsD,wBAAwB,CAACF,UAAU,CAAC,GAAGO,kBAAkB;MACpE,OAAO5B,OAAO,CAACC,OAAO,CAAC2B,kBAAkB,CAAC;IAC9C,CAAC,CAAC;EACN;AACF,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["React","View","merge","PartialProvider","WmPrefabContainer","BaseFragment","axios","BasePrefab","constructor","props","defualtProps","partialService","_defineProperty","App","appConfig","app","Actions","Variables","appUrl","url","resourceBaseUrl","baseUrl","prefabname","watcher","parentWatcher","create","getServiceDefinitions","onComponentInit","w","targetWidget","onFragmentReady","_renderPrefab","component","renderPrefab","then","onContentReady","invokeEventCallback","refresh","Promise","resolve","resetAppLocale","appLocale","messages","prefabMessages","Object","values","fragments","forEach","f","componentWillUnmount","renderWidget","_props$styles","createElement","value","style","width","styles","root","_BasePrefab","prefabName","defs","SERVICE_DEFINITION_CACHE","get","catch","response","_response$data","serviceDefinitions","data","serviceDefs"],"sources":["base-prefab.component.tsx"],"sourcesContent":["import React from 'react';\nimport { View } from 'react-native';\nimport { merge } from 'lodash-es';\n\nimport { BaseComponent } from '@wavemaker/app-rn-runtime/core/base.component';\nimport PartialService, { PartialProvider } from '@wavemaker/app-rn-runtime/core/partial.service';\nimport WmPrefabContainer from '@wavemaker/app-rn-runtime/components/prefab/prefab-container.component';\nimport BaseFragment, { FragmentProps, FragmentState } from './base-fragment.component';\nimport axios from 'axios';\nimport { Watcher } from './watcher';\nimport WmLottie from '../components/basic/lottie/lottie.component';\n\n\nexport interface PrefabProps extends FragmentProps {\n prefabname: string;\n parentWatcher: Watcher;\n}\n\nexport interface PrefabState extends FragmentState<PrefabProps> {}\n\nexport default abstract class BasePrefab extends BaseFragment<PrefabProps, PrefabState> {\n\n private static SERVICE_DEFINITION_CACHE = {} as any;\n\n public static getServiceDefinitions = (prefabName: string, url: string) => {\n const defs = BasePrefab.SERVICE_DEFINITION_CACHE[prefabName];\n if (defs) {\n return Promise.resolve(defs);\n } else {\n return axios.get(url + '/servicedefs')\n .catch(() => ({}))\n .then((response: any) => {\n const serviceDefinitions = response?.data?.serviceDefs || {};\n BasePrefab.SERVICE_DEFINITION_CACHE[prefabName] = serviceDefinitions;\n return Promise.resolve(serviceDefinitions);\n });\n }\n };\n\n private appUrl = '';\n private prefabParams: any = {};\n private _renderPrefab:() => React.ReactNode = null as any;\n\n constructor(props: PrefabProps, defualtProps: PrefabProps, private partialService: PartialService) {\n super(props, defualtProps);\n this.App = this.appConfig.app;\n this.Actions = {};\n this.Variables = {};\n this.appUrl = this.appConfig.url;\n this.resourceBaseUrl = `${this.baseUrl}/app/prefabs/${props.prefabname}`;\n this.baseUrl = `${this.baseUrl}/prefabs/${props.prefabname}`;\n this.watcher = props.parentWatcher.create();\n }\n\n getServiceDefinitions() {\n return BasePrefab.getServiceDefinitions(this.props.prefabname, `${this.appUrl}/services/prefabs/${this.props.prefabname}`);\n }\n\n onComponentInit(w: BaseComponent<any, any, any>) {\n super.onComponentInit(w);\n if (w instanceof WmPrefabContainer) {\n this.targetWidget = w;\n }\n }\n\n onFragmentReady(): Promise<void> {\n this._renderPrefab = () => {\n const component = this.renderPrefab();\n super.onFragmentReady()\n .then(() => {\n this.onContentReady();\n this.invokeEventCallback('onLoad', [null, this]);\n });\n this._renderPrefab = () => this.renderPrefab();\n return component;\n };\n this.refresh();\n return Promise.resolve();\n }\n\n resetAppLocale() {\n this.appLocale = merge({ }, this.appConfig.appLocale.messages, this.appConfig.appLocale.prefabMessages[this.props.prefabname]);\n Object.values(this.fragments).forEach((f: any) => (f as BaseFragment<any, any>).resetAppLocale());\n }\n\n componentWillUnmount() {\n super.componentWillUnmount();\n this.invokeEventCallback('onDestroy', [null, this]);\n }\n\n abstract renderPrefab(): React.ReactNode;\n \n renderWidget(props: PrefabProps) {\n return (\n <PartialProvider value={this.partialService}>\n <View style={[{width: '100%'}, props.styles?.root]}>\n {this._renderPrefab ? this._renderPrefab(): null}\n </View>\n </PartialProvider>\n );\n }\n}\n"],"mappings":";;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,IAAI,QAAQ,cAAc;AACnC,SAASC,KAAK,QAAQ,WAAW;AAGjC,SAAyBC,eAAe,QAAQ,gDAAgD;AAChG,OAAOC,iBAAiB,MAAM,wEAAwE;AACtG,OAAOC,YAAY,MAAwC,2BAA2B;AACtF,OAAOC,KAAK,MAAM,OAAO;AAYzB,eAAe,MAAeC,UAAU,SAASF,YAAY,CAA2B;EAuBpFG,WAAWA,CAACC,KAAkB,EAAEC,YAAyB,EAAUC,cAA8B,EAAE;IACjG,KAAK,CAACF,KAAK,EAAEC,YAAY,CAAC;IAAC,KADsCC,cAA8B,GAA9BA,cAA8B;IAAAC,eAAA,iBAJhF,EAAE;IAAAA,eAAA,uBACS,CAAC,CAAC;IAAAA,eAAA,wBACgB,IAAI;IAIhD,IAAI,CAACC,GAAG,GAAG,IAAI,CAACC,SAAS,CAACC,GAAG;IAC7B,IAAI,CAACC,OAAO,GAAG,CAAC,CAAC;IACjB,IAA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,CAAC,MAAM;IACL,OAAOtD,KAAK,CAACwD,GAAG,CAAC3C,GAAG,GAAG,cAAc,CAAC,CACnC4C,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CACjB7B,IAAI,CAAE8B,QAAa,IAAK;MAAA,IAAAC,cAAA;MACrB,MAAMC,kBAAkB,GAAG,CAAAF,QAAQ,aAARA,QAAQ,gBAAAC,cAAA,GAARD,QAAQ,CAAEG,IAAI,cAAAF,cAAA,uBAAdA,cAAA,CAAgBG,WAAW,KAAI,CAAC,CAAC;MAC5D7D,WAAU,CAACsD,wBAAwB,CAACF,UAAU,CAAC,GAAGO,kBAAkB;MACpE,OAAO5B,OAAO,CAACC,OAAO,CAAC2B,kBAAkB,CAAC;IAC9C,CAAC,CAAC;EACN;AACF,CAAC","ignoreList":[]}
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { createDrawerNavigator } from '@react-navigation/drawer';
2
+ import { createDrawerNavigator, getDrawerStatusFromState } from '@react-navigation/drawer';
3
3
  import ThemeVariables from '@wavemaker/app-rn-runtime/styles/theme.variables';
4
4
  const Drawer = createDrawerNavigator();
5
5
  class AppDrawerNavigator extends React.Component {
@@ -11,15 +11,24 @@ class AppDrawerNavigator extends React.Component {
11
11
  initialRouteName: "pages",
12
12
  drawerContent: this.props.content,
13
13
  useLegacyImplementation: false,
14
- screenOptions: {
15
- drawerType: this.props.type,
16
- headerShown: false,
17
- gestureHandlerProps: {
18
- enabled: !this.props.hide
19
- },
20
- drawerStyle: {
21
- backgroundColor: ThemeVariables.INSTANCE.pageContentBgColor
22
- }
14
+ screenOptions: ({
15
+ navigation
16
+ }) => {
17
+ const widthStyle = this.props.drawerWidth && getDrawerStatusFromState(navigation.getState()) === 'open' ? {
18
+ width: this.props.drawerWidth,
19
+ maxWidth: null
20
+ } : {};
21
+ return {
22
+ drawerType: this.props.type,
23
+ headerShown: false,
24
+ gestureHandlerProps: {
25
+ enabled: !this.props.hide
26
+ },
27
+ drawerStyle: {
28
+ backgroundColor: ThemeVariables.INSTANCE.pageContentBgColor,
29
+ ...widthStyle
30
+ }
31
+ };
23
32
  }
24
33
  }, /*#__PURE__*/React.createElement(Drawer.Screen, {
25
34
  name: "pages"
@@ -1 +1 @@
1
- {"version":3,"names":["React","createDrawerNavigator","ThemeVariables","Drawer","AppDrawerNavigator","Component","constructor","props","render","createElement","Navigator","initialRouteName","drawerContent","content","useLegacyImplementation","screenOptions","drawerType","type","headerShown","gestureHandlerProps","enabled","hide","drawerStyle","backgroundColor","INSTANCE","pageContentBgColor","Screen","name","_props","rootComponent"],"sources":["drawer.navigator.tsx"],"sourcesContent":["import React, { ReactNode } from 'react';\nimport { createDrawerNavigator } from '@react-navigation/drawer';\nimport ThemeVariables from '@wavemaker/app-rn-runtime/styles/theme.variables';\nconst Drawer = createDrawerNavigator();\n\ninterface AppDrawerNavigatorProps {\n content: (props: any) => ReactNode;\n hide: boolean,\n type: any;\n rootComponent: React.ReactNode;\n}\n\nclass AppDrawerNavigator extends React.Component<AppDrawerNavigatorProps, any, any> {\n\n constructor(props: AppDrawerNavigatorProps) {\n super(props);\n }\n\n render(){\n return (<Drawer.Navigator\n initialRouteName=\"pages\"\n drawerContent={this.props.content}\n useLegacyImplementation={false}\n screenOptions={{\n drawerType: this.props.type,\n headerShown: false,\n gestureHandlerProps: { enabled: !this.props.hide },\n drawerStyle: { backgroundColor: ThemeVariables.INSTANCE.pageContentBgColor }\n }}>\n <Drawer.Screen name=\"pages\">\n {(_props) => this.props.rootComponent}\n </Drawer.Screen>\n </Drawer.Navigator>);\n }\n}\n\nexport default AppDrawerNavigator;\n"],"mappings":"AAAA,OAAOA,KAAK,MAAqB,OAAO;AACxC,SAASC,qBAAqB,QAAQ,0BAA0B;AAChE,OAAOC,cAAc,MAAM,kDAAkD;AAC7E,MAAMC,MAAM,GAAGF,qBAAqB,CAAC,CAAC;AAStC,MAAMG,kBAAkB,SAASJ,KAAK,CAACK,SAAS,CAAoC;EAElFC,WAAWA,CAACC,KAA8B,EAAE;IAC1C,KAAK,CAACA,KAAK,CAAC;EACd;EAEAC,MAAMA,CAAA,EAAE;IACN,oBAAQR,KAAA,CAAAS,aAAA,CAACN,MAAM,CAACO,SAAS;MACvBC,gBAAgB,EAAC,OAAO;MACxBC,aAAa,EAAE,IAAI,CAACL,KAAK,CAACM,OAAQ;MAClCC,uBAAuB,EAAE,KAAM;MAC/BC,aAAa,EAAE;QACXC,UAAU,EAAE,IAAI,CAACT,KAAK,CAACU,IAAI;QAC3BC,WAAW,EAAE,KAAK;QAClBC,mBAAmB,EAAE;UAAEC,OAAO,EAAE,CAAC,IAAI,CAACb,KAAK,CAACc;QAAK,CAAC;QAClDC,WAAW,EAAE;UAAEC,eAAe,EAAGrB,cAAc,CAACsB,QAAQ,CAACC;QAAmB;MAChF;IAAE,gBACFzB,KAAA,CAAAS,aAAA,CAACN,MAAM,CAACuB,MAAM;MAACC,IAAI,EAAC;IAAO,GACvBC,MAAM,IAAK,IAAI,CAACrB,KAAK,CAACsB,aACX,CACC,CAAC;EACrB;AACF;AAEA,eAAezB,kBAAkB","ignoreList":[]}
1
+ {"version":3,"names":["React","createDrawerNavigator","getDrawerStatusFromState","ThemeVariables","Drawer","AppDrawerNavigator","Component","constructor","props","render","createElement","Navigator","initialRouteName","drawerContent","content","useLegacyImplementation","screenOptions","navigation","widthStyle","drawerWidth","getState","width","maxWidth","drawerType","type","headerShown","gestureHandlerProps","enabled","hide","drawerStyle","backgroundColor","INSTANCE","pageContentBgColor","Screen","name","_props","rootComponent"],"sources":["drawer.navigator.tsx"],"sourcesContent":["import React, { ReactNode } from 'react';\nimport { createDrawerNavigator, getDrawerStatusFromState } from '@react-navigation/drawer';\nimport ThemeVariables from '@wavemaker/app-rn-runtime/styles/theme.variables';\nconst Drawer = createDrawerNavigator();\n\ninterface AppDrawerNavigatorProps {\n content: (props: any) => ReactNode;\n hide: boolean,\n drawerWidth: any;\n type: any;\n rootComponent: React.ReactNode;\n}\n\nclass AppDrawerNavigator extends React.Component<AppDrawerNavigatorProps, any, any> {\n\n constructor(props: AppDrawerNavigatorProps) {\n super(props);\n }\n\n render(){\n return (<Drawer.Navigator\n initialRouteName=\"pages\"\n drawerContent={this.props.content}\n useLegacyImplementation={false}\n screenOptions={({navigation})=> {\n const widthStyle = (this.props.drawerWidth && getDrawerStatusFromState(navigation.getState()) === 'open' ? {width: this.props.drawerWidth, maxWidth: null} : {})\n return {\n drawerType: this.props.type,\n headerShown: false,\n gestureHandlerProps: { enabled: !this.props.hide },\n drawerStyle: { backgroundColor: ThemeVariables.INSTANCE.pageContentBgColor, ...widthStyle}}\n }}>\n <Drawer.Screen name=\"pages\">\n {(_props) => this.props.rootComponent}\n </Drawer.Screen>\n </Drawer.Navigator>);\n }\n}\n\nexport default AppDrawerNavigator;\n"],"mappings":"AAAA,OAAOA,KAAK,MAAqB,OAAO;AACxC,SAASC,qBAAqB,EAAEC,wBAAwB,QAAQ,0BAA0B;AAC1F,OAAOC,cAAc,MAAM,kDAAkD;AAC7E,MAAMC,MAAM,GAAGH,qBAAqB,CAAC,CAAC;AAUtC,MAAMI,kBAAkB,SAASL,KAAK,CAACM,SAAS,CAAoC;EAElFC,WAAWA,CAACC,KAA8B,EAAE;IAC1C,KAAK,CAACA,KAAK,CAAC;EACd;EAEAC,MAAMA,CAAA,EAAE;IACN,oBAAQT,KAAA,CAAAU,aAAA,CAACN,MAAM,CAACO,SAAS;MACvBC,gBAAgB,EAAC,OAAO;MACxBC,aAAa,EAAE,IAAI,CAACL,KAAK,CAACM,OAAQ;MAClCC,uBAAuB,EAAE,KAAM;MAC/BC,aAAa,EAAEA,CAAC;QAACC;MAAU,CAAC,KAAI;QAC9B,MAAMC,UAAU,GAAI,IAAI,CAACV,KAAK,CAACW,WAAW,IAAIjB,wBAAwB,CAACe,UAAU,CAACG,QAAQ,CAAC,CAAC,CAAC,KAAK,MAAM,GAAG;UAACC,KAAK,EAAE,IAAI,CAACb,KAAK,CAACW,WAAW;UAAEG,QAAQ,EAAE;QAAI,CAAC,GAAG,CAAC,CAAE;QAChK,OAAO;UACLC,UAAU,EAAE,IAAI,CAACf,KAAK,CAACgB,IAAI;UAC3BC,WAAW,EAAE,KAAK;UAClBC,mBAAmB,EAAE;YAAEC,OAAO,EAAE,CAAC,IAAI,CAACnB,KAAK,CAACoB;UAAK,CAAC;UAClDC,WAAW,EAAE;YAAEC,eAAe,EAAG3B,cAAc,CAAC4B,QAAQ,CAACC,kBAAkB;YAAE,GAAGd;UAAU;QAAC,CAAC;MAChG;IAAE,gBACFlB,KAAA,CAAAU,aAAA,CAACN,MAAM,CAAC6B,MAAM;MAACC,IAAI,EAAC;IAAO,GACvBC,MAAM,IAAK,IAAI,CAAC3B,KAAK,CAAC4B,aACX,CACC,CAAC;EACrB;AACF;AAEA,eAAe/B,kBAAkB","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["React","View","createStackNavigator","ThemeVariables","Stack","pages","Screen","Component","constructor","props","_defineProperty","state","renew","page","createPage","navigation","cleanUp","push","addListener","setState","createElement","route","name","component","destroyMe","setTimeout","componentWillUnmount","forEach","fn","render","getPageId","pageName","pageParams","pageParamsStr","Object","keys","sort","map","k","join","AppStackNavigator","Navigator","initialRouteName","landingPage","p","key","getId","params","options","headerShown","cardStyle","backgroundColor","INSTANCE","pageContentBgColor"],"sources":["stack.navigator.tsx"],"sourcesContent":["import React from 'react';\nimport { View } from 'react-native';\nimport { createStackNavigator } from '@react-navigation/stack';\nimport ThemeVariables from '@wavemaker/app-rn-runtime/styles/theme.variables';\n\nconst Stack = createStackNavigator();\n\ninterface AppStackNavigatorProps {\n pages: any[];\n landingPage: string; \n}\n\nconst pages = {} as any;\n\nclass Screen extends React.Component {\n\n private cleanUp = [] as Function[];\n\n constructor(props: any) {\n super(props);\n this.state = {\n renew: false,\n page: this.createPage()\n };\n const navigation = (this.props as any).navigation as any;\n this.cleanUp.push(navigation.addListener('focus', () => {\n const state = (this.state as any);\n if (state.renew) {\n state.page = this.createPage();\n this.setState(() => ({\n renew: false,\n page: state.page\n }));\n }\n }));\n }\n\n private createPage() {\n const props = this.props as any;\n return React.createElement(pages[props.route.name].component, {...props, destroyMe: () => {\n setTimeout(() => {\n this.setState(() => ({renew: true, page: null}));\n }, 100);\n }});\n }\n\n componentWillUnmount() {\n this.cleanUp.forEach(fn => fn && fn());\n }\n\n render() {\n return (this.state as any).page || (<View/>);\n }\n}\n\nconst getPageId = (pageName: string, pageParams: any) => {\n const pageParamsStr = pageParams ? Object.keys(pageParams)\n .sort()\n .map((k: string) => `${k}=${pageParams[k]}`)\n .join('&') : '';\n return `${pageName}?${pageParamsStr}`;\n}\n\nconst AppStackNavigator = (props: AppStackNavigatorProps) => {\n return (<Stack.Navigator initialRouteName={props.landingPage}>\n {props.pages.map(p => {\n pages[p.name] = p;\n return (\n <Stack.Screen key={p.name}\n name={p.name}\n component={Screen}\n getId={({params}) => getPageId(p.name, params)}\n options={{\n headerShown: false,\n cardStyle: {\n backgroundColor: ThemeVariables.INSTANCE.pageContentBgColor\n }\n }}\n />);\n })}\n </Stack.Navigator>);\n};\n\nexport default AppStackNavigator;"],"mappings":";;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,IAAI,QAAQ,cAAc;AACnC,SAASC,oBAAoB,QAAQ,yBAAyB;AAC9D,OAAOC,cAAc,MAAM,kDAAkD;AAE7E,MAAMC,KAAK,GAAGF,oBAAoB,CAAC,CAAC;AAOpC,MAAMG,KAAK,GAAG,CAAC,CAAQ;AAEvB,MAAMC,MAAM,SAASN,KAAK,CAACO,SAAS,CAAC;EAInCC,WAAWA,CAACC,KAAU,EAAE;IACtB,KAAK,CAACA,KAAK,CAAC;IAACC,eAAA,kBAHG,EAAE;IAIlB,IAAI,CAACC,KAAK,GAAG;MACXC,KAAK,EAAE,KAAK;MACZC,IAAI,EAAE,IAAI,CAACC,UAAU,CAAC;IACxB,CAAC;IACD,MAAMC,UAAU,GAAI,IAAI,CAACN,KAAK,CAASM,UAAiB;IACxD,I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IAAM,GAAEA,CAAE,IAAGN,UAAU,CAACM,CAAC,CAAE,EAAC,CAAC,CAC3CC,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE;EACjB,OAAQ,GAAER,QAAS,IAAGE,aAAc,EAAC;AACvC,CAAC;AAED,MAAMO,iBAAiB,GAAI/B,KAA6B,IAAK;EAC3D,oBAAQT,KAAA,CAAAoB,aAAA,CAAChB,KAAK,CAACqC,SAAS;IAACC,gBAAgB,EAAEjC,KAAK,CAACkC;EAAY,GAC1DlC,KAAK,CAACJ,KAAK,CAACgC,GAAG,CAACO,CAAC,IAAI;IACpBvC,KAAK,CAACuC,CAAC,CAACtB,IAAI,CAAC,GAAGsB,CAAC;IACjB,oBACE5C,KAAA,CAAAoB,aAAA,CAAChB,KAAK,CAACE,MAAM;MAACuC,GAAG,EAAED,CAAC,CAACtB,IAAK;MACxBA,IAAI,EAAEsB,CAAC,CAACtB,IAAK;MACbC,SAAS,EAAEjB,MAAO;MAClBwC,KAAK,EAAEA,CAAC;QAACC;MAAM,CAAC,KAAKjB,SAAS,CAACc,CAAC,CAACtB,IAAI,EAAEyB,MAAM,CAAE;MAC/CC,OAAO,EAAE;QACPC,WAAW,EAAE,KAAK;QAClBC,SAAS,EAAE;UACTC,eAAe,EAAEhD,cAAc,CAACiD,QAAQ,CAACC;QAC3C;MACF;IAAE,CACH,CAAC;EACJ,CAAC,CACY,CAAC;AACpB,CAAC;AAED,eAAeb,iBAAiB","ignoreList":[]}
1
+ {"version":3,"names":["React","View","createStackNavigator","ThemeVariables","Stack","pages","Screen","Component","constructor","props","_defineProperty","state","renew","page","createPage","navigation","cleanUp","push","addListener","setState","createElement","route","name","component","destroyMe","setTimeout","componentWillUnmount","forEach","fn","render","getPageId","pageName","pageParams","pageParamsStr","Object","keys","sort","map","k","join","AppStackNavigator","Navigator","initialRouteName","landingPage","p","key","getId","params","options","headerShown","cardStyle","backgroundColor","INSTANCE","pageContentBgColor"],"sources":["stack.navigator.tsx"],"sourcesContent":["import React from 'react';\nimport { View } from 'react-native';\nimport { createStackNavigator } from '@react-navigation/stack';\nimport ThemeVariables from '@wavemaker/app-rn-runtime/styles/theme.variables';\n\nconst Stack = createStackNavigator();\n\ninterface AppStackNavigatorProps {\n pages: any[];\n landingPage: string; \n}\n\nconst pages = {} as any;\n\nclass Screen extends React.Component {\n\n private cleanUp = [] as Function[];\n\n constructor(props: any) {\n super(props);\n this.state = {\n renew: false,\n page: this.createPage()\n };\n const navigation = (this.props as any).navigation as any;\n this.cleanUp.push(navigation.addListener('focus', () => {\n const state = (this.state as any);\n if (state.renew) {\n state.page = this.createPage();\n this.setState(() => ({\n renew: false,\n page: state.page\n }));\n }\n }));\n }\n\n private createPage() {\n const props = this.props as any;\n return React.createElement(pages[props.route.name].component, {...props, destroyMe: () => {\n setTimeout(() => {\n this.setState(() => ({renew: true, page: null}));\n }, 100);\n }});\n }\n\n componentWillUnmount() {\n this.cleanUp.forEach(fn => fn && fn());\n }\n\n render() {\n return (this.state as any).page || (<View/>);\n }\n}\n\nconst getPageId = (pageName: string, pageParams: any) => {\n const pageParamsStr = pageParams ? Object.keys(pageParams)\n .sort()\n .map((k: string) => `${k}=${pageParams[k]}`)\n .join('&') : '';\n return `${pageName}?${pageParamsStr}`;\n}\n\nconst AppStackNavigator = (props: AppStackNavigatorProps) => {\n return (<Stack.Navigator initialRouteName={props.landingPage}>\n {props.pages.map(p => {\n pages[p.name] = p;\n return (\n <Stack.Screen key={p.name}\n name={p.name}\n component={Screen}\n getId={({params}) => getPageId(p.name, params)}\n options={{\n headerShown: false,\n cardStyle: {\n backgroundColor: ThemeVariables.INSTANCE.pageContentBgColor\n }\n }}\n />);\n })}\n </Stack.Navigator>);\n};\n\nexport default AppStackNavigator;"],"mappings":";;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,IAAI,QAAQ,cAAc;AACnC,SAASC,oBAAoB,QAAQ,yBAAyB;AAC9D,OAAOC,cAAc,MAAM,kDAAkD;AAE7E,MAAMC,K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,CAAC,CACY,CAAC;AACpB,CAAC;AAED,eAAeb,iBAAiB","ignoreList":[]}
@@ -51,6 +51,16 @@ class AppI18nService {
51
51
  });
52
52
  });
53
53
  }
54
+
55
+ // app defaults support same as web
56
+ get appDefaults() {
57
+ return {
58
+ dateFormat: this.dateFormat,
59
+ timeFormat: this.timeFormat,
60
+ currencyCode: this.currencyCode,
61
+ dateTimeFormat: this.dateTimeFormat
62
+ };
63
+ }
54
64
  setTimezone(timezone) {
55
65
  this.timezone = timezone;
56
66
  }
@@ -1 +1 @@
1
- {"version":3,"names":["axios","StorageService","isWebPreviewMode","I18nManager","APP_LOCALE_ROOT_PATH","STORAGE_KEY","RTL_LANGUAGE_CODES","map","forEach","v","AppI18nService","constructor","_defineProperty","init","selectedLocale","getItem","isRTLLocale","newLocale","setRTL","locale","flag","needsRestart","isRTL","forceRTL","loadAppLocaleBundle","url","Promise","resolve","then","path","get","bundle","dateFormat","data","formats","date","timeFormat","time","currencyCode","currency","dateTimeFormat","catch","console","warn","setTimezone","timezone","getTimezone","setSelectedLocale","setItem","getSelectedLocale","i18nService"],"sources":["app-i18n.service.tsx"],"sourcesContent":["import axios, { AxiosResponse } from 'axios';\nimport StorageService from '@wavemaker/app-rn-runtime/core/storage.service';\nimport { isWebPreviewMode } from '@wavemaker/app-rn-runtime/core/utils';\nimport { I18nManager, Platform } from 'react-native';\nimport { I18nService } from '@wavemaker/app-rn-runtime/core/i18n.service';\n\nconst APP_LOCALE_ROOT_PATH = '/resources/i18n';\nconst STORAGE_KEY = 'selectedLocale';\nconst RTL_LANGUAGE_CODES = (()=>{\n const map = {} as any;\n [\"ar\", \"ar-001\", \"ar-ae\", \"ar-bh\", \"ar-dz\", \"ar-eg\", \"ar-iq\", \"ar-jo\", \"ar-kw\", \"ar-lb\",\n \"ar-ly\", \"ar-ma\", \"ar-om\", \"ar-qa\", \"ar-sa\", \"ar-sd\", \"ar-sy\", \"ar-tn\", \"ar-ye\", \"arc\",\n \"bcc\", \"bqi\", \"ckb\", \"dv\", \"fa\", \"glk\", \"he\", \"ku\", \"mzn\", \"pnb\", \"ps\", \"sd\", \"ug\", \"ur\", \"yi\"].forEach(v=>{\n map[v] = true;\n });\n return map;\n })();\n\nclass AppI18nService implements I18nService{\n appLocale: any;\n defaultSupportedLocale = 'en';\n selectedLocale: any;\n dateFormat: string = '';\n timeFormat: string = '';\n dateTimeFormat: string = '';\n currencyCode: string = '';\n timezone: string = '';\n\n constructor() {}\n\n async init() {\n this.selectedLocale = await StorageService.getItem(STORAGE_KEY);\n }\n\n isRTLLocale(newLocale: string = this.selectedLocale){\n return !!(newLocale && RTL_LANGUAGE_CODES[newLocale]);\n }\n\n setRTL(locale?: string){\n const flag = this.isRTLLocale(locale);\n const needsRestart = !isWebPreviewMode() && I18nManager.isRTL !== flag;\n I18nManager.forceRTL(flag);\n return needsRestart; \n }\n\n loadAppLocaleBundle(url: string) {\n return Promise.resolve().then(() => {\n const path = `${url + APP_LOCALE_ROOT_PATH}/${this.selectedLocale}.json`;\n return axios.get(path)\n .then((bundle) => {\n this.dateFormat = bundle.data.formats.date;\n this.timeFormat = bundle.data.formats.time;\n this.currencyCode = bundle.data.formats.currency;\n this.dateTimeFormat = this.dateFormat + ' ' + this.timeFormat;\n return bundle;\n })\n .catch(() => {\n console.warn(`error loading locale resource from ${path}`);\n });\n\n });\n }\n\n setTimezone(timezone: string){\n this.timezone = timezone;\n }\n\n getTimezone(){\n return this.timezone;\n }\n\n setSelectedLocale(locale: string) {\n this.selectedLocale = locale;\n StorageService.setItem(STORAGE_KEY, locale);\n return this.setRTL(locale);\n }\n\n getSelectedLocale() {\n return this.selectedLocale;\n }\n}\n\nconst i18nService = new AppI18nService();\n\nexport default i18nService;\n"],"mappings":";;;AAAA,OAAOA,KAAK,MAAyB,OAAO;AAC5C,OAAOC,cAAc,MAAM,gDAAgD;AAC3E,SAASC,gBAAgB,QAAQ,sCAAsC;AACvE,SAASC,WAAW,QAAkB,cAAc;AAGpD,MAAMC,oBAAo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CAAC;IAC3C,OAAO,IAAI,CAACD,MAAM,CAACC,MAAM,CAAC;EAC9B;EAEA8B,iBAAiBA,CAAA,EAAG;IAClB,OAAO,IAAI,CAACnC,cAAc;EAC5B;AACJ;AAEA,MAAMoC,WAAW,GAAG,IAAIxC,cAAc,CAAC,CAAC;AAExC,eAAewC,WAAW","ignoreList":[]}
1
+ {"version":3,"names":["axios","StorageService","isWebPreviewMode","I18nManager","APP_LOCALE_ROOT_PATH","STORAGE_KEY","RTL_LANGUAGE_CODES","map","forEach","v","AppI18nService","constructor","_defineProperty","init","selectedLocale","getItem","isRTLLocale","newLocale","setRTL","locale","flag","needsRestart","isRTL","forceRTL","loadAppLocaleBundle","url","Promise","resolve","then","path","get","bundle","dateFormat","data","formats","date","timeFormat","time","currencyCode","currency","dateTimeFormat","catch","console","warn","appDefaults","setTimezone","timezone","getTimezone","setSelectedLocale","setItem","getSelectedLocale","i18nService"],"sources":["app-i18n.service.tsx"],"sourcesContent":["import axios, { AxiosResponse } from 'axios';\nimport StorageService from '@wavemaker/app-rn-runtime/core/storage.service';\nimport { isWebPreviewMode } from '@wavemaker/app-rn-runtime/core/utils';\nimport { I18nManager, Platform } from 'react-native';\nimport { I18nService } from '@wavemaker/app-rn-runtime/core/i18n.service';\n\nconst APP_LOCALE_ROOT_PATH = '/resources/i18n';\nconst STORAGE_KEY = 'selectedLocale';\nconst RTL_LANGUAGE_CODES = (()=>{\n const map = {} as any;\n [\"ar\", \"ar-001\", \"ar-ae\", \"ar-bh\", \"ar-dz\", \"ar-eg\", \"ar-iq\", \"ar-jo\", \"ar-kw\", \"ar-lb\",\n \"ar-ly\", \"ar-ma\", \"ar-om\", \"ar-qa\", \"ar-sa\", \"ar-sd\", \"ar-sy\", \"ar-tn\", \"ar-ye\", \"arc\",\n \"bcc\", \"bqi\", \"ckb\", \"dv\", \"fa\", \"glk\", \"he\", \"ku\", \"mzn\", \"pnb\", \"ps\", \"sd\", \"ug\", \"ur\", \"yi\"].forEach(v=>{\n map[v] = true;\n });\n return map;\n })();\n\nclass AppI18nService implements I18nService{\n appLocale: any;\n defaultSupportedLocale = 'en';\n selectedLocale: any;\n dateFormat: string = '';\n timeFormat: string = '';\n dateTimeFormat: string = '';\n currencyCode: string = '';\n timezone: string = '';\n\n constructor() {}\n\n async init() {\n this.selectedLocale = await StorageService.getItem(STORAGE_KEY);\n }\n\n isRTLLocale(newLocale: string = this.selectedLocale){\n return !!(newLocale && RTL_LANGUAGE_CODES[newLocale]);\n }\n\n setRTL(locale?: string){\n const flag = this.isRTLLocale(locale);\n const needsRestart = !isWebPreviewMode() && I18nManager.isRTL !== flag;\n I18nManager.forceRTL(flag);\n return needsRestart; \n }\n\n loadAppLocaleBundle(url: string) {\n return Promise.resolve().then(() => {\n const path = `${url + APP_LOCALE_ROOT_PATH}/${this.selectedLocale}.json`;\n return axios.get(path)\n .then((bundle) => {\n this.dateFormat = bundle.data.formats.date;\n this.timeFormat = bundle.data.formats.time;\n this.currencyCode = bundle.data.formats.currency;\n this.dateTimeFormat = this.dateFormat + ' ' + this.timeFormat;\n return bundle;\n })\n .catch(() => {\n console.warn(`error loading locale resource from ${path}`);\n });\n\n });\n }\n\n // app defaults support same as web \n get appDefaults(){\n return {\n dateFormat : this.dateFormat,\n timeFormat : this.timeFormat,\n currencyCode: this.currencyCode,\n dateTimeFormat: this.dateTimeFormat\n }\n }\n\n setTimezone(timezone: string){\n this.timezone = timezone;\n }\n\n getTimezone(){\n return this.timezone;\n }\n\n setSelectedLocale(locale: string) {\n this.selectedLocale = locale;\n StorageService.setItem(STORAGE_KEY, locale);\n return this.setRTL(locale);\n }\n\n getSelectedLocale() {\n return this.selectedLocale;\n }\n}\n\nconst i18nService = new AppI18nService();\n\nexport default i18nService;\n"],"mappings":";;;AAAA,OAAOA,KAAK,MAAyB,OAAO;AAC5C,OAAOC,cAAc,MAAM,gDAAgD;AAC3E,SAASC,gBAAgB,QAAQ,sCAAsC;AACvE,SAASC,WAAW,QAAkB,cAAc;AAGpD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,QAAQ,GAAGA,QAAQ;EAC1B;EAEAC,WAAWA,CAAA,EAAE;IACX,OAAO,IAAI,CAACD,QAAQ;EACtB;EAEAE,iBAAiBA,CAAC7B,MAAc,EAAE;IAC9B,IAAI,CAACL,cAAc,GAAGK,MAAM;IAC5BlB,cAAc,CAACgD,OAAO,CAAC5C,WAAW,EAAEc,MAAM,CAAC;IAC3C,OAAO,IAAI,CAACD,MAAM,CAACC,MAAM,CAAC;EAC9B;EAEA+B,iBAAiBA,CAAA,EAAG;IAClB,OAAO,IAAI,CAACpC,cAAc;EAC5B;AACJ;AAEA,MAAMqC,WAAW,GAAG,IAAIzC,cAAc,CAAC,CAAC;AAExC,eAAeyC,WAAW","ignoreList":[]}
@@ -8,6 +8,7 @@ import networkService from '@wavemaker/app-rn-runtime/core/network.service';
8
8
  import injector from '@wavemaker/app-rn-runtime/core/injector';
9
9
  import StorageService from '@wavemaker/app-rn-runtime/core/storage.service';
10
10
  import WebProcessService from './webprocess.service';
11
+ import { isWebPreviewMode } from '@wavemaker/app-rn-runtime/core/utils';
11
12
  var USER_ROLE = /*#__PURE__*/function (USER_ROLE) {
12
13
  USER_ROLE["EVERYONE"] = "Everyone";
13
14
  USER_ROLE["ANONYMOUS"] = "Anonymous";
@@ -27,6 +28,19 @@ class AppSecurityService {
27
28
  _defineProperty(this, "baseUrl", '');
28
29
  _defineProperty(this, "defaultSecurityConfig", void 0);
29
30
  _defineProperty(this, "landingPage", '');
31
+ _defineProperty(this, "getRegex", str => {
32
+ const wm_xsrf_token_index = str.indexOf('wm_xsrf_token') + 13; // 13 is the length of 'wm_xsrf_token' string
33
+ let index = wm_xsrf_token_index;
34
+ while (str[index] !== ':') {
35
+ index++;
36
+ }
37
+ const regExp = str.substring(wm_xsrf_token_index, index);
38
+ return new RegExp(regExp, "g");
39
+ });
40
+ _defineProperty(this, "formateData", data => {
41
+ const regex = this.getRegex(data);
42
+ return JSON.parse(data.replace(regex, "\""));
43
+ });
30
44
  axios.interceptors.request.use(config => this.onBeforeServiceCall(config));
31
45
  }
32
46
  onBeforeServiceCall(config) {
@@ -90,6 +104,14 @@ class AppSecurityService {
90
104
  });
91
105
  }
92
106
  load(baseURL) {
107
+ if (isWebPreviewMode()) {
108
+ var _document;
109
+ const token = (_document = document) === null || _document === void 0 || (_document = _document.cookie) === null || _document === void 0 ? void 0 : _document.split(';').filter(item => item.includes('wm_xsrf_token'));
110
+ if (token && token.length > 0) {
111
+ const wm_xsrf_token = token[0].split('=')[1];
112
+ wm_xsrf_token && StorageService.setItem(XSRF_COOKIE_NAME, wm_xsrf_token);
113
+ }
114
+ }
93
115
  return Promise.resolve().then(() => {
94
116
  if (networkService.isConnected()) {
95
117
  return axios.get(baseURL + '/services/security/info').then(response => response.data);
@@ -142,7 +164,9 @@ class AppSecurityService {
142
164
  setTimeout(() => {
143
165
  WebProcessService.execute('LOGIN', '/services/security/ssologin', false, true).then(output => {
144
166
  if (output) {
145
- return JSON.parse(output.data && output.data.replace(/&quot;/g, "\""));
167
+ if (output.data) {
168
+ return this.formateData(`${output.data}`);
169
+ }
146
170
  }
147
171
  return Promise.reject();
148
172
  }).then(output => {
@@ -171,7 +195,23 @@ class AppSecurityService {
171
195
  appLogout(options) {
172
196
  return axios.post(options.baseURL + '/j_spring_security_logout', null, {
173
197
  withCredentials: true
174
- }).catch(() => {}).then(() => {
198
+ }).catch(() => {}).then(response => {
199
+ var _response$data;
200
+ if (response !== null && response !== void 0 && (_response$data = response.data) !== null && _response$data !== void 0 && _response$data.result) {
201
+ if (isWebPreviewMode()) {
202
+ location.href = response.data.result;
203
+ return new Promise(r => setTimeout(r, 5000));
204
+ } else {
205
+ var _response$data2;
206
+ return axios.get(`${response === null || response === void 0 || (_response$data2 = response.data) === null || _response$data2 === void 0 ? void 0 : _response$data2.result}`, {
207
+ withCredentials: true
208
+ });
209
+ }
210
+ }
211
+ return Promise.reject();
212
+ }).catch(e => {
213
+ console.error(e);
214
+ }).then(() => {
175
215
  this.isLoggedIn = false;
176
216
  this.redirectToLogin();
177
217
  });
@@ -1 +1 @@
1
- {"version":3,"names":["Platform","axios","each","includes","networkService","injector","StorageService","WebProcessService","USER_ROLE","authCookieStr","XSRF_COOKIE_NAME","xsrf_header_name","AppSecurityService","constructor","_defineProperty","interceptors","request","use","config","onBeforeServiceCall","appConfig","getAppConfig","baseUrl","url","getXsrfToken","then","token","_config$url","startsWith","headers","Promise","resolve","getItem","xsrf_token","get","navigateToLandingPage","_this$appConfig$curre","_this$appConfig$logge","currentPage","goToPage","loggedInUser","landingPage","setTimeout","_this$appConfig$curre2","openUrl","appLogin","options","payload","formData","value","name","encodeURIComponent","defaults","withCredentials","post","baseURL","response","xsrfCookieValue","data","setItem","isLoggedIn","load","userData","getLoggedInUserDetails","useDefaultSuccessHandler","app","triggerStartUpVariables","isConnected","getServiceDefinitions","defaultSecurityConfig","details","securityConfig","isSecurityEnabled","securityEnabled","authenticated","_appConfig$appPropert","isAuthenticated","roles","userInfo","userRoles","userName","id","userId","tenantId","userAttributes","dataSet","appProperties","homePage","redirectToLogin","redirectTo","_this$securityConfig","loginConfig","type","authUrl","OS","window","parent","location","href","execute","output","JSON","parse","replace","reject","refresh","_this$securityConfig$","_this$appConfig$curre3","loginPage","pageName","appLogout","catch","canUserAccessPage","_this$securityConfig2","res","status","matchRoles","widgetRoles","some","item","hasAccessToWidget","_this$loggedInUser$da","_this$loggedInUser$da2","_this$loggedInUser$da3","_this$loggedInUser$da4","widgetRolesArr","split","EVERYONE","ANONYMOUS","AUTHENTICATED","appSecurityService"],"sources":["app-security.service.tsx"],"sourcesContent":["import { Platform } from 'react-native';\nimport axios, { InternalAxiosRequestConfig, AxiosResponse } from 'axios';\nimport { each, includes } from 'lodash';\n\nimport networkService from '@wavemaker/app-rn-runtime/core/network.service';\nimport injector from '@wavemaker/app-rn-runtime/core/injector';\nimport AppConfig from '@wavemaker/app-rn-runtime/core/AppConfig';\nimport StorageService from '@wavemaker/app-rn-runtime/core/storage.service';\nimport { SecurityService } from '@wavemaker/app-rn-runtime/core/security.service';\n\nimport WebProcessService from './webprocess.service';\n\ndeclare const window: any;\n\ninterface LoggedInUserConfig {\n isAuthenticated: Boolean;\n isSecurityEnabled: Boolean;\n roles: Array<string>;\n name: String;\n id: String;\n tenantId: String;\n userAttributes: any;\n landingPage: string;\n}\n\nenum USER_ROLE {\n EVERYONE = 'Everyone',\n ANONYMOUS = 'Anonymous',\n AUTHENTICATED = 'Authenticated'\n}\n\nconst authCookieStr = 'AUTH_COOKIE';\nconst XSRF_COOKIE_NAME = 'wm_xsrf_token';\nconst xsrf_header_name = 'X-WM-XSRF-TOKEN';\n\nclass AppSecurityService implements SecurityService {\n\n securityConfig: any;\n isLoggedIn = false;\n loggedInUser: any = {};\n token: any;\n appConfig: any;\n baseUrl: string = '';\n defaultSecurityConfig: any;\n landingPage = '';\n\n constructor() {\n axios.interceptors.request.use((config: InternalAxiosRequestConfig) => this.onBeforeServiceCall(config));\n }\n\n onBeforeServiceCall(config: InternalAxiosRequestConfig) {\n if (!this.appConfig) {\n this.appConfig = this.getAppConfig();\n this.baseUrl = this.appConfig.url;\n }\n return this.getXsrfToken().then((token: string) => {\n if (config.url?.startsWith(this.baseUrl) && token) {\n if(config.headers) config.headers[xsrf_header_name] = token;\n }\n return config\n });\n }\n\n private getXsrfToken(): Promise<string> {\n if (this.token) {\n return Promise.resolve(this.token);\n }\n return StorageService.getItem(XSRF_COOKIE_NAME).then(xsrf_token => {\n this.token = xsrf_token;\n return this.token;\n });\n }\n\n private getAppConfig() {\n return injector.get<AppConfig>('APP_CONFIG');\n }\n\n public navigateToLandingPage() {\n this.appConfig.currentPage?.goToPage(\n this.appConfig.loggedInUser?.landingPage \n || this.appConfig.landingPage \n || 'Main', null, true);\n if (this.landingPage) {\n const landingPage = this.landingPage;\n this.landingPage = '';\n setTimeout(() => {\n this.appConfig.currentPage?.openUrl(landingPage);\n }, 100);\n }\n }\n\n public appLogin(options: any) {\n // encode all parameters\n let payload = '';\n each(options.formData, function (value, name) {\n payload += (payload ? '&' : '') + encodeURIComponent(name) + '=' + encodeURIComponent(value);\n });\n axios.defaults.withCredentials = true;\n return axios.post(options.baseURL + '/j_spring_security_check', payload, {\n withCredentials: true,\n headers: {\n 'Content-Type': 'application/x-www-form-urlencoded'\n }}).then((response: AxiosResponse) => {\n const xsrfCookieValue = response.data ? response.data[XSRF_COOKIE_NAME] : '';\n this.token = xsrfCookieValue;\n StorageService.setItem(XSRF_COOKIE_NAME, xsrfCookieValue);\n this.isLoggedIn = true;\n }).then(() => this.load(options.baseURL))\n .then(async () => {\n const userData = await this.getLoggedInUserDetails(options.baseURL, options.useDefaultSuccessHandler);\n await this.appConfig.app.triggerStartUpVariables();\n return userData;\n });\n }\n\n public load(baseURL: string) {\n return Promise.resolve().then(() => {\n if (networkService.isConnected()) {\n return axios.get(baseURL + '/services/security/info')\n .then((response: AxiosResponse) => response.data);\n }\n return this.appConfig.getServiceDefinitions(this.appConfig.url)\n .then(() => Promise.resolve(this.defaultSecurityConfig));\n }).then((details: any) => {\n const loggedInUser = {} as LoggedInUserConfig;\n this.securityConfig = details || {};\n this.securityConfig.isSecurityEnabled = !!details?.securityEnabled;\n const appConfig = this.appConfig;\n if (typeof details !== 'string' && (!details.securityEnabled || details.authenticated)) {\n if (details.authenticated) {\n loggedInUser.isAuthenticated = details.authenticated;\n loggedInUser.isSecurityEnabled = details.authenticated;\n loggedInUser.roles = details.userInfo.userRoles;\n loggedInUser.name = details.userInfo.userName;\n loggedInUser.id = details.userInfo.userId;\n loggedInUser.tenantId = details.userInfo.tenantId;\n loggedInUser.userAttributes = details.userInfo.userAttributes;\n loggedInUser.landingPage = details.userInfo.landingPage;\n appConfig.loggedInUser = loggedInUser;\n this.loggedInUser.dataSet = loggedInUser;\n appConfig.landingPage = appConfig.appProperties?.homePage;\n }\n return appConfig.getServiceDefinitions(appConfig.url)\n .then(() => {\n return details;\n });\n } else {\n return appConfig.getServiceDefinitions(appConfig.url)\n .then(() => {\n this.redirectToLogin();\n });\n }\n });\n }\n\n private getLoggedInUserDetails(baseURL: string, useDefaultSuccessHandler: boolean = true) {\n if (!baseURL) {\n this.loggedInUser = {};\n return Promise.resolve({});\n }\n return this.load(baseURL);\n }\n\n \n public redirectToLogin(redirectTo?: string) {\n if (this.securityConfig?.loginConfig?.type === 'SSO') {\n const authUrl = this.appConfig.url + '/services/security/ssologin';\n if (Platform.OS === 'web') {\n (window.parent || window).location.href = authUrl;\n } else {\n setTimeout(() => {\n WebProcessService.execute('LOGIN', '/services/security/ssologin', false, true)\n .then((output: any) => {\n if (output) {\n return JSON.parse(output.data && output.data.replace(/&quot;/g, \"\\\"\"));\n }\n return Promise.reject();\n }).then((output: any) => {\n if (output[XSRF_COOKIE_NAME]) {\n this.token = output[XSRF_COOKIE_NAME];\n StorageService.setItem(XSRF_COOKIE_NAME, output[XSRF_COOKIE_NAME]);\n }\n }).then(() => {\n this.appConfig.refresh(true);\n }).then(() => this.load(this.baseUrl)).then(() => {\n return this.getLoggedInUserDetails(this.baseUrl);\n });\n }, 1000);\n }\n } else {\n const loginPage = this.securityConfig.loginConfig?.pageName || 'Login';\n if (redirectTo && !redirectTo.startsWith('#/'+ loginPage)) {\n this.landingPage = redirectTo;\n }\n injector.get<AppConfig>('APP_CONFIG').landingPage = loginPage;\n this.appConfig.currentPage?.goToPage(loginPage, null, true);\n }\n this.appConfig.refresh();\n }\n\n public appLogout(options: any) {\n return axios.post(options.baseURL + '/j_spring_security_logout', null, {\n withCredentials: true\n }).catch(() => {}).then(() => {\n this.isLoggedIn = false;\n this.redirectToLogin();\n });\n }\n\n public canUserAccessPage(pageName: string) {\n if (this.baseUrl && this.securityConfig?.isSecurityEnabled) {\n return axios.get(this.baseUrl + `/pages/${pageName}/${pageName}.html`)\n .catch((res) => res)\n .then((res) => res.status === 200 || res.status === 304); \n } else {\n return Promise.resolve(true);\n }\n }\n\n private matchRoles(widgetRoles: Array<String>, userRoles: Array<String>) {\n return widgetRoles.some(function (item) {\n return includes(userRoles, item);\n });\n }\n\n public hasAccessToWidget(widgetRoles: String) {\n const widgetRolesArr = widgetRoles.split(',');\n // access the widget when 'Everyone' is chosen\n if (includes(widgetRolesArr, USER_ROLE.EVERYONE)) {\n return true;\n }\n\n // access the widget when 'Anonymous' is chosen and user is not authenticated\n if (includes(widgetRolesArr, USER_ROLE.ANONYMOUS) && !this.loggedInUser.dataSet?.isAuthenticated) {\n return true;\n }\n\n // access the widget when 'Only Authenticated Users' is chosen and user is authenticated\n if (includes(widgetRolesArr, USER_ROLE.AUTHENTICATED) && this.loggedInUser.dataSet?.isAuthenticated) {\n return true;\n }\n\n // access the widget when widget role and logged in user role matches\n return this.loggedInUser.dataSet?.isAuthenticated && this.matchRoles(widgetRolesArr, this.loggedInUser.dataSet?.roles);\n }\n}\n\nconst appSecurityService = new AppSecurityService();\n\nexport default appSecurityService;\n"],"mappings":";;;AAAA,SAASA,QAAQ,QAAQ,cAAc;AACvC,OAAOC,KAAK,MAAqD,OAAO;AACxE,SAASC,IAAI,EAAEC,QAAQ,QAAQ,QAAQ;AAEvC,OAAOC,cAAc,MAAM,gDAAgD;AAC3E,OAAOC,QAAQ,MAAM,yCAAyC;AAE9D,OAAOC,cAAc,MAAM,gDAAgD;AAG3E,OAAOC,iBAAiB,MAAM,sBAAsB;AAAC,IAehDC,SAAS,0BAATA,SAAS;EAATA,SAAS;EAATA,SAAS;EAATA,SAAS;EAAA,OAATA,SAAS;AAAA,EAATA,SAAS;AAMd,MAAMC,aAAa,GAAG,aAAa;AACnC,MAAMC,gBAAgB,GAAG,eAAe;AACxC,MAAMC,gBAAgB,GAAG,iBAAiB;AAE1C,MAAMC,kBAAkB,CAA4B;EAWhDC,WAAWA,CAAA,EAAG;IAAAC,eAAA;IAAAA,eAAA,qBARD,KAAK;IAAAA,eAAA,uBACE,CAAC,CAAC;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA,kBAGJ,EAAE;IAAAA,eAAA;IAAAA,eAAA,sBAEN,EAAE;IAGdb,KAAK,CAACc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A,eAAzBA,qBAAA,CAA2B7C,eAAe,GAAE;MAC9F,OAAO,IAAI;IACf;;IAEA;IACA,IAAIzE,QAAQ,CAAC0H,cAAc,EAAErH,SAAS,CAACyH,aAAa,CAAC,KAAAP,sBAAA,GAAI,IAAI,CAAClF,YAAY,CAAC6C,OAAO,cAAAqC,sBAAA,eAAzBA,sBAAA,CAA2B9C,eAAe,EAAE;MACjG,OAAO,IAAI;IACf;;IAEA;IACA,OAAO,EAAA+C,sBAAA,OAAI,CAACnF,YAAY,CAAC6C,OAAO,cAAAsC,sBAAA,uBAAzBA,sBAAA,CAA2B/C,eAAe,KAAI,IAAI,CAACwC,UAAU,CAACS,cAAc,GAAAD,sBAAA,GAAE,IAAI,CAACpF,YAAY,CAAC6C,OAAO,cAAAuC,sBAAA,uBAAzBA,sBAAA,CAA2B/C,KAAK,CAAC;EAC1H;AACJ;AAEA,MAAMqD,kBAAkB,GAAG,IAAItH,kBAAkB,CAAC,CAAC;AAEnD,eAAesH,kBAAkB","ignoreList":[]}
1
+ {"version":3,"names":["Platform","axios","each","includes","networkService","injector","StorageService","WebProcessService","isWebPreviewMode","USER_ROLE","authCookieStr","XSRF_COOKIE_NAME","xsrf_header_name","AppSecurityService","constructor","_defineProperty","str","wm_xsrf_token_index","indexOf","index","regExp","substring","RegExp","data","regex","getRegex","JSON","parse","replace","interceptors","request","use","config","onBeforeServiceCall","appConfig","getAppConfig","baseUrl","url","getXsrfToken","then","token","_config$url","startsWith","headers","Promise","resolve","getItem","xsrf_token","get","navigateToLandingPage","_this$appConfig$curre","_this$appConfig$logge","currentPage","goToPage","loggedInUser","landingPage","setTimeout","_this$appConfig$curre2","openUrl","appLogin","options","payload","formData","value","name","encodeURIComponent","defaults","withCredentials","post","baseURL","response","xsrfCookieValue","setItem","isLoggedIn","load","userData","getLoggedInUserDetails","useDefaultSuccessHandler","app","triggerStartUpVariables","_document","document","cookie","split","filter","item","length","wm_xsrf_token","isConnected","getServiceDefinitions","defaultSecurityConfig","details","securityConfig","isSecurityEnabled","securityEnabled","authenticated","_appConfig$appPropert","isAuthenticated","roles","userInfo","userRoles","userName","id","userId","tenantId","userAttributes","dataSet","appProperties","homePage","redirectToLogin","redirectTo","_this$securityConfig","loginConfig","type","authUrl","OS","window","parent","location","href","execute","output","formateData","reject","refresh","_this$securityConfig$","_this$appConfig$curre3","loginPage","pageName","appLogout","catch","_response$data","result","r","_response$data2","e","console","error","canUserAccessPage","_this$securityConfig2","res","status","matchRoles","widgetRoles","some","hasAccessToWidget","_this$loggedInUser$da","_this$loggedInUser$da2","_this$loggedInUser$da3","_this$loggedInUser$da4","widgetRolesArr","EVERYONE","ANONYMOUS","AUTHENTICATED","appSecurityService"],"sources":["app-security.service.tsx"],"sourcesContent":["import { Platform } from 'react-native';\nimport axios, { InternalAxiosRequestConfig, AxiosResponse } from 'axios';\nimport { each, includes } from 'lodash';\n\nimport networkService from '@wavemaker/app-rn-runtime/core/network.service';\nimport injector from '@wavemaker/app-rn-runtime/core/injector';\nimport AppConfig from '@wavemaker/app-rn-runtime/core/AppConfig';\nimport StorageService from '@wavemaker/app-rn-runtime/core/storage.service';\nimport { SecurityService } from '@wavemaker/app-rn-runtime/core/security.service';\n\nimport WebProcessService from './webprocess.service';\nimport { isWebPreviewMode } from '@wavemaker/app-rn-runtime/core/utils';\n\ndeclare const window: any;\n\ninterface LoggedInUserConfig {\n isAuthenticated: Boolean;\n isSecurityEnabled: Boolean;\n roles: Array<string>;\n name: String;\n id: String;\n tenantId: String;\n userAttributes: any;\n landingPage: string;\n}\n\nenum USER_ROLE {\n EVERYONE = 'Everyone',\n ANONYMOUS = 'Anonymous',\n AUTHENTICATED = 'Authenticated'\n}\n\nconst authCookieStr = 'AUTH_COOKIE';\nconst XSRF_COOKIE_NAME = 'wm_xsrf_token';\nconst xsrf_header_name = 'X-WM-XSRF-TOKEN';\n\nclass AppSecurityService implements SecurityService {\n\n securityConfig: any;\n isLoggedIn = false;\n loggedInUser: any = {};\n token: any;\n appConfig: any;\n baseUrl: string = '';\n defaultSecurityConfig: any;\n landingPage = '';\n\n constructor() {\n axios.interceptors.request.use((config: InternalAxiosRequestConfig) => this.onBeforeServiceCall(config));\n }\n\n getRegex = (str: string) =>{\n const wm_xsrf_token_index = str.indexOf('wm_xsrf_token') + 13; // 13 is the length of 'wm_xsrf_token' string\n let index = wm_xsrf_token_index;\n\n while(str[index] !== ':'){\n index++;\n }\n \n const regExp = str.substring(wm_xsrf_token_index, index);\n return new RegExp(regExp, \"g\");\n }\n \n formateData = (data: string) => {\n const regex = this.getRegex(data)\n return JSON.parse(data.replace(regex, \"\\\"\"));\n }\n\n onBeforeServiceCall(config: InternalAxiosRequestConfig) {\n if (!this.appConfig) {\n this.appConfig = this.getAppConfig();\n this.baseUrl = this.appConfig.url;\n }\n return this.getXsrfToken().then((token: string) => {\n if (config.url?.startsWith(this.baseUrl) && token) {\n if(config.headers) config.headers[xsrf_header_name] = token;\n }\n return config\n });\n }\n\n private getXsrfToken(): Promise<string> {\n if (this.token) {\n return Promise.resolve(this.token);\n }\n return StorageService.getItem(XSRF_COOKIE_NAME).then(xsrf_token => {\n this.token = xsrf_token;\n return this.token;\n });\n }\n\n private getAppConfig() {\n return injector.get<AppConfig>('APP_CONFIG');\n }\n\n public navigateToLandingPage() {\n this.appConfig.currentPage?.goToPage(\n this.appConfig.loggedInUser?.landingPage \n || this.appConfig.landingPage \n || 'Main', null, true);\n if (this.landingPage) {\n const landingPage = this.landingPage;\n this.landingPage = '';\n setTimeout(() => {\n this.appConfig.currentPage?.openUrl(landingPage);\n }, 100);\n }\n }\n\n public appLogin(options: any) {\n // encode all parameters\n let payload = '';\n each(options.formData, function (value, name) {\n payload += (payload ? '&' : '') + encodeURIComponent(name) + '=' + encodeURIComponent(value);\n });\n axios.defaults.withCredentials = true;\n return axios.post(options.baseURL + '/j_spring_security_check', payload, {\n withCredentials: true,\n headers: {\n 'Content-Type': 'application/x-www-form-urlencoded'\n }}).then((response: AxiosResponse) => {\n const xsrfCookieValue = response.data ? response.data[XSRF_COOKIE_NAME] : '';\n this.token = xsrfCookieValue;\n StorageService.setItem(XSRF_COOKIE_NAME, xsrfCookieValue);\n this.isLoggedIn = true;\n }).then(() => this.load(options.baseURL))\n .then(async () => {\n const userData = await this.getLoggedInUserDetails(options.baseURL, options.useDefaultSuccessHandler);\n await this.appConfig.app.triggerStartUpVariables();\n return userData;\n });\n }\n\n public load(baseURL: string) {\n if (isWebPreviewMode()) {\n const token = document?.cookie?.split(';').filter(item => item.includes('wm_xsrf_token'))\n if (token && token.length > 0) {\n const wm_xsrf_token = token[0].split('=')[1];\n wm_xsrf_token && StorageService.setItem(XSRF_COOKIE_NAME, wm_xsrf_token);\n }\n }\n\n return Promise.resolve().then(() => {\n if (networkService.isConnected()) {\n return axios.get(baseURL + '/services/security/info')\n .then((response: AxiosResponse) => response.data);\n }\n return this.appConfig.getServiceDefinitions(this.appConfig.url)\n .then(() => Promise.resolve(this.defaultSecurityConfig));\n }).then((details: any) => {\n const loggedInUser = {} as LoggedInUserConfig;\n this.securityConfig = details || {};\n this.securityConfig.isSecurityEnabled = !!details?.securityEnabled;\n const appConfig = this.appConfig;\n if (typeof details !== 'string' && (!details.securityEnabled || details.authenticated)) {\n if (details.authenticated) {\n loggedInUser.isAuthenticated = details.authenticated;\n loggedInUser.isSecurityEnabled = details.authenticated;\n loggedInUser.roles = details.userInfo.userRoles;\n loggedInUser.name = details.userInfo.userName;\n loggedInUser.id = details.userInfo.userId;\n loggedInUser.tenantId = details.userInfo.tenantId;\n loggedInUser.userAttributes = details.userInfo.userAttributes;\n loggedInUser.landingPage = details.userInfo.landingPage;\n appConfig.loggedInUser = loggedInUser;\n this.loggedInUser.dataSet = loggedInUser;\n appConfig.landingPage = appConfig.appProperties?.homePage;\n }\n return appConfig.getServiceDefinitions(appConfig.url)\n .then(() => {\n return details;\n });\n } else {\n return appConfig.getServiceDefinitions(appConfig.url)\n .then(() => {\n this.redirectToLogin();\n });\n }\n });\n }\n\n private getLoggedInUserDetails(baseURL: string, useDefaultSuccessHandler: boolean = true) {\n if (!baseURL) {\n this.loggedInUser = {};\n return Promise.resolve({});\n }\n return this.load(baseURL);\n }\n\n \n public redirectToLogin(redirectTo?: string) {\n if (this.securityConfig?.loginConfig?.type === 'SSO') {\n const authUrl = this.appConfig.url + '/services/security/ssologin';\n if (Platform.OS === 'web') {\n (window.parent || window).location.href = authUrl;\n } else {\n setTimeout(() => {\n WebProcessService.execute('LOGIN', '/services/security/ssologin', false, true)\n .then((output: any) => {\n if (output) {\n if(output.data){\n return this.formateData(`${output.data}`);\n }\n }\n return Promise.reject();\n }).then((output: any) => {\n if (output[XSRF_COOKIE_NAME]) {\n this.token = output[XSRF_COOKIE_NAME];\n StorageService.setItem(XSRF_COOKIE_NAME, output[XSRF_COOKIE_NAME]);\n }\n }).then(() => {\n this.appConfig.refresh(true);\n }).then(() => this.load(this.baseUrl)).then(() => {\n return this.getLoggedInUserDetails(this.baseUrl);\n });\n }, 1000);\n }\n } else {\n const loginPage = this.securityConfig.loginConfig?.pageName || 'Login';\n if (redirectTo && !redirectTo.startsWith('#/'+ loginPage)) {\n this.landingPage = redirectTo;\n }\n injector.get<AppConfig>('APP_CONFIG').landingPage = loginPage;\n this.appConfig.currentPage?.goToPage(loginPage, null, true);\n }\n this.appConfig.refresh();\n }\n\n public appLogout(options: any) {\n return axios.post(options.baseURL + '/j_spring_security_logout', null, {\n withCredentials: true\n })\n .catch(() => {})\n .then((response) => {\n if(response?.data?.result){\n if (isWebPreviewMode()) {\n location.href = response.data.result;\n return new Promise(r => setTimeout(r, 5000));\n } else {\n return axios.get(`${response?.data?.result}`, {\n withCredentials: true,\n });\n }\n }\n return Promise.reject();\n })\n .catch((e) => {\n console.error(e);\n })\n .then(()=>{\n this.isLoggedIn = false;\n this.redirectToLogin();\n });\n }\n\n public canUserAccessPage(pageName: string) {\n if (this.baseUrl && this.securityConfig?.isSecurityEnabled) {\n return axios.get(this.baseUrl + `/pages/${pageName}/${pageName}.html`)\n .catch((res) => res)\n .then((res) => res.status === 200 || res.status === 304); \n } else {\n return Promise.resolve(true);\n }\n }\n\n private matchRoles(widgetRoles: Array<String>, userRoles: Array<String>) {\n return widgetRoles.some(function (item) {\n return includes(userRoles, item);\n });\n }\n\n public hasAccessToWidget(widgetRoles: String) {\n const widgetRolesArr = widgetRoles.split(',');\n // access the widget when 'Everyone' is chosen\n if (includes(widgetRolesArr, USER_ROLE.EVERYONE)) {\n return true;\n }\n\n // access the widget when 'Anonymous' is chosen and user is not authenticated\n if (includes(widgetRolesArr, USER_ROLE.ANONYMOUS) && !this.loggedInUser.dataSet?.isAuthenticated) {\n return true;\n }\n\n // access the widget when 'Only Authenticated Users' is chosen and user is authenticated\n if (includes(widgetRolesArr, USER_ROLE.AUTHENTICATED) && this.loggedInUser.dataSet?.isAuthenticated) {\n return true;\n }\n\n // access the widget when widget role and logged in user role matches\n return this.loggedInUser.dataSet?.isAuthenticated && this.matchRoles(widgetRolesArr, this.loggedInUser.dataSet?.roles);\n }\n}\n\nconst appSecurityService = new AppSecurityService();\n\nexport default appSecurityService;\n"],"mappings":";;;AAAA,SAASA,QAAQ,QAAQ,cAAc;AACvC,OAAOC,KAAK,MAAqD,OAAO;AACxE,SAASC,IAAI,EAAEC,QAAQ,QAAQ,QAAQ;AAEvC,OAAOC,cAAc,MAAM,gDAAgD;AAC3E,OAAOC,QAAQ,MAAM,yCAAyC;AAE9D,OAAOC,cAAc,MAAM,gDAAgD;AAG3E,OAAOC,iBAAiB,MAAM,sBAAsB;AACpD,SAASC,gBAAgB,QAAQ,sCAAsC;AAAC,IAenEC,SAAS,0BAATA,SAAS;EAATA,SAAS;EAATA,SAAS;EAATA,SAAS;EAAA,OAATA,SAAS;AAAA,EAATA,SAAS;AAMd,MAAMC,aAAa,GAAG,aAAa;AACnC,MAAMC,gBAAgB,GAAG,eAAe;AACxC,MAAMC,gBAAgB,GAAG,iBAAiB;AAE1C,MAAMC,kBAAkB,CAA4B;EAWhDC,WAAWA,CAAA,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AAI,CAAC9F,YAAY,CAACoD,OAAO,cAAA0C,sBAAA,uBAAzBA,sBAAA,CAA2BnD,eAAe,KAAI,IAAI,CAAC6C,UAAU,CAACQ,cAAc,GAAAD,sBAAA,GAAE,IAAI,CAAC/F,YAAY,CAACoD,OAAO,cAAA2C,sBAAA,uBAAzBA,sBAAA,CAA2BnD,KAAK,CAAC;EAC1H;AACJ;AAEA,MAAMwD,kBAAkB,GAAG,IAAI7I,kBAAkB,CAAC,CAAC;AAEnD,eAAe6I,kBAAkB","ignoreList":[]}
@@ -44,7 +44,6 @@ export class AppSpinnerService {
44
44
  this.count++;
45
45
  }
46
46
  hide() {
47
- this.skeleton = false;
48
47
  if (this.count > 0) {
49
48
  this.count--;
50
49
  } else {
@@ -55,6 +54,7 @@ export class AppSpinnerService {
55
54
  if (!this.count && this.destroy) {
56
55
  this.destroy.call(this.displayManager);
57
56
  this.destroy = null;
57
+ this.skeleton = false;
58
58
  }
59
59
  }, 300);
60
60
  }
@@ -1 +1 @@
1
- {"version":3,"names":["React","View","appDisplayManagerService","WmSpinner","ThemeVariables","AppSpinnerService","constructor","displayManager","_defineProperty","setImage","path","image","setDefaultOptions","options","defaultDisplayOptions","show","skeleton","spinner","loader","count","destroy","setTimeout","content","createElement","Fragment","style","styles","appSpinnerContainer","backgroundColor","INSTANCE","pageContentBgColor","caption","message","classname","lottie","delay","hide","call","justifyContent","alignItems","width","height","opacity","spinnerService"],"sources":["app-spinner.service.tsx"],"sourcesContent":["import React from 'react';\n\nimport { View, ViewStyle } from 'react-native';\n\nimport { SpinnerService, DisplayOptions } from '@wavemaker/app-rn-runtime/core/spinner.service';\nimport { DisplayManager } from '@wavemaker/app-rn-runtime/core/display.manager';\nimport appDisplayManagerService from '@wavemaker/app-rn-runtime/runtime/services/app-display-manager.service';\nimport WmSpinner from '@wavemaker/app-rn-runtime/components/basic/spinner/spinner.component';\nimport ThemeVariables from '@wavemaker/app-rn-runtime/styles/theme.variables';\n\nexport class AppSpinnerService implements SpinnerService {\n public displayOptions = {} as DisplayOptions;\n public destroy: any;\n public delay = 0;\n private count = 0;\n private image: string = '';\n public skeleton: boolean = false;\n private defaultDisplayOptions: DisplayOptions = {} as any;\n constructor(private displayManager: DisplayManager) {}\n\n setImage(path: string) {\n this.image = path;\n }\n\n setDefaultOptions(options: DisplayOptions) {\n this.defaultDisplayOptions = options;\n }\n\n show(options: DisplayOptions = this.defaultDisplayOptions) {\n this.skeleton = options.spinner.loader == 'skeleton';\n if (this.count === 0 && !this.destroy) { \n setTimeout(() => {\n const content = (<>\n {!this.skeleton? \n <View style={[styles.appSpinnerContainer, { backgroundColor: ThemeVariables.INSTANCE.pageContentBgColor }]}>\n <WmSpinner\n caption={options.message || ''}\n classname=\"global-spinner\"\n lottie={options.spinner}></WmSpinner>\n </View> : null}\n </>);\n this.destroy = this.displayManager.show({ content: content });\n }, this.delay);\n }\n this.count++;\n }\n\n hide() {\n this.skeleton = false;\n if (this.count > 0) {\n this.count--;\n } else {\n this.count = 0;\n }\n if (this.count === 0) {\n setTimeout(() => {\n if (!this.count && this.destroy) {\n this.destroy.call(this.displayManager);\n this.destroy = null;\n }\n }, 300);\n }\n }\n}\n\nconst styles = {\n appSpinnerContainer:{ \n justifyContent: 'center', \n alignItems: 'center', \n width:'100%', \n height:'100%', \n opacity: 0.8 \n } as ViewStyle\n}\n\nconst spinnerService = new AppSpinnerService(appDisplayManagerService);\nexport default spinnerService;\n"],"mappings":";;;AAAA,OAAOA,KAAK,MAAM,OAAO;AAEzB,SAASC,IAAI,QAAmB,cAAc;AAI9C,OAAOC,wBAAwB,MAAM,wEAAwE;AAC7G,OAAOC,SAAS,MAAM,sEAAsE;AAC5F,OAAOC,cAAc,MAAM,kDAAkD;AAE7E,OAAO,MAAMC,iBAAiB,CAA2B;EAQvDC,WAAWA,CAASC,cAA8B,EAAE;IAAA,KAAhCA,cAA8B,GAA9BA,cAA8B;IAAAC,eAAA,yBAP1B,CAAC,CAAC;IAAAA,eAAA;IAAAA,eAA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,GAAG,KAAK;IACrB,IAAI,IAAI,CAACG,KAAK,GAAG,CAAC,EAAE;MAClB,IAAI,CAACA,KAAK,EAAE;IACd,CAAC,MAAM;MACL,IAAI,CAACA,KAAK,GAAG,CAAC;IAChB;IACA,IAAI,IAAI,CAACA,KAAK,KAAK,CAAC,EAAE;MACpBE,UAAU,CAAC,MAAM;QACf,IAAI,CAAC,IAAI,CAACF,KAAK,IAAI,IAAI,CAACC,OAAO,EAAE;UAC/B,IAAI,CAACA,OAAO,CAACiB,IAAI,CAAC,IAAI,CAAC9B,cAAc,CAAC;UACtC,IAAI,CAACa,OAAO,GAAG,IAAI;QACrB;MACF,CAAC,EAAE,GAAG,CAAC;IACT;EACF;AACF;AAEA,MAAMM,MAAM,GAAG;EACbC,mBAAmB,EAAC;IAClBW,cAAc,EAAE,QAAQ;IACxBC,UAAU,EAAE,QAAQ;IACpBC,KAAK,EAAC,MAAM;IACZC,MAAM,EAAC,MAAM;IACbC,OAAO,EAAE;EACX;AACF,CAAC;AAED,MAAMC,cAAc,GAAG,IAAItC,iBAAiB,CAACH,wBAAwB,CAAC;AACtE,eAAeyC,cAAc","ignoreList":[]}
1
+ {"version":3,"names":["React","View","appDisplayManagerService","WmSpinner","ThemeVariables","AppSpinnerService","constructor","displayManager","_defineProperty","setImage","path","image","setDefaultOptions","options","defaultDisplayOptions","show","skeleton","spinner","loader","count","destroy","setTimeout","content","createElement","Fragment","style","styles","appSpinnerContainer","backgroundColor","INSTANCE","pageContentBgColor","caption","message","classname","lottie","delay","hide","call","justifyContent","alignItems","width","height","opacity","spinnerService"],"sources":["app-spinner.service.tsx"],"sourcesContent":["import React from 'react';\n\nimport { View, ViewStyle } from 'react-native';\n\nimport { SpinnerService, DisplayOptions } from '@wavemaker/app-rn-runtime/core/spinner.service';\nimport { DisplayManager } from '@wavemaker/app-rn-runtime/core/display.manager';\nimport appDisplayManagerService from '@wavemaker/app-rn-runtime/runtime/services/app-display-manager.service';\nimport WmSpinner from '@wavemaker/app-rn-runtime/components/basic/spinner/spinner.component';\nimport ThemeVariables from '@wavemaker/app-rn-runtime/styles/theme.variables';\n\nexport class AppSpinnerService implements SpinnerService {\n public displayOptions = {} as DisplayOptions;\n public destroy: any;\n public delay = 0;\n private count = 0;\n private image: string = '';\n public skeleton: boolean = false;\n private defaultDisplayOptions: DisplayOptions = {} as any;\n constructor(private displayManager: DisplayManager) {}\n\n setImage(path: string) {\n this.image = path;\n }\n\n setDefaultOptions(options: DisplayOptions) {\n this.defaultDisplayOptions = options;\n }\n\n show(options: DisplayOptions = this.defaultDisplayOptions) {\n this.skeleton = options.spinner.loader == 'skeleton';\n if (this.count === 0 && !this.destroy) { \n setTimeout(() => {\n const content = (<>\n {!this.skeleton? \n <View style={[styles.appSpinnerContainer, { backgroundColor: ThemeVariables.INSTANCE.pageContentBgColor }]}>\n <WmSpinner\n caption={options.message || ''}\n classname=\"global-spinner\"\n lottie={options.spinner}></WmSpinner>\n </View> : null}\n </>);\n this.destroy = this.displayManager.show({ content: content });\n }, this.delay);\n }\n this.count++;\n }\n\n hide() {\n if (this.count > 0) {\n this.count--;\n } else {\n this.count = 0;\n }\n if (this.count === 0) {\n setTimeout(() => {\n if (!this.count && this.destroy) {\n this.destroy.call(this.displayManager);\n this.destroy = null;\n this.skeleton = false;\n }\n }, 300);\n }\n }\n}\n\nconst styles = {\n appSpinnerContainer:{ \n justifyContent: 'center', \n alignItems: 'center', \n width:'100%', \n height:'100%', \n opacity: 0.8 \n } as ViewStyle\n}\n\nconst spinnerService = new AppSpinnerService(appDisplayManagerService);\nexport default spinnerService;\n"],"mappings":";;;AAAA,OAAOA,KAAK,MAAM,OAAO;AAEzB,SAASC,IAAI,QAAmB,cAAc;AAI9C,OAAOC,wBAAwB,MAAM,wEAAwE;AAC7G,OAAOC,SAAS,MAAM,sEAAsE;AAC5F,OAAOC,cAAc,MAAM,kDAAkD;AAE7E,OAAO,MAAMC,iBAAiB,CAA2B;EAQvDC,WAAWA,CAASC,cAA8B,EAAE;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