Liferay.Loader.define("segments-web@3.0.77/js/components/inputs/DecimalInput.es",["module","exports","require","@frontend-taglib-clay$clayui/form","liferay!frontend-js-react-web$prop-types","liferay!frontend-js-react-web$react"],(function(e,t,a){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=a("@frontend-taglib-clay$clayui/form"),r=(_interopRequireDefault(a("liferay!frontend-js-react-web$prop-types")),_interopRequireDefault(a("liferay!frontend-js-react-web$react")));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _defineProperty(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}class DecimalInput extends r.default.Component{constructor(...e){super(...e),_defineProperty(this,"_handleDecimalBlur",(e=>{const t=Number.parseFloat(e.target.value).toFixed(2);this.props.onChange({value:t})})),_defineProperty(this,"_handleDecimalChange",(e=>{this.props.onChange({value:e.target.value})}))}render(){const{disabled:e,options:t,propertyLabel:a,value:l}=this.props;return t.length?r.default.createElement(n.ClaySelectWithOption,{className:"criterion-input form-control","data-testid":"options-decimal",disabled:e,onChange:this._handleDecimalChange,options:t.map((e=>({disabled:e.disabled,label:e.label,value:e.value}))),value:l}):r.default.createElement("input",{"aria-label":"".concat(a,": ").concat(Liferay.Language.get("input-a-value")),className:"criterion-input form-control","data-testid":"decimal-number",disabled:e,onBlur:this._handleDecimalBlur,onChange:this._handleDecimalChange,step:"0.01",type:"number",value:l})}}_defineProperty(DecimalInput,"defaultProps",{options:[]});var l=DecimalInput;t.default=l}}));
//# sourceMappingURL=DecimalInput.es.js.map