Liferay.Loader.define("@liferay/object-js-components-web@1.0.58/components/Select/SelectWithOption",["module","exports","require","@frontend-taglib-clay$clayui/autocomplete","@frontend-taglib-clay$clayui/drop-down","@frontend-taglib-clay$clayui/icon","liferay!frontend-js-react-web$classnames","liferay!frontend-js-react-web$react","./index.scss","../FieldBase"],(function(e,t,a){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.SelectWithOption=function SelectWithOption({ariaLabel:e,className:t,disabled:a,error:u,feedbackMessage:d,id:f,items:s,label:p,onSelectChange:b,placeholder:y=Liferay.Language.get("choose-an-option"),required:g,tooltip:m,value:_}){const[h,v]=(0,o.useState)(!1),w=(0,o.useRef)(null);return o.default.createElement(c.FieldBase,{className:t,disabled:a,errorMessage:u,helpMessage:d,id:f,label:p,required:g,tooltip:m},o.default.createElement(o.default.Fragment,null,o.default.createElement(n.default,{className:(0,i.default)("base-select__input-icon",{"base-select__input-icon--disabled":a}),onClick:()=>!a&&v((e=>!e)),symbol:"caret-double"}),o.default.createElement(l.default.Input,{"aria-label":e,disabled:a,onClick:()=>v((e=>!e)),placeholder:y,ref:w,value:_})),o.default.createElement(r.default.Menu,{active:h,alignElementRef:w,alignmentByViewport:!0,onActiveChange:()=>v((e=>!e)),triggerRef:w},o.default.createElement(r.default.ItemList,{items:s},(e=>o.default.createElement(r.default.Group,{header:e.label,items:e.options,key:e.label},(e=>o.default.createElement(r.default.Item,{key:e.value,onClick:()=>{b(e.label,e.value),v(!1)}},e.label)))))))};var l=_interopRequireDefault(a("@frontend-taglib-clay$clayui/autocomplete")),r=_interopRequireDefault(a("@frontend-taglib-clay$clayui/drop-down")),n=_interopRequireDefault(a("@frontend-taglib-clay$clayui/icon")),i=_interopRequireDefault(a("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 a={},l=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){var n=l?Object.getOwnPropertyDescriptor(e,r):null;n&&(n.get||n.set)?Object.defineProperty(a,r,n):a[r]=e[r]}a.default=e,t&&t.set(e,a);return a}(a("liferay!frontend-js-react-web$react"));a("./index.scss");var c=a("../FieldBase");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}}}}));
//# sourceMappingURL=SelectWithOption.js.map