All Downloads are FREE. Search and download functionalities are using the official Maven repository.

theme.keycloak.v2.admin.resources.assets.Select-802cd710.js Maven / Gradle / Ivy

There is a newer version: 25.0.1
Show newest version
import{_ as q,r as e,aF as pt,X as H,n as dt,ak as C,bc as ht,k as p,bY as We,cy as ut,cz as he,ah as He,bx as Se,b$ as Fe,x as ze,b_ as Xe,B as qe,aj as ft,bA as we,bX as mt,cA as gt,cB as bt,bS as yt,bd as ke,V as j,cC as Ue,p as Ct,cn as Et,co as xt,be as Tt}from"./index-f33eb656.js";import{c as Re}from"./check-fc57dbe1.js";import{S as It}from"./star-icon-d7615f00.js";const Ye=g=>{var t=q(g,["children"]);return e.createElement(pt,Object.assign({},t))};Ye.displayName="ApplicationLauncherSeparator";const vt=(g,t,s,n)=>{if(t){const i=[];return g.forEach(r=>{if(s.length>0)return r.props.children&&r.props.children.filter(o=>s.includes(o.props.id)).map(o=>n?i.push(e.cloneElement(o,{isFavorite:!0,enterTriggersArrowDown:n,id:`favorite-${o.props.id}`})):i.push(e.cloneElement(o,{isFavorite:!0,id:`favorite-${o.props.id}`})))}),i}return g.filter(i=>s.includes(i.props.id)).map(i=>e.cloneElement(i,{isFavorite:!0,enterTriggersArrowDown:n}))},kt=(g,t,s)=>t?g.map(n=>e.cloneElement(n,{children:e.Children.map(n.props.children,i=>i.type===Ye||i.type===H?i:e.cloneElement(i,{isFavorite:s.some(r=>r===i.props.id||`favorite-${r}`===i.props.id)}))})):g.map(n=>e.cloneElement(n,{isFavorite:s.some(i=>i===n.props.id)}));const a={check:"pf-c-check",checkLabel:"pf-c-check__label",chipGroup:"pf-c-chip-group",divider:"pf-c-divider",formControl:"pf-c-form-control",modifiers:{invalid:"pf-m-invalid",success:"pf-m-success",warning:"pf-m-warning",disabled:"pf-m-disabled",active:"pf-m-active",expanded:"pf-m-expanded",plain:"pf-m-plain",typeahead:"pf-m-typeahead",placeholder:"pf-m-placeholder",top:"pf-m-top",alignRight:"pf-m-align-right",static:"pf-m-static",favorite:"pf-m-favorite",favoriteAction:"pf-m-favorite-action",focus:"pf-m-focus",link:"pf-m-link",action:"pf-m-action",selected:"pf-m-selected",description:"pf-m-description",load:"pf-m-load",loading:"pf-m-loading"},select:"pf-c-select",selectListItem:"pf-c-select__list-item",selectMenu:"pf-c-select__menu",selectMenuFieldset:"pf-c-select__menu-fieldset",selectMenuFooter:"pf-c-select__menu-footer",selectMenuGroup:"pf-c-select__menu-group",selectMenuGroupTitle:"pf-c-select__menu-group-title",selectMenuItem:"pf-c-select__menu-item",selectMenuItemActionIcon:"pf-c-select__menu-item-action-icon",selectMenuItemCount:"pf-c-select__menu-item-count",selectMenuItemDescription:"pf-c-select__menu-item-description",selectMenuItemIcon:"pf-c-select__menu-item-icon",selectMenuItemMain:"pf-c-select__menu-item-main",selectMenuItemMatch:"pf-c-select__menu-item--match",selectMenuItemRow:"pf-c-select__menu-item-row",selectMenuItemText:"pf-c-select__menu-item-text",selectMenuSearch:"pf-c-select__menu-search",selectMenuWrapper:"pf-c-select__menu-wrapper",selectToggle:"pf-c-select__toggle",selectToggleArrow:"pf-c-select__toggle-arrow",selectToggleBadge:"pf-c-select__toggle-badge",selectToggleButton:"pf-c-select__toggle-button",selectToggleClear:"pf-c-select__toggle-clear",selectToggleIcon:"pf-c-select__toggle-icon",selectToggleStatusIcon:"pf-c-select__toggle-status-icon",selectToggleText:"pf-c-select__toggle-text",selectToggleTypeahead:"pf-c-select__toggle-typeahead",selectToggleWrapper:"pf-c-select__toggle-wrapper",themeDark:"pf-theme-dark"},Rt={name:"TimesCircleIcon",height:512,width:512,svgPath:"M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm121.6 313.1c4.7 4.7 4.7 12.3 0 17L338 377.6c-4.7 4.7-12.3 4.7-17 0L256 312l-65.1 65.6c-4.7 4.7-12.3 4.7-17 0L134.4 338c-4.7-4.7-4.7-12.3 0-17l65.6-65-65.6-65.1c-4.7-4.7-4.7-12.3 0-17l39.6-39.6c4.7-4.7 12.3-4.7 17 0l65 65.7 65.1-65.6c4.7-4.7 12.3-4.7 17 0l39.6 39.6c4.7 4.7 4.7 12.3 0 17L312 256l65.6 65.1z",yOffset:0,xOffset:0},Ft=dt(Rt),Je=Ft,Me=e.createContext(null);Me.Provider;const Ae=Me.Consumer;var m;(function(g){g.single="single",g.checkbox="checkbox",g.typeahead="typeahead",g.typeaheadMulti="typeaheadmulti"})(m||(m={}));var fe;(function(g){g.right="right",g.left="left"})(fe||(fe={}));var me;(function(g){g.up="up",g.down="down"})(me||(me={}));const ue="input, button, select, textarea, a[href]";class X extends e.Component{constructor(){super(...arguments),this.ref=e.createRef(),this.liRef=e.createRef(),this.favoriteRef=e.createRef(),this.onKeyDown=(t,s,n,i)=>{const{index:r,keyHandler:o,isLastOptionBeforeFooter:c}=this.props;let h=!1;c!==void 0&&(h=c(r)),t.key===C.Tab&&(i&&!h?(t.shiftKey?o(r,s,"up"):o(r,s,"down"),t.stopPropagation()):t.shiftKey?o(r,s,"up"):o(r,s,"tab")),t.preventDefault(),t.key===C.ArrowUp?o(r,s,"up"):t.key===C.ArrowDown?o(r,s,"down"):t.key===C.ArrowLeft?o(r,s,"left"):t.key===C.ArrowRight?o(r,s,"right"):t.key===C.Enter&&(n!==void 0?n():this.ref.current.click())}}componentDidMount(){this.props.sendRef(this.props.isDisabled?null:this.ref.current,this.props.isDisabled?null:this.favoriteRef.current,this.props.isDisabled?null:this.liRef.current,this.props.index)}componentDidUpdate(){this.props.sendRef(this.props.isDisabled?null:this.ref.current,this.props.isDisabled?null:this.favoriteRef.current,this.props.isDisabled?null:this.liRef.current,this.props.index)}render(){const t=this.props,{children:s,className:n,id:i,description:r,itemCount:o,value:c,onClick:h,isDisabled:l,isPlaceholder:d,isNoResultsOption:u,isSelected:b,isChecked:I,isFocused:y,sendRef:v,keyHandler:k,index:f,component:O,inputId:R,isFavorite:N,ariaIsFavoriteLabel:w="starred",ariaIsNotFavoriteLabel:L="not starred",isLoad:S,isLoading:M,setViewMoreNextIndex:te,isLastOptionBeforeFooter:G,isGrouped:A=!1}=t,D=q(t,["children","className","id","description","itemCount","value","onClick","isDisabled","isPlaceholder","isNoResultsOption","isSelected","isChecked","isFocused","sendRef","keyHandler","index","component","inputId","isFavorite","ariaIsFavoriteLabel","ariaIsNotFavoriteLabel","isLoad","isLoading","setViewMoreNextIndex","isLastOptionBeforeFooter","isGrouped"]),U=O;!i&&N!==null&&console.error("Please provide an id to use the favorites feature.");const P=i||ht("select-option"),K=V=>e.createElement("button",{className:p(a.selectMenuItem,a.modifiers.action,a.modifiers.favoriteAction),"aria-label":N?w:L,onClick:()=>{V(P.replace("favorite-",""),N)},onKeyDown:Q=>{this.onKeyDown(Q,1,()=>V(P.replace("favorite-",""),N))},ref:this.favoriteRef},e.createElement("span",{className:p(a.selectMenuItemActionIcon)},e.createElement(It,null))),J=o?e.createElement("span",{className:p(a.selectMenuItemRow)},e.createElement("span",{className:p(a.selectMenuItemText)},s||c&&c.toString&&c.toString()),e.createElement("span",{className:p(a.selectMenuItemCount)},o)):s||c.toString(),_=V=>{te(),h(V)},Oe=(V,Q,B,ae,oe,be)=>{if(B!==m.checkbox&&M&&A)return e.createElement("div",{role:"presentation",className:p(a.selectListItem,M&&a.modifiers.loading,n)},s);if(B!==m.checkbox&&S&&A)return e.createElement("div",null,e.createElement("button",Object.assign({},D,{role:"presentation",className:p(a.selectMenuItem,a.modifiers.load,n),onClick:E=>{_(E),E.stopPropagation()},ref:this.ref,type:"button"}),s||c.toString()));if(B!==m.checkbox)return e.createElement("li",{id:P,role:"presentation",className:p(M&&a.selectListItem,!M&&a.selectMenuWrapper,N&&a.modifiers.favorite,y&&a.modifiers.focus,M&&a.modifiers.loading),ref:this.liRef},M&&s,S&&!A&&e.createElement("button",Object.assign({},D,{className:p(a.selectMenuItem,a.modifiers.load,n),onClick:E=>{_(E),E.stopPropagation()},ref:this.ref,onKeyDown:E=>{this.onKeyDown(E,0)},type:"button"}),J),!M&&!S&&e.createElement(e.Fragment,null,e.createElement(U,Object.assign({},D,{className:p(a.selectMenuItem,S&&a.modifiers.load,b&&a.modifiers.selected,l&&a.modifiers.disabled,r&&a.modifiers.description,N!==null&&a.modifiers.link,n),onClick:E=>{l||(h(E),V(E,c,d),be&&Q())},role:"option","aria-selected":b||null,ref:this.ref,onKeyDown:E=>{this.onKeyDown(E,0)},type:"button"}),r&&e.createElement(e.Fragment,null,e.createElement("span",{className:p(a.selectMenuItemMain)},J,b&&e.createElement("span",{className:p(a.selectMenuItemIcon)},e.createElement(We,{"aria-hidden":!0}))),e.createElement("span",{className:p(a.selectMenuItemDescription)},r)),!r&&e.createElement(e.Fragment,null,J,b&&e.createElement("span",{className:p(a.selectMenuItemIcon)},e.createElement(We,{"aria-hidden":!0})))),N!==null&&i&&K(oe)));if(B===m.checkbox&&S)return e.createElement("button",{className:p(a.selectMenuItem,a.modifiers.load,y&&a.modifiers.focus,n),onKeyDown:E=>{this.onKeyDown(E,0,void 0,!0)},onClick:E=>{_(E),E.stopPropagation()},ref:this.ref},s||c&&c.toString&&c.toString());if(B===m.checkbox&&M)return e.createElement("div",{className:p(a.selectListItem,M&&a.modifiers.loading,n)},s);if(B===m.checkbox&&!u&&!M&&!S)return e.createElement("label",Object.assign({},D,{className:p(Re.check,a.selectMenuItem,l&&a.modifiers.disabled,r&&a.modifiers.description,n),onKeyDown:E=>{this.onKeyDown(E,0,void 0,!0)}}),e.createElement("input",{id:R||`${ae}-${c.toString()}`,className:p(Re.checkInput),type:"checkbox",onChange:E=>{l||(h(E),V(E,c))},ref:this.ref,checked:I||!1,disabled:l}),e.createElement("span",{className:p(Re.checkLabel,l&&a.modifiers.disabled)},J),r&&e.createElement("div",{className:p(Re.checkDescription)},r));if(B===m.checkbox&&u&&!M&&!S)return e.createElement("div",null,e.createElement(U,Object.assign({},D,{className:p(a.selectMenuItem,b&&a.modifiers.selected,l&&a.modifiers.disabled,n),role:"option","aria-selected":b||null,ref:this.ref,onKeyDown:E=>{this.onKeyDown(E,0,void 0,!0)},type:"button"}),J))};return e.createElement(Ae,null,({onSelect:V,onClose:Q,variant:B,inputIdPrefix:ae,onFavorite:oe,shouldResetOnSelect:be})=>e.createElement(e.Fragment,null,Oe(V,Q,B,ae,oe,be)))}}X.displayName="SelectOption";X.defaultProps={className:"",value:"",index:0,isDisabled:!1,isPlaceholder:!1,isSelected:!1,isChecked:!1,isNoResultsOption:!1,component:"button",onClick:()=>{},sendRef:()=>{},keyHandler:()=>{},inputId:"",isFavorite:null,isLoad:!1,isLoading:!1,setViewMoreNextIndex:()=>{},isLastOptionBeforeFooter:()=>!1};const Z=g=>{var{children:t=[],className:s="",label:n="",titleId:i=""}=g,r=q(g,["children","className","label","titleId"]);return e.createElement(Ae,null,({variant:o})=>e.createElement("div",Object.assign({},r,{className:p(a.selectMenuGroup,s)}),e.createElement("div",{className:p(a.selectMenuGroupTitle),id:i,"aria-hidden":!0},n),o===m.checkbox?t:e.createElement("ul",{role:"listbox"},t)))};Z.displayName="SelectGroup";class Le extends e.Component{extendChildren(t){const{children:s,hasInlineFilter:n,isGrouped:i}=this.props,r=s;let o=n?1:0;return i?e.Children.map(r,c=>c.type===Z?e.cloneElement(c,{titleId:c.props.label&&c.props.label.replace(/\W/g,"-"),children:e.Children.map(c.props.children,h=>this.cloneOption(h,o++,t))}):this.cloneOption(c,o++,t)):e.Children.map(r,c=>this.cloneOption(c,o++,t))}cloneOption(t,s,n){const{selected:i,sendRef:r,keyHandler:o}=this.props,c=this.checkForValue(t.props.value,i);return t.type===H?t:e.cloneElement(t,{inputId:`${n}-${s}`,isSelected:c,sendRef:r,keyHandler:o,index:s})}checkForValue(t,s){if(!s||!t)return!1;const n=typeof t!="string"&&t.toString&&t.compareTo;return Array.isArray(s)?n?s.some(i=>i.compareTo(t)):s.includes(t):n?s.compareTo(t):s===t}extendCheckboxChildren(t){const{isGrouped:s,checked:n,sendRef:i,keyHandler:r,hasInlineFilter:o,isLastOptionBeforeFooter:c}=this.props;let h=o?1:0;return s?e.Children.map(t,l=>l.type===H?l:l.type===X?e.cloneElement(l,{isChecked:this.checkForValue(l.props.value,n),sendRef:i,keyHandler:r,index:h++,isLastOptionBeforeFooter:c}):e.cloneElement(l,{titleId:l.props.label&&l.props.label.replace(/\W/g,"-"),children:l.props.children?e.createElement("fieldset",{"aria-labelledby":l.props.label&&l.props.label.replace(/\W/g,"-"),className:p(a.selectMenuFieldset)},e.Children.map(l.props.children,d=>d.type===H?d:e.cloneElement(d,{isChecked:this.checkForValue(d.props.value,n),sendRef:i,keyHandler:r,index:h++,isLastOptionBeforeFooter:c}))):null})):e.Children.map(t,l=>l.type===H?l:e.cloneElement(l,{isChecked:this.checkForValue(l.props.value,n),sendRef:i,keyHandler:r,index:h++,isLastOptionBeforeFooter:c}))}renderSelectMenu({variant:t,inputIdPrefix:s}){const n=this.props,{children:i,isCustomContent:r,className:o,isExpanded:c,openedOnEnter:h,selected:l,checked:d,isGrouped:u,position:b,sendRef:I,keyHandler:y,maxHeight:v,noResultsFoundText:k,createText:f,"aria-label":O,"aria-labelledby":R,hasInlineFilter:N,innerRef:w,footer:L,footerRef:S,isLastOptionBeforeFooter:M}=n,te=q(n,["children","isCustomContent","className","isExpanded","openedOnEnter","selected","checked","isGrouped","position","sendRef","keyHandler","maxHeight","noResultsFoundText","createText","aria-label","aria-labelledby","hasInlineFilter","innerRef","footer","footerRef","isLastOptionBeforeFooter"]);let G="div";const A=Object.assign({ref:w,className:p(L?"pf-c-select__menu-list":a.selectMenu,b===fe.right&&a.modifiers.alignRight,o)},v&&{style:{maxHeight:v,overflow:"auto"}}),D=()=>t===m.checkbox?this.extendCheckboxChildren(i):this.extendChildren(s);return r?A.children=i:N?e.Children.count(i)===0?A.children=e.createElement("fieldset",{className:p(a.selectMenuFieldset)}):A.children=e.createElement("fieldset",{"aria-label":O,"aria-labelledby":!O&&R||null,className:p(ut.formFieldset)},i.shift(),D()):(A.children=D(),u||(G="ul",A.role="listbox",A["aria-label"]=O,A["aria-labelledby"]=!O&&R||null)),e.createElement(e.Fragment,null,e.createElement(G,Object.assign({},A,te)),L&&e.createElement("div",{className:p(a.selectMenuFooter),ref:S},L))}render(){return e.createElement(Ae,null,t=>this.renderSelectMenu(t))}}Le.displayName="SelectMenu";Le.defaultProps={className:"",isExpanded:!1,isGrouped:!1,openedOnEnter:!1,selected:"",maxHeight:"",position:fe.left,sendRef:()=>{},keyHandler:()=>{},isCustomContent:!1,hasInlineFilter:!1,isLastOptionBeforeFooter:()=>{}};const Ot=e.forwardRef((g,t)=>e.createElement(Le,Object.assign({innerRef:t},g),g.children));class De extends e.Component{constructor(t){super(t),this.onDocClick=i=>{const{parentRef:r,menuRef:o,footerRef:c,isOpen:h,onToggle:l,onClose:d}=this.props,u=r&&r.current&&r.current.contains(i.target),b=o&&o.current&&o.current.contains&&o.current.contains(i.target),I=c&&c.current&&c.current.contains&&c.current.contains(i.target);h&&!(u||b||I)&&(l(!1,i),d())},this.handleGlobalKeys=i=>{const{parentRef:r,menuRef:o,hasFooter:c,footerRef:h,isOpen:l,variant:d,onToggle:u,onClose:b,moveFocusToLastMenuItem:I}=this.props,y=r&&r.current&&r.current.contains(i.target),v=o&&o.current&&o.current.contains&&o.current.contains(i.target);if(l&&i.key===C.Tab&&(d===m.typeahead||d===m.typeaheadMulti)){this.props.handleTypeaheadKeys("tab",i.shiftKey),i.preventDefault();return}if(l&&i.key===C.Tab&&c){const k=he(h,ue);if(k.length<=0){u(!1,i),b(),this.toggle.current.focus();return}else{const f=k.findIndex(O=>O===document.activeElement);if(f===-1)if(i.shiftKey)d!=="checkbox"&&(u(!1,i),b(),this.toggle.current.focus());else{k[0].focus();return}if(i.shiftKey){f===0&&(I(),i.preventDefault());return}f+1{const{isOpen:r,onToggle:o,variant:c,onClose:h,onEnter:l,handleTypeaheadKeys:d}=this.props;(c===m.typeahead||c===m.typeaheadMulti)&&(i.key===C.ArrowDown||i.key===C.ArrowUp?(d(i.key===C.ArrowDown&&"down"||i.key===C.ArrowUp&&"up"),i.preventDefault()):i.key===C.Enter&&(r?d("enter"):o(!r,i))),!(c===m.typeahead||c===m.typeaheadMulti||i.key===C.Tab&&!r||i.key!==C.Enter&&i.key!==C.Space)&&(i.preventDefault(),(i.key===C.Tab||i.key===C.Enter||i.key===C.Space)&&r?(o(!r,i),h(),this.toggle.current.focus()):(i.key===C.Enter||i.key===C.Space)&&!r&&(o(!r,i),l()))};const{variant:s}=t,n=s===m.typeahead||s===m.typeaheadMulti;this.props.innerRef?this.toggle=this.props.innerRef:this.toggle=n?e.createRef():e.createRef()}componentDidMount(){document.addEventListener("click",this.onDocClick,{capture:!0}),document.addEventListener("touchstart",this.onDocClick),document.addEventListener("keydown",this.handleGlobalKeys)}componentWillUnmount(){document.removeEventListener("click",this.onDocClick),document.removeEventListener("touchstart",this.onDocClick),document.removeEventListener("keydown",this.handleGlobalKeys)}render(){const t=this.props,{className:s,children:n,isOpen:i,isActive:r,isPlain:o,isDisabled:c,hasPlaceholderStyle:h,variant:l,onToggle:d,onEnter:u,onClose:b,onBlur:I,onClickTypeaheadToggleButton:y,handleTypeaheadKeys:v,moveFocusToLastMenuItem:k,parentRef:f,menuRef:O,id:R,type:N,hasClearButton:w,"aria-labelledby":L,"aria-label":S,hasFooter:M,footerRef:te,toggleIndicator:G,innerRef:A}=t,D=q(t,["className","children","isOpen","isActive","isPlain","isDisabled","hasPlaceholderStyle","variant","onToggle","onEnter","onClose","onBlur","onClickTypeaheadToggleButton","handleTypeaheadKeys","moveFocusToLastMenuItem","parentRef","menuRef","id","type","hasClearButton","aria-labelledby","aria-label","hasFooter","footerRef","toggleIndicator","innerRef"]),U=l===m.typeahead||l===m.typeaheadMulti||w,P={id:R,"aria-labelledby":L,"aria-expanded":i,"aria-haspopup":l!==m.checkbox&&"listbox"||null};return e.createElement(e.Fragment,null,!U&&e.createElement("button",Object.assign({},D,P,{ref:this.toggle,type:N,className:p(a.selectToggle,h&&a.modifiers.placeholder,c&&a.modifiers.disabled,o&&a.modifiers.plain,r&&a.modifiers.active,s),"aria-label":S,onBlur:I,onClick:K=>{d(!i,K),i&&b()},onKeyDown:this.onKeyDown,disabled:c}),n,e.createElement("span",{className:p(a.selectToggleArrow)},G??e.createElement(He,null))),U&&e.createElement("div",Object.assign({},D,{ref:this.toggle,className:p(a.selectToggle,h&&a.modifiers.placeholder,c&&a.modifiers.disabled,o&&a.modifiers.plain,U&&a.modifiers.typeahead,s),onBlur:I,onClick:K=>{c||(d(!i,K),i&&b())},onKeyDown:this.onKeyDown}),n,e.createElement("button",Object.assign({},P,{type:N,className:p(Se.button,a.selectToggleButton,a.modifiers.plain),"aria-label":S,onClick:K=>{d(!i,K),i&&b(),y()}},(l===m.typeahead||l===m.typeaheadMulti)&&{tabIndex:-1},{disabled:c}),G??e.createElement(He,{className:p(a.selectToggleArrow)}))))}}De.displayName="SelectToggle";De.defaultProps={className:"",isOpen:!1,isActive:!1,isPlain:!1,isDisabled:!1,hasPlaceholderStyle:!1,hasClearButton:!1,hasFooter:!1,variant:"single","aria-labelledby":"","aria-label":"",type:"button",onToggle:()=>{},onEnter:()=>{},onClose:()=>{},onClickTypeaheadToggleButton:()=>{}};const Nt=e.forwardRef((g,t)=>e.createElement(De,Object.assign({innerRef:t},g)));const z={chipGroup:"pf-c-chip-group",chipGroupClose:"pf-c-chip-group__close",chipGroupLabel:"pf-c-chip-group__label",chipGroupList:"pf-c-chip-group__list",chipGroupListItem:"pf-c-chip-group__list-item",chipGroupMain:"pf-c-chip-group__main",modifiers:{category:"pf-m-category"}};const de={badge:"pf-c-badge",button:"pf-c-button",chip:"pf-c-chip",chipIcon:"pf-c-chip__icon",chipText:"pf-c-chip__text",modifiers:{overflow:"pf-m-overflow",draggable:"pf-m-draggable"},themeDark:"pf-theme-dark"};class ee extends e.Component{constructor(t){super(t),this.span=e.createRef(),this.setChipStyle=()=>({"--pf-c-chip__text--MaxWidth":this.props.textMaxWidth}),this.renderOverflowChip=()=>{const s=this.props,{children:n,className:i,onClick:r,ouiaId:o,textMaxWidth:c,style:h,component:l,tooltipPosition:d,isOverflowChip:u,closeBtnAriaLabel:b,isReadOnly:I}=s,y=q(s,["children","className","onClick","ouiaId","textMaxWidth","style","component","tooltipPosition","isOverflowChip","closeBtnAriaLabel","isReadOnly"]),v=l;return e.createElement(v,Object.assign({onClick:r},c&&Object.assign({style:this.setChipStyle()},h),{className:p(de.chip,de.modifiers.overflow,i)},l==="button"?{type:"button"}:{},Fe("OverflowChip",o!==void 0?o:this.state.ouiaStateId),y),e.createElement("span",{className:p(de.chipText)},n))},this.renderChip=s=>{const{children:n,tooltipPosition:i}=this.props;return this.state.isTooltipVisible?e.createElement(ze,{position:i,content:n},this.renderInnerChip(s)):this.renderInnerChip(s)},this.state={isTooltipVisible:!1,ouiaStateId:Xe(ee.displayName)}}componentDidMount(){this.setState({isTooltipVisible:!!(this.span.current&&this.span.current.offsetWidtht?this.renderOverflowChip():this.renderChip(this.props.id||s))}}ee.displayName="Chip";ee.defaultProps={closeBtnAriaLabel:"close",className:"",isOverflowChip:!1,isReadOnly:!1,tooltipPosition:"top",onClick:g=>{},component:"div"};class ge extends e.Component{constructor(t){super(t),this.headingRef=e.createRef(),this.toggleCollapse=()=>{this.setState(s=>({isOpen:!s.isOpen,isTooltipVisible:!!(this.headingRef.current&&this.headingRef.current.offsetWidth{const L=f?e.Children.toArray(n):e.Children.toArray(n).slice(0,d);return e.createElement("div",Object.assign({className:p(z.chipGroup,i,s&&z.modifiers.category),role:"group"},s&&{"aria-labelledby":w},!s&&{"aria-label":c},Fe(ge.displayName,I)),e.createElement("div",{className:p(z.chipGroupMain)},s&&this.renderLabel(w),e.createElement("ul",Object.assign({className:p(z.chipGroupList)},s&&{"aria-labelledby":w},!s&&{"aria-label":c},{role:"list"},k),L.map((S,M)=>e.createElement("li",{className:p(z.chipGroupListItem),key:M},S)),O>d&&e.createElement("li",{className:p(z.chipGroupListItem)},e.createElement(ee,{isOverflowChip:!0,onClick:S=>{this.toggleCollapse(),l(S)},component:"button"},f?u:R)))),r&&e.createElement("div",{className:p(z.chipGroupClose)},e.createElement(qe,{variant:"plain","aria-label":o,onClick:h,id:`remove_group_${w}`,"aria-labelledby":`remove_group_${w} ${w}`,ouiaId:I||o},e.createElement(Je,{"aria-hidden":"true"}))))};return O===0?null:e.createElement(we,null,w=>N(this.props.id||w))}}ge.displayName="ChipGroup";ge.defaultProps={expandedText:"Show Less",collapsedText:"${remaining} more",categoryName:"",defaultIsOpen:!1,numChips:3,isClosable:!1,onClick:g=>{},onOverflowChipClick:g=>{},closeBtnAriaLabel:"Close chip group",tooltipPosition:"top","aria-label":"Chip group category"};let St=0;class ne extends e.Component{constructor(){super(...arguments),this.parentRef=e.createRef(),this.menuComponentRef=e.createRef(),this.filterRef=e.createRef(),this.clearRef=e.createRef(),this.inputRef=e.createRef(),this.refCollection=[[]],this.optionContainerRefCollection=[],this.footerRef=e.createRef(),this.state={focusFirstOption:!1,typeaheadInputValue:null,typeaheadFilteredChildren:e.Children.toArray(this.props.children),favoritesGroup:[],typeaheadCurrIndex:-1,typeaheadStoredIndex:-1,creatableValue:"",tabbedIntoFavoritesMenu:!1,ouiaStateId:Xe(ne.displayName,this.props.variant),viewMoreNextIndex:-1},this.getTypeaheadActiveChild=t=>this.refCollection[t]?this.refCollection[t][0]:null,this.componentDidUpdate=(t,s)=>{if(this.props.hasInlineFilter&&(this.refCollection[0][0]=this.filterRef.current),!s.focusFirstOption&&this.state.focusFirstOption&&!this.props.customContent){const r=this.refCollection.find(o=>o!==null&&o[0]);r&&r[0]&&r[0].focus()}else this.state.viewMoreNextIndex!==-1&&this.refCollection.length>this.state.viewMoreNextIndex&&this.props.loadingVariant!=="spinner"&&this.refCollection[this.state.viewMoreNextIndex][0]&&this.props.variant!=="typeahead"&&this.props.variant!=="typeaheadmulti"&&(this.refCollection[this.state.viewMoreNextIndex][0].focus(),this.setState({viewMoreNextIndex:-1}));const n=(r,o)=>Array.from(r).some((c,h)=>{const l=c.props,d=o[h],{props:u}=d;return l&&u?l.value!==u.value||l.label!==u.label||l.isDisabled!==u.isDisabled||l.isPlaceholder!==u.isPlaceholder:c!==d});if((t.children.length!==this.props.children.length||n(t.children,this.props.children)||this.props.isGrouped&&Array.from(t.children).some((r,o)=>r.type===Z&&r.props.children&&this.props.children[o].props.children&&(r.props.children.length!==this.props.children[o].props.children.length||n(r.props.children,this.props.children[o].props.children))))&&this.updateTypeAheadFilteredChildren(s.typeaheadInputValue||"",null),this.props.onFavorite&&(this.props.favorites.length!==t.favorites.length||this.state.typeaheadFilteredChildren!==s.typeaheadFilteredChildren)){const r=this.props.variant==="typeahead"||this.props.variant==="typeaheadmulti"?this.state.typeaheadFilteredChildren:this.props.children,o=vt(r,this.props.isGrouped,this.props.favorites),c=o.length?[e.createElement(Z,{key:"favorites",label:this.props.favoritesLabel},o),e.createElement(H,{key:"favorites-group-divider"})]:[];this.setState({favoritesGroup:c})}},this.onEnter=()=>{this.setState({focusFirstOption:!0})},this.onToggle=(t,s)=>{const{isInputValuePersisted:n,onSelect:i,onToggle:r,hasInlineFilter:o}=this.props;!t&&n&&i&&i(void 0,this.inputRef.current?this.inputRef.current.value:""),t&&o&&this.setState({focusFirstOption:!0}),r(t,s)},this.onClose=()=>{const{isInputFilterPersisted:t}=this.props;this.setState(Object.assign(Object.assign({focusFirstOption:!1,typeaheadInputValue:null},!t&&{typeaheadFilteredChildren:e.Children.toArray(this.props.children)}),{typeaheadCurrIndex:-1,tabbedIntoFavoritesMenu:!1,viewMoreNextIndex:-1}))},this.onChange=t=>{t.target.value.toString()!==""&&!this.props.isOpen&&this.onToggle(!0,t),this.props.onTypeaheadInputChanged&&this.props.onTypeaheadInputChanged(t.target.value.toString()),this.setState({typeaheadCurrIndex:-1,typeaheadInputValue:t.target.value,creatableValue:t.target.value}),this.updateTypeAheadFilteredChildren(t.target.value.toString(),t),this.refCollection=[[]]},this.updateTypeAheadFilteredChildren=(t,s)=>{let n;const{onFilter:i,isCreatable:r,isCreateOptionOnTop:o,onCreateOption:c,createText:h,noResultsFoundText:l,children:d,isGrouped:u,isCreateSelectOptionObject:b,loadingVariant:I}=this.props;if(i)n=i(s,s?s.target.value:t)||d;else{let y;try{y=new RegExp(t.toString(),"i")}catch{y=new RegExp(t.toString().replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"i")}const v=e.Children.toArray(d);if(u){const k=f=>f.props.value&&f.props.value.toString&&this.getDisplay(f.props.value.toString(),"text").search(y)===0;n=t.toString()!==""?e.Children.map(d,f=>{if(e.isValidElement(f)&&f.type===Z){const O=e.Children.toArray(f.props.children).filter(k);if(O.length>0)return e.cloneElement(f,{titleId:f.props.label&&f.props.label.replace(/\W/g,"-"),children:O})}else return e.Children.toArray(f).filter(k)}):v}else n=t.toString()!==""?v.filter(k=>{const f=k.props.value;if(!f)return!0;const O=typeof f!="string"&&f.toString&&f.compareTo;return I!=="spinner"&&I?.text===f||I==="spinner"&&f==="loading"?!0:O?f.compareTo(t):this.getDisplay(k.props.value.toString(),"text").search(y)===0}):v}if(n||(n=[]),n.length===0&&!r&&n.push(e.createElement(X,{isDisabled:!0,key:"no-results",value:l,isNoResultsOption:!0})),r&&t!==""){const y=t;if(!n.find(v=>v.props.value&&v.props.value.toString().toLowerCase()===y.toString().toLowerCase())){const v=b?{toString:()=>y,compareTo:f=>this.toString().toLowerCase().includes(f.toString().toLowerCase())}:y,k=e.createElement(X,{key:`create ${y}`,value:v,onClick:()=>c&&c(y)},h,' "',y,'"');o?n.unshift(k):n.push(k)}}this.setState({typeaheadFilteredChildren:n})},this.onClick=t=>{this.props.isOpen||this.onToggle(!0,t)},this.clearSelection=t=>{this.setState({typeaheadInputValue:null,typeaheadFilteredChildren:e.Children.toArray(this.props.children),typeaheadCurrIndex:-1})},this.sendRef=(t,s,n,i)=>{this.refCollection[i]=[t,s],this.optionContainerRefCollection[i]=n},this.handleMenuKeys=(t,s,n)=>{gt(t,s,n,this.refCollection,this.refCollection),(this.props.variant===m.typeahead||this.props.variant===m.typeaheadMulti)&&n!=="tab"&&this.handleTypeaheadKeys(n)},this.moveFocus=(t,s=!0)=>{const{isCreatable:n,createText:i}=this.props,r=!!(this.refCollection[t][0]&&this.refCollection[t][0].classList.contains("pf-m-description")),o=!!(this.refCollection[t][0]&&this.refCollection[t][0].classList.contains("pf-m-load")),c=r?this.refCollection[t][0].firstElementChild:this.refCollection[t][0];let h="";n&&c.textContent.includes(i)?h=this.state.creatableValue:c&&!o&&(h=c.textContent),this.setState(l=>({typeaheadCurrIndex:s?t:l.typeaheadCurrIndex,typeaheadStoredIndex:t,typeaheadInputValue:h}))},this.switchFocusToFavoriteMenu=()=>{const{typeaheadCurrIndex:t,typeaheadStoredIndex:s}=this.state;let n=0;t!==-1?n=t:s!==-1&&(n=s),this.refCollection[n]!==null&&this.refCollection[n][0]!==null?this.refCollection[n][0].focus():this.clearRef.current.focus(),this.setState({tabbedIntoFavoritesMenu:!0,typeaheadCurrIndex:-1})},this.moveFocusToLastMenuItem=()=>{const t=this.refCollection.length;t>0&&this.refCollection[t-1]!==null&&this.refCollection[t-1][0]!==null&&this.refCollection[t-1][0].focus()},this.handleTypeaheadKeys=(t,s=!1)=>{const{isOpen:n,onFavorite:i,isCreatable:r}=this.props,{typeaheadCurrIndex:o,tabbedIntoFavoritesMenu:c}=this.state,h=this.getTypeaheadActiveChild(o);if(n)if(t==="enter"){if((o!==-1||r&&this.refCollection.length===1)&&(h||this.refCollection[0]&&this.refCollection[0][0])){if(h){if(!h.classList.contains("pf-m-load")){const d=h.childElementCount>1?h.firstChild.textContent:h.textContent;this.setState({typeaheadInputValue:d})}}else this.refCollection[0]&&this.refCollection[0][0]&&this.setState({typeaheadInputValue:this.refCollection[0][0].textContent});h?h.click():this.refCollection[0][0].click()}}else if(t==="tab")if(i)if(this.inputRef.current===document.activeElement)if(this.props.footer&&s){const l=he(this.footerRef,ue);l.length>0&&l[l.length-1]&&l[l.length-1].focus()}else this.switchFocusToFavoriteMenu();else if(this.props.footer){let l=!1;const d=he(this.footerRef,ue);if(d.length>0){const u=d.findIndex(b=>b===document.activeElement);u===-1?s?this.inputRef.current.focus():d[0].focus():s?u===0?(this.switchFocusToFavoriteMenu(),l=!0):d[u-1].focus():d[u+1]?d[u+1].focus():this.inputRef.current.focus()}else this.inputRef.current.focus(),l=!1;this.setState({tabbedIntoFavoritesMenu:l})}else this.inputRef.current.focus(),this.setState({tabbedIntoFavoritesMenu:!1});else if(!this.props.footer)this.onToggle(!1,null),this.onClose();else{const l=he(this.footerRef,ue),d=l.findIndex(u=>u===document.activeElement);this.inputRef.current===document.activeElement?s?(this.onToggle(!1,null),this.onClose()):l[0]?l[0].focus():(this.onToggle(!1,null),this.onClose()):s?d===0?this.inputRef.current.focus():l[d-1].focus():l[d+1]?l[d+1].focus():(this.onToggle(!1,null),this.inputRef.current.focus(),this.onClose())}else if(c){const l=this.refCollection.findIndex(d=>d!==void 0&&(d[0]===document.activeElement||d[1]===document.activeElement));this.moveFocus(l)}else{if(this.refCollection[0][0]===null)return;let l;if(o===-1&&t==="down"?l=0:o===-1&&t==="up"?l=this.refCollection.length-1:t!=="left"&&t!=="right"?l=bt(o,t,this.refCollection):l=o,this.refCollection[l]===null)return;this.moveFocus(l)}},this.onClickTypeaheadToggleButton=()=>{this.inputRef&&this.inputRef.current&&this.inputRef.current.focus()},this.getDisplay=(t,s="node")=>{if(!t)return;const n=this.props.isGrouped?e.Children.toArray(this.props.children).reduce((i,r)=>[...i,...e.Children.toArray(r.props.children)],[]).find(i=>i.props.value.toString()===t.toString()):e.Children.toArray(this.props.children).find(i=>i.props.value&&i.props.value.toString()===t.toString());return n?n&&n.props.children?s==="node"?n.props.children:this.findText(n):n.props.value.toString():t.toString()},this.findText=t=>{if(typeof t=="string")return t;if(e.isValidElement(t)){const s=[];return e.Children.toArray(t.props.children).forEach(n=>s.push(this.findText(n))),s.join("")}else return""},this.generateSelectedBadge=()=>{const{customBadgeText:t,selections:s}=this.props;return t!==null?t:Array.isArray(s)&&s.length>0?s.length:null},this.setVieMoreNextIndex=()=>{this.setState({viewMoreNextIndex:this.refCollection.length-1})},this.isLastOptionBeforeFooter=t=>!!(this.props.footer&&t===this.refCollection.length-1)}extendTypeaheadChildren(t,s){const{isGrouped:n,onFavorite:i,createText:r}=this.props,o=s?s.concat(this.state.typeaheadFilteredChildren):this.state.typeaheadFilteredChildren,c=this.optionContainerRefCollection[t];let h=this.getTypeaheadActiveChild(t);return h&&h.classList.contains("pf-m-description")&&(h=h.firstElementChild),this.refCollection=[[]],this.optionContainerRefCollection=[],n?e.Children.map(o,l=>l.type===H?l:l.type===Z&&i?e.cloneElement(l,{titleId:l.props.label&&l.props.label.replace(/\W/g,"-"),children:e.Children.map(l.props.children,d=>d.type===H?d:e.cloneElement(d,{isFocused:c&&(c.id===d.props.id||this.props.isCreatable&&h.textContent===`${r} "${l.props.value}"`)}))}):l.type===Z?e.cloneElement(l,{titleId:l.props.label&&l.props.label.replace(/\W/g,"-"),children:e.Children.map(l.props.children,d=>d.type===H?d:e.cloneElement(d,{isFocused:h&&(h.textContent===d.props.value.toString()||this.props.isCreatable&&h.textContent===`${r} "${d.props.value}"`)}))}):e.cloneElement(l,{isFocused:h&&(h.textContent===l.props.value.toString()||this.props.isCreatable&&h.textContent===`${r} "${l.props.value}"`)})):o.map((l,d)=>l.type.displayName==="Divider"?l:e.cloneElement(l,{isFocused:h?h.textContent===l.props.value.toString()||this.props.isCreatable&&h.textContent===`${r} "${l.props.value}"`:d===t}))}render(){const t=this.props,{children:s,chipGroupProps:n,chipGroupComponent:i,className:r,customContent:o,variant:c,direction:h,onSelect:l,onClear:d,onBlur:u,toggleId:b,toggleRef:I,isOpen:y,isGrouped:v,isPlain:k,isDisabled:f,hasPlaceholderStyle:O,validated:R,selections:N,typeAheadAriaLabel:w,typeAheadAriaDescribedby:L,clearSelectionsAriaLabel:S,toggleAriaLabel:M,removeSelectionAriaLabel:te,"aria-label":G,"aria-labelledby":A,"aria-describedby":D,"aria-invalid":U,placeholderText:P,width:K,maxHeight:J,toggleIcon:_,toggleIndicator:Oe,ouiaId:V,ouiaSafe:Q,hasInlineFilter:B,isCheckboxSelectionBadgeHidden:ae,inlineFilterPlaceholderText:oe,onFilter:be,onTypeaheadInputChanged:E,onCreateOption:wt,isCreatable:Mt,onToggle:At,createText:Lt,noResultsFoundText:_e,customBadgeText:Dt,inputIdPrefix:Qe,inputAutoComplete:Ne,isInputValuePersisted:_t,isInputFilterPersisted:Pt,menuAppendTo:re,favorites:Ze,onFavorite:ce,favoritesLabel:Bt,footer:ye,loadingVariant:Y,isCreateSelectOptionObject:Gt,isCreateOptionOnTop:Kt,shouldResetOnSelect:et,isFlipEnabled:tt,removeFindDomNode:it,zIndex:st}=t,lt=q(t,["children","chipGroupProps","chipGroupComponent","className","customContent","variant","direction","onSelect","onClear","onBlur","toggleId","toggleRef","isOpen","isGrouped","isPlain","isDisabled","hasPlaceholderStyle","validated","selections","typeAheadAriaLabel","typeAheadAriaDescribedby","clearSelectionsAriaLabel","toggleAriaLabel","removeSelectionAriaLabel","aria-label","aria-labelledby","aria-describedby","aria-invalid","placeholderText","width","maxHeight","toggleIcon","toggleIndicator","ouiaId","ouiaSafe","hasInlineFilter","isCheckboxSelectionBadgeHidden","inlineFilterPlaceholderText","onFilter","onTypeaheadInputChanged","onCreateOption","isCreatable","onToggle","createText","noResultsFoundText","customBadgeText","inputIdPrefix","inputAutoComplete","isInputValuePersisted","isInputFilterPersisted","menuAppendTo","favorites","onFavorite","favoritesLabel","footer","loadingVariant","isCreateSelectOptionObject","isCreateOptionOnTop","shouldResetOnSelect","isFlipEnabled","removeFindDomNode","zIndex"]),{focusFirstOption:ie,typeaheadCurrIndex:Ce,typeaheadInputValue:se,typeaheadFilteredChildren:nt,favoritesGroup:Pe}=this.state,Ee=b||`pf-select-toggle-id-${St++}`,F=Array.isArray(N)?N:[N],Be=e.Children.toArray(s).find(x=>x.props.value===F[0]),at=Be&&Be.props.isPlaceholder,xe=!!(F[0]&&F[0]!==""),Te=this.getTypeaheadActiveChild(Ce);let Ge=null,$=[];if(ce){let x=s;c==="typeahead"||c==="typeaheadmulti"?x=this.extendTypeaheadChildren(Ce,Pe):ce&&(x=Pe.concat(s)),$=kt(x,v,Ze)}else $=s;if(!o&&!xe&&!P){const x=e.Children.toArray(s).filter(T=>T.props.isPlaceholder===!0);Ge=x[0]&&this.getDisplay(x[0].props.value,"node")||s[0]&&this.getDisplay(s[0].props.value,"node")}y&&$.find(x=>x?.key==="loading")===void 0&&(Y==="spinner"?$.push(e.createElement(X,{isLoading:!0,key:"loading",value:"loading"},e.createElement(yt,{size:"lg"}))):Y?.text&&$.push(e.createElement(X,{isLoad:!0,key:"loading",value:Y.text,setViewMoreNextIndex:this.setVieMoreNextIndex,onClick:Y?.onClick})));const pe=d!==ne.defaultProps.onClear,Ie=e.createElement("button",{className:p(Se.button,Se.modifiers.plain,a.selectToggleClear),onClick:x=>{this.clearSelection(x),d(x),x.stopPropagation()},"aria-label":S,type:"button",disabled:f,ref:this.clearRef,onKeyDown:x=>{x.key===C.Enter&&this.clearRef.current.click()}},e.createElement(Je,{"aria-hidden":!0}));let Ke=null;c===m.typeaheadMulti&&(Ke=i||e.createElement(ge,Object.assign({},n),F&&F.map(x=>e.createElement(ee,{key:x,onClick:T=>l(T,x),closeBtnAriaLabel:te},this.getDisplay(x,"node"))))),B&&($=[e.createElement(e.Fragment,null,e.createElement("div",{key:"inline-filter",className:p(a.selectMenuSearch)},e.createElement("input",{key:"inline-filter-input",type:"search",className:p(ke.formControl,ke.modifiers.search),onChange:this.onChange,placeholder:oe,onKeyDown:T=>{if(T.key===C.ArrowUp)this.handleMenuKeys(0,0,"up"),T.preventDefault();else if(T.key===C.ArrowDown)this.handleMenuKeys(0,0,"down"),T.preventDefault();else if(T.key===C.ArrowLeft)this.handleMenuKeys(0,0,"left"),T.preventDefault();else if(T.key===C.ArrowRight)this.handleMenuKeys(0,0,"right"),T.preventDefault();else if(T.key===C.Tab&&c!==m.checkbox&&this.props.footer)if(T.shiftKey)this.onToggle(!1,T);else{const ve=he(this.footerRef,ue);ve.length>0?(ve[0].focus(),T.stopPropagation(),T.preventDefault()):this.onToggle(!1,T)}else T.key===C.Tab&&c===m.checkbox&&(T.shiftKey?this.handleMenuKeys(0,0,"up"):this.handleMenuKeys(0,0,"down"),T.stopPropagation(),T.preventDefault())},ref:this.filterRef,autoComplete:Ne})),e.createElement(H,{key:"inline-filter-divider"})),...nt].map((T,ve)=>e.cloneElement(T,{key:ve})));let le,W;if(o)le={selected:F,openedOnEnter:ie,isCustomContent:!0},W=o;else switch(c){case"single":le={selected:F[0],hasInlineFilter:B,openedOnEnter:ie},W=$;break;case"checkbox":le={checked:F,isGrouped:v,hasInlineFilter:B,openedOnEnter:ie},W=$;break;case"typeahead":le={selected:F[0],openedOnEnter:ie},W=ce?$:this.extendTypeaheadChildren(Ce),W.length===0&&W.push(e.createElement(X,{isDisabled:!0,key:0,value:_e,isNoResultsOption:!0}));break;case"typeaheadmulti":le={selected:F,openedOnEnter:ie},W=ce?$:this.extendTypeaheadChildren(Ce),W.length===0&&W.push(e.createElement(X,{isDisabled:!0,key:0,value:_e,isNoResultsOption:!0}));break}const ot=tt&&re!=="inline",Ve=e.createElement(Ot,Object.assign({className:p(ot&&a.modifiers.static)},lt,{isGrouped:v,selected:F},le,{openedOnEnter:ie,"aria-label":G,"aria-labelledby":A,sendRef:this.sendRef,keyHandler:this.handleMenuKeys,maxHeight:J,ref:this.menuComponentRef,footer:ye,footerRef:this.footerRef,isLastOptionBeforeFooter:this.isLastOptionBeforeFooter}),W),je=ye?e.createElement("div",{className:p(a.selectMenu)}," ",Ve," "):Ve,rt=e.createElement("div",Object.assign({className:p(a.select,y&&a.modifiers.expanded,R===j.success&&a.modifiers.success,R===j.warning&&a.modifiers.warning,R===j.error&&a.modifiers.invalid,h===me.up&&a.modifiers.top,r)},K&&{style:{width:K}},R!==j.default&&{"aria-invalid":U}),y&&je),$e=e.createElement("div",Object.assign({className:p(a.select,y&&a.modifiers.expanded,R===j.success&&a.modifiers.success,R===j.warning&&a.modifiers.warning,R===j.error&&a.modifiers.invalid,h===me.up&&a.modifiers.top,r),ref:this.parentRef},Fe(ne.displayName,V!==void 0?V:this.state.ouiaStateId,Q),K&&{style:{width:K}},R!==j.default&&{"aria-invalid":U}),e.createElement(Nt,Object.assign({id:Ee,parentRef:this.parentRef,menuRef:this.menuComponentRef,ref:I},ye&&{footerRef:this.footerRef},{isOpen:y,isPlain:k,hasPlaceholderStyle:O&&(!F.length||F[0]===null||at),onToggle:this.onToggle,onEnter:this.onEnter,onClose:this.onClose,onBlur:u,variant:c,toggleIndicator:Oe,"aria-labelledby":`${A||""} ${Ee}`,"aria-label":M},D&&{"aria-describedby":D},{handleTypeaheadKeys:this.handleTypeaheadKeys,moveFocusToLastMenuItem:this.moveFocusToLastMenuItem,isDisabled:f,hasClearButton:pe,hasFooter:ye!==void 0,onClickTypeaheadToggleButton:this.onClickTypeaheadToggleButton}),o&&e.createElement("div",{className:p(a.selectToggleWrapper)},_&&e.createElement("span",{className:p(a.selectToggleIcon)},_),e.createElement("span",{className:p(a.selectToggleText)},P)),c===m.single&&!o&&e.createElement(e.Fragment,null,e.createElement("div",{className:p(a.selectToggleWrapper)},_&&e.createElement("span",{className:p(a.selectToggleIcon)},_),e.createElement("span",{className:p(a.selectToggleText)},this.getDisplay(F[0],"node")||P||Ge)),pe&&xe&&Ie),c===m.checkbox&&!o&&e.createElement(e.Fragment,null,e.createElement("div",{className:p(a.selectToggleWrapper)},_&&e.createElement("span",{className:p(a.selectToggleIcon)},_),e.createElement("span",{className:p(a.selectToggleText)},P),!ae&&xe&&e.createElement("div",{className:p(a.selectToggleBadge)},e.createElement("span",{className:p(Ue.badge,Ue.modifiers.read)},this.generateSelectedBadge()))),pe&&xe&&Ie),c===m.typeahead&&!o&&e.createElement(e.Fragment,null,e.createElement("div",{className:p(a.selectToggleWrapper)},_&&e.createElement("span",{className:p(a.selectToggleIcon)},_),e.createElement("input",Object.assign({className:p(ke.formControl,a.selectToggleTypeahead),"aria-activedescendant":Te&&Te.id,id:`${Ee}-select-typeahead`,"aria-label":w},L&&{"aria-describedby":L},{placeholder:P,value:se!==null?se:this.getDisplay(F[0],"text")||"",type:"text",onClick:this.onClick,onChange:this.onChange,autoComplete:Ne,disabled:f,ref:this.inputRef}))),pe&&(F[0]||se)&&Ie),c===m.typeaheadMulti&&!o&&e.createElement(e.Fragment,null,e.createElement("div",{className:p(a.selectToggleWrapper)},_&&e.createElement("span",{className:p(a.selectToggleIcon)},_),F&&Array.isArray(F)&&F.length>0&&Ke,e.createElement("input",Object.assign({className:p(ke.formControl,a.selectToggleTypeahead),"aria-activedescendant":Te&&Te.id,id:`${Ee}-select-multi-typeahead-typeahead`,"aria-label":w,"aria-invalid":R===j.error},L&&{"aria-describedby":L},{placeholder:P,value:se!==null?se:"",type:"text",onChange:this.onChange,onClick:this.onClick,autoComplete:Ne,disabled:f,ref:this.inputRef}))),pe&&(F&&F.length>0||se)&&Ie),R===j.success&&e.createElement("span",{className:p(a.selectToggleStatusIcon)},e.createElement(Ct,{"aria-hidden":"true"})),R===j.error&&e.createElement("span",{className:p(a.selectToggleStatusIcon)},e.createElement(Et,{"aria-hidden":"true"})),R===j.warning&&e.createElement("span",{className:p(a.selectToggleStatusIcon)},e.createElement(xt,{"aria-hidden":"true"}))),y&&re==="inline"&&je),ct=()=>this.parentRef&&this.parentRef.current?this.parentRef.current.parentElement:null;return e.createElement(we,null,x=>e.createElement(Me.Provider,{value:{onSelect:l,onFavorite:ce,onClose:this.onClose,variant:c,inputIdPrefix:Qe||x,shouldResetOnSelect:et}},re==="inline"?$e:e.createElement(Tt,{trigger:$e,popper:rt,direction:h,appendTo:re==="parent"?ct():re,isVisible:y,removeFindDomNode:it,zIndex:st})))}}ne.displayName="Select";ne.defaultProps={children:[],className:"",position:fe.left,direction:me.down,toggleId:null,isOpen:!1,isGrouped:!1,isPlain:!1,isDisabled:!1,hasPlaceholderStyle:!1,isCreatable:!1,isCreateOptionOnTop:!1,validated:"default","aria-label":"","aria-labelledby":"","aria-describedby":"","aria-invalid":!1,typeAheadAriaLabel:"",typeAheadAriaDescribedby:"",clearSelectionsAriaLabel:"Clear all",toggleAriaLabel:"Options menu",removeSelectionAriaLabel:"Remove",selections:[],createText:"Create",placeholderText:"",noResultsFoundText:"No results found",variant:m.single,width:"",onClear:()=>{},onCreateOption:()=>{},toggleIcon:null,toggleIndicator:null,onFilter:null,onTypeaheadInputChanged:null,customContent:null,hasInlineFilter:!1,inlineFilterPlaceholderText:null,customBadgeText:null,inputIdPrefix:"",inputAutoComplete:"off",menuAppendTo:"inline",favorites:[],favoritesLabel:"Favorites",ouiaSafe:!0,chipGroupComponent:null,isInputValuePersisted:!1,isInputFilterPersisted:!1,isCreateSelectOptionObject:!1,shouldResetOnSelect:!0,isFlipEnabled:!0,removeFindDomNode:!1,zIndex:9999};export{ge as C,ne as S,m as a,X as b,ee as c,Z as d};
//# sourceMappingURL=Select-802cd710.js.map




© 2015 - 2024 Weber Informatics LLC | Privacy Policy