@wavemaker/app-rn-runtime 12.0.0-next.45102 → 12.0.0-next.45128

Sign up to get free protection for your applications and to get access to all the features.
Files changed (292) hide show
  1. app-rn-runtime/components/advanced/carousel/carousel.component.js +31 -5
  2. app-rn-runtime/components/advanced/carousel/carousel.component.js.map +1 -1
  3. app-rn-runtime/components/advanced/carousel/carousel.props.js +1 -0
  4. app-rn-runtime/components/advanced/carousel/carousel.props.js.map +1 -1
  5. app-rn-runtime/components/advanced/carousel/carousel.styles.js +15 -0
  6. app-rn-runtime/components/advanced/carousel/carousel.styles.js.map +1 -1
  7. app-rn-runtime/components/advanced/webview/webview.component.js.map +1 -1
  8. app-rn-runtime/components/basic/anchor/anchor.component.js +15 -5
  9. app-rn-runtime/components/basic/anchor/anchor.component.js.map +1 -1
  10. app-rn-runtime/components/basic/anchor/anchor.styles.js +3 -0
  11. app-rn-runtime/components/basic/anchor/anchor.styles.js.map +1 -1
  12. app-rn-runtime/components/basic/animatedview.component.js +6 -2
  13. app-rn-runtime/components/basic/animatedview.component.js.map +1 -1
  14. app-rn-runtime/components/basic/audio/audio.component.js.map +1 -1
  15. app-rn-runtime/components/basic/button/button.component.js +20 -6
  16. app-rn-runtime/components/basic/button/button.component.js.map +1 -1
  17. app-rn-runtime/components/basic/icon/icon.component.js +14 -6
  18. app-rn-runtime/components/basic/icon/icon.component.js.map +1 -1
  19. app-rn-runtime/components/basic/label/label.component.js +13 -3
  20. app-rn-runtime/components/basic/label/label.component.js.map +1 -1
  21. app-rn-runtime/components/basic/label/label.styles.js.map +1 -1
  22. app-rn-runtime/components/basic/message/message.component.js.map +1 -1
  23. app-rn-runtime/components/basic/picture/picture.component.js +1 -2
  24. app-rn-runtime/components/basic/picture/picture.component.js.map +1 -1
  25. app-rn-runtime/components/basic/progress-bar/progress-bar.component.js +2 -2
  26. app-rn-runtime/components/basic/progress-bar/progress-bar.component.js.map +1 -1
  27. app-rn-runtime/components/basic/progress-circle/progress-circle.component.js +5 -5
  28. app-rn-runtime/components/basic/progress-circle/progress-circle.component.js.map +1 -1
  29. app-rn-runtime/components/basic/search/search.component.js +9 -0
  30. app-rn-runtime/components/basic/search/search.component.js.map +1 -1
  31. app-rn-runtime/components/basic/search/search.props.js +2 -0
  32. app-rn-runtime/components/basic/search/search.props.js.map +1 -1
  33. app-rn-runtime/components/basic/search/search.styles.js +5 -0
  34. app-rn-runtime/components/basic/search/search.styles.js.map +1 -1
  35. app-rn-runtime/components/basic/skeleton/skeleton.component.js +4 -3
  36. app-rn-runtime/components/basic/skeleton/skeleton.component.js.map +1 -1
  37. app-rn-runtime/components/basic/skeleton/skeleton.props.js +9 -1
  38. app-rn-runtime/components/basic/skeleton/skeleton.props.js.map +1 -1
  39. app-rn-runtime/components/basic/spinner/spinner.component.js +2 -3
  40. app-rn-runtime/components/basic/spinner/spinner.component.js.map +1 -1
  41. app-rn-runtime/components/basic/spinner/spinner.styles.js +3 -2
  42. app-rn-runtime/components/basic/spinner/spinner.styles.js.map +1 -1
  43. app-rn-runtime/components/basic/video/video.component.js.map +1 -1
  44. app-rn-runtime/components/basic/video/video.styles.js +4 -1
  45. app-rn-runtime/components/basic/video/video.styles.js.map +1 -1
  46. app-rn-runtime/components/chart/area-chart/area-chart.component.js +2 -1
  47. app-rn-runtime/components/chart/area-chart/area-chart.component.js.map +1 -1
  48. app-rn-runtime/components/chart/area-chart/area-chart.styles.js +7 -1
  49. app-rn-runtime/components/chart/area-chart/area-chart.styles.js.map +1 -1
  50. app-rn-runtime/components/chart/bar-chart/bar-chart.styles.js +7 -1
  51. app-rn-runtime/components/chart/bar-chart/bar-chart.styles.js.map +1 -1
  52. app-rn-runtime/components/chart/basechart.component.js +54 -2
  53. app-rn-runtime/components/chart/basechart.component.js.map +1 -1
  54. app-rn-runtime/components/chart/basechart.props.js +3 -2
  55. app-rn-runtime/components/chart/basechart.props.js.map +1 -1
  56. app-rn-runtime/components/chart/basechart.styles.js +4 -0
  57. app-rn-runtime/components/chart/basechart.styles.js.map +1 -1
  58. app-rn-runtime/components/chart/bubble-chart/bubble-chart.component.js +15 -3
  59. app-rn-runtime/components/chart/bubble-chart/bubble-chart.component.js.map +1 -1
  60. app-rn-runtime/components/chart/bubble-chart/bubble-chart.styles.js +7 -1
  61. app-rn-runtime/components/chart/bubble-chart/bubble-chart.styles.js.map +1 -1
  62. app-rn-runtime/components/chart/column-chart/column-chart.styles.js +7 -1
  63. app-rn-runtime/components/chart/column-chart/column-chart.styles.js.map +1 -1
  64. app-rn-runtime/components/chart/donut-chart/donut-chart.styles.js +7 -1
  65. app-rn-runtime/components/chart/donut-chart/donut-chart.styles.js.map +1 -1
  66. app-rn-runtime/components/chart/line-chart/line-chart.props.js +2 -0
  67. app-rn-runtime/components/chart/line-chart/line-chart.props.js.map +1 -1
  68. app-rn-runtime/components/chart/line-chart/line-chart.styles.js +7 -1
  69. app-rn-runtime/components/chart/line-chart/line-chart.styles.js.map +1 -1
  70. app-rn-runtime/components/chart/pie-chart/pie-chart.component.js +6 -2
  71. app-rn-runtime/components/chart/pie-chart/pie-chart.component.js.map +1 -1
  72. app-rn-runtime/components/chart/pie-chart/pie-chart.styles.js +7 -1
  73. app-rn-runtime/components/chart/pie-chart/pie-chart.styles.js.map +1 -1
  74. app-rn-runtime/components/chart/stack-chart/stack-chart.component.js +37 -11
  75. app-rn-runtime/components/chart/stack-chart/stack-chart.component.js.map +1 -1
  76. app-rn-runtime/components/container/accordion/accordion.component.js +61 -12
  77. app-rn-runtime/components/container/accordion/accordion.component.js.map +1 -1
  78. app-rn-runtime/components/container/accordion/accordion.props.js.map +1 -1
  79. app-rn-runtime/components/container/accordion/accordion.styles.js +5 -0
  80. app-rn-runtime/components/container/accordion/accordion.styles.js.map +1 -1
  81. app-rn-runtime/components/container/accordion/accordionpane/accordionpane.component.js +11 -1
  82. app-rn-runtime/components/container/accordion/accordionpane/accordionpane.component.js.map +1 -1
  83. app-rn-runtime/components/container/container.component.js +36 -2
  84. app-rn-runtime/components/container/container.component.js.map +1 -1
  85. app-rn-runtime/components/container/container.styles.js +7 -0
  86. app-rn-runtime/components/container/container.styles.js.map +1 -1
  87. app-rn-runtime/components/container/layoutgrid/gridcolumn/gridcolumn.component.js.map +1 -1
  88. app-rn-runtime/components/container/layoutgrid/gridrow/gridrow.component.js +5 -1
  89. app-rn-runtime/components/container/layoutgrid/gridrow/gridrow.component.js.map +1 -1
  90. app-rn-runtime/components/container/layoutgrid/gridrow/gridrow.styles.js +6 -1
  91. app-rn-runtime/components/container/layoutgrid/gridrow/gridrow.styles.js.map +1 -1
  92. app-rn-runtime/components/container/layoutgrid/layoutgrid.component.js +28 -2
  93. app-rn-runtime/components/container/layoutgrid/layoutgrid.component.js.map +1 -1
  94. app-rn-runtime/components/container/layoutgrid/layoutgrid.props.js.map +1 -1
  95. app-rn-runtime/components/container/layoutgrid/layoutgrid.styles.js +4 -1
  96. app-rn-runtime/components/container/layoutgrid/layoutgrid.styles.js.map +1 -1
  97. app-rn-runtime/components/container/linearlayout/linearlayout.component.js +31 -5
  98. app-rn-runtime/components/container/linearlayout/linearlayout.component.js.map +1 -1
  99. app-rn-runtime/components/container/linearlayout/linearlayout.props.js.map +1 -1
  100. app-rn-runtime/components/container/linearlayout/linearlayout.styles.js +4 -1
  101. app-rn-runtime/components/container/linearlayout/linearlayout.styles.js.map +1 -1
  102. app-rn-runtime/components/container/panel/panel.component.js +47 -6
  103. app-rn-runtime/components/container/panel/panel.component.js.map +1 -1
  104. app-rn-runtime/components/container/panel/panel.props.js.map +1 -1
  105. app-rn-runtime/components/container/panel/panel.styles.js +3 -0
  106. app-rn-runtime/components/container/panel/panel.styles.js.map +1 -1
  107. app-rn-runtime/components/container/partial-host.component.js.map +1 -1
  108. app-rn-runtime/components/container/tabs/tabheader/tabheader.component.js +3 -4
  109. app-rn-runtime/components/container/tabs/tabheader/tabheader.component.js.map +1 -1
  110. app-rn-runtime/components/container/tabs/tabheader/tabheader.props.js.map +1 -1
  111. app-rn-runtime/components/container/tabs/tabpane/tabpane.component.js +11 -1
  112. app-rn-runtime/components/container/tabs/tabpane/tabpane.component.js.map +1 -1
  113. app-rn-runtime/components/container/tabs/tabpane/tabpane.props.js.map +1 -1
  114. app-rn-runtime/components/container/tabs/tabs.component.js +41 -5
  115. app-rn-runtime/components/container/tabs/tabs.component.js.map +1 -1
  116. app-rn-runtime/components/container/tabs/tabs.props.js.map +1 -1
  117. app-rn-runtime/components/container/tabs/tabs.styles.js +4 -1
  118. app-rn-runtime/components/container/tabs/tabs.styles.js.map +1 -1
  119. app-rn-runtime/components/container/tile/tile.component.js +28 -2
  120. app-rn-runtime/components/container/tile/tile.component.js.map +1 -1
  121. app-rn-runtime/components/container/tile/tile.props.js.map +1 -1
  122. app-rn-runtime/components/container/tile/tile.styles.js +6 -1
  123. app-rn-runtime/components/container/tile/tile.styles.js.map +1 -1
  124. app-rn-runtime/components/container/wizard/wizard.component.js +62 -13
  125. app-rn-runtime/components/container/wizard/wizard.component.js.map +1 -1
  126. app-rn-runtime/components/container/wizard/wizard.props.js.map +1 -1
  127. app-rn-runtime/components/container/wizard/wizard.styles.js +3 -0
  128. app-rn-runtime/components/container/wizard/wizard.styles.js.map +1 -1
  129. app-rn-runtime/components/container/wizard/wizardstep/wizardstep.component.js +4 -1
  130. app-rn-runtime/components/container/wizard/wizardstep/wizardstep.component.js.map +1 -1
  131. app-rn-runtime/components/data/card/card-content/card-content.component.js +6 -2
  132. app-rn-runtime/components/data/card/card-content/card-content.component.js.map +1 -1
  133. app-rn-runtime/components/data/card/card-content/card-content.styles.js +4 -1
  134. app-rn-runtime/components/data/card/card-content/card-content.styles.js.map +1 -1
  135. app-rn-runtime/components/data/card/card.component.js +18 -0
  136. app-rn-runtime/components/data/card/card.component.js.map +1 -1
  137. app-rn-runtime/components/data/card/card.styles.js +3 -0
  138. app-rn-runtime/components/data/card/card.styles.js.map +1 -1
  139. app-rn-runtime/components/data/form/form-field/form-field.component.js.map +1 -1
  140. app-rn-runtime/components/data/form/form.component.js +1 -1
  141. app-rn-runtime/components/data/form/form.component.js.map +1 -1
  142. app-rn-runtime/components/data/form/form.props.js +1 -0
  143. app-rn-runtime/components/data/form/form.props.js.map +1 -1
  144. app-rn-runtime/components/data/list/list-template/list-template.component.js +15 -1
  145. app-rn-runtime/components/data/list/list-template/list-template.component.js.map +1 -1
  146. app-rn-runtime/components/data/list/list-template/list-template.props.js +1 -0
  147. app-rn-runtime/components/data/list/list-template/list-template.props.js.map +1 -1
  148. app-rn-runtime/components/data/list/list-template/list-template.styles.js +11 -1
  149. app-rn-runtime/components/data/list/list-template/list-template.styles.js.map +1 -1
  150. app-rn-runtime/components/data/list/list.component.js +54 -33
  151. app-rn-runtime/components/data/list/list.component.js.map +1 -1
  152. app-rn-runtime/components/data/list/list.props.js +1 -0
  153. app-rn-runtime/components/data/list/list.props.js.map +1 -1
  154. app-rn-runtime/components/data/list/list.styles.js +9 -0
  155. app-rn-runtime/components/data/list/list.styles.js.map +1 -1
  156. app-rn-runtime/components/dialogs/dialog/dialog.component.js +5 -3
  157. app-rn-runtime/components/dialogs/dialog/dialog.component.js.map +1 -1
  158. app-rn-runtime/components/dialogs/dialog/dialog.styles.js.map +1 -1
  159. app-rn-runtime/components/input/basedataset/basedataset.component.js.map +1 -1
  160. app-rn-runtime/components/input/baseinput/baseinput.component.js +11 -4
  161. app-rn-runtime/components/input/baseinput/baseinput.component.js.map +1 -1
  162. app-rn-runtime/components/input/baseinput/baseinput.props.js +1 -0
  163. app-rn-runtime/components/input/baseinput/baseinput.props.js.map +1 -1
  164. app-rn-runtime/components/input/basenumber/basenumber.component.js +25 -12
  165. app-rn-runtime/components/input/basenumber/basenumber.component.js.map +1 -1
  166. app-rn-runtime/components/input/basenumber/basenumber.props.js +2 -0
  167. app-rn-runtime/components/input/basenumber/basenumber.props.js.map +1 -1
  168. app-rn-runtime/components/input/checkbox/checkbox.component.js +5 -6
  169. app-rn-runtime/components/input/checkbox/checkbox.component.js.map +1 -1
  170. app-rn-runtime/components/input/checkbox/checkbox.styles.js.map +1 -1
  171. app-rn-runtime/components/input/checkboxset/checkboxset.component.js +24 -3
  172. app-rn-runtime/components/input/checkboxset/checkboxset.component.js.map +1 -1
  173. app-rn-runtime/components/input/checkboxset/checkboxset.props.js +1 -0
  174. app-rn-runtime/components/input/checkboxset/checkboxset.props.js.map +1 -1
  175. app-rn-runtime/components/input/checkboxset/checkboxset.styles.js +1 -0
  176. app-rn-runtime/components/input/checkboxset/checkboxset.styles.js.map +1 -1
  177. app-rn-runtime/components/input/chips/chips.component.js +3 -2
  178. app-rn-runtime/components/input/chips/chips.component.js.map +1 -1
  179. app-rn-runtime/components/input/currency/currency.component.js +16 -1
  180. app-rn-runtime/components/input/currency/currency.component.js.map +1 -1
  181. app-rn-runtime/components/input/epoch/base-datetime.component.js +22 -5
  182. app-rn-runtime/components/input/epoch/base-datetime.component.js.map +1 -1
  183. app-rn-runtime/components/input/epoch/wheel-date-picker.component.js +123 -12
  184. app-rn-runtime/components/input/epoch/wheel-date-picker.component.js.map +1 -1
  185. app-rn-runtime/components/input/epoch/wheelpicker/wheelpicker.component.js.map +1 -1
  186. app-rn-runtime/components/input/epoch/wheelpickermodal/date/date-picker-modal.component.js +4 -0
  187. app-rn-runtime/components/input/epoch/wheelpickermodal/date/date-picker-modal.component.js.map +1 -1
  188. app-rn-runtime/components/input/epoch/wheelpickermodal/date/date-picker-modal.props.js +2 -0
  189. app-rn-runtime/components/input/epoch/wheelpickermodal/date/date-picker-modal.props.js.map +1 -1
  190. app-rn-runtime/components/input/fileupload/fileupload.component.js +4 -2
  191. app-rn-runtime/components/input/fileupload/fileupload.component.js.map +1 -1
  192. app-rn-runtime/components/input/fileupload/fileupload.props.js +1 -0
  193. app-rn-runtime/components/input/fileupload/fileupload.props.js.map +1 -1
  194. app-rn-runtime/components/input/number/number.component.js +6 -3
  195. app-rn-runtime/components/input/number/number.component.js.map +1 -1
  196. app-rn-runtime/components/input/radioset/radioset.component.js +27 -7
  197. app-rn-runtime/components/input/radioset/radioset.component.js.map +1 -1
  198. app-rn-runtime/components/input/radioset/radioset.props.js +1 -0
  199. app-rn-runtime/components/input/radioset/radioset.props.js.map +1 -1
  200. app-rn-runtime/components/input/radioset/radioset.styles.js +1 -0
  201. app-rn-runtime/components/input/radioset/radioset.styles.js.map +1 -1
  202. app-rn-runtime/components/input/select/select.component.js +23 -9
  203. app-rn-runtime/components/input/select/select.component.js.map +1 -1
  204. app-rn-runtime/components/input/switch/switch.component.js +2 -2
  205. app-rn-runtime/components/input/switch/switch.component.js.map +1 -1
  206. app-rn-runtime/components/input/text/text.component.js +21 -0
  207. app-rn-runtime/components/input/text/text.component.js.map +1 -1
  208. app-rn-runtime/components/input/text/text.props.js +2 -0
  209. app-rn-runtime/components/input/text/text.props.js.map +1 -1
  210. app-rn-runtime/components/input/text/text.styles.js.map +1 -1
  211. app-rn-runtime/components/input/textarea/textarea.component.js +21 -0
  212. app-rn-runtime/components/input/textarea/textarea.component.js.map +1 -1
  213. app-rn-runtime/components/input/textarea/textarea.props.js +2 -0
  214. app-rn-runtime/components/input/textarea/textarea.props.js.map +1 -1
  215. app-rn-runtime/components/input/toggle/toggle.component.js +2 -4
  216. app-rn-runtime/components/input/toggle/toggle.component.js.map +1 -1
  217. app-rn-runtime/components/navigation/appnavbar/appnavbar.component.js +2 -2
  218. app-rn-runtime/components/navigation/appnavbar/appnavbar.component.js.map +1 -1
  219. app-rn-runtime/components/navigation/basenav/basenav.component.js.map +1 -1
  220. app-rn-runtime/components/navigation/navitem/navitem.component.js +2 -3
  221. app-rn-runtime/components/navigation/navitem/navitem.component.js.map +1 -1
  222. app-rn-runtime/components/navigation/popover/popover.component.js.map +1 -1
  223. app-rn-runtime/components/page/content/content.component.js +19 -4
  224. app-rn-runtime/components/page/content/content.component.js.map +1 -1
  225. app-rn-runtime/components/page/page-content/page-content.component.js +27 -2
  226. app-rn-runtime/components/page/page-content/page-content.component.js.map +1 -1
  227. app-rn-runtime/components/page/page-content/page-content.props.js +2 -2
  228. app-rn-runtime/components/page/page-content/page-content.props.js.map +1 -1
  229. app-rn-runtime/components/page/page-content/page-content.styles.js +6 -1
  230. app-rn-runtime/components/page/page-content/page-content.styles.js.map +1 -1
  231. app-rn-runtime/components/page/page.component.js.map +1 -1
  232. app-rn-runtime/components/page/page.props.js.map +1 -1
  233. app-rn-runtime/components/page/page.styles.js +7 -1
  234. app-rn-runtime/components/page/page.styles.js.map +1 -1
  235. app-rn-runtime/components/page/partial/partial.component.js +27 -1
  236. app-rn-runtime/components/page/partial/partial.component.js.map +1 -1
  237. app-rn-runtime/components/page/partial/partial.props.js.map +1 -1
  238. app-rn-runtime/components/page/partial/partial.styles.js +6 -1
  239. app-rn-runtime/components/page/partial/partial.styles.js.map +1 -1
  240. app-rn-runtime/components/page/tabbar/curve.js.map +1 -1
  241. app-rn-runtime/components/page/tabbar/tabbar.component.js.map +1 -1
  242. app-rn-runtime/components/page/tabbar/tabbar.props.js +1 -0
  243. app-rn-runtime/components/page/tabbar/tabbar.props.js.map +1 -1
  244. app-rn-runtime/components/prefab/prefab-container.component.js +27 -1
  245. app-rn-runtime/components/prefab/prefab-container.component.js.map +1 -1
  246. app-rn-runtime/components/prefab/prefab-container.props.js.map +1 -1
  247. app-rn-runtime/components/prefab/prefab-container.styles.js +6 -1
  248. app-rn-runtime/components/prefab/prefab-container.styles.js.map +1 -1
  249. app-rn-runtime/core/base.component.js +5 -3
  250. app-rn-runtime/core/base.component.js.map +1 -1
  251. app-rn-runtime/core/components/textinput.component.js +4 -3
  252. app-rn-runtime/core/components/textinput.component.js.map +1 -1
  253. app-rn-runtime/core/formatters.js.map +1 -1
  254. app-rn-runtime/core/key.extractor.js.map +1 -1
  255. app-rn-runtime/core/props.provider.js +4 -1
  256. app-rn-runtime/core/props.provider.js.map +1 -1
  257. app-rn-runtime/core/storage.service.js.map +1 -1
  258. app-rn-runtime/core/tappable.component.js +34 -27
  259. app-rn-runtime/core/tappable.component.js.map +1 -1
  260. app-rn-runtime/core/ui-preferences.context.js +7 -0
  261. app-rn-runtime/core/ui-preferences.context.js.map +1 -0
  262. app-rn-runtime/core/utils.js +87 -4
  263. app-rn-runtime/core/utils.js.map +1 -1
  264. app-rn-runtime/package.json +30 -7
  265. app-rn-runtime/runtime/App.js +4 -8
  266. app-rn-runtime/runtime/App.js.map +1 -1
  267. app-rn-runtime/runtime/App.navigator.js.map +1 -1
  268. app-rn-runtime/runtime/base-fragment.component.js +43 -13
  269. app-rn-runtime/runtime/base-fragment.component.js.map +1 -1
  270. app-rn-runtime/runtime/base-page.component.js.map +1 -1
  271. app-rn-runtime/runtime/base-partial.component.js.map +1 -1
  272. app-rn-runtime/runtime/base-prefab.component.js.map +1 -1
  273. app-rn-runtime/runtime/navigator/stack.navigator.js.map +1 -1
  274. app-rn-runtime/runtime/services/app-i18n.service.js +10 -0
  275. app-rn-runtime/runtime/services/app-i18n.service.js.map +1 -1
  276. app-rn-runtime/runtime/services/app-security.service.js +42 -2
  277. app-rn-runtime/runtime/services/app-security.service.js.map +1 -1
  278. app-rn-runtime/runtime/services/app-spinner.service.js +1 -1
  279. app-rn-runtime/runtime/services/app-spinner.service.js.map +1 -1
  280. app-rn-runtime/runtime/services/webprocess.service.js.map +1 -1
  281. app-rn-runtime/runtime/watcher.js.map +1 -1
  282. app-rn-runtime/styles/background.component.js +1 -0
  283. app-rn-runtime/styles/background.component.js.map +1 -1
  284. app-rn-runtime/styles/style-prop.validator.js.map +1 -1
  285. app-rn-runtime/styles/theme.js +5 -0
  286. app-rn-runtime/styles/theme.js.map +1 -1
  287. app-rn-runtime/styles/theme.variables.js +1 -0
  288. app-rn-runtime/styles/theme.variables.js.map +1 -1
  289. app-rn-runtime/variables/base-variable.js.map +1 -1
  290. app-rn-runtime/variables/device/file/upload-file.operation.js.map +1 -1
  291. app-rn-runtime/variables/device-variable.js.map +1 -1
  292. app-rn-runtime/variables/service-variable.js.map +1 -1
@@ -1 +1 @@
1
- {"version":3,"names":["React","Platform","View","DocumentPicker","BaseComponent","BaseComponentState","WmFileuploadProps","DEFAULT_CLASS","WmButton","WmFileuploadState","constructor","args","_defineProperty","namedParameters","copyToCacheDirectory","multiple","type","WmFileupload","props","onTap","getDocumentAsync","then","response","selectedFile","OS","assets","mimeType","file","invokeEventCallback","proxy","updateState","selectedFiles","bind","renderWidget","createElement","style","styles","root","_background","accessibilitylabel","caption","hint","id","getTestId","iconclass","button","iconsize"],"sources":["fileupload.component.tsx"],"sourcesContent":["import React from 'react';\nimport { Platform, View } from 'react-native';\nimport * as DocumentPicker from 'expo-document-picker';\n\nimport { BaseComponent, BaseComponentState } from '@wavemaker/app-rn-runtime/core/base.component';\n\nimport WmFileuploadProps from './fileupload.props';\nimport { DEFAULT_CLASS, WmFileuploadStyles } from './fileupload.styles';\nimport WmButton from '@wavemaker/app-rn-runtime/components/basic/button/button.component';\n\nexport interface SelectFileOutput {\n mimeType: string;\n name: string;\n size: number;\n type: 'cancel' | 'success';\n uri: string;\n}\n\nexport class WmFileuploadState extends BaseComponentState<WmFileuploadProps> {\n selectedFiles: any;\n}\n\nconst namedParameters = {\n copyToCacheDirectory: false,\n multiple: false,\n type: '*/*'\n};\n\nexport default class WmFileupload extends BaseComponent<WmFileuploadProps, WmFileuploadState, WmFileuploadStyles> {\n\n constructor(props: WmFileuploadProps) {\n super(props, DEFAULT_CLASS, new WmFileuploadProps());\n }\n\n onTap() {\n DocumentPicker.getDocumentAsync(namedParameters).then((response: any) => {\n let selectedFile;\n if (Platform.OS !== 'web') {\n selectedFile = response.assets[0];\n selectedFile.type = selectedFile.mimeType;\n } else {\n selectedFile = [response.assets[0].file];\n }\n this.invokeEventCallback('onBeforeselect', [null, this.proxy, selectedFile]);\n\n this.updateState({\n props: {\n selectedFiles: selectedFile\n }\n } as WmFileuploadState, this.invokeEventCallback.bind(this, 'onSelect', [null, this.proxy, selectedFile]));\n });\n }\n\n renderWidget(props: WmFileuploadProps) {\n return <View style={this.styles.root}>\n {this._background}\n <WmButton accessibilitylabel={props.accessibilitylabel || props.caption} hint = {props.hint} id={this.getTestId()} iconclass={props.iconclass} caption={props.caption} styles={this.styles.button} iconsize={props.iconsize} onTap={this.onTap.bind(this)}></WmButton>\n </View>\n }\n}\n"],"mappings":";;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,QAAQ,EAAEC,IAAI,QAAQ,cAAc;AAC7C,OAAO,KAAKC,cAAc,MAAM,sBAAsB;AAEtD,SAASC,aAAa,EAAEC,kBAAkB,QAAQ,+CAA+C;AAEjG,OAAOC,iBAAiB,MAAM,oBAAoB;AAClD,SAASC,aAAa,QAA4B,qBAAqB;AACvE,OAAOC,QAAQ,MAAM,oEAAoE;AAUzF,OAAO,MAAMC,iBAAiB,SAASJ,kBAAkB,CAAoB;EAAAK,YAAA,GAAAC,IAAA;IAAA,SAAAA,IAAA;IAAAC,eAAA;EAAA;AAE7E;AAEA,MAAMC,eAAe,GAAG;EACtBC,oBAAoB,EAAE,KAAK;EAC3BC,QAAQ,EAAE,KAAK;EACfC,IAAI,EAAE;AACR,CAAC;AAED,eAAe,MAAMC,YAAY,SAASb,aAAa,CAA2D;EAEhHM,WAAWA,CAACQ,KAAwB,EAAE;IACpC,KAAK,CAACA,KAAK,EAAEX,aAAa,EAAE,IAAID,iBAAiB,CAAC,CAAC,CAAC;EACtD;EAEAa,KAAKA,CAAA,EAAG;IACNhB,cAAc,CAACiB,gBAAgB,CAACP,eAAe,CAAC,CAACQ,IAAI,CAAEC,QAAa,IAAK;MACvE,IAAIC,YAAY;MAChB,IAAItB,QAAQ,CAACuB,EAAE,KAAK,KAAK,EAAE;QACzBD,YAAY,GAAGD,QAAQ,CAACG,MAAM,CAAC,CAAC,CAAC;QACjCF,YAAY,CAACP,IAAI,GAAGO,YAAY,CAACG,QAAQ;MAC3C,CAAC,MAAM;QACLH,YAAY,GAAG,CAACD,QAAQ,CAACG,MAAM,CAAC,CAAC,CAAC,CAACE,IAAI,CAAC;MAC1C;MACA,IAAI,CAACC,mBAAmB,CAAC,gBAAgB,EAAE,CAAC,IAAI,EAAE,IAAI,CAACC,KAAK,EAAEN,YAAY,CAAC,CAAC;MAE5E,IAAI,CAACO,WAAW,CAAC;QACbZ,KAAK,EAAE;UACPa,aAAa,EAAER;QACjB;MACF,CAAC,EAAuB,IAAI,CAACK,mBAAmB,CAACI,IAAI,CAAC,IAAI,EAAE,UAAU,EAAE,CAAC,IAAI,EAAE,IAAI,CAACH,KAAK,EAAEN,YAAY,CAAC,CAAC,CAAC;IAC5G,CAAC,CAAC;EACJ;EAEAU,YAAYA,CAACf,KAAwB,EAAE;IACrC,oBAAOlB,KAAA,CAAAkC,aAAA,CAAChC,IAAI;MAACiC,KAAK,EAAE,IAAI,CAACC,MAAM,CAACC;IAAK,GAClC,IAAI,CAACC,WAAW,eACjBtC,KAAA,CAAAkC,aAAA,CAAC1B,QAAQ;MAAC+B,kBAAkB,EAAErB,KAAK,CAACqB,kBAAkB,IAAIrB,KAAK,CAACsB,OAAQ;MAACC,IAAI,EAAIvB,KAAK,CAACuB,IAAK;MAACC,EAAE,EAAE,IAAI,CAACC,SAAS,CAAC,CAAE;MAACC,SAAS,EAAE1B,KAAK,CAAC0B,SAAU;MAACJ,OAAO,EAAEtB,KAAK,CAACsB,OAAQ;MAACJ,MAAM,EAAE,IAAI,CAACA,MAAM,CAACS,MAAO;MAACC,QAAQ,EAAE5B,KAAK,CAAC4B,QAAS;MAAC3B,KAAK,EAAE,IAAI,CAACA,KAAK,CAACa,IAAI,CAAC,IAAI;IAAE,CAAW,CACjQ,CAAC;EACT;AACF","ignoreList":[]}
1
+ {"version":3,"names":["React","Platform","View","DocumentPicker","BaseComponent","BaseComponentState","WmFileuploadProps","DEFAULT_CLASS","WmButton","getMimeType","WmFileuploadState","constructor","args","_defineProperty","namedParameters","copyToCacheDirectory","multiple","type","WmFileupload","props","onTap","contenttype","getDocumentAsync","then","response","selectedFile","OS","assets","mimeType","file","invokeEventCallback","proxy","updateState","selectedFiles","bind","renderWidget","createElement","style","styles","root","_background","accessibilitylabel","caption","hint","id","getTestId","iconclass","button","iconsize"],"sources":["fileupload.component.tsx"],"sourcesContent":["import React from 'react';\nimport { Platform, View } from 'react-native';\nimport * as DocumentPicker from 'expo-document-picker';\n\nimport { BaseComponent, BaseComponentState } from '@wavemaker/app-rn-runtime/core/base.component';\n\nimport WmFileuploadProps from './fileupload.props';\nimport { DEFAULT_CLASS, WmFileuploadStyles } from './fileupload.styles';\nimport WmButton from '@wavemaker/app-rn-runtime/components/basic/button/button.component';\nimport { getMimeType } from '@wavemaker/app-rn-runtime/core/utils';\n\nexport interface SelectFileOutput {\n mimeType: string;\n name: string;\n size: number;\n type: 'cancel' | 'success';\n uri: string;\n}\n\nexport class WmFileuploadState extends BaseComponentState<WmFileuploadProps> {\n selectedFiles: any;\n}\n\ntype NamedParametersType = {\n copyToCacheDirectory: boolean,\n multiple: boolean,\n type: string | string[]\n};\n\nconst namedParameters: NamedParametersType = {\n copyToCacheDirectory: false,\n multiple: false,\n type: '*/*'\n};\n\nexport default class WmFileupload extends BaseComponent<WmFileuploadProps, WmFileuploadState, WmFileuploadStyles> {\n\n constructor(props: WmFileuploadProps) {\n super(props, DEFAULT_CLASS, new WmFileuploadProps());\n }\n\n onTap(props: WmFileuploadProps) {\n namedParameters.type = getMimeType(props.contenttype);\n DocumentPicker.getDocumentAsync(namedParameters).then((response: any) => {\n let selectedFile;\n if (Platform.OS !== 'web') {\n selectedFile = response.assets[0];\n selectedFile.type = selectedFile.mimeType;\n } else {\n selectedFile = [response.assets[0].file];\n }\n this.invokeEventCallback('onBeforeselect', [null, this.proxy, selectedFile]);\n\n this.updateState({\n props: {\n selectedFiles: selectedFile\n }\n } as WmFileuploadState, this.invokeEventCallback.bind(this, 'onSelect', [null, this.proxy, selectedFile]));\n });\n }\n\n renderWidget(props: WmFileuploadProps) {\n return <View style={this.styles.root}>\n {this._background}\n <WmButton accessibilitylabel={props.accessibilitylabel || props.caption} hint = {props.hint} id={this.getTestId()} iconclass={props.iconclass} caption={props.caption} styles={this.styles.button} iconsize={props.iconsize} onTap={() => this.onT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AI,CAACC,mBAAmB,CAAC,gBAAgB,EAAE,CAAC,IAAI,EAAE,IAAI,CAACC,KAAK,EAAEN,YAAY,CAAC,CAAC;MAE5E,IAAI,CAACO,WAAW,CAAC;QACbb,KAAK,EAAE;UACPc,aAAa,EAAER;QACjB;MACF,CAAC,EAAuB,IAAI,CAACK,mBAAmB,CAACI,IAAI,CAAC,IAAI,EAAE,UAAU,EAAE,CAAC,IAAI,EAAE,IAAI,CAACH,KAAK,EAAEN,YAAY,CAAC,CAAC,CAAC;IAC5G,CAAC,CAAC;EACJ;EAEAU,YAAYA,CAAChB,KAAwB,EAAE;IACrC,oBAAOnB,KAAA,CAAAoC,aAAA,CAAClC,IAAI;MAACmC,KAAK,EAAE,IAAI,CAACC,MAAM,CAACC;IAAK,GAClC,IAAI,CAACC,WAAW,eACjBxC,KAAA,CAAAoC,aAAA,CAAC5B,QAAQ;MAACiC,kBAAkB,EAAEtB,KAAK,CAACsB,kBAAkB,IAAItB,KAAK,CAACuB,OAAQ;MAACC,IAAI,EAAIxB,KAAK,CAACwB,IAAK;MAACC,EAAE,EAAE,IAAI,CAACC,SAAS,CAAC,CAAE;MAACC,SAAS,EAAE3B,KAAK,CAAC2B,SAAU;MAACJ,OAAO,EAAEvB,KAAK,CAACuB,OAAQ;MAACJ,MAAM,EAAE,IAAI,CAACA,MAAM,CAACS,MAAO;MAACC,QAAQ,EAAE7B,KAAK,CAAC6B,QAAS;MAAC5B,KAAK,EAAEA,CAAA,KAAM,IAAI,CAACA,KAAK,CAACc,IAAI,CAAC,IAAI,CAAC,CAACf,KAAK;IAAE,CAAW,CAC9Q,CAAC;EACT;AACF","ignoreList":[]}
@@ -9,6 +9,7 @@ export default class WmFileuploadProps extends BaseProps {
9
9
  _defineProperty(this, "iconsize", 16);
10
10
  _defineProperty(this, "caption", 'Upload');
11
11
  _defineProperty(this, "selectedFiles", void 0);
12
+ _defineProperty(this, "contenttype", void 0);
12
13
  _defineProperty(this, "accessibilitylabel", undefined);
13
14
  _defineProperty(this, "hint", undefined);
14
15
  }
@@ -1 +1 @@
1
- {"version":3,"names":["BaseProps","WmFileuploadProps","constructor","args","_defineProperty","undefined"],"sources":["fileupload.props.ts"],"sourcesContent":["import { BaseProps } from '@wavemaker/app-rn-runtime/core/base.component';\nimport {AccessibilityRole} from 'react-native';\n\nexport default class WmFileuploadProps extends BaseProps {\n iconclass: string = 'wm-sl-l sl-cloud-upload';\n iconsize: number = 16;\n caption: string = 'Upload';\n selectedFiles?: any;\n accessibilitylabel?: string = undefined;\n hint?: string = undefined;\n}\n"],"mappings":";;;AAAA,SAASA,SAAS,QAAQ,+CAA+C;AAGzE,eAAe,MAAMC,iBAAiB,SAASD,SAAS,CAAC;EAAAE,YAAA,GAAAC,IAAA;IAAA,SAAAA,IAAA;IAAAC,eAAA,oBACnC,yBAAyB;IAAAA,eAAA,mBAC1B,EAAE;IAAAA,eAAA,kBACH,QAAQ;IAAAA,eAAA;IAAAA,eAAA,6BAEIC,SAAS;IAAAD,eAAA,eACvBC,SAAS;EAAA;AAC3B","ignoreList":[]}
1
+ {"version":3,"names":["BaseProps","WmFileuploadProps","constructor","args","_defineProperty","undefined"],"sources":["fileupload.props.ts"],"sourcesContent":["import { BaseProps } from '@wavemaker/app-rn-runtime/core/base.component';\nimport {AccessibilityRole} from 'react-native';\n\nexport default class WmFileuploadProps extends BaseProps {\n iconclass: string = 'wm-sl-l sl-cloud-upload';\n iconsize: number = 16;\n caption: string = 'Upload';\n selectedFiles?: any;\n contenttype?: string;\n accessibilitylabel?: string = undefined;\n hint?: string = undefined;\n}\n"],"mappings":";;;AAAA,SAASA,SAAS,QAAQ,+CAA+C;AAGzE,eAAe,MAAMC,iBAAiB,SAASD,SAAS,CAAC;EAAAE,YAAA,GAAAC,IAAA;IAAA,SAAAA,IAAA;IAAAC,eAAA,oBACnC,yBAAyB;IAAAA,eAAA,mBAC1B,EAAE;IAAAA,eAAA,kBACH,QAAQ;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA,6BAGIC,SAAS;IAAAD,eAAA,eACvBC,SAAS;EAAA;AAC3B","ignoreList":[]}
@@ -52,14 +52,17 @@ export default class WmNumber extends BaseNumberComponent {
52
52
  autoFocus: props.autofocus,
53
53
  editable: props.disabled || props.readonly ? false : true,
54
54
  placeholder: props.placeholder,
55
- onBlur: this.onBlur.bind(this),
55
+ onBlur: event => {
56
+ this.onBlur.bind(this)(event, !!props.displayValue);
57
+ },
56
58
  onFocus: this.onFocus.bind(this),
57
59
  onKeyPress: this.validateInputEntry.bind(this),
58
60
  onChangeText: text => {
59
- this.onChangeText.bind(this)(text, 'number');
61
+ this.onChangeText.bind(this)(text, 'number', !!props.displayValue);
60
62
  },
61
63
  onChange: this.invokeChange.bind(this),
62
- allowContentSelection: this.styles.text.userSelect === 'text'
64
+ allowContentSelection: this.styles.text.userSelect === 'text',
65
+ customDisplayValue: props.displayValue
63
66
  }));
64
67
  }
65
68
  }
@@ -1 +1 @@
1
- {"version":3,"names":["React","Platform","isNull","WmNumberProps","DEFAULT_CLASS","WMTextInput","BaseNumberComponent","BaseNumberState","AccessibilityWidgetType","getAccessibilityProps","WmNumberState","constructor","args","_defineProperty","WmNumber","props","getStyleClassName","classes","state","floatinglabel","push","join","renderWidget","_this$state$textValue","opts","valueExpr","OS","textValue","toString","createElement","_extends","getTestPropsForInput","NUMBER","ref","widgetRef","selectionStart","selectionEnd","cursor","floatingLabel","floatingLabelStyle","styles","activeFloatingLabelStyle","activeFloatingLabel","style","root","isValid","invalid","keyboardType","placeholderTextColor","placeholderText","color","autoFocus","autofocus","editable","disabled","readonly","placeholder","onBlur","bind","onFocus","onKeyPress","validateInputEntry","onChangeText","text","onChange","invokeChange","allowContentSelection","userSelect"],"sources":["number.component.tsx"],"sourcesContent":["import React from 'react';\nimport { Platform } from 'react-native';\nimport { isNull } from 'lodash';\n\nimport WmNumberProps from './number.props';\nimport { DEFAULT_CLASS, WmNumberStyles } from './number.styles';\nimport { WMTextInput } from '@wavemaker/app-rn-runtime/core/components/textinput.component';\nimport {\n BaseNumberComponent,\n BaseNumberState\n} from '@wavemaker/app-rn-runtime/components/input/basenumber/basenumber.component';\nimport { AccessibilityWidgetType, getAccessibilityProps } from '@wavemaker/app-rn-runtime/core/accessibility'; \n\nexport class WmNumberState extends BaseNumberState<WmNumberProps> {\n keyboardType: any;\n}\n\nexport default class WmNumber extends BaseNumberComponent<WmNumberProps, WmNumberState, WmNumberStyles> {\n\n constructor(props: WmNumberProps) {\n super(props, DEFAULT_CLASS, new WmNumberProps(), new WmNumberState());\n }\n\n public getStyleClassName(): string | undefined {\n const classes = [];\n if (this.state.props.floatinglabel) {\n classes.push('app-number-with-label'); \n }\n classes.push(super.getStyleClassName());\n return classes.join(' ');\n }\n\n renderWidget(props: WmNumberProps) {\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(AccessibilityWidgetType.NUMBER, props)}\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 style={[this.styles.root, this.state.isValid ? {} : this.styles.invalid]}\n keyboardType=\"numeric\"\n placeholderTextColor={this.styles.placeholderText.color as any}\n autoFocus={props.autofocus}\n editable={props.disabled || props.readonly ? false : true}\n placeholder={props.placeholder}\n onBlur={this.onBlur.bind(this)}\n onFocus={this.onFocus.bind(this)}\n onKeyPress={this.validateInputEntry.bind(this)}\n onChangeText={(text) => {\n this.onChangeText.bind(this)(text, 'number');\n }}\n onChange={this.invokeChange.bind(this)}\n allowContentSelection={this.styles.text.userSelect === 'text'}\n />);\n }\n}\n"],"mappings":";;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I,CAACC,kBAAkB,CAACH,IAAI,CAAC,IAAI,CAAE;MAC/CI,YAAY,EAAGC,IAAI,IAAK;QACtB,IAAI,CAACD,YAAY,CAACJ,IAAI,CAAC,IAAI,CAAC,CAACK,IAAI,EAAE,QAAQ,CAAC;MAC9C,CAAE;MACFC,QAAQ,EAAE,IAAI,CAACC,YAAY,CAACP,IAAI,CAAC,IAAI,CAAE;MACvCQ,qBAAqB,EAAE,IAAI,CAAC1B,MAAM,CAACuB,IAAI,CAACI,UAAU,KAAK;IAAO,EAC/D,CAAC;EACJ;AACF","ignoreList":[]}
1
+ {"version":3,"names":["React","Platform","isNull","WmNumberProps","DEFAULT_CLASS","WMTextInput","BaseNumberComponent","BaseNumberState","AccessibilityWidgetType","getAccessibilityProps","WmNumberState","constructor","args","_defineProperty","WmNumber","props","getStyleClassName","classes","state","floatinglabel","push","join","renderWidget","_this$state$textValue","opts","valueExpr","OS","textValue","toString","createElement","_extends","getTestPropsForInput","NUMBER","ref","widgetRef","selectionStart","selectionEnd","cursor","floatingLabel","floatingLabelStyle","styles","activeFloatingLabelStyle","activeFloatingLabel","style","root","isValid","invalid","keyboardType","placeholderTextColor","placeholderText","color","autoFocus","autofocus","editable","disabled","readonly","placeholder","onBlur","event","bind","displayValue","onFocus","onKeyPress","validateInputEntry","onChangeText","text","onChange","invokeChange","allowContentSelection","userSelect","customDisplayValue"],"sources":["number.component.tsx"],"sourcesContent":["import React from 'react';\nimport { Platform } from 'react-native';\nimport { isNull } from 'lodash';\n\nimport WmNumberProps from './number.props';\nimport { DEFAULT_CLASS, WmNumberStyles } from './number.styles';\nimport { WMTextInput } from '@wavemaker/app-rn-runtime/core/components/textinput.component';\nimport {\n BaseNumberComponent,\n BaseNumberState\n} from '@wavemaker/app-rn-runtime/components/input/basenumber/basenumber.component';\nimport { AccessibilityWidgetType, getAccessibilityProps } from '@wavemaker/app-rn-runtime/core/accessibility'; \n\nexport class WmNumberState extends BaseNumberState<WmNumberProps> {\n keyboardType: any;\n}\n\nexport default class WmNumber extends BaseNumberComponent<WmNumberProps, WmNumberState, WmNumberStyles> {\n\n constructor(props: WmNumberProps) {\n super(props, DEFAULT_CLASS, new WmNumberProps(), new WmNumberState());\n }\n\n public getStyleClassName(): string | undefined {\n const classes = [];\n if (this.state.props.floatinglabel) {\n classes.push('app-number-with-label'); \n }\n classes.push(super.getStyleClassName());\n return classes.join(' ');\n }\n\n renderWidget(props: WmNumberProps) {\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(AccessibilityWidgetType.NUMBER, props)}\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 style={[this.styles.root, this.state.isValid ? {} : this.styles.invalid]}\n keyboardType=\"numeric\"\n placeholderTextColor={this.styles.placeholderText.color as any}\n autoFocus={props.autofocus}\n editable={props.disabled || props.readonly ? false : true}\n placeholder={props.placeholder}\n onBlur={(event)=>{this.onBlur.bind(this)(event, !!props.displayValue)}}\n onFocus={this.onFocus.bind(this)}\n onKeyPress={this.validateInputEntry.bind(this)}\n onChangeText={(text) => {\n this.onChangeText.bind(this)(text, 'number', !!props.displayValue);\n }}\n onChange={this.invokeChange.bind(this)}\n allowContentSelection={this.styles.text.userSelect === 'text'}\n customDisplayValue={props.displayValue}\n />);\n }\n}\n"],"mappings":";;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,QAAQ,QAAQ,cAAc;AACvC,SAASC,MAAM,QAAQ,QAAQ;AAE/B,OAAOC,aAAa,MAAM,gBAAgB;AAC1C,SAASC,aAAa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EAAGC,IAAI,IAAK;QACtB,IAAI,CAACD,YAAY,CAACL,IAAI,CAAC,IAAI,CAAC,CAACM,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAClD,KAAK,CAAC6C,YAAY,CAAC;MACpE,CAAE;MACFM,QAAQ,EAAE,IAAI,CAACC,YAAY,CAACR,IAAI,CAAC,IAAI,CAAE;MACvCS,qBAAqB,EAAE,IAAI,CAAC5B,MAAM,CAACyB,IAAI,CAACI,UAAU,KAAK,MAAO;MAC9DC,kBAAkB,EAAEvD,KAAK,CAAC6C;IAAa,EACxC,CAAC;EACJ;AACF","ignoreList":[]}
@@ -11,6 +11,8 @@ import { BaseDatasetComponent, BaseDatasetState } from '@wavemaker/app-rn-runtim
11
11
  import WmIcon from '@wavemaker/app-rn-runtime/components/basic/icon/icon.component';
12
12
  import { find, isEqual } from 'lodash-es';
13
13
  import { isEmpty } from 'lodash';
14
+ import WmLabel from '@wavemaker/app-rn-runtime/components/basic/label/label.component';
15
+ import { getNumberOfEmptyObjects } from '@wavemaker/app-rn-runtime/core/utils';
14
16
  export class WmRadiosetState extends BaseDatasetState {
15
17
  constructor(...args) {
16
18
  super(...args);
@@ -22,10 +24,10 @@ export default class WmRadioset extends BaseDatasetComponent {
22
24
  super(props, DEFAULT_CLASS, new WmRadiosetProps());
23
25
  }
24
26
  onPress(item) {
25
- this.invokeEventCallback('onTap', [null, this.proxy]);
26
27
  if (this.state.props.disabled || this.state.props.readonly) {
27
28
  return;
28
29
  }
30
+ this.invokeEventCallback('onTap', [null, this.proxy]);
29
31
  item.selected = true;
30
32
  let selectedValue = "";
31
33
  const selectedItem = find(this.state.dataItems, d => isEqual(d.key, item.key));
@@ -51,14 +53,14 @@ export default class WmRadioset extends BaseDatasetComponent {
51
53
  }],
52
54
  onPress: this.onPress.bind(this, item),
53
55
  key: item.key
54
- }, this.getTestPropsForAction()), /*#__PURE__*/React.createElement(WmIcon, _extends({}, this.getTestProps('' + index), {
56
+ }, this.getTestPropsForAction("radio" + index)), /*#__PURE__*/React.createElement(WmIcon, {
57
+ id: this.getTestId('radiobutton' + index),
55
58
  iconclass: "wi wi-fiber-manual-record",
56
59
  styles: item.selected ? this.styles.checkedRadio : this.styles.uncheckedRadio,
57
- disabled: this.state.props.readonly || this.state.props.disabled,
58
- accessibilitylabel: `Radio button for ${displayText}`
59
- })), !isEmpty(this.state.template) && this.props.renderitempartial ? this.props.renderitempartial(item.dataObject, index, this.state.template) : /*#__PURE__*/React.createElement(Text, _extends({
60
- style: this.styles.radioLabel
61
- }, this.getTestPropsForLabel('caption')), displayText));
60
+ disabled: this.state.props.readonly || this.state.props.disabled
61
+ }), !isEmpty(this.state.template) && this.props.renderitempartial ? this.props.renderitempartial(item.dataObject, index, this.state.template) : /*#__PURE__*/React.createElement(Text, _extends({
62
+ style: [this.styles.radioLabel, item.selected ? this.styles.selectedLabel : null]
63
+ }, this.getTestPropsForLabel('caption' + index)), displayText));
62
64
  }
63
65
  setTemplate(partialName) {
64
66
  this.updateState({
@@ -85,6 +87,24 @@ export default class WmRadioset extends BaseDatasetComponent {
85
87
  style: noOfColumns === 1 ? {} : this.styles.group
86
88
  }, items && items.length ? items.map((item, index) => this.renderChild(item, index, colWidth)) : null);
87
89
  }
90
+ renderSkeleton(props) {
91
+ var _ref;
92
+ const noOfColumns = props.itemsperrow.xs || 1;
93
+ const colWidth = Math.round(100 / noOfColumns) + '%';
94
+ return [...getNumberOfEmptyObjects((_ref = props.numberofskeletonitems) !== null && _ref !== void 0 ? _ref : 5)].map(_ => {
95
+ return /*#__PURE__*/React.createElement(View, {
96
+ style: [this.styles.item, {
97
+ width: colWidth
98
+ }]
99
+ }, /*#__PURE__*/React.createElement(WmIcon, {
100
+ styles: this.styles.checkedRadio
101
+ }), /*#__PURE__*/React.createElement(WmLabel, {
102
+ styles: {
103
+ skeleton: this.styles.skeleton
104
+ }
105
+ }));
106
+ });
107
+ }
88
108
  renderWidget(props) {
89
109
  const items = this.state.dataItems;
90
110
  return /*#__PURE__*/React.createElement(ScrollView, {
@@ -1 +1 @@
1
- {"version":3,"names":["React","View","Text","TouchableOpacity","ScrollView","WmRadiosetProps","DEFAULT_CLASS","BaseDatasetComponent","BaseDatasetState","WmIcon","find","isEqual","isEmpty","WmRadiosetState","constructor","args","_defineProperty","WmRadioset","props","onPress","item","invokeEventCallback","proxy","state","disabled","readonly","selected","selectedValue","selectedItem","dataItems","d","key","oldValue","datavalue","datafield","validate","updateState","computeDisplayValue","undefined","renderChild","index","colWidth","displayText","displayexp","displayfield","value","getItemKey","createElement","_extends","style","styles","width","bind","getTestPropsForAction","getTestProps","iconclass","checkedRadio","uncheckedRadio","accessibilitylabel","template","renderitempartial","dataObject","radioLabel","getTestPropsForLabel","setTemplate","partialName","renderGroupby","groupedData","accessibilityRole","length","map","groupObj","groupHeaderTitle","renderRadioButtons","data","items","noOfColumns","itemsperrow","xs","Math","round","group","renderWidget","root","horizontal","groupby"],"sources":["radioset.component.tsx"],"sourcesContent":["import React from 'react';\nimport { View, Text, DimensionValue, TouchableOpacity } from 'react-native';\nimport { ScrollView } from 'react-native-gesture-handler';\n\nimport WmRadiosetProps from './radioset.props';\nimport { DEFAULT_CLASS, WmRadiosetStyles } from './radioset.styles';\nimport {\n BaseDatasetComponent,\n BaseDatasetState\n} from '@wavemaker/app-rn-runtime/components/input/basedataset/basedataset.component';\nimport WmIcon from '@wavemaker/app-rn-runtime/components/basic/icon/icon.component';\nimport WmSkeleton, { createSkeleton } from '../../basic/skeleton/skeleton.component';\nimport { AccessibilityWidgetType, getAccessibilityProps } from '@wavemaker/app-rn-runtime/core/accessibility';\nimport { find, forEach, isEqual } from 'lodash-es';\nimport { isEmpty } from 'lodash';\n\nexport class WmRadiosetState extends BaseDatasetState<WmRadiosetProps> {\n template: string = '';\n}\n\nexport default class WmRadioset extends BaseDatasetComponent<WmRadiosetProps, WmRadiosetState, WmRadiosetStyles> {\n\n constructor(props: WmRadiosetProps) {\n super(props, DEFAULT_CLASS, new WmRadiosetProps());\n }\n\n onPress(item: any) {\n this.invokeEventCallback('onTap', [null, this.proxy]);\n if (this.state.props.disabled || this.state.props.readonly) {\n return;\n }\n item.selected = true;\n let selectedValue: any = \"\";\n const selectedItem = find(this.state.dataItems, d => isEqual(d.key, item.key));\n const oldValue = this.state.props.datavalue;\n selectedItem.selected = item.selected;\n selectedValue = selectedItem.selected ? selectedItem.datafield : null;\n this.validate(selectedValue);\n this.updateState({ props: { datavalue: selectedValue }} as WmRadiosetState,() => {\n this.computeDisplayValue();\n this.invokeEventCallback('onChange', [ undefined, this.proxy, selectedValue, oldValue ]);\n });\n }\n\n renderChild(item: any, index: any, colWidth: DimensionValue) {\n const displayText = item.displayexp || item.displayfield;\n const value = this.state.props.datafield === 'All Fields' ? this.getItemKey(item.datafield) : item.datafield;\n return (\n <TouchableOpacity style={[\n this.styles.item,\n item.selected ? this.styles.selectedItem : null,\n {width: colWidth}]} onPress={this.onPress.bind(this, item)} key={item.key} {...this.getTestPropsForAction()}>\n <WmIcon {...this.getTestProps('' + index)} iconclass=\"wi wi-fiber-manual-record\" styles={item.selected ? this.styles.checkedRadio : this.styles.uncheckedRadio} disabled={this.state.props.readonly || this.state.props.disabled} accessibilitylabel={`Radio button for ${displayText}`}></WmIcon>\n {!isEmpty(this.state.template) && this.props.renderitempartial ?\n this.props.renderitempartial(item.dataObject, index, this.state.template) : <Text style={this.styles.radioLabel} {...this.getTestPropsForLabel('caption')}>{displayText}</Text>}\n </TouchableOpacity>)\n }\n\n setTemplate(partialName: any) {\n this.updateState({ template: partialName } as WmRadiosetState);\n }\n\n renderGroupby() {\n const groupedData = this.state.groupedData;\n return (\n <View accessibilityRole='radiogroup'>\n {groupedData && groupedData.length\n ? groupedData.map((groupObj: any, index: any) => {\n return(\n <View key={groupObj.key}>\n <Text style={this.styles.groupHeaderTitle}>{groupObj.key}</Text>\n {this.renderRadioButtons(groupObj.data)}\n </View>)\n })\n : null}\n </View>\n );\n }\n\n renderRadioButtons(items: any) {\n const props = this.state.props;\n const noOfColumns = props.itemsperrow.xs || 1;\n const colWidth = Math.round(100/ noOfColumns) + '%' as DimensionValue;\n return(\n <View style={noOfColumns === 1 ? {} : this.styles.group}>\n {items && items.length ?\n items.map((item: any, index: any) => this.renderChild(item, index, colWidth)): null}\n </View>)\n }\n\n renderWidget(props: WmRadiosetProps) {\n const items = this.state.dataItems;\n return (\n <ScrollView style={this.styles.root}>\n <ScrollView horizontal={true}>\n {props.groupby && this.renderGroupby()}\n {!props.groupby && this.renderRadioButtons(items)}\n </ScrollView>\n </ScrollView>\n );\n }\n}\n"],"mappings":";;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,IAAI,EAAEC,IAAI,EAAkBC,gBAAgB,QAAQ,cAAc;AAC3E,SAASC,UAAU,QAAQ,8BAA8B;AAEzD,OAAOC,eAAe,MAAM,kBAAkB;AAC9C,SAASC,aAAa,QAA0B,mBAAmB;AACnE,SACEC,oBAAoB,EACpBC,gBAAgB,QACX,8EAA8E;AACrF,OAAOC,MAAM,MAAM,gEAAgE;AAGnF,SAASC,IAAI,EAAWC,OAAO,QAAQ,WAAW;AAClD,SAASC,OAAO,QAAQ,QAAQ;AAEhC,OAAO,MAAMC,eAAe,SAASL,gBAAgB,CAAkB;EAAAM,YAAA,GAAAC,IAAA;IAAA,SAAAA,IAAA;IAAAC,eAAA,mBAClD,EAAE;EAAA;AACvB;AAEA,eAAe,MAAMC,UAAU,SAASV,oBAAoB,CAAqD;EAE/GO,WAAWA,CAACI,KAAsB,EAAE;IAClC,KAAK,CAACA,KAAK,EAAEZ,aAAa,EAAE,IAAID,eAAe,CAAC,CAAC,CAAC;EACpD;EAEAc,OAAOA,CAACC,IAAS,EAAE;IACjB,IAAI,CAACC,mBAAmB,CAAC,OAAO,EAAE,CAAC,IAAI,EAAE,IAAI,CAACC,KAAK,CAAC,CAAC;IACrD,IAAI,IAAI,CAACC,KAAK,CAACL,KAAK,CAACM,QAAQ,IAAI,IAAI,CAACD,KAAK,CAACL,KAAK,CAACO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sB,EAAE;IACnC,MAAMyD,KAAK,GAAG,IAAI,CAACpD,KAAK,CAACM,SAAS;IAClC,oBACE7B,KAAA,CAAA+C,aAAA,CAAC3C,UAAU;MAAC6C,KAAK,EAAE,IAAI,CAACC,MAAM,CAACiC;IAAK,gBAClCnF,KAAA,CAAA+C,aAAA,CAAC3C,UAAU;MAACgF,UAAU,EAAE;IAAK,GAC1BlE,KAAK,CAACmE,OAAO,IAAI,IAAI,CAACnB,aAAa,CAAC,CAAC,EACrC,CAAChD,KAAK,CAACmE,OAAO,IAAI,IAAI,CAACZ,kBAAkB,CAACE,KAAK,CACtC,CACF,CAAC;EAEjB;AACF","ignoreList":[]}
1
+ {"version":3,"names":["React","View","Text","TouchableOpacity","ScrollView","WmRadiosetProps","DEFAULT_CLASS","BaseDatasetComponent","BaseDatasetState","WmIcon","find","isEqual","isEmpty","WmLabel","getNumberOfEmptyObjects","WmRadiosetState","constructor","args","_defineProperty","WmRadioset","props","onPress","item","state","disabled","readonly","invokeEventCallback","proxy","selected","selectedValue","selectedItem","dataItems","d","key","oldValue","datavalue","datafield","validate","updateState","computeDisplayValue","undefined","renderChild","index","colWidth","displayText","displayexp","displayfield","value","getItemKey","createElement","_extends","style","styles","width","bind","getTestPropsForAction","id","getTestId","iconclass","checkedRadio","uncheckedRadio","template","renderitempartial","dataObject","radioLabel","selectedLabel","getTestPropsForLabel","setTemplate","partialName","renderGroupby","groupedData","accessibilityRole","length","map","groupObj","groupHeaderTitle","renderRadioButtons","data","items","noOfColumns","itemsperrow","xs","Math","round","group","renderSkeleton","_ref","numberofskeletonitems","_","skeleton","renderWidget","root","horizontal","groupby"],"sources":["radioset.component.tsx"],"sourcesContent":["import React from 'react';\nimport { View, Text, DimensionValue, TouchableOpacity } from 'react-native';\nimport { ScrollView } from 'react-native-gesture-handler';\n\nimport WmRadiosetProps from './radioset.props';\nimport { DEFAULT_CLASS, WmRadiosetStyles } from './radioset.styles';\nimport {\n BaseDatasetComponent,\n BaseDatasetState\n} from '@wavemaker/app-rn-runtime/components/input/basedataset/basedataset.component';\nimport WmIcon from '@wavemaker/app-rn-runtime/components/basic/icon/icon.component';\nimport WmSkeleton, { createSkeleton } from '../../basic/skeleton/skeleton.component';\nimport { AccessibilityWidgetType, getAccessibilityProps } from '@wavemaker/app-rn-runtime/core/accessibility';\nimport { find, forEach, isEqual } from 'lodash-es';\nimport { isEmpty } from 'lodash';\nimport WmLabel from '@wavemaker/app-rn-runtime/components/basic/label/label.component';\nimport { getNumberOfEmptyObjects } from '@wavemaker/app-rn-runtime/core/utils';\n\nexport class WmRadiosetState extends BaseDatasetState<WmRadiosetProps> {\n template: string = '';\n}\n\nexport default class WmRadioset extends BaseDatasetComponent<WmRadiosetProps, WmRadiosetState, WmRadiosetStyles> {\n\n constructor(props: WmRadiosetProps) {\n super(props, DEFAULT_CLASS, new WmRadiosetProps());\n }\n\n onPress(item: any) {\n if (this.state.props.disabled || this.state.props.readonly) {\n return;\n }\n this.invokeEventCallback('onTap', [null, this.proxy]);\n item.selected = true;\n let selectedValue: any = \"\";\n const selectedItem = find(this.state.dataItems, d => isEqual(d.key, item.key));\n const oldValue = this.state.props.datavalue;\n selectedItem.selected = item.selected;\n selectedValue = selectedItem.selected ? selectedItem.datafield : null;\n this.validate(selectedValue);\n this.updateState({ props: { datavalue: selectedValue }} as WmRadiosetState,() => {\n this.computeDisplayValue();\n this.invokeEventCallback('onChange', [ undefined, this.proxy, selectedValue, oldValue ]);\n });\n }\n\n renderChild(item: any, index: any, colWidth: DimensionValue) {\n const displayText = item.displayexp || item.displayfield;\n const value = this.state.props.datafield === 'All Fields' ? this.getItemKey(item.datafield) : item.datafield;\n return (\n <TouchableOpacity style={[\n this.styles.item,\n item.selected ? this.styles.selectedItem : null,\n {width: colWidth}]} onPress={this.onPress.bind(this, item)} key={item.key} {...this.getTestPropsForAction(\"radio\"+index)}>\n <WmIcon id={this.getTestId('radiobutton' + index)} iconclass=\"wi wi-fiber-manual-record\" styles={item.selected ? this.styles.checkedRadio : this.styles.uncheckedRadio} disabled={this.state.props.readonly || this.state.props.disabled}></WmIcon>\n {!isEmpty(this.state.template) && this.props.renderitempartial ?\n this.props.renderitempartial(item.dataObject, index, this.state.template) : <Text style={[this.styles.radioLabel, item.selected ? this.styles.selectedLabel : null]} {...this.getTestPropsForLabel('caption'+index)}>{displayText}</Text>}\n </TouchableOpacity>)\n }\n\n setTemplate(partialName: any) {\n this.updateState({ template: partialName } as WmRadiosetState);\n }\n\n renderGroupby() {\n const groupedData = this.state.groupedData;\n return (\n <View accessibilityRole='radiogroup'>\n {groupedData && groupedData.length\n ? groupedData.map((groupObj: any, index: any) => {\n return(\n <View key={groupObj.key}>\n <Text style={this.styles.groupHeaderTitle}>{groupObj.key}</Text>\n {this.renderRadioButtons(groupObj.data)}\n </View>)\n })\n : null}\n </View>\n );\n }\n\n renderRadioButtons(items: any) {\n const props = this.state.props;\n const noOfColumns = props.itemsperrow.xs || 1;\n const colWidth = Math.round(100/ noOfColumns) + '%' as DimensionValue;\n return(\n <View style={noOfColumns === 1 ? {} : this.styles.group}>\n {items && items.length ?\n items.map((item: any, index: any) => this.renderChild(item, index, colWidth)): null}\n </View>)\n }\n\n public renderSkeleton(props: WmRadiosetProps): React.ReactNode {\n const noOfColumns = props.itemsperrow.xs || 1;\n const colWidth = Math.round(100/ noOfColumns) + '%' as DimensionValue;\n\n return [...getNumberOfEmptyObjects(props.numberofskeletonitems as number ?? 5)].map(_ => {\n return <View style={[this.styles.item, {width: colWidth}]}>\n <WmIcon styles={this.styles.checkedRadio}/>\n <WmLabel styles={{ skeleton: this.styles.skeleton }}/>\n </View>\n })\n\n }\n\n renderWidget(props: WmRadiosetProps) {\n const items = this.state.dataItems;\n return (\n <ScrollView style={this.styles.root}>\n <ScrollView horizontal={true}>\n {props.groupby && this.renderGroupby()}\n {!props.groupby && this.renderRadioButtons(items)}\n </ScrollView>\n </ScrollView>\n );\n }\n}\n"],"mappings":";;;;AAAA,OAAOA,KAAK,MAAM,OAAO;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A,GAAClE,KAAK,CAACmE,qBAAqB,cAAAD,IAAA,cAAAA,IAAA,GAAc,CAAC,CAAC,CAAC,CAACb,GAAG,CAACe,CAAC,IAAI;MACvF,oBAAOxF,KAAA,CAAAiD,aAAA,CAAChD,IAAI;QAACkD,KAAK,EAAE,CAAC,IAAI,CAACC,MAAM,CAAC9B,IAAI,EAAE;UAAC+B,KAAK,EAAEV;QAAQ,CAAC;MAAE,gBACxD3C,KAAA,CAAAiD,aAAA,CAACxC,MAAM;QAAC2C,MAAM,EAAE,IAAI,CAACA,MAAM,CAACO;MAAa,CAAC,CAAC,eAC3C3D,KAAA,CAAAiD,aAAA,CAACpC,OAAO;QAACuC,MAAM,EAAE;UAAEqC,QAAQ,EAAE,IAAI,CAACrC,MAAM,CAACqC;QAAS;MAAE,CAAC,CACjD,CAAC;IACT,CAAC,CAAC;EAEJ;EAEAC,YAAYA,CAACtE,KAAsB,EAAE;IACnC,MAAM0D,KAAK,GAAG,IAAI,CAACvD,KAAK,CAACQ,SAAS;IAClC,oBACE/B,KAAA,CAAAiD,aAAA,CAAC7C,UAAU;MAAC+C,KAAK,EAAE,IAAI,CAACC,MAAM,CAACuC;IAAK,gBAClC3F,KAAA,CAAAiD,aAAA,CAAC7C,UAAU;MAACwF,UAAU,EAAE;IAAK,GAC1BxE,KAAK,CAACyE,OAAO,IAAI,IAAI,CAACxB,aAAa,CAAC,CAAC,EACrC,CAACjD,KAAK,CAACyE,OAAO,IAAI,IAAI,CAACjB,kBAAkB,CAACE,KAAK,CACtC,CACF,CAAC;EAEjB;AACF","ignoreList":[]}
@@ -13,6 +13,7 @@ export default class WmRadiosetProps extends BaseDatasetProps {
13
13
  lg: 1
14
14
  });
15
15
  _defineProperty(this, "renderitempartial", void 0);
16
+ _defineProperty(this, "numberofskeletonitems", void 0);
16
17
  }
17
18
  }
18
19
  //# sourceMappingURL=radioset.props.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["BaseDatasetProps","WmRadiosetProps","constructor","args","_defineProperty","xs","sm","md","lg"],"sources":["radioset.props.ts"],"sourcesContent":["import BaseDatasetProps from '@wavemaker/app-rn-runtime/components/input/basedataset/basedataset.props';\n\nexport default class WmRadiosetProps extends BaseDatasetProps {\n dataset: any = 'Option 1, Option 2, Option 3';\n itemsperrow = {\n xs: 1,\n sm: 1,\n md: 1,\n lg: 1,\n };\n renderitempartial?: (item: any, index: number, partialName: string)=> React.ReactNode;\n}\n"],"mappings":";;;AAAA,OAAOA,gBAAgB,MAAM,0EAA0E;AAEvG,eAAe,MAAMC,eAAe,SAASD,gBAAgB,CAAC;EAAAE,YAAA,GAAAC,IAAA;IAAA,SAAAA,IAAA;IAAAC,eAAA,kBAC7C,8BAA8B;IAAAA,eAAA,sBAC9B;MACbC,EAAE,EAAE,CAAC;MACLC,EAAE,EAAE,CAAC;MACLC,EAAE,EAAE,CAAC;MACLC,EAAE,EAAE;IACP,CAAC;IAAAJ,eAAA;EAAA;AAEF","ignoreList":[]}
1
+ {"version":3,"names":["BaseDatasetProps","WmRadiosetProps","constructor","args","_defineProperty","xs","sm","md","lg"],"sources":["radioset.props.ts"],"sourcesContent":["import BaseDatasetProps from '@wavemaker/app-rn-runtime/components/input/basedataset/basedataset.props';\n\nexport default class WmRadiosetProps extends BaseDatasetProps {\n dataset: any = 'Option 1, Option 2, Option 3';\n itemsperrow = {\n xs: 1,\n sm: 1,\n md: 1,\n lg: 1,\n };\n renderitempartial?: (item: any, index: number, partialName: string)=> React.ReactNode;\n numberofskeletonitems?: number | string\n}\n"],"mappings":";;;AAAA,OAAOA,gBAAgB,MAAM,0EAA0E;AAEvG,eAAe,MAAMC,eAAe,SAASD,gBAAgB,CAAC;EAAAE,YAAA,GAAAC,IAAA;IAAA,SAAAA,IAAA;IAAAC,eAAA,kBAC7C,8BAA8B;IAAAA,eAAA,sBAC9B;MACbC,EAAE,EAAE,CAAC;MACLC,EAAE,EAAE,CAAC;MACLC,EAAE,EAAE,CAAC;MACLC,EAAE,EAAE;IACP,CAAC;IAAAJ,eAAA;IAAAA,eAAA;EAAA;AAGF","ignoreList":[]}
@@ -26,6 +26,7 @@ BASE_THEME.registerStyle((themeVariables, addStyle) => {
26
26
  marginTop: 8
27
27
  },
28
28
  selectedItem: {},
29
+ selectedLabel: {},
29
30
  radioLabel: {
30
31
  alignSelf: 'center',
31
32
  fontFamily: themeVariables.baseFont,
@@ -1 +1 @@
1
- {"version":3,"names":["BASE_THEME","defineStyles","DEFAULT_CLASS","registerStyle","themeVariables","addStyle","defaultStyles","root","color","checkedColor","text","group","flexDirection","flexWrap","groupHeaderTitle","backgroundColor","groupHeadingBgColor","fontSize","paddingLeft","paddingRight","lineHeight","fontFamily","baseFont","item","alignContent","marginRight","marginTop","selectedItem","radioLabel","alignSelf","labelDefaultColor","marginLeft","skeleton","width","height","borderRadius","uncheckedRadio","borderStyle","borderWidth","borderColor","checkedBorderColor","icon","opacity","checkedRadio","padding","checkedDisabledColor"],"sources":["radioset.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 '../../basic/skeleton/skeleton.styles';\nimport { WmIconStyles } from '@wavemaker/app-rn-runtime/components/basic/icon/icon.styles';\n\nexport type WmRadiosetStyles = BaseStyles & {\n group: AllStyle,\n groupHeaderTitle: AllStyle;\n item: AllStyle;\n selectedItem: AllStyle;\n radioLabel: AllStyle;\n skeleton: WmSkeletonStyles;\n uncheckedRadio: WmIconStyles;\n checkedRadio: WmIconStyles;\n};\n\nexport const DEFAULT_CLASS = 'app-radioset';\nBASE_THEME.registerStyle((themeVariables, addStyle) => {\n const defaultStyles: WmRadiosetStyles = defineStyles({\n root: {\n color: themeVariables.checkedColor\n },\n text: {},\n group: {\n flexDirection: 'row',\n flexWrap: 'wrap'\n },\n groupHeaderTitle: {\n backgroundColor: themeVariables.groupHeadingBgColor,\n fontSize: 16,\n paddingLeft: 8,\n paddingRight: 8,\n lineHeight: 40,\n fontFamily: themeVariables.baseFont\n } as AllStyle,\n item: {\n flexDirection: 'row',\n alignContent: 'center',\n marginRight: -20,\n marginTop: 8\n } as AllStyle,\n selectedItem: {} as AllStyle,\n radioLabel: {\n alignSelf: 'center',\n fontFamily: themeVariables.baseFont,\n fontSize: 16,\n color: themeVariables.labelDefaultColor,\n marginLeft: 8\n } as AllStyle,\n skeleton: {\n root: {\n width: '100%',\n height: 16,\n borderRadius: 4\n }\n } as any as WmSkeletonStyles,\n uncheckedRadio: {\n root: {\n width: 20,\n height: 20,\n borderRadius: 10,\n borderStyle: \"solid\",\n borderWidth: 2,\n borderColor: themeVariables.checkedBorderColor,\n },\n text: {},\n icon: {\n opacity: 0,\n }\n } as WmIconStyles,\n checkedRadio : {\n root: {\n width: 20,\n height: 20,\n borderRadius: 10,\n borderStyle: \"solid\",\n borderWidth: 2,\n borderColor: themeVariables.checkedBorderColor,\n },\n text: {\n fontSize: 16,\n },\n icon : {\n color: themeVariables.checkedColor,\n padding: 0,\n }\n } as WmIconStyles\n});\n\n addStyle(DEFAULT_CLASS + '-disabled', '', {\n root : {\n color: themeVariables.checkedDisabledColor,\n opacity: 0.8\n }\n });\n\n addStyle(DEFAULT_CLASS, '', defaultStyles);\n});\n"],"mappings":"AAAA,OAAOA,UAAU,MAAoB,wCAAwC;AAC7E,SAAqBC,YAAY,QAAQ,+CAA+C;AAexF,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,KAAK,EAAEJ,cAAc,CAACK;IACxB,CAAC;IACDC,IAAI,EAAE,CAAC,CAAC;IACRC,KAAK,EAAE;MACLC,aAAa,EAAE,KAAK;MACpBC,QAAQ,EAAE;IACZ,CAAC;IACDC,gBAAgB,EAAE;MAChBC,eAAe,EAAEX,cAAc,C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cAAc,CAACK,YAAY;QAClCmC,OAAO,EAAE;MACX;IACN;EACF,CAAC,CAAC;EAEAvC,QAAQ,CAACH,aAAa,GAAG,WAAW,EAAE,EAAE,EAAE;IACxCK,IAAI,EAAG;MACLC,KAAK,EAAEJ,cAAc,CAACyC,oBAAoB;MAC1CH,OAAO,EAAE;IACX;EACF,CAAC,CAAC;EAEFrC,QAAQ,CAACH,aAAa,EAAE,EAAE,EAAEI,aAAa,CAAC;AAC5C,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["BASE_THEME","defineStyles","DEFAULT_CLASS","registerStyle","themeVariables","addStyle","defaultStyles","root","color","checkedColor","text","group","flexDirection","flexWrap","groupHeaderTitle","backgroundColor","groupHeadingBgColor","fontSize","paddingLeft","paddingRight","lineHeight","fontFamily","baseFont","item","alignContent","marginRight","marginTop","selectedItem","selectedLabel","radioLabel","alignSelf","labelDefaultColor","marginLeft","skeleton","width","height","borderRadius","uncheckedRadio","borderStyle","borderWidth","borderColor","checkedBorderColor","icon","opacity","checkedRadio","padding","checkedDisabledColor"],"sources":["radioset.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';\nimport { WmIconStyles } from '@wavemaker/app-rn-runtime/components/basic/icon/icon.styles';\n\nexport type WmRadiosetStyles = BaseStyles & {\n group: AllStyle,\n groupHeaderTitle: AllStyle;\n item: AllStyle;\n selectedItem: AllStyle;\n radioLabel: AllStyle;\n skeleton: WmSkeletonStyles;\n uncheckedRadio: WmIconStyles;\n checkedRadio: WmIconStyles;\n};\n\nexport const DEFAULT_CLASS = 'app-radioset';\nBASE_THEME.registerStyle((themeVariables, addStyle) => {\n const defaultStyles: WmRadiosetStyles = defineStyles({\n root: {\n color: themeVariables.checkedColor\n },\n text: {},\n group: {\n flexDirection: 'row',\n flexWrap: 'wrap'\n },\n groupHeaderTitle: {\n backgroundColor: themeVariables.groupHeadingBgColor,\n fontSize: 16,\n paddingLeft: 8,\n paddingRight: 8,\n lineHeight: 40,\n fontFamily: themeVariables.baseFont\n } as AllStyle,\n item: {\n flexDirection: 'row',\n alignContent: 'center',\n marginRight: -20,\n marginTop: 8\n } as AllStyle,\n selectedItem: {} as AllStyle,\n selectedLabel: {} as AllStyle,\n radioLabel: {\n alignSelf: 'center',\n fontFamily: themeVariables.baseFont,\n fontSize: 16,\n color: themeVariables.labelDefaultColor,\n marginLeft: 8\n } as AllStyle,\n skeleton: {\n root: {\n width: '100%',\n height: 16,\n borderRadius: 4,\n }\n } as any as WmSkeletonStyles,\n uncheckedRadio: {\n root: {\n width: 20,\n height: 20,\n borderRadius: 10,\n borderStyle: \"solid\",\n borderWidth: 2,\n borderColor: themeVariables.checkedBorderColor,\n },\n text: {},\n icon: {\n opacity: 0,\n }\n } as WmIconStyles,\n checkedRadio : {\n root: {\n width: 20,\n height: 20,\n borderRadius: 10,\n borderStyle: \"solid\",\n borderWidth: 2,\n borderColor: themeVariables.checkedBorderColor,\n },\n text: {\n fontSize: 16,\n },\n icon : {\n color: themeVariables.checkedColor,\n padding: 0,\n }\n } as WmIconStyles\n});\n\n addStyle(DEFAULT_CLASS + '-disabled', '', {\n root : {\n color: themeVariables.checkedDisabledColor,\n opacity: 0.8\n }\n });\n\n addStyle(DEFAULT_CLASS, '', defaultStyles);\n});\n"],"mappings":"AAAA,OAAOA,UAAU,MAAoB,wCAAwC;AAC7E,SAAqBC,YAAY,QAAQ,+CAA+C;AAexF,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,KAAK,EAAEJ,cAAc,CAACK;IACxB,CAAC;IACDC,IAAI,EAAE,CAAC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ACpBC,WAAW,EAAE,CAAC;QACdC,WAAW,EAAEpC,cAAc,CAACqC;MAC9B,CAAC;MACD/B,IAAI,EAAE;QACJO,QAAQ,EAAE;MACZ,CAAC;MACDyB,IAAI,EAAG;QACLlC,KAAK,EAAEJ,cAAc,CAACK,YAAY;QAClCoC,OAAO,EAAE;MACX;IACN;EACF,CAAC,CAAC;EAEAxC,QAAQ,CAACH,aAAa,GAAG,WAAW,EAAE,EAAE,EAAE;IACxCK,IAAI,EAAG;MACLC,KAAK,EAAEJ,cAAc,CAAC0C,oBAAoB;MAC1CH,OAAO,EAAE;IACX;EACF,CAAC,CAAC;EAEFtC,QAAQ,CAACH,aAAa,EAAE,EAAE,EAAEI,aAAa,CAAC;AAC5C,CAAC,CAAC","ignoreList":[]}
@@ -15,6 +15,7 @@ import WmButton from '@wavemaker/app-rn-runtime/components/basic/button/button.c
15
15
  import { Tappable } from '@wavemaker/app-rn-runtime/core/tappable.component';
16
16
  import ThemeVariables from '@wavemaker/app-rn-runtime/styles/theme.variables';
17
17
  import { AccessibilityWidgetType, getAccessibilityProps } from '@wavemaker/app-rn-runtime/core/accessibility';
18
+ import { BackgroundComponent } from '@wavemaker/app-rn-runtime/styles/background.component';
18
19
  export class WmSelectState extends BaseDatasetState {
19
20
  constructor(...args) {
20
21
  super(...args);
@@ -90,6 +91,7 @@ export default class WmSelect extends BaseDatasetComponent {
90
91
  }
91
92
  renderSelect() {
92
93
  const props = this.state.props;
94
+ const select = this.styles.root;
93
95
  return (
94
96
  /*#__PURE__*/
95
97
  /*
@@ -104,7 +106,16 @@ export default class WmSelect extends BaseDatasetComponent {
104
106
  this.view = ref;
105
107
  },
106
108
  onLayout: () => {}
107
- }, /*#__PURE__*/React.createElement(Text, _extends({
109
+ }, select.backgroundImage ? /*#__PURE__*/React.createElement(BackgroundComponent, {
110
+ image: select.backgroundImage,
111
+ position: select.backgroundPosition || 'center',
112
+ size: select.backgroundSize || 'contain',
113
+ repeat: select.backgroundRepeat || 'no-repeat',
114
+ resizeMode: select.backgroundResizeMode,
115
+ style: {
116
+ borderRadius: this.styles.root.borderRadius
117
+ }
118
+ }) : null, /*#__PURE__*/React.createElement(Text, _extends({
108
119
  style: [this.styles.text, this.state.props.displayValue ? {} : {
109
120
  color: this.styles.placeholderText.color
110
121
  }],
@@ -132,14 +143,17 @@ export default class WmSelect extends BaseDatasetComponent {
132
143
  }
133
144
  renderSelectItem(item, index, isPlaceholder, isLast) {
134
145
  let selected = this.isSelected(item);
135
- return /*#__PURE__*/React.createElement(Tappable, _extends({}, this.getTestPropsForAction(index + ''), {
136
- onTap: this.onItemSelect.bind(this, item, isPlaceholder)
137
- }, getAccessibilityProps(AccessibilityWidgetType.SELECT, {
138
- ...this.props,
139
- expanded: this.state.isOpened
140
- })), /*#__PURE__*/React.createElement(View, {
146
+ return /*#__PURE__*/React.createElement(Tappable, _extends({}, this.getTestPropsForAction('selectitem' + index), {
147
+ onTap: this.onItemSelect.bind(this, item, isPlaceholder),
148
+ accessibilityProps: {
149
+ ...getAccessibilityProps(AccessibilityWidgetType.SELECT, {
150
+ ...this.props,
151
+ expanded: this.state.isOpened
152
+ })
153
+ }
154
+ }), /*#__PURE__*/React.createElement(View, {
141
155
  style: [this.styles.selectItem, isLast ? this.styles.lastSelectItem : null, selected ? this.styles.selectedItem : null]
142
- }, /*#__PURE__*/React.createElement(Text, _extends({}, this.getTestPropsForLabel(index + ''), {
156
+ }, /*#__PURE__*/React.createElement(Text, _extends({}, this.getTestPropsForLabel('label' + index), {
143
157
  style: [this.styles.selectItemText, {
144
158
  color: isPlaceholder ? this.styles.placeholderText.color : selected ? this.styles.selectedItemText.color : this.styles.selectItemText.color
145
159
  }]
@@ -172,7 +186,7 @@ export default class WmSelect extends BaseDatasetComponent {
172
186
  this.updateDefaultQueryModel();
173
187
  }
174
188
  renderWidget(props) {
175
- return /*#__PURE__*/React.createElement(View, null, this.renderSelect(), this.state.isOpened ? /*#__PURE__*/React.createElement(ModalConsumer, null, modalService => {
189
+ return /*#__PURE__*/React.createElement(View, null, this._background, this.renderSelect(), this.state.isOpened ? /*#__PURE__*/React.createElement(ModalConsumer, null, modalService => {
176
190
  const items = this.state.dataItems;
177
191
  modalService.showModal(this.prepareModalOptions( /*#__PURE__*/React.createElement(ScrollView, {
178
192
  style: {
@@ -1 +1 @@
1
- {"version":3,"names":["React","Text","View","ScrollView","find","isEmpty","WmSelectProps","DEFAULT_CLASS","BaseDatasetComponent","BaseDatasetState","WmIcon","ModalConsumer","WmButton","Tappable","ThemeVariables","AccessibilityWidgetType","getAccessibilityProps","WmSelectState","constructor","args","_defineProperty","WmSelect","props","updateState","isOpened","onPress","event","state","disabled","showPopover","invokeEventCallback","proxy","onPropertyChange","name","$new","$old","isNaN","displayValue","placeholder","prepareModalOptions","content","styles","modalService","o","modalOptions","modalStyle","modal","contentStyle","modalContent","isModal","centered","onClose","hide","isDefaultValue","validate","setTimeout","triggerValidation","setState","hideModal","focus","_this$widgetRef","widgetRef","renderSelect","createElement","style","root","isValid","invalid","backgroundColor","disabledText","ref","view","onLayout","_extends","text","color","placeholderText","getTestPropsForInput","SELECT","bind","arrowButton","iconclass","onTap","hint","isSelected","item","val","datafield","dataObject","datavalue","onItemSelect","isPlaceholder","onChange","renderSelectItem","index","isLast","selected","getTestPropsForAction","expanded","selectItem","lastSelectItem","selectedItem","getTestPropsForLabel","selectItemText","selectedItemText","displayexp","displayfield","id","getTestId","theme","mergeStyle","checkIcon","opacity","updateDefaultQueryModel","dataItems","length","componentDidMount","onDataItemsUpdate","renderWidget","items","showModal","width","maxHeight","INSTANCE","maxModalHeight","contentContainerStyle","dropDownContent","key","map"],"sources":["select.component.tsx"],"sourcesContent":["import React from 'react';\nimport { Text, View } from 'react-native';\nimport { ScrollView } from 'react-native-gesture-handler';\nimport { find, isEmpty } from 'lodash';\n\nimport WmSelectProps from './select.props';\nimport { DEFAULT_CLASS, WmSelectStyles } from './select.styles';\nimport {\n BaseDatasetComponent,\n BaseDatasetState\n} from '@wavemaker/app-rn-runtime/components/input/basedataset/basedataset.component';\nimport WmIcon from '@wavemaker/app-rn-runtime/components/basic/icon/icon.component';\nimport { ModalConsumer, ModalOptions, ModalService } from '@wavemaker/app-rn-runtime/core/modal.service';\nimport WmButton from '@wavemaker/app-rn-runtime/components/basic/button/button.component';\nimport { Tappable } from '@wavemaker/app-rn-runtime/core/tappable.component';\nimport ThemeVariables from '@wavemaker/app-rn-runtime/styles/theme.variables';\nimport { AccessibilityWidgetType, getAccessibilityProps } from '@wavemaker/app-rn-runtime/core/accessibility'; \n\nexport class WmSelectState extends BaseDatasetState<WmSelectProps> {\n modalOptions = {} as ModalOptions;\n isOpened: boolean = false;\n selectedValue: any = '';\n}\n\nexport default class WmSelect extends BaseDatasetComponent<WmSelectProps, WmSelectState, WmSelectStyles> {\n constructor(props: WmSelectProps) {\n super(props, DEFAULT_CLASS, new WmSelectProps(), new WmSelectState());\n }\n view: View = null as any;\n public widgetRef: Text | null = null;\n private isDefaultValue: boolean = true;\n\n onPress(event: any) {\n if (this.state.props.disabled) {\n return;\n }\n if (!this.state.isOpened) {\n this.showPopover();\n }\n this.invokeEventCallback('onFocus', [event, this.proxy]);\n }\n\n onPropertyChange(name: string, $new: any, $old: any): void {\n super.onPropertyChange(name, $new, $old);\n switch(name) {\n case 'datavalue':\n if (isNaN($new) && isEmpty($new)) {\n this.updateState({\n props: {\n displayValue: this.state.props.placeholder || ''\n }\n } as WmSelectState);\n }\n }\n }\n\n prepareModalOptions(content: React.ReactNode, styles: WmSelectStyles, modalService: ModalService) {\n const o = this.state.modalOptions;\n o.modalStyle = styles.modal;\n o.contentStyle = {...styles.modalContent};\n o.content = content;\n o.isModal = true;\n o.centered = true;\n o.onClose = () => {\n this.hide = () => {};\n if (this.isDefaultValue && this.state.props.displayValue === '') {\n this.validate(this.state.props.displayValue);\n setTimeout(() => {\n this.props.triggerValidation && this.props.triggerValidation();\n }, 0);\n }\n this.invokeEventCallback('onBlur', [{}, this.proxy]);\n this.setState({ isOpened: false, modalOptions: {} as ModalOptions } as WmSelectState);\n };\n this.hide = () => modalService.hideModal(this.state.modalOptions);\n return o;\n }\n\n public showPopover = () => {\n this.updateState({ isOpened: true } as WmSelectState);\n };\n\n public hide = () => {};\n\n focus() {\n this?.widgetRef?.focus();\n }\n\n renderSelect() {\n const props = this.state.props;\n return (\n /*\n * onLayout function is required.\n * https://github.com/naoufal/react-native-accordion/pull/19/files\n */\n <View\n style={[this.styles.root, this.state.isValid ? {} : this.styles.invalid, { backgroundColor: props.disabled ? this.styles.disabledText.backgroundColor : this.styles.root.backgroundColor}]}\n ref={(ref) => {\n this.view = ref as View;\n }}\n onLayout={() => {}}>\n <Text\n style={[this.styles.text,\n this.state.props.displayValue ? {} : {color: this.styles.placeholderText.color}]}\n ref={(ref) => {\n this.widgetRef = ref;\n }}\n {...this.getTestPropsForInput()}\n {...getAccessibilityProps(\n AccessibilityWidgetType.SELECT,\n props\n )}\n onPress={this.onPress.bind(this)}>\n {this.state.props.displayValue || props.placeholder || ' '}\n </Text>\n <WmButton\n styles={this.styles.arrowButton}\n iconclass={'wi wi-keyboard-arrow-down'}\n onTap={this.onPress.bind(this)}\n hint={props?.hint}\n />\n </View>\n );\n }\n\n isSelected(item: any) {\n const val = this.state.props.datafield === 'All Fields' ? item.dataObject : item.datafield;\n return this.state.props.datavalue === val;\n }\n\n onItemSelect(item: any, isPlaceholder?: boolean) {\n this.isDefaultValue = false;\n this.onChange(isPlaceholder ? '' : this.state.props.datafield === 'All Fields' ? item.dataObject : item.datafield);\n this.hide();\n }\n\n renderSelectItem(item: any, index: number, isPlaceholder: boolean, isLast: boolean) {\n let selected = this.isSelected(item);\n return (\n <Tappable {...this.getTestPropsForAction(index + '')} onTap={this.onItemSelect.bind(this, item, isPlaceholder)} {...getAccessibilityProps(\n AccessibilityWidgetType.SELECT,\n {...this.props, expanded: this.state.isOpened}\n )}>\n <View style={[this.styles.selectItem, isLast ? this.styles.lastSelectItem : null, selected ? this.styles.selectedItem : null ]}>\n <Text {...this.getTestPropsForLabel(index + '')} style={[this.styles.selectItemText, {color: isPlaceholder ? this.styles.placeholderText.color : selected ? this.styles.selectedItemText.color : this.styles.selectItemText.color}]}>\n {isPlaceholder ? this.state.props.placeholder : (item.displayexp || item.displayfield)}\n </Text>\n <WmIcon id={this.getTestId('checkicon' + index)} iconclass='wi wi-check' styles={this.theme.mergeStyle(this.styles.checkIcon, {\n root: {\n opacity: !isPlaceholder && selected ? 1 : 0\n }\n })}></WmIcon>\n </View>\n </Tappable>\n );\n }\n\n updateDefaultQueryModel() {\n if (this.state.dataItems && this.state.dataItems.length && this.isDefaultValue) {\n const selectedItem = find(this.state.dataItems, (item) => item.selected);\n selectedItem && this.updateState({\n props: {\n displayValue: selectedItem.displayexp || selectedItem.displayfield || ''\n }\n } as WmSelectState);\n }\n }\n\n componentDidMount() {\n super.componentDidMount();\n this.updateDefaultQueryModel();\n }\n\n onDataItemsUpdate() {\n super.onDataItemsUpdate();\n this.updateDefaultQueryModel();\n }\n\n renderWidget(props: WmSelectProps) {\n return (\n <View>\n {this.renderSelect()}\n {this.state.isOpened ? (\n <ModalConsumer>\n {(modalService: ModalService) => {\n const items = this.state.dataItems;\n modalService.showModal(\n this.prepareModalOptions(\n <ScrollView style={{width: '100%', maxHeight: ThemeVariables.INSTANCE.maxModalHeight}} contentContainerStyle={this.styles.dropDownContent}>\n {props.placeholder ?\n <View key={props.name + '_placeholder'} style={this.styles.placeholderText}>\n {this.renderSelectItem({}, 0, true, false)}\n </View>\n : null}\n {items && items.map((item: any, index: number) => (\n <View key={item.key}>\n {this.renderSelectItem(item, index, false, index === items.length - 1)}\n </View>\n ))}\n </ScrollView>,\n this.styles,\n modalService\n )\n );\n return null;\n }}\n </ModalConsumer>\n ) : null}\n </View>\n );\n }\n}\n"],"mappings":";;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,IAAI,EAAEC,IAAI,QAAQ,cAAc;AACzC,SAASC,UAAU,QAAQ,8BAA8B;AACzD,SAASC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":["React","Text","View","ScrollView","find","isEmpty","WmSelectProps","DEFAULT_CLASS","BaseDatasetComponent","BaseDatasetState","WmIcon","ModalConsumer","WmButton","Tappable","ThemeVariables","AccessibilityWidgetType","getAccessibilityProps","BackgroundComponent","WmSelectState","constructor","args","_defineProperty","WmSelect","props","updateState","isOpened","onPress","event","state","disabled","showPopover","invokeEventCallback","proxy","onPropertyChange","name","$new","$old","isNaN","displayValue","placeholder","prepareModalOptions","content","styles","modalService","o","modalOptions","modalStyle","modal","contentStyle","modalContent","isModal","centered","onClose","hide","isDefaultValue","validate","setTimeout","triggerValidation","setState","hideModal","focus","_this$widgetRef","widgetRef","renderSelect","select","root","createElement","style","isValid","invalid","backgroundColor","disabledText","ref","view","onLayout","backgroundImage","image","position","backgroundPosition","size","backgroundSize","repeat","backgroundRepeat","resizeMode","backgroundResizeMode","borderRadius","_extends","text","color","placeholderText","getTestPropsForInput","SELECT","bind","arrowButton","iconclass","onTap","hint","isSelected","item","val","datafield","dataObject","datavalue","onItemSelect","isPlaceholder","onChange","renderSelectItem","index","isLast","selected","getTestPropsForAction","accessibilityProps","expanded","selectItem","lastSelectItem","selectedItem","getTestPropsForLabel","selectItemText","selectedItemText","displayexp","displayfield","id","getTestId","theme","mergeStyle","checkIcon","opacity","updateDefaultQueryModel","dataItems","length","componentDidMount","onDataItemsUpdate","renderWidget","_background","items","showModal","width","maxHeight","INSTANCE","maxModalHeight","contentContainerStyle","dropDownContent","key","map"],"sources":["select.component.tsx"],"sourcesContent":["import React from 'react';\nimport { Text, View } from 'react-native';\nimport { ScrollView } from 'react-native-gesture-handler';\nimport { find, isEmpty } from 'lodash';\n\nimport WmSelectProps from './select.props';\nimport { DEFAULT_CLASS, WmSelectStyles } from './select.styles';\nimport {\n BaseDatasetComponent,\n BaseDatasetState\n} from '@wavemaker/app-rn-runtime/components/input/basedataset/basedataset.component';\nimport WmIcon from '@wavemaker/app-rn-runtime/components/basic/icon/icon.component';\nimport { ModalConsumer, ModalOptions, ModalService } from '@wavemaker/app-rn-runtime/core/modal.service';\nimport WmButton from '@wavemaker/app-rn-runtime/components/basic/button/button.component';\nimport { Tappable } from '@wavemaker/app-rn-runtime/core/tappable.component';\nimport ThemeVariables from '@wavemaker/app-rn-runtime/styles/theme.variables';\nimport { AccessibilityWidgetType, getAccessibilityProps } from '@wavemaker/app-rn-runtime/core/accessibility'; \nimport { BackgroundComponent } from '@wavemaker/app-rn-runtime/styles/background.component';\n\nexport class WmSelectState extends BaseDatasetState<WmSelectProps> {\n modalOptions = {} as ModalOptions;\n isOpened: boolean = false;\n selectedValue: any = '';\n}\n\nexport default class WmSelect extends BaseDatasetComponent<WmSelectProps, WmSelectState, WmSelectStyles> {\n constructor(props: WmSelectProps) {\n super(props, DEFAULT_CLASS, new WmSelectProps(), new WmSelectState());\n }\n view: View = null as any;\n public widgetRef: Text | null = null;\n private isDefaultValue: boolean = true;\n\n onPress(event: any) {\n if (this.state.props.disabled) {\n return;\n }\n if (!this.state.isOpened) {\n this.showPopover();\n }\n this.invokeEventCallback('onFocus', [event, this.proxy]);\n }\n\n onPropertyChange(name: string, $new: any, $old: any): void {\n super.onPropertyChange(name, $new, $old);\n switch(name) {\n case 'datavalue':\n if (isNaN($new) && isEmpty($new)) {\n this.updateState({\n props: {\n displayValue: this.state.props.placeholder || ''\n }\n } as WmSelectState);\n }\n }\n }\n\n prepareModalOptions(content: React.ReactNode, styles: WmSelectStyles, modalService: ModalService) {\n const o = this.state.modalOptions;\n o.modalStyle = styles.modal;\n o.contentStyle = {...styles.modalContent};\n o.content = content;\n o.isModal = true;\n o.centered = true;\n o.onClose = () => {\n this.hide = () => {};\n if (this.isDefaultValue && this.state.props.displayValue === '') {\n this.validate(this.state.props.displayValue);\n setTimeout(() => {\n this.props.triggerValidation && this.props.triggerValidation();\n }, 0);\n }\n this.invokeEventCallback('onBlur', [{}, this.proxy]);\n this.setState({ isOpened: false, modalOptions: {} as ModalOptions } as WmSelectState);\n };\n this.hide = () => modalService.hideModal(this.state.modalOptions);\n return o;\n }\n\n public showPopover = () => {\n this.updateState({ isOpened: true } as WmSelectState);\n };\n\n public hide = () => {};\n\n focus() {\n this?.widgetRef?.focus();\n }\n\n renderSelect() {\n const props = this.state.props;\n const select = this.styles.root as any;\n return (\n /*\n * onLayout function is required.\n * https://github.com/naoufal/react-native-accordion/pull/19/files\n */\n <View\n style={[this.styles.root, this.state.isValid ? {} : this.styles.invalid, { backgroundColor: props.disabled ? this.styles.disabledText.backgroundColor : this.styles.root.backgroundColor}]}\n ref={(ref) => {\n this.view = ref as View;\n }}\n onLayout={() => {}}>\n {select.backgroundImage ? (<BackgroundComponent\n image={select.backgroundImage}\n position={select.backgroundPosition || 'center'}\n size={select.backgroundSize || 'contain'}\n repeat={select.backgroundRepeat || 'no-repeat'}\n resizeMode={select.backgroundResizeMode}\n style={{borderRadius: this.styles.root.borderRadius}}\n ></BackgroundComponent>) : null }\n <Text\n style={[this.styles.text,\n this.state.props.displayValue ? {} : {color: this.styles.placeholderText.color}]}\n ref={(ref) => {\n this.widgetRef = ref;\n }}\n {...this.getTestPropsForInput()}\n {...getAccessibilityProps(\n AccessibilityWidgetType.SELECT,\n props\n )}\n onPress={this.onPress.bind(this)}>\n {this.state.props.displayValue || props.placeholder || ' '}\n </Text>\n <WmButton\n styles={this.styles.arrowButton}\n iconclass={'wi wi-keyboard-arrow-down'}\n onTap={this.onPress.bind(this)}\n hint={props?.hint}\n />\n </View>\n );\n }\n\n isSelected(item: any) {\n const val = this.state.props.datafield === 'All Fields' ? item.dataObject : item.datafield;\n return this.state.props.datavalue === val;\n }\n\n onItemSelect(item: any, isPlaceholder?: boolean) {\n this.isDefaultValue = false;\n this.onChange(isPlaceholder ? '' : this.state.props.datafield === 'All Fields' ? item.dataObject : item.datafield);\n this.hide();\n }\n\n renderSelectItem(item: any, index: number, isPlaceholder: boolean, isLast: boolean) {\n let selected = this.isSelected(item);\n return (\n <Tappable {...this.getTestPropsForAction('selectitem'+index)} onTap={this.onItemSelect.bind(this, item, isPlaceholder)} \n accessibilityProps={{...getAccessibilityProps(\n AccessibilityWidgetType.SELECT,\n {...this.props, expanded: this.state.isOpened}\n )}}>\n <View style={[this.styles.selectItem, isLast ? this.styles.lastSelectItem : null, selected ? this.styles.selectedItem : null ]}>\n <Text {...this.getTestPropsForLabel('label'+index)} style={[this.styles.selectItemText, {color: isPlaceholder ? this.styles.placeholderText.color : selected ? this.styles.selectedItemText.color : this.styles.selectItemText.color}]}>\n {isPlaceholder ? this.state.props.placeholder : (item.displayexp || item.displayfield)}\n </Text>\n <WmIcon id={this.getTestId('checkicon' + index)} iconclass='wi wi-check' styles={this.theme.mergeStyle(this.styles.checkIcon, {\n root: {\n opacity: !isPlaceholder && selected ? 1 : 0\n }\n })}></WmIcon>\n </View>\n </Tappable>\n );\n }\n\n updateDefaultQueryModel() {\n if (this.state.dataItems && this.state.dataItems.length && this.isDefaultValue) {\n const selectedItem = find(this.state.dataItems, (item) => item.selected);\n selectedItem && this.updateState({\n props: {\n displayValue: selectedItem.displayexp || selectedItem.displayfield || ''\n }\n } as WmSelectState);\n }\n }\n\n componentDidMount() {\n super.componentDidMount();\n this.updateDefaultQueryModel();\n }\n\n onDataItemsUpdate() {\n super.onDataItemsUpdate();\n this.updateDefaultQueryModel();\n }\n\n renderWidget(props: WmSelectProps) {\n return (\n <View>\n {this._background}\n {this.renderSelect()}\n {this.state.isOpened ? (\n <ModalConsumer>\n {(modalService: ModalService) => {\n const items = this.state.dataItems;\n modalService.showModal(\n this.prepareModalOptions(\n <ScrollView style={{width: '100%', maxHeight: ThemeVariables.INSTANCE.maxModalHeight}} contentContainerStyle={this.styles.dropDownContent}>\n {props.placeholder ?\n <View key={props.name + '_placeholder'} style={this.styles.placeholderText}>\n {this.renderSelectItem({}, 0, true, false)}\n </View>\n : null}\n {items && items.map((item: any, index: number) => (\n <View key={item.key}>\n {this.renderSelectItem(item, index, false, index === items.length - 1)}\n </View>\n ))}\n </ScrollView>,\n this.styles,\n modalService\n )\n );\n return null;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AAc,CAAE;QAACC,qBAAqB,EAAE,IAAI,CAAClG,MAAM,CAACmG;MAAgB,GACvItH,KAAK,CAACgB,WAAW,gBAChBvC,KAAA,CAAAkE,aAAA,CAAChE,IAAI;QAAC4I,GAAG,EAAEvH,KAAK,CAACW,IAAI,GAAG,cAAe;QAACiC,KAAK,EAAE,IAAI,CAACzB,MAAM,CAAC+C;MAAgB,GACxE,IAAI,CAACiB,gBAAgB,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,IAAI,EAAE,KAAK,CACrC,CAAC,GACL,IAAI,EACL4B,KAAK,IAAIA,KAAK,CAACS,GAAG,CAAC,CAAC7C,IAAS,EAAES,KAAa,kBAC3C3G,KAAA,CAAAkE,aAAA,CAAChE,IAAI;QAAC4I,GAAG,EAAE5C,IAAI,CAAC4C;MAAI,GACjB,IAAI,CAACpC,gBAAgB,CAACR,IAAI,EAAES,KAAK,EAAE,KAAK,EAAEA,KAAK,KAAK2B,KAAK,CAACL,MAAM,GAAG,CAAC,CACjE,CACP,CACO,CAAC,EACb,IAAI,CAACvF,MAAM,EACXC,YACF,CACF,CAAC;MACD,OAAO,IAAI;IACb,CACa,CAAC,GACd,IACA,CAAC;EAEX;AACF","ignoreList":[]}
@@ -53,7 +53,7 @@ export default class WmSwitch extends BaseDatasetComponent {
53
53
  }
54
54
  const displayText = item.displayexp || item.displayfield;
55
55
  const isSelected = this.state.props.datafield === 'All Fields' ? isEqual(props.datavalue, item.datafield) : this.state.props.datavalue === item.datafield;
56
- return /*#__PURE__*/React.createElement(Tappable, _extends({}, this.getTestPropsForAction(index + ''), {
56
+ return /*#__PURE__*/React.createElement(Tappable, _extends({}, this.getTestPropsForAction('button' + index), {
57
57
  accessibilityProps: {
58
58
  ...getAccessibilityProps(AccessibilityWidgetType.SWITCH, {
59
59
  selected: isSelected,
@@ -68,7 +68,7 @@ export default class WmSwitch extends BaseDatasetComponent {
68
68
  styles: this.styles.loadingIcon,
69
69
  iconclass: item.icon,
70
70
  caption: displayText
71
- }) : /*#__PURE__*/React.createElement(View, null, /*#__PURE__*/React.createElement(Text, _extends({}, this.getTestPropsForLabel('' + index), {
71
+ }) : /*#__PURE__*/React.createElement(View, null, /*#__PURE__*/React.createElement(Text, _extends({}, this.getTestPropsForLabel('label' + index), {
72
72
  style: [isSelected ? this.styles.selectedButtonText : this.styles.text, {
73
73
  color: isSelected ? this.styles.selectedButton.color : this.styles.button.color
74
74
  }]
@@ -1 +1 @@
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","accessibilityProps","SWITCH","selected","hint","disabled","bind","styles","button","selectedButton","iconclass","id","getTestId","loadingIcon","icon","caption","getTestPropsForLabel","style","selectedButtonText","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 accessibilityProps={{...getAccessibilityProps(AccessibilityWidgetType.SWITCH, {selected: isSelected, hint: props?.hint})}}\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={[ isSelected ? this.styles.selectedButtonText : 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,IAAI,CAACC,QAAQ,CAACJ,KAAK,CAAC;IACpB,IAAIA,KAAK,KAAKC,MAAM,EAAE;MACpB;IACF;IACA,IAAI,IAAI,CAACC,KAAK,CAACJ,KAAK,CAACO,SAAS,KAAK,YAAY,EAAE;MAC/C,MAAMC,YAAY,GAAGpB,IAAI,CAAC,IAAI,CAACgB,KAAK,CAACK,SAAS,EAAGC,IAAI,IAAKvB,OAAO,CAACuB,IAAI,CAACC,GAAG,EAAET,KAAK,CAAC,CAAC;MACnFA,KAAK,GAAGM,YAAY,IAAIA,YAAY,CAACI,UAAU;IACjD;IACA;IACA,IAAI,CAACC,WAAW,CAAC;MAACb,KAAK,EAAE;QAACK,SAAS,EAAEH;M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I,CAACX,MAAM,CAACY,IAAI,EACtE;QAACC,KAAK,EAAEvB,UAAU,GAAG,IAAI,CAACU,MAAM,CAACE,cAAc,CAACW,KAAK,GAAG,IAAI,CAACb,MAAM,CAACC,MAAM,CAACY;MAAM,CAAC;IAAE,IACrF1B,WACG,CACF,CACJ,CAAC;EAEf;EAEA2B,YAAYA,CAACrD,KAAoB,EAAE;IACjC,MAAMsD,KAAK,GAAG,IAAI,CAAClD,KAAK,CAACK,SAAS;IAClC,oBAAQzB,KAAA,CAAA8C,aAAA,CAAC5C,IAAI;MAAC+D,KAAK,EAAE,IAAI,CAACV,MAAM,CAACgB;IAAK,GACnCD,KAAK,IAAIA,KAAK,CAAC7B,MAAM,GACpB6B,KAAK,CAACE,GAAG,CAAC,CAAC9C,IAAS,EAAEa,KAAU,KAAK,IAAI,CAACD,WAAW,CAACZ,IAAI,EAAEa,KAAK,CAAC,CAAC,GAAE,IACnE,CAAC;EACT;AACF","ignoreList":[]}
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","accessibilityProps","SWITCH","selected","hint","disabled","bind","styles","button","selectedButton","iconclass","id","getTestId","loadingIcon","icon","caption","getTestPropsForLabel","style","selectedButtonText","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('button'+index)}\n accessibilityProps={{...getAccessibilityProps(AccessibilityWidgetType.SWITCH, {selected: isSelected, hint: props?.hint})}}\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('label' + index)}\n style={[ isSelected ? this.styles.selectedButtonText : 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,IAAI,CAACC,QAAQ,CAACJ,KAAK,CAAC;IACpB,IAAIA,KAAK,KAAKC,MAAM,EAAE;MACpB;IACF;IACA,IAAI,IAAI,CAACC,KA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AY;MAChCH,SAAS,EAAEhC,IAAI,CAACoC,IAAK;MACrBC,OAAO,EAAErB;IAAY,CAAS,CAAC,gBAC9B1C,KAAA,CAAA8C,aAAA,CAAC5C,IAAI,qBACJF,KAAA,CAAA8C,aAAA,CAAC7C,IAAI,EAAA8C,QAAA,KACC,IAAI,CAACiB,oBAAoB,CAAC,OAAO,GAAGzB,KAAK,CAAC;MAC9C0B,KAAK,EAAE,CAAEpB,UAAU,GAAI,IAAI,CAACU,MAAM,CAACW,kBAAkB,GAAG,IAAI,CAACX,MAAM,CAACY,IAAI,EACtE;QAACC,KAAK,EAAEvB,UAAU,GAAG,IAAI,CAACU,MAAM,CAACE,cAAc,CAACW,KAAK,GAAG,IAAI,CAACb,MAAM,CAACC,MAAM,CAACY;MAAM,CAAC;IAAE,IACrF1B,WACG,CACF,CACJ,CAAC;EAEf;EAEA2B,YAAYA,CAACrD,KAAoB,EAAE;IACjC,MAAMsD,KAAK,GAAG,IAAI,CAAClD,KAAK,CAACK,SAAS;IAClC,oBAAQzB,KAAA,CAAA8C,aAAA,CAAC5C,IAAI;MAAC+D,KAAK,EAAE,IAAI,CAACV,MAAM,CAACgB;IAAK,GACnCD,KAAK,IAAIA,KAAK,CAAC7B,MAAM,GACpB6B,KAAK,CAACE,GAAG,CAAC,CAAC9C,IAAS,EAAEa,KAAU,KAAK,IAAI,CAACD,WAAW,CAACZ,IAAI,EAAEa,KAAK,CAAC,CAAC,GAAE,IACnE,CAAC;EACT;AACF","ignoreList":[]}
@@ -7,6 +7,7 @@ import { WMTextInput } from '@wavemaker/app-rn-runtime/core/components/textinput
7
7
  import { BaseInputComponent, BaseInputState } from "@wavemaker/app-rn-runtime/components/input/baseinput/baseinput.component";
8
8
  import { isNull } from 'lodash';
9
9
  import { AccessibilityWidgetType, getAccessibilityProps } from '@wavemaker/app-rn-runtime/core/accessibility';
10
+ import { createSkeleton } from '@wavemaker/app-rn-runtime/components/basic/skeleton/skeleton.component';
10
11
  export class WmTextState extends BaseInputState {}
11
12
  export default class WmText extends BaseInputComponent {
12
13
  constructor(props) {
@@ -20,6 +21,26 @@ export default class WmText extends BaseInputComponent {
20
21
  classes.push(super.getStyleClassName());
21
22
  return classes.join(' ');
22
23
  }
24
+ renderSkeleton(props) {
25
+ let skeletonWidth, skeletonHeight;
26
+ if (this.props.skeletonwidth == "0") {
27
+ skeletonWidth = 0;
28
+ } else {
29
+ var _this$styles$root;
30
+ skeletonWidth = this.props.skeletonwidth || ((_this$styles$root = this.styles.root) === null || _this$styles$root === void 0 ? void 0 : _this$styles$root.width);
31
+ }
32
+ if (this.props.skeletonheight == "0") {
33
+ skeletonHeight = 0;
34
+ } else {
35
+ var _this$styles$root2;
36
+ skeletonHeight = this.props.skeletonheight || ((_this$styles$root2 = this.styles.root) === null || _this$styles$root2 === void 0 ? void 0 : _this$styles$root2.height);
37
+ }
38
+ return createSkeleton(this.theme, this.styles.skeleton, {
39
+ ...this.styles.root,
40
+ width: skeletonWidth,
41
+ height: skeletonHeight
42
+ });
43
+ }
23
44
  renderWidget(props) {
24
45
  var _this$state$textValue;
25
46
  let opts = {};