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

Sign up to get free protection for your applications and to get access to all the features.
Files changed (289) hide show
  1. app-rn-runtime/components/advanced/carousel/carousel.component.js +14 -2
  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/basic/anchor/anchor.component.js +15 -5
  8. app-rn-runtime/components/basic/anchor/anchor.component.js.map +1 -1
  9. app-rn-runtime/components/basic/anchor/anchor.styles.js +3 -0
  10. app-rn-runtime/components/basic/anchor/anchor.styles.js.map +1 -1
  11. app-rn-runtime/components/basic/audio/audio.component.js +9 -2
  12. app-rn-runtime/components/basic/audio/audio.component.js.map +1 -1
  13. app-rn-runtime/components/basic/audio/audio.styles.js +7 -0
  14. app-rn-runtime/components/basic/audio/audio.styles.js.map +1 -1
  15. app-rn-runtime/components/basic/button/button.component.js +15 -2
  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 +10 -2
  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/search/search.component.js +10 -1
  27. app-rn-runtime/components/basic/search/search.component.js.map +1 -1
  28. app-rn-runtime/components/basic/search/search.props.js +3 -0
  29. app-rn-runtime/components/basic/search/search.props.js.map +1 -1
  30. app-rn-runtime/components/basic/search/search.styles.js +5 -0
  31. app-rn-runtime/components/basic/search/search.styles.js.map +1 -1
  32. app-rn-runtime/components/basic/skeleton/skeleton.component.js +6 -3
  33. app-rn-runtime/components/basic/skeleton/skeleton.component.js.map +1 -1
  34. app-rn-runtime/components/basic/skeleton/skeleton.props.js +9 -1
  35. app-rn-runtime/components/basic/skeleton/skeleton.props.js.map +1 -1
  36. app-rn-runtime/components/basic/video/video.component.js +6 -0
  37. app-rn-runtime/components/basic/video/video.component.js.map +1 -1
  38. app-rn-runtime/components/basic/video/video.styles.js +7 -1
  39. app-rn-runtime/components/basic/video/video.styles.js.map +1 -1
  40. app-rn-runtime/components/chart/area-chart/area-chart.component.js +2 -1
  41. app-rn-runtime/components/chart/area-chart/area-chart.component.js.map +1 -1
  42. app-rn-runtime/components/chart/area-chart/area-chart.styles.js +7 -1
  43. app-rn-runtime/components/chart/area-chart/area-chart.styles.js.map +1 -1
  44. app-rn-runtime/components/chart/bar-chart/bar-chart.styles.js +7 -1
  45. app-rn-runtime/components/chart/bar-chart/bar-chart.styles.js.map +1 -1
  46. app-rn-runtime/components/chart/basechart.component.js +23 -0
  47. app-rn-runtime/components/chart/basechart.component.js.map +1 -1
  48. app-rn-runtime/components/chart/basechart.props.js +2 -2
  49. app-rn-runtime/components/chart/basechart.props.js.map +1 -1
  50. app-rn-runtime/components/chart/basechart.styles.js.map +1 -1
  51. app-rn-runtime/components/chart/bubble-chart/bubble-chart.component.js +1 -1
  52. app-rn-runtime/components/chart/bubble-chart/bubble-chart.component.js.map +1 -1
  53. app-rn-runtime/components/chart/bubble-chart/bubble-chart.styles.js +7 -1
  54. app-rn-runtime/components/chart/bubble-chart/bubble-chart.styles.js.map +1 -1
  55. app-rn-runtime/components/chart/column-chart/column-chart.styles.js +7 -1
  56. app-rn-runtime/components/chart/column-chart/column-chart.styles.js.map +1 -1
  57. app-rn-runtime/components/chart/donut-chart/donut-chart.styles.js +7 -1
  58. app-rn-runtime/components/chart/donut-chart/donut-chart.styles.js.map +1 -1
  59. app-rn-runtime/components/chart/line-chart/line-chart.props.js +2 -0
  60. app-rn-runtime/components/chart/line-chart/line-chart.props.js.map +1 -1
  61. app-rn-runtime/components/chart/line-chart/line-chart.styles.js +7 -1
  62. app-rn-runtime/components/chart/line-chart/line-chart.styles.js.map +1 -1
  63. app-rn-runtime/components/chart/pie-chart/pie-chart.component.js +2 -1
  64. app-rn-runtime/components/chart/pie-chart/pie-chart.component.js.map +1 -1
  65. app-rn-runtime/components/chart/pie-chart/pie-chart.styles.js +7 -1
  66. app-rn-runtime/components/chart/pie-chart/pie-chart.styles.js.map +1 -1
  67. app-rn-runtime/components/container/accordion/accordion.component.js +58 -11
  68. app-rn-runtime/components/container/accordion/accordion.component.js.map +1 -1
  69. app-rn-runtime/components/container/accordion/accordion.props.js.map +1 -1
  70. app-rn-runtime/components/container/accordion/accordion.styles.js +4 -0
  71. app-rn-runtime/components/container/accordion/accordion.styles.js.map +1 -1
  72. app-rn-runtime/components/container/accordion/accordionpane/accordionpane.component.js +11 -1
  73. app-rn-runtime/components/container/accordion/accordionpane/accordionpane.component.js.map +1 -1
  74. app-rn-runtime/components/container/container.component.js +44 -3
  75. app-rn-runtime/components/container/container.component.js.map +1 -1
  76. app-rn-runtime/components/container/container.props.js +1 -0
  77. app-rn-runtime/components/container/container.props.js.map +1 -1
  78. app-rn-runtime/components/container/container.styles.js +7 -0
  79. app-rn-runtime/components/container/container.styles.js.map +1 -1
  80. app-rn-runtime/components/container/layoutgrid/gridrow/gridrow.component.js +5 -1
  81. app-rn-runtime/components/container/layoutgrid/gridrow/gridrow.component.js.map +1 -1
  82. app-rn-runtime/components/container/layoutgrid/gridrow/gridrow.styles.js +6 -1
  83. app-rn-runtime/components/container/layoutgrid/gridrow/gridrow.styles.js.map +1 -1
  84. app-rn-runtime/components/container/layoutgrid/layoutgrid.component.js +28 -2
  85. app-rn-runtime/components/container/layoutgrid/layoutgrid.component.js.map +1 -1
  86. app-rn-runtime/components/container/layoutgrid/layoutgrid.props.js.map +1 -1
  87. app-rn-runtime/components/container/layoutgrid/layoutgrid.styles.js +4 -1
  88. app-rn-runtime/components/container/layoutgrid/layoutgrid.styles.js.map +1 -1
  89. app-rn-runtime/components/container/linearlayout/linearlayout.component.js +31 -5
  90. app-rn-runtime/components/container/linearlayout/linearlayout.component.js.map +1 -1
  91. app-rn-runtime/components/container/linearlayout/linearlayout.props.js.map +1 -1
  92. app-rn-runtime/components/container/linearlayout/linearlayout.styles.js +4 -1
  93. app-rn-runtime/components/container/linearlayout/linearlayout.styles.js.map +1 -1
  94. app-rn-runtime/components/container/panel/panel.component.js +43 -4
  95. app-rn-runtime/components/container/panel/panel.component.js.map +1 -1
  96. app-rn-runtime/components/container/panel/panel.props.js.map +1 -1
  97. app-rn-runtime/components/container/panel/panel.styles.js +3 -0
  98. app-rn-runtime/components/container/panel/panel.styles.js.map +1 -1
  99. app-rn-runtime/components/container/partial-host.component.js.map +1 -1
  100. app-rn-runtime/components/container/tabs/tabheader/tabheader.component.js +2 -2
  101. app-rn-runtime/components/container/tabs/tabheader/tabheader.component.js.map +1 -1
  102. app-rn-runtime/components/container/tabs/tabpane/tabpane.component.js +11 -1
  103. app-rn-runtime/components/container/tabs/tabpane/tabpane.component.js.map +1 -1
  104. app-rn-runtime/components/container/tabs/tabpane/tabpane.props.js +1 -0
  105. app-rn-runtime/components/container/tabs/tabpane/tabpane.props.js.map +1 -1
  106. app-rn-runtime/components/container/tabs/tabs.component.js +41 -6
  107. app-rn-runtime/components/container/tabs/tabs.component.js.map +1 -1
  108. app-rn-runtime/components/container/tabs/tabs.styles.js +4 -1
  109. app-rn-runtime/components/container/tabs/tabs.styles.js.map +1 -1
  110. app-rn-runtime/components/container/tile/tile.component.js +28 -2
  111. app-rn-runtime/components/container/tile/tile.component.js.map +1 -1
  112. app-rn-runtime/components/container/tile/tile.props.js.map +1 -1
  113. app-rn-runtime/components/container/tile/tile.styles.js +6 -1
  114. app-rn-runtime/components/container/tile/tile.styles.js.map +1 -1
  115. app-rn-runtime/components/container/wizard/wizard.component.js +39 -6
  116. app-rn-runtime/components/container/wizard/wizard.component.js.map +1 -1
  117. app-rn-runtime/components/container/wizard/wizard.props.js.map +1 -1
  118. app-rn-runtime/components/container/wizard/wizard.styles.js +3 -0
  119. app-rn-runtime/components/container/wizard/wizard.styles.js.map +1 -1
  120. app-rn-runtime/components/container/wizard/wizardstep/wizardstep.component.js +8 -1
  121. app-rn-runtime/components/container/wizard/wizardstep/wizardstep.component.js.map +1 -1
  122. app-rn-runtime/components/data/card/card-content/card-content.component.js +6 -2
  123. app-rn-runtime/components/data/card/card-content/card-content.component.js.map +1 -1
  124. app-rn-runtime/components/data/card/card-content/card-content.styles.js +4 -1
  125. app-rn-runtime/components/data/card/card-content/card-content.styles.js.map +1 -1
  126. app-rn-runtime/components/data/card/card.component.js +18 -0
  127. app-rn-runtime/components/data/card/card.component.js.map +1 -1
  128. app-rn-runtime/components/data/card/card.styles.js +3 -0
  129. app-rn-runtime/components/data/card/card.styles.js.map +1 -1
  130. app-rn-runtime/components/data/form/form-field/form-field.component.js +2 -1
  131. app-rn-runtime/components/data/form/form-field/form-field.component.js.map +1 -1
  132. app-rn-runtime/components/data/form/form.component.js +1 -1
  133. app-rn-runtime/components/data/form/form.component.js.map +1 -1
  134. app-rn-runtime/components/data/form/form.props.js +1 -0
  135. app-rn-runtime/components/data/form/form.props.js.map +1 -1
  136. app-rn-runtime/components/data/list/list-template/list-template.component.js +15 -1
  137. app-rn-runtime/components/data/list/list-template/list-template.component.js.map +1 -1
  138. app-rn-runtime/components/data/list/list-template/list-template.props.js +1 -0
  139. app-rn-runtime/components/data/list/list-template/list-template.props.js.map +1 -1
  140. app-rn-runtime/components/data/list/list-template/list-template.styles.js +11 -1
  141. app-rn-runtime/components/data/list/list-template/list-template.styles.js.map +1 -1
  142. app-rn-runtime/components/data/list/list.component.js +32 -24
  143. app-rn-runtime/components/data/list/list.component.js.map +1 -1
  144. app-rn-runtime/components/data/list/list.props.js +1 -0
  145. app-rn-runtime/components/data/list/list.props.js.map +1 -1
  146. app-rn-runtime/components/data/list/list.styles.js +9 -0
  147. app-rn-runtime/components/data/list/list.styles.js.map +1 -1
  148. app-rn-runtime/components/dialogs/dialog/dialog.styles.js.map +1 -1
  149. app-rn-runtime/components/input/baseinput/baseinput.component.js +46 -10
  150. app-rn-runtime/components/input/baseinput/baseinput.component.js.map +1 -1
  151. app-rn-runtime/components/input/basenumber/basenumber.component.js +19 -6
  152. app-rn-runtime/components/input/basenumber/basenumber.component.js.map +1 -1
  153. app-rn-runtime/components/input/calendar/calendar.component.js +25 -0
  154. app-rn-runtime/components/input/calendar/calendar.component.js.map +1 -1
  155. app-rn-runtime/components/input/calendar/calendar.styles.js +19 -0
  156. app-rn-runtime/components/input/calendar/calendar.styles.js.map +1 -1
  157. app-rn-runtime/components/input/checkbox/checkbox.component.js +23 -3
  158. app-rn-runtime/components/input/checkbox/checkbox.component.js.map +1 -1
  159. app-rn-runtime/components/input/checkbox/checkbox.styles.js +19 -2
  160. app-rn-runtime/components/input/checkbox/checkbox.styles.js.map +1 -1
  161. app-rn-runtime/components/input/checkboxset/checkboxset.component.js +21 -1
  162. app-rn-runtime/components/input/checkboxset/checkboxset.component.js.map +1 -1
  163. app-rn-runtime/components/input/checkboxset/checkboxset.props.js +1 -0
  164. app-rn-runtime/components/input/checkboxset/checkboxset.props.js.map +1 -1
  165. app-rn-runtime/components/input/checkboxset/checkboxset.styles.js +1 -0
  166. app-rn-runtime/components/input/checkboxset/checkboxset.styles.js.map +1 -1
  167. app-rn-runtime/components/input/chips/chips.component.js +16 -2
  168. app-rn-runtime/components/input/chips/chips.component.js.map +1 -1
  169. app-rn-runtime/components/input/chips/chips.styles.js +8 -0
  170. app-rn-runtime/components/input/chips/chips.styles.js.map +1 -1
  171. app-rn-runtime/components/input/currency/currency.component.js +14 -4
  172. app-rn-runtime/components/input/currency/currency.component.js.map +1 -1
  173. app-rn-runtime/components/input/currency/currency.styles.js +43 -1
  174. app-rn-runtime/components/input/currency/currency.styles.js.map +1 -1
  175. app-rn-runtime/components/input/epoch/base-datetime.component.js +26 -5
  176. app-rn-runtime/components/input/epoch/base-datetime.component.js.map +1 -1
  177. app-rn-runtime/components/input/epoch/datetime/datetime.props.js +6 -0
  178. app-rn-runtime/components/input/epoch/datetime/datetime.props.js.map +1 -1
  179. app-rn-runtime/components/input/epoch/datetime/datetime.styles.js +13 -0
  180. app-rn-runtime/components/input/epoch/datetime/datetime.styles.js.map +1 -1
  181. app-rn-runtime/components/input/epoch/wheelpickermodal/date/date-picker-modal.component.js +7 -4
  182. app-rn-runtime/components/input/epoch/wheelpickermodal/date/date-picker-modal.component.js.map +1 -1
  183. app-rn-runtime/components/input/epoch/wheelpickermodal/date/date-picker-modal.props.js +3 -0
  184. app-rn-runtime/components/input/epoch/wheelpickermodal/date/date-picker-modal.props.js.map +1 -1
  185. app-rn-runtime/components/input/epoch/wheelpickermodal/time/time-picker-modal.component.js +7 -4
  186. app-rn-runtime/components/input/epoch/wheelpickermodal/time/time-picker-modal.component.js.map +1 -1
  187. app-rn-runtime/components/input/epoch/wheelpickermodal/time/time-picker-modal.props.js +3 -0
  188. app-rn-runtime/components/input/epoch/wheelpickermodal/time/time-picker-modal.props.js.map +1 -1
  189. app-rn-runtime/components/input/number/number.component.js +17 -3
  190. app-rn-runtime/components/input/number/number.component.js.map +1 -1
  191. app-rn-runtime/components/input/number/number.styles.js +24 -1
  192. app-rn-runtime/components/input/number/number.styles.js.map +1 -1
  193. app-rn-runtime/components/input/radioset/radioset.component.js +33 -8
  194. app-rn-runtime/components/input/radioset/radioset.component.js.map +1 -1
  195. app-rn-runtime/components/input/radioset/radioset.props.js +2 -0
  196. app-rn-runtime/components/input/radioset/radioset.props.js.map +1 -1
  197. app-rn-runtime/components/input/radioset/radioset.styles.js +7 -0
  198. app-rn-runtime/components/input/radioset/radioset.styles.js.map +1 -1
  199. app-rn-runtime/components/input/select/select.component.js +11 -3
  200. app-rn-runtime/components/input/select/select.component.js.map +1 -1
  201. app-rn-runtime/components/input/select/select.styles.js +24 -0
  202. app-rn-runtime/components/input/select/select.styles.js.map +1 -1
  203. app-rn-runtime/components/input/switch/switch.component.js +13 -3
  204. app-rn-runtime/components/input/switch/switch.component.js.map +1 -1
  205. app-rn-runtime/components/input/switch/switch.styles.js +15 -0
  206. app-rn-runtime/components/input/switch/switch.styles.js.map +1 -1
  207. app-rn-runtime/components/input/text/text.component.js +26 -2
  208. app-rn-runtime/components/input/text/text.component.js.map +1 -1
  209. app-rn-runtime/components/input/text/text.props.js +3 -0
  210. app-rn-runtime/components/input/text/text.props.js.map +1 -1
  211. app-rn-runtime/components/input/text/text.styles.js +3 -0
  212. app-rn-runtime/components/input/text/text.styles.js.map +1 -1
  213. app-rn-runtime/components/input/textarea/textarea.component.js +24 -1
  214. app-rn-runtime/components/input/textarea/textarea.component.js.map +1 -1
  215. app-rn-runtime/components/input/textarea/textarea.props.js +2 -0
  216. app-rn-runtime/components/input/textarea/textarea.props.js.map +1 -1
  217. app-rn-runtime/components/input/textarea/textarea.styles.js +3 -0
  218. app-rn-runtime/components/input/textarea/textarea.styles.js.map +1 -1
  219. app-rn-runtime/components/input/toggle/toggle.component.js +6 -0
  220. app-rn-runtime/components/input/toggle/toggle.component.js.map +1 -1
  221. app-rn-runtime/components/input/toggle/toggle.props.js +2 -0
  222. app-rn-runtime/components/input/toggle/toggle.props.js.map +1 -1
  223. app-rn-runtime/components/input/toggle/toggle.styles.js +7 -0
  224. app-rn-runtime/components/input/toggle/toggle.styles.js.map +1 -1
  225. app-rn-runtime/components/navigation/popover/popover.component.js.map +1 -1
  226. app-rn-runtime/components/page/content/content.component.js.map +1 -1
  227. app-rn-runtime/components/page/left-panel/left-panel.component.js +4 -1
  228. app-rn-runtime/components/page/left-panel/left-panel.component.js.map +1 -1
  229. app-rn-runtime/components/page/page-content/page-content.component.js +70 -14
  230. app-rn-runtime/components/page/page-content/page-content.component.js.map +1 -1
  231. app-rn-runtime/components/page/page-content/page-content.props.js +2 -2
  232. app-rn-runtime/components/page/page-content/page-content.props.js.map +1 -1
  233. app-rn-runtime/components/page/page-content/page-content.styles.js +6 -1
  234. app-rn-runtime/components/page/page-content/page-content.styles.js.map +1 -1
  235. app-rn-runtime/components/page/page.component.js.map +1 -1
  236. app-rn-runtime/components/page/page.props.js.map +1 -1
  237. app-rn-runtime/components/page/page.styles.js +7 -1
  238. app-rn-runtime/components/page/page.styles.js.map +1 -1
  239. app-rn-runtime/components/page/partial/partial.component.js +27 -1
  240. app-rn-runtime/components/page/partial/partial.component.js.map +1 -1
  241. app-rn-runtime/components/page/partial/partial.props.js.map +1 -1
  242. app-rn-runtime/components/page/partial/partial.styles.js +6 -1
  243. app-rn-runtime/components/page/partial/partial.styles.js.map +1 -1
  244. app-rn-runtime/components/prefab/prefab-container.component.js +27 -1
  245. app-rn-runtime/components/prefab/prefab-container.component.js.map +1 -1
  246. app-rn-runtime/components/prefab/prefab-container.props.js.map +1 -1
  247. app-rn-runtime/components/prefab/prefab-container.styles.js +6 -1
  248. app-rn-runtime/components/prefab/prefab-container.styles.js.map +1 -1
  249. app-rn-runtime/core/AppConfig.js.map +1 -1
  250. app-rn-runtime/core/base.component.js +33 -6
  251. app-rn-runtime/core/base.component.js.map +1 -1
  252. app-rn-runtime/core/components/textinput.component.js +9 -7
  253. app-rn-runtime/core/components/textinput.component.js.map +1 -1
  254. app-rn-runtime/core/props.provider.js +0 -1
  255. app-rn-runtime/core/props.provider.js.map +1 -1
  256. app-rn-runtime/core/storage.service.js +15 -0
  257. app-rn-runtime/core/storage.service.js.map +1 -1
  258. app-rn-runtime/core/tappable.component.js +10 -4
  259. app-rn-runtime/core/tappable.component.js.map +1 -1
  260. app-rn-runtime/core/utils.js +5 -0
  261. app-rn-runtime/core/utils.js.map +1 -1
  262. app-rn-runtime/core/wm-component-tree.js +58 -0
  263. app-rn-runtime/core/wm-component-tree.js.map +1 -0
  264. app-rn-runtime/package.json +13 -6
  265. app-rn-runtime/runtime/App.js +23 -9
  266. app-rn-runtime/runtime/App.js.map +1 -1
  267. app-rn-runtime/runtime/App.navigator.js +1 -0
  268. app-rn-runtime/runtime/App.navigator.js.map +1 -1
  269. app-rn-runtime/runtime/base-fragment.component.js +46 -13
  270. app-rn-runtime/runtime/base-fragment.component.js.map +1 -1
  271. app-rn-runtime/runtime/base-page.component.js +38 -2
  272. app-rn-runtime/runtime/base-page.component.js.map +1 -1
  273. app-rn-runtime/runtime/base-partial.component.js +3 -0
  274. app-rn-runtime/runtime/base-partial.component.js.map +1 -1
  275. app-rn-runtime/runtime/base-prefab.component.js.map +1 -1
  276. app-rn-runtime/runtime/navigator/drawer.navigator.js +19 -10
  277. app-rn-runtime/runtime/navigator/drawer.navigator.js.map +1 -1
  278. app-rn-runtime/runtime/services/app-modal.service.js +4 -4
  279. app-rn-runtime/runtime/services/app-modal.service.js.map +1 -1
  280. app-rn-runtime/runtime/services/app-security.service.js +17 -1
  281. app-rn-runtime/runtime/services/app-security.service.js.map +1 -1
  282. app-rn-runtime/styles/theme.js +10 -0
  283. app-rn-runtime/styles/theme.js.map +1 -1
  284. app-rn-runtime/styles/theme.variables.js +2 -1
  285. app-rn-runtime/styles/theme.variables.js.map +1 -1
  286. app-rn-runtime/variables/http.service.js +5 -1
  287. app-rn-runtime/variables/http.service.js.map +1 -1
  288. app-rn-runtime/variables/live-variable.js +14 -0
  289. app-rn-runtime/variables/live-variable.js.map +1 -1
@@ -1 +1 @@
1
- {"version":3,"names":["Platform","moment","FileSystem","isFunction","includes","isUndefined","isNull","orderBy","groupBy","toLower","get","forEach","sortBy","cloneDeep","keys","values","isArray","isString","isNumber","mime","ThemeVariables","GROUP_BY_OPTIONS","ALPHABET","WORD","OTHERS","TIME_ROLLUP_OPTIONS","HOUR","DAY","WEEK","MONTH","YEAR","_deepCopy","o1","o2","o","Object","k","v","deepCopy","objects","toBoolean","val","undefined","toNumber","parseFloat","e","encodeUrl","url","splits","split","hash","params","length","map","p","encodeURIComponent","join","encodeURI","isWebPreviewMode","OS","isDevMode","__DEV__","widgetsWithUndefinedValue","isAndroid","test","window","navigator","userAgent","isIos","getGroupKey","fieldDef","groupby","widgetScope","innerItem","apply","proxy","getGroupedData","fieldDefs","match","orderby","dateFormat","groupKey","groupedLiData","concatStr","toString","trim","substr","replace","format","getSortedGroupedData","getOrderedDataset","dataSet","items","fields","directions","obj","item","push","_groupedData","groupkey","index","liData","key","data","_groupIndex","isDefined","unStringify","defaultVal","number","parseInt","isNaN","retryIfFails","fn","interval","maxRetries","onBeforeRetry","Promise","resolve","retryCount","tryFn","reject","errorFn","errArgs","arguments","setTimeout","then","retry","getAbortableDefer","_defer","promise","onAbort","isAborted","abort","validateField","props","value","requiredCheck","regexCheck","required","errorType","isValid","regexp","condition","RegExp","maxchars","mindate","Date","datavalue","startOf","toDate","maxdate","endOf","countDecimalDigits","numberString","decimalMatch","decimalDigits","formatCompactNumber","isNegative","formattedNumber","toFixed","toBase64","path","readAsStringAsync","encoding","DATASET_WIDGETS","Set","isDataSetWidget","widget","has","isFullPathUrl","startsWith","removeUndefinedKeys","getDaysInMonth","month","year","getDate","getDates","startDate","endDate","getFullYear","daysInMonth","dates","Array","from","i","datesInRange","filter","date","monthNames","getMonths","startMonth","endMonth","months","name","substring","monthRange","_","getMonthIndex","monthName","shortName","monthNumber","findIndex","getYearRange","startYear","endYear","years","getDateObject","getHours","hours","hour","paddedHour","String","padStart","get24Hours","getMinutes","minutes","minute","paddedMinute","getTimeIndicators","getDateTimeObject","getGradientStartEnd","angle","angleLowerCase","toLowerCase","start","x","y","end","parseLinearGradient","gradient","color1","color2","linearGradientRegex","hasLinearGradient","matches","INSTANCE","primaryColor","validateInputOnDevice","type","_value$match","isCurrencyField","isValidText","validText","Number","isDateFormatAsPerPattern","datePattern","dateString","_date$format","toUpperCase","error","getMimeType","extensions","hasInvalidExtension","wildCards","extensionList","mimeType","extension","lookup","isWildCardExtension"],"sources":["utils.ts"],"sourcesContent":["import { Platform } from 'react-native';\nimport moment from \"moment\";\nimport * as FileSystem from \"expo-file-system\";\nimport { isFunction, includes, isUndefined, isNull, orderBy, groupBy, toLower, get, forEach, sortBy, cloneDeep, keys, values, isArray, isString, isNumber} from 'lodash';\nimport * as mime from 'react-native-mime-types';\nimport ThemeVariables from '../styles/theme.variables';\n\ndeclare const window: any;\nconst GROUP_BY_OPTIONS = {\n ALPHABET: 'alphabet',\n WORD: 'word',\n OTHERS: 'Others'\n};\nconst TIME_ROLLUP_OPTIONS = {\n HOUR: 'hour',\n DAY: 'day',\n WEEK: 'week',\n MONTH: 'month',\n YEAR: 'year'\n};\n\nconst _deepCopy = (o1: any, ...o2: any) => {\n o2.forEach((o: any) => {\n if (o) {\n Object.keys(o).forEach(k => {\n const v = o[k];\n if (v && !isString(v) && !isArray(v) && typeof v === 'object') {\n o1[k] = _deepCopy(o1[k] || {}, o[k]);\n } else {\n o1[k] = _deepCopy(v);\n }\n });\n }\n });\n return o1;\n};\n\nexport const deepCopy = (...objects: any) => _deepCopy({}, ...objects);\n\nexport const toBoolean = (val: any) => {\n return val === true\n || val === 'true'\n || !(val === false\n || val === null\n || val === undefined\n || val === '');\n};\n\nexport const toNumber = (val: any) => {\n try {\n return parseFloat(val) || 0;\n } catch(e) {\n return 0;\n }\n};\n\n/**\n * this method encodes the url and returns the encoded string\n */\n export const encodeUrl = (url: string): string => {\n let splits = url.split('#');\n const hash = splits[1];\n splits = splits[0].split('?');\n let params = '';\n if (splits.length > 1) {\n params = splits[1].split('&')\n .map(p => p.split('='))\n .map(p => p[0] +'=' + encodeURIComponent(p[1]))\n .join('&');\n }\n return encodeURI(splits[0]) + (params ? '?' + params: '') + (hash ? '#'+ hash : '');\n};\n\nexport const isWebPreviewMode = () => Platform.OS === 'web';\n\nexport const isDevMode = () => isWebPreviewMode() || __DEV__;\n\nexport const widgetsWithUndefinedValue = ['checkbox', 'toggle'];\n\nexport const isAndroid = () => (Platform.OS === 'android' || (Platform.OS === 'web' && /android/i.test(window.navigator.userAgent)));\n\nexport const isIos = () => (Platform.OS === 'ios' || (Platform.OS === 'web' && /iPhone|iPad/i.test(window.navigator.userAgent)));\n\nconst getGroupKey = (fieldDef: any, groupby: string, widgetScope: any, innerItem?: any) => isFunction(groupby) ? groupby.apply(widgetScope.proxy, [innerItem ? fieldDef[innerItem] : fieldDef]) : get(innerItem ? fieldDef[innerItem] : fieldDef, groupby);\n\n/**\n * This method prepares the grouped data.\n *\n * @param fieldDefs array of objects i.e. dataset\n * @param groupby string groupby\n * @param match string match\n * @param orderby string orderby\n * @param dateFormat string date format\n */\nexport const getGroupedData = (fieldDefs: any, groupby: string, match: string, orderby: string, dateFormat: string, widgetScope: any, innerItem?: any) => {\n\n // handling case-in-sensitive scenario\n // ordering the data based on groupby field. If there is innerItem then apply orderby using the innerItem's containing the groupby field.\n fieldDefs = orderBy(fieldDefs, fieldDef => {\n const groupKey = getGroupKey(fieldDef, groupby, widgetScope, innerItem);\n if (groupKey) {\n return toLower(groupKey);\n }\n return '';\n });\n\n // extract the grouped data based on the field obtained from 'groupDataByField'.\n const groupedLiData = groupBy(fieldDefs, function (fieldDef) {\n let concatStr = getGroupKey(fieldDef, groupby, widgetScope, innerItem);\n // by default set the undefined groupKey as 'others'\n if (isUndefined(concatStr) || isNull(concatStr) || concatStr.toString().trim() === '') {\n return GROUP_BY_OPTIONS.OTHERS;\n }\n // if match prop is alphabetic ,get the starting alphabet of the word as key.\n if (match === GROUP_BY_OPTIONS.ALPHABET) {\n concatStr = concatStr.substr(0, 1);\n }\n\n // if match contains the time options then get the concatStr using 'getTimeRolledUpString'\n if (includes(values(TIME_ROLLUP_OPTIONS), match)) {\n dateFormat = dateFormat && dateFormat.replace(/d/g, 'D');\n dateFormat = dateFormat && dateFormat.replace(/y/g, 'Y');\n concatStr = moment(concatStr).format(dateFormat);\n }\n\n return concatStr;\n });\n\n return getSortedGroupedData(groupedLiData, groupby, orderby, innerItem);\n};\n\n/**\n * function to get the ordered dataset based on the given orderby\n */\nexport const getOrderedDataset = (dataSet: any, orderby: string, innerItem?: any) => {\n if (!orderBy) {\n return cloneDeep(dataSet);\n }\n\n // The order by only works when the dataset contains list of objects.\n const items = orderby && orderby.split(','),\n fields: any = [],\n directions: any = [];\n items && items.forEach( obj => {\n const item = obj.split(':');\n fields.push(innerItem ? innerItem + '.' + item[0] : item[0]);\n directions.push(item[1]);\n });\n return orderBy(dataSet, fields, directions);\n};\n\n\n/**\n * This method returns sorted data based to groupkey.\n * Returns a array of objects, each object containing key which is groupKey and data is the sorted data which is sorted by groupby field in the data.\n *\n * @param groupedLiData, grouped data object with key as the groupKey and its value as the array of objects grouped under the groupKey.\n * @param groupBy, string groupby property\n * @returns {any[]}\n */\nexport const getSortedGroupedData = (groupedLiData: any, groupBy: string, orderby: string, innerItem?: any) => {\n const _groupedData: any = [];\n forEach(keys(groupedLiData), (groupkey, index) => {\n const liData = getOrderedDataset(groupedLiData[groupkey], orderby, innerItem);\n _groupedData.push({\n key: groupkey,\n data: sortBy(liData, data => {\n data._groupIndex = index;\n return get(data, groupBy) || get(data[innerItem], groupBy);\n })\n });\n });\n return _groupedData;\n};\n\nexport const isDefined = (v: any) => typeof v !== 'undefined';\n\n// try to convert the chekedvalue and unchecked values to boolean/number\nexport const unStringify = (val: any, defaultVal?: boolean) => {\n if (val === null) {\n return defaultVal;\n }\n\n if (val === true || val === 'true') {\n return true;\n }\n\n if (val === false || val === 'false') {\n return false;\n }\n\n const number = parseInt(val, 10);\n if (!isNaN(number)) {\n return number;\n }\n return val;\n};\n\n/**\n * This function invokes the given the function (fn) until the function successfully executes or the maximum number\n * of retries is reached or onBeforeRetry returns false.\n *\n * @param fn - a function that is needs to be invoked. The function can also return a promise as well.\n * @param interval - minimum time gap between successive retries. This argument should be greater or equal to 0.\n * @param maxRetries - maximum number of retries. This argument should be greater than 0. For all other values,\n * maxRetries is infinity.\n * @param onBeforeRetry - a callback function that will be invoked before re-invoking again. This function can\n * return false or a promise that is resolved to false to stop further retry attempts.\n * @returns {*} a promise that is resolved when fn is success (or) maximum retry attempts reached\n * (or) onBeforeRetry returned false.\n */\nexport const retryIfFails = (fn: Function, interval: number, maxRetries: number, onBeforeRetry = () => Promise.resolve(false)) => {\n let retryCount = 0;\n const tryFn = () => {\n retryCount++;\n if (isFunction(fn)) {\n return fn();\n }\n };\n maxRetries = (isNumber(maxRetries) && maxRetries > 0 ? maxRetries : 0);\n interval = (isNumber(interval) && interval > 0 ? interval : 0);\n return new Promise((resolve, reject) => {\n const errorFn = function () {\n const errArgs = arguments;\n setTimeout(() => {\n Promise.resolve().then(() => onBeforeRetry()).then(function (retry) {\n if (retry !== false && (!maxRetries || retryCount <= maxRetries)) {\n Promise.resolve().then(() => tryFn()).then(resolve, errorFn);\n } else {\n reject(errArgs);\n }\n }, () => reject(errArgs));\n }, interval);\n };\n Promise.resolve().then(() => tryFn()).then(resolve, errorFn);\n });\n};\n\n/**\n * Promise of a defer created using this function, has abort function that will reject the defer when called.\n * @returns {*} angular defer object\n */\nexport const getAbortableDefer = () => {\n const _defer: any = {\n promise: null,\n reject: null,\n resolve: null,\n onAbort: () => { },\n isAborted: false\n };\n _defer.promise = new Promise((resolve, reject) => {\n _defer.resolve = resolve;\n _defer.reject = reject;\n });\n _defer.promise.abort = () => {\n _defer.onAbort && _defer.onAbort();\n _defer.reject('aborted');\n _defer.isAborted = true;\n };\n return _defer;\n};\n\nexport const validateField = (props: any, value: any) => {\n let requiredCheck = true, regexCheck = true;\n if (props.required) {\n if (isArray(value)) {\n requiredCheck = value.length === 0 ? false : true\n } else {\n requiredCheck = !value ? false : true\n }\n if (!requiredCheck) {\n return {\n errorType : 'required',\n isValid: false\n }\n }\n }\n if (value && props.regexp) {\n const condition = new RegExp(\"^\" + props.regexp + \"$\", 'g');\n regexCheck = condition.test(value);\n if (!regexCheck) {\n return {\n errorType : 'regexp',\n isValid: false\n }\n }\n }\n if (value && props.maxchars && value.length > props.maxchars) {\n return {\n errorType : 'maxchars',\n isValid: false\n }\n\n }\n if (value && props.mindate && new Date(props.datavalue) < moment(props.mindate).startOf('day').toDate()) {\n return {\n errorType : 'mindate',\n isValid: false\n }\n }\n if (value && props.maxdate && new Date(props.datavalue) > moment(props.maxdate).endOf('day').toDate()) {\n return {\n errorType : 'maxdate',\n isValid: false\n }\n }\n\n return {\n isValid: true\n }\n};\n\nexport const countDecimalDigits = (number: number | string) => {\n if (!number) return 0;\n\n // * convert the number to a string\n const numberString = number.toString();\n \n // * regular expression to match and count the decimal digits\n const decimalMatch = numberString.match(/\\.(\\d+)/);\n\n if (decimalMatch) {\n const decimalDigits = decimalMatch[1];\n return decimalDigits.length;\n } else {\n return 0; // * no decimal digits found\n }\n}\n\nexport const formatCompactNumber = (number: number) => {\n const isNegative = number < 0;\n number = isNegative ? number * -1 : number;\n let formattedNumber = number + '';\n if (number >= 1000 && number < 1_000_000) {\n formattedNumber = (number / 1000).toFixed(1).replace(/\\.0$/, \"\") + \"K\";\n } else if (number >= 1_000_000 && number < 1_000_000_000) {\n formattedNumber = (number / 1_000_000).toFixed(1).replace(/\\.0$/, \"\") + \"M\";\n } else if (number >= 1_000_000_000 && number < 1_000_000_000_000) {\n formattedNumber = (number / 1_000_000_000).toFixed(1).replace(/\\.0$/, \"\") + \"B\";\n } else if (number >= 1_000_000_000_000 && number < 1_000_000_000_000_000) {\n formattedNumber = (number / 1_000_000_000_000).toFixed(1).replace(/\\.0$/, \"\") + \"T\";\n }\n return (isNegative ? '-' : '') + formattedNumber;\n}\n\nexport const toBase64 = function(path: string) {\n return FileSystem.readAsStringAsync(path, { encoding: 'base64' });\n};\n\nconst DATASET_WIDGETS = new Set([ 'select', 'checkboxset', 'radioset', 'switch', 'autocomplete', 'chips', 'typeahead', 'rating']);\nexport const isDataSetWidget = (widget: any) => {\n return DATASET_WIDGETS.has(widget);\n};\nexport const isFullPathUrl = (url: string) => {\n return isString(url) &&\n (url.startsWith('data:') \n || url.startsWith('http:') \n || url.startsWith('https:') \n || url.startsWith('file:'));\n};\n\nexport function removeUndefinedKeys(obj: any) {\n for (const key in obj) {\n if (obj[key] === undefined) {\n delete obj[key];\n } else if (typeof obj[key] === 'object') {\n // * if the value is an object, recursively call the function\n removeUndefinedKeys(obj[key]);\n }\n }\n\n return obj;\n}\n// * get total number of days in a month of a year\nfunction getDaysInMonth(month: number, year: number) {\n return new Date(year, month, 0).getDate();\n}\n\nexport const getDates = (\n startDate: number,\n endDate: number,\n month = 0, // zero-based\n year = new Date().getFullYear(),\n) => {\n const daysInMonth = getDaysInMonth(month, year);\n const dates = Array.from({length: daysInMonth}, (v, i) => i + 1);\n\n const datesInRange = dates.filter(date => date >= startDate);\n\n return datesInRange;\n};\n\nexport const monthNames = [\n 'January',\n 'February',\n 'March',\n 'April',\n 'May',\n 'June',\n 'July',\n 'August',\n 'September',\n 'October',\n 'November',\n 'December',\n];\n\nexport const getMonths = (startMonth: number, endMonth: number) => {\n const months = monthNames.map(name => name.substring(0, 3));\n const monthRange = months.filter((_, index) => index >= startMonth)\n\n return monthRange;\n};\n\nexport const getMonthIndex = (monthName: string, shortName: boolean = true) => {\n const months = shortName ? monthNames.map(name => name.substring(0, 3)) : monthNames;\n const monthNumber = months.findIndex((name) => name === monthName);\n\n return monthNumber;\n}\n\nexport const getYearRange = (\n startYear: number = 1950,\n endYear: number = 2060,\n) => {\n const years = [];\n for (let year = startYear; year <= endYear; ++year) {\n years.push(year);\n }\n\n return years;\n};\n\nexport const getDateObject = (date: number, month: number, year: number) => {\n // * month is zero-based\n return new Date(year, month, date);\n};\n\nexport const getHours = () => {\n const hours = [];\n for (let hour = 1; hour <= 12; ++hour) {\n const paddedHour = String(hour).padStart(2, '0');\n hours.push(paddedHour);\n }\n\n return hours;\n}\n\nexport const get24Hours = () => {\n const hours = [];\n for (let hour = 0; hour <= 23; ++hour) {\n const paddedHour = String(hour).padStart(2, '0');\n hours.push(paddedHour);\n }\n\n return hours;\n}\n\nexport const getMinutes = () => {\n const minutes = [];\n for (let minute = 0; minute <= 59; ++minute) {\n const paddedMinute = String(minute).padStart(2, '0');\n minutes.push(paddedMinute);\n }\n\n return minutes;\n}\n\nexport const getTimeIndicators = () => {\n return ['AM', 'PM'];\n}\n\nexport const getDateTimeObject = (date: number, month: number, year: number, hour: number, minute: number) => {\n // * month is zero-based\n return new Date(year, month, date, hour, minute);\n};\n\nexport const getGradientStartEnd = (angle: string) => {\n const angleLowerCase = angle?.toLowerCase();\n let start = { x: 0, y: 1 };\n let end = { x: 1, y: 1 };\n\n if (angle === '0deg' || angleLowerCase === 'to top') {\n end.x = 0;\n end.y = 0;\n } else if (angle === '90deg' || angleLowerCase === 'to right') {\n start.x = 0;\n } else if (angle === '180deg' || angleLowerCase === 'to bottom') {\n start.y = 0;\n end.x = 0;\n end.y = 1;\n } else if (angle === '270deg' || angleLowerCase === 'to left') {\n start.x = 1;\n end.x = 0;\n } else {\n // other angle\n }\n\n return {start, end}\n}\n\nexport const parseLinearGradient = (gradient: string) => {\n let angle = '', color1 = '', color2 = '';\n const linearGradientRegex = /linear-gradient\\(([^,]+),\\s*([^,]+),\\s*([^)]+)\\)/;\n const hasLinearGradient = linearGradientRegex.test(gradient);\n\n const matches = gradient?.match(linearGradientRegex);\n angle = matches?.[1] || '90deg';\n const {start, end} = getGradientStartEnd(angle)\n color1 = matches?.[2] || ThemeVariables.INSTANCE.primaryColor;\n color2 = matches?.[3] || ThemeVariables.INSTANCE.primaryColor;\n\n return {hasLinearGradient, color1, color2, start, end};\n}\n\nexport const validateInputOnDevice = (value: string, type: 'number' | 'currency') => {\n const isCurrencyField = type === 'currency';\n let isValidText = true;\n let validText = value;\n \n // * no alphabets except E, may contain E only once\n if (/[a-df-zA-DF-Z]/.test(value) || !/^[^eE]*[eE]?[^eE]*$/.test(value)) {\n isValidText = false;\n validText = validText.replace(/[a-df-zA-DF-Z]/g, '');\n validText = validText.replace(/([eE])\\1+/g, 'e');\n }\n\n // * currency only: check for negative number\n if (isCurrencyField && (Number(value) < 0 || /-/g.test(value))) {\n isValidText = false;\n validText = validText.replace(/-/g, '');\n }\n\n // * number only: not more than one minus and doesn't end with minus (-)\n if (!isCurrencyField && (Number(value.match(/-/g)?.length) > 1) || /\\w-/.test(value)) {\n isValidText = false;\n validText = validText.replace(/-/g, '');\n validText = validText.replace(/\\w-/g, '');\n }\n\n // * check for more than one decimal point\n if (/^\\d*\\.\\d*\\..*$/.test(value)) {\n isValidText = false;\n validText = validText.replace(/\\.(?=\\.*\\.)/g, '');\n }\n\n // * check for spaces and comma\n if (/[\\s,]/.test(value)) {\n isValidText = false;\n validText = validText.replace(/[\\s,]/, '');\n }\n\n return {isValidText, validText};\n}\n\nexport const isDateFormatAsPerPattern = (\n datePattern?: string,\n dateString?: string | Date\n) => {\n try {\n // * format dateString as per datePattern\n const date = moment(dateString, datePattern, true);\n\n // * check date is valid and matches the format\n return date.isValid() && typeof dateString === 'string' && dateString?.toUpperCase() === date.format(datePattern)?.toUpperCase();\n } catch (error) {\n // * if not able to parse date string\n return false;\n }\n};\n\nexport const getMimeType = (extensions?: string) => {\n if (!extensions) return '*/*';\n let hasInvalidExtension = false;\n let wildCards = ['image/*', 'audio/*', 'video/*'];\n let extensionList = extensions.split(' ');\n let mimeType = extensionList\n .map((extension: string) => {\n let type = mime.lookup(extension);\n let isWildCardExtension = wildCards.includes(extension);\n // * invalid extension, also not in wildcards\n hasInvalidExtension = !type && !isWildCardExtension;\n return type ? type : isWildCardExtension ? extension : '';\n })\n .filter((type) => type);\n\n if (hasInvalidExtension) return '*/*';\n return mimeType;\n};\n"],"mappings":"AAAA,SAASA,QAAQ,QAAQ,cAAc;AACvC,OAAOC,MAAM,MAAM,QAAQ;AAC3B,OAAO,KAAKC,UAAU,MAAM,kBAAkB;AAC9C,SAASC,UAAU,EAAEC,QAAQ,EAAEC,WAAW,EAAEC,MAAM,EAAEC,OAAO,EAAEC,OAAO,EAAEC,OAAO,EAAEC,GAAG,EAAEC,OAAO,EAAEC,MAAM,EAAEC,SAAS,EAAEC,IAAI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,KAAK;EACrC,OAAOG,QAAQ;AACjB,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["Platform","moment","FileSystem","isFunction","includes","isUndefined","isNull","orderBy","groupBy","toLower","get","forEach","sortBy","cloneDeep","keys","values","isArray","isString","isNumber","mime","ThemeVariables","GROUP_BY_OPTIONS","ALPHABET","WORD","OTHERS","TIME_ROLLUP_OPTIONS","HOUR","DAY","WEEK","MONTH","YEAR","_deepCopy","o1","o2","o","Object","k","v","deepCopy","objects","toBoolean","val","undefined","toNumber","parseFloat","e","encodeUrl","url","splits","split","hash","params","length","map","p","encodeURIComponent","join","encodeURI","isWebPreviewMode","OS","isDevMode","__DEV__","widgetsWithUndefinedValue","isAndroid","test","window","navigator","userAgent","isIos","getGroupKey","fieldDef","groupby","widgetScope","innerItem","apply","proxy","getGroupedData","fieldDefs","match","orderby","dateFormat","groupKey","groupedLiData","concatStr","toString","trim","substr","replace","format","getSortedGroupedData","getOrderedDataset","dataSet","items","fields","directions","obj","item","push","_groupedData","groupkey","index","liData","key","data","_groupIndex","isDefined","unStringify","defaultVal","number","parseInt","isNaN","retryIfFails","fn","interval","maxRetries","onBeforeRetry","Promise","resolve","retryCount","tryFn","reject","errorFn","errArgs","arguments","setTimeout","then","retry","getAbortableDefer","_defer","promise","onAbort","isAborted","abort","validateField","props","value","requiredCheck","regexCheck","required","errorType","isValid","regexp","condition","RegExp","maxchars","mindate","Date","datavalue","startOf","toDate","maxdate","endOf","countDecimalDigits","numberString","decimalMatch","decimalDigits","formatCompactNumber","isNegative","formattedNumber","toFixed","toBase64","path","readAsStringAsync","encoding","DATASET_WIDGETS","Set","isDataSetWidget","widget","has","isFullPathUrl","startsWith","removeUndefinedKeys","getDaysInMonth","month","year","getDate","getDates","startDate","endDate","getFullYear","daysInMonth","dates","Array","from","i","datesInRange","filter","date","monthNames","getMonths","startMonth","endMonth","months","name","substring","monthRange","_","getMonthIndex","monthName","shortName","monthNumber","findIndex","getYearRange","startYear","endYear","years","getDateObject","getHours","hours","hour","paddedHour","String","padStart","get24Hours","getMinutes","minutes","minute","paddedMinute","getTimeIndicators","getDateTimeObject","getGradientStartEnd","angle","angleLowerCase","toLowerCase","start","x","y","end","parseLinearGradient","gradient","color1","color2","linearGradientRegex","hasLinearGradient","matches","INSTANCE","primaryColor","validateInputOnDevice","type","_value$match","isCurrencyField","isValidText","validText","Number","isDateFormatAsPerPattern","datePattern","dateString","_date$format","toUpperCase","error","getMimeType","extensions","hasInvalidExtension","wildCards","extensionList","mimeType","extension","lookup","isWildCardExtension","getNumberOfEmptyObjects","noOfItems"],"sources":["utils.ts"],"sourcesContent":["import { Platform } from 'react-native';\nimport moment from \"moment\";\nimport * as FileSystem from \"expo-file-system\";\nimport { isFunction, includes, isUndefined, isNull, orderBy, groupBy, toLower, get, forEach, sortBy, cloneDeep, keys, values, isArray, isString, isNumber} from 'lodash';\nimport * as mime from 'react-native-mime-types';\nimport ThemeVariables from '../styles/theme.variables';\n\ndeclare const window: any;\nconst GROUP_BY_OPTIONS = {\n ALPHABET: 'alphabet',\n WORD: 'word',\n OTHERS: 'Others'\n};\nconst TIME_ROLLUP_OPTIONS = {\n HOUR: 'hour',\n DAY: 'day',\n WEEK: 'week',\n MONTH: 'month',\n YEAR: 'year'\n};\n\nconst _deepCopy = (o1: any, ...o2: any) => {\n o2.forEach((o: any) => {\n if (o) {\n Object.keys(o).forEach(k => {\n const v = o[k];\n if (v && !isString(v) && !isArray(v) && typeof v === 'object') {\n o1[k] = _deepCopy(o1[k] || {}, o[k]);\n } else {\n o1[k] = _deepCopy(v);\n }\n });\n }\n });\n return o1;\n};\n\nexport const deepCopy = (...objects: any) => _deepCopy({}, ...objects);\n\nexport const toBoolean = (val: any) => {\n return val === true\n || val === 'true'\n || !(val === false\n || val === null\n || val === undefined\n || val === '');\n};\n\nexport const toNumber = (val: any) => {\n try {\n return parseFloat(val) || 0;\n } catch(e) {\n return 0;\n }\n};\n\n/**\n * this method encodes the url and returns the encoded string\n */\n export const encodeUrl = (url: string): string => {\n let splits = url.split('#');\n const hash = splits[1];\n splits = splits[0].split('?');\n let params = '';\n if (splits.length > 1) {\n params = splits[1].split('&')\n .map(p => p.split('='))\n .map(p => p[0] +'=' + encodeURIComponent(p[1]))\n .join('&');\n }\n return encodeURI(splits[0]) + (params ? '?' + params: '') + (hash ? '#'+ hash : '');\n};\n\nexport const isWebPreviewMode = () => Platform.OS === 'web';\n\nexport const isDevMode = () => isWebPreviewMode() || __DEV__;\n\nexport const widgetsWithUndefinedValue = ['checkbox', 'toggle'];\n\nexport const isAndroid = () => (Platform.OS === 'android' || (Platform.OS === 'web' && /android/i.test(window.navigator.userAgent)));\n\nexport const isIos = () => (Platform.OS === 'ios' || (Platform.OS === 'web' && /iPhone|iPad/i.test(window.navigator.userAgent)));\n\nconst getGroupKey = (fieldDef: any, groupby: string, widgetScope: any, innerItem?: any) => isFunction(groupby) ? groupby.apply(widgetScope.proxy, [innerItem ? fieldDef[innerItem] : fieldDef]) : get(innerItem ? fieldDef[innerItem] : fieldDef, groupby);\n\n/**\n * This method prepares the grouped data.\n *\n * @param fieldDefs array of objects i.e. dataset\n * @param groupby string groupby\n * @param match string match\n * @param orderby string orderby\n * @param dateFormat string date format\n */\nexport const getGroupedData = (fieldDefs: any, groupby: string, match: string, orderby: string, dateFormat: string, widgetScope: any, innerItem?: any) => {\n\n // handling case-in-sensitive scenario\n // ordering the data based on groupby field. If there is innerItem then apply orderby using the innerItem's containing the groupby field.\n fieldDefs = orderBy(fieldDefs, fieldDef => {\n const groupKey = getGroupKey(fieldDef, groupby, widgetScope, innerItem);\n if (groupKey) {\n return toLower(groupKey);\n }\n return '';\n });\n\n // extract the grouped data based on the field obtained from 'groupDataByField'.\n const groupedLiData = groupBy(fieldDefs, function (fieldDef) {\n let concatStr = getGroupKey(fieldDef, groupby, widgetScope, innerItem);\n // by default set the undefined groupKey as 'others'\n if (isUndefined(concatStr) || isNull(concatStr) || concatStr.toString().trim() === '') {\n return GROUP_BY_OPTIONS.OTHERS;\n }\n // if match prop is alphabetic ,get the starting alphabet of the word as key.\n if (match === GROUP_BY_OPTIONS.ALPHABET) {\n concatStr = concatStr.substr(0, 1);\n }\n\n // if match contains the time options then get the concatStr using 'getTimeRolledUpString'\n if (includes(values(TIME_ROLLUP_OPTIONS), match)) {\n dateFormat = dateFormat && dateFormat.replace(/d/g, 'D');\n dateFormat = dateFormat && dateFormat.replace(/y/g, 'Y');\n concatStr = moment(concatStr).format(dateFormat);\n }\n\n return concatStr;\n });\n\n return getSortedGroupedData(groupedLiData, groupby, orderby, innerItem);\n};\n\n/**\n * function to get the ordered dataset based on the given orderby\n */\nexport const getOrderedDataset = (dataSet: any, orderby: string, innerItem?: any) => {\n if (!orderBy) {\n return cloneDeep(dataSet);\n }\n\n // The order by only works when the dataset contains list of objects.\n const items = orderby && orderby.split(','),\n fields: any = [],\n directions: any = [];\n items && items.forEach( obj => {\n const item = obj.split(':');\n fields.push(innerItem ? innerItem + '.' + item[0] : item[0]);\n directions.push(item[1]);\n });\n return orderBy(dataSet, fields, directions);\n};\n\n\n/**\n * This method returns sorted data based to groupkey.\n * Returns a array of objects, each object containing key which is groupKey and data is the sorted data which is sorted by groupby field in the data.\n *\n * @param groupedLiData, grouped data object with key as the groupKey and its value as the array of objects grouped under the groupKey.\n * @param groupBy, string groupby property\n * @returns {any[]}\n */\nexport const getSortedGroupedData = (groupedLiData: any, groupBy: string, orderby: string, innerItem?: any) => {\n const _groupedData: any = [];\n forEach(keys(groupedLiData), (groupkey, index) => {\n const liData = getOrderedDataset(groupedLiData[groupkey], orderby, innerItem);\n _groupedData.push({\n key: groupkey,\n data: sortBy(liData, data => {\n data._groupIndex = index;\n return get(data, groupBy) || get(data[innerItem], groupBy);\n })\n });\n });\n return _groupedData;\n};\n\nexport const isDefined = (v: any) => typeof v !== 'undefined';\n\n// try to convert the chekedvalue and unchecked values to boolean/number\nexport const unStringify = (val: any, defaultVal?: boolean) => {\n if (val === null) {\n return defaultVal;\n }\n\n if (val === true || val === 'true') {\n return true;\n }\n\n if (val === false || val === 'false') {\n return false;\n }\n\n const number = parseInt(val, 10);\n if (!isNaN(number)) {\n return number;\n }\n return val;\n};\n\n/**\n * This function invokes the given the function (fn) until the function successfully executes or the maximum number\n * of retries is reached or onBeforeRetry returns false.\n *\n * @param fn - a function that is needs to be invoked. The function can also return a promise as well.\n * @param interval - minimum time gap between successive retries. This argument should be greater or equal to 0.\n * @param maxRetries - maximum number of retries. This argument should be greater than 0. For all other values,\n * maxRetries is infinity.\n * @param onBeforeRetry - a callback function that will be invoked before re-invoking again. This function can\n * return false or a promise that is resolved to false to stop further retry attempts.\n * @returns {*} a promise that is resolved when fn is success (or) maximum retry attempts reached\n * (or) onBeforeRetry returned false.\n */\nexport const retryIfFails = (fn: Function, interval: number, maxRetries: number, onBeforeRetry = () => Promise.resolve(false)) => {\n let retryCount = 0;\n const tryFn = () => {\n retryCount++;\n if (isFunction(fn)) {\n return fn();\n }\n };\n maxRetries = (isNumber(maxRetries) && maxRetries > 0 ? maxRetries : 0);\n interval = (isNumber(interval) && interval > 0 ? interval : 0);\n return new Promise((resolve, reject) => {\n const errorFn = function () {\n const errArgs = arguments;\n setTimeout(() => {\n Promise.resolve().then(() => onBeforeRetry()).then(function (retry) {\n if (retry !== false && (!maxRetries || retryCount <= maxRetries)) {\n Promise.resolve().then(() => tryFn()).then(resolve, errorFn);\n } else {\n reject(errArgs);\n }\n }, () => reject(errArgs));\n }, interval);\n };\n Promise.resolve().then(() => tryFn()).then(resolve, errorFn);\n });\n};\n\n/**\n * Promise of a defer created using this function, has abort function that will reject the defer when called.\n * @returns {*} angular defer object\n */\nexport const getAbortableDefer = () => {\n const _defer: any = {\n promise: null,\n reject: null,\n resolve: null,\n onAbort: () => { },\n isAborted: false\n };\n _defer.promise = new Promise((resolve, reject) => {\n _defer.resolve = resolve;\n _defer.reject = reject;\n });\n _defer.promise.abort = () => {\n _defer.onAbort && _defer.onAbort();\n _defer.reject('aborted');\n _defer.isAborted = true;\n };\n return _defer;\n};\n\nexport const validateField = (props: any, value: any) => {\n let requiredCheck = true, regexCheck = true;\n if (props.required) {\n if (isArray(value)) {\n requiredCheck = value.length === 0 ? false : true\n } else {\n requiredCheck = !value ? false : true\n }\n if (!requiredCheck) {\n return {\n errorType : 'required',\n isValid: false\n }\n }\n }\n if (value && props.regexp) {\n const condition = new RegExp(\"^\" + props.regexp + \"$\", 'g');\n regexCheck = condition.test(value);\n if (!regexCheck) {\n return {\n errorType : 'regexp',\n isValid: false\n }\n }\n }\n if (value && props.maxchars && value.length > props.maxchars) {\n return {\n errorType : 'maxchars',\n isValid: false\n }\n\n }\n if (value && props.mindate && new Date(props.datavalue) < moment(props.mindate).startOf('day').toDate()) {\n return {\n errorType : 'mindate',\n isValid: false\n }\n }\n if (value && props.maxdate && new Date(props.datavalue) > moment(props.maxdate).endOf('day').toDate()) {\n return {\n errorType : 'maxdate',\n isValid: false\n }\n }\n\n return {\n isValid: true\n }\n};\n\nexport const countDecimalDigits = (number: number | string) => {\n if (!number) return 0;\n\n // * convert the number to a string\n const numberString = number.toString();\n \n // * regular expression to match and count the decimal digits\n const decimalMatch = numberString.match(/\\.(\\d+)/);\n\n if (decimalMatch) {\n const decimalDigits = decimalMatch[1];\n return decimalDigits.length;\n } else {\n return 0; // * no decimal digits found\n }\n}\n\nexport const formatCompactNumber = (number: number) => {\n const isNegative = number < 0;\n number = isNegative ? number * -1 : number;\n let formattedNumber = number + '';\n if (number >= 1000 && number < 1_000_000) {\n formattedNumber = (number / 1000).toFixed(1).replace(/\\.0$/, \"\") + \"K\";\n } else if (number >= 1_000_000 && number < 1_000_000_000) {\n formattedNumber = (number / 1_000_000).toFixed(1).replace(/\\.0$/, \"\") + \"M\";\n } else if (number >= 1_000_000_000 && number < 1_000_000_000_000) {\n formattedNumber = (number / 1_000_000_000).toFixed(1).replace(/\\.0$/, \"\") + \"B\";\n } else if (number >= 1_000_000_000_000 && number < 1_000_000_000_000_000) {\n formattedNumber = (number / 1_000_000_000_000).toFixed(1).replace(/\\.0$/, \"\") + \"T\";\n }\n return (isNegative ? '-' : '') + formattedNumber;\n}\n\nexport const toBase64 = function(path: string) {\n return FileSystem.readAsStringAsync(path, { encoding: 'base64' });\n};\n\nconst DATASET_WIDGETS = new Set([ 'select', 'checkboxset', 'radioset', 'switch', 'autocomplete', 'chips', 'typeahead', 'rating']);\nexport const isDataSetWidget = (widget: any) => {\n return DATASET_WIDGETS.has(widget);\n};\nexport const isFullPathUrl = (url: string) => {\n return isString(url) &&\n (url.startsWith('data:') \n || url.startsWith('http:') \n || url.startsWith('https:') \n || url.startsWith('file:'));\n};\n\nexport function removeUndefinedKeys(obj: any) {\n for (const key in obj) {\n if (obj[key] === undefined) {\n delete obj[key];\n } else if (typeof obj[key] === 'object') {\n // * if the value is an object, recursively call the function\n removeUndefinedKeys(obj[key]);\n }\n }\n\n return obj;\n}\n// * get total number of days in a month of a year\nfunction getDaysInMonth(month: number, year: number) {\n return new Date(year, month, 0).getDate();\n}\n\nexport const getDates = (\n startDate: number,\n endDate: number,\n month = 0, // zero-based\n year = new Date().getFullYear(),\n) => {\n const daysInMonth = getDaysInMonth(month, year);\n const dates = Array.from({length: daysInMonth}, (v, i) => i + 1);\n\n const datesInRange = dates.filter(date => date >= startDate);\n\n return datesInRange;\n};\n\nexport const monthNames = [\n 'January',\n 'February',\n 'March',\n 'April',\n 'May',\n 'June',\n 'July',\n 'August',\n 'September',\n 'October',\n 'November',\n 'December',\n];\n\nexport const getMonths = (startMonth: number, endMonth: number) => {\n const months = monthNames.map(name => name.substring(0, 3));\n const monthRange = months.filter((_, index) => index >= startMonth)\n\n return monthRange;\n};\n\nexport const getMonthIndex = (monthName: string, shortName: boolean = true) => {\n const months = shortName ? monthNames.map(name => name.substring(0, 3)) : monthNames;\n const monthNumber = months.findIndex((name) => name === monthName);\n\n return monthNumber;\n}\n\nexport const getYearRange = (\n startYear: number = 1950,\n endYear: number = 2060,\n) => {\n const years = [];\n for (let year = startYear; year <= endYear; ++year) {\n years.push(year);\n }\n\n return years;\n};\n\nexport const getDateObject = (date: number, month: number, year: number) => {\n // * month is zero-based\n return new Date(year, month, date);\n};\n\nexport const getHours = () => {\n const hours = [];\n for (let hour = 1; hour <= 12; ++hour) {\n const paddedHour = String(hour).padStart(2, '0');\n hours.push(paddedHour);\n }\n\n return hours;\n}\n\nexport const get24Hours = () => {\n const hours = [];\n for (let hour = 0; hour <= 23; ++hour) {\n const paddedHour = String(hour).padStart(2, '0');\n hours.push(paddedHour);\n }\n\n return hours;\n}\n\nexport const getMinutes = () => {\n const minutes = [];\n for (let minute = 0; minute <= 59; ++minute) {\n const paddedMinute = String(minute).padStart(2, '0');\n minutes.push(paddedMinute);\n }\n\n return minutes;\n}\n\nexport const getTimeIndicators = () => {\n return ['AM', 'PM'];\n}\n\nexport const getDateTimeObject = (date: number, month: number, year: number, hour: number, minute: number) => {\n // * month is zero-based\n return new Date(year, month, date, hour, minute);\n};\n\nexport const getGradientStartEnd = (angle: string) => {\n const angleLowerCase = angle?.toLowerCase();\n let start = { x: 0, y: 1 };\n let end = { x: 1, y: 1 };\n\n if (angle === '0deg' || angleLowerCase === 'to top') {\n end.x = 0;\n end.y = 0;\n } else if (angle === '90deg' || angleLowerCase === 'to right') {\n start.x = 0;\n } else if (angle === '180deg' || angleLowerCase === 'to bottom') {\n start.y = 0;\n end.x = 0;\n end.y = 1;\n } else if (angle === '270deg' || angleLowerCase === 'to left') {\n start.x = 1;\n end.x = 0;\n } else {\n // other angle\n }\n\n return {start, end}\n}\n\nexport const parseLinearGradient = (gradient: string) => {\n let angle = '', color1 = '', color2 = '';\n const linearGradientRegex = /linear-gradient\\(([^,]+),\\s*([^,]+),\\s*([^)]+)\\)/;\n const hasLinearGradient = linearGradientRegex.test(gradient);\n\n const matches = gradient?.match(linearGradientRegex);\n angle = matches?.[1] || '90deg';\n const {start, end} = getGradientStartEnd(angle)\n color1 = matches?.[2] || ThemeVariables.INSTANCE.primaryColor;\n color2 = matches?.[3] || ThemeVariables.INSTANCE.primaryColor;\n\n return {hasLinearGradient, color1, color2, start, end};\n}\n\nexport const validateInputOnDevice = (value: string, type: 'number' | 'currency') => {\n const isCurrencyField = type === 'currency';\n let isValidText = true;\n let validText = value;\n \n // * no alphabets except E, may contain E only once\n if (/[a-df-zA-DF-Z]/.test(value) || !/^[^eE]*[eE]?[^eE]*$/.test(value)) {\n isValidText = false;\n validText = validText.replace(/[a-df-zA-DF-Z]/g, '');\n validText = validText.replace(/([eE])\\1+/g, 'e');\n }\n\n // * currency only: check for negative number\n if (isCurrencyField && (Number(value) < 0 || /-/g.test(value))) {\n isValidText = false;\n validText = validText.replace(/-/g, '');\n }\n\n // * number only: not more than one minus and doesn't end with minus (-)\n if (!isCurrencyField && (Number(value.match(/-/g)?.length) > 1) || /\\w-/.test(value)) {\n isValidText = false;\n validText = validText.replace(/-/g, '');\n validText = validText.replace(/\\w-/g, '');\n }\n\n // * check for more than one decimal point\n if (/^\\d*\\.\\d*\\..*$/.test(value)) {\n isValidText = false;\n validText = validText.replace(/\\.(?=\\.*\\.)/g, '');\n }\n\n // * check for spaces and comma\n if (/[\\s,]/.test(value)) {\n isValidText = false;\n validText = validText.replace(/[\\s,]/, '');\n }\n\n return {isValidText, validText};\n}\n\nexport const isDateFormatAsPerPattern = (\n datePattern?: string,\n dateString?: string | Date\n) => {\n try {\n // * format dateString as per datePattern\n const date = moment(dateString, datePattern, true);\n\n // * check date is valid and matches the format\n return date.isValid() && typeof dateString === 'string' && dateString?.toUpperCase() === date.format(datePattern)?.toUpperCase();\n } catch (error) {\n // * if not able to parse date string\n return false;\n }\n};\n\nexport const getMimeType = (extensions?: string) => {\n if (!extensions) return '*/*';\n let hasInvalidExtension = false;\n let wildCards = ['image/*', 'audio/*', 'video/*'];\n let extensionList = extensions.split(' ');\n let mimeType = extensionList\n .map((extension: string) => {\n let type = mime.lookup(extension);\n let isWildCardExtension = wildCards.includes(extension);\n // * invalid extension, also not in wildcards\n hasInvalidExtension = !type && !isWildCardExtension;\n return type ? type : isWildCardExtension ? extension : '';\n })\n .filter((type) => type);\n\n if (hasInvalidExtension) return '*/*';\n return mimeType;\n};\n\nexport function getNumberOfEmptyObjects(noOfItems: number) {\n return Array.from({ length: noOfItems }, () => ({}));\n}\n"],"mappings":"AAAA,SAASA,QAAQ,QAAQ,cAAc;AACvC,OAAOC,MAAM,MAAM,QAAQ;AAC3B,OAAO,KAAKC,UAAU,MAAM,kBAAkB;AAC9C,SAASC,UAAU,EAAEC,QAAQ,EAAEC,WAAW,EAAEC,MAAM,EAAEC,OAAO,EAAEC,OAAO,EAAEC,OAAO,EAAEC,GAAG,EAAEC,OAAO,EAAEC,MAAM,EAAEC,SAAS,EAAEC,IAAI,EAAEC,MAAM,EAAEC,OAAO,EAAEC,QAAQ,EAAEC,QAAQ,QAAO,QAAQ;AACxK,OAAO,KAAKC,IAAI,MAAM,yBAAyB;AAC/C,OAAOC,cAAc,MAAM,2BAA2B;AAGtD,MAAMC,gBAAgB,GAAG;EACvBC,QAAQ,EAAE,UAAU;EACpBC,IAAI,EAAE,MAAM;EACZC,MAAM,EAAE;AACV,CAAC;AACD,MAAMC,mBAAmB,GAAG;EAC1BC,IAAI,EAAE,MAAM;EACZC,GAAG,EAAE,KAAK;EACVC,IAAI,EAAE,MAAM;EACZC,KAAK,EAAE,OAAO;EACdC,IAAI,EAAE;AACR,CAAC;AAED,MAAMC,SAAS,GAAGA,CAACC,EAAO,EAAE,GAAGC,EAAO,KAAK;EACvCA,EAAE,CAACtB,OAAO,CAAEuB,CAAM,IAAK;IACnB,IAAIA,CAAC,EAAE;MACHC,MAAM,CAACrB,IAAI,CAACoB,CAAC,CAAC,CAACvB,OAAO,CAACyB,CAAC,IAAI;QACxB,MAAMC,CAAC,GAAGH,CAAC,CAACE,CAAC,CAAC;QACd,IAAIC,CAAC,IAAI,CAACpB,QAAQ,CAACoB,CAAC,CAAC,IAAI,CAACrB,OAAO,CAACqB,CAAC,CAAC,IAAI,OAAOA,CAAC,KAAK,QAAQ,E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QAAQ,GAAGD,aAAa,CACzBzM,GAAG,CAAE2M,SAAiB,IAAK;IAC1B,IAAIlB,IAAI,GAAG3N,IAAI,CAAC8O,MAAM,CAACD,SAAS,CAAC;IACjC,IAAIE,mBAAmB,GAAGL,SAAS,CAACzP,QAAQ,CAAC4P,SAAS,CAAC;IACvD;IACAJ,mBAAmB,GAAG,CAACd,IAAI,IAAI,CAACoB,mBAAmB;IACnD,OAAOpB,IAAI,GAAGA,IAAI,GAAGoB,mBAAmB,GAAGF,SAAS,GAAG,EAAE;EAC3D,CAAC,CAAC,CACDtE,MAAM,CAAEoD,IAAI,IAAKA,IAAI,CAAC;EAEzB,IAAIc,mBAAmB,EAAE,OAAO,KAAK;EACrC,OAAOG,QAAQ;AACjB,CAAC;AAED,OAAO,SAASI,uBAAuBA,CAACC,SAAiB,EAAE;EACzD,OAAO9E,KAAK,CAACC,IAAI,CAAC;IAAEnI,MAAM,EAAEgN;EAAU,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC;AACtD","ignoreList":[]}
@@ -0,0 +1,58 @@
1
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
2
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
3
+ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
4
+ let id = 0;
5
+ export class WmComponentNode {
6
+ constructor(args) {
7
+ var _args$children;
8
+ _defineProperty(this, "type", void 0);
9
+ _defineProperty(this, "_classnameMap", new Map());
10
+ _defineProperty(this, "id", ++id);
11
+ _defineProperty(this, "_classnameVal", '');
12
+ _defineProperty(this, "parent", void 0);
13
+ _defineProperty(this, "children", []);
14
+ _defineProperty(this, "instance", void 0);
15
+ this.type = args.type;
16
+ this.instance = args.instance;
17
+ (_args$children = args.children) === null || _args$children === void 0 || _args$children.forEach(c => this.add(c));
18
+ }
19
+ refresh(only) {
20
+ if (!only || only(this)) {
21
+ var _this$instance;
22
+ (_this$instance = this.instance) === null || _this$instance === void 0 || _this$instance.refresh();
23
+ }
24
+ if (only) {
25
+ var _this$children;
26
+ (_this$children = this.children) === null || _this$children === void 0 || _this$children.forEach(c => {
27
+ c === null || c === void 0 || c.refresh(only);
28
+ });
29
+ }
30
+ }
31
+ get classname() {
32
+ return this._classnameVal;
33
+ }
34
+ hasClass(name) {
35
+ return this._classnameMap.has(name);
36
+ }
37
+ add(node) {
38
+ if (node.parent !== this) {
39
+ var _node$parent;
40
+ (_node$parent = node.parent) === null || _node$parent === void 0 || _node$parent.remove(this);
41
+ this.children.push(node);
42
+ node.parent = this;
43
+ node.refresh();
44
+ }
45
+ }
46
+ remove(node) {
47
+ const i = this.children.findIndex(n => n === node);
48
+ if (i >= 0) {
49
+ var _this$children2;
50
+ this.children.splice(i, 1);
51
+ node.parent = undefined;
52
+ (_this$children2 = this.children) === null || _this$children2 === void 0 || _this$children2.forEach(c => {
53
+ c.refresh();
54
+ });
55
+ }
56
+ }
57
+ }
58
+ //# sourceMappingURL=wm-component-tree.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["id","WmComponentNode","constructor","args","_args$children","_defineProperty","Map","type","instance","children","forEach","c","add","refresh","only","_this$instance","_this$children","classname","_classnameVal","hasClass","name","_classnameMap","has","node","parent","_node$parent","remove","push","i","findIndex","n","_this$children2","splice","undefined"],"sources":["wm-component-tree.ts"],"sourcesContent":["import { BaseComponent } from \"./base.component\";\n\nlet id = 0;\n\nexport class WmComponentNode {\n type?: string;\n private _classnameMap: Map<string, boolean> = new Map();\n private id = ++id;\n private _classnameVal = '';\n parent?: WmComponentNode;\n readonly children: WmComponentNode[] = [];\n instance?: BaseComponent<any, any, any>;\n \n\n public constructor(args: {\n type?: string,\n classname?: string,\n children?: WmComponentNode[],\n instance?: BaseComponent<any, any, any>\n }) {\n this.type = args.type;\n this.instance = args.instance;\n args.children?.forEach(c => this.add(c));\n }\n\n private refresh(only?: (node: WmComponentNode) => boolean) {\n if (!only || only(this)) {\n this.instance?.refresh();\n }\n if (only) {\n this.children?.forEach((c) => {\n c?.refresh(only);\n });\n }\n }\n\n get classname() {\n return this._classnameVal;\n }\n\n hasClass(name: string) {\n return this._classnameMap.has(name);\n }\n\n add(node: WmComponentNode) {\n if (node.parent !== this) {\n node.parent?.remove(this);\n this.children.push(node);\n node.parent = this;\n node.refresh();\n }\n }\n\n remove(node: WmComponentNode) {\n const i = this.children.findIndex((n) => n === node);\n if (i >= 0) {\n this.children.splice(i, 1);\n node.parent = undefined;\n this.children?.forEach((c) => {\n c.refresh();\n });\n }\n }\n}"],"mappings":";;;AAEA,IAAIA,EAAE,GAAG,CAAC;AAEV,OAAO,MAAMC,eAAe,CAAC;EAUlBC,WAAWA,CAACC,IAKlB,EAAE;IAAA,IAAAC,cAAA;IAAAC,eAAA;IAAAA,eAAA,wBAb2C,IAAIC,GAAG,CAAC,CAAC;IAAAD,eAAA,aAC1C,EAAEL,EAAE;IAAAK,eAAA,wBACO,EAAE;IAAAA,eAAA;IAAAA,eAAA,mBAEa,EAAE;IAAAA,eAAA;IAUrC,IAAI,CAACE,IAAI,GAAGJ,IAAI,CAACI,IAAI;IACrB,IAAI,CAACC,QAAQ,GAAGL,IAAI,CAACK,QAAQ;IAC7B,CAAAJ,cAAA,GAAAD,IAAI,CAACM,QAAQ,cAAAL,cAAA,eAAbA,cAAA,CAAeM,OAAO,CAACC,CAAC,IAAI,IAAI,CAACC,GAAG,CAACD,CAAC,CAAC,CAAC;EAC5C;EAEQE,OAAOA,CAACC,IAAyC,EAAE;IACvD,IAAI,CAACA,IAAI,IAAIA,IAAI,CAAC,IAAI,CAAC,EAAE;MAAA,IAAAC,cAAA;MACrB,CAAAA,cAAA,OAAI,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;QAC1BA,CAAC,CAACE,OAAO,CAAC,CAAC;MACf,CAAC,CAAC;IACN;EACJ;AACJ","ignoreList":[]}
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wavemaker/app-rn-runtime",
3
- "version": "12.0.0-next.45752",
3
+ "version": "12.0.0-next.46502",
4
4
  "description": "''",
5
5
  "main": "index",
6
6
  "module": "index",
@@ -11,7 +11,7 @@
11
11
  "./": "./"
12
12
  },
13
13
  "scripts": {
14
- "test": "jest -u --coverage",
14
+ "test": "jest --coverage",
15
15
  "test:theme": "jest \"test/styles/theme.spec.ts\"",
16
16
  "typescript": "tsc --noEmit",
17
17
  "copy-resources": "mkdir -p ./dist && cp -r ./lib/module ./dist && cp ./package.json ./dist/module",
@@ -22,7 +22,8 @@
22
22
  "example": "yarn --cwd example",
23
23
  "pods": "cd example && pod-install --quiet",
24
24
  "bootstrap": "yarn example && yarn && yarn pods",
25
- "watch": "npm-watch build"
25
+ "watch": "npm-watch build",
26
+ "test:coverage": "jest --coverage --forceExit; node scripts/combineCoverageHtmlCSS.js"
26
27
  },
27
28
  "keywords": [
28
29
  "react-native",
@@ -50,7 +51,7 @@
50
51
  "@react-navigation/drawer": "6.6.3",
51
52
  "@react-navigation/native": "6.1.7",
52
53
  "@react-navigation/stack": "6.3.29",
53
- "@wavemaker/variables": "12.0.0-next.45752",
54
+ "@wavemaker/variables": "12.0.0-next.46502",
54
55
  "axios": "1.6.8",
55
56
  "color": "4.2.3",
56
57
  "cross-env": "7.0.3",
@@ -141,7 +142,7 @@
141
142
  "typescript": "5.1.3",
142
143
  "victory-native": "36.6.11",
143
144
  "yargs": "16.2.0",
144
- "@wavemaker/variables": "12.0.0-next.45752"
145
+ "@wavemaker/variables": "12.0.0-next.46502"
145
146
  },
146
147
  "jest": {
147
148
  "preset": "jest-expo",
@@ -156,10 +157,16 @@
156
157
  "collectCoverageFrom": [
157
158
  "**/*.{js,jsx,ts,tsx}",
158
159
  "!**/coverage/**",
160
+ "!**/.yalc/**",
159
161
  "!**/node_modules/**",
160
162
  "!**/babel.config.js",
161
163
  "!**/jest.setup.js",
162
- "!**/dist/**"
164
+ "!**/dist/**",
165
+ "!**/scripts/**",
166
+ "!**/typings/**",
167
+ "!**/src/variables/**",
168
+ "!**/src/actions/**",
169
+ "!**/src/runtime/**"
163
170
  ],
164
171
  "coverageDirectory": "./dist/reports/coverage",
165
172
  "transform": {
@@ -3,7 +3,7 @@ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol"
3
3
  function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
4
4
  import React from 'react';
5
5
  import axios from 'axios';
6
- import { Platform, TouchableOpacity, View, StatusBar, KeyboardAvoidingView } from 'react-native';
6
+ import { Platform, TouchableOpacity, View, StatusBar } from 'react-native';
7
7
  import { GestureHandlerRootView } from 'react-native-gesture-handler';
8
8
  import ProtoTypes from 'prop-types';
9
9
  import { SafeAreaProvider, SafeAreaInsetsContext, SafeAreaView } from 'react-native-safe-area-context';
@@ -50,6 +50,7 @@ import { getValidJSON, parseErrors } from '@wavemaker/app-rn-runtime/variables/u
50
50
  import MaterialCommunityIconsFont from '@expo/vector-icons/build/vendor/react-native-vector-icons/Fonts/MaterialCommunityIcons.ttf';
51
51
  import * as SplashScreen from 'expo-splash-screen';
52
52
  import { WmMemo } from './memo.component';
53
+ import { VariableEvents } from '../variables/base-variable';
53
54
  //some old react libraries need this
54
55
  View['propTypes'] = {
55
56
  style: ProtoTypes.any
@@ -83,6 +84,7 @@ const SUPPORTED_SERVICES = {
83
84
  AppDisplayManagerService: AppDisplayManagerService,
84
85
  i18nService: AppI18nService
85
86
  };
87
+ global['axios'] = axios;
86
88
  export default class BaseApp extends React.Component {
87
89
  constructor(props) {
88
90
  super(props);
@@ -173,6 +175,10 @@ export default class BaseApp extends React.Component {
173
175
  var _this$commonPartial2;
174
176
  return (_this$commonPartial2 = this.commonPartial) === null || _this$commonPartial2 === void 0 ? void 0 : _this$commonPartial2.Widgets;
175
177
  }
178
+ async onBeforePageLeave(currentPage, nextPage) {
179
+ //method can be override by the user from studio;
180
+ return true;
181
+ }
176
182
  goToPage(pageName, params) {
177
183
  var _this$appConfig$curre2;
178
184
  return (_this$appConfig$curre2 = this.appConfig.currentPage) === null || _this$appConfig$curre2 === void 0 ? void 0 : _this$appConfig$curre2.goToPage(pageName, params);
@@ -242,9 +248,11 @@ export default class BaseApp extends React.Component {
242
248
  config.headers = config.headers || {};
243
249
  config.headers['X-Requested-With'] = 'XMLHttpRequest';
244
250
  console.log('onBeforeService call invoked on ' + config.url);
251
+ this.notify('beforeServiceCall', config);
245
252
  return this.onBeforeServiceCall(config);
246
253
  }), axios.interceptors.response.use(response => {
247
254
  this.onServiceSuccess(response.data, response);
255
+ this.notify('afterServiceCall', response.config, response);
248
256
  return response;
249
257
  }, error => {
250
258
  var _errorDetails, _errorDetails2, _error$response, _error$response2, _error$response3, _error$response4;
@@ -263,6 +271,7 @@ export default class BaseApp extends React.Component {
263
271
  var _this$appConfig$curre5, _this$appConfig$curre6;
264
272
  ((_this$appConfig$curre5 = this.appConfig.currentPage) === null || _this$appConfig$curre5 === void 0 ? void 0 : _this$appConfig$curre5.pageName) !== 'Login' && ((_this$appConfig$curre6 = this.appConfig.currentPage) === null || _this$appConfig$curre6 === void 0 ? void 0 : _this$appConfig$curre6.goToPage('Login'));
265
273
  }
274
+ this.notify('afterServiceCall', error.config, error);
266
275
  return Promise.reject(error);
267
276
  })];
268
277
  }
@@ -284,12 +293,22 @@ export default class BaseApp extends React.Component {
284
293
  AppSpinnerService.show({
285
294
  spinner: this.appConfig.spinner
286
295
  });
287
- this.triggerStartUpVariables().then(() => {
296
+ this.cleanup.push(...Object.values(this.Variables).map(v => {
297
+ return v.subscribe(VariableEvents.BEFORE_INVOKE, () => {
298
+ this.notify(VariableEvents.BEFORE_INVOKE, v);
299
+ });
300
+ }));
301
+ this.cleanup.push(...Object.values(this.Variables).map(v => {
302
+ return v.subscribe(VariableEvents.AFTER_INVOKE, () => {
303
+ this.notify(VariableEvents.AFTER_INVOKE, v);
304
+ });
305
+ }));
306
+ this.startUpActions.map(a => this.Actions[a] && this.Actions[a].invoke());
307
+ return this.triggerStartUpVariables().then(() => {
288
308
  this.onAppVariablesReady();
289
309
  this.isStarted = true;
290
310
  this.forceUpdate();
291
311
  }, () => {});
292
- this.startUpActions.map(a => this.Actions[a] && this.Actions[a].invoke());
293
312
  }
294
313
  componentWillUnmount() {
295
314
  this.axiosInterceptorIds.map(id => {
@@ -451,11 +470,6 @@ export default class BaseApp extends React.Component {
451
470
  }
452
471
  }, /*#__PURE__*/React.createElement(StatusBar, null), /*#__PURE__*/React.createElement(ThemeProvider, {
453
472
  value: this.appConfig.theme
454
- }, /*#__PURE__*/React.createElement(KeyboardAvoidingView, {
455
- behavior: Platform.OS === "ios" ? "padding" : undefined,
456
- style: {
457
- flex: 1
458
- }
459
473
  }, /*#__PURE__*/React.createElement(FixedViewContainer, null, /*#__PURE__*/React.createElement(View, {
460
474
  style: styles.container
461
475
  }, /*#__PURE__*/React.createElement(GestureHandlerRootView, {
@@ -469,7 +483,7 @@ export default class BaseApp extends React.Component {
469
483
  drawerAnimation: (_this$appConfig$drawe2 = this.appConfig.drawer) === null || _this$appConfig$drawe2 === void 0 ? void 0 : _this$appConfig$drawe2.getAnimation()
470
484
  }), commonPartial)), this.appConfig.url ? /*#__PURE__*/React.createElement(WmNetworkInfoToaster, {
471
485
  appLocale: this.appConfig.appLocale
472
- }) : null), this.renderToasters(), this.renderDialogs(), this.renderDisplayManager()))));
486
+ }) : null), this.renderToasters(), this.renderDialogs(), this.renderDisplayManager())));
473
487
  }))));
474
488
  }
475
489
  }