"use strict";var _interopRequireWildcard=require("@babel/runtime/helpers/interopRequireWildcard"),_interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _classCallCheck2=_interopRequireDefault(require("@babel/runtime/helpers/classCallCheck")),_createClass2=_interopRequireDefault(require("@babel/runtime/helpers/createClass")),_possibleConstructorReturn2=_interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn")),_getPrototypeOf2=_interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf")),_inherits2=_interopRequireDefault(require("@babel/runtime/helpers/inherits")),_defineProperty2=_interopRequireDefault(require("@babel/runtime/helpers/defineProperty")),React=_interopRequireWildcard(require("react")),_propTypes=_interopRequireDefault(require("prop-types")),_classnames=_interopRequireDefault(require("classnames")),_lodash=_interopRequireDefault(require("lodash")),_withStyles=_interopRequireDefault(require("../../hoc/withStyles")),_ErrorBoundary=_interopRequireDefault(require("../../hoc/ErrorBoundary")),_styles=_interopRequireDefault(require("./styles")),LinearProgressBar=/*#__PURE__*/function(_React$Component){function LinearProgressBar(){return(0,_classCallCheck2.default)(this,LinearProgressBar),(0,_possibleConstructorReturn2.default)(this,(0,_getPrototypeOf2.default)(LinearProgressBar).apply(this,arguments))}return(0,_inherits2.default)(LinearProgressBar,_React$Component),(0,_createClass2.default)(LinearProgressBar,[{key:"_renderProgressBar",value:function _renderProgressBar(){var _this$props=this.props,classes=_this$props.classes,showParts=_this$props.showParts;return React.createElement("div",{className:classes.progressBar},React.createElement("div",{className:classes.filledBar}),showParts&&React.createElement("div",{className:classes.parts},_lodash.default.range(0,10).map(function(index){return React.createElement("div",{key:index,className:(0,_classnames.default)(classes.part,{hide:0===index}),style:{left:"".concat(10*index,"%")}})})))}},{key:"render",value:function render(){var _this$props2=this.props,classes=_this$props2.classes,label=_this$props2.label,showPercentage=_this$props2.showPercentage,value=_this$props2.value;return React.createElement(_ErrorBoundary.default,null,React.createElement("div",{className:classes.component},!!label&&React.createElement("div",{className:classes.label},label),this._renderProgressBar(),showPercentage&&React.createElement("div",{className:classes.percentage},value,"%")))}}]),LinearProgressBar}(React.Component);(0,_defineProperty2.default)(LinearProgressBar,"propTypes",{label:_propTypes.default.string,showPercentage:_propTypes.default.bool,showParts:_propTypes.default.bool,filledColor:_propTypes.default.string,unfilledColor:_propTypes.default.string,value:_propTypes.default.number,rounded:_propTypes.default.bool,width:_propTypes.default.number,classes:_propTypes.default.object}),(0,_defineProperty2.default)(LinearProgressBar,"defaultProps",{unfilledColor:"#f5f5f5",filledColor:"#2bc88f",showParts:!0,showPercentage:!0,rounded:!0,width:200});var _default=(0,_withStyles.default)(_styles.default)(LinearProgressBar);exports.default=_default;