Liferay.Loader.define("@liferay/object-js-components-web@1.0.58/components/Select/SingleSelect",["module","exports","require","@frontend-taglib-clay$clayui/drop-down","@frontend-taglib-clay$clayui/popover","liferay!frontend-js-react-web$react","./BaseSelect","./index.scss"],(function(e,t,r){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.SingleSelect=function SingleSelect(e){let{onChange:t=(()=>{}),options:r,children:i}=e,c=function _objectWithoutProperties(e,t){if(null==e)return{};var r,n,o=function _objectWithoutPropertiesLoose(e,t){if(null==e)return{};var r,n,o={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}(e,["onChange","options","children"]);const[u,d]=(0,l.useState)(!1),s=l.Children.toArray(i),[f,p]=(0,l.useState)(!1);return(0,l.useEffect)((()=>{u||p(!1)}),[u]),l.default.createElement(a.BaseSelect,_extends({dropdownActive:u,setDropdownActive:d},c),r.map(((e,r)=>{var a,i,u,y;let b={};return e.popover&&(b={onMouseOut:()=>p(!1),onMouseOver:()=>p(!0)}),l.default.createElement(l.Fragment,{key:null!==(a=null!==(i=e.name)&&void 0!==i?i:e.value)&&void 0!==a?a:r},l.default.createElement(o.default,{alignPosition:"right",disableScroll:!1,header:null===(u=e.popover)||void 0===u?void 0:u.header,onShowChange:p,show:f&&!!Object.keys(b).length,trigger:l.default.createElement(n.default.Item,_extends({},b,{active:e.label===c.value,className:e.type?"lfr-object__single-select--with-label":"",disabled:e.disabled,key:r,onClick:()=>{d(!1),t(e)}}),l.default.createElement("div",null,e.label),e.description&&l.default.createElement("span",{className:"text-small"},e.description),null==s?void 0:s[r])},null===(y=e.popover)||void 0===y?void 0:y.body))})))};var n=_interopRequireDefault(r("@frontend-taglib-clay$clayui/drop-down")),o=_interopRequireDefault(r("@frontend-taglib-clay$clayui/popover")),l=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 r={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var l=n?Object.getOwnPropertyDescriptor(e,o):null;l&&(l.get||l.set)?Object.defineProperty(r,o,l):r[o]=e[o]}r.default=e,t&&t.set(e,r);return r}(r("liferay!frontend-js-react-web$react")),a=r("./BaseSelect");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}}function _extends(){return(_extends=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}r("./index.scss")}}));
//# sourceMappingURL=SingleSelect.js.map