@wavemaker/app-rn-runtime 11.5.0-next.40003 → 11.5.0-next.40301
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-template/carousel-template.component.js +1 -4
- app-rn-runtime/components/advanced/carousel/carousel-template/carousel-template.component.js.map +1 -1
- app-rn-runtime/components/advanced/carousel/carousel-template/carousel-template.styles.js +2 -1
- app-rn-runtime/components/advanced/carousel/carousel-template/carousel-template.styles.js.map +1 -1
- app-rn-runtime/components/advanced/carousel/carousel.component.js +68 -122
- app-rn-runtime/components/advanced/carousel/carousel.component.js.map +1 -1
- app-rn-runtime/components/advanced/carousel/carousel.props.js +0 -3
- app-rn-runtime/components/advanced/carousel/carousel.props.js.map +1 -1
- app-rn-runtime/components/advanced/carousel/carousel.styles.js +9 -17
- app-rn-runtime/components/advanced/carousel/carousel.styles.js.map +1 -1
- app-rn-runtime/components/basic/button/button.component.js +2 -2
- app-rn-runtime/components/basic/button/button.component.js.map +1 -1
- app-rn-runtime/components/basic/icon/icon.component.js +0 -3
- app-rn-runtime/components/basic/icon/icon.component.js.map +1 -1
- app-rn-runtime/components/basic/search/search.component.js +1 -3
- app-rn-runtime/components/basic/search/search.component.js.map +1 -1
- app-rn-runtime/components/chart/basechart.component.js +8 -19
- app-rn-runtime/components/chart/basechart.component.js.map +1 -1
- app-rn-runtime/components/container/accordion/accordion.component.js +2 -6
- app-rn-runtime/components/container/accordion/accordion.component.js.map +1 -1
- app-rn-runtime/components/container/accordion/accordionpane/accordionpane.component.js +2 -3
- app-rn-runtime/components/container/accordion/accordionpane/accordionpane.component.js.map +1 -1
- app-rn-runtime/components/container/panel/panel.component.js +1 -1
- app-rn-runtime/components/container/panel/panel.component.js.map +1 -1
- app-rn-runtime/components/container/partial-host.component.js +1 -1
- app-rn-runtime/components/container/partial-host.component.js.map +1 -1
- app-rn-runtime/components/container/tabs/tabpane/tabpane.component.js +1 -1
- app-rn-runtime/components/container/tabs/tabpane/tabpane.component.js.map +1 -1
- app-rn-runtime/components/container/wizard/wizard.component.js +2 -2
- app-rn-runtime/components/container/wizard/wizard.component.js.map +1 -1
- app-rn-runtime/components/container/wizard/wizard.styles.js +1 -3
- app-rn-runtime/components/container/wizard/wizard.styles.js.map +1 -1
- app-rn-runtime/components/data/card/card-content/card-content.component.js +1 -1
- app-rn-runtime/components/data/card/card-content/card-content.component.js.map +1 -1
- app-rn-runtime/components/data/list/list-template/list-template.component.js +1 -15
- app-rn-runtime/components/data/list/list-template/list-template.component.js.map +1 -1
- app-rn-runtime/components/data/list/list-template/list-template.styles.js +3 -7
- app-rn-runtime/components/data/list/list-template/list-template.styles.js.map +1 -1
- app-rn-runtime/components/data/list/list.component.js +25 -30
- app-rn-runtime/components/data/list/list.component.js.map +1 -1
- app-rn-runtime/components/data/list/list.props.js +0 -6
- app-rn-runtime/components/data/list/list.props.js.map +1 -1
- app-rn-runtime/components/dialogs/dialogcontent/dialogcontent.component.js +2 -4
- app-rn-runtime/components/dialogs/dialogcontent/dialogcontent.component.js.map +1 -1
- app-rn-runtime/components/dialogs/dialogcontent/dialogcontent.styles.js +1 -2
- app-rn-runtime/components/dialogs/dialogcontent/dialogcontent.styles.js.map +1 -1
- app-rn-runtime/components/input/composite/composite.component.js +1 -8
- app-rn-runtime/components/input/composite/composite.component.js.map +1 -1
- app-rn-runtime/components/input/composite/composite.props.js +0 -1
- app-rn-runtime/components/input/composite/composite.props.js.map +1 -1
- app-rn-runtime/components/input/composite/composite.styles.js +1 -16
- app-rn-runtime/components/input/composite/composite.styles.js.map +1 -1
- app-rn-runtime/components/input/radioset/radioset.component.js +3 -7
- app-rn-runtime/components/input/radioset/radioset.component.js.map +1 -1
- app-rn-runtime/components/input/radioset/radioset.props.js +0 -6
- app-rn-runtime/components/input/radioset/radioset.props.js.map +1 -1
- app-rn-runtime/components/input/radioset/radioset.styles.js +8 -4
- app-rn-runtime/components/input/radioset/radioset.styles.js.map +1 -1
- app-rn-runtime/components/input/select/select.styles.js +1 -2
- app-rn-runtime/components/input/select/select.styles.js.map +1 -1
- app-rn-runtime/components/input/switch/switch.styles.js +1 -2
- app-rn-runtime/components/input/switch/switch.styles.js.map +1 -1
- app-rn-runtime/components/navigation/basenav/basenav.component.js +0 -2
- app-rn-runtime/components/navigation/basenav/basenav.component.js.map +1 -1
- app-rn-runtime/components/navigation/navitem/navitem.component.js +1 -1
- app-rn-runtime/components/navigation/navitem/navitem.component.js.map +1 -1
- app-rn-runtime/components/navigation/popover/popover.component.js +1 -3
- app-rn-runtime/components/navigation/popover/popover.component.js.map +1 -1
- app-rn-runtime/components/navigation/popover/popover.props.js.map +1 -1
- app-rn-runtime/components/page/left-panel/left-panel.component.js +1 -1
- app-rn-runtime/components/page/left-panel/left-panel.component.js.map +1 -1
- app-rn-runtime/components/page/tabbar/tabbar.styles.js +0 -22
- app-rn-runtime/components/page/tabbar/tabbar.styles.js.map +1 -1
- app-rn-runtime/core/imageSizeEstimator.js +0 -4
- app-rn-runtime/core/imageSizeEstimator.js.map +1 -1
- app-rn-runtime/gestures/swipe.animation.js +11 -34
- app-rn-runtime/gestures/swipe.animation.js.map +1 -1
- app-rn-runtime/package.json +3 -3
- app-rn-runtime/runtime/App.js +1 -4
- app-rn-runtime/runtime/App.js.map +1 -1
- app-rn-runtime/runtime/base-page.component.js +0 -17
- app-rn-runtime/runtime/base-page.component.js.map +1 -1
- app-rn-runtime/runtime/services/app-security.service.js +3 -14
- app-rn-runtime/runtime/services/app-security.service.js.map +1 -1
- app-rn-runtime/styles/theme.js +1 -30
- app-rn-runtime/styles/theme.js.map +1 -1
- app-rn-runtime/variables/http.service.js +1 -1
- app-rn-runtime/variables/http.service.js.map +1 -1
- app-rn-runtime/variables/live-variable.js +0 -1
- app-rn-runtime/variables/live-variable.js.map +1 -1
- app-rn-runtime/variables/model-variable.js +0 -11
- app-rn-runtime/variables/model-variable.js.map +1 -1
- app-rn-runtime/variables/service-variable.js +0 -1
- app-rn-runtime/variables/service-variable.js.map +1 -1
- app-rn-runtime/components/chart/stack-chart/stack-chart.component.js +0 -213
- app-rn-runtime/components/chart/stack-chart/stack-chart.component.js.map +0 -1
- app-rn-runtime/components/chart/stack-chart/stack-chart.props.js +0 -15
- app-rn-runtime/components/chart/stack-chart/stack-chart.props.js.map +0 -1
- app-rn-runtime/components/chart/stack-chart/stack-chart.styles.js +0 -7
- app-rn-runtime/components/chart/stack-chart/stack-chart.styles.js.map +0 -1
- app-rn-runtime/core/key.extractor.js +0 -22
- app-rn-runtime/core/key.extractor.js.map +0 -1
app-rn-runtime/components/advanced/carousel/carousel-template/carousel-template.component.js
CHANGED
|
@@ -9,11 +9,8 @@ export default class WmCarouselTemplate extends BaseComponent {
|
|
|
9
9
|
super(props, DEFAULT_CLASS, new WmCarouselTemplateProps());
|
|
10
10
|
}
|
|
11
11
|
renderWidget(props) {
|
|
12
|
-
var _this$parent;
|
|
13
12
|
return /*#__PURE__*/React.createElement(View, {
|
|
14
|
-
style:
|
|
15
|
-
height: this.styles.root.height || ((_this$parent = this.parent) === null || _this$parent === void 0 ? void 0 : _this$parent.styles.root.height) && '100%'
|
|
16
|
-
}]
|
|
13
|
+
style: this.styles.root
|
|
17
14
|
}, this._background, props.children);
|
|
18
15
|
}
|
|
19
16
|
}
|
app-rn-runtime/components/advanced/carousel/carousel-template/carousel-template.component.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","View","BaseComponent","BaseComponentState","WmCarouselTemplateProps","DEFAULT_CLASS","WmCarouselTemplateState","WmCarouselTemplate","constructor","props","renderWidget","
|
|
1
|
+
{"version":3,"names":["React","View","BaseComponent","BaseComponentState","WmCarouselTemplateProps","DEFAULT_CLASS","WmCarouselTemplateState","WmCarouselTemplate","constructor","props","renderWidget","createElement","style","styles","root","_background","children"],"sources":["carousel-template.component.tsx"],"sourcesContent":["import React from 'react';\nimport { View } from 'react-native';\nimport { BaseComponent, BaseComponentState } from '@wavemaker/app-rn-runtime/core/base.component';\n\nimport WmCarouselTemplateProps from './carousel-template.props';\nimport { DEFAULT_CLASS, WmCarouselTemplateStyles } from './carousel-template.styles';\n\nexport class WmCarouselTemplateState extends BaseComponentState<WmCarouselTemplateProps> {}\n\nexport default class WmCarouselTemplate extends BaseComponent<WmCarouselTemplateProps, WmCarouselTemplateState, WmCarouselTemplateStyles> {\n\n constructor(props: WmCarouselTemplateProps) {\n super(props, DEFAULT_CLASS, new WmCarouselTemplateProps());\n }\n\n renderWidget(props: WmCarouselTemplateProps) {\n return (<View style={this.styles.root}>{this._background}{props.children}</View>); \n }\n}\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,IAAI,QAAQ,cAAc;AACnC,SAASC,aAAa,EAAEC,kBAAkB,QAAQ,+CAA+C;AAEjG,OAAOC,uBAAuB,MAAM,2BAA2B;AAC/D,SAASC,aAAa,QAAkC,4BAA4B;AAEpF,OAAO,MAAMC,uBAAuB,SAASH,kBAAkB,CAA0B;AAEzF,eAAe,MAAMI,kBAAkB,SAASL,aAAa,CAA6E;EAExIM,WAAWA,CAACC,KAA8B,EAAE;IAC1C,KAAK,CAACA,KAAK,EAAEJ,aAAa,EAAE,IAAID,uBAAuB,CAAC,CAAC,CAAC;EAC5D;EAEAM,YAAYA,CAACD,KAA8B,EAAE;IAC3C,oBAAQT,KAAA,CAAAW,aAAA,CAACV,IAAI;MAACW,KAAK,EAAE,IAAI,CAACC,MAAM,CAACC;IAAK,GAAE,IAAI,CAACC,WAAW,EAAEN,KAAK,CAACO,QAAe,CAAC;EAClF;AACF"}
|
app-rn-runtime/components/advanced/carousel/carousel-template/carousel-template.styles.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["BASE_THEME","defineStyles","DEFAULT_CLASS","registerStyle","themeVariables","addStyle","defaultStyles","root","flexDirection","justifyContent","alignItems","width","text"],"sources":["carousel-template.styles.ts"],"sourcesContent":["import BASE_THEME from '@wavemaker/app-rn-runtime/styles/theme';\nimport { BaseStyles, defineStyles } from '@wavemaker/app-rn-runtime/core/base.component';\n\nexport type WmCarouselTemplateStyles = BaseStyles & {};\n\nexport const DEFAULT_CLASS = 'app-carousel-template';\n\nBASE_THEME.registerStyle((themeVariables, addStyle) => {\n const defaultStyles: WmCarouselTemplateStyles = defineStyles({\n root: {\n flexDirection: 'column',\n justifyContent: 'center',\n alignItems: 'center',\n width: '100%'\n },\n text: {}\n });\n\n addStyle(DEFAULT_CLASS, '', defaultStyles);\n});"],"mappings":"AAAA,OAAOA,UAAU,MAAM,wCAAwC;AAC/D,SAAqBC,YAAY,QAAQ,+CAA+C;AAIxF,OAAO,MAAMC,aAAa,GAAG,uBAAuB;AAEpDF,UAAU,CAACG,aAAa,CAAC,CAACC,cAAc,EAAEC,QAAQ,KAAK;EACnD,MAAMC,aAAuC,GAAGL,YAAY,CAAC;IACzDM,IAAI,EAAE;MACFC,aAAa,EAAE,QAAQ;MACvBC,cAAc,EAAE,QAAQ;MACxBC,UAAU,EAAE,QAAQ;MACpBC,KAAK,EAAE;
|
|
1
|
+
{"version":3,"names":["BASE_THEME","defineStyles","DEFAULT_CLASS","registerStyle","themeVariables","addStyle","defaultStyles","root","flexDirection","justifyContent","alignItems","width","height","text"],"sources":["carousel-template.styles.ts"],"sourcesContent":["import BASE_THEME from '@wavemaker/app-rn-runtime/styles/theme';\nimport { BaseStyles, defineStyles } from '@wavemaker/app-rn-runtime/core/base.component';\n\nexport type WmCarouselTemplateStyles = BaseStyles & {};\n\nexport const DEFAULT_CLASS = 'app-carousel-template';\n\nBASE_THEME.registerStyle((themeVariables, addStyle) => {\n const defaultStyles: WmCarouselTemplateStyles = defineStyles({\n root: {\n flexDirection: 'column',\n justifyContent: 'center',\n alignItems: 'center',\n width: '100%',\n height: '100%'\n },\n text: {}\n });\n\n addStyle(DEFAULT_CLASS, '', defaultStyles);\n});"],"mappings":"AAAA,OAAOA,UAAU,MAAM,wCAAwC;AAC/D,SAAqBC,YAAY,QAAQ,+CAA+C;AAIxF,OAAO,MAAMC,aAAa,GAAG,uBAAuB;AAEpDF,UAAU,CAACG,aAAa,CAAC,CAACC,cAAc,EAAEC,QAAQ,KAAK;EACnD,MAAMC,aAAuC,GAAGL,YAAY,CAAC;IACzDM,IAAI,EAAE;MACFC,aAAa,EAAE,QAAQ;MACvBC,cAAc,EAAE,QAAQ;MACxBC,UAAU,EAAE,QAAQ;MACpBC,KAAK,EAAE,MAAM;MACbC,MAAM,EAAE;IACZ,CAAC;IACDC,IAAI,EAAE,CAAC;EACX,CAAC,CAAC;EAEFR,QAAQ,CAACH,aAAa,EAAE,EAAE,EAAEI,aAAa,CAAC;AAC9C,CAAC,CAAC"}
|
|
@@ -2,121 +2,87 @@ 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 {
|
|
6
|
-
import {
|
|
7
|
-
import { DefaultKeyExtractor } from '@wavemaker/app-rn-runtime/core/key.extractor';
|
|
5
|
+
import { View, Text } from 'react-native';
|
|
6
|
+
import Carousel, { Pagination } from 'react-native-snap-carousel';
|
|
8
7
|
import WmIcon from '@wavemaker/app-rn-runtime/components/basic/icon/icon.component';
|
|
9
8
|
import { BaseComponent, BaseComponentState } from '@wavemaker/app-rn-runtime/core/base.component';
|
|
10
|
-
import * as SwipeAnimation from '@wavemaker/app-rn-runtime/gestures/swipe.animation';
|
|
11
9
|
import WmCarouselProps from './carousel.props';
|
|
12
10
|
import { DEFAULT_CLASS } from './carousel.styles';
|
|
13
11
|
export class WmCarouselState extends BaseComponentState {
|
|
14
12
|
constructor() {
|
|
15
13
|
super(...arguments);
|
|
16
|
-
_defineProperty(this, "activeIndex",
|
|
14
|
+
_defineProperty(this, "activeIndex", 0);
|
|
15
|
+
_defineProperty(this, "sliderWidth", 0);
|
|
17
16
|
}
|
|
18
17
|
}
|
|
19
18
|
export default class WmCarousel extends BaseComponent {
|
|
20
19
|
constructor(_props) {
|
|
21
20
|
super(_props, DEFAULT_CLASS, new WmCarouselProps(), new WmCarouselState());
|
|
21
|
+
_defineProperty(this, "carouselRef", null);
|
|
22
22
|
_defineProperty(this, "noOfSlides", 0);
|
|
23
|
-
_defineProperty(this, "slideLayout", null);
|
|
24
|
-
_defineProperty(this, "keyExtractor", new DefaultKeyExtractor());
|
|
25
23
|
_defineProperty(this, "stopPlay", null);
|
|
26
|
-
_defineProperty(this, "animationView", null);
|
|
27
|
-
_defineProperty(this, "animationHandlers", {
|
|
28
|
-
bounds: e => {
|
|
29
|
-
var _this$slideLayout;
|
|
30
|
-
const activeTabIndex = this.state.activeIndex - 1,
|
|
31
|
-
w = ((_this$slideLayout = this.slideLayout) === null || _this$slideLayout === void 0 ? void 0 : _this$slideLayout.width) || 0,
|
|
32
|
-
noOfTabs = this.state.props.dataset.length;
|
|
33
|
-
return {
|
|
34
|
-
lower: -1 * (activeTabIndex - (activeTabIndex === 0 ? 0 : 1)) * w,
|
|
35
|
-
center: -1 * activeTabIndex * w,
|
|
36
|
-
upper: -1 * (activeTabIndex + (activeTabIndex === noOfTabs - 1 ? 0 : 1)) * w
|
|
37
|
-
};
|
|
38
|
-
},
|
|
39
|
-
computePhase: value => {
|
|
40
|
-
var _this$slideLayout2;
|
|
41
|
-
const w = ((_this$slideLayout2 = this.slideLayout) === null || _this$slideLayout2 === void 0 ? void 0 : _this$slideLayout2.width) || 0;
|
|
42
|
-
return w && Math.abs(value / w);
|
|
43
|
-
},
|
|
44
|
-
onLower: e => {
|
|
45
|
-
this.onSlideChange(this.state.activeIndex - 1);
|
|
46
|
-
},
|
|
47
|
-
onUpper: e => {
|
|
48
|
-
this.onSlideChange(this.state.activeIndex + 1);
|
|
49
|
-
}
|
|
50
|
-
});
|
|
51
24
|
_defineProperty(this, "onSlideChange", index => {
|
|
52
25
|
const prevIndex = this.state.activeIndex;
|
|
53
26
|
this.updateState({
|
|
54
27
|
activeIndex: index
|
|
55
28
|
}, () => this.invokeEventCallback('onChange', [this, index, prevIndex]));
|
|
56
29
|
});
|
|
57
|
-
_defineProperty(this, "renderItem",
|
|
30
|
+
_defineProperty(this, "renderItem", data => {
|
|
58
31
|
const props = this.state.props;
|
|
59
32
|
if (props.type === 'dynamic') {
|
|
60
|
-
return props.renderSlide ? props.renderSlide(item, index) : null;
|
|
33
|
+
return props.renderSlide ? props.renderSlide(data.item, data.index) : null;
|
|
61
34
|
}
|
|
62
|
-
return props.children[index];
|
|
35
|
+
return props.children[data.index];
|
|
36
|
+
});
|
|
37
|
+
_defineProperty(this, "onLayoutChange", e => {
|
|
38
|
+
this.updateState({
|
|
39
|
+
sliderWidth: e.nativeEvent.layout.width
|
|
40
|
+
});
|
|
41
|
+
});
|
|
42
|
+
_defineProperty(this, "getDotElement", _ref => {
|
|
43
|
+
let {
|
|
44
|
+
active,
|
|
45
|
+
index
|
|
46
|
+
} = _ref;
|
|
47
|
+
return /*#__PURE__*/React.createElement(Text, {
|
|
48
|
+
style: active ? this.styles.activeDotStyle : this.styles.dotStyle
|
|
49
|
+
}, index);
|
|
63
50
|
});
|
|
64
51
|
_defineProperty(this, "next", () => {
|
|
65
|
-
if (this.
|
|
66
|
-
var _this$
|
|
67
|
-
this.
|
|
68
|
-
(_this$animationView = this.animationView) === null || _this$animationView === void 0 ? void 0 : _this$animationView.setPosition(0);
|
|
52
|
+
if (this.carouselRef && this.carouselRef.currentIndex < this.noOfSlides - 1) {
|
|
53
|
+
var _this$carouselRef;
|
|
54
|
+
(_this$carouselRef = this.carouselRef) === null || _this$carouselRef === void 0 ? void 0 : _this$carouselRef.snapToNext();
|
|
69
55
|
} else {
|
|
70
|
-
var _this$
|
|
71
|
-
(_this$
|
|
56
|
+
var _this$carouselRef2;
|
|
57
|
+
(_this$carouselRef2 = this.carouselRef) === null || _this$carouselRef2 === void 0 ? void 0 : _this$carouselRef2.snapToItem(0);
|
|
72
58
|
}
|
|
73
59
|
});
|
|
74
60
|
_defineProperty(this, "prev", () => {
|
|
75
|
-
|
|
76
|
-
|
|
61
|
+
if (this.carouselRef && this.carouselRef.currentIndex > 0) {
|
|
62
|
+
var _this$carouselRef3;
|
|
63
|
+
(_this$carouselRef3 = this.carouselRef) === null || _this$carouselRef3 === void 0 ? void 0 : _this$carouselRef3.snapToPrev();
|
|
64
|
+
} else {
|
|
65
|
+
var _this$carouselRef4;
|
|
66
|
+
(_this$carouselRef4 = this.carouselRef) === null || _this$carouselRef4 === void 0 ? void 0 : _this$carouselRef4.snapToItem(this.noOfSlides - 1);
|
|
67
|
+
}
|
|
77
68
|
});
|
|
78
69
|
this.cleanup.push(() => {
|
|
79
70
|
this.stopPlay && this.stopPlay();
|
|
80
71
|
});
|
|
81
72
|
}
|
|
82
|
-
generateItemKey(item, index, props) {
|
|
83
|
-
if (props.itemkey && item && !this._showSkeleton) {
|
|
84
|
-
return props.itemkey(item, index);
|
|
85
|
-
}
|
|
86
|
-
return 'list_item_' + this.keyExtractor.getKey(item, true);
|
|
87
|
-
}
|
|
88
|
-
setSlideLayout(event) {
|
|
89
|
-
this.slideLayout = event.nativeEvent.layout;
|
|
90
|
-
this.forceUpdate();
|
|
91
|
-
}
|
|
92
73
|
autoPlay() {
|
|
93
74
|
const props = this.state.props;
|
|
94
75
|
this.stopPlay && this.stopPlay();
|
|
95
|
-
if (props.animation
|
|
76
|
+
if (props.animation && props.animationinterval) {
|
|
96
77
|
const intervalId = setInterval(() => {
|
|
97
78
|
this.next();
|
|
98
79
|
}, props.animationinterval * 1000);
|
|
99
80
|
this.stopPlay = () => clearInterval(intervalId);
|
|
100
|
-
} else {
|
|
101
|
-
setTimeout(() => {
|
|
102
|
-
var _this$animationView4;
|
|
103
|
-
this.onSlideChange(1);
|
|
104
|
-
(_this$animationView4 = this.animationView) === null || _this$animationView4 === void 0 ? void 0 : _this$animationView4.setPosition(0);
|
|
105
|
-
}, 1000);
|
|
106
81
|
}
|
|
107
82
|
}
|
|
108
83
|
onPropertyChange(name, $new, $old) {
|
|
109
84
|
super.onPropertyChange(name, $new, $old);
|
|
110
85
|
switch (name) {
|
|
111
|
-
case 'dataset':
|
|
112
|
-
{
|
|
113
|
-
var _this$keyExtractor;
|
|
114
|
-
(_this$keyExtractor = this.keyExtractor) === null || _this$keyExtractor === void 0 ? void 0 : _this$keyExtractor.clear();
|
|
115
|
-
this.updateState({
|
|
116
|
-
activeIndex: Math.min(this.state.activeIndex, ($new === null || $new === void 0 ? void 0 : $new.length) || 0)
|
|
117
|
-
});
|
|
118
|
-
break;
|
|
119
|
-
}
|
|
120
86
|
case 'animation':
|
|
121
87
|
case 'animationinterval':
|
|
122
88
|
{
|
|
@@ -124,68 +90,48 @@ export default class WmCarousel extends BaseComponent {
|
|
|
124
90
|
}
|
|
125
91
|
}
|
|
126
92
|
}
|
|
127
|
-
renderPagination(
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
key: 'dots_' + this.generateItemKey(item, index, this.state.props),
|
|
139
|
-
style: [this.styles.dotStyle, index === this.state.activeIndex - 1 ? this.styles.activeDotStyle : null]
|
|
140
|
-
}) : null;
|
|
141
|
-
}));
|
|
93
|
+
renderPagination(props, styles) {
|
|
94
|
+
return /*#__PURE__*/React.createElement(Pagination, {
|
|
95
|
+
carouselRef: this.carouselRef,
|
|
96
|
+
dotsLength: this.noOfSlides,
|
|
97
|
+
activeDotIndex: this.state.activeIndex,
|
|
98
|
+
containerStyle: styles.dotsWrapperStyle,
|
|
99
|
+
dotStyle: styles.activeDotStyle,
|
|
100
|
+
inactiveDotStyle: styles.dotStyle,
|
|
101
|
+
inactiveDotScale: 0.8,
|
|
102
|
+
tappableDots: true
|
|
103
|
+
});
|
|
142
104
|
}
|
|
143
105
|
renderWidget(props) {
|
|
144
|
-
var _data;
|
|
145
106
|
const hasNavs = props.controls === 'both' || props.controls === 'navs';
|
|
146
107
|
const hasDots = props.controls === 'both' || props.controls === 'indicators';
|
|
147
108
|
let styles = this.styles;
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
109
|
+
const data = props.type === 'dynamic' ? props.dataset : props.children;
|
|
110
|
+
this.noOfSlides = (data === null || data === void 0 ? void 0 : data.length) || 0;
|
|
111
|
+
const autoPlay = props.animation === 'auto';
|
|
151
112
|
// TODO: loop prop on Carousel is not working Refer: https://github.com/meliorence/react-native-snap-carousel/issues/608
|
|
152
113
|
return /*#__PURE__*/React.createElement(View, {
|
|
153
114
|
style: styles.root,
|
|
154
|
-
onLayout: this.
|
|
155
|
-
}, this._background, /*#__PURE__*/React.createElement(
|
|
156
|
-
|
|
115
|
+
onLayout: this.onLayoutChange
|
|
116
|
+
}, this._background, this.state.sliderWidth > 0 ? /*#__PURE__*/React.createElement(Carousel, {
|
|
117
|
+
ref: ref => this.carouselRef = ref,
|
|
118
|
+
data: data || [],
|
|
119
|
+
firstItem: 0,
|
|
157
120
|
style: {
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
alignItems: 'center'
|
|
161
|
-
},
|
|
162
|
-
direction: "horizontal",
|
|
163
|
-
ref: r => {
|
|
164
|
-
this.animationView = r;
|
|
121
|
+
width: '100%',
|
|
122
|
+
height: '100%'
|
|
165
123
|
},
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
});
|
|
178
|
-
return /*#__PURE__*/React.createElement(Animated.View, {
|
|
179
|
-
key: this.generateItemKey(item, index, props),
|
|
180
|
-
style: [this.styles.slide, index === 0 ? this.styles.firstSlide : null, index === data.length - 1 ? this.styles.lastSlide : null, isActive ? this.styles.activeSlide : null, translateX && scale ? {
|
|
181
|
-
transform: [{
|
|
182
|
-
translateX: translateX
|
|
183
|
-
}, {
|
|
184
|
-
scale: scale
|
|
185
|
-
}]
|
|
186
|
-
} : null]
|
|
187
|
-
}, this.renderItem(item, index));
|
|
188
|
-
})), hasNavs ? /*#__PURE__*/React.createElement(View, {
|
|
124
|
+
enableSnap: true,
|
|
125
|
+
loopClonesPerSide: 1,
|
|
126
|
+
autoplay: false,
|
|
127
|
+
activeSlideAlignment: "start",
|
|
128
|
+
renderItem: this.renderItem,
|
|
129
|
+
sliderWidth: this.state.sliderWidth,
|
|
130
|
+
itemWidth: this.state.sliderWidth,
|
|
131
|
+
lockScrollWhileSnapping: false,
|
|
132
|
+
scrollEnabled: false,
|
|
133
|
+
onSnapToItem: this.onSlideChange
|
|
134
|
+
}) : null, hasNavs ? /*#__PURE__*/React.createElement(View, {
|
|
189
135
|
style: styles.btnPanel
|
|
190
136
|
}, /*#__PURE__*/React.createElement(WmIcon, {
|
|
191
137
|
iconclass: "wi wi-chevron-left fa-2x",
|
|
@@ -195,7 +141,7 @@ export default class WmCarousel extends BaseComponent {
|
|
|
195
141
|
iconclass: "wi wi-chevron-right fa-2x",
|
|
196
142
|
styles: styles.nextBtn,
|
|
197
143
|
onTap: this.next
|
|
198
|
-
})) : null, hasDots && data ? this.renderPagination(
|
|
144
|
+
})) : null, this.state.sliderWidth > 0 && hasDots && data ? this.renderPagination(props, styles) : null);
|
|
199
145
|
}
|
|
200
146
|
}
|
|
201
147
|
//# sourceMappingURL=carousel.component.js.map
|
|
@@ -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","dataset","length","lower","center","upper","computePhase","value","_this$slideLayout2","Math","abs","onLower","onSlideChange","onUpper","index","prevIndex","updateState","invokeEventCallback","item","type","renderSlide","children","_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","data","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","direction","ref","r","handlers","animationHandlers","_this$animationView5","_this$animationView6","isActive","scale","animationPhase","interpolate","inputRange","outputRange","translateX","slide","firstSlide","lastSlide","activeSlide","transform","renderItem","btnPanel","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 noOfTabs = this.state.props.dataset.length;\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 if (this.state.activeIndex >= this.state.props.dataset.length) {\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 }}\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={[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 iconclass=\"wi wi-chevron-left fa-2x\"\n styles={styles.prevBtn}\n onTap={this.prev}/>\n <WmIcon\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,QAAQ,WAAW;AACnC,SAASC,QAAQ,EAAEC,IAAI,QAAkD,cAAc;AACvF,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,CA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1C,MAAM,EAAEA,MAAM,CAAC2C,OAAQ;MACvBC,KAAK,EAAE,IAAI,CAACC;IAAK,CAAC,CAAC,eACrB1I,KAAA,CAAA2F,aAAA,CAACtF,MAAM;MACLkI,SAAS,EAAC,2BAA2B;MACrC1C,MAAM,EAAEA,MAAM,CAAC8C,OAAQ;MACvBF,KAAK,EAAE,IAAI,CAAChE;IAAK,CAAC,CAChB,CAAC,GAAG,IAAI,EACb8B,OAAO,IAAIlB,IAAI,GAAG,IAAI,CAACD,gBAAgB,CAACC,IAAI,CAAC,GAAG,IAC/C,CAAC;EACX;AACF"}
|
|
1
|
+
{"version":3,"names":["React","View","Text","Carousel","Pagination","WmIcon","BaseComponent","BaseComponentState","WmCarouselProps","DEFAULT_CLASS","WmCarouselState","constructor","arguments","_defineProperty","WmCarousel","props","index","prevIndex","state","activeIndex","updateState","invokeEventCallback","data","type","renderSlide","item","children","e","sliderWidth","nativeEvent","layout","width","_ref","active","createElement","style","styles","activeDotStyle","dotStyle","carouselRef","currentIndex","noOfSlides","_this$carouselRef","snapToNext","_this$carouselRef2","snapToItem","_this$carouselRef3","snapToPrev","_this$carouselRef4","cleanup","push","stopPlay","autoPlay","animation","animationinterval","intervalId","setInterval","next","clearInterval","onPropertyChange","name","$new","$old","renderPagination","dotsLength","activeDotIndex","containerStyle","dotsWrapperStyle","inactiveDotStyle","inactiveDotScale","tappableDots","renderWidget","hasNavs","controls","hasDots","dataset","length","root","onLayout","onLayoutChange","_background","ref","firstItem","height","enableSnap","loopClonesPerSide","autoplay","activeSlideAlignment","renderItem","itemWidth","lockScrollWhileSnapping","scrollEnabled","onSnapToItem","onSlideChange","btnPanel","iconclass","prevBtn","onTap","prev","nextBtn"],"sources":["carousel.component.tsx"],"sourcesContent":["import React from 'react';\nimport { View, Text, LayoutChangeEvent } from 'react-native';\nimport Carousel, { Pagination } from 'react-native-snap-carousel';\nimport WmIcon from '@wavemaker/app-rn-runtime/components/basic/icon/icon.component';\nimport { BaseComponent, BaseComponentState } from '@wavemaker/app-rn-runtime/core/base.component';\n\nimport WmCarouselProps from './carousel.props';\nimport { DEFAULT_CLASS, WmCarouselStyles } from './carousel.styles';\n\nexport class WmCarouselState extends BaseComponentState<WmCarouselProps> {\n activeIndex = 0;\n sliderWidth = 0;\n}\n\nexport default class WmCarousel extends BaseComponent<WmCarouselProps, WmCarouselState, WmCarouselStyles> {\n\n carouselRef: Carousel<unknown> | null = null as any;\n noOfSlides: number = 0;\n stopPlay: Function = null as any;\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 autoPlay() {\n const props = this.state.props;\n this.stopPlay && this.stopPlay();\n if (props.animation && props.animationinterval) {\n const intervalId = setInterval(() => {\n this.next();\n }, props.animationinterval * 1000);\n this.stopPlay = () => clearInterval(intervalId);\n }\n }\n\n onPropertyChange(name: string, $new: any, $old: any): void {\n super.onPropertyChange(name, $new, $old);\n switch (name) {\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 = (data: any) => {\n const props = this.state.props;\n if (props.type === 'dynamic') {\n return props.renderSlide ? props.renderSlide(data.item, data.index) : null;\n }\n return props.children[data.index];\n }\n\n onLayoutChange = (e: LayoutChangeEvent) => {\n this.updateState({\n sliderWidth: e.nativeEvent.layout.width\n } as WmCarouselState);\n }\n\n getDotElement = ({active, index}: {active: boolean, index: number}) => {\n return (<Text style={active ? this.styles.activeDotStyle: this.styles.dotStyle}>{index}</Text>);\n }\n\n renderPagination(props: WmCarouselProps, styles: WmCarouselStyles) {\n return (\n <Pagination\n carouselRef={this.carouselRef as any}\n dotsLength={this.noOfSlides}\n activeDotIndex={this.state.activeIndex}\n containerStyle={styles.dotsWrapperStyle}\n dotStyle={styles.activeDotStyle}\n inactiveDotStyle={styles.dotStyle}\n inactiveDotScale={0.8}\n tappableDots={true}\n />\n );\n }\n\n next = () => {\n if (this.carouselRef && this.carouselRef.currentIndex < this.noOfSlides - 1) {\n this.carouselRef?.snapToNext();\n } else {\n this.carouselRef?.snapToItem(0);\n }\n }\n\n prev = () => {\n if (this.carouselRef && this.carouselRef.currentIndex > 0) {\n this.carouselRef?.snapToPrev();\n } else {\n this.carouselRef?.snapToItem(this.noOfSlides - 1);\n }\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 const data = props.type === 'dynamic' ? props.dataset : props.children;\n this.noOfSlides = data?.length || 0;\n const autoPlay = props.animation === 'auto';\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.onLayoutChange}>\n {this._background}\n {this.state.sliderWidth > 0 ?\n (<Carousel\n ref={ref => this.carouselRef = ref}\n data={data || []}\n firstItem={0}\n style={{width: '100%', height: '100%'}}\n enableSnap={true}\n loopClonesPerSide={1}\n autoplay={false}\n activeSlideAlignment='start'\n renderItem={this.renderItem}\n sliderWidth={this.state.sliderWidth}\n itemWidth={this.state.sliderWidth}\n lockScrollWhileSnapping={false}\n scrollEnabled={false}\n onSnapToItem={this.onSlideChange}\n ></Carousel>) : null}\n {hasNavs ? (\n <View style={styles.btnPanel}>\n <WmIcon\n iconclass=\"wi wi-chevron-left fa-2x\"\n styles={styles.prevBtn}\n onTap={this.prev}/>\n <WmIcon\n iconclass=\"wi wi-chevron-right fa-2x\"\n styles={styles.nextBtn}\n onTap={this.next}/>\n </View>): null}\n {this.state.sliderWidth > 0 && hasDots && data ? this.renderPagination(props, styles) : null}\n </View>);\n }\n}\n"],"mappings":";;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,IA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AW;MAC5B5D,WAAW,EAAE,IAAI,CAACV,KAAK,CAACU,WAAY;MACpC6D,SAAS,EAAE,IAAI,CAACvE,KAAK,CAACU,WAAY;MAClC8D,uBAAuB,EAAE,KAAM;MAC/BC,aAAa,EAAE,KAAM;MACrBC,YAAY,EAAE,IAAI,CAACC;IAAc,CACxB,CAAC,GAAI,IAAI,EACrBrB,OAAO,gBACNxE,KAAA,CAAAkC,aAAA,CAACjC,IAAI;MAACkC,KAAK,EAAEC,MAAM,CAAC0D;IAAS,gBAC3B9F,KAAA,CAAAkC,aAAA,CAAC7B,MAAM;MACL0F,SAAS,EAAC,0BAA0B;MACpC3D,MAAM,EAAEA,MAAM,CAAC4D,OAAQ;MACvBC,KAAK,EAAE,IAAI,CAACC;IAAK,CAAC,CAAC,eACrBlG,KAAA,CAAAkC,aAAA,CAAC7B,MAAM;MACL0F,SAAS,EAAC,2BAA2B;MACrC3D,MAAM,EAAEA,MAAM,CAAC+D,OAAQ;MACvBF,KAAK,EAAE,IAAI,CAACxC;IAAK,CAAC,CAChB,CAAC,GAAG,IAAI,EACf,IAAI,CAACvC,KAAK,CAACU,WAAW,GAAG,CAAC,IAAI8C,OAAO,IAAIpD,IAAI,GAAG,IAAI,CAACyC,gBAAgB,CAAChD,KAAK,EAAEqB,MAAM,CAAC,GAAG,IACpF,CAAC;EACX;AACF"}
|
|
@@ -11,10 +11,7 @@ export default class WmCarouselProps extends BaseProps {
|
|
|
11
11
|
_defineProperty(this, "animationinterval", 3);
|
|
12
12
|
_defineProperty(this, "controls", 'both');
|
|
13
13
|
_defineProperty(this, "children", null);
|
|
14
|
-
_defineProperty(this, "itemkey", null);
|
|
15
14
|
_defineProperty(this, "renderSlide", void 0);
|
|
16
|
-
_defineProperty(this, "enablegestures", true);
|
|
17
|
-
_defineProperty(this, "maxnoofdots", 20);
|
|
18
15
|
}
|
|
19
16
|
}
|
|
20
17
|
//# sourceMappingURL=carousel.props.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["BaseProps","WmCarouselProps","constructor","arguments","_defineProperty"],"sources":["carousel.props.ts"],"sourcesContent":["import { BaseProps } from '@wavemaker/app-rn-runtime/core/base.component';\nimport React from 'react';\n\nexport default class WmCarouselProps extends BaseProps {\n dataset: any = null;\n type?: 'static' | 'dynamic' = 'static';\n animation?:
|
|
1
|
+
{"version":3,"names":["BaseProps","WmCarouselProps","constructor","arguments","_defineProperty"],"sources":["carousel.props.ts"],"sourcesContent":["import { BaseProps } from '@wavemaker/app-rn-runtime/core/base.component';\nimport React from 'react';\n\nexport default class WmCarouselProps extends BaseProps {\n dataset: any = null;\n type?: 'static' | 'dynamic' = 'static';\n animation?: string = 'auto';\n animationinterval?: number = 3;\n controls?: 'both' | 'none' | 'navs' | 'indicators' = 'both';\n children? = null as any;\n renderSlide?: ($item: any, $index: number) => React.ReactNode;\n}"],"mappings":";;;AAAA,SAASA,SAAS,QAAQ,+CAA+C;AAGzE,eAAe,MAAMC,eAAe,SAASD,SAAS,CAAC;EAAAE,YAAA;IAAA,SAAAC,SAAA;IAAAC,eAAA,kBACtC,IAAI;IAAAA,eAAA,eACW,QAAQ;IAAAA,eAAA,oBACjB,MAAM;IAAAA,eAAA,4BACE,CAAC;IAAAA,eAAA,mBACuB,MAAM;IAAAA,eAAA,mBAC/C,IAAI;IAAAA,eAAA;EAAA;AAElB"}
|
|
@@ -15,16 +15,6 @@ BASE_THEME.registerStyle((themeVariables, addStyle) => {
|
|
|
15
15
|
position: 'relative'
|
|
16
16
|
},
|
|
17
17
|
text: {},
|
|
18
|
-
slide: {
|
|
19
|
-
width: '100%',
|
|
20
|
-
paddingHorizontal: 16,
|
|
21
|
-
transform: [{
|
|
22
|
-
translateX: 0
|
|
23
|
-
}]
|
|
24
|
-
},
|
|
25
|
-
firstSlide: {},
|
|
26
|
-
lastSlide: {},
|
|
27
|
-
activeSlide: {},
|
|
28
18
|
btnPanel: {
|
|
29
19
|
position: 'absolute',
|
|
30
20
|
top: '50%',
|
|
@@ -63,23 +53,25 @@ BASE_THEME.registerStyle((themeVariables, addStyle) => {
|
|
|
63
53
|
},
|
|
64
54
|
dotsWrapperStyle: {
|
|
65
55
|
opacity: 1,
|
|
56
|
+
height: 64,
|
|
57
|
+
marginTop: -64,
|
|
58
|
+
position: 'absolute',
|
|
59
|
+
top: '100%',
|
|
66
60
|
backgroundColor: themeVariables.carouselDotWrapperBgColor,
|
|
67
|
-
|
|
68
|
-
justifyContent: 'center',
|
|
69
|
-
alignItems: 'center',
|
|
61
|
+
alignSelf: 'center',
|
|
70
62
|
paddingTop: 4,
|
|
71
63
|
paddingBottom: 4
|
|
72
64
|
},
|
|
73
65
|
activeDotStyle: {
|
|
66
|
+
width: 12,
|
|
67
|
+
height: 12,
|
|
68
|
+
borderRadius: 10,
|
|
74
69
|
backgroundColor: themeVariables.carouselActiveDotColor,
|
|
75
70
|
opacity: 1
|
|
76
71
|
},
|
|
77
72
|
dotStyle: {
|
|
78
|
-
width: 8,
|
|
79
|
-
height: 8,
|
|
80
|
-
borderRadius: 10,
|
|
81
73
|
opacity: 0.2,
|
|
82
|
-
marginHorizontal: 2,
|
|
74
|
+
marginHorizontal: -2,
|
|
83
75
|
backgroundColor: themeVariables.carouselDotColor
|
|
84
76
|
}
|
|
85
77
|
});
|
|
@@ -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","
|
|
1
|
+
{"version":3,"names":["BASE_THEME","defineStyles","DEFAULT_CLASS","registerStyle","themeVariables","addStyle","btn","height","width","borderRadius","borderColor","transparent","borderWidth","justifyContent","defaultStyles","root","position","text","btnPanel","top","marginTop","flexDirection","alignItems","prevBtn","marginLeft","backgroundColor","carouselPrevBgColor","fontSize","icon","color","carouselPrevBtnColor","nextBtn","marginRight","carouselNextBtnColor","dotsWrapperStyle","opacity","carouselDotWrapperBgColor","alignSelf","paddingTop","paddingBottom","activeDotStyle","carouselActiveDotColor","dotStyle","marginHorizontal","carouselDotColor","transform","rotateY","defaultColorF","right","padding","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 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 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 height: 64,\n marginTop: -64,\n position: 'absolute',\n top: '100%',\n backgroundColor: themeVariables.carouselDotWrapperBgColor,\n alignSelf: 'center',\n paddingTop: 4,\n paddingBottom: 4\n },\n activeDotStyle: {\n width: 12,\n height: 12,\n borderRadius: 10,\n backgroundColor: themeVariables.carouselActiveDotColor,\n opacity: 1\n },\n dotStyle: {\n opacity: 0.2,\n marginHorizontal: -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;AAWxF,OAAO,MAAMC,aAAa,GAAG,cAAc;AAC3CF,UAAU,CAACG,aAAa,CAAC,CAACC,cAAc,EAAEC,QAAQ,KAAK;EACnD,MAAMC,GAAc,GAAG;IACnBC,MAAM,EAAE,EAAE;IACVC,KAA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BxB,cAAc,EAAE;IACpB,CAAC;IACD2B,cAAc,EAAE;MACZf,eAAe,EAAErB,cAAc,CAAC8C;IACpC,CAAC;IACDR,QAAQ,EAAE;MACNjB,eAAe,EAAErB,cAAc,CAAC8C;IACpC,CAAC;IACD3B,OAAO,EAAE;MACLR,IAAI,EAAE;QACFU,eAAe,EAAE,0BAA0B;QAC3Cf,WAAW,EAAEN,cAAc,CAAC8C;MAChC,CAAC;MACDtB,IAAI,EAAG;QACHC,KAAK,EAAEzB,cAAc,CAAC8C;MAC1B;IACJ,CAAC;IACDnB,OAAO,EAAE;MACLhB,IAAI,EAAE;QACFS,UAAU,EAAE,CAAC;QACbC,eAAe,EAAE,0BAA0B;QAC3Cf,WAAW,EAAEN,cAAc,CAAC8C;MAChC,CAAC;MACDtB,IAAI,EAAG;QACHC,KAAK,EAAEzB,cAAc,CAAC8C;MAC1B;IACJ;EACJ,CAA4B,CAAC;AACjC,CAAC,CAAC"}
|
|
@@ -44,9 +44,9 @@ export default class WmButton extends BaseComponent {
|
|
|
44
44
|
style: [this.styles.content, {
|
|
45
45
|
flexDirection: props.iconposition === 'top' ? 'column' : 'row'
|
|
46
46
|
}]
|
|
47
|
-
}, props.iconposition === 'top' && this.prepareIcon(props), props.iconposition === 'left' && this.prepareIcon(props),
|
|
47
|
+
}, props.iconposition === 'top' && this.prepareIcon(props), props.iconposition === 'left' && this.prepareIcon(props), /*#__PURE__*/React.createElement(Text, {
|
|
48
48
|
style: this.styles.text
|
|
49
|
-
}, props.caption)
|
|
49
|
+
}, props.caption), props.iconposition === 'right' && this.prepareIcon(props), props.badgevalue && this.prepareBadge(props))));
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
52
|
//# sourceMappingURL=button.component.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","Text","View","BaseComponent","BaseComponentState","Tappable","Badge","WmButtonProps","DEFAULT_CLASS","WmIcon","Animatedview","createSkeleton","WmButtonState","WmButton","constructor","props","prepareIcon","createElement","styles","icon","name","iconclass","iconsize","prepareBadge","style","badge","badgevalue","renderSkeleton","prop","theme","skeleton","root","width","skeletonwidth","height","skeletonheight","renderWidget","entryanimation","animation","_background","target","content","flexDirection","iconposition","
|
|
1
|
+
{"version":3,"names":["React","Text","View","BaseComponent","BaseComponentState","Tappable","Badge","WmButtonProps","DEFAULT_CLASS","WmIcon","Animatedview","createSkeleton","WmButtonState","WmButton","constructor","props","prepareIcon","createElement","styles","icon","name","iconclass","iconsize","prepareBadge","style","badge","badgevalue","renderSkeleton","prop","theme","skeleton","root","width","skeletonwidth","height","skeletonheight","renderWidget","entryanimation","animation","_background","target","content","flexDirection","iconposition","text","caption"],"sources":["button.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';\nimport { Badge } from 'react-native-paper';\n\nimport WmButtonProps from './button.props';\nimport { DEFAULT_CLASS, WmButtonStyles } from './button.styles';\nimport WmIcon from '@wavemaker/app-rn-runtime/components/basic/icon/icon.component';\nimport { Animatedview } from '@wavemaker/app-rn-runtime/components/basic/animatedview.component';\nimport { createSkeleton } from '../skeleton/skeleton.component';\n\nexport class WmButtonState extends BaseComponentState<WmButtonProps> {\n\n}\n\nexport default class WmButton extends BaseComponent<WmButtonProps, WmButtonState, WmButtonStyles> {\n\n constructor(props: WmButtonProps) {\n super(props, DEFAULT_CLASS, new WmButtonProps());\n }\n\n private prepareIcon(props: any) {\n return (<WmIcon\n styles={this.styles.icon} name={props.name + '_icon'} iconclass={props.iconclass} iconsize={props.iconsize}></WmIcon>);\n }\n\n private prepareBadge(props: any) {\n //@ts-ignore\n return (<Badge style={this.styles.badge}>{props.badgevalue}</Badge>);\n }\n\n public renderSkeleton(prop: WmButtonProps) {\n return createSkeleton(this.theme, this.styles.skeleton, {\n ...this.styles.root,\n width: (this.props.skeletonwidth || this.styles.root.width)as DimensionValue,\n height: (this.props.skeletonheight || this.styles.root.height) as DimensionValue\n });\n }\n\n renderWidget(props: WmButtonProps) {\n return (\n <Animatedview entryanimation={props.animation} style={this.styles.root}>\n {this._background}\n <Tappable target={this}>\n <View style={[this.styles.content, {flexDirection: props.iconposition === 'top' ? 'column': 'row'}]}>\n {props.iconposition === 'top' && this.prepareIcon(props)}\n {props.iconposition === 'left' && this.prepareIcon(props)}\n <Text style={this.styles.text}>{props.caption}</Text>\n {props.iconposition === 'right' && this.prepareIcon(props)}\n {props.badgevalue && this.prepareBadge(props)}\n </View>\n </Tappable>\n </Animatedview>\n );\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;AAC5E,SAASC,KAAK,QAAQ,oBAAoB;AAE1C,OAAOC,aAAa,MAAM,gBAAgB;AAC1C,SAASC,aAAa,QAAwB,iBAAiB;AAC/D,OAAOC,MAAM,MAAM,gEAAgE;AACnF,SAASC,YAAY,QAAQ,mEAAmE;AAChG,SAASC,cAAc,QAAQ,gCAAgC;AAE/D,OAAO,MAAMC,aAAa,SAASR,kBAAkB,CAAgB;AAIrE,eAAe,MAAMS,QAAQ,SAASV,aAAa,CAA+C;EAEhGW,WAAWA,CAACC,KAAoB,EAAE;IAChC,KAAK,CAACA,KAAK,EAAEP,aAAa,EAAE,IAAID,aAAa,CAAC,CAAC,CAAC;EAClD;EAEQS,WAAWA,CAACD,KAAU,EAAE;IAC9B,oBAAQf,KAAA,CAAAiB,aAAA,CAACR,MAAM;MACbS,MAAM,EAAE,IAAI,CAACA,MAAM,CAACC,IAAK;MAACC,IAAI,EAAEL,KAAK,CAACK,IAAI,GAAG,OAAQ;MAACC,SAAS,EAAEN,KAAK,CAACM,SAAU;MAACC,QAAQ,EAAEP,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,KAAA,CAAAiB,aAAA,CAAChB,IAAI;MAACuB,KAAK,EAAE,IAAI,CAACN,MAAM,CAAC0B;IAAK,GAAE7B,KAAK,CAAC8B,OAAc,CAAC,EACpD9B,KAAK,CAAC4B,YAAY,KAAK,OAAO,IAAI,IAAI,CAAC3B,WAAW,CAACD,KAAK,CAAC,EACzDA,KAAK,CAACW,UAAU,IAAI,IAAI,CAACH,YAAY,CAACR,KAAK,CACxC,CACE,CACE,CAAC;EAEnB;AACF"}
|
|
@@ -133,14 +133,11 @@ export default class WmIcon extends BaseComponent {
|
|
|
133
133
|
size: iconSize
|
|
134
134
|
}, customIcon);
|
|
135
135
|
} else if (props.show && iconDef) {
|
|
136
|
-
var _this$styles$icon;
|
|
137
136
|
let WMCustomIcon = WavIcon;
|
|
138
137
|
if (iconDef.isStreamlineLightIcon) {
|
|
139
138
|
WMCustomIcon = StreamlineLightIcon;
|
|
140
139
|
} else if (iconDef.isStreamlineRegularIcon) {
|
|
141
140
|
WMCustomIcon = StreamlineRegularIcon;
|
|
142
|
-
} else if (!iconDef.isWavIcon && !((_this$styles$icon = this.styles.icon) !== null && _this$styles$icon !== void 0 && _this$styles$icon.fontFamily)) {
|
|
143
|
-
return null;
|
|
144
141
|
}
|
|
145
142
|
//@ts-ignore type information is not matching
|
|
146
143
|
icon = WMCustomIcon ? /*#__PURE__*/React.createElement(WMCustomIcon, {
|