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

Sign up to get free protection for your applications and to get access to all the features.
Files changed (304) hide show
  1. app-rn-runtime/components/advanced/carousel/carousel.component.js +14 -9
  2. app-rn-runtime/components/advanced/carousel/carousel.component.js.map +1 -1
  3. app-rn-runtime/components/advanced/carousel/carousel.styles.js +6 -3
  4. app-rn-runtime/components/advanced/carousel/carousel.styles.js.map +1 -1
  5. app-rn-runtime/components/advanced/webview/webview.component.js +33 -14
  6. app-rn-runtime/components/advanced/webview/webview.component.js.map +1 -1
  7. app-rn-runtime/components/advanced/webview/webview.props.js +3 -1
  8. app-rn-runtime/components/advanced/webview/webview.props.js.map +1 -1
  9. app-rn-runtime/components/basic/anchor/anchor.component.js +22 -8
  10. app-rn-runtime/components/basic/anchor/anchor.component.js.map +1 -1
  11. app-rn-runtime/components/basic/anchor/anchor.props.js +7 -0
  12. app-rn-runtime/components/basic/anchor/anchor.props.js.map +1 -1
  13. app-rn-runtime/components/basic/anchor/anchor.styles.js +3 -1
  14. app-rn-runtime/components/basic/anchor/anchor.styles.js.map +1 -1
  15. app-rn-runtime/components/basic/animatedview.component.js +5 -3
  16. app-rn-runtime/components/basic/animatedview.component.js.map +1 -1
  17. app-rn-runtime/components/basic/button/button.component.js +41 -8
  18. app-rn-runtime/components/basic/button/button.component.js.map +1 -1
  19. app-rn-runtime/components/basic/button/button.props.js +7 -0
  20. app-rn-runtime/components/basic/button/button.props.js.map +1 -1
  21. app-rn-runtime/components/basic/button/button.styles.js +9 -10
  22. app-rn-runtime/components/basic/button/button.styles.js.map +1 -1
  23. app-rn-runtime/components/basic/buttongroup/buttongroup.styles.js +13 -5
  24. app-rn-runtime/components/basic/buttongroup/buttongroup.styles.js.map +1 -1
  25. app-rn-runtime/components/basic/icon/icon.component.js +64 -12
  26. app-rn-runtime/components/basic/icon/icon.component.js.map +1 -1
  27. app-rn-runtime/components/basic/icon/icon.props.js +7 -0
  28. app-rn-runtime/components/basic/icon/icon.props.js.map +1 -1
  29. app-rn-runtime/components/basic/icon/icon.styles.js +2 -1
  30. app-rn-runtime/components/basic/icon/icon.styles.js.map +1 -1
  31. app-rn-runtime/components/basic/label/label.component.js +34 -25
  32. app-rn-runtime/components/basic/label/label.component.js.map +1 -1
  33. app-rn-runtime/components/basic/label/label.props.js +4 -0
  34. app-rn-runtime/components/basic/label/label.props.js.map +1 -1
  35. app-rn-runtime/components/basic/label/label.styles.js +4 -5
  36. app-rn-runtime/components/basic/label/label.styles.js.map +1 -1
  37. app-rn-runtime/components/basic/message/message.component.js +3 -2
  38. app-rn-runtime/components/basic/message/message.component.js.map +1 -1
  39. app-rn-runtime/components/basic/message/message.props.js +3 -0
  40. app-rn-runtime/components/basic/message/message.props.js.map +1 -1
  41. app-rn-runtime/components/basic/message/message.styles.js +3 -1
  42. app-rn-runtime/components/basic/message/message.styles.js.map +1 -1
  43. app-rn-runtime/components/basic/picture/picture.component.js +4 -2
  44. app-rn-runtime/components/basic/picture/picture.component.js.map +1 -1
  45. app-rn-runtime/components/basic/picture/picture.props.js +3 -0
  46. app-rn-runtime/components/basic/picture/picture.props.js.map +1 -1
  47. app-rn-runtime/components/basic/picture/picture.styles.js +3 -1
  48. app-rn-runtime/components/basic/picture/picture.styles.js.map +1 -1
  49. app-rn-runtime/components/basic/progress-bar/progress-bar.component.js +3 -3
  50. app-rn-runtime/components/basic/progress-bar/progress-bar.component.js.map +1 -1
  51. app-rn-runtime/components/basic/progress-bar/progress-bar.props.js +2 -0
  52. app-rn-runtime/components/basic/progress-bar/progress-bar.props.js.map +1 -1
  53. app-rn-runtime/components/basic/progress-circle/progress-circle.component.js +3 -2
  54. app-rn-runtime/components/basic/progress-circle/progress-circle.component.js.map +1 -1
  55. app-rn-runtime/components/basic/progress-circle/progress-circle.props.js +2 -0
  56. app-rn-runtime/components/basic/progress-circle/progress-circle.props.js.map +1 -1
  57. app-rn-runtime/components/basic/search/search.component.js +2 -1
  58. app-rn-runtime/components/basic/search/search.component.js.map +1 -1
  59. app-rn-runtime/components/basic/search/search.props.js +3 -0
  60. app-rn-runtime/components/basic/search/search.props.js.map +1 -1
  61. app-rn-runtime/components/basic/search/search.styles.js +6 -5
  62. app-rn-runtime/components/basic/search/search.styles.js.map +1 -1
  63. app-rn-runtime/components/basic/skeleton/skeleton.component.js +0 -1
  64. app-rn-runtime/components/basic/skeleton/skeleton.component.js.map +1 -1
  65. app-rn-runtime/components/basic/video/video.component.js +4 -2
  66. app-rn-runtime/components/basic/video/video.component.js.map +1 -1
  67. app-rn-runtime/components/basic/video/video.props.js +3 -0
  68. app-rn-runtime/components/basic/video/video.props.js.map +1 -1
  69. app-rn-runtime/components/chart/area-chart/area-chart.component.js +34 -24
  70. app-rn-runtime/components/chart/area-chart/area-chart.component.js.map +1 -1
  71. app-rn-runtime/components/chart/bar-chart/bar-chart.component.js +29 -16
  72. app-rn-runtime/components/chart/bar-chart/bar-chart.component.js.map +1 -1
  73. app-rn-runtime/components/chart/bar-chart/bar-chart.props.js +0 -2
  74. app-rn-runtime/components/chart/bar-chart/bar-chart.props.js.map +1 -1
  75. app-rn-runtime/components/chart/basechart.component.js +33 -7
  76. app-rn-runtime/components/chart/basechart.component.js.map +1 -1
  77. app-rn-runtime/components/chart/basechart.props.js +7 -2
  78. app-rn-runtime/components/chart/basechart.props.js.map +1 -1
  79. app-rn-runtime/components/chart/basechart.styles.js +9 -2
  80. app-rn-runtime/components/chart/basechart.styles.js.map +1 -1
  81. app-rn-runtime/components/chart/bubble-chart/bubble-chart.component.js +4 -2
  82. app-rn-runtime/components/chart/bubble-chart/bubble-chart.component.js.map +1 -1
  83. app-rn-runtime/components/chart/line-chart/line-chart.component.js +27 -20
  84. app-rn-runtime/components/chart/line-chart/line-chart.component.js.map +1 -1
  85. app-rn-runtime/components/chart/line-chart/line-chart.props.js.map +1 -1
  86. app-rn-runtime/components/chart/pie-chart/pie-chart.component.js +7 -4
  87. app-rn-runtime/components/chart/pie-chart/pie-chart.component.js.map +1 -1
  88. app-rn-runtime/components/chart/stack-chart/stack-chart.component.js +33 -10
  89. app-rn-runtime/components/chart/stack-chart/stack-chart.component.js.map +1 -1
  90. app-rn-runtime/components/chart/stack-chart/stack-chart.props.js +1 -0
  91. app-rn-runtime/components/chart/stack-chart/stack-chart.props.js.map +1 -1
  92. app-rn-runtime/components/chart/staticdata.js +215 -0
  93. app-rn-runtime/components/chart/staticdata.js.map +1 -0
  94. app-rn-runtime/components/container/container.component.js +11 -2
  95. app-rn-runtime/components/container/container.component.js.map +1 -1
  96. app-rn-runtime/components/container/container.props.js +1 -0
  97. app-rn-runtime/components/container/container.props.js.map +1 -1
  98. app-rn-runtime/components/container/panel/panel.component.js +6 -2
  99. app-rn-runtime/components/container/panel/panel.component.js.map +1 -1
  100. app-rn-runtime/components/container/panel/panel.props.js +4 -0
  101. app-rn-runtime/components/container/panel/panel.props.js.map +1 -1
  102. app-rn-runtime/components/container/tabs/tabheader/tabheader.styles.js +1 -1
  103. app-rn-runtime/components/container/tabs/tabheader/tabheader.styles.js.map +1 -1
  104. app-rn-runtime/components/container/wizard/wizard.component.js +17 -14
  105. app-rn-runtime/components/container/wizard/wizard.component.js.map +1 -1
  106. app-rn-runtime/components/container/wizard/wizard.styles.js +19 -3
  107. app-rn-runtime/components/container/wizard/wizard.styles.js.map +1 -1
  108. app-rn-runtime/components/container/wizard/wizardstep/wizardstep.component.js +27 -2
  109. app-rn-runtime/components/container/wizard/wizardstep/wizardstep.component.js.map +1 -1
  110. app-rn-runtime/components/container/wizard/wizardstep/wizardstep.props.js +6 -0
  111. app-rn-runtime/components/container/wizard/wizardstep/wizardstep.props.js.map +1 -1
  112. app-rn-runtime/components/data/card/card.component.js +7 -3
  113. app-rn-runtime/components/data/card/card.component.js.map +1 -1
  114. app-rn-runtime/components/data/card/card.props.js +4 -0
  115. app-rn-runtime/components/data/card/card.props.js.map +1 -1
  116. app-rn-runtime/components/data/form/form-action/form-action.styles.js +2 -1
  117. app-rn-runtime/components/data/form/form-action/form-action.styles.js.map +1 -1
  118. app-rn-runtime/components/data/form/form-field/form-field.component.js +5 -1
  119. app-rn-runtime/components/data/form/form-field/form-field.component.js.map +1 -1
  120. app-rn-runtime/components/data/list/list.component.js +136 -25
  121. app-rn-runtime/components/data/list/list.component.js.map +1 -1
  122. app-rn-runtime/components/data/list/list.props.js +4 -1
  123. app-rn-runtime/components/data/list/list.props.js.map +1 -1
  124. app-rn-runtime/components/data/list/list.styles.js +9 -0
  125. app-rn-runtime/components/data/list/list.styles.js.map +1 -1
  126. app-rn-runtime/components/device/barcodescanner/barcodescanner.component.js +4 -1
  127. app-rn-runtime/components/device/barcodescanner/barcodescanner.component.js.map +1 -1
  128. app-rn-runtime/components/device/barcodescanner/barcodescanner.props.js +3 -0
  129. app-rn-runtime/components/device/barcodescanner/barcodescanner.props.js.map +1 -1
  130. app-rn-runtime/components/device/barcodescanner/barcodescanner.styles.js +13 -6
  131. app-rn-runtime/components/device/barcodescanner/barcodescanner.styles.js.map +1 -1
  132. app-rn-runtime/components/device/camera/camera.component.js +4 -1
  133. app-rn-runtime/components/device/camera/camera.component.js.map +1 -1
  134. app-rn-runtime/components/device/camera/camera.props.js +3 -0
  135. app-rn-runtime/components/device/camera/camera.props.js.map +1 -1
  136. app-rn-runtime/components/device/camera/camera.styles.js +12 -4
  137. app-rn-runtime/components/device/camera/camera.styles.js.map +1 -1
  138. app-rn-runtime/components/dialogs/alertdialog/alertdialog.component.js +4 -0
  139. app-rn-runtime/components/dialogs/alertdialog/alertdialog.component.js.map +1 -1
  140. app-rn-runtime/components/dialogs/alertdialog/alertdialog.props.js +4 -0
  141. app-rn-runtime/components/dialogs/alertdialog/alertdialog.props.js.map +1 -1
  142. app-rn-runtime/components/dialogs/alertdialog/alertdialog.styles.js +2 -1
  143. app-rn-runtime/components/dialogs/alertdialog/alertdialog.styles.js.map +1 -1
  144. app-rn-runtime/components/dialogs/confirmdialog/confirmdialog.component.js +4 -0
  145. app-rn-runtime/components/dialogs/confirmdialog/confirmdialog.component.js.map +1 -1
  146. app-rn-runtime/components/dialogs/confirmdialog/confirmdialog.props.js +4 -0
  147. app-rn-runtime/components/dialogs/confirmdialog/confirmdialog.props.js.map +1 -1
  148. app-rn-runtime/components/dialogs/dialog/dialog.component.js +7 -3
  149. app-rn-runtime/components/dialogs/dialog/dialog.component.js.map +1 -1
  150. app-rn-runtime/components/dialogs/dialog/dialog.props.js +4 -0
  151. app-rn-runtime/components/dialogs/dialog/dialog.props.js.map +1 -1
  152. app-rn-runtime/components/dialogs/dialog/dialog.styles.js +11 -2
  153. app-rn-runtime/components/dialogs/dialog/dialog.styles.js.map +1 -1
  154. app-rn-runtime/components/input/basedataset/basedataset.props.js +4 -0
  155. app-rn-runtime/components/input/basedataset/basedataset.props.js.map +1 -1
  156. app-rn-runtime/components/input/baseinput/baseinput.component.js +2 -2
  157. app-rn-runtime/components/input/baseinput/baseinput.component.js.map +1 -1
  158. app-rn-runtime/components/input/baseinput/baseinput.props.js +4 -0
  159. app-rn-runtime/components/input/baseinput/baseinput.props.js.map +1 -1
  160. app-rn-runtime/components/input/basenumber/basenumber.component.js +16 -10
  161. app-rn-runtime/components/input/basenumber/basenumber.component.js.map +1 -1
  162. app-rn-runtime/components/input/basenumber/basenumber.props.js +4 -0
  163. app-rn-runtime/components/input/basenumber/basenumber.props.js.map +1 -1
  164. app-rn-runtime/components/input/checkbox/checkbox.component.js +12 -5
  165. app-rn-runtime/components/input/checkbox/checkbox.component.js.map +1 -1
  166. app-rn-runtime/components/input/checkbox/checkbox.styles.js +35 -5
  167. app-rn-runtime/components/input/checkbox/checkbox.styles.js.map +1 -1
  168. app-rn-runtime/components/input/checkboxset/checkboxset.component.js +13 -6
  169. app-rn-runtime/components/input/checkboxset/checkboxset.component.js.map +1 -1
  170. app-rn-runtime/components/input/checkboxset/checkboxset.styles.js +39 -10
  171. app-rn-runtime/components/input/checkboxset/checkboxset.styles.js.map +1 -1
  172. app-rn-runtime/components/input/chips/chips.component.js +5 -1
  173. app-rn-runtime/components/input/chips/chips.component.js.map +1 -1
  174. app-rn-runtime/components/input/composite/composite.component.js +1 -1
  175. app-rn-runtime/components/input/composite/composite.component.js.map +1 -1
  176. app-rn-runtime/components/input/composite/composite.props.js +1 -1
  177. app-rn-runtime/components/input/composite/composite.props.js.map +1 -1
  178. app-rn-runtime/components/input/currency/currency.component.js +18 -3
  179. app-rn-runtime/components/input/currency/currency.component.js.map +1 -1
  180. app-rn-runtime/components/input/currency/currency.props.js +1 -0
  181. app-rn-runtime/components/input/currency/currency.props.js.map +1 -1
  182. app-rn-runtime/components/input/currency/currency.styles.js +19 -1
  183. app-rn-runtime/components/input/currency/currency.styles.js.map +1 -1
  184. app-rn-runtime/components/input/epoch/base-datetime.component.js +76 -10
  185. app-rn-runtime/components/input/epoch/base-datetime.component.js.map +1 -1
  186. app-rn-runtime/components/input/epoch/date/date.component.js +8 -0
  187. app-rn-runtime/components/input/epoch/date/date.component.js.map +1 -1
  188. app-rn-runtime/components/input/epoch/date/date.styles.js +16 -0
  189. app-rn-runtime/components/input/epoch/date/date.styles.js.map +1 -1
  190. app-rn-runtime/components/input/epoch/datetime/datetime.component.js +8 -0
  191. app-rn-runtime/components/input/epoch/datetime/datetime.component.js.map +1 -1
  192. app-rn-runtime/components/input/epoch/datetime/datetime.props.js +5 -0
  193. app-rn-runtime/components/input/epoch/datetime/datetime.props.js.map +1 -1
  194. app-rn-runtime/components/input/epoch/datetime/datetime.styles.js +49 -1
  195. app-rn-runtime/components/input/epoch/datetime/datetime.styles.js.map +1 -1
  196. app-rn-runtime/components/input/epoch/time/time.component.js +8 -0
  197. app-rn-runtime/components/input/epoch/time/time.component.js.map +1 -1
  198. app-rn-runtime/components/input/epoch/time/time.styles.js +16 -0
  199. app-rn-runtime/components/input/epoch/time/time.styles.js.map +1 -1
  200. app-rn-runtime/components/input/fileupload/fileupload.component.js +2 -0
  201. app-rn-runtime/components/input/fileupload/fileupload.component.js.map +1 -1
  202. app-rn-runtime/components/input/fileupload/fileupload.props.js +2 -0
  203. app-rn-runtime/components/input/fileupload/fileupload.props.js.map +1 -1
  204. app-rn-runtime/components/input/fileupload/fileupload.styles.js +1 -1
  205. app-rn-runtime/components/input/fileupload/fileupload.styles.js.map +1 -1
  206. app-rn-runtime/components/input/number/number.component.js +13 -2
  207. app-rn-runtime/components/input/number/number.component.js.map +1 -1
  208. app-rn-runtime/components/input/number/number.props.js +1 -0
  209. app-rn-runtime/components/input/number/number.props.js.map +1 -1
  210. app-rn-runtime/components/input/number/number.styles.js +17 -0
  211. app-rn-runtime/components/input/number/number.styles.js.map +1 -1
  212. app-rn-runtime/components/input/radioset/radioset.component.js +7 -2
  213. app-rn-runtime/components/input/radioset/radioset.component.js.map +1 -1
  214. app-rn-runtime/components/input/select/select.component.js +7 -3
  215. app-rn-runtime/components/input/select/select.component.js.map +1 -1
  216. app-rn-runtime/components/input/select/select.styles.js +5 -1
  217. app-rn-runtime/components/input/select/select.styles.js.map +1 -1
  218. app-rn-runtime/components/input/slider/slider.styles.js +3 -3
  219. app-rn-runtime/components/input/slider/slider.styles.js.map +1 -1
  220. app-rn-runtime/components/input/switch/switch.component.js +8 -1
  221. app-rn-runtime/components/input/switch/switch.component.js.map +1 -1
  222. app-rn-runtime/components/input/switch/switch.styles.js +10 -5
  223. app-rn-runtime/components/input/switch/switch.styles.js.map +1 -1
  224. app-rn-runtime/components/input/text/text.component.js +13 -1
  225. app-rn-runtime/components/input/text/text.component.js.map +1 -1
  226. app-rn-runtime/components/input/text/text.props.js +1 -0
  227. app-rn-runtime/components/input/text/text.props.js.map +1 -1
  228. app-rn-runtime/components/input/text/text.styles.js +17 -0
  229. app-rn-runtime/components/input/text/text.styles.js.map +1 -1
  230. app-rn-runtime/components/input/textarea/textarea.component.js +13 -1
  231. app-rn-runtime/components/input/textarea/textarea.component.js.map +1 -1
  232. app-rn-runtime/components/input/textarea/textarea.props.js +1 -0
  233. app-rn-runtime/components/input/textarea/textarea.props.js.map +1 -1
  234. app-rn-runtime/components/input/textarea/textarea.styles.js +17 -0
  235. app-rn-runtime/components/input/textarea/textarea.styles.js.map +1 -1
  236. app-rn-runtime/components/input/toggle/toggle.component.js +48 -5
  237. app-rn-runtime/components/input/toggle/toggle.component.js.map +1 -1
  238. app-rn-runtime/components/input/toggle/toggle.props.js +4 -0
  239. app-rn-runtime/components/input/toggle/toggle.props.js.map +1 -1
  240. app-rn-runtime/components/input/toggle/toggle.styles.js +5 -12
  241. app-rn-runtime/components/input/toggle/toggle.styles.js.map +1 -1
  242. app-rn-runtime/components/navigation/appnavbar/appnavbar.component.js +6 -1
  243. app-rn-runtime/components/navigation/appnavbar/appnavbar.component.js.map +1 -1
  244. app-rn-runtime/components/navigation/appnavbar/appnavbar.props.js +1 -0
  245. app-rn-runtime/components/navigation/appnavbar/appnavbar.props.js.map +1 -1
  246. app-rn-runtime/components/navigation/appnavbar/appnavbar.styles.js +11 -2
  247. app-rn-runtime/components/navigation/appnavbar/appnavbar.styles.js.map +1 -1
  248. app-rn-runtime/components/navigation/basenav/basenav.component.js +1 -2
  249. app-rn-runtime/components/navigation/basenav/basenav.component.js.map +1 -1
  250. app-rn-runtime/components/navigation/menu/menu.styles.js +8 -5
  251. app-rn-runtime/components/navigation/menu/menu.styles.js.map +1 -1
  252. app-rn-runtime/components/navigation/navitem/navitem.component.js +8 -5
  253. app-rn-runtime/components/navigation/navitem/navitem.component.js.map +1 -1
  254. app-rn-runtime/components/navigation/navitem/navitem.props.js +3 -0
  255. app-rn-runtime/components/navigation/navitem/navitem.props.js.map +1 -1
  256. app-rn-runtime/components/navigation/popover/popover.component.js +10 -3
  257. app-rn-runtime/components/navigation/popover/popover.component.js.map +1 -1
  258. app-rn-runtime/components/navigation/popover/popover.props.js +7 -0
  259. app-rn-runtime/components/navigation/popover/popover.props.js.map +1 -1
  260. app-rn-runtime/components/navigation/popover/popover.styles.js +8 -2
  261. app-rn-runtime/components/navigation/popover/popover.styles.js.map +1 -1
  262. app-rn-runtime/components/page/page-content/page-content.component.js +7 -1
  263. app-rn-runtime/components/page/page-content/page-content.component.js.map +1 -1
  264. app-rn-runtime/components/page/tabbar/curve.js +84 -0
  265. app-rn-runtime/components/page/tabbar/curve.js.map +1 -0
  266. app-rn-runtime/components/page/tabbar/tabbar.component.js +44 -10
  267. app-rn-runtime/components/page/tabbar/tabbar.component.js.map +1 -1
  268. app-rn-runtime/components/page/tabbar/tabbar.styles.js +82 -15
  269. app-rn-runtime/components/page/tabbar/tabbar.styles.js.map +1 -1
  270. app-rn-runtime/core/accessibility.js +149 -0
  271. app-rn-runtime/core/accessibility.js.map +1 -0
  272. app-rn-runtime/core/base.component.js +21 -3
  273. app-rn-runtime/core/base.component.js.map +1 -1
  274. app-rn-runtime/core/components/floatinglabel.component.js +45 -0
  275. app-rn-runtime/core/components/floatinglabel.component.js.map +1 -0
  276. app-rn-runtime/core/components/textinput.component.js +25 -2
  277. app-rn-runtime/core/components/textinput.component.js.map +1 -1
  278. app-rn-runtime/core/event-notifier.js +22 -1
  279. app-rn-runtime/core/event-notifier.js.map +1 -1
  280. app-rn-runtime/core/tappable.component.js +37 -10
  281. app-rn-runtime/core/tappable.component.js.map +1 -1
  282. app-rn-runtime/core/utils.js +11 -0
  283. app-rn-runtime/core/utils.js.map +1 -1
  284. app-rn-runtime/gestures/swipe.animation.js +34 -1
  285. app-rn-runtime/gestures/swipe.animation.js.map +1 -1
  286. app-rn-runtime/package.json +8 -3
  287. app-rn-runtime/runtime/App.js +12 -7
  288. app-rn-runtime/runtime/App.js.map +1 -1
  289. app-rn-runtime/runtime/base-page.component.js +1 -1
  290. app-rn-runtime/runtime/base-page.component.js.map +1 -1
  291. app-rn-runtime/runtime/services/app-security.service.js +2 -1
  292. app-rn-runtime/runtime/services/app-security.service.js.map +1 -1
  293. app-rn-runtime/runtime/services/webprocess.service.js +0 -1
  294. app-rn-runtime/runtime/services/webprocess.service.js.map +1 -1
  295. app-rn-runtime/styles/background.component.js +1 -1
  296. app-rn-runtime/styles/background.component.js.map +1 -1
  297. app-rn-runtime/styles/theme.js +43 -0
  298. app-rn-runtime/styles/theme.js.map +1 -1
  299. app-rn-runtime/styles/theme.variables.js +30 -6
  300. app-rn-runtime/styles/theme.variables.js.map +1 -1
  301. app-rn-runtime/variables/model-variable.js +2 -1
  302. app-rn-runtime/variables/model-variable.js.map +1 -1
  303. app-rn-runtime/variables/service-variable.js +14 -6
  304. app-rn-runtime/variables/service-variable.js.map +1 -1
@@ -1 +1 @@
1
- {"version":3,"names":["React","View","BaseComponent","BaseComponentState","WmLabel","WmMenu","WmIcon","Tappable","WmPicture","WmCardProps","DEFAULT_CLASS","WmCardState","WmCard","constructor","props","renderHeader","createElement","style","flexDirection","iconclass","title","subheading","actions","styles","heading","cardIcon","flex","caption","dataset","itemlabel","itemlink","itemicon","itembadge","isactive","itemchildren","picturesource","theme","mergeStyle","root","height","imageheight","picture","renderWidget","_background","_extends","getTestPropsForAction","target","width","children"],"sources":["card.component.tsx"],"sourcesContent":["import React from 'react';\nimport { View } from 'react-native';\nimport { BaseComponent, BaseComponentState } from '@wavemaker/app-rn-runtime/core/base.component';\nimport WmLabel from '@wavemaker/app-rn-runtime/components/basic/label/label.component';\nimport WmMenu from '@wavemaker/app-rn-runtime/components/navigation/menu/menu.component';\nimport WmIcon from '@wavemaker/app-rn-runtime/components/basic/icon/icon.component';\nimport { Tappable } from '@wavemaker/app-rn-runtime/core/tappable.component';\nimport WmPicture from '@wavemaker/app-rn-runtime/components/basic/picture/picture.component';\n\n\nimport WmCardProps from './card.props';\nimport { DEFAULT_CLASS, WmCardStyles } from './card.styles';\n\nexport class WmCardState extends BaseComponentState<WmCardProps> {}\n\nexport default class WmCard extends BaseComponent<WmCardProps, WmCardState, WmCardStyles> {\n\n constructor(props: WmCardProps) {\n super(props, DEFAULT_CLASS, new WmCardProps());\n }\n\n renderHeader(props: WmCardProps) {\n return (\n <View style={{flexDirection: 'row'}}>\n {(props.iconclass || props.title || props.subheading || props.actions) ?\n (<View style={this.styles.heading}>\n <WmIcon styles={this.styles.cardIcon} iconclass={props.iconclass}></WmIcon>\n <View style={{flex: 1}}>\n <WmLabel styles={this.styles.title} caption={props.title}></WmLabel>\n <WmLabel styles={this.styles.subheading} caption={props.subheading}></WmLabel>\n </View>\n <WmMenu\n caption=\"\"\n iconclass=\"wm-sl-l sl-more-menu-vertical\"\n dataset={props.actions}\n itemlabel={props.itemlabel}\n itemlink={props.itemlink}\n itemicon={props.itemicon}\n itembadge={props.itembadge}\n isactive={props.isactive}\n itemchildren={props.itemchildren}></WmMenu>\n </View>) : null}\n {props.picturesource &&\n (<WmPicture\n picturesource={props.picturesource}\n styles={this.theme.mergeStyle({root : {height: props.imageheight}}, this.styles.picture)}></WmPicture>\n )}\n </View>);\n }\n\n renderWidget(props: WmCardProps) {\n return (\n <View style={this.styles.root}>\n {this._background}\n <Tappable {...this.getTestPropsForAction()} target={this} styles={{width: '100%', height: this.styles.root.height ? '100%' : null}}>\n {this.renderHeader(props)}\n {props.children}\n </Tappable>\n </View>);\n }\n}\n"],"mappings":";AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,IAAI,QAAQ,cAAc;AACnC,SAASC,aAAa,EAAEC,kBAAkB,QAAQ,+CAA+C;AACjG,OAAOC,OAAO,MAAM,kEAAkE;AACtF,OAAOC,MAAM,MAAM,qEAAqE;AACxF,OAAOC,MAAM,MAAM,gEAAgE;AACnF,SAASC,QAAQ,QAAQ,mDAAmD;AAC5E,OAAOC,SAAS,MAAM,sEAAsE;AAG5F,OAAOC,WAAW,MAAM,cAAc;AACtC,SAASC,aAAa,QAAsB,eAAe;AAE3D,OAAO,MAAMC,WAAW,SAASR,kBAAkB,CAAc;AAEjE,eAAe,MAAMS,MAAM,SAASV,aAAa,CAAyC;EAExFW,WAAWA,CAACC,KAAkB,EAAE;IAC9B,KAAK,CAACA,KAAK,EAAEJ,aAAa,EAAE,IAAID,WAAW,CAAC,CAAC,CAAC;EAChD;EAEAM,YAAYA,CAACD,KAAkB,EAAE;IAC/B,oBACEd,KAAA,CAAA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C,KAAA,CAAAgB,aAAA,CAACR,SAAS;MACT2B,aAAa,EAAErB,KAAK,CAACqB,aAAc;MACnCZ,MAAM,EAAE,IAAI,CAACa,KAAK,CAACC,UAAU,CAAC;QAACC,IAAI,EAAG;UAACC,MAAM,EAAEzB,KAAK,CAAC0B;QAAW;MAAC,CAAC,EAAE,IAAI,CAACjB,MAAM,CAACkB,OAAO;IAAE,CAAY,CAErG,CAAC;EACX;EAEAC,YAAYA,CAAC5B,KAAkB,EAAE;IAC/B,oBACEd,KAAA,CAAAgB,aAAA,CAACf,IAAI;MAACgB,KAAK,EAAE,IAAI,CAACM,MAAM,CAACe;IAAK,GAC3B,IAAI,CAACK,WAAW,eACjB3C,KAAA,CAAAgB,aAAA,CAACT,QAAQ,EAAAqC,QAAA,KAAK,IAAI,CAACC,qBAAqB,CAAC,CAAC;MAAEC,MAAM,EAAE,IAAK;MAACvB,MAAM,EAAE;QAACwB,KAAK,EAAE,MAAM;QAAER,MAAM,EAAE,IAAI,CAAChB,MAAM,CAACe,IAAI,CAACC,MAAM,GAAG,MAAM,GAAG;MAAI;IAAE,IAC9H,IAAI,CAACxB,YAAY,CAACD,KAAK,CAAC,EACxBA,KAAK,CAACkC,QACD,CACN,CAAC;EACX;AACF"}
1
+ {"version":3,"names":["React","View","BaseComponent","BaseComponentState","WmLabel","WmMenu","WmIcon","Tappable","WmPicture","WmCardProps","DEFAULT_CLASS","WmCardState","WmCard","constructor","props","renderHeader","createElement","style","flexDirection","iconclass","title","subheading","actions","styles","heading","iconurl","cardIcon","iconheight","iconmargin","iconwidth","flex","caption","dataset","itemlabel","itemlink","itemicon","itembadge","isactive","itemchildren","picturesource","theme","mergeStyle","root","height","imageheight","picture","renderWidget","_background","_extends","getTestPropsForAction","target","width","children"],"sources":["card.component.tsx"],"sourcesContent":["import React from 'react';\nimport { View } from 'react-native';\nimport { BaseComponent, BaseComponentState } from '@wavemaker/app-rn-runtime/core/base.component';\nimport WmLabel from '@wavemaker/app-rn-runtime/components/basic/label/label.component';\nimport WmMenu from '@wavemaker/app-rn-runtime/components/navigation/menu/menu.component';\nimport WmIcon from '@wavemaker/app-rn-runtime/components/basic/icon/icon.component';\nimport { Tappable } from '@wavemaker/app-rn-runtime/core/tappable.component';\nimport WmPicture from '@wavemaker/app-rn-runtime/components/basic/picture/picture.component';\n\n\nimport WmCardProps from './card.props';\nimport { DEFAULT_CLASS, WmCardStyles } from './card.styles';\n\nexport class WmCardState extends BaseComponentState<WmCardProps> {}\n\nexport default class WmCard extends BaseComponent<WmCardProps, WmCardState, WmCardStyles> {\n\n constructor(props: WmCardProps) {\n super(props, DEFAULT_CLASS, new WmCardProps());\n }\n\n renderHeader(props: WmCardProps) {\n return (\n <View style={{flexDirection: 'row'}}>\n {(props.iconclass || props.title || props.subheading || props.actions) ?\n (<View style={this.styles.heading}>\n {props.iconclass || props.iconurl ? \n <WmIcon styles={this.styles.cardIcon}\n iconclass={props.iconclass}\n iconurl={props.iconurl}\n iconheight={props.iconheight}\n iconmargin={props.iconmargin}\n iconwidth={props.iconwidth}\n /> : null} \n <View style={{flex: 1}}>\n <WmLabel styles={this.styles.title} caption={props.title}></WmLabel>\n <WmLabel styles={this.styles.subheading} caption={props.subheading}></WmLabel>\n </View>\n <WmMenu\n caption=\"\"\n iconclass=\"wm-sl-l sl-more-menu-vertical\"\n dataset={props.actions}\n itemlabel={props.itemlabel}\n itemlink={props.itemlink}\n itemicon={props.itemicon}\n itembadge={props.itembadge}\n isactive={props.isactive}\n itemchildren={props.itemchildren}></WmMenu>\n </View>) : null}\n {props.picturesource &&\n (<WmPicture\n picturesource={props.picturesource}\n styles={this.theme.mergeStyle({root : {height: props.imageheight}}, this.styles.picture)}></WmPicture>\n )}\n </View>);\n }\n\n renderWidget(props: WmCardProps) {\n return (\n <View style={this.styles.root}>\n {this._background}\n <Tappable {...this.getTestPropsForAction()} target={this} styles={{width: '100%', height: this.styles.root.height ? '100%' : null}}>\n {this.renderHeader(props)}\n {props.children}\n </Tappable>\n </View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E,IAAI,CAACM,MAAM,CAACmB;IAAK,GAC3B,IAAI,CAACK,WAAW,eACjB/C,KAAA,CAAAgB,aAAA,CAACT,QAAQ,EAAAyC,QAAA,KAAK,IAAI,CAACC,qBAAqB,CAAC,CAAC;MAAEC,MAAM,EAAE,IAAK;MAAC3B,MAAM,EAAE;QAAC4B,KAAK,EAAE,MAAM;QAAER,MAAM,EAAE,IAAI,CAACpB,MAAM,CAACmB,IAAI,CAACC,MAAM,GAAG,MAAM,GAAG;MAAI;IAAE,IAC9H,IAAI,CAAC5B,YAAY,CAACD,KAAK,CAAC,EACxBA,KAAK,CAACsC,QACD,CACN,CAAC;EACX;AACF"}
@@ -18,6 +18,10 @@ export default class WmCardProps extends BaseProps {
18
18
  _defineProperty(this, "picturesource", null);
19
19
  _defineProperty(this, "subheading", null);
20
20
  _defineProperty(this, "title", null);
21
+ _defineProperty(this, "iconurl", null);
22
+ _defineProperty(this, "iconheight", null);
23
+ _defineProperty(this, "iconwidth", null);
24
+ _defineProperty(this, "iconmargin", null);
21
25
  }
22
26
  }
23
27
  //# sourceMappingURL=card.props.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["BaseProps","WmCardProps","constructor","arguments","_defineProperty"],"sources":["card.props.ts"],"sourcesContent":["import { BaseProps } from '@wavemaker/app-rn-runtime/core/base.component';\n\nexport default class WmCardProps extends BaseProps {\n children? = null as any;\n actions?: string = null as any;\n itemlabel?: string = null as any;\n itemlink?: string = null as any;\n itemicon?: string = null as any;\n itembadge?: string = null as any;\n isactive?: string = null as any;\n itemchildren?: string = null as any;\n iconclass?: string = null as any;\n imageheight?: number = 200;\n picturesource?: string = null as any;\n subheading?: string = null as any;\n title?: string = null as any;\n}"],"mappings":";;;AAAA,SAASA,SAAS,QAAQ,+CAA+C;AAEzE,eAAe,MAAMC,WAAW,SAASD,SAAS,CAAC;EAAAE,YAAA;IAAA,SAAAC,SAAA;IAAAC,eAAA,mBACrC,IAAI;IAAAA,eAAA,kBACG,IAAI;IAAAA,eAAA,oBACF,IAAI;IAAAA,eAAA,mBACL,IAAI;IAAAA,eAAA,mBACJ,IAAI;IAAAA,eAAA,oBACH,IAAI;IAAAA,eAAA,mBACL,IAAI;IAAAA,eAAA,uBACA,IAAI;IAAAA,eAAA,oBACP,IAAI;IAAAA,eAAA,sBACF,GAAG;IAAAA,eAAA,wBACD,IAAI;IAAAA,eAAA,qBACP,IAAI;IAAAA,eAAA,gBACT,IAAI;EAAA;AACvB"}
1
+ {"version":3,"names":["BaseProps","WmCardProps","constructor","arguments","_defineProperty"],"sources":["card.props.ts"],"sourcesContent":["import { BaseProps } from '@wavemaker/app-rn-runtime/core/base.component';\n\nexport default class WmCardProps extends BaseProps {\n children? = null as any;\n actions?: string = null as any;\n itemlabel?: string = null as any;\n itemlink?: string = null as any;\n itemicon?: string = null as any;\n itembadge?: string = null as any;\n isactive?: string = null as any;\n itemchildren?: string = null as any;\n iconclass?: string = null as any;\n imageheight?: number = 200;\n picturesource?: string = null as any;\n subheading?: string = null as any;\n title?: string = null as any;\n iconurl?: string = null as any;\n iconheight?: number = null as any;\n iconwidth?: number = null as any;\n iconmargin?: number = null as any;\n}"],"mappings":";;;AAAA,SAASA,SAAS,QAAQ,+CAA+C;AAEzE,eAAe,MAAMC,WAAW,SAASD,SAAS,CAAC;EAAAE,YAAA;IAAA,SAAAC,SAAA;IAAAC,eAAA,mBACrC,IAAI;IAAAA,eAAA,kBACG,IAAI;IAAAA,eAAA,oBACF,IAAI;IAAAA,eAAA,mBACL,IAAI;IAAAA,eAAA,mBACJ,IAAI;IAAAA,eAAA,oBACH,IAAI;IAAAA,eAAA,mBACL,IAAI;IAAAA,eAAA,uBACA,IAAI;IAAAA,eAAA,oBACP,IAAI;IAAAA,eAAA,sBACF,GAAG;IAAAA,eAAA,wBACD,IAAI;IAAAA,eAAA,qBACP,IAAI;IAAAA,eAAA,gBACT,IAAI;IAAAA,eAAA,kBACF,IAAI;IAAAA,eAAA,qBACD,IAAI;IAAAA,eAAA,oBACL,IAAI;IAAAA,eAAA,qBACH,IAAI;EAAA;AAC5B"}
@@ -8,7 +8,8 @@ BASE_THEME.registerStyle((themeVariables, addStyle) => {
8
8
  marginLeft: 4,
9
9
  marginRight: 4,
10
10
  marginBottom: 0,
11
- flex: 1
11
+ flex: 1,
12
+ rippleColor: themeVariables.rippleColor
12
13
  },
13
14
  text: {},
14
15
  icon: {
@@ -1 +1 @@
1
- {"version":3,"names":["BASE_THEME","defineStyles","DEFAULT_CLASS","registerStyle","themeVariables","addStyle","defaultStyles","root","marginTop","marginLeft","marginRight","marginBottom","flex","text","icon","fontSize","skeleton","width","height","opacity"],"sources":["form-action.styles.ts"],"sourcesContent":["import BASE_THEME from '@wavemaker/app-rn-runtime/styles/theme';\nimport { BaseStyles, defineStyles } from '@wavemaker/app-rn-runtime/core/base.component';\nimport { WmButtonStyles } from '@wavemaker/app-rn-runtime/components/basic/button/button.styles';\nimport { WmSkeletonStyles } from '@wavemaker/app-rn-runtime/components/basic/skeleton/skeleton.styles';\n\nexport type WmFormActionStyles = WmButtonStyles & {\n skeleton: WmSkeletonStyles\n};\n\nexport const DEFAULT_CLASS = 'app-form-action';\nBASE_THEME.registerStyle((themeVariables, addStyle) => {\n const defaultStyles: WmFormActionStyles = defineStyles({\n root: {\n marginTop: 0,\n marginLeft: 4,\n marginRight: 4,\n marginBottom: 0,\n flex: 1\n },\n text: {},\n icon : {\n icon: {\n fontSize: 20\n }\n },\n skeleton: {\n root: {\n width: 96,\n height: 48\n }\n } as WmSkeletonStyles\n } as WmFormActionStyles);\n addStyle(DEFAULT_CLASS + '-disabled', '', {\n root : {\n opacity: 0.5\n }\n });\n\n addStyle(DEFAULT_CLASS, '', defaultStyles);\n});\n"],"mappings":"AAAA,OAAOA,UAAU,MAAM,wCAAwC;AAC/D,SAAqBC,YAAY,QAAQ,+CAA+C;AAQxF,OAAO,MAAMC,aAAa,GAAG,iBAAiB;AAC9CF,UAAU,CAACG,aAAa,CAAC,CAACC,cAAc,EAAEC,QAAQ,KAAK;EACrD,MAAMC,aAAiC,GAAGL,YAAY,CAAC;IACrDM,IAAI,EAAE;MACJC,SAAS,EAAE,CAAC;MACZC,UAAU,EAAE,CAAC;MACbC,WAAW,EAAE,CAAC;MACdC,YAAY,EAAE,CAAC;MACfC,IAAI,EAAE;IACR,CAAC;IACDC,IAAI,EAAE,CAAC,CAAC;IACRC,IAAI,EAAG;MACLA,IAAI,EAAE;QACJC,QAAQ,EAAE;MACZ;IACF,CAAC;IACDC,QAAQ,EAAE;MACRT,IAAI,EAAE;QACJU,KAAK,EAAE,EAAE;QACTC,MAAM,EAAE;MACV;IACF;EACF,CAAuB,CAAC;EACxBb,QAAQ,CAACH,aAAa,GAAG,WAAW,EAAE,EAAE,EAAE;IACxCK,IAAI,EAAG;MACLY,OAAO,EAAE;IACX;EACF,CAAC,CAAC;EAEFd,QAAQ,CAACH,aAAa,EAAE,EAAE,EAAEI,aAAa,CAAC;AAC5C,CAAC,CAAC"}
1
+ {"version":3,"names":["BASE_THEME","defineStyles","DEFAULT_CLASS","registerStyle","themeVariables","addStyle","defaultStyles","root","marginTop","marginLeft","marginRight","marginBottom","flex","rippleColor","text","icon","fontSize","skeleton","width","height","opacity"],"sources":["form-action.styles.ts"],"sourcesContent":["import BASE_THEME from '@wavemaker/app-rn-runtime/styles/theme';\nimport { BaseStyles, defineStyles } from '@wavemaker/app-rn-runtime/core/base.component';\nimport { WmButtonStyles } from '@wavemaker/app-rn-runtime/components/basic/button/button.styles';\nimport { WmSkeletonStyles } from '@wavemaker/app-rn-runtime/components/basic/skeleton/skeleton.styles';\n\nexport type WmFormActionStyles = WmButtonStyles & {\n skeleton: WmSkeletonStyles\n};\n\nexport const DEFAULT_CLASS = 'app-form-action';\nBASE_THEME.registerStyle((themeVariables, addStyle) => {\n const defaultStyles: WmFormActionStyles = defineStyles({\n root: {\n marginTop: 0,\n marginLeft: 4,\n marginRight: 4,\n marginBottom: 0,\n flex: 1,\n rippleColor: themeVariables.rippleColor\n },\n text: {},\n icon : {\n icon: {\n fontSize: 20\n }\n },\n skeleton: {\n root: {\n width: 96,\n height: 48\n }\n } as WmSkeletonStyles\n } as WmFormActionStyles);\n addStyle(DEFAULT_CLASS + '-disabled', '', {\n root : {\n opacity: 0.5\n }\n });\n\n addStyle(DEFAULT_CLASS, '', defaultStyles);\n});\n"],"mappings":"AAAA,OAAOA,UAAU,MAAM,wCAAwC;AAC/D,SAAqBC,YAAY,QAAQ,+CAA+C;AAQxF,OAAO,MAAMC,aAAa,GAAG,iBAAiB;AAC9CF,UAAU,CAACG,aAAa,CAAC,CAACC,cAAc,EAAEC,QAAQ,KAAK;EACrD,MAAMC,aAAiC,GAAGL,YAAY,CAAC;IACrDM,IAAI,EAAE;MACJC,SAAS,EAAE,CAAC;MACZC,UAAU,EAAE,CAAC;MACbC,WAAW,EAAE,CAAC;MACdC,YAAY,EAAE,CAAC;MACfC,IAAI,EAAE,CAAC;MACPC,WAAW,EAAET,cAAc,CAACS;IAC9B,CAAC;IACDC,IAAI,EAAE,CAAC,CAAC;IACRC,IAAI,EAAG;MACLA,IAAI,EAAE;QACJC,QAAQ,EAAE;MACZ;IACF,CAAC;IACDC,QAAQ,EAAE;MACRV,IAAI,EAAE;QACJW,KAAK,EAAE,EAAE;QACTC,MAAM,EAAE;MACV;IACF;EACF,CAAuB,CAAC;EACxBd,QAAQ,CAACH,aAAa,GAAG,WAAW,EAAE,EAAE,EAAE;IACxCK,IAAI,EAAG;MACLa,OAAO,EAAE;IACX;EACF,CAAC,CAAC;EAEFf,QAAQ,CAACH,aAAa,EAAE,EAAE,EAAEI,aAAa,CAAC;AAC5C,CAAC,CAAC"}
@@ -27,7 +27,6 @@ export default class WmFormField extends BaseComponent {
27
27
  }
28
28
  onFieldChangeEvt(name, $new, $old, isDefault) {
29
29
  this.notifyChanges();
30
- this.validateFormField();
31
30
  if (!isEqual($old, $new)) {
32
31
  this.updateState({
33
32
  props: {
@@ -35,6 +34,7 @@ export default class WmFormField extends BaseComponent {
35
34
  }
36
35
  }, () => {
37
36
  !isDefault && this.invokeEventCallback('onChange', [undefined, this, $new, $old]);
37
+ this.validateFormField();
38
38
  });
39
39
  if (this.form) {
40
40
  this.form.updateDataOutput.call(this.form, get(this.props, 'formKey', this.props.name), $new);
@@ -206,10 +206,14 @@ export default class WmFormField extends BaseComponent {
206
206
  });
207
207
  this._asyncValidatorFn && this._asyncValidatorFn();
208
208
  }
209
+ get value() {
210
+ return this.state.props.datavalue;
211
+ }
209
212
  renderWidget(props) {
210
213
  var childrenWithProps = React.Children.map(props.renderFormFields(this.proxy).props.children, child => {
211
214
  return /*#__PURE__*/React.cloneElement(child, {
212
215
  datavalue: props.datavalue,
216
+ value: this.value,
213
217
  isValid: this.state.isValid,
214
218
  invokeEvent: this.invokeEventCallback.bind(this),
215
219
  triggerValidation: this.validateFormField.bind(this),
@@ -1 +1 @@
1
- {"version":3,"names":["React","Text","View","BaseComponent","BaseComponentState","isEqual","get","find","cloneDeep","forEach","keys","WmFormFieldProps","DEFAULT_CLASS","PERFORMANCE_LOGGER","WmFormFieldState","constructor","arguments","_defineProperty","WmFormField","props","onFieldChangeEvt","name","$new","$old","isDefault","notifyChanges","validateFormField","updateState","datavalue","invokeEventCallback","undefined","form","updateDataOutput","call","observeOn","fields","field","formfield","formFields","f","proxy","notifyForFields","push","formwidget","validate","setTimeout","getPromiseList","validators","arr","fn","promise","Function","bind","Promise","setAsyncValidators","_asyncValidatorFn","all","then","err","validationMsg","hasOwnProperty","messageKeys","toString","setInvalidState","setValidators","_cloneValidators","_syncValidators","obj","index","key","defaultValidatorMessages","value","propsObj","updateFormWidgetDataset","res","displayField","dataset","data","datafield","displayfield","state","msg","isValid","validationmessage","onPropertyChange","debug","applyDefaultValue","setPrimaryKey","setReadOnlyState","updateMode","_this$formwidget","readonly","_this$formwidget2","_this$_syncValidators","_this$formwidget3","errorType","errormsg","errorMessage","renderWidget","childrenWithProps","Children","map","renderFormFields","children","child","cloneElement","invokeEvent","triggerValidation","onFieldChange","formRef","createElement","style","styles","root","_background","_extends","getTestPropsForLabel","errorMsg"],"sources":["form-field.component.tsx"],"sourcesContent":["import React from 'react';\nimport {Text, View} from 'react-native';\nimport { BaseComponent, BaseComponentState } from '@wavemaker/app-rn-runtime/core/base.component';\nimport { widgetsWithUndefinedValue } from '@wavemaker/app-rn-runtime/core/utils';\nimport { isEqual, get, find, cloneDeep, forEach, keys } from 'lodash';\n\nimport WmFormFieldProps from './form-field.props';\nimport { DEFAULT_CLASS, WmFormFieldStyles } from './form-field.styles';\nimport {PERFORMANCE_LOGGER} from \"@wavemaker/app-rn-runtime/core/logger\";\n\nexport class WmFormFieldState extends BaseComponentState<WmFormFieldProps> {\n isValid = true;\n}\n\nexport default class WmFormField extends BaseComponent<WmFormFieldProps, WmFormFieldState, WmFormFieldStyles> {\n public form: any;\n public formwidget: any;\n public _syncValidators: any;\n public defaultValidatorMessages: any = [];\n private notifyForFields: any = [];\n private _asyncValidatorFn: any;\n constructor(props: WmFormFieldProps) {\n super(props, DEFAULT_CLASS, new WmFormFieldProps(), new WmFormFieldState());\n }\n\n onFieldChangeEvt(name: string, $new: any, $old: any, isDefault: boolean) {\n this.notifyChanges();\n this.validateFormField();\n if (!isEqual($old, $new)) {\n this.updateState({ props: { datavalue: $new }} as WmFormFieldState, () => {\n !isDefault && this.invokeEventCallback('onChange', [undefined, this, $new, $old]);\n });\n if (this.form) {\n this.form.updateDataOutput.call(this.form, get(this.props, 'formKey', this.props.name), $new);\n }\n }\n }\n\n // Registers observer of validation fields\n observeOn(fields: any) {\n forEach(fields, (field) => {\n const formfield = find(this.form.formFields, (f) => f.proxy.name === field);\n if (formfield) {\n formfield.notifyForFields.push(this);\n }\n });\n }\n\n // Notifies changes to observing validation fields\n notifyChanges() {\n forEach(this.notifyForFields, (field) => {\n field.formwidget.validate(field.formwidget.datavalue);\n setTimeout(() => field.validateFormField());\n });\n }\n\n getPromiseList(validators: any) {\n const arr: any = [];\n forEach(validators, (fn) => {\n let promise = fn;\n if (fn instanceof Function && fn.bind) {\n promise = fn(this.formwidget.proxy, this.form);\n }\n if (promise instanceof Promise) {\n arr.push(promise);\n }\n });\n return arr;\n }\n\n // this method sets the asyncValidation on the form field. Assigns validationmessages from the returned response\n setAsyncValidators(validators: any) {\n this._asyncValidatorFn = () => {\n return Promise.all(this.getPromiseList(validators)).then(() => {\n return null;\n }, err => {\n let validationMsg: string;\n // if err obj has validationMessage key, then set validationMessage using this value\n // else return the value of the first key in the err object as validation message.\n if (err.hasOwnProperty('errorMessage')) {\n validationMsg = get(err, 'errorMessage');\n } else {\n const messageKeys = keys(err);\n validationMsg = (err[messageKeys[0]]).toString();\n }\n this.setInvalidState(validationMsg);\n return err;\n })\n };\n }\n\n // sets the default validation on the form field\n setValidators(validators: any) {\n let _cloneValidators = cloneDeep(validators);\n this._syncValidators = [];\n forEach(_cloneValidators, (obj, index) => {\n // custom validation is bound to function.\n if (obj && obj instanceof Function) {\n // passing formwidget and form as arguments to the obj (i.e. validator function)\n _cloneValidators[index] = obj.bind(undefined, this.formwidget.proxy, this.form);\n this._syncValidators.push(_cloneValidators[index]);\n } else {\n // checks for default validator like required, maxchars etc.\n const key = get(obj, 'type');\n this.defaultValidatorMessages[key] = get(obj, 'errorMessage');\n const value = get(obj, 'validator');\n let propsObj: any = {\n props: {}\n };\n propsObj.props[key] = value;\n key === 'required' && this.updateState(propsObj as WmFormFieldState);\n this.formwidget.updateState(propsObj as WmFormFieldState);\n }\n });\n }\n\n updateFormWidgetDataset(res: any, displayField: string) {\n this.formwidget.updateState({\n props: {\n dataset: res.data,\n datafield: 'All Fields',\n displayfield: this.formwidget.state.props.displayfield || displayField,\n }\n } as WmFormFieldState);\n }\n\n setInvalidState(msg: string) {\n this.updateState({\n isValid: false,\n props: {\n validationmessage: msg\n }\n } as WmFormFieldState)\n this.formwidget.updateState({\n isValid: false,\n props: {\n validationmessage: msg\n }\n } as WmFormFieldState);\n }\n\n onPropertyChange(name: string, $new: any, $old: any) {\n switch (name) {\n case 'datavalue':\n if (!isEqual($old, $new)) {\n PERFORMANCE_LOGGER.debug(`form field ${this.props.name} changed from ${$old} to ${$new}`);\n }\n break;\n case 'defaultvalue':\n if (!isEqual($old, $new)) {\n get(this, 'form') && this.form.applyDefaultValue(this);\n }\n break;\n case 'primary-key':\n if ($new) {\n this.form.setPrimaryKey(this.props.name);\n }\n break;\n }\n }\n\n setReadOnlyState(updateMode: any) {\n this.formwidget?.updateState({\n props: {\n readonly: !updateMode,\n }\n } as WmFormFieldState);\n }\n\n validateFormField() {\n if (this.formwidget?.state.isValid === false) {\n const errorType = this.formwidget?.state?.errorType;\n let validationMsg = get(this.defaultValidatorMessages, errorType);\n if (validationMsg) {\n if (validationMsg instanceof Function) {\n // passing formwidget and form as arguments to the errorMessage function.\n validationMsg = validationMsg(this.formwidget.proxy, this.form);\n }\n this.updateState({ props: {\n validationmessage: validationMsg\n }} as WmFormFieldState);\n }\n this.updateState({ isValid: false} as WmFormFieldState);\n } else {\n this.updateState({ isValid: true } as WmFormFieldState);\n }\n\n this._syncValidators?.forEach((fn: any) => {\n const errormsg = fn();\n let validationMsg = errormsg?.errorMessage;\n if (validationMsg) {\n if (validationMsg instanceof Function) {\n // passing formwidget and form as arguments to the errorMessage function.\n validationMsg = validationMsg(this.formwidget.proxy, this.form);\n }\n this.setInvalidState(validationMsg);\n }\n })\n\n this._asyncValidatorFn && this._asyncValidatorFn();\n\n }\n\n renderWidget(props: WmFormFieldProps) {\n var childrenWithProps = React.Children.map(props.renderFormFields(this.proxy).props.children, (child) => {\n return React.cloneElement(child, {\n datavalue: props.datavalue,\n isValid: this.state.isValid,\n invokeEvent: this.invokeEventCallback.bind(this),\n triggerValidation: this.validateFormField.bind(this),\n onFieldChange: this.onFieldChangeEvt.bind(this),\n formRef: props.formRef });\n });\n return (\n <View style={this.styles.root}>{this._background}{childrenWithProps}\n {this.state.isValid === false && <Text {...this.getTestPropsForLabel('error_msg')} style={this.styles.errorMsg}>{props.validationmessage}</Text>}\n </View>\n );\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I,CAACF,KAAK,CAACE,OAAO;QAC3BwB,WAAW,EAAE,IAAI,CAAC7E,mBAAmB,CAACuB,IAAI,CAAC,IAAI,CAAC;QAChDuD,iBAAiB,EAAE,IAAI,CAACjF,iBAAiB,CAAC0B,IAAI,CAAC,IAAI,CAAC;QACpDwD,aAAa,EAAE,IAAI,CAACxF,gBAAgB,CAACgC,IAAI,CAAC,IAAI,CAAC;QAC/CyD,OAAO,EAAE1F,KAAK,CAAC0F;MAAQ,CAAC,CAAC;IAC/B,CAAC,CAAC;IACF,oBACE7G,KAAA,CAAA8G,aAAA,CAAC5G,IAAI;MAAC6G,KAAK,EAAE,IAAI,CAACC,MAAM,CAACC;IAAK,GAAE,IAAI,CAACC,WAAW,EAAEf,iBAAiB,EAChE,IAAI,CAACnB,KAAK,CAACE,OAAO,KAAK,KAAK,iBAAIlF,KAAA,CAAA8G,aAAA,CAAC7G,IAAI,EAAAkH,QAAA,KAAK,IAAI,CAACC,oBAAoB,CAAC,WAAW,CAAC;MAAEL,KAAK,EAAE,IAAI,CAACC,MAAM,CAACK;IAAS,IAAElG,KAAK,CAACgE,iBAAwB,CAC3I,CAAC;EAEX;AACF"}
1
+ {"version":3,"names":["React","Text","View","BaseComponent","BaseComponentState","isEqual","get","find","cloneDeep","forEach","keys","WmFormFieldProps","DEFAULT_CLASS","PERFORMANCE_LOGGER","WmFormFieldState","constructor","arguments","_defineProperty","WmFormField","props","onFieldChangeEvt","name","$new","$old","isDefault","notifyChanges","updateState","datavalue","invokeEventCallback","undefined","validateFormField","form","updateDataOutput","call","observeOn","fields","field","formfield","formFields","f","proxy","notifyForFields","push","formwidget","validate","setTimeout","getPromiseList","validators","arr","fn","promise","Function","bind","Promise","setAsyncValidators","_asyncValidatorFn","all","then","err","validationMsg","hasOwnProperty","messageKeys","toString","setInvalidState","setValidators","_cloneValidators","_syncValidators","obj","index","key","defaultValidatorMessages","value","propsObj","updateFormWidgetDataset","res","displayField","dataset","data","datafield","displayfield","state","msg","isValid","validationmessage","onPropertyChange","debug","applyDefaultValue","setPrimaryKey","setReadOnlyState","updateMode","_this$formwidget","readonly","_this$formwidget2","_this$_syncValidators","_this$formwidget3","errorType","errormsg","errorMessage","renderWidget","childrenWithProps","Children","map","renderFormFields","children","child","cloneElement","invokeEvent","triggerValidation","onFieldChange","formRef","createElement","style","styles","root","_background","_extends","getTestPropsForLabel","errorMsg"],"sources":["form-field.component.tsx"],"sourcesContent":["import React from 'react';\nimport {Text, View} from 'react-native';\nimport { BaseComponent, BaseComponentState } from '@wavemaker/app-rn-runtime/core/base.component';\nimport { widgetsWithUndefinedValue } from '@wavemaker/app-rn-runtime/core/utils';\nimport { isEqual, get, find, cloneDeep, forEach, keys } from 'lodash';\n\nimport WmFormFieldProps from './form-field.props';\nimport { DEFAULT_CLASS, WmFormFieldStyles } from './form-field.styles';\nimport {PERFORMANCE_LOGGER} from \"@wavemaker/app-rn-runtime/core/logger\";\n\nexport class WmFormFieldState extends BaseComponentState<WmFormFieldProps> {\n isValid = true;\n}\n\nexport default class WmFormField extends BaseComponent<WmFormFieldProps, WmFormFieldState, WmFormFieldStyles> {\n public form: any;\n public formwidget: any;\n public _syncValidators: any;\n public defaultValidatorMessages: any = [];\n private notifyForFields: any = [];\n private _asyncValidatorFn: any;\n constructor(props: WmFormFieldProps) {\n super(props, DEFAULT_CLASS, new WmFormFieldProps(), new WmFormFieldState());\n }\n\n onFieldChangeEvt(name: string, $new: any, $old: any, isDefault: boolean) {\n this.notifyChanges();\n if (!isEqual($old, $new)) {\n this.updateState({ props: { datavalue: $new }} as WmFormFieldState, () => {\n !isDefault && this.invokeEventCallback('onChange', [undefined, this, $new, $old]);\n this.validateFormField();\n });\n if (this.form) {\n this.form.updateDataOutput.call(this.form, get(this.props, 'formKey', this.props.name), $new);\n }\n }\n }\n\n // Registers observer of validation fields\n observeOn(fields: any) {\n forEach(fields, (field) => {\n const formfield = find(this.form.formFields, (f) => f.proxy.name === field);\n if (formfield) {\n formfield.notifyForFields.push(this);\n }\n });\n }\n\n // Notifies changes to observing validation fields\n notifyChanges() {\n forEach(this.notifyForFields, (field) => {\n field.formwidget.validate(field.formwidget.datavalue);\n setTimeout(() => field.validateFormField());\n });\n }\n\n getPromiseList(validators: any) {\n const arr: any = [];\n forEach(validators, (fn) => {\n let promise = fn;\n if (fn instanceof Function && fn.bind) {\n promise = fn(this.formwidget.proxy, this.form);\n }\n if (promise instanceof Promise) {\n arr.push(promise);\n }\n });\n return arr;\n }\n\n // this method sets the asyncValidation on the form field. Assigns validationmessages from the returned response\n setAsyncValidators(validators: any) {\n this._asyncValidatorFn = () => {\n return Promise.all(this.getPromiseList(validators)).then(() => {\n return null;\n }, err => {\n let validationMsg: string;\n // if err obj has validationMessage key, then set validationMessage using this value\n // else return the value of the first key in the err object as validation message.\n if (err.hasOwnProperty('errorMessage')) {\n validationMsg = get(err, 'errorMessage');\n } else {\n const messageKeys = keys(err);\n validationMsg = (err[messageKeys[0]]).toString();\n }\n this.setInvalidState(validationMsg);\n return err;\n })\n };\n }\n\n // sets the default validation on the form field\n setValidators(validators: any) {\n let _cloneValidators = cloneDeep(validators);\n this._syncValidators = [];\n forEach(_cloneValidators, (obj, index) => {\n // custom validation is bound to function.\n if (obj && obj instanceof Function) {\n // passing formwidget and form as arguments to the obj (i.e. validator function)\n _cloneValidators[index] = obj.bind(undefined, this.formwidget.proxy, this.form);\n this._syncValidators.push(_cloneValidators[index]);\n } else {\n // checks for default validator like required, maxchars etc.\n const key = get(obj, 'type');\n this.defaultValidatorMessages[key] = get(obj, 'errorMessage');\n const value = get(obj, 'validator');\n let propsObj: any = {\n props: {}\n };\n propsObj.props[key] = value;\n key === 'required' && this.updateState(propsObj as WmFormFieldState);\n this.formwidget.updateState(propsObj as WmFormFieldState);\n }\n });\n }\n\n updateFormWidgetDataset(res: any, displayField: string) {\n this.formwidget.updateState({\n props: {\n dataset: res.data,\n datafield: 'All Fields',\n displayfield: this.formwidget.state.props.displayfield || displayField,\n }\n } as WmFormFieldState);\n }\n\n setInvalidState(msg: string) {\n this.updateState({\n isValid: false,\n props: {\n validationmessage: msg\n }\n } as WmFormFieldState)\n this.formwidget.updateState({\n isValid: false,\n props: {\n validationmessage: msg\n }\n } as WmFormFieldState);\n }\n\n onPropertyChange(name: string, $new: any, $old: any) {\n switch (name) {\n case 'datavalue':\n if (!isEqual($old, $new)) {\n PERFORMANCE_LOGGER.debug(`form field ${this.props.name} changed from ${$old} to ${$new}`);\n }\n break;\n case 'defaultvalue':\n if (!isEqual($old, $new)) {\n get(this, 'form') && this.form.applyDefaultValue(this);\n }\n break;\n case 'primary-key':\n if ($new) {\n this.form.setPrimaryKey(this.props.name);\n }\n break;\n }\n }\n\n setReadOnlyState(updateMode: any) {\n this.formwidget?.updateState({\n props: {\n readonly: !updateMode,\n }\n } as WmFormFieldState);\n }\n\n validateFormField() {\n if (this.formwidget?.state.isValid === false) {\n const errorType = this.formwidget?.state?.errorType;\n let validationMsg = get(this.defaultValidatorMessages, errorType);\n if (validationMsg) {\n if (validationMsg instanceof Function) {\n // passing formwidget and form as arguments to the errorMessage function.\n validationMsg = validationMsg(this.formwidget.proxy, this.form);\n }\n this.updateState({ props: {\n validationmessage: validationMsg\n }} as WmFormFieldState);\n }\n this.updateState({ isValid: false} as WmFormFieldState);\n } else {\n this.updateState({ isValid: true } as WmFormFieldState);\n }\n\n this._syncValidators?.forEach((fn: any) => {\n const errormsg = fn();\n let validationMsg = errormsg?.errorMessage;\n if (validationMsg) {\n if (validationMsg instanceof Function) {\n // passing formwidget and form as arguments to the errorMessage function.\n validationMsg = validationMsg(this.formwidget.proxy, this.form);\n }\n this.setInvalidState(validationMsg);\n }\n })\n\n this._asyncValidatorFn && this._asyncValidatorFn();\n\n }\n\n get value(){\n return this.state.props.datavalue;\n }\n\n renderWidget(props: WmFormFieldProps) {\n var childrenWithProps = React.Children.map(props.renderFormFields(this.proxy).props.children, (child) => {\n return React.cloneElement(child, {\n datavalue: props.datavalue,\n value: this.value,\n isValid: this.state.isValid,\n invokeEvent: this.invokeEventCallback.bind(this),\n triggerValidation: this.validateFormField.bind(this),\n onFieldChange: this.onFieldChangeEvt.bind(this),\n formRef: props.formRef });\n });\n return (\n <View style={this.styles.root}>{this._background}{childrenWithProps}\n {this.state.isValid === false && <Text {...this.getTestPropsForLabel('error_msg')} style={this.styles.errorMsg}>{props.validationmessage}</Text>}\n </View>\n );\n }\n}\n"],"mappings":";;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAAQC,IAAI,EAAEC,IAAI,QAAO,cAAc;AACvC,SAASC,aAAa,EAAEC,kBAAkB,QAAQ,+CAA+C;AAEjG,SAASC,OAAO,EAAEC,GAAG,EAAEC,IAAI,EAAEC,SAAS,EAAEC,OAAO,EAAEC,IAAI,QAAQ,QAAQ;AAErE,OAAOC,gBAAgB,MAAM,oBAAoB;AACjD,SAASC,aAAa,QAA2B,qBAAqB;AACtE,SAAQC,kBAAkB,QAAO,uCAAuC;AAExE,OAAO,MAAMC,gBAAgB,SAASV,kBAAkB,CAAmB;EAAAW,YAAA;IAAA,SAAAC,SAAA;IAAAC,eAAA,kBAC/D,IAAI;EAAA;AAChB;AAEA,eAAe,MAAMC,WAAW,SAASf,aAAa,CAAwD;EAO5GY,WAAWA,CAACI,KAAuB,EAAE;IACnC,KAAK,CAACA,KAAK,EAAEP,aAAa,EAAE,IAAID,gBAAgB,CAAC,CAAC,EAAE,IAAIG,gBAAgB,CAAC,CAAC,CAAC;IAACG,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA,mCAJvC,EAAE;IAAAA,eAAA,0BACV,EAAE;IAAAA,eAAA;EAIjC;EAEAG,gBAAgBA,CAACC,IAAY,EAAEC,IAAS,EAAEC,IAAS,EAAEC,SAAkB,EAAE;IACvE,IAAI,CAACC,aAAa,CAAC,CAAC;IACpB,IAAI,CAACpB,OAAO,CAACkB,IAAI,EAAED,IAAI,CAAC,EAAE;MACxB,IAAI,CAACI,WAAW,CAAC;QAAEP,KAAK,EAAE;UA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EACnC;EAEAuE,YAAYA,CAAC/E,KAAuB,EAAE;IACpC,IAAIgF,iBAAiB,GAAGnG,KAAK,CAACoG,QAAQ,CAACC,GAAG,CAAClF,KAAK,CAACmF,gBAAgB,CAAC,IAAI,CAAC9D,KAAK,CAAC,CAACrB,KAAK,CAACoF,QAAQ,EAAGC,KAAK,IAAK;MACvG,oBAAOxG,KAAK,CAACyG,YAAY,CAACD,KAAK,EAAE;QAC7B7E,SAAS,EAAER,KAAK,CAACQ,SAAS;QAC1B4C,KAAK,EAAE,IAAI,CAACA,KAAK;QACjBW,OAAO,EAAE,IAAI,CAACF,KAAK,CAACE,OAAO;QAC3BwB,WAAW,EAAE,IAAI,CAAC9E,mBAAmB,CAACwB,IAAI,CAAC,IAAI,CAAC;QAChDuD,iBAAiB,EAAE,IAAI,CAAC7E,iBAAiB,CAACsB,IAAI,CAAC,IAAI,CAAC;QACpDwD,aAAa,EAAE,IAAI,CAACxF,gBAAgB,CAACgC,IAAI,CAAC,IAAI,CAAC;QAC/CyD,OAAO,EAAE1F,KAAK,CAAC0F;MAAQ,CAAC,CAAC;IAC/B,CAAC,CAAC;IACF,oBACE7G,KAAA,CAAA8G,aAAA,CAAC5G,IAAI;MAAC6G,KAAK,EAAE,IAAI,CAACC,MAAM,CAACC;IAAK,GAAE,IAAI,CAACC,WAAW,EAAEf,iBAAiB,EAChE,IAAI,CAACnB,KAAK,CAACE,OAAO,KAAK,KAAK,iBAAIlF,KAAA,CAAA8G,aAAA,CAAC7G,IAAI,EAAAkH,QAAA,KAAK,IAAI,CAACC,oBAAoB,CAAC,WAAW,CAAC;MAAEL,KAAK,EAAE,IAAI,CAACC,MAAM,CAACK;IAAS,IAAElG,KAAK,CAACgE,iBAAwB,CAC3I,CAAC;EAEX;AACF"}
@@ -3,8 +3,8 @@ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key i
3
3
  function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
4
4
  function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
5
5
  import React from 'react';
6
- import { SectionList, Text, View, FlatList } from 'react-native';
7
- import { isArray, isEmpty, isNil, round } from 'lodash-es';
6
+ import { ActivityIndicator, SectionList, Text, View, FlatList } from 'react-native';
7
+ import { isArray, isEmpty, isNil, isNumber } from 'lodash-es';
8
8
  import { BaseComponent, BaseComponentState } from '@wavemaker/app-rn-runtime/core/base.component';
9
9
  import { getGroupedData, isDefined } from "@wavemaker/app-rn-runtime/core/utils";
10
10
  import { Tappable } from '@wavemaker/app-rn-runtime/core/tappable.component';
@@ -19,6 +19,7 @@ export class WmListState extends BaseComponentState {
19
19
  _defineProperty(this, "selectedindex", void 0);
20
20
  _defineProperty(this, "groupedData", []);
21
21
  _defineProperty(this, "currentPage", 1);
22
+ _defineProperty(this, "maxRecordsToShow", 20);
22
23
  }
23
24
  }
24
25
  export default class WmList extends BaseComponent {
@@ -27,6 +28,9 @@ export default class WmList extends BaseComponent {
27
28
  _defineProperty(this, "itemWidgets", []);
28
29
  _defineProperty(this, "selectedItemWidgets", {});
29
30
  _defineProperty(this, "keyExtractor", new DefaultKeyExtractor());
31
+ _defineProperty(this, "endThreshold", -1);
32
+ _defineProperty(this, "loadingData", false);
33
+ _defineProperty(this, "hasMoreData", true);
30
34
  }
31
35
  isSelected($item) {
32
36
  const selectedItem = this.state.props.selecteditem;
@@ -71,6 +75,32 @@ export default class WmList extends BaseComponent {
71
75
  });
72
76
  }
73
77
  }
78
+ loadData() {
79
+ if (this.loadingData) {
80
+ return;
81
+ }
82
+ const $list = this.proxy;
83
+ $list.loadingdata = true;
84
+ this.loadingData = true;
85
+ this.props.getNextPageData && this.props.getNextPageData(null, this.proxy, this.state.currentPage + 1).then(data => {
86
+ if (data && isArray(data) && isArray(this.state.props.dataset)) {
87
+ $list.dataset = [...this.state.props.dataset, ...data];
88
+ this.updateState({
89
+ currentPage: this.state.currentPage + 1,
90
+ maxRecordsToShow: this.state.maxRecordsToShow + 20
91
+ });
92
+ this.hasMoreData = true;
93
+ } else {
94
+ this.hasMoreData = false;
95
+ }
96
+ }).catch(err => {
97
+ console.error(err);
98
+ }).then(() => {
99
+ setTimeout(() => {
100
+ $list.loadingdata = false;
101
+ }, 1000);
102
+ });
103
+ }
74
104
  selectFirstItem() {
75
105
  const props = this.state.props;
76
106
  if (this.initialized && props.dataset && props.dataset.length) {
@@ -78,6 +108,52 @@ export default class WmList extends BaseComponent {
78
108
  this.onSelect(props.dataset[0], index);
79
109
  }
80
110
  }
111
+ clear() {
112
+ this.updateState({
113
+ groupedData: {}
114
+ });
115
+ }
116
+ selectItem(item) {
117
+ const dataset = this.state.props.dataset;
118
+ if (isNumber(item)) {
119
+ this.onSelect(dataset[item], item);
120
+ } else {
121
+ let index = dataset.indexOf(item);
122
+ this.onSelect(dataset[index], index);
123
+ }
124
+ }
125
+ getItem(index) {
126
+ const props = this.state.props;
127
+ return this.props.dataset[index];
128
+ }
129
+ deselect(item) {
130
+ const props = this.state.props;
131
+ let selectedItem = null;
132
+ let index = isNumber(item) ? item : props.dataset.indexOf(item);
133
+ if (props.multiselect && index >= 0) {
134
+ selectedItem = [...(props.selecteditem || [])];
135
+ let selectedItemIndex = selectedItem.indexOf(props.dataset[index]);
136
+ if (selectedItemIndex >= 0) {
137
+ selectedItem.splice(selectedItemIndex, 1);
138
+ }
139
+ } else {
140
+ if (props.selecteditem === props.dataset[index]) {
141
+ selectedItem = null;
142
+ }
143
+ }
144
+ this.updateState({
145
+ props: {
146
+ selecteditem: selectedItem
147
+ }
148
+ });
149
+ }
150
+ getWidgets(widgetname, index) {
151
+ if (index >= 0 && index < this.itemWidgets.length) {
152
+ return this.itemWidgets[index][widgetname];
153
+ } else {
154
+ return this.itemWidgets.map(item => item[widgetname]).filter(widget => widget !== undefined);
155
+ }
156
+ }
81
157
  deselectAll() {
82
158
  this.updateState({
83
159
  props: {
@@ -112,10 +188,17 @@ export default class WmList extends BaseComponent {
112
188
  if (this.state.props.groupby) {
113
189
  this.setGroupData($new);
114
190
  } else {
191
+ if (!($old && $old.length) && $new && $new.length && this.state.props.deferload) {
192
+ this.updateState({
193
+ props: {
194
+ dataset: [...$new]
195
+ }
196
+ });
197
+ }
115
198
  const data = isArray($new) ? $new : !isEmpty($new) && isDefined($new) ? [$new] : [];
116
199
  this.updateState({
117
200
  groupedData: data[0] || props.direction === 'horizontal' ? [{
118
- key: '',
201
+ key: 'key',
119
202
  data: data
120
203
  }] : []
121
204
  }, () => {
@@ -142,6 +225,15 @@ export default class WmList extends BaseComponent {
142
225
  } else if (isArray(this.state.props.selecteditem)) {
143
226
  this.state.props.selecteditem = this.state.props.selecteditem.pop();
144
227
  }
228
+ break;
229
+ case 'loadingdata':
230
+ this.loadingData = $new && this.loadingData;
231
+ break;
232
+ case 'selecteditem':
233
+ if ($new != $old && isNumber($new)) {
234
+ this.selectItem(this.state.props.dataset[$new]);
235
+ }
236
+ break;
145
237
  }
146
238
  }
147
239
  componentDidMount() {
@@ -152,6 +244,19 @@ export default class WmList extends BaseComponent {
152
244
  this.onSelect(props.dataset[0], 0);
153
245
  });
154
246
  }
247
+ this.subscribe('scroll', event => {
248
+ const scrollPosition = event.nativeEvent.contentOffset.y + event.nativeEvent.layoutMeasurement.height;
249
+ if (scrollPosition > this.endThreshold) {
250
+ var _this$state$props$dat;
251
+ if (((_this$state$props$dat = this.state.props.dataset) === null || _this$state$props$dat === void 0 ? void 0 : _this$state$props$dat.length) > this.state.maxRecordsToShow) {
252
+ this.updateState({
253
+ maxRecordsToShow: this.state.maxRecordsToShow + 20
254
+ });
255
+ } else if (this.state.props.deferload) {
256
+ this.loadData();
257
+ }
258
+ }
259
+ });
155
260
  super.componentDidMount();
156
261
  }
157
262
  componentDidUpdate(prevProps, prevState, snapshot) {
@@ -174,22 +279,22 @@ export default class WmList extends BaseComponent {
174
279
  renderItem(item, index, props) {
175
280
  const cols = this.getNoOfColumns();
176
281
  const isHorizontal = props.direction === 'horizontal';
177
- return /*#__PURE__*/React.createElement(Tappable, _extends({}, this.getTestPropsForAction(`item${index}`), {
282
+ return index < this.state.maxRecordsToShow ? /*#__PURE__*/React.createElement(View, {
283
+ style: [this.styles.item, props.itemclass ? this.theme.getStyle(props.itemclass(item, index)) : null, this.isSelected(item) ? this.styles.selectedItem : {}]
284
+ }, /*#__PURE__*/React.createElement(Tappable, _extends({}, this.getTestPropsForAction(`item${index}`), {
178
285
  onTap: () => this.onSelect(item, index, true),
179
286
  onLongTap: () => this.invokeEventCallback('onLongtap', [null, this.proxy]),
180
287
  onDoubleTap: () => this.invokeEventCallback('onDoubletap', [null, this.proxy]),
181
288
  styles: [cols ? {
182
- width: round(100 / cols, 2) + '%'
289
+ width: '100%'
183
290
  } : null, cols || isHorizontal ? {
184
291
  paddingRight: (isNil(this.styles.item.marginRight) ? this.styles.item.margin : this.styles.item.marginRight) || 4
185
292
  } : null]
186
- }), /*#__PURE__*/React.createElement(View, {
187
- style: [this.styles.item, props.itemclass ? this.theme.getStyle(props.itemclass(item, index)) : null, this.isSelected(item) ? this.styles.selectedItem : {}]
188
- }, props.renderItem(item, index, this), this.isSelected(item) ? /*#__PURE__*/React.createElement(WmIcon, {
293
+ }), props.renderItem(item, index, this), this.isSelected(item) ? /*#__PURE__*/React.createElement(WmIcon, {
189
294
  id: this.getTestId('icon' + index),
190
295
  iconclass: "wi wi-check-circle",
191
296
  styles: this.styles.selectedIcon
192
- }) : null));
297
+ }) : null)) : null;
193
298
  }
194
299
  renderHeader(props, title) {
195
300
  return props.groupby ? /*#__PURE__*/React.createElement(Text, {
@@ -223,11 +328,13 @@ export default class WmList extends BaseComponent {
223
328
  });
224
329
  }
225
330
  renderLoadingIcon(props) {
226
- return /*#__PURE__*/React.createElement(WmIcon, {
331
+ return props.loadingicon ? /*#__PURE__*/React.createElement(WmIcon, {
227
332
  id: this.getTestId('loadingicon'),
228
333
  styles: this.styles.loadingIcon,
229
334
  iconclass: props.loadingicon,
230
335
  caption: props.loadingdatamsg
336
+ }) : /*#__PURE__*/React.createElement(ActivityIndicator, {
337
+ color: this.styles.loadingIcon.text.color
231
338
  });
232
339
  }
233
340
  getNoOfColumns() {
@@ -237,10 +344,18 @@ export default class WmList extends BaseComponent {
237
344
  }
238
345
  return 0;
239
346
  }
347
+ onLayoutChange(e) {
348
+ const l = e.nativeEvent.layout;
349
+ this.endThreshold = l.height + l.y - 100;
350
+ if (!this.endThreshold) {
351
+ this.endThreshold = -1;
352
+ }
353
+ }
240
354
  renderWithFlatList(props) {
241
355
  let isHorizontal = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
242
356
  return /*#__PURE__*/React.createElement(View, {
243
- style: this.styles.root
357
+ style: this.styles.root,
358
+ onLayout: e => this.onLayoutChange(e)
244
359
  }, !isEmpty(this.state.groupedData) ? this.state.groupedData.map((v, i) => /*#__PURE__*/React.createElement(View, {
245
360
  style: {
246
361
  marginBottom: 16
@@ -249,13 +364,19 @@ export default class WmList extends BaseComponent {
249
364
  }, this.renderHeader(props, v.key), /*#__PURE__*/React.createElement(FlatList, _extends({
250
365
  key: props.name + '_' + (isHorizontal ? 'H' : 'V') + props.itemsperrow.xs,
251
366
  keyExtractor: (item, i) => this.generateItemKey(item, i, props),
367
+ scrollEnabled: false,
252
368
  horizontal: isHorizontal,
253
- data: v.data || [],
369
+ data: isEmpty(v.data[0]) ? [] : v.data,
254
370
  ListEmptyComponent: itemInfo => this.renderEmptyMessage(isHorizontal, itemInfo.item, itemInfo.index, props),
255
371
  renderItem: itemInfo => this.renderItem(itemInfo.item, itemInfo.index, props)
256
372
  }, isHorizontal ? {} : {
257
373
  numColumns: this.getNoOfColumns()
258
- })))) : this.renderEmptyMessage(isHorizontal, null, null, props));
374
+ })), props.deferload ? this.loadingData ? this.renderLoadingIcon(props) : /*#__PURE__*/React.createElement(WmLabel, {
375
+ id: this.getTestId('ondemandmessage'),
376
+ styles: this.styles.onDemandMessage,
377
+ caption: this.hasMoreData ? props.ondemandmessage : props.nodatamessage,
378
+ onTap: () => this.loadData()
379
+ }) : null)) : this.renderEmptyMessage(isHorizontal, null, null, props));
259
380
  }
260
381
  getSectionListData() {
261
382
  if (this._showSkeleton) {
@@ -273,25 +394,15 @@ export default class WmList extends BaseComponent {
273
394
  return /*#__PURE__*/React.createElement(SectionList, {
274
395
  keyExtractor: (item, i) => this.generateItemKey(item, i, props),
275
396
  horizontal: isHorizontal,
276
- onEndReached: _ref => {
277
- let {
278
- distanceFromEnd
279
- } = _ref;
280
- this.setState({
281
- currentPage: this.state.currentPage + 1
282
- });
283
- this.invokeEventCallback('onEndReached', [null, this]);
284
- },
285
397
  contentContainerStyle: this.styles.root,
286
- onEndReachedThreshold: 0.3,
287
398
  sections: this.getSectionListData(),
288
- renderSectionHeader: _ref2 => {
399
+ renderSectionHeader: _ref => {
289
400
  let {
290
401
  section: {
291
402
  key,
292
403
  data
293
404
  }
294
- } = _ref2;
405
+ } = _ref;
295
406
  return this.renderHeader(props, key);
296
407
  },
297
408
  renderSectionFooter: () => props.loadingdata ? this.renderLoadingIcon(props) : null,