Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@expo/react-native-action-sheet

Package Overview
Dependencies
Maintainers
26
Versions
38
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@expo/react-native-action-sheet - npm Package Compare versions

Comparing version 3.9.0 to 3.10.0

5

CHANGELOG.md
# Changelog
# [3.10.0](https://github.com/expo/react-native-action-sheet/compare/v3.8.0...v3.10.0) (2021-08-09)
### Features
* Allow multiple destructive indices ([#210](https://github.com/expo/react-native-action-sheet/issues/210)) ([81112b9](https://github.com/expo/react-native-action-sheet/commit/81112b9553dc34725e2708b02b64b7a5e5c57509))
# [3.9.0](https://github.com/expo/react-native-action-sheet/compare/v3.8.0...v3.9.0) (2021-03-12)

@@ -4,0 +9,0 @@

2

lib/commonjs/ActionSheet/ActionGroup.js

@@ -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="/home/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 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:69,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:81,columnNumber:7}},React.createElement(_reactNative.View,{style:[styles.titleContainer,{paddingBottom:showSeparators?24:16}],__source:{fileName:_jsxFileName,lineNumber:82,columnNumber:9}},!!title&&React.createElement(_reactNative.Text,{style:[styles.title,titleTextStyle],__source:{fileName:_jsxFileName,lineNumber:83,columnNumber:23}},title),!!message&&React.createElement(_reactNative.Text,{style:[styles.message,messageTextStyle],__source:{fileName:_jsxFileName,lineNumber:84,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:99,columnNumber:14}});}else{return React.createElement(_reactNative.View,{style:styles.icon,__source:{fileName:_jsxFileName,lineNumber:101,columnNumber:14}},iconSource);}};_this._renderOptionViews=function(){var _this$props2=_this.props,options=_this$props2.options,icons=_this$props2.icons,destructiveButtonIndex=_this$props2.destructiveButtonIndex,_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 color=_i===destructiveButtonIndex?destructiveColor: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,onPress:function onPress(){return onSelect(_i);},style:styles.button,accessibilityRole:"button",accessibilityLabel:options[_i],__source:{fileName:_jsxFileName,lineNumber:133,columnNumber:9}},_this._renderIconElement(iconSource,color),React.createElement(_reactNative.Text,{style:[styles.text,textStyle,{color:color}],__source:{fileName:_jsxFileName,lineNumber:143,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:60,columnNumber:7}},this._renderTitleContent(),React.createElement(_reactNative.ScrollView,{__source:{fileName:_jsxFileName,lineNumber:62,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},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/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 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:77,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:89,columnNumber:7}},React.createElement(_reactNative.View,{style:[styles.titleContainer,{paddingBottom:showSeparators?24:16}],__source:{fileName:_jsxFileName,lineNumber:90,columnNumber:9}},!!title&&React.createElement(_reactNative.Text,{style:[styles.title,titleTextStyle],__source:{fileName:_jsxFileName,lineNumber:91,columnNumber:23}},title),!!message&&React.createElement(_reactNative.Text,{style:[styles.message,messageTextStyle],__source:{fileName:_jsxFileName,lineNumber:92,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:107,columnNumber:14}});}else{return React.createElement(_reactNative.View,{style:styles.icon,__source:{fileName:_jsxFileName,lineNumber:109,columnNumber:14}},iconSource);}};_this._renderOptionViews=function(){var _this$props2=_this.props,options=_this$props2.options,icons=_this$props2.icons,destructiveButtonIndex=_this$props2.destructiveButtonIndex,_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 color=isIndexDestructive(_i,destructiveButtonIndex)?destructiveColor: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,onPress:function onPress(){return onSelect(_i);},style:styles.button,accessibilityRole:"button",accessibilityLabel:options[_i],__source:{fileName:_jsxFileName,lineNumber:141,columnNumber:9}},_this._renderIconElement(iconSource,color),React.createElement(_reactNative.Text,{style:[styles.text,textStyle,{color:color}],__source:{fileName:_jsxFileName,lineNumber:151,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:68,columnNumber:7}},this._renderTitleContent(),React.createElement(_reactNative.ScrollView,{__source:{fileName:_jsxFileName,lineNumber:70,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},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 _inherits from"@babel/runtime/helpers/inherits";import _possibleConstructorReturn from"@babel/runtime/helpers/possibleConstructorReturn";import _getPrototypeOf from"@babel/runtime/helpers/getPrototypeOf";var _jsxFileName="/home/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{StyleSheet,Text,Image,View,ScrollView,findNodeHandle,AccessibilityInfo,Platform,UIManager}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 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:69,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:81,columnNumber:7}},React.createElement(View,{style:[styles.titleContainer,{paddingBottom:showSeparators?24:16}],__source:{fileName:_jsxFileName,lineNumber:82,columnNumber:9}},!!title&&React.createElement(Text,{style:[styles.title,titleTextStyle],__source:{fileName:_jsxFileName,lineNumber:83,columnNumber:23}},title),!!message&&React.createElement(Text,{style:[styles.message,messageTextStyle],__source:{fileName:_jsxFileName,lineNumber:84,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:99,columnNumber:14}});}else{return React.createElement(View,{style:styles.icon,__source:{fileName:_jsxFileName,lineNumber:101,columnNumber:14}},iconSource);}};_this._renderOptionViews=function(){var _this$props2=_this.props,options=_this$props2.options,icons=_this$props2.icons,destructiveButtonIndex=_this$props2.destructiveButtonIndex,_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 color=_i===destructiveButtonIndex?destructiveColor: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,onPress:function onPress(){return onSelect(_i);},style:styles.button,accessibilityRole:"button",accessibilityLabel:options[_i],__source:{fileName:_jsxFileName,lineNumber:133,columnNumber:9}},_this._renderIconElement(iconSource,color),React.createElement(Text,{style:[styles.text,textStyle,{color:color}],__source:{fileName:_jsxFileName,lineNumber:143,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:60,columnNumber:7}},this._renderTitleContent(),React.createElement(ScrollView,{__source:{fileName:_jsxFileName,lineNumber:62,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},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/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 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:77,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:89,columnNumber:7}},React.createElement(View,{style:[styles.titleContainer,{paddingBottom:showSeparators?24:16}],__source:{fileName:_jsxFileName,lineNumber:90,columnNumber:9}},!!title&&React.createElement(Text,{style:[styles.title,titleTextStyle],__source:{fileName:_jsxFileName,lineNumber:91,columnNumber:23}},title),!!message&&React.createElement(Text,{style:[styles.message,messageTextStyle],__source:{fileName:_jsxFileName,lineNumber:92,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:107,columnNumber:14}});}else{return React.createElement(View,{style:styles.icon,__source:{fileName:_jsxFileName,lineNumber:109,columnNumber:14}},iconSource);}};_this._renderOptionViews=function(){var _this$props2=_this.props,options=_this$props2.options,icons=_this$props2.icons,destructiveButtonIndex=_this$props2.destructiveButtonIndex,_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 color=isIndexDestructive(_i,destructiveButtonIndex)?destructiveColor: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,onPress:function onPress(){return onSelect(_i);},style:styles.button,accessibilityRole:"button",accessibilityLabel:options[_i],__source:{fileName:_jsxFileName,lineNumber:141,columnNumber:9}},_this._renderIconElement(iconSource,color),React.createElement(Text,{style:[styles.text,textStyle,{color:color}],__source:{fileName:_jsxFileName,lineNumber:151,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:68,columnNumber:7}},this._renderTitleContent(),React.createElement(ScrollView,{__source:{fileName:_jsxFileName,lineNumber:70,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},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

@@ -12,3 +12,3 @@ import * as React from 'react';

cancelButtonIndex?: number;
destructiveButtonIndex?: number;
destructiveButtonIndex?: number | number[];
anchor?: number;

@@ -15,0 +15,0 @@ userInterfaceStyle?: 'light' | 'dark';

{
"name": "@expo/react-native-action-sheet",
"version": "3.9.0",
"version": "3.10.0",
"description": "A cross-platform ActionSheet for React Native",

@@ -38,4 +38,4 @@ "react-native": "lib/module/index.js",

"@react-native-community/eslint-config": "^0.0.5",
"@semantic-release/changelog": "^3.0.5",
"@semantic-release/git": "^7.0.18",
"@semantic-release/changelog": "^5.0.1",
"@semantic-release/git": "^9.0.0",
"@types/react": "^16.8.23",

@@ -53,3 +53,3 @@ "@types/react-native": "^0.57.65",

"react-native": "https://github.com/expo/react-native/archive/sdk-33.0.0.tar.gz",
"semantic-release": "^17.3.0",
"semantic-release": "^17.4.4",
"typescript": "^3.5.3"

@@ -56,0 +56,0 @@ },

# react-native-action-sheet
[![npm](https://img.shields.io/npm/v/@expo/react-native-action-sheet.svg?style=flat-square)](https://www.npmjs.com/package/@expo/react-native-action-sheet)
[![License: MIT](https://img.shields.io/github/license/nd-02110114/goofi-mobile.svg)](https://opensource.org/licenses/MIT)
[![Slack](https://slack.expo.io/badge.svg)](https://slack.expo.io)
[![Discord](https://img.shields.io/badge/discord-expo-green?style=flat-square&logo=discord)](https://discord.gg/4gtbPAdpaE)

@@ -6,0 +6,0 @@ ActionSheet is a cross-platform React Native component that uses the native UIActionSheet on iOS and a JS implementation on Android. Almost a drop in replacement for [ActionSheetIOS](https://facebook.github.io/react-native/docs/actionsheetios.html) except it cannot be called statically.

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc