@wavemaker/app-rn-runtime 11.14.1-22.647577 → 11.14.1-24.647644

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 (98) hide show
  1. package/components/basic/progress-circle/progress-circle.component.js +3 -3
  2. package/components/basic/progress-circle/progress-circle.component.js.map +1 -1
  3. package/components/chart/area-chart/area-chart.component.js +26 -9
  4. package/components/chart/area-chart/area-chart.component.js.map +1 -1
  5. package/components/chart/bar-chart/bar-chart.component.js +38 -6
  6. package/components/chart/bar-chart/bar-chart.component.js.map +1 -1
  7. package/components/chart/bar-chart/bar-chart.props.js +1 -0
  8. package/components/chart/bar-chart/bar-chart.props.js.map +1 -1
  9. package/components/chart/basechart.component.js +8 -15
  10. package/components/chart/basechart.component.js.map +1 -1
  11. package/components/chart/basechart.props.js +1 -0
  12. package/components/chart/basechart.props.js.map +1 -1
  13. package/components/chart/bubble-chart/bubble-chart.component.js +22 -5
  14. package/components/chart/bubble-chart/bubble-chart.component.js.map +1 -1
  15. package/components/chart/line-chart/line-chart.component.js +22 -5
  16. package/components/chart/line-chart/line-chart.component.js.map +1 -1
  17. package/components/chart/pie-chart/pie-chart.component.js +14 -3
  18. package/components/chart/pie-chart/pie-chart.component.js.map +1 -1
  19. package/components/container/tabs/tabs.component.js +62 -29
  20. package/components/container/tabs/tabs.component.js.map +1 -1
  21. package/components/container/tabs/tabs.props.js +1 -0
  22. package/components/container/tabs/tabs.props.js.map +1 -1
  23. package/components/container/wizard/wizard.component.js +1 -1
  24. package/components/container/wizard/wizard.component.js.map +1 -1
  25. package/components/container/wizard/wizard.props.js +0 -1
  26. package/components/container/wizard/wizard.props.js.map +1 -1
  27. package/components/container/wizard/wizardstep/wizardstep.component.js +2 -2
  28. package/components/container/wizard/wizardstep/wizardstep.component.js.map +1 -1
  29. package/components/data/form/form.component.js +4 -1
  30. package/components/data/form/form.component.js.map +1 -1
  31. package/components/dialogs/dialogcontent/dialogcontent.component.js +1 -2
  32. package/components/dialogs/dialogcontent/dialogcontent.component.js.map +1 -1
  33. package/components/input/baseinput/baseinput.component.js +21 -3
  34. package/components/input/baseinput/baseinput.component.js.map +1 -1
  35. package/components/input/baseinput/baseinput.props.js +1 -0
  36. package/components/input/baseinput/baseinput.props.js.map +1 -1
  37. package/components/input/basenumber/basenumber.component.js +18 -3
  38. package/components/input/basenumber/basenumber.component.js.map +1 -1
  39. package/components/input/basenumber/basenumber.props.js +1 -0
  40. package/components/input/basenumber/basenumber.props.js.map +1 -1
  41. package/components/input/checkboxset/checkboxset.component.js +1 -1
  42. package/components/input/checkboxset/checkboxset.component.js.map +1 -1
  43. package/components/input/currency/currency.component.js +2 -0
  44. package/components/input/currency/currency.component.js.map +1 -1
  45. package/components/input/currency/currency.styles.js +10 -1
  46. package/components/input/currency/currency.styles.js.map +1 -1
  47. package/components/input/number/number.component.js +2 -0
  48. package/components/input/number/number.component.js.map +1 -1
  49. package/components/input/number/number.styles.js +4 -0
  50. package/components/input/number/number.styles.js.map +1 -1
  51. package/components/input/radioset/radioset.component.js +3 -6
  52. package/components/input/radioset/radioset.component.js.map +1 -1
  53. package/components/input/text/text.component.js +2 -0
  54. package/components/input/text/text.component.js.map +1 -1
  55. package/components/input/text/text.props.js +0 -1
  56. package/components/input/text/text.props.js.map +1 -1
  57. package/components/input/text/text.styles.js +17 -0
  58. package/components/input/text/text.styles.js.map +1 -1
  59. package/components/input/textarea/textarea.component.js +1 -0
  60. package/components/input/textarea/textarea.component.js.map +1 -1
  61. package/components/input/textarea/textarea.styles.js +4 -0
  62. package/components/input/textarea/textarea.styles.js.map +1 -1
  63. package/components/navigation/popover/popover.component.js +3 -3
  64. package/components/navigation/popover/popover.component.js.map +1 -1
  65. package/core/AppConfig.js.map +1 -1
  66. package/core/base.component.js +0 -5
  67. package/core/base.component.js.map +1 -1
  68. package/core/components/error-fallback/error-fallback.component.js +18 -50
  69. package/core/components/error-fallback/error-fallback.component.js.map +1 -1
  70. package/core/components/error-fallback/error-fallback.styles.js +1 -4
  71. package/core/components/error-fallback/error-fallback.styles.js.map +1 -1
  72. package/core/components/textinput.component.js +25 -4
  73. package/core/components/textinput.component.js.map +1 -1
  74. package/core/error-boundary.component.js +2 -46
  75. package/core/error-boundary.component.js.map +1 -1
  76. package/core/fixed-view.component.js +19 -2
  77. package/core/fixed-view.component.js.map +1 -1
  78. package/core/tappable.component.js +1 -1
  79. package/core/tappable.component.js.map +1 -1
  80. package/core/viewport.js +13 -8
  81. package/core/viewport.js.map +1 -1
  82. package/gestures/carousel-swipe.animation.js +0 -1
  83. package/gestures/carousel-swipe.animation.js.map +1 -1
  84. package/npm-shrinkwrap.json +266 -350
  85. package/package-lock.json +266 -350
  86. package/package.json +2 -2
  87. package/runtime/App.js +12 -174
  88. package/runtime/App.js.map +1 -1
  89. package/runtime/base-page.component.js +2 -11
  90. package/runtime/base-page.component.js.map +1 -1
  91. package/runtime/navigator/stack.navigator.js +0 -3
  92. package/runtime/navigator/stack.navigator.js.map +1 -1
  93. package/styles/theme.js +6 -0
  94. package/styles/theme.js.map +1 -1
  95. package/core/advanced-promise-rejection-tracker.js +0 -207
  96. package/core/advanced-promise-rejection-tracker.js.map +0 -1
  97. package/core/global-error-handler.service.js +0 -177
  98. package/core/global-error-handler.service.js.map +0 -1
@@ -26,11 +26,11 @@ export default class WmProgressCircle extends BaseComponent {
26
26
  const height = e.nativeEvent.layout.height;
27
27
  let radius = this.state.radius;
28
28
  if (!width) {
29
- radius = height;
29
+ radius = Math.floor(height);
30
30
  } else if (!height) {
31
- radius = width;
31
+ radius = Math.floor(width);
32
32
  } else {
33
- radius = Math.min(width, height);
33
+ radius = Math.floor(Math.min(width, height));
34
34
  }
35
35
  this.handleLayout(e);
36
36
  this.updateState({
@@ -1 +1 @@
1
- {"version":3,"names":["React","View","Text","isNumber","AnimatedCircularProgress","Tappable","BaseComponent","BaseComponentState","AccessibilityWidgetType","getAccessibilityProps","WmProgressCircleProps","DEFAULT_CLASS","WmProgressCircleState","constructor","args","_defineProperty","WmProgressCircle","props","onLayout","e","width","nativeEvent","layout","height","radius","state","Math","min","handleLayout","updateState","renderWidget","value","datavalue","minvalue","maxvalue","styles","theme","mergeStyle","getStyle","type","showText","captionplacement","createElement","_extends","style","root","bind","PROGRESSCIRCLE","getTestPropsForAction","_background","target","disableTouchEffect","disabletoucheffect","fill","progressValue","backgroundWidth","rotation","tintColor","backgroundColor","lineCap","buttStyle","progressCircle","size","alignItems","text","getTestPropsForLabel","title","subtitle","subTitle"],"sources":["progress-circle.component.tsx"],"sourcesContent":["import React from 'react';\nimport { LayoutChangeEvent, View, Text } from 'react-native';\nimport { isNumber } from 'lodash';\nimport { AnimatedCircularProgress } from 'react-native-circular-progress';\nimport { Tappable } from '@wavemaker/app-rn-runtime/core/tappable.component';\nimport { BaseComponent, BaseComponentState } from '@wavemaker/app-rn-runtime/core/base.component';\nimport { AccessibilityWidgetType, getAccessibilityProps } from '@wavemaker/app-rn-runtime/core/accessibility';\n\nimport WmProgressCircleProps from './progress-circle.props';\nimport { DEFAULT_CLASS, WmProgressCircleStyles } from './progress-circle.styles';\n\n\nexport class WmProgressCircleState extends BaseComponentState<WmProgressCircleProps> {\n radius = 10;\n}\n\nexport default class WmProgressCircle extends BaseComponent<WmProgressCircleProps, WmProgressCircleState, WmProgressCircleStyles> {\n\n constructor(props: WmProgressCircleProps) {\n super(props, DEFAULT_CLASS, new WmProgressCircleProps(), new WmProgressCircleState());\n }\n\n onLayout(e: LayoutChangeEvent) {\n const width = e.nativeEvent.layout.width;\n const height = e.nativeEvent.layout.height;\n let radius = this.state.radius;\n if (!width) {\n radius = height;\n } else if (!height) {\n radius = width;\n } else {\n radius = Math.min(width, height);\n }\n \n this.handleLayout(e)\n\n this.updateState({\n radius: radius\n } as WmProgressCircleState);\n }\n\n renderWidget(props: WmProgressCircleProps) {\n let value = 0;\n if (isNumber(props.datavalue) && isNumber(props.minvalue) && isNumber(props.maxvalue)) {\n value = (+props.datavalue - (+props.minvalue)) / (+props.maxvalue - (+props.minvalue)) * 100;\n }\n const styles = this.theme.mergeStyle(this.theme.getStyle(`app-${props.type}-progress-circle`), this.styles);\n const showText = props.captionplacement !== 'hidden';\n return (\n <View style={styles.root} onLayout={this.onLayout.bind(this)} {...getAccessibilityProps(AccessibilityWidgetType.PROGRESSCIRCLE, props)} {...this.getTestPropsForAction('progresscircle')}>\n {this._background}\n <Tappable target={this} styles={{root:{width: '100%', height: '100%'}}} disableTouchEffect={this.state.props.disabletoucheffect}>\n <AnimatedCircularProgress\n fill={value}\n width={styles.progressValue.height}\n backgroundWidth={styles.progressValue.height}\n rotation={0}\n tintColor={styles.progressValue.backgroundColor}\n lineCap={styles.progressValue.buttStyle || \"butt\"}\n backgroundColor={styles.progressCircle.backgroundColor}\n size={this.state.radius}>\n {(fill: any) => (<View style={{alignItems: 'center'}}>\n <Text style={styles.text} {...this.getTestPropsForLabel('title')}>{ showText ? props.title || value : '' }</Text>\n {showText && props.subtitle ? (<Text style={styles.subTitle} {...this.getTestPropsForLabel('subtitle')}>{ props.subtitle }</Text>) : null}\n </View>)} \n </AnimatedCircularProgress>\n </Tappable>\n </View>); \n }\n}\n"],"mappings":";;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAA4BC,IAAI,EAAEC,IAAI,QAAQ,cAAc;AAC5D,SAASC,QAAQ,QAAQ,QAAQ;AACjC,SAASC,wBAAwB,QAAQ,gCAAgC;AACzE,SAASC,QAAQ,QAAQ,mDAAmD;AAC5E,SAASC,aAAa,EAAEC,kBAAkB,QAAQ,+CAA+C;AACjG,SAASC,uBAAuB,EAAEC,qBAAqB,QAAQ,8CAA8C;AAE7G,OAAOC,qBAAqB,MAAM,yBAAyB;AAC3D,SAASC,aAAa,QAAgC,0BAA0B;AAGhF,OAAO,MAAMC,qBAAqB,SAASL,kBAAkB,CAAwB;EAAAM,YAAA,GAAAC,IAAA;IAAA,SAAAA,IAAA;IAAAC,eAAA,iBAC1E,EAAE;EAAA;AACb;AAEA,eAAe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AQ;IAAE,gBACvC/D,KAAA,CAAA0C,aAAA,CAACxC,IAAI,EAAAyC,QAAA;MAACC,KAAK,EAAET,MAAM,CAAC6B;IAAK,GAAK,IAAI,CAACC,oBAAoB,CAAC,OAAO,CAAC,GAAIzB,QAAQ,GAAGvB,KAAK,CAACiD,KAAK,IAAInC,KAAK,GAAG,EAAU,CAAC,EAChHS,QAAQ,IAAIvB,KAAK,CAACkD,QAAQ,gBAAInE,KAAA,CAAA0C,aAAA,CAACxC,IAAI,EAAAyC,QAAA;MAACC,KAAK,EAAET,MAAM,CAACiC;IAAS,GAAK,IAAI,CAACH,oBAAoB,CAAC,UAAU,CAAC,GAAIhD,KAAK,CAACkD,QAAgB,CAAC,GAAI,IACjI,CACI,CAClB,CACN,CAAC;EACT;AACF","ignoreList":[]}
1
+ {"version":3,"names":["React","View","Text","isNumber","AnimatedCircularProgress","Tappable","BaseComponent","BaseComponentState","AccessibilityWidgetType","getAccessibilityProps","WmProgressCircleProps","DEFAULT_CLASS","WmProgressCircleState","constructor","args","_defineProperty","WmProgressCircle","props","onLayout","e","width","nativeEvent","layout","height","radius","state","Math","floor","min","handleLayout","updateState","renderWidget","value","datavalue","minvalue","maxvalue","styles","theme","mergeStyle","getStyle","type","showText","captionplacement","createElement","_extends","style","root","bind","PROGRESSCIRCLE","getTestPropsForAction","_background","target","disableTouchEffect","disabletoucheffect","fill","progressValue","backgroundWidth","rotation","tintColor","backgroundColor","lineCap","buttStyle","progressCircle","size","alignItems","text","getTestPropsForLabel","title","subtitle","subTitle"],"sources":["progress-circle.component.tsx"],"sourcesContent":["import React from 'react';\nimport { LayoutChangeEvent, View, Text } from 'react-native';\nimport { isNumber } from 'lodash';\nimport { AnimatedCircularProgress } from 'react-native-circular-progress';\nimport { Tappable } from '@wavemaker/app-rn-runtime/core/tappable.component';\nimport { BaseComponent, BaseComponentState } from '@wavemaker/app-rn-runtime/core/base.component';\nimport { AccessibilityWidgetType, getAccessibilityProps } from '@wavemaker/app-rn-runtime/core/accessibility';\n\nimport WmProgressCircleProps from './progress-circle.props';\nimport { DEFAULT_CLASS, WmProgressCircleStyles } from './progress-circle.styles';\n\n\nexport class WmProgressCircleState extends BaseComponentState<WmProgressCircleProps> {\n radius = 10;\n}\n\nexport default class WmProgressCircle extends BaseComponent<WmProgressCircleProps, WmProgressCircleState, WmProgressCircleStyles> {\n\n constructor(props: WmProgressCircleProps) {\n super(props, DEFAULT_CLASS, new WmProgressCircleProps(), new WmProgressCircleState());\n }\n\n onLayout(e: LayoutChangeEvent) {\n const width = e.nativeEvent.layout.width;\n const height = e.nativeEvent.layout.height;\n let radius = this.state.radius;\n if (!width) {\n radius = Math.floor(height);\n } else if (!height) {\n radius = Math.floor(width);\n } else {\n radius = Math.floor(Math.min(width, height));\n }\n \n this.handleLayout(e)\n\n this.updateState({\n radius: radius\n } as WmProgressCircleState);\n }\n\n renderWidget(props: WmProgressCircleProps) {\n let value = 0;\n if (isNumber(props.datavalue) && isNumber(props.minvalue) && isNumber(props.maxvalue)) {\n value = (+props.datavalue - (+props.minvalue)) / (+props.maxvalue - (+props.minvalue)) * 100;\n }\n const styles = this.theme.mergeStyle(this.theme.getStyle(`app-${props.type}-progress-circle`), this.styles);\n const showText = props.captionplacement !== 'hidden';\n return (\n <View style={styles.root} onLayout={this.onLayout.bind(this)} {...getAccessibilityProps(AccessibilityWidgetType.PROGRESSCIRCLE, props)} {...this.getTestPropsForAction('progresscircle')}>\n {this._background}\n <Tappable target={this} styles={{root:{width: '100%', height: '100%'}}} disableTouchEffect={this.state.props.disabletoucheffect}>\n <AnimatedCircularProgress\n fill={value}\n width={styles.progressValue.height}\n backgroundWidth={styles.progressValue.height}\n rotation={0}\n tintColor={styles.progressValue.backgroundColor}\n lineCap={styles.progressValue.buttStyle || \"butt\"}\n backgroundColor={styles.progressCircle.backgroundColor}\n size={this.state.radius}>\n {(fill: any) => (<View style={{alignItems: 'center'}}>\n <Text style={styles.text} {...this.getTestPropsForLabel('title')}>{ showText ? props.title || value : '' }</Text>\n {showText && props.subtitle ? (<Text style={styles.subTitle} {...this.getTestPropsForLabel('subtitle')}>{ props.subtitle }</Text>) : null}\n </View>)} \n </AnimatedCircularProgress>\n </Tappable>\n </View>); \n }\n}\n"],"mappings":";;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAA4BC,IAAI,EAAEC,IAAI,QAAQ,cAAc;AAC5D,SAASC,QAAQ,QAAQ,QAAQ;AACjC,SAASC,wBAAwB,QAAQ,gCAAgC;AACzE,SAASC,QAAQ,QAAQ,mDAAmD;AAC5E,SAASC,aAAa,EAAEC,kBAAkB,QAAQ,+CAA+C;AACjG,SAASC,uBAAuB,EAAEC,qBAAqB,QAAQ,8CAA8C;AAE7G,OAAOC,qBAAqB,MAAM,yBAAyB;AAC3D,SAASC,aAAa,QAAgC,0BAA0B;AAGhF,OAAO,MAAMC,qBAAqB,SAASL,kBAAkB,CAAwB;EAAAM,YAAA,GAAAC,IAAA;IAAA,SAAAA,IAAA;IAAAC,eAAA,iBAC1E,EAAE;EAAA;AACb;AAEA,eAAe,MAAMC,gBAAgB,SAASV,aAAa,CAAuE;EAEhIO,WAAWA,CAACI,KAA4B,EAAE;IACxC,KAAK,CAACA,KAAK,EAAEN,aAAa,EAAE,IAAID,qBAAqB,CAAC,CAAC,EAAE,IAAIE,qBAAqB,CAAC,CAAC,CAAC;EACvF;EAEAM,QAAQA,CAACC,CAAoB,EAAE;IAC7B,MAAMC,KAAK,GAAGD,CAAC,CAACE,WAAW,CAACC,MAAM,CAACF,KAAK;IACxC,MAAMG,MAAM,GAAGJ,CAAC,CAACE,WAAW,CAACC,MAAM,CAACC,MAAM;IAC1C,IAAIC,MAAM,GAAG,IAAI,CAACC,KAAK,CAACD,MAAM;IAC9B,IAAI,CAACJ,KAAK,EAAE;MACVI,MAAM,GAAGE,IAAI,CAACC,KAAK,CAACJ,MAAM,CAAC;IAC7B,CAAC,MAAM,IAAI,CAACA,MAAM,EAAE;MAClBC,MAAM,GAAGE,IAA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AC;EACT;AACF","ignoreList":[]}
@@ -61,22 +61,39 @@ export default class WmAreaChart extends BaseChartComponent {
61
61
  });
62
62
  }
63
63
  renderWidget(props) {
64
- var _this$state$data, _this$props$name;
64
+ var _this$state$data, _this$props$name, _props$chartheight, _this$styles$root, _this$styles$root2, _this$styles$root3, _this$styles$root4, _this$styles$root5, _this$styles$root6;
65
65
  this.invokeEventCallback('onBeforerender', [this.proxy, null]);
66
66
  if (!((_this$state$data = this.state.data) !== null && _this$state$data !== void 0 && _this$state$data.length)) {
67
67
  return null;
68
68
  }
69
- let mindomain = {
70
- x: props.xdomain === 'Min' ? this.state.chartMinX : undefined,
71
- y: props.ydomain === 'Min' ? this.state.chartMinY : undefined
72
- };
73
69
  const chartName = (_this$props$name = this.props.name) !== null && _this$props$name !== void 0 ? _this$props$name : 'nonameAreachart';
74
70
  let gradientStop = '100%';
75
71
  if (isNumber(this.state.chartMaxY) && isNumber(this.state.chartMinY) && this.state.chartMaxY > 0) {
76
72
  gradientStop = (this.state.chartMaxY - this.state.chartMinY) * 100 / this.state.chartMaxY + '%';
77
73
  }
74
+ let offsetTop = props.offsettop;
75
+ let offsetHeight = 0;
76
+ let victoryChartHeight = (_props$chartheight = props.chartheight) !== null && _props$chartheight !== void 0 ? _props$chartheight : this.styles.root.height;
77
+ if ((_this$styles$root = this.styles.root) !== null && _this$styles$root !== void 0 && _this$styles$root.height && typeof ((_this$styles$root2 = this.styles.root) === null || _this$styles$root2 === void 0 ? void 0 : _this$styles$root2.height) === 'number') {
78
+ offsetTop = this.styles.root.height / 250 * props.offsettop;
79
+ offsetHeight = this.styles.root.height >= 250 && !props.chartheight && props.chartheight !== 0 ? 0 : offsetTop + props.offsetbottom;
80
+ }
81
+ if (typeof victoryChartHeight === 'number') {
82
+ victoryChartHeight = victoryChartHeight + offsetHeight;
83
+ }
84
+ let containerStyle = {
85
+ ...this.styles.root
86
+ };
87
+ if (containerStyle !== null && containerStyle !== void 0 && containerStyle.height) {
88
+ containerStyle['minHeight'] = containerStyle['height'];
89
+ delete containerStyle['height'];
90
+ }
91
+ let mindomain = {
92
+ x: props.xdomain === 'Min' ? this.state.chartMinX : undefined,
93
+ y: props.ydomain === 'Min' ? this.state.chartMinY : undefined
94
+ };
78
95
  return /*#__PURE__*/React.createElement(View, _extends({}, getAccessibilityProps(AccessibilityWidgetType.LINECHART, props), {
79
- style: this.styles.root,
96
+ style: containerStyle,
80
97
  onLayout: this.onViewLayoutChange.bind(this),
81
98
  key: `${props.title}_area_chart`
82
99
  }), /*#__PURE__*/React.createElement(View, null, props.title || props.iconclass ? /*#__PURE__*/React.createElement(View, {
@@ -96,16 +113,16 @@ export default class WmAreaChart extends BaseChartComponent {
96
113
  ref: this.viewRef
97
114
  }, this.getTooltip(), /*#__PURE__*/React.createElement(VictoryChart, {
98
115
  theme: this.state.theme,
99
- height: this.styles.root.height,
116
+ height: victoryChartHeight,
100
117
  width: this.state.chartWidth || this.screenWidth,
101
118
  padding: {
102
- top: props.offsettop,
119
+ top: offsetTop,
103
120
  bottom: props.offsetbottom,
104
121
  left: this.isRTL ? props.offsetright : props.offsetleft,
105
122
  right: this.isRTL ? props.offsetleft : props.offsetright
106
123
  },
107
124
  minDomain: mindomain
108
- }, this.getLegendView(), this.getXaxis(), this.getYAxis(), /*#__PURE__*/React.createElement(VictoryStack, null, this.state.data.map((d, i) => {
125
+ }, this.getLegendView(undefined, (_this$styles$root3 = this.styles.root) !== null && _this$styles$root3 !== void 0 && _this$styles$root3.height && typeof ((_this$styles$root4 = this.styles.root) === null || _this$styles$root4 === void 0 ? void 0 : _this$styles$root4.height) === 'string' || (_this$styles$root5 = this.styles.root) !== null && _this$styles$root5 !== void 0 && _this$styles$root5.height && typeof ((_this$styles$root6 = this.styles.root) === null || _this$styles$root6 === void 0 ? void 0 : _this$styles$root6.height) === 'number' && this.styles.root.height >= 250 ? 0 : offsetHeight), this.getXaxis(offsetHeight), this.getYAxis(), /*#__PURE__*/React.createElement(VictoryStack, null, this.state.data.map((d, i) => {
109
126
  return /*#__PURE__*/React.createElement(VictoryGroup, {
110
127
  key: props.name + '_area_group_' + i
111
128
  }, /*#__PURE__*/React.createElement(Defs, null, /*#__PURE__*/React.createElement(LinearGradient, {
@@ -1 +1 @@
1
- {"version":3,"names":["React","Color","View","Text","Platform","Defs","LinearGradient","Stop","VictoryArea","VictoryChart","VictoryStack","VictoryScatter","VictoryGroup","WmAreaChartProps","DEFAULT_CLASS","BaseChartComponent","BaseChartComponentState","WmIcon","isNumber","AccessibilityWidgetType","getAccessibilityProps","WmAreaChartState","constructor","args","_defineProperty","WmAreaChart","props","e","viewWidth","nativeEvent","layout","width","handleLayout","updateState","chartWidth","onSelect","event","data","viewRef","current","state","dataset","measureInWindow","chartX","chartY","value","index","y","label","xaxisDatakeyArr","datum","x","selectedItem","tooltipX","pageX","tooltipY","pageY","selectedChartItem","series","_dataObj","tooltipXaxis","tooltipYaxis","isTooltipOpen","tooltipXPosition","tooltipoffsetx","tooltipYPosition","tooltipoffsety","invokeEventCallback","proxy","renderWidget","_this$state$data","_this$props$name","length","mindomain","xdomain","chartMinX","undefined","ydomain","chartMinY","chartName","name","gradientStop","chartMaxY","createElement","_extends","LINECHART","style","styles","root","onLayout","onViewLayoutChange","bind","key","title","iconclass","testID","flexDirection","alignItems","icon","subheading","subHeading","ref","getTooltip","theme","height","screenWidth","padding","top","offsettop","bottom","offsetbottom","left","isRTL","offsetright","offsetleft","right","minDomain","getLegendView","getXaxis","getYAxis","map","d","i","id","x1","y1","x2","y2","offset","stopColor","colors","lighten","rgb","toString","interpolation","fill","stroke","strokeWidth","linethickness","size","highlightpoints","opacity","events","target","eventHandlers","OS","onClick","onPress"],"sources":["area-chart.component.tsx"],"sourcesContent":["import React from 'react';\nimport Color from \"color\";\nimport { LayoutChangeEvent, View, Text, Platform } from 'react-native';\nimport { Defs, LinearGradient, Stop, Svg } from 'react-native-svg';\nimport { VictoryArea, VictoryLine, VictoryChart, VictoryLegend, VictoryStack, VictoryScatter, VictoryGroup } from \"victory-native\";\nimport { InterpolationPropType } from 'victory-core';\nimport WmAreaChartProps from './area-chart.props';\nimport { DEFAULT_CLASS, WmAreaChartStyles } from './area-chart.styles';\nimport {\n BaseChartComponent,\n BaseChartComponentState\n} from \"@wavemaker/app-rn-runtime/components/chart/basechart.component\";\nimport WmIcon from \"@wavemaker/app-rn-runtime/components/basic/icon/icon.component\";\n\nimport ThemeVariables from '@wavemaker/app-rn-runtime/styles/theme.variables';\nimport { isNil, isNumber } from 'lodash-es';\nimport { AccessibilityWidgetType, getAccessibilityProps } from '@wavemaker/app-rn-runtime/core/accessibility'; \nimport { isWebPreviewMode } from '@wavemaker/app-rn-runtime/core/utils';\n\nexport class WmAreaChartState extends BaseChartComponentState<WmAreaChartProps> {\n chartWidth = 0;\n}\n\nexport default class WmAreaChart extends BaseChartComponent<WmAreaChartProps, WmAreaChartState, WmAreaChartStyles> {\n\n constructor(props: WmAreaChartProps) {\n super(props, DEFAULT_CLASS, new WmAreaChartProps(), new WmAreaChartState());\n }\n\n onViewLayoutChange = (e: LayoutChangeEvent) => {\n let viewWidth = e.nativeEvent.layout.width;\n\n this.handleLayout(e);\n\n this.updateState({\n chartWidth: viewWidth\n } as WmAreaChartState)\n }\n\n onSelect(event: any, data: any){\n if (!this.viewRef.current) return;\n if (!this.state.props.dataset) return;\n this.viewRef.current.measureInWindow((chartX: number, chartY: number) => {\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 const nativeEvent = event.nativeEvent;\n let tooltipX = nativeEvent.pageX - chartX;\n let tooltipY = nativeEvent.pageY - chartY;\n let selectedChartItem = [{series: 0, x: data.index, y: value,_dataObj: selectedItem},data.index];\n this.updateState({\n tooltipXaxis: label,\n tooltipYaxis: value,\n isTooltipOpen: true,\n selectedItem: {...selectedItem, index: data.index},\n tooltipXPosition: tooltipX - this.state.tooltipoffsetx, \n tooltipYPosition: tooltipY - this.state.tooltipoffsety\n } as WmAreaChartState)\n this.invokeEventCallback('onSelect', [event.nativeEvent, this.proxy, selectedItem, selectedChartItem ]);\n });\n }\n\n renderWidget(props: WmAreaChartProps) {\n this.invokeEventCallback('onBeforerender', [this.proxy, null]);\n if (!this.state.data?.length) {\n return null;\n }\n let mindomain={\n x: props.xdomain === 'Min' ? this.state.chartMinX: undefined,\n y: props.ydomain === 'Min' ? this.state.chartMinY: undefined\n };\n const chartName = this.props.name ?? 'nonameAreachart';\n let gradientStop = '100%';\n if (isNumber(this.state.chartMaxY) && isNumber(this.state.chartMinY) && this.state.chartMaxY > 0) {\n gradientStop = (this.state.chartMaxY - this.state.chartMinY) * 100 / this.state.chartMaxY + '%';\n }\n return (\n <View\n {...getAccessibilityProps(AccessibilityWidgetType.LINECHART, props)}\n style={this.styles.root}\n onLayout={this.onViewLayoutChange.bind(this)}\n key={`${props.title}_area_chart`}\n >\n <View>\n { (props.title || props.iconclass) ? (\n <View testID=\"title-icon-container\" style={{flexDirection: 'row', alignItems: 'center'}}>\n {props.iconclass ? (<WmIcon iconclass={props.iconclass} styles={this.styles.icon}></WmIcon>) : null }\n {props.title ? (<Text style={this.styles.title}>{props.title}</Text>) : null }\n </View>\n ) : null }\n { props.subheading? (\n <Text style={this.styles.subHeading}>{props.subheading}</Text> ) : null }\n </View>\n {this.state.chartWidth ? \n (\n <View ref={this.viewRef}>\n {this.getTooltip()}\n <VictoryChart\n theme={this.state.theme}\n height={this.styles.root.height as number}\n width={this.state.chartWidth || this.screenWidth}\n padding={{ top: props.offsettop, bottom: props.offsetbottom, left: this.isRTL ? props.offsetright : props.offsetleft, right: this.isRTL ? props.offsetleft : props.offsetright }}\n minDomain={mindomain}\n > \n {this.getLegendView()}\n {this.getXaxis()}\n {this.getYAxis()}\n <VictoryStack>\n {\n this.state.data.map((d: any, i: number) => {\n return <VictoryGroup key={props.name + '_area_group_' + i}>\n <Defs>\n <LinearGradient id={`${chartName}Gradient${i}`} x1=\"0%\" y1=\"0%\" x2=\"0%\" y2=\"100%\">\n <Stop offset=\"0%\" stopColor={Color(this.state.colors[i]).lighten(0.2).rgb().toString()}/>\n <Stop offset={gradientStop} stopColor={Color(this.state.colors[i]).lighten(0.6).rgb().toString()}/>\n </LinearGradient>\n </Defs>\n <VictoryArea\n interpolation={props.interpolation as InterpolationPropType}\n key={props.name + '_' + i}\n name={props.name + '_' + i}\n style={{\n data: {\n fill: `url(#${chartName}Gradient${i})`,\n stroke: this.state.colors[i],\n strokeWidth: props.linethickness,\n }\n }}\n data={d}\n />\n <VictoryScatter\n size={5}\n key={props.name + '_scatter' + i}\n style={{\n data: props.highlightpoints ? {fill: this.state.colors[i], opacity: 0.8}:{opacity: 0}\n }} \n data={d}\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 </VictoryGroup>\n })\n }\n </VictoryStack>\n </VictoryChart>\n </View>\n )\n : null}\n </View>);\n }\n}\n"],"mappings":";;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,KAAK,MAAM,OAAO;AACzB,SAA4BC,IAAI,EAAEC,IAAI,EAAEC,QAAQ,QAAQ,cAAc;AACtE,SAASC,IAAI,EAAEC,cAAc,EAAEC,IAAI,QAAa,kBAAkB;AAClE,SAASC,WAAW,EAAeC,YAAY,EAAiBC,YAAY,EAAEC,cAAc,EAAEC,YAAY,QAAQ,gBAAgB;AAElI,OAAOC,gBAAgB,MAAM,oBAAoB;AACjD,SAASC,aAAa,QAA2B,qBAAqB;AACtE,SACEC,kBAAkB,EAClBC,uBAAuB,QAClB,gEAAgE;AACvE,OAAOC,MAAM,MAAM,gEAAgE;AAGnF,SAAgBC,QAAQ,QAAQ,WAAW;AAC3C,SAASC,uBAAuB,EAAEC,qBAAqB,QAAQ,8CAA8C;AAG7G,OAAO,MAAMC,gBAAgB,SAASL,uBAAuB,CAAmB;EAAAM,YAAA,GAAAC,IAAA;IAAA,SAAAA,IA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MAAM,EAAE,IAAI,CAAChG,KAAK,CAAC0F,MAAM,CAACR,CAAC,CAAC;YAC5Be,WAAW,EAAE/G,KAAK,CAACgH;UACrB;QACF,CAAE;QACFrG,IAAI,EAAEoF;MAAE,CACT,CAAC,eACAzH,KAAA,CAAAmF,aAAA,CAACxE,cAAc;QACbgI,IAAI,EAAE,CAAE;QACR/C,GAAG,EAAElE,KAAK,CAACsD,IAAI,GAAG,UAAU,GAAG0C,CAAE;QACjCpC,KAAK,EAAE;UACLjD,IAAI,EAAEX,KAAK,CAACkH,eAAe,GAAG;YAACL,IAAI,EAAE,IAAI,CAAC/F,KAAK,CAAC0F,MAAM,CAACR,CAAC,CAAC;YAAEmB,OAAO,EAAE;UAAG,CAAC,GAAC;YAACA,OAAO,EAAE;UAAC;QACtF,CAAE;QACFxG,IAAI,EAAEoF,CAAE;QACRqB,MAAM,EAAE,CAAC;UACPC,MAAM,EAAE,MAAM;UACdC,aAAa,EAAE5I,QAAQ,CAAC6I,EAAE,IAAI,KAAK,GAAG;YACpCC,OAAO,EAAE,IAAI,CAAC/G,QAAQ,CAACwD,IAAI,CAAC,IAAI;UAClC,CAAC,GAAC;YACAwD,OAAO,EAAE,IAAI,CAAChH,QAAQ,CAACwD,IAAI,CAAC,IAAI;UAClC;QACF,CAAC;MAAE,CACF,CACO,CAAC;IACjB,CAAC,CAEW,CACF,CACR,CAAC,GAET,IACE,CAAC;EACT;AACF","ignoreList":[]}
1
+ {"version":3,"names":["React","Color","View","Text","Platform","Defs","LinearGradient","Stop","VictoryArea","VictoryChart","VictoryStack","VictoryScatter","VictoryGroup","WmAreaChartProps","DEFAULT_CLASS","BaseChartComponent","BaseChartComponentState","WmIcon","isNumber","AccessibilityWidgetType","getAccessibilityProps","WmAreaChartState","constructor","args","_defineProperty","WmAreaChart","props","e","viewWidth","nativeEvent","layout","width","handleLayout","updateState","chartWidth","onSelect","event","data","viewRef","current","state","dataset","measureInWindow","chartX","chartY","value","index","y","label","xaxisDatakeyArr","datum","x","selectedItem","tooltipX","pageX","tooltipY","pageY","selectedChartItem","series","_dataObj","tooltipXaxis","tooltipYaxis","isTooltipOpen","tooltipXPosition","tooltipoffsetx","tooltipYPosition","tooltipoffsety","invokeEventCallback","proxy","renderWidget","_this$state$data","_this$props$name","_props$chartheight","_this$styles$root","_this$styles$root2","_this$styles$root3","_this$styles$root4","_this$styles$root5","_this$styles$root6","length","chartName","name","gradientStop","chartMaxY","chartMinY","offsetTop","offsettop","offsetHeight","victoryChartHeight","chartheight","styles","root","height","offsetbottom","containerStyle","mindomain","xdomain","chartMinX","undefined","ydomain","createElement","_extends","LINECHART","style","onLayout","onViewLayoutChange","bind","key","title","iconclass","testID","flexDirection","alignItems","icon","subheading","subHeading","ref","getTooltip","theme","screenWidth","padding","top","bottom","left","isRTL","offsetright","offsetleft","right","minDomain","getLegendView","getXaxis","getYAxis","map","d","i","id","x1","y1","x2","y2","offset","stopColor","colors","lighten","rgb","toString","interpolation","fill","stroke","strokeWidth","linethickness","size","highlightpoints","opacity","events","target","eventHandlers","OS","onClick","onPress"],"sources":["area-chart.component.tsx"],"sourcesContent":["import React from 'react';\nimport Color from \"color\";\nimport { LayoutChangeEvent, View, Text, Platform } from 'react-native';\nimport { Defs, LinearGradient, Stop, Svg } from 'react-native-svg';\nimport { VictoryArea, VictoryLine, VictoryChart, VictoryLegend, VictoryStack, VictoryScatter, VictoryGroup } from \"victory-native\";\nimport { InterpolationPropType } from 'victory-core';\nimport WmAreaChartProps from './area-chart.props';\nimport { DEFAULT_CLASS, WmAreaChartStyles } from './area-chart.styles';\nimport {\n BaseChartComponent,\n BaseChartComponentState\n} from \"@wavemaker/app-rn-runtime/components/chart/basechart.component\";\nimport WmIcon from \"@wavemaker/app-rn-runtime/components/basic/icon/icon.component\";\n\nimport ThemeVariables from '@wavemaker/app-rn-runtime/styles/theme.variables';\nimport { isNil, isNumber } from 'lodash-es';\nimport { AccessibilityWidgetType, getAccessibilityProps } from '@wavemaker/app-rn-runtime/core/accessibility'; \nimport { isWebPreviewMode } from '@wavemaker/app-rn-runtime/core/utils';\n\nexport class WmAreaChartState extends BaseChartComponentState<WmAreaChartProps> {\n chartWidth = 0;\n}\n\nexport default class WmAreaChart extends BaseChartComponent<WmAreaChartProps, WmAreaChartState, WmAreaChartStyles> {\n\n constructor(props: WmAreaChartProps) {\n super(props, DEFAULT_CLASS, new WmAreaChartProps(), new WmAreaChartState());\n }\n\n onViewLayoutChange = (e: LayoutChangeEvent) => {\n let viewWidth = e.nativeEvent.layout.width;\n\n this.handleLayout(e);\n\n this.updateState({\n chartWidth: viewWidth\n } as WmAreaChartState)\n }\n\n onSelect(event: any, data: any){\n if (!this.viewRef.current) return;\n if (!this.state.props.dataset) return;\n this.viewRef.current.measureInWindow((chartX: number, chartY: number) => {\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 const nativeEvent = event.nativeEvent;\n let tooltipX = nativeEvent.pageX - chartX;\n let tooltipY = nativeEvent.pageY - chartY;\n let selectedChartItem = [{series: 0, x: data.index, y: value,_dataObj: selectedItem},data.index];\n this.updateState({\n tooltipXaxis: label,\n tooltipYaxis: value,\n isTooltipOpen: true,\n selectedItem: {...selectedItem, index: data.index},\n tooltipXPosition: tooltipX - this.state.tooltipoffsetx, \n tooltipYPosition: tooltipY - this.state.tooltipoffsety\n } as WmAreaChartState)\n this.invokeEventCallback('onSelect', [event.nativeEvent, this.proxy, selectedItem, selectedChartItem ]);\n });\n }\n\n renderWidget(props: WmAreaChartProps) {\n this.invokeEventCallback('onBeforerender', [this.proxy, null]);\n if (!this.state.data?.length) {\n return null;\n }\n \n const chartName = this.props.name ?? 'nonameAreachart';\n let gradientStop = '100%';\n if (isNumber(this.state.chartMaxY) && isNumber(this.state.chartMinY) && this.state.chartMaxY > 0) {\n gradientStop = (this.state.chartMaxY - this.state.chartMinY) * 100 / this.state.chartMaxY + '%';\n }\n\n let offsetTop = props.offsettop;\n let offsetHeight = 0;\n let victoryChartHeight = props.chartheight ?? this.styles.root.height;\n\n if(this.styles.root?.height && typeof this.styles.root?.height === 'number') {\n offsetTop = (this.styles.root.height / 250) * props.offsettop;\n offsetHeight = (this.styles.root.height >= 250 && !props.chartheight && props.chartheight !== 0) ? 0 : offsetTop + props.offsetbottom;\n }\n\n if(typeof victoryChartHeight === 'number') {\n victoryChartHeight = victoryChartHeight + offsetHeight;\n }\n\n let containerStyle = {...this.styles.root}\n if(containerStyle?.height) {\n containerStyle['minHeight'] = containerStyle['height'];\n delete containerStyle['height'];\n }\n\n let mindomain={\n x: props.xdomain === 'Min' ? this.state.chartMinX: undefined,\n y: props.ydomain === 'Min' ? this.state.chartMinY: undefined\n };\n return (\n <View\n {...getAccessibilityProps(AccessibilityWidgetType.LINECHART, props)}\n style={containerStyle}\n onLayout={this.onViewLayoutChange.bind(this)}\n key={`${props.title}_area_chart`}\n >\n <View>\n { (props.title || props.iconclass) ? (\n <View testID=\"title-icon-container\" style={{flexDirection: 'row', alignItems: 'center'}}>\n {props.iconclass ? (<WmIcon iconclass={props.iconclass} styles={this.styles.icon}></WmIcon>) : null }\n {props.title ? (<Text style={this.styles.title}>{props.title}</Text>) : null }\n </View>\n ) : null }\n { props.subheading? (\n <Text style={this.styles.subHeading}>{props.subheading}</Text> ) : null }\n </View>\n {this.state.chartWidth ? \n (\n <View ref={this.viewRef}>\n {this.getTooltip()}\n <VictoryChart\n theme={this.state.theme}\n height={victoryChartHeight as number}\n width={this.state.chartWidth || this.screenWidth}\n padding={{ top: offsetTop, bottom: props.offsetbottom, left: this.isRTL ? props.offsetright : props.offsetleft, right: this.isRTL ? props.offsetleft : props.offsetright }}\n minDomain={mindomain}\n > \n {this.getLegendView(\n undefined, \n (\n (\n (this.styles.root?.height && typeof this.styles.root?.height === 'string') || \n (this.styles.root?.height && typeof this.styles.root?.height === 'number' && this.styles.root.height >= 250)) ? \n 0 : offsetHeight\n )\n )}\n {this.getXaxis(offsetHeight)}\n {this.getYAxis()}\n <VictoryStack>\n {\n this.state.data.map((d: any, i: number) => {\n return <VictoryGroup key={props.name + '_area_group_' + i}>\n <Defs>\n <LinearGradient id={`${chartName}Gradient${i}`} x1=\"0%\" y1=\"0%\" x2=\"0%\" y2=\"100%\">\n <Stop offset=\"0%\" stopColor={Color(this.state.colors[i]).lighten(0.2).rgb().toString()}/>\n <Stop offset={gradientStop} stopColor={Color(this.state.colors[i]).lighten(0.6).rgb().toString()}/>\n </LinearGradient>\n </Defs>\n <VictoryArea\n interpolation={props.interpolation as InterpolationPropType}\n key={props.name + '_' + i}\n name={props.name + '_' + i}\n style={{\n data: {\n fill: `url(#${chartName}Gradient${i})`,\n stroke: this.state.colors[i],\n strokeWidth: props.linethickness,\n }\n }}\n data={d}\n />\n <VictoryScatter\n size={5}\n key={props.name + '_scatter' + i}\n style={{\n data: props.highlightpoints ? {fill: this.state.colors[i], opacity: 0.8}:{opacity: 0}\n }} \n data={d}\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 </VictoryGroup>\n })\n }\n </VictoryStack>\n </VictoryChart>\n </View>\n )\n : null}\n </View>);\n }\n}\n"],"mappings":";;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,KAAK,MAAM,OAAO;AACzB,SAA4BC,IAAI,EAAEC,IAAI,EAAEC,QAAQ,QAAQ,cAAc;AACtE,SAASC,IAAI,EAAEC,cAAc,EAAEC,IAAI,QAAa,kBAAkB;AAClE,SAASC,WAAW,EAAeC,YAAY,EAAiBC,YAAY,EAAEC,cAAc,EAAEC,YAAY,QAAQ,gBAAgB;AAElI,OAAOC,gBAAgB,MAAM,oBAAoB;AACjD,SAASC,aAAa,QAA2B,qBAAqB;AACtE,SACEC,kBAAkB,EAClBC,uBAAuB,QAClB,gEAAgE;AACvE,OAAOC,MAAM,MAAM,gEAAgE;AAGnF,SAAgBC,QAAQ,QAAQ,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AQ,CAACyJ,EAAE,IAAI,KAAK,GAAG;YACpCC,OAAO,EAAE,IAAI,CAAC3H,QAAQ,CAACuE,IAAI,CAAC,IAAI;UAClC,CAAC,GAAC;YACAqD,OAAO,EAAE,IAAI,CAAC5H,QAAQ,CAACuE,IAAI,CAAC,IAAI;UAClC;QACF,CAAC;MAAE,CACF,CACO,CAAC;IACjB,CAAC,CAEW,CACF,CACR,CAAC,GAET,IACE,CAAC;EACT;AACF","ignoreList":[]}
@@ -16,6 +16,9 @@ export default class WmBarChart extends BaseChartComponent {
16
16
  return this.abbreviateNumber(data.datum.y);
17
17
  }
18
18
  getBarChart(props) {
19
+ if (props.chartheight !== undefined && props.chartheight === 0) {
20
+ return /*#__PURE__*/React.createElement(React.Fragment, null);
21
+ }
19
22
  const isNested = Array.isArray(this.state.data[0]) && this.state.data.length > 1;
20
23
  return this.state.data.map((d, i) => {
21
24
  return /*#__PURE__*/React.createElement(VictoryBar, _extends({
@@ -32,9 +35,20 @@ export default class WmBarChart extends BaseChartComponent {
32
35
  }) => {
33
36
  var _this$state$colors$da;
34
37
  return (_this$state$colors$da = this.state.colors[datum.x]) !== null && _this$state$colors$da !== void 0 ? _this$state$colors$da : this.state.colors[datum.x % this.state.colors.length];
35
- }
38
+ },
39
+ stroke: isNested ? this.state.colors[i % this.state.colors.length] : ({
40
+ datum
41
+ }) => {
42
+ var _this$state$colors$da2;
43
+ return (_this$state$colors$da2 = this.state.colors[datum.x]) !== null && _this$state$colors$da2 !== void 0 ? _this$state$colors$da2 : this.state.colors[datum.x % this.state.colors.length];
44
+ },
45
+ strokeWidth: props.showzerothvalue ? 3 : 0
46
+ }
47
+ } : {
48
+ data: {
49
+ strokeWidth: props.showzerothvalue ? 3 : 0
36
50
  }
37
- } : {},
51
+ },
38
52
  cornerRadius: {
39
53
  topLeft: this.styles.bar.borderTopLeftRadius,
40
54
  topRight: this.styles.bar.borderTopRightRadius,
@@ -85,16 +99,34 @@ export default class WmBarChart extends BaseChartComponent {
85
99
  });
86
100
  }
87
101
  renderWidget(props) {
102
+ var _props$chartheight, _this$styles$root, _this$styles$root2, _this$styles$root3, _this$styles$root4, _this$styles$root5, _this$styles$root6;
88
103
  this.invokeEventCallback('onBeforerender', [this.proxy, null]);
89
104
  if (!this.state.data.length) {
90
105
  return null;
91
106
  }
107
+ let offsetTop = props.offsettop;
108
+ let offsetHeight = 0;
109
+ let victoryChartHeight = (_props$chartheight = props.chartheight) !== null && _props$chartheight !== void 0 ? _props$chartheight : this.styles.root.height;
110
+ if ((_this$styles$root = this.styles.root) !== null && _this$styles$root !== void 0 && _this$styles$root.height && typeof ((_this$styles$root2 = this.styles.root) === null || _this$styles$root2 === void 0 ? void 0 : _this$styles$root2.height) === 'number') {
111
+ offsetTop = this.styles.root.height / 250 * props.offsettop;
112
+ offsetHeight = this.styles.root.height >= 250 && !props.chartheight && props.chartheight !== 0 ? 0 : offsetTop + props.offsetbottom;
113
+ }
114
+ if (typeof victoryChartHeight === 'number') {
115
+ victoryChartHeight = victoryChartHeight + offsetHeight;
116
+ }
117
+ let containerStyle = {
118
+ ...this.styles.root
119
+ };
120
+ if (containerStyle !== null && containerStyle !== void 0 && containerStyle.height) {
121
+ containerStyle['minHeight'] = containerStyle['height'];
122
+ delete containerStyle['height'];
123
+ }
92
124
  let mindomain = {
93
125
  x: this.props.xdomain === 'Min' ? this.state.chartMinX : undefined,
94
126
  y: this.props.ydomain === 'Min' ? this.state.chartMinY : undefined
95
127
  };
96
128
  return /*#__PURE__*/React.createElement(View, _extends({}, getAccessibilityProps(AccessibilityWidgetType.LINECHART, props), {
97
- style: this.styles.root,
129
+ style: containerStyle,
98
130
  onLayout: this.onViewLayoutChange.bind(this)
99
131
  }), /*#__PURE__*/React.createElement(View, null, props.title || props.iconclass ? /*#__PURE__*/React.createElement(View, {
100
132
  testID: "title-icon-container",
@@ -113,16 +145,16 @@ export default class WmBarChart extends BaseChartComponent {
113
145
  ref: this.viewRef
114
146
  }, this.getTooltip(), /*#__PURE__*/React.createElement(VictoryChart, {
115
147
  theme: this.state.theme,
116
- height: this.styles.root.height,
148
+ height: victoryChartHeight,
117
149
  width: this.state.chartWidth || this.screenWidth,
118
150
  minDomain: mindomain,
119
151
  padding: {
120
- top: props.offsettop,
152
+ top: offsetTop,
121
153
  bottom: props.offsetbottom,
122
154
  left: this.isRTL ? props.offsetright : props.offsetleft,
123
155
  right: this.isRTL ? props.offsetleft : props.offsetright
124
156
  }
125
- }, this.getLegendView(), this.getXaxis(), this.getYAxis(), props.viewtype === 'Stacked' ? /*#__PURE__*/React.createElement(VictoryStack, {
157
+ }, this.getLegendView(undefined, (_this$styles$root3 = this.styles.root) !== null && _this$styles$root3 !== void 0 && _this$styles$root3.height && typeof ((_this$styles$root4 = this.styles.root) === null || _this$styles$root4 === void 0 ? void 0 : _this$styles$root4.height) === 'string' || (_this$styles$root5 = this.styles.root) !== null && _this$styles$root5 !== void 0 && _this$styles$root5.height && typeof ((_this$styles$root6 = this.styles.root) === null || _this$styles$root6 === void 0 ? void 0 : _this$styles$root6.height) === 'number' && this.styles.root.height >= 250 ? 0 : offsetHeight), this.getXaxis(offsetHeight), this.getYAxis(), props.viewtype === 'Stacked' ? /*#__PURE__*/React.createElement(VictoryStack, {
126
158
  colorScale: !this.theme ? this.state.colors : undefined
127
159
  }, this.getBarChart(props)) : /*#__PURE__*/React.createElement(VictoryGroup, {
128
160
  colorScale: !this.theme ? this.state.colors : undefined,
@@ -1 +1 @@
1
- {"version":3,"names":["React","View","Text","Platform","AccessibilityWidgetType","getAccessibilityProps","VictoryChart","VictoryBar","VictoryStack","VictoryGroup","BaseChartComponent","BaseChartComponentState","WmBarChartProps","DEFAULT_CLASS","WmIcon","WmBarChartState","WmBarChart","constructor","props","labelFn","data","abbreviateNumber","datum","y","getBarChart","isNested","Array","isArray","state","length","map","d","i","createElement","_extends","key","name","horizontal","labels","showvalues","bind","undefined","isRTL","toReversed","height","alignment","style","customcolors","fill","colors","_this$state$colors$da","x","cornerRadius","topLeft","styles","bar","borderTopLeftRadius","topRight","borderTopRightRadius","bottomLeft","borderBottomLeftRadius","bottomRight","borderBottomRightRadius","events","target","eventHandlers","OS","onClick","onSelect","onPress","barwidth","barWidth","event","viewRef","current","dataset","measureInWindow","chartX","chartY","value","index","label","xaxisDatakeyArr","selectedItem","nativeEvent","tooltipX","pageX","tooltipY","pageY","selectedChartItem","series","_dataObj","updateState","tooltipXaxis","tooltipYaxis","isTooltipOpen","tooltipXPosition","tooltipoffsetx","tooltipYPosition","tooltipoffsety","invokeEventCallback","proxy","renderWidget","mindomain","xdomain","chartMinX","ydomain","chartMinY","LINECHART","root","onLayout","onViewLayoutChange","title","iconclass","testID","flexDirection","alignItems","icon","subheading","subHeading","ref","getTooltip","theme","width","chartWidth","screenWidth","minDomain","padding","top","offsettop","bottom","offsetbottom","left","offsetright","offsetleft","right","getLegendView","getXaxis","getYAxis","viewtype","colorScale","offset"],"sources":["bar-chart.component.tsx"],"sourcesContent":["import React from 'react';\nimport { View, Text, Platform, LayoutChangeEvent } from 'react-native';\nimport { AccessibilityWidgetType, getAccessibilityProps } from '@wavemaker/app-rn-runtime/core/accessibility'; \nimport {\n VictoryChart,\n VictoryBar,\n VictoryLegend,\n VictoryStack,\n VictoryGroup\n} from \"victory-native\";\n\nimport {\n BaseChartComponent,\n BaseChartComponentState\n} from \"@wavemaker/app-rn-runtime/components/chart/basechart.component\";\nimport WmBarChartProps from './bar-chart.props';\nimport { DEFAULT_CLASS, WmBarChartStyles } from './bar-chart.styles';\nimport WmIcon from \"@wavemaker/app-rn-runtime/components/basic/icon/icon.component\";\nimport { min } from 'moment';\nimport { isWebPreviewMode } from '@wavemaker/app-rn-runtime/core/utils';\n\nexport class WmBarChartState extends BaseChartComponentState<WmBarChartProps> {}\n\nexport default class WmBarChart extends BaseChartComponent<WmBarChartProps, WmBarChartState, WmBarChartStyles> {\n\n constructor(props: WmBarChartProps) {\n super(props, DEFAULT_CLASS, new WmBarChartProps(), new WmBarChartState());\n }\n\n labelFn(data: any): string | number | string[] | number[] | null {\n return this.abbreviateNumber(data.datum.y);\n }\n\n getBarChart(props: WmBarChartProps) {\n const isNested = Array.isArray(this.state.data[0]) && this.state.data.length > 1;\n return this.state.data.map((d: any, i: number) => {\n return <VictoryBar key={props.name + '_' + i}\n horizontal={props.horizontal} labels={props.showvalues ? this.labelFn.bind(this) : undefined}\n data={this.isRTL?d.toReversed():d}\n height={100}\n alignment={this.isRTL ? 'end' : 'start'}\n style={props.customcolors?{\n data: {\n fill:isNested ? this.state.colors[i % this.state.colors.length] : ({ datum }) => this.state.colors[datum.x] ?? this.state.colors[datum.x % this.state.colors.length]\n }\n }:{}}\n cornerRadius={{topLeft: this.styles.bar.borderTopLeftRadius, topRight: this.styles.bar.borderTopRightRadius, bottomLeft: this.styles.bar.borderBottomLeftRadius, bottomRight: this.styles.bar.borderBottomRightRadius}}\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 {...(props.barwidth ? { barWidth: props.barwidth } : {})} />\n });\n }\n\nonSelect(event: any, data: any){\n if (!this.viewRef.current) return;\n if (!this.state.props.dataset) return;\n this.viewRef.current.measureInWindow((chartX: number, chartY: number) => {\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 const nativeEvent = event.nativeEvent;\n let tooltipX = nativeEvent.pageX - chartX;\n let tooltipY = nativeEvent.pageY - chartY;\n let selectedChartItem = [{series: 0, x: data.index, y: value,_dataObj: selectedItem},data.index];\n this.updateState({\n tooltipXaxis: label,\n tooltipYaxis: value,\n isTooltipOpen: true,\n selectedItem: {...selectedItem, index: data.index},\n tooltipXPosition: tooltipX - this.state.tooltipoffsetx, \n tooltipYPosition: tooltipY - this.state.tooltipoffsety\n } as WmBarChartState)\n this.invokeEventCallback('onSelect', [event.nativeEvent, this.proxy, selectedItem, selectedChartItem ]);\n });\n}\n\n renderWidget(props: WmBarChartProps) {\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 (<View\n {...getAccessibilityProps(AccessibilityWidgetType.LINECHART, props)}\n style={this.styles.root}\n onLayout={this.onViewLayoutChange.bind(this)}\n >\n <View>\n { (props.title || props.iconclass) ? (\n <View testID=\"title-icon-container\" style={{flexDirection: 'row', alignItems: 'center'}}>\n {props.iconclass ? (<WmIcon iconclass={props.iconclass} styles={this.styles.icon}></WmIcon>) : null }\n {props.title ? (<Text style={this.styles.title}>{props.title}</Text>) : null }\n </View>\n ) : null }\n { props.subheading ? (\n <Text style={this.styles.subHeading}>{props.subheading}</Text> ) : null }\n </View>\n <View ref={this.viewRef}>\n {this.getTooltip()}\n <VictoryChart theme={this.state.theme}\n height={(this.styles.root.height) as number}\n width={this.state.chartWidth || this.screenWidth}\n minDomain={mindomain}\n padding={{ top: props.offsettop, bottom: props.offsetbottom, left: this.isRTL ? props.offsetright : props.offsetleft, right: this.isRTL ? props.offsetleft : props.offsetright }}>\n {this.getLegendView()}\n {this.getXaxis()}\n {this.getYAxis()}\n {\n props.viewtype === 'Stacked' ? <VictoryStack \n colorScale={!this.theme ? this.state.colors : undefined}>\n {\n this.getBarChart(props)\n }\n </VictoryStack> : <VictoryGroup colorScale={!this.theme ? this.state.colors : undefined} offset={10} >\n {\n this.getBarChart(props) \n }\n </VictoryGroup>\n }\n </VictoryChart></View></View>);\n }\n}\n"],"mappings":";AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,IAAI,EAAEC,IAAI,EAAEC,QAAQ,QAA2B,cAAc;AACtE,SAASC,uBAAuB,EAAEC,qBAAqB,QAAQ,8CAA8C;AAC7G,SACEC,YAAY,EACZC,UAAU,EAEVC,YAAY,EACZC,YAAY,QACP,gBAAgB;AAEvB,SACEC,kBA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pM,IAAI,CAACG,aAAa,CAAC,CAAC,EACpB,IAAI,CAACC,QAAQ,CAAC,CAAC,EACf,IAAI,CAACC,QAAQ,CAAC,CAAC,EAEdxH,KAAK,CAACyH,QAAQ,KAAK,SAAS,gBAAG3I,KAAA,CAAAiC,aAAA,CAACzB,YAAY;MAC5CoI,UAAU,EAAE,CAAC,IAAI,CAAClB,KAAK,GAAG,IAAI,CAAC9F,KAAK,CAACqB,MAAM,GAAGR;IAAU,GAEpD,IAAI,CAACjB,WAAW,CAACN,KAAK,CAEZ,CAAC,gBAAGlB,KAAA,CAAAiC,aAAA,CAACxB,YAAY;MAACmI,UAAU,EAAE,CAAC,IAAI,CAAClB,KAAK,GAAG,IAAI,CAAC9F,KAAK,CAACqB,MAAM,GAAGR,SAAU;MAAEoG,MAAM,EAAE;IAAG,GAEjG,IAAI,CAACrH,WAAW,CAACN,KAAK,CAEZ,CAEJ,CAAO,CAAO,CAAC;EAC/B;AACF","ignoreList":[]}
1
+ {"version":3,"names":["React","View","Text","Platform","AccessibilityWidgetType","getAccessibilityProps","VictoryChart","VictoryBar","VictoryStack","VictoryGroup","BaseChartComponent","BaseChartComponentState","WmBarChartProps","DEFAULT_CLASS","WmIcon","WmBarChartState","WmBarChart","constructor","props","labelFn","data","abbreviateNumber","datum","y","getBarChart","chartheight","undefined","createElement","Fragment","isNested","Array","isArray","state","length","map","d","i","_extends","key","name","horizontal","labels","showvalues","bind","isRTL","toReversed","height","alignment","style","customcolors","fill","colors","_this$state$colors$da","x","stroke","_this$state$colors$da2","strokeWidth","showzerothvalue","cornerRadius","topLeft","styles","bar","borderTopLeftRadius","topRight","borderTopRightRadius","bottomLeft","borderBottomLeftRadius","bottomRight","borderBottomRightRadius","events","target","eventHandlers","OS","onClick","onSelect","onPress","barwidth","barWidth","event","viewRef","current","dataset","measureInWindow","chartX","chartY","value","index","label","xaxisDatakeyArr","selectedItem","nativeEvent","tooltipX","pageX","tooltipY","pageY","selectedChartItem","series","_dataObj","updateState","tooltipXaxis","tooltipYaxis","isTooltipOpen","tooltipXPosition","tooltipoffsetx","tooltipYPosition","tooltipoffsety","invokeEventCallback","proxy","renderWidget","_props$chartheight","_this$styles$root","_this$styles$root2","_this$styles$root3","_this$styles$root4","_this$styles$root5","_this$styles$root6","offsetTop","offsettop","offsetHeight","victoryChartHeight","root","offsetbottom","containerStyle","mindomain","xdomain","chartMinX","ydomain","chartMinY","LINECHART","onLayout","onViewLayoutChange","title","iconclass","testID","flexDirection","alignItems","icon","subheading","subHeading","ref","getTooltip","theme","width","chartWidth","screenWidth","minDomain","padding","top","bottom","left","offsetright","offsetleft","right","getLegendView","getXaxis","getYAxis","viewtype","colorScale","offset"],"sources":["bar-chart.component.tsx"],"sourcesContent":["import React from 'react';\nimport { View, Text, Platform, LayoutChangeEvent } from 'react-native';\nimport { AccessibilityWidgetType, getAccessibilityProps } from '@wavemaker/app-rn-runtime/core/accessibility'; \nimport {\n VictoryChart,\n VictoryBar,\n VictoryLegend,\n VictoryStack,\n VictoryGroup\n} from \"victory-native\";\n\nimport {\n BaseChartComponent,\n BaseChartComponentState\n} from \"@wavemaker/app-rn-runtime/components/chart/basechart.component\";\nimport WmBarChartProps from './bar-chart.props';\nimport { DEFAULT_CLASS, WmBarChartStyles } from './bar-chart.styles';\nimport WmIcon from \"@wavemaker/app-rn-runtime/components/basic/icon/icon.component\";\nimport { min } from 'moment';\nimport { isWebPreviewMode } from '@wavemaker/app-rn-runtime/core/utils';\n\nexport class WmBarChartState extends BaseChartComponentState<WmBarChartProps> {}\n\nexport default class WmBarChart extends BaseChartComponent<WmBarChartProps, WmBarChartState, WmBarChartStyles> {\n\n constructor(props: WmBarChartProps) {\n super(props, DEFAULT_CLASS, new WmBarChartProps(), new WmBarChartState());\n }\n\n labelFn(data: any): string | number | string[] | number[] | null {\n return this.abbreviateNumber(data.datum.y);\n }\n\n getBarChart(props: WmBarChartProps) {\n if(props.chartheight !== undefined && props.chartheight === 0){\n return <></>\n }\n const isNested = Array.isArray(this.state.data[0]) && this.state.data.length > 1;\n return this.state.data.map((d: any, i: number) => {\n return <VictoryBar key={props.name + '_' + i}\n horizontal={props.horizontal} labels={props.showvalues ? this.labelFn.bind(this) : undefined}\n data={this.isRTL?d.toReversed():d}\n height={100}\n alignment={this.isRTL ? 'end' : 'start'}\n style={props.customcolors?{\n data: {\n fill:isNested ? this.state.colors[i % this.state.colors.length] : ({ datum }) => this.state.colors[datum.x] ?? this.state.colors[datum.x % this.state.colors.length],\n stroke: isNested ? this.state.colors[i % this.state.colors.length] : ({ datum }) => this.state.colors[datum.x] ?? this.state.colors[datum.x % this.state.colors.length],\n strokeWidth: props.showzerothvalue ? 3 : 0\n }\n }:{\n data: {\n strokeWidth: props.showzerothvalue ? 3 : 0\n }\n }}\n cornerRadius={{topLeft: this.styles.bar.borderTopLeftRadius, topRight: this.styles.bar.borderTopRightRadius, bottomLeft: this.styles.bar.borderBottomLeftRadius, bottomRight: this.styles.bar.borderBottomRightRadius}}\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 {...(props.barwidth ? { barWidth: props.barwidth } : {})} />\n });\n }\n\nonSelect(event: any, data: any){\n if (!this.viewRef.current) return;\n if (!this.state.props.dataset) return;\n this.viewRef.current.measureInWindow((chartX: number, chartY: number) => {\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 const nativeEvent = event.nativeEvent;\n let tooltipX = nativeEvent.pageX - chartX;\n let tooltipY = nativeEvent.pageY - chartY;\n let selectedChartItem = [{series: 0, x: data.index, y: value,_dataObj: selectedItem},data.index];\n this.updateState({\n tooltipXaxis: label,\n tooltipYaxis: value,\n isTooltipOpen: true,\n selectedItem: {...selectedItem, index: data.index},\n tooltipXPosition: tooltipX - this.state.tooltipoffsetx, \n tooltipYPosition: tooltipY - this.state.tooltipoffsety\n } as WmBarChartState)\n this.invokeEventCallback('onSelect', [event.nativeEvent, this.proxy, selectedItem, selectedChartItem ]);\n });\n}\n\n renderWidget(props: WmBarChartProps) {\n this.invokeEventCallback('onBeforerender', [this.proxy, null]);\n if (!this.state.data.length) {\n return null;\n }\n\n let offsetTop = props.offsettop;\n let offsetHeight = 0;\n let victoryChartHeight = props.chartheight ?? this.styles.root.height;\n\n if(this.styles.root?.height && typeof this.styles.root?.height === 'number') {\n offsetTop = (this.styles.root.height / 250) * props.offsettop;\n offsetHeight = (this.styles.root.height >= 250 && !props.chartheight && props.chartheight !== 0) ? 0 : offsetTop + props.offsetbottom;\n }\n\n if(typeof victoryChartHeight === 'number') {\n victoryChartHeight = victoryChartHeight + offsetHeight;\n }\n\n let containerStyle = {...this.styles.root}\n if(containerStyle?.height) {\n containerStyle['minHeight'] = containerStyle['height'];\n delete containerStyle['height'];\n }\n\n let mindomain={x: this.props.xdomain === 'Min' ? this.state.chartMinX: undefined, y: this.props.ydomain === 'Min' ? this.state.chartMinY: undefined};\n return (<View\n {...getAccessibilityProps(AccessibilityWidgetType.LINECHART, props)}\n style={containerStyle}\n onLayout={this.onViewLayoutChange.bind(this)}\n >\n <View>\n { (props.title || props.iconclass) ? (\n <View testID=\"title-icon-container\" style={{flexDirection: 'row', alignItems: 'center'}}>\n {props.iconclass ? (<WmIcon iconclass={props.iconclass} styles={this.styles.icon}></WmIcon>) : null }\n {props.title ? (<Text style={this.styles.title}>{props.title}</Text>) : null }\n </View>\n ) : null }\n { props.subheading ? (\n <Text style={this.styles.subHeading}>{props.subheading}</Text> ) : null }\n </View>\n <View ref={this.viewRef}>\n {this.getTooltip()}\n <VictoryChart theme={this.state.theme}\n height={victoryChartHeight as number}\n width={this.state.chartWidth || this.screenWidth}\n minDomain={mindomain}\n padding={{ top: offsetTop, bottom: props.offsetbottom, left: this.isRTL ? props.offsetright : props.offsetleft, right: this.isRTL ? props.offsetleft : props.offsetright }}>\n {this.getLegendView(\n undefined, \n (\n (\n (this.styles.root?.height && typeof this.styles.root?.height === 'string') || \n (this.styles.root?.height && typeof this.styles.root?.height === 'number' && this.styles.root.height >= 250)) ? \n 0 : offsetHeight\n )\n )}\n {this.getXaxis(offsetHeight)}\n {this.getYAxis()}\n {\n props.viewtype === 'Stacked' ? <VictoryStack \n colorScale={!this.theme ? this.state.colors : undefined}>\n {\n this.getBarChart(props)\n }\n </VictoryStack> : <VictoryGroup colorScale={!this.theme ? this.state.colors : undefined} offset={10} >\n {\n this.getBarChart(props) \n }\n </VictoryGroup>\n }\n </VictoryChart></View></View>);\n }\n}\n"],"mappings":";AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,IAAI,EAAEC,IAAI,EAAEC,QAAQ,QAA2B,cAAc;AACtE,SAASC,uBAAuB,EAAEC,qBAAqB,QAAQ,8CAA8C;AAC7G,SACEC,YAAY,EACZC,UAAU,EAEVC,YAAY,EACZC,YAAY,QACP,gBAAgB;AAEvB,SACEC,kBAAkB,EAClBC,uBAAuB,QAClB,gEAAgE;AACvE,OAAOC,eAAe,MAAM,mBAAmB;AAC/C,SAASC,aAAa,QAA0B,oBAAoB;AACpE,OAAOC,MAAM,MAAM,gEAAgE;AAInF,OAAO,MAAMC,eAAe,SAASJ,uBAAuB,CAAkB;AAE9E,eAAe,MAAMK,UAAU,SAASN,kBAAkB,CAAqD;EAE7GO,WAAWA,CAACC,KAAsB,EAAE;IAClC,KAAK,CAACA,KAAK,EAAEL,aAAa,EAAE,IAAID,eAAe,CAAC,CAAC,EAAE,IAAIG,eAAe,CAAC,CAAC,CAAC;EAC3E;EAEAI,OAAOA,CAACC,IAAS,EAAgD;IAC/D,OAAO,IAAI,CAACC,gBAAgB,CAACD,IAAI,CAACE,KAAK,CAACC,CAAC,CAAC;EAC5C;EAEAC,WAAWA,CAACN,KAAsB,EAAE;IAClC,IAAGA,KAAK,CAACO,WAAW,KAAKC,SAAS,IAAIR,KAAK,CAACO,WAAW,KAAK,CAAC,EAAC;MAC5D,oBAAOzB,KAAA,CAA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class WmBarChartProps extends BaseChartComponentProps {
9
9
  _defineProperty(this, "viewtype", 'Grouped');
10
10
  _defineProperty(this, "onSelect", void 0);
11
11
  _defineProperty(this, "barwidth", void 0);
12
+ _defineProperty(this, "showzerothvalue", false);
12
13
  }
13
14
  }
14
15
  //# sourceMappingURL=bar-chart.props.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["BaseChartComponentProps","WmBarChartProps","constructor","args","_defineProperty"],"sources":["bar-chart.props.ts"],"sourcesContent":["import BaseChartComponentProps from \"@wavemaker/app-rn-runtime/components/chart/basechart.props\";\n\nexport default class WmBarChartProps extends BaseChartComponentProps {\n horizontal?: boolean = true;\n viewtype: string = 'Grouped';\n onSelect?: any;\n barwidth?: number;\n}\n"],"mappings":";;;AAAA,OAAOA,uBAAuB,MAAM,4DAA4D;AAEhG,eAAe,MAAMC,eAAe,SAASD,uBAAuB,CAAC;EAAAE,YAAA,GAAAC,IAAA;IAAA,SAAAA,IAAA;IAAAC,eAAA,qBAC5C,IAAI;IAAAA,eAAA,mBACR,SAAS;IAAAA,eAAA;IAAAA,eAAA;EAAA;AAG9B","ignoreList":[]}
1
+ {"version":3,"names":["BaseChartComponentProps","WmBarChartProps","constructor","args","_defineProperty"],"sources":["bar-chart.props.ts"],"sourcesContent":["import BaseChartComponentProps from \"@wavemaker/app-rn-runtime/components/chart/basechart.props\";\n\nexport default class WmBarChartProps extends BaseChartComponentProps {\n horizontal?: boolean = true;\n viewtype: string = 'Grouped';\n onSelect?: any;\n barwidth?: number;\n showzerothvalue: boolean = false;\n}\n"],"mappings":";;;AAAA,OAAOA,uBAAuB,MAAM,4DAA4D;AAEhG,eAAe,MAAMC,eAAe,SAASD,uBAAuB,CAAC;EAAAE,YAAA,GAAAC,IAAA;IAAA,SAAAA,IAAA;IAAAC,eAAA,qBAC5C,IAAI;IAAAA,eAAA,mBACR,SAAS;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA,0BAGD,KAAK;EAAA;AAClC","ignoreList":[]}
@@ -107,14 +107,14 @@ export class BaseChartComponent extends BaseComponent {
107
107
  // format number and add suffix
108
108
  return scaled.toFixed(1) + suffix;
109
109
  }
110
- getLegendView(colorScale) {
110
+ getLegendView(colorScale, offset = 0) {
111
111
  if (this.state.props.showlegend === 'hide') {
112
112
  return null;
113
113
  }
114
114
  const props = this.state.props;
115
115
  let top = props.showlegend === 'bottom' ? parseInt(this.styles.root.height) : 0;
116
116
  if (top) {
117
- top = top - 50; // remove legendHeight
117
+ top = offset !== 0 ? top - 50 : top - offset; // remove legendHeight
118
118
  }
119
119
  const orientation = props.showlegend === 'right' || props.showlegend === 'left' ? 'vertical' : 'horizontal';
120
120
  return /*#__PURE__*/React.createElement(VictoryLegend, {
@@ -129,7 +129,7 @@ export class BaseChartComponent extends BaseComponent {
129
129
  }
130
130
  },
131
131
  borderPadding: {
132
- top: 30,
132
+ top: offset !== 0 ? 0 : 30,
133
133
  left: 50
134
134
  },
135
135
  y: top
@@ -162,16 +162,17 @@ export class BaseChartComponent extends BaseComponent {
162
162
  }
163
163
 
164
164
  // x axis with vertical lines having grid stroke colors
165
- getXaxis() {
165
+ getXaxis(offset = 0) {
166
+ var _props$chartheight;
166
167
  const minIndex = 0;
167
168
  const maxIndex = this.state.xaxisDatakeyArr.length - 1;
168
169
  const props = this.state.props;
169
170
  const getTickValueLabel = props.xtickexpr;
170
- let height = this.styles.root.height || 250;
171
- let yaxislabeldistance = props.yaxislabeldistance ? props.yaxislabeldistance : height - 20;
171
+ let height = (_props$chartheight = props.chartheight) !== null && _props$chartheight !== void 0 ? _props$chartheight : this.styles.root.height || 250;
172
172
  if (height && typeof height === 'string') {
173
173
  height = parseInt(height);
174
174
  }
175
+ let yaxislabeldistance = props.yaxislabeldistance ? props.yaxislabeldistance : height + offset - 20;
175
176
  return /*#__PURE__*/React.createElement(VictoryAxis, {
176
177
  crossAxis: false,
177
178
  label: (props.xaxislabel || props.xaxisdatakey || "name") + (props.xunits ? `(${props.xunits})` : ''),
@@ -193,7 +194,7 @@ export class BaseChartComponent extends BaseComponent {
193
194
  y: yaxislabeldistance
194
195
  }),
195
196
  tickLabelComponent: /*#__PURE__*/React.createElement(VictoryLabel, {
196
- y: props.offsetyaxis ? props.offsetyaxis : height - 30,
197
+ y: props.offsetyaxis ? props.offsetyaxis : height + offset - 30,
197
198
  angle: props.labelangle || 0
198
199
  }),
199
200
  theme: this.state.theme,
@@ -574,14 +575,6 @@ export class BaseChartComponent extends BaseComponent {
574
575
  });
575
576
  // chartTransform
576
577
  this.invokeEventCallback('onTransform', [undefined, this.proxy]);
577
- if (props.type == 'Pie' || props.type === 'Donut') {
578
- // for animation effect
579
- setTimeout(() => {
580
- this.updateState({
581
- endAngle: 360
582
- });
583
- }, 500);
584
- }
585
578
  this.updateData(datasets, yPts, xaxisDatakeyArr);
586
579
  }
587
580
  }