@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
@@ -1 +1 @@
1
- {"version":3,"names":["React","View","ModalConsumer","AssetProvider","HideMode","ThemeProvider","BaseComponent","BaseComponentState","WmIcon","WmButton","WmDialogProps","DEFAULT_CLASS","WmDialogState","constructor","args","_defineProperty","WmDialog","props","hideMode","DONOT_ADD_TO_DOM","state","modalOptions","onClose","Promise","res","updateState","show","invokeEventCallback","onOpen","open","close","_close","prepareModalOptions","content","modalService","o","name","modalStyle","styles","modal","contentStyle","isModal","centered","animation","animationdelay","hideModal","renderWidget","createElement","showModal","value","loadAsset","theme","style","root","_background","showheader","header","headerLabel","iconclass","iconurl","id","getTestId","caption","title","accessibilityrole","icon","iconheight","iconmargin","iconwidth","closable","onTap","closeBtn","children"],"sources":["dialog.component.tsx"],"sourcesContent":["import React from 'react';\nimport { Text, View } from 'react-native';\n\nimport { ModalConsumer, ModalOptions, ModalService } from '@wavemaker/app-rn-runtime/core/modal.service';\nimport { AssetProvider } from '@wavemaker/app-rn-runtime/core/asset.provider';\nimport { HideMode } from '@wavemaker/app-rn-runtime/core/if.component';\nimport { ThemeProvider } from '@wavemaker/app-rn-runtime/styles/theme';\nimport { BaseComponent, BaseComponentState } from '@wavemaker/app-rn-runtime/core/base.component';\nimport WmIcon from '@wavemaker/app-rn-runtime/components/basic/icon/icon.component';\nimport WmButton from '@wavemaker/app-rn-runtime/components/basic/button/button.component';\n\nimport WmDialogProps from './dialog.props';\nimport { DEFAULT_CLASS, WmDialogStyles } from './dialog.styles';\n\nexport class WmDialogState extends BaseComponentState<WmDialogProps> {\n modalOptions = {} as ModalOptions;\n}\n\nexport default class WmDialog extends BaseComponent<WmDialogProps, WmDialogState, WmDialogStyles> {\n\n private _close: Function = () => {};\n\n constructor(props: WmDialogProps) {\n super(props, DEFAULT_CLASS, new WmDialogProps(), new WmDialogState());\n this.hideMode = HideMode.DONOT_ADD_TO_DOM;\n this.state.modalOptions.onClose = () => {\n return new Promise<void>((res) => {\n this.updateState({\n props: {show: false}\n } as WmDialogState, () => {\n this.invokeEventCallback('onClose', [null, this]);\n res();\n });\n });\n };\n this.state.modalOptions.onOpen = () => {\n this.invokeEventCallback('onOpened', [null, this]);\n };\n }\n\n open() {\n if (!this.state.props.show) {\n this.updateState({\n props:{show: true}\n } as WmDialogState);\n }\n }\n\n close() {\n this._close();\n }\n\n prepareModalOptions(content: React.ReactNode, modalService: ModalService) {\n const o = this.state.modalOptions;\n o.name = this.state.props.name;\n o.modalStyle = this.styles.modal;\n o.content = content;\n o.contentStyle = this.styles.content;\n o.isModal = !!this.state.props.modal;\n o.centered = true;\n o.animation = this.state.props.animation;\n o.animationdelay = this.state.props.animationdelay || 0;\n this._close = () => modalService.hideModal(this.state.modalOptions);\n return o;\n }\n\n renderWidget(props: WmDialogProps) {\n return (<ModalConsumer>\n {(modalService: ModalService) => {\n modalService.showModal(this.prepareModalOptions((\n <AssetProvider value={this.loadAsset}>\n <ThemeProvider value={this.theme}>\n <View style={this.styles.root}>\n {this._background}\n {props.showheader ? (<View style={this.styles.header}>\n <View style={this.styles.headerLabel}>\n {props.iconclass || props.iconurl ?\n <WmIcon id={this.getTestId('icon')}\n caption={props.title}\n accessibilityrole='header'\n iconclass={props.iconclass}\n styles={this.styles.icon}\n iconurl={props.iconurl}\n iconheight={props.iconheight}\n iconmargin={props.iconmargin}\n iconwidth={props.iconwidth}\n /> : null}\n </View>\n {props.closable && <WmButton id={this.getTestId('closebtn')} show={props.closable} iconclass=\"wm-sl-l sl-close\" onTap={() => this.close()} styles={this.styles.closeBtn}></WmButton>}\n </View>) : null}\n {props.children}\n </View>\n </ThemeProvider>\n </AssetProvider>\n ), modalService));\n return null;\n }}\n </ModalConsumer>);\n }\n}\n"],"mappings":";;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAAeC,IAAI,QAAQ,cAAc;AAEzC,SAASC,aAAa,QAAoC,8CAA8C;AACxG,SAASC,aAAa,QAAQ,+CAA+C;AAC7E,SAASC,QAAQ,QAAQ,6CAA6C;AACtE,SAASC,aAAa,QAAQ,wCAAwC;AACtE,SAASC,aAAa,EAAEC,kBAAkB,QAAQ,+CAA+C;AACjG,OAAOC,MAAM,MAAM,gEAAgE;AACnF,OAAOC,QAAQ,MAAM,oEAAoE;AAEzF,OAAOC,aAAa,MAAM,gBAAgB;AAC1C,SAASC,aAAa,QAAwB,iBAAiB;AAE/D,OAAO,MAAMC,a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EAAE,IAAI,CAACd,MAAM,CAACkB;MAAO,gBACnDxD,KAAA,CAAA+C,aAAA,CAAC9C,IAAI;QAACmD,KAAK,EAAE,IAAI,CAACd,MAAM,CAACmB;MAAY,GACpCxC,KAAK,CAACyC,SAAS,IAAIzC,KAAK,CAAC0C,OAAO,gBAC/B3D,KAAA,CAAA+C,aAAA,CAACvC,MAAM;QAACoD,EAAE,EAAE,IAAI,CAACC,SAAS,CAAC,MAAM,CAAE;QAClCC,OAAO,EAAE7C,KAAK,CAAC8C,KAAM;QACrBC,iBAAiB,EAAC,QAAQ;QAC1BN,SAAS,EAAEzC,KAAK,CAACyC,SAAU;QAC3BpB,MAAM,EAAE,IAAI,CAACA,MAAM,CAAC2B,IAAK;QACzBN,OAAO,EAAE1C,KAAK,CAAC0C,OAAQ;QACvBO,UAAU,EAAEjD,KAAK,CAACiD,UAAW;QAC7BC,UAAU,EAAElD,KAAK,CAACkD,UAAW;QAC7BC,SAAS,EAAEnD,KAAK,CAACmD;MAAU,CAC1B,CAAC,GAAG,IACF,CAAC,EACNnD,KAAK,CAACoD,QAAQ,iBAAIrE,KAAA,CAAA+C,aAAA,CAACtC,QAAQ;QAACmD,EAAE,EAAE,IAAI,CAACC,SAAS,CAAC,UAAU,CAAE;QAACnC,IAAI,EAAET,KAAK,CAACoD,QAAS;QAACX,SAAS,EAAC,kBAAkB;QAACY,KAAK,EAAEA,CAAA,KAAM,IAAI,CAACxC,KAAK,CAAC,CAAE;QAACQ,MAAM,EAAE,IAAI,CAACA,MAAM,CAACiC;MAAS,CAAW,CAC/K,CAAC,GAAI,IAAI,EACdtD,KAAK,CAACuD,QACH,CACO,CACF,CAAC,EACftC,YAAY,CAAC,CAAC;MACjB,OAAO,IAAI;IACb,CACa,CAAC;EAClB;AACF","ignoreList":[]}
1
+ {"version":3,"names":["React","View","ModalConsumer","AssetProvider","HideMode","ThemeProvider","BaseComponent","BaseComponentState","WmIcon","WmButton","WmDialogProps","DEFAULT_CLASS","WmDialogState","constructor","args","_defineProperty","WmDialog","props","hideMode","DONOT_ADD_TO_DOM","state","modalOptions","onClose","Promise","res","updateState","show","invokeEventCallback","onOpen","open","close","_close","prepareModalOptions","content","modalService","o","name","modalStyle","styles","modal","contentStyle","isModal","centered","animation","animationdelay","hideModal","renderWidget","createElement","showModal","value","loadAsset","theme","style","root","testID","_background","showheader","header","headerLabel","iconclass","iconurl","title","id","getTestId","caption","accessibilityrole","icon","iconheight","iconmargin","iconwidth","closable","onTap","closeBtn","children"],"sources":["dialog.component.tsx"],"sourcesContent":["import React from 'react';\nimport { Text, View } from 'react-native';\n\nimport { ModalConsumer, ModalOptions, ModalService } from '@wavemaker/app-rn-runtime/core/modal.service';\nimport { AssetProvider } from '@wavemaker/app-rn-runtime/core/asset.provider';\nimport { HideMode } from '@wavemaker/app-rn-runtime/core/if.component';\nimport { ThemeProvider } from '@wavemaker/app-rn-runtime/styles/theme';\nimport { BaseComponent, BaseComponentState } from '@wavemaker/app-rn-runtime/core/base.component';\nimport WmIcon from '@wavemaker/app-rn-runtime/components/basic/icon/icon.component';\nimport WmButton from '@wavemaker/app-rn-runtime/components/basic/button/button.component';\n\nimport WmDialogProps from './dialog.props';\nimport { DEFAULT_CLASS, WmDialogStyles } from './dialog.styles';\n\nexport class WmDialogState extends BaseComponentState<WmDialogProps> {\n modalOptions = {} as ModalOptions;\n}\n\nexport default class WmDialog extends BaseComponent<WmDialogProps, WmDialogState, WmDialogStyles> {\n\n private _close: Function = () => {};\n\n constructor(props: WmDialogProps) {\n super(props, DEFAULT_CLASS, new WmDialogProps(), new WmDialogState());\n this.hideMode = HideMode.DONOT_ADD_TO_DOM;\n this.state.modalOptions.onClose = () => {\n return new Promise<void>((res) => {\n this.updateState({\n props: {show: false}\n } as WmDialogState, () => {\n this.invokeEventCallback('onClose', [null, this]);\n res();\n });\n });\n };\n this.state.modalOptions.onOpen = () => {\n this.invokeEventCallback('onOpened', [null, this]);\n };\n }\n\n open() {\n if (!this.state.props.show) {\n this.updateState({\n props:{show: true}\n } as WmDialogState);\n }\n }\n\n close() {\n this._close();\n }\n\n prepareModalOptions(content: React.ReactNode, modalService: ModalService) {\n const o = this.state.modalOptions;\n o.name = this.state.props.name;\n o.modalStyle = this.styles.modal;\n o.content = content;\n o.contentStyle = this.styles.content;\n o.isModal = !!this.state.props.modal;\n o.centered = true;\n o.animation = this.state.props.animation;\n o.animationdelay = this.state.props.animationdelay || 0;\n this._close = () => modalService.hideModal(this.state.modalOptions);\n return o;\n }\n\n renderWidget(props: WmDialogProps) {\n return (<ModalConsumer>\n {(modalService: ModalService) => {\n modalService.showModal(this.prepareModalOptions((\n <AssetProvider value={this.loadAsset}>\n <ThemeProvider value={this.theme}>\n <View style={this.styles.root} testID=\"wm-dialog\">\n {this._background}\n {props.showheader ? (<View style={this.styles.header} testID=\"wm-dialog-header\">\n <View style={this.styles.headerLabel}>\n {props.iconclass || props.iconurl || props.title ?\n <WmIcon id={this.getTestId('icon')}\n caption={props.title}\n accessibilityrole='header'\n iconclass={props.iconclass}\n styles={this.styles.icon}\n iconurl={props.iconurl}\n iconheight={props.iconheight}\n iconmargin={props.iconmargin}\n iconwidth={props.iconwidth}\n /> : null}\n </View>\n {props.closable && <WmButton id={this.getTestId('closebtn')} show={props.closable} iconclass=\"wm-sl-l sl-close\" onTap={() => this.close()} styles={this.styles.closeBtn}></WmButton>}\n </View>) : null}\n {props.children}\n </View>\n </ThemeProvider>\n </AssetProvider>\n ), modalService));\n return null;\n }}\n </ModalConsumer>);\n }\n}\n"],"mappings":";;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAAeC,IAAI,QAAQ,cAAc;AAEzC,SAASC,aAAa,QAAoC,8CAA8C;AACxG,SAASC,aAAa,QAAQ,+CAA+C;AAC7E,SAASC,QAAQ,QAAQ,6CAA6C;AACtE,SAASC,aAAa,QAAQ,wCAAwC;AACtE,SAASC,aAAa,EAAEC,kBAAkB,QAAQ,+CAA+C;AACjG,OAAOC,MAAM,MAAM,gEAAgE;A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AC,EACfvC,YAAY,CAAC,CAAC;MACjB,OAAO,IAAI;IACb,CACa,CAAC;EAClB;AACF","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["BASE_THEME","defineStyles","DEFAULT_CLASS","registerStyle","themeVariables","addStyle","defaultStyles","root","minWidth","paddingTop","paddingBottom","paddingLeft","paddingRight","elevation","width","maxHeight","maxModalHeight","backgroundColor","dialogBackgroundColor","borderRadius","text","modal","modalContent","undefined","icon","alignSelf","fontFamily","baseFont","fontSize","fontWeight","color","dialogLabelColor","dialogIconColor","header","flexDirection","borderStyle","borderColor","dialogBorderColor","headerLabel","flex","justifyContent","alignItems","closeBtn","minHeight","marginBottom","rippleColor","transparent","dialogCloseIconColor"],"sources":["dialog.styles.ts"],"sourcesContent":["import { ViewStyle } from 'react-native';\nimport BASE_THEME from '@wavemaker/app-rn-runtime/styles/theme';\nimport { BaseStyles, defineStyles } from '@wavemaker/app-rn-runtime/core/base.component';\nimport { WmIconStyles } from '@wavemaker/app-rn-runtime/components/basic/icon/icon.styles';\nimport { WmButtonStyles } from '../../basic/button/button.styles';\n\nexport type WmDialogStyles = BaseStyles & {\n modal: ViewStyle,\n modalContent: ViewStyle,\n icon: WmIconStyles,\n closeBtn: WmButtonStyles\n};\n\nexport const DEFAULT_CLASS = 'app-dialog';\nBASE_THEME.registerStyle((themeVariables, addStyle) => {\n const defaultStyles: WmDialogStyles = defineStyles<WmDialogStyles>({\n root: {\n minWidth: 320,\n paddingTop: 24,\n paddingBottom: 24,\n paddingLeft: 24,\n paddingRight: 24,\n elevation: 6,\n width: '90%',\n maxHeight: themeVariables.maxModalHeight,\n backgroundColor: themeVariables.dialogBackgroundColor,\n borderRadius: 28,\n },\n text: {},\n modal: {},\n modalContent: {\n width: undefined\n },\n icon: {\n root: {\n alignSelf: 'center',\n },\n text: {\n fontFamily: themeVariables.baseFont,\n fontSize: 24,\n fontWeight: '400',\n color : themeVariables.dialogLabelColor,\n },\n icon: {\n fontSize: 24,\n color: themeVariables.dialogIconColor\n }\n } as WmIconStyles,\n header: {\n flexDirection: 'row',\n borderStyle: 'solid',\n borderColor: themeVariables.dialogBorderColor\n },\n headerLabel: {\n flex: 1,\n flexDirection: 'row',\n justifyContent: 'flex-start',\n alignItems: 'center',\n paddingBottom: 16,\n },\n closeBtn: {\n root: {\n alignSelf: 'flex-end',\n backgroundColor: 'transparent',\n borderRadius: 8,\n paddingRight: 8,\n paddingTop: 8,\n paddingBottom: 8,\n paddingLeft: 8,\n minHeight: 0,\n marginBottom: 22,\n rippleColor: themeVariables.transparent\n },\n icon : {\n root: {\n alignItems: 'center',\n },\n icon: {\n paddingRight: 0\n },\n text: {\n color: themeVariables.dialogCloseIconColor,\n fontSize: 14\n }\n }\n } as WmButtonStyles\n });\n\n addStyle(DEFAULT_CLASS, '', defaultStyles);\n});"],"mappings":"AACA,OAAOA,UAAU,MAAM,wCAAwC;AAC/D,SAAqBC,YAAY,QAAQ,+CAA+C;AAWxF,OAAO,MAAMC,aAAa,GAAG,YAAY;AACzCF,UAAU,CAACG,aAAa,CAAC,CAACC,cAAc,EAAEC,QAAQ,KAAK;EACnD,MAAMC,aAA6B,GAAGL,YAAY,CAAiB;IAC/DM,IAAI,EAAE;MACFC,QAAQ,EAAE,GAAG;MACbC,UAAU,EAAE,EAAE;MACdC,aAAa,EAAE,EAAE;MACjBC,WAAW,EAAE,EAAE;MACfC,YAAY,EAAE,EAAE;MAChBC,SAAS,EAAE,CAAC;MACZC,KAAK,EAAE,KAAK;MACZC,SAAS,EAAEX,cAAc,CAACY,cAAc;MACxCC,eAAe,EAAEb,cAAc,CAACc,qBAAqB;MACrDC,YAAY,EAAE;IAClB,CAAC;IACDC,IAAI,EAAE,CAAC,CAAC;IACRC,KAAK,EAAE,CAAC,CAAC;IACTC,YAAY,EAAE;MACVR,KAAK,EAAES;IACX,CAAC;IACDC,IAAI,EAAE;MACFjB,IAAI,EAAE;QACFkB,SAAS,EAAE;MACf,CAAC;MACDL,IAAI,EAAE;QACFM,UAAU,EAAEtB,cAAc,CAACuB,QAAQ;QACnCC,QAAQ,EAAE,EAAE;QACZC,UAAU,EAAE,KAAK;QACjBC,KAAK,EAAG1B,cAAc,CAAC2B;MAC3B,CAAC;MACDP,IAAI,EAAE;QACFI,QAAQ,EAAE,EAAE;QACZE,KAAK,EAAE1B,cAAc,CAAC4B;MAC1B;IACJ,CAAiB;IACjBC,MAAM,EAAE;MACJC,aAAa,EAAE,KAAK;MACpBC,WAAW,EAAE,OAAO;MACpBC,WAAW,EAAEhC,cAAc,CAACiC;IAChC,CAAC;IACDC,WAAW,EAAE;MACTC,IAAI,EAAE,CAAC;MACPL,aAAa,EAAE,KAAK;MACpBM,cAAc,EAAE,YAAY;MAC5BC,UAAU,EAAE,QAAQ;MACpB/B,aAAa,EAAE;IACnB,CAAC;IACDgC,QAAQ,EAAE;MACNnC,IAAI,EAAE;QACFkB,SAAS,EAAE,UAAU;QACrBR,eAAe,EAAE,aAAa;QAC9BE,YAAY,EAAE,CAAC;QACfP,YAAY,EAAE,CAAC;QACfH,UAAU,EAAE,CAAC;QACbC,aAAa,EAAE,CAAC;QAChBC,WAAW,EAAE,CAAC;QACdgC,SAAS,EAAE,CAAC;QACZC,YAAY,EAAE,EAAE;QAChBC,WAAW,EAAEzC,cAAc,CAAC0C;MAChC,CAAC;MACDtB,IAAI,EAAG;QACHjB,IAAI,EAAE;UACFkC,UAAU,EAAE;QAChB,CAAC;QACDjB,IAAI,EAAE;UACFZ,YAAY,EAAE;QAClB,CAAC;QACDQ,IAAI,EAAE;UACFU,KAAK,EAAE1B,cAAc,CAAC2C,oBAAoB;UAC1CnB,QAAQ,EAAE;QACd;MACJ;IACJ;EACJ,CAAC,CAAC;EAEFvB,QAAQ,CAACH,aAAa,EAAE,EAAE,EAAEI,aAAa,CAAC;AAC9C,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["BASE_THEME","defineStyles","DEFAULT_CLASS","registerStyle","themeVariables","addStyle","defaultStyles","root","minWidth","paddingTop","paddingBottom","paddingLeft","paddingRight","elevation","width","maxHeight","maxModalHeight","backgroundColor","dialogBackgroundColor","borderRadius","text","modal","modalContent","undefined","icon","alignSelf","fontFamily","baseFont","fontSize","fontWeight","color","dialogLabelColor","dialogIconColor","header","flexDirection","borderStyle","borderColor","dialogBorderColor","headerLabel","flex","justifyContent","alignItems","closeBtn","minHeight","marginBottom","rippleColor","transparent","dialogCloseIconColor"],"sources":["dialog.styles.ts"],"sourcesContent":["import { ViewStyle } from 'react-native';\nimport BASE_THEME from '@wavemaker/app-rn-runtime/styles/theme';\nimport { BaseStyles, defineStyles } from '@wavemaker/app-rn-runtime/core/base.component';\nimport { WmIconStyles } from '@wavemaker/app-rn-runtime/components/basic/icon/icon.styles';\nimport { WmButtonStyles } from '@wavemaker/app-rn-runtime/components/basic/button/button.styles';\n\nexport type WmDialogStyles = BaseStyles & {\n modal: ViewStyle,\n modalContent: ViewStyle,\n icon: WmIconStyles,\n closeBtn: WmButtonStyles\n};\n\nexport const DEFAULT_CLASS = 'app-dialog';\nBASE_THEME.registerStyle((themeVariables, addStyle) => {\n const defaultStyles: WmDialogStyles = defineStyles<WmDialogStyles>({\n root: {\n minWidth: 320,\n paddingTop: 24,\n paddingBottom: 24,\n paddingLeft: 24,\n paddingRight: 24,\n elevation: 6,\n width: '90%',\n maxHeight: themeVariables.maxModalHeight,\n backgroundColor: themeVariables.dialogBackgroundColor,\n borderRadius: 28,\n },\n text: {},\n modal: {},\n modalContent: {\n width: undefined\n },\n icon: {\n root: {\n alignSelf: 'center',\n },\n text: {\n fontFamily: themeVariables.baseFont,\n fontSize: 24,\n fontWeight: '400',\n color : themeVariables.dialogLabelColor,\n },\n icon: {\n fontSize: 24,\n color: themeVariables.dialogIconColor\n }\n } as WmIconStyles,\n header: {\n flexDirection: 'row',\n borderStyle: 'solid',\n borderColor: themeVariables.dialogBorderColor\n },\n headerLabel: {\n flex: 1,\n flexDirection: 'row',\n justifyContent: 'flex-start',\n alignItems: 'center',\n paddingBottom: 16,\n },\n closeBtn: {\n root: {\n alignSelf: 'flex-end',\n backgroundColor: 'transparent',\n borderRadius: 8,\n paddingRight: 8,\n paddingTop: 8,\n paddingBottom: 8,\n paddingLeft: 8,\n minHeight: 0,\n marginBottom: 22,\n rippleColor: themeVariables.transparent\n },\n icon : {\n root: {\n alignItems: 'center',\n },\n icon: {\n paddingRight: 0\n },\n text: {\n color: themeVariables.dialogCloseIconColor,\n fontSize: 14\n }\n }\n } as WmButtonStyles\n });\n\n addStyle(DEFAULT_CLASS, '', defaultStyles);\n});"],"mappings":"AACA,OAAOA,UAAU,MAAM,wCAAwC;AAC/D,SAAqBC,YAAY,QAAQ,+CAA+C;AAWxF,OAAO,MAAMC,aAAa,GAAG,YAAY;AACzCF,UAAU,CAACG,aAAa,CAAC,CAACC,cAAc,EAAEC,QAAQ,KAAK;EACnD,MAAMC,aAA6B,GAAGL,YAAY,CAAiB;IAC/DM,IAAI,EAAE;MACFC,QAAQ,EAAE,GAAG;MACbC,UAAU,EAAE,EAAE;MACdC,aAAa,EAAE,EAAE;MACjBC,WAAW,EAAE,EAAE;MACfC,YAAY,EAAE,EAAE;MAChBC,SAAS,EAAE,CAAC;MACZC,KAAK,EAAE,KAAK;MACZC,SAAS,EAAEX,cAAc,CAACY,cAAc;MACxCC,eAAe,EAAEb,cAAc,CAACc,qBAAqB;MACrDC,YAAY,EAAE;IAClB,CAAC;IACDC,IAAI,EAAE,CAAC,CAAC;IACRC,KAAK,EAAE,CAAC,CAAC;IACTC,YAAY,EAAE;MACVR,KAAK,EAAES;IACX,CAAC;IACDC,IAAI,EAAE;MACFjB,IAAI,EAAE;QACFkB,SAAS,EAAE;MACf,CAAC;MACDL,IAAI,EAAE;QACFM,UAAU,EAAEtB,cAAc,CAACuB,QAAQ;QACnCC,QAAQ,EAAE,EAAE;QACZC,UAAU,EAAE,KAAK;QACjBC,KAAK,EAAG1B,cAAc,CAAC2B;MAC3B,CAAC;MACDP,IAAI,EAAE;QACFI,QAAQ,EAAE,EAAE;QACZE,KAAK,EAAE1B,cAAc,CAAC4B;MAC1B;IACJ,CAAiB;IACjBC,MAAM,EAAE;MACJC,aAAa,EAAE,KAAK;MACpBC,WAAW,EAAE,OAAO;MACpBC,WAAW,EAAEhC,cAAc,CAACiC;IAChC,CAAC;IACDC,WAAW,EAAE;MACTC,IAAI,EAAE,CAAC;MACPL,aAAa,EAAE,KAAK;MACpBM,cAAc,EAAE,YAAY;MAC5BC,UAAU,EAAE,QAAQ;MACpB/B,aAAa,EAAE;IACnB,CAAC;IACDgC,QAAQ,EAAE;MACNnC,IAAI,EAAE;QACFkB,SAAS,EAAE,UAAU;QACrBR,eAAe,EAAE,aAAa;QAC9BE,YAAY,EAAE,CAAC;QACfP,YAAY,EAAE,CAAC;QACfH,UAAU,EAAE,CAAC;QACbC,aAAa,EAAE,CAAC;QAChBC,WAAW,EAAE,CAAC;QACdgC,SAAS,EAAE,CAAC;QACZC,YAAY,EAAE,EAAE;QAChBC,WAAW,EAAEzC,cAAc,CAAC0C;MAChC,CAAC;MACDtB,IAAI,EAAG;QACHjB,IAAI,EAAE;UACFkC,UAAU,EAAE;QAChB,CAAC;QACDjB,IAAI,EAAE;UACFZ,YAAY,EAAE;QAClB,CAAC;QACDQ,IAAI,EAAE;UACFU,KAAK,EAAE1B,cAAc,CAAC2C,oBAAoB;UAC1CnB,QAAQ,EAAE;QACd;MACJ;IACJ;EACJ,CAAC,CAAC;EAEFvB,QAAQ,CAACH,aAAa,EAAE,EAAE,EAAEI,aAAa,CAAC;AAC9C,CAAC,CAAC","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["BaseComponent","BaseComponentState","find","isString","isEqual","isFunction","includes","get","forEach","isObject","isArray","filter","trim","uniqBy","uniqWith","getGroupedData","getOrderedDataset","isDefined","validateField","DEFAULT_CLASS","BaseDatasetState","constructor","args","_defineProperty","BaseDatasetComponent","props","defaultClass","defaultProps","defaultState","onPropertyChange","name","$new","$old","state","setDataItems","dataset","setGroupData","dataItems","dataValue","isDefault","updateState","onFieldChange","bind","items","groupby","groupedData","match","orderby","dateformat","onDataItemsUpdate","validate","value","validationObj","setState","isValid","errorType","updateDatavalue","Promise","resolve","datavalue","computeDisplayValue","onValueChange","datafield","selectedItem","item","key","dataObject","onChange","getItemKey","oldValue","then","invokeEventCallback","undefined","proxy","displayValue","selected","map","displayexp","displayfield","getUniqObjsByDataField","data","allowEmptyFields","uniqData","isAllFields","obj","propsObj","allowEmpty","datavalueItems","split","s","i","toString","push","isSelected","length","df","d","datafieldValue","_get","_get2","displaylabel","getDisplayExpression","imgSrc","displayimagesrc","icon","iconclass","isUpdated"],"sources":["basedataset.component.ts"],"sourcesContent":["import { BaseComponent, BaseComponentState } from \"@wavemaker/app-rn-runtime/core/base.component\";\nimport BaseDatasetProps from '@wavemaker/app-rn-runtime/components/input/basedataset/basedataset.props';\nimport { find, isString, isEqual,isEmpty, isFunction, includes, get, forEach, isObject, isArray, filter, trim, uniqBy, uniqWith } from 'lodash';\nimport { getGroupedData, getOrderedDataset, isDefined, validateField } from \"@wavemaker/app-rn-runtime/core/utils\";\nimport { DEFAULT_CLASS, BaseDatasetStyles } from \"@wavemaker/app-rn-runtime/components/input/basedataset/basedataset.styles\";\n\nexport class BaseDatasetState <T extends BaseDatasetProps> extends BaseComponentState<T> {\n dataItems: any;\n groupedData: any;\n isDefault = false;\n isValid = true;\n errorType = '';\n}\n\nexport abstract class BaseDatasetComponent< T extends BaseDatasetProps, S extends BaseDatasetState<T>, L extends BaseDatasetStyles> extends BaseComponent<T, S, L> {\n\n constructor(props: T, public defaultClass: string = DEFAULT_CLASS, defaultProps?: T, defaultState?: S) {\n super(props, defaultClass, defaultProps, defaultState);\n\n }\n\n onPropertyChange(name: string, $new: any, $old: any) {\n const props = this.state.props;\n switch (name) {\n case 'dataset':\n this.setDataItems($new);\n break;\n case 'getDisplayExpression':\n case 'displayfield':\n case 'displaylabel':\n case 'displayimagesrc':\n case 'datafield':\n case 'orderby':\n this.setDataItems(this.state.props.dataset);\n break;\n case 'groupby':\n case 'match':\n this.setGroupData(this.state.dataItems);\n case 'datavalue':\n this.setDataItems(this.state.props.dataset, { dataValue: $new });\n const isDefault = this.state.isDefault;\n if (isDefault) {\n this.updateState({ isDefault: false } as S, this.props.onFieldChange && this.props.onFieldChange.bind(this, 'datavalue', $new, $old, isDefault));\n } else {\n this.props.onFieldChange && this.props.onFieldChange('datavalue', $new, $old, isDefault);\n }\n }\n }\n\n setGroupData(items: any) {\n const dataItems = items;\n const props = this.state.props;\n if (props.groupby) {\n const groupedData = dataItems && getGroupedData(dataItems, props.groupby, props.match, props.orderby, props.dateformat, this, 'dataObject');\n this.updateState({ groupedData: groupedData } as S, () => this.onDataItemsUpdate());\n }\n }\n\n validate(value: any) {\n const validationObj = validateField(this.state.props, value);\n this.setState({\n isValid: validationObj.isValid,\n errorType: validationObj.errorType\n } as S);\n }\n\n updateDatavalue(value: any) {\n return new Promise<void>((resolve) => {\n this.updateState({\n props: { datavalue: value }\n } as S,\n () => {\n this.computeDisplayValue();\n resolve();\n });\n });\n }\n\n onValueChange(value: any) {\n if (this.state.props.datafield === 'All Fields') {\n const selectedItem = find(this.state.dataItems, (item) => isEqual(item.key, value));\n value = selectedItem && selectedItem.dataObject;\n }\n this.onChange(value);\n }\n\n getItemKey(value: any) {\n const selectedItem = find(this.state.dataItems, (item) => isEqual(item.dataObject, value));\n return selectedItem && selectedItem.key;\n }\n\n onChange(value: any) {\n const oldValue = this.state.props.datavalue;\n this.validate(value);\n this.updateDatavalue(value)\n .then(() => {\n if (value !== oldValue) {\n if (this.props.onFieldChange) {\n this.props.onFieldChange('datavalue', value, oldValue);\n } else {\n this.invokeEventCallback('onChange', [\n undefined,\n this.proxy,\n value,\n oldValue,\n ]);\n }\n }\n });\n }\n\n computeDisplayValue() {\n this.updateState({\n props: {\n displayValue: ((this.state.dataItems || [] as any)\n .filter((item: any) => item.selected)\n .map((item: any) => item.displayexp || item.displayfield))[0] || ''\n }\n } as S);\n }\n\n onDataItemsUpdate() {\n this.computeDisplayValue();\n }\n\n getUniqObjsByDataField(\n data: any,\n allowEmptyFields: boolean = true\n ) {\n let uniqData;\n const isAllFields = this.state.props.datafield === 'All Fields';\n\n uniqData = isAllFields ? uniqWith(data, isEqual) : uniqBy(data, 'datafield');\n\n if (!this.state.props.displayfield || allowEmptyFields) {\n return uniqData;\n }\n\n // return objects having non empty datafield and display field values.\n return filter(uniqData, (obj) => {\n if (isAllFields) {\n return trim(obj.displayfield);\n }\n return trim(obj.datafield) && trim(obj.displayfield);\n });\n }\n\n setDataItems(dataset: any, propsObj?: { [key: string]: any }, allowEmpty: boolean = true) {\n const name = this.props.name;\n const props = this.state.props;\n const datavalue = propsObj ? propsObj['dataValue'] : props.datavalue;\n let dataItems: any = [];\n let datavalueItems: any = [];\n if (typeof datavalue === 'string') {\n datavalueItems = datavalue.split(',');\n datavalueItems = allowEmpty ? datavalueItems : datavalueItems.map((item: any) => item.trim());\n } else if (isArray(datavalue)) {\n datavalueItems = datavalue;\n } else {\n if (isDefined(datavalue)) {\n datavalueItems = [datavalue];\n }\n }\n if (typeof dataset === 'string') {\n dataset = dataset.split(',');\n }\n if (isArray(dataset) && !isObject(dataset[0])) {\n dataItems = dataset.map((s, i) => {\n s = isString(s) ? s.trim() : s;\n return {\n key: `${name}_item${i}`,\n dataObject: s,\n displayfield: s.toString(),\n datafield: s,\n selected: includes(datavalueItems, s) || includes(datavalueItems, s.toString()) || datavalue === s ? true : false,\n };\n });\n } else if (dataset) {\n if (isObject(dataset) && !isArray(dataset)) {\n forEach(dataset, (value, key) => {\n if (isDefined(key) && key !== null) {\n dataItems.push({key: `${name}_item${key}`, displayfield: value, datafield: key, dataObject: dataset});\n }\n });\n } else {\n const isSelected = (item: any) => {\n if (datavalueItems.length) {\n let datafield = this.state.props.datafield;\n if (!datafield) {\n datafield = 'All Fields';\n }\n if (datafield === 'All Fields') {\n return includes(datavalueItems, item);\n }\n let df = get(item, datafield);\n if (isDefined(df) && df !== null) {\n return (includes(datavalueItems, df) || includes(datavalueItems, df.toString()));\n }\n }\n return false;\n };\n forEach(dataset as any[], (d, i) => {\n let datafieldValue = this.state.props.datafield === 'All Fields' ? d : get(d, this.state.props.datafield);\n if (isDefined(datafieldValue) && datafieldValue !== null) {\n dataItems.push({\n key: `${name}_item${i}`,\n dataObject: d,\n displayfield: (get(d, this.state.props.displayfield))?.toString() || (get(d, this.state.props.displaylabel))?.toString(),\n datafield: datafieldValue,\n displayexp: this.state.props.getDisplayExpression ? this.state.props.getDisplayExpression(d) : get(d, this.state.props.displayfield),\n selected: isSelected(d),\n imgSrc: isFunction(this.state.props.displayimagesrc) ? this.state.props.displayimagesrc(d) : get(d, this.state.props.displayimagesrc),\n icon: d[this.props.iconclass]\n });\n }\n });\n }\n }\n if (dataItems.length) {\n dataItems = this.getUniqObjsByDataField(dataItems, allowEmpty);\n }\n const isUpdated = !isEqual(dataItems, this.state.dataItems);\n if (props.groupby) {\n this.setGroupData(dataItems);\n this.updateState({ dataItems: dataItems } as S, () => isUpdated && this.onDataItemsUpdate());\n } else if (props.orderby) {\n this.updateState({ dataItems: getOrderedDataset(dataItems, props.orderby, 'dataObject')} as S, () => isUpdated && this.onDataItemsUpdate());\n } else {\n this.updateState({ dataItems: dataItems } as S, () => isUpdated && this.onDataItemsUpdate());\n }\n }\n}\n"],"mappings":";;;AAAA,SAASA,aAAa,EAAEC,kBAAkB,QAAQ,+CAA+C;AAEjG,SAASC,IAAI,EAAEC,QAAQ,EAAEC,OAAO,EAAUC,UAAU,EAAEC,QAAQ,EAAEC,GAAG,EAAEC,OAAO,EAAEC,QAAQ,EAAEC,OAAO,EAAEC,MAAM,EAAEC,IAAI,EAAEC,MAAM,EAAEC,QAAQ,QAAQ,QAAQ;AAC/I,SAASC,cAAc,EAAEC,iBAAiB,EAAEC,SAAS,EAAEC,aAAa,QAAQ,sCAAsC;AAClH,SAASC,aAAa,QAA2B,2EAA2E;AAE5H,OAAO,MAAMC,gBAAgB,SAAs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find","isString","isEqual","isFunction","includes","get","forEach","isObject","isArray","filter","trim","uniqBy","uniqWith","getGroupedData","getOrderedDataset","isDefined","validateField","DEFAULT_CLASS","BaseDatasetState","constructor","args","_defineProperty","BaseDatasetComponent","props","defaultClass","defaultProps","defaultState","onPropertyChange","name","$new","$old","state","setDataItems","dataset","setGroupData","dataItems","dataValue","isDefault","updateState","onFieldChange","bind","items","groupby","groupedData","match","orderby","dateformat","onDataItemsUpdate","validate","value","validationObj","setState","isValid","errorType","updateDatavalue","Promise","resolve","datavalue","computeDisplayValue","onValueChange","datafield","selectedItem","item","key","dataObject","onChange","getItemKey","oldValue","then","invokeEventCallback","undefined","proxy","displayValue","selected","map","displayexp","displayfield","getUniqObjsByDataField","data","allowEmptyFields","uniqData","isAllFields","obj","propsObj","allowEmpty","datavalueItems","split","s","i","toString","push","isSelected","length","df","d","datafieldValue","_get","_get2","displaylabel","getDisplayExpression","imgSrc","displayimagesrc","icon","iconclass","isUpdated"],"sources":["basedataset.component.ts"],"sourcesContent":["import { BaseComponent, BaseComponentState } from \"@wavemaker/app-rn-runtime/core/base.component\";\nimport BaseDatasetProps from '@wavemaker/app-rn-runtime/components/input/basedataset/basedataset.props';\nimport { find, isString, isEqual,isEmpty, isFunction, includes, get, forEach, isObject, isArray, filter, trim, uniqBy, uniqWith } from 'lodash';\nimport { getGroupedData, getOrderedDataset, isDefined, validateField } from \"@wavemaker/app-rn-runtime/core/utils\";\nimport { DEFAULT_CLASS, BaseDatasetStyles } from \"@wavemaker/app-rn-runtime/components/input/basedataset/basedataset.styles\";\n\nexport class BaseDatasetState <T extends BaseDatasetProps> extends BaseComponentState<T> {\n dataItems: any;\n groupedData: any;\n isDefault = false;\n isValid = true;\n errorType = '';\n}\n\nexport abstract class BaseDatasetComponent< T extends BaseDatasetProps, S extends BaseDatasetState<T>, L extends BaseDatasetStyles> extends BaseComponent<T, S, L> {\n\n constructor(props: T, public defaultClass: string = DEFAULT_CLASS, defaultProps?: T, defaultState?: S) {\n super(props, defaultClass, defaultProps, defaultState);\n\n }\n\n onPropertyChange(name: string, $new: any, $old: any) {\n const props = this.state.props;\n switch (name) {\n case 'dataset':\n this.setDataItems($new);\n break;\n case 'getDisplayExpression':\n case 'displayfield':\n case 'displaylabel':\n case 'displayimagesrc':\n case 'datafield':\n case 'orderby':\n this.setDataItems(this.state.props.dataset);\n break;\n case 'groupby':\n case 'match':\n this.setGroupData(this.state.dataItems);\n case 'datavalue':\n this.setDataItems(this.state.props.dataset, { dataValue: $new });\n const isDefault = this.state.isDefault;\n if (isDefault) {\n this.updateState({ isDefault: false } as S, this.props.onFieldChange && this.props.onFieldChange.bind(this, 'datavalue', $new, $old, isDefault));\n } else {\n this.props.onFieldChange && this.props.onFieldChange('datavalue', $new, $old, isDefault);\n }\n }\n }\n\n setGroupData(items: any) {\n const dataItems = items;\n const props = this.state.props;\n if (props.groupby) {\n const groupedData = dataItems && getGroupedData(dataItems, props.groupby, props.match, props.orderby, props.dateformat, this, 'dataObject');\n this.updateState({ groupedData: groupedData } as S, () => this.onDataItemsUpdate());\n }\n }\n\n validate(value: any) {\n const validationObj = validateField(this.state.props, value);\n this.setState({\n isValid: validationObj.isValid,\n errorType: validationObj.errorType\n } as S);\n }\n\n updateDatavalue(value: any) {\n return new Promise<void>((resolve) => {\n this.updateState({\n props: { datavalue: value }\n } as S,\n () => {\n this.computeDisplayValue();\n resolve();\n });\n });\n }\n\n onValueChange(value: any) {\n if (this.state.props.datafield === 'All Fields') {\n const selectedItem = find(this.state.dataItems, (item) => isEqual(item.key, value));\n value = selectedItem && selectedItem.dataObject;\n }\n this.onChange(value);\n }\n\n getItemKey(value: any) {\n const selectedItem = find(this.state.dataItems, (item) => isEqual(item.dataObject, value));\n return selectedItem && selectedItem.key;\n }\n\n onChange(value: any) {\n const oldValue = this.state.props.datavalue;\n this.validate(value);\n this.updateDatavalue(value)\n .then(() => {\n if (value !== oldValue) {\n if (this.props.onFieldChange) {\n this.props.onFieldChange('datavalue', value, oldValue);\n } else {\n this.invokeEventCallback('onChange', [\n undefined,\n this.proxy,\n value,\n oldValue,\n ]);\n }\n }\n });\n }\n\n computeDisplayValue() {\n this.updateState({\n props: {\n displayValue: ((this.state.dataItems || [] as any)\n .filter((item: any) => item.selected)\n .map((item: any) => item.displayexp || item.displayfield))[0] || ''\n }\n } as S);\n }\n\n onDataItemsUpdate() {\n this.computeDisplayValue();\n }\n\n getUniqObjsByDataField(\n data: any,\n allowEmptyFields: boolean = true\n ) {\n let uniqData;\n const isAllFields = this.state.props.datafield === 'All Fields';\n\n uniqData = isAllFields ? uniqWith(data, isEqual) : uniqBy(data, 'datafield');\n\n if (!this.state.props.displayfield || allowEmptyFields) {\n return uniqData;\n }\n\n // return objects having non empty datafield and display field values.\n return filter(uniqData, (obj) => {\n if (isAllFields) {\n return trim(obj.displayfield);\n }\n return trim(obj.datafield) && trim(obj.displayfield);\n });\n }\n\n setDataItems(dataset: any, propsObj?: { [key: string]: any }, allowEmpty: boolean = true) {\n const name = this.props.name;\n const props = this.state.props;\n const datavalue = propsObj ? propsObj['dataValue'] : props.datavalue;\n let dataItems: any = [];\n let datavalueItems: any = [];\n if (typeof datavalue === 'string') {\n datavalueItems = datavalue.split(',');\n datavalueItems = allowEmpty ? datavalueItems : datavalueItems.map((item: any) => item.trim());\n } else if (isArray(datavalue)) {\n datavalueItems = datavalue;\n } else {\n if (isDefined(datavalue)) {\n datavalueItems = [datavalue];\n }\n }\n if (typeof dataset === 'string') {\n dataset = dataset.split(',');\n }\n if (isArray(dataset) && !isObject(dataset[0])) {\n dataItems = dataset.map((s, i) => {\n s = isString(s) ? s.trim() : s;\n return {\n key: `${name}_item${i}`,\n dataObject: s,\n displayfield: s.toString(),\n datafield: s,\n selected: includes(datavalueItems, s) || includes(datavalueItems, s.toString()) || datavalue === s ? true : false,\n };\n });\n } else if (dataset) {\n if (isObject(dataset) && !isArray(dataset)) {\n forEach(dataset, (value, key) => {\n if (isDefined(key) && key !== null) {\n dataItems.push({key: `${name}_item${key}`, displayfield: value, datafield: key, dataObject: dataset});\n }\n });\n } else {\n const isSelected = (item: any) => {\n if (datavalueItems.length) {\n let datafield = this.state.props.datafield;\n if (!datafield) {\n datafield = 'All Fields';\n }\n if (datafield === 'All Fields') {\n return includes(datavalueItems, item);\n }\n let df = get(item, datafield);\n if (isDefined(df) && df !== null) {\n return (includes(datavalueItems, df) || includes(datavalueItems, df.toString()));\n }\n }\n return false;\n };\n forEach(dataset as any[], (d, i) => {\n let datafieldValue = this.state.props.datafield === 'All Fields' ? d : get(d, this.state.props.datafield);\n if (isDefined(datafieldValue) && datafieldValue !== null) {\n dataItems.push({\n key: `${name}_item${i}`,\n dataObject: d,\n displayfield: (get(d, this.state.props.displayfield))?.toString() || (get(d, this.state.props.displaylabel))?.toString(),\n datafield: datafieldValue,\n displayexp: this.state.props.getDisplayExpression ? this.state.props.getDisplayExpression(d) : get(d, this.state.props.displayfield),\n selected: isSelected(d),\n imgSrc: isFunction(this.state.props.displayimagesrc) ? this.state.props.displayimagesrc(d) : get(d, this.state.props.displayimagesrc),\n icon: d[this.props.iconclass]\n });\n }\n });\n }\n }\n if (dataItems.length) {\n dataItems = this.getUniqObjsByDataField(dataItems, allowEmpty);\n }\n const isUpdated = !isEqual(dataItems, this.state.dataItems);\n if (props.groupby) {\n this.setGroupData(dataItems);\n this.updateState({ dataItems: dataItems } as S, () => isUpdated && this.onDataItemsUpdate());\n } else if (props.orderby) {\n this.updateState({ dataItems: getOrderedDataset(dataItems, props.orderby, 'dataObject')} as S, () => isUpdated && this.onDataItemsUpdate());\n } else {\n this.updateState({ dataItems: dataItems } as S, () => isUpdated && this.onDataItemsUpdate());\n }\n }\n}\n"],"mappings":";;;AAAA,SAASA,aAAa,EAAEC,kBAAkB,QAAQ,+CAA+C;AAEjG,SAASC,IAAI,EAAEC,QAAQ,EAAEC,OAAO,EAAUC,UAAU,EAAEC,QAAQ,EAAEC,GAAG,EAAEC,OAAO,EAAEC,QAAQ,EAAEC,OAAO,EAAEC,M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7I,CAAC,MAAM;MACL,IAAI,CAACT,WAAW,CAAC;QAAEH,SAAS,EAAEA;MAAU,CAAC,EAAO,MAAMqE,SAAS,IAAI,IAAI,CAACzD,iBAAiB,CAAC,CAAC,CAAC;IAC9F;EACF;AACF","ignoreList":[]}
@@ -12,6 +12,7 @@ export class BaseInputState extends BaseComponentState {
12
12
  super(...args);
13
13
  _defineProperty(this, "keyboardType", 'default');
14
14
  _defineProperty(this, "isValid", true);
15
+ _defineProperty(this, "isInputFocused", false);
15
16
  _defineProperty(this, "textValue", '');
16
17
  _defineProperty(this, "isDefault", false);
17
18
  _defineProperty(this, "errorType", '');
@@ -24,6 +25,7 @@ export class BaseInputComponent extends BaseComponent {
24
25
  _defineProperty(this, "widgetRef", null);
25
26
  _defineProperty(this, "isTouched", false);
26
27
  _defineProperty(this, "cursor", 0);
28
+ _defineProperty(this, "timer", null);
27
29
  }
28
30
  focus() {
29
31
  var _this$widgetRef;
@@ -65,17 +67,40 @@ export class BaseInputComponent extends BaseComponent {
65
67
  onChange(event) {
66
68
  if (this.state.props.updateon === 'default') {
67
69
  this.updateDatavalue(event.target.value, event);
70
+ } else if (this.state.props.updateon === 'lazy') {
71
+ if (this.timer !== null) {
72
+ clearTimeout(this.timer);
73
+ this.timer = null;
74
+ }
75
+ this.timer = setTimeout(() => {
76
+ this.updateDatavalue(event.target.value, event);
77
+ }, 300);
68
78
  }
69
79
  }
70
80
  onChangeText(value) {
71
- this.updateState({
72
- textValue: value
73
- }, () => {
74
- if (this.state.props.updateon === 'default') {
75
- this.validate(value);
76
- this.updateDatavalue(value, null);
81
+ if (this.state.props.updateon === 'lazy') {
82
+ if (this.timer !== null) {
83
+ clearTimeout(this.timer);
84
+ this.timer = null;
77
85
  }
78
- });
86
+ this.timer = setTimeout(() => {
87
+ this.updateState({
88
+ textValue: value
89
+ }, () => {
90
+ this.validate(value);
91
+ this.updateDatavalue(value, null);
92
+ });
93
+ }, 300);
94
+ } else {
95
+ this.updateState({
96
+ textValue: value
97
+ }, () => {
98
+ if (this.state.props.updateon === 'default') {
99
+ this.validate(value);
100
+ this.updateDatavalue(value, null);
101
+ }
102
+ });
103
+ }
79
104
  }
80
105
  invokeChange(e) {
81
106
  if (Platform.OS === 'web') {
@@ -96,11 +121,23 @@ export class BaseInputComponent extends BaseComponent {
96
121
  if (props.autotrim && props.datavalue && isString(props.datavalue)) {
97
122
  value = value.trim();
98
123
  }
99
- this.updateState({
100
- props: {
101
- datavalue: value
124
+ new Promise(resolve => {
125
+ if (props.hastwowaybinding) {
126
+ this.setProp("datavalue", value);
127
+ this.updateState({
128
+ props: {
129
+ "datavalue": value
130
+ }
131
+ });
132
+ resolve(true);
133
+ } else {
134
+ this.updateState({
135
+ props: {
136
+ datavalue: value
137
+ }
138
+ }, () => resolve(true));
102
139
  }
103
- }, () => {
140
+ }).then(() => {
104
141
  !this.props.onFieldChange && value !== oldValue && this.invokeEventCallback('onChange', [event, this.proxy, value, oldValue]);
105
142
  if (source === 'blur') {
106
143
  this.invokeEventCallback('onBlur', [event, this.proxy]);
@@ -110,7 +147,7 @@ export class BaseInputComponent extends BaseComponent {
110
147
  onBlur(event) {
111
148
  Injector.FOCUSED_ELEMENT.remove();
112
149
  this.isTouched = true;
113
- let newVal = this.state.textValue;
150
+ let newVal = this.state.textValue || '';
114
151
  let oldVal = this.state.props.datavalue || '';
115
152
  this.validate(newVal);
116
153
  if (newVal === '' || newVal == undefined) {
@@ -118,12 +155,15 @@ export class BaseInputComponent extends BaseComponent {
118
155
  this.props.triggerValidation && this.props.triggerValidation();
119
156
  }, 10);
120
157
  }
121
- if (this.state.props.updateon === 'blur') {
122
- if (oldVal !== newVal) {
158
+ if (this.state.props.updateon === 'blur' || this.state.props.updateon === 'default') {
159
+ if (oldVal !== newVal && this.state.props.updateon === 'blur') {
123
160
  this.updateDatavalue(newVal, event, 'blur');
124
161
  } else {
125
162
  this.invokeEventCallback('onBlur', [event, this.proxy]);
126
163
  }
164
+ this.setState({
165
+ isInputFocused: false
166
+ });
127
167
  }
128
168
  }
129
169
  validate(value) {
@@ -142,6 +182,9 @@ export class BaseInputComponent extends BaseComponent {
142
182
  this.invokeEventCallback('onFocus', [event, this.proxy]);
143
183
  (_this$closestTappable = this.closestTappable) === null || _this$closestTappable === void 0 || _this$closestTappable.triggerTap();
144
184
  }, 250);
185
+ this.setState({
186
+ isInputFocused: true
187
+ });
145
188
  }
146
189
  onKeyPress(event) {
147
190
  this.invokeEventCallback('onKeypress', [event, this.proxy]);
@@ -1 +1 @@
1
- {"version":3,"names":["DEFAULT_CLASS","BaseComponent","BaseComponentState","isString","Platform","validateField","Injector","BaseInputState","constructor","args","_defineProperty","BaseInputComponent","props","defaultClass","defaultProps","defaultState","focus","_this$widgetRef","widgetRef","blur","_this$widgetRef2","_this$widgetRef3","onPropertyChange","name","$new","$old","keyboardType","type","updateState","textValue","isDefault","state","onFieldChange","bind","onChange","event","updateon","updateDatavalue","target","value","onChangeText","validate","invokeChange","e","OS","cursor","selectionStart","setState","source","oldValue","datavalue","autotrim","trim","invokeEventCallback","proxy","onBlur","FOCUSED_ELEMENT","remove","isTouched","newVal","oldVal","undefined","setTimeout","triggerValidation","validationObj","isValid","errorType","onFocus","_this$closestTappable","set","closestTappable","triggerTap","onKeyPress"],"sources":["baseinput.component.ts"],"sourcesContent":["import { DEFAULT_CLASS } from '@wavemaker/app-rn-runtime/components/navigation/basenav/basenav.styles';\nimport { BaseComponent, BaseComponentState } from '@wavemaker/app-rn-runtime/core/base.component';\nimport BaseInputProps from './baseinput.props';\nimport { isString } from 'lodash';\nimport { BaseInputStyles } from './baseinput.styles';\nimport { Platform, TextInput } from 'react-native';\nimport { validateField } from '@wavemaker/app-rn-runtime/core/utils';\nimport Injector from '@wavemaker/app-rn-runtime/core/injector';\n\nexport class BaseInputState <T extends BaseInputProps> extends BaseComponentState<T> {\n keyboardType: any = 'default';\n isValid: boolean = true;\n textValue: string = '';\n isDefault = false;\n errorType: string = '';\n}\nexport abstract class BaseInputComponent< T extends BaseInputProps, S extends BaseInputState<T>, L extends BaseInputStyles> extends BaseComponent<T, S, L> {\n public widgetRef: TextInput | null = null;\n isTouched: boolean = false;\n private cursor: any = 0;\n constructor(props: T, public defaultClass: string = DEFAULT_CLASS, defaultProps?: T, defaultState?: S) {\n super(props, defaultClass, defaultProps, defaultState);\n }\n\n focus() {\n this?.widgetRef?.focus();\n }\n\n blur() {\n this?.widgetRef?.blur && this?.widgetRef?.blur();\n }\n\n onPropertyChange(name: string, $new: any, $old: any) {\n switch (name) {\n case 'type':\n let keyboardType;\n if (this.props.type === 'number') {\n keyboardType = 'numeric';\n } else if (this.props.type === 'tel') {\n keyboardType = 'phone-pad';\n } else if (this.props.type === 'email') {\n keyboardType = 'email-address';\n }\n this.updateState({\n keyboardType: keyboardType,\n } as S);\n break;\n case 'datavalue':\n this.updateState({\n textValue: $new\n } as S\n );\n const isDefault = this.state.isDefault;\n if (isDefault) {\n this.updateState({ isDefault: false } as S, this.props.onFieldChange && this.props.onFieldChange.bind(this, 'datavalue', $new, $old, isDefault));\n } else {\n this.props.onFieldChange && this.props.onFieldChange('datavalue', $new, $old, isDefault);\n }\n }\n }\n\n onChange(event: any) {\n if (this.state.props.updateon === 'default') {\n this.updateDatavalue(event.target.value, event);\n }\n }\n\n onChangeText(value: any) {\n this.updateState({\n textValue: value\n } as S, () => {\n if (this.state.props.updateon === 'default') {\n this.validate(value);\n this.updateDatavalue(value, null);\n }\n }\n );\n }\n\n invokeChange(e: any) {\n if (Platform.OS === 'web') {\n this.cursor = e.target.selectionStart;\n this.setState({ textValue: e.target.value });\n }\n }\n\n updateDatavalue(value: any, event?: any, source?: any) {\n const props = this.state.props;\n const oldValue = props.datavalue;\n if (value === oldValue) {\n return;\n }\n\n // autotrim\n if (props.autotrim && props.datavalue && isString(props.datavalue)) {\n value = value.trim();\n }\n\n this.updateState({\n props: {\n datavalue: value\n }\n } as S, () => {\n !this.props.onFieldChange && value !== oldValue && this.invokeEventCallback('onChange', [event, this.proxy, value, oldValue]);\n if (source === 'blur') {\n this.invokeEventCallback('onBlur', [ event, this.proxy]);\n }\n })\n\n }\n\n onBlur(event: any) {\n Injector.FOCUSED_ELEMENT.remove();\n this.isTouched = true;\n let newVal = this.state.textValue;\n let oldVal = this.state.props.datavalue || '';\n this.validate(newVal);\n if (newVal === '' || newVal == undefined) {\n setTimeout(() => {\n this.props.triggerValidation && this.props.triggerValidation();\n },10)\n }\n if (this.state.props.updateon === 'blur') {\n if (oldVal !== newVal) {\n this.updateDatavalue(newVal, event, 'blur');\n } else {\n this.invokeEventCallback('onBlur', [event, this.proxy]);\n }\n }\n }\n\n validate(value: any) {\n const validationObj = validateField(this.state.props, value);\n this.setState({\n isValid: validationObj.isValid,\n errorType: validationObj.errorType\n } as S);\n }\n\n onFocus(event: any) {\n // When input widgets are inside list widget and try to focus the field, list is selecting but unable to enter values in input fields\n // because on tap event of list is triggering after 200ms timeout So added 250ms timeout here\n setTimeout(() => {\n Injector.FOCUSED_ELEMENT.set(this);\n this.invokeEventCallback('onFocus', [ event, this.proxy]);\n this.closestTappable?.triggerTap();\n }, 250);\n\n }\n\n onKeyPress(event: any) {\n this.invokeEventCallback('onKeypress', [ event, this.proxy]);\n }\n}\n"],"mappings":";;;AAAA,SAASA,aAAa,QAAQ,wEAAwE;AACtG,SAASC,aAAa,EAAEC,kBAAkB,QAAQ,+CAA+C;AAEjG,SAASC,QAAQ,QAAQ,QAAQ;AAEjC,SAASC,QAAQ,QAAmB,cAAc;AAClD,SAASC,aAAa,QAAQ,sCAAsC;AACpE,OAAOC,QAAQ,MAAM,yCAAyC;AAE9D,OAAO,MAAMC,cAAc,SAAoCL,kBAAkB,CAAI;EAAAM,YAAA,GAAAC,IAAA;IAAA,SAAAA,IAAA;IAAAC,eAAA,uBAC/D,SAAS;IAAAA,eAAA,kBACV,IAAI;IAAAA,eAAA,oBACH,EAAE;IAAAA,eAAA,oBACV,KAAK;IAAAA,eAAA,oBACG,EAAE;EAAA;AACxB;AACA,OAAO,MAAe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ACrC,KAAU,EAAE;IACrB,IAAI,CAACkB,mBAAmB,CAAC,YAAY,EAAE,CAAElB,KAAK,EAAE,IAAI,CAACmB,KAAK,CAAC,CAAC;EAC9D;AACF","ignoreList":[]}
1
+ {"version":3,"names":["DEFAULT_CLASS","BaseComponent","BaseComponentState","isString","Platform","validateField","Injector","BaseInputState","constructor","args","_defineProperty","BaseInputComponent","props","defaultClass","defaultProps","defaultState","focus","_this$widgetRef","widgetRef","blur","_this$widgetRef2","_this$widgetRef3","onPropertyChange","name","$new","$old","keyboardType","type","updateState","textValue","isDefault","state","onFieldChange","bind","onChange","event","updateon","updateDatavalue","target","value","timer","clearTimeout","setTimeout","onChangeText","validate","invokeChange","e","OS","cursor","selectionStart","setState","source","oldValue","datavalue","autotrim","trim","Promise","resolve","hastwowaybinding","setProp","then","invokeEventCallback","proxy","onBlur","FOCUSED_ELEMENT","remove","isTouched","newVal","oldVal","undefined","triggerValidation","isInputFocused","validationObj","isValid","errorType","onFocus","_this$closestTappable","set","closestTappable","triggerTap","onKeyPress"],"sources":["baseinput.component.ts"],"sourcesContent":["import { DEFAULT_CLASS } from '@wavemaker/app-rn-runtime/components/navigation/basenav/basenav.styles';\nimport { BaseComponent, BaseComponentState } from '@wavemaker/app-rn-runtime/core/base.component';\nimport BaseInputProps from './baseinput.props';\nimport { isString } from 'lodash';\nimport { BaseInputStyles } from './baseinput.styles';\nimport { Platform, TextInput } from 'react-native';\nimport { validateField } from '@wavemaker/app-rn-runtime/core/utils';\nimport Injector from '@wavemaker/app-rn-runtime/core/injector';\n\nexport class BaseInputState <T extends BaseInputProps> extends BaseComponentState<T> {\n keyboardType: any = 'default';\n isValid: boolean = true;\n isInputFocused: boolean = false;\n textValue: string = '';\n isDefault = false;\n errorType: string = '';\n}\nexport abstract class BaseInputComponent< T extends BaseInputProps, S extends BaseInputState<T>, L extends BaseInputStyles> extends BaseComponent<T, S, L> {\n public widgetRef: TextInput | null = null;\n isTouched: boolean = false;\n private cursor: any = 0;\n private timer: ReturnType<typeof setTimeout> | null = null;\n constructor(props: T, public defaultClass: string = DEFAULT_CLASS, defaultProps?: T, defaultState?: S) {\n super(props, defaultClass, defaultProps, defaultState);\n }\n\n focus() {\n this?.widgetRef?.focus();\n }\n\n blur() {\n this?.widgetRef?.blur && this?.widgetRef?.blur();\n }\n\n onPropertyChange(name: string, $new: any, $old: any) {\n switch (name) {\n case 'type':\n let keyboardType;\n if (this.props.type === 'number') {\n keyboardType = 'numeric';\n } else if (this.props.type === 'tel') {\n keyboardType = 'phone-pad';\n } else if (this.props.type === 'email') {\n keyboardType = 'email-address';\n }\n this.updateState({\n keyboardType: keyboardType,\n } as S);\n break;\n case 'datavalue':\n this.updateState({\n textValue: $new\n } as S\n );\n const isDefault = this.state.isDefault;\n if (isDefault) {\n this.updateState({ isDefault: false } as S, this.props.onFieldChange && this.props.onFieldChange.bind(this, 'datavalue', $new, $old, isDefault));\n } else {\n this.props.onFieldChange && this.props.onFieldChange('datavalue', $new, $old, isDefault);\n }\n }\n }\n\n onChange(event: any) {\n if (this.state.props.updateon === 'default') {\n this.updateDatavalue(event.target.value, event);\n }else if(this.state.props.updateon === 'lazy') {\n if(this.timer !== null) {\n clearTimeout(this.timer);\n this.timer = null;\n }\n\n this.timer = setTimeout(() => {\n this.updateDatavalue(event.target.value, event);\n }, 300)\n }\n }\n\n onChangeText(value: any) {\n if(this.state.props.updateon === 'lazy') {\n if(this.timer !== null) {\n clearTimeout(this.timer);\n this.timer = null;\n }\n\n this.timer = setTimeout(() => {\n this.updateState({\n textValue: value\n } as S, () => {\n this.validate(value);\n this.updateDatavalue(value, null);\n }\n );\n }, 300)\n }\n else {\n this.updateState({\n textValue: value\n } as S, () => {\n if (this.state.props.updateon === 'default') {\n this.validate(value);\n this.updateDatavalue(value, null);\n }\n }\n );\n }\n }\n\n invokeChange(e: any) {\n if (Platform.OS === 'web') {\n this.cursor = e.target.selectionStart;\n this.setState({ textValue: e.target.value });\n }\n }\n\n updateDatavalue(value: any, event?: any, source?: any) {\n const props = this.state.props;\n const oldValue = props.datavalue;\n if (value === oldValue) {\n return;\n }\n\n // autotrim\n if (props.autotrim && props.datavalue && isString(props.datavalue)) {\n value = value.trim();\n }\n new Promise((resolve) => {\n if (props.hastwowaybinding) {\n this.setProp(\"datavalue\", value);\n this.updateState({props: { \"datavalue\": value }} as S);\n resolve(true);\n } else {\n this.updateState({\n props: {\n datavalue: value\n }\n } as S, () => resolve(true));\n }\n }).then(() => {\n !this.props.onFieldChange && value !== oldValue && this.invokeEventCallback('onChange', [event, this.proxy, value, oldValue]);\n if (source === 'blur') {\n this.invokeEventCallback('onBlur', [ event, this.proxy]);\n }\n })\n }\n\n onBlur(event: any) {\n Injector.FOCUSED_ELEMENT.remove();\n this.isTouched = true;\n let newVal = this.state.textValue || '';\n let oldVal = this.state.props.datavalue || '';\n this.validate(newVal);\n if (newVal === '' || newVal == undefined) {\n setTimeout(() => {\n this.props.triggerValidation && this.props.triggerValidation();\n },10)\n }\n if (this.state.props.updateon === 'blur' || this.state.props.updateon === 'default') {\n if (oldVal !== newVal && this.state.props.updateon === 'blur') {\n this.updateDatavalue(newVal, event, 'blur');\n } else {\n this.invokeEventCallback('onBlur', [event, this.proxy]);\n }\n this.setState({ isInputFocused: false })\n }\n }\n\n validate(value: any) {\n const validationObj = validateField(this.state.props, value);\n this.setState({\n isValid: validationObj.isValid,\n errorType: validationObj.errorType\n } as S);\n }\n\n onFocus(event: any) {\n // When input widgets are inside list widget and try to focus the field, list is selecting but unable to enter values in input fields\n // because on tap event of list is triggering after 200ms timeout So added 250ms timeout here\n setTimeout(() => {\n Injector.FOCUSED_ELEMENT.set(this);\n this.invokeEventCallback('onFocus', [ event, this.proxy]);\n this.closestTappable?.triggerTap();\n }, 250);\n this.setState({ isInputFocused: true })\n }\n\n onKeyPress(event: any) {\n this.invokeEventCallback('onKeypress', [ event, this.proxy]);\n }\n}\n"],"mappings":";;;AAAA,SAASA,aAAa,QAAQ,wEAAwE;AACtG,SAASC,aAA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I,CAACZ,QAAQ,CAAC;QAAEqB,cAAc,EAAE;MAAM,CAAC,CAAC;IAC1C;EACF;EAEA3B,QAAQA,CAACL,KAAU,EAAE;IACnB,MAAMiC,aAAa,GAAGnE,aAAa,CAAC,IAAI,CAAC0B,KAAK,CAACnB,KAAK,EAAE2B,KAAK,CAAC;IAC5D,IAAI,CAACW,QAAQ,CAAC;MACZuB,OAAO,EAAED,aAAa,CAACC,OAAO;MAC9BC,SAAS,EAAEF,aAAa,CAACE;IAC3B,CAAM,CAAC;EACT;EAEAC,OAAOA,CAACxC,KAAU,EAAE;IAClB;IACA;IACAO,UAAU,CAAC,MAAM;MAAA,IAAAkC,qBAAA;MACftE,QAAQ,CAAC0D,eAAe,CAACa,GAAG,CAAC,IAAI,CAAC;MAClC,IAAI,CAAChB,mBAAmB,CAAC,SAAS,EAAE,CAAE1B,KAAK,EAAE,IAAI,CAAC2B,KAAK,CAAC,CAAC;MACzD,CAAAc,qBAAA,OAAI,CAACE,eAAe,cAAAF,qBAAA,eAApBA,qBAAA,CAAsBG,UAAU,CAAC,CAAC;IACpC,CAAC,EAAE,GAAG,CAAC;IACP,IAAI,CAAC7B,QAAQ,CAAC;MAAEqB,cAAc,EAAE;IAAK,CAAC,CAAC;EACzC;EAEAS,UAAUA,CAAC7C,KAAU,EAAE;IACrB,IAAI,CAAC0B,mBAAmB,CAAC,YAAY,EAAE,CAAE1B,KAAK,EAAE,IAAI,CAAC2B,KAAK,CAAC,CAAC;EAC9D;AACF","ignoreList":[]}
@@ -9,6 +9,7 @@ export default class BaseInputProps extends BaseProps {
9
9
  _defineProperty(this, "autocomplete", true);
10
10
  _defineProperty(this, "autotrim", true);
11
11
  _defineProperty(this, "datavalue", void 0);
12
+ _defineProperty(this, "hastwowaybinding", false);
12
13
  _defineProperty(this, "maxchars", null);
13
14
  _defineProperty(this, "readonly", null);
14
15
  _defineProperty(this, "regexp", null);
@@ -1 +1 @@
1
- {"version":3,"names":["BaseProps","BaseInputProps","constructor","args","_defineProperty","undefined"],"sources":["baseinput.props.ts"],"sourcesContent":["import {AccessibilityRole} from \"react-native\";\nimport { BaseProps } from '@wavemaker/app-rn-runtime/core/base.component';\n\nexport default class BaseInputProps extends BaseProps {\n autofocus: boolean = null as any;\n autocomplete: boolean = true;\n autotrim: boolean = true;\n datavalue: any;\n maxchars: number = null as any;\n readonly: boolean = null as any;\n regexp: string = null as any;\n type: string = 'text';\n updateon: string = 'blur' as any;\n required?: boolean = false as any;\n checkFormField?: any;\n onFieldChange?: any;\n triggerValidation?: any;\n accessibilitylabel?: string = undefined;\n hint?: string = undefined;\n accessibilityrole?: AccessibilityRole;\n accessibilitylabelledby?: string = undefined;\n maskchar: string = null as any;\n displayformat: string = null as any;\n}\n"],"mappings":";;;AACA,SAASA,SAAS,QAAQ,+CAA+C;AAEzE,eAAe,MAAMC,cAAc,SAASD,SAAS,CAAC;EAAAE,YAAA,GAAAC,IAAA;IAAA,SAAAA,IAAA;IAAAC,eAAA,oBAC/B,IAAI;IAAAA,eAAA,uBACD,IAAI;IAAAA,eAAA,mBACR,IAAI;IAAAA,eAAA;IAAAA,eAAA,mBAEL,IAAI;IAAAA,eAAA,mBACH,IAAI;IAAAA,eAAA,iBACP,IAAI;IAAAA,eAAA,eACN,MAAM;IAAAA,eAAA,mBACF,MAAM;IAAAA,eAAA,mBACJ,KAAK;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA,6BAIIC,SAAS;IAAAD,eAAA,eACvBC,SAAS;IAAAD,eAAA;IAAAA,eAAA,kCAEUC,SAAS;IAAAD,eAAA,mBACzB,IAAI;IAAAA,eAAA,wBACC,IAAI;EAAA;AAC9B","ignoreList":[]}
1
+ {"version":3,"names":["BaseProps","BaseInputProps","constructor","args","_defineProperty","undefined"],"sources":["baseinput.props.ts"],"sourcesContent":["import {AccessibilityRole} from \"react-native\";\nimport { BaseProps } from '@wavemaker/app-rn-runtime/core/base.component';\n\nexport default class BaseInputProps extends BaseProps {\n autofocus: boolean = null as any;\n autocomplete: boolean = true;\n autotrim: boolean = true;\n datavalue: any;\n hastwowaybinding = false;\n maxchars: number = null as any;\n readonly: boolean = null as any;\n regexp: string = null as any;\n type: string = 'text';\n updateon: string = 'blur' as any;\n required?: boolean = false as any;\n checkFormField?: any;\n onFieldChange?: any;\n triggerValidation?: any;\n accessibilitylabel?: string = undefined;\n hint?: string = undefined;\n accessibilityrole?: AccessibilityRole;\n accessibilitylabelledby?: string = undefined;\n maskchar: string = null as any;\n displayformat: string = null as any;\n}\n"],"mappings":";;;AACA,SAASA,SAAS,QAAQ,+CAA+C;AAEzE,eAAe,MAAMC,cAAc,SAASD,SAAS,CAAC;EAAAE,YAAA,GAAAC,IAAA;IAAA,SAAAA,IAAA;IAAAC,eAAA,oBAC/B,IAAI;IAAAA,eAAA,uBACD,IAAI;IAAAA,eAAA,mBACR,IAAI;IAAAA,eAAA;IAAAA,eAAA,2BAEL,KAAK;IAAAA,eAAA,mBACL,IAAI;IAAAA,eAAA,mBACH,IAAI;IAAAA,eAAA,iBACP,IAAI;IAAAA,eAAA,eACN,MAAM;IAAAA,eAAA,mBACF,MAAM;IAAAA,eAAA,mBACJ,KAAK;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA,6BAIIC,SAAS;IAAAD,eAAA,eACvBC,SAAS;IAAAD,eAAA;IAAAA,eAAA,kCAEUC,SAAS;IAAAD,eAAA,mBACzB,IAAI;IAAAA,eAAA,wBACC,IAAI;EAAA;AAC9B","ignoreList":[]}
@@ -10,6 +10,7 @@ export class BaseNumberState extends BaseComponentState {
10
10
  constructor(...args) {
11
11
  super(...args);
12
12
  _defineProperty(this, "isValid", true);
13
+ _defineProperty(this, "isInputFocused", false);
13
14
  _defineProperty(this, "textValue", '');
14
15
  _defineProperty(this, "isDefault", false);
15
16
  _defineProperty(this, "errorType", '');
@@ -66,21 +67,22 @@ export class BaseNumberComponent extends BaseComponent {
66
67
  }
67
68
  return isValidText;
68
69
  }
69
- onChangeText(value, type) {
70
- const isValidTextOnDevice = this.validateOnDevice(value, type);
70
+ onChangeText(value, type, shouldFormateToNumber) {
71
+ const newValue = shouldFormateToNumber ? `${this.parseNumber(value.replace(/[^0-9.]/g, ''))}` : value;
72
+ const isValidTextOnDevice = this.validateOnDevice(newValue, type);
71
73
  if (!isValidTextOnDevice) {
72
74
  return;
73
75
  }
74
- const decimalPlacesInNumber = countDecimalDigits(value);
76
+ const decimalPlacesInNumber = countDecimalDigits(newValue);
75
77
  if (this.props.decimalPlaces < decimalPlacesInNumber) {
76
78
  return;
77
79
  }
78
80
  this.updateState({
79
- textValue: value
81
+ textValue: newValue
80
82
  }, () => {
81
83
  if (this.state.props.updateon === 'default') {
82
- this.validate(value);
83
- this.updateDatavalue(value, null);
84
+ this.validate(newValue);
85
+ this.updateDatavalue(newValue, null);
84
86
  }
85
87
  });
86
88
  }
@@ -155,36 +157,55 @@ export class BaseNumberComponent extends BaseComponent {
155
157
  this.invokeEventCallback('onError', [event, this.proxy, value, oldValue]);
156
158
  return;
157
159
  }
158
- this.updateState({
159
- props: {
160
- datavalue: model || Number(value)
160
+ new Promise(resolve => {
161
+ if (props.hastwowaybinding) {
162
+ this.setProp("datavalue", value);
163
+ this.updateState({
164
+ props: {
165
+ "datavalue": value
166
+ }
167
+ });
168
+ resolve(true);
169
+ } else {
170
+ this.updateState({
171
+ props: {
172
+ datavalue: model || Number(value)
173
+ }
174
+ }, () => resolve(true));
161
175
  }
162
- }, () => {
176
+ }).then(() => {
163
177
  !this.props.onFieldChange && value !== oldValue && this.invokeEventCallback('onChange', [event, this.proxy, model, oldValue]);
164
178
  if (source === 'blur') {
165
179
  this.invokeEventCallback('onBlur', [event, this.proxy]);
166
180
  }
167
181
  });
168
182
  }
169
- onBlur(event) {
170
- let newVal = event.target.value || this.state.textValue;
183
+ onBlur(event, isDisplayValuePresent) {
184
+ const textVal = this.state.textValue || '';
185
+ let newVal = isDisplayValuePresent ? textVal : event.target.value || textVal;
171
186
  this.validate(newVal);
172
187
  if (newVal === '' || newVal == undefined) {
173
188
  setTimeout(() => {
174
189
  this.props.triggerValidation && this.props.triggerValidation();
175
190
  }, 10);
176
191
  }
177
- if (this.state.props.updateon === 'blur') {
192
+ if (this.state.props.updateon === 'blur' || this.state.props.updateon === 'default') {
178
193
  let oldVal = this.state.props.datavalue || '';
179
- if (oldVal !== newVal) {
194
+ if (oldVal !== newVal && this.state.props.updateon === 'blur') {
180
195
  this.updateDatavalue(newVal, event, 'blur');
181
196
  } else {
182
197
  this.invokeEventCallback('onBlur', [event, this.proxy]);
183
198
  }
199
+ this.setState({
200
+ isInputFocused: false
201
+ });
184
202
  }
185
203
  }
186
204
  onFocus(event) {
187
205
  this.invokeEventCallback('onFocus', [event, this.proxy]);
206
+ this.setState({
207
+ isInputFocused: true
208
+ });
188
209
  }
189
210
 
190
211
  /**
@@ -308,6 +329,11 @@ export class BaseNumberComponent extends BaseComponent {
308
329
  } else {
309
330
  this.props.onFieldChange && this.props.onFieldChange('datavalue', $new, $old, isDefault);
310
331
  }
332
+ break;
333
+ case 'displayValue':
334
+ this.updateState({
335
+ displayValue: $new
336
+ });
311
337
  }
312
338
  }
313
339
  }
@@ -1 +1 @@
1
- {"version":3,"names":["includes","intersection","isNaN","isFinite","toArray","isNil","BaseComponent","BaseComponentState","DEFAULT_CLASS","Platform","countDecimalDigits","validateField","BaseNumberState","constructor","args","_defineProperty","BaseNumberComponent","props","defaultClass","defaultProps","defaultState","DECIMAL","GROUP","onChange","event","state","updateon","updateDatavalue","target","value","focus","_this$widgetRef","widgetRef","validateOnDevice","type","_value$match","isCurrencyField","isValidText","test","Number","match","length","onChangeText","isValidTextOnDevice","decimalPlacesInNumber","decimalPlaces","updateState","textValue","validate","invokeChange","e","OS","cursor","selectionStart","setState","validationObj","isValid","errorType","handleValidation","regexp","condition","RegExp","parseNumber","val","parts","split","NaN","number","join","decimal","sum","parseFloat","toFixed","Object","is","source","model","toString","oldValue","datavalue","validNumber","isValidNumber","invokeEventCallback","proxy","onFieldChange","onBlur","newVal","undefined","setTimeout","triggerValidation","oldVal","onFocus","countDecimals","decimalValue","validateInputEntry","$event","ctrlKey","key","validity","inputValue","step","preventDefault","getValueInRange","minvalue","maxvalue","required","isInteger","resetValidations","onPropertyChange","name","$new","$old","isDefault","bind"],"sources":["basenumber.component.ts"],"sourcesContent":["import { includes, intersection, isNaN, isFinite, toArray, isNil } from 'lodash';\nimport BaseNumberProps from '@wavemaker/app-rn-runtime/components/input/basenumber/basenumber.props';\nimport { BaseComponent, BaseComponentState } from \"@wavemaker/app-rn-runtime/core/base.component\";\nimport { BaseNumberStyles } from '@wavemaker/app-rn-runtime/components/input/basenumber/basenumber.styles';\nimport { DEFAULT_CLASS } from \"@wavemaker/app-rn-runtime/components/navigation/basenav/basenav.styles\";\nimport { Platform, TextInput } from 'react-native';\nimport { countDecimalDigits, validateField } from '@wavemaker/app-rn-runtime/core/utils';\n\nexport class BaseNumberState <T extends BaseNumberProps> extends BaseComponentState<T> {\n isValid: boolean = true;\n textValue: string = '';\n isDefault = false;\n errorType = '';\n}\n\nexport abstract class BaseNumberComponent< T extends BaseNumberProps, S extends BaseNumberState<T>, L extends BaseNumberStyles> extends BaseComponent<T, S, L> {\n private DECIMAL;\n private GROUP;\n public widgetRef: TextInput | null = null;\n private cursor: any = 0;\n constructor(props: T, public defaultClass: string = DEFAULT_CLASS, defaultProps?: T, defaultState?: S) {\n super(props, defaultClass, defaultProps, defaultState);\n this.DECIMAL = '.';\n this.GROUP = ',';\n }\n\n onChange(event: any) {\n if (this.state.props.updateon === 'default') {\n this.updateDatavalue(event.target.value, event);\n }\n }\n\n focus() {\n this?.widgetRef?.focus();\n }\n\n validateOnDevice(value: string, type: 'number' | 'currency') {\n const isCurrencyField = type === 'currency';\n let isValidText = true;\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 }\n\n // * currency only: check for negative number\n if (isCurrencyField && (Number(value) < 0 || /-/g.test(value))) {\n isValidText = false;\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 }\n\n // * check for more than one decimal point\n if (/^\\d*\\.\\d*\\..*$/.test(value)) {\n isValidText = false;\n }\n\n // * check for spaces and comma\n if (/[\\s,]/.test(value)) {\n isValidText = false;\n }\n\n return isValidText;\n }\n\n onChangeText(value: string, type: 'number' | 'currency') {\n const isValidTextOnDevice = this.validateOnDevice(value, type);\n if (!isValidTextOnDevice) {\n return;\n }\n\n const decimalPlacesInNumber = countDecimalDigits(value);\n\n if (this.props.decimalPlaces < decimalPlacesInNumber) {\n return;\n }\n\n this.updateState({\n textValue: value\n } as S, () => {\n if (this.state.props.updateon === 'default') {\n this.validate(value);\n this.updateDatavalue(value, null);\n }\n }\n );\n }\n\n invokeChange(e: any) {\n if (Platform.OS === 'web') {\n this.cursor = e.target.selectionStart;\n this.setState({ textValue: e.target.value });\n }\n }\n\n validate(value: any) {\n const validationObj = validateField(this.state.props, value);\n this.updateState({\n isValid: validationObj.isValid,\n errorType: validationObj.errorType\n } as S);\n\n }\n\n handleValidation(value: any) {\n const props = this.state.props;\n if (props.regexp) {\n const condition = new RegExp(props.regexp, 'g');\n return condition.test(value);\n }\n return true;\n }\n\n /**\n * Method parses the Localized number(string) to a valid number.\n * if the string dose not result to a valid number then returns NaN.\n * @param {string} val Localized number.\n * @returns {number}\n */\n private parseNumber(val: string): any {\n // splits string into two parts. decimal and number.\n const parts = val.split(this.DECIMAL);\n if (!parts.length) {\n return;\n }\n if (parts.length > 2) {\n return NaN;\n }\n // If number have decimal point and not have a decimal value then return.\n if (parts[1] === '') {\n return NaN;\n }\n // replaces all group separators form the number.\n const number = Number(parts[0].split(this.GROUP).join(''));\n const decimal = Number(`0.${parts[1] || 0}`);\n if (Number.isNaN(number) || Number.isNaN(decimal)) {\n return NaN;\n }\n const sum = parts.length > 1 ? parseFloat((number + decimal).toFixed(parts[1].length)) : number + decimal;\n // if the number is negative then calculate the number as number - decimal\n // Ex: number = -123 and decimal = 0.45 then number - decimal = -123-045 = -123.45\n // If entered number is -0.1 to -0.9 then the number is -0 and decimal is 0.1 to 0.9. Now calaculate the number as number-decimal\n // Ex: number = -0 and decimal = 0.1 then number-decimal = -0-0.1 = -0.1\n if (number === 0) {\n return Object.is(0, number) ? sum : number - decimal;\n }\n return number > 0 ? sum : number - decimal;\n }\n\n updateDatavalue(value: any, event?: any, source?: any) {\n const model = value && this.parseNumber(value.toString());\n const props = this.state.props;\n const oldValue = props.datavalue;\n if (value === oldValue) {\n return;\n }\n const validNumber = this.isValidNumber(model) || value == oldValue + '.';\n if (!validNumber) {\n this.invokeEventCallback('onError', [ event, this.proxy, value, oldValue ]);\n return;\n }\n\n this.updateState({\n props: {\n datavalue: model || Number(value)\n }\n } as S, () => {\n !this.props.onFieldChange && value !== oldValue && this.invokeEventCallback('onChange', [event, this.proxy, model, oldValue]);\n if (source === 'blur') {\n this.invokeEventCallback('onBlur', [event, this.proxy]);\n }\n });\n }\n\n onBlur(event: any) {\n let newVal = event.target.value || this.state.textValue;\n this.validate(newVal);\n if (newVal === '' || newVal == undefined) {\n setTimeout(() => {\n this.props.triggerValidation && this.props.triggerValidation();\n },10)\n }\n if (this.state.props.updateon === 'blur') {\n let oldVal = this.state.props.datavalue || '';\n if (oldVal !== newVal) {\n this.updateDatavalue(newVal, event, 'blur');\n } else {\n this.invokeEventCallback('onBlur', [event, this.proxy]);\n }\n }\n }\n\n onFocus(event: any) {\n this.invokeEventCallback('onFocus', [ event, this.proxy]);\n }\n\n /**\n * returns the number of decimal places a number have.\n * @param value: number\n * @returns {number}\n */\n private countDecimals(value: any) {\n if (value && ((value % 1) !== 0)) {\n const decimalValue = value.toString().split('.')[1];\n return decimalValue && decimalValue.length;\n }\n return 0;\n }\n\n public validateInputEntry($event: any) {\n const props = this.state.props;\n\n // allow actions if control key is pressed or if backspace is pressed. (for Mozilla).\n if ($event.ctrlKey || includes(['Backspace', 'ArrowRight', 'ArrowLeft', 'Tab', 'Enter', 'Delete'], $event.key)) {\n return;\n }\n\n const validity = new RegExp(`^[\\\\d\\\\s-,.e+${this.GROUP}${this.DECIMAL}]$`, 'i');\n const inputValue = $event.target.value;\n // validates entering of decimal values only when user provides decimal limit(i.e step contains decimal values).\n if (inputValue && this.countDecimals(props.step) && (this.countDecimals(inputValue) >= this.countDecimals(props.step))) {\n $event.preventDefault();\n }\n // validates if user entered an invalid character.\n if (!validity.test($event.key)) {\n $event.preventDefault();\n }\n // a decimal value can be entered only once in the input.\n if (includes(inputValue, this.DECIMAL) && $event.key === this.DECIMAL) {\n $event.preventDefault();\n }\n // 'e' can be entered only once in the input.\n if (intersection(toArray(inputValue), ['e', 'E']).length && includes('eE', $event.key)) {\n $event.preventDefault();\n }\n if ((includes(inputValue, '+') || includes(inputValue, '-')) && ($event.key === '+' || $event.key === '-')) {\n $event.preventDefault();\n }\n this.invokeEventCallback('onKeypress', [ $event, this.proxy]);\n }\n\n /**\n * returns a valid number by validating the minimum and maximum values.\n * @param {number} value\n * @returns {number}\n */\n private getValueInRange(value: number): number {\n const props = this.state.props;\n if (!isNil(value) && !isNaN(props.minvalue) && value < props.minvalue) {\n this.updateState({ errorType: 'minvalue'} as S);\n return props.minvalue;\n }\n if (!isNil(value) && !isNaN(props.maxvalue) && value > props.maxvalue) {\n this.updateState({ errorType: 'maxvalue'} as S);\n return props.maxvalue;\n }\n return value;\n }\n\n /**\n * Adds validations for the number before updating the widget model. like validating min and max value for the widget.\n * @param {number} val number to be validated\n * @returns {number}\n */\n private isValidNumber(val: number): boolean {\n const props = this.state.props;\n\n //empty number widget should not show validation error when required is false\n // @ts-ignore\n if (this.state.props.required === false && val === '') {\n return true;\n }\n // id number is infinite then consider it as invalid value\n if (isNaN(val) || !isFinite(val) || (!Number.isInteger(props.step) &&\n this.countDecimals(val) > this.countDecimals(props.step))) {\n this.updateState({\n isValid: false,\n } as S);\n return false;\n }\n if (val !== this.getValueInRange(val)) {\n this.updateState({\n isValid: false,\n } as S);\n return true;\n }\n this.resetValidations();\n return true;\n }\n\n // resets all the flags related to the widget's validation.\n protected resetValidations() {\n this.updateState({\n isValid: true,\n } as S);\n }\n\n onPropertyChange(name: string, $new: any, $old: any) {\n switch (name) {\n case 'minvalue':\n case 'maxvalue':\n if ($new|| $old) {\n this.isValidNumber($new);\n }\n break;\n case 'datavalue':\n this.updateState({\n textValue: $new,\n } as S);\n const isDefault = this.state.isDefault;\n if (isDefault) {\n this.updateState({ isDefault: false } as S, this.props.onFieldChange && this.props.onFieldChange.bind(this, 'datavalue', $new, $old, isDefault));\n } else {\n this.props.onFieldChange && this.props.onFieldChange('datavalue', $new, $old, isDefault);\n }\n }\n }\n}\n"],"mappings":";;;AAAA,SAASA,QAAQ,EAAEC,YAAY,EAAEC,KAAK,EAAEC,QAAQ,EAAEC,OAAO,EAAEC,KAAK,QAAQ,QAAQ;AAEhF,SAASC,aAAa,EAAEC,kBAAkB,QAAQ,+CAA+C;AAEjG,SAASC,aAAa,QAAQ,wEAAwE;AACtG,SAASC,QAAQ,QAAmB,cAAc;AAClD,SAASC,kBAAkB,EAAEC,aAAa,QAAQ,sCAAsC;AAExF,OAAO,MAAMC,eAAe,SAAqCL,kBAAkB,CAAI;EAAAM,YAAA,GAAAC,IAAA;IAAA,SAAAA,IAAA;IAAAC,eAAA,kBAClE,IAAI;IAAAA,eAAA,oBACH,EAAE;IAAAA,eAAA,oBACV,KAAK;IAAAA,eAAA,oBACL,EAAE;EAAA;AAChB;AAEA,OAAO,MAAeC,mBAAmB,SAA+FV,aAAa,CAAU;EAK7JO,WAAWA,CAACI,KAAQ,EAASC,YAAoB,GAAGV,aAAa,EAAEW,YAAgB,EAAEC,YAAgB,EAAE;IACrG,KAAK,CAACH,KAAK,EAAEC,YAAY,EAAEC,YAAY,EAAEC,YAAY,CAAC;IAAC,KAD5BF,YAAoB,GAApBA,YAAoB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CAACuF,SAAS;QACtC,IAAIA,SAAS,EAAE;UACb,IAAI,CAAClE,WAAW,CAAC;YAAEkE,SAAS,EAAE;UAAM,CAAC,EAAO,IAAI,CAAC/F,KAAK,CAACmE,aAAa,IAAI,IAAI,CAACnE,KAAK,CAACmE,aAAa,CAAC6B,IAAI,CAAC,IAAI,EAAE,WAAW,EAAEH,IAAI,EAAEC,IAAI,EAAEC,SAAS,CAAC,CAAC;QAClJ,CAAC,MAAM;UACL,IAAI,CAAC/F,KAAK,CAACmE,aAAa,IAAI,IAAI,CAACnE,KAAK,CAACmE,aAAa,CAAC,WAAW,EAAE0B,IAAI,EAAEC,IAAI,EAAEC,SAAS,CAAC;QAC1F;IACJ;EACF;AACF","ignoreList":[]}
1
+ {"version":3,"names":["includes","intersection","isNaN","isFinite","toArray","isNil","BaseComponent","BaseComponentState","DEFAULT_CLASS","Platform","countDecimalDigits","validateField","BaseNumberState","constructor","args","_defineProperty","BaseNumberComponent","props","defaultClass","defaultProps","defaultState","DECIMAL","GROUP","onChange","event","state","updateon","updateDatavalue","target","value","focus","_this$widgetRef","widgetRef","validateOnDevice","type","_value$match","isCurrencyField","isValidText","test","Number","match","length","onChangeText","shouldFormateToNumber","newValue","parseNumber","replace","isValidTextOnDevice","decimalPlacesInNumber","decimalPlaces","updateState","textValue","validate","invokeChange","e","OS","cursor","selectionStart","setState","validationObj","isValid","errorType","handleValidation","regexp","condition","RegExp","val","parts","split","NaN","number","join","decimal","sum","parseFloat","toFixed","Object","is","source","model","toString","oldValue","datavalue","validNumber","isValidNumber","invokeEventCallback","proxy","Promise","resolve","hastwowaybinding","setProp","then","onFieldChange","onBlur","isDisplayValuePresent","textVal","newVal","undefined","setTimeout","triggerValidation","oldVal","isInputFocused","onFocus","countDecimals","decimalValue","validateInputEntry","$event","ctrlKey","key","validity","inputValue","step","preventDefault","getValueInRange","minvalue","maxvalue","required","isInteger","resetValidations","onPropertyChange","name","$new","$old","isDefault","bind","displayValue"],"sources":["basenumber.component.ts"],"sourcesContent":["import { includes, intersection, isNaN, isFinite, toArray, isNil } from 'lodash';\nimport BaseNumberProps from '@wavemaker/app-rn-runtime/components/input/basenumber/basenumber.props';\nimport { BaseComponent, BaseComponentState } from \"@wavemaker/app-rn-runtime/core/base.component\";\nimport { BaseNumberStyles } from '@wavemaker/app-rn-runtime/components/input/basenumber/basenumber.styles';\nimport { DEFAULT_CLASS } from \"@wavemaker/app-rn-runtime/components/navigation/basenav/basenav.styles\";\nimport { Platform, TextInput } from 'react-native';\nimport { countDecimalDigits, validateField } from '@wavemaker/app-rn-runtime/core/utils';\n\nexport class BaseNumberState <T extends BaseNumberProps> extends BaseComponentState<T> {\n isValid: boolean = true;\n isInputFocused: boolean = false;\n textValue: string = '';\n isDefault = false;\n errorType = '';\n}\n\nexport abstract class BaseNumberComponent< T extends BaseNumberProps, S extends BaseNumberState<T>, L extends BaseNumberStyles> extends BaseComponent<T, S, L> {\n private DECIMAL;\n private GROUP;\n public widgetRef: TextInput | null = null;\n private cursor: any = 0;\n constructor(props: T, public defaultClass: string = DEFAULT_CLASS, defaultProps?: T, defaultState?: S) {\n super(props, defaultClass, defaultProps, defaultState);\n this.DECIMAL = '.';\n this.GROUP = ',';\n }\n\n onChange(event: any) {\n if (this.state.props.updateon === 'default') {\n this.updateDatavalue(event.target.value, event);\n }\n }\n\n focus() {\n this?.widgetRef?.focus();\n }\n\n validateOnDevice(value: string, type: 'number' | 'currency') {\n const isCurrencyField = type === 'currency';\n let isValidText = true;\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 }\n\n // * currency only: check for negative number\n if (isCurrencyField && (Number(value) < 0 || /-/g.test(value))) {\n isValidText = false;\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 }\n\n // * check for more than one decimal point\n if (/^\\d*\\.\\d*\\..*$/.test(value)) {\n isValidText = false;\n }\n\n // * check for spaces and comma\n if (/[\\s,]/.test(value)) {\n isValidText = false;\n }\n\n return isValidText;\n }\n\n onChangeText(value: string, type: 'number' | 'currency', shouldFormateToNumber?: boolean) {\n const newValue = shouldFormateToNumber ? `${this.parseNumber(value.replace(/[^0-9.]/g, ''))}` : value;\n const isValidTextOnDevice = this.validateOnDevice(newValue, type);\n if (!isValidTextOnDevice) {\n return;\n }\n\n const decimalPlacesInNumber = countDecimalDigits(newValue);\n\n if (this.props.decimalPlaces < decimalPlacesInNumber) {\n return;\n }\n\n this.updateState({\n textValue: newValue\n } as S, () => {\n if (this.state.props.updateon === 'default') {\n this.validate(newValue);\n this.updateDatavalue(newValue, null);\n }\n }\n );\n }\n\n invokeChange(e: any) {\n if (Platform.OS === 'web') {\n this.cursor = e.target.selectionStart;\n this.setState({ textValue: e.target.value });\n }\n }\n\n validate(value: any) {\n const validationObj = validateField(this.state.props, value);\n this.updateState({\n isValid: validationObj.isValid,\n errorType: validationObj.errorType\n } as S);\n\n }\n\n handleValidation(value: any) {\n const props = this.state.props;\n if (props.regexp) {\n const condition = new RegExp(props.regexp, 'g');\n return condition.test(value);\n }\n return true;\n }\n\n /**\n * Method parses the Localized number(string) to a valid number.\n * if the string dose not result to a valid number then returns NaN.\n * @param {string} val Localized number.\n * @returns {number}\n */\n private parseNumber(val: string): any {\n // splits string into two parts. decimal and number.\n const parts = val.split(this.DECIMAL);\n if (!parts.length) {\n return;\n }\n if (parts.length > 2) {\n return NaN;\n }\n // If number have decimal point and not have a decimal value then return.\n if (parts[1] === '') {\n return NaN;\n }\n // replaces all group separators form the number.\n const number = Number(parts[0].split(this.GROUP).join(''));\n const decimal = Number(`0.${parts[1] || 0}`);\n if (Number.isNaN(number) || Number.isNaN(decimal)) {\n return NaN;\n }\n const sum = parts.length > 1 ? parseFloat((number + decimal).toFixed(parts[1].length)) : number + decimal;\n // if the number is negative then calculate the number as number - decimal\n // Ex: number = -123 and decimal = 0.45 then number - decimal = -123-045 = -123.45\n // If entered number is -0.1 to -0.9 then the number is -0 and decimal is 0.1 to 0.9. Now calaculate the number as number-decimal\n // Ex: number = -0 and decimal = 0.1 then number-decimal = -0-0.1 = -0.1\n if (number === 0) {\n return Object.is(0, number) ? sum : number - decimal;\n }\n return number > 0 ? sum : number - decimal;\n }\n\n updateDatavalue(value: any, event?: any, source?: any) {\n const model = value && this.parseNumber(value.toString());\n const props = this.state.props;\n const oldValue = props.datavalue;\n if (value === oldValue) {\n return;\n }\n const validNumber = this.isValidNumber(model) || value == oldValue + '.';\n if (!validNumber) {\n this.invokeEventCallback('onError', [ event, this.proxy, value, oldValue ]);\n return;\n }\n\n new Promise((resolve) => {\n if (props.hastwowaybinding) {\n this.setProp(\"datavalue\", value);\n this.updateState({props: { \"datavalue\": value }} as S);\n resolve(true);\n } else {\n this.updateState({\n props: {\n datavalue: model || Number(value)\n }\n } as S, () => resolve(true));\n }\n }).then(() => {\n !this.props.onFieldChange && value !== oldValue && this.invokeEventCallback('onChange', [event, this.proxy, model, oldValue]);\n if (source === 'blur') {\n this.invokeEventCallback('onBlur', [event, this.proxy]);\n }\n });\n }\n\n onBlur(event: any, isDisplayValuePresent?: boolean) {\n const textVal = this.state.textValue || '';\n let newVal = isDisplayValuePresent ? textVal : event.target.value || textVal;\n this.validate(newVal);\n if (newVal === '' || newVal == undefined) {\n setTimeout(() => {\n this.props.triggerValidation && this.props.triggerValidation();\n },10)\n }\n if (this.state.props.updateon === 'blur' || this.state.props.updateon === 'default') {\n let oldVal = this.state.props.datavalue || '';\n if (oldVal !== newVal && this.state.props.updateon === 'blur') {\n this.updateDatavalue(newVal, event, 'blur');\n } else {\n this.invokeEventCallback('onBlur', [event, this.proxy]);\n }\n this.setState({ isInputFocused: false});\n }\n }\n\n onFocus(event: any) {\n this.invokeEventCallback('onFocus', [ event, this.proxy]);\n this.setState({ isInputFocused: true});\n }\n\n /**\n * returns the number of decimal places a number have.\n * @param value: number\n * @returns {number}\n */\n private countDecimals(value: any) {\n if (value && ((value % 1) !== 0)) {\n const decimalValue = value.toString().split('.')[1];\n return decimalValue && decimalValue.length;\n }\n return 0;\n }\n\n public validateInputEntry($event: any) {\n const props = this.state.props;\n\n // allow actions if control key is pressed or if backspace is pressed. (for Mozilla).\n if ($event.ctrlKey || includes(['Backspace', 'ArrowRight', 'ArrowLeft', 'Tab', 'Enter', 'Delete'], $event.key)) {\n return;\n }\n\n const validity = new RegExp(`^[\\\\d\\\\s-,.e+${this.GROUP}${this.DECIMAL}]$`, 'i');\n const inputValue = $event.target.value;\n // validates entering of decimal values only when user provides decimal limit(i.e step contains decimal values).\n if (inputValue && this.countDecimals(props.step) && (this.countDecimals(inputValue) >= this.countDecimals(props.step))) {\n $event.preventDefault();\n }\n // validates if user entered an invalid character.\n if (!validity.test($event.key)) {\n $event.preventDefault();\n }\n // a decimal value can be entered only once in the input.\n if (includes(inputValue, this.DECIMAL) && $event.key === this.DECIMAL) {\n $event.preventDefault();\n }\n // 'e' can be entered only once in the input.\n if (intersection(toArray(inputValue), ['e', 'E']).length && includes('eE', $event.key)) {\n $event.preventDefault();\n }\n if ((includes(inputValue, '+') || includes(inputValue, '-')) && ($event.key === '+' || $event.key === '-')) {\n $event.preventDefault();\n }\n this.invokeEventCallback('onKeypress', [ $event, this.proxy]);\n }\n\n /**\n * returns a valid number by validating the minimum and maximum values.\n * @param {number} value\n * @returns {number}\n */\n private getValueInRange(value: number): number {\n const props = this.state.props;\n if (!isNil(value) && !isNaN(props.minvalue) && value < props.minvalue) {\n this.updateState({ errorType: 'minvalue'} as S);\n return props.minvalue;\n }\n if (!isNil(value) && !isNaN(props.maxvalue) && value > props.maxvalue) {\n this.updateState({ errorType: 'maxvalue'} as S);\n return props.maxvalue;\n }\n return value;\n }\n\n /**\n * Adds validations for the number before updating the widget model. like validating min and max value for the widget.\n * @param {number} val number to be validated\n * @returns {number}\n */\n private isValidNumber(val: number): boolean {\n const props = this.state.props;\n\n //empty number widget should not show validation error when required is false\n // @ts-ignore\n if (this.state.props.required === false && val === '') {\n return true;\n }\n // id number is infinite then consider it as invalid value\n if (isNaN(val) || !isFinite(val) || (!Number.isInteger(props.step) &&\n this.countDecimals(val) > this.countDecimals(props.step))) {\n this.updateState({\n isValid: false,\n } as S);\n return false;\n }\n if (val !== this.getValueInRange(val)) {\n this.updateState({\n isValid: false,\n } as S);\n return true;\n }\n this.resetValidations();\n return true;\n }\n\n // resets all the flags related to the widget's validation.\n protected resetValidations() {\n this.updateState({\n isValid: true,\n } as S);\n }\n\n onPropertyChange(name: string, $new: any, $old: any) {\n switch (name) {\n case 'minvalue':\n case 'maxvalue':\n if ($new|| $old) {\n this.isValidNumber($new);\n }\n break;\n case 'datavalue':\n this.updateState({\n textValue: $new,\n } as S);\n const isDefault = this.state.isDefault;\n if (isDefault) {\n this.updateState({ isDefault: false } as S, this.props.onFieldChange && this.props.onFieldChange.bind(this, 'datavalue', $new, $old, isDefault));\n } else {\n this.props.onFieldChange && this.props.onFieldChange('datavalue', $new, $old, isDefault);\n }\n break;\n case 'displayValue': \n this.updateState({\n displayValue: $new,\n } as any)\n }\n }\n}\n"],"mappings":";;;AAAA,SAASA,QAAQ,EAAEC,YAAY,EAAEC,KAAK,EAAEC,QAAQ,EAAEC,OAAO,EAAEC,KAAK,QAAQ,QAAQ;AAEhF,SAASC,aAAa,EAAEC,kBAAkB,QAAQ,+CAA+C;AAEjG,SAASC,aAAa,QAAQ,wEAAwE;AACtG,SAASC,QAAQ,QAAmB,cAAc;AAClD,SAASC,kBAAkB,EAAEC,aAAa,QAAQ,sCAAsC;AAExF,OAAO,MAAMC,eAAe,SAAqCL,kBAAkB,CAAI;EAAAM,YAAA,GAAAC,IAAA;IAAA,SAAAA,IAAA;IAAAC,eAAA,kBAClE,IAAI;IAAAA,eAAA,yBACG,KAAK;IAAAA,eAAA,oBACX,EAAE;IAAAA,eAAA,oBACV,KAAK;IAAAA,eAAA,oBACL,EAAE;EAAA;AAChB;AAEA,O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