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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (288) hide show
  1. app-rn-runtime/components/advanced/carousel/carousel.component.js +6 -3
  2. app-rn-runtime/components/advanced/carousel/carousel.component.js.map +1 -1
  3. app-rn-runtime/components/advanced/carousel/carousel.styles.js +6 -3
  4. app-rn-runtime/components/advanced/carousel/carousel.styles.js.map +1 -1
  5. app-rn-runtime/components/advanced/webview/webview.component.js +6 -3
  6. app-rn-runtime/components/advanced/webview/webview.component.js.map +1 -1
  7. app-rn-runtime/components/advanced/webview/webview.props.js +3 -0
  8. app-rn-runtime/components/advanced/webview/webview.props.js.map +1 -1
  9. app-rn-runtime/components/basic/anchor/anchor.component.js +23 -7
  10. app-rn-runtime/components/basic/anchor/anchor.component.js.map +1 -1
  11. app-rn-runtime/components/basic/anchor/anchor.props.js +8 -0
  12. app-rn-runtime/components/basic/anchor/anchor.props.js.map +1 -1
  13. app-rn-runtime/components/basic/anchor/anchor.styles.js +3 -1
  14. app-rn-runtime/components/basic/anchor/anchor.styles.js.map +1 -1
  15. app-rn-runtime/components/basic/animatedview.component.js +5 -3
  16. app-rn-runtime/components/basic/animatedview.component.js.map +1 -1
  17. app-rn-runtime/components/basic/button/button.component.js +32 -9
  18. app-rn-runtime/components/basic/button/button.component.js.map +1 -1
  19. app-rn-runtime/components/basic/button/button.props.js +7 -0
  20. app-rn-runtime/components/basic/button/button.props.js.map +1 -1
  21. app-rn-runtime/components/basic/button/button.styles.js +9 -9
  22. app-rn-runtime/components/basic/button/button.styles.js.map +1 -1
  23. app-rn-runtime/components/basic/buttongroup/buttongroup.styles.js +8 -5
  24. app-rn-runtime/components/basic/buttongroup/buttongroup.styles.js.map +1 -1
  25. app-rn-runtime/components/basic/icon/icon.component.js +64 -12
  26. app-rn-runtime/components/basic/icon/icon.component.js.map +1 -1
  27. app-rn-runtime/components/basic/icon/icon.props.js +7 -0
  28. app-rn-runtime/components/basic/icon/icon.props.js.map +1 -1
  29. app-rn-runtime/components/basic/label/label.component.js +21 -11
  30. app-rn-runtime/components/basic/label/label.component.js.map +1 -1
  31. app-rn-runtime/components/basic/label/label.props.js +4 -0
  32. app-rn-runtime/components/basic/label/label.props.js.map +1 -1
  33. app-rn-runtime/components/basic/label/label.styles.js +3 -1
  34. app-rn-runtime/components/basic/label/label.styles.js.map +1 -1
  35. app-rn-runtime/components/basic/message/message.component.js +3 -2
  36. app-rn-runtime/components/basic/message/message.component.js.map +1 -1
  37. app-rn-runtime/components/basic/message/message.props.js +3 -0
  38. app-rn-runtime/components/basic/message/message.props.js.map +1 -1
  39. app-rn-runtime/components/basic/message/message.styles.js +3 -1
  40. app-rn-runtime/components/basic/message/message.styles.js.map +1 -1
  41. app-rn-runtime/components/basic/picture/picture.component.js +4 -2
  42. app-rn-runtime/components/basic/picture/picture.component.js.map +1 -1
  43. app-rn-runtime/components/basic/picture/picture.props.js +3 -0
  44. app-rn-runtime/components/basic/picture/picture.props.js.map +1 -1
  45. app-rn-runtime/components/basic/picture/picture.styles.js +3 -1
  46. app-rn-runtime/components/basic/picture/picture.styles.js.map +1 -1
  47. app-rn-runtime/components/basic/progress-bar/progress-bar.component.js +3 -3
  48. app-rn-runtime/components/basic/progress-bar/progress-bar.component.js.map +1 -1
  49. app-rn-runtime/components/basic/progress-bar/progress-bar.props.js +2 -0
  50. app-rn-runtime/components/basic/progress-bar/progress-bar.props.js.map +1 -1
  51. app-rn-runtime/components/basic/progress-circle/progress-circle.component.js +3 -2
  52. app-rn-runtime/components/basic/progress-circle/progress-circle.component.js.map +1 -1
  53. app-rn-runtime/components/basic/progress-circle/progress-circle.props.js +2 -0
  54. app-rn-runtime/components/basic/progress-circle/progress-circle.props.js.map +1 -1
  55. app-rn-runtime/components/basic/search/search.component.js +10 -3
  56. app-rn-runtime/components/basic/search/search.component.js.map +1 -1
  57. app-rn-runtime/components/basic/search/search.props.js +4 -0
  58. app-rn-runtime/components/basic/search/search.props.js.map +1 -1
  59. app-rn-runtime/components/basic/search/search.styles.js +6 -5
  60. app-rn-runtime/components/basic/search/search.styles.js.map +1 -1
  61. app-rn-runtime/components/basic/skeleton/skeleton.component.js +0 -1
  62. app-rn-runtime/components/basic/skeleton/skeleton.component.js.map +1 -1
  63. app-rn-runtime/components/basic/video/video.component.js +4 -2
  64. app-rn-runtime/components/basic/video/video.component.js.map +1 -1
  65. app-rn-runtime/components/basic/video/video.props.js +3 -0
  66. app-rn-runtime/components/basic/video/video.props.js.map +1 -1
  67. app-rn-runtime/components/chart/area-chart/area-chart.component.js +32 -22
  68. app-rn-runtime/components/chart/area-chart/area-chart.component.js.map +1 -1
  69. app-rn-runtime/components/chart/bar-chart/bar-chart.component.js +22 -15
  70. app-rn-runtime/components/chart/bar-chart/bar-chart.component.js.map +1 -1
  71. app-rn-runtime/components/chart/basechart.component.js +15 -1
  72. app-rn-runtime/components/chart/basechart.component.js.map +1 -1
  73. app-rn-runtime/components/chart/basechart.props.js +3 -0
  74. app-rn-runtime/components/chart/basechart.props.js.map +1 -1
  75. app-rn-runtime/components/chart/basechart.styles.js +2 -1
  76. app-rn-runtime/components/chart/basechart.styles.js.map +1 -1
  77. app-rn-runtime/components/chart/bubble-chart/bubble-chart.component.js +4 -2
  78. app-rn-runtime/components/chart/bubble-chart/bubble-chart.component.js.map +1 -1
  79. app-rn-runtime/components/chart/line-chart/line-chart.component.js +25 -18
  80. app-rn-runtime/components/chart/line-chart/line-chart.component.js.map +1 -1
  81. app-rn-runtime/components/chart/line-chart/line-chart.props.js.map +1 -1
  82. app-rn-runtime/components/chart/pie-chart/pie-chart.component.js +6 -3
  83. app-rn-runtime/components/chart/pie-chart/pie-chart.component.js.map +1 -1
  84. app-rn-runtime/components/chart/stack-chart/stack-chart.component.js +21 -12
  85. app-rn-runtime/components/chart/stack-chart/stack-chart.component.js.map +1 -1
  86. app-rn-runtime/components/chart/staticdata.js +215 -0
  87. app-rn-runtime/components/chart/staticdata.js.map +1 -0
  88. app-rn-runtime/components/container/container.component.js +1 -10
  89. app-rn-runtime/components/container/container.component.js.map +1 -1
  90. app-rn-runtime/components/container/container.props.js +0 -1
  91. app-rn-runtime/components/container/container.props.js.map +1 -1
  92. app-rn-runtime/components/container/panel/panel.component.js +6 -2
  93. app-rn-runtime/components/container/panel/panel.component.js.map +1 -1
  94. app-rn-runtime/components/container/panel/panel.props.js +4 -0
  95. app-rn-runtime/components/container/panel/panel.props.js.map +1 -1
  96. app-rn-runtime/components/container/tabs/tabheader/tabheader.component.js +1 -1
  97. app-rn-runtime/components/container/tabs/tabheader/tabheader.component.js.map +1 -1
  98. app-rn-runtime/components/container/tabs/tabheader/tabheader.styles.js +1 -1
  99. app-rn-runtime/components/container/tabs/tabheader/tabheader.styles.js.map +1 -1
  100. app-rn-runtime/components/container/tabs/tabpane/tabpane.component.js +14 -1
  101. app-rn-runtime/components/container/tabs/tabpane/tabpane.component.js.map +1 -1
  102. app-rn-runtime/components/container/tabs/tabs.component.js +3 -0
  103. app-rn-runtime/components/container/tabs/tabs.component.js.map +1 -1
  104. app-rn-runtime/components/container/wizard/wizard.component.js +6 -6
  105. app-rn-runtime/components/container/wizard/wizard.component.js.map +1 -1
  106. app-rn-runtime/components/container/wizard/wizard.styles.js +19 -3
  107. app-rn-runtime/components/container/wizard/wizard.styles.js.map +1 -1
  108. app-rn-runtime/components/container/wizard/wizardstep/wizardstep.component.js +17 -11
  109. app-rn-runtime/components/container/wizard/wizardstep/wizardstep.component.js.map +1 -1
  110. app-rn-runtime/components/container/wizard/wizardstep/wizardstep.props.js +3 -0
  111. app-rn-runtime/components/container/wizard/wizardstep/wizardstep.props.js.map +1 -1
  112. app-rn-runtime/components/data/card/card.component.js +7 -3
  113. app-rn-runtime/components/data/card/card.component.js.map +1 -1
  114. app-rn-runtime/components/data/card/card.props.js +4 -0
  115. app-rn-runtime/components/data/card/card.props.js.map +1 -1
  116. app-rn-runtime/components/data/form/form-action/form-action.component.js +1 -0
  117. app-rn-runtime/components/data/form/form-action/form-action.component.js.map +1 -1
  118. app-rn-runtime/components/data/form/form-action/form-action.props.js +1 -0
  119. app-rn-runtime/components/data/form/form-action/form-action.props.js.map +1 -1
  120. app-rn-runtime/components/data/form/form-action/form-action.styles.js +2 -1
  121. app-rn-runtime/components/data/form/form-action/form-action.styles.js.map +1 -1
  122. app-rn-runtime/components/data/form/form-field/form-field.component.js +16 -1
  123. app-rn-runtime/components/data/form/form-field/form-field.component.js.map +1 -1
  124. app-rn-runtime/components/data/form/form-field/form-field.props.js +3 -0
  125. app-rn-runtime/components/data/form/form-field/form-field.props.js.map +1 -1
  126. app-rn-runtime/components/data/form/form.component.js +26 -4
  127. app-rn-runtime/components/data/form/form.component.js.map +1 -1
  128. app-rn-runtime/components/data/form/form.props.js +3 -0
  129. app-rn-runtime/components/data/form/form.props.js.map +1 -1
  130. app-rn-runtime/components/data/list/list.component.js +91 -28
  131. app-rn-runtime/components/data/list/list.component.js.map +1 -1
  132. app-rn-runtime/components/data/list/list.props.js +6 -1
  133. app-rn-runtime/components/data/list/list.props.js.map +1 -1
  134. app-rn-runtime/components/data/list/list.styles.js +13 -0
  135. app-rn-runtime/components/data/list/list.styles.js.map +1 -1
  136. app-rn-runtime/components/device/barcodescanner/barcodescanner.component.js +4 -1
  137. app-rn-runtime/components/device/barcodescanner/barcodescanner.component.js.map +1 -1
  138. app-rn-runtime/components/device/barcodescanner/barcodescanner.props.js +3 -0
  139. app-rn-runtime/components/device/barcodescanner/barcodescanner.props.js.map +1 -1
  140. app-rn-runtime/components/device/barcodescanner/barcodescanner.styles.js +13 -6
  141. app-rn-runtime/components/device/barcodescanner/barcodescanner.styles.js.map +1 -1
  142. app-rn-runtime/components/device/camera/camera.component.js +4 -1
  143. app-rn-runtime/components/device/camera/camera.component.js.map +1 -1
  144. app-rn-runtime/components/device/camera/camera.props.js +3 -0
  145. app-rn-runtime/components/device/camera/camera.props.js.map +1 -1
  146. app-rn-runtime/components/device/camera/camera.styles.js +12 -4
  147. app-rn-runtime/components/device/camera/camera.styles.js.map +1 -1
  148. app-rn-runtime/components/dialogs/alertdialog/alertdialog.component.js +4 -0
  149. app-rn-runtime/components/dialogs/alertdialog/alertdialog.component.js.map +1 -1
  150. app-rn-runtime/components/dialogs/alertdialog/alertdialog.props.js +4 -0
  151. app-rn-runtime/components/dialogs/alertdialog/alertdialog.props.js.map +1 -1
  152. app-rn-runtime/components/dialogs/alertdialog/alertdialog.styles.js +2 -1
  153. app-rn-runtime/components/dialogs/alertdialog/alertdialog.styles.js.map +1 -1
  154. app-rn-runtime/components/dialogs/confirmdialog/confirmdialog.component.js +4 -0
  155. app-rn-runtime/components/dialogs/confirmdialog/confirmdialog.component.js.map +1 -1
  156. app-rn-runtime/components/dialogs/confirmdialog/confirmdialog.props.js +4 -0
  157. app-rn-runtime/components/dialogs/confirmdialog/confirmdialog.props.js.map +1 -1
  158. app-rn-runtime/components/dialogs/dialog/dialog.component.js +7 -3
  159. app-rn-runtime/components/dialogs/dialog/dialog.component.js.map +1 -1
  160. app-rn-runtime/components/dialogs/dialog/dialog.props.js +4 -0
  161. app-rn-runtime/components/dialogs/dialog/dialog.props.js.map +1 -1
  162. app-rn-runtime/components/dialogs/dialog/dialog.styles.js +2 -1
  163. app-rn-runtime/components/dialogs/dialog/dialog.styles.js.map +1 -1
  164. app-rn-runtime/components/dialogs/dialogcontent/dialogcontent.component.js +4 -0
  165. app-rn-runtime/components/dialogs/dialogcontent/dialogcontent.component.js.map +1 -1
  166. app-rn-runtime/components/input/basedataset/basedataset.props.js +4 -0
  167. app-rn-runtime/components/input/basedataset/basedataset.props.js.map +1 -1
  168. app-rn-runtime/components/input/baseinput/baseinput.component.js +3 -3
  169. app-rn-runtime/components/input/baseinput/baseinput.component.js.map +1 -1
  170. app-rn-runtime/components/input/baseinput/baseinput.props.js +6 -0
  171. app-rn-runtime/components/input/baseinput/baseinput.props.js.map +1 -1
  172. app-rn-runtime/components/input/basenumber/basenumber.component.js +6 -6
  173. app-rn-runtime/components/input/basenumber/basenumber.component.js.map +1 -1
  174. app-rn-runtime/components/input/basenumber/basenumber.props.js +4 -0
  175. app-rn-runtime/components/input/basenumber/basenumber.props.js.map +1 -1
  176. app-rn-runtime/components/input/checkbox/checkbox.component.js +12 -5
  177. app-rn-runtime/components/input/checkbox/checkbox.component.js.map +1 -1
  178. app-rn-runtime/components/input/checkbox/checkbox.styles.js +35 -5
  179. app-rn-runtime/components/input/checkbox/checkbox.styles.js.map +1 -1
  180. app-rn-runtime/components/input/checkboxset/checkboxset.component.js +26 -10
  181. app-rn-runtime/components/input/checkboxset/checkboxset.component.js.map +1 -1
  182. app-rn-runtime/components/input/checkboxset/checkboxset.props.js +1 -0
  183. app-rn-runtime/components/input/checkboxset/checkboxset.props.js.map +1 -1
  184. app-rn-runtime/components/input/checkboxset/checkboxset.styles.js +39 -10
  185. app-rn-runtime/components/input/checkboxset/checkboxset.styles.js.map +1 -1
  186. app-rn-runtime/components/input/chips/chips.component.js +5 -1
  187. app-rn-runtime/components/input/chips/chips.component.js.map +1 -1
  188. app-rn-runtime/components/input/currency/currency.component.js +2 -2
  189. app-rn-runtime/components/input/currency/currency.component.js.map +1 -1
  190. app-rn-runtime/components/input/epoch/base-datetime.component.js +64 -6
  191. app-rn-runtime/components/input/epoch/base-datetime.component.js.map +1 -1
  192. app-rn-runtime/components/input/epoch/datetime/datetime.props.js +4 -0
  193. app-rn-runtime/components/input/epoch/datetime/datetime.props.js.map +1 -1
  194. app-rn-runtime/components/input/epoch/datetime/datetime.styles.js +28 -0
  195. app-rn-runtime/components/input/epoch/datetime/datetime.styles.js.map +1 -1
  196. app-rn-runtime/components/input/fileupload/fileupload.component.js +2 -0
  197. app-rn-runtime/components/input/fileupload/fileupload.component.js.map +1 -1
  198. app-rn-runtime/components/input/fileupload/fileupload.props.js +2 -0
  199. app-rn-runtime/components/input/fileupload/fileupload.props.js.map +1 -1
  200. app-rn-runtime/components/input/fileupload/fileupload.styles.js +1 -1
  201. app-rn-runtime/components/input/fileupload/fileupload.styles.js.map +1 -1
  202. app-rn-runtime/components/input/number/number.component.js +2 -2
  203. app-rn-runtime/components/input/number/number.component.js.map +1 -1
  204. app-rn-runtime/components/input/radioset/radioset.component.js +52 -21
  205. app-rn-runtime/components/input/radioset/radioset.component.js.map +1 -1
  206. app-rn-runtime/components/input/radioset/radioset.props.js +1 -0
  207. app-rn-runtime/components/input/radioset/radioset.props.js.map +1 -1
  208. app-rn-runtime/components/input/radioset/radioset.styles.js +35 -2
  209. app-rn-runtime/components/input/radioset/radioset.styles.js.map +1 -1
  210. app-rn-runtime/components/input/select/select.component.js +7 -3
  211. app-rn-runtime/components/input/select/select.component.js.map +1 -1
  212. app-rn-runtime/components/input/select/select.styles.js +5 -1
  213. app-rn-runtime/components/input/select/select.styles.js.map +1 -1
  214. app-rn-runtime/components/input/slider/slider.component.js +3 -2
  215. app-rn-runtime/components/input/slider/slider.component.js.map +1 -1
  216. app-rn-runtime/components/input/switch/switch.component.js +5 -1
  217. app-rn-runtime/components/input/switch/switch.component.js.map +1 -1
  218. app-rn-runtime/components/input/switch/switch.styles.js +2 -0
  219. app-rn-runtime/components/input/switch/switch.styles.js.map +1 -1
  220. app-rn-runtime/components/input/text/text.component.js +6 -3
  221. app-rn-runtime/components/input/text/text.component.js.map +1 -1
  222. app-rn-runtime/components/input/textarea/textarea.component.js +2 -1
  223. app-rn-runtime/components/input/textarea/textarea.component.js.map +1 -1
  224. app-rn-runtime/components/input/toggle/toggle.component.js +11 -5
  225. app-rn-runtime/components/input/toggle/toggle.component.js.map +1 -1
  226. app-rn-runtime/components/input/toggle/toggle.props.js +4 -0
  227. app-rn-runtime/components/input/toggle/toggle.props.js.map +1 -1
  228. app-rn-runtime/components/navigation/appnavbar/appnavbar.component.js +6 -1
  229. app-rn-runtime/components/navigation/appnavbar/appnavbar.component.js.map +1 -1
  230. app-rn-runtime/components/navigation/appnavbar/appnavbar.props.js +1 -0
  231. app-rn-runtime/components/navigation/appnavbar/appnavbar.props.js.map +1 -1
  232. app-rn-runtime/components/navigation/appnavbar/appnavbar.styles.js +11 -2
  233. app-rn-runtime/components/navigation/appnavbar/appnavbar.styles.js.map +1 -1
  234. app-rn-runtime/components/navigation/basenav/basenav.component.js +1 -2
  235. app-rn-runtime/components/navigation/basenav/basenav.component.js.map +1 -1
  236. app-rn-runtime/components/navigation/menu/menu.styles.js +8 -5
  237. app-rn-runtime/components/navigation/menu/menu.styles.js.map +1 -1
  238. app-rn-runtime/components/navigation/navitem/navitem.component.js +8 -5
  239. app-rn-runtime/components/navigation/navitem/navitem.component.js.map +1 -1
  240. app-rn-runtime/components/navigation/navitem/navitem.props.js +3 -0
  241. app-rn-runtime/components/navigation/navitem/navitem.props.js.map +1 -1
  242. app-rn-runtime/components/navigation/popover/popover.component.js +14 -3
  243. app-rn-runtime/components/navigation/popover/popover.component.js.map +1 -1
  244. app-rn-runtime/components/navigation/popover/popover.props.js +7 -0
  245. app-rn-runtime/components/navigation/popover/popover.props.js.map +1 -1
  246. app-rn-runtime/components/navigation/popover/popover.styles.js +8 -2
  247. app-rn-runtime/components/navigation/popover/popover.styles.js.map +1 -1
  248. app-rn-runtime/components/page/left-panel/left-panel.component.js +4 -0
  249. app-rn-runtime/components/page/left-panel/left-panel.component.js.map +1 -1
  250. app-rn-runtime/components/page/page-content/page-content.component.js +7 -1
  251. app-rn-runtime/components/page/page-content/page-content.component.js.map +1 -1
  252. app-rn-runtime/components/page/tabbar/tabbar.component.js +4 -4
  253. app-rn-runtime/components/page/tabbar/tabbar.component.js.map +1 -1
  254. app-rn-runtime/components/page/tabbar/tabbar.styles.js +30 -16
  255. app-rn-runtime/components/page/tabbar/tabbar.styles.js.map +1 -1
  256. app-rn-runtime/core/accessibility.js +149 -0
  257. app-rn-runtime/core/accessibility.js.map +1 -0
  258. app-rn-runtime/core/base.component.js +28 -5
  259. app-rn-runtime/core/base.component.js.map +1 -1
  260. app-rn-runtime/core/components/textinput.component.js +147 -14
  261. app-rn-runtime/core/components/textinput.component.js.map +1 -1
  262. app-rn-runtime/core/event-notifier.js +37 -2
  263. app-rn-runtime/core/event-notifier.js.map +1 -1
  264. app-rn-runtime/core/formatters.js +14 -1
  265. app-rn-runtime/core/formatters.js.map +1 -1
  266. app-rn-runtime/core/tappable.component.js +2 -2
  267. app-rn-runtime/core/tappable.component.js.map +1 -1
  268. app-rn-runtime/core/utils.js +11 -0
  269. app-rn-runtime/core/utils.js.map +1 -1
  270. app-rn-runtime/gestures/swipe.animation.js +34 -1
  271. app-rn-runtime/gestures/swipe.animation.js.map +1 -1
  272. app-rn-runtime/package.json +4 -3
  273. app-rn-runtime/runtime/App.js +17 -10
  274. app-rn-runtime/runtime/App.js.map +1 -1
  275. app-rn-runtime/runtime/base-fragment.component.js +5 -1
  276. app-rn-runtime/runtime/base-fragment.component.js.map +1 -1
  277. app-rn-runtime/runtime/base-page.component.js +1 -1
  278. app-rn-runtime/runtime/base-page.component.js.map +1 -1
  279. app-rn-runtime/runtime/services/app-security.service.js +2 -1
  280. app-rn-runtime/runtime/services/app-security.service.js.map +1 -1
  281. app-rn-runtime/styles/background.component.js +16 -5
  282. app-rn-runtime/styles/background.component.js.map +1 -1
  283. app-rn-runtime/styles/theme.js +12 -5
  284. app-rn-runtime/styles/theme.js.map +1 -1
  285. app-rn-runtime/styles/theme.variables.js +28 -11
  286. app-rn-runtime/styles/theme.variables.js.map +1 -1
  287. app-rn-runtime/variables/service-variable.js +14 -6
  288. app-rn-runtime/variables/service-variable.js.map +1 -1
@@ -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,CAAC;AAExE,MAAMC,YAAY,GAAG;EACnB,QAAQ,EAAG,QAAQ;EACnB,QAAQ,EAAG,MAAM;EACjB,QAAQ,EAAG,SAAS;EACpB,QAAQ,EAA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AiB;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,27 +13,18 @@ export class WmContainerState extends PartialHostState {
13
13
  constructor() {
14
14
  super(...arguments);
15
15
  _defineProperty(this, "isPartialLoaded", false);
16
- _defineProperty(this, "showContent", false);
17
16
  }
18
17
  }
19
18
  export default class WmContainer extends PartialHost {
20
19
  constructor(props) {
21
20
  super(props, DEFAULT_CLASS, new WmContainerProps(), new WmContainerState());
22
- this.updateState({
23
- showContent: !this.state.props.deferload
24
- });
25
21
  }
26
22
  renderWidget(props) {
27
- if (!this.state.showContent && this.isVisible()) {
28
- this.updateState({
29
- showContent: true
30
- });
31
- }
32
23
  const dimensions = {
33
24
  width: this.styles.root.width ? '100%' : undefined,
34
25
  height: this.styles.root.height ? '100%' : undefined
35
26
  };
36
- return this.state.showContent && /*#__PURE__*/React.createElement(Animatedview, {
27
+ return /*#__PURE__*/React.createElement(Animatedview, {
37
28
  entryanimation: props.animation,
38
29
  style: this.styles.root
39
30
  }, 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","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 );\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AEd,KAAK,CAACe,SAAU;MAACC,KAAK,EAAE,IAAI,CAACP,MAAM,CAACC;IAAK,GACpE,IAAI,CAACO,WAAW,eACjB9B,KAAA,CAAA0B,aAAA,CAACtB,QAAQ,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"}
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(), new WmContainerState());\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 </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,aAAa,QAA2B,oBAAoB;AACrE,SAASC,QAAQ,QAAQ,mDAAmD;AAC5E,SAASC,YAAY,QAAQ,mEAAmE;AAChG,SAASC,WAAW,EAAEC,gBAAgB,QAAQ,0BAA0B;AAExE,OAAO,MAAMC,gBAAgB,SAASD,gBAAgB,CAAmB;EAAAE,YAAA;IAAA,SAAAC,SAAA;IAAAC,eAAA,0BACrD,KAAK;EAAA;AACzB;AAEA,eAAe,MAAMC,WAAW,SAASN,WAAW,CAAwD;EAC1GG,WAAWA,CAACI,KAAuB,EAAE;IACnC,KAAK,CAACA,KAAK,EAAEV,aAAa,EAAE,IAAID,gBAAgB,CAAC,CAAC,EAAE,IAAIM,gBAAgB,CAAC,CAAC,CAAC;EAC7E;EAEAM,YAAYA,CAACD,KAAuB,EAAE;IACpC,MAAME,UAAU,GAAG;MACjBC,KAAK,EAAE,IAAI,CAACC,MAAM,CAACC,IAAI,CAACF,KAAK,GAAG,MAAM,GAAGG,SAAS;MAClDC,MAAM,EAAE,IAAI,CAACH,MAAM,CAACC,IAAI,CAACE,MAAM,GAAG,MAAM,GAAGD;IAC7C,CAAC;IACD,oBACEnB,KAAA,CAAAqB,aAAA,CAAChB,YAAY;MAACiB,cAAc,EAAET,KAAK,CAACU,SAAU;MAACC,KAAK,EAAE,IAAI,CAACP,MAAM,CAACC;IAAK,GACpE,IAAI,CAACO,WAAW,eACjBzB,KAAA,CAAAqB,aAAA,CAACjB,QAAQ,EAAAsB,QAAA,KAAK,IAAI,CAACC,qBAAqB,CAAC,CAAC;MAAEC,MAAM,EAAE,IAAK;MAACX,MAAM,EAAEF;IAAW,iBACzEf,KAAA,CAAAqB,aAAA,CAACpB,IAAI;MAACuB,KAAK,EAAE,CAACT,UAAU,EAAgB,IAAI,CAACE,MAAM,CAACY,OAAO;IAAE,GAAE,IAAI,CAACC,aAAa,CAACjB,KAAK,CAAQ,CACzF,CACE,CAAC;EAEnB;AACF"}
@@ -7,7 +7,6 @@ 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);
11
10
  }
12
11
  }
13
12
  //# 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 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"}
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"}
@@ -73,10 +73,14 @@ export default class WmPanel extends BaseComponent {
73
73
  return /*#__PURE__*/React.createElement(TouchableOpacity, _extends({}, this.getTestPropsForAction(`header`), {
74
74
  style: [this.styles.header],
75
75
  onPress: this.onPanelPress.bind(this)
76
- }), props.iconclass ? /*#__PURE__*/React.createElement(WmIcon, {
76
+ }), props.iconclass || props.iconurl ? /*#__PURE__*/React.createElement(WmIcon, {
77
77
  styles: this.styles.icon,
78
78
  name: props.name + '_icon',
79
- iconclass: props.iconclass
79
+ iconclass: props.iconclass,
80
+ iconheight: props.iconheight,
81
+ iconwidth: props.iconwidth,
82
+ iconmargin: props.iconmargin,
83
+ iconurl: props.iconurl
80
84
  }) : null, /*#__PURE__*/React.createElement(View, {
81
85
  style: {
82
86
  flexDirection: 'column',
@@ -1 +1 @@
1
- {"version":3,"names":["React","Text","View","TouchableOpacity","isUndefined","Badge","BaseComponent","BaseComponentState","WmIcon","WmPanelProps","DEFAULT_CLASS","isWebPreviewMode","CollapsiblePane","WmPanelState","constructor","arguments","_defineProperty","WmPanel","props","onPartialLoad","invokeEventCallback","renderContent","renderPartial","state","isPartialLoaded","setTimeout","updateState","bind","onPanelPress","collapsible","eventName","expanded","proxy","expandCollapseIcon","isExpanded","widgetProps","badge","badgevalue","undefined","createElement","style","styles","badgetype","iconclass","name","toggleIcon","flexDirection","alignItems","renderHeader","_extends","getTestPropsForAction","header","onPress","icon","flex","justifyContent","text","heading","title","subheading","renderPane","content","maxHeight","overflow","close","renderWidget","root","_background","Fragment","children"],"sources":["panel.component.tsx"],"sourcesContent":["import React from 'react';\nimport { Text, View, TouchableOpacity } from 'react-native';\nimport { isUndefined } from 'lodash';\nimport { Badge } from 'react-native-paper';\nimport { BaseComponent, BaseComponentState } from '@wavemaker/app-rn-runtime/core/base.component';\nimport WmIcon from '@wavemaker/app-rn-runtime/components/basic/icon/icon.component';\n\nimport WmPanelProps from './panel.props';\nimport { DEFAULT_CLASS, WmPanelStyles } from './panel.styles';\nimport { isWebPreviewMode } from '@wavemaker/app-rn-runtime/core/utils';\nimport { CollapsiblePane } from './collapsible-pane.component';\n\nexport class WmPanelState extends BaseComponentState<WmPanelProps> {\n isPartialLoaded = false;\n}\n\nexport default class WmPanel extends BaseComponent<WmPanelProps, WmPanelState, WmPanelStyles> {\n constructor(props: WmPanelProps) {\n super(props, DEFAULT_CLASS, new WmPanelProps());\n }\n\n onPartialLoad() {\n this.invokeEventCallback('onLoad', [this]);\n }\n\n renderContent(props: WmPanelProps) {\n if (props.renderPartial) {\n if (!this.state.isPartialLoaded) {\n setTimeout(() => {\n this.updateState({\n isPartialLoaded: true\n } as WmPanelState);\n });\n }\n return props.renderPartial(props, this.onPartialLoad.bind(this));\n }\n }\n\n onPanelPress() {\n if (!this.state.props.collapsible) {\n return;\n }\n const eventName = this.state.props.expanded ? 'onCollapse' : 'onExpand';\n this.updateState({\n props: {\n expanded: !this.state.props.expanded\n }\n } as WmPanelState);\n\n this.invokeEventCallback(eventName, [null, this.proxy]);\n }\n\n expandCollapseIcon(isExpanded: boolean) {\n const widgetProps = this.state.props;\n //@ts-ignore\n const badge = widgetProps.badgevalue != undefined ? (<Badge style={[this.styles.badge, this.styles[widgetProps.badgetype || 'default']]}>{widgetProps.badgevalue}</Badge>): null;\n const iconclass = isExpanded ? 'wi wi-chevron-up' : 'wi wi-chevron-down';\n const expandCollapseIcon = widgetProps.collapsible ? (<WmIcon name={'expand_collapse_icon'} styles={this.styles.toggleIcon} iconclass={iconclass}></WmIcon>) : null;\n return (<View style={{flexDirection: 'row', alignItems: 'center'}}>{badge}{expandCollapseIcon}</View>);\n }\n\n renderHeader() {\n const props = this.state.props;\n return (\n <TouchableOpacity\n {...this.getTestPropsForAction(`header`)}\n style={[this.styles.header]}\n onPress={this.onPanelPress.bind(this)}>\n {props.iconclass ? <WmIcon styles={this.styles.icon} name={props.name + '_icon'} iconclass={props.iconclass}></WmIcon>: null}\n <View style={{flexDirection: 'column', flex: 1, justifyContent: 'center'}}>\n <Text style={[\n this.styles.text,\n this.styles.heading]}\n {...this.getTestPropsForAction(`header_title`)}>\n {isUndefined(props.title) ? 'Title' : props.title}\n </Text>\n {props.subheading ? \n (<Text style={this.styles.subheading}\n {...this.getTestPropsForAction(`subheader`)}>{props.subheading}</Text>) : null }\n </View>\n {this.expandCollapseIcon(props.expanded)}\n </TouchableOpacity>\n );\n }\n\n renderPane(content: React.ReactNode) {\n const expanded = this.state.props.expanded;\n return isWebPreviewMode() ? \n (<View style={expanded ? {} : {maxHeight: 0, overflow: 'hidden'}}>\n {content}\n </View>) :\n (<CollapsiblePane close={!expanded}>\n {content}\n </CollapsiblePane>);\n }\n\n renderWidget(props: WmPanelProps) {\n return (<View style={this.styles.root}>\n {this._background}\n {this.renderHeader()}\n {this.renderPane((\n <>\n {this.renderContent(props)}\n <View>{props.children}</View>\n </>\n ))}\n </View>);\n }\n}\n"],"mappings":";;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,IAAI,EAAEC,IAAI,EAAEC,gBAAgB,QAAQ,cAAc;AAC3D,SAASC,WAAW,QAAQ,QAAQ;AACpC,SAASC,KAAK,QAAQ,oBAAoB;AAC1C,SAASC,aAAa,EAAEC,kBAAkB,QAAQ,+CAA+C;AACjG,OAAOC,MAAM,MAAM,gEAAgE;AAEnF,OAAOC,YAAY,MAAM,eAAe;AACxC,SAASC,aAAa,QAAuB,gBAAgB;AAC7D,SAASC,gBAAgB,QAAQ,sCAAsC;AACvE,SAASC,eAAe,QAAQ,8BAA8B;AAE9D,OAAO,MAAMC,YAAY,SAASN,kBAAkB,CAAe;EAAAO,YAAA;IAAA,SAAAC,SAAA;IAAAC,eAAA,0BAC/C,KAAK;EAAA;AACzB;AAEA,eAAe,MAAMC,OAAO,SAASX,aAAa,CAA4C;EAC5FQ,WAAWA,CAACI,KAAmB,EAAE;IAC/B,KAAK,CAACA,KAAK,EAAER,aAAa,EAAE,IAAID,YAAY,CAAC,CAAC,CAAC;EACjD;EAEAU,aAAaA,CAAA,EAAG;IACd,IAAI,CAACC,mBAAmB,CAAC,QAAQ,EAAE,CAAC,IAAI,CAAC,CAAC;EAC5C;EAEAC,aAAaA,CAACH,KAAmB,EAAE;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AC;EACT;AACF"}
1
+ {"version":3,"names":["React","Text","View","TouchableOpacity","isUndefined","Badge","BaseComponent","BaseComponentState","WmIcon","WmPanelProps","DEFAULT_CLASS","isWebPreviewMode","CollapsiblePane","WmPanelState","constructor","arguments","_defineProperty","WmPanel","props","onPartialLoad","invokeEventCallback","renderContent","renderPartial","state","isPartialLoaded","setTimeout","updateState","bind","onPanelPress","collapsible","eventName","expanded","proxy","expandCollapseIcon","isExpanded","widgetProps","badge","badgevalue","undefined","createElement","style","styles","badgetype","iconclass","name","toggleIcon","flexDirection","alignItems","renderHeader","_extends","getTestPropsForAction","header","onPress","iconurl","icon","iconheight","iconwidth","iconmargin","flex","justifyContent","text","heading","title","subheading","renderPane","content","maxHeight","overflow","close","renderWidget","root","_background","Fragment","children"],"sources":["panel.component.tsx"],"sourcesContent":["import React from 'react';\nimport { Text, View, TouchableOpacity } from 'react-native';\nimport { isUndefined } from 'lodash';\nimport { Badge } from 'react-native-paper';\nimport { BaseComponent, BaseComponentState } from '@wavemaker/app-rn-runtime/core/base.component';\nimport WmIcon from '@wavemaker/app-rn-runtime/components/basic/icon/icon.component';\n\nimport WmPanelProps from './panel.props';\nimport { DEFAULT_CLASS, WmPanelStyles } from './panel.styles';\nimport { isWebPreviewMode } from '@wavemaker/app-rn-runtime/core/utils';\nimport { CollapsiblePane } from './collapsible-pane.component';\n\nexport class WmPanelState extends BaseComponentState<WmPanelProps> {\n isPartialLoaded = false;\n}\n\nexport default class WmPanel extends BaseComponent<WmPanelProps, WmPanelState, WmPanelStyles> {\n constructor(props: WmPanelProps) {\n super(props, DEFAULT_CLASS, new WmPanelProps());\n }\n\n onPartialLoad() {\n this.invokeEventCallback('onLoad', [this]);\n }\n\n renderContent(props: WmPanelProps) {\n if (props.renderPartial) {\n if (!this.state.isPartialLoaded) {\n setTimeout(() => {\n this.updateState({\n isPartialLoaded: true\n } as WmPanelState);\n });\n }\n return props.renderPartial(props, this.onPartialLoad.bind(this));\n }\n }\n\n onPanelPress() {\n if (!this.state.props.collapsible) {\n return;\n }\n const eventName = this.state.props.expanded ? 'onCollapse' : 'onExpand';\n this.updateState({\n props: {\n expanded: !this.state.props.expanded\n }\n } as WmPanelState);\n\n this.invokeEventCallback(eventName, [null, this.proxy]);\n }\n\n expandCollapseIcon(isExpanded: boolean) {\n const widgetProps = this.state.props;\n //@ts-ignore\n const badge = widgetProps.badgevalue != undefined ? (<Badge style={[this.styles.badge, this.styles[widgetProps.badgetype || 'default']]}>{widgetProps.badgevalue}</Badge>): null;\n const iconclass = isExpanded ? 'wi wi-chevron-up' : 'wi wi-chevron-down';\n const expandCollapseIcon = widgetProps.collapsible ? (<WmIcon name={'expand_collapse_icon'} styles={this.styles.toggleIcon} iconclass={iconclass}></WmIcon>) : null;\n return (<View style={{flexDirection: 'row', alignItems: 'center'}}>{badge}{expandCollapseIcon}</View>);\n }\n\n renderHeader() {\n const props = this.state.props;\n return (\n <TouchableOpacity\n {...this.getTestPropsForAction(`header`)}\n style={[this.styles.header]}\n onPress={this.onPanelPress.bind(this)}>\n {props.iconclass || props.iconurl ? \n <WmIcon styles={this.styles.icon} \n name={props.name + '_icon'}\n iconclass={props.iconclass}\n iconheight={props.iconheight}\n iconwidth={props.iconwidth}\n iconmargin={props.iconmargin}\n iconurl={props.iconurl}\n /> : null}\n <View style={{flexDirection: 'column', flex: 1, justifyContent: 'center'}}>\n <Text style={[\n this.styles.text,\n this.styles.heading]}\n {...this.getTestPropsForAction(`header_title`)}>\n {isUndefined(props.title) ? 'Title' : props.title}\n </Text>\n {props.subheading ? \n (<Text style={this.styles.subheading}\n {...this.getTestPropsForAction(`subheader`)}>{props.subheading}</Text>) : null }\n </View>\n {this.expandCollapseIcon(props.expanded)}\n </TouchableOpacity>\n );\n }\n\n renderPane(content: React.ReactNode) {\n const expanded = this.state.props.expanded;\n return isWebPreviewMode() ? \n (<View style={expanded ? {} : {maxHeight: 0, overflow: 'hidden'}}>\n {content}\n </View>) :\n (<CollapsiblePane close={!expanded}>\n {content}\n </CollapsiblePane>);\n }\n\n renderWidget(props: WmPanelProps) {\n return (<View style={this.styles.root}>\n {this._background}\n {this.renderHeader()}\n {this.renderPane((\n <>\n {this.renderContent(props)}\n <View>{props.children}</View>\n </>\n ))}\n </View>);\n }\n}\n"],"mappings":";;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,IAAI,EAAEC,IAAI,EAAEC,gBAAgB,QAAQ,cAAc;AAC3D,SAASC,WAAW,QAAQ,QAAQ;AACpC,SAASC,KAAK,QAAQ,oBAAoB;AAC1C,SAASC,aAAa,EAAEC,kBAAkB,QAAQ,+CAA+C;AACjG,OAAOC,MAAM,MAAM,gEAAgE;AAEnF,OAAOC,YAAY,MAAM,eAAe;AACxC,SAASC,aAAa,QAAuB,gBAAgB;AAC7D,SAASC,gBAAgB,QAAQ,sCAAsC;AACvE,SAASC,eAAe,QAAQ,8BAA8B;AAE9D,OAAO,MAAMC,YAAY,SAASN,kBAAkB,CAAe;EAAAO,YAAA;IAAA,SAAAC,SAAA;IAAAC,eAAA,0BAC/C,KAAK;EAAA;AACzB;AAEA,eAAe,MAAMC,OAAO,SAASX,aAAa,CAA4C;EAC5FQ,WAAWA,CAACI,KAAmB,EAAE;IAC/B,KAAK,CAACA,KAAK,EAAER,aAAa,EAAE,IAAID,YAAY,CAAC,CAAC,CAAC;EACjD;EAEAU,aAAaA,CAAA,EAAG;IACd,IAAI,CAACC,mBAAmB,CAAC,QAAQ,EAAE,CAAC,IAAI,CAAC,CAAC;EAC5C;EAEAC,aAAaA,CAACH,KAAmB,EAAE;IACjC,IAAIA,KAAK,CAACI,aAAa,EAAE;MACvB,IAAI,CAAC,IAAI,CAACC,KAAK,CAACC,eAAe,EAAE;QAC/BC,UAAU,CAAC,MAAM;UACf,IAAI,CAACC,WAAW,CAAC;YACfF,eAAe,EAAE;UACnB,CAAiB,CAAC;QACpB,CAAC,CAAC;MACJ;MACA,OAAON,KAAK,CAACI,aAAa,CAACJ,KAAK,EAAE,IAA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
15
15
  _defineProperty(this, "badgevalue", null);
16
16
  _defineProperty(this, "badgetype", 'default');
17
17
  _defineProperty(this, "expanded", true);
18
+ _defineProperty(this, "iconurl", null);
19
+ _defineProperty(this, "iconheight", null);
20
+ _defineProperty(this, "iconwidth", null);
21
+ _defineProperty(this, "iconmargin", null);
18
22
  }
19
23
  }
20
24
  //# sourceMappingURL=panel.props.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["BaseProps","WmPanelProps","constructor","arguments","_defineProperty"],"sources":["panel.props.ts"],"sourcesContent":["import { BaseProps } from '@wavemaker/app-rn-runtime/core/base.component';\n\nexport default class WmPanelProps extends BaseProps {\n animation: string = null as any;\n children: any;\n collapsible: boolean = null as any;\n iconclass: string = null as any;\n title: string = 'Title';\n renderPartial?: Function;\n subheading: string = null as any;\n badgevalue: string = null as any;\n badgetype: string = 'default';\n expanded: boolean = true;\n}\n"],"mappings":";;;AAAA,SAASA,SAAS,QAAQ,+CAA+C;AAEzE,eAAe,MAAMC,YAAY,SAASD,SAAS,CAAC;EAAAE,YAAA;IAAA,SAAAC,SAAA;IAAAC,eAAA,oBAC9B,IAAI;IAAAA,eAAA;IAAAA,eAAA,sBAED,IAAI;IAAAA,eAAA,oBACP,IAAI;IAAAA,eAAA,gBACR,OAAO;IAAAA,eAAA;IAAAA,eAAA,qBAEF,IAAI;IAAAA,eAAA,qBACJ,IAAI;IAAAA,eAAA,oBACL,SAAS;IAAAA,eAAA,mBACT,IAAI;EAAA;AAC1B"}
1
+ {"version":3,"names":["BaseProps","WmPanelProps","constructor","arguments","_defineProperty"],"sources":["panel.props.ts"],"sourcesContent":["import { BaseProps } from '@wavemaker/app-rn-runtime/core/base.component';\n\nexport default class WmPanelProps extends BaseProps {\n animation: string = null as any;\n children: any;\n collapsible: boolean = null as any;\n iconclass: string = null as any;\n title: string = 'Title';\n renderPartial?: Function;\n subheading: string = null as any;\n badgevalue: string = null as any;\n badgetype: string = 'default';\n expanded: boolean = true;\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}\n"],"mappings":";;;AAAA,SAASA,SAAS,QAAQ,+CAA+C;AAEzE,eAAe,MAAMC,YAAY,SAASD,SAAS,CAAC;EAAAE,YAAA;IAAA,SAAAC,SAAA;IAAAC,eAAA,oBAC9B,IAAI;IAAAA,eAAA;IAAAA,eAAA,sBAED,IAAI;IAAAA,eAAA,oBACP,IAAI;IAAAA,eAAA,gBACR,OAAO;IAAAA,eAAA;IAAAA,eAAA,qBAEF,IAAI;IAAAA,eAAA,qBACJ,IAAI;IAAAA,eAAA,oBACL,SAAS;IAAAA,eAAA,mBACT,IAAI;IAAAA,eAAA,kBACL,IAAI;IAAAA,eAAA,qBACD,IAAI;IAAAA,eAAA,oBACL,IAAI;IAAAA,eAAA,qBACH,IAAI;EAAA;AAC5B"}
@@ -116,7 +116,7 @@ export default class WmTabheader extends BaseComponent {
116
116
  }
117
117
  }, {
118
118
  ...this.styles.root,
119
- width: ((_this$styles$root = this.styles.root) === null || _this$styles$root === void 0 ? void 0 : _this$styles$root.width) || "100%",
119
+ width: ((_this$styles$root = this.styles.root) === null || _this$styles$root === void 0 ? void 0 : _this$styles$root.width) || "80%",
120
120
  height: ((_this$styles$root2 = this.styles.root) === null || _this$styles$root2 === void 0 ? void 0 : _this$styles$root2.height) || ((_this$styles$activeHe = this.styles.activeHeaderText) === null || _this$styles$activeHe === void 0 ? void 0 : _this$styles$activeHe.fontSize) || 16
121
121
  })));
122
122
  })), /*#__PURE__*/React.createElement(Animated.View, {
@@ -1 +1 @@
1
- {"version":3,"names":["React","Animated","Easing","Text","View","BaseComponent","BaseComponentState","WmTabheaderProps","DEFAULT_CLASS","Tappable","createSkeleton","BackgroundComponent","WmTabheaderState","WmTabheader","constructor","props","_defineProperty","Value","headerScrollPosition","addListener","_ref","value","headerScrollPositionValue","setHeaderPanelPositon","nativeEvent","headerPanelLayout","layout","forceUpdate","setHeaderPositon","index","headersLayout","selectedTabIndex","onTabSelection","state","onIndexChange","setPosition","_this$headersLayout$s","_this$headerPanelLayo","_this$headerPanelLayo2","toIndicatorPosition","toIndicatorWidth","width","toHeaderScrollPosition","totalWidth","data","length","forEach","p","i","minScrollPosition","maxScrollPosition","Math","max","min","positionIndicator","position","isRTL","parallel","timing","useNativeDriver","toValue","duration","easing","linear","indicatorWidth","reverseIndicatorWidth","indicatorPosition","start","renderSkeleton","createElement","style","transform","translateX","onLayout","bind","styles","root","map","header","_this$styles$root","_this$styles$root2","_this$styles$activeHe","isSelected","onTap","key","flex","activeHeader","theme","borderRadius","height","activeHeaderText","fontSize","activeIndicator","scaleX","renderWidget","arrowIndicator","overflow","zIndex","_background","_extends","getTestPropsForAction","flexGrow","undefined","numberOfLines","headerText","getTestPropsForLabel","title","backgroundImage","image","backgroundPosition","size","backgroundSize","repeat","backgroundRepeat","resizeMode","backgroundResizeMode","arrowIndicatorDot"],"sources":["tabheader.component.tsx"],"sourcesContent":["import React from 'react';\nimport { Animated, Easing, LayoutChangeEvent, LayoutRectangle, Text, View } from 'react-native';\nimport { BaseComponent, BaseComponentState } from '@wavemaker/app-rn-runtime/core/base.component';\n\nimport WmTabheaderProps from './tabheader.props';\nimport { DEFAULT_CLASS, WmTabheaderStyles } from './tabheader.styles';\nimport { Tappable } from '@wavemaker/app-rn-runtime/core/tappable.component';\nimport WmSkeleton, { createSkeleton } from '@wavemaker/app-rn-runtime/components/basic/skeleton/skeleton.component';\nimport { WmSkeletonStyles } from '@wavemaker/app-rn-runtime/components/basic/skeleton/skeleton.styles';\nimport { BackgroundComponent } from '@wavemaker/app-rn-runtime/styles/background.component';\n\nexport class WmTabheaderState extends BaseComponentState<WmTabheaderProps> {\n}\n\nexport default class WmTabheader extends BaseComponent<WmTabheaderProps, WmTabheaderState, WmTabheaderStyles> {\n\n private headerPanelLayout: LayoutRectangle = null as any;\n private headersLayout: LayoutRectangle[] = [];\n private headerScrollPosition = new Animated.Value(0);\n private headerScrollPositionValue = 0;\n private indicatorPosition = new Animated.Value(0);\n private reverseIndicatorWidth = new Animated.Value(0);\n private indicatorWidth = new Animated.Value(0);\n\n constructor(props: WmTabheaderProps) {\n super(props, DEFAULT_CLASS, new WmTabheaderProps(), new WmTabheaderState());\n this.headerScrollPosition.addListener(({value}) => this.headerScrollPositionValue = value);\n }\n\n setHeaderPanelPositon(nativeEvent: LayoutChangeEvent) {\n this.headerPanelLayout = nativeEvent.nativeEvent.layout;\n this.forceUpdate();\n }\n\n setHeaderPositon(index: number, nativeEvent: LayoutChangeEvent) {\n this.headersLayout[index] = nativeEvent.nativeEvent.layout;\n if (index === this.props.selectedTabIndex) {\n this.forceUpdate();\n }\n }\n\n onTabSelection(index: number) {\n if (this.state.props.selectedTabIndex != index) {\n this.state.props.onIndexChange && this.state.props.onIndexChange(index);\n }\n }\n\n setPosition() {\n const selectedTabIndex = this.state.props.selectedTabIndex;\n let toIndicatorPosition = 0;\n let toIndicatorWidth = this.headersLayout[selectedTabIndex]?.width || 0;\n let toHeaderScrollPosition = this.headerScrollPositionValue;\n let totalWidth = 0;\n if (this.state.props.data.length !== this.headersLayout.length) {\n return;\n }\n this.headersLayout.forEach((p, i) => {\n if (i < selectedTabIndex) {\n toIndicatorPosition += p.width;\n }\n totalWidth += p.width;\n });\n toHeaderScrollPosition = -1 * (toIndicatorPosition - (this.headerPanelLayout?.width || 0) / 2 + toIndicatorWidth/ 2) ;\n const minScrollPosition = -1 * (totalWidth - (this.headerPanelLayout?.width || 0));\n const maxScrollPosition = 0;\n toHeaderScrollPosition = Math.max(minScrollPosition, toHeaderScrollPosition);\n toHeaderScrollPosition = Math.min(maxScrollPosition, toHeaderScrollPosition);\n let positionIndicator = (toIndicatorPosition - (100 - toIndicatorWidth) / 2);\n let position = this.isRTL?-positionIndicator:positionIndicator;\n Animated.parallel([\n Animated.timing(this.headerScrollPosition, {\n useNativeDriver: true,\n toValue: toHeaderScrollPosition,\n duration: 200,\n easing: Easing.linear\n }),\n Animated.timing(this.indicatorWidth, {\n useNativeDriver: true,\n toValue: toIndicatorWidth / 100,\n duration: 200,\n easing: Easing.linear\n }),\n Animated.timing(this.reverseIndicatorWidth, {\n useNativeDriver: true,\n toValue: toIndicatorWidth ? 100 / toIndicatorWidth : 0,\n duration: 200,\n easing: Easing.linear\n }),\n Animated.timing(this.indicatorPosition, {\n useNativeDriver: true,\n toValue: position,\n duration: 200,\n easing: Easing.linear\n })\n ]).start();\n }\n\n public renderSkeleton(props: WmTabheaderProps){\n return(\n <Animated.View style={{\n transform: [{\n translateX: this.headerScrollPosition\n }]\n }}\n onLayout={this.setHeaderPanelPositon.bind(this)}>\n <View style={this.styles.root}>\n {this.props.data.map((header ,i) => {\n const isSelected = i === this.props.selectedTabIndex;\n return (\n <Tappable onTap={this.onTabSelection.bind(this, i)} key={header.key} styles={{flex: 1}}>\n <View onLayout={this.setHeaderPositon.bind(this, i)} style={[\n this.styles.header, \n isSelected ? this.styles.activeHeader : null]}>\n {\n createSkeleton(this.theme, { root: { borderRadius: 4 }} as WmSkeletonStyles, {\n ...this.styles.root,\n width: this.styles.root?.width || \"100%\",\n height: this.styles.root?.height || this.styles.activeHeaderText?.fontSize || 16\n })\n }\n </View>\n </Tappable>\n );\n })}\n </View>\n <Animated.View style={[this.styles.activeIndicator, {\n transform: [{\n translateX: this.indicatorPosition\n }, {\n scaleX: this.indicatorWidth\n }]\n }]}></Animated.View>\n </Animated.View>\n\n )\n }\n\n renderWidget(props: WmTabheaderProps) {\n this.setPosition();\n const arrowIndicator = this.styles.arrowIndicator as any;\n return (\n <View style={{overflow: 'hidden', zIndex: 16}}>\n <Animated.View style={{\n transform: [{\n translateX: this.headerScrollPosition\n }]\n }}\n onLayout={this.setHeaderPanelPositon.bind(this)}>\n <View style={this.styles.root}>\n {this._background}\n {props.data.map((header ,i) => {\n const isSelected = i === props.selectedTabIndex ;\n return (\n <Tappable onTap={this.onTabSelection.bind(this, i)}\n {...this.getTestPropsForAction(i +'')}\n key={header.key} \n styles={this.styles.header.flexGrow ? {flexGrow: this.styles.header.flexGrow} : null}>\n <View onLayout={this.setHeaderPositon.bind(this, i)}>\n <View style={[\n this.styles.header,\n {flexGrow: undefined},\n isSelected ? this.styles.activeHeader : null]}>\n <Text numberOfLines={1} style={[\n this.styles.headerText, \n isSelected ? this.styles.activeHeaderText : null]}\n {...this.getTestPropsForLabel(i + '_title')}\n >{header.title}</Text>\n </View>\n </View>\n </Tappable>\n );\n })}\n </View>\n <Animated.View style={[this.styles.activeIndicator, {\n transform: [{\n translateX: this.indicatorPosition\n }, {\n scaleX: this.indicatorWidth\n }]\n }]}>\n <Animated.View style={[{\n transform: [{\n scaleX: this.reverseIndicatorWidth\n }]\n },\n this.styles.arrowIndicator\n ]}>\n {arrowIndicator.backgroundImage ? (<BackgroundComponent\n image={arrowIndicator.backgroundImage}\n position={arrowIndicator.backgroundPosition}\n size={arrowIndicator.backgroundSize}\n repeat={arrowIndicator.backgroundRepeat}\n resizeMode={arrowIndicator.backgroundResizeMode}\n style={{borderRadius: this.styles.root.borderRadius}}\n ></BackgroundComponent>) : null }\n <View style={this.styles.arrowIndicatorDot}></View>\n </Animated.View>\n </Animated.View>\n </Animated.View>\n </View>\n ); \n }\n}\n"],"mappings":";;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,QAAQ,EAAEC,MAAM,EAAsCC,IAAI,EAAEC,IAAI,QAAQ,cAAc;AAC/F,SAASC,aAAa,EAAEC,kBAAkB,QAAQ,+CAA+C;AAEjG,OAAOC,gBAAgB,MAAM,mBAAmB;AAChD,SAASC,aAAa,QAA2B,oBAAoB;AACrE,SAASC,QAAQ,QAAQ,mDAAmD;AAC5E,SAAqBC,cAAc,QAAQ,wEAAwE;AAEnH,SAASC,mBAAmB,QAAQ,uDAAuD;AAE3F,OAAO,MAAMC,gBAAgB,SAASN,kBAAkB,CAAmB;AAG3E,eAAe,MAAMO,WAAW,SAASR,aAAa,CAAwD;EAU5GS,WAAWA,CAACC,KAAuB,EAAE;IACnC,KAAK,CAACA,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G,IAAI;MAACkE,KAAK,EAAE,CAAC,IAAI,CAACK,MAAM,CAACiB,eAAe,EAAE;QAClDrB,SAAS,EAAE,CAAC;UACVC,UAAU,EAAE,IAAI,CAACN;QACnB,CAAC,EAAE;UACD2B,MAAM,EAAE,IAAI,CAAC7B;QACf,CAAC;MACH,CAAC;IAAE,gBACDhE,KAAA,CAAAqE,aAAA,CAACpE,QAAQ,CAACG,IAAI;MAACkE,KAAK,EAAE,CAAC;QACnBC,SAAS,EAAE,CAAC;UACVsB,MAAM,EAAE,IAAI,CAAC5B;QACf,CAAC;MACH,CAAC,EACD,IAAI,CAACU,MAAM,CAACoB,cAAc;IAC1B,GACCA,cAAc,CAACY,eAAe,gBAAI3G,KAAA,CAAAqE,aAAA,CAAC1D,mBAAmB;MACvDiG,KAAK,EAAEb,cAAc,CAACY,eAAgB;MACtCpD,QAAQ,EAAEwC,cAAc,CAACc,kBAAmB;MAC5CC,IAAI,EAAEf,cAAc,CAACgB,cAAe;MACpCC,MAAM,EAAEjB,cAAc,CAACkB,gBAAiB;MACxCC,UAAU,EAAEnB,cAAc,CAACoB,oBAAqB;MAChD7C,KAAK,EAAE;QAACkB,YAAY,EAAE,IAAI,CAACb,MAAM,CAACC,IAAI,CAACY;MAAY;IAAE,CACjC,CAAC,GAAI,IAAI,eAC7BxF,KAAA,CAAAqE,aAAA,CAACjE,IAAI;MAACkE,KAAK,EAAE,IAAI,CAACK,MAAM,CAACyC;IAAkB,CAAO,CACrC,CACF,CACF,CACT,CAAC;EAEX;AACF"}
1
+ {"version":3,"names":["React","Animated","Easing","Text","View","BaseComponent","BaseComponentState","WmTabheaderProps","DEFAULT_CLASS","Tappable","createSkeleton","BackgroundComponent","WmTabheaderState","WmTabheader","constructor","props","_defineProperty","Value","headerScrollPosition","addListener","_ref","value","headerScrollPositionValue","setHeaderPanelPositon","nativeEvent","headerPanelLayout","layout","forceUpdate","setHeaderPositon","index","headersLayout","selectedTabIndex","onTabSelection","state","onIndexChange","setPosition","_this$headersLayout$s","_this$headerPanelLayo","_this$headerPanelLayo2","toIndicatorPosition","toIndicatorWidth","width","toHeaderScrollPosition","totalWidth","data","length","forEach","p","i","minScrollPosition","maxScrollPosition","Math","max","min","positionIndicator","position","isRTL","parallel","timing","useNativeDriver","toValue","duration","easing","linear","indicatorWidth","reverseIndicatorWidth","indicatorPosition","start","renderSkeleton","createElement","style","transform","translateX","onLayout","bind","styles","root","map","header","_this$styles$root","_this$styles$root2","_this$styles$activeHe","isSelected","onTap","key","flex","activeHeader","theme","borderRadius","height","activeHeaderText","fontSize","activeIndicator","scaleX","renderWidget","arrowIndicator","overflow","zIndex","_background","_extends","getTestPropsForAction","flexGrow","undefined","numberOfLines","headerText","getTestPropsForLabel","title","backgroundImage","image","backgroundPosition","size","backgroundSize","repeat","backgroundRepeat","resizeMode","backgroundResizeMode","arrowIndicatorDot"],"sources":["tabheader.component.tsx"],"sourcesContent":["import React from 'react';\nimport { Animated, Easing, LayoutChangeEvent, LayoutRectangle, Text, View } from 'react-native';\nimport { BaseComponent, BaseComponentState } from '@wavemaker/app-rn-runtime/core/base.component';\n\nimport WmTabheaderProps from './tabheader.props';\nimport { DEFAULT_CLASS, WmTabheaderStyles } from './tabheader.styles';\nimport { Tappable } from '@wavemaker/app-rn-runtime/core/tappable.component';\nimport WmSkeleton, { createSkeleton } from '@wavemaker/app-rn-runtime/components/basic/skeleton/skeleton.component';\nimport { WmSkeletonStyles } from '@wavemaker/app-rn-runtime/components/basic/skeleton/skeleton.styles';\nimport { BackgroundComponent } from '@wavemaker/app-rn-runtime/styles/background.component';\n\nexport class WmTabheaderState extends BaseComponentState<WmTabheaderProps> {\n}\n\nexport default class WmTabheader extends BaseComponent<WmTabheaderProps, WmTabheaderState, WmTabheaderStyles> {\n\n private headerPanelLayout: LayoutRectangle = null as any;\n private headersLayout: LayoutRectangle[] = [];\n private headerScrollPosition = new Animated.Value(0);\n private headerScrollPositionValue = 0;\n private indicatorPosition = new Animated.Value(0);\n private reverseIndicatorWidth = new Animated.Value(0);\n private indicatorWidth = new Animated.Value(0);\n\n constructor(props: WmTabheaderProps) {\n super(props, DEFAULT_CLASS, new WmTabheaderProps(), new WmTabheaderState());\n this.headerScrollPosition.addListener(({value}) => this.headerScrollPositionValue = value);\n }\n\n setHeaderPanelPositon(nativeEvent: LayoutChangeEvent) {\n this.headerPanelLayout = nativeEvent.nativeEvent.layout;\n this.forceUpdate();\n }\n\n setHeaderPositon(index: number, nativeEvent: LayoutChangeEvent) {\n this.headersLayout[index] = nativeEvent.nativeEvent.layout;\n if (index === this.props.selectedTabIndex) {\n this.forceUpdate();\n }\n }\n\n onTabSelection(index: number) {\n if (this.state.props.selectedTabIndex != index) {\n this.state.props.onIndexChange && this.state.props.onIndexChange(index);\n }\n }\n\n setPosition() {\n const selectedTabIndex = this.state.props.selectedTabIndex;\n let toIndicatorPosition = 0;\n let toIndicatorWidth = this.headersLayout[selectedTabIndex]?.width || 0;\n let toHeaderScrollPosition = this.headerScrollPositionValue;\n let totalWidth = 0;\n if (this.state.props.data.length !== this.headersLayout.length) {\n return;\n }\n this.headersLayout.forEach((p, i) => {\n if (i < selectedTabIndex) {\n toIndicatorPosition += p.width;\n }\n totalWidth += p.width;\n });\n toHeaderScrollPosition = -1 * (toIndicatorPosition - (this.headerPanelLayout?.width || 0) / 2 + toIndicatorWidth/ 2) ;\n const minScrollPosition = -1 * (totalWidth - (this.headerPanelLayout?.width || 0));\n const maxScrollPosition = 0;\n toHeaderScrollPosition = Math.max(minScrollPosition, toHeaderScrollPosition);\n toHeaderScrollPosition = Math.min(maxScrollPosition, toHeaderScrollPosition);\n let positionIndicator = (toIndicatorPosition - (100 - toIndicatorWidth) / 2);\n let position = this.isRTL?-positionIndicator:positionIndicator;\n Animated.parallel([\n Animated.timing(this.headerScrollPosition, {\n useNativeDriver: true,\n toValue: toHeaderScrollPosition,\n duration: 200,\n easing: Easing.linear\n }),\n Animated.timing(this.indicatorWidth, {\n useNativeDriver: true,\n toValue: toIndicatorWidth / 100,\n duration: 200,\n easing: Easing.linear\n }),\n Animated.timing(this.reverseIndicatorWidth, {\n useNativeDriver: true,\n toValue: toIndicatorWidth ? 100 / toIndicatorWidth : 0,\n duration: 200,\n easing: Easing.linear\n }),\n Animated.timing(this.indicatorPosition, {\n useNativeDriver: true,\n toValue: position,\n duration: 200,\n easing: Easing.linear\n })\n ]).start();\n }\n\n public renderSkeleton(props: WmTabheaderProps){\n return(\n <Animated.View style={{\n transform: [{\n translateX: this.headerScrollPosition\n }]\n }}\n onLayout={this.setHeaderPanelPositon.bind(this)}>\n <View style={this.styles.root}>\n {this.props.data.map((header ,i) => {\n const isSelected = i === this.props.selectedTabIndex;\n return (\n <Tappable onTap={this.onTabSelection.bind(this, i)} key={header.key} styles={{flex: 1}}>\n <View onLayout={this.setHeaderPositon.bind(this, i)} style={[\n this.styles.header, \n isSelected ? this.styles.activeHeader : null]}>\n {\n createSkeleton(this.theme, { root: { borderRadius: 4 }} as WmSkeletonStyles, {\n ...this.styles.root,\n width: this.styles.root?.width || \"80%\",\n height: this.styles.root?.height || this.styles.activeHeaderText?.fontSize || 16\n })\n }\n </View>\n </Tappable>\n );\n })}\n </View>\n <Animated.View style={[this.styles.activeIndicator, {\n transform: [{\n translateX: this.indicatorPosition\n }, {\n scaleX: this.indicatorWidth\n }]\n }]}></Animated.View>\n </Animated.View>\n\n )\n }\n\n renderWidget(props: WmTabheaderProps) {\n this.setPosition();\n const arrowIndicator = this.styles.arrowIndicator as any;\n return (\n <View style={{overflow: 'hidden', zIndex: 16}}>\n <Animated.View style={{\n transform: [{\n translateX: this.headerScrollPosition\n }]\n }}\n onLayout={this.setHeaderPanelPositon.bind(this)}>\n <View style={this.styles.root}>\n {this._background}\n {props.data.map((header ,i) => {\n const isSelected = i === props.selectedTabIndex ;\n return (\n <Tappable onTap={this.onTabSelection.bind(this, i)}\n {...this.getTestPropsForAction(i +'')}\n key={header.key} \n styles={this.styles.header.flexGrow ? {flexGrow: this.styles.header.flexGrow} : null}>\n <View onLayout={this.setHeaderPositon.bind(this, i)}>\n <View style={[\n this.styles.header,\n {flexGrow: undefined},\n isSelected ? this.styles.activeHeader : null]}>\n <Text numberOfLines={1} style={[\n this.styles.headerText, \n isSelected ? this.styles.activeHeaderText : null]}\n {...this.getTestPropsForLabel(i + '_title')}\n >{header.title}</Text>\n </View>\n </View>\n </Tappable>\n );\n })}\n </View>\n <Animated.View style={[this.styles.activeIndicator, {\n transform: [{\n translateX: this.indicatorPosition\n }, {\n scaleX: this.indicatorWidth\n }]\n }]}>\n <Animated.View style={[{\n transform: [{\n scaleX: this.reverseIndicatorWidth\n }]\n },\n this.styles.arrowIndicator\n ]}>\n {arrowIndicator.backgroundImage ? (<BackgroundComponent\n image={arrowIndicator.backgroundImage}\n position={arrowIndicator.backgroundPosition}\n size={arrowIndicator.backgroundSize}\n repeat={arrowIndicator.backgroundRepeat}\n resizeMode={arrowIndicator.backgroundResizeMode}\n style={{borderRadius: this.styles.root.borderRadius}}\n ></BackgroundComponent>) : null }\n <View style={this.styles.arrowIndicatorDot}></View>\n </Animated.View>\n </Animated.View>\n </Animated.View>\n </View>\n ); \n }\n}\n"],"mappings":";;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,QAAQ,EAAEC,MAAM,EAAsCC,IAAI,EAAEC,IAAI,QAAQ,cAAc;AAC/F,SAASC,aAAa,EAAEC,kBAAkB,QAAQ,+CAA+C;AAEjG,OAAOC,gBAAgB,MAAM,mBAAmB;AAChD,SAASC,aAAa,QAA2B,oBAAoB;AACrE,SAASC,QAAQ,QAAQ,mDAAmD;AAC5E,SAAqBC,cAAc,QAAQ,wEAAwE;AAEnH,SAASC,mBAAmB,QAAQ,uDAAuD;AAE3F,OAAO,MAAMC,gBAAgB,SAASN,kBAAkB,CAAmB;AAG3E,eAAe,MAAMO,WAAW,SAASR,aAAa,CAAwD;EAU5GS,WAAWA,CAACC,KAAuB,EAAE;IACnC,KAAK,CAACA,KAAK,EAAEP,aAAa,EAAE,I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,CAAC,IAAI,CAACK,MAAM,CAACiB,eAAe,EAAE;QAClDrB,SAAS,EAAE,CAAC;UACVC,UAAU,EAAE,IAAI,CAACN;QACnB,CAAC,EAAE;UACD2B,MAAM,EAAE,IAAI,CAAC7B;QACf,CAAC;MACH,CAAC;IAAE,gBACDhE,KAAA,CAAAqE,aAAA,CAACpE,QAAQ,CAACG,IAAI;MAACkE,KAAK,EAAE,CAAC;QACnBC,SAAS,EAAE,CAAC;UACVsB,MAAM,EAAE,IAAI,CAAC5B;QACf,CAAC;MACH,CAAC,EACD,IAAI,CAACU,MAAM,CAACoB,cAAc;IAC1B,GACCA,cAAc,CAACY,eAAe,gBAAI3G,KAAA,CAAAqE,aAAA,CAAC1D,mBAAmB;MACvDiG,KAAK,EAAEb,cAAc,CAACY,eAAgB;MACtCpD,QAAQ,EAAEwC,cAAc,CAACc,kBAAmB;MAC5CC,IAAI,EAAEf,cAAc,CAACgB,cAAe;MACpCC,MAAM,EAAEjB,cAAc,CAACkB,gBAAiB;MACxCC,UAAU,EAAEnB,cAAc,CAACoB,oBAAqB;MAChD7C,KAAK,EAAE;QAACkB,YAAY,EAAE,IAAI,CAACb,MAAM,CAACC,IAAI,CAACY;MAAY;IAAE,CACjC,CAAC,GAAI,IAAI,eAC7BxF,KAAA,CAAAqE,aAAA,CAACjE,IAAI;MAACkE,KAAK,EAAE,IAAI,CAACK,MAAM,CAACyC;IAAkB,CAAO,CACrC,CACF,CACF,CACT,CAAC;EAEX;AACF"}
@@ -42,7 +42,7 @@ BASE_THEME.registerStyle((themeVariables, addStyle) => {
42
42
  backgroundColor: themeVariables.tabActiveIndicatorBgColor,
43
43
  width: 100,
44
44
  height: 2,
45
- marginTop: -4
45
+ marginTop: -2
46
46
  },
47
47
  activeHeaderIcon: {
48
48
  text: {
@@ -1 +1 @@
1
- {"version":3,"names":["BASE_THEME","DEFAULT_CLASS","registerStyle","themeVariables","addStyle","defaultStyles","root","flexDirection","minWidth","overflow","backgroundColor","tabHeaderBgColor","text","header","paddingTop","paddingBottom","paddingVertical","minHeight","justifyContent","flexGrow","headerIcon","color","tabHeaderIconColor","icon","fontSize","headerText","tabHeaderTextColor","fontFamily","baseFont","fontWeight","activeHeader","tabActiveHeaderBgColor","activeIndicator","tabActiveIndicatorBgColor","width","height","marginTop","activeHeaderIcon","tabActiveHeaderIconColor","activeHeaderText","tabActiveHeaderTextColor","arrowIndicator","display","backgroundImage","backgroundSize","backgroundPosition","backgroundRepeat","arrowIndicatorDot","skeleton"],"sources":["tabheader.styles.ts"],"sourcesContent":["import BASE_THEME from '@wavemaker/app-rn-runtime/styles/theme';\nimport { BaseStyles } from '@wavemaker/app-rn-runtime/core/base.component';\nimport { TextStyle, ViewStyle } from 'react-native';\nimport { WmIconStyles } from '@wavemaker/app-rn-runtime/components/basic/icon/icon.styles';\nimport { WmSkeletonStyles } from '@wavemaker/app-rn-runtime/components/basic/skeleton/skeleton.styles';\n\nexport type WmTabheaderStyles = BaseStyles & {\n activeIndicator: ViewStyle,\n header: ViewStyle,\n headerIcon: WmIconStyles,\n headerText: TextStyle,\n arrowIndicator: ViewStyle,\n arrowIndicatorDot: ViewStyle,\n activeHeader: ViewStyle,\n activeHeaderIcon: WmIconStyles,\n activeHeaderText: TextStyle,\n skeleton: WmSkeletonStyles \n};\n\nexport const DEFAULT_CLASS = 'app-tabheader';\nBASE_THEME.registerStyle((themeVariables, addStyle) => {\n const defaultStyles = {\n root: {\n flexDirection: 'row',\n minWidth: '100%',\n overflow: 'visible',\n backgroundColor: themeVariables.tabHeaderBgColor,\n },\n text: {},\n header: {\n backgroundColor: themeVariables.tabHeaderBgColor,\n paddingTop: 16,\n paddingBottom: 16,\n paddingVertical: 12,\n minWidth: 80,\n minHeight:48,\n flexDirection: 'row',\n justifyContent: 'center',\n flexGrow: 1\n },\n headerIcon: {\n text: {\n color: themeVariables.tabHeaderIconColor\n },\n icon: {\n fontSize : 24\n }\n } as WmIconStyles,\n headerText: {\n color: themeVariables.tabHeaderTextColor,\n overflow: 'visible',\n fontFamily: themeVariables.baseFont,\n fontWeight: '500',\n fontSize: 14,\n },\n activeHeader: {\n backgroundColor: themeVariables.tabActiveHeaderBgColor\n },\n activeIndicator: {\n backgroundColor: themeVariables.tabActiveIndicatorBgColor,\n width: 100,\n height: 2,\n marginTop: -4\n },\n activeHeaderIcon: {\n text: {\n color: themeVariables.tabActiveHeaderIconColor\n }\n } as WmIconStyles,\n activeHeaderText: {\n color: themeVariables.tabActiveHeaderTextColor \n },\n arrowIndicator: {\n display: 'none',\n backgroundImage: '',\n backgroundSize: '100% 100%',\n backgroundPosition: 'center',\n backgroundRepeat: 'no-repeat'\n },\n arrowIndicatorDot: {\n display: 'none'\n },\n skeleton: {} as WmSkeletonStyles\n } as WmTabheaderStyles;\n addStyle(DEFAULT_CLASS, '', defaultStyles);\n});"],"mappings":"AAAA,OAAOA,UAAU,MAAM,wCAAwC;AAmB/D,OAAO,MAAMC,aAAa,GAAG,eAAe;AAC5CD,UAAU,CAACE,aAAa,CAAC,CAACC,cAAc,EAAEC,QAAQ,KAAK;EACnD,MAAMC,aAAa,GAAG;IAClBC,IAAI,EAAE;MACFC,aAAa,EAAE,KAAK;MACpBC,QAAQ,EAAE,MAAM;MAChBC,QAAQ,EAAE,SAAS;MACnBC,eAAe,EAAEP,cAAc,CAACQ;IACpC,CAAC;IACDC,IAAI,EAAE,CAAC,CAAC;IACRC,MAAM,EAAE;MACJH,eAAe,EAAEP,cAAc,CAACQ,gBAAgB;MAChDG,UAAU,EAAE,EAAE;MACdC,aAAa,EAAE,EAAE;MACjBC,eAAe,EAAE,EAAE;MACnBR,QAAQ,EAAE,EAAE;MACZS,SAAS,EAAC,EAAE;MACZV,aAAa,EAAE,KAAK;MACpBW,cAAc,EAAE,QAAQ;MACxBC,QAAQ,EAAE;IACd,CAAC;IACDC,UAAU,EAAE;MACRR,IAAI,EAAE;QACFS,KAAK,EAAElB,cAAc,CAACmB;MAC1B,CAAC;MACDC,IAAI,EAAE;QACFC,QAAQ,EAAG;MACd;IACL,CAAiB;IACjBC,UAAU,EAAE;MACRJ,KAAK,EAAElB,cAAc,CAACuB,kBAAkB;MACxCjB,QAAQ,EAAE,SAAS;MACnBkB,UAAU,EAAExB,cAAc,CAACyB,QAAQ;MACnCC,UAAU,EAAE,KAAK;MACjBL,QAAQ,EAAE;IACd,CAAC;IACDM,YAAY,EAAE;MACVpB,eAAe,EAAEP,cAAc,CAAC4B;IACpC,CAAC;IACDC,eAAe,EAAE;MACbtB,eAAe,EAAEP,cAAc,CAAC8B,yBAAyB;MACzDC,KAAK,EAAE,GAAG;MACVC,MAAM,EAAE,CAAC;MACTC,SAAS,EAAE,CAAC;IAChB,CAAC;IACDC,gBAAgB,EAAE;MACdzB,IAAI,EAAE;QACFS,KAAK,EAAElB,cAAc,CAACmC;MAC1B;IACJ,CAAiB;IACjBC,gBAAgB,EAAE;MACdlB,KAAK,EAAElB,cAAc,CAACqC;IAC1B,CAAC;IACDC,cAAc,EAAE;MACZC,OAAO,EAAE,MAAM;MACfC,eAAe,EAAE,EAAE;MACnBC,cAAc,EAAE,WAAW;MAC3BC,kBAAkB,EAAE,QAAQ;MAC5BC,gBAAgB,EAAE;IACtB,CAAC;IACDC,iBAAiB,EAAE;MACfL,OAAO,EAAE;IACb,CAAC;IACDM,QAAQ,EAAE,CAAC;EACf,CAAsB;EACtB5C,QAAQ,CAACH,aAAa,EAAE,EAAE,EAAEI,aAAa,CAAC;AAC9C,CAAC,CAAC"}
1
+ {"version":3,"names":["BASE_THEME","DEFAULT_CLASS","registerStyle","themeVariables","addStyle","defaultStyles","root","flexDirection","minWidth","overflow","backgroundColor","tabHeaderBgColor","text","header","paddingTop","paddingBottom","paddingVertical","minHeight","justifyContent","flexGrow","headerIcon","color","tabHeaderIconColor","icon","fontSize","headerText","tabHeaderTextColor","fontFamily","baseFont","fontWeight","activeHeader","tabActiveHeaderBgColor","activeIndicator","tabActiveIndicatorBgColor","width","height","marginTop","activeHeaderIcon","tabActiveHeaderIconColor","activeHeaderText","tabActiveHeaderTextColor","arrowIndicator","display","backgroundImage","backgroundSize","backgroundPosition","backgroundRepeat","arrowIndicatorDot","skeleton"],"sources":["tabheader.styles.ts"],"sourcesContent":["import BASE_THEME from '@wavemaker/app-rn-runtime/styles/theme';\nimport { BaseStyles } from '@wavemaker/app-rn-runtime/core/base.component';\nimport { TextStyle, ViewStyle } from 'react-native';\nimport { WmIconStyles } from '@wavemaker/app-rn-runtime/components/basic/icon/icon.styles';\nimport { WmSkeletonStyles } from '@wavemaker/app-rn-runtime/components/basic/skeleton/skeleton.styles';\n\nexport type WmTabheaderStyles = BaseStyles & {\n activeIndicator: ViewStyle,\n header: ViewStyle,\n headerIcon: WmIconStyles,\n headerText: TextStyle,\n arrowIndicator: ViewStyle,\n arrowIndicatorDot: ViewStyle,\n activeHeader: ViewStyle,\n activeHeaderIcon: WmIconStyles,\n activeHeaderText: TextStyle,\n skeleton: WmSkeletonStyles \n};\n\nexport const DEFAULT_CLASS = 'app-tabheader';\nBASE_THEME.registerStyle((themeVariables, addStyle) => {\n const defaultStyles = {\n root: {\n flexDirection: 'row',\n minWidth: '100%',\n overflow: 'visible',\n backgroundColor: themeVariables.tabHeaderBgColor,\n },\n text: {},\n header: {\n backgroundColor: themeVariables.tabHeaderBgColor,\n paddingTop: 16,\n paddingBottom: 16,\n paddingVertical: 12,\n minWidth: 80,\n minHeight:48,\n flexDirection: 'row',\n justifyContent: 'center',\n flexGrow: 1\n },\n headerIcon: {\n text: {\n color: themeVariables.tabHeaderIconColor\n },\n icon: {\n fontSize : 24\n }\n } as WmIconStyles,\n headerText: {\n color: themeVariables.tabHeaderTextColor,\n overflow: 'visible',\n fontFamily: themeVariables.baseFont,\n fontWeight: '500',\n fontSize: 14,\n },\n activeHeader: {\n backgroundColor: themeVariables.tabActiveHeaderBgColor\n },\n activeIndicator: {\n backgroundColor: themeVariables.tabActiveIndicatorBgColor,\n width: 100,\n height: 2,\n marginTop: -2\n },\n activeHeaderIcon: {\n text: {\n color: themeVariables.tabActiveHeaderIconColor\n }\n } as WmIconStyles,\n activeHeaderText: {\n color: themeVariables.tabActiveHeaderTextColor \n },\n arrowIndicator: {\n display: 'none',\n backgroundImage: '',\n backgroundSize: '100% 100%',\n backgroundPosition: 'center',\n backgroundRepeat: 'no-repeat'\n },\n arrowIndicatorDot: {\n display: 'none'\n },\n skeleton: {} as WmSkeletonStyles\n } as WmTabheaderStyles;\n addStyle(DEFAULT_CLASS, '', defaultStyles);\n});"],"mappings":"AAAA,OAAOA,UAAU,MAAM,wCAAwC;AAmB/D,OAAO,MAAMC,aAAa,GAAG,eAAe;AAC5CD,UAAU,CAACE,aAAa,CAAC,CAACC,cAAc,EAAEC,QAAQ,KAAK;EACnD,MAAMC,aAAa,GAAG;IAClBC,IAAI,EAAE;MACFC,aAAa,EAAE,KAAK;MACpBC,QAAQ,EAAE,MAAM;MAChBC,QAAQ,EAAE,SAAS;MACnBC,eAAe,EAAEP,cAAc,CAACQ;IACpC,CAAC;IACDC,IAAI,EAAE,CAAC,CAAC;IACRC,MAAM,EAAE;MACJH,eAAe,EAAEP,cAAc,CAACQ,gBAAgB;MAChDG,UAAU,EAAE,EAAE;MACdC,aAAa,EAAE,EAAE;MACjBC,eAAe,EAAE,EAAE;MACnBR,QAAQ,EAAE,EAAE;MACZS,SAAS,EAAC,EAAE;MACZV,aAAa,EAAE,KAAK;MACpBW,cAAc,EAAE,QAAQ;MACxBC,QAAQ,EAAE;IACd,CAAC;IACDC,UAAU,EAAE;MACRR,IAAI,EAAE;QACFS,KAAK,EAAElB,cAAc,CAACmB;MAC1B,CAAC;MACDC,IAAI,EAAE;QACFC,QAAQ,EAAG;MACd;IACL,CAAiB;IACjBC,UAAU,EAAE;MACRJ,KAAK,EAAElB,cAAc,CAACuB,kBAAkB;MACxCjB,QAAQ,EAAE,SAAS;MACnBkB,UAAU,EAAExB,cAAc,CAACyB,QAAQ;MACnCC,UAAU,EAAE,KAAK;MACjBL,QAAQ,EAAE;IACd,CAAC;IACDM,YAAY,EAAE;MACVpB,eAAe,EAAEP,cAAc,CAAC4B;IACpC,CAAC;IACDC,eAAe,EAAE;MACbtB,eAAe,EAAEP,cAAc,CAAC8B,yBAAyB;MACzDC,KAAK,EAAE,GAAG;MACVC,MAAM,EAAE,CAAC;MACTC,SAAS,EAAE,CAAC;IAChB,CAAC;IACDC,gBAAgB,EAAE;MACdzB,IAAI,EAAE;QACFS,KAAK,EAAElB,cAAc,CAACmC;MAC1B;IACJ,CAAiB;IACjBC,gBAAgB,EAAE;MACdlB,KAAK,EAAElB,cAAc,CAACqC;IAC1B,CAAC;IACDC,cAAc,EAAE;MACZC,OAAO,EAAE,MAAM;MACfC,eAAe,EAAE,EAAE;MACnBC,cAAc,EAAE,WAAW;MAC3BC,kBAAkB,EAAE,QAAQ;MAC5BC,gBAAgB,EAAE;IACtB,CAAC;IACDC,iBAAiB,EAAE;MACfL,OAAO,EAAE;IACb,CAAC;IACDM,QAAQ,EAAE,CAAC;EACf,CAAsB;EACtB5C,QAAQ,CAACH,aAAa,EAAE,EAAE,EAAEI,aAAa,CAAC;AAC9C,CAAC,CAAC"}
@@ -10,11 +10,15 @@ export class WmTabpaneState extends BaseComponentState {
10
10
  constructor() {
11
11
  super(...arguments);
12
12
  _defineProperty(this, "isPartialLoaded", false);
13
+ _defineProperty(this, "isActive", false);
13
14
  }
14
15
  }
15
16
  export default class WmTabpane extends BaseComponent {
16
17
  constructor(props) {
17
- super(props, DEFAULT_CLASS, new WmTabpaneProps());
18
+ super(props, DEFAULT_CLASS, new WmTabpaneProps(), new WmTabpaneState());
19
+ this.subscribe('scroll', event => {
20
+ return this.state.isActive;
21
+ });
18
22
  }
19
23
  onPartialLoad() {
20
24
  this.invokeEventCallback('onLoad', [null, this]);
@@ -32,15 +36,24 @@ export default class WmTabpane extends BaseComponent {
32
36
  }
33
37
  return props.children;
34
38
  }
39
+ showView() {
40
+ return this.isVisible() && this.state.isActive;
41
+ }
35
42
  componentDidMount() {
36
43
  const tabs = this.parent;
37
44
  tabs.addTabPane(this.proxy);
38
45
  super.componentDidMount();
39
46
  }
40
47
  _onSelect() {
48
+ this.updateState({
49
+ isActive: true
50
+ });
41
51
  this.invokeEventCallback('onSelect', [null, this.proxy]);
42
52
  }
43
53
  _onDeselect() {
54
+ this.updateState({
55
+ isActive: false
56
+ });
44
57
  this.invokeEventCallback('onDeselect', [null, this.proxy]);
45
58
  }
46
59
  select() {
@@ -1 +1 @@
1
- {"version":3,"names":["React","View","BaseComponent","BaseComponentState","WmTabpaneProps","DEFAULT_CLASS","WmTabpaneState","constructor","arguments","_defineProperty","WmTabpane","props","onPartialLoad","invokeEventCallback","renderContent","renderPartial","state","isPartialLoaded","setTimeout","updateState","bind","children","componentDidMount","tabs","parent","addTabPane","proxy","_onSelect","_onDeselect","select","selectTabPane","renderWidget","createElement","style","styles","root","_background"],"sources":["tabpane.component.tsx"],"sourcesContent":["import React from 'react';\nimport { View } from 'react-native';\nimport { BaseComponent, BaseComponentState } from '@wavemaker/app-rn-runtime/core/base.component';\n\nimport WmTabpaneProps from './tabpane.props';\nimport { DEFAULT_CLASS, WmTabpaneStyles } from './tabpane.styles';\nimport WmTabs from '../tabs.component';\n\nexport class WmTabpaneState extends BaseComponentState<WmTabpaneProps> {\n isPartialLoaded = false;\n}\n\nexport default class WmTabpane extends BaseComponent<WmTabpaneProps, WmTabpaneState, WmTabpaneStyles> {\n\n constructor(props: WmTabpaneProps) {\n super(props, DEFAULT_CLASS, new WmTabpaneProps());\n }\n\n onPartialLoad() {\n this.invokeEventCallback('onLoad', [null, this]);\n }\n\n renderContent(props: WmTabpaneProps) {\n if (props.renderPartial) {\n if (!this.state.isPartialLoaded) {\n setTimeout(() => {\n this.updateState({\n isPartialLoaded: true\n } as WmTabpaneState);\n });\n }\n return props.renderPartial(props, this.onPartialLoad.bind(this));\n }\n return props.children;\n }\n\n componentDidMount() {\n const tabs = (this.parent) as WmTabs;\n tabs.addTabPane(this.proxy as WmTabpane);\n super.componentDidMount();\n }\n\n _onSelect() {\n this.invokeEventCallback('onSelect', [null, this.proxy]);\n }\n _onDeselect() {\n this.invokeEventCallback('onDeselect', [null, this.proxy]);\n }\n\n select() {\n (this.parent as WmTabs).selectTabPane(this);\n }\n\n renderWidget(props: WmTabpaneProps) {\n return (<View style={this.styles.root}>{this._background}{this.renderContent(props)}</View>);\n }\n}\n"],"mappings":";;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,IAAI,QAAQ,cAAc;AACnC,SAASC,aAAa,EAAEC,kBAAkB,QAAQ,+CAA+C;AAEjG,OAAOC,cAAc,MAAM,iBAAiB;AAC5C,SAASC,aAAa,QAAyB,kBAAkB;AAGjE,OAAO,MAAMC,cAAc,SAASH,kBAAkB,CAAiB;EAAAI,YAAA;IAAA,SAAAC,SAAA;IAAAC,eAAA,0BACnD,KAAK;EAAA;AACzB;AAEA,eAAe,MAAMC,SAAS,SAASR,aAAa,CAAkD;EAEpGK,WAAWA,CAACI,KAAqB,EAAE;IACjC,KAAK,CAACA,KAAK,EAAEN,aAAa,EAAE,IAAID,cAAc,CAAC,CAAC,CAAC;EACnD;EAEAQ,aAAaA,CAAA,EAAG;IACd,IAAI,CAACC,mBAAmB,CAAC,QAAQ,EAAE,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;EAClD;EAEAC,aAAaA,CAACH,KAAqB,EAAE;IACnC,IAAIA,KAAK,CAACI,aAAa,EAAE;MACvB,IAAI,CAAC,IAAI,CAACC,KAAK,CAACC,eAAe,EAAE;QAC/BC,UAAU,CAAC,MAAM;UACf,IAAI,CAACC,WAAW,CAAC;YACfF,eAAe,EAAE;UACnB,CAAmB,CAAC;QACtB,CAAC,CAAC;MACJ;MACA,OAAON,KAAK,CAACI,aAAa,CAACJ,KAAK,EAAE,IAAI,CAACC,aAAa,CAACQ,IAAI,CAAC,IAAI,CAAC,CAAC;IAClE;IACA,OAAOT,KAAK,CAACU,QAAQ;EACvB;EAEAC,iBAAiBA,CAAA,EAAG;IAClB,MAAMC,IAAI,GAAI,IAAI,CAACC,MAAiB;IACpCD,IAAI,CAACE,UAAU,CAAC,IAAI,CAACC,KAAkB,CAAC;IACxC,KAAK,CAACJ,iBAAiB,CAAC,CAAC;EAC3B;EAEAK,SAASA,CAAA,EAAG;IACV,IAAI,CAACd,mBAAmB,CAAC,UAAU,EAAE,CAAC,IAAI,EAAE,IAAI,CAACa,KAAK,CAAC,CAAC;EAC1D;EACAE,WAAWA,CAAA,EAAG;IACZ,IAAI,CAACf,mBAAmB,CAAC,YAAY,EAAE,CAAC,IAAI,EAAE,IAAI,CAACa,KAAK,CAAC,CAAC;EAC5D;EAEAG,MAAMA,CAAA,EAAG;IACN,IAAI,CAACL,MAAM,CAAYM,aAAa,CAAC,IAAI,CAAC;EAC7C;EAEAC,YAAYA,CAACpB,KAAqB,EAAE;IAClC,oBAAQX,KAAA,CAAAgC,aAAA,CAAC/B,IAAI;MAACgC,KAAK,EAAE,IAAI,CAACC,MAAM,CAACC;IAAK,GAAE,IAAI,CAACC,WAAW,EAAE,IAAI,CAACtB,aAAa,CAACH,KAAK,CAAQ,CAAC;EAC7F;AACF"}
1
+ {"version":3,"names":["React","View","BaseComponent","BaseComponentState","WmTabpaneProps","DEFAULT_CLASS","WmTabpaneState","constructor","arguments","_defineProperty","WmTabpane","props","subscribe","event","state","isActive","onPartialLoad","invokeEventCallback","renderContent","renderPartial","isPartialLoaded","setTimeout","updateState","bind","children","showView","isVisible","componentDidMount","tabs","parent","addTabPane","proxy","_onSelect","_onDeselect","select","selectTabPane","renderWidget","createElement","style","styles","root","_background"],"sources":["tabpane.component.tsx"],"sourcesContent":["import React from 'react';\nimport { View } from 'react-native';\nimport { BaseComponent, BaseComponentState } from '@wavemaker/app-rn-runtime/core/base.component';\n\nimport WmTabpaneProps from './tabpane.props';\nimport { DEFAULT_CLASS, WmTabpaneStyles } from './tabpane.styles';\nimport WmTabs from '../tabs.component';\n\nexport class WmTabpaneState extends BaseComponentState<WmTabpaneProps> {\n isPartialLoaded = false;\n isActive = false;\n}\n\nexport default class WmTabpane extends BaseComponent<WmTabpaneProps, WmTabpaneState, WmTabpaneStyles> {\n\n constructor(props: WmTabpaneProps) {\n super(props, DEFAULT_CLASS, new WmTabpaneProps(), new WmTabpaneState());\n this.subscribe('scroll', (event: any) => {\n return this.state.isActive;\n });\n }\n\n onPartialLoad() {\n this.invokeEventCallback('onLoad', [null, this]);\n }\n\n renderContent(props: WmTabpaneProps) {\n if (props.renderPartial) {\n if (!this.state.isPartialLoaded) {\n setTimeout(() => {\n this.updateState({\n isPartialLoaded: true\n } as WmTabpaneState);\n });\n }\n return props.renderPartial(props, this.onPartialLoad.bind(this));\n }\n return props.children;\n }\n\n showView(): boolean {\n return this.isVisible() && this.state.isActive;\n }\n\n componentDidMount() {\n const tabs = (this.parent) as WmTabs;\n tabs.addTabPane(this.proxy as WmTabpane);\n super.componentDidMount();\n }\n\n _onSelect() {\n this.updateState({\n isActive: true\n } as WmTabpaneState);\n this.invokeEventCallback('onSelect', [null, this.proxy]);\n }\n _onDeselect() {\n this.updateState({\n isActive: false\n } as WmTabpaneState);\n this.invokeEventCallback('onDeselect', [null, this.proxy]);\n }\n\n select() {\n (this.parent as WmTabs).selectTabPane(this);\n }\n\n renderWidget(props: WmTabpaneProps) {\n return (<View style={this.styles.root}>\n {this._background}\n {this.renderContent(props)}\n </View>);\n }\n}\n"],"mappings":";;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,IAAI,QAAQ,cAAc;AACnC,SAASC,aAAa,EAAEC,kBAAkB,QAAQ,+CAA+C;AAEjG,OAAOC,cAAc,MAAM,iBAAiB;AAC5C,SAASC,aAAa,QAAyB,kBAAkB;AAGjE,OAAO,MAAMC,cAAc,SAASH,kBAAkB,CAAiB;EAAAI,YAAA;IAAA,SAAAC,SAAA;IAAAC,eAAA,0BACnD,KAAK;IAAAA,eAAA,mBACZ,KAAK;EAAA;AAClB;AAEA,eAAe,MAAMC,SAAS,SAASR,aAAa,CAAkD;EA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AC,CAAC;EAC1D;EACAE,WAAWA,CAAA,EAAG;IACZ,IAAI,CAACX,WAAW,CAAC;MACfP,QAAQ,EAAE;IACZ,CAAmB,CAAC;IACpB,IAAI,CAACE,mBAAmB,CAAC,YAAY,EAAE,CAAC,IAAI,EAAE,IAAI,CAACc,KAAK,CAAC,CAAC;EAC5D;EAEAG,MAAMA,CAAA,EAAG;IACN,IAAI,CAACL,MAAM,CAAYM,aAAa,CAAC,IAAI,CAAC;EAC7C;EAEAC,YAAYA,CAACzB,KAAqB,EAAE;IAClC,oBAAQX,KAAA,CAAAqC,aAAA,CAACpC,IAAI;MAACqC,KAAK,EAAE,IAAI,CAACC,MAAM,CAACC;IAAK,GACjC,IAAI,CAACC,WAAW,EAChB,IAAI,CAACvB,aAAa,CAACP,KAAK,CACrB,CAAC;EACX;AACF"}
@@ -81,6 +81,9 @@ export default class WmTabs extends BaseComponent {
81
81
  selectTabPane(tabPane) {
82
82
  this.goToTab(this.tabPanes.indexOf(tabPane));
83
83
  }
84
+ get selectedTabPane() {
85
+ return this.tabPanes[this.state.selectedTabIndex];
86
+ }
84
87
  goToTab() {
85
88
  var _this$tabLayout2, _this$animationView;
86
89
  let index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.state.selectedTabIndex;