Liferay.Loader.define("segments-web@3.0.68/js/components/inputs/DateInput.es",["module","exports","require","liferay!frontend-js-react-web$prop-types","liferay!frontend-js-react-web$react","../../utils/constants.es","../../utils/utils.es"],(function(e,t,a){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;r(a("liferay!frontend-js-react-web$prop-types"));var n=r(a("liferay!frontend-js-react-web$react")),s=a("../../utils/constants.es"),l=a("../../utils/utils.es");function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}class e extends n.default.Component{constructor(...e){super(...e),i(this,"state",{}),i(this,"_handleDateChange",(e=>{const t=e.target.value;this.setState({value:t})})),i(this,"_handleDateBlur",(e=>{const t=(0,l.jsDatetoYYYYMMDD)(e.target.value);"Invalid Date"!==t?this.setState({value:t},(()=>{this.props.onChange({type:s.PROPERTY_TYPES.DATE,value:t})})):this.setState({value:(0,l.jsDatetoYYYYMMDD)(new Date)},(()=>{this.props.onChange({type:s.PROPERTY_TYPES.DATE,value:(0,l.jsDatetoYYYYMMDD)(new Date)})}))}))}static getDerivedStateFromProps(e,t){let a=null;return e.value!==t.initialValue&&(a={initialValue:e.value,value:e.value}),a}render(){const{disabled:e}=this.props,{value:t}=this.state;return n.default.createElement("div",{className:"criterion-input date-input"},n.default.createElement("input",{className:"form-control","data-testid":"date-input",disabled:e,onBlur:this._handleDateBlur,onChange:this._handleDateChange,type:"date",value:t}))}}var u=e;t.default=u}}));
//# sourceMappingURL=DateInput.es.js.map