Liferay.Loader.define("dynamic-data-mapping-form-field-type@6.0.108/Select/VisibleSelectInput.es",["module","exports","require","./VisibleSelectInput.scss","@frontend-taglib-clay$clayui/icon","@frontend-taglib-clay$clayui/label","liferay!frontend-js-react-web$classnames","liferay!frontend-js-react-web$react"],(function(e,t,l){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,l("./VisibleSelectInput.scss");var a=i(l("@frontend-taglib-clay$clayui/icon")),n=i(l("@frontend-taglib-clay$clayui/label")),r=i(l("liferay!frontend-js-react-web$classnames")),o=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=c();if(t&&t.has(e))return t.get(e);var l={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var r=a?Object.getOwnPropertyDescriptor(e,n):null;r&&(r.get||r.set)?Object.defineProperty(l,n,r):l[n]=e[n]}l.default=e,t&&t.set(e,l);return l}(l("liferay!frontend-js-react-web$react"));function c(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return c=function(){return e},e}function i(e){return e&&e.__esModule?e:{default:e}}const e=({onCloseButtonClicked:e,option:t,readOnly:l})=>o.default.createElement("li",null,o.default.createElement(n.default,{className:"ddm-select-option-label",closeButtonProps:{"data-testid":"closeButton".concat(t.value),onClick:l=>{l.preventDefault(),l.stopPropagation(),e({event:l,value:t.value})}},value:t.value,withClose:!l},t.label)),d=({isPlaceholder:e,label:t})=>o.default.createElement("div",{className:(0,r.default)("option-selected",{"option-selected-placeholder":e})},t);var u=(0,o.forwardRef)((({className:t,id:l,multiple:n,onClick:c,onCloseButtonClicked:i,onKeyDown:u,options:s,readOnly:f,value:p},y)=>{const b=n?Liferay.Language.get("choose-options"):Liferay.Language.get("choose-an-option"),m=!p.length;return o.default.createElement("div",{className:(0,r.default)(t,"form-builder-select-field input-group-container"),onClick:c,onKeyDown:u,ref:y},o.default.createElement("div",{className:(0,r.default)("form-control results-chosen select-field-trigger",{disabled:f,"multiple-label-list":n}),disabled:f,id:l,tabIndex:"0"},m||1===p.length&&!n?o.default.createElement(d,{isPlaceholder:m,label:(()=>{if(m)return b;const e=s.find((e=>e.value===p[0]));return e?e.label:b})()}):p.map((t=>{const l=s.find((e=>e.value===t));return o.default.createElement(o.default.Fragment,null,l&&o.default.createElement(e,{key:"".concat(l.value,"-").concat(l.label),onCloseButtonClicked:i,option:l,readOnly:f}))})),o.default.createElement("a",{className:"select-arrow-down-container"},o.default.createElement(a.default,{symbol:"caret-double"}))))}));t.default=u}}));
//# sourceMappingURL=VisibleSelectInput.es.js.map