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

Sign up to get free protection for your applications and to get access to all the features.
Files changed (304) hide show
  1. app-rn-runtime/components/advanced/carousel/carousel.component.js +14 -9
  2. app-rn-runtime/components/advanced/carousel/carousel.component.js.map +1 -1
  3. app-rn-runtime/components/advanced/carousel/carousel.styles.js +6 -3
  4. app-rn-runtime/components/advanced/carousel/carousel.styles.js.map +1 -1
  5. app-rn-runtime/components/advanced/webview/webview.component.js +33 -14
  6. app-rn-runtime/components/advanced/webview/webview.component.js.map +1 -1
  7. app-rn-runtime/components/advanced/webview/webview.props.js +3 -1
  8. app-rn-runtime/components/advanced/webview/webview.props.js.map +1 -1
  9. app-rn-runtime/components/basic/anchor/anchor.component.js +22 -8
  10. app-rn-runtime/components/basic/anchor/anchor.component.js.map +1 -1
  11. app-rn-runtime/components/basic/anchor/anchor.props.js +7 -0
  12. app-rn-runtime/components/basic/anchor/anchor.props.js.map +1 -1
  13. app-rn-runtime/components/basic/anchor/anchor.styles.js +3 -1
  14. app-rn-runtime/components/basic/anchor/anchor.styles.js.map +1 -1
  15. app-rn-runtime/components/basic/animatedview.component.js +5 -3
  16. app-rn-runtime/components/basic/animatedview.component.js.map +1 -1
  17. app-rn-runtime/components/basic/button/button.component.js +41 -8
  18. app-rn-runtime/components/basic/button/button.component.js.map +1 -1
  19. app-rn-runtime/components/basic/button/button.props.js +7 -0
  20. app-rn-runtime/components/basic/button/button.props.js.map +1 -1
  21. app-rn-runtime/components/basic/button/button.styles.js +9 -10
  22. app-rn-runtime/components/basic/button/button.styles.js.map +1 -1
  23. app-rn-runtime/components/basic/buttongroup/buttongroup.styles.js +13 -5
  24. app-rn-runtime/components/basic/buttongroup/buttongroup.styles.js.map +1 -1
  25. app-rn-runtime/components/basic/icon/icon.component.js +64 -12
  26. app-rn-runtime/components/basic/icon/icon.component.js.map +1 -1
  27. app-rn-runtime/components/basic/icon/icon.props.js +7 -0
  28. app-rn-runtime/components/basic/icon/icon.props.js.map +1 -1
  29. app-rn-runtime/components/basic/icon/icon.styles.js +2 -1
  30. app-rn-runtime/components/basic/icon/icon.styles.js.map +1 -1
  31. app-rn-runtime/components/basic/label/label.component.js +34 -25
  32. app-rn-runtime/components/basic/label/label.component.js.map +1 -1
  33. app-rn-runtime/components/basic/label/label.props.js +4 -0
  34. app-rn-runtime/components/basic/label/label.props.js.map +1 -1
  35. app-rn-runtime/components/basic/label/label.styles.js +4 -5
  36. app-rn-runtime/components/basic/label/label.styles.js.map +1 -1
  37. app-rn-runtime/components/basic/message/message.component.js +3 -2
  38. app-rn-runtime/components/basic/message/message.component.js.map +1 -1
  39. app-rn-runtime/components/basic/message/message.props.js +3 -0
  40. app-rn-runtime/components/basic/message/message.props.js.map +1 -1
  41. app-rn-runtime/components/basic/message/message.styles.js +3 -1
  42. app-rn-runtime/components/basic/message/message.styles.js.map +1 -1
  43. app-rn-runtime/components/basic/picture/picture.component.js +4 -2
  44. app-rn-runtime/components/basic/picture/picture.component.js.map +1 -1
  45. app-rn-runtime/components/basic/picture/picture.props.js +3 -0
  46. app-rn-runtime/components/basic/picture/picture.props.js.map +1 -1
  47. app-rn-runtime/components/basic/picture/picture.styles.js +3 -1
  48. app-rn-runtime/components/basic/picture/picture.styles.js.map +1 -1
  49. app-rn-runtime/components/basic/progress-bar/progress-bar.component.js +3 -3
  50. app-rn-runtime/components/basic/progress-bar/progress-bar.component.js.map +1 -1
  51. app-rn-runtime/components/basic/progress-bar/progress-bar.props.js +2 -0
  52. app-rn-runtime/components/basic/progress-bar/progress-bar.props.js.map +1 -1
  53. app-rn-runtime/components/basic/progress-circle/progress-circle.component.js +3 -2
  54. app-rn-runtime/components/basic/progress-circle/progress-circle.component.js.map +1 -1
  55. app-rn-runtime/components/basic/progress-circle/progress-circle.props.js +2 -0
  56. app-rn-runtime/components/basic/progress-circle/progress-circle.props.js.map +1 -1
  57. app-rn-runtime/components/basic/search/search.component.js +2 -1
  58. app-rn-runtime/components/basic/search/search.component.js.map +1 -1
  59. app-rn-runtime/components/basic/search/search.props.js +3 -0
  60. app-rn-runtime/components/basic/search/search.props.js.map +1 -1
  61. app-rn-runtime/components/basic/search/search.styles.js +6 -5
  62. app-rn-runtime/components/basic/search/search.styles.js.map +1 -1
  63. app-rn-runtime/components/basic/skeleton/skeleton.component.js +0 -1
  64. app-rn-runtime/components/basic/skeleton/skeleton.component.js.map +1 -1
  65. app-rn-runtime/components/basic/video/video.component.js +4 -2
  66. app-rn-runtime/components/basic/video/video.component.js.map +1 -1
  67. app-rn-runtime/components/basic/video/video.props.js +3 -0
  68. app-rn-runtime/components/basic/video/video.props.js.map +1 -1
  69. app-rn-runtime/components/chart/area-chart/area-chart.component.js +34 -24
  70. app-rn-runtime/components/chart/area-chart/area-chart.component.js.map +1 -1
  71. app-rn-runtime/components/chart/bar-chart/bar-chart.component.js +29 -16
  72. app-rn-runtime/components/chart/bar-chart/bar-chart.component.js.map +1 -1
  73. app-rn-runtime/components/chart/bar-chart/bar-chart.props.js +0 -2
  74. app-rn-runtime/components/chart/bar-chart/bar-chart.props.js.map +1 -1
  75. app-rn-runtime/components/chart/basechart.component.js +33 -7
  76. app-rn-runtime/components/chart/basechart.component.js.map +1 -1
  77. app-rn-runtime/components/chart/basechart.props.js +7 -2
  78. app-rn-runtime/components/chart/basechart.props.js.map +1 -1
  79. app-rn-runtime/components/chart/basechart.styles.js +9 -2
  80. app-rn-runtime/components/chart/basechart.styles.js.map +1 -1
  81. app-rn-runtime/components/chart/bubble-chart/bubble-chart.component.js +4 -2
  82. app-rn-runtime/components/chart/bubble-chart/bubble-chart.component.js.map +1 -1
  83. app-rn-runtime/components/chart/line-chart/line-chart.component.js +27 -20
  84. app-rn-runtime/components/chart/line-chart/line-chart.component.js.map +1 -1
  85. app-rn-runtime/components/chart/line-chart/line-chart.props.js.map +1 -1
  86. app-rn-runtime/components/chart/pie-chart/pie-chart.component.js +7 -4
  87. app-rn-runtime/components/chart/pie-chart/pie-chart.component.js.map +1 -1
  88. app-rn-runtime/components/chart/stack-chart/stack-chart.component.js +33 -10
  89. app-rn-runtime/components/chart/stack-chart/stack-chart.component.js.map +1 -1
  90. app-rn-runtime/components/chart/stack-chart/stack-chart.props.js +1 -0
  91. app-rn-runtime/components/chart/stack-chart/stack-chart.props.js.map +1 -1
  92. app-rn-runtime/components/chart/staticdata.js +215 -0
  93. app-rn-runtime/components/chart/staticdata.js.map +1 -0
  94. app-rn-runtime/components/container/container.component.js +11 -2
  95. app-rn-runtime/components/container/container.component.js.map +1 -1
  96. app-rn-runtime/components/container/container.props.js +1 -0
  97. app-rn-runtime/components/container/container.props.js.map +1 -1
  98. app-rn-runtime/components/container/panel/panel.component.js +6 -2
  99. app-rn-runtime/components/container/panel/panel.component.js.map +1 -1
  100. app-rn-runtime/components/container/panel/panel.props.js +4 -0
  101. app-rn-runtime/components/container/panel/panel.props.js.map +1 -1
  102. app-rn-runtime/components/container/tabs/tabheader/tabheader.styles.js +1 -1
  103. app-rn-runtime/components/container/tabs/tabheader/tabheader.styles.js.map +1 -1
  104. app-rn-runtime/components/container/wizard/wizard.component.js +17 -14
  105. app-rn-runtime/components/container/wizard/wizard.component.js.map +1 -1
  106. app-rn-runtime/components/container/wizard/wizard.styles.js +19 -3
  107. app-rn-runtime/components/container/wizard/wizard.styles.js.map +1 -1
  108. app-rn-runtime/components/container/wizard/wizardstep/wizardstep.component.js +27 -2
  109. app-rn-runtime/components/container/wizard/wizardstep/wizardstep.component.js.map +1 -1
  110. app-rn-runtime/components/container/wizard/wizardstep/wizardstep.props.js +6 -0
  111. app-rn-runtime/components/container/wizard/wizardstep/wizardstep.props.js.map +1 -1
  112. app-rn-runtime/components/data/card/card.component.js +7 -3
  113. app-rn-runtime/components/data/card/card.component.js.map +1 -1
  114. app-rn-runtime/components/data/card/card.props.js +4 -0
  115. app-rn-runtime/components/data/card/card.props.js.map +1 -1
  116. app-rn-runtime/components/data/form/form-action/form-action.styles.js +2 -1
  117. app-rn-runtime/components/data/form/form-action/form-action.styles.js.map +1 -1
  118. app-rn-runtime/components/data/form/form-field/form-field.component.js +5 -1
  119. app-rn-runtime/components/data/form/form-field/form-field.component.js.map +1 -1
  120. app-rn-runtime/components/data/list/list.component.js +136 -25
  121. app-rn-runtime/components/data/list/list.component.js.map +1 -1
  122. app-rn-runtime/components/data/list/list.props.js +4 -1
  123. app-rn-runtime/components/data/list/list.props.js.map +1 -1
  124. app-rn-runtime/components/data/list/list.styles.js +9 -0
  125. app-rn-runtime/components/data/list/list.styles.js.map +1 -1
  126. app-rn-runtime/components/device/barcodescanner/barcodescanner.component.js +4 -1
  127. app-rn-runtime/components/device/barcodescanner/barcodescanner.component.js.map +1 -1
  128. app-rn-runtime/components/device/barcodescanner/barcodescanner.props.js +3 -0
  129. app-rn-runtime/components/device/barcodescanner/barcodescanner.props.js.map +1 -1
  130. app-rn-runtime/components/device/barcodescanner/barcodescanner.styles.js +13 -6
  131. app-rn-runtime/components/device/barcodescanner/barcodescanner.styles.js.map +1 -1
  132. app-rn-runtime/components/device/camera/camera.component.js +4 -1
  133. app-rn-runtime/components/device/camera/camera.component.js.map +1 -1
  134. app-rn-runtime/components/device/camera/camera.props.js +3 -0
  135. app-rn-runtime/components/device/camera/camera.props.js.map +1 -1
  136. app-rn-runtime/components/device/camera/camera.styles.js +12 -4
  137. app-rn-runtime/components/device/camera/camera.styles.js.map +1 -1
  138. app-rn-runtime/components/dialogs/alertdialog/alertdialog.component.js +4 -0
  139. app-rn-runtime/components/dialogs/alertdialog/alertdialog.component.js.map +1 -1
  140. app-rn-runtime/components/dialogs/alertdialog/alertdialog.props.js +4 -0
  141. app-rn-runtime/components/dialogs/alertdialog/alertdialog.props.js.map +1 -1
  142. app-rn-runtime/components/dialogs/alertdialog/alertdialog.styles.js +2 -1
  143. app-rn-runtime/components/dialogs/alertdialog/alertdialog.styles.js.map +1 -1
  144. app-rn-runtime/components/dialogs/confirmdialog/confirmdialog.component.js +4 -0
  145. app-rn-runtime/components/dialogs/confirmdialog/confirmdialog.component.js.map +1 -1
  146. app-rn-runtime/components/dialogs/confirmdialog/confirmdialog.props.js +4 -0
  147. app-rn-runtime/components/dialogs/confirmdialog/confirmdialog.props.js.map +1 -1
  148. app-rn-runtime/components/dialogs/dialog/dialog.component.js +7 -3
  149. app-rn-runtime/components/dialogs/dialog/dialog.component.js.map +1 -1
  150. app-rn-runtime/components/dialogs/dialog/dialog.props.js +4 -0
  151. app-rn-runtime/components/dialogs/dialog/dialog.props.js.map +1 -1
  152. app-rn-runtime/components/dialogs/dialog/dialog.styles.js +11 -2
  153. app-rn-runtime/components/dialogs/dialog/dialog.styles.js.map +1 -1
  154. app-rn-runtime/components/input/basedataset/basedataset.props.js +4 -0
  155. app-rn-runtime/components/input/basedataset/basedataset.props.js.map +1 -1
  156. app-rn-runtime/components/input/baseinput/baseinput.component.js +2 -2
  157. app-rn-runtime/components/input/baseinput/baseinput.component.js.map +1 -1
  158. app-rn-runtime/components/input/baseinput/baseinput.props.js +4 -0
  159. app-rn-runtime/components/input/baseinput/baseinput.props.js.map +1 -1
  160. app-rn-runtime/components/input/basenumber/basenumber.component.js +16 -10
  161. app-rn-runtime/components/input/basenumber/basenumber.component.js.map +1 -1
  162. app-rn-runtime/components/input/basenumber/basenumber.props.js +4 -0
  163. app-rn-runtime/components/input/basenumber/basenumber.props.js.map +1 -1
  164. app-rn-runtime/components/input/checkbox/checkbox.component.js +12 -5
  165. app-rn-runtime/components/input/checkbox/checkbox.component.js.map +1 -1
  166. app-rn-runtime/components/input/checkbox/checkbox.styles.js +35 -5
  167. app-rn-runtime/components/input/checkbox/checkbox.styles.js.map +1 -1
  168. app-rn-runtime/components/input/checkboxset/checkboxset.component.js +13 -6
  169. app-rn-runtime/components/input/checkboxset/checkboxset.component.js.map +1 -1
  170. app-rn-runtime/components/input/checkboxset/checkboxset.styles.js +39 -10
  171. app-rn-runtime/components/input/checkboxset/checkboxset.styles.js.map +1 -1
  172. app-rn-runtime/components/input/chips/chips.component.js +5 -1
  173. app-rn-runtime/components/input/chips/chips.component.js.map +1 -1
  174. app-rn-runtime/components/input/composite/composite.component.js +1 -1
  175. app-rn-runtime/components/input/composite/composite.component.js.map +1 -1
  176. app-rn-runtime/components/input/composite/composite.props.js +1 -1
  177. app-rn-runtime/components/input/composite/composite.props.js.map +1 -1
  178. app-rn-runtime/components/input/currency/currency.component.js +18 -3
  179. app-rn-runtime/components/input/currency/currency.component.js.map +1 -1
  180. app-rn-runtime/components/input/currency/currency.props.js +1 -0
  181. app-rn-runtime/components/input/currency/currency.props.js.map +1 -1
  182. app-rn-runtime/components/input/currency/currency.styles.js +19 -1
  183. app-rn-runtime/components/input/currency/currency.styles.js.map +1 -1
  184. app-rn-runtime/components/input/epoch/base-datetime.component.js +76 -10
  185. app-rn-runtime/components/input/epoch/base-datetime.component.js.map +1 -1
  186. app-rn-runtime/components/input/epoch/date/date.component.js +8 -0
  187. app-rn-runtime/components/input/epoch/date/date.component.js.map +1 -1
  188. app-rn-runtime/components/input/epoch/date/date.styles.js +16 -0
  189. app-rn-runtime/components/input/epoch/date/date.styles.js.map +1 -1
  190. app-rn-runtime/components/input/epoch/datetime/datetime.component.js +8 -0
  191. app-rn-runtime/components/input/epoch/datetime/datetime.component.js.map +1 -1
  192. app-rn-runtime/components/input/epoch/datetime/datetime.props.js +5 -0
  193. app-rn-runtime/components/input/epoch/datetime/datetime.props.js.map +1 -1
  194. app-rn-runtime/components/input/epoch/datetime/datetime.styles.js +49 -1
  195. app-rn-runtime/components/input/epoch/datetime/datetime.styles.js.map +1 -1
  196. app-rn-runtime/components/input/epoch/time/time.component.js +8 -0
  197. app-rn-runtime/components/input/epoch/time/time.component.js.map +1 -1
  198. app-rn-runtime/components/input/epoch/time/time.styles.js +16 -0
  199. app-rn-runtime/components/input/epoch/time/time.styles.js.map +1 -1
  200. app-rn-runtime/components/input/fileupload/fileupload.component.js +2 -0
  201. app-rn-runtime/components/input/fileupload/fileupload.component.js.map +1 -1
  202. app-rn-runtime/components/input/fileupload/fileupload.props.js +2 -0
  203. app-rn-runtime/components/input/fileupload/fileupload.props.js.map +1 -1
  204. app-rn-runtime/components/input/fileupload/fileupload.styles.js +1 -1
  205. app-rn-runtime/components/input/fileupload/fileupload.styles.js.map +1 -1
  206. app-rn-runtime/components/input/number/number.component.js +13 -2
  207. app-rn-runtime/components/input/number/number.component.js.map +1 -1
  208. app-rn-runtime/components/input/number/number.props.js +1 -0
  209. app-rn-runtime/components/input/number/number.props.js.map +1 -1
  210. app-rn-runtime/components/input/number/number.styles.js +17 -0
  211. app-rn-runtime/components/input/number/number.styles.js.map +1 -1
  212. app-rn-runtime/components/input/radioset/radioset.component.js +7 -2
  213. app-rn-runtime/components/input/radioset/radioset.component.js.map +1 -1
  214. app-rn-runtime/components/input/select/select.component.js +7 -3
  215. app-rn-runtime/components/input/select/select.component.js.map +1 -1
  216. app-rn-runtime/components/input/select/select.styles.js +5 -1
  217. app-rn-runtime/components/input/select/select.styles.js.map +1 -1
  218. app-rn-runtime/components/input/slider/slider.styles.js +3 -3
  219. app-rn-runtime/components/input/slider/slider.styles.js.map +1 -1
  220. app-rn-runtime/components/input/switch/switch.component.js +8 -1
  221. app-rn-runtime/components/input/switch/switch.component.js.map +1 -1
  222. app-rn-runtime/components/input/switch/switch.styles.js +10 -5
  223. app-rn-runtime/components/input/switch/switch.styles.js.map +1 -1
  224. app-rn-runtime/components/input/text/text.component.js +13 -1
  225. app-rn-runtime/components/input/text/text.component.js.map +1 -1
  226. app-rn-runtime/components/input/text/text.props.js +1 -0
  227. app-rn-runtime/components/input/text/text.props.js.map +1 -1
  228. app-rn-runtime/components/input/text/text.styles.js +17 -0
  229. app-rn-runtime/components/input/text/text.styles.js.map +1 -1
  230. app-rn-runtime/components/input/textarea/textarea.component.js +13 -1
  231. app-rn-runtime/components/input/textarea/textarea.component.js.map +1 -1
  232. app-rn-runtime/components/input/textarea/textarea.props.js +1 -0
  233. app-rn-runtime/components/input/textarea/textarea.props.js.map +1 -1
  234. app-rn-runtime/components/input/textarea/textarea.styles.js +17 -0
  235. app-rn-runtime/components/input/textarea/textarea.styles.js.map +1 -1
  236. app-rn-runtime/components/input/toggle/toggle.component.js +48 -5
  237. app-rn-runtime/components/input/toggle/toggle.component.js.map +1 -1
  238. app-rn-runtime/components/input/toggle/toggle.props.js +4 -0
  239. app-rn-runtime/components/input/toggle/toggle.props.js.map +1 -1
  240. app-rn-runtime/components/input/toggle/toggle.styles.js +5 -12
  241. app-rn-runtime/components/input/toggle/toggle.styles.js.map +1 -1
  242. app-rn-runtime/components/navigation/appnavbar/appnavbar.component.js +6 -1
  243. app-rn-runtime/components/navigation/appnavbar/appnavbar.component.js.map +1 -1
  244. app-rn-runtime/components/navigation/appnavbar/appnavbar.props.js +1 -0
  245. app-rn-runtime/components/navigation/appnavbar/appnavbar.props.js.map +1 -1
  246. app-rn-runtime/components/navigation/appnavbar/appnavbar.styles.js +11 -2
  247. app-rn-runtime/components/navigation/appnavbar/appnavbar.styles.js.map +1 -1
  248. app-rn-runtime/components/navigation/basenav/basenav.component.js +1 -2
  249. app-rn-runtime/components/navigation/basenav/basenav.component.js.map +1 -1
  250. app-rn-runtime/components/navigation/menu/menu.styles.js +8 -5
  251. app-rn-runtime/components/navigation/menu/menu.styles.js.map +1 -1
  252. app-rn-runtime/components/navigation/navitem/navitem.component.js +8 -5
  253. app-rn-runtime/components/navigation/navitem/navitem.component.js.map +1 -1
  254. app-rn-runtime/components/navigation/navitem/navitem.props.js +3 -0
  255. app-rn-runtime/components/navigation/navitem/navitem.props.js.map +1 -1
  256. app-rn-runtime/components/navigation/popover/popover.component.js +10 -3
  257. app-rn-runtime/components/navigation/popover/popover.component.js.map +1 -1
  258. app-rn-runtime/components/navigation/popover/popover.props.js +7 -0
  259. app-rn-runtime/components/navigation/popover/popover.props.js.map +1 -1
  260. app-rn-runtime/components/navigation/popover/popover.styles.js +8 -2
  261. app-rn-runtime/components/navigation/popover/popover.styles.js.map +1 -1
  262. app-rn-runtime/components/page/page-content/page-content.component.js +7 -1
  263. app-rn-runtime/components/page/page-content/page-content.component.js.map +1 -1
  264. app-rn-runtime/components/page/tabbar/curve.js +84 -0
  265. app-rn-runtime/components/page/tabbar/curve.js.map +1 -0
  266. app-rn-runtime/components/page/tabbar/tabbar.component.js +44 -10
  267. app-rn-runtime/components/page/tabbar/tabbar.component.js.map +1 -1
  268. app-rn-runtime/components/page/tabbar/tabbar.styles.js +82 -15
  269. app-rn-runtime/components/page/tabbar/tabbar.styles.js.map +1 -1
  270. app-rn-runtime/core/accessibility.js +149 -0
  271. app-rn-runtime/core/accessibility.js.map +1 -0
  272. app-rn-runtime/core/base.component.js +21 -3
  273. app-rn-runtime/core/base.component.js.map +1 -1
  274. app-rn-runtime/core/components/floatinglabel.component.js +45 -0
  275. app-rn-runtime/core/components/floatinglabel.component.js.map +1 -0
  276. app-rn-runtime/core/components/textinput.component.js +25 -2
  277. app-rn-runtime/core/components/textinput.component.js.map +1 -1
  278. app-rn-runtime/core/event-notifier.js +22 -1
  279. app-rn-runtime/core/event-notifier.js.map +1 -1
  280. app-rn-runtime/core/tappable.component.js +37 -10
  281. app-rn-runtime/core/tappable.component.js.map +1 -1
  282. app-rn-runtime/core/utils.js +11 -0
  283. app-rn-runtime/core/utils.js.map +1 -1
  284. app-rn-runtime/gestures/swipe.animation.js +34 -1
  285. app-rn-runtime/gestures/swipe.animation.js.map +1 -1
  286. app-rn-runtime/package.json +8 -3
  287. app-rn-runtime/runtime/App.js +12 -7
  288. app-rn-runtime/runtime/App.js.map +1 -1
  289. app-rn-runtime/runtime/base-page.component.js +1 -1
  290. app-rn-runtime/runtime/base-page.component.js.map +1 -1
  291. app-rn-runtime/runtime/services/app-security.service.js +2 -1
  292. app-rn-runtime/runtime/services/app-security.service.js.map +1 -1
  293. app-rn-runtime/runtime/services/webprocess.service.js +0 -1
  294. app-rn-runtime/runtime/services/webprocess.service.js.map +1 -1
  295. app-rn-runtime/styles/background.component.js +1 -1
  296. app-rn-runtime/styles/background.component.js.map +1 -1
  297. app-rn-runtime/styles/theme.js +43 -0
  298. app-rn-runtime/styles/theme.js.map +1 -1
  299. app-rn-runtime/styles/theme.variables.js +30 -6
  300. app-rn-runtime/styles/theme.variables.js.map +1 -1
  301. app-rn-runtime/variables/model-variable.js +2 -1
  302. app-rn-runtime/variables/model-variable.js.map +1 -1
  303. app-rn-runtime/variables/service-variable.js +14 -6
  304. app-rn-runtime/variables/service-variable.js.map +1 -1
@@ -1 +1 @@
1
- {"version":3,"names":["BASE_THEME","defineStyles","DEFAULT_CLASS","registerStyle","themeVariables","addStyle","defaultStyles","root","text","fontSize","minimumValue","maximumValue","value","track","position","height","flexDirection","width","minWidth","marginVertical","overflow","borderRadius","minimumTrack","backgroundColor","minimumTrackTintColor","borderTopLeftRadius","borderBottomLeftRadius","maximumTrack","maximumTrackTintColor","flex","borderTopRightRadius","borderBottomRightRadius","thumb","marginLeft","marginTop","thumbTintColor","backgroundSize","backgroundPosition","disabled","pointerEvents","opacity"],"sources":["slider.styles.ts"],"sourcesContent":["import BASE_THEME from '@wavemaker/app-rn-runtime/styles/theme';\nimport { BaseStyles, defineStyles } from '@wavemaker/app-rn-runtime/core/base.component';\nimport { TextStyle, ViewStyle } from 'react-native';\n\nexport type WmSliderStyles = BaseStyles & {\n minimumValue: TextStyle,\n maximumValue: TextStyle,\n value: TextStyle,\n track: ViewStyle,\n minimumTrack: ViewStyle,\n maximumTrack: ViewStyle,\n thumb: ViewStyle,\n disabled: ViewStyle\n};\n\nexport const DEFAULT_CLASS = 'app-slider';\nBASE_THEME.registerStyle((themeVariables, addStyle) => {\n const defaultStyles: WmSliderStyles = defineStyles({\n root: {\n },\n text: {\n fontSize: 16\n },\n minimumValue: {\n\n },\n maximumValue: {\n\n },\n value: {\n\n },\n track: {\n position: 'relative',\n height: 4,\n flexDirection: 'row',\n width: '100%',\n minWidth: 160,\n marginVertical: 8,\n overflow: 'hidden',\n borderRadius: 4\n },\n minimumTrack: {\n position: 'absolute',\n height: '100%',\n width: 150,\n backgroundColor: themeVariables.minimumTrackTintColor,\n borderTopLeftRadius: 4,\n borderBottomLeftRadius: 4,\n },\n maximumTrack: {\n position: 'absolute',\n height: '100%',\n backgroundColor: themeVariables.maximumTrackTintColor,\n flex: 1,\n borderTopRightRadius: 4,\n borderBottomRightRadius: 4,\n },\n thumb: {\n height: 16,\n width: 16,\n marginLeft: -8,\n marginTop: -18,\n borderRadius: 16,\n backgroundColor: themeVariables.thumbTintColor,\n backgroundSize: '100% 100%',\n backgroundPosition: 'center'\n },\n disabled: {\n pointerEvents: 'none'\n }\n }) as WmSliderStyles;\n\n addStyle(DEFAULT_CLASS, '', defaultStyles);\n addStyle(DEFAULT_CLASS + '-disabled', '', {\n root : {\n opacity: 0.5\n }\n });\n});"],"mappings":"AAAA,OAAOA,UAAU,MAAM,wCAAwC;AAC/D,SAAqBC,YAAY,QAAQ,+CAA+C;AAcxF,OAAO,MAAMC,aAAa,GAAG,YAAY;AACzCF,UAAU,CAACG,aAAa,CAAC,CAACC,cAAc,EAAEC,QAAQ,KAAK;EACnD,MAAMC,aAA6B,GAAGL,YAAY,CAAC;IAC/CM,IAAI,EAAE,CACN,CAAC;IACDC,IAAI,EAAE;MACFC,QAAQ,EAAE;IACd,CAAC;IACDC,YAAY,EAAE,CAEd,CAAC;IACDC,YAAY,EAAE,CAEd,CAAC;IACDC,KAAK,EAAE,CAEP,CAAC;IACDC,KAAK,EAAE;MACHC,QAAQ,EAAE,UAAU;MACpBC,MAAM,EAAE,CAAC;MACTC,aAAa,EAAE,KAAK;MACpBC,KAAK,EAAE,MAAM;MACbC,QAAQ,EAAE,GAAG;MACbC,cAAc,EAAE,CAAC;MACjBC,QAAQ,EAAE,QAAQ;MAClBC,YAAY,EAAE;IAClB,CAAC;IACDC,YAAY,EAAE;MACVR,QAAQ,EAAE,UAAU;MACpBC,MAAM,EAAE,MAAM;MACdE,KAAK,EAAG,GAAG;MACXM,eAAe,EAAEnB,cAAc,CAACoB,qBAAqB;MACrDC,mBAAmB,EAAE,CAAC;MACtBC,sBAAsB,EAAE;IAC5B,CAAC;IACDC,YAAY,EAAE;MACVb,QAAQ,EAAE,UAAU;MACpBC,MAAM,EAAE,MAAM;MACdQ,eAAe,EAAEnB,cAAc,CAACwB,qBAAqB;MACrDC,IAAI,EAAE,CAAC;MACPC,oBAAoB,EAAE,CAAC;MACvBC,uBAAuB,EAAE;IAC7B,CAAC;IACDC,KAAK,EAAE;MACHjB,MAAM,EAAE,EAAE;MACVE,KAAK,EAAE,EAAE;MACTgB,UAAU,EAAE,CAAC,CAAC;MACdC,SAAS,EAAE,CAAC,EAAE;MACdb,YAAY,EAAE,EAAE;MAChBE,eAAe,EAAEnB,cAAc,CAAC+B,cAAc;MAC9CC,cAAc,EAAE,WAAW;MAC3BC,kBAAkB,EAAE;IACxB,CAAC;IACDC,QAAQ,EAAE;MACNC,aAAa,EAAE;IACnB;EACJ,CAAC,CAAmB;EAEpBlC,QAAQ,CAACH,aAAa,EAAE,EAAE,EAAEI,aAAa,CAAC;EAC1CD,QAAQ,CAACH,aAAa,GAAG,WAAW,EAAE,EAAE,EAAE;IACtCK,IAAI,EAAG;MACPiC,OAAO,EAAE;IACT;EACJ,CAAC,CAAC;AACN,CAAC,CAAC"}
1
+ {"version":3,"names":["BASE_THEME","defineStyles","DEFAULT_CLASS","registerStyle","themeVariables","addStyle","defaultStyles","root","text","fontSize","minimumValue","maximumValue","value","track","position","height","flexDirection","width","minWidth","marginVertical","overflow","borderRadius","minimumTrack","backgroundColor","minimumTrackTintColor","borderTopLeftRadius","borderBottomLeftRadius","maximumTrack","maximumTrackTintColor","flex","borderTopRightRadius","borderBottomRightRadius","thumb","marginLeft","marginTop","thumbTintColor","backgroundSize","backgroundPosition","disabled","pointerEvents","opacity"],"sources":["slider.styles.ts"],"sourcesContent":["import BASE_THEME from '@wavemaker/app-rn-runtime/styles/theme';\nimport { BaseStyles, defineStyles } from '@wavemaker/app-rn-runtime/core/base.component';\nimport { TextStyle, ViewStyle } from 'react-native';\n\nexport type WmSliderStyles = BaseStyles & {\n minimumValue: TextStyle,\n maximumValue: TextStyle,\n value: TextStyle,\n track: ViewStyle,\n minimumTrack: ViewStyle,\n maximumTrack: ViewStyle,\n thumb: ViewStyle,\n disabled: ViewStyle\n};\n\nexport const DEFAULT_CLASS = 'app-slider';\nBASE_THEME.registerStyle((themeVariables, addStyle) => {\n const defaultStyles: WmSliderStyles = defineStyles({\n root: {\n },\n text: {\n fontSize: 16\n },\n minimumValue: {\n\n },\n maximumValue: {\n\n },\n value: {\n\n },\n track: {\n position: 'relative',\n height: 4,\n flexDirection: 'row',\n width: '100%',\n minWidth: 160,\n marginVertical: 8,\n overflow: 'hidden',\n borderRadius: 4\n },\n minimumTrack: {\n position: 'absolute',\n height: '100%',\n width: 150,\n backgroundColor: themeVariables.minimumTrackTintColor,\n borderTopLeftRadius: 4,\n borderBottomLeftRadius: 4,\n },\n maximumTrack: {\n position: 'absolute',\n height: '100%',\n backgroundColor: themeVariables.maximumTrackTintColor,\n flex: 1,\n borderTopRightRadius: 4,\n borderBottomRightRadius: 4,\n },\n thumb: {\n height: 20,\n width: 20,\n marginLeft: -8,\n marginTop: -20,\n borderRadius: 16,\n backgroundColor: themeVariables.thumbTintColor,\n backgroundSize: '100% 100%',\n backgroundPosition: 'center'\n },\n disabled: {\n pointerEvents: 'none'\n }\n }) as WmSliderStyles;\n\n addStyle(DEFAULT_CLASS, '', defaultStyles);\n addStyle(DEFAULT_CLASS + '-disabled', '', {\n root : {\n opacity: 0.5\n }\n });\n});"],"mappings":"AAAA,OAAOA,UAAU,MAAM,wCAAwC;AAC/D,SAAqBC,YAAY,QAAQ,+CAA+C;AAcxF,OAAO,MAAMC,aAAa,GAAG,YAAY;AACzCF,UAAU,CAACG,aAAa,CAAC,CAACC,cAAc,EAAEC,QAAQ,KAAK;EACnD,MAAMC,aAA6B,GAAGL,YAAY,CAAC;IAC/CM,IAAI,EAAE,CACN,CAAC;IACDC,IAAI,EAAE;MACFC,QAAQ,EAAE;IACd,CAAC;IACDC,YA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7,7 @@ import { DEFAULT_CLASS } from './switch.styles';
7
7
  import WmIcon from '@wavemaker/app-rn-runtime/components/basic/icon/icon.component';
8
8
  import { BaseDatasetComponent, BaseDatasetState } from '../basedataset/basedataset.component';
9
9
  import { Tappable } from '@wavemaker/app-rn-runtime/core/tappable.component';
10
+ import { AccessibilityWidgetType, getAccessibilityProps } from '@wavemaker/app-rn-runtime/core/accessibility';
10
11
  export class WmSwitchState extends BaseDatasetState {}
11
12
  export default class WmSwitch extends BaseDatasetComponent {
12
13
  constructor(props) {
@@ -18,6 +19,9 @@ export default class WmSwitch extends BaseDatasetComponent {
18
19
  }
19
20
  const oldVal = this.state.props.datavalue;
20
21
  this.validate(value);
22
+ if (value === oldVal) {
23
+ return;
24
+ }
21
25
  if (this.state.props.datafield === 'All Fields') {
22
26
  const selectedItem = find(this.state.dataItems, item => isEqual(item.key, value));
23
27
  value = selectedItem && selectedItem.dataObject;
@@ -49,7 +53,10 @@ export default class WmSwitch extends BaseDatasetComponent {
49
53
  }
50
54
  const displayText = item.displayexp || item.displayfield;
51
55
  const isSelected = this.state.props.datafield === 'All Fields' ? isEqual(props.datavalue, item.datafield) : this.state.props.datavalue === item.datafield;
52
- return /*#__PURE__*/React.createElement(Tappable, _extends({}, this.getTestPropsForAction(index + ''), {
56
+ return /*#__PURE__*/React.createElement(Tappable, _extends({}, this.getTestPropsForAction(index + ''), getAccessibilityProps(AccessibilityWidgetType.SWITCH, {
57
+ ...this.state.props,
58
+ selected: isSelected
59
+ }), {
53
60
  onTap: this.state.props.disabled ? undefined : this.onTap.bind(this, null, item),
54
61
  styles: [this.styles.button, this.styles[btnClass], isSelected ? this.styles.selectedButton : null],
55
62
  key: item.key
@@ -1 +1 @@
1
- {"version":3,"names":["React","Text","View","isEqual","find","WmSwitchProps","DEFAULT_CLASS","WmIcon","BaseDatasetComponent","BaseDatasetState","Tappable","WmSwitchState","WmSwitch","constructor","props","onChange","value","oldVal","state","datavalue","validate","datafield","selectedItem","dataItems","item","key","dataObject","updateState","isDefault","invokeEvent","invokeEventCallback","undefined","proxy","onTap","event","getItemKey","renderChild","index","btnClass","length","displayText","displayexp","displayfield","isSelected","createElement","_extends","getTestPropsForAction","disabled","bind","styles","button","selectedButton","iconclass","id","getTestId","loadingIcon","icon","caption","getTestPropsForLabel","style","text","color","renderWidget","items","root","map"],"sources":["switch.component.tsx"],"sourcesContent":["import React from 'react';\nimport {Text, View} from \"react-native\";\nimport { isEqual, find } from 'lodash';\n\nimport WmSwitchProps from './switch.props';\nimport { DEFAULT_CLASS, WmSwitchStyles } from './switch.styles';\nimport WmIcon from '@wavemaker/app-rn-runtime/components/basic/icon/icon.component';\nimport { BaseDatasetComponent, BaseDatasetState } from '../basedataset/basedataset.component';\nimport { Tappable } from '@wavemaker/app-rn-runtime/core/tappable.component';\n\nexport class WmSwitchState extends BaseDatasetState<WmSwitchProps> {}\n\nexport default class WmSwitch extends BaseDatasetComponent<WmSwitchProps, WmSwitchState, WmSwitchStyles> {\n constructor(props: WmSwitchProps) {\n super(props, DEFAULT_CLASS, new WmSwitchProps());\n }\n\n onChange(value: any) {\n if (!value) {\n return;\n }\n const oldVal = this.state.props.datavalue;\n this.validate(value);\n if (this.state.props.datafield === 'All Fields') {\n const selectedItem = find(this.state.dataItems, (item) => isEqual(item.key, value));\n value = selectedItem && selectedItem.dataObject;\n }\n // @ts-ignore\n this.updateState({props: {datavalue: value}, isDefault: false},\n () => {\n if (!this.props.invokeEvent) {\n this.invokeEventCallback('onChange', [undefined, this.proxy, value, oldVal]);\n }\n });\n }\n\n onTap(event: any, item: any) {\n const value = this.state.props.datafield === 'All Fields' ? this.getItemKey(item.datafield) : item.datafield;\n this.onChange(value);\n this.invokeEventCallback('onTap', [ event, this.proxy ]);\n }\n\n renderChild(item: any, index: any) {\n let btnClass = 'button';\n const props = this.state.props;\n if(index === 0) {\n btnClass = 'firstButton';\n } else if (index+1 === this.state.dataItems.length) {\n btnClass = 'lastButton';\n }\n const displayText = item.displayexp || item.displayfield;\n const isSelected = this.state.props.datafield === 'All Fields' ? isEqual(props.datavalue, item.datafield) : this.state.props.datavalue === item.datafield;\n return (\n <Tappable \n {...this.getTestPropsForAction(index + '')}\n onTap={this.state.props.disabled ? undefined : this.onTap.bind(this, null, item)}\n styles={[\n this.styles.button,\n this.styles[btnClass],\n isSelected ? this.styles.selectedButton : null]}\n key={item.key}>\n {this.state.props.iconclass ?\n (<WmIcon \n id={this.getTestId('icon' + index)}\n styles={this.styles.loadingIcon}\n iconclass={item.icon}\n caption={displayText}></WmIcon>)\n : (<View>\n <Text \n {...this.getTestPropsForLabel('' + index)}\n style={[this.styles.text, \n {color: isSelected ? this.styles.selectedButton.color : this.styles.button.color }]}>\n {displayText}\n </Text>\n </View>)}\n </Tappable>\n );\n };\n\n renderWidget(props: WmSwitchProps) {\n const items = this.state.dataItems;\n return (<View style={this.styles.root}>\n {items && items.length ?\n items.map((item: any, index: any) => this.renderChild(item, index)): null}\n </View>);\n }\n}\n"],"mappings":";AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAAQC,IAAI,EAAEC,IAAI,QAAO,cAAc;AACvC,SAASC,OAAO,EAAEC,IAAI,QAAQ,QAAQ;AAEtC,OAAOC,aAAa,MAAM,gBAAgB;AAC1C,SAASC,aAAa,QAAwB,iBAAiB;AAC/D,OAAOC,MAAM,MAAM,gEAAgE;AACnF,SAASC,oBAAoB,EAAEC,gBAAgB,QAAQ,sCAAsC;AAC7F,SAASC,QAAQ,QAAQ,mDAAmD;AAE5E,OAAO,MAAMC,aAAa,SAASF,gBAAgB,CAAgB;AAEnE,eAAe,MAAMG,QAAQ,SAASJ,oBAAoB,CAA+C;EACvGK,WAAWA,CAACC,KAAoB,EAAE;IAChC,KAAK,CAACA,KAAK,EAAER,aAAa,EAAE,IAAID,aAAa,CAAC,CAAC,CAAC;EAClD;EAEAU,QAAQA,CAACC,KAAU,EAAE;IACnB,IAAI,CAACA,KAAK,EAAE;MACV;IACF;IACA,MAAMC,MAAM,GAAG,I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AC9BxC,KAAA,CAAA4C,aAAA,CAAC1C,IAAI,qBACJF,KAAA,CAAA4C,aAAA,CAAC3C,IAAI,EAAA4C,QAAA,KACC,IAAI,CAACa,oBAAoB,CAAC,EAAE,GAAGrB,KAAK,CAAC;MACzCsB,KAAK,EAAE,CAAC,IAAI,CAACV,MAAM,CAACW,IAAI,EACtB;QAACC,KAAK,EAAElB,UAAU,GAAG,IAAI,CAACM,MAAM,CAACE,cAAc,CAACU,KAAK,GAAG,IAAI,CAACZ,MAAM,CAACC,MAAM,CAACW;MAAM,CAAC;IAAE,IACrFrB,WACG,CACF,CACJ,CAAC;EAEf;EAEAsB,YAAYA,CAAChD,KAAoB,EAAE;IACjC,MAAMiD,KAAK,GAAG,IAAI,CAAC7C,KAAK,CAACK,SAAS;IAClC,oBAAQvB,KAAA,CAAA4C,aAAA,CAAC1C,IAAI;MAACyD,KAAK,EAAE,IAAI,CAACV,MAAM,CAACe;IAAK,GACnCD,KAAK,IAAIA,KAAK,CAACxB,MAAM,GACpBwB,KAAK,CAACE,GAAG,CAAC,CAACzC,IAAS,EAAEa,KAAU,KAAK,IAAI,CAACD,WAAW,CAACZ,IAAI,EAAEa,KAAK,CAAC,CAAC,GAAE,IACnE,CAAC;EACT;AACF"}
1
+ {"version":3,"names":["React","Text","View","isEqual","find","WmSwitchProps","DEFAULT_CLASS","WmIcon","BaseDatasetComponent","BaseDatasetState","Tappable","AccessibilityWidgetType","getAccessibilityProps","WmSwitchState","WmSwitch","constructor","props","onChange","value","oldVal","state","datavalue","validate","datafield","selectedItem","dataItems","item","key","dataObject","updateState","isDefault","invokeEvent","invokeEventCallback","undefined","proxy","onTap","event","getItemKey","renderChild","index","btnClass","length","displayText","displayexp","displayfield","isSelected","createElement","_extends","getTestPropsForAction","SWITCH","selected","disabled","bind","styles","button","selectedButton","iconclass","id","getTestId","loadingIcon","icon","caption","getTestPropsForLabel","style","text","color","renderWidget","items","root","map"],"sources":["switch.component.tsx"],"sourcesContent":["import React from 'react';\nimport {Text, View} from \"react-native\";\nimport { isEqual, find } from 'lodash';\n\nimport WmSwitchProps from './switch.props';\nimport { DEFAULT_CLASS, WmSwitchStyles } from './switch.styles';\nimport WmIcon from '@wavemaker/app-rn-runtime/components/basic/icon/icon.component';\nimport { BaseDatasetComponent, BaseDatasetState } from '../basedataset/basedataset.component';\nimport { Tappable } from '@wavemaker/app-rn-runtime/core/tappable.component';\nimport { AccessibilityWidgetType, getAccessibilityProps } from '@wavemaker/app-rn-runtime/core/accessibility'; \n\nexport class WmSwitchState extends BaseDatasetState<WmSwitchProps> {}\n\nexport default class WmSwitch extends BaseDatasetComponent<WmSwitchProps, WmSwitchState, WmSwitchStyles> {\n constructor(props: WmSwitchProps) {\n super(props, DEFAULT_CLASS, new WmSwitchProps());\n }\n\n onChange(value: any) {\n if (!value) {\n return;\n }\n const oldVal = this.state.props.datavalue;\n this.validate(value);\n if (value === oldVal) {\n return;\n }\n if (this.state.props.datafield === 'All Fields') {\n const selectedItem = find(this.state.dataItems, (item) => isEqual(item.key, value));\n value = selectedItem && selectedItem.dataObject;\n }\n // @ts-ignore\n this.updateState({props: {datavalue: value}, isDefault: false},\n () => {\n if (!this.props.invokeEvent) {\n this.invokeEventCallback('onChange', [undefined, this.proxy, value, oldVal]);\n }\n });\n }\n\n onTap(event: any, item: any) {\n const value = this.state.props.datafield === 'All Fields' ? this.getItemKey(item.datafield) : item.datafield;\n this.onChange(value);\n this.invokeEventCallback('onTap', [ event, this.proxy ]);\n }\n\n renderChild(item: any, index: any) {\n let btnClass = 'button';\n const props = this.state.props;\n if(index === 0) {\n btnClass = 'firstButton';\n } else if (index+1 === this.state.dataItems.length) {\n btnClass = 'lastButton';\n }\n const displayText = item.displayexp || item.displayfield;\n const isSelected = this.state.props.datafield === 'All Fields' ? isEqual(props.datavalue, item.datafield) : this.state.props.datavalue === item.datafield;\n return (\n <Tappable \n {...this.getTestPropsForAction(index + '')}\n {...getAccessibilityProps(AccessibilityWidgetType.SWITCH, {...this.state.props, selected: isSelected})}\n onTap={this.state.props.disabled ? undefined : this.onTap.bind(this, null, item)}\n styles={[\n this.styles.button,\n this.styles[btnClass],\n isSelected ? this.styles.selectedButton : null]}\n key={item.key}>\n {this.state.props.iconclass ?\n (<WmIcon \n id={this.getTestId('icon' + index)}\n styles={this.styles.loadingIcon}\n iconclass={item.icon}\n caption={displayText}></WmIcon>)\n : (<View>\n <Text \n {...this.getTestPropsForLabel('' + index)}\n style={[this.styles.text, \n {color: isSelected ? this.styles.selectedButton.color : this.styles.button.color }]}>\n {displayText}\n </Text>\n </View>)}\n </Tappable>\n );\n };\n\n renderWidget(props: WmSwitchProps) {\n const items = this.state.dataItems;\n return (<View style={this.styles.root}>\n {items && items.length ?\n items.map((item: any, index: any) => this.renderChild(item, index)): null}\n </View>);\n }\n}\n"],"mappings":";AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAAQC,IAAI,EAAEC,IAAI,QAAO,cAAc;AACvC,SAASC,OAAO,EAAEC,IAAI,QAAQ,QAAQ;AAEtC,OAAOC,aAAa,MAAM,gBAAgB;AAC1C,SAASC,aAAa,QAAwB,iBAAiB;AAC/D,OAAOC,MAAM,MAAM,gEAAgE;AACnF,SAASC,oBAAoB,EAAEC,gBAAgB,QAAQ,sCAAsC;AAC7F,SAASC,QAAQ,QAAQ,mDAAmD;AAC5E,SAASC,uBAAuB,EAAEC,qBAAqB,QAAQ,8CAA8C;AAE7G,OAAO,MAAMC,aAAa,SAASJ,gBAAgB,CAAgB;AAEnE,eAAe,MAAMK,QAAQ,SAASN,oBAAoB,CAA+C;EACvGO,WAAWA,CAACC,KAAoB,EAAE;IAChC,KAAK,CAACA,KAAK,EAAEV,aAAa,EAAE,IAAID,aAAa,CAAC,CAAC,CAAC;EAClD;EAEAY,QAAQA,CAACC,KAAU,EAAE;IACnB,IAAI,CAACA,KAAK,EAAE;MACV;IACF;IACA,MAAMC,MAAM,GAAG,IAAI,CAACC,KAAK,CAACJ,KAAK,CAACK,SAAS;IACzC,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K,CAAE;MACnCc,MAAM,EAAE,IAAI,CAACA,MAAM,CAACM,WAAY;MAChCH,SAAS,EAAE9B,IAAI,CAACkC,IAAK;MACrBC,OAAO,EAAEnB;IAAY,CAAS,CAAC,gBAC9B1C,KAAA,CAAA8C,aAAA,CAAC5C,IAAI,qBACJF,KAAA,CAAA8C,aAAA,CAAC7C,IAAI,EAAA8C,QAAA,KACC,IAAI,CAACe,oBAAoB,CAAC,EAAE,GAAGvB,KAAK,CAAC;MACzCwB,KAAK,EAAE,CAAC,IAAI,CAACV,MAAM,CAACW,IAAI,EACtB;QAACC,KAAK,EAAEpB,UAAU,GAAG,IAAI,CAACQ,MAAM,CAACE,cAAc,CAACU,KAAK,GAAG,IAAI,CAACZ,MAAM,CAACC,MAAM,CAACW;MAAM,CAAC;IAAE,IACrFvB,WACG,CACF,CACJ,CAAC;EAEf;EAEAwB,YAAYA,CAAClD,KAAoB,EAAE;IACjC,MAAMmD,KAAK,GAAG,IAAI,CAAC/C,KAAK,CAACK,SAAS;IAClC,oBAAQzB,KAAA,CAAA8C,aAAA,CAAC5C,IAAI;MAAC6D,KAAK,EAAE,IAAI,CAACV,MAAM,CAACe;IAAK,GACnCD,KAAK,IAAIA,KAAK,CAAC1B,MAAM,GACpB0B,KAAK,CAACE,GAAG,CAAC,CAAC3C,IAAS,EAAEa,KAAU,KAAK,IAAI,CAACD,WAAW,CAACZ,IAAI,EAAEa,KAAK,CAAC,CAAC,GAAE,IACnE,CAAC;EACT;AACF"}
@@ -31,7 +31,12 @@ BASE_THEME.registerStyle((themeVariables, addStyle) => {
31
31
  fontSize: 14,
32
32
  minWidth: 64,
33
33
  minHeight: 40,
34
- borderRadius: 0,
34
+ paddingLeft: 16,
35
+ paddingRight: 16,
36
+ borderTopLeftRadius: 0,
37
+ borderBottomLeftRadius: 0,
38
+ borderBottomRightRadius: 0,
39
+ borderTopRightRadius: 0,
35
40
  borderColor: themeVariables.switchBorderColor,
36
41
  borderWidth: 1,
37
42
  borderRightWidth: 0,
@@ -46,16 +51,16 @@ BASE_THEME.registerStyle((themeVariables, addStyle) => {
46
51
  borderColor: themeVariables.switchBorderColor
47
52
  },
48
53
  firstButton: {
49
- borderTopLeftRadius: 6,
50
- borderBottomLeftRadius: 6,
54
+ borderTopLeftRadius: 18,
55
+ borderBottomLeftRadius: 18,
51
56
  borderTopRightRadius: 0,
52
57
  borderBottomRightRadius: 0
53
58
  },
54
59
  lastButton: {
55
60
  borderTopLeftRadius: 0,
56
61
  borderBottomLeftRadius: 0,
57
- borderTopRightRadius: 6,
58
- borderBottomRightRadius: 6,
62
+ borderTopRightRadius: 18,
63
+ borderBottomRightRadius: 18,
59
64
  borderRightWidth: 1
60
65
  }
61
66
  });
@@ -1 +1 @@
1
- {"version":3,"names":["BASE_THEME","defineStyles","Platform","DEFAULT_CLASS","registerStyle","themeVariables","addStyle","defaultStyles","root","minHeight","padding","flexDirection","text","fontWeight","fontSize","textTransform","loadingIcon","flex","alignSelf","justifyContent","color","listSubTitleColor","button","backgroundColor","switchBgColor","switchTextColor","minWidth","borderRadius","borderColor","switchBorderColor","borderWidth","borderRightWidth","fontFamily","baseFont","alignItems","selectedButton","switchActiveTextColor","switchActiveBgColor","firstButton","borderTopLeftRadius","borderBottomLeftRadius","borderTopRightRadius","borderBottomRightRadius","lastButton","OS","borderLeftWidth"],"sources":["switch.styles.ts"],"sourcesContent":["import BASE_THEME, {AllStyle} from '@wavemaker/app-rn-runtime/styles/theme';\nimport { BaseStyles, defineStyles } from '@wavemaker/app-rn-runtime/core/base.component';\nimport {WmIconStyles} from \"@wavemaker/app-rn-runtime/components/basic/icon/icon.styles\";\nimport { Platform } from 'react-native';\n\nexport type WmSwitchStyles = BaseStyles & {\n loadingIcon: WmIconStyles,\n button: AllStyle,\n selectedButton: AllStyle,\n firstButton: AllStyle,\n lastButton: AllStyle\n};\n\nexport const DEFAULT_CLASS = 'app-switch';\nBASE_THEME.registerStyle((themeVariables, addStyle) => {\n const defaultStyles: WmSwitchStyles = defineStyles<WmSwitchStyles>({\n root: {\n minHeight: 24,\n padding: 4,\n flexDirection: 'row'\n },\n text: {\n fontWeight: '500',\n fontSize: 16,\n textTransform: 'capitalize'\n },\n loadingIcon: {\n root: {\n flex: 1,\n alignSelf: 'center',\n justifyContent: 'center',\n fontSize: 16\n },\n text: {\n color: themeVariables.listSubTitleColor\n }\n } as WmIconStyles,\n button: {\n backgroundColor: themeVariables.switchBgColor,\n color: themeVariables.switchTextColor,\n fontSize: 14,\n minWidth: 64,\n minHeight: 40,\n borderRadius: 0,\n borderColor: themeVariables.switchBorderColor,\n borderWidth: 1,\n borderRightWidth: 0,\n fontWeight: '500',\n fontFamily: themeVariables.baseFont,\n justifyContent: 'center',\n alignItems: 'center'\n } as AllStyle,\n selectedButton: {\n color: themeVariables.switchActiveTextColor,\n backgroundColor: themeVariables.switchActiveBgColor,\n borderColor: themeVariables.switchBorderColor\n } as AllStyle,\n firstButton: {\n borderTopLeftRadius: 6,\n borderBottomLeftRadius: 6,\n borderTopRightRadius: 0,\n borderBottomRightRadius: 0\n } as AllStyle,\n lastButton: {\n borderTopLeftRadius: 0,\n borderBottomLeftRadius: 0,\n borderTopRightRadius: 6,\n borderBottomRightRadius: 6,\n borderRightWidth: 1\n } as AllStyle\n });\n\n addStyle(DEFAULT_CLASS, '', defaultStyles);\n addStyle(DEFAULT_CLASS + '-disabled', '', {\n root: {}\n });\n addStyle(DEFAULT_CLASS + '-rtl', '', Platform.OS==\"web\"?{\n firstButton:{\n borderTopLeftRadius: 0,\n borderBottomLeftRadius: 0,\n borderTopRightRadius: 6,\n borderBottomRightRadius: 6,\n borderRightWidth: 1,\n borderLeftWidth: 0\n } ,\n lastButton:{\n borderTopLeftRadius: 6,\n borderBottomLeftRadius: 6,\n borderTopRightRadius: 0,\n borderBottomRightRadius: 0,\n borderRightWidth: 0\n }\n }:{});\n addStyle(DEFAULT_CLASS + '1-rtl', '', Platform.OS==\"web\"?{\n firstButton:{\n borderTopLeftRadius: 0,\n borderBottomLeftRadius: 0,\n borderTopRightRadius: 500,\n borderBottomRightRadius: 500,\n borderRightWidth: 0,\n borderLeftWidth: 1\n } ,\n lastButton:{\n flex: 1,\n borderTopLeftRadius: 500,\n borderBottomLeftRadius: 500,\n borderTopRightRadius: 0,\n borderBottomRightRadius: 0,\n borderRightWidth: 1\n }\n }:{});\n addStyle(DEFAULT_CLASS + '1', '', {\n firstButton: {\n borderTopLeftRadius: 500,\n borderBottomLeftRadius: 500,\n borderTopRightRadius: 0,\n borderBottomRightRadius: 0\n } as AllStyle,\n lastButton: {\n flex: 1,\n borderTopLeftRadius: 0,\n borderBottomLeftRadius: 0,\n borderTopRightRadius: 500,\n borderBottomRightRadius: 500\n } as AllStyle\n } as WmSwitchStyles);\n});"],"mappings":"AAAA,OAAOA,UAAU,MAAkB,wCAAwC;AAC3E,SAAqBC,YAAY,QAAQ,+CAA+C;AAExF,SAASC,QAAQ,QAAQ,cAAc;AAUvC,OAAO,MAAMC,aAAa,GAAG,YAAY;AACzCH,UAAU,CAACI,aAAa,CAAC,CAACC,cAAc,EAAEC,QAAQ,KAAK;EACrD,MAAMC,aAA6B,GAAGN,YAAY,CAAiB;IAC/DO,IAAI,EAAE;MACJC,SAAS,EAAE,EAAE;MACbC,OAAO,EAAE,CAAC;MACVC,aAAa,EAAE;IACjB,CAAC;IACDC,IAAI,EAAE;MACJC,UAAU,EAAE,KAAK;MACjBC,QAAQ,EAAE,EAAE;MACZC,aAAa,EAAE;IACjB,CAAC;IACHC,WAAW,EAAE;MACXR,IAAI,EAAE;QACJS,IAAI,EAAE,CAAC;QACPC,SAAS,EAAE,QAAQ;QACnBC,cAAc,EAAE,QAAQ;QACxBL,QAAQ,EAAE;MACZ,CAAC;MACDF,IAAI,EAAE;QACJQ,KAAK,EAAEf,cAAc,CAACgB;MACxB;IACF,CAAiB;IACjBC,MAAM,EAAE;MACNC,eAAe,EAAElB,cAAc,CAACmB,aAAa;MAC7CJ,KAAK,EAAEf,cAAc,CAACoB,eAAe;M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F,UAAU,EAAC;MACTJ,mBAAmB,EAAE,CAAC;MACtBC,sBAAsB,EAAE,CAAC;MACzBC,oBAAoB,EAAE,CAAC;MACvBC,uBAAuB,EAAE,CAAC;MAC1BX,gBAAgB,EAAE;IACpB;EACF,CAAC,GAAC,CAAC,CAAC,CAAC;EACLzB,QAAQ,CAACH,aAAa,GAAG,OAAO,EAAE,EAAE,EAAED,QAAQ,CAAC0C,EAAE,IAAE,KAAK,GAAC;IACvDN,WAAW,EAAC;MACVC,mBAAmB,EAAE,CAAC;MACtBC,sBAAsB,EAAE,CAAC;MACzBC,oBAAoB,EAAE,GAAG;MACzBC,uBAAuB,EAAE,GAAG;MAC5BX,gBAAgB,EAAE,CAAC;MACnBc,eAAe,EAAE;IACnB,CAAC;IACDF,UAAU,EAAC;MACT1B,IAAI,EAAE,CAAC;MACPsB,mBAAmB,EAAE,GAAG;MACxBC,sBAAsB,EAAE,GAAG;MAC3BC,oBAAoB,EAAE,CAAC;MACvBC,uBAAuB,EAAE,CAAC;MAC1BX,gBAAgB,EAAE;IACpB;EACF,CAAC,GAAC,CAAC,CAAC,CAAC;EACLzB,QAAQ,CAACH,aAAa,GAAG,GAAG,EAAE,EAAE,EAAE;IAChCmC,WAAW,EAAE;MACXC,mBAAmB,EAAE,GAAG;MACxBC,sBAAsB,EAAE,GAAG;MAC3BC,oBAAoB,EAAE,CAAC;MACvBC,uBAAuB,EAAE;IAC3B,CAAa;IACbC,UAAU,EAAE;MACV1B,IAAI,EAAE,CAAC;MACPsB,mBAAmB,EAAE,CAAC;MACtBC,sBAAsB,EAAE,CAAC;MACzBC,oBAAoB,EAAE,GAAG;MACzBC,uBAAuB,EAAE;IAC3B;EACF,CAAmB,CAAC;AACtB,CAAC,CAAC"}
1
+ {"version":3,"names":["BASE_THEME","defineStyles","Platform","DEFAULT_CLASS","registerStyle","themeVariables","addStyle","defaultStyles","root","minHeight","padding","flexDirection","text","fontWeight","fontSize","textTransform","loadingIcon","flex","alignSelf","justifyContent","color","listSubTitleColor","button","backgroundColor","switchBgColor","switchTextColor","minWidth","paddingLeft","paddingRight","borderTopLeftRadius","borderBottomLeftRadius","borderBottomRightRadius","borderTopRightRadius","borderColor","switchBorderColor","borderWidth","borderRightWidth","fontFamily","baseFont","alignItems","selectedButton","switchActiveTextColor","switchActiveBgColor","firstButton","lastButton","OS","borderLeftWidth"],"sources":["switch.styles.ts"],"sourcesContent":["import BASE_THEME, {AllStyle} from '@wavemaker/app-rn-runtime/styles/theme';\nimport { BaseStyles, defineStyles } from '@wavemaker/app-rn-runtime/core/base.component';\nimport {WmIconStyles} from \"@wavemaker/app-rn-runtime/components/basic/icon/icon.styles\";\nimport { Platform } from 'react-native';\n\nexport type WmSwitchStyles = BaseStyles & {\n loadingIcon: WmIconStyles,\n button: AllStyle,\n selectedButton: AllStyle,\n firstButton: AllStyle,\n lastButton: AllStyle\n};\n\nexport const DEFAULT_CLASS = 'app-switch';\nBASE_THEME.registerStyle((themeVariables, addStyle) => {\n const defaultStyles: WmSwitchStyles = defineStyles<WmSwitchStyles>({\n root: {\n minHeight: 24,\n padding: 4,\n flexDirection: 'row'\n },\n text: {\n fontWeight: '500',\n fontSize: 16,\n textTransform: 'capitalize'\n },\n loadingIcon: {\n root: {\n flex: 1,\n alignSelf: 'center',\n justifyContent: 'center',\n fontSize: 16\n },\n text: {\n color: themeVariables.listSubTitleColor\n }\n } as WmIconStyles,\n button: {\n backgroundColor: themeVariables.switchBgColor,\n color: themeVariables.switchTextColor,\n fontSize: 14,\n minWidth: 64,\n minHeight: 40,\n paddingLeft: 16,\n paddingRight: 16,\n borderTopLeftRadius: 0,\n borderBottomLeftRadius: 0,\n borderBottomRightRadius: 0,\n borderTopRightRadius: 0,\n borderColor: themeVariables.switchBorderColor,\n borderWidth: 1,\n borderRightWidth: 0,\n fontWeight: '500',\n fontFamily: themeVariables.baseFont,\n justifyContent: 'center',\n alignItems: 'center'\n } as AllStyle,\n selectedButton: {\n color: themeVariables.switchActiveTextColor,\n backgroundColor: themeVariables.switchActiveBgColor,\n borderColor: themeVariables.switchBorderColor\n } as AllStyle,\n firstButton: {\n borderTopLeftRadius: 18,\n borderBottomLeftRadius: 18,\n borderTopRightRadius: 0,\n borderBottomRightRadius: 0\n } as AllStyle,\n lastButton: {\n borderTopLeftRadius: 0,\n borderBottomLeftRadius: 0,\n borderTopRightRadius: 18,\n borderBottomRightRadius: 18,\n borderRightWidth: 1\n } as AllStyle\n });\n\n addStyle(DEFAULT_CLASS, '', defaultStyles);\n addStyle(DEFAULT_CLASS + '-disabled', '', {\n root: {}\n });\n addStyle(DEFAULT_CLASS + '-rtl', '', Platform.OS==\"web\"?{\n firstButton:{\n borderTopLeftRadius: 0,\n borderBottomLeftRadius: 0,\n borderTopRightRadius: 6,\n borderBottomRightRadius: 6,\n borderRightWidth: 1,\n borderLeftWidth: 0\n } ,\n lastButton:{\n borderTopLeftRadius: 6,\n borderBottomLeftRadius: 6,\n borderTopRightRadius: 0,\n borderBottomRightRadius: 0,\n borderRightWidth: 0\n }\n }:{});\n addStyle(DEFAULT_CLASS + '1-rtl', '', Platform.OS==\"web\"?{\n firstButton:{\n borderTopLeftRadius: 0,\n borderBottomLeftRadius: 0,\n borderTopRightRadius: 500,\n borderBottomRightRadius: 500,\n borderRightWidth: 0,\n borderLeftWidth: 1\n } ,\n lastButton:{\n flex: 1,\n borderTopLeftRadius: 500,\n borderBottomLeftRadius: 500,\n borderTopRightRadius: 0,\n borderBottomRightRadius: 0,\n borderRightWidth: 1\n }\n }:{});\n addStyle(DEFAULT_CLASS + '1', '', {\n firstButton: {\n borderTopLeftRadius: 500,\n borderBottomLeftRadius: 500,\n borderTopRightRadius: 0,\n borderBottomRightRadius: 0\n } as AllStyle,\n lastButton: {\n flex: 1,\n borderTopLeftRadius: 0,\n borderBottomLeftRadius: 0,\n borderTopRightRadius: 500,\n borderBottomRightRadius: 500\n } as AllStyle\n } as WmSwitchStyles);\n});"],"mappings":"AAAA,OAAOA,UAAU,MAAkB,wCAAwC;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AAoB,EAAE,GAAG;MACzBD,uBAAuB,EAAE,GAAG;MAC5BK,gBAAgB,EAAE,CAAC;MACnBU,eAAe,EAAE;IACnB,CAAC;IACDF,UAAU,EAAC;MACT3B,IAAI,EAAE,CAAC;MACPY,mBAAmB,EAAE,GAAG;MACxBC,sBAAsB,EAAE,GAAG;MAC3BE,oBAAoB,EAAE,CAAC;MACvBD,uBAAuB,EAAE,CAAC;MAC1BK,gBAAgB,EAAE;IACpB;EACF,CAAC,GAAC,CAAC,CAAC,CAAC;EACL9B,QAAQ,CAACH,aAAa,GAAG,GAAG,EAAE,EAAE,EAAE;IAChCwC,WAAW,EAAE;MACXd,mBAAmB,EAAE,GAAG;MACxBC,sBAAsB,EAAE,GAAG;MAC3BE,oBAAoB,EAAE,CAAC;MACvBD,uBAAuB,EAAE;IAC3B,CAAa;IACba,UAAU,EAAE;MACV3B,IAAI,EAAE,CAAC;MACPY,mBAAmB,EAAE,CAAC;MACtBC,sBAAsB,EAAE,CAAC;MACzBE,oBAAoB,EAAE,GAAG;MACzBD,uBAAuB,EAAE;IAC3B;EACF,CAAmB,CAAC;AACtB,CAAC,CAAC"}
@@ -6,17 +6,26 @@ import { DEFAULT_CLASS } from './text.styles';
6
6
  import { WMTextInput } from '@wavemaker/app-rn-runtime/core/components/textinput.component';
7
7
  import { BaseInputComponent, BaseInputState } from "@wavemaker/app-rn-runtime/components/input/baseinput/baseinput.component";
8
8
  import { isNull } from 'lodash';
9
+ import { AccessibilityWidgetType, getAccessibilityProps } from '@wavemaker/app-rn-runtime/core/accessibility';
9
10
  export class WmTextState extends BaseInputState {}
10
11
  export default class WmText extends BaseInputComponent {
11
12
  constructor(props) {
12
13
  super(props, DEFAULT_CLASS, new WmTextProps(), new WmTextState());
13
14
  }
15
+ getStyleClassName() {
16
+ const classes = [];
17
+ if (this.state.props.floatinglabel) {
18
+ classes.push('app-text-with-label');
19
+ }
20
+ classes.push(super.getStyleClassName());
21
+ return classes.join(' ');
22
+ }
14
23
  renderWidget(props) {
15
24
  var _this$state$textValue;
16
25
  let opts = {};
17
26
  const valueExpr = Platform.OS === 'web' ? 'value' : 'defaultValue';
18
27
  opts[valueExpr] = ((_this$state$textValue = this.state.textValue) === null || _this$state$textValue === void 0 ? void 0 : _this$state$textValue.toString()) || '';
19
- return /*#__PURE__*/React.createElement(WMTextInput, _extends({}, this.getTestPropsForInput(), {
28
+ return /*#__PURE__*/React.createElement(WMTextInput, _extends({}, this.getTestPropsForInput(), getAccessibilityProps(AccessibilityWidgetType.TEXT, props), {
20
29
  ref: ref => {
21
30
  this.widgetRef = ref;
22
31
  // @ts-ignore
@@ -26,6 +35,9 @@ export default class WmText extends BaseInputComponent {
26
35
  }
27
36
  }
28
37
  }, opts, {
38
+ floatingLabel: props.floatinglabel,
39
+ floatingLabelStyle: this.styles.floatingLabel,
40
+ activeFloatingLabelStyle: this.styles.activeFloatingLabel,
29
41
  placeholderTextColor: this.styles.placeholderText.color,
30
42
  style: [this.styles.root, this.state.isValid ? {} : this.styles.invalid],
31
43
  keyboardType: this.state.keyboardType,
@@ -1 +1 @@
1
- {"version":3,"names":["React","Platform","WmTextProps","DEFAULT_CLASS","WMTextInput","BaseInputComponent","BaseInputState","isNull","WmTextState","WmText","constructor","props","renderWidget","_this$state$textValue","opts","valueExpr","OS","state","textValue","toString","createElement","_extends","getTestPropsForInput","ref","widgetRef","selectionStart","selectionEnd","cursor","placeholderTextColor","styles","placeholderText","color","style","root","isValid","invalid","keyboardType","autoComplete","autocomplete","autoFocus","autofocus","editable","disabled","readonly","secureTextEntry","type","maxLength","maxchars","placeholder","onBlur","bind","onFocus","onKeyPress","onChangeText","onChange","invokeChange","allowContentSelection","text","userSelect"],"sources":["text.component.tsx"],"sourcesContent":["import React from 'react';\nimport { Platform } from 'react-native';\n\nimport WmTextProps from './text.props';\nimport { DEFAULT_CLASS, WmTextStyles } from './text.styles';\nimport { WMTextInput } from '@wavemaker/app-rn-runtime/core/components/textinput.component';\nimport { BaseInputComponent, BaseInputState } from \"@wavemaker/app-rn-runtime/components/input/baseinput/baseinput.component\";\nimport { isNull } from 'lodash';\n\nexport class WmTextState extends BaseInputState<WmTextProps> {\n}\n\nexport default class WmText extends BaseInputComponent<WmTextProps, WmTextState, WmTextStyles> {\n\n constructor(props: WmTextProps) {\n super(props, DEFAULT_CLASS, new WmTextProps(), new WmTextState());\n }\n\n renderWidget(props: WmTextProps) {\n let opts: any = {};\n const valueExpr = Platform.OS === 'web' ? 'value' : 'defaultValue';\n opts[valueExpr] = this.state.textValue?.toString() || '';\n return (\n <WMTextInput\n {...this.getTestPropsForInput()}\n ref={(ref: any) => {this.widgetRef = ref;\n // @ts-ignore\n if (ref && !isNull(ref.selectionStart) && !isNull(ref.selectionEnd)) {\n // @ts-ignore\n ref.selectionStart = ref.selectionEnd = this.cursor;\n }}}\n {...opts}\n placeholderTextColor={this.styles.placeholderText.color as any}\n style={[this.styles.root, this.state.isValid ? {} : this.styles.invalid]}\n keyboardType={this.state.keyboardType}\n autoComplete={props.autocomplete ? 'username' : 'off'}\n autoFocus={props.autofocus}\n editable={props.disabled || props.readonly ? false : true}\n secureTextEntry={props.type === 'password' ? true : false}\n maxLength={props.maxchars}\n placeholder={props.placeholder}\n onBlur={this.onBlur.bind(this)}\n onFocus={this.onFocus.bind(this)}\n onKeyPress={this.onKeyPress.bind(this)}\n onChangeText={this.onChangeText.bind(this)}\n onChange={this.invokeChange.bind(this)}\n allowContentSelection={this.styles.text.userSelect === 'text'}\n />\n );\n }\n}\n"],"mappings":";AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,QAAQ,QAAQ,cAAc;AAEvC,OAAOC,WAAW,MAAM,cAAc;AACtC,SAASC,aAAa,QAAsB,eAAe;AAC3D,SAASC,WAAW,QAAQ,+DAA+D;AAC3F,SAASC,kBAAkB,EAAEC,cAAc,QAAQ,0EAA0E;AAC7H,SAASC,MAAM,QAAQ,QAAQ;AAE/B,OAAO,MAAMC,WAAW,SAASF,cAAc,CAAc;AAG7D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YAAY,GAAG,UAAU,GAAG,KAAM;MACtDC,SAAS,EAAE5B,KAAK,CAAC6B,SAAU;MAC3BC,QAAQ,EAAE9B,KAAK,CAAC+B,QAAQ,IAAI/B,KAAK,CAACgC,QAAQ,GAAG,KAAK,GAAG,IAAK;MAC1DC,eAAe,EAAEjC,KAAK,CAACkC,IAAI,KAAK,UAAU,GAAG,IAAI,GAAG,KAAM;MAC1DC,SAAS,EAAEnC,KAAK,CAACoC,QAAS;MAC1BC,WAAW,EAAErC,KAAK,CAACqC,WAAY;MAC/BC,MAAM,EAAE,IAAI,CAACA,MAAM,CAACC,IAAI,CAAC,IAAI,CAAE;MAC/BC,OAAO,EAAE,IAAI,CAACA,OAAO,CAACD,IAAI,CAAC,IAAI,CAAE;MACjCE,UAAU,EAAE,IAAI,CAACA,UAAU,CAACF,IAAI,CAAC,IAAI,CAAE;MACvCG,YAAY,EAAE,IAAI,CAACA,YAAY,CAACH,IAAI,CAAC,IAAI,CAAE;MAC3CI,QAAQ,EAAE,IAAI,CAACC,YAAY,CAACL,IAAI,CAAC,IAAI,CAAE;MACvCM,qBAAqB,EAAE,IAAI,CAAC3B,MAAM,CAAC4B,IAAI,CAACC,UAAU,KAAK;IAAO,EAC/D,CAAC;EAER;AACF"}
1
+ {"version":3,"names":["React","Platform","WmTextProps","DEFAULT_CLASS","WMTextInput","BaseInputComponent","BaseInputState","isNull","AccessibilityWidgetType","getAccessibilityProps","WmTextState","WmText","constructor","props","getStyleClassName","classes","state","floatinglabel","push","join","renderWidget","_this$state$textValue","opts","valueExpr","OS","textValue","toString","createElement","_extends","getTestPropsForInput","TEXT","ref","widgetRef","selectionStart","selectionEnd","cursor","floatingLabel","floatingLabelStyle","styles","activeFloatingLabelStyle","activeFloatingLabel","placeholderTextColor","placeholderText","color","style","root","isValid","invalid","keyboardType","autoComplete","autocomplete","autoFocus","autofocus","editable","disabled","readonly","secureTextEntry","type","maxLength","maxchars","placeholder","onBlur","bind","onFocus","onKeyPress","onChangeText","onChange","invokeChange","allowContentSelection","text","userSelect"],"sources":["text.component.tsx"],"sourcesContent":["import React from 'react';\nimport { Platform } from 'react-native';\n\nimport WmTextProps from './text.props';\nimport { DEFAULT_CLASS, WmTextStyles } from './text.styles';\nimport { WMTextInput } from '@wavemaker/app-rn-runtime/core/components/textinput.component';\nimport { BaseInputComponent, BaseInputState } from \"@wavemaker/app-rn-runtime/components/input/baseinput/baseinput.component\";\nimport { isNull } from 'lodash';\nimport { AccessibilityWidgetType, getAccessibilityProps } from '@wavemaker/app-rn-runtime/core/accessibility'; \n\nexport class WmTextState extends BaseInputState<WmTextProps> {\n}\n\nexport default class WmText extends BaseInputComponent<WmTextProps, WmTextState, WmTextStyles> {\n\n constructor(props: WmTextProps) {\n super(props, DEFAULT_CLASS, new WmTextProps(), new WmTextState());\n }\n\n public getStyleClassName(): string | undefined {\n const classes = [];\n if (this.state.props.floatinglabel) {\n classes.push('app-text-with-label'); \n }\n classes.push(super.getStyleClassName());\n return classes.join(' ');\n }\n\n renderWidget(props: WmTextProps) {\n let opts: any = {};\n const valueExpr = Platform.OS === 'web' ? 'value' : 'defaultValue';\n opts[valueExpr] = this.state.textValue?.toString() || '';\n return (\n <WMTextInput\n {...this.getTestPropsForInput()}\n {...getAccessibilityProps(\n AccessibilityWidgetType.TEXT,\n props\n )}\n ref={(ref: any) => {this.widgetRef = ref;\n // @ts-ignore\n if (ref && !isNull(ref.selectionStart) && !isNull(ref.selectionEnd)) {\n // @ts-ignore\n ref.selectionStart = ref.selectionEnd = this.cursor;\n }}}\n {...opts}\n floatingLabel={props.floatinglabel}\n floatingLabelStyle={this.styles.floatingLabel}\n activeFloatingLabelStyle={this.styles.activeFloatingLabel}\n placeholderTextColor={this.styles.placeholderText.color as any}\n style={[this.styles.root, this.state.isValid ? {} : this.styles.invalid]}\n keyboardType={this.state.keyboardType}\n autoComplete={props.autocomplete ? 'username' : 'off'}\n autoFocus={props.autofocus}\n editable={props.disabled || props.readonly ? false : true}\n secureTextEntry={props.type === 'password' ? true : false}\n maxLength={props.maxchars}\n placeholder={props.placeholder}\n onBlur={this.onBlur.bind(this)}\n onFocus={this.onFocus.bind(this)}\n onKeyPress={this.onKeyPress.bind(this)}\n onChangeText={this.onChangeText.bind(this)}\n onChange={this.invokeChange.bind(this)}\n allowContentSelection={this.styles.text.userSelect === 'text'}\n />\n );\n }\n}\n"],"mappings":";AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,QAAQ,QAAQ,cAAc;AAEvC,OAAOC,WAAW,MAAM,cAAc;AACtC,SAASC,aAAa,QAAsB,eAAe;AAC3D,SAASC,WAAW,QAAQ,+DAA+D;AAC3F,SAASC,kBAAkB,EAAEC,cAAc,QAAQ,0EAA0E;AAC7H,SAASC,MAAM,QAAQ,QAAQ;AAC/B,SAASC,uBAAuB,EAAEC,qBAAqB,QAAQ,8CAA8C;AAE7G,OAAO,MAAMC,WAAW,SAASJ,cAAc,CAAc;AAG7D,eAAe,MAAMK,MAAM,SAASN,kBAAkB,CAAyC;EAE7FO,WAAWA,CAACC,KAAkB,EAAE;IAC9B,KAAK,CAACA,KAAK,EAAEV,aAAa,EAAE,IAAID,WAAW,CAAC,CAAC,EAAE,IAAIQ,WAAW,CAAC,CAAC,CAAC;EACnE;EAEOI,iBAAiBA,CAAA,EAAuB;IAC7C,MAAMC,OAAO,GAAG,EAAE;IAClB,IAAI,IAAI,CAACC,KAAK,CAACH,KAAK,CAACI,aAAa,EAAE;MAClCF,OAAO,CAACG,IAAI,CAAC,qBAAqB,CAAC;IACrC;IACAH,OAAO,CAACG,IAAI,CAAC,KAAK,CAACJ,iBAAiB,CAAC,CAAC,CAAC;IACvC,OAAOC,OAAO,CAACI,IAAI,CAAC,GAAG,CAAC;EAC1B;EAEAC,YAAYA,CAACP,KAAkB,EAAE;IAAA,IAAAQ,qBAAA;IAC/B,IAAIC,IAAS,GAAG,CAAC,CAAC;IAClB,MAAMC,SAAS,GAAGtB,QAAQ,CAACuB,EAAE,KAAK,KAAK,GA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,KAAK,CAAC0C,QAAQ,GAAG,KAAK,GAAG,IAAK;MAC1DC,eAAe,EAAE3C,KAAK,CAAC4C,IAAI,KAAK,UAAU,GAAG,IAAI,GAAG,KAAM;MAC1DC,SAAS,EAAE7C,KAAK,CAAC8C,QAAS;MAC1BC,WAAW,EAAE/C,KAAK,CAAC+C,WAAY;MAC/BC,MAAM,EAAE,IAAI,CAACA,MAAM,CAACC,IAAI,CAAC,IAAI,CAAE;MAC/BC,OAAO,EAAE,IAAI,CAACA,OAAO,CAACD,IAAI,CAAC,IAAI,CAAE;MACjCE,UAAU,EAAE,IAAI,CAACA,UAAU,CAACF,IAAI,CAAC,IAAI,CAAE;MACvCG,YAAY,EAAE,IAAI,CAACA,YAAY,CAACH,IAAI,CAAC,IAAI,CAAE;MAC3CI,QAAQ,EAAE,IAAI,CAACC,YAAY,CAACL,IAAI,CAAC,IAAI,CAAE;MACvCM,qBAAqB,EAAE,IAAI,CAAC9B,MAAM,CAAC+B,IAAI,CAACC,UAAU,KAAK;IAAO,EAC/D,CAAC;EAER;AACF"}
@@ -5,6 +5,7 @@ import BaseInputProps from "@wavemaker/app-rn-runtime/components/input/baseinput
5
5
  export default class WmTextProps extends BaseInputProps {
6
6
  constructor() {
7
7
  super(...arguments);
8
+ _defineProperty(this, "floatinglabel", void 0);
8
9
  _defineProperty(this, "placeholder", 'Enter text');
9
10
  }
10
11
  }
@@ -1 +1 @@
1
- {"version":3,"names":["BaseInputProps","WmTextProps","constructor","arguments","_defineProperty"],"sources":["text.props.ts"],"sourcesContent":["import BaseInputProps from \"@wavemaker/app-rn-runtime/components/input/baseinput/baseinput.props\";\n\nexport default class WmTextProps extends BaseInputProps {\n placeholder: string = 'Enter text';\n}\n"],"mappings":";;;AAAA,OAAOA,cAAc,MAAM,sEAAsE;AAEjG,eAAe,MAAMC,WAAW,SAASD,cAAc,CAAC;EAAAE,YAAA;IAAA,SAAAC,SAAA;IAAAC,eAAA,sBAChC,YAAY;EAAA;AACpC"}
1
+ {"version":3,"names":["BaseInputProps","WmTextProps","constructor","arguments","_defineProperty"],"sources":["text.props.ts"],"sourcesContent":["import BaseInputProps from \"@wavemaker/app-rn-runtime/components/input/baseinput/baseinput.props\";\n\nexport default class WmTextProps extends BaseInputProps {\n floatinglabel?: string;\n placeholder: string = 'Enter text';\n}\n"],"mappings":";;;AAAA,OAAOA,cAAc,MAAM,sEAAsE;AAEjG,eAAe,MAAMC,WAAW,SAASD,cAAc,CAAC;EAAAE,YAAA;IAAA,SAAAC,SAAA;IAAAC,eAAA;IAAAA,eAAA,sBAEhC,YAAY;EAAA;AACpC"}
@@ -25,6 +25,8 @@ BASE_THEME.registerStyle((themeVariables, addStyle) => {
25
25
  placeholderText: {
26
26
  color: themeVariables.inputPlaceholderColor
27
27
  },
28
+ floatingLabel: {},
29
+ activeFloatingLabel: {},
28
30
  skeleton: {
29
31
  root: {
30
32
  width: '100%',
@@ -44,5 +46,20 @@ BASE_THEME.registerStyle((themeVariables, addStyle) => {
44
46
  textAlign: 'right'
45
47
  }
46
48
  });
49
+ addStyle(DEFAULT_CLASS + '-with-label', '', {
50
+ root: {
51
+ minHeight: 48
52
+ },
53
+ floatingLabel: {
54
+ position: 'absolute',
55
+ top: 12,
56
+ left: 16,
57
+ fontSize: 14,
58
+ color: themeVariables.floatingLabelColor
59
+ },
60
+ activeFloatingLabel: {
61
+ color: themeVariables.activeFloatingLabelColor
62
+ }
63
+ });
47
64
  });
48
65
  //# sourceMappingURL=text.styles.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["BASE_THEME","defineStyles","DEFAULT_CLASS","registerStyle","themeVariables","addStyle","defaultStyles","root","minHeight","paddingTop","paddingBottom","borderWidth","paddingLeft","paddingRight","borderStyle","borderColor","inputBorderColor","backgroundColor","inputBackgroundColor","borderRadius","fontFamily","baseFont","text","fontSize","invalid","borderBottomColor","inputInvalidBorderColor","placeholderText","color","inputPlaceholderColor","skeleton","width","height","inputDisabledBgColor","textAlign"],"sources":["text.styles.ts"],"sourcesContent":["import BASE_THEME, {AllStyle, Theme} from '@wavemaker/app-rn-runtime/styles/theme';\nimport { BaseStyles, defineStyles } from '@wavemaker/app-rn-runtime/core/base.component';\nimport {ColorValue} from \"react-native\";\nimport { WmSkeletonStyles } from '../../basic/skeleton/skeleton.styles';\n\nexport type WmTextStyles = BaseStyles & {\n invalid: AllStyle;\n placeholderText: AllStyle;\n skeleton: WmSkeletonStyles\n};\n\nexport const DEFAULT_CLASS = 'app-text';\nBASE_THEME.registerStyle((themeVariables, addStyle) => {\n const defaultStyles: WmTextStyles = defineStyles({\n root: {\n minHeight: 42,\n paddingTop: 8,\n paddingBottom: 8,\n borderWidth: 1,\n paddingLeft: 16,\n paddingRight: 16,\n borderStyle: 'solid',\n borderColor: themeVariables.inputBorderColor,\n backgroundColor: themeVariables.inputBackgroundColor,\n borderRadius: 6,\n fontFamily: themeVariables.baseFont\n },\n text: {\n fontSize: 16\n },\n invalid: {\n borderBottomColor: themeVariables.inputInvalidBorderColor\n },\n placeholderText: {\n color: themeVariables.inputPlaceholderColor\n },\n skeleton: {\n root: {\n width: '100%',\n height: 16,\n borderRadius: 4\n }\n } as any as WmSkeletonStyles\n });\n\n addStyle(DEFAULT_CLASS, '', defaultStyles);\n addStyle(DEFAULT_CLASS + '-disabled', '', {\n root : {\n backgroundColor: themeVariables.inputDisabledBgColor\n }\n });\n addStyle(DEFAULT_CLASS + '-rtl', '', {\n root:{\n textAlign: 'right'\n }\n })\n});"],"mappings":"AAAA,OAAOA,UAAU,MAAyB,wCAAwC;AAClF,SAAqBC,YAAY,QAAQ,+CAA+C;AAUxF,OAAO,MAAMC,aAAa,GAAG,UAAU;AACvCF,UAAU,CAACG,aAAa,CAAC,CAACC,cAAc,EAAEC,QAAQ,KAAK;EACrD,MAAMC,aAA2B,GAAGL,YAAY,CAAC;IAC7CM,IAAI,EAAE;MACJC,SAAS,EAAE,EAAE;MACbC,UAAU,EAAE,CAAC;MACbC,aAAa,EAAE,CAAC;MAChBC,WAAW,EAAE,CAAC;MACdC,WAAW,EAAE,EAAE;MACfC,YAAY,EAAE,EAAE;MAChBC,WAAW,EAAE,OAAO;MACpBC,WAAW,EAAEX,cAAc,CAACY,gBAAgB;MAC5CC,eAAe,EAAEb,cAAc,CAACc,oBAAoB;MACpDC,YAAY,EAAE,CAAC;MACfC,UAAU,EAAEhB,cAAc,CAACiB;IAC7B,CAAC;IACDC,IAAI,EAAE;MACJC,QAAQ,EAAE;IACZ,CAAC;IACDC,OAAO,EAAE;MACPC,iBAAiB,EAAErB,cAAc,CAACsB;IACpC,CAAC;IACDC,eAAe,EAAE;MACjBC,KAAK,EAAExB,cAAc,CAACyB;IACtB,CAAC;IACDC,QAAQ,EAAE;MACRvB,IAAI,EAAE;QACJwB,KAAK,EAAE,MAAM;QACbC,MAAM,EAAE,EAAE;QACVb,YAAY,EAAE;MAChB;IACF;EACJ,CAAC,CAAC;EAEFd,QAAQ,CAACH,aAAa,EAAE,EAAE,EAAEI,aAAa,CAAC;EAC1CD,QAAQ,CAACH,aAAa,GAAG,WAAW,EAAE,EAAE,EAAE;IACtCK,IAAI,EAAG;MACLU,eAAe,EAAEb,cAAc,CAAC6B;IAClC;EACJ,CAAC,CAAC;EACF5B,QAAQ,CAACH,aAAa,GAAG,MAAM,EAAE,EAAE,EAAE;IACjCK,IAAI,EAAC;MACH2B,SAAS,EAAE;IACb;EACJ,CAAC,CAAC;AACJ,CAAC,CAAC"}
1
+ {"version":3,"names":["BASE_THEME","defineStyles","DEFAULT_CLASS","registerStyle","themeVariables","addStyle","defaultStyles","root","minHeight","paddingTop","paddingBottom","borderWidth","paddingLeft","paddingRight","borderStyle","borderColor","inputBorderColor","backgroundColor","inputBackgroundColor","borderRadius","fontFamily","baseFont","text","fontSize","invalid","borderBottomColor","inputInvalidBorderColor","placeholderText","color","inputPlaceholderColor","floatingLabel","activeFloatingLabel","skeleton","width","height","inputDisabledBgColor","textAlign","position","top","left","floatingLabelColor","activeFloatingLabelColor"],"sources":["text.styles.ts"],"sourcesContent":["import BASE_THEME, {AllStyle, Theme} from '@wavemaker/app-rn-runtime/styles/theme';\nimport { BaseStyles, defineStyles } from '@wavemaker/app-rn-runtime/core/base.component';\nimport {ColorValue} from \"react-native\";\nimport { WmSkeletonStyles } from '../../basic/skeleton/skeleton.styles';\n\nexport type WmTextStyles = BaseStyles & {\n invalid: AllStyle;\n placeholderText: AllStyle;\n floatingLabel: AllStyle;\n activeFloatingLabel: AllStyle;\n skeleton: WmSkeletonStyles;\n};\n\nexport const DEFAULT_CLASS = 'app-text';\nBASE_THEME.registerStyle((themeVariables, addStyle) => {\n const defaultStyles: WmTextStyles = defineStyles({\n root: {\n minHeight: 42,\n paddingTop: 8,\n paddingBottom: 8,\n borderWidth: 1,\n paddingLeft: 16,\n paddingRight: 16,\n borderStyle: 'solid',\n borderColor: themeVariables.inputBorderColor,\n backgroundColor: themeVariables.inputBackgroundColor,\n borderRadius: 6,\n fontFamily: themeVariables.baseFont\n },\n text: {\n fontSize: 16\n },\n invalid: {\n borderBottomColor: themeVariables.inputInvalidBorderColor\n },\n placeholderText: {\n color: themeVariables.inputPlaceholderColor\n },\n floatingLabel: {},\n activeFloatingLabel: {},\n skeleton: {\n root: {\n width: '100%',\n height: 16,\n borderRadius: 4\n }\n } as any as WmSkeletonStyles\n });\n\n addStyle(DEFAULT_CLASS, '', defaultStyles);\n addStyle(DEFAULT_CLASS + '-disabled', '', {\n root : {\n backgroundColor: themeVariables.inputDisabledBgColor\n }\n });\n addStyle(DEFAULT_CLASS + '-rtl', '', {\n root:{\n textAlign: 'right'\n }\n });\n addStyle(DEFAULT_CLASS + '-with-label', '', {\n root: {\n minHeight: 48,\n },\n floatingLabel: {\n position: 'absolute',\n top: 12,\n left: 16,\n fontSize: 14,\n color: themeVariables.floatingLabelColor\n },\n activeFloatingLabel: {\n color: themeVariables.activeFloatingLabelColor\n }\n });\n});"],"mappings":"AAAA,OAAOA,UAAU,MAAyB,wCAAwC;AAClF,SAAqBC,YAAY,QAAQ,+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AE,EAAE;IAC1CK,IAAI,EAAE;MACJC,SAAS,EAAE;IACb,CAAC;IACDsB,aAAa,EAAE;MACbO,QAAQ,EAAE,UAAU;MACpBC,GAAG,EAAE,EAAE;MACPC,IAAI,EAAE,EAAE;MACRhB,QAAQ,EAAE,EAAE;MACZK,KAAK,EAAExB,cAAc,CAACoC;IACxB,CAAC;IACDT,mBAAmB,EAAE;MACnBH,KAAK,EAAExB,cAAc,CAACqC;IACxB;EACF,CAAC,CAAC;AACJ,CAAC,CAAC"}
@@ -6,17 +6,26 @@ import { DEFAULT_CLASS } from './textarea.styles';
6
6
  import { BaseInputComponent, BaseInputState } from '@wavemaker/app-rn-runtime/components/input/baseinput/baseinput.component';
7
7
  import { WMTextInput } from '@wavemaker/app-rn-runtime/core/components/textinput.component';
8
8
  import { isNull } from 'lodash';
9
+ import { AccessibilityWidgetType, getAccessibilityProps } from '@wavemaker/app-rn-runtime/core/accessibility';
9
10
  export class WmTextareaState extends BaseInputState {}
10
11
  export default class WmTextarea extends BaseInputComponent {
11
12
  constructor(props) {
12
13
  super(props, DEFAULT_CLASS, new WmTextareaProps(), new WmTextareaState());
13
14
  }
15
+ getStyleClassName() {
16
+ const classes = [];
17
+ if (this.state.props.floatinglabel) {
18
+ classes.push('app-textarea-with-label');
19
+ }
20
+ classes.push(super.getStyleClassName());
21
+ return classes.join(' ');
22
+ }
14
23
  renderWidget(props) {
15
24
  var _this$state$textValue;
16
25
  let opts = {};
17
26
  const valueExpr = Platform.OS === 'web' ? 'value' : 'defaultValue';
18
27
  opts[valueExpr] = ((_this$state$textValue = this.state.textValue) === null || _this$state$textValue === void 0 ? void 0 : _this$state$textValue.toString()) || '';
19
- return /*#__PURE__*/React.createElement(WMTextInput, _extends({}, this.getTestPropsForInput(), {
28
+ return /*#__PURE__*/React.createElement(WMTextInput, _extends({}, this.getTestPropsForInput(), getAccessibilityProps(AccessibilityWidgetType.TEXTAREA, props), {
20
29
  ref: ref => {
21
30
  this.widgetRef = ref;
22
31
  // @ts-ignore
@@ -31,6 +40,9 @@ export default class WmTextarea extends BaseInputComponent {
31
40
  numberOfLines: 4,
32
41
  keyboardType: this.state.keyboardType
33
42
  }, opts, {
43
+ floatingLabel: props.floatinglabel,
44
+ floatingLabelStyle: this.styles.floatingLabel,
45
+ activeFloatingLabelStyle: this.styles.activeFloatingLabel,
34
46
  autoComplete: props.autocomplete ? 'username' : 'off',
35
47
  autoFocus: props.autofocus,
36
48
  editable: props.disabled || props.readonly ? false : true,
@@ -1 +1 @@
1
- {"version":3,"names":["React","Platform","WmTextareaProps","DEFAULT_CLASS","BaseInputComponent","BaseInputState","WMTextInput","isNull","WmTextareaState","WmTextarea","constructor","props","renderWidget","_this$state$textValue","opts","valueExpr","OS","state","textValue","toString","createElement","_extends","getTestPropsForInput","ref","widgetRef","selectionStart","selectionEnd","cursor","placeholderTextColor","styles","placeholderText","color","style","root","text","isValid","invalid","multiline","numberOfLines","keyboardType","autoComplete","autocomplete","autoFocus","autofocus","editable","disabled","readonly","maxLength","maxchars","placeholder","onBlur","bind","onFocus","onKeyPress","onChangeText","onChange","invokeChange","allowContentSelection","userSelect"],"sources":["textarea.component.tsx"],"sourcesContent":["import React from 'react';\nimport { Platform, TextInput, View } from 'react-native';\nimport WmTextareaProps from './textarea.props';\nimport { DEFAULT_CLASS, WmTextareaStyles } from './textarea.styles';\nimport {\n BaseInputComponent,\n BaseInputState\n} from '@wavemaker/app-rn-runtime/components/input/baseinput/baseinput.component';\nimport { WMTextInput } from '@wavemaker/app-rn-runtime/core/components/textinput.component';\nimport { isNull } from 'lodash';\n\nexport class WmTextareaState extends BaseInputState<WmTextareaProps> {}\n\nexport default class WmTextarea extends BaseInputComponent<WmTextareaProps, WmTextareaState, WmTextareaStyles> {\n\n constructor(props: WmTextareaProps) {\n super(props, DEFAULT_CLASS, new WmTextareaProps(), new WmTextareaState());\n }\n\n renderWidget(props: WmTextareaProps) {\n let opts: any = {};\n const valueExpr = Platform.OS === 'web' ? 'value' : 'defaultValue';\n opts[valueExpr] = this.state.textValue?.toString() || '';\n return ( <WMTextInput\n {...this.getTestPropsForInput()}\n ref={(ref: any) => {this.widgetRef = ref;\n // @ts-ignore\n if (ref && !isNull(ref.selectionStart) && !isNull(ref.selectionEnd)) {\n // @ts-ignore\n ref.selectionStart = ref.selectionEnd = this.cursor;\n }}}\n placeholderTextColor={this.styles.placeholderText.color as any}\n style={[this.styles.root, this.styles.text, this.state.isValid ? {} : this.styles.invalid]}\n multiline={true}\n numberOfLines={4}\n keyboardType={this.state.keyboardType}\n {...opts}\n autoComplete={props.autocomplete ? 'username' : 'off'}\n autoFocus={props.autofocus}\n editable={props.disabled || props.readonly ? false : true}\n maxLength={props.maxchars}\n placeholder={props.placeholder || 'Place your text'}\n onBlur={this.onBlur.bind(this)}\n onFocus={this.onFocus.bind(this)}\n onKeyPress={this.onKeyPress.bind(this)}\n onChangeText={this.onChangeText.bind(this)}\n onChange={this.invokeChange.bind(this)}\n allowContentSelection={this.styles.text.userSelect === 'text'}\n />);\n }\n}\n"],"mappings":";AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,QAAQ,QAAyB,cAAc;AACxD,OAAOC,eAAe,MAAM,kBAAkB;AAC9C,SAASC,aAAa,QAA0B,mBAAmB;AACnE,SACEC,kBAAkB,EAClBC,cAAc,QACT,0EAA0E;AACjF,SAASC,WAAW,QAAQ,+DAA+D;AAC3F,SAASC,MAAM,QAAQ,QAAQ;AAE/B,OAAO,MAAMC,eAAe,SAASH,cAAc,CAAkB;AAErE,eAAe,MAAMI,UAAU,SAASL,kBAAkB,CAAqD;EAE7GM,WAAWA,CAACC,KAAsB,EAAE;IAClC,KAAK,CAACA,KAAK,EAAER,aAAa,EAAE,IAAID,eAAe,CAAC,CAAC,EAAE,IAAIM,eAAe,CAAC,CAAC,CAAC;EAC3E;EAEAI,YAAYA,CAACD,KAAsB,EAAE;IAAA,IAAAE,qBAAA;IACnC,IAAIC,IAAS,GAAG,CAAC,CAAC;IAClB,MAA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qC,QAAS;MAC1BC,WAAW,EAAEtC,KAAK,CAACsC,WAAW,IAAI,iBAAkB;MACpDC,MAAM,EAAE,IAAI,CAACA,MAAM,CAACC,IAAI,CAAC,IAAI,CAAE;MAC/BC,OAAO,EAAE,IAAI,CAACA,OAAO,CAACD,IAAI,CAAC,IAAI,CAAE;MACjCE,UAAU,EAAE,IAAI,CAACA,UAAU,CAACF,IAAI,CAAC,IAAI,CAAE;MACvCG,YAAY,EAAE,IAAI,CAACA,YAAY,CAACH,IAAI,CAAC,IAAI,CAAE;MAC3CI,QAAQ,EAAE,IAAI,CAACC,YAAY,CAACL,IAAI,CAAC,IAAI,CAAE;MACvCM,qBAAqB,EAAE,IAAI,CAAC5B,MAAM,CAACK,IAAI,CAACwB,UAAU,KAAK;IAAO,EAC/D,CAAC;EACJ;AACF"}
1
+ {"version":3,"names":["React","Platform","WmTextareaProps","DEFAULT_CLASS","BaseInputComponent","BaseInputState","WMTextInput","isNull","AccessibilityWidgetType","getAccessibilityProps","WmTextareaState","WmTextarea","constructor","props","getStyleClassName","classes","state","floatinglabel","push","join","renderWidget","_this$state$textValue","opts","valueExpr","OS","textValue","toString","createElement","_extends","getTestPropsForInput","TEXTAREA","ref","widgetRef","selectionStart","selectionEnd","cursor","placeholderTextColor","styles","placeholderText","color","style","root","text","isValid","invalid","multiline","numberOfLines","keyboardType","floatingLabel","floatingLabelStyle","activeFloatingLabelStyle","activeFloatingLabel","autoComplete","autocomplete","autoFocus","autofocus","editable","disabled","readonly","maxLength","maxchars","placeholder","onBlur","bind","onFocus","onKeyPress","onChangeText","onChange","invokeChange","allowContentSelection","userSelect"],"sources":["textarea.component.tsx"],"sourcesContent":["import React from 'react';\nimport { Platform, TextInput, View } from 'react-native';\nimport WmTextareaProps from './textarea.props';\nimport { DEFAULT_CLASS, WmTextareaStyles } from './textarea.styles';\nimport {\n BaseInputComponent,\n BaseInputState\n} from '@wavemaker/app-rn-runtime/components/input/baseinput/baseinput.component';\nimport { WMTextInput } from '@wavemaker/app-rn-runtime/core/components/textinput.component';\nimport { isNull } from 'lodash';\nimport { AccessibilityWidgetType, getAccessibilityProps } from '@wavemaker/app-rn-runtime/core/accessibility'; \n\nexport class WmTextareaState extends BaseInputState<WmTextareaProps> {}\n\nexport default class WmTextarea extends BaseInputComponent<WmTextareaProps, WmTextareaState, WmTextareaStyles> {\n\n constructor(props: WmTextareaProps) {\n super(props, DEFAULT_CLASS, new WmTextareaProps(), new WmTextareaState());\n }\n\n public getStyleClassName(): string | undefined {\n const classes = [];\n if (this.state.props.floatinglabel) {\n classes.push('app-textarea-with-label'); \n }\n classes.push(super.getStyleClassName());\n return classes.join(' ');\n }\n\n renderWidget(props: WmTextareaProps) {\n let opts: any = {};\n const valueExpr = Platform.OS === 'web' ? 'value' : 'defaultValue';\n opts[valueExpr] = this.state.textValue?.toString() || '';\n return ( <WMTextInput\n {...this.getTestPropsForInput()}\n {...getAccessibilityProps(\n AccessibilityWidgetType.TEXTAREA,\n props\n )}\n ref={(ref: any) => {this.widgetRef = ref;\n // @ts-ignore\n if (ref && !isNull(ref.selectionStart) && !isNull(ref.selectionEnd)) {\n // @ts-ignore\n ref.selectionStart = ref.selectionEnd = this.cursor;\n }}}\n placeholderTextColor={this.styles.placeholderText.color as any}\n style={[this.styles.root, this.styles.text, this.state.isValid ? {} : this.styles.invalid]}\n multiline={true}\n numberOfLines={4}\n keyboardType={this.state.keyboardType}\n {...opts}\n floatingLabel={props.floatinglabel}\n floatingLabelStyle={this.styles.floatingLabel}\n activeFloatingLabelStyle={this.styles.activeFloatingLabel}\n autoComplete={props.autocomplete ? 'username' : 'off'}\n autoFocus={props.autofocus}\n editable={props.disabled || props.readonly ? false : true}\n maxLength={props.maxchars}\n placeholder={props.placeholder || 'Place your text'}\n onBlur={this.onBlur.bind(this)}\n onFocus={this.onFocus.bind(this)}\n onKeyPress={this.onKeyPress.bind(this)}\n onChangeText={this.onChangeText.bind(this)}\n onChange={this.invokeChange.bind(this)}\n allowContentSelection={this.styles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BC,WAAW,EAAEhD,KAAK,CAACgD,WAAW,IAAI,iBAAkB;MACpDC,MAAM,EAAE,IAAI,CAACA,MAAM,CAACC,IAAI,CAAC,IAAI,CAAE;MAC/BC,OAAO,EAAE,IAAI,CAACA,OAAO,CAACD,IAAI,CAAC,IAAI,CAAE;MACjCE,UAAU,EAAE,IAAI,CAACA,UAAU,CAACF,IAAI,CAAC,IAAI,CAAE;MACvCG,YAAY,EAAE,IAAI,CAACA,YAAY,CAACH,IAAI,CAAC,IAAI,CAAE;MAC3CI,QAAQ,EAAE,IAAI,CAACC,YAAY,CAACL,IAAI,CAAC,IAAI,CAAE;MACvCM,qBAAqB,EAAE,IAAI,CAAChC,MAAM,CAACK,IAAI,CAAC4B,UAAU,KAAK;IAAO,EAC/D,CAAC;EACJ;AACF"}
@@ -5,6 +5,7 @@ import BaseInputProps from '@wavemaker/app-rn-runtime/components/input/baseinput
5
5
  export default class WmTextareaProps extends BaseInputProps {
6
6
  constructor() {
7
7
  super(...arguments);
8
+ _defineProperty(this, "floatinglabel", void 0);
8
9
  _defineProperty(this, "placeholder", 'Place your text');
9
10
  }
10
11
  }
@@ -1 +1 @@
1
- {"version":3,"names":["BaseInputProps","WmTextareaProps","constructor","arguments","_defineProperty"],"sources":["textarea.props.ts"],"sourcesContent":["import BaseInputProps from '@wavemaker/app-rn-runtime/components/input/baseinput/baseinput.props';\n\nexport default class WmTextareaProps extends BaseInputProps {\n placeholder: string = 'Place your text';\n}\n"],"mappings":";;;AAAA,OAAOA,cAAc,MAAM,sEAAsE;AAEjG,eAAe,MAAMC,eAAe,SAASD,cAAc,CAAC;EAAAE,YAAA;IAAA,SAAAC,SAAA;IAAAC,eAAA,sBACpC,iBAAiB;EAAA;AACzC"}
1
+ {"version":3,"names":["BaseInputProps","WmTextareaProps","constructor","arguments","_defineProperty"],"sources":["textarea.props.ts"],"sourcesContent":["import BaseInputProps from '@wavemaker/app-rn-runtime/components/input/baseinput/baseinput.props';\n\nexport default class WmTextareaProps extends BaseInputProps {\n floatinglabel?: string;\n placeholder: string = 'Place your text';\n}\n"],"mappings":";;;AAAA,OAAOA,cAAc,MAAM,sEAAsE;AAEjG,eAAe,MAAMC,eAAe,SAASD,cAAc,CAAC;EAAAE,YAAA;IAAA,SAAAC,SAAA;IAAAC,eAAA;IAAAA,eAAA,sBAEpC,iBAAiB;EAAA;AACzC"}
@@ -17,6 +17,8 @@ BASE_THEME.registerStyle((themeVariables, addStyle) => {
17
17
  fontSize: 16,
18
18
  textAlignVertical: 'top'
19
19
  },
20
+ floatingLabel: {},
21
+ activeFloatingLabel: {},
20
22
  invalid: {
21
23
  borderBottomColor: 'red'
22
24
  },
@@ -42,5 +44,20 @@ BASE_THEME.registerStyle((themeVariables, addStyle) => {
42
44
  textAlign: 'right'
43
45
  }
44
46
  });
47
+ addStyle(DEFAULT_CLASS + '-with-label', '', {
48
+ text: {
49
+ paddingTop: 24
50
+ },
51
+ floatingLabel: {
52
+ position: 'absolute',
53
+ top: 12,
54
+ left: 16,
55
+ fontSize: 14,
56
+ color: themeVariables.floatingLabelColor
57
+ },
58
+ activeFloatingLabel: {
59
+ color: themeVariables.activeFloatingLabelColor
60
+ }
61
+ });
45
62
  });
46
63
  //# sourceMappingURL=textarea.styles.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["BASE_THEME","defineStyles","DEFAULT_CLASS","registerStyle","themeVariables","addStyle","defaultStyles","root","padding","borderWidth","borderStyle","borderColor","inputBorderColor","backgroundColor","inputBackgroundColor","borderRadius","fontFamily","baseFont","minHeight","text","fontSize","textAlignVertical","invalid","borderBottomColor","placeholderText","color","inputPlaceholderColor","skeleton","width","height","inputDisabledBgColor","textAlign"],"sources":["textarea.styles.ts"],"sourcesContent":["import BASE_THEME, { AllStyle } from '@wavemaker/app-rn-runtime/styles/theme';\nimport { BaseStyles, defineStyles } from '@wavemaker/app-rn-runtime/core/base.component';\nimport { WmSkeletonStyles } from '@wavemaker/app-rn-runtime/components/basic/skeleton/skeleton.styles';\n\nexport type WmTextareaStyles = BaseStyles & {\n invalid: AllStyle;\n placeholderText: AllStyle;\n skeleton: WmSkeletonStyles;\n};\n\nexport const DEFAULT_CLASS = 'app-textarea';\nBASE_THEME.registerStyle((themeVariables, addStyle) => {\n const defaultStyles: WmTextareaStyles = defineStyles({\n root: {\n padding:12,\n borderWidth:1,\n borderStyle: 'solid',\n borderColor: themeVariables.inputBorderColor,\n backgroundColor: themeVariables.inputBackgroundColor,\n borderRadius: 6,\n fontFamily: themeVariables.baseFont,\n minHeight: 160,\n },\n text: {\n fontSize: 16,\n textAlignVertical: 'top'\n },\n invalid: {\n borderBottomColor: 'red'\n },\n placeholderText: {\n color: themeVariables.inputPlaceholderColor\n },\n skeleton: {\n root: {\n width: '100%',\n height: 84,\n borderRadius: 4\n }\n } as any as WmSkeletonStyles\n });\n\n addStyle(DEFAULT_CLASS, '', defaultStyles);\n addStyle(DEFAULT_CLASS + '-disabled', '', {\n root : {\n backgroundColor: themeVariables.inputDisabledBgColor\n }\n });\n addStyle(DEFAULT_CLASS + '-rtl', '', {\n root:{\n textAlign: 'right'\n }\n })\n});"],"mappings":"AAAA,OAAOA,UAAU,MAAoB,wCAAwC;AAC7E,SAAqBC,YAAY,QAAQ,+CAA+C;AASxF,OAAO,MAAMC,aAAa,GAAG,cAAc;AAC3CF,UAAU,CAACG,aAAa,CAAC,CAACC,cAAc,EAAEC,QAAQ,KAAK;EACrD,MAAMC,aAA+B,GAAGL,YAAY,CAAC;IACjDM,IAAI,EAAE;MACJC,OAAO,EAAC,EAAE;MACVC,WAAW,EAAC,CAAC;MACbC,WAAW,EAAE,OAAO;MACpBC,WAAW,EAAEP,cAAc,CAACQ,gBAAgB;MAC5CC,eAAe,EAAET,cAAc,CAACU,oBAAoB;MACpDC,YAAY,EAAE,CAAC;MACfC,UAAU,EAAEZ,cAAc,CAACa,QAAQ;MACnCC,SAAS,EAAE;IACb,CAAC;IACDC,IAAI,EAAE;MACJC,QAAQ,EAAE,EAAE;MACZC,iBAAiB,EAAE;IACrB,CAAC;IACDC,OAAO,EAAE;MACPC,iBAAiB,EAAE;IACrB,CAAC;IACDC,eAAe,EAAE;MACfC,KAAK,EAAErB,cAAc,CAACsB;IACxB,CAAC;IACDC,QAAQ,EAAE;MACRpB,IAAI,EAAE;QACJqB,KAAK,EAAE,MAAM;QACbC,MAAM,EAAE,EAAE;QACVd,YAAY,EAAE;MAChB;IACF;EACJ,CAAC,CAAC;EAEFV,QAAQ,CAACH,aAAa,EAAE,EAAE,EAAEI,aAAa,CAAC;EAC1CD,QAAQ,CAACH,aAAa,GAAG,WAAW,EAAE,EAAE,EAAE;IACtCK,IAAI,EAAG;MACLM,eAAe,EAAET,cAAc,CAAC0B;IAClC;EACJ,CAAC,CAAC;EACFzB,QAAQ,CAACH,aAAa,GAAG,MAAM,EAAE,EAAE,EAAE;IACnCK,IAAI,EAAC;MACHwB,SAAS,EAAE;IACb;EACF,CAAC,CAAC;AACJ,CAAC,CAAC"}
1
+ {"version":3,"names":["BASE_THEME","defineStyles","DEFAULT_CLASS","registerStyle","themeVariables","addStyle","defaultStyles","root","padding","borderWidth","borderStyle","borderColor","inputBorderColor","backgroundColor","inputBackgroundColor","borderRadius","fontFamily","baseFont","minHeight","text","fontSize","textAlignVertical","floatingLabel","activeFloatingLabel","invalid","borderBottomColor","placeholderText","color","inputPlaceholderColor","skeleton","width","height","inputDisabledBgColor","textAlign","paddingTop","position","top","left","floatingLabelColor","activeFloatingLabelColor"],"sources":["textarea.styles.ts"],"sourcesContent":["import BASE_THEME, { AllStyle } from '@wavemaker/app-rn-runtime/styles/theme';\nimport { BaseStyles, defineStyles } from '@wavemaker/app-rn-runtime/core/base.component';\nimport { WmSkeletonStyles } from '@wavemaker/app-rn-runtime/components/basic/skeleton/skeleton.styles';\n\nexport type WmTextareaStyles = BaseStyles & {\n invalid: AllStyle;\n placeholderText: AllStyle;\n floatingLabel: AllStyle;\n activeFloatingLabel: AllStyle;\n skeleton: WmSkeletonStyles;\n};\n\nexport const DEFAULT_CLASS = 'app-textarea';\nBASE_THEME.registerStyle((themeVariables, addStyle) => {\n const defaultStyles: WmTextareaStyles = defineStyles({\n root: {\n padding:12,\n borderWidth:1,\n borderStyle: 'solid',\n borderColor: themeVariables.inputBorderColor,\n backgroundColor: themeVariables.inputBackgroundColor,\n borderRadius: 6,\n fontFamily: themeVariables.baseFont,\n minHeight: 160,\n },\n text: {\n fontSize: 16,\n textAlignVertical: 'top'\n },\n floatingLabel: {},\n activeFloatingLabel: {},\n invalid: {\n borderBottomColor: 'red'\n },\n placeholderText: {\n color: themeVariables.inputPlaceholderColor\n },\n skeleton: {\n root: {\n width: '100%',\n height: 84,\n borderRadius: 4\n }\n } as any as WmSkeletonStyles\n });\n\n addStyle(DEFAULT_CLASS, '', defaultStyles);\n addStyle(DEFAULT_CLASS + '-disabled', '', {\n root : {\n backgroundColor: themeVariables.inputDisabledBgColor\n }\n });\n addStyle(DEFAULT_CLASS + '-rtl', '', {\n root:{\n textAlign: 'right'\n }\n })\n addStyle(DEFAULT_CLASS + '-with-label', '', {\n text:{\n paddingTop: 24\n },\n floatingLabel: {\n position: 'absolute',\n top: 12,\n left: 16,\n fontSize: 14,\n color: themeVariables.floatingLabelColor\n },\n activeFloatingLabel: {\n color: themeVariables.activeFloatingLabelColor\n }\n })\n});"],"mappings":"AAAA,OAAOA,UAAU,MAAoB,wCAAwC;AAC7E,SAAqBC,YAAY,QAAQ,+CAA+C;AAWxF,OAAO,MAAMC,aAAa,GAAG,cAAc;AAC3CF,UAAU,CAACG,aAAa,CAAC,CAACC,cAAc,EAAEC,QAAQ,KAAK;EACrD,MAAMC,aAA+B,GAAGL,YAAY,CAAC;IACjDM,IAAI,EAAE;MACJC,OAAO,EAAC,EAAE;MACVC,WAAW,EAAC,CAAC;MACbC,WAAW,EAAE,OAAO;MACpBC,WAAW,EAAEP,cAAc,CAACQ,gBAAgB;MAC5CC,eAAe,EAAET,cAAc,CAACU,oBAAoB;MACpDC,YAAY,EAAE,CAAC;MACfC,UAAU,EAAEZ,cAAc,CAACa,QAAQ;MACnCC,SAAS,EAAE;IACb,CAAC;IACDC,IAAI,EAAE;MACJC,QAAQ,EAAE,EAAE;MACZC,iBAAiB,EAAE;IACrB,CAAC;IACDC,aAAa,EAAE,CAAC,CAAC;IACjBC,mBAAmB,EAAE,CAAC,CAAC;IACvBC,OAAO,EAAE;MACPC,iBAAiB,EAAE;IACrB,CAAC;IACDC,eAAe,EAAE;MACfC,KAAK,EAAEvB,cAAc,CAACwB;IACxB,CAAC;IACDC,QAAQ,EAAE;MACRtB,IAAI,EAAE;QACJuB,KAAK,EAAE,MAAM;QACbC,MAAM,EAAE,EAAE;QACVhB,YAAY,EAAE;MAChB;IACF;EACJ,CAAC,CAAC;EAEFV,QAAQ,CAACH,aAAa,EAAE,EAAE,EAAEI,aAAa,CAAC;EAC1CD,QAAQ,CAACH,aAAa,GAAG,WAAW,EAAE,EAAE,EAAE;IACtCK,IAAI,EAAG;MACLM,eAAe,EAAET,cAAc,CAAC4B;IAClC;EACJ,CAAC,CAAC;EACF3B,QAAQ,CAACH,aAAa,GAAG,MAAM,EAAE,EAAE,EAAE;IACnCK,IAAI,EAAC;MACH0B,SAAS,EAAE;IACb;EACF,CAAC,CAAC;EACF5B,QAAQ,CAACH,aAAa,GAAG,aAAa,EAAE,EAAE,EAAE;IAC1CiB,IAAI,EAAC;MACHe,UAAU,EAAE;IACd,CAAC;IACDZ,aAAa,EAAE;MACba,QAAQ,EAAE,UAAU;MACpBC,GAAG,EAAE,EAAE;MACPC,IAAI,EAAE,EAAE;MACRjB,QAAQ,EAAE,EAAE;MACZO,KAAK,EAAEvB,cAAc,CAACkC;IACxB,CAAC;IACDf,mBAAmB,EAAE;MACnBI,KAAK,EAAEvB,cAAc,CAACmC;IACxB;EACF,CAAC,CAAC;AACJ,CAAC,CAAC"}
@@ -3,10 +3,11 @@ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key i
3
3
  function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
4
4
  function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
5
5
  import React from 'react';
6
- import { View, TouchableOpacity } from 'react-native';
6
+ import { TouchableOpacity, Animated, Easing } from 'react-native';
7
7
  import { BackgroundComponent } from '@wavemaker/app-rn-runtime/styles/background.component';
8
8
  import { BaseComponent, BaseComponentState } from '@wavemaker/app-rn-runtime/core/base.component';
9
9
  import { unStringify, validateField } from '@wavemaker/app-rn-runtime/core/utils';
10
+ import { AccessibilityWidgetType, getAccessibilityProps } from '@wavemaker/app-rn-runtime/core/accessibility';
10
11
  import WmToggleProps from './toggle.props';
11
12
  import { DEFAULT_CLASS } from './toggle.styles';
12
13
  export class WmToggleState extends BaseComponentState {
@@ -15,11 +16,14 @@ export class WmToggleState extends BaseComponentState {
15
16
  _defineProperty(this, "isSwitchOn", false);
16
17
  _defineProperty(this, "isValid", true);
17
18
  _defineProperty(this, "errorType", '');
19
+ _defineProperty(this, "viewWidth", 0);
18
20
  }
19
21
  }
20
22
  export default class WmToggle extends BaseComponent {
21
23
  constructor(props) {
22
24
  super(props, DEFAULT_CLASS, new WmToggleProps(), new WmToggleState());
25
+ _defineProperty(this, "animationValue", new Animated.Value(0));
26
+ _defineProperty(this, "scaleValue", new Animated.Value(1));
23
27
  }
24
28
  onPropertyChange(name, $new, $old) {
25
29
  switch (name) {
@@ -52,6 +56,22 @@ export default class WmToggle extends BaseComponent {
52
56
  isSwitchOn: value
53
57
  });
54
58
  const dataValue = value === true ? this.state.props.checkedvalue : this.state.props.uncheckedvalue;
59
+ Animated.sequence([Animated.timing(this.scaleValue, {
60
+ toValue: 1.6,
61
+ duration: 300,
62
+ useNativeDriver: true
63
+ }), Animated.timing(this.animationValue, {
64
+ toValue: value ? 1 : 0,
65
+ duration: 300,
66
+ easing: Easing.linear,
67
+ useNativeDriver: true
68
+ })]).start(() => {
69
+ Animated.timing(this.scaleValue, {
70
+ toValue: value ? 1.5 : 1,
71
+ duration: 0,
72
+ useNativeDriver: true
73
+ }).start();
74
+ });
55
75
  // @ts-ignore
56
76
  this.updateState({
57
77
  props: {
@@ -66,10 +86,22 @@ export default class WmToggle extends BaseComponent {
66
86
  this.invokeEventCallback('onBlur', [null, this.proxy]);
67
87
  });
68
88
  }
89
+ onLayoutChange(event) {
90
+ let width = event.nativeEvent.layout.width;
91
+ this.setState({
92
+ viewWidth: width
93
+ });
94
+ }
69
95
  renderWidget(props) {
70
96
  const styles = this.theme.mergeStyle(this.styles, this.theme.getStyle(this.state.isSwitchOn ? 'app-toggle-on' : 'app-toggle-off'));
71
- return /*#__PURE__*/React.createElement(TouchableOpacity, _extends({}, this.getTestPropsForAction(), {
72
- style: styles.root,
97
+ return /*#__PURE__*/React.createElement(TouchableOpacity, _extends({
98
+ onLayout: e => {
99
+ this.onLayoutChange(e);
100
+ }
101
+ }, getAccessibilityProps(AccessibilityWidgetType.TOGGLE, {
102
+ ...this.props,
103
+ selected: this.state.isSwitchOn
104
+ }), {
73
105
  onPress: () => {
74
106
  if (this.props.disabled) {
75
107
  return;
@@ -83,8 +115,19 @@ export default class WmToggle extends BaseComponent {
83
115
  }, 500);
84
116
  this.onToggleSwitch(!this.state.isSwitchOn);
85
117
  }
86
- }), this._background, /*#__PURE__*/React.createElement(View, {
87
- style: styles.handle
118
+ }, this.getTestPropsForAction(), {
119
+ style: styles.root
120
+ }), this._background, /*#__PURE__*/React.createElement(Animated.View, {
121
+ style: [styles.handle, {
122
+ transform: [{
123
+ translateX: this.animationValue.interpolate({
124
+ inputRange: [0, 1],
125
+ outputRange: [0, this.state.viewWidth - (this.styles.handle.width + 18)]
126
+ })
127
+ }, {
128
+ scale: this.scaleValue
129
+ }]
130
+ }]
88
131
  }, /*#__PURE__*/React.createElement(BackgroundComponent, {
89
132
  size: styles.handle.backgroundSize,
90
133
  position: styles.handle.backgroundPosition,
@@ -1 +1 @@
1
- {"version":3,"names":["React","View","TouchableOpacity","BackgroundComponent","BaseComponent","BaseComponentState","unStringify","validateField","WmToggleProps","DEFAULT_CLASS","WmToggleState","constructor","arguments","_defineProperty","WmToggle","props","onPropertyChange","name","$new","$old","value","state","checkedvalue","updateState","isSwitchOn","updateDatavalue","datavalue","validate","validationObj","isValid","errorType","onToggleSwitch","oldValue","dataValue","uncheckedvalue","onFieldChange","invokeEventCallback","proxy","renderWidget","styles","theme","mergeStyle","getStyle","createElement","_extends","getTestPropsForAction","style","root","onPress","disabled","setTimeout","readonly","_background","handle","size","backgroundSize","position","backgroundPosition","image","backgroundImage"],"sources":["toggle.component.tsx"],"sourcesContent":["import React from 'react';\nimport { View, TouchableOpacity } from 'react-native';\n\nimport { BackgroundComponent } from '@wavemaker/app-rn-runtime/styles/background.component';\nimport { BaseComponent, BaseComponentState } from '@wavemaker/app-rn-runtime/core/base.component';\nimport {unStringify, validateField} from '@wavemaker/app-rn-runtime/core/utils';\n\nimport WmToggleProps from './toggle.props';\nimport { DEFAULT_CLASS, WmToggleStyles } from './toggle.styles';\n\nexport class WmToggleState extends BaseComponentState<WmToggleProps> {\n isSwitchOn: boolean = false;\n isValid: boolean = true;\n errorType = '';\n}\n\nexport default class WmToggle extends BaseComponent<WmToggleProps, WmToggleState, WmToggleStyles> {\n\n constructor(props: WmToggleProps) {\n super(props, DEFAULT_CLASS, new WmToggleProps(), new WmToggleState());\n }\n\n onPropertyChange(name: string, $new: any, $old: any) {\n switch (name) {\n case 'datavalue':\n let value =\n unStringify($new) ===\n unStringify(this.state.props.checkedvalue, true);\n this.updateState({ isSwitchOn: value } as WmToggleState);\n break;\n }\n }\n\n updateDatavalue(value: any) {\n this.updateState({ props: { datavalue: value }} as WmToggleState);\n }\n\n validate(value: any) {\n const validationObj = validateField(this.state.props, value);\n this.updateState({\n isValid: validationObj.isValid,\n errorType: validationObj.errorType\n } as WmToggleState);\n }\n\n onToggleSwitch(value: any) {\n const oldValue = this.state.props.datavalue;\n this.validate(value);\n this.updateState({ isSwitchOn: value } as WmToggleState);\n const dataValue = value === true ? this.state.props.checkedvalue : this.state.props.uncheckedvalue;\n // @ts-ignore\n this.updateState({ props: { datavalue: dataValue } },\n ()=> {\n if (!this.props.onFieldChange) {\n this.invokeEventCallback('onChange', [null, this.proxy, dataValue, oldValue]);\n } else {\n this.props.onFieldChange && this.props.onFieldChange('datavalue', dataValue, oldValue);\n }\n this.invokeEventCallback('onBlur', [ null, this.proxy ]);\n });\n }\n\n renderWidget(props: WmToggleProps) {\n const styles = this.theme.mergeStyle(this.styles, \n this.theme.getStyle(this.state.isSwitchOn ? 'app-toggle-on' : 'app-toggle-off'));\n return (\n <TouchableOpacity \n {...this.getTestPropsForAction()}\n style={styles.root} onPress={() => {\n if (this.props.disabled) {\n return;\n }\n // Added setTimeout to smooth animation\n setTimeout(() => {\n if (!props.readonly) {\n this.invokeEventCallback('onFocus', [null, this]);\n }\n this.invokeEventCallback('onTap', [null, this]);\n }, 500);\n this.onToggleSwitch(!this.state.isSwitchOn);\n }}>\n {this._background}\n <View style={styles.handle}>\n <BackgroundComponent\n size={styles.handle.backgroundSize}\n position={styles.handle.backgroundPosition}\n image={styles.handle.backgroundImage}> \n </BackgroundComponent>\n </View>\n </TouchableOpacity>\n );\n }\n}\n"],"mappings":";;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,IAAI,EAAEC,gBAAgB,QAAQ,cAAc;AAErD,SAASC,mBAAmB,QAAQ,uDAAuD;AAC3F,SAASC,aAAa,EAAEC,kBAAkB,QAAQ,+CAA+C;AACjG,SAAQC,WAAW,EAAEC,aAAa,QAAO,sCAAsC;AAE/E,OAAOC,aAAa,MAAM,gBAAgB;AAC1C,SAASC,aAAa,QAAwB,iBAAiB;AAE/D,OAAO,MAAMC,aAAa,SAASL,kBAAkB,CAAgB;EAAAM,YAAA;IAAA,SAAA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,EAAE,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;UACnD;UACA,IAAI,CAACA,mBAAmB,CAAC,OAAO,EAAE,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;QACjD,CAAC,EAAE,GAAG,CAAC;QACP,IAAI,CAACL,cAAc,CAAC,CAAC,IAAI,CAACV,KAAK,CAACG,UAAU,CAAC;MAC7C;IAAE,IACC,IAAI,CAAC4B,WAAW,eACjBpD,KAAA,CAAA2C,aAAA,CAAC1C,IAAI;MAAC6C,KAAK,EAAEP,MAAM,CAACc;IAAO,gBACzBrD,KAAA,CAAA2C,aAAA,CAACxC,mBAAmB;MAClBmD,IAAI,EAAEf,MAAM,CAACc,MAAM,CAACE,cAAe;MACnCC,QAAQ,EAAEjB,MAAM,CAACc,MAAM,CAACI,kBAAmB;MAC3CC,KAAK,EAAEnB,MAAM,CAACc,MAAM,CAACM;IAAgB,CAClB,CACjB,CACU,CAAC;EAEvB;AACF"}
1
+ {"version":3,"names":["React","TouchableOpacity","Animated","Easing","BackgroundComponent","BaseComponent","BaseComponentState","unStringify","validateField","AccessibilityWidgetType","getAccessibilityProps","WmToggleProps","DEFAULT_CLASS","WmToggleState","constructor","arguments","_defineProperty","WmToggle","props","Value","onPropertyChange","name","$new","$old","value","state","checkedvalue","updateState","isSwitchOn","updateDatavalue","datavalue","validate","validationObj","isValid","errorType","onToggleSwitch","oldValue","dataValue","uncheckedvalue","sequence","timing","scaleValue","toValue","duration","useNativeDriver","animationValue","easing","linear","start","onFieldChange","invokeEventCallback","proxy","onLayoutChange","event","width","nativeEvent","layout","setState","viewWidth","renderWidget","styles","theme","mergeStyle","getStyle","createElement","_extends","onLayout","e","TOGGLE","selected","onPress","disabled","setTimeout","readonly","getTestPropsForAction","style","root","_background","View","handle","transform","translateX","interpolate","inputRange","outputRange","scale","size","backgroundSize","position","backgroundPosition","image","backgroundImage"],"sources":["toggle.component.tsx"],"sourcesContent":["import React from 'react';\nimport { TouchableOpacity, Animated, Easing, LayoutChangeEvent } from 'react-native';\n\nimport { BackgroundComponent } from '@wavemaker/app-rn-runtime/styles/background.component';\nimport { BaseComponent, BaseComponentState } from '@wavemaker/app-rn-runtime/core/base.component';\nimport { unStringify, validateField} from '@wavemaker/app-rn-runtime/core/utils';\nimport { AccessibilityWidgetType, getAccessibilityProps } from '@wavemaker/app-rn-runtime/core/accessibility'; \n\nimport WmToggleProps from './toggle.props';\nimport { DEFAULT_CLASS, WmToggleStyles } from './toggle.styles';\n\nexport class WmToggleState extends BaseComponentState<WmToggleProps> {\n isSwitchOn: boolean = false;\n isValid: boolean = true;\n errorType = '';\n viewWidth: number = 0;\n}\n\nexport default class WmToggle extends BaseComponent<WmToggleProps, WmToggleState, WmToggleStyles> {\n\n private animationValue = new Animated.Value(0);\n private scaleValue = new Animated.Value(1);\n\n constructor(props: WmToggleProps) {\n super(props, DEFAULT_CLASS, new WmToggleProps(), new WmToggleState());\n }\n\n onPropertyChange(name: string, $new: any, $old: any) {\n switch (name) {\n case 'datavalue':\n let value =\n unStringify($new) ===\n unStringify(this.state.props.checkedvalue, true);\n this.updateState({ isSwitchOn: value } as WmToggleState);\n break;\n }\n }\n\n updateDatavalue(value: any) {\n this.updateState({ props: { datavalue: value }} as WmToggleState);\n }\n\n validate(value: any) {\n const validationObj = validateField(this.state.props, value);\n this.updateState({\n isValid: validationObj.isValid,\n errorType: validationObj.errorType\n } as WmToggleState);\n }\n\n onToggleSwitch(value: any) {\n const oldValue = this.state.props.datavalue;\n this.validate(value);\n this.updateState({ isSwitchOn: value } as WmToggleState);\n const dataValue = value === true ? this.state.props.checkedvalue : this.state.props.uncheckedvalue;\n Animated.sequence([\n Animated.timing(this.scaleValue, {\n toValue: 1.6,\n duration: 300,\n useNativeDriver: true,\n }),\n Animated.timing(this.animationValue, {\n toValue: value ? 1 : 0,\n duration: 300,\n easing: Easing.linear,\n useNativeDriver: true,\n }),\n ]).start(() => {\n Animated.timing(this.scaleValue, {\n toValue: value ? 1.5 : 1,\n duration: 0,\n useNativeDriver: true,\n }).start();\n });\n // @ts-ignore\n this.updateState({ props: { datavalue: dataValue } },\n ()=> {\n if (!this.props.onFieldChange) {\n this.invokeEventCallback('onChange', [null, this.proxy, dataValue, oldValue]);\n } else {\n this.props.onFieldChange && this.props.onFieldChange('datavalue', dataValue, oldValue);\n }\n this.invokeEventCallback('onBlur', [ null, this.proxy ]);\n });\n }\n\n onLayoutChange(event: LayoutChangeEvent){\n let width = event.nativeEvent.layout.width;\n this.setState({\n viewWidth: width,\n } as WmToggleState);\n }\n\n renderWidget(props: WmToggleProps) {\n const styles = this.theme.mergeStyle(this.styles, \n this.theme.getStyle(this.state.isSwitchOn ? 'app-toggle-on' : 'app-toggle-off'));\n return (\n <TouchableOpacity \n onLayout={(e) => {\n this.onLayoutChange(e);\n }}\n {...getAccessibilityProps(AccessibilityWidgetType.TOGGLE, {...this.props, selected: this.state.isSwitchOn})}\n onPress={() => {\n if (this.props.disabled) {\n return;\n }\n // Added setTimeout to smooth animation\n setTimeout(() => {\n if (!props.readonly) {\n this.invokeEventCallback('onFocus', [null, this]);\n }\n this.invokeEventCallback('onTap', [null, this]);\n }, 500);\n this.onToggleSwitch(!this.state.isSwitchOn);\n }}{...this.getTestPropsForAction()}\n style={styles.root}>\n {this._background}\n <Animated.View\n style={[\n styles.handle,\n {\n transform: [\n {\n translateX: this.animationValue.interpolate({\n inputRange: [0, 1],\n outputRange: [0, this.state.viewWidth - (this.styles.handle.width as number+ 18)],\n }),\n },\n {scale : this.scaleValue}\n ],\n },\n ]}>\n <BackgroundComponent\n size={styles.handle.backgroundSize}\n position={styles.handle.backgroundPosition}\n image={styles.handle.backgroundImage}> \n </BackgroundComponent>\n </Animated.View>\n </TouchableOpacity>\n );\n }\n}\n"],"mappings":";;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,gBAAgB,EAAEC,QAAQ,EAAEC,MAAM,QAA2B,cAAc;AAEpF,SAASC,mBAAmB,QAAQ,uDAAuD;AAC3F,SAAS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