@wavemaker/app-rn-runtime 11.7.0-next.24863 → 11.7.0-next.26328

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (288) hide show
  1. app-rn-runtime/components/advanced/carousel/carousel.component.js +6 -3
  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 +6 -3
  6. app-rn-runtime/components/advanced/webview/webview.component.js.map +1 -1
  7. app-rn-runtime/components/advanced/webview/webview.props.js +3 -0
  8. app-rn-runtime/components/advanced/webview/webview.props.js.map +1 -1
  9. app-rn-runtime/components/basic/anchor/anchor.component.js +23 -7
  10. app-rn-runtime/components/basic/anchor/anchor.component.js.map +1 -1
  11. app-rn-runtime/components/basic/anchor/anchor.props.js +8 -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 +32 -9
  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 -9
  22. app-rn-runtime/components/basic/button/button.styles.js.map +1 -1
  23. app-rn-runtime/components/basic/buttongroup/buttongroup.styles.js +8 -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/label/label.component.js +21 -11
  30. app-rn-runtime/components/basic/label/label.component.js.map +1 -1
  31. app-rn-runtime/components/basic/label/label.props.js +4 -0
  32. app-rn-runtime/components/basic/label/label.props.js.map +1 -1
  33. app-rn-runtime/components/basic/label/label.styles.js +3 -1
  34. app-rn-runtime/components/basic/label/label.styles.js.map +1 -1
  35. app-rn-runtime/components/basic/message/message.component.js +3 -2
  36. app-rn-runtime/components/basic/message/message.component.js.map +1 -1
  37. app-rn-runtime/components/basic/message/message.props.js +3 -0
  38. app-rn-runtime/components/basic/message/message.props.js.map +1 -1
  39. app-rn-runtime/components/basic/message/message.styles.js +3 -1
  40. app-rn-runtime/components/basic/message/message.styles.js.map +1 -1
  41. app-rn-runtime/components/basic/picture/picture.component.js +4 -2
  42. app-rn-runtime/components/basic/picture/picture.component.js.map +1 -1
  43. app-rn-runtime/components/basic/picture/picture.props.js +3 -0
  44. app-rn-runtime/components/basic/picture/picture.props.js.map +1 -1
  45. app-rn-runtime/components/basic/picture/picture.styles.js +3 -1
  46. app-rn-runtime/components/basic/picture/picture.styles.js.map +1 -1
  47. app-rn-runtime/components/basic/progress-bar/progress-bar.component.js +3 -3
  48. app-rn-runtime/components/basic/progress-bar/progress-bar.component.js.map +1 -1
  49. app-rn-runtime/components/basic/progress-bar/progress-bar.props.js +2 -0
  50. app-rn-runtime/components/basic/progress-bar/progress-bar.props.js.map +1 -1
  51. app-rn-runtime/components/basic/progress-circle/progress-circle.component.js +3 -2
  52. app-rn-runtime/components/basic/progress-circle/progress-circle.component.js.map +1 -1
  53. app-rn-runtime/components/basic/progress-circle/progress-circle.props.js +2 -0
  54. app-rn-runtime/components/basic/progress-circle/progress-circle.props.js.map +1 -1
  55. app-rn-runtime/components/basic/search/search.component.js +10 -3
  56. app-rn-runtime/components/basic/search/search.component.js.map +1 -1
  57. app-rn-runtime/components/basic/search/search.props.js +4 -0
  58. app-rn-runtime/components/basic/search/search.props.js.map +1 -1
  59. app-rn-runtime/components/basic/search/search.styles.js +6 -5
  60. app-rn-runtime/components/basic/search/search.styles.js.map +1 -1
  61. app-rn-runtime/components/basic/skeleton/skeleton.component.js +0 -1
  62. app-rn-runtime/components/basic/skeleton/skeleton.component.js.map +1 -1
  63. app-rn-runtime/components/basic/video/video.component.js +4 -2
  64. app-rn-runtime/components/basic/video/video.component.js.map +1 -1
  65. app-rn-runtime/components/basic/video/video.props.js +3 -0
  66. app-rn-runtime/components/basic/video/video.props.js.map +1 -1
  67. app-rn-runtime/components/chart/area-chart/area-chart.component.js +32 -22
  68. app-rn-runtime/components/chart/area-chart/area-chart.component.js.map +1 -1
  69. app-rn-runtime/components/chart/bar-chart/bar-chart.component.js +22 -15
  70. app-rn-runtime/components/chart/bar-chart/bar-chart.component.js.map +1 -1
  71. app-rn-runtime/components/chart/basechart.component.js +15 -1
  72. app-rn-runtime/components/chart/basechart.component.js.map +1 -1
  73. app-rn-runtime/components/chart/basechart.props.js +3 -0
  74. app-rn-runtime/components/chart/basechart.props.js.map +1 -1
  75. app-rn-runtime/components/chart/basechart.styles.js +2 -1
  76. app-rn-runtime/components/chart/basechart.styles.js.map +1 -1
  77. app-rn-runtime/components/chart/bubble-chart/bubble-chart.component.js +4 -2
  78. app-rn-runtime/components/chart/bubble-chart/bubble-chart.component.js.map +1 -1
  79. app-rn-runtime/components/chart/line-chart/line-chart.component.js +25 -18
  80. app-rn-runtime/components/chart/line-chart/line-chart.component.js.map +1 -1
  81. app-rn-runtime/components/chart/line-chart/line-chart.props.js.map +1 -1
  82. app-rn-runtime/components/chart/pie-chart/pie-chart.component.js +6 -3
  83. app-rn-runtime/components/chart/pie-chart/pie-chart.component.js.map +1 -1
  84. app-rn-runtime/components/chart/stack-chart/stack-chart.component.js +21 -12
  85. app-rn-runtime/components/chart/stack-chart/stack-chart.component.js.map +1 -1
  86. app-rn-runtime/components/chart/staticdata.js +215 -0
  87. app-rn-runtime/components/chart/staticdata.js.map +1 -0
  88. app-rn-runtime/components/container/container.component.js +1 -10
  89. app-rn-runtime/components/container/container.component.js.map +1 -1
  90. app-rn-runtime/components/container/container.props.js +0 -1
  91. app-rn-runtime/components/container/container.props.js.map +1 -1
  92. app-rn-runtime/components/container/panel/panel.component.js +6 -2
  93. app-rn-runtime/components/container/panel/panel.component.js.map +1 -1
  94. app-rn-runtime/components/container/panel/panel.props.js +4 -0
  95. app-rn-runtime/components/container/panel/panel.props.js.map +1 -1
  96. app-rn-runtime/components/container/tabs/tabheader/tabheader.component.js +1 -1
  97. app-rn-runtime/components/container/tabs/tabheader/tabheader.component.js.map +1 -1
  98. app-rn-runtime/components/container/tabs/tabheader/tabheader.styles.js +1 -1
  99. app-rn-runtime/components/container/tabs/tabheader/tabheader.styles.js.map +1 -1
  100. app-rn-runtime/components/container/tabs/tabpane/tabpane.component.js +14 -1
  101. app-rn-runtime/components/container/tabs/tabpane/tabpane.component.js.map +1 -1
  102. app-rn-runtime/components/container/tabs/tabs.component.js +3 -0
  103. app-rn-runtime/components/container/tabs/tabs.component.js.map +1 -1
  104. app-rn-runtime/components/container/wizard/wizard.component.js +6 -6
  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 +17 -11
  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 +3 -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.component.js +1 -0
  117. app-rn-runtime/components/data/form/form-action/form-action.component.js.map +1 -1
  118. app-rn-runtime/components/data/form/form-action/form-action.props.js +1 -0
  119. app-rn-runtime/components/data/form/form-action/form-action.props.js.map +1 -1
  120. app-rn-runtime/components/data/form/form-action/form-action.styles.js +2 -1
  121. app-rn-runtime/components/data/form/form-action/form-action.styles.js.map +1 -1
  122. app-rn-runtime/components/data/form/form-field/form-field.component.js +16 -1
  123. app-rn-runtime/components/data/form/form-field/form-field.component.js.map +1 -1
  124. app-rn-runtime/components/data/form/form-field/form-field.props.js +3 -0
  125. app-rn-runtime/components/data/form/form-field/form-field.props.js.map +1 -1
  126. app-rn-runtime/components/data/form/form.component.js +26 -4
  127. app-rn-runtime/components/data/form/form.component.js.map +1 -1
  128. app-rn-runtime/components/data/form/form.props.js +3 -0
  129. app-rn-runtime/components/data/form/form.props.js.map +1 -1
  130. app-rn-runtime/components/data/list/list.component.js +91 -28
  131. app-rn-runtime/components/data/list/list.component.js.map +1 -1
  132. app-rn-runtime/components/data/list/list.props.js +6 -1
  133. app-rn-runtime/components/data/list/list.props.js.map +1 -1
  134. app-rn-runtime/components/data/list/list.styles.js +13 -0
  135. app-rn-runtime/components/data/list/list.styles.js.map +1 -1
  136. app-rn-runtime/components/device/barcodescanner/barcodescanner.component.js +4 -1
  137. app-rn-runtime/components/device/barcodescanner/barcodescanner.component.js.map +1 -1
  138. app-rn-runtime/components/device/barcodescanner/barcodescanner.props.js +3 -0
  139. app-rn-runtime/components/device/barcodescanner/barcodescanner.props.js.map +1 -1
  140. app-rn-runtime/components/device/barcodescanner/barcodescanner.styles.js +13 -6
  141. app-rn-runtime/components/device/barcodescanner/barcodescanner.styles.js.map +1 -1
  142. app-rn-runtime/components/device/camera/camera.component.js +4 -1
  143. app-rn-runtime/components/device/camera/camera.component.js.map +1 -1
  144. app-rn-runtime/components/device/camera/camera.props.js +3 -0
  145. app-rn-runtime/components/device/camera/camera.props.js.map +1 -1
  146. app-rn-runtime/components/device/camera/camera.styles.js +12 -4
  147. app-rn-runtime/components/device/camera/camera.styles.js.map +1 -1
  148. app-rn-runtime/components/dialogs/alertdialog/alertdialog.component.js +4 -0
  149. app-rn-runtime/components/dialogs/alertdialog/alertdialog.component.js.map +1 -1
  150. app-rn-runtime/components/dialogs/alertdialog/alertdialog.props.js +4 -0
  151. app-rn-runtime/components/dialogs/alertdialog/alertdialog.props.js.map +1 -1
  152. app-rn-runtime/components/dialogs/alertdialog/alertdialog.styles.js +2 -1
  153. app-rn-runtime/components/dialogs/alertdialog/alertdialog.styles.js.map +1 -1
  154. app-rn-runtime/components/dialogs/confirmdialog/confirmdialog.component.js +4 -0
  155. app-rn-runtime/components/dialogs/confirmdialog/confirmdialog.component.js.map +1 -1
  156. app-rn-runtime/components/dialogs/confirmdialog/confirmdialog.props.js +4 -0
  157. app-rn-runtime/components/dialogs/confirmdialog/confirmdialog.props.js.map +1 -1
  158. app-rn-runtime/components/dialogs/dialog/dialog.component.js +7 -3
  159. app-rn-runtime/components/dialogs/dialog/dialog.component.js.map +1 -1
  160. app-rn-runtime/components/dialogs/dialog/dialog.props.js +4 -0
  161. app-rn-runtime/components/dialogs/dialog/dialog.props.js.map +1 -1
  162. app-rn-runtime/components/dialogs/dialog/dialog.styles.js +2 -1
  163. app-rn-runtime/components/dialogs/dialog/dialog.styles.js.map +1 -1
  164. app-rn-runtime/components/dialogs/dialogcontent/dialogcontent.component.js +4 -0
  165. app-rn-runtime/components/dialogs/dialogcontent/dialogcontent.component.js.map +1 -1
  166. app-rn-runtime/components/input/basedataset/basedataset.props.js +4 -0
  167. app-rn-runtime/components/input/basedataset/basedataset.props.js.map +1 -1
  168. app-rn-runtime/components/input/baseinput/baseinput.component.js +3 -3
  169. app-rn-runtime/components/input/baseinput/baseinput.component.js.map +1 -1
  170. app-rn-runtime/components/input/baseinput/baseinput.props.js +6 -0
  171. app-rn-runtime/components/input/baseinput/baseinput.props.js.map +1 -1
  172. app-rn-runtime/components/input/basenumber/basenumber.component.js +6 -6
  173. app-rn-runtime/components/input/basenumber/basenumber.component.js.map +1 -1
  174. app-rn-runtime/components/input/basenumber/basenumber.props.js +4 -0
  175. app-rn-runtime/components/input/basenumber/basenumber.props.js.map +1 -1
  176. app-rn-runtime/components/input/checkbox/checkbox.component.js +12 -5
  177. app-rn-runtime/components/input/checkbox/checkbox.component.js.map +1 -1
  178. app-rn-runtime/components/input/checkbox/checkbox.styles.js +35 -5
  179. app-rn-runtime/components/input/checkbox/checkbox.styles.js.map +1 -1
  180. app-rn-runtime/components/input/checkboxset/checkboxset.component.js +26 -10
  181. app-rn-runtime/components/input/checkboxset/checkboxset.component.js.map +1 -1
  182. app-rn-runtime/components/input/checkboxset/checkboxset.props.js +1 -0
  183. app-rn-runtime/components/input/checkboxset/checkboxset.props.js.map +1 -1
  184. app-rn-runtime/components/input/checkboxset/checkboxset.styles.js +39 -10
  185. app-rn-runtime/components/input/checkboxset/checkboxset.styles.js.map +1 -1
  186. app-rn-runtime/components/input/chips/chips.component.js +5 -1
  187. app-rn-runtime/components/input/chips/chips.component.js.map +1 -1
  188. app-rn-runtime/components/input/currency/currency.component.js +2 -2
  189. app-rn-runtime/components/input/currency/currency.component.js.map +1 -1
  190. app-rn-runtime/components/input/epoch/base-datetime.component.js +64 -6
  191. app-rn-runtime/components/input/epoch/base-datetime.component.js.map +1 -1
  192. app-rn-runtime/components/input/epoch/datetime/datetime.props.js +4 -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 +28 -0
  195. app-rn-runtime/components/input/epoch/datetime/datetime.styles.js.map +1 -1
  196. app-rn-runtime/components/input/fileupload/fileupload.component.js +2 -0
  197. app-rn-runtime/components/input/fileupload/fileupload.component.js.map +1 -1
  198. app-rn-runtime/components/input/fileupload/fileupload.props.js +2 -0
  199. app-rn-runtime/components/input/fileupload/fileupload.props.js.map +1 -1
  200. app-rn-runtime/components/input/fileupload/fileupload.styles.js +1 -1
  201. app-rn-runtime/components/input/fileupload/fileupload.styles.js.map +1 -1
  202. app-rn-runtime/components/input/number/number.component.js +2 -2
  203. app-rn-runtime/components/input/number/number.component.js.map +1 -1
  204. app-rn-runtime/components/input/radioset/radioset.component.js +52 -21
  205. app-rn-runtime/components/input/radioset/radioset.component.js.map +1 -1
  206. app-rn-runtime/components/input/radioset/radioset.props.js +1 -0
  207. app-rn-runtime/components/input/radioset/radioset.props.js.map +1 -1
  208. app-rn-runtime/components/input/radioset/radioset.styles.js +35 -2
  209. app-rn-runtime/components/input/radioset/radioset.styles.js.map +1 -1
  210. app-rn-runtime/components/input/select/select.component.js +7 -3
  211. app-rn-runtime/components/input/select/select.component.js.map +1 -1
  212. app-rn-runtime/components/input/select/select.styles.js +5 -1
  213. app-rn-runtime/components/input/select/select.styles.js.map +1 -1
  214. app-rn-runtime/components/input/slider/slider.component.js +3 -2
  215. app-rn-runtime/components/input/slider/slider.component.js.map +1 -1
  216. app-rn-runtime/components/input/switch/switch.component.js +5 -1
  217. app-rn-runtime/components/input/switch/switch.component.js.map +1 -1
  218. app-rn-runtime/components/input/switch/switch.styles.js +2 -0
  219. app-rn-runtime/components/input/switch/switch.styles.js.map +1 -1
  220. app-rn-runtime/components/input/text/text.component.js +6 -3
  221. app-rn-runtime/components/input/text/text.component.js.map +1 -1
  222. app-rn-runtime/components/input/textarea/textarea.component.js +2 -1
  223. app-rn-runtime/components/input/textarea/textarea.component.js.map +1 -1
  224. app-rn-runtime/components/input/toggle/toggle.component.js +11 -5
  225. app-rn-runtime/components/input/toggle/toggle.component.js.map +1 -1
  226. app-rn-runtime/components/input/toggle/toggle.props.js +4 -0
  227. app-rn-runtime/components/input/toggle/toggle.props.js.map +1 -1
  228. app-rn-runtime/components/navigation/appnavbar/appnavbar.component.js +6 -1
  229. app-rn-runtime/components/navigation/appnavbar/appnavbar.component.js.map +1 -1
  230. app-rn-runtime/components/navigation/appnavbar/appnavbar.props.js +1 -0
  231. app-rn-runtime/components/navigation/appnavbar/appnavbar.props.js.map +1 -1
  232. app-rn-runtime/components/navigation/appnavbar/appnavbar.styles.js +11 -2
  233. app-rn-runtime/components/navigation/appnavbar/appnavbar.styles.js.map +1 -1
  234. app-rn-runtime/components/navigation/basenav/basenav.component.js +1 -2
  235. app-rn-runtime/components/navigation/basenav/basenav.component.js.map +1 -1
  236. app-rn-runtime/components/navigation/menu/menu.styles.js +8 -5
  237. app-rn-runtime/components/navigation/menu/menu.styles.js.map +1 -1
  238. app-rn-runtime/components/navigation/navitem/navitem.component.js +8 -5
  239. app-rn-runtime/components/navigation/navitem/navitem.component.js.map +1 -1
  240. app-rn-runtime/components/navigation/navitem/navitem.props.js +3 -0
  241. app-rn-runtime/components/navigation/navitem/navitem.props.js.map +1 -1
  242. app-rn-runtime/components/navigation/popover/popover.component.js +14 -3
  243. app-rn-runtime/components/navigation/popover/popover.component.js.map +1 -1
  244. app-rn-runtime/components/navigation/popover/popover.props.js +7 -0
  245. app-rn-runtime/components/navigation/popover/popover.props.js.map +1 -1
  246. app-rn-runtime/components/navigation/popover/popover.styles.js +8 -2
  247. app-rn-runtime/components/navigation/popover/popover.styles.js.map +1 -1
  248. app-rn-runtime/components/page/left-panel/left-panel.component.js +4 -0
  249. app-rn-runtime/components/page/left-panel/left-panel.component.js.map +1 -1
  250. app-rn-runtime/components/page/page-content/page-content.component.js +7 -1
  251. app-rn-runtime/components/page/page-content/page-content.component.js.map +1 -1
  252. app-rn-runtime/components/page/tabbar/tabbar.component.js +4 -4
  253. app-rn-runtime/components/page/tabbar/tabbar.component.js.map +1 -1
  254. app-rn-runtime/components/page/tabbar/tabbar.styles.js +30 -16
  255. app-rn-runtime/components/page/tabbar/tabbar.styles.js.map +1 -1
  256. app-rn-runtime/core/accessibility.js +149 -0
  257. app-rn-runtime/core/accessibility.js.map +1 -0
  258. app-rn-runtime/core/base.component.js +28 -5
  259. app-rn-runtime/core/base.component.js.map +1 -1
  260. app-rn-runtime/core/components/textinput.component.js +147 -14
  261. app-rn-runtime/core/components/textinput.component.js.map +1 -1
  262. app-rn-runtime/core/event-notifier.js +37 -2
  263. app-rn-runtime/core/event-notifier.js.map +1 -1
  264. app-rn-runtime/core/formatters.js +14 -1
  265. app-rn-runtime/core/formatters.js.map +1 -1
  266. app-rn-runtime/core/tappable.component.js +2 -2
  267. app-rn-runtime/core/tappable.component.js.map +1 -1
  268. app-rn-runtime/core/utils.js +11 -0
  269. app-rn-runtime/core/utils.js.map +1 -1
  270. app-rn-runtime/gestures/swipe.animation.js +34 -1
  271. app-rn-runtime/gestures/swipe.animation.js.map +1 -1
  272. app-rn-runtime/package.json +4 -3
  273. app-rn-runtime/runtime/App.js +17 -10
  274. app-rn-runtime/runtime/App.js.map +1 -1
  275. app-rn-runtime/runtime/base-fragment.component.js +5 -1
  276. app-rn-runtime/runtime/base-fragment.component.js.map +1 -1
  277. app-rn-runtime/runtime/base-page.component.js +1 -1
  278. app-rn-runtime/runtime/base-page.component.js.map +1 -1
  279. app-rn-runtime/runtime/services/app-security.service.js +2 -1
  280. app-rn-runtime/runtime/services/app-security.service.js.map +1 -1
  281. app-rn-runtime/styles/background.component.js +16 -5
  282. app-rn-runtime/styles/background.component.js.map +1 -1
  283. app-rn-runtime/styles/theme.js +12 -5
  284. app-rn-runtime/styles/theme.js.map +1 -1
  285. app-rn-runtime/styles/theme.variables.js +28 -11
  286. app-rn-runtime/styles/theme.variables.js.map +1 -1
  287. app-rn-runtime/variables/service-variable.js +14 -6
  288. app-rn-runtime/variables/service-variable.js.map +1 -1
@@ -1 +1 @@
1
- {"version":3,"names":["assign","isUndefined","isNil","React","Platform","Animatable","ThemeVariables","StyleProps","getStyleName","BackgroundComponent","injector","ROOT_LOGGER","deepCopy","BASE_THEME","ThemeConsumer","ThemeEvent","EventNotifier","PropsProvider","assignIn","HideMode","AssetConsumer","FixedView","TextIdPrefixConsumer","WIDGET_LOGGER","extend","ParentContext","createContext","BaseComponentState","constructor","_defineProperty","undefined","defineStyles","styles","text","fontFamily","INSTANCE","baseFont","userSelect","BaseProps","arguments","BaseComponent","Component","markupProps","defaultClass","defaultProps","defaultState","ADD_TO_DOM","createElement","Fragment","I18nService","get","state","propertyProvider","show","name","$new","$old","debug","props","initialized","styleName","styleOverrides","cleanRefresh","onPropertyChange","check","proxy","Proxy","target","prop","receiver","propName","toString","has","Reflect","set","value","updateState","cleanup","push","updateStateTimeouts","forEach","v","clearTimeout","theme","subscribe","CHANGE","forceUpdate","destroyParentListeners","event","fn","notifier","isRTL","i18nService","isRTLLocale","animate","setState","animationId","Date","now","animatableProps","setProp","setPropDefault","setDefault","getDefaultStyles","getStyle","reset","newPartialState","callback","destroyed","stateFn","oldState","oldProps","newState","Object","keys","k","onUpdateState","_this$props$listener","_this$props$listener2","listener","onComponentChange","timeoutId","setTimeout","splice","indexOf","shouldComponentUpdate","nextProps","nextState","nextContext","key","componentDidMount","onComponentInit","componentWillAttach","isFixed","hide","componentWillDetach","componentWillUnmount","onComponentDestroy","f","notify","componentDidUpdate","prevProps","prevState","snapshot","invokeEventCallback","eventName","args","callBack","map","a","apply","e","console","error","isVisible","refresh","renderSkeleton","parentListenerDestroyers","setParent","parent","copyStyles","property","from","to","renderFixedContainer","style","rootStyle","left","top","bottom","right","width","height","root","mergeStyle","addAnimation","renderWidget","n","View","_extends","setBackground","bgStyle","_background","image","backgroundImage","position","backgroundPosition","size","backgroundSize","repeat","backgroundRepeat","resizeMode","backgroundResizeMode","borderRadius","getTestId","suffix","id","testIdPrefix","getTestProps","OS","accessibilityLabel","testID","accessible","getStyleClassName","classname","getTestPropsForInput","getTestPropsForAction","getTestPropsForLabel","getDependenciesFromContext","loadAsset","Consumer","_this$parent","_showSkeleton","showskeleton","Provider","render","hideMode","DONOT_ADD_TO_DOM","selectedLocale","getSelectedLocale","info","disabled","showindevice","d","join","hasOwnProperty","backgroundColor","eleToRender"],"sources":["base.component.tsx"],"sourcesContent":["import { assign, isUndefined, isNil } from 'lodash';\nimport React, { ReactNode } from 'react';\nimport { I18nManager, Platform, TextStyle, ViewStyle } from 'react-native';\nimport * as Application from 'expo-application';\nimport { AnimatableProperties } from 'react-native-animatable';\nimport * as Animatable from 'react-native-animatable';\nimport ThemeVariables from '@wavemaker/app-rn-runtime/styles/theme.variables';\nimport { StyleProps, getStyleName } from '@wavemaker/app-rn-runtime/styles/style-props';\nimport { BackgroundComponent } from '@wavemaker/app-rn-runtime/styles/background.component';\nimport injector from '@wavemaker/app-rn-runtime/core/injector';\nimport { ROOT_LOGGER } from '@wavemaker/app-rn-runtime/core/logger';\nimport { deepCopy, isWebPreviewMode } from '@wavemaker/app-rn-runtime/core/utils';\nimport BASE_THEME, { NamedStyles, AllStyle, ThemeConsumer, ThemeEvent, Theme } from '../styles/theme';\nimport EventNotifier from './event-notifier';\nimport { PropsProvider } from './props.provider';\nimport { assignIn } from 'lodash-es';\nimport { HideMode } from './if.component';\nimport { AssetConsumer } from './asset.provider';\nimport { FixedView } from './fixed-view.component';\nimport { TextIdPrefixConsumer } from './testid.provider';\n\nexport const WIDGET_LOGGER = ROOT_LOGGER.extend('widget');\n\nexport const ParentContext = React.createContext(null as any);\n\nexport class BaseComponentState<T extends BaseProps> {\n public animationId?: number = 0;\n public animatableProps?: AnimatableProperties<ViewStyle> = undefined;\n public props = {} as T;\n public hide? = false;\n}\n\nexport type BaseStyles = NamedStyles<any> & {\n root: AllStyle,\n text: TextStyle & {userSelect?: 'none'| 'text'}\n}\n\nexport function defineStyles<T>(styles: T): T {\n return deepCopy({\n text: {\n fontFamily: ThemeVariables.INSTANCE.baseFont,\n userSelect: 'text'\n }\n }, styles);\n}\n\nexport interface LifecycleListener {\n onComponentChange?: (c: BaseComponent<any, any, any>) => void;\n onComponentInit?: (c: BaseComponent<any, any, any>) => void;\n onComponentDestroy?: (c: BaseComponent<any, any, any>) => void;\n}\n\nexport class BaseProps extends StyleProps {\n id?: string = null as any;\n name?: string = null as any;\n key?: any = null as any;\n disabled? = false;\n show? = true as Boolean | String | Number;\n styles?: any = null;\n classname?: string = null as any;\n listener?: LifecycleListener = null as any;\n showindevice?: ('xs'|'sm'|'md'|'lg'|'xl'|'xxl')[] = null as any;\n showskeleton?: boolean = false;\n}\n\nexport abstract class BaseComponent<T extends BaseProps, S extends BaseComponentState<T>, L extends BaseStyles> extends React.Component<T, S> {\n public styles: L = null as any;\n public hideMode = HideMode.ADD_TO_DOM;\n private propertyProvider: PropsProvider<T>;\n public proxy: BaseComponent<T, S, L>;\n public initialized = false;\n public cleanup = [] as Function[];\n public theme = BASE_THEME;\n public updateStateTimeouts= [] as NodeJS.Timeout[];\n public parent: BaseComponent<any, any, any> = null as any;\n public destroyed = false;\n public _showSkeleton = false;\n public isFixed = false;\n private notifier = new EventNotifier();\n private parentListenerDestroyers = [] as Function[];\n public _background = <></>;\n private styleOverrides = {} as any;\n public loadAsset: (path: string) => number | string = null as any;\n private i18nService = injector.I18nService.get();\n public testIdPrefix = '';\n\n constructor(markupProps: T, public defaultClass: string, defaultProps?: T, defaultState?: S) {\n super(markupProps);\n this.state = (defaultState || {} as S);\n this.propertyProvider = new PropsProvider<T>(\n assign({show: true}, defaultProps),\n assign({}, markupProps),\n (name: string, $new: any, $old: any) => {\n WIDGET_LOGGER.debug(() => `${this.props.name || this.constructor.name}: ${name} changed from ${$old} to ${$new}`);\n if (this.initialized) {\n const styleName = getStyleName(name);\n if (styleName) {\n if ($new === undefined) {\n delete this.styleOverrides[styleName];\n } else {\n this.styleOverrides[styleName] = $new;\n }\n }\n }\n if (name === 'showskeleton' && this.initialized) {\n this.cleanRefresh();\n }\n this.onPropertyChange(name, $new, $old);\n });\n //@ts-ignore\n this.state.props =this.propertyProvider.get();\n this.propertyProvider.check();\n //@ts-ignore\n this.proxy = (new Proxy(this, {\n get: (target, prop, receiver): any => {\n const propName = prop.toString();\n if (this.propertyProvider.has(propName)) {\n //@ts-ignore\n return this.state.props[propName];\n }\n return Reflect.get(target, prop, receiver);\n },\n set: (target: any, prop, value: any): any => {\n const propName = prop.toString();\n if (this.propertyProvider.has(propName)) {\n // @ts-ignore\n const props = {} as any;\n props[propName] = value;\n this.updateState({\n props: props\n } as S);\n return true;\n } else {\n return Reflect.set(target, prop, value);\n }\n }\n }));\n this.cleanup.push(() => {\n this.updateStateTimeouts.forEach(v => clearTimeout(v));\n });\n this.cleanup.push(this.theme.subscribe(ThemeEvent.CHANGE, () => {\n this.forceUpdate();\n }));\n this.cleanup.push(() => {\n this.destroyParentListeners();\n });\n }\n\n public subscribe(event: string, fn: Function) {\n return this.notifier.subscribe(event, fn);\n }\n\n public get isRTL(){\n return this.i18nService.isRTLLocale();\n }\n\n public animate(props: AnimatableProperties<ViewStyle>) {\n this.setState({\n animationId: Date.now(),\n animatableProps: props\n });\n }\n\n setProp(propName: string, value: any) {\n this.propertyProvider.set(propName, value);\n this.updateState({props:{}} as S);\n }\n\n setPropDefault(propName: string, value: any) {\n this.propertyProvider.setDefault(propName, value);\n }\n \n onPropertyChange(name: string, $new: any, $old: any) { \n }\n \n getDefaultStyles() {\n return this.theme.getStyle(this.defaultClass);\n }\n\n reset() {\n\n }\n\n updateState(newPartialState: S, callback?: ()=>void) {\n if (this.destroyed) {\n return;\n }\n const stateFn = (oldState: S) => {\n const oldProps = oldState.props;\n const newState = this.initialized ? assignIn({}, oldState, newPartialState) : assignIn(oldState, newPartialState);\n if (newPartialState.props) {\n Object.keys(newPartialState.props).forEach((k) => {\n //@ts-ignore\n oldProps[k] = newState.props[k];\n });\n newState.props = oldProps;\n }\n return newState;\n };\n const onUpdateState = () => {\n callback && callback();\n this.props.listener?.onComponentChange\n && this.props.listener?.onComponentChange(this);\n }\n if (!this.initialized) {\n this.state = stateFn(this.state);\n onUpdateState();\n } else {\n const timeoutId = setTimeout(() => {\n this.setState(stateFn, onUpdateState);\n this.updateStateTimeouts.splice(this.updateStateTimeouts.indexOf(timeoutId), 1);\n });\n this.updateStateTimeouts.push(timeoutId);\n }\n }\n\n shouldComponentUpdate(nextProps: T, nextState: S, nextContext: any) {\n if (this.propertyProvider.check(nextProps)) {\n return true;\n }\n for(let key in nextState) {\n if(key !== 'props' && (!(key in this.state) || nextState[key] !== this.state[key])) {\n return true;\n }\n }\n\n for(let key in this.state) {\n if(key !== 'props' && (!(key in nextState) || this.state[key] !== nextState[key])) {\n return true;\n }\n }\n return false;\n }\n\n componentDidMount() {\n if (this.props.listener && this.props.listener.onComponentInit) {\n this.props.listener.onComponentInit(this.proxy);\n }\n this.initialized = true;\n }\n\n componentWillAttach() {\n if (this.isFixed) {\n this.setState({hide: false});\n }\n }\n\n componentWillDetach() {\n if (this.isFixed) {\n this.setState({hide: true});\n }\n }\n\n componentWillUnmount() {\n this.destroyed = true;\n if (this.props.listener && this.props.listener.onComponentDestroy) {\n this.props.listener.onComponentDestroy(this.proxy);\n }\n this.cleanup.forEach(f => f && f());\n this.notifier.notify('destroy', []);\n }\n \n componentDidUpdate(prevProps: Readonly<T>, prevState: Readonly<S>, snapshot?: any): void {\n if (this.propertyProvider.check(this.props)) {\n this.forceUpdate();\n }\n }\n\n invokeEventCallback(eventName: string, args: any[]) {\n //@ts-ignore\n const callBack: Function = this.props[eventName];\n args = args && args.map(a => (a === this) ? this.proxy : a)\n if (callBack) {\n try {\n return callBack.apply(this.proxy, args);\n } catch(e) {\n console.error(e);\n }\n }\n }\n\n isVisible() {\n const show = this.state.props.show;\n return show !== false && show !== 'false' && show !== '0' && !isNil(show);\n }\n\n protected abstract renderWidget(props: T): ReactNode;\n\n public refresh() {\n this.forceUpdate();\n }\n\n public cleanRefresh() {\n this.forceUpdate(() => this.notifier.notify('forceUpdate', []));\n }\n \n public renderSkeleton (props: T): ReactNode {\n return null;\n }\n\n public destroyParentListeners() {\n this.parentListenerDestroyers.map(fn => fn());\n }\n\n private setParent(parent: BaseComponent<any, any, any>) {\n if (parent && this.parent !== parent) {\n this.parent = parent;\n this.parentListenerDestroyers = [\n this.parent.subscribe('forceUpdate', () => {\n this.cleanRefresh();\n }),\n this.parent.subscribe('destroy', () => {\n this.destroyParentListeners();\n })\n ];\n }\n }\n\n copyStyles(property: string, from: any, to: any) {\n if (!isUndefined(from[property])) {\n to[property] = from[property];\n }\n }\n\n renderFixedContainer(props: T) {\n const style = {} as ViewStyle;\n const rootStyle = {\n left: 0,\n top: 0,\n bottom: 0,\n right: 0,\n width: \"100%\",\n height: \"100%\"\n } as ViewStyle;\n this.copyStyles('left', this.styles.root, style);\n this.copyStyles('top', this.styles.root, style);\n this.copyStyles('right', this.styles.root, style);\n this.copyStyles('bottom', this.styles.root, style);\n this.copyStyles('width', this.styles.root, style);\n this.copyStyles('height', this.styles.root, style);\n this.styles = this.theme.mergeStyle(this.styles, {root: rootStyle});\n return (<FixedView style={style} theme={this.theme}>{this.addAnimation(this.renderWidget(props))}</FixedView>);\n }\n\n private addAnimation(n: ReactNode) {\n if (!this.state.animatableProps) {\n return n;\n }\n return (<Animatable.View key={this.state.animationId} {...this.state.animatableProps}>{n}</Animatable.View>);\n }\n \n private setBackground() {\n const bgStyle = this.styles.root as any;\n this._background = (\n <BackgroundComponent \n image={bgStyle.backgroundImage}\n position={bgStyle.backgroundPosition}\n size={bgStyle.backgroundSize}\n repeat={bgStyle.backgroundRepeat}\n resizeMode={bgStyle.backgroundResizeMode}\n style={{borderRadius: this.styles.root.borderRadius}}>\n </BackgroundComponent>\n );\n delete (this.styles.root as any)['backgroundImage'];\n delete (this.styles.root as any)['backgroundPosition'];\n delete (this.styles.root as any)['backgroundResizeMode'];\n delete (this.styles.root as any)['backgroundSize'];\n delete (this.styles.root as any)['backgroundRepeat'];\n }\n\n public getTestId(suffix?: string) {\n let id = this.props.id || this.props.name;\n if (this.testIdPrefix) {\n id = this.testIdPrefix + '_' + id;\n }\n if (suffix) {\n id = id + '_' + suffix;\n }\n return id;\n }\n\n public getTestProps(suffix?: string) {\n let id = this.getTestId(suffix);\n if (Platform.OS === 'android' || Platform.OS === 'web') {\n return {\n accessibilityLabel: id,\n testID: id\n };\n }\n return {\n accessible: false,\n testID: id\n };\n }\n\n public getStyleClassName() {\n return this.state.props.classname;\n }\n\n public getTestPropsForInput(suffix?: string) {\n return this.getTestProps(suffix || 'i');\n }\n\n public getTestPropsForAction(suffix?: string) {\n return this.getTestProps(suffix || 'a');\n }\n\n public getTestPropsForLabel(suffix?: string) {\n return this.getTestProps(suffix || 'l');\n }\n\n private getDependenciesFromContext(fn: () => ReactNode) {\n return (\n <TextIdPrefixConsumer>\n {(testIdPrefix) => {\n this.testIdPrefix = testIdPrefix || '';\n return (<AssetConsumer>\n {(loadAsset) => {\n this.loadAsset = loadAsset;\n return (<ParentContext.Consumer>\n {(parent) => {\n this.setParent(parent);\n this._showSkeleton = this.parent?._showSkeleton \n || !!this.state.props.showskeleton;\n return (\n <ParentContext.Provider value={this}>\n <ThemeConsumer>\n {(theme) => { \n this.theme = theme || BASE_THEME;\n return fn();\n }}\n </ThemeConsumer>\n </ParentContext.Provider>);\n }} \n </ParentContext.Consumer>);\n }}\n </AssetConsumer>);\n }}\n </TextIdPrefixConsumer>); \n }\n \n public render(): ReactNode {\n const props = this.state.props;\n if (this.state.hide || (!this.isVisible() && this.hideMode === HideMode.DONOT_ADD_TO_DOM)) {\n return null;\n }\n this.isFixed = false;\n const selectedLocale = this.i18nService.getSelectedLocale();\n return this.getDependenciesFromContext(() => {\n WIDGET_LOGGER.info(() => `${this.props.name || this.constructor.name} is rendering.`);\n const classname = this.getStyleClassName();\n this.styles = this.theme.mergeStyle(\n this.getDefaultStyles(),\n {text: this.theme.getStyle('app-' + selectedLocale)},\n {text: this.theme.getStyle(this.defaultClass + '-' + selectedLocale)},\n props.disabled ? this.theme.getStyle(this.defaultClass + '-disabled') : null,\n this.isRTL ? this.theme.getStyle(this.defaultClass + '-rtl') : null,\n classname && this.theme.getStyle(classname),\n props.showindevice && this.theme.getStyle('d-all-none ' + props.showindevice.map(d => `d-${d}-flex`).join(' ')),\n this.props.styles,\n {\n root: this.styleOverrides,\n text: this.styleOverrides\n });\n if (this.styles.root.hasOwnProperty('_background')) {\n delete this.styles.root.backgroundColor;\n }\n if (!this.isVisible()) {\n assign(this.styles, this.theme.getStyle('hidden'))\n }\n let eleToRender = (this._showSkeleton && this.renderSkeleton(props));\n if (eleToRender) {\n return eleToRender;\n }\n this.setBackground();\n this.isFixed = (this.styles.root.position as any) === 'fixed';\n if (this.isFixed) {\n this.styles.root.position = undefined;\n return this.renderFixedContainer(props);\n }\n return this.addAnimation(this.renderWidget(this.state.props)); \n });\n }\n}\n"],"mappings":";;;;AAAA,SAASA,MAAM,EAAEC,WAAW,EAAEC,KAAK,QAAQ,QAAQ;AACnD,OAAOC,KAAK,MAAqB,OAAO;AACxC,SAAsBC,QAAQ,QAA8B,cAAc;AAG1E,OAAO,KAAKC,UAAU,MAAM,yBAAyB;AACrD,OAAOC,cAAc,MAAM,kDAAkD;AAC7E,SAASC,UAAU,EAAEC,YAAY,QAAQ,8CAA8C;AACvF,SAASC,mBAAmB,QAAQ,uDAAuD;AAC3F,OAAOC,QAAQ,MAAM,yCAAyC;AAC9D,SAASC,WAAW,QAAQ,uCAAuC;AACnE,SAASC,QAAQ,QAA0B,sCAAsC;AACjF,OAAOC,UAAU,IAA2BC,aAAa,EAAEC,UAAU,QAAe,iBAAiB;AACrG,OAAOC,aAAa,MAAM,kBAAkB;AAC5C,SAASC,aAAa,QAAQ,kBAAkB;AAChD,SAASC,QAAQ,QAAQ,WAAW;AACpC,SAASC,QAAQ,QAAQ,gBAAgB;AACzC,SAASC,aAAa,QAAQ,kBAAkB;AAChD,SAASC,SAAS,QAAQ,wBAAwB;AAClD,SAASC,oBAAoB,QAAQ,mBAAmB;AAExD,OAAO,MAAMC,aAAa,GAAGZ,WAAW,CAACa,MAAM,CAAC,QAAQ,CAAC;AAEzD,OAAO,MAAMC,aAAa,gBAAGtB,KAAK,CAACuB,aAAa,CAAC,IAAW,CAAC;AAE7D,OAAO,MAAMC,kBAAkB,CAAsB;EAAAC,YAAA;IAAAC,eAAA,sBACnB,CAAC;IAAAA,eAAA,0BAC4BC,SAAS;IAAAD,eAAA,gB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AAE,IAAI,CAACmD,KAAK,CAACqB,QAAQ,CAAC,QAAQ,CAAC,CAAC;MACtD;MACA,IAAI2H,WAAW,GAAI,IAAI,CAACf,aAAa,IAAI,IAAI,CAACxD,cAAc,CAAClG,KAAK,CAAE;MACpE,IAAIyK,WAAW,EAAE;QACb,OAAOA,WAAW;MACtB;MACA,IAAI,CAAC/C,aAAa,CAAC,CAAC;MACpB,IAAI,CAAC/C,OAAO,GAAI,IAAI,CAACrG,MAAM,CAAC6I,IAAI,CAACY,QAAQ,KAAa,OAAO;MAC7D,IAAI,IAAI,CAACpD,OAAO,EAAE;QACd,IAAI,CAACrG,MAAM,CAAC6I,IAAI,CAACY,QAAQ,GAAI3J,SAAS;QACtC,OAAO,IAAI,CAACsI,oBAAoB,CAAC1G,KAAK,CAAC;MAC3C;MACA,OAAO,IAAI,CAACqH,YAAY,CAAC,IAAI,CAACC,YAAY,CAAC,IAAI,CAAC7H,KAAK,CAACO,KAAK,CAAC,CAAC;IACjE,CAAC,CAAC;EACN;AACJ"}
1
+ {"version":3,"names":["assign","isUndefined","isNil","React","AccessibilityInfo","Platform","Animatable","ThemeVariables","StyleProps","getStyleName","BackgroundComponent","injector","ROOT_LOGGER","deepCopy","BASE_THEME","ThemeConsumer","ThemeEvent","EventNotifier","PropsProvider","assignIn","HideMode","AssetConsumer","FixedView","TextIdPrefixConsumer","isScreenReaderEnabled","WIDGET_LOGGER","extend","ParentContext","createContext","BaseComponentState","constructor","_defineProperty","undefined","defineStyles","styles","text","fontFamily","INSTANCE","baseFont","userSelect","BaseProps","arguments","BaseComponent","Component","markupProps","defaultClass","defaultProps","defaultState","ADD_TO_DOM","createElement","Fragment","I18nService","get","state","notifier","name","props","propertyProvider","show","$new","$old","debug","initialized","styleName","styleOverrides","setTimeout","cleanRefresh","onPropertyChange","_showView","deferload","check","proxy","Proxy","target","prop","receiver","propName","toString","has","Reflect","set","value","updateState","cleanup","push","updateStateTimeouts","forEach","v","clearTimeout","theme","subscribe","CHANGE","forceUpdate","addEventListener","remove","destroyParentListeners","event","fn","notify","args","isRTL","i18nService","isRTLLocale","animate","setState","animationId","Date","now","animatableProps","setProp","setPropDefault","setDefault","getDefaultStyles","getStyle","reset","newPartialState","callback","destroyed","stateFn","oldState","oldProps","newState","Object","keys","k","onUpdateState","_this$props$listener","_this$props$listener2","listener","onComponentChange","timeoutId","splice","indexOf","shouldComponentUpdate","nextProps","nextState","nextContext","key","componentDidMount","onComponentInit","componentWillAttach","isFixed","hide","componentWillDetach","componentWillUnmount","onComponentDestroy","f","destroy","componentDidUpdate","prevProps","prevState","snapshot","invokeEventCallback","eventName","callBack","map","a","apply","e","console","error","showView","isVisible","refresh","renderSkeleton","parentListenerDestroyers","setParent","parent","copyStyles","property","from","to","renderFixedContainer","style","rootStyle","left","top","bottom","right","width","height","root","mergeStyle","addAnimation","renderWidget","n","View","_extends","setBackground","bgStyle","_background","image","backgroundImage","position","backgroundPosition","size","backgroundSize","repeat","backgroundRepeat","resizeMode","backgroundResizeMode","borderRadius","getTestId","suffix","id","testIdPrefix","getTestProps","OS","accessibilityLabel","testID","accessible","getStyleClassName","classname","getTestPropsForInput","getTestPropsForAction","getTestPropsForLabel","getDependenciesFromContext","loadAsset","Consumer","_this$parent","_showSkeleton","showskeleton","Provider","render","selectedLocale","getSelectedLocale","info","hideMode","DONOT_ADD_TO_DOM","disabled","showindevice","d","join","hasOwnProperty","backgroundColor","eleToRender"],"sources":["base.component.tsx"],"sourcesContent":["import { assign, isUndefined, isNil } from 'lodash';\nimport React, { ReactNode } from 'react';\nimport { AccessibilityInfo, Platform, TextStyle, ViewStyle } from 'react-native';\nimport { AnimatableProperties } from 'react-native-animatable';\nimport * as Animatable from 'react-native-animatable';\nimport ThemeVariables from '@wavemaker/app-rn-runtime/styles/theme.variables';\nimport { StyleProps, getStyleName } from '@wavemaker/app-rn-runtime/styles/style-props';\nimport { BackgroundComponent } from '@wavemaker/app-rn-runtime/styles/background.component';\nimport injector from '@wavemaker/app-rn-runtime/core/injector';\nimport { ROOT_LOGGER } from '@wavemaker/app-rn-runtime/core/logger';\nimport { deepCopy } from '@wavemaker/app-rn-runtime/core/utils';\nimport BASE_THEME, { NamedStyles, AllStyle, ThemeConsumer, ThemeEvent, Theme } from '../styles/theme';\nimport EventNotifier from './event-notifier';\nimport { PropsProvider } from './props.provider';\nimport { assignIn } from 'lodash-es';\nimport { HideMode } from './if.component';\nimport { AssetConsumer } from './asset.provider';\nimport { FixedView } from './fixed-view.component';\nimport { TextIdPrefixConsumer } from './testid.provider';\nimport { isScreenReaderEnabled } from './accessibility';\n\nexport const WIDGET_LOGGER = ROOT_LOGGER.extend('widget');\n\nexport const ParentContext = React.createContext(null as any);\n\nexport class BaseComponentState<T extends BaseProps> {\n public animationId?: number = 0;\n public animatableProps?: AnimatableProperties<ViewStyle> = undefined;\n public props = {} as T;\n public hide? = false;\n}\n\nexport type BaseStyles = NamedStyles<any> & {\n root: AllStyle,\n text: TextStyle & {userSelect?: 'none'| 'text'}\n}\n\nexport function defineStyles<T>(styles: T): T {\n return deepCopy({\n text: {\n fontFamily: ThemeVariables.INSTANCE.baseFont,\n userSelect: 'text'\n }\n }, styles);\n}\n\nexport interface LifecycleListener {\n onComponentChange?: (c: BaseComponent<any, any, any>) => void;\n onComponentInit?: (c: BaseComponent<any, any, any>) => void;\n onComponentDestroy?: (c: BaseComponent<any, any, any>) => void;\n}\n\nexport class BaseProps extends StyleProps {\n id?: string = null as any;\n name?: string = null as any;\n key?: any = null as any;\n disabled? = false;\n show? = true as Boolean | String | Number;\n styles?: any = null;\n classname?: string = null as any;\n listener?: LifecycleListener = null as any;\n showindevice?: ('xs'|'sm'|'md'|'lg'|'xl'|'xxl')[] = null as any;\n showskeleton?: boolean = false;\n deferload?: boolean = false;\n}\n\nexport abstract class BaseComponent<T extends BaseProps, S extends BaseComponentState<T>, L extends BaseStyles> extends React.Component<T, S> {\n public styles: L = null as any;\n public hideMode = HideMode.ADD_TO_DOM;\n private propertyProvider: PropsProvider<T>;\n public proxy: BaseComponent<T, S, L>;\n public initialized = false;\n public cleanup = [] as Function[];\n public theme = BASE_THEME;\n public updateStateTimeouts= [] as NodeJS.Timeout[];\n public parent: BaseComponent<any, any, any> = null as any;\n public destroyed = false;\n public _showSkeleton = false;\n public isFixed = false;\n private notifier = new EventNotifier();\n private parentListenerDestroyers = [] as Function[];\n public _background = <></>;\n private styleOverrides = {} as any;\n public loadAsset: (path: string) => number | string = null as any;\n private i18nService = injector.I18nService.get();\n public testIdPrefix = '';\n private _showView = true;\n\n constructor(markupProps: T, public defaultClass: string, defaultProps?: T, defaultState?: S) {\n super(markupProps);\n this.state = (defaultState || {} as S);\n this.notifier.name = this.props.name || '';\n this.propertyProvider = new PropsProvider<T>(\n assign({show: true}, defaultProps),\n assign({}, markupProps),\n (name: string, $new: any, $old: any) => {\n WIDGET_LOGGER.debug(() => `${this.props.name || this.constructor.name}: ${name} changed from ${$old} to ${$new}`);\n if (this.initialized) {\n const styleName = getStyleName(name);\n if (styleName) {\n if ($new === undefined) {\n delete this.styleOverrides[styleName];\n } else {\n this.styleOverrides[styleName] = $new;\n }\n }\n }\n if (name === 'showskeleton' && this.initialized) {\n setTimeout(() => this.cleanRefresh(), 100);\n }\n this.onPropertyChange(name, $new, $old);\n });\n //@ts-ignore\n this.state.props =this.propertyProvider.get();\n //@ts-ignore\n this._showView = !this.props.deferload;\n this.propertyProvider.check();\n //@ts-ignore\n this.proxy = (new Proxy(this, {\n get: (target, prop, receiver): any => {\n const propName = prop.toString();\n if (this.propertyProvider.has(propName)) {\n //@ts-ignore\n return this.state.props[propName];\n }\n return Reflect.get(target, prop, receiver);\n },\n set: (target: any, prop, value: any): any => {\n const propName = prop.toString();\n if (this.propertyProvider.has(propName)) {\n // @ts-ignore\n const props = {} as any;\n props[propName] = value;\n this.updateState({\n props: props\n } as S);\n return true;\n } else {\n return Reflect.set(target, prop, value);\n }\n }\n }));\n this.cleanup.push(() => {\n this.updateStateTimeouts.forEach(v => clearTimeout(v));\n });\n this.cleanup.push(this.theme.subscribe(ThemeEvent.CHANGE, () => {\n this.forceUpdate();\n }));\n this.cleanup.push(AccessibilityInfo.addEventListener('screenReaderChanged',\n () => {\n setTimeout(() => {\n this.forceUpdate();\n }, 100);\n },\n ).remove);\n this.cleanup.push(() => {\n this.destroyParentListeners();\n });\n }\n\n public subscribe(event: string, fn: Function) {\n return this.notifier.subscribe(event, fn);\n }\n\n public notify(event: string, args: any[]) {\n return this.notifier.notify(event, args);\n }\n\n public get isRTL(){\n return this.i18nService.isRTLLocale();\n }\n\n public animate(props: AnimatableProperties<ViewStyle>) {\n this.setState({\n animationId: Date.now(),\n animatableProps: props\n });\n }\n\n setProp(propName: string, value: any) {\n this.propertyProvider.set(propName, value);\n this.updateState({props:{}} as S);\n }\n\n setPropDefault(propName: string, value: any) {\n this.propertyProvider.setDefault(propName, value);\n }\n \n onPropertyChange(name: string, $new: any, $old: any) { \n }\n \n getDefaultStyles() {\n return this.theme.getStyle(this.defaultClass);\n }\n\n reset() {\n\n }\n\n updateState(newPartialState: S, callback?: ()=>void) {\n if (this.destroyed) {\n return;\n }\n const stateFn = (oldState: S) => {\n const oldProps = oldState.props;\n const newState = this.initialized ? assignIn({}, oldState, newPartialState) : assignIn(oldState, newPartialState);\n if (newPartialState.props) {\n Object.keys(newPartialState.props).forEach((k) => {\n //@ts-ignore\n oldProps[k] = newState.props[k];\n });\n newState.props = oldProps;\n }\n return newState;\n };\n const onUpdateState = () => {\n callback && callback();\n this.props.listener?.onComponentChange\n && this.props.listener?.onComponentChange(this);\n }\n if (!this.initialized) {\n this.state = stateFn(this.state);\n onUpdateState();\n } else {\n const timeoutId = setTimeout(() => {\n this.setState(stateFn, onUpdateState);\n this.updateStateTimeouts.splice(this.updateStateTimeouts.indexOf(timeoutId), 1);\n });\n this.updateStateTimeouts.push(timeoutId);\n }\n }\n\n shouldComponentUpdate(nextProps: T, nextState: S, nextContext: any) {\n if (this.propertyProvider.check(nextProps)) {\n return true;\n }\n for(let key in nextState) {\n if(key !== 'props' && (!(key in this.state) || nextState[key] !== this.state[key])) {\n return true;\n }\n }\n\n for(let key in this.state) {\n if(key !== 'props' && (!(key in nextState) || this.state[key] !== nextState[key])) {\n return true;\n }\n }\n return false;\n }\n\n componentDidMount() {\n if (this.props.listener && this.props.listener.onComponentInit) {\n this.props.listener.onComponentInit(this.proxy);\n }\n this.initialized = true;\n }\n\n componentWillAttach() {\n if (this.isFixed) {\n this.setState({hide: false});\n }\n }\n\n componentWillDetach() {\n if (this.isFixed) {\n this.setState({hide: true});\n }\n }\n\n componentWillUnmount() {\n this.destroyed = true;\n if (this.props.listener && this.props.listener.onComponentDestroy) {\n this.props.listener.onComponentDestroy(this.proxy);\n }\n this.cleanup.forEach(f => f && f());\n this.notifier.destroy();\n this.notifier.notify('destroy', []);\n }\n \n componentDidUpdate(prevProps: Readonly<T>, prevState: Readonly<S>, snapshot?: any): void {\n if (this.propertyProvider.check(this.props)) {\n this.forceUpdate();\n }\n }\n\n invokeEventCallback(eventName: string, args: any[]) {\n //@ts-ignore\n const callBack: Function = this.props[eventName];\n args = args && args.map(a => (a === this) ? this.proxy : a)\n if (callBack) {\n try {\n return callBack.apply(this.proxy, args);\n } catch(e) {\n console.error(e);\n }\n }\n }\n\n showView() {\n return this.isVisible();\n }\n\n isVisible() {\n const show = this.state.props.show;\n return show !== false && show !== 'false' && show !== '0' && !isNil(show);\n }\n\n protected abstract renderWidget(props: T): ReactNode;\n\n public refresh() {\n this.forceUpdate();\n }\n\n public cleanRefresh() {\n this.forceUpdate(() => this.notifier.notify('forceUpdate', []));\n }\n \n public renderSkeleton (props: T): ReactNode {\n return null;\n }\n\n public destroyParentListeners() {\n this.parentListenerDestroyers.map(fn => fn());\n }\n\n private setParent(parent: BaseComponent<any, any, any>) {\n if (parent && this.parent !== parent) {\n this.parent = parent;\n this.notifier.setParent(parent.notifier);\n this.parentListenerDestroyers = [\n this.parent.subscribe('forceUpdate', () => {\n this.cleanRefresh();\n }),\n this.parent.subscribe('destroy', () => {\n this.destroyParentListeners();\n })\n ];\n }\n }\n\n copyStyles(property: string, from: any, to: any) {\n if (!isUndefined(from[property])) {\n to[property] = from[property];\n }\n }\n\n renderFixedContainer(props: T) {\n const style = {} as ViewStyle;\n const rootStyle = {\n left: 0,\n top: 0,\n bottom: 0,\n right: 0,\n width: \"100%\",\n height: \"100%\"\n } as ViewStyle;\n this.copyStyles('left', this.styles.root, style);\n this.copyStyles('top', this.styles.root, style);\n this.copyStyles('right', this.styles.root, style);\n this.copyStyles('bottom', this.styles.root, style);\n this.copyStyles('width', this.styles.root, style);\n this.copyStyles('height', this.styles.root, style);\n this.styles = this.theme.mergeStyle(this.styles, {root: rootStyle});\n return (<FixedView style={style} theme={this.theme}>{this.addAnimation(this.renderWidget(props))}</FixedView>);\n }\n\n private addAnimation(n: ReactNode) {\n if (!this.state.animatableProps) {\n return n;\n }\n return (<Animatable.View key={this.state.animationId} {...this.state.animatableProps}>{n}</Animatable.View>);\n }\n \n private setBackground() {\n const bgStyle = this.styles.root as any;\n this._background = (\n <BackgroundComponent \n image={bgStyle.backgroundImage}\n position={bgStyle.backgroundPosition}\n size={bgStyle.backgroundSize}\n repeat={bgStyle.backgroundRepeat}\n resizeMode={bgStyle.backgroundResizeMode}\n style={{borderRadius: this.styles.root.borderRadius}}>\n </BackgroundComponent>\n );\n delete (this.styles.root as any)['backgroundImage'];\n delete (this.styles.root as any)['backgroundPosition'];\n delete (this.styles.root as any)['backgroundResizeMode'];\n delete (this.styles.root as any)['backgroundSize'];\n delete (this.styles.root as any)['backgroundRepeat'];\n }\n\n public getTestId(suffix?: string) {\n let id = this.props.id || this.props.name;\n if (this.testIdPrefix) {\n id = this.testIdPrefix + '_' + id;\n }\n if (suffix) {\n id = id + '_' + suffix;\n }\n return id;\n }\n\n public getTestProps(suffix?: string) {\n let id = this.getTestId(suffix);\n if (isScreenReaderEnabled()) {\n return {};\n }\n if (Platform.OS === 'android' || Platform.OS === 'web') {\n return {\n accessibilityLabel: id,\n testID: id\n };\n }\n return {\n accessible: false,\n testID: id\n };\n }\n\n public getStyleClassName() {\n return this.state.props.classname;\n }\n\n public getTestPropsForInput(suffix?: string) {\n return this.getTestProps(suffix || 'i');\n }\n\n public getTestPropsForAction(suffix?: string) {\n return this.getTestProps(suffix || 'a');\n }\n\n public getTestPropsForLabel(suffix?: string) {\n return this.getTestProps(suffix || 'l');\n }\n\n private getDependenciesFromContext(fn: () => ReactNode) {\n return (\n <TextIdPrefixConsumer>\n {(testIdPrefix) => {\n this.testIdPrefix = testIdPrefix || '';\n return (<AssetConsumer>\n {(loadAsset) => {\n this.loadAsset = loadAsset;\n return (<ParentContext.Consumer>\n {(parent) => {\n this.setParent(parent);\n this._showSkeleton = this.parent?._showSkeleton \n || !!this.state.props.showskeleton;\n return (\n <ParentContext.Provider value={this}>\n <ThemeConsumer>\n {(theme) => { \n this.theme = theme || BASE_THEME;\n return fn();\n }}\n </ThemeConsumer>\n </ParentContext.Provider>);\n }} \n </ParentContext.Consumer>);\n }}\n </AssetConsumer>);\n }}\n </TextIdPrefixConsumer>); \n }\n \n public render(): ReactNode {\n const props = this.state.props;\n this.isFixed = false;\n const selectedLocale = this.i18nService.getSelectedLocale();\n return this.getDependenciesFromContext(() => {\n WIDGET_LOGGER.info(() => `${this.props.name || this.constructor.name} is rendering.`);\n this._showView = this._showView || this.showView();\n if (this.state.hide \n || (!this.isVisible() && this.hideMode === HideMode.DONOT_ADD_TO_DOM)\n || !this._showView) {\n return null;\n }\n const classname = this.getStyleClassName();\n this.styles = this.theme.mergeStyle(\n this.getDefaultStyles(),\n {text: this.theme.getStyle('app-' + selectedLocale)},\n {text: this.theme.getStyle(this.defaultClass + '-' + selectedLocale)},\n props.disabled ? this.theme.getStyle(this.defaultClass + '-disabled') : null,\n this.isRTL ? this.theme.getStyle(this.defaultClass + '-rtl') : null,\n classname && this.theme.getStyle(classname),\n props.showindevice && this.theme.getStyle('d-all-none ' + props.showindevice.map(d => `d-${d}-flex`).join(' ')),\n this.props.styles,\n {\n root: this.styleOverrides,\n text: this.styleOverrides\n });\n if (this.styles.root.hasOwnProperty('_background')) {\n delete this.styles.root.backgroundColor;\n }\n if (!this.isVisible()) {\n assign(this.styles, this.theme.getStyle('hidden'))\n }\n let eleToRender = (this._showSkeleton && this.renderSkeleton(props));\n if (eleToRender) {\n return eleToRender;\n }\n this.setBackground();\n this.isFixed = (this.styles.root.position as any) === 'fixed';\n if (this.isFixed) {\n this.styles.root.position = undefined;\n return this.renderFixedContainer(props);\n }\n return this.addAnimation(this.renderWidget(this.state.props)); \n });\n }\n}\n"],"mappings":";;;;AAAA,SAASA,MAAM,EAAEC,WAAW,EAAEC,KAAK,QAAQ,QAAQ;AACnD,OAAOC,KAAK,MAAqB,OAAO;AACxC,SAASC,iBAAiB,EAAEC,QAAQ,QAA8B,cAAc;AAEhF,OAAO,KAAKC,UAAU,MAAM,yBAAyB;AACrD,OAAOC,cAAc,MAAM,kDAAkD;AAC7E,SAASC,UAAU,EAAEC,YAAY,QAAQ,8CAA8C;AACvF,SAASC,mBAAmB,QAAQ,uDAAuD;AAC3F,OAAOC,QAAQ,MAAM,yCAAyC;AAC9D,SAASC,WAAW,QAAQ,uCAAuC;AACnE,SAASC,QAAQ,QAAQ,sCAAsC;AAC/D,OAAOC,UAAU,IAA2BC,aAAa,EAAEC,UAAU,QAAe,iBAAiB;AACrG,OAAOC,aAAa,MAAM,kBAAkB;AAC5C,SAASC,aAAa,QAAQ,kBAAkB;AAChD,SAASC,QAAQ,QAAQ,WAAW;AACpC,SAASC,QAAQ,QAAQ,gBAAgB;AACzC,SAASC,aAAa,QAAQ,kBAAkB;AAChD,SAASC,SAAS,QAAQ,wBAAwB;AAClD,SAASC,oBAAoB,QAAQ,mBAAmB;AACxD,SAASC,qBAAqB,QAAQ,iBAAiB;AAEvD,OAAO,MAAMC,aAAa,GAAGb,WAAW,CAACc,MAAM,CAAC,QAAQ,CAAC;AAEzD,OAAO,MAAMC,aAAa,gBAAGxB,KAAK,CAACy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W,GAAI,IAAI,CAACf,aAAa,IAAI,IAAI,CAACxD,cAAc,CAAC5G,KAAK,CAAE;MACpE,IAAImL,WAAW,EAAE;QACb,OAAOA,WAAW;MACtB;MACA,IAAI,CAAC/C,aAAa,CAAC,CAAC;MACpB,IAAI,CAAC/C,OAAO,GAAI,IAAI,CAAC3G,MAAM,CAACmJ,IAAI,CAACY,QAAQ,KAAa,OAAO;MAC7D,IAAI,IAAI,CAACpD,OAAO,EAAE;QACd,IAAI,CAAC3G,MAAM,CAACmJ,IAAI,CAACY,QAAQ,GAAIjK,SAAS;QACtC,OAAO,IAAI,CAAC4I,oBAAoB,CAACpH,KAAK,CAAC;MAC3C;MACA,OAAO,IAAI,CAAC+H,YAAY,CAAC,IAAI,CAACC,YAAY,CAAC,IAAI,CAACnI,KAAK,CAACG,KAAK,CAAC,CAAC;IACjE,CAAC,CAAC;EACN;AACJ"}
@@ -1,13 +1,82 @@
1
1
  function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
- import React, { useCallback, useRef, useState } from 'react';
3
- import { Platform, TextInput } from 'react-native';
2
+ import React, { useCallback, useEffect, useRef, useState } from 'react';
3
+ import { Animated, Platform, Text, TextInput, View } from 'react-native';
4
+ import { isArray } from 'lodash';
5
+ import IMask from 'imask';
4
6
  import { FloatingLabel } from './floatinglabel.component';
7
+ const WmCursor = /*#__PURE__*/React.memo(props => {
8
+ const opacityAnimation = useRef(new Animated.Value(0.5)).current;
9
+ const runAnimation = useCallback(() => {
10
+ Animated.timing(opacityAnimation, {
11
+ toValue: 0.2,
12
+ duration: 500,
13
+ useNativeDriver: true
14
+ }).start(() => {
15
+ Animated.timing(opacityAnimation, {
16
+ toValue: 0.6,
17
+ duration: 500,
18
+ useNativeDriver: true
19
+ }).start(runAnimation);
20
+ });
21
+ }, []);
22
+ useEffect(() => {
23
+ runAnimation();
24
+ }, []);
25
+ return /*#__PURE__*/React.createElement(Animated.View, {
26
+ style: {
27
+ backgroundColor: props.color,
28
+ width: 2,
29
+ marginHorizontal: 1,
30
+ height: props.height,
31
+ opacity: opacityAnimation
32
+ }
33
+ });
34
+ });
5
35
  export const WMTextInput = /*#__PURE__*/React.forwardRef((props, ref) => {
6
- var _props$value, _props$defaultValue;
7
36
  const [selectRange, setSelectRange] = useState(null);
8
37
  const [isInputFocused, setIsInputFocused] = useState(false);
38
+ const [iMask, setIMask] = useState(null);
39
+ const [displayCursor, setDisplayCursor] = useState(false);
9
40
  const value = useRef(props.value || '');
10
- const animateLabelText = props.floatingLabel && (Platform.OS === 'web' ? Number((_props$value = props.value) === null || _props$value === void 0 ? void 0 : _props$value.length) > 0 : Number((_props$defaultValue = props.defaultValue) === null || _props$defaultValue === void 0 ? void 0 : _props$defaultValue.length) > 0);
41
+ const [x, forceUpdate] = useState(1);
42
+ const [displayValue, setDisplayValue] = useState('');
43
+ const element = useRef(null);
44
+ // iMask initialization
45
+ useEffect(() => {
46
+ const iMask = props.displayformat ? new IMask.MaskedPattern({
47
+ mask: props.displayformat,
48
+ skipInvalid: true,
49
+ lazy: false,
50
+ definitions: {
51
+ '9': /\d/,
52
+ 'A': /[a-zA-Z]/,
53
+ 'a': /[a-z]/,
54
+ '*': /\w/
55
+ }
56
+ }) : null;
57
+ if (iMask) {
58
+ iMask.typedValue = value;
59
+ setDisplayValue(iMask.displayValue);
60
+ setIMask(iMask);
61
+ }
62
+ }, [props.displayformat]);
63
+ // set default value
64
+ useEffect(() => {
65
+ const defaultValue = props.defaultValue || props.value || '';
66
+ if (!value.current) {
67
+ value.current = defaultValue;
68
+ onChangeText(defaultValue);
69
+ }
70
+ }, [props.defaultValue, props.value]);
71
+ // set cursor position in windows
72
+ useEffect(() => {
73
+ setTimeout(() => {
74
+ if (Platform.OS === 'web' && (props.displayformat || props.maskchar)) {
75
+ var _element$current;
76
+ element === null || element === void 0 || (_element$current = element.current) === null || _element$current === void 0 ? void 0 : _element$current.setSelectionRange(value.current.length, value.current.length);
77
+ }
78
+ }, 100);
79
+ }, [value.current, props]);
11
80
  const onSelectionChange = useCallback(e => {
12
81
  var _e$nativeEvent;
13
82
  if (Platform.OS !== 'android') {
@@ -22,39 +91,103 @@ export const WMTextInput = /*#__PURE__*/React.forwardRef((props, ref) => {
22
91
  } else if (selectRange && selectRange.end > 0) {
23
92
  setSelectRange(null);
24
93
  }
25
- }, [props.allowContentSelection, value.current]);
94
+ }, [props.allowContentSelection, value]);
95
+ // when text changes
26
96
  const onChangeText = useCallback(text => {
27
- value.current = text;
28
- }, []);
97
+ if (!(iMask || props.maskchar)) {
98
+ value.current = text;
99
+ props.onChangeText && props.onChangeText(text);
100
+ return;
101
+ }
102
+ let _value = value.current || '';
103
+ if (value.current.length - text.length > 0) {
104
+ _value = _value.substring(0, _value.length - (value.current.length - text.length));
105
+ } else if (text.length - value.current.length > 0) {
106
+ _value += text.slice(-1 * (text.length - value.current.length));
107
+ }
108
+ let formattedValue = _value;
109
+ if (props.maskchar) {
110
+ formattedValue = _value.replace(/./g, props.maskchar);
111
+ }
112
+ if (iMask) {
113
+ iMask.typedValue = _value;
114
+ formattedValue = iMask.displayValue;
115
+ }
116
+ if (formattedValue !== displayValue) {
117
+ value.current = _value;
118
+ props.onChangeText && props.onChangeText(_value);
119
+ }
120
+ forceUpdate(x + 1);
121
+ setDisplayValue(formattedValue);
122
+ }, [iMask, value, displayValue, props.onChangeText]);
123
+ const valueExpr = Platform.OS === 'web' ? 'value' : 'defaultValue';
124
+ const opts = {};
125
+ opts[valueExpr] = value.current;
126
+ const textStyle = Object.assign({}, ...(isArray(props.style) ? props.style : [props.style]));
127
+ const hideInput = props.displayformat || props.maskchar;
29
128
  return /*#__PURE__*/React.createElement(React.Fragment, null, props.floatingLabel ? /*#__PURE__*/React.createElement(FloatingLabel, {
30
- moveUp: !!(value.current || isInputFocused),
129
+ moveUp: !!(value.current || isInputFocused || displayValue),
31
130
  label: props.floatingLabel ?? props.placeholder,
32
131
  style: {
33
132
  ...(props.floatingLabelStyle || []),
34
133
  ...(isInputFocused ? props.activeFloatingLabelStyle || {} : {})
35
134
  }
36
- }) : null, /*#__PURE__*/React.createElement(TextInput, _extends({}, props, {
37
- placeholder: props.floatingLabel ? '' : props.placeholder,
38
- style: props.style,
135
+ }) : null, /*#__PURE__*/React.createElement(TextInput, _extends({}, props, hideInput ? opts : {}, {
136
+ placeholder: props.floatingLabel || displayValue ? '' : props.placeholder,
137
+ style: [props.style, hideInput ? {
138
+ color: 'transparent',
139
+ backgroundColor: 'transparent',
140
+ borderColor: 'transparent',
141
+ zIndex: 1
142
+ } : {}],
39
143
  onFocus: e => {
40
144
  var _props$onFocus;
41
145
  (_props$onFocus = props.onFocus) === null || _props$onFocus === void 0 ? void 0 : _props$onFocus.call(props, e);
42
146
  setIsInputFocused(true);
147
+ setDisplayCursor(true);
148
+ element.current = e.target;
43
149
  },
44
150
  onBlur: e => {
45
151
  var _props$onBlur;
46
152
  props === null || props === void 0 || (_props$onBlur = props.onBlur) === null || _props$onBlur === void 0 ? void 0 : _props$onBlur.call(props, e);
47
153
  setIsInputFocused(false);
154
+ setDisplayCursor(false);
48
155
  },
49
156
  ref: ref,
50
157
  selection: selectRange,
51
158
  onSelectionChange: onSelectionChange,
52
159
  caretHidden: !!(selectRange !== null && selectRange !== void 0 && selectRange.end),
53
160
  onChangeText: text => {
54
- props.onChangeText && props.onChangeText(text);
55
161
  onChangeText(text);
56
- },
162
+ }
163
+ }, hideInput ? {
164
+ selectionColor: 'transparent',
165
+ cursorColor: 'transparent',
166
+ onChange: () => {}
167
+ } : {}, {
57
168
  contextMenuHidden: !props.allowContentSelection
58
- })));
169
+ })), hideInput ? /*#__PURE__*/React.createElement(View, {
170
+ style: [props.style, {
171
+ display: 'flex',
172
+ flexDirection: 'row',
173
+ alignItems: 'center',
174
+ marginTop: -1 * (textStyle.height || textStyle.minHeight || 0) + (textStyle.marginTop || 0)
175
+ }]
176
+ }, /*#__PURE__*/React.createElement(Text, {
177
+ style: {
178
+ width: undefined,
179
+ backgroundColor: 'transparent',
180
+ borderColor: 'transparent',
181
+ padding: 0,
182
+ display: 'flex',
183
+ color: textStyle.color,
184
+ fontFamily: textStyle.fontFamily,
185
+ fontSize: textStyle.fontSize,
186
+ fontWeight: textStyle.fontWeight
187
+ }
188
+ }, displayValue), displayCursor && !props.displayformat ? /*#__PURE__*/React.createElement(WmCursor, {
189
+ color: textStyle.color || '#000000',
190
+ height: textStyle.fontSize || 14
191
+ }) : null) : null);
59
192
  });
60
193
  //# sourceMappingURL=textinput.component.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["React","useCallback","useRef","useState","Platform","TextInput","FloatingLabel","WMTextInput","forwardRef","props","ref","_props$value","_props$defaultValue","selectRange","setSelectRange","isInputFocused","setIsInputFocused","value","animateLabelText","floatingLabel","OS","Number","length","defaultValue","onSelectionChange","e","_e$nativeEvent","selection","nativeEvent","allowContentSelection","end","start","current","onChangeText","text","createElement","Fragment","moveUp","label","placeholder","style","floatingLabelStyle","activeFloatingLabelStyle","_extends","onFocus","_props$onFocus","call","onBlur","_props$onBlur","caretHidden","contextMenuHidden"],"sources":["textinput.component.tsx"],"sourcesContent":["import React, { ForwardedRef, useCallback, useRef, useState } from 'react';\nimport { Platform, TextInput, TextInputProps, TextStyle } from 'react-native';\nimport { FloatingLabel } from './floatinglabel.component';\n\ninterface SelectRange {\n start: number,\n end: number\n}\n\nexport const WMTextInput = React.forwardRef((props: (TextInputProps & \n {allowContentSelection: boolean, \n floatingLabel: string\n floatingLabelStyle: TextStyle,\n activeFloatingLabelStyle: TextStyle\n }), \n ref: ForwardedRef<TextInput>) => {\n const [selectRange, setSelectRange] = useState<SelectRange>(null as any);\n const [isInputFocused, setIsInputFocused] = useState(false);\n const value = useRef(props.value || '');\n \n const animateLabelText = props.floatingLabel && ( Platform.OS === 'web' ? Number(props.value?.length) > 0 : Number(props.defaultValue?.length) > 0);\n\n const onSelectionChange = useCallback((e: any) => {\n if (Platform.OS !== 'android') {\n return;\n }\n const selection = e?.nativeEvent?.selection;\n if (!props.allowContentSelection\n && selection\n && selection.end - selection.start > 0) {\n setSelectRange({\n start: value.current.length + 2,\n end: value.current.length + 2\n });\n } else if (selectRange && selectRange.end > 0){\n setSelectRange(null as any);\n }\n }, [props.allowContentSelection, value.current]);\n const onChangeText = useCallback((text: string) => {\n value.current = text;\n }, []);\n\n return (\n <>\n {props.floatingLabel ? (\n <FloatingLabel\n moveUp={!!(value.current || isInputFocused)}\n label={props.floatingLabel ?? props.placeholder} \n style={{\n ...(props.floatingLabelStyle || []),\n ...(isInputFocused ? (props.activeFloatingLabelStyle || {}) : {})\n }}/>\n ) : null}\n <TextInput\n {...props}\n placeholder={props.floatingLabel ? '' : props.placeholder }\n style={props.style}\n onFocus={(e) => {\n props.onFocus?.(e);\n setIsInputFocused(true);\n }}\n onBlur={(e) => {\n props?.onBlur?.(e);\n setIsInputFocused(false);\n }}\n ref={ref}\n selection={selectRange}\n onSelectionChange={onSelectionChange}\n caretHidden={!!selectRange?.end}\n onChangeText={(text) => {\n props.onChangeText && props.onChangeText(text);\n onChangeText(text);\n }}\n contextMenuHidden={!props.allowContentSelection}\n ></TextInput>\n </>\n );\n});"],"mappings":";AAAA,OAAOA,KAAK,IAAkBC,WAAW,EAAEC,MAAM,EAAEC,QAAQ,QAAQ,OAAO;AAC1E,SAASC,QAAQ,EAAEC,SAAS,QAAmC,cAAc;AAC7E,SAASC,aAAa,QAAQ,2BAA2B;AAOzD,OAAO,MAAMC,WAAW,gBAAGP,KAAK,CAACQ,UAAU,CAAC,CAACC,KAKzC,EACAC,GAA4B,KAAK;EAAA,IAAAC,YAAA,EAAAC,mBAAA;EACjC,MAAM,CAACC,WAAW,EAAEC,cAAc,CAAC,GAAGX,QAAQ,CAAc,IAAW,CAAC;EACxE,MAAM,CAACY,cAAc,EAAEC,iBAAiB,CAAC,GAAGb,QAAQ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AAY;IACvBW,iBAAiB,EAAEA,iBAAkB;IACrCyB,WAAW,EAAE,CAAC,EAACpC,WAAW,aAAXA,WAAW,eAAXA,WAAW,CAAEiB,GAAG,CAAC;IAChCG,YAAY,EAAGC,IAAI,IAAK;MACtBzB,KAAK,CAACwB,YAAY,IAAIxB,KAAK,CAACwB,YAAY,CAACC,IAAI,CAAC;MAC9CD,YAAY,CAACC,IAAI,CAAC;IACpB,CAAE;IACFgB,iBAAiB,EAAE,CAACzC,KAAK,CAACoB;EAAsB,EACtC,CACZ,CAAC;AAET,CAAC,CAAC"}
1
+ {"version":3,"names":["React","useCallback","useEffect","useRef","useState","Animated","Platform","Text","TextInput","View","isArray","IMask","FloatingLabel","WmCursor","memo","props","opacityAnimation","Value","current","runAnimation","timing","toValue","duration","useNativeDriver","start","createElement","style","backgroundColor","color","width","marginHorizontal","height","opacity","WMTextInput","forwardRef","ref","selectRange","setSelectRange","isInputFocused","setIsInputFocused","iMask","setIMask","displayCursor","setDisplayCursor","value","x","forceUpdate","displayValue","setDisplayValue","element","displayformat","MaskedPattern","mask","skipInvalid","lazy","definitions","typedValue","defaultValue","onChangeText","setTimeout","OS","maskchar","_element$current","setSelectionRange","length","onSelectionChange","e","_e$nativeEvent","selection","nativeEvent","allowContentSelection","end","text","_value","substring","slice","formattedValue","replace","valueExpr","opts","textStyle","Object","assign","hideInput","Fragment","floatingLabel","moveUp","label","placeholder","floatingLabelStyle","activeFloatingLabelStyle","_extends","borderColor","zIndex","onFocus","_props$onFocus","call","target","onBlur","_props$onBlur","caretHidden","selectionColor","cursorColor","onChange","contextMenuHidden","display","flexDirection","alignItems","marginTop","minHeight","undefined","padding","fontFamily","fontSize","fontWeight"],"sources":["textinput.component.tsx"],"sourcesContent":["import React, { ForwardedRef, useCallback, useEffect, useRef, useState } from 'react';\nimport { Animated, Platform, Text, TextInput, TextInputProps, TextStyle, View } from 'react-native';\nimport { isArray } from 'lodash';\nimport IMask from 'imask';\nimport { FloatingLabel } from './floatinglabel.component';\n\ninterface SelectRange {\n start: number,\n end: number\n}\n\nconst WmCursor = React.memo((props: {\n color: string,\n height: number\n}) => {\n const opacityAnimation = useRef(new Animated.Value(0.5)).current;\n const runAnimation = useCallback(() => {\n Animated.timing(opacityAnimation, {\n toValue: 0.2,\n duration: 500,\n useNativeDriver: true\n }).start(() => {\n Animated.timing(opacityAnimation, {\n toValue: 0.6,\n duration: 500,\n useNativeDriver: true\n }).start(runAnimation);\n });\n }, []);\n useEffect(() => {\n runAnimation();\n }, []);\n return (\n <Animated.View style={{\n backgroundColor: props.color,\n width: 2,\n marginHorizontal: 1,\n height: props.height,\n opacity: opacityAnimation\n }}></Animated.View>\n );\n});\n\nexport const WMTextInput = React.forwardRef((props: (TextInputProps & \n {allowContentSelection: boolean,\n displayformat: string,\n maskchar: string,\n floatingLabel: string\n floatingLabelStyle: TextStyle,\n activeFloatingLabelStyle: TextStyle\n }), \n ref: ForwardedRef<TextInput>) => {\n const [selectRange, setSelectRange] = useState<SelectRange>(null as any);\n const [isInputFocused, setIsInputFocused] = useState(false);\n const [iMask, setIMask] = useState(null as any);\n const [displayCursor, setDisplayCursor] = useState(false);\n const value = useRef(props.value || '');\n const [x, forceUpdate] = useState(1);\n const [displayValue, setDisplayValue] = useState('');\n const element = useRef(null as any);\n // iMask initialization\n useEffect(() => {\n const iMask: any = props.displayformat ? new IMask.MaskedPattern({\n mask: props.displayformat,\n skipInvalid: true,\n lazy: false,\n definitions: {\n '9': /\\d/,\n 'A': /[a-zA-Z]/,\n 'a': /[a-z]/,\n '*': /\\w/\n }\n }) : null;\n if (iMask) {\n iMask.typedValue = value;\n setDisplayValue(iMask.displayValue)\n setIMask(iMask);\n }\n },[props.displayformat]);\n // set default value\n useEffect(() => {\n const defaultValue = props.defaultValue || props.value || '';\n if (!value.current) {\n value.current = defaultValue;\n onChangeText(defaultValue);\n }\n },[props.defaultValue, props.value]);\n // set cursor position in windows\n useEffect(() => {\n setTimeout(() => {\n if (Platform.OS === 'web' && (props.displayformat || props.maskchar)) {\n element?.current?.setSelectionRange(value.current.length, value.current.length);\n }\n }, 100);\n }, [value.current, props]);\n const onSelectionChange = useCallback((e: any) => {\n if (Platform.OS !== 'android') {\n return;\n }\n const selection = e?.nativeEvent?.selection;\n if (!props.allowContentSelection\n && selection\n && selection.end - selection.start > 0) {\n setSelectRange({\n start: value.current.length + 2,\n end: value.current.length + 2\n });\n } else if (selectRange && selectRange.end > 0){\n setSelectRange(null as any);\n }\n }, [props.allowContentSelection, value]);\n // when text changes\n const onChangeText = useCallback((text: string) => {\n if (!(iMask || props.maskchar)) {\n value.current = text;\n props.onChangeText && props.onChangeText(text);\n return;\n }\n let _value = value.current || '';\n if (value.current.length - text.length > 0) {\n _value = _value.substring(0, _value.length - (value.current.length - text.length));\n } else if (text.length - value.current.length > 0) {\n _value += text.slice(-1 * (text.length - value.current.length));\n }\n let formattedValue = _value;\n if(props.maskchar) {\n formattedValue = (_value.replace(/./g, props.maskchar));\n }\n if (iMask) {\n iMask.typedValue = _value;\n formattedValue = iMask.displayValue;\n }\n if (formattedValue !== displayValue) {\n value.current = _value;\n props.onChangeText && props.onChangeText(_value);\n }\n forceUpdate(x+ 1);\n setDisplayValue(formattedValue);\n }, [iMask, value, displayValue, props.onChangeText]);\n const valueExpr = Platform.OS === 'web' ? 'value' : 'defaultValue';\n const opts = {} as any;\n opts[valueExpr] = value.current;\n const textStyle = Object.assign({}, ...isArray(props.style) ? props.style: [props.style]);\n const hideInput = props.displayformat || props.maskchar;\n return (\n <>\n {props.floatingLabel ? (\n <FloatingLabel\n moveUp={!!(value.current || isInputFocused || displayValue)}\n label={props.floatingLabel ?? props.placeholder} \n style={{\n ...(props.floatingLabelStyle || []),\n ...(isInputFocused ? (props.activeFloatingLabelStyle || {}) : {})\n }}/>\n ) : null}\n <TextInput\n {...props}\n {...hideInput ? opts: {}}\n placeholder={props.floatingLabel || displayValue ? '' : props.placeholder }\n style={[props.style, hideInput ? {\n color: 'transparent', \n backgroundColor: 'transparent',\n borderColor: 'transparent',\n zIndex: 1\n } : {}]}\n onFocus={(e) => {\n props.onFocus?.(e);\n setIsInputFocused(true);\n setDisplayCursor(true);\n element.current = e.target;\n }}\n onBlur={(e) => {\n props?.onBlur?.(e);\n setIsInputFocused(false);\n setDisplayCursor(false);\n }}\n ref={ref}\n selection={selectRange}\n onSelectionChange={onSelectionChange}\n caretHidden={!!selectRange?.end}\n onChangeText={(text) => {\n onChangeText(text);\n }}\n {...hideInput ? {\n selectionColor: 'transparent',\n cursorColor: 'transparent',\n onChange : () => {}\n }: {}}\n contextMenuHidden={!props.allowContentSelection}\n ></TextInput>\n {\n hideInput ? (\n <View style={[props.style, {\n display: 'flex',\n flexDirection: 'row',\n alignItems: 'center',\n marginTop: -1 * (textStyle.height || textStyle.minHeight || 0)\n + (textStyle.marginTop || 0)}]}>\n <Text style={{ \n width: undefined,\n backgroundColor: 'transparent', \n borderColor: 'transparent',\n padding: 0,\n display: 'flex',\n color: textStyle.color,\n fontFamily: textStyle.fontFamily,\n fontSize: textStyle.fontSize,\n fontWeight: textStyle.fontWeight\n }}>\n {displayValue}\n </Text>\n {\n (displayCursor && !props.displayformat) ? React.createElement(WmCursor, {\n color: textStyle.color || '#000000',\n height: textStyle.fontSize || 14\n }) : null\n }\n </View>\n ) : null\n }\n </>\n );\n});"],"mappings":";AAAA,OAAOA,KAAK,IAAkBC,WAAW,EAAEC,SAAS,EAAEC,MAAM,EAAEC,QAAQ,QAAQ,OAAO;AACrF,SAASC,QAAQ,EAAEC,QAAQ,EAAEC,IAAI,EAAEC,SAAS,EAA6BC,IAAI,QAAQ,cAAc;AACnG,SAASC,OAAO,QAAQ,QAAQ;AAChC,OAAOC,KAAK,MAAM,OAAO;AACzB,SAASC,aAAa,QAAQ,2BAA2B;AAOzD,MAAMC,QAAQ,gBAAGb,KAAK,CAACc,IAAI,CAAEC,KAG5B,IAAK;EACJ,MAAMC,gBAAgB,GAAGb,MAAM,CAAC,IAAIE,QAAQ,CAACY,KAAK,C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pB,CAAC,GAAE,CAAC,CAAC;IACLC,iBAAiB,EAAE,CAACzF,KAAK,CAACuD;EAAsB,EACtC,CAAC,EAEXa,SAAS,gBACPnF,KAAA,CAAAyB,aAAA,CAAChB,IAAI;IAACiB,KAAK,EAAE,CAACX,KAAK,CAACW,KAAK,EAAE;MACzB+E,OAAO,EAAE,MAAM;MACfC,aAAa,EAAE,KAAK;MACpBC,UAAU,EAAE,QAAQ;MACpBC,SAAS,EAAE,CAAC,CAAC,IAAI5B,SAAS,CAACjD,MAAM,IAAIiD,SAAS,CAAC6B,SAAS,IAAI,CAAC,CAAC,IACzD7B,SAAS,CAAC4B,SAAS,IAAI,CAAC;IAAC,CAAC;EAAE,gBACjC5G,KAAA,CAAAyB,aAAA,CAAClB,IAAI;IAACmB,KAAK,EAAE;MACXG,KAAK,EAAEiF,SAAS;MAChBnF,eAAe,EAAE,aAAa;MAC9BiE,WAAW,EAAE,aAAa;MAC1BmB,OAAO,EAAE,CAAC;MACVN,OAAO,EAAE,MAAM;MACf7E,KAAK,EAAEoD,SAAS,CAACpD,KAAK;MACtBoF,UAAU,EAAEhC,SAAS,CAACgC,UAAU;MAChCC,QAAQ,EAAEjC,SAAS,CAACiC,QAAQ;MAC5BC,UAAU,EAAElC,SAAS,CAACkC;IACtB;EAAE,GACDnE,YACG,CAAC,EAEJL,aAAa,IAAI,CAAC3B,KAAK,CAACmC,aAAa,gBAAIlD,KAAK,CAACyB,aAAa,CAACZ,QAAQ,EAAE;IACtEe,KAAK,EAAEoD,SAAS,CAACpD,KAAK,IAAI,SAAS;IACnCG,MAAM,EAAEiD,SAAS,CAACiC,QAAQ,IAAI;EAChC,CAAC,CAAC,GAAG,IAEH,CAAC,GACL,IAEN,CAAC;AAET,CAAC,CAAC"}
@@ -1,14 +1,37 @@
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
+ let i = 1;
4
5
  export default class EventNotifier {
5
6
  constructor() {
7
+ _defineProperty(this, "name", '');
8
+ _defineProperty(this, "id", i++);
6
9
  _defineProperty(this, "listeners", {});
10
+ _defineProperty(this, "parent", null);
11
+ _defineProperty(this, "children", []);
12
+ }
13
+ setParent(parent) {
14
+ if (parent !== this.parent) {
15
+ this.removeFromParent();
16
+ this.parent = parent;
17
+ this.parent.children.push(this);
18
+ }
7
19
  }
8
20
  notify(event, args) {
21
+ let propagate = true;
9
22
  if (this.listeners[event]) {
10
- this.listeners[event].forEach(l => {
11
- l && l.apply(null, args);
23
+ propagate = !this.listeners[event].find(l => {
24
+ try {
25
+ return (l && l.apply(null, args)) === false;
26
+ } catch (e) {
27
+ console.error(e);
28
+ }
29
+ return true;
30
+ });
31
+ }
32
+ if (propagate) {
33
+ this.children.forEach(c => {
34
+ c.notify(event, args);
12
35
  });
13
36
  }
14
37
  }
@@ -21,5 +44,17 @@ export default class EventNotifier {
21
44
  eventListeners.splice(i, 1);
22
45
  };
23
46
  }
47
+ removeFromParent() {
48
+ if (this.parent) {
49
+ const i = this.parent.children.indexOf(this) || -1;
50
+ if (i >= 0) {
51
+ this.parent.children.splice(i, 1);
52
+ }
53
+ this.parent = null;
54
+ }
55
+ }
56
+ destroy() {
57
+ this.removeFromParent();
58
+ }
24
59
  }
25
60
  //# sourceMappingURL=event-notifier.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["EventNotifier","constructor","_defineProperty","notify","event","args","listeners","forEach","l","apply","subscribe","fn","push","eventListeners","i","findIndex","fni","splice"],"sources":["event-notifier.ts"],"sourcesContent":["export default class EventNotifier {\n private listeners = {} as any;\n\n public notify(event: string, args: any[]) {\n if (this.listeners[event]) {\n this.listeners[event].forEach((l: Function) => {\n l && l.apply(null, args);\n });\n }\n }\n\n public subscribe(event: string, fn: Function) {\n this.listeners[event] = this.listeners[event] || [];\n this.listeners[event].push(fn);\n return () => {\n const eventListeners = this.listeners[event];\n const i = eventListeners.findIndex((fni: Function) => fni === fn);\n eventListeners.splice(i, 1);\n };\n }\n}"],"mappings":";;;AAAA,eAAe,MAAMA,aAAa,CAAC;EAAAC,YAAA;IAAAC,eAAA,oBACX,CAAC,CAAC;EAAA;EAEfC,MAAMA,CAACC,KAAa,EAAEC,IAAW,EAAE;IACtC,IAAI,IAAI,CAACC,SAAS,CAACF,KAAK,CAAC,EAAE;MACvB,IAAI,CAACE,SAAS,CAACF,KAAK,CAAC,CAACG,OAAO,CAAEC,CAAW,IAAK;QAC3CA,CAAC,IAAIA,CAAC,CAACC,KAAK,CAAC,IAAI,EAAEJ,IAAI,CAAC;MAC5B,CAAC,CAAC;IACN;EACJ;EAEOK,SAASA,CAACN,KAAa,EAAEO,EAAY,EAAE;IAC1C,IAAI,CAACL,SAAS,CAACF,KAAK,CAAC,GAAG,IAAI,CAACE,SAAS,CAACF,KAAK,CAAC,IAAI,EAAE;IACnD,IAAI,CAACE,SAAS,CAACF,KAAK,CAAC,CAACQ,IAAI,CAACD,EAAE,CAAC;IAC9B,OAAO,MAAM;MACT,MAAME,cAAc,GAAG,IAAI,CAACP,SAAS,CAACF,KAAK,CAAC;MAC5C,MAAMU,CAAC,GAAGD,cAAc,CAACE,SAAS,CAAEC,GAAa,IAAKA,GAAG,KAAKL,EAAE,CAAC;MACjEE,cAAc,CAACI,MAAM,CAACH,CAAC,EAAE,CAAC,CAAC;IAC/B,CAAC;EACL;AACJ"}
1
+ {"version":3,"names":["i","EventNotifier","constructor","_defineProperty","setParent","parent","removeFromParent","children","push","notify","event","args","propagate","listeners","find","l","apply","e","console","error","forEach","c","subscribe","fn","eventListeners","findIndex","fni","splice","indexOf","destroy"],"sources":["event-notifier.ts"],"sourcesContent":["let i = 1;\nexport default class EventNotifier {\n public name = '';\n public id = i++;\n private listeners = {} as any;\n private parent: EventNotifier = null as any;\n private children: EventNotifier[] = [];\n\n setParent(parent: EventNotifier) {\n if (parent !== this.parent) {\n this.removeFromParent();\n this.parent = parent;\n this.parent.children.push(this);\n }\n }\n\n public notify(event: string, args: any[]) {\n let propagate = true;\n if (this.listeners[event]) {\n propagate = !this.listeners[event].find((l: Function) => {\n try {\n return (l && l.apply(null, args)) === false;\n } catch(e) {\n console.error(e);\n }\n return true;\n });\n }\n if (propagate) {\n this.children.forEach((c) => {\n c.notify(event, args);\n });\n }\n }\n\n public subscribe(event: string, fn: Function) {\n this.listeners[event] = this.listeners[event] || [];\n this.listeners[event].push(fn);\n return () => {\n const eventListeners = this.listeners[event];\n const i = eventListeners.findIndex((fni: Function) => fni === fn);\n eventListeners.splice(i, 1);\n };\n }\n\n private removeFromParent() {\n if (this.parent) {\n const i = this.parent.children.indexOf(this) || -1;\n if (i >= 0) {\n this.parent.children.splice(i, 1);\n }\n this.parent = null as any;\n }\n }\n\n public destroy() {\n this.removeFromParent();\n }\n}"],"mappings":";;;AAAA,IAAIA,CAAC,GAAG,CAAC;AACT,eAAe,MAAMC,aAAa,CAAC;EAAAC,YAAA;IAAAC,eAAA,eACjB,EAAE;IAAAA,eAAA,aACJH,CAAC,EAAE;IAAAG,eAAA,oBACK,CAAC,CAAC;IAAAA,eAAA,iBACU,IAAI;IAAAA,eAAA,mBACA,EAAE;EAAA;EAEtCC,SAASA,CAACC,MAAqB,EAAE;IAC7B,IAAIA,MAAM,KAAK,IAAI,CAACA,MAAM,EAAE;MACxB,IAAI,CAACC,gBAAgB,CAAC,CAAC;MACvB,IAAI,CAACD,MAAM,GAAGA,MAAM;MACpB,IAAI,CAACA,MAAM,CAACE,QAAQ,CAACC,IAAI,CAAC,IAAI,CAAC;IACnC;EACJ;EAEOC,MAAMA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AAC;MAClD,IAAI5B,CAAC,IAAI,CAAC,EAAE;QACR,IAAI,CAACK,MAAM,CAACE,QAAQ,CAACoB,MAAM,CAAC3B,CAAC,EAAE,CAAC,CAAC;MACrC;MACA,IAAI,CAACK,MAAM,GAAG,IAAW;IAC7B;EACJ;EAEOwB,OAAOA,CAAA,EAAG;IACb,IAAI,CAACvB,gBAAgB,CAAC,CAAC;EAC3B;AACJ"}
@@ -57,5 +57,18 @@ export class StringToNumberFormatter {
57
57
  return parseInt(input);
58
58
  }
59
59
  }
60
- export default new Map([['numberToString', new NumberToStringFormatter()], ['prefix', new PrependFormatter()], ['suffix', new AppendFormatter()], ['stringToNumber', new StringToNumberFormatter()], ['timeFromNow', new TimeFromNowFormatter()], ['toDate', new DateToStringFormatter()], ['toCurrency', new CurrencyFormatter()]]);
60
+ const createFormatter = (key, defaultFormatter) => {
61
+ return {
62
+ format: function (input) {
63
+ for (var _len = arguments.length, params = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
64
+ params[_key - 1] = arguments[_key];
65
+ }
66
+ const output = defaultFormatter.format(input, ...params);
67
+ const customFormatter = formatters.get(`custom.${key}`);
68
+ return customFormatter ? customFormatter.format(output, ...params) : output;
69
+ }
70
+ };
71
+ };
72
+ const formatters = new Map([['numberToString', createFormatter('numberToString', new NumberToStringFormatter())], ['prefix', createFormatter('prefix', new PrependFormatter())], ['suffix', createFormatter('suffix', new AppendFormatter())], ['stringToNumber', createFormatter('stringToNumber', new StringToNumberFormatter())], ['timeFromNow', createFormatter('timeFromNow', new TimeFromNowFormatter())], ['toDate', createFormatter('toDate', new DateToStringFormatter())], ['toCurrency', createFormatter('toCurrency', new CurrencyFormatter())]]);
73
+ export default formatters;
61
74
  //# sourceMappingURL=formatters.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["parseInt","moment","CURRENCY_INFO","injector","DateToStringFormatter","format","input","getTime","replace","_moment","isValid","toString","PrependFormatter","prefix","undefined","AppendFormatter","suffix","NumberToStringFormatter","fractionSize","i18nService","I18nService","get","selectedLocale","getSelectedLocale","formatCurrency","Intl","NumberFormat","minimumFractionDigits","maximumFractionDigits","isNaN","CurrencyFormatter","data","currencySymbol","fracSize","_currencySymbol","symbol","_val","isNegativeNumber","startsWith","TimeFromNowFormatter","timestamp","fromNow","StringToNumberFormatter","Map"],"sources":["formatters.ts"],"sourcesContent":["import { parseInt } from 'lodash';\nimport moment from 'moment';\nimport { CURRENCY_INFO, Currency } from './constants/currency-constants';\nimport { DateFormatter } from '@wavemaker/variables/src/types/date-formatter';\nimport injector from '@wavemaker/app-rn-runtime/core/injector';\n\nexport interface Formatter {\n format: (input: any, ...params: any) => any;\n}\n\nexport class DateToStringFormatter implements DateFormatter {\n\n public format(input: Date, format: string): string {\n if (!input) {\n return '';\n }\n if (format === 'timestamp') {\n return input.getTime() + '';\n }\n format = format.replace(/d/g, 'D');\n const _moment = moment(input, [\n \"M/D/YYYY\", \"M-D-YYYY\", \"M.D.YYYY\",\n \"M/DD/YYYY\", \"M-DD-YYYY\", \"M.DD.YYYY\",\n \"YYYY/M/D\", \"YYYY-M-D\", \"YYYY.M.D\",\n \"MM/D/YYYY\", \"MM-D-YYYY\", \"MM.D.YYYY\",\n \"M/D/YY\", \"M-D-YY\", \"M.D.YY\", \"D MMM YYYY\",\n \"MM/DD/YYYY\", \"MM-DD-YYYY\", \"MM.DD.YYYY\",\n \"YYYY/MM/DD\", \"YYYY-MM-DD\", \"YYYY.MM.DD\",\n \"MM/DD/YY\", \"MM-DD-YY\", \"MM.DD.YY\", \"DD MMM YYYY\"\n ], true);\n return _moment.isValid() ? _moment.format(format) : input.toString();\n }\n}\n\nexport class PrependFormatter implements Formatter {\n\n public format(input: any, prefix: string): string {\n return (prefix || '') + (input !== null || input != undefined ? input : '');\n }\n}\n\nexport class AppendFormatter implements Formatter {\n\n public format(input: any, suffix: string): string {\n return (input !== null || input != undefined ? input : '') + (suffix || '');\n }\n}\n\nexport class NumberToStringFormatter implements Formatter {\n\n public format(input: number, fractionSize: number): string {\n const i18nService = injector.I18nService.get();\n const selectedLocale = i18nService.getSelectedLocale();\n let formatCurrency = new Intl.NumberFormat(selectedLocale,{\n minimumFractionDigits: fractionSize,\n maximumFractionDigits: fractionSize,\n });\n return isNaN(input) ? '': formatCurrency.format(input);\n }\n}\n\nexport class CurrencyFormatter implements Formatter {\n\n public format(data: number, currencySymbol: string, fracSize: number) {\n const _currencySymbol = ((((CURRENCY_INFO as any)[currencySymbol]) || {}) as Currency).symbol || currencySymbol || '';\n let _val = new NumberToStringFormatter().format(data, fracSize);\n const isNegativeNumber = _val.startsWith('-');\n if (isNegativeNumber) {\n _val = _val.replace('-','');\n }\n return _val ? isNegativeNumber ? '-'+ _currencySymbol +_val :_currencySymbol + _val : '';\n }\n}\n\nexport class TimeFromNowFormatter implements Formatter {\n public format(timestamp: Date) {\n return timestamp ? moment(timestamp).fromNow() : undefined;\n }\n}\n\nexport class StringToNumberFormatter implements Formatter {\n public format(input: string) {\n return parseInt(input);\n }\n}\n\nexport default new Map<string, Formatter>([\n ['numberToString', new NumberToStringFormatter()],\n ['prefix', new PrependFormatter()],\n ['suffix', new AppendFormatter()],\n ['stringToNumber', new StringToNumberFormatter()],\n ['timeFromNow', new TimeFromNowFormatter()],\n ['toDate', new DateToStringFormatter()],\n ['toCurrency', new CurrencyFormatter()]\n]);\n"],"mappings":"AAAA,SAASA,QAAQ,QAAQ,QAAQ;AACjC,OAAOC,MAAM,MAAM,QAAQ;AAC3B,SAASC,aAAa,QAAkB,gCAAgC;AAExE,OAAOC,QAAQ,MAAM,yCAAyC;AAM9D,OAAO,MAAMC,qBAAqB,CAA0B;EAEjDC,MAAMA,CAACC,KAAW,EAAED,MAAc,EAAU;IAC/C,IAAI,CAACC,KAAK,EAAE;MACR,OAAO,EAAE;IACb;IACA,IAAID,MAAM,KAAK,WAAW,EAAE;MACxB,OAAOC,KAAK,CAACC,OAAO,CAAC,CAAC,GAAG,EAAE;IAC/B;IACAF,MAAM,GAA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AuB,CAAC,CAAC,CAAC,EACjD,CAAC,QAAQ,EAAE,IAAIL,gBAAgB,CAAC,CAAC,CAAC,EAClC,CAAC,QAAQ,EAAE,IAAIG,eAAe,CAAC,CAAC,CAAC,EACjC,CAAC,gBAAgB,EAAE,IAAI2B,uBAAuB,CAAC,CAAC,CAAC,EACjD,CAAC,aAAa,EAAE,IAAIH,oBAAoB,CAAC,CAAC,CAAC,EAC3C,CAAC,QAAQ,EAAE,IAAInC,qBAAqB,CAAC,CAAC,CAAC,EACvC,CAAC,YAAY,EAAE,IAAI0B,iBAAiB,CAAC,CAAC,CAAC,CAC1C,CAAC"}
1
+ {"version":3,"names":["parseInt","moment","CURRENCY_INFO","injector","DateToStringFormatter","format","input","getTime","replace","_moment","isValid","toString","PrependFormatter","prefix","undefined","AppendFormatter","suffix","NumberToStringFormatter","fractionSize","i18nService","I18nService","get","selectedLocale","getSelectedLocale","formatCurrency","Intl","NumberFormat","minimumFractionDigits","maximumFractionDigits","isNaN","CurrencyFormatter","data","currencySymbol","fracSize","_currencySymbol","symbol","_val","isNegativeNumber","startsWith","TimeFromNowFormatter","timestamp","fromNow","StringToNumberFormatter","createFormatter","key","defaultFormatter","_len","arguments","length","params","Array","_key","output","customFormatter","formatters","Map"],"sources":["formatters.ts"],"sourcesContent":["import { parseInt } from 'lodash';\nimport moment from 'moment';\nimport { CURRENCY_INFO, Currency } from './constants/currency-constants';\nimport { DateFormatter } from '@wavemaker/variables/src/types/date-formatter';\nimport injector from '@wavemaker/app-rn-runtime/core/injector';\n\nexport interface Formatter {\n format: (input: any, ...params: any) => any;\n}\n\nexport class DateToStringFormatter implements DateFormatter {\n\n public format(input: Date, format: string): string {\n if (!input) {\n return '';\n }\n if (format === 'timestamp') {\n return input.getTime() + '';\n }\n format = format.replace(/d/g, 'D');\n const _moment = moment(input, [\n \"M/D/YYYY\", \"M-D-YYYY\", \"M.D.YYYY\",\n \"M/DD/YYYY\", \"M-DD-YYYY\", \"M.DD.YYYY\",\n \"YYYY/M/D\", \"YYYY-M-D\", \"YYYY.M.D\",\n \"MM/D/YYYY\", \"MM-D-YYYY\", \"MM.D.YYYY\",\n \"M/D/YY\", \"M-D-YY\", \"M.D.YY\", \"D MMM YYYY\",\n \"MM/DD/YYYY\", \"MM-DD-YYYY\", \"MM.DD.YYYY\",\n \"YYYY/MM/DD\", \"YYYY-MM-DD\", \"YYYY.MM.DD\",\n \"MM/DD/YY\", \"MM-DD-YY\", \"MM.DD.YY\", \"DD MMM YYYY\"\n ], true);\n return _moment.isValid() ? _moment.format(format) : input.toString();\n }\n}\n\nexport class PrependFormatter implements Formatter {\n\n public format(input: any, prefix: string): string {\n return (prefix || '') + (input !== null || input != undefined ? input : '');\n }\n}\n\nexport class AppendFormatter implements Formatter {\n\n public format(input: any, suffix: string): string {\n return (input !== null || input != undefined ? input : '') + (suffix || '');\n }\n}\n\nexport class NumberToStringFormatter implements Formatter {\n\n public format(input: number, fractionSize: number): string {\n const i18nService = injector.I18nService.get();\n const selectedLocale = i18nService.getSelectedLocale();\n let formatCurrency = new Intl.NumberFormat(selectedLocale,{\n minimumFractionDigits: fractionSize,\n maximumFractionDigits: fractionSize,\n });\n return isNaN(input) ? '': formatCurrency.format(input);\n }\n}\n\nexport class CurrencyFormatter implements Formatter {\n\n public format(data: number, currencySymbol: string, fracSize: number) {\n const _currencySymbol = ((((CURRENCY_INFO as any)[currencySymbol]) || {}) as Currency).symbol || currencySymbol || '';\n let _val = new NumberToStringFormatter().format(data, fracSize);\n const isNegativeNumber = _val.startsWith('-');\n if (isNegativeNumber) {\n _val = _val.replace('-','');\n }\n return _val ? isNegativeNumber ? '-'+ _currencySymbol +_val :_currencySymbol + _val : '';\n }\n}\n\nexport class TimeFromNowFormatter implements Formatter {\n public format(timestamp: Date) {\n return timestamp ? moment(timestamp).fromNow() : undefined;\n }\n}\n\nexport class StringToNumberFormatter implements Formatter {\n public format(input: string) {\n return parseInt(input);\n }\n}\n\nconst createFormatter = (key: string, defaultFormatter: Formatter) => {\n return {\n format: (input: any, ...params: any) => {\n const output = defaultFormatter.format(input, ...params);\n const customFormatter = formatters.get(`custom.${key}`);\n return customFormatter ? customFormatter.format(output, ...params): output;\n }\n };\n};\n\nconst formatters = new Map<string, Formatter>([\n ['numberToString', createFormatter('numberToString' , new NumberToStringFormatter())],\n ['prefix', createFormatter('prefix', new PrependFormatter())],\n ['suffix', createFormatter('suffix', new AppendFormatter())],\n ['stringToNumber', createFormatter('stringToNumber',new StringToNumberFormatter())],\n ['timeFromNow', createFormatter('timeFromNow', new TimeFromNowFormatter())],\n ['toDate', createFormatter('toDate', new DateToStringFormatter())],\n ['toCurrency', createFormatter('toCurrency', new CurrencyFormatter())]\n]);\n\nexport default formatters;"],"mappings":"AAAA,SAASA,QAAQ,QAAQ,QAAQ;AACjC,OAAOC,MAAM,MAAM,QAAQ;AAC3B,SAASC,aAAa,QAAkB,gCAAgC;AAExE,OAAOC,QAAQ,MAAM,yCAAyC;AAM9D,OAAO,MAAMC,qBAAqB,CAA0B;EAEjDC,MAAMA,CAACC,KAAW,EAAED,MAAc,EAAU;IAC/C,IAAI,CAACC,KAAK,EAAE;MACR,OAAO,EAAE;IACb;IACA,IAAID,MAAM,KAAK,WAAW,EAAE;MACxB,OAAOC,KAAK,CAACC,OAAO,CAAC,CAAC,GAAG,EAAE;IAC/B;IACAF,MAAM,GAAGA,MAAM,CAACG,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC;IAClC,MAAMC,OAAO,GAAGR,MAAM,CAACK,KAAK,EAAE,CAC1B,UAAU,EAAE,UAAU,EAAE,UAAU,EAClC,WAAW,EAAE,WAAW,EAAE,WAAW,EACrC,UAAU,EAAE,UAAU,EAAE,UAAU,EAClC,WAAW,EAAE,WAAW,EAAE,WAAW,EACrC,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,YAAY,EAC1C,YAAY,EAAE,YAAY,EAAE,YAAY,EACxC,YAAY,EAAE,YAAY,EAAE,YAAY,EACxC,UAAU,EAAE,UAA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CAAE,UAASuB,GAAI,EAAC,CAAC;MACvD,OAAOS,eAAe,GAAGA,eAAe,CAAChD,MAAM,CAAC+C,MAAM,EAAE,GAAGH,MAAM,CAAC,GAAEG,MAAM;IAC9E;EACJ,CAAC;AACL,CAAC;AAED,MAAME,UAAU,GAAG,IAAIC,GAAG,CAAoB,CAC1C,CAAC,gBAAgB,EAAEZ,eAAe,CAAC,gBAAgB,EAAG,IAAI1B,uBAAuB,CAAC,CAAC,CAAC,CAAC,EACrF,CAAC,QAAQ,EAAE0B,eAAe,CAAC,QAAQ,EAAE,IAAI/B,gBAAgB,CAAC,CAAC,CAAC,CAAC,EAC7D,CAAC,QAAQ,EAAE+B,eAAe,CAAC,QAAQ,EAAE,IAAI5B,eAAe,CAAC,CAAC,CAAC,CAAC,EAC5D,CAAC,gBAAgB,EAAE4B,eAAe,CAAC,gBAAgB,EAAC,IAAID,uBAAuB,CAAC,CAAC,CAAC,CAAC,EACnF,CAAC,aAAa,EAAEC,eAAe,CAAC,aAAa,EAAE,IAAIJ,oBAAoB,CAAC,CAAC,CAAC,CAAC,EAC3E,CAAC,QAAQ,EAAEI,eAAe,CAAC,QAAQ,EAAE,IAAIvC,qBAAqB,CAAC,CAAC,CAAC,CAAC,EAClE,CAAC,YAAY,EAAEuC,eAAe,CAAC,YAAY,EAAE,IAAIb,iBAAiB,CAAC,CAAC,CAAC,CAAC,CACzE,CAAC;AAEF,eAAewB,UAAU"}
@@ -84,13 +84,13 @@ export class Tappable extends React.Component {
84
84
  const target = this.props.target;
85
85
  if (target !== null && target !== void 0 && target.props.onTap || target !== null && target !== void 0 && target.props.onLongtap || target !== null && target !== void 0 && target.props.onDoubletap || this.props.onTap || this.props.onLongTap || this.props.onDoubleTap) {
86
86
  return /*#__PURE__*/React.createElement(TouchableRipple, _extends({
87
- rippleColor: "rgba(0, 0, 0, 0)",
87
+ rippleColor: this.props.rippleColor,
88
88
  borderless: true
89
89
  }, Platform.OS === 'android' || Platform.OS === 'web' ? {
90
90
  accessibilityLabel: this.props.testID,
91
91
  testID: this.props.testID
92
92
  } : {
93
- accessible: false,
93
+ // accessible: false,
94
94
  testID: this.props.testID
95
95
  }, {
96
96
  disabled: get(target === null || target === void 0 ? void 0 : target.proxy, 'disabled'),