@wavemaker/app-rn-runtime 12.0.0-next.45752 → 12.0.0-rc.5849

Sign up to get free protection for your applications and to get access to all the features.
Files changed (196) hide show
  1. app-rn-runtime/components/advanced/carousel/carousel.component.js +13 -2
  2. app-rn-runtime/components/advanced/carousel/carousel.component.js.map +1 -1
  3. app-rn-runtime/components/advanced/carousel/carousel.props.js +1 -0
  4. app-rn-runtime/components/advanced/carousel/carousel.props.js.map +1 -1
  5. app-rn-runtime/components/advanced/carousel/carousel.styles.js +15 -0
  6. app-rn-runtime/components/advanced/carousel/carousel.styles.js.map +1 -1
  7. app-rn-runtime/components/basic/anchor/anchor.component.js +15 -5
  8. app-rn-runtime/components/basic/anchor/anchor.component.js.map +1 -1
  9. app-rn-runtime/components/basic/anchor/anchor.styles.js +3 -0
  10. app-rn-runtime/components/basic/anchor/anchor.styles.js.map +1 -1
  11. app-rn-runtime/components/basic/button/button.component.js +15 -2
  12. app-rn-runtime/components/basic/button/button.component.js.map +1 -1
  13. app-rn-runtime/components/basic/icon/icon.component.js +10 -2
  14. app-rn-runtime/components/basic/icon/icon.component.js.map +1 -1
  15. app-rn-runtime/components/basic/label/label.component.js +13 -3
  16. app-rn-runtime/components/basic/label/label.component.js.map +1 -1
  17. app-rn-runtime/components/basic/label/label.styles.js.map +1 -1
  18. app-rn-runtime/components/basic/search/search.component.js +9 -0
  19. app-rn-runtime/components/basic/search/search.component.js.map +1 -1
  20. app-rn-runtime/components/basic/search/search.props.js +2 -0
  21. app-rn-runtime/components/basic/search/search.props.js.map +1 -1
  22. app-rn-runtime/components/basic/search/search.styles.js +5 -0
  23. app-rn-runtime/components/basic/search/search.styles.js.map +1 -1
  24. app-rn-runtime/components/basic/skeleton/skeleton.component.js +4 -3
  25. app-rn-runtime/components/basic/skeleton/skeleton.component.js.map +1 -1
  26. app-rn-runtime/components/basic/skeleton/skeleton.props.js +9 -1
  27. app-rn-runtime/components/basic/skeleton/skeleton.props.js.map +1 -1
  28. app-rn-runtime/components/chart/area-chart/area-chart.component.js +2 -1
  29. app-rn-runtime/components/chart/area-chart/area-chart.component.js.map +1 -1
  30. app-rn-runtime/components/chart/area-chart/area-chart.styles.js +7 -1
  31. app-rn-runtime/components/chart/area-chart/area-chart.styles.js.map +1 -1
  32. app-rn-runtime/components/chart/bar-chart/bar-chart.styles.js +7 -1
  33. app-rn-runtime/components/chart/bar-chart/bar-chart.styles.js.map +1 -1
  34. app-rn-runtime/components/chart/basechart.component.js +23 -0
  35. app-rn-runtime/components/chart/basechart.component.js.map +1 -1
  36. app-rn-runtime/components/chart/basechart.props.js +2 -2
  37. app-rn-runtime/components/chart/basechart.props.js.map +1 -1
  38. app-rn-runtime/components/chart/basechart.styles.js.map +1 -1
  39. app-rn-runtime/components/chart/bubble-chart/bubble-chart.component.js +1 -1
  40. app-rn-runtime/components/chart/bubble-chart/bubble-chart.component.js.map +1 -1
  41. app-rn-runtime/components/chart/bubble-chart/bubble-chart.styles.js +7 -1
  42. app-rn-runtime/components/chart/bubble-chart/bubble-chart.styles.js.map +1 -1
  43. app-rn-runtime/components/chart/column-chart/column-chart.styles.js +7 -1
  44. app-rn-runtime/components/chart/column-chart/column-chart.styles.js.map +1 -1
  45. app-rn-runtime/components/chart/donut-chart/donut-chart.styles.js +7 -1
  46. app-rn-runtime/components/chart/donut-chart/donut-chart.styles.js.map +1 -1
  47. app-rn-runtime/components/chart/line-chart/line-chart.props.js +2 -0
  48. app-rn-runtime/components/chart/line-chart/line-chart.props.js.map +1 -1
  49. app-rn-runtime/components/chart/line-chart/line-chart.styles.js +7 -1
  50. app-rn-runtime/components/chart/line-chart/line-chart.styles.js.map +1 -1
  51. app-rn-runtime/components/chart/pie-chart/pie-chart.component.js +2 -1
  52. app-rn-runtime/components/chart/pie-chart/pie-chart.component.js.map +1 -1
  53. app-rn-runtime/components/chart/pie-chart/pie-chart.styles.js +7 -1
  54. app-rn-runtime/components/chart/pie-chart/pie-chart.styles.js.map +1 -1
  55. app-rn-runtime/components/container/accordion/accordion.component.js +58 -11
  56. app-rn-runtime/components/container/accordion/accordion.component.js.map +1 -1
  57. app-rn-runtime/components/container/accordion/accordion.props.js.map +1 -1
  58. app-rn-runtime/components/container/accordion/accordion.styles.js +4 -0
  59. app-rn-runtime/components/container/accordion/accordion.styles.js.map +1 -1
  60. app-rn-runtime/components/container/accordion/accordionpane/accordionpane.component.js +11 -1
  61. app-rn-runtime/components/container/accordion/accordionpane/accordionpane.component.js.map +1 -1
  62. app-rn-runtime/components/container/container.component.js +36 -2
  63. app-rn-runtime/components/container/container.component.js.map +1 -1
  64. app-rn-runtime/components/container/container.styles.js +7 -0
  65. app-rn-runtime/components/container/container.styles.js.map +1 -1
  66. app-rn-runtime/components/container/layoutgrid/gridrow/gridrow.component.js +5 -1
  67. app-rn-runtime/components/container/layoutgrid/gridrow/gridrow.component.js.map +1 -1
  68. app-rn-runtime/components/container/layoutgrid/gridrow/gridrow.styles.js +6 -1
  69. app-rn-runtime/components/container/layoutgrid/gridrow/gridrow.styles.js.map +1 -1
  70. app-rn-runtime/components/container/layoutgrid/layoutgrid.component.js +28 -2
  71. app-rn-runtime/components/container/layoutgrid/layoutgrid.component.js.map +1 -1
  72. app-rn-runtime/components/container/layoutgrid/layoutgrid.props.js.map +1 -1
  73. app-rn-runtime/components/container/layoutgrid/layoutgrid.styles.js +4 -1
  74. app-rn-runtime/components/container/layoutgrid/layoutgrid.styles.js.map +1 -1
  75. app-rn-runtime/components/container/linearlayout/linearlayout.component.js +31 -5
  76. app-rn-runtime/components/container/linearlayout/linearlayout.component.js.map +1 -1
  77. app-rn-runtime/components/container/linearlayout/linearlayout.props.js.map +1 -1
  78. app-rn-runtime/components/container/linearlayout/linearlayout.styles.js +4 -1
  79. app-rn-runtime/components/container/linearlayout/linearlayout.styles.js.map +1 -1
  80. app-rn-runtime/components/container/panel/panel.component.js +43 -4
  81. app-rn-runtime/components/container/panel/panel.component.js.map +1 -1
  82. app-rn-runtime/components/container/panel/panel.props.js.map +1 -1
  83. app-rn-runtime/components/container/panel/panel.styles.js +3 -0
  84. app-rn-runtime/components/container/panel/panel.styles.js.map +1 -1
  85. app-rn-runtime/components/container/partial-host.component.js.map +1 -1
  86. app-rn-runtime/components/container/tabs/tabheader/tabheader.component.js +2 -2
  87. app-rn-runtime/components/container/tabs/tabheader/tabheader.component.js.map +1 -1
  88. app-rn-runtime/components/container/tabs/tabpane/tabpane.component.js +11 -1
  89. app-rn-runtime/components/container/tabs/tabpane/tabpane.component.js.map +1 -1
  90. app-rn-runtime/components/container/tabs/tabs.component.js +38 -5
  91. app-rn-runtime/components/container/tabs/tabs.component.js.map +1 -1
  92. app-rn-runtime/components/container/tabs/tabs.styles.js +4 -1
  93. app-rn-runtime/components/container/tabs/tabs.styles.js.map +1 -1
  94. app-rn-runtime/components/container/tile/tile.component.js +28 -2
  95. app-rn-runtime/components/container/tile/tile.component.js.map +1 -1
  96. app-rn-runtime/components/container/tile/tile.props.js.map +1 -1
  97. app-rn-runtime/components/container/tile/tile.styles.js +6 -1
  98. app-rn-runtime/components/container/tile/tile.styles.js.map +1 -1
  99. app-rn-runtime/components/container/wizard/wizard.component.js +39 -6
  100. app-rn-runtime/components/container/wizard/wizard.component.js.map +1 -1
  101. app-rn-runtime/components/container/wizard/wizard.props.js.map +1 -1
  102. app-rn-runtime/components/container/wizard/wizard.styles.js +3 -0
  103. app-rn-runtime/components/container/wizard/wizard.styles.js.map +1 -1
  104. app-rn-runtime/components/container/wizard/wizardstep/wizardstep.component.js +4 -1
  105. app-rn-runtime/components/container/wizard/wizardstep/wizardstep.component.js.map +1 -1
  106. app-rn-runtime/components/data/card/card-content/card-content.component.js +6 -2
  107. app-rn-runtime/components/data/card/card-content/card-content.component.js.map +1 -1
  108. app-rn-runtime/components/data/card/card-content/card-content.styles.js +4 -1
  109. app-rn-runtime/components/data/card/card-content/card-content.styles.js.map +1 -1
  110. app-rn-runtime/components/data/card/card.component.js +18 -0
  111. app-rn-runtime/components/data/card/card.component.js.map +1 -1
  112. app-rn-runtime/components/data/card/card.styles.js +3 -0
  113. app-rn-runtime/components/data/card/card.styles.js.map +1 -1
  114. app-rn-runtime/components/data/form/form.component.js +1 -1
  115. app-rn-runtime/components/data/form/form.component.js.map +1 -1
  116. app-rn-runtime/components/data/form/form.props.js +1 -0
  117. app-rn-runtime/components/data/form/form.props.js.map +1 -1
  118. app-rn-runtime/components/data/list/list-template/list-template.component.js +15 -1
  119. app-rn-runtime/components/data/list/list-template/list-template.component.js.map +1 -1
  120. app-rn-runtime/components/data/list/list-template/list-template.props.js +1 -0
  121. app-rn-runtime/components/data/list/list-template/list-template.props.js.map +1 -1
  122. app-rn-runtime/components/data/list/list-template/list-template.styles.js +11 -1
  123. app-rn-runtime/components/data/list/list-template/list-template.styles.js.map +1 -1
  124. app-rn-runtime/components/data/list/list.component.js +32 -24
  125. app-rn-runtime/components/data/list/list.component.js.map +1 -1
  126. app-rn-runtime/components/data/list/list.props.js +1 -0
  127. app-rn-runtime/components/data/list/list.props.js.map +1 -1
  128. app-rn-runtime/components/data/list/list.styles.js +9 -0
  129. app-rn-runtime/components/data/list/list.styles.js.map +1 -1
  130. app-rn-runtime/components/dialogs/dialog/dialog.styles.js.map +1 -1
  131. app-rn-runtime/components/input/checkbox/checkbox.styles.js.map +1 -1
  132. app-rn-runtime/components/input/checkboxset/checkboxset.component.js +21 -1
  133. app-rn-runtime/components/input/checkboxset/checkboxset.component.js.map +1 -1
  134. app-rn-runtime/components/input/checkboxset/checkboxset.props.js +1 -0
  135. app-rn-runtime/components/input/checkboxset/checkboxset.props.js.map +1 -1
  136. app-rn-runtime/components/input/checkboxset/checkboxset.styles.js +1 -0
  137. app-rn-runtime/components/input/checkboxset/checkboxset.styles.js.map +1 -1
  138. app-rn-runtime/components/input/radioset/radioset.component.js +21 -1
  139. app-rn-runtime/components/input/radioset/radioset.component.js.map +1 -1
  140. app-rn-runtime/components/input/radioset/radioset.props.js +1 -0
  141. app-rn-runtime/components/input/radioset/radioset.props.js.map +1 -1
  142. app-rn-runtime/components/input/radioset/radioset.styles.js +1 -0
  143. app-rn-runtime/components/input/radioset/radioset.styles.js.map +1 -1
  144. app-rn-runtime/components/input/text/text.component.js +21 -0
  145. app-rn-runtime/components/input/text/text.component.js.map +1 -1
  146. app-rn-runtime/components/input/text/text.props.js +2 -0
  147. app-rn-runtime/components/input/text/text.props.js.map +1 -1
  148. app-rn-runtime/components/input/text/text.styles.js.map +1 -1
  149. app-rn-runtime/components/input/textarea/textarea.component.js +21 -0
  150. app-rn-runtime/components/input/textarea/textarea.component.js.map +1 -1
  151. app-rn-runtime/components/input/textarea/textarea.props.js +2 -0
  152. app-rn-runtime/components/input/textarea/textarea.props.js.map +1 -1
  153. app-rn-runtime/components/navigation/popover/popover.component.js.map +1 -1
  154. app-rn-runtime/components/page/content/content.component.js +19 -4
  155. app-rn-runtime/components/page/content/content.component.js.map +1 -1
  156. app-rn-runtime/components/page/page-content/page-content.component.js +27 -2
  157. app-rn-runtime/components/page/page-content/page-content.component.js.map +1 -1
  158. app-rn-runtime/components/page/page-content/page-content.props.js +2 -2
  159. app-rn-runtime/components/page/page-content/page-content.props.js.map +1 -1
  160. app-rn-runtime/components/page/page-content/page-content.styles.js +6 -1
  161. app-rn-runtime/components/page/page-content/page-content.styles.js.map +1 -1
  162. app-rn-runtime/components/page/page.component.js.map +1 -1
  163. app-rn-runtime/components/page/page.props.js.map +1 -1
  164. app-rn-runtime/components/page/page.styles.js +7 -1
  165. app-rn-runtime/components/page/page.styles.js.map +1 -1
  166. app-rn-runtime/components/page/partial/partial.component.js +27 -1
  167. app-rn-runtime/components/page/partial/partial.component.js.map +1 -1
  168. app-rn-runtime/components/page/partial/partial.props.js.map +1 -1
  169. app-rn-runtime/components/page/partial/partial.styles.js +6 -1
  170. app-rn-runtime/components/page/partial/partial.styles.js.map +1 -1
  171. app-rn-runtime/components/prefab/prefab-container.component.js +27 -1
  172. app-rn-runtime/components/prefab/prefab-container.component.js.map +1 -1
  173. app-rn-runtime/components/prefab/prefab-container.props.js.map +1 -1
  174. app-rn-runtime/components/prefab/prefab-container.styles.js +6 -1
  175. app-rn-runtime/components/prefab/prefab-container.styles.js.map +1 -1
  176. app-rn-runtime/core/base.component.js +3 -2
  177. app-rn-runtime/core/base.component.js.map +1 -1
  178. app-rn-runtime/core/props.provider.js +0 -1
  179. app-rn-runtime/core/props.provider.js.map +1 -1
  180. app-rn-runtime/core/tappable.component.js +10 -4
  181. app-rn-runtime/core/tappable.component.js.map +1 -1
  182. app-rn-runtime/core/utils.js +5 -0
  183. app-rn-runtime/core/utils.js.map +1 -1
  184. app-rn-runtime/package.json +3 -3
  185. app-rn-runtime/runtime/App.js +2 -7
  186. app-rn-runtime/runtime/App.js.map +1 -1
  187. app-rn-runtime/runtime/base-fragment.component.js +28 -13
  188. app-rn-runtime/runtime/base-fragment.component.js.map +1 -1
  189. app-rn-runtime/runtime/base-partial.component.js.map +1 -1
  190. app-rn-runtime/runtime/base-prefab.component.js.map +1 -1
  191. app-rn-runtime/runtime/services/app-security.service.js +17 -1
  192. app-rn-runtime/runtime/services/app-security.service.js.map +1 -1
  193. app-rn-runtime/styles/theme.js +5 -0
  194. app-rn-runtime/styles/theme.js.map +1 -1
  195. app-rn-runtime/styles/theme.variables.js +1 -0
  196. app-rn-runtime/styles/theme.variables.js.map +1 -1
@@ -1 +1 @@
1
- {"version":3,"names":["BASE_THEME","defineStyles","Platform","DEFAULT_CLASS","registerStyle","themeVariables","addStyle","defaultStyles","root","backgroundColor","panelBgColor","borderStyle","borderWidth","padding","borderRadius","text","color","panelHeaderTextColor","fontSize","fontWeight","header","flexDirection","panelHeaderBgColor","paddingHorizontal","paddingVertical","borderColor","borderTopLeftRadius","borderTopRightRadius","heading","subheading","icon","alignSelf","toggleIcon","badge","badgeTextColor","marginRight","default","labelDefaultColor","success","labelSuccessColor","danger","labelDangerColor","warning","labelWarningColor","info","labelInfoColor","primary","labelPrimaryColor","OS","textAlign","getPanelBgStyles","panelTextColor","panelDangerColor","panelDefaultColor","panelInfoColor","panelPrimaryColor","panelSuccessColor","panelWarningColor"],"sources":["panel.styles.ts"],"sourcesContent":["import BASE_THEME, { AllStyle } from '@wavemaker/app-rn-runtime/styles/theme';\nimport { BaseStyles, defineStyles } from '@wavemaker/app-rn-runtime/core/base.component';\nimport { WmIconStyles } from '@wavemaker/app-rn-runtime/components/basic/icon/icon.styles';\nimport { Platform } from 'react-native';\n\nexport type WmPanelStyles = BaseStyles & {\n icon: WmIconStyles,\n badge: AllStyle,\n header: AllStyle,\n subheading: AllStyle\n};\n\nexport const DEFAULT_CLASS = 'app-panel';\nBASE_THEME.registerStyle((themeVariables, addStyle) => {\n const defaultStyles: WmPanelStyles = defineStyles({\n root: {\n backgroundColor: themeVariables.panelBgColor,\n borderStyle: 'solid',\n borderWidth: 0,\n padding: 12,\n borderRadius: 6\n },\n text: {\n color: themeVariables.panelHeaderTextColor,\n fontSize: 16,\n fontWeight: 'bold'\n },\n header: {\n flexDirection: 'row',\n backgroundColor: themeVariables.panelHeaderBgColor,\n paddingHorizontal: 8,\n paddingVertical: 4,\n borderStyle: 'solid',\n borderWidth: 0,\n borderColor: themeVariables.panelHeaderBgColor,\n borderTopLeftRadius: 6,\n borderTopRightRadius: 6\n },\n heading: {\n paddingHorizontal: 16\n },\n subheading: {\n paddingHorizontal: 16\n },\n icon: {\n root: {\n alignSelf: 'auto',\n fontSize: 32,\n },\n } as WmIconStyles,\n toggleIcon: {\n root: {\n fontSize: 16,\n },\n } as WmIconStyles,\n badge: {\n color: themeVariables.badgeTextColor,\n marginRight: 8,\n alignSelf: 'center'\n },\n default: {\n backgroundColor: themeVariables.labelDefaultColor\n },\n success: {\n backgroundColor: themeVariables.labelSuccessColor\n },\n danger: {\n backgroundColor: themeVariables.labelDangerColor\n },\n warning: {\n backgroundColor: themeVariables.labelWarningColor\n },\n info: {\n backgroundColor: themeVariables.labelInfoColor\n },\n primary: {\n backgroundColor: themeVariables.labelPrimaryColor\n }\n });\n\n addStyle(DEFAULT_CLASS, '', defaultStyles);\n addStyle(DEFAULT_CLASS + '-rtl', '', Platform.OS==\"web\"?{\n text:{\n textAlign:'right',\n } ,\n subheading:{\n textAlign:'right',\n }\n }:{});\n const getPanelBgStyles = (color: string) => {\n return {\n header: {\n backgroundColor: color\n },\n text: {\n color: themeVariables.panelTextColor\n },\n subheading: {\n color: themeVariables.panelTextColor\n },\n icon: {\n text: {\n color: themeVariables.panelTextColor\n }\n } as WmIconStyles\n } as WmPanelStyles;\n };\n\n addStyle('panel-danger', '', getPanelBgStyles(themeVariables.panelDangerColor));\n addStyle('panel-default', '', getPanelBgStyles(themeVariables.panelDefaultColor));\n addStyle('panel-info', '', getPanelBgStyles(themeVariables.panelInfoColor));\n addStyle('panel-primary', '', getPanelBgStyles(themeVariables.panelPrimaryColor));\n addStyle('panel-success', '', getPanelBgStyles(themeVariables.panelSuccessColor));\n addStyle('panel-warning', '', getPanelBgStyles(themeVariables.panelWarningColor));\n});"],"mappings":"AAAA,OAAOA,UAAU,MAAoB,wCAAwC;AAC7E,SAAqBC,YAAY,QAAQ,+CAA+C;AAExF,SAASC,QAAQ,QAAQ,cAAc;AASvC,OAAO,MAAMC,aAAa,GAAG,WAAW;AACxCH,UAAU,CAACI,aAAa,CAAC,CAACC,cAAc,EAAEC,QAAQ,KAAK;EACrD,MAAMC,aAA4B,GAAGN,YAAY,CAAC;IAC9CO,IAAI,EAAE;MACJC,eAAe,EAAEJ,cAAc,CAACK,YAAY;MAC5CC,WAAW,EAAE,OAAO;MACpBC,WAAW,EAAE,CAAC;MACdC,OAAO,EAAE,EAAE;MACXC,YAAY,EAAE;IAChB,CAAC;IACDC,IAAI,EAAE;MACJC,KAAK,EAAEX,cAAc,CAACY,oBAAoB;MAC1CC,QAAQ,EAAE,EAAE;MACZC,UAAU,EAAE;IACd,CAAC;IACDC,MAAM,EAAE;MACNC,aAAa,EAAE,KAAK;MACpBZ,eAAe,EAAEJ,cAAc,CAACiB,kBAAkB;MAClDC,iBAAiB,EAAE,CAAC;MACpBC,eAAe,EAAE,CAAC;MA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C;EACL,MAAMC,gBAAgB,GAAIlC,KAAa,IAAK;IAC1C,OAAO;MACLI,MAAM,EAAE;QACNX,eAAe,EAAEO;MACnB,CAAC;MACDD,IAAI,EAAE;QACJC,KAAK,EAAEX,cAAc,CAAC8C;MACxB,CAAC;MACDtB,UAAU,EAAE;QACVb,KAAK,EAAEX,cAAc,CAAC8C;MACxB,CAAC;MACDrB,IAAI,EAAE;QACJf,IAAI,EAAE;UACJC,KAAK,EAAEX,cAAc,CAAC8C;QACxB;MACF;IACF,CAAC;EACH,CAAC;EAED7C,QAAQ,CAAC,cAAc,EAAE,EAAE,EAAE4C,gBAAgB,CAAC7C,cAAc,CAAC+C,gBAAgB,CAAC,CAAC;EAC/E9C,QAAQ,CAAC,eAAe,EAAE,EAAE,EAAE4C,gBAAgB,CAAC7C,cAAc,CAACgD,iBAAiB,CAAC,CAAC;EACjF/C,QAAQ,CAAC,YAAY,EAAE,EAAE,EAAE4C,gBAAgB,CAAC7C,cAAc,CAACiD,cAAc,CAAC,CAAC;EAC3EhD,QAAQ,CAAC,eAAe,EAAE,EAAE,EAAE4C,gBAAgB,CAAC7C,cAAc,CAACkD,iBAAiB,CAAC,CAAC;EACjFjD,QAAQ,CAAC,eAAe,EAAE,EAAE,EAAE4C,gBAAgB,CAAC7C,cAAc,CAACmD,iBAAiB,CAAC,CAAC;EACjFlD,QAAQ,CAAC,eAAe,EAAE,EAAE,EAAE4C,gBAAgB,CAAC7C,cAAc,CAACoD,iBAAiB,CAAC,CAAC;AACnF,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["BASE_THEME","defineStyles","Platform","DEFAULT_CLASS","registerStyle","themeVariables","addStyle","defaultStyles","root","backgroundColor","panelBgColor","borderStyle","borderWidth","padding","borderRadius","text","color","panelHeaderTextColor","fontSize","fontWeight","header","flexDirection","panelHeaderBgColor","paddingHorizontal","paddingVertical","borderColor","borderTopLeftRadius","borderTopRightRadius","heading","subheading","icon","alignSelf","toggleIcon","badge","badgeTextColor","marginRight","default","labelDefaultColor","success","labelSuccessColor","danger","labelDangerColor","warning","labelWarningColor","info","labelInfoColor","primary","labelPrimaryColor","skeleton","OS","textAlign","getPanelBgStyles","panelTextColor","panelDangerColor","panelDefaultColor","panelInfoColor","panelPrimaryColor","panelSuccessColor","panelWarningColor"],"sources":["panel.styles.ts"],"sourcesContent":["import BASE_THEME, { AllStyle } from '@wavemaker/app-rn-runtime/styles/theme';\nimport { BaseStyles, defineStyles } from '@wavemaker/app-rn-runtime/core/base.component';\nimport { WmIconStyles } from '@wavemaker/app-rn-runtime/components/basic/icon/icon.styles';\nimport { Platform } from 'react-native';\nimport { WmSkeletonStyles } from '@wavemaker/app-rn-runtime/components/basic/skeleton/skeleton.styles';\n\nexport type WmPanelStyles = BaseStyles & {\n icon: WmIconStyles,\n badge: AllStyle,\n header: AllStyle,\n subheading: AllStyle,\n skeleton: WmSkeletonStyles\n};\n\nexport const DEFAULT_CLASS = 'app-panel';\nBASE_THEME.registerStyle((themeVariables, addStyle) => {\n const defaultStyles: WmPanelStyles = defineStyles({\n root: {\n backgroundColor: themeVariables.panelBgColor,\n borderStyle: 'solid',\n borderWidth: 0,\n padding: 12,\n borderRadius: 6\n },\n text: {\n color: themeVariables.panelHeaderTextColor,\n fontSize: 16,\n fontWeight: 'bold'\n },\n header: {\n flexDirection: 'row',\n backgroundColor: themeVariables.panelHeaderBgColor,\n paddingHorizontal: 8,\n paddingVertical: 4,\n borderStyle: 'solid',\n borderWidth: 0,\n borderColor: themeVariables.panelHeaderBgColor,\n borderTopLeftRadius: 6,\n borderTopRightRadius: 6\n },\n heading: {\n paddingHorizontal: 16\n },\n subheading: {\n paddingHorizontal: 16\n },\n icon: {\n root: {\n alignSelf: 'auto',\n fontSize: 32,\n },\n } as WmIconStyles,\n toggleIcon: {\n root: {\n fontSize: 16,\n },\n } as WmIconStyles,\n badge: {\n color: themeVariables.badgeTextColor,\n marginRight: 8,\n alignSelf: 'center'\n },\n default: {\n backgroundColor: themeVariables.labelDefaultColor\n },\n success: {\n backgroundColor: themeVariables.labelSuccessColor\n },\n danger: {\n backgroundColor: themeVariables.labelDangerColor\n },\n warning: {\n backgroundColor: themeVariables.labelWarningColor\n },\n info: {\n backgroundColor: themeVariables.labelInfoColor\n },\n primary: {\n backgroundColor: themeVariables.labelPrimaryColor\n },\n skeleton: {\n root: {\n }\n } as WmSkeletonStyles, \n });\n\n addStyle(DEFAULT_CLASS, '', defaultStyles);\n addStyle(DEFAULT_CLASS + '-rtl', '', Platform.OS==\"web\"?{\n text:{\n textAlign:'right',\n } ,\n subheading:{\n textAlign:'right',\n }\n }:{});\n const getPanelBgStyles = (color: string) => {\n return {\n header: {\n backgroundColor: color\n },\n text: {\n color: themeVariables.panelTextColor\n },\n subheading: {\n color: themeVariables.panelTextColor\n },\n icon: {\n text: {\n color: themeVariables.panelTextColor\n }\n } as WmIconStyles\n } as WmPanelStyles;\n };\n\n addStyle('panel-danger', '', getPanelBgStyles(themeVariables.panelDangerColor));\n addStyle('panel-default', '', getPanelBgStyles(themeVariables.panelDefaultColor));\n addStyle('panel-info', '', getPanelBgStyles(themeVariables.panelInfoColor));\n addStyle('panel-primary', '', getPanelBgStyles(themeVariables.panelPrimaryColor));\n addStyle('panel-success', '', getPanelBgStyles(themeVariables.panelSuccessColor));\n addStyle('panel-warning', '', getPanelBgStyles(themeVariables.panelWarningColor));\n});"],"mappings":"AAAA,OAAOA,UAAU,MAAoB,wCAAwC;AAC7E,SAAqBC,YAAY,QAAQ,+CAA+C;AAExF,SAASC,QAAQ,QAAQ,cAAc;AAWvC,OAAO,MAAMC,aAAa,GAAG,WAAW;AACxCH,UAAU,CAACI,aAAa,CAAC,CAACC,cAAc,EAAEC,QAAQ,KAAK;EACrD,MAAMC,aAA4B,GAAGN,YAAY,CAAC;IAC9CO,IAAI,EAAE;MACJC,eAAe,EAAEJ,cAAc,CAACK,YAAY;MAC5CC,WAAW,EAAE,OAAO;MACpBC,WAAW,EAAE,CAAC;MACdC,OAAO,EAAE,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CAAC9C,cAAc,CAACqD,iBAAiB,CAAC,CAAC;AACnF,CAAC,CAAC","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["BaseComponent","BaseComponentState","BaseProps","PartialHostState","constructor","args","_defineProperty","PartialHostProps","PartialHost","markupProps","defaultClass","defaultProps","defaultState","onPartialLoad","invokeEventCallback","renderContent","props","renderPartial","state","isPartialLoaded","isVisible","setTimeout","updateState","bind","children"],"sources":["partial-host.component.tsx"],"sourcesContent":["import { BaseComponent, BaseComponentState, BaseProps, BaseStyles } from \"@wavemaker/app-rn-runtime/core/base.component\";\n\nexport abstract class PartialHostState<T extends BaseProps> extends BaseComponentState<T> {\n isPartialLoaded = false;\n}\n\nexport abstract class PartialHostProps extends BaseProps {\n renderPartial?: Function;\n children?: any;\n}\n\nexport abstract class PartialHost<T extends BaseProps, S extends PartialHostState<T>, L extends BaseStyles>\n extends BaseComponent<T, S, L> {\n\n constructor(markupProps: T, defaultClass: string, defaultProps?: T, defaultState?: S) {\n super(markupProps, defaultClass, defaultProps, defaultState);\n }\n\n onPartialLoad() {\n this.invokeEventCallback('onLoad', [this]);\n }\n\n renderContent(props: PartialHostProps) {\n if (props.renderPartial) {\n if (!this.state.isPartialLoaded && !this.isVisible()) {\n return null;\n }\n if (!this.state.isPartialLoaded) {\n setTimeout(() => {\n this.updateState({\n isPartialLoaded: true\n } as any);\n });\n }\n return props.renderPartial(props, this.onPartialLoad.bind(this));\n }\n return props.children;\n }\n\n}"],"mappings":";;;AAAA,SAASA,aAAa,EAAEC,kBAAkB,EAAEC,SAAS,QAAoB,+CAA+C;AAExH,OAAO,MAAeC,gBAAgB,SAA8BF,kBAAkB,CAAI;EAAAG,YAAA,GAAAC,IAAA;IAAA,SAAAA,IAAA;IAAAC,eAAA,0BACpE,KAAK;EAAA;AAC3B;AAEA,OAAO,MAAeC,gBAAgB,SAASL,SAAS,CAAC;EAAAE,YAAA,GAAAC,IAAA;IAAA,SAAAA,IAAA;IAAAC,eAAA;IAAAA,eAAA;EAAA;AAGzD;AAEA,OAAO,MAAeE,WAAW,SACrBR,aAAa,CAAU;EAE/BI,WAAWA,CAACK,WAAc,EAAEC,YAAoB,EAAEC,YAAgB,EAAEC,YAAgB,EAAE;IAClF,KAAK,CAACH,WAAW,EAAEC,YAAY,EAAEC,YAAY,EAAEC,YAAY,CAAC;EAChE;EAEAC,aAAaA,CAAA,EAAG;IACZ,IAAI,CAACC,mBAAmB,CAAC,QAAQ,EAAE,CAAC,IAAI,CAAC,CAAC;EAC9C;EAEAC,aAAaA,CAACC,KAAuB,EAAE;IACnC,IAAIA,KAAK,CAACC,aAAa,EAAE;MACrB,IAAI,CAAC,IAAI,CAACC,KAAK,CAACC,eAAe,IAAI,CAAC,IAAI,CAACC,SAAS,CAAC,CAAC,EAAE;QAClD,OAAO,IAAI;MACf;MACA,IAAI,CAAC,IAAI,CAACF,KAAK,CAACC,eAAe,EAAE;QAC7BE,UAAU,CAAC,MAAM;UACb,IAAI,CAACC,WAAW,CAAC;YACbH,eAAe,EAAE;UACrB,CAAQ,CAAC;QACb,CAAC,CAAC;MACN;MACA,OAAOH,KAAK,CAACC,aAAa,CAACD,KAAK,EAAE,IAAI,CAACH,aAAa,CAACU,IAAI,CAAC,IAAI,CAAC,CAAC;IACpE;IACA,OAAOP,KAAK,CAACQ,QAAQ;EACzB;AAEJ","ignoreList":[]}
1
+ {"version":3,"names":["BaseComponent","BaseComponentState","BaseProps","PartialHostState","constructor","args","_defineProperty","PartialHostProps","PartialHost","markupProps","defaultClass","defaultProps","defaultState","onPartialLoad","invokeEventCallback","renderContent","props","renderPartial","state","isPartialLoaded","isVisible","setTimeout","updateState","bind","children"],"sources":["partial-host.component.tsx"],"sourcesContent":["import { BaseComponent, BaseComponentState, BaseProps, BaseStyles } from \"@wavemaker/app-rn-runtime/core/base.component\";\nimport { WmSkeletonStyles } from \"../basic/skeleton/skeleton.styles\";\n\n\nexport type PartialHostStyles = BaseStyles & {\n skeleton: WmSkeletonStyles\n}\nexport abstract class PartialHostState<T extends BaseProps> extends BaseComponentState<T> {\n isPartialLoaded = false;\n}\n\nexport abstract class PartialHostProps extends BaseProps {\n renderPartial?: Function;\n children?: any;\n }\n \n \nexport abstract class PartialHost<T extends PartialHostProps, S extends PartialHostState<T>, L extends PartialHostStyles>\n extends BaseComponent<T, S, L> {\n\n constructor(markupProps: T, defaultClass: string, defaultProps?: T, defaultState?: S) {\n super(markupProps, defaultClass, defaultProps, defaultState);\n }\n\n onPartialLoad() {\n this.invokeEventCallback('onLoad', [this]);\n }\n\n renderContent(props: PartialHostProps) {\n if (props.renderPartial) {\n if (!this.state.isPartialLoaded && !this.isVisible()) {\n return null;\n }\n if (!this.state.isPartialLoaded) {\n setTimeout(() => {\n this.updateState({\n isPartialLoaded: true\n } as any);\n });\n }\n return props.renderPartial(props, this.onPartialLoad.bind(this));\n }\n return props.children;\n }\n\n}"],"mappings":";;;AAAA,SAASA,aAAa,EAAEC,kBAAkB,EAAEC,SAAS,QAAoB,+CAA+C;AAOxH,OAAO,MAAeC,gBAAgB,SAA8BF,kBAAkB,CAAI;EAAAG,YAAA,GAAAC,IAAA;IAAA,SAAAA,IAAA;IAAAC,eAAA,0BACpE,KAAK;EAAA;AAC3B;AAEA,OAAO,MAAeC,gBAAgB,SAASL,SAAS,CAAC;EAAAE,YAAA,GAAAC,IAAA;IAAA,SAAAA,IAAA;IAAAC,eAAA;IAAAA,eAAA;EAAA;AAGvD;AAGF,OAAO,MAAeE,WAAW,SACrBR,aAAa,CAAU;EAE/BI,WAAWA,CAACK,WAAc,EAAEC,YAAoB,EAAEC,YAAgB,EAAEC,YAAgB,EAAE;IAClF,KAAK,CAACH,WAAW,EAAEC,YAAY,EAAEC,YAAY,EAAEC,YAAY,CAAC;EAChE;EAEAC,aAAaA,CAAA,EAAG;IACZ,IAAI,CAACC,mBAAmB,CAAC,QAAQ,EAAE,CAAC,IAAI,CAAC,CAAC;EAC9C;EAEAC,aAAaA,CAACC,KAAuB,EAAE;IACnC,IAAIA,KAAK,CAACC,aAAa,EAAE;MACrB,IAAI,CAAC,IAAI,CAACC,KAAK,CAACC,eAAe,IAAI,CAAC,IAAI,CAACC,SAAS,CAAC,CAAC,EAAE;QAClD,OAAO,IAAI;MACf;MACA,IAAI,CAAC,IAAI,CAACF,KAAK,CAACC,eAAe,EAAE;QAC7BE,UAAU,CAAC,MAAM;UACb,IAAI,CAACC,WAAW,CAAC;YACbH,eAAe,EAAE;UACrB,CAAQ,CAAC;QACb,CAAC,CAAC;MACN;MACA,OAAOH,KAAK,CAACC,aAAa,CAACD,KAAK,EAAE,IAAI,CAACH,aAAa,CAACU,IAAI,CAAC,IAAI,CAAC,CAAC;IACpE;IACA,OAAOP,KAAK,CAACQ,QAAQ;EACzB;AAEJ","ignoreList":[]}
@@ -42,8 +42,8 @@ export default class WmTabheader extends BaseComponent {
42
42
  }
43
43
  }
44
44
  setPosition() {
45
- var _this$state$props$sel, _this$headersLayout$s, _this$headerPanelLayo, _this$headerPanelLayo2;
46
- const selectedTabIndex = (_this$state$props$sel = this.state.props.selectedTabIndex) !== null && _this$state$props$sel !== void 0 ? _this$state$props$sel : 0;
45
+ var _this$headersLayout$s, _this$headerPanelLayo, _this$headerPanelLayo2;
46
+ const selectedTabIndex = this.state.props.selectedTabIndex ? this.state.props.selectedTabIndex : 0;
47
47
  let toIndicatorPosition = 0;
48
48
  let toIndicatorWidth = ((_this$headersLayout$s = this.headersLayout[selectedTabIndex]) === null || _this$headersLayout$s === void 0 ? void 0 : _this$headersLayout$s.width) || 0;
49
49
  let toHeaderScrollPosition = this.headerScrollPositionValue;
@@ -1 +1 @@
1
- {"version":3,"names":["React","Animated","Easing","Text","View","BaseComponent","BaseComponentState","WmTabheaderProps","DEFAULT_CLASS","Tappable","createSkeleton","BackgroundComponent","WmIcon","WmTabheaderState","WmTabheader","constructor","props","_defineProperty","Value","headerScrollPosition","addListener","value","headerScrollPositionValue","setHeaderPanelPositon","nativeEvent","headerPanelLayout","layout","forceUpdate","setHeaderPositon","index","headersLayout","selectedTabIndex","onTabSelection","state","onIndexChange","setPosition","_this$state$props$sel","_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","id","getTestId","mergeStyle","headerIcon","activeHeaderIcon","iconclass","icon","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';\nimport WmIcon from \"@wavemaker/app-rn-runtime/components/basic/icon/icon.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 ?? 0;\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 <WmIcon\n id={this.getTestId(i + 'icon')}\n styles={this.theme.mergeStyle({}, this.styles.headerIcon, isSelected ? this.styles.activeHeaderIcon : null)}\n iconclass={header.icon}></WmIcon>\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,oBAAo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AAc,CAACqB,kBAAmB;MAC5CC,IAAI,EAAEtB,cAAc,CAACuB,cAAe;MACpCC,MAAM,EAAExB,cAAc,CAACyB,gBAAiB;MACxCC,UAAU,EAAE1B,cAAc,CAAC2B,oBAAqB;MAChDpD,KAAK,EAAE;QAACkB,YAAY,EAAE,IAAI,CAACb,MAAM,CAACC,IAAI,CAACY;MAAY;IAAE,CACjC,CAAC,GAAI,IAAI,eAC7BzF,KAAA,CAAAsE,aAAA,CAAClE,IAAI;MAACmE,KAAK,EAAE,IAAI,CAACK,MAAM,CAACgD;IAAkB,CAAO,CACrC,CACF,CACF,CACT,CAAC;EAEX;AACF","ignoreList":[]}
1
+ {"version":3,"names":["React","Animated","Easing","Text","View","BaseComponent","BaseComponentState","WmTabheaderProps","DEFAULT_CLASS","Tappable","createSkeleton","BackgroundComponent","WmIcon","WmTabheaderState","WmTabheader","constructor","props","_defineProperty","Value","headerScrollPosition","addListener","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","id","getTestId","mergeStyle","headerIcon","activeHeaderIcon","iconclass","icon","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';\nimport WmIcon from \"@wavemaker/app-rn-runtime/components/basic/icon/icon.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 ? this.state.props.selectedTabIndex : 0\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 <WmIcon\n id={this.getTestId(i + 'icon')}\n styles={this.theme.mergeStyle({}, this.styles.headerIcon, isSelected ? this.styles.activeHeaderIcon : null)}\n iconclass={header.icon}></WmIcon>\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;AAC3F,OAAOC,MAAM,MAAM,gEAAgE;AAEnF,OAAO,MAAMC,gBAAgB,SAASP,kBAAkB,CAAmB;AAG3E,eAAe,MAAMQ,WAAW,SAAST,aAAa,CAAwD;EAU5GU,WAAWA,CAACC,KAAuB,EAAE;IACnC,KAAK,CAACA,KAAK,EAAER,aAAa,EAAE,IAAID,gBAAgB,CAAC,CAAC,EAAE,IAAIM,gBAAgB,CAAC,CAAC,CAAC;IAACI,eAAA,4BATjC,IAAI;IAAAA,eAAA,wBACN,EAAE;IAAAA,eAAA,+BACd,IAAIhB,QAAQ,CAACiB,KAAK,CAAC,CAAC,CAAC;IAAAD,eAAA,oCAChB,CAAC;IAAAA,eAAA,4BACT,IAAIhB,QAAQ,CAACiB,KAAK,CAAC,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CACF,CACE,CAAC;IAEf,CAAC,CACG,CAAC,eACPjH,KAAA,CAAAqE,aAAA,CAACpE,QAAQ,CAACG,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,CAACmB,eAAe,gBAAIlH,KAAA,CAAAqE,aAAA,CAAC1D,mBAAmB;MACvDwG,KAAK,EAAEpB,cAAc,CAACmB,eAAgB;MACtC3D,QAAQ,EAAEwC,cAAc,CAACqB,kBAAmB;MAC5CC,IAAI,EAAEtB,cAAc,CAACuB,cAAe;MACpCC,MAAM,EAAExB,cAAc,CAACyB,gBAAiB;MACxCC,UAAU,EAAE1B,cAAc,CAAC2B,oBAAqB;MAChDpD,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,CAACgD;IAAkB,CAAO,CACrC,CACF,CACF,CACT,CAAC;EAEX;AACF","ignoreList":[]}
@@ -16,6 +16,7 @@ export class WmTabpaneState extends BaseComponentState {
16
16
  export default class WmTabpane extends BaseComponent {
17
17
  constructor(props) {
18
18
  super(props, DEFAULT_CLASS, new WmTabpaneProps(), new WmTabpaneState());
19
+ _defineProperty(this, "paneId", "");
19
20
  this.subscribe('scroll', event => {
20
21
  return this.state.isActive;
21
22
  });
@@ -41,9 +42,18 @@ export default class WmTabpane extends BaseComponent {
41
42
  }
42
43
  componentDidMount() {
43
44
  const tabs = this.parent;
44
- tabs.addTabPane(this.proxy);
45
+ // When skeleton is enabled in the tabs component, the parent would be WMSkeleton which doesnot have addTabPane function
46
+ if (tabs.addTabPane) {
47
+ tabs.addTabPane(this.proxy);
48
+ }
45
49
  super.componentDidMount();
46
50
  }
51
+ componentWillUnmount() {
52
+ const tabs = this.parent;
53
+ if (tabs.removeTabPane) {
54
+ tabs.removeTabPane(this);
55
+ }
56
+ }
47
57
  _onSelect() {
48
58
  this.updateState({
49
59
  isActive: true
@@ -1 +1 @@
1
- {"version":3,"names":["React","ScrollView","BaseComponent","BaseComponentState","WmTabpaneProps","DEFAULT_CLASS","WmTabpaneState","constructor","args","_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","onScroll","notify","_background"],"sources":["tabpane.component.tsx"],"sourcesContent":["import React from 'react';\nimport { View } from 'react-native';\nimport { ScrollView } from 'react-native-gesture-handler'\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 (<ScrollView style={this.styles.root} \n onScroll={(event) => {this.notify('scroll', [event])}}>\n {this._background}\n {this.renderContent(props)}\n </ScrollView>);\n }\n}\n"],"mappings":";;;AAAA,OAAOA,KAAK,MAAM,OAAO;AAEzB,SAASC,UAAU,QAAQ,8BAA8B;AACzD,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,GAAAC,IAAA;IAAA,SAAAA,IAAA;IAAAC,eAAA,0BACnD,KAAK;IAAAA,eAAA,mBACZ,KAAK;EAAA;AAClB;AAEA,eAAe,MAAMC,SAAS,SAASR,aAAa,CAAkD;EAEpGK,WAAWA,CAACI,KAAqB,EAAE;IACjC,KAAK,CAACA,KAAK,EAAEN,aAAa,EAAE,IAAID,cAAc,CAAC,CAAC,EAAE,IAAIE,cAAc,CAAC,CAAC,CAAC;IACvE,IAAI,CAACM,SAAS,CAAC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,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,UAAU;MAACqC,KAAK,EAAE,IAAI,CAACC,MAAM,CAACC,IAAK;MAC5CC,QAAQ,EAAG5B,KAAK,IAAK;QAAC,IAAI,CAAC6B,MAAM,CAAC,QAAQ,EAAE,CAAC7B,KAAK,CAAC,CAAC;MAAA;IAAE,GACjD,IAAI,CAAC8B,WAAW,EAChB,IAAI,CAACzB,aAAa,CAACP,KAAK,CACf,CAAC;EACjB;AACF","ignoreList":[]}
1
+ {"version":3,"names":["React","ScrollView","BaseComponent","BaseComponentState","WmTabpaneProps","DEFAULT_CLASS","WmTabpaneState","constructor","args","_defineProperty","WmTabpane","props","subscribe","event","state","isActive","onPartialLoad","invokeEventCallback","renderContent","renderPartial","isPartialLoaded","setTimeout","updateState","bind","children","showView","isVisible","componentDidMount","tabs","parent","addTabPane","proxy","componentWillUnmount","removeTabPane","_onSelect","_onDeselect","select","selectTabPane","renderWidget","createElement","style","styles","root","onScroll","notify","_background"],"sources":["tabpane.component.tsx"],"sourcesContent":["import React from 'react';\nimport { View } from 'react-native';\nimport { ScrollView } from 'react-native-gesture-handler'\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 public paneId: string = \"\";\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 // When skeleton is enabled in the tabs component, the parent would be WMSkeleton which doesnot have addTabPane function\n if(tabs.addTabPane) {\n tabs.addTabPane(this.proxy as WmTabpane);\n }\n super.componentDidMount();\n }\n\n componentWillUnmount() {\n const tabs = (this.parent) as WmTabs;\n if(tabs.removeTabPane) {\n tabs.removeTabPane(this)\n }\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 (<ScrollView style={this.styles.root} \n onScroll={(event) => {this.notify('scroll', [event])}}>\n {this._background}\n {this.renderContent(props)}\n </ScrollView>);\n }\n}\n"],"mappings":";;;AAAA,OAAOA,KAAK,MAAM,OAAO;AAEzB,SAASC,UAAU,QAAQ,8BAA8B;AACzD,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,GAAAC,IAAA;IAAA,SAAAA,IAAA;IAAAC,eAAA,0BACnD,KAAK;IAAAA,eA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AAG;IACrB,MAAMJ,IAAI,GAAI,IAAI,CAACC,MAAiB;IACpC,IAAGD,IAAI,CAACK,aAAa,EAAE;MACrBL,IAAI,CAACK,aAAa,CAAC,IAAI,CAAC;IAC1B;EACF;EAEAC,SAASA,CAAA,EAAG;IACV,IAAI,CAACZ,WAAW,CAAC;MACfP,QAAQ,EAAE;IACZ,CAAmB,CAAC;IACpB,IAAI,CAACE,mBAAmB,CAAC,UAAU,EAAE,CAAC,IAAI,EAAE,IAAI,CAACc,KAAK,CAAC,CAAC;EAC1D;EACAI,WAAWA,CAAA,EAAG;IACZ,IAAI,CAACb,WAAW,CAAC;MACfP,QAAQ,EAAE;IACZ,CAAmB,CAAC;IACpB,IAAI,CAACE,mBAAmB,CAAC,YAAY,EAAE,CAAC,IAAI,EAAE,IAAI,CAACc,KAAK,CAAC,CAAC;EAC5D;EAEAK,MAAMA,CAAA,EAAG;IACN,IAAI,CAACP,MAAM,CAAYQ,aAAa,CAAC,IAAI,CAAC;EAC7C;EAEAC,YAAYA,CAAC3B,KAAqB,EAAE;IAClC,oBAAQX,KAAA,CAAAuC,aAAA,CAACtC,UAAU;MAACuC,KAAK,EAAE,IAAI,CAACC,MAAM,CAACC,IAAK;MAC5CC,QAAQ,EAAG9B,KAAK,IAAK;QAAC,IAAI,CAAC+B,MAAM,CAAC,QAAQ,EAAE,CAAC/B,KAAK,CAAC,CAAC;MAAA;IAAE,GACjD,IAAI,CAACgC,WAAW,EAChB,IAAI,CAAC3B,aAAa,CAACP,KAAK,CACf,CAAC;EACjB;AACF","ignoreList":[]}
@@ -9,6 +9,7 @@ import { isWebPreviewMode } from '@wavemaker/app-rn-runtime/core/utils';
9
9
  import WmTabsProps from './tabs.props';
10
10
  import { DEFAULT_CLASS } from './tabs.styles';
11
11
  import WmTabheader from './tabheader/tabheader.component';
12
+ import { createSkeleton } from '@wavemaker/app-rn-runtime/components/basic/skeleton/skeleton.component';
12
13
  export class WmTabsState extends BaseComponentState {
13
14
  constructor(...args) {
14
15
  super(...args);
@@ -71,11 +72,19 @@ export default class WmTabs extends BaseComponent {
71
72
  }
72
73
  }
73
74
  addTabPane(tabPane) {
74
- const i = this.tabPanes.findIndex(t => t.props.name === tabPane.props.name);
75
+ tabPane.paneId = `tabPane${this.newIndex++}`;
76
+ const i = this.tabPanes.findIndex(t => t.paneId === tabPane.paneId);
75
77
  if (i >= 0) {
76
78
  this.tabPanes[i] = tabPane;
77
79
  } else {
78
- this.tabPanes[this.newIndex++] = tabPane;
80
+ this.tabPanes.push(tabPane);
81
+ }
82
+ }
83
+ removeTabPane(tabPane) {
84
+ const i = this.tabPanes.findIndex(t => t.paneId === tabPane.paneId);
85
+ if (i >= 0) {
86
+ this.tabPanes.splice(i, 1);
87
+ this.newIndex--;
79
88
  }
80
89
  }
81
90
  selectTabPane(tabPane) {
@@ -122,7 +131,7 @@ export default class WmTabs extends BaseComponent {
122
131
  });
123
132
  });
124
133
  }
125
- renderSkeleton(props) {
134
+ renderSkeletonContent(props) {
126
135
  const tabPanes = React.Children.toArray(this.props.children).filter((item, index) => item.props.show != false);
127
136
  const headerData = tabPanes.map((p, i) => ({
128
137
  title: p.props.title || 'Tab Title',
@@ -167,6 +176,23 @@ export default class WmTabs extends BaseComponent {
167
176
  }, p);
168
177
  }))));
169
178
  }
179
+ renderSkeleton(props) {
180
+ if (!props.showskeletonchildren) {
181
+ var _this$props;
182
+ const skeletonStyles = ((_this$props = this.props) === null || _this$props === void 0 || (_this$props = _this$props.styles) === null || _this$props === void 0 ? void 0 : _this$props.skeleton) || {
183
+ root: {},
184
+ text: {}
185
+ };
186
+ return createSkeleton(this.theme, skeletonStyles, {
187
+ ...this.styles.root
188
+ }, /*#__PURE__*/React.createElement(View, {
189
+ style: [this.styles.root, {
190
+ opacity: 0
191
+ }]
192
+ }, this.renderSkeletonContent(props)));
193
+ }
194
+ return this.renderSkeletonContent(props);
195
+ }
170
196
  onPropertyChange(name, $new, $old) {
171
197
  super.onPropertyChange(name, $new, $old);
172
198
  switch (name) {
@@ -180,6 +206,9 @@ export default class WmTabs extends BaseComponent {
180
206
  });
181
207
  }
182
208
  }
209
+ getBackground() {
210
+ return this._showSkeleton ? null : this._background;
211
+ }
183
212
  renderWidget(props) {
184
213
  const tabPanes = React.Children.toArray(props.children).filter((item, index) => item.props.show != false);
185
214
  const headerData = tabPanes.map((p, i) => ({
@@ -187,9 +216,13 @@ export default class WmTabs extends BaseComponent {
187
216
  icon: p.props.paneicon || '',
188
217
  key: `tab-${p.props.title}-${i}`
189
218
  }));
219
+ const styles = this._showSkeleton ? {
220
+ ...this.styles.root,
221
+ ...this.styles.skeleton.root
222
+ } : this.styles.root;
190
223
  return /*#__PURE__*/React.createElement(View, {
191
- style: this.styles.root
192
- }, this._background, /*#__PURE__*/React.createElement(View, {
224
+ style: styles
225
+ }, this.getBackground(), /*#__PURE__*/React.createElement(View, {
193
226
  onLayout: this.setTabLayout.bind(this),
194
227
  style: {
195
228
  width: '100%'
@@ -1 +1 @@
1
- {"version":3,"names":["React","View","BaseComponent","BaseComponentState","SwipeAnimation","isWebPreviewMode","WmTabsProps","DEFAULT_CLASS","WmTabheader","WmTabsState","constructor","args","_defineProperty","WmTabs","props","bounds","e","_this$tabLayout","activeTabIndex","state","selectedTabIndex","w","tabLayout","width","noOfTabs","tabPanes","length","lower","center","upper","onLower","onChange","onUpper","setTabLayout","event","nativeEvent","layout","forceUpdate","goToTab","setTabPaneHeights","index","_nativeEvent$nativeEv","tabPaneHeights","height","setTabShown","tabIndex","callback","tabsShown","setTimeout","updateState","addTabPane","tabPane","i","findIndex","t","name","newIndex","selectTabPane","indexOf","selectedTabPane","_this$tabLayout2","position","animationView","setPosition","then","prev","_this$animationView","goToLower","next","_this$animationView2","oldIndex","deselectedTab","_onDeselect","selectedTab","_onSelect","invokeEventCallback","proxy","renderSkeleton","Children","toArray","children","filter","item","show","headerData","map","p","title","icon","key","createElement","style","styles","root","borderBottomWidth","onLayout","bind","tabHeader","data","showskeleton","overflow","flexDirection","flexWrap","alignSelf","onPropertyChange","$new","$old","selectedIndex","renderWidget","paneicon","_background","id","getTestId","onIndexChange","flex","maxHeight","tabContent","enableGestures","enablegestures","alignItems","direction","ref","r","handlers","animationHandlers","undefined"],"sources":["tabs.component.tsx"],"sourcesContent":["import React from 'react';\nimport { LayoutChangeEvent, LayoutRectangle, View } from 'react-native';\nimport { BaseComponent, BaseComponentState } from '@wavemaker/app-rn-runtime/core/base.component';\nimport * as SwipeAnimation from '@wavemaker/app-rn-runtime/gestures/swipe.animation';\nimport { isWebPreviewMode } from '@wavemaker/app-rn-runtime/core/utils';\n\nimport WmTabsProps from './tabs.props';\nimport { DEFAULT_CLASS, WmTabsStyles } from './tabs.styles';\nimport WmTabpane from './tabpane/tabpane.component';\nimport WmTabheader from './tabheader/tabheader.component';\n\nexport class WmTabsState extends BaseComponentState<WmTabsProps> {\n tabsShown: boolean[] = [];\n selectedTabIndex: number = 0;\n}\n\nexport default class WmTabs extends BaseComponent<WmTabsProps, WmTabsState, WmTabsStyles> {\n public tabPanes = [] as WmTabpane[];\n private newIndex = 0;\n private tabLayout: LayoutRectangle = null as any;\n private tabPaneHeights: number[] = [];\n private animationView: SwipeAnimation.View | null = null as any;\n private animationHandlers = {\n bounds: (e) => {\n const activeTabIndex = this.state.selectedTabIndex,\n w = this.tabLayout?.width || 0,\n noOfTabs = this.tabPanes.length;\n return {\n lower: -1 * (activeTabIndex - (activeTabIndex === 0 ? 0 : 1)) * w,\n center: -1 * activeTabIndex * w,\n upper: -1 * (activeTabIndex + (activeTabIndex === noOfTabs - 1 ? 0 : 1)) * w\n };\n },\n onLower: (e) => {\n this.onChange(this.state.selectedTabIndex - 1);\n },\n onUpper: (e) => {\n this.onChange(this.state.selectedTabIndex + 1);\n }\n } as SwipeAnimation.Handlers;\n\n constructor(props: WmTabsProps) {\n super(props, DEFAULT_CLASS, new WmTabsProps(), new WmTabsState());\n }\n\n setTabLayout(event: LayoutChangeEvent) {\n this.tabLayout = event.nativeEvent.layout;\n this.forceUpdate(() => {\n this.goToTab();\n });\n }\n\n setTabPaneHeights(index: number, nativeEvent: LayoutChangeEvent) {\n this.tabPaneHeights[index] = nativeEvent.nativeEvent.layout?.height;\n if (index === this.state.selectedTabIndex) {\n this.forceUpdate();\n }\n }\n\n setTabShown(tabIndex: number, callback: () => any) {\n if (!this.state.tabsShown[tabIndex]) {\n const tabsShown = [...this.state.tabsShown];\n tabsShown[tabIndex] = true;\n setTimeout(() => {\n this.updateState({\n tabsShown: tabsShown\n } as WmTabsState, callback);\n }, 300);\n } else {\n callback && callback();\n }\n }\n\n addTabPane(tabPane: WmTabpane) {\n const i = this.tabPanes.findIndex(t => t.props.name === tabPane.props.name);\n if (i >= 0) {\n this.tabPanes[i] = tabPane;\n } else {\n this.tabPanes[this.newIndex++] = tabPane;\n }\n }\n\n selectTabPane(tabPane: WmTabpane) {\n this.goToTab(this.tabPanes.indexOf(tabPane));\n }\n\n get selectedTabPane() {\n return this.tabPanes[this.state.selectedTabIndex];\n }\n\n goToTab(index = this.state.selectedTabIndex) {\n if (index < 0 || index >= this.tabPanes.length) {\n return;\n }\n const position = -1 * index * (this.tabLayout?.width || 0);\n if(this.animationView) {\n this.animationView.setPosition(position)\n .then(() => this.onChange(index));\n } else {\n this.onChange(index);\n }\n }\n\n prev() {\n this.animationView?.goToLower();\n }\n\n next() {\n this.animationView?.goToLower();\n }\n\n onChange(newIndex: number) {\n if (newIndex < 0 || newIndex >= this.tabPanes.length) {\n return;\n }\n const oldIndex = this.state.selectedTabIndex;\n const deselectedTab = this.tabPanes[this.state.selectedTabIndex];\n this.newIndex = newIndex;\n deselectedTab?._onDeselect();\n this.updateState({\n selectedTabIndex: newIndex\n } as WmTabsState, () => {\n this.setTabShown(newIndex, () => {\n const selectedTab = this.tabPanes[newIndex];\n selectedTab?._onSelect();\n this.invokeEventCallback('onChange', [{}, this.proxy, newIndex, oldIndex]);\n });\n });\n }\n\n public renderSkeleton(props: WmTabsProps){\n const tabPanes = React.Children.toArray(this.props.children)\n .filter((item: any, index: number) => item.props.show != false);\n const headerData = tabPanes.map((p: any, i: number) =>\n ({title: p.props.title || 'Tab Title', icon: '', key: `tab-${p.props.title}-${i}`}));\n return(\n <View style={[this.styles.root, { borderBottomWidth: 0}]}>\n <View onLayout={this.setTabLayout.bind(this)} style={{width: '100%'}}></View>\n <WmTabheader\n styles={this.styles.tabHeader}\n data={headerData}\n showskeleton={this.props.showskeleton}\n selectedTabIndex={this.state.selectedTabIndex}\n ></WmTabheader>\n <View\n //{...this.panResponder.panHandlers}\n style={{\n width: '100%',\n //height: this.tabPaneHeights[this.state.selectedTabIndex],\n overflow: 'hidden'\n }} >\n <View style={{\n flexDirection: 'row',\n flexWrap: 'nowrap'\n }}>\n {tabPanes.map((p: any, i) => {\n return (\n <View\n key={`tab-${p.props.title}-${i}`}\n style={{width: '100%', alignSelf: 'flex-start'}}\n onLayout={this.setTabPaneHeights.bind(this, i)}>\n {/* {this.state.tabsShown[i] ? p : null} */}\n {p}\n </View>);\n })}\n </View>\n </View>\n </View>\n\n )\n }\n\n public onPropertyChange(name: string, $new: any, $old: any): void {\n super.onPropertyChange(name, $new, $old);\n switch(name) {\n case \"defaultpaneindex\":\n const selectedIndex = $new || 0;\n const tabsShown: boolean[] = [];\n tabsShown[selectedIndex] = true;\n this.updateState({\n selectedTabIndex: selectedIndex,\n tabsShown: tabsShown\n } as WmTabsState);\n }\n }\n\n renderWidget(props: WmTabsProps) {\n const tabPanes = React.Children.toArray(props.children)\n .filter((item: any, index: number) => item.props.show != false);\n const headerData = tabPanes.map((p: any, i: number) =>\n ({title: p.props.title || 'Tab Title', icon: p.props.paneicon || '', key: `tab-${p.props.title}-${i}`}));\n return (\n <View style={this.styles.root}>\n {this._background}\n <View onLayout={this.setTabLayout.bind(this)} style={{width: '100%'}}></View>\n <WmTabheader\n id={this.getTestId('headers')}\n styles={this.styles.tabHeader}\n data={headerData}\n selectedTabIndex={this.state.selectedTabIndex}\n onIndexChange={this.goToTab.bind(this)}\n ></WmTabheader>\n <View\n style={[{\n width: '100%',\n flex: 1\n }, this.styles.root.height ?\n (isWebPreviewMode() ? {'overflowX': 'hidden','overflowY': 'auto'} as any : {overflow: 'scroll'})\n : {\n overflow: 'hidden',\n maxHeight: this.tabPaneHeights[this.state.selectedTabIndex],\n }, this.styles.tabContent]} >\n <SwipeAnimation.View\n enableGestures={props.enablegestures}\n style={{\n flexDirection: 'row',\n flexWrap: 'nowrap',\n alignItems: 'flex-start'\n }}\n direction='horizontal'\n ref={(r) => {this.animationView = r}}\n handlers = {this.animationHandlers}\n >\n {tabPanes.map((p: any, i) => {\n return (\n <View\n key={`tab-${p.props.title}-${i}`}\n style={{\n width: '100%',\n height: this.styles.root.height ? undefined : 1000000,\n alignSelf: 'flex-start'}}>\n <View\n style={{width: '100%', alignSelf: 'flex-start'}}\n onLayout={this.setTabPaneHeights.bind(this, i)}>\n {/* {this.state.tabsShown[i] ? p : null} */}\n {p}\n </View>\n </View>);\n })}\n </SwipeAnimation.View>\n </View>\n </View>\n );\n }\n}\n"],"mappings":";;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAA6CC,IAAI,QAAQ,cAAc;AACvE,SAASC,aAAa,EAAEC,kBAAkB,QAAQ,+CAA+C;AACjG,OAAO,KAAKC,cAAc,MAAM,oDAAoD;AACpF,SAASC,gBAAgB,QAAQ,sCAAsC;AAEvE,OAAOC,WAAW,MAAM,cAAc;AACtC,SAASC,aAAa,QAAsB,eAAe;AAE3D,OAAOC,WAAW,MAAM,iCAAiC;AAEzD,OAAO,MAAMC,WAAW,SAASN,kBAAkB,CAAc;EAAAO,YAAA,GAAAC,IAAA;IAAA,SAAAA,IAAA;IAAAC,eAAA,oBACxC,EAAE;IAAAA,eAAA,2BACE,CAAC;EAAA;AAC9B;AAEA,eAAe,MAAMC,MAAM,SAASX,aAAa,CAAyC;EAyBxFQ,WAAWA,CAACI,KAAkB,EAAE;IAC9B,KAAK,CAACA,KAAK,EAAEP,aAAa,EAAE,IAAID,WAA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C4D,GAAG,CAAC,CAACC,CAAM,EAAElC,CAAC,KAAK;MAC3B,oBACApD,KAAA,CAAA0F,aAAA,CAACzF,IAAI;QACHwF,GAAG,EAAE,OAAOH,CAAC,CAACxE,KAAK,CAACyE,KAAK,IAAInC,CAAC,EAAG;QACjCuC,KAAK,EAAE;UACLpE,KAAK,EAAE,MAAM;UACboB,MAAM,EAAE,IAAI,CAACiD,MAAM,CAACC,IAAI,CAAClD,MAAM,GAAIkF,SAAS,GAAG,OAAO;UACtDtB,SAAS,EAAE;QAAY;MAAE,gBAC3BvG,KAAA,CAAA0F,aAAA,CAACzF,IAAI;QACH0F,KAAK,EAAE;UAACpE,KAAK,EAAE,MAAM;UAAEgF,SAAS,EAAE;QAAY,CAAE;QAChDR,QAAQ,EAAE,IAAI,CAACxD,iBAAiB,CAACyD,IAAI,CAAC,IAAI,EAAE5C,CAAC;MAAE,GAE9CkC,CACG,CACF,CAAC;IACT,CAAC,CACkB,CACjB,CACF,CAAC;EAEX;AACF","ignoreList":[]}
1
+ {"version":3,"names":["React","View","BaseComponent","BaseComponentState","SwipeAnimation","isWebPreviewMode","WmTabsProps","DEFAULT_CLASS","WmTabheader","createSkeleton","WmTabsState","constructor","args","_defineProperty","WmTabs","props","bounds","e","_this$tabLayout","activeTabIndex","state","selectedTabIndex","w","tabLayout","width","noOfTabs","tabPanes","length","lower","center","upper","onLower","onChange","onUpper","setTabLayout","event","nativeEvent","layout","forceUpdate","goToTab","setTabPaneHeights","index","_nativeEvent$nativeEv","tabPaneHeights","height","setTabShown","tabIndex","callback","tabsShown","setTimeout","updateState","addTabPane","tabPane","paneId","newIndex","i","findIndex","t","push","removeTabPane","splice","selectTabPane","indexOf","selectedTabPane","_this$tabLayout2","position","animationView","setPosition","then","prev","_this$animationView","goToLower","next","_this$animationView2","oldIndex","deselectedTab","_onDeselect","selectedTab","_onSelect","invokeEventCallback","proxy","renderSkeletonContent","Children","toArray","children","filter","item","show","headerData","map","p","title","icon","key","createElement","style","styles","root","borderBottomWidth","onLayout","bind","tabHeader","data","showskeleton","overflow","flexDirection","flexWrap","alignSelf","renderSkeleton","showskeletonchildren","_this$props","skeletonStyles","skeleton","text","theme","opacity","onPropertyChange","name","$new","$old","selectedIndex","getBackground","_showSkeleton","_background","renderWidget","paneicon","id","getTestId","onIndexChange","flex","maxHeight","tabContent","enableGestures","enablegestures","alignItems","direction","ref","r","handlers","animationHandlers","undefined"],"sources":["tabs.component.tsx"],"sourcesContent":["import React from 'react';\nimport { LayoutChangeEvent, LayoutRectangle, View } from 'react-native';\nimport { BaseComponent, BaseComponentState } from '@wavemaker/app-rn-runtime/core/base.component';\nimport * as SwipeAnimation from '@wavemaker/app-rn-runtime/gestures/swipe.animation';\nimport { isWebPreviewMode } from '@wavemaker/app-rn-runtime/core/utils';\n\nimport WmTabsProps from './tabs.props';\nimport { DEFAULT_CLASS, WmTabsStyles } from './tabs.styles';\nimport WmTabpane from './tabpane/tabpane.component';\nimport WmTabheader from './tabheader/tabheader.component';\nimport { WmSkeletonStyles } from '@wavemaker/app-rn-runtime/components/basic/skeleton/skeleton.styles';\nimport { createSkeleton } from '@wavemaker/app-rn-runtime/components/basic/skeleton/skeleton.component';\n\nexport class WmTabsState extends BaseComponentState<WmTabsProps> {\n tabsShown: boolean[] = [];\n selectedTabIndex: number = 0;\n}\n\nexport default class WmTabs extends BaseComponent<WmTabsProps, WmTabsState, WmTabsStyles> {\n public tabPanes = [] as WmTabpane[];\n private newIndex = 0;\n private tabLayout: LayoutRectangle = null as any;\n private tabPaneHeights: number[] = [];\n private animationView: SwipeAnimation.View | null = null as any;\n private animationHandlers = {\n bounds: (e) => {\n const activeTabIndex = this.state.selectedTabIndex,\n w = this.tabLayout?.width || 0,\n noOfTabs = this.tabPanes.length;\n return {\n lower: -1 * (activeTabIndex - (activeTabIndex === 0 ? 0 : 1)) * w,\n center: -1 * activeTabIndex * w,\n upper: -1 * (activeTabIndex + (activeTabIndex === noOfTabs - 1 ? 0 : 1)) * w\n };\n },\n onLower: (e) => {\n this.onChange(this.state.selectedTabIndex - 1);\n },\n onUpper: (e) => {\n this.onChange(this.state.selectedTabIndex + 1);\n }\n } as SwipeAnimation.Handlers;\n\n constructor(props: WmTabsProps) {\n super(props, DEFAULT_CLASS, new WmTabsProps(), new WmTabsState());\n }\n\n setTabLayout(event: LayoutChangeEvent) {\n this.tabLayout = event.nativeEvent.layout;\n this.forceUpdate(() => {\n this.goToTab();\n });\n }\n\n setTabPaneHeights(index: number, nativeEvent: LayoutChangeEvent) {\n this.tabPaneHeights[index] = nativeEvent.nativeEvent.layout?.height;\n if (index === this.state.selectedTabIndex) {\n this.forceUpdate();\n }\n }\n\n setTabShown(tabIndex: number, callback: () => any) {\n if (!this.state.tabsShown[tabIndex]) {\n const tabsShown = [...this.state.tabsShown];\n tabsShown[tabIndex] = true;\n setTimeout(() => {\n this.updateState({\n tabsShown: tabsShown\n } as WmTabsState, callback);\n }, 300);\n } else {\n callback && callback();\n }\n }\n\n addTabPane(tabPane: WmTabpane) {\n tabPane.paneId = `tabPane${this.newIndex++}`;\n const i = this.tabPanes.findIndex(t => t.paneId === tabPane.paneId);\n if (i >= 0) {\n this.tabPanes[i] = tabPane;\n } else {\n this.tabPanes.push(tabPane)\n }\n }\n\n removeTabPane(tabPane: WmTabpane) {\n const i = this.tabPanes.findIndex(t => t.paneId === tabPane.paneId);\n if (i >= 0) {\n this.tabPanes.splice(i, 1); \n this.newIndex--;\n }\n }\n\n selectTabPane(tabPane: WmTabpane) {\n this.goToTab(this.tabPanes.indexOf(tabPane));\n }\n\n get selectedTabPane() {\n return this.tabPanes[this.state.selectedTabIndex];\n }\n\n goToTab(index = this.state.selectedTabIndex) {\n if (index < 0 || index >= this.tabPanes.length) {\n return;\n }\n const position = -1 * index * (this.tabLayout?.width || 0);\n if(this.animationView) {\n this.animationView.setPosition(position)\n .then(() => this.onChange(index));\n } else {\n this.onChange(index);\n }\n }\n\n prev() {\n this.animationView?.goToLower();\n }\n\n next() {\n this.animationView?.goToLower();\n }\n\n onChange(newIndex: number) {\n if (newIndex < 0 || newIndex >= this.tabPanes.length) {\n return;\n }\n const oldIndex = this.state.selectedTabIndex;\n const deselectedTab = this.tabPanes[this.state.selectedTabIndex];\n this.newIndex = newIndex;\n deselectedTab?._onDeselect();\n this.updateState({\n selectedTabIndex: newIndex\n } as WmTabsState, () => {\n this.setTabShown(newIndex, () => {\n const selectedTab = this.tabPanes[newIndex];\n selectedTab?._onSelect();\n this.invokeEventCallback('onChange', [{}, this.proxy, newIndex, oldIndex]);\n });\n });\n }\n\n public renderSkeletonContent(props: WmTabsProps) {\n const tabPanes = React.Children.toArray(this.props.children)\n .filter((item: any, index: number) => item.props.show != false);\n const headerData = tabPanes.map((p: any, i: number) =>\n ({title: p.props.title || 'Tab Title', icon: '', key: `tab-${p.props.title}-${i}`}));\n return(\n <View style={[this.styles.root, { borderBottomWidth: 0}]}>\n <View onLayout={this.setTabLayout.bind(this)} style={{width: '100%'}}></View>\n <WmTabheader\n styles={this.styles.tabHeader}\n data={headerData}\n showskeleton={this.props.showskeleton}\n selectedTabIndex={this.state.selectedTabIndex}\n ></WmTabheader>\n <View\n //{...this.panResponder.panHandlers}\n style={{\n width: '100%',\n //height: this.tabPaneHeights[this.state.selectedTabIndex],\n overflow: 'hidden'\n }} >\n <View style={{\n flexDirection: 'row',\n flexWrap: 'nowrap'\n }}>\n {tabPanes.map((p: any, i) => {\n return (\n <View\n key={`tab-${p.props.title}-${i}`}\n style={{width: '100%', alignSelf: 'flex-start'}}\n onLayout={this.setTabPaneHeights.bind(this, i)}>\n {/* {this.state.tabsShown[i] ? p : null} */}\n {p}\n </View>);\n })}\n </View>\n </View>\n </View>\n )\n }\n\n public renderSkeleton(props: WmTabsProps){\n if(!props.showskeletonchildren) {\n const skeletonStyles: WmSkeletonStyles = this.props?.styles?.skeleton || { root: {}, text: {} } as WmSkeletonStyles\n return createSkeleton(this.theme, skeletonStyles, {\n ...this.styles.root\n }, (<View style={[this.styles.root, { opacity: 0 }]}>\n {this.renderSkeletonContent(props)}\n </View>)) \n }\n return this.renderSkeletonContent(props);\n }\n\n public onPropertyChange(name: string, $new: any, $old: any): void {\n super.onPropertyChange(name, $new, $old);\n switch(name) {\n case \"defaultpaneindex\":\n const selectedIndex = $new || 0;\n const tabsShown: boolean[] = [];\n tabsShown[selectedIndex] = true;\n this.updateState({\n selectedTabIndex: selectedIndex,\n tabsShown: tabsShown\n } as WmTabsState);\n }\n }\n\n getBackground(): React.JSX.Element | null {\n return this._showSkeleton ? null : this._background\n } \n\n\n renderWidget(props: WmTabsProps) {\n const tabPanes = React.Children.toArray(props.children)\n .filter((item: any, index: number) => item.props.show != false);\n const headerData = tabPanes.map((p: any, i: number) =>\n ({title: p.props.title || 'Tab Title', icon: p.props.paneicon || '', key: `tab-${p.props.title}-${i}`}));\n const styles = this._showSkeleton ? {\n ...this.styles.root,\n ...this.styles.skeleton.root\n } : this.styles.root\n return (\n <View style={styles}>\n {this.getBackground()}\n <View onLayout={this.setTabLayout.bind(this)} style={{width: '100%'}}></View>\n <WmTabheader\n id={this.getTestId('headers')}\n styles={this.styles.tabHeader}\n data={headerData}\n selectedTabIndex={this.state.selectedTabIndex}\n onIndexChange={this.goToTab.bind(this)}\n ></WmTabheader>\n <View\n style={[{\n width: '100%',\n flex: 1\n }, this.styles.root.height ?\n (isWebPreviewMode() ? {'overflowX': 'hidden','overflowY': 'auto'} as any : {overflow: 'scroll'})\n : {\n overflow: 'hidden',\n maxHeight: this.tabPaneHeights[this.state.selectedTabIndex],\n }, this.styles.tabContent]} >\n <SwipeAnimation.View\n enableGestures={props.enablegestures}\n style={{\n flexDirection: 'row',\n flexWrap: 'nowrap',\n alignItems: 'flex-start'\n }}\n direction='horizontal'\n ref={(r) => {this.animationView = r}}\n handlers = {this.animationHandlers}\n >\n {tabPanes.map((p: any, i) => {\n return (\n <View\n key={`tab-${p.props.title}-${i}`}\n style={{\n width: '100%',\n height: this.styles.root.height ? undefined : 1000000,\n alignSelf: 'flex-start'}}>\n <View\n style={{width: '100%', alignSelf: 'flex-start'}}\n onLayout={this.setTabPaneHeights.bind(this, i)}>\n {/* {this.state.tabsShown[i] ? p : null} */}\n {p}\n </View>\n </View>);\n })}\n </SwipeAnimation.View>\n </View>\n </View>\n );\n }\n}\n"],"mappings":";;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAA6CC,IAAI,QAAQ,cAAc;AACvE,SAASC,aAAa,EAAEC,kBAAkB,QAAQ,+CAA+C;AACjG,OAAO,KAAKC,cAAc,MAAM,oDAAoD;AACpF,SAASC,gBAAgB,QAAQ,sCAAsC;AAEvE,OAAOC,WAAW,MAAM,cAAc;AACtC,SAASC,aAAa,QAAsB,eAAe;AAE3D,OAAOC,WAAW,MAAM,iCAAiC;AAEzD,SAASC,cAAc,QAAQ,wEAAwE;AAEvG,OAAO,MAAMC,WAAW,SAASP,kBAAkB,CAAc;EAAAQ,YAAA,GAAAC,IAAA;IAAA,SAAAA,IAAA;IAAAC,eAAA,oBACxC,EAAE;IAAAA,eAAA,2BACE,CAAC;EAAA;AAC9B;AAEA,eAAe,MAAMC,MAAM,SAASZ,aAAa,CAAyC;EAyBxFS,WAAWA,CAACI,KAAkB,EAAE;IAC9B,KAAK,CAACA,KAAK,EAAER,aAAa,EAAE,IAAID,WAAW,CAAC,CAAC,EAAE,IAAII,WAAW,CAAC,CAAC,CAAC;IAACG,eAAA,mBAzBlD,EAAE;IAAAA,eAAA,mBACD,CAAC;IAAAA,eAAA,oBACiB,IAAI;IAAAA,eAAA,yBACN,EAAE;IAAAA,eAAA,wBACe,IAAI;IAAAA,eAAA,4BAC5B;MAC1BG,MAAM,EAAGC,CAAC,IAAK;QAAA,IAAAC,eAAA;QACb,MAAMC,cAAc,GAAG,IAAI,CAACC,KAAK,CAACC,gBAAgB;UAC5CC,CAAC,GAAG,EAAAJ,eAAA,OAAI,CAACK,SAAS,cAAAL,eAAA,uBAAdA,eAAA,CAAgBM,KAAK,KAAI,CAAC;UAC9BC,QAAQ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,OAAO;UACtDjC,SAAS,EAAE;QAAY;MAAE,gBAC3B3G,KAAA,CAAA8F,aAAA,CAAC7F,IAAI;QACH8F,KAAK,EAAE;UAACvE,KAAK,EAAE,MAAM;UAAEmF,SAAS,EAAE;QAAY,CAAE;QAChDR,QAAQ,EAAE,IAAI,CAAC3D,iBAAiB,CAAC4D,IAAI,CAAC,IAAI,EAAE7C,CAAC;MAAE,GAE9CmC,CACG,CACF,CAAC;IACT,CAAC,CACkB,CACjB,CACF,CAAC;EAEX;AACF","ignoreList":[]}
@@ -12,7 +12,10 @@ BASE_THEME.registerStyle((themeVariables, addStyle) => {
12
12
  },
13
13
  text: {},
14
14
  tabContent: {},
15
- tabHeader: {}
15
+ tabHeader: {},
16
+ skeleton: {
17
+ root: {}
18
+ }
16
19
  });
17
20
  addStyle(DEFAULT_CLASS, '', defaultStyles);
18
21
  addStyle('tabs-with-arrow-indicator', '', {
@@ -1 +1 @@
1
- {"version":3,"names":["BASE_THEME","defineStyles","DEFAULT_CLASS","registerStyle","themeVariables","addStyle","defaultStyles","root","minHeight","elevation","borderBottomWidth","borderStyle","borderColor","tabBorderColor","text","tabContent","tabHeader","backgroundColor","transparent","header","marginBottom","activeIndicator","justifyContent","alignItems","marginTop","height","arrowIndicator","display","tabArrowIndicatorBgColor","width","transform","rotateZ","arrowIndicatorDot","tabArrowIndicatorDotColor","borderRadius","translateX","translateY"],"sources":["tabs.styles.ts"],"sourcesContent":["import { ViewStyle } from 'react-native';\nimport BASE_THEME from '@wavemaker/app-rn-runtime/styles/theme';\nimport { BaseStyles, defineStyles } from '@wavemaker/app-rn-runtime/core/base.component';\nimport { WmTabheaderStyles } from './tabheader/tabheader.styles';\n\nexport type WmTabsStyles = BaseStyles & {\n tabHeader: WmTabheaderStyles,\n tabContent: ViewStyle\n};\n\nexport const DEFAULT_CLASS = 'app-tabs';\nBASE_THEME.registerStyle((themeVariables, addStyle) => {\n const defaultStyles: WmTabsStyles = defineStyles({\n root: {\n minHeight: 240,\n elevation: 0,\n borderBottomWidth: 1,\n borderStyle: 'solid',\n borderColor: themeVariables.tabBorderColor\n },\n text: {},\n tabContent: {},\n tabHeader: {} as WmTabheaderStyles\n });\n addStyle(DEFAULT_CLASS, '', defaultStyles);\n addStyle('tabs-with-arrow-indicator', '', {\n tabHeader: {\n root: {\n backgroundColor: themeVariables.transparent\n },\n header: {\n marginBottom: 16\n },\n activeIndicator: {\n justifyContent: 'center',\n alignItems: 'center',\n marginTop: 2,\n height: 0\n },\n arrowIndicator: {\n display: 'flex',\n backgroundColor: themeVariables.tabArrowIndicatorBgColor,\n width: 24,\n height: 24,\n justifyContent: 'center',\n alignItems: 'center',\n transform: [{\n rotateZ: '45deg'\n }]\n },\n arrowIndicatorDot: {\n display: 'flex',\n backgroundColor: themeVariables.tabArrowIndicatorDotColor,\n width: 4,\n height: 4, \n borderRadius: 8,\n transform: [{\n translateX: -2\n }, {\n translateY: -2\n }]\n }\n } as WmTabheaderStyles\n });\n});\n"],"mappings":"AACA,OAAOA,UAAU,MAAM,wCAAwC;AAC/D,SAAqBC,YAAY,QAAQ,+CAA+C;AAQxF,OAAO,MAAMC,aAAa,GAAG,UAAU;AACvCF,UAAU,CAACG,aAAa,CAAC,CAACC,cAAc,EAAEC,QAAQ,KAAK;EACrD,MAAMC,aAA2B,GAAGL,YAAY,CAAC;IAC7CM,IAAI,EAAE;MACJC,SAAS,EAAE,GAAG;MACdC,SAAS,EAAE,CAAC;MACZC,iBAAiB,EAAE,CAAC;MACpBC,WAAW,EAAE,OAAO;MACpBC,WAAW,EAAER,cAAc,CAACS;IAC9B,CAAC;IACDC,IAAI,EAAE,CAAC,CAAC;IACRC,UAAU,EAAE,CAAC,CAAC;IACdC,SAAS,EAAE,CAAC;EAChB,CAAC,CAAC;EACFX,QAAQ,CAACH,aAAa,EAAE,EAAE,EAAEI,aAAa,CAAC;EAC1CD,QAAQ,CAAC,2BAA2B,EAAE,EAAE,EAAE;IACxCW,SAAS,EAAE;MACTT,IAAI,EAAE;QACJU,eAAe,EAAEb,cAAc,CAACc;MAClC,CAAC;MACDC,MAAM,EAAE;QACNC,YAAY,EAAE;MAChB,CAAC;MACDC,eAAe,EAAE;QACfC,cAAc,EAAE,QAAQ;QACxBC,UAAU,EAAE,QAAQ;QACpBC,SAAS,EAAE,CAAC;QACZC,MAAM,EAAE;MACV,CAAC;MACDC,cAAc,EAAE;QACdC,OAAO,EAAE,MAAM;QACfV,eAAe,EAAEb,cAAc,CAACwB,wBAAwB;QACxDC,KAAK,EAAE,EAAE;QACTJ,MAAM,EAAE,EAAE;QACVH,cAAc,EAAE,QAAQ;QACxBC,UAAU,EAAE,QAAQ;QACpBO,SAAS,EAAE,CAAC;UACVC,OAAO,EAAE;QACX,CAAC;MACH,CAAC;MACDC,iBAAiB,EAAE;QACjBL,OAAO,EAAE,MAAM;QACfV,eAAe,EAAEb,cAAc,CAAC6B,yBAAyB;QACzDJ,KAAK,EAAE,CAAC;QACRJ,MAAM,EAAE,CAAC;QACTS,YAAY,EAAE,CAAC;QACfJ,SAAS,EAAE,CAAC;UACVK,UAAU,EAAE,CAAC;QACf,CAAC,EAAE;UACDC,UAAU,EAAE,CAAC;QACf,CAAC;MACH;IACF;EACF,CAAC,CAAC;AACJ,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["BASE_THEME","defineStyles","DEFAULT_CLASS","registerStyle","themeVariables","addStyle","defaultStyles","root","minHeight","elevation","borderBottomWidth","borderStyle","borderColor","tabBorderColor","text","tabContent","tabHeader","skeleton","backgroundColor","transparent","header","marginBottom","activeIndicator","justifyContent","alignItems","marginTop","height","arrowIndicator","display","tabArrowIndicatorBgColor","width","transform","rotateZ","arrowIndicatorDot","tabArrowIndicatorDotColor","borderRadius","translateX","translateY"],"sources":["tabs.styles.ts"],"sourcesContent":["import { ViewStyle } from 'react-native';\nimport BASE_THEME from '@wavemaker/app-rn-runtime/styles/theme';\nimport { BaseStyles, defineStyles } from '@wavemaker/app-rn-runtime/core/base.component';\nimport { WmTabheaderStyles } from './tabheader/tabheader.styles';\nimport { WmSkeletonStyles } from '@wavemaker/app-rn-runtime/components/basic/skeleton/skeleton.styles';\n\nexport type WmTabsStyles = BaseStyles & {\n tabHeader: WmTabheaderStyles,\n tabContent: ViewStyle,\n skeleton: WmSkeletonStyles\n};\n\nexport const DEFAULT_CLASS = 'app-tabs';\nBASE_THEME.registerStyle((themeVariables, addStyle) => {\n const defaultStyles: WmTabsStyles = defineStyles({\n root: {\n minHeight: 240,\n elevation: 0,\n borderBottomWidth: 1,\n borderStyle: 'solid',\n borderColor: themeVariables.tabBorderColor\n },\n text: {},\n tabContent: {},\n tabHeader: {} as WmTabheaderStyles,\n skeleton: { \n root: {\n }\n } as WmSkeletonStyles\n });\n addStyle(DEFAULT_CLASS, '', defaultStyles);\n addStyle('tabs-with-arrow-indicator', '', {\n tabHeader: {\n root: {\n backgroundColor: themeVariables.transparent\n },\n header: {\n marginBottom: 16\n },\n activeIndicator: {\n justifyContent: 'center',\n alignItems: 'center',\n marginTop: 2,\n height: 0\n },\n arrowIndicator: {\n display: 'flex',\n backgroundColor: themeVariables.tabArrowIndicatorBgColor,\n width: 24,\n height: 24,\n justifyContent: 'center',\n alignItems: 'center',\n transform: [{\n rotateZ: '45deg'\n }]\n },\n arrowIndicatorDot: {\n display: 'flex',\n backgroundColor: themeVariables.tabArrowIndicatorDotColor,\n width: 4,\n height: 4, \n borderRadius: 8,\n transform: [{\n translateX: -2\n }, {\n translateY: -2\n }]\n }\n } as WmTabheaderStyles\n });\n});\n"],"mappings":"AACA,OAAOA,UAAU,MAAM,wCAAwC;AAC/D,SAAqBC,YAAY,QAAQ,+CAA+C;AAUxF,OAAO,MAAMC,aAAa,GAAG,UAAU;AACvCF,UAAU,CAACG,aAAa,CAAC,CAACC,cAAc,EAAEC,QAAQ,KAAK;EACrD,MAAMC,aAA2B,GAAGL,YAAY,CAAC;IAC7CM,IAAI,EAAE;MACJC,SAAS,EAAE,GAAG;MACdC,SAAS,EAAE,CAAC;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assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
2
  import React from 'react';
3
+ import { View } from 'react-native';
3
4
  import { BaseComponent, BaseComponentState } from '@wavemaker/app-rn-runtime/core/base.component';
4
5
  import WmTileProps from './tile.props';
5
6
  import { DEFAULT_CLASS } from './tile.styles';
6
7
  import { Tappable } from '@wavemaker/app-rn-runtime/core/tappable.component';
7
8
  import { Animatedview } from '@wavemaker/app-rn-runtime/components/basic/animatedview.component';
9
+ import { createSkeleton } from '@wavemaker/app-rn-runtime/components/basic/skeleton/skeleton.component';
8
10
  export class WmTileState extends BaseComponentState {}
9
11
  export default class WmTile extends BaseComponent {
10
12
  constructor(props) {
11
13
  super(props, DEFAULT_CLASS, new WmTileProps());
12
14
  }
15
+ renderSkeleton(props) {
16
+ if (!props.showskeletonchildren) {
17
+ var _this$props;
18
+ const skeletonStyles = ((_this$props = this.props) === null || _this$props === void 0 || (_this$props = _this$props.styles) === null || _this$props === void 0 ? void 0 : _this$props.skeleton) || {
19
+ root: {},
20
+ text: {}
21
+ };
22
+ return createSkeleton(this.theme, skeletonStyles, {
23
+ ...this.styles.root
24
+ }, /*#__PURE__*/React.createElement(View, {
25
+ style: [this.styles.root, {
26
+ opacity: 0
27
+ }]
28
+ }, props.children));
29
+ }
30
+ return null;
31
+ }
32
+ getBackground() {
33
+ return this._showSkeleton ? null : this._background;
34
+ }
13
35
  renderWidget(props) {
36
+ const styles = this._showSkeleton ? {
37
+ ...this.styles.root,
38
+ ...this.styles.skeleton.root
39
+ } : this.styles.root;
14
40
  return /*#__PURE__*/React.createElement(Tappable, _extends({}, this.getTestPropsForAction(), {
15
41
  target: this
16
42
  }), /*#__PURE__*/React.createElement(Animatedview, {
17
43
  entryanimation: props.animation,
18
44
  delay: props.animationdelay,
19
- style: this.styles.root
20
- }, this._background, props.children));
45
+ style: styles
46
+ }, this.getBackground(), props.children));
21
47
  }
22
48
  }
23
49
  //# sourceMappingURL=tile.component.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["React","BaseComponent","BaseComponentState","WmTileProps","DEFAULT_CLASS","Tappable","Animatedview","WmTileState","WmTile","constructor","props","renderWidget","createElement","_extends","getTestPropsForAction","target","entryanimation","animation","delay","animationdelay","style","styles","root","_background","children"],"sources":["tile.component.tsx"],"sourcesContent":["import React from 'react';\nimport { BaseComponent, BaseComponentState } from '@wavemaker/app-rn-runtime/core/base.component';\n\nimport WmTileProps from './tile.props';\nimport { DEFAULT_CLASS, WmTileStyles } from './tile.styles';\nimport { Tappable } from '@wavemaker/app-rn-runtime/core/tappable.component';\nimport { Animatedview } from '@wavemaker/app-rn-runtime/components/basic/animatedview.component';\n\nexport class WmTileState extends BaseComponentState<WmTileProps> {}\n\nexport default class WmTile extends BaseComponent<WmTileProps, WmTileState, WmTileStyles> {\n\n constructor(props: WmTileProps) {\n super(props, DEFAULT_CLASS, new WmTileProps());\n }\n\n renderWidget(props: WmTileProps) {\n return (<Tappable {...this.getTestPropsForAction()} target={this}>\n <Animatedview entryanimation={props.animation} delay={props.animationdelay} style={this.styles.root}>{this._background}{props.children}</Animatedview>\n </Tappable>);\n }\n}\n"],"mappings":";AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,aAAa,EAAEC,kBAAkB,QAAQ,+CAA+C;AAEjG,OAAOC,WAAW,MAAM,cAAc;AACtC,SAASC,aAAa,QAAsB,eAAe;AAC3D,SAASC,QAAQ,QAAQ,mDAAmD;AAC5E,SAASC,YAAY,QAAQ,mEAAmE;AAEhG,OAAO,MAAMC,WAAW,SAASL,kBAAkB,CAAc;AAEjE,eAAe,MAAMM,MAAM,SAASP,aAAa,CAAyC;EAExFQ,WAAWA,CAACC,KAAkB,EAAE;IAC9B,KAAK,CAACA,KAAK,EAAEN,aAAa,EAAE,IAAID,WAAW,CAAC,CAAC,CAAC;EAChD;EAEAQ,YAAYA,CAACD,KAAkB,EAAE;IAC/B,oBAAQV,KAAA,CAAAY,aAAA,CAACP,QAAQ,EAAAQ,QAAA,KAAK,IAAI,CAACC,qBAAqB,CAAC,CAAC;MAAEC,MAAM,EAAE;IAAK,iBAC/Df,KAAA,CAAAY,aAAA,CAACN,YAAY;MAACU,cAAc,EAAEN,KAAK,CAACO,SAAU;MAACC,KAAK,EAAER,KAAK,CAACS,cAAe;MAACC,KAAK,EAAE,IAAI,CAACC,MAAM,CAACC;IAAK,GAAE,IAAI,CAACC,WAAW,EAAEb,KAAK,CAACc,QAAuB,CAC7I,CAAC;EACb;AACF","ignoreList":[]}
1
+ {"version":3,"names":["React","View","BaseComponent","BaseComponentState","WmTileProps","DEFAULT_CLASS","Tappable","Animatedview","createSkeleton","WmTileState","WmTile","constructor","props","renderSkeleton","showskeletonchildren","_this$props","skeletonStyles","styles","skeleton","root","text","theme","createElement","style","opacity","children","getBackground","_showSkeleton","_background","renderWidget","_extends","getTestPropsForAction","target","entryanimation","animation","delay","animationdelay"],"sources":["tile.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 WmTileProps from './tile.props';\nimport { DEFAULT_CLASS, WmTileStyles } from './tile.styles';\nimport { Tappable } from '@wavemaker/app-rn-runtime/core/tappable.component';\nimport { Animatedview } from '@wavemaker/app-rn-runtime/components/basic/animatedview.component';\nimport { WmSkeletonStyles } from '@wavemaker/app-rn-runtime/components/basic/skeleton/skeleton.styles';\nimport { createSkeleton } from '@wavemaker/app-rn-runtime/components/basic/skeleton/skeleton.component';\n\nexport class WmTileState extends BaseComponentState<WmTileProps> {}\n\nexport default class WmTile extends BaseComponent<WmTileProps, WmTileState, WmTileStyles> {\n\n constructor(props: WmTileProps) {\n super(props, DEFAULT_CLASS, new WmTileProps());\n }\n \n public renderSkeleton(props: WmTileProps): React.ReactNode {\n if(!props.showskeletonchildren) {\n const skeletonStyles: WmSkeletonStyles = this.props?.styles?.skeleton || { root: {}, text: {} } as WmSkeletonStyles\n return createSkeleton(this.theme, skeletonStyles, {\n ...this.styles.root\n }, (<View style={[this.styles.root, { opacity: 0 }]}>\n {props.children}\n </View>))\n }\n return null;\n }\n\n getBackground(): React.JSX.Element | null {\n return this._showSkeleton ? null : this._background\n } \n \n renderWidget(props: WmTileProps) {\n const styles = this._showSkeleton ? {\n ...this.styles.root,\n ...this.styles.skeleton.root\n } : this.styles.root;\n \n return (<Tappable {...this.getTestPropsForAction()} target={this}>\n <Animatedview entryanimation={props.animation} delay={props.animationdelay} style={styles}>{this.getBackground()}{props.children}</Animatedview>\n </Tappable>);\n }\n}\n\n"],"mappings":";AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,IAAI,QAAQ,cAAc;AACnC,SAASC,aAAa,EAAEC,kBAAkB,QAAQ,+CAA+C;AAEjG,OAAOC,WAAW,MAAM,cAAc;AACtC,SAASC,aAAa,QAAsB,eAAe;AAC3D,SAASC,QAAQ,QAAQ,mDAAmD;AAC5E,SAASC,YAAY,QAAQ,mEAAmE;AAEhG,SAASC,cAAc,QAAQ,wEAAwE;AAEvG,OAAO,MAAMC,WAAW,SAASN,kBAAkB,CAAc;AAEjE,eAAe,MAAMO,MAAM,SAASR,aAAa,CAAyC;EAExFS,WAAWA,CAACC,KAAkB,EAAE;IAC9B,KAAK,CAACA,KAAK,EAAEP,aAAa,EAAE,IAAID,WAAW,CAAC,CAAC,CAAC;EAChD;EAEOS,cAAcA,CAACD,KAAkB,EAAmB;IACzD,IAAG,CAACA,KAAK,CAACE,oBAAoB,EAAE;MAAA,IAAAC,WAAA;MAC9B,MAAMC,cAAgC,GAAG,EAAAD,WAAA,OAAI,CAACH,KAAK,cAAAG,WAAA,gBAAAA,WAAA,GAAVA,WAAA,CAAYE,MAAM,cAAAF,WAAA,uBAAlBA,WAAA,CAAoBG,QAAQ,KAAI;QAAEC,IAAI,EAAE,CAAC,CAAC;QAAEC,IAAI,EAAE,CAAC;MAAG,CAAqB;MACpH,OAAOZ,cAAc,CAAC,IAAI,CAACa,KAAK,EAAEL,cAAc,EAAE;QAChD,GAAG,IAAI,CAACC,MAAM,CAACE;MACjB,CAAC,eAAGnB,KAAA,CAAAsB,aAAA,CAACrB,IAAI;QAACsB,KAAK,EAAE,CAAC,IAAI,CAACN,MAAM,CAACE,IAAI,EAAE;UAAEK,OAAO,EAAE;QAAE,CAAC;MAAE,GACjDZ,KAAK,CAACa,QACH,CAAE,CAAC;IACX;IACA,OAAO,IAAI;EACb;EAEAC,aAAaA,CAAA,EAA6B;IACxC,OAAO,IAAI,CAACC,aAAa,GAAG,IAAI,GAAG,IAAI,CAACC,WAAW;EACrD;EAEAC,YAAYA,CAACjB,KAAkB,EAAE;IAC/B,MAAMK,MAAM,GAAG,IAAI,CAACU,aAAa,GAAG;MAClC,GAAG,IAAI,CAACV,MAAM,CAACE,IAAI;MACnB,GAAG,IAAI,CAACF,MAAM,CAACC,QAAQ,CAACC;IACzB,CAAC,GAAG,IAAI,CAACF,MAAM,CAACE,IAAI;IAErB,oBAAQnB,KAAA,CAAAsB,aAAA,CAAChB,QAAQ,EAAAwB,QAAA,KAAK,IAAI,CAACC,qBAAqB,CAAC,CAAC;MAAEC,MAAM,EAAE;IAAK,iBAC/DhC,KAAA,CAAAsB,aAAA,CAACf,YAAY;MAAC0B,cAAc,EAAErB,KAAK,CAACsB,SAAU;MAACC,KAAK,EAAEvB,KAAK,CAACwB,cAAe;MAACb,KAAK,EAAEN;IAAO,GAAE,IAAI,CAACS,aAAa,CAAC,CAAC,EAAEd,KAAK,CAACa,QAAuB,CACvI,CAAC;EACb;AACF","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["BaseProps","WmTileProps","constructor","args","_defineProperty"],"sources":["tile.props.ts"],"sourcesContent":["import { BaseProps } from '@wavemaker/app-rn-runtime/core/base.component';\n\nexport default class WmTileProps extends BaseProps {\n animation: string = null as any;\n animationdelay?: number = null as any;\n children: any;\n}\n"],"mappings":";;;AAAA,SAASA,SAAS,QAAQ,+CAA+C;AAEzE,eAAe,MAAMC,WAAW,SAASD,SAAS,CAAC;EAAAE,YAAA,GAAAC,IAAA;IAAA,SAAAA,IAAA;IAAAC,eAAA,oBAC7B,IAAI;IAAAA,eAAA,yBACE,IAAI;IAAAA,eAAA;EAAA;AAEhC","ignoreList":[]}
1
+ {"version":3,"names":["BaseProps","WmTileProps","constructor","args","_defineProperty"],"sources":["tile.props.ts"],"sourcesContent":["import { BaseProps } from '@wavemaker/app-rn-runtime/core/base.component';\n\nexport default class WmTileProps extends BaseProps {\n animation: string = null as any;\n animationdelay?: number = null as any;\n children: any;\n}\n\n"],"mappings":";;;AAAA,SAASA,SAAS,QAAQ,+CAA+C;AAEzE,eAAe,MAAMC,WAAW,SAASD,SAAS,CAAC;EAAAE,YAAA,GAAAC,IAAA;IAAA,SAAAA,IAAA;IAAAC,eAAA,oBAC7B,IAAI;IAAAA,eAAA,yBACE,IAAI;IAAAA,eAAA;EAAA;AAEhC","ignoreList":[]}
@@ -10,7 +10,12 @@ BASE_THEME.registerStyle((themeVariables, addStyle) => {
10
10
  borderColor: themeVariables.transparent,
11
11
  padding: 12
12
12
  },
13
- text: {}
13
+ text: {},
14
+ skeleton: {
15
+ root: {
16
+ width: '100%'
17
+ }
18
+ }
14
19
  });
15
20
  addStyle(DEFAULT_CLASS, '', defaultStyles);
16
21
  addStyle('tile-template-text', '', {
@@ -1 +1 @@
1
- {"version":3,"names":["BASE_THEME","defineStyles","DEFAULT_CLASS","registerStyle","themeVariables","addStyle","defaultStyles","root","borderRadius","borderWidth","borderStyle","borderColor","transparent","padding","text","color","tilePrimaryTextColor","marginBottom","backgroundColor","tileWellbgColor","tileWellBorderColor"],"sources":["tile.styles.ts"],"sourcesContent":["import BASE_THEME from '@wavemaker/app-rn-runtime/styles/theme';\nimport { BaseStyles, defineStyles } from '@wavemaker/app-rn-runtime/core/base.component';\n\nexport type WmTileStyles = BaseStyles & {};\n\nexport const DEFAULT_CLASS = 'app-tile';\nBASE_THEME.registerStyle((themeVariables, addStyle) => {\n const defaultStyles: WmTileStyles = defineStyles({\n root: {\n borderRadius: 6,\n borderWidth: 1,\n borderStyle: 'solid',\n borderColor: themeVariables.transparent,\n padding: 12\n },\n text: {}\n });\n\n addStyle(DEFAULT_CLASS, '', defaultStyles);\n\n addStyle('tile-template-text', '', {\n text: {\n color: themeVariables.tilePrimaryTextColor\n }\n } as any);\n\n addStyle('well', '', {\n root: {\n padding: 20,\n marginBottom: 20,\n borderWidth: 1,\n backgroundColor: themeVariables.tileWellbgColor,\n borderColor: themeVariables.tileWellBorderColor,\n borderStyle: 'solid',\n borderRadius: 2\n }\n });\n});\n"],"mappings":"AAAA,OAAOA,UAAU,MAAM,wCAAwC;AAC/D,SAAqBC,YAAY,QAAQ,+CAA+C;AAIxF,OAAO,MAAMC,aAAa,GAAG,UAAU;AACvCF,UAAU,CAACG,aAAa,CAAC,CAACC,cAAc,EAAEC,QAAQ,KAAK;EACrD,MAAMC,aAA2B,GAAGL,YAAY,CAAC;IAC7CM,IAAI,EAAE;MACJC,YAAY,EAAE,CAAC;MACfC,WAAW,EAAE,CAAC;MACdC,WAAW,EAAE,OAAO;MACpBC,WAAW,EAAEP,cAAc,CAACQ,WAAW;MACvCC,OAAO,EAAE;IACX,CAAC;IACDC,IAAI,EAAE,CAAC;EACX,CAAC,CAAC;EAEFT,QAAQ,CAACH,aAAa,EAAE,EAAE,EAAEI,aAAa,CAAC;EAE1CD,QAAQ,CAAC,oBAAoB,EAAE,EAAE,EAAE;IACjCS,IAAI,EAAE;MACJC,KAAK,EAAEX,cAAc,CAACY;IACxB;EACF,CAAQ,CAAC;EAETX,QAAQ,CAAC,MAAM,EAAE,EAAE,EAAE;IACnBE,IAAI,EAAE;MACJM,OAAO,EAAE,EAAE;MACXI,YAAY,EAAE,EAAE;MAChBR,WAAW,EAAE,CAAC;MACdS,eAAe,EAAEd,cAAc,CAACe,eAAe;MAC/CR,WAAW,EAAEP,cAAc,CAACgB,mBAAmB;MAC/CV,WAAW,EAAE,OAAO;MACpBF,YAAY,EAAE;IAChB;EACF,CAAC,CAAC;AACJ,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["BASE_THEME","defineStyles","DEFAULT_CLASS","registerStyle","themeVariables","addStyle","defaultStyles","root","borderRadius","borderWidth","borderStyle","borderColor","transparent","padding","text","skeleton","width","color","tilePrimaryTextColor","marginBottom","backgroundColor","tileWellbgColor","tileWellBorderColor"],"sources":["tile.styles.ts"],"sourcesContent":["import BASE_THEME from '@wavemaker/app-rn-runtime/styles/theme';\nimport { BaseStyles, defineStyles } from '@wavemaker/app-rn-runtime/core/base.component';\nimport { WmSkeletonStyles } from '@wavemaker/app-rn-runtime/components/basic/skeleton/skeleton.styles';\n\nexport type WmTileStyles = BaseStyles & {\n skeleton: WmSkeletonStyles\n};\n\nexport const DEFAULT_CLASS = 'app-tile';\nBASE_THEME.registerStyle((themeVariables, addStyle) => {\n const defaultStyles: WmTileStyles = defineStyles({\n root: {\n borderRadius: 6,\n borderWidth: 1,\n borderStyle: 'solid',\n borderColor: themeVariables.transparent,\n padding: 12\n },\n text: {},\n skeleton: {\n root:{\n width: '100%',\n },\n } as any as WmSkeletonStyles\n });\n\n addStyle(DEFAULT_CLASS, '', defaultStyles);\n\n addStyle('tile-template-text', '', {\n text: {\n color: themeVariables.tilePrimaryTextColor\n }\n } as any);\n\n addStyle('well', '', {\n root: {\n padding: 20,\n marginBottom: 20,\n borderWidth: 1,\n backgroundColor: themeVariables.tileWellbgColor,\n borderColor: themeVariables.tileWellBorderColor,\n borderStyle: 'solid',\n borderRadius: 2\n }\n });\n});\n"],"mappings":"AAAA,OAAOA,UAAU,MAAM,wCAAwC;AAC/D,SAAqBC,YAAY,QAAQ,+CAA+C;AAOxF,OAAO,MAAMC,aAAa,GAAG,UAAU;AACvCF,UAAU,CAACG,aAAa,CAAC,CAACC,cAAc,EAAEC,QAAQ,KAAK;EACrD,MAAMC,aAA2B,GAAGL,YAAY,CAAC;IAC7CM,IAAI,EAAE;MACJC,YAAY,EAAE,CAAC;MACfC,WAAW,EAAE,CAAC;MACdC,WAAW,EAAE,OAAO;MACpBC,WAAW,EAAEP,cAAc,CAACQ,WAAW;MACvCC,OAAO,EAAE;IACX,CAAC;IACDC,IAAI,EAAE,CAAC,CAAC;IACRC,QAAQ,EAAE;MACRR,IAAI,EAAC;QACHS,KAAK,EAAE;MACT;IACF;EACJ,CAAC,CAAC;EAEFX,QAAQ,CAACH,aAAa,EAAE,EAAE,EAAEI,aAAa,CAAC;EAE1CD,QAAQ,CAAC,oBAAoB,EAAE,EAAE,EAAE;IACjCS,IAAI,EAAE;MACJG,KAAK,EAAEb,cAAc,CAACc;IACxB;EACF,CAAQ,CAAC;EAETb,QAAQ,CAAC,MAAM,EAAE,EAAE,EAAE;IACnBE,IAAI,EAAE;MACJM,OAAO,EAAE,EAAE;MACXM,YAAY,EAAE,EAAE;MAChBV,WAAW,EAAE,CAAC;MACdW,eAAe,EAAEhB,cAAc,CAACiB,eAAe;MAC/CV,WAAW,EAAEP,cAAc,CAACkB,mBAAmB;MAC/CZ,WAAW,EAAE,OAAO;MACpBF,YAAY,EAAE;IAChB;EACF,CAAC,CAAC;AACJ,CAAC,CAAC","ignoreList":[]}