@wavemaker/app-rn-runtime 12.0.0-next.140535 → 12.0.0-next.140537

Sign up to get free protection for your applications and to get access to all the features.
Files changed (177) hide show
  1. app-rn-runtime/components/advanced/carousel/carousel.component.js +7 -7
  2. app-rn-runtime/components/advanced/carousel/carousel.component.js.map +1 -1
  3. app-rn-runtime/components/advanced/carousel/carousel.styles.js +3 -3
  4. app-rn-runtime/components/advanced/carousel/carousel.styles.js.map +1 -1
  5. app-rn-runtime/components/basic/audio/audio.component.js +9 -2
  6. app-rn-runtime/components/basic/audio/audio.component.js.map +1 -1
  7. app-rn-runtime/components/basic/audio/audio.styles.js +7 -0
  8. app-rn-runtime/components/basic/audio/audio.styles.js.map +1 -1
  9. app-rn-runtime/components/basic/custom/custom.component.js +1 -1
  10. app-rn-runtime/components/basic/custom/custom.component.js.map +1 -1
  11. app-rn-runtime/components/basic/lottie/lottie.component.js +3 -1
  12. app-rn-runtime/components/basic/lottie/lottie.component.js.map +1 -1
  13. app-rn-runtime/components/basic/search/search.component.js +6 -9
  14. app-rn-runtime/components/basic/search/search.component.js.map +1 -1
  15. app-rn-runtime/components/basic/search/search.props.js +1 -0
  16. app-rn-runtime/components/basic/search/search.props.js.map +1 -1
  17. app-rn-runtime/components/basic/search/search.styles.js +1 -2
  18. app-rn-runtime/components/basic/search/search.styles.js.map +1 -1
  19. app-rn-runtime/components/basic/skeleton/skeleton.component.js +2 -0
  20. app-rn-runtime/components/basic/skeleton/skeleton.component.js.map +1 -1
  21. app-rn-runtime/components/basic/video/video.component.js +6 -0
  22. app-rn-runtime/components/basic/video/video.component.js.map +1 -1
  23. app-rn-runtime/components/basic/video/video.styles.js +7 -1
  24. app-rn-runtime/components/basic/video/video.styles.js.map +1 -1
  25. app-rn-runtime/components/chart/area-chart/area-chart.component.js +2 -1
  26. app-rn-runtime/components/chart/area-chart/area-chart.component.js.map +1 -1
  27. app-rn-runtime/components/chart/pie-chart/pie-chart.component.js +2 -1
  28. app-rn-runtime/components/chart/pie-chart/pie-chart.component.js.map +1 -1
  29. app-rn-runtime/components/container/accordion/accordion.component.js +14 -7
  30. app-rn-runtime/components/container/accordion/accordion.component.js.map +1 -1
  31. app-rn-runtime/components/container/accordion/accordionpane/accordionpane.component.js +7 -0
  32. app-rn-runtime/components/container/accordion/accordionpane/accordionpane.component.js.map +1 -1
  33. app-rn-runtime/components/container/container.component.js +8 -1
  34. app-rn-runtime/components/container/container.component.js.map +1 -1
  35. app-rn-runtime/components/container/container.props.js +1 -0
  36. app-rn-runtime/components/container/container.props.js.map +1 -1
  37. app-rn-runtime/components/container/layoutgrid/layoutgrid.component.js +2 -1
  38. app-rn-runtime/components/container/layoutgrid/layoutgrid.component.js.map +1 -1
  39. app-rn-runtime/components/container/panel/panel.component.js +2 -1
  40. app-rn-runtime/components/container/panel/panel.component.js.map +1 -1
  41. app-rn-runtime/components/container/tabs/tabpane/tabpane.component.js +7 -0
  42. app-rn-runtime/components/container/tabs/tabpane/tabpane.component.js.map +1 -1
  43. app-rn-runtime/components/container/tabs/tabpane/tabpane.props.js +1 -0
  44. app-rn-runtime/components/container/tabs/tabpane/tabpane.props.js.map +1 -1
  45. app-rn-runtime/components/container/tabs/tabs.component.js +14 -4
  46. app-rn-runtime/components/container/tabs/tabs.component.js.map +1 -1
  47. app-rn-runtime/components/container/tile/tile.component.js +5 -1
  48. app-rn-runtime/components/container/tile/tile.component.js.map +1 -1
  49. app-rn-runtime/components/container/wizard/wizard.component.js +12 -4
  50. app-rn-runtime/components/container/wizard/wizard.component.js.map +1 -1
  51. app-rn-runtime/components/container/wizard/wizardstep/wizardstep.component.js +4 -0
  52. app-rn-runtime/components/container/wizard/wizardstep/wizardstep.component.js.map +1 -1
  53. app-rn-runtime/components/data/card/card.styles.js.map +1 -1
  54. app-rn-runtime/components/data/form/form-field/form-field.component.js +2 -1
  55. app-rn-runtime/components/data/form/form-field/form-field.component.js.map +1 -1
  56. app-rn-runtime/components/data/list/list-template/list-template.styles.js +1 -1
  57. app-rn-runtime/components/data/list/list-template/list-template.styles.js.map +1 -1
  58. app-rn-runtime/components/input/baseinput/baseinput.component.js +46 -10
  59. app-rn-runtime/components/input/baseinput/baseinput.component.js.map +1 -1
  60. app-rn-runtime/components/input/basenumber/basenumber.component.js +19 -6
  61. app-rn-runtime/components/input/basenumber/basenumber.component.js.map +1 -1
  62. app-rn-runtime/components/input/calendar/calendar.component.js +25 -0
  63. app-rn-runtime/components/input/calendar/calendar.component.js.map +1 -1
  64. app-rn-runtime/components/input/calendar/calendar.styles.js +19 -0
  65. app-rn-runtime/components/input/calendar/calendar.styles.js.map +1 -1
  66. app-rn-runtime/components/input/checkbox/checkbox.component.js +23 -3
  67. app-rn-runtime/components/input/checkbox/checkbox.component.js.map +1 -1
  68. app-rn-runtime/components/input/checkbox/checkbox.styles.js +19 -2
  69. app-rn-runtime/components/input/checkbox/checkbox.styles.js.map +1 -1
  70. app-rn-runtime/components/input/checkboxset/checkboxset.component.js +1 -1
  71. app-rn-runtime/components/input/checkboxset/checkboxset.component.js.map +1 -1
  72. app-rn-runtime/components/input/checkboxset/checkboxset.styles.js +1 -0
  73. app-rn-runtime/components/input/checkboxset/checkboxset.styles.js.map +1 -1
  74. app-rn-runtime/components/input/chips/chips.component.js +16 -2
  75. app-rn-runtime/components/input/chips/chips.component.js.map +1 -1
  76. app-rn-runtime/components/input/chips/chips.styles.js +8 -0
  77. app-rn-runtime/components/input/chips/chips.styles.js.map +1 -1
  78. app-rn-runtime/components/input/currency/currency.component.js +14 -4
  79. app-rn-runtime/components/input/currency/currency.component.js.map +1 -1
  80. app-rn-runtime/components/input/currency/currency.styles.js +43 -1
  81. app-rn-runtime/components/input/currency/currency.styles.js.map +1 -1
  82. app-rn-runtime/components/input/epoch/base-datetime.component.js +26 -5
  83. app-rn-runtime/components/input/epoch/base-datetime.component.js.map +1 -1
  84. app-rn-runtime/components/input/epoch/datetime/datetime.props.js +6 -0
  85. app-rn-runtime/components/input/epoch/datetime/datetime.props.js.map +1 -1
  86. app-rn-runtime/components/input/epoch/datetime/datetime.styles.js +13 -0
  87. app-rn-runtime/components/input/epoch/datetime/datetime.styles.js.map +1 -1
  88. app-rn-runtime/components/input/epoch/wheelpickermodal/date/date-picker-modal.component.js +7 -4
  89. app-rn-runtime/components/input/epoch/wheelpickermodal/date/date-picker-modal.component.js.map +1 -1
  90. app-rn-runtime/components/input/epoch/wheelpickermodal/date/date-picker-modal.props.js +3 -0
  91. app-rn-runtime/components/input/epoch/wheelpickermodal/date/date-picker-modal.props.js.map +1 -1
  92. app-rn-runtime/components/input/epoch/wheelpickermodal/time/time-picker-modal.component.js +7 -4
  93. app-rn-runtime/components/input/epoch/wheelpickermodal/time/time-picker-modal.component.js.map +1 -1
  94. app-rn-runtime/components/input/epoch/wheelpickermodal/time/time-picker-modal.props.js +3 -0
  95. app-rn-runtime/components/input/epoch/wheelpickermodal/time/time-picker-modal.props.js.map +1 -1
  96. app-rn-runtime/components/input/number/number.component.js +17 -3
  97. app-rn-runtime/components/input/number/number.component.js.map +1 -1
  98. app-rn-runtime/components/input/number/number.styles.js +24 -1
  99. app-rn-runtime/components/input/number/number.styles.js.map +1 -1
  100. app-rn-runtime/components/input/radioset/radioset.component.js +13 -8
  101. app-rn-runtime/components/input/radioset/radioset.component.js.map +1 -1
  102. app-rn-runtime/components/input/radioset/radioset.props.js +1 -0
  103. app-rn-runtime/components/input/radioset/radioset.props.js.map +1 -1
  104. app-rn-runtime/components/input/radioset/radioset.styles.js +7 -0
  105. app-rn-runtime/components/input/radioset/radioset.styles.js.map +1 -1
  106. app-rn-runtime/components/input/select/select.component.js +11 -3
  107. app-rn-runtime/components/input/select/select.component.js.map +1 -1
  108. app-rn-runtime/components/input/select/select.styles.js +24 -0
  109. app-rn-runtime/components/input/select/select.styles.js.map +1 -1
  110. app-rn-runtime/components/input/switch/switch.component.js +13 -3
  111. app-rn-runtime/components/input/switch/switch.component.js.map +1 -1
  112. app-rn-runtime/components/input/switch/switch.styles.js +15 -0
  113. app-rn-runtime/components/input/switch/switch.styles.js.map +1 -1
  114. app-rn-runtime/components/input/text/text.component.js +5 -2
  115. app-rn-runtime/components/input/text/text.component.js.map +1 -1
  116. app-rn-runtime/components/input/text/text.props.js +1 -0
  117. app-rn-runtime/components/input/text/text.props.js.map +1 -1
  118. app-rn-runtime/components/input/text/text.styles.js +3 -0
  119. app-rn-runtime/components/input/text/text.styles.js.map +1 -1
  120. app-rn-runtime/components/input/textarea/textarea.component.js +3 -1
  121. app-rn-runtime/components/input/textarea/textarea.component.js.map +1 -1
  122. app-rn-runtime/components/input/textarea/textarea.styles.js +3 -0
  123. app-rn-runtime/components/input/textarea/textarea.styles.js.map +1 -1
  124. app-rn-runtime/components/input/toggle/toggle.component.js +6 -0
  125. app-rn-runtime/components/input/toggle/toggle.component.js.map +1 -1
  126. app-rn-runtime/components/input/toggle/toggle.props.js +2 -0
  127. app-rn-runtime/components/input/toggle/toggle.props.js.map +1 -1
  128. app-rn-runtime/components/input/toggle/toggle.styles.js +7 -0
  129. app-rn-runtime/components/input/toggle/toggle.styles.js.map +1 -1
  130. app-rn-runtime/components/page/content/content.component.js.map +1 -1
  131. app-rn-runtime/components/page/left-panel/left-panel.component.js +4 -1
  132. app-rn-runtime/components/page/left-panel/left-panel.component.js.map +1 -1
  133. app-rn-runtime/components/page/page-content/page-content.component.js +43 -12
  134. app-rn-runtime/components/page/page-content/page-content.component.js.map +1 -1
  135. app-rn-runtime/components/page/partial/partial.component.js +6 -1
  136. app-rn-runtime/components/page/partial/partial.component.js.map +1 -1
  137. app-rn-runtime/components/page/partial/partial.styles.js.map +1 -1
  138. app-rn-runtime/components/prefab/prefab-container.component.js +5 -1
  139. app-rn-runtime/components/prefab/prefab-container.component.js.map +1 -1
  140. app-rn-runtime/core/AppConfig.js.map +1 -1
  141. app-rn-runtime/core/base.component.js +31 -5
  142. app-rn-runtime/core/base.component.js.map +1 -1
  143. app-rn-runtime/core/components/textinput.component.js +9 -7
  144. app-rn-runtime/core/components/textinput.component.js.map +1 -1
  145. app-rn-runtime/core/props.provider.js +0 -1
  146. app-rn-runtime/core/props.provider.js.map +1 -1
  147. app-rn-runtime/core/storage.service.js +15 -0
  148. app-rn-runtime/core/storage.service.js.map +1 -1
  149. app-rn-runtime/core/tappable.component.js +10 -4
  150. app-rn-runtime/core/tappable.component.js.map +1 -1
  151. app-rn-runtime/core/wm-component-tree.js +58 -0
  152. app-rn-runtime/core/wm-component-tree.js.map +1 -0
  153. app-rn-runtime/package.json +13 -6
  154. app-rn-runtime/runtime/App.js +23 -9
  155. app-rn-runtime/runtime/App.js.map +1 -1
  156. app-rn-runtime/runtime/App.navigator.js +1 -0
  157. app-rn-runtime/runtime/App.navigator.js.map +1 -1
  158. app-rn-runtime/runtime/base-fragment.component.js +18 -0
  159. app-rn-runtime/runtime/base-fragment.component.js.map +1 -1
  160. app-rn-runtime/runtime/base-page.component.js +38 -2
  161. app-rn-runtime/runtime/base-page.component.js.map +1 -1
  162. app-rn-runtime/runtime/base-partial.component.js +3 -0
  163. app-rn-runtime/runtime/base-partial.component.js.map +1 -1
  164. app-rn-runtime/runtime/navigator/drawer.navigator.js +19 -10
  165. app-rn-runtime/runtime/navigator/drawer.navigator.js.map +1 -1
  166. app-rn-runtime/runtime/services/app-modal.service.js +4 -4
  167. app-rn-runtime/runtime/services/app-modal.service.js.map +1 -1
  168. app-rn-runtime/runtime/services/app-security.service.js +17 -1
  169. app-rn-runtime/runtime/services/app-security.service.js.map +1 -1
  170. app-rn-runtime/styles/theme.js +10 -0
  171. app-rn-runtime/styles/theme.js.map +1 -1
  172. app-rn-runtime/styles/theme.variables.js +1 -1
  173. app-rn-runtime/styles/theme.variables.js.map +1 -1
  174. app-rn-runtime/variables/http.service.js +5 -1
  175. app-rn-runtime/variables/http.service.js.map +1 -1
  176. app-rn-runtime/variables/live-variable.js +14 -0
  177. app-rn-runtime/variables/live-variable.js.map +1 -1
@@ -1 +1 @@
1
- {"version":3,"names":["React","View","Text","Platform","Svg","AccessibilityWidgetType","getAccessibilityProps","VictoryLabel","VictoryPie","WmPieChartProps","DEFAULT_CLASS","formatCompactNumber","WmIcon","BaseChartComponent","BaseChartComponentState","WmDonutChartProps","Legend","WmPieChartState","constructor","args","_defineProperty","WmPieChart","props","type","e","_e$nativeEvent","viewWidth","nativeEvent","layout","width","updateState","chartWidth","totalHeight","height","_e$nativeEvent2","infoHeight","opacity","_e$nativeEvent3","_e$nativeEvent4","legendWidth","legendHeight","componentDidMount","getLabel","d","labeltype","Math","round","y","state","total","xaxisDatakeyArr","x","onSelect","event","data","value","slice","label","datum","selectedItem","dataset","index","selectedChartItem","color","style","fill","_dataObj","setTooltipPosition","tooltipXaxis","tooltipYaxis","isTooltipOpen","invokeEventCallback","proxy","renderWidget","length","pieData","showlegend","chartHeight","styles","root","radius","min","innerRadius","donutratio","styleProp","labelRadius","showlabels","labels","display","origin","orientation","legendData","map","name","colors","createElement","_extends","LINECHART","onLayout","onViewLayoutChange","onInfoViewLayoutChange","flexDirection","alignItems","iconclass","icon","title","subHeading","subheading","onLegendViewLayoutChange","testStyle","legendText","dotStyle","legenedDot","justifyContent","getTooltip","flex","standalone","colorScale","endAngle","theme","key","isRTL","toReversed","labelPlacement","labelplacement","events","target","eventHandlers","OS","onClick","bind","onPress","textAnchor","centerLabel","text","centerlabel","maxWidth"],"sources":["pie-chart.component.tsx"],"sourcesContent":["import React from 'react';\nimport { LayoutChangeEvent, View, Text, Platform } from 'react-native';\nimport { Svg } from 'react-native-svg';\nimport { AccessibilityWidgetType, getAccessibilityProps } from '@wavemaker/app-rn-runtime/core/accessibility'; \n\nimport { VictoryLabel, VictoryLegend, VictoryPie } from 'victory-native';\n\nimport WmPieChartProps from './pie-chart.props';\nimport { DEFAULT_CLASS, WmPieChartStyles } from './pie-chart.styles';\n\nimport { formatCompactNumber } from '@wavemaker/app-rn-runtime/core/utils';\nimport WmIcon from '@wavemaker/app-rn-runtime/components/basic/icon/icon.component';\nimport {\n BaseChartComponent,\n BaseChartComponentState\n} from '@wavemaker/app-rn-runtime/components/chart/basechart.component';\nimport WmDonutChartProps from '@wavemaker/app-rn-runtime/components/chart/donut-chart/donut-chart.props';\nimport { Legend } from '../legend/legend.component';\n\n\nexport class WmPieChartState extends BaseChartComponentState<WmPieChartProps> {\n chartWidth = 0;\n totalHeight = 0;\n infoHeight = 10;\n legendWidth = 0;\n legendHeight = 0;\n opacity = 0;\n}\n\nexport default class WmPieChart extends BaseChartComponent<WmPieChartProps, WmPieChartState, WmPieChartStyles> {\n\n constructor(props: WmPieChartProps) {\n super(props, DEFAULT_CLASS, props.type === 'Donut' ? new WmDonutChartProps() : new WmPieChartProps(), new WmPieChartState());\n }\n\n componentDidMount() {\n super.componentDidMount();\n }\n\n onViewLayoutChange = (e: LayoutChangeEvent) => {\n let viewWidth = e.nativeEvent.layout.width;\n this.updateState({\n chartWidth: viewWidth,\n totalHeight: e.nativeEvent?.layout.height\n } as WmPieChartState)\n }\n\n onInfoViewLayoutChange = (e: LayoutChangeEvent) => {\n this.updateState({\n infoHeight: e.nativeEvent?.layout.height,\n opacity: 1\n } as WmPieChartState);\n }\n\n onLegendViewLayoutChange = (e: LayoutChangeEvent) => {\n this.updateState({\n legendWidth: e.nativeEvent?.layout.width,\n legendHeight: e.nativeEvent?.layout.height\n } as WmPieChartState);\n }\n\n getLabel(d: {x: any, y: any}, props: WmPieChartProps): string {\n switch(props.labeltype) {\n case 'percent': {\n return Math.round(d.y * 100 /this.state.total) + '%';\n }\n case 'key': {\n return this.state.xaxisDatakeyArr[d.x];\n }\n case 'value': {\n return formatCompactNumber(d.y);\n }\n case 'key-value': {\n return this.state.xaxisDatakeyArr[d.x] + ' ' + d.y;\n }\n }\n }\n\n onSelect(event: any, data: any){\n let value = data.slice.value;\n let label = this.state.xaxisDatakeyArr[data.datum.x];\n let selectedItem = this.props.dataset[data.index];\n let selectedChartItem = data.slice;\n selectedChartItem[\"data\"] = {x: label, y: value, color: data.style.fill, _dataObj: selectedItem}\n const nativeEvent = event.nativeEvent;\n this.setTooltipPosition(nativeEvent);\n this.updateState({\n tooltipXaxis: label,\n tooltipYaxis: value,\n isTooltipOpen: true,\n selectedItem: {...selectedItem, index: data.index},\n } as WmPieChartState)\n this.invokeEventCallback('onSelect', [event.nativeEvent, this.proxy, selectedItem, selectedChartItem ]);\n }\n\n renderWidget(props: WmPieChartProps) {\n this.invokeEventCallback('onBeforerender', [this.proxy, null]);\n if (!this.state.data.length) {\n return null;\n } \n const pieData = this.state.data[0];\n const chartWidth = this.state.chartWidth \n - (props.showlegend === 'right' ? this.state.legendWidth : 0);\n const chartHeight = (this.styles.root.height ? this.state.totalHeight : chartWidth) \n - this.state.infoHeight \n - (props.showlegend === 'right' ? 0 : this.state.legendHeight);\n let radius = (Math.min(chartWidth, chartHeight) - 40)/ 2;\n let innerRadius = props.donutratio * radius;\n let styleProp = {};\n let labelRadius;\n if (props.showlabels === 'hide') {\n styleProp={labels: { display: \"none\" }};\n } else if (props.showlabels === 'inside') {\n labelRadius = radius/2;\n } else {\n labelRadius = radius + 8;\n }\n const origin = {x: (chartWidth/2), y: (chartHeight/2)};\n const orientation = props.showlegend === 'right' ? 'vertical' : 'horizontal';\n let legendData = pieData.map((d: {x: any, y: any}, index: number) => {\n return {\n name: this.state.xaxisDatakeyArr[d.x],\n color: this.state.colors[index % (this.state.colors.length)]\n };\n });\n return (\n <View style={[{opacity: this.state.opacity}, this.styles.root]}\n {...getAccessibilityProps(AccessibilityWidgetType.LINECHART, props)}\n onLayout={this.onViewLayoutChange}>\n <View onLayout={this.onInfoViewLayoutChange}>\n <View style={{flexDirection: 'row', alignItems: 'center'}}>\n {props.iconclass ? (<WmIcon iconclass={props.iconclass} styles={this.styles.icon}></WmIcon>) : null }\n <Text style={this.styles.title}>{props.title}</Text>\n </View>\n <Text style={this.styles.subHeading}>{props.subheading}</Text>\n </View>\n {props.showlegend === 'top' ? \n (<View onLayout={this.onLegendViewLayoutChange}>\n <Legend data={legendData}\n testStyle={this.styles.legendText}\n dotStyle={this.styles.legenedDot}></Legend>\n </View>) : null }\n <View style={{flexDirection: 'row', justifyContent: 'center', alignItems: 'center'}}>\n {this.getTooltip()}\n <View style={{flex: 1}}>\n {chartWidth ? (\n <Svg\n width={chartWidth}\n height={chartHeight}\n >\n <VictoryPie\n style={styleProp}\n standalone={false}\n colorScale={this.state.colors}\n labels={({datum}) => this.getLabel(datum, props)}\n endAngle={this.state.endAngle || 0}\n radius={radius}\n innerRadius={innerRadius}\n theme={this.state.theme}\n key={props.name}\n name={props.name}\n data={this.isRTL?pieData.toReversed():pieData}\n origin={origin}\n labelPlacement={props.labelplacement}\n labelRadius={labelRadius}\n events={[{\n target: 'data',\n eventHandlers: Platform.OS == \"web\" ? {\n onClick: this.onSelect.bind(this)\n }:{\n onPress: this.onSelect.bind(this)\n }\n }]}\n />\n <VictoryLabel\n textAnchor=\"middle\"\n style={{ ...this.styles.centerLabel, fill: this.styles.centerLabel.color }}\n x={origin.x} y={origin.y}\n text={props.centerlabel}\n />\n </Svg>) : null}\n </View>\n {props.showlegend === 'right' ? \n (<View style={{maxWidth: '50%'}} onLayout={this.onLegendViewLayoutChange}>\n <Legend data={legendData}\n testStyle={this.styles.legendText}\n dotStyle={this.styles.legenedDot}\n orientation='vertical'></Legend>\n </View>) : null }\n </View>\n {props.showlegend === 'bottom' ? \n (<View onLayout={this.onLegendViewLayoutChange}>\n <Legend data={legendData}\n testStyle={this.styles.legendText}\n dotStyle={this.styles.legenedDot}></Legend>\n </View>) : null }\n </View>\n );\n }\n}\n"],"mappings":";;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAA4BC,IAAI,EAAEC,IAAI,EAAEC,QAAQ,QAAQ,cAAc;AACtE,SAASC,GAAG,QAAQ,kBAAkB;AACtC,SAASC,uBAAuB,EAAEC,qBAAqB,QAAQ,8CAA8C;AAE7G,SAASC,YAAY,EAAiBC,UAAU,QAAQ,gBAAgB;AAExE,OAAOC,eAAe,MAAM,mBAAmB;AAC/C,SAASC,aAAa,QAA0B,oBAAoB;AAEpE,SAASC,mBAAmB,Q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BkB,SAAS,EAAE,IAAI,CAAC/B,MAAM,CAACgC,UAAW;MAClCC,QAAQ,EAAE,IAAI,CAACjC,MAAM,CAACkC;IAAW,CAAS,CACxC,CAAC,GAAI,IACT,CAAC;EAEX;AACF","ignoreList":[]}
1
+ {"version":3,"names":["React","View","Text","Platform","Svg","AccessibilityWidgetType","getAccessibilityProps","VictoryLabel","VictoryPie","WmPieChartProps","DEFAULT_CLASS","formatCompactNumber","WmIcon","BaseChartComponent","BaseChartComponentState","WmDonutChartProps","Legend","WmPieChartState","constructor","args","_defineProperty","WmPieChart","props","type","e","_e$nativeEvent","viewWidth","nativeEvent","layout","width","updateState","chartWidth","totalHeight","height","_e$nativeEvent2","infoHeight","opacity","_e$nativeEvent3","_e$nativeEvent4","legendWidth","legendHeight","componentDidMount","getLabel","d","labeltype","Math","round","y","state","total","xaxisDatakeyArr","x","onSelect","event","data","value","slice","label","datum","selectedItem","dataset","index","selectedChartItem","color","style","fill","_dataObj","setTooltipPosition","tooltipXaxis","tooltipYaxis","isTooltipOpen","invokeEventCallback","proxy","renderWidget","length","pieData","showlegend","chartHeight","styles","root","radius","min","innerRadius","donutratio","styleProp","labelRadius","showlabels","labels","display","origin","orientation","legendData","map","name","colors","createElement","_extends","LINECHART","onLayout","onViewLayoutChange","key","title","onInfoViewLayoutChange","flexDirection","alignItems","iconclass","icon","subHeading","subheading","onLegendViewLayoutChange","testStyle","legendText","dotStyle","legenedDot","justifyContent","getTooltip","flex","standalone","colorScale","endAngle","theme","isRTL","toReversed","labelPlacement","labelplacement","events","target","eventHandlers","OS","onClick","bind","onPress","textAnchor","centerLabel","text","centerlabel","maxWidth"],"sources":["pie-chart.component.tsx"],"sourcesContent":["import React from 'react';\nimport { LayoutChangeEvent, View, Text, Platform } from 'react-native';\nimport { Svg } from 'react-native-svg';\nimport { AccessibilityWidgetType, getAccessibilityProps } from '@wavemaker/app-rn-runtime/core/accessibility'; \n\nimport { VictoryLabel, VictoryLegend, VictoryPie } from 'victory-native';\n\nimport WmPieChartProps from './pie-chart.props';\nimport { DEFAULT_CLASS, WmPieChartStyles } from './pie-chart.styles';\n\nimport { formatCompactNumber } from '@wavemaker/app-rn-runtime/core/utils';\nimport WmIcon from '@wavemaker/app-rn-runtime/components/basic/icon/icon.component';\nimport {\n BaseChartComponent,\n BaseChartComponentState\n} from '@wavemaker/app-rn-runtime/components/chart/basechart.component';\nimport WmDonutChartProps from '@wavemaker/app-rn-runtime/components/chart/donut-chart/donut-chart.props';\nimport { Legend } from '../legend/legend.component';\n\n\nexport class WmPieChartState extends BaseChartComponentState<WmPieChartProps> {\n chartWidth = 0;\n totalHeight = 0;\n infoHeight = 10;\n legendWidth = 0;\n legendHeight = 0;\n opacity = 0;\n}\n\nexport default class WmPieChart extends BaseChartComponent<WmPieChartProps, WmPieChartState, WmPieChartStyles> {\n\n constructor(props: WmPieChartProps) {\n super(props, DEFAULT_CLASS, props.type === 'Donut' ? new WmDonutChartProps() : new WmPieChartProps(), new WmPieChartState());\n }\n\n componentDidMount() {\n super.componentDidMount();\n }\n\n onViewLayoutChange = (e: LayoutChangeEvent) => {\n let viewWidth = e.nativeEvent.layout.width;\n this.updateState({\n chartWidth: viewWidth,\n totalHeight: e.nativeEvent?.layout.height\n } as WmPieChartState)\n }\n\n onInfoViewLayoutChange = (e: LayoutChangeEvent) => {\n this.updateState({\n infoHeight: e.nativeEvent?.layout.height,\n opacity: 1\n } as WmPieChartState);\n }\n\n onLegendViewLayoutChange = (e: LayoutChangeEvent) => {\n this.updateState({\n legendWidth: e.nativeEvent?.layout.width,\n legendHeight: e.nativeEvent?.layout.height\n } as WmPieChartState);\n }\n\n getLabel(d: {x: any, y: any}, props: WmPieChartProps): string {\n switch(props.labeltype) {\n case 'percent': {\n return Math.round(d.y * 100 /this.state.total) + '%';\n }\n case 'key': {\n return this.state.xaxisDatakeyArr[d.x];\n }\n case 'value': {\n return formatCompactNumber(d.y);\n }\n case 'key-value': {\n return this.state.xaxisDatakeyArr[d.x] + ' ' + d.y;\n }\n }\n }\n\n onSelect(event: any, data: any){\n let value = data.slice.value;\n let label = this.state.xaxisDatakeyArr[data.datum.x];\n let selectedItem = this.props.dataset[data.index];\n let selectedChartItem = data.slice;\n selectedChartItem[\"data\"] = {x: label, y: value, color: data.style.fill, _dataObj: selectedItem}\n const nativeEvent = event.nativeEvent;\n this.setTooltipPosition(nativeEvent);\n this.updateState({\n tooltipXaxis: label,\n tooltipYaxis: value,\n isTooltipOpen: true,\n selectedItem: {...selectedItem, index: data.index},\n } as WmPieChartState)\n this.invokeEventCallback('onSelect', [event.nativeEvent, this.proxy, selectedItem, selectedChartItem ]);\n }\n\n renderWidget(props: WmPieChartProps) {\n this.invokeEventCallback('onBeforerender', [this.proxy, null]);\n if (!this.state.data.length) {\n return null;\n } \n const pieData = this.state.data[0];\n const chartWidth = this.state.chartWidth \n - (props.showlegend === 'right' ? this.state.legendWidth : 0);\n const chartHeight = (this.styles.root.height ? this.state.totalHeight : chartWidth) \n - this.state.infoHeight \n - (props.showlegend === 'right' ? 0 : this.state.legendHeight);\n let radius = (Math.min(chartWidth, chartHeight) - 40)/ 2;\n let innerRadius = props.donutratio * radius;\n let styleProp = {};\n let labelRadius;\n if (props.showlabels === 'hide') {\n styleProp={labels: { display: \"none\" }};\n } else if (props.showlabels === 'inside') {\n labelRadius = radius/2;\n } else {\n labelRadius = radius + 8;\n }\n const origin = {x: (chartWidth/2), y: (chartHeight/2)};\n const orientation = props.showlegend === 'right' ? 'vertical' : 'horizontal';\n let legendData = pieData.map((d: {x: any, y: any}, index: number) => {\n return {\n name: this.state.xaxisDatakeyArr[d.x],\n color: this.state.colors[index % (this.state.colors.length)]\n };\n });\n return (\n <View style={[{opacity: this.state.opacity}, this.styles.root]}\n {...getAccessibilityProps(AccessibilityWidgetType.LINECHART, props)}\n onLayout={this.onViewLayoutChange}\n key={`${props.title}_pie_chart`}\n >\n <View onLayout={this.onInfoViewLayoutChange}>\n <View style={{flexDirection: 'row', alignItems: 'center'}}>\n {props.iconclass ? (<WmIcon iconclass={props.iconclass} styles={this.styles.icon}></WmIcon>) : null }\n <Text style={this.styles.title}>{props.title}</Text>\n </View>\n <Text style={this.styles.subHeading}>{props.subheading}</Text>\n </View>\n {props.showlegend === 'top' ? \n (<View onLayout={this.onLegendViewLayoutChange}>\n <Legend data={legendData}\n testStyle={this.styles.legendText}\n dotStyle={this.styles.legenedDot}></Legend>\n </View>) : null }\n <View style={{flexDirection: 'row', justifyContent: 'center', alignItems: 'center'}}>\n {this.getTooltip()}\n <View style={{flex: 1}}>\n {chartWidth ? (\n <Svg\n width={chartWidth}\n height={chartHeight}\n >\n <VictoryPie\n style={styleProp}\n standalone={false}\n colorScale={this.state.colors}\n labels={({datum}) => this.getLabel(datum, props)}\n endAngle={this.state.endAngle || 0}\n radius={radius}\n innerRadius={innerRadius}\n theme={this.state.theme}\n key={props.name}\n name={props.name}\n data={this.isRTL?pieData.toReversed():pieData}\n origin={origin}\n labelPlacement={props.labelplacement}\n labelRadius={labelRadius}\n events={[{\n target: 'data',\n eventHandlers: Platform.OS == \"web\" ? {\n onClick: this.onSelect.bind(this)\n }:{\n onPress: this.onSelect.bind(this)\n }\n }]}\n />\n <VictoryLabel\n textAnchor=\"middle\"\n style={{ ...this.styles.centerLabel, fill: this.styles.centerLabel.color }}\n x={origin.x} y={origin.y}\n text={props.centerlabel}\n />\n </Svg>) : null}\n </View>\n {props.showlegend === 'right' ? \n (<View style={{maxWidth: '50%'}} onLayout={this.onLegendViewLayoutChange}>\n <Legend data={legendData}\n testStyle={this.styles.legendText}\n dotStyle={this.styles.legenedDot}\n orientation='vertical'></Legend>\n </View>) : null }\n </View>\n {props.showlegend === 'bottom' ? \n (<View onLayout={this.onLegendViewLayoutChange}>\n <Legend data={legendData}\n testStyle={this.styles.legendText}\n dotStyle={this.styles.legenedDot}></Legend>\n </View>) : null }\n </View>\n );\n }\n}\n"],"mappings":";;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAA4BC,IAAI,EAAE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;MAClCC,QAAQ,EAAE,IAAI,CAAClC,MAAM,CAACmC,UAAW;MACjCvB,WAAW,EAAC;IAAU,CAAS,CAC7B,CAAC,GAAI,IACT,CAAC,EACNpE,KAAK,CAACsD,UAAU,KAAK,QAAQ,gBAC3B5E,KAAA,CAAA+F,aAAA,CAAC9F,IAAI;MAACiG,QAAQ,EAAE,IAAI,CAACW;IAAyB,gBAC7C7G,KAAA,CAAA+F,aAAA,CAAC/E,MAAM;MAACsC,IAAI,EAAEqC,UAAW;MACvBmB,SAAS,EAAE,IAAI,CAAChC,MAAM,CAACiC,UAAW;MAClCC,QAAQ,EAAE,IAAI,CAAClC,MAAM,CAACmC;IAAW,CAAS,CACxC,CAAC,GAAI,IACT,CAAC;EAEX;AACF","ignoreList":[]}
@@ -27,15 +27,22 @@ export default class WmAccordion extends BaseComponent {
27
27
  _defineProperty(this, "newIndex", 0);
28
28
  }
29
29
  addAccordionPane(accordionPane) {
30
- var _this$state$isExpande;
31
- const i = this.accordionPanes.findIndex(t => t.props.title === accordionPane.props.title);
30
+ const i = this.accordionPanes.findIndex(t => {
31
+ return t.paneId === accordionPane.paneId;
32
+ });
32
33
  if (i >= 0) {
33
34
  this.accordionPanes[i] = accordionPane;
34
35
  } else {
35
- this.accordionPanes[this.newIndex++] = accordionPane;
36
+ accordionPane.paneId = `accordionPane${this.newIndex++}`;
37
+ this.accordionPanes.push(accordionPane);
36
38
  }
37
- if (!((_this$state$isExpande = this.state.isExpanded) !== null && _this$state$isExpande !== void 0 && _this$state$isExpande.find(v => v))) {
38
- this.toggle(this.state.props.defaultpaneindex + 1);
39
+ this.toggle(this.state.props.defaultpaneindex + 1);
40
+ }
41
+ removeAccordionPane(accordionPane) {
42
+ const index = this.accordionPanes.findIndex(t => t.paneId === accordionPane.paneId);
43
+ if (index >= 0) {
44
+ this.accordionPanes.splice(index, 1);
45
+ this.newIndex--;
39
46
  }
40
47
  }
41
48
  expand(accordionName) {
@@ -115,7 +122,8 @@ export default class WmAccordion extends BaseComponent {
115
122
  toggle(index, expand = true) {
116
123
  let expandedId = expand ? index : -1;
117
124
  let collapseId = expand ? -1 : index;
118
- if (expand && this.state.isExpanded[expandedId - 1] || !expand && this.state.isExpanded[collapseId - 1] === false) {
125
+ const expandedPane = expandedId ? this.accordionPanes[expandedId - 1] : null;
126
+ if (expand && this.state.isExpanded[expandedId - 1] && !(expandedPane !== null && expandedPane !== void 0 && expandedPane.state.collapsed) || !expand && this.state.isExpanded[collapseId - 1] === false && expandedPane !== null && expandedPane !== void 0 && expandedPane.state.collapsed) {
119
127
  return;
120
128
  }
121
129
  if (collapseId < 0 && this.state.props.closeothers) {
@@ -124,7 +132,6 @@ export default class WmAccordion extends BaseComponent {
124
132
  const collapsedPane = this.accordionPanes[collapseId - 1];
125
133
  collapsedPane === null || collapsedPane === void 0 || collapsedPane.hide();
126
134
  Promise.resolve().then(() => {
127
- const expandedPane = expandedId ? this.accordionPanes[expandedId - 1] : null;
128
135
  expandedPane === null || expandedPane === void 0 || expandedPane.show();
129
136
  this.setState(state => {
130
137
  if (collapseId > 0 && collapsedPane) {
@@ -1 +1 @@
1
- {"version":3,"names":["React","Text","TouchableOpacity","View","Badge","isArray","BaseComponent","BaseComponentState","WmAccordionProps","DEFAULT_CLASS","WmIcon","isDefined","createSkeleton","WmLabel","WmAccordionState","constructor","args","_defineProperty","WmAccordion","props","addAccordionPane","accordionPane","_this$state$isExpande","i","accordionPanes","findIndex","t","title","newIndex","state","isExpanded","find","v","toggle","defaultpaneindex","expand","accordionName","name","collapse","expandCollapseIcon","item","index","showBadge","showIcon","useChevron","widgetProps","badge","badgevalue","undefined","createElement","_extends","style","styles","activeBadge","badgetype","getTestProps","iconclass","flexDirection","id","getTestId","theme","mergeStyle","icon","activeIcon","renderAccordionpane","accordionpanes","showIconOnLeft","leftToggleIcon","root","width","titleIconStyles","titleIcon","show","pane","key","getTestPropsForAction","header","firstHeader","length","lastHeader","activeHeader","onPress","bind","flex","justifyContent","_showSkeleton","showskeleton","text","heading","caption","activeHeaderTitle","accessibilityRole","description","subheading","expandedId","collapseId","closeothers","lastExpandedIndex","collapsedPane","hide","Promise","resolve","then","expandedPane","setState","invokeEventCallback","proxy","componentDidMount","getBackground","_background","renderSkeleton","children","showskeletonchildren","_this$props","skeletonStyles","skeleton","opacity","map","renderWidget","_this$styles$skeleton"],"sources":["accordion.component.tsx"],"sourcesContent":["import React from 'react';\nimport { Text, TouchableOpacity, View } from 'react-native';\nimport { Badge } from 'react-native-paper';\nimport { isArray } from 'lodash';\n\nimport { BaseComponent, BaseComponentState } from '@wavemaker/app-rn-runtime/core/base.component';\nimport WmAccordionProps from './accordion.props';\nimport { DEFAULT_CLASS, WmAccordionStyles } from './accordion.styles';\nimport WmIcon from '@wavemaker/app-rn-runtime/components/basic/icon/icon.component';\nimport WmAccordionpane from './accordionpane/accordionpane.component';\nimport { isDefined } from '@wavemaker/app-rn-runtime/core/utils';\n\nimport { createSkeleton } from '@wavemaker/app-rn-runtime/components/basic/skeleton/skeleton.component';\nimport { WmSkeletonStyles } from '@wavemaker/app-rn-runtime/components/basic/skeleton/skeleton.styles';\nimport WmLabel from '@wavemaker/app-rn-runtime/components/basic/label/label.component';\n\nexport class WmAccordionState extends BaseComponentState<WmAccordionProps> {\n lastExpandedIndex = -1;\n isExpanded = [] as boolean[];\n}\n\n\nexport default class WmAccordion extends BaseComponent<WmAccordionProps, WmAccordionState, WmAccordionStyles> {\n public accordionPanes = [] as WmAccordionpane[];\n private newIndex = 0;\n\n constructor(props: WmAccordionProps) {\n super(props, DEFAULT_CLASS, new WmAccordionProps(), new WmAccordionState());\n }\n\n addAccordionPane(accordionPane: WmAccordionpane) {\n const i = this.accordionPanes.findIndex(t => t.props.title === accordionPane.props.title);\n if (i >= 0) {\n this.accordionPanes[i] = accordionPane;\n } else {\n this.accordionPanes[this.newIndex++] = accordionPane;\n }\n if (!(this.state.isExpanded?.find((v) => v))) {\n this.toggle(this.state.props.defaultpaneindex + 1);\n }\n }\n\n expand(accordionName: string) {\n const i = this.accordionPanes.findIndex(t => t.props.name === accordionName);\n this.toggle(i + 1, true);\n }\n\n collapse(accordionName: string) {\n const i = this.accordionPanes.findIndex(t => t.props.name === accordionName);\n this.toggle(i + 1, false);\n }\n\n expandCollapseIcon(item: any, index: number, showBadge = true, showIcon = true, useChevron = true, isExpanded = false) {\n const widgetProps = item.props;\n //@ts-ignore\n const badge = showBadge && widgetProps.badgevalue != undefined ? (\n <Badge style={[\n this.styles.badge,\n isExpanded ? this.styles.activeBadge: null,\n this.styles[widgetProps.badgetype || 'default']]}\n {...this.getTestProps('badge'+index)}>\n {widgetProps.badgevalue}\n </Badge>): null;\n let iconclass = null;\n if (useChevron) {\n iconclass = isExpanded ? 'wi wi-chevron-down' : 'wi wi-chevron-up';\n } else {\n iconclass = isExpanded ? 'wi wi-minus' : 'wi wi-plus';\n }\n return (<View style={{flexDirection: 'row'}}>\n {badge}\n {showIcon ? (\n <WmIcon\n id={this.getTestId('icon' + index)}\n styles={this.theme.mergeStyle({}, this.styles.icon, isExpanded ? this.styles.activeIcon : null)}\n name={'expand_collapse_icon'}\n iconclass={iconclass}></WmIcon>): null}\n </View>);\n }\n\n renderAccordionpane(item: any, index: any, accordionpanes: any[] = []) {\n const showIconOnLeft = this.styles.leftToggleIcon.root.width !== undefined;\n const isExpanded = this.state.isExpanded[index];\n const titleIconStyles = this.theme.mergeStyle(this.styles.icon, this.styles.titleIcon)\n return item.props.show != false ? (\n <View style={this.styles.pane} key={item.props.title}>\n <TouchableOpacity key={'accordionpane_' + (index + 1)}\n {...this.getTestPropsForAction(`header${index}`)}\n style={[this.styles.header,\n index === 0 ? this.styles.firstHeader: null,\n index === accordionpanes.length - 1 && !isExpanded ? this.styles.lastHeader: null,\n isExpanded ? this.styles.activeHeader : {}]}\n onPress={this.toggle.bind(this, index + 1, !isExpanded)}>\n {this.expandCollapseIcon(item, index, false, showIconOnLeft, true, isExpanded)}\n {item.props.iconclass ? <WmIcon id={this.getTestId('icon')} styles={titleIconStyles} name={item.props.name + '_icon'} iconclass={item.props.iconclass}></WmIcon>: null}\n <View style={{flexDirection: 'column', flex: 1, justifyContent: 'center'}}>\n {this._showSkeleton ? \n <WmLabel \n showskeleton={true}\n styles={{\n root: [\n this.styles.text,\n this.styles.heading\n ]\n }} \n caption={isDefined(item.props.title) ? item.props.title : 'Title'}/> : \n <Text \n style={[\n this.styles.text,\n this.styles.heading,\n isExpanded ? this.styles.activeHeaderTitle : {}]}\n {...this.getTestPropsForAction(`header${index}_title`)}\n accessibilityRole='header'>\n {isDefined(item.props.title) ? item.props.title : 'Title'}\n </Text>} \n {item.props.description ? \n (this._showSkeleton ? \n <WmLabel \n styles={{root: this.styles.subheading}} \n showskeleton={true} \n caption={item.props.description} /> : \n <Text style={this.styles.subheading}\n {...this.getTestPropsForAction(`header${index}_description`)}>\n {item.props.description}\n </Text>) : null }\n </View>\n {this.expandCollapseIcon(item, index, true, !showIconOnLeft, true, isExpanded)}\n </TouchableOpacity>\n {item}\n </View>\n ): null;\n }\n\n toggle(index: number, expand = true) {\n let expandedId = expand ? index : -1;\n let collapseId = expand ? -1 : index;\n if (expand && this.state.isExpanded[expandedId - 1]\n || !expand && this.state.isExpanded[collapseId - 1] === false) {\n return;\n }\n if (collapseId < 0 && this.state.props.closeothers) {\n collapseId = this.state.lastExpandedIndex;\n }\n const collapsedPane = this.accordionPanes[collapseId -1];\n collapsedPane?.hide();\n Promise.resolve().then(() => {\n const expandedPane = expandedId ? this.accordionPanes[expandedId - 1]: null;\n expandedPane?.show();\n this.setState((state) => {\n if (collapseId > 0 && collapsedPane) {\n state.isExpanded[collapseId - 1] = false;\n }\n if (expandedId > 0 && expandedPane) {\n state.isExpanded[expandedId - 1] = true;\n }\n return {\n lastExpandedIndex: expandedId,\n isExpanded: [...state.isExpanded]\n };\n }, () => {\n this.invokeEventCallback('onChange', [{},\n this.proxy,\n expandedId - 1,\n collapseId ? collapseId - 1 : null,\n expandedPane && expandedPane.props.name,\n collapsedPane && collapsedPane.props.name]);\n });\n }, () => {});\n }\n\n public componentDidMount(): void {\n super.componentDidMount();\n this.toggle(this.state.props.defaultpaneindex + 1);\n }\n\n protected getBackground(): React.JSX.Element | null {\n return this._showSkeleton ? null : this._background\n } \n \n public renderSkeleton(props: WmAccordionProps): React.ReactNode {\n const accordionpanes = props.children;\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 {accordionpanes\n ? isArray(accordionpanes) && accordionpanes.length\n ? accordionpanes.map((item: any, index: any) => this.renderAccordionpane(item, index, accordionpanes))\n : this.renderAccordionpane(accordionpanes, 0)\n : null}\n </View>))\n }\n return null;\n }\n\n\n renderWidget(props: WmAccordionProps) {\n const accordionpanes = props.children;\n const expandedId = this.state.lastExpandedIndex || 0;\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 {accordionpanes\n ? isArray(accordionpanes) && accordionpanes.length\n ? accordionpanes.map((item: any, index: any) => this.renderAccordionpane(item, index, accordionpanes))\n : this.renderAccordionpane(accordionpanes, 0)\n : null}\n </View>\n );\n }\n}\n"],"mappings":";;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,IAAI,EAAEC,gBAAgB,EAAEC,IAAI,QAAQ,cAAc;AAC3D,SAASC,KAAK,QAAQ,oBAAoB;AAC1C,SAASC,OAAO,QAAQ,QAAQ;AAEhC,SAASC,aAAa,EAAEC,kBAAkB,QAAQ,+CAA+C;AACjG,OAAOC,gBAAgB,MAAM,mBAAmB;AAChD,SAAUC,aAAa,QAA2B,oBAAoB;AACtE,OAAOC,MAAM,MAAM,gEAAgE;AAEnF,SAASC,SAAS,QAAQ,sCAAsC;AAEhE,SAASC,cAAc,QAAQ,wEAAwE;AAEv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AC,CAAC,GACpG,IAAI,CAACD,mBAAmB,CAACC,cAAc,EAAE,CAAC,CAAC,GAC7C,IACF,CAAC;EAEb;AACF","ignoreList":[]}
1
+ {"version":3,"names":["React","Text","TouchableOpacity","View","Badge","isArray","BaseComponent","BaseComponentState","WmAccordionProps","DEFAULT_CLASS","WmIcon","isDefined","createSkeleton","WmLabel","WmAccordionState","constructor","args","_defineProperty","WmAccordion","props","addAccordionPane","accordionPane","i","accordionPanes","findIndex","t","paneId","newIndex","push","toggle","state","defaultpaneindex","removeAccordionPane","index","splice","expand","accordionName","name","collapse","expandCollapseIcon","item","showBadge","showIcon","useChevron","isExpanded","widgetProps","badge","badgevalue","undefined","createElement","_extends","style","styles","activeBadge","badgetype","getTestProps","iconclass","flexDirection","id","getTestId","theme","mergeStyle","icon","activeIcon","renderAccordionpane","accordionpanes","showIconOnLeft","leftToggleIcon","root","width","titleIconStyles","titleIcon","show","pane","key","title","getTestPropsForAction","header","firstHeader","length","lastHeader","activeHeader","onPress","bind","flex","justifyContent","_showSkeleton","showskeleton","text","heading","caption","activeHeaderTitle","accessibilityRole","description","subheading","expandedId","collapseId","expandedPane","collapsed","closeothers","lastExpandedIndex","collapsedPane","hide","Promise","resolve","then","setState","invokeEventCallback","proxy","componentDidMount","getBackground","_background","renderSkeleton","children","showskeletonchildren","_this$props","skeletonStyles","skeleton","opacity","map","renderWidget","_this$styles$skeleton"],"sources":["accordion.component.tsx"],"sourcesContent":["import React from 'react';\nimport { Text, TouchableOpacity, View } from 'react-native';\nimport { Badge } from 'react-native-paper';\nimport { isArray } from 'lodash';\n\nimport { BaseComponent, BaseComponentState } from '@wavemaker/app-rn-runtime/core/base.component';\nimport WmAccordionProps from './accordion.props';\nimport { DEFAULT_CLASS, WmAccordionStyles } from './accordion.styles';\nimport WmIcon from '@wavemaker/app-rn-runtime/components/basic/icon/icon.component';\nimport WmAccordionpane from './accordionpane/accordionpane.component';\nimport { isDefined } from '@wavemaker/app-rn-runtime/core/utils';\n\nimport { createSkeleton } from '@wavemaker/app-rn-runtime/components/basic/skeleton/skeleton.component';\nimport { WmSkeletonStyles } from '@wavemaker/app-rn-runtime/components/basic/skeleton/skeleton.styles';\nimport WmLabel from '@wavemaker/app-rn-runtime/components/basic/label/label.component';\n\nexport class WmAccordionState extends BaseComponentState<WmAccordionProps> {\n lastExpandedIndex = -1;\n isExpanded = [] as boolean[];\n}\n\n\nexport default class WmAccordion extends BaseComponent<WmAccordionProps, WmAccordionState, WmAccordionStyles> {\n public accordionPanes = [] as WmAccordionpane[];\n private newIndex = 0;\n\n constructor(props: WmAccordionProps) {\n super(props, DEFAULT_CLASS, new WmAccordionProps(), new WmAccordionState());\n }\n\n addAccordionPane(accordionPane: WmAccordionpane) {\n const i = this.accordionPanes.findIndex(t => {\n return t.paneId === accordionPane.paneId});\n if (i >= 0) {\n this.accordionPanes[i] = accordionPane;\n } else {\n accordionPane.paneId = `accordionPane${this.newIndex++}`;\n this.accordionPanes.push(accordionPane);\n }\n this.toggle(this.state.props.defaultpaneindex + 1);\n }\n\n removeAccordionPane(accordionPane: WmAccordionpane){\n const index = this.accordionPanes.findIndex(t => t.paneId === accordionPane.paneId);\n if (index >= 0) {\n this.accordionPanes.splice(index, 1); \n this.newIndex--;\n }\n }\n\n expand(accordionName: string) {\n const i = this.accordionPanes.findIndex(t => t.props.name === accordionName);\n this.toggle(i + 1, true);\n }\n\n collapse(accordionName: string) {\n const i = this.accordionPanes.findIndex(t => t.props.name === accordionName);\n this.toggle(i + 1, false);\n }\n\n expandCollapseIcon(item: any, index: number, showBadge = true, showIcon = true, useChevron = true, isExpanded = false) {\n const widgetProps = item.props;\n //@ts-ignore\n const badge = showBadge && widgetProps.badgevalue != undefined ? (\n <Badge style={[\n this.styles.badge,\n isExpanded ? this.styles.activeBadge: null,\n this.styles[widgetProps.badgetype || 'default']]}\n {...this.getTestProps('badge'+index)}>\n {widgetProps.badgevalue}\n </Badge>): null;\n let iconclass = null;\n if (useChevron) {\n iconclass = isExpanded ? 'wi wi-chevron-down' : 'wi wi-chevron-up';\n } else {\n iconclass = isExpanded ? 'wi wi-minus' : 'wi wi-plus';\n }\n return (<View style={{flexDirection: 'row'}}>\n {badge}\n {showIcon ? (\n <WmIcon\n id={this.getTestId('icon' + index)}\n styles={this.theme.mergeStyle({}, this.styles.icon, isExpanded ? this.styles.activeIcon : null)}\n name={'expand_collapse_icon'}\n iconclass={iconclass}></WmIcon>): null}\n </View>);\n }\n\n renderAccordionpane(item: any, index: any, accordionpanes: any[] = []) {\n const showIconOnLeft = this.styles.leftToggleIcon.root.width !== undefined;\n const isExpanded = this.state.isExpanded[index];\n const titleIconStyles = this.theme.mergeStyle(this.styles.icon, this.styles.titleIcon)\n return item.props.show != false ? (\n <View style={this.styles.pane} key={item.props.title}>\n <TouchableOpacity key={'accordionpane_' + (index + 1)}\n {...this.getTestPropsForAction(`header${index}`)}\n style={[this.styles.header,\n index === 0 ? this.styles.firstHeader: null,\n index === accordionpanes.length - 1 && !isExpanded ? this.styles.lastHeader: null,\n isExpanded ? this.styles.activeHeader : {}]}\n onPress={this.toggle.bind(this, index + 1, !isExpanded)}>\n {this.expandCollapseIcon(item, index, false, showIconOnLeft, true, isExpanded)}\n {item.props.iconclass ? <WmIcon id={this.getTestId('icon')} styles={titleIconStyles} name={item.props.name + '_icon'} iconclass={item.props.iconclass}></WmIcon>: null}\n <View style={{flexDirection: 'column', flex: 1, justifyContent: 'center'}}>\n {this._showSkeleton ? \n <WmLabel \n showskeleton={true}\n styles={{\n root: [\n this.styles.text,\n this.styles.heading\n ]\n }} \n caption={isDefined(item.props.title) ? item.props.title : 'Title'}/> : \n <Text \n style={[\n this.styles.text,\n this.styles.heading,\n isExpanded ? this.styles.activeHeaderTitle : {}]}\n {...this.getTestPropsForAction(`header${index}_title`)}\n accessibilityRole='header'>\n {isDefined(item.props.title) ? item.props.title : 'Title'}\n </Text>} \n {item.props.description ? \n (this._showSkeleton ? \n <WmLabel \n styles={{root: this.styles.subheading}} \n showskeleton={true} \n caption={item.props.description} /> : \n <Text style={this.styles.subheading}\n {...this.getTestPropsForAction(`header${index}_description`)}>\n {item.props.description}\n </Text>) : null }\n </View>\n {this.expandCollapseIcon(item, index, true, !showIconOnLeft, true, isExpanded)}\n </TouchableOpacity>\n {item}\n </View>\n ): null;\n }\n\n toggle(index: number, expand = true) {\n let expandedId = expand ? index : -1;\n let collapseId = expand ? -1 : index;\n const expandedPane = expandedId ? this.accordionPanes[expandedId - 1]: null;\n if (expand && this.state.isExpanded[expandedId - 1] && !expandedPane?.state.collapsed\n || !expand && this.state.isExpanded[collapseId - 1] === false && expandedPane?.state.collapsed) {\n return;\n }\n if (collapseId < 0 && this.state.props.closeothers) {\n collapseId = this.state.lastExpandedIndex;\n }\n const collapsedPane = this.accordionPanes[collapseId -1];\n collapsedPane?.hide();\n Promise.resolve().then(() => {\n expandedPane?.show();\n this.setState((state) => {\n if (collapseId > 0 && collapsedPane) {\n state.isExpanded[collapseId - 1] = false;\n }\n if (expandedId > 0 && expandedPane) {\n state.isExpanded[expandedId - 1] = true;\n }\n return {\n lastExpandedIndex: expandedId,\n isExpanded: [...state.isExpanded]\n };\n }, () => {\n this.invokeEventCallback('onChange', [{},\n this.proxy,\n expandedId - 1,\n collapseId ? collapseId - 1 : null,\n expandedPane && expandedPane.props.name,\n collapsedPane && collapsedPane.props.name]);\n });\n }, () => {});\n }\n\n public componentDidMount(): void {\n super.componentDidMount();\n this.toggle(this.state.props.defaultpaneindex + 1);\n }\n\n protected getBackground(): React.JSX.Element | null {\n return this._showSkeleton ? null : this._background\n } \n \n public renderSkeleton(props: WmAccordionProps): React.ReactNode {\n const accordionpanes = props.children;\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 {accordionpanes\n ? isArray(accordionpanes) && accordionpanes.length\n ? accordionpanes.map((item: any, index: any) => this.renderAccordionpane(item, index, accordionpanes))\n : this.renderAccordionpane(accordionpanes, 0)\n : null}\n </View>))\n }\n return null;\n }\n\n\n renderWidget(props: WmAccordionProps) {\n const accordionpanes = props.children;\n const expandedId = this.state.lastExpandedIndex || 0;\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 {accordionpanes\n ? isArray(accordionpanes) && accordionpanes.length\n ? accordionpanes.map((item: any, index: any) => this.renderAccordionpane(item, index, accordionpanes))\n : this.renderAccordionpane(accordionpanes, 0)\n : null}\n </View>\n );\n }\n}\n"],"mappings":";;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,IAAI,EAAEC,gBAAgB,EAAEC,IAAI,QAAQ,cAAc;AAC3D,SAASC,KAAK,QAAQ,oBAAoB;AAC1C,SAASC,OAAO,QAAQ,QAAQ;AAEhC,SAASC,aAAa,EAAEC,kBAAkB,QAAQ,+CAA+C;AACjG,OAAOC,gBAAgB,MAAM,mBAAmB;AAChD,SAAUC,aAAa,QAA2B,oBAAoB;AACtE,OAAOC,MAAM,MAAM,gEAAgE;AAEnF,SAASC,SAAS,QAAQ,sCAAsC;AAEhE,SAASC,cAAc,QAAQ,wEAAwE;AAEvG,OAAOC,OAAO,MAAM,kEAAkE;AAEtF,OAAO,MAAMC,gBAAgB,SAASP,kBAAkB,CAAmB;EAAAQ,YAAA,GAAAC,IAAA;IAAA,SAAAA,IAAA;IAAAC,eAAA,4BACrD,CAAC,CAAC;IAAAA,eAAA,qBACT,EAAE;EAAA;AACjB;AAGA,eAAe,MAAMC,WAAW,SAASZ,aAAa,CAAwD;EAI5GS,WAAWA,CAACI,KAAuB,EAAE;IACnC,KAAK,CAACA,KAAK,EAAEV,aAAa,EAAE,IAAID,gBAAgB,CAAC,CAAC,EAAE,IAAIM,gBAAgB,CAAC,CAAC,CAAC;IAACG,eAAA,yBAJtD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,CAAC;EAEb;AACF","ignoreList":[]}
@@ -18,6 +18,7 @@ export class WmAccordionpaneState extends BaseComponentState {
18
18
  export default class WmAccordionpane extends BaseComponent {
19
19
  constructor(props) {
20
20
  super(props, DEFAULT_CLASS, new WmAccordionpaneProps(), new WmAccordionpaneState());
21
+ _defineProperty(this, "paneId", "");
21
22
  }
22
23
  isCollapsed() {
23
24
  return this.state.collapsed;
@@ -48,6 +49,12 @@ export default class WmAccordionpane extends BaseComponent {
48
49
  }
49
50
  super.componentDidMount();
50
51
  }
52
+ componentWillUnmount() {
53
+ const accordion = this.parent;
54
+ if (accordion.removeAccordionPane) {
55
+ accordion.removeAccordionPane(this);
56
+ }
57
+ }
51
58
  onPartialLoad() {
52
59
  this.invokeEventCallback('onLoad', [this]);
53
60
  }
@@ -1 +1 @@
1
- {"version":3,"names":["React","BaseComponent","BaseComponentState","WmAccordionpaneProps","DEFAULT_CLASS","View","isWebPreviewMode","CollapsiblePane","WmAccordionpaneState","constructor","args","_defineProperty","WmAccordionpane","props","isCollapsed","state","collapsed","show","updateState","invokeEventCallback","proxy","hide","expand","parent","name","collapse","componentDidMount","accordion","addAccordionPane","onPartialLoad","renderContent","renderPartial","isPartialLoaded","setTimeout","bind","children","renderWidget","createElement","style","maxHeight","overflow","_background","close"],"sources":["accordionpane.component.tsx"],"sourcesContent":["import React, { useCallback, useMemo, useState } from 'react';\nimport { BaseComponent, BaseComponentState } from '@wavemaker/app-rn-runtime/core/base.component';\n\nimport WmAccordionpaneProps from './accordionpane.props';\nimport { DEFAULT_CLASS, WmAccordionpaneStyles } from './accordionpane.styles';\nimport WmAccordion from '../accordion.component';\nimport { View } from 'react-native';\nimport { isWebPreviewMode } from '@wavemaker/app-rn-runtime/core/utils';\nimport { CollapsiblePane } from '../../panel/collapsible-pane.component';\n\nexport class WmAccordionpaneState extends BaseComponentState<WmAccordionpaneProps> {\n isPartialLoaded = false;\n collapsed = true;\n}\n\nexport default class WmAccordionpane extends BaseComponent<WmAccordionpaneProps, WmAccordionpaneState, WmAccordionpaneStyles> {\n\n constructor(props: WmAccordionpaneProps) {\n super(props, DEFAULT_CLASS, new WmAccordionpaneProps(), new WmAccordionpaneState());\n }\n\n isCollapsed() {\n return this.state.collapsed;\n }\n \n show() {\n this.updateState({\n collapsed: false\n } as WmAccordionpaneState);\n this.invokeEventCallback('onExpand', [null, this.proxy]);\n }\n\n hide() {\n this.updateState({\n collapsed: true\n } as WmAccordionpaneState);\n this.invokeEventCallback('onCollapse', [null, this.proxy]);\n }\n\n expand() {\n (this.parent as WmAccordion).expand(this.props.name || '');\n }\n\n collapse() {\n (this.parent as WmAccordion).expand(this.props.name || '');\n }\n\n componentDidMount() {\n const accordion = (this.parent) as WmAccordion;\n // When skeleton is enabled in the accordion component, the parent would be WMSkeleton which doesnot have addAccordionPane function\n if(accordion.addAccordionPane) {\n accordion.addAccordionPane(this);\n }\n super.componentDidMount();\n }\n\n onPartialLoad() {\n this.invokeEventCallback('onLoad', [this]);\n }\n\n renderContent(props: WmAccordionpaneProps) {\n if (props.renderPartial) {\n if (!this.state.isPartialLoaded) {\n setTimeout(() => {\n this.updateState({\n isPartialLoaded: true\n } as WmAccordionpaneState);\n });\n }\n return props.renderPartial(props, this.onPartialLoad.bind(this));\n }\n return props.children;\n }\n renderWidget(props: WmAccordionpaneProps) {\n return isWebPreviewMode() ? \n (<View style={this.state.collapsed ? {maxHeight: 0, overflow: 'hidden'} : {}}>\n {this._background}\n {this.renderContent(props)}\n </View>) :\n (<CollapsiblePane close={this.state.collapsed}>\n {this._background}\n {this.renderContent(props)}\n </CollapsiblePane>);\n }\n}\n"],"mappings":";;;AAAA,OAAOA,KAAK,MAA0C,OAAO;AAC7D,SAASC,aAAa,EAAEC,kBAAkB,QAAQ,+CAA+C;AAEjG,OAAOC,oBAAoB,MAAM,uBAAuB;AACxD,SAASC,aAAa,QAA+B,wBAAwB;AAE7E,SAASC,IAAI,QAAQ,cAAc;AACnC,SAASC,gBAAgB,QAAQ,sCAAsC;A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,CAACC,gBAAgB,CAAC,IAAI,CAAC;IAClC;IACA,KAAK,CAACF,iBAAiB,CAAC,CAAC;EAC3B;EAEAG,aAAaA,CAAA,EAAG;IACd,IAAI,CAACV,mBAAmB,CAAC,QAAQ,EAAE,CAAC,IAAI,CAAC,CAAC;EAC5C;EAEAW,aAAaA,CAACjB,KAA2B,EAAE;IACzC,IAAIA,KAAK,CAACkB,aAAa,EAAE;MACvB,IAAI,CAAC,IAAI,CAAChB,KAAK,CAACiB,eAAe,EAAE;QAC/BC,UAAU,CAAC,MAAM;UACf,IAAI,CAACf,WAAW,CAAC;YACfc,eAAe,EAAE;UACnB,CAAyB,CAAC;QAC5B,CAAC,CAAC;MACJ;MACA,OAAOnB,KAAK,CAACkB,aAAa,CAAClB,KAAK,EAAE,IAAI,CAACgB,aAAa,CAACK,IAAI,CAAC,IAAI,CAAC,CAAC;IAClE;IACA,OAAOrB,KAAK,CAACsB,QAAQ;EACvB;EACAC,YAAYA,CAACvB,KAA2B,EAAE;IACxC,OAAOP,gBAAgB,CAAC,CAAC,gBACxBN,KAAA,CAAAqC,aAAA,CAAChC,IAAI;MAACiC,KAAK,EAAE,IAAI,CAACvB,KAAK,CAACC,SAAS,GAAG;QAACuB,SAAS,EAAE,CAAC;QAAEC,QAAQ,EAAE;MAAQ,CAAC,GAAG,CAAC;IAAE,GAC1E,IAAI,CAACC,WAAW,EAChB,IAAI,CAACX,aAAa,CAACjB,KAAK,CACrB,CAAC,gBACNb,KAAA,CAAAqC,aAAA,CAAC9B,eAAe;MAACmC,KAAK,EAAE,IAAI,CAAC3B,KAAK,CAACC;IAAU,GAC3C,IAAI,CAACyB,WAAW,EAChB,IAAI,CAACX,aAAa,CAACjB,KAAK,CACV,CAAE;EACrB;AACF","ignoreList":[]}
1
+ {"version":3,"names":["React","BaseComponent","BaseComponentState","WmAccordionpaneProps","DEFAULT_CLASS","View","isWebPreviewMode","CollapsiblePane","WmAccordionpaneState","constructor","args","_defineProperty","WmAccordionpane","props","isCollapsed","state","collapsed","show","updateState","invokeEventCallback","proxy","hide","expand","parent","name","collapse","componentDidMount","accordion","addAccordionPane","componentWillUnmount","removeAccordionPane","onPartialLoad","renderContent","renderPartial","isPartialLoaded","setTimeout","bind","children","renderWidget","createElement","style","maxHeight","overflow","_background","close"],"sources":["accordionpane.component.tsx"],"sourcesContent":["import React, { useCallback, useMemo, useState } from 'react';\nimport { BaseComponent, BaseComponentState } from '@wavemaker/app-rn-runtime/core/base.component';\n\nimport WmAccordionpaneProps from './accordionpane.props';\nimport { DEFAULT_CLASS, WmAccordionpaneStyles } from './accordionpane.styles';\nimport WmAccordion from '../accordion.component';\nimport { View } from 'react-native';\nimport { isWebPreviewMode } from '@wavemaker/app-rn-runtime/core/utils';\nimport { CollapsiblePane } from '../../panel/collapsible-pane.component';\n\nexport class WmAccordionpaneState extends BaseComponentState<WmAccordionpaneProps> {\n isPartialLoaded = false;\n collapsed = true;\n}\n\nexport default class WmAccordionpane extends BaseComponent<WmAccordionpaneProps, WmAccordionpaneState, WmAccordionpaneStyles> {\n public paneId: string = \"\";\n constructor(props: WmAccordionpaneProps) {\n super(props, DEFAULT_CLASS, new WmAccordionpaneProps(), new WmAccordionpaneState());\n }\n\n isCollapsed() {\n return this.state.collapsed;\n }\n \n show() {\n this.updateState({\n collapsed: false\n } as WmAccordionpaneState);\n this.invokeEventCallback('onExpand', [null, this.proxy]);\n }\n\n hide() {\n this.updateState({\n collapsed: true\n } as WmAccordionpaneState);\n this.invokeEventCallback('onCollapse', [null, this.proxy]);\n }\n\n expand() {\n (this.parent as WmAccordion).expand(this.props.name || '');\n }\n\n collapse() {\n (this.parent as WmAccordion).expand(this.props.name || '');\n }\n\n componentDidMount() {\n const accordion = (this.parent) as WmAccordion;\n // When skeleton is enabled in the accordion component, the parent would be WMSkeleton which doesnot have addAccordionPane function\n if(accordion.addAccordionPane) {\n accordion.addAccordionPane(this);\n }\n super.componentDidMount();\n }\n\n componentWillUnmount() {\n const accordion = (this.parent) as WmAccordion;\n if(accordion.removeAccordionPane) {\n accordion.removeAccordionPane(this);\n }\n }\n\n onPartialLoad() {\n this.invokeEventCallback('onLoad', [this]);\n }\n\n renderContent(props: WmAccordionpaneProps) {\n if (props.renderPartial) {\n if (!this.state.isPartialLoaded) {\n setTimeout(() => {\n this.updateState({\n isPartialLoaded: true\n } as WmAccordionpaneState);\n });\n }\n return props.renderPartial(props, this.onPartialLoad.bind(this));\n }\n return props.children;\n }\n renderWidget(props: WmAccordionpaneProps) {\n return isWebPreviewMode() ? \n (<View style={this.state.collapsed ? {maxHeight: 0, overflow: 'hidden'} : {}}>\n {this._background}\n {this.renderContent(props)}\n </View>) :\n (<CollapsiblePane close={this.state.collapsed}>\n {this._background}\n {this.renderContent(props)}\n </CollapsiblePane>);\n }\n}\n"],"mappings":";;;AAAA,OAAOA,KAAK,MAA0C,OAAO;AAC7D,SAASC,aAAa,EAAEC,kBAAkB,QAAQ,+CAA+C;AAEjG,OAAOC,oBAAoB,MAAM,uBAAuB;AACxD,SAASC,aAAa,QAA+B,wBAAwB;AAE7E,SAASC,IAAI,QAAQ,cAAc;AACnC,SAASC,gBAAgB,QAAQ,sCAAsC;AACvE,SAASC,eAAe,QAAQ,wCAAwC;AAExE,OAAO,MAAMC,oBAAoB,SAASN,kBAAkB,CAAuB;EAAAO,YAAA,GAAAC,IAAA;IAAA,SAAAA,IAAA;IAAAC,eAAA,0BAC/D,KAAK;IAAAA,eAAA,oBACX,IAAI;EAAA;AAClB;AAEA,eAAe,MAAMC,eAAe,SAASX,aAAa,CAAoE;EAE5HQ,WAAWA,CAACI,KAA2B,EAAE;IACvC,KAAK,CAACA,KAAK,EAAET,aAAa,EAAE,IAAID,oBAAoB,CAAC,CAAC,EAAE,IAAIK,oBAAoB,CAAC,CAAC,CAAC;IAACG,eAAA,iBAF9D,EAAE;EAG1B;EAEAG,WAAWA,CAAA,EAAG;IACZ,OAAO,IAAI,CAACC,KAAK,CAACC,SAAS;EAC7B;EAEAC,IAAIA,CAAA,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EAAE;QAC/BC,UAAU,CAAC,MAAM;UACf,IAAI,CAACjB,WAAW,CAAC;YACfgB,eAAe,EAAE;UACnB,CAAyB,CAAC;QAC5B,CAAC,CAAC;MACJ;MACA,OAAOrB,KAAK,CAACoB,aAAa,CAACpB,KAAK,EAAE,IAAI,CAACkB,aAAa,CAACK,IAAI,CAAC,IAAI,CAAC,CAAC;IAClE;IACA,OAAOvB,KAAK,CAACwB,QAAQ;EACvB;EACAC,YAAYA,CAACzB,KAA2B,EAAE;IACxC,OAAOP,gBAAgB,CAAC,CAAC,gBACxBN,KAAA,CAAAuC,aAAA,CAAClC,IAAI;MAACmC,KAAK,EAAE,IAAI,CAACzB,KAAK,CAACC,SAAS,GAAG;QAACyB,SAAS,EAAE,CAAC;QAAEC,QAAQ,EAAE;MAAQ,CAAC,GAAG,CAAC;IAAE,GAC1E,IAAI,CAACC,WAAW,EAChB,IAAI,CAACX,aAAa,CAACnB,KAAK,CACrB,CAAC,gBACNb,KAAA,CAAAuC,aAAA,CAAChC,eAAe;MAACqC,KAAK,EAAE,IAAI,CAAC7B,KAAK,CAACC;IAAU,GAC3C,IAAI,CAAC2B,WAAW,EAChB,IAAI,CAACX,aAAa,CAACnB,KAAK,CACV,CAAE;EACrB;AACF","ignoreList":[]}
@@ -10,6 +10,7 @@ import { Tappable } from '@wavemaker/app-rn-runtime/core/tappable.component';
10
10
  import { Animatedview } from '@wavemaker/app-rn-runtime/components/basic/animatedview.component';
11
11
  import { PartialHost, PartialHostState } from './partial-host.component';
12
12
  import { createSkeleton } from '../basic/skeleton/skeleton.component';
13
+ import { ScrollView } from 'react-native-gesture-handler';
13
14
  export class WmContainerState extends PartialHostState {
14
15
  constructor(...args) {
15
16
  super(...args);
@@ -65,8 +66,14 @@ export default class WmContainer extends PartialHost {
65
66
  }, this.getBackground(), /*#__PURE__*/React.createElement(Tappable, _extends({}, this.getTestPropsForAction(), {
66
67
  target: this,
67
68
  styles: dimensions
68
- }), /*#__PURE__*/React.createElement(View, {
69
+ }), !props.scrollable ? /*#__PURE__*/React.createElement(View, {
69
70
  style: [dimensions, this.styles.content]
71
+ }, this.renderContent(props)) : /*#__PURE__*/React.createElement(ScrollView, {
72
+ style: [dimensions, this.styles.content],
73
+ onScroll: event => {
74
+ this.notify('scroll', [event]);
75
+ },
76
+ scrollEventThrottle: 48
70
77
  }, this.renderContent(props))));
71
78
  }
72
79
  }
@@ -1 +1 @@
1
- {"version":3,"names":["React","View","WmContainerProps","DEFAULT_CLASS","Tappable","Animatedview","PartialHost","PartialHostState","createSkeleton","WmContainerState","constructor","args","_defineProperty","WmContainer","props","getBackground","_showSkeleton","_background","renderSkeleton","showskeletonchildren","_this$props","dimensions","width","styles","root","undefined","height","skeletonStyles","skeleton","text","theme","createElement","style","opacity","_extends","getTestPropsForAction","target","content","renderContent","renderWidget","entryanimation","animation","delay","animationdelay"],"sources":["container.component.tsx"],"sourcesContent":["import React from 'react';\nimport { ColorValue, View, ViewStyle } from 'react-native';\n\nimport WmContainerProps from './container.props';\nimport { DEFAULT_CLASS, WmContainerStyles } from './container.styles';\nimport { Tappable } from '@wavemaker/app-rn-runtime/core/tappable.component';\nimport { Animatedview } from '@wavemaker/app-rn-runtime/components/basic/animatedview.component';\nimport { PartialHost, PartialHostState } from './partial-host.component';\nimport { createSkeleton } from '../basic/skeleton/skeleton.component';\nimport { WmSkeletonStyles } from '../basic/skeleton/skeleton.styles';\n\nexport class WmContainerState extends PartialHostState<WmContainerProps> {\n isPartialLoaded = false;\n}\n\nexport default class WmContainer extends PartialHost<WmContainerProps, WmContainerState, WmContainerStyles> {\n constructor(props: WmContainerProps) {\n super(props, DEFAULT_CLASS, new WmContainerProps(), new WmContainerState());\n }\n\n getBackground(): React.JSX.Element | null {\n return this._showSkeleton ? null : this._background\n } \n \n public renderSkeleton(props: WmContainerProps): React.ReactNode {\n if(!props.showskeletonchildren) {\n const dimensions = {\n width: this.styles.root.width ? '100%' : undefined,\n height: this.styles.root.height ? '100%' : undefined\n }; \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 <Tappable {...this.getTestPropsForAction()} target={this} styles={dimensions}>\n <View style={[dimensions as ViewStyle, this.styles.content]}>{this.renderContent(props)}</View>\n </Tappable>\n\n </View>))\n }\n return null;\n }\n\n\n renderWidget(props: WmContainerProps) {\n const dimensions = {\n width: this.styles.root.width ? '100%' : undefined,\n height: this.styles.root.height ? '100%' : undefined\n };\n\n const styles = this._showSkeleton ? {\n ...this.styles.root,\n ...this.styles.skeleton.root\n } : this.styles.root\n return (\n <Animatedview entryanimation={props.animation} delay={props.animationdelay} style={styles}>\n {this.getBackground()}\n <Tappable {...this.getTestPropsForAction()} target={this} styles={dimensions}>\n <View style={[dimensions as ViewStyle, this.styles.content]}>{this.renderContent(props)}</View>\n </Tappable>\n </Animatedview>\n );\n }\n}\n"],"mappings":";;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAAqBC,IAAI,QAAmB,cAAc;AAE1D,OAAOC,gBAAgB,MAAM,mBAAmB;AAChD,SAASC,aAAa,QAA2B,oBAAoB;AACrE,SAASC,QAAQ,QAAQ,mDAAmD;AAC5E,SAASC,YAAY,QAAQ,mEAAmE;AAChG,SAASC,WAAW,EAAEC,gBAAgB,QAAQ,0BAA0B;AACxE,SAASC,cAAc,QAAQ,sCAAsC;AAGrE,OAAO,MAAMC,gBAAgB,SAASF,gBAAgB,CAAmB;EAAAG,YAAA,GAAAC,IAAA;IAAA,SAAAA,IAAA;IAAAC,eAAA,0BACrD,KAAK;EAAA;AACzB;AAEA,eAAe,MAAMC,WAAW,SAASP,WAAW,CAAwD;EAC1GI,WAAWA,CAACI,KAAuB,EAAE;IACnC,KAAK,CAACA,KAAK,EAAEX,aAAa,EAAE,IAAID,gBAAgB,CAAC,CAAC,EAAE,IAAIO,gBAAgB,CAAC,CAA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,CAEJ,CAAE,CAAC;IACX;IACA,OAAO,IAAI;EACb;EAGFyB,YAAYA,CAACzB,KAAuB,EAAE;IACpC,MAAMO,UAAU,GAAG;MACjBC,KAAK,EAAE,IAAI,CAACC,MAAM,CAACC,IAAI,CAACF,KAAK,GAAG,MAAM,GAAGG,SAAS;MAClDC,MAAM,EAAE,IAAI,CAACH,MAAM,CAACC,IAAI,CAACE,MAAM,GAAG,MAAM,GAAGD;IAC7C,CAAC;IAED,MAAMF,MAAM,GAAG,IAAI,CAACP,aAAa,GAAG;MAClC,GAAG,IAAI,CAACO,MAAM,CAACC,IAAI;MACnB,GAAG,IAAI,CAACD,MAAM,CAACK,QAAQ,CAACJ;IAC1B,CAAC,GAAG,IAAI,CAACD,MAAM,CAACC,IAAI;IACpB,oBACExB,KAAA,CAAA+B,aAAA,CAAC1B,YAAY;MAACmC,cAAc,EAAE1B,KAAK,CAAC2B,SAAU;MAACC,KAAK,EAAE5B,KAAK,CAAC6B,cAAe;MAACX,KAAK,EAAET;IAAO,GACvF,IAAI,CAACR,aAAa,CAAC,CAAC,eACrBf,KAAA,CAAA+B,aAAA,CAAC3B,QAAQ,EAAA8B,QAAA,KAAK,IAAI,CAACC,qBAAqB,CAAC,CAAC;MAAEC,MAAM,EAAE,IAAK;MAACb,MAAM,EAAEF;IAAW,iBACzErB,KAAA,CAAA+B,aAAA,CAAC9B,IAAI;MAAC+B,KAAK,EAAE,CAACX,UAAU,EAAgB,IAAI,CAACE,MAAM,CAACc,OAAO;IAAE,GAAE,IAAI,CAACC,aAAa,CAACxB,KAAK,CAAQ,CACzF,CACE,CAAC;EAEnB;AACF","ignoreList":[]}
1
+ {"version":3,"names":["React","View","WmContainerProps","DEFAULT_CLASS","Tappable","Animatedview","PartialHost","PartialHostState","createSkeleton","ScrollView","WmContainerState","constructor","args","_defineProperty","WmContainer","props","getBackground","_showSkeleton","_background","renderSkeleton","showskeletonchildren","_this$props","dimensions","width","styles","root","undefined","height","skeletonStyles","skeleton","text","theme","createElement","style","opacity","_extends","getTestPropsForAction","target","content","renderContent","renderWidget","entryanimation","animation","delay","animationdelay","scrollable","onScroll","event","notify","scrollEventThrottle"],"sources":["container.component.tsx"],"sourcesContent":["import React from 'react';\nimport { ColorValue, View, ViewStyle } from 'react-native';\n\nimport WmContainerProps from './container.props';\nimport { DEFAULT_CLASS, WmContainerStyles } from './container.styles';\nimport { Tappable } from '@wavemaker/app-rn-runtime/core/tappable.component';\nimport { Animatedview } from '@wavemaker/app-rn-runtime/components/basic/animatedview.component';\nimport { PartialHost, PartialHostState } from './partial-host.component';\nimport { createSkeleton } from '../basic/skeleton/skeleton.component';\nimport { WmSkeletonStyles } from '../basic/skeleton/skeleton.styles';\nimport { ScrollView } from 'react-native-gesture-handler';\n\nexport class WmContainerState extends PartialHostState<WmContainerProps> {\n isPartialLoaded = false;\n}\n\nexport default class WmContainer extends PartialHost<WmContainerProps, WmContainerState, WmContainerStyles> {\n constructor(props: WmContainerProps) {\n super(props, DEFAULT_CLASS, new WmContainerProps(), new WmContainerState());\n }\n\n getBackground(): React.JSX.Element | null {\n return this._showSkeleton ? null : this._background\n } \n \n public renderSkeleton(props: WmContainerProps): React.ReactNode {\n if(!props.showskeletonchildren) {\n const dimensions = {\n width: this.styles.root.width ? '100%' : undefined,\n height: this.styles.root.height ? '100%' : undefined\n }; \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 <Tappable {...this.getTestPropsForAction()} target={this} styles={dimensions}>\n <View style={[dimensions as ViewStyle, this.styles.content]}>{this.renderContent(props)}</View>\n </Tappable>\n\n </View>))\n }\n return null;\n }\n\n\n renderWidget(props: WmContainerProps) {\n const dimensions = {\n width: this.styles.root.width ? '100%' : undefined,\n height: this.styles.root.height ? '100%' : undefined\n };\n\n const styles = this._showSkeleton ? {\n ...this.styles.root,\n ...this.styles.skeleton.root\n } : this.styles.root\n return (\n <Animatedview entryanimation={props.animation} delay={props.animationdelay} style={styles}>\n {this.getBackground()}\n <Tappable {...this.getTestPropsForAction()} target={this} styles={dimensions}>\n {!props.scrollable ? <View style={[dimensions as ViewStyle, this.styles.content]}>{this.renderContent(props)}</View> : \n <ScrollView style={[dimensions as ViewStyle, this.styles.content]}\n onScroll={(event) => {this.notify('scroll', [event])}}\n scrollEventThrottle={48}>\n {this.renderContent(props)}\n </ScrollView>}\n </Tappable>\n </Animatedview>\n );\n }\n}\n"],"mappings":";;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAAqBC,IAAI,QAAmB,cAAc;AAE1D,OAAOC,gBAAgB,MAAM,mBAAmB;AAChD,SAASC,aAAa,QAA2B,oBAAoB;AACrE,SAASC,QAAQ,QAAQ,mDAAmD;AAC5E,SAASC,YAAY,QAAQ,mEAAmE;AAChG,SAASC,WAAW,EAAEC,gBAAgB,QAAQ,0BAA0B;AACxE,SAASC,cAAc,QAAQ,sCAAsC;AAErE,SAASC,UAAU,QAAQ,8BAA8B;AAEzD,OAAO,MAAMC,gBAAgB,SAASH,gBAAgB,CAAmB;EAAAI,YAAA,GAAAC,IAAA;IAAA,SAAAA,IAAA;IAAAC,eAAA,0BACrD,KAAK;EAAA;AACzB;AAEA,eAAe,MAAMC,WAAW,SAASR,WAAW,CAAwD;EAC1GK,WAAWA,CAACI,KAAuB,EAAE;IACnC,KAAK,CAACA,KAAK,EAAEZ,aAAa,EAAE,IAAID,gBAAgB,CAAC,CAAC,EAAE,IAAIQ,gBAAgB,CAAC,CAAC,CAAC;EAC7E;EAEAM,aAAaA,CAAA,EAA6B;IACxC,OAAO,IAAI,CAACC,aAAa,GAAG,IAAI,GAAG,IAAI,CAACC,WAAW;EACrD;EAEOC,cAAcA,CAACJ,KAAuB,EAAmB;IAC5D,IAAG,CAACA,KAAK,CAACK,oBAAoB,EAAE;MAAA,IAAAC,WAAA;MAC9B,MAAMC,UAAU,G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AI,CAACE,MAAM,GAAG,MAAM,GAAGD;IAC7C,CAAC;IAED,MAAMF,MAAM,GAAG,IAAI,CAACP,aAAa,GAAG;MAClC,GAAG,IAAI,CAACO,MAAM,CAACC,IAAI;MACnB,GAAG,IAAI,CAACD,MAAM,CAACK,QAAQ,CAACJ;IAC1B,CAAC,GAAG,IAAI,CAACD,MAAM,CAACC,IAAI;IACpB,oBACEzB,KAAA,CAAAgC,aAAA,CAAC3B,YAAY;MAACoC,cAAc,EAAE1B,KAAK,CAAC2B,SAAU;MAACC,KAAK,EAAE5B,KAAK,CAAC6B,cAAe;MAACX,KAAK,EAAET;IAAO,GACvF,IAAI,CAACR,aAAa,CAAC,CAAC,eACrBhB,KAAA,CAAAgC,aAAA,CAAC5B,QAAQ,EAAA+B,QAAA,KAAK,IAAI,CAACC,qBAAqB,CAAC,CAAC;MAAEC,MAAM,EAAE,IAAK;MAACb,MAAM,EAAEF;IAAW,IACxE,CAACP,KAAK,CAAC8B,UAAU,gBAAG7C,KAAA,CAAAgC,aAAA,CAAC/B,IAAI;MAACgC,KAAK,EAAE,CAACX,UAAU,EAAgB,IAAI,CAACE,MAAM,CAACc,OAAO;IAAE,GAAE,IAAI,CAACC,aAAa,CAACxB,KAAK,CAAQ,CAAC,gBACrHf,KAAA,CAAAgC,aAAA,CAACvB,UAAU;MAACwB,KAAK,EAAE,CAACX,UAAU,EAAgB,IAAI,CAACE,MAAM,CAACc,OAAO,CAAE;MACnEQ,QAAQ,EAAGC,KAAK,IAAK;QAAC,IAAI,CAACC,MAAM,CAAC,QAAQ,EAAE,CAACD,KAAK,CAAC,CAAC;MAAA,CAAE;MACtDE,mBAAmB,EAAE;IAAG,GACvB,IAAI,CAACV,aAAa,CAACxB,KAAK,CACf,CACJ,CACE,CAAC;EAEnB;AACF","ignoreList":[]}
@@ -8,6 +8,7 @@ export default class WmContainerProps extends PartialHostProps {
8
8
  _defineProperty(this, "animation", null);
9
9
  _defineProperty(this, "animationdelay", null);
10
10
  _defineProperty(this, "onLoad", void 0);
11
+ _defineProperty(this, "scrollable", false);
11
12
  }
12
13
  }
13
14
  //# sourceMappingURL=container.props.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["PartialHostProps","WmContainerProps","constructor","args","_defineProperty"],"sources":["container.props.ts"],"sourcesContent":["import { PartialHostProps } from './partial-host.component';\n\nexport default class WmContainerProps extends PartialHostProps {\n animation?: string = null as any;\n animationdelay?: number = null as any;\n onLoad?: Function;\n}\n"],"mappings":";;;AAAA,SAASA,gBAAgB,QAAQ,0BAA0B;AAE3D,eAAe,MAAMC,gBAAgB,SAASD,gBAAgB,CAAC;EAAAE,YAAA,GAAAC,IAAA;IAAA,SAAAA,IAAA;IAAAC,eAAA,oBACxC,IAAI;IAAAA,eAAA,yBACC,IAAI;IAAAA,eAAA;EAAA;AAEhC","ignoreList":[]}
1
+ {"version":3,"names":["PartialHostProps","WmContainerProps","constructor","args","_defineProperty"],"sources":["container.props.ts"],"sourcesContent":["import { PartialHostProps } from './partial-host.component';\n\nexport default class WmContainerProps extends PartialHostProps {\n animation?: string = null as any;\n animationdelay?: number = null as any;\n onLoad?: Function;\n scrollable?: Boolean = false as any;\n}\n"],"mappings":";;;AAAA,SAASA,gBAAgB,QAAQ,0BAA0B;AAE3D,eAAe,MAAMC,gBAAgB,SAASD,gBAAgB,CAAC;EAAAE,YAAA,GAAAC,IAAA;IAAA,SAAAA,IAAA;IAAAC,eAAA,oBACxC,IAAI;IAAAA,eAAA,yBACC,IAAI;IAAAA,eAAA;IAAAA,eAAA,qBAEP,KAAK;EAAA;AAC9B","ignoreList":[]}
@@ -35,7 +35,8 @@ export default class WmLayoutgrid extends BaseComponent {
35
35
  ...this.styles.skeleton.root
36
36
  } : this.styles.root;
37
37
  return /*#__PURE__*/React.createElement(View, {
38
- style: styles
38
+ style: styles,
39
+ testID: this.getTestId()
39
40
  }, this.getBackground(), props.children);
40
41
  }
41
42
  }
@@ -1 +1 @@
1
- {"version":3,"names":["React","View","BaseComponent","BaseComponentState","WmLayoutgridProps","DEFAULT_CLASS","createSkeleton","WmLayoutgridState","WmLayoutgrid","constructor","props","getBackground","_showSkeleton","_background","renderSkeleton","showskeletonchildren","_this$props","skeletonStyles","styles","skeleton","root","text","theme","createElement","style","opacity","children","renderWidget"],"sources":["layoutgrid.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 WmLayoutgridProps from './layoutgrid.props';\nimport { DEFAULT_CLASS, WmLayoutGridStyles } from './layoutgrid.styles';\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 WmLayoutgridState extends BaseComponentState<WmLayoutgridProps> {\n\n}\n\nexport default class WmLayoutgrid extends BaseComponent<WmLayoutgridProps, WmLayoutgridState, WmLayoutGridStyles> {\n\n constructor(props: WmLayoutgridProps) {\n super(props, DEFAULT_CLASS, new WmLayoutgridProps());\n }\n\n getBackground(): React.JSX.Element | null {\n return this._showSkeleton ? null : this._background\n } \n\n public renderSkeleton(props: WmLayoutgridProps): 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\n renderWidget(props: WmLayoutgridProps) {\n const styles = this._showSkeleton ? {\n ...this.styles.root,\n ...this.styles.skeleton.root\n } : this.styles.root\n return (\n <View style={styles}>{this.getBackground()}{props.children}</View>\n ); \n }\n}\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,IAAI,QAAQ,cAAc;AACnC,SAASC,aAAa,EAAEC,kBAAkB,QAAQ,+CAA+C;AAEj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AQ,CAACC;IAC1B,CAAC,GAAG,IAAI,CAACF,MAAM,CAACE,IAAI;IACpB,oBACEpB,KAAA,CAAAuB,aAAA,CAACtB,IAAI;MAACuB,KAAK,EAAEN;IAAO,GAAE,IAAI,CAACP,aAAa,CAAC,CAAC,EAAED,KAAK,CAACgB,QAAe,CAAC;EAEtE;AACF","ignoreList":[]}
1
+ {"version":3,"names":["React","View","BaseComponent","BaseComponentState","WmLayoutgridProps","DEFAULT_CLASS","createSkeleton","WmLayoutgridState","WmLayoutgrid","constructor","props","getBackground","_showSkeleton","_background","renderSkeleton","showskeletonchildren","_this$props","skeletonStyles","styles","skeleton","root","text","theme","createElement","style","opacity","children","renderWidget","testID","getTestId"],"sources":["layoutgrid.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 WmLayoutgridProps from './layoutgrid.props';\nimport { DEFAULT_CLASS, WmLayoutGridStyles } from './layoutgrid.styles';\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 WmLayoutgridState extends BaseComponentState<WmLayoutgridProps> {\n\n}\n\nexport default class WmLayoutgrid extends BaseComponent<WmLayoutgridProps, WmLayoutgridState, WmLayoutGridStyles> {\n\n constructor(props: WmLayoutgridProps) {\n super(props, DEFAULT_CLASS, new WmLayoutgridProps());\n }\n\n getBackground(): React.JSX.Element | null {\n return this._showSkeleton ? null : this._background\n } \n\n public renderSkeleton(props: WmLayoutgridProps): 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\n renderWidget(props: WmLayoutgridProps) {\n const styles = this._showSkeleton ? {\n ...this.styles.root,\n ...this.styles.skeleton.root\n } : this.styles.root\n return (\n <View style={styles} testID={this.getTestId()}>{this.getBackground()}{props.children}</View>\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,iBAAiB,MAAM,oBAAoB;AAClD,SAASC,aAAa,QAA4B,qBAAqB;AAEvE,SAASC,cAAc,QAAQ,wEAAwE;AAEvG,OAAO,MAAMC,iBAAiB,SAASJ,kBAAkB,CAAoB;AAI7E,eAAe,MAAMK,YAAY,SAASN,aAAa,CAA2D;EAEhHO,WAAWA,CAACC,KAAwB,EAAE;IACpC,KAAK,CAACA,KAAK,EAAEL,aAAa,EAAE,IAAID,iBAAiB,CAAC,CAAC,CAAC;EACtD;EAEAO,aAAaA,CAAA,EAA6B;IACxC,OAAO,IAAI,CAACC,aAAa,GAAG,IAAI,GAAG,IAAI,CAACC,WAAW;EACrD;EAEOC,cAAcA,CAACJ,KAAwB,EAAmB;IAC/D,IAAG,CAACA,KAAK,CAACK,oBAAoB,EAAE;MAAA,IAAAC,WAAA;MAC9B,MAAMC,cAAgC,GAAG,EAAAD,WAAA,OAAI,CAACN,KAAK,cAAAM,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,OAAOf,cAAc,CAAC,IAAI,CAACgB,KAAK,EAAEL,cAAc,EAAE;QAChD,GAAG,IAAI,CAACC,MAAM,CAACE;MACjB,CAAC,eAAGpB,KAAA,CAAAuB,aAAA,CAACtB,IAAI;QAACuB,KAAK,EAAE,CAAC,IAAI,CAACN,MAAM,CAACE,IAAI,EAAE;UAAEK,OAAO,EAAE;QAAE,CAAC;MAAE,GACjDf,KAAK,CAACgB,QACH,CAAE,CAAC;IACX;IACA,OAAO,IAAI;EACb;EAGAC,YAAYA,CAACjB,KAAwB,EAAE;IACrC,MAAMQ,MAAM,GAAG,IAAI,CAACN,aAAa,GAAG;MAClC,GAAG,IAAI,CAACM,MAAM,CAACE,IAAI;MACnB,GAAG,IAAI,CAACF,MAAM,CAACC,QAAQ,CAACC;IAC1B,CAAC,GAAG,IAAI,CAACF,MAAM,CAACE,IAAI;IACpB,oBACEpB,KAAA,CAAAuB,aAAA,CAACtB,IAAI;MAACuB,KAAK,EAAEN,MAAO;MAACU,MAAM,EAAE,IAAI,CAACC,SAAS,CAAC;IAAE,GAAE,IAAI,CAAClB,aAAa,CAAC,CAAC,EAAED,KAAK,CAACgB,QAAe,CAAC;EAEhG;AACF","ignoreList":[]}
@@ -147,7 +147,8 @@ export default class WmPanel extends BaseComponent {
147
147
  ...this.styles.skeleton.root
148
148
  } : this.styles.root;
149
149
  return /*#__PURE__*/React.createElement(View, {
150
- style: styles
150
+ style: styles,
151
+ testID: this.getTestId()
151
152
  }, this.getBackground(), this.renderHeader(), this.renderPane( /*#__PURE__*/React.createElement(React.Fragment, null, this.renderContent(props), /*#__PURE__*/React.createElement(View, null, props.children))));
152
153
  }
153
154
  }
@@ -1 +1 @@
1
- {"version":3,"names":["React","Text","View","TouchableOpacity","isUndefined","Badge","BaseComponent","BaseComponentState","WmIcon","WmPanelProps","DEFAULT_CLASS","isWebPreviewMode","CollapsiblePane","createSkeleton","WmLabel","WmPanelState","constructor","args","_defineProperty","WmPanel","props","onPartialLoad","invokeEventCallback","renderContent","renderPartial","state","isPartialLoaded","setTimeout","updateState","bind","onPanelPress","collapsible","eventName","expanded","proxy","expandCollapseIcon","isExpanded","widgetProps","badge","badgevalue","undefined","createElement","_extends","style","styles","badgetype","getTestProps","iconclass","id","getTestId","name","toggleIcon","flexDirection","alignItems","renderHeader","getTestPropsForAction","header","onPress","accessibilityRole","iconurl","icon","iconheight","iconwidth","iconmargin","flex","justifyContent","_showSkeleton","showskeleton","root","text","heading","caption","title","subheading","renderPane","content","display","maxHeight","overflow","close","getBackground","_background","renderSkeleton","showskeletonchildren","_this$props","skeletonStyles","skeleton","theme","opacity","Fragment","children","renderWidget"],"sources":["panel.component.tsx"],"sourcesContent":["import React from 'react';\nimport { Text, View, TouchableOpacity } from 'react-native';\nimport { isUndefined } from 'lodash';\nimport { Badge } from 'react-native-paper';\nimport { BaseComponent, BaseComponentState } from '@wavemaker/app-rn-runtime/core/base.component';\nimport WmIcon from '@wavemaker/app-rn-runtime/components/basic/icon/icon.component';\n\nimport WmPanelProps from './panel.props';\nimport { DEFAULT_CLASS, WmPanelStyles } from './panel.styles';\nimport { isWebPreviewMode } from '@wavemaker/app-rn-runtime/core/utils';\nimport { CollapsiblePane } from './collapsible-pane.component';\nimport { WmSkeletonStyles } from '@wavemaker/app-rn-runtime/components/basic/skeleton/skeleton.styles';\nimport { createSkeleton } from '@wavemaker/app-rn-runtime/components/basic/skeleton/skeleton.component';\nimport WmLabel from '@wavemaker/app-rn-runtime/components/basic/label/label.component';\n\nexport class WmPanelState extends BaseComponentState<WmPanelProps> {\n isPartialLoaded = false;\n}\n\nexport default class WmPanel extends BaseComponent<WmPanelProps, WmPanelState, WmPanelStyles> {\n constructor(props: WmPanelProps) {\n super(props, DEFAULT_CLASS, new WmPanelProps());\n }\n\n onPartialLoad() {\n this.invokeEventCallback('onLoad', [this]);\n }\n\n renderContent(props: WmPanelProps) {\n if (props.renderPartial) {\n if (!this.state.isPartialLoaded) {\n setTimeout(() => {\n this.updateState({\n isPartialLoaded: true\n } as WmPanelState);\n });\n }\n return props.renderPartial(props, this.onPartialLoad.bind(this));\n }\n }\n\n onPanelPress() {\n if (!this.state.props.collapsible) {\n return;\n }\n const eventName = this.state.props.expanded ? 'onCollapse' : 'onExpand';\n this.updateState({\n props: {\n expanded: !this.state.props.expanded\n }\n } as WmPanelState);\n\n this.invokeEventCallback(eventName, [null, this.proxy]);\n }\n\n expandCollapseIcon(isExpanded: boolean) {\n const widgetProps = this.state.props;\n //@ts-ignore\n const badge = widgetProps.badgevalue != undefined ? (<Badge style={[this.styles.badge, this.styles[widgetProps.badgetype || 'default']]} {...this.getTestProps('badge')}>{widgetProps.badgevalue}</Badge>): null;\n const iconclass = isExpanded ? 'wi wi-chevron-up' : 'wi wi-chevron-down';\n const expandCollapseIcon = widgetProps.collapsible ? (<WmIcon id={this.getTestId('collapseicon')} name={'expand_collapse_icon'} styles={this.styles.toggleIcon} iconclass={iconclass}></WmIcon>) : null;\n return (<View style={{flexDirection: 'row', alignItems: 'center'}}>{badge}{expandCollapseIcon}</View>);\n }\n\n renderHeader() {\n const props = this.state.props;\n return (\n <TouchableOpacity\n {...this.getTestPropsForAction(`header`)}\n style={[this.styles.header]}\n onPress={this.onPanelPress.bind(this)}\n accessibilityRole='header'>\n {props.iconclass || props.iconurl ? \n <WmIcon styles={this.styles.icon}\n id={this.getTestId('icon')} \n name={props.name + '_icon'}\n iconclass={props.iconclass}\n iconheight={props.iconheight}\n iconwidth={props.iconwidth}\n iconmargin={props.iconmargin}\n iconurl={props.iconurl}\n /> : null}\n <View style={{flexDirection: 'column', flex: 1, justifyContent: 'center'}}>\n {\n this._showSkeleton ? \n <WmLabel \n showskeleton={true}\n styles={{root: [\n this.styles.text,\n this.styles.heading]}} caption={isUndefined(props.title) ? 'Title' : props.title}/> : \n <Text style={[\n this.styles.text,\n this.styles.heading]}\n {...this.getTestPropsForAction(`header_title`)}>\n {isUndefined(props.title) ? 'Title' : props.title}\n </Text>\n }\n {props.subheading ? \n (this._showSkeleton ? \n <WmLabel \n showskeleton={true} \n styles={{root: this.styles.subheading}} \n caption={props.subheading} /> :\n <Text \n style={this.styles.subheading}\n {...this.getTestPropsForAction(`subheader`)}>\n {props.subheading}\n </Text> ) : null }\n </View>\n {this.expandCollapseIcon(props.expanded)}\n </TouchableOpacity>\n );\n }\n\n renderPane(content: React.ReactNode) {\n const expanded = this.state.props.expanded;\n return isWebPreviewMode() || this.styles.header.display == \"none\" ? \n (<View style={expanded ? {} : {maxHeight: 0, overflow: 'hidden'}}>\n {content}\n </View>) :\n (<CollapsiblePane close={!expanded}>\n {content}\n </CollapsiblePane>);\n }\n\n protected getBackground(): React.JSX.Element | null {\n return this._showSkeleton ? null : this._background\n } \n \n public renderSkeleton(props: WmPanelProps): 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 {this.renderHeader()}\n {this.renderPane((\n <>\n {this.renderContent(props)}\n <View>{props.children}</View>\n </>\n ))}\n </View>))\n }\n return null;\n }\n\n renderWidget(props: WmPanelProps) {\n const styles = this._showSkeleton ? {\n ...this.styles.root,\n ...this.styles.skeleton.root\n } : this.styles.root\n return (<View style={styles}>\n {this.getBackground()}\n {this.renderHeader()}\n {this.renderPane((\n <>\n {this.renderContent(props)}\n <View>{props.children}</View>\n </>\n ))}\n </View>);\n }\n}\n"],"mappings":";;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,IAAI,EAAEC,IAAI,EAAEC,gBAAgB,QAAQ,cAAc;AAC3D,SAASC,WAAW,QAAQ,QAAQ;AACpC,SAASC,KAAK,QAAQ,oBAAoB;AAC1C,SAASC,aAAa,EAAEC,kBAAkB,QAAQ,+CAA+C;AACjG,OAAOC,MAAM,MAAM,gEAAgE;AAEnF,OAAOC,YAAY,MAAM,eAAe;AACxC,SAASC,aAAa,QAAuB,gBAAgB;AAC7D,SAASC,gBAAgB,QAAQ,sCAAsC;AACvE,SAASC,eAAe,QAAQ,8BAA8B;AAE9D,SAASC,cAAc,QAAQ,wEAAwE;AACvG,OAAOC,OAAO,MAAM,kEAAkE;AAEtF,OAAO,MAAMC,YAA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aAAA,CAAAzC,KAAA,CAAAyF,QAAA,QACC,IAAI,CAAClE,aAAa,CAACH,KAAK,CAAC,eAC1BpB,KAAA,CAAAyC,aAAA,CAACvC,IAAI,QAAEkB,KAAK,CAACsE,QAAe,CAC1B,CACH,CACG,CAAC;EACT;AACF","ignoreList":[]}
1
+ {"version":3,"names":["React","Text","View","TouchableOpacity","isUndefined","Badge","BaseComponent","BaseComponentState","WmIcon","WmPanelProps","DEFAULT_CLASS","isWebPreviewMode","CollapsiblePane","createSkeleton","WmLabel","WmPanelState","constructor","args","_defineProperty","WmPanel","props","onPartialLoad","invokeEventCallback","renderContent","renderPartial","state","isPartialLoaded","setTimeout","updateState","bind","onPanelPress","collapsible","eventName","expanded","proxy","expandCollapseIcon","isExpanded","widgetProps","badge","badgevalue","undefined","createElement","_extends","style","styles","badgetype","getTestProps","iconclass","id","getTestId","name","toggleIcon","flexDirection","alignItems","renderHeader","getTestPropsForAction","header","onPress","accessibilityRole","iconurl","icon","iconheight","iconwidth","iconmargin","flex","justifyContent","_showSkeleton","showskeleton","root","text","heading","caption","title","subheading","renderPane","content","display","maxHeight","overflow","close","getBackground","_background","renderSkeleton","showskeletonchildren","_this$props","skeletonStyles","skeleton","theme","opacity","Fragment","children","renderWidget","testID"],"sources":["panel.component.tsx"],"sourcesContent":["import React from 'react';\nimport { Text, View, TouchableOpacity } from 'react-native';\nimport { isUndefined } from 'lodash';\nimport { Badge } from 'react-native-paper';\nimport { BaseComponent, BaseComponentState } from '@wavemaker/app-rn-runtime/core/base.component';\nimport WmIcon from '@wavemaker/app-rn-runtime/components/basic/icon/icon.component';\n\nimport WmPanelProps from './panel.props';\nimport { DEFAULT_CLASS, WmPanelStyles } from './panel.styles';\nimport { isWebPreviewMode } from '@wavemaker/app-rn-runtime/core/utils';\nimport { CollapsiblePane } from './collapsible-pane.component';\nimport { WmSkeletonStyles } from '@wavemaker/app-rn-runtime/components/basic/skeleton/skeleton.styles';\nimport { createSkeleton } from '@wavemaker/app-rn-runtime/components/basic/skeleton/skeleton.component';\nimport WmLabel from '@wavemaker/app-rn-runtime/components/basic/label/label.component';\n\nexport class WmPanelState extends BaseComponentState<WmPanelProps> {\n isPartialLoaded = false;\n}\n\nexport default class WmPanel extends BaseComponent<WmPanelProps, WmPanelState, WmPanelStyles> {\n constructor(props: WmPanelProps) {\n super(props, DEFAULT_CLASS, new WmPanelProps());\n }\n\n onPartialLoad() {\n this.invokeEventCallback('onLoad', [this]);\n }\n\n renderContent(props: WmPanelProps) {\n if (props.renderPartial) {\n if (!this.state.isPartialLoaded) {\n setTimeout(() => {\n this.updateState({\n isPartialLoaded: true\n } as WmPanelState);\n });\n }\n return props.renderPartial(props, this.onPartialLoad.bind(this));\n }\n }\n\n onPanelPress() {\n if (!this.state.props.collapsible) {\n return;\n }\n const eventName = this.state.props.expanded ? 'onCollapse' : 'onExpand';\n this.updateState({\n props: {\n expanded: !this.state.props.expanded\n }\n } as WmPanelState);\n\n this.invokeEventCallback(eventName, [null, this.proxy]);\n }\n\n expandCollapseIcon(isExpanded: boolean) {\n const widgetProps = this.state.props;\n //@ts-ignore\n const badge = widgetProps.badgevalue != undefined ? (<Badge style={[this.styles.badge, this.styles[widgetProps.badgetype || 'default']]} {...this.getTestProps('badge')}>{widgetProps.badgevalue}</Badge>): null;\n const iconclass = isExpanded ? 'wi wi-chevron-up' : 'wi wi-chevron-down';\n const expandCollapseIcon = widgetProps.collapsible ? (<WmIcon id={this.getTestId('collapseicon')} name={'expand_collapse_icon'} styles={this.styles.toggleIcon} iconclass={iconclass}></WmIcon>) : null;\n return (<View style={{flexDirection: 'row', alignItems: 'center'}}>{badge}{expandCollapseIcon}</View>);\n }\n\n renderHeader() {\n const props = this.state.props;\n return (\n <TouchableOpacity\n {...this.getTestPropsForAction(`header`)}\n style={[this.styles.header]}\n onPress={this.onPanelPress.bind(this)}\n accessibilityRole='header'>\n {props.iconclass || props.iconurl ? \n <WmIcon styles={this.styles.icon}\n id={this.getTestId('icon')} \n name={props.name + '_icon'}\n iconclass={props.iconclass}\n iconheight={props.iconheight}\n iconwidth={props.iconwidth}\n iconmargin={props.iconmargin}\n iconurl={props.iconurl}\n /> : null}\n <View style={{flexDirection: 'column', flex: 1, justifyContent: 'center'}}>\n {\n this._showSkeleton ? \n <WmLabel \n showskeleton={true}\n styles={{root: [\n this.styles.text,\n this.styles.heading]}} caption={isUndefined(props.title) ? 'Title' : props.title}/> : \n <Text style={[\n this.styles.text,\n this.styles.heading]}\n {...this.getTestPropsForAction(`header_title`)}>\n {isUndefined(props.title) ? 'Title' : props.title}\n </Text>\n }\n {props.subheading ? \n (this._showSkeleton ? \n <WmLabel \n showskeleton={true} \n styles={{root: this.styles.subheading}} \n caption={props.subheading} /> :\n <Text \n style={this.styles.subheading}\n {...this.getTestPropsForAction(`subheader`)}>\n {props.subheading}\n </Text> ) : null }\n </View>\n {this.expandCollapseIcon(props.expanded)}\n </TouchableOpacity>\n );\n }\n\n renderPane(content: React.ReactNode) {\n const expanded = this.state.props.expanded;\n return isWebPreviewMode() || this.styles.header.display == \"none\" ? \n (<View style={expanded ? {} : {maxHeight: 0, overflow: 'hidden'}}>\n {content}\n </View>) :\n (<CollapsiblePane close={!expanded}>\n {content}\n </CollapsiblePane>);\n }\n\n protected getBackground(): React.JSX.Element | null {\n return this._showSkeleton ? null : this._background\n } \n \n public renderSkeleton(props: WmPanelProps): 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 {this.renderHeader()}\n {this.renderPane((\n <>\n {this.renderContent(props)}\n <View>{props.children}</View>\n </>\n ))}\n </View>))\n }\n return null;\n }\n\n renderWidget(props: WmPanelProps) {\n const styles = this._showSkeleton ? {\n ...this.styles.root,\n ...this.styles.skeleton.root\n } : this.styles.root\n return (<View style={styles} testID={this.getTestId()}>\n {this.getBackground()}\n {this.renderHeader()}\n {this.renderPane((\n <>\n {this.renderContent(props)}\n <View>{props.children}</View>\n </>\n ))}\n </View>);\n }\n}\n"],"mappings":";;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,IAAI,EAAEC,IAAI,EAAEC,gBAAgB,QAAQ,cAAc;AAC3D,SAASC,WAAW,QAAQ,QAAQ;AACpC,SAASC,KAAK,QAAQ,oBAAoB;AAC1C,SAASC,aAAa,EAAEC,kBAAkB,QAAQ,+CAA+C;AACjG,OAAOC,MAAM,MAAM,gEAAgE;AAEnF,OAAOC,YAAY,MAAM,eAAe;AACxC,SAASC,aAAa,QAAuB,gBAAgB;AAC7D,SAASC,gBAAgB,QAAQ,sCAAsC;AACvE,SAASC,eAAe,QAAQ,8BAA8B;AAE9D,SAASC,cAAc,QAAQ,wEAAwE;AACvG,OAAOC,OAAO,MAAM,kEAAkE;AAEtF,OAAO,MAAMC,YAAY,SAASR,kBAAkB,CAAe;EAAAS,YAAA,GAAAC,IAAA;IAAA,SAAAA,IAAA;IAAAC,eAAA,0BAC/C,KAAK;EAAA;AACzB;AAEA,eAAe,MAAMC,OAAO,SAASb,aAAa,CAA4C;EAC5FU,WAAWA,CAACI,KAAmB,EAAE;IAC/B,KAAK,CAACA,KAAK,EAAEV,aAAa,EAAE,IAAID,YAAY,CAAC,CAAC,CAAC;EACjD;EAEAY,aAAaA,CAAA,EAAG;IACd,IAAI,CAACC,mBAAmB,CAAC,QAAQ,EAAE,CAAC,IAAI,CAAC,CAAC;EAC5C;EAEAC,aAAaA,CAACH,KAAmB,EAAE;IACjC,IAAIA,KAAK,CAACI,aAAa,EAAE;MACvB,IAAI,CAAC,IAAI,CAACC,KAAK,CAACC,eAAe,EAAE;QAC/BC,UAAU,CAAC,MAAM;UACf,IAAI,CAACC,WAAW,CAAC;YACfF,eAAe,EAAE;UACnB,CAAiB,CAAC;QACpB,CAAC,CAAC;MACJ;MACA,OAAON,KAAK,CAACI,aAAa,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AClE,aAAa,CAACH,KAAK,CAAC,eAC1BpB,KAAA,CAAAyC,aAAA,CAACvC,IAAI,QAAEkB,KAAK,CAACsE,QAAe,CAC1B,CACH,CACH,CAAE,CAAC;IACX;IACA,OAAO,IAAI;EACb;EAEFC,YAAYA,CAACvE,KAAmB,EAAE;IAChC,MAAMwB,MAAM,GAAG,IAAI,CAACsB,aAAa,GAAG;MAClC,GAAG,IAAI,CAACtB,MAAM,CAACwB,IAAI;MACnB,GAAG,IAAI,CAACxB,MAAM,CAAC0C,QAAQ,CAAClB;IAC1B,CAAC,GAAG,IAAI,CAACxB,MAAM,CAACwB,IAAI;IACpB,oBAAQpE,KAAA,CAAAyC,aAAA,CAACvC,IAAI;MAACyC,KAAK,EAAEC,MAAO;MAACgD,MAAM,EAAE,IAAI,CAAC3C,SAAS,CAAC;IAAE,GACnD,IAAI,CAAC+B,aAAa,CAAC,CAAC,EACpB,IAAI,CAAC1B,YAAY,CAAC,CAAC,EACnB,IAAI,CAACoB,UAAU,eACd1E,KAAA,CAAAyC,aAAA,CAAAzC,KAAA,CAAAyF,QAAA,QACC,IAAI,CAAClE,aAAa,CAACH,KAAK,CAAC,eAC1BpB,KAAA,CAAAyC,aAAA,CAACvC,IAAI,QAAEkB,KAAK,CAACsE,QAAe,CAC1B,CACH,CACG,CAAC;EACT;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
  });
@@ -47,6 +48,12 @@ export default class WmTabpane extends BaseComponent {
47
48
  }
48
49
  super.componentDidMount();
49
50
  }
51
+ componentWillUnmount() {
52
+ const tabs = this.parent;
53
+ if (tabs.removeTabPane) {
54
+ tabs.removeTabPane(this);
55
+ }
56
+ }
50
57
  _onSelect() {
51
58
  this.updateState({
52
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 // 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 _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,QAAQ,EAAGC,KAAU,IAAK;MACvC,OAAO,IAAI,CAACC,KAAK,CAACC,QAAQ;IAC5B,CAAC,CAAC;EACJ;EAEAC,aAAaA,CAAA,EAAG;IACd,IAAI,CAACC,mBAAmB,CAAC,QAAQ,EAAE,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;EAClD;EAEAC,aAAaA,CAACP,KAAqB,EAAE;IACnC,IAAIA,KAAK,CAACQ,aAAa,EAAE;MACvB,IAAI,CAAC,IAAI,CA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AAK;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,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;IAACG,eAAA,iBAFlD,EAAE;IAGxB,IAAI,CAACG,S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mB,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":[]}
@@ -10,6 +10,7 @@ export default class WmTabpaneProps extends BaseProps {
10
10
  _defineProperty(this, "title", 'Tab Title');
11
11
  _defineProperty(this, "renderPartial", void 0);
12
12
  _defineProperty(this, "isPartialLoaded", false);
13
+ _defineProperty(this, "invokeVariables", true);
13
14
  }
14
15
  }
15
16
  //# sourceMappingURL=tabpane.props.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["BaseProps","WmTabpaneProps","constructor","args","_defineProperty"],"sources":["tabpane.props.ts"],"sourcesContent":["import { BaseProps } from '@wavemaker/app-rn-runtime/core/base.component';\n\nexport default class WmTabpaneProps extends BaseProps {\n children?: any;\n paneicon?: string = null as any;\n title: string = 'Tab Title';\n renderPartial?: Function;\n isPartialLoaded? = false;\n}\n"],"mappings":";;;AAAA,SAASA,SAAS,QAAQ,+CAA+C;AAEzE,eAAe,MAAMC,cAAc,SAASD,SAAS,CAAC;EAAAE,YAAA,GAAAC,IAAA;IAAA,SAAAA,IAAA;IAAAC,eAAA;IAAAA,eAAA,mBAEhC,IAAI;IAAAA,eAAA,gBACR,WAAW;IAAAA,eAAA;IAAAA,eAAA,0BAER,KAAK;EAAA;AAC1B","ignoreList":[]}
1
+ {"version":3,"names":["BaseProps","WmTabpaneProps","constructor","args","_defineProperty"],"sources":["tabpane.props.ts"],"sourcesContent":["import { BaseProps } from '@wavemaker/app-rn-runtime/core/base.component';\n\nexport default class WmTabpaneProps extends BaseProps {\n children?: any;\n paneicon?: string = null as any;\n title: string = 'Tab Title';\n renderPartial?: Function;\n isPartialLoaded? = false;\n invokeVariables = true;\n}\n"],"mappings":";;;AAAA,SAASA,SAAS,QAAQ,+CAA+C;AAEzE,eAAe,MAAMC,cAAc,SAASD,SAAS,CAAC;EAAAE,YAAA,GAAAC,IAAA;IAAA,SAAAA,IAAA;IAAAC,eAAA;IAAAA,eAAA,mBAEhC,IAAI;IAAAA,eAAA,gBACR,WAAW;IAAAA,eAAA;IAAAA,eAAA,0BAER,KAAK;IAAAA,eAAA,0BACN,IAAI;EAAA;AACxB","ignoreList":[]}
@@ -72,11 +72,19 @@ export default class WmTabs extends BaseComponent {
72
72
  }
73
73
  }
74
74
  addTabPane(tabPane) {
75
- 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);
76
77
  if (i >= 0) {
77
78
  this.tabPanes[i] = tabPane;
78
79
  } else {
79
- 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--;
80
88
  }
81
89
  }
82
90
  selectTabPane(tabPane) {
@@ -165,11 +173,13 @@ export default class WmTabs extends BaseComponent {
165
173
  alignSelf: 'flex-start'
166
174
  },
167
175
  onLayout: this.setTabPaneHeights.bind(this, i)
168
- }, p);
176
+ }, /*#__PURE__*/React.cloneElement(p, {
177
+ "invokeVariables": false
178
+ }));
169
179
  }))));
170
180
  }
171
181
  renderSkeleton(props) {
172
- if (!this.props.showskeletonchildren) {
182
+ if (!props.showskeletonchildren) {
173
183
  var _this$props;
174
184
  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) || {
175
185
  root: {},