"use strict";var _interopRequireWildcard=require("@babel/runtime/helpers/interopRequireWildcard"),_interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.defaultProps=exports.propTypes=void 0;var _extends2=_interopRequireDefault(require("@babel/runtime/helpers/extends")),_objectWithoutProperties2=_interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties")),_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")),_objectSpread2=_interopRequireDefault(require("@babel/runtime/helpers/objectSpread")),_react=_interopRequireWildcard(require("react")),_propTypes=_interopRequireDefault(require("prop-types")),_Input=_interopRequireDefault(require("../input/Input")),_reactTextMask=_interopRequireDefault(require("react-text-mask")),renderProps={on_change:null,on_submit:null,on_focus:null,on_blur:null,on_submit_focus:null,on_submit_blur:null},propTypes={mask:_propTypes.default.oneOfType([_propTypes.default.array,_propTypes.default.func]),show_mask:_propTypes.default.oneOfType([_propTypes.default.string,_propTypes.default.bool]),guide:_propTypes.default.bool,pipe:_propTypes.default.func,keep_char_positions:_propTypes.default.bool,placeholder_char:_propTypes.default.string};exports.propTypes=propTypes;var defaultProps=(0,_objectSpread2.default)({mask:[],show_mask:!1,guide:!0,pipe:null,keep_char_positions:!1,placeholder_char:"_"},renderProps);exports.defaultProps=defaultProps;var InputMasked=function(e){function r(e){return(0,_classCallCheck2.default)(this,r),(0,_possibleConstructorReturn2.default)(this,(0,_getPrototypeOf2.default)(r).call(this,e))}return(0,_inherits2.default)(r,e),(0,_createClass2.default)(r,[{key:"render",value:function(){var e=this.props,t=e.mask,p=e.show_mask,u=e.guide,a=e.pipe,o=e.keep_char_positions,s=e.placeholder_char,r=(0,_objectWithoutProperties2.default)(e,["mask","show_mask","guide","pipe","keep_char_positions","placeholder_char"]);return r.inputElement||(r.inputElement=function(e,r){return e=(0,_objectSpread2.default)({},e,{mask:t,guide:u,pipe:a,showMask:Boolean(p),keepCharPositions:o,placeholderChar:s}),_react.default.createElement(_reactTextMask.default,(0,_extends2.default)({ref:r},e))}),_react.default.createElement(_Input.default,(0,_extends2.default)({className:"dnb-input-masked"},r))}}]),r}(_react.PureComponent);exports.default=InputMasked,(0,_defineProperty2.default)(InputMasked,"defaultProps",defaultProps),(0,_defineProperty2.default)(InputMasked,"renderProps",renderProps),InputMasked.propTypes="production"!==process.env.NODE_ENV?propTypes:{};
//# sourceMappingURL=InputMasked.js.map
