@wavemaker/app-rn-runtime 11.10.5-next.27872 → 11.10.5-rc.207
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/advanced/login/login.component.js +1 -1
- package/components/advanced/login/login.component.js.map +1 -1
- package/components/advanced/login/login.props.js +1 -0
- package/components/advanced/login/login.props.js.map +1 -1
- package/components/container/wizard/wizard.component.js +14 -3
- package/components/container/wizard/wizard.component.js.map +1 -1
- package/components/data/list/list.component.js +36 -10
- package/components/data/list/list.component.js.map +1 -1
- package/components/data/list/list.styles.js +1 -0
- package/components/data/list/list.styles.js.map +1 -1
- package/components/device/camera/camera.component.js +3 -1
- package/components/device/camera/camera.component.js.map +1 -1
- package/components/device/camera/camera.props.js +1 -0
- package/components/device/camera/camera.props.js.map +1 -1
- package/components/input/checkbox/checkbox.component.js +3 -1
- package/components/input/checkbox/checkbox.component.js.map +1 -1
- package/components/input/epoch/base-datetime.component.js +8 -2
- package/components/input/epoch/base-datetime.component.js.map +1 -1
- package/components/input/toggle/toggle.component.js +3 -1
- package/components/input/toggle/toggle.component.js.map +1 -1
- package/components/page/page-content/page-content.component.js +38 -7
- package/components/page/page-content/page-content.component.js.map +1 -1
- package/components/page/page-content/page-content.props.js +3 -0
- package/components/page/page-content/page-content.props.js.map +1 -1
- package/npm-shrinkwrap.json +175 -173
- package/package-lock.json +175 -173
- package/package.json +2 -2
@@ -11,13 +11,43 @@ import { DEFAULT_CLASS } from './page-content.styles';
|
|
11
11
|
import { ScrollView } from 'react-native-gesture-handler';
|
12
12
|
import WmLottie from '@wavemaker/app-rn-runtime/components/basic/lottie/lottie.component';
|
13
13
|
import { SafeAreaInsetsContext } from 'react-native-safe-area-context';
|
14
|
-
export class WmPageContentState extends BaseComponentState {
|
14
|
+
export class WmPageContentState extends BaseComponentState {
|
15
|
+
constructor(...args) {
|
16
|
+
super(...args);
|
17
|
+
_defineProperty(this, "previousScrollY", 0);
|
18
|
+
_defineProperty(this, "swipeThreshold", 8);
|
19
|
+
}
|
20
|
+
}
|
15
21
|
export default class WmPageContent extends BaseComponent {
|
16
22
|
constructor(props) {
|
17
23
|
super(props, DEFAULT_CLASS, new WmPageContentProps());
|
18
24
|
_defineProperty(this, "scrollRef", void 0);
|
25
|
+
_defineProperty(this, "handleScroll", event => {
|
26
|
+
const currentScrollY = event.nativeEvent.contentOffset.y;
|
27
|
+
const {
|
28
|
+
previousScrollY,
|
29
|
+
swipeThreshold
|
30
|
+
} = this.state;
|
31
|
+
const delta = currentScrollY - previousScrollY;
|
32
|
+
if (Math.abs(delta) > swipeThreshold) {
|
33
|
+
if (delta > 0) {
|
34
|
+
this.invokeEventCallback('onSwipeup', [null, this.proxy]);
|
35
|
+
} else {
|
36
|
+
this.invokeEventCallback('onSwipedown', [null, this.proxy]);
|
37
|
+
}
|
38
|
+
this.setState({
|
39
|
+
previousScrollY: currentScrollY
|
40
|
+
});
|
41
|
+
}
|
42
|
+
this.notify('scroll', [event]);
|
43
|
+
});
|
19
44
|
this.hideMode = HideMode.DONOT_ADD_TO_DOM;
|
20
45
|
this.scrollRef = /*#__PURE__*/createRef();
|
46
|
+
this.state = {
|
47
|
+
...this.state,
|
48
|
+
previousScrollY: 0,
|
49
|
+
swipeThreshold: 8
|
50
|
+
};
|
21
51
|
this.subscribe('scrollToPosition', args => {
|
22
52
|
this.scrollTo(args);
|
23
53
|
});
|
@@ -57,7 +87,6 @@ export default class WmPageContent extends BaseComponent {
|
|
57
87
|
}
|
58
88
|
renderWidget(props) {
|
59
89
|
const showScrollbar = this.styles.root.scrollbarColor != 'transparent';
|
60
|
-
// return ((props.scrollable || isWebPreviewMode()) && !this._showSkeleton) ? (
|
61
90
|
return props.scrollable || isWebPreviewMode() ? /*#__PURE__*/React.createElement(View, {
|
62
91
|
style: {
|
63
92
|
height: '100%',
|
@@ -71,7 +100,7 @@ export default class WmPageContent extends BaseComponent {
|
|
71
100
|
right: 0
|
72
101
|
}) => {
|
73
102
|
const keyboardOffset = (insets === null || insets === void 0 ? void 0 : insets.bottom) || 0;
|
74
|
-
const verticalOffset = Platform.OS === 'ios' ? keyboardOffset +
|
103
|
+
const verticalOffset = Platform.OS === 'ios' ? keyboardOffset + props.keyboardverticaloffset : keyboardOffset;
|
75
104
|
return /*#__PURE__*/React.createElement(KeyboardAvoidingView, {
|
76
105
|
behavior: Platform.OS === 'ios' ? 'padding' : undefined,
|
77
106
|
keyboardVerticalOffset: verticalOffset,
|
@@ -79,14 +108,16 @@ export default class WmPageContent extends BaseComponent {
|
|
79
108
|
flex: 1
|
80
109
|
}
|
81
110
|
}, /*#__PURE__*/React.createElement(ScrollView, {
|
111
|
+
testID: this.getTestId("page_content_scrollview"),
|
82
112
|
ref: this.scrollRef,
|
83
113
|
contentContainerStyle: [this.styles.root, {
|
84
114
|
backgroundColor: 'transparent'
|
85
115
|
}],
|
86
116
|
showsVerticalScrollIndicator: showScrollbar,
|
87
|
-
onScroll:
|
88
|
-
|
89
|
-
|
117
|
+
onScroll: this.handleScroll,
|
118
|
+
alwaysBounceVertical: false,
|
119
|
+
alwaysBounceHorizontal: false,
|
120
|
+
bounces: false,
|
90
121
|
scrollEventThrottle: 48
|
91
122
|
}, props.children));
|
92
123
|
})) : /*#__PURE__*/React.createElement(View, {
|
@@ -100,7 +131,7 @@ export default class WmPageContent extends BaseComponent {
|
|
100
131
|
right: 0
|
101
132
|
}) => {
|
102
133
|
const keyboardOffset = (insets === null || insets === void 0 ? void 0 : insets.bottom) || 0;
|
103
|
-
const verticalOffset = Platform.OS === 'ios' ? keyboardOffset +
|
134
|
+
const verticalOffset = Platform.OS === 'ios' ? keyboardOffset + props.keyboardverticaloffset : keyboardOffset;
|
104
135
|
return /*#__PURE__*/React.createElement(KeyboardAvoidingView, {
|
105
136
|
behavior: Platform.OS === 'ios' ? 'padding' : undefined,
|
106
137
|
keyboardVerticalOffset: verticalOffset,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["React","createRef","KeyboardAvoidingView","Platform","View","isWebPreviewMode","HideMode","BaseComponent","BaseComponentState","WmPageContentProps","DEFAULT_CLASS","ScrollView","WmLottie","SafeAreaInsetsContext","WmPageContentState","WmPageContent","constructor","props","_defineProperty","hideMode","DONOT_ADD_TO_DOM","scrollRef","subscribe","args","scrollTo","_this$scrollRef","current","scrollToEnd","position","_this$scrollRef2","x","y","Animated","renderSkeleton","skeletonanimationresource","createElement","style","width","styles","root","content","skeleton","source","loop","autoplay","speed","skeletonanimationspeed","renderWidget","showScrollbar","scrollbarColor","scrollable","height","backgroundColor","_showSkeleton","_background","Consumer","insets","top","bottom","left","right","keyboardOffset","verticalOffset","OS","behavior","undefined","keyboardVerticalOffset","flex","ref","contentContainerStyle","showsVerticalScrollIndicator","onScroll","event","notify","scrollEventThrottle","children"],"sources":["page-content.component.tsx"],"sourcesContent":["import React, { createRef, RefObject } from 'react';\nimport { KeyboardAvoidingView, Platform, View } from 'react-native';\nimport { isWebPreviewMode } from '@wavemaker/app-rn-runtime/core/utils';\nimport { HideMode } from '@wavemaker/app-rn-runtime/core/if.component';\nimport { BaseComponent, BaseComponentState } from '@wavemaker/app-rn-runtime/core/base.component';\n\nimport WmPageContentProps from './page-content.props';\nimport { DEFAULT_CLASS, WmPageContentStyles } from './page-content.styles';\nimport { ScrollView } from 'react-native-gesture-handler';\nimport WmLottie from '@wavemaker/app-rn-runtime/components/basic/lottie/lottie.component';\nimport { SafeAreaInsetsContext } from 'react-native-safe-area-context';\n\nexport class WmPageContentState extends BaseComponentState<WmPageContentProps> {\n\n}\n\nexport default class WmPageContent extends BaseComponent<WmPageContentProps, WmPageContentState, WmPageContentStyles> {\n private scrollRef: RefObject<any>;\n\n constructor(props: WmPageContentProps) {\n super(props, DEFAULT_CLASS, new WmPageContentProps());\n this.hideMode = HideMode.DONOT_ADD_TO_DOM;\n this.scrollRef = createRef();\n this.subscribe('scrollToPosition', (args: any) => {\n this.scrollTo(args)\n })\n\n this.subscribe('scrollToEnd', () => {\n this.scrollRef?.current.scrollToEnd();\n })\n }\n\n public scrollTo(position: {x: number, y: number}){\n this.scrollRef?.current.scrollTo({\n x: position.x,\n y: position.y,\n Animated: true\n });\n }\n\n public renderSkeleton(props: WmPageContentProps): React.ReactNode {\n if(this.props.skeletonanimationresource) {\n return <View style={[{width: '100%'}, this.styles.root]}>\n <WmLottie styles={{ content: {...this.styles.root, ...this.styles.skeleton.root} }} source={this.props.skeletonanimationresource} loop={true} autoplay={true} speed={this.props.skeletonanimationspeed}/>\n </View>\n } \n return null;\n } \n\n renderWidget(props: WmPageContentProps) {\n const showScrollbar = (this.styles.root as any).scrollbarColor != 'transparent';\n // return ((props.scrollable || isWebPreviewMode()) && !this._showSkeleton) ? (\n return (props.scrollable || isWebPreviewMode()) ? (\n <View style={{height: '100%', width: '100%', backgroundColor: this._showSkeleton && this.styles.skeleton.root.backgroundColor ? this.styles.skeleton.root.backgroundColor : this.styles.root.backgroundColor}}>\n {this._background}\n <SafeAreaInsetsContext.Consumer>\n {(insets = { top: 0, bottom: 0, left: 0, right: 0 }) => {\n const keyboardOffset = insets?.bottom || 0;\n const verticalOffset = Platform.OS === 'ios' ? keyboardOffset + 100 : keyboardOffset;\n return (\n <KeyboardAvoidingView\n behavior={Platform.OS === 'ios' ? 'padding' : undefined}\n keyboardVerticalOffset={verticalOffset}\n style={{ flex: 1 }}>\n <ScrollView \n ref={this.scrollRef}\n contentContainerStyle={[this.styles.root, {backgroundColor: 'transparent'}]}\n showsVerticalScrollIndicator={showScrollbar}\n onScroll={(event) => {this.notify('scroll', [event])}}\n scrollEventThrottle={48}>\n {props.children}\n </ScrollView>\n </KeyboardAvoidingView>\n )}}\n </SafeAreaInsetsContext.Consumer>\n </View> \n ) : (\n <View style={[this.styles.root,\n {backgroundColor: this._showSkeleton ?\n this.styles.skeleton.root.backgroundColor : \n this.styles.root.backgroundColor}]}>\n <SafeAreaInsetsContext.Consumer>\n {(insets = { top: 0, bottom: 0, left: 0, right: 0 }) => {\n const keyboardOffset = insets?.bottom || 0;\n const verticalOffset = Platform.OS === 'ios' ? keyboardOffset + 100 : keyboardOffset;\n return (\n <KeyboardAvoidingView\n behavior={Platform.OS === 'ios' ? 'padding' : undefined}\n keyboardVerticalOffset={verticalOffset}\n style={{ flex: 1 }}>\n {this._background}\n {props.children}\n </KeyboardAvoidingView>\n )}}\n </SafeAreaInsetsContext.Consumer>\n </View>\n );\n }\n }\n "],"mappings":";;;AAAA,OAAOA,KAAK,IAAIC,SAAS,QAAmB,OAAO;AACnD,SAASC,oBAAoB,EAAEC,QAAQ,EAAEC,IAAI,QAAQ,cAAc;AACnE,SAASC,gBAAgB,QAAQ,sCAAsC;AACvE,SAASC,QAAQ,QAAQ,6CAA6C;AACtE,SAASC,aAAa,EAAEC,kBAAkB,QAAQ,+CAA+C;AAEjG,OAAOC,kBAAkB,MAAM,sBAAsB;AACrD,SAASC,aAAa,QAA6B,uBAAuB;AAC1E,SAASC,UAAU,QAAQ,8BAA8B;AACzD,OAAOC,QAAQ,MAAM,oEAAoE;AACzF,SAASC,qBAAqB,QAAQ,gCAAgC;AAEtE,OAAO,MAAMC,kBAAkB,SAASN,kBAAkB,CAAqB;AAI/E,eAAe,MAAMO,aAAa,SAASR,aAAa,CAA8D;EAGpHS,WAAWA,CAACC,KAAyB,EAAE;IACrC,KAAK,CAACA,KAAK,EAAEP,aAAa,EAAE,IAAID,kBAAkB,CAAC,CAAC,CAAC;IAACS,eAAA;IACtD,IAAI,CAACC,QAAQ,GAAGb,QAAQ,CAACc,gBAAgB;IACzC,IAAI,CAACC,SAAS,gBAAGpB,SAAS,CAAC,CAAC;IAC5B,IAAI,CAACqB,SAAS,CAAC,kBAAkB,EAAGC,IAAS,IAAK;MAChD,IAAI,CAACC,QAAQ,CAACD,IAAI,CAAC;IACrB,CAAC,CAAC;IAEF,IAAI,CAACD,SAAS,CAAC,aAAa,EAAE,MAAM;MAAA,IAAAG,eAAA;MAClC,CAAAA,eAAA,OAAI,CAACJ,SAAS,cAAAI,eAAA,eAAdA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,mBAAmB,EAAE;MAAG,GACvBzD,KAAK,CAAC0D,QACG,CACQ,CAAC;IACxB,CAC2B,CAC1B,CAAC,gBAEL3E,KAAA,CAAAmC,aAAA,CAAC/B,IAAI;MAACgC,KAAK,EAAE,CAAC,IAAI,CAACE,MAAM,CAACC,IAAI,EAC1B;QAACa,eAAe,EAAE,IAAI,CAACC,aAAa,GAClC,IAAI,CAACf,MAAM,CAACG,QAAQ,CAACF,IAAI,CAACa,eAAe,GACzC,IAAI,CAACd,MAAM,CAACC,IAAI,CAACa;MAAe,CAAC;IAAE,gBACvCpD,KAAA,CAAAmC,aAAA,CAACtB,qBAAqB,CAAC0C,QAAQ,QAC5B,CAACC,MAAM,GAAG;MAAEC,GAAG,EAAE,CAAC;MAAEC,MAAM,EAAE,CAAC;MAAEC,IAAI,EAAE,CAAC;MAAEC,KAAK,EAAE;IAAE,CAAC,KAAK;MACtD,MAAMC,cAAc,GAAG,CAAAL,MAAM,aAANA,MAAM,uBAANA,MAAM,CAAEE,MAAM,KAAI,CAAC;MAC1C,MAAMI,cAAc,GAAG3D,QAAQ,CAAC4D,EAAE,KAAK,KAAK,GAAGF,cAAc,GAAG,GAAG,GAAGA,cAAc;MACpF,oBACE7D,KAAA,CAAAmC,aAAA,CAACjC,oBAAoB;QACnB8D,QAAQ,EAAE7D,QAAQ,CAAC4D,EAAE,KAAK,KAAK,GAAG,SAAS,GAAGE,SAAU;QACxDC,sBAAsB,EAAEJ,cAAe;QACvC1B,KAAK,EAAE;UAAE+B,IAAI,EAAE;QAAE;MAAE,GAClB,IAAI,CAACb,WAAW,EAChBrC,KAAK,CAAC0D,QACa,CAAC;IACxB,CAC2B,CAC5B,CACP;EACH;AACF","ignoreList":[]}
|
1
|
+
{"version":3,"names":["React","createRef","KeyboardAvoidingView","Platform","View","isWebPreviewMode","HideMode","BaseComponent","BaseComponentState","WmPageContentProps","DEFAULT_CLASS","ScrollView","WmLottie","SafeAreaInsetsContext","WmPageContentState","constructor","args","_defineProperty","WmPageContent","props","event","currentScrollY","nativeEvent","contentOffset","y","previousScrollY","swipeThreshold","state","delta","Math","abs","invokeEventCallback","proxy","setState","notify","hideMode","DONOT_ADD_TO_DOM","scrollRef","subscribe","scrollTo","_this$scrollRef","current","scrollToEnd","position","_this$scrollRef2","x","Animated","renderSkeleton","skeletonanimationresource","createElement","style","width","styles","root","content","skeleton","source","loop","autoplay","speed","skeletonanimationspeed","renderWidget","showScrollbar","scrollbarColor","scrollable","height","backgroundColor","_showSkeleton","_background","Consumer","insets","top","bottom","left","right","keyboardOffset","verticalOffset","OS","keyboardverticaloffset","behavior","undefined","keyboardVerticalOffset","flex","testID","getTestId","ref","contentContainerStyle","showsVerticalScrollIndicator","onScroll","handleScroll","alwaysBounceVertical","alwaysBounceHorizontal","bounces","scrollEventThrottle","children"],"sources":["page-content.component.tsx"],"sourcesContent":["import React, { createRef, RefObject } from 'react';\nimport { KeyboardAvoidingView, Platform, View, NativeSyntheticEvent, NativeScrollEvent } from 'react-native';\nimport { isWebPreviewMode } from '@wavemaker/app-rn-runtime/core/utils';\nimport { HideMode } from '@wavemaker/app-rn-runtime/core/if.component';\nimport { BaseComponent, BaseComponentState } from '@wavemaker/app-rn-runtime/core/base.component';\n\nimport WmPageContentProps from './page-content.props';\nimport { DEFAULT_CLASS, WmPageContentStyles } from './page-content.styles';\nimport { ScrollView } from 'react-native-gesture-handler';\nimport WmLottie from '@wavemaker/app-rn-runtime/components/basic/lottie/lottie.component';\nimport { SafeAreaInsetsContext } from 'react-native-safe-area-context';\n\nexport class WmPageContentState extends BaseComponentState<WmPageContentProps> {\n previousScrollY: number = 0;\n swipeThreshold: number = 8;\n}\n\nexport default class WmPageContent extends BaseComponent<WmPageContentProps, WmPageContentState, WmPageContentStyles> {\n private scrollRef: RefObject<any>;\n\n constructor(props: WmPageContentProps) {\n super(props, DEFAULT_CLASS, new WmPageContentProps());\n this.hideMode = HideMode.DONOT_ADD_TO_DOM;\n this.scrollRef = createRef();\n \n this.state = {\n ...this.state,\n previousScrollY: 0,\n swipeThreshold: 8\n };\n\n this.subscribe('scrollToPosition', (args: any) => {\n this.scrollTo(args);\n });\n\n this.subscribe('scrollToEnd', () => {\n this.scrollRef?.current.scrollToEnd();\n });\n }\n\n public scrollTo(position: {x: number, y: number}){\n this.scrollRef?.current.scrollTo({\n x: position.x,\n y: position.y,\n Animated: true\n });\n }\n\n private handleScroll = (event: NativeSyntheticEvent<NativeScrollEvent>) => {\n const currentScrollY = event.nativeEvent.contentOffset.y;\n const { previousScrollY, swipeThreshold } = this.state;\n \n const delta = currentScrollY - previousScrollY;\n \n if (Math.abs(delta) > swipeThreshold) {\n if (delta > 0) {\n this.invokeEventCallback('onSwipeup', [null, this.proxy]);\n \n } else {\n this.invokeEventCallback('onSwipedown', [null, this.proxy]);\n }\n this.setState({ previousScrollY: currentScrollY });\n }\n this.notify('scroll', [event]);\n };\n\n public renderSkeleton(props: WmPageContentProps): React.ReactNode {\n if(this.props.skeletonanimationresource) {\n return <View style={[{width: '100%'}, this.styles.root]}>\n <WmLottie styles={{ content: {...this.styles.root, ...this.styles.skeleton.root} }} source={this.props.skeletonanimationresource} loop={true} autoplay={true} speed={this.props.skeletonanimationspeed}/>\n </View>\n } \n return null;\n } \n\n renderWidget(props: WmPageContentProps) {\n const showScrollbar = (this.styles.root as any).scrollbarColor != 'transparent';\n \n return (props.scrollable || isWebPreviewMode()) ? (\n <View style={{height: '100%', width: '100%', backgroundColor: this._showSkeleton && this.styles.skeleton.root.backgroundColor ? this.styles.skeleton.root.backgroundColor : this.styles.root.backgroundColor}}>\n {this._background}\n <SafeAreaInsetsContext.Consumer>\n {(insets = { top: 0, bottom: 0, left: 0, right: 0 }) => {\n const keyboardOffset = insets?.bottom || 0;\n const verticalOffset = Platform.OS === 'ios' ? keyboardOffset + props.keyboardverticaloffset : keyboardOffset;\n return (\n <KeyboardAvoidingView\n behavior={Platform.OS === 'ios' ? 'padding' : undefined}\n keyboardVerticalOffset={verticalOffset}\n style={{ flex: 1 }}>\n <ScrollView \n testID={this.getTestId(\"page_content_scrollview\")}\n ref={this.scrollRef}\n contentContainerStyle={[this.styles.root, {backgroundColor: 'transparent'}]}\n showsVerticalScrollIndicator={showScrollbar}\n onScroll={this.handleScroll}\n alwaysBounceVertical={false}\n alwaysBounceHorizontal={false}\n bounces={false}\n scrollEventThrottle={48}>\n {props.children}\n </ScrollView>\n </KeyboardAvoidingView>\n )}}\n </SafeAreaInsetsContext.Consumer>\n </View> \n ) : (\n <View style={[this.styles.root,\n {backgroundColor: this._showSkeleton ?\n this.styles.skeleton.root.backgroundColor : \n this.styles.root.backgroundColor}]}>\n <SafeAreaInsetsContext.Consumer>\n {(insets = { top: 0, bottom: 0, left: 0, right: 0 }) => {\n const keyboardOffset = insets?.bottom || 0;\n const verticalOffset = Platform.OS === 'ios' ? keyboardOffset + props.keyboardverticaloffset : keyboardOffset;\n return (\n <KeyboardAvoidingView\n behavior={Platform.OS === 'ios' ? 'padding' : undefined}\n keyboardVerticalOffset={verticalOffset}\n style={{ flex: 1 }}>\n {this._background}\n {props.children}\n </KeyboardAvoidingView>\n )}}\n </SafeAreaInsetsContext.Consumer>\n </View>\n );\n }\n}"],"mappings":";;;AAAA,OAAOA,KAAK,IAAIC,SAAS,QAAmB,OAAO;AACnD,SAASC,oBAAoB,EAAEC,QAAQ,EAAEC,IAAI,QAAiD,cAAc;AAC5G,SAASC,gBAAgB,QAAQ,sCAAsC;AACvE,SAASC,QAAQ,QAAQ,6CAA6C;AACtE,SAASC,aAAa,EAAEC,kBAAkB,QAAQ,+CAA+C;AAEjG,OAAOC,kBAAkB,MAAM,sBAAsB;AACrD,SAASC,aAAa,QAA6B,uBAAuB;AAC1E,SAASC,UAAU,QAAQ,8BAA8B;AACzD,OAAOC,QAAQ,MAAM,oEAAoE;AACzF,SAASC,qBAAqB,QAAQ,gCAAgC;AAEtE,OAAO,MAAMC,kBAAkB,SAASN,kBAAkB,CAAqB;EAAAO,YAAA,GAAAC,IAAA;IAAA,SAAAA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;MAAE,GAClB,IAAI,CAACd,WAAW,EAChBjD,KAAK,CAAC2E,QACa,CAAC;IACxB,CAC2B,CAC5B,CACP;EACH;AACF","ignoreList":[]}
|
@@ -7,6 +7,9 @@ export default class WmPageContentProps extends SkeletonAnimationProps {
|
|
7
7
|
super(...args);
|
8
8
|
_defineProperty(this, "children", null);
|
9
9
|
_defineProperty(this, "scrollable", true);
|
10
|
+
_defineProperty(this, "onSwipeup", null);
|
11
|
+
_defineProperty(this, "onSwipedown", null);
|
12
|
+
_defineProperty(this, "keyboardverticaloffset", 100);
|
10
13
|
}
|
11
14
|
}
|
12
15
|
//# sourceMappingURL=page-content.props.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["SkeletonAnimationProps","WmPageContentProps","constructor","args","_defineProperty"],"sources":["page-content.props.ts"],"sourcesContent":["import { BaseProps } from '@wavemaker/app-rn-runtime/core/base.component';\nimport { SkeletonAnimationProps } from '@wavemaker/app-rn-runtime/runtime/base-fragment.component';\n\nexport default class WmPageContentProps extends SkeletonAnimationProps {\n children: any[] = null as any;\n scrollable: boolean = true;\n}"],"mappings":";;;AACA,SAASA,sBAAsB,QAAQ,2DAA2D;AAElG,eAAe,MAAMC,kBAAkB,SAASD,sBAAsB,CAAC;EAAAE,YAAA,GAAAC,IAAA;IAAA,SAAAA,IAAA;IAAAC,eAAA,mBACjD,IAAI;IAAAA,eAAA,qBACA,IAAI;EAAA;
|
1
|
+
{"version":3,"names":["SkeletonAnimationProps","WmPageContentProps","constructor","args","_defineProperty"],"sources":["page-content.props.ts"],"sourcesContent":["import { BaseProps } from '@wavemaker/app-rn-runtime/core/base.component';\nimport { SkeletonAnimationProps } from '@wavemaker/app-rn-runtime/runtime/base-fragment.component';\n\nexport default class WmPageContentProps extends SkeletonAnimationProps {\n children: any[] = null as any;\n scrollable: boolean = true;\n onSwipeup?: Function = null as any; \n onSwipedown?: Function = null as any;\n keyboardverticaloffset: number = 100;\n}"],"mappings":";;;AACA,SAASA,sBAAsB,QAAQ,2DAA2D;AAElG,eAAe,MAAMC,kBAAkB,SAASD,sBAAsB,CAAC;EAAAE,YAAA,GAAAC,IAAA;IAAA,SAAAA,IAAA;IAAAC,eAAA,mBACjD,IAAI;IAAAA,eAAA,qBACA,IAAI;IAAAA,eAAA,oBACH,IAAI;IAAAA,eAAA,sBACF,IAAI;IAAAA,eAAA,iCACI,GAAG;EAAA;AACxC","ignoreList":[]}
|