Liferay.Loader.define("@liferay/search-experiences-web@3.0.30/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=_interopRequireDefault(l("@frontend-taglib-clay$clayui/button")),n=l("@frontend-taglib-clay$clayui/form"),i=_interopRequireDefault(l("@frontend-taglib-clay$clayui/icon")),r=l("frontend-js-web"),u=_interopRequireDefault(l("liferay!frontend-js-react-web$react"));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}var d=function ItemSelectorInput({disabled:e,entityJSON:t,id:l,itemType:d,label:o,name:c,setFieldTouched:f,setFieldValue:y,value:s}){return u.default.createElement(n.ClayInput.Group,{onBlur:()=>f(c),small:!0},u.default.createElement(n.ClayInput.GroupItem,null,u.default.createElement(n.ClayInput,{"aria-label":o,disabled:e,id:l,name:c,onKeyDown:e=>{"Enter"===e.key&&e.preventDefault()},readOnly:!0,type:"text",value:s&&s.length?s.map((e=>e.label)).join(", "):""})),s&&!!s.length&&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:()=>y(c,[])},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&&y(c,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=>{y(c,[{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=d}}));
//# sourceMappingURL=ItemSelectorInput.js.map