@wavemaker/app-rn-runtime 11.6.0-next.24748 → 11.6.0-next.52051

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (151) hide show
  1. app-rn-runtime/components/advanced/carousel/carousel.component.js +9 -7
  2. app-rn-runtime/components/advanced/carousel/carousel.component.js.map +1 -1
  3. app-rn-runtime/components/advanced/webview/webview.component.js +27 -11
  4. app-rn-runtime/components/advanced/webview/webview.component.js.map +1 -1
  5. app-rn-runtime/components/advanced/webview/webview.props.js +0 -1
  6. app-rn-runtime/components/advanced/webview/webview.props.js.map +1 -1
  7. app-rn-runtime/components/basic/anchor/anchor.styles.js +0 -1
  8. app-rn-runtime/components/basic/anchor/anchor.styles.js.map +1 -1
  9. app-rn-runtime/components/basic/button/button.styles.js +4 -3
  10. app-rn-runtime/components/basic/button/button.styles.js.map +1 -1
  11. app-rn-runtime/components/basic/buttongroup/buttongroup.styles.js +5 -8
  12. app-rn-runtime/components/basic/buttongroup/buttongroup.styles.js.map +1 -1
  13. app-rn-runtime/components/basic/label/label.component.js +33 -26
  14. app-rn-runtime/components/basic/label/label.component.js.map +1 -1
  15. app-rn-runtime/components/basic/label/label.styles.js +2 -7
  16. app-rn-runtime/components/basic/label/label.styles.js.map +1 -1
  17. app-rn-runtime/components/basic/message/message.styles.js +1 -3
  18. app-rn-runtime/components/basic/message/message.styles.js.map +1 -1
  19. app-rn-runtime/components/basic/search/search.styles.js +4 -4
  20. app-rn-runtime/components/basic/search/search.styles.js.map +1 -1
  21. app-rn-runtime/components/chart/area-chart/area-chart.component.js +15 -20
  22. app-rn-runtime/components/chart/area-chart/area-chart.component.js.map +1 -1
  23. app-rn-runtime/components/chart/bar-chart/bar-chart.component.js +21 -20
  24. app-rn-runtime/components/chart/bar-chart/bar-chart.component.js.map +1 -1
  25. app-rn-runtime/components/chart/bar-chart/bar-chart.props.js +0 -2
  26. app-rn-runtime/components/chart/bar-chart/bar-chart.props.js.map +1 -1
  27. app-rn-runtime/components/chart/basechart.component.js +20 -20
  28. app-rn-runtime/components/chart/basechart.component.js.map +1 -1
  29. app-rn-runtime/components/chart/basechart.props.js +5 -4
  30. app-rn-runtime/components/chart/basechart.props.js.map +1 -1
  31. app-rn-runtime/components/chart/basechart.styles.js +8 -3
  32. app-rn-runtime/components/chart/basechart.styles.js.map +1 -1
  33. app-rn-runtime/components/chart/line-chart/line-chart.component.js +17 -20
  34. app-rn-runtime/components/chart/line-chart/line-chart.component.js.map +1 -1
  35. app-rn-runtime/components/chart/pie-chart/pie-chart.component.js +1 -1
  36. app-rn-runtime/components/chart/pie-chart/pie-chart.component.js.map +1 -1
  37. app-rn-runtime/components/chart/stack-chart/stack-chart.component.js +28 -7
  38. app-rn-runtime/components/chart/stack-chart/stack-chart.component.js.map +1 -1
  39. app-rn-runtime/components/chart/stack-chart/stack-chart.props.js +1 -0
  40. app-rn-runtime/components/chart/stack-chart/stack-chart.props.js.map +1 -1
  41. app-rn-runtime/components/container/container.component.js +11 -2
  42. app-rn-runtime/components/container/container.component.js.map +1 -1
  43. app-rn-runtime/components/container/container.props.js +1 -0
  44. app-rn-runtime/components/container/container.props.js.map +1 -1
  45. app-rn-runtime/components/container/tabs/tabheader/tabheader.styles.js +1 -1
  46. app-rn-runtime/components/container/tabs/tabheader/tabheader.styles.js.map +1 -1
  47. app-rn-runtime/components/container/wizard/wizard.component.js +14 -11
  48. app-rn-runtime/components/container/wizard/wizard.component.js.map +1 -1
  49. app-rn-runtime/components/container/wizard/wizard.styles.js +3 -19
  50. app-rn-runtime/components/container/wizard/wizard.styles.js.map +1 -1
  51. app-rn-runtime/components/container/wizard/wizardstep/wizardstep.component.js +21 -10
  52. app-rn-runtime/components/container/wizard/wizardstep/wizardstep.component.js.map +1 -1
  53. app-rn-runtime/components/container/wizard/wizardstep/wizardstep.props.js +3 -0
  54. app-rn-runtime/components/container/wizard/wizardstep/wizardstep.props.js.map +1 -1
  55. app-rn-runtime/components/data/list/list.component.js +57 -10
  56. app-rn-runtime/components/data/list/list.component.js.map +1 -1
  57. app-rn-runtime/components/device/barcodescanner/barcodescanner.styles.js +6 -13
  58. app-rn-runtime/components/device/barcodescanner/barcodescanner.styles.js.map +1 -1
  59. app-rn-runtime/components/device/camera/camera.styles.js +4 -11
  60. app-rn-runtime/components/device/camera/camera.styles.js.map +1 -1
  61. app-rn-runtime/components/dialogs/alertdialog/alertdialog.styles.js +1 -2
  62. app-rn-runtime/components/dialogs/alertdialog/alertdialog.styles.js.map +1 -1
  63. app-rn-runtime/components/input/basenumber/basenumber.component.js +12 -6
  64. app-rn-runtime/components/input/basenumber/basenumber.component.js.map +1 -1
  65. app-rn-runtime/components/input/composite/composite.component.js +1 -1
  66. app-rn-runtime/components/input/composite/composite.component.js.map +1 -1
  67. app-rn-runtime/components/input/composite/composite.props.js +1 -1
  68. app-rn-runtime/components/input/composite/composite.props.js.map +1 -1
  69. app-rn-runtime/components/input/currency/currency.component.js +17 -2
  70. app-rn-runtime/components/input/currency/currency.component.js.map +1 -1
  71. app-rn-runtime/components/input/currency/currency.props.js +1 -0
  72. app-rn-runtime/components/input/currency/currency.props.js.map +1 -1
  73. app-rn-runtime/components/input/currency/currency.styles.js +19 -1
  74. app-rn-runtime/components/input/currency/currency.styles.js.map +1 -1
  75. app-rn-runtime/components/input/epoch/base-datetime.component.js +13 -5
  76. app-rn-runtime/components/input/epoch/base-datetime.component.js.map +1 -1
  77. app-rn-runtime/components/input/epoch/date/date.component.js +8 -0
  78. app-rn-runtime/components/input/epoch/date/date.component.js.map +1 -1
  79. app-rn-runtime/components/input/epoch/date/date.styles.js +16 -0
  80. app-rn-runtime/components/input/epoch/date/date.styles.js.map +1 -1
  81. app-rn-runtime/components/input/epoch/datetime/datetime.component.js +8 -0
  82. app-rn-runtime/components/input/epoch/datetime/datetime.component.js.map +1 -1
  83. app-rn-runtime/components/input/epoch/datetime/datetime.props.js +1 -0
  84. app-rn-runtime/components/input/epoch/datetime/datetime.props.js.map +1 -1
  85. app-rn-runtime/components/input/epoch/datetime/datetime.styles.js +21 -1
  86. app-rn-runtime/components/input/epoch/datetime/datetime.styles.js.map +1 -1
  87. app-rn-runtime/components/input/epoch/time/time.component.js +8 -0
  88. app-rn-runtime/components/input/epoch/time/time.component.js.map +1 -1
  89. app-rn-runtime/components/input/epoch/time/time.styles.js +16 -0
  90. app-rn-runtime/components/input/epoch/time/time.styles.js.map +1 -1
  91. app-rn-runtime/components/input/fileupload/fileupload.styles.js +1 -1
  92. app-rn-runtime/components/input/fileupload/fileupload.styles.js.map +1 -1
  93. app-rn-runtime/components/input/number/number.component.js +11 -0
  94. app-rn-runtime/components/input/number/number.component.js.map +1 -1
  95. app-rn-runtime/components/input/number/number.props.js +1 -0
  96. app-rn-runtime/components/input/number/number.props.js.map +1 -1
  97. app-rn-runtime/components/input/number/number.styles.js +17 -0
  98. app-rn-runtime/components/input/number/number.styles.js.map +1 -1
  99. app-rn-runtime/components/input/select/select.styles.js +1 -5
  100. app-rn-runtime/components/input/select/select.styles.js.map +1 -1
  101. app-rn-runtime/components/input/switch/switch.component.js +3 -0
  102. app-rn-runtime/components/input/switch/switch.component.js.map +1 -1
  103. app-rn-runtime/components/input/switch/switch.styles.js +4 -8
  104. app-rn-runtime/components/input/switch/switch.styles.js.map +1 -1
  105. app-rn-runtime/components/input/text/text.component.js +11 -0
  106. app-rn-runtime/components/input/text/text.component.js.map +1 -1
  107. app-rn-runtime/components/input/text/text.props.js +1 -0
  108. app-rn-runtime/components/input/text/text.props.js.map +1 -1
  109. app-rn-runtime/components/input/text/text.styles.js +17 -0
  110. app-rn-runtime/components/input/text/text.styles.js.map +1 -1
  111. app-rn-runtime/components/input/textarea/textarea.component.js +11 -0
  112. app-rn-runtime/components/input/textarea/textarea.component.js.map +1 -1
  113. app-rn-runtime/components/input/textarea/textarea.props.js +1 -0
  114. app-rn-runtime/components/input/textarea/textarea.props.js.map +1 -1
  115. app-rn-runtime/components/input/textarea/textarea.styles.js +17 -0
  116. app-rn-runtime/components/input/textarea/textarea.styles.js.map +1 -1
  117. app-rn-runtime/components/input/toggle/toggle.component.js +2 -2
  118. app-rn-runtime/components/input/toggle/toggle.component.js.map +1 -1
  119. app-rn-runtime/components/navigation/basenav/basenav.component.js +2 -1
  120. app-rn-runtime/components/navigation/basenav/basenav.component.js.map +1 -1
  121. app-rn-runtime/components/navigation/menu/menu.styles.js +5 -8
  122. app-rn-runtime/components/navigation/menu/menu.styles.js.map +1 -1
  123. app-rn-runtime/components/navigation/popover/popover.styles.js +2 -8
  124. app-rn-runtime/components/navigation/popover/popover.styles.js.map +1 -1
  125. app-rn-runtime/components/page/tabbar/curve.js +84 -0
  126. app-rn-runtime/components/page/tabbar/curve.js.map +1 -0
  127. app-rn-runtime/components/page/tabbar/tabbar.component.js +41 -10
  128. app-rn-runtime/components/page/tabbar/tabbar.component.js.map +1 -1
  129. app-rn-runtime/components/page/tabbar/tabbar.styles.js +69 -29
  130. app-rn-runtime/components/page/tabbar/tabbar.styles.js.map +1 -1
  131. app-rn-runtime/core/base.component.js +5 -1
  132. app-rn-runtime/core/base.component.js.map +1 -1
  133. app-rn-runtime/core/components/floatinglabel.component.js +45 -0
  134. app-rn-runtime/core/components/floatinglabel.component.js.map +1 -0
  135. app-rn-runtime/core/components/textinput.component.js +25 -2
  136. app-rn-runtime/core/components/textinput.component.js.map +1 -1
  137. app-rn-runtime/core/tappable.component.js +31 -7
  138. app-rn-runtime/core/tappable.component.js.map +1 -1
  139. app-rn-runtime/package.json +5 -3
  140. app-rn-runtime/runtime/services/webprocess.service.js +0 -1
  141. app-rn-runtime/runtime/services/webprocess.service.js.map +1 -1
  142. app-rn-runtime/styles/theme.js +36 -0
  143. app-rn-runtime/styles/theme.js.map +1 -1
  144. app-rn-runtime/styles/theme.variables.js +7 -4
  145. app-rn-runtime/styles/theme.variables.js.map +1 -1
  146. app-rn-runtime/variables/model-variable.js +2 -1
  147. app-rn-runtime/variables/model-variable.js.map +1 -1
  148. app-rn-runtime/variables/service-variable.js +0 -1
  149. app-rn-runtime/variables/service-variable.js.map +1 -1
  150. app-rn-runtime/components/chart/staticdata.js +0 -215
  151. app-rn-runtime/components/chart/staticdata.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"names":["React","View","Text","Platform","Svg","VictoryLabel","VictoryPie","WmPieChartProps","DEFAULT_CLASS","formatCompactNumber","WmIcon","BaseChartComponent","BaseChartComponentState","WmDonutChartProps","Legend","WmPieChartState","constructor","arguments","_defineProperty","WmPieChart","props","type","e","_e$nativeEvent","viewWidth","nativeEvent","layout","width","updateState","chartWidth","totalHeight","height","_e$nativeEvent2","infoHeight","opacity","_e$nativeEvent3","_e$nativeEvent4","legendWidth","legendHeight","componentDidMount","getLabel","d","labeltype","Math","round","y","state","total","xaxisDatakeyArr","x","onSelect","event","data","value","slice","label","datum","selectedItem","dataset","index","selectedChartItem","color","style","fill","_dataObj","invokeEventCallback","proxy","renderWidget","length","pieData","showlegend","chartHeight","styles","root","radius","min","innerRadius","donutratio","styleProp","labelRadius","showlabels","labels","display","origin","orientation","legendData","map","name","colors","createElement","onLayout","onViewLayoutChange","onInfoViewLayoutChange","flexDirection","alignItems","iconclass","icon","title","subHeading","subheading","onLegendViewLayoutChange","testStyle","legendText","dotStyle","legenedDot","justifyContent","flex","standalone","colorScale","_ref","endAngle","theme","key","labelPlacement","labelplacement","events","target","eventHandlers","OS","onClick","bind","onPress","textAnchor","text","centerlabel","maxWidth"],"sources":["pie-chart.component.tsx"],"sourcesContent":["import React from 'react';\nimport { LayoutChangeEvent, View, Text, Platform } from 'react-native';\nimport { Svg } from 'react-native-svg';\n\nimport { VictoryLabel, VictoryLegend, VictoryPie } from 'victory-native';\n\nimport WmPieChartProps from './pie-chart.props';\nimport { DEFAULT_CLASS, WmPieChartStyles } from './pie-chart.styles';\n\nimport { formatCompactNumber } from '@wavemaker/app-rn-runtime/core/utils';\nimport WmIcon from '@wavemaker/app-rn-runtime/components/basic/icon/icon.component';\nimport {\n BaseChartComponent,\n BaseChartComponentState\n} from '@wavemaker/app-rn-runtime/components/chart/basechart.component';\nimport WmDonutChartProps from '@wavemaker/app-rn-runtime/components/chart/donut-chart/donut-chart.props';\nimport { Legend } from '../legend/legend.component';\n\n\nexport class WmPieChartState extends BaseChartComponentState<WmPieChartProps> {\n chartWidth = 0;\n totalHeight = 0;\n infoHeight = 10;\n legendWidth = 0;\n legendHeight = 0;\n opacity = 0;\n}\n\nexport default class WmPieChart extends BaseChartComponent<WmPieChartProps, WmPieChartState, WmPieChartStyles> {\n\n constructor(props: WmPieChartProps) {\n super(props, DEFAULT_CLASS, props.type === 'Donut' ? new WmDonutChartProps() : new WmPieChartProps(), new WmPieChartState());\n }\n\n componentDidMount() {\n super.componentDidMount();\n }\n\n onViewLayoutChange = (e: LayoutChangeEvent) => {\n let viewWidth = e.nativeEvent.layout.width;\n this.updateState({\n chartWidth: viewWidth,\n totalHeight: e.nativeEvent?.layout.height\n } as WmPieChartState)\n }\n\n onInfoViewLayoutChange = (e: LayoutChangeEvent) => {\n this.updateState({\n infoHeight: e.nativeEvent?.layout.height,\n opacity: 1\n } as WmPieChartState);\n }\n\n onLegendViewLayoutChange = (e: LayoutChangeEvent) => {\n this.updateState({\n legendWidth: e.nativeEvent?.layout.width,\n legendHeight: e.nativeEvent?.layout.height\n } as WmPieChartState);\n }\n\n getLabel(d: {x: any, y: any}, props: WmPieChartProps): string {\n switch(props.labeltype) {\n case 'percent': {\n return Math.round(d.y * 100 /this.state.total) + '%';\n }\n case 'key': {\n return this.state.xaxisDatakeyArr[d.x];\n }\n case 'value': {\n return formatCompactNumber(d.y);\n }\n case 'key-value': {\n return this.state.xaxisDatakeyArr[d.x] + ' ' + d.y;\n }\n }\n }\n\n onSelect(event: any, data: any){\n let value = data.slice.value;\n let label = this.state.xaxisDatakeyArr[data.datum.x];\n let selectedItem = this.props.dataset[data.index];\n let selectedChartItem = data.slice;\n selectedChartItem[\"data\"] = {x: label, y: value, color: data.style.fill, _dataObj: selectedItem}\n this.invokeEventCallback('onSelect', [event.nativeEvent, this.proxy, selectedItem, selectedChartItem ]);\n }\n\n renderWidget(props: WmPieChartProps) {\n this.invokeEventCallback('onBeforerender', [this.proxy, null]);\n if (!this.state.data.length) {\n return null;\n } \n const pieData = this.state.data[0];\n const chartWidth = this.state.chartWidth \n - (props.showlegend === 'right' ? this.state.legendWidth : 0);\n const chartHeight = (this.styles.root.height ? this.state.totalHeight : chartWidth) \n - this.state.infoHeight \n - (props.showlegend === 'right' ? 0 : this.state.legendHeight);\n let radius = (Math.min(chartWidth, chartHeight) - 40)/ 2;\n let innerRadius = props.donutratio * radius;\n let styleProp = {};\n let labelRadius;\n if (props.showlabels === 'hide') {\n styleProp={labels: { display: \"none\" }};\n } else if (props.showlabels === 'inside') {\n labelRadius = radius/2;\n } else {\n labelRadius = radius + 8;\n }\n const origin = {x: (chartWidth/2), y: (chartHeight/2)};\n const orientation = props.showlegend === 'right' ? 'vertical' : 'horizontal';\n let legendData = pieData.map((d: {x: any, y: any}, index: number) => {\n return {\n name: this.state.xaxisDatakeyArr[d.x],\n color: this.state.colors[index % (this.state.colors.length)]\n };\n });\n return (\n <View style={[{opacity: this.state.opacity}, this.styles.root]}\n onLayout={this.onViewLayoutChange}>\n <View onLayout={this.onInfoViewLayoutChange}>\n <View style={{flexDirection: 'row', alignItems: 'center'}}>\n {props.iconclass ? (<WmIcon iconclass={props.iconclass} styles={this.styles.icon}></WmIcon>) : null }\n <Text style={this.styles.title}>{props.title}</Text>\n </View>\n <Text style={this.styles.subHeading}>{props.subheading}</Text>\n </View>\n {props.showlegend === 'top' ? \n (<View onLayout={this.onLegendViewLayoutChange}>\n <Legend data={legendData}\n testStyle={this.styles.legendText}\n dotStyle={this.styles.legenedDot}></Legend>\n </View>) : null }\n <View style={{flexDirection: 'row', justifyContent: 'center', alignItems: 'center'}}>\n <View style={{flex: 1}}>\n {chartWidth ? (\n <Svg\n width={chartWidth}\n height={chartHeight}\n >\n <VictoryPie\n style={styleProp}\n standalone={false}\n colorScale={this.state.colors}\n labels={({datum}) => this.getLabel(datum, props)}\n endAngle={this.state.endAngle || 0}\n radius={radius}\n innerRadius={innerRadius}\n theme={this.state.theme}\n key={props.name}\n name={props.name}\n data={pieData}\n origin={origin}\n labelPlacement={props.labelplacement}\n labelRadius={labelRadius}\n events={[{\n target: 'data',\n eventHandlers: Platform.OS == \"web\" ? {\n onClick: this.onSelect.bind(this)\n }:{\n onPress: this.onSelect.bind(this)\n }\n }]}\n />\n <VictoryLabel\n textAnchor=\"middle\"\n style={this.styles.title as any}\n x={origin.x} y={origin.y}\n text={props.centerlabel}\n />\n </Svg>) : null}\n </View>\n {props.showlegend === 'right' ? \n (<View style={{maxWidth: '50%'}} onLayout={this.onLegendViewLayoutChange}>\n <Legend data={legendData}\n testStyle={this.styles.legendText}\n dotStyle={this.styles.legenedDot}\n orientation='vertical'></Legend>\n </View>) : null }\n </View>\n {props.showlegend === 'bottom' ? \n (<View onLayout={this.onLegendViewLayoutChange}>\n <Legend data={legendData}\n testStyle={this.styles.legendText}\n dotStyle={this.styles.legenedDot}></Legend>\n </View>) : null }\n </View>\n );\n }\n}\n"],"mappings":";;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAA4BC,IAAI,EAAEC,IAAI,EAAEC,QAAQ,QAAQ,cAAc;AACtE,SAASC,GAAG,QAAQ,kBAAkB;AAEtC,SAASC,YAAY,EAAiBC,UAAU,QAAQ,gBAAgB;AAExE,OAAOC,eAAe,MAAM,mBAAmB;AAC/C,SAASC,aAAa,QAA0B,oBAAoB;AAEpE,SAASC,mBAAmB,QAAQ,sCAAsC;AAC1E,OAAOC,MAAM,MAAM,gEAAgE;AACnF,SACEC,kBAAkB,EAClBC,uBAAuB,QAClB,gEAAgE;AACvE,OAAOC,iBAAiB,MAAM,0EAA0E;AACxG,SAASC,MAAM,QAAQ,4BAA4B;AAGnD,OAAO,MAAMC,eAAe,SAASH,uBAAuB,CAAkB;EAAAI,YAAA;IAAA,SAAAC,SAAA;IAAAC,e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,CAAAyF,aAAA,CAAC3E,MAAM;MAACsC,IAAI,EAAEiC,UAAW;MACvBgB,SAAS,EAAE,IAAI,CAAC7B,MAAM,CAAC8B,UAAW;MAClCC,QAAQ,EAAE,IAAI,CAAC/B,MAAM,CAACgC,UAAW;MACjCpB,WAAW,EAAC;IAAU,CAAS,CAC7B,CAAC,GAAI,IACT,CAAC,EACNhE,KAAK,CAACkD,UAAU,KAAK,QAAQ,gBAC3BtE,KAAA,CAAAyF,aAAA,CAACxF,IAAI;MAACyF,QAAQ,EAAE,IAAI,CAACU;IAAyB,gBAC7CpG,KAAA,CAAAyF,aAAA,CAAC3E,MAAM;MAACsC,IAAI,EAAEiC,UAAW;MACvBgB,SAAS,EAAE,IAAI,CAAC7B,MAAM,CAAC8B,UAAW;MAClCC,QAAQ,EAAE,IAAI,CAAC/B,MAAM,CAACgC;IAAW,CAAS,CACxC,CAAC,GAAI,IACT,CAAC;EAEX;AACF"}
1
+ {"version":3,"names":["React","View","Text","Platform","Svg","VictoryLabel","VictoryPie","WmPieChartProps","DEFAULT_CLASS","formatCompactNumber","WmIcon","BaseChartComponent","BaseChartComponentState","WmDonutChartProps","Legend","WmPieChartState","constructor","arguments","_defineProperty","WmPieChart","props","type","e","_e$nativeEvent","viewWidth","nativeEvent","layout","width","updateState","chartWidth","totalHeight","height","_e$nativeEvent2","infoHeight","opacity","_e$nativeEvent3","_e$nativeEvent4","legendWidth","legendHeight","componentDidMount","getLabel","d","labeltype","Math","round","y","state","total","xaxisDatakeyArr","x","onSelect","event","data","value","slice","label","datum","selectedItem","dataset","index","selectedChartItem","color","style","fill","_dataObj","invokeEventCallback","proxy","renderWidget","length","pieData","showlegend","chartHeight","styles","root","radius","min","innerRadius","donutratio","styleProp","labelRadius","showlabels","labels","display","origin","orientation","legendData","map","name","colors","createElement","onLayout","onViewLayoutChange","onInfoViewLayoutChange","flexDirection","alignItems","iconclass","icon","title","subHeading","subheading","onLegendViewLayoutChange","testStyle","legendText","dotStyle","legenedDot","justifyContent","flex","standalone","colorScale","_ref","endAngle","theme","key","isRTL","toReversed","labelPlacement","labelplacement","events","target","eventHandlers","OS","onClick","bind","onPress","textAnchor","text","centerlabel","maxWidth"],"sources":["pie-chart.component.tsx"],"sourcesContent":["import React from 'react';\nimport { LayoutChangeEvent, View, Text, Platform } from 'react-native';\nimport { Svg } from 'react-native-svg';\n\nimport { VictoryLabel, VictoryLegend, VictoryPie } from 'victory-native';\n\nimport WmPieChartProps from './pie-chart.props';\nimport { DEFAULT_CLASS, WmPieChartStyles } from './pie-chart.styles';\n\nimport { formatCompactNumber } from '@wavemaker/app-rn-runtime/core/utils';\nimport WmIcon from '@wavemaker/app-rn-runtime/components/basic/icon/icon.component';\nimport {\n BaseChartComponent,\n BaseChartComponentState\n} from '@wavemaker/app-rn-runtime/components/chart/basechart.component';\nimport WmDonutChartProps from '@wavemaker/app-rn-runtime/components/chart/donut-chart/donut-chart.props';\nimport { Legend } from '../legend/legend.component';\n\nexport class WmPieChartState extends BaseChartComponentState<WmPieChartProps> {\n chartWidth = 0;\n totalHeight = 0;\n infoHeight = 10;\n legendWidth = 0;\n legendHeight = 0;\n opacity = 0;\n}\n\nexport default class WmPieChart extends BaseChartComponent<WmPieChartProps, WmPieChartState, WmPieChartStyles> {\n\n constructor(props: WmPieChartProps) {\n super(props, DEFAULT_CLASS, props.type === 'Donut' ? new WmDonutChartProps() : new WmPieChartProps(), new WmPieChartState());\n }\n\n componentDidMount() {\n super.componentDidMount();\n }\n\n onViewLayoutChange = (e: LayoutChangeEvent) => {\n let viewWidth = e.nativeEvent.layout.width;\n this.updateState({\n chartWidth: viewWidth,\n totalHeight: e.nativeEvent?.layout.height\n } as WmPieChartState)\n }\n\n onInfoViewLayoutChange = (e: LayoutChangeEvent) => {\n this.updateState({\n infoHeight: e.nativeEvent?.layout.height,\n opacity: 1\n } as WmPieChartState);\n }\n\n onLegendViewLayoutChange = (e: LayoutChangeEvent) => {\n this.updateState({\n legendWidth: e.nativeEvent?.layout.width,\n legendHeight: e.nativeEvent?.layout.height\n } as WmPieChartState);\n }\n\n getLabel(d: {x: any, y: any}, props: WmPieChartProps): string {\n switch(props.labeltype) {\n case 'percent': {\n return Math.round(d.y * 100 /this.state.total) + '%';\n }\n case 'key': {\n return this.state.xaxisDatakeyArr[d.x];\n }\n case 'value': {\n return formatCompactNumber(d.y);\n }\n case 'key-value': {\n return this.state.xaxisDatakeyArr[d.x] + ' ' + d.y;\n }\n }\n }\n\n onSelect(event: any, data: any){\n let value = data.slice.value;\n let label = this.state.xaxisDatakeyArr[data.datum.x];\n let selectedItem = this.props.dataset[data.index];\n let selectedChartItem = data.slice;\n selectedChartItem[\"data\"] = {x: label, y: value, color: data.style.fill, _dataObj: selectedItem}\n this.invokeEventCallback('onSelect', [event.nativeEvent, this.proxy, selectedItem, selectedChartItem ]);\n }\n\n renderWidget(props: WmPieChartProps) {\n this.invokeEventCallback('onBeforerender', [this.proxy, null]);\n if (!this.state.data.length) {\n return null;\n }\n const pieData = this.state.data[0];\n const chartWidth = this.state.chartWidth \n - (props.showlegend === 'right' ? this.state.legendWidth : 0);\n const chartHeight = (this.styles.root.height ? this.state.totalHeight : chartWidth) \n - this.state.infoHeight \n - (props.showlegend === 'right' ? 0 : this.state.legendHeight);\n let radius = (Math.min(chartWidth, chartHeight) - 40)/ 2;\n let innerRadius = props.donutratio * radius;\n let styleProp = {};\n let labelRadius;\n if (props.showlabels === 'hide') {\n styleProp={labels: { display: \"none\" }};\n } else if (props.showlabels === 'inside') {\n labelRadius = radius/2;\n } else {\n labelRadius = radius + 8;\n }\n const origin = {x: (chartWidth/2), y: (chartHeight/2)};\n const orientation = props.showlegend === 'right' ? 'vertical' : 'horizontal';\n let legendData = pieData.map((d: {x: any, y: any}, index: number) => {\n return {\n name: this.state.xaxisDatakeyArr[d.x],\n color: this.state.colors[index % (this.state.colors.length)]\n };\n });\n return (\n <View style={[{opacity: this.state.opacity}, this.styles.root]}\n onLayout={this.onViewLayoutChange}>\n <View onLayout={this.onInfoViewLayoutChange}>\n <View style={{flexDirection: 'row', alignItems: 'center'}}>\n {props.iconclass ? (<WmIcon iconclass={props.iconclass} styles={this.styles.icon}></WmIcon>) : null }\n <Text style={this.styles.title}>{props.title}</Text>\n </View>\n <Text style={this.styles.subHeading}>{props.subheading}</Text>\n </View>\n {props.showlegend === 'top' ? \n (<View onLayout={this.onLegendViewLayoutChange}>\n <Legend data={legendData}\n testStyle={this.styles.legendText}\n dotStyle={this.styles.legenedDot}></Legend>\n </View>) : null }\n <View style={{flexDirection: 'row', justifyContent: 'center', alignItems: 'center'}}>\n <View style={{flex: 1}}>\n {chartWidth ? (\n <Svg\n width={chartWidth}\n height={chartHeight}\n >\n <VictoryPie\n style={styleProp}\n standalone={false}\n colorScale={this.state.colors}\n labels={({datum}) => this.getLabel(datum, props)}\n endAngle={this.state.endAngle || 0}\n radius={radius}\n innerRadius={innerRadius}\n theme={this.state.theme}\n key={props.name}\n name={props.name}\n data={this.isRTL?pieData.toReversed():pieData}\n origin={origin}\n labelPlacement={props.labelplacement}\n labelRadius={labelRadius}\n events={[{\n target: 'data',\n eventHandlers: Platform.OS == \"web\" ? {\n onClick: this.onSelect.bind(this)\n }:{\n onPress: this.onSelect.bind(this)\n }\n }]}\n />\n <VictoryLabel\n textAnchor=\"middle\"\n style={this.styles.title as any}\n x={origin.x} y={origin.y}\n text={props.centerlabel}\n />\n </Svg>) : null}\n </View>\n {props.showlegend === 'right' ? \n (<View style={{maxWidth: '50%'}} onLayout={this.onLegendViewLayoutChange}>\n <Legend data={legendData}\n testStyle={this.styles.legendText}\n dotStyle={this.styles.legenedDot}\n orientation='vertical'></Legend>\n </View>) : null }\n </View>\n {props.showlegend === 'bottom' ? \n (<View onLayout={this.onLegendViewLayoutChange}>\n <Legend data={legendData}\n testStyle={this.styles.legendText}\n dotStyle={this.styles.legenedDot}></Legend>\n </View>) : null }\n </View>\n );\n }\n}\n"],"mappings":";;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAA4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EAAE,IAAI,CAACzE,QAAQ,CAACwE,IAAI,CAAC,IAAI;QAClC;MACF,CAAC;IAAE,CACJ,CAAC,eACF1H,KAAA,CAAAyF,aAAA,CAACpF,YAAY;MACXuH,UAAU,EAAC,QAAQ;MACnB9D,KAAK,EAAE,IAAI,CAACU,MAAM,CAACyB,KAAa;MAChChD,CAAC,EAAEkC,MAAM,CAAClC,CAAE;MAACJ,CAAC,EAAEsC,MAAM,CAACtC,CAAE;MACzBgF,IAAI,EAAEzG,KAAK,CAAC0G;IAAY,CACzB,CACE,CAAC,GAAI,IACN,CAAC,EACN1G,KAAK,CAACkD,UAAU,KAAK,OAAO,gBAC1BtE,KAAA,CAAAyF,aAAA,CAACxF,IAAI;MAAC6D,KAAK,EAAE;QAACiE,QAAQ,EAAE;MAAK,CAAE;MAACrC,QAAQ,EAAE,IAAI,CAACU;IAAyB,gBACvEpG,KAAA,CAAAyF,aAAA,CAAC3E,MAAM;MAACsC,IAAI,EAAEiC,UAAW;MACvBgB,SAAS,EAAE,IAAI,CAAC7B,MAAM,CAAC8B,UAAW;MAClCC,QAAQ,EAAE,IAAI,CAAC/B,MAAM,CAACgC,UAAW;MACjCpB,WAAW,EAAC;IAAU,CAAS,CAC7B,CAAC,GAAI,IACT,CAAC,EACNhE,KAAK,CAACkD,UAAU,KAAK,QAAQ,gBAC3BtE,KAAA,CAAAyF,aAAA,CAACxF,IAAI;MAACyF,QAAQ,EAAE,IAAI,CAACU;IAAyB,gBAC7CpG,KAAA,CAAAyF,aAAA,CAAC3E,MAAM;MAACsC,IAAI,EAAEiC,UAAW;MACvBgB,SAAS,EAAE,IAAI,CAAC7B,MAAM,CAAC8B,UAAW;MAClCC,QAAQ,EAAE,IAAI,CAAC/B,MAAM,CAACgC;IAAW,CAAS,CACxC,CAAC,GAAI,IACT,CAAC;EAEX;AACF"}
@@ -6,7 +6,7 @@ import { View, Platform } from 'react-native';
6
6
  import { Svg } from 'react-native-svg';
7
7
  import { VictoryStack, VictoryBar, VictoryChart, VictoryPie, VictoryLegend, VictoryAxis } from 'victory-native';
8
8
  import { Axis, Scale } from 'victory-core';
9
- import { orderBy, cloneDeep } from 'lodash';
9
+ import { orderBy, cloneDeep, findIndex, isString } from 'lodash';
10
10
  import WmStackChartProps from './stack-chart.props';
11
11
  import { DEFAULT_CLASS } from './stack-chart.styles';
12
12
  import { BaseChartComponent, BaseChartComponentState } from '@wavemaker/app-rn-runtime/components/chart/basechart.component';
@@ -40,10 +40,30 @@ export default class WmStackChart extends BaseChartComponent {
40
40
  positiveValuesArray = orderBy(positiveValuesArray, 'y', 'asc');
41
41
  return positiveValuesArray;
42
42
  }
43
+ getData() {
44
+ const negativeValues = cloneDeep(this.getNegativeValuesArray());
45
+ return negativeValues.concat(cloneDeep(this.getPositiveValuesArray()));
46
+ }
47
+ updateColors() {
48
+ if (this.state.colors.length === 1) {
49
+ return this.state.colors[0];
50
+ } else {
51
+ let colorCodes = cloneDeep(this.state.colors);
52
+ ;
53
+ if (this.state.data.length > 0) {
54
+ const orderedData = this.getData();
55
+ this.state.data[0].map((d, i) => {
56
+ let index = findIndex(orderedData, d);
57
+ colorCodes[index] = this.state.colors[i];
58
+ });
59
+ return colorCodes;
60
+ }
61
+ }
62
+ }
43
63
  getBarChart(props) {
44
64
  if (this.state.data.length > 0) {
45
65
  const negativeValues = cloneDeep(this.getNegativeValuesArray());
46
- const data = negativeValues.concat(cloneDeep(this.getPositiveValuesArray()));
66
+ const data = this.getData();
47
67
  let currentValue = 0;
48
68
  return data.map((d, i) => {
49
69
  let d1 = [];
@@ -65,8 +85,8 @@ export default class WmStackChart extends BaseChartComponent {
65
85
  }
66
86
  }
67
87
  getColorCodes() {
68
- const colors = cloneDeep(this.state.colors);
69
- return colors.reverse();
88
+ const colors = cloneDeep(this.updateColors());
89
+ return isString(colors) ? [colors] : colors.reverse();
70
90
  }
71
91
  getArcChart(props) {
72
92
  if (this.state.data.length > 0) {
@@ -147,6 +167,8 @@ export default class WmStackChart extends BaseChartComponent {
147
167
  } else {
148
168
  ticks[0] = minValue;
149
169
  }
170
+ } else {
171
+ ticks[0] = this.state.props.minvalue;
150
172
  }
151
173
  }
152
174
  return ticks;
@@ -172,7 +194,6 @@ export default class WmStackChart extends BaseChartComponent {
172
194
  x: this.props.xdomain === 'Min' ? this.state.chartMinX : undefined,
173
195
  y: this.props.ydomain === 'Min' ? this.state.chartMinY : undefined
174
196
  };
175
- const colorScale = this.state.colors.length === 1 ? this.state.colors[0] : this.state.colors;
176
197
  return /*#__PURE__*/React.createElement(View, {
177
198
  style: this.styles.root,
178
199
  onLayout: this.onViewLayoutChange
@@ -202,7 +223,7 @@ export default class WmStackChart extends BaseChartComponent {
202
223
  gutter: 20,
203
224
  data: [],
204
225
  theme: this.state.theme
205
- }), this.getLegendView(colorScale), /*#__PURE__*/React.createElement(VictoryAxis, {
226
+ }), this.getLegendView(this.updateColors()), /*#__PURE__*/React.createElement(VictoryAxis, {
206
227
  crossAxis: true,
207
228
  style: {
208
229
  tickLabels: {
@@ -222,7 +243,7 @@ export default class WmStackChart extends BaseChartComponent {
222
243
  tickFormat: t => this.state.props.yunits ? `${this.abbreviateNumber(t)}${this.state.props.yunits}` : `${this.abbreviateNumber(t)}`,
223
244
  dependentAxis: true
224
245
  }), /*#__PURE__*/React.createElement(VictoryStack, {
225
- colorScale: colorScale,
246
+ colorScale: this.updateColors(),
226
247
  horizontal: true,
227
248
  style: {
228
249
  data: {
@@ -1 +1 @@
1
- {"version":3,"names":["React","View","Platform","Svg","VictoryStack","VictoryBar","VictoryChart","VictoryPie","VictoryLegend","VictoryAxis","Axis","Scale","orderBy","cloneDeep","WmStackChartProps","DEFAULT_CLASS","BaseChartComponent","BaseChartComponentState","WmStackChartState","constructor","arguments","_defineProperty","WmStackChart","props","e","viewWidth","nativeEvent","layout","width","updateState","chartWidth","componentDidMount","setHeightWidthOnChart","getNegativeValuesArray","negativeValuesArray","state","data","filter","d","y","getPositiveValuesArray","positiveValuesArray","getBarChart","length","negativeValues","concat","currentValue","map","i","d1","x","push","createElement","key","name","cornerRadius","bottomLeft","bottomRight","topLeft","topRight","getColorCodes","colors","reverse","getArcChart","colorScaleArray","maxValue","Math","max","o","radius","min","chartHeight","colorScale","startAngle","endAngle","standalone","origin","innerRadius","thickness","labels","getArcAxis","ticks","getTickValues","axisData","forEach","yunits","style","fontSize","paddingLeft","paddingRight","labelRadius","minValue","scale","getBaseScale","domain","getTicks","unshift","onSelect","event","value","index","label","xaxisDatakeyArr","datum","selectedItem","dataset","selectedChartItem","series","_dataObj","invokeEventCallback","proxy","renderWidget","mindomain","xdomain","chartMinX","undefined","ydomain","chartMinY","styles","root","onLayout","onViewLayoutChange","viewtype","theme","minDomain","height","screenWidth","padding","top","offsettop","bottom","offsetbottom","left","offsetleft","right","offsetright","containerComponent","getTooltip","title","fontFamily","subheading","orientation","gutter","getLegendView","crossAxis","tickLabels","fill","showyaxis","axisLabel","grid","stroke","tickValues","tickFormat","t","abbreviateNumber","dependentAxis","horizontal","strokeWidth","events","target","eventHandlers","OS","onClick","bind","onPress"],"sources":["stack-chart.component.tsx"],"sourcesContent":["import React from 'react';\nimport { LayoutChangeEvent, View, Platform } from 'react-native';\nimport { Svg } from 'react-native-svg';\nimport { VictoryStack, VictoryBar, VictoryChart, VictoryPie, VictoryLegend, VictoryAxis } from 'victory-native';\nimport { Axis, Scale } from 'victory-core';\nimport { orderBy, cloneDeep } from 'lodash';\n\nimport WmStackChartProps from './stack-chart.props';\nimport { DEFAULT_CLASS, WmStackChartStyles } from './stack-chart.styles';\nimport {\n BaseChartComponent,\n BaseChartComponentState\n} from '@wavemaker/app-rn-runtime/components/chart/basechart.component';\n\nexport class WmStackChartState extends BaseChartComponentState<WmStackChartProps> {\n chartWidth = 0;\n}\n\nexport default class WmStackChart extends BaseChartComponent<WmStackChartProps, WmStackChartState, WmStackChartStyles> {\n constructor(props: WmStackChartProps) {\n super(props, DEFAULT_CLASS, new WmStackChartProps(), new WmStackChartState());\n }\n\n componentDidMount() {\n super.componentDidMount();\n this.setHeightWidthOnChart();\n }\n\n getNegativeValuesArray() {\n let negativeValuesArray = cloneDeep(this.state.data[0]).filter((d: any) => d.y < 0);\n negativeValuesArray = orderBy(negativeValuesArray, 'y', 'desc');\n return negativeValuesArray;\n }\n\n getPositiveValuesArray() {\n let positiveValuesArray = cloneDeep(this.state.data[0]).filter((d: any) => d.y > 0);\n positiveValuesArray = orderBy(positiveValuesArray, 'y', 'asc');\n return positiveValuesArray;\n }\n\n getBarChart(props: WmStackChartProps) {\n if ( this.state.data.length > 0 ) {\n const negativeValues = cloneDeep(this.getNegativeValuesArray());\n const data = negativeValues.concat(cloneDeep(this.getPositiveValuesArray()));\n let currentValue = 0;\n\n return data.map((d: any, i: number) => {\n let d1: any = [];\n d.x = 0;\n d.y = d.y - currentValue;\n d1.push(d);\n currentValue = d.y < 0 && i === negativeValues.length -1 ? 0 : d.y + currentValue;\n return <VictoryBar key={props.name + '_' + i}\n cornerRadius={{bottomLeft:(1), bottomRight:(1), topLeft:(1), topRight:(1)}}\n data={d1}/>\n });\n }\n }\n\n private getColorCodes() {\n const colors = cloneDeep(this.state.colors);\n return colors.reverse();\n }\n\n getArcChart(props: WmStackChartProps) {\n if ( this.state.data.length > 0 ) {\n let data = cloneDeep(this.state.data[0]);\n const colorScaleArray = this.getColorCodes();\n const maxValue = Math.max(...data.map((o: any) => o.y));\n data = orderBy(data, 'y', 'desc');\n const radius = Math.min(this.state.chartWidth/2, this.state.chartHeight - 50);\n return data.map((d: any, i: number) => {\n let d1: any = [];\n d1.push(d);\n d1.push({x: d.x, y: maxValue - d.y})\n return <VictoryPie key={props.name + '_' + i}\n radius={radius}\n colorScale={[colorScaleArray[i], '#fff0']}\n startAngle={-80}\n endAngle={80}\n cornerRadius={100}\n standalone={false}\n origin={{x: (this.state.chartWidth/2), y: (this.state.chartHeight - 50)}}\n innerRadius={radius - this.state.props.thickness}\n labels={[]}\n data={d1}/>\n });\n }\n }\n\n getArcAxis() {\n const ticks = this.getTickValues();\n const radius = Math.min(this.state.chartWidth/2, this.state.chartHeight-50);\n const axisData: any = [];\n ticks.forEach((d: any, i: any) => {\n axisData.push({x: `${this.state.props.yunits}${d}`, y: 1})\n });\n return <VictoryPie\n style={{\n labels: {\n fontSize: 12, paddingLeft: 50, paddingRight: 80\n }}\n }\n startAngle={-90}\n endAngle={90}\n standalone={false}\n colorScale={['#fff0']}\n origin={{x: (this.state.chartWidth/2 - 5), y: (this.state.chartHeight - 50)}}\n labelRadius={radius - this.state.props.thickness - 20}\n data={axisData}\n />\n }\n\n onViewLayoutChange = (e: LayoutChangeEvent) => {\n let viewWidth = e.nativeEvent.layout.width;\n this.updateState({\n chartWidth: viewWidth\n } as WmStackChartState);\n }\n\n getTickValues() {\n let ticks: any = [];\n if (this.state.data[0].length) {\n let data = cloneDeep(this.state.data[0]);\n const maxValue = Math.max(...data.map((o: any) => o.y));\n const minValue = Math.min(...data.map((o: any) => o.y));\n const scale = Scale.getBaseScale({}, 'x');\n scale.domain([minValue > 0 ? 0 : minValue, maxValue]);\n ticks = Axis.getTicks({}, scale);\n ticks[ticks.length -1] = maxValue;\n if ( minValue < 0 ) {\n if (ticks[0] === 0) {\n ticks.unshift(minValue);\n } else {\n ticks[0] = minValue;\n }\n }\n }\n return ticks;\n }\n\n onSelect(event: any, data: any){\n let value = data.data[data.index].y;\n let label = this.state.xaxisDatakeyArr[data.datum.x];\n let selectedItem = this.props.dataset[data.index];\n let selectedChartItem = [{series: 0, x: data.index, y: value,_dataObj: selectedItem},data.index];\n this.invokeEventCallback('onSelect', [event.nativeEvent, this.proxy, selectedItem, selectedChartItem ]);\n }\n\n renderWidget(props: WmStackChartProps) {\n this.invokeEventCallback('onBeforerender', [this.proxy, null]);\n if (!this.state.data.length) {\n return null;\n }\n let mindomain={x: this.props.xdomain === 'Min' ? this.state.chartMinX: undefined, y: this.props.ydomain === 'Min' ? this.state.chartMinY: undefined};\n const colorScale = this.state.colors.length === 1 ? this.state.colors[0] : this.state.colors;\n return (\n <View\n style={this.styles.root} onLayout={this.onViewLayoutChange}\n >{\n props.viewtype === 'Bar' ?\n <VictoryChart\n theme={this.state.theme}\n minDomain={mindomain}\n height={this.styles.root.height as number}\n width={this.styles.root.width as number || this.screenWidth}\n padding={{\n top: props.offsettop,\n bottom: props.offsetbottom,\n left: props.offsetleft,\n right: props.offsetright\n }}\n containerComponent={\n this.getTooltip(props)\n }\n >\n <VictoryLegend\n name={'legend'}\n containerComponent={<Svg />}\n style={{title: {\n fontFamily: \"'Helvetica Neue', 'Helvetica', sans-serif\",\n fontSize: 18\n }\n }}\n title={[props.title, props.subheading]}\n orientation=\"horizontal\"\n gutter={20}\n data={[]}\n theme={this.state.theme}\n />\n {this.getLegendView(colorScale)}\n <VictoryAxis crossAxis\n style={{\n tickLabels: { fill: this.state.props.showyaxis === false ? 'transparent' : '#000000', fontSize: 12, padding: this.state.props.thickness/2 + 5},\n axisLabel: { padding: (15 + this.state.props.thickness/2) },\n grid: {stroke: 'none'}\n }}\n theme={this.state.theme}\n tickValues={this.getTickValues()}\n tickFormat={(t) => this.state.props.yunits ? `${this.abbreviateNumber(t)}${this.state.props.yunits}` : `${this.abbreviateNumber(t)}`} dependentAxis />\n <VictoryStack\n colorScale={colorScale}\n horizontal={true}\n style={{\n data: { strokeWidth: this.state.props.thickness }\n }}\n events={[{\n target: 'data',\n eventHandlers: Platform.OS == \"web\" ? {\n onClick: this.onSelect.bind(this)\n }:{\n onPress: this.onSelect.bind(this)\n }\n }]}\n >\n {\n this.getBarChart(props)\n }\n </VictoryStack>\n </VictoryChart> :\n <Svg width={this.state.chartWidth} height={this.state.chartHeight}>\n <VictoryLegend\n name={'legend'}\n containerComponent={<Svg />}\n title={[props.title, props.subheading]}\n orientation=\"horizontal\"\n gutter={20}\n data={[]}\n theme={this.state.theme}\n />\n {this.getArcChart(props)}\n {this.getArcAxis()}\n </Svg>\n }\n </View>\n );\n }\n}\n"],"mappings":";;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAA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xC,KAAK,CAAC,EACvB,IAAI,CAACyD,UAAU,CAAC,CACd,CAEH,CAAC;EAEX;AACF"}
1
+ {"version":3,"names":["React","View","Platform","Svg","VictoryStack","VictoryBar","VictoryChart","VictoryPie","VictoryLegend","VictoryAxis","Axis","Scale","orderBy","cloneDeep","findIndex","isString","WmStackChartProps","DEFAULT_CLASS","BaseChartComponent","BaseChartComponentState","WmStackChartState","constructor","arguments","_defineProperty","WmStackChart","props","e","viewWidth","nativeEvent","layout","width","updateState","chartWidth","componentDidMount","setHeightWidthOnChart","getNegativeValuesArray","negativeValuesArray","state","data","filter","d","y","getPositiveValuesArray","positiveValuesArray","getData","negativeValues","concat","updateColors","colors","length","colorCodes","orderedData","map","i","index","getBarChart","currentValue","d1","x","push","createElement","key","name","cornerRadius","bottomLeft","bottomRight","topLeft","topRight","getColorCodes","reverse","getArcChart","colorScaleArray","maxValue","Math","max","o","radius","min","chartHeight","colorScale","startAngle","endAngle","standalone","origin","innerRadius","thickness","labels","getArcAxis","ticks","getTickValues","axisData","forEach","yunits","style","fontSize","paddingLeft","paddingRight","labelRadius","minValue","scale","getBaseScale","domain","getTicks","unshift","minvalue","onSelect","event","value","label","xaxisDatakeyArr","datum","selectedItem","dataset","selectedChartItem","series","_dataObj","invokeEventCallback","proxy","renderWidget","mindomain","xdomain","chartMinX","undefined","ydomain","chartMinY","styles","root","onLayout","onViewLayoutChange","viewtype","theme","minDomain","height","screenWidth","padding","top","offsettop","bottom","offsetbottom","left","offsetleft","right","offsetright","containerComponent","getTooltip","title","fontFamily","subheading","orientation","gutter","getLegendView","crossAxis","tickLabels","fill","showyaxis","axisLabel","grid","stroke","tickValues","tickFormat","t","abbreviateNumber","dependentAxis","horizontal","strokeWidth","events","target","eventHandlers","OS","onClick","bind","onPress"],"sources":["stack-chart.component.tsx"],"sourcesContent":["import React from 'react';\nimport { LayoutChangeEvent, View, Platform } from 'react-native';\nimport { Svg } from 'react-native-svg';\nimport { VictoryStack, VictoryBar, VictoryChart, VictoryPie, VictoryLegend, VictoryAxis } from 'victory-native';\nimport { Axis, Scale } from 'victory-core';\nimport { orderBy, cloneDeep, findIndex, isString} from 'lodash';\n\nimport WmStackChartProps from './stack-chart.props';\nimport { DEFAULT_CLASS, WmStackChartStyles } from './stack-chart.styles';\nimport {\n BaseChartComponent,\n BaseChartComponentState\n} from '@wavemaker/app-rn-runtime/components/chart/basechart.component';\n\nexport class WmStackChartState extends BaseChartComponentState<WmStackChartProps> {\n chartWidth = 0;\n}\n\nexport default class WmStackChart extends BaseChartComponent<WmStackChartProps, WmStackChartState, WmStackChartStyles> {\n constructor(props: WmStackChartProps) {\n super(props, DEFAULT_CLASS, new WmStackChartProps(), new WmStackChartState());\n }\n\n componentDidMount() {\n super.componentDidMount();\n this.setHeightWidthOnChart();\n }\n\n getNegativeValuesArray() {\n let negativeValuesArray = cloneDeep(this.state.data[0]).filter((d: any) => d.y < 0);\n negativeValuesArray = orderBy(negativeValuesArray, 'y', 'desc');\n return negativeValuesArray;\n }\n\n getPositiveValuesArray() {\n let positiveValuesArray = cloneDeep(this.state.data[0]).filter((d: any) => d.y > 0);\n positiveValuesArray = orderBy(positiveValuesArray, 'y', 'asc');\n return positiveValuesArray;\n }\n\n getData() {\n const negativeValues = cloneDeep(this.getNegativeValuesArray());\n return negativeValues.concat(cloneDeep(this.getPositiveValuesArray()));\n }\n\n updateColors() {\n if (this.state.colors.length === 1 ) {\n return this.state.colors[0];\n } else {\n let colorCodes = cloneDeep(this.state.colors);;\n if ( this.state.data.length > 0 ) {\n const orderedData = this.getData();\n this.state.data[0].map((d: any, i: number) => {\n let index = findIndex(orderedData, d);\n colorCodes[index] = this.state.colors[i];\n })\n return colorCodes;\n }\n }\n }\n\n getBarChart(props: WmStackChartProps) {\n if ( this.state.data.length > 0 ) {\n const negativeValues = cloneDeep(this.getNegativeValuesArray());\n const data = this.getData();\n let currentValue = 0;\n\n return data.map((d: any, i: number) => {\n let d1: any = [];\n d.x = 0;\n d.y = d.y - currentValue;\n d1.push(d);\n currentValue = d.y < 0 && i === negativeValues.length -1 ? 0 : d.y + currentValue;\n return <VictoryBar key={props.name + '_' + i}\n cornerRadius={{bottomLeft:(1), bottomRight:(1), topLeft:(1), topRight:(1)}}\n data={d1}/>\n });\n }\n }\n\n private getColorCodes() {\n const colors = cloneDeep(this.updateColors());\n return isString(colors) ? [colors] : colors.reverse();\n }\n\n getArcChart(props: WmStackChartProps) {\n if ( this.state.data.length > 0 ) {\n let data = cloneDeep(this.state.data[0]);\n const colorScaleArray = this.getColorCodes();\n const maxValue = Math.max(...data.map((o: any) => o.y));\n data = orderBy(data, 'y', 'desc');\n const radius = Math.min(this.state.chartWidth/2, this.state.chartHeight - 50);\n return data.map((d: any, i: number) => {\n let d1: any = [];\n d1.push(d);\n d1.push({x: d.x, y: maxValue - d.y})\n return <VictoryPie key={props.name + '_' + i}\n radius={radius}\n colorScale={[colorScaleArray[i], '#fff0']}\n startAngle={-80}\n endAngle={80}\n cornerRadius={100}\n standalone={false}\n origin={{x: (this.state.chartWidth/2), y: (this.state.chartHeight - 50)}}\n innerRadius={radius - this.state.props.thickness}\n labels={[]}\n data={d1}/>\n });\n }\n }\n\n getArcAxis() {\n const ticks = this.getTickValues();\n const radius = Math.min(this.state.chartWidth/2, this.state.chartHeight-50);\n const axisData: any = [];\n ticks.forEach((d: any, i: any) => {\n axisData.push({x: `${this.state.props.yunits}${d}`, y: 1})\n });\n return <VictoryPie\n style={{\n labels: {\n fontSize: 12, paddingLeft: 50, paddingRight: 80\n }}\n }\n startAngle={-90}\n endAngle={90}\n standalone={false}\n colorScale={['#fff0']}\n origin={{x: (this.state.chartWidth/2 - 5), y: (this.state.chartHeight - 50)}}\n labelRadius={radius - this.state.props.thickness - 20}\n data={axisData}\n />\n }\n\n onViewLayoutChange = (e: LayoutChangeEvent) => {\n let viewWidth = e.nativeEvent.layout.width;\n this.updateState({\n chartWidth: viewWidth\n } as WmStackChartState);\n }\n\n getTickValues() {\n let ticks: any = [];\n if (this.state.data[0].length) {\n let data = cloneDeep(this.state.data[0]);\n const maxValue = Math.max(...data.map((o: any) => o.y));\n const minValue = Math.min(...data.map((o: any) => o.y));\n const scale = Scale.getBaseScale({}, 'x');\n scale.domain([minValue > 0 ? 0 : minValue, maxValue]);\n ticks = Axis.getTicks({}, scale);\n ticks[ticks.length -1] = maxValue;\n if ( minValue < 0 ) {\n if (ticks[0] === 0) {\n ticks.unshift(minValue);\n } else {\n ticks[0] = minValue;\n }\n } else {\n ticks[0] = this.state.props.minvalue;\n }\n }\n return ticks;\n }\n\n onSelect(event: any, data: any){\n let value = data.data[data.index].y;\n let label = this.state.xaxisDatakeyArr[data.datum.x];\n let selectedItem = this.props.dataset[data.index];\n let selectedChartItem = [{series: 0, x: data.index, y: value,_dataObj: selectedItem},data.index];\n this.invokeEventCallback('onSelect', [event.nativeEvent, this.proxy, selectedItem, selectedChartItem ]);\n }\n\n renderWidget(props: WmStackChartProps) {\n this.invokeEventCallback('onBeforerender', [this.proxy, null]);\n if (!this.state.data.length) {\n return null;\n }\n let mindomain={x: this.props.xdomain === 'Min' ? this.state.chartMinX: undefined, y: this.props.ydomain === 'Min' ? this.state.chartMinY: undefined};\n return (\n <View\n style={this.styles.root} onLayout={this.onViewLayoutChange}\n >{\n props.viewtype === 'Bar' ?\n <VictoryChart\n theme={this.state.theme}\n minDomain={mindomain}\n height={this.styles.root.height as number}\n width={this.styles.root.width as number || this.screenWidth}\n padding={{\n top: props.offsettop,\n bottom: props.offsetbottom,\n left: props.offsetleft,\n right: props.offsetright\n }}\n containerComponent={\n this.getTooltip(props)\n }\n >\n <VictoryLegend\n name={'legend'}\n containerComponent={<Svg />}\n style={{title: {\n fontFamily: \"'Helvetica Neue', 'Helvetica', sans-serif\",\n fontSize: 18\n }\n }}\n title={[props.title, props.subheading]}\n orientation=\"horizontal\"\n gutter={20}\n data={[]}\n theme={this.state.theme}\n />\n {this.getLegendView(this.updateColors())}\n <VictoryAxis crossAxis\n style={{\n tickLabels: { fill: this.state.props.showyaxis === false ? 'transparent' : '#000000', fontSize: 12, padding: this.state.props.thickness/2 + 5},\n axisLabel: { padding: (15 + this.state.props.thickness/2) },\n grid: {stroke: 'none'}\n }}\n theme={this.state.theme}\n tickValues={this.getTickValues()}\n tickFormat={(t) => this.state.props.yunits ? `${this.abbreviateNumber(t)}${this.state.props.yunits}` : `${this.abbreviateNumber(t)}`} dependentAxis />\n <VictoryStack\n colorScale={this.updateColors()}\n horizontal={true}\n style={{\n data: { strokeWidth: this.state.props.thickness }\n }}\n events={[{\n target: 'data',\n eventHandlers: Platform.OS == \"web\" ? {\n onClick: this.onSelect.bind(this)\n }:{\n onPress: this.onSelect.bind(this)\n }\n }]}\n >\n {\n this.getBarChart(props)\n }\n </VictoryStack>\n </VictoryChart> :\n <Svg width={this.state.chartWidth} height={this.state.chartHeight}>\n <VictoryLegend\n name={'legend'}\n containerComponent={<Svg />}\n title={[props.title, props.subheading]}\n orientation=\"horizontal\"\n gutter={20}\n data={[]}\n theme={this.state.theme}\n />\n {this.getArcChart(props)}\n {this.getArcAxis()}\n </Svg>\n }\n </View>\n );\n }\n}\n"],"mappings":";;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAA4BC,IAAI,EAAEC,QAAQ,QAAQ,cAAc;AAChE,SAASC,GAAG,QAAQ,kBAAkB;AACtC,SAASC,YAAY,EAAEC,UAAU,EAAEC,YAAY,EAAEC,UAAU,EAAEC,aAAa,EAAEC,WAAW,QAAQ,gBAAgB;AAC/G,SAASC,IAAI,EAAEC,KAAK,QAAQ,cAAc;AAC1C,SAASC,OAAO,EAAEC,SAAS,EAAEC,SAAS,EAAEC,QAAQ,QAAO,QAAQ;AAE/D,OAAOC,iBAAiB,MAAM,qBAAqB;AACnD,SAASC,aAAa,QAA4B,sBAAsB;AACxE,SACEC,kBAAkB,EAClBC,uBAAuB,QAClB,gEAAgE;AAEvE,OAAO,MAAMC,iBAAiB,SAASD,uBAAuB,CAAoB;EAAAE,YAAA;IAAA,SAAAC,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C/F,KAAK,CAACyC;IAAY,gBAChE9E,KAAA,CAAA4D,aAAA,CAACpD,aAAa;MACZsD,IAAI,EAAE,QAAS;MACfiF,kBAAkB,eAAE/I,KAAA,CAAA4D,aAAA,CAACzD,GAAG,MAAE,CAAE;MAC5B8I,KAAK,EAAE,CAACxH,KAAK,CAACwH,KAAK,EAAExH,KAAK,CAAC0H,UAAU,CAAE;MACvCC,WAAW,EAAC,YAAY;MACxBC,MAAM,EAAE,EAAG;MACX/G,IAAI,EAAE,EAAG;MACT4F,KAAK,EAAE,IAAI,CAAC7F,KAAK,CAAC6F;IAAM,CACzB,CAAC,EACD,IAAI,CAAC5D,WAAW,CAAC7C,KAAK,CAAC,EACvB,IAAI,CAAC8D,UAAU,CAAC,CACd,CAEH,CAAC;EAEX;AACF"}
@@ -11,6 +11,7 @@ export default class WmStackChartProps extends BaseChartComponentProps {
11
11
  _defineProperty(this, "offsetleft", 25);
12
12
  _defineProperty(this, "offsetright", 35);
13
13
  _defineProperty(this, "onSelect", void 0);
14
+ _defineProperty(this, "minvalue", 0);
14
15
  }
15
16
  }
16
17
  //# sourceMappingURL=stack-chart.props.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["BaseChartComponentProps","WmStackChartProps","constructor","arguments","_defineProperty"],"sources":["stack-chart.props.ts"],"sourcesContent":["import BaseChartComponentProps from '@wavemaker/app-rn-runtime/components/chart/basechart.props';\n\nexport default class WmStackChartProps extends BaseChartComponentProps {\n viewtype: string = 'Bar';\n showlegend: string = 'left';\n thickness: number = 20;\n offsetleft: number = 25;\n offsetright: number = 35;\n onSelect?: any;\n}\n"],"mappings":";;;AAAA,OAAOA,uBAAuB,MAAM,4DAA4D;AAEhG,eAAe,MAAMC,iBAAiB,SAASD,uBAAuB,CAAC;EAAAE,YAAA;IAAA,SAAAC,SAAA;IAAAC,eAAA,mBAClD,KAAK;IAAAA,eAAA,qBACH,MAAM;IAAAA,eAAA,oBACP,EAAE;IAAAA,eAAA,qBACD,EAAE;IAAAA,eAAA,sBACD,EAAE;IAAAA,eAAA;EAAA;AAE1B"}
1
+ {"version":3,"names":["BaseChartComponentProps","WmStackChartProps","constructor","arguments","_defineProperty"],"sources":["stack-chart.props.ts"],"sourcesContent":["import BaseChartComponentProps from '@wavemaker/app-rn-runtime/components/chart/basechart.props';\n\nexport default class WmStackChartProps extends BaseChartComponentProps {\n viewtype: string = 'Bar';\n showlegend: string = 'left';\n thickness: number = 20;\n offsetleft: number = 25;\n offsetright: number = 35;\n onSelect?: any;\n minvalue: number = 0;\n}\n"],"mappings":";;;AAAA,OAAOA,uBAAuB,MAAM,4DAA4D;AAEhG,eAAe,MAAMC,iBAAiB,SAASD,uBAAuB,CAAC;EAAAE,YAAA;IAAA,SAAAC,SAAA;IAAAC,eAAA,mBAClD,KAAK;IAAAA,eAAA,qBACH,MAAM;IAAAA,eAAA,oBACP,EAAE;IAAAA,eAAA,qBACD,EAAE;IAAAA,eAAA,sBACD,EAAE;IAAAA,eAAA;IAAAA,eAAA,mBAEL,CAAC;EAAA;AACtB"}
@@ -13,18 +13,27 @@ export class WmContainerState extends PartialHostState {
13
13
  constructor() {
14
14
  super(...arguments);
15
15
  _defineProperty(this, "isPartialLoaded", false);
16
+ _defineProperty(this, "showContent", false);
16
17
  }
17
18
  }
18
19
  export default class WmContainer extends PartialHost {
19
20
  constructor(props) {
20
- super(props, DEFAULT_CLASS, new WmContainerProps());
21
+ super(props, DEFAULT_CLASS, new WmContainerProps(), new WmContainerState());
22
+ this.updateState({
23
+ showContent: !this.state.props.deferload
24
+ });
21
25
  }
22
26
  renderWidget(props) {
27
+ if (!this.state.showContent && this.isVisible()) {
28
+ this.updateState({
29
+ showContent: true
30
+ });
31
+ }
23
32
  const dimensions = {
24
33
  width: this.styles.root.width ? '100%' : undefined,
25
34
  height: this.styles.root.height ? '100%' : undefined
26
35
  };
27
- return /*#__PURE__*/React.createElement(Animatedview, {
36
+ return this.state.showContent && /*#__PURE__*/React.createElement(Animatedview, {
28
37
  entryanimation: props.animation,
29
38
  style: this.styles.root
30
39
  }, this._background, /*#__PURE__*/React.createElement(Tappable, _extends({}, this.getTestPropsForAction(), {
@@ -1 +1 @@
1
- {"version":3,"names":["React","View","WmContainerProps","DEFAULT_CLASS","Tappable","Animatedview","PartialHost","PartialHostState","WmContainerState","constructor","arguments","_defineProperty","WmContainer","props","renderWidget","dimensions","width","styles","root","undefined","height","createElement","entryanimation","animation","style","_background","_extends","getTestPropsForAction","target","content","renderContent"],"sources":["container.component.tsx"],"sourcesContent":["import React from 'react';\nimport { View, ViewStyle } from 'react-native';\n\nimport WmContainerProps from './container.props';\nimport { DEFAULT_CLASS, WmContainerStyles } from './container.styles';\nimport { Tappable } from '@wavemaker/app-rn-runtime/core/tappable.component';\nimport { Animatedview } from '@wavemaker/app-rn-runtime/components/basic/animatedview.component';\nimport { PartialHost, PartialHostState } from './partial-host.component';\n\nexport class WmContainerState extends PartialHostState<WmContainerProps> {\n isPartialLoaded = false;\n}\n\nexport default class WmContainer extends PartialHost<WmContainerProps, WmContainerState, WmContainerStyles> {\n constructor(props: WmContainerProps) {\n super(props, DEFAULT_CLASS, new WmContainerProps());\n }\n\n renderWidget(props: WmContainerProps) {\n const dimensions = {\n width: this.styles.root.width ? '100%' : undefined,\n height: this.styles.root.height ? '100%' : undefined\n };\n return (\n <Animatedview entryanimation={props.animation} style={this.styles.root}>\n {this._background}\n <Tappable {...this.getTestPropsForAction()} target={this} styles={dimensions}>\n <View style={[dimensions as ViewStyle, this.styles.content]}>{this.renderContent(props)}</View>\n </Tappable>\n </Animatedview>\n );\n }\n}\n"],"mappings":";;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,IAAI,QAAmB,cAAc;AAE9C,OAAOC,gBAAgB,MAAM,mBAAmB;AAChD,SAASC,aAAa,QAA2B,oBAAoB;AACrE,SAASC,QAAQ,QAAQ,mDAAmD;AAC5E,SAASC,YAAY,QAAQ,mEAAmE;AAChG,SAASC,WAAW,EAAEC,gBAAgB,QAAQ,0BAA0B;AAExE,OAAO,MAAMC,gBAAgB,SAASD,gBAAgB,CAAmB;EAAAE,YAAA;IAAA,SAAAC,SAAA;IAAAC,eAAA,0BACrD,KAAK;EAAA;AACzB;AAEA,eAAe,MAAMC,WAAW,SAASN,WAAW,CAAwD;EAC1GG,WAAWA,CAACI,KAAuB,EAAE;IACnC,KAAK,CAACA,KAAK,EAAEV,aAAa,EAAE,IAAID,gBAAgB,CAAC,CAAC,CAAC;EACrD;EAEAY,YAAYA,CAACD,KAAuB,EAAE;IACpC,MAAME,UAAU,GAAG;MACjBC,KAAK,EAAE,IAAI,CAACC,MAAM,CAACC,IAAI,CAACF,KAAK,GAAG,MAAM,GAAGG,SAAS;MAClDC,MAAM,EAAE,IAAI,CAACH,MAAM,CAACC,IAAI,CAACE,MAAM,GAAG,MAAM,GAAGD;IAC7C,CAAC;IACD,oBACEnB,KAAA,CAAAqB,aAAA,CAAChB,YAAY;MAACiB,cAAc,EAAET,KAAK,CAACU,SAAU;MAACC,KAAK,EAAE,IAAI,CAACP,MAAM,CAACC;IAAK,GACpE,IAAI,CAACO,WAAW,eACjBzB,KAAA,CAAAqB,aAAA,CAACjB,QAAQ,EAAAsB,QAAA,KAAK,IAAI,CAACC,qBAAqB,CAAC,CAAC;MAAEC,MAAM,EAAE,IAAK;MAACX,MAAM,EAAEF;IAAW,iBACzEf,KAAA,CAAAqB,aAAA,CAACpB,IAAI;MAACuB,KAAK,EAAE,CAACT,UAAU,EAAgB,IAAI,CAACE,MAAM,CAACY,OAAO;IAAE,GAAE,IAAI,CAACC,aAAa,CAACjB,KAAK,CAAQ,CACzF,CACE,CAAC;EAEnB;AACF"}
1
+ {"version":3,"names":["React","View","WmContainerProps","DEFAULT_CLASS","Tappable","Animatedview","PartialHost","PartialHostState","WmContainerState","constructor","arguments","_defineProperty","WmContainer","props","updateState","showContent","state","deferload","renderWidget","isVisible","dimensions","width","styles","root","undefined","height","createElement","entryanimation","animation","style","_background","_extends","getTestPropsForAction","target","content","renderContent"],"sources":["container.component.tsx"],"sourcesContent":["import React from 'react';\nimport { View, ViewStyle } from 'react-native';\n\nimport WmContainerProps from './container.props';\nimport { DEFAULT_CLASS, WmContainerStyles } from './container.styles';\nimport { Tappable } from '@wavemaker/app-rn-runtime/core/tappable.component';\nimport { Animatedview } from '@wavemaker/app-rn-runtime/components/basic/animatedview.component';\nimport { PartialHost, PartialHostState } from './partial-host.component';\n\nexport class WmContainerState extends PartialHostState<WmContainerProps> {\n isPartialLoaded = false;\n showContent: boolean = false;\n}\n\nexport default class WmContainer extends PartialHost<WmContainerProps, WmContainerState, WmContainerStyles> {\n constructor(props: WmContainerProps) {\n super(props, DEFAULT_CLASS, new WmContainerProps(), new WmContainerState());\n this.updateState({showContent: !this.state.props.deferload} as WmContainerState);\n }\n\n renderWidget(props: WmContainerProps) {\n if(!this.state.showContent && this.isVisible()){\n this.updateState({showContent: true} as WmContainerState);\n }\n const dimensions = {\n width: this.styles.root.width ? '100%' : undefined,\n height: this.styles.root.height ? '100%' : undefined\n };\n return this.state.showContent && (\n <Animatedview entryanimation={props.animation} style={this.styles.root}>\n {this._background}\n <Tappable {...this.getTestPropsForAction()} target={this} styles={dimensions}>\n <View style={[dimensions as ViewStyle, this.styles.content]}>{this.renderContent(props)}</View>\n </Tappable>\n </Animatedview>\n );\n }\n}\n"],"mappings":";;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,IAAI,QAAmB,cAAc;AAE9C,OAAOC,gBAAgB,MAAM,mBAAmB;AAChD,SAASC,aAAa,QAA2B,oBAAoB;AACrE,SAASC,QAAQ,QAAQ,mDAAmD;AAC5E,SAASC,YAAY,QAAQ,mEAAmE;AAChG,SAASC,WAAW,EAAEC,gBAAgB,QAAQ,0BAA0B;AAExE,OAAO,MAAMC,gBAAgB,SAASD,gBAAgB,CAAmB;EAAAE,YAAA;IAAA,SAAAC,SAAA;IAAAC,eAAA,0BACrD,KAAK;IAAAA,eAAA,sBACA,KAAK;EAAA;AAC9B;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EACH;AACF"}
@@ -7,6 +7,7 @@ export default class WmContainerProps extends PartialHostProps {
7
7
  super(...arguments);
8
8
  _defineProperty(this, "animation", null);
9
9
  _defineProperty(this, "onLoad", void 0);
10
+ _defineProperty(this, "deferload", false);
10
11
  }
11
12
  }
12
13
  //# sourceMappingURL=container.props.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["PartialHostProps","WmContainerProps","constructor","arguments","_defineProperty"],"sources":["container.props.ts"],"sourcesContent":["import { PartialHostProps } from './partial-host.component';\n\nexport default class WmContainerProps extends PartialHostProps {\n animation?: string = null as any;\n onLoad?: Function;\n}\n"],"mappings":";;;AAAA,SAASA,gBAAgB,QAAQ,0BAA0B;AAE3D,eAAe,MAAMC,gBAAgB,SAASD,gBAAgB,CAAC;EAAAE,YAAA;IAAA,SAAAC,SAAA;IAAAC,eAAA,oBACxC,IAAI;IAAAA,eAAA;EAAA;AAE3B"}
1
+ {"version":3,"names":["PartialHostProps","WmContainerProps","constructor","arguments","_defineProperty"],"sources":["container.props.ts"],"sourcesContent":["import { PartialHostProps } from './partial-host.component';\n\nexport default class WmContainerProps extends PartialHostProps {\n animation?: string = null as any;\n onLoad?: Function;\n deferload?: boolean = false;\n}\n"],"mappings":";;;AAAA,SAASA,gBAAgB,QAAQ,0BAA0B;AAE3D,eAAe,MAAMC,gBAAgB,SAASD,gBAAgB,CAAC;EAAAE,YAAA;IAAA,SAAAC,SAAA;IAAAC,eAAA,oBACxC,IAAI;IAAAA,eAAA;IAAAA,eAAA,oBAEH,KAAK;EAAA;AAC7B"}
@@ -42,7 +42,7 @@ BASE_THEME.registerStyle((themeVariables, addStyle) => {
42
42
  backgroundColor: themeVariables.tabActiveIndicatorBgColor,
43
43
  width: 100,
44
44
  height: 2,
45
- marginTop: -2
45
+ marginTop: -4
46
46
  },
47
47
  activeHeaderIcon: {
48
48
  text: {
@@ -1 +1 @@
1
- {"version":3,"names":["BASE_THEME","DEFAULT_CLASS","registerStyle","themeVariables","addStyle","defaultStyles","root","flexDirection","minWidth","overflow","backgroundColor","tabHeaderBgColor","text","header","paddingTop","paddingBottom","paddingVertical","minHeight","justifyContent","flexGrow","headerIcon","color","tabHeaderIconColor","icon","fontSize","headerText","tabHeaderTextColor","fontFamily","baseFont","fontWeight","activeHeader","tabActiveHeaderBgColor","activeIndicator","tabActiveIndicatorBgColor","width","height","marginTop","activeHeaderIcon","tabActiveHeaderIconColor","activeHeaderText","tabActiveHeaderTextColor","arrowIndicator","display","backgroundImage","backgroundSize","backgroundPosition","backgroundRepeat","arrowIndicatorDot","skeleton"],"sources":["tabheader.styles.ts"],"sourcesContent":["import BASE_THEME from '@wavemaker/app-rn-runtime/styles/theme';\nimport { BaseStyles } from '@wavemaker/app-rn-runtime/core/base.component';\nimport { TextStyle, ViewStyle } from 'react-native';\nimport { WmIconStyles } from '@wavemaker/app-rn-runtime/components/basic/icon/icon.styles';\nimport { WmSkeletonStyles } from '@wavemaker/app-rn-runtime/components/basic/skeleton/skeleton.styles';\n\nexport type WmTabheaderStyles = BaseStyles & {\n activeIndicator: ViewStyle,\n header: ViewStyle,\n headerIcon: WmIconStyles,\n headerText: TextStyle,\n arrowIndicator: ViewStyle,\n arrowIndicatorDot: ViewStyle,\n activeHeader: ViewStyle,\n activeHeaderIcon: WmIconStyles,\n activeHeaderText: TextStyle,\n skeleton: WmSkeletonStyles \n};\n\nexport const DEFAULT_CLASS = 'app-tabheader';\nBASE_THEME.registerStyle((themeVariables, addStyle) => {\n const defaultStyles = {\n root: {\n flexDirection: 'row',\n minWidth: '100%',\n overflow: 'visible',\n backgroundColor: themeVariables.tabHeaderBgColor,\n },\n text: {},\n header: {\n backgroundColor: themeVariables.tabHeaderBgColor,\n paddingTop: 16,\n paddingBottom: 16,\n paddingVertical: 12,\n minWidth: 80,\n minHeight:48,\n flexDirection: 'row',\n justifyContent: 'center',\n flexGrow: 1\n },\n headerIcon: {\n text: {\n color: themeVariables.tabHeaderIconColor\n },\n icon: {\n fontSize : 24\n }\n } as WmIconStyles,\n headerText: {\n color: themeVariables.tabHeaderTextColor,\n overflow: 'visible',\n fontFamily: themeVariables.baseFont,\n fontWeight: '500',\n fontSize: 14,\n },\n activeHeader: {\n backgroundColor: themeVariables.tabActiveHeaderBgColor\n },\n activeIndicator: {\n backgroundColor: themeVariables.tabActiveIndicatorBgColor,\n width: 100,\n height: 2,\n marginTop: -2\n },\n activeHeaderIcon: {\n text: {\n color: themeVariables.tabActiveHeaderIconColor\n }\n } as WmIconStyles,\n activeHeaderText: {\n color: themeVariables.tabActiveHeaderTextColor \n },\n arrowIndicator: {\n display: 'none',\n backgroundImage: '',\n backgroundSize: '100% 100%',\n backgroundPosition: 'center',\n backgroundRepeat: 'no-repeat'\n },\n arrowIndicatorDot: {\n display: 'none'\n },\n skeleton: {} as WmSkeletonStyles\n } as WmTabheaderStyles;\n addStyle(DEFAULT_CLASS, '', defaultStyles);\n});"],"mappings":"AAAA,OAAOA,UAAU,MAAM,wCAAwC;AAmB/D,OAAO,MAAMC,aAAa,GAAG,eAAe;AAC5CD,UAAU,CAACE,aAAa,CAAC,CAACC,cAAc,EAAEC,QAAQ,KAAK;EACnD,MAAMC,aAAa,GAAG;IAClBC,IAAI,EAAE;MACFC,aAAa,EAAE,KAAK;MACpBC,QAAQ,EAAE,MAAM;MAChBC,QAAQ,EAAE,SAAS;MACnBC,eAAe,EAAEP,cAAc,CAACQ;IACpC,CAAC;IACDC,IAAI,EAAE,CAAC,CAAC;IACRC,MAAM,EAAE;MACJH,eAAe,EAAEP,cAAc,CAACQ,gBAAgB;MAChDG,UAAU,EAAE,EAAE;MACdC,aAAa,EAAE,EAAE;MACjBC,eAAe,EAAE,EAAE;MACnBR,QAAQ,EAAE,EAAE;MACZS,SAAS,EAAC,EAAE;MACZV,aAAa,EAAE,KAAK;MACpBW,cAAc,EAAE,QAAQ;MACxBC,QAAQ,EAAE;IACd,CAAC;IACDC,UAAU,EAAE;MACRR,IAAI,EAAE;QACFS,KAAK,EAAElB,cAAc,CAACmB;MAC1B,CAAC;MACDC,IAAI,EAAE;QACFC,QAAQ,EAAG;MACd;IACL,CAAiB;IACjBC,UAAU,EAAE;MACRJ,KAAK,EAAElB,cAAc,CAACuB,kBAAkB;MACxCjB,QAAQ,EAAE,SAAS;MACnBkB,UAAU,EAAExB,cAAc,CAACyB,QAAQ;MACnCC,UAAU,EAAE,KAAK;MACjBL,QAAQ,EAAE;IACd,CAAC;IACDM,YAAY,EAAE;MACVpB,eAAe,EAAEP,cAAc,CAAC4B;IACpC,CAAC;IACDC,eAAe,EAAE;MACbtB,eAAe,EAAEP,cAAc,CAAC8B,yBAAyB;MACzDC,KAAK,EAAE,GAAG;MACVC,MAAM,EAAE,CAAC;MACTC,SAAS,EAAE,CAAC;IAChB,CAAC;IACDC,gBAAgB,EAAE;MACdzB,IAAI,EAAE;QACFS,KAAK,EAAElB,cAAc,CAACmC;MAC1B;IACJ,CAAiB;IACjBC,gBAAgB,EAAE;MACdlB,KAAK,EAAElB,cAAc,CAACqC;IAC1B,CAAC;IACDC,cAAc,EAAE;MACZC,OAAO,EAAE,MAAM;MACfC,eAAe,EAAE,EAAE;MACnBC,cAAc,EAAE,WAAW;MAC3BC,kBAAkB,EAAE,QAAQ;MAC5BC,gBAAgB,EAAE;IACtB,CAAC;IACDC,iBAAiB,EAAE;MACfL,OAAO,EAAE;IACb,CAAC;IACDM,QAAQ,EAAE,CAAC;EACf,CAAsB;EACtB5C,QAAQ,CAACH,aAAa,EAAE,EAAE,EAAEI,aAAa,CAAC;AAC9C,CAAC,CAAC"}
1
+ {"version":3,"names":["BASE_THEME","DEFAULT_CLASS","registerStyle","themeVariables","addStyle","defaultStyles","root","flexDirection","minWidth","overflow","backgroundColor","tabHeaderBgColor","text","header","paddingTop","paddingBottom","paddingVertical","minHeight","justifyContent","flexGrow","headerIcon","color","tabHeaderIconColor","icon","fontSize","headerText","tabHeaderTextColor","fontFamily","baseFont","fontWeight","activeHeader","tabActiveHeaderBgColor","activeIndicator","tabActiveIndicatorBgColor","width","height","marginTop","activeHeaderIcon","tabActiveHeaderIconColor","activeHeaderText","tabActiveHeaderTextColor","arrowIndicator","display","backgroundImage","backgroundSize","backgroundPosition","backgroundRepeat","arrowIndicatorDot","skeleton"],"sources":["tabheader.styles.ts"],"sourcesContent":["import BASE_THEME from '@wavemaker/app-rn-runtime/styles/theme';\nimport { BaseStyles } from '@wavemaker/app-rn-runtime/core/base.component';\nimport { TextStyle, ViewStyle } from 'react-native';\nimport { WmIconStyles } from '@wavemaker/app-rn-runtime/components/basic/icon/icon.styles';\nimport { WmSkeletonStyles } from '@wavemaker/app-rn-runtime/components/basic/skeleton/skeleton.styles';\n\nexport type WmTabheaderStyles = BaseStyles & {\n activeIndicator: ViewStyle,\n header: ViewStyle,\n headerIcon: WmIconStyles,\n headerText: TextStyle,\n arrowIndicator: ViewStyle,\n arrowIndicatorDot: ViewStyle,\n activeHeader: ViewStyle,\n activeHeaderIcon: WmIconStyles,\n activeHeaderText: TextStyle,\n skeleton: WmSkeletonStyles \n};\n\nexport const DEFAULT_CLASS = 'app-tabheader';\nBASE_THEME.registerStyle((themeVariables, addStyle) => {\n const defaultStyles = {\n root: {\n flexDirection: 'row',\n minWidth: '100%',\n overflow: 'visible',\n backgroundColor: themeVariables.tabHeaderBgColor,\n },\n text: {},\n header: {\n backgroundColor: themeVariables.tabHeaderBgColor,\n paddingTop: 16,\n paddingBottom: 16,\n paddingVertical: 12,\n minWidth: 80,\n minHeight:48,\n flexDirection: 'row',\n justifyContent: 'center',\n flexGrow: 1\n },\n headerIcon: {\n text: {\n color: themeVariables.tabHeaderIconColor\n },\n icon: {\n fontSize : 24\n }\n } as WmIconStyles,\n headerText: {\n color: themeVariables.tabHeaderTextColor,\n overflow: 'visible',\n fontFamily: themeVariables.baseFont,\n fontWeight: '500',\n fontSize: 14,\n },\n activeHeader: {\n backgroundColor: themeVariables.tabActiveHeaderBgColor\n },\n activeIndicator: {\n backgroundColor: themeVariables.tabActiveIndicatorBgColor,\n width: 100,\n height: 2,\n marginTop: -4\n },\n activeHeaderIcon: {\n text: {\n color: themeVariables.tabActiveHeaderIconColor\n }\n } as WmIconStyles,\n activeHeaderText: {\n color: themeVariables.tabActiveHeaderTextColor \n },\n arrowIndicator: {\n display: 'none',\n backgroundImage: '',\n backgroundSize: '100% 100%',\n backgroundPosition: 'center',\n backgroundRepeat: 'no-repeat'\n },\n arrowIndicatorDot: {\n display: 'none'\n },\n skeleton: {} as WmSkeletonStyles\n } as WmTabheaderStyles;\n addStyle(DEFAULT_CLASS, '', defaultStyles);\n});"],"mappings":"AAAA,OAAOA,UAAU,MAAM,wCAAwC;AAmB/D,OAAO,MAAMC,aAAa,GAAG,eAAe;AAC5CD,UAAU,CAACE,aAAa,CAAC,CAACC,cAAc,EAAEC,QAAQ,KAAK;EACnD,MAAMC,aAAa,GAAG;IAClBC,IAAI,EAAE;MACFC,aAAa,EAAE,KAAK;MACpBC,QAAQ,EAAE,MAAM;MAChBC,QAAQ,EAAE,SAAS;MACnBC,eAAe,EAAEP,cAAc,CAACQ;IACpC,CAAC;IACDC,IAAI,EAAE,CAAC,CAAC;IACRC,MAAM,EAAE;MACJH,eAAe,EAAEP,cAAc,CAACQ,gBAAgB;MAChDG,UAAU,EAAE,EAAE;MACdC,aAAa,EAAE,EAAE;MACjBC,eAAe,EAAE,EAAE;MACnBR,QAAQ,EAAE,EAAE;MACZS,SAAS,EAAC,EAAE;MACZV,aAAa,EAAE,KAAK;MACpBW,cAAc,EAAE,QAAQ;MACxBC,QAAQ,EAAE;IACd,CAAC;IACDC,UAAU,EAAE;MACRR,IAAI,EAAE;QACFS,KAAK,EAAElB,cAAc,CAACmB;MAC1B,CAAC;MACDC,IAAI,EAAE;QACFC,QAAQ,EAAG;MACd;IACL,CAAiB;IACjBC,UAAU,EAAE;MACRJ,KAAK,EAAElB,cAAc,CAACuB,kBAAkB;MACxCjB,QAAQ,EAAE,SAAS;MACnBkB,UAAU,EAAExB,cAAc,CAACyB,QAAQ;MACnCC,UAAU,EAAE,KAAK;MACjBL,QAAQ,EAAE;IACd,CAAC;IACDM,YAAY,EAAE;MACVpB,eAAe,EAAEP,cAAc,CAAC4B;IACpC,CAAC;IACDC,eAAe,EAAE;MACbtB,eAAe,EAAEP,cAAc,CAAC8B,yBAAyB;MACzDC,KAAK,EAAE,GAAG;MACVC,MAAM,EAAE,CAAC;MACTC,SAAS,EAAE,CAAC;IAChB,CAAC;IACDC,gBAAgB,EAAE;MACdzB,IAAI,EAAE;QACFS,KAAK,EAAElB,cAAc,CAACmC;MAC1B;IACJ,CAAiB;IACjBC,gBAAgB,EAAE;MACdlB,KAAK,EAAElB,cAAc,CAACqC;IAC1B,CAAC;IACDC,cAAc,EAAE;MACZC,OAAO,EAAE,MAAM;MACfC,eAAe,EAAE,EAAE;MACnBC,cAAc,EAAE,WAAW;MAC3BC,kBAAkB,EAAE,QAAQ;MAC5BC,gBAAgB,EAAE;IACtB,CAAC;IACDC,iBAAiB,EAAE;MACfL,OAAO,EAAE;IACb,CAAC;IACDM,QAAQ,EAAE,CAAC;EACf,CAAsB;EACtB5C,QAAQ,CAACH,aAAa,EAAE,EAAE,EAAEI,aAAa,CAAC;AAC9C,CAAC,CAAC"}
@@ -164,7 +164,7 @@ export default class WmWizard extends BaseComponent {
164
164
  const isFirstStep = index === 0;
165
165
  const isActiveStep = index === this.state.currentStep;
166
166
  const isNumberTextLayout = this.state.props.classname === 'number-text-inline';
167
- return item.state.props.show != false ? /*#__PURE__*/React.createElement(View, {
167
+ return item.props.show != false ? /*#__PURE__*/React.createElement(View, {
168
168
  style: [this.styles.headerWrapper, isNumberTextLayout ? {
169
169
  paddingRight: isActiveStep ? 0 : 5,
170
170
  paddingLeft: index === this.state.currentStep + 1 ? 0 : 5
@@ -184,10 +184,10 @@ export default class WmWizard extends BaseComponent {
184
184
  color: this.styles.activeStep.color
185
185
  }
186
186
  }),
187
- iconclass: item.state.props.iconclass || 'wm-sl-l sl-check'
187
+ iconclass: item.props.iconclass || 'wm-sl-l sl-check'
188
188
  })), (isNumberTextLayout && isActiveStep || !isNumberTextLayout) && /*#__PURE__*/React.createElement(Text, {
189
189
  style: this.styles.stepTitle
190
- }, item.state.props.title || 'Step Title'), this.numberOfSteps > 1 && isActiveStep && /*#__PURE__*/React.createElement(View, {
190
+ }, item.props.title || 'Step Title'), this.numberOfSteps > 1 && isActiveStep && /*#__PURE__*/React.createElement(View, {
191
191
  style: [this.styles.numberTextStepConnector, {
192
192
  width: isLastStep ? 0 : 50
193
193
  }]
@@ -204,7 +204,9 @@ export default class WmWizard extends BaseComponent {
204
204
  return;
205
205
  }
206
206
  const currentStep = this.steps[index];
207
- currentStep.invokePrevCB(index);
207
+ if (currentStep.invokePrevCB(index) == false) {
208
+ return;
209
+ }
208
210
  this.updateCurrentStep(index - 1);
209
211
  }
210
212
  next(eventName) {
@@ -233,15 +235,13 @@ export default class WmWizard extends BaseComponent {
233
235
  this.invokeEventCallback('onCancel', [null, this.proxy]);
234
236
  }
235
237
  skip() {
236
- if (this.steps[this.state.currentStep] && this.steps[this.state.currentStep].props.enableskip) {
237
- this.next('skip');
238
- }
238
+ this.next('skip');
239
239
  }
240
240
  renderWidget(props) {
241
241
  var _this$state$props$cla;
242
242
  this.numberOfSteps = this.steps.length;
243
243
  const activeStep = this.steps[this.state.currentStep];
244
- const isSkippable = this.steps[this.state.currentStep] && this.steps[this.state.currentStep].props.enableskip;
244
+ const isSkippable = activeStep && activeStep.state.props.enableskip;
245
245
  const isProgressCircleHeader = (_this$state$props$cla = this.state.props.classname) === null || _this$state$props$cla === void 0 ? void 0 : _this$state$props$cla.includes('progress-circle-header');
246
246
  return /*#__PURE__*/React.createElement(View, {
247
247
  style: this.styles.root
@@ -258,20 +258,23 @@ export default class WmWizard extends BaseComponent {
258
258
  styles: merge({}, this.styles.wizardActions, this.theme.getStyle('btn-default'), this.styles.doneButton),
259
259
  id: this.getTestId('donebtn'),
260
260
  caption: props.donebtnlabel,
261
- onTap: this.done.bind(this)
261
+ onTap: this.done.bind(this),
262
+ disabled: activeStep.state.props.disabledone
262
263
  }), this.state.currentStep + 1 < this.numberOfSteps && /*#__PURE__*/React.createElement(WmButton, {
263
264
  iconclass: 'wi wi-chevron-right',
264
265
  styles: merge({}, this.styles.wizardActions, this.theme.getStyle('btn-default'), this.styles.nextButton),
265
266
  id: this.getTestId('nextbtn'),
266
267
  iconposition: 'right',
267
268
  caption: props.nextbtnlabel,
268
- onTap: this.next.bind(this)
269
+ onTap: this.next.bind(this),
270
+ disabled: activeStep.state.props.disablenext
269
271
  }), this.state.currentStep > 0 && /*#__PURE__*/React.createElement(WmButton, {
270
272
  iconclass: 'wi wi-chevron-left',
271
273
  styles: merge({}, this.theme.getStyle('btn-default'), this.styles.wizardActions, this.styles.prevButton),
272
274
  caption: props.previousbtnlabel,
273
275
  id: this.getTestId('prevbtn'),
274
- onTap: this.prev.bind(this)
276
+ onTap: this.prev.bind(this),
277
+ disabled: activeStep.state.props.disableprev
275
278
  }), props.cancelable ? /*#__PURE__*/React.createElement(WmButton, {
276
279
  id: this.getTestId('cancelbtn'),
277
280
  caption: props.cancelbtnlabel,