@wavemaker-ai/app-rn-runtime 1.0.0-rc.324 → 1.0.0-rc.328
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.
- package/components/advanced/offline-banner/offline-banner.component.js +68 -0
- package/components/advanced/offline-banner/offline-banner.component.js.map +1 -0
- package/components/advanced/offline-banner/offline-banner.props.js +12 -0
- package/components/advanced/offline-banner/offline-banner.props.js.map +1 -0
- package/components/advanced/offline-banner/offline-banner.styles.js +99 -0
- package/components/advanced/offline-banner/offline-banner.styles.js.map +1 -0
- package/components/advanced/webview/webview.component.js +2 -2
- package/components/advanced/webview/webview.component.js.map +1 -1
- package/components/advanced/webview/webview.props.js +1 -1
- package/components/advanced/webview/webview.props.js.map +1 -1
- package/components/basic/bottomsheet/bottomsheet.component.js +156 -14
- package/components/basic/bottomsheet/bottomsheet.component.js.map +1 -1
- package/components/basic/bottomsheet/bottomsheet.styles.js +0 -3
- package/components/basic/bottomsheet/bottomsheet.styles.js.map +1 -1
- package/components/basic/progress-circle/progress-circle.component.js +3 -1
- package/components/basic/progress-circle/progress-circle.component.js.map +1 -1
- package/components/chart/area-chart/area-chart.component.js +86 -93
- package/components/chart/area-chart/area-chart.component.js.map +1 -1
- package/components/chart/area-chart/area-chart.props.js +2 -0
- package/components/chart/area-chart/area-chart.props.js.map +1 -1
- package/components/chart/bar-chart/bar-chart.component.js +79 -97
- package/components/chart/bar-chart/bar-chart.component.js.map +1 -1
- package/components/chart/basechart.component.js +117 -96
- package/components/chart/basechart.component.js.map +1 -1
- package/components/chart/basechart.props.js +12 -0
- package/components/chart/basechart.props.js.map +1 -1
- package/components/chart/basechart.styles.js.map +1 -1
- package/components/chart/bubble-chart/bubble-chart.component.js +72 -70
- package/components/chart/bubble-chart/bubble-chart.component.js.map +1 -1
- package/components/chart/bubble-chart/bubble-chart.props.js +1 -0
- package/components/chart/bubble-chart/bubble-chart.props.js.map +1 -1
- package/components/chart/line-chart/line-chart.component.js +105 -79
- package/components/chart/line-chart/line-chart.component.js.map +1 -1
- package/components/chart/pie-chart/pie-chart.component.js +70 -166
- package/components/chart/pie-chart/pie-chart.component.js.map +1 -1
- package/components/chart/pie-chart/pie-chart.props.js +1 -0
- package/components/chart/pie-chart/pie-chart.props.js.map +1 -1
- package/components/container/accordion/accordionpane/accordionpane.component.js +6 -2
- package/components/container/accordion/accordionpane/accordionpane.component.js.map +1 -1
- package/components/container/container.component.js +27 -1
- package/components/container/container.component.js.map +1 -1
- package/components/container/container.props.js +7 -0
- package/components/container/container.props.js.map +1 -1
- package/components/container/linearlayout/linearlayoutitem/linearlayoutitem.component.js +25 -1
- package/components/container/linearlayout/linearlayoutitem/linearlayoutitem.component.js.map +1 -1
- package/components/container/linearlayout/linearlayoutitem/linearlayoutitem.props.js +1 -0
- package/components/container/linearlayout/linearlayoutitem/linearlayoutitem.props.js.map +1 -1
- package/components/container/tabs/tabheader/tabheader.component.js +5 -14
- package/components/container/tabs/tabheader/tabheader.component.js.map +1 -1
- package/components/container/tabs/tabheader/tabheader.props.js +0 -2
- package/components/container/tabs/tabheader/tabheader.props.js.map +1 -1
- package/components/container/tabs/tabheader/tabheader.styles.js +1 -43
- package/components/container/tabs/tabheader/tabheader.styles.js.map +1 -1
- package/components/container/tabs/tabpane/tabpane.component.js +6 -2
- package/components/container/tabs/tabpane/tabpane.component.js.map +1 -1
- package/components/container/tabs/tabs.component.js +2 -6
- package/components/container/tabs/tabs.component.js.map +1 -1
- package/components/container/tabs/tabs.props.js +0 -2
- package/components/container/tabs/tabs.props.js.map +1 -1
- package/components/container/wizard/wizardstep/wizardstep.component.js +28 -5
- package/components/container/wizard/wizardstep/wizardstep.component.js.map +1 -1
- package/components/container/wizard/wizardstep/wizardstep.props.js +2 -0
- package/components/container/wizard/wizardstep/wizardstep.props.js.map +1 -1
- package/components/data/form/form-field/form-field.component.js +1 -0
- package/components/data/form/form-field/form-field.component.js.map +1 -1
- package/components/data/form/form-field/form-field.props.js +1 -0
- package/components/data/form/form-field/form-field.props.js.map +1 -1
- package/components/data/list/list-template/list-template.component.js +3 -0
- package/components/data/list/list-template/list-template.component.js.map +1 -1
- package/components/data/list/list.component.js +6 -4
- package/components/data/list/list.component.js.map +1 -1
- package/components/data/list/list.styles.js +1 -14
- package/components/data/list/list.styles.js.map +1 -1
- package/components/input/baseinput/baseinput.component.js +7 -0
- package/components/input/baseinput/baseinput.component.js.map +1 -1
- package/components/input/calendar/calendar.component.js +4 -0
- package/components/input/calendar/calendar.component.js.map +1 -1
- package/components/input/calendar/views/month-view.js +8 -1
- package/components/input/calendar/views/month-view.js.map +1 -1
- package/components/input/checkboxset/checkboxset.component.js.map +1 -1
- package/components/input/checkboxset/checkboxset.styles.js.map +1 -1
- package/components/input/chips/chips.component.js +3 -4
- package/components/input/chips/chips.component.js.map +1 -1
- package/components/input/chips/chips.styles.js +1 -2
- package/components/input/chips/chips.styles.js.map +1 -1
- package/components/input/currency/currency.component.js +1 -0
- package/components/input/currency/currency.component.js.map +1 -1
- package/components/input/number/number.component.js +1 -0
- package/components/input/number/number.component.js.map +1 -1
- package/components/input/switch/switch.component.js +2 -16
- package/components/input/switch/switch.component.js.map +1 -1
- package/components/input/switch/switch.props.js +0 -1
- package/components/input/switch/switch.props.js.map +1 -1
- package/components/input/switch/switch.styles.js +0 -19
- package/components/input/switch/switch.styles.js.map +1 -1
- package/components/input/text/text.component.js +14 -3
- package/components/input/text/text.component.js.map +1 -1
- package/components/input/text/text.props.js +1 -0
- package/components/input/text/text.props.js.map +1 -1
- package/components/input/text/text.styles.js +3 -1
- package/components/input/text/text.styles.js.map +1 -1
- package/components/input/textarea/textarea.component.js +3 -2
- package/components/input/textarea/textarea.component.js.map +1 -1
- package/components/input/toggle/toggle.component.js +4 -13
- package/components/input/toggle/toggle.component.js.map +1 -1
- package/components/input/toggle/toggle.props.js +1 -3
- package/components/input/toggle/toggle.props.js.map +1 -1
- package/components/input/toggle/toggle.styles.js +4 -12
- package/components/input/toggle/toggle.styles.js.map +1 -1
- package/components/navigation/appnavbar/appnavbar.props.js +1 -1
- package/components/navigation/appnavbar/appnavbar.props.js.map +1 -1
- package/components/page/page-content/page-content.component.js +3 -0
- package/components/page/page-content/page-content.component.js.map +1 -1
- package/components/page/page-content/page-content.props.js +2 -0
- package/components/page/page-content/page-content.props.js.map +1 -1
- package/components/page/page.component.js +95 -2
- package/components/page/page.component.js.map +1 -1
- package/components/page/page.props.js +3 -0
- package/components/page/page.props.js.map +1 -1
- package/components/page/tabbar/tabbar.component.js +3 -2
- package/components/page/tabbar/tabbar.component.js.map +1 -1
- package/components/page/tabbar/tabbar.props.js +1 -0
- package/components/page/tabbar/tabbar.props.js.map +1 -1
- package/components-prism/basic/search/search.component.js +8 -12
- package/components-prism/basic/search/search.component.js.map +1 -1
- package/components-prism/basic/search/search.props.js +1 -1
- package/components-prism/basic/search/search.props.js.map +1 -1
- package/components-prism/basic/search/search.styles.js +60 -25
- package/components-prism/basic/search/search.styles.js.map +1 -1
- package/core/AppConfig.js.map +1 -1
- package/core/accessibility.js +9 -0
- package/core/accessibility.js.map +1 -1
- package/core/auto-layout-host.component.js +8 -2
- package/core/auto-layout-host.component.js.map +1 -1
- package/core/auto-layout.utils.js +59 -0
- package/core/auto-layout.utils.js.map +1 -1
- package/core/base.component.js +22 -1
- package/core/base.component.js.map +1 -1
- package/core/components/floatinglabel.component.js +5 -2
- package/core/components/floatinglabel.component.js.map +1 -1
- package/core/components/textinput.component.js +3 -0
- package/core/components/textinput.component.js.map +1 -1
- package/core/network.service.js.map +1 -1
- package/core/tappable.component.js +109 -15
- package/core/tappable.component.js.map +1 -1
- package/npm-shrinkwrap.json +2835 -5858
- package/package-lock.json +2835 -5858
- package/package.json +25 -18
- package/runtime/base-fragment.component.js +7 -1
- package/runtime/base-fragment.component.js.map +1 -1
- package/runtime/base-page.component.js +24 -0
- package/runtime/base-page.component.js.map +1 -1
- package/runtime/base-partial.component.js.map +1 -1
- package/runtime/navigator/drawer.navigator.js +1 -0
- package/runtime/navigator/drawer.navigator.js.map +1 -1
- package/runtime/navigator/stack.navigator.js +16 -1
- package/runtime/navigator/stack.navigator.js.map +1 -1
- package/runtime/services/device/scan-service.js +12 -34
- package/runtime/services/device/scan-service.js.map +1 -1
- package/styles/theme.variables.js.map +1 -1
- package/variables/http.service.js +6 -1
- package/variables/http.service.js.map +1 -1
- package/variables/interceptor/intercept-context.impl.js +46 -0
- package/variables/interceptor/intercept-context.impl.js.map +1 -0
- package/variables/interceptor/interceptor.factory.js +78 -0
- package/variables/interceptor/interceptor.factory.js.map +1 -0
- package/variables/interceptor/persistent.storage.js +142 -0
- package/variables/interceptor/persistent.storage.js.map +1 -0
- package/variables/interceptor/service-variable-interceptor.js +52 -0
- package/variables/interceptor/service-variable-interceptor.js.map +1 -0
- package/variables/service-variable.js +109 -1
- package/variables/service-variable.js.map +1 -1
|
@@ -3,25 +3,20 @@ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object
|
|
|
3
3
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
4
4
|
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
5
5
|
import React from 'react';
|
|
6
|
-
import { View, Text
|
|
7
|
-
import { Svg } from 'react-native-svg';
|
|
6
|
+
import { View, Text } from 'react-native';
|
|
8
7
|
import { AccessibilityWidgetType, getAccessibilityProps } from '@wavemaker-ai/app-rn-runtime/core/accessibility';
|
|
9
|
-
import {
|
|
8
|
+
import { PieChart } from '@wavemaker/react-native-echarts';
|
|
10
9
|
import WmPieChartProps from './pie-chart.props';
|
|
11
10
|
import { DEFAULT_CLASS } from './pie-chart.styles';
|
|
12
|
-
import { formatCompactNumber } from '@wavemaker-ai/app-rn-runtime/core/utils';
|
|
13
11
|
import WmIcon from '@wavemaker-ai/app-rn-runtime/components/basic/icon/icon.component';
|
|
14
12
|
import { BaseChartComponent, BaseChartComponentState } from '@wavemaker-ai/app-rn-runtime/components/chart/basechart.component';
|
|
15
13
|
import WmDonutChartProps from '@wavemaker-ai/app-rn-runtime/components/chart/donut-chart/donut-chart.props';
|
|
16
|
-
import { Legend } from '../legend/legend.component';
|
|
17
14
|
export class WmPieChartState extends BaseChartComponentState {
|
|
18
15
|
constructor(...args) {
|
|
19
16
|
super(...args);
|
|
20
17
|
_defineProperty(this, "chartWidth", 0);
|
|
21
18
|
_defineProperty(this, "totalHeight", 0);
|
|
22
19
|
_defineProperty(this, "infoHeight", 10);
|
|
23
|
-
_defineProperty(this, "legendWidth", 0);
|
|
24
|
-
_defineProperty(this, "legendHeight", 0);
|
|
25
20
|
_defineProperty(this, "opacity", 0);
|
|
26
21
|
}
|
|
27
22
|
}
|
|
@@ -44,103 +39,61 @@ export default class WmPieChart extends BaseChartComponent {
|
|
|
44
39
|
opacity: 1
|
|
45
40
|
});
|
|
46
41
|
});
|
|
47
|
-
_defineProperty(this, "
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
{
|
|
62
|
-
return Math.round(d.y * 100 / this.state.total) + '%';
|
|
63
|
-
}
|
|
64
|
-
case 'key':
|
|
65
|
-
{
|
|
66
|
-
return this.state.xaxisDatakeyArr[d.x];
|
|
67
|
-
}
|
|
68
|
-
case 'value':
|
|
69
|
-
{
|
|
70
|
-
return formatCompactNumber(d.y);
|
|
42
|
+
_defineProperty(this, "onSelect", event => {
|
|
43
|
+
if (!this.state.props.dataset) return;
|
|
44
|
+
const {
|
|
45
|
+
dataIndex,
|
|
46
|
+
name,
|
|
47
|
+
value,
|
|
48
|
+
seriesIndex
|
|
49
|
+
} = event;
|
|
50
|
+
const selectedItem = this.props.dataset[dataIndex];
|
|
51
|
+
const selectedChartItem = {
|
|
52
|
+
data: {
|
|
53
|
+
x: name,
|
|
54
|
+
y: value,
|
|
55
|
+
_dataObj: selectedItem
|
|
71
56
|
}
|
|
72
|
-
case 'key-value':
|
|
73
|
-
{
|
|
74
|
-
return this.state.xaxisDatakeyArr[d.x] + ' ' + d.y;
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
onSelect(event, data) {
|
|
79
|
-
if (!this.viewRef.current) return;
|
|
80
|
-
if (!this.state.props.dataset) return;
|
|
81
|
-
this.viewRef.current.measureInWindow((chartX, chartY) => {
|
|
82
|
-
let value = data.slice.value;
|
|
83
|
-
let label = this.state.xaxisDatakeyArr[data.datum.x];
|
|
84
|
-
let selectedItem = this.props.dataset[data.index];
|
|
85
|
-
let selectedChartItem = data.slice;
|
|
86
|
-
selectedChartItem["data"] = {
|
|
87
|
-
x: label,
|
|
88
|
-
y: value,
|
|
89
|
-
color: data.style.fill,
|
|
90
|
-
_dataObj: selectedItem
|
|
91
57
|
};
|
|
92
|
-
const nativeEvent = event.nativeEvent;
|
|
93
|
-
let tooltipX = nativeEvent.pageX - chartX;
|
|
94
|
-
let tooltipY = nativeEvent.pageY - chartY;
|
|
95
58
|
this.updateState({
|
|
96
|
-
tooltipXaxis: label,
|
|
97
|
-
tooltipYaxis: value,
|
|
98
|
-
isTooltipOpen: true,
|
|
99
59
|
selectedItem: {
|
|
100
60
|
...selectedItem,
|
|
101
|
-
index:
|
|
102
|
-
}
|
|
103
|
-
tooltipXPosition: tooltipX - this.state.tooltipoffsetx,
|
|
104
|
-
tooltipYPosition: tooltipY - this.state.tooltipoffsety
|
|
61
|
+
index: dataIndex
|
|
62
|
+
}
|
|
105
63
|
});
|
|
106
|
-
this.invokeEventCallback('onSelect', [
|
|
64
|
+
this.invokeEventCallback('onSelect', [null, this.proxy, selectedItem, selectedChartItem]);
|
|
107
65
|
});
|
|
108
66
|
}
|
|
67
|
+
componentDidMount() {
|
|
68
|
+
super.componentDidMount();
|
|
69
|
+
}
|
|
109
70
|
renderWidget(props) {
|
|
110
|
-
var
|
|
71
|
+
var _props$tooltip;
|
|
111
72
|
this.invokeEventCallback('onBeforerender', [this.proxy, null]);
|
|
112
73
|
if (!this.state.data.length) {
|
|
113
74
|
return null;
|
|
114
75
|
}
|
|
115
76
|
const pieData = this.state.data[0];
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
if (props.showlabels === 'hide') {
|
|
123
|
-
styleProp = {
|
|
124
|
-
labels: {
|
|
125
|
-
display: "none"
|
|
126
|
-
}
|
|
127
|
-
};
|
|
128
|
-
} else if (props.showlabels === 'inside') {
|
|
129
|
-
labelRadius = radius / 2;
|
|
130
|
-
} else {
|
|
131
|
-
labelRadius = radius + 8;
|
|
132
|
-
}
|
|
133
|
-
const origin = {
|
|
134
|
-
x: chartWidth / 2,
|
|
135
|
-
y: chartHeight / 2
|
|
136
|
-
};
|
|
137
|
-
const orientation = props.showlegend === 'right' ? 'vertical' : 'horizontal';
|
|
138
|
-
let legendData = pieData.map((d, index) => {
|
|
139
|
-
return {
|
|
140
|
-
name: this.state.xaxisDatakeyArr[d.x],
|
|
77
|
+
|
|
78
|
+
// Build PieDataItem[] with per-slice colors embedded so RTL reversal keeps color-to-slice binding correct
|
|
79
|
+
const chartData = pieData.map((d, index) => ({
|
|
80
|
+
name: this.state.xaxisDatakeyArr[d.x],
|
|
81
|
+
value: d.y,
|
|
82
|
+
itemStyle: {
|
|
141
83
|
color: this.state.colors[index % this.state.colors.length]
|
|
142
|
-
}
|
|
143
|
-
});
|
|
84
|
+
}
|
|
85
|
+
}));
|
|
86
|
+
const orderedData = this.isRTL ? [...chartData].reverse() : chartData;
|
|
87
|
+
|
|
88
|
+
// Donut: [inner%, outer%] tuple; Pie: single percentage string
|
|
89
|
+
const radius = props.donutratio > 0 ? [`${Math.round(props.donutratio * 75)}%`, '75%'] : '75%';
|
|
90
|
+
const showLabel = props.showlabels !== 'hide';
|
|
91
|
+
const labelPosition = props.showlabels === 'inside' ? 'inside' : 'outside';
|
|
92
|
+
const labelFormat = props.labeltype === 'percent' ? 'percentage' : props.labeltype;
|
|
93
|
+
const showLegend = props.showlegend !== 'hide';
|
|
94
|
+
const legendPosition = ['top', 'bottom', 'left', 'right'].includes(props.showlegend) ? props.showlegend : 'bottom';
|
|
95
|
+
const chartWidth = this.state.chartWidth;
|
|
96
|
+
const chartHeight = (this.styles.root.height ? this.state.totalHeight : chartWidth) - this.state.infoHeight;
|
|
144
97
|
return /*#__PURE__*/React.createElement(View, _extends({
|
|
145
98
|
style: [{
|
|
146
99
|
opacity: this.state.opacity
|
|
@@ -163,89 +116,40 @@ export default class WmPieChart extends BaseChartComponent {
|
|
|
163
116
|
style: this.styles.title
|
|
164
117
|
}, props.title) : null) : null, props.subheading ? /*#__PURE__*/React.createElement(Text, {
|
|
165
118
|
style: this.styles.subHeading
|
|
166
|
-
}, props.subheading) : null),
|
|
167
|
-
onLayout: this.onLegendViewLayoutChange
|
|
168
|
-
}, /*#__PURE__*/React.createElement(Legend, {
|
|
169
|
-
data: legendData,
|
|
170
|
-
testStyle: this.styles.legendText,
|
|
171
|
-
dotStyle: this.styles.legenedDot
|
|
172
|
-
})) : null, /*#__PURE__*/React.createElement(View, {
|
|
173
|
-
style: {
|
|
174
|
-
flexDirection: 'row',
|
|
175
|
-
justifyContent: 'center',
|
|
176
|
-
alignItems: 'center'
|
|
177
|
-
}
|
|
178
|
-
}, this.getTooltip(), /*#__PURE__*/React.createElement(View, {
|
|
119
|
+
}, props.subheading) : null), /*#__PURE__*/React.createElement(View, {
|
|
179
120
|
style: {
|
|
180
|
-
|
|
121
|
+
position: 'relative'
|
|
181
122
|
},
|
|
182
123
|
ref: this.viewRef
|
|
183
|
-
}, chartWidth ? /*#__PURE__*/React.createElement(
|
|
124
|
+
}, chartWidth ? /*#__PURE__*/React.createElement(PieChart, {
|
|
125
|
+
data: orderedData,
|
|
184
126
|
width: chartWidth,
|
|
185
|
-
height: chartHeight
|
|
186
|
-
}, /*#__PURE__*/React.createElement(VictoryPie, {
|
|
187
|
-
style: {
|
|
188
|
-
...styleProp,
|
|
189
|
-
...((_this$state$labelColo = this.state.labelColors) !== null && _this$state$labelColo !== void 0 && _this$state$labelColo.length ? {
|
|
190
|
-
labels: {
|
|
191
|
-
fill: ({
|
|
192
|
-
index
|
|
193
|
-
}) => {
|
|
194
|
-
const labelColorScale = this.isRTL ? [...this.state.labelColors].slice(0, pieData.length).reverse() : this.state.labelColors;
|
|
195
|
-
return labelColorScale[index % labelColorScale.length];
|
|
196
|
-
}
|
|
197
|
-
}
|
|
198
|
-
} : {})
|
|
199
|
-
},
|
|
200
|
-
standalone: false,
|
|
201
|
-
colorScale: this.isRTL ? [...this.state.colors].slice(0, pieData.length).reverse() : this.state.colors,
|
|
202
|
-
labels: ({
|
|
203
|
-
datum
|
|
204
|
-
}) => this.getLabel(datum, props),
|
|
205
|
-
endAngle: this.state.endAngle || 0,
|
|
127
|
+
height: chartHeight,
|
|
206
128
|
radius: radius,
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
} : {
|
|
220
|
-
onPress: this.onSelect.bind(this)
|
|
221
|
-
}
|
|
222
|
-
}]
|
|
223
|
-
}), /*#__PURE__*/React.createElement(VictoryLabel, {
|
|
224
|
-
textAnchor: "middle",
|
|
225
|
-
style: {
|
|
226
|
-
...this.styles.centerLabel,
|
|
227
|
-
fill: this.styles.centerLabel.color
|
|
228
|
-
},
|
|
229
|
-
x: origin.x,
|
|
230
|
-
y: origin.y,
|
|
231
|
-
text: props.centerlabel
|
|
232
|
-
})) : null), props.showlegend === 'right' ? /*#__PURE__*/React.createElement(View, {
|
|
129
|
+
theme: this.getChartTheme(),
|
|
130
|
+
showLabel: showLabel,
|
|
131
|
+
labelPosition: labelPosition,
|
|
132
|
+
showLabelLine: props.showLabelLine,
|
|
133
|
+
showLegend: showLegend,
|
|
134
|
+
legendPosition: legendPosition,
|
|
135
|
+
renderTooltip: this.getRenderTooltip(),
|
|
136
|
+
tooltip: props.tooltips ? this.hasCustomTooltip ? 'none' : (_props$tooltip = props.tooltip) !== null && _props$tooltip !== void 0 ? _props$tooltip : 'card' : 'none',
|
|
137
|
+
showHighlighter: props.showhighlighter,
|
|
138
|
+
onSelect: this.onSelect
|
|
139
|
+
}) : null, props.centerlabel ? /*#__PURE__*/React.createElement(View, {
|
|
140
|
+
pointerEvents: "none",
|
|
233
141
|
style: {
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
}
|
|
243
|
-
|
|
244
|
-
},
|
|
245
|
-
data: legendData,
|
|
246
|
-
testStyle: this.styles.legendText,
|
|
247
|
-
dotStyle: this.styles.legenedDot
|
|
248
|
-
})) : null);
|
|
142
|
+
position: 'absolute',
|
|
143
|
+
top: 0,
|
|
144
|
+
left: 0,
|
|
145
|
+
right: 0,
|
|
146
|
+
bottom: 0,
|
|
147
|
+
justifyContent: 'center',
|
|
148
|
+
alignItems: 'center'
|
|
149
|
+
}
|
|
150
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
151
|
+
style: this.styles.centerLabel
|
|
152
|
+
}, props.centerlabel)) : null));
|
|
249
153
|
}
|
|
250
154
|
}
|
|
251
155
|
//# sourceMappingURL=pie-chart.component.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","View","Text","Platform","Svg","AccessibilityWidgetType","getAccessibilityProps","VictoryLabel","VictoryPie","WmPieChartProps","DEFAULT_CLASS","formatCompactNumber","WmIcon","BaseChartComponent","BaseChartComponentState","WmDonutChartProps","Legend","WmPieChartState","constructor","args","_defineProperty","WmPieChart","props","type","e","_e$nativeEvent","viewWidth","nativeEvent","layout","width","handleLayout","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","viewRef","current","dataset","measureInWindow","chartX","chartY","value","slice","label","datum","selectedItem","index","selectedChartItem","color","style","fill","_dataObj","tooltipX","pageX","tooltipY","pageY","tooltipXaxis","tooltipYaxis","isTooltipOpen","tooltipXPosition","tooltipoffsetx","tooltipYPosition","tooltipoffsety","invokeEventCallback","proxy","renderWidget","_this$state$labelColo","length","pieData","showlegend","chartHeight","styles","root","radius","min","innerRadius","donutratio","styleProp","labelRadius","showlabels","labels","display","origin","orientation","legendData","map","name","colors","createElement","_extends","LINECHART","onLayout","onViewLayoutChange","key","title","onInfoViewLayoutChange","iconclass","testID","flexDirection","alignItems","icon","subheading","subHeading","onLegendViewLayoutChange","testStyle","legendText","dotStyle","legenedDot","justifyContent","getTooltip","flex","ref","labelColors","labelColorScale","isRTL","reverse","standalone","colorScale","endAngle","theme","toReversed","labelPlacement","labelplacement","events","target","eventHandlers","OS","onClick","bind","onPress","textAnchor","centerLabel","text","centerlabel","maxWidth"],"sources":["pie-chart.component.tsx"],"sourcesContent":["import React from 'react';\nimport { LayoutChangeEvent, View, Text, Platform } from 'react-native';\nimport { Svg } from 'react-native-svg';\nimport { AccessibilityWidgetType, getAccessibilityProps } from '@wavemaker-ai/app-rn-runtime/core/accessibility';\n\nimport { VictoryLabel, VictoryPie } from 'victory-native';\n\nimport WmPieChartProps from './pie-chart.props';\nimport { DEFAULT_CLASS, WmPieChartStyles } from './pie-chart.styles';\n\nimport { formatCompactNumber, isWebPreviewMode } from '@wavemaker-ai/app-rn-runtime/core/utils';\nimport WmIcon from '@wavemaker-ai/app-rn-runtime/components/basic/icon/icon.component';\nimport {\n BaseChartComponent,\n BaseChartComponentState\n} from '@wavemaker-ai/app-rn-runtime/components/chart/basechart.component';\nimport WmDonutChartProps from '@wavemaker-ai/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\n this.handleLayout(e)\n\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 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.slice.value;\n let label = this.state.xaxisDatakeyArr[data.datum.x];\n let selectedItem = this.props.dataset[data.index];\n let selectedChartItem = data.slice;\n selectedChartItem[\"data\"] = {x: label, y: value, color: data.style.fill, _dataObj: selectedItem}\n const nativeEvent = event.nativeEvent;\n let tooltipX = nativeEvent.pageX - chartX;\n let tooltipY = nativeEvent.pageY - chartY;\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 any);\n this.invokeEventCallback('onSelect', [event.nativeEvent, this.proxy, selectedItem, selectedChartItem ]);\n });\n }\n\n renderWidget(props: WmPieChartProps) {\n this.invokeEventCallback('onBeforerender', [this.proxy, null]);\n if (!this.state.data.length) {\n return null;\n }\n const pieData = this.state.data[0];\n const chartWidth = this.state.chartWidth\n - (props.showlegend === 'right' ? this.state.legendWidth : 0);\n const chartHeight = (this.styles.root.height ? this.state.totalHeight : chartWidth)\n - this.state.infoHeight\n - (props.showlegend === 'right' ? 0 : this.state.legendHeight);\n let radius = (Math.min(chartWidth, chartHeight) - 40)/ 2;\n let innerRadius = props.donutratio * radius;\n let styleProp = {};\n let labelRadius;\n if (props.showlabels === 'hide') {\n styleProp={labels: { display: \"none\" }};\n } else if (props.showlabels === 'inside') {\n labelRadius = radius/2;\n } else {\n labelRadius = radius + 8;\n }\n const origin = {x: (chartWidth/2), y: (chartHeight/2)};\n const orientation = props.showlegend === 'right' ? 'vertical' : 'horizontal';\n let legendData = pieData.map((d: {x: any, y: any}, index: number) => {\n return {\n name: this.state.xaxisDatakeyArr[d.x],\n color: this.state.colors[index % (this.state.colors.length)]\n };\n });\n return (\n <View style={[{opacity: this.state.opacity}, this.styles.root]}\n {...getAccessibilityProps(AccessibilityWidgetType.LINECHART, props)}\n onLayout={this.onViewLayoutChange}\n key={`${props.title}_pie_chart`}\n >\n <View onLayout={this.onInfoViewLayoutChange}>\n { (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 {props.showlegend === 'top' ?\n (<View onLayout={this.onLegendViewLayoutChange}>\n <Legend data={legendData}\n testStyle={this.styles.legendText}\n dotStyle={this.styles.legenedDot}></Legend>\n </View>) : null }\n <View style={{flexDirection: 'row', justifyContent: 'center', alignItems: 'center'}}>\n {this.getTooltip()}\n <View style={{flex: 1}} ref={this.viewRef}>\n {chartWidth ? (\n <Svg\n width={chartWidth}\n height={chartHeight}\n >\n <VictoryPie\n style={{\n ...styleProp,\n ...(this.state.labelColors?.length ? {\n labels: {\n fill: ({ index }: any) => {\n const labelColorScale = this.isRTL\n ? [...this.state.labelColors].slice(0, pieData.length).reverse()\n : this.state.labelColors;\n return labelColorScale[index % labelColorScale.length];\n }\n }\n } : {})\n }}\n standalone={false}\n colorScale={this.isRTL ? [...this.state.colors].slice(0, pieData.length).reverse() : this.state.colors}\n labels={({datum}) => this.getLabel(datum, props)}\n endAngle={this.state.endAngle || 0}\n radius={radius}\n innerRadius={innerRadius}\n theme={this.state.theme}\n key={props.name}\n name={props.name}\n data={this.isRTL?pieData.toReversed():pieData}\n origin={origin}\n labelPlacement={props.labelplacement}\n labelRadius={labelRadius}\n events={[{\n target: 'data',\n eventHandlers: Platform.OS == \"web\" ? {\n onClick: this.onSelect.bind(this)\n }:{\n onPress: this.onSelect.bind(this)\n }\n }]}\n />\n <VictoryLabel\n textAnchor=\"middle\"\n style={{ ...this.styles.centerLabel, fill: this.styles.centerLabel.color }}\n x={origin.x} y={origin.y}\n text={props.centerlabel}\n />\n </Svg>) : null}\n </View>\n {props.showlegend === 'right' ?\n (<View style={{maxWidth: '50%'}} onLayout={this.onLegendViewLayoutChange}>\n <Legend data={legendData}\n testStyle={this.styles.legendText}\n dotStyle={this.styles.legenedDot}\n orientation='vertical'></Legend>\n </View>) : null }\n </View>\n {props.showlegend === 'bottom' ?\n (<View onLayout={this.onLegendViewLayoutChange}>\n <Legend data={legendData}\n testStyle={this.styles.legendText}\n dotStyle={this.styles.legenedDot}></Legend>\n </View>) : null }\n </View>\n );\n }\n}\n"],"mappings":";;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAA4BC,IAAI,EAAEC,IAAI,EAAEC,QAAQ,QAAQ,cAAc;AACtE,SAASC,GAAG,QAAQ,kBAAkB;AACtC,SAASC,uBAAuB,EAAEC,qBAAqB,QAAQ,iDAAiD;AAEhH,SAASC,YAAY,EAAEC,UAAU,QAAQ,gBAAgB;AAEzD,OAAOC,eAAe,MAAM,mBAAmB;AAC/C,SAASC,aAAa,QAA0B,oBAAoB;AAEpE,SAASC,mBAAmB,QAA0B,yCAAyC;AAC/F,OAAOC,MAAM,MAAM,mEAAmE;AACtF,SACEC,kBAAkB,EAClBC,uBAAuB,QAClB,mEAAmE;AAC1E,OAAOC,iBAAiB,MAAM,6EAA6E;AAC3G,SAASC,MAAM,QAAQ,4BAA4B;AAGnD,OAAO,MAAMC,eAAe,SAASH,uBAAuB,CAAkB;EAAAI,YAAA,GAAAC,IAAA;IAAA,SAAAA,IAAA;IAAAC,eAAA,qBAC/D,CAAC;IAAAA,eAAA,sBACA,CAAC;IAAAA,eAAA,qBACF,EAAE;IAAAA,eAAA,sBACD,CAAC;IAAAA,eAAA,uBACA,CAAC;IAAAA,eAAA,kBACN,CAAC;EAAA;AACb;AAEA,eAAe,MAAMC,UAAU,SAASR,kBAAkB,CAAqD;EAE7GK,WAAWA,CAACI,KAAsB,EAAE;IAClC,KAAK,CAACA,KAAK,EAAEZ,aAAa,EAAEY,KAAK,CAACC,IAAI,KAAK,OAAO,GAAG,IAAIR,iBAAiB,CAAC,CAAC,GAAG,IAAIN,eAAe,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4D,WAAW;QAAEjF,IAAI,EAAE,IAAI,CAACqB,MAAM,CAAC4D,WAAW,CAACnF;MAAM,CAAE;MAC3EjB,CAAC,EAAEmD,MAAM,CAACnD,CAAE;MAACJ,CAAC,EAAEuD,MAAM,CAACvD,CAAE;MACzByG,IAAI,EAAEnI,KAAK,CAACoI;IAAY,CACzB,CACE,CAAC,GAAI,IACN,CAAC,EACNpI,KAAK,CAACoE,UAAU,KAAK,OAAO,gBAC1B1F,KAAA,CAAA6G,aAAA,CAAC5G,IAAI;MAACqE,KAAK,EAAE;QAACqF,QAAQ,EAAE;MAAK,CAAE;MAAC3C,QAAQ,EAAE,IAAI,CAACY;IAAyB,gBACvE5H,KAAA,CAAA6G,aAAA,CAAC7F,MAAM;MAACuC,IAAI,EAAEkD,UAAW;MACvBoB,SAAS,EAAE,IAAI,CAACjC,MAAM,CAACkC,UAAW;MAClCC,QAAQ,EAAE,IAAI,CAACnC,MAAM,CAACoC,UAAW;MACjCxB,WAAW,EAAC;IAAU,CAAS,CAC7B,CAAC,GAAI,IACT,CAAC,EACNlF,KAAK,CAACoE,UAAU,KAAK,QAAQ,gBAC3B1F,KAAA,CAAA6G,aAAA,CAAC5G,IAAI;MAAC+G,QAAQ,EAAE,IAAI,CAACY;IAAyB,gBAC7C5H,KAAA,CAAA6G,aAAA,CAAC7F,MAAM;MAACuC,IAAI,EAAEkD,UAAW;MACvBoB,SAAS,EAAE,IAAI,CAACjC,MAAM,CAACkC,UAAW;MAClCC,QAAQ,EAAE,IAAI,CAACnC,MAAM,CAACoC;IAAW,CAAS,CACxC,CAAC,GAAI,IACT,CAAC;EAEX;AACF","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["React","View","Text","AccessibilityWidgetType","getAccessibilityProps","PieChart","WmPieChartProps","DEFAULT_CLASS","WmIcon","BaseChartComponent","BaseChartComponentState","WmDonutChartProps","WmPieChartState","constructor","args","_defineProperty","WmPieChart","props","type","e","_e$nativeEvent","viewWidth","nativeEvent","layout","width","handleLayout","updateState","chartWidth","totalHeight","height","_e$nativeEvent2","infoHeight","opacity","event","state","dataset","dataIndex","name","value","seriesIndex","selectedItem","selectedChartItem","data","x","y","_dataObj","index","invokeEventCallback","proxy","componentDidMount","renderWidget","_props$tooltip","length","pieData","chartData","map","d","xaxisDatakeyArr","itemStyle","color","colors","orderedData","isRTL","reverse","radius","donutratio","Math","round","showLabel","showlabels","labelPosition","labelFormat","labeltype","showLegend","showlegend","legendPosition","includes","chartHeight","styles","root","createElement","_extends","style","LINECHART","onLayout","onViewLayoutChange","key","title","onInfoViewLayoutChange","iconclass","testID","flexDirection","alignItems","icon","subheading","subHeading","position","ref","viewRef","theme","getChartTheme","showLabelLine","renderTooltip","getRenderTooltip","tooltip","tooltips","hasCustomTooltip","showHighlighter","showhighlighter","onSelect","centerlabel","pointerEvents","top","left","right","bottom","justifyContent","centerLabel"],"sources":["pie-chart.component.tsx"],"sourcesContent":["import React from 'react';\nimport { LayoutChangeEvent, View, Text } from 'react-native';\nimport { AccessibilityWidgetType, getAccessibilityProps } from '@wavemaker-ai/app-rn-runtime/core/accessibility';\n\nimport { PieChart, PieDataItem, PieChartSelectEvent } from '@wavemaker/react-native-echarts';\n\nimport WmPieChartProps from './pie-chart.props';\nimport { DEFAULT_CLASS, WmPieChartStyles } from './pie-chart.styles';\n\nimport WmIcon from '@wavemaker-ai/app-rn-runtime/components/basic/icon/icon.component';\nimport {\n BaseChartComponent,\n BaseChartComponentState\n} from '@wavemaker-ai/app-rn-runtime/components/chart/basechart.component';\nimport WmDonutChartProps from '@wavemaker-ai/app-rn-runtime/components/chart/donut-chart/donut-chart.props';\n\nexport class WmPieChartState extends BaseChartComponentState<WmPieChartProps> {\n chartWidth = 0;\n totalHeight = 0;\n infoHeight = 10;\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\n this.handleLayout(e)\n\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 onSelect = (event: PieChartSelectEvent): void => {\n if (!this.state.props.dataset) return;\n const { dataIndex, name, value, seriesIndex } = event; \n const selectedItem = this.props.dataset[dataIndex];\n const selectedChartItem = {\n data: { x: name, y: value, _dataObj: selectedItem }\n };\n this.updateState({\n selectedItem: { ...selectedItem, index: dataIndex },\n } as any);\n this.invokeEventCallback('onSelect', [null, this.proxy, selectedItem, selectedChartItem]);\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\n // Build PieDataItem[] with per-slice colors embedded so RTL reversal keeps color-to-slice binding correct\n const chartData: PieDataItem[] = pieData.map((d: {x: any, y: any}, index: number) => ({\n name: this.state.xaxisDatakeyArr[d.x],\n value: d.y,\n itemStyle: { color: this.state.colors[index % this.state.colors.length] }\n }));\n const orderedData = this.isRTL ? [...chartData].reverse() : chartData;\n\n // Donut: [inner%, outer%] tuple; Pie: single percentage string\n const radius: string | (string | number)[] = props.donutratio > 0\n ? [`${Math.round(props.donutratio * 75)}%`, '75%']\n : '75%';\n\n const showLabel = props.showlabels !== 'hide';\n const labelPosition: 'outside' | 'inside' | 'center' =\n props.showlabels === 'inside' ? 'inside' : 'outside';\n\n const labelFormat = props.labeltype === 'percent' ? 'percentage' : props.labeltype;\n\n const showLegend = props.showlegend !== 'hide';\n const legendPosition = (['top', 'bottom', 'left', 'right'].includes(props.showlegend)\n ? props.showlegend : 'bottom') as 'top' | 'bottom' | 'left' | 'right';\n\n const chartWidth = this.state.chartWidth;\n const chartHeight = (this.styles.root.height ? this.state.totalHeight : chartWidth)\n - this.state.infoHeight;\n\n return (\n <View style={[{opacity: this.state.opacity}, this.styles.root]}\n {...getAccessibilityProps(AccessibilityWidgetType.LINECHART, props)}\n onLayout={this.onViewLayoutChange}\n key={`${props.title}_pie_chart`}\n >\n <View onLayout={this.onInfoViewLayoutChange}>\n {(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} />) : 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>\n ) : null}\n </View>\n <View style={{position: 'relative'}} ref={this.viewRef}\n >\n {chartWidth ? (\n <PieChart\n data={orderedData}\n width={chartWidth}\n height={chartHeight}\n radius={radius}\n theme={this.getChartTheme()}\n showLabel={showLabel}\n labelPosition={labelPosition}\n showLabelLine={props.showLabelLine}\n showLegend={showLegend}\n legendPosition={legendPosition}\n renderTooltip={this.getRenderTooltip()}\n tooltip={props.tooltips ? (this.hasCustomTooltip ? 'none' : (props.tooltip ?? 'card')) : 'none'}\n showHighlighter={props.showhighlighter}\n onSelect={this.onSelect}\n />\n ) : null}\n {props.centerlabel ? (\n <View\n pointerEvents=\"none\"\n style={{\n position: 'absolute',\n top: 0, left: 0, right: 0, bottom: 0,\n justifyContent: 'center',\n alignItems: 'center',\n }}\n >\n <Text style={this.styles.centerLabel as any}>\n {props.centerlabel}\n </Text>\n </View>\n ) : null}\n </View>\n </View>\n );\n }\n}\n"],"mappings":";;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAA4BC,IAAI,EAAEC,IAAI,QAAQ,cAAc;AAC5D,SAASC,uBAAuB,EAAEC,qBAAqB,QAAQ,iDAAi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F,CAAC,GACL,IACA,CACF,CAAC;EAEX;AACF","ignoreList":[]}
|
|
@@ -9,6 +9,7 @@ export default class WmPieChartProps extends BaseChartComponentProps {
|
|
|
9
9
|
_defineProperty(this, "labelplacement", 'vertical');
|
|
10
10
|
_defineProperty(this, "centerlabel", '');
|
|
11
11
|
_defineProperty(this, "onSelect", void 0);
|
|
12
|
+
_defineProperty(this, "showLabelLine", true);
|
|
12
13
|
}
|
|
13
14
|
}
|
|
14
15
|
//# sourceMappingURL=pie-chart.props.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["BaseChartComponentProps","WmPieChartProps","constructor","args","_defineProperty"],"sources":["pie-chart.props.ts"],"sourcesContent":["import BaseChartComponentProps from '@wavemaker-ai/app-rn-runtime/components/chart/basechart.props';\
|
|
1
|
+
{"version":3,"names":["BaseChartComponentProps","WmPieChartProps","constructor","args","_defineProperty"],"sources":["pie-chart.props.ts"],"sourcesContent":["import BaseChartComponentProps from '@wavemaker-ai/app-rn-runtime/components/chart/basechart.props';\n\nexport default class WmPieChartProps extends BaseChartComponentProps {\n donutratio: number = 0;\n labelplacement: string = 'vertical';\n centerlabel = '';\n onSelect?: any;\n showLabelLine: boolean = true;\n}\n"],"mappings":";;;AAAA,OAAOA,uBAAuB,MAAM,+DAA+D;AAEnG,eAAe,MAAMC,eAAe,SAASD,uBAAuB,CAAC;EAAAE,YAAA,GAAAC,IAAA;IAAA,SAAAA,IAAA;IAAAC,eAAA,qBAC9C,CAAC;IAAAA,eAAA,yBACG,UAAU;IAAAA,eAAA,sBACrB,EAAE;IAAAA,eAAA;IAAAA,eAAA,wBAES,IAAI;EAAA;AAC/B","ignoreList":[]}
|
|
@@ -25,6 +25,10 @@ export default class WmAccordionpane extends BaseComponent {
|
|
|
25
25
|
isCollapsed() {
|
|
26
26
|
return this.state.collapsed;
|
|
27
27
|
}
|
|
28
|
+
hasOwnFillHugResolution() {
|
|
29
|
+
var _this$parent;
|
|
30
|
+
return isAutoLayout(extractAutoLayoutProps(this.state.props, (_this$parent = this.parent) === null || _this$parent === void 0 || (_this$parent = _this$parent.state) === null || _this$parent === void 0 ? void 0 : _this$parent.props));
|
|
31
|
+
}
|
|
28
32
|
show() {
|
|
29
33
|
this.updateState({
|
|
30
34
|
collapsed: false
|
|
@@ -74,8 +78,8 @@ export default class WmAccordionpane extends BaseComponent {
|
|
|
74
78
|
return props.children;
|
|
75
79
|
}
|
|
76
80
|
renderWidget(props) {
|
|
77
|
-
var _this$
|
|
78
|
-
const autoLayoutProps = extractAutoLayoutProps(props, (_this$
|
|
81
|
+
var _this$parent2;
|
|
82
|
+
const autoLayoutProps = extractAutoLayoutProps(props, (_this$parent2 = this.parent) === null || _this$parent2 === void 0 || (_this$parent2 = _this$parent2.state) === null || _this$parent2 === void 0 ? void 0 : _this$parent2.props);
|
|
79
83
|
const hasAutoLayout = isAutoLayout(autoLayoutProps);
|
|
80
84
|
const shouldScroll = !hasAutoLayout || autoLayoutProps.overflow === 'scroll';
|
|
81
85
|
const autoLayoutDirectionStyle = hasAutoLayout ? getDirectionStyle(autoLayoutProps) : {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","BaseComponent","BaseComponentState","extractAutoLayoutProps","getContentContainerStyle","getDirectionStyle","getDimensionStyle","isAutoLayout","AutoLayoutHost","WmAccordionpaneProps","DEFAULT_CLASS","View","isWebPreviewMode","CollapsiblePane","WmAccordionpaneState","constructor","args","_defineProperty","WmAccordionpane","props","isCollapsed","state","collapsed","show","updateState","invokeEventCallback","proxy","hide","expand","parent","name","collapse","componentDidMount","accordion","addAccordionPane","componentWillUnmount","removeAccordionPane","onPartialLoad","renderContent","renderPartial","isPartialLoaded","setTimeout","bind","children","renderWidget","_this$parent","autoLayoutProps","hasAutoLayout","shouldScroll","overflow","autoLayoutDirectionStyle","autoLayoutContentStyle","autoLayoutOuterDimensionStyle","styles","root","autoLayoutInnerDimensionStyle","createElement","containerStyle","maxHeight","padding","contentStyle","minWidth","undefined","_background","style","close"],"sources":["accordionpane.component.tsx"],"sourcesContent":["import React, { useCallback, useMemo, useState } from 'react';\nimport { BaseComponent, BaseComponentState } from '@wavemaker-ai/app-rn-runtime/core/base.component';\nimport {extractAutoLayoutProps, getContentContainerStyle, getDirectionStyle, getDimensionStyle, isAutoLayout} from '@wavemaker-ai/app-rn-runtime/core/auto-layout.utils';\nimport { AutoLayoutHost } from '@wavemaker-ai/app-rn-runtime/core/auto-layout-host.component';\n\nimport WmAccordionpaneProps from './accordionpane.props';\nimport { DEFAULT_CLASS, WmAccordionpaneStyles } from './accordionpane.styles';\nimport WmAccordion from '../accordion.component';\nimport { View } from 'react-native';\nimport { isWebPreviewMode } from '@wavemaker-ai/app-rn-runtime/core/utils';\nimport { CollapsiblePane } from '../../panel/collapsible-pane.component';\n\nexport class WmAccordionpaneState extends BaseComponentState<WmAccordionpaneProps> {\n isPartialLoaded = false;\n collapsed = true;\n}\n\nexport default class WmAccordionpane extends BaseComponent<WmAccordionpaneProps, WmAccordionpaneState, WmAccordionpaneStyles> {\n public paneId: string = \"\";\n constructor(props: WmAccordionpaneProps) {\n super(props, DEFAULT_CLASS, new WmAccordionpaneProps(), new WmAccordionpaneState());\n }\n\n isCollapsed() {\n return this.state.collapsed;\n }\n\n show() {\n this.updateState({\n collapsed: false\n } as WmAccordionpaneState);\n this.invokeEventCallback('onExpand', [null, this.proxy]);\n }\n\n hide() {\n this.updateState({\n collapsed: true\n } as WmAccordionpaneState);\n this.invokeEventCallback('onCollapse', [null, this.proxy]);\n }\n\n expand() {\n (this.parent as WmAccordion).expand(this.props.name || '');\n }\n\n collapse() {\n (this.parent as WmAccordion).expand(this.props.name || '');\n }\n\n componentDidMount() {\n const accordion = (this.parent) as WmAccordion;\n // When skeleton is enabled in the accordion component, the parent would be WMSkeleton which doesnot have addAccordionPane function\n if(accordion.addAccordionPane) {\n accordion.addAccordionPane(this);\n }\n super.componentDidMount();\n }\n\n componentWillUnmount() {\n const accordion = (this.parent) as WmAccordion;\n if(accordion.removeAccordionPane) {\n accordion.removeAccordionPane(this);\n }\n }\n\n onPartialLoad() {\n this.invokeEventCallback('onLoad', [this]);\n }\n\n renderContent(props: WmAccordionpaneProps) {\n if (props.renderPartial) {\n if (!this.state.isPartialLoaded) {\n setTimeout(() => {\n this.updateState({\n isPartialLoaded: true\n } as WmAccordionpaneState);\n });\n }\n return props.renderPartial(props, this.onPartialLoad.bind(this));\n }\n return props.children;\n }\n renderWidget(props: WmAccordionpaneProps) {\n const autoLayoutProps = extractAutoLayoutProps(\n props,\n this.parent?.state?.props\n );\n const hasAutoLayout = isAutoLayout(autoLayoutProps);\n const shouldScroll = !hasAutoLayout || autoLayoutProps.overflow === 'scroll';\n const autoLayoutDirectionStyle = hasAutoLayout ? getDirectionStyle(autoLayoutProps) : {};\n const autoLayoutContentStyle = hasAutoLayout ? getContentContainerStyle(autoLayoutProps) : {};\n const autoLayoutOuterDimensionStyle = hasAutoLayout ? getDimensionStyle(autoLayoutProps, this.styles.root) : {};\n const autoLayoutInnerDimensionStyle = hasAutoLayout ? getDimensionStyle(autoLayoutProps, this.styles.root, true) : {};\n\n return isWebPreviewMode() ?\n (<AutoLayoutHost\n autoLayoutProps={autoLayoutProps}\n shouldScroll={shouldScroll}\n containerStyle={[\n this.styles.root,\n hasAutoLayout ? { ...autoLayoutDirectionStyle, ...autoLayoutOuterDimensionStyle } : {},\n this.state.collapsed ? { maxHeight: 0, overflow: 'hidden', padding: 0 } : {},\n ]}\n contentStyle={hasAutoLayout ? {\n ...autoLayoutDirectionStyle,\n ...autoLayoutContentStyle,\n ...autoLayoutInnerDimensionStyle,\n minWidth: 0,\n } : undefined}\n >\n {this._background}\n {this.renderContent(props)}\n </AutoLayoutHost>) :\n (<View style={[this.styles.root, hasAutoLayout ? { ...autoLayoutDirectionStyle, ...autoLayoutOuterDimensionStyle } : {}]}>\n <CollapsiblePane close={this.state.collapsed}>\n <AutoLayoutHost\n autoLayoutProps={autoLayoutProps}\n shouldScroll={shouldScroll}\n containerStyle={hasAutoLayout ? autoLayoutInnerDimensionStyle : undefined}\n contentStyle={hasAutoLayout ? {\n ...autoLayoutDirectionStyle,\n ...autoLayoutContentStyle,\n minWidth: 0,\n } : undefined}\n >\n {this._background}\n {this.renderContent(props)}\n </AutoLayoutHost>\n </CollapsiblePane>\n </View>);\n }\n}\n"],"mappings":";;;AAAA,OAAOA,KAAK,MAA0C,OAAO;AAC7D,SAASC,aAAa,EAAEC,kBAAkB,QAAQ,kDAAkD;AACpG,SAAQC,sBAAsB,EAAEC,wBAAwB,EAAEC,iBAAiB,EAAEC,iBAAiB,EAAEC,YAAY,QAAO,qDAAqD;AACxK,SAASC,cAAc,QAAQ,8DAA8D;AAE7F,OAAOC,oBAAoB,MAAM,uBAAuB;AACxD,SAASC,aAAa,QAA+B,wBAAwB;AAE7E,SAASC,IAAI,QAAQ,cAAc;AACnC,SAASC,gBAAgB,QAAQ,yCAAyC;AAC1E,SAASC,eAAe,QAAQ,wCAAwC;AAExE,OAAO,MAAMC,oBAAoB,SAASZ,kBAAkB,CAAuB;EAAAa,YAAA,GAAAC,IAAA;IAAA,SAAAA,IAAA;IAAAC,eAAA,0BAC/D,KAAK;IAAAA,eAAA,oBACX,IAAI;EAAA;AAClB;AAEA,eAAe,MAAMC,eAAe,SAASjB,aAAa,CAAoE;EAE5Hc,WAAWA,CAACI,KAA2B,EAAE;IACvC,KAAK,CAACA,KAAK,EAAET,aAAa,EAAE,IAAID,oBAAoB,CAAC,CAAC,EAAE,IAAIK,oBAAoB,CAAC,CAAC,CAAC;IAACG,eAAA,iBAF9D,EAAE;EAG1B;EAEAG,WAAWA,CAAA,EAAG;IACZ,OAAO,IAAI,CAACC,KAAK,CAACC,SAAS;EAC7B;EAEAC,IAAIA,CAAA,EAAG;IACL,IAAI,CAACC,WAAW,CAAC;MACfF,SAAS,EAAE;IACb,CAAyB,CAAC;IAC1B,IAAI,CAACG,mBAAmB,CAAC,UAAU,EAAE,CAAC,IAAI,EAAE,IAAI,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,CAAC,EACtF,IAAI,CAAC/B,KAAK,CAACC,SAAS,GAAG;QAAEoC,SAAS,EAAE,CAAC;QAAET,QAAQ,EAAE,QAAQ;QAAEU,OAAO,EAAE;MAAE,CAAC,GAAG,CAAC,CAAC,CAC5E;MACFC,YAAY,EAAEb,aAAa,GAAG;QAC5B,GAAGG,wBAAwB;QAC3B,GAAGC,sBAAsB;QACzB,GAAGI,6BAA6B;QAChCM,QAAQ,EAAE;MACZ,CAAC,GAAGC;IAAU,GAEb,IAAI,CAACC,WAAW,EAChB,IAAI,CAACzB,aAAa,CAACnB,KAAK,CACX,CAAC,gBAChBnB,KAAA,CAAAwD,aAAA,CAAC7C,IAAI;MAACqD,KAAK,EAAE,CAAC,IAAI,CAACX,MAAM,CAACC,IAAI,EAAEP,aAAa,GAAG;QAAE,GAAGG,wBAAwB;QAAE,GAAGE;MAA8B,CAAC,GAAG,CAAC,CAAC;IAAE,gBACvHpD,KAAA,CAAAwD,aAAA,CAAC3C,eAAe;MAACoD,KAAK,EAAE,IAAI,CAAC5C,KAAK,CAACC;IAAU,gBAC3CtB,KAAA,CAAAwD,aAAA,CAAChD,cAAc;MACbsC,eAAe,EAAEA,eAAgB;MACjCE,YAAY,EAAEA,YAAa;MAC3BS,cAAc,EAAEV,aAAa,GAAGQ,6BAA6B,GAAGO,SAAU;MAC1EF,YAAY,EAAEb,aAAa,GAAG;QAC5B,GAAGG,wBAAwB;QAC3B,GAAGC,sBAAsB;QACzBU,QAAQ,EAAE;MACZ,CAAC,GAAGC;IAAU,GAEb,IAAI,CAACC,WAAW,EAChB,IAAI,CAACzB,aAAa,CAACnB,KAAK,CACX,CACD,CACb,CAAE;EACV;AACF","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["React","BaseComponent","BaseComponentState","extractAutoLayoutProps","getContentContainerStyle","getDirectionStyle","getDimensionStyle","isAutoLayout","AutoLayoutHost","WmAccordionpaneProps","DEFAULT_CLASS","View","isWebPreviewMode","CollapsiblePane","WmAccordionpaneState","constructor","args","_defineProperty","WmAccordionpane","props","isCollapsed","state","collapsed","hasOwnFillHugResolution","_this$parent","parent","show","updateState","invokeEventCallback","proxy","hide","expand","name","collapse","componentDidMount","accordion","addAccordionPane","componentWillUnmount","removeAccordionPane","onPartialLoad","renderContent","renderPartial","isPartialLoaded","setTimeout","bind","children","renderWidget","_this$parent2","autoLayoutProps","hasAutoLayout","shouldScroll","overflow","autoLayoutDirectionStyle","autoLayoutContentStyle","autoLayoutOuterDimensionStyle","styles","root","autoLayoutInnerDimensionStyle","createElement","containerStyle","maxHeight","padding","contentStyle","minWidth","undefined","_background","style","close"],"sources":["accordionpane.component.tsx"],"sourcesContent":["import React, { useCallback, useMemo, useState } from 'react';\nimport { BaseComponent, BaseComponentState } from '@wavemaker-ai/app-rn-runtime/core/base.component';\nimport {extractAutoLayoutProps, getContentContainerStyle, getDirectionStyle, getDimensionStyle, isAutoLayout} from '@wavemaker-ai/app-rn-runtime/core/auto-layout.utils';\nimport { AutoLayoutHost } from '@wavemaker-ai/app-rn-runtime/core/auto-layout-host.component';\n\nimport WmAccordionpaneProps from './accordionpane.props';\nimport { DEFAULT_CLASS, WmAccordionpaneStyles } from './accordionpane.styles';\nimport WmAccordion from '../accordion.component';\nimport { View } from 'react-native';\nimport { isWebPreviewMode } from '@wavemaker-ai/app-rn-runtime/core/utils';\nimport { CollapsiblePane } from '../../panel/collapsible-pane.component';\n\nexport class WmAccordionpaneState extends BaseComponentState<WmAccordionpaneProps> {\n isPartialLoaded = false;\n collapsed = true;\n}\n\nexport default class WmAccordionpane extends BaseComponent<WmAccordionpaneProps, WmAccordionpaneState, WmAccordionpaneStyles> {\n public paneId: string = \"\";\n constructor(props: WmAccordionpaneProps) {\n super(props, DEFAULT_CLASS, new WmAccordionpaneProps(), new WmAccordionpaneState());\n }\n\n isCollapsed() {\n return this.state.collapsed;\n }\n\n protected hasOwnFillHugResolution(): boolean {\n return isAutoLayout(extractAutoLayoutProps(this.state.props, this.parent?.state?.props));\n }\n\n show() {\n this.updateState({\n collapsed: false\n } as WmAccordionpaneState);\n this.invokeEventCallback('onExpand', [null, this.proxy]);\n }\n\n hide() {\n this.updateState({\n collapsed: true\n } as WmAccordionpaneState);\n this.invokeEventCallback('onCollapse', [null, this.proxy]);\n }\n\n expand() {\n (this.parent as WmAccordion).expand(this.props.name || '');\n }\n\n collapse() {\n (this.parent as WmAccordion).expand(this.props.name || '');\n }\n\n componentDidMount() {\n const accordion = (this.parent) as WmAccordion;\n // When skeleton is enabled in the accordion component, the parent would be WMSkeleton which doesnot have addAccordionPane function\n if(accordion.addAccordionPane) {\n accordion.addAccordionPane(this);\n }\n super.componentDidMount();\n }\n\n componentWillUnmount() {\n const accordion = (this.parent) as WmAccordion;\n if(accordion.removeAccordionPane) {\n accordion.removeAccordionPane(this);\n }\n }\n\n onPartialLoad() {\n this.invokeEventCallback('onLoad', [this]);\n }\n\n renderContent(props: WmAccordionpaneProps) {\n if (props.renderPartial) {\n if (!this.state.isPartialLoaded) {\n setTimeout(() => {\n this.updateState({\n isPartialLoaded: true\n } as WmAccordionpaneState);\n });\n }\n return props.renderPartial(props, this.onPartialLoad.bind(this));\n }\n return props.children;\n }\n renderWidget(props: WmAccordionpaneProps) {\n const autoLayoutProps = extractAutoLayoutProps(\n props,\n this.parent?.state?.props\n );\n const hasAutoLayout = isAutoLayout(autoLayoutProps);\n const shouldScroll = !hasAutoLayout || autoLayoutProps.overflow === 'scroll';\n const autoLayoutDirectionStyle = hasAutoLayout ? getDirectionStyle(autoLayoutProps) : {};\n const autoLayoutContentStyle = hasAutoLayout ? getContentContainerStyle(autoLayoutProps) : {};\n const autoLayoutOuterDimensionStyle = hasAutoLayout ? getDimensionStyle(autoLayoutProps, this.styles.root) : {};\n const autoLayoutInnerDimensionStyle = hasAutoLayout ? getDimensionStyle(autoLayoutProps, this.styles.root, true) : {};\n\n return isWebPreviewMode() ?\n (<AutoLayoutHost\n autoLayoutProps={autoLayoutProps}\n shouldScroll={shouldScroll}\n containerStyle={[\n this.styles.root,\n hasAutoLayout ? { ...autoLayoutDirectionStyle, ...autoLayoutOuterDimensionStyle } : {},\n this.state.collapsed ? { maxHeight: 0, overflow: 'hidden', padding: 0 } : {},\n ]}\n contentStyle={hasAutoLayout ? {\n ...autoLayoutDirectionStyle,\n ...autoLayoutContentStyle,\n ...autoLayoutInnerDimensionStyle,\n minWidth: 0,\n } : undefined}\n >\n {this._background}\n {this.renderContent(props)}\n </AutoLayoutHost>) :\n (<View style={[this.styles.root, hasAutoLayout ? { ...autoLayoutDirectionStyle, ...autoLayoutOuterDimensionStyle } : {}]}>\n <CollapsiblePane close={this.state.collapsed}>\n <AutoLayoutHost\n autoLayoutProps={autoLayoutProps}\n shouldScroll={shouldScroll}\n containerStyle={hasAutoLayout ? autoLayoutInnerDimensionStyle : undefined}\n contentStyle={hasAutoLayout ? {\n ...autoLayoutDirectionStyle,\n ...autoLayoutContentStyle,\n minWidth: 0,\n } : undefined}\n >\n {this._background}\n {this.renderContent(props)}\n </AutoLayoutHost>\n </CollapsiblePane>\n </View>);\n }\n}\n"],"mappings":";;;AAAA,OAAOA,KAAK,MAA0C,OAAO;AAC7D,SAASC,aAAa,EAAEC,kBAAkB,QAAQ,kDAAkD;AACpG,SAAQC,sBAAsB,EAAEC,wBAAwB,EAAEC,iBAAiB,EAAEC,iBAAiB,EAAEC,YAAY,QAAO,qDAAqD;AACxK,SAASC,cAAc,QAAQ,8DAA8D;AAE7F,OAAOC,oBAAoB,MAAM,uBAAuB;AACxD,SAASC,aAAa,QAA+B,wBAAwB;AAE7E,SAASC,IAAI,QAAQ,cAAc;AACnC,SAASC,gBAAgB,QAAQ,yCAAyC;AAC1E,SAASC,eAAe,QAAQ,wCAAwC;AAExE,OAAO,MAAMC,oBAAoB,SAASZ,kBAAkB,CAAuB;EAAAa,YAAA,GAAAC,IAAA;IAAA,SAAAA,IAAA;IAAAC,eAAA,0BAC/D,KAAK;IAAAA,eAAA,oBACX,IAAI;EAAA;AAClB;AAEA,eAAe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,GAAGG,wBAAwB;QAAE,GAAGE;MAA8B,CAAC,GAAG,CAAC,CAAC;IAAE,gBACvHtD,KAAA,CAAA0D,aAAA,CAAC7C,eAAe;MAACsD,KAAK,EAAE,IAAI,CAAC9C,KAAK,CAACC;IAAU,gBAC3CtB,KAAA,CAAA0D,aAAA,CAAClD,cAAc;MACbwC,eAAe,EAAEA,eAAgB;MACjCE,YAAY,EAAEA,YAAa;MAC3BS,cAAc,EAAEV,aAAa,GAAGQ,6BAA6B,GAAGO,SAAU;MAC1EF,YAAY,EAAEb,aAAa,GAAG;QAC5B,GAAGG,wBAAwB;QAC3B,GAAGC,sBAAsB;QACzBU,QAAQ,EAAE;MACZ,CAAC,GAAGC;IAAU,GAEb,IAAI,CAACC,WAAW,EAChB,IAAI,CAACzB,aAAa,CAACrB,KAAK,CACX,CACD,CACb,CAAE;EACV;AACF","ignoreList":[]}
|
|
@@ -28,6 +28,7 @@ export default class WmContainer extends PartialHost {
|
|
|
28
28
|
constructor(props) {
|
|
29
29
|
super(props, DEFAULT_CLASS, new WmContainerProps(), new WmContainerState());
|
|
30
30
|
_defineProperty(this, "containerRef", void 0);
|
|
31
|
+
_defineProperty(this, "scrollViewRef", /*#__PURE__*/React.createRef());
|
|
31
32
|
_defineProperty(this, "stickyContainerOpacity", void 0);
|
|
32
33
|
_defineProperty(this, "appConfig", injector.get('APP_CONFIG'));
|
|
33
34
|
_defineProperty(this, "insets", {
|
|
@@ -36,6 +37,20 @@ export default class WmContainer extends PartialHost {
|
|
|
36
37
|
left: 0,
|
|
37
38
|
right: 0
|
|
38
39
|
});
|
|
40
|
+
_defineProperty(this, "handleOnScrollEndDrag", event => {
|
|
41
|
+
var _event$nativeEvent;
|
|
42
|
+
const currentY = event === null || event === void 0 || (_event$nativeEvent = event.nativeEvent) === null || _event$nativeEvent === void 0 || (_event$nativeEvent = _event$nativeEvent.contentOffset) === null || _event$nativeEvent === void 0 ? void 0 : _event$nativeEvent.y;
|
|
43
|
+
if (currentY > 0) {
|
|
44
|
+
this.invokeEventCallback('onScroll', [null, this.proxy]);
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
_defineProperty(this, "handleOnMomentumScrollEnd", event => {
|
|
48
|
+
var _event$nativeEvent2;
|
|
49
|
+
const currentY = event === null || event === void 0 || (_event$nativeEvent2 = event.nativeEvent) === null || _event$nativeEvent2 === void 0 || (_event$nativeEvent2 = _event$nativeEvent2.contentOffset) === null || _event$nativeEvent2 === void 0 ? void 0 : _event$nativeEvent2.y;
|
|
50
|
+
if (currentY < 1) {
|
|
51
|
+
this.invokeEventCallback('onScrolltotop', [null, this.proxy]);
|
|
52
|
+
}
|
|
53
|
+
});
|
|
39
54
|
this.containerRef = /*#__PURE__*/React.createRef();
|
|
40
55
|
this.stickyContainerOpacity = new Animated.Value(1);
|
|
41
56
|
this.subscribe('updateStickyHeaders', _event => {
|
|
@@ -53,6 +68,9 @@ export default class WmContainer extends PartialHost {
|
|
|
53
68
|
var _this$parent;
|
|
54
69
|
return extractAutoLayoutProps(this.props, (_this$parent = this.parent) === null || _this$parent === void 0 || (_this$parent = _this$parent.state) === null || _this$parent === void 0 ? void 0 : _this$parent.props);
|
|
55
70
|
}
|
|
71
|
+
hasOwnFillHugResolution() {
|
|
72
|
+
return checkAutoLayout(this.getAutoLayoutProps());
|
|
73
|
+
}
|
|
56
74
|
renderSkeleton(props) {
|
|
57
75
|
if (!props.showskeletonchildren) {
|
|
58
76
|
var _this$props;
|
|
@@ -102,6 +120,10 @@ export default class WmContainer extends PartialHost {
|
|
|
102
120
|
useNativeDriver: true
|
|
103
121
|
}).start();
|
|
104
122
|
}
|
|
123
|
+
//emiting container wdiget scrollview ref value to bottom sheet widget(bottom sheet sticky header/footer feature)
|
|
124
|
+
if (this.scrollViewRef.current) {
|
|
125
|
+
this.notify('containerScrollViewReady', [this.scrollViewRef], true);
|
|
126
|
+
}
|
|
105
127
|
}
|
|
106
128
|
renderStickyContent(props, dimensions, styles) {
|
|
107
129
|
const {
|
|
@@ -185,7 +207,11 @@ export default class WmContainer extends PartialHost {
|
|
|
185
207
|
...autoLayoutStyle,
|
|
186
208
|
minWidth: 0
|
|
187
209
|
} : {}],
|
|
188
|
-
onScroll: event => this.notify('scroll', [event])
|
|
210
|
+
onScroll: event => this.notify('scroll', [event]),
|
|
211
|
+
scrollEventThrottle: 48,
|
|
212
|
+
ref: this.scrollViewRef,
|
|
213
|
+
onScrollEndDrag: this.handleOnScrollEndDrag,
|
|
214
|
+
onMomentumScrollEnd: this.handleOnMomentumScrollEnd
|
|
189
215
|
}, this.renderContent(props))));
|
|
190
216
|
});
|
|
191
217
|
}
|