@wavemaker/app-rn-runtime 11.5.1-rc.5402 → 11.5.2-rc.5404
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.
- app-rn-runtime/components/advanced/carousel/carousel.component.js +110 -29
- app-rn-runtime/components/advanced/carousel/carousel.component.js.map +1 -1
- app-rn-runtime/components/advanced/carousel/carousel.styles.js +7 -3
- app-rn-runtime/components/advanced/carousel/carousel.styles.js.map +1 -1
- app-rn-runtime/components/basic/label/label.component.js +0 -1
- app-rn-runtime/components/basic/label/label.component.js.map +1 -1
- app-rn-runtime/components/basic/progress-bar/progress-bar.component.js +0 -1
- app-rn-runtime/components/basic/progress-bar/progress-bar.component.js.map +1 -1
- app-rn-runtime/components/chart/line-chart/line-chart.component.js +6 -31
- app-rn-runtime/components/chart/line-chart/line-chart.component.js.map +1 -1
- app-rn-runtime/components/chart/line-chart/line-chart.props.js +0 -1
- app-rn-runtime/components/chart/line-chart/line-chart.props.js.map +1 -1
- app-rn-runtime/components/chart/stack-chart/stack-chart.component.js +2 -2
- app-rn-runtime/components/chart/stack-chart/stack-chart.component.js.map +1 -1
- app-rn-runtime/components/container/tabs/tabheader/tabheader.component.js +21 -10
- app-rn-runtime/components/container/tabs/tabheader/tabheader.component.js.map +1 -1
- app-rn-runtime/components/container/tabs/tabheader/tabheader.styles.js +6 -5
- app-rn-runtime/components/container/tabs/tabheader/tabheader.styles.js.map +1 -1
- app-rn-runtime/components/container/tabs/tabs.component.js +14 -8
- app-rn-runtime/components/container/tabs/tabs.component.js.map +1 -1
- app-rn-runtime/components/container/tabs/tabs.styles.js +1 -0
- app-rn-runtime/components/container/tabs/tabs.styles.js.map +1 -1
- app-rn-runtime/components/input/slider/slider.component.js +6 -1
- app-rn-runtime/components/input/slider/slider.component.js.map +1 -1
- app-rn-runtime/components/input/slider/slider.styles.js +3 -1
- app-rn-runtime/components/input/slider/slider.styles.js.map +1 -1
- app-rn-runtime/components/navigation/appnavbar/appnavbar.component.js +9 -1
- app-rn-runtime/components/navigation/appnavbar/appnavbar.component.js.map +1 -1
- app-rn-runtime/gestures/swipe.animation.js +53 -5
- app-rn-runtime/gestures/swipe.animation.js.map +1 -1
- app-rn-runtime/package.json +3 -3
|
@@ -2,8 +2,8 @@ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key i
|
|
|
2
2
|
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
3
3
|
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
4
4
|
import React from 'react';
|
|
5
|
-
import { isArray } from 'lodash-es';
|
|
6
|
-
import { Animated, View } from 'react-native';
|
|
5
|
+
import { isArray, isUndefined } from 'lodash-es';
|
|
6
|
+
import { Animated, Easing, View } from 'react-native';
|
|
7
7
|
import { DefaultKeyExtractor } from '@wavemaker/app-rn-runtime/core/key.extractor';
|
|
8
8
|
import WmIcon from '@wavemaker/app-rn-runtime/components/basic/icon/icon.component';
|
|
9
9
|
import { BaseComponent, BaseComponentState } from '@wavemaker/app-rn-runtime/core/base.component';
|
|
@@ -20,26 +20,32 @@ export default class WmCarousel extends BaseComponent {
|
|
|
20
20
|
constructor(_props) {
|
|
21
21
|
super(_props, DEFAULT_CLASS, new WmCarouselProps(), new WmCarouselState());
|
|
22
22
|
_defineProperty(this, "noOfSlides", 0);
|
|
23
|
-
_defineProperty(this, "
|
|
23
|
+
_defineProperty(this, "slidesLayout", []);
|
|
24
24
|
_defineProperty(this, "keyExtractor", new DefaultKeyExtractor());
|
|
25
25
|
_defineProperty(this, "stopPlay", null);
|
|
26
|
+
_defineProperty(this, "dotScale", new Animated.Value(0));
|
|
27
|
+
_defineProperty(this, "dotPosition", new Animated.Value(0));
|
|
26
28
|
_defineProperty(this, "animationView", null);
|
|
27
29
|
_defineProperty(this, "animationHandlers", {
|
|
28
30
|
bounds: e => {
|
|
29
|
-
var _this$
|
|
30
|
-
const activeTabIndex = this.state.activeIndex - 1
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
31
|
+
var _this$slidesLayout, _this$slidesLayout$ac;
|
|
32
|
+
const activeTabIndex = this.state.activeIndex - 1;
|
|
33
|
+
let lower = 0;
|
|
34
|
+
if (activeTabIndex > 0) {
|
|
35
|
+
lower = this.slidesLayout.filter((l, i) => i < activeTabIndex - 1).reduce((s, l) => s + l.width, 0);
|
|
36
|
+
}
|
|
37
|
+
let center = lower + (((_this$slidesLayout = this.slidesLayout[activeTabIndex - 1]) === null || _this$slidesLayout === void 0 ? void 0 : _this$slidesLayout.width) || 0);
|
|
38
|
+
let upper = center + (((_this$slidesLayout$ac = this.slidesLayout[activeTabIndex]) === null || _this$slidesLayout$ac === void 0 ? void 0 : _this$slidesLayout$ac.width) || 0);
|
|
34
39
|
return {
|
|
35
|
-
lower: -1 *
|
|
36
|
-
center: -1 *
|
|
37
|
-
upper: -1 *
|
|
40
|
+
lower: -1 * lower,
|
|
41
|
+
center: -1 * center,
|
|
42
|
+
upper: -1 * upper
|
|
38
43
|
};
|
|
39
44
|
},
|
|
40
45
|
computePhase: value => {
|
|
41
|
-
var _this$
|
|
42
|
-
const
|
|
46
|
+
var _this$slidesLayout$ac2;
|
|
47
|
+
const activeTabIndex = this.state.activeIndex - 1;
|
|
48
|
+
const w = ((_this$slidesLayout$ac2 = this.slidesLayout[activeTabIndex]) === null || _this$slidesLayout$ac2 === void 0 ? void 0 : _this$slidesLayout$ac2.width) || 0;
|
|
43
49
|
return w && Math.abs(value / w);
|
|
44
50
|
},
|
|
45
51
|
onLower: e => {
|
|
@@ -54,6 +60,7 @@ export default class WmCarousel extends BaseComponent {
|
|
|
54
60
|
this.updateState({
|
|
55
61
|
activeIndex: index
|
|
56
62
|
}, () => this.invokeEventCallback('onChange', [this, index, prevIndex]));
|
|
63
|
+
this.animatePagination(index);
|
|
57
64
|
});
|
|
58
65
|
_defineProperty(this, "renderItem", (item, index) => {
|
|
59
66
|
const props = this.state.props;
|
|
@@ -82,16 +89,18 @@ export default class WmCarousel extends BaseComponent {
|
|
|
82
89
|
this.stopPlay && this.stopPlay();
|
|
83
90
|
});
|
|
84
91
|
}
|
|
92
|
+
addSlideLayout(index, nativeEvent) {
|
|
93
|
+
this.slidesLayout[index] = nativeEvent.nativeEvent.layout;
|
|
94
|
+
if (index === this.state.activeIndex) {
|
|
95
|
+
this.forceUpdate();
|
|
96
|
+
}
|
|
97
|
+
}
|
|
85
98
|
generateItemKey(item, index, props) {
|
|
86
99
|
if (props.itemkey && item && !this._showSkeleton) {
|
|
87
100
|
return props.itemkey(item, index);
|
|
88
101
|
}
|
|
89
102
|
return 'list_item_' + this.keyExtractor.getKey(item, true);
|
|
90
103
|
}
|
|
91
|
-
setSlideLayout(event) {
|
|
92
|
-
this.slideLayout = event.nativeEvent.layout;
|
|
93
|
-
this.forceUpdate();
|
|
94
|
-
}
|
|
95
104
|
autoPlay() {
|
|
96
105
|
const props = this.state.props;
|
|
97
106
|
this.stopPlay && this.stopPlay();
|
|
@@ -116,7 +125,7 @@ export default class WmCarousel extends BaseComponent {
|
|
|
116
125
|
var _this$keyExtractor;
|
|
117
126
|
(_this$keyExtractor = this.keyExtractor) === null || _this$keyExtractor === void 0 ? void 0 : _this$keyExtractor.clear();
|
|
118
127
|
this.updateState({
|
|
119
|
-
activeIndex: Math.min(this.state.activeIndex, ($new === null || $new === void 0 ? void 0 : $new.length) ||
|
|
128
|
+
activeIndex: Math.min(this.state.activeIndex, ($new === null || $new === void 0 ? void 0 : $new.length) || 1)
|
|
120
129
|
});
|
|
121
130
|
break;
|
|
122
131
|
}
|
|
@@ -127,6 +136,43 @@ export default class WmCarousel extends BaseComponent {
|
|
|
127
136
|
}
|
|
128
137
|
}
|
|
129
138
|
}
|
|
139
|
+
animatePagination(index) {
|
|
140
|
+
var _this$styles$dotStyle, _this$styles$dotStyle2, _this$styles$dotStyle3;
|
|
141
|
+
const prevIndex = this.state.activeIndex;
|
|
142
|
+
const margin = (((_this$styles$dotStyle = this.styles.dotStyle) === null || _this$styles$dotStyle === void 0 ? void 0 : _this$styles$dotStyle.marginLeft) || 0) + (((_this$styles$dotStyle2 = this.styles.dotStyle) === null || _this$styles$dotStyle2 === void 0 ? void 0 : _this$styles$dotStyle2.marginRight) || 0);
|
|
143
|
+
const width = ((_this$styles$dotStyle3 = this.styles.dotStyle) === null || _this$styles$dotStyle3 === void 0 ? void 0 : _this$styles$dotStyle3.width) || 2;
|
|
144
|
+
const size = margin + width;
|
|
145
|
+
const position = Math.max(index - 1, 0) * size;
|
|
146
|
+
const scale = Math.abs(index - prevIndex) * size;
|
|
147
|
+
const options = {
|
|
148
|
+
useNativeDriver: true,
|
|
149
|
+
duration: 200,
|
|
150
|
+
easing: Easing.out(Easing.linear)
|
|
151
|
+
};
|
|
152
|
+
if (prevIndex < index) {
|
|
153
|
+
Animated.sequence([Animated.timing(this.dotScale, {
|
|
154
|
+
toValue: scale,
|
|
155
|
+
...options
|
|
156
|
+
}), Animated.parallel([Animated.timing(this.dotScale, {
|
|
157
|
+
toValue: 0,
|
|
158
|
+
...options
|
|
159
|
+
}), Animated.timing(this.dotPosition, {
|
|
160
|
+
toValue: (this.isRTL ? -1 : 1) * position,
|
|
161
|
+
...options
|
|
162
|
+
})])]).start();
|
|
163
|
+
} else if (prevIndex > index) {
|
|
164
|
+
Animated.sequence([Animated.parallel([Animated.timing(this.dotScale, {
|
|
165
|
+
toValue: scale,
|
|
166
|
+
...options
|
|
167
|
+
}), Animated.timing(this.dotPosition, {
|
|
168
|
+
toValue: (this.isRTL ? -1 : 1) * position,
|
|
169
|
+
...options
|
|
170
|
+
})]), Animated.timing(this.dotScale, {
|
|
171
|
+
toValue: 0,
|
|
172
|
+
...options
|
|
173
|
+
})]).start();
|
|
174
|
+
}
|
|
175
|
+
}
|
|
130
176
|
renderPagination(data) {
|
|
131
177
|
const maxNoOfDots = this.state.props.maxnoofdots;
|
|
132
178
|
let minIndex = Math.max(this.state.activeIndex - maxNoOfDots + 1, 0);
|
|
@@ -136,44 +182,72 @@ export default class WmCarousel extends BaseComponent {
|
|
|
136
182
|
}
|
|
137
183
|
return /*#__PURE__*/React.createElement(View, {
|
|
138
184
|
style: this.styles.dotsWrapperStyle
|
|
185
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
186
|
+
style: {
|
|
187
|
+
flexDirection: this.isRTL ? 'row-reverse' : 'row'
|
|
188
|
+
}
|
|
139
189
|
}, data.map((item, index) => {
|
|
140
190
|
return index >= minIndex && index <= maxIndex ? /*#__PURE__*/React.createElement(View, {
|
|
141
191
|
key: 'dots_' + this.generateItemKey(item, index, this.state.props),
|
|
142
|
-
style: [this.styles.dotStyle
|
|
192
|
+
style: [this.styles.dotStyle]
|
|
143
193
|
}) : null;
|
|
144
|
-
})
|
|
194
|
+
}), /*#__PURE__*/React.createElement(Animated.View, {
|
|
195
|
+
style: [this.styles.dotStyle, this.styles.activeDotStyle, {
|
|
196
|
+
width: undefined,
|
|
197
|
+
height: undefined,
|
|
198
|
+
transform: [{
|
|
199
|
+
translateX: this.dotPosition
|
|
200
|
+
}]
|
|
201
|
+
}, this.isRTL ? {
|
|
202
|
+
right: 0
|
|
203
|
+
} : {
|
|
204
|
+
left: 0
|
|
205
|
+
}]
|
|
206
|
+
}, /*#__PURE__*/React.createElement(Animated.View, {
|
|
207
|
+
style: [{
|
|
208
|
+
width: 1,
|
|
209
|
+
height: 1
|
|
210
|
+
}, {
|
|
211
|
+
// This is failing in Android
|
|
212
|
+
// minWidth: this.dotScale
|
|
213
|
+
}]
|
|
214
|
+
}))));
|
|
145
215
|
}
|
|
146
216
|
renderWidget(props) {
|
|
147
|
-
var _data;
|
|
217
|
+
var _data, _this$styles$slide;
|
|
148
218
|
const hasNavs = props.controls === 'both' || props.controls === 'navs';
|
|
149
219
|
const hasDots = props.controls === 'both' || props.controls === 'indicators';
|
|
150
220
|
let styles = this.styles;
|
|
151
221
|
let data = props.type === 'dynamic' ? props.dataset : props.children;
|
|
152
222
|
data = isArray(data) ? data : [];
|
|
153
223
|
this.noOfSlides = ((_data = data) === null || _data === void 0 ? void 0 : _data.length) || 0;
|
|
224
|
+
let slideScale = undefined;
|
|
225
|
+
let slideTranslateX = undefined;
|
|
226
|
+
if (isArray((_this$styles$slide = this.styles.slide) === null || _this$styles$slide === void 0 ? void 0 : _this$styles$slide.transform)) {
|
|
227
|
+
var _this$styles$slide2, _this$styles$slide3;
|
|
228
|
+
slideScale = (_this$styles$slide2 = this.styles.slide) === null || _this$styles$slide2 === void 0 || (_this$styles$slide2 = _this$styles$slide2.transform) === null || _this$styles$slide2 === void 0 || (_this$styles$slide2 = _this$styles$slide2.find(o => !isUndefined(o.scale))) === null || _this$styles$slide2 === void 0 ? void 0 : _this$styles$slide2.scale;
|
|
229
|
+
slideTranslateX = (_this$styles$slide3 = this.styles.slide) === null || _this$styles$slide3 === void 0 || (_this$styles$slide3 = _this$styles$slide3.transform) === null || _this$styles$slide3 === void 0 || (_this$styles$slide3 = _this$styles$slide3.find(o => !isUndefined(o.translateX))) === null || _this$styles$slide3 === void 0 ? void 0 : _this$styles$slide3.translateX;
|
|
230
|
+
}
|
|
154
231
|
// TODO: loop prop on Carousel is not working Refer: https://github.com/meliorence/react-native-snap-carousel/issues/608
|
|
155
232
|
return /*#__PURE__*/React.createElement(View, {
|
|
156
|
-
style: styles.root
|
|
157
|
-
onLayout: this.setSlideLayout.bind(this)
|
|
233
|
+
style: styles.root
|
|
158
234
|
}, this._background, /*#__PURE__*/React.createElement(SwipeAnimation.View, {
|
|
159
235
|
enableGestures: props.enablegestures,
|
|
160
236
|
style: {
|
|
161
|
-
flexDirection: 'row',
|
|
162
|
-
flexWrap: 'nowrap',
|
|
163
|
-
alignItems: 'center',
|
|
164
237
|
height: props.type === 'dynamic' ? undefined : '100%'
|
|
165
238
|
},
|
|
166
239
|
direction: "horizontal",
|
|
167
240
|
ref: r => {
|
|
168
241
|
this.animationView = r;
|
|
169
242
|
},
|
|
170
|
-
handlers: this.animationHandlers
|
|
243
|
+
handlers: this.animationHandlers,
|
|
244
|
+
slideWidth: this.styles.slide.width
|
|
171
245
|
}, data.map((item, index) => {
|
|
172
246
|
var _this$animationView5, _this$animationView6;
|
|
173
247
|
const isActive = index === this.state.activeIndex - 1;
|
|
174
248
|
let scale = (_this$animationView5 = this.animationView) === null || _this$animationView5 === void 0 ? void 0 : _this$animationView5.animationPhase.interpolate({
|
|
175
249
|
inputRange: [-2000, index - 1, index, index + 1, 2000],
|
|
176
|
-
outputRange: [
|
|
250
|
+
outputRange: [slideScale, slideScale, 1, slideScale, slideScale]
|
|
177
251
|
});
|
|
178
252
|
let translateX = (_this$animationView6 = this.animationView) === null || _this$animationView6 === void 0 ? void 0 : _this$animationView6.animationPhase.interpolate({
|
|
179
253
|
inputRange: [-2000, index - 1, index, index + 1, 2000],
|
|
@@ -181,11 +255,18 @@ export default class WmCarousel extends BaseComponent {
|
|
|
181
255
|
});
|
|
182
256
|
return /*#__PURE__*/React.createElement(Animated.View, {
|
|
183
257
|
key: this.generateItemKey(item, index, props),
|
|
258
|
+
onLayout: this.addSlideLayout.bind(this, index),
|
|
259
|
+
onTouchEnd: () => {
|
|
260
|
+
var _this$animationView7;
|
|
261
|
+
this.onSlideChange(index + 1);
|
|
262
|
+
const position = this.slidesLayout.filter((l, i) => i < index).reduce((s, l) => s + l.width, 0);
|
|
263
|
+
(_this$animationView7 = this.animationView) === null || _this$animationView7 === void 0 ? void 0 : _this$animationView7.setPosition(-1 * position);
|
|
264
|
+
},
|
|
184
265
|
style: [{
|
|
185
266
|
height: props.type === 'dynamic' ? undefined : '100%'
|
|
186
267
|
}, this.styles.slide, index === 0 ? this.styles.firstSlide : null, index === data.length - 1 ? this.styles.lastSlide : null, isActive ? this.styles.activeSlide : null, translateX && scale ? {
|
|
187
268
|
transform: [{
|
|
188
|
-
translateX: translateX
|
|
269
|
+
translateX: !isUndefined(slideTranslateX) ? slideTranslateX : translateX
|
|
189
270
|
}, {
|
|
190
271
|
scale: scale
|
|
191
272
|
}]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","isArray","Animated","View","DefaultKeyExtractor","WmIcon","BaseComponent","BaseComponentState","SwipeAnimation","WmCarouselProps","DEFAULT_CLASS","WmCarouselState","constructor","arguments","_defineProperty","WmCarousel","props","bounds","e","_this$slideLayout","activeTabIndex","state","activeIndex","w","slideLayout","width","noOfTabs","type","dataset","children","lower","center","upper","computePhase","value","_this$slideLayout2","Math","abs","onLower","onSlideChange","onUpper","index","prevIndex","updateState","invokeEventCallback","item","renderSlide","data","length","_this$animationView","animationView","setPosition","_this$animationView2","goToUpper","_this$animationView3","goToLower","cleanup","push","stopPlay","generateItemKey","itemkey","_showSkeleton","keyExtractor","getKey","setSlideLayout","event","nativeEvent","layout","forceUpdate","autoPlay","animation","animationinterval","intervalId","setInterval","next","clearInterval","setTimeout","_this$animationView4","onPropertyChange","name","$new","$old","_this$keyExtractor","clear","min","renderPagination","maxNoOfDots","maxnoofdots","minIndex","max","maxIndex","createElement","style","styles","dotsWrapperStyle","map","key","dotStyle","activeDotStyle","renderWidget","_data","hasNavs","controls","hasDots","noOfSlides","root","onLayout","bind","_background","enableGestures","enablegestures","flexDirection","flexWrap","alignItems","height","undefined","direction","ref","r","handlers","animationHandlers","_this$animationView5","_this$animationView6","isActive","scale","animationPhase","interpolate","inputRange","outputRange","translateX","slide","firstSlide","lastSlide","activeSlide","transform","renderItem","btnPanel","id","getTestId","iconclass","prevBtn","onTap","prev","nextBtn"],"sources":["carousel.component.tsx"],"sourcesContent":["import React from 'react';\nimport { isArray } from 'lodash-es';\nimport { Animated, View, Text, LayoutChangeEvent, LayoutRectangle } from 'react-native';\nimport { DefaultKeyExtractor } from '@wavemaker/app-rn-runtime/core/key.extractor';\nimport WmIcon from '@wavemaker/app-rn-runtime/components/basic/icon/icon.component';\nimport { BaseComponent, BaseComponentState } from '@wavemaker/app-rn-runtime/core/base.component';\nimport * as SwipeAnimation from '@wavemaker/app-rn-runtime/gestures/swipe.animation';\n\nimport WmCarouselProps from './carousel.props';\nimport { DEFAULT_CLASS, WmCarouselStyles } from './carousel.styles';\n\nexport class WmCarouselState extends BaseComponentState<WmCarouselProps> {\n activeIndex = 1;\n}\n\nexport default class WmCarousel extends BaseComponent<WmCarouselProps, WmCarouselState, WmCarouselStyles> {\n\n noOfSlides: number = 0;\n private slideLayout: LayoutRectangle = null as any;\n private keyExtractor = new DefaultKeyExtractor();\n stopPlay: Function = null as any;\n private animationView: SwipeAnimation.View | null = null as any;\n private animationHandlers = {\n bounds: (e) => {\n const activeTabIndex = this.state.activeIndex - 1,\n w = this.slideLayout?.width || 0,\n props = this.state.props,\n noOfTabs = props.type === 'dynamic' ? props.dataset : props.children;\n return {\n lower: -1 * (activeTabIndex - (activeTabIndex === 0 ? 0 : 1)) * w,\n center: -1 * activeTabIndex * w,\n upper: -1 * (activeTabIndex + (activeTabIndex === noOfTabs - 1 ? 0 : 1)) * w\n };\n },\n computePhase: (value) => {\n const w = this.slideLayout?.width || 0;\n return w && Math.abs(value / w);\n },\n onLower: (e) => {\n this.onSlideChange(this.state.activeIndex - 1);\n },\n onUpper: (e) => {\n this.onSlideChange(this.state.activeIndex + 1);\n }\n } as SwipeAnimation.Handlers;\n\n constructor(props: WmCarouselProps) {\n super(props, DEFAULT_CLASS, new WmCarouselProps(), new WmCarouselState());\n this.cleanup.push(() => {\n this.stopPlay && this.stopPlay();\n })\n }\n\n private generateItemKey(item: any, index: number, props: WmCarouselProps) {\n if (props.itemkey && item && !this._showSkeleton) {\n return props.itemkey(item, index);\n }\n return 'list_item_' + this.keyExtractor.getKey(item, true);\n }\n\n setSlideLayout(event: LayoutChangeEvent) {\n this.slideLayout = event.nativeEvent.layout;\n this.forceUpdate();\n }\n\n autoPlay() {\n const props = this.state.props;\n this.stopPlay && this.stopPlay();\n if (props.animation === 'auto' && props.animationinterval) {\n const intervalId = setInterval(() => {\n this.next();\n }, props.animationinterval * 1000);\n this.stopPlay = () => clearInterval(intervalId);\n } else {\n setTimeout(() => {\n this.onSlideChange(1);\n this.animationView?.setPosition(0);\n }, 1000);\n }\n }\n\n onPropertyChange(name: string, $new: any, $old: any): void {\n super.onPropertyChange(name, $new, $old);\n switch (name) {\n case 'dataset': {\n this.keyExtractor?.clear();\n this.updateState({\n activeIndex: Math.min(this.state.activeIndex, $new?.length || 0)\n } as WmCarouselState);\n break;\n }\n case 'animation':\n case 'animationinterval' : {\n this.autoPlay();\n }\n }\n }\n\n onSlideChange = (index: number) => {\n const prevIndex = this.state.activeIndex;\n this.updateState({\n activeIndex: index\n } as WmCarouselState,\n () => this.invokeEventCallback('onChange', [this, index, prevIndex]));\n }\n\n renderItem = (item: any, index: number) => {\n const props = this.state.props;\n if (props.type === 'dynamic') {\n return props.renderSlide ? props.renderSlide(item, index) : null;\n }\n return props.children[index];\n }\n\n next = () => {\n const props = this.state.props;\n const data = props.type === 'dynamic' ? props.dataset : props.children;\n if (this.state.activeIndex >= data?.length || 0) {\n this.onSlideChange(1);\n this.animationView?.setPosition(0);\n } else {\n this.animationView?.goToUpper();\n }\n }\n\n prev = () => {\n this.animationView?.goToLower();\n }\n\n renderPagination(data: any) {\n const maxNoOfDots = this.state.props.maxnoofdots;\n let minIndex = Math.max(this.state.activeIndex - maxNoOfDots + 1, 0);\n let maxIndex = Math.min(minIndex + maxNoOfDots - 1, data.length);\n if (maxIndex === data.length) {\n minIndex = maxIndex - maxNoOfDots;\n }\n return (<View style={this.styles.dotsWrapperStyle}>\n {\n data.map((item: any, index: number) => {\n return index >= minIndex && index <= maxIndex ? (\n <View key={'dots_' + this.generateItemKey(item, index, this.state.props)} \n style={[\n this.styles.dotStyle,\n index === this.state.activeIndex - 1 ? this.styles.activeDotStyle: null]}>\n </View>) : null;\n })\n }\n </View>);\n }\n\n renderWidget(props: WmCarouselProps) {\n const hasNavs = props.controls === 'both' || props.controls ==='navs';\n const hasDots = props.controls === 'both' || props.controls ==='indicators';\n let styles = this.styles;\n let data = props.type === 'dynamic' ? props.dataset : props.children;\n data = isArray(data) ? data : [];\n this.noOfSlides = data?.length || 0;\n // TODO: loop prop on Carousel is not working Refer: https://github.com/meliorence/react-native-snap-carousel/issues/608\n return (\n <View style={styles.root} onLayout={this.setSlideLayout.bind(this)}>\n {this._background}\n <SwipeAnimation.View \n enableGestures={props.enablegestures}\n style={{\n flexDirection: 'row',\n flexWrap: 'nowrap',\n alignItems: 'center',\n height: props.type === 'dynamic' ? undefined : '100%',\n }}\n direction='horizontal'\n ref={(r) => {this.animationView = r}}\n handlers = {this.animationHandlers}\n >\n {data.map((item: any, index: number) => {\n const isActive = index === this.state.activeIndex - 1;\n let scale = this.animationView?.animationPhase.interpolate({\n inputRange: [-2000, index - 1, index, index + 1, 2000],\n outputRange: [0.8, 0.8, 1, 0.8, 0.8]\n });\n let translateX = this.animationView?.animationPhase.interpolate({\n inputRange: [-2000, index - 1, index, index + 1, 2000],\n outputRange: [-56, -56, 0, 56, 56]\n });\n return (\n <Animated.View key={this.generateItemKey(item, index, props)}\n style={[\n {height: props.type === 'dynamic' ? undefined : '100%'},\n this.styles.slide,\n index === 0 ? this.styles.firstSlide : null,\n index === data.length - 1 ? this.styles.lastSlide: null,\n isActive ? this.styles.activeSlide: null,\n translateX && scale ? {\n transform: [\n {\n translateX: translateX\n },\n {\n scale: scale\n }\n ]\n } : null]}>\n {this.renderItem(item, index)}\n </Animated.View>\n );\n })}\n </SwipeAnimation.View>\n {hasNavs ? (\n <View style={styles.btnPanel}>\n <WmIcon\n id={this.getTestId('prev_icon')}\n iconclass=\"wi wi-chevron-left fa-2x\"\n styles={styles.prevBtn}\n onTap={this.prev}/>\n <WmIcon\n id={this.getTestId('next_icon')}\n iconclass=\"wi wi-chevron-right fa-2x\"\n styles={styles.nextBtn}\n onTap={this.next}/>\n </View>): null}\n {hasDots && data ? this.render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AK,EAAE,IAAI,CAACnE;IAAK,CAAC,CAChB,CAAC,GAAG,IAAI,EACb6B,OAAO,IAAIxD,IAAI,GAAG,IAAI,CAACsC,gBAAgB,CAACtC,IAAI,CAAC,GAAG,IAC/C,CAAC;EACX;AACF"}
|
|
1
|
+
{"version":3,"names":["React","isArray","isUndefined","Animated","Easing","View","DefaultKeyExtractor","WmIcon","BaseComponent","BaseComponentState","SwipeAnimation","WmCarouselProps","DEFAULT_CLASS","WmCarouselState","constructor","arguments","_defineProperty","WmCarousel","props","Value","bounds","e","_this$slidesLayout","_this$slidesLayout$ac","activeTabIndex","state","activeIndex","lower","slidesLayout","filter","l","i","reduce","s","width","center","upper","computePhase","value","_this$slidesLayout$ac2","w","Math","abs","onLower","onSlideChange","onUpper","index","prevIndex","updateState","invokeEventCallback","animatePagination","item","type","renderSlide","children","data","dataset","length","_this$animationView","animationView","setPosition","_this$animationView2","goToUpper","_this$animationView3","goToLower","cleanup","push","stopPlay","addSlideLayout","nativeEvent","layout","forceUpdate","generateItemKey","itemkey","_showSkeleton","keyExtractor","getKey","autoPlay","animation","animationinterval","intervalId","setInterval","next","clearInterval","setTimeout","_this$animationView4","onPropertyChange","name","$new","$old","_this$keyExtractor","clear","min","_this$styles$dotStyle","_this$styles$dotStyle2","_this$styles$dotStyle3","margin","styles","dotStyle","marginLeft","marginRight","size","position","max","scale","options","useNativeDriver","duration","easing","out","linear","sequence","timing","dotScale","toValue","parallel","dotPosition","isRTL","start","renderPagination","maxNoOfDots","maxnoofdots","minIndex","maxIndex","createElement","style","dotsWrapperStyle","flexDirection","map","key","activeDotStyle","undefined","height","transform","translateX","right","left","renderWidget","_data","_this$styles$slide","hasNavs","controls","hasDots","noOfSlides","slideScale","slideTranslateX","slide","_this$styles$slide2","_this$styles$slide3","find","o","root","_background","enableGestures","enablegestures","direction","ref","r","handlers","animationHandlers","slideWidth","_this$animationView5","_this$animationView6","isActive","animationPhase","interpolate","inputRange","outputRange","onLayout","bind","onTouchEnd","_this$animationView7","firstSlide","lastSlide","activeSlide","renderItem","btnPanel","id","getTestId","iconclass","prevBtn","onTap","prev","nextBtn"],"sources":["carousel.component.tsx"],"sourcesContent":["import React from 'react';\nimport { isArray, isUndefined } from 'lodash-es';\nimport { Animated, Easing, View, LayoutChangeEvent, LayoutRectangle } from 'react-native';\nimport { DefaultKeyExtractor } from '@wavemaker/app-rn-runtime/core/key.extractor';\nimport WmIcon from '@wavemaker/app-rn-runtime/components/basic/icon/icon.component';\nimport { BaseComponent, BaseComponentState } from '@wavemaker/app-rn-runtime/core/base.component';\nimport * as SwipeAnimation from '@wavemaker/app-rn-runtime/gestures/swipe.animation';\n\nimport WmCarouselProps from './carousel.props';\nimport { DEFAULT_CLASS, WmCarouselStyles } from './carousel.styles';\n\nexport class WmCarouselState extends BaseComponentState<WmCarouselProps> {\n activeIndex = 1;\n}\n\nexport default class WmCarousel extends BaseComponent<WmCarouselProps, WmCarouselState, WmCarouselStyles> {\n\n noOfSlides: number = 0;\n private slidesLayout: LayoutRectangle[] = [];\n private keyExtractor = new DefaultKeyExtractor();\n stopPlay: Function = null as any;\n private dotScale = new Animated.Value(0);\n private dotPosition = new Animated.Value(0);\n private animationView: SwipeAnimation.View | null = null as any;\n private animationHandlers = {\n bounds: (e) => {\n const activeTabIndex = this.state.activeIndex - 1;\n let lower = 0;\n if (activeTabIndex > 0) {\n lower = this.slidesLayout\n .filter((l , i) => i < activeTabIndex - 1)\n .reduce((s, l) => s + l.width, 0);\n }\n let center = lower + (this.slidesLayout[activeTabIndex - 1]?.width || 0);\n let upper = center + (this.slidesLayout[activeTabIndex]?.width || 0);\n return {\n lower: -1 * lower,\n center: -1 * center,\n upper: -1 * upper\n };\n },\n computePhase: (value) => {\n const activeTabIndex = this.state.activeIndex - 1;\n const w = this.slidesLayout[activeTabIndex]?.width || 0;\n return w && Math.abs(value / w);\n },\n onLower: (e) => {\n this.onSlideChange(this.state.activeIndex - 1);\n },\n onUpper: (e) => {\n this.onSlideChange(this.state.activeIndex + 1);\n }\n } as SwipeAnimation.Handlers;\n\n constructor(props: WmCarouselProps) {\n super(props, DEFAULT_CLASS, new WmCarouselProps(), new WmCarouselState());\n this.cleanup.push(() => {\n this.stopPlay && this.stopPlay();\n })\n }\n\n addSlideLayout(index: number, nativeEvent: LayoutChangeEvent) {\n this.slidesLayout[index] = nativeEvent.nativeEvent.layout;\n if (index === this.state.activeIndex) {\n this.forceUpdate();\n }\n }\n\n private generateItemKey(item: any, index: number, props: WmCarouselProps) {\n if (props.itemkey && item && !this._showSkeleton) {\n return props.itemkey(item, index);\n }\n return 'list_item_' + this.keyExtractor.getKey(item, true);\n }\n\n autoPlay() {\n const props = this.state.props;\n this.stopPlay && this.stopPlay();\n if (props.animation === 'auto' && props.animationinterval) {\n const intervalId = setInterval(() => {\n this.next();\n }, props.animationinterval * 1000);\n this.stopPlay = () => clearInterval(intervalId);\n } else {\n setTimeout(() => {\n this.onSlideChange(1);\n this.animationView?.setPosition(0);\n }, 1000);\n }\n }\n\n onPropertyChange(name: string, $new: any, $old: any): void {\n super.onPropertyChange(name, $new, $old);\n switch (name) {\n case 'dataset': {\n this.keyExtractor?.clear();\n this.updateState({\n activeIndex: Math.min(this.state.activeIndex, $new?.length || 1)\n } as WmCarouselState);\n break;\n }\n case 'animation':\n case 'animationinterval' : {\n this.autoPlay();\n }\n }\n }\n\n animatePagination(index: number) {\n const prevIndex = this.state.activeIndex;\n const margin = ((this.styles.dotStyle?.marginLeft as number)|| 0) + \n ((this.styles.dotStyle?.marginRight as number)|| 0)\n const width = (this.styles.dotStyle?.width as number)|| 2;\n const size = margin + width;\n const position = Math.max(index - 1, 0) * size;\n const scale = Math.abs(index - prevIndex) * size;\n const options = {\n useNativeDriver: true,\n duration: 200,\n easing: Easing.out(Easing.linear)\n };\n if (prevIndex < index) {\n Animated.sequence([\n Animated.timing(this.dotScale, {\n toValue: scale,\n ...options\n }),\n Animated.parallel([\n Animated.timing(this.dotScale, {\n toValue: 0,\n ...options\n }),\n Animated.timing(this.dotPosition, {\n toValue: (this.isRTL ? -1: 1) * position,\n ...options\n })\n ])\n ]).start();\n } else if (prevIndex > index) {\n Animated.sequence([\n Animated.parallel([\n Animated.timing(this.dotScale, {\n toValue: scale,\n ...options\n }),\n Animated.timing(this.dotPosition, {\n toValue: (this.isRTL ? -1: 1) * position,\n ...options\n })\n ]),\n Animated.timing(this.dotScale, {\n toValue: 0,\n ...options\n }),\n ]).start();\n } \n }\n\n onSlideChange = (index: number) => {\n const prevIndex = this.state.activeIndex;\n this.updateState({\n activeIndex: index\n } as WmCarouselState,\n () => this.invokeEventCallback('onChange', [this, index, prevIndex]));\n this.animatePagination(index);\n }\n\n renderItem = (item: any, index: number) => {\n const props = this.state.props;\n if (props.type === 'dynamic') {\n return props.renderSlide ? props.renderSlide(item, index) : null;\n }\n return props.children[index];\n }\n\n next = () => {\n const props = this.state.props;\n const data = props.type === 'dynamic' ? props.dataset : props.children;\n if (this.state.activeIndex >= data?.length || 0) {\n this.onSlideChange(1);\n this.animationView?.setPosition(0);\n } else {\n this.animationView?.goToUpper();\n }\n }\n\n prev = () => {\n this.animationView?.goToLower();\n }\n\n renderPagination(data: any) {\n const maxNoOfDots = this.state.props.maxnoofdots;\n let minIndex = Math.max(this.state.activeIndex - maxNoOfDots + 1, 0);\n let maxIndex = Math.min(minIndex + maxNoOfDots - 1, data.length);\n if (maxIndex === data.length) {\n minIndex = maxIndex - maxNoOfDots;\n }\n return (<View style={this.styles.dotsWrapperStyle}>\n <View style={{flexDirection: this.isRTL ? 'row-reverse' : 'row'}}>\n {\n data.map((item: any, index: number) => {\n return index >= minIndex && index <= maxIndex ? (\n <View key={'dots_' + this.generateItemKey(item, index, this.state.props)} \n style={[this.styles.dotStyle]}>\n </View>) : null;\n })\n }\n <Animated.View style={[\n this.styles.dotStyle,\n this.styles.activeDotStyle, {\n width: undefined,\n height: undefined,\n transform: [{\n translateX: this.dotPosition\n }]\n }, this.isRTL ? { right: 0 } : { left: 0}]}>\n <Animated.View style={[{\n width: 1,\n height: 1\n }, {\n // This is failing in Android\n // minWidth: this.dotScale\n }]}>\n </Animated.View>\n </Animated.View>\n </View>\n </View>);\n }\n\n renderWidget(props: WmCarouselProps) {\n const hasNavs = props.controls === 'both' || props.controls ==='navs';\n const hasDots = props.controls === 'both' || props.controls ==='indicators';\n let styles = this.styles;\n let data = props.type === 'dynamic' ? props.dataset : props.children;\n data = isArray(data) ? data : [];\n this.noOfSlides = data?.length || 0;\n let slideScale = undefined as any;\n let slideTranslateX = undefined as any;\n if (isArray(this.styles.slide?.transform)) {\n slideScale = (this.styles.slide?.transform?.find(o => !isUndefined((o as any).scale)) as any)?.scale;\n slideTranslateX = (this.styles.slide?.transform?.find(o => !isUndefined((o as any).translateX)) as any)?.translateX;\n }\n // TODO: loop prop on Carousel is not working Refer: https://github.com/meliorence/react-native-snap-carousel/issues/608\n return (\n <View style={styles.root}>\n {this._background}\n <SwipeAnimation.View \n enableGestures={props.enablegestures}\n style={{\n height: props.type === 'dynamic' ? undefined : '100%',\n }}\n direction='horizontal'\n ref={(r) => {this.animationView = r}}\n handlers = {this.animationHandlers}\n slideWidth={this.styles.slide.width}\n >\n {data.map((item: any, index: number) => {\n const isActive = index === this.state.activeIndex - 1;\n let scale = this.animationView?.animationPhase.interpolate({\n inputRange: [-2000, index - 1, index, index + 1, 2000],\n outputRange: [slideScale, slideScale, 1, slideScale, slideScale]\n });\n let translateX = this.animationView?.animationPhase.interpolate({\n inputRange: [-2000, index - 1, index, index + 1, 2000],\n outputRange: [-56, -56, 0, 56, 56]\n });\n return (\n <Animated.View key={this.generateItemKey(item, index, props)}\n onLayout={this.addSlideLayout.bind(this, index)}\n onTouchEnd={() => {\n this.onSlideChange(index + 1);\n const position = this.slidesLayout\n .filter((l , i) => i < index)\n .reduce((s, l) => s + l.width, 0);\n this.animationView?.setPosition(-1 * position);\n }}\n style={[\n {height: props.type === 'dynamic' ? undefined : '100%'},\n this.styles.slide,\n index === 0 ? this.styles.firstSlide : null,\n index === data.length - 1 ? this.styles.lastSlide: null,\n isActive ? this.styles.activeSlide: null,\n translateX && scale ? {\n transform: [\n {\n translateX: !isUndefined(slideTranslateX) ? slideTranslateX : translateX\n }, {\n scale: scale\n }\n ]\n } : null]}>\n {this.renderItem(item, index)}\n </Animated.View>\n );\n })}\n </SwipeAnimation.View>\n {hasNavs ? (\n <View style={styles.btnPanel}>\n <WmIcon\n id={this.getTestId('prev_icon')}\n iconclass=\"wi wi-chevron-left fa-2x\"\n styles={styles.prevBtn}\n onTap={this.prev}/>\n <WmIcon\n id={this.getTestId('next_icon')}\n iconclass=\"wi wi-chevron-right fa-2x\"\n styles={styles.nextBtn}\n onTap={this.next}/>\n </View>): null}\n {hasDots && data ? this.renderPagination(data) : null}\n </View>);\n }\n}\n"],"mappings":";;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,OAAO,EAAEC,WAAW,QAAQ,WAAW;AAChD,SAASC,QAAQ,EAAEC,MAAM,EAAEC,IAAI,QAA4C,cAAc;AACzF,SAASC,mBAAmB,QAAQ,8CAA8C;AAClF,OAAOC,MAAM,MAAM,gEAAgE;AACnF,SAASC,aAAa,EAAEC,kBAAkB,QAAQ,+CAA+C;AACjG,OAAO,KAAKC,cAAc,MAAM,oDAAoD;AAEpF,OAAOC,eAAe,MAAM,kBAAkB;AAC9C,SAASC,aAAa,QAA0B,mBAAmB;AAEnE,OAAO,MAAMC,eAAe,SAASJ,kBAAkB,CAAkB;EAAAK,YAAA;IAAA,SAAAC,SAAA;IAAAC,eAAA,sBACzD,CAAC;EAAA;AACjB;AAEA,eAAe,MAAMC,UAAU,SAAST,aAAa,CAAqD;EAuCxGM,WAAWA,CAACI,MAAsB,EAAE;IAClC,KAAK,CAACA,MAAK,EAAEN,aAAa,EAAE,IAAID,eAAe,CAAC,CAAC,EAAE,IAAIE,eAAe,CAAC,CAAC,CAAC;IAACG,eAAA,qBAtCvD,CAAC;IAAAA,eAAA,uBACoB,EAAE;IAAAA,eAAA,uBACrB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C,0BAA0B;MACpClF,MAAM,EAAEA,MAAM,CAACmF,OAAQ;MACvBC,KAAK,EAAE,IAAI,CAACC;IAAK,CAAC,CAAC,eACrBtL,KAAA,CAAA4H,aAAA,CAACrH,MAAM;MACL0K,EAAE,EAAE,IAAI,CAACC,SAAS,CAAC,WAAW,CAAE;MAChCC,SAAS,EAAC,2BAA2B;MACrClF,MAAM,EAAEA,MAAM,CAACsF,OAAQ;MACvBF,KAAK,EAAE,IAAI,CAACnG;IAAK,CAAC,CAChB,CAAC,GAAG,IAAI,EACb4D,OAAO,IAAIvF,IAAI,GAAG,IAAI,CAACgE,gBAAgB,CAAChE,IAAI,CAAC,GAAG,IAC/C,CAAC;EACX;AACF"}
|
|
@@ -17,9 +17,10 @@ BASE_THEME.registerStyle((themeVariables, addStyle) => {
|
|
|
17
17
|
text: {},
|
|
18
18
|
slide: {
|
|
19
19
|
width: '100%',
|
|
20
|
+
overflow: 'hidden',
|
|
20
21
|
paddingHorizontal: 16,
|
|
21
22
|
transform: [{
|
|
22
|
-
|
|
23
|
+
scale: 0.8
|
|
23
24
|
}]
|
|
24
25
|
},
|
|
25
26
|
firstSlide: {},
|
|
@@ -71,15 +72,18 @@ BASE_THEME.registerStyle((themeVariables, addStyle) => {
|
|
|
71
72
|
paddingBottom: 4
|
|
72
73
|
},
|
|
73
74
|
activeDotStyle: {
|
|
75
|
+
position: 'absolute',
|
|
74
76
|
backgroundColor: themeVariables.carouselActiveDotColor,
|
|
75
|
-
opacity: 1
|
|
77
|
+
opacity: 1,
|
|
78
|
+
padding: 4
|
|
76
79
|
},
|
|
77
80
|
dotStyle: {
|
|
78
81
|
width: 8,
|
|
79
82
|
height: 8,
|
|
80
83
|
borderRadius: 10,
|
|
81
84
|
opacity: 0.2,
|
|
82
|
-
|
|
85
|
+
marginLeft: 2,
|
|
86
|
+
marginRight: 2,
|
|
83
87
|
backgroundColor: themeVariables.carouselDotColor
|
|
84
88
|
}
|
|
85
89
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["BASE_THEME","defineStyles","DEFAULT_CLASS","registerStyle","themeVariables","addStyle","btn","height","width","borderRadius","borderColor","transparent","borderWidth","justifyContent","defaultStyles","root","position","text","slide","paddingHorizontal","transform","
|
|
1
|
+
{"version":3,"names":["BASE_THEME","defineStyles","DEFAULT_CLASS","registerStyle","themeVariables","addStyle","btn","height","width","borderRadius","borderColor","transparent","borderWidth","justifyContent","defaultStyles","root","position","text","slide","overflow","paddingHorizontal","transform","scale","firstSlide","lastSlide","activeSlide","btnPanel","top","marginTop","flexDirection","alignItems","prevBtn","marginLeft","backgroundColor","carouselPrevBgColor","fontSize","icon","color","carouselPrevBtnColor","nextBtn","marginRight","carouselNextBtnColor","dotsWrapperStyle","opacity","carouselDotWrapperBgColor","paddingTop","paddingBottom","activeDotStyle","carouselActiveDotColor","padding","dotStyle","carouselDotColor","rotateY","defaultColorF","right","alignSelf","primaryColor"],"sources":["carousel.styles.ts"],"sourcesContent":["import { ViewStyle } from 'react-native';\nimport BASE_THEME, { AllStyle } from '@wavemaker/app-rn-runtime/styles/theme';\nimport { BaseStyles, defineStyles } from '@wavemaker/app-rn-runtime/core/base.component';\nimport { WmIconStyles } from '@wavemaker/app-rn-runtime/components/basic/icon/icon.styles';\n\nexport type WmCarouselStyles = BaseStyles & {\n btnPanel: AllStyle,\n prevBtn: WmIconStyles,\n slide: AllStyle,\n firstSlide: AllStyle,\n lastSlide: AllStyle,\n activeSlide: AllStyle,\n nextBtn: WmIconStyles,\n dotsWrapperStyle: AllStyle,\n dotStyle: AllStyle,\n activeDotStyle: AllStyle\n};\nexport const DEFAULT_CLASS = 'app-carousel';\nBASE_THEME.registerStyle((themeVariables, addStyle) => {\n const btn: ViewStyle = {\n height: 48,\n width: 48,\n borderRadius: 48,\n borderColor: themeVariables.transparent,\n borderWidth: 1,\n justifyContent: 'center'\n };\n const defaultStyles: WmCarouselStyles = defineStyles({\n root: {\n position: 'relative'\n },\n text: {},\n slide: {\n width: '100%',\n overflow: 'hidden',\n paddingHorizontal: 16,\n transform: [\n {\n scale: 0.8\n }\n ]\n },\n firstSlide: {},\n lastSlide: {},\n activeSlide: {},\n btnPanel: {\n position: 'absolute',\n top: '50%',\n marginTop: -64,\n height: 64,\n flexDirection: 'row',\n alignItems: 'center',\n justifyContent: 'space-between',\n width: '100%'\n },\n prevBtn : {\n root: {\n marginLeft: 12,\n ...btn,\n backgroundColor: themeVariables.carouselPrevBgColor\n },\n text: {\n fontSize: 32\n },\n icon : {\n color: themeVariables.carouselPrevBtnColor\n }\n } as WmIconStyles,\n nextBtn : {\n root: {\n marginRight: 12,\n ...btn,\n backgroundColor: themeVariables.carouselPrevBgColor\n },\n text: {\n fontSize: 32\n },\n icon : {\n color: themeVariables.carouselNextBtnColor\n }\n } as WmIconStyles,\n dotsWrapperStyle:{\n opacity: 1,\n backgroundColor: themeVariables.carouselDotWrapperBgColor,\n flexDirection: 'row',\n justifyContent: 'center',\n alignItems: 'center',\n paddingTop: 4,\n paddingBottom: 4\n },\n activeDotStyle: {\n position: 'absolute',\n backgroundColor: themeVariables.carouselActiveDotColor,\n opacity: 1,\n padding: 4\n },\n dotStyle: {\n width: 8,\n height: 8,\n borderRadius: 10,\n opacity: 0.2,\n marginLeft: 2,\n marginRight: 2,\n backgroundColor: themeVariables.carouselDotColor\n }\n } as WmCarouselStyles);\n\n addStyle(DEFAULT_CLASS, '', defaultStyles);\n addStyle(DEFAULT_CLASS + '-rtl', '', {\n prevBtn : {\n root:{\n transform: [{rotateY: '180deg'}]\n }\n },\n nextBtn : {\n root:{\n transform: [{rotateY: '180deg'}]\n }\n }\n });\n\n addStyle('app-carousel-1', '', {\n btnPanel: {\n top: '100%'\n },\n prevBtn: {\n root: {\n borderRadius: 6\n }\n },\n nextBtn: {\n root: {\n borderRadius: 6\n }\n }\n } as any as WmCarouselStyles);\n\n addStyle('app-carousel-2', '', {\n btnPanel: {\n backgroundColor: themeVariables.defaultColorF,\n width: '100%',\n top: '100%',\n right: 0,\n padding: 8,\n justifyContent: 'flex-end'\n },\n dotsWrapperStyle:{\n alignSelf: 'flex-start',\n justifyContent: 'flex-start'\n },\n activeDotStyle: {\n backgroundColor: themeVariables.primaryColor,\n },\n dotStyle: {\n backgroundColor: themeVariables.primaryColor,\n },\n prevBtn: {\n root: {\n backgroundColor: 'rgba(255, 255, 255, 0.1)',\n borderColor: themeVariables.primaryColor,\n },\n icon : {\n color: themeVariables.primaryColor\n }\n },\n nextBtn: {\n root: {\n marginLeft: 8,\n backgroundColor: 'rgba(255, 255, 255, 0.1)',\n borderColor: themeVariables.primaryColor,\n },\n icon : {\n color: themeVariables.primaryColor\n }\n }\n } as any as WmCarouselStyles);\n});"],"mappings":"AACA,OAAOA,UAAU,MAAoB,wCAAwC;AAC7E,SAAqBC,YAAY,QAAQ,+CAA+C;AAexF,OAAO,MAAMC,aAAa,GAAG,cAAc;AAC3CF,UAAU,CAACG,aAAa,CAAC,CAACC,cAAc,EAAEC,QAAQ,KAAK;EACnD,MAAMC,GAAc,GAAG;IACnBC,MAAM,EAAE,EAAE;IACVC,KAAK,EAAE,EAAE;IACTC,YAAY,EAAE,EAAE;IAChBC,WAAW,EAAEN,cAAc,CAACO,WAAW;IACvCC,WAAW,EAAE,CAAC;IACdC,cAAc,EAAE;EACpB,CAAC;EACD,MAAMC,aAA+B,GAAGb,YAAY,CAAC;IACjDc,IAAI,EAAE;MACFC,QAAQ,EAAE;IACd,CAAC;IACDC,IAAI,EAAE,CAAC,CAAC;IACRC,KAAK,EAAE;MACHV,KAAK,EAAE,MAAM;MACbW,QAAQ,EAAE,QAAQ;MAClBC,iBAAiB,EAAE,EAAE;MACrBC,SAAS,EAAE,CACP;QACIC,KAAK,EAAE;MACX,CAAC;IAET,CAAC;IACDC,UAAU,EAAE,CAAC,CAAC;IACdC,SAAS,EAAE,CAAC,CAAC;IACbC,WAAW,EAAE,CAAC,CAAC;IACfC,QAAQ,EAAE;MACNV,QAAQ,EAAE,UAAU;MACpBW,GAAG,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CAAC;MACDpB,IAAI,EAAG;QACHC,KAAK,EAAEjC,cAAc,CAACoD;MAC1B;IACJ,CAAC;IACDjB,OAAO,EAAE;MACLxB,IAAI,EAAE;QACFiB,UAAU,EAAE,CAAC;QACbC,eAAe,EAAE,0BAA0B;QAC3CvB,WAAW,EAAEN,cAAc,CAACoD;MAChC,CAAC;MACDpB,IAAI,EAAG;QACHC,KAAK,EAAEjC,cAAc,CAACoD;MAC1B;IACJ;EACJ,CAA4B,CAAC;AACjC,CAAC,CAAC"}
|
|
@@ -101,7 +101,6 @@ export default class WmLabel extends BaseComponent {
|
|
|
101
101
|
target: this
|
|
102
102
|
}, /*#__PURE__*/React.createElement(Text, {
|
|
103
103
|
style: {
|
|
104
|
-
flex: 1,
|
|
105
104
|
flexWrap: "wrap"
|
|
106
105
|
}
|
|
107
106
|
}, (_this$state$parts = this.state.parts) === null || _this$state$parts === void 0 ? void 0 : _this$state$parts.map((part, index) => /*#__PURE__*/React.createElement(React.Fragment, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","Text","View","BaseComponent","BaseComponentState","Tappable","WmLabelProps","DEFAULT_CLASS","isNil","toString","Animatedview","createSkeleton","WmAnchor","WmLabelState","constructor","arguments","_defineProperty","WmLabel","props","getAsterisk","createElement","style","styles","asterisk","onPropertyChange","name","$new","$old","updateState","parts","parseCaption","getMultilineSkeleton","width","height","borderRadius","marginBottom","theme","skeleton","caption","pattern","linkRegex","captionSplit","split","i","length","isLink","test","part","isNextTextALink","text","link","push","renderSkeleton","_this$styles$root","_this$styles$root2","skeletonWidth","skeletonwidth","root","skeletonHeight","skeletonheight","fontSize","multilineskeleton","renderWidget","_this$state$parts","entryanimation","animation","_background","target","flex","flexWrap","state","map","index","Fragment","key","hyperlink","color","isValid","numberOfLines","wrap","undefined","selectable","userSelect","required"],"sources":["label.component.tsx"],"sourcesContent":["import React from 'react';\nimport { DimensionValue, Text, View } from 'react-native';\nimport { BaseComponent, BaseComponentState } from '@wavemaker/app-rn-runtime/core/base.component';\nimport { Tappable } from '@wavemaker/app-rn-runtime/core/tappable.component';\n\nimport WmLabelProps from './label.props';\nimport { DEFAULT_CLASS, WmLabelStyles } from './label.styles';\nimport { isNil, toString } from 'lodash-es';\nimport { Animatedview } from '@wavemaker/app-rn-runtime/components/basic/animatedview.component';\nimport WmSkeleton, { createSkeleton } from '../skeleton/skeleton.component';\nimport { totalMonths } from 'react-native-paper-dates/lib/typescript/Date/dateUtils';\nimport WmAnchor from '../anchor/anchor.component';\n\ntype PartType = {\n text?: string,\n link?: string,\n};\n\nexport class WmLabelState extends BaseComponentState<WmLabelProps> {\n parts: PartType[] = []\n}\n\nexport default class WmLabel extends BaseComponent<WmLabelProps, WmLabelState, WmLabelStyles> {\n\n constructor(props: WmLabelProps) {\n super(props, DEFAULT_CLASS, new WmLabelProps(), new WmLabelState());\n }\n\n private getAsterisk () {\n return <Text style={this.styles.asterisk}>*</Text>;\n }\n\n public onPropertyChange(name: string, $new: any, $old: any): void {\n super.onPropertyChange(name, $new, $old);\n\n switch(name) {\n case \"caption\":\n this.updateState({\n parts: this.parseCaption($new)\n } as WmLabelState);\n break;\n }\n }\n private getMultilineSkeleton(width: any, height: any) {\n const styles = {\n borderRadius:4,\n marginBottom: 10,\n height: height\n };\n return createSkeleton(this.theme, this.styles.skeleton, {\n ...styles,\n width: width,\n height: height\n });\n }\n\n parseCaption(caption: string) {\n if (!caption) {\n return [];\n }\n caption += '';\n const pattern = /\\[([^\\]]+)\\]\\((http.*?[^)])\\)/g;\n const linkRegex = /^(http|https):\\/\\/[^ \"]+$/;\n const captionSplit = caption.split(pattern);\n\n let parts = [];\n\n for (let i = 0; i < captionSplit.length; i++) {\n const isLink = linkRegex.test(captionSplit[i]);\n let part: PartType = {};\n \n const isNextTextALink = linkRegex.test(captionSplit[i + 1]) || false;\n if (isLink) {\n part.text = captionSplit[i - 1] ?? '';\n part.link = captionSplit[i];\n } else {\n part.text = isNextTextALink ? \"\" : captionSplit[i];\n };\n\n if (part.text) {\n parts.push(part);\n }\n }\n\n return parts;\n }\n\n public renderSkeleton(props: WmLabelProps){\n const skeletonWidth = this.props.skeletonwidth || this.styles.root?.width;\n const skeletonHeight = this.props.skeletonheight || this.styles.root?.height || this.styles.text.fontSize;\n if(this.props.multilineskeleton) {\n return (<View style={{\n width: skeletonWidth as DimensionValue\n }}>\n {this.getMultilineSkeleton('100%', skeletonHeight)}\n {this.getMultilineSkeleton('70%', skeletonHeight)}\n {this.getMultilineSkeleton('40%', skeletonHeight)}\n </View>)\n }\n else{\n return createSkeleton(this.theme, this.styles.skeleton, {\n ...this.styles.root,\n width: skeletonWidth as DimensionValue,\n height: skeletonHeight as DimensionValue\n }); \n }\n }\n\n renderWidget(props: WmLabelProps) {\n return !isNil(props.caption) ? (\n <Animatedview entryanimation={props.animation} style={this.styles.root}>\n {this._background}\n <Tappable target={this}>\n <Text style={{flex: 1, flexWrap: \"wrap\"}}>\n {this.state.parts?.map((part, index) => (\n <React.Fragment key={`part_${index}`}>\n {part.link ? (\n <WmAnchor styles={this.styles.link} caption={part.text} hyperlink={part.link} />\n ) : (\n <Text\n style={[\n this.styles.text,\n {\n color:\n props.isValid === false\n ? 'red'\n : this.styles.text.color,\n },\n ]}\n numberOfLines={props.wrap ? undefined : 1}\n selectable={this.styles.text.userSelect === 'text'}\n >\n {toString(part.text)}\n {props.required && this.getAsterisk()}\n </Text>\n )}\n </React.Fragment>\n ))}\n </Text>\n </Tappable>\n </Animatedview>\n ) : null;\n }\n}\n"],"mappings":";;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAAyBC,IAAI,EAAEC,IAAI,QAAQ,cAAc;AACzD,SAASC,aAAa,EAAEC,kBAAkB,QAAQ,+CAA+C;AACjG,SAASC,QAAQ,QAAQ,mDAAmD;AAE5E,OAAOC,YAAY,MAAM,eAAe;AACxC,SAASC,aAAa,QAAuB,gBAAgB;AAC7D,SAASC,KAAK,EAAEC,QAAQ,QAAQ,WAAW;AAC3C,SA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AkC,iBAAA,uBAAhBA,iBAAA,CAAkBQ,GAAG,CAAC,CAACxB,IAAI,EAAEyB,KAAK,kBACjCxE,KAAA,CAAAoB,aAAA,CAACpB,KAAK,CAACyE,QAAQ;MAACC,GAAG,EAAG,QAAOF,KAAM;IAAE,GAClCzB,IAAI,CAACG,IAAI,gBACRlD,KAAA,CAAAoB,aAAA,CAACR,QAAQ;MAACU,MAAM,EAAE,IAAI,CAACA,MAAM,CAAC4B,IAAK;MAACZ,OAAO,EAAES,IAAI,CAACE,IAAK;MAAC0B,SAAS,EAAE5B,IAAI,CAACG;IAAK,CAAE,CAAC,gBAEhFlD,KAAA,CAAAoB,aAAA,CAACnB,IAAI;MACHoB,KAAK,EAAE,CACL,IAAI,CAACC,MAAM,CAAC2B,IAAI,EAChB;QACE2B,KAAK,EACH1D,KAAK,CAAC2D,OAAO,KAAK,KAAK,GACnB,KAAK,GACL,IAAI,CAACvD,MAAM,CAAC2B,IAAI,CAAC2B;MACzB,CAAC,CACD;MACFE,aAAa,EAAE5D,KAAK,CAAC6D,IAAI,GAAGC,SAAS,GAAG,CAAE;MAC1CC,UAAU,EAAE,IAAI,CAAC3D,MAAM,CAAC2B,IAAI,CAACiC,UAAU,KAAK;IAAO,GAElDzE,QAAQ,CAACsC,IAAI,CAACE,IAAI,CAAC,EACnB/B,KAAK,CAACiE,QAAQ,IAAI,IAAI,CAAChE,WAAW,CAAC,CAChC,CAEM,CACjB,CACG,CACE,CACE,CAAC,GACb,IAAI;EACV;AACF"}
|
|
1
|
+
{"version":3,"names":["React","Text","View","BaseComponent","BaseComponentState","Tappable","WmLabelProps","DEFAULT_CLASS","isNil","toString","Animatedview","createSkeleton","WmAnchor","WmLabelState","constructor","arguments","_defineProperty","WmLabel","props","getAsterisk","createElement","style","styles","asterisk","onPropertyChange","name","$new","$old","updateState","parts","parseCaption","getMultilineSkeleton","width","height","borderRadius","marginBottom","theme","skeleton","caption","pattern","linkRegex","captionSplit","split","i","length","isLink","test","part","isNextTextALink","text","link","push","renderSkeleton","_this$styles$root","_this$styles$root2","skeletonWidth","skeletonwidth","root","skeletonHeight","skeletonheight","fontSize","multilineskeleton","renderWidget","_this$state$parts","entryanimation","animation","_background","target","flexWrap","state","map","index","Fragment","key","hyperlink","color","isValid","numberOfLines","wrap","undefined","selectable","userSelect","required"],"sources":["label.component.tsx"],"sourcesContent":["import React from 'react';\nimport { DimensionValue, Text, View } from 'react-native';\nimport { BaseComponent, BaseComponentState } from '@wavemaker/app-rn-runtime/core/base.component';\nimport { Tappable } from '@wavemaker/app-rn-runtime/core/tappable.component';\n\nimport WmLabelProps from './label.props';\nimport { DEFAULT_CLASS, WmLabelStyles } from './label.styles';\nimport { isNil, toString } from 'lodash-es';\nimport { Animatedview } from '@wavemaker/app-rn-runtime/components/basic/animatedview.component';\nimport WmSkeleton, { createSkeleton } from '../skeleton/skeleton.component';\nimport { totalMonths } from 'react-native-paper-dates/lib/typescript/Date/dateUtils';\nimport WmAnchor from '../anchor/anchor.component';\n\ntype PartType = {\n text?: string,\n link?: string,\n};\n\nexport class WmLabelState extends BaseComponentState<WmLabelProps> {\n parts: PartType[] = []\n}\n\nexport default class WmLabel extends BaseComponent<WmLabelProps, WmLabelState, WmLabelStyles> {\n\n constructor(props: WmLabelProps) {\n super(props, DEFAULT_CLASS, new WmLabelProps(), new WmLabelState());\n }\n\n private getAsterisk () {\n return <Text style={this.styles.asterisk}>*</Text>;\n }\n\n public onPropertyChange(name: string, $new: any, $old: any): void {\n super.onPropertyChange(name, $new, $old);\n\n switch(name) {\n case \"caption\":\n this.updateState({\n parts: this.parseCaption($new)\n } as WmLabelState);\n break;\n }\n }\n private getMultilineSkeleton(width: any, height: any) {\n const styles = {\n borderRadius:4,\n marginBottom: 10,\n height: height\n };\n return createSkeleton(this.theme, this.styles.skeleton, {\n ...styles,\n width: width,\n height: height\n });\n }\n\n parseCaption(caption: string) {\n if (!caption) {\n return [];\n }\n caption += '';\n const pattern = /\\[([^\\]]+)\\]\\((http.*?[^)])\\)/g;\n const linkRegex = /^(http|https):\\/\\/[^ \"]+$/;\n const captionSplit = caption.split(pattern);\n\n let parts = [];\n\n for (let i = 0; i < captionSplit.length; i++) {\n const isLink = linkRegex.test(captionSplit[i]);\n let part: PartType = {};\n \n const isNextTextALink = linkRegex.test(captionSplit[i + 1]) || false;\n if (isLink) {\n part.text = captionSplit[i - 1] ?? '';\n part.link = captionSplit[i];\n } else {\n part.text = isNextTextALink ? \"\" : captionSplit[i];\n };\n\n if (part.text) {\n parts.push(part);\n }\n }\n\n return parts;\n }\n\n public renderSkeleton(props: WmLabelProps){\n const skeletonWidth = this.props.skeletonwidth || this.styles.root?.width;\n const skeletonHeight = this.props.skeletonheight || this.styles.root?.height || this.styles.text.fontSize;\n if(this.props.multilineskeleton) {\n return (<View style={{\n width: skeletonWidth as DimensionValue\n }}>\n {this.getMultilineSkeleton('100%', skeletonHeight)}\n {this.getMultilineSkeleton('70%', skeletonHeight)}\n {this.getMultilineSkeleton('40%', skeletonHeight)}\n </View>)\n }\n else{\n return createSkeleton(this.theme, this.styles.skeleton, {\n ...this.styles.root,\n width: skeletonWidth as DimensionValue,\n height: skeletonHeight as DimensionValue\n }); \n }\n }\n\n renderWidget(props: WmLabelProps) {\n return !isNil(props.caption) ? (\n <Animatedview entryanimation={props.animation} style={this.styles.root}>\n {this._background}\n <Tappable target={this}>\n <Text style={{flexWrap: \"wrap\"}}>\n {this.state.parts?.map((part, index) => (\n <React.Fragment key={`part_${index}`}>\n {part.link ? (\n <WmAnchor styles={this.styles.link} caption={part.text} hyperlink={part.link} />\n ) : (\n <Text\n style={[\n this.styles.text,\n {\n color:\n props.isValid === false\n ? 'red'\n : this.styles.text.color,\n },\n ]}\n numberOfLines={props.wrap ? undefined : 1}\n selectable={this.styles.text.userSelect === 'text'}\n >\n {toString(part.text)}\n {props.required && this.getAsterisk()}\n </Text>\n )}\n </React.Fragment>\n ))}\n </Text>\n </Tappable>\n </Animatedview>\n ) : null;\n }\n}\n"],"mappings":";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extends BaseComponent {
|
|
|
13
13
|
}
|
|
14
14
|
renderWidget(props) {
|
|
15
15
|
let value = (props.datavalue - props.minvalue) / (props.maxvalue - props.minvalue);
|
|
16
|
-
value = Math.round(isNaN(value) ? 0 : value);
|
|
17
16
|
const styles = this.theme.mergeStyle(this.theme.getStyle(`app-${props.type}-progress-bar`), this.styles);
|
|
18
17
|
return /*#__PURE__*/React.createElement(View, {
|
|
19
18
|
style: styles.root
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","View","ProgressBar","Tappable","BaseComponent","BaseComponentState","WmProgressBarProps","DEFAULT_CLASS","WmProgressBarState","WmProgressBar","constructor","props","renderWidget","value","datavalue","minvalue","maxvalue","
|
|
1
|
+
{"version":3,"names":["React","View","ProgressBar","Tappable","BaseComponent","BaseComponentState","WmProgressBarProps","DEFAULT_CLASS","WmProgressBarState","WmProgressBar","constructor","props","renderWidget","value","datavalue","minvalue","maxvalue","styles","theme","mergeStyle","getStyle","type","createElement","style","root","_background","_extends","getTestPropsForAction","target","width","height","testID","getTestId","progress","color","progressValue","progressBar"],"sources":["progress-bar.component.tsx"],"sourcesContent":["import React from 'react';\nimport { View } from 'react-native';\nimport { ProgressBar } from 'react-native-paper';\nimport { Tappable } from '@wavemaker/app-rn-runtime/core/tappable.component';\nimport { BaseComponent, BaseComponentState } from '@wavemaker/app-rn-runtime/core/base.component';\n\nimport WmProgressBarProps from './progress-bar.props';\nimport { DEFAULT_CLASS, WmProgressBarStyles } from './progress-bar.styles';\n\nexport class WmProgressBarState extends BaseComponentState<WmProgressBarProps> {}\n\nexport default class WmProgressBar extends BaseComponent<WmProgressBarProps, WmProgressBarState, WmProgressBarStyles> {\n\n constructor(props: WmProgressBarProps) {\n super(props, DEFAULT_CLASS, new WmProgressBarProps());\n }\n\n renderWidget(props: WmProgressBarProps) {\n let value = (props.datavalue - props.minvalue) / (props.maxvalue - props.minvalue);\n const styles = this.theme.mergeStyle(this.theme.getStyle(`app-${props.type}-progress-bar`), this.styles);\n return (\n <View style={styles.root}>\n {this._background}\n <Tappable {...this.getTestPropsForAction()} target={this} styles={{root:{width: '100%', height: '100%'}}}>\n <ProgressBar\n testID={this.getTestId('progressbar')}\n progress={value}\n color={styles.progressValue.color}\n style={[styles.progressBar, {height: styles.root.height || styles.progressBar.height}]}></ProgressBar>\n </Tappable>\n </View>); \n }\n\n}\n"],"mappings":";AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,IAAI,QAAQ,cAAc;AACnC,SAASC,WAAW,QAAQ,oBAAoB;AAChD,SAASC,QAAQ,QAAQ,mDAAmD;AAC5E,SAASC,aAAa,EAAEC,kBAAkB,QAAQ,+CAA+C;AAEjG,OAAOC,kBAAkB,MAAM,sBAAsB;AACrD,SAASC,aAAa,QAA6B,uBAAuB;AAE1E,OAAO,MAAMC,kBAAkB,SAASH,kBAAkB,CAAqB;AAE/E,eAAe,MAAMI,aAAa,SAASL,aAAa,CAA8D;EAEpHM,WAAWA,CAACC,KAAyB,EAAE;IACrC,KAAK,CAACA,KAAK,EAAEJ,aAAa,EAAE,IAAID,kBAAkB,CAAC,CAAC,CAAC;EACvD;EAEAM,YAAYA,CAACD,KAAyB,EAAE;IACtC,IAAIE,KAAK,GAAG,CAACF,KAAK,CAACG,SAAS,GAAGH,KAAK,CAACI,QAAQ,KAAKJ,KAAK,CAACK,QAAQ,GAAGL,KAAK,CAACI,QAAQ,CAAC;IAClF,MAAME,MAAM,GAAG,IAAI,CAACC,KAAK,CAACC,UAAU,CAAC,IAAI,CAACD,KAAK,CAACE,QAAQ,CAAE,OAAMT,KAAK,CAACU,IAAK,eAAc,CAAC,EAAE,IAAI,CAACJ,MAAM,CAAC;IACxG,oBACAjB,KAAA,CAAAsB,aAAA,CAACrB,IAAI;MAACsB,KAAK,EAAEN,MAAM,CAACO;IAAK,GACtB,IAAI,CAACC,WAAW,eACjBzB,KAAA,CAAAsB,aAAA,CAACnB,QAAQ,EAAAuB,QAAA,KAAK,IAAI,CAACC,qBAAqB,CAAC,CAAC;MAAEC,MAAM,EAAE,IAAK;MAACX,MAAM,EAAE;QAACO,IAAI,EAAC;UAACK,KAAK,EAAE,MAAM;UAAEC,MAAM,EAAE;QAAM;MAAC;IAAE,iBACvG9B,KAAA,CAAAsB,aAAA,CAACpB,WAAW;MACV6B,MAAM,EAAE,IAAI,CAACC,SAAS,CAAC,aAAa,CAAE;MACtCC,QAAQ,EAAEpB,KAAM;MAChBqB,KAAK,EAAEjB,MAAM,CAACkB,aAAa,CAACD,KAAM;MAClCX,KAAK,EAAE,CAACN,MAAM,CAACmB,WAAW,EAAE;QAACN,MAAM,EAAEb,MAAM,CAACO,IAAI,CAACM,MAAM,IAAIb,MAAM,CAACmB,WAAW,CAACN;MAAM,CAAC;IAAE,CAAc,CAC/F,CACN,CAAC;EACT;AAEF"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { View } from 'react-native';
|
|
3
3
|
import { Svg } from 'react-native-svg';
|
|
4
|
-
import { VictoryChart, VictoryLine, VictoryLegend, VictoryScatter, VictoryGroup
|
|
4
|
+
import { VictoryChart, VictoryLine, VictoryLegend, VictoryScatter, VictoryGroup } from 'victory-native';
|
|
5
5
|
import WmLineChartProps from './line-chart.props';
|
|
6
6
|
import { DEFAULT_CLASS } from './line-chart.styles';
|
|
7
7
|
import { BaseChartComponent, BaseChartComponentState } from "@wavemaker/app-rn-runtime/components/chart/basechart.component";
|
|
@@ -19,14 +19,6 @@ export default class WmLineChart extends BaseChartComponent {
|
|
|
19
19
|
return /*#__PURE__*/React.createElement(View, {
|
|
20
20
|
style: this.styles.root
|
|
21
21
|
}, /*#__PURE__*/React.createElement(VictoryChart, {
|
|
22
|
-
containerComponent: /*#__PURE__*/React.createElement(VictoryVoronoiContainer, {
|
|
23
|
-
labels: _ref => {
|
|
24
|
-
let {
|
|
25
|
-
datum
|
|
26
|
-
} = _ref;
|
|
27
|
-
return `${datum.x}, ${datum.y}`;
|
|
28
|
-
}
|
|
29
|
-
}),
|
|
30
22
|
theme: this.state.theme,
|
|
31
23
|
height: this.styles.root.height,
|
|
32
24
|
width: this.styles.root.width || this.screenWidth,
|
|
@@ -48,32 +40,18 @@ export default class WmLineChart extends BaseChartComponent {
|
|
|
48
40
|
}), this.getLegendView(), this.getXaxis(), this.getYAxis(), this.state.data.map((d, i) => {
|
|
49
41
|
return /*#__PURE__*/React.createElement(VictoryGroup, {
|
|
50
42
|
key: props.name + '_line_group_' + i
|
|
51
|
-
}, /*#__PURE__*/React.createElement(
|
|
52
|
-
interpolation: props.interpolation,
|
|
53
|
-
key: props.name + '_area_' + i,
|
|
54
|
-
name: props.name + '_area_' + i,
|
|
55
|
-
standalone: true,
|
|
56
|
-
style: {
|
|
57
|
-
data: {
|
|
58
|
-
fill: '#90EE90',
|
|
59
|
-
// Set the fill color to green
|
|
60
|
-
fillOpacity: 0.8 // Adjust the opacity as needed
|
|
61
|
-
}
|
|
62
|
-
},
|
|
63
|
-
|
|
64
|
-
data: this.isRTL ? d.toReversed() : d
|
|
65
|
-
}), /*#__PURE__*/React.createElement(VictoryLine, {
|
|
43
|
+
}, /*#__PURE__*/React.createElement(VictoryLine, {
|
|
66
44
|
interpolation: props.interpolation,
|
|
67
45
|
key: props.name + '_line_' + i,
|
|
68
46
|
name: props.name + '_line_' + i,
|
|
69
47
|
standalone: true,
|
|
70
48
|
style: {
|
|
71
49
|
data: {
|
|
72
|
-
stroke:
|
|
50
|
+
stroke: this.state.colors[i] || ThemeVariables.INSTANCE.chartLineColor,
|
|
73
51
|
strokeWidth: props.linethickness
|
|
74
52
|
}
|
|
75
53
|
},
|
|
76
|
-
data:
|
|
54
|
+
data: d
|
|
77
55
|
}), props.highlightpoints || this.state.data.length === 1 ? /*#__PURE__*/React.createElement(VictoryScatter, {
|
|
78
56
|
size: 5,
|
|
79
57
|
key: props.name + '_scatter' + i,
|
|
@@ -82,11 +60,8 @@ export default class WmLineChart extends BaseChartComponent {
|
|
|
82
60
|
fill: this.state.colors[i],
|
|
83
61
|
opacity: 0.8
|
|
84
62
|
}
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
// data={this.isRTL?d.toReversed():d}
|
|
88
|
-
,
|
|
89
|
-
data: this.isRTL ? d.toReversed() : [d[d.length - 1]]
|
|
63
|
+
},
|
|
64
|
+
data: d
|
|
90
65
|
}) : null);
|
|
91
66
|
})));
|
|
92
67
|
}
|