bd5749302dd6614e74974b182cda4075.json
5.54 KB
{"ast":null,"code":"var _interopRequireWildcard=require(\"@babel/runtime/helpers/interopRequireWildcard\");var _interopRequireDefault=require(\"@babel/runtime/helpers/interopRequireDefault\");Object.defineProperty(exports,\"__esModule\",{value:true});exports.default=void 0;var _extends2=_interopRequireDefault(require(\"@babel/runtime/helpers/extends\"));var _objectWithoutProperties2=_interopRequireDefault(require(\"@babel/runtime/helpers/objectWithoutProperties\"));var _classCallCheck2=_interopRequireDefault(require(\"@babel/runtime/helpers/classCallCheck\"));var _createClass2=_interopRequireDefault(require(\"@babel/runtime/helpers/createClass\"));var _possibleConstructorReturn2=_interopRequireDefault(require(\"@babel/runtime/helpers/possibleConstructorReturn\"));var _getPrototypeOf2=_interopRequireDefault(require(\"@babel/runtime/helpers/getPrototypeOf\"));var _inherits2=_interopRequireDefault(require(\"@babel/runtime/helpers/inherits\"));var React=_interopRequireWildcard(require(\"react\"));var _TouchableNativeFeedback=_interopRequireDefault(require(\"react-native-web/dist/exports/TouchableNativeFeedback\"));var _TouchableOpacity=_interopRequireDefault(require(\"react-native-web/dist/exports/TouchableOpacity\"));var _Platform=_interopRequireDefault(require(\"react-native-web/dist/exports/Platform\"));var _View=_interopRequireDefault(require(\"react-native-web/dist/exports/View\"));var _jsxFileName=\"/Users/satya/Workspace/Projects/react-native-tab-view/src/TouchableItem.tsx\";var LOLLIPOP=21;var TouchableItem=function(_React$Component){(0,_inherits2.default)(TouchableItem,_React$Component);function TouchableItem(){(0,_classCallCheck2.default)(this,TouchableItem);return(0,_possibleConstructorReturn2.default)(this,(0,_getPrototypeOf2.default)(TouchableItem).apply(this,arguments));}(0,_createClass2.default)(TouchableItem,[{key:\"render\",value:function render(){var _this$props=this.props,style=_this$props.style,pressOpacity=_this$props.pressOpacity,pressColor=_this$props.pressColor,borderless=_this$props.borderless,children=_this$props.children,rest=(0,_objectWithoutProperties2.default)(_this$props,[\"style\",\"pressOpacity\",\"pressColor\",\"borderless\",\"children\"]);if(_Platform.default.OS==='android'&&_Platform.default.Version>=LOLLIPOP){return React.createElement(_TouchableNativeFeedback.default,(0,_extends2.default)({},rest,{background:_TouchableNativeFeedback.default.Ripple(pressColor,borderless),__source:{fileName:_jsxFileName,lineNumber:42}}),React.createElement(_View.default,{style:style,__source:{fileName:_jsxFileName,lineNumber:46}},React.Children.only(children)));}else{return React.createElement(_TouchableOpacity.default,(0,_extends2.default)({},rest,{style:style,activeOpacity:pressOpacity,__source:{fileName:_jsxFileName,lineNumber:51}}),children);}}}]);return TouchableItem;}(React.Component);exports.default=TouchableItem;TouchableItem.defaultProps={pressColor:'rgba(255, 255, 255, .4)'};","map":{"version":3,"sources":["TouchableItem.tsx"],"names":["LOLLIPOP","TouchableItem","React","Component","defaultProps","pressColor","style","pressOpacity","borderless","children","rest","Platform","TouchableNativeFeedback"],"mappings":"k5BAAA,oD,qeAsBA,GAAMA,CAAAA,QAAQ,CAAd,EAAA,CAEqBC,GAAAA,CAAAA,a,kWAKV,CAAA,GAAA,CAAA,WAAA,CAQH,KARG,KAAA,CAELK,KAFK,CAAA,WAAA,CAAA,KAAA,CAGLC,YAHK,CAAA,WAAA,CAAA,YAAA,CAILF,UAJK,CAAA,WAAA,CAAA,UAAA,CAKLG,UALK,CAAA,WAAA,CAAA,UAAA,CAMLC,QANK,CAAA,WAAA,CAAA,QAAA,CAOFC,IAPE,CAAA,sCAAA,WAAA,CAAA,CAAA,OAAA,CAAA,cAAA,CAAA,YAAA,CAAA,YAAA,CAAA,UAAA,CAAA,CAAA,CAUP,GAAIC,kBAAAA,EAAAA,GAAAA,SAAAA,EAA6BA,kBAAAA,OAAAA,EAAjC,QAAA,CAA+D,CAC7D,MACE,CAAA,KAAA,CAAA,aAAA,CAAA,gCAAA,CAAA,sBAAA,EAAA,CAAA,IAAA,CAAA,CAEE,UAAU,CAAEC,iCAAAA,MAAAA,CAAAA,UAAAA,CAFd,UAEcA,CAFd,CAAA,QAAA,CAAA,CAAA,QAAA,CAAA,YAAA,CAAA,UAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAIE,KAAA,CAAA,aAAA,CAAA,aAAA,CAAA,CAAM,KAAK,CAAX,KAAA,CAAA,QAAA,CAAA,CAAA,QAAA,CAAA,YAAA,CAAA,UAAA,CAAA,EAAA,CAAA,CAAA,CAAqBV,KAAK,CAALA,QAAAA,CAAAA,IAAAA,CALzB,QAKyBA,CAArB,CAJF,CADF,CADF,CAAA,IASO,CACL,MACE,CAAA,KAAA,CAAA,aAAA,CAAA,yBAAA,CAAA,sBAAA,EAAA,CAAA,IAAA,CAAA,CAA4B,KAAK,CAAjC,KAAA,CAA0C,aAAa,CAAvD,YAAA,CAAA,QAAA,CAAA,CAAA,QAAA,CAAA,YAAA,CAAA,UAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CADF,QACE,CADF,CAMH,C,4BA/BwCA,KAAK,CAACC,S,CAA5BF,C,8BAAAA,a,CACZG,YADYH,CACG,CACpBI,UAAU,CAFOJ,yBACG,CADHA","sourcesContent":["import * as React from 'react';\nimport {\n TouchableNativeFeedback,\n TouchableOpacity,\n Platform,\n View,\n StyleProp,\n ViewStyle,\n ViewProps,\n} from 'react-native';\n\ntype Props = ViewProps & {\n onPress: () => void;\n onLongPress?: () => void;\n delayPressIn?: number;\n borderless?: boolean;\n pressColor: string;\n pressOpacity?: number;\n children?: React.ReactNode;\n style?: StyleProp<ViewStyle>;\n};\n\nconst LOLLIPOP = 21;\n\nexport default class TouchableItem extends React.Component<Props> {\n static defaultProps = {\n pressColor: 'rgba(255, 255, 255, .4)',\n };\n\n render() {\n const {\n style,\n pressOpacity,\n pressColor,\n borderless,\n children,\n ...rest\n } = this.props;\n\n if (Platform.OS === 'android' && Platform.Version >= LOLLIPOP) {\n return (\n <TouchableNativeFeedback\n {...rest}\n background={TouchableNativeFeedback.Ripple(pressColor, borderless)}\n >\n <View style={style}>{React.Children.only(children)}</View>\n </TouchableNativeFeedback>\n );\n } else {\n return (\n <TouchableOpacity {...rest} style={style} activeOpacity={pressOpacity}>\n {children}\n </TouchableOpacity>\n );\n }\n }\n}\n"]},"metadata":{},"sourceType":"script"}