Liferay.Loader.define("segments-web@3.0.68/js/components/inputs/SelectEntityInput.es",["module","exports","require","@frontend-taglib-clay$clayui/button","liferay!frontend-js-react-web$classnames","frontend-js-web","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;var a=u(n("@frontend-taglib-clay$clayui/button")),r=u(n("liferay!frontend-js-react-web$classnames")),l=n("frontend-js-web"),i=(u(n("liferay!frontend-js-react-web$prop-types")),u(n("liferay!frontend-js-react-web$react")));function u(e){return e&&e.__esModule?e:{default:e}}class e extends i.default.Component{constructor(...e){var t,n,a;super(...e),a=()=>{const{onChange:e,selectEntity:{id:t,multiple:n,title:a,uri:r}}=this.props;n?(0,l.openSelectionModal)({buttonAddLabel:Liferay.Language.get("select"),multiple:!0,onSelect:t=>{if(t){const n=t.map((e=>({displayValue:e.name,value:e.id})));e(n)}},selectEventName:t,title:a,url:r}):(0,l.openSelectionModal)({onSelect:t=>{e({displayValue:t.entityname,value:t.entityid})},selectEventName:t,title:a,url:r})},(n="_handleSelectEntity")in(t=this)?Object.defineProperty(t,n,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[n]=a}render(){const{disabled:e,displayValue:t,renderEmptyValueErrors:n,value:l}=this.props;return i.default.createElement("div",{className:"criterion-input input-group select-entity-input"},i.default.createElement("div",{className:"input-group-item input-group-prepend"},i.default.createElement("input",{"data-testid":"entity-select-input",disabled:e,type:"hidden",value:l}),i.default.createElement("input",{className:(0,r.default)("form-control",{"criterion-input--error":!l&&n}),disabled:e,readOnly:!0,value:t})),i.default.createElement("span",{className:"input-group-append input-group-item input-group-item-shrink"},i.default.createElement(a.default,{className:(0,r.default)("input-group-append input-group-item input-group-item-shrink",{"criterion-input--error":!l&&n}),disabled:e,displayType:"secondary",onClick:this._handleSelectEntity},Liferay.Language.get("select"))))}}var s=e;t.default=s}}));
//# sourceMappingURL=SelectEntityInput.es.js.map