react-native-vector-icons
Advanced tools
Comparing version 4.4.2 to 4.4.3
@@ -1,1 +0,1 @@ | ||
Object.defineProperty(exports,"__esModule",{value:true});var _extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(Object.prototype.hasOwnProperty.call(source,key)){target[key]=source[key];}}}return target;};var _jsxFileName='./lib/create-icon-set.js';var _createClass=function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false;descriptor.configurable=true;if("value"in descriptor)descriptor.writable=true;Object.defineProperty(target,descriptor.key,descriptor);}}return function(Constructor,protoProps,staticProps){if(protoProps)defineProperties(Constructor.prototype,protoProps);if(staticProps)defineProperties(Constructor,staticProps);return Constructor;};}();exports.default=createIconSet;var _react=require('react');var _react2=_interopRequireDefault(_react);var _propTypes=require('prop-types');var _propTypes2=_interopRequireDefault(_propTypes);var _reactNative=require('./react-native');var _iconButton=require('./icon-button');var _iconButton2=_interopRequireDefault(_iconButton);var _tabBarItemIos=require('./tab-bar-item-ios');var _tabBarItemIos2=_interopRequireDefault(_tabBarItemIos);var _toolbarAndroid=require('./toolbar-android');var _toolbarAndroid2=_interopRequireDefault(_toolbarAndroid);function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj};}function _toConsumableArray(arr){if(Array.isArray(arr)){for(var i=0,arr2=Array(arr.length);i<arr.length;i++){arr2[i]=arr[i];}return arr2;}else{return Array.from(arr);}}function _objectWithoutProperties(obj,keys){var target={};for(var i in obj){if(keys.indexOf(i)>=0)continue;if(!Object.prototype.hasOwnProperty.call(obj,i))continue;target[i]=obj[i];}return target;}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function");}}function _possibleConstructorReturn(self,call){if(!self){throw new ReferenceError("this hasn't been initialised - super() hasn't been called");}return call&&(typeof call==="object"||typeof call==="function")?call:self;}function _inherits(subClass,superClass){if(typeof superClass!=="function"&&superClass!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);}subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:false,writable:true,configurable:true}});if(superClass)Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass;}var NativeIconAPI=_reactNative.NativeModules.RNVectorIconsManager||_reactNative.NativeModules.RNVectorIconsModule;var DEFAULT_ICON_SIZE=12;var DEFAULT_ICON_COLOR='black';function createIconSet(glyphMap,fontFamily,fontFile){var fontReference=fontFamily;if(_reactNative.Platform.OS==='android'&&fontFile){fontReference=fontFile.replace(/\.(otf|ttf)$/,'');}if(_reactNative.Platform.OS==='windows'&&fontFile){fontReference='Assets/'+fontFile+'#'+fontFamily;}var IconNamePropType=_propTypes2.default.oneOf(Object.keys(glyphMap));var Icon=function(_Component){_inherits(Icon,_Component);function Icon(){var _ref;var _temp,_this,_ret;_classCallCheck(this,Icon);for(var _len=arguments.length,args=Array(_len),_key=0;_key<_len;_key++){args[_key]=arguments[_key];}return _ret=(_temp=(_this=_possibleConstructorReturn(this,(_ref=Icon.__proto__||Object.getPrototypeOf(Icon)).call.apply(_ref,[this].concat(args))),_this),_this.root=null,_this.handleRef=function(ref){_this.root=ref;},_temp),_possibleConstructorReturn(_this,_ret);}_createClass(Icon,[{key:'setNativeProps',value:function setNativeProps(nativeProps){if(this.root){this.root.setNativeProps(nativeProps);}}},{key:'render',value:function render(){var _props=this.props,name=_props.name,size=_props.size,color=_props.color,style=_props.style,props=_objectWithoutProperties(_props,['name','size','color','style']);var glyph=name?glyphMap[name]||'?':'';if(typeof glyph==='number'){glyph=String.fromCharCode(glyph);}var styleDefaults={fontSize:size,color:color};var styleOverrides={fontFamily:fontReference,fontWeight:'normal',fontStyle:'normal'};props.style=[styleDefaults,style,styleOverrides];props.ref=this.handleRef;return _react2.default.createElement(_reactNative.Text,_extends({},props,{__source:{fileName:_jsxFileName,lineNumber:82}}),glyph,this.props.children);}}]);return Icon;}(_react.Component);Icon.propTypes={name:IconNamePropType,size:_propTypes2.default.number,color:_propTypes2.default.string,children:_propTypes2.default.node,style:_propTypes2.default.any};Icon.defaultProps={size:DEFAULT_ICON_SIZE,allowFontScaling:false};var imageSourceCache={};function ensureNativeModuleAvailable(){if(!NativeIconAPI){if(_reactNative.Platform.OS==='android'){throw new Error('RNVectorIconsModule not available, did you properly integrate the module? Try running `react-native link react-native-vector-icons` and recompiling.');}throw new Error('RNVectorIconsManager not available, did you add the library to your project and link with libRNVectorIcons.a? Try running `react-native link react-native-vector-icons` and recompiling.');}}function getImageSource(name){var size=arguments.length>1&&arguments[1]!==undefined?arguments[1]:DEFAULT_ICON_SIZE;var color=arguments.length>2&&arguments[2]!==undefined?arguments[2]:DEFAULT_ICON_COLOR;ensureNativeModuleAvailable();var glyph=glyphMap[name]||'?';if(typeof glyph==='number'){glyph=String.fromCharCode(glyph);}var processedColor=(0,_reactNative.processColor)(color);var cacheKey=glyph+':'+size+':'+processedColor;var scale=_reactNative.PixelRatio.get();return new Promise(function(resolve,reject){var cached=imageSourceCache[cacheKey];if(typeof cached!=='undefined'){if(!cached||cached instanceof Error){reject(cached);}else{resolve({uri:cached,scale:scale});}}else{NativeIconAPI.getImageForFont(fontReference,glyph,size,processedColor,function(err,image){var error=typeof err==='string'?new Error(err):err;imageSourceCache[cacheKey]=image||error||false;if(!error&&image){resolve({uri:image,scale:scale});}else{reject(error);}});}});}function loadFont(){var file=arguments.length>0&&arguments[0]!==undefined?arguments[0]:fontFile;if(_reactNative.Platform.OS==='ios'){ensureNativeModuleAvailable();if(!file){return Promise.reject(new Error('Unable to load font, because no file was specified. '));}return NativeIconAPI.loadFontWithFileName.apply(NativeIconAPI,_toConsumableArray(file.split('.')));}return Promise.resolve();}Icon.Button=(0,_iconButton2.default)(Icon);Icon.TabBarItem=(0,_tabBarItemIos2.default)(IconNamePropType,getImageSource);Icon.TabBarItemIOS=Icon.TabBarItem;Icon.ToolbarAndroid=(0,_toolbarAndroid2.default)(IconNamePropType,getImageSource);Icon.getImageSource=getImageSource;Icon.loadFont=loadFont;return Icon;} | ||
Object.defineProperty(exports,"__esModule",{value:true});var _extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(Object.prototype.hasOwnProperty.call(source,key)){target[key]=source[key];}}}return target;};var _jsxFileName='./lib/create-icon-set.js';var _createClass=function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false;descriptor.configurable=true;if("value"in descriptor)descriptor.writable=true;Object.defineProperty(target,descriptor.key,descriptor);}}return function(Constructor,protoProps,staticProps){if(protoProps)defineProperties(Constructor.prototype,protoProps);if(staticProps)defineProperties(Constructor,staticProps);return Constructor;};}();exports.default=createIconSet;var _react=require('react');var _react2=_interopRequireDefault(_react);var _propTypes=require('prop-types');var _propTypes2=_interopRequireDefault(_propTypes);var _reactNative=require('./react-native');var _iconButton=require('./icon-button');var _iconButton2=_interopRequireDefault(_iconButton);var _tabBarItemIos=require('./tab-bar-item-ios');var _tabBarItemIos2=_interopRequireDefault(_tabBarItemIos);var _toolbarAndroid=require('./toolbar-android');var _toolbarAndroid2=_interopRequireDefault(_toolbarAndroid);function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj};}function _toConsumableArray(arr){if(Array.isArray(arr)){for(var i=0,arr2=Array(arr.length);i<arr.length;i++){arr2[i]=arr[i];}return arr2;}else{return Array.from(arr);}}function _objectWithoutProperties(obj,keys){var target={};for(var i in obj){if(keys.indexOf(i)>=0)continue;if(!Object.prototype.hasOwnProperty.call(obj,i))continue;target[i]=obj[i];}return target;}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function");}}function _possibleConstructorReturn(self,call){if(!self){throw new ReferenceError("this hasn't been initialised - super() hasn't been called");}return call&&(typeof call==="object"||typeof call==="function")?call:self;}function _inherits(subClass,superClass){if(typeof superClass!=="function"&&superClass!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);}subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:false,writable:true,configurable:true}});if(superClass)Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass;}var NativeIconAPI=_reactNative.NativeModules.RNVectorIconsManager||_reactNative.NativeModules.RNVectorIconsModule;var DEFAULT_ICON_SIZE=12;var DEFAULT_ICON_COLOR='black';function createIconSet(glyphMap,fontFamily,fontFile){var fontReference=fontFamily;if(_reactNative.Platform.OS==='android'&&fontFile){fontReference=fontFile.replace(/\.(otf|ttf)$/,'');}if(_reactNative.Platform.OS==='windows'&&fontFile){fontReference='Assets/'+fontFile+'#'+fontFamily;}var IconNamePropType=_propTypes2.default.oneOf(Object.keys(glyphMap));var Icon=function(_PureComponent){_inherits(Icon,_PureComponent);function Icon(){var _ref;var _temp,_this,_ret;_classCallCheck(this,Icon);for(var _len=arguments.length,args=Array(_len),_key=0;_key<_len;_key++){args[_key]=arguments[_key];}return _ret=(_temp=(_this=_possibleConstructorReturn(this,(_ref=Icon.__proto__||Object.getPrototypeOf(Icon)).call.apply(_ref,[this].concat(args))),_this),_this.root=null,_this.handleRef=function(ref){_this.root=ref;},_temp),_possibleConstructorReturn(_this,_ret);}_createClass(Icon,[{key:'setNativeProps',value:function setNativeProps(nativeProps){if(this.root){this.root.setNativeProps(nativeProps);}}},{key:'render',value:function render(){var _props=this.props,name=_props.name,size=_props.size,color=_props.color,style=_props.style,props=_objectWithoutProperties(_props,['name','size','color','style']);var glyph=name?glyphMap[name]||'?':'';if(typeof glyph==='number'){glyph=String.fromCharCode(glyph);}var styleDefaults={fontSize:size,color:color};var styleOverrides={fontFamily:fontReference,fontWeight:'normal',fontStyle:'normal'};props.style=[styleDefaults,style,styleOverrides];props.ref=this.handleRef;return _react2.default.createElement(_reactNative.Text,_extends({},props,{__source:{fileName:_jsxFileName,lineNumber:82}}),glyph,this.props.children);}}]);return Icon;}(_react.PureComponent);Icon.propTypes={name:IconNamePropType,size:_propTypes2.default.number,color:_propTypes2.default.oneOfType([_propTypes2.default.string,_propTypes2.default.number]),children:_propTypes2.default.node,style:_propTypes2.default.any};Icon.defaultProps={size:DEFAULT_ICON_SIZE,allowFontScaling:false};var imageSourceCache={};function ensureNativeModuleAvailable(){if(!NativeIconAPI){if(_reactNative.Platform.OS==='android'){throw new Error('RNVectorIconsModule not available, did you properly integrate the module? Try running `react-native link react-native-vector-icons` and recompiling.');}throw new Error('RNVectorIconsManager not available, did you add the library to your project and link with libRNVectorIcons.a? Try running `react-native link react-native-vector-icons` and recompiling.');}}function getImageSource(name){var size=arguments.length>1&&arguments[1]!==undefined?arguments[1]:DEFAULT_ICON_SIZE;var color=arguments.length>2&&arguments[2]!==undefined?arguments[2]:DEFAULT_ICON_COLOR;ensureNativeModuleAvailable();var glyph=glyphMap[name]||'?';if(typeof glyph==='number'){glyph=String.fromCharCode(glyph);}var processedColor=(0,_reactNative.processColor)(color);var cacheKey=glyph+':'+size+':'+processedColor;var scale=_reactNative.PixelRatio.get();return new Promise(function(resolve,reject){var cached=imageSourceCache[cacheKey];if(typeof cached!=='undefined'){if(!cached||cached instanceof Error){reject(cached);}else{resolve({uri:cached,scale:scale});}}else{NativeIconAPI.getImageForFont(fontReference,glyph,size,processedColor,function(err,image){var error=typeof err==='string'?new Error(err):err;imageSourceCache[cacheKey]=image||error||false;if(!error&&image){resolve({uri:image,scale:scale});}else{reject(error);}});}});}function loadFont(){var file=arguments.length>0&&arguments[0]!==undefined?arguments[0]:fontFile;if(_reactNative.Platform.OS==='ios'){ensureNativeModuleAvailable();if(!file){return Promise.reject(new Error('Unable to load font, because no file was specified. '));}return NativeIconAPI.loadFontWithFileName.apply(NativeIconAPI,_toConsumableArray(file.split('.')));}return Promise.resolve();}Icon.Button=(0,_iconButton2.default)(Icon);Icon.TabBarItem=(0,_tabBarItemIos2.default)(IconNamePropType,getImageSource);Icon.TabBarItemIOS=Icon.TabBarItem;Icon.ToolbarAndroid=(0,_toolbarAndroid2.default)(IconNamePropType,getImageSource);Icon.getImageSource=getImageSource;Icon.loadFont=loadFont;return Icon;} |
@@ -1,1 +0,1 @@ | ||
Object.defineProperty(exports,"__esModule",{value:true});var _extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(Object.prototype.hasOwnProperty.call(source,key)){target[key]=source[key];}}}return target;};var _jsxFileName='./lib/icon-button.js';var _createClass=function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false;descriptor.configurable=true;if("value"in descriptor)descriptor.writable=true;Object.defineProperty(target,descriptor.key,descriptor);}}return function(Constructor,protoProps,staticProps){if(protoProps)defineProperties(Constructor.prototype,protoProps);if(staticProps)defineProperties(Constructor,staticProps);return Constructor;};}();exports.default=createIconButtonComponent;var _isString=require('lodash/isString');var _isString2=_interopRequireDefault(_isString);var _omit=require('lodash/omit');var _omit2=_interopRequireDefault(_omit);var _pick=require('lodash/pick');var _pick2=_interopRequireDefault(_pick);var _react=require('react');var _react2=_interopRequireDefault(_react);var _propTypes=require('prop-types');var _propTypes2=_interopRequireDefault(_propTypes);var _reactNative=require('./react-native');function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj};}function _objectWithoutProperties(obj,keys){var target={};for(var i in obj){if(keys.indexOf(i)>=0)continue;if(!Object.prototype.hasOwnProperty.call(obj,i))continue;target[i]=obj[i];}return target;}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function");}}function _possibleConstructorReturn(self,call){if(!self){throw new ReferenceError("this hasn't been initialised - super() hasn't been called");}return call&&(typeof call==="object"||typeof call==="function")?call:self;}function _inherits(subClass,superClass){if(typeof superClass!=="function"&&superClass!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);}subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:false,writable:true,configurable:true}});if(superClass)Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass;}var styles=_reactNative.StyleSheet.create({container:{flexDirection:'row',justifyContent:'flex-start',alignItems:'center',padding:8},touchable:{overflow:'hidden'},icon:{marginRight:10},text:{fontWeight:'600',backgroundColor:'transparent'}});var IOS7_BLUE='#007AFF';function createIconButtonComponent(Icon){var _class,_temp;return _temp=_class=function(_Component){_inherits(IconButton,_Component);function IconButton(){_classCallCheck(this,IconButton);return _possibleConstructorReturn(this,(IconButton.__proto__||Object.getPrototypeOf(IconButton)).apply(this,arguments));}_createClass(IconButton,[{key:'render',value:function render(){var _props=this.props,style=_props.style,iconStyle=_props.iconStyle,children=_props.children,restProps=_objectWithoutProperties(_props,['style','iconStyle','children']);var iconProps=(0,_pick2.default)(restProps,Object.keys(_reactNative.Text.propTypes),'style','name','size','color');var touchableProps=(0,_pick2.default)(restProps,Object.keys(_reactNative.TouchableHighlight.propTypes));var props=(0,_omit2.default)(restProps,Object.keys(iconProps),Object.keys(touchableProps),'iconStyle','borderRadius','backgroundColor');iconProps.style=iconStyle?[styles.icon,iconStyle]:styles.icon;var colorStyle=(0,_pick2.default)(this.props,'color');var blockStyle=(0,_pick2.default)(this.props,'backgroundColor','borderRadius');return _react2.default.createElement(_reactNative.TouchableHighlight,_extends({style:[styles.touchable,blockStyle]},touchableProps,{__source:{fileName:_jsxFileName,lineNumber:77}}),_react2.default.createElement(_reactNative.View,_extends({style:[styles.container,blockStyle,style]},props,{__source:{fileName:_jsxFileName,lineNumber:81}}),_react2.default.createElement(Icon,_extends({},iconProps,{__source:{fileName:_jsxFileName,lineNumber:82}})),(0,_isString2.default)(children)?_react2.default.createElement(_reactNative.Text,{style:[styles.text,colorStyle],__source:{fileName:_jsxFileName,lineNumber:84}},children):children));}}]);return IconButton;}(_react.Component),_class.propTypes={backgroundColor:_propTypes2.default.string,borderRadius:_propTypes2.default.number,color:_propTypes2.default.string,size:_propTypes2.default.number,iconStyle:_propTypes2.default.any,style:_propTypes2.default.any,children:_propTypes2.default.node},_class.defaultProps={backgroundColor:IOS7_BLUE,borderRadius:5,color:'white',size:20},_temp;} | ||
Object.defineProperty(exports,"__esModule",{value:true});var _extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(Object.prototype.hasOwnProperty.call(source,key)){target[key]=source[key];}}}return target;};var _jsxFileName='./lib/icon-button.js';var _createClass=function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false;descriptor.configurable=true;if("value"in descriptor)descriptor.writable=true;Object.defineProperty(target,descriptor.key,descriptor);}}return function(Constructor,protoProps,staticProps){if(protoProps)defineProperties(Constructor.prototype,protoProps);if(staticProps)defineProperties(Constructor,staticProps);return Constructor;};}();exports.default=createIconButtonComponent;var _isString=require('lodash/isString');var _isString2=_interopRequireDefault(_isString);var _omit=require('lodash/omit');var _omit2=_interopRequireDefault(_omit);var _pick=require('lodash/pick');var _pick2=_interopRequireDefault(_pick);var _react=require('react');var _react2=_interopRequireDefault(_react);var _propTypes=require('prop-types');var _propTypes2=_interopRequireDefault(_propTypes);var _reactNative=require('./react-native');function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj};}function _objectWithoutProperties(obj,keys){var target={};for(var i in obj){if(keys.indexOf(i)>=0)continue;if(!Object.prototype.hasOwnProperty.call(obj,i))continue;target[i]=obj[i];}return target;}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function");}}function _possibleConstructorReturn(self,call){if(!self){throw new ReferenceError("this hasn't been initialised - super() hasn't been called");}return call&&(typeof call==="object"||typeof call==="function")?call:self;}function _inherits(subClass,superClass){if(typeof superClass!=="function"&&superClass!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);}subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:false,writable:true,configurable:true}});if(superClass)Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass;}var styles=_reactNative.StyleSheet.create({container:{flexDirection:'row',justifyContent:'flex-start',alignItems:'center',padding:8},touchable:{overflow:'hidden'},icon:{marginRight:10},text:{fontWeight:'600',backgroundColor:'transparent'}});var IOS7_BLUE='#007AFF';function createIconButtonComponent(Icon){var _class,_temp;return _temp=_class=function(_PureComponent){_inherits(IconButton,_PureComponent);function IconButton(){_classCallCheck(this,IconButton);return _possibleConstructorReturn(this,(IconButton.__proto__||Object.getPrototypeOf(IconButton)).apply(this,arguments));}_createClass(IconButton,[{key:'render',value:function render(){var _props=this.props,style=_props.style,iconStyle=_props.iconStyle,children=_props.children,restProps=_objectWithoutProperties(_props,['style','iconStyle','children']);var iconProps=(0,_pick2.default)(restProps,Object.keys(_reactNative.Text.propTypes),'style','name','size','color');var touchableProps=(0,_pick2.default)(restProps,Object.keys(_reactNative.TouchableHighlight.propTypes));var props=(0,_omit2.default)(restProps,Object.keys(iconProps),Object.keys(touchableProps),'iconStyle','borderRadius','backgroundColor');iconProps.style=iconStyle?[styles.icon,iconStyle]:styles.icon;var colorStyle=(0,_pick2.default)(this.props,'color');var blockStyle=(0,_pick2.default)(this.props,'backgroundColor','borderRadius');return _react2.default.createElement(_reactNative.TouchableHighlight,_extends({style:[styles.touchable,blockStyle]},touchableProps,{__source:{fileName:_jsxFileName,lineNumber:80}}),_react2.default.createElement(_reactNative.View,_extends({style:[styles.container,blockStyle,style]},props,{__source:{fileName:_jsxFileName,lineNumber:84}}),_react2.default.createElement(Icon,_extends({},iconProps,{__source:{fileName:_jsxFileName,lineNumber:85}})),(0,_isString2.default)(children)?_react2.default.createElement(_reactNative.Text,{style:[styles.text,colorStyle],__source:{fileName:_jsxFileName,lineNumber:87}},children):children));}}]);return IconButton;}(_react.PureComponent),_class.propTypes={backgroundColor:_propTypes2.default.oneOfType([_propTypes2.default.string,_propTypes2.default.number]),borderRadius:_propTypes2.default.number,color:_propTypes2.default.oneOfType([_propTypes2.default.string,_propTypes2.default.number]),size:_propTypes2.default.number,iconStyle:_propTypes2.default.any,style:_propTypes2.default.any,children:_propTypes2.default.node},_class.defaultProps={backgroundColor:IOS7_BLUE,borderRadius:5,color:'white',size:20},_temp;} |
@@ -1,1 +0,1 @@ | ||
Object.defineProperty(exports,"__esModule",{value:true});var _extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(Object.prototype.hasOwnProperty.call(source,key)){target[key]=source[key];}}}return target;};var _jsxFileName='./lib/tab-bar-item-ios.js';var _createClass=function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false;descriptor.configurable=true;if("value"in descriptor)descriptor.writable=true;Object.defineProperty(target,descriptor.key,descriptor);}}return function(Constructor,protoProps,staticProps){if(protoProps)defineProperties(Constructor.prototype,protoProps);if(staticProps)defineProperties(Constructor,staticProps);return Constructor;};}();exports.default=createTabBarItemIOSComponent;var _isEqual=require('lodash/isEqual');var _isEqual2=_interopRequireDefault(_isEqual);var _pick=require('lodash/pick');var _pick2=_interopRequireDefault(_pick);var _react=require('react');var _react2=_interopRequireDefault(_react);var _propTypes=require('prop-types');var _propTypes2=_interopRequireDefault(_propTypes);var _reactNative=require('./react-native');function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj};}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function");}}function _possibleConstructorReturn(self,call){if(!self){throw new ReferenceError("this hasn't been initialised - super() hasn't been called");}return call&&(typeof call==="object"||typeof call==="function")?call:self;}function _inherits(subClass,superClass){if(typeof superClass!=="function"&&superClass!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);}subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:false,writable:true,configurable:true}});if(superClass)Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass;}function createTabBarItemIOSComponent(IconNamePropType,getImageSource){var _class,_temp;return _temp=_class=function(_Component){_inherits(TabBarItemIOS,_Component);function TabBarItemIOS(){_classCallCheck(this,TabBarItemIOS);return _possibleConstructorReturn(this,(TabBarItemIOS.__proto__||Object.getPrototypeOf(TabBarItemIOS)).apply(this,arguments));}_createClass(TabBarItemIOS,[{key:'componentWillMount',value:function componentWillMount(){this.updateIconSources(this.props);}},{key:'componentWillReceiveProps',value:function componentWillReceiveProps(nextProps){var keys=Object.keys(TabBarItemIOS.propTypes);if(!(0,_isEqual2.default)((0,_pick2.default)(nextProps,keys),(0,_pick2.default)(this.props,keys))){this.updateIconSources(nextProps);}}},{key:'updateIconSources',value:function updateIconSources(props){var _this2=this;if(props.iconName){getImageSource(props.iconName,props.iconSize,props.iconColor).then(function(icon){return _this2.setState({icon:icon});});}if(props.selectedIconName||props.selectedIconColor){var selectedIconName=props.selectedIconName||props.iconName;var selectedIconColor=props.selectedIconColor||props.iconColor;getImageSource(selectedIconName,props.iconSize,selectedIconColor).then(function(selectedIcon){return _this2.setState({selectedIcon:selectedIcon});});}}},{key:'render',value:function render(){return _react2.default.createElement(_reactNative.TabBarIOS.Item,_extends({},this.props,this.state,{__source:{fileName:_jsxFileName,lineNumber:56}}));}}]);return TabBarItemIOS;}(_react.Component),_class.propTypes={iconName:IconNamePropType.isRequired,selectedIconName:IconNamePropType,iconSize:_propTypes2.default.number,iconColor:_propTypes2.default.string,selectedIconColor:_propTypes2.default.string},_class.defaultProps={iconSize:30},_temp;} | ||
Object.defineProperty(exports,"__esModule",{value:true});var _extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(Object.prototype.hasOwnProperty.call(source,key)){target[key]=source[key];}}}return target;};var _jsxFileName='./lib/tab-bar-item-ios.js';var _createClass=function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false;descriptor.configurable=true;if("value"in descriptor)descriptor.writable=true;Object.defineProperty(target,descriptor.key,descriptor);}}return function(Constructor,protoProps,staticProps){if(protoProps)defineProperties(Constructor.prototype,protoProps);if(staticProps)defineProperties(Constructor,staticProps);return Constructor;};}();exports.default=createTabBarItemIOSComponent;var _isEqual=require('lodash/isEqual');var _isEqual2=_interopRequireDefault(_isEqual);var _pick=require('lodash/pick');var _pick2=_interopRequireDefault(_pick);var _react=require('react');var _react2=_interopRequireDefault(_react);var _propTypes=require('prop-types');var _propTypes2=_interopRequireDefault(_propTypes);var _reactNative=require('./react-native');function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj};}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function");}}function _possibleConstructorReturn(self,call){if(!self){throw new ReferenceError("this hasn't been initialised - super() hasn't been called");}return call&&(typeof call==="object"||typeof call==="function")?call:self;}function _inherits(subClass,superClass){if(typeof superClass!=="function"&&superClass!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);}subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:false,writable:true,configurable:true}});if(superClass)Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass;}function createTabBarItemIOSComponent(IconNamePropType,getImageSource){var _class,_temp;return _temp=_class=function(_PureComponent){_inherits(TabBarItemIOS,_PureComponent);function TabBarItemIOS(){_classCallCheck(this,TabBarItemIOS);return _possibleConstructorReturn(this,(TabBarItemIOS.__proto__||Object.getPrototypeOf(TabBarItemIOS)).apply(this,arguments));}_createClass(TabBarItemIOS,[{key:'componentWillMount',value:function componentWillMount(){this.updateIconSources(this.props);}},{key:'componentWillReceiveProps',value:function componentWillReceiveProps(nextProps){var keys=Object.keys(TabBarItemIOS.propTypes);if(!(0,_isEqual2.default)((0,_pick2.default)(nextProps,keys),(0,_pick2.default)(this.props,keys))){this.updateIconSources(nextProps);}}},{key:'updateIconSources',value:function updateIconSources(props){var _this2=this;if(props.iconName){getImageSource(props.iconName,props.iconSize,props.iconColor).then(function(icon){return _this2.setState({icon:icon});});}if(props.selectedIconName||props.selectedIconColor){var selectedIconName=props.selectedIconName||props.iconName;var selectedIconColor=props.selectedIconColor||props.iconColor;getImageSource(selectedIconName,props.iconSize,selectedIconColor).then(function(selectedIcon){return _this2.setState({selectedIcon:selectedIcon});});}}},{key:'render',value:function render(){return _react2.default.createElement(_reactNative.TabBarIOS.Item,_extends({},this.props,this.state,{__source:{fileName:_jsxFileName,lineNumber:59}}));}}]);return TabBarItemIOS;}(_react.PureComponent),_class.propTypes={iconName:IconNamePropType.isRequired,selectedIconName:IconNamePropType,iconSize:_propTypes2.default.number,iconColor:_propTypes2.default.oneOfType([_propTypes2.default.string,_propTypes2.default.number]),selectedIconColor:_propTypes2.default.oneOfType([_propTypes2.default.string,_propTypes2.default.number])},_class.defaultProps={iconSize:30},_temp;} |
@@ -1,1 +0,1 @@ | ||
Object.defineProperty(exports,"__esModule",{value:true});var _jsxFileName='./lib/toolbar-android.js';var _extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(Object.prototype.hasOwnProperty.call(source,key)){target[key]=source[key];}}}return target;};var _createClass=function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false;descriptor.configurable=true;if("value"in descriptor)descriptor.writable=true;Object.defineProperty(target,descriptor.key,descriptor);}}return function(Constructor,protoProps,staticProps){if(protoProps)defineProperties(Constructor.prototype,protoProps);if(staticProps)defineProperties(Constructor,staticProps);return Constructor;};}();exports.default=createToolbarAndroidComponent;var _isEqual=require('lodash/isEqual');var _isEqual2=_interopRequireDefault(_isEqual);var _pick=require('lodash/pick');var _pick2=_interopRequireDefault(_pick);var _react=require('react');var _react2=_interopRequireDefault(_react);var _propTypes=require('prop-types');var _propTypes2=_interopRequireDefault(_propTypes);var _reactNative=require('./react-native');function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj};}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function");}}function _possibleConstructorReturn(self,call){if(!self){throw new ReferenceError("this hasn't been initialised - super() hasn't been called");}return call&&(typeof call==="object"||typeof call==="function")?call:self;}function _inherits(subClass,superClass){if(typeof superClass!=="function"&&superClass!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);}subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:false,writable:true,configurable:true}});if(superClass)Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass;}function createToolbarAndroidComponent(IconNamePropType,getImageSource){var _class,_temp;return _temp=_class=function(_Component){_inherits(IconToolbarAndroid,_Component);function IconToolbarAndroid(){_classCallCheck(this,IconToolbarAndroid);return _possibleConstructorReturn(this,(IconToolbarAndroid.__proto__||Object.getPrototypeOf(IconToolbarAndroid)).apply(this,arguments));}_createClass(IconToolbarAndroid,[{key:'componentWillMount',value:function componentWillMount(){this.updateIconSources(this.props);}},{key:'componentWillReceiveProps',value:function componentWillReceiveProps(nextProps){var _this2=this;var keys=Object.keys(IconToolbarAndroid.propTypes);if(!(0,_isEqual2.default)((0,_pick2.default)(nextProps,keys),(0,_pick2.default)(this.props,keys))){var stateToEvict={};if(!nextProps.logoName){stateToEvict.logo=undefined;}if(!nextProps.navIconName){stateToEvict.navIcon=undefined;}if(!nextProps.overflowIconName){stateToEvict.overflowIcon=undefined;}if(this.state&&Object.keys(stateToEvict).length){this.setState(stateToEvict,function(){return _this2.updateIconSources(nextProps);});}else{this.updateIconSources(nextProps);}}}},{key:'updateIconSources',value:function updateIconSources(props){var _this3=this;var size=props.iconSize;var color=props.iconColor||props.titleColor;if(props.logoName){getImageSource(props.logoName,size,color).then(function(logo){return _this3.setState({logo:logo});});}if(props.navIconName){getImageSource(props.navIconName,size,color).then(function(navIcon){return _this3.setState({navIcon:navIcon});});}if(props.overflowIconName){getImageSource(props.overflowIconName,size,color).then(function(overflowIcon){return _this3.setState({overflowIcon:overflowIcon});});}Promise.all((props.actions||[]).map(function(action){if(action.iconName){return getImageSource(action.iconName,action.iconSize||size,action.iconColor||color).then(function(icon){return _extends({},action,{icon:icon});});}return Promise.resolve(action);})).then(function(actions){return _this3.setState({actions:actions});});}},{key:'render',value:function render(){return _react2.default.createElement(_reactNative.ToolbarAndroid,_extends({},this.props,this.state,{__source:{fileName:_jsxFileName,lineNumber:94}}));}}]);return IconToolbarAndroid;}(_react.Component),_class.propTypes={logoName:IconNamePropType,navIconName:IconNamePropType,overflowIconName:IconNamePropType,actions:_propTypes2.default.arrayOf(_propTypes2.default.shape({title:_propTypes2.default.string.isRequired,iconName:IconNamePropType,iconSize:_propTypes2.default.number,iconColor:_propTypes2.default.string,show:_propTypes2.default.oneOf(['always','ifRoom','never']),showWithText:_propTypes2.default.bool})),iconSize:_propTypes2.default.number,iconColor:_propTypes2.default.string},_class.defaultProps={iconSize:24},_temp;} | ||
Object.defineProperty(exports,"__esModule",{value:true});var _jsxFileName='./lib/toolbar-android.js';var _extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(Object.prototype.hasOwnProperty.call(source,key)){target[key]=source[key];}}}return target;};var _createClass=function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false;descriptor.configurable=true;if("value"in descriptor)descriptor.writable=true;Object.defineProperty(target,descriptor.key,descriptor);}}return function(Constructor,protoProps,staticProps){if(protoProps)defineProperties(Constructor.prototype,protoProps);if(staticProps)defineProperties(Constructor,staticProps);return Constructor;};}();exports.default=createToolbarAndroidComponent;var _isEqual=require('lodash/isEqual');var _isEqual2=_interopRequireDefault(_isEqual);var _pick=require('lodash/pick');var _pick2=_interopRequireDefault(_pick);var _react=require('react');var _react2=_interopRequireDefault(_react);var _propTypes=require('prop-types');var _propTypes2=_interopRequireDefault(_propTypes);var _reactNative=require('./react-native');function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj};}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function");}}function _possibleConstructorReturn(self,call){if(!self){throw new ReferenceError("this hasn't been initialised - super() hasn't been called");}return call&&(typeof call==="object"||typeof call==="function")?call:self;}function _inherits(subClass,superClass){if(typeof superClass!=="function"&&superClass!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);}subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:false,writable:true,configurable:true}});if(superClass)Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass;}function createToolbarAndroidComponent(IconNamePropType,getImageSource){var _class,_temp;return _temp=_class=function(_PureComponent){_inherits(IconToolbarAndroid,_PureComponent);function IconToolbarAndroid(){_classCallCheck(this,IconToolbarAndroid);return _possibleConstructorReturn(this,(IconToolbarAndroid.__proto__||Object.getPrototypeOf(IconToolbarAndroid)).apply(this,arguments));}_createClass(IconToolbarAndroid,[{key:'componentWillMount',value:function componentWillMount(){this.updateIconSources(this.props);}},{key:'componentWillReceiveProps',value:function componentWillReceiveProps(nextProps){var _this2=this;var keys=Object.keys(IconToolbarAndroid.propTypes);if(!(0,_isEqual2.default)((0,_pick2.default)(nextProps,keys),(0,_pick2.default)(this.props,keys))){var stateToEvict={};if(!nextProps.logoName){stateToEvict.logo=undefined;}if(!nextProps.navIconName){stateToEvict.navIcon=undefined;}if(!nextProps.overflowIconName){stateToEvict.overflowIcon=undefined;}if(this.state&&Object.keys(stateToEvict).length){this.setState(stateToEvict,function(){return _this2.updateIconSources(nextProps);});}else{this.updateIconSources(nextProps);}}}},{key:'updateIconSources',value:function updateIconSources(props){var _this3=this;var size=props.iconSize;var color=props.iconColor||props.titleColor;if(props.logoName){getImageSource(props.logoName,size,color).then(function(logo){return _this3.setState({logo:logo});});}if(props.navIconName){getImageSource(props.navIconName,size,color).then(function(navIcon){return _this3.setState({navIcon:navIcon});});}if(props.overflowIconName){getImageSource(props.overflowIconName,size,color).then(function(overflowIcon){return _this3.setState({overflowIcon:overflowIcon});});}Promise.all((props.actions||[]).map(function(action){if(action.iconName){return getImageSource(action.iconName,action.iconSize||size,action.iconColor||color).then(function(icon){return _extends({},action,{icon:icon});});}return Promise.resolve(action);})).then(function(actions){return _this3.setState({actions:actions});});}},{key:'render',value:function render(){return _react2.default.createElement(_reactNative.ToolbarAndroid,_extends({},this.props,this.state,{__source:{fileName:_jsxFileName,lineNumber:94}}));}}]);return IconToolbarAndroid;}(_react.PureComponent),_class.propTypes={logoName:IconNamePropType,navIconName:IconNamePropType,overflowIconName:IconNamePropType,actions:_propTypes2.default.arrayOf(_propTypes2.default.shape({title:_propTypes2.default.string.isRequired,iconName:IconNamePropType,iconSize:_propTypes2.default.number,iconColor:_propTypes2.default.oneOfType([_propTypes2.default.string,_propTypes2.default.number]),show:_propTypes2.default.oneOf(['always','ifRoom','never']),showWithText:_propTypes2.default.bool})),iconSize:_propTypes2.default.number,iconColor:_propTypes2.default.oneOfType([_propTypes2.default.string,_propTypes2.default.number])},_class.defaultProps={iconSize:24},_temp;} |
@@ -1,1 +0,1 @@ | ||
Object.defineProperty(exports,"__esModule",{value:true});var _extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(Object.prototype.hasOwnProperty.call(source,key)){target[key]=source[key];}}}return target;};var _jsxFileName='./RNIMigration.js';var _createClass=function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false;descriptor.configurable=true;if("value"in descriptor)descriptor.writable=true;Object.defineProperty(target,descriptor.key,descriptor);}}return function(Constructor,protoProps,staticProps){if(protoProps)defineProperties(Constructor.prototype,protoProps);if(staticProps)defineProperties(Constructor,staticProps);return Constructor;};}();var _react=require('react');var _react2=_interopRequireDefault(_react);var _propTypes=require('prop-types');var _propTypes2=_interopRequireDefault(_propTypes);var _FontAwesome=require('react-native-vector-icons/FontAwesome');var _FontAwesome2=_interopRequireDefault(_FontAwesome);var _Foundation=require('react-native-vector-icons/Foundation');var _Foundation2=_interopRequireDefault(_Foundation);var _Ionicons=require('react-native-vector-icons/Ionicons');var _Ionicons2=_interopRequireDefault(_Ionicons);var _MaterialIcons=require('react-native-vector-icons/MaterialIcons');var _MaterialIcons2=_interopRequireDefault(_MaterialIcons);var _Zocial=require('react-native-vector-icons/Zocial');var _Zocial2=_interopRequireDefault(_Zocial);var _SimpleLineIcons=require('react-native-vector-icons/SimpleLineIcons');var _SimpleLineIcons2=_interopRequireDefault(_SimpleLineIcons);function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj};}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function");}}function _possibleConstructorReturn(self,call){if(!self){throw new ReferenceError("this hasn't been initialised - super() hasn't been called");}return call&&(typeof call==="object"||typeof call==="function")?call:self;}function _inherits(subClass,superClass){if(typeof superClass!=="function"&&superClass!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);}subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:false,writable:true,configurable:true}});if(superClass)Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass;}var ICON_SET_MAP={fontawesome:_FontAwesome2.default,foundation:_Foundation2.default,ion:_Ionicons2.default,material:_MaterialIcons2.default,zocial:_Zocial2.default,simpleline:_SimpleLineIcons2.default};var Icon=function(_React$Component){_inherits(Icon,_React$Component);function Icon(){var _ref;var _temp,_this,_ret;_classCallCheck(this,Icon);for(var _len=arguments.length,args=Array(_len),_key=0;_key<_len;_key++){args[_key]=arguments[_key];}return _ret=(_temp=(_this=_possibleConstructorReturn(this,(_ref=Icon.__proto__||Object.getPrototypeOf(Icon)).call.apply(_ref,[this].concat(args))),_this),_this.iconRef=null,_this.handleComponentRef=function(ref){_this.iconRef=ref;},_temp),_possibleConstructorReturn(_this,_ret);}_createClass(Icon,[{key:'setNativeProps',value:function setNativeProps(nativeProps){if(this.iconRef){this.iconRef.setNativeProps(nativeProps);}}},{key:'render',value:function render(){var nameParts=this.props.name.split('|');var setName=nameParts[0];var name=nameParts[1];var IconSet=ICON_SET_MAP[setName];if(!IconSet){throw new Error('Invalid icon set "'+setName+'"');}return _react2.default.createElement(IconSet,_extends({allowFontScaling:false,ref:this.handleComponentRef},this.props,{name:name,__source:{fileName:_jsxFileName,lineNumber:51}}));}}]);return Icon;}(_react2.default.Component);Icon.propTypes={name:_propTypes2.default.string.isRequired,size:_propTypes2.default.number,color:_propTypes2.default.string};exports.default=Icon; | ||
Object.defineProperty(exports,"__esModule",{value:true});var _extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(Object.prototype.hasOwnProperty.call(source,key)){target[key]=source[key];}}}return target;};var _jsxFileName='./RNIMigration.js';var _createClass=function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false;descriptor.configurable=true;if("value"in descriptor)descriptor.writable=true;Object.defineProperty(target,descriptor.key,descriptor);}}return function(Constructor,protoProps,staticProps){if(protoProps)defineProperties(Constructor.prototype,protoProps);if(staticProps)defineProperties(Constructor,staticProps);return Constructor;};}();var _react=require('react');var _react2=_interopRequireDefault(_react);var _propTypes=require('prop-types');var _propTypes2=_interopRequireDefault(_propTypes);var _FontAwesome=require('react-native-vector-icons/FontAwesome');var _FontAwesome2=_interopRequireDefault(_FontAwesome);var _Foundation=require('react-native-vector-icons/Foundation');var _Foundation2=_interopRequireDefault(_Foundation);var _Ionicons=require('react-native-vector-icons/Ionicons');var _Ionicons2=_interopRequireDefault(_Ionicons);var _MaterialIcons=require('react-native-vector-icons/MaterialIcons');var _MaterialIcons2=_interopRequireDefault(_MaterialIcons);var _Zocial=require('react-native-vector-icons/Zocial');var _Zocial2=_interopRequireDefault(_Zocial);var _SimpleLineIcons=require('react-native-vector-icons/SimpleLineIcons');var _SimpleLineIcons2=_interopRequireDefault(_SimpleLineIcons);function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj};}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function");}}function _possibleConstructorReturn(self,call){if(!self){throw new ReferenceError("this hasn't been initialised - super() hasn't been called");}return call&&(typeof call==="object"||typeof call==="function")?call:self;}function _inherits(subClass,superClass){if(typeof superClass!=="function"&&superClass!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);}subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:false,writable:true,configurable:true}});if(superClass)Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass;}var ICON_SET_MAP={fontawesome:_FontAwesome2.default,foundation:_Foundation2.default,ion:_Ionicons2.default,material:_MaterialIcons2.default,zocial:_Zocial2.default,simpleline:_SimpleLineIcons2.default};var Icon=function(_PureComponent){_inherits(Icon,_PureComponent);function Icon(){var _ref;var _temp,_this,_ret;_classCallCheck(this,Icon);for(var _len=arguments.length,args=Array(_len),_key=0;_key<_len;_key++){args[_key]=arguments[_key];}return _ret=(_temp=(_this=_possibleConstructorReturn(this,(_ref=Icon.__proto__||Object.getPrototypeOf(Icon)).call.apply(_ref,[this].concat(args))),_this),_this.iconRef=null,_this.handleComponentRef=function(ref){_this.iconRef=ref;},_temp),_possibleConstructorReturn(_this,_ret);}_createClass(Icon,[{key:'setNativeProps',value:function setNativeProps(nativeProps){if(this.iconRef){this.iconRef.setNativeProps(nativeProps);}}},{key:'render',value:function render(){var nameParts=this.props.name.split('|');var setName=nameParts[0];var name=nameParts[1];var IconSet=ICON_SET_MAP[setName];if(!IconSet){throw new Error('Invalid icon set "'+setName+'"');}return _react2.default.createElement(IconSet,_extends({allowFontScaling:false,ref:this.handleComponentRef},this.props,{name:name,__source:{fileName:_jsxFileName,lineNumber:51}}));}}]);return Icon;}(_react.PureComponent);Icon.propTypes={name:_propTypes2.default.string.isRequired,size:_propTypes2.default.number,color:_propTypes2.default.string};exports.default=Icon; |
@@ -1,2 +0,2 @@ | ||
import React, { Component } from 'react'; | ||
import React, { PureComponent } from 'react'; | ||
import PropTypes from 'prop-types'; | ||
@@ -34,7 +34,7 @@ import { | ||
class Icon extends Component { | ||
class Icon extends PureComponent { | ||
static propTypes = { | ||
name: IconNamePropType, | ||
size: PropTypes.number, | ||
color: PropTypes.string, | ||
color: PropTypes.oneOfType([PropTypes.string, PropTypes.number]), | ||
children: PropTypes.node, | ||
@@ -41,0 +41,0 @@ style: PropTypes.any, // eslint-disable-line react/forbid-prop-types |
import isString from 'lodash/isString'; | ||
import omit from 'lodash/omit'; | ||
import pick from 'lodash/pick'; | ||
import React, { Component } from 'react'; | ||
import React, { PureComponent } from 'react'; | ||
import PropTypes from 'prop-types'; | ||
@@ -30,7 +30,10 @@ import { StyleSheet, Text, TouchableHighlight, View } from './react-native'; | ||
export default function createIconButtonComponent(Icon) { | ||
return class IconButton extends Component { | ||
return class IconButton extends PureComponent { | ||
static propTypes = { | ||
backgroundColor: PropTypes.string, | ||
backgroundColor: PropTypes.oneOfType([ | ||
PropTypes.string, | ||
PropTypes.number, | ||
]), | ||
borderRadius: PropTypes.number, | ||
color: PropTypes.string, | ||
color: PropTypes.oneOfType([PropTypes.string, PropTypes.number]), | ||
size: PropTypes.number, | ||
@@ -37,0 +40,0 @@ iconStyle: PropTypes.any, // eslint-disable-line react/forbid-prop-types |
/* eslint-disable react/no-unused-prop-types */ | ||
import isEqual from 'lodash/isEqual'; | ||
import pick from 'lodash/pick'; | ||
import React, { Component } from 'react'; | ||
import React, { PureComponent } from 'react'; | ||
import PropTypes from 'prop-types'; | ||
@@ -12,3 +12,3 @@ import { TabBarIOS } from './react-native'; | ||
) { | ||
return class TabBarItemIOS extends Component { | ||
return class TabBarItemIOS extends PureComponent { | ||
static propTypes = { | ||
@@ -18,4 +18,7 @@ iconName: IconNamePropType.isRequired, | ||
iconSize: PropTypes.number, | ||
iconColor: PropTypes.string, | ||
selectedIconColor: PropTypes.string, | ||
iconColor: PropTypes.oneOfType([PropTypes.string, PropTypes.number]), | ||
selectedIconColor: PropTypes.oneOfType([ | ||
PropTypes.string, | ||
PropTypes.number, | ||
]), | ||
}; | ||
@@ -22,0 +25,0 @@ |
/* eslint-disable react/no-unused-prop-types */ | ||
import isEqual from 'lodash/isEqual'; | ||
import pick from 'lodash/pick'; | ||
import React, { Component } from 'react'; | ||
import React, { PureComponent } from 'react'; | ||
import PropTypes from 'prop-types'; | ||
@@ -12,3 +12,3 @@ import { ToolbarAndroid } from './react-native'; | ||
) { | ||
return class IconToolbarAndroid extends Component { | ||
return class IconToolbarAndroid extends PureComponent { | ||
static propTypes = { | ||
@@ -23,3 +23,3 @@ logoName: IconNamePropType, | ||
iconSize: PropTypes.number, | ||
iconColor: PropTypes.string, | ||
iconColor: PropTypes.oneOfType([PropTypes.string, PropTypes.number]), | ||
show: PropTypes.oneOf(['always', 'ifRoom', 'never']), | ||
@@ -30,3 +30,3 @@ showWithText: PropTypes.bool, | ||
iconSize: PropTypes.number, | ||
iconColor: PropTypes.string, | ||
iconColor: PropTypes.oneOfType([PropTypes.string, PropTypes.number]), | ||
}; | ||
@@ -33,0 +33,0 @@ |
{ | ||
"name": "react-native-vector-icons", | ||
"version": "4.4.2", | ||
"version": "4.4.3", | ||
"description": "Customizable Icons for React Native with support for NavBar/TabBar/ToolbarAndroid, image source and full styling.", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -264,3 +264,3 @@ ![Vector Icons for React Native](https://cloud.githubusercontent.com/assets/378279/12009887/33f4ae1c-ac8d-11e5-8666-7a87458753ee.png) | ||
|**`size`**|Icon size.|`20`| | ||
|**`iconStyle`**|Styles applied to the icon only, good for setting margins or a different color.|`{marginRight: 10}`| | ||
|**`iconStyle`**|Styles applied to the icon only, good for setting margins or a different color. *Note: use `iconStyle` for margins or expect unstable behaviour.*|`{marginRight: 10}`| | ||
|**`backgroundColor`**|Background color of the button.|`#007AFF`| | ||
@@ -267,0 +267,0 @@ |**`borderRadius`**|Border radius of the button, set to `0` to disable. |`5`| |
@@ -1,2 +0,2 @@ | ||
import React from 'react'; | ||
import React, { PureComponent } from 'react'; | ||
import PropTypes from 'prop-types'; | ||
@@ -21,3 +21,3 @@ import FontAwesome from 'react-native-vector-icons/FontAwesome'; | ||
// react-native-icons module. Please don't use this component for new apps/views. | ||
export default class Icon extends React.Component { | ||
export default class Icon extends PureComponent { | ||
static propTypes = { | ||
@@ -24,0 +24,0 @@ name: PropTypes.string.isRequired, |
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
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
1584937
13139
103