@expo/react-native-action-sheet
Advanced tools
Comparing version 4.0.0-rc.1 to 4.0.0
@@ -1,2 +0,2 @@ | ||
var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");var _interopRequireWildcard=require("@babel/runtime/helpers/interopRequireWildcard");Object.defineProperty(exports,"__esModule",{value:true});exports.default=void 0;var _classCallCheck2=_interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));var _createClass2=_interopRequireDefault(require("@babel/runtime/helpers/createClass"));var _inherits2=_interopRequireDefault(require("@babel/runtime/helpers/inherits"));var _possibleConstructorReturn2=_interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));var _getPrototypeOf2=_interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));var React=_interopRequireWildcard(require("react"));var _reactNative=require("react-native");var _TouchableNativeFeedbackSafe=_interopRequireDefault(require("./TouchableNativeFeedbackSafe"));var _jsxFileName="/Users/bradley/Code/expo/react-native-action-sheet/src/ActionSheet/ActionGroup.tsx";function _createSuper(Derived){var hasNativeReflectConstruct=_isNativeReflectConstruct();return function _createSuperInternal(){var Super=(0,_getPrototypeOf2.default)(Derived),result;if(hasNativeReflectConstruct){var NewTarget=(0,_getPrototypeOf2.default)(this).constructor;result=Reflect.construct(Super,arguments,NewTarget);}else{result=Super.apply(this,arguments);}return(0,_possibleConstructorReturn2.default)(this,result);};}function _isNativeReflectConstruct(){if(typeof Reflect==="undefined"||!Reflect.construct)return false;if(Reflect.construct.sham)return false;if(typeof Proxy==="function")return true;try{Date.prototype.toString.call(Reflect.construct(Date,[],function(){}));return true;}catch(e){return false;}}var BLACK_54PC_TRANSPARENT='#0000008a';var BLACK_87PC_TRANSPARENT='#000000de';var DESTRUCTIVE_COLOR='#d32f2f';var focusViewOnRender=function focusViewOnRender(ref){if(ref){var reactTag=(0,_reactNative.findNodeHandle)(ref);if(reactTag){if(_reactNative.Platform.OS==='android'){_reactNative.UIManager.sendAccessibilityEvent(reactTag,_reactNative.UIManager.AccessibilityEventTypes.typeViewFocused);}else{_reactNative.AccessibilityInfo.setAccessibilityFocus(reactTag);}}}};var isIndexDestructive=function isIndexDestructive(index,destructiveIndex){if(Array.isArray(destructiveIndex)){return destructiveIndex.includes(index);}return index===destructiveIndex;};var isIndexDisabled=function isIndexDisabled(index){var disabledButtonIndices=arguments.length>1&&arguments[1]!==undefined?arguments[1]:[];return disabledButtonIndices.includes(index);};var ActionGroup=function(_React$Component){(0,_inherits2.default)(ActionGroup,_React$Component);var _super=_createSuper(ActionGroup);function ActionGroup(){var _this;(0,_classCallCheck2.default)(this,ActionGroup);for(var _len=arguments.length,args=new Array(_len),_key=0;_key<_len;_key++){args[_key]=arguments[_key];}_this=_super.call.apply(_super,[this].concat(args));_this._renderRowSeparator=function(key){return React.createElement(_reactNative.View,{key:"separator-"+key,style:[styles.rowSeparator,_this.props.separatorStyle],__source:{fileName:_jsxFileName,lineNumber:82,columnNumber:7}});};_this._renderTitleContent=function(){var _this$props=_this.props,title=_this$props.title,titleTextStyle=_this$props.titleTextStyle,message=_this$props.message,messageTextStyle=_this$props.messageTextStyle,showSeparators=_this$props.showSeparators;if(!title&&!message){return null;}return React.createElement(_reactNative.View,{__source:{fileName:_jsxFileName,lineNumber:94,columnNumber:7}},React.createElement(_reactNative.View,{style:[styles.titleContainer,{paddingBottom:showSeparators?24:16}],__source:{fileName:_jsxFileName,lineNumber:95,columnNumber:9}},!!title&&React.createElement(_reactNative.Text,{style:[styles.title,titleTextStyle],__source:{fileName:_jsxFileName,lineNumber:96,columnNumber:23}},title),!!message&&React.createElement(_reactNative.Text,{style:[styles.message,messageTextStyle],__source:{fileName:_jsxFileName,lineNumber:97,columnNumber:25}},message)),!!showSeparators&&_this._renderRowSeparator('title'));};_this._renderIconElement=function(iconSource,color){var tintIcons=_this.props.tintIcons;if(!iconSource){return null;}if(typeof iconSource==='number'){var iconStyle=[styles.icon,{tintColor:tintIcons?color:undefined}];return React.createElement(_reactNative.Image,{fadeDuration:0,source:iconSource,resizeMode:"contain",style:iconStyle,__source:{fileName:_jsxFileName,lineNumber:112,columnNumber:14}});}else{return React.createElement(_reactNative.View,{style:styles.icon,__source:{fileName:_jsxFileName,lineNumber:114,columnNumber:14}},iconSource);}};_this._renderOptionViews=function(){var _this$props2=_this.props,options=_this$props2.options,icons=_this$props2.icons,cancelButtonIndex=_this$props2.cancelButtonIndex,cancelButtonTintColor=_this$props2.cancelButtonTintColor,destructiveButtonIndex=_this$props2.destructiveButtonIndex,disabledButtonIndices=_this$props2.disabledButtonIndices,_this$props2$destruct=_this$props2.destructiveColor,destructiveColor=_this$props2$destruct===void 0?DESTRUCTIVE_COLOR:_this$props2$destruct,onSelect=_this$props2.onSelect,startIndex=_this$props2.startIndex,length=_this$props2.length,textStyle=_this$props2.textStyle,tintColor=_this$props2.tintColor,autoFocus=_this$props2.autoFocus,showSeparators=_this$props2.showSeparators;var optionViews=[];var nativeFeedbackBackground=_TouchableNativeFeedbackSafe.default.Ripple('rgba(180, 180, 180, 1)',false);var _loop=function _loop(_i){var defaultColor=tintColor?tintColor:(textStyle||{}).color||BLACK_87PC_TRANSPARENT;var disabled=isIndexDisabled(_i,disabledButtonIndices);var isCancelButton=_i===cancelButtonIndex;var color=isIndexDestructive(_i,destructiveButtonIndex)?destructiveColor:isCancelButton?cancelButtonTintColor||defaultColor:defaultColor;var iconSource=icons!=null?icons[_i]:null;optionViews.push(React.createElement(_TouchableNativeFeedbackSafe.default,{ref:autoFocus&&_i===0?focusViewOnRender:undefined,key:_i,pressInDelay:0,background:nativeFeedbackBackground,disabled:disabled,onPress:function onPress(){return onSelect(_i);},style:[styles.button,disabled&&styles.disabledButton],accessibilityRole:"button",accessibilityLabel:options[_i],__source:{fileName:_jsxFileName,lineNumber:155,columnNumber:9}},_this._renderIconElement(iconSource,color),React.createElement(_reactNative.Text,{style:[styles.text,textStyle,{color:color}],__source:{fileName:_jsxFileName,lineNumber:166,columnNumber:11}},options[_i])));if(showSeparators&&_i<startIndex+length-1){optionViews.push(_this._renderRowSeparator(_i));}};for(var _i=startIndex;_i<startIndex+length;_i++){_loop(_i);}return optionViews;};return _this;}(0,_createClass2.default)(ActionGroup,[{key:"render",value:function render(){return React.createElement(_reactNative.View,{style:[styles.groupContainer,this.props.containerStyle],__source:{fileName:_jsxFileName,lineNumber:73,columnNumber:7}},this._renderTitleContent(),React.createElement(_reactNative.ScrollView,{__source:{fileName:_jsxFileName,lineNumber:75,columnNumber:9}},this._renderOptionViews()));}}]);return ActionGroup;}(React.Component);exports.default=ActionGroup;ActionGroup.defaultProps={title:null,message:null,showSeparators:false,tintIcons:true,textStyle:{}};var styles=_reactNative.StyleSheet.create({button:{justifyContent:'flex-start',alignItems:'center',flexDirection:'row',height:56,paddingHorizontal:16},disabledButton:{opacity:0.5},groupContainer:{backgroundColor:'#ffffff',overflow:'hidden'},icon:{width:24,height:24,marginRight:32,justifyContent:'center'},message:{marginTop:12,fontSize:14,color:BLACK_54PC_TRANSPARENT,textAlignVertical:'center'},rowSeparator:{backgroundColor:'#dddddd',height:1,width:'100%'},text:{fontSize:16,color:BLACK_87PC_TRANSPARENT,textAlignVertical:'center'},title:{fontSize:16,color:BLACK_54PC_TRANSPARENT,textAlignVertical:'center'},titleContainer:{alignItems:'flex-start',padding:16,paddingTop:24}}); | ||
var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");var _interopRequireWildcard=require("@babel/runtime/helpers/interopRequireWildcard");Object.defineProperty(exports,"__esModule",{value:true});exports.default=void 0;var _classCallCheck2=_interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));var _createClass2=_interopRequireDefault(require("@babel/runtime/helpers/createClass"));var _inherits2=_interopRequireDefault(require("@babel/runtime/helpers/inherits"));var _possibleConstructorReturn2=_interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));var _getPrototypeOf2=_interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));var React=_interopRequireWildcard(require("react"));var _reactNative=require("react-native");var _TouchableNativeFeedbackSafe=_interopRequireDefault(require("./TouchableNativeFeedbackSafe"));var _jsxFileName="/home/runner/work/react-native-action-sheet/react-native-action-sheet/src/ActionSheet/ActionGroup.tsx";function _createSuper(Derived){var hasNativeReflectConstruct=_isNativeReflectConstruct();return function _createSuperInternal(){var Super=(0,_getPrototypeOf2.default)(Derived),result;if(hasNativeReflectConstruct){var NewTarget=(0,_getPrototypeOf2.default)(this).constructor;result=Reflect.construct(Super,arguments,NewTarget);}else{result=Super.apply(this,arguments);}return(0,_possibleConstructorReturn2.default)(this,result);};}function _isNativeReflectConstruct(){if(typeof Reflect==="undefined"||!Reflect.construct)return false;if(Reflect.construct.sham)return false;if(typeof Proxy==="function")return true;try{Date.prototype.toString.call(Reflect.construct(Date,[],function(){}));return true;}catch(e){return false;}}var BLACK_54PC_TRANSPARENT='#0000008a';var BLACK_87PC_TRANSPARENT='#000000de';var DESTRUCTIVE_COLOR='#d32f2f';var focusViewOnRender=function focusViewOnRender(ref){if(ref){var reactTag=(0,_reactNative.findNodeHandle)(ref);if(reactTag){if(_reactNative.Platform.OS==='android'){_reactNative.UIManager.sendAccessibilityEvent(reactTag,_reactNative.UIManager.AccessibilityEventTypes.typeViewFocused);}else{_reactNative.AccessibilityInfo.setAccessibilityFocus(reactTag);}}}};var isIndexDestructive=function isIndexDestructive(index,destructiveIndex){if(Array.isArray(destructiveIndex)){return destructiveIndex.includes(index);}return index===destructiveIndex;};var isIndexDisabled=function isIndexDisabled(index){var disabledButtonIndices=arguments.length>1&&arguments[1]!==undefined?arguments[1]:[];return disabledButtonIndices.includes(index);};var ActionGroup=function(_React$Component){(0,_inherits2.default)(ActionGroup,_React$Component);var _super=_createSuper(ActionGroup);function ActionGroup(){var _this;(0,_classCallCheck2.default)(this,ActionGroup);for(var _len=arguments.length,args=new Array(_len),_key=0;_key<_len;_key++){args[_key]=arguments[_key];}_this=_super.call.apply(_super,[this].concat(args));_this._renderRowSeparator=function(key){return React.createElement(_reactNative.View,{key:"separator-"+key,style:[styles.rowSeparator,_this.props.separatorStyle],__source:{fileName:_jsxFileName,lineNumber:82,columnNumber:7}});};_this._renderTitleContent=function(){var _this$props=_this.props,title=_this$props.title,titleTextStyle=_this$props.titleTextStyle,message=_this$props.message,messageTextStyle=_this$props.messageTextStyle,showSeparators=_this$props.showSeparators;if(!title&&!message){return null;}return React.createElement(_reactNative.View,{__source:{fileName:_jsxFileName,lineNumber:94,columnNumber:7}},React.createElement(_reactNative.View,{style:[styles.titleContainer,{paddingBottom:showSeparators?24:16}],__source:{fileName:_jsxFileName,lineNumber:95,columnNumber:9}},!!title&&React.createElement(_reactNative.Text,{style:[styles.title,titleTextStyle],__source:{fileName:_jsxFileName,lineNumber:96,columnNumber:23}},title),!!message&&React.createElement(_reactNative.Text,{style:[styles.message,messageTextStyle],__source:{fileName:_jsxFileName,lineNumber:97,columnNumber:25}},message)),!!showSeparators&&_this._renderRowSeparator('title'));};_this._renderIconElement=function(iconSource,color){var tintIcons=_this.props.tintIcons;if(!iconSource){return null;}if(typeof iconSource==='number'){var iconStyle=[styles.icon,{tintColor:tintIcons?color:undefined}];return React.createElement(_reactNative.Image,{fadeDuration:0,source:iconSource,resizeMode:"contain",style:iconStyle,__source:{fileName:_jsxFileName,lineNumber:112,columnNumber:14}});}else{return React.createElement(_reactNative.View,{style:styles.icon,__source:{fileName:_jsxFileName,lineNumber:114,columnNumber:14}},iconSource);}};_this._renderOptionViews=function(){var _this$props2=_this.props,options=_this$props2.options,icons=_this$props2.icons,cancelButtonIndex=_this$props2.cancelButtonIndex,cancelButtonTintColor=_this$props2.cancelButtonTintColor,destructiveButtonIndex=_this$props2.destructiveButtonIndex,disabledButtonIndices=_this$props2.disabledButtonIndices,_this$props2$destruct=_this$props2.destructiveColor,destructiveColor=_this$props2$destruct===void 0?DESTRUCTIVE_COLOR:_this$props2$destruct,onSelect=_this$props2.onSelect,startIndex=_this$props2.startIndex,length=_this$props2.length,textStyle=_this$props2.textStyle,tintColor=_this$props2.tintColor,autoFocus=_this$props2.autoFocus,showSeparators=_this$props2.showSeparators;var optionViews=[];var nativeFeedbackBackground=_TouchableNativeFeedbackSafe.default.Ripple('rgba(180, 180, 180, 1)',false);var _loop=function _loop(_i){var defaultColor=tintColor?tintColor:(textStyle||{}).color||BLACK_87PC_TRANSPARENT;var disabled=isIndexDisabled(_i,disabledButtonIndices);var isCancelButton=_i===cancelButtonIndex;var color=isIndexDestructive(_i,destructiveButtonIndex)?destructiveColor:isCancelButton?cancelButtonTintColor||defaultColor:defaultColor;var iconSource=icons!=null?icons[_i]:null;optionViews.push(React.createElement(_TouchableNativeFeedbackSafe.default,{ref:autoFocus&&_i===0?focusViewOnRender:undefined,key:_i,pressInDelay:0,background:nativeFeedbackBackground,disabled:disabled,onPress:function onPress(){return onSelect(_i);},style:[styles.button,disabled&&styles.disabledButton],accessibilityRole:"button",accessibilityLabel:options[_i],__source:{fileName:_jsxFileName,lineNumber:155,columnNumber:9}},_this._renderIconElement(iconSource,color),React.createElement(_reactNative.Text,{style:[styles.text,textStyle,{color:color}],__source:{fileName:_jsxFileName,lineNumber:166,columnNumber:11}},options[_i])));if(showSeparators&&_i<startIndex+length-1){optionViews.push(_this._renderRowSeparator(_i));}};for(var _i=startIndex;_i<startIndex+length;_i++){_loop(_i);}return optionViews;};return _this;}(0,_createClass2.default)(ActionGroup,[{key:"render",value:function render(){return React.createElement(_reactNative.View,{style:[styles.groupContainer,this.props.containerStyle],__source:{fileName:_jsxFileName,lineNumber:73,columnNumber:7}},this._renderTitleContent(),React.createElement(_reactNative.ScrollView,{__source:{fileName:_jsxFileName,lineNumber:75,columnNumber:9}},this._renderOptionViews()));}}]);return ActionGroup;}(React.Component);exports.default=ActionGroup;ActionGroup.defaultProps={title:null,message:null,showSeparators:false,tintIcons:true,textStyle:{}};var styles=_reactNative.StyleSheet.create({button:{justifyContent:'flex-start',alignItems:'center',flexDirection:'row',height:56,paddingHorizontal:16},disabledButton:{opacity:0.5},groupContainer:{backgroundColor:'#ffffff',overflow:'hidden'},icon:{width:24,height:24,marginRight:32,justifyContent:'center'},message:{marginTop:12,fontSize:14,color:BLACK_54PC_TRANSPARENT,textAlignVertical:'center'},rowSeparator:{backgroundColor:'#dddddd',height:1,width:'100%'},text:{fontSize:16,color:BLACK_87PC_TRANSPARENT,textAlignVertical:'center'},title:{fontSize:16,color:BLACK_54PC_TRANSPARENT,textAlignVertical:'center'},titleContainer:{alignItems:'flex-start',padding:16,paddingTop:24}}); | ||
//# sourceMappingURL=ActionGroup.js.map |
@@ -1,2 +0,2 @@ | ||
var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");var _interopRequireWildcard=require("@babel/runtime/helpers/interopRequireWildcard");Object.defineProperty(exports,"__esModule",{value:true});exports.default=void 0;var _classCallCheck2=_interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));var _createClass2=_interopRequireDefault(require("@babel/runtime/helpers/createClass"));var _assertThisInitialized2=_interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));var _inherits2=_interopRequireDefault(require("@babel/runtime/helpers/inherits"));var _possibleConstructorReturn2=_interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));var _getPrototypeOf2=_interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));var React=_interopRequireWildcard(require("react"));var _reactNative=require("react-native");var _ActionGroup=_interopRequireDefault(require("./ActionGroup"));var _jsxFileName="/Users/bradley/Code/expo/react-native-action-sheet/src/ActionSheet/CustomActionSheet.tsx";function _createSuper(Derived){var hasNativeReflectConstruct=_isNativeReflectConstruct();return function _createSuperInternal(){var Super=(0,_getPrototypeOf2.default)(Derived),result;if(hasNativeReflectConstruct){var NewTarget=(0,_getPrototypeOf2.default)(this).constructor;result=Reflect.construct(Super,arguments,NewTarget);}else{result=Super.apply(this,arguments);}return(0,_possibleConstructorReturn2.default)(this,result);};}function _isNativeReflectConstruct(){if(typeof Reflect==="undefined"||!Reflect.construct)return false;if(Reflect.construct.sham)return false;if(typeof Proxy==="function")return true;try{Date.prototype.toString.call(Reflect.construct(Date,[],function(){}));return true;}catch(e){return false;}}var OPACITY_ANIMATION_IN_TIME=225;var OPACITY_ANIMATION_OUT_TIME=195;var EASING_OUT=_reactNative.Easing.bezier(0.25,0.46,0.45,0.94);var EASING_IN=_reactNative.Easing.out(EASING_OUT);var ESCAPE_KEY='Escape';var CustomActionSheet=function(_React$Component){(0,_inherits2.default)(CustomActionSheet,_React$Component);var _super=_createSuper(CustomActionSheet);function CustomActionSheet(){var _this;(0,_classCallCheck2.default)(this,CustomActionSheet);for(var _len=arguments.length,args=new Array(_len),_key=0;_key<_len;_key++){args[_key]=arguments[_key];}_this=_super.call.apply(_super,[this].concat(args));_this._actionSheetHeight=360;_this.state={isVisible:false,isAnimating:false,options:null,onSelect:null,overlayOpacity:new _reactNative.Animated.Value(0),sheetOpacity:new _reactNative.Animated.Value(0)};_this._deferAfterAnimation=undefined;_this._handleWebKeyDown=function(event){if(event.key===ESCAPE_KEY&&_this.state.isVisible){event.preventDefault();_this._selectCancelButton();}};_this._setActionSheetHeight=function(_ref){var nativeEvent=_ref.nativeEvent;return _this._actionSheetHeight=nativeEvent.layout.height;};_this.showActionSheetWithOptions=function(options,onSelect){var _this$state=_this.state,isVisible=_this$state.isVisible,overlayOpacity=_this$state.overlayOpacity,sheetOpacity=_this$state.sheetOpacity;var _this$props$useNative=_this.props.useNativeDriver,useNativeDriver=_this$props$useNative===void 0?true:_this$props$useNative;if(isVisible){_this._deferAfterAnimation=_this.showActionSheetWithOptions.bind((0,_assertThisInitialized2.default)(_this),options,onSelect);return;}_this.setState({options:options,onSelect:onSelect,isVisible:true,isAnimating:true});overlayOpacity.setValue(0);sheetOpacity.setValue(0);_reactNative.Animated.parallel([_reactNative.Animated.timing(overlayOpacity,{toValue:0.32,easing:EASING_OUT,duration:OPACITY_ANIMATION_IN_TIME,useNativeDriver:useNativeDriver}),_reactNative.Animated.timing(sheetOpacity,{toValue:1,easing:EASING_OUT,duration:OPACITY_ANIMATION_IN_TIME,useNativeDriver:useNativeDriver})]).start(function(result){if(result.finished){_this.setState({isAnimating:false});_this._deferAfterAnimation=undefined;}});_reactNative.BackHandler.addEventListener('actionSheetHardwareBackPress',_this._selectCancelButton);};_this._selectCancelButton=function(){var options=_this.state.options;if(!options){return false;}if(typeof options.cancelButtonIndex==='undefined'){return false;}else if(typeof options.cancelButtonIndex==='number'){return _this._onSelect(options.cancelButtonIndex);}else{return _this._animateOut();}};_this._onSelect=function(index){var _this$state2=_this.state,isAnimating=_this$state2.isAnimating,onSelect=_this$state2.onSelect;if(isAnimating){return false;}if(onSelect){_this._deferAfterAnimation=onSelect.bind((0,_assertThisInitialized2.default)(_this),index);}return _this._animateOut();};_this._animateOut=function(){var _this$state3=_this.state,isAnimating=_this$state3.isAnimating,overlayOpacity=_this$state3.overlayOpacity,sheetOpacity=_this$state3.sheetOpacity;var _this$props$useNative2=_this.props.useNativeDriver,useNativeDriver=_this$props$useNative2===void 0?true:_this$props$useNative2;if(isAnimating){return false;}_reactNative.BackHandler.removeEventListener('actionSheetHardwareBackPress',_this._selectCancelButton);_this.setState({isAnimating:true});_reactNative.Animated.parallel([_reactNative.Animated.timing(overlayOpacity,{toValue:0,easing:EASING_IN,duration:OPACITY_ANIMATION_OUT_TIME,useNativeDriver:useNativeDriver}),_reactNative.Animated.timing(sheetOpacity,{toValue:0,easing:EASING_IN,duration:OPACITY_ANIMATION_OUT_TIME,useNativeDriver:useNativeDriver})]).start(function(result){if(result.finished){_this.setState({isVisible:false,isAnimating:false});if(_this._deferAfterAnimation){_this._deferAfterAnimation();}}});return true;};return _this;}(0,_createClass2.default)(CustomActionSheet,[{key:"componentDidMount",value:function componentDidMount(){if(_reactNative.Platform.OS==='web'){document.addEventListener('keydown',this._handleWebKeyDown);}}},{key:"componentWillUnmount",value:function componentWillUnmount(){if(_reactNative.Platform.OS==='web'){document.removeEventListener('keydown',this._handleWebKeyDown);}}},{key:"render",value:function render(){var _this$state4=this.state,isVisible=_this$state4.isVisible,overlayOpacity=_this$state4.overlayOpacity,options=_this$state4.options;var useModal=options?options.autoFocus||options.useModal===true:false;var overlay=isVisible?React.createElement(_reactNative.Animated.View,{style:[styles.overlay,{opacity:overlayOpacity}],__source:{fileName:_jsxFileName,lineNumber:79,columnNumber:7}}):null;var appContent=React.createElement(_reactNative.View,{style:styles.flexContainer,importantForAccessibility:isVisible?'no-hide-descendants':'auto',__source:{fileName:_jsxFileName,lineNumber:91,columnNumber:7}},React.Children.only(this.props.children));return React.createElement(_reactNative.View,{pointerEvents:this.props.pointerEvents,style:styles.flexContainer,__source:{fileName:_jsxFileName,lineNumber:99,columnNumber:7}},appContent,isVisible&&!useModal&&React.createElement(React.Fragment,null,overlay,this._renderSheet()),isVisible&&useModal&&React.createElement(_reactNative.Modal,{animationType:"none",transparent:true,onRequestClose:this._selectCancelButton,__source:{fileName:_jsxFileName,lineNumber:108,columnNumber:11}},overlay,this._renderSheet()));}},{key:"_renderSheet",value:function _renderSheet(){var _this$state5=this.state,options=_this$state5.options,isAnimating=_this$state5.isAnimating,sheetOpacity=_this$state5.sheetOpacity;if(!options){return null;}var optionsArray=options.options,icons=options.icons,tintIcons=options.tintIcons,destructiveButtonIndex=options.destructiveButtonIndex,disabledButtonIndices=options.disabledButtonIndices,destructiveColor=options.destructiveColor,textStyle=options.textStyle,tintColor=options.tintColor,title=options.title,titleTextStyle=options.titleTextStyle,message=options.message,messageTextStyle=options.messageTextStyle,autoFocus=options.autoFocus,showSeparators=options.showSeparators,containerStyle=options.containerStyle,separatorStyle=options.separatorStyle,cancelButtonIndex=options.cancelButtonIndex,cancelButtonTintColor=options.cancelButtonTintColor;return React.createElement(_reactNative.TouchableWithoutFeedback,{importantForAccessibility:"yes",onPress:this._selectCancelButton,__source:{fileName:_jsxFileName,lineNumber:145,columnNumber:7}},React.createElement(_reactNative.Animated.View,{needsOffscreenAlphaCompositing:isAnimating,style:[styles.sheetContainer,{opacity:sheetOpacity,transform:[{translateY:sheetOpacity.interpolate({inputRange:[0,1],outputRange:[this._actionSheetHeight,0]})}]}],__source:{fileName:_jsxFileName,lineNumber:146,columnNumber:9}},React.createElement(_reactNative.View,{style:styles.sheet,onLayout:this._setActionSheetHeight,__source:{fileName:_jsxFileName,lineNumber:162,columnNumber:11}},React.createElement(_ActionGroup.default,{options:optionsArray,icons:icons,tintIcons:tintIcons===undefined?true:tintIcons,cancelButtonIndex:cancelButtonIndex,cancelButtonTintColor:cancelButtonTintColor,destructiveButtonIndex:destructiveButtonIndex,destructiveColor:destructiveColor,disabledButtonIndices:disabledButtonIndices,onSelect:this._onSelect,startIndex:0,length:optionsArray.length,textStyle:textStyle||{},tintColor:tintColor,title:title||undefined,titleTextStyle:titleTextStyle,message:message||undefined,messageTextStyle:messageTextStyle,autoFocus:autoFocus,showSeparators:showSeparators,containerStyle:containerStyle,separatorStyle:separatorStyle,__source:{fileName:_jsxFileName,lineNumber:163,columnNumber:13}}))));}}]);return CustomActionSheet;}(React.Component);exports.default=CustomActionSheet;var styles=_reactNative.StyleSheet.create({flexContainer:{flex:1},overlay:{position:'absolute',top:0,right:0,bottom:0,left:0,backgroundColor:'black'},sheetContainer:{position:'absolute',left:0,right:0,bottom:0,top:0,backgroundColor:'transparent',alignItems:'flex-end',justifyContent:'center',flexDirection:'row'},sheet:{flex:1,backgroundColor:'transparent'}}); | ||
var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");var _interopRequireWildcard=require("@babel/runtime/helpers/interopRequireWildcard");Object.defineProperty(exports,"__esModule",{value:true});exports.default=void 0;var _classCallCheck2=_interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));var _createClass2=_interopRequireDefault(require("@babel/runtime/helpers/createClass"));var _assertThisInitialized2=_interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));var _inherits2=_interopRequireDefault(require("@babel/runtime/helpers/inherits"));var _possibleConstructorReturn2=_interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));var _getPrototypeOf2=_interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));var React=_interopRequireWildcard(require("react"));var _reactNative=require("react-native");var _ActionGroup=_interopRequireDefault(require("./ActionGroup"));var _jsxFileName="/home/runner/work/react-native-action-sheet/react-native-action-sheet/src/ActionSheet/CustomActionSheet.tsx";function _createSuper(Derived){var hasNativeReflectConstruct=_isNativeReflectConstruct();return function _createSuperInternal(){var Super=(0,_getPrototypeOf2.default)(Derived),result;if(hasNativeReflectConstruct){var NewTarget=(0,_getPrototypeOf2.default)(this).constructor;result=Reflect.construct(Super,arguments,NewTarget);}else{result=Super.apply(this,arguments);}return(0,_possibleConstructorReturn2.default)(this,result);};}function _isNativeReflectConstruct(){if(typeof Reflect==="undefined"||!Reflect.construct)return false;if(Reflect.construct.sham)return false;if(typeof Proxy==="function")return true;try{Date.prototype.toString.call(Reflect.construct(Date,[],function(){}));return true;}catch(e){return false;}}var OPACITY_ANIMATION_IN_TIME=225;var OPACITY_ANIMATION_OUT_TIME=195;var EASING_OUT=_reactNative.Easing.bezier(0.25,0.46,0.45,0.94);var EASING_IN=_reactNative.Easing.out(EASING_OUT);var ESCAPE_KEY='Escape';var CustomActionSheet=function(_React$Component){(0,_inherits2.default)(CustomActionSheet,_React$Component);var _super=_createSuper(CustomActionSheet);function CustomActionSheet(){var _this;(0,_classCallCheck2.default)(this,CustomActionSheet);for(var _len=arguments.length,args=new Array(_len),_key=0;_key<_len;_key++){args[_key]=arguments[_key];}_this=_super.call.apply(_super,[this].concat(args));_this._actionSheetHeight=360;_this.state={isVisible:false,isAnimating:false,options:null,onSelect:null,overlayOpacity:new _reactNative.Animated.Value(0),sheetOpacity:new _reactNative.Animated.Value(0)};_this._deferAfterAnimation=undefined;_this._handleWebKeyDown=function(event){if(event.key===ESCAPE_KEY&&_this.state.isVisible){event.preventDefault();_this._selectCancelButton();}};_this._setActionSheetHeight=function(_ref){var nativeEvent=_ref.nativeEvent;return _this._actionSheetHeight=nativeEvent.layout.height;};_this.showActionSheetWithOptions=function(options,onSelect){var _this$state=_this.state,isVisible=_this$state.isVisible,overlayOpacity=_this$state.overlayOpacity,sheetOpacity=_this$state.sheetOpacity;var _this$props$useNative=_this.props.useNativeDriver,useNativeDriver=_this$props$useNative===void 0?true:_this$props$useNative;if(isVisible){_this._deferAfterAnimation=_this.showActionSheetWithOptions.bind((0,_assertThisInitialized2.default)(_this),options,onSelect);return;}_this.setState({options:options,onSelect:onSelect,isVisible:true,isAnimating:true});overlayOpacity.setValue(0);sheetOpacity.setValue(0);_reactNative.Animated.parallel([_reactNative.Animated.timing(overlayOpacity,{toValue:0.32,easing:EASING_OUT,duration:OPACITY_ANIMATION_IN_TIME,useNativeDriver:useNativeDriver}),_reactNative.Animated.timing(sheetOpacity,{toValue:1,easing:EASING_OUT,duration:OPACITY_ANIMATION_IN_TIME,useNativeDriver:useNativeDriver})]).start(function(result){if(result.finished){_this.setState({isAnimating:false});_this._deferAfterAnimation=undefined;}});_reactNative.BackHandler.addEventListener('actionSheetHardwareBackPress',_this._selectCancelButton);};_this._selectCancelButton=function(){var options=_this.state.options;if(!options){return false;}if(typeof options.cancelButtonIndex==='undefined'){return false;}else if(typeof options.cancelButtonIndex==='number'){return _this._onSelect(options.cancelButtonIndex);}else{return _this._animateOut();}};_this._onSelect=function(index){var _this$state2=_this.state,isAnimating=_this$state2.isAnimating,onSelect=_this$state2.onSelect;if(isAnimating){return false;}if(onSelect){_this._deferAfterAnimation=onSelect.bind((0,_assertThisInitialized2.default)(_this),index);}return _this._animateOut();};_this._animateOut=function(){var _this$state3=_this.state,isAnimating=_this$state3.isAnimating,overlayOpacity=_this$state3.overlayOpacity,sheetOpacity=_this$state3.sheetOpacity;var _this$props$useNative2=_this.props.useNativeDriver,useNativeDriver=_this$props$useNative2===void 0?true:_this$props$useNative2;if(isAnimating){return false;}_reactNative.BackHandler.removeEventListener('actionSheetHardwareBackPress',_this._selectCancelButton);_this.setState({isAnimating:true});_reactNative.Animated.parallel([_reactNative.Animated.timing(overlayOpacity,{toValue:0,easing:EASING_IN,duration:OPACITY_ANIMATION_OUT_TIME,useNativeDriver:useNativeDriver}),_reactNative.Animated.timing(sheetOpacity,{toValue:0,easing:EASING_IN,duration:OPACITY_ANIMATION_OUT_TIME,useNativeDriver:useNativeDriver})]).start(function(result){if(result.finished){_this.setState({isVisible:false,isAnimating:false});if(_this._deferAfterAnimation){_this._deferAfterAnimation();}}});return true;};return _this;}(0,_createClass2.default)(CustomActionSheet,[{key:"componentDidMount",value:function componentDidMount(){if(_reactNative.Platform.OS==='web'){document.addEventListener('keydown',this._handleWebKeyDown);}}},{key:"componentWillUnmount",value:function componentWillUnmount(){if(_reactNative.Platform.OS==='web'){document.removeEventListener('keydown',this._handleWebKeyDown);}}},{key:"render",value:function render(){var _this$state4=this.state,isVisible=_this$state4.isVisible,overlayOpacity=_this$state4.overlayOpacity,options=_this$state4.options;var useModal=options?options.autoFocus||options.useModal===true:false;var overlay=isVisible?React.createElement(_reactNative.Animated.View,{style:[styles.overlay,{opacity:overlayOpacity}],__source:{fileName:_jsxFileName,lineNumber:79,columnNumber:7}}):null;var appContent=React.createElement(_reactNative.View,{style:styles.flexContainer,importantForAccessibility:isVisible?'no-hide-descendants':'auto',__source:{fileName:_jsxFileName,lineNumber:91,columnNumber:7}},React.Children.only(this.props.children));return React.createElement(_reactNative.View,{pointerEvents:this.props.pointerEvents,style:styles.flexContainer,__source:{fileName:_jsxFileName,lineNumber:99,columnNumber:7}},appContent,isVisible&&!useModal&&React.createElement(React.Fragment,null,overlay,this._renderSheet()),isVisible&&useModal&&React.createElement(_reactNative.Modal,{animationType:"none",transparent:true,onRequestClose:this._selectCancelButton,__source:{fileName:_jsxFileName,lineNumber:108,columnNumber:11}},overlay,this._renderSheet()));}},{key:"_renderSheet",value:function _renderSheet(){var _this$state5=this.state,options=_this$state5.options,isAnimating=_this$state5.isAnimating,sheetOpacity=_this$state5.sheetOpacity;if(!options){return null;}var optionsArray=options.options,icons=options.icons,tintIcons=options.tintIcons,destructiveButtonIndex=options.destructiveButtonIndex,disabledButtonIndices=options.disabledButtonIndices,destructiveColor=options.destructiveColor,textStyle=options.textStyle,tintColor=options.tintColor,title=options.title,titleTextStyle=options.titleTextStyle,message=options.message,messageTextStyle=options.messageTextStyle,autoFocus=options.autoFocus,showSeparators=options.showSeparators,containerStyle=options.containerStyle,separatorStyle=options.separatorStyle,cancelButtonIndex=options.cancelButtonIndex,cancelButtonTintColor=options.cancelButtonTintColor;return React.createElement(_reactNative.TouchableWithoutFeedback,{importantForAccessibility:"yes",onPress:this._selectCancelButton,__source:{fileName:_jsxFileName,lineNumber:145,columnNumber:7}},React.createElement(_reactNative.Animated.View,{needsOffscreenAlphaCompositing:isAnimating,style:[styles.sheetContainer,{opacity:sheetOpacity,transform:[{translateY:sheetOpacity.interpolate({inputRange:[0,1],outputRange:[this._actionSheetHeight,0]})}]}],__source:{fileName:_jsxFileName,lineNumber:146,columnNumber:9}},React.createElement(_reactNative.View,{style:styles.sheet,onLayout:this._setActionSheetHeight,__source:{fileName:_jsxFileName,lineNumber:162,columnNumber:11}},React.createElement(_ActionGroup.default,{options:optionsArray,icons:icons,tintIcons:tintIcons===undefined?true:tintIcons,cancelButtonIndex:cancelButtonIndex,cancelButtonTintColor:cancelButtonTintColor,destructiveButtonIndex:destructiveButtonIndex,destructiveColor:destructiveColor,disabledButtonIndices:disabledButtonIndices,onSelect:this._onSelect,startIndex:0,length:optionsArray.length,textStyle:textStyle||{},tintColor:tintColor,title:title||undefined,titleTextStyle:titleTextStyle,message:message||undefined,messageTextStyle:messageTextStyle,autoFocus:autoFocus,showSeparators:showSeparators,containerStyle:containerStyle,separatorStyle:separatorStyle,__source:{fileName:_jsxFileName,lineNumber:163,columnNumber:13}}))));}}]);return CustomActionSheet;}(React.Component);exports.default=CustomActionSheet;var styles=_reactNative.StyleSheet.create({flexContainer:{flex:1},overlay:{position:'absolute',top:0,right:0,bottom:0,left:0,backgroundColor:'black'},sheetContainer:{position:'absolute',left:0,right:0,bottom:0,top:0,backgroundColor:'transparent',alignItems:'flex-end',justifyContent:'center',flexDirection:'row'},sheet:{flex:1,backgroundColor:'transparent'}}); | ||
//# sourceMappingURL=CustomActionSheet.js.map |
@@ -1,2 +0,2 @@ | ||
var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");var _interopRequireWildcard=require("@babel/runtime/helpers/interopRequireWildcard");Object.defineProperty(exports,"__esModule",{value:true});exports.default=void 0;var _classCallCheck2=_interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));var _createClass2=_interopRequireDefault(require("@babel/runtime/helpers/createClass"));var _inherits2=_interopRequireDefault(require("@babel/runtime/helpers/inherits"));var _possibleConstructorReturn2=_interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));var _getPrototypeOf2=_interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));var React=_interopRequireWildcard(require("react"));var _reactNative=require("react-native");var _jsxFileName="/Users/bradley/Code/expo/react-native-action-sheet/src/ActionSheet/index.ios.tsx";function _createSuper(Derived){var hasNativeReflectConstruct=_isNativeReflectConstruct();return function _createSuperInternal(){var Super=(0,_getPrototypeOf2.default)(Derived),result;if(hasNativeReflectConstruct){var NewTarget=(0,_getPrototypeOf2.default)(this).constructor;result=Reflect.construct(Super,arguments,NewTarget);}else{result=Super.apply(this,arguments);}return(0,_possibleConstructorReturn2.default)(this,result);};}function _isNativeReflectConstruct(){if(typeof Reflect==="undefined"||!Reflect.construct)return false;if(Reflect.construct.sham)return false;if(typeof Proxy==="function")return true;try{Date.prototype.toString.call(Reflect.construct(Date,[],function(){}));return true;}catch(e){return false;}}var ActionSheet=function(_React$Component){(0,_inherits2.default)(ActionSheet,_React$Component);var _super=_createSuper(ActionSheet);function ActionSheet(){(0,_classCallCheck2.default)(this,ActionSheet);return _super.apply(this,arguments);}(0,_createClass2.default)(ActionSheet,[{key:"render",value:function render(){return React.createElement(_reactNative.View,{pointerEvents:this.props.pointerEvents,style:{flex:1},__source:{fileName:_jsxFileName,lineNumber:16,columnNumber:7}},React.Children.only(this.props.children));}},{key:"showActionSheetWithOptions",value:function showActionSheetWithOptions(dataOptions,onSelect){var cancelButtonIndex=dataOptions.cancelButtonIndex,destructiveButtonIndex=dataOptions.destructiveButtonIndex,options=dataOptions.options,tintColor=dataOptions.tintColor,cancelButtonTintColor=dataOptions.cancelButtonTintColor,disabledButtonIndices=dataOptions.disabledButtonIndices;var iosOptions={cancelButtonIndex:cancelButtonIndex,destructiveButtonIndex:destructiveButtonIndex,options:options,tintColor:tintColor,cancelButtonTintColor:cancelButtonTintColor,disabledButtonIndices:disabledButtonIndices,title:dataOptions.title||undefined,message:dataOptions.message||undefined,anchor:dataOptions.anchor||undefined,userInterfaceStyle:dataOptions.userInterfaceStyle||undefined};_reactNative.ActionSheetIOS.showActionSheetWithOptions(iosOptions,onSelect);}}]);return ActionSheet;}(React.Component);exports.default=ActionSheet; | ||
var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");var _interopRequireWildcard=require("@babel/runtime/helpers/interopRequireWildcard");Object.defineProperty(exports,"__esModule",{value:true});exports.default=void 0;var _classCallCheck2=_interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));var _createClass2=_interopRequireDefault(require("@babel/runtime/helpers/createClass"));var _inherits2=_interopRequireDefault(require("@babel/runtime/helpers/inherits"));var _possibleConstructorReturn2=_interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));var _getPrototypeOf2=_interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));var React=_interopRequireWildcard(require("react"));var _reactNative=require("react-native");var _jsxFileName="/home/runner/work/react-native-action-sheet/react-native-action-sheet/src/ActionSheet/index.ios.tsx";function _createSuper(Derived){var hasNativeReflectConstruct=_isNativeReflectConstruct();return function _createSuperInternal(){var Super=(0,_getPrototypeOf2.default)(Derived),result;if(hasNativeReflectConstruct){var NewTarget=(0,_getPrototypeOf2.default)(this).constructor;result=Reflect.construct(Super,arguments,NewTarget);}else{result=Super.apply(this,arguments);}return(0,_possibleConstructorReturn2.default)(this,result);};}function _isNativeReflectConstruct(){if(typeof Reflect==="undefined"||!Reflect.construct)return false;if(Reflect.construct.sham)return false;if(typeof Proxy==="function")return true;try{Date.prototype.toString.call(Reflect.construct(Date,[],function(){}));return true;}catch(e){return false;}}var ActionSheet=function(_React$Component){(0,_inherits2.default)(ActionSheet,_React$Component);var _super=_createSuper(ActionSheet);function ActionSheet(){(0,_classCallCheck2.default)(this,ActionSheet);return _super.apply(this,arguments);}(0,_createClass2.default)(ActionSheet,[{key:"render",value:function render(){return React.createElement(_reactNative.View,{pointerEvents:this.props.pointerEvents,style:{flex:1},__source:{fileName:_jsxFileName,lineNumber:16,columnNumber:7}},React.Children.only(this.props.children));}},{key:"showActionSheetWithOptions",value:function showActionSheetWithOptions(dataOptions,onSelect){var cancelButtonIndex=dataOptions.cancelButtonIndex,destructiveButtonIndex=dataOptions.destructiveButtonIndex,options=dataOptions.options,tintColor=dataOptions.tintColor,cancelButtonTintColor=dataOptions.cancelButtonTintColor,disabledButtonIndices=dataOptions.disabledButtonIndices;var iosOptions={cancelButtonIndex:cancelButtonIndex,destructiveButtonIndex:destructiveButtonIndex,options:options,tintColor:tintColor,cancelButtonTintColor:cancelButtonTintColor,disabledButtonIndices:disabledButtonIndices,title:dataOptions.title||undefined,message:dataOptions.message||undefined,anchor:dataOptions.anchor||undefined,userInterfaceStyle:dataOptions.userInterfaceStyle||undefined};_reactNative.ActionSheetIOS.showActionSheetWithOptions(iosOptions,onSelect);}}]);return ActionSheet;}(React.Component);exports.default=ActionSheet; | ||
//# sourceMappingURL=index.ios.js.map |
@@ -1,2 +0,2 @@ | ||
var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");var _interopRequireWildcard=require("@babel/runtime/helpers/interopRequireWildcard");Object.defineProperty(exports,"__esModule",{value:true});exports.default=void 0;var _extends2=_interopRequireDefault(require("@babel/runtime/helpers/extends"));var _classCallCheck2=_interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));var _createClass2=_interopRequireDefault(require("@babel/runtime/helpers/createClass"));var _inherits2=_interopRequireDefault(require("@babel/runtime/helpers/inherits"));var _possibleConstructorReturn2=_interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));var _getPrototypeOf2=_interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));var React=_interopRequireWildcard(require("react"));var _reactNative=require("react-native");var _jsxFileName="/Users/bradley/Code/expo/react-native-action-sheet/src/ActionSheet/TouchableNativeFeedbackSafe.tsx";function _createSuper(Derived){var hasNativeReflectConstruct=_isNativeReflectConstruct();return function _createSuperInternal(){var Super=(0,_getPrototypeOf2.default)(Derived),result;if(hasNativeReflectConstruct){var NewTarget=(0,_getPrototypeOf2.default)(this).constructor;result=Reflect.construct(Super,arguments,NewTarget);}else{result=Super.apply(this,arguments);}return(0,_possibleConstructorReturn2.default)(this,result);};}function _isNativeReflectConstruct(){if(typeof Reflect==="undefined"||!Reflect.construct)return false;if(Reflect.construct.sham)return false;if(typeof Proxy==="function")return true;try{Date.prototype.toString.call(Reflect.construct(Date,[],function(){}));return true;}catch(e){return false;}}var CustomTouchableOpacity=function(_React$Component){(0,_inherits2.default)(CustomTouchableOpacity,_React$Component);var _super=_createSuper(CustomTouchableOpacity);function CustomTouchableOpacity(){(0,_classCallCheck2.default)(this,CustomTouchableOpacity);return _super.apply(this,arguments);}(0,_createClass2.default)(CustomTouchableOpacity,[{key:"render",value:function render(){return React.createElement(_reactNative.TouchableOpacity,(0,_extends2.default)({},this.props,{__source:{fileName:_jsxFileName,lineNumber:17,columnNumber:12}}),this.props.children);}}]);return CustomTouchableOpacity;}(React.Component);CustomTouchableOpacity.SelectableBackground=function(){return{};};CustomTouchableOpacity.SelectableBackgroundBorderless=function(){return{};};CustomTouchableOpacity.Ripple=function(color,borderless){return{};};var TouchableComponent=_reactNative.Platform.select({web:CustomTouchableOpacity,default:_reactNative.Platform.Version<=20?CustomTouchableOpacity:_reactNative.TouchableNativeFeedback});var TouchableNativeFeedbackSafe=function(_React$Component2){(0,_inherits2.default)(TouchableNativeFeedbackSafe,_React$Component2);var _super2=_createSuper(TouchableNativeFeedbackSafe);function TouchableNativeFeedbackSafe(){(0,_classCallCheck2.default)(this,TouchableNativeFeedbackSafe);return _super2.apply(this,arguments);}(0,_createClass2.default)(TouchableNativeFeedbackSafe,[{key:"render",value:function render(){if(TouchableComponent===_reactNative.TouchableNativeFeedback){return React.createElement(TouchableComponent,(0,_extends2.default)({},this.props,{style:{},__source:{fileName:_jsxFileName,lineNumber:39,columnNumber:9}}),React.createElement(_reactNative.View,{style:this.props.style,__source:{fileName:_jsxFileName,lineNumber:40,columnNumber:11}},this.props.children));}return React.createElement(TouchableComponent,(0,_extends2.default)({},this.props,{__source:{fileName:_jsxFileName,lineNumber:46,columnNumber:12}}),this.props.children);}}]);return TouchableNativeFeedbackSafe;}(React.Component);exports.default=TouchableNativeFeedbackSafe;TouchableNativeFeedbackSafe.SelectableBackground=TouchableComponent.SelectableBackground;TouchableNativeFeedbackSafe.SelectableBackgroundBorderless=TouchableComponent.SelectableBackgroundBorderless;TouchableNativeFeedbackSafe.Ripple=TouchableComponent.Ripple; | ||
var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");var _interopRequireWildcard=require("@babel/runtime/helpers/interopRequireWildcard");Object.defineProperty(exports,"__esModule",{value:true});exports.default=void 0;var _extends2=_interopRequireDefault(require("@babel/runtime/helpers/extends"));var _classCallCheck2=_interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));var _createClass2=_interopRequireDefault(require("@babel/runtime/helpers/createClass"));var _inherits2=_interopRequireDefault(require("@babel/runtime/helpers/inherits"));var _possibleConstructorReturn2=_interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));var _getPrototypeOf2=_interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));var React=_interopRequireWildcard(require("react"));var _reactNative=require("react-native");var _jsxFileName="/home/runner/work/react-native-action-sheet/react-native-action-sheet/src/ActionSheet/TouchableNativeFeedbackSafe.tsx";function _createSuper(Derived){var hasNativeReflectConstruct=_isNativeReflectConstruct();return function _createSuperInternal(){var Super=(0,_getPrototypeOf2.default)(Derived),result;if(hasNativeReflectConstruct){var NewTarget=(0,_getPrototypeOf2.default)(this).constructor;result=Reflect.construct(Super,arguments,NewTarget);}else{result=Super.apply(this,arguments);}return(0,_possibleConstructorReturn2.default)(this,result);};}function _isNativeReflectConstruct(){if(typeof Reflect==="undefined"||!Reflect.construct)return false;if(Reflect.construct.sham)return false;if(typeof Proxy==="function")return true;try{Date.prototype.toString.call(Reflect.construct(Date,[],function(){}));return true;}catch(e){return false;}}var CustomTouchableOpacity=function(_React$Component){(0,_inherits2.default)(CustomTouchableOpacity,_React$Component);var _super=_createSuper(CustomTouchableOpacity);function CustomTouchableOpacity(){(0,_classCallCheck2.default)(this,CustomTouchableOpacity);return _super.apply(this,arguments);}(0,_createClass2.default)(CustomTouchableOpacity,[{key:"render",value:function render(){return React.createElement(_reactNative.TouchableOpacity,(0,_extends2.default)({},this.props,{__source:{fileName:_jsxFileName,lineNumber:17,columnNumber:12}}),this.props.children);}}]);return CustomTouchableOpacity;}(React.Component);CustomTouchableOpacity.SelectableBackground=function(){return{};};CustomTouchableOpacity.SelectableBackgroundBorderless=function(){return{};};CustomTouchableOpacity.Ripple=function(color,borderless){return{};};var TouchableComponent=_reactNative.Platform.select({web:CustomTouchableOpacity,default:_reactNative.Platform.Version<=20?CustomTouchableOpacity:_reactNative.TouchableNativeFeedback});var TouchableNativeFeedbackSafe=function(_React$Component2){(0,_inherits2.default)(TouchableNativeFeedbackSafe,_React$Component2);var _super2=_createSuper(TouchableNativeFeedbackSafe);function TouchableNativeFeedbackSafe(){(0,_classCallCheck2.default)(this,TouchableNativeFeedbackSafe);return _super2.apply(this,arguments);}(0,_createClass2.default)(TouchableNativeFeedbackSafe,[{key:"render",value:function render(){if(TouchableComponent===_reactNative.TouchableNativeFeedback){return React.createElement(TouchableComponent,(0,_extends2.default)({},this.props,{style:{},__source:{fileName:_jsxFileName,lineNumber:39,columnNumber:9}}),React.createElement(_reactNative.View,{style:this.props.style,__source:{fileName:_jsxFileName,lineNumber:40,columnNumber:11}},this.props.children));}return React.createElement(TouchableComponent,(0,_extends2.default)({},this.props,{__source:{fileName:_jsxFileName,lineNumber:46,columnNumber:12}}),this.props.children);}}]);return TouchableNativeFeedbackSafe;}(React.Component);exports.default=TouchableNativeFeedbackSafe;TouchableNativeFeedbackSafe.SelectableBackground=TouchableComponent.SelectableBackground;TouchableNativeFeedbackSafe.SelectableBackgroundBorderless=TouchableComponent.SelectableBackgroundBorderless;TouchableNativeFeedbackSafe.Ripple=TouchableComponent.Ripple; | ||
//# sourceMappingURL=TouchableNativeFeedbackSafe.js.map |
@@ -1,2 +0,2 @@ | ||
var _interopRequireWildcard=require("@babel/runtime/helpers/interopRequireWildcard");var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.default=ActionSheetProvider;var React=_interopRequireWildcard(require("react"));var _ActionSheet=_interopRequireDefault(require("./ActionSheet"));var _CustomActionSheet=_interopRequireDefault(require("./ActionSheet/CustomActionSheet"));var _context=require("./context");var _jsxFileName="/Users/bradley/Code/expo/react-native-action-sheet/src/ActionSheetProvider.tsx";function ActionSheetProvider(_ref){var children=_ref.children,useNativeDriver=_ref.useNativeDriver,_ref$useCustomActionS=_ref.useCustomActionSheet,useCustomActionSheet=_ref$useCustomActionS===void 0?false:_ref$useCustomActionS;var actionSheetRef=React.useRef(null);var context=React.useMemo(function(){return{showActionSheetWithOptions:function showActionSheetWithOptions(options,callback){if(actionSheetRef.current){actionSheetRef.current.showActionSheetWithOptions(options,callback);}}};},[actionSheetRef]);var ActionSheet=React.useMemo(function(){return useCustomActionSheet?_CustomActionSheet.default:_ActionSheet.default;},[useCustomActionSheet]);return React.createElement(_context.Provider,{value:context,__source:{fileName:_jsxFileName,lineNumber:39,columnNumber:5}},React.createElement(ActionSheet,{ref:actionSheetRef,useNativeDriver:useNativeDriver,__source:{fileName:_jsxFileName,lineNumber:40,columnNumber:7}},React.Children.only(children)));} | ||
var _interopRequireWildcard=require("@babel/runtime/helpers/interopRequireWildcard");var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.default=ActionSheetProvider;var React=_interopRequireWildcard(require("react"));var _ActionSheet=_interopRequireDefault(require("./ActionSheet"));var _CustomActionSheet=_interopRequireDefault(require("./ActionSheet/CustomActionSheet"));var _context=require("./context");var _jsxFileName="/home/runner/work/react-native-action-sheet/react-native-action-sheet/src/ActionSheetProvider.tsx";function ActionSheetProvider(_ref){var children=_ref.children,useNativeDriver=_ref.useNativeDriver,_ref$useCustomActionS=_ref.useCustomActionSheet,useCustomActionSheet=_ref$useCustomActionS===void 0?false:_ref$useCustomActionS;var actionSheetRef=React.useRef(null);var context=React.useMemo(function(){return{showActionSheetWithOptions:function showActionSheetWithOptions(options,callback){if(actionSheetRef.current){actionSheetRef.current.showActionSheetWithOptions(options,callback);}}};},[actionSheetRef]);var ActionSheet=React.useMemo(function(){return useCustomActionSheet?_CustomActionSheet.default:_ActionSheet.default;},[useCustomActionSheet]);return React.createElement(_context.Provider,{value:context,__source:{fileName:_jsxFileName,lineNumber:39,columnNumber:5}},React.createElement(ActionSheet,{ref:actionSheetRef,useNativeDriver:useNativeDriver,__source:{fileName:_jsxFileName,lineNumber:40,columnNumber:7}},React.Children.only(children)));} | ||
//# sourceMappingURL=ActionSheetProvider.js.map |
@@ -1,2 +0,2 @@ | ||
var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");var _interopRequireWildcard=require("@babel/runtime/helpers/interopRequireWildcard");Object.defineProperty(exports,"__esModule",{value:true});exports.default=connectActionSheet;var _extends2=_interopRequireDefault(require("@babel/runtime/helpers/extends"));var _hoistNonReactStatics=_interopRequireDefault(require("hoist-non-react-statics"));var React=_interopRequireWildcard(require("react"));var _context=require("./context");var _jsxFileName="/Users/bradley/Code/expo/react-native-action-sheet/src/connectActionSheet.tsx";function connectActionSheet(WrappedComponent){var ConnectedActionSheet=function ConnectedActionSheet(props){return React.createElement(_context.Consumer,{__source:{fileName:_jsxFileName,lineNumber:12,columnNumber:7}},function(_ref){var showActionSheetWithOptions=_ref.showActionSheetWithOptions;return React.createElement(WrappedComponent,(0,_extends2.default)({},props,{showActionSheetWithOptions:showActionSheetWithOptions,__source:{fileName:_jsxFileName,lineNumber:15,columnNumber:13}}));});};return(0,_hoistNonReactStatics.default)(ConnectedActionSheet,WrappedComponent);} | ||
var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");var _interopRequireWildcard=require("@babel/runtime/helpers/interopRequireWildcard");Object.defineProperty(exports,"__esModule",{value:true});exports.default=connectActionSheet;var _extends2=_interopRequireDefault(require("@babel/runtime/helpers/extends"));var _hoistNonReactStatics=_interopRequireDefault(require("hoist-non-react-statics"));var React=_interopRequireWildcard(require("react"));var _context=require("./context");var _jsxFileName="/home/runner/work/react-native-action-sheet/react-native-action-sheet/src/connectActionSheet.tsx";function connectActionSheet(WrappedComponent){var ConnectedActionSheet=function ConnectedActionSheet(props){return React.createElement(_context.Consumer,{__source:{fileName:_jsxFileName,lineNumber:12,columnNumber:7}},function(_ref){var showActionSheetWithOptions=_ref.showActionSheetWithOptions;return React.createElement(WrappedComponent,(0,_extends2.default)({},props,{showActionSheetWithOptions:showActionSheetWithOptions,__source:{fileName:_jsxFileName,lineNumber:15,columnNumber:13}}));});};return(0,_hoistNonReactStatics.default)(ConnectedActionSheet,WrappedComponent);} | ||
//# sourceMappingURL=connectActionSheet.js.map |
@@ -1,2 +0,2 @@ | ||
import _classCallCheck from"@babel/runtime/helpers/classCallCheck";import _createClass from"@babel/runtime/helpers/createClass";import _inherits from"@babel/runtime/helpers/inherits";import _possibleConstructorReturn from"@babel/runtime/helpers/possibleConstructorReturn";import _getPrototypeOf from"@babel/runtime/helpers/getPrototypeOf";var _jsxFileName="/Users/bradley/Code/expo/react-native-action-sheet/src/ActionSheet/ActionGroup.tsx";function _createSuper(Derived){var hasNativeReflectConstruct=_isNativeReflectConstruct();return function _createSuperInternal(){var Super=_getPrototypeOf(Derived),result;if(hasNativeReflectConstruct){var NewTarget=_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget);}else{result=Super.apply(this,arguments);}return _possibleConstructorReturn(this,result);};}function _isNativeReflectConstruct(){if(typeof Reflect==="undefined"||!Reflect.construct)return false;if(Reflect.construct.sham)return false;if(typeof Proxy==="function")return true;try{Date.prototype.toString.call(Reflect.construct(Date,[],function(){}));return true;}catch(e){return false;}}import*as React from'react';import{AccessibilityInfo,findNodeHandle,Image,Platform,ScrollView,StyleSheet,Text,UIManager,View}from'react-native';import TouchableNativeFeedbackSafe from'./TouchableNativeFeedbackSafe';var BLACK_54PC_TRANSPARENT='#0000008a';var BLACK_87PC_TRANSPARENT='#000000de';var DESTRUCTIVE_COLOR='#d32f2f';var focusViewOnRender=function focusViewOnRender(ref){if(ref){var reactTag=findNodeHandle(ref);if(reactTag){if(Platform.OS==='android'){UIManager.sendAccessibilityEvent(reactTag,UIManager.AccessibilityEventTypes.typeViewFocused);}else{AccessibilityInfo.setAccessibilityFocus(reactTag);}}}};var isIndexDestructive=function isIndexDestructive(index,destructiveIndex){if(Array.isArray(destructiveIndex)){return destructiveIndex.includes(index);}return index===destructiveIndex;};var isIndexDisabled=function isIndexDisabled(index){var disabledButtonIndices=arguments.length>1&&arguments[1]!==undefined?arguments[1]:[];return disabledButtonIndices.includes(index);};var ActionGroup=function(_React$Component){_inherits(ActionGroup,_React$Component);var _super=_createSuper(ActionGroup);function ActionGroup(){var _this;_classCallCheck(this,ActionGroup);for(var _len=arguments.length,args=new Array(_len),_key=0;_key<_len;_key++){args[_key]=arguments[_key];}_this=_super.call.apply(_super,[this].concat(args));_this._renderRowSeparator=function(key){return React.createElement(View,{key:"separator-"+key,style:[styles.rowSeparator,_this.props.separatorStyle],__source:{fileName:_jsxFileName,lineNumber:82,columnNumber:7}});};_this._renderTitleContent=function(){var _this$props=_this.props,title=_this$props.title,titleTextStyle=_this$props.titleTextStyle,message=_this$props.message,messageTextStyle=_this$props.messageTextStyle,showSeparators=_this$props.showSeparators;if(!title&&!message){return null;}return React.createElement(View,{__source:{fileName:_jsxFileName,lineNumber:94,columnNumber:7}},React.createElement(View,{style:[styles.titleContainer,{paddingBottom:showSeparators?24:16}],__source:{fileName:_jsxFileName,lineNumber:95,columnNumber:9}},!!title&&React.createElement(Text,{style:[styles.title,titleTextStyle],__source:{fileName:_jsxFileName,lineNumber:96,columnNumber:23}},title),!!message&&React.createElement(Text,{style:[styles.message,messageTextStyle],__source:{fileName:_jsxFileName,lineNumber:97,columnNumber:25}},message)),!!showSeparators&&_this._renderRowSeparator('title'));};_this._renderIconElement=function(iconSource,color){var tintIcons=_this.props.tintIcons;if(!iconSource){return null;}if(typeof iconSource==='number'){var iconStyle=[styles.icon,{tintColor:tintIcons?color:undefined}];return React.createElement(Image,{fadeDuration:0,source:iconSource,resizeMode:"contain",style:iconStyle,__source:{fileName:_jsxFileName,lineNumber:112,columnNumber:14}});}else{return React.createElement(View,{style:styles.icon,__source:{fileName:_jsxFileName,lineNumber:114,columnNumber:14}},iconSource);}};_this._renderOptionViews=function(){var _this$props2=_this.props,options=_this$props2.options,icons=_this$props2.icons,cancelButtonIndex=_this$props2.cancelButtonIndex,cancelButtonTintColor=_this$props2.cancelButtonTintColor,destructiveButtonIndex=_this$props2.destructiveButtonIndex,disabledButtonIndices=_this$props2.disabledButtonIndices,_this$props2$destruct=_this$props2.destructiveColor,destructiveColor=_this$props2$destruct===void 0?DESTRUCTIVE_COLOR:_this$props2$destruct,onSelect=_this$props2.onSelect,startIndex=_this$props2.startIndex,length=_this$props2.length,textStyle=_this$props2.textStyle,tintColor=_this$props2.tintColor,autoFocus=_this$props2.autoFocus,showSeparators=_this$props2.showSeparators;var optionViews=[];var nativeFeedbackBackground=TouchableNativeFeedbackSafe.Ripple('rgba(180, 180, 180, 1)',false);var _loop=function _loop(_i){var defaultColor=tintColor?tintColor:(textStyle||{}).color||BLACK_87PC_TRANSPARENT;var disabled=isIndexDisabled(_i,disabledButtonIndices);var isCancelButton=_i===cancelButtonIndex;var color=isIndexDestructive(_i,destructiveButtonIndex)?destructiveColor:isCancelButton?cancelButtonTintColor||defaultColor:defaultColor;var iconSource=icons!=null?icons[_i]:null;optionViews.push(React.createElement(TouchableNativeFeedbackSafe,{ref:autoFocus&&_i===0?focusViewOnRender:undefined,key:_i,pressInDelay:0,background:nativeFeedbackBackground,disabled:disabled,onPress:function onPress(){return onSelect(_i);},style:[styles.button,disabled&&styles.disabledButton],accessibilityRole:"button",accessibilityLabel:options[_i],__source:{fileName:_jsxFileName,lineNumber:155,columnNumber:9}},_this._renderIconElement(iconSource,color),React.createElement(Text,{style:[styles.text,textStyle,{color:color}],__source:{fileName:_jsxFileName,lineNumber:166,columnNumber:11}},options[_i])));if(showSeparators&&_i<startIndex+length-1){optionViews.push(_this._renderRowSeparator(_i));}};for(var _i=startIndex;_i<startIndex+length;_i++){_loop(_i);}return optionViews;};return _this;}_createClass(ActionGroup,[{key:"render",value:function render(){return React.createElement(View,{style:[styles.groupContainer,this.props.containerStyle],__source:{fileName:_jsxFileName,lineNumber:73,columnNumber:7}},this._renderTitleContent(),React.createElement(ScrollView,{__source:{fileName:_jsxFileName,lineNumber:75,columnNumber:9}},this._renderOptionViews()));}}]);return ActionGroup;}(React.Component);ActionGroup.defaultProps={title:null,message:null,showSeparators:false,tintIcons:true,textStyle:{}};export{ActionGroup as default};var styles=StyleSheet.create({button:{justifyContent:'flex-start',alignItems:'center',flexDirection:'row',height:56,paddingHorizontal:16},disabledButton:{opacity:0.5},groupContainer:{backgroundColor:'#ffffff',overflow:'hidden'},icon:{width:24,height:24,marginRight:32,justifyContent:'center'},message:{marginTop:12,fontSize:14,color:BLACK_54PC_TRANSPARENT,textAlignVertical:'center'},rowSeparator:{backgroundColor:'#dddddd',height:1,width:'100%'},text:{fontSize:16,color:BLACK_87PC_TRANSPARENT,textAlignVertical:'center'},title:{fontSize:16,color:BLACK_54PC_TRANSPARENT,textAlignVertical:'center'},titleContainer:{alignItems:'flex-start',padding:16,paddingTop:24}}); | ||
import _classCallCheck from"@babel/runtime/helpers/classCallCheck";import _createClass from"@babel/runtime/helpers/createClass";import _inherits from"@babel/runtime/helpers/inherits";import _possibleConstructorReturn from"@babel/runtime/helpers/possibleConstructorReturn";import _getPrototypeOf from"@babel/runtime/helpers/getPrototypeOf";var _jsxFileName="/home/runner/work/react-native-action-sheet/react-native-action-sheet/src/ActionSheet/ActionGroup.tsx";function _createSuper(Derived){var hasNativeReflectConstruct=_isNativeReflectConstruct();return function _createSuperInternal(){var Super=_getPrototypeOf(Derived),result;if(hasNativeReflectConstruct){var NewTarget=_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget);}else{result=Super.apply(this,arguments);}return _possibleConstructorReturn(this,result);};}function _isNativeReflectConstruct(){if(typeof Reflect==="undefined"||!Reflect.construct)return false;if(Reflect.construct.sham)return false;if(typeof Proxy==="function")return true;try{Date.prototype.toString.call(Reflect.construct(Date,[],function(){}));return true;}catch(e){return false;}}import*as React from'react';import{AccessibilityInfo,findNodeHandle,Image,Platform,ScrollView,StyleSheet,Text,UIManager,View}from'react-native';import TouchableNativeFeedbackSafe from'./TouchableNativeFeedbackSafe';var BLACK_54PC_TRANSPARENT='#0000008a';var BLACK_87PC_TRANSPARENT='#000000de';var DESTRUCTIVE_COLOR='#d32f2f';var focusViewOnRender=function focusViewOnRender(ref){if(ref){var reactTag=findNodeHandle(ref);if(reactTag){if(Platform.OS==='android'){UIManager.sendAccessibilityEvent(reactTag,UIManager.AccessibilityEventTypes.typeViewFocused);}else{AccessibilityInfo.setAccessibilityFocus(reactTag);}}}};var isIndexDestructive=function isIndexDestructive(index,destructiveIndex){if(Array.isArray(destructiveIndex)){return destructiveIndex.includes(index);}return index===destructiveIndex;};var isIndexDisabled=function isIndexDisabled(index){var disabledButtonIndices=arguments.length>1&&arguments[1]!==undefined?arguments[1]:[];return disabledButtonIndices.includes(index);};var ActionGroup=function(_React$Component){_inherits(ActionGroup,_React$Component);var _super=_createSuper(ActionGroup);function ActionGroup(){var _this;_classCallCheck(this,ActionGroup);for(var _len=arguments.length,args=new Array(_len),_key=0;_key<_len;_key++){args[_key]=arguments[_key];}_this=_super.call.apply(_super,[this].concat(args));_this._renderRowSeparator=function(key){return React.createElement(View,{key:"separator-"+key,style:[styles.rowSeparator,_this.props.separatorStyle],__source:{fileName:_jsxFileName,lineNumber:82,columnNumber:7}});};_this._renderTitleContent=function(){var _this$props=_this.props,title=_this$props.title,titleTextStyle=_this$props.titleTextStyle,message=_this$props.message,messageTextStyle=_this$props.messageTextStyle,showSeparators=_this$props.showSeparators;if(!title&&!message){return null;}return React.createElement(View,{__source:{fileName:_jsxFileName,lineNumber:94,columnNumber:7}},React.createElement(View,{style:[styles.titleContainer,{paddingBottom:showSeparators?24:16}],__source:{fileName:_jsxFileName,lineNumber:95,columnNumber:9}},!!title&&React.createElement(Text,{style:[styles.title,titleTextStyle],__source:{fileName:_jsxFileName,lineNumber:96,columnNumber:23}},title),!!message&&React.createElement(Text,{style:[styles.message,messageTextStyle],__source:{fileName:_jsxFileName,lineNumber:97,columnNumber:25}},message)),!!showSeparators&&_this._renderRowSeparator('title'));};_this._renderIconElement=function(iconSource,color){var tintIcons=_this.props.tintIcons;if(!iconSource){return null;}if(typeof iconSource==='number'){var iconStyle=[styles.icon,{tintColor:tintIcons?color:undefined}];return React.createElement(Image,{fadeDuration:0,source:iconSource,resizeMode:"contain",style:iconStyle,__source:{fileName:_jsxFileName,lineNumber:112,columnNumber:14}});}else{return React.createElement(View,{style:styles.icon,__source:{fileName:_jsxFileName,lineNumber:114,columnNumber:14}},iconSource);}};_this._renderOptionViews=function(){var _this$props2=_this.props,options=_this$props2.options,icons=_this$props2.icons,cancelButtonIndex=_this$props2.cancelButtonIndex,cancelButtonTintColor=_this$props2.cancelButtonTintColor,destructiveButtonIndex=_this$props2.destructiveButtonIndex,disabledButtonIndices=_this$props2.disabledButtonIndices,_this$props2$destruct=_this$props2.destructiveColor,destructiveColor=_this$props2$destruct===void 0?DESTRUCTIVE_COLOR:_this$props2$destruct,onSelect=_this$props2.onSelect,startIndex=_this$props2.startIndex,length=_this$props2.length,textStyle=_this$props2.textStyle,tintColor=_this$props2.tintColor,autoFocus=_this$props2.autoFocus,showSeparators=_this$props2.showSeparators;var optionViews=[];var nativeFeedbackBackground=TouchableNativeFeedbackSafe.Ripple('rgba(180, 180, 180, 1)',false);var _loop=function _loop(_i){var defaultColor=tintColor?tintColor:(textStyle||{}).color||BLACK_87PC_TRANSPARENT;var disabled=isIndexDisabled(_i,disabledButtonIndices);var isCancelButton=_i===cancelButtonIndex;var color=isIndexDestructive(_i,destructiveButtonIndex)?destructiveColor:isCancelButton?cancelButtonTintColor||defaultColor:defaultColor;var iconSource=icons!=null?icons[_i]:null;optionViews.push(React.createElement(TouchableNativeFeedbackSafe,{ref:autoFocus&&_i===0?focusViewOnRender:undefined,key:_i,pressInDelay:0,background:nativeFeedbackBackground,disabled:disabled,onPress:function onPress(){return onSelect(_i);},style:[styles.button,disabled&&styles.disabledButton],accessibilityRole:"button",accessibilityLabel:options[_i],__source:{fileName:_jsxFileName,lineNumber:155,columnNumber:9}},_this._renderIconElement(iconSource,color),React.createElement(Text,{style:[styles.text,textStyle,{color:color}],__source:{fileName:_jsxFileName,lineNumber:166,columnNumber:11}},options[_i])));if(showSeparators&&_i<startIndex+length-1){optionViews.push(_this._renderRowSeparator(_i));}};for(var _i=startIndex;_i<startIndex+length;_i++){_loop(_i);}return optionViews;};return _this;}_createClass(ActionGroup,[{key:"render",value:function render(){return React.createElement(View,{style:[styles.groupContainer,this.props.containerStyle],__source:{fileName:_jsxFileName,lineNumber:73,columnNumber:7}},this._renderTitleContent(),React.createElement(ScrollView,{__source:{fileName:_jsxFileName,lineNumber:75,columnNumber:9}},this._renderOptionViews()));}}]);return ActionGroup;}(React.Component);ActionGroup.defaultProps={title:null,message:null,showSeparators:false,tintIcons:true,textStyle:{}};export{ActionGroup as default};var styles=StyleSheet.create({button:{justifyContent:'flex-start',alignItems:'center',flexDirection:'row',height:56,paddingHorizontal:16},disabledButton:{opacity:0.5},groupContainer:{backgroundColor:'#ffffff',overflow:'hidden'},icon:{width:24,height:24,marginRight:32,justifyContent:'center'},message:{marginTop:12,fontSize:14,color:BLACK_54PC_TRANSPARENT,textAlignVertical:'center'},rowSeparator:{backgroundColor:'#dddddd',height:1,width:'100%'},text:{fontSize:16,color:BLACK_87PC_TRANSPARENT,textAlignVertical:'center'},title:{fontSize:16,color:BLACK_54PC_TRANSPARENT,textAlignVertical:'center'},titleContainer:{alignItems:'flex-start',padding:16,paddingTop:24}}); | ||
//# sourceMappingURL=ActionGroup.js.map |
@@ -1,2 +0,2 @@ | ||
import _classCallCheck from"@babel/runtime/helpers/classCallCheck";import _createClass from"@babel/runtime/helpers/createClass";import _assertThisInitialized from"@babel/runtime/helpers/assertThisInitialized";import _inherits from"@babel/runtime/helpers/inherits";import _possibleConstructorReturn from"@babel/runtime/helpers/possibleConstructorReturn";import _getPrototypeOf from"@babel/runtime/helpers/getPrototypeOf";var _jsxFileName="/Users/bradley/Code/expo/react-native-action-sheet/src/ActionSheet/CustomActionSheet.tsx";function _createSuper(Derived){var hasNativeReflectConstruct=_isNativeReflectConstruct();return function _createSuperInternal(){var Super=_getPrototypeOf(Derived),result;if(hasNativeReflectConstruct){var NewTarget=_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget);}else{result=Super.apply(this,arguments);}return _possibleConstructorReturn(this,result);};}function _isNativeReflectConstruct(){if(typeof Reflect==="undefined"||!Reflect.construct)return false;if(Reflect.construct.sham)return false;if(typeof Proxy==="function")return true;try{Date.prototype.toString.call(Reflect.construct(Date,[],function(){}));return true;}catch(e){return false;}}import*as React from'react';import{Animated,BackHandler,Easing,Modal,Platform,StyleSheet,TouchableWithoutFeedback,View}from'react-native';import ActionGroup from'./ActionGroup';var OPACITY_ANIMATION_IN_TIME=225;var OPACITY_ANIMATION_OUT_TIME=195;var EASING_OUT=Easing.bezier(0.25,0.46,0.45,0.94);var EASING_IN=Easing.out(EASING_OUT);var ESCAPE_KEY='Escape';var CustomActionSheet=function(_React$Component){_inherits(CustomActionSheet,_React$Component);var _super=_createSuper(CustomActionSheet);function CustomActionSheet(){var _this;_classCallCheck(this,CustomActionSheet);for(var _len=arguments.length,args=new Array(_len),_key=0;_key<_len;_key++){args[_key]=arguments[_key];}_this=_super.call.apply(_super,[this].concat(args));_this._actionSheetHeight=360;_this.state={isVisible:false,isAnimating:false,options:null,onSelect:null,overlayOpacity:new Animated.Value(0),sheetOpacity:new Animated.Value(0)};_this._deferAfterAnimation=undefined;_this._handleWebKeyDown=function(event){if(event.key===ESCAPE_KEY&&_this.state.isVisible){event.preventDefault();_this._selectCancelButton();}};_this._setActionSheetHeight=function(_ref){var nativeEvent=_ref.nativeEvent;return _this._actionSheetHeight=nativeEvent.layout.height;};_this.showActionSheetWithOptions=function(options,onSelect){var _this$state=_this.state,isVisible=_this$state.isVisible,overlayOpacity=_this$state.overlayOpacity,sheetOpacity=_this$state.sheetOpacity;var _this$props$useNative=_this.props.useNativeDriver,useNativeDriver=_this$props$useNative===void 0?true:_this$props$useNative;if(isVisible){_this._deferAfterAnimation=_this.showActionSheetWithOptions.bind(_assertThisInitialized(_this),options,onSelect);return;}_this.setState({options:options,onSelect:onSelect,isVisible:true,isAnimating:true});overlayOpacity.setValue(0);sheetOpacity.setValue(0);Animated.parallel([Animated.timing(overlayOpacity,{toValue:0.32,easing:EASING_OUT,duration:OPACITY_ANIMATION_IN_TIME,useNativeDriver:useNativeDriver}),Animated.timing(sheetOpacity,{toValue:1,easing:EASING_OUT,duration:OPACITY_ANIMATION_IN_TIME,useNativeDriver:useNativeDriver})]).start(function(result){if(result.finished){_this.setState({isAnimating:false});_this._deferAfterAnimation=undefined;}});BackHandler.addEventListener('actionSheetHardwareBackPress',_this._selectCancelButton);};_this._selectCancelButton=function(){var options=_this.state.options;if(!options){return false;}if(typeof options.cancelButtonIndex==='undefined'){return false;}else if(typeof options.cancelButtonIndex==='number'){return _this._onSelect(options.cancelButtonIndex);}else{return _this._animateOut();}};_this._onSelect=function(index){var _this$state2=_this.state,isAnimating=_this$state2.isAnimating,onSelect=_this$state2.onSelect;if(isAnimating){return false;}if(onSelect){_this._deferAfterAnimation=onSelect.bind(_assertThisInitialized(_this),index);}return _this._animateOut();};_this._animateOut=function(){var _this$state3=_this.state,isAnimating=_this$state3.isAnimating,overlayOpacity=_this$state3.overlayOpacity,sheetOpacity=_this$state3.sheetOpacity;var _this$props$useNative2=_this.props.useNativeDriver,useNativeDriver=_this$props$useNative2===void 0?true:_this$props$useNative2;if(isAnimating){return false;}BackHandler.removeEventListener('actionSheetHardwareBackPress',_this._selectCancelButton);_this.setState({isAnimating:true});Animated.parallel([Animated.timing(overlayOpacity,{toValue:0,easing:EASING_IN,duration:OPACITY_ANIMATION_OUT_TIME,useNativeDriver:useNativeDriver}),Animated.timing(sheetOpacity,{toValue:0,easing:EASING_IN,duration:OPACITY_ANIMATION_OUT_TIME,useNativeDriver:useNativeDriver})]).start(function(result){if(result.finished){_this.setState({isVisible:false,isAnimating:false});if(_this._deferAfterAnimation){_this._deferAfterAnimation();}}});return true;};return _this;}_createClass(CustomActionSheet,[{key:"componentDidMount",value:function componentDidMount(){if(Platform.OS==='web'){document.addEventListener('keydown',this._handleWebKeyDown);}}},{key:"componentWillUnmount",value:function componentWillUnmount(){if(Platform.OS==='web'){document.removeEventListener('keydown',this._handleWebKeyDown);}}},{key:"render",value:function render(){var _this$state4=this.state,isVisible=_this$state4.isVisible,overlayOpacity=_this$state4.overlayOpacity,options=_this$state4.options;var useModal=options?options.autoFocus||options.useModal===true:false;var overlay=isVisible?React.createElement(Animated.View,{style:[styles.overlay,{opacity:overlayOpacity}],__source:{fileName:_jsxFileName,lineNumber:79,columnNumber:7}}):null;var appContent=React.createElement(View,{style:styles.flexContainer,importantForAccessibility:isVisible?'no-hide-descendants':'auto',__source:{fileName:_jsxFileName,lineNumber:91,columnNumber:7}},React.Children.only(this.props.children));return React.createElement(View,{pointerEvents:this.props.pointerEvents,style:styles.flexContainer,__source:{fileName:_jsxFileName,lineNumber:99,columnNumber:7}},appContent,isVisible&&!useModal&&React.createElement(React.Fragment,null,overlay,this._renderSheet()),isVisible&&useModal&&React.createElement(Modal,{animationType:"none",transparent:true,onRequestClose:this._selectCancelButton,__source:{fileName:_jsxFileName,lineNumber:108,columnNumber:11}},overlay,this._renderSheet()));}},{key:"_renderSheet",value:function _renderSheet(){var _this$state5=this.state,options=_this$state5.options,isAnimating=_this$state5.isAnimating,sheetOpacity=_this$state5.sheetOpacity;if(!options){return null;}var optionsArray=options.options,icons=options.icons,tintIcons=options.tintIcons,destructiveButtonIndex=options.destructiveButtonIndex,disabledButtonIndices=options.disabledButtonIndices,destructiveColor=options.destructiveColor,textStyle=options.textStyle,tintColor=options.tintColor,title=options.title,titleTextStyle=options.titleTextStyle,message=options.message,messageTextStyle=options.messageTextStyle,autoFocus=options.autoFocus,showSeparators=options.showSeparators,containerStyle=options.containerStyle,separatorStyle=options.separatorStyle,cancelButtonIndex=options.cancelButtonIndex,cancelButtonTintColor=options.cancelButtonTintColor;return React.createElement(TouchableWithoutFeedback,{importantForAccessibility:"yes",onPress:this._selectCancelButton,__source:{fileName:_jsxFileName,lineNumber:145,columnNumber:7}},React.createElement(Animated.View,{needsOffscreenAlphaCompositing:isAnimating,style:[styles.sheetContainer,{opacity:sheetOpacity,transform:[{translateY:sheetOpacity.interpolate({inputRange:[0,1],outputRange:[this._actionSheetHeight,0]})}]}],__source:{fileName:_jsxFileName,lineNumber:146,columnNumber:9}},React.createElement(View,{style:styles.sheet,onLayout:this._setActionSheetHeight,__source:{fileName:_jsxFileName,lineNumber:162,columnNumber:11}},React.createElement(ActionGroup,{options:optionsArray,icons:icons,tintIcons:tintIcons===undefined?true:tintIcons,cancelButtonIndex:cancelButtonIndex,cancelButtonTintColor:cancelButtonTintColor,destructiveButtonIndex:destructiveButtonIndex,destructiveColor:destructiveColor,disabledButtonIndices:disabledButtonIndices,onSelect:this._onSelect,startIndex:0,length:optionsArray.length,textStyle:textStyle||{},tintColor:tintColor,title:title||undefined,titleTextStyle:titleTextStyle,message:message||undefined,messageTextStyle:messageTextStyle,autoFocus:autoFocus,showSeparators:showSeparators,containerStyle:containerStyle,separatorStyle:separatorStyle,__source:{fileName:_jsxFileName,lineNumber:163,columnNumber:13}}))));}}]);return CustomActionSheet;}(React.Component);export{CustomActionSheet as default};var styles=StyleSheet.create({flexContainer:{flex:1},overlay:{position:'absolute',top:0,right:0,bottom:0,left:0,backgroundColor:'black'},sheetContainer:{position:'absolute',left:0,right:0,bottom:0,top:0,backgroundColor:'transparent',alignItems:'flex-end',justifyContent:'center',flexDirection:'row'},sheet:{flex:1,backgroundColor:'transparent'}}); | ||
import _classCallCheck from"@babel/runtime/helpers/classCallCheck";import _createClass from"@babel/runtime/helpers/createClass";import _assertThisInitialized from"@babel/runtime/helpers/assertThisInitialized";import _inherits from"@babel/runtime/helpers/inherits";import _possibleConstructorReturn from"@babel/runtime/helpers/possibleConstructorReturn";import _getPrototypeOf from"@babel/runtime/helpers/getPrototypeOf";var _jsxFileName="/home/runner/work/react-native-action-sheet/react-native-action-sheet/src/ActionSheet/CustomActionSheet.tsx";function _createSuper(Derived){var hasNativeReflectConstruct=_isNativeReflectConstruct();return function _createSuperInternal(){var Super=_getPrototypeOf(Derived),result;if(hasNativeReflectConstruct){var NewTarget=_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget);}else{result=Super.apply(this,arguments);}return _possibleConstructorReturn(this,result);};}function _isNativeReflectConstruct(){if(typeof Reflect==="undefined"||!Reflect.construct)return false;if(Reflect.construct.sham)return false;if(typeof Proxy==="function")return true;try{Date.prototype.toString.call(Reflect.construct(Date,[],function(){}));return true;}catch(e){return false;}}import*as React from'react';import{Animated,BackHandler,Easing,Modal,Platform,StyleSheet,TouchableWithoutFeedback,View}from'react-native';import ActionGroup from'./ActionGroup';var OPACITY_ANIMATION_IN_TIME=225;var OPACITY_ANIMATION_OUT_TIME=195;var EASING_OUT=Easing.bezier(0.25,0.46,0.45,0.94);var EASING_IN=Easing.out(EASING_OUT);var ESCAPE_KEY='Escape';var CustomActionSheet=function(_React$Component){_inherits(CustomActionSheet,_React$Component);var _super=_createSuper(CustomActionSheet);function CustomActionSheet(){var _this;_classCallCheck(this,CustomActionSheet);for(var _len=arguments.length,args=new Array(_len),_key=0;_key<_len;_key++){args[_key]=arguments[_key];}_this=_super.call.apply(_super,[this].concat(args));_this._actionSheetHeight=360;_this.state={isVisible:false,isAnimating:false,options:null,onSelect:null,overlayOpacity:new Animated.Value(0),sheetOpacity:new Animated.Value(0)};_this._deferAfterAnimation=undefined;_this._handleWebKeyDown=function(event){if(event.key===ESCAPE_KEY&&_this.state.isVisible){event.preventDefault();_this._selectCancelButton();}};_this._setActionSheetHeight=function(_ref){var nativeEvent=_ref.nativeEvent;return _this._actionSheetHeight=nativeEvent.layout.height;};_this.showActionSheetWithOptions=function(options,onSelect){var _this$state=_this.state,isVisible=_this$state.isVisible,overlayOpacity=_this$state.overlayOpacity,sheetOpacity=_this$state.sheetOpacity;var _this$props$useNative=_this.props.useNativeDriver,useNativeDriver=_this$props$useNative===void 0?true:_this$props$useNative;if(isVisible){_this._deferAfterAnimation=_this.showActionSheetWithOptions.bind(_assertThisInitialized(_this),options,onSelect);return;}_this.setState({options:options,onSelect:onSelect,isVisible:true,isAnimating:true});overlayOpacity.setValue(0);sheetOpacity.setValue(0);Animated.parallel([Animated.timing(overlayOpacity,{toValue:0.32,easing:EASING_OUT,duration:OPACITY_ANIMATION_IN_TIME,useNativeDriver:useNativeDriver}),Animated.timing(sheetOpacity,{toValue:1,easing:EASING_OUT,duration:OPACITY_ANIMATION_IN_TIME,useNativeDriver:useNativeDriver})]).start(function(result){if(result.finished){_this.setState({isAnimating:false});_this._deferAfterAnimation=undefined;}});BackHandler.addEventListener('actionSheetHardwareBackPress',_this._selectCancelButton);};_this._selectCancelButton=function(){var options=_this.state.options;if(!options){return false;}if(typeof options.cancelButtonIndex==='undefined'){return false;}else if(typeof options.cancelButtonIndex==='number'){return _this._onSelect(options.cancelButtonIndex);}else{return _this._animateOut();}};_this._onSelect=function(index){var _this$state2=_this.state,isAnimating=_this$state2.isAnimating,onSelect=_this$state2.onSelect;if(isAnimating){return false;}if(onSelect){_this._deferAfterAnimation=onSelect.bind(_assertThisInitialized(_this),index);}return _this._animateOut();};_this._animateOut=function(){var _this$state3=_this.state,isAnimating=_this$state3.isAnimating,overlayOpacity=_this$state3.overlayOpacity,sheetOpacity=_this$state3.sheetOpacity;var _this$props$useNative2=_this.props.useNativeDriver,useNativeDriver=_this$props$useNative2===void 0?true:_this$props$useNative2;if(isAnimating){return false;}BackHandler.removeEventListener('actionSheetHardwareBackPress',_this._selectCancelButton);_this.setState({isAnimating:true});Animated.parallel([Animated.timing(overlayOpacity,{toValue:0,easing:EASING_IN,duration:OPACITY_ANIMATION_OUT_TIME,useNativeDriver:useNativeDriver}),Animated.timing(sheetOpacity,{toValue:0,easing:EASING_IN,duration:OPACITY_ANIMATION_OUT_TIME,useNativeDriver:useNativeDriver})]).start(function(result){if(result.finished){_this.setState({isVisible:false,isAnimating:false});if(_this._deferAfterAnimation){_this._deferAfterAnimation();}}});return true;};return _this;}_createClass(CustomActionSheet,[{key:"componentDidMount",value:function componentDidMount(){if(Platform.OS==='web'){document.addEventListener('keydown',this._handleWebKeyDown);}}},{key:"componentWillUnmount",value:function componentWillUnmount(){if(Platform.OS==='web'){document.removeEventListener('keydown',this._handleWebKeyDown);}}},{key:"render",value:function render(){var _this$state4=this.state,isVisible=_this$state4.isVisible,overlayOpacity=_this$state4.overlayOpacity,options=_this$state4.options;var useModal=options?options.autoFocus||options.useModal===true:false;var overlay=isVisible?React.createElement(Animated.View,{style:[styles.overlay,{opacity:overlayOpacity}],__source:{fileName:_jsxFileName,lineNumber:79,columnNumber:7}}):null;var appContent=React.createElement(View,{style:styles.flexContainer,importantForAccessibility:isVisible?'no-hide-descendants':'auto',__source:{fileName:_jsxFileName,lineNumber:91,columnNumber:7}},React.Children.only(this.props.children));return React.createElement(View,{pointerEvents:this.props.pointerEvents,style:styles.flexContainer,__source:{fileName:_jsxFileName,lineNumber:99,columnNumber:7}},appContent,isVisible&&!useModal&&React.createElement(React.Fragment,null,overlay,this._renderSheet()),isVisible&&useModal&&React.createElement(Modal,{animationType:"none",transparent:true,onRequestClose:this._selectCancelButton,__source:{fileName:_jsxFileName,lineNumber:108,columnNumber:11}},overlay,this._renderSheet()));}},{key:"_renderSheet",value:function _renderSheet(){var _this$state5=this.state,options=_this$state5.options,isAnimating=_this$state5.isAnimating,sheetOpacity=_this$state5.sheetOpacity;if(!options){return null;}var optionsArray=options.options,icons=options.icons,tintIcons=options.tintIcons,destructiveButtonIndex=options.destructiveButtonIndex,disabledButtonIndices=options.disabledButtonIndices,destructiveColor=options.destructiveColor,textStyle=options.textStyle,tintColor=options.tintColor,title=options.title,titleTextStyle=options.titleTextStyle,message=options.message,messageTextStyle=options.messageTextStyle,autoFocus=options.autoFocus,showSeparators=options.showSeparators,containerStyle=options.containerStyle,separatorStyle=options.separatorStyle,cancelButtonIndex=options.cancelButtonIndex,cancelButtonTintColor=options.cancelButtonTintColor;return React.createElement(TouchableWithoutFeedback,{importantForAccessibility:"yes",onPress:this._selectCancelButton,__source:{fileName:_jsxFileName,lineNumber:145,columnNumber:7}},React.createElement(Animated.View,{needsOffscreenAlphaCompositing:isAnimating,style:[styles.sheetContainer,{opacity:sheetOpacity,transform:[{translateY:sheetOpacity.interpolate({inputRange:[0,1],outputRange:[this._actionSheetHeight,0]})}]}],__source:{fileName:_jsxFileName,lineNumber:146,columnNumber:9}},React.createElement(View,{style:styles.sheet,onLayout:this._setActionSheetHeight,__source:{fileName:_jsxFileName,lineNumber:162,columnNumber:11}},React.createElement(ActionGroup,{options:optionsArray,icons:icons,tintIcons:tintIcons===undefined?true:tintIcons,cancelButtonIndex:cancelButtonIndex,cancelButtonTintColor:cancelButtonTintColor,destructiveButtonIndex:destructiveButtonIndex,destructiveColor:destructiveColor,disabledButtonIndices:disabledButtonIndices,onSelect:this._onSelect,startIndex:0,length:optionsArray.length,textStyle:textStyle||{},tintColor:tintColor,title:title||undefined,titleTextStyle:titleTextStyle,message:message||undefined,messageTextStyle:messageTextStyle,autoFocus:autoFocus,showSeparators:showSeparators,containerStyle:containerStyle,separatorStyle:separatorStyle,__source:{fileName:_jsxFileName,lineNumber:163,columnNumber:13}}))));}}]);return CustomActionSheet;}(React.Component);export{CustomActionSheet as default};var styles=StyleSheet.create({flexContainer:{flex:1},overlay:{position:'absolute',top:0,right:0,bottom:0,left:0,backgroundColor:'black'},sheetContainer:{position:'absolute',left:0,right:0,bottom:0,top:0,backgroundColor:'transparent',alignItems:'flex-end',justifyContent:'center',flexDirection:'row'},sheet:{flex:1,backgroundColor:'transparent'}}); | ||
//# sourceMappingURL=CustomActionSheet.js.map |
@@ -1,2 +0,2 @@ | ||
import _classCallCheck from"@babel/runtime/helpers/classCallCheck";import _createClass from"@babel/runtime/helpers/createClass";import _inherits from"@babel/runtime/helpers/inherits";import _possibleConstructorReturn from"@babel/runtime/helpers/possibleConstructorReturn";import _getPrototypeOf from"@babel/runtime/helpers/getPrototypeOf";var _jsxFileName="/Users/bradley/Code/expo/react-native-action-sheet/src/ActionSheet/index.ios.tsx";function _createSuper(Derived){var hasNativeReflectConstruct=_isNativeReflectConstruct();return function _createSuperInternal(){var Super=_getPrototypeOf(Derived),result;if(hasNativeReflectConstruct){var NewTarget=_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget);}else{result=Super.apply(this,arguments);}return _possibleConstructorReturn(this,result);};}function _isNativeReflectConstruct(){if(typeof Reflect==="undefined"||!Reflect.construct)return false;if(Reflect.construct.sham)return false;if(typeof Proxy==="function")return true;try{Date.prototype.toString.call(Reflect.construct(Date,[],function(){}));return true;}catch(e){return false;}}import*as React from'react';import{ActionSheetIOS,View}from'react-native';var ActionSheet=function(_React$Component){_inherits(ActionSheet,_React$Component);var _super=_createSuper(ActionSheet);function ActionSheet(){_classCallCheck(this,ActionSheet);return _super.apply(this,arguments);}_createClass(ActionSheet,[{key:"render",value:function render(){return React.createElement(View,{pointerEvents:this.props.pointerEvents,style:{flex:1},__source:{fileName:_jsxFileName,lineNumber:16,columnNumber:7}},React.Children.only(this.props.children));}},{key:"showActionSheetWithOptions",value:function showActionSheetWithOptions(dataOptions,onSelect){var cancelButtonIndex=dataOptions.cancelButtonIndex,destructiveButtonIndex=dataOptions.destructiveButtonIndex,options=dataOptions.options,tintColor=dataOptions.tintColor,cancelButtonTintColor=dataOptions.cancelButtonTintColor,disabledButtonIndices=dataOptions.disabledButtonIndices;var iosOptions={cancelButtonIndex:cancelButtonIndex,destructiveButtonIndex:destructiveButtonIndex,options:options,tintColor:tintColor,cancelButtonTintColor:cancelButtonTintColor,disabledButtonIndices:disabledButtonIndices,title:dataOptions.title||undefined,message:dataOptions.message||undefined,anchor:dataOptions.anchor||undefined,userInterfaceStyle:dataOptions.userInterfaceStyle||undefined};ActionSheetIOS.showActionSheetWithOptions(iosOptions,onSelect);}}]);return ActionSheet;}(React.Component);export{ActionSheet as default}; | ||
import _classCallCheck from"@babel/runtime/helpers/classCallCheck";import _createClass from"@babel/runtime/helpers/createClass";import _inherits from"@babel/runtime/helpers/inherits";import _possibleConstructorReturn from"@babel/runtime/helpers/possibleConstructorReturn";import _getPrototypeOf from"@babel/runtime/helpers/getPrototypeOf";var _jsxFileName="/home/runner/work/react-native-action-sheet/react-native-action-sheet/src/ActionSheet/index.ios.tsx";function _createSuper(Derived){var hasNativeReflectConstruct=_isNativeReflectConstruct();return function _createSuperInternal(){var Super=_getPrototypeOf(Derived),result;if(hasNativeReflectConstruct){var NewTarget=_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget);}else{result=Super.apply(this,arguments);}return _possibleConstructorReturn(this,result);};}function _isNativeReflectConstruct(){if(typeof Reflect==="undefined"||!Reflect.construct)return false;if(Reflect.construct.sham)return false;if(typeof Proxy==="function")return true;try{Date.prototype.toString.call(Reflect.construct(Date,[],function(){}));return true;}catch(e){return false;}}import*as React from'react';import{ActionSheetIOS,View}from'react-native';var ActionSheet=function(_React$Component){_inherits(ActionSheet,_React$Component);var _super=_createSuper(ActionSheet);function ActionSheet(){_classCallCheck(this,ActionSheet);return _super.apply(this,arguments);}_createClass(ActionSheet,[{key:"render",value:function render(){return React.createElement(View,{pointerEvents:this.props.pointerEvents,style:{flex:1},__source:{fileName:_jsxFileName,lineNumber:16,columnNumber:7}},React.Children.only(this.props.children));}},{key:"showActionSheetWithOptions",value:function showActionSheetWithOptions(dataOptions,onSelect){var cancelButtonIndex=dataOptions.cancelButtonIndex,destructiveButtonIndex=dataOptions.destructiveButtonIndex,options=dataOptions.options,tintColor=dataOptions.tintColor,cancelButtonTintColor=dataOptions.cancelButtonTintColor,disabledButtonIndices=dataOptions.disabledButtonIndices;var iosOptions={cancelButtonIndex:cancelButtonIndex,destructiveButtonIndex:destructiveButtonIndex,options:options,tintColor:tintColor,cancelButtonTintColor:cancelButtonTintColor,disabledButtonIndices:disabledButtonIndices,title:dataOptions.title||undefined,message:dataOptions.message||undefined,anchor:dataOptions.anchor||undefined,userInterfaceStyle:dataOptions.userInterfaceStyle||undefined};ActionSheetIOS.showActionSheetWithOptions(iosOptions,onSelect);}}]);return ActionSheet;}(React.Component);export{ActionSheet as default}; | ||
//# sourceMappingURL=index.ios.js.map |
@@ -1,2 +0,2 @@ | ||
import _extends from"@babel/runtime/helpers/extends";import _classCallCheck from"@babel/runtime/helpers/classCallCheck";import _createClass from"@babel/runtime/helpers/createClass";import _inherits from"@babel/runtime/helpers/inherits";import _possibleConstructorReturn from"@babel/runtime/helpers/possibleConstructorReturn";import _getPrototypeOf from"@babel/runtime/helpers/getPrototypeOf";var _jsxFileName="/Users/bradley/Code/expo/react-native-action-sheet/src/ActionSheet/TouchableNativeFeedbackSafe.tsx";function _createSuper(Derived){var hasNativeReflectConstruct=_isNativeReflectConstruct();return function _createSuperInternal(){var Super=_getPrototypeOf(Derived),result;if(hasNativeReflectConstruct){var NewTarget=_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget);}else{result=Super.apply(this,arguments);}return _possibleConstructorReturn(this,result);};}function _isNativeReflectConstruct(){if(typeof Reflect==="undefined"||!Reflect.construct)return false;if(Reflect.construct.sham)return false;if(typeof Proxy==="function")return true;try{Date.prototype.toString.call(Reflect.construct(Date,[],function(){}));return true;}catch(e){return false;}}import*as React from'react';import{Platform,TouchableNativeFeedback,TouchableOpacity,View}from'react-native';var CustomTouchableOpacity=function(_React$Component){_inherits(CustomTouchableOpacity,_React$Component);var _super=_createSuper(CustomTouchableOpacity);function CustomTouchableOpacity(){_classCallCheck(this,CustomTouchableOpacity);return _super.apply(this,arguments);}_createClass(CustomTouchableOpacity,[{key:"render",value:function render(){return React.createElement(TouchableOpacity,_extends({},this.props,{__source:{fileName:_jsxFileName,lineNumber:17,columnNumber:12}}),this.props.children);}}]);return CustomTouchableOpacity;}(React.Component);CustomTouchableOpacity.SelectableBackground=function(){return{};};CustomTouchableOpacity.SelectableBackgroundBorderless=function(){return{};};CustomTouchableOpacity.Ripple=function(color,borderless){return{};};var TouchableComponent=Platform.select({web:CustomTouchableOpacity,default:Platform.Version<=20?CustomTouchableOpacity:TouchableNativeFeedback});var TouchableNativeFeedbackSafe=function(_React$Component2){_inherits(TouchableNativeFeedbackSafe,_React$Component2);var _super2=_createSuper(TouchableNativeFeedbackSafe);function TouchableNativeFeedbackSafe(){_classCallCheck(this,TouchableNativeFeedbackSafe);return _super2.apply(this,arguments);}_createClass(TouchableNativeFeedbackSafe,[{key:"render",value:function render(){if(TouchableComponent===TouchableNativeFeedback){return React.createElement(TouchableComponent,_extends({},this.props,{style:{},__source:{fileName:_jsxFileName,lineNumber:39,columnNumber:9}}),React.createElement(View,{style:this.props.style,__source:{fileName:_jsxFileName,lineNumber:40,columnNumber:11}},this.props.children));}return React.createElement(TouchableComponent,_extends({},this.props,{__source:{fileName:_jsxFileName,lineNumber:46,columnNumber:12}}),this.props.children);}}]);return TouchableNativeFeedbackSafe;}(React.Component);TouchableNativeFeedbackSafe.SelectableBackground=TouchableComponent.SelectableBackground;TouchableNativeFeedbackSafe.SelectableBackgroundBorderless=TouchableComponent.SelectableBackgroundBorderless;TouchableNativeFeedbackSafe.Ripple=TouchableComponent.Ripple;export{TouchableNativeFeedbackSafe as default}; | ||
import _extends from"@babel/runtime/helpers/extends";import _classCallCheck from"@babel/runtime/helpers/classCallCheck";import _createClass from"@babel/runtime/helpers/createClass";import _inherits from"@babel/runtime/helpers/inherits";import _possibleConstructorReturn from"@babel/runtime/helpers/possibleConstructorReturn";import _getPrototypeOf from"@babel/runtime/helpers/getPrototypeOf";var _jsxFileName="/home/runner/work/react-native-action-sheet/react-native-action-sheet/src/ActionSheet/TouchableNativeFeedbackSafe.tsx";function _createSuper(Derived){var hasNativeReflectConstruct=_isNativeReflectConstruct();return function _createSuperInternal(){var Super=_getPrototypeOf(Derived),result;if(hasNativeReflectConstruct){var NewTarget=_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget);}else{result=Super.apply(this,arguments);}return _possibleConstructorReturn(this,result);};}function _isNativeReflectConstruct(){if(typeof Reflect==="undefined"||!Reflect.construct)return false;if(Reflect.construct.sham)return false;if(typeof Proxy==="function")return true;try{Date.prototype.toString.call(Reflect.construct(Date,[],function(){}));return true;}catch(e){return false;}}import*as React from'react';import{Platform,TouchableNativeFeedback,TouchableOpacity,View}from'react-native';var CustomTouchableOpacity=function(_React$Component){_inherits(CustomTouchableOpacity,_React$Component);var _super=_createSuper(CustomTouchableOpacity);function CustomTouchableOpacity(){_classCallCheck(this,CustomTouchableOpacity);return _super.apply(this,arguments);}_createClass(CustomTouchableOpacity,[{key:"render",value:function render(){return React.createElement(TouchableOpacity,_extends({},this.props,{__source:{fileName:_jsxFileName,lineNumber:17,columnNumber:12}}),this.props.children);}}]);return CustomTouchableOpacity;}(React.Component);CustomTouchableOpacity.SelectableBackground=function(){return{};};CustomTouchableOpacity.SelectableBackgroundBorderless=function(){return{};};CustomTouchableOpacity.Ripple=function(color,borderless){return{};};var TouchableComponent=Platform.select({web:CustomTouchableOpacity,default:Platform.Version<=20?CustomTouchableOpacity:TouchableNativeFeedback});var TouchableNativeFeedbackSafe=function(_React$Component2){_inherits(TouchableNativeFeedbackSafe,_React$Component2);var _super2=_createSuper(TouchableNativeFeedbackSafe);function TouchableNativeFeedbackSafe(){_classCallCheck(this,TouchableNativeFeedbackSafe);return _super2.apply(this,arguments);}_createClass(TouchableNativeFeedbackSafe,[{key:"render",value:function render(){if(TouchableComponent===TouchableNativeFeedback){return React.createElement(TouchableComponent,_extends({},this.props,{style:{},__source:{fileName:_jsxFileName,lineNumber:39,columnNumber:9}}),React.createElement(View,{style:this.props.style,__source:{fileName:_jsxFileName,lineNumber:40,columnNumber:11}},this.props.children));}return React.createElement(TouchableComponent,_extends({},this.props,{__source:{fileName:_jsxFileName,lineNumber:46,columnNumber:12}}),this.props.children);}}]);return TouchableNativeFeedbackSafe;}(React.Component);TouchableNativeFeedbackSafe.SelectableBackground=TouchableComponent.SelectableBackground;TouchableNativeFeedbackSafe.SelectableBackgroundBorderless=TouchableComponent.SelectableBackgroundBorderless;TouchableNativeFeedbackSafe.Ripple=TouchableComponent.Ripple;export{TouchableNativeFeedbackSafe as default}; | ||
//# sourceMappingURL=TouchableNativeFeedbackSafe.js.map |
@@ -1,2 +0,2 @@ | ||
var _jsxFileName="/Users/bradley/Code/expo/react-native-action-sheet/src/ActionSheetProvider.tsx";import*as React from'react';import NativeActionSheet from'./ActionSheet';import CustomActionSheet from'./ActionSheet/CustomActionSheet';import{Provider}from'./context';export default function ActionSheetProvider(_ref){var children=_ref.children,useNativeDriver=_ref.useNativeDriver,_ref$useCustomActionS=_ref.useCustomActionSheet,useCustomActionSheet=_ref$useCustomActionS===void 0?false:_ref$useCustomActionS;var actionSheetRef=React.useRef(null);var context=React.useMemo(function(){return{showActionSheetWithOptions:function showActionSheetWithOptions(options,callback){if(actionSheetRef.current){actionSheetRef.current.showActionSheetWithOptions(options,callback);}}};},[actionSheetRef]);var ActionSheet=React.useMemo(function(){return useCustomActionSheet?CustomActionSheet:NativeActionSheet;},[useCustomActionSheet]);return React.createElement(Provider,{value:context,__source:{fileName:_jsxFileName,lineNumber:39,columnNumber:5}},React.createElement(ActionSheet,{ref:actionSheetRef,useNativeDriver:useNativeDriver,__source:{fileName:_jsxFileName,lineNumber:40,columnNumber:7}},React.Children.only(children)));} | ||
var _jsxFileName="/home/runner/work/react-native-action-sheet/react-native-action-sheet/src/ActionSheetProvider.tsx";import*as React from'react';import NativeActionSheet from'./ActionSheet';import CustomActionSheet from'./ActionSheet/CustomActionSheet';import{Provider}from'./context';export default function ActionSheetProvider(_ref){var children=_ref.children,useNativeDriver=_ref.useNativeDriver,_ref$useCustomActionS=_ref.useCustomActionSheet,useCustomActionSheet=_ref$useCustomActionS===void 0?false:_ref$useCustomActionS;var actionSheetRef=React.useRef(null);var context=React.useMemo(function(){return{showActionSheetWithOptions:function showActionSheetWithOptions(options,callback){if(actionSheetRef.current){actionSheetRef.current.showActionSheetWithOptions(options,callback);}}};},[actionSheetRef]);var ActionSheet=React.useMemo(function(){return useCustomActionSheet?CustomActionSheet:NativeActionSheet;},[useCustomActionSheet]);return React.createElement(Provider,{value:context,__source:{fileName:_jsxFileName,lineNumber:39,columnNumber:5}},React.createElement(ActionSheet,{ref:actionSheetRef,useNativeDriver:useNativeDriver,__source:{fileName:_jsxFileName,lineNumber:40,columnNumber:7}},React.Children.only(children)));} | ||
//# sourceMappingURL=ActionSheetProvider.js.map |
@@ -1,2 +0,2 @@ | ||
import _extends from"@babel/runtime/helpers/extends";var _jsxFileName="/Users/bradley/Code/expo/react-native-action-sheet/src/connectActionSheet.tsx";import hoistNonReactStatic from'hoist-non-react-statics';import*as React from'react';import{Consumer}from'./context';export default function connectActionSheet(WrappedComponent){var ConnectedActionSheet=function ConnectedActionSheet(props){return React.createElement(Consumer,{__source:{fileName:_jsxFileName,lineNumber:12,columnNumber:7}},function(_ref){var showActionSheetWithOptions=_ref.showActionSheetWithOptions;return React.createElement(WrappedComponent,_extends({},props,{showActionSheetWithOptions:showActionSheetWithOptions,__source:{fileName:_jsxFileName,lineNumber:15,columnNumber:13}}));});};return hoistNonReactStatic(ConnectedActionSheet,WrappedComponent);} | ||
import _extends from"@babel/runtime/helpers/extends";var _jsxFileName="/home/runner/work/react-native-action-sheet/react-native-action-sheet/src/connectActionSheet.tsx";import hoistNonReactStatic from'hoist-non-react-statics';import*as React from'react';import{Consumer}from'./context';export default function connectActionSheet(WrappedComponent){var ConnectedActionSheet=function ConnectedActionSheet(props){return React.createElement(Consumer,{__source:{fileName:_jsxFileName,lineNumber:12,columnNumber:7}},function(_ref){var showActionSheetWithOptions=_ref.showActionSheetWithOptions;return React.createElement(WrappedComponent,_extends({},props,{showActionSheetWithOptions:showActionSheetWithOptions,__source:{fileName:_jsxFileName,lineNumber:15,columnNumber:13}}));});};return hoistNonReactStatic(ConnectedActionSheet,WrappedComponent);} | ||
//# sourceMappingURL=connectActionSheet.js.map |
{ | ||
"name": "@expo/react-native-action-sheet", | ||
"version": "4.0.0-rc.1", | ||
"version": "4.0.0", | ||
"description": "A cross-platform ActionSheet for React Native", | ||
@@ -5,0 +5,0 @@ "react-native": "lib/module/index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
165848
356
8
1