From e6953727d7b6981b0a392aab2ce36d72f2ac0bd4 Mon Sep 17 00:00:00 2001 From: lucas Date: Thu, 15 Sep 2022 16:48:36 +0200 Subject: [PATCH 1/3] fix/crash on react-native ^0.69 due to deprecated prop-types --- dist/src/basic/DatePicker.js | 2 +- dist/src/basic/DatePicker.js.map | 2 +- package.json | 1 + src/basic/Actionsheet.js | 34 +++++++++++++++---------------- src/basic/Badge.js | 11 ++++++---- src/basic/Body.js | 11 ++++++---- src/basic/Card.js | 11 ++++++---- src/basic/DatePicker.js | 6 ------ src/basic/DeckSwiper.js | 34 ++++++++++++++++++++++++------- src/basic/Footer.js | 3 ++- src/basic/FooterTab.js | 3 ++- src/basic/Form.js | 11 ++++++---- src/basic/Gravatar.js | 3 ++- src/basic/H1.js | 3 ++- src/basic/H2.js | 3 ++- src/basic/H3.js | 3 ++- src/basic/Header.js | 3 ++- src/basic/Input.js | 11 ++++++---- src/basic/InputGroup.js | 3 ++- src/basic/Label.js | 13 +++++++----- src/basic/Left.js | 11 ++++++---- src/basic/Picker.ios.js | 3 ++- src/basic/Right.js | 11 ++++++---- src/basic/Root.js | 11 ++++++---- src/basic/Segment.js | 3 ++- src/basic/Separator.js | 3 ++- src/basic/Subtitle.js | 7 +++++-- src/basic/Tab.js | 3 ++- src/basic/TabContainer.js | 3 ++- src/basic/TabHeading.js | 3 ++- src/basic/Text.js | 3 ++- src/basic/Textarea.js | 3 ++- src/basic/Thumbnail.js | 3 ++- src/basic/Title.js | 11 ++++++---- src/basic/Toast.js | 11 ++++++---- src/basic/ToastContainer.js | 35 ++++++++++++++------------------ src/basic/View.js | 3 ++- yarn.lock | 27 ++++++++++++++++++++++-- 38 files changed, 206 insertions(+), 119 deletions(-) diff --git a/dist/src/basic/DatePicker.js b/dist/src/basic/DatePicker.js index 1f8e733f0..0b7e765e1 100644 --- a/dist/src/basic/DatePicker.js +++ b/dist/src/basic/DatePicker.js @@ -1,2 +1,2 @@ -Object.defineProperty(exports,"__esModule",{value:true});exports.DatePicker=undefined;var _extends=Object.assign||function(target){for(var i=1;i {\n this.setState({ modalVisible: true });\n };\n\n formatChosenDate(date) {\n if (this.props.formatChosenDate) {\n return this.props.formatChosenDate(date);\n }\n return [date.getDate(), date.getMonth() + 1, date.getFullYear()].join('/');\n }\n\n render() {\n const {\n animationType,\n disabled,\n locale,\n maximumDate,\n minimumDate,\n modalTransparent,\n placeHolderText,\n placeHolderTextStyle,\n textStyle,\n timeZoneOffsetInMinutes\n } = this.props;\n\n const variables = this.context.theme\n ? this.context.theme['@@shoutem.theme/themeStyle'].variables\n : variable;\n\n return (\n this.setDate(date)}\n minimumDate={minimumDate}\n maximumDate={maximumDate}\n mode=\"date\"\n locale={locale}\n timeZoneOffsetInMinutes={timeZoneOffsetInMinutes}\n {...this.props}\n />\n );\n }\n}\n"]} \ No newline at end of file +{"version":3,"sources":["../../../src/basic/DatePicker.js"],"names":["DatePicker","props","state","defaultDate","Date","chosenDate","placeHolderText","undefined","date","setState","onDateChange","formatChosenDate","getDate","getMonth","getFullYear","join","locale","maximumDate","minimumDate","timeZoneOffsetInMinutes","variables","context","theme","variable","setDate","React","Component","defaultProps","disabled"],"mappings":"+1BAAA,4B,2CAEA,sE,6DAEA,qD,q7BAEaA,W,SAAAA,U,mEAIX,oBAAYC,KAAZ,CAAmB,gJACXA,KADW,GAEjB,MAAKC,KAAL,CAAa,CACXC,YAAaF,MAAME,WAAN,CAAoBF,MAAME,WAA1B,CAAwC,GAAIC,KAAJ,EAD1C,CAEXC,WACE,CAACJ,MAAMK,eAAP,EAA0BL,MAAME,WAAhC,CACIF,MAAME,WADV,CAEII,SALK,CAAb,CAFiB,aASlB,C,+DAEOC,I,CAAM,CACZ,KAAKC,QAAL,CAAc,CAAEJ,WAAY,GAAID,KAAJ,CAASI,IAAT,CAAd,CAAd,EACA,GAAI,KAAKP,KAAL,CAAWS,YAAf,CAA6B,CAC3B,KAAKT,KAAL,CAAWS,YAAX,CAAwBF,IAAxB,EACD,CACF,C,0DAEgBA,I,CAAM,CACrB,GAAI,KAAKP,KAAL,CAAWU,gBAAf,CAAiC,CAC/B,MAAO,MAAKV,KAAL,CAAWU,gBAAX,CAA4BH,IAA5B,CAAP,CACD,CACD,MAAO,CAACA,KAAKI,OAAL,EAAD,CAAiBJ,KAAKK,QAAL,GAAkB,CAAnC,CAAsCL,KAAKM,WAAL,EAAtC,EAA0DC,IAA1D,CAA+D,GAA/D,CAAP,CACD,C,uCAEQ,4BAMH,KAAKd,KANF,CAELe,MAFK,QAELA,MAFK,CAGLC,WAHK,QAGLA,WAHK,CAILC,WAJK,QAILA,WAJK,CAKLC,uBALK,QAKLA,uBALK,CAQP,GAAMC,WAAY,KAAKC,OAAL,CAAaC,KAAb,CACd,KAAKD,OAAL,CAAaC,KAAb,CAAmB,4BAAnB,EAAiDF,SADnC,CAEdG,kBAFJ,CAIA,MACE,+BAAC,wBAAD,WACE,KACE,KAAKrB,KAAL,CAAWG,UAAX,CAAwB,KAAKH,KAAL,CAAWG,UAAnC,CAAgD,KAAKH,KAAL,CAAWC,WAF/D,CAIE,aAAc,kCAAQ,QAAKqB,OAAL,CAAahB,IAAb,CAAR,EAJhB,CAKE,YAAaU,WALf,CAME,YAAaD,WANf,CAOE,KAAK,MAPP,CAQE,OAAQD,MARV,CASE,wBAAyBG,uBAT3B,EAUM,KAAKlB,KAVX,mDADF,CAcD,C,wBAvD6BwB,gBAAMC,S,EAAzB1B,U,CACJ2B,Y,CAAe,CACpBC,SAAU,KADU,C","file":"DatePicker.js","sourcesContent":["import React from 'react';\n\nimport DateTimePicker from '@react-native-community/datetimepicker';\n\nimport variable from '../theme/variables/platform';\n\nexport class DatePicker extends React.Component {\n static defaultProps = {\n disabled: false\n };\n constructor(props) {\n super(props);\n this.state = {\n defaultDate: props.defaultDate ? props.defaultDate : new Date(),\n chosenDate:\n !props.placeHolderText && props.defaultDate\n ? props.defaultDate\n : undefined\n };\n }\n\n setDate(date) {\n this.setState({ chosenDate: new Date(date) });\n if (this.props.onDateChange) {\n this.props.onDateChange(date);\n }\n }\n\n formatChosenDate(date) {\n if (this.props.formatChosenDate) {\n return this.props.formatChosenDate(date);\n }\n return [date.getDate(), date.getMonth() + 1, date.getFullYear()].join('/');\n }\n\n render() {\n const {\n locale,\n maximumDate,\n minimumDate,\n timeZoneOffsetInMinutes\n } = this.props;\n\n const variables = this.context.theme\n ? this.context.theme['@@shoutem.theme/themeStyle'].variables\n : variable;\n\n return (\n this.setDate(date)}\n minimumDate={minimumDate}\n maximumDate={maximumDate}\n mode=\"date\"\n locale={locale}\n timeZoneOffsetInMinutes={timeZoneOffsetInMinutes}\n {...this.props}\n />\n );\n }\n}\n"]} \ No newline at end of file diff --git a/package.json b/package.json index 266f91af3..3d8dd4615 100644 --- a/package.json +++ b/package.json @@ -37,6 +37,7 @@ "clamp": "^1.0.1", "color": "~3.1.2", "create-react-class": "^15.6.3", + "deprecated-react-native-prop-types": "^2.3.0", "eslint-config-prettier": "^6.0.0", "fs-extra": "^2.0.0", "jest-react-native": "^18.0.0", diff --git a/src/basic/Actionsheet.js b/src/basic/Actionsheet.js index bf7f7c6a8..67ffb14e9 100644 --- a/src/basic/Actionsheet.js +++ b/src/basic/Actionsheet.js @@ -9,9 +9,9 @@ import { Modal, Platform, TouchableOpacity, - StyleSheet, - ViewPropTypes, + StyleSheet } from 'react-native'; +import { ViewPropTypes } from 'deprecated-react-native-prop-types'; import { connectStyle } from 'native-base-shoutem-theme'; import mapPropsToStyleNames from '../utils/mapPropsToStyleNames'; @@ -36,7 +36,7 @@ class ActionSheetContainer extends Component { super(props); this.state = { modalVisible: false, - items: [], + items: [] }; } @@ -53,7 +53,7 @@ class ActionSheetContainer extends Component { if (Platform.OS === PLATFORM.IOS) { if (typeof config.options[0] === 'object') { const options = config.options; - const filtered = options.map((item) => { + const filtered = options.map(item => { return item.text; }); @@ -72,7 +72,7 @@ class ActionSheetContainer extends Component { modalVisible: true, callback, style: config.style, - fontStyle: config.fontStyle, + fontStyle: config.fontStyle }); } } @@ -110,7 +110,7 @@ class ActionSheetContainer extends Component { String(index)} @@ -134,8 +134,8 @@ class ActionSheetContainer extends Component { style={[ styles.listItem, { - height: commonColor.listItemHeight, - }, + height: commonColor.listItemHeight + } ]} icon > @@ -144,7 +144,7 @@ class ActionSheetContainer extends Component { name={item.icon} type={item.iconType} style={{ - color: item.iconColor ? item.iconColor : undefined, + color: item.iconColor ? item.iconColor : undefined }} /> @@ -164,36 +164,36 @@ class ActionSheetContainer extends Component { } ActionSheetContainer.propTypes = { - ...ViewPropTypes, + ...ViewPropTypes }; const styles = StyleSheet.create({ containerTouchable: { backgroundColor: commonColor.containerTouchableBackgroundColor, flex: 1, - justifyContent: 'flex-end', + justifyContent: 'flex-end' }, flatList: { - marginHorizontal: commonColor.marginHorizontal, + marginHorizontal: commonColor.marginHorizontal }, innerTouchable: { backgroundColor: commonColor.innerTouchableBackgroundColor, minHeight: commonColor.minHeight, maxHeight: Dimensions.get('window').height / 2, padding: commonColor.padding, - elevation: commonColor.elevation, + elevation: commonColor.elevation }, listItem: { borderColor: commonColor.listItemBorderColor, - marginLeft: commonColor.marginLeft, + marginLeft: commonColor.marginLeft }, listItemBody: { borderColor: commonColor.listItemBorderColor, - paddingLeft: commonColor.marginLeft / 2, + paddingLeft: commonColor.marginLeft / 2 }, touchableText: { - color: commonColor.touchableTextColor, - }, + color: commonColor.touchableTextColor + } }); const StyledActionSheetContainer = connectStyle( diff --git a/src/basic/Badge.js b/src/basic/Badge.js index 4374c7e7d..37958d033 100644 --- a/src/basic/Badge.js +++ b/src/basic/Badge.js @@ -1,6 +1,7 @@ import React, { Component } from 'react'; import PropTypes from 'prop-types'; -import { View, ViewPropTypes } from 'react-native'; +import { View } from 'react-native'; +import { ViewPropTypes } from 'deprecated-react-native-prop-types'; import { connectStyle } from 'native-base-shoutem-theme'; import mapPropsToStyleNames from '../utils/mapPropsToStyleNames'; @@ -24,8 +25,10 @@ Badge.propTypes = { ]) }; -const StyledBadge = connectStyle('NativeBase.Badge', {}, mapPropsToStyleNames)( - Badge -); +const StyledBadge = connectStyle( + 'NativeBase.Badge', + {}, + mapPropsToStyleNames +)(Badge); export { StyledBadge as Badge }; diff --git a/src/basic/Body.js b/src/basic/Body.js index abbea7430..6bd9dfe23 100644 --- a/src/basic/Body.js +++ b/src/basic/Body.js @@ -1,6 +1,7 @@ import React, { Component } from 'react'; import PropTypes from 'prop-types'; -import { View, ViewPropTypes } from 'react-native'; +import { View } from 'react-native'; +import { ViewPropTypes } from 'deprecated-react-native-prop-types'; import { connectStyle } from 'native-base-shoutem-theme'; import mapPropsToStyleNames from '../utils/mapPropsToStyleNames'; @@ -20,8 +21,10 @@ Body.propTypes = { ]) }; -const StyledBody = connectStyle('NativeBase.Body', {}, mapPropsToStyleNames)( - Body -); +const StyledBody = connectStyle( + 'NativeBase.Body', + {}, + mapPropsToStyleNames +)(Body); export { StyledBody as Body }; diff --git a/src/basic/Card.js b/src/basic/Card.js index 1f68d0b92..c3e81f65a 100644 --- a/src/basic/Card.js +++ b/src/basic/Card.js @@ -1,6 +1,7 @@ import React, { Component } from 'react'; import PropTypes from 'prop-types'; -import { FlatList, View, ViewPropTypes } from 'react-native'; +import { FlatList, View } from 'react-native'; +import { ViewPropTypes } from 'deprecated-react-native-prop-types'; import { connectStyle } from 'native-base-shoutem-theme'; import mapPropsToStyleNames from '../utils/mapPropsToStyleNames'; @@ -37,8 +38,10 @@ Card.propTypes = { renderRow: PropTypes.func }; -const StyledCard = connectStyle('NativeBase.Card', {}, mapPropsToStyleNames)( - Card -); +const StyledCard = connectStyle( + 'NativeBase.Card', + {}, + mapPropsToStyleNames +)(Card); export { StyledCard as Card }; diff --git a/src/basic/DatePicker.js b/src/basic/DatePicker.js index 9782dd83e..d132ba2e2 100644 --- a/src/basic/DatePicker.js +++ b/src/basic/DatePicker.js @@ -2,8 +2,6 @@ import React from 'react'; import DateTimePicker from '@react-native-community/datetimepicker'; -import variable from '../theme/variables/platform'; - export class DatePicker extends React.Component { static defaultProps = { disabled: false @@ -41,10 +39,6 @@ export class DatePicker extends React.Component { timeZoneOffsetInMinutes } = this.props; - const variables = this.context.theme - ? this.context.theme['@@shoutem.theme/themeStyle'].variables - : variable; - return ( 0.2) { val = 0.2; } - Animated.timing(this.state.fadeAnim, { toValue: 0.8 + val, useNativeDriver: false }).start(); + Animated.timing(this.state.fadeAnim, { + toValue: 0.8 + val, + useNativeDriver: false + }).start(); Animated.spring(this.state.enter, { toValue: 0.8 + val, friction: 7, useNativeDriver: false }).start(); - Animated.event([null, { dx: this.state.pan.x }], { useNativeDriver: false })(e, gestureState); + Animated.event([null, { dx: this.state.pan.x }], { + useNativeDriver: false + })(e, gestureState); }, onPanResponderRelease: (e, { vx, vy }) => { @@ -178,8 +184,15 @@ class DeckSwiper extends Component { swipeRight() { if (this.props.onSwiping) this.props.onSwiping('right'); setTimeout(() => { - Animated.timing(this.state.fadeAnim, { toValue: 1, useNativeDriver: false }).start(); - Animated.spring(this.state.enter, { toValue: 1, friction: 7, useNativeDriver: false }).start(); + Animated.timing(this.state.fadeAnim, { + toValue: 1, + useNativeDriver: false + }).start(); + Animated.spring(this.state.enter, { + toValue: 1, + friction: 7, + useNativeDriver: false + }).start(); this.selectNext(); Animated.decay(this.state.pan, { velocity: { x: 8, y: 1 }, @@ -192,8 +205,15 @@ class DeckSwiper extends Component { swipeLeft() { if (this.props.onSwiping) this.props.onSwiping('left'); setTimeout(() => { - Animated.timing(this.state.fadeAnim, { toValue: 1, useNativeDriver: false }).start(); - Animated.spring(this.state.enter, { toValue: 1, friction: 7, useNativeDriver: false }).start(); + Animated.timing(this.state.fadeAnim, { + toValue: 1, + useNativeDriver: false + }).start(); + Animated.spring(this.state.enter, { + toValue: 1, + friction: 7, + useNativeDriver: false + }).start(); this.selectNext(); Animated.decay(this.state.pan, { velocity: { x: -8, y: 1 }, diff --git a/src/basic/Footer.js b/src/basic/Footer.js index b4cb74794..d8262d356 100644 --- a/src/basic/Footer.js +++ b/src/basic/Footer.js @@ -1,6 +1,7 @@ import React, { Component } from 'react'; import PropTypes from 'prop-types'; -import { View, ViewPropTypes, SafeAreaView } from 'react-native'; +import { View, SafeAreaView } from 'react-native'; +import { ViewPropTypes } from 'deprecated-react-native-prop-types'; import { connectStyle } from 'native-base-shoutem-theme'; import mapPropsToStyleNames from '../utils/mapPropsToStyleNames'; diff --git a/src/basic/FooterTab.js b/src/basic/FooterTab.js index 7934cb2df..2d217a1d0 100644 --- a/src/basic/FooterTab.js +++ b/src/basic/FooterTab.js @@ -1,6 +1,7 @@ import React, { Component } from 'react'; import PropTypes from 'prop-types'; -import { View, ViewPropTypes } from 'react-native'; +import { View } from 'react-native'; +import { ViewPropTypes } from 'deprecated-react-native-prop-types'; import { connectStyle } from 'native-base-shoutem-theme'; import mapPropsToStyleNames from '../utils/mapPropsToStyleNames'; diff --git a/src/basic/Form.js b/src/basic/Form.js index 96ce0511c..314ca6e80 100644 --- a/src/basic/Form.js +++ b/src/basic/Form.js @@ -1,6 +1,7 @@ import React, { Component } from 'react'; import PropTypes from 'prop-types'; -import { View, ViewPropTypes } from 'react-native'; +import { View } from 'react-native'; +import { ViewPropTypes } from 'deprecated-react-native-prop-types'; import { connectStyle } from 'native-base-shoutem-theme'; import mapPropsToStyleNames from '../utils/mapPropsToStyleNames'; @@ -20,8 +21,10 @@ Form.propTypes = { ]) }; -const StyledForm = connectStyle('NativeBase.Form', {}, mapPropsToStyleNames)( - Form -); +const StyledForm = connectStyle( + 'NativeBase.Form', + {}, + mapPropsToStyleNames +)(Form); export { StyledForm as Form }; diff --git a/src/basic/Gravatar.js b/src/basic/Gravatar.js index 259830d58..e4bc653de 100644 --- a/src/basic/Gravatar.js +++ b/src/basic/Gravatar.js @@ -1,6 +1,7 @@ import React from 'react'; import PropTypes from 'prop-types'; import { Image } from 'react-native'; +import { ImagePropTypes } from 'deprecated-react-native-prop-types'; import { connectStyle } from 'native-base-shoutem-theme'; import _ from 'lodash'; import md5 from 'blueimp-md5'; @@ -54,7 +55,7 @@ class Gravatar extends NativeBaseComponent { } Gravatar.propTypes = { - ...Image.propTypes, + ...ImagePropTypes, email: PropTypes.string.isRequired, style: PropTypes.oneOfType([ PropTypes.object, diff --git a/src/basic/H1.js b/src/basic/H1.js index 2bb573b4f..cb1f716d4 100644 --- a/src/basic/H1.js +++ b/src/basic/H1.js @@ -1,6 +1,7 @@ import React, { Component } from 'react'; import PropTypes from 'prop-types'; import { Text } from 'react-native'; +import { TextPropTypes } from 'deprecated-react-native-prop-types'; import { connectStyle } from 'native-base-shoutem-theme'; import mapPropsToStyleNames from '../utils/mapPropsToStyleNames'; @@ -23,7 +24,7 @@ const childrenType = function(props, propName, component) { }; H1.propTypes = { - ...Text.propTypes, + ...TextPropTypes, children: childrenType, style: PropTypes.oneOfType([ PropTypes.object, diff --git a/src/basic/H2.js b/src/basic/H2.js index 04742315e..3090c4423 100644 --- a/src/basic/H2.js +++ b/src/basic/H2.js @@ -1,6 +1,7 @@ import React, { Component } from 'react'; import PropTypes from 'prop-types'; import { Text } from 'react-native'; +import { TextPropTypes } from 'deprecated-react-native-prop-types'; import { connectStyle } from 'native-base-shoutem-theme'; import mapPropsToStyleNames from '../utils/mapPropsToStyleNames'; @@ -22,7 +23,7 @@ const childrenType = function(props, propName, component) { }; H2.propTypes = { - ...Text.propTypes, + ...TextPropTypes, children: childrenType, style: PropTypes.oneOfType([ PropTypes.object, diff --git a/src/basic/H3.js b/src/basic/H3.js index 40a963266..a08f47d8b 100644 --- a/src/basic/H3.js +++ b/src/basic/H3.js @@ -1,6 +1,7 @@ import React, { Component } from 'react'; import PropTypes from 'prop-types'; import { Text } from 'react-native'; +import { TextPropTypes } from 'deprecated-react-native-prop-types'; import { connectStyle } from 'native-base-shoutem-theme'; import mapPropsToStyleNames from '../utils/mapPropsToStyleNames'; @@ -23,7 +24,7 @@ const childrenType = function(props, propName, component) { }; H3.propTypes = { - ...Text.propTypes, + ...TextPropTypes, children: childrenType, style: PropTypes.oneOfType([ PropTypes.object, diff --git a/src/basic/Header.js b/src/basic/Header.js index 621e7e709..0c9f666d2 100644 --- a/src/basic/Header.js +++ b/src/basic/Header.js @@ -3,7 +3,8 @@ import { connectStyle } from 'native-base-shoutem-theme'; import PropTypes from 'prop-types'; import React, { Component } from 'react'; -import { View, StatusBar, ViewPropTypes, SafeAreaView } from 'react-native'; +import { View, StatusBar, SafeAreaView } from 'react-native'; +import { ViewPropTypes } from 'deprecated-react-native-prop-types'; import mapPropsToStyleNames from '../utils/mapPropsToStyleNames'; import getStyle from '../utils/getStyle'; diff --git a/src/basic/Input.js b/src/basic/Input.js index 08f8a1732..6039965f3 100644 --- a/src/basic/Input.js +++ b/src/basic/Input.js @@ -1,6 +1,7 @@ import React from 'react'; import PropTypes from 'prop-types'; import { TextInput } from 'react-native'; +import { TextInputPropTypes } from 'deprecated-react-native-prop-types'; import { connectStyle } from 'native-base-shoutem-theme'; import mapPropsToStyleNames from '../utils/mapPropsToStyleNames'; @@ -33,7 +34,7 @@ class Input extends NativeBaseComponent { } Input.propTypes = { - ...TextInput.propTypes, + ...TextInputPropTypes, style: PropTypes.oneOfType([ PropTypes.object, PropTypes.number, @@ -41,8 +42,10 @@ Input.propTypes = { ]) }; -const StyledInput = connectStyle('NativeBase.Input', {}, mapPropsToStyleNames)( - Input -); +const StyledInput = connectStyle( + 'NativeBase.Input', + {}, + mapPropsToStyleNames +)(Input); export { StyledInput as Input }; diff --git a/src/basic/InputGroup.js b/src/basic/InputGroup.js index 5b5dfb6d8..825f8ec05 100644 --- a/src/basic/InputGroup.js +++ b/src/basic/InputGroup.js @@ -1,6 +1,7 @@ import React, { Component } from 'react'; import PropTypes from 'prop-types'; -import { View, ViewPropTypes } from 'react-native'; +import { View } from 'react-native'; +import { ViewPropTypes } from 'deprecated-react-native-prop-types'; import { connectStyle } from 'native-base-shoutem-theme'; import variables from '../theme/variables/platform'; diff --git a/src/basic/Label.js b/src/basic/Label.js index 04c22ad77..4dbbcc5ec 100644 --- a/src/basic/Label.js +++ b/src/basic/Label.js @@ -1,6 +1,7 @@ import React, { Component } from 'react'; import PropTypes from 'prop-types'; import { Text } from 'react-native'; +import { TextPropTypes } from 'deprecated-react-native-prop-types'; import { connectStyle } from 'native-base-shoutem-theme'; import mapPropsToStyleNames from '../utils/mapPropsToStyleNames'; @@ -12,17 +13,19 @@ class Label extends Component { } Label.propTypes = { - ...Text.propTypes, + ...TextPropTypes, style: PropTypes.oneOfType([ PropTypes.object, PropTypes.number, PropTypes.array ]), - floatBack: PropTypes.number, + floatBack: PropTypes.number }; -const StyledLabel = connectStyle('NativeBase.Label', {}, mapPropsToStyleNames)( - Label -); +const StyledLabel = connectStyle( + 'NativeBase.Label', + {}, + mapPropsToStyleNames +)(Label); export { StyledLabel as Label }; diff --git a/src/basic/Left.js b/src/basic/Left.js index c23487d61..eaac035b0 100644 --- a/src/basic/Left.js +++ b/src/basic/Left.js @@ -1,6 +1,7 @@ import React, { Component } from 'react'; import PropTypes from 'prop-types'; -import { View, ViewPropTypes } from 'react-native'; +import { View } from 'react-native'; +import { ViewPropTypes } from 'deprecated-react-native-prop-types'; import { connectStyle } from 'native-base-shoutem-theme'; import mapPropsToStyleNames from '../utils/mapPropsToStyleNames'; @@ -20,8 +21,10 @@ Left.propTypes = { ]) }; -const StyledLeft = connectStyle('NativeBase.Left', {}, mapPropsToStyleNames)( - Left -); +const StyledLeft = connectStyle( + 'NativeBase.Left', + {}, + mapPropsToStyleNames +)(Left); export { StyledLeft as Left }; diff --git a/src/basic/Picker.ios.js b/src/basic/Picker.ios.js index 7cf65e846..99cbe0abc 100644 --- a/src/basic/Picker.ios.js +++ b/src/basic/Picker.ios.js @@ -4,7 +4,8 @@ import React, { Component } from 'react'; import PropTypes from 'prop-types'; import createReactClass from 'create-react-class'; -import { FlatList, Modal, View, ViewPropTypes } from 'react-native'; +import { FlatList, Modal, View } from 'react-native'; +import { ViewPropTypes } from 'deprecated-react-native-prop-types'; import { Picker } from '@react-native-picker/picker'; import { connectStyle } from 'native-base-shoutem-theme'; import { find, get } from 'lodash'; diff --git a/src/basic/Right.js b/src/basic/Right.js index 05986bc1d..ddb94cf3d 100644 --- a/src/basic/Right.js +++ b/src/basic/Right.js @@ -1,6 +1,7 @@ import React, { Component } from 'react'; import PropTypes from 'prop-types'; -import { View, ViewPropTypes } from 'react-native'; +import { View } from 'react-native'; +import { ViewPropTypes } from 'deprecated-react-native-prop-types'; import { connectStyle } from 'native-base-shoutem-theme'; import mapPropsToStyleNames from '../utils/mapPropsToStyleNames'; @@ -20,8 +21,10 @@ Right.propTypes = { ]) }; -const StyledRight = connectStyle('NativeBase.Right', {}, mapPropsToStyleNames)( - Right -); +const StyledRight = connectStyle( + 'NativeBase.Right', + {}, + mapPropsToStyleNames +)(Right); export { StyledRight as Right }; diff --git a/src/basic/Root.js b/src/basic/Root.js index 89c0b1bb0..69c024a8d 100644 --- a/src/basic/Root.js +++ b/src/basic/Root.js @@ -1,5 +1,6 @@ import React, { Component } from 'react'; -import { View, ViewPropTypes } from 'react-native'; +import { View } from 'react-native'; +import { ViewPropTypes } from 'deprecated-react-native-prop-types'; import PropTypes from 'prop-types'; import { connectStyle } from 'native-base-shoutem-theme'; @@ -37,8 +38,10 @@ Root.propTypes = { ]) }; -const StyledRoot = connectStyle('NativeBase.Root', {}, mapPropsToStyleNames)( - Root -); +const StyledRoot = connectStyle( + 'NativeBase.Root', + {}, + mapPropsToStyleNames +)(Root); export { StyledRoot as Root }; diff --git a/src/basic/Segment.js b/src/basic/Segment.js index ed9387432..6b95ee269 100644 --- a/src/basic/Segment.js +++ b/src/basic/Segment.js @@ -1,6 +1,7 @@ import React, { Component } from 'react'; import PropTypes from 'prop-types'; -import { View, ViewPropTypes } from 'react-native'; +import { View } from 'react-native'; +import { ViewPropTypes } from 'deprecated-react-native-prop-types'; import { connectStyle } from 'native-base-shoutem-theme'; import mapPropsToStyleNames from '../utils/mapPropsToStyleNames'; diff --git a/src/basic/Separator.js b/src/basic/Separator.js index c09d537c4..a873adfe0 100644 --- a/src/basic/Separator.js +++ b/src/basic/Separator.js @@ -1,6 +1,7 @@ import React, { Component } from 'react'; import PropTypes from 'prop-types'; -import { View, ViewPropTypes } from 'react-native'; +import { View } from 'react-native'; +import { ViewPropTypes } from 'deprecated-react-native-prop-types'; import { connectStyle } from 'native-base-shoutem-theme'; import mapPropsToStyleNames from '../utils/mapPropsToStyleNames'; diff --git a/src/basic/Subtitle.js b/src/basic/Subtitle.js index 972307468..1623496fa 100644 --- a/src/basic/Subtitle.js +++ b/src/basic/Subtitle.js @@ -1,18 +1,21 @@ import React, { Component } from 'react'; import PropTypes from 'prop-types'; import { Text } from 'react-native'; +import { TextPropTypes } from 'deprecated-react-native-prop-types'; import { connectStyle } from 'native-base-shoutem-theme'; import mapPropsToStyleNames from '../utils/mapPropsToStyleNames'; class Subtitle extends Component { render() { - return (this._root = c)} numberOfLines={1} {...this.props} />; + return ( + (this._root = c)} numberOfLines={1} {...this.props} /> + ); } } Subtitle.propTypes = { - ...Text.propTypes, + ...TextPropTypes, style: PropTypes.oneOfType([ PropTypes.object, PropTypes.number, diff --git a/src/basic/Tab.js b/src/basic/Tab.js index ab3b678e6..0201ddf5e 100644 --- a/src/basic/Tab.js +++ b/src/basic/Tab.js @@ -1,6 +1,7 @@ import React, { Component } from 'react'; import PropTypes from 'prop-types'; -import { View, ViewPropTypes } from 'react-native'; +import { View } from 'react-native'; +import { ViewPropTypes } from 'deprecated-react-native-prop-types'; import { connectStyle } from 'native-base-shoutem-theme'; import mapPropsToStyleNames from '../utils/mapPropsToStyleNames'; diff --git a/src/basic/TabContainer.js b/src/basic/TabContainer.js index a2e6dd7d2..bc46a4047 100644 --- a/src/basic/TabContainer.js +++ b/src/basic/TabContainer.js @@ -1,6 +1,7 @@ import React, { Component } from 'react'; import PropTypes from 'prop-types'; -import { View, ViewPropTypes } from 'react-native'; +import { View } from 'react-native'; +import { ViewPropTypes } from 'deprecated-react-native-prop-types'; import { connectStyle } from 'native-base-shoutem-theme'; import mapPropsToStyleNames from '../utils/mapPropsToStyleNames'; diff --git a/src/basic/TabHeading.js b/src/basic/TabHeading.js index 3302b796a..96c4fb473 100644 --- a/src/basic/TabHeading.js +++ b/src/basic/TabHeading.js @@ -1,6 +1,7 @@ import React, { Component } from 'react'; import PropTypes from 'prop-types'; -import { View, ViewPropTypes } from 'react-native'; +import { View } from 'react-native'; +import { ViewPropTypes } from 'deprecated-react-native-prop-types'; import { connectStyle } from 'native-base-shoutem-theme'; import mapPropsToStyleNames from '../utils/mapPropsToStyleNames'; diff --git a/src/basic/Text.js b/src/basic/Text.js index 5d15e098d..2f786c7ee 100644 --- a/src/basic/Text.js +++ b/src/basic/Text.js @@ -1,6 +1,7 @@ import React from 'react'; import PropTypes from 'prop-types'; import { Text as RNText } from 'react-native'; +import { TextPropTypes } from 'deprecated-react-native-prop-types'; import _ from 'lodash'; import { connectStyle } from 'native-base-shoutem-theme'; @@ -35,7 +36,7 @@ class Text extends React.PureComponent { } Text.propTypes = { - ...RNText.propTypes, + ...TextPropTypes, uppercase: PropTypes.bool, style: PropTypes.oneOfType([ PropTypes.object, diff --git a/src/basic/Textarea.js b/src/basic/Textarea.js index ef297d4cd..e7c730525 100644 --- a/src/basic/Textarea.js +++ b/src/basic/Textarea.js @@ -1,6 +1,7 @@ import React, { Component } from 'react'; import PropTypes from 'prop-types'; import { TextInput } from 'react-native'; +import { TextInputPropTypes } from 'deprecated-react-native-prop-types'; import { connectStyle } from 'native-base-shoutem-theme'; import variables from '../theme/variables/platform'; @@ -44,7 +45,7 @@ class Textarea extends Component { } Textarea.propTypes = { - ...TextInput.propTypes, + ...TextInputPropTypes, style: PropTypes.oneOfType([ PropTypes.object, PropTypes.number, diff --git a/src/basic/Thumbnail.js b/src/basic/Thumbnail.js index 89cc71833..a222b9e30 100644 --- a/src/basic/Thumbnail.js +++ b/src/basic/Thumbnail.js @@ -1,6 +1,7 @@ import React, { Component } from 'react'; import PropTypes from 'prop-types'; import { Image } from 'react-native'; +import { ImagePropTypes } from 'deprecated-react-native-prop-types'; import { connectStyle } from 'native-base-shoutem-theme'; import mapPropsToStyleNames from '../utils/mapPropsToStyleNames'; @@ -12,7 +13,7 @@ class Thumbnail extends Component { } Thumbnail.propTypes = { - ...Image.propTypes, + ...ImagePropTypes, style: PropTypes.oneOfType([ PropTypes.object, PropTypes.number, diff --git a/src/basic/Title.js b/src/basic/Title.js index 76e96035a..77b0b595b 100644 --- a/src/basic/Title.js +++ b/src/basic/Title.js @@ -1,6 +1,7 @@ import React, { Component } from 'react'; import PropTypes from 'prop-types'; import { Text } from 'react-native'; +import { TextPropTypes } from 'deprecated-react-native-prop-types'; import { connectStyle } from 'native-base-shoutem-theme'; import mapPropsToStyleNames from '../utils/mapPropsToStyleNames'; @@ -14,7 +15,7 @@ class Title extends Component { } Title.propTypes = { - ...Text.propTypes, + ...TextPropTypes, style: PropTypes.oneOfType([ PropTypes.object, PropTypes.number, @@ -22,7 +23,9 @@ Title.propTypes = { ]) }; -const StyledTitle = connectStyle('NativeBase.Title', {}, mapPropsToStyleNames)( - Title -); +const StyledTitle = connectStyle( + 'NativeBase.Title', + {}, + mapPropsToStyleNames +)(Title); export { StyledTitle as Title }; diff --git a/src/basic/Toast.js b/src/basic/Toast.js index 834dbe777..2ae6891a6 100644 --- a/src/basic/Toast.js +++ b/src/basic/Toast.js @@ -1,6 +1,7 @@ import React, { Component } from 'react'; import PropTypes from 'prop-types'; -import { View, ViewPropTypes } from 'react-native'; +import { View } from 'react-native'; +import { ViewPropTypes } from 'deprecated-react-native-prop-types'; import { connectStyle } from 'native-base-shoutem-theme'; import mapPropsToStyleNames from '../utils/mapPropsToStyleNames'; @@ -20,7 +21,9 @@ Toast.propTypes = { ]) }; -const StyledToast = connectStyle('NativeBase.Toast', {}, mapPropsToStyleNames)( - Toast -); +const StyledToast = connectStyle( + 'NativeBase.Toast', + {}, + mapPropsToStyleNames +)(Toast); export { StyledToast as Toast }; diff --git a/src/basic/ToastContainer.js b/src/basic/ToastContainer.js index 4bd57acf3..410e4bd3e 100644 --- a/src/basic/ToastContainer.js +++ b/src/basic/ToastContainer.js @@ -1,12 +1,7 @@ /* eslint-disable class-methods-use-this */ import React, { Component } from 'react'; -import { - Keyboard, - Platform, - Animated, - ViewPropTypes, - PanResponder, -} from 'react-native'; +import { Keyboard, Platform, Animated, PanResponder } from 'react-native'; +import { ViewPropTypes } from 'deprecated-react-native-prop-types'; import { connectStyle } from 'native-base-shoutem-theme'; import mapPropsToStyleNames from '../utils/mapPropsToStyleNames'; @@ -19,7 +14,7 @@ import { Toast } from './Toast'; const POSITION = { ABSOLUTE: 'absolute', BOTTOM: 'bottom', - TOP: 'top', + TOP: 'top' }; class ToastContainer extends Component { @@ -39,7 +34,7 @@ class ToastContainer extends Component { pan: new Animated.ValueXY({ x: 0, y: 0 }), keyboardHeight: 0, isKeyboardVisible: false, - modalVisible: false, + modalVisible: false }; this.keyboardDidHide = this.keyboardDidHide.bind(this); @@ -54,7 +49,7 @@ class ToastContainer extends Component { useNativeDriver: false }).start(() => this.closeToast('swipe')); } - }, + } }); } @@ -77,7 +72,7 @@ class ToastContainer extends Component { paddingHorizontal: Platform.OS === PLATFORM.IOS ? 20 : 0, top: this.state.position === POSITION.TOP ? 30 : undefined, bottom: - this.state.position === POSITION.BOTTOM ? this.getTop() : undefined, + this.state.position === POSITION.BOTTOM ? this.getTop() : undefined }; } @@ -109,14 +104,14 @@ class ToastContainer extends Component { keyboardDidHide() { this.setState({ keyboardHeight: 0, - isKeyboardVisible: false, + isKeyboardVisible: false }); } keyboardDidShow(e) { this.setState({ keyboardHeight: e.endCoordinates.height, - isKeyboardVisible: true, + isKeyboardVisible: true }); } @@ -151,12 +146,12 @@ class ToastContainer extends Component { Animated.timing(this.state.fadeAnim, { toValue: 1, duration: 200, - useNativeDriver: false, + useNativeDriver: false }).start(); } - closeModal = (reason) => { + closeModal = reason => { this.setState({ - modalVisible: false, + modalVisible: false }); const { onClose } = this.state; if (onClose && typeof onClose === 'function') { @@ -168,7 +163,7 @@ class ToastContainer extends Component { Animated.timing(this.state.fadeAnim, { toValue: 0, duration: 200, - useNativeDriver: false, + useNativeDriver: false }).start(() => { this.closeModal(reason); this.state.pan.setValue({ x: 0, y: 0 }); @@ -180,10 +175,10 @@ class ToastContainer extends Component { const { x, y } = this.state.pan; return ( Date: Fri, 16 Sep 2022 13:05:06 +0200 Subject: [PATCH 2/3] update/generated dist --- dist/src/basic/Actionsheet.js | 2 +- dist/src/basic/Actionsheet.js.map | 2 +- dist/src/basic/Badge.js | 2 +- dist/src/basic/Badge.js.map | 2 +- dist/src/basic/Body.js | 2 +- dist/src/basic/Body.js.map | 2 +- dist/src/basic/Card.js | 2 +- dist/src/basic/Card.js.map | 2 +- dist/src/basic/DatePicker.js | 2 +- dist/src/basic/DatePicker.js.map | 2 +- dist/src/basic/DeckSwiper.js | 2 +- dist/src/basic/DeckSwiper.js.map | 2 +- dist/src/basic/Footer.js | 2 +- dist/src/basic/Footer.js.map | 2 +- dist/src/basic/FooterTab.js | 2 +- dist/src/basic/FooterTab.js.map | 2 +- dist/src/basic/Form.js | 2 +- dist/src/basic/Form.js.map | 2 +- dist/src/basic/Gravatar.js | 2 +- dist/src/basic/Gravatar.js.map | 2 +- dist/src/basic/H1.js | 2 +- dist/src/basic/H1.js.map | 2 +- dist/src/basic/H2.js | 2 +- dist/src/basic/H2.js.map | 2 +- dist/src/basic/H3.js | 2 +- dist/src/basic/H3.js.map | 2 +- dist/src/basic/Header.js | 2 +- dist/src/basic/Header.js.map | 2 +- dist/src/basic/Input.js | 2 +- dist/src/basic/Input.js.map | 2 +- dist/src/basic/InputGroup.js | 2 +- dist/src/basic/InputGroup.js.map | 2 +- dist/src/basic/Label.js | 2 +- dist/src/basic/Label.js.map | 2 +- dist/src/basic/Left.js | 2 +- dist/src/basic/Left.js.map | 2 +- dist/src/basic/Picker.ios.js | 2 +- dist/src/basic/Picker.ios.js.map | 2 +- dist/src/basic/Right.js | 2 +- dist/src/basic/Right.js.map | 2 +- dist/src/basic/Root.js | 2 +- dist/src/basic/Root.js.map | 2 +- dist/src/basic/Segment.js | 2 +- dist/src/basic/Segment.js.map | 2 +- dist/src/basic/Separator.js | 2 +- dist/src/basic/Separator.js.map | 2 +- dist/src/basic/Subtitle.js | 2 +- dist/src/basic/Subtitle.js.map | 2 +- dist/src/basic/Tab.js | 2 +- dist/src/basic/Tab.js.map | 2 +- dist/src/basic/TabContainer.js | 2 +- dist/src/basic/TabContainer.js.map | 2 +- dist/src/basic/TabHeading.js | 2 +- dist/src/basic/TabHeading.js.map | 2 +- dist/src/basic/Text.js | 2 +- dist/src/basic/Text.js.map | 2 +- dist/src/basic/Textarea.js | 2 +- dist/src/basic/Textarea.js.map | 2 +- dist/src/basic/Thumbnail.js | 2 +- dist/src/basic/Thumbnail.js.map | 2 +- dist/src/basic/Title.js | 2 +- dist/src/basic/Title.js.map | 2 +- dist/src/basic/Toast.js | 2 +- dist/src/basic/Toast.js.map | 2 +- dist/src/basic/ToastContainer.js | 2 +- dist/src/basic/ToastContainer.js.map | 2 +- dist/src/basic/View.js | 2 +- dist/src/basic/View.js.map | 2 +- 68 files changed, 68 insertions(+), 68 deletions(-) diff --git a/dist/src/basic/Actionsheet.js b/dist/src/basic/Actionsheet.js index 19e9175c0..93e69e6b6 100644 --- a/dist/src/basic/Actionsheet.js +++ b/dist/src/basic/Actionsheet.js @@ -1,2 +1,2 @@ -Object.defineProperty(exports,"__esModule",{value:true});exports.ActionSheetContainer=undefined;var _jsxFileName='src/basic/Actionsheet.js';var _extends=Object.assign||function(target){for(var i=1;i {\n return item.text;\n });\n\n const filteredConfig = { ...config, options: filtered };\n ActionSheetIOS.showActionSheetWithOptions(filteredConfig, callback);\n } else {\n ActionSheetIOS.showActionSheetWithOptions(config, callback);\n }\n } else {\n this.setState({\n items: config.options,\n title: config.title,\n message: config.message,\n destructiveButtonIndex: config.destructiveButtonIndex,\n cancelButtonIndex: config.cancelButtonIndex,\n modalVisible: true,\n callback,\n style: config.style,\n fontStyle: config.fontStyle,\n });\n }\n }\n\n hideActionSheet() {\n this.setState({ modalVisible: false });\n }\n\n render() {\n return (\n {\n this.state.callback(this.state.cancelButtonIndex);\n this.setState({ modalVisible: false });\n }}\n >\n {\n this.state.callback(this.state.cancelButtonIndex);\n this.setState({ modalVisible: false });\n }}\n style={styles.containerTouchable}\n >\n \n {this.state.title ? (\n {this.state.title}\n ) : null}\n String(index)}\n renderItem={({ index, item }) => {\n return typeof this.state.items[0] === 'string' ? (\n {\n this.state.callback(parseInt(index));\n this.setState({ modalVisible: false });\n }}\n style={styles.listItem}\n >\n {item}\n \n ) : (\n {\n this.state.callback(parseInt(index));\n this.setState({ modalVisible: false });\n }}\n style={[\n styles.listItem,\n {\n height: commonColor.listItemHeight,\n },\n ]}\n icon\n >\n \n \n \n \n {item.text}\n \n \n \n );\n }}\n />\n \n \n \n );\n }\n}\n\nActionSheetContainer.propTypes = {\n ...ViewPropTypes,\n};\n\nconst styles = StyleSheet.create({\n containerTouchable: {\n backgroundColor: commonColor.containerTouchableBackgroundColor,\n flex: 1,\n justifyContent: 'flex-end',\n },\n flatList: {\n marginHorizontal: commonColor.marginHorizontal,\n },\n innerTouchable: {\n backgroundColor: commonColor.innerTouchableBackgroundColor,\n minHeight: commonColor.minHeight,\n maxHeight: Dimensions.get('window').height / 2,\n padding: commonColor.padding,\n elevation: commonColor.elevation,\n },\n listItem: {\n borderColor: commonColor.listItemBorderColor,\n marginLeft: commonColor.marginLeft,\n },\n listItemBody: {\n borderColor: commonColor.listItemBorderColor,\n paddingLeft: commonColor.marginLeft / 2,\n },\n touchableText: {\n color: commonColor.touchableTextColor,\n },\n});\n\nconst StyledActionSheetContainer = connectStyle(\n 'NativeBase.ActionSheetContainer',\n {},\n mapPropsToStyleNames\n)(ActionSheetContainer);\n\nexport { StyledActionSheetContainer as ActionSheetContainer };\n"]} \ No newline at end of file +{"version":3,"sources":["../../../src/basic/Actionsheet.js"],"names":["ActionSheetContainer","config","callback","actionsheetInstance","_root","showActionSheet","hideActionSheet","props","state","modalVisible","items","autoHide","duration","console","warn","Platform","OS","PLATFORM","IOS","options","filtered","map","item","text","filteredConfig","ActionSheetIOS","showActionSheetWithOptions","setState","title","message","destructiveButtonIndex","cancelButtonIndex","style","fontStyle","styles","containerTouchable","innerTouchable","touchableText","flatList","marginTop","commonColor","index","String","parseInt","listItem","height","listItemHeight","icon","iconType","color","iconColor","undefined","listItemBody","Component","propTypes","ViewPropTypes","StyleSheet","create","backgroundColor","containerTouchableBackgroundColor","flex","justifyContent","marginHorizontal","innerTouchableBackgroundColor","minHeight","maxHeight","Dimensions","get","padding","elevation","borderColor","listItemBorderColor","marginLeft","paddingLeft","touchableTextColor","StyledActionSheetContainer","mapPropsToStyleNames"],"mappings":"02BAGA,4B,2CACA,yCASA,kFACA,iEAEA,mE,yEACA,2D,uDAEA,4BACA,4BACA,4BACA,8BACA,4BACA,oC,o4BAEMA,qB,yIACQC,M,CAAQC,Q,CAAU,CAC5B,KAAKC,mBAAL,CAAyBC,KAAzB,CAA+BC,eAA/B,CAA+CJ,MAA/C,CAAuDC,QAAvD,EACD,C,mCACa,CACZ,KAAKC,mBAAL,CAAyBC,KAAzB,CAA+BE,eAA/B,GACD,C,IAED,8BAAYC,KAAZ,CAAmB,8KACXA,KADW,GAEjB,MAAKC,KAAL,CAAa,CACXC,aAAc,KADH,CAEXC,MAAO,EAFI,CAAb,CAFiB,aAMlB,C,8FAEmB,CAClB,GAAI,CAAC,KAAKH,KAAL,CAAWI,QAAZ,EAAwB,KAAKJ,KAAL,CAAWK,QAAvC,CAAiD,CAE/CC,QAAQC,IAAR,8DACD,CACF,C,wDAIeb,M,CAAQC,Q,CAAU,CAChC,GAAIa,sBAASC,EAAT,GAAgBC,sBAASC,GAA7B,CAAkC,CAChC,GAAI,MAAOjB,QAAOkB,OAAP,CAAe,CAAf,CAAP,GAA6B,QAAjC,CAA2C,CACzC,GAAMA,SAAUlB,OAAOkB,OAAvB,CACA,GAAMC,UAAWD,QAAQE,GAAR,CAAY,cAAQ,CACnC,MAAOC,MA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UAAD,EAAM,MAAOjB,OAAOkB,YAApB,kDACE,8BAAC,UAAD,EAAM,MAAO,OAAK5C,KAAL,CAAWyB,SAAxB,kDAAoCX,KAAKC,IAAzC,CADF,CAtBF,CAyBE,8BAAC,YAAD,mDAzBF,CAXF,CAuCD,CA/CH,kDAPF,CARF,CATF,CADF,CA8ED,C,kCAxIgC8B,gB,EA2InCrD,qBAAqBsD,SAArB,aACKC,6CADL,EAIA,GAAMrB,QAASsB,wBAAWC,MAAX,CAAkB,CAC/BtB,mBAAoB,CAClBuB,gBAAiBlB,sBAAYmB,iCADX,CAElBC,KAAM,CAFY,CAGlBC,eAAgB,UAHE,CADW,CAM/BvB,SAAU,CACRwB,iBAAkBtB,sBAAYsB,gBADtB,CANqB,CAS/B1B,eAAgB,CACdsB,gBAAiBlB,sBAAYuB,6BADf,CAEdC,UAAWxB,sBAAYwB,SAFT,CAGdC,UAAWC,wBAAWC,GAAX,CAAe,QAAf,EAAyBtB,MAAzB,CAAkC,CAH/B,CAIduB,QAAS5B,sBAAY4B,OAJP,CAKdC,UAAW7B,sBAAY6B,SALT,CATe,CAgB/BzB,SAAU,CACR0B,YAAa9B,sBAAY+B,mBADjB,CAERC,WAAYhC,sBAAYgC,UAFhB,CAhBqB,CAoB/BpB,aAAc,CACZkB,YAAa9B,sBAAY+B,mBADb,CAEZE,YAAajC,sBAAYgC,UAAZ,CAAyB,CAF1B,CApBiB,CAwB/BnC,cAAe,CACbY,MAAOT,sBAAYkC,kBADN,CAxBgB,CAAlB,CAAf,CA6BA,GAAMC,4BAA6B,yCACjC,iCADiC,CAEjC,EAFiC,CAGjCC,8BAHiC,EAIjC5E,oBAJiC,CAAnC,C,QAMuCA,oB,CAA9B2E,0B","file":"Actionsheet.js","sourcesContent":["/* eslint-disable no-use-before-define */\n/* eslint-disable radix */\n\nimport React, { Component } from 'react';\nimport {\n ActionSheetIOS,\n Dimensions,\n FlatList,\n Modal,\n Platform,\n TouchableOpacity,\n StyleSheet\n} from 'react-native';\nimport { ViewPropTypes } from 'deprecated-react-native-prop-types';\nimport { connectStyle } from 'native-base-shoutem-theme';\n\nimport mapPropsToStyleNames from '../utils/mapPropsToStyleNames';\nimport commonColor, { PLATFORM } from '../theme/variables/commonColor';\n\nimport { Text } from './Text';\nimport { Icon } from './Icon';\nimport { Left } from './Left';\nimport { Right } from './Right';\nimport { Body } from './Body';\nimport { ListItem } from './ListItem';\n\nclass ActionSheetContainer extends Component {\n static show(config, callback) {\n this.actionsheetInstance._root.showActionSheet(config, callback);\n }\n static hide() {\n this.actionsheetInstance._root.hideActionSheet();\n }\n\n constructor(props) {\n super(props);\n this.state = {\n modalVisible: false,\n items: []\n };\n }\n\n componentDidMount() {\n if (!this.props.autoHide && this.props.duration) {\n // eslint-disable-next-line no-console\n console.warn(`It's not recommended to set autoHide false with duration`);\n }\n }\n\n static actionsheetInstance;\n\n showActionSheet(config, callback) {\n if (Platform.OS === PLATFORM.IOS) {\n if (typeof config.options[0] === 'object') {\n const options = config.options;\n const filtered = options.map(item => {\n return item.text;\n });\n\n const filteredConfig = { ...config, options: filtered };\n ActionSheetIOS.showActionSheetWithOptions(filteredConfig, callback);\n } else {\n ActionSheetIOS.showActionSheetWithOptions(config, callback);\n }\n } else {\n this.setState({\n items: config.options,\n title: config.title,\n message: config.message,\n destructiveButtonIndex: config.destructiveButtonIndex,\n cancelButtonIndex: config.cancelButtonIndex,\n modalVisible: true,\n callback,\n style: config.style,\n fontStyle: config.fontStyle\n });\n }\n }\n\n hideActionSheet() {\n this.setState({ modalVisible: false });\n }\n\n render() {\n return (\n {\n this.state.callback(this.state.cancelButtonIndex);\n this.setState({ modalVisible: false });\n }}\n >\n {\n this.state.callback(this.state.cancelButtonIndex);\n this.setState({ modalVisible: false });\n }}\n style={styles.containerTouchable}\n >\n \n {this.state.title ? (\n {this.state.title}\n ) : null}\n String(index)}\n renderItem={({ index, item }) => {\n return typeof this.state.items[0] === 'string' ? (\n {\n this.state.callback(parseInt(index));\n this.setState({ modalVisible: false });\n }}\n style={styles.listItem}\n >\n {item}\n \n ) : (\n {\n this.state.callback(parseInt(index));\n this.setState({ modalVisible: false });\n }}\n style={[\n styles.listItem,\n {\n height: commonColor.listItemHeight\n }\n ]}\n icon\n >\n \n \n \n \n {item.text}\n \n \n \n );\n }}\n />\n \n \n \n );\n }\n}\n\nActionSheetContainer.propTypes = {\n ...ViewPropTypes\n};\n\nconst styles = StyleSheet.create({\n containerTouchable: {\n backgroundColor: commonColor.containerTouchableBackgroundColor,\n flex: 1,\n justifyContent: 'flex-end'\n },\n flatList: {\n marginHorizontal: commonColor.marginHorizontal\n },\n innerTouchable: {\n backgroundColor: commonColor.innerTouchableBackgroundColor,\n minHeight: commonColor.minHeight,\n maxHeight: Dimensions.get('window').height / 2,\n padding: commonColor.padding,\n elevation: commonColor.elevation\n },\n listItem: {\n borderColor: commonColor.listItemBorderColor,\n marginLeft: commonColor.marginLeft\n },\n listItemBody: {\n borderColor: commonColor.listItemBorderColor,\n paddingLeft: commonColor.marginLeft / 2\n },\n touchableText: {\n color: commonColor.touchableTextColor\n }\n});\n\nconst StyledActionSheetContainer = connectStyle(\n 'NativeBase.ActionSheetContainer',\n {},\n mapPropsToStyleNames\n)(ActionSheetContainer);\n\nexport { StyledActionSheetContainer as ActionSheetContainer };\n"]} \ No newline at end of file diff --git a/dist/src/basic/Badge.js b/dist/src/basic/Badge.js index 75a8ab329..5ed4f5b3a 100644 --- a/dist/src/basic/Badge.js +++ b/dist/src/basic/Badge.js @@ -1,2 +1,2 @@ -Object.defineProperty(exports,"__esModule",{value:true});exports.Badge=undefined;var _extends=Object.assign||function(target){for(var i=1;i (this._root = c)} {...this.props}>\n {this.props.children}\n \n );\n }\n}\n\nBadge.propTypes = {\n ...ViewPropTypes,\n style: PropTypes.oneOfType([\n PropTypes.object,\n PropTypes.number,\n PropTypes.array\n ])\n};\n\nconst StyledBadge = connectStyle('NativeBase.Badge', {}, mapPropsToStyleNames)(\n Badge\n);\n\nexport { StyledBadge as Badge };\n"]} \ No newline at end of file +{"version":3,"sources":["../../../src/basic/Badge.js"],"names":["Badge","_root","c","props","children","Component","propTypes","ViewPropTypes","style","PropTypes","oneOfType","object","number","array","StyledBadge","mapPropsToStyleNames"],"mappings":"q1BAAA,4B,2CACA,qC,mDACA,yCACA,kFACA,iEAEA,mE,68BAEMA,M,uQACK,iBACP,MACE,+BAAC,iBAAD,WAAM,IAAK,sBAAM,QAAKC,KAAL,CAAaC,CAAnB,EAAX,EAAsC,KAAKC,KAA3C,mDACG,KAAKA,KAAL,CAAWC,QADd,CADF,CAKD,C,mBAPiBC,gB,EAUpBL,MAAMM,SAAN,aACKC,6CADL,EAEEC,MAAOC,oBAAUC,SAAV,CAAoB,CACzBD,oBAAUE,MADe,CAEzBF,oBAAUG,MAFe,CAGzBH,oBAAUI,KAHe,CAApB,CAFT,GASA,GAAMC,aAAc,yCAClB,kBADkB,CAElB,EAFkB,CAGlBC,8BAHkB,EAIlBf,KAJkB,CAApB,C,QAMwBA,K,CAAfc,W","file":"Badge.js","sourcesContent":["import React, { Component } from 'react';\nimport PropTypes from 'prop-types';\nimport { View } from 'react-native';\nimport { ViewPropTypes } from 'deprecated-react-native-prop-types';\nimport { connectStyle } from 'native-base-shoutem-theme';\n\nimport mapPropsToStyleNames from '../utils/mapPropsToStyleNames';\n\nclass Badge extends Component {\n render() {\n return (\n (this._root = c)} {...this.props}>\n {this.props.children}\n \n );\n }\n}\n\nBadge.propTypes = {\n ...ViewPropTypes,\n style: PropTypes.oneOfType([\n PropTypes.object,\n PropTypes.number,\n PropTypes.array\n ])\n};\n\nconst StyledBadge = connectStyle(\n 'NativeBase.Badge',\n {},\n mapPropsToStyleNames\n)(Badge);\n\nexport { StyledBadge as Badge };\n"]} \ No newline at end of file diff --git a/dist/src/basic/Body.js b/dist/src/basic/Body.js index 463d1509a..3934a675c 100644 --- a/dist/src/basic/Body.js +++ b/dist/src/basic/Body.js @@ -1,2 +1,2 @@ -Object.defineProperty(exports,"__esModule",{value:true});exports.Body=undefined;var _extends=Object.assign||function(target){for(var i=1;i (this._root = c)} {...this.props} />;\n }\n}\n\nBody.propTypes = {\n ...ViewPropTypes,\n style: PropTypes.oneOfType([\n PropTypes.object,\n PropTypes.number,\n PropTypes.array\n ])\n};\n\nconst StyledBody = connectStyle('NativeBase.Body', {}, mapPropsToStyleNames)(\n Body\n);\n\nexport { StyledBody as Body };\n"]} \ No newline at end of file +{"version":3,"sources":["../../../src/basic/Body.js"],"names":["Body","_root","c","props","Component","propTypes","ViewPropTypes","style","PropTypes","oneOfType","object","number","array","StyledBody","mapPropsToStyleNames"],"mappings":"m1BAAA,4B,2CACA,qC,mDACA,yCACA,kFACA,iEAEA,mE,68BAEMA,K,iQACK,iBACP,MAAO,+BAAC,iBAAD,WAAM,IAAK,sBAAM,QAAKC,KAAL,CAAaC,CAAnB,EAAX,EAAsC,KAAKC,KAA3C,mDAAP,CACD,C,kBAHgBC,gB,EAMnBJ,KAAKK,SAAL,aACKC,6CADL,EAEEC,MAAOC,oBAAUC,SAAV,CAAoB,CACzBD,oBAAUE,MADe,CAEzBF,oBAAUG,MAFe,CAGzBH,oBAAUI,KAHe,CAApB,CAFT,GASA,GAAMC,YAAa,yCACjB,iBADiB,CAEjB,EAFiB,CAGjBC,8BAHiB,EAIjBd,IAJiB,CAAnB,C,QAMuBA,I,CAAda,U","file":"Body.js","sourcesContent":["import React, { Component } from 'react';\nimport PropTypes from 'prop-types';\nimport { View } from 'react-native';\nimport { ViewPropTypes } from 'deprecated-react-native-prop-types';\nimport { connectStyle } from 'native-base-shoutem-theme';\n\nimport mapPropsToStyleNames from '../utils/mapPropsToStyleNames';\n\nclass Body extends Component {\n render() {\n return (this._root = c)} {...this.props} />;\n }\n}\n\nBody.propTypes = {\n ...ViewPropTypes,\n style: PropTypes.oneOfType([\n PropTypes.object,\n PropTypes.number,\n PropTypes.array\n ])\n};\n\nconst StyledBody = connectStyle(\n 'NativeBase.Body',\n {},\n mapPropsToStyleNames\n)(Body);\n\nexport { StyledBody as Body };\n"]} \ No newline at end of file diff --git a/dist/src/basic/Card.js b/dist/src/basic/Card.js index 33c53397f..9ac2a997b 100644 --- a/dist/src/basic/Card.js +++ b/dist/src/basic/Card.js @@ -1,2 +1,2 @@ -Object.defineProperty(exports,"__esModule",{value:true});exports.Card=undefined;var _extends=Object.assign||function(target){for(var i=1;i index.toString()}\n />\n );\n }\n return (\n (this._root = c)} {...this.props}>\n {this.props.children}\n \n );\n }\n}\n\nCard.propTypes = {\n ...ViewPropTypes,\n style: PropTypes.oneOfType([\n PropTypes.object,\n PropTypes.number,\n PropTypes.array\n ]),\n // eslint-disable-next-line react/forbid-prop-types\n dataArray: PropTypes.array,\n renderRow: PropTypes.func\n};\n\nconst StyledCard = connectStyle('NativeBase.Card', {}, mapPropsToStyleNames)(\n Card\n);\n\nexport { StyledCard as Card };\n"]} \ No newline at end of file +{"version":3,"sources":["../../../src/basic/Card.js"],"names":["Card","props","dataArray","renderRow","item","index","toString","_root","c","children","Component","propTypes","ViewPropTypes","style","PropTypes","oneOfType","object","number","array","func","StyledCard","mapPropsToStyleNames"],"mappings":"m1BAAA,4B,2CACA,qC,mDACA,yCACA,kFACA,iEAEA,mE,68BAEMA,K,iQACK,iBACP,GAAI,KAAKC,KAAL,CAAWC,SAAX,EAAwB,KAAKD,KAAL,CAAWE,SAAvC,CAAkD,CAChD,MACE,+BAAC,qBAAD,aACM,KAAKF,KADX,EAEE,KAAM,KAAKA,KAAL,CAAWC,SAFnB,CAGE,WAAY,KAAKD,KAAL,CAAWE,SAHzB,CAIE,aAAc,sBAACC,IAAD,CAAOC,KAAP,QAAiBA,OAAMC,QAAN,EAAjB,EAJhB,kDADF,CAQD,CACD,MACE,+BAAC,iBAAD,WAAM,IAAK,sBAAM,QAAKC,KAAL,CAAaC,CAAnB,EAAX,EAAsC,KAAKP,KAA3C,mDACG,KAAKA,KAAL,CAAWQ,QADd,CADF,CAKD,C,kBAjBgBC,gB,EAoBnBV,KAAKW,SAAL,aACKC,6CADL,EAEEC,MAAOC,oBAAUC,SAAV,CAAoB,CACzBD,oBAAUE,MADe,CAEzBF,oBAAUG,MAFe,CAGzBH,oBAAUI,KAHe,CAApB,CAFT,CAQEhB,UAAWY,oBAAUI,KARvB,CASEf,UAAWW,oBAAUK,IATvB,GAYA,GAAMC,YAAa,yCACjB,iBADiB,CAEjB,EAFiB,CAGjBC,8BAHiB,EAIjBrB,IAJiB,CAAnB,C,QAMuBA,I,CAAdoB,U","file":"Card.js","sourcesContent":["import React, { Component } from 'react';\nimport PropTypes from 'prop-types';\nimport { FlatList, View } from 'react-native';\nimport { ViewPropTypes } from 'deprecated-react-native-prop-types';\nimport { connectStyle } from 'native-base-shoutem-theme';\n\nimport mapPropsToStyleNames from '../utils/mapPropsToStyleNames';\n\nclass Card extends Component {\n render() {\n if (this.props.dataArray && this.props.renderRow) {\n return (\n index.toString()}\n />\n );\n }\n return (\n (this._root = c)} {...this.props}>\n {this.props.children}\n \n );\n }\n}\n\nCard.propTypes = {\n ...ViewPropTypes,\n style: PropTypes.oneOfType([\n PropTypes.object,\n PropTypes.number,\n PropTypes.array\n ]),\n // eslint-disable-next-line react/forbid-prop-types\n dataArray: PropTypes.array,\n renderRow: PropTypes.func\n};\n\nconst StyledCard = connectStyle(\n 'NativeBase.Card',\n {},\n mapPropsToStyleNames\n)(Card);\n\nexport { StyledCard as Card };\n"]} \ No newline at end of file diff --git a/dist/src/basic/DatePicker.js b/dist/src/basic/DatePicker.js index 0b7e765e1..7440af30d 100644 --- a/dist/src/basic/DatePicker.js +++ b/dist/src/basic/DatePicker.js @@ -1,2 +1,2 @@ -Object.defineProperty(exports,"__esModule",{value:true});exports.DatePicker=undefined;var _extends=Object.assign||function(target){for(var i=1;i this.setDate(date)}\n minimumDate={minimumDate}\n maximumDate={maximumDate}\n mode=\"date\"\n locale={locale}\n timeZoneOffsetInMinutes={timeZoneOffsetInMinutes}\n {...this.props}\n />\n );\n }\n}\n"]} \ No newline at end of file +{"version":3,"sources":["../../../src/basic/DatePicker.js"],"names":["DatePicker","props","state","defaultDate","Date","chosenDate","placeHolderText","undefined","date","setState","onDateChange","formatChosenDate","getDate","getMonth","getFullYear","join","locale","maximumDate","minimumDate","timeZoneOffsetInMinutes","setDate","React","Component","defaultProps","disabled"],"mappings":"+1BAAA,4B,2CAEA,sE,i8BAEaA,W,SAAAA,U,mEAIX,oBAAYC,KAAZ,CAAmB,gJACXA,KADW,GAEjB,MAAKC,KAAL,CAAa,CACXC,YAAaF,MAAME,WAAN,CAAoBF,MAAME,WAA1B,CAAwC,GAAIC,KAAJ,EAD1C,CAEXC,WACE,CAACJ,MAAMK,eAAP,EAA0BL,MAAME,WAAhC,CACIF,MAAME,WADV,CAEII,SALK,CAAb,CAFiB,aASlB,C,+DAEOC,I,CAAM,CACZ,KAAKC,QAAL,CAAc,CAAEJ,WAAY,GAAID,KAAJ,CAASI,IAAT,CAAd,CAAd,EACA,GAAI,KAAKP,KAAL,CAAWS,YAAf,CAA6B,CAC3B,KAAKT,KAAL,CAAWS,YAAX,CAAwBF,IAAxB,EACD,CACF,C,0DAEgBA,I,CAAM,CACrB,GAAI,KAAKP,KAAL,CAAWU,gBAAf,CAAiC,CAC/B,MAAO,MAAKV,KAAL,CAAWU,gBAAX,CAA4BH,IAA5B,CAAP,CACD,CACD,MAAO,CAACA,KAAKI,OAAL,EAAD,CAAiBJ,KAAKK,QAAL,GAAkB,CAAnC,CAAsCL,KAAKM,WAAL,EAAtC,EAA0DC,IAA1D,CAA+D,GAA/D,CAAP,CACD,C,uCAEQ,4BAMH,KAAKd,KANF,CAELe,MAFK,QAELA,MAFK,CAGLC,WAHK,QAGLA,WAHK,CAILC,WAJK,QAILA,WAJK,CAKLC,uBALK,QAKLA,uBALK,CAQP,MACE,+BAAC,wBAAD,WACE,KACE,KAAKjB,KAAL,CAAWG,UAAX,CAAwB,KAAKH,KAAL,CAAWG,UAAnC,CAAgD,KAAKH,KAAL,CAAWC,WAF/D,CAIE,aAAc,kCAAQ,QAAKiB,OAAL,CAAaZ,IAAb,CAAR,EAJhB,CAKE,YAAaU,WALf,CAME,YAAaD,WANf,CAOE,KAAK,MAPP,CAQE,OAAQD,MARV,CASE,wBAAyBG,uBAT3B,EAUM,KAAKlB,KAVX,mDADF,CAcD,C,wBAnD6BoB,gBAAMC,S,EAAzBtB,U,CACJuB,Y,CAAe,CACpBC,SAAU,KADU,C","file":"DatePicker.js","sourcesContent":["import React from 'react';\n\nimport DateTimePicker from '@react-native-community/datetimepicker';\n\nexport class DatePicker extends React.Component {\n static defaultProps = {\n disabled: false\n };\n constructor(props) {\n super(props);\n this.state = {\n defaultDate: props.defaultDate ? props.defaultDate : new Date(),\n chosenDate:\n !props.placeHolderText && props.defaultDate\n ? props.defaultDate\n : undefined\n };\n }\n\n setDate(date) {\n this.setState({ chosenDate: new Date(date) });\n if (this.props.onDateChange) {\n this.props.onDateChange(date);\n }\n }\n\n formatChosenDate(date) {\n if (this.props.formatChosenDate) {\n return this.props.formatChosenDate(date);\n }\n return [date.getDate(), date.getMonth() + 1, date.getFullYear()].join('/');\n }\n\n render() {\n const {\n locale,\n maximumDate,\n minimumDate,\n timeZoneOffsetInMinutes\n } = this.props;\n\n return (\n this.setDate(date)}\n minimumDate={minimumDate}\n maximumDate={maximumDate}\n mode=\"date\"\n locale={locale}\n timeZoneOffsetInMinutes={timeZoneOffsetInMinutes}\n {...this.props}\n />\n );\n }\n}\n"]} \ No newline at end of file diff --git a/dist/src/basic/DeckSwiper.js b/dist/src/basic/DeckSwiper.js index 11f3eb280..d691a350e 100644 --- a/dist/src/basic/DeckSwiper.js +++ b/dist/src/basic/DeckSwiper.js @@ -1,2 +1,2 @@ -Object.defineProperty(exports,"__esModule",{value:true});exports.DeckSwiper=undefined;var _jsxFileName='src/basic/DeckSwiper.js';var _extends=Object.assign||function(target){for(var i=1;i5;},onPanResponderGrant:function onPanResponderGrant(){_this2.state.pan.setOffset({x:_this2.state.pan.x._value,y:_this2.state.pan.y._value});_this2.state.pan.setValue({x:0,y:0});},onPanResponderMove:function onPanResponderMove(e,gestureState){if(gestureState.dx>20){if(_this2.props.onSwiping)_this2.props.onSwiping('right',gestureState.dx);}else if(gestureState.dx<-20){if(_this2.props.onSwiping)_this2.props.onSwiping('left',gestureState.dx);}var val=Math.abs(gestureState.dx*0.0013);if(val>0.2){val=0.2;}_reactNative.Animated.timing(_this2.state.fadeAnim,{toValue:0.8+val,useNativeDriver:false}).start();_reactNative.Animated.spring(_this2.state.enter,{toValue:0.8+val,friction:7,useNativeDriver:false}).start();_reactNative.Animated.event([null,{dx:_this2.state.pan.x}],{useNativeDriver:false})(e,gestureState);},onPanResponderRelease:function onPanResponderRelease(e,_ref3){var vx=_ref3.vx,vy=_ref3.vy;if(_this2.props.onSwiping)_this2.props.onSwiping(null);var velocity=void 0;if(vx>=0){velocity=(0,_clamp2.default)(vx,4.5,10);}else if(vx<0){velocity=(0,_clamp2.default)(vx*-1,4.5,10)*-1;}if(Math.abs(_this2.state.pan.x._value)>SWIPE_THRESHOLD){if(velocity>0){_this2.props.onSwipeRight?_this2.props.onSwipeRight(_this2.state.selectedItem):undefined;_this2.selectNext();}else{_this2.props.onSwipeLeft?_this2.props.onSwipeLeft(_this2.state.selectedItem):undefined;_this2.selectNext();}_reactNative.Animated.decay(_this2.state.pan,{velocity:{x:velocity,y:vy},deceleration:0.98,useNativeDriver:false}).start(_this2._resetState.bind(_this2));}else{_reactNative.Animated.spring(_this2.state.pan,{toValue:{x:0,y:0},friction:4,useNativeDriver:false}).start();}}});}},{key:'_resetState',value:function _resetState(){this.state.pan.setValue({x:0,y:0});this.state.enter.setValue(0.8);this.state.fadeAnim.setValue(0.8);this.setState({card1Top:!this.state.card1Top,card2Top:!this.state.card2Top});if(this.props.onSwiping)this.props.onSwiping(null);}},{key:'swipeRight',value:function swipeRight(){var _this3=this;if(this.props.onSwiping)this.props.onSwiping('right');setTimeout(function(){_reactNative.Animated.timing(_this3.state.fadeAnim,{toValue:1,useNativeDriver:false}).start();_reactNative.Animated.spring(_this3.state.enter,{toValue:1,friction:7,useNativeDriver:false}).start();_this3.selectNext();_reactNative.Animated.decay(_this3.state.pan,{velocity:{x:8,y:1},deceleration:0.98,useNativeDriver:false}).start(_this3._resetState.bind(_this3));},300);}},{key:'swipeLeft',value:function swipeLeft(){var _this4=this;if(this.props.onSwiping)this.props.onSwiping('left');setTimeout(function(){_reactNative.Animated.timing(_this4.state.fadeAnim,{toValue:1,useNativeDriver:false}).start();_reactNative.Animated.spring(_this4.state.enter,{toValue:1,friction:7,useNativeDriver:false}).start();_this4.selectNext();_reactNative.Animated.decay(_this4.state.pan,{velocity:{x:-8,y:1},deceleration:0.98,userNativeDriver:false}).start(_this4._resetState.bind(_this4));},300);}},{key:'selectNext',value:function selectNext(){var _this5=this;var dataSource=this.props.dataSource;var currentIndex=dataSource.indexOf(this.state.selectedItem);if(!this.state.looping){if(currentIndex===dataSource.length-1){return this.setState({disabled:true});}else if(currentIndex===dataSource.length-2){return setTimeout(function(){_this5.setState({selectedItem:dataSource[currentIndex+1]});setTimeout(function(){_this5.setState({lastCard:true});},350);},50);}}var nextIndexes=this.findNextIndexes(currentIndex);setTimeout(function(){_this5.setState({selectedItem:_this5.props.dataSource[nextIndexes[0]]});setTimeout(function(){_this5.setState({selectedItem2:_this5.props.dataSource[nextIndexes[1]]});},350);},50);return null;}},{key:'findNextIndexes',value:function findNextIndexes(currentIndex){var newIdx=currentIndex+1;var newIdx2=currentIndex+2;if(newIdx2>this.props.dataSource.length-1&&newIdx===this.props.dataSource.length-1){return[newIdx,0];}else if(newIdx>this.props.dataSource.length-1){return[0,1];}return[newIdx,newIdx2];}},{key:'render',value:function render(){if(this.state.disabled){return _react2.default.createElement(_reactNative.View,{style:{position:'relative',flexDirection:'column'},__source:{fileName:_jsxFileName,lineNumber:266}},_react2.default.createElement(_reactNative.View,{__source:{fileName:_jsxFileName,lineNumber:267}},this.props.renderEmpty&&this.props.renderEmpty()));}else if(this.state.lastCard){return _react2.default.createElement(_reactNative.View,{style:{position:'relative',flexDirection:'column'},__source:{fileName:_jsxFileName,lineNumber:273}},this.state.selectedItem===undefined?_react2.default.createElement(_reactNative.View,{__source:{fileName:_jsxFileName,lineNumber:275}}):_react2.default.createElement(_reactNative.View,{__source:{fileName:_jsxFileName,lineNumber:277}},_react2.default.createElement(_reactNative.Animated.View,_extends({style:[this.getCardStyles()[1],this.getInitialStyle().topCard,{opacity:this.state.fadeAnim}]},this._panResponder.panHandlers,{__source:{fileName:_jsxFileName,lineNumber:278}}),this.props.renderEmpty&&this.props.renderEmpty()),_react2.default.createElement(_reactNative.Animated.View,_extends({style:[this.getCardStyles()[0],this.getInitialStyle().topCard]},this._panResponder.panHandlers,{__source:{fileName:_jsxFileName,lineNumber:288}}),this.props.renderItem(this.state.selectedItem))));}return _react2.default.createElement(_reactNative.View,{style:{position:'relative',flexDirection:'column'},__source:{fileName:_jsxFileName,lineNumber:303}},this.state.selectedItem===undefined?_react2.default.createElement(_reactNative.View,{__source:{fileName:_jsxFileName,lineNumber:305}}):_react2.default.createElement(_reactNative.View,{__source:{fileName:_jsxFileName,lineNumber:307}},_react2.default.createElement(_reactNative.Animated.View,_extends({style:[this.getCardStyles()[1],this.getInitialStyle().topCard,{opacity:this.state.fadeAnim}]},this._panResponder.panHandlers,{__source:{fileName:_jsxFileName,lineNumber:308}}),this.props.renderBottom?this.props.renderBottom(this.state.selectedItem2):this.props.renderItem(this.state.selectedItem2)),_react2.default.createElement(_reactNative.Animated.View,_extends({style:[this.getCardStyles()[0],this.getInitialStyle().topCard]},this._panResponder.panHandlers,{__source:{fileName:_jsxFileName,lineNumber:320}}),this.props.renderTop?this.props.renderTop(this.state.selectedItem):this.props.renderItem(this.state.selectedItem))));}}]);return DeckSwiper;}(_react.Component);DeckSwiper.propTypes=_extends({},_reactNative.ViewPropTypes,{style:_propTypes2.default.oneOfType([_propTypes2.default.object,_propTypes2.default.number,_propTypes2.default.array]),dataSource:_propTypes2.default.array});var StyledDeckSwiper=(0,_nativeBaseShoutemTheme.connectStyle)('NativeBase.DeckSwiper',{},_mapPropsToStyleNames2.default)(DeckSwiper);exports.DeckSwiper=StyledDeckSwiper; +Object.defineProperty(exports,"__esModule",{value:true});exports.DeckSwiper=undefined;var _jsxFileName='src/basic/DeckSwiper.js';var _extends=Object.assign||function(target){for(var i=1;i5;},onPanResponderGrant:function onPanResponderGrant(){_this2.state.pan.setOffset({x:_this2.state.pan.x._value,y:_this2.state.pan.y._value});_this2.state.pan.setValue({x:0,y:0});},onPanResponderMove:function onPanResponderMove(e,gestureState){if(gestureState.dx>20){if(_this2.props.onSwiping)_this2.props.onSwiping('right',gestureState.dx);}else if(gestureState.dx<-20){if(_this2.props.onSwiping)_this2.props.onSwiping('left',gestureState.dx);}var val=Math.abs(gestureState.dx*0.0013);if(val>0.2){val=0.2;}_reactNative.Animated.timing(_this2.state.fadeAnim,{toValue:0.8+val,useNativeDriver:false}).start();_reactNative.Animated.spring(_this2.state.enter,{toValue:0.8+val,friction:7,useNativeDriver:false}).start();_reactNative.Animated.event([null,{dx:_this2.state.pan.x}],{useNativeDriver:false})(e,gestureState);},onPanResponderRelease:function onPanResponderRelease(e,_ref3){var vx=_ref3.vx,vy=_ref3.vy;if(_this2.props.onSwiping)_this2.props.onSwiping(null);var velocity=void 0;if(vx>=0){velocity=(0,_clamp2.default)(vx,4.5,10);}else if(vx<0){velocity=(0,_clamp2.default)(vx*-1,4.5,10)*-1;}if(Math.abs(_this2.state.pan.x._value)>SWIPE_THRESHOLD){if(velocity>0){_this2.props.onSwipeRight?_this2.props.onSwipeRight(_this2.state.selectedItem):undefined;_this2.selectNext();}else{_this2.props.onSwipeLeft?_this2.props.onSwipeLeft(_this2.state.selectedItem):undefined;_this2.selectNext();}_reactNative.Animated.decay(_this2.state.pan,{velocity:{x:velocity,y:vy},deceleration:0.98,useNativeDriver:false}).start(_this2._resetState.bind(_this2));}else{_reactNative.Animated.spring(_this2.state.pan,{toValue:{x:0,y:0},friction:4,useNativeDriver:false}).start();}}});}},{key:'_resetState',value:function _resetState(){this.state.pan.setValue({x:0,y:0});this.state.enter.setValue(0.8);this.state.fadeAnim.setValue(0.8);this.setState({card1Top:!this.state.card1Top,card2Top:!this.state.card2Top});if(this.props.onSwiping)this.props.onSwiping(null);}},{key:'swipeRight',value:function swipeRight(){var _this3=this;if(this.props.onSwiping)this.props.onSwiping('right');setTimeout(function(){_reactNative.Animated.timing(_this3.state.fadeAnim,{toValue:1,useNativeDriver:false}).start();_reactNative.Animated.spring(_this3.state.enter,{toValue:1,friction:7,useNativeDriver:false}).start();_this3.selectNext();_reactNative.Animated.decay(_this3.state.pan,{velocity:{x:8,y:1},deceleration:0.98,useNativeDriver:false}).start(_this3._resetState.bind(_this3));},300);}},{key:'swipeLeft',value:function swipeLeft(){var _this4=this;if(this.props.onSwiping)this.props.onSwiping('left');setTimeout(function(){_reactNative.Animated.timing(_this4.state.fadeAnim,{toValue:1,useNativeDriver:false}).start();_reactNative.Animated.spring(_this4.state.enter,{toValue:1,friction:7,useNativeDriver:false}).start();_this4.selectNext();_reactNative.Animated.decay(_this4.state.pan,{velocity:{x:-8,y:1},deceleration:0.98,userNativeDriver:false}).start(_this4._resetState.bind(_this4));},300);}},{key:'selectNext',value:function selectNext(){var _this5=this;var dataSource=this.props.dataSource;var currentIndex=dataSource.indexOf(this.state.selectedItem);if(!this.state.looping){if(currentIndex===dataSource.length-1){return this.setState({disabled:true});}else if(currentIndex===dataSource.length-2){return setTimeout(function(){_this5.setState({selectedItem:dataSource[currentIndex+1]});setTimeout(function(){_this5.setState({lastCard:true});},350);},50);}}var nextIndexes=this.findNextIndexes(currentIndex);setTimeout(function(){_this5.setState({selectedItem:_this5.props.dataSource[nextIndexes[0]]});setTimeout(function(){_this5.setState({selectedItem2:_this5.props.dataSource[nextIndexes[1]]});},350);},50);return null;}},{key:'findNextIndexes',value:function findNextIndexes(currentIndex){var newIdx=currentIndex+1;var newIdx2=currentIndex+2;if(newIdx2>this.props.dataSource.length-1&&newIdx===this.props.dataSource.length-1){return[newIdx,0];}else if(newIdx>this.props.dataSource.length-1){return[0,1];}return[newIdx,newIdx2];}},{key:'render',value:function render(){if(this.state.disabled){return _react2.default.createElement(_reactNative.View,{style:{position:'relative',flexDirection:'column'},__source:{fileName:_jsxFileName,lineNumber:286}},_react2.default.createElement(_reactNative.View,{__source:{fileName:_jsxFileName,lineNumber:287}},this.props.renderEmpty&&this.props.renderEmpty()));}else if(this.state.lastCard){return _react2.default.createElement(_reactNative.View,{style:{position:'relative',flexDirection:'column'},__source:{fileName:_jsxFileName,lineNumber:293}},this.state.selectedItem===undefined?_react2.default.createElement(_reactNative.View,{__source:{fileName:_jsxFileName,lineNumber:295}}):_react2.default.createElement(_reactNative.View,{__source:{fileName:_jsxFileName,lineNumber:297}},_react2.default.createElement(_reactNative.Animated.View,_extends({style:[this.getCardStyles()[1],this.getInitialStyle().topCard,{opacity:this.state.fadeAnim}]},this._panResponder.panHandlers,{__source:{fileName:_jsxFileName,lineNumber:298}}),this.props.renderEmpty&&this.props.renderEmpty()),_react2.default.createElement(_reactNative.Animated.View,_extends({style:[this.getCardStyles()[0],this.getInitialStyle().topCard]},this._panResponder.panHandlers,{__source:{fileName:_jsxFileName,lineNumber:308}}),this.props.renderItem(this.state.selectedItem))));}return _react2.default.createElement(_reactNative.View,{style:{position:'relative',flexDirection:'column'},__source:{fileName:_jsxFileName,lineNumber:323}},this.state.selectedItem===undefined?_react2.default.createElement(_reactNative.View,{__source:{fileName:_jsxFileName,lineNumber:325}}):_react2.default.createElement(_reactNative.View,{__source:{fileName:_jsxFileName,lineNumber:327}},_react2.default.createElement(_reactNative.Animated.View,_extends({style:[this.getCardStyles()[1],this.getInitialStyle().topCard,{opacity:this.state.fadeAnim}]},this._panResponder.panHandlers,{__source:{fileName:_jsxFileName,lineNumber:328}}),this.props.renderBottom?this.props.renderBottom(this.state.selectedItem2):this.props.renderItem(this.state.selectedItem2)),_react2.default.createElement(_reactNative.Animated.View,_extends({style:[this.getCardStyles()[0],this.getInitialStyle().topCard]},this._panResponder.panHandlers,{__source:{fileName:_jsxFileName,lineNumber:340}}),this.props.renderTop?this.props.renderTop(this.state.selectedItem):this.props.renderItem(this.state.selectedItem))));}}]);return DeckSwiper;}(_react.Component);DeckSwiper.propTypes=_extends({},_deprecatedReactNativePropTypes.ViewPropTypes,{style:_propTypes2.default.oneOfType([_propTypes2.default.object,_propTypes2.default.number,_propTypes2.default.array]),dataSource:_propTypes2.default.array});var StyledDeckSwiper=(0,_nativeBaseShoutemTheme.connectStyle)('NativeBase.DeckSwiper',{},_mapPropsToStyleNames2.default)(DeckSwiper);exports.DeckSwiper=StyledDeckSwiper; //# sourceMappingURL=DeckSwiper.js.map \ No newline at end of file diff --git a/dist/src/basic/DeckSwiper.js.map b/dist/src/basic/DeckSwiper.js.map index e1ae588f8..1ae696143 100644 --- a/dist/src/basic/DeckSwiper.js.map +++ b/dist/src/basic/DeckSwiper.js.map @@ -1 +1 @@ -{"version":3,"sources":["../../../src/basic/DeckSwiper.js"],"names":["SWIPE_THRESHOLD","DeckSwiper","props","getInitialStyle","topCard","position","top","right","left","state","pan","Animated","ValueXY","pan2","enter","Value","selectedItem","dataSource","selectedItem2","card1Top","card2Top","fadeAnim","looping","disabled","length","lastCard","setPanresponder","setState","undefined","visibleIndex","indexOf","currentIndex","nextIndex","x","y","translateX","translateY","rotate","interpolate","inputRange","outputRange","opacity","scale","animatedCardStyles","transform","animatedCardStyles2","_panResponder","PanResponder","create","onMoveShouldSetResponderCapture","onMoveShouldSetPanResponderCapture","evt","gestureState","Math","abs","dx","onPanResponderGrant","setOffset","_value","setValue","onPanResponderMove","e","onSwiping","val","timing","toValue","useNativeDriver","start","spring","friction","event","onPanResponderRelease","vx","vy","velocity","onSwipeRight","selectNext","onSwipeLeft","decay","deceleration","_resetState","bind","setTimeout","userNativeDriver","nextIndexes","findNextIndexes","newIdx","newIdx2","flexDirection","renderEmpty","getCardStyles","panHandlers","renderItem","renderBottom","renderTop","Component","propTypes","ViewPropTypes","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BxG,UAJuB,CAAzB,C,QAM6BA,U,CAApBuG,gB","file":"DeckSwiper.js","sourcesContent":["import React, { Component } from 'react';\nimport PropTypes from 'prop-types';\nimport { View, Animated, PanResponder, ViewPropTypes } from 'react-native';\nimport clamp from 'clamp';\nimport { connectStyle } from 'native-base-shoutem-theme';\n\nimport mapPropsToStyleNames from '../utils/mapPropsToStyleNames';\n\nconst SWIPE_THRESHOLD = 120;\n\nclass DeckSwiper extends Component {\n constructor(props) {\n super(props);\n this.state = {\n pan: new Animated.ValueXY(),\n pan2: new Animated.ValueXY(),\n enter: new Animated.Value(0.8),\n selectedItem: this.props.dataSource[0],\n selectedItem2: this.props.dataSource[1],\n card1Top: true,\n card2Top: false,\n fadeAnim: new Animated.Value(0.8),\n looping:\n typeof this.props.looping === 'undefined' ? true : this.props.looping,\n disabled: this.props.dataSource.length === 0,\n lastCard: this.props.dataSource.length === 1\n };\n this.setPanresponder();\n }\n\n componentDidUpdate({ dataSource }) {\n if (dataSource.length !== this.props.dataSource.length) {\n if (dataSource.length <= 1) {\n this.setState({\n ...this.state,\n selectedItem: dataSource[0],\n selectedItem2: undefined,\n disabled: dataSource.length === 0,\n lastCard: dataSource.length === 1\n });\n return;\n }\n\n const visibleIndex = dataSource.indexOf(this.state.selectedItem);\n const currentIndex = visibleIndex < 0 ? visibleIndex + 1 : visibleIndex;\n const nextIndex =\n currentIndex + 1 === dataSource.length ? 0 : currentIndex + 1;\n\n this.setState({\n selectedItem: dataSource[currentIndex],\n selectedItem2: dataSource[nextIndex]\n });\n }\n }\n\n getInitialStyle = () => {\n return {\n topCard: {\n position: 'absolute',\n top: 0,\n right: 0,\n left: 0\n }\n };\n };\n\n getCardStyles() {\n const { pan, enter } = this.state;\n\n const [translateX, translateY] = [pan.x, pan.y];\n // let [translateX, translateY] = [pan2.x, pan2.y];\n\n const rotate = pan.x.interpolate({\n inputRange: [-700, 0, 700],\n outputRange: ['-10deg', '0deg', '10deg']\n });\n\n const opacity = pan.x.interpolate({\n inputRange: [-320, 0, 320],\n outputRange: [0.9, 1, 0.9]\n });\n const scale = enter;\n\n const animatedCardStyles = {\n transform: [{ translateX }, { translateY }, { rotate }],\n opacity\n };\n const animatedCardStyles2 = { transform: [{ scale }] };\n\n return [animatedCardStyles, animatedCardStyles2];\n }\n\n setPanresponder() {\n this._panResponder = PanResponder.create({\n onMoveShouldSetResponderCapture: () => true,\n onMoveShouldSetPanResponderCapture: (evt, gestureState) =>\n Math.abs(gestureState.dx) > 5,\n\n onPanResponderGrant: () => {\n this.state.pan.setOffset({\n x: this.state.pan.x._value,\n y: this.state.pan.y._value\n });\n this.state.pan.setValue({ x: 0, y: 0 });\n },\n\n onPanResponderMove: (e, gestureState) => {\n if (gestureState.dx > 20) {\n if (this.props.onSwiping)\n this.props.onSwiping('right', gestureState.dx);\n } else if (gestureState.dx < -20) {\n if (this.props.onSwiping)\n this.props.onSwiping('left', gestureState.dx);\n }\n let val = Math.abs(gestureState.dx * 0.0013);\n if (val > 0.2) {\n val = 0.2;\n }\n Animated.timing(this.state.fadeAnim, { toValue: 0.8 + val, useNativeDriver: false }).start();\n Animated.spring(this.state.enter, {\n toValue: 0.8 + val,\n friction: 7,\n useNativeDriver: false\n }).start();\n Animated.event([null, { dx: this.state.pan.x }], { useNativeDriver: false })(e, gestureState);\n },\n\n onPanResponderRelease: (e, { vx, vy }) => {\n if (this.props.onSwiping) this.props.onSwiping(null);\n let velocity;\n\n if (vx >= 0) {\n velocity = clamp(vx, 4.5, 10);\n } else if (vx < 0) {\n velocity = clamp(vx * -1, 4.5, 10) * -1;\n }\n\n if (Math.abs(this.state.pan.x._value) > SWIPE_THRESHOLD) {\n if (velocity > 0) {\n this.props.onSwipeRight\n ? this.props.onSwipeRight(this.state.selectedItem)\n : undefined;\n this.selectNext();\n } else {\n this.props.onSwipeLeft\n ? this.props.onSwipeLeft(this.state.selectedItem)\n : undefined;\n this.selectNext();\n }\n\n Animated.decay(this.state.pan, {\n velocity: { x: velocity, y: vy },\n deceleration: 0.98,\n useNativeDriver: false\n }).start(this._resetState.bind(this));\n } else {\n Animated.spring(this.state.pan, {\n toValue: { x: 0, y: 0 },\n friction: 4,\n useNativeDriver: false\n }).start();\n }\n }\n });\n }\n\n _resetState() {\n this.state.pan.setValue({ x: 0, y: 0 });\n this.state.enter.setValue(0.8);\n this.state.fadeAnim.setValue(0.8);\n this.setState({\n card1Top: !this.state.card1Top,\n card2Top: !this.state.card2Top\n });\n if (this.props.onSwiping) this.props.onSwiping(null);\n }\n\n swipeRight() {\n if (this.props.onSwiping) this.props.onSwiping('right');\n setTimeout(() => {\n Animated.timing(this.state.fadeAnim, { toValue: 1, useNativeDriver: false }).start();\n Animated.spring(this.state.enter, { toValue: 1, friction: 7, useNativeDriver: false }).start();\n this.selectNext();\n Animated.decay(this.state.pan, {\n velocity: { x: 8, y: 1 },\n deceleration: 0.98,\n useNativeDriver: false\n }).start(this._resetState.bind(this));\n }, 300);\n }\n\n swipeLeft() {\n if (this.props.onSwiping) this.props.onSwiping('left');\n setTimeout(() => {\n Animated.timing(this.state.fadeAnim, { toValue: 1, useNativeDriver: false }).start();\n Animated.spring(this.state.enter, { toValue: 1, friction: 7, useNativeDriver: false }).start();\n this.selectNext();\n Animated.decay(this.state.pan, {\n velocity: { x: -8, y: 1 },\n deceleration: 0.98,\n userNativeDriver: false\n }).start(this._resetState.bind(this));\n }, 300);\n }\n\n selectNext() {\n const dataSource = this.props.dataSource;\n const currentIndex = dataSource.indexOf(this.state.selectedItem);\n\n // if not looping, check for these conditionals and if true return from selectNext()\n if (!this.state.looping) {\n // reached end -> only display static renderEmpty() -> no swiping\n if (currentIndex === dataSource.length - 1) {\n return this.setState({\n disabled: true\n });\n } else if (currentIndex === dataSource.length - 2) {\n // show last card with renderEmpty() component behind it\n return setTimeout(() => {\n this.setState({\n selectedItem: dataSource[currentIndex + 1]\n });\n setTimeout(() => {\n this.setState({\n lastCard: true\n });\n }, 350);\n }, 50);\n }\n }\n\n const nextIndexes = this.findNextIndexes(currentIndex);\n setTimeout(() => {\n this.setState({\n selectedItem: this.props.dataSource[nextIndexes[0]]\n });\n setTimeout(() => {\n this.setState({\n selectedItem2: this.props.dataSource[nextIndexes[1]]\n });\n }, 350);\n }, 50);\n\n return null;\n }\n\n findNextIndexes(currentIndex) {\n const newIdx = currentIndex + 1;\n const newIdx2 = currentIndex + 2;\n\n if (\n newIdx2 > this.props.dataSource.length - 1 &&\n newIdx === this.props.dataSource.length - 1\n ) {\n return [newIdx, 0];\n } else if (newIdx > this.props.dataSource.length - 1) {\n return [0, 1];\n }\n return [newIdx, newIdx2];\n }\n\n render() {\n if (this.state.disabled) {\n // disable swiping and renderEmpty\n return (\n \n {{this.props.renderEmpty && this.props.renderEmpty()}}\n \n );\n } else if (this.state.lastCard) {\n // display renderEmpty underneath last viable card\n return (\n \n {this.state.selectedItem === undefined ? (\n \n ) : (\n \n \n {this.props.renderEmpty && this.props.renderEmpty()}\n \n \n {this.props.renderItem(this.state.selectedItem)}\n \n \n )}\n \n );\n }\n return (\n \n {this.state.selectedItem === undefined ? (\n \n ) : (\n \n \n {this.props.renderBottom\n ? this.props.renderBottom(this.state.selectedItem2)\n : this.props.renderItem(this.state.selectedItem2)}\n \n \n {this.props.renderTop\n ? this.props.renderTop(this.state.selectedItem)\n : this.props.renderItem(this.state.selectedItem)}\n \n \n )}\n \n );\n }\n}\n\nDeckSwiper.propTypes = {\n ...ViewPropTypes,\n style: PropTypes.oneOfType([\n PropTypes.object,\n PropTypes.number,\n PropTypes.array\n ]),\n // eslint-disable-next-line react/forbid-prop-types\n dataSource: PropTypes.array\n};\n\nconst StyledDeckSwiper = connectStyle(\n 'NativeBase.DeckSwiper',\n {},\n mapPropsToStyleNames\n)(DeckSwiper);\n\nexport { StyledDeckSwiper as DeckSwiper };\n"]} \ No newline at end of file +{"version":3,"sources":["../../../src/basic/DeckSwiper.js"],"names":["SWIPE_THRESHOLD","DeckSwiper","props","getInitialStyle","topCard","position","top","right","left","state","pan","Animated","ValueXY","pan2","enter","Value","selectedItem","dataSource","selectedItem2","card1Top","card2Top","fadeAnim","looping","disabled","length","lastCard","setPanresponder","setState","undefined","visibleIndex","indexOf","currentIndex","nextIndex","x","y","translateX","translateY","rotate","interpolate","inputRange","outputRange","opacity","scale","animatedCardStyles","transform","animatedCardStyles2","_panResponder","PanResponder","create","onMoveShouldSetResponderCapture","onMoveShouldSetPanResponderCapture","evt","gestureState","Math","abs","dx","onPanResponderGrant","setOffset","_value","setValue","onPanResponderMove","e","onSwiping","val","timing","toValue","useNativeDriver","start","spring","friction","event","onPanResponderRelease","vx","vy","velocity","onSwipeRight","selectNext","onSwipeLeft","decay","deceleration","_resetState","bind","setTimeout","userNativeDriver","nextIndexes","findNextIndexes","newIdx","newIdx2","flexDirection","renderEmpty","getCardStyles","panHandlers","renderItem","renderBottom","renderTop","Component","propTypes","ViewPropTypes","style","PropTypes","oneOfType","object","number","array","StyledDeckSwiper","mapPropsToStyleNames"],"mappings":"+1BAAA,4B,2CACA,qC,mDACA,yCACA,kFACA,4B,2CACA,iEAEA,mE,08BAEA,GAAMA,iBAAkB,GAAxB,C,GAEMC,W,uDACJ,oBAAYC,KAAZ,CAAmB,gJACXA,KADW,SA4CnBC,eA5CmB,CA4CD,UAAM,CACtB,MAAO,CACLC,QAAS,CACPC,SAAU,UADH,CAEPC,IAAK,CAFE,CAGPC,MAAO,CAHA,CAIPC,KAAM,CAJC,CADJ,CAAP,CAQD,CArDkB,CAEjB,MAAKC,KAAL,CAAa,CACXC,IAAK,GAAIC,uBAASC,OAAb,EADM,CAEXC,KAAM,GAAIF,uBAASC,OAAb,EAFK,CAGXE,MAAO,GAAIH,uBAASI,KAAb,CAAmB,GAAnB,CAHI,CAIXC,aAAc,MAAKd,KAAL,CAAWe,UAAX,CAAsB,CAAtB,CAJH,CAKXC,cAAe,MAAKhB,KAAL,CAAWe,UAAX,CAAsB,CAAtB,CALJ,CAMXE,SAAU,IANC,CAOXC,SAAU,KAPC,CAQXC,SAAU,GAAIV,uB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AKvF,eAAL,GAAuBC,OAAjD,CADT,EAEM,KAAK0C,aAAL,CAAmB6C,WAFzB,oDAIG,KAAKzF,KAAL,CAAW4F,SAAX,CACG,KAAK5F,KAAL,CAAW4F,SAAX,CAAqB,KAAKrF,KAAL,CAAWO,YAAhC,CADH,CAEG,KAAKd,KAAL,CAAW0F,UAAX,CAAsB,KAAKnF,KAAL,CAAWO,YAAjC,CANN,CAbF,CAJJ,CADF,CA8BD,C,wBApVsB+E,gB,EAuVzB9F,WAAW+F,SAAX,aACKC,6CADL,EAEEC,MAAOC,oBAAUC,SAAV,CAAoB,CACzBD,oBAAUE,MADe,CAEzBF,oBAAUG,MAFe,CAGzBH,oBAAUI,KAHe,CAApB,CAFT,CAQEtF,WAAYkF,oBAAUI,KARxB,GAWA,GAAMC,kBAAmB,yCACvB,uBADuB,CAEvB,EAFuB,CAGvBC,8BAHuB,EAIvBxG,UAJuB,CAAzB,C,QAM6BA,U,CAApBuG,gB","file":"DeckSwiper.js","sourcesContent":["import React, { Component } from 'react';\nimport PropTypes from 'prop-types';\nimport { View, Animated, PanResponder } from 'react-native';\nimport { ViewPropTypes } from 'deprecated-react-native-prop-types';\nimport clamp from 'clamp';\nimport { connectStyle } from 'native-base-shoutem-theme';\n\nimport mapPropsToStyleNames from '../utils/mapPropsToStyleNames';\n\nconst SWIPE_THRESHOLD = 120;\n\nclass DeckSwiper extends Component {\n constructor(props) {\n super(props);\n this.state = {\n pan: new Animated.ValueXY(),\n pan2: new Animated.ValueXY(),\n enter: new Animated.Value(0.8),\n selectedItem: this.props.dataSource[0],\n selectedItem2: this.props.dataSource[1],\n card1Top: true,\n card2Top: false,\n fadeAnim: new Animated.Value(0.8),\n looping:\n typeof this.props.looping === 'undefined' ? true : this.props.looping,\n disabled: this.props.dataSource.length === 0,\n lastCard: this.props.dataSource.length === 1\n };\n this.setPanresponder();\n }\n\n componentDidUpdate({ dataSource }) {\n if (dataSource.length !== this.props.dataSource.length) {\n if (dataSource.length <= 1) {\n this.setState({\n ...this.state,\n selectedItem: dataSource[0],\n selectedItem2: undefined,\n disabled: dataSource.length === 0,\n lastCard: dataSource.length === 1\n });\n return;\n }\n\n const visibleIndex = dataSource.indexOf(this.state.selectedItem);\n const currentIndex = visibleIndex < 0 ? visibleIndex + 1 : visibleIndex;\n const nextIndex =\n currentIndex + 1 === dataSource.length ? 0 : currentIndex + 1;\n\n this.setState({\n selectedItem: dataSource[currentIndex],\n selectedItem2: dataSource[nextIndex]\n });\n }\n }\n\n getInitialStyle = () => {\n return {\n topCard: {\n position: 'absolute',\n top: 0,\n right: 0,\n left: 0\n }\n };\n };\n\n getCardStyles() {\n const { pan, enter } = this.state;\n\n const [translateX, translateY] = [pan.x, pan.y];\n // let [translateX, translateY] = [pan2.x, pan2.y];\n\n const rotate = pan.x.interpolate({\n inputRange: [-700, 0, 700],\n outputRange: ['-10deg', '0deg', '10deg']\n });\n\n const opacity = pan.x.interpolate({\n inputRange: [-320, 0, 320],\n outputRange: [0.9, 1, 0.9]\n });\n const scale = enter;\n\n const animatedCardStyles = {\n transform: [{ translateX }, { translateY }, { rotate }],\n opacity\n };\n const animatedCardStyles2 = { transform: [{ scale }] };\n\n return [animatedCardStyles, animatedCardStyles2];\n }\n\n setPanresponder() {\n this._panResponder = PanResponder.create({\n onMoveShouldSetResponderCapture: () => true,\n onMoveShouldSetPanResponderCapture: (evt, gestureState) =>\n Math.abs(gestureState.dx) > 5,\n\n onPanResponderGrant: () => {\n this.state.pan.setOffset({\n x: this.state.pan.x._value,\n y: this.state.pan.y._value\n });\n this.state.pan.setValue({ x: 0, y: 0 });\n },\n\n onPanResponderMove: (e, gestureState) => {\n if (gestureState.dx > 20) {\n if (this.props.onSwiping)\n this.props.onSwiping('right', gestureState.dx);\n } else if (gestureState.dx < -20) {\n if (this.props.onSwiping)\n this.props.onSwiping('left', gestureState.dx);\n }\n let val = Math.abs(gestureState.dx * 0.0013);\n if (val > 0.2) {\n val = 0.2;\n }\n Animated.timing(this.state.fadeAnim, {\n toValue: 0.8 + val,\n useNativeDriver: false\n }).start();\n Animated.spring(this.state.enter, {\n toValue: 0.8 + val,\n friction: 7,\n useNativeDriver: false\n }).start();\n Animated.event([null, { dx: this.state.pan.x }], {\n useNativeDriver: false\n })(e, gestureState);\n },\n\n onPanResponderRelease: (e, { vx, vy }) => {\n if (this.props.onSwiping) this.props.onSwiping(null);\n let velocity;\n\n if (vx >= 0) {\n velocity = clamp(vx, 4.5, 10);\n } else if (vx < 0) {\n velocity = clamp(vx * -1, 4.5, 10) * -1;\n }\n\n if (Math.abs(this.state.pan.x._value) > SWIPE_THRESHOLD) {\n if (velocity > 0) {\n this.props.onSwipeRight\n ? this.props.onSwipeRight(this.state.selectedItem)\n : undefined;\n this.selectNext();\n } else {\n this.props.onSwipeLeft\n ? this.props.onSwipeLeft(this.state.selectedItem)\n : undefined;\n this.selectNext();\n }\n\n Animated.decay(this.state.pan, {\n velocity: { x: velocity, y: vy },\n deceleration: 0.98,\n useNativeDriver: false\n }).start(this._resetState.bind(this));\n } else {\n Animated.spring(this.state.pan, {\n toValue: { x: 0, y: 0 },\n friction: 4,\n useNativeDriver: false\n }).start();\n }\n }\n });\n }\n\n _resetState() {\n this.state.pan.setValue({ x: 0, y: 0 });\n this.state.enter.setValue(0.8);\n this.state.fadeAnim.setValue(0.8);\n this.setState({\n card1Top: !this.state.card1Top,\n card2Top: !this.state.card2Top\n });\n if (this.props.onSwiping) this.props.onSwiping(null);\n }\n\n swipeRight() {\n if (this.props.onSwiping) this.props.onSwiping('right');\n setTimeout(() => {\n Animated.timing(this.state.fadeAnim, {\n toValue: 1,\n useNativeDriver: false\n }).start();\n Animated.spring(this.state.enter, {\n toValue: 1,\n friction: 7,\n useNativeDriver: false\n }).start();\n this.selectNext();\n Animated.decay(this.state.pan, {\n velocity: { x: 8, y: 1 },\n deceleration: 0.98,\n useNativeDriver: false\n }).start(this._resetState.bind(this));\n }, 300);\n }\n\n swipeLeft() {\n if (this.props.onSwiping) this.props.onSwiping('left');\n setTimeout(() => {\n Animated.timing(this.state.fadeAnim, {\n toValue: 1,\n useNativeDriver: false\n }).start();\n Animated.spring(this.state.enter, {\n toValue: 1,\n friction: 7,\n useNativeDriver: false\n }).start();\n this.selectNext();\n Animated.decay(this.state.pan, {\n velocity: { x: -8, y: 1 },\n deceleration: 0.98,\n userNativeDriver: false\n }).start(this._resetState.bind(this));\n }, 300);\n }\n\n selectNext() {\n const dataSource = this.props.dataSource;\n const currentIndex = dataSource.indexOf(this.state.selectedItem);\n\n // if not looping, check for these conditionals and if true return from selectNext()\n if (!this.state.looping) {\n // reached end -> only display static renderEmpty() -> no swiping\n if (currentIndex === dataSource.length - 1) {\n return this.setState({\n disabled: true\n });\n } else if (currentIndex === dataSource.length - 2) {\n // show last card with renderEmpty() component behind it\n return setTimeout(() => {\n this.setState({\n selectedItem: dataSource[currentIndex + 1]\n });\n setTimeout(() => {\n this.setState({\n lastCard: true\n });\n }, 350);\n }, 50);\n }\n }\n\n const nextIndexes = this.findNextIndexes(currentIndex);\n setTimeout(() => {\n this.setState({\n selectedItem: this.props.dataSource[nextIndexes[0]]\n });\n setTimeout(() => {\n this.setState({\n selectedItem2: this.props.dataSource[nextIndexes[1]]\n });\n }, 350);\n }, 50);\n\n return null;\n }\n\n findNextIndexes(currentIndex) {\n const newIdx = currentIndex + 1;\n const newIdx2 = currentIndex + 2;\n\n if (\n newIdx2 > this.props.dataSource.length - 1 &&\n newIdx === this.props.dataSource.length - 1\n ) {\n return [newIdx, 0];\n } else if (newIdx > this.props.dataSource.length - 1) {\n return [0, 1];\n }\n return [newIdx, newIdx2];\n }\n\n render() {\n if (this.state.disabled) {\n // disable swiping and renderEmpty\n return (\n \n {{this.props.renderEmpty && this.props.renderEmpty()}}\n \n );\n } else if (this.state.lastCard) {\n // display renderEmpty underneath last viable card\n return (\n \n {this.state.selectedItem === undefined ? (\n \n ) : (\n \n \n {this.props.renderEmpty && this.props.renderEmpty()}\n \n \n {this.props.renderItem(this.state.selectedItem)}\n \n \n )}\n \n );\n }\n return (\n \n {this.state.selectedItem === undefined ? (\n \n ) : (\n \n \n {this.props.renderBottom\n ? this.props.renderBottom(this.state.selectedItem2)\n : this.props.renderItem(this.state.selectedItem2)}\n \n \n {this.props.renderTop\n ? this.props.renderTop(this.state.selectedItem)\n : this.props.renderItem(this.state.selectedItem)}\n \n \n )}\n \n );\n }\n}\n\nDeckSwiper.propTypes = {\n ...ViewPropTypes,\n style: PropTypes.oneOfType([\n PropTypes.object,\n PropTypes.number,\n PropTypes.array\n ]),\n // eslint-disable-next-line react/forbid-prop-types\n dataSource: PropTypes.array\n};\n\nconst StyledDeckSwiper = connectStyle(\n 'NativeBase.DeckSwiper',\n {},\n mapPropsToStyleNames\n)(DeckSwiper);\n\nexport { StyledDeckSwiper as DeckSwiper };\n"]} \ No newline at end of file diff --git a/dist/src/basic/Footer.js b/dist/src/basic/Footer.js index 870e006d1..041ae2d6e 100644 --- a/dist/src/basic/Footer.js +++ b/dist/src/basic/Footer.js @@ -1,2 +1,2 @@ -Object.defineProperty(exports,"__esModule",{value:true});exports.Footer=undefined;var _extends=Object.assign||function(target){for(var i=1;i\n (this._root = c)} {...this.props} />\n \n );\n }\n}\n\nFooter.propTypes = {\n ...ViewPropTypes,\n style: PropTypes.oneOfType([\n PropTypes.object,\n PropTypes.number,\n PropTypes.array\n ])\n};\n\nconst StyledFooter = connectStyle(\n 'NativeBase.Footer',\n {},\n mapPropsToStyleNames\n)(Footer);\nexport { StyledFooter as Footer };\n"]} \ No newline at end of file +{"version":3,"sources":["../../../src/basic/Footer.js"],"names":["Footer","style","props","backgroundColor","_root","c","Component","contextTypes","theme","PropTypes","object","propTypes","ViewPropTypes","oneOfType","number","array","StyledFooter","mapPropsToStyleNames"],"mappings":"u1BAAA,4B,2CACA,qC,mDACA,yCACA,kFACA,iEAEA,mE,yEACA,2C,q7BAEMA,O,6QAKK,oBACCC,MADD,CACW,KAAKC,KADhB,CACCD,KADD,CAGP,MACE,+BAAC,yBAAD,EACE,MAAO,CACLE,gBAAiB,uBAASF,KAAT,EAAgBE,eAD5B,CADT,iDAKE,8BAAC,iBAAD,WAAM,IAAK,sBAAM,QAAKC,KAAL,CAAaC,CAAnB,EAAX,EAAsC,KAAKH,KAA3C,mDALF,CADF,CASD,C,oBAjBkBI,gB,EAAfN,M,CACGO,Y,CAAe,CACpBC,MAAOC,oBAAUC,MADG,C,CAmBxBV,OAAOW,SAAP,aACKC,6CADL,EAEEX,MAAOQ,oBAAUI,SAAV,CAAoB,CACzBJ,oBAAUC,MADe,CAEzBD,oBAAUK,MAFe,CAGzBL,oBAAUM,KAHe,CAApB,CAFT,GASA,GAAMC,cAAe,yCACnB,mBADmB,CAEnB,EAFmB,CAGnBC,8BAHmB,EAInBjB,MAJmB,CAArB,C,QAKyBA,M,CAAhBgB,Y","file":"Footer.js","sourcesContent":["import React, { Component } from 'react';\nimport PropTypes from 'prop-types';\nimport { View, SafeAreaView } from 'react-native';\nimport { ViewPropTypes } from 'deprecated-react-native-prop-types';\nimport { connectStyle } from 'native-base-shoutem-theme';\n\nimport mapPropsToStyleNames from '../utils/mapPropsToStyleNames';\nimport getStyle from '../utils/getStyle';\n\nclass Footer extends Component {\n static contextTypes = {\n theme: PropTypes.object\n };\n\n render() {\n const { style } = this.props;\n\n return (\n \n (this._root = c)} {...this.props} />\n \n );\n }\n}\n\nFooter.propTypes = {\n ...ViewPropTypes,\n style: PropTypes.oneOfType([\n PropTypes.object,\n PropTypes.number,\n PropTypes.array\n ])\n};\n\nconst StyledFooter = connectStyle(\n 'NativeBase.Footer',\n {},\n mapPropsToStyleNames\n)(Footer);\nexport { StyledFooter as Footer };\n"]} \ No newline at end of file diff --git a/dist/src/basic/FooterTab.js b/dist/src/basic/FooterTab.js index 21a56affd..4de511bd5 100644 --- a/dist/src/basic/FooterTab.js +++ b/dist/src/basic/FooterTab.js @@ -1,2 +1,2 @@ -Object.defineProperty(exports,"__esModule",{value:true});exports.FooterTab=undefined;var _extends=Object.assign||function(target){for(var i=1;i (this._root = c)} {...this.props}>\n {this.props.children}\n \n );\n }\n}\n\nFooterTab.propTypes = {\n ...ViewPropTypes,\n style: PropTypes.oneOfType([\n PropTypes.object,\n PropTypes.number,\n PropTypes.array\n ])\n};\n\nconst StyledFooterTab = connectStyle(\n 'NativeBase.FooterTab',\n {},\n mapPropsToStyleNames\n)(FooterTab);\n\nexport { StyledFooterTab as FooterTab };\n"]} \ No newline at end of file +{"version":3,"sources":["../../../src/basic/FooterTab.js"],"names":["FooterTab","_root","c","props","children","Component","propTypes","ViewPropTypes","style","PropTypes","oneOfType","object","number","array","StyledFooterTab","mapPropsToStyleNames"],"mappings":"61BAAA,4B,2CACA,qC,mDACA,yCACA,kFACA,iEAEA,mE,68BAEMA,U,+RACK,iBACP,MACE,+BAAC,iBAAD,WAAM,IAAK,sBAAM,QAAKC,KAAL,CAAaC,CAAnB,EAAX,EAAsC,KAAKC,KAA3C,mDACG,KAAKA,KAAL,CAAWC,QADd,CADF,CAKD,C,uBAPqBC,gB,EAUxBL,UAAUM,SAAV,aACKC,6CADL,EAEEC,MAAOC,oBAAUC,SAAV,CAAoB,CACzBD,oBAAUE,MADe,CAEzBF,oBAAUG,MAFe,CAGzBH,oBAAUI,KAHe,CAApB,CAFT,GASA,GAAMC,iBAAkB,yCACtB,sBADsB,CAEtB,EAFsB,CAGtBC,8BAHsB,EAItBf,SAJsB,CAAxB,C,QAM4BA,S,CAAnBc,e","file":"FooterTab.js","sourcesContent":["import React, { Component } from 'react';\nimport PropTypes from 'prop-types';\nimport { View } from 'react-native';\nimport { ViewPropTypes } from 'deprecated-react-native-prop-types';\nimport { connectStyle } from 'native-base-shoutem-theme';\n\nimport mapPropsToStyleNames from '../utils/mapPropsToStyleNames';\n\nclass FooterTab extends Component {\n render() {\n return (\n (this._root = c)} {...this.props}>\n {this.props.children}\n \n );\n }\n}\n\nFooterTab.propTypes = {\n ...ViewPropTypes,\n style: PropTypes.oneOfType([\n PropTypes.object,\n PropTypes.number,\n PropTypes.array\n ])\n};\n\nconst StyledFooterTab = connectStyle(\n 'NativeBase.FooterTab',\n {},\n mapPropsToStyleNames\n)(FooterTab);\n\nexport { StyledFooterTab as FooterTab };\n"]} \ No newline at end of file diff --git a/dist/src/basic/Form.js b/dist/src/basic/Form.js index 63c2fbe4a..832a74809 100644 --- a/dist/src/basic/Form.js +++ b/dist/src/basic/Form.js @@ -1,2 +1,2 @@ -Object.defineProperty(exports,"__esModule",{value:true});exports.Form=undefined;var _extends=Object.assign||function(target){for(var i=1;i (this._root = c)} {...this.props} />;\n }\n}\n\nForm.propTypes = {\n ...ViewPropTypes,\n style: PropTypes.oneOfType([\n PropTypes.object,\n PropTypes.number,\n PropTypes.array\n ])\n};\n\nconst StyledForm = connectStyle('NativeBase.Form', {}, mapPropsToStyleNames)(\n Form\n);\n\nexport { StyledForm as Form };\n"]} \ No newline at end of file +{"version":3,"sources":["../../../src/basic/Form.js"],"names":["Form","_root","c","props","Component","propTypes","ViewPropTypes","style","PropTypes","oneOfType","object","number","array","StyledForm","mapPropsToStyleNames"],"mappings":"m1BAAA,4B,2CACA,qC,mDACA,yCACA,kFACA,iEAEA,mE,68BAEMA,K,iQACK,iBACP,MAAO,+BAAC,iBAAD,WAAM,IAAK,sBAAM,QAAKC,KAAL,CAAaC,CAAnB,EAAX,EAAsC,KAAKC,KAA3C,mDAAP,CACD,C,kBAHgBC,gB,EAMnBJ,KAAKK,SAAL,aACKC,6CADL,EAEEC,MAAOC,oBAAUC,SAAV,CAAoB,CACzBD,oBAAUE,MADe,CAEzBF,oBAAUG,MAFe,CAGzBH,oBAAUI,KAHe,CAApB,CAFT,GASA,GAAMC,YAAa,yCACjB,iBADiB,CAEjB,EAFiB,CAGjBC,8BAHiB,EAIjBd,IAJiB,CAAnB,C,QAMuBA,I,CAAda,U","file":"Form.js","sourcesContent":["import React, { Component } from 'react';\nimport PropTypes from 'prop-types';\nimport { View } from 'react-native';\nimport { ViewPropTypes } from 'deprecated-react-native-prop-types';\nimport { connectStyle } from 'native-base-shoutem-theme';\n\nimport mapPropsToStyleNames from '../utils/mapPropsToStyleNames';\n\nclass Form extends Component {\n render() {\n return (this._root = c)} {...this.props} />;\n }\n}\n\nForm.propTypes = {\n ...ViewPropTypes,\n style: PropTypes.oneOfType([\n PropTypes.object,\n PropTypes.number,\n PropTypes.array\n ])\n};\n\nconst StyledForm = connectStyle(\n 'NativeBase.Form',\n {},\n mapPropsToStyleNames\n)(Form);\n\nexport { StyledForm as Form };\n"]} \ No newline at end of file diff --git a/dist/src/basic/Gravatar.js b/dist/src/basic/Gravatar.js index 3ebc2c5ad..c218e7922 100644 --- a/dist/src/basic/Gravatar.js +++ b/dist/src/basic/Gravatar.js @@ -1,2 +1,2 @@ -Object.defineProperty(exports,"__esModule",{value:true});exports.Gravatar=undefined;var _extends=Object.assign||function(target){for(var i=1;i (this._root = c)} {...props} source={{ uri }} />;\n }\n}\n\nGravatar.propTypes = {\n ...Image.propTypes,\n email: PropTypes.string.isRequired,\n style: PropTypes.oneOfType([\n PropTypes.object,\n PropTypes.number,\n PropTypes.array\n ]),\n size: PropTypes.number,\n circular: PropTypes.bool,\n square: PropTypes.bool\n};\n\nconst StyledGravatar = connectStyle(\n 'NativeBase.Gravatar',\n {},\n mapPropsToStyleNames\n)(Gravatar);\nexport { StyledGravatar as Gravatar };\n"]} \ No newline at end of file +{"version":3,"sources":["../../../src/basic/Gravatar.js"],"names":["GRAVATAR_URI","Gravatar","gravatar","borderRadius","props","size","width","height","resizeMode","contain","undefined","gravatarStyle","circular","square","defaultProps","style","_","merge","getInitialStyle","prepareRootProps","uri","email","_root","c","NativeBaseComponent","propTypes","ImagePropTypes","PropTypes","string","isRequired","oneOfType","object","number","array","bool","StyledGravatar","mapPropsToStyleNames"],"mappings":"21BAAA,4B,2CACA,qC,mDACA,yCACA,kFACA,iEACA,8B,6CACA,sC,mDAEA,mE,yEACA,mD,yDAEA,gE,y8BAEA,GAAMA,cAAe,kCAArB,C,GAEMC,S,+TACc,CAChB,MA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CAAaC,CAAnB,EAAZ,EAAuCnB,KAAvC,EAA8C,OAAQ,CAAEgB,OAAF,CAAtD,kDAAP,CACD,C,sBAtCoBI,6B,EAyCvBvB,SAASwB,SAAT,aACKC,8CADL,EAEEL,MAAOM,oBAAUC,MAAV,CAAiBC,UAF1B,CAGEd,MAAOY,oBAAUG,SAAV,CAAoB,CACzBH,oBAAUI,MADe,CAEzBJ,oBAAUK,MAFe,CAGzBL,oBAAUM,KAHe,CAApB,CAHT,CAQE5B,KAAMsB,oBAAUK,MARlB,CASEpB,SAAUe,oBAAUO,IATtB,CAUErB,OAAQc,oBAAUO,IAVpB,GAaA,GAAMC,gBAAiB,yCACrB,qBADqB,CAErB,EAFqB,CAGrBC,8BAHqB,EAIrBnC,QAJqB,CAAvB,C,QAK2BA,Q,CAAlBkC,c","file":"Gravatar.js","sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport { Image } from 'react-native';\nimport { ImagePropTypes } from 'deprecated-react-native-prop-types';\nimport { connectStyle } from 'native-base-shoutem-theme';\nimport _ from 'lodash';\nimport md5 from 'blueimp-md5';\n\nimport mapPropsToStyleNames from '../utils/mapPropsToStyleNames';\nimport computeProps from '../utils/computeProps';\n\nimport NativeBaseComponent from './Base/NativeBaseComponent';\n\nconst GRAVATAR_URI = 'https://www.gravatar.com/avatar/';\n\nclass Gravatar extends NativeBaseComponent {\n getInitialStyle() {\n return {\n gravatar: {\n borderRadius: this.props.size ? this.props.size / 2 : 15,\n width: this.props.size ? this.props.size : 30,\n height: this.props.size ? this.props.size : 30,\n resizeMode: this.props.contain ? 'contain' : undefined\n }\n };\n }\n\n prepareRootProps() {\n const gravatarStyle = {};\n if (this.props.circular) {\n gravatarStyle.width = this.props.size;\n gravatarStyle.height = this.props.size;\n gravatarStyle.borderRadius = this.props.size / 2;\n } else if (this.props.square) {\n gravatarStyle.width = this.props.size;\n gravatarStyle.height = this.props.size;\n gravatarStyle.borderRadius = 0;\n }\n\n const defaultProps = {\n style: _.merge(this.getInitialStyle().gravatar, gravatarStyle)\n };\n\n return computeProps(this.props, defaultProps);\n }\n\n render() {\n const props = this.prepareRootProps();\n\n const uri = `${GRAVATAR_URI + md5(this.props.email)}?s=${\n props.style.height\n }`;\n return (this._root = c)} {...props} source={{ uri }} />;\n }\n}\n\nGravatar.propTypes = {\n ...ImagePropTypes,\n email: PropTypes.string.isRequired,\n style: PropTypes.oneOfType([\n PropTypes.object,\n PropTypes.number,\n PropTypes.array\n ]),\n size: PropTypes.number,\n circular: PropTypes.bool,\n square: PropTypes.bool\n};\n\nconst StyledGravatar = connectStyle(\n 'NativeBase.Gravatar',\n {},\n mapPropsToStyleNames\n)(Gravatar);\nexport { StyledGravatar as Gravatar };\n"]} \ No newline at end of file diff --git a/dist/src/basic/H1.js b/dist/src/basic/H1.js index d05461284..1fde9d0cb 100644 --- a/dist/src/basic/H1.js +++ b/dist/src/basic/H1.js @@ -1,2 +1,2 @@ -Object.defineProperty(exports,"__esModule",{value:true});exports.H1=undefined;var _extends=Object.assign||function(target){for(var i=1;i (this._root = c)} {...this.props} />;\n }\n}\n\nconst childrenType = function(props, propName, component) {\n let error;\n const prop = props[propName];\n React.Children.forEach(prop, child => {\n if (typeof child !== 'string' && typeof child !== 'number') {\n error = new Error(`${component} should have only string or number`);\n }\n });\n return error;\n};\n\nH1.propTypes = {\n ...Text.propTypes,\n children: childrenType,\n style: PropTypes.oneOfType([\n PropTypes.object,\n PropTypes.number,\n PropTypes.array\n ])\n};\n\nconst StyledH1 = connectStyle('NativeBase.H1', {}, mapPropsToStyleNames)(H1);\n\nexport { StyledH1 as H1 };\n"]} \ No newline at end of file +{"version":3,"sources":["../../../src/basic/H1.js"],"names":["H1","_root","c","props","Component","childrenType","propName","component","error","prop","React","Children","forEach","child","Error","propTypes","TextPropTypes","children","style","PropTypes","oneOfType","object","number","array","StyledH1","mapPropsToStyleNames"],"mappings":"+0BAAA,4B,2CACA,qC,mDACA,yCACA,kFACA,iEAEA,mE,68BAEMA,G,qPACK,iBACP,MAAO,+BAAC,iBAAD,WAAM,IAAK,sBAAM,QAAKC,KAAL,CAAaC,CAAnB,EAAX,EAAsC,KAAKC,KAA3C,mDAAP,CACD,C,gBAHcC,gB,EAMjB,GAAMC,cAAe,QAAfA,aAAe,CAASF,KAAT,CAAgBG,QAAhB,CAA0BC,SAA1B,CAAqC,CACxD,GAAIC,aAAJ,CACA,GAAMC,MAAON,MAAMG,QAAN,CAAb,CACAI,gBAAMC,QAAN,CAAeC,OAAf,CAAuBH,IAAvB,CAA6B,eAAS,CACpC,GAAI,MAAOI,MAAP,GAAiB,QAAjB,EAA6B,MAAOA,MAAP,GAAiB,QAAlD,CAA4D,CAC1DL,MAAQ,GAAIM,MAAJ,CAAaP,SAAb,sCAAR,CACD,CACF,CAJD,EAKA,MAAOC,MAAP,CACD,CATD,CAWAR,GAAGe,SAAH,aACKC,6CADL,EAEEC,SAAUZ,YAFZ,CAGEa,MAAOC,oBAAUC,SAAV,CAAoB,CACzBD,oBAAUE,MADe,CAEzBF,oBAAUG,MAFe,CAGzBH,oBAAUI,KAHe,CAApB,CAHT,GAUA,GAAMC,UAAW,yCAAa,eAAb,CAA8B,EAA9B,CAAkCC,8BAAlC,EAAwDzB,EAAxD,CAAjB,C,QAEqBA,E,CAAZwB,Q","file":"H1.js","sourcesContent":["import React, { Component } from 'react';\nimport PropTypes from 'prop-types';\nimport { Text } from 'react-native';\nimport { TextPropTypes } from 'deprecated-react-native-prop-types';\nimport { connectStyle } from 'native-base-shoutem-theme';\n\nimport mapPropsToStyleNames from '../utils/mapPropsToStyleNames';\n\nclass H1 extends Component {\n render() {\n return (this._root = c)} {...this.props} />;\n }\n}\n\nconst childrenType = function(props, propName, component) {\n let error;\n const prop = props[propName];\n React.Children.forEach(prop, child => {\n if (typeof child !== 'string' && typeof child !== 'number') {\n error = new Error(`${component} should have only string or number`);\n }\n });\n return error;\n};\n\nH1.propTypes = {\n ...TextPropTypes,\n children: childrenType,\n style: PropTypes.oneOfType([\n PropTypes.object,\n PropTypes.number,\n PropTypes.array\n ])\n};\n\nconst StyledH1 = connectStyle('NativeBase.H1', {}, mapPropsToStyleNames)(H1);\n\nexport { StyledH1 as H1 };\n"]} \ No newline at end of file diff --git a/dist/src/basic/H2.js b/dist/src/basic/H2.js index b9da5f102..6c4c94dca 100644 --- a/dist/src/basic/H2.js +++ b/dist/src/basic/H2.js @@ -1,2 +1,2 @@ -Object.defineProperty(exports,"__esModule",{value:true});exports.H2=undefined;var _extends=Object.assign||function(target){for(var i=1;i (this._root = c)} {...this.props} />;\n }\n}\nconst childrenType = function(props, propName, component) {\n let error;\n const prop = props[propName];\n React.Children.forEach(prop, child => {\n if (typeof child !== 'string' && typeof child !== 'number') {\n error = new Error(`${component} should have only string or number`);\n }\n });\n return error;\n};\n\nH2.propTypes = {\n ...Text.propTypes,\n children: childrenType,\n style: PropTypes.oneOfType([\n PropTypes.object,\n PropTypes.number,\n PropTypes.array\n ])\n};\n\nconst StyledH2 = connectStyle('NativeBase.H2', {}, mapPropsToStyleNames)(H2);\n\nexport { StyledH2 as H2 };\n"]} \ No newline at end of file +{"version":3,"sources":["../../../src/basic/H2.js"],"names":["H2","_root","c","props","Component","childrenType","propName","component","error","prop","React","Children","forEach","child","Error","propTypes","TextPropTypes","children","style","PropTypes","oneOfType","object","number","array","StyledH2","mapPropsToStyleNames"],"mappings":"+0BAAA,4B,2CACA,qC,mDACA,yCACA,kFACA,iEAEA,mE,68BAEMA,G,qPACK,iBACP,MAAO,+BAAC,iBAAD,WAAM,IAAK,sBAAM,QAAKC,KAAL,CAAaC,CAAnB,EAAX,EAAsC,KAAKC,KAA3C,mDAAP,CACD,C,gBAHcC,gB,EAKjB,GAAMC,cAAe,QAAfA,aAAe,CAASF,KAAT,CAAgBG,QAAhB,CAA0BC,SAA1B,CAAqC,CACxD,GAAIC,aAAJ,CACA,GAAMC,MAAON,MAAMG,QAAN,CAAb,CACAI,gBAAMC,QAAN,CAAeC,OAAf,CAAuBH,IAAvB,CAA6B,eAAS,CACpC,GAAI,MAAOI,MAAP,GAAiB,QAAjB,EAA6B,MAAOA,MAAP,GAAiB,QAAlD,CAA4D,CAC1DL,MAAQ,GAAIM,MAAJ,CAAaP,SAAb,sCAAR,CACD,CACF,CAJD,EAKA,MAAOC,MAAP,CACD,CATD,CAWAR,GAAGe,SAAH,aACKC,6CADL,EAEEC,SAAUZ,YAFZ,CAGEa,MAAOC,oBAAUC,SAAV,CAAoB,CACzBD,oBAAUE,MADe,CAEzBF,oBAAUG,MAFe,CAGzBH,oBAAUI,KAHe,CAApB,CAHT,GAUA,GAAMC,UAAW,yCAAa,eAAb,CAA8B,EAA9B,CAAkCC,8BAAlC,EAAwDzB,EAAxD,CAAjB,C,QAEqBA,E,CAAZwB,Q","file":"H2.js","sourcesContent":["import React, { Component } from 'react';\nimport PropTypes from 'prop-types';\nimport { Text } from 'react-native';\nimport { TextPropTypes } from 'deprecated-react-native-prop-types';\nimport { connectStyle } from 'native-base-shoutem-theme';\n\nimport mapPropsToStyleNames from '../utils/mapPropsToStyleNames';\n\nclass H2 extends Component {\n render() {\n return (this._root = c)} {...this.props} />;\n }\n}\nconst childrenType = function(props, propName, component) {\n let error;\n const prop = props[propName];\n React.Children.forEach(prop, child => {\n if (typeof child !== 'string' && typeof child !== 'number') {\n error = new Error(`${component} should have only string or number`);\n }\n });\n return error;\n};\n\nH2.propTypes = {\n ...TextPropTypes,\n children: childrenType,\n style: PropTypes.oneOfType([\n PropTypes.object,\n PropTypes.number,\n PropTypes.array\n ])\n};\n\nconst StyledH2 = connectStyle('NativeBase.H2', {}, mapPropsToStyleNames)(H2);\n\nexport { StyledH2 as H2 };\n"]} \ No newline at end of file diff --git a/dist/src/basic/H3.js b/dist/src/basic/H3.js index 30bfe09b8..be63ea161 100644 --- a/dist/src/basic/H3.js +++ b/dist/src/basic/H3.js @@ -1,2 +1,2 @@ -Object.defineProperty(exports,"__esModule",{value:true});exports.H3=undefined;var _extends=Object.assign||function(target){for(var i=1;i (this._root = c)} {...this.props} />;\n }\n}\n\nconst childrenType = function(props, propName, component) {\n let error;\n const prop = props[propName];\n React.Children.forEach(prop, child => {\n if (typeof child !== 'string' && typeof child !== 'number') {\n error = new Error(`${component} should have only string or number`);\n }\n });\n return error;\n};\n\nH3.propTypes = {\n ...Text.propTypes,\n children: childrenType,\n style: PropTypes.oneOfType([\n PropTypes.object,\n PropTypes.number,\n PropTypes.array\n ])\n};\n\nconst StyledH3 = connectStyle('NativeBase.H3', {}, mapPropsToStyleNames)(H3);\n\nexport { StyledH3 as H3 };\n"]} \ No newline at end of file +{"version":3,"sources":["../../../src/basic/H3.js"],"names":["H3","_root","c","props","Component","childrenType","propName","component","error","prop","React","Children","forEach","child","Error","propTypes","TextPropTypes","children","style","PropTypes","oneOfType","object","number","array","StyledH3","mapPropsToStyleNames"],"mappings":"+0BAAA,4B,2CACA,qC,mDACA,yCACA,kFACA,iEAEA,mE,68BAEMA,G,qPACK,iBACP,MAAO,+BAAC,iBAAD,WAAM,IAAK,sBAAM,QAAKC,KAAL,CAAaC,CAAnB,EAAX,EAAsC,KAAKC,KAA3C,mDAAP,CACD,C,gBAHcC,gB,EAMjB,GAAMC,cAAe,QAAfA,aAAe,CAASF,KAAT,CAAgBG,QAAhB,CAA0BC,SAA1B,CAAqC,CACxD,GAAIC,aAAJ,CACA,GAAMC,MAAON,MAAMG,QAAN,CAAb,CACAI,gBAAMC,QAAN,CAAeC,OAAf,CAAuBH,IAAvB,CAA6B,eAAS,CACpC,GAAI,MAAOI,MAAP,GAAiB,QAAjB,EAA6B,MAAOA,MAAP,GAAiB,QAAlD,CAA4D,CAC1DL,MAAQ,GAAIM,MAAJ,CAAaP,SAAb,sCAAR,CACD,CACF,CAJD,EAKA,MAAOC,MAAP,CACD,CATD,CAWAR,GAAGe,SAAH,aACKC,6CADL,EAEEC,SAAUZ,YAFZ,CAGEa,MAAOC,oBAAUC,SAAV,CAAoB,CACzBD,oBAAUE,MADe,CAEzBF,oBAAUG,MAFe,CAGzBH,oBAAUI,KAHe,CAApB,CAHT,GAUA,GAAMC,UAAW,yCAAa,eAAb,CAA8B,EAA9B,CAAkCC,8BAAlC,EAAwDzB,EAAxD,CAAjB,C,QAEqBA,E,CAAZwB,Q","file":"H3.js","sourcesContent":["import React, { Component } from 'react';\nimport PropTypes from 'prop-types';\nimport { Text } from 'react-native';\nimport { TextPropTypes } from 'deprecated-react-native-prop-types';\nimport { connectStyle } from 'native-base-shoutem-theme';\n\nimport mapPropsToStyleNames from '../utils/mapPropsToStyleNames';\n\nclass H3 extends Component {\n render() {\n return (this._root = c)} {...this.props} />;\n }\n}\n\nconst childrenType = function(props, propName, component) {\n let error;\n const prop = props[propName];\n React.Children.forEach(prop, child => {\n if (typeof child !== 'string' && typeof child !== 'number') {\n error = new Error(`${component} should have only string or number`);\n }\n });\n return error;\n};\n\nH3.propTypes = {\n ...TextPropTypes,\n children: childrenType,\n style: PropTypes.oneOfType([\n PropTypes.object,\n PropTypes.number,\n PropTypes.array\n ])\n};\n\nconst StyledH3 = connectStyle('NativeBase.H3', {}, mapPropsToStyleNames)(H3);\n\nexport { StyledH3 as H3 };\n"]} \ No newline at end of file diff --git a/dist/src/basic/Header.js b/dist/src/basic/Header.js index efec5600a..a9b5ead97 100644 --- a/dist/src/basic/Header.js +++ b/dist/src/basic/Header.js @@ -1,2 +1,2 @@ -Object.defineProperty(exports,"__esModule",{value:true});exports.Header=undefined;var _extends=Object.assign||function(target){for(var i=1;i\n \n \n (this._root = c)} {...this.props} />\n \n \n );\n }\n}\n\nHeader.propTypes = {\n ...ViewPropTypes,\n style: PropTypes.oneOfType([\n PropTypes.object,\n PropTypes.number,\n PropTypes.array\n ]),\n searchBar: PropTypes.bool,\n rounded: PropTypes.bool\n};\n\nconst StyledHeader = connectStyle(\n 'NativeBase.Header',\n {},\n mapPropsToStyleNames\n)(Header);\nexport { StyledHeader as Header };\n"]} \ No newline at end of file +{"version":3,"sources":["../../../src/basic/Header.js"],"names":["Header","props","androidStatusBarColor","iosBarStyle","style","transparent","translucent","variables","context","theme","variable","platformStyle","statusBarColor","iosStatusbar","backgroundColor","_root","c","Component","contextTypes","PropTypes","object","propTypes","ViewPropTypes","oneOfType","number","array","searchBar","bool","rounded","StyledHeader","mapPropsToStyleNames"],"mappings":"u1BAEA,iEACA,qC,mDACA,4B,2CACA,yCACA,kFAEA,mE,yEACA,2C,iDACA,qD,q7BAEMA,O,6QAKK,4BAOH,KAAKC,KAPF,CAELC,qBAFK,QAELA,qBAFK,CAGLC,WAHK,QAGLA,WAHK,CAILC,KAJK,QAILA,KAJK,CAKLC,WALK,QAKLA,WALK,CAMLC,WANK,QAMLA,WANK,CASP,GAAMC,WAAY,KAAKC,OAAL,CAAaC,KAAb,CACd,KAAKD,OAAL,CAAaC,KAAb,CAAmB,4BAAnB,EAAiDF,SADnC,CAEdG,kBAFJ,CAIA,GAAMC,eAAgBJ,UAAUI,aAAhC,CAEA,MACE,+BAAC,iBAAD,kDACE,8BAAC,sBAAD,EACE,gBACET,sBACIA,qBADJ,CAEIK,UAAUK,cAJlB,CAME,SACET,YACIA,WADJ,CAEIQ,gBAAkB,UAAlB,CACA,eADA,CAEAJ,UAAUM,YAXlB,CAaE,YAAaR,YAAc,IAAd,CAAqBC,WAbpC,iDADF,CAgBE,8BAAC,yBAAD,EACE,MAAO,CACLQ,gBAAiB,uBAASV,KAAT,EAAgBU,eAD5B,CADT,iDAKE,8BAAC,iBAAD,WAAM,IAAK,sBAAM,QAAKC,KAAL,CAAaC,CAAnB,EAAX,EAAsC,KAAKf,KAA3C,mDALF,CAhBF,CADF,CA0BD,C,oBA9CkBgB,gB,EAAfjB,M,CACGkB,Y,CAAe,CACpBT,MAAOU,oBAAUC,MADG,C,CAgDxBpB,OAAOqB,SAAP,aACKC,6CADL,EAEElB,MAAOe,oBAAUI,SAAV,CAAoB,CACzBJ,oBAAUC,MADe,CAEzBD,oBAAUK,MAFe,CAGzBL,oBAAUM,KAHe,CAApB,CAFT,CAOEC,UAAWP,oBAAUQ,IAPvB,CAQEC,QAAST,oBAAUQ,IARrB,GAWA,GAAME,cAAe,yCACnB,mBADmB,CAEnB,EAFmB,CAGnBC,8BAHmB,EAInB9B,MAJmB,CAArB,C,QAKyBA,M,CAAhB6B,Y","file":"Header.js","sourcesContent":["/* eslint-disable no-nested-ternary */\n/* eslint-disable no-unneeded-ternary */\nimport { connectStyle } from 'native-base-shoutem-theme';\nimport PropTypes from 'prop-types';\nimport React, { Component } from 'react';\nimport { View, StatusBar, SafeAreaView } from 'react-native';\nimport { ViewPropTypes } from 'deprecated-react-native-prop-types';\n\nimport mapPropsToStyleNames from '../utils/mapPropsToStyleNames';\nimport getStyle from '../utils/getStyle';\nimport variable from '../theme/variables/platform';\n\nclass Header extends Component {\n static contextTypes = {\n theme: PropTypes.object\n };\n\n render() {\n const {\n androidStatusBarColor,\n iosBarStyle,\n style,\n transparent,\n translucent\n } = this.props;\n\n const variables = this.context.theme\n ? this.context.theme['@@shoutem.theme/themeStyle'].variables\n : variable;\n\n const platformStyle = variables.platformStyle;\n\n return (\n \n \n \n (this._root = c)} {...this.props} />\n \n \n );\n }\n}\n\nHeader.propTypes = {\n ...ViewPropTypes,\n style: PropTypes.oneOfType([\n PropTypes.object,\n PropTypes.number,\n PropTypes.array\n ]),\n searchBar: PropTypes.bool,\n rounded: PropTypes.bool\n};\n\nconst StyledHeader = connectStyle(\n 'NativeBase.Header',\n {},\n mapPropsToStyleNames\n)(Header);\nexport { StyledHeader as Header };\n"]} \ No newline at end of file diff --git a/dist/src/basic/Input.js b/dist/src/basic/Input.js index cbe65c228..c3108c1bb 100644 --- a/dist/src/basic/Input.js +++ b/dist/src/basic/Input.js @@ -1,2 +1,2 @@ -Object.defineProperty(exports,"__esModule",{value:true});exports.Input=undefined;var _extends=Object.assign||function(target){for(var i=1;i {\n this._textInput = c;\n this._root = c;\n }}\n editable={!this.props.disabled}\n underlineColorAndroid=\"rgba(0,0,0,0)\"\n placeholderTextColor={\n this.props.placeholderTextColor\n ? this.props.placeholderTextColor\n : variables.inputColorPlaceholder\n }\n {...this.props}\n />\n );\n }\n}\n\nInput.propTypes = {\n ...TextInput.propTypes,\n style: PropTypes.oneOfType([\n PropTypes.object,\n PropTypes.number,\n PropTypes.array\n ])\n};\n\nconst StyledInput = connectStyle('NativeBase.Input', {}, mapPropsToStyleNames)(\n Input\n);\n\nexport { StyledInput as Input };\n"]} \ No newline at end of file +{"version":3,"sources":["../../../src/basic/Input.js"],"names":["Input","variables","context","theme","variable","_textInput","c","_root","props","disabled","placeholderTextColor","inputColorPlaceholder","NativeBaseComponent","propTypes","TextInputPropTypes","style","PropTypes","oneOfType","object","number","array","StyledInput","mapPropsToStyleNames"],"mappings":"q1BAAA,4B,2CACA,qC,mDACA,yCACA,kFACA,iEAEA,mE,yEACA,qD,iDAEA,gE,48BAEMA,M,2RACK,iBACP,GAAMC,WAAY,KAAKC,OAAL,CAAaC,KAAb,CACd,KAAKD,OAAL,CAAaC,KAAb,CAAmB,4BAAnB,EAAiDF,SADnC,CAEdG,kBAFJ,CAGA,MACE,+BAAC,sBAAD,WACE,IAAK,eAAK,CACR,OAAKC,UAAL,CAAkBC,CAAlB,CACA,OAAKC,KAAL,CAAaD,CAAb,CACD,CAJH,CAKE,SAAU,CAAC,KAAKE,KAAL,CAAWC,QALxB,CAME,sBAAsB,eANxB,CAOE,qBACE,KAAKD,KAAL,CAAWE,oBAAX,CACI,KAAKF,KAAL,CAAWE,oBADf,CAEIT,UAAUU,qBAVlB,EAYM,KAAKH,KAZX,mDADF,CAgBD,C,mBArBiBI,6B,EAwBpBZ,MAAMa,SAAN,aACKC,kDADL,EAEEC,MAAOC,oBAAUC,SAAV,CAAoB,CACzBD,oBAAUE,MADe,CAEzBF,oBAAUG,MAFe,CAGzBH,oBAAUI,KAHe,CAApB,CAFT,GASA,GAAMC,aAAc,yCAClB,kBADkB,CAElB,EAFkB,CAGlBC,8BAHkB,EAIlBtB,KAJkB,CAApB,C,QAMwBA,K,CAAfqB,W","file":"Input.js","sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport { TextInput } from 'react-native';\nimport { TextInputPropTypes } from 'deprecated-react-native-prop-types';\nimport { connectStyle } from 'native-base-shoutem-theme';\n\nimport mapPropsToStyleNames from '../utils/mapPropsToStyleNames';\nimport variable from '../theme/variables/platform';\n\nimport NativeBaseComponent from './Base/NativeBaseComponent';\n\nclass Input extends NativeBaseComponent {\n render() {\n const variables = this.context.theme\n ? this.context.theme['@@shoutem.theme/themeStyle'].variables\n : variable;\n return (\n {\n this._textInput = c;\n this._root = c;\n }}\n editable={!this.props.disabled}\n underlineColorAndroid=\"rgba(0,0,0,0)\"\n placeholderTextColor={\n this.props.placeholderTextColor\n ? this.props.placeholderTextColor\n : variables.inputColorPlaceholder\n }\n {...this.props}\n />\n );\n }\n}\n\nInput.propTypes = {\n ...TextInputPropTypes,\n style: PropTypes.oneOfType([\n PropTypes.object,\n PropTypes.number,\n PropTypes.array\n ])\n};\n\nconst StyledInput = connectStyle(\n 'NativeBase.Input',\n {},\n mapPropsToStyleNames\n)(Input);\n\nexport { StyledInput as Input };\n"]} \ No newline at end of file diff --git a/dist/src/basic/InputGroup.js b/dist/src/basic/InputGroup.js index b59ccf5d3..a032d1200 100644 --- a/dist/src/basic/InputGroup.js +++ b/dist/src/basic/InputGroup.js @@ -1,2 +1,2 @@ -Object.defineProperty(exports,"__esModule",{value:true});exports.InputGroup=undefined;var _extends=Object.assign||function(target){for(var i=1;i (this._root = c)} {...this.prepareRootProps()}>\n {this.props.children}\n \n );\n }\n}\n\nInputGroup.propTypes = {\n ...ViewPropTypes,\n regular: PropTypes.bool,\n underline: PropTypes.bool,\n rounded: PropTypes.bool,\n success: PropTypes.bool,\n error: PropTypes.bool,\n disabled: PropTypes.bool\n};\n\nconst StyledInputGroup = connectStyle(\n 'NativeBase.InputGroup',\n {},\n mapPropsToStyleNames\n)(InputGroup);\n\nexport { StyledInputGroup as InputGroup };\n"]} \ No newline at end of file +{"version":3,"sources":["../../../src/basic/InputGroup.js"],"names":["InputGroup","roundedInputGroup","borderWidth","props","rounded","undefined","borderRadius","variables","inputGroupRoundedBorderRadius","defaultProps","style","getInitialStyle","_root","c","prepareRootProps","children","Component","propTypes","ViewPropTypes","regular","PropTypes","bool","underline","success","error","disabled","StyledInputGroup","mapPropsToStyleNames"],"mappings":"+1BAAA,4B,2CACA,qC,mDACA,yCACA,kFACA,iEAEA,qD,iDACA,mD,yDACA,mE,68BAEMA,W,uTACc,CAChB,MAAO,CACLC,kBAAmB,CACjBC,YAAa,KAAKC,KAAL,CAAWC,OAAX,CAAqB,CAArB,CAAyBC,SADrB,CAEjBC,aAAc,KAAKH,KAAL,CAAWC,OAAX,CACVG,mBAAUC,6BADA,CAEVH,SAJa,CADd,CAAP,CAQD,C,2DAEkB,CACjB,GAAMI,cAAe,CACnBC,MAAO,KAAKC,eAAL,GAAuBV,iBADX,CAArB,CAIA,MAAO,2BAAa,KAAKE,KAAlB,CAAyBM,YAAzB,CAAP,CACD,C,uCACQ,iBACP,MACE,+BAAC,iBAAD,WAAM,IAAK,sBAAM,QAAKG,KAAL,CAAaC,CAAnB,EAAX,EAAsC,KAAKC,gBAAL,EAAtC,mDACG,KAAKX,KAAL,CAAWY,QADd,CADF,CAKD,C,wBAzBsBC,gB,EA4BzBhB,WAAWiB,SAAX,aACKC,6CADL,EAEEC,QAASC,oBAAUC,IAFrB,CAGEC,UAAWF,oBAAUC,IAHvB,CAIEjB,QAASgB,oBAAUC,IAJrB,CAKEE,QAASH,oBAAUC,IALrB,CAMEG,MAAOJ,oBAAUC,IANnB,CAOEI,SAAUL,oBAAUC,IAPtB,GAUA,GAAMK,kBAAmB,yCACvB,uBADuB,CAEvB,EAFuB,CAGvBC,8BAHuB,EAIvB3B,UAJuB,CAAzB,C,QAM6BA,U,CAApB0B,gB","file":"InputGroup.js","sourcesContent":["import React, { Component } from 'react';\nimport PropTypes from 'prop-types';\nimport { View } from 'react-native';\nimport { ViewPropTypes } from 'deprecated-react-native-prop-types';\nimport { connectStyle } from 'native-base-shoutem-theme';\n\nimport variables from '../theme/variables/platform';\nimport computeProps from '../utils/computeProps';\nimport mapPropsToStyleNames from '../utils/mapPropsToStyleNames';\n\nclass InputGroup extends Component {\n getInitialStyle() {\n return {\n roundedInputGroup: {\n borderWidth: this.props.rounded ? 1 : undefined,\n borderRadius: this.props.rounded\n ? variables.inputGroupRoundedBorderRadius\n : undefined\n }\n };\n }\n\n prepareRootProps() {\n const defaultProps = {\n style: this.getInitialStyle().roundedInputGroup\n };\n\n return computeProps(this.props, defaultProps);\n }\n render() {\n return (\n (this._root = c)} {...this.prepareRootProps()}>\n {this.props.children}\n \n );\n }\n}\n\nInputGroup.propTypes = {\n ...ViewPropTypes,\n regular: PropTypes.bool,\n underline: PropTypes.bool,\n rounded: PropTypes.bool,\n success: PropTypes.bool,\n error: PropTypes.bool,\n disabled: PropTypes.bool\n};\n\nconst StyledInputGroup = connectStyle(\n 'NativeBase.InputGroup',\n {},\n mapPropsToStyleNames\n)(InputGroup);\n\nexport { StyledInputGroup as InputGroup };\n"]} \ No newline at end of file diff --git a/dist/src/basic/Label.js b/dist/src/basic/Label.js index 8998d4e39..75ab7fece 100644 --- a/dist/src/basic/Label.js +++ b/dist/src/basic/Label.js @@ -1,2 +1,2 @@ -Object.defineProperty(exports,"__esModule",{value:true});exports.Label=undefined;var _extends=Object.assign||function(target){for(var i=1;i (this._root = c)} {...this.props} />;\n }\n}\n\nLabel.propTypes = {\n ...Text.propTypes,\n style: PropTypes.oneOfType([\n PropTypes.object,\n PropTypes.number,\n PropTypes.array\n ]),\n floatBack: PropTypes.number,\n};\n\nconst StyledLabel = connectStyle('NativeBase.Label', {}, mapPropsToStyleNames)(\n Label\n);\n\nexport { StyledLabel as Label };\n"]} \ No newline at end of file +{"version":3,"sources":["../../../src/basic/Label.js"],"names":["Label","_root","c","props","Component","propTypes","TextPropTypes","style","PropTypes","oneOfType","object","number","array","floatBack","StyledLabel","mapPropsToStyleNames"],"mappings":"q1BAAA,4B,2CACA,qC,mDACA,yCACA,kFACA,iEAEA,mE,68BAEMA,M,uQACK,iBACP,MAAO,+BAAC,iBAAD,WAAM,IAAK,sBAAM,QAAKC,KAAL,CAAaC,CAAnB,EAAX,EAAsC,KAAKC,KAA3C,mDAAP,CACD,C,mBAHiBC,gB,EAMpBJ,MAAMK,SAAN,aACKC,6CADL,EAEEC,MAAOC,oBAAUC,SAAV,CAAoB,CACzBD,oBAAUE,MADe,CAEzBF,oBAAUG,MAFe,CAGzBH,oBAAUI,KAHe,CAApB,CAFT,CAOEC,UAAWL,oBAAUG,MAPvB,GAUA,GAAMG,aAAc,yCAClB,kBADkB,CAElB,EAFkB,CAGlBC,8BAHkB,EAIlBf,KAJkB,CAApB,C,QAMwBA,K,CAAfc,W","file":"Label.js","sourcesContent":["import React, { Component } from 'react';\nimport PropTypes from 'prop-types';\nimport { Text } from 'react-native';\nimport { TextPropTypes } from 'deprecated-react-native-prop-types';\nimport { connectStyle } from 'native-base-shoutem-theme';\n\nimport mapPropsToStyleNames from '../utils/mapPropsToStyleNames';\n\nclass Label extends Component {\n render() {\n return (this._root = c)} {...this.props} />;\n }\n}\n\nLabel.propTypes = {\n ...TextPropTypes,\n style: PropTypes.oneOfType([\n PropTypes.object,\n PropTypes.number,\n PropTypes.array\n ]),\n floatBack: PropTypes.number\n};\n\nconst StyledLabel = connectStyle(\n 'NativeBase.Label',\n {},\n mapPropsToStyleNames\n)(Label);\n\nexport { StyledLabel as Label };\n"]} \ No newline at end of file diff --git a/dist/src/basic/Left.js b/dist/src/basic/Left.js index 0c9219ab0..cfec95825 100644 --- a/dist/src/basic/Left.js +++ b/dist/src/basic/Left.js @@ -1,2 +1,2 @@ -Object.defineProperty(exports,"__esModule",{value:true});exports.Left=undefined;var _extends=Object.assign||function(target){for(var i=1;i (this._root = c)} {...this.props} />;\n }\n}\n\nLeft.propTypes = {\n ...ViewPropTypes,\n style: PropTypes.oneOfType([\n PropTypes.object,\n PropTypes.number,\n PropTypes.array\n ])\n};\n\nconst StyledLeft = connectStyle('NativeBase.Left', {}, mapPropsToStyleNames)(\n Left\n);\n\nexport { StyledLeft as Left };\n"]} \ No newline at end of file +{"version":3,"sources":["../../../src/basic/Left.js"],"names":["Left","_root","c","props","Component","propTypes","ViewPropTypes","style","PropTypes","oneOfType","object","number","array","StyledLeft","mapPropsToStyleNames"],"mappings":"m1BAAA,4B,2CACA,qC,mDACA,yCACA,kFACA,iEAEA,mE,68BAEMA,K,iQACK,iBACP,MAAO,+BAAC,iBAAD,WAAM,IAAK,sBAAM,QAAKC,KAAL,CAAaC,CAAnB,EAAX,EAAsC,KAAKC,KAA3C,mDAAP,CACD,C,kBAHgBC,gB,EAMnBJ,KAAKK,SAAL,aACKC,6CADL,EAEEC,MAAOC,oBAAUC,SAAV,CAAoB,CACzBD,oBAAUE,MADe,CAEzBF,oBAAUG,MAFe,CAGzBH,oBAAUI,KAHe,CAApB,CAFT,GASA,GAAMC,YAAa,yCACjB,iBADiB,CAEjB,EAFiB,CAGjBC,8BAHiB,EAIjBd,IAJiB,CAAnB,C,QAMuBA,I,CAAda,U","file":"Left.js","sourcesContent":["import React, { Component } from 'react';\nimport PropTypes from 'prop-types';\nimport { View } from 'react-native';\nimport { ViewPropTypes } from 'deprecated-react-native-prop-types';\nimport { connectStyle } from 'native-base-shoutem-theme';\n\nimport mapPropsToStyleNames from '../utils/mapPropsToStyleNames';\n\nclass Left extends Component {\n render() {\n return (this._root = c)} {...this.props} />;\n }\n}\n\nLeft.propTypes = {\n ...ViewPropTypes,\n style: PropTypes.oneOfType([\n PropTypes.object,\n PropTypes.number,\n PropTypes.array\n ])\n};\n\nconst StyledLeft = connectStyle(\n 'NativeBase.Left',\n {},\n mapPropsToStyleNames\n)(Left);\n\nexport { StyledLeft as Left };\n"]} \ No newline at end of file diff --git a/dist/src/basic/Picker.ios.js b/dist/src/basic/Picker.ios.js index 5874e6bfe..22b6a1969 100644 --- a/dist/src/basic/Picker.ios.js +++ b/dist/src/basic/Picker.ios.js @@ -1,2 +1,2 @@ -Object.defineProperty(exports,"__esModule",{value:true});exports.PickerNB=undefined;var _jsxFileName='src/basic/Picker.ios.js';var _extends=Object.assign||function(target){for(var i=1;i {\n return {\n picker: {\n // alignItems: 'flex-end'\n },\n pickerItem: {}\n };\n };\n\n getLabel(props) {\n const children = this.getChildren(props.children);\n const item = find(\n children,\n child => child.props.value === props.selectedValue\n );\n return get(item, 'props.label');\n }\n\n getSelectedItem() {\n return find(\n this.props.children,\n child => child.props.value === this.props.selectedValue\n );\n }\n\n getChildren = children => {\n if (children && !Array.isArray(children)) {\n return [].concat(children);\n }\n // eslint-disable-next-line prefer-spread\n const appliedChildren = [].concat.apply([], children);\n return appliedChildren;\n };\n\n prepareRootProps() {\n const defaultProps = {\n style: this.getInitialStyle().picker,\n itemStyle: this.getInitialStyle().pickerItem\n };\n\n return computeProps(this.props, defaultProps);\n }\n\n _setModalVisible(visible) {\n this.setState({ modalVisible: visible });\n }\n\n renderIcon() {\n return React.cloneElement(this.props.iosIcon, {\n style: [\n {\n fontSize: 22,\n lineHeight: 26\n },\n { ...this.props.iosIcon.props.style }\n ]\n });\n }\n\n renderButton() {\n const onPress = () => {\n if (this.props.enabled !== undefined && !this.props.enabled) return;\n this._setModalVisible(true);\n };\n const text = this.state.currentLabel\n ? this.state.currentLabel\n : this.props.placeholder;\n if (this.props.renderButton) {\n return this.props.renderButton({\n onPress,\n text,\n picker: this,\n selectedItem: this.getSelectedItem()\n });\n }\n return (\n \n {this.state.currentLabel ? (\n \n {this.state.currentLabel}\n \n ) : (\n \n {this.props.placeholder}\n \n )}\n {this.props.iosIcon === undefined ? null : this.renderIcon()}\n \n );\n }\n\n renderHeader() {\n return this.props.renderHeader ? (\n this.props.renderHeader(() => this._setModalVisible(false))\n ) : (\n
\n \n {\n this._setModalVisible(false);\n }}\n >\n \n {this.props.headerBackButtonText || 'Back'}\n \n \n \n \n \n {this.props.iosHeader || 'Select One'}\n \n \n \n
\n );\n }\n\n // eslint-disable-next-line camelcase\n UNSAFE_componentWillReceiveProps(nextProps) {\n const currentLabel = this.state.currentLabel;\n const nextLabel = this.getLabel(nextProps);\n const currentDS = this.state.dataSource;\n const nextDS = this.getChildren(nextProps.children);\n\n if (currentLabel !== nextLabel) {\n this.setState({\n currentLabel: nextLabel\n });\n }\n if (currentDS !== nextDS) {\n this.setState({\n dataSource: nextDS\n });\n }\n }\n\n render() {\n return (\n (this._root = c)}>\n {this.renderButton()}\n {\n this._setModalVisible(false);\n }}\n >\n \n {this.renderHeader()}\n \n String(index)}\n renderItem={({ item }) => (\n {\n this._setModalVisible(false);\n this.props.onValueChange(item.props.value, item.key);\n this.setState({ current: item.props.label });\n }}\n >\n \n \n {item.props.label}\n \n \n \n {item.props.value === this.props.selectedValue ? (\n \n ) : (\n \n )}\n \n \n )}\n />\n \n \n \n \n );\n }\n}\n\n// eslint-disable-next-line react/no-multi-comp\nPickerNB.Item = createReactClass({\n render() {\n return ;\n }\n});\n\nPickerNB.propTypes = {\n ...ViewPropTypes,\n renderButton: PropTypes.func\n};\n\nconst StyledPickerNB = connectStyle(\n 'NativeBase.PickerNB',\n {},\n mapPropsToStyleNames\n)(PickerNB);\n\nexport { StyledPickerNB as PickerNB };\n"]} \ No newline at end of file +{"version":3,"sources":["../../../src/basic/Picker.ios.js"],"names":["PickerNB","props","getInitialStyle","picker","pickerItem","getChildren","children","Array","isArray","concat","appliedChildren","apply","state","modalVisible","currentLabel","getLabel","dataSource","item","child","value","selectedValue","defaultProps","style","itemStyle","visible","setState","React","cloneElement","iosIcon","fontSize","lineHeight","onPress","enabled","undefined","_setModalVisible","text","placeholder","renderButton","selectedItem","getSelectedItem","textStyle","note","placeholderStyle","renderIcon","renderHeader","headerStyle","shadowOffset","shadowColor","shadowRadius","shadowOpacity","marginLeft","headerBackButtonStyle","headerBackButtonTextStyle","headerBackButtonText","headerTitleStyle","iosHeader","nextProps","nextLabel","currentDS","nextDS","_root","c","modalStyle","testID","index","String","onValueChange","key","current","label","itemTextStyle","Component","Item","render","propTypes","ViewPropTypes","PropTypes","func","StyledPickerNB","mapPropsToStyleNames"],"mappings":"61BAGA,4B,2CACA,qC,mDACA,oD,iEACA,yCACA,kFACA,mDACA,iEACA,8BAEA,mD,yDACA,mE,yEAEA,4BACA,8BACA,sCACA,kCACA,oCACA,gCACA,gCACA,8BACA,4BACA,8BACA,4B,o4BAEMA,S,qDACJ,kBAAYC,KAAZ,CAAmB,0IACXA,KADW,SASnBC,eATmB,CASD,UAAM,CACtB,MAAO,CACLC,OAAQ,EADH,CAILC,WAAY,EAJP,CAAP,CAMD,CAhBkB,OAkCnBC,WAlCmB,CAkCL,kBAAY,CACxB,GAAIC,UAAY,CAACC,MAAMC,OAAN,CAAcF,QAAd,CAAjB,CAA0C,CACxC,MAAO,GAAGG,MAAH,CAAUH,QAAV,CAAP,CACD,CAED,GAAMI,iBAAkB,GAAGD,MAAH,CAAUE,KAAV,CAAgB,EAAhB,CAAoBL,QAApB,CAAxB,CACA,MAAOI,gBAAP,CACD,CAzCkB,CAEjB,MAAKE,KAAL,CAAa,CACXC,aAAc,KADH,CAEXC,aAAc,MAAKC,QAAL,CAAcd,KAAd,CAFH,CAGXe,WAAY,MAAKX,WAAL,CAAiBJ,MAAMK,QAAvB,CAHD,CAAb,CAFiB,aAOlB,C,+DAWQL,K,CAAO,CACd,GAAMK,UAAW,KAAKD,WAAL,CAAiBJ,MAAMK,QAAvB,CAAjB,CACA,GAAMW,MAAO,iBACXX,QADW,CAEX,sBAASY,OAAMjB,KAAN,CAAYkB,KAAZ,GAAsBlB,MAAMmB,aAArC,EAFW,CAAb,CAIA,MAAO,gBAAIH,IAAJ,CAAU,aAAV,CAAP,CACD,C,yDAEiB,iBAChB,MAAO,iBACL,KAAKhB,KAAL,CAAWK,QADN,CAEL,sBAASY,OAAMjB,KAAN,CAAYkB,KAAZ,GAAsB,OAAKlB,KAAL,CAAWmB,aAA1C,EAFK,CAAP,CAID,C,2DAWkB,CACjB,GAAMC,cAAe,CAC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BAAM,CACb,OAAKW,gBAAL,CAAsB,KAAtB,EACA,OAAKjC,KAAL,CAAWiE,aAAX,CAAyBjD,KAAKhB,KAAL,CAAWkB,KAApC,CAA2CF,KAAKkD,GAAhD,EACA,OAAK1C,QAAL,CAAc,CAAE2C,QAASnD,KAAKhB,KAAL,CAAWoE,KAAtB,CAAd,EACD,CARH,kDAUE,8BAAC,UAAD,mDACE,8BAAC,UAAD,EAAM,MAAO,OAAKpE,KAAL,CAAWqE,aAAxB,kDACGrD,KAAKhB,KAAL,CAAWoE,KADd,CADF,CAVF,CAeE,8BAAC,YAAD,mDACGpD,KAAKhB,KAAL,CAAWkB,KAAX,GAAqB,OAAKlB,KAAL,CAAWmB,aAAhC,CACC,8BAAC,YAAD,EAAO,aAAP,kDADD,CAGC,8BAAC,YAAD,EAAO,SAAU,KAAjB,kDAJJ,CAfF,CADU,EAJd,kDADF,CAFF,CAVF,CAFF,CADF,CAmDD,C,sBA/NoBmD,gB,EAmOvBvE,SAASwE,IAAT,CAAgB,+BAAiB,oBAC/BC,MAD+B,kBACtB,CACP,MAAO,+BAAC,cAAD,CAAQ,IAAR,aAAiB,KAAKxE,KAAL,EAAjB,oDAAP,CACD,CAH8B,CAAjB,CAAhB,CAMAD,SAAS0E,SAAT,aACKC,6CADL,EAEEtC,aAAcuC,oBAAUC,IAF1B,GAKA,GAAMC,gBAAiB,yCACrB,qBADqB,CAErB,EAFqB,CAGrBC,8BAHqB,EAIrB/E,QAJqB,CAAvB,C,QAM2BA,Q,CAAlB8E,c","file":"Picker.ios.js","sourcesContent":["/* eslint-disable react/prefer-stateless-function */\n/* eslint-disable react/prefer-es6-class */\n/* eslint-disable react/sort-comp */\nimport React, { Component } from 'react';\nimport PropTypes from 'prop-types';\nimport createReactClass from 'create-react-class';\nimport { FlatList, Modal, View } from 'react-native';\nimport { ViewPropTypes } from 'deprecated-react-native-prop-types';\nimport { Picker } from '@react-native-picker/picker';\nimport { connectStyle } from 'native-base-shoutem-theme';\nimport { find, get } from 'lodash';\n\nimport computeProps from '../utils/computeProps';\nimport mapPropsToStyleNames from '../utils/mapPropsToStyleNames';\n\nimport { Text } from './Text';\nimport { Radio } from './Radio';\nimport { Container } from './Container';\nimport { Content } from './Content';\nimport { ListItem } from './ListItem';\nimport { Button } from './Button';\nimport { Header } from './Header';\nimport { Title } from './Title';\nimport { Left } from './Left';\nimport { Right } from './Right';\nimport { Body } from './Body';\n\nclass PickerNB extends Component {\n constructor(props) {\n super(props);\n this.state = {\n modalVisible: false,\n currentLabel: this.getLabel(props),\n dataSource: this.getChildren(props.children)\n };\n }\n\n getInitialStyle = () => {\n return {\n picker: {\n // alignItems: 'flex-end'\n },\n pickerItem: {}\n };\n };\n\n getLabel(props) {\n const children = this.getChildren(props.children);\n const item = find(\n children,\n child => child.props.value === props.selectedValue\n );\n return get(item, 'props.label');\n }\n\n getSelectedItem() {\n return find(\n this.props.children,\n child => child.props.value === this.props.selectedValue\n );\n }\n\n getChildren = children => {\n if (children && !Array.isArray(children)) {\n return [].concat(children);\n }\n // eslint-disable-next-line prefer-spread\n const appliedChildren = [].concat.apply([], children);\n return appliedChildren;\n };\n\n prepareRootProps() {\n const defaultProps = {\n style: this.getInitialStyle().picker,\n itemStyle: this.getInitialStyle().pickerItem\n };\n\n return computeProps(this.props, defaultProps);\n }\n\n _setModalVisible(visible) {\n this.setState({ modalVisible: visible });\n }\n\n renderIcon() {\n return React.cloneElement(this.props.iosIcon, {\n style: [\n {\n fontSize: 22,\n lineHeight: 26\n },\n { ...this.props.iosIcon.props.style }\n ]\n });\n }\n\n renderButton() {\n const onPress = () => {\n if (this.props.enabled !== undefined && !this.props.enabled) return;\n this._setModalVisible(true);\n };\n const text = this.state.currentLabel\n ? this.state.currentLabel\n : this.props.placeholder;\n if (this.props.renderButton) {\n return this.props.renderButton({\n onPress,\n text,\n picker: this,\n selectedItem: this.getSelectedItem()\n });\n }\n return (\n \n {this.state.currentLabel ? (\n \n {this.state.currentLabel}\n
\n ) : (\n \n {this.props.placeholder}\n
\n )}\n {this.props.iosIcon === undefined ? null : this.renderIcon()}\n \n );\n }\n\n renderHeader() {\n return this.props.renderHeader ? (\n this.props.renderHeader(() => this._setModalVisible(false))\n ) : (\n
\n \n {\n this._setModalVisible(false);\n }}\n >\n \n {this.props.headerBackButtonText || 'Back'}\n \n \n \n \n \n {this.props.iosHeader || 'Select One'}\n \n \n \n
\n );\n }\n\n // eslint-disable-next-line camelcase\n UNSAFE_componentWillReceiveProps(nextProps) {\n const currentLabel = this.state.currentLabel;\n const nextLabel = this.getLabel(nextProps);\n const currentDS = this.state.dataSource;\n const nextDS = this.getChildren(nextProps.children);\n\n if (currentLabel !== nextLabel) {\n this.setState({\n currentLabel: nextLabel\n });\n }\n if (currentDS !== nextDS) {\n this.setState({\n dataSource: nextDS\n });\n }\n }\n\n render() {\n return (\n (this._root = c)}>\n {this.renderButton()}\n {\n this._setModalVisible(false);\n }}\n >\n \n {this.renderHeader()}\n \n String(index)}\n renderItem={({ item }) => (\n {\n this._setModalVisible(false);\n this.props.onValueChange(item.props.value, item.key);\n this.setState({ current: item.props.label });\n }}\n >\n \n \n {item.props.label}\n \n \n \n {item.props.value === this.props.selectedValue ? (\n \n ) : (\n \n )}\n \n \n )}\n />\n \n \n \n \n );\n }\n}\n\n// eslint-disable-next-line react/no-multi-comp\nPickerNB.Item = createReactClass({\n render() {\n return ;\n }\n});\n\nPickerNB.propTypes = {\n ...ViewPropTypes,\n renderButton: PropTypes.func\n};\n\nconst StyledPickerNB = connectStyle(\n 'NativeBase.PickerNB',\n {},\n mapPropsToStyleNames\n)(PickerNB);\n\nexport { StyledPickerNB as PickerNB };\n"]} \ No newline at end of file diff --git a/dist/src/basic/Right.js b/dist/src/basic/Right.js index 85ed963e2..04245e16d 100644 --- a/dist/src/basic/Right.js +++ b/dist/src/basic/Right.js @@ -1,2 +1,2 @@ -Object.defineProperty(exports,"__esModule",{value:true});exports.Right=undefined;var _extends=Object.assign||function(target){for(var i=1;i (this._root = c)} {...this.props} />;\n }\n}\n\nRight.propTypes = {\n ...ViewPropTypes,\n style: PropTypes.oneOfType([\n PropTypes.object,\n PropTypes.number,\n PropTypes.array\n ])\n};\n\nconst StyledRight = connectStyle('NativeBase.Right', {}, mapPropsToStyleNames)(\n Right\n);\n\nexport { StyledRight as Right };\n"]} \ No newline at end of file +{"version":3,"sources":["../../../src/basic/Right.js"],"names":["Right","_root","c","props","Component","propTypes","ViewPropTypes","style","PropTypes","oneOfType","object","number","array","StyledRight","mapPropsToStyleNames"],"mappings":"q1BAAA,4B,2CACA,qC,mDACA,yCACA,kFACA,iEAEA,mE,68BAEMA,M,uQACK,iBACP,MAAO,+BAAC,iBAAD,WAAM,IAAK,sBAAM,QAAKC,KAAL,CAAaC,CAAnB,EAAX,EAAsC,KAAKC,KAA3C,mDAAP,CACD,C,mBAHiBC,gB,EAMpBJ,MAAMK,SAAN,aACKC,6CADL,EAEEC,MAAOC,oBAAUC,SAAV,CAAoB,CACzBD,oBAAUE,MADe,CAEzBF,oBAAUG,MAFe,CAGzBH,oBAAUI,KAHe,CAApB,CAFT,GASA,GAAMC,aAAc,yCAClB,kBADkB,CAElB,EAFkB,CAGlBC,8BAHkB,EAIlBd,KAJkB,CAApB,C,QAMwBA,K,CAAfa,W","file":"Right.js","sourcesContent":["import React, { Component } from 'react';\nimport PropTypes from 'prop-types';\nimport { View } from 'react-native';\nimport { ViewPropTypes } from 'deprecated-react-native-prop-types';\nimport { connectStyle } from 'native-base-shoutem-theme';\n\nimport mapPropsToStyleNames from '../utils/mapPropsToStyleNames';\n\nclass Right extends Component {\n render() {\n return (this._root = c)} {...this.props} />;\n }\n}\n\nRight.propTypes = {\n ...ViewPropTypes,\n style: PropTypes.oneOfType([\n PropTypes.object,\n PropTypes.number,\n PropTypes.array\n ])\n};\n\nconst StyledRight = connectStyle(\n 'NativeBase.Right',\n {},\n mapPropsToStyleNames\n)(Right);\n\nexport { StyledRight as Right };\n"]} \ No newline at end of file diff --git a/dist/src/basic/Root.js b/dist/src/basic/Root.js index e6fc6fc7c..e184ae7e3 100644 --- a/dist/src/basic/Root.js +++ b/dist/src/basic/Root.js @@ -1,2 +1,2 @@ -Object.defineProperty(exports,"__esModule",{value:true});exports.Root=undefined;var _extends=Object.assign||function(target){for(var i=1;i (this._root = c)} {...this.props} style={{ flex: 1 }}>\n {this.props.children}\n {\n if (c) Toast.toastInstance = c;\n }}\n />\n {\n if (c) ActionSheet.actionsheetInstance = c;\n }}\n />\n \n );\n }\n}\n\nRoot.propTypes = {\n ...ViewPropTypes,\n style: PropTypes.oneOfType([\n PropTypes.object,\n PropTypes.number,\n PropTypes.array\n ])\n};\n\nconst StyledRoot = connectStyle('NativeBase.Root', {}, mapPropsToStyleNames)(\n Root\n);\n\nexport { StyledRoot as Root };\n"]} \ No newline at end of file +{"version":3,"sources":["../../../src/basic/Root.js"],"names":["Root","_root","c","props","flex","children","Toast","toastInstance","ActionSheet","actionsheetInstance","Component","propTypes","ViewPropTypes","style","PropTypes","oneOfType","object","number","array","StyledRoot","mapPropsToStyleNames"],"mappings":"m1BAAA,4B,2CACA,yCACA,kFACA,qC,mDACA,iEAEA,mE,yEAEA,gDACA,0C,o4BAEMA,K,iQACK,iBACP,MACE,+BAAC,iBAAD,WAAM,IAAK,sBAAM,QAAKC,KAAL,CAAaC,CAAnB,EAAX,EAAsC,KAAKC,KAA3C,EAAkD,MAAO,CAAEC,KAAM,CAAR,CAAzD,kDACG,KAAKD,KAAL,CAAWE,QADd,CAEE,8BAAC,8BAAD,EACE,IAAK,eAAK,CACR,GAAIH,CAAJ,CAAOI,+BAAMC,aAAN,CAAsBL,CAAtB,CACR,CAHH,iDAFF,CAOE,8BAAC,iCAAD,EACE,IAAK,eAAK,CACR,GAAIA,CAAJ,CAAOM,kCAAYC,mBAAZ,CAAkCP,CAAlC,CACR,CAHH,iDAPF,CADF,CAeD,C,kBAjBgBQ,gB,EAoBnBV,KAAKW,SAAL,aACKC,6CADL,EAEEC,MAAOC,oBAAUC,SAAV,CAAoB,CACzBD,oBAAUE,MADe,CAEzBF,oBAAUG,MAFe,CAGzBH,oBAAUI,KAHe,CAApB,CAFT,GASA,GAAMC,YAAa,yCACjB,iBADiB,CAEjB,EAFiB,CAGjBC,8BAHiB,EAIjBpB,IAJiB,CAAnB,C,QAMuBA,I,CAAdmB,U","file":"Root.js","sourcesContent":["import React, { Component } from 'react';\nimport { View } from 'react-native';\nimport { ViewPropTypes } from 'deprecated-react-native-prop-types';\nimport PropTypes from 'prop-types';\nimport { connectStyle } from 'native-base-shoutem-theme';\n\nimport mapPropsToStyleNames from '../utils/mapPropsToStyleNames';\n\nimport { ToastContainer as Toast } from './ToastContainer';\nimport { ActionSheetContainer as ActionSheet } from './Actionsheet';\n\nclass Root extends Component {\n render() {\n return (\n (this._root = c)} {...this.props} style={{ flex: 1 }}>\n {this.props.children}\n {\n if (c) Toast.toastInstance = c;\n }}\n />\n {\n if (c) ActionSheet.actionsheetInstance = c;\n }}\n />\n \n );\n }\n}\n\nRoot.propTypes = {\n ...ViewPropTypes,\n style: PropTypes.oneOfType([\n PropTypes.object,\n PropTypes.number,\n PropTypes.array\n ])\n};\n\nconst StyledRoot = connectStyle(\n 'NativeBase.Root',\n {},\n mapPropsToStyleNames\n)(Root);\n\nexport { StyledRoot as Root };\n"]} \ No newline at end of file diff --git a/dist/src/basic/Segment.js b/dist/src/basic/Segment.js index ddfd033cf..0bc096851 100644 --- a/dist/src/basic/Segment.js +++ b/dist/src/basic/Segment.js @@ -1,2 +1,2 @@ -Object.defineProperty(exports,"__esModule",{value:true});exports.Segment=undefined;var _extends=Object.assign||function(target){for(var i=1;i (this._root = c)} {...this.props} />;\n }\n}\n\nSegment.propTypes = {\n ...ViewPropTypes,\n style: PropTypes.oneOfType([\n PropTypes.object,\n PropTypes.number,\n PropTypes.array\n ])\n};\n\nconst StyledSegment = connectStyle(\n 'NativeBase.Segment',\n {},\n mapPropsToStyleNames\n)(Segment);\nexport { StyledSegment as Segment };\n"]} \ No newline at end of file +{"version":3,"sources":["../../../src/basic/Segment.js"],"names":["Segment","_root","c","props","Component","propTypes","ViewPropTypes","style","PropTypes","oneOfType","object","number","array","StyledSegment","mapPropsToStyleNames"],"mappings":"y1BAAA,4B,2CACA,qC,mDACA,yCACA,kFACA,iEAEA,mE,68BAEMA,Q,mRACK,iBACP,MAAO,+BAAC,iBAAD,WAAM,IAAK,sBAAM,QAAKC,KAAL,CAAaC,CAAnB,EAAX,EAAsC,KAAKC,KAA3C,mDAAP,CACD,C,qBAHmBC,gB,EAMtBJ,QAAQK,SAAR,aACKC,6CADL,EAEEC,MAAOC,oBAAUC,SAAV,CAAoB,CACzBD,oBAAUE,MADe,CAEzBF,oBAAUG,MAFe,CAGzBH,oBAAUI,KAHe,CAApB,CAFT,GASA,GAAMC,eAAgB,yCACpB,oBADoB,CAEpB,EAFoB,CAGpBC,8BAHoB,EAIpBd,OAJoB,CAAtB,C,QAK0BA,O,CAAjBa,a","file":"Segment.js","sourcesContent":["import React, { Component } from 'react';\nimport PropTypes from 'prop-types';\nimport { View } from 'react-native';\nimport { ViewPropTypes } from 'deprecated-react-native-prop-types';\nimport { connectStyle } from 'native-base-shoutem-theme';\n\nimport mapPropsToStyleNames from '../utils/mapPropsToStyleNames';\n\nclass Segment extends Component {\n render() {\n return (this._root = c)} {...this.props} />;\n }\n}\n\nSegment.propTypes = {\n ...ViewPropTypes,\n style: PropTypes.oneOfType([\n PropTypes.object,\n PropTypes.number,\n PropTypes.array\n ])\n};\n\nconst StyledSegment = connectStyle(\n 'NativeBase.Segment',\n {},\n mapPropsToStyleNames\n)(Segment);\nexport { StyledSegment as Segment };\n"]} \ No newline at end of file diff --git a/dist/src/basic/Separator.js b/dist/src/basic/Separator.js index f04e4b2d9..7c78e8543 100644 --- a/dist/src/basic/Separator.js +++ b/dist/src/basic/Separator.js @@ -1,2 +1,2 @@ -Object.defineProperty(exports,"__esModule",{value:true});exports.Separator=undefined;var _extends=Object.assign||function(target){for(var i=1;i (this._root = c)} {...this.props} />;\n }\n}\n\nSeparator.propTypes = {\n ...ViewPropTypes,\n style: PropTypes.oneOfType([\n PropTypes.object,\n PropTypes.number,\n PropTypes.array\n ])\n};\n\nconst StyledSeparator = connectStyle(\n 'NativeBase.Separator',\n {},\n mapPropsToStyleNames\n)(Separator);\n\nexport { StyledSeparator as Separator };\n"]} \ No newline at end of file +{"version":3,"sources":["../../../src/basic/Separator.js"],"names":["Separator","_root","c","props","Component","propTypes","ViewPropTypes","style","PropTypes","oneOfType","object","number","array","StyledSeparator","mapPropsToStyleNames"],"mappings":"61BAAA,4B,2CACA,qC,mDACA,yCACA,kFACA,iEAEA,mE,68BAEMA,U,+RACK,iBACP,MAAO,+BAAC,iBAAD,WAAM,IAAK,sBAAM,QAAKC,KAAL,CAAaC,CAAnB,EAAX,EAAsC,KAAKC,KAA3C,mDAAP,CACD,C,uBAHqBC,gB,EAMxBJ,UAAUK,SAAV,aACKC,6CADL,EAEEC,MAAOC,oBAAUC,SAAV,CAAoB,CACzBD,oBAAUE,MADe,CAEzBF,oBAAUG,MAFe,CAGzBH,oBAAUI,KAHe,CAApB,CAFT,GASA,GAAMC,iBAAkB,yCACtB,sBADsB,CAEtB,EAFsB,CAGtBC,8BAHsB,EAItBd,SAJsB,CAAxB,C,QAM4BA,S,CAAnBa,e","file":"Separator.js","sourcesContent":["import React, { Component } from 'react';\nimport PropTypes from 'prop-types';\nimport { View } from 'react-native';\nimport { ViewPropTypes } from 'deprecated-react-native-prop-types';\nimport { connectStyle } from 'native-base-shoutem-theme';\n\nimport mapPropsToStyleNames from '../utils/mapPropsToStyleNames';\n\nclass Separator extends Component {\n render() {\n return (this._root = c)} {...this.props} />;\n }\n}\n\nSeparator.propTypes = {\n ...ViewPropTypes,\n style: PropTypes.oneOfType([\n PropTypes.object,\n PropTypes.number,\n PropTypes.array\n ])\n};\n\nconst StyledSeparator = connectStyle(\n 'NativeBase.Separator',\n {},\n mapPropsToStyleNames\n)(Separator);\n\nexport { StyledSeparator as Separator };\n"]} \ No newline at end of file diff --git a/dist/src/basic/Subtitle.js b/dist/src/basic/Subtitle.js index 39d052520..58aafb7ed 100644 --- a/dist/src/basic/Subtitle.js +++ b/dist/src/basic/Subtitle.js @@ -1,2 +1,2 @@ -Object.defineProperty(exports,"__esModule",{value:true});exports.Subtitle=undefined;var _extends=Object.assign||function(target){for(var i=1;i (this._root = c)} numberOfLines={1} {...this.props} />;\n }\n}\n\nSubtitle.propTypes = {\n ...Text.propTypes,\n style: PropTypes.oneOfType([\n PropTypes.object,\n PropTypes.number,\n PropTypes.array\n ])\n};\n\nconst StyledSubtitle = connectStyle(\n 'NativeBase.Subtitle',\n {},\n mapPropsToStyleNames\n)(Subtitle);\nexport { StyledSubtitle as Subtitle };\n"]} \ No newline at end of file +{"version":3,"sources":["../../../src/basic/Subtitle.js"],"names":["Subtitle","_root","c","props","Component","propTypes","TextPropTypes","style","PropTypes","oneOfType","object","number","array","StyledSubtitle","mapPropsToStyleNames"],"mappings":"21BAAA,4B,2CACA,qC,mDACA,yCACA,kFACA,iEAEA,mE,68BAEMA,S,yRACK,iBACP,MACE,+BAAC,iBAAD,WAAM,IAAK,sBAAM,QAAKC,KAAL,CAAaC,CAAnB,EAAX,CAAkC,cAAe,CAAjD,EAAwD,KAAKC,KAA7D,mDADF,CAGD,C,sBALoBC,gB,EAQvBJ,SAASK,SAAT,aACKC,6CADL,EAEEC,MAAOC,oBAAUC,SAAV,CAAoB,CACzBD,oBAAUE,MADe,CAEzBF,oBAAUG,MAFe,CAGzBH,oBAAUI,KAHe,CAApB,CAFT,GASA,GAAMC,gBAAiB,yCACrB,qBADqB,CAErB,EAFqB,CAGrBC,8BAHqB,EAIrBd,QAJqB,CAAvB,C,QAK2BA,Q,CAAlBa,c","file":"Subtitle.js","sourcesContent":["import React, { Component } from 'react';\nimport PropTypes from 'prop-types';\nimport { Text } from 'react-native';\nimport { TextPropTypes } from 'deprecated-react-native-prop-types';\nimport { connectStyle } from 'native-base-shoutem-theme';\n\nimport mapPropsToStyleNames from '../utils/mapPropsToStyleNames';\n\nclass Subtitle extends Component {\n render() {\n return (\n (this._root = c)} numberOfLines={1} {...this.props} />\n );\n }\n}\n\nSubtitle.propTypes = {\n ...TextPropTypes,\n style: PropTypes.oneOfType([\n PropTypes.object,\n PropTypes.number,\n PropTypes.array\n ])\n};\n\nconst StyledSubtitle = connectStyle(\n 'NativeBase.Subtitle',\n {},\n mapPropsToStyleNames\n)(Subtitle);\nexport { StyledSubtitle as Subtitle };\n"]} \ No newline at end of file diff --git a/dist/src/basic/Tab.js b/dist/src/basic/Tab.js index 0d74149dd..851225020 100644 --- a/dist/src/basic/Tab.js +++ b/dist/src/basic/Tab.js @@ -1,2 +1,2 @@ -Object.defineProperty(exports,"__esModule",{value:true});exports.Tab=undefined;var _extends=Object.assign||function(target){for(var i=1;i (this._root = c)} {...this.props}>\n {this.props.children}\n \n );\n }\n}\n\nTab.propTypes = {\n ...ViewPropTypes,\n style: PropTypes.oneOfType([\n PropTypes.object,\n PropTypes.number,\n PropTypes.array\n ])\n};\n\nconst StyledTab = connectStyle('NativeBase.Tab', {}, mapPropsToStyleNames)(Tab);\n\nexport { StyledTab as Tab };\n"]} \ No newline at end of file +{"version":3,"sources":["../../../src/basic/Tab.js"],"names":["Tab","_root","c","props","children","Component","propTypes","ViewPropTypes","style","PropTypes","oneOfType","object","number","array","StyledTab","mapPropsToStyleNames"],"mappings":"i1BAAA,4B,2CACA,qC,mDACA,yCACA,kFACA,iEAEA,mE,68BAEMA,I,2PACK,iBACP,MACE,+BAAC,iBAAD,WAAM,IAAK,sBAAM,QAAKC,KAAL,CAAaC,CAAnB,EAAX,EAAsC,KAAKC,KAA3C,mDACG,KAAKA,KAAL,CAAWC,QADd,CADF,CAKD,C,iBAPeC,gB,EAUlBL,IAAIM,SAAJ,aACKC,6CADL,EAEEC,MAAOC,oBAAUC,SAAV,CAAoB,CACzBD,oBAAUE,MADe,CAEzBF,oBAAUG,MAFe,CAGzBH,oBAAUI,KAHe,CAApB,CAFT,GASA,GAAMC,WAAY,yCAAa,gBAAb,CAA+B,EAA/B,CAAmCC,8BAAnC,EAAyDf,GAAzD,CAAlB,C,QAEsBA,G,CAAbc,S","file":"Tab.js","sourcesContent":["import React, { Component } from 'react';\nimport PropTypes from 'prop-types';\nimport { View } from 'react-native';\nimport { ViewPropTypes } from 'deprecated-react-native-prop-types';\nimport { connectStyle } from 'native-base-shoutem-theme';\n\nimport mapPropsToStyleNames from '../utils/mapPropsToStyleNames';\n\nclass Tab extends Component {\n render() {\n return (\n (this._root = c)} {...this.props}>\n {this.props.children}\n \n );\n }\n}\n\nTab.propTypes = {\n ...ViewPropTypes,\n style: PropTypes.oneOfType([\n PropTypes.object,\n PropTypes.number,\n PropTypes.array\n ])\n};\n\nconst StyledTab = connectStyle('NativeBase.Tab', {}, mapPropsToStyleNames)(Tab);\n\nexport { StyledTab as Tab };\n"]} \ No newline at end of file diff --git a/dist/src/basic/TabContainer.js b/dist/src/basic/TabContainer.js index 57e3187e6..463a41bb7 100644 --- a/dist/src/basic/TabContainer.js +++ b/dist/src/basic/TabContainer.js @@ -1,2 +1,2 @@ -Object.defineProperty(exports,"__esModule",{value:true});exports.TabContainer=undefined;var _extends=Object.assign||function(target){for(var i=1;i (this._root = c)} {...this.props} />;\n }\n}\n\nTabContainer.propTypes = {\n ...ViewPropTypes,\n style: PropTypes.oneOfType([\n PropTypes.object,\n PropTypes.number,\n PropTypes.array\n ])\n};\n\nconst StyledTabContainer = connectStyle(\n 'NativeBase.TabContainer',\n {},\n mapPropsToStyleNames\n)(TabContainer);\nexport { StyledTabContainer as TabContainer };\n"]} \ No newline at end of file +{"version":3,"sources":["../../../src/basic/TabContainer.js"],"names":["TabContainer","_root","c","props","Component","propTypes","ViewPropTypes","style","PropTypes","oneOfType","object","number","array","StyledTabContainer","mapPropsToStyleNames"],"mappings":"m2BAAA,4B,2CACA,qC,mDACA,yCACA,kFACA,iEAEA,mE,68BAEMA,a,iTACK,iBACP,MAAO,+BAAC,iBAAD,WAAM,IAAK,sBAAM,QAAKC,KAAL,CAAaC,CAAnB,EAAX,EAAsC,KAAKC,KAA3C,mDAAP,CACD,C,0BAHwBC,gB,EAM3BJ,aAAaK,SAAb,aACKC,6CADL,EAEEC,MAAOC,oBAAUC,SAAV,CAAoB,CACzBD,oBAAUE,MADe,CAEzBF,oBAAUG,MAFe,CAGzBH,oBAAUI,KAHe,CAApB,CAFT,GASA,GAAMC,oBAAqB,yCACzB,yBADyB,CAEzB,EAFyB,CAGzBC,8BAHyB,EAIzBd,YAJyB,CAA3B,C,QAK+BA,Y,CAAtBa,kB","file":"TabContainer.js","sourcesContent":["import React, { Component } from 'react';\nimport PropTypes from 'prop-types';\nimport { View } from 'react-native';\nimport { ViewPropTypes } from 'deprecated-react-native-prop-types';\nimport { connectStyle } from 'native-base-shoutem-theme';\n\nimport mapPropsToStyleNames from '../utils/mapPropsToStyleNames';\n\nclass TabContainer extends Component {\n render() {\n return (this._root = c)} {...this.props} />;\n }\n}\n\nTabContainer.propTypes = {\n ...ViewPropTypes,\n style: PropTypes.oneOfType([\n PropTypes.object,\n PropTypes.number,\n PropTypes.array\n ])\n};\n\nconst StyledTabContainer = connectStyle(\n 'NativeBase.TabContainer',\n {},\n mapPropsToStyleNames\n)(TabContainer);\nexport { StyledTabContainer as TabContainer };\n"]} \ No newline at end of file diff --git a/dist/src/basic/TabHeading.js b/dist/src/basic/TabHeading.js index f8da6dd6a..200c061c0 100644 --- a/dist/src/basic/TabHeading.js +++ b/dist/src/basic/TabHeading.js @@ -1,2 +1,2 @@ -Object.defineProperty(exports,"__esModule",{value:true});exports.TabHeading=undefined;var _extends=Object.assign||function(target){for(var i=1;i (this._root = c)} {...this.props} />;\n }\n}\n\nTabHeadingNB.propTypes = {\n ...ViewPropTypes,\n style: PropTypes.oneOfType([\n PropTypes.object,\n PropTypes.number,\n PropTypes.array\n ])\n};\n\nconst StyledTabHeadingNB = connectStyle(\n 'NativeBase.TabHeading',\n {},\n mapPropsToStyleNames\n)(TabHeadingNB);\nexport { StyledTabHeadingNB as TabHeading };\n"]} \ No newline at end of file +{"version":3,"sources":["../../../src/basic/TabHeading.js"],"names":["TabHeadingNB","_root","c","props","Component","propTypes","ViewPropTypes","style","PropTypes","oneOfType","object","number","array","StyledTabHeadingNB","mapPropsToStyleNames","TabHeading"],"mappings":"+1BAAA,4B,2CACA,qC,mDACA,yCACA,kFACA,iEAEA,mE,68BAEMA,a,iTACK,iBACP,MAAO,+BAAC,iBAAD,WAAM,IAAK,sBAAM,QAAKC,KAAL,CAAaC,CAAnB,EAAX,EAAsC,KAAKC,KAA3C,mDAAP,CACD,C,0BAHwBC,gB,EAM3BJ,aAAaK,SAAb,aACKC,6CADL,EAEEC,MAAOC,oBAAUC,SAAV,CAAoB,CACzBD,oBAAUE,MADe,CAEzBF,oBAAUG,MAFe,CAGzBH,oBAAUI,KAHe,CAApB,CAFT,GASA,GAAMC,oBAAqB,yCACzB,uBADyB,CAEzB,EAFyB,CAGzBC,8BAHyB,EAIzBd,YAJyB,CAA3B,C,QAK+Be,U,CAAtBF,kB","file":"TabHeading.js","sourcesContent":["import React, { Component } from 'react';\nimport PropTypes from 'prop-types';\nimport { View } from 'react-native';\nimport { ViewPropTypes } from 'deprecated-react-native-prop-types';\nimport { connectStyle } from 'native-base-shoutem-theme';\n\nimport mapPropsToStyleNames from '../utils/mapPropsToStyleNames';\n\nclass TabHeadingNB extends Component {\n render() {\n return (this._root = c)} {...this.props} />;\n }\n}\n\nTabHeadingNB.propTypes = {\n ...ViewPropTypes,\n style: PropTypes.oneOfType([\n PropTypes.object,\n PropTypes.number,\n PropTypes.array\n ])\n};\n\nconst StyledTabHeadingNB = connectStyle(\n 'NativeBase.TabHeading',\n {},\n mapPropsToStyleNames\n)(TabHeadingNB);\nexport { StyledTabHeadingNB as TabHeading };\n"]} \ No newline at end of file diff --git a/dist/src/basic/Text.js b/dist/src/basic/Text.js index a3c870bb9..4423150c5 100644 --- a/dist/src/basic/Text.js +++ b/dist/src/basic/Text.js @@ -1,2 +1,2 @@ -Object.defineProperty(exports,"__esModule",{value:true});exports.Text=undefined;var _extends=Object.assign||function(target){for(var i=1;i {\n if (_.isString(child)) {\n return _.toUpper(child);\n }\n return child;\n });\n } else {\n text = children;\n }\n\n return (\n \n {text}\n \n );\n }\n}\n\nText.propTypes = {\n ...RNText.propTypes,\n uppercase: PropTypes.bool,\n style: PropTypes.oneOfType([\n PropTypes.object,\n PropTypes.number,\n PropTypes.array\n ])\n};\n\nText.defaultProps = {\n uppercase: false\n};\n\nconst StyledText = connectStyle(\n 'NativeBase.Text',\n {},\n mapPropsToStyleNames\n)(Text);\n\nexport { StyledText as Text };\n"]} \ No newline at end of file +{"version":3,"sources":["../../../src/basic/Text.js"],"names":["Text","c","_root","props","uppercase","children","text","React","Children","map","_","isString","child","toUpper","setRoot","PureComponent","propTypes","TextPropTypes","PropTypes","bool","style","oneOfType","object","number","array","defaultProps","StyledText","mapPropsToStyleNames"],"mappings":"m1BAAA,4B,2CACA,qC,mDACA,yCACA,kFACA,8B,6CACA,iEAEA,mE,68BAEMA,K,sRACIC,C,CAAG,CACT,KAAKC,KAAL,CAAaD,CAAb,CACD,C,uCAEQ,YACyB,KAAKE,KAD9B,CACCC,SADD,QACCA,SADD,CACYC,QADZ,QACYA,QADZ,CAGP,GAAIC,YAAJ,CACA,GAAIF,SAAJ,CAAe,CACbE,KAAOC,gBAAMC,QAAN,CAAeC,GAAf,CAAmBJ,QAAnB,CAA6B,eAAS,CAC3C,GAAIK,iBAAEC,QAAF,CAAWC,KAAX,CAAJ,CAAuB,CACrB,MAAOF,kBAAEG,OAAF,CAAUD,KAAV,CAAP,CACD,CACD,MAAOA,MAAP,CACD,CALM,CAAP,CAMD,CAPD,IAOO,CACLN,KAAOD,QAAP,CACD,CAED,MACE,+BAAC,iBAAD,WAAQ,IAAK,KAAKS,OAAlB,EAA+B,KAAKX,KAApC,mDACGG,IADH,CADF,CAKD,C,kBAzBgBC,gBAAMQ,a,EA4BzBf,KAAKgB,SAAL,aACKC,6CADL,EAEEb,UAAWc,oBAAUC,IAFvB,CAGEC,MAAOF,oBAAUG,SAAV,CAAoB,CACzBH,oBAAUI,MADe,CAEzBJ,oBAAUK,MAFe,CAGzBL,oBAAUM,KAHe,CAApB,CAHT,GAUAxB,KAAKyB,YAAL,CAAoB,CAClBrB,UAAW,KADO,CAApB,CAIA,GAAMsB,YAAa,yCACjB,iBADiB,CAEjB,EAFiB,CAGjBC,8BAHiB,EAIjB3B,IAJiB,CAAnB,C,QAMuBA,I,CAAd0B,U","file":"Text.js","sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport { Text as RNText } from 'react-native';\nimport { TextPropTypes } from 'deprecated-react-native-prop-types';\nimport _ from 'lodash';\nimport { connectStyle } from 'native-base-shoutem-theme';\n\nimport mapPropsToStyleNames from '../utils/mapPropsToStyleNames';\n\nclass Text extends React.PureComponent {\n setRoot(c) {\n this._root = c;\n }\n\n render() {\n const { uppercase, children } = this.props;\n\n let text;\n if (uppercase) {\n text = React.Children.map(children, child => {\n if (_.isString(child)) {\n return _.toUpper(child);\n }\n return child;\n });\n } else {\n text = children;\n }\n\n return (\n \n {text}\n \n );\n }\n}\n\nText.propTypes = {\n ...TextPropTypes,\n uppercase: PropTypes.bool,\n style: PropTypes.oneOfType([\n PropTypes.object,\n PropTypes.number,\n PropTypes.array\n ])\n};\n\nText.defaultProps = {\n uppercase: false\n};\n\nconst StyledText = connectStyle(\n 'NativeBase.Text',\n {},\n mapPropsToStyleNames\n)(Text);\n\nexport { StyledText as Text };\n"]} \ No newline at end of file diff --git a/dist/src/basic/Textarea.js b/dist/src/basic/Textarea.js index 2ba6ebf2e..b8030baae 100644 --- a/dist/src/basic/Textarea.js +++ b/dist/src/basic/Textarea.js @@ -1,2 +1,2 @@ -Object.defineProperty(exports,"__esModule",{value:true});exports.Textarea=undefined;var _extends=Object.assign||function(target){for(var i=1;i {\n this._textInput = c;\n this._root = c;\n }}\n {...this.prepareRootProps()}\n multiline\n placeholderTextColor={\n this.props.placeholderTextColor\n ? this.props.placeholderTextColor\n : variables.inputColorPlaceholder\n }\n underlineColorAndroid=\"rgba(0,0,0,0)\"\n editable={!this.props.disabled}\n />\n );\n }\n}\n\nTextarea.propTypes = {\n ...TextInput.propTypes,\n style: PropTypes.oneOfType([\n PropTypes.object,\n PropTypes.number,\n PropTypes.array\n ]),\n rowSpan: PropTypes.number,\n bordered: PropTypes.bool,\n underline: PropTypes.bool\n};\n\nconst StyledTextarea = connectStyle(\n 'NativeBase.Textarea',\n {},\n mapPropsToStyleNames\n)(Textarea);\n\nexport { StyledTextarea as Textarea };\n"]} \ No newline at end of file +{"version":3,"sources":["../../../src/basic/Textarea.js"],"names":["Textarea","textarea","height","props","rowSpan","defaultProps","style","getStyle","_textInput","c","_root","prepareRootProps","placeholderTextColor","variables","inputColorPlaceholder","disabled","Component","propTypes","TextInputPropTypes","PropTypes","oneOfType","object","number","array","bordered","bool","underline","StyledTextarea","mapPropsToStyleNames"],"mappings":"21BAAA,4B,2CACA,qC,mDACA,yCACA,kFACA,iEAEA,qD,iDACA,mD,yDACA,mE,68BAEMA,S,6RACO,CACT,MAAO,CACLC,SAAU,CACRC,OAAQ,KAAKC,KAAL,CAAWC,OAAX,CAAqB,KAAKD,KAAL,CAAWC,OAAX,CAAqB,EAA1C,CAA+C,EAD/C,CADL,CAAP,CAKD,C,2DAEkB,CACjB,GAAMC,cAAe,CACnBC,MAAO,KAAKC,QAAL,GAAgBN,QADJ,CAArB,CAGA,MAAO,2BAAa,KAAKE,KAAlB,CAAyBE,YAAzB,CAAP,CACD,C,uCACQ,iBACP,MACE,+BAAC,sBAAD,WACE,IAAK,eAAK,CACR,OAAKG,UAAL,CAAkBC,CAAlB,CACA,OAAKC,KAAL,CAAaD,CAAb,CACD,CAJH,EAKM,KAAKE,gBAAL,EALN,EAME,cANF,CAOE,qBACE,KAAKR,KAAL,CAAWS,oBAAX,CACI,KAAKT,KAAL,CAAWS,oBADf,CAEIC,mBAAUC,qBAVlB,CAYE,sBAAsB,eAZxB,CAaE,SAAU,CAAC,KAAKX,KAAL,CAAWY,QAbxB,kDADF,CAiBD,C,sBAjCoBC,gB,EAoCvBhB,SAASiB,SAAT,aACKC,kDADL,EAEEZ,MAAOa,oBAAUC,SAAV,CAAoB,CACzBD,oBAAUE,MADe,CAEzBF,oBAAUG,MAFe,CAGzBH,oBAAUI,KAHe,CAApB,CAFT,CAOEnB,QAASe,oBAAUG,MAPrB,CAQEE,SAAUL,oBAAUM,IARtB,CASEC,UAAWP,oBAAUM,IATvB,GAYA,GAAME,gBAAiB,yCACrB,qBADqB,CAErB,EAFqB,CAGrBC,8BAHqB,EAIrB5B,QAJqB,CAAvB,C,QAM2BA,Q,CAAlB2B,c","file":"Textarea.js","sourcesContent":["import React, { Component } from 'react';\nimport PropTypes from 'prop-types';\nimport { TextInput } from 'react-native';\nimport { TextInputPropTypes } from 'deprecated-react-native-prop-types';\nimport { connectStyle } from 'native-base-shoutem-theme';\n\nimport variables from '../theme/variables/platform';\nimport computeProps from '../utils/computeProps';\nimport mapPropsToStyleNames from '../utils/mapPropsToStyleNames';\n\nclass Textarea extends Component {\n getStyle() {\n return {\n textarea: {\n height: this.props.rowSpan ? this.props.rowSpan * 25 : 60\n }\n };\n }\n\n prepareRootProps() {\n const defaultProps = {\n style: this.getStyle().textarea\n };\n return computeProps(this.props, defaultProps);\n }\n render() {\n return (\n {\n this._textInput = c;\n this._root = c;\n }}\n {...this.prepareRootProps()}\n multiline\n placeholderTextColor={\n this.props.placeholderTextColor\n ? this.props.placeholderTextColor\n : variables.inputColorPlaceholder\n }\n underlineColorAndroid=\"rgba(0,0,0,0)\"\n editable={!this.props.disabled}\n />\n );\n }\n}\n\nTextarea.propTypes = {\n ...TextInputPropTypes,\n style: PropTypes.oneOfType([\n PropTypes.object,\n PropTypes.number,\n PropTypes.array\n ]),\n rowSpan: PropTypes.number,\n bordered: PropTypes.bool,\n underline: PropTypes.bool\n};\n\nconst StyledTextarea = connectStyle(\n 'NativeBase.Textarea',\n {},\n mapPropsToStyleNames\n)(Textarea);\n\nexport { StyledTextarea as Textarea };\n"]} \ No newline at end of file diff --git a/dist/src/basic/Thumbnail.js b/dist/src/basic/Thumbnail.js index 5217d78c3..2b367c09c 100644 --- a/dist/src/basic/Thumbnail.js +++ b/dist/src/basic/Thumbnail.js @@ -1,2 +1,2 @@ -Object.defineProperty(exports,"__esModule",{value:true});exports.Thumbnail=undefined;var _extends=Object.assign||function(target){for(var i=1;i (this._root = c)} {...this.props} />;\n }\n}\n\nThumbnail.propTypes = {\n ...Image.propTypes,\n style: PropTypes.oneOfType([\n PropTypes.object,\n PropTypes.number,\n PropTypes.array\n ]),\n square: PropTypes.bool,\n circular: PropTypes.bool,\n size: PropTypes.number\n};\n\nconst StyledThumbnail = connectStyle(\n 'NativeBase.Thumbnail',\n {},\n mapPropsToStyleNames\n)(Thumbnail);\n\nexport { StyledThumbnail as Thumbnail };\n"]} \ No newline at end of file +{"version":3,"sources":["../../../src/basic/Thumbnail.js"],"names":["Thumbnail","_root","c","props","Component","propTypes","ImagePropTypes","style","PropTypes","oneOfType","object","number","array","square","bool","circular","size","StyledThumbnail","mapPropsToStyleNames"],"mappings":"61BAAA,4B,2CACA,qC,mDACA,yCACA,kFACA,iEAEA,mE,68BAEMA,U,+RACK,iBACP,MAAO,+BAAC,kBAAD,WAAO,IAAK,sBAAM,QAAKC,KAAL,CAAaC,CAAnB,EAAZ,EAAuC,KAAKC,KAA5C,mDAAP,CACD,C,uBAHqBC,gB,EAMxBJ,UAAUK,SAAV,aACKC,8CADL,EAEEC,MAAOC,oBAAUC,SAAV,CAAoB,CACzBD,oBAAUE,MADe,CAEzBF,oBAAUG,MAFe,CAGzBH,oBAAUI,KAHe,CAApB,CAFT,CAOEC,OAAQL,oBAAUM,IAPpB,CAQEC,SAAUP,oBAAUM,IARtB,CASEE,KAAMR,oBAAUG,MATlB,GAYA,GAAMM,iBAAkB,yCACtB,sBADsB,CAEtB,EAFsB,CAGtBC,8BAHsB,EAItBlB,SAJsB,CAAxB,C,QAM4BA,S,CAAnBiB,e","file":"Thumbnail.js","sourcesContent":["import React, { Component } from 'react';\nimport PropTypes from 'prop-types';\nimport { Image } from 'react-native';\nimport { ImagePropTypes } from 'deprecated-react-native-prop-types';\nimport { connectStyle } from 'native-base-shoutem-theme';\n\nimport mapPropsToStyleNames from '../utils/mapPropsToStyleNames';\n\nclass Thumbnail extends Component {\n render() {\n return (this._root = c)} {...this.props} />;\n }\n}\n\nThumbnail.propTypes = {\n ...ImagePropTypes,\n style: PropTypes.oneOfType([\n PropTypes.object,\n PropTypes.number,\n PropTypes.array\n ]),\n square: PropTypes.bool,\n circular: PropTypes.bool,\n size: PropTypes.number\n};\n\nconst StyledThumbnail = connectStyle(\n 'NativeBase.Thumbnail',\n {},\n mapPropsToStyleNames\n)(Thumbnail);\n\nexport { StyledThumbnail as Thumbnail };\n"]} \ No newline at end of file diff --git a/dist/src/basic/Title.js b/dist/src/basic/Title.js index c1d2a0587..aff26a758 100644 --- a/dist/src/basic/Title.js +++ b/dist/src/basic/Title.js @@ -1,2 +1,2 @@ -Object.defineProperty(exports,"__esModule",{value:true});exports.Title=undefined;var _extends=Object.assign||function(target){for(var i=1;i (this._root = c)} numberOfLines={1} {...this.props} />\n );\n }\n}\n\nTitle.propTypes = {\n ...Text.propTypes,\n style: PropTypes.oneOfType([\n PropTypes.object,\n PropTypes.number,\n PropTypes.array\n ])\n};\n\nconst StyledTitle = connectStyle('NativeBase.Title', {}, mapPropsToStyleNames)(\n Title\n);\nexport { StyledTitle as Title };\n"]} \ No newline at end of file +{"version":3,"sources":["../../../src/basic/Title.js"],"names":["Title","_root","c","props","Component","propTypes","TextPropTypes","style","PropTypes","oneOfType","object","number","array","StyledTitle","mapPropsToStyleNames"],"mappings":"q1BAAA,4B,2CACA,qC,mDACA,yCACA,kFACA,iEAEA,mE,68BAEMA,M,uQACK,iBACP,MACE,+BAAC,iBAAD,WAAM,IAAK,sBAAM,QAAKC,KAAL,CAAaC,CAAnB,EAAX,CAAkC,cAAe,CAAjD,EAAwD,KAAKC,KAA7D,mDADF,CAGD,C,mBALiBC,gB,EAQpBJ,MAAMK,SAAN,aACKC,6CADL,EAEEC,MAAOC,oBAAUC,SAAV,CAAoB,CACzBD,oBAAUE,MADe,CAEzBF,oBAAUG,MAFe,CAGzBH,oBAAUI,KAHe,CAApB,CAFT,GASA,GAAMC,aAAc,yCAClB,kBADkB,CAElB,EAFkB,CAGlBC,8BAHkB,EAIlBd,KAJkB,CAApB,C,QAKwBA,K,CAAfa,W","file":"Title.js","sourcesContent":["import React, { Component } from 'react';\nimport PropTypes from 'prop-types';\nimport { Text } from 'react-native';\nimport { TextPropTypes } from 'deprecated-react-native-prop-types';\nimport { connectStyle } from 'native-base-shoutem-theme';\n\nimport mapPropsToStyleNames from '../utils/mapPropsToStyleNames';\n\nclass Title extends Component {\n render() {\n return (\n (this._root = c)} numberOfLines={1} {...this.props} />\n );\n }\n}\n\nTitle.propTypes = {\n ...TextPropTypes,\n style: PropTypes.oneOfType([\n PropTypes.object,\n PropTypes.number,\n PropTypes.array\n ])\n};\n\nconst StyledTitle = connectStyle(\n 'NativeBase.Title',\n {},\n mapPropsToStyleNames\n)(Title);\nexport { StyledTitle as Title };\n"]} \ No newline at end of file diff --git a/dist/src/basic/Toast.js b/dist/src/basic/Toast.js index 10d56fa2b..76d1d76d3 100644 --- a/dist/src/basic/Toast.js +++ b/dist/src/basic/Toast.js @@ -1,2 +1,2 @@ -Object.defineProperty(exports,"__esModule",{value:true});exports.Toast=undefined;var _extends=Object.assign||function(target){for(var i=1;i (this._root = c)} {...this.props} />;\n }\n}\n\nToast.propTypes = {\n ...ViewPropTypes,\n style: PropTypes.oneOfType([\n PropTypes.object,\n PropTypes.number,\n PropTypes.array\n ])\n};\n\nconst StyledToast = connectStyle('NativeBase.Toast', {}, mapPropsToStyleNames)(\n Toast\n);\nexport { StyledToast as Toast };\n"]} \ No newline at end of file +{"version":3,"sources":["../../../src/basic/Toast.js"],"names":["Toast","_root","c","props","Component","propTypes","ViewPropTypes","style","PropTypes","oneOfType","object","number","array","StyledToast","mapPropsToStyleNames"],"mappings":"q1BAAA,4B,2CACA,qC,mDACA,yCACA,kFACA,iEAEA,mE,68BAEMA,M,uQACK,iBACP,MAAO,+BAAC,iBAAD,WAAM,IAAK,sBAAM,QAAKC,KAAL,CAAaC,CAAnB,EAAX,EAAsC,KAAKC,KAA3C,mDAAP,CACD,C,mBAHiBC,gB,EAMpBJ,MAAMK,SAAN,aACKC,6CADL,EAEEC,MAAOC,oBAAUC,SAAV,CAAoB,CACzBD,oBAAUE,MADe,CAEzBF,oBAAUG,MAFe,CAGzBH,oBAAUI,KAHe,CAApB,CAFT,GASA,GAAMC,aAAc,yCAClB,kBADkB,CAElB,EAFkB,CAGlBC,8BAHkB,EAIlBd,KAJkB,CAApB,C,QAKwBA,K,CAAfa,W","file":"Toast.js","sourcesContent":["import React, { Component } from 'react';\nimport PropTypes from 'prop-types';\nimport { View } from 'react-native';\nimport { ViewPropTypes } from 'deprecated-react-native-prop-types';\nimport { connectStyle } from 'native-base-shoutem-theme';\n\nimport mapPropsToStyleNames from '../utils/mapPropsToStyleNames';\n\nclass Toast extends Component {\n render() {\n return (this._root = c)} {...this.props} />;\n }\n}\n\nToast.propTypes = {\n ...ViewPropTypes,\n style: PropTypes.oneOfType([\n PropTypes.object,\n PropTypes.number,\n PropTypes.array\n ])\n};\n\nconst StyledToast = connectStyle(\n 'NativeBase.Toast',\n {},\n mapPropsToStyleNames\n)(Toast);\nexport { StyledToast as Toast };\n"]} \ No newline at end of file diff --git a/dist/src/basic/ToastContainer.js b/dist/src/basic/ToastContainer.js index 832b3e8e0..0b28e2ca2 100644 --- a/dist/src/basic/ToastContainer.js +++ b/dist/src/basic/ToastContainer.js @@ -1,2 +1,2 @@ -Object.defineProperty(exports,"__esModule",{value:true});exports.ToastContainer=undefined;var _extends=Object.assign||function(target){for(var i=1;i=0)continue;if(!Object.prototype.hasOwnProperty.call(obj,i))continue;target[i]=obj[i];}return target;}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function");}}function _possibleConstructorReturn(self,call){if(!self){throw new ReferenceError("this hasn't been initialised - super() hasn't been called");}return call&&(typeof call==="object"||typeof call==="function")?call:self;}function _inherits(subClass,superClass){if(typeof superClass!=="function"&&superClass!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);}subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:false,writable:true,configurable:true}});if(superClass)Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass;}var POSITION={ABSOLUTE:'absolute',BOTTOM:'bottom',TOP:'top'};var ToastContainer=function(_Component){_inherits(ToastContainer,_Component);_createClass(ToastContainer,null,[{key:'show',value:function show(_ref){var config=_objectWithoutProperties(_ref,[]);this.toastInstance._root.showToast({config:config});}},{key:'hide',value:function hide(){if(this.toastInstance._root.getModalState()){this.toastInstance._root.closeToast('functionCall');}}}]);function ToastContainer(props){_classCallCheck(this,ToastContainer);var _this=_possibleConstructorReturn(this,(ToastContainer.__proto__||Object.getPrototypeOf(ToastContainer)).call(this,props));_this.closeModal=function(reason){_this.setState({modalVisible:false});var onClose=_this.state.onClose;if(onClose&&typeof onClose==='function'){onClose(reason);}};_this.state={fadeAnim:new _reactNative.Animated.Value(0),pan:new _reactNative.Animated.ValueXY({x:0,y:0}),keyboardHeight:0,isKeyboardVisible:false,modalVisible:false};_this.keyboardDidHide=_this.keyboardDidHide.bind(_this);_this.keyboardDidShow=_this.keyboardDidShow.bind(_this);_this._panResponder=_reactNative.PanResponder.create({onMoveShouldSetPanResponderCapture:function onMoveShouldSetPanResponderCapture(){return true;},onPanResponderRelease:function onPanResponderRelease(evt,_ref2){var dx=_ref2.dx;if(dx!==0){_reactNative.Animated.timing(_this.state.pan,{toValue:{x:dx,y:0},duration:100,useNativeDriver:false}).start(function(){return _this.closeToast('swipe');});}}});return _this;}_createClass(ToastContainer,[{key:'componentDidMount',value:function componentDidMount(){_reactNative.Keyboard.addListener('keyboardDidShow',this.keyboardDidShow);_reactNative.Keyboard.addListener('keyboardDidHide',this.keyboardDidHide);}},{key:'componentWillUnmount',value:function componentWillUnmount(){_reactNative.Keyboard.removeListener('keyboardDidShow',this.keyboardDidShow);_reactNative.Keyboard.removeListener('keyboardDidHide',this.keyboardDidHide);}},{key:'getToastStyle',value:function getToastStyle(){return{position:POSITION.ABSOLUTE,opacity:this.state.fadeAnim,width:'100%',elevation:9,paddingHorizontal:_reactNative.Platform.OS===_commonColor.PLATFORM.IOS?20:0,top:this.state.position===POSITION.TOP?30:undefined,bottom:this.state.position===POSITION.BOTTOM?this.getTop():undefined};}},{key:'getTop',value:function getTop(){if(_reactNative.Platform.OS===_commonColor.PLATFORM.IOS){if(this.state.isKeyboardVisible){return this.state.keyboardHeight;}return 30;}return 0;}},{key:'getButtonText',value:function getButtonText(buttonText){if(buttonText){if(buttonText.trim().length===0){return undefined;}return buttonText;}return undefined;}},{key:'getModalState',value:function getModalState(){return this.state.modalVisible;}},{key:'keyboardDidHide',value:function keyboardDidHide(){this.setState({keyboardHeight:0,isKeyboardVisible:false});}},{key:'keyboardDidShow',value:function keyboardDidShow(e){this.setState({keyboardHeight:e.endCoordinates.height,isKeyboardVisible:true});}},{key:'showToast',value:function showToast(_ref3){var config=_ref3.config;this.setState({modalVisible:true,text:config.text,buttonText:this.getButtonText(config.buttonText),type:config.type,position:config.position?config.position:POSITION.BOTTOM,supportedOrientations:config.supportedOrientations,style:config.style,buttonTextStyle:config.buttonTextStyle,buttonStyle:config.buttonStyle,textStyle:config.textStyle,onClose:config.onClose,swipeDisabled:config.swipeDisabled||false});if(this.closeTimeout){clearTimeout(this.closeTimeout);}if(config.duration!==0){var duration=config.duration>0?config.duration:1500;this.closeTimeout=setTimeout(this.closeToast.bind(this,'timeout'),duration);}_reactNative.Animated.timing(this.state.fadeAnim,{toValue:1,duration:200,useNativeDriver:false}).start();}},{key:'closeToast',value:function closeToast(reason){var _this2=this;clearTimeout(this.closeTimeout);_reactNative.Animated.timing(this.state.fadeAnim,{toValue:0,duration:200,useNativeDriver:false}).start(function(){_this2.closeModal(reason);_this2.state.pan.setValue({x:0,y:0});});}},{key:'render',value:function render(){var _this3=this;if(this.state.modalVisible){var _state$pan=this.state.pan,x=_state$pan.x,y=_state$pan.y;return _react2.default.createElement(_reactNative.Animated.View,_extends({},this.state.swipeDisabled?{}:this._panResponder.panHandlers,{style:[this.getToastStyle(),{transform:[{translateX:x},{translateY:y}]}],__source:{fileName:_jsxFileName,lineNumber:182}}),_react2.default.createElement(_Toast.Toast,{style:[this.state.style],danger:this.state.type==='danger',success:this.state.type==='success',warning:this.state.type==='warning',__source:{fileName:_jsxFileName,lineNumber:189}},_react2.default.createElement(_Text.Text,{style:this.state.textStyle,__source:{fileName:_jsxFileName,lineNumber:195}},this.state.text),this.state.buttonText&&_react2.default.createElement(_Button.Button,{style:this.state.buttonStyle,onPress:function onPress(){return _this3.closeToast('user');},__source:{fileName:_jsxFileName,lineNumber:197}},_react2.default.createElement(_Text.Text,{style:this.state.buttonTextStyle,__source:{fileName:_jsxFileName,lineNumber:201}},this.state.buttonText))));}return null;}}]);return ToastContainer;}(_react.Component);ToastContainer.propTypes=_extends({},_reactNative.ViewPropTypes);var StyledToastContainer=(0,_nativeBaseShoutemTheme.connectStyle)('NativeBase.ToastContainer',{},_mapPropsToStyleNames2.default)(ToastContainer);exports.ToastContainer=StyledToastContainer; +Object.defineProperty(exports,"__esModule",{value:true});exports.ToastContainer=undefined;var _extends=Object.assign||function(target){for(var i=1;i=0)continue;if(!Object.prototype.hasOwnProperty.call(obj,i))continue;target[i]=obj[i];}return target;}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function");}}function _possibleConstructorReturn(self,call){if(!self){throw new ReferenceError("this hasn't been initialised - super() hasn't been called");}return call&&(typeof call==="object"||typeof call==="function")?call:self;}function _inherits(subClass,superClass){if(typeof superClass!=="function"&&superClass!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);}subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:false,writable:true,configurable:true}});if(superClass)Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass;}var POSITION={ABSOLUTE:'absolute',BOTTOM:'bottom',TOP:'top'};var ToastContainer=function(_Component){_inherits(ToastContainer,_Component);_createClass(ToastContainer,null,[{key:'show',value:function show(_ref){var config=_objectWithoutProperties(_ref,[]);this.toastInstance._root.showToast({config:config});}},{key:'hide',value:function hide(){if(this.toastInstance._root.getModalState()){this.toastInstance._root.closeToast('functionCall');}}}]);function ToastContainer(props){_classCallCheck(this,ToastContainer);var _this=_possibleConstructorReturn(this,(ToastContainer.__proto__||Object.getPrototypeOf(ToastContainer)).call(this,props));_this.closeModal=function(reason){_this.setState({modalVisible:false});var onClose=_this.state.onClose;if(onClose&&typeof onClose==='function'){onClose(reason);}};_this.state={fadeAnim:new _reactNative.Animated.Value(0),pan:new _reactNative.Animated.ValueXY({x:0,y:0}),keyboardHeight:0,isKeyboardVisible:false,modalVisible:false};_this.keyboardDidHide=_this.keyboardDidHide.bind(_this);_this.keyboardDidShow=_this.keyboardDidShow.bind(_this);_this._panResponder=_reactNative.PanResponder.create({onMoveShouldSetPanResponderCapture:function onMoveShouldSetPanResponderCapture(){return true;},onPanResponderRelease:function onPanResponderRelease(evt,_ref2){var dx=_ref2.dx;if(dx!==0){_reactNative.Animated.timing(_this.state.pan,{toValue:{x:dx,y:0},duration:100,useNativeDriver:false}).start(function(){return _this.closeToast('swipe');});}}});return _this;}_createClass(ToastContainer,[{key:'componentDidMount',value:function componentDidMount(){_reactNative.Keyboard.addListener('keyboardDidShow',this.keyboardDidShow);_reactNative.Keyboard.addListener('keyboardDidHide',this.keyboardDidHide);}},{key:'componentWillUnmount',value:function componentWillUnmount(){_reactNative.Keyboard.removeListener('keyboardDidShow',this.keyboardDidShow);_reactNative.Keyboard.removeListener('keyboardDidHide',this.keyboardDidHide);}},{key:'getToastStyle',value:function getToastStyle(){return{position:POSITION.ABSOLUTE,opacity:this.state.fadeAnim,width:'100%',elevation:9,paddingHorizontal:_reactNative.Platform.OS===_commonColor.PLATFORM.IOS?20:0,top:this.state.position===POSITION.TOP?30:undefined,bottom:this.state.position===POSITION.BOTTOM?this.getTop():undefined};}},{key:'getTop',value:function getTop(){if(_reactNative.Platform.OS===_commonColor.PLATFORM.IOS){if(this.state.isKeyboardVisible){return this.state.keyboardHeight;}return 30;}return 0;}},{key:'getButtonText',value:function getButtonText(buttonText){if(buttonText){if(buttonText.trim().length===0){return undefined;}return buttonText;}return undefined;}},{key:'getModalState',value:function getModalState(){return this.state.modalVisible;}},{key:'keyboardDidHide',value:function keyboardDidHide(){this.setState({keyboardHeight:0,isKeyboardVisible:false});}},{key:'keyboardDidShow',value:function keyboardDidShow(e){this.setState({keyboardHeight:e.endCoordinates.height,isKeyboardVisible:true});}},{key:'showToast',value:function showToast(_ref3){var config=_ref3.config;this.setState({modalVisible:true,text:config.text,buttonText:this.getButtonText(config.buttonText),type:config.type,position:config.position?config.position:POSITION.BOTTOM,supportedOrientations:config.supportedOrientations,style:config.style,buttonTextStyle:config.buttonTextStyle,buttonStyle:config.buttonStyle,textStyle:config.textStyle,onClose:config.onClose,swipeDisabled:config.swipeDisabled||false});if(this.closeTimeout){clearTimeout(this.closeTimeout);}if(config.duration!==0){var duration=config.duration>0?config.duration:1500;this.closeTimeout=setTimeout(this.closeToast.bind(this,'timeout'),duration);}_reactNative.Animated.timing(this.state.fadeAnim,{toValue:1,duration:200,useNativeDriver:false}).start();}},{key:'closeToast',value:function closeToast(reason){var _this2=this;clearTimeout(this.closeTimeout);_reactNative.Animated.timing(this.state.fadeAnim,{toValue:0,duration:200,useNativeDriver:false}).start(function(){_this2.closeModal(reason);_this2.state.pan.setValue({x:0,y:0});});}},{key:'render',value:function render(){var _this3=this;if(this.state.modalVisible){var _state$pan=this.state.pan,x=_state$pan.x,y=_state$pan.y;return _react2.default.createElement(_reactNative.Animated.View,_extends({},this.state.swipeDisabled?{}:this._panResponder.panHandlers,{style:[this.getToastStyle(),{transform:[{translateX:x},{translateY:y}]}],__source:{fileName:_jsxFileName,lineNumber:177}}),_react2.default.createElement(_Toast.Toast,{style:[this.state.style],danger:this.state.type==='danger',success:this.state.type==='success',warning:this.state.type==='warning',__source:{fileName:_jsxFileName,lineNumber:184}},_react2.default.createElement(_Text.Text,{style:this.state.textStyle,__source:{fileName:_jsxFileName,lineNumber:190}},this.state.text),this.state.buttonText&&_react2.default.createElement(_Button.Button,{style:this.state.buttonStyle,onPress:function onPress(){return _this3.closeToast('user');},__source:{fileName:_jsxFileName,lineNumber:192}},_react2.default.createElement(_Text.Text,{style:this.state.buttonTextStyle,__source:{fileName:_jsxFileName,lineNumber:196}},this.state.buttonText))));}return null;}}]);return ToastContainer;}(_react.Component);ToastContainer.propTypes=_extends({},_deprecatedReactNativePropTypes.ViewPropTypes);var StyledToastContainer=(0,_nativeBaseShoutemTheme.connectStyle)('NativeBase.ToastContainer',{},_mapPropsToStyleNames2.default)(ToastContainer);exports.ToastContainer=StyledToastContainer; //# sourceMappingURL=ToastContainer.js.map \ No newline at end of file diff --git a/dist/src/basic/ToastContainer.js.map b/dist/src/basic/ToastContainer.js.map index 7207b3695..b27591ebf 100644 --- a/dist/src/basic/ToastContainer.js.map +++ b/dist/src/basic/ToastContainer.js.map @@ -1 +1 @@ -{"version":3,"sources":["../../../src/basic/ToastContainer.js"],"names":["POSITION","ABSOLUTE","BOTTOM","TOP","ToastContainer","config","toastInstance","_root","showToast","getModalState","closeToast","props","closeModal","reason","setState","modalVisible","onClose","state","fadeAnim","Animated","Value","pan","ValueXY","x","y","keyboardHeight","isKeyboardVisible","keyboardDidHide","bind","keyboardDidShow","_panResponder","PanResponder","create","onMoveShouldSetPanResponderCapture","onPanResponderRelease","evt","dx","timing","toValue","duration","useNativeDriver","start","Keyboard","addListener","removeListener","position","opacity","width","elevation","paddingHorizontal","Platform","OS","PLATFORM","IOS","top","undefined","bottom","getTop","buttonText","trim","length","e","endCoordinates","height","text","getButtonText","type","supportedOrientations","style","buttonTextStyle","buttonStyle","textStyle","swipeDisabled","closeTimeout","clearTimeout","setTimeout","setValue","panHandlers","getToastStyle","transform","translateX","translateY","Component","propTypes","ViewPropTypes","StyledToastContainer","mapPropsToStyleNames"],"mappings":"u2BACA,4B,2CACA,yCAOA,iEAEA,mE,yEACA,2DAEA,4BACA,gCACA,8B,skCAEA,GAAMA,UAAW,CACfC,SAAU,UADK,CAEfC,OAAQ,QAFO,CAGfC,IAAK,KAHU,CAAjB,C,GAMMC,e,kIACuB,IAAVC,OAAU,mCACzB,KAAKC,aAAL,CAAmBC,KAAnB,CAAyBC,SAAzB,CAAmC,CAAEH,aAAF,CAAnC,EACD,C,mCACa,CACZ,GAAI,KAAKC,aAAL,CAAmBC,KAAnB,CAAyBE,aAAzB,EAAJ,CAA8C,CAC5C,KAAKH,aAAL,CAAmBC,KAAnB,CAAyBG,UAAzB,CAAoC,cAApC,EACD,CACF,C,IACD,wBAAYC,KAAZ,CAAmB,4JACXA,KADW,SA2HnBC,UA3HmB,CA2HN,SAACC,MAAD,CAAY,CACvB,MAAKC,QAAL,CAAc,CACZC,aAAc,KADF,CAAd,EADuB,GAIfC,QAJe,CAIH,MAAKC,KAJF,CAIfD,OAJe,CAKvB,GAAIA,SAAW,MAAOA,QAAP,GAAmB,UAAlC,CAA8C,CAC5CA,QAAQH,MAAR,EACD,CACF,CAnIkB,CAGjB,MAAKI,KAAL,CAAa,CACXC,SAAU,GAAIC,uBAASC,KAAb,CAAmB,CAAnB,CADC,CAEXC,IAAK,GAAIF,uBAASG,OAAb,CAAqB,CAAEC,EAAG,CAAL,CAAQC,EAAG,CAAX,CAArB,CAFM,CAGXC,eAAgB,CAHL,CAIXC,kBAAmB,KAJR,CAKXX,aAAc,KALH,CAAb,CAQA,MAAKY,eA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D,EACE,MAAO,CAAC,KAAKP,KAAL,CAAWmD,KAAZ,CADT,CAEE,OAAQ,KAAKnD,KAAL,CAAWiD,IAAX,GAAoB,QAF9B,CAGE,QAAS,KAAKjD,KAAL,CAAWiD,IAAX,GAAoB,SAH/B,CAIE,QAAS,KAAKjD,KAAL,CAAWiD,IAAX,GAAoB,SAJ/B,kDAME,8BAAC,UAAD,EAAM,MAAO,KAAKjD,KAAL,CAAWsD,SAAxB,kDAAoC,KAAKtD,KAAL,CAAW+C,IAA/C,CANF,CAOG,KAAK/C,KAAL,CAAWyC,UAAX,EACC,8BAAC,cAAD,EACE,MAAO,KAAKzC,KAAL,CAAWqD,WADpB,CAEE,QAAS,yBAAM,QAAK5D,UAAL,CAAgB,MAAhB,CAAN,EAFX,kDAIE,8BAAC,UAAD,EAAM,MAAO,KAAKO,KAAL,CAAWoD,eAAxB,kDACG,KAAKpD,KAAL,CAAWyC,UADd,CAJF,CARJ,CAPF,CADF,CA4BD,CACD,MAAO,KAAP,CACD,C,4BA1L0BwB,gB,EA6L7B9E,eAAe+E,SAAf,aACKC,0BADL,EAIA,GAAMC,sBAAuB,yCAC3B,2BAD2B,CAE3B,EAF2B,CAG3BC,8BAH2B,EAI3BlF,cAJ2B,CAA7B,C,QAMiCA,c,CAAxBiF,oB","file":"ToastContainer.js","sourcesContent":["/* eslint-disable class-methods-use-this */\nimport React, { Component } from 'react';\nimport {\n Keyboard,\n Platform,\n Animated,\n ViewPropTypes,\n PanResponder,\n} from 'react-native';\nimport { connectStyle } from 'native-base-shoutem-theme';\n\nimport mapPropsToStyleNames from '../utils/mapPropsToStyleNames';\nimport { PLATFORM } from '../theme/variables/commonColor';\n\nimport { Text } from './Text';\nimport { Button } from './Button';\nimport { Toast } from './Toast';\n\nconst POSITION = {\n ABSOLUTE: 'absolute',\n BOTTOM: 'bottom',\n TOP: 'top',\n};\n\nclass ToastContainer extends Component {\n static show({ ...config }) {\n this.toastInstance._root.showToast({ config });\n }\n static hide() {\n if (this.toastInstance._root.getModalState()) {\n this.toastInstance._root.closeToast('functionCall');\n }\n }\n constructor(props) {\n super(props);\n\n this.state = {\n fadeAnim: new Animated.Value(0),\n pan: new Animated.ValueXY({ x: 0, y: 0 }),\n keyboardHeight: 0,\n isKeyboardVisible: false,\n modalVisible: false,\n };\n\n this.keyboardDidHide = this.keyboardDidHide.bind(this);\n this.keyboardDidShow = this.keyboardDidShow.bind(this);\n this._panResponder = PanResponder.create({\n onMoveShouldSetPanResponderCapture: () => true,\n onPanResponderRelease: (evt, { dx }) => {\n if (dx !== 0) {\n Animated.timing(this.state.pan, {\n toValue: { x: dx, y: 0 },\n duration: 100,\n useNativeDriver: false\n }).start(() => this.closeToast('swipe'));\n }\n },\n });\n }\n\n componentDidMount() {\n Keyboard.addListener('keyboardDidShow', this.keyboardDidShow);\n Keyboard.addListener('keyboardDidHide', this.keyboardDidHide);\n }\n\n componentWillUnmount() {\n Keyboard.removeListener('keyboardDidShow', this.keyboardDidShow);\n Keyboard.removeListener('keyboardDidHide', this.keyboardDidHide);\n }\n\n getToastStyle() {\n return {\n position: POSITION.ABSOLUTE,\n opacity: this.state.fadeAnim,\n width: '100%',\n elevation: 9,\n paddingHorizontal: Platform.OS === PLATFORM.IOS ? 20 : 0,\n top: this.state.position === POSITION.TOP ? 30 : undefined,\n bottom:\n this.state.position === POSITION.BOTTOM ? this.getTop() : undefined,\n };\n }\n\n getTop() {\n if (Platform.OS === PLATFORM.IOS) {\n if (this.state.isKeyboardVisible) {\n return this.state.keyboardHeight;\n }\n return 30;\n }\n return 0;\n }\n\n getButtonText(buttonText) {\n if (buttonText) {\n if (buttonText.trim().length === 0) {\n return undefined;\n }\n return buttonText;\n }\n return undefined;\n }\n getModalState() {\n return this.state.modalVisible;\n }\n\n static toastInstance;\n\n keyboardDidHide() {\n this.setState({\n keyboardHeight: 0,\n isKeyboardVisible: false,\n });\n }\n\n keyboardDidShow(e) {\n this.setState({\n keyboardHeight: e.endCoordinates.height,\n isKeyboardVisible: true,\n });\n }\n\n showToast({ config }) {\n this.setState({\n modalVisible: true,\n text: config.text,\n buttonText: this.getButtonText(config.buttonText),\n type: config.type,\n position: config.position ? config.position : POSITION.BOTTOM,\n supportedOrientations: config.supportedOrientations,\n style: config.style,\n buttonTextStyle: config.buttonTextStyle,\n buttonStyle: config.buttonStyle,\n textStyle: config.textStyle,\n onClose: config.onClose,\n swipeDisabled: config.swipeDisabled || false\n });\n // If we have a toast already open, cut off its close timeout so that it won't affect *this* toast.\n if (this.closeTimeout) {\n clearTimeout(this.closeTimeout);\n }\n // Set the toast to close after the duration.\n if (config.duration !== 0) {\n const duration = config.duration > 0 ? config.duration : 1500;\n this.closeTimeout = setTimeout(\n this.closeToast.bind(this, 'timeout'),\n duration\n );\n }\n // Fade the toast in now.\n Animated.timing(this.state.fadeAnim, {\n toValue: 1,\n duration: 200,\n useNativeDriver: false,\n }).start();\n }\n closeModal = (reason) => {\n this.setState({\n modalVisible: false,\n });\n const { onClose } = this.state;\n if (onClose && typeof onClose === 'function') {\n onClose(reason);\n }\n };\n closeToast(reason) {\n clearTimeout(this.closeTimeout);\n Animated.timing(this.state.fadeAnim, {\n toValue: 0,\n duration: 200,\n useNativeDriver: false,\n }).start(() => {\n this.closeModal(reason);\n this.state.pan.setValue({ x: 0, y: 0 });\n });\n }\n\n render() {\n if (this.state.modalVisible) {\n const { x, y } = this.state.pan;\n return (\n \n \n {this.state.text}\n {this.state.buttonText && (\n this.closeToast('user')}\n >\n \n {this.state.buttonText}\n \n \n )}\n \n \n );\n }\n return null;\n }\n}\n\nToastContainer.propTypes = {\n ...ViewPropTypes,\n};\n\nconst StyledToastContainer = connectStyle(\n 'NativeBase.ToastContainer',\n {},\n mapPropsToStyleNames\n)(ToastContainer);\n\nexport { StyledToastContainer as ToastContainer };\n"]} \ No newline at end of file +{"version":3,"sources":["../../../src/basic/ToastContainer.js"],"names":["POSITION","ABSOLUTE","BOTTOM","TOP","ToastContainer","config","toastInstance","_root","showToast","getModalState","closeToast","props","closeModal","setState","modalVisible","onClose","state","reason","fadeAnim","Animated","Value","pan","ValueXY","x","y","keyboardHeight","isKeyboardVisible","keyboardDidHide","bind","keyboardDidShow","_panResponder","PanResponder","create","onMoveShouldSetPanResponderCapture","onPanResponderRelease","evt","dx","timing","toValue","duration","useNativeDriver","start","Keyboard","addListener","removeListener","position","opacity","width","elevation","paddingHorizontal","Platform","OS","PLATFORM","IOS","top","undefined","bottom","getTop","buttonText","trim","length","e","endCoordinates","height","text","getButtonText","type","supportedOrientations","style","buttonTextStyle","buttonStyle","textStyle","swipeDisabled","closeTimeout","clearTimeout","setTimeout","setValue","panHandlers","getToastStyle","transform","translateX","translateY","Component","propTypes","ViewPropTypes","StyledToastContainer","mapPropsToStyleNames"],"mappings":"u2BACA,4B,2CACA,yCACA,kFACA,iEAEA,mE,yEACA,2DAEA,4BACA,gCACA,8B,skCAEA,GAAMA,UAAW,CACfC,SAAU,UADK,CAEfC,OAAQ,QAFO,CAGfC,IAAK,KAHU,CAAjB,C,GAMMC,e,kIACuB,IAAVC,OAAU,mCACzB,KAAKC,aAAL,CAAmBC,KAAnB,CAAyBC,SAAzB,CAAmC,CAAEH,aAAF,CAAnC,EACD,C,mCACa,CACZ,GAAI,KAAKC,aAAL,CAAmBC,KAAnB,CAAyBE,aAAzB,EAAJ,CAA8C,CAC5C,KAAKH,aAAL,CAAmBC,KAAnB,CAAyBG,UAAzB,CAAoC,cAApC,EACD,CACF,C,IACD,wBAAYC,KAAZ,CAAmB,4JACXA,KADW,SA2HnBC,UA3HmB,CA2HN,gBAAU,CACrB,MAAKC,QAAL,CAAc,CACZC,aAAc,KADF,CAAd,EADqB,GAIbC,QAJa,CAID,MAAKC,KAJJ,CAIbD,OAJa,CAKrB,GAAIA,SAAW,MAAOA,QAAP,GAAmB,UAAlC,CAA8C,CAC5CA,QAAQE,MAAR,EACD,CACF,CAnIkB,CAGjB,MAAKD,KAAL,CAAa,CACXE,SAAU,GAAIC,uBAASC,KAAb,CAAmB,CAAn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AAL,CAAmB+C,WAD1D,EAEE,MAAO,CACL,KAAKC,aAAL,EADK,CAEL,CAAEC,UAAW,CAAC,CAAEC,WAAYzD,CAAd,CAAD,CAAoB,CAAE0D,WAAYzD,CAAd,CAApB,CAAb,CAFK,CAFT,mDAOE,8BAAC,YAAD,EACE,MAAO,CAAC,KAAKR,KAAL,CAAWoD,KAAZ,CADT,CAEE,OAAQ,KAAKpD,KAAL,CAAWkD,IAAX,GAAoB,QAF9B,CAGE,QAAS,KAAKlD,KAAL,CAAWkD,IAAX,GAAoB,SAH/B,CAIE,QAAS,KAAKlD,KAAL,CAAWkD,IAAX,GAAoB,SAJ/B,kDAME,8BAAC,UAAD,EAAM,MAAO,KAAKlD,KAAL,CAAWuD,SAAxB,kDAAoC,KAAKvD,KAAL,CAAWgD,IAA/C,CANF,CAOG,KAAKhD,KAAL,CAAW0C,UAAX,EACC,8BAAC,cAAD,EACE,MAAO,KAAK1C,KAAL,CAAWsD,WADpB,CAEE,QAAS,yBAAM,QAAK5D,UAAL,CAAgB,MAAhB,CAAN,EAFX,kDAIE,8BAAC,UAAD,EAAM,MAAO,KAAKM,KAAL,CAAWqD,eAAxB,kDACG,KAAKrD,KAAL,CAAW0C,UADd,CAJF,CARJ,CAPF,CADF,CA4BD,CACD,MAAO,KAAP,CACD,C,4BA1L0BwB,gB,EA6L7B9E,eAAe+E,SAAf,aACKC,6CADL,EAIA,GAAMC,sBAAuB,yCAC3B,2BAD2B,CAE3B,EAF2B,CAG3BC,8BAH2B,EAI3BlF,cAJ2B,CAA7B,C,QAMiCA,c,CAAxBiF,oB","file":"ToastContainer.js","sourcesContent":["/* eslint-disable class-methods-use-this */\nimport React, { Component } from 'react';\nimport { Keyboard, Platform, Animated, PanResponder } from 'react-native';\nimport { ViewPropTypes } from 'deprecated-react-native-prop-types';\nimport { connectStyle } from 'native-base-shoutem-theme';\n\nimport mapPropsToStyleNames from '../utils/mapPropsToStyleNames';\nimport { PLATFORM } from '../theme/variables/commonColor';\n\nimport { Text } from './Text';\nimport { Button } from './Button';\nimport { Toast } from './Toast';\n\nconst POSITION = {\n ABSOLUTE: 'absolute',\n BOTTOM: 'bottom',\n TOP: 'top'\n};\n\nclass ToastContainer extends Component {\n static show({ ...config }) {\n this.toastInstance._root.showToast({ config });\n }\n static hide() {\n if (this.toastInstance._root.getModalState()) {\n this.toastInstance._root.closeToast('functionCall');\n }\n }\n constructor(props) {\n super(props);\n\n this.state = {\n fadeAnim: new Animated.Value(0),\n pan: new Animated.ValueXY({ x: 0, y: 0 }),\n keyboardHeight: 0,\n isKeyboardVisible: false,\n modalVisible: false\n };\n\n this.keyboardDidHide = this.keyboardDidHide.bind(this);\n this.keyboardDidShow = this.keyboardDidShow.bind(this);\n this._panResponder = PanResponder.create({\n onMoveShouldSetPanResponderCapture: () => true,\n onPanResponderRelease: (evt, { dx }) => {\n if (dx !== 0) {\n Animated.timing(this.state.pan, {\n toValue: { x: dx, y: 0 },\n duration: 100,\n useNativeDriver: false\n }).start(() => this.closeToast('swipe'));\n }\n }\n });\n }\n\n componentDidMount() {\n Keyboard.addListener('keyboardDidShow', this.keyboardDidShow);\n Keyboard.addListener('keyboardDidHide', this.keyboardDidHide);\n }\n\n componentWillUnmount() {\n Keyboard.removeListener('keyboardDidShow', this.keyboardDidShow);\n Keyboard.removeListener('keyboardDidHide', this.keyboardDidHide);\n }\n\n getToastStyle() {\n return {\n position: POSITION.ABSOLUTE,\n opacity: this.state.fadeAnim,\n width: '100%',\n elevation: 9,\n paddingHorizontal: Platform.OS === PLATFORM.IOS ? 20 : 0,\n top: this.state.position === POSITION.TOP ? 30 : undefined,\n bottom:\n this.state.position === POSITION.BOTTOM ? this.getTop() : undefined\n };\n }\n\n getTop() {\n if (Platform.OS === PLATFORM.IOS) {\n if (this.state.isKeyboardVisible) {\n return this.state.keyboardHeight;\n }\n return 30;\n }\n return 0;\n }\n\n getButtonText(buttonText) {\n if (buttonText) {\n if (buttonText.trim().length === 0) {\n return undefined;\n }\n return buttonText;\n }\n return undefined;\n }\n getModalState() {\n return this.state.modalVisible;\n }\n\n static toastInstance;\n\n keyboardDidHide() {\n this.setState({\n keyboardHeight: 0,\n isKeyboardVisible: false\n });\n }\n\n keyboardDidShow(e) {\n this.setState({\n keyboardHeight: e.endCoordinates.height,\n isKeyboardVisible: true\n });\n }\n\n showToast({ config }) {\n this.setState({\n modalVisible: true,\n text: config.text,\n buttonText: this.getButtonText(config.buttonText),\n type: config.type,\n position: config.position ? config.position : POSITION.BOTTOM,\n supportedOrientations: config.supportedOrientations,\n style: config.style,\n buttonTextStyle: config.buttonTextStyle,\n buttonStyle: config.buttonStyle,\n textStyle: config.textStyle,\n onClose: config.onClose,\n swipeDisabled: config.swipeDisabled || false\n });\n // If we have a toast already open, cut off its close timeout so that it won't affect *this* toast.\n if (this.closeTimeout) {\n clearTimeout(this.closeTimeout);\n }\n // Set the toast to close after the duration.\n if (config.duration !== 0) {\n const duration = config.duration > 0 ? config.duration : 1500;\n this.closeTimeout = setTimeout(\n this.closeToast.bind(this, 'timeout'),\n duration\n );\n }\n // Fade the toast in now.\n Animated.timing(this.state.fadeAnim, {\n toValue: 1,\n duration: 200,\n useNativeDriver: false\n }).start();\n }\n closeModal = reason => {\n this.setState({\n modalVisible: false\n });\n const { onClose } = this.state;\n if (onClose && typeof onClose === 'function') {\n onClose(reason);\n }\n };\n closeToast(reason) {\n clearTimeout(this.closeTimeout);\n Animated.timing(this.state.fadeAnim, {\n toValue: 0,\n duration: 200,\n useNativeDriver: false\n }).start(() => {\n this.closeModal(reason);\n this.state.pan.setValue({ x: 0, y: 0 });\n });\n }\n\n render() {\n if (this.state.modalVisible) {\n const { x, y } = this.state.pan;\n return (\n \n \n {this.state.text}\n {this.state.buttonText && (\n this.closeToast('user')}\n >\n \n {this.state.buttonText}\n \n \n )}\n \n \n );\n }\n return null;\n }\n}\n\nToastContainer.propTypes = {\n ...ViewPropTypes\n};\n\nconst StyledToastContainer = connectStyle(\n 'NativeBase.ToastContainer',\n {},\n mapPropsToStyleNames\n)(ToastContainer);\n\nexport { StyledToastContainer as ToastContainer };\n"]} \ No newline at end of file diff --git a/dist/src/basic/View.js b/dist/src/basic/View.js index f39212331..4591f4304 100644 --- a/dist/src/basic/View.js +++ b/dist/src/basic/View.js @@ -1,2 +1,2 @@ -Object.defineProperty(exports,"__esModule",{value:true});exports.ViewNB=undefined;var _extends=Object.assign||function(target){for(var i=1;i (this._root = c)} {...this.props} />;\n }\n}\n\nViewNB.propTypes = {\n ...ViewPropTypes,\n style: PropTypes.oneOfType([\n PropTypes.object,\n PropTypes.number,\n PropTypes.array\n ])\n};\n\nconst StyledViewNB = connectStyle(\n 'NativeBase.ViewNB',\n {},\n mapPropsToStyleNames\n)(ViewNB);\nexport { StyledViewNB as ViewNB };\n"]} \ No newline at end of file +{"version":3,"sources":["../../../src/basic/View.js"],"names":["ViewNB","_root","c","props","Component","propTypes","ViewPropTypes","style","PropTypes","oneOfType","object","number","array","StyledViewNB","mapPropsToStyleNames"],"mappings":"q1BAAA,4B,2CACA,qC,mDACA,yCACA,kFACA,iEAEA,mE,68BAEMA,O,6QACK,iBACP,MAAO,+BAAC,iBAAD,WAAM,IAAK,sBAAM,QAAKC,KAAL,CAAaC,CAAnB,EAAX,EAAsC,KAAKC,KAA3C,mDAAP,CACD,C,oBAHkBC,gB,EAMrBJ,OAAOK,SAAP,aACKC,6CADL,EAEEC,MAAOC,oBAAUC,SAAV,CAAoB,CACzBD,oBAAUE,MADe,CAEzBF,oBAAUG,MAFe,CAGzBH,oBAAUI,KAHe,CAApB,CAFT,GASA,GAAMC,cAAe,yCACnB,mBADmB,CAEnB,EAFmB,CAGnBC,8BAHmB,EAInBd,MAJmB,CAArB,C,QAKyBA,M,CAAhBa,Y","file":"View.js","sourcesContent":["import React, { Component } from 'react';\nimport PropTypes from 'prop-types';\nimport { View } from 'react-native';\nimport { ViewPropTypes } from 'deprecated-react-native-prop-types';\nimport { connectStyle } from 'native-base-shoutem-theme';\n\nimport mapPropsToStyleNames from '../utils/mapPropsToStyleNames';\n\nclass ViewNB extends Component {\n render() {\n return (this._root = c)} {...this.props} />;\n }\n}\n\nViewNB.propTypes = {\n ...ViewPropTypes,\n style: PropTypes.oneOfType([\n PropTypes.object,\n PropTypes.number,\n PropTypes.array\n ])\n};\n\nconst StyledViewNB = connectStyle(\n 'NativeBase.ViewNB',\n {},\n mapPropsToStyleNames\n)(ViewNB);\nexport { StyledViewNB as ViewNB };\n"]} \ No newline at end of file From 2539924510588f085848c4703f46d76d527793e6 Mon Sep 17 00:00:00 2001 From: lucas Date: Thu, 15 Sep 2022 16:48:36 +0200 Subject: [PATCH 3/3] fix/crash on react-native ^0.69 due to deprecated prop-types --- dist/src/basic/Actionsheet.js | 2 +- dist/src/basic/Actionsheet.js.map | 2 +- dist/src/basic/Badge.js | 2 +- dist/src/basic/Badge.js.map | 2 +- dist/src/basic/Body.js | 2 +- dist/src/basic/Body.js.map | 2 +- dist/src/basic/Card.js | 2 +- dist/src/basic/Card.js.map | 2 +- dist/src/basic/DatePicker.js | 2 +- dist/src/basic/DatePicker.js.map | 2 +- dist/src/basic/DeckSwiper.js | 2 +- dist/src/basic/DeckSwiper.js.map | 2 +- dist/src/basic/Footer.js | 2 +- dist/src/basic/Footer.js.map | 2 +- dist/src/basic/FooterTab.js | 2 +- dist/src/basic/FooterTab.js.map | 2 +- dist/src/basic/Form.js | 2 +- dist/src/basic/Form.js.map | 2 +- dist/src/basic/Gravatar.js | 2 +- dist/src/basic/Gravatar.js.map | 2 +- dist/src/basic/H1.js | 2 +- dist/src/basic/H1.js.map | 2 +- dist/src/basic/H2.js | 2 +- dist/src/basic/H2.js.map | 2 +- dist/src/basic/H3.js | 2 +- dist/src/basic/H3.js.map | 2 +- dist/src/basic/Header.js | 2 +- dist/src/basic/Header.js.map | 2 +- dist/src/basic/Input.js | 2 +- dist/src/basic/Input.js.map | 2 +- dist/src/basic/InputGroup.js | 2 +- dist/src/basic/InputGroup.js.map | 2 +- dist/src/basic/Label.js | 2 +- dist/src/basic/Label.js.map | 2 +- dist/src/basic/Left.js | 2 +- dist/src/basic/Left.js.map | 2 +- dist/src/basic/Picker.ios.js | 2 +- dist/src/basic/Picker.ios.js.map | 2 +- dist/src/basic/Right.js | 2 +- dist/src/basic/Right.js.map | 2 +- dist/src/basic/Root.js | 2 +- dist/src/basic/Root.js.map | 2 +- dist/src/basic/Segment.js | 2 +- dist/src/basic/Segment.js.map | 2 +- dist/src/basic/Separator.js | 2 +- dist/src/basic/Separator.js.map | 2 +- dist/src/basic/Subtitle.js | 2 +- dist/src/basic/Subtitle.js.map | 2 +- dist/src/basic/Tab.js | 2 +- dist/src/basic/Tab.js.map | 2 +- dist/src/basic/TabContainer.js | 2 +- dist/src/basic/TabContainer.js.map | 2 +- dist/src/basic/TabHeading.js | 2 +- dist/src/basic/TabHeading.js.map | 2 +- dist/src/basic/Text.js | 2 +- dist/src/basic/Text.js.map | 2 +- dist/src/basic/Textarea.js | 2 +- dist/src/basic/Textarea.js.map | 2 +- dist/src/basic/Thumbnail.js | 2 +- dist/src/basic/Thumbnail.js.map | 2 +- dist/src/basic/Title.js | 2 +- dist/src/basic/Title.js.map | 2 +- dist/src/basic/Toast.js | 2 +- dist/src/basic/Toast.js.map | 2 +- dist/src/basic/ToastContainer.js | 2 +- dist/src/basic/ToastContainer.js.map | 2 +- dist/src/basic/View.js | 2 +- dist/src/basic/View.js.map | 2 +- package.json | 1 + src/basic/Actionsheet.js | 34 +++++++++++++-------------- src/basic/Badge.js | 11 +++++---- src/basic/Body.js | 11 +++++---- src/basic/Card.js | 11 +++++---- src/basic/DatePicker.js | 6 ----- src/basic/DeckSwiper.js | 34 +++++++++++++++++++++------ src/basic/Footer.js | 3 ++- src/basic/FooterTab.js | 3 ++- src/basic/Form.js | 11 +++++---- src/basic/Gravatar.js | 3 ++- src/basic/H1.js | 3 ++- src/basic/H2.js | 3 ++- src/basic/H3.js | 3 ++- src/basic/Header.js | 3 ++- src/basic/Input.js | 11 +++++---- src/basic/InputGroup.js | 3 ++- src/basic/Label.js | 13 +++++++---- src/basic/Left.js | 11 +++++---- src/basic/Picker.ios.js | 3 ++- src/basic/Right.js | 11 +++++---- src/basic/Root.js | 11 +++++---- src/basic/Segment.js | 3 ++- src/basic/Separator.js | 3 ++- src/basic/Subtitle.js | 7 ++++-- src/basic/Tab.js | 3 ++- src/basic/TabContainer.js | 3 ++- src/basic/TabHeading.js | 3 ++- src/basic/Text.js | 3 ++- src/basic/Textarea.js | 3 ++- src/basic/Thumbnail.js | 3 ++- src/basic/Title.js | 11 +++++---- src/basic/Toast.js | 11 +++++---- src/basic/ToastContainer.js | 35 ++++++++++++---------------- src/basic/View.js | 3 ++- yarn.lock | 27 +++++++++++++++++++-- 104 files changed, 272 insertions(+), 185 deletions(-) diff --git a/dist/src/basic/Actionsheet.js b/dist/src/basic/Actionsheet.js index 19e9175c0..93e69e6b6 100644 --- a/dist/src/basic/Actionsheet.js +++ b/dist/src/basic/Actionsheet.js @@ -1,2 +1,2 @@ -Object.defineProperty(exports,"__esModule",{value:true});exports.ActionSheetContainer=undefined;var _jsxFileName='src/basic/Actionsheet.js';var _extends=Object.assign||function(target){for(var i=1;i {\n return item.text;\n });\n\n const filteredConfig = { ...config, options: filtered };\n ActionSheetIOS.showActionSheetWithOptions(filteredConfig, callback);\n } else {\n ActionSheetIOS.showActionSheetWithOptions(config, callback);\n }\n } else {\n this.setState({\n items: config.options,\n title: config.title,\n message: config.message,\n destructiveButtonIndex: config.destructiveButtonIndex,\n cancelButtonIndex: config.cancelButtonIndex,\n modalVisible: true,\n callback,\n style: config.style,\n fontStyle: config.fontStyle,\n });\n }\n }\n\n hideActionSheet() {\n this.setState({ modalVisible: false });\n }\n\n render() {\n return (\n {\n this.state.callback(this.state.cancelButtonIndex);\n this.setState({ modalVisible: false });\n }}\n >\n {\n this.state.callback(this.state.cancelButtonIndex);\n this.setState({ modalVisible: false });\n }}\n style={styles.containerTouchable}\n >\n \n {this.state.title ? (\n {this.state.title}\n ) : null}\n String(index)}\n renderItem={({ index, item }) => {\n return typeof this.state.items[0] === 'string' ? (\n {\n this.state.callback(parseInt(index));\n this.setState({ modalVisible: false });\n }}\n style={styles.listItem}\n >\n {item}\n \n ) : (\n {\n this.state.callback(parseInt(index));\n this.setState({ modalVisible: false });\n }}\n style={[\n styles.listItem,\n {\n height: commonColor.listItemHeight,\n },\n ]}\n icon\n >\n \n \n \n \n {item.text}\n \n \n \n );\n }}\n />\n \n \n \n );\n }\n}\n\nActionSheetContainer.propTypes = {\n ...ViewPropTypes,\n};\n\nconst styles = StyleSheet.create({\n containerTouchable: {\n backgroundColor: commonColor.containerTouchableBackgroundColor,\n flex: 1,\n justifyContent: 'flex-end',\n },\n flatList: {\n marginHorizontal: commonColor.marginHorizontal,\n },\n innerTouchable: {\n backgroundColor: commonColor.innerTouchableBackgroundColor,\n minHeight: commonColor.minHeight,\n maxHeight: Dimensions.get('window').height / 2,\n padding: commonColor.padding,\n elevation: commonColor.elevation,\n },\n listItem: {\n borderColor: commonColor.listItemBorderColor,\n marginLeft: commonColor.marginLeft,\n },\n listItemBody: {\n borderColor: commonColor.listItemBorderColor,\n paddingLeft: commonColor.marginLeft / 2,\n },\n touchableText: {\n color: commonColor.touchableTextColor,\n },\n});\n\nconst StyledActionSheetContainer = connectStyle(\n 'NativeBase.ActionSheetContainer',\n {},\n mapPropsToStyleNames\n)(ActionSheetContainer);\n\nexport { StyledActionSheetContainer as ActionSheetContainer };\n"]} \ No newline at end of file +{"version":3,"sources":["../../../src/basic/Actionsheet.js"],"names":["ActionSheetContainer","config","callback","actionsheetInstance","_root","showActionSheet","hideActionSheet","props","state","modalVisible","items","autoHide","duration","console","warn","Platform","OS","PLATFORM","IOS","options","filtered","map","item","text","filteredConfig","ActionSheetIOS","showActionSheetWithOptions","setState","title","message","destructiveButtonIndex","cancelButtonIndex","style","fontStyle","styles","containerTouchable","innerTouchable","touchableText","flatList","marginTop","commonColor","index","String","parseInt","listItem","height","listItemHeight","icon","iconType","color","iconColor","undefined","listItemBody","Component","propTypes","ViewPropTypes","StyleSheet","create","backgroundColor","containerTouchableBackgroundColor","flex","justifyContent","marginHorizontal","innerTouchableBackgroundColor","minHeight","maxHeight","Dimensions","get","padding","elevation","borderColor","listItemBorderColor","marginLeft","paddingLeft","touchableTextColor","StyledActionSheetContainer","mapPropsToStyleNames"],"mappings":"02BAGA,4B,2CACA,yCASA,kFACA,iEAEA,mE,yEACA,2D,uDAEA,4BACA,4BACA,4BACA,8BACA,4BACA,oC,o4BAEMA,qB,yIACQC,M,CAAQC,Q,CAAU,CAC5B,KAAKC,mBAAL,CAAyBC,KAAzB,CAA+BC,eAA/B,CAA+CJ,MAA/C,CAAuDC,QAAvD,EACD,C,mCACa,CACZ,KAAKC,mBAAL,CAAyBC,KAAzB,CAA+BE,eAA/B,GACD,C,IAED,8BAAYC,KAAZ,CAAmB,8KACXA,KADW,GAEjB,MAAKC,KAAL,CAAa,CACXC,aAAc,KADH,CAEXC,MAAO,EAFI,CAAb,CAFiB,aAMlB,C,8FAEmB,CAClB,GAAI,CAAC,KAAKH,KAAL,CAAWI,QAAZ,EAAwB,KAAKJ,KAAL,CAAWK,QAAvC,CAAiD,CAE/CC,QAAQC,IAAR,8DACD,CACF,C,wDAIeb,M,CAAQC,Q,CAAU,CAChC,GAAIa,sBAASC,EAAT,GAAgBC,sBAASC,GAA7B,CAAkC,CAChC,GAAI,MAAOjB,QAAOkB,OAAP,CAAe,CAAf,CAAP,GAA6B,QAAjC,CAA2C,CACzC,GAAMA,SAAUlB,OAAOkB,OAAvB,CACA,GAAMC,UAAWD,QAAQE,GAAR,CAAY,cAAQ,CACnC,MAAOC,MAAKC,IAAZ,CACD,CAFgB,CAAjB,CAIA,GAAMC,4BAAsBvB,MAAtB,EAA8BkB,QAASC,QAAvC,EAAN,CACAK,4BAAeC,0BAAf,CAA0CF,cAA1C,CAA0DtB,QAA1D,EACD,CARD,IAQO,CACLuB,4BAAeC,0BAAf,CAA0CzB,MAA1C,CAAkDC,QAA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kCAxIgC8B,gB,EA2InCrD,qBAAqBsD,SAArB,aACKC,6CADL,EAIA,GAAMrB,QAASsB,wBAAWC,MAAX,CAAkB,CAC/BtB,mBAAoB,CAClBuB,gBAAiBlB,sBAAYmB,iCADX,CAElBC,KAAM,CAFY,CAGlBC,eAAgB,UAHE,CADW,CAM/BvB,SAAU,CACRwB,iBAAkBtB,sBAAYsB,gBADtB,CANqB,CAS/B1B,eAAgB,CACdsB,gBAAiBlB,sBAAYuB,6BADf,CAEdC,UAAWxB,sBAAYwB,SAFT,CAGdC,UAAWC,wBAAWC,GAAX,CAAe,QAAf,EAAyBtB,MAAzB,CAAkC,CAH/B,CAIduB,QAAS5B,sBAAY4B,OAJP,CAKdC,UAAW7B,sBAAY6B,SALT,CATe,CAgB/BzB,SAAU,CACR0B,YAAa9B,sBAAY+B,mBADjB,CAERC,WAAYhC,sBAAYgC,UAFhB,CAhBqB,CAoB/BpB,aAAc,CACZkB,YAAa9B,sBAAY+B,mBADb,CAEZE,YAAajC,sBAAYgC,UAAZ,CAAyB,CAF1B,CApBiB,CAwB/BnC,cAAe,CACbY,MAAOT,sBAAYkC,kBADN,CAxBgB,CAAlB,CAAf,CA6BA,GAAMC,4BAA6B,yCACjC,iCADiC,CAEjC,EAFiC,CAGjCC,8BAHiC,EAIjC5E,oBAJiC,CAAnC,C,QAMuCA,oB,CAA9B2E,0B","file":"Actionsheet.js","sourcesContent":["/* eslint-disable no-use-before-define */\n/* eslint-disable radix */\n\nimport React, { Component } from 'react';\nimport {\n ActionSheetIOS,\n Dimensions,\n FlatList,\n Modal,\n Platform,\n TouchableOpacity,\n StyleSheet\n} from 'react-native';\nimport { ViewPropTypes } from 'deprecated-react-native-prop-types';\nimport { connectStyle } from 'native-base-shoutem-theme';\n\nimport mapPropsToStyleNames from '../utils/mapPropsToStyleNames';\nimport commonColor, { PLATFORM } from '../theme/variables/commonColor';\n\nimport { Text } from './Text';\nimport { Icon } from './Icon';\nimport { Left } from './Left';\nimport { Right } from './Right';\nimport { Body } from './Body';\nimport { ListItem } from './ListItem';\n\nclass ActionSheetContainer extends Component {\n static show(config, callback) {\n this.actionsheetInstance._root.showActionSheet(config, callback);\n }\n static hide() {\n this.actionsheetInstance._root.hideActionSheet();\n }\n\n constructor(props) {\n super(props);\n this.state = {\n modalVisible: false,\n items: []\n };\n }\n\n componentDidMount() {\n if (!this.props.autoHide && this.props.duration) {\n // eslint-disable-next-line no-console\n console.warn(`It's not recommended to set autoHide false with duration`);\n }\n }\n\n static actionsheetInstance;\n\n showActionSheet(config, callback) {\n if (Platform.OS === PLATFORM.IOS) {\n if (typeof config.options[0] === 'object') {\n const options = config.options;\n const filtered = options.map(item => {\n return item.text;\n });\n\n const filteredConfig = { ...config, options: filtered };\n ActionSheetIOS.showActionSheetWithOptions(filteredConfig, callback);\n } else {\n ActionSheetIOS.showActionSheetWithOptions(config, callback);\n }\n } else {\n this.setState({\n items: config.options,\n title: config.title,\n message: config.message,\n destructiveButtonIndex: config.destructiveButtonIndex,\n cancelButtonIndex: config.cancelButtonIndex,\n modalVisible: true,\n callback,\n style: config.style,\n fontStyle: config.fontStyle\n });\n }\n }\n\n hideActionSheet() {\n this.setState({ modalVisible: false });\n }\n\n render() {\n return (\n {\n this.state.callback(this.state.cancelButtonIndex);\n this.setState({ modalVisible: false });\n }}\n >\n {\n this.state.callback(this.state.cancelButtonIndex);\n this.setState({ modalVisible: false });\n }}\n style={styles.containerTouchable}\n >\n \n {this.state.title ? (\n {this.state.title}\n ) : null}\n String(index)}\n renderItem={({ index, item }) => {\n return typeof this.state.items[0] === 'string' ? (\n {\n this.state.callback(parseInt(index));\n this.setState({ modalVisible: false });\n }}\n style={styles.listItem}\n >\n {item}\n \n ) : (\n {\n this.state.callback(parseInt(index));\n this.setState({ modalVisible: false });\n }}\n style={[\n styles.listItem,\n {\n height: commonColor.listItemHeight\n }\n ]}\n icon\n >\n \n \n \n \n {item.text}\n \n \n \n );\n }}\n />\n \n \n \n );\n }\n}\n\nActionSheetContainer.propTypes = {\n ...ViewPropTypes\n};\n\nconst styles = StyleSheet.create({\n containerTouchable: {\n backgroundColor: commonColor.containerTouchableBackgroundColor,\n flex: 1,\n justifyContent: 'flex-end'\n },\n flatList: {\n marginHorizontal: commonColor.marginHorizontal\n },\n innerTouchable: {\n backgroundColor: commonColor.innerTouchableBackgroundColor,\n minHeight: commonColor.minHeight,\n maxHeight: Dimensions.get('window').height / 2,\n padding: commonColor.padding,\n elevation: commonColor.elevation\n },\n listItem: {\n borderColor: commonColor.listItemBorderColor,\n marginLeft: commonColor.marginLeft\n },\n listItemBody: {\n borderColor: commonColor.listItemBorderColor,\n paddingLeft: commonColor.marginLeft / 2\n },\n touchableText: {\n color: commonColor.touchableTextColor\n }\n});\n\nconst StyledActionSheetContainer = connectStyle(\n 'NativeBase.ActionSheetContainer',\n {},\n mapPropsToStyleNames\n)(ActionSheetContainer);\n\nexport { StyledActionSheetContainer as ActionSheetContainer };\n"]} \ No newline at end of file diff --git a/dist/src/basic/Badge.js b/dist/src/basic/Badge.js index 75a8ab329..5ed4f5b3a 100644 --- a/dist/src/basic/Badge.js +++ b/dist/src/basic/Badge.js @@ -1,2 +1,2 @@ -Object.defineProperty(exports,"__esModule",{value:true});exports.Badge=undefined;var _extends=Object.assign||function(target){for(var i=1;i (this._root = c)} {...this.props}>\n {this.props.children}\n \n );\n }\n}\n\nBadge.propTypes = {\n ...ViewPropTypes,\n style: PropTypes.oneOfType([\n PropTypes.object,\n PropTypes.number,\n PropTypes.array\n ])\n};\n\nconst StyledBadge = connectStyle('NativeBase.Badge', {}, mapPropsToStyleNames)(\n Badge\n);\n\nexport { StyledBadge as Badge };\n"]} \ No newline at end of file +{"version":3,"sources":["../../../src/basic/Badge.js"],"names":["Badge","_root","c","props","children","Component","propTypes","ViewPropTypes","style","PropTypes","oneOfType","object","number","array","StyledBadge","mapPropsToStyleNames"],"mappings":"q1BAAA,4B,2CACA,qC,mDACA,yCACA,kFACA,iEAEA,mE,68BAEMA,M,uQACK,iBACP,MACE,+BAAC,iBAAD,WAAM,IAAK,sBAAM,QAAKC,KAAL,CAAaC,CAAnB,EAAX,EAAsC,KAAKC,KAA3C,mDACG,KAAKA,KAAL,CAAWC,QADd,CADF,CAKD,C,mBAPiBC,gB,EAUpBL,MAAMM,SAAN,aACKC,6CADL,EAEEC,MAAOC,oBAAUC,SAAV,CAAoB,CACzBD,oBAAUE,MADe,CAEzBF,oBAAUG,MAFe,CAGzBH,oBAAUI,KAHe,CAApB,CAFT,GASA,GAAMC,aAAc,yCAClB,kBADkB,CAElB,EAFkB,CAGlBC,8BAHkB,EAIlBf,KAJkB,CAApB,C,QAMwBA,K,CAAfc,W","file":"Badge.js","sourcesContent":["import React, { Component } from 'react';\nimport PropTypes from 'prop-types';\nimport { View } from 'react-native';\nimport { ViewPropTypes } from 'deprecated-react-native-prop-types';\nimport { connectStyle } from 'native-base-shoutem-theme';\n\nimport mapPropsToStyleNames from '../utils/mapPropsToStyleNames';\n\nclass Badge extends Component {\n render() {\n return (\n (this._root = c)} {...this.props}>\n {this.props.children}\n \n );\n }\n}\n\nBadge.propTypes = {\n ...ViewPropTypes,\n style: PropTypes.oneOfType([\n PropTypes.object,\n PropTypes.number,\n PropTypes.array\n ])\n};\n\nconst StyledBadge = connectStyle(\n 'NativeBase.Badge',\n {},\n mapPropsToStyleNames\n)(Badge);\n\nexport { StyledBadge as Badge };\n"]} \ No newline at end of file diff --git a/dist/src/basic/Body.js b/dist/src/basic/Body.js index 463d1509a..3934a675c 100644 --- a/dist/src/basic/Body.js +++ b/dist/src/basic/Body.js @@ -1,2 +1,2 @@ -Object.defineProperty(exports,"__esModule",{value:true});exports.Body=undefined;var _extends=Object.assign||function(target){for(var i=1;i (this._root = c)} {...this.props} />;\n }\n}\n\nBody.propTypes = {\n ...ViewPropTypes,\n style: PropTypes.oneOfType([\n PropTypes.object,\n PropTypes.number,\n PropTypes.array\n ])\n};\n\nconst StyledBody = connectStyle('NativeBase.Body', {}, mapPropsToStyleNames)(\n Body\n);\n\nexport { StyledBody as Body };\n"]} \ No newline at end of file +{"version":3,"sources":["../../../src/basic/Body.js"],"names":["Body","_root","c","props","Component","propTypes","ViewPropTypes","style","PropTypes","oneOfType","object","number","array","StyledBody","mapPropsToStyleNames"],"mappings":"m1BAAA,4B,2CACA,qC,mDACA,yCACA,kFACA,iEAEA,mE,68BAEMA,K,iQACK,iBACP,MAAO,+BAAC,iBAAD,WAAM,IAAK,sBAAM,QAAKC,KAAL,CAAaC,CAAnB,EAAX,EAAsC,KAAKC,KAA3C,mDAAP,CACD,C,kBAHgBC,gB,EAMnBJ,KAAKK,SAAL,aACKC,6CADL,EAEEC,MAAOC,oBAAUC,SAAV,CAAoB,CACzBD,oBAAUE,MADe,CAEzBF,oBAAUG,MAFe,CAGzBH,oBAAUI,KAHe,CAApB,CAFT,GASA,GAAMC,YAAa,yCACjB,iBADiB,CAEjB,EAFiB,CAGjBC,8BAHiB,EAIjBd,IAJiB,CAAnB,C,QAMuBA,I,CAAda,U","file":"Body.js","sourcesContent":["import React, { Component } from 'react';\nimport PropTypes from 'prop-types';\nimport { View } from 'react-native';\nimport { ViewPropTypes } from 'deprecated-react-native-prop-types';\nimport { connectStyle } from 'native-base-shoutem-theme';\n\nimport mapPropsToStyleNames from '../utils/mapPropsToStyleNames';\n\nclass Body extends Component {\n render() {\n return (this._root = c)} {...this.props} />;\n }\n}\n\nBody.propTypes = {\n ...ViewPropTypes,\n style: PropTypes.oneOfType([\n PropTypes.object,\n PropTypes.number,\n PropTypes.array\n ])\n};\n\nconst StyledBody = connectStyle(\n 'NativeBase.Body',\n {},\n mapPropsToStyleNames\n)(Body);\n\nexport { StyledBody as Body };\n"]} \ No newline at end of file diff --git a/dist/src/basic/Card.js b/dist/src/basic/Card.js index 33c53397f..9ac2a997b 100644 --- a/dist/src/basic/Card.js +++ b/dist/src/basic/Card.js @@ -1,2 +1,2 @@ -Object.defineProperty(exports,"__esModule",{value:true});exports.Card=undefined;var _extends=Object.assign||function(target){for(var i=1;i index.toString()}\n />\n );\n }\n return (\n (this._root = c)} {...this.props}>\n {this.props.children}\n \n );\n }\n}\n\nCard.propTypes = {\n ...ViewPropTypes,\n style: PropTypes.oneOfType([\n PropTypes.object,\n PropTypes.number,\n PropTypes.array\n ]),\n // eslint-disable-next-line react/forbid-prop-types\n dataArray: PropTypes.array,\n renderRow: PropTypes.func\n};\n\nconst StyledCard = connectStyle('NativeBase.Card', {}, mapPropsToStyleNames)(\n Card\n);\n\nexport { StyledCard as Card };\n"]} \ No newline at end of file +{"version":3,"sources":["../../../src/basic/Card.js"],"names":["Card","props","dataArray","renderRow","item","index","toString","_root","c","children","Component","propTypes","ViewPropTypes","style","PropTypes","oneOfType","object","number","array","func","StyledCard","mapPropsToStyleNames"],"mappings":"m1BAAA,4B,2CACA,qC,mDACA,yCACA,kFACA,iEAEA,mE,68BAEMA,K,iQACK,iBACP,GAAI,KAAKC,KAAL,CAAWC,SAAX,EAAwB,KAAKD,KAAL,CAAWE,SAAvC,CAAkD,CAChD,MACE,+BAAC,qBAAD,aACM,KAAKF,KADX,EAEE,KAAM,KAAKA,KAAL,CAAWC,SAFnB,CAGE,WAAY,KAAKD,KAAL,CAAWE,SAHzB,CAIE,aAAc,sBAACC,IAAD,CAAOC,KAAP,QAAiBA,OAAMC,QAAN,EAAjB,EAJhB,kDADF,CAQD,CACD,MACE,+BAAC,iBAAD,WAAM,IAAK,sBAAM,QAAKC,KAAL,CAAaC,CAAnB,EAAX,EAAsC,KAAKP,KAA3C,mDACG,KAAKA,KAAL,CAAWQ,QADd,CADF,CAKD,C,kBAjBgBC,gB,EAoBnBV,KAAKW,SAAL,aACKC,6CADL,EAEEC,MAAOC,oBAAUC,SAAV,CAAoB,CACzBD,oBAAUE,MADe,CAEzBF,oBAAUG,MAFe,CAGzBH,oBAAUI,KAHe,CAApB,CAFT,CAQEhB,UAAWY,oBAAUI,KARvB,CASEf,UAAWW,oBAAUK,IATvB,GAYA,GAAMC,YAAa,yCACjB,iBADiB,CAEjB,EAFiB,CAGjBC,8BAHiB,EAIjBrB,IAJiB,CAAnB,C,QAMuBA,I,CAAdoB,U","file":"Card.js","sourcesContent":["import React, { Component } from 'react';\nimport PropTypes from 'prop-types';\nimport { FlatList, View } from 'react-native';\nimport { ViewPropTypes } from 'deprecated-react-native-prop-types';\nimport { connectStyle } from 'native-base-shoutem-theme';\n\nimport mapPropsToStyleNames from '../utils/mapPropsToStyleNames';\n\nclass Card extends Component {\n render() {\n if (this.props.dataArray && this.props.renderRow) {\n return (\n index.toString()}\n />\n );\n }\n return (\n (this._root = c)} {...this.props}>\n {this.props.children}\n \n );\n }\n}\n\nCard.propTypes = {\n ...ViewPropTypes,\n style: PropTypes.oneOfType([\n PropTypes.object,\n PropTypes.number,\n PropTypes.array\n ]),\n // eslint-disable-next-line react/forbid-prop-types\n dataArray: PropTypes.array,\n renderRow: PropTypes.func\n};\n\nconst StyledCard = connectStyle(\n 'NativeBase.Card',\n {},\n mapPropsToStyleNames\n)(Card);\n\nexport { StyledCard as Card };\n"]} \ No newline at end of file diff --git a/dist/src/basic/DatePicker.js b/dist/src/basic/DatePicker.js index 1f8e733f0..7440af30d 100644 --- a/dist/src/basic/DatePicker.js +++ b/dist/src/basic/DatePicker.js @@ -1,2 +1,2 @@ -Object.defineProperty(exports,"__esModule",{value:true});exports.DatePicker=undefined;var _extends=Object.assign||function(target){for(var i=1;i {\n this.setState({ modalVisible: true });\n };\n\n formatChosenDate(date) {\n if (this.props.formatChosenDate) {\n return this.props.formatChosenDate(date);\n }\n return [date.getDate(), date.getMonth() + 1, date.getFullYear()].join('/');\n }\n\n render() {\n const {\n animationType,\n disabled,\n locale,\n maximumDate,\n minimumDate,\n modalTransparent,\n placeHolderText,\n placeHolderTextStyle,\n textStyle,\n timeZoneOffsetInMinutes\n } = this.props;\n\n const variables = this.context.theme\n ? this.context.theme['@@shoutem.theme/themeStyle'].variables\n : variable;\n\n return (\n this.setDate(date)}\n minimumDate={minimumDate}\n maximumDate={maximumDate}\n mode=\"date\"\n locale={locale}\n timeZoneOffsetInMinutes={timeZoneOffsetInMinutes}\n {...this.props}\n />\n );\n }\n}\n"]} \ No newline at end of file +{"version":3,"sources":["../../../src/basic/DatePicker.js"],"names":["DatePicker","props","state","defaultDate","Date","chosenDate","placeHolderText","undefined","date","setState","onDateChange","formatChosenDate","getDate","getMonth","getFullYear","join","locale","maximumDate","minimumDate","timeZoneOffsetInMinutes","setDate","React","Component","defaultProps","disabled"],"mappings":"+1BAAA,4B,2CAEA,sE,i8BAEaA,W,SAAAA,U,mEAIX,oBAAYC,KAAZ,CAAmB,gJACXA,KADW,GAEjB,MAAKC,KAAL,CAAa,CACXC,YAAaF,MAAME,WAAN,CAAoBF,MAAME,WAA1B,CAAwC,GAAIC,KAAJ,EAD1C,CAEXC,WACE,CAACJ,MAAMK,eAAP,EAA0BL,MAAME,WAAhC,CACIF,MAAME,WADV,CAEII,SALK,CAAb,CAFiB,aASlB,C,+DAEOC,I,CAAM,CACZ,KAAKC,QAAL,CAAc,CAAEJ,WAAY,GAAID,KAAJ,CAASI,IAAT,CAAd,CAAd,EACA,GAAI,KAAKP,KAAL,CAAWS,YAAf,CAA6B,CAC3B,KAAKT,KAAL,CAAWS,YAAX,CAAwBF,IAAxB,EACD,CACF,C,0DAEgBA,I,CAAM,CACrB,GAAI,KAAKP,KAAL,CAAWU,gBAAf,CAAiC,CAC/B,MAAO,MAAKV,KAAL,CAAWU,gBAAX,CAA4BH,IAA5B,CAAP,CACD,CACD,MAAO,CAACA,KAAKI,OAAL,EAAD,CAAiBJ,KAAKK,QAAL,GAAkB,CAAnC,CAAsCL,KAAKM,WAAL,EAAtC,EAA0DC,IAA1D,CAA+D,GAA/D,CAAP,CACD,C,uCAEQ,4BAMH,KAAKd,KANF,CAELe,MAFK,QAELA,MAFK,CAGLC,WAHK,QAGLA,WAHK,CAILC,WAJK,QAILA,WAJK,CAKLC,uBALK,QAKLA,uBALK,CAQP,MACE,+BAAC,wBAAD,WACE,KACE,KAAKjB,KAAL,CAAWG,UAAX,CAAwB,KAAKH,KAAL,CAAWG,UAAnC,CAAgD,KAAKH,KAAL,CAAWC,WAF/D,CAIE,aAAc,kCAAQ,QAAKiB,OAAL,CAAaZ,IAAb,CAAR,EAJhB,CAKE,YAAaU,WALf,CAME,YAAaD,WANf,CAOE,KAAK,MAPP,CAQE,OAAQD,MARV,CASE,wBAAyBG,uBAT3B,EAUM,KAAKlB,KAVX,mDADF,CAcD,C,wBAnD6BoB,gBAAMC,S,EAAzBtB,U,CACJuB,Y,CAAe,CACpBC,SAAU,KADU,C","file":"DatePicker.js","sourcesContent":["import React from 'react';\n\nimport DateTimePicker from '@react-native-community/datetimepicker';\n\nexport class DatePicker extends React.Component {\n static defaultProps = {\n disabled: false\n };\n constructor(props) {\n super(props);\n this.state = {\n defaultDate: props.defaultDate ? props.defaultDate : new Date(),\n chosenDate:\n !props.placeHolderText && props.defaultDate\n ? props.defaultDate\n : undefined\n };\n }\n\n setDate(date) {\n this.setState({ chosenDate: new Date(date) });\n if (this.props.onDateChange) {\n this.props.onDateChange(date);\n }\n }\n\n formatChosenDate(date) {\n if (this.props.formatChosenDate) {\n return this.props.formatChosenDate(date);\n }\n return [date.getDate(), date.getMonth() + 1, date.getFullYear()].join('/');\n }\n\n render() {\n const {\n locale,\n maximumDate,\n minimumDate,\n timeZoneOffsetInMinutes\n } = this.props;\n\n return (\n this.setDate(date)}\n minimumDate={minimumDate}\n maximumDate={maximumDate}\n mode=\"date\"\n locale={locale}\n timeZoneOffsetInMinutes={timeZoneOffsetInMinutes}\n {...this.props}\n />\n );\n }\n}\n"]} \ No newline at end of file diff --git a/dist/src/basic/DeckSwiper.js b/dist/src/basic/DeckSwiper.js index 11f3eb280..d691a350e 100644 --- a/dist/src/basic/DeckSwiper.js +++ b/dist/src/basic/DeckSwiper.js @@ -1,2 +1,2 @@ -Object.defineProperty(exports,"__esModule",{value:true});exports.DeckSwiper=undefined;var _jsxFileName='src/basic/DeckSwiper.js';var _extends=Object.assign||function(target){for(var i=1;i5;},onPanResponderGrant:function onPanResponderGrant(){_this2.state.pan.setOffset({x:_this2.state.pan.x._value,y:_this2.state.pan.y._value});_this2.state.pan.setValue({x:0,y:0});},onPanResponderMove:function onPanResponderMove(e,gestureState){if(gestureState.dx>20){if(_this2.props.onSwiping)_this2.props.onSwiping('right',gestureState.dx);}else if(gestureState.dx<-20){if(_this2.props.onSwiping)_this2.props.onSwiping('left',gestureState.dx);}var val=Math.abs(gestureState.dx*0.0013);if(val>0.2){val=0.2;}_reactNative.Animated.timing(_this2.state.fadeAnim,{toValue:0.8+val,useNativeDriver:false}).start();_reactNative.Animated.spring(_this2.state.enter,{toValue:0.8+val,friction:7,useNativeDriver:false}).start();_reactNative.Animated.event([null,{dx:_this2.state.pan.x}],{useNativeDriver:false})(e,gestureState);},onPanResponderRelease:function onPanResponderRelease(e,_ref3){var vx=_ref3.vx,vy=_ref3.vy;if(_this2.props.onSwiping)_this2.props.onSwiping(null);var velocity=void 0;if(vx>=0){velocity=(0,_clamp2.default)(vx,4.5,10);}else if(vx<0){velocity=(0,_clamp2.default)(vx*-1,4.5,10)*-1;}if(Math.abs(_this2.state.pan.x._value)>SWIPE_THRESHOLD){if(velocity>0){_this2.props.onSwipeRight?_this2.props.onSwipeRight(_this2.state.selectedItem):undefined;_this2.selectNext();}else{_this2.props.onSwipeLeft?_this2.props.onSwipeLeft(_this2.state.selectedItem):undefined;_this2.selectNext();}_reactNative.Animated.decay(_this2.state.pan,{velocity:{x:velocity,y:vy},deceleration:0.98,useNativeDriver:false}).start(_this2._resetState.bind(_this2));}else{_reactNative.Animated.spring(_this2.state.pan,{toValue:{x:0,y:0},friction:4,useNativeDriver:false}).start();}}});}},{key:'_resetState',value:function _resetState(){this.state.pan.setValue({x:0,y:0});this.state.enter.setValue(0.8);this.state.fadeAnim.setValue(0.8);this.setState({card1Top:!this.state.card1Top,card2Top:!this.state.card2Top});if(this.props.onSwiping)this.props.onSwiping(null);}},{key:'swipeRight',value:function swipeRight(){var _this3=this;if(this.props.onSwiping)this.props.onSwiping('right');setTimeout(function(){_reactNative.Animated.timing(_this3.state.fadeAnim,{toValue:1,useNativeDriver:false}).start();_reactNative.Animated.spring(_this3.state.enter,{toValue:1,friction:7,useNativeDriver:false}).start();_this3.selectNext();_reactNative.Animated.decay(_this3.state.pan,{velocity:{x:8,y:1},deceleration:0.98,useNativeDriver:false}).start(_this3._resetState.bind(_this3));},300);}},{key:'swipeLeft',value:function swipeLeft(){var _this4=this;if(this.props.onSwiping)this.props.onSwiping('left');setTimeout(function(){_reactNative.Animated.timing(_this4.state.fadeAnim,{toValue:1,useNativeDriver:false}).start();_reactNative.Animated.spring(_this4.state.enter,{toValue:1,friction:7,useNativeDriver:false}).start();_this4.selectNext();_reactNative.Animated.decay(_this4.state.pan,{velocity:{x:-8,y:1},deceleration:0.98,userNativeDriver:false}).start(_this4._resetState.bind(_this4));},300);}},{key:'selectNext',value:function selectNext(){var _this5=this;var dataSource=this.props.dataSource;var currentIndex=dataSource.indexOf(this.state.selectedItem);if(!this.state.looping){if(currentIndex===dataSource.length-1){return this.setState({disabled:true});}else if(currentIndex===dataSource.length-2){return setTimeout(function(){_this5.setState({selectedItem:dataSource[currentIndex+1]});setTimeout(function(){_this5.setState({lastCard:true});},350);},50);}}var nextIndexes=this.findNextIndexes(currentIndex);setTimeout(function(){_this5.setState({selectedItem:_this5.props.dataSource[nextIndexes[0]]});setTimeout(function(){_this5.setState({selectedItem2:_this5.props.dataSource[nextIndexes[1]]});},350);},50);return null;}},{key:'findNextIndexes',value:function findNextIndexes(currentIndex){var newIdx=currentIndex+1;var newIdx2=currentIndex+2;if(newIdx2>this.props.dataSource.length-1&&newIdx===this.props.dataSource.length-1){return[newIdx,0];}else if(newIdx>this.props.dataSource.length-1){return[0,1];}return[newIdx,newIdx2];}},{key:'render',value:function render(){if(this.state.disabled){return _react2.default.createElement(_reactNative.View,{style:{position:'relative',flexDirection:'column'},__source:{fileName:_jsxFileName,lineNumber:266}},_react2.default.createElement(_reactNative.View,{__source:{fileName:_jsxFileName,lineNumber:267}},this.props.renderEmpty&&this.props.renderEmpty()));}else if(this.state.lastCard){return _react2.default.createElement(_reactNative.View,{style:{position:'relative',flexDirection:'column'},__source:{fileName:_jsxFileName,lineNumber:273}},this.state.selectedItem===undefined?_react2.default.createElement(_reactNative.View,{__source:{fileName:_jsxFileName,lineNumber:275}}):_react2.default.createElement(_reactNative.View,{__source:{fileName:_jsxFileName,lineNumber:277}},_react2.default.createElement(_reactNative.Animated.View,_extends({style:[this.getCardStyles()[1],this.getInitialStyle().topCard,{opacity:this.state.fadeAnim}]},this._panResponder.panHandlers,{__source:{fileName:_jsxFileName,lineNumber:278}}),this.props.renderEmpty&&this.props.renderEmpty()),_react2.default.createElement(_reactNative.Animated.View,_extends({style:[this.getCardStyles()[0],this.getInitialStyle().topCard]},this._panResponder.panHandlers,{__source:{fileName:_jsxFileName,lineNumber:288}}),this.props.renderItem(this.state.selectedItem))));}return _react2.default.createElement(_reactNative.View,{style:{position:'relative',flexDirection:'column'},__source:{fileName:_jsxFileName,lineNumber:303}},this.state.selectedItem===undefined?_react2.default.createElement(_reactNative.View,{__source:{fileName:_jsxFileName,lineNumber:305}}):_react2.default.createElement(_reactNative.View,{__source:{fileName:_jsxFileName,lineNumber:307}},_react2.default.createElement(_reactNative.Animated.View,_extends({style:[this.getCardStyles()[1],this.getInitialStyle().topCard,{opacity:this.state.fadeAnim}]},this._panResponder.panHandlers,{__source:{fileName:_jsxFileName,lineNumber:308}}),this.props.renderBottom?this.props.renderBottom(this.state.selectedItem2):this.props.renderItem(this.state.selectedItem2)),_react2.default.createElement(_reactNative.Animated.View,_extends({style:[this.getCardStyles()[0],this.getInitialStyle().topCard]},this._panResponder.panHandlers,{__source:{fileName:_jsxFileName,lineNumber:320}}),this.props.renderTop?this.props.renderTop(this.state.selectedItem):this.props.renderItem(this.state.selectedItem))));}}]);return DeckSwiper;}(_react.Component);DeckSwiper.propTypes=_extends({},_reactNative.ViewPropTypes,{style:_propTypes2.default.oneOfType([_propTypes2.default.object,_propTypes2.default.number,_propTypes2.default.array]),dataSource:_propTypes2.default.array});var StyledDeckSwiper=(0,_nativeBaseShoutemTheme.connectStyle)('NativeBase.DeckSwiper',{},_mapPropsToStyleNames2.default)(DeckSwiper);exports.DeckSwiper=StyledDeckSwiper; +Object.defineProperty(exports,"__esModule",{value:true});exports.DeckSwiper=undefined;var _jsxFileName='src/basic/DeckSwiper.js';var _extends=Object.assign||function(target){for(var i=1;i5;},onPanResponderGrant:function onPanResponderGrant(){_this2.state.pan.setOffset({x:_this2.state.pan.x._value,y:_this2.state.pan.y._value});_this2.state.pan.setValue({x:0,y:0});},onPanResponderMove:function onPanResponderMove(e,gestureState){if(gestureState.dx>20){if(_this2.props.onSwiping)_this2.props.onSwiping('right',gestureState.dx);}else if(gestureState.dx<-20){if(_this2.props.onSwiping)_this2.props.onSwiping('left',gestureState.dx);}var val=Math.abs(gestureState.dx*0.0013);if(val>0.2){val=0.2;}_reactNative.Animated.timing(_this2.state.fadeAnim,{toValue:0.8+val,useNativeDriver:false}).start();_reactNative.Animated.spring(_this2.state.enter,{toValue:0.8+val,friction:7,useNativeDriver:false}).start();_reactNative.Animated.event([null,{dx:_this2.state.pan.x}],{useNativeDriver:false})(e,gestureState);},onPanResponderRelease:function onPanResponderRelease(e,_ref3){var vx=_ref3.vx,vy=_ref3.vy;if(_this2.props.onSwiping)_this2.props.onSwiping(null);var velocity=void 0;if(vx>=0){velocity=(0,_clamp2.default)(vx,4.5,10);}else if(vx<0){velocity=(0,_clamp2.default)(vx*-1,4.5,10)*-1;}if(Math.abs(_this2.state.pan.x._value)>SWIPE_THRESHOLD){if(velocity>0){_this2.props.onSwipeRight?_this2.props.onSwipeRight(_this2.state.selectedItem):undefined;_this2.selectNext();}else{_this2.props.onSwipeLeft?_this2.props.onSwipeLeft(_this2.state.selectedItem):undefined;_this2.selectNext();}_reactNative.Animated.decay(_this2.state.pan,{velocity:{x:velocity,y:vy},deceleration:0.98,useNativeDriver:false}).start(_this2._resetState.bind(_this2));}else{_reactNative.Animated.spring(_this2.state.pan,{toValue:{x:0,y:0},friction:4,useNativeDriver:false}).start();}}});}},{key:'_resetState',value:function _resetState(){this.state.pan.setValue({x:0,y:0});this.state.enter.setValue(0.8);this.state.fadeAnim.setValue(0.8);this.setState({card1Top:!this.state.card1Top,card2Top:!this.state.card2Top});if(this.props.onSwiping)this.props.onSwiping(null);}},{key:'swipeRight',value:function swipeRight(){var _this3=this;if(this.props.onSwiping)this.props.onSwiping('right');setTimeout(function(){_reactNative.Animated.timing(_this3.state.fadeAnim,{toValue:1,useNativeDriver:false}).start();_reactNative.Animated.spring(_this3.state.enter,{toValue:1,friction:7,useNativeDriver:false}).start();_this3.selectNext();_reactNative.Animated.decay(_this3.state.pan,{velocity:{x:8,y:1},deceleration:0.98,useNativeDriver:false}).start(_this3._resetState.bind(_this3));},300);}},{key:'swipeLeft',value:function swipeLeft(){var _this4=this;if(this.props.onSwiping)this.props.onSwiping('left');setTimeout(function(){_reactNative.Animated.timing(_this4.state.fadeAnim,{toValue:1,useNativeDriver:false}).start();_reactNative.Animated.spring(_this4.state.enter,{toValue:1,friction:7,useNativeDriver:false}).start();_this4.selectNext();_reactNative.Animated.decay(_this4.state.pan,{velocity:{x:-8,y:1},deceleration:0.98,userNativeDriver:false}).start(_this4._resetState.bind(_this4));},300);}},{key:'selectNext',value:function selectNext(){var _this5=this;var dataSource=this.props.dataSource;var currentIndex=dataSource.indexOf(this.state.selectedItem);if(!this.state.looping){if(currentIndex===dataSource.length-1){return this.setState({disabled:true});}else if(currentIndex===dataSource.length-2){return setTimeout(function(){_this5.setState({selectedItem:dataSource[currentIndex+1]});setTimeout(function(){_this5.setState({lastCard:true});},350);},50);}}var nextIndexes=this.findNextIndexes(currentIndex);setTimeout(function(){_this5.setState({selectedItem:_this5.props.dataSource[nextIndexes[0]]});setTimeout(function(){_this5.setState({selectedItem2:_this5.props.dataSource[nextIndexes[1]]});},350);},50);return null;}},{key:'findNextIndexes',value:function findNextIndexes(currentIndex){var newIdx=currentIndex+1;var newIdx2=currentIndex+2;if(newIdx2>this.props.dataSource.length-1&&newIdx===this.props.dataSource.length-1){return[newIdx,0];}else if(newIdx>this.props.dataSource.length-1){return[0,1];}return[newIdx,newIdx2];}},{key:'render',value:function render(){if(this.state.disabled){return _react2.default.createElement(_reactNative.View,{style:{position:'relative',flexDirection:'column'},__source:{fileName:_jsxFileName,lineNumber:286}},_react2.default.createElement(_reactNative.View,{__source:{fileName:_jsxFileName,lineNumber:287}},this.props.renderEmpty&&this.props.renderEmpty()));}else if(this.state.lastCard){return _react2.default.createElement(_reactNative.View,{style:{position:'relative',flexDirection:'column'},__source:{fileName:_jsxFileName,lineNumber:293}},this.state.selectedItem===undefined?_react2.default.createElement(_reactNative.View,{__source:{fileName:_jsxFileName,lineNumber:295}}):_react2.default.createElement(_reactNative.View,{__source:{fileName:_jsxFileName,lineNumber:297}},_react2.default.createElement(_reactNative.Animated.View,_extends({style:[this.getCardStyles()[1],this.getInitialStyle().topCard,{opacity:this.state.fadeAnim}]},this._panResponder.panHandlers,{__source:{fileName:_jsxFileName,lineNumber:298}}),this.props.renderEmpty&&this.props.renderEmpty()),_react2.default.createElement(_reactNative.Animated.View,_extends({style:[this.getCardStyles()[0],this.getInitialStyle().topCard]},this._panResponder.panHandlers,{__source:{fileName:_jsxFileName,lineNumber:308}}),this.props.renderItem(this.state.selectedItem))));}return _react2.default.createElement(_reactNative.View,{style:{position:'relative',flexDirection:'column'},__source:{fileName:_jsxFileName,lineNumber:323}},this.state.selectedItem===undefined?_react2.default.createElement(_reactNative.View,{__source:{fileName:_jsxFileName,lineNumber:325}}):_react2.default.createElement(_reactNative.View,{__source:{fileName:_jsxFileName,lineNumber:327}},_react2.default.createElement(_reactNative.Animated.View,_extends({style:[this.getCardStyles()[1],this.getInitialStyle().topCard,{opacity:this.state.fadeAnim}]},this._panResponder.panHandlers,{__source:{fileName:_jsxFileName,lineNumber:328}}),this.props.renderBottom?this.props.renderBottom(this.state.selectedItem2):this.props.renderItem(this.state.selectedItem2)),_react2.default.createElement(_reactNative.Animated.View,_extends({style:[this.getCardStyles()[0],this.getInitialStyle().topCard]},this._panResponder.panHandlers,{__source:{fileName:_jsxFileName,lineNumber:340}}),this.props.renderTop?this.props.renderTop(this.state.selectedItem):this.props.renderItem(this.state.selectedItem))));}}]);return DeckSwiper;}(_react.Component);DeckSwiper.propTypes=_extends({},_deprecatedReactNativePropTypes.ViewPropTypes,{style:_propTypes2.default.oneOfType([_propTypes2.default.object,_propTypes2.default.number,_propTypes2.default.array]),dataSource:_propTypes2.default.array});var StyledDeckSwiper=(0,_nativeBaseShoutemTheme.connectStyle)('NativeBase.DeckSwiper',{},_mapPropsToStyleNames2.default)(DeckSwiper);exports.DeckSwiper=StyledDeckSwiper; //# sourceMappingURL=DeckSwiper.js.map \ No newline at end of file diff --git a/dist/src/basic/DeckSwiper.js.map b/dist/src/basic/DeckSwiper.js.map index e1ae588f8..1ae696143 100644 --- a/dist/src/basic/DeckSwiper.js.map +++ b/dist/src/basic/DeckSwiper.js.map @@ -1 +1 @@ -{"version":3,"sources":["../../../src/basic/DeckSwiper.js"],"names":["SWIPE_THRESHOLD","DeckSwiper","props","getInitialStyle","topCard","position","top","right","left","state","pan","Animated","ValueXY","pan2","enter","Value","selectedItem","dataSource","selectedItem2","card1Top","card2Top","fadeAnim","looping","disabled","length","lastCard","setPanresponder","setState","undefined","visibleIndex","indexOf","currentIndex","nextIndex","x","y","translateX","translateY","rotate","interpolate","inputRange","outputRange","opacity","scale","animatedCardStyles","transform","animatedCardStyles2","_panResponder","PanResponder","create","onMoveShouldSetResponderCapture","onMoveShouldSetPanResponderCapture","evt","gestureState","Math","abs","dx","onPanResponderGrant","setOffset","_value","setValue","onPanResponderMove","e","onSwiping","val","timing","toValue","useNativeDriver","start","spring","friction","event","onPanResponderRelease","vx","vy","velocity","onSwipeRight","selectNext","onSwipeLeft","decay","deceleration","_resetState","bind","setTimeout","userNativeDriver","nextIndexes","findNextIndexes","newIdx","newIdx2","flexDirection","renderEmpty","getCardStyles","panHandlers","renderItem","renderBottom","renderTop","Component","propTypes","ViewPropTypes","style","PropTypes","oneOfType","object","number","array","StyledDeckSwiper","mapPropsToStyleNames"],"mappings":"+1BAAA,4B,2CACA,qC,mDACA,yCACA,4B,2CACA,iEAEA,mE,08BAEA,GAAMA,iBAAkB,GAAxB,C,GAEMC,W,uDACJ,oBAAYC,KAAZ,CAAmB,gJACXA,KADW,SA4CnBC,eA5CmB,CA4CD,UAAM,CACtB,MAAO,CACLC,QAAS,CACPC,SAAU,UADH,CAEPC,IAAK,CAFE,CAGPC,MAAO,CAHA,CAIPC,KAAM,CAJC,CADJ,CAAP,CAQD,CArDkB,CAEjB,MAAKC,KAAL,CAAa,CACXC,IAAK,GAAIC,uBAASC,OAAb,EADM,CAEXC,KAAM,GAAIF,uBAASC,OAAb,EAFK,CAGXE,MAAO,GAAIH,uBAASI,KAAb,CAAmB,GAAnB,CAHI,CAIXC,aAAc,MAAKd,KAAL,CAAWe,UAAX,CAAsB,CAAtB,CAJH,CAKXC,cAAe,MAAKhB,KAAL,CAAWe,UAAX,CAAsB,CAAtB,CALJ,CAMXE,SAAU,IANC,CAOXC,SAAU,KAPC,CAQXC,SAAU,GAAIV,uBAASI,KAAb,CAAmB,GAAnB,CARC,CASXO,QACE,MAAO,OAAKpB,KAAL,CAAWoB,OAAlB,GAA8B,WAA9B,CAA4C,IAA5C,CAAmD,MAAKpB,KAAL,CAAWoB,OAVrD,CAWXC,SAAU,MAAKrB,KAAL,CAAWe,UAAX,CAAsBO,MAAtB,GAAiC,CAXhC,CAYXC,SAAU,MAAKvB,KAAL,CAAWe,UAAX,CAAsBO,MAAtB,GAAiC,CAZhC,CAAb,CAcA,MAAKE,eAAL,GAhBiB,aAiBlB,C,0FAEkC,IAAdT,WAAc,MAAdA,UAAc,CACjC,GAAIA,WAAWO,MAAX,GAAsB,KAAKtB,KAAL,CAAWe,UA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,CAApB,CAFT,CAQEtF,WAAYkF,oBAAUI,KARxB,GAWA,GAAMC,kBAAmB,yCACvB,uBADuB,CAEvB,EAFuB,CAGvBC,8BAHuB,EAIvBxG,UAJuB,CAAzB,C,QAM6BA,U,CAApBuG,gB","file":"DeckSwiper.js","sourcesContent":["import React, { Component } from 'react';\nimport PropTypes from 'prop-types';\nimport { View, Animated, PanResponder, ViewPropTypes } from 'react-native';\nimport clamp from 'clamp';\nimport { connectStyle } from 'native-base-shoutem-theme';\n\nimport mapPropsToStyleNames from '../utils/mapPropsToStyleNames';\n\nconst SWIPE_THRESHOLD = 120;\n\nclass DeckSwiper extends Component {\n constructor(props) {\n super(props);\n this.state = {\n pan: new Animated.ValueXY(),\n pan2: new Animated.ValueXY(),\n enter: new Animated.Value(0.8),\n selectedItem: this.props.dataSource[0],\n selectedItem2: this.props.dataSource[1],\n card1Top: true,\n card2Top: false,\n fadeAnim: new Animated.Value(0.8),\n looping:\n typeof this.props.looping === 'undefined' ? true : this.props.looping,\n disabled: this.props.dataSource.length === 0,\n lastCard: this.props.dataSource.length === 1\n };\n this.setPanresponder();\n }\n\n componentDidUpdate({ dataSource }) {\n if (dataSource.length !== this.props.dataSource.length) {\n if (dataSource.length <= 1) {\n this.setState({\n ...this.state,\n selectedItem: dataSource[0],\n selectedItem2: undefined,\n disabled: dataSource.length === 0,\n lastCard: dataSource.length === 1\n });\n return;\n }\n\n const visibleIndex = dataSource.indexOf(this.state.selectedItem);\n const currentIndex = visibleIndex < 0 ? visibleIndex + 1 : visibleIndex;\n const nextIndex =\n currentIndex + 1 === dataSource.length ? 0 : currentIndex + 1;\n\n this.setState({\n selectedItem: dataSource[currentIndex],\n selectedItem2: dataSource[nextIndex]\n });\n }\n }\n\n getInitialStyle = () => {\n return {\n topCard: {\n position: 'absolute',\n top: 0,\n right: 0,\n left: 0\n }\n };\n };\n\n getCardStyles() {\n const { pan, enter } = this.state;\n\n const [translateX, translateY] = [pan.x, pan.y];\n // let [translateX, translateY] = [pan2.x, pan2.y];\n\n const rotate = pan.x.interpolate({\n inputRange: [-700, 0, 700],\n outputRange: ['-10deg', '0deg', '10deg']\n });\n\n const opacity = pan.x.interpolate({\n inputRange: [-320, 0, 320],\n outputRange: [0.9, 1, 0.9]\n });\n const scale = enter;\n\n const animatedCardStyles = {\n transform: [{ translateX }, { translateY }, { rotate }],\n opacity\n };\n const animatedCardStyles2 = { transform: [{ scale }] };\n\n return [animatedCardStyles, animatedCardStyles2];\n }\n\n setPanresponder() {\n this._panResponder = PanResponder.create({\n onMoveShouldSetResponderCapture: () => true,\n onMoveShouldSetPanResponderCapture: (evt, gestureState) =>\n Math.abs(gestureState.dx) > 5,\n\n onPanResponderGrant: () => {\n this.state.pan.setOffset({\n x: this.state.pan.x._value,\n y: this.state.pan.y._value\n });\n this.state.pan.setValue({ x: 0, y: 0 });\n },\n\n onPanResponderMove: (e, gestureState) => {\n if (gestureState.dx > 20) {\n if (this.props.onSwiping)\n this.props.onSwiping('right', gestureState.dx);\n } else if (gestureState.dx < -20) {\n if (this.props.onSwiping)\n this.props.onSwiping('left', gestureState.dx);\n }\n let val = Math.abs(gestureState.dx * 0.0013);\n if (val > 0.2) {\n val = 0.2;\n }\n Animated.timing(this.state.fadeAnim, { toValue: 0.8 + val, useNativeDriver: false }).start();\n Animated.spring(this.state.enter, {\n toValue: 0.8 + val,\n friction: 7,\n useNativeDriver: false\n }).start();\n Animated.event([null, { dx: this.state.pan.x }], { useNativeDriver: false })(e, gestureState);\n },\n\n onPanResponderRelease: (e, { vx, vy }) => {\n if (this.props.onSwiping) this.props.onSwiping(null);\n let velocity;\n\n if (vx >= 0) {\n velocity = clamp(vx, 4.5, 10);\n } else if (vx < 0) {\n velocity = clamp(vx * -1, 4.5, 10) * -1;\n }\n\n if (Math.abs(this.state.pan.x._value) > SWIPE_THRESHOLD) {\n if (velocity > 0) {\n this.props.onSwipeRight\n ? this.props.onSwipeRight(this.state.selectedItem)\n : undefined;\n this.selectNext();\n } else {\n this.props.onSwipeLeft\n ? this.props.onSwipeLeft(this.state.selectedItem)\n : undefined;\n this.selectNext();\n }\n\n Animated.decay(this.state.pan, {\n velocity: { x: velocity, y: vy },\n deceleration: 0.98,\n useNativeDriver: false\n }).start(this._resetState.bind(this));\n } else {\n Animated.spring(this.state.pan, {\n toValue: { x: 0, y: 0 },\n friction: 4,\n useNativeDriver: false\n }).start();\n }\n }\n });\n }\n\n _resetState() {\n this.state.pan.setValue({ x: 0, y: 0 });\n this.state.enter.setValue(0.8);\n this.state.fadeAnim.setValue(0.8);\n this.setState({\n card1Top: !this.state.card1Top,\n card2Top: !this.state.card2Top\n });\n if (this.props.onSwiping) this.props.onSwiping(null);\n }\n\n swipeRight() {\n if (this.props.onSwiping) this.props.onSwiping('right');\n setTimeout(() => {\n Animated.timing(this.state.fadeAnim, { toValue: 1, useNativeDriver: false }).start();\n Animated.spring(this.state.enter, { toValue: 1, friction: 7, useNativeDriver: false }).start();\n this.selectNext();\n Animated.decay(this.state.pan, {\n velocity: { x: 8, y: 1 },\n deceleration: 0.98,\n useNativeDriver: false\n }).start(this._resetState.bind(this));\n }, 300);\n }\n\n swipeLeft() {\n if (this.props.onSwiping) this.props.onSwiping('left');\n setTimeout(() => {\n Animated.timing(this.state.fadeAnim, { toValue: 1, useNativeDriver: false }).start();\n Animated.spring(this.state.enter, { toValue: 1, friction: 7, useNativeDriver: false }).start();\n this.selectNext();\n Animated.decay(this.state.pan, {\n velocity: { x: -8, y: 1 },\n deceleration: 0.98,\n userNativeDriver: false\n }).start(this._resetState.bind(this));\n }, 300);\n }\n\n selectNext() {\n const dataSource = this.props.dataSource;\n const currentIndex = dataSource.indexOf(this.state.selectedItem);\n\n // if not looping, check for these conditionals and if true return from selectNext()\n if (!this.state.looping) {\n // reached end -> only display static renderEmpty() -> no swiping\n if (currentIndex === dataSource.length - 1) {\n return this.setState({\n disabled: true\n });\n } else if (currentIndex === dataSource.length - 2) {\n // show last card with renderEmpty() component behind it\n return setTimeout(() => {\n this.setState({\n selectedItem: dataSource[currentIndex + 1]\n });\n setTimeout(() => {\n this.setState({\n lastCard: true\n });\n }, 350);\n }, 50);\n }\n }\n\n const nextIndexes = this.findNextIndexes(currentIndex);\n setTimeout(() => {\n this.setState({\n selectedItem: this.props.dataSource[nextIndexes[0]]\n });\n setTimeout(() => {\n this.setState({\n selectedItem2: this.props.dataSource[nextIndexes[1]]\n });\n }, 350);\n }, 50);\n\n return null;\n }\n\n findNextIndexes(currentIndex) {\n const newIdx = currentIndex + 1;\n const newIdx2 = currentIndex + 2;\n\n if (\n newIdx2 > this.props.dataSource.length - 1 &&\n newIdx === this.props.dataSource.length - 1\n ) {\n return [newIdx, 0];\n } else if (newIdx > this.props.dataSource.length - 1) {\n return [0, 1];\n }\n return [newIdx, newIdx2];\n }\n\n render() {\n if (this.state.disabled) {\n // disable swiping and renderEmpty\n return (\n \n {{this.props.renderEmpty && this.props.renderEmpty()}}\n \n );\n } else if (this.state.lastCard) {\n // display renderEmpty underneath last viable card\n return (\n \n {this.state.selectedItem === undefined ? (\n \n ) : (\n \n \n {this.props.renderEmpty && this.props.renderEmpty()}\n \n \n {this.props.renderItem(this.state.selectedItem)}\n \n \n )}\n \n );\n }\n return (\n \n {this.state.selectedItem === undefined ? (\n \n ) : (\n \n \n {this.props.renderBottom\n ? this.props.renderBottom(this.state.selectedItem2)\n : this.props.renderItem(this.state.selectedItem2)}\n \n \n {this.props.renderTop\n ? this.props.renderTop(this.state.selectedItem)\n : this.props.renderItem(this.state.selectedItem)}\n \n \n )}\n \n );\n }\n}\n\nDeckSwiper.propTypes = {\n ...ViewPropTypes,\n style: PropTypes.oneOfType([\n PropTypes.object,\n PropTypes.number,\n PropTypes.array\n ]),\n // eslint-disable-next-line react/forbid-prop-types\n dataSource: PropTypes.array\n};\n\nconst StyledDeckSwiper = connectStyle(\n 'NativeBase.DeckSwiper',\n {},\n mapPropsToStyleNames\n)(DeckSwiper);\n\nexport { StyledDeckSwiper as DeckSwiper };\n"]} \ No newline at end of file +{"version":3,"sources":["../../../src/basic/DeckSwiper.js"],"names":["SWIPE_THRESHOLD","DeckSwiper","props","getInitialStyle","topCard","position","top","right","left","state","pan","Animated","ValueXY","pan2","enter","Value","selectedItem","dataSource","selectedItem2","card1Top","card2Top","fadeAnim","looping","disabled","length","lastCard","setPanresponder","setState","undefined","visibleIndex","indexOf","currentIndex","nextIndex","x","y","translateX","translateY","rotate","interpolate","inputRange","outputRange","opacity","scale","animatedCardStyles","transform","animatedCardStyles2","_panResponder","PanResponder","create","onMoveShouldSetResponderCapture","onMoveShouldSetPanResponderCapture","evt","gestureState","Math","abs","dx","onPanResponderGrant","setOffset","_value","setValue","onPanResponderMove","e","onSwiping","val","timing","toValue","useNativeDriver","start","spring","friction","event","onPanResponderRelease","vx","vy","velocity","onSwipeRight","selectNext","onSwipeLeft","decay","deceleration","_resetState","bind","setTimeout","userNativeDriver","nextIndexes","findNextIndexes","newIdx","newIdx2","flexDirection","renderEmpty","getCardStyles","panHandlers","renderItem","renderBottom","renderTop","Component","propTypes","ViewPropTypes","style","PropTypes","oneOfType","object","number","array","StyledDeckSwiper","mapPropsToStyleNames"],"mappings":"+1BAAA,4B,2CACA,qC,mDACA,yCACA,kFACA,4B,2CACA,iEAEA,mE,08BAEA,GAAMA,iBAAkB,GAAxB,C,GAEMC,W,uDACJ,oBAAYC,KAAZ,CAAmB,gJACXA,KADW,SA4CnBC,eA5CmB,CA4CD,UAAM,CACtB,MAAO,CACLC,QAAS,CACPC,SAAU,UADH,CAEPC,IAAK,CAFE,CAGPC,MAAO,CAHA,CAIPC,KAAM,CAJC,CADJ,CAAP,CAQD,CArDkB,CAEjB,MAAKC,KAAL,CAAa,CACXC,IAAK,GAAIC,uBAASC,OAAb,EADM,CAEXC,KAAM,GAAIF,uBAASC,OAAb,EAFK,CAGXE,MAAO,GAAIH,uBAASI,KAAb,CAAmB,GAAnB,CAHI,CAIXC,aAAc,MAAKd,KAAL,CAAWe,UAAX,CAAsB,CAAtB,CAJH,CAKX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AAWS,aAAjC,CAVN,CADF,CAaE,8BAAC,qBAAD,CAAU,IAAV,WACE,MAAO,CAAC,KAAKwE,aAAL,GAAqB,CAArB,CAAD,CAA0B,KAAKvF,eAAL,GAAuBC,OAAjD,CADT,EAEM,KAAK0C,aAAL,CAAmB6C,WAFzB,oDAIG,KAAKzF,KAAL,CAAW4F,SAAX,CACG,KAAK5F,KAAL,CAAW4F,SAAX,CAAqB,KAAKrF,KAAL,CAAWO,YAAhC,CADH,CAEG,KAAKd,KAAL,CAAW0F,UAAX,CAAsB,KAAKnF,KAAL,CAAWO,YAAjC,CANN,CAbF,CAJJ,CADF,CA8BD,C,wBApVsB+E,gB,EAuVzB9F,WAAW+F,SAAX,aACKC,6CADL,EAEEC,MAAOC,oBAAUC,SAAV,CAAoB,CACzBD,oBAAUE,MADe,CAEzBF,oBAAUG,MAFe,CAGzBH,oBAAUI,KAHe,CAApB,CAFT,CAQEtF,WAAYkF,oBAAUI,KARxB,GAWA,GAAMC,kBAAmB,yCACvB,uBADuB,CAEvB,EAFuB,CAGvBC,8BAHuB,EAIvBxG,UAJuB,CAAzB,C,QAM6BA,U,CAApBuG,gB","file":"DeckSwiper.js","sourcesContent":["import React, { Component } from 'react';\nimport PropTypes from 'prop-types';\nimport { View, Animated, PanResponder } from 'react-native';\nimport { ViewPropTypes } from 'deprecated-react-native-prop-types';\nimport clamp from 'clamp';\nimport { connectStyle } from 'native-base-shoutem-theme';\n\nimport mapPropsToStyleNames from '../utils/mapPropsToStyleNames';\n\nconst SWIPE_THRESHOLD = 120;\n\nclass DeckSwiper extends Component {\n constructor(props) {\n super(props);\n this.state = {\n pan: new Animated.ValueXY(),\n pan2: new Animated.ValueXY(),\n enter: new Animated.Value(0.8),\n selectedItem: this.props.dataSource[0],\n selectedItem2: this.props.dataSource[1],\n card1Top: true,\n card2Top: false,\n fadeAnim: new Animated.Value(0.8),\n looping:\n typeof this.props.looping === 'undefined' ? true : this.props.looping,\n disabled: this.props.dataSource.length === 0,\n lastCard: this.props.dataSource.length === 1\n };\n this.setPanresponder();\n }\n\n componentDidUpdate({ dataSource }) {\n if (dataSource.length !== this.props.dataSource.length) {\n if (dataSource.length <= 1) {\n this.setState({\n ...this.state,\n selectedItem: dataSource[0],\n selectedItem2: undefined,\n disabled: dataSource.length === 0,\n lastCard: dataSource.length === 1\n });\n return;\n }\n\n const visibleIndex = dataSource.indexOf(this.state.selectedItem);\n const currentIndex = visibleIndex < 0 ? visibleIndex + 1 : visibleIndex;\n const nextIndex =\n currentIndex + 1 === dataSource.length ? 0 : currentIndex + 1;\n\n this.setState({\n selectedItem: dataSource[currentIndex],\n selectedItem2: dataSource[nextIndex]\n });\n }\n }\n\n getInitialStyle = () => {\n return {\n topCard: {\n position: 'absolute',\n top: 0,\n right: 0,\n left: 0\n }\n };\n };\n\n getCardStyles() {\n const { pan, enter } = this.state;\n\n const [translateX, translateY] = [pan.x, pan.y];\n // let [translateX, translateY] = [pan2.x, pan2.y];\n\n const rotate = pan.x.interpolate({\n inputRange: [-700, 0, 700],\n outputRange: ['-10deg', '0deg', '10deg']\n });\n\n const opacity = pan.x.interpolate({\n inputRange: [-320, 0, 320],\n outputRange: [0.9, 1, 0.9]\n });\n const scale = enter;\n\n const animatedCardStyles = {\n transform: [{ translateX }, { translateY }, { rotate }],\n opacity\n };\n const animatedCardStyles2 = { transform: [{ scale }] };\n\n return [animatedCardStyles, animatedCardStyles2];\n }\n\n setPanresponder() {\n this._panResponder = PanResponder.create({\n onMoveShouldSetResponderCapture: () => true,\n onMoveShouldSetPanResponderCapture: (evt, gestureState) =>\n Math.abs(gestureState.dx) > 5,\n\n onPanResponderGrant: () => {\n this.state.pan.setOffset({\n x: this.state.pan.x._value,\n y: this.state.pan.y._value\n });\n this.state.pan.setValue({ x: 0, y: 0 });\n },\n\n onPanResponderMove: (e, gestureState) => {\n if (gestureState.dx > 20) {\n if (this.props.onSwiping)\n this.props.onSwiping('right', gestureState.dx);\n } else if (gestureState.dx < -20) {\n if (this.props.onSwiping)\n this.props.onSwiping('left', gestureState.dx);\n }\n let val = Math.abs(gestureState.dx * 0.0013);\n if (val > 0.2) {\n val = 0.2;\n }\n Animated.timing(this.state.fadeAnim, {\n toValue: 0.8 + val,\n useNativeDriver: false\n }).start();\n Animated.spring(this.state.enter, {\n toValue: 0.8 + val,\n friction: 7,\n useNativeDriver: false\n }).start();\n Animated.event([null, { dx: this.state.pan.x }], {\n useNativeDriver: false\n })(e, gestureState);\n },\n\n onPanResponderRelease: (e, { vx, vy }) => {\n if (this.props.onSwiping) this.props.onSwiping(null);\n let velocity;\n\n if (vx >= 0) {\n velocity = clamp(vx, 4.5, 10);\n } else if (vx < 0) {\n velocity = clamp(vx * -1, 4.5, 10) * -1;\n }\n\n if (Math.abs(this.state.pan.x._value) > SWIPE_THRESHOLD) {\n if (velocity > 0) {\n this.props.onSwipeRight\n ? this.props.onSwipeRight(this.state.selectedItem)\n : undefined;\n this.selectNext();\n } else {\n this.props.onSwipeLeft\n ? this.props.onSwipeLeft(this.state.selectedItem)\n : undefined;\n this.selectNext();\n }\n\n Animated.decay(this.state.pan, {\n velocity: { x: velocity, y: vy },\n deceleration: 0.98,\n useNativeDriver: false\n }).start(this._resetState.bind(this));\n } else {\n Animated.spring(this.state.pan, {\n toValue: { x: 0, y: 0 },\n friction: 4,\n useNativeDriver: false\n }).start();\n }\n }\n });\n }\n\n _resetState() {\n this.state.pan.setValue({ x: 0, y: 0 });\n this.state.enter.setValue(0.8);\n this.state.fadeAnim.setValue(0.8);\n this.setState({\n card1Top: !this.state.card1Top,\n card2Top: !this.state.card2Top\n });\n if (this.props.onSwiping) this.props.onSwiping(null);\n }\n\n swipeRight() {\n if (this.props.onSwiping) this.props.onSwiping('right');\n setTimeout(() => {\n Animated.timing(this.state.fadeAnim, {\n toValue: 1,\n useNativeDriver: false\n }).start();\n Animated.spring(this.state.enter, {\n toValue: 1,\n friction: 7,\n useNativeDriver: false\n }).start();\n this.selectNext();\n Animated.decay(this.state.pan, {\n velocity: { x: 8, y: 1 },\n deceleration: 0.98,\n useNativeDriver: false\n }).start(this._resetState.bind(this));\n }, 300);\n }\n\n swipeLeft() {\n if (this.props.onSwiping) this.props.onSwiping('left');\n setTimeout(() => {\n Animated.timing(this.state.fadeAnim, {\n toValue: 1,\n useNativeDriver: false\n }).start();\n Animated.spring(this.state.enter, {\n toValue: 1,\n friction: 7,\n useNativeDriver: false\n }).start();\n this.selectNext();\n Animated.decay(this.state.pan, {\n velocity: { x: -8, y: 1 },\n deceleration: 0.98,\n userNativeDriver: false\n }).start(this._resetState.bind(this));\n }, 300);\n }\n\n selectNext() {\n const dataSource = this.props.dataSource;\n const currentIndex = dataSource.indexOf(this.state.selectedItem);\n\n // if not looping, check for these conditionals and if true return from selectNext()\n if (!this.state.looping) {\n // reached end -> only display static renderEmpty() -> no swiping\n if (currentIndex === dataSource.length - 1) {\n return this.setState({\n disabled: true\n });\n } else if (currentIndex === dataSource.length - 2) {\n // show last card with renderEmpty() component behind it\n return setTimeout(() => {\n this.setState({\n selectedItem: dataSource[currentIndex + 1]\n });\n setTimeout(() => {\n this.setState({\n lastCard: true\n });\n }, 350);\n }, 50);\n }\n }\n\n const nextIndexes = this.findNextIndexes(currentIndex);\n setTimeout(() => {\n this.setState({\n selectedItem: this.props.dataSource[nextIndexes[0]]\n });\n setTimeout(() => {\n this.setState({\n selectedItem2: this.props.dataSource[nextIndexes[1]]\n });\n }, 350);\n }, 50);\n\n return null;\n }\n\n findNextIndexes(currentIndex) {\n const newIdx = currentIndex + 1;\n const newIdx2 = currentIndex + 2;\n\n if (\n newIdx2 > this.props.dataSource.length - 1 &&\n newIdx === this.props.dataSource.length - 1\n ) {\n return [newIdx, 0];\n } else if (newIdx > this.props.dataSource.length - 1) {\n return [0, 1];\n }\n return [newIdx, newIdx2];\n }\n\n render() {\n if (this.state.disabled) {\n // disable swiping and renderEmpty\n return (\n \n {{this.props.renderEmpty && this.props.renderEmpty()}}\n \n );\n } else if (this.state.lastCard) {\n // display renderEmpty underneath last viable card\n return (\n \n {this.state.selectedItem === undefined ? (\n \n ) : (\n \n \n {this.props.renderEmpty && this.props.renderEmpty()}\n \n \n {this.props.renderItem(this.state.selectedItem)}\n \n \n )}\n \n );\n }\n return (\n \n {this.state.selectedItem === undefined ? (\n \n ) : (\n \n \n {this.props.renderBottom\n ? this.props.renderBottom(this.state.selectedItem2)\n : this.props.renderItem(this.state.selectedItem2)}\n \n \n {this.props.renderTop\n ? this.props.renderTop(this.state.selectedItem)\n : this.props.renderItem(this.state.selectedItem)}\n \n \n )}\n \n );\n }\n}\n\nDeckSwiper.propTypes = {\n ...ViewPropTypes,\n style: PropTypes.oneOfType([\n PropTypes.object,\n PropTypes.number,\n PropTypes.array\n ]),\n // eslint-disable-next-line react/forbid-prop-types\n dataSource: PropTypes.array\n};\n\nconst StyledDeckSwiper = connectStyle(\n 'NativeBase.DeckSwiper',\n {},\n mapPropsToStyleNames\n)(DeckSwiper);\n\nexport { StyledDeckSwiper as DeckSwiper };\n"]} \ No newline at end of file diff --git a/dist/src/basic/Footer.js b/dist/src/basic/Footer.js index 870e006d1..041ae2d6e 100644 --- a/dist/src/basic/Footer.js +++ b/dist/src/basic/Footer.js @@ -1,2 +1,2 @@ -Object.defineProperty(exports,"__esModule",{value:true});exports.Footer=undefined;var _extends=Object.assign||function(target){for(var i=1;i\n (this._root = c)} {...this.props} />\n \n );\n }\n}\n\nFooter.propTypes = {\n ...ViewPropTypes,\n style: PropTypes.oneOfType([\n PropTypes.object,\n PropTypes.number,\n PropTypes.array\n ])\n};\n\nconst StyledFooter = connectStyle(\n 'NativeBase.Footer',\n {},\n mapPropsToStyleNames\n)(Footer);\nexport { StyledFooter as Footer };\n"]} \ No newline at end of file +{"version":3,"sources":["../../../src/basic/Footer.js"],"names":["Footer","style","props","backgroundColor","_root","c","Component","contextTypes","theme","PropTypes","object","propTypes","ViewPropTypes","oneOfType","number","array","StyledFooter","mapPropsToStyleNames"],"mappings":"u1BAAA,4B,2CACA,qC,mDACA,yCACA,kFACA,iEAEA,mE,yEACA,2C,q7BAEMA,O,6QAKK,oBACCC,MADD,CACW,KAAKC,KADhB,CACCD,KADD,CAGP,MACE,+BAAC,yBAAD,EACE,MAAO,CACLE,gBAAiB,uBAASF,KAAT,EAAgBE,eAD5B,CADT,iDAKE,8BAAC,iBAAD,WAAM,IAAK,sBAAM,QAAKC,KAAL,CAAaC,CAAnB,EAAX,EAAsC,KAAKH,KAA3C,mDALF,CADF,CASD,C,oBAjBkBI,gB,EAAfN,M,CACGO,Y,CAAe,CACpBC,MAAOC,oBAAUC,MADG,C,CAmBxBV,OAAOW,SAAP,aACKC,6CADL,EAEEX,MAAOQ,oBAAUI,SAAV,CAAoB,CACzBJ,oBAAUC,MADe,CAEzBD,oBAAUK,MAFe,CAGzBL,oBAAUM,KAHe,CAApB,CAFT,GASA,GAAMC,cAAe,yCACnB,mBADmB,CAEnB,EAFmB,CAGnBC,8BAHmB,EAInBjB,MAJmB,CAArB,C,QAKyBA,M,CAAhBgB,Y","file":"Footer.js","sourcesContent":["import React, { Component } from 'react';\nimport PropTypes from 'prop-types';\nimport { View, SafeAreaView } from 'react-native';\nimport { ViewPropTypes } from 'deprecated-react-native-prop-types';\nimport { connectStyle } from 'native-base-shoutem-theme';\n\nimport mapPropsToStyleNames from '../utils/mapPropsToStyleNames';\nimport getStyle from '../utils/getStyle';\n\nclass Footer extends Component {\n static contextTypes = {\n theme: PropTypes.object\n };\n\n render() {\n const { style } = this.props;\n\n return (\n \n (this._root = c)} {...this.props} />\n \n );\n }\n}\n\nFooter.propTypes = {\n ...ViewPropTypes,\n style: PropTypes.oneOfType([\n PropTypes.object,\n PropTypes.number,\n PropTypes.array\n ])\n};\n\nconst StyledFooter = connectStyle(\n 'NativeBase.Footer',\n {},\n mapPropsToStyleNames\n)(Footer);\nexport { StyledFooter as Footer };\n"]} \ No newline at end of file diff --git a/dist/src/basic/FooterTab.js b/dist/src/basic/FooterTab.js index 21a56affd..4de511bd5 100644 --- a/dist/src/basic/FooterTab.js +++ b/dist/src/basic/FooterTab.js @@ -1,2 +1,2 @@ -Object.defineProperty(exports,"__esModule",{value:true});exports.FooterTab=undefined;var _extends=Object.assign||function(target){for(var i=1;i (this._root = c)} {...this.props}>\n {this.props.children}\n \n );\n }\n}\n\nFooterTab.propTypes = {\n ...ViewPropTypes,\n style: PropTypes.oneOfType([\n PropTypes.object,\n PropTypes.number,\n PropTypes.array\n ])\n};\n\nconst StyledFooterTab = connectStyle(\n 'NativeBase.FooterTab',\n {},\n mapPropsToStyleNames\n)(FooterTab);\n\nexport { StyledFooterTab as FooterTab };\n"]} \ No newline at end of file +{"version":3,"sources":["../../../src/basic/FooterTab.js"],"names":["FooterTab","_root","c","props","children","Component","propTypes","ViewPropTypes","style","PropTypes","oneOfType","object","number","array","StyledFooterTab","mapPropsToStyleNames"],"mappings":"61BAAA,4B,2CACA,qC,mDACA,yCACA,kFACA,iEAEA,mE,68BAEMA,U,+RACK,iBACP,MACE,+BAAC,iBAAD,WAAM,IAAK,sBAAM,QAAKC,KAAL,CAAaC,CAAnB,EAAX,EAAsC,KAAKC,KAA3C,mDACG,KAAKA,KAAL,CAAWC,QADd,CADF,CAKD,C,uBAPqBC,gB,EAUxBL,UAAUM,SAAV,aACKC,6CADL,EAEEC,MAAOC,oBAAUC,SAAV,CAAoB,CACzBD,oBAAUE,MADe,CAEzBF,oBAAUG,MAFe,CAGzBH,oBAAUI,KAHe,CAApB,CAFT,GASA,GAAMC,iBAAkB,yCACtB,sBADsB,CAEtB,EAFsB,CAGtBC,8BAHsB,EAItBf,SAJsB,CAAxB,C,QAM4BA,S,CAAnBc,e","file":"FooterTab.js","sourcesContent":["import React, { Component } from 'react';\nimport PropTypes from 'prop-types';\nimport { View } from 'react-native';\nimport { ViewPropTypes } from 'deprecated-react-native-prop-types';\nimport { connectStyle } from 'native-base-shoutem-theme';\n\nimport mapPropsToStyleNames from '../utils/mapPropsToStyleNames';\n\nclass FooterTab extends Component {\n render() {\n return (\n (this._root = c)} {...this.props}>\n {this.props.children}\n \n );\n }\n}\n\nFooterTab.propTypes = {\n ...ViewPropTypes,\n style: PropTypes.oneOfType([\n PropTypes.object,\n PropTypes.number,\n PropTypes.array\n ])\n};\n\nconst StyledFooterTab = connectStyle(\n 'NativeBase.FooterTab',\n {},\n mapPropsToStyleNames\n)(FooterTab);\n\nexport { StyledFooterTab as FooterTab };\n"]} \ No newline at end of file diff --git a/dist/src/basic/Form.js b/dist/src/basic/Form.js index 63c2fbe4a..832a74809 100644 --- a/dist/src/basic/Form.js +++ b/dist/src/basic/Form.js @@ -1,2 +1,2 @@ -Object.defineProperty(exports,"__esModule",{value:true});exports.Form=undefined;var _extends=Object.assign||function(target){for(var i=1;i (this._root = c)} {...this.props} />;\n }\n}\n\nForm.propTypes = {\n ...ViewPropTypes,\n style: PropTypes.oneOfType([\n PropTypes.object,\n PropTypes.number,\n PropTypes.array\n ])\n};\n\nconst StyledForm = connectStyle('NativeBase.Form', {}, mapPropsToStyleNames)(\n Form\n);\n\nexport { StyledForm as Form };\n"]} \ No newline at end of file +{"version":3,"sources":["../../../src/basic/Form.js"],"names":["Form","_root","c","props","Component","propTypes","ViewPropTypes","style","PropTypes","oneOfType","object","number","array","StyledForm","mapPropsToStyleNames"],"mappings":"m1BAAA,4B,2CACA,qC,mDACA,yCACA,kFACA,iEAEA,mE,68BAEMA,K,iQACK,iBACP,MAAO,+BAAC,iBAAD,WAAM,IAAK,sBAAM,QAAKC,KAAL,CAAaC,CAAnB,EAAX,EAAsC,KAAKC,KAA3C,mDAAP,CACD,C,kBAHgBC,gB,EAMnBJ,KAAKK,SAAL,aACKC,6CADL,EAEEC,MAAOC,oBAAUC,SAAV,CAAoB,CACzBD,oBAAUE,MADe,CAEzBF,oBAAUG,MAFe,CAGzBH,oBAAUI,KAHe,CAApB,CAFT,GASA,GAAMC,YAAa,yCACjB,iBADiB,CAEjB,EAFiB,CAGjBC,8BAHiB,EAIjBd,IAJiB,CAAnB,C,QAMuBA,I,CAAda,U","file":"Form.js","sourcesContent":["import React, { Component } from 'react';\nimport PropTypes from 'prop-types';\nimport { View } from 'react-native';\nimport { ViewPropTypes } from 'deprecated-react-native-prop-types';\nimport { connectStyle } from 'native-base-shoutem-theme';\n\nimport mapPropsToStyleNames from '../utils/mapPropsToStyleNames';\n\nclass Form extends Component {\n render() {\n return (this._root = c)} {...this.props} />;\n }\n}\n\nForm.propTypes = {\n ...ViewPropTypes,\n style: PropTypes.oneOfType([\n PropTypes.object,\n PropTypes.number,\n PropTypes.array\n ])\n};\n\nconst StyledForm = connectStyle(\n 'NativeBase.Form',\n {},\n mapPropsToStyleNames\n)(Form);\n\nexport { StyledForm as Form };\n"]} \ No newline at end of file diff --git a/dist/src/basic/Gravatar.js b/dist/src/basic/Gravatar.js index 3ebc2c5ad..c218e7922 100644 --- a/dist/src/basic/Gravatar.js +++ b/dist/src/basic/Gravatar.js @@ -1,2 +1,2 @@ -Object.defineProperty(exports,"__esModule",{value:true});exports.Gravatar=undefined;var _extends=Object.assign||function(target){for(var i=1;i (this._root = c)} {...props} source={{ uri }} />;\n }\n}\n\nGravatar.propTypes = {\n ...Image.propTypes,\n email: PropTypes.string.isRequired,\n style: PropTypes.oneOfType([\n PropTypes.object,\n PropTypes.number,\n PropTypes.array\n ]),\n size: PropTypes.number,\n circular: PropTypes.bool,\n square: PropTypes.bool\n};\n\nconst StyledGravatar = connectStyle(\n 'NativeBase.Gravatar',\n {},\n mapPropsToStyleNames\n)(Gravatar);\nexport { StyledGravatar as Gravatar };\n"]} \ No newline at end of file +{"version":3,"sources":["../../../src/basic/Gravatar.js"],"names":["GRAVATAR_URI","Gravatar","gravatar","borderRadius","props","size","width","height","resizeMode","contain","undefined","gravatarStyle","circular","square","defaultProps","style","_","merge","getInitialStyle","prepareRootProps","uri","email","_root","c","NativeBaseComponent","propTypes","ImagePropTypes","PropTypes","string","isRequired","oneOfType","object","number","array","bool","StyledGravatar","mapPropsToStyleNames"],"mappings":"21BAAA,4B,2CACA,qC,mDACA,y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AL,CAAWiB,KAAf,CAAxB,OACJjB,MAAMW,KAAN,CAAYR,MADd,CAGA,MAAO,+BAAC,kBAAD,WAAO,IAAK,sBAAM,QAAKe,KAAL,CAAaC,CAAnB,EAAZ,EAAuCnB,KAAvC,EAA8C,OAAQ,CAAEgB,OAAF,CAAtD,kDAAP,CACD,C,sBAtCoBI,6B,EAyCvBvB,SAASwB,SAAT,aACKC,8CADL,EAEEL,MAAOM,oBAAUC,MAAV,CAAiBC,UAF1B,CAGEd,MAAOY,oBAAUG,SAAV,CAAoB,CACzBH,oBAAUI,MADe,CAEzBJ,oBAAUK,MAFe,CAGzBL,oBAAUM,KAHe,CAApB,CAHT,CAQE5B,KAAMsB,oBAAUK,MARlB,CASEpB,SAAUe,oBAAUO,IATtB,CAUErB,OAAQc,oBAAUO,IAVpB,GAaA,GAAMC,gBAAiB,yCACrB,qBADqB,CAErB,EAFqB,CAGrBC,8BAHqB,EAIrBnC,QAJqB,CAAvB,C,QAK2BA,Q,CAAlBkC,c","file":"Gravatar.js","sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport { Image } from 'react-native';\nimport { ImagePropTypes } from 'deprecated-react-native-prop-types';\nimport { connectStyle } from 'native-base-shoutem-theme';\nimport _ from 'lodash';\nimport md5 from 'blueimp-md5';\n\nimport mapPropsToStyleNames from '../utils/mapPropsToStyleNames';\nimport computeProps from '../utils/computeProps';\n\nimport NativeBaseComponent from './Base/NativeBaseComponent';\n\nconst GRAVATAR_URI = 'https://www.gravatar.com/avatar/';\n\nclass Gravatar extends NativeBaseComponent {\n getInitialStyle() {\n return {\n gravatar: {\n borderRadius: this.props.size ? this.props.size / 2 : 15,\n width: this.props.size ? this.props.size : 30,\n height: this.props.size ? this.props.size : 30,\n resizeMode: this.props.contain ? 'contain' : undefined\n }\n };\n }\n\n prepareRootProps() {\n const gravatarStyle = {};\n if (this.props.circular) {\n gravatarStyle.width = this.props.size;\n gravatarStyle.height = this.props.size;\n gravatarStyle.borderRadius = this.props.size / 2;\n } else if (this.props.square) {\n gravatarStyle.width = this.props.size;\n gravatarStyle.height = this.props.size;\n gravatarStyle.borderRadius = 0;\n }\n\n const defaultProps = {\n style: _.merge(this.getInitialStyle().gravatar, gravatarStyle)\n };\n\n return computeProps(this.props, defaultProps);\n }\n\n render() {\n const props = this.prepareRootProps();\n\n const uri = `${GRAVATAR_URI + md5(this.props.email)}?s=${\n props.style.height\n }`;\n return (this._root = c)} {...props} source={{ uri }} />;\n }\n}\n\nGravatar.propTypes = {\n ...ImagePropTypes,\n email: PropTypes.string.isRequired,\n style: PropTypes.oneOfType([\n PropTypes.object,\n PropTypes.number,\n PropTypes.array\n ]),\n size: PropTypes.number,\n circular: PropTypes.bool,\n square: PropTypes.bool\n};\n\nconst StyledGravatar = connectStyle(\n 'NativeBase.Gravatar',\n {},\n mapPropsToStyleNames\n)(Gravatar);\nexport { StyledGravatar as Gravatar };\n"]} \ No newline at end of file diff --git a/dist/src/basic/H1.js b/dist/src/basic/H1.js index d05461284..1fde9d0cb 100644 --- a/dist/src/basic/H1.js +++ b/dist/src/basic/H1.js @@ -1,2 +1,2 @@ -Object.defineProperty(exports,"__esModule",{value:true});exports.H1=undefined;var _extends=Object.assign||function(target){for(var i=1;i (this._root = c)} {...this.props} />;\n }\n}\n\nconst childrenType = function(props, propName, component) {\n let error;\n const prop = props[propName];\n React.Children.forEach(prop, child => {\n if (typeof child !== 'string' && typeof child !== 'number') {\n error = new Error(`${component} should have only string or number`);\n }\n });\n return error;\n};\n\nH1.propTypes = {\n ...Text.propTypes,\n children: childrenType,\n style: PropTypes.oneOfType([\n PropTypes.object,\n PropTypes.number,\n PropTypes.array\n ])\n};\n\nconst StyledH1 = connectStyle('NativeBase.H1', {}, mapPropsToStyleNames)(H1);\n\nexport { StyledH1 as H1 };\n"]} \ No newline at end of file +{"version":3,"sources":["../../../src/basic/H1.js"],"names":["H1","_root","c","props","Component","childrenType","propName","component","error","prop","React","Children","forEach","child","Error","propTypes","TextPropTypes","children","style","PropTypes","oneOfType","object","number","array","StyledH1","mapPropsToStyleNames"],"mappings":"+0BAAA,4B,2CACA,qC,mDACA,yCACA,kFACA,iEAEA,mE,68BAEMA,G,qPACK,iBACP,MAAO,+BAAC,iBAAD,WAAM,IAAK,sBAAM,QAAKC,KAAL,CAAaC,CAAnB,EAAX,EAAsC,KAAKC,KAA3C,mDAAP,CACD,C,gBAHcC,gB,EAMjB,GAAMC,cAAe,QAAfA,aAAe,CAASF,KAAT,CAAgBG,QAAhB,CAA0BC,SAA1B,CAAqC,CACxD,GAAIC,aAAJ,CACA,GAAMC,MAAON,MAAMG,QAAN,CAAb,CACAI,gBAAMC,QAAN,CAAeC,OAAf,CAAuBH,IAAvB,CAA6B,eAAS,CACpC,GAAI,MAAOI,MAAP,GAAiB,QAAjB,EAA6B,MAAOA,MAAP,GAAiB,QAAlD,CAA4D,CAC1DL,MAAQ,GAAIM,MAAJ,CAAaP,SAAb,sCAAR,CACD,CACF,CAJD,EAKA,MAAOC,MAAP,CACD,CATD,CAWAR,GAAGe,SAAH,aACKC,6CADL,EAEEC,SAAUZ,YAFZ,CAGEa,MAAOC,oBAAUC,SAAV,CAAoB,CACzBD,oBAAUE,MADe,CAEzBF,oBAAUG,MAFe,CAGzBH,oBAAUI,KAHe,CAApB,CAHT,GAUA,GAAMC,UAAW,yCAAa,eAAb,CAA8B,EAA9B,CAAkCC,8BAAlC,EAAwDzB,EAAxD,CAAjB,C,QAEqBA,E,CAAZwB,Q","file":"H1.js","sourcesContent":["import React, { Component } from 'react';\nimport PropTypes from 'prop-types';\nimport { Text } from 'react-native';\nimport { TextPropTypes } from 'deprecated-react-native-prop-types';\nimport { connectStyle } from 'native-base-shoutem-theme';\n\nimport mapPropsToStyleNames from '../utils/mapPropsToStyleNames';\n\nclass H1 extends Component {\n render() {\n return (this._root = c)} {...this.props} />;\n }\n}\n\nconst childrenType = function(props, propName, component) {\n let error;\n const prop = props[propName];\n React.Children.forEach(prop, child => {\n if (typeof child !== 'string' && typeof child !== 'number') {\n error = new Error(`${component} should have only string or number`);\n }\n });\n return error;\n};\n\nH1.propTypes = {\n ...TextPropTypes,\n children: childrenType,\n style: PropTypes.oneOfType([\n PropTypes.object,\n PropTypes.number,\n PropTypes.array\n ])\n};\n\nconst StyledH1 = connectStyle('NativeBase.H1', {}, mapPropsToStyleNames)(H1);\n\nexport { StyledH1 as H1 };\n"]} \ No newline at end of file diff --git a/dist/src/basic/H2.js b/dist/src/basic/H2.js index b9da5f102..6c4c94dca 100644 --- a/dist/src/basic/H2.js +++ b/dist/src/basic/H2.js @@ -1,2 +1,2 @@ -Object.defineProperty(exports,"__esModule",{value:true});exports.H2=undefined;var _extends=Object.assign||function(target){for(var i=1;i (this._root = c)} {...this.props} />;\n }\n}\nconst childrenType = function(props, propName, component) {\n let error;\n const prop = props[propName];\n React.Children.forEach(prop, child => {\n if (typeof child !== 'string' && typeof child !== 'number') {\n error = new Error(`${component} should have only string or number`);\n }\n });\n return error;\n};\n\nH2.propTypes = {\n ...Text.propTypes,\n children: childrenType,\n style: PropTypes.oneOfType([\n PropTypes.object,\n PropTypes.number,\n PropTypes.array\n ])\n};\n\nconst StyledH2 = connectStyle('NativeBase.H2', {}, mapPropsToStyleNames)(H2);\n\nexport { StyledH2 as H2 };\n"]} \ No newline at end of file +{"version":3,"sources":["../../../src/basic/H2.js"],"names":["H2","_root","c","props","Component","childrenType","propName","component","error","prop","React","Children","forEach","child","Error","propTypes","TextPropTypes","children","style","PropTypes","oneOfType","object","number","array","StyledH2","mapPropsToStyleNames"],"mappings":"+0BAAA,4B,2CACA,qC,mDACA,yCACA,kFACA,iEAEA,mE,68BAEMA,G,qPACK,iBACP,MAAO,+BAAC,iBAAD,WAAM,IAAK,sBAAM,QAAKC,KAAL,CAAaC,CAAnB,EAAX,EAAsC,KAAKC,KAA3C,mDAAP,CACD,C,gBAHcC,gB,EAKjB,GAAMC,cAAe,QAAfA,aAAe,CAASF,KAAT,CAAgBG,QAAhB,CAA0BC,SAA1B,CAAqC,CACxD,GAAIC,aAAJ,CACA,GAAMC,MAAON,MAAMG,QAAN,CAAb,CACAI,gBAAMC,QAAN,CAAeC,OAAf,CAAuBH,IAAvB,CAA6B,eAAS,CACpC,GAAI,MAAOI,MAAP,GAAiB,QAAjB,EAA6B,MAAOA,MAAP,GAAiB,QAAlD,CAA4D,CAC1DL,MAAQ,GAAIM,MAAJ,CAAaP,SAAb,sCAAR,CACD,CACF,CAJD,EAKA,MAAOC,MAAP,CACD,CATD,CAWAR,GAAGe,SAAH,aACKC,6CADL,EAEEC,SAAUZ,YAFZ,CAGEa,MAAOC,oBAAUC,SAAV,CAAoB,CACzBD,oBAAUE,MADe,CAEzBF,oBAAUG,MAFe,CAGzBH,oBAAUI,KAHe,CAApB,CAHT,GAUA,GAAMC,UAAW,yCAAa,eAAb,CAA8B,EAA9B,CAAkCC,8BAAlC,EAAwDzB,EAAxD,CAAjB,C,QAEqBA,E,CAAZwB,Q","file":"H2.js","sourcesContent":["import React, { Component } from 'react';\nimport PropTypes from 'prop-types';\nimport { Text } from 'react-native';\nimport { TextPropTypes } from 'deprecated-react-native-prop-types';\nimport { connectStyle } from 'native-base-shoutem-theme';\n\nimport mapPropsToStyleNames from '../utils/mapPropsToStyleNames';\n\nclass H2 extends Component {\n render() {\n return (this._root = c)} {...this.props} />;\n }\n}\nconst childrenType = function(props, propName, component) {\n let error;\n const prop = props[propName];\n React.Children.forEach(prop, child => {\n if (typeof child !== 'string' && typeof child !== 'number') {\n error = new Error(`${component} should have only string or number`);\n }\n });\n return error;\n};\n\nH2.propTypes = {\n ...TextPropTypes,\n children: childrenType,\n style: PropTypes.oneOfType([\n PropTypes.object,\n PropTypes.number,\n PropTypes.array\n ])\n};\n\nconst StyledH2 = connectStyle('NativeBase.H2', {}, mapPropsToStyleNames)(H2);\n\nexport { StyledH2 as H2 };\n"]} \ No newline at end of file diff --git a/dist/src/basic/H3.js b/dist/src/basic/H3.js index 30bfe09b8..be63ea161 100644 --- a/dist/src/basic/H3.js +++ b/dist/src/basic/H3.js @@ -1,2 +1,2 @@ -Object.defineProperty(exports,"__esModule",{value:true});exports.H3=undefined;var _extends=Object.assign||function(target){for(var i=1;i (this._root = c)} {...this.props} />;\n }\n}\n\nconst childrenType = function(props, propName, component) {\n let error;\n const prop = props[propName];\n React.Children.forEach(prop, child => {\n if (typeof child !== 'string' && typeof child !== 'number') {\n error = new Error(`${component} should have only string or number`);\n }\n });\n return error;\n};\n\nH3.propTypes = {\n ...Text.propTypes,\n children: childrenType,\n style: PropTypes.oneOfType([\n PropTypes.object,\n PropTypes.number,\n PropTypes.array\n ])\n};\n\nconst StyledH3 = connectStyle('NativeBase.H3', {}, mapPropsToStyleNames)(H3);\n\nexport { StyledH3 as H3 };\n"]} \ No newline at end of file +{"version":3,"sources":["../../../src/basic/H3.js"],"names":["H3","_root","c","props","Component","childrenType","propName","component","error","prop","React","Children","forEach","child","Error","propTypes","TextPropTypes","children","style","PropTypes","oneOfType","object","number","array","StyledH3","mapPropsToStyleNames"],"mappings":"+0BAAA,4B,2CACA,qC,mDACA,yCACA,kFACA,iEAEA,mE,68BAEMA,G,qPACK,iBACP,MAAO,+BAAC,iBAAD,WAAM,IAAK,sBAAM,QAAKC,KAAL,CAAaC,CAAnB,EAAX,EAAsC,KAAKC,KAA3C,mDAAP,CACD,C,gBAHcC,gB,EAMjB,GAAMC,cAAe,QAAfA,aAAe,CAASF,KAAT,CAAgBG,QAAhB,CAA0BC,SAA1B,CAAqC,CACxD,GAAIC,aAAJ,CACA,GAAMC,MAAON,MAAMG,QAAN,CAAb,CACAI,gBAAMC,QAAN,CAAeC,OAAf,CAAuBH,IAAvB,CAA6B,eAAS,CACpC,GAAI,MAAOI,MAAP,GAAiB,QAAjB,EAA6B,MAAOA,MAAP,GAAiB,QAAlD,CAA4D,CAC1DL,MAAQ,GAAIM,MAAJ,CAAaP,SAAb,sCAAR,CACD,CACF,CAJD,EAKA,MAAOC,MAAP,CACD,CATD,CAWAR,GAAGe,SAAH,aACKC,6CADL,EAEEC,SAAUZ,YAFZ,CAGEa,MAAOC,oBAAUC,SAAV,CAAoB,CACzBD,oBAAUE,MADe,CAEzBF,oBAAUG,MAFe,CAGzBH,oBAAUI,KAHe,CAApB,CAHT,GAUA,GAAMC,UAAW,yCAAa,eAAb,CAA8B,EAA9B,CAAkCC,8BAAlC,EAAwDzB,EAAxD,CAAjB,C,QAEqBA,E,CAAZwB,Q","file":"H3.js","sourcesContent":["import React, { Component } from 'react';\nimport PropTypes from 'prop-types';\nimport { Text } from 'react-native';\nimport { TextPropTypes } from 'deprecated-react-native-prop-types';\nimport { connectStyle } from 'native-base-shoutem-theme';\n\nimport mapPropsToStyleNames from '../utils/mapPropsToStyleNames';\n\nclass H3 extends Component {\n render() {\n return (this._root = c)} {...this.props} />;\n }\n}\n\nconst childrenType = function(props, propName, component) {\n let error;\n const prop = props[propName];\n React.Children.forEach(prop, child => {\n if (typeof child !== 'string' && typeof child !== 'number') {\n error = new Error(`${component} should have only string or number`);\n }\n });\n return error;\n};\n\nH3.propTypes = {\n ...TextPropTypes,\n children: childrenType,\n style: PropTypes.oneOfType([\n PropTypes.object,\n PropTypes.number,\n PropTypes.array\n ])\n};\n\nconst StyledH3 = connectStyle('NativeBase.H3', {}, mapPropsToStyleNames)(H3);\n\nexport { StyledH3 as H3 };\n"]} \ No newline at end of file diff --git a/dist/src/basic/Header.js b/dist/src/basic/Header.js index efec5600a..a9b5ead97 100644 --- a/dist/src/basic/Header.js +++ b/dist/src/basic/Header.js @@ -1,2 +1,2 @@ -Object.defineProperty(exports,"__esModule",{value:true});exports.Header=undefined;var _extends=Object.assign||function(target){for(var i=1;i\n \n \n (this._root = c)} {...this.props} />\n \n \n );\n }\n}\n\nHeader.propTypes = {\n ...ViewPropTypes,\n style: PropTypes.oneOfType([\n PropTypes.object,\n PropTypes.number,\n PropTypes.array\n ]),\n searchBar: PropTypes.bool,\n rounded: PropTypes.bool\n};\n\nconst StyledHeader = connectStyle(\n 'NativeBase.Header',\n {},\n mapPropsToStyleNames\n)(Header);\nexport { StyledHeader as Header };\n"]} \ No newline at end of file +{"version":3,"sources":["../../../src/basic/Header.js"],"names":["Header","props","androidStatusBarColor","iosBarStyle","style","transparent","translucent","variables","context","theme","variable","platformStyle","statusBarColor","iosStatusbar","backgroundColor","_root","c","Component","contextTypes","PropTypes","object","propTypes","ViewPropTypes","oneOfType","number","array","searchBar","bool","rounded","StyledHeader","mapPropsToStyleNames"],"mappings":"u1BAEA,iEACA,qC,mDACA,4B,2CACA,yCACA,kFAEA,mE,yEACA,2C,iDACA,qD,q7BAEMA,O,6QAKK,4BAOH,KAAKC,KAPF,CAELC,qBAFK,QAELA,qBAFK,CAGLC,WAHK,QAGLA,WAHK,CAILC,KAJK,QAILA,KAJK,CAKLC,WALK,QAKLA,WALK,CAMLC,WANK,QAMLA,WANK,CASP,GAAMC,WAAY,KAAKC,OAAL,CAAaC,KAAb,CACd,KAAKD,OAAL,CAAaC,KAAb,CAAmB,4BAAnB,EAAiDF,SADnC,CAEdG,kBAFJ,CAIA,GAAMC,eAAgBJ,UAAUI,aAAhC,CAEA,MACE,+BAAC,iBAAD,kDACE,8BAAC,sBAAD,EACE,gBACET,sBACIA,qBADJ,CAEIK,UAAUK,cAJlB,CAME,SACET,YACIA,WADJ,CAEIQ,gBAAkB,UAAlB,CACA,eADA,CAEAJ,UAAUM,YAXlB,CAaE,YAAaR,YAAc,IAAd,CAAqBC,WAbpC,iDADF,CAgBE,8BAAC,yBAAD,EACE,MAAO,CACLQ,gBAAiB,uBAASV,KAAT,EAAgBU,eAD5B,CADT,iDAKE,8BAAC,iBAAD,WAAM,IAAK,sBAAM,QAAKC,KAAL,CAAaC,CAAnB,EAAX,EAAsC,KAAKf,KAA3C,mDALF,CAhBF,CADF,CA0BD,C,oBA9CkBgB,gB,EAAfjB,M,CACGkB,Y,CAAe,CACpBT,MAAOU,oBAAUC,MADG,C,CAgDxBpB,OAAOqB,SAAP,aACKC,6CADL,EAEElB,MAAOe,oBAAUI,SAAV,CAAoB,CACzBJ,oBAAUC,MADe,CAEzBD,oBAAUK,MAFe,CAGzBL,oBAAUM,KAHe,CAApB,CAFT,CAOEC,UAAWP,oBAAUQ,IAPvB,CAQEC,QAAST,oBAAUQ,IARrB,GAWA,GAAME,cAAe,yCACnB,mBADmB,CAEnB,EAFmB,CAGnBC,8BAHmB,EAInB9B,MAJmB,CAArB,C,QAKyBA,M,CAAhB6B,Y","file":"Header.js","sourcesContent":["/* eslint-disable no-nested-ternary */\n/* eslint-disable no-unneeded-ternary */\nimport { connectStyle } from 'native-base-shoutem-theme';\nimport PropTypes from 'prop-types';\nimport React, { Component } from 'react';\nimport { View, StatusBar, SafeAreaView } from 'react-native';\nimport { ViewPropTypes } from 'deprecated-react-native-prop-types';\n\nimport mapPropsToStyleNames from '../utils/mapPropsToStyleNames';\nimport getStyle from '../utils/getStyle';\nimport variable from '../theme/variables/platform';\n\nclass Header extends Component {\n static contextTypes = {\n theme: PropTypes.object\n };\n\n render() {\n const {\n androidStatusBarColor,\n iosBarStyle,\n style,\n transparent,\n translucent\n } = this.props;\n\n const variables = this.context.theme\n ? this.context.theme['@@shoutem.theme/themeStyle'].variables\n : variable;\n\n const platformStyle = variables.platformStyle;\n\n return (\n \n \n \n (this._root = c)} {...this.props} />\n \n \n );\n }\n}\n\nHeader.propTypes = {\n ...ViewPropTypes,\n style: PropTypes.oneOfType([\n PropTypes.object,\n PropTypes.number,\n PropTypes.array\n ]),\n searchBar: PropTypes.bool,\n rounded: PropTypes.bool\n};\n\nconst StyledHeader = connectStyle(\n 'NativeBase.Header',\n {},\n mapPropsToStyleNames\n)(Header);\nexport { StyledHeader as Header };\n"]} \ No newline at end of file diff --git a/dist/src/basic/Input.js b/dist/src/basic/Input.js index cbe65c228..c3108c1bb 100644 --- a/dist/src/basic/Input.js +++ b/dist/src/basic/Input.js @@ -1,2 +1,2 @@ -Object.defineProperty(exports,"__esModule",{value:true});exports.Input=undefined;var _extends=Object.assign||function(target){for(var i=1;i {\n this._textInput = c;\n this._root = c;\n }}\n editable={!this.props.disabled}\n underlineColorAndroid=\"rgba(0,0,0,0)\"\n placeholderTextColor={\n this.props.placeholderTextColor\n ? this.props.placeholderTextColor\n : variables.inputColorPlaceholder\n }\n {...this.props}\n />\n );\n }\n}\n\nInput.propTypes = {\n ...TextInput.propTypes,\n style: PropTypes.oneOfType([\n PropTypes.object,\n PropTypes.number,\n PropTypes.array\n ])\n};\n\nconst StyledInput = connectStyle('NativeBase.Input', {}, mapPropsToStyleNames)(\n Input\n);\n\nexport { StyledInput as Input };\n"]} \ No newline at end of file +{"version":3,"sources":["../../../src/basic/Input.js"],"names":["Input","variables","context","theme","variable","_textInput","c","_root","props","disabled","placeholderTextColor","inputColorPlaceholder","NativeBaseComponent","propTypes","TextInputPropTypes","style","PropTypes","oneOfType","object","number","array","StyledInput","mapPropsToStyleNames"],"mappings":"q1BAAA,4B,2CACA,qC,mDACA,yCACA,kFACA,iEAEA,mE,yEACA,qD,iDAEA,gE,48BAEMA,M,2RACK,iBACP,GAAMC,WAAY,KAAKC,OAAL,CAAaC,KAAb,CACd,KAAKD,OAAL,CAAaC,KAAb,CAAmB,4BAAnB,EAAiDF,SADnC,CAEdG,kBAFJ,CAGA,MACE,+BAAC,sBAAD,WACE,IAAK,eAAK,CACR,OAAKC,UAAL,CAAkBC,CAAlB,CACA,OAAKC,KAAL,CAAaD,CAAb,CACD,CAJH,CAKE,SAAU,CAAC,KAAKE,KAAL,CAAWC,QALxB,CAME,sBAAsB,eANxB,CAOE,qBACE,KAAKD,KAAL,CAAWE,oBAAX,CACI,KAAKF,KAAL,CAAWE,oBADf,CAEIT,UAAUU,qBAVlB,EAYM,KAAKH,KAZX,mDADF,CAgBD,C,mBArBiBI,6B,EAwBpBZ,MAAMa,SAAN,aACKC,kDADL,EAEEC,MAAOC,oBAAUC,SAAV,CAAoB,CACzBD,oBAAUE,MADe,CAEzBF,oBAAUG,MAFe,CAGzBH,oBAAUI,KAHe,CAApB,CAFT,GASA,GAAMC,aAAc,yCAClB,kBADkB,CAElB,EAFkB,CAGlBC,8BAHkB,EAIlBtB,KAJkB,CAApB,C,QAMwBA,K,CAAfqB,W","file":"Input.js","sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport { TextInput } from 'react-native';\nimport { TextInputPropTypes } from 'deprecated-react-native-prop-types';\nimport { connectStyle } from 'native-base-shoutem-theme';\n\nimport mapPropsToStyleNames from '../utils/mapPropsToStyleNames';\nimport variable from '../theme/variables/platform';\n\nimport NativeBaseComponent from './Base/NativeBaseComponent';\n\nclass Input extends NativeBaseComponent {\n render() {\n const variables = this.context.theme\n ? this.context.theme['@@shoutem.theme/themeStyle'].variables\n : variable;\n return (\n {\n this._textInput = c;\n this._root = c;\n }}\n editable={!this.props.disabled}\n underlineColorAndroid=\"rgba(0,0,0,0)\"\n placeholderTextColor={\n this.props.placeholderTextColor\n ? this.props.placeholderTextColor\n : variables.inputColorPlaceholder\n }\n {...this.props}\n />\n );\n }\n}\n\nInput.propTypes = {\n ...TextInputPropTypes,\n style: PropTypes.oneOfType([\n PropTypes.object,\n PropTypes.number,\n PropTypes.array\n ])\n};\n\nconst StyledInput = connectStyle(\n 'NativeBase.Input',\n {},\n mapPropsToStyleNames\n)(Input);\n\nexport { StyledInput as Input };\n"]} \ No newline at end of file diff --git a/dist/src/basic/InputGroup.js b/dist/src/basic/InputGroup.js index b59ccf5d3..a032d1200 100644 --- a/dist/src/basic/InputGroup.js +++ b/dist/src/basic/InputGroup.js @@ -1,2 +1,2 @@ -Object.defineProperty(exports,"__esModule",{value:true});exports.InputGroup=undefined;var _extends=Object.assign||function(target){for(var i=1;i (this._root = c)} {...this.prepareRootProps()}>\n {this.props.children}\n \n );\n }\n}\n\nInputGroup.propTypes = {\n ...ViewPropTypes,\n regular: PropTypes.bool,\n underline: PropTypes.bool,\n rounded: PropTypes.bool,\n success: PropTypes.bool,\n error: PropTypes.bool,\n disabled: PropTypes.bool\n};\n\nconst StyledInputGroup = connectStyle(\n 'NativeBase.InputGroup',\n {},\n mapPropsToStyleNames\n)(InputGroup);\n\nexport { StyledInputGroup as InputGroup };\n"]} \ No newline at end of file +{"version":3,"sources":["../../../src/basic/InputGroup.js"],"names":["InputGroup","roundedInputGroup","borderWidth","props","rounded","undefined","borderRadius","variables","inputGroupRoundedBorderRadius","defaultProps","style","getInitialStyle","_root","c","prepareRootProps","children","Component","propTypes","ViewPropTypes","regular","PropTypes","bool","underline","success","error","disabled","StyledInputGroup","mapPropsToStyleNames"],"mappings":"+1BAAA,4B,2CACA,qC,mDACA,yCACA,kFACA,iEAEA,qD,iDACA,mD,yDACA,mE,68BAEMA,W,uTACc,CAChB,MAAO,CACLC,kBAAmB,CACjBC,YAAa,KAAKC,KAAL,CAAWC,OAAX,CAAqB,CAArB,CAAyBC,SADrB,CAEjBC,aAAc,KAAKH,KAAL,CAAWC,OAAX,CACVG,mBAAUC,6BADA,CAEVH,SAJa,CADd,CAAP,CAQD,C,2DAEkB,CACjB,GAAMI,cAAe,CACnBC,MAAO,KAAKC,eAAL,GAAuBV,iBADX,CAArB,CAIA,MAAO,2BAAa,KAAKE,KAAlB,CAAyBM,YAAzB,CAAP,CACD,C,uCACQ,iBACP,MACE,+BAAC,iBAAD,WAAM,IAAK,sBAAM,QAAKG,KAAL,CAAaC,CAAnB,EAAX,EAAsC,KAAKC,gBAAL,EAAtC,mDACG,KAAKX,KAAL,CAAWY,QADd,CADF,CAKD,C,wBAzBsBC,gB,EA4BzBhB,WAAWiB,SAAX,aACKC,6CADL,EAEEC,QAASC,oBAAUC,IAFrB,CAGEC,UAAWF,oBAAUC,IAHvB,CAIEjB,QAASgB,oBAAUC,IAJrB,CAKEE,QAASH,oBAAUC,IALrB,CAMEG,MAAOJ,oBAAUC,IANnB,CAOEI,SAAUL,oBAAUC,IAPtB,GAUA,GAAMK,kBAAmB,yCACvB,uBADuB,CAEvB,EAFuB,CAGvBC,8BAHuB,EAIvB3B,UAJuB,CAAzB,C,QAM6BA,U,CAApB0B,gB","file":"InputGroup.js","sourcesContent":["import React, { Component } from 'react';\nimport PropTypes from 'prop-types';\nimport { View } from 'react-native';\nimport { ViewPropTypes } from 'deprecated-react-native-prop-types';\nimport { connectStyle } from 'native-base-shoutem-theme';\n\nimport variables from '../theme/variables/platform';\nimport computeProps from '../utils/computeProps';\nimport mapPropsToStyleNames from '../utils/mapPropsToStyleNames';\n\nclass InputGroup extends Component {\n getInitialStyle() {\n return {\n roundedInputGroup: {\n borderWidth: this.props.rounded ? 1 : undefined,\n borderRadius: this.props.rounded\n ? variables.inputGroupRoundedBorderRadius\n : undefined\n }\n };\n }\n\n prepareRootProps() {\n const defaultProps = {\n style: this.getInitialStyle().roundedInputGroup\n };\n\n return computeProps(this.props, defaultProps);\n }\n render() {\n return (\n (this._root = c)} {...this.prepareRootProps()}>\n {this.props.children}\n \n );\n }\n}\n\nInputGroup.propTypes = {\n ...ViewPropTypes,\n regular: PropTypes.bool,\n underline: PropTypes.bool,\n rounded: PropTypes.bool,\n success: PropTypes.bool,\n error: PropTypes.bool,\n disabled: PropTypes.bool\n};\n\nconst StyledInputGroup = connectStyle(\n 'NativeBase.InputGroup',\n {},\n mapPropsToStyleNames\n)(InputGroup);\n\nexport { StyledInputGroup as InputGroup };\n"]} \ No newline at end of file diff --git a/dist/src/basic/Label.js b/dist/src/basic/Label.js index 8998d4e39..75ab7fece 100644 --- a/dist/src/basic/Label.js +++ b/dist/src/basic/Label.js @@ -1,2 +1,2 @@ -Object.defineProperty(exports,"__esModule",{value:true});exports.Label=undefined;var _extends=Object.assign||function(target){for(var i=1;i (this._root = c)} {...this.props} />;\n }\n}\n\nLabel.propTypes = {\n ...Text.propTypes,\n style: PropTypes.oneOfType([\n PropTypes.object,\n PropTypes.number,\n PropTypes.array\n ]),\n floatBack: PropTypes.number,\n};\n\nconst StyledLabel = connectStyle('NativeBase.Label', {}, mapPropsToStyleNames)(\n Label\n);\n\nexport { StyledLabel as Label };\n"]} \ No newline at end of file +{"version":3,"sources":["../../../src/basic/Label.js"],"names":["Label","_root","c","props","Component","propTypes","TextPropTypes","style","PropTypes","oneOfType","object","number","array","floatBack","StyledLabel","mapPropsToStyleNames"],"mappings":"q1BAAA,4B,2CACA,qC,mDACA,yCACA,kFACA,iEAEA,mE,68BAEMA,M,uQACK,iBACP,MAAO,+BAAC,iBAAD,WAAM,IAAK,sBAAM,QAAKC,KAAL,CAAaC,CAAnB,EAAX,EAAsC,KAAKC,KAA3C,mDAAP,CACD,C,mBAHiBC,gB,EAMpBJ,MAAMK,SAAN,aACKC,6CADL,EAEEC,MAAOC,oBAAUC,SAAV,CAAoB,CACzBD,oBAAUE,MADe,CAEzBF,oBAAUG,MAFe,CAGzBH,oBAAUI,KAHe,CAApB,CAFT,CAOEC,UAAWL,oBAAUG,MAPvB,GAUA,GAAMG,aAAc,yCAClB,kBADkB,CAElB,EAFkB,CAGlBC,8BAHkB,EAIlBf,KAJkB,CAApB,C,QAMwBA,K,CAAfc,W","file":"Label.js","sourcesContent":["import React, { Component } from 'react';\nimport PropTypes from 'prop-types';\nimport { Text } from 'react-native';\nimport { TextPropTypes } from 'deprecated-react-native-prop-types';\nimport { connectStyle } from 'native-base-shoutem-theme';\n\nimport mapPropsToStyleNames from '../utils/mapPropsToStyleNames';\n\nclass Label extends Component {\n render() {\n return (this._root = c)} {...this.props} />;\n }\n}\n\nLabel.propTypes = {\n ...TextPropTypes,\n style: PropTypes.oneOfType([\n PropTypes.object,\n PropTypes.number,\n PropTypes.array\n ]),\n floatBack: PropTypes.number\n};\n\nconst StyledLabel = connectStyle(\n 'NativeBase.Label',\n {},\n mapPropsToStyleNames\n)(Label);\n\nexport { StyledLabel as Label };\n"]} \ No newline at end of file diff --git a/dist/src/basic/Left.js b/dist/src/basic/Left.js index 0c9219ab0..cfec95825 100644 --- a/dist/src/basic/Left.js +++ b/dist/src/basic/Left.js @@ -1,2 +1,2 @@ -Object.defineProperty(exports,"__esModule",{value:true});exports.Left=undefined;var _extends=Object.assign||function(target){for(var i=1;i (this._root = c)} {...this.props} />;\n }\n}\n\nLeft.propTypes = {\n ...ViewPropTypes,\n style: PropTypes.oneOfType([\n PropTypes.object,\n PropTypes.number,\n PropTypes.array\n ])\n};\n\nconst StyledLeft = connectStyle('NativeBase.Left', {}, mapPropsToStyleNames)(\n Left\n);\n\nexport { StyledLeft as Left };\n"]} \ No newline at end of file +{"version":3,"sources":["../../../src/basic/Left.js"],"names":["Left","_root","c","props","Component","propTypes","ViewPropTypes","style","PropTypes","oneOfType","object","number","array","StyledLeft","mapPropsToStyleNames"],"mappings":"m1BAAA,4B,2CACA,qC,mDACA,yCACA,kFACA,iEAEA,mE,68BAEMA,K,iQACK,iBACP,MAAO,+BAAC,iBAAD,WAAM,IAAK,sBAAM,QAAKC,KAAL,CAAaC,CAAnB,EAAX,EAAsC,KAAKC,KAA3C,mDAAP,CACD,C,kBAHgBC,gB,EAMnBJ,KAAKK,SAAL,aACKC,6CADL,EAEEC,MAAOC,oBAAUC,SAAV,CAAoB,CACzBD,oBAAUE,MADe,CAEzBF,oBAAUG,MAFe,CAGzBH,oBAAUI,KAHe,CAApB,CAFT,GASA,GAAMC,YAAa,yCACjB,iBADiB,CAEjB,EAFiB,CAGjBC,8BAHiB,EAIjBd,IAJiB,CAAnB,C,QAMuBA,I,CAAda,U","file":"Left.js","sourcesContent":["import React, { Component } from 'react';\nimport PropTypes from 'prop-types';\nimport { View } from 'react-native';\nimport { ViewPropTypes } from 'deprecated-react-native-prop-types';\nimport { connectStyle } from 'native-base-shoutem-theme';\n\nimport mapPropsToStyleNames from '../utils/mapPropsToStyleNames';\n\nclass Left extends Component {\n render() {\n return (this._root = c)} {...this.props} />;\n }\n}\n\nLeft.propTypes = {\n ...ViewPropTypes,\n style: PropTypes.oneOfType([\n PropTypes.object,\n PropTypes.number,\n PropTypes.array\n ])\n};\n\nconst StyledLeft = connectStyle(\n 'NativeBase.Left',\n {},\n mapPropsToStyleNames\n)(Left);\n\nexport { StyledLeft as Left };\n"]} \ No newline at end of file diff --git a/dist/src/basic/Picker.ios.js b/dist/src/basic/Picker.ios.js index 5874e6bfe..22b6a1969 100644 --- a/dist/src/basic/Picker.ios.js +++ b/dist/src/basic/Picker.ios.js @@ -1,2 +1,2 @@ -Object.defineProperty(exports,"__esModule",{value:true});exports.PickerNB=undefined;var _jsxFileName='src/basic/Picker.ios.js';var _extends=Object.assign||function(target){for(var i=1;i {\n return {\n picker: {\n // alignItems: 'flex-end'\n },\n pickerItem: {}\n };\n };\n\n getLabel(props) {\n const children = this.getChildren(props.children);\n const item = find(\n children,\n child => child.props.value === props.selectedValue\n );\n return get(item, 'props.label');\n }\n\n getSelectedItem() {\n return find(\n this.props.children,\n child => child.props.value === this.props.selectedValue\n );\n }\n\n getChildren = children => {\n if (children && !Array.isArray(children)) {\n return [].concat(children);\n }\n // eslint-disable-next-line prefer-spread\n const appliedChildren = [].concat.apply([], children);\n return appliedChildren;\n };\n\n prepareRootProps() {\n const defaultProps = {\n style: this.getInitialStyle().picker,\n itemStyle: this.getInitialStyle().pickerItem\n };\n\n return computeProps(this.props, defaultProps);\n }\n\n _setModalVisible(visible) {\n this.setState({ modalVisible: visible });\n }\n\n renderIcon() {\n return React.cloneElement(this.props.iosIcon, {\n style: [\n {\n fontSize: 22,\n lineHeight: 26\n },\n { ...this.props.iosIcon.props.style }\n ]\n });\n }\n\n renderButton() {\n const onPress = () => {\n if (this.props.enabled !== undefined && !this.props.enabled) return;\n this._setModalVisible(true);\n };\n const text = this.state.currentLabel\n ? this.state.currentLabel\n : this.props.placeholder;\n if (this.props.renderButton) {\n return this.props.renderButton({\n onPress,\n text,\n picker: this,\n selectedItem: this.getSelectedItem()\n });\n }\n return (\n \n {this.state.currentLabel ? (\n \n {this.state.currentLabel}\n \n ) : (\n \n {this.props.placeholder}\n \n )}\n {this.props.iosIcon === undefined ? null : this.renderIcon()}\n \n );\n }\n\n renderHeader() {\n return this.props.renderHeader ? (\n this.props.renderHeader(() => this._setModalVisible(false))\n ) : (\n
\n \n {\n this._setModalVisible(false);\n }}\n >\n \n {this.props.headerBackButtonText || 'Back'}\n \n \n \n \n \n {this.props.iosHeader || 'Select One'}\n \n \n \n
\n );\n }\n\n // eslint-disable-next-line camelcase\n UNSAFE_componentWillReceiveProps(nextProps) {\n const currentLabel = this.state.currentLabel;\n const nextLabel = this.getLabel(nextProps);\n const currentDS = this.state.dataSource;\n const nextDS = this.getChildren(nextProps.children);\n\n if (currentLabel !== nextLabel) {\n this.setState({\n currentLabel: nextLabel\n });\n }\n if (currentDS !== nextDS) {\n this.setState({\n dataSource: nextDS\n });\n }\n }\n\n render() {\n return (\n (this._root = c)}>\n {this.renderButton()}\n {\n this._setModalVisible(false);\n }}\n >\n \n {this.renderHeader()}\n \n String(index)}\n renderItem={({ item }) => (\n {\n this._setModalVisible(false);\n this.props.onValueChange(item.props.value, item.key);\n this.setState({ current: item.props.label });\n }}\n >\n \n \n {item.props.label}\n \n \n \n {item.props.value === this.props.selectedValue ? (\n \n ) : (\n \n )}\n \n \n )}\n />\n \n \n \n \n );\n }\n}\n\n// eslint-disable-next-line react/no-multi-comp\nPickerNB.Item = createReactClass({\n render() {\n return ;\n }\n});\n\nPickerNB.propTypes = {\n ...ViewPropTypes,\n renderButton: PropTypes.func\n};\n\nconst StyledPickerNB = connectStyle(\n 'NativeBase.PickerNB',\n {},\n mapPropsToStyleNames\n)(PickerNB);\n\nexport { StyledPickerNB as PickerNB };\n"]} \ No newline at end of file +{"version":3,"sources":["../../../src/basic/Picker.ios.js"],"names":["PickerNB","props","getInitialStyle","picker","pickerItem","getChildren","children","Array","isArray","concat","appliedChildren","apply","state","modalVisible","currentLabel","getLabel","dataSource","item","child","value","selectedValue","defaultProps","style","itemStyle","visible","setState","React","cloneElement","iosIcon","fontSize","lineHeight","onPress","enabled","undefined","_setModalVisible","text","placeholder","renderButton","selectedItem","getSelectedItem","textStyle","note","placeholderStyle","renderIcon","renderHeader","headerStyle","shadowOffset","shadowColor","shadowRadius","shadowOpacity","marginLeft","headerBackButtonStyle","headerBackButtonTextStyle","headerBackButtonText","headerTitleStyle","iosHeader","nextProps","nextLabel","currentDS","nextDS","_root","c","modalStyle","testID","index","String","onValueChange","key","current","label","itemTextStyle","Component","Item","render","propTypes","ViewPropTypes","PropTypes","func","StyledPickerNB","mapPropsToStyleNames"],"mappings":"61BAGA,4B,2CACA,qC,mDACA,oD,iEACA,yCACA,kFACA,mDACA,iEACA,8BAEA,mD,yDACA,mE,yEAEA,4BACA,8BACA,sCACA,kCACA,oCACA,gCACA,gCACA,8BACA,4BACA,8BACA,4B,o4BAEMA,S,qDACJ,kBAAYC,KAAZ,CAAmB,0IACXA,KADW,SASnBC,eATmB,CASD,UAAM,CACtB,MAAO,CACLC,OAAQ,EADH,CAILC,WAAY,EAJP,CAAP,CAMD,CAhBkB,OAkCnBC,WAlCmB,CAkCL,kBAAY,CACxB,GAAIC,UAAY,CAACC,MAAMC,OAAN,CAAcF,QAAd,CAAjB,CAA0C,CACxC,MAAO,GAAGG,MAAH,CAAUH,QAAV,CAAP,CACD,CAED,GAAMI,iBAAkB,GAAGD,MAAH,CAAUE,KAAV,CAAgB,EAAhB,CAAoBL,QAApB,CAAxB,CACA,MAAOI,gBAAP,CACD,CAzCkB,CAEjB,MAAKE,KAAL,CAAa,CACXC,aAAc,KADH,CAEXC,aAAc,MAAKC,QAAL,CAAcd,KAAd,CAFH,CAGXe,WAAY,MAAKX,WAAL,CAAiBJ,MAAMK,QAAvB,CAHD,CAAb,CAFiB,aAOlB,C,+DAWQL,K,CAAO,CACd,GAAMK,UAAW,KAAKD,WAAL,CAAiBJ,MAAMK,QAAvB,CAAjB,CACA,GAAMW,MAAO,iBACXX,QADW,CAEX,sBAASY,OAAMjB,KAAN,CAAYkB,KAAZ,GAAsBlB,MAAMmB,aAArC,EAFW,CAAb,CAIA,MAAO,gBAAIH,IAAJ,CAAU,aAAV,CAAP,CACD,C,yDAEiB,iBAChB,MAAO,iBACL,KAAKhB,KAAL,CAAWK,QADN,CAEL,sBAASY,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AWkB,KAAX,GAAqB,OAAKlB,KAAL,CAAWmB,aAD5C,CAEE,WAFF,CAGE,MAAO,OAAKnB,KAAL,CAAWsB,SAHpB,CAIE,QAAS,kBAAM,CACb,OAAKW,gBAAL,CAAsB,KAAtB,EACA,OAAKjC,KAAL,CAAWiE,aAAX,CAAyBjD,KAAKhB,KAAL,CAAWkB,KAApC,CAA2CF,KAAKkD,GAAhD,EACA,OAAK1C,QAAL,CAAc,CAAE2C,QAASnD,KAAKhB,KAAL,CAAWoE,KAAtB,CAAd,EACD,CARH,kDAUE,8BAAC,UAAD,mDACE,8BAAC,UAAD,EAAM,MAAO,OAAKpE,KAAL,CAAWqE,aAAxB,kDACGrD,KAAKhB,KAAL,CAAWoE,KADd,CADF,CAVF,CAeE,8BAAC,YAAD,mDACGpD,KAAKhB,KAAL,CAAWkB,KAAX,GAAqB,OAAKlB,KAAL,CAAWmB,aAAhC,CACC,8BAAC,YAAD,EAAO,aAAP,kDADD,CAGC,8BAAC,YAAD,EAAO,SAAU,KAAjB,kDAJJ,CAfF,CADU,EAJd,kDADF,CAFF,CAVF,CAFF,CADF,CAmDD,C,sBA/NoBmD,gB,EAmOvBvE,SAASwE,IAAT,CAAgB,+BAAiB,oBAC/BC,MAD+B,kBACtB,CACP,MAAO,+BAAC,cAAD,CAAQ,IAAR,aAAiB,KAAKxE,KAAL,EAAjB,oDAAP,CACD,CAH8B,CAAjB,CAAhB,CAMAD,SAAS0E,SAAT,aACKC,6CADL,EAEEtC,aAAcuC,oBAAUC,IAF1B,GAKA,GAAMC,gBAAiB,yCACrB,qBADqB,CAErB,EAFqB,CAGrBC,8BAHqB,EAIrB/E,QAJqB,CAAvB,C,QAM2BA,Q,CAAlB8E,c","file":"Picker.ios.js","sourcesContent":["/* eslint-disable react/prefer-stateless-function */\n/* eslint-disable react/prefer-es6-class */\n/* eslint-disable react/sort-comp */\nimport React, { Component } from 'react';\nimport PropTypes from 'prop-types';\nimport createReactClass from 'create-react-class';\nimport { FlatList, Modal, View } from 'react-native';\nimport { ViewPropTypes } from 'deprecated-react-native-prop-types';\nimport { Picker } from '@react-native-picker/picker';\nimport { connectStyle } from 'native-base-shoutem-theme';\nimport { find, get } from 'lodash';\n\nimport computeProps from '../utils/computeProps';\nimport mapPropsToStyleNames from '../utils/mapPropsToStyleNames';\n\nimport { Text } from './Text';\nimport { Radio } from './Radio';\nimport { Container } from './Container';\nimport { Content } from './Content';\nimport { ListItem } from './ListItem';\nimport { Button } from './Button';\nimport { Header } from './Header';\nimport { Title } from './Title';\nimport { Left } from './Left';\nimport { Right } from './Right';\nimport { Body } from './Body';\n\nclass PickerNB extends Component {\n constructor(props) {\n super(props);\n this.state = {\n modalVisible: false,\n currentLabel: this.getLabel(props),\n dataSource: this.getChildren(props.children)\n };\n }\n\n getInitialStyle = () => {\n return {\n picker: {\n // alignItems: 'flex-end'\n },\n pickerItem: {}\n };\n };\n\n getLabel(props) {\n const children = this.getChildren(props.children);\n const item = find(\n children,\n child => child.props.value === props.selectedValue\n );\n return get(item, 'props.label');\n }\n\n getSelectedItem() {\n return find(\n this.props.children,\n child => child.props.value === this.props.selectedValue\n );\n }\n\n getChildren = children => {\n if (children && !Array.isArray(children)) {\n return [].concat(children);\n }\n // eslint-disable-next-line prefer-spread\n const appliedChildren = [].concat.apply([], children);\n return appliedChildren;\n };\n\n prepareRootProps() {\n const defaultProps = {\n style: this.getInitialStyle().picker,\n itemStyle: this.getInitialStyle().pickerItem\n };\n\n return computeProps(this.props, defaultProps);\n }\n\n _setModalVisible(visible) {\n this.setState({ modalVisible: visible });\n }\n\n renderIcon() {\n return React.cloneElement(this.props.iosIcon, {\n style: [\n {\n fontSize: 22,\n lineHeight: 26\n },\n { ...this.props.iosIcon.props.style }\n ]\n });\n }\n\n renderButton() {\n const onPress = () => {\n if (this.props.enabled !== undefined && !this.props.enabled) return;\n this._setModalVisible(true);\n };\n const text = this.state.currentLabel\n ? this.state.currentLabel\n : this.props.placeholder;\n if (this.props.renderButton) {\n return this.props.renderButton({\n onPress,\n text,\n picker: this,\n selectedItem: this.getSelectedItem()\n });\n }\n return (\n \n {this.state.currentLabel ? (\n \n {this.state.currentLabel}\n
\n ) : (\n \n {this.props.placeholder}\n
\n )}\n {this.props.iosIcon === undefined ? null : this.renderIcon()}\n \n );\n }\n\n renderHeader() {\n return this.props.renderHeader ? (\n this.props.renderHeader(() => this._setModalVisible(false))\n ) : (\n
\n \n {\n this._setModalVisible(false);\n }}\n >\n \n {this.props.headerBackButtonText || 'Back'}\n \n \n \n \n \n {this.props.iosHeader || 'Select One'}\n \n \n \n
\n );\n }\n\n // eslint-disable-next-line camelcase\n UNSAFE_componentWillReceiveProps(nextProps) {\n const currentLabel = this.state.currentLabel;\n const nextLabel = this.getLabel(nextProps);\n const currentDS = this.state.dataSource;\n const nextDS = this.getChildren(nextProps.children);\n\n if (currentLabel !== nextLabel) {\n this.setState({\n currentLabel: nextLabel\n });\n }\n if (currentDS !== nextDS) {\n this.setState({\n dataSource: nextDS\n });\n }\n }\n\n render() {\n return (\n (this._root = c)}>\n {this.renderButton()}\n {\n this._setModalVisible(false);\n }}\n >\n \n {this.renderHeader()}\n \n String(index)}\n renderItem={({ item }) => (\n {\n this._setModalVisible(false);\n this.props.onValueChange(item.props.value, item.key);\n this.setState({ current: item.props.label });\n }}\n >\n \n \n {item.props.label}\n \n \n \n {item.props.value === this.props.selectedValue ? (\n \n ) : (\n \n )}\n \n \n )}\n />\n \n \n \n \n );\n }\n}\n\n// eslint-disable-next-line react/no-multi-comp\nPickerNB.Item = createReactClass({\n render() {\n return ;\n }\n});\n\nPickerNB.propTypes = {\n ...ViewPropTypes,\n renderButton: PropTypes.func\n};\n\nconst StyledPickerNB = connectStyle(\n 'NativeBase.PickerNB',\n {},\n mapPropsToStyleNames\n)(PickerNB);\n\nexport { StyledPickerNB as PickerNB };\n"]} \ No newline at end of file diff --git a/dist/src/basic/Right.js b/dist/src/basic/Right.js index 85ed963e2..04245e16d 100644 --- a/dist/src/basic/Right.js +++ b/dist/src/basic/Right.js @@ -1,2 +1,2 @@ -Object.defineProperty(exports,"__esModule",{value:true});exports.Right=undefined;var _extends=Object.assign||function(target){for(var i=1;i (this._root = c)} {...this.props} />;\n }\n}\n\nRight.propTypes = {\n ...ViewPropTypes,\n style: PropTypes.oneOfType([\n PropTypes.object,\n PropTypes.number,\n PropTypes.array\n ])\n};\n\nconst StyledRight = connectStyle('NativeBase.Right', {}, mapPropsToStyleNames)(\n Right\n);\n\nexport { StyledRight as Right };\n"]} \ No newline at end of file +{"version":3,"sources":["../../../src/basic/Right.js"],"names":["Right","_root","c","props","Component","propTypes","ViewPropTypes","style","PropTypes","oneOfType","object","number","array","StyledRight","mapPropsToStyleNames"],"mappings":"q1BAAA,4B,2CACA,qC,mDACA,yCACA,kFACA,iEAEA,mE,68BAEMA,M,uQACK,iBACP,MAAO,+BAAC,iBAAD,WAAM,IAAK,sBAAM,QAAKC,KAAL,CAAaC,CAAnB,EAAX,EAAsC,KAAKC,KAA3C,mDAAP,CACD,C,mBAHiBC,gB,EAMpBJ,MAAMK,SAAN,aACKC,6CADL,EAEEC,MAAOC,oBAAUC,SAAV,CAAoB,CACzBD,oBAAUE,MADe,CAEzBF,oBAAUG,MAFe,CAGzBH,oBAAUI,KAHe,CAApB,CAFT,GASA,GAAMC,aAAc,yCAClB,kBADkB,CAElB,EAFkB,CAGlBC,8BAHkB,EAIlBd,KAJkB,CAApB,C,QAMwBA,K,CAAfa,W","file":"Right.js","sourcesContent":["import React, { Component } from 'react';\nimport PropTypes from 'prop-types';\nimport { View } from 'react-native';\nimport { ViewPropTypes } from 'deprecated-react-native-prop-types';\nimport { connectStyle } from 'native-base-shoutem-theme';\n\nimport mapPropsToStyleNames from '../utils/mapPropsToStyleNames';\n\nclass Right extends Component {\n render() {\n return (this._root = c)} {...this.props} />;\n }\n}\n\nRight.propTypes = {\n ...ViewPropTypes,\n style: PropTypes.oneOfType([\n PropTypes.object,\n PropTypes.number,\n PropTypes.array\n ])\n};\n\nconst StyledRight = connectStyle(\n 'NativeBase.Right',\n {},\n mapPropsToStyleNames\n)(Right);\n\nexport { StyledRight as Right };\n"]} \ No newline at end of file diff --git a/dist/src/basic/Root.js b/dist/src/basic/Root.js index e6fc6fc7c..e184ae7e3 100644 --- a/dist/src/basic/Root.js +++ b/dist/src/basic/Root.js @@ -1,2 +1,2 @@ -Object.defineProperty(exports,"__esModule",{value:true});exports.Root=undefined;var _extends=Object.assign||function(target){for(var i=1;i (this._root = c)} {...this.props} style={{ flex: 1 }}>\n {this.props.children}\n {\n if (c) Toast.toastInstance = c;\n }}\n />\n {\n if (c) ActionSheet.actionsheetInstance = c;\n }}\n />\n \n );\n }\n}\n\nRoot.propTypes = {\n ...ViewPropTypes,\n style: PropTypes.oneOfType([\n PropTypes.object,\n PropTypes.number,\n PropTypes.array\n ])\n};\n\nconst StyledRoot = connectStyle('NativeBase.Root', {}, mapPropsToStyleNames)(\n Root\n);\n\nexport { StyledRoot as Root };\n"]} \ No newline at end of file +{"version":3,"sources":["../../../src/basic/Root.js"],"names":["Root","_root","c","props","flex","children","Toast","toastInstance","ActionSheet","actionsheetInstance","Component","propTypes","ViewPropTypes","style","PropTypes","oneOfType","object","number","array","StyledRoot","mapPropsToStyleNames"],"mappings":"m1BAAA,4B,2CACA,yCACA,kFACA,qC,mDACA,iEAEA,mE,yEAEA,gDACA,0C,o4BAEMA,K,iQACK,iBACP,MACE,+BAAC,iBAAD,WAAM,IAAK,sBAAM,QAAKC,KAAL,CAAaC,CAAnB,EAAX,EAAsC,KAAKC,KAA3C,EAAkD,MAAO,CAAEC,KAAM,CAAR,CAAzD,kDACG,KAAKD,KAAL,CAAWE,QADd,CAEE,8BAAC,8BAAD,EACE,IAAK,eAAK,CACR,GAAIH,CAAJ,CAAOI,+BAAMC,aAAN,CAAsBL,CAAtB,CACR,CAHH,iDAFF,CAOE,8BAAC,iCAAD,EACE,IAAK,eAAK,CACR,GAAIA,CAAJ,CAAOM,kCAAYC,mBAAZ,CAAkCP,CAAlC,CACR,CAHH,iDAPF,CADF,CAeD,C,kBAjBgBQ,gB,EAoBnBV,KAAKW,SAAL,aACKC,6CADL,EAEEC,MAAOC,oBAAUC,SAAV,CAAoB,CACzBD,oBAAUE,MADe,CAEzBF,oBAAUG,MAFe,CAGzBH,oBAAUI,KAHe,CAApB,CAFT,GASA,GAAMC,YAAa,yCACjB,iBADiB,CAEjB,EAFiB,CAGjBC,8BAHiB,EAIjBpB,IAJiB,CAAnB,C,QAMuBA,I,CAAdmB,U","file":"Root.js","sourcesContent":["import React, { Component } from 'react';\nimport { View } from 'react-native';\nimport { ViewPropTypes } from 'deprecated-react-native-prop-types';\nimport PropTypes from 'prop-types';\nimport { connectStyle } from 'native-base-shoutem-theme';\n\nimport mapPropsToStyleNames from '../utils/mapPropsToStyleNames';\n\nimport { ToastContainer as Toast } from './ToastContainer';\nimport { ActionSheetContainer as ActionSheet } from './Actionsheet';\n\nclass Root extends Component {\n render() {\n return (\n (this._root = c)} {...this.props} style={{ flex: 1 }}>\n {this.props.children}\n {\n if (c) Toast.toastInstance = c;\n }}\n />\n {\n if (c) ActionSheet.actionsheetInstance = c;\n }}\n />\n \n );\n }\n}\n\nRoot.propTypes = {\n ...ViewPropTypes,\n style: PropTypes.oneOfType([\n PropTypes.object,\n PropTypes.number,\n PropTypes.array\n ])\n};\n\nconst StyledRoot = connectStyle(\n 'NativeBase.Root',\n {},\n mapPropsToStyleNames\n)(Root);\n\nexport { StyledRoot as Root };\n"]} \ No newline at end of file diff --git a/dist/src/basic/Segment.js b/dist/src/basic/Segment.js index ddfd033cf..0bc096851 100644 --- a/dist/src/basic/Segment.js +++ b/dist/src/basic/Segment.js @@ -1,2 +1,2 @@ -Object.defineProperty(exports,"__esModule",{value:true});exports.Segment=undefined;var _extends=Object.assign||function(target){for(var i=1;i (this._root = c)} {...this.props} />;\n }\n}\n\nSegment.propTypes = {\n ...ViewPropTypes,\n style: PropTypes.oneOfType([\n PropTypes.object,\n PropTypes.number,\n PropTypes.array\n ])\n};\n\nconst StyledSegment = connectStyle(\n 'NativeBase.Segment',\n {},\n mapPropsToStyleNames\n)(Segment);\nexport { StyledSegment as Segment };\n"]} \ No newline at end of file +{"version":3,"sources":["../../../src/basic/Segment.js"],"names":["Segment","_root","c","props","Component","propTypes","ViewPropTypes","style","PropTypes","oneOfType","object","number","array","StyledSegment","mapPropsToStyleNames"],"mappings":"y1BAAA,4B,2CACA,qC,mDACA,yCACA,kFACA,iEAEA,mE,68BAEMA,Q,mRACK,iBACP,MAAO,+BAAC,iBAAD,WAAM,IAAK,sBAAM,QAAKC,KAAL,CAAaC,CAAnB,EAAX,EAAsC,KAAKC,KAA3C,mDAAP,CACD,C,qBAHmBC,gB,EAMtBJ,QAAQK,SAAR,aACKC,6CADL,EAEEC,MAAOC,oBAAUC,SAAV,CAAoB,CACzBD,oBAAUE,MADe,CAEzBF,oBAAUG,MAFe,CAGzBH,oBAAUI,KAHe,CAApB,CAFT,GASA,GAAMC,eAAgB,yCACpB,oBADoB,CAEpB,EAFoB,CAGpBC,8BAHoB,EAIpBd,OAJoB,CAAtB,C,QAK0BA,O,CAAjBa,a","file":"Segment.js","sourcesContent":["import React, { Component } from 'react';\nimport PropTypes from 'prop-types';\nimport { View } from 'react-native';\nimport { ViewPropTypes } from 'deprecated-react-native-prop-types';\nimport { connectStyle } from 'native-base-shoutem-theme';\n\nimport mapPropsToStyleNames from '../utils/mapPropsToStyleNames';\n\nclass Segment extends Component {\n render() {\n return (this._root = c)} {...this.props} />;\n }\n}\n\nSegment.propTypes = {\n ...ViewPropTypes,\n style: PropTypes.oneOfType([\n PropTypes.object,\n PropTypes.number,\n PropTypes.array\n ])\n};\n\nconst StyledSegment = connectStyle(\n 'NativeBase.Segment',\n {},\n mapPropsToStyleNames\n)(Segment);\nexport { StyledSegment as Segment };\n"]} \ No newline at end of file diff --git a/dist/src/basic/Separator.js b/dist/src/basic/Separator.js index f04e4b2d9..7c78e8543 100644 --- a/dist/src/basic/Separator.js +++ b/dist/src/basic/Separator.js @@ -1,2 +1,2 @@ -Object.defineProperty(exports,"__esModule",{value:true});exports.Separator=undefined;var _extends=Object.assign||function(target){for(var i=1;i (this._root = c)} {...this.props} />;\n }\n}\n\nSeparator.propTypes = {\n ...ViewPropTypes,\n style: PropTypes.oneOfType([\n PropTypes.object,\n PropTypes.number,\n PropTypes.array\n ])\n};\n\nconst StyledSeparator = connectStyle(\n 'NativeBase.Separator',\n {},\n mapPropsToStyleNames\n)(Separator);\n\nexport { StyledSeparator as Separator };\n"]} \ No newline at end of file +{"version":3,"sources":["../../../src/basic/Separator.js"],"names":["Separator","_root","c","props","Component","propTypes","ViewPropTypes","style","PropTypes","oneOfType","object","number","array","StyledSeparator","mapPropsToStyleNames"],"mappings":"61BAAA,4B,2CACA,qC,mDACA,yCACA,kFACA,iEAEA,mE,68BAEMA,U,+RACK,iBACP,MAAO,+BAAC,iBAAD,WAAM,IAAK,sBAAM,QAAKC,KAAL,CAAaC,CAAnB,EAAX,EAAsC,KAAKC,KAA3C,mDAAP,CACD,C,uBAHqBC,gB,EAMxBJ,UAAUK,SAAV,aACKC,6CADL,EAEEC,MAAOC,oBAAUC,SAAV,CAAoB,CACzBD,oBAAUE,MADe,CAEzBF,oBAAUG,MAFe,CAGzBH,oBAAUI,KAHe,CAApB,CAFT,GASA,GAAMC,iBAAkB,yCACtB,sBADsB,CAEtB,EAFsB,CAGtBC,8BAHsB,EAItBd,SAJsB,CAAxB,C,QAM4BA,S,CAAnBa,e","file":"Separator.js","sourcesContent":["import React, { Component } from 'react';\nimport PropTypes from 'prop-types';\nimport { View } from 'react-native';\nimport { ViewPropTypes } from 'deprecated-react-native-prop-types';\nimport { connectStyle } from 'native-base-shoutem-theme';\n\nimport mapPropsToStyleNames from '../utils/mapPropsToStyleNames';\n\nclass Separator extends Component {\n render() {\n return (this._root = c)} {...this.props} />;\n }\n}\n\nSeparator.propTypes = {\n ...ViewPropTypes,\n style: PropTypes.oneOfType([\n PropTypes.object,\n PropTypes.number,\n PropTypes.array\n ])\n};\n\nconst StyledSeparator = connectStyle(\n 'NativeBase.Separator',\n {},\n mapPropsToStyleNames\n)(Separator);\n\nexport { StyledSeparator as Separator };\n"]} \ No newline at end of file diff --git a/dist/src/basic/Subtitle.js b/dist/src/basic/Subtitle.js index 39d052520..58aafb7ed 100644 --- a/dist/src/basic/Subtitle.js +++ b/dist/src/basic/Subtitle.js @@ -1,2 +1,2 @@ -Object.defineProperty(exports,"__esModule",{value:true});exports.Subtitle=undefined;var _extends=Object.assign||function(target){for(var i=1;i (this._root = c)} numberOfLines={1} {...this.props} />;\n }\n}\n\nSubtitle.propTypes = {\n ...Text.propTypes,\n style: PropTypes.oneOfType([\n PropTypes.object,\n PropTypes.number,\n PropTypes.array\n ])\n};\n\nconst StyledSubtitle = connectStyle(\n 'NativeBase.Subtitle',\n {},\n mapPropsToStyleNames\n)(Subtitle);\nexport { StyledSubtitle as Subtitle };\n"]} \ No newline at end of file +{"version":3,"sources":["../../../src/basic/Subtitle.js"],"names":["Subtitle","_root","c","props","Component","propTypes","TextPropTypes","style","PropTypes","oneOfType","object","number","array","StyledSubtitle","mapPropsToStyleNames"],"mappings":"21BAAA,4B,2CACA,qC,mDACA,yCACA,kFACA,iEAEA,mE,68BAEMA,S,yRACK,iBACP,MACE,+BAAC,iBAAD,WAAM,IAAK,sBAAM,QAAKC,KAAL,CAAaC,CAAnB,EAAX,CAAkC,cAAe,CAAjD,EAAwD,KAAKC,KAA7D,mDADF,CAGD,C,sBALoBC,gB,EAQvBJ,SAASK,SAAT,aACKC,6CADL,EAEEC,MAAOC,oBAAUC,SAAV,CAAoB,CACzBD,oBAAUE,MADe,CAEzBF,oBAAUG,MAFe,CAGzBH,oBAAUI,KAHe,CAApB,CAFT,GASA,GAAMC,gBAAiB,yCACrB,qBADqB,CAErB,EAFqB,CAGrBC,8BAHqB,EAIrBd,QAJqB,CAAvB,C,QAK2BA,Q,CAAlBa,c","file":"Subtitle.js","sourcesContent":["import React, { Component } from 'react';\nimport PropTypes from 'prop-types';\nimport { Text } from 'react-native';\nimport { TextPropTypes } from 'deprecated-react-native-prop-types';\nimport { connectStyle } from 'native-base-shoutem-theme';\n\nimport mapPropsToStyleNames from '../utils/mapPropsToStyleNames';\n\nclass Subtitle extends Component {\n render() {\n return (\n (this._root = c)} numberOfLines={1} {...this.props} />\n );\n }\n}\n\nSubtitle.propTypes = {\n ...TextPropTypes,\n style: PropTypes.oneOfType([\n PropTypes.object,\n PropTypes.number,\n PropTypes.array\n ])\n};\n\nconst StyledSubtitle = connectStyle(\n 'NativeBase.Subtitle',\n {},\n mapPropsToStyleNames\n)(Subtitle);\nexport { StyledSubtitle as Subtitle };\n"]} \ No newline at end of file diff --git a/dist/src/basic/Tab.js b/dist/src/basic/Tab.js index 0d74149dd..851225020 100644 --- a/dist/src/basic/Tab.js +++ b/dist/src/basic/Tab.js @@ -1,2 +1,2 @@ -Object.defineProperty(exports,"__esModule",{value:true});exports.Tab=undefined;var _extends=Object.assign||function(target){for(var i=1;i (this._root = c)} {...this.props}>\n {this.props.children}\n \n );\n }\n}\n\nTab.propTypes = {\n ...ViewPropTypes,\n style: PropTypes.oneOfType([\n PropTypes.object,\n PropTypes.number,\n PropTypes.array\n ])\n};\n\nconst StyledTab = connectStyle('NativeBase.Tab', {}, mapPropsToStyleNames)(Tab);\n\nexport { StyledTab as Tab };\n"]} \ No newline at end of file +{"version":3,"sources":["../../../src/basic/Tab.js"],"names":["Tab","_root","c","props","children","Component","propTypes","ViewPropTypes","style","PropTypes","oneOfType","object","number","array","StyledTab","mapPropsToStyleNames"],"mappings":"i1BAAA,4B,2CACA,qC,mDACA,yCACA,kFACA,iEAEA,mE,68BAEMA,I,2PACK,iBACP,MACE,+BAAC,iBAAD,WAAM,IAAK,sBAAM,QAAKC,KAAL,CAAaC,CAAnB,EAAX,EAAsC,KAAKC,KAA3C,mDACG,KAAKA,KAAL,CAAWC,QADd,CADF,CAKD,C,iBAPeC,gB,EAUlBL,IAAIM,SAAJ,aACKC,6CADL,EAEEC,MAAOC,oBAAUC,SAAV,CAAoB,CACzBD,oBAAUE,MADe,CAEzBF,oBAAUG,MAFe,CAGzBH,oBAAUI,KAHe,CAApB,CAFT,GASA,GAAMC,WAAY,yCAAa,gBAAb,CAA+B,EAA/B,CAAmCC,8BAAnC,EAAyDf,GAAzD,CAAlB,C,QAEsBA,G,CAAbc,S","file":"Tab.js","sourcesContent":["import React, { Component } from 'react';\nimport PropTypes from 'prop-types';\nimport { View } from 'react-native';\nimport { ViewPropTypes } from 'deprecated-react-native-prop-types';\nimport { connectStyle } from 'native-base-shoutem-theme';\n\nimport mapPropsToStyleNames from '../utils/mapPropsToStyleNames';\n\nclass Tab extends Component {\n render() {\n return (\n (this._root = c)} {...this.props}>\n {this.props.children}\n \n );\n }\n}\n\nTab.propTypes = {\n ...ViewPropTypes,\n style: PropTypes.oneOfType([\n PropTypes.object,\n PropTypes.number,\n PropTypes.array\n ])\n};\n\nconst StyledTab = connectStyle('NativeBase.Tab', {}, mapPropsToStyleNames)(Tab);\n\nexport { StyledTab as Tab };\n"]} \ No newline at end of file diff --git a/dist/src/basic/TabContainer.js b/dist/src/basic/TabContainer.js index 57e3187e6..463a41bb7 100644 --- a/dist/src/basic/TabContainer.js +++ b/dist/src/basic/TabContainer.js @@ -1,2 +1,2 @@ -Object.defineProperty(exports,"__esModule",{value:true});exports.TabContainer=undefined;var _extends=Object.assign||function(target){for(var i=1;i (this._root = c)} {...this.props} />;\n }\n}\n\nTabContainer.propTypes = {\n ...ViewPropTypes,\n style: PropTypes.oneOfType([\n PropTypes.object,\n PropTypes.number,\n PropTypes.array\n ])\n};\n\nconst StyledTabContainer = connectStyle(\n 'NativeBase.TabContainer',\n {},\n mapPropsToStyleNames\n)(TabContainer);\nexport { StyledTabContainer as TabContainer };\n"]} \ No newline at end of file +{"version":3,"sources":["../../../src/basic/TabContainer.js"],"names":["TabContainer","_root","c","props","Component","propTypes","ViewPropTypes","style","PropTypes","oneOfType","object","number","array","StyledTabContainer","mapPropsToStyleNames"],"mappings":"m2BAAA,4B,2CACA,qC,mDACA,yCACA,kFACA,iEAEA,mE,68BAEMA,a,iTACK,iBACP,MAAO,+BAAC,iBAAD,WAAM,IAAK,sBAAM,QAAKC,KAAL,CAAaC,CAAnB,EAAX,EAAsC,KAAKC,KAA3C,mDAAP,CACD,C,0BAHwBC,gB,EAM3BJ,aAAaK,SAAb,aACKC,6CADL,EAEEC,MAAOC,oBAAUC,SAAV,CAAoB,CACzBD,oBAAUE,MADe,CAEzBF,oBAAUG,MAFe,CAGzBH,oBAAUI,KAHe,CAApB,CAFT,GASA,GAAMC,oBAAqB,yCACzB,yBADyB,CAEzB,EAFyB,CAGzBC,8BAHyB,EAIzBd,YAJyB,CAA3B,C,QAK+BA,Y,CAAtBa,kB","file":"TabContainer.js","sourcesContent":["import React, { Component } from 'react';\nimport PropTypes from 'prop-types';\nimport { View } from 'react-native';\nimport { ViewPropTypes } from 'deprecated-react-native-prop-types';\nimport { connectStyle } from 'native-base-shoutem-theme';\n\nimport mapPropsToStyleNames from '../utils/mapPropsToStyleNames';\n\nclass TabContainer extends Component {\n render() {\n return (this._root = c)} {...this.props} />;\n }\n}\n\nTabContainer.propTypes = {\n ...ViewPropTypes,\n style: PropTypes.oneOfType([\n PropTypes.object,\n PropTypes.number,\n PropTypes.array\n ])\n};\n\nconst StyledTabContainer = connectStyle(\n 'NativeBase.TabContainer',\n {},\n mapPropsToStyleNames\n)(TabContainer);\nexport { StyledTabContainer as TabContainer };\n"]} \ No newline at end of file diff --git a/dist/src/basic/TabHeading.js b/dist/src/basic/TabHeading.js index f8da6dd6a..200c061c0 100644 --- a/dist/src/basic/TabHeading.js +++ b/dist/src/basic/TabHeading.js @@ -1,2 +1,2 @@ -Object.defineProperty(exports,"__esModule",{value:true});exports.TabHeading=undefined;var _extends=Object.assign||function(target){for(var i=1;i (this._root = c)} {...this.props} />;\n }\n}\n\nTabHeadingNB.propTypes = {\n ...ViewPropTypes,\n style: PropTypes.oneOfType([\n PropTypes.object,\n PropTypes.number,\n PropTypes.array\n ])\n};\n\nconst StyledTabHeadingNB = connectStyle(\n 'NativeBase.TabHeading',\n {},\n mapPropsToStyleNames\n)(TabHeadingNB);\nexport { StyledTabHeadingNB as TabHeading };\n"]} \ No newline at end of file +{"version":3,"sources":["../../../src/basic/TabHeading.js"],"names":["TabHeadingNB","_root","c","props","Component","propTypes","ViewPropTypes","style","PropTypes","oneOfType","object","number","array","StyledTabHeadingNB","mapPropsToStyleNames","TabHeading"],"mappings":"+1BAAA,4B,2CACA,qC,mDACA,yCACA,kFACA,iEAEA,mE,68BAEMA,a,iTACK,iBACP,MAAO,+BAAC,iBAAD,WAAM,IAAK,sBAAM,QAAKC,KAAL,CAAaC,CAAnB,EAAX,EAAsC,KAAKC,KAA3C,mDAAP,CACD,C,0BAHwBC,gB,EAM3BJ,aAAaK,SAAb,aACKC,6CADL,EAEEC,MAAOC,oBAAUC,SAAV,CAAoB,CACzBD,oBAAUE,MADe,CAEzBF,oBAAUG,MAFe,CAGzBH,oBAAUI,KAHe,CAApB,CAFT,GASA,GAAMC,oBAAqB,yCACzB,uBADyB,CAEzB,EAFyB,CAGzBC,8BAHyB,EAIzBd,YAJyB,CAA3B,C,QAK+Be,U,CAAtBF,kB","file":"TabHeading.js","sourcesContent":["import React, { Component } from 'react';\nimport PropTypes from 'prop-types';\nimport { View } from 'react-native';\nimport { ViewPropTypes } from 'deprecated-react-native-prop-types';\nimport { connectStyle } from 'native-base-shoutem-theme';\n\nimport mapPropsToStyleNames from '../utils/mapPropsToStyleNames';\n\nclass TabHeadingNB extends Component {\n render() {\n return (this._root = c)} {...this.props} />;\n }\n}\n\nTabHeadingNB.propTypes = {\n ...ViewPropTypes,\n style: PropTypes.oneOfType([\n PropTypes.object,\n PropTypes.number,\n PropTypes.array\n ])\n};\n\nconst StyledTabHeadingNB = connectStyle(\n 'NativeBase.TabHeading',\n {},\n mapPropsToStyleNames\n)(TabHeadingNB);\nexport { StyledTabHeadingNB as TabHeading };\n"]} \ No newline at end of file diff --git a/dist/src/basic/Text.js b/dist/src/basic/Text.js index a3c870bb9..4423150c5 100644 --- a/dist/src/basic/Text.js +++ b/dist/src/basic/Text.js @@ -1,2 +1,2 @@ -Object.defineProperty(exports,"__esModule",{value:true});exports.Text=undefined;var _extends=Object.assign||function(target){for(var i=1;i {\n if (_.isString(child)) {\n return _.toUpper(child);\n }\n return child;\n });\n } else {\n text = children;\n }\n\n return (\n \n {text}\n \n );\n }\n}\n\nText.propTypes = {\n ...RNText.propTypes,\n uppercase: PropTypes.bool,\n style: PropTypes.oneOfType([\n PropTypes.object,\n PropTypes.number,\n PropTypes.array\n ])\n};\n\nText.defaultProps = {\n uppercase: false\n};\n\nconst StyledText = connectStyle(\n 'NativeBase.Text',\n {},\n mapPropsToStyleNames\n)(Text);\n\nexport { StyledText as Text };\n"]} \ No newline at end of file +{"version":3,"sources":["../../../src/basic/Text.js"],"names":["Text","c","_root","props","uppercase","children","text","React","Children","map","_","isString","child","toUpper","setRoot","PureComponent","propTypes","TextPropTypes","PropTypes","bool","style","oneOfType","object","number","array","defaultProps","StyledText","mapPropsToStyleNames"],"mappings":"m1BAAA,4B,2CACA,qC,mDACA,yCACA,kFACA,8B,6CACA,iEAEA,mE,68BAEMA,K,sRACIC,C,CAAG,CACT,KAAKC,KAAL,CAAaD,CAAb,CACD,C,uCAEQ,YACyB,KAAKE,KAD9B,CACCC,SADD,QACCA,SADD,CACYC,QADZ,QACYA,QADZ,CAGP,GAAIC,YAAJ,CACA,GAAIF,SAAJ,CAAe,CACbE,KAAOC,gBAAMC,QAAN,CAAeC,GAAf,CAAmBJ,QAAnB,CAA6B,eAAS,CAC3C,GAAIK,iBAAEC,QAAF,CAAWC,KAAX,CAAJ,CAAuB,CACrB,MAAOF,kBAAEG,OAAF,CAAUD,KAAV,CAAP,CACD,CACD,MAAOA,MAAP,CACD,CALM,CAAP,CAMD,CAPD,IAOO,CACLN,KAAOD,QAAP,CACD,CAED,MACE,+BAAC,iBAAD,WAAQ,IAAK,KAAKS,OAAlB,EAA+B,KAAKX,KAApC,mDACGG,IADH,CADF,CAKD,C,kBAzBgBC,gBAAMQ,a,EA4BzBf,KAAKgB,SAAL,aACKC,6CADL,EAEEb,UAAWc,oBAAUC,IAFvB,CAGEC,MAAOF,oBAAUG,SAAV,CAAoB,CACzBH,oBAAUI,MADe,CAEzBJ,oBAAUK,MAFe,CAGzBL,oBAAUM,KAHe,CAApB,CAHT,GAUAxB,KAAKyB,YAAL,CAAoB,CAClBrB,UAAW,KADO,CAApB,CAIA,GAAMsB,YAAa,yCACjB,iBADiB,CAEjB,EAFiB,CAGjBC,8BAHiB,EAIjB3B,IAJiB,CAAnB,C,QAMuBA,I,CAAd0B,U","file":"Text.js","sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport { Text as RNText } from 'react-native';\nimport { TextPropTypes } from 'deprecated-react-native-prop-types';\nimport _ from 'lodash';\nimport { connectStyle } from 'native-base-shoutem-theme';\n\nimport mapPropsToStyleNames from '../utils/mapPropsToStyleNames';\n\nclass Text extends React.PureComponent {\n setRoot(c) {\n this._root = c;\n }\n\n render() {\n const { uppercase, children } = this.props;\n\n let text;\n if (uppercase) {\n text = React.Children.map(children, child => {\n if (_.isString(child)) {\n return _.toUpper(child);\n }\n return child;\n });\n } else {\n text = children;\n }\n\n return (\n \n {text}\n \n );\n }\n}\n\nText.propTypes = {\n ...TextPropTypes,\n uppercase: PropTypes.bool,\n style: PropTypes.oneOfType([\n PropTypes.object,\n PropTypes.number,\n PropTypes.array\n ])\n};\n\nText.defaultProps = {\n uppercase: false\n};\n\nconst StyledText = connectStyle(\n 'NativeBase.Text',\n {},\n mapPropsToStyleNames\n)(Text);\n\nexport { StyledText as Text };\n"]} \ No newline at end of file diff --git a/dist/src/basic/Textarea.js b/dist/src/basic/Textarea.js index 2ba6ebf2e..b8030baae 100644 --- a/dist/src/basic/Textarea.js +++ b/dist/src/basic/Textarea.js @@ -1,2 +1,2 @@ -Object.defineProperty(exports,"__esModule",{value:true});exports.Textarea=undefined;var _extends=Object.assign||function(target){for(var i=1;i {\n this._textInput = c;\n this._root = c;\n }}\n {...this.prepareRootProps()}\n multiline\n placeholderTextColor={\n this.props.placeholderTextColor\n ? this.props.placeholderTextColor\n : variables.inputColorPlaceholder\n }\n underlineColorAndroid=\"rgba(0,0,0,0)\"\n editable={!this.props.disabled}\n />\n );\n }\n}\n\nTextarea.propTypes = {\n ...TextInput.propTypes,\n style: PropTypes.oneOfType([\n PropTypes.object,\n PropTypes.number,\n PropTypes.array\n ]),\n rowSpan: PropTypes.number,\n bordered: PropTypes.bool,\n underline: PropTypes.bool\n};\n\nconst StyledTextarea = connectStyle(\n 'NativeBase.Textarea',\n {},\n mapPropsToStyleNames\n)(Textarea);\n\nexport { StyledTextarea as Textarea };\n"]} \ No newline at end of file +{"version":3,"sources":["../../../src/basic/Textarea.js"],"names":["Textarea","textarea","height","props","rowSpan","defaultProps","style","getStyle","_textInput","c","_root","prepareRootProps","placeholderTextColor","variables","inputColorPlaceholder","disabled","Component","propTypes","TextInputPropTypes","PropTypes","oneOfType","object","number","array","bordered","bool","underline","StyledTextarea","mapPropsToStyleNames"],"mappings":"21BAAA,4B,2CACA,qC,mDACA,yCACA,kFACA,iEAEA,qD,iDACA,mD,yDACA,mE,68BAEMA,S,6RACO,CACT,MAAO,CACLC,SAAU,CACRC,OAAQ,KAAKC,KAAL,CAAWC,OAAX,CAAqB,KAAKD,KAAL,CAAWC,OAAX,CAAqB,EAA1C,CAA+C,EAD/C,CADL,CAAP,CAKD,C,2DAEkB,CACjB,GAAMC,cAAe,CACnBC,MAAO,KAAKC,QAAL,GAAgBN,QADJ,CAArB,CAGA,MAAO,2BAAa,KAAKE,KAAlB,CAAyBE,YAAzB,CAAP,CACD,C,uCACQ,iBACP,MACE,+BAAC,sBAAD,WACE,IAAK,eAAK,CACR,OAAKG,UAAL,CAAkBC,CAAlB,CACA,OAAKC,KAAL,CAAaD,CAAb,CACD,CAJH,EAKM,KAAKE,gBAAL,EALN,EAME,cANF,CAOE,qBACE,KAAKR,KAAL,CAAWS,oBAAX,CACI,KAAKT,KAAL,CAAWS,oBADf,CAEIC,mBAAUC,qBAVlB,CAYE,sBAAsB,eAZxB,CAaE,SAAU,CAAC,KAAKX,KAAL,CAAWY,QAbxB,kDADF,CAiBD,C,sBAjCoBC,gB,EAoCvBhB,SAASiB,SAAT,aACKC,kDADL,EAEEZ,MAAOa,oBAAUC,SAAV,CAAoB,CACzBD,oBAAUE,MADe,CAEzBF,oBAAUG,MAFe,CAGzBH,oBAAUI,KAHe,CAApB,CAFT,CAOEnB,QAASe,oBAAUG,MAPrB,CAQEE,SAAUL,oBAAUM,IARtB,CASEC,UAAWP,oBAAUM,IATvB,GAYA,GAAME,gBAAiB,yCACrB,qBADqB,CAErB,EAFqB,CAGrBC,8BAHqB,EAIrB5B,QAJqB,CAAvB,C,QAM2BA,Q,CAAlB2B,c","file":"Textarea.js","sourcesContent":["import React, { Component } from 'react';\nimport PropTypes from 'prop-types';\nimport { TextInput } from 'react-native';\nimport { TextInputPropTypes } from 'deprecated-react-native-prop-types';\nimport { connectStyle } from 'native-base-shoutem-theme';\n\nimport variables from '../theme/variables/platform';\nimport computeProps from '../utils/computeProps';\nimport mapPropsToStyleNames from '../utils/mapPropsToStyleNames';\n\nclass Textarea extends Component {\n getStyle() {\n return {\n textarea: {\n height: this.props.rowSpan ? this.props.rowSpan * 25 : 60\n }\n };\n }\n\n prepareRootProps() {\n const defaultProps = {\n style: this.getStyle().textarea\n };\n return computeProps(this.props, defaultProps);\n }\n render() {\n return (\n {\n this._textInput = c;\n this._root = c;\n }}\n {...this.prepareRootProps()}\n multiline\n placeholderTextColor={\n this.props.placeholderTextColor\n ? this.props.placeholderTextColor\n : variables.inputColorPlaceholder\n }\n underlineColorAndroid=\"rgba(0,0,0,0)\"\n editable={!this.props.disabled}\n />\n );\n }\n}\n\nTextarea.propTypes = {\n ...TextInputPropTypes,\n style: PropTypes.oneOfType([\n PropTypes.object,\n PropTypes.number,\n PropTypes.array\n ]),\n rowSpan: PropTypes.number,\n bordered: PropTypes.bool,\n underline: PropTypes.bool\n};\n\nconst StyledTextarea = connectStyle(\n 'NativeBase.Textarea',\n {},\n mapPropsToStyleNames\n)(Textarea);\n\nexport { StyledTextarea as Textarea };\n"]} \ No newline at end of file diff --git a/dist/src/basic/Thumbnail.js b/dist/src/basic/Thumbnail.js index 5217d78c3..2b367c09c 100644 --- a/dist/src/basic/Thumbnail.js +++ b/dist/src/basic/Thumbnail.js @@ -1,2 +1,2 @@ -Object.defineProperty(exports,"__esModule",{value:true});exports.Thumbnail=undefined;var _extends=Object.assign||function(target){for(var i=1;i (this._root = c)} {...this.props} />;\n }\n}\n\nThumbnail.propTypes = {\n ...Image.propTypes,\n style: PropTypes.oneOfType([\n PropTypes.object,\n PropTypes.number,\n PropTypes.array\n ]),\n square: PropTypes.bool,\n circular: PropTypes.bool,\n size: PropTypes.number\n};\n\nconst StyledThumbnail = connectStyle(\n 'NativeBase.Thumbnail',\n {},\n mapPropsToStyleNames\n)(Thumbnail);\n\nexport { StyledThumbnail as Thumbnail };\n"]} \ No newline at end of file +{"version":3,"sources":["../../../src/basic/Thumbnail.js"],"names":["Thumbnail","_root","c","props","Component","propTypes","ImagePropTypes","style","PropTypes","oneOfType","object","number","array","square","bool","circular","size","StyledThumbnail","mapPropsToStyleNames"],"mappings":"61BAAA,4B,2CACA,qC,mDACA,yCACA,kFACA,iEAEA,mE,68BAEMA,U,+RACK,iBACP,MAAO,+BAAC,kBAAD,WAAO,IAAK,sBAAM,QAAKC,KAAL,CAAaC,CAAnB,EAAZ,EAAuC,KAAKC,KAA5C,mDAAP,CACD,C,uBAHqBC,gB,EAMxBJ,UAAUK,SAAV,aACKC,8CADL,EAEEC,MAAOC,oBAAUC,SAAV,CAAoB,CACzBD,oBAAUE,MADe,CAEzBF,oBAAUG,MAFe,CAGzBH,oBAAUI,KAHe,CAApB,CAFT,CAOEC,OAAQL,oBAAUM,IAPpB,CAQEC,SAAUP,oBAAUM,IARtB,CASEE,KAAMR,oBAAUG,MATlB,GAYA,GAAMM,iBAAkB,yCACtB,sBADsB,CAEtB,EAFsB,CAGtBC,8BAHsB,EAItBlB,SAJsB,CAAxB,C,QAM4BA,S,CAAnBiB,e","file":"Thumbnail.js","sourcesContent":["import React, { Component } from 'react';\nimport PropTypes from 'prop-types';\nimport { Image } from 'react-native';\nimport { ImagePropTypes } from 'deprecated-react-native-prop-types';\nimport { connectStyle } from 'native-base-shoutem-theme';\n\nimport mapPropsToStyleNames from '../utils/mapPropsToStyleNames';\n\nclass Thumbnail extends Component {\n render() {\n return (this._root = c)} {...this.props} />;\n }\n}\n\nThumbnail.propTypes = {\n ...ImagePropTypes,\n style: PropTypes.oneOfType([\n PropTypes.object,\n PropTypes.number,\n PropTypes.array\n ]),\n square: PropTypes.bool,\n circular: PropTypes.bool,\n size: PropTypes.number\n};\n\nconst StyledThumbnail = connectStyle(\n 'NativeBase.Thumbnail',\n {},\n mapPropsToStyleNames\n)(Thumbnail);\n\nexport { StyledThumbnail as Thumbnail };\n"]} \ No newline at end of file diff --git a/dist/src/basic/Title.js b/dist/src/basic/Title.js index c1d2a0587..aff26a758 100644 --- a/dist/src/basic/Title.js +++ b/dist/src/basic/Title.js @@ -1,2 +1,2 @@ -Object.defineProperty(exports,"__esModule",{value:true});exports.Title=undefined;var _extends=Object.assign||function(target){for(var i=1;i (this._root = c)} numberOfLines={1} {...this.props} />\n );\n }\n}\n\nTitle.propTypes = {\n ...Text.propTypes,\n style: PropTypes.oneOfType([\n PropTypes.object,\n PropTypes.number,\n PropTypes.array\n ])\n};\n\nconst StyledTitle = connectStyle('NativeBase.Title', {}, mapPropsToStyleNames)(\n Title\n);\nexport { StyledTitle as Title };\n"]} \ No newline at end of file +{"version":3,"sources":["../../../src/basic/Title.js"],"names":["Title","_root","c","props","Component","propTypes","TextPropTypes","style","PropTypes","oneOfType","object","number","array","StyledTitle","mapPropsToStyleNames"],"mappings":"q1BAAA,4B,2CACA,qC,mDACA,yCACA,kFACA,iEAEA,mE,68BAEMA,M,uQACK,iBACP,MACE,+BAAC,iBAAD,WAAM,IAAK,sBAAM,QAAKC,KAAL,CAAaC,CAAnB,EAAX,CAAkC,cAAe,CAAjD,EAAwD,KAAKC,KAA7D,mDADF,CAGD,C,mBALiBC,gB,EAQpBJ,MAAMK,SAAN,aACKC,6CADL,EAEEC,MAAOC,oBAAUC,SAAV,CAAoB,CACzBD,oBAAUE,MADe,CAEzBF,oBAAUG,MAFe,CAGzBH,oBAAUI,KAHe,CAApB,CAFT,GASA,GAAMC,aAAc,yCAClB,kBADkB,CAElB,EAFkB,CAGlBC,8BAHkB,EAIlBd,KAJkB,CAApB,C,QAKwBA,K,CAAfa,W","file":"Title.js","sourcesContent":["import React, { Component } from 'react';\nimport PropTypes from 'prop-types';\nimport { Text } from 'react-native';\nimport { TextPropTypes } from 'deprecated-react-native-prop-types';\nimport { connectStyle } from 'native-base-shoutem-theme';\n\nimport mapPropsToStyleNames from '../utils/mapPropsToStyleNames';\n\nclass Title extends Component {\n render() {\n return (\n (this._root = c)} numberOfLines={1} {...this.props} />\n );\n }\n}\n\nTitle.propTypes = {\n ...TextPropTypes,\n style: PropTypes.oneOfType([\n PropTypes.object,\n PropTypes.number,\n PropTypes.array\n ])\n};\n\nconst StyledTitle = connectStyle(\n 'NativeBase.Title',\n {},\n mapPropsToStyleNames\n)(Title);\nexport { StyledTitle as Title };\n"]} \ No newline at end of file diff --git a/dist/src/basic/Toast.js b/dist/src/basic/Toast.js index 10d56fa2b..76d1d76d3 100644 --- a/dist/src/basic/Toast.js +++ b/dist/src/basic/Toast.js @@ -1,2 +1,2 @@ -Object.defineProperty(exports,"__esModule",{value:true});exports.Toast=undefined;var _extends=Object.assign||function(target){for(var i=1;i (this._root = c)} {...this.props} />;\n }\n}\n\nToast.propTypes = {\n ...ViewPropTypes,\n style: PropTypes.oneOfType([\n PropTypes.object,\n PropTypes.number,\n PropTypes.array\n ])\n};\n\nconst StyledToast = connectStyle('NativeBase.Toast', {}, mapPropsToStyleNames)(\n Toast\n);\nexport { StyledToast as Toast };\n"]} \ No newline at end of file +{"version":3,"sources":["../../../src/basic/Toast.js"],"names":["Toast","_root","c","props","Component","propTypes","ViewPropTypes","style","PropTypes","oneOfType","object","number","array","StyledToast","mapPropsToStyleNames"],"mappings":"q1BAAA,4B,2CACA,qC,mDACA,yCACA,kFACA,iEAEA,mE,68BAEMA,M,uQACK,iBACP,MAAO,+BAAC,iBAAD,WAAM,IAAK,sBAAM,QAAKC,KAAL,CAAaC,CAAnB,EAAX,EAAsC,KAAKC,KAA3C,mDAAP,CACD,C,mBAHiBC,gB,EAMpBJ,MAAMK,SAAN,aACKC,6CADL,EAEEC,MAAOC,oBAAUC,SAAV,CAAoB,CACzBD,oBAAUE,MADe,CAEzBF,oBAAUG,MAFe,CAGzBH,oBAAUI,KAHe,CAApB,CAFT,GASA,GAAMC,aAAc,yCAClB,kBADkB,CAElB,EAFkB,CAGlBC,8BAHkB,EAIlBd,KAJkB,CAApB,C,QAKwBA,K,CAAfa,W","file":"Toast.js","sourcesContent":["import React, { Component } from 'react';\nimport PropTypes from 'prop-types';\nimport { View } from 'react-native';\nimport { ViewPropTypes } from 'deprecated-react-native-prop-types';\nimport { connectStyle } from 'native-base-shoutem-theme';\n\nimport mapPropsToStyleNames from '../utils/mapPropsToStyleNames';\n\nclass Toast extends Component {\n render() {\n return (this._root = c)} {...this.props} />;\n }\n}\n\nToast.propTypes = {\n ...ViewPropTypes,\n style: PropTypes.oneOfType([\n PropTypes.object,\n PropTypes.number,\n PropTypes.array\n ])\n};\n\nconst StyledToast = connectStyle(\n 'NativeBase.Toast',\n {},\n mapPropsToStyleNames\n)(Toast);\nexport { StyledToast as Toast };\n"]} \ No newline at end of file diff --git a/dist/src/basic/ToastContainer.js b/dist/src/basic/ToastContainer.js index 832b3e8e0..0b28e2ca2 100644 --- a/dist/src/basic/ToastContainer.js +++ b/dist/src/basic/ToastContainer.js @@ -1,2 +1,2 @@ -Object.defineProperty(exports,"__esModule",{value:true});exports.ToastContainer=undefined;var _extends=Object.assign||function(target){for(var i=1;i=0)continue;if(!Object.prototype.hasOwnProperty.call(obj,i))continue;target[i]=obj[i];}return target;}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function");}}function _possibleConstructorReturn(self,call){if(!self){throw new ReferenceError("this hasn't been initialised - super() hasn't been called");}return call&&(typeof call==="object"||typeof call==="function")?call:self;}function _inherits(subClass,superClass){if(typeof superClass!=="function"&&superClass!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);}subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:false,writable:true,configurable:true}});if(superClass)Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass;}var POSITION={ABSOLUTE:'absolute',BOTTOM:'bottom',TOP:'top'};var ToastContainer=function(_Component){_inherits(ToastContainer,_Component);_createClass(ToastContainer,null,[{key:'show',value:function show(_ref){var config=_objectWithoutProperties(_ref,[]);this.toastInstance._root.showToast({config:config});}},{key:'hide',value:function hide(){if(this.toastInstance._root.getModalState()){this.toastInstance._root.closeToast('functionCall');}}}]);function ToastContainer(props){_classCallCheck(this,ToastContainer);var _this=_possibleConstructorReturn(this,(ToastContainer.__proto__||Object.getPrototypeOf(ToastContainer)).call(this,props));_this.closeModal=function(reason){_this.setState({modalVisible:false});var onClose=_this.state.onClose;if(onClose&&typeof onClose==='function'){onClose(reason);}};_this.state={fadeAnim:new _reactNative.Animated.Value(0),pan:new _reactNative.Animated.ValueXY({x:0,y:0}),keyboardHeight:0,isKeyboardVisible:false,modalVisible:false};_this.keyboardDidHide=_this.keyboardDidHide.bind(_this);_this.keyboardDidShow=_this.keyboardDidShow.bind(_this);_this._panResponder=_reactNative.PanResponder.create({onMoveShouldSetPanResponderCapture:function onMoveShouldSetPanResponderCapture(){return true;},onPanResponderRelease:function onPanResponderRelease(evt,_ref2){var dx=_ref2.dx;if(dx!==0){_reactNative.Animated.timing(_this.state.pan,{toValue:{x:dx,y:0},duration:100,useNativeDriver:false}).start(function(){return _this.closeToast('swipe');});}}});return _this;}_createClass(ToastContainer,[{key:'componentDidMount',value:function componentDidMount(){_reactNative.Keyboard.addListener('keyboardDidShow',this.keyboardDidShow);_reactNative.Keyboard.addListener('keyboardDidHide',this.keyboardDidHide);}},{key:'componentWillUnmount',value:function componentWillUnmount(){_reactNative.Keyboard.removeListener('keyboardDidShow',this.keyboardDidShow);_reactNative.Keyboard.removeListener('keyboardDidHide',this.keyboardDidHide);}},{key:'getToastStyle',value:function getToastStyle(){return{position:POSITION.ABSOLUTE,opacity:this.state.fadeAnim,width:'100%',elevation:9,paddingHorizontal:_reactNative.Platform.OS===_commonColor.PLATFORM.IOS?20:0,top:this.state.position===POSITION.TOP?30:undefined,bottom:this.state.position===POSITION.BOTTOM?this.getTop():undefined};}},{key:'getTop',value:function getTop(){if(_reactNative.Platform.OS===_commonColor.PLATFORM.IOS){if(this.state.isKeyboardVisible){return this.state.keyboardHeight;}return 30;}return 0;}},{key:'getButtonText',value:function getButtonText(buttonText){if(buttonText){if(buttonText.trim().length===0){return undefined;}return buttonText;}return undefined;}},{key:'getModalState',value:function getModalState(){return this.state.modalVisible;}},{key:'keyboardDidHide',value:function keyboardDidHide(){this.setState({keyboardHeight:0,isKeyboardVisible:false});}},{key:'keyboardDidShow',value:function keyboardDidShow(e){this.setState({keyboardHeight:e.endCoordinates.height,isKeyboardVisible:true});}},{key:'showToast',value:function showToast(_ref3){var config=_ref3.config;this.setState({modalVisible:true,text:config.text,buttonText:this.getButtonText(config.buttonText),type:config.type,position:config.position?config.position:POSITION.BOTTOM,supportedOrientations:config.supportedOrientations,style:config.style,buttonTextStyle:config.buttonTextStyle,buttonStyle:config.buttonStyle,textStyle:config.textStyle,onClose:config.onClose,swipeDisabled:config.swipeDisabled||false});if(this.closeTimeout){clearTimeout(this.closeTimeout);}if(config.duration!==0){var duration=config.duration>0?config.duration:1500;this.closeTimeout=setTimeout(this.closeToast.bind(this,'timeout'),duration);}_reactNative.Animated.timing(this.state.fadeAnim,{toValue:1,duration:200,useNativeDriver:false}).start();}},{key:'closeToast',value:function closeToast(reason){var _this2=this;clearTimeout(this.closeTimeout);_reactNative.Animated.timing(this.state.fadeAnim,{toValue:0,duration:200,useNativeDriver:false}).start(function(){_this2.closeModal(reason);_this2.state.pan.setValue({x:0,y:0});});}},{key:'render',value:function render(){var _this3=this;if(this.state.modalVisible){var _state$pan=this.state.pan,x=_state$pan.x,y=_state$pan.y;return _react2.default.createElement(_reactNative.Animated.View,_extends({},this.state.swipeDisabled?{}:this._panResponder.panHandlers,{style:[this.getToastStyle(),{transform:[{translateX:x},{translateY:y}]}],__source:{fileName:_jsxFileName,lineNumber:182}}),_react2.default.createElement(_Toast.Toast,{style:[this.state.style],danger:this.state.type==='danger',success:this.state.type==='success',warning:this.state.type==='warning',__source:{fileName:_jsxFileName,lineNumber:189}},_react2.default.createElement(_Text.Text,{style:this.state.textStyle,__source:{fileName:_jsxFileName,lineNumber:195}},this.state.text),this.state.buttonText&&_react2.default.createElement(_Button.Button,{style:this.state.buttonStyle,onPress:function onPress(){return _this3.closeToast('user');},__source:{fileName:_jsxFileName,lineNumber:197}},_react2.default.createElement(_Text.Text,{style:this.state.buttonTextStyle,__source:{fileName:_jsxFileName,lineNumber:201}},this.state.buttonText))));}return null;}}]);return ToastContainer;}(_react.Component);ToastContainer.propTypes=_extends({},_reactNative.ViewPropTypes);var StyledToastContainer=(0,_nativeBaseShoutemTheme.connectStyle)('NativeBase.ToastContainer',{},_mapPropsToStyleNames2.default)(ToastContainer);exports.ToastContainer=StyledToastContainer; +Object.defineProperty(exports,"__esModule",{value:true});exports.ToastContainer=undefined;var _extends=Object.assign||function(target){for(var i=1;i=0)continue;if(!Object.prototype.hasOwnProperty.call(obj,i))continue;target[i]=obj[i];}return target;}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function");}}function _possibleConstructorReturn(self,call){if(!self){throw new ReferenceError("this hasn't been initialised - super() hasn't been called");}return call&&(typeof call==="object"||typeof call==="function")?call:self;}function _inherits(subClass,superClass){if(typeof superClass!=="function"&&superClass!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);}subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:false,writable:true,configurable:true}});if(superClass)Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass;}var POSITION={ABSOLUTE:'absolute',BOTTOM:'bottom',TOP:'top'};var ToastContainer=function(_Component){_inherits(ToastContainer,_Component);_createClass(ToastContainer,null,[{key:'show',value:function show(_ref){var config=_objectWithoutProperties(_ref,[]);this.toastInstance._root.showToast({config:config});}},{key:'hide',value:function hide(){if(this.toastInstance._root.getModalState()){this.toastInstance._root.closeToast('functionCall');}}}]);function ToastContainer(props){_classCallCheck(this,ToastContainer);var _this=_possibleConstructorReturn(this,(ToastContainer.__proto__||Object.getPrototypeOf(ToastContainer)).call(this,props));_this.closeModal=function(reason){_this.setState({modalVisible:false});var onClose=_this.state.onClose;if(onClose&&typeof onClose==='function'){onClose(reason);}};_this.state={fadeAnim:new _reactNative.Animated.Value(0),pan:new _reactNative.Animated.ValueXY({x:0,y:0}),keyboardHeight:0,isKeyboardVisible:false,modalVisible:false};_this.keyboardDidHide=_this.keyboardDidHide.bind(_this);_this.keyboardDidShow=_this.keyboardDidShow.bind(_this);_this._panResponder=_reactNative.PanResponder.create({onMoveShouldSetPanResponderCapture:function onMoveShouldSetPanResponderCapture(){return true;},onPanResponderRelease:function onPanResponderRelease(evt,_ref2){var dx=_ref2.dx;if(dx!==0){_reactNative.Animated.timing(_this.state.pan,{toValue:{x:dx,y:0},duration:100,useNativeDriver:false}).start(function(){return _this.closeToast('swipe');});}}});return _this;}_createClass(ToastContainer,[{key:'componentDidMount',value:function componentDidMount(){_reactNative.Keyboard.addListener('keyboardDidShow',this.keyboardDidShow);_reactNative.Keyboard.addListener('keyboardDidHide',this.keyboardDidHide);}},{key:'componentWillUnmount',value:function componentWillUnmount(){_reactNative.Keyboard.removeListener('keyboardDidShow',this.keyboardDidShow);_reactNative.Keyboard.removeListener('keyboardDidHide',this.keyboardDidHide);}},{key:'getToastStyle',value:function getToastStyle(){return{position:POSITION.ABSOLUTE,opacity:this.state.fadeAnim,width:'100%',elevation:9,paddingHorizontal:_reactNative.Platform.OS===_commonColor.PLATFORM.IOS?20:0,top:this.state.position===POSITION.TOP?30:undefined,bottom:this.state.position===POSITION.BOTTOM?this.getTop():undefined};}},{key:'getTop',value:function getTop(){if(_reactNative.Platform.OS===_commonColor.PLATFORM.IOS){if(this.state.isKeyboardVisible){return this.state.keyboardHeight;}return 30;}return 0;}},{key:'getButtonText',value:function getButtonText(buttonText){if(buttonText){if(buttonText.trim().length===0){return undefined;}return buttonText;}return undefined;}},{key:'getModalState',value:function getModalState(){return this.state.modalVisible;}},{key:'keyboardDidHide',value:function keyboardDidHide(){this.setState({keyboardHeight:0,isKeyboardVisible:false});}},{key:'keyboardDidShow',value:function keyboardDidShow(e){this.setState({keyboardHeight:e.endCoordinates.height,isKeyboardVisible:true});}},{key:'showToast',value:function showToast(_ref3){var config=_ref3.config;this.setState({modalVisible:true,text:config.text,buttonText:this.getButtonText(config.buttonText),type:config.type,position:config.position?config.position:POSITION.BOTTOM,supportedOrientations:config.supportedOrientations,style:config.style,buttonTextStyle:config.buttonTextStyle,buttonStyle:config.buttonStyle,textStyle:config.textStyle,onClose:config.onClose,swipeDisabled:config.swipeDisabled||false});if(this.closeTimeout){clearTimeout(this.closeTimeout);}if(config.duration!==0){var duration=config.duration>0?config.duration:1500;this.closeTimeout=setTimeout(this.closeToast.bind(this,'timeout'),duration);}_reactNative.Animated.timing(this.state.fadeAnim,{toValue:1,duration:200,useNativeDriver:false}).start();}},{key:'closeToast',value:function closeToast(reason){var _this2=this;clearTimeout(this.closeTimeout);_reactNative.Animated.timing(this.state.fadeAnim,{toValue:0,duration:200,useNativeDriver:false}).start(function(){_this2.closeModal(reason);_this2.state.pan.setValue({x:0,y:0});});}},{key:'render',value:function render(){var _this3=this;if(this.state.modalVisible){var _state$pan=this.state.pan,x=_state$pan.x,y=_state$pan.y;return _react2.default.createElement(_reactNative.Animated.View,_extends({},this.state.swipeDisabled?{}:this._panResponder.panHandlers,{style:[this.getToastStyle(),{transform:[{translateX:x},{translateY:y}]}],__source:{fileName:_jsxFileName,lineNumber:177}}),_react2.default.createElement(_Toast.Toast,{style:[this.state.style],danger:this.state.type==='danger',success:this.state.type==='success',warning:this.state.type==='warning',__source:{fileName:_jsxFileName,lineNumber:184}},_react2.default.createElement(_Text.Text,{style:this.state.textStyle,__source:{fileName:_jsxFileName,lineNumber:190}},this.state.text),this.state.buttonText&&_react2.default.createElement(_Button.Button,{style:this.state.buttonStyle,onPress:function onPress(){return _this3.closeToast('user');},__source:{fileName:_jsxFileName,lineNumber:192}},_react2.default.createElement(_Text.Text,{style:this.state.buttonTextStyle,__source:{fileName:_jsxFileName,lineNumber:196}},this.state.buttonText))));}return null;}}]);return ToastContainer;}(_react.Component);ToastContainer.propTypes=_extends({},_deprecatedReactNativePropTypes.ViewPropTypes);var StyledToastContainer=(0,_nativeBaseShoutemTheme.connectStyle)('NativeBase.ToastContainer',{},_mapPropsToStyleNames2.default)(ToastContainer);exports.ToastContainer=StyledToastContainer; //# sourceMappingURL=ToastContainer.js.map \ No newline at end of file diff --git a/dist/src/basic/ToastContainer.js.map b/dist/src/basic/ToastContainer.js.map index 7207b3695..b27591ebf 100644 --- a/dist/src/basic/ToastContainer.js.map +++ b/dist/src/basic/ToastContainer.js.map @@ -1 +1 @@ -{"version":3,"sources":["../../../src/basic/ToastContainer.js"],"names":["POSITION","ABSOLUTE","BOTTOM","TOP","ToastContainer","config","toastInstance","_root","showToast","getModalState","closeToast","props","closeModal","reason","setState","modalVisible","onClose","state","fadeAnim","Animated","Value","pan","ValueXY","x","y","keyboardHeight","isKeyboardVisible","keyboardDidHide","bind","keyboardDidShow","_panResponder","PanResponder","create","onMoveShouldSetPanResponderCapture","onPanResponderRelease","evt","dx","timing","toValue","duration","useNativeDriver","start","Keyboard","addListener","removeListener","position","opacity","width","elevation","paddingHorizontal","Platform","OS","PLATFORM","IOS","top","undefined","bottom","getTop","buttonText","trim","length","e","endCoordinates","height","text","getButtonText","type","supportedOrientations","style","buttonTextStyle","buttonStyle","textStyle","swipeDisabled","closeTimeout","clearTimeout","setTimeout","setValue","panHandlers","getToastStyle","transform","translateX","translateY","Component","propTypes","ViewPropTypes","StyledToastContainer","mapPropsToStyleNames"],"mappings":"u2BACA,4B,2CACA,yCAOA,iEAEA,mE,yEACA,2DAEA,4BACA,gCACA,8B,skCAEA,GAAMA,UAAW,CACfC,SAAU,UADK,CAEfC,OAAQ,QAFO,CAGfC,IAAK,KAHU,CAAjB,C,GAMMC,e,kIACuB,IAAVC,OAAU,mCACzB,KAAKC,aAAL,CAAmBC,KAAnB,CAAyBC,SAAzB,CAAmC,CAAEH,aAAF,CAAnC,EACD,C,mCACa,CACZ,GAAI,KAAKC,aAAL,CAAmBC,KAAnB,CAAyBE,aAAzB,EAAJ,CAA8C,CAC5C,KAAKH,aAAL,CAAmBC,KAAnB,CAAyBG,UAAzB,CAAoC,cAApC,EACD,CACF,C,IACD,wBAAYC,KAAZ,CAAmB,4JACXA,KADW,SA2HnBC,UA3HmB,CA2HN,SAACC,MAAD,CAAY,CACvB,MAAKC,QAAL,CAAc,CACZC,aAAc,KADF,CAAd,EADuB,GAIfC,QAJe,CAIH,MAAKC,KAJF,CAIfD,OAJe,CAKvB,GAAIA,SAAW,MAAOA,QAAP,GAAmB,UAAlC,CAA8C,CAC5CA,QAAQH,MAAR,EACD,CACF,CAnIkB,CAGjB,MAAKI,KAAL,CAAa,CACXC,SAAU,GAAIC,uBAASC,KAAb,CAAmB,CAAnB,CADC,CAEXC,IAAK,GAAIF,uBAASG,OAAb,CAAqB,CAAEC,EAAG,CA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AEC,UAAW,CAAC,CAAEC,WAAYzD,CAAd,CAAD,CAAoB,CAAE0D,WAAYzD,CAAd,CAApB,CAAb,CAFK,CAFT,mDAOE,8BAAC,YAAD,EACE,MAAO,CAAC,KAAKP,KAAL,CAAWmD,KAAZ,CADT,CAEE,OAAQ,KAAKnD,KAAL,CAAWiD,IAAX,GAAoB,QAF9B,CAGE,QAAS,KAAKjD,KAAL,CAAWiD,IAAX,GAAoB,SAH/B,CAIE,QAAS,KAAKjD,KAAL,CAAWiD,IAAX,GAAoB,SAJ/B,kDAME,8BAAC,UAAD,EAAM,MAAO,KAAKjD,KAAL,CAAWsD,SAAxB,kDAAoC,KAAKtD,KAAL,CAAW+C,IAA/C,CANF,CAOG,KAAK/C,KAAL,CAAWyC,UAAX,EACC,8BAAC,cAAD,EACE,MAAO,KAAKzC,KAAL,CAAWqD,WADpB,CAEE,QAAS,yBAAM,QAAK5D,UAAL,CAAgB,MAAhB,CAAN,EAFX,kDAIE,8BAAC,UAAD,EAAM,MAAO,KAAKO,KAAL,CAAWoD,eAAxB,kDACG,KAAKpD,KAAL,CAAWyC,UADd,CAJF,CARJ,CAPF,CADF,CA4BD,CACD,MAAO,KAAP,CACD,C,4BA1L0BwB,gB,EA6L7B9E,eAAe+E,SAAf,aACKC,0BADL,EAIA,GAAMC,sBAAuB,yCAC3B,2BAD2B,CAE3B,EAF2B,CAG3BC,8BAH2B,EAI3BlF,cAJ2B,CAA7B,C,QAMiCA,c,CAAxBiF,oB","file":"ToastContainer.js","sourcesContent":["/* eslint-disable class-methods-use-this */\nimport React, { Component } from 'react';\nimport {\n Keyboard,\n Platform,\n Animated,\n ViewPropTypes,\n PanResponder,\n} from 'react-native';\nimport { connectStyle } from 'native-base-shoutem-theme';\n\nimport mapPropsToStyleNames from '../utils/mapPropsToStyleNames';\nimport { PLATFORM } from '../theme/variables/commonColor';\n\nimport { Text } from './Text';\nimport { Button } from './Button';\nimport { Toast } from './Toast';\n\nconst POSITION = {\n ABSOLUTE: 'absolute',\n BOTTOM: 'bottom',\n TOP: 'top',\n};\n\nclass ToastContainer extends Component {\n static show({ ...config }) {\n this.toastInstance._root.showToast({ config });\n }\n static hide() {\n if (this.toastInstance._root.getModalState()) {\n this.toastInstance._root.closeToast('functionCall');\n }\n }\n constructor(props) {\n super(props);\n\n this.state = {\n fadeAnim: new Animated.Value(0),\n pan: new Animated.ValueXY({ x: 0, y: 0 }),\n keyboardHeight: 0,\n isKeyboardVisible: false,\n modalVisible: false,\n };\n\n this.keyboardDidHide = this.keyboardDidHide.bind(this);\n this.keyboardDidShow = this.keyboardDidShow.bind(this);\n this._panResponder = PanResponder.create({\n onMoveShouldSetPanResponderCapture: () => true,\n onPanResponderRelease: (evt, { dx }) => {\n if (dx !== 0) {\n Animated.timing(this.state.pan, {\n toValue: { x: dx, y: 0 },\n duration: 100,\n useNativeDriver: false\n }).start(() => this.closeToast('swipe'));\n }\n },\n });\n }\n\n componentDidMount() {\n Keyboard.addListener('keyboardDidShow', this.keyboardDidShow);\n Keyboard.addListener('keyboardDidHide', this.keyboardDidHide);\n }\n\n componentWillUnmount() {\n Keyboard.removeListener('keyboardDidShow', this.keyboardDidShow);\n Keyboard.removeListener('keyboardDidHide', this.keyboardDidHide);\n }\n\n getToastStyle() {\n return {\n position: POSITION.ABSOLUTE,\n opacity: this.state.fadeAnim,\n width: '100%',\n elevation: 9,\n paddingHorizontal: Platform.OS === PLATFORM.IOS ? 20 : 0,\n top: this.state.position === POSITION.TOP ? 30 : undefined,\n bottom:\n this.state.position === POSITION.BOTTOM ? this.getTop() : undefined,\n };\n }\n\n getTop() {\n if (Platform.OS === PLATFORM.IOS) {\n if (this.state.isKeyboardVisible) {\n return this.state.keyboardHeight;\n }\n return 30;\n }\n return 0;\n }\n\n getButtonText(buttonText) {\n if (buttonText) {\n if (buttonText.trim().length === 0) {\n return undefined;\n }\n return buttonText;\n }\n return undefined;\n }\n getModalState() {\n return this.state.modalVisible;\n }\n\n static toastInstance;\n\n keyboardDidHide() {\n this.setState({\n keyboardHeight: 0,\n isKeyboardVisible: false,\n });\n }\n\n keyboardDidShow(e) {\n this.setState({\n keyboardHeight: e.endCoordinates.height,\n isKeyboardVisible: true,\n });\n }\n\n showToast({ config }) {\n this.setState({\n modalVisible: true,\n text: config.text,\n buttonText: this.getButtonText(config.buttonText),\n type: config.type,\n position: config.position ? config.position : POSITION.BOTTOM,\n supportedOrientations: config.supportedOrientations,\n style: config.style,\n buttonTextStyle: config.buttonTextStyle,\n buttonStyle: config.buttonStyle,\n textStyle: config.textStyle,\n onClose: config.onClose,\n swipeDisabled: config.swipeDisabled || false\n });\n // If we have a toast already open, cut off its close timeout so that it won't affect *this* toast.\n if (this.closeTimeout) {\n clearTimeout(this.closeTimeout);\n }\n // Set the toast to close after the duration.\n if (config.duration !== 0) {\n const duration = config.duration > 0 ? config.duration : 1500;\n this.closeTimeout = setTimeout(\n this.closeToast.bind(this, 'timeout'),\n duration\n );\n }\n // Fade the toast in now.\n Animated.timing(this.state.fadeAnim, {\n toValue: 1,\n duration: 200,\n useNativeDriver: false,\n }).start();\n }\n closeModal = (reason) => {\n this.setState({\n modalVisible: false,\n });\n const { onClose } = this.state;\n if (onClose && typeof onClose === 'function') {\n onClose(reason);\n }\n };\n closeToast(reason) {\n clearTimeout(this.closeTimeout);\n Animated.timing(this.state.fadeAnim, {\n toValue: 0,\n duration: 200,\n useNativeDriver: false,\n }).start(() => {\n this.closeModal(reason);\n this.state.pan.setValue({ x: 0, y: 0 });\n });\n }\n\n render() {\n if (this.state.modalVisible) {\n const { x, y } = this.state.pan;\n return (\n \n \n {this.state.text}\n {this.state.buttonText && (\n this.closeToast('user')}\n >\n \n {this.state.buttonText}\n \n \n )}\n \n \n );\n }\n return null;\n }\n}\n\nToastContainer.propTypes = {\n ...ViewPropTypes,\n};\n\nconst StyledToastContainer = connectStyle(\n 'NativeBase.ToastContainer',\n {},\n mapPropsToStyleNames\n)(ToastContainer);\n\nexport { StyledToastContainer as ToastContainer };\n"]} \ No newline at end of file +{"version":3,"sources":["../../../src/basic/ToastContainer.js"],"names":["POSITION","ABSOLUTE","BOTTOM","TOP","ToastContainer","config","toastInstance","_root","showToast","getModalState","closeToast","props","closeModal","setState","modalVisible","onClose","state","reason","fadeAnim","Animated","Value","pan","ValueXY","x","y","keyboardHeight","isKeyboardVisible","keyboardDidHide","bind","keyboardDidShow","_panResponder","PanResponder","create","onMoveShouldSetPanResponderCapture","onPanResponderRelease","evt","dx","timing","toValue","duration","useNativeDriver","start","Keyboard","addListener","removeListener","position","opacity","width","elevation","paddingHorizontal","Platform","OS","PLATFORM","IOS","top","undefined","bottom","getTop","buttonText","trim","length","e","endCoordinates","height","text","getButtonText","type","supportedOrientations","style","buttonTextStyle","buttonStyle","textStyle","swipeDisabled","closeTimeout","clearTimeout","setTimeout","setValue","panHandlers","getToastStyle","transform","translateX","translateY","Component","propTypes","ViewPropTypes","StyledToastContainer","mapPropsToStyleNames"],"mappings":"u2BACA,4B,2CACA,yCACA,kFACA,iEAEA,mE,yEACA,2DAEA,4BACA,gCACA,8B,skCAEA,GAAMA,UAAW,CACfC,SAAU,UADK,CAEfC,OAAQ,QAFO,CAGfC,IAAK,KAHU,CAAjB,C,GAMMC,e,kIACuB,IAAVC,OAAU,mCACzB,KAAKC,aAAL,CAAmBC,KAAnB,CAAyBC,SAAzB,CAAmC,CAAEH,aAAF,CAAnC,EACD,C,mCACa,CACZ,GAAI,KAAKC,aAAL,CAAmBC,KAAnB,CAAyBE,aAAzB,EAAJ,CAA8C,CAC5C,KAAKH,aAAL,CAAmBC,KAAnB,CAAyBG,UAAzB,CAAoC,cAApC,EACD,CACF,C,IACD,wBAAYC,KAAZ,CAAmB,4JACXA,KADW,SA2HnBC,UA3HmB,CA2HN,gBAAU,CACrB,MAAKC,QAAL,CAAc,CACZC,aAAc,KADF,CAAd,EADqB,GAIbC,QAJa,CAID,MAAKC,KAJJ,CAIbD,OAJa,CAKrB,GAAIA,SAAW,MAAOA,QAAP,GAAmB,UAAlC,C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,YAChBA,CADgB,CAE3B,MACE,+BAAC,qBAAD,CAAU,IAAV,aACO,KAAKR,KAAL,CAAWwD,aAAX,CAA2B,EAA3B,CAAgC,KAAK1C,aAAL,CAAmB+C,WAD1D,EAEE,MAAO,CACL,KAAKC,aAAL,EADK,CAEL,CAAEC,UAAW,CAAC,CAAEC,WAAYzD,CAAd,CAAD,CAAoB,CAAE0D,WAAYzD,CAAd,CAApB,CAAb,CAFK,CAFT,mDAOE,8BAAC,YAAD,EACE,MAAO,CAAC,KAAKR,KAAL,CAAWoD,KAAZ,CADT,CAEE,OAAQ,KAAKpD,KAAL,CAAWkD,IAAX,GAAoB,QAF9B,CAGE,QAAS,KAAKlD,KAAL,CAAWkD,IAAX,GAAoB,SAH/B,CAIE,QAAS,KAAKlD,KAAL,CAAWkD,IAAX,GAAoB,SAJ/B,kDAME,8BAAC,UAAD,EAAM,MAAO,KAAKlD,KAAL,CAAWuD,SAAxB,kDAAoC,KAAKvD,KAAL,CAAWgD,IAA/C,CANF,CAOG,KAAKhD,KAAL,CAAW0C,UAAX,EACC,8BAAC,cAAD,EACE,MAAO,KAAK1C,KAAL,CAAWsD,WADpB,CAEE,QAAS,yBAAM,QAAK5D,UAAL,CAAgB,MAAhB,CAAN,EAFX,kDAIE,8BAAC,UAAD,EAAM,MAAO,KAAKM,KAAL,CAAWqD,eAAxB,kDACG,KAAKrD,KAAL,CAAW0C,UADd,CAJF,CARJ,CAPF,CADF,CA4BD,CACD,MAAO,KAAP,CACD,C,4BA1L0BwB,gB,EA6L7B9E,eAAe+E,SAAf,aACKC,6CADL,EAIA,GAAMC,sBAAuB,yCAC3B,2BAD2B,CAE3B,EAF2B,CAG3BC,8BAH2B,EAI3BlF,cAJ2B,CAA7B,C,QAMiCA,c,CAAxBiF,oB","file":"ToastContainer.js","sourcesContent":["/* eslint-disable class-methods-use-this */\nimport React, { Component } from 'react';\nimport { Keyboard, Platform, Animated, PanResponder } from 'react-native';\nimport { ViewPropTypes } from 'deprecated-react-native-prop-types';\nimport { connectStyle } from 'native-base-shoutem-theme';\n\nimport mapPropsToStyleNames from '../utils/mapPropsToStyleNames';\nimport { PLATFORM } from '../theme/variables/commonColor';\n\nimport { Text } from './Text';\nimport { Button } from './Button';\nimport { Toast } from './Toast';\n\nconst POSITION = {\n ABSOLUTE: 'absolute',\n BOTTOM: 'bottom',\n TOP: 'top'\n};\n\nclass ToastContainer extends Component {\n static show({ ...config }) {\n this.toastInstance._root.showToast({ config });\n }\n static hide() {\n if (this.toastInstance._root.getModalState()) {\n this.toastInstance._root.closeToast('functionCall');\n }\n }\n constructor(props) {\n super(props);\n\n this.state = {\n fadeAnim: new Animated.Value(0),\n pan: new Animated.ValueXY({ x: 0, y: 0 }),\n keyboardHeight: 0,\n isKeyboardVisible: false,\n modalVisible: false\n };\n\n this.keyboardDidHide = this.keyboardDidHide.bind(this);\n this.keyboardDidShow = this.keyboardDidShow.bind(this);\n this._panResponder = PanResponder.create({\n onMoveShouldSetPanResponderCapture: () => true,\n onPanResponderRelease: (evt, { dx }) => {\n if (dx !== 0) {\n Animated.timing(this.state.pan, {\n toValue: { x: dx, y: 0 },\n duration: 100,\n useNativeDriver: false\n }).start(() => this.closeToast('swipe'));\n }\n }\n });\n }\n\n componentDidMount() {\n Keyboard.addListener('keyboardDidShow', this.keyboardDidShow);\n Keyboard.addListener('keyboardDidHide', this.keyboardDidHide);\n }\n\n componentWillUnmount() {\n Keyboard.removeListener('keyboardDidShow', this.keyboardDidShow);\n Keyboard.removeListener('keyboardDidHide', this.keyboardDidHide);\n }\n\n getToastStyle() {\n return {\n position: POSITION.ABSOLUTE,\n opacity: this.state.fadeAnim,\n width: '100%',\n elevation: 9,\n paddingHorizontal: Platform.OS === PLATFORM.IOS ? 20 : 0,\n top: this.state.position === POSITION.TOP ? 30 : undefined,\n bottom:\n this.state.position === POSITION.BOTTOM ? this.getTop() : undefined\n };\n }\n\n getTop() {\n if (Platform.OS === PLATFORM.IOS) {\n if (this.state.isKeyboardVisible) {\n return this.state.keyboardHeight;\n }\n return 30;\n }\n return 0;\n }\n\n getButtonText(buttonText) {\n if (buttonText) {\n if (buttonText.trim().length === 0) {\n return undefined;\n }\n return buttonText;\n }\n return undefined;\n }\n getModalState() {\n return this.state.modalVisible;\n }\n\n static toastInstance;\n\n keyboardDidHide() {\n this.setState({\n keyboardHeight: 0,\n isKeyboardVisible: false\n });\n }\n\n keyboardDidShow(e) {\n this.setState({\n keyboardHeight: e.endCoordinates.height,\n isKeyboardVisible: true\n });\n }\n\n showToast({ config }) {\n this.setState({\n modalVisible: true,\n text: config.text,\n buttonText: this.getButtonText(config.buttonText),\n type: config.type,\n position: config.position ? config.position : POSITION.BOTTOM,\n supportedOrientations: config.supportedOrientations,\n style: config.style,\n buttonTextStyle: config.buttonTextStyle,\n buttonStyle: config.buttonStyle,\n textStyle: config.textStyle,\n onClose: config.onClose,\n swipeDisabled: config.swipeDisabled || false\n });\n // If we have a toast already open, cut off its close timeout so that it won't affect *this* toast.\n if (this.closeTimeout) {\n clearTimeout(this.closeTimeout);\n }\n // Set the toast to close after the duration.\n if (config.duration !== 0) {\n const duration = config.duration > 0 ? config.duration : 1500;\n this.closeTimeout = setTimeout(\n this.closeToast.bind(this, 'timeout'),\n duration\n );\n }\n // Fade the toast in now.\n Animated.timing(this.state.fadeAnim, {\n toValue: 1,\n duration: 200,\n useNativeDriver: false\n }).start();\n }\n closeModal = reason => {\n this.setState({\n modalVisible: false\n });\n const { onClose } = this.state;\n if (onClose && typeof onClose === 'function') {\n onClose(reason);\n }\n };\n closeToast(reason) {\n clearTimeout(this.closeTimeout);\n Animated.timing(this.state.fadeAnim, {\n toValue: 0,\n duration: 200,\n useNativeDriver: false\n }).start(() => {\n this.closeModal(reason);\n this.state.pan.setValue({ x: 0, y: 0 });\n });\n }\n\n render() {\n if (this.state.modalVisible) {\n const { x, y } = this.state.pan;\n return (\n \n \n {this.state.text}\n {this.state.buttonText && (\n this.closeToast('user')}\n >\n \n {this.state.buttonText}\n \n \n )}\n \n \n );\n }\n return null;\n }\n}\n\nToastContainer.propTypes = {\n ...ViewPropTypes\n};\n\nconst StyledToastContainer = connectStyle(\n 'NativeBase.ToastContainer',\n {},\n mapPropsToStyleNames\n)(ToastContainer);\n\nexport { StyledToastContainer as ToastContainer };\n"]} \ No newline at end of file diff --git a/dist/src/basic/View.js b/dist/src/basic/View.js index f39212331..4591f4304 100644 --- a/dist/src/basic/View.js +++ b/dist/src/basic/View.js @@ -1,2 +1,2 @@ -Object.defineProperty(exports,"__esModule",{value:true});exports.ViewNB=undefined;var _extends=Object.assign||function(target){for(var i=1;i (this._root = c)} {...this.props} />;\n }\n}\n\nViewNB.propTypes = {\n ...ViewPropTypes,\n style: PropTypes.oneOfType([\n PropTypes.object,\n PropTypes.number,\n PropTypes.array\n ])\n};\n\nconst StyledViewNB = connectStyle(\n 'NativeBase.ViewNB',\n {},\n mapPropsToStyleNames\n)(ViewNB);\nexport { StyledViewNB as ViewNB };\n"]} \ No newline at end of file +{"version":3,"sources":["../../../src/basic/View.js"],"names":["ViewNB","_root","c","props","Component","propTypes","ViewPropTypes","style","PropTypes","oneOfType","object","number","array","StyledViewNB","mapPropsToStyleNames"],"mappings":"q1BAAA,4B,2CACA,qC,mDACA,yCACA,kFACA,iEAEA,mE,68BAEMA,O,6QACK,iBACP,MAAO,+BAAC,iBAAD,WAAM,IAAK,sBAAM,QAAKC,KAAL,CAAaC,CAAnB,EAAX,EAAsC,KAAKC,KAA3C,mDAAP,CACD,C,oBAHkBC,gB,EAMrBJ,OAAOK,SAAP,aACKC,6CADL,EAEEC,MAAOC,oBAAUC,SAAV,CAAoB,CACzBD,oBAAUE,MADe,CAEzBF,oBAAUG,MAFe,CAGzBH,oBAAUI,KAHe,CAApB,CAFT,GASA,GAAMC,cAAe,yCACnB,mBADmB,CAEnB,EAFmB,CAGnBC,8BAHmB,EAInBd,MAJmB,CAArB,C,QAKyBA,M,CAAhBa,Y","file":"View.js","sourcesContent":["import React, { Component } from 'react';\nimport PropTypes from 'prop-types';\nimport { View } from 'react-native';\nimport { ViewPropTypes } from 'deprecated-react-native-prop-types';\nimport { connectStyle } from 'native-base-shoutem-theme';\n\nimport mapPropsToStyleNames from '../utils/mapPropsToStyleNames';\n\nclass ViewNB extends Component {\n render() {\n return (this._root = c)} {...this.props} />;\n }\n}\n\nViewNB.propTypes = {\n ...ViewPropTypes,\n style: PropTypes.oneOfType([\n PropTypes.object,\n PropTypes.number,\n PropTypes.array\n ])\n};\n\nconst StyledViewNB = connectStyle(\n 'NativeBase.ViewNB',\n {},\n mapPropsToStyleNames\n)(ViewNB);\nexport { StyledViewNB as ViewNB };\n"]} \ No newline at end of file diff --git a/package.json b/package.json index 266f91af3..3d8dd4615 100644 --- a/package.json +++ b/package.json @@ -37,6 +37,7 @@ "clamp": "^1.0.1", "color": "~3.1.2", "create-react-class": "^15.6.3", + "deprecated-react-native-prop-types": "^2.3.0", "eslint-config-prettier": "^6.0.0", "fs-extra": "^2.0.0", "jest-react-native": "^18.0.0", diff --git a/src/basic/Actionsheet.js b/src/basic/Actionsheet.js index bf7f7c6a8..67ffb14e9 100644 --- a/src/basic/Actionsheet.js +++ b/src/basic/Actionsheet.js @@ -9,9 +9,9 @@ import { Modal, Platform, TouchableOpacity, - StyleSheet, - ViewPropTypes, + StyleSheet } from 'react-native'; +import { ViewPropTypes } from 'deprecated-react-native-prop-types'; import { connectStyle } from 'native-base-shoutem-theme'; import mapPropsToStyleNames from '../utils/mapPropsToStyleNames'; @@ -36,7 +36,7 @@ class ActionSheetContainer extends Component { super(props); this.state = { modalVisible: false, - items: [], + items: [] }; } @@ -53,7 +53,7 @@ class ActionSheetContainer extends Component { if (Platform.OS === PLATFORM.IOS) { if (typeof config.options[0] === 'object') { const options = config.options; - const filtered = options.map((item) => { + const filtered = options.map(item => { return item.text; }); @@ -72,7 +72,7 @@ class ActionSheetContainer extends Component { modalVisible: true, callback, style: config.style, - fontStyle: config.fontStyle, + fontStyle: config.fontStyle }); } } @@ -110,7 +110,7 @@ class ActionSheetContainer extends Component { String(index)} @@ -134,8 +134,8 @@ class ActionSheetContainer extends Component { style={[ styles.listItem, { - height: commonColor.listItemHeight, - }, + height: commonColor.listItemHeight + } ]} icon > @@ -144,7 +144,7 @@ class ActionSheetContainer extends Component { name={item.icon} type={item.iconType} style={{ - color: item.iconColor ? item.iconColor : undefined, + color: item.iconColor ? item.iconColor : undefined }} /> @@ -164,36 +164,36 @@ class ActionSheetContainer extends Component { } ActionSheetContainer.propTypes = { - ...ViewPropTypes, + ...ViewPropTypes }; const styles = StyleSheet.create({ containerTouchable: { backgroundColor: commonColor.containerTouchableBackgroundColor, flex: 1, - justifyContent: 'flex-end', + justifyContent: 'flex-end' }, flatList: { - marginHorizontal: commonColor.marginHorizontal, + marginHorizontal: commonColor.marginHorizontal }, innerTouchable: { backgroundColor: commonColor.innerTouchableBackgroundColor, minHeight: commonColor.minHeight, maxHeight: Dimensions.get('window').height / 2, padding: commonColor.padding, - elevation: commonColor.elevation, + elevation: commonColor.elevation }, listItem: { borderColor: commonColor.listItemBorderColor, - marginLeft: commonColor.marginLeft, + marginLeft: commonColor.marginLeft }, listItemBody: { borderColor: commonColor.listItemBorderColor, - paddingLeft: commonColor.marginLeft / 2, + paddingLeft: commonColor.marginLeft / 2 }, touchableText: { - color: commonColor.touchableTextColor, - }, + color: commonColor.touchableTextColor + } }); const StyledActionSheetContainer = connectStyle( diff --git a/src/basic/Badge.js b/src/basic/Badge.js index 4374c7e7d..37958d033 100644 --- a/src/basic/Badge.js +++ b/src/basic/Badge.js @@ -1,6 +1,7 @@ import React, { Component } from 'react'; import PropTypes from 'prop-types'; -import { View, ViewPropTypes } from 'react-native'; +import { View } from 'react-native'; +import { ViewPropTypes } from 'deprecated-react-native-prop-types'; import { connectStyle } from 'native-base-shoutem-theme'; import mapPropsToStyleNames from '../utils/mapPropsToStyleNames'; @@ -24,8 +25,10 @@ Badge.propTypes = { ]) }; -const StyledBadge = connectStyle('NativeBase.Badge', {}, mapPropsToStyleNames)( - Badge -); +const StyledBadge = connectStyle( + 'NativeBase.Badge', + {}, + mapPropsToStyleNames +)(Badge); export { StyledBadge as Badge }; diff --git a/src/basic/Body.js b/src/basic/Body.js index abbea7430..6bd9dfe23 100644 --- a/src/basic/Body.js +++ b/src/basic/Body.js @@ -1,6 +1,7 @@ import React, { Component } from 'react'; import PropTypes from 'prop-types'; -import { View, ViewPropTypes } from 'react-native'; +import { View } from 'react-native'; +import { ViewPropTypes } from 'deprecated-react-native-prop-types'; import { connectStyle } from 'native-base-shoutem-theme'; import mapPropsToStyleNames from '../utils/mapPropsToStyleNames'; @@ -20,8 +21,10 @@ Body.propTypes = { ]) }; -const StyledBody = connectStyle('NativeBase.Body', {}, mapPropsToStyleNames)( - Body -); +const StyledBody = connectStyle( + 'NativeBase.Body', + {}, + mapPropsToStyleNames +)(Body); export { StyledBody as Body }; diff --git a/src/basic/Card.js b/src/basic/Card.js index 1f68d0b92..c3e81f65a 100644 --- a/src/basic/Card.js +++ b/src/basic/Card.js @@ -1,6 +1,7 @@ import React, { Component } from 'react'; import PropTypes from 'prop-types'; -import { FlatList, View, ViewPropTypes } from 'react-native'; +import { FlatList, View } from 'react-native'; +import { ViewPropTypes } from 'deprecated-react-native-prop-types'; import { connectStyle } from 'native-base-shoutem-theme'; import mapPropsToStyleNames from '../utils/mapPropsToStyleNames'; @@ -37,8 +38,10 @@ Card.propTypes = { renderRow: PropTypes.func }; -const StyledCard = connectStyle('NativeBase.Card', {}, mapPropsToStyleNames)( - Card -); +const StyledCard = connectStyle( + 'NativeBase.Card', + {}, + mapPropsToStyleNames +)(Card); export { StyledCard as Card }; diff --git a/src/basic/DatePicker.js b/src/basic/DatePicker.js index 9782dd83e..d132ba2e2 100644 --- a/src/basic/DatePicker.js +++ b/src/basic/DatePicker.js @@ -2,8 +2,6 @@ import React from 'react'; import DateTimePicker from '@react-native-community/datetimepicker'; -import variable from '../theme/variables/platform'; - export class DatePicker extends React.Component { static defaultProps = { disabled: false @@ -41,10 +39,6 @@ export class DatePicker extends React.Component { timeZoneOffsetInMinutes } = this.props; - const variables = this.context.theme - ? this.context.theme['@@shoutem.theme/themeStyle'].variables - : variable; - return ( 0.2) { val = 0.2; } - Animated.timing(this.state.fadeAnim, { toValue: 0.8 + val, useNativeDriver: false }).start(); + Animated.timing(this.state.fadeAnim, { + toValue: 0.8 + val, + useNativeDriver: false + }).start(); Animated.spring(this.state.enter, { toValue: 0.8 + val, friction: 7, useNativeDriver: false }).start(); - Animated.event([null, { dx: this.state.pan.x }], { useNativeDriver: false })(e, gestureState); + Animated.event([null, { dx: this.state.pan.x }], { + useNativeDriver: false + })(e, gestureState); }, onPanResponderRelease: (e, { vx, vy }) => { @@ -178,8 +184,15 @@ class DeckSwiper extends Component { swipeRight() { if (this.props.onSwiping) this.props.onSwiping('right'); setTimeout(() => { - Animated.timing(this.state.fadeAnim, { toValue: 1, useNativeDriver: false }).start(); - Animated.spring(this.state.enter, { toValue: 1, friction: 7, useNativeDriver: false }).start(); + Animated.timing(this.state.fadeAnim, { + toValue: 1, + useNativeDriver: false + }).start(); + Animated.spring(this.state.enter, { + toValue: 1, + friction: 7, + useNativeDriver: false + }).start(); this.selectNext(); Animated.decay(this.state.pan, { velocity: { x: 8, y: 1 }, @@ -192,8 +205,15 @@ class DeckSwiper extends Component { swipeLeft() { if (this.props.onSwiping) this.props.onSwiping('left'); setTimeout(() => { - Animated.timing(this.state.fadeAnim, { toValue: 1, useNativeDriver: false }).start(); - Animated.spring(this.state.enter, { toValue: 1, friction: 7, useNativeDriver: false }).start(); + Animated.timing(this.state.fadeAnim, { + toValue: 1, + useNativeDriver: false + }).start(); + Animated.spring(this.state.enter, { + toValue: 1, + friction: 7, + useNativeDriver: false + }).start(); this.selectNext(); Animated.decay(this.state.pan, { velocity: { x: -8, y: 1 }, diff --git a/src/basic/Footer.js b/src/basic/Footer.js index b4cb74794..d8262d356 100644 --- a/src/basic/Footer.js +++ b/src/basic/Footer.js @@ -1,6 +1,7 @@ import React, { Component } from 'react'; import PropTypes from 'prop-types'; -import { View, ViewPropTypes, SafeAreaView } from 'react-native'; +import { View, SafeAreaView } from 'react-native'; +import { ViewPropTypes } from 'deprecated-react-native-prop-types'; import { connectStyle } from 'native-base-shoutem-theme'; import mapPropsToStyleNames from '../utils/mapPropsToStyleNames'; diff --git a/src/basic/FooterTab.js b/src/basic/FooterTab.js index 7934cb2df..2d217a1d0 100644 --- a/src/basic/FooterTab.js +++ b/src/basic/FooterTab.js @@ -1,6 +1,7 @@ import React, { Component } from 'react'; import PropTypes from 'prop-types'; -import { View, ViewPropTypes } from 'react-native'; +import { View } from 'react-native'; +import { ViewPropTypes } from 'deprecated-react-native-prop-types'; import { connectStyle } from 'native-base-shoutem-theme'; import mapPropsToStyleNames from '../utils/mapPropsToStyleNames'; diff --git a/src/basic/Form.js b/src/basic/Form.js index 96ce0511c..314ca6e80 100644 --- a/src/basic/Form.js +++ b/src/basic/Form.js @@ -1,6 +1,7 @@ import React, { Component } from 'react'; import PropTypes from 'prop-types'; -import { View, ViewPropTypes } from 'react-native'; +import { View } from 'react-native'; +import { ViewPropTypes } from 'deprecated-react-native-prop-types'; import { connectStyle } from 'native-base-shoutem-theme'; import mapPropsToStyleNames from '../utils/mapPropsToStyleNames'; @@ -20,8 +21,10 @@ Form.propTypes = { ]) }; -const StyledForm = connectStyle('NativeBase.Form', {}, mapPropsToStyleNames)( - Form -); +const StyledForm = connectStyle( + 'NativeBase.Form', + {}, + mapPropsToStyleNames +)(Form); export { StyledForm as Form }; diff --git a/src/basic/Gravatar.js b/src/basic/Gravatar.js index 259830d58..e4bc653de 100644 --- a/src/basic/Gravatar.js +++ b/src/basic/Gravatar.js @@ -1,6 +1,7 @@ import React from 'react'; import PropTypes from 'prop-types'; import { Image } from 'react-native'; +import { ImagePropTypes } from 'deprecated-react-native-prop-types'; import { connectStyle } from 'native-base-shoutem-theme'; import _ from 'lodash'; import md5 from 'blueimp-md5'; @@ -54,7 +55,7 @@ class Gravatar extends NativeBaseComponent { } Gravatar.propTypes = { - ...Image.propTypes, + ...ImagePropTypes, email: PropTypes.string.isRequired, style: PropTypes.oneOfType([ PropTypes.object, diff --git a/src/basic/H1.js b/src/basic/H1.js index 2bb573b4f..cb1f716d4 100644 --- a/src/basic/H1.js +++ b/src/basic/H1.js @@ -1,6 +1,7 @@ import React, { Component } from 'react'; import PropTypes from 'prop-types'; import { Text } from 'react-native'; +import { TextPropTypes } from 'deprecated-react-native-prop-types'; import { connectStyle } from 'native-base-shoutem-theme'; import mapPropsToStyleNames from '../utils/mapPropsToStyleNames'; @@ -23,7 +24,7 @@ const childrenType = function(props, propName, component) { }; H1.propTypes = { - ...Text.propTypes, + ...TextPropTypes, children: childrenType, style: PropTypes.oneOfType([ PropTypes.object, diff --git a/src/basic/H2.js b/src/basic/H2.js index 04742315e..3090c4423 100644 --- a/src/basic/H2.js +++ b/src/basic/H2.js @@ -1,6 +1,7 @@ import React, { Component } from 'react'; import PropTypes from 'prop-types'; import { Text } from 'react-native'; +import { TextPropTypes } from 'deprecated-react-native-prop-types'; import { connectStyle } from 'native-base-shoutem-theme'; import mapPropsToStyleNames from '../utils/mapPropsToStyleNames'; @@ -22,7 +23,7 @@ const childrenType = function(props, propName, component) { }; H2.propTypes = { - ...Text.propTypes, + ...TextPropTypes, children: childrenType, style: PropTypes.oneOfType([ PropTypes.object, diff --git a/src/basic/H3.js b/src/basic/H3.js index 40a963266..a08f47d8b 100644 --- a/src/basic/H3.js +++ b/src/basic/H3.js @@ -1,6 +1,7 @@ import React, { Component } from 'react'; import PropTypes from 'prop-types'; import { Text } from 'react-native'; +import { TextPropTypes } from 'deprecated-react-native-prop-types'; import { connectStyle } from 'native-base-shoutem-theme'; import mapPropsToStyleNames from '../utils/mapPropsToStyleNames'; @@ -23,7 +24,7 @@ const childrenType = function(props, propName, component) { }; H3.propTypes = { - ...Text.propTypes, + ...TextPropTypes, children: childrenType, style: PropTypes.oneOfType([ PropTypes.object, diff --git a/src/basic/Header.js b/src/basic/Header.js index 621e7e709..0c9f666d2 100644 --- a/src/basic/Header.js +++ b/src/basic/Header.js @@ -3,7 +3,8 @@ import { connectStyle } from 'native-base-shoutem-theme'; import PropTypes from 'prop-types'; import React, { Component } from 'react'; -import { View, StatusBar, ViewPropTypes, SafeAreaView } from 'react-native'; +import { View, StatusBar, SafeAreaView } from 'react-native'; +import { ViewPropTypes } from 'deprecated-react-native-prop-types'; import mapPropsToStyleNames from '../utils/mapPropsToStyleNames'; import getStyle from '../utils/getStyle'; diff --git a/src/basic/Input.js b/src/basic/Input.js index 08f8a1732..6039965f3 100644 --- a/src/basic/Input.js +++ b/src/basic/Input.js @@ -1,6 +1,7 @@ import React from 'react'; import PropTypes from 'prop-types'; import { TextInput } from 'react-native'; +import { TextInputPropTypes } from 'deprecated-react-native-prop-types'; import { connectStyle } from 'native-base-shoutem-theme'; import mapPropsToStyleNames from '../utils/mapPropsToStyleNames'; @@ -33,7 +34,7 @@ class Input extends NativeBaseComponent { } Input.propTypes = { - ...TextInput.propTypes, + ...TextInputPropTypes, style: PropTypes.oneOfType([ PropTypes.object, PropTypes.number, @@ -41,8 +42,10 @@ Input.propTypes = { ]) }; -const StyledInput = connectStyle('NativeBase.Input', {}, mapPropsToStyleNames)( - Input -); +const StyledInput = connectStyle( + 'NativeBase.Input', + {}, + mapPropsToStyleNames +)(Input); export { StyledInput as Input }; diff --git a/src/basic/InputGroup.js b/src/basic/InputGroup.js index 5b5dfb6d8..825f8ec05 100644 --- a/src/basic/InputGroup.js +++ b/src/basic/InputGroup.js @@ -1,6 +1,7 @@ import React, { Component } from 'react'; import PropTypes from 'prop-types'; -import { View, ViewPropTypes } from 'react-native'; +import { View } from 'react-native'; +import { ViewPropTypes } from 'deprecated-react-native-prop-types'; import { connectStyle } from 'native-base-shoutem-theme'; import variables from '../theme/variables/platform'; diff --git a/src/basic/Label.js b/src/basic/Label.js index 04c22ad77..4dbbcc5ec 100644 --- a/src/basic/Label.js +++ b/src/basic/Label.js @@ -1,6 +1,7 @@ import React, { Component } from 'react'; import PropTypes from 'prop-types'; import { Text } from 'react-native'; +import { TextPropTypes } from 'deprecated-react-native-prop-types'; import { connectStyle } from 'native-base-shoutem-theme'; import mapPropsToStyleNames from '../utils/mapPropsToStyleNames'; @@ -12,17 +13,19 @@ class Label extends Component { } Label.propTypes = { - ...Text.propTypes, + ...TextPropTypes, style: PropTypes.oneOfType([ PropTypes.object, PropTypes.number, PropTypes.array ]), - floatBack: PropTypes.number, + floatBack: PropTypes.number }; -const StyledLabel = connectStyle('NativeBase.Label', {}, mapPropsToStyleNames)( - Label -); +const StyledLabel = connectStyle( + 'NativeBase.Label', + {}, + mapPropsToStyleNames +)(Label); export { StyledLabel as Label }; diff --git a/src/basic/Left.js b/src/basic/Left.js index c23487d61..eaac035b0 100644 --- a/src/basic/Left.js +++ b/src/basic/Left.js @@ -1,6 +1,7 @@ import React, { Component } from 'react'; import PropTypes from 'prop-types'; -import { View, ViewPropTypes } from 'react-native'; +import { View } from 'react-native'; +import { ViewPropTypes } from 'deprecated-react-native-prop-types'; import { connectStyle } from 'native-base-shoutem-theme'; import mapPropsToStyleNames from '../utils/mapPropsToStyleNames'; @@ -20,8 +21,10 @@ Left.propTypes = { ]) }; -const StyledLeft = connectStyle('NativeBase.Left', {}, mapPropsToStyleNames)( - Left -); +const StyledLeft = connectStyle( + 'NativeBase.Left', + {}, + mapPropsToStyleNames +)(Left); export { StyledLeft as Left }; diff --git a/src/basic/Picker.ios.js b/src/basic/Picker.ios.js index 7cf65e846..99cbe0abc 100644 --- a/src/basic/Picker.ios.js +++ b/src/basic/Picker.ios.js @@ -4,7 +4,8 @@ import React, { Component } from 'react'; import PropTypes from 'prop-types'; import createReactClass from 'create-react-class'; -import { FlatList, Modal, View, ViewPropTypes } from 'react-native'; +import { FlatList, Modal, View } from 'react-native'; +import { ViewPropTypes } from 'deprecated-react-native-prop-types'; import { Picker } from '@react-native-picker/picker'; import { connectStyle } from 'native-base-shoutem-theme'; import { find, get } from 'lodash'; diff --git a/src/basic/Right.js b/src/basic/Right.js index 05986bc1d..ddb94cf3d 100644 --- a/src/basic/Right.js +++ b/src/basic/Right.js @@ -1,6 +1,7 @@ import React, { Component } from 'react'; import PropTypes from 'prop-types'; -import { View, ViewPropTypes } from 'react-native'; +import { View } from 'react-native'; +import { ViewPropTypes } from 'deprecated-react-native-prop-types'; import { connectStyle } from 'native-base-shoutem-theme'; import mapPropsToStyleNames from '../utils/mapPropsToStyleNames'; @@ -20,8 +21,10 @@ Right.propTypes = { ]) }; -const StyledRight = connectStyle('NativeBase.Right', {}, mapPropsToStyleNames)( - Right -); +const StyledRight = connectStyle( + 'NativeBase.Right', + {}, + mapPropsToStyleNames +)(Right); export { StyledRight as Right }; diff --git a/src/basic/Root.js b/src/basic/Root.js index 89c0b1bb0..69c024a8d 100644 --- a/src/basic/Root.js +++ b/src/basic/Root.js @@ -1,5 +1,6 @@ import React, { Component } from 'react'; -import { View, ViewPropTypes } from 'react-native'; +import { View } from 'react-native'; +import { ViewPropTypes } from 'deprecated-react-native-prop-types'; import PropTypes from 'prop-types'; import { connectStyle } from 'native-base-shoutem-theme'; @@ -37,8 +38,10 @@ Root.propTypes = { ]) }; -const StyledRoot = connectStyle('NativeBase.Root', {}, mapPropsToStyleNames)( - Root -); +const StyledRoot = connectStyle( + 'NativeBase.Root', + {}, + mapPropsToStyleNames +)(Root); export { StyledRoot as Root }; diff --git a/src/basic/Segment.js b/src/basic/Segment.js index ed9387432..6b95ee269 100644 --- a/src/basic/Segment.js +++ b/src/basic/Segment.js @@ -1,6 +1,7 @@ import React, { Component } from 'react'; import PropTypes from 'prop-types'; -import { View, ViewPropTypes } from 'react-native'; +import { View } from 'react-native'; +import { ViewPropTypes } from 'deprecated-react-native-prop-types'; import { connectStyle } from 'native-base-shoutem-theme'; import mapPropsToStyleNames from '../utils/mapPropsToStyleNames'; diff --git a/src/basic/Separator.js b/src/basic/Separator.js index c09d537c4..a873adfe0 100644 --- a/src/basic/Separator.js +++ b/src/basic/Separator.js @@ -1,6 +1,7 @@ import React, { Component } from 'react'; import PropTypes from 'prop-types'; -import { View, ViewPropTypes } from 'react-native'; +import { View } from 'react-native'; +import { ViewPropTypes } from 'deprecated-react-native-prop-types'; import { connectStyle } from 'native-base-shoutem-theme'; import mapPropsToStyleNames from '../utils/mapPropsToStyleNames'; diff --git a/src/basic/Subtitle.js b/src/basic/Subtitle.js index 972307468..1623496fa 100644 --- a/src/basic/Subtitle.js +++ b/src/basic/Subtitle.js @@ -1,18 +1,21 @@ import React, { Component } from 'react'; import PropTypes from 'prop-types'; import { Text } from 'react-native'; +import { TextPropTypes } from 'deprecated-react-native-prop-types'; import { connectStyle } from 'native-base-shoutem-theme'; import mapPropsToStyleNames from '../utils/mapPropsToStyleNames'; class Subtitle extends Component { render() { - return (this._root = c)} numberOfLines={1} {...this.props} />; + return ( + (this._root = c)} numberOfLines={1} {...this.props} /> + ); } } Subtitle.propTypes = { - ...Text.propTypes, + ...TextPropTypes, style: PropTypes.oneOfType([ PropTypes.object, PropTypes.number, diff --git a/src/basic/Tab.js b/src/basic/Tab.js index ab3b678e6..0201ddf5e 100644 --- a/src/basic/Tab.js +++ b/src/basic/Tab.js @@ -1,6 +1,7 @@ import React, { Component } from 'react'; import PropTypes from 'prop-types'; -import { View, ViewPropTypes } from 'react-native'; +import { View } from 'react-native'; +import { ViewPropTypes } from 'deprecated-react-native-prop-types'; import { connectStyle } from 'native-base-shoutem-theme'; import mapPropsToStyleNames from '../utils/mapPropsToStyleNames'; diff --git a/src/basic/TabContainer.js b/src/basic/TabContainer.js index a2e6dd7d2..bc46a4047 100644 --- a/src/basic/TabContainer.js +++ b/src/basic/TabContainer.js @@ -1,6 +1,7 @@ import React, { Component } from 'react'; import PropTypes from 'prop-types'; -import { View, ViewPropTypes } from 'react-native'; +import { View } from 'react-native'; +import { ViewPropTypes } from 'deprecated-react-native-prop-types'; import { connectStyle } from 'native-base-shoutem-theme'; import mapPropsToStyleNames from '../utils/mapPropsToStyleNames'; diff --git a/src/basic/TabHeading.js b/src/basic/TabHeading.js index 3302b796a..96c4fb473 100644 --- a/src/basic/TabHeading.js +++ b/src/basic/TabHeading.js @@ -1,6 +1,7 @@ import React, { Component } from 'react'; import PropTypes from 'prop-types'; -import { View, ViewPropTypes } from 'react-native'; +import { View } from 'react-native'; +import { ViewPropTypes } from 'deprecated-react-native-prop-types'; import { connectStyle } from 'native-base-shoutem-theme'; import mapPropsToStyleNames from '../utils/mapPropsToStyleNames'; diff --git a/src/basic/Text.js b/src/basic/Text.js index 5d15e098d..2f786c7ee 100644 --- a/src/basic/Text.js +++ b/src/basic/Text.js @@ -1,6 +1,7 @@ import React from 'react'; import PropTypes from 'prop-types'; import { Text as RNText } from 'react-native'; +import { TextPropTypes } from 'deprecated-react-native-prop-types'; import _ from 'lodash'; import { connectStyle } from 'native-base-shoutem-theme'; @@ -35,7 +36,7 @@ class Text extends React.PureComponent { } Text.propTypes = { - ...RNText.propTypes, + ...TextPropTypes, uppercase: PropTypes.bool, style: PropTypes.oneOfType([ PropTypes.object, diff --git a/src/basic/Textarea.js b/src/basic/Textarea.js index ef297d4cd..e7c730525 100644 --- a/src/basic/Textarea.js +++ b/src/basic/Textarea.js @@ -1,6 +1,7 @@ import React, { Component } from 'react'; import PropTypes from 'prop-types'; import { TextInput } from 'react-native'; +import { TextInputPropTypes } from 'deprecated-react-native-prop-types'; import { connectStyle } from 'native-base-shoutem-theme'; import variables from '../theme/variables/platform'; @@ -44,7 +45,7 @@ class Textarea extends Component { } Textarea.propTypes = { - ...TextInput.propTypes, + ...TextInputPropTypes, style: PropTypes.oneOfType([ PropTypes.object, PropTypes.number, diff --git a/src/basic/Thumbnail.js b/src/basic/Thumbnail.js index 89cc71833..a222b9e30 100644 --- a/src/basic/Thumbnail.js +++ b/src/basic/Thumbnail.js @@ -1,6 +1,7 @@ import React, { Component } from 'react'; import PropTypes from 'prop-types'; import { Image } from 'react-native'; +import { ImagePropTypes } from 'deprecated-react-native-prop-types'; import { connectStyle } from 'native-base-shoutem-theme'; import mapPropsToStyleNames from '../utils/mapPropsToStyleNames'; @@ -12,7 +13,7 @@ class Thumbnail extends Component { } Thumbnail.propTypes = { - ...Image.propTypes, + ...ImagePropTypes, style: PropTypes.oneOfType([ PropTypes.object, PropTypes.number, diff --git a/src/basic/Title.js b/src/basic/Title.js index 76e96035a..77b0b595b 100644 --- a/src/basic/Title.js +++ b/src/basic/Title.js @@ -1,6 +1,7 @@ import React, { Component } from 'react'; import PropTypes from 'prop-types'; import { Text } from 'react-native'; +import { TextPropTypes } from 'deprecated-react-native-prop-types'; import { connectStyle } from 'native-base-shoutem-theme'; import mapPropsToStyleNames from '../utils/mapPropsToStyleNames'; @@ -14,7 +15,7 @@ class Title extends Component { } Title.propTypes = { - ...Text.propTypes, + ...TextPropTypes, style: PropTypes.oneOfType([ PropTypes.object, PropTypes.number, @@ -22,7 +23,9 @@ Title.propTypes = { ]) }; -const StyledTitle = connectStyle('NativeBase.Title', {}, mapPropsToStyleNames)( - Title -); +const StyledTitle = connectStyle( + 'NativeBase.Title', + {}, + mapPropsToStyleNames +)(Title); export { StyledTitle as Title }; diff --git a/src/basic/Toast.js b/src/basic/Toast.js index 834dbe777..2ae6891a6 100644 --- a/src/basic/Toast.js +++ b/src/basic/Toast.js @@ -1,6 +1,7 @@ import React, { Component } from 'react'; import PropTypes from 'prop-types'; -import { View, ViewPropTypes } from 'react-native'; +import { View } from 'react-native'; +import { ViewPropTypes } from 'deprecated-react-native-prop-types'; import { connectStyle } from 'native-base-shoutem-theme'; import mapPropsToStyleNames from '../utils/mapPropsToStyleNames'; @@ -20,7 +21,9 @@ Toast.propTypes = { ]) }; -const StyledToast = connectStyle('NativeBase.Toast', {}, mapPropsToStyleNames)( - Toast -); +const StyledToast = connectStyle( + 'NativeBase.Toast', + {}, + mapPropsToStyleNames +)(Toast); export { StyledToast as Toast }; diff --git a/src/basic/ToastContainer.js b/src/basic/ToastContainer.js index 4bd57acf3..410e4bd3e 100644 --- a/src/basic/ToastContainer.js +++ b/src/basic/ToastContainer.js @@ -1,12 +1,7 @@ /* eslint-disable class-methods-use-this */ import React, { Component } from 'react'; -import { - Keyboard, - Platform, - Animated, - ViewPropTypes, - PanResponder, -} from 'react-native'; +import { Keyboard, Platform, Animated, PanResponder } from 'react-native'; +import { ViewPropTypes } from 'deprecated-react-native-prop-types'; import { connectStyle } from 'native-base-shoutem-theme'; import mapPropsToStyleNames from '../utils/mapPropsToStyleNames'; @@ -19,7 +14,7 @@ import { Toast } from './Toast'; const POSITION = { ABSOLUTE: 'absolute', BOTTOM: 'bottom', - TOP: 'top', + TOP: 'top' }; class ToastContainer extends Component { @@ -39,7 +34,7 @@ class ToastContainer extends Component { pan: new Animated.ValueXY({ x: 0, y: 0 }), keyboardHeight: 0, isKeyboardVisible: false, - modalVisible: false, + modalVisible: false }; this.keyboardDidHide = this.keyboardDidHide.bind(this); @@ -54,7 +49,7 @@ class ToastContainer extends Component { useNativeDriver: false }).start(() => this.closeToast('swipe')); } - }, + } }); } @@ -77,7 +72,7 @@ class ToastContainer extends Component { paddingHorizontal: Platform.OS === PLATFORM.IOS ? 20 : 0, top: this.state.position === POSITION.TOP ? 30 : undefined, bottom: - this.state.position === POSITION.BOTTOM ? this.getTop() : undefined, + this.state.position === POSITION.BOTTOM ? this.getTop() : undefined }; } @@ -109,14 +104,14 @@ class ToastContainer extends Component { keyboardDidHide() { this.setState({ keyboardHeight: 0, - isKeyboardVisible: false, + isKeyboardVisible: false }); } keyboardDidShow(e) { this.setState({ keyboardHeight: e.endCoordinates.height, - isKeyboardVisible: true, + isKeyboardVisible: true }); } @@ -151,12 +146,12 @@ class ToastContainer extends Component { Animated.timing(this.state.fadeAnim, { toValue: 1, duration: 200, - useNativeDriver: false, + useNativeDriver: false }).start(); } - closeModal = (reason) => { + closeModal = reason => { this.setState({ - modalVisible: false, + modalVisible: false }); const { onClose } = this.state; if (onClose && typeof onClose === 'function') { @@ -168,7 +163,7 @@ class ToastContainer extends Component { Animated.timing(this.state.fadeAnim, { toValue: 0, duration: 200, - useNativeDriver: false, + useNativeDriver: false }).start(() => { this.closeModal(reason); this.state.pan.setValue({ x: 0, y: 0 }); @@ -180,10 +175,10 @@ class ToastContainer extends Component { const { x, y } = this.state.pan; return (