@wavemaker/app-rn-runtime 11.6.0-rc.5488 → 11.7.0-next.42251

Sign up to get free protection for your applications and to get access to all the features.
Files changed (304) hide show
  1. app-rn-runtime/components/advanced/carousel/carousel.component.js +14 -9
  2. app-rn-runtime/components/advanced/carousel/carousel.component.js.map +1 -1
  3. app-rn-runtime/components/advanced/carousel/carousel.styles.js +6 -3
  4. app-rn-runtime/components/advanced/carousel/carousel.styles.js.map +1 -1
  5. app-rn-runtime/components/advanced/webview/webview.component.js +33 -14
  6. app-rn-runtime/components/advanced/webview/webview.component.js.map +1 -1
  7. app-rn-runtime/components/advanced/webview/webview.props.js +3 -1
  8. app-rn-runtime/components/advanced/webview/webview.props.js.map +1 -1
  9. app-rn-runtime/components/basic/anchor/anchor.component.js +22 -8
  10. app-rn-runtime/components/basic/anchor/anchor.component.js.map +1 -1
  11. app-rn-runtime/components/basic/anchor/anchor.props.js +7 -0
  12. app-rn-runtime/components/basic/anchor/anchor.props.js.map +1 -1
  13. app-rn-runtime/components/basic/anchor/anchor.styles.js +3 -1
  14. app-rn-runtime/components/basic/anchor/anchor.styles.js.map +1 -1
  15. app-rn-runtime/components/basic/animatedview.component.js +5 -3
  16. app-rn-runtime/components/basic/animatedview.component.js.map +1 -1
  17. app-rn-runtime/components/basic/button/button.component.js +41 -8
  18. app-rn-runtime/components/basic/button/button.component.js.map +1 -1
  19. app-rn-runtime/components/basic/button/button.props.js +7 -0
  20. app-rn-runtime/components/basic/button/button.props.js.map +1 -1
  21. app-rn-runtime/components/basic/button/button.styles.js +9 -10
  22. app-rn-runtime/components/basic/button/button.styles.js.map +1 -1
  23. app-rn-runtime/components/basic/buttongroup/buttongroup.styles.js +13 -5
  24. app-rn-runtime/components/basic/buttongroup/buttongroup.styles.js.map +1 -1
  25. app-rn-runtime/components/basic/icon/icon.component.js +64 -12
  26. app-rn-runtime/components/basic/icon/icon.component.js.map +1 -1
  27. app-rn-runtime/components/basic/icon/icon.props.js +7 -0
  28. app-rn-runtime/components/basic/icon/icon.props.js.map +1 -1
  29. app-rn-runtime/components/basic/icon/icon.styles.js +2 -1
  30. app-rn-runtime/components/basic/icon/icon.styles.js.map +1 -1
  31. app-rn-runtime/components/basic/label/label.component.js +34 -25
  32. app-rn-runtime/components/basic/label/label.component.js.map +1 -1
  33. app-rn-runtime/components/basic/label/label.props.js +4 -0
  34. app-rn-runtime/components/basic/label/label.props.js.map +1 -1
  35. app-rn-runtime/components/basic/label/label.styles.js +4 -5
  36. app-rn-runtime/components/basic/label/label.styles.js.map +1 -1
  37. app-rn-runtime/components/basic/message/message.component.js +3 -2
  38. app-rn-runtime/components/basic/message/message.component.js.map +1 -1
  39. app-rn-runtime/components/basic/message/message.props.js +3 -0
  40. app-rn-runtime/components/basic/message/message.props.js.map +1 -1
  41. app-rn-runtime/components/basic/message/message.styles.js +3 -1
  42. app-rn-runtime/components/basic/message/message.styles.js.map +1 -1
  43. app-rn-runtime/components/basic/picture/picture.component.js +4 -2
  44. app-rn-runtime/components/basic/picture/picture.component.js.map +1 -1
  45. app-rn-runtime/components/basic/picture/picture.props.js +3 -0
  46. app-rn-runtime/components/basic/picture/picture.props.js.map +1 -1
  47. app-rn-runtime/components/basic/picture/picture.styles.js +3 -1
  48. app-rn-runtime/components/basic/picture/picture.styles.js.map +1 -1
  49. app-rn-runtime/components/basic/progress-bar/progress-bar.component.js +3 -3
  50. app-rn-runtime/components/basic/progress-bar/progress-bar.component.js.map +1 -1
  51. app-rn-runtime/components/basic/progress-bar/progress-bar.props.js +2 -0
  52. app-rn-runtime/components/basic/progress-bar/progress-bar.props.js.map +1 -1
  53. app-rn-runtime/components/basic/progress-circle/progress-circle.component.js +3 -2
  54. app-rn-runtime/components/basic/progress-circle/progress-circle.component.js.map +1 -1
  55. app-rn-runtime/components/basic/progress-circle/progress-circle.props.js +2 -0
  56. app-rn-runtime/components/basic/progress-circle/progress-circle.props.js.map +1 -1
  57. app-rn-runtime/components/basic/search/search.component.js +2 -1
  58. app-rn-runtime/components/basic/search/search.component.js.map +1 -1
  59. app-rn-runtime/components/basic/search/search.props.js +3 -0
  60. app-rn-runtime/components/basic/search/search.props.js.map +1 -1
  61. app-rn-runtime/components/basic/search/search.styles.js +6 -5
  62. app-rn-runtime/components/basic/search/search.styles.js.map +1 -1
  63. app-rn-runtime/components/basic/skeleton/skeleton.component.js +0 -1
  64. app-rn-runtime/components/basic/skeleton/skeleton.component.js.map +1 -1
  65. app-rn-runtime/components/basic/video/video.component.js +4 -2
  66. app-rn-runtime/components/basic/video/video.component.js.map +1 -1
  67. app-rn-runtime/components/basic/video/video.props.js +3 -0
  68. app-rn-runtime/components/basic/video/video.props.js.map +1 -1
  69. app-rn-runtime/components/chart/area-chart/area-chart.component.js +34 -24
  70. app-rn-runtime/components/chart/area-chart/area-chart.component.js.map +1 -1
  71. app-rn-runtime/components/chart/bar-chart/bar-chart.component.js +29 -16
  72. app-rn-runtime/components/chart/bar-chart/bar-chart.component.js.map +1 -1
  73. app-rn-runtime/components/chart/bar-chart/bar-chart.props.js +0 -2
  74. app-rn-runtime/components/chart/bar-chart/bar-chart.props.js.map +1 -1
  75. app-rn-runtime/components/chart/basechart.component.js +33 -7
  76. app-rn-runtime/components/chart/basechart.component.js.map +1 -1
  77. app-rn-runtime/components/chart/basechart.props.js +7 -2
  78. app-rn-runtime/components/chart/basechart.props.js.map +1 -1
  79. app-rn-runtime/components/chart/basechart.styles.js +9 -2
  80. app-rn-runtime/components/chart/basechart.styles.js.map +1 -1
  81. app-rn-runtime/components/chart/bubble-chart/bubble-chart.component.js +4 -2
  82. app-rn-runtime/components/chart/bubble-chart/bubble-chart.component.js.map +1 -1
  83. app-rn-runtime/components/chart/line-chart/line-chart.component.js +27 -20
  84. app-rn-runtime/components/chart/line-chart/line-chart.component.js.map +1 -1
  85. app-rn-runtime/components/chart/line-chart/line-chart.props.js.map +1 -1
  86. app-rn-runtime/components/chart/pie-chart/pie-chart.component.js +7 -4
  87. app-rn-runtime/components/chart/pie-chart/pie-chart.component.js.map +1 -1
  88. app-rn-runtime/components/chart/stack-chart/stack-chart.component.js +33 -10
  89. app-rn-runtime/components/chart/stack-chart/stack-chart.component.js.map +1 -1
  90. app-rn-runtime/components/chart/stack-chart/stack-chart.props.js +1 -0
  91. app-rn-runtime/components/chart/stack-chart/stack-chart.props.js.map +1 -1
  92. app-rn-runtime/components/chart/staticdata.js +215 -0
  93. app-rn-runtime/components/chart/staticdata.js.map +1 -0
  94. app-rn-runtime/components/container/container.component.js +11 -2
  95. app-rn-runtime/components/container/container.component.js.map +1 -1
  96. app-rn-runtime/components/container/container.props.js +1 -0
  97. app-rn-runtime/components/container/container.props.js.map +1 -1
  98. app-rn-runtime/components/container/panel/panel.component.js +6 -2
  99. app-rn-runtime/components/container/panel/panel.component.js.map +1 -1
  100. app-rn-runtime/components/container/panel/panel.props.js +4 -0
  101. app-rn-runtime/components/container/panel/panel.props.js.map +1 -1
  102. app-rn-runtime/components/container/tabs/tabheader/tabheader.styles.js +1 -1
  103. app-rn-runtime/components/container/tabs/tabheader/tabheader.styles.js.map +1 -1
  104. app-rn-runtime/components/container/wizard/wizard.component.js +17 -14
  105. app-rn-runtime/components/container/wizard/wizard.component.js.map +1 -1
  106. app-rn-runtime/components/container/wizard/wizard.styles.js +19 -3
  107. app-rn-runtime/components/container/wizard/wizard.styles.js.map +1 -1
  108. app-rn-runtime/components/container/wizard/wizardstep/wizardstep.component.js +27 -2
  109. app-rn-runtime/components/container/wizard/wizardstep/wizardstep.component.js.map +1 -1
  110. app-rn-runtime/components/container/wizard/wizardstep/wizardstep.props.js +6 -0
  111. app-rn-runtime/components/container/wizard/wizardstep/wizardstep.props.js.map +1 -1
  112. app-rn-runtime/components/data/card/card.component.js +7 -3
  113. app-rn-runtime/components/data/card/card.component.js.map +1 -1
  114. app-rn-runtime/components/data/card/card.props.js +4 -0
  115. app-rn-runtime/components/data/card/card.props.js.map +1 -1
  116. app-rn-runtime/components/data/form/form-action/form-action.styles.js +2 -1
  117. app-rn-runtime/components/data/form/form-action/form-action.styles.js.map +1 -1
  118. app-rn-runtime/components/data/form/form-field/form-field.component.js +5 -1
  119. app-rn-runtime/components/data/form/form-field/form-field.component.js.map +1 -1
  120. app-rn-runtime/components/data/list/list.component.js +136 -25
  121. app-rn-runtime/components/data/list/list.component.js.map +1 -1
  122. app-rn-runtime/components/data/list/list.props.js +4 -1
  123. app-rn-runtime/components/data/list/list.props.js.map +1 -1
  124. app-rn-runtime/components/data/list/list.styles.js +9 -0
  125. app-rn-runtime/components/data/list/list.styles.js.map +1 -1
  126. app-rn-runtime/components/device/barcodescanner/barcodescanner.component.js +4 -1
  127. app-rn-runtime/components/device/barcodescanner/barcodescanner.component.js.map +1 -1
  128. app-rn-runtime/components/device/barcodescanner/barcodescanner.props.js +3 -0
  129. app-rn-runtime/components/device/barcodescanner/barcodescanner.props.js.map +1 -1
  130. app-rn-runtime/components/device/barcodescanner/barcodescanner.styles.js +13 -6
  131. app-rn-runtime/components/device/barcodescanner/barcodescanner.styles.js.map +1 -1
  132. app-rn-runtime/components/device/camera/camera.component.js +4 -1
  133. app-rn-runtime/components/device/camera/camera.component.js.map +1 -1
  134. app-rn-runtime/components/device/camera/camera.props.js +3 -0
  135. app-rn-runtime/components/device/camera/camera.props.js.map +1 -1
  136. app-rn-runtime/components/device/camera/camera.styles.js +12 -4
  137. app-rn-runtime/components/device/camera/camera.styles.js.map +1 -1
  138. app-rn-runtime/components/dialogs/alertdialog/alertdialog.component.js +4 -0
  139. app-rn-runtime/components/dialogs/alertdialog/alertdialog.component.js.map +1 -1
  140. app-rn-runtime/components/dialogs/alertdialog/alertdialog.props.js +4 -0
  141. app-rn-runtime/components/dialogs/alertdialog/alertdialog.props.js.map +1 -1
  142. app-rn-runtime/components/dialogs/alertdialog/alertdialog.styles.js +2 -1
  143. app-rn-runtime/components/dialogs/alertdialog/alertdialog.styles.js.map +1 -1
  144. app-rn-runtime/components/dialogs/confirmdialog/confirmdialog.component.js +4 -0
  145. app-rn-runtime/components/dialogs/confirmdialog/confirmdialog.component.js.map +1 -1
  146. app-rn-runtime/components/dialogs/confirmdialog/confirmdialog.props.js +4 -0
  147. app-rn-runtime/components/dialogs/confirmdialog/confirmdialog.props.js.map +1 -1
  148. app-rn-runtime/components/dialogs/dialog/dialog.component.js +7 -3
  149. app-rn-runtime/components/dialogs/dialog/dialog.component.js.map +1 -1
  150. app-rn-runtime/components/dialogs/dialog/dialog.props.js +4 -0
  151. app-rn-runtime/components/dialogs/dialog/dialog.props.js.map +1 -1
  152. app-rn-runtime/components/dialogs/dialog/dialog.styles.js +11 -2
  153. app-rn-runtime/components/dialogs/dialog/dialog.styles.js.map +1 -1
  154. app-rn-runtime/components/input/basedataset/basedataset.props.js +4 -0
  155. app-rn-runtime/components/input/basedataset/basedataset.props.js.map +1 -1
  156. app-rn-runtime/components/input/baseinput/baseinput.component.js +2 -2
  157. app-rn-runtime/components/input/baseinput/baseinput.component.js.map +1 -1
  158. app-rn-runtime/components/input/baseinput/baseinput.props.js +4 -0
  159. app-rn-runtime/components/input/baseinput/baseinput.props.js.map +1 -1
  160. app-rn-runtime/components/input/basenumber/basenumber.component.js +16 -10
  161. app-rn-runtime/components/input/basenumber/basenumber.component.js.map +1 -1
  162. app-rn-runtime/components/input/basenumber/basenumber.props.js +4 -0
  163. app-rn-runtime/components/input/basenumber/basenumber.props.js.map +1 -1
  164. app-rn-runtime/components/input/checkbox/checkbox.component.js +12 -5
  165. app-rn-runtime/components/input/checkbox/checkbox.component.js.map +1 -1
  166. app-rn-runtime/components/input/checkbox/checkbox.styles.js +35 -5
  167. app-rn-runtime/components/input/checkbox/checkbox.styles.js.map +1 -1
  168. app-rn-runtime/components/input/checkboxset/checkboxset.component.js +13 -6
  169. app-rn-runtime/components/input/checkboxset/checkboxset.component.js.map +1 -1
  170. app-rn-runtime/components/input/checkboxset/checkboxset.styles.js +39 -10
  171. app-rn-runtime/components/input/checkboxset/checkboxset.styles.js.map +1 -1
  172. app-rn-runtime/components/input/chips/chips.component.js +5 -1
  173. app-rn-runtime/components/input/chips/chips.component.js.map +1 -1
  174. app-rn-runtime/components/input/composite/composite.component.js +1 -1
  175. app-rn-runtime/components/input/composite/composite.component.js.map +1 -1
  176. app-rn-runtime/components/input/composite/composite.props.js +1 -1
  177. app-rn-runtime/components/input/composite/composite.props.js.map +1 -1
  178. app-rn-runtime/components/input/currency/currency.component.js +18 -3
  179. app-rn-runtime/components/input/currency/currency.component.js.map +1 -1
  180. app-rn-runtime/components/input/currency/currency.props.js +1 -0
  181. app-rn-runtime/components/input/currency/currency.props.js.map +1 -1
  182. app-rn-runtime/components/input/currency/currency.styles.js +19 -1
  183. app-rn-runtime/components/input/currency/currency.styles.js.map +1 -1
  184. app-rn-runtime/components/input/epoch/base-datetime.component.js +76 -10
  185. app-rn-runtime/components/input/epoch/base-datetime.component.js.map +1 -1
  186. app-rn-runtime/components/input/epoch/date/date.component.js +8 -0
  187. app-rn-runtime/components/input/epoch/date/date.component.js.map +1 -1
  188. app-rn-runtime/components/input/epoch/date/date.styles.js +16 -0
  189. app-rn-runtime/components/input/epoch/date/date.styles.js.map +1 -1
  190. app-rn-runtime/components/input/epoch/datetime/datetime.component.js +8 -0
  191. app-rn-runtime/components/input/epoch/datetime/datetime.component.js.map +1 -1
  192. app-rn-runtime/components/input/epoch/datetime/datetime.props.js +5 -0
  193. app-rn-runtime/components/input/epoch/datetime/datetime.props.js.map +1 -1
  194. app-rn-runtime/components/input/epoch/datetime/datetime.styles.js +49 -1
  195. app-rn-runtime/components/input/epoch/datetime/datetime.styles.js.map +1 -1
  196. app-rn-runtime/components/input/epoch/time/time.component.js +8 -0
  197. app-rn-runtime/components/input/epoch/time/time.component.js.map +1 -1
  198. app-rn-runtime/components/input/epoch/time/time.styles.js +16 -0
  199. app-rn-runtime/components/input/epoch/time/time.styles.js.map +1 -1
  200. app-rn-runtime/components/input/fileupload/fileupload.component.js +2 -0
  201. app-rn-runtime/components/input/fileupload/fileupload.component.js.map +1 -1
  202. app-rn-runtime/components/input/fileupload/fileupload.props.js +2 -0
  203. app-rn-runtime/components/input/fileupload/fileupload.props.js.map +1 -1
  204. app-rn-runtime/components/input/fileupload/fileupload.styles.js +1 -1
  205. app-rn-runtime/components/input/fileupload/fileupload.styles.js.map +1 -1
  206. app-rn-runtime/components/input/number/number.component.js +13 -2
  207. app-rn-runtime/components/input/number/number.component.js.map +1 -1
  208. app-rn-runtime/components/input/number/number.props.js +1 -0
  209. app-rn-runtime/components/input/number/number.props.js.map +1 -1
  210. app-rn-runtime/components/input/number/number.styles.js +17 -0
  211. app-rn-runtime/components/input/number/number.styles.js.map +1 -1
  212. app-rn-runtime/components/input/radioset/radioset.component.js +7 -2
  213. app-rn-runtime/components/input/radioset/radioset.component.js.map +1 -1
  214. app-rn-runtime/components/input/select/select.component.js +7 -3
  215. app-rn-runtime/components/input/select/select.component.js.map +1 -1
  216. app-rn-runtime/components/input/select/select.styles.js +5 -1
  217. app-rn-runtime/components/input/select/select.styles.js.map +1 -1
  218. app-rn-runtime/components/input/slider/slider.styles.js +3 -3
  219. app-rn-runtime/components/input/slider/slider.styles.js.map +1 -1
  220. app-rn-runtime/components/input/switch/switch.component.js +8 -1
  221. app-rn-runtime/components/input/switch/switch.component.js.map +1 -1
  222. app-rn-runtime/components/input/switch/switch.styles.js +10 -5
  223. app-rn-runtime/components/input/switch/switch.styles.js.map +1 -1
  224. app-rn-runtime/components/input/text/text.component.js +13 -1
  225. app-rn-runtime/components/input/text/text.component.js.map +1 -1
  226. app-rn-runtime/components/input/text/text.props.js +1 -0
  227. app-rn-runtime/components/input/text/text.props.js.map +1 -1
  228. app-rn-runtime/components/input/text/text.styles.js +17 -0
  229. app-rn-runtime/components/input/text/text.styles.js.map +1 -1
  230. app-rn-runtime/components/input/textarea/textarea.component.js +13 -1
  231. app-rn-runtime/components/input/textarea/textarea.component.js.map +1 -1
  232. app-rn-runtime/components/input/textarea/textarea.props.js +1 -0
  233. app-rn-runtime/components/input/textarea/textarea.props.js.map +1 -1
  234. app-rn-runtime/components/input/textarea/textarea.styles.js +17 -0
  235. app-rn-runtime/components/input/textarea/textarea.styles.js.map +1 -1
  236. app-rn-runtime/components/input/toggle/toggle.component.js +48 -5
  237. app-rn-runtime/components/input/toggle/toggle.component.js.map +1 -1
  238. app-rn-runtime/components/input/toggle/toggle.props.js +4 -0
  239. app-rn-runtime/components/input/toggle/toggle.props.js.map +1 -1
  240. app-rn-runtime/components/input/toggle/toggle.styles.js +5 -12
  241. app-rn-runtime/components/input/toggle/toggle.styles.js.map +1 -1
  242. app-rn-runtime/components/navigation/appnavbar/appnavbar.component.js +6 -1
  243. app-rn-runtime/components/navigation/appnavbar/appnavbar.component.js.map +1 -1
  244. app-rn-runtime/components/navigation/appnavbar/appnavbar.props.js +1 -0
  245. app-rn-runtime/components/navigation/appnavbar/appnavbar.props.js.map +1 -1
  246. app-rn-runtime/components/navigation/appnavbar/appnavbar.styles.js +11 -2
  247. app-rn-runtime/components/navigation/appnavbar/appnavbar.styles.js.map +1 -1
  248. app-rn-runtime/components/navigation/basenav/basenav.component.js +1 -2
  249. app-rn-runtime/components/navigation/basenav/basenav.component.js.map +1 -1
  250. app-rn-runtime/components/navigation/menu/menu.styles.js +8 -5
  251. app-rn-runtime/components/navigation/menu/menu.styles.js.map +1 -1
  252. app-rn-runtime/components/navigation/navitem/navitem.component.js +8 -5
  253. app-rn-runtime/components/navigation/navitem/navitem.component.js.map +1 -1
  254. app-rn-runtime/components/navigation/navitem/navitem.props.js +3 -0
  255. app-rn-runtime/components/navigation/navitem/navitem.props.js.map +1 -1
  256. app-rn-runtime/components/navigation/popover/popover.component.js +10 -3
  257. app-rn-runtime/components/navigation/popover/popover.component.js.map +1 -1
  258. app-rn-runtime/components/navigation/popover/popover.props.js +7 -0
  259. app-rn-runtime/components/navigation/popover/popover.props.js.map +1 -1
  260. app-rn-runtime/components/navigation/popover/popover.styles.js +8 -2
  261. app-rn-runtime/components/navigation/popover/popover.styles.js.map +1 -1
  262. app-rn-runtime/components/page/page-content/page-content.component.js +7 -1
  263. app-rn-runtime/components/page/page-content/page-content.component.js.map +1 -1
  264. app-rn-runtime/components/page/tabbar/curve.js +84 -0
  265. app-rn-runtime/components/page/tabbar/curve.js.map +1 -0
  266. app-rn-runtime/components/page/tabbar/tabbar.component.js +44 -10
  267. app-rn-runtime/components/page/tabbar/tabbar.component.js.map +1 -1
  268. app-rn-runtime/components/page/tabbar/tabbar.styles.js +82 -15
  269. app-rn-runtime/components/page/tabbar/tabbar.styles.js.map +1 -1
  270. app-rn-runtime/core/accessibility.js +149 -0
  271. app-rn-runtime/core/accessibility.js.map +1 -0
  272. app-rn-runtime/core/base.component.js +21 -3
  273. app-rn-runtime/core/base.component.js.map +1 -1
  274. app-rn-runtime/core/components/floatinglabel.component.js +45 -0
  275. app-rn-runtime/core/components/floatinglabel.component.js.map +1 -0
  276. app-rn-runtime/core/components/textinput.component.js +25 -2
  277. app-rn-runtime/core/components/textinput.component.js.map +1 -1
  278. app-rn-runtime/core/event-notifier.js +22 -1
  279. app-rn-runtime/core/event-notifier.js.map +1 -1
  280. app-rn-runtime/core/tappable.component.js +37 -10
  281. app-rn-runtime/core/tappable.component.js.map +1 -1
  282. app-rn-runtime/core/utils.js +11 -0
  283. app-rn-runtime/core/utils.js.map +1 -1
  284. app-rn-runtime/gestures/swipe.animation.js +34 -1
  285. app-rn-runtime/gestures/swipe.animation.js.map +1 -1
  286. app-rn-runtime/package.json +8 -3
  287. app-rn-runtime/runtime/App.js +12 -7
  288. app-rn-runtime/runtime/App.js.map +1 -1
  289. app-rn-runtime/runtime/base-page.component.js +1 -1
  290. app-rn-runtime/runtime/base-page.component.js.map +1 -1
  291. app-rn-runtime/runtime/services/app-security.service.js +2 -1
  292. app-rn-runtime/runtime/services/app-security.service.js.map +1 -1
  293. app-rn-runtime/runtime/services/webprocess.service.js +0 -1
  294. app-rn-runtime/runtime/services/webprocess.service.js.map +1 -1
  295. app-rn-runtime/styles/background.component.js +1 -1
  296. app-rn-runtime/styles/background.component.js.map +1 -1
  297. app-rn-runtime/styles/theme.js +43 -0
  298. app-rn-runtime/styles/theme.js.map +1 -1
  299. app-rn-runtime/styles/theme.variables.js +30 -6
  300. app-rn-runtime/styles/theme.variables.js.map +1 -1
  301. app-rn-runtime/variables/model-variable.js +2 -1
  302. app-rn-runtime/variables/model-variable.js.map +1 -1
  303. app-rn-runtime/variables/service-variable.js +14 -6
  304. app-rn-runtime/variables/service-variable.js.map +1 -1
@@ -34,6 +34,10 @@ export default class WmConfirmdialog extends BaseComponent {
34
34
  return /*#__PURE__*/React.createElement(WmDialog, {
35
35
  id: this.getTestId('dialog'),
36
36
  iconclass: props.iconclass,
37
+ iconurl: props.iconurl,
38
+ iconheight: props.iconheight,
39
+ iconmargin: props.iconmargin,
40
+ iconwidth: props.iconwidth,
37
41
  animation: props.animation,
38
42
  closable: props.closable,
39
43
  modal: props.modal,
@@ -1 +1 @@
1
- {"version":3,"names":["React","BaseComponent","BaseComponentState","WmButton","WmLabel","WmDialog","WmDialogcontent","WmDialogactions","WmConfirmdialogProps","DEFAULT_CLASS","WmConfirmdialogState","WmConfirmdialog","constructor","props","_defineProperty","onComponentInit","c","dialogRef","open","close","getMessageStyle","type","renderWidget","createElement","id","getTestId","iconclass","animation","closable","modal","styles","dialog","title","listener","onOpened","invokeEventCallback","dialogContent","caption","message","dialogActions","canceltext","theme","mergeStyle","getStyle","cancelButton","onTap","oktext","okButton"],"sources":["confirmdialog.component.tsx"],"sourcesContent":["import React from 'react';\nimport { BaseComponent, BaseComponentState, LifecycleListener } from '@wavemaker/app-rn-runtime/core/base.component';\n\nimport WmButton from '@wavemaker/app-rn-runtime/components/basic/button/button.component';\nimport WmLabel from '@wavemaker/app-rn-runtime/components/basic/label/label.component';\n\nimport WmDialog from '../dialog/dialog.component';\nimport WmDialogcontent from '../dialogcontent/dialogcontent.component';\nimport WmDialogactions from '../dialogactions/dialogactions.component';\n\nimport WmConfirmdialogProps from './confirmdialog.props';\nimport { DEFAULT_CLASS, WmConfirmdialogStyles } from './confirmdialog.styles';\nimport { merge } from 'lodash-es';\n\nexport class WmConfirmdialogState extends BaseComponentState<WmConfirmdialogProps> {}\n\nexport default class WmConfirmdialog extends BaseComponent<WmConfirmdialogProps, WmConfirmdialogState, WmConfirmdialogStyles> {\n\n private dialogRef: WmDialog = null as any;\n\n private listener: LifecycleListener = {\n onComponentInit: (c) => {\n if (c instanceof WmDialog) {\n this.dialogRef = c;\n }\n }\n };\n\n constructor(props: WmConfirmdialogProps) {\n super(props, DEFAULT_CLASS, new WmConfirmdialogProps());\n }\n\n open() {\n this.dialogRef.open();\n }\n\n close() {\n this.dialogRef.close();\n }\n\n getMessageStyle(type: string) {\n\n }\n\n renderWidget(props: WmConfirmdialogProps) {\n return (\n <WmDialog\n id={this.getTestId('dialog')}\n iconclass={props.iconclass}\n animation={props.animation}\n closable={props.closable}\n modal={props.modal}\n styles={this.styles.dialog}\n title={props.title}\n listener={this.listener} onOpened={() => {\n this.invokeEventCallback('onOpened', [null, this]);\n }}>\n <WmDialogcontent styles={this.styles.dialogContent}>\n <WmLabel\n id={this.getTestId('msg')}\n caption={props.message || ''}\n styles={this.styles.message}></WmLabel>\n </WmDialogcontent>\n <WmDialogactions styles={this.styles.dialogActions}>\n <WmButton\n id={this.getTestId('cancelbtn')}\n caption={props.canceltext}\n styles={this.theme.mergeStyle({}, this.theme.getStyle('btn-onlyLabel'), this.styles.cancelButton)}\n onTap={() => {\n this.dialogRef.close();\n this.invokeEventCallback('onCancel', [null, this]);\n }}></WmButton>\n <WmButton\n id={this.getTestId('okbtn')}\n caption={props.oktext}\n styles={this.theme.mergeStyle({}, this.theme.getStyle('btn-only-label'), this.styles.okButton)}\n onTap={() => {\n this.dialogRef.close();\n this.invokeEventCallback('onOk', [null, this]);\n }}></WmButton>\n </WmDialogactions>\n </WmDialog>\n );\n }\n}\n"],"mappings":";;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,aAAa,EAAEC,kBAAkB,QAA2B,+CAA+C;AAEpH,OAAOC,QAAQ,MAAM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CAAC,EAAE,IAAI,CAACD,KAAK,CAACE,QAAQ,CAAC,gBAAgB,CAAC,EAAE,IAAI,CAACb,MAAM,CAACiB,QAAQ,CAAE;MAC/FF,KAAK,EAAEA,CAAA,KAAM;QACX,IAAI,CAAC5B,SAAS,CAACE,KAAK,CAAC,CAAC;QACtB,IAAI,CAACgB,mBAAmB,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;MAChD;IAAE,CAAW,CACA,CACT,CAAC;EAEf;AACF"}
1
+ {"version":3,"names":["React","BaseComponent","BaseComponentState","WmButton","WmLabel","WmDialog","WmDialogcontent","WmDialogactions","WmConfirmdialogProps","DEFAULT_CLASS","WmConfirmdialogState","WmConfirmdialog","constructor","props","_defineProperty","onComponentInit","c","dialogRef","open","close","getMessageStyle","type","renderWidget","createElement","id","getTestId","iconclass","iconurl","iconheight","iconmargin","iconwidth","animation","closable","modal","styles","dialog","title","listener","onOpened","invokeEventCallback","dialogContent","caption","message","dialogActions","canceltext","theme","mergeStyle","getStyle","cancelButton","onTap","oktext","okButton"],"sources":["confirmdialog.component.tsx"],"sourcesContent":["import React from 'react';\nimport { BaseComponent, BaseComponentState, LifecycleListener } from '@wavemaker/app-rn-runtime/core/base.component';\n\nimport WmButton from '@wavemaker/app-rn-runtime/components/basic/button/button.component';\nimport WmLabel from '@wavemaker/app-rn-runtime/components/basic/label/label.component';\n\nimport WmDialog from '../dialog/dialog.component';\nimport WmDialogcontent from '../dialogcontent/dialogcontent.component';\nimport WmDialogactions from '../dialogactions/dialogactions.component';\n\nimport WmConfirmdialogProps from './confirmdialog.props';\nimport { DEFAULT_CLASS, WmConfirmdialogStyles } from './confirmdialog.styles';\nimport { merge } from 'lodash-es';\n\nexport class WmConfirmdialogState extends BaseComponentState<WmConfirmdialogProps> {}\n\nexport default class WmConfirmdialog extends BaseComponent<WmConfirmdialogProps, WmConfirmdialogState, WmConfirmdialogStyles> {\n\n private dialogRef: WmDialog = null as any;\n\n private listener: LifecycleListener = {\n onComponentInit: (c) => {\n if (c instanceof WmDialog) {\n this.dialogRef = c;\n }\n }\n };\n\n constructor(props: WmConfirmdialogProps) {\n super(props, DEFAULT_CLASS, new WmConfirmdialogProps());\n }\n\n open() {\n this.dialogRef.open();\n }\n\n close() {\n this.dialogRef.close();\n }\n\n getMessageStyle(type: string) {\n\n }\n\n renderWidget(props: WmConfirmdialogProps) {\n return (\n <WmDialog\n id={this.getTestId('dialog')}\n iconclass={props.iconclass}\n iconurl={props.iconurl}\n iconheight={props.iconheight}\n iconmargin={props.iconmargin}\n iconwidth={props.iconwidth}\n animation={props.animation}\n closable={props.closable}\n modal={props.modal}\n styles={this.styles.dialog}\n title={props.title}\n listener={this.listener} onOpened={() => {\n this.invokeEventCallback('onOpened', [null, this]);\n }}>\n <WmDialogcontent styles={this.styles.dialogContent}>\n <WmLabel\n id={this.getTestId('msg')}\n caption={props.message || ''}\n styles={this.styles.message}></WmLabel>\n </WmDialogcontent>\n <WmDialogactions styles={this.styles.dialogActions}>\n <WmButton\n id={this.getTestId('cancelbtn')}\n caption={props.canceltext}\n styles={this.theme.mergeStyle({}, this.theme.getStyle('btn-onlyLabel'), this.styles.cancelButton)}\n onTap={() => {\n this.dialogRef.close();\n this.invokeEventCallback('onCancel', [null, this]);\n }}></WmButton>\n <WmButton\n id={this.getTestId('okbtn')}\n caption={props.oktext}\n styles={this.theme.mergeStyle({}, this.theme.getStyle('btn-only-label'), this.styles.okButton)}\n onTap={() => {\n this.dialogRef.close();\n this.invokeEventCallback('onOk', [null, this]);\n }}></WmButton>\n </WmDialogactions>\n </WmDialog>\n );\n }\n}\n"],"mappings":";;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,aAAa,EAAEC,kBAAkB,QAA2B,+CAA+C;AAEpH,OAAOC,QAAQ,MAAM,oEAAoE;AACzF,OAAOC,OAAO,MAAM,kEAAkE;AAEtF,OAAOC,QAAQ,MAAM,4BAA4B;AACjD,OAAOC,eAAe,MAAM,0CAA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AAO;MACtBhB,MAAM,EAAE,IAAI,CAACW,KAAK,CAACC,UAAU,CAAC,CAAC,CAAC,EAAE,IAAI,CAACD,KAAK,CAACE,QAAQ,CAAC,gBAAgB,CAAC,EAAE,IAAI,CAACb,MAAM,CAACiB,QAAQ,CAAE;MAC/FF,KAAK,EAAEA,CAAA,KAAM;QACX,IAAI,CAAChC,SAAS,CAACE,KAAK,CAAC,CAAC;QACtB,IAAI,CAACoB,mBAAmB,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;MAChD;IAAE,CAAW,CACA,CACT,CAAC;EAEf;AACF"}
@@ -14,6 +14,10 @@ export default class WmConfirmdialogProps extends BaseProps {
14
14
  _defineProperty(this, "modal", false);
15
15
  _defineProperty(this, "closable", true);
16
16
  _defineProperty(this, "onOpened", null);
17
+ _defineProperty(this, "iconurl", null);
18
+ _defineProperty(this, "iconheight", null);
19
+ _defineProperty(this, "iconwidth", null);
20
+ _defineProperty(this, "iconmargin", null);
17
21
  }
18
22
  }
19
23
  //# sourceMappingURL=confirmdialog.props.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["BaseProps","WmConfirmdialogProps","constructor","arguments","_defineProperty"],"sources":["confirmdialog.props.ts"],"sourcesContent":["import { BaseProps } from '@wavemaker/app-rn-runtime/core/base.component';\n\nexport default class WmConfirmdialogProps extends BaseProps {\n animation: string = null as any;\n title? = 'Confirm';\n iconclass? = 'wm-sl-l sl-check';\n oktext? = 'Ok';\n canceltext? = 'CANCEL';\n message? = 'I am confirm box!';\n modal? = false;\n closable? = true;\n onOpened?: Function = null as any;\n}\n"],"mappings":";;;AAAA,SAASA,SAAS,QAAQ,+CAA+C;AAEzE,eAAe,MAAMC,oBAAoB,SAASD,SAAS,CAAC;EAAAE,YAAA;IAAA,SAAAC,SAAA;IAAAC,eAAA,oBACpC,IAAI;IAAAA,eAAA,gBACf,SAAS;IAAAA,eAAA,oBACL,kBAAkB;IAAAA,eAAA,iBACrB,IAAI;IAAAA,eAAA,qBACA,QAAQ;IAAAA,eAAA,kBACX,mBAAmB;IAAAA,eAAA,gBACrB,KAAK;IAAAA,eAAA,mBACF,IAAI;IAAAA,eAAA,mBACM,IAAI;EAAA;AAC9B"}
1
+ {"version":3,"names":["BaseProps","WmConfirmdialogProps","constructor","arguments","_defineProperty"],"sources":["confirmdialog.props.ts"],"sourcesContent":["import { BaseProps } from '@wavemaker/app-rn-runtime/core/base.component';\n\nexport default class WmConfirmdialogProps extends BaseProps {\n animation: string = null as any;\n title? = 'Confirm';\n iconclass? = 'wm-sl-l sl-check';\n oktext? = 'Ok';\n canceltext? = 'CANCEL';\n message? = 'I am confirm box!';\n modal? = false;\n closable? = true;\n onOpened?: Function = null as any;\n iconurl?: string = null as any;\n iconheight?: number = null as any;\n iconwidth?: number = null as any;\n iconmargin?: number = null as any;\n}\n"],"mappings":";;;AAAA,SAASA,SAAS,QAAQ,+CAA+C;AAEzE,eAAe,MAAMC,oBAAoB,SAASD,SAAS,CAAC;EAAAE,YAAA;IAAA,SAAAC,SAAA;IAAAC,eAAA,oBACpC,IAAI;IAAAA,eAAA,gBACf,SAAS;IAAAA,eAAA,oBACL,kBAAkB;IAAAA,eAAA,iBACrB,IAAI;IAAAA,eAAA,qBACA,QAAQ;IAAAA,eAAA,kBACX,mBAAmB;IAAAA,eAAA,gBACrB,KAAK;IAAAA,eAAA,mBACF,IAAI;IAAAA,eAAA,mBACM,IAAI;IAAAA,eAAA,kBACP,IAAI;IAAAA,eAAA,qBACD,IAAI;IAAAA,eAAA,oBACL,IAAI;IAAAA,eAAA,qBACH,IAAI;EAAA;AAC9B"}
@@ -75,12 +75,16 @@ export default class WmDialog extends BaseComponent {
75
75
  style: this.styles.header
76
76
  }, /*#__PURE__*/React.createElement(View, {
77
77
  style: this.styles.headerLabel
78
- }, /*#__PURE__*/React.createElement(WmIcon, {
78
+ }, props.iconclass || props.iconurl ? /*#__PURE__*/React.createElement(WmIcon, {
79
79
  id: this.getTestId('icon'),
80
80
  caption: props.title,
81
81
  iconclass: props.iconclass,
82
- styles: this.styles.icon
83
- })), props.closable && /*#__PURE__*/React.createElement(WmButton, {
82
+ styles: this.styles.icon,
83
+ iconurl: props.iconurl,
84
+ iconheight: props.iconheight,
85
+ iconmargin: props.iconmargin,
86
+ iconwidth: props.iconwidth
87
+ }) : null), props.closable && /*#__PURE__*/React.createElement(WmButton, {
84
88
  id: this.getTestId('closebtn'),
85
89
  show: props.closable,
86
90
  iconclass: "wm-sl-l sl-close",
@@ -1 +1 @@
1
- {"version":3,"names":["React","View","ModalConsumer","AssetProvider","HideMode","ThemeProvider","BaseComponent","BaseComponentState","WmIcon","WmButton","WmDialogProps","DEFAULT_CLASS","WmDialogState","constructor","arguments","_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","hideModal","renderWidget","createElement","showModal","value","loadAsset","theme","style","root","_background","showheader","header","headerLabel","id","getTestId","caption","title","iconclass","icon","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 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 <WmIcon id={this.getTestId('icon')} caption={props.title} iconclass={props.iconclass} styles={this.styles.icon}></WmIcon>\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,S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C,KAAK,EAAE,IAAI,CAACE;MAAM,gBAC/BlD,KAAA,CAAA8C,aAAA,CAAC7C,IAAI;QAACkD,KAAK,EAAE,IAAI,CAACb,MAAM,CAACc;MAAK,GAC7B,IAAI,CAACC,WAAW,EACdpC,KAAK,CAACqC,UAAU,gBAAItD,KAAA,CAAA8C,aAAA,CAAC7C,IAAI;QAACkD,KAAK,EAAE,IAAI,CAACb,MAAM,CAACiB;MAAO,gBACnDvD,KAAA,CAAA8C,aAAA,CAAC7C,IAAI;QAACkD,KAAK,EAAE,IAAI,CAACb,MAAM,CAACkB;MAAY,gBACnCxD,KAAA,CAAA8C,aAAA,CAACtC,MAAM;QAACiD,EAAE,EAAE,IAAI,CAACC,SAAS,CAAC,MAAM,CAAE;QAACC,OAAO,EAAE1C,KAAK,CAAC2C,KAAM;QAACC,SAAS,EAAE5C,KAAK,CAAC4C,SAAU;QAACvB,MAAM,EAAE,IAAI,CAACA,MAAM,CAACwB;MAAK,CAAS,CACpH,CAAC,EACN7C,KAAK,CAAC8C,QAAQ,iBAAI/D,KAAA,CAAA8C,aAAA,CAACrC,QAAQ;QAACgD,EAAE,EAAE,IAAI,CAACC,SAAS,CAAC,UAAU,CAAE;QAAChC,IAAI,EAAET,KAAK,CAAC8C,QAAS;QAACF,SAAS,EAAC,kBAAkB;QAACG,KAAK,EAAEA,CAAA,KAAM,IAAI,CAAClC,KAAK,CAAC,CAAE;QAACQ,MAAM,EAAE,IAAI,CAACA,MAAM,CAAC2B;MAAS,CAAW,CAC/K,CAAC,GAAI,IAAI,EACdhD,KAAK,CAACiD,QACH,CACO,CACF,CAAC,EACfhC,YAAY,CAAC,CAAC;MACjB,OAAO,IAAI;IACb,CACa,CAAC;EAClB;AACF"}
1
+ {"version":3,"names":["React","View","ModalConsumer","AssetProvider","HideMode","ThemeProvider","BaseComponent","BaseComponentState","WmIcon","WmButton","WmDialogProps","DEFAULT_CLASS","WmDialogState","constructor","arguments","_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","hideModal","renderWidget","createElement","showModal","value","loadAsset","theme","style","root","_background","showheader","header","headerLabel","iconclass","iconurl","id","getTestId","caption","title","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 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 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,aAAa,SAASL,kBA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,CAACkB;MAAY,GACpCvC,KAAK,CAACwC,SAAS,IAAIxC,KAAK,CAACyC,OAAO,gBAC/B1D,KAAA,CAAA8C,aAAA,CAACtC,MAAM;QAACmD,EAAE,EAAE,IAAI,CAACC,SAAS,CAAC,MAAM,CAAE;QAClCC,OAAO,EAAE5C,KAAK,CAAC6C,KAAM;QACrBL,SAAS,EAAExC,KAAK,CAACwC,SAAU;QAC3BnB,MAAM,EAAE,IAAI,CAACA,MAAM,CAACyB,IAAK;QACzBL,OAAO,EAAEzC,KAAK,CAACyC,OAAQ;QACvBM,UAAU,EAAE/C,KAAK,CAAC+C,UAAW;QAC7BC,UAAU,EAAEhD,KAAK,CAACgD,UAAW;QAC7BC,SAAS,EAAEjD,KAAK,CAACiD;MAAU,CAC1B,CAAC,GAAG,IACF,CAAC,EACNjD,KAAK,CAACkD,QAAQ,iBAAInE,KAAA,CAAA8C,aAAA,CAACrC,QAAQ;QAACkD,EAAE,EAAE,IAAI,CAACC,SAAS,CAAC,UAAU,CAAE;QAAClC,IAAI,EAAET,KAAK,CAACkD,QAAS;QAACV,SAAS,EAAC,kBAAkB;QAACW,KAAK,EAAEA,CAAA,KAAM,IAAI,CAACtC,KAAK,CAAC,CAAE;QAACQ,MAAM,EAAE,IAAI,CAACA,MAAM,CAAC+B;MAAS,CAAW,CAC/K,CAAC,GAAI,IAAI,EACdpD,KAAK,CAACqD,QACH,CACO,CACF,CAAC,EACfpC,YAAY,CAAC,CAAC;MACjB,OAAO,IAAI;IACb,CACa,CAAC;EAClB;AACF"}
@@ -15,6 +15,10 @@ export default class WmDialogProps extends BaseProps {
15
15
  _defineProperty(this, "showheader", true);
16
16
  _defineProperty(this, "title", '');
17
17
  _defineProperty(this, "onOpened", null);
18
+ _defineProperty(this, "iconurl", null);
19
+ _defineProperty(this, "iconheight", null);
20
+ _defineProperty(this, "iconwidth", null);
21
+ _defineProperty(this, "iconmargin", null);
18
22
  }
19
23
  }
20
24
  //# sourceMappingURL=dialog.props.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["BaseProps","WmDialogProps","constructor","arguments","_defineProperty"],"sources":["dialog.props.ts"],"sourcesContent":["import { BaseProps } from '@wavemaker/app-rn-runtime/core/base.component';\n\nexport default class WmDialogProps extends BaseProps {\n animation: string = null as any;\n show? = false;\n children = null as any;\n closable?= true;\n dialogtype?='design-dialog';\n iconclass? = '';\n modal? = true;\n showheader? = true;\n title? = '';\n onOpened?: Function = null as any;\n}\n"],"mappings":";;;AAAA,SAASA,SAAS,QAAQ,+CAA+C;AAEzE,eAAe,MAAMC,aAAa,SAASD,SAAS,CAAC;EAAAE,YAAA;IAAA,SAAAC,SAAA;IAAAC,eAAA,oBAC/B,IAAI;IAAAA,eAAA,eAChB,KAAK;IAAAA,eAAA,mBACF,IAAI;IAAAA,eAAA,mBACJ,IAAI;IAAAA,eAAA,qBACH,eAAe;IAAAA,eAAA,oBACd,EAAE;IAAAA,eAAA,gBACN,IAAI;IAAAA,eAAA,qBACC,IAAI;IAAAA,eAAA,gBACT,EAAE;IAAAA,eAAA,mBACW,IAAI;EAAA;AAC5B"}
1
+ {"version":3,"names":["BaseProps","WmDialogProps","constructor","arguments","_defineProperty"],"sources":["dialog.props.ts"],"sourcesContent":["import { BaseProps } from '@wavemaker/app-rn-runtime/core/base.component';\n\nexport default class WmDialogProps extends BaseProps {\n animation: string = null as any;\n show? = false;\n children = null as any;\n closable?= true;\n dialogtype?='design-dialog';\n iconclass? = '';\n modal? = true;\n showheader? = true;\n title? = '';\n onOpened?: Function = null as any;\n iconurl?: string = null as any;\n iconheight?: number = null as any;\n iconwidth?: number = null as any;\n iconmargin?: number = null as any;\n}\n"],"mappings":";;;AAAA,SAASA,SAAS,QAAQ,+CAA+C;AAEzE,eAAe,MAAMC,aAAa,SAASD,SAAS,CAAC;EAAAE,YAAA;IAAA,SAAAC,SAAA;IAAAC,eAAA,oBAC/B,IAAI;IAAAA,eAAA,eAChB,KAAK;IAAAA,eAAA,mBACF,IAAI;IAAAA,eAAA,mBACJ,IAAI;IAAAA,eAAA,qBACH,eAAe;IAAAA,eAAA,oBACd,EAAE;IAAAA,eAAA,gBACN,IAAI;IAAAA,eAAA,qBACC,IAAI;IAAAA,eAAA,gBACT,EAAE;IAAAA,eAAA,mBACW,IAAI;IAAAA,eAAA,kBACP,IAAI;IAAAA,eAAA,qBACD,IAAI;IAAAA,eAAA,oBACL,IAAI;IAAAA,eAAA,qBACH,IAAI;EAAA;AAC5B"}
@@ -51,13 +51,22 @@ BASE_THEME.registerStyle((themeVariables, addStyle) => {
51
51
  root: {
52
52
  alignSelf: 'flex-end',
53
53
  backgroundColor: 'transparent',
54
- paddingRight: 0,
55
- paddingTop: 0
54
+ borderRadius: 8,
55
+ paddingRight: 8,
56
+ paddingTop: 8,
57
+ paddingBottom: 8,
58
+ paddingLeft: 8,
59
+ minHeight: 0,
60
+ marginBottom: 22,
61
+ rippleColor: themeVariables.transparent
56
62
  },
57
63
  icon: {
58
64
  root: {
59
65
  alignItems: 'center'
60
66
  },
67
+ icon: {
68
+ paddingRight: 0
69
+ },
61
70
  text: {
62
71
  color: themeVariables.dialogCloseIconColor,
63
72
  fontSize: 14
@@ -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","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 paddingRight: 0,\n paddingTop: 0\n },\n icon : {\n root: {\n alignItems: 'center'\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,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,KAAK,EAAE1B,cAAc,CAACuC,oBAAoB;UAC1Cf,QAAQ,EAAE;QACd;MACJ;IACJ;EACJ,CAAC,CAAC;EAEFvB,QAAQ,CAACH,aAAa,EAAE,EAAE,EAAEI,aAAa,CAAC;AAC9C,CAAC,CAAC"}
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,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export default class BaseDatasetProps extends BaseProps {
22
22
  _defineProperty(this, "displayimagesrc", void 0);
23
23
  _defineProperty(this, "iconclass", void 0);
24
24
  _defineProperty(this, "triggerValidation", void 0);
25
+ _defineProperty(this, "accessibilitylabel", undefined);
26
+ _defineProperty(this, "hint", undefined);
27
+ _defineProperty(this, "accessibilityrole", "none");
28
+ _defineProperty(this, "accessibilitylabelledby", undefined);
25
29
  }
26
30
  }
27
31
  //# sourceMappingURL=basedataset.props.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["BaseProps","BaseDatasetProps","constructor","arguments","_defineProperty"],"sources":["basedataset.props.ts"],"sourcesContent":["import { BaseProps } from '@wavemaker/app-rn-runtime/core/base.component';\n\nexport default class BaseDatasetProps extends BaseProps {\n dataset: any;\n datavalue?: any;\n displayfield: any;\n datafield: any;\n displayexpression: any;\n getDisplayExpression: any;\n groupby?: any;\n match?: any;\n orderby?: any;\n readonly: boolean = null as any;\n dateformat?: any;\n onFieldChange?: any;\n displaylabel?: any;\n displayValue?: any;\n displayimagesrc: any;\n iconclass?: any;\n triggerValidation?: any;\n}\n"],"mappings":";;;AAAA,SAASA,SAAS,QAAQ,+CAA+C;AAEzE,eAAe,MAAMC,gBAAgB,SAASD,SAAS,CAAC;EAAAE,YAAA;IAAA,SAAAC,SAAA;IAAAC,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA,mBAUlC,IAAI;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;EAAA;AAQ1B"}
1
+ {"version":3,"names":["BaseProps","BaseDatasetProps","constructor","arguments","_defineProperty","undefined"],"sources":["basedataset.props.ts"],"sourcesContent":["import {AccessibilityRole} from \"react-native\";\nimport { BaseProps } from '@wavemaker/app-rn-runtime/core/base.component';\n\nexport default class BaseDatasetProps extends BaseProps {\n dataset: any;\n datavalue?: any;\n displayfield: any;\n datafield: any;\n displayexpression: any;\n getDisplayExpression: any;\n groupby?: any;\n match?: any;\n orderby?: any;\n readonly: boolean = null as any;\n dateformat?: any;\n onFieldChange?: any;\n displaylabel?: any;\n displayValue?: any;\n displayimagesrc: any;\n iconclass?: any;\n triggerValidation?: any;\n accessibilitylabel?: string = undefined;\n hint?: string = undefined;\n accessibilityrole?: AccessibilityRole = \"none\";\n accessibilitylabelledby?: string = undefined;\n}\n"],"mappings":";;;AACA,SAASA,SAAS,QAAQ,+CAA+C;AAEzE,eAAe,MAAMC,gBAAgB,SAASD,SAAS,CAAC;EAAAE,YAAA;IAAA,SAAAC,SAAA;IAAAC,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA,mBAUlC,IAAI;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA,6BAQMC,SAAS;IAAAD,eAAA,eACvBC,SAAS;IAAAD,eAAA,4BACe,MAAM;IAAAA,eAAA,kCACXC,SAAS;EAAA;AAC9C"}
@@ -116,10 +116,10 @@ export class BaseInputComponent extends BaseComponent {
116
116
  let newVal = event.target.value || this.state.textValue;
117
117
  let oldVal = this.state.props.datavalue || '';
118
118
  this.validate(newVal);
119
- if (newVal === '') {
119
+ if (newVal === '' || newVal == undefined) {
120
120
  setTimeout(() => {
121
121
  this.props.triggerValidation && this.props.triggerValidation();
122
- });
122
+ }, 10);
123
123
  }
124
124
  if (this.state.props.updateon === 'blur') {
125
125
  if (oldVal !== newVal) {
@@ -1 +1 @@
1
- {"version":3,"names":["DEFAULT_CLASS","BaseComponent","BaseComponentState","isString","Platform","validateField","Injector","BaseInputState","constructor","arguments","_defineProperty","BaseInputComponent","props","defaultClass","length","undefined","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","setTimeout","triggerValidation","validationObj","isValid","errorType","onFocus","set","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 = event.target.value || this.state.textValue;\n let oldVal = this.state.props.datavalue || '';\n this.validate(newVal);\n if (newVal === '') {\n setTimeout(() => {\n this.props.triggerValidation && this.props.triggerValidation();\n })\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 }, 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;IAAA,SAAAC,SAAA;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,MAAeC,kBAAkB,SAA4FV,aAAa,CAAU;EAIzJO,WAAWA,CAACI,KAAQ,EAAmF;IAAA,IAA1EC,YAAoB,GAAAJ,SAAA,CAAAK,MAAA,QAAAL,SAAA,QAAAM,SAAA,GAAAN,SAAA,MAAGT,aAAa;IAAA,IAAEgB,YAAgB,GAAAP,SAAA,CAAAK,MAAA,OAAAL,SAAA,MAAAM,SAAA;IAAA,IAAEE,YAAgB,GAAAR,SAAA,CAAAK,MAAA,OAAAL,SAAA,MAAAM,SAAA;IACnG,KAAK,CAACH,KAAK,EAAEC,YAAY,EAAEG,YAAY,EAAEC,YAAY,CAAC;IAAC,KAD5BJ,YAAoB,GAApBA,YAAoB;IAAAH,eAAA,oBAHZ,IAAI;IAAAA,eAAA,oBACpB,KAAK;IAAAA,eAAA,iB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CAAC/B,KAAK,CAACrB,KAAK,CAAC0B,QAAQ,KAAK,MAAM,EAAE;MACxC,IAAIwB,MAAM,KAAKD,MAAM,EAAE;QACrB,IAAI,CAACtB,eAAe,CAACsB,MAAM,EAAExB,KAAK,EAAE,MAAM,CAAC;MAC7C,CAAC,MAAM;QACL,IAAI,CAACkB,mBAAmB,CAAC,QAAQ,EAAE,CAAClB,KAAK,EAAE,IAAI,CAACmB,KAAK,CAAC,CAAC;MACzD;IACF;EACF;EAEAb,QAAQA,CAACF,KAAU,EAAE;IACnB,MAAMwB,aAAa,GAAG5D,aAAa,CAAC,IAAI,CAAC4B,KAAK,CAACrB,KAAK,EAAE6B,KAAK,CAAC;IAC5D,IAAI,CAACQ,QAAQ,CAAC;MACZiB,OAAO,EAAED,aAAa,CAACC,OAAO;MAC9BC,SAAS,EAAEF,aAAa,CAACE;IAC3B,CAAM,CAAC;EACT;EAEAC,OAAOA,CAAC/B,KAAU,EAAE;IAClB;IACA;IACA0B,UAAU,CAAC,MAAM;MACfzD,QAAQ,CAACoD,eAAe,CAACW,GAAG,CAAC,IAAI,CAAC;MAClC,IAAI,CAACd,mBAAmB,CAAC,SAAS,EAAE,CAAElB,KAAK,EAAE,IAAI,CAACmB,KAAK,CAAC,CAAC;IAC3D,CAAC,EAAE,GAAG,CAAC;EAET;EAEAc,UAAUA,CAACjC,KAAU,EAAE;IACrB,IAAI,CAACkB,mBAAmB,CAAC,YAAY,EAAE,CAAElB,KAAK,EAAE,IAAI,CAACmB,KAAK,CAAC,CAAC;EAC9D;AACF"}
1
+ {"version":3,"names":["DEFAULT_CLASS","BaseComponent","BaseComponentState","isString","Platform","validateField","Injector","BaseInputState","constructor","arguments","_defineProperty","BaseInputComponent","props","defaultClass","length","undefined","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","setTimeout","triggerValidation","validationObj","isValid","errorType","onFocus","set","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 = event.target.value || 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 }, 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;IAAA,SAAAC,SAAA;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,MAAeC,kBAAkB,SAA4FV,aAAa,CAAU;EAIzJO,WAAWA,CAACI,KAAQ,EAAmF;IAAA,IAA1EC,YAAoB,GAAAJ,SAAA,CAAAK,MAAA,QAAAL,SAAA,QAAAM,SAAA,GAAAN,SAAA,MAAGT,aAAa;IAAA,IAAEgB,YAAgB,GAAAP,SAAA,CAAAK,MAAA,OAAAL,SAAA,MAAAM,SAAA;IAAA,IAAEE,YAAgB,GAAAR,SAAA,CAAAK,MAAA,OAAAL,SAAA,MAAAM,SAAA;IACnG,KAAK,CAACH,KAAK,EAAEC,YAAY,EAAEG,YAAY,EAAEC,YAAY,CAAC;IAAC,KAD5BJ,YAAoB,GAApBA,YAAoB;IAAAH,eAAA,oBAHZ,IAAI;IAAAA,eAAA,oBACpB,KAAK;IAAAA,eAAA,iBACJ,CAAC;EAGvB;EAEAQ,KAAKA,CAAA,EAAG;IAAA,IAAAC,eAAA;IACN,IAAI,aAAJ,IAAI,gBAAAA,eAAA,GAAJ,IAAI,CAAEC,SAAS,cAAAD,e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E;QACrB,IAAI,CAACtB,eAAe,CAACsB,MAAM,EAAExB,KAAK,EAAE,MAAM,CAAC;MAC7C,CAAC,MAAM;QACL,IAAI,CAACkB,mBAAmB,CAAC,QAAQ,EAAE,CAAClB,KAAK,EAAE,IAAI,CAACmB,KAAK,CAAC,CAAC;MACzD;IACF;EACF;EAEAb,QAAQA,CAACF,KAAU,EAAE;IACnB,MAAMwB,aAAa,GAAG5D,aAAa,CAAC,IAAI,CAAC4B,KAAK,CAACrB,KAAK,EAAE6B,KAAK,CAAC;IAC5D,IAAI,CAACQ,QAAQ,CAAC;MACZiB,OAAO,EAAED,aAAa,CAACC,OAAO;MAC9BC,SAAS,EAAEF,aAAa,CAACE;IAC3B,CAAM,CAAC;EACT;EAEAC,OAAOA,CAAC/B,KAAU,EAAE;IAClB;IACA;IACA0B,UAAU,CAAC,MAAM;MACfzD,QAAQ,CAACoD,eAAe,CAACW,GAAG,CAAC,IAAI,CAAC;MAClC,IAAI,CAACd,mBAAmB,CAAC,SAAS,EAAE,CAAElB,KAAK,EAAE,IAAI,CAACmB,KAAK,CAAC,CAAC;IAC3D,CAAC,EAAE,GAAG,CAAC;EAET;EAEAc,UAAUA,CAACjC,KAAU,EAAE;IACrB,IAAI,CAACkB,mBAAmB,CAAC,YAAY,EAAE,CAAElB,KAAK,EAAE,IAAI,CAACmB,KAAK,CAAC,CAAC;EAC9D;AACF"}
@@ -18,6 +18,10 @@ export default class BaseInputProps extends BaseProps {
18
18
  _defineProperty(this, "checkFormField", void 0);
19
19
  _defineProperty(this, "onFieldChange", void 0);
20
20
  _defineProperty(this, "triggerValidation", void 0);
21
+ _defineProperty(this, "accessibilitylabel", undefined);
22
+ _defineProperty(this, "hint", undefined);
23
+ _defineProperty(this, "accessibilityrole", "none");
24
+ _defineProperty(this, "accessibilitylabelledby", undefined);
21
25
  }
22
26
  }
23
27
  //# sourceMappingURL=baseinput.props.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["BaseProps","BaseInputProps","constructor","arguments","_defineProperty"],"sources":["baseinput.props.ts"],"sourcesContent":["import { 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}\n"],"mappings":";;;AAAA,SAASA,SAAS,QAAQ,+CAA+C;AAEzE,eAAe,MAAMC,cAAc,SAASD,SAAS,CAAC;EAAAE,YAAA;IAAA,SAAAC,SAAA;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;EAAA;AAI5B"}
1
+ {"version":3,"names":["BaseProps","BaseInputProps","constructor","arguments","_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 = \"none\";\n accessibilitylabelledby?: string = undefined;\n}\n"],"mappings":";;;AACA,SAASA,SAAS,QAAQ,+CAA+C;AAEzE,eAAe,MAAMC,cAAc,SAASD,SAAS,CAAC;EAAAE,YAAA;IAAA,SAAAC,SAAA;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,4BACe,MAAM;IAAAA,eAAA,kCACXC,SAAS;EAAA;AAC9C"}
@@ -1,7 +1,7 @@
1
1
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
2
2
  function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
3
3
  function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
4
- import { includes, intersection, isNaN, isFinite, toArray } from 'lodash';
4
+ import { includes, intersection, isNaN, isFinite, toArray, isNil } from 'lodash';
5
5
  import { BaseComponent, BaseComponentState } from "@wavemaker/app-rn-runtime/core/base.component";
6
6
  import { DEFAULT_CLASS } from "@wavemaker/app-rn-runtime/components/navigation/basenav/basenav.styles";
7
7
  import { Platform } from 'react-native';
@@ -39,11 +39,12 @@ export class BaseNumberComponent extends BaseComponent {
39
39
  this === null || this === void 0 || (_this$widgetRef = this.widgetRef) === null || _this$widgetRef === void 0 ? void 0 : _this$widgetRef.focus();
40
40
  }
41
41
  validateOnDevice(value, type) {
42
+ var _value$match;
42
43
  const isCurrencyField = type === 'currency';
43
44
  let isValidText = true;
44
45
 
45
- // * check for alphabets
46
- if (/[a-zA-Z]/.test(value)) {
46
+ // * no alphabets except E, may contain E only once
47
+ if (/[a-df-zA-DF-Z]/.test(value) || !/^[^eE]*[eE]?[^eE]*$/.test(value)) {
47
48
  isValidText = false;
48
49
  }
49
50
 
@@ -52,6 +53,11 @@ export class BaseNumberComponent extends BaseComponent {
52
53
  isValidText = false;
53
54
  }
54
55
 
56
+ // * number only: not more than one minus and doesn't end with minus (-)
57
+ if (!isCurrencyField && Number((_value$match = value.match(/-/g)) === null || _value$match === void 0 ? void 0 : _value$match.length) > 1 || /\w-/.test(value)) {
58
+ isValidText = false;
59
+ }
60
+
55
61
  // * check for more than one decimal point
56
62
  if (/^\d*\.\d*\..*$/.test(value)) {
57
63
  isValidText = false;
@@ -147,17 +153,17 @@ export class BaseNumberComponent extends BaseComponent {
147
153
  if (value === oldValue) {
148
154
  return;
149
155
  }
150
- const validNumber = this.isValidNumber(model);
156
+ const validNumber = this.isValidNumber(model) || value == oldValue + '.';
151
157
  if (!validNumber) {
152
158
  this.invokeEventCallback('onError', [event, this.proxy, value, oldValue]);
153
159
  return;
154
160
  }
155
161
  this.updateState({
156
162
  props: {
157
- datavalue: model
163
+ datavalue: model || Number(value)
158
164
  }
159
165
  }, () => {
160
- !this.props.onFieldChange && value !== oldValue && this.invokeEventCallback('onChange', [event, this.proxy, value, oldValue]);
166
+ !this.props.onFieldChange && value !== oldValue && this.invokeEventCallback('onChange', [event, this.proxy, model, oldValue]);
161
167
  if (source === 'blur') {
162
168
  this.invokeEventCallback('onBlur', [event, this.proxy]);
163
169
  }
@@ -166,10 +172,10 @@ export class BaseNumberComponent extends BaseComponent {
166
172
  onBlur(event) {
167
173
  let newVal = event.target.value || this.state.textValue;
168
174
  this.validate(newVal);
169
- if (newVal === '') {
175
+ if (newVal === '' || newVal == undefined) {
170
176
  setTimeout(() => {
171
177
  this.props.triggerValidation && this.props.triggerValidation();
172
- });
178
+ }, 10);
173
179
  }
174
180
  if (this.state.props.updateon === 'blur') {
175
181
  let oldVal = this.state.props.datavalue || '';
@@ -234,13 +240,13 @@ export class BaseNumberComponent extends BaseComponent {
234
240
  */
235
241
  getValueInRange(value) {
236
242
  const props = this.state.props;
237
- if (!isNaN(props.minvalue) && value < props.minvalue) {
243
+ if (!isNil(value) && !isNaN(props.minvalue) && value < props.minvalue) {
238
244
  this.updateState({
239
245
  errorType: 'minvalue'
240
246
  });
241
247
  return props.minvalue;
242
248
  }
243
- if (!isNaN(props.maxvalue) && value > props.maxvalue) {
249
+ if (!isNil(value) && !isNaN(props.maxvalue) && value > props.maxvalue) {
244
250
  this.updateState({
245
251
  errorType: 'maxvalue'
246
252
  });
@@ -1 +1 @@
1
- {"version":3,"names":["includes","intersection","isNaN","isFinite","toArray","BaseComponent","BaseComponentState","DEFAULT_CLASS","Platform","countDecimalDigits","validateField","BaseNumberState","constructor","arguments","_defineProperty","BaseNumberComponent","props","defaultClass","length","undefined","defaultProps","defaultState","DECIMAL","GROUP","onChange","event","state","updateon","updateDatavalue","target","value","focus","_this$widgetRef","widgetRef","validateOnDevice","type","isCurrencyField","isValidText","test","Number","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","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 } 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 // * check for alphabets\n if (/[a-zA-Z]/.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 // * 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);\n if (!validNumber) {\n this.invokeEventCallback('onError', [ event, this.proxy, value, oldValue ]);\n return;\n }\n\n this.updateState({\n props: {\n datavalue: model\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 onBlur(event: any) {\n let newVal = event.target.value || this.state.textValue;\n this.validate(newVal);\n if (newVal === '') {\n setTimeout(() => {\n this.props.triggerValidation && this.props.triggerValidation();\n })\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 (!isNaN(props.minvalue) && value < props.minvalue) {\n this.updateState({ errorType: 'minvalue'} as S);\n return props.minvalue;\n\n }\n if (!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, isDef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EAEA;EACUA,gBAAgBA,CAAA,EAAG;IAC3B,IAAI,CAAC5D,WAAW,CAAC;MACfU,OAAO,EAAE;IACX,CAAM,CAAC;EACT;EAEAmD,gBAAgBA,CAACC,IAAY,EAAEC,IAAS,EAAEC,IAAS,EAAE;IACnD,QAAQF,IAAI;MACV,KAAK,UAAU;MACf,KAAK,UAAU;QACb,IAAIC,IAAI,IAAGC,IAAI,EAAE;UACf,IAAI,CAAC7B,aAAa,CAAC4B,IAAI,CAAC;QAC1B;QACA;MACF,KAAK,WAAW;QACd,IAAI,CAAC/D,WAAW,CAAC;UACfC,SAAS,EAAE8D;QACb,CAAM,CAAC;QACP,MAAME,SAAS,GAAG,IAAI,CAACnF,KAAK,CAACmF,SAAS;QACtC,IAAIA,SAAS,EAAE;UACb,IAAI,CAACjE,WAAW,CAAC;YAAEiE,SAAS,EAAE;UAAM,CAAC,EAAO,IAAI,CAAC7F,KAAK,CAACkE,aAAa,IAAI,IAAI,CAAClE,KAAK,CAACkE,aAAa,CAAC4B,IAAI,CAAC,IAAI,EAAE,WAAW,EAAEH,IAAI,EAAEC,IAAI,EAAEC,SAAS,CAAC,CAAC;QAClJ,CAAC,MAAM;UACL,IAAI,CAAC7F,KAAK,CAACkE,aAAa,IAAI,IAAI,CAAClE,KAAK,CAACkE,aAAa,CAAC,WAAW,EAAEyB,IAAI,EAAEC,IAAI,EAAEC,SAAS,CAAC;QAC1F;IACJ;EACF;AACF"}
1
+ {"version":3,"names":["includes","intersection","isNaN","isFinite","toArray","isNil","BaseComponent","BaseComponentState","DEFAULT_CLASS","Platform","countDecimalDigits","validateField","BaseNumberState","constructor","arguments","_defineProperty","BaseNumberComponent","props","defaultClass","length","undefined","defaultProps","defaultState","DECIMAL","GROUP","onChange","event","state","updateon","updateDatavalue","target","value","focus","_this$widgetRef","widgetRef","validateOnDevice","type","_value$match","isCurrencyField","isValidText","test","Number","match","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","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;IAAA,SAAAC,SAAA;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,EAAmF;IAAA,IAA1EC,YAA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AmD,gBAAgBA,CAACC,IAAY,EAAEC,IAAS,EAAEC,IAAS,EAAE;IACnD,QAAQF,IAAI;MACV,KAAK,UAAU;MACf,KAAK,UAAU;QACb,IAAIC,IAAI,IAAGC,IAAI,EAAE;UACf,IAAI,CAAC7B,aAAa,CAAC4B,IAAI,CAAC;QAC1B;QACA;MACF,KAAK,WAAW;QACd,IAAI,CAAC/D,WAAW,CAAC;UACfC,SAAS,EAAE8D;QACb,CAAM,CAAC;QACP,MAAME,SAAS,GAAG,IAAI,CAACrF,KAAK,CAACqF,SAAS;QACtC,IAAIA,SAAS,EAAE;UACb,IAAI,CAACjE,WAAW,CAAC;YAAEiE,SAAS,EAAE;UAAM,CAAC,EAAO,IAAI,CAAC/F,KAAK,CAACoE,aAAa,IAAI,IAAI,CAACpE,KAAK,CAACoE,aAAa,CAAC4B,IAAI,CAAC,IAAI,EAAE,WAAW,EAAEH,IAAI,EAAEC,IAAI,EAAEC,SAAS,CAAC,CAAC;QAClJ,CAAC,MAAM;UACL,IAAI,CAAC/F,KAAK,CAACoE,aAAa,IAAI,IAAI,CAACpE,KAAK,CAACoE,aAAa,CAAC,WAAW,EAAEyB,IAAI,EAAEC,IAAI,EAAEC,SAAS,CAAC;QAC1F;IACJ;EACF;AACF"}
@@ -16,6 +16,10 @@ export default class BaseNumberProps extends BaseProps {
16
16
  _defineProperty(this, "required", false);
17
17
  _defineProperty(this, "triggerValidation", void 0);
18
18
  _defineProperty(this, "decimalPlaces", 2);
19
+ _defineProperty(this, "accessibilitylabel", undefined);
20
+ _defineProperty(this, "hint", undefined);
21
+ _defineProperty(this, "accessibilityrole", "none");
22
+ _defineProperty(this, "accessibilitylabelledby", undefined);
19
23
  }
20
24
  }
21
25
  //# sourceMappingURL=basenumber.props.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["BaseProps","BaseNumberProps","constructor","arguments","_defineProperty"],"sources":["basenumber.props.ts"],"sourcesContent":["import { BaseProps } from '@wavemaker/app-rn-runtime/core/base.component';\n\nexport default class BaseNumberProps extends BaseProps {\n datavalue: any;\n minvalue: number = null as any;\n maxvalue: number = null as any;\n step: number = 1;\n updateon: string = 'blur' as any;\n readonly: boolean = null as any;\n regexp: string = null as any;\n onFieldChange: any;\n required: boolean = false;\n triggerValidation: any;\n decimalPlaces: number = 2;\n}\n"],"mappings":";;;AAAA,SAASA,SAAS,QAAQ,+CAA+C;AAEzE,eAAe,MAAMC,eAAe,SAASD,SAAS,CAAC;EAAAE,YAAA;IAAA,SAAAC,SAAA;IAAAC,eAAA;IAAAA,eAAA,mBAElC,IAAI;IAAAA,eAAA,mBACJ,IAAI;IAAAA,eAAA,eACR,CAAC;IAAAA,eAAA,mBACG,MAAM;IAAAA,eAAA,mBACL,IAAI;IAAAA,eAAA,iBACP,IAAI;IAAAA,eAAA;IAAAA,eAAA,mBAED,KAAK;IAAAA,eAAA;IAAAA,eAAA,wBAED,CAAC;EAAA;AAC3B"}
1
+ {"version":3,"names":["BaseProps","BaseNumberProps","constructor","arguments","_defineProperty","undefined"],"sources":["basenumber.props.ts"],"sourcesContent":["import {AccessibilityRole} from \"react-native\";\nimport { BaseProps } from '@wavemaker/app-rn-runtime/core/base.component';\n\nexport default class BaseNumberProps extends BaseProps {\n datavalue: any;\n minvalue: number = null as any;\n maxvalue: number = null as any;\n step: number = 1;\n updateon: string = 'blur' as any;\n readonly: boolean = null as any;\n regexp: string = null as any;\n onFieldChange: any;\n required: boolean = false;\n triggerValidation: any;\n decimalPlaces: number = 2;\n accessibilitylabel?: string = undefined;\n hint?: string = undefined;\n accessibilityrole?: AccessibilityRole = \"none\";\n accessibilitylabelledby?: string = undefined;\n}\n"],"mappings":";;;AACA,SAASA,SAAS,QAAQ,+CAA+C;AAEzE,eAAe,MAAMC,eAAe,SAASD,SAAS,CAAC;EAAAE,YAAA;IAAA,SAAAC,SAAA;IAAAC,eAAA;IAAAA,eAAA,mBAElC,IAAI;IAAAA,eAAA,mBACJ,IAAI;IAAAA,eAAA,eACR,CAAC;IAAAA,eAAA,mBACG,MAAM;IAAAA,eAAA,mBACL,IAAI;IAAAA,eAAA,iBACP,IAAI;IAAAA,eAAA;IAAAA,eAAA,mBAED,KAAK;IAAAA,eAAA;IAAAA,eAAA,wBAED,CAAC;IAAAA,eAAA,6BACKC,SAAS;IAAAD,eAAA,eACvBC,SAAS;IAAAD,eAAA,4BACe,MAAM;IAAAA,eAAA,kCACXC,SAAS;EAAA;AAC9C"}
@@ -4,11 +4,12 @@ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typ
4
4
  function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
5
5
  import React from 'react';
6
6
  import { Text, TouchableOpacity } from 'react-native';
7
- import { Checkbox } from 'react-native-paper';
8
7
  import { BaseComponent, BaseComponentState } from '@wavemaker/app-rn-runtime/core/base.component';
8
+ import WmIcon from '@wavemaker/app-rn-runtime/components/basic/icon/icon.component';
9
9
  import { unStringify, validateField } from '@wavemaker/app-rn-runtime/core/utils';
10
10
  import WmCheckboxProps from './checkbox.props';
11
11
  import { DEFAULT_CLASS } from './checkbox.styles';
12
+ import { AccessibilityWidgetType, getAccessibilityProps } from '@wavemaker/app-rn-runtime/core/accessibility';
12
13
  export class WmCheckboxState extends BaseComponentState {
13
14
  constructor() {
14
15
  super(...arguments);
@@ -83,12 +84,18 @@ export default class WmCheckbox extends BaseComponent {
83
84
  return /*#__PURE__*/React.createElement(TouchableOpacity, _extends({}, this.getTestPropsForAction(), {
84
85
  style: this.styles.root,
85
86
  onPress: this.onPress.bind(this)
86
- }), this._background, /*#__PURE__*/React.createElement(Checkbox.Android, {
87
- status: this.state.isChecked ? 'checked' : 'unchecked',
88
- color: this.styles.text.color,
87
+ }, getAccessibilityProps(AccessibilityWidgetType.CHECKBOX, {
88
+ ...props,
89
+ checked: this.state.isChecked
90
+ }), {
91
+ accessibilityRole: "checkbox",
92
+ accessibilityLabel: `Checkbox for ${props.caption}`
93
+ }), this._background, /*#__PURE__*/React.createElement(WmIcon, {
94
+ iconclass: "wi wi-check",
95
+ styles: this.state.isChecked ? this.styles.checkicon : this.styles.uncheckicon,
89
96
  disabled: props.readonly || props.disabled
90
97
  }), /*#__PURE__*/React.createElement(Text, _extends({}, this.getTestPropsForLabel(), {
91
- style: this.styles.checkboxLabel
98
+ style: this.styles.text
92
99
  }), props.caption));
93
100
  }
94
101
  }