Liferay.Loader.define("segments-web@3.0.68/js/components/inputs/CollectionInput.es",["module","exports","require","liferay!frontend-js-react-web$prop-types","liferay!frontend-js-react-web$react"],(function(e,t,n){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;r(n("liferay!frontend-js-react-web$prop-types"));var a=r(n("liferay!frontend-js-react-web$react"));function r(e){return e&&e.__esModule?e:{default:e}}function l(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class e extends a.default.Component{constructor(...e){super(...e),l(this,"_handleKeyChange",(e=>{const{value:t}=this._stringToKeyValueObject(this.props.value);this.props.onChange({value:"".concat(e.target.value,"=").concat(t)})})),l(this,"_handleValueChange",(e=>{const{key:t}=this._stringToKeyValueObject(this.props.value);this.props.onChange({value:"".concat(t,"=").concat(e.target.value)})})),l(this,"_handleKeyDown",(e=>{"="===e.key&&e.preventDefault()})),l(this,"_stringToKeyValueObject",(e=>{const[t="",n=""]="string"==typeof e?e.split("="):[];return{key:t,value:n}}))}render(){const{disabled:e}=this.props,{key:t,value:n}=this._stringToKeyValueObject(this.props.value);return a.default.createElement(a.default.Fragment,null,a.default.createElement("input",{className:"criterion-input form-control","data-testid":"collection-key-input",disabled:e,onChange:this._handleKeyChange,onKeyDown:this._handleKeyDown,placeholder:Liferay.Language.get("key"),type:"text",value:t}),a.default.createElement("input",{className:"criterion-input form-control","data-testid":"collection-value-input",disabled:e,onChange:this._handleValueChange,onKeyDown:this._handleKeyDown,placeholder:Liferay.Language.get("value"),type:"text",value:n}))}}var o=e;t.default=o}}));
//# sourceMappingURL=CollectionInput.es.js.map