text: 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 _objectSpread2=_interopRequireDefault(require("@babel/runtime/helpers/objectSpread"));var _objectWithoutProperties2=_interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));var _classCallCheck2=_interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));var _createClass2=_interopRequireDefault(require("@babel/runtime/helpers/createClass"));var _possibleConstructorReturn2=_interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));var _getPrototypeOf3=_interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));var _inherits2=_interopRequireDefault(require("@babel/runtime/helpers/inherits"));var React=_interopRequireWildcard(require("react"));var _reactNative=require("react-native");var _color=_interopRequireDefault(require("color"));var _colors=require("../styles/colors");var _theming=require("../core/theming");var _jsxFileName="/Users/trensik/dev/react-native-paper/src/components/Badge.tsx";var defaultSize=20;var Badge=function(_React$Component){(0,_inherits2.default)(Badge,_React$Component);function Badge(){var _getPrototypeOf2;var _this;(0,_classCallCheck2.default)(this,Badge);for(var _len=arguments.length,args=new Array(_len),_key=0;_key<_len;_key++){args[_key]=arguments[_key];}_this=(0,_possibleConstructorReturn2.default)(this,(_getPrototypeOf2=(0,_getPrototypeOf3.default)(Badge)).call.apply(_getPrototypeOf2,[this].concat(args)));_this.state={opacity:new _reactNative.Animated.Value(_this.props.visible?1:0)};return _this;}(0,_createClass2.default)(Badge,[{key:"componentDidUpdate",value:function componentDidUpdate(prevProps){var visible=this.props.visible;if(visible!==prevProps.visible){_reactNative.Animated.timing(this.state.opacity,{toValue:visible?1:0,duration:150,useNativeDriver:true}).start();}}},{key:"render",value:function render(){var _this$props=this.props,children=_this$props.children,_this$props$size=_this$props.size,size=_this$props$size===void 0?defaultSize:_this$props$size,style=_this$props.style,theme=_this$props.theme;var opacity=this.state.opacity;var _ref=_reactNative.StyleSheet.flatten(style)||{},_ref$backgroundColor=_ref.backgroundColor,backgroundColor=_ref$backgroundColor===void 0?theme.colors.notification:_ref$backgroundColor,restStyle=(0,_objectWithoutProperties2.default)(_ref,["backgroundColor"]);var textColor=(0,_color.default)(backgroundColor).isLight()?_colors.black:_colors.white;var borderRadius=size/2;return React.createElement(_reactNative.Animated.Text,{numberOfLines:1,style:[(0,_objectSpread2.default)({opacity:opacity,backgroundColor:backgroundColor,color:textColor,fontSize:size*0.5},theme.fonts.regular,{lineHeight:size,height:size,minWidth:size,borderRadius:borderRadius}),styles.container,restStyle],__source:{fileName:_jsxFileName,lineNumber:89}},children);}}]);return Badge;}(React.Component);Badge.defaultProps={visible:true,size:defaultSize};var _default=(0,_theming.withTheme)(Badge);exports.default=_default;var styles=_reactNative.StyleSheet.create({container:{alignSelf:'flex-end',textAlign:'center',textAlignVertical:'center',paddingHorizontal:4,overflow:'hidden'}});
  //# sourceMappingURL=Badge.js.map