@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","Text","Platform","Svg","VictoryLabel","VictoryPie","WmPieChartProps","DEFAULT_CLASS","formatCompactNumber","WmIcon","BaseChartComponent","BaseChartComponentState","WmDonutChartProps","Legend","WmPieChartState","constructor","arguments","_defineProperty","WmPieChart","props","type","e","_e$nativeEvent","viewWidth","nativeEvent","layout","width","updateState","chartWidth","totalHeight","height","_e$nativeEvent2","infoHeight","opacity","_e$nativeEvent3","_e$nativeEvent4","legendWidth","legendHeight","componentDidMount","getLabel","d","labeltype","Math","round","y","state","total","xaxisDatakeyArr","x","onSelect","event","data","value","slice","label","datum","selectedItem","dataset","index","selectedChartItem","color","style","fill","_dataObj","invokeEventCallback","proxy","renderWidget","length","pieData","showlegend","chartHeight","styles","root","radius","min","innerRadius","donutratio","styleProp","labelRadius","showlabels","labels","display","origin","orientation","legendData","map","name","colors","createElement","onLayout","onViewLayoutChange","onInfoViewLayoutChange","flexDirection","alignItems","iconclass","icon","title","subHeading","subheading","onLegendViewLayoutChange","testStyle","legendText","dotStyle","legenedDot","justifyContent","flex","standalone","colorScale","_ref","endAngle","theme","key","labelPlacement","labelplacement","events","target","eventHandlers","OS","onClick","bind","onPress","textAnchor","text","centerlabel","maxWidth"],"sources":["pie-chart.component.tsx"],"sourcesContent":["import React from 'react';\nimport { LayoutChangeEvent, View, Text, Platform } from 'react-native';\nimport { Svg } from 'react-native-svg';\n\nimport { VictoryLabel, VictoryLegend, VictoryPie } from 'victory-native';\n\nimport WmPieChartProps from './pie-chart.props';\nimport { DEFAULT_CLASS, WmPieChartStyles } from './pie-chart.styles';\n\nimport { formatCompactNumber } from '@wavemaker/app-rn-runtime/core/utils';\nimport WmIcon from '@wavemaker/app-rn-runtime/components/basic/icon/icon.component';\nimport {\n BaseChartComponent,\n BaseChartComponentState\n} from '@wavemaker/app-rn-runtime/components/chart/basechart.component';\nimport WmDonutChartProps from '@wavemaker/app-rn-runtime/components/chart/donut-chart/donut-chart.props';\nimport { Legend } from '../legend/legend.component';\n\nexport class WmPieChartState extends BaseChartComponentState<WmPieChartProps> {\n chartWidth = 0;\n totalHeight = 0;\n infoHeight = 10;\n legendWidth = 0;\n legendHeight = 0;\n opacity = 0;\n}\n\nexport default class WmPieChart extends BaseChartComponent<WmPieChartProps, WmPieChartState, WmPieChartStyles> {\n\n constructor(props: WmPieChartProps) {\n super(props, DEFAULT_CLASS, props.type === 'Donut' ? new WmDonutChartProps() : new WmPieChartProps(), new WmPieChartState());\n }\n\n componentDidMount() {\n super.componentDidMount();\n }\n\n onViewLayoutChange = (e: LayoutChangeEvent) => {\n let viewWidth = e.nativeEvent.layout.width;\n this.updateState({\n chartWidth: viewWidth,\n totalHeight: e.nativeEvent?.layout.height\n } as WmPieChartState)\n }\n\n onInfoViewLayoutChange = (e: LayoutChangeEvent) => {\n this.updateState({\n infoHeight: e.nativeEvent?.layout.height,\n opacity: 1\n } as WmPieChartState);\n }\n\n onLegendViewLayoutChange = (e: LayoutChangeEvent) => {\n this.updateState({\n legendWidth: e.nativeEvent?.layout.width,\n legendHeight: e.nativeEvent?.layout.height\n } as WmPieChartState);\n }\n\n getLabel(d: {x: any, y: any}, props: WmPieChartProps): string {\n switch(props.labeltype) {\n case 'percent': {\n return Math.round(d.y * 100 /this.state.total) + '%';\n }\n case 'key': {\n return this.state.xaxisDatakeyArr[d.x];\n }\n case 'value': {\n return formatCompactNumber(d.y);\n }\n case 'key-value': {\n return this.state.xaxisDatakeyArr[d.x] + ' ' + d.y;\n }\n }\n }\n\n onSelect(event: any, data: any){\n let value = data.slice.value;\n let label = this.state.xaxisDatakeyArr[data.datum.x];\n let selectedItem = this.props.dataset[data.index];\n let selectedChartItem = data.slice;\n selectedChartItem[\"data\"] = {x: label, y: value, color: data.style.fill, _dataObj: selectedItem}\n this.invokeEventCallback('onSelect', [event.nativeEvent, this.proxy, selectedItem, selectedChartItem ]);\n }\n\n renderWidget(props: WmPieChartProps) {\n this.invokeEventCallback('onBeforerender', [this.proxy, null]);\n if (!this.state.data.length) {\n return null;\n }\n const pieData = this.state.data[0];\n const chartWidth = this.state.chartWidth \n - (props.showlegend === 'right' ? this.state.legendWidth : 0);\n const chartHeight = (this.styles.root.height ? this.state.totalHeight : chartWidth) \n - this.state.infoHeight \n - (props.showlegend === 'right' ? 0 : this.state.legendHeight);\n let radius = (Math.min(chartWidth, chartHeight) - 40)/ 2;\n let innerRadius = props.donutratio * radius;\n let styleProp = {};\n let labelRadius;\n if (props.showlabels === 'hide') {\n styleProp={labels: { display: \"none\" }};\n } else if (props.showlabels === 'inside') {\n labelRadius = radius/2;\n } else {\n labelRadius = radius + 8;\n }\n const origin = {x: (chartWidth/2), y: (chartHeight/2)};\n const orientation = props.showlegend === 'right' ? 'vertical' : 'horizontal';\n let legendData = pieData.map((d: {x: any, y: any}, index: number) => {\n return {\n name: this.state.xaxisDatakeyArr[d.x],\n color: this.state.colors[index % (this.state.colors.length)]\n };\n });\n return (\n <View style={[{opacity: this.state.opacity}, this.styles.root]}\n onLayout={this.onViewLayoutChange}>\n <View onLayout={this.onInfoViewLayoutChange}>\n <View style={{flexDirection: 'row', alignItems: 'center'}}>\n {props.iconclass ? (<WmIcon iconclass={props.iconclass} styles={this.styles.icon}></WmIcon>) : null }\n <Text style={this.styles.title}>{props.title}</Text>\n </View>\n <Text style={this.styles.subHeading}>{props.subheading}</Text>\n </View>\n {props.showlegend === 'top' ? \n (<View onLayout={this.onLegendViewLayoutChange}>\n <Legend data={legendData}\n testStyle={this.styles.legendText}\n dotStyle={this.styles.legenedDot}></Legend>\n </View>) : null }\n <View style={{flexDirection: 'row', justifyContent: 'center', alignItems: 'center'}}>\n <View style={{flex: 1}}>\n {chartWidth ? (\n <Svg\n width={chartWidth}\n height={chartHeight}\n >\n <VictoryPie\n style={styleProp}\n standalone={false}\n colorScale={this.state.colors}\n labels={({datum}) => this.getLabel(datum, props)}\n endAngle={this.state.endAngle || 0}\n radius={radius}\n innerRadius={innerRadius}\n theme={this.state.theme}\n key={props.name}\n name={props.name}\n data={pieData}\n origin={origin}\n labelPlacement={props.labelplacement}\n labelRadius={labelRadius}\n events={[{\n target: 'data',\n eventHandlers: Platform.OS == \"web\" ? {\n onClick: this.onSelect.bind(this)\n }:{\n onPress: this.onSelect.bind(this)\n }\n }]}\n />\n <VictoryLabel\n textAnchor=\"middle\"\n style={this.styles.title as any}\n x={origin.x} y={origin.y}\n text={props.centerlabel}\n />\n </Svg>) : null}\n </View>\n {props.showlegend === 'right' ? \n (<View style={{maxWidth: '50%'}} onLayout={this.onLegendViewLayoutChange}>\n <Legend data={legendData}\n testStyle={this.styles.legendText}\n dotStyle={this.styles.legenedDot}\n orientation='vertical'></Legend>\n </View>) : null }\n </View>\n {props.showlegend === 'bottom' ? \n (<View onLayout={this.onLegendViewLayoutChange}>\n <Legend data={legendData}\n testStyle={this.styles.legendText}\n dotStyle={this.styles.legenedDot}></Legend>\n </View>) : null }\n </View>\n );\n }\n}\n"],"mappings":";;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAA4BC,IAAI,EAAEC,IAAI,EAAEC,QAAQ,QAAQ,cAAc;AACtE,SAASC,GAAG,QAAQ,kBAAkB;AAEtC,SAASC,YAAY,EAAiBC,UAAU,QAAQ,gBAAgB;AAExE,OAAOC,eAAe,MAAM,mBAAmB;AAC/C,SAASC,aAAa,QAA0B,oBAAoB;AAEpE,SAASC,mBAAmB,QAAQ,sCAAsC;AAC1E,OAAOC,MAAM,MAAM,gEAAgE;AACnF,SACEC,kBAAkB,EAClBC,uBAAuB,QAClB,gEAAgE;AACvE,OAAOC,iBAAiB,MAAM,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yF,aAAA,CAACxF,IAAI;MAAC6D,KAAK,EAAE;QAAC+D,QAAQ,EAAE;MAAK,CAAE;MAACnC,QAAQ,EAAE,IAAI,CAACU;IAAyB,gBACvEpG,KAAA,CAAAyF,aAAA,CAAC3E,MAAM;MAACsC,IAAI,EAAEiC,UAAW;MACvBgB,SAAS,EAAE,IAAI,CAAC7B,MAAM,CAAC8B,UAAW;MAClCC,QAAQ,EAAE,IAAI,CAAC/B,MAAM,CAACgC,UAAW;MACjCpB,WAAW,EAAC;IAAU,CAAS,CAC7B,CAAC,GAAI,IACT,CAAC,EACNhE,KAAK,CAACkD,UAAU,KAAK,QAAQ,gBAC3BtE,KAAA,CAAAyF,aAAA,CAACxF,IAAI;MAACyF,QAAQ,EAAE,IAAI,CAACU;IAAyB,gBAC7CpG,KAAA,CAAAyF,aAAA,CAAC3E,MAAM;MAACsC,IAAI,EAAEiC,UAAW;MACvBgB,SAAS,EAAE,IAAI,CAAC7B,MAAM,CAAC8B,UAAW;MAClCC,QAAQ,EAAE,IAAI,CAAC/B,MAAM,CAACgC;IAAW,CAAS,CACxC,CAAC,GAAI,IACT,CAAC;EAEX;AACF"}
1
+ {"version":3,"names":["React","View","Text","Platform","Svg","AccessibilityWidgetType","getAccessibilityProps","VictoryLabel","VictoryPie","WmPieChartProps","DEFAULT_CLASS","formatCompactNumber","WmIcon","BaseChartComponent","BaseChartComponentState","WmDonutChartProps","Legend","WmPieChartState","constructor","arguments","_defineProperty","WmPieChart","props","type","e","_e$nativeEvent","viewWidth","nativeEvent","layout","width","updateState","chartWidth","totalHeight","height","_e$nativeEvent2","infoHeight","opacity","_e$nativeEvent3","_e$nativeEvent4","legendWidth","legendHeight","componentDidMount","getLabel","d","labeltype","Math","round","y","state","total","xaxisDatakeyArr","x","onSelect","event","data","value","slice","label","datum","selectedItem","dataset","index","selectedChartItem","color","style","fill","_dataObj","invokeEventCallback","proxy","renderWidget","length","pieData","showlegend","chartHeight","styles","root","radius","min","innerRadius","donutratio","styleProp","labelRadius","showlabels","labels","display","origin","orientation","legendData","map","name","colors","createElement","_extends","LINECHART","onLayout","onViewLayoutChange","onInfoViewLayoutChange","flexDirection","alignItems","iconclass","icon","title","subHeading","subheading","onLegendViewLayoutChange","testStyle","legendText","dotStyle","legenedDot","justifyContent","flex","standalone","colorScale","_ref","endAngle","theme","key","isRTL","toReversed","labelPlacement","labelplacement","events","target","eventHandlers","OS","onClick","bind","onPress","textAnchor","text","centerlabel","maxWidth"],"sources":["pie-chart.component.tsx"],"sourcesContent":["import React from 'react';\nimport { LayoutChangeEvent, View, Text, Platform } from 'react-native';\nimport { Svg } from 'react-native-svg';\nimport { AccessibilityWidgetType, getAccessibilityProps } from '@wavemaker/app-rn-runtime/core/accessibility'; \n\nimport { VictoryLabel, VictoryLegend, VictoryPie } from 'victory-native';\n\nimport WmPieChartProps from './pie-chart.props';\nimport { DEFAULT_CLASS, WmPieChartStyles } from './pie-chart.styles';\n\nimport { formatCompactNumber } from '@wavemaker/app-rn-runtime/core/utils';\nimport WmIcon from '@wavemaker/app-rn-runtime/components/basic/icon/icon.component';\nimport {\n BaseChartComponent,\n BaseChartComponentState\n} from '@wavemaker/app-rn-runtime/components/chart/basechart.component';\nimport WmDonutChartProps from '@wavemaker/app-rn-runtime/components/chart/donut-chart/donut-chart.props';\nimport { Legend } from '../legend/legend.component';\n\n\nexport class WmPieChartState extends BaseChartComponentState<WmPieChartProps> {\n chartWidth = 0;\n totalHeight = 0;\n infoHeight = 10;\n legendWidth = 0;\n legendHeight = 0;\n opacity = 0;\n}\n\nexport default class WmPieChart extends BaseChartComponent<WmPieChartProps, WmPieChartState, WmPieChartStyles> {\n\n constructor(props: WmPieChartProps) {\n super(props, DEFAULT_CLASS, props.type === 'Donut' ? new WmDonutChartProps() : new WmPieChartProps(), new WmPieChartState());\n }\n\n componentDidMount() {\n super.componentDidMount();\n }\n\n onViewLayoutChange = (e: LayoutChangeEvent) => {\n let viewWidth = e.nativeEvent.layout.width;\n this.updateState({\n chartWidth: viewWidth,\n totalHeight: e.nativeEvent?.layout.height\n } as WmPieChartState)\n }\n\n onInfoViewLayoutChange = (e: LayoutChangeEvent) => {\n this.updateState({\n infoHeight: e.nativeEvent?.layout.height,\n opacity: 1\n } as WmPieChartState);\n }\n\n onLegendViewLayoutChange = (e: LayoutChangeEvent) => {\n this.updateState({\n legendWidth: e.nativeEvent?.layout.width,\n legendHeight: e.nativeEvent?.layout.height\n } as WmPieChartState);\n }\n\n getLabel(d: {x: any, y: any}, props: WmPieChartProps): string {\n switch(props.labeltype) {\n case 'percent': {\n return Math.round(d.y * 100 /this.state.total) + '%';\n }\n case 'key': {\n return this.state.xaxisDatakeyArr[d.x];\n }\n case 'value': {\n return formatCompactNumber(d.y);\n }\n case 'key-value': {\n return this.state.xaxisDatakeyArr[d.x] + ' ' + d.y;\n }\n }\n }\n\n onSelect(event: any, data: any){\n let value = data.slice.value;\n let label = this.state.xaxisDatakeyArr[data.datum.x];\n let selectedItem = this.props.dataset[data.index];\n let selectedChartItem = data.slice;\n selectedChartItem[\"data\"] = {x: label, y: value, color: data.style.fill, _dataObj: selectedItem}\n this.invokeEventCallback('onSelect', [event.nativeEvent, this.proxy, selectedItem, selectedChartItem ]);\n }\n\n renderWidget(props: WmPieChartProps) {\n this.invokeEventCallback('onBeforerender', [this.proxy, null]);\n if (!this.state.data.length) {\n return null;\n } \n const pieData = this.state.data[0];\n const chartWidth = this.state.chartWidth \n - (props.showlegend === 'right' ? this.state.legendWidth : 0);\n const chartHeight = (this.styles.root.height ? this.state.totalHeight : chartWidth) \n - this.state.infoHeight \n - (props.showlegend === 'right' ? 0 : this.state.legendHeight);\n let radius = (Math.min(chartWidth, chartHeight) - 40)/ 2;\n let innerRadius = props.donutratio * radius;\n let styleProp = {};\n let labelRadius;\n if (props.showlabels === 'hide') {\n styleProp={labels: { display: \"none\" }};\n } else if (props.showlabels === 'inside') {\n labelRadius = radius/2;\n } else {\n labelRadius = radius + 8;\n }\n const origin = {x: (chartWidth/2), y: (chartHeight/2)};\n const orientation = props.showlegend === 'right' ? 'vertical' : 'horizontal';\n let legendData = pieData.map((d: {x: any, y: any}, index: number) => {\n return {\n name: this.state.xaxisDatakeyArr[d.x],\n color: this.state.colors[index % (this.state.colors.length)]\n };\n });\n return (\n <View style={[{opacity: this.state.opacity}, this.styles.root]}\n {...getAccessibilityProps(AccessibilityWidgetType.LINECHART, props)}\n onLayout={this.onViewLayoutChange}>\n <View onLayout={this.onInfoViewLayoutChange}>\n <View style={{flexDirection: 'row', alignItems: 'center'}}>\n {props.iconclass ? (<WmIcon iconclass={props.iconclass} styles={this.styles.icon}></WmIcon>) : null }\n <Text style={this.styles.title}>{props.title}</Text>\n </View>\n <Text style={this.styles.subHeading}>{props.subheading}</Text>\n </View>\n {props.showlegend === 'top' ? \n (<View onLayout={this.onLegendViewLayoutChange}>\n <Legend data={legendData}\n testStyle={this.styles.legendText}\n dotStyle={this.styles.legenedDot}></Legend>\n </View>) : null }\n <View style={{flexDirection: 'row', justifyContent: 'center', alignItems: 'center'}}>\n <View style={{flex: 1}}>\n {chartWidth ? (\n <Svg\n width={chartWidth}\n height={chartHeight}\n >\n <VictoryPie\n style={styleProp}\n standalone={false}\n colorScale={this.state.colors}\n labels={({datum}) => this.getLabel(datum, props)}\n endAngle={this.state.endAngle || 0}\n radius={radius}\n innerRadius={innerRadius}\n theme={this.state.theme}\n key={props.name}\n name={props.name}\n data={this.isRTL?pieData.toReversed():pieData}\n origin={origin}\n labelPlacement={props.labelplacement}\n labelRadius={labelRadius}\n events={[{\n target: 'data',\n eventHandlers: Platform.OS == \"web\" ? {\n onClick: this.onSelect.bind(this)\n }:{\n onPress: this.onSelect.bind(this)\n }\n }]}\n />\n <VictoryLabel\n textAnchor=\"middle\"\n style={this.styles.title as any}\n x={origin.x} y={origin.y}\n text={props.centerlabel}\n />\n </Svg>) : null}\n </View>\n {props.showlegend === 'right' ? \n (<View style={{maxWidth: '50%'}} onLayout={this.onLegendViewLayoutChange}>\n <Legend data={legendData}\n testStyle={this.styles.legendText}\n dotStyle={this.styles.legenedDot}\n orientation='vertical'></Legend>\n </View>) : null }\n </View>\n {props.showlegend === 'bottom' ? \n (<View onLayout={this.onLegendViewLayoutChange}>\n <Legend data={legendData}\n testStyle={this.styles.legendText}\n dotStyle={this.styles.legenedDot}></Legend>\n </View>) : null }\n </View>\n );\n }\n}\n"],"mappings":";;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAA4BC,IAAI,EAAEC,IAAI,EAAEC,QAAQ,QAAQ,cAAc;AACtE,SAASC,GAAG,QAAQ,kBAAkB;AACtC,SAASC,uBAAuB,EAAEC,qBAAqB,QAAQ,8CAA8C;AAE7G,SAASC,YAAY,EAAiBC,UAAU,QAAQ,gBAAgB;AAExE,OAAOC,eAAe,MAAM,mBAAmB;AAC/C,SAASC,aAAa,QAA0B,oBAAoB;AAEpE,SAASC,mBAAmB,QAAQ,sCAAsC;AAC1E,OAAOC,MAAM,MAAM,gEAAgE;AACnF,SACEC,kBAAkB,EAClBC,uBAAuB,QAClB,gEAAgE;AACvE,OAAOC,iBAAiB,MAAM,0EAA0E;AACxG,SAASC,MAAM,QAAQ,4BAA4B;AAGnD,OAAO,MAAMC,eAAe,SAASH,uBAAuB,CAAkB;EAAAI,YAAA;IAAA,SAAAC,SAAA;IAAAC,eAAA,qBAC/D,CAAC;IAAAA,eAAA,sBACA,CAAC;IAAAA,eAAA,qBACF,EAAE;IAAAA,eAAA,sBACD,CAAC;IAAAA,eAAA,uBACA,CAAC;IAAAA,eAAA,kBACN,CAAC;EAAA;AACb;AAEA,eAAe,MAAMC,UAAU,SAASR,kBAAkB,CAAqD;EAE7GK,WAAWA,CAACI,KAAsB,EAAE;IAClC,KAAK,CAACA,KAAK,EAAEZ,aAAa,EAAEY,KAAK,CAACC,IAAI,KAAK,OAAO,GAAG,IAAIR,iBAAiB,CAAC,CAAC,GAAG,IAAIN,eAAe,CAAC,CAAC,EAAE,IAAIQ,eAAe,CAAC,CAAC,CAAC;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AAQ,gBAC3BxE,KAAA,CAAA2F,aAAA,CAAC1F,IAAI;MAAC6F,QAAQ,EAAE,IAAI,CAACU;IAAyB,gBAC7CxG,KAAA,CAAA2F,aAAA,CAAC3E,MAAM;MAACsC,IAAI,EAAEiC,UAAW;MACvBkB,SAAS,EAAE,IAAI,CAAC/B,MAAM,CAACgC,UAAW;MAClCC,QAAQ,EAAE,IAAI,CAACjC,MAAM,CAACkC;IAAW,CAAS,CACxC,CAAC,GAAI,IACT,CAAC;EAEX;AACF"}
@@ -1,3 +1,4 @@
1
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
1
2
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
2
3
  function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
3
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); }
@@ -6,7 +7,8 @@ import { View, Platform } from 'react-native';
6
7
  import { Svg } from 'react-native-svg';
7
8
  import { VictoryStack, VictoryBar, VictoryChart, VictoryPie, VictoryLegend, VictoryAxis } from 'victory-native';
8
9
  import { Axis, Scale } from 'victory-core';
9
- import { orderBy, cloneDeep } from 'lodash';
10
+ import { orderBy, cloneDeep, findIndex, isString } from 'lodash';
11
+ import { AccessibilityWidgetType, getAccessibilityProps } from '@wavemaker/app-rn-runtime/core/accessibility';
10
12
  import WmStackChartProps from './stack-chart.props';
11
13
  import { DEFAULT_CLASS } from './stack-chart.styles';
12
14
  import { BaseChartComponent, BaseChartComponentState } from '@wavemaker/app-rn-runtime/components/chart/basechart.component';
@@ -40,10 +42,30 @@ export default class WmStackChart extends BaseChartComponent {
40
42
  positiveValuesArray = orderBy(positiveValuesArray, 'y', 'asc');
41
43
  return positiveValuesArray;
42
44
  }
45
+ getData() {
46
+ const negativeValues = cloneDeep(this.getNegativeValuesArray());
47
+ return negativeValues.concat(cloneDeep(this.getPositiveValuesArray()));
48
+ }
49
+ updateColors() {
50
+ if (this.state.colors.length === 1) {
51
+ return this.state.colors[0];
52
+ } else {
53
+ let colorCodes = cloneDeep(this.state.colors);
54
+ ;
55
+ if (this.state.data.length > 0) {
56
+ const orderedData = this.getData();
57
+ this.state.data[0].map((d, i) => {
58
+ let index = findIndex(orderedData, d);
59
+ colorCodes[index] = this.state.colors[i];
60
+ });
61
+ return colorCodes;
62
+ }
63
+ }
64
+ }
43
65
  getBarChart(props) {
44
66
  if (this.state.data.length > 0) {
45
67
  const negativeValues = cloneDeep(this.getNegativeValuesArray());
46
- const data = negativeValues.concat(cloneDeep(this.getPositiveValuesArray()));
68
+ const data = this.getData();
47
69
  let currentValue = 0;
48
70
  return data.map((d, i) => {
49
71
  let d1 = [];
@@ -65,8 +87,8 @@ export default class WmStackChart extends BaseChartComponent {
65
87
  }
66
88
  }
67
89
  getColorCodes() {
68
- const colors = cloneDeep(this.state.colors);
69
- return colors.reverse();
90
+ const colors = cloneDeep(this.updateColors());
91
+ return isString(colors) ? [colors] : colors.reverse();
70
92
  }
71
93
  getArcChart(props) {
72
94
  if (this.state.data.length > 0) {
@@ -147,6 +169,8 @@ export default class WmStackChart extends BaseChartComponent {
147
169
  } else {
148
170
  ticks[0] = minValue;
149
171
  }
172
+ } else {
173
+ ticks[0] = this.state.props.minvalue;
150
174
  }
151
175
  }
152
176
  return ticks;
@@ -172,15 +196,14 @@ export default class WmStackChart extends BaseChartComponent {
172
196
  x: this.props.xdomain === 'Min' ? this.state.chartMinX : undefined,
173
197
  y: this.props.ydomain === 'Min' ? this.state.chartMinY : undefined
174
198
  };
175
- const colorScale = this.state.colors.length === 1 ? this.state.colors[0] : this.state.colors;
176
- return /*#__PURE__*/React.createElement(View, {
199
+ return /*#__PURE__*/React.createElement(View, _extends({}, getAccessibilityProps(AccessibilityWidgetType.LINECHART, props), {
177
200
  style: this.styles.root,
178
201
  onLayout: this.onViewLayoutChange
179
- }, props.viewtype === 'Bar' ? /*#__PURE__*/React.createElement(VictoryChart, {
202
+ }), props.viewtype === 'Bar' ? /*#__PURE__*/React.createElement(VictoryChart, {
180
203
  theme: this.state.theme,
181
204
  minDomain: mindomain,
182
205
  height: this.styles.root.height,
183
- width: this.styles.root.width || this.screenWidth,
206
+ width: this.styles.root.width || this.state.chartWidth,
184
207
  padding: {
185
208
  top: props.offsettop,
186
209
  bottom: props.offsetbottom,
@@ -202,7 +225,7 @@ export default class WmStackChart extends BaseChartComponent {
202
225
  gutter: 20,
203
226
  data: [],
204
227
  theme: this.state.theme
205
- }), this.getLegendView(colorScale), /*#__PURE__*/React.createElement(VictoryAxis, {
228
+ }), this.getLegendView(this.updateColors()), /*#__PURE__*/React.createElement(VictoryAxis, {
206
229
  crossAxis: true,
207
230
  style: {
208
231
  tickLabels: {
@@ -222,7 +245,7 @@ export default class WmStackChart extends BaseChartComponent {
222
245
  tickFormat: t => this.state.props.yunits ? `${this.abbreviateNumber(t)}${this.state.props.yunits}` : `${this.abbreviateNumber(t)}`,
223
246
  dependentAxis: true
224
247
  }), /*#__PURE__*/React.createElement(VictoryStack, {
225
- colorScale: colorScale,
248
+ colorScale: this.updateColors(),
226
249
  horizontal: true,
227
250
  style: {
228
251
  data: {
@@ -1 +1 @@
1
- {"version":3,"names":["React","View","Platform","Svg","VictoryStack","VictoryBar","VictoryChart","VictoryPie","VictoryLegend","VictoryAxis","Axis","Scale","orderBy","cloneDeep","WmStackChartProps","DEFAULT_CLASS","BaseChartComponent","BaseChartComponentState","WmStackChartState","constructor","arguments","_defineProperty","WmStackChart","props","e","viewWidth","nativeEvent","layout","width","updateState","chartWidth","componentDidMount","setHeightWidthOnChart","getNegativeValuesArray","negativeValuesArray","state","data","filter","d","y","getPositiveValuesArray","positiveValuesArray","getBarChart","length","negativeValues","concat","currentValue","map","i","d1","x","push","createElement","key","name","cornerRadius","bottomLeft","bottomRight","topLeft","topRight","getColorCodes","colors","reverse","getArcChart","colorScaleArray","maxValue","Math","max","o","radius","min","chartHeight","colorScale","startAngle","endAngle","standalone","origin","innerRadius","thickness","labels","getArcAxis","ticks","getTickValues","axisData","forEach","yunits","style","fontSize","paddingLeft","paddingRight","labelRadius","minValue","scale","getBaseScale","domain","getTicks","unshift","onSelect","event","value","index","label","xaxisDatakeyArr","datum","selectedItem","dataset","selectedChartItem","series","_dataObj","invokeEventCallback","proxy","renderWidget","mindomain","xdomain","chartMinX","undefined","ydomain","chartMinY","styles","root","onLayout","onViewLayoutChange","viewtype","theme","minDomain","height","screenWidth","padding","top","offsettop","bottom","offsetbottom","left","offsetleft","right","offsetright","containerComponent","getTooltip","title","fontFamily","subheading","orientation","gutter","getLegendView","crossAxis","tickLabels","fill","showyaxis","axisLabel","grid","stroke","tickValues","tickFormat","t","abbreviateNumber","dependentAxis","horizontal","strokeWidth","events","target","eventHandlers","OS","onClick","bind","onPress"],"sources":["stack-chart.component.tsx"],"sourcesContent":["import React from 'react';\nimport { LayoutChangeEvent, View, Platform } from 'react-native';\nimport { Svg } from 'react-native-svg';\nimport { VictoryStack, VictoryBar, VictoryChart, VictoryPie, VictoryLegend, VictoryAxis } from 'victory-native';\nimport { Axis, Scale } from 'victory-core';\nimport { orderBy, cloneDeep } from 'lodash';\n\nimport WmStackChartProps from './stack-chart.props';\nimport { DEFAULT_CLASS, WmStackChartStyles } from './stack-chart.styles';\nimport {\n BaseChartComponent,\n BaseChartComponentState\n} from '@wavemaker/app-rn-runtime/components/chart/basechart.component';\n\nexport class WmStackChartState extends BaseChartComponentState<WmStackChartProps> {\n chartWidth = 0;\n}\n\nexport default class WmStackChart extends BaseChartComponent<WmStackChartProps, WmStackChartState, WmStackChartStyles> {\n constructor(props: WmStackChartProps) {\n super(props, DEFAULT_CLASS, new WmStackChartProps(), new WmStackChartState());\n }\n\n componentDidMount() {\n super.componentDidMount();\n this.setHeightWidthOnChart();\n }\n\n getNegativeValuesArray() {\n let negativeValuesArray = cloneDeep(this.state.data[0]).filter((d: any) => d.y < 0);\n negativeValuesArray = orderBy(negativeValuesArray, 'y', 'desc');\n return negativeValuesArray;\n }\n\n getPositiveValuesArray() {\n let positiveValuesArray = cloneDeep(this.state.data[0]).filter((d: any) => d.y > 0);\n positiveValuesArray = orderBy(positiveValuesArray, 'y', 'asc');\n return positiveValuesArray;\n }\n\n getBarChart(props: WmStackChartProps) {\n if ( this.state.data.length > 0 ) {\n const negativeValues = cloneDeep(this.getNegativeValuesArray());\n const data = negativeValues.concat(cloneDeep(this.getPositiveValuesArray()));\n let currentValue = 0;\n\n return data.map((d: any, i: number) => {\n let d1: any = [];\n d.x = 0;\n d.y = d.y - currentValue;\n d1.push(d);\n currentValue = d.y < 0 && i === negativeValues.length -1 ? 0 : d.y + currentValue;\n return <VictoryBar key={props.name + '_' + i}\n cornerRadius={{bottomLeft:(1), bottomRight:(1), topLeft:(1), topRight:(1)}}\n data={d1}/>\n });\n }\n }\n\n private getColorCodes() {\n const colors = cloneDeep(this.state.colors);\n return colors.reverse();\n }\n\n getArcChart(props: WmStackChartProps) {\n if ( this.state.data.length > 0 ) {\n let data = cloneDeep(this.state.data[0]);\n const colorScaleArray = this.getColorCodes();\n const maxValue = Math.max(...data.map((o: any) => o.y));\n data = orderBy(data, 'y', 'desc');\n const radius = Math.min(this.state.chartWidth/2, this.state.chartHeight - 50);\n return data.map((d: any, i: number) => {\n let d1: any = [];\n d1.push(d);\n d1.push({x: d.x, y: maxValue - d.y})\n return <VictoryPie key={props.name + '_' + i}\n radius={radius}\n colorScale={[colorScaleArray[i], '#fff0']}\n startAngle={-80}\n endAngle={80}\n cornerRadius={100}\n standalone={false}\n origin={{x: (this.state.chartWidth/2), y: (this.state.chartHeight - 50)}}\n innerRadius={radius - this.state.props.thickness}\n labels={[]}\n data={d1}/>\n });\n }\n }\n\n getArcAxis() {\n const ticks = this.getTickValues();\n const radius = Math.min(this.state.chartWidth/2, this.state.chartHeight-50);\n const axisData: any = [];\n ticks.forEach((d: any, i: any) => {\n axisData.push({x: `${this.state.props.yunits}${d}`, y: 1})\n });\n return <VictoryPie\n style={{\n labels: {\n fontSize: 12, paddingLeft: 50, paddingRight: 80\n }}\n }\n startAngle={-90}\n endAngle={90}\n standalone={false}\n colorScale={['#fff0']}\n origin={{x: (this.state.chartWidth/2 - 5), y: (this.state.chartHeight - 50)}}\n labelRadius={radius - this.state.props.thickness - 20}\n data={axisData}\n />\n }\n\n onViewLayoutChange = (e: LayoutChangeEvent) => {\n let viewWidth = e.nativeEvent.layout.width;\n this.updateState({\n chartWidth: viewWidth\n } as WmStackChartState);\n }\n\n getTickValues() {\n let ticks: any = [];\n if (this.state.data[0].length) {\n let data = cloneDeep(this.state.data[0]);\n const maxValue = Math.max(...data.map((o: any) => o.y));\n const minValue = Math.min(...data.map((o: any) => o.y));\n const scale = Scale.getBaseScale({}, 'x');\n scale.domain([minValue > 0 ? 0 : minValue, maxValue]);\n ticks = Axis.getTicks({}, scale);\n ticks[ticks.length -1] = maxValue;\n if ( minValue < 0 ) {\n if (ticks[0] === 0) {\n ticks.unshift(minValue);\n } else {\n ticks[0] = minValue;\n }\n }\n }\n return ticks;\n }\n\n onSelect(event: any, data: any){\n let value = data.data[data.index].y;\n let label = this.state.xaxisDatakeyArr[data.datum.x];\n let selectedItem = this.props.dataset[data.index];\n let selectedChartItem = [{series: 0, x: data.index, y: value,_dataObj: selectedItem},data.index];\n this.invokeEventCallback('onSelect', [event.nativeEvent, this.proxy, selectedItem, selectedChartItem ]);\n }\n\n renderWidget(props: WmStackChartProps) {\n this.invokeEventCallback('onBeforerender', [this.proxy, null]);\n if (!this.state.data.length) {\n return null;\n }\n let mindomain={x: this.props.xdomain === 'Min' ? this.state.chartMinX: undefined, y: this.props.ydomain === 'Min' ? this.state.chartMinY: undefined};\n const colorScale = this.state.colors.length === 1 ? this.state.colors[0] : this.state.colors;\n return (\n <View\n style={this.styles.root} onLayout={this.onViewLayoutChange}\n >{\n props.viewtype === 'Bar' ?\n <VictoryChart\n theme={this.state.theme}\n minDomain={mindomain}\n height={this.styles.root.height as number}\n width={this.styles.root.width as number || this.screenWidth}\n padding={{\n top: props.offsettop,\n bottom: props.offsetbottom,\n left: props.offsetleft,\n right: props.offsetright\n }}\n containerComponent={\n this.getTooltip(props)\n }\n >\n <VictoryLegend\n name={'legend'}\n containerComponent={<Svg />}\n style={{title: {\n fontFamily: \"'Helvetica Neue', 'Helvetica', sans-serif\",\n fontSize: 18\n }\n }}\n title={[props.title, props.subheading]}\n orientation=\"horizontal\"\n gutter={20}\n data={[]}\n theme={this.state.theme}\n />\n {this.getLegendView(colorScale)}\n <VictoryAxis crossAxis\n style={{\n tickLabels: { fill: this.state.props.showyaxis === false ? 'transparent' : '#000000', fontSize: 12, padding: this.state.props.thickness/2 + 5},\n axisLabel: { padding: (15 + this.state.props.thickness/2) },\n grid: {stroke: 'none'}\n }}\n theme={this.state.theme}\n tickValues={this.getTickValues()}\n tickFormat={(t) => this.state.props.yunits ? `${this.abbreviateNumber(t)}${this.state.props.yunits}` : `${this.abbreviateNumber(t)}`} dependentAxis />\n <VictoryStack\n colorScale={colorScale}\n horizontal={true}\n style={{\n data: { strokeWidth: this.state.props.thickness }\n }}\n events={[{\n target: 'data',\n eventHandlers: Platform.OS == \"web\" ? {\n onClick: this.onSelect.bind(this)\n }:{\n onPress: this.onSelect.bind(this)\n }\n }]}\n >\n {\n this.getBarChart(props)\n }\n </VictoryStack>\n </VictoryChart> :\n <Svg width={this.state.chartWidth} height={this.state.chartHeight}>\n <VictoryLegend\n name={'legend'}\n containerComponent={<Svg />}\n title={[props.title, props.subheading]}\n orientation=\"horizontal\"\n gutter={20}\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ACxBC,MAAM,EAAE,EAAG;MACX1G,IAAI,EAAE,EAAG;MACTuF,KAAK,EAAE,IAAI,CAACxF,KAAK,CAACwF;IAAM,CACzB,CAAC,EACD,IAAI,CAAC5D,WAAW,CAACxC,KAAK,CAAC,EACvB,IAAI,CAACyD,UAAU,CAAC,CACd,CAEH,CAAC;EAEX;AACF"}
1
+ {"version":3,"names":["React","View","Platform","Svg","VictoryStack","VictoryBar","VictoryChart","VictoryPie","VictoryLegend","VictoryAxis","Axis","Scale","orderBy","cloneDeep","findIndex","isString","AccessibilityWidgetType","getAccessibilityProps","WmStackChartProps","DEFAULT_CLASS","BaseChartComponent","BaseChartComponentState","WmStackChartState","constructor","arguments","_defineProperty","WmStackChart","props","e","viewWidth","nativeEvent","layout","width","updateState","chartWidth","componentDidMount","setHeightWidthOnChart","getNegativeValuesArray","negativeValuesArray","state","data","filter","d","y","getPositiveValuesArray","positiveValuesArray","getData","negativeValues","concat","updateColors","colors","length","colorCodes","orderedData","map","i","index","getBarChart","currentValue","d1","x","push","createElement","key","name","cornerRadius","bottomLeft","bottomRight","topLeft","topRight","getColorCodes","reverse","getArcChart","colorScaleArray","maxValue","Math","max","o","radius","min","chartHeight","colorScale","startAngle","endAngle","standalone","origin","innerRadius","thickness","labels","getArcAxis","ticks","getTickValues","axisData","forEach","yunits","style","fontSize","paddingLeft","paddingRight","labelRadius","minValue","scale","getBaseScale","domain","getTicks","unshift","minvalue","onSelect","event","value","label","xaxisDatakeyArr","datum","selectedItem","dataset","selectedChartItem","series","_dataObj","invokeEventCallback","proxy","renderWidget","mindomain","xdomain","chartMinX","undefined","ydomain","chartMinY","_extends","LINECHART","styles","root","onLayout","onViewLayoutChange","viewtype","theme","minDomain","height","padding","top","offsettop","bottom","offsetbottom","left","offsetleft","right","offsetright","containerComponent","getTooltip","title","fontFamily","subheading","orientation","gutter","getLegendView","crossAxis","tickLabels","fill","showyaxis","axisLabel","grid","stroke","tickValues","tickFormat","t","abbreviateNumber","dependentAxis","horizontal","strokeWidth","events","target","eventHandlers","OS","onClick","bind","onPress"],"sources":["stack-chart.component.tsx"],"sourcesContent":["import React from 'react';\nimport { LayoutChangeEvent, View, Platform } from 'react-native';\nimport { Svg } from 'react-native-svg';\nimport { VictoryStack, VictoryBar, VictoryChart, VictoryPie, VictoryLegend, VictoryAxis } from 'victory-native';\nimport { Axis, Scale } from 'victory-core';\nimport { orderBy, cloneDeep, findIndex, isString} from 'lodash';\nimport { AccessibilityWidgetType, getAccessibilityProps } from '@wavemaker/app-rn-runtime/core/accessibility'; \nimport WmStackChartProps from './stack-chart.props';\nimport { DEFAULT_CLASS, WmStackChartStyles } from './stack-chart.styles';\nimport {\n BaseChartComponent,\n BaseChartComponentState\n} from '@wavemaker/app-rn-runtime/components/chart/basechart.component';\n\nexport class WmStackChartState extends BaseChartComponentState<WmStackChartProps> {\n chartWidth = 0;\n}\n\nexport default class WmStackChart extends BaseChartComponent<WmStackChartProps, WmStackChartState, WmStackChartStyles> {\n constructor(props: WmStackChartProps) {\n super(props, DEFAULT_CLASS, new WmStackChartProps(), new WmStackChartState());\n }\n\n componentDidMount() {\n super.componentDidMount();\n this.setHeightWidthOnChart();\n }\n\n getNegativeValuesArray() {\n let negativeValuesArray = cloneDeep(this.state.data[0]).filter((d: any) => d.y < 0);\n negativeValuesArray = orderBy(negativeValuesArray, 'y', 'desc');\n return negativeValuesArray;\n }\n\n getPositiveValuesArray() {\n let positiveValuesArray = cloneDeep(this.state.data[0]).filter((d: any) => d.y > 0);\n positiveValuesArray = orderBy(positiveValuesArray, 'y', 'asc');\n return positiveValuesArray;\n }\n\n getData() {\n const negativeValues = cloneDeep(this.getNegativeValuesArray());\n return negativeValues.concat(cloneDeep(this.getPositiveValuesArray()));\n }\n\n updateColors() {\n if (this.state.colors.length === 1 ) {\n return this.state.colors[0];\n } else {\n let colorCodes = cloneDeep(this.state.colors);;\n if ( this.state.data.length > 0 ) {\n const orderedData = this.getData();\n this.state.data[0].map((d: any, i: number) => {\n let index = findIndex(orderedData, d);\n colorCodes[index] = this.state.colors[i];\n })\n return colorCodes;\n }\n }\n }\n\n getBarChart(props: WmStackChartProps) {\n if ( this.state.data.length > 0 ) {\n const negativeValues = cloneDeep(this.getNegativeValuesArray());\n const data = this.getData();\n let currentValue = 0;\n\n return data.map((d: any, i: number) => {\n let d1: any = [];\n d.x = 0;\n d.y = d.y - currentValue;\n d1.push(d);\n currentValue = d.y < 0 && i === negativeValues.length -1 ? 0 : d.y + currentValue;\n return <VictoryBar key={props.name + '_' + i}\n cornerRadius={{bottomLeft:(1), bottomRight:(1), topLeft:(1), topRight:(1)}}\n data={d1}/>\n });\n }\n }\n\n private getColorCodes() {\n const colors = cloneDeep(this.updateColors());\n return isString(colors) ? [colors] : colors.reverse();\n }\n\n getArcChart(props: WmStackChartProps) {\n if ( this.state.data.length > 0 ) {\n let data = cloneDeep(this.state.data[0]);\n const colorScaleArray = this.getColorCodes();\n const maxValue = Math.max(...data.map((o: any) => o.y));\n data = orderBy(data, 'y', 'desc');\n const radius = Math.min(this.state.chartWidth/2, this.state.chartHeight - 50);\n return data.map((d: any, i: number) => {\n let d1: any = [];\n d1.push(d);\n d1.push({x: d.x, y: maxValue - d.y})\n return <VictoryPie key={props.name + '_' + i}\n radius={radius}\n colorScale={[colorScaleArray[i], '#fff0']}\n startAngle={-80}\n endAngle={80}\n cornerRadius={100}\n standalone={false}\n origin={{x: (this.state.chartWidth/2), y: (this.state.chartHeight - 50)}}\n innerRadius={radius - this.state.props.thickness}\n labels={[]}\n data={d1}/>\n });\n }\n }\n\n getArcAxis() {\n const ticks = this.getTickValues();\n const radius = Math.min(this.state.chartWidth/2, this.state.chartHeight-50);\n const axisData: any = [];\n ticks.forEach((d: any, i: any) => {\n axisData.push({x: `${this.state.props.yunits}${d}`, y: 1})\n });\n return <VictoryPie\n style={{\n labels: {\n fontSize: 12, paddingLeft: 50, paddingRight: 80\n }}\n }\n startAngle={-90}\n endAngle={90}\n standalone={false}\n colorScale={['#fff0']}\n origin={{x: (this.state.chartWidth/2 - 5), y: (this.state.chartHeight - 50)}}\n labelRadius={radius - this.state.props.thickness - 20}\n data={axisData}\n />\n }\n\n onViewLayoutChange = (e: LayoutChangeEvent) => {\n let viewWidth = e.nativeEvent.layout.width;\n this.updateState({\n chartWidth: viewWidth\n } as WmStackChartState);\n }\n\n getTickValues() {\n let ticks: any = [];\n if (this.state.data[0].length) {\n let data = cloneDeep(this.state.data[0]);\n const maxValue = Math.max(...data.map((o: any) => o.y));\n const minValue = Math.min(...data.map((o: any) => o.y));\n const scale = Scale.getBaseScale({}, 'x');\n scale.domain([minValue > 0 ? 0 : minValue, maxValue]);\n ticks = Axis.getTicks({}, scale);\n ticks[ticks.length -1] = maxValue;\n if ( minValue < 0 ) {\n if (ticks[0] === 0) {\n ticks.unshift(minValue);\n } else {\n ticks[0] = minValue;\n }\n } else {\n ticks[0] = this.state.props.minvalue;\n }\n }\n return ticks;\n }\n\n onSelect(event: any, data: any){\n let value = data.data[data.index].y;\n let label = this.state.xaxisDatakeyArr[data.datum.x];\n let selectedItem = this.props.dataset[data.index];\n let selectedChartItem = [{series: 0, x: data.index, y: value,_dataObj: selectedItem},data.index];\n this.invokeEventCallback('onSelect', [event.nativeEvent, this.proxy, selectedItem, selectedChartItem ]);\n }\n\n renderWidget(props: WmStackChartProps) {\n this.invokeEventCallback('onBeforerender', [this.proxy, null]);\n if (!this.state.data.length) {\n return null;\n }\n let mindomain={x: this.props.xdomain === 'Min' ? this.state.chartMinX: undefined, y: this.props.ydomain === 'Min' ? this.state.chartMinY: undefined};\n return (\n <View\n {...getAccessibilityProps(AccessibilityWidgetType.LINECHART, props)}\n style={this.styles.root} onLayout={this.onViewLayoutChange}\n >{\n props.viewtype === 'Bar' ?\n <VictoryChart\n theme={this.state.theme}\n minDomain={mindomain}\n height={this.styles.root.height as number}\n width={this.styles.root.width as number || this.state.chartWidth}\n padding={{\n top: props.offsettop,\n bottom: props.offsetbottom,\n left: props.offsetleft,\n right: props.offsetright\n }}\n containerComponent={\n this.getTooltip(props)\n }\n >\n <VictoryLegend\n name={'legend'}\n containerComponent={<Svg />}\n style={{title: {\n fontFamily: \"'Helvetica Neue', 'Helvetica', sans-serif\",\n fontSize: 18\n }\n }}\n title={[props.title, props.subheading]}\n orientation=\"horizontal\"\n gutter={20}\n data={[]}\n theme={this.state.theme}\n />\n {this.getLegendView(this.updateColors())}\n <VictoryAxis crossAxis\n style={{\n tickLabels: { fill: this.state.props.showyaxis === false ? 'transparent' : '#000000', fontSize: 12, padding: this.state.props.thickness/2 + 5},\n axisLabel: { padding: (15 + this.state.props.thickness/2) },\n grid: {stroke: 'none'}\n }}\n theme={this.state.theme}\n tickValues={this.getTickValues()}\n tickFormat={(t) => this.state.props.yunits ? `${this.abbreviateNumber(t)}${this.state.props.yunits}` : `${this.abbreviateNumber(t)}`} dependentAxis />\n <VictoryStack\n colorScale={this.updateColors()}\n horizontal={true}\n style={{\n data: { strokeWidth: this.state.props.thickness }\n }}\n events={[{\n target: 'data',\n eventHandlers: Platform.OS == \"web\" ? {\n onClick: this.onSelect.bind(this)\n }:{\n onPress: this.onSelect.bind(this)\n }\n }]}\n >\n {\n this.getBarChart(props)\n }\n </VictoryStack>\n </VictoryChart> :\n <Svg width={this.state.chartWidth} height={this.state.chartHeight}>\n <VictoryLegend\n name={'legend'}\n containerComponent={<Svg />}\n title={[props.title, props.subheading]}\n orientation=\"horizontal\"\n gutter={20}\n data={[]}\n theme={this.state.theme}\n />\n {this.getArcChart(props)}\n {this.getArcAxis()}\n </Svg>\n }\n </View>\n );\n }\n}\n"],"mappings":";;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAA4BC,IAAI,EAAEC,QAAQ,QAAQ,cAAc;AAChE,SAASC,GAAG,QAAQ,kBAAkB;AACtC,SAASC,YAAY,EAAEC,UAAU,EAAEC,YAAY,EAAEC,UAAU,EAAEC,aAAa,EAAEC,WAAW,QAAQ,gBAAgB;AAC/G,SAASC,IAAI,EAAEC,KAAK,QAAQ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ACPC,MAAM,EAAE,MAAM;QACdC,aAAa,EAAExK,QAAQ,CAACyK,EAAE,IAAI,KAAK,GAAG;UACpCC,OAAO,EAAE,IAAI,CAACjE,QAAQ,CAACkE,IAAI,CAAC,IAAI;QAClC,CAAC,GAAC;UACAC,OAAO,EAAE,IAAI,CAACnE,QAAQ,CAACkE,IAAI,CAAC,IAAI;QAClC;MACF,CAAC;IAAE,GAGD,IAAI,CAACpH,WAAW,CAAC9B,KAAK,CAEZ,CACF,CAAC,gBACf3B,KAAA,CAAA8D,aAAA,CAAC3D,GAAG;MAAC6B,KAAK,EAAE,IAAI,CAACO,KAAK,CAACL,UAAW;MAACsG,MAAM,EAAE,IAAI,CAACjG,KAAK,CAACyC;IAAY,gBAChEhF,KAAA,CAAA8D,aAAA,CAACtD,aAAa;MACZwD,IAAI,EAAE,QAAS;MACfkF,kBAAkB,eAAElJ,KAAA,CAAA8D,aAAA,CAAC3D,GAAG,MAAE,CAAE;MAC5BiJ,KAAK,EAAE,CAACzH,KAAK,CAACyH,KAAK,EAAEzH,KAAK,CAAC2H,UAAU,CAAE;MACvCC,WAAW,EAAC,YAAY;MACxBC,MAAM,EAAE,EAAG;MACXhH,IAAI,EAAE,EAAG;MACT8F,KAAK,EAAE,IAAI,CAAC/F,KAAK,CAAC+F;IAAM,CACzB,CAAC,EACD,IAAI,CAAC9D,WAAW,CAAC7C,KAAK,CAAC,EACvB,IAAI,CAAC8D,UAAU,CAAC,CACd,CAEH,CAAC;EAEX;AACF"}
@@ -11,6 +11,7 @@ export default class WmStackChartProps extends BaseChartComponentProps {
11
11
  _defineProperty(this, "offsetleft", 25);
12
12
  _defineProperty(this, "offsetright", 35);
13
13
  _defineProperty(this, "onSelect", void 0);
14
+ _defineProperty(this, "minvalue", 0);
14
15
  }
15
16
  }
16
17
  //# sourceMappingURL=stack-chart.props.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["BaseChartComponentProps","WmStackChartProps","constructor","arguments","_defineProperty"],"sources":["stack-chart.props.ts"],"sourcesContent":["import BaseChartComponentProps from '@wavemaker/app-rn-runtime/components/chart/basechart.props';\n\nexport default class WmStackChartProps extends BaseChartComponentProps {\n viewtype: string = 'Bar';\n showlegend: string = 'left';\n thickness: number = 20;\n offsetleft: number = 25;\n offsetright: number = 35;\n onSelect?: any;\n}\n"],"mappings":";;;AAAA,OAAOA,uBAAuB,MAAM,4DAA4D;AAEhG,eAAe,MAAMC,iBAAiB,SAASD,uBAAuB,CAAC;EAAAE,YAAA;IAAA,SAAAC,SAAA;IAAAC,eAAA,mBAClD,KAAK;IAAAA,eAAA,qBACH,MAAM;IAAAA,eAAA,oBACP,EAAE;IAAAA,eAAA,qBACD,EAAE;IAAAA,eAAA,sBACD,EAAE;IAAAA,eAAA;EAAA;AAE1B"}
1
+ {"version":3,"names":["BaseChartComponentProps","WmStackChartProps","constructor","arguments","_defineProperty"],"sources":["stack-chart.props.ts"],"sourcesContent":["import BaseChartComponentProps from '@wavemaker/app-rn-runtime/components/chart/basechart.props';\n\nexport default class WmStackChartProps extends BaseChartComponentProps {\n viewtype: string = 'Bar';\n showlegend: string = 'left';\n thickness: number = 20;\n offsetleft: number = 25;\n offsetright: number = 35;\n onSelect?: any;\n minvalue: number = 0;\n}\n"],"mappings":";;;AAAA,OAAOA,uBAAuB,MAAM,4DAA4D;AAEhG,eAAe,MAAMC,iBAAiB,SAASD,uBAAuB,CAAC;EAAAE,YAAA;IAAA,SAAAC,SAAA;IAAAC,eAAA,mBAClD,KAAK;IAAAA,eAAA,qBACH,MAAM;IAAAA,eAAA,oBACP,EAAE;IAAAA,eAAA,qBACD,EAAE;IAAAA,eAAA,sBACD,EAAE;IAAAA,eAAA;IAAAA,eAAA,mBAEL,CAAC;EAAA;AACtB"}
@@ -0,0 +1,215 @@
1
+ import _ from "lodash";
2
+ const dataTypeJSON = ['Column', 'Line', 'Pie', 'Bar', 'Donut', 'Bubble'];
3
+ const SAMPLE_DATA1 = {
4
+ 'group1': 'Europe',
5
+ 'group2': 'Asia',
6
+ 'group3': 'America',
7
+ 'group4': 'Australia'
8
+ };
9
+ const SAMPLE_DATA = {
10
+ 'group1': '01/01/2001',
11
+ 'group2': '01/01/2002',
12
+ 'group3': '01/01/2003'
13
+ };
14
+ const SAMPLE_DATA2 = {
15
+ 'group1': '78.6',
16
+ 'group2': '79',
17
+ 'group3': '80',
18
+ 'group4': '80.66'
19
+ };
20
+ export const chartTypes = ['Column', 'Line', 'Area', 'Cumulative Line', 'Bar', 'Pie', 'Donut', 'Bubble'];
21
+ export const isPieChart = type => type === 'Pie';
22
+
23
+ // returns true if chart type is line
24
+ export const isLineChart = type => type === 'Line';
25
+
26
+ // returns true if chart type is bar
27
+ export const isBarChart = type => type === 'Bar';
28
+
29
+ // returns true if chart type is donut
30
+ export const isDonutChart = type => type === 'Donut';
31
+
32
+ // returns true if chart type is bubble
33
+ export const isBubbleChart = type => type === 'Bubble';
34
+ export const isAreaChart = type => type === 'Area';
35
+
36
+ // returns true if chart type is column
37
+ export const isColumnChart = type => type === 'Column';
38
+ export const isPieType = type => isPieChart(type) || isDonutChart(type);
39
+
40
+ // The format of chart data is array of json objects in case of the following types of chart
41
+ export const isChartDataJSON = type => _.includes(dataTypeJSON, type) || !_.includes(chartTypes, type);
42
+ export const constructSampleData = (dataType, yaxisLength, shape) => {
43
+ let first_series = [],
44
+ second_series = [],
45
+ third_series = [],
46
+ first_series_array = [],
47
+ second_series_array = [],
48
+ third_series_array = [],
49
+ data = [];
50
+ switch (dataType) {
51
+ case 'jsonFormat':
52
+ first_series = [{
53
+ 'x': '01/01/2001',
54
+ 'y': 4000000
55
+ }, {
56
+ 'x': '01/01/2002',
57
+ 'y': 1000000
58
+ }, {
59
+ 'x': '01/01/2003',
60
+ 'y': 5000000
61
+ }];
62
+ second_series = [{
63
+ 'x': '01/01/2001',
64
+ 'y': 3000000
65
+ }, {
66
+ 'x': '01/01/2002',
67
+ 'y': 4000000
68
+ }, {
69
+ 'x': '01/01/2003',
70
+ 'y': 7000000
71
+ }];
72
+ third_series = [{
73
+ 'x': '01/01/2001',
74
+ 'y': 2000000
75
+ }, {
76
+ 'x': '01/01/2002',
77
+ 'y': 8000000
78
+ }, {
79
+ 'x': '01/01/2003',
80
+ 'y': 6000000
81
+ }];
82
+ data[0] = {
83
+ values: first_series,
84
+ key: SAMPLE_DATA.group1
85
+ };
86
+ if (yaxisLength >= 2) {
87
+ data[1] = {
88
+ values: second_series,
89
+ key: SAMPLE_DATA.group2
90
+ };
91
+ }
92
+ if (yaxisLength >= 3) {
93
+ data[2] = {
94
+ values: third_series,
95
+ key: SAMPLE_DATA.group3
96
+ };
97
+ }
98
+ break;
99
+ case 'arrayFormat':
100
+ first_series_array = [[1, 4000000], [2, 1000000], [3, 5000000]];
101
+ second_series_array = [[1, 3000000], [2, 4000000], [3, 7000000]];
102
+ third_series_array = [[1, 2000000], [2, 8000000], [3, 6000000]];
103
+ data[0] = {
104
+ values: first_series_array,
105
+ key: SAMPLE_DATA.group1
106
+ };
107
+ if (yaxisLength >= 2) {
108
+ data[1] = {
109
+ values: second_series_array,
110
+ key: SAMPLE_DATA.group2
111
+ };
112
+ }
113
+ if (yaxisLength >= 3) {
114
+ data[2] = {
115
+ values: third_series_array,
116
+ key: SAMPLE_DATA.group3
117
+ };
118
+ }
119
+ break;
120
+ case 'columnChartFormat':
121
+ data = [{
122
+ 'x': SAMPLE_DATA.group1,
123
+ 'y': 3
124
+ }];
125
+ break;
126
+ case 'barChartFormat':
127
+ data = [{
128
+ 'x': SAMPLE_DATA.group1,
129
+ 'y': 2000000
130
+ }, {
131
+ 'x': SAMPLE_DATA.group2,
132
+ 'y': 1000000
133
+ }, {
134
+ 'x': SAMPLE_DATA.group3,
135
+ 'y': 3000000
136
+ }];
137
+ break;
138
+ case 'lineChartFormat':
139
+ data = [{
140
+ 'x': SAMPLE_DATA1.group1,
141
+ 'y': 2
142
+ }, {
143
+ 'x': SAMPLE_DATA1.group2,
144
+ 'y': 0
145
+ }, {
146
+ 'x': SAMPLE_DATA1.group3,
147
+ 'y': 3
148
+ }];
149
+ break;
150
+ case 'bubbleFormat':
151
+ // shape = shape === 'random' ? shapes[Math.floor(Math.random() * shapes.length)] : shape;
152
+ data = [{
153
+ 'x': SAMPLE_DATA2.group1,
154
+ 'y': 1000000
155
+ }, {
156
+ 'x': SAMPLE_DATA2.group2,
157
+ 'y': 2000000
158
+ }, {
159
+ 'x': SAMPLE_DATA2.group3,
160
+ 'y': 3000000
161
+ }, {
162
+ 'x': SAMPLE_DATA2.group4,
163
+ 'y': 4000000
164
+ }];
165
+ break;
166
+ case 'pieChartFormat':
167
+ data = [{
168
+ 'x': SAMPLE_DATA1.group1,
169
+ 'y': 1000000
170
+ }, {
171
+ 'x': SAMPLE_DATA1.group2,
172
+ 'y': 2000000
173
+ }, {
174
+ 'x': SAMPLE_DATA1.group3,
175
+ 'y': 3000000
176
+ }, {
177
+ 'x': SAMPLE_DATA1.group4,
178
+ 'y': 4000000
179
+ }];
180
+ break;
181
+ }
182
+ return data;
183
+ };
184
+ export const getChartType = widgetContext => {
185
+ const type = widgetContext.type;
186
+ if (isLineChart(type)) {
187
+ return 'lineChartFormat';
188
+ }
189
+ if (isAreaChart(type)) {
190
+ return 'lineChartFormat';
191
+ }
192
+ if (isBarChart(type)) {
193
+ return 'barChartFormat';
194
+ }
195
+ if (isColumnChart(type)) {
196
+ return 'columnChartFormat';
197
+ }
198
+ if (isPieChart(type)) {
199
+ return 'pieChartFormat';
200
+ }
201
+ if (isBubbleChart(type)) {
202
+ return 'bubbleFormat';
203
+ }
204
+ if (isDonutChart(type)) {
205
+ return 'pieChartFormat';
206
+ }
207
+ return isChartDataJSON(type) ? 'jsonFormat' : 'arrayFormat';
208
+ };
209
+
210
+ // Sample data to populate when no data is bound
211
+ export const getSampleData = widgetContext => constructSampleData(getDataType(widgetContext), _.split(widgetContext.yaxisdatakey, ',').length, widgetContext.shape);
212
+ function getDataType(widgetContext) {
213
+ throw new Error("Function not implemented.");
214
+ }
215
+ //# sourceMappingURL=staticdata.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_","dataTypeJSON","SAMPLE_DATA1","SAMPLE_DATA","SAMPLE_DATA2","chartTypes","isPieChart","type","isLineChart","isBarChart","isDonutChart","isBubbleChart","isAreaChart","isColumnChart","isPieType","isChartDataJSON","includes","constructSampleData","dataType","yaxisLength","shape","first_series","second_series","third_series","first_series_array","second_series_array","third_series_array","data","values","key","group1","group2","group3","group4","getChartType","widgetContext","getSampleData","getDataType","split","yaxisdatakey","length","Error"],"sources":["staticdata.tsx"],"sourcesContent":["import _ from \"lodash\";\n\nconst dataTypeJSON = ['Column', 'Line', 'Pie', 'Bar', 'Donut', 'Bubble']\n\nconst SAMPLE_DATA1 = {\n 'group1' : 'Europe',\n 'group2' : 'Asia',\n 'group3' : 'America',\n 'group4' : 'Australia'\n}\n\nconst SAMPLE_DATA = {\n 'group1' : '01/01/2001',\n 'group2' : '01/01/2002',\n 'group3' : '01/01/2003',\n};\nconst SAMPLE_DATA2 = {\n 'group1' : '78.6',\n 'group2' : '79',\n 'group3' : '80',\n 'group4' : '80.66'\n};\nexport const chartTypes = ['Column', 'Line', 'Area', 'Cumulative Line', 'Bar', 'Pie', 'Donut', 'Bubble']\n\nexport const isPieChart = (type: string) => type === 'Pie';\n\n// returns true if chart type is line\nexport const isLineChart = (type: string) => type === 'Line';\n\n// returns true if chart type is bar\nexport const isBarChart = (type: string) => type === 'Bar';\n\n// returns true if chart type is donut\nexport const isDonutChart = (type: string) => type === 'Donut';\n\n// returns true if chart type is bubble\nexport const isBubbleChart = (type: string) => type === 'Bubble';\n\nexport const isAreaChart = (type: string) => type === 'Area';\n\n// returns true if chart type is column\nexport const isColumnChart = (type: string) => type === 'Column';\n\nexport const isPieType = (type: string) => isPieChart(type) || isDonutChart(type);\n\n// The format of chart data is array of json objects in case of the following types of chart\nexport const isChartDataJSON = (type: any) => _.includes(dataTypeJSON, type) || !_.includes(chartTypes, type);\n\n\nexport const constructSampleData = (dataType: any, yaxisLength: any, shape: string) => {\n let first_series = [],\n second_series = [],\n third_series = [],\n first_series_array = [],\n second_series_array = [],\n third_series_array = [],\n data: { values?: { x: string | number; y?: string | number; size?: number; shape?: any; }[] | number[][]; key: any; }[] | { x: any; y?: number; }[] = [];\n switch (dataType) {\n case 'jsonFormat':\n first_series = [\n {'x': '01/01/2001', 'y': 4000000},\n {'x': '01/01/2002', 'y': 1000000},\n {'x': '01/01/2003', 'y': 5000000}\n ];\n second_series = [\n {'x': '01/01/2001', 'y': 3000000},\n {'x': '01/01/2002', 'y': 4000000},\n {'x': '01/01/2003', 'y': 7000000}\n ];\n third_series = [\n {'x': '01/01/2001', 'y': 2000000},\n {'x': '01/01/2002', 'y': 8000000},\n {'x': '01/01/2003', 'y': 6000000}\n ];\n data[0] = {\n values: first_series,\n key: SAMPLE_DATA.group1\n };\n if (yaxisLength >= 2) {\n data[1] = {\n values: second_series,\n key: SAMPLE_DATA.group2\n };\n }\n if (yaxisLength >= 3) {\n data[2] = {\n values: third_series,\n key: SAMPLE_DATA.group3\n };\n }\n break;\n case 'arrayFormat':\n first_series_array = [\n [1, 4000000],\n [2, 1000000],\n [3, 5000000]\n ];\n second_series_array = [\n [1, 3000000],\n [2, 4000000],\n [3, 7000000]\n ];\n third_series_array = [\n [1, 2000000],\n [2, 8000000],\n [3, 6000000]\n ];\n data[0] = {\n values: first_series_array,\n key: SAMPLE_DATA.group1\n };\n if (yaxisLength >= 2) {\n data[1] = {\n values: second_series_array,\n key: SAMPLE_DATA.group2\n };\n }\n if (yaxisLength >= 3) {\n data[2] = {\n values: third_series_array,\n key: SAMPLE_DATA.group3\n };\n }\n break;\n case 'columnChartFormat':\n data = [\n {'x': SAMPLE_DATA.group1, 'y': 3}\n ];\n break;\n case 'barChartFormat':\n data = [\n {'x': SAMPLE_DATA.group1, 'y': 2000000},\n {'x': SAMPLE_DATA.group2, 'y': 1000000},\n {'x': SAMPLE_DATA.group3, 'y': 3000000}\n ];\n break;\n case 'lineChartFormat':\n data = [\n {'x': SAMPLE_DATA1.group1, 'y': 2},\n {'x': SAMPLE_DATA1.group2, 'y': 0},\n {'x': SAMPLE_DATA1.group3, 'y': 3}\n ];\n break;\n case 'bubbleFormat':\n // shape = shape === 'random' ? shapes[Math.floor(Math.random() * shapes.length)] : shape;\n data = [\n {'x': SAMPLE_DATA2.group1, 'y': 1000000},\n {'x': SAMPLE_DATA2.group2, 'y': 2000000},\n {'x': SAMPLE_DATA2.group3, 'y': 3000000},\n {'x': SAMPLE_DATA2.group4, 'y': 4000000}\n ];\n break;\n case 'pieChartFormat':\n data = [\n {'x': SAMPLE_DATA1.group1, 'y': 1000000},\n {'x': SAMPLE_DATA1.group2, 'y': 2000000},\n {'x': SAMPLE_DATA1.group3, 'y': 3000000},\n {'x': SAMPLE_DATA1.group4, 'y': 4000000}\n ];\n break;\n \n }\n return data;\n\n};\n\nexport const getChartType = (widgetContext: { type: any; }) => {\n const type = widgetContext.type;\n if (isLineChart(type)) {\n return 'lineChartFormat';\n }\n if (isAreaChart(type)) {\n return 'lineChartFormat'; \n }\n if (isBarChart(type)) {\n return 'barChartFormat'; \n }\n if (isColumnChart(type)) {\n return 'columnChartFormat'; \n }\n if (isPieChart(type)) {\n return 'pieChartFormat';\n }\n if (isBubbleChart(type)) {\n return 'bubbleFormat';\n }\n if (isDonutChart(type)) {\n return 'pieChartFormat';\n}\n return isChartDataJSON(type) ? 'jsonFormat' : 'arrayFormat';\n};\n\n// Sample data to populate when no data is bound\nexport const getSampleData = (widgetContext: { yaxisdatakey: any; shape: any; }) => constructSampleData(getDataType(widgetContext), _.split(widgetContext.yaxisdatakey, ',').length, widgetContext.shape);\n\nfunction getDataType(widgetContext: { yaxisdatakey: any; shape: any; }): any {\n throw new Error(\"Function not implemented.\");\n}\n"],"mappings":"AAAA,OAAOA,CAAC,MAAM,QAAQ;AAEtB,MAAMC,YAAY,GAAG,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ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IC,aAA6B,IAAK;EAC7D,MAAM5B,IAAI,GAAG4B,aAAa,CAAC5B,IAAI;EAC/B,IAAIC,WAAW,CAACD,IAAI,CAAC,EAAE;IACnB,OAAO,iBAAiB;EAC5B;EACA,IAAIK,WAAW,CAACL,IAAI,CAAC,EAAE;IACrB,OAAO,iBAAiB;EAC1B;EACA,IAAIE,UAAU,CAACF,IAAI,CAAC,EAAE;IACpB,OAAO,gBAAgB;EACzB;EACA,IAAIM,aAAa,CAACN,IAAI,CAAC,EAAE;IACvB,OAAO,mBAAmB;EAC5B;EACA,IAAID,UAAU,CAACC,IAAI,CAAC,EAAE;IAClB,OAAO,gBAAgB;EAC3B;EACA,IAAII,aAAa,CAACJ,IAAI,CAAC,EAAE;IACrB,OAAO,cAAc;EACzB;EACA,IAAIG,YAAY,CAACH,IAAI,CAAC,EAAE;IACtB,OAAO,gBAAgB;EAC3B;EACE,OAAOQ,eAAe,CAACR,IAAI,CAAC,GAAG,YAAY,GAAG,aAAa;AAC7D,CAAC;;AAED;AACA,OAAO,MAAM6B,aAAa,GAAID,aAAiD,IAAKlB,mBAAmB,CAACoB,WAAW,CAACF,aAAa,CAAC,EAAEnC,CAAC,CAACsC,KAAK,CAACH,aAAa,CAACI,YAAY,EAAE,GAAG,CAAC,CAACC,MAAM,EAAEL,aAAa,CAACf,KAAK,CAAC;AAEzM,SAASiB,WAAWA,CAACF,aAAiD,EAAO;EAC3E,MAAM,IAAIM,KAAK,CAAC,2BAA2B,CAAC;AAC9C"}
@@ -13,18 +13,27 @@ export class WmContainerState extends PartialHostState {
13
13
  constructor() {
14
14
  super(...arguments);
15
15
  _defineProperty(this, "isPartialLoaded", false);
16
+ _defineProperty(this, "showContent", false);
16
17
  }
17
18
  }
18
19
  export default class WmContainer extends PartialHost {
19
20
  constructor(props) {
20
- super(props, DEFAULT_CLASS, new WmContainerProps());
21
+ super(props, DEFAULT_CLASS, new WmContainerProps(), new WmContainerState());
22
+ this.updateState({
23
+ showContent: !this.state.props.deferload
24
+ });
21
25
  }
22
26
  renderWidget(props) {
27
+ if (!this.state.showContent && this.isVisible()) {
28
+ this.updateState({
29
+ showContent: true
30
+ });
31
+ }
23
32
  const dimensions = {
24
33
  width: this.styles.root.width ? '100%' : undefined,
25
34
  height: this.styles.root.height ? '100%' : undefined
26
35
  };
27
- return /*#__PURE__*/React.createElement(Animatedview, {
36
+ return this.state.showContent && /*#__PURE__*/React.createElement(Animatedview, {
28
37
  entryanimation: props.animation,
29
38
  style: this.styles.root
30
39
  }, this._background, /*#__PURE__*/React.createElement(Tappable, _extends({}, this.getTestPropsForAction(), {
@@ -1 +1 @@
1
- {"version":3,"names":["React","View","WmContainerProps","DEFAULT_CLASS","Tappable","Animatedview","PartialHost","PartialHostState","WmContainerState","constructor","arguments","_defineProperty","WmContainer","props","renderWidget","dimensions","width","styles","root","undefined","height","createElement","entryanimation","animation","style","_background","_extends","getTestPropsForAction","target","content","renderContent"],"sources":["container.component.tsx"],"sourcesContent":["import React from 'react';\nimport { View, ViewStyle } from 'react-native';\n\nimport WmContainerProps from './container.props';\nimport { DEFAULT_CLASS, WmContainerStyles } from './container.styles';\nimport { Tappable } from '@wavemaker/app-rn-runtime/core/tappable.component';\nimport { Animatedview } from '@wavemaker/app-rn-runtime/components/basic/animatedview.component';\nimport { PartialHost, PartialHostState } from './partial-host.component';\n\nexport class WmContainerState extends PartialHostState<WmContainerProps> {\n isPartialLoaded = false;\n}\n\nexport default class WmContainer extends PartialHost<WmContainerProps, WmContainerState, WmContainerStyles> {\n constructor(props: WmContainerProps) {\n super(props, DEFAULT_CLASS, new WmContainerProps());\n }\n\n renderWidget(props: WmContainerProps) {\n const dimensions = {\n width: this.styles.root.width ? '100%' : undefined,\n height: this.styles.root.height ? '100%' : undefined\n };\n return (\n <Animatedview entryanimation={props.animation} style={this.styles.root}>\n {this._background}\n <Tappable {...this.getTestPropsForAction()} target={this} styles={dimensions}>\n <View style={[dimensions as ViewStyle, this.styles.content]}>{this.renderContent(props)}</View>\n </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AE,GAAE,IAAI,CAACC,aAAa,CAACjB,KAAK,CAAQ,CACzF,CACE,CAAC;EAEnB;AACF"}
1
+ {"version":3,"names":["React","View","WmContainerProps","DEFAULT_CLASS","Tappable","Animatedview","PartialHost","PartialHostState","WmContainerState","constructor","arguments","_defineProperty","WmContainer","props","updateState","showContent","state","deferload","renderWidget","isVisible","dimensions","width","styles","root","undefined","height","createElement","entryanimation","animation","style","_background","_extends","getTestPropsForAction","target","content","renderContent"],"sources":["container.component.tsx"],"sourcesContent":["import React from 'react';\nimport { View, ViewStyle } from 'react-native';\n\nimport WmContainerProps from './container.props';\nimport { DEFAULT_CLASS, WmContainerStyles } from './container.styles';\nimport { Tappable } from '@wavemaker/app-rn-runtime/core/tappable.component';\nimport { Animatedview } from '@wavemaker/app-rn-runtime/components/basic/animatedview.component';\nimport { PartialHost, PartialHostState } from './partial-host.component';\n\nexport class WmContainerState extends PartialHostState<WmContainerProps> {\n isPartialLoaded = false;\n showContent: boolean = false;\n}\n\nexport default class WmContainer extends PartialHost<WmContainerProps, WmContainerState, WmContainerStyles> {\n constructor(props: WmContainerProps) {\n super(props, DEFAULT_CLASS, new WmContainerProps(), new WmContainerState());\n this.updateState({showContent: !this.state.props.deferload} as WmContainerState);\n }\n\n renderWidget(props: WmContainerProps) {\n if(!this.state.showContent && this.isVisible()){\n this.updateState({showContent: true} as WmContainerState);\n }\n const dimensions = {\n width: this.styles.root.width ? '100%' : undefined,\n height: this.styles.root.height ? '100%' : undefined\n };\n return this.state.showContent && (\n <Animatedview entryanimation={props.animation} style={this.styles.root}>\n {this._background}\n <Tappable {...this.getTestPropsForAction()} target={this} styles={dimensions}>\n <View style={[dimensions as ViewStyle, this.styles.content]}>{this.renderContent(props)}</View>\n </Tappable>\n </Animatedview>\n );\n }\n}\n"],"mappings":";;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,IAAI,QAAmB,cAAc;AAE9C,OAAOC,gBAAgB,MAAM,mBAAmB;AAChD,SAASC,a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Q,EAAA2B,QAAA,KAAK,IAAI,CAACC,qBAAqB,CAAC,CAAC;MAAEC,MAAM,EAAE,IAAK;MAACX,MAAM,EAAEF;IAAW,iBACzEpB,KAAA,CAAA0B,aAAA,CAACzB,IAAI;MAAC4B,KAAK,EAAE,CAACT,UAAU,EAAgB,IAAI,CAACE,MAAM,CAACY,OAAO;IAAE,GAAE,IAAI,CAACC,aAAa,CAACtB,KAAK,CAAQ,CACzF,CACE,CACf;EACH;AACF"}
@@ -7,6 +7,7 @@ export default class WmContainerProps extends PartialHostProps {
7
7
  super(...arguments);
8
8
  _defineProperty(this, "animation", null);
9
9
  _defineProperty(this, "onLoad", void 0);
10
+ _defineProperty(this, "deferload", false);
10
11
  }
11
12
  }
12
13
  //# sourceMappingURL=container.props.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["PartialHostProps","WmContainerProps","constructor","arguments","_defineProperty"],"sources":["container.props.ts"],"sourcesContent":["import { PartialHostProps } from './partial-host.component';\n\nexport default class WmContainerProps extends PartialHostProps {\n animation?: string = null as any;\n onLoad?: Function;\n}\n"],"mappings":";;;AAAA,SAASA,gBAAgB,QAAQ,0BAA0B;AAE3D,eAAe,MAAMC,gBAAgB,SAASD,gBAAgB,CAAC;EAAAE,YAAA;IAAA,SAAAC,SAAA;IAAAC,eAAA,oBACxC,IAAI;IAAAA,eAAA;EAAA;AAE3B"}
1
+ {"version":3,"names":["PartialHostProps","WmContainerProps","constructor","arguments","_defineProperty"],"sources":["container.props.ts"],"sourcesContent":["import { PartialHostProps } from './partial-host.component';\n\nexport default class WmContainerProps extends PartialHostProps {\n animation?: string = null as any;\n onLoad?: Function;\n deferload?: boolean = false;\n}\n"],"mappings":";;;AAAA,SAASA,gBAAgB,QAAQ,0BAA0B;AAE3D,eAAe,MAAMC,gBAAgB,SAASD,gBAAgB,CAAC;EAAAE,YAAA;IAAA,SAAAC,SAAA;IAAAC,eAAA,oBACxC,IAAI;IAAAA,eAAA;IAAAA,eAAA,oBAEH,KAAK;EAAA;AAC7B"}