Liferay.Loader.define("@liferay/search-experiences-web@3.0.7/sxp_blueprint_admin/js/shared/sxp_element/ItemSelectorInput",["module","exports","require","@frontend-taglib-clay$clayui/button","@frontend-taglib-clay$clayui/form","@frontend-taglib-clay$clayui/icon","frontend-js-web","liferay!frontend-js-react-web$react"],(function(e,t,l){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=d(l("@frontend-taglib-clay$clayui/button")),n=l("@frontend-taglib-clay$clayui/form"),i=d(l("@frontend-taglib-clay$clayui/icon")),r=l("frontend-js-web"),u=d(l("liferay!frontend-js-react-web$react"));function d(e){return e&&e.__esModule?e:{default:e}}var c=function({disabled:e,entityJSON:t,id:l,itemType:d,label:c,name:o,setFieldTouched:y,setFieldValue:f,value:s}){return u.default.createElement(n.ClayInput.Group,{onBlur:()=>y(o),small:!0},u.default.createElement(n.ClayInput.GroupItem,null,u.default.createElement(n.ClayInput,{"aria-label":c,disabled:e,id:l,name:o,onKeyDown:e=>{"Enter"===e.key&&e.preventDefault()},readOnly:!0,type:"text",value:s&&s.length>0?s.map((e=>e.label)).join(", "):""})),s&&s.length>0&&u.default.createElement(n.ClayInput.GroupItem,{shrink:!0},u.default.createElement(a.default,{"aria-label":Liferay.Language.get("delete"),className:"component-action",disabled:e,displayType:"unstyled",onClick:()=>f(o,[])},u.default.createElement(i.default,{symbol:"times-circle"}))),u.default.createElement(n.ClayInput.GroupItem,{shrink:!0},u.default.createElement(a.default,{"aria-label":Liferay.Language.get("select"),disabled:e||!t,displayType:"secondary",onClick:()=>{t&&(e=>{t[e].multiple?(0,r.openSelectionModal)({buttonAddLabel:Liferay.Language.get("select"),multiple:!0,onSelect:e=>{e&&f(o,e.map((e=>({label:e.name,value:e.id}))))},selectEventName:"selectEntity",title:t[e].title,url:t[e].url}):(0,r.openSelectionModal)({buttonAddLabel:Liferay.Language.get("select"),onSelect:e=>{f(o,[{label:e.entityname,value:e.entityid}])},selectEventName:"selectEntity",title:t[e].title,url:t[e].url})})(d)},small:!0},Liferay.Language.get("select"))))};t.default=c}}));
//# sourceMappingURL=ItemSelectorInput.js.map