Liferay.Loader.define("segments-web@3.0.77/js/components/inputs/CollectionInput.es",["module","exports","require","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;_interopRequireDefault(a("liferay!frontend-js-react-web$prop-types"));var n=_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 CollectionInput extends n.default.Component{constructor(...e){super(...e),_defineProperty(this,"_handleKeyChange",(e=>{const{value:t}=this._stringToKeyValueObject(this.props.value);this.props.onChange({value:"".concat(e.target.value,"=").concat(t)})})),_defineProperty(this,"_handleValueChange",(e=>{const{key:t}=this._stringToKeyValueObject(this.props.value);this.props.onChange({value:"".concat(t,"=").concat(e.target.value)})})),_defineProperty(this,"_handleKeyDown",(e=>{"="===e.key&&e.preventDefault()})),_defineProperty(this,"_stringToKeyValueObject",(e=>{const[t="",a=""]="string"==typeof e?e.split("="):[];return{key:t,value:a}}))}render(){const{disabled:e,propertyLabel:t}=this.props,{key:a,value:r}=this._stringToKeyValueObject(this.props.value);return n.default.createElement(n.default.Fragment,null,n.default.createElement("input",{"aria-label":"".concat(t,": ").concat(Liferay.Language.get("input-a-key")),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:a}),n.default.createElement("input",{"aria-label":"".concat(t,": ").concat(Liferay.Language.get("input-a-value")),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:r}))}}var r=CollectionInput;t.default=r}}));
//# sourceMappingURL=CollectionInput.es.js.map