Liferay.Loader.define("dynamic-data-mapping-form-field-type@6.0.124/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=_interopRequireDefault(l("@frontend-taglib-clay$clayui/icon")),n=_interopRequireDefault(l("@frontend-taglib-clay$clayui/label")),r=_interopRequireDefault(l("liferay!frontend-js-react-web$classnames")),o=function _interopRequireWildcard(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=_getRequireWildcardCache();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 _getRequireWildcardCache(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return _getRequireWildcardCache=function _getRequireWildcardCache(){return e},e}function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}const LabelOptionListItem=({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)),OptionSelected=({isPlaceholder:e,label:t})=>o.default.createElement("div",{className:(0,r.default)("option-selected",{"option-selected-placeholder":e})},t);var i=(0,o.forwardRef)((({className:e,id:t,multiple:l,onClick:n,onCloseButtonClicked:i,onKeyDown:c,options:u,readOnly:d,value:f},s)=>{const p=l?Liferay.Language.get("choose-options"):Liferay.Language.get("choose-an-option"),m=!f.length;return o.default.createElement("div",{className:(0,r.default)(e,"form-builder-select-field input-group-container","lfr__ddm-select-input-trigger"),onClick:n,onKeyDown:c,ref:s},o.default.createElement("div",{className:(0,r.default)("form-control results-chosen select-field-trigger",{disabled:d,"multiple-label-list":l}),disabled:d,id:t,tabIndex:"0"},m||1===f.length&&!l?o.default.createElement(OptionSelected,{isPlaceholder:m,label:(()=>{if(m)return p;const e=u.find((e=>e.value===f[0]));return e?e.label:p})()}):o.default.createElement(o.default.Fragment,null,f.map((e=>{const t=u.find((t=>t.value===e));return o.default.createElement(o.default.Fragment,null,t&&o.default.createElement(LabelOptionListItem,{key:"".concat(t.value,"-").concat(t.label),onCloseButtonClicked:i,option:t,readOnly:d}))}))),o.default.createElement("div",{className:"lfr__ddm-form-field-type-select-arrow-down"},o.default.createElement("a",{className:"select-arrow-down-container"},o.default.createElement(a.default,{symbol:"caret-double"})))))}));t.default=i}}));
//# sourceMappingURL=VisibleSelectInput.es.js.map