react-functional-select
Advanced tools
Comparing version 3.3.4 to 3.3.5
@@ -19,3 +19,3 @@ import { type MutableRefObject, type FunctionComponent } from 'react'; | ||
renderOptionLabel: RenderLabelCallback; | ||
fixedSizeListRef: MutableRefObject<FixedSizeList | null>; | ||
fixedSizeListRef: MutableRefObject<FixedSizeList | null> | undefined; | ||
selectOption: (option: SelectedOption, isSelected?: boolean) => void; | ||
@@ -22,0 +22,0 @@ }>; |
@@ -1,2 +0,2 @@ | ||
import type { CallbackFunction } from '../types'; | ||
import type { CallbackFn } from '../types'; | ||
/** | ||
@@ -8,3 +8,3 @@ * A custom hook that converts a callback to a ref to avoid triggering re-renders | ||
*/ | ||
declare const useCallbackRef: <T extends CallbackFunction>(callback: T | undefined) => T; | ||
declare const useCallbackRef: <T extends CallbackFn>(callback: T | undefined) => T; | ||
export default useCallbackRef; |
import { MenuPositionEnum } from '../constants'; | ||
import type { CallbackFunction } from '../types'; | ||
import type { CallbackFn } from '../types'; | ||
import { type RefObject } from 'react'; | ||
@@ -11,3 +11,3 @@ /** | ||
*/ | ||
declare const useMenuPositioner: (menuRef: RefObject<HTMLElement | null>, controlRef: RefObject<HTMLElement | null>, menuOpen: boolean, menuPosition: MenuPositionEnum, menuItemSize: number, menuHeightDefault: number, menuOptionsLength: number, isMenuPortaled: boolean, onMenuOpen?: CallbackFunction, onMenuClose?: CallbackFunction, menuScrollDuration?: number, scrollMenuIntoView?: boolean) => [string | undefined, number]; | ||
declare const useMenuPositioner: (menuRef: RefObject<HTMLElement | null>, controlRef: RefObject<HTMLElement | null>, menuOpen: boolean, menuPosition: MenuPositionEnum, menuItemSize: number, menuHeightDefault: number, menuOptionsLength: number, isMenuPortaled: boolean, onMenuOpen?: CallbackFn, onMenuClose?: CallbackFn, menuScrollDuration?: number, scrollMenuIntoView?: boolean) => [string | undefined, number]; | ||
export default useMenuPositioner; |
@@ -1,1 +0,1 @@ | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@babel/runtime/helpers/extends"),n=require("react"),t=require("styled-components"),o=require("@babel/runtime/helpers/objectWithoutPropertiesLoose"),i=require("react-window"),r=require("react-dom");function a(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var l=a(e),u=a(n),d=a(t),c=a(o),s={role:"combobox","aria-haspopup":"listbox",className:"rfs-select-container"},f={tabIndex:0,type:"text",spellCheck:!1,autoCorrect:"off",autoComplete:"off",autoCapitalize:"none","aria-autocomplete":"list",className:"rfs-autosize-input"},p="top",m="auto",h="bottom",g="any",v=0,b=1,w=2,y=3,O=t.keyframes(["0%,80%,100%{transform:scale(0);}40%{transform:scale(1.0);}"]),x=t.keyframes(["from{opacity:0;}to{opacity:1;}"]),C=t.css([""," 0.2s ease-in"],x),I={index:-1},S=[],E={OPTION_LABEL:function(e){return e.label},OPTION_VALUE:function(e){return e.value},OPTION_IS_DISABLED:function(e){return!!e.isDisabled},OPTION_FILTER:function(e){var n=e.label;return"string"==typeof n?n:""+n}},k=/(auto|scroll)/;function M(e){return L(e)?window.pageYOffset:e.scrollTop}function L(e){return e===document.body||e===document.documentElement||e===window}function N(e){var n=e.overflow,t=e.overflowX,o=e.overflowY;return k.test(""+n+t+o)}function z(e){var n=getComputedStyle(e),t=document.documentElement,o="absolute"===n.position;if("fixed"===n.position)return t;for(var i=e;i=null==i?void 0:i.parentElement;)if(n=getComputedStyle(i),(!o||"static"!==n.position)&&N(n))return i;return t}function D(e,n,t,o){void 0===t&&(t=300);var i=0,r=M(e),a=n-r;requestAnimationFrame((function n(){var l,u=a*((l=(l=i+=5)/t-1)*l*l+1)+r;!function(e,n){L(e)?window.scrollTo(0,n):e.scrollTop=n}(e,u),i<t?requestAnimationFrame(n):null==o||o()}))}var R=/[\u0300-\u036f]/g,T=function(e){return"boolean"==typeof e},A=function(e){return"function"==typeof e},B=function(e){return Array.isArray(e)&&!!e.length},V=function(e){return null!==e&&"object"==typeof e&&!Array.isArray(e)},F=function(e){e.preventDefault(),e.stopPropagation()},P=function(e,n,t){var o=e.trim();return n&&(o=o.toLowerCase()),t?o.normalize("NFD").replace(R,""):o},q=function(e,n,t){var o=Array.isArray(e)?e:V(e)?[e]:S;return B(o)?o.map((function(e){return{data:e,value:n(e),label:t(e)}})):o},W=function e(n,t){var o=l.default({},n);return Object.keys(t).forEach((function(i){var r=t[i];o[i]="animation"!==i&&V(r)?n[i]?e(n[i],r):r:null!=r?r:""})),o},_={color:{border:"#ced4da",danger:"#dc3545",primary:"#007bff",disabled:"#e9ecef",placeholder:"#6E7276",dangerLight:"rgba(220, 53, 69, 0.25)"},input:{},select:{},loader:{size:"0.625rem",padding:"0.375rem 0.75rem",animation:t.css([""," 1.19s ease-in-out infinite"],O),color:"rgba(0, 123, 255, 0.42)"},icon:{color:"#ccc",hoverColor:"#A6A6A6",padding:"0 0.9375rem",clear:{width:"14px",height:"16px",animation:C,transition:"color 0.2s ease-out"},caret:{size:"7px",transition:"transform 0.3s ease-in-out, color 0.2s ease-out"}},control:{minHeight:"38px",borderWidth:"1px",borderStyle:"solid",borderRadius:"3px",boxShadow:"0 0 0 0.2rem",padding:"0.375rem 0.75rem",boxShadowColor:"rgba(0, 123, 255, 0.25)",focusedBorderColor:"rgba(0, 123, 255, 0.75)",transition:"box-shadow 0.2s ease-out, border-color 0.2s ease-out"},menu:{padding:"0",width:"100%",margin:"0.35rem 0",borderRadius:"3px",backgroundColor:"#fff",animation:C,boxShadow:"0 0.5em 1em -0.125em rgb(10 10 10 / 12%), 0 0 0 1px rgb(10 10 10 / 4%)",option:{textAlign:"left",selectedColor:"#fff",selectedBgColor:"#007bff",padding:"0.375rem 0.75rem",focusedBgColor:"rgba(0, 123, 255, 0.15)"}},noOptions:{fontSize:"1.25rem",margin:"0.25rem 0",color:"hsl(0, 0%, 60%)",padding:"0.375rem 0.75rem"},placeholder:{animation:C},multiValue:{margin:"1px 2px",borderRadius:"3px",backgroundColor:"#e7edf3",animation:C,label:{borderRadius:"3px",fontSize:"0.825em",padding:"1px 0 1px 6px"},clear:{fontWeight:600,padding:"0 6px",color:"#a6a6a6",fontSize:"0.65em",alignSelf:"center",focusColor:"#808080",transition:"color 0.2s ease-out"}}},j=function(e){return V(e)?W(_,e):_},K=!!(null===window||void 0===window?void 0:window.ontouchstart)||!!(null===navigator||void 0===navigator?void 0:navigator.maxTouchPoints),U=function(e,n){return n.data.memoOptions&&i.areEqual(e,n)},H=n.memo((function(e){var n=e.index,t=e.style,o=e.data,i=o.menuOptions,r=o.selectOption,a=o.renderOptionLabel,l=o.focusedOptionIndex,d=i[n],c=d.data,s=d.value,f=d.label,p=d.isDisabled,m=d.isSelected,h=function(e,n,t){var o="rfs-option";return e&&(o+=" rfs-option-disabled"),n&&(o+=" rfs-option-selected"),t&&(o+=" rfs-option-focused"),o}(p,m,n===l),g=p?void 0:function(){return r({data:c,value:s,label:f},m)};return u.default.createElement("div",{style:t,onClick:g,className:h},a(c))}),U);H.displayName="Option";var Y=d.default.div.withConfig({displayName:"NoOptionsMsg",componentId:"sc-1on2920-0"})(["text-align:center;color:",";margin:",";padding:",";font-size:",";",""],(function(e){return e.theme.noOptions.color}),(function(e){return e.theme.noOptions.margin}),(function(e){return e.theme.noOptions.padding}),(function(e){return e.theme.noOptions.fontSize}),(function(e){return e.theme.noOptions.css})),X=function(e){var t=e.width,o=e.height,r=e.itemSize,a=e.direction,l=e.isLoading,d=e.loadingMsg,c=e.menuOptions,s=e.memoOptions,f=e.selectOption,p=e.noOptionsMsg,m=e.overscanCount,h=e.itemKeySelector,g=e.fixedSizeListRef,v=e.renderOptionLabel,b=e.focusedOptionIndex,w=n.useMemo((function(){return{menuOptions:c,memoOptions:s,selectOption:f,renderOptionLabel:v,focusedOptionIndex:b}}),[c,s,b,f,v]);if(l)return u.default.createElement(Y,null,d);var y=h?function(e,n){return n.menuOptions[e][h]}:void 0;return u.default.createElement(n.Fragment,null,u.default.createElement(i.FixedSizeList,{width:t,height:o,itemKey:y,itemSize:r,itemData:w,direction:a,ref:g,overscanCount:m,itemCount:c.length},H),!B(c)&&p&&u.default.createElement(Y,null,p))},G=["menuRef","menuTop","menuOpen","onMenuMouseDown","menuPortalTarget"],J=d.default.div.withConfig({displayName:"MenuWrapper",componentId:"sc-105ivps-0"})(["z-index:999;cursor:default;position:absolute;"," "," .","{display:block;overflow:hidden;user-select:none;white-space:nowrap;text-overflow:ellipsis;-webkit-tap-highlight-color:transparent;will-change:top;padding:",";text-align:",";&.",",&:hover:not(.","):not(.","){background-color:",";}&.","{color:",";background-color:",";}&.","{opacity:0.35;}}"],(function(e){var n=e.menuTop,o=e.menuOpen,i=e.hideNoOptionsMsg,r=e.theme.menu;return t.css(["width:",";margin:",";padding:",";animation:",";border-radius:",";background-color:",";box-shadow:",";"," ",""],r.width,r.margin,r.padding,r.animation,r.borderRadius,r.backgroundColor,i?"none":r.boxShadow,!o&&"display: none;",n&&"top: "+n+";")}),(function(e){return e.theme.menu.css}),"rfs-option",(function(e){return e.theme.menu.option.padding}),(function(e){return e.theme.menu.option.textAlign}),"rfs-option-focused","rfs-option-disabled","rfs-option-selected",(function(e){return e.theme.menu.option.focusedBgColor}),"rfs-option-selected",(function(e){return e.theme.menu.option.selectedColor}),(function(e){return e.theme.menu.option.selectedBgColor}),"rfs-option-disabled"),Q=function(e){var n=e.menuRef,t=e.menuTop,o=e.menuOpen,i=e.onMenuMouseDown,a=e.menuPortalTarget,d=c.default(e,G),s=d.menuOptions,f=d.noOptionsMsg,p=o&&!Boolean(f)&&!B(s),m=u.default.createElement(J,{ref:n,menuTop:t,menuOpen:o,onMouseDown:i,className:"rfs-menu-container",hideNoOptionsMsg:p},u.default.createElement(X,l.default({},d)));return a?r.createPortal(m,a):m},Z=t.css(["color:",";"],(function(e){return e.theme.multiValue.clear.focusColor})),$=d.default.div.withConfig({displayName:"MultiValueWrapper",componentId:"sc-1vzivtq-0"})(["min-width:0;display:flex;"," ",""],(function(e){var n=e.theme.multiValue;return t.css(["margin:",";animation:",";border-radius:",";background-color:",";"],n.margin,n.animation,n.borderRadius,n.backgroundColor)}),(function(e){return e.theme.multiValue.css})),ee=d.default.div.withConfig({displayName:"Label",componentId:"sc-1vzivtq-1"})(["overflow:hidden;white-space:nowrap;text-overflow:ellipsis;padding:",";font-size:",";border-radius:",";"],(function(e){return e.theme.multiValue.label.padding}),(function(e){return e.theme.multiValue.label.fontSize}),(function(e){return e.theme.multiValue.label.borderRadius})),ne=d.default.i.withConfig({displayName:"Clear",componentId:"sc-1vzivtq-2"})(["display:flex;font-style:inherit;"," ",""],(function(e){var n=e.theme.multiValue.clear;return t.css(["color:",";padding:",";font-size:",";align-self:",";transition:",";font-weight:",";&:hover{","}"],n.color,n.padding,n.fontSize,n.alignSelf,n.transition,n.fontWeight,Z)}),(function(e){return e.isFocused&&Z})),te=n.memo((function(e){var n=e.data,t=e.value,o=e.isFocused,i=e.renderOptionLabel,r=e.removeSelectedOption,a=i(n),l=function(){return r(t)};return u.default.createElement($,null,u.default.createElement(ee,null,a),u.default.createElement(ne,{isFocused:o,onClick:l,onTouchEnd:l,onMouseDown:F},"✖"))}));te.displayName="MultiValue";var oe=function(){var e=n.useRef(!0);return e.current?(e.current=!1,!0):e.current},ie=function(e,t){var o=oe();n.useEffect((function(){if(!o)return e()}),t)},re=function(e){var t=n.useRef(e);return n.useEffect((function(){t.current=e})),n.useCallback((function(){for(var e,n,o=arguments.length,i=new Array(o),r=0;r<o;r++)i[r]=arguments[r];return null===(n=t.current)||void 0===n?void 0:(e=n).call.apply(e,[t].concat(i))}),[])},ae=function(e,t,o,i,r,a,l,u,d,c,s,f,p){void 0===d&&(d=!1),void 0===c&&(c=!1),void 0===s&&(s=!1),void 0===f&&(f=!1);var m=n.useState(S),h=m[0],v=m[1],b=re(u||E.OPTION_FILTER),w=re(l||E.OPTION_IS_DISABLED),y=f?"":t,O=o===g,x=T(p)?p:s;return n.useEffect((function(){var n=i.length?new Set(i.map((function(e){return e.value}))):null,t=P(y,d,c),o=function(e){var o,i=r(e),l=a(e),u=w(e),s=null!==(o=null==n?void 0:n.has(i))&&void 0!==o&&o,f={data:e,value:i,label:l,isDisabled:u,isSelected:s};if(!(!function(e){if(!t)return!0;var n=b(e),o=P(n,d,c);return O?o.includes(t):o.substr(0,t.length)===t}(f)||x&&s))return f},l=e.reduce((function(e,n){var t=o(n);return t&&e.push(t),e}),[]);v(l)}),[e,y,r,a,i,O,d,c,w,b,x]),h},le=function(e,t,o,i,r,a,l,u,d,c,s,f){var h=n.useRef(!1),g=n.useRef(!u),v=re(d),b=re(c),w=n.useState(a),y=w[0],O=w[1],x=n.useState(!1),C=x[0],I=x[1];n.useEffect((function(){g.current=!C&&!u})),n.useEffect((function(){var n=i===p||i===m&&!function(e){if(!e)return!0;var n=z(e),t=e.getBoundingClientRect(),o=t.top,i=t.height;return n.getBoundingClientRect().height-M(n)-o>=i}(e.current);I(n)}),[e,i]),ie((function(){if(o){var n=function(e){v(),e&&(h.current=!0,O(e))};g.current?function(e,n,t,o){if(e){var i=e.getBoundingClientRect(),r=i.top,a=i.height,l=i.bottom,u=window.innerHeight;if(u-r>=a)o();else{var d=z(e),c=M(d),s=d.getBoundingClientRect().height-c-r,f=s<a;if(!f&&t){var p=getComputedStyle(e).marginBottom;D(d,l-u+c+parseInt(p,10),n,o)}else o(f?s:void 0)}}else o()}(e.current,s,f,n):n()}else b(),h.current&&(h.current=!1,O(a))}),[e,o,a,f,s,b,v]);var S=Math.min(y,l*r),E=C?function(e,n,t){var o,i,r=n&&getComputedStyle(n),a=r?parseInt(r.marginBottom,10):0,l=r?parseInt(r.marginTop,10):0,u=null!==(o=null==t?void 0:t.getBoundingClientRect().height)&&void 0!==o?o:0,d=e>0?e:null!==(i=null==n?void 0:n.getBoundingClientRect().height)&&void 0!==i?i:0;return"calc("+-Math.abs(d+u)+"px + "+(a+l)+"px)"}(S,e.current,t.current):void 0;return[E,S]},ue=t.css(["top:50%;overflow:hidden;position:absolute;white-space:nowrap;box-sizing:border-box;text-overflow:ellipsis;transform:translateY(-50%);"]),de=d.default.div.withConfig({displayName:"SingleValue",componentId:"sc-us7kwl-0"})([""," max-width:calc(100% - 0.5rem);"],ue),ce=d.default.div.withConfig({displayName:"Placeholder",componentId:"sc-us7kwl-1"})([""," color:",";",""],ue,(function(e){return e.theme.color.placeholder}),(function(e){var n=e.theme;return!e.initRender&&t.css(["animation:",";"],n.placeholder.animation)})),se=function(e){var t=e.isMulti,o=e.inputValue,i=e.placeholder,r=e.selectedOption,a=e.focusedMultiValue,l=e.renderOptionLabel,d=e.renderMultiOptions,c=e.removeSelectedOption,s=oe(),f=!B(r);return o&&(!t||t&&(f||d))?null:f?u.default.createElement(ce,{initRender:s},i):t?u.default.createElement(n.Fragment,null,d?d({renderOptionLabel:l,selected:r}):r.map((function(e){var n=e.data,t=e.value;return u.default.createElement(te,{key:t,data:n,value:t,renderOptionLabel:l,isFocused:t===a,removeSelectedOption:c})}))):u.default.createElement(de,null,l(r[0].data))},fe=t.css(["font-size:inherit;font-weight:inherit;font-family:inherit;"]),pe=d.default.div.withConfig({displayName:"SizerDiv",componentId:"sc-4er7q8-0"})(["top:0;left:0;height:0;overflow:scroll;white-space:pre;position:absolute;visibility:hidden;"," ",""],fe,(function(e){return e.theme.input.css})),me=d.default.input.attrs(f).withConfig({displayName:"Input",componentId:"sc-4er7q8-1"})(["border:0;outline:0;padding:0;cursor:text;background:0;color:inherit;box-sizing:content-box;"," :read-only{opacity:0;cursor:default;}:required{","}",""],fe,(function(e){var n=e.theme;return e.isInvalid&&n.input.cssRequired}),(function(e){return e.theme.input.css})),he=n.memo(n.forwardRef((function(e,t){var o=e.id,i=e.onBlur,r=e.onFocus,a=e.readOnly,l=e.required,d=e.onChange,c=e.ariaLabel,s=e.inputValue,f=e.ariaLabelledBy,p=e.hasSelectedOptions,m=!!l&&!p,h=n.useRef(null),g=n.useState(15),v=g[0],b=g[1];return ie((function(){var e=h.current;e&&b(e.scrollWidth+15)}),[s]),u.default.createElement(n.Fragment,null,u.default.createElement(me,{id:o,ref:t,isInvalid:!0,onBlur:i,onFocus:r,value:s,readOnly:a,required:m,"aria-label":c,style:{width:v},"aria-labelledby":f,onChange:a?void 0:d}),u.default.createElement(pe,{ref:h},s))})));he.displayName="AutosizeInput";var ge=d.default.span.withConfig({displayName:"A11yText",componentId:"sc-1yv4bud-0"})(["border:0;padding:0;width:1px;height:1px;margin:-1px;z-index:9999;overflow:hidden;position:absolute;white-space:nowrap;clip:rect(0,0,0,0);"]),ve=function(e){var n=e.menuOpen,t=e.isFocused,o=e.inputValue,i=e.optionCount,r=e.isSearchable,a=e.focusedOption,l=e.selectedOption,d=e.ariaLive,c=void 0===d?"polite":d,s=e.ariaLabel;if(!t)return null;var f=n?"Use Up and Down arrow keys to choose options, press Enter or Tab to select the currently focused option, press Escape to close the menu.":(void 0===s?"Select":s)+" is focused"+(r?", type to filter options":"")+", press Down arrow key to open the menu.",p=a.index,m=a.value,h=a.label,g=a.isDisabled,v=((m&&!g?"Option "+h+" is focused, "+(p+1)+" of "+i+".":"")+" "+(i+" option(s) available"+(o?" for search "+o:"")+".")+" "+f).trimStart(),b="Selected option: "+(l.length?l.map((function(e){return e.label})).join(" "):"N/A");return u.default.createElement(ge,{"aria-atomic":"false","aria-live":c,"aria-relevant":"additions text"},u.default.createElement("span",{id:"aria-selection"},b),u.default.createElement("span",{id:"aria-context"},v))},be=d.default.div.withConfig({displayName:"StyledLoadingDots",componentId:"sc-1tlaoz1-0"})(["display:flex;align-self:center;text-align:center;margin-right:0.25rem;padding:",";> div{border-radius:100%;display:inline-block;"," :nth-of-type(1){animation-delay:-0.272s;}:nth-of-type(2){animation-delay:-0.136s;}}"],(function(e){return e.theme.loader.padding}),(function(e){var n=e.theme;return t.css(["width:",";height:",";animation:",";background-color:",";"],n.loader.size,n.loader.size,n.loader.animation,n.loader.color)})),we=function(){return u.default.createElement(be,{"aria-hidden":!0,className:"rfs-loading-dots"},u.default.createElement("div",null),u.default.createElement("div",null),u.default.createElement("div",null))},ye=d.default.svg.withConfig({displayName:"ClearSvg",componentId:"sc-kkzaaw-0"})(["fill:currentColor;",""],(function(e){var n=e.theme;return t.css(["width:",";height:",";animation:",";transition:",";"],n.icon.clear.width,n.icon.clear.height,n.icon.clear.animation,n.icon.clear.transition)})),Oe=function(){return u.default.createElement(ye,{"aria-hidden":!0,focusable:"false",viewBox:"0 0 14 16",className:"rfs-clear-icon"},u.default.createElement("path",{fillRule:"evenodd",d:"M7.71 8.23l3.75 3.75-1.48 1.48-3.75-3.75-3.75 3.75L1 11.98l3.75-3.75L1 4.48 2.48 3l3.75 3.75L9.98 3l1.48 1.48-3.75 3.75z"}))},xe=d.default.div.withConfig({displayName:"IndicatorIconsWrapper",componentId:"sc-1jozl2i-0"})(["display:flex;flex-shrink:0;align-items:center;align-self:stretch;box-sizing:border-box;"]),Ce=d.default.div.withConfig({displayName:"IndicatorIcon",componentId:"sc-1jozl2i-1"})(["height:100%;display:flex;align-items:center;box-sizing:border-box;color:",";padding:",";:hover{color:",";}",""],(function(e){return e.theme.icon.color}),(function(e){return e.theme.icon.padding}),(function(e){return e.theme.icon.hoverColor}),(function(e){return e.theme.icon.css})),Ie=d.default.div.withConfig({displayName:"Separator",componentId:"sc-1jozl2i-2"})(["width:1px;margin:0.5rem 0;align-self:stretch;box-sizing:border-box;background-color:",";"],(function(e){var n=e.theme;return n.color.iconSeparator||n.color.border})),Se=d.default.div.withConfig({displayName:"Caret",componentId:"sc-1jozl2i-3"})(["transition:",";border-top:"," dashed;border-left:"," solid transparent;border-right:"," solid transparent;",""],(function(e){return e.theme.icon.caret.transition}),(function(e){return e.theme.icon.caret.size}),(function(e){return e.theme.icon.caret.size}),(function(e){return e.theme.icon.caret.size}),(function(e){var n=e.theme,o=e.menuOpen,i=e.isInvalid;return o&&t.css(["transform:rotate(180deg);color:",";"],i?n.color.danger:n.color.caretActive||n.color.primary)})),Ee=n.memo((function(e){var n=e.menuOpen,t=e.clearIcon,o=e.caretIcon,i=e.isInvalid,r=e.showClear,a=e.isLoading,l=e.isDisabled,d=e.loadingNode,c=e.onCaretMouseDown,s=e.onClearMouseDown,f=function(e){return A(e)?e({menuOpen:n,isLoading:a,isInvalid:i,isDisabled:l}):e};return u.default.createElement(xe,null,r&&!a&&u.default.createElement(Ce,{onTouchEnd:s,onMouseDown:s},f(t)||u.default.createElement(Oe,null)),a&&(d||u.default.createElement(we,null)),u.default.createElement(Ie,{role:"none"}),u.default.createElement(Ce,{onTouchEnd:c,onMouseDown:c},f(o)||u.default.createElement(Se,{"aria-hidden":!0,menuOpen:n,isInvalid:i,className:"rfs-caret-icon"})))}));Ee.displayName="IndicatorIcons";var ke=d.default.div.attrs(s).withConfig({displayName:"SelectWrapper",componentId:"sc-kcrmu9-0"})(["position:relative;box-sizing:border-box;",""],(function(e){return e.theme.select.css})),Me=d.default.div.withConfig({displayName:"ValueWrapper",componentId:"sc-kcrmu9-1"})(["flex:1 1 0%;display:flex;flex-wrap:wrap;overflow:hidden;position:relative;align-items:center;box-sizing:border-box;padding:",";"],(function(e){return e.theme.control.padding})),Le=d.default.div.withConfig({displayName:"ControlWrapper",componentId:"sc-kcrmu9-2"})(["outline:0;display:flex;flex-wrap:wrap;cursor:default;position:relative;align-items:center;box-sizing:border-box;justify-content:space-between;"," "," ",""],(function(e){var n=e.isDisabled,o=e.isFocused,i=e.isInvalid,r=e.theme,a=r.control,l=r.color;return t.css(["transition:",";border-style:",";border-width:",";border-radius:",";min-height:",";border-color:",";"," "," "," ",""],a.transition,a.borderStyle,a.borderWidth,a.borderRadius,a.height||a.minHeight,i?l.danger:o?a.focusedBorderColor:l.border,a.height&&"height: "+a.height+";",n&&"pointer-events:none;user-select:none;",(a.backgroundColor||n)&&"background-color: "+(n?l.disabled:a.backgroundColor)+";",o&&"box-shadow: "+a.boxShadow+" "+(i?l.dangerLight:a.boxShadowColor)+";")}),(function(e){return e.theme.control.css}),(function(e){var n=e.isFocused,t=e.theme;return n&&t.control.focusedCss})),Ne=n.forwardRef((function(e,o){var i,r=e.async,a=e.isMulti,d=e.inputId,c=e.selectId,s=e.required,f=e.ariaLive,p=e.autoFocus,m=e.isLoading,O=e.onKeyDown,x=e.clearIcon,C=e.caretIcon,k=e.isInvalid,M=e.ariaLabel,L=e.menuWidth,N=e.isDisabled,z=e.inputDelay,D=e.onMenuOpen,R=e.onMenuClose,V=e.onInputBlur,P=e.isClearable,W=e.themeConfig,_=e.loadingNode,U=e.initialValue,H=e.onInputFocus,Y=e.onInputChange,X=e.ariaLabelledBy,G=e.onOptionChange,J=e.onSearchChange,Z=e.getOptionLabel,$=e.getOptionValue,ee=e.itemKeySelector,ne=e.openMenuOnFocus,te=e.menuPortalTarget,oe=e.isAriaLiveEnabled,ue=e.menuOverscanCount,de=e.blurInputOnSelect,ce=e.menuItemDirection,fe=e.renderOptionLabel,pe=e.renderMultiOptions,me=e.menuScrollDuration,ge=e.filterIgnoreAccents,be=e.hideSelectedOptions,we=e.getIsOptionDisabled,ye=e.getFilterOptionString,Oe=e.isSearchable,xe=void 0===Oe||Oe,Ce=e.memoOptions,Ie=void 0!==Ce&&Ce,Se=e.lazyLoadMenu,Ne=void 0!==Se&&Se,ze=e.openMenuOnClick,De=void 0===ze||ze,Re=e.filterIgnoreCase,Te=void 0===Re||Re,Ae=e.tabSelectsOption,Be=void 0===Ae||Ae,Ve=e.closeMenuOnSelect,Fe=void 0===Ve||Ve,Pe=e.scrollMenuIntoView,qe=void 0===Pe||Pe,We=e.backspaceClearsValue,_e=void 0===We||We,je=e.filterMatchFrom,Ke=void 0===je?g:je,Ue=e.menuPosition,He=void 0===Ue?h:Ue,Ye=e.options,Xe=void 0===Ye?S:Ye,Ge=e.loadingMsg,Je=void 0===Ge?"Loading..":Ge,Qe=e.placeholder,Ze=void 0===Qe?"Select option..":Qe,$e=e.noOptionsMsg,en=void 0===$e?"No options":$e,nn=e.menuItemSize,tn=void 0===nn?35:nn,on=e.menuMaxHeight,rn=void 0===on?300:on,an=n.useRef(!1),ln=n.useRef(),un=n.useRef(!1),dn=n.useRef(A(J)),cn=n.useRef(A(G)),sn=n.useRef(null),fn=n.useRef(null),pn=n.useRef(null),mn=n.useRef(null),hn=n.useState(""),gn=hn[0],vn=hn[1],bn=n.useState(!1),wn=bn[0],yn=bn[1],On=n.useState(!1),xn=On[0],Cn=On[1],In=n.useState(null),Sn=In[0],En=In[1],kn=n.useState(I),Mn=kn[0],Ln=kn[1],Nn=n.useMemo((function(){return j(W)}),[W]),zn=n.useMemo((function(){return Z||E.OPTION_LABEL}),[Z]),Dn=n.useMemo((function(){return $||E.OPTION_VALUE}),[$]),Rn=n.useMemo((function(){return fe||zn}),[fe,zn]),Tn=function(e,t){void 0===t&&(t=0);var o=n.useState(e),i=o[0],r=o[1];return ie((function(){if(!(t<=0)){var n=setTimeout((function(){r(e)}),t);return function(){clearTimeout(n)}}}),[e,t]),t<=0?e:i}(gn,z),An=n.useState((function(){return q(U,Dn,zn)})),Bn=An[0],Vn=An[1],Fn=ae(Xe,Tn,Ke,Bn,Dn,zn,we,ye,Te,ge,a,r,be),Pn=le(fn,mn,wn,He,tn,rn,Fn.length,!!te,D,R,me,qe),qn=Pn[0],Wn=Pn[1],_n=re(J),jn=re(G),Kn=function(){var e;return null===(e=pn.current)||void 0===e?void 0:e.blur()},Un=function(){var e;return null===(e=pn.current)||void 0===e?void 0:e.focus()},Hn=function(e){var n;return null===(n=sn.current)||void 0===n?void 0:n.scrollToItem(e)},Yn=B(Bn),Xn=T(de)?de:K,Gn=n.useCallback((function(e){if(B(Fn)){var n=a?-1:Fn.findIndex((function(e){return e.isSelected})),t=n>-1?n:e===y?0:Fn.length-1;Hn(t),yn(!0),En(null),Ln(l.default({index:t},Fn[t]))}else yn(!0)}),[a,Fn]),Jn=n.useCallback((function(e){Vn((function(n){return n.filter((function(n){return n.value!==e}))}))}),[]),Qn=n.useCallback((function(e,n){n?a&&Jn(e.value):Vn((function(n){return a?[].concat(n,[e]):[e]})),Xn?Kn():Fe&&(vn(""),yn(!1))}),[a,Fe,Jn,Xn]);n.useImperativeHandle(o,(function(){return{empty:!Yn,menuOpen:an.current,blur:Kn,focus:Un,clearValue:function(){Vn(S),Ln(I)},setValue:function(e){var n=q(e,Dn,zn);Vn(n)},toggleMenu:function(e){!0===e||void 0===e&&!an.current?(Un(),Gn(y)):Kn()}}}),[Yn,Dn,zn,Gn]),i=function(){p&&Un()},n.useEffect(i,[]),n.useEffect((function(){an.current=wn}),[wn]),n.useEffect((function(){dn.current=A(J),cn.current=A(G)})),n.useEffect((function(){xn&&ne&&Gn(y)}),[xn,ne,Gn]),n.useEffect((function(){dn.current&&un.current&&(un.current=!1,_n(Tn))}),[_n,Tn]),ie((function(){if(cn.current){var e=a?Bn.map((function(e){return e.data})):B(Bn)?Bn[0].data:null;jn(e)}}),[jn,a,Bn]),ie((function(){var e=Fn.length,n=e>0&&(r||e!==Xe.length||0===ln.current);0===e?Ln(I):(1===e||n)&&(Hn(0),Ln(l.default({index:0},Fn[0]))),ln.current=e}),[r,Xe,Fn]);var Zn=function(){var e=Mn.data,n=Mn.value,t=Mn.label,o=Mn.isSelected,i=Mn.isDisabled;e&&!i&&Qn({data:e,value:n,label:t},o)},$n=function(e){if(B(Fn)){var n=e===b?(Mn.index+1)%Fn.length:Mn.index>0?Mn.index-1:Fn.length-1;Hn(n),En(null),Ln(l.default({index:n},Fn[n]))}},et=function(e){F(e),Un()},nt=function(e){if(!N){xn||Un();var n="INPUT"!==e.target.nodeName;wn?n&&(yn(!1),vn("")):De&&Gn(y),n&&e.preventDefault()}},tt=n.useCallback((function(e){null==V||V(e),Cn(!1),yn(!1),vn("")}),[V]),ot=n.useCallback((function(e){null==H||H(e),Cn(!0)}),[H]),it=n.useCallback((function(e){un.current=!0,null==Y||Y(e.currentTarget.value),vn(e.currentTarget.value),yn(!0)}),[Y]),rt=n.useCallback((function(e){et(e),an.current?yn(!1):Gn(y)}),[Gn]),at=n.useCallback((function(e){et(e),Vn(S)}),[]),lt=!Ne||Ne&&wn,ut=!(!P||N||!Yn),dt=N||!xe||!!Sn,ct=N||De?void 0:rt;return u.default.createElement(t.ThemeProvider,{theme:Nn},u.default.createElement(ke,{id:c,"aria-controls":d,"aria-expanded":wn,onKeyDown:function(e){if(!N){var n=e.key,t=e.shiftKey,o=e.defaultPrevented;if(!O||(O(e,gn,Mn),!o)){switch(n){case"ArrowDown":wn?$n(b):Gn(y);break;case"ArrowUp":wn?$n(v):Gn(w);break;case"ArrowLeft":case"ArrowRight":if(!a||gn||pe)return;!function(e){if(Yn){var n=-1,t=Bn.length-1,o=Sn?Bn.findIndex((function(e){return e.value===Sn})):-1,i=(n="ArrowRight"===e?o>-1&&o<t?o+1:-1:0!==o?-1===o?t:o-1:0)>=0?Bn[n].value:null;Mn.data&&Ln(I),i!==Sn&&En(i)}}(n);break;case" ":if(gn)return;if(wn){if(!Mn.data)return;Zn()}else Gn(y);break;case"Enter":wn&&Zn();break;case"Escape":wn&&(yn(!1),vn(""));break;case"Tab":if(!wn||!Be||!Mn.data||t)return;Zn();break;case"Delete":case"Backspace":if(gn)return;if(Sn){var i=Bn.findIndex((function(e){return e.value===Sn})),r=i>-1&&i<Bn.length-1?Bn[i+1].value:null;Jn(Sn),En(r)}else{if(!_e)return;if(!Yn)break;if(a&&!pe){var l=Bn[Bn.length-1].value;Jn(l)}else P&&Vn(S)}break;default:return}e.preventDefault()}}}},u.default.createElement(Le,{ref:mn,isInvalid:k,isFocused:xn,isDisabled:N,className:"rfs-control-container",onTouchEnd:nt,onMouseDown:nt},u.default.createElement(Me,null,u.default.createElement(se,{isMulti:a,inputValue:gn,placeholder:Ze,selectedOption:Bn,focusedMultiValue:Sn,renderMultiOptions:pe,renderOptionLabel:Rn,removeSelectedOption:Jn}),u.default.createElement(he,{id:d,ref:pn,required:s,ariaLabel:M,inputValue:gn,readOnly:dt,onBlur:tt,onFocus:ot,onChange:it,ariaLabelledBy:X,hasSelectedOptions:Yn})),u.default.createElement(Ee,{menuOpen:wn,clearIcon:x,caretIcon:C,isInvalid:k,isLoading:m,showClear:ut,isDisabled:N,loadingNode:_,onClearMouseDown:at,onCaretMouseDown:ct})),lt&&u.default.createElement(Q,{menuRef:fn,menuOpen:wn,isLoading:m,menuTop:qn,height:Wn,itemSize:tn,loadingMsg:Je,menuOptions:Fn,memoOptions:Ie,fixedSizeListRef:sn,noOptionsMsg:en,selectOption:Qn,direction:ce,itemKeySelector:ee,overscanCount:ue,menuPortalTarget:te,width:L||Nn.menu.width,renderOptionLabel:Rn,focusedOptionIndex:Mn.index,onMenuMouseDown:et}),oe&&u.default.createElement(ve,{ariaLive:f,menuOpen:wn,isFocused:xn,ariaLabel:M,inputValue:gn,isSearchable:xe,focusedOption:Mn,selectedOption:Bn,optionCount:Fn.length})))}));Ne.displayName="Select",exports.Select=Ne; | ||
"use strict";var e=require("@babel/runtime/helpers/extends"),n=require("react"),t=require("styled-components"),o=require("@babel/runtime/helpers/objectWithoutPropertiesLoose"),i=require("react-window"),r=require("react-dom"),a={role:"combobox","aria-haspopup":"listbox",className:"rfs-select-container"},l={tabIndex:0,type:"text",spellCheck:!1,autoCorrect:"off",autoComplete:"off",autoCapitalize:"none","aria-autocomplete":"list",className:"rfs-autosize-input"},u="top",c="auto",s="bottom",d="any",f=0,p=1,m=2,h=3,g=t.keyframes(["0%,80%,100%{transform:scale(0);}40%{transform:scale(1.0);}"]),v=t.keyframes(["from{opacity:0;}to{opacity:1;}"]),b=t.css([""," 0.2s ease-in"],v),w={index:-1},O=[],y={OPTION_LABEL:function(e){return e.label},OPTION_VALUE:function(e){return e.value},OPTION_IS_DISABLED:function(e){return!!e.isDisabled},OPTION_FILTER:function(e){var n=e.label;return"string"==typeof n?n:""+n}},x=/(auto|scroll)/;function C(e){return I(e)?window.pageYOffset:e.scrollTop}function I(e){return e===document.body||e===document.documentElement||e===window}function S(e){var n=e.overflow,t=e.overflowX,o=e.overflowY;return x.test(""+n+t+o)}function E(e){var n=getComputedStyle(e),t=document.documentElement,o="absolute"===n.position;if("fixed"===n.position)return t;for(var i=e;i=null==i?void 0:i.parentElement;)if(n=getComputedStyle(i),(!o||"static"!==n.position)&&S(n))return i;return t}function k(e,n,t,o){void 0===t&&(t=300);var i=0,r=C(e),a=n-r;requestAnimationFrame((function n(){var l,u=a*((l=(l=i+=5)/t-1)*l*l+1)+r;!function(e,n){I(e)?window.scrollTo(0,n):e.scrollTop=n}(e,u),i<t?requestAnimationFrame(n):null==o||o()}))}var L=/[\u0300-\u036f]/g,M=function(e){return"boolean"==typeof e},N=function(e){return"function"==typeof e},z=function(e){return Array.isArray(e)&&!!e.length},D=function(e){return null!==e&&"object"==typeof e&&!Array.isArray(e)},R=function(e){e.preventDefault(),e.stopPropagation()},T=function(e,n,t){var o=e.trim();return n&&(o=o.toLowerCase()),t?o.normalize("NFD").replace(L,""):o},A=function(e,n,t){var o=Array.isArray(e)?e:D(e)?[e]:O;return z(o)?o.map((function(e){return{data:e,value:n(e),label:t(e)}})):o},V=function n(t,o){var i=e({},t);return Object.keys(o).forEach((function(e){var r=o[e];i[e]="animation"!==e&&D(r)?t[e]?n(t[e],r):r:null!=r?r:""})),i},B={color:{border:"#ced4da",danger:"#dc3545",primary:"#007bff",disabled:"#e9ecef",placeholder:"#6E7276",dangerLight:"rgba(220, 53, 69, 0.25)"},input:{},select:{},loader:{size:"0.625rem",padding:"0.375rem 0.75rem",animation:t.css([""," 1.19s ease-in-out infinite"],g),color:"rgba(0, 123, 255, 0.42)"},icon:{color:"#ccc",hoverColor:"#A6A6A6",padding:"0 0.9375rem",clear:{width:"14px",height:"16px",animation:b,transition:"color 0.2s ease-out"},caret:{size:"7px",transition:"transform 0.3s ease-in-out, color 0.2s ease-out"}},control:{minHeight:"38px",borderWidth:"1px",borderStyle:"solid",borderRadius:"3px",boxShadow:"0 0 0 0.2rem",padding:"0.375rem 0.75rem",boxShadowColor:"rgba(0, 123, 255, 0.25)",focusedBorderColor:"rgba(0, 123, 255, 0.75)",transition:"box-shadow 0.2s ease-out, border-color 0.2s ease-out"},menu:{padding:"0",width:"100%",margin:"0.35rem 0",borderRadius:"3px",backgroundColor:"#fff",animation:b,boxShadow:"0 0.5em 1em -0.125em rgb(10 10 10 / 12%), 0 0 0 1px rgb(10 10 10 / 4%)",option:{textAlign:"left",selectedColor:"#fff",selectedBgColor:"#007bff",padding:"0.375rem 0.75rem",focusedBgColor:"rgba(0, 123, 255, 0.15)"}},noOptions:{fontSize:"1.25rem",margin:"0.25rem 0",color:"hsl(0, 0%, 60%)",padding:"0.375rem 0.75rem"},placeholder:{animation:b},multiValue:{margin:"1px 2px",borderRadius:"3px",backgroundColor:"#e7edf3",animation:b,label:{borderRadius:"3px",fontSize:"0.825em",padding:"1px 0 1px 6px"},clear:{fontWeight:600,padding:"0 6px",color:"#a6a6a6",fontSize:"0.65em",alignSelf:"center",focusColor:"#808080",transition:"color 0.2s ease-out"}}},F=function(e){return D(e)?V(B,e):B},P=!!(null===window||void 0===window?void 0:window.ontouchstart)||!!(null===navigator||void 0===navigator?void 0:navigator.maxTouchPoints),q=function(e,n){return n.data.memoOptions&&i.areEqual(e,n)},W=n.memo((function(e){var t=e.index,o=e.style,i=e.data,r=i.menuOptions,a=i.selectOption,l=i.renderOptionLabel,u=i.focusedOptionIndex,c=r[t],s=c.data,d=c.value,f=c.label,p=c.isDisabled,m=c.isSelected,h=function(e,n,t){var o="rfs-option";return e&&(o+=" rfs-option-disabled"),n&&(o+=" rfs-option-selected"),t&&(o+=" rfs-option-focused"),o}(p,m,t===u),g=p?void 0:function(){return a({data:s,value:d,label:f},m)};return n.createElement("div",{style:o,onClick:g,className:h},l(s))}),q);W.displayName="Option";var _=t.div.withConfig({displayName:"NoOptionsMsg",componentId:"sc-1on2920-0"})(["text-align:center;color:",";margin:",";padding:",";font-size:",";",""],(function(e){return e.theme.noOptions.color}),(function(e){return e.theme.noOptions.margin}),(function(e){return e.theme.noOptions.padding}),(function(e){return e.theme.noOptions.fontSize}),(function(e){return e.theme.noOptions.css})),j=function(e){var t=e.width,o=e.height,r=e.itemSize,a=e.direction,l=e.isLoading,u=e.loadingMsg,c=e.menuOptions,s=e.memoOptions,d=e.selectOption,f=e.noOptionsMsg,p=e.overscanCount,m=e.itemKeySelector,h=e.fixedSizeListRef,g=e.renderOptionLabel,v=e.focusedOptionIndex,b=n.useMemo((function(){return{menuOptions:c,memoOptions:s,selectOption:d,renderOptionLabel:g,focusedOptionIndex:v}}),[c,s,v,d,g]);if(l)return n.createElement(_,null,u);var w=m?function(e,n){return n.menuOptions[e][m]}:void 0;return n.createElement(n.Fragment,null,n.createElement(i.FixedSizeList,{width:t,height:o,itemKey:w,itemSize:r,itemData:b,direction:a,ref:h,overscanCount:p,itemCount:c.length},W),!z(c)&&f&&n.createElement(_,null,f))},K=["menuRef","menuTop","menuOpen","onMenuMouseDown","menuPortalTarget"],U=t.div.withConfig({displayName:"MenuWrapper",componentId:"sc-105ivps-0"})(["z-index:999;cursor:default;position:absolute;"," "," .","{display:block;overflow:hidden;user-select:none;white-space:nowrap;text-overflow:ellipsis;-webkit-tap-highlight-color:transparent;will-change:top;padding:",";text-align:",";&.",",&:hover:not(.","):not(.","){background-color:",";}&.","{color:",";background-color:",";}&.","{opacity:0.35;}}"],(function(e){var n=e.menuTop,o=e.menuOpen,i=e.hideNoOptionsMsg,r=e.theme.menu;return t.css(["width:",";margin:",";padding:",";animation:",";border-radius:",";background-color:",";box-shadow:",";"," ",""],r.width,r.margin,r.padding,r.animation,r.borderRadius,r.backgroundColor,i?"none":r.boxShadow,!o&&"display: none;",n&&"top: "+n+";")}),(function(e){return e.theme.menu.css}),"rfs-option",(function(e){return e.theme.menu.option.padding}),(function(e){return e.theme.menu.option.textAlign}),"rfs-option-focused","rfs-option-disabled","rfs-option-selected",(function(e){return e.theme.menu.option.focusedBgColor}),"rfs-option-selected",(function(e){return e.theme.menu.option.selectedColor}),(function(e){return e.theme.menu.option.selectedBgColor}),"rfs-option-disabled"),H=function(t){var i=t.menuRef,a=t.menuTop,l=t.menuOpen,u=t.onMenuMouseDown,c=t.menuPortalTarget,s=o(t,K),d=s.menuOptions,f=s.noOptionsMsg,p=l&&!f&&!z(d),m=n.createElement(U,{ref:i,menuTop:a,menuOpen:l,onMouseDown:u,className:"rfs-menu-container",hideNoOptionsMsg:p},n.createElement(j,e({},s)));return c?r.createPortal(m,c):m},Y=t.css(["color:",";"],(function(e){return e.theme.multiValue.clear.focusColor})),X=t.div.withConfig({displayName:"MultiValueWrapper",componentId:"sc-1vzivtq-0"})(["min-width:0;display:flex;"," ",""],(function(e){var n=e.theme.multiValue;return t.css(["margin:",";animation:",";border-radius:",";background-color:",";"],n.margin,n.animation,n.borderRadius,n.backgroundColor)}),(function(e){return e.theme.multiValue.css})),G=t.div.withConfig({displayName:"Label",componentId:"sc-1vzivtq-1"})(["overflow:hidden;white-space:nowrap;text-overflow:ellipsis;padding:",";font-size:",";border-radius:",";"],(function(e){return e.theme.multiValue.label.padding}),(function(e){return e.theme.multiValue.label.fontSize}),(function(e){return e.theme.multiValue.label.borderRadius})),J=t.i.withConfig({displayName:"Clear",componentId:"sc-1vzivtq-2"})(["display:flex;font-style:inherit;"," ",""],(function(e){var n=e.theme.multiValue.clear;return t.css(["color:",";padding:",";font-size:",";align-self:",";transition:",";font-weight:",";&:hover{","}"],n.color,n.padding,n.fontSize,n.alignSelf,n.transition,n.fontWeight,Y)}),(function(e){return e.isFocused&&Y})),Q=n.memo((function(e){var t=e.data,o=e.value,i=e.isFocused,r=e.renderOptionLabel,a=e.removeSelectedOption,l=r(t),u=function(){return a(o)};return n.createElement(X,null,n.createElement(G,null,l),n.createElement(J,{isFocused:i,onClick:u,onTouchEnd:u,onMouseDown:R},"✖"))}));Q.displayName="MultiValue";var Z=function(){var e=n.useRef(!0);return e.current?(e.current=!1,!0):e.current},$=function(e,t){var o=Z();n.useEffect((function(){if(!o)return e()}),t)},ee=function(e){var t=n.useRef(e);return n.useEffect((function(){t.current=e})),n.useCallback((function(){for(var e,n,o=arguments.length,i=new Array(o),r=0;r<o;r++)i[r]=arguments[r];return null===(n=t.current)||void 0===n?void 0:(e=n).call.apply(e,[t].concat(i))}),[])},ne=function(e,t,o,i,r,a,l,u,c,s,f,p,m){void 0===c&&(c=!1),void 0===s&&(s=!1),void 0===f&&(f=!1),void 0===p&&(p=!1);var h=n.useState(O),g=h[0],v=h[1],b=ee(u||y.OPTION_FILTER),w=ee(l||y.OPTION_IS_DISABLED),x=p?"":t,C=o===d,I=M(m)?m:f;return n.useEffect((function(){var n=i.length?new Set(i.map((function(e){return e.value}))):null,t=T(x,c,s),o=function(e){var o,i=r(e),l=a(e),u=w(e),d=null!==(o=null==n?void 0:n.has(i))&&void 0!==o&&o,f={data:e,value:i,label:l,isDisabled:u,isSelected:d};if(!(!function(e){if(!t)return!0;var n=b(e),o=T(n,c,s);return C?o.includes(t):o.substr(0,t.length)===t}(f)||I&&d))return f},l=e.reduce((function(e,n){var t=o(n);return t&&e.push(t),e}),[]);v(l)}),[e,x,r,a,i,C,c,s,w,b,I]),g},te=function(e,t,o,i,r,a,l,s,d,f,p,m){var h=n.useRef(!1),g=n.useRef(!s),v=ee(d),b=ee(f),w=n.useState(a),O=w[0],y=w[1],x=n.useState(!1),I=x[0],S=x[1];n.useEffect((function(){g.current=!I&&!s})),n.useEffect((function(){var n=i===u||i===c&&!function(e){if(!e)return!0;var n=E(e),t=e.getBoundingClientRect(),o=t.top,i=t.height;return n.getBoundingClientRect().height-C(n)-o>=i}(e.current);S(n)}),[e,i]),$((function(){if(o){var n=function(e){v(),e&&(h.current=!0,y(e))};g.current?function(e,n,t,o){if(e){var i=e.getBoundingClientRect(),r=i.top,a=i.height,l=i.bottom,u=window.innerHeight;if(u-r>=a)o();else{var c=E(e),s=C(c),d=c.getBoundingClientRect().height-s-r,f=d<a;if(!f&&t){var p=getComputedStyle(e).marginBottom;k(c,l-u+s+parseInt(p,10),n,o)}else o(f?d:void 0)}}else o()}(e.current,p,m,n):n()}else b(),h.current&&(h.current=!1,y(a))}),[e,o,a,m,p,b,v]);var L=Math.min(O,l*r),M=I?function(e,n,t){var o,i,r=n&&getComputedStyle(n),a=r?parseInt(r.marginBottom,10):0,l=r?parseInt(r.marginTop,10):0,u=null!==(o=null==t?void 0:t.getBoundingClientRect().height)&&void 0!==o?o:0,c=e>0?e:null!==(i=null==n?void 0:n.getBoundingClientRect().height)&&void 0!==i?i:0;return"calc("+-Math.abs(c+u)+"px + "+(a+l)+"px)"}(L,e.current,t.current):void 0;return[M,L]},oe=t.css(["top:50%;overflow:hidden;position:absolute;white-space:nowrap;box-sizing:border-box;text-overflow:ellipsis;transform:translateY(-50%);"]),ie=t.div.withConfig({displayName:"SingleValue",componentId:"sc-us7kwl-0"})([""," max-width:calc(100% - 0.5rem);"],oe),re=t.div.withConfig({displayName:"Placeholder",componentId:"sc-us7kwl-1"})([""," color:",";",""],oe,(function(e){return e.theme.color.placeholder}),(function(e){var n=e.theme;return!e.initRender&&t.css(["animation:",";"],n.placeholder.animation)})),ae=function(e){var t=e.isMulti,o=e.inputValue,i=e.placeholder,r=e.selectedOption,a=e.focusedMultiValue,l=e.renderOptionLabel,u=e.renderMultiOptions,c=e.removeSelectedOption,s=Z(),d=!z(r);return o&&(!t||t&&(d||u))?null:d?n.createElement(re,{initRender:s},i):t?n.createElement(n.Fragment,null,u?u({renderOptionLabel:l,selected:r}):r.map((function(e){var t=e.data,o=e.value;return n.createElement(Q,{key:o,data:t,value:o,renderOptionLabel:l,isFocused:o===a,removeSelectedOption:c})}))):n.createElement(ie,null,l(r[0].data))},le=t.css(["font-size:inherit;font-weight:inherit;font-family:inherit;"]),ue=t.div.withConfig({displayName:"SizerDiv",componentId:"sc-4er7q8-0"})(["top:0;left:0;height:0;overflow:scroll;white-space:pre;position:absolute;visibility:hidden;"," ",""],le,(function(e){return e.theme.input.css})),ce=t.input.attrs(l).withConfig({displayName:"Input",componentId:"sc-4er7q8-1"})(["border:0;outline:0;padding:0;cursor:text;background:0;color:inherit;box-sizing:content-box;"," :read-only{opacity:0;cursor:default;}:required{","}",""],le,(function(e){var n=e.theme;return e.isInvalid&&n.input.cssRequired}),(function(e){return e.theme.input.css})),se=n.memo(n.forwardRef((function(e,t){var o=e.id,i=e.onBlur,r=e.onFocus,a=e.readOnly,l=e.required,u=e.onChange,c=e.ariaLabel,s=e.inputValue,d=e.ariaLabelledBy,f=e.hasSelectedOptions,p=!!l&&!f,m=n.useRef(null),h=n.useState(15),g=h[0],v=h[1];return $((function(){var e=m.current;e&&v(e.scrollWidth+15)}),[s]),n.createElement(n.Fragment,null,n.createElement(ce,{id:o,ref:t,isInvalid:!0,onBlur:i,onFocus:r,value:s,readOnly:a,required:p,"aria-label":c,style:{width:g},"aria-labelledby":d,onChange:a?void 0:u}),n.createElement(ue,{ref:m},s))})));se.displayName="AutosizeInput";var de=t.span.withConfig({displayName:"A11yText",componentId:"sc-1yv4bud-0"})(["border:0;padding:0;width:1px;height:1px;margin:-1px;z-index:9999;overflow:hidden;position:absolute;white-space:nowrap;clip:rect(0,0,0,0);"]),fe=function(e){var t=e.menuOpen,o=e.isFocused,i=e.inputValue,r=e.optionCount,a=e.isSearchable,l=e.focusedOption,u=e.selectedOption,c=e.ariaLive,s=void 0===c?"polite":c,d=e.ariaLabel;if(!o)return null;var f=t?"Use Up and Down arrow keys to choose options, press Enter or Tab to select the currently focused option, press Escape to close the menu.":(void 0===d?"Select":d)+" is focused"+(a?", type to filter options":"")+", press Down arrow key to open the menu.",p=l.index,m=l.value,h=l.label,g=l.isDisabled,v=((m&&!g?"Option "+h+" is focused, "+(p+1)+" of "+r+".":"")+" "+(r+" option(s) available"+(i?" for search "+i:"")+".")+" "+f).trimStart(),b="Selected option: "+(u.length?u.map((function(e){return e.label})).join(" "):"N/A");return n.createElement(de,{"aria-atomic":"false","aria-live":s,"aria-relevant":"additions text"},n.createElement("span",{id:"aria-selection"},b),n.createElement("span",{id:"aria-context"},v))},pe=t.div.withConfig({displayName:"StyledLoadingDots",componentId:"sc-1tlaoz1-0"})(["display:flex;align-self:center;text-align:center;margin-right:0.25rem;padding:",";> div{border-radius:100%;display:inline-block;"," :nth-of-type(1){animation-delay:-0.272s;}:nth-of-type(2){animation-delay:-0.136s;}}"],(function(e){return e.theme.loader.padding}),(function(e){var n=e.theme;return t.css(["width:",";height:",";animation:",";background-color:",";"],n.loader.size,n.loader.size,n.loader.animation,n.loader.color)})),me=function(){return n.createElement(pe,{"aria-hidden":!0,className:"rfs-loading-dots"},n.createElement("div",null),n.createElement("div",null),n.createElement("div",null))},he=t.svg.withConfig({displayName:"ClearSvg",componentId:"sc-kkzaaw-0"})(["fill:currentColor;",""],(function(e){var n=e.theme;return t.css(["width:",";height:",";animation:",";transition:",";"],n.icon.clear.width,n.icon.clear.height,n.icon.clear.animation,n.icon.clear.transition)})),ge=function(){return n.createElement(he,{"aria-hidden":!0,focusable:"false",viewBox:"0 0 14 16",className:"rfs-clear-icon"},n.createElement("path",{fillRule:"evenodd",d:"M7.71 8.23l3.75 3.75-1.48 1.48-3.75-3.75-3.75 3.75L1 11.98l3.75-3.75L1 4.48 2.48 3l3.75 3.75L9.98 3l1.48 1.48-3.75 3.75z"}))},ve=t.div.withConfig({displayName:"IndicatorIconsWrapper",componentId:"sc-1jozl2i-0"})(["display:flex;flex-shrink:0;align-items:center;align-self:stretch;box-sizing:border-box;"]),be=t.div.withConfig({displayName:"IndicatorIcon",componentId:"sc-1jozl2i-1"})(["height:100%;display:flex;align-items:center;box-sizing:border-box;color:",";padding:",";:hover{color:",";}",""],(function(e){return e.theme.icon.color}),(function(e){return e.theme.icon.padding}),(function(e){return e.theme.icon.hoverColor}),(function(e){return e.theme.icon.css})),we=t.div.withConfig({displayName:"Separator",componentId:"sc-1jozl2i-2"})(["width:1px;margin:0.5rem 0;align-self:stretch;box-sizing:border-box;background-color:",";"],(function(e){var n=e.theme;return n.color.iconSeparator||n.color.border})),Oe=t.div.withConfig({displayName:"Caret",componentId:"sc-1jozl2i-3"})(["transition:",";border-top:"," dashed;border-left:"," solid transparent;border-right:"," solid transparent;",""],(function(e){return e.theme.icon.caret.transition}),(function(e){return e.theme.icon.caret.size}),(function(e){return e.theme.icon.caret.size}),(function(e){return e.theme.icon.caret.size}),(function(e){var n=e.theme,o=e.menuOpen,i=e.isInvalid;return o&&t.css(["transform:rotate(180deg);color:",";"],i?n.color.danger:n.color.caretActive||n.color.primary)})),ye=n.memo((function(e){var t=e.menuOpen,o=e.clearIcon,i=e.caretIcon,r=e.isInvalid,a=e.showClear,l=e.isLoading,u=e.isDisabled,c=e.loadingNode,s=e.onCaretMouseDown,d=e.onClearMouseDown,f=function(e){return N(e)?e({menuOpen:t,isLoading:l,isInvalid:r,isDisabled:u}):e};return n.createElement(ve,null,a&&!l&&n.createElement(be,{onTouchEnd:d,onMouseDown:d},f(o)||n.createElement(ge,null)),l&&(c||n.createElement(me,null)),n.createElement(we,{role:"none"}),n.createElement(be,{onTouchEnd:s,onMouseDown:s},f(i)||n.createElement(Oe,{"aria-hidden":!0,menuOpen:t,isInvalid:r,className:"rfs-caret-icon"})))}));ye.displayName="IndicatorIcons";var xe=t.div.attrs(a).withConfig({displayName:"SelectWrapper",componentId:"sc-kcrmu9-0"})(["position:relative;box-sizing:border-box;",""],(function(e){return e.theme.select.css})),Ce=t.div.withConfig({displayName:"ValueWrapper",componentId:"sc-kcrmu9-1"})(["flex:1 1 0%;display:flex;flex-wrap:wrap;overflow:hidden;position:relative;align-items:center;box-sizing:border-box;padding:",";"],(function(e){return e.theme.control.padding})),Ie=t.div.withConfig({displayName:"ControlWrapper",componentId:"sc-kcrmu9-2"})(["outline:0;display:flex;flex-wrap:wrap;cursor:default;position:relative;align-items:center;box-sizing:border-box;justify-content:space-between;"," "," ",""],(function(e){var n=e.isDisabled,o=e.isFocused,i=e.isInvalid,r=e.theme,a=r.control,l=r.color;return t.css(["transition:",";border-style:",";border-width:",";border-radius:",";min-height:",";border-color:",";"," "," "," ",""],a.transition,a.borderStyle,a.borderWidth,a.borderRadius,a.height||a.minHeight,i?l.danger:o?a.focusedBorderColor:l.border,a.height&&"height: "+a.height+";",n&&"pointer-events:none;user-select:none;",(a.backgroundColor||n)&&"background-color: "+(n?l.disabled:a.backgroundColor)+";",o&&"box-shadow: "+a.boxShadow+" "+(i?l.dangerLight:a.boxShadowColor)+";")}),(function(e){return e.theme.control.css}),(function(e){var n=e.isFocused,t=e.theme;return n&&t.control.focusedCss})),Se=n.forwardRef((function(o,i){var r,a=o.async,l=o.isMulti,u=o.inputId,c=o.selectId,g=o.required,v=o.ariaLive,b=o.autoFocus,x=o.isLoading,C=o.onKeyDown,I=o.clearIcon,S=o.caretIcon,E=o.isInvalid,k=o.ariaLabel,L=o.menuWidth,D=o.isDisabled,T=o.inputDelay,V=o.onMenuOpen,B=o.onMenuClose,q=o.onInputBlur,W=o.isClearable,_=o.themeConfig,j=o.loadingNode,K=o.initialValue,U=o.onInputFocus,Y=o.onInputChange,X=o.ariaLabelledBy,G=o.onOptionChange,J=o.onSearchChange,Q=o.getOptionLabel,Z=o.getOptionValue,oe=o.itemKeySelector,ie=o.openMenuOnFocus,re=o.menuPortalTarget,le=o.isAriaLiveEnabled,ue=o.menuOverscanCount,ce=o.blurInputOnSelect,de=o.menuItemDirection,pe=o.renderOptionLabel,me=o.renderMultiOptions,he=o.menuScrollDuration,ge=o.filterIgnoreAccents,ve=o.hideSelectedOptions,be=o.getIsOptionDisabled,we=o.getFilterOptionString,Oe=o.isSearchable,Se=void 0===Oe||Oe,Ee=o.memoOptions,ke=void 0!==Ee&&Ee,Le=o.lazyLoadMenu,Me=void 0!==Le&&Le,Ne=o.openMenuOnClick,ze=void 0===Ne||Ne,De=o.filterIgnoreCase,Re=void 0===De||De,Te=o.tabSelectsOption,Ae=void 0===Te||Te,Ve=o.closeMenuOnSelect,Be=void 0===Ve||Ve,Fe=o.scrollMenuIntoView,Pe=void 0===Fe||Fe,qe=o.backspaceClearsValue,We=void 0===qe||qe,_e=o.filterMatchFrom,je=void 0===_e?d:_e,Ke=o.menuPosition,Ue=void 0===Ke?s:Ke,He=o.options,Ye=void 0===He?O:He,Xe=o.loadingMsg,Ge=void 0===Xe?"Loading..":Xe,Je=o.placeholder,Qe=void 0===Je?"Select option..":Je,Ze=o.noOptionsMsg,$e=void 0===Ze?"No options":Ze,en=o.menuItemSize,nn=void 0===en?35:en,tn=o.menuMaxHeight,on=void 0===tn?300:tn,rn=n.useRef(!1),an=n.useRef(),ln=n.useRef(!1),un=n.useRef(N(J)),cn=n.useRef(N(G)),sn=n.useRef(null),dn=n.useRef(null),fn=n.useRef(null),pn=n.useRef(null),mn=n.useState(""),hn=mn[0],gn=mn[1],vn=n.useState(!1),bn=vn[0],wn=vn[1],On=n.useState(!1),yn=On[0],xn=On[1],Cn=n.useState(null),In=Cn[0],Sn=Cn[1],En=n.useState(w),kn=En[0],Ln=En[1],Mn=n.useMemo((function(){return F(_)}),[_]),Nn=n.useMemo((function(){return Q||y.OPTION_LABEL}),[Q]),zn=n.useMemo((function(){return Z||y.OPTION_VALUE}),[Z]),Dn=n.useMemo((function(){return pe||Nn}),[pe,Nn]),Rn=function(e,t){void 0===t&&(t=0);var o=n.useState(e),i=o[0],r=o[1];return $((function(){if(!(t<=0)){var n=setTimeout((function(){r(e)}),t);return function(){clearTimeout(n)}}}),[e,t]),t<=0?e:i}(hn,T),Tn=n.useState((function(){return A(K,zn,Nn)})),An=Tn[0],Vn=Tn[1],Bn=ne(Ye,Rn,je,An,zn,Nn,be,we,Re,ge,l,a,ve),Fn=te(dn,pn,bn,Ue,nn,on,Bn.length,!!re,V,B,he,Pe),Pn=Fn[0],qn=Fn[1],Wn=ee(J),_n=ee(G),jn=function(){var e;return null===(e=fn.current)||void 0===e?void 0:e.blur()},Kn=function(){var e;return null===(e=fn.current)||void 0===e?void 0:e.focus()},Un=function(e){var n;return null===(n=sn.current)||void 0===n?void 0:n.scrollToItem(e)},Hn=z(An),Yn=M(ce)?ce:P,Xn=n.useCallback((function(n){if(z(Bn)){var t=l?-1:Bn.findIndex((function(e){return e.isSelected})),o=t>-1?t:n===h?0:Bn.length-1;Un(o),wn(!0),Sn(null),Ln(e({index:o},Bn[o]))}else wn(!0)}),[l,Bn]),Gn=n.useCallback((function(e){Vn((function(n){return n.filter((function(n){return n.value!==e}))}))}),[]),Jn=n.useCallback((function(e,n){n?l&&Gn(e.value):Vn((function(n){return l?[].concat(n,[e]):[e]})),Yn?jn():Be&&(gn(""),wn(!1))}),[l,Be,Gn,Yn]);n.useImperativeHandle(i,(function(){return{empty:!Hn,menuOpen:rn.current,blur:jn,focus:Kn,clearValue:function(){Vn(O),Ln(w)},setValue:function(e){var n=A(e,zn,Nn);Vn(n)},toggleMenu:function(e){!0===e||void 0===e&&!rn.current?(Kn(),Xn(h)):jn()}}}),[Hn,zn,Nn,Xn]),r=function(){b&&Kn()},n.useEffect(r,[]),n.useEffect((function(){rn.current=bn}),[bn]),n.useEffect((function(){un.current=N(J),cn.current=N(G)})),n.useEffect((function(){yn&&ie&&Xn(h)}),[yn,ie,Xn]),n.useEffect((function(){un.current&&ln.current&&(ln.current=!1,Wn(Rn))}),[Wn,Rn]),$((function(){if(cn.current){var e=l?An.map((function(e){return e.data})):z(An)?An[0].data:null;_n(e)}}),[_n,l,An]),$((function(){var n=Bn.length,t=n>0&&(a||n!==Ye.length||0===an.current);0===n?Ln(w):(1===n||t)&&(Un(0),Ln(e({index:0},Bn[0]))),an.current=n}),[a,Ye,Bn]);var Qn=function(){var e=kn.data,n=kn.value,t=kn.label,o=kn.isSelected,i=kn.isDisabled;e&&!i&&Jn({data:e,value:n,label:t},o)},Zn=function(n){if(z(Bn)){var t=n===p?(kn.index+1)%Bn.length:kn.index>0?kn.index-1:Bn.length-1;Un(t),Sn(null),Ln(e({index:t},Bn[t]))}},$n=function(e){R(e),Kn()},et=function(e){if(!D){yn||Kn();var n="INPUT"!==e.target.nodeName;bn?n&&(wn(!1),gn("")):ze&&Xn(h),n&&e.preventDefault()}},nt=n.useCallback((function(e){null==q||q(e),xn(!1),wn(!1),gn("")}),[q]),tt=n.useCallback((function(e){null==U||U(e),xn(!0)}),[U]),ot=n.useCallback((function(e){ln.current=!0,null==Y||Y(e.currentTarget.value),gn(e.currentTarget.value),wn(!0)}),[Y]),it=n.useCallback((function(e){$n(e),rn.current?wn(!1):Xn(h)}),[Xn]),rt=n.useCallback((function(e){$n(e),Vn(O)}),[]),at=!Me||Me&&bn,lt=!(!W||D||!Hn),ut=D||!Se||!!In,ct=D||ze?void 0:it;return n.createElement(t.ThemeProvider,{theme:Mn},n.createElement(xe,{id:c,"aria-controls":u,"aria-expanded":bn,onKeyDown:function(e){if(!D){var n=e.key,t=e.shiftKey,o=e.defaultPrevented;if(!C||(C(e,hn,kn),!o)){switch(n){case"ArrowDown":bn?Zn(p):Xn(h);break;case"ArrowUp":bn?Zn(f):Xn(m);break;case"ArrowLeft":case"ArrowRight":if(!l||hn||me)return;!function(e){if(Hn){var n=-1,t=An.length-1,o=In?An.findIndex((function(e){return e.value===In})):-1,i=(n="ArrowRight"===e?o>-1&&o<t?o+1:-1:0!==o?-1===o?t:o-1:0)>=0?An[n].value:null;kn.data&&Ln(w),i!==In&&Sn(i)}}(n);break;case" ":if(hn)return;if(bn){if(!kn.data)return;Qn()}else Xn(h);break;case"Enter":bn&&Qn();break;case"Escape":bn&&(wn(!1),gn(""));break;case"Tab":if(!bn||!Ae||!kn.data||t)return;Qn();break;case"Delete":case"Backspace":if(hn)return;if(In){var i=An.findIndex((function(e){return e.value===In})),r=i>-1&&i<An.length-1?An[i+1].value:null;Gn(In),Sn(r)}else{if(!We)return;if(!Hn)break;if(l&&!me){var a=An[An.length-1].value;Gn(a)}else W&&Vn(O)}break;default:return}e.preventDefault()}}}},n.createElement(Ie,{ref:pn,isInvalid:E,isFocused:yn,isDisabled:D,className:"rfs-control-container",onTouchEnd:et,onMouseDown:et},n.createElement(Ce,null,n.createElement(ae,{isMulti:l,inputValue:hn,placeholder:Qe,selectedOption:An,focusedMultiValue:In,renderMultiOptions:me,renderOptionLabel:Dn,removeSelectedOption:Gn}),n.createElement(se,{id:u,ref:fn,required:g,ariaLabel:k,inputValue:hn,readOnly:ut,onBlur:nt,onFocus:tt,onChange:ot,ariaLabelledBy:X,hasSelectedOptions:Hn})),n.createElement(ye,{menuOpen:bn,clearIcon:I,caretIcon:S,isInvalid:E,isLoading:x,showClear:lt,isDisabled:D,loadingNode:j,onClearMouseDown:rt,onCaretMouseDown:ct})),at&&n.createElement(H,{menuRef:dn,menuOpen:bn,isLoading:x,menuTop:Pn,height:qn,itemSize:nn,loadingMsg:Ge,menuOptions:Bn,memoOptions:ke,fixedSizeListRef:sn,noOptionsMsg:$e,selectOption:Jn,direction:de,itemKeySelector:oe,overscanCount:ue,menuPortalTarget:re,width:L||Mn.menu.width,renderOptionLabel:Dn,focusedOptionIndex:kn.index,onMenuMouseDown:$n}),le&&n.createElement(fe,{ariaLive:v,menuOpen:bn,isFocused:yn,ariaLabel:k,inputValue:hn,isSearchable:Se,focusedOption:kn,selectedOption:An,optionCount:Bn.length})))}));Se.displayName="Select",exports.Select=Se; |
@@ -1,1 +0,1 @@ | ||
import e from"@babel/runtime/helpers/esm/extends";import n,{memo as r,useMemo as t,Fragment as o,useRef as i,useEffect as a,useState as l,useCallback as d,forwardRef as s,useImperativeHandle as u}from"react";import c,{css as p,keyframes as m,ThemeProvider as v}from"styled-components";import h from"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";import{areEqual as g,FixedSizeList as f}from"react-window";import{createPortal as b}from"react-dom";var w={role:"combobox","aria-haspopup":"listbox",className:"rfs-select-container"},O={tabIndex:0,type:"text",spellCheck:!1,autoCorrect:"off",autoComplete:"off",autoCapitalize:"none","aria-autocomplete":"list",className:"rfs-autosize-input"},x={TOP:"top",AUTO:"auto",BOTTOM:"bottom"},y={ANY:"any",START:"start"},C=0,I=1,S=2,E=3,N=m(["0%,80%,100%{transform:scale(0);}40%{transform:scale(1.0);}"]),L=p([""," 0.2s ease-in"],m(["from{opacity:0;}to{opacity:1;}"])),M=35,z=300,T="Loading..",k="No options",D="Select option..",A={index:-1},B=[],R={OPTION_LABEL:e=>{var{label:n}=e;return n},OPTION_VALUE:e=>{var{value:n}=e;return n},OPTION_IS_DISABLED:e=>{var{isDisabled:n}=e;return!!n},OPTION_FILTER:e=>{var{label:n}=e;return"string"==typeof n?n:""+n}},V=/(auto|scroll)/;function F(e){return P(e)?window.pageYOffset:e.scrollTop}function P(e){return e===document.body||e===document.documentElement||e===window}function q(e){var{overflow:n,overflowX:r,overflowY:t}=e;return V.test(""+n+r+t)}function W(e){var n=getComputedStyle(e),r=document.documentElement,t="absolute"===n.position;if("fixed"===n.position)return r;for(var o=e;o=null==o?void 0:o.parentElement;)if(n=getComputedStyle(o),(!t||"static"!==n.position)&&q(n))return o;return r}function _(e,n,r,t){void 0===r&&(r=300);var o=0,i=F(e),a=n-i;requestAnimationFrame((function n(){var l,d=a*((l=(l=o+=5)/r-1)*l*l+1)+i;!function(e,n){P(e)?window.scrollTo(0,n):e.scrollTop=n}(e,d),o<r?requestAnimationFrame(n):null==t||t()}))}var j=/[\u0300-\u036f]/g,U=e=>"boolean"==typeof e,K=e=>"function"==typeof e,Y=e=>Array.isArray(e)&&!!e.length,H=e=>null!==e&&"object"==typeof e&&!Array.isArray(e),X=e=>{e.preventDefault(),e.stopPropagation()},G=(e,n,r)=>{var t=e.trim();return n&&(t=t.toLowerCase()),r?t.normalize("NFD").replace(j,""):t},J=(e,n,r)=>{var t=Array.isArray(e)?e:H(e)?[e]:B;return Y(t)?t.map((e=>({data:e,value:n(e),label:r(e)}))):t},Q=(n,r)=>{var t=e({},n);return Object.keys(r).forEach((e=>{var o=r[e];t[e]="animation"!==e&&H(o)?n[e]?Q(n[e],o):o:null!=o?o:""})),t},Z={color:{border:"#ced4da",danger:"#dc3545",primary:"#007bff",disabled:"#e9ecef",placeholder:"#6E7276",dangerLight:"rgba(220, 53, 69, 0.25)"},input:{},select:{},loader:{size:"0.625rem",padding:"0.375rem 0.75rem",animation:p([""," 1.19s ease-in-out infinite"],N),color:"rgba(0, 123, 255, 0.42)"},icon:{color:"#ccc",hoverColor:"#A6A6A6",padding:"0 0.9375rem",clear:{width:"14px",height:"16px",animation:L,transition:"color 0.2s ease-out"},caret:{size:"7px",transition:"transform 0.3s ease-in-out, color 0.2s ease-out"}},control:{minHeight:"38px",borderWidth:"1px",borderStyle:"solid",borderRadius:"3px",boxShadow:"0 0 0 0.2rem",padding:"0.375rem 0.75rem",boxShadowColor:"rgba(0, 123, 255, 0.25)",focusedBorderColor:"rgba(0, 123, 255, 0.75)",transition:"box-shadow 0.2s ease-out, border-color 0.2s ease-out"},menu:{padding:"0",width:"100%",margin:"0.35rem 0",borderRadius:"3px",backgroundColor:"#fff",animation:L,boxShadow:"0 0.5em 1em -0.125em rgb(10 10 10 / 12%), 0 0 0 1px rgb(10 10 10 / 4%)",option:{textAlign:"left",selectedColor:"#fff",selectedBgColor:"#007bff",padding:"0.375rem 0.75rem",focusedBgColor:"rgba(0, 123, 255, 0.15)"}},noOptions:{fontSize:"1.25rem",margin:"0.25rem 0",color:"hsl(0, 0%, 60%)",padding:"0.375rem 0.75rem"},placeholder:{animation:L},multiValue:{margin:"1px 2px",borderRadius:"3px",backgroundColor:"#e7edf3",animation:L,label:{borderRadius:"3px",fontSize:"0.825em",padding:"1px 0 1px 6px"},clear:{fontWeight:600,padding:"0 6px",color:"#a6a6a6",fontSize:"0.65em",alignSelf:"center",focusColor:"#808080",transition:"color 0.2s ease-out"}}},$=!!(null===window||void 0===window?void 0:window.ontouchstart)||!!(null===navigator||void 0===navigator?void 0:navigator.maxTouchPoints),ee=r((e=>{var{index:r,style:t,data:{menuOptions:o,selectOption:i,renderOptionLabel:a,focusedOptionIndex:l}}=e,{data:d,value:s,label:u,isDisabled:c,isSelected:p}=o[r],m=((e,n,r)=>{var t="rfs-option";return e&&(t+=" rfs-option-disabled"),n&&(t+=" rfs-option-selected"),r&&(t+=" rfs-option-focused"),t})(c,p,r===l),v=c?void 0:()=>i({data:d,value:s,label:u},p);return n.createElement("div",{style:t,onClick:v,className:m},a(d))}),((e,n)=>{var{memoOptions:r}=n.data;return r&&g(e,n)}));ee.displayName="Option";var ne=c.div.withConfig({displayName:"NoOptionsMsg",componentId:"sc-1on2920-0"})(["text-align:center;color:",";margin:",";padding:",";font-size:",";",""],(e=>{var{theme:n}=e;return n.noOptions.color}),(e=>{var{theme:n}=e;return n.noOptions.margin}),(e=>{var{theme:n}=e;return n.noOptions.padding}),(e=>{var{theme:n}=e;return n.noOptions.fontSize}),(e=>{var{theme:n}=e;return n.noOptions.css})),re=e=>{var{width:r,height:i,itemSize:a,direction:l,isLoading:d,loadingMsg:s,menuOptions:u,memoOptions:c,selectOption:p,noOptionsMsg:m,overscanCount:v,itemKeySelector:h,fixedSizeListRef:g,renderOptionLabel:b,focusedOptionIndex:w}=e,O=t((()=>({menuOptions:u,memoOptions:c,selectOption:p,renderOptionLabel:b,focusedOptionIndex:w})),[u,c,w,p,b]);if(d)return n.createElement(ne,null,s);var x=h?(e,n)=>n.menuOptions[e][h]:void 0;return n.createElement(o,null,n.createElement(f,{width:r,height:i,itemKey:x,itemSize:a,itemData:O,direction:l,ref:g,overscanCount:v,itemCount:u.length},ee),!Y(u)&&m&&n.createElement(ne,null,m))},te=["menuRef","menuTop","menuOpen","onMenuMouseDown","menuPortalTarget"],oe=c.div.withConfig({displayName:"MenuWrapper",componentId:"sc-105ivps-0"})(["z-index:999;cursor:default;position:absolute;"," "," .","{display:block;overflow:hidden;user-select:none;white-space:nowrap;text-overflow:ellipsis;-webkit-tap-highlight-color:transparent;will-change:top;padding:",";text-align:",";&.",",&:hover:not(.","):not(.","){background-color:",";}&.","{color:",";background-color:",";}&.","{opacity:0.35;}}"],(e=>{var{menuTop:n,menuOpen:r,hideNoOptionsMsg:t,theme:{menu:o}}=e;return p(["width:",";margin:",";padding:",";animation:",";border-radius:",";background-color:",";box-shadow:",";"," ",""],o.width,o.margin,o.padding,o.animation,o.borderRadius,o.backgroundColor,t?"none":o.boxShadow,!r&&"display: none;",n&&"top: "+n+";")}),(e=>{var{theme:n}=e;return n.menu.css}),"rfs-option",(e=>{var{theme:n}=e;return n.menu.option.padding}),(e=>{var{theme:n}=e;return n.menu.option.textAlign}),"rfs-option-focused","rfs-option-disabled","rfs-option-selected",(e=>{var{theme:n}=e;return n.menu.option.focusedBgColor}),"rfs-option-selected",(e=>{var{theme:n}=e;return n.menu.option.selectedColor}),(e=>{var{theme:n}=e;return n.menu.option.selectedBgColor}),"rfs-option-disabled"),ie=r=>{var{menuRef:t,menuTop:o,menuOpen:i,onMenuMouseDown:a,menuPortalTarget:l}=r,d=h(r,te),{menuOptions:s,noOptionsMsg:u}=d,c=i&&!Boolean(u)&&!Y(s),p=n.createElement(oe,{ref:t,menuTop:o,menuOpen:i,onMouseDown:a,className:"rfs-menu-container",hideNoOptionsMsg:c},n.createElement(re,e({},d)));return l?b(p,l):p},ae=p(["color:",";"],(e=>{var{theme:n}=e;return n.multiValue.clear.focusColor})),le=c.div.withConfig({displayName:"MultiValueWrapper",componentId:"sc-1vzivtq-0"})(["min-width:0;display:flex;"," ",""],(e=>{var{theme:{multiValue:n}}=e;return p(["margin:",";animation:",";border-radius:",";background-color:",";"],n.margin,n.animation,n.borderRadius,n.backgroundColor)}),(e=>{var{theme:n}=e;return n.multiValue.css})),de=c.div.withConfig({displayName:"Label",componentId:"sc-1vzivtq-1"})(["overflow:hidden;white-space:nowrap;text-overflow:ellipsis;padding:",";font-size:",";border-radius:",";"],(e=>{var{theme:n}=e;return n.multiValue.label.padding}),(e=>{var{theme:n}=e;return n.multiValue.label.fontSize}),(e=>{var{theme:n}=e;return n.multiValue.label.borderRadius})),se=c.i.withConfig({displayName:"Clear",componentId:"sc-1vzivtq-2"})(["display:flex;font-style:inherit;"," ",""],(e=>{var{theme:{multiValue:{clear:n}}}=e;return p(["color:",";padding:",";font-size:",";align-self:",";transition:",";font-weight:",";&:hover{","}"],n.color,n.padding,n.fontSize,n.alignSelf,n.transition,n.fontWeight,ae)}),(e=>{var{isFocused:n}=e;return n&&ae})),ue=r((e=>{var{data:r,value:t,isFocused:o,renderOptionLabel:i,removeSelectedOption:a}=e,l=i(r),d=()=>a(t);return n.createElement(le,null,n.createElement(de,null,l),n.createElement(se,{isFocused:o,onClick:d,onTouchEnd:d,onMouseDown:X},"✖"))}));ue.displayName="MultiValue";var ce=()=>{var e=i(!0);return e.current?(e.current=!1,!0):e.current},pe=(e,n)=>{var r=ce();a((()=>{if(!r)return e()}),n)},me=e=>{var n=i(e);return a((()=>{n.current=e})),d((function(){for(var e,r=arguments.length,t=new Array(r),o=0;o<r;o++)t[o]=arguments[o];return null===(e=n.current)||void 0===e?void 0:e.call(n,...t)}),[])},ve=function(e,n,r,t,o,i,d,s,u,c,p,m,v){void 0===u&&(u=!1),void 0===c&&(c=!1),void 0===p&&(p=!1),void 0===m&&(m=!1);var[h,g]=l(B),f=me(s||R.OPTION_FILTER),b=me(d||R.OPTION_IS_DISABLED),w=m?"":n,O=r===y.ANY,x=U(v)?v:p;return a((()=>{var n=t.length?new Set(t.map((e=>e.value))):null,r=G(w,u,c),a=e=>{var t,a=o(e),l=i(e),d=b(e),s=null!==(t=null==n?void 0:n.has(a))&&void 0!==t&&t,p={data:e,value:a,label:l,isDisabled:d,isSelected:s};if(!(!(e=>{if(!r)return!0;var n=f(e),t=G(n,u,c);return O?t.includes(r):t.substr(0,r.length)===r})(p)||x&&s))return p},l=e.reduce(((e,n)=>{var r=a(n);return r&&e.push(r),e}),[]);g(l)}),[e,w,o,i,t,O,u,c,b,f,x]),h},he=(e,n,r,t,o,d,s,u,c,p,m,v)=>{var h=i(!1),g=i(!u),f=me(c),b=me(p),[w,O]=l(d),[y,C]=l(!1);a((()=>{g.current=!y&&!u})),a((()=>{var{TOP:n,AUTO:r}=x,o=t===n||t===r&&!(e=>{if(!e)return!0;var n=W(e),{top:r,height:t}=e.getBoundingClientRect(),{height:o}=n.getBoundingClientRect();return o-F(n)-r>=t})(e.current);C(o)}),[e,t]),pe((()=>{if(r){var n=e=>{f(),e&&(h.current=!0,O(e))};g.current?((e,n,r,t)=>{if(e){var{top:o,height:i,bottom:a}=e.getBoundingClientRect(),l=window.innerHeight;if(l-o>=i)t();else{var d=W(e),s=F(d),u=d.getBoundingClientRect().height-s-o,c=u<i;if(!c&&r){var p=getComputedStyle(e).marginBottom;_(d,a-l+s+parseInt(p,10),n,t)}else t(c?u:void 0)}}else t()})(e.current,m,v,n):n()}else b(),h.current&&(h.current=!1,O(d))}),[e,r,d,v,m,b,f]);var I=Math.min(w,s*o),S=y?((e,n,r)=>{var t,o,i=n&&getComputedStyle(n),a=i?parseInt(i.marginBottom,10):0,l=i?parseInt(i.marginTop,10):0,d=null!==(t=null==r?void 0:r.getBoundingClientRect().height)&&void 0!==t?t:0,s=e>0?e:null!==(o=null==n?void 0:n.getBoundingClientRect().height)&&void 0!==o?o:0;return"calc("+-Math.abs(s+d)+"px + "+(a+l)+"px)"})(I,e.current,n.current):void 0;return[S,I]},ge=p(["top:50%;overflow:hidden;position:absolute;white-space:nowrap;box-sizing:border-box;text-overflow:ellipsis;transform:translateY(-50%);"]),fe=c.div.withConfig({displayName:"SingleValue",componentId:"sc-us7kwl-0"})([""," max-width:calc(100% - 0.5rem);"],ge),be=c.div.withConfig({displayName:"Placeholder",componentId:"sc-us7kwl-1"})([""," color:",";",""],ge,(e=>{var{theme:n}=e;return n.color.placeholder}),(e=>{var{theme:n,initRender:r}=e;return!r&&p(["animation:",";"],n.placeholder.animation)})),we=e=>{var{isMulti:r,inputValue:t,placeholder:i,selectedOption:a,focusedMultiValue:l,renderOptionLabel:d,renderMultiOptions:s,removeSelectedOption:u}=e,c=ce(),p=!Y(a);return t&&(!r||r&&(p||s))?null:p?n.createElement(be,{initRender:c},i):r?n.createElement(o,null,s?s({renderOptionLabel:d,selected:a}):a.map((e=>{var{data:r,value:t}=e;return n.createElement(ue,{key:t,data:r,value:t,renderOptionLabel:d,isFocused:t===l,removeSelectedOption:u})}))):n.createElement(fe,null,d(a[0].data))},Oe=p(["font-size:inherit;font-weight:inherit;font-family:inherit;"]),xe=c.div.withConfig({displayName:"SizerDiv",componentId:"sc-4er7q8-0"})(["top:0;left:0;height:0;overflow:scroll;white-space:pre;position:absolute;visibility:hidden;"," ",""],Oe,(e=>{var{theme:n}=e;return n.input.css})),ye=c.input.attrs(O).withConfig({displayName:"Input",componentId:"sc-4er7q8-1"})(["border:0;outline:0;padding:0;cursor:text;background:0;color:inherit;box-sizing:content-box;"," :read-only{opacity:0;cursor:default;}:required{","}",""],Oe,(e=>{var{theme:n,isInvalid:r}=e;return r&&n.input.cssRequired}),(e=>{var{theme:n}=e;return n.input.css})),Ce=r(s(((e,r)=>{var{id:t,onBlur:a,onFocus:d,readOnly:s,required:u,onChange:c,ariaLabel:p,inputValue:m,ariaLabelledBy:v,hasSelectedOptions:h}=e,g=!!u&&!h,f=i(null),[b,w]=l(15);return pe((()=>{var{current:e}=f;e&&w(e.scrollWidth+15)}),[m]),n.createElement(o,null,n.createElement(ye,{id:t,ref:r,isInvalid:!0,onBlur:a,onFocus:d,value:m,readOnly:s,required:g,"aria-label":p,style:{width:b},"aria-labelledby":v,onChange:s?void 0:c}),n.createElement(xe,{ref:f},m))})));Ce.displayName="AutosizeInput";var Ie=c.span.withConfig({displayName:"A11yText",componentId:"sc-1yv4bud-0"})(["border:0;padding:0;width:1px;height:1px;margin:-1px;z-index:9999;overflow:hidden;position:absolute;white-space:nowrap;clip:rect(0,0,0,0);"]),Se=e=>{var{menuOpen:r,isFocused:t,inputValue:o,optionCount:i,isSearchable:a,focusedOption:l,selectedOption:d,ariaLive:s="polite",ariaLabel:u="Select"}=e;if(!t)return null;var c=r?"Use Up and Down arrow keys to choose options, press Enter or Tab to select the currently focused option, press Escape to close the menu.":u+" is focused"+(a?", type to filter options":"")+", press Down arrow key to open the menu.",{index:p,value:m,label:v,isDisabled:h}=l,g=((m&&!h?"Option "+v+" is focused, "+(p+1)+" of "+i+".":"")+" "+(i+" option(s) available"+(o?" for search "+o:"")+".")+" "+c).trimStart(),f="Selected option: "+(d.length?d.map((e=>e.label)).join(" "):"N/A");return n.createElement(Ie,{"aria-atomic":"false","aria-live":s,"aria-relevant":"additions text"},n.createElement("span",{id:"aria-selection"},f),n.createElement("span",{id:"aria-context"},g))},Ee=c.div.withConfig({displayName:"StyledLoadingDots",componentId:"sc-1tlaoz1-0"})(["display:flex;align-self:center;text-align:center;margin-right:0.25rem;padding:",";> div{border-radius:100%;display:inline-block;"," :nth-of-type(1){animation-delay:-0.272s;}:nth-of-type(2){animation-delay:-0.136s;}}"],(e=>{var{theme:n}=e;return n.loader.padding}),(e=>{var{theme:n}=e;return p(["width:",";height:",";animation:",";background-color:",";"],n.loader.size,n.loader.size,n.loader.animation,n.loader.color)})),Ne=()=>n.createElement(Ee,{"aria-hidden":!0,className:"rfs-loading-dots"},n.createElement("div",null),n.createElement("div",null),n.createElement("div",null)),Le=c.svg.withConfig({displayName:"ClearSvg",componentId:"sc-kkzaaw-0"})(["fill:currentColor;",""],(e=>{var{theme:n}=e;return p(["width:",";height:",";animation:",";transition:",";"],n.icon.clear.width,n.icon.clear.height,n.icon.clear.animation,n.icon.clear.transition)})),Me=()=>n.createElement(Le,{"aria-hidden":!0,focusable:"false",viewBox:"0 0 14 16",className:"rfs-clear-icon"},n.createElement("path",{fillRule:"evenodd",d:"M7.71 8.23l3.75 3.75-1.48 1.48-3.75-3.75-3.75 3.75L1 11.98l3.75-3.75L1 4.48 2.48 3l3.75 3.75L9.98 3l1.48 1.48-3.75 3.75z"})),ze=c.div.withConfig({displayName:"IndicatorIconsWrapper",componentId:"sc-1jozl2i-0"})(["display:flex;flex-shrink:0;align-items:center;align-self:stretch;box-sizing:border-box;"]),Te=c.div.withConfig({displayName:"IndicatorIcon",componentId:"sc-1jozl2i-1"})(["height:100%;display:flex;align-items:center;box-sizing:border-box;color:",";padding:",";:hover{color:",";}",""],(e=>{var{theme:n}=e;return n.icon.color}),(e=>{var{theme:n}=e;return n.icon.padding}),(e=>{var{theme:n}=e;return n.icon.hoverColor}),(e=>{var{theme:n}=e;return n.icon.css})),ke=c.div.withConfig({displayName:"Separator",componentId:"sc-1jozl2i-2"})(["width:1px;margin:0.5rem 0;align-self:stretch;box-sizing:border-box;background-color:",";"],(e=>{var{theme:n}=e;return n.color.iconSeparator||n.color.border})),De=c.div.withConfig({displayName:"Caret",componentId:"sc-1jozl2i-3"})(["transition:",";border-top:"," dashed;border-left:"," solid transparent;border-right:"," solid transparent;",""],(e=>{var{theme:n}=e;return n.icon.caret.transition}),(e=>{var{theme:n}=e;return n.icon.caret.size}),(e=>{var{theme:n}=e;return n.icon.caret.size}),(e=>{var{theme:n}=e;return n.icon.caret.size}),(e=>{var{theme:n,menuOpen:r,isInvalid:t}=e;return r&&p(["transform:rotate(180deg);color:",";"],t?n.color.danger:n.color.caretActive||n.color.primary)})),Ae=r((e=>{var{menuOpen:r,clearIcon:t,caretIcon:o,isInvalid:i,showClear:a,isLoading:l,isDisabled:d,loadingNode:s,onCaretMouseDown:u,onClearMouseDown:c}=e,p=e=>K(e)?e({menuOpen:r,isLoading:l,isInvalid:i,isDisabled:d}):e;return n.createElement(ze,null,a&&!l&&n.createElement(Te,{onTouchEnd:c,onMouseDown:c},p(t)||n.createElement(Me,null)),l&&(s||n.createElement(Ne,null)),n.createElement(ke,{role:"none"}),n.createElement(Te,{onTouchEnd:u,onMouseDown:u},p(o)||n.createElement(De,{"aria-hidden":!0,menuOpen:r,isInvalid:i,className:"rfs-caret-icon"})))}));Ae.displayName="IndicatorIcons";var Be=c.div.attrs(w).withConfig({displayName:"SelectWrapper",componentId:"sc-kcrmu9-0"})(["position:relative;box-sizing:border-box;",""],(e=>{var{theme:n}=e;return n.select.css})),Re=c.div.withConfig({displayName:"ValueWrapper",componentId:"sc-kcrmu9-1"})(["flex:1 1 0%;display:flex;flex-wrap:wrap;overflow:hidden;position:relative;align-items:center;box-sizing:border-box;padding:",";"],(e=>{var{theme:n}=e;return n.control.padding})),Ve=c.div.withConfig({displayName:"ControlWrapper",componentId:"sc-kcrmu9-2"})(["outline:0;display:flex;flex-wrap:wrap;cursor:default;position:relative;align-items:center;box-sizing:border-box;justify-content:space-between;"," "," ",""],(e=>{var{isDisabled:n,isFocused:r,isInvalid:t,theme:{control:o,color:i}}=e;return p(["transition:",";border-style:",";border-width:",";border-radius:",";min-height:",";border-color:",";"," "," "," ",""],o.transition,o.borderStyle,o.borderWidth,o.borderRadius,o.height||o.minHeight,t?i.danger:r?o.focusedBorderColor:i.border,o.height&&"height: "+o.height+";",n&&"pointer-events:none;user-select:none;",(o.backgroundColor||n)&&"background-color: "+(n?i.disabled:o.backgroundColor)+";",r&&"box-shadow: "+o.boxShadow+" "+(t?i.dangerLight:o.boxShadowColor)+";")}),(e=>{var{theme:n}=e;return n.control.css}),(e=>{var{isFocused:n,theme:r}=e;return n&&r.control.focusedCss})),Fe=s(((r,o)=>{var{async:s,isMulti:c,inputId:p,selectId:m,required:h,ariaLive:g,autoFocus:f,isLoading:b,onKeyDown:w,clearIcon:O,caretIcon:N,isInvalid:L,ariaLabel:V,menuWidth:F,isDisabled:P,inputDelay:q,onMenuOpen:W,onMenuClose:_,onInputBlur:j,isClearable:G,themeConfig:ee,loadingNode:ne,initialValue:re,onInputFocus:te,onInputChange:oe,ariaLabelledBy:ae,onOptionChange:le,onSearchChange:de,getOptionLabel:se,getOptionValue:ue,itemKeySelector:ce,openMenuOnFocus:ge,menuPortalTarget:fe,isAriaLiveEnabled:be,menuOverscanCount:Oe,blurInputOnSelect:xe,menuItemDirection:ye,renderOptionLabel:Ie,renderMultiOptions:Ee,menuScrollDuration:Ne,filterIgnoreAccents:Le,hideSelectedOptions:Me,getIsOptionDisabled:ze,getFilterOptionString:Te,isSearchable:ke=!0,memoOptions:De=!1,lazyLoadMenu:Fe=!1,openMenuOnClick:Pe=!0,filterIgnoreCase:qe=!0,tabSelectsOption:We=!0,closeMenuOnSelect:_e=!0,scrollMenuIntoView:je=!0,backspaceClearsValue:Ue=!0,filterMatchFrom:Ke=y.ANY,menuPosition:Ye=x.BOTTOM,options:He=B,loadingMsg:Xe=T,placeholder:Ge=D,noOptionsMsg:Je=k,menuItemSize:Qe=M,menuMaxHeight:Ze=z}=r,$e=i(!1),en=i(),nn=i(!1),rn=i(K(de)),tn=i(K(le)),on=i(null),an=i(null),ln=i(null),dn=i(null),[sn,un]=l(""),[cn,pn]=l(!1),[mn,vn]=l(!1),[hn,gn]=l(null),[fn,bn]=l(A),wn=t((()=>(e=>H(e)?Q(Z,e):Z)(ee)),[ee]),On=t((()=>se||R.OPTION_LABEL),[se]),xn=t((()=>ue||R.OPTION_VALUE),[ue]),yn=t((()=>Ie||On),[Ie,On]),Cn=function(e,n){void 0===n&&(n=0);var[r,t]=l(e);return pe((()=>{if(!(n<=0)){var r=setTimeout((()=>{t(e)}),n);return()=>{clearTimeout(r)}}}),[e,n]),n<=0?e:r}(sn,q),[In,Sn]=l((()=>J(re,xn,On))),En=ve(He,Cn,Ke,In,xn,On,ze,Te,qe,Le,c,s,Me),[Nn,Ln]=he(an,dn,cn,Ye,Qe,Ze,En.length,!!fe,W,_,Ne,je),Mn=me(de),zn=me(le),Tn=()=>{var e;return null===(e=ln.current)||void 0===e?void 0:e.blur()},kn=()=>{var e;return null===(e=ln.current)||void 0===e?void 0:e.focus()},Dn=e=>{var n;return null===(n=on.current)||void 0===n?void 0:n.scrollToItem(e)},An=Y(In),Bn=U(xe)?xe:$,Rn=d((n=>{if(Y(En)){var r=c?-1:En.findIndex((e=>e.isSelected)),t=r>-1?r:n===E?0:En.length-1;Dn(t),pn(!0),gn(null),bn(e({index:t},En[t]))}else pn(!0)}),[c,En]),Vn=d((e=>{Sn((n=>n.filter((n=>n.value!==e))))}),[]),Fn=d(((e,n)=>{n?c&&Vn(e.value):Sn((n=>c?[...n,e]:[e])),Bn?Tn():_e&&(un(""),pn(!1))}),[c,_e,Vn,Bn]);u(o,(()=>({empty:!An,menuOpen:$e.current,blur:Tn,focus:kn,clearValue:()=>{Sn(B),bn(A)},setValue:e=>{var n=J(e,xn,On);Sn(n)},toggleMenu:e=>{!0===e||void 0===e&&!$e.current?(kn(),Rn(E)):Tn()}})),[An,xn,On,Rn]),a((()=>{f&&kn()}),[]),a((()=>{$e.current=cn}),[cn]),a((()=>{rn.current=K(de),tn.current=K(le)})),a((()=>{mn&&ge&&Rn(E)}),[mn,ge,Rn]),a((()=>{var{current:e}=rn;e&&nn.current&&(nn.current=!1,Mn(Cn))}),[Mn,Cn]),pe((()=>{var{current:e}=tn;if(e){var n=c?In.map((e=>e.data)):Y(In)?In[0].data:null;zn(n)}}),[zn,c,In]),pe((()=>{var{length:n}=En,r=n>0&&(s||n!==He.length||0===en.current);0===n?bn(A):(1===n||r)&&(Dn(0),bn(e({index:0},En[0]))),en.current=n}),[s,He,En]);var Pn=()=>{var{data:e,value:n,label:r,isSelected:t,isDisabled:o}=fn;e&&!o&&Fn({data:e,value:n,label:r},t)},qn=n=>{if(Y(En)){var r=n===I?(fn.index+1)%En.length:fn.index>0?fn.index-1:En.length-1;Dn(r),gn(null),bn(e({index:r},En[r]))}},Wn=e=>{X(e),kn()},_n=e=>{if(!P){mn||kn();var n="INPUT"!==e.target.nodeName;cn?n&&(pn(!1),un("")):Pe&&Rn(E),n&&e.preventDefault()}},jn=d((e=>{null==j||j(e),vn(!1),pn(!1),un("")}),[j]),Un=d((e=>{null==te||te(e),vn(!0)}),[te]),Kn=d((e=>{nn.current=!0,null==oe||oe(e.currentTarget.value),un(e.currentTarget.value),pn(!0)}),[oe]),Yn=d((e=>{Wn(e),$e.current?pn(!1):Rn(E)}),[Rn]),Hn=d((e=>{Wn(e),Sn(B)}),[]),Xn=!Fe||Fe&&cn,Gn=!(!G||P||!An),Jn=P||!ke||!!hn,Qn=P||Pe?void 0:Yn;return n.createElement(v,{theme:wn},n.createElement(Be,{id:m,"aria-controls":p,"aria-expanded":cn,onKeyDown:e=>{if(!P){var{key:n,shiftKey:r,defaultPrevented:t}=e;if(!w||(w(e,sn,fn),!t)){switch(n){case"ArrowDown":cn?qn(I):Rn(E);break;case"ArrowUp":cn?qn(C):Rn(S);break;case"ArrowLeft":case"ArrowRight":if(!c||sn||Ee)return;(e=>{if(An){var n=-1,r=In.length-1,t=hn?In.findIndex((e=>e.value===hn)):-1,o=(n="ArrowRight"===e?t>-1&&t<r?t+1:-1:0!==t?-1===t?r:t-1:0)>=0?In[n].value:null;fn.data&&bn(A),o!==hn&&gn(o)}})(n);break;case" ":if(sn)return;if(cn){if(!fn.data)return;Pn()}else Rn(E);break;case"Enter":cn&&Pn();break;case"Escape":cn&&(pn(!1),un(""));break;case"Tab":if(!cn||!We||!fn.data||r)return;Pn();break;case"Delete":case"Backspace":if(sn)return;if(hn){var o=In.findIndex((e=>e.value===hn)),i=o>-1&&o<In.length-1?In[o+1].value:null;Vn(hn),gn(i)}else{if(!Ue)return;if(!An)break;if(c&&!Ee){var{value:a}=In[In.length-1];Vn(a)}else G&&Sn(B)}break;default:return}e.preventDefault()}}}},n.createElement(Ve,{ref:dn,isInvalid:L,isFocused:mn,isDisabled:P,className:"rfs-control-container",onTouchEnd:_n,onMouseDown:_n},n.createElement(Re,null,n.createElement(we,{isMulti:c,inputValue:sn,placeholder:Ge,selectedOption:In,focusedMultiValue:hn,renderMultiOptions:Ee,renderOptionLabel:yn,removeSelectedOption:Vn}),n.createElement(Ce,{id:p,ref:ln,required:h,ariaLabel:V,inputValue:sn,readOnly:Jn,onBlur:jn,onFocus:Un,onChange:Kn,ariaLabelledBy:ae,hasSelectedOptions:An})),n.createElement(Ae,{menuOpen:cn,clearIcon:O,caretIcon:N,isInvalid:L,isLoading:b,showClear:Gn,isDisabled:P,loadingNode:ne,onClearMouseDown:Hn,onCaretMouseDown:Qn})),Xn&&n.createElement(ie,{menuRef:an,menuOpen:cn,isLoading:b,menuTop:Nn,height:Ln,itemSize:Qe,loadingMsg:Xe,menuOptions:En,memoOptions:De,fixedSizeListRef:on,noOptionsMsg:Je,selectOption:Fn,direction:ye,itemKeySelector:ce,overscanCount:Oe,menuPortalTarget:fe,width:F||wn.menu.width,renderOptionLabel:yn,focusedOptionIndex:fn.index,onMenuMouseDown:Wn}),be&&n.createElement(Se,{ariaLive:g,menuOpen:cn,isFocused:mn,ariaLabel:V,inputValue:sn,isSearchable:ke,focusedOption:fn,selectedOption:In,optionCount:En.length})))}));Fe.displayName="Select";export{Fe as Select}; | ||
import e from"@babel/runtime/helpers/esm/extends";import n,{memo as r,useMemo as t,Fragment as o,useRef as i,useEffect as a,useState as l,useCallback as d,forwardRef as s,useImperativeHandle as u}from"react";import c,{css as p,keyframes as m,ThemeProvider as v}from"styled-components";import h from"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";import{areEqual as g,FixedSizeList as f}from"react-window";import{createPortal as b}from"react-dom";var w={role:"combobox","aria-haspopup":"listbox",className:"rfs-select-container"},O={tabIndex:0,type:"text",spellCheck:!1,autoCorrect:"off",autoComplete:"off",autoCapitalize:"none","aria-autocomplete":"list",className:"rfs-autosize-input"},x={TOP:"top",AUTO:"auto",BOTTOM:"bottom"},y={ANY:"any",START:"start"},C=0,I=1,S=2,E=3,N=m(["0%,80%,100%{transform:scale(0);}40%{transform:scale(1.0);}"]),L=p([""," 0.2s ease-in"],m(["from{opacity:0;}to{opacity:1;}"])),M=35,z=300,T="Loading..",k="No options",D="Select option..",A={index:-1},B=[],R={OPTION_LABEL:e=>{var{label:n}=e;return n},OPTION_VALUE:e=>{var{value:n}=e;return n},OPTION_IS_DISABLED:e=>{var{isDisabled:n}=e;return!!n},OPTION_FILTER:e=>{var{label:n}=e;return"string"==typeof n?n:""+n}},V=/(auto|scroll)/;function F(e){return P(e)?window.pageYOffset:e.scrollTop}function P(e){return e===document.body||e===document.documentElement||e===window}function q(e){var{overflow:n,overflowX:r,overflowY:t}=e;return V.test(""+n+r+t)}function W(e){var n=getComputedStyle(e),r=document.documentElement,t="absolute"===n.position;if("fixed"===n.position)return r;for(var o=e;o=null==o?void 0:o.parentElement;)if(n=getComputedStyle(o),(!t||"static"!==n.position)&&q(n))return o;return r}function _(e,n,r,t){void 0===r&&(r=300);var o=0,i=F(e),a=n-i;requestAnimationFrame((function n(){var l,d=a*((l=(l=o+=5)/r-1)*l*l+1)+i;!function(e,n){P(e)?window.scrollTo(0,n):e.scrollTop=n}(e,d),o<r?requestAnimationFrame(n):null==t||t()}))}var j=/[\u0300-\u036f]/g,U=e=>"boolean"==typeof e,K=e=>"function"==typeof e,Y=e=>Array.isArray(e)&&!!e.length,H=e=>null!==e&&"object"==typeof e&&!Array.isArray(e),X=e=>{e.preventDefault(),e.stopPropagation()},G=(e,n,r)=>{var t=e.trim();return n&&(t=t.toLowerCase()),r?t.normalize("NFD").replace(j,""):t},J=(e,n,r)=>{var t=Array.isArray(e)?e:H(e)?[e]:B;return Y(t)?t.map((e=>({data:e,value:n(e),label:r(e)}))):t},Q=(n,r)=>{var t=e({},n);return Object.keys(r).forEach((e=>{var o=r[e];t[e]="animation"!==e&&H(o)?n[e]?Q(n[e],o):o:null!=o?o:""})),t},Z={color:{border:"#ced4da",danger:"#dc3545",primary:"#007bff",disabled:"#e9ecef",placeholder:"#6E7276",dangerLight:"rgba(220, 53, 69, 0.25)"},input:{},select:{},loader:{size:"0.625rem",padding:"0.375rem 0.75rem",animation:p([""," 1.19s ease-in-out infinite"],N),color:"rgba(0, 123, 255, 0.42)"},icon:{color:"#ccc",hoverColor:"#A6A6A6",padding:"0 0.9375rem",clear:{width:"14px",height:"16px",animation:L,transition:"color 0.2s ease-out"},caret:{size:"7px",transition:"transform 0.3s ease-in-out, color 0.2s ease-out"}},control:{minHeight:"38px",borderWidth:"1px",borderStyle:"solid",borderRadius:"3px",boxShadow:"0 0 0 0.2rem",padding:"0.375rem 0.75rem",boxShadowColor:"rgba(0, 123, 255, 0.25)",focusedBorderColor:"rgba(0, 123, 255, 0.75)",transition:"box-shadow 0.2s ease-out, border-color 0.2s ease-out"},menu:{padding:"0",width:"100%",margin:"0.35rem 0",borderRadius:"3px",backgroundColor:"#fff",animation:L,boxShadow:"0 0.5em 1em -0.125em rgb(10 10 10 / 12%), 0 0 0 1px rgb(10 10 10 / 4%)",option:{textAlign:"left",selectedColor:"#fff",selectedBgColor:"#007bff",padding:"0.375rem 0.75rem",focusedBgColor:"rgba(0, 123, 255, 0.15)"}},noOptions:{fontSize:"1.25rem",margin:"0.25rem 0",color:"hsl(0, 0%, 60%)",padding:"0.375rem 0.75rem"},placeholder:{animation:L},multiValue:{margin:"1px 2px",borderRadius:"3px",backgroundColor:"#e7edf3",animation:L,label:{borderRadius:"3px",fontSize:"0.825em",padding:"1px 0 1px 6px"},clear:{fontWeight:600,padding:"0 6px",color:"#a6a6a6",fontSize:"0.65em",alignSelf:"center",focusColor:"#808080",transition:"color 0.2s ease-out"}}},$=!!(null===window||void 0===window?void 0:window.ontouchstart)||!!(null===navigator||void 0===navigator?void 0:navigator.maxTouchPoints),ee=r((e=>{var{index:r,style:t,data:{menuOptions:o,selectOption:i,renderOptionLabel:a,focusedOptionIndex:l}}=e,{data:d,value:s,label:u,isDisabled:c,isSelected:p}=o[r],m=((e,n,r)=>{var t="rfs-option";return e&&(t+=" rfs-option-disabled"),n&&(t+=" rfs-option-selected"),r&&(t+=" rfs-option-focused"),t})(c,p,r===l),v=c?void 0:()=>i({data:d,value:s,label:u},p);return n.createElement("div",{style:t,onClick:v,className:m},a(d))}),((e,n)=>{var{memoOptions:r}=n.data;return r&&g(e,n)}));ee.displayName="Option";var ne=c.div.withConfig({displayName:"NoOptionsMsg",componentId:"sc-1on2920-0"})(["text-align:center;color:",";margin:",";padding:",";font-size:",";",""],(e=>{var{theme:n}=e;return n.noOptions.color}),(e=>{var{theme:n}=e;return n.noOptions.margin}),(e=>{var{theme:n}=e;return n.noOptions.padding}),(e=>{var{theme:n}=e;return n.noOptions.fontSize}),(e=>{var{theme:n}=e;return n.noOptions.css})),re=e=>{var{width:r,height:i,itemSize:a,direction:l,isLoading:d,loadingMsg:s,menuOptions:u,memoOptions:c,selectOption:p,noOptionsMsg:m,overscanCount:v,itemKeySelector:h,fixedSizeListRef:g,renderOptionLabel:b,focusedOptionIndex:w}=e,O=t((()=>({menuOptions:u,memoOptions:c,selectOption:p,renderOptionLabel:b,focusedOptionIndex:w})),[u,c,w,p,b]);if(d)return n.createElement(ne,null,s);var x=h?(e,n)=>n.menuOptions[e][h]:void 0;return n.createElement(o,null,n.createElement(f,{width:r,height:i,itemKey:x,itemSize:a,itemData:O,direction:l,ref:g,overscanCount:v,itemCount:u.length},ee),!Y(u)&&m&&n.createElement(ne,null,m))},te=["menuRef","menuTop","menuOpen","onMenuMouseDown","menuPortalTarget"],oe=c.div.withConfig({displayName:"MenuWrapper",componentId:"sc-105ivps-0"})(["z-index:999;cursor:default;position:absolute;"," "," .","{display:block;overflow:hidden;user-select:none;white-space:nowrap;text-overflow:ellipsis;-webkit-tap-highlight-color:transparent;will-change:top;padding:",";text-align:",";&.",",&:hover:not(.","):not(.","){background-color:",";}&.","{color:",";background-color:",";}&.","{opacity:0.35;}}"],(e=>{var{menuTop:n,menuOpen:r,hideNoOptionsMsg:t,theme:{menu:o}}=e;return p(["width:",";margin:",";padding:",";animation:",";border-radius:",";background-color:",";box-shadow:",";"," ",""],o.width,o.margin,o.padding,o.animation,o.borderRadius,o.backgroundColor,t?"none":o.boxShadow,!r&&"display: none;",n&&"top: "+n+";")}),(e=>{var{theme:n}=e;return n.menu.css}),"rfs-option",(e=>{var{theme:n}=e;return n.menu.option.padding}),(e=>{var{theme:n}=e;return n.menu.option.textAlign}),"rfs-option-focused","rfs-option-disabled","rfs-option-selected",(e=>{var{theme:n}=e;return n.menu.option.focusedBgColor}),"rfs-option-selected",(e=>{var{theme:n}=e;return n.menu.option.selectedColor}),(e=>{var{theme:n}=e;return n.menu.option.selectedBgColor}),"rfs-option-disabled"),ie=r=>{var{menuRef:t,menuTop:o,menuOpen:i,onMenuMouseDown:a,menuPortalTarget:l}=r,d=h(r,te),{menuOptions:s,noOptionsMsg:u}=d,c=i&&!u&&!Y(s),p=n.createElement(oe,{ref:t,menuTop:o,menuOpen:i,onMouseDown:a,className:"rfs-menu-container",hideNoOptionsMsg:c},n.createElement(re,e({},d)));return l?b(p,l):p},ae=p(["color:",";"],(e=>{var{theme:n}=e;return n.multiValue.clear.focusColor})),le=c.div.withConfig({displayName:"MultiValueWrapper",componentId:"sc-1vzivtq-0"})(["min-width:0;display:flex;"," ",""],(e=>{var{theme:{multiValue:n}}=e;return p(["margin:",";animation:",";border-radius:",";background-color:",";"],n.margin,n.animation,n.borderRadius,n.backgroundColor)}),(e=>{var{theme:n}=e;return n.multiValue.css})),de=c.div.withConfig({displayName:"Label",componentId:"sc-1vzivtq-1"})(["overflow:hidden;white-space:nowrap;text-overflow:ellipsis;padding:",";font-size:",";border-radius:",";"],(e=>{var{theme:n}=e;return n.multiValue.label.padding}),(e=>{var{theme:n}=e;return n.multiValue.label.fontSize}),(e=>{var{theme:n}=e;return n.multiValue.label.borderRadius})),se=c.i.withConfig({displayName:"Clear",componentId:"sc-1vzivtq-2"})(["display:flex;font-style:inherit;"," ",""],(e=>{var{theme:{multiValue:{clear:n}}}=e;return p(["color:",";padding:",";font-size:",";align-self:",";transition:",";font-weight:",";&:hover{","}"],n.color,n.padding,n.fontSize,n.alignSelf,n.transition,n.fontWeight,ae)}),(e=>{var{isFocused:n}=e;return n&&ae})),ue=r((e=>{var{data:r,value:t,isFocused:o,renderOptionLabel:i,removeSelectedOption:a}=e,l=i(r),d=()=>a(t);return n.createElement(le,null,n.createElement(de,null,l),n.createElement(se,{isFocused:o,onClick:d,onTouchEnd:d,onMouseDown:X},"✖"))}));ue.displayName="MultiValue";var ce=()=>{var e=i(!0);return e.current?(e.current=!1,!0):e.current},pe=(e,n)=>{var r=ce();a((()=>{if(!r)return e()}),n)},me=e=>{var n=i(e);return a((()=>{n.current=e})),d((function(){for(var e,r=arguments.length,t=new Array(r),o=0;o<r;o++)t[o]=arguments[o];return null===(e=n.current)||void 0===e?void 0:e.call(n,...t)}),[])},ve=function(e,n,r,t,o,i,d,s,u,c,p,m,v){void 0===u&&(u=!1),void 0===c&&(c=!1),void 0===p&&(p=!1),void 0===m&&(m=!1);var[h,g]=l(B),f=me(s||R.OPTION_FILTER),b=me(d||R.OPTION_IS_DISABLED),w=m?"":n,O=r===y.ANY,x=U(v)?v:p;return a((()=>{var n=t.length?new Set(t.map((e=>e.value))):null,r=G(w,u,c),a=e=>{var t,a=o(e),l=i(e),d=b(e),s=null!==(t=null==n?void 0:n.has(a))&&void 0!==t&&t,p={data:e,value:a,label:l,isDisabled:d,isSelected:s};if(!(!(e=>{if(!r)return!0;var n=f(e),t=G(n,u,c);return O?t.includes(r):t.substr(0,r.length)===r})(p)||x&&s))return p},l=e.reduce(((e,n)=>{var r=a(n);return r&&e.push(r),e}),[]);g(l)}),[e,w,o,i,t,O,u,c,b,f,x]),h},he=(e,n,r,t,o,d,s,u,c,p,m,v)=>{var h=i(!1),g=i(!u),f=me(c),b=me(p),[w,O]=l(d),[y,C]=l(!1);a((()=>{g.current=!y&&!u})),a((()=>{var{TOP:n,AUTO:r}=x,o=t===n||t===r&&!(e=>{if(!e)return!0;var n=W(e),{top:r,height:t}=e.getBoundingClientRect(),{height:o}=n.getBoundingClientRect();return o-F(n)-r>=t})(e.current);C(o)}),[e,t]),pe((()=>{if(r){var n=e=>{f(),e&&(h.current=!0,O(e))};g.current?((e,n,r,t)=>{if(e){var{top:o,height:i,bottom:a}=e.getBoundingClientRect(),l=window.innerHeight;if(l-o>=i)t();else{var d=W(e),s=F(d),u=d.getBoundingClientRect().height-s-o,c=u<i;if(!c&&r){var p=getComputedStyle(e).marginBottom;_(d,a-l+s+parseInt(p,10),n,t)}else t(c?u:void 0)}}else t()})(e.current,m,v,n):n()}else b(),h.current&&(h.current=!1,O(d))}),[e,r,d,v,m,b,f]);var I=Math.min(w,s*o),S=y?((e,n,r)=>{var t,o,i=n&&getComputedStyle(n),a=i?parseInt(i.marginBottom,10):0,l=i?parseInt(i.marginTop,10):0,d=null!==(t=null==r?void 0:r.getBoundingClientRect().height)&&void 0!==t?t:0,s=e>0?e:null!==(o=null==n?void 0:n.getBoundingClientRect().height)&&void 0!==o?o:0;return"calc("+-Math.abs(s+d)+"px + "+(a+l)+"px)"})(I,e.current,n.current):void 0;return[S,I]},ge=p(["top:50%;overflow:hidden;position:absolute;white-space:nowrap;box-sizing:border-box;text-overflow:ellipsis;transform:translateY(-50%);"]),fe=c.div.withConfig({displayName:"SingleValue",componentId:"sc-us7kwl-0"})([""," max-width:calc(100% - 0.5rem);"],ge),be=c.div.withConfig({displayName:"Placeholder",componentId:"sc-us7kwl-1"})([""," color:",";",""],ge,(e=>{var{theme:n}=e;return n.color.placeholder}),(e=>{var{theme:n,initRender:r}=e;return!r&&p(["animation:",";"],n.placeholder.animation)})),we=e=>{var{isMulti:r,inputValue:t,placeholder:i,selectedOption:a,focusedMultiValue:l,renderOptionLabel:d,renderMultiOptions:s,removeSelectedOption:u}=e,c=ce(),p=!Y(a);return t&&(!r||r&&(p||s))?null:p?n.createElement(be,{initRender:c},i):r?n.createElement(o,null,s?s({renderOptionLabel:d,selected:a}):a.map((e=>{var{data:r,value:t}=e;return n.createElement(ue,{key:t,data:r,value:t,renderOptionLabel:d,isFocused:t===l,removeSelectedOption:u})}))):n.createElement(fe,null,d(a[0].data))},Oe=p(["font-size:inherit;font-weight:inherit;font-family:inherit;"]),xe=c.div.withConfig({displayName:"SizerDiv",componentId:"sc-4er7q8-0"})(["top:0;left:0;height:0;overflow:scroll;white-space:pre;position:absolute;visibility:hidden;"," ",""],Oe,(e=>{var{theme:n}=e;return n.input.css})),ye=c.input.attrs(O).withConfig({displayName:"Input",componentId:"sc-4er7q8-1"})(["border:0;outline:0;padding:0;cursor:text;background:0;color:inherit;box-sizing:content-box;"," :read-only{opacity:0;cursor:default;}:required{","}",""],Oe,(e=>{var{theme:n,isInvalid:r}=e;return r&&n.input.cssRequired}),(e=>{var{theme:n}=e;return n.input.css})),Ce=r(s(((e,r)=>{var{id:t,onBlur:a,onFocus:d,readOnly:s,required:u,onChange:c,ariaLabel:p,inputValue:m,ariaLabelledBy:v,hasSelectedOptions:h}=e,g=!!u&&!h,f=i(null),[b,w]=l(15);return pe((()=>{var{current:e}=f;e&&w(e.scrollWidth+15)}),[m]),n.createElement(o,null,n.createElement(ye,{id:t,ref:r,isInvalid:!0,onBlur:a,onFocus:d,value:m,readOnly:s,required:g,"aria-label":p,style:{width:b},"aria-labelledby":v,onChange:s?void 0:c}),n.createElement(xe,{ref:f},m))})));Ce.displayName="AutosizeInput";var Ie=c.span.withConfig({displayName:"A11yText",componentId:"sc-1yv4bud-0"})(["border:0;padding:0;width:1px;height:1px;margin:-1px;z-index:9999;overflow:hidden;position:absolute;white-space:nowrap;clip:rect(0,0,0,0);"]),Se=e=>{var{menuOpen:r,isFocused:t,inputValue:o,optionCount:i,isSearchable:a,focusedOption:l,selectedOption:d,ariaLive:s="polite",ariaLabel:u="Select"}=e;if(!t)return null;var c=r?"Use Up and Down arrow keys to choose options, press Enter or Tab to select the currently focused option, press Escape to close the menu.":u+" is focused"+(a?", type to filter options":"")+", press Down arrow key to open the menu.",{index:p,value:m,label:v,isDisabled:h}=l,g=((m&&!h?"Option "+v+" is focused, "+(p+1)+" of "+i+".":"")+" "+(i+" option(s) available"+(o?" for search "+o:"")+".")+" "+c).trimStart(),f="Selected option: "+(d.length?d.map((e=>e.label)).join(" "):"N/A");return n.createElement(Ie,{"aria-atomic":"false","aria-live":s,"aria-relevant":"additions text"},n.createElement("span",{id:"aria-selection"},f),n.createElement("span",{id:"aria-context"},g))},Ee=c.div.withConfig({displayName:"StyledLoadingDots",componentId:"sc-1tlaoz1-0"})(["display:flex;align-self:center;text-align:center;margin-right:0.25rem;padding:",";> div{border-radius:100%;display:inline-block;"," :nth-of-type(1){animation-delay:-0.272s;}:nth-of-type(2){animation-delay:-0.136s;}}"],(e=>{var{theme:n}=e;return n.loader.padding}),(e=>{var{theme:n}=e;return p(["width:",";height:",";animation:",";background-color:",";"],n.loader.size,n.loader.size,n.loader.animation,n.loader.color)})),Ne=()=>n.createElement(Ee,{"aria-hidden":!0,className:"rfs-loading-dots"},n.createElement("div",null),n.createElement("div",null),n.createElement("div",null)),Le=c.svg.withConfig({displayName:"ClearSvg",componentId:"sc-kkzaaw-0"})(["fill:currentColor;",""],(e=>{var{theme:n}=e;return p(["width:",";height:",";animation:",";transition:",";"],n.icon.clear.width,n.icon.clear.height,n.icon.clear.animation,n.icon.clear.transition)})),Me=()=>n.createElement(Le,{"aria-hidden":!0,focusable:"false",viewBox:"0 0 14 16",className:"rfs-clear-icon"},n.createElement("path",{fillRule:"evenodd",d:"M7.71 8.23l3.75 3.75-1.48 1.48-3.75-3.75-3.75 3.75L1 11.98l3.75-3.75L1 4.48 2.48 3l3.75 3.75L9.98 3l1.48 1.48-3.75 3.75z"})),ze=c.div.withConfig({displayName:"IndicatorIconsWrapper",componentId:"sc-1jozl2i-0"})(["display:flex;flex-shrink:0;align-items:center;align-self:stretch;box-sizing:border-box;"]),Te=c.div.withConfig({displayName:"IndicatorIcon",componentId:"sc-1jozl2i-1"})(["height:100%;display:flex;align-items:center;box-sizing:border-box;color:",";padding:",";:hover{color:",";}",""],(e=>{var{theme:n}=e;return n.icon.color}),(e=>{var{theme:n}=e;return n.icon.padding}),(e=>{var{theme:n}=e;return n.icon.hoverColor}),(e=>{var{theme:n}=e;return n.icon.css})),ke=c.div.withConfig({displayName:"Separator",componentId:"sc-1jozl2i-2"})(["width:1px;margin:0.5rem 0;align-self:stretch;box-sizing:border-box;background-color:",";"],(e=>{var{theme:n}=e;return n.color.iconSeparator||n.color.border})),De=c.div.withConfig({displayName:"Caret",componentId:"sc-1jozl2i-3"})(["transition:",";border-top:"," dashed;border-left:"," solid transparent;border-right:"," solid transparent;",""],(e=>{var{theme:n}=e;return n.icon.caret.transition}),(e=>{var{theme:n}=e;return n.icon.caret.size}),(e=>{var{theme:n}=e;return n.icon.caret.size}),(e=>{var{theme:n}=e;return n.icon.caret.size}),(e=>{var{theme:n,menuOpen:r,isInvalid:t}=e;return r&&p(["transform:rotate(180deg);color:",";"],t?n.color.danger:n.color.caretActive||n.color.primary)})),Ae=r((e=>{var{menuOpen:r,clearIcon:t,caretIcon:o,isInvalid:i,showClear:a,isLoading:l,isDisabled:d,loadingNode:s,onCaretMouseDown:u,onClearMouseDown:c}=e,p=e=>K(e)?e({menuOpen:r,isLoading:l,isInvalid:i,isDisabled:d}):e;return n.createElement(ze,null,a&&!l&&n.createElement(Te,{onTouchEnd:c,onMouseDown:c},p(t)||n.createElement(Me,null)),l&&(s||n.createElement(Ne,null)),n.createElement(ke,{role:"none"}),n.createElement(Te,{onTouchEnd:u,onMouseDown:u},p(o)||n.createElement(De,{"aria-hidden":!0,menuOpen:r,isInvalid:i,className:"rfs-caret-icon"})))}));Ae.displayName="IndicatorIcons";var Be=c.div.attrs(w).withConfig({displayName:"SelectWrapper",componentId:"sc-kcrmu9-0"})(["position:relative;box-sizing:border-box;",""],(e=>{var{theme:n}=e;return n.select.css})),Re=c.div.withConfig({displayName:"ValueWrapper",componentId:"sc-kcrmu9-1"})(["flex:1 1 0%;display:flex;flex-wrap:wrap;overflow:hidden;position:relative;align-items:center;box-sizing:border-box;padding:",";"],(e=>{var{theme:n}=e;return n.control.padding})),Ve=c.div.withConfig({displayName:"ControlWrapper",componentId:"sc-kcrmu9-2"})(["outline:0;display:flex;flex-wrap:wrap;cursor:default;position:relative;align-items:center;box-sizing:border-box;justify-content:space-between;"," "," ",""],(e=>{var{isDisabled:n,isFocused:r,isInvalid:t,theme:{control:o,color:i}}=e;return p(["transition:",";border-style:",";border-width:",";border-radius:",";min-height:",";border-color:",";"," "," "," ",""],o.transition,o.borderStyle,o.borderWidth,o.borderRadius,o.height||o.minHeight,t?i.danger:r?o.focusedBorderColor:i.border,o.height&&"height: "+o.height+";",n&&"pointer-events:none;user-select:none;",(o.backgroundColor||n)&&"background-color: "+(n?i.disabled:o.backgroundColor)+";",r&&"box-shadow: "+o.boxShadow+" "+(t?i.dangerLight:o.boxShadowColor)+";")}),(e=>{var{theme:n}=e;return n.control.css}),(e=>{var{isFocused:n,theme:r}=e;return n&&r.control.focusedCss})),Fe=s(((r,o)=>{var{async:s,isMulti:c,inputId:p,selectId:m,required:h,ariaLive:g,autoFocus:f,isLoading:b,onKeyDown:w,clearIcon:O,caretIcon:N,isInvalid:L,ariaLabel:V,menuWidth:F,isDisabled:P,inputDelay:q,onMenuOpen:W,onMenuClose:_,onInputBlur:j,isClearable:G,themeConfig:ee,loadingNode:ne,initialValue:re,onInputFocus:te,onInputChange:oe,ariaLabelledBy:ae,onOptionChange:le,onSearchChange:de,getOptionLabel:se,getOptionValue:ue,itemKeySelector:ce,openMenuOnFocus:ge,menuPortalTarget:fe,isAriaLiveEnabled:be,menuOverscanCount:Oe,blurInputOnSelect:xe,menuItemDirection:ye,renderOptionLabel:Ie,renderMultiOptions:Ee,menuScrollDuration:Ne,filterIgnoreAccents:Le,hideSelectedOptions:Me,getIsOptionDisabled:ze,getFilterOptionString:Te,isSearchable:ke=!0,memoOptions:De=!1,lazyLoadMenu:Fe=!1,openMenuOnClick:Pe=!0,filterIgnoreCase:qe=!0,tabSelectsOption:We=!0,closeMenuOnSelect:_e=!0,scrollMenuIntoView:je=!0,backspaceClearsValue:Ue=!0,filterMatchFrom:Ke=y.ANY,menuPosition:Ye=x.BOTTOM,options:He=B,loadingMsg:Xe=T,placeholder:Ge=D,noOptionsMsg:Je=k,menuItemSize:Qe=M,menuMaxHeight:Ze=z}=r,$e=i(!1),en=i(),nn=i(!1),rn=i(K(de)),tn=i(K(le)),on=i(null),an=i(null),ln=i(null),dn=i(null),[sn,un]=l(""),[cn,pn]=l(!1),[mn,vn]=l(!1),[hn,gn]=l(null),[fn,bn]=l(A),wn=t((()=>(e=>H(e)?Q(Z,e):Z)(ee)),[ee]),On=t((()=>se||R.OPTION_LABEL),[se]),xn=t((()=>ue||R.OPTION_VALUE),[ue]),yn=t((()=>Ie||On),[Ie,On]),Cn=function(e,n){void 0===n&&(n=0);var[r,t]=l(e);return pe((()=>{if(!(n<=0)){var r=setTimeout((()=>{t(e)}),n);return()=>{clearTimeout(r)}}}),[e,n]),n<=0?e:r}(sn,q),[In,Sn]=l((()=>J(re,xn,On))),En=ve(He,Cn,Ke,In,xn,On,ze,Te,qe,Le,c,s,Me),[Nn,Ln]=he(an,dn,cn,Ye,Qe,Ze,En.length,!!fe,W,_,Ne,je),Mn=me(de),zn=me(le),Tn=()=>{var e;return null===(e=ln.current)||void 0===e?void 0:e.blur()},kn=()=>{var e;return null===(e=ln.current)||void 0===e?void 0:e.focus()},Dn=e=>{var n;return null===(n=on.current)||void 0===n?void 0:n.scrollToItem(e)},An=Y(In),Bn=U(xe)?xe:$,Rn=d((n=>{if(Y(En)){var r=c?-1:En.findIndex((e=>e.isSelected)),t=r>-1?r:n===E?0:En.length-1;Dn(t),pn(!0),gn(null),bn(e({index:t},En[t]))}else pn(!0)}),[c,En]),Vn=d((e=>{Sn((n=>n.filter((n=>n.value!==e))))}),[]),Fn=d(((e,n)=>{n?c&&Vn(e.value):Sn((n=>c?[...n,e]:[e])),Bn?Tn():_e&&(un(""),pn(!1))}),[c,_e,Vn,Bn]);u(o,(()=>({empty:!An,menuOpen:$e.current,blur:Tn,focus:kn,clearValue:()=>{Sn(B),bn(A)},setValue:e=>{var n=J(e,xn,On);Sn(n)},toggleMenu:e=>{!0===e||void 0===e&&!$e.current?(kn(),Rn(E)):Tn()}})),[An,xn,On,Rn]),a((()=>{f&&kn()}),[]),a((()=>{$e.current=cn}),[cn]),a((()=>{rn.current=K(de),tn.current=K(le)})),a((()=>{mn&&ge&&Rn(E)}),[mn,ge,Rn]),a((()=>{var{current:e}=rn;e&&nn.current&&(nn.current=!1,Mn(Cn))}),[Mn,Cn]),pe((()=>{var{current:e}=tn;if(e){var n=c?In.map((e=>e.data)):Y(In)?In[0].data:null;zn(n)}}),[zn,c,In]),pe((()=>{var{length:n}=En,r=n>0&&(s||n!==He.length||0===en.current);0===n?bn(A):(1===n||r)&&(Dn(0),bn(e({index:0},En[0]))),en.current=n}),[s,He,En]);var Pn=()=>{var{data:e,value:n,label:r,isSelected:t,isDisabled:o}=fn;e&&!o&&Fn({data:e,value:n,label:r},t)},qn=n=>{if(Y(En)){var r=n===I?(fn.index+1)%En.length:fn.index>0?fn.index-1:En.length-1;Dn(r),gn(null),bn(e({index:r},En[r]))}},Wn=e=>{X(e),kn()},_n=e=>{if(!P){mn||kn();var n="INPUT"!==e.target.nodeName;cn?n&&(pn(!1),un("")):Pe&&Rn(E),n&&e.preventDefault()}},jn=d((e=>{null==j||j(e),vn(!1),pn(!1),un("")}),[j]),Un=d((e=>{null==te||te(e),vn(!0)}),[te]),Kn=d((e=>{nn.current=!0,null==oe||oe(e.currentTarget.value),un(e.currentTarget.value),pn(!0)}),[oe]),Yn=d((e=>{Wn(e),$e.current?pn(!1):Rn(E)}),[Rn]),Hn=d((e=>{Wn(e),Sn(B)}),[]),Xn=!Fe||Fe&&cn,Gn=!(!G||P||!An),Jn=P||!ke||!!hn,Qn=P||Pe?void 0:Yn;return n.createElement(v,{theme:wn},n.createElement(Be,{id:m,"aria-controls":p,"aria-expanded":cn,onKeyDown:e=>{if(!P){var{key:n,shiftKey:r,defaultPrevented:t}=e;if(!w||(w(e,sn,fn),!t)){switch(n){case"ArrowDown":cn?qn(I):Rn(E);break;case"ArrowUp":cn?qn(C):Rn(S);break;case"ArrowLeft":case"ArrowRight":if(!c||sn||Ee)return;(e=>{if(An){var n=-1,r=In.length-1,t=hn?In.findIndex((e=>e.value===hn)):-1,o=(n="ArrowRight"===e?t>-1&&t<r?t+1:-1:0!==t?-1===t?r:t-1:0)>=0?In[n].value:null;fn.data&&bn(A),o!==hn&&gn(o)}})(n);break;case" ":if(sn)return;if(cn){if(!fn.data)return;Pn()}else Rn(E);break;case"Enter":cn&&Pn();break;case"Escape":cn&&(pn(!1),un(""));break;case"Tab":if(!cn||!We||!fn.data||r)return;Pn();break;case"Delete":case"Backspace":if(sn)return;if(hn){var o=In.findIndex((e=>e.value===hn)),i=o>-1&&o<In.length-1?In[o+1].value:null;Vn(hn),gn(i)}else{if(!Ue)return;if(!An)break;if(c&&!Ee){var{value:a}=In[In.length-1];Vn(a)}else G&&Sn(B)}break;default:return}e.preventDefault()}}}},n.createElement(Ve,{ref:dn,isInvalid:L,isFocused:mn,isDisabled:P,className:"rfs-control-container",onTouchEnd:_n,onMouseDown:_n},n.createElement(Re,null,n.createElement(we,{isMulti:c,inputValue:sn,placeholder:Ge,selectedOption:In,focusedMultiValue:hn,renderMultiOptions:Ee,renderOptionLabel:yn,removeSelectedOption:Vn}),n.createElement(Ce,{id:p,ref:ln,required:h,ariaLabel:V,inputValue:sn,readOnly:Jn,onBlur:jn,onFocus:Un,onChange:Kn,ariaLabelledBy:ae,hasSelectedOptions:An})),n.createElement(Ae,{menuOpen:cn,clearIcon:O,caretIcon:N,isInvalid:L,isLoading:b,showClear:Gn,isDisabled:P,loadingNode:ne,onClearMouseDown:Hn,onCaretMouseDown:Qn})),Xn&&n.createElement(ie,{menuRef:an,menuOpen:cn,isLoading:b,menuTop:Nn,height:Ln,itemSize:Qe,loadingMsg:Xe,menuOptions:En,memoOptions:De,fixedSizeListRef:on,noOptionsMsg:Je,selectOption:Fn,direction:ye,itemKeySelector:ce,overscanCount:Oe,menuPortalTarget:fe,width:F||wn.menu.width,renderOptionLabel:yn,focusedOptionIndex:fn.index,onMenuMouseDown:Wn}),be&&n.createElement(Se,{ariaLive:g,menuOpen:cn,isFocused:mn,ariaLabel:V,inputValue:sn,isSearchable:ke,focusedOption:fn,selectedOption:In,optionCount:En.length})))}));Fe.displayName="Select";export{Fe as Select}; |
@@ -1,1 +0,1 @@ | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react"),require("styled-components"),require("react-window"),require("react-dom")):"function"==typeof define&&define.amd?define(["exports","react","styled-components","react-window","react-dom"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).ReactFunctionalSelect={},e.React,e.styled,e.ReactWindow,e.ReactDOM)}(this,(function(e,t,n,r,a){"use strict";function o(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var i=o(t),l=o(n);function u(){return u=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},u.apply(this,arguments)}var d="rfs-option",s="rfs-option-focused",c="rfs-option-selected",p="rfs-option-disabled",m={role:"combobox","aria-haspopup":"listbox",className:"rfs-select-container"},f={tabIndex:0,type:"text",spellCheck:!1,autoCorrect:"off",autoComplete:"off",autoCapitalize:"none","aria-autocomplete":"list",className:"rfs-autosize-input"},v={TOP:"top",AUTO:"auto",BOTTOM:"bottom"},h={ANY:"any",START:"start"},g=0,b=1,w=2,O=3,y=n.keyframes(["0%,80%,100%{transform:scale(0);}40%{transform:scale(1.0);}"]),x=n.keyframes(["from{opacity:0;}to{opacity:1;}"]),C=n.css([""," 0.2s ease-in"],x),I=35,S=300,E="Loading..",M="No options",k="Select option..",N={index:-1},L=[],z={OPTION_LABEL:e=>{var{label:t}=e;return t},OPTION_VALUE:e=>{var{value:t}=e;return t},OPTION_IS_DISABLED:e=>{var{isDisabled:t}=e;return!!t},OPTION_FILTER:e=>{var{label:t}=e;return"string"==typeof t?t:""+t}};var T=/(auto|scroll)/;function R(e){return D(e)?window.pageYOffset:e.scrollTop}function D(e){return e===document.body||e===document.documentElement||e===window}function A(e){var{overflow:t,overflowX:n,overflowY:r}=e;return T.test(""+t+n+r)}function B(e){var t=getComputedStyle(e),n=document.documentElement,r="absolute"===t.position;if("fixed"===t.position)return n;for(var a=e;a=null==a?void 0:a.parentElement;)if(t=getComputedStyle(a),(!r||"static"!==t.position)&&A(t))return a;return n}function V(e,t,n,r){void 0===n&&(n=300);var a=0,o=R(e),i=t-o;requestAnimationFrame((function t(){var l,u=i*((l=(l=a+=5)/n-1)*l*l+1)+o;!function(e,t){D(e)?window.scrollTo(0,t):e.scrollTop=t}(e,u),a<n?requestAnimationFrame(t):null==r||r()}))}var F=/[\u0300-\u036f]/g,P=e=>"boolean"==typeof e,q=e=>"function"==typeof e,j=e=>Array.isArray(e)&&!!e.length,W=e=>null!==e&&"object"==typeof e&&!Array.isArray(e),_=e=>{e.preventDefault(),e.stopPropagation()},U=(e,t,n)=>{var r=e.trim();return t&&(r=r.toLowerCase()),n?r.normalize("NFD").replace(F,""):r},K=(e,t,n)=>{var r=Array.isArray(e)?e:W(e)?[e]:L;return j(r)?r.map((e=>({data:e,value:t(e),label:n(e)}))):r},Y=(e,t)=>{var n=u({},e);return Object.keys(t).forEach((r=>{var a=t[r];n[r]="animation"!==r&&W(a)?e[r]?Y(e[r],a):a:null!=a?a:""})),n},H={color:{border:"#ced4da",danger:"#dc3545",primary:"#007bff",disabled:"#e9ecef",placeholder:"#6E7276",dangerLight:"rgba(220, 53, 69, 0.25)"},input:{},select:{},loader:{size:"0.625rem",padding:"0.375rem 0.75rem",animation:n.css([""," 1.19s ease-in-out infinite"],y),color:"rgba(0, 123, 255, 0.42)"},icon:{color:"#ccc",hoverColor:"#A6A6A6",padding:"0 0.9375rem",clear:{width:"14px",height:"16px",animation:C,transition:"color 0.2s ease-out"},caret:{size:"7px",transition:"transform 0.3s ease-in-out, color 0.2s ease-out"}},control:{minHeight:"38px",borderWidth:"1px",borderStyle:"solid",borderRadius:"3px",boxShadow:"0 0 0 0.2rem",padding:"0.375rem 0.75rem",boxShadowColor:"rgba(0, 123, 255, 0.25)",focusedBorderColor:"rgba(0, 123, 255, 0.75)",transition:"box-shadow 0.2s ease-out, border-color 0.2s ease-out"},menu:{padding:"0",width:"100%",margin:"0.35rem 0",borderRadius:"3px",backgroundColor:"#fff",animation:C,boxShadow:"0 0.5em 1em -0.125em rgb(10 10 10 / 12%), 0 0 0 1px rgb(10 10 10 / 4%)",option:{textAlign:"left",selectedColor:"#fff",selectedBgColor:"#007bff",padding:"0.375rem 0.75rem",focusedBgColor:"rgba(0, 123, 255, 0.15)"}},noOptions:{fontSize:"1.25rem",margin:"0.25rem 0",color:"hsl(0, 0%, 60%)",padding:"0.375rem 0.75rem"},placeholder:{animation:C},multiValue:{margin:"1px 2px",borderRadius:"3px",backgroundColor:"#e7edf3",animation:C,label:{borderRadius:"3px",fontSize:"0.825em",padding:"1px 0 1px 6px"},clear:{fontWeight:600,padding:"0 6px",color:"#a6a6a6",fontSize:"0.65em",alignSelf:"center",focusColor:"#808080",transition:"color 0.2s ease-out"}}},X=!!(null===window||void 0===window?void 0:window.ontouchstart)||!!(null===navigator||void 0===navigator?void 0:navigator.maxTouchPoints),G=(e,t)=>{var{memoOptions:n}=t.data;return n&&r.areEqual(e,t)},J=t.memo((e=>{var{index:t,style:n,data:{menuOptions:r,selectOption:a,renderOptionLabel:o,focusedOptionIndex:l}}=e,{data:u,value:s,label:c,isDisabled:p,isSelected:m}=r[t],f=((e,t,n)=>{var r=d;return e&&(r+=" rfs-option-disabled"),t&&(r+=" rfs-option-selected"),n&&(r+=" rfs-option-focused"),r})(p,m,t===l),v=p?void 0:()=>a({data:u,value:s,label:c},m);return i.default.createElement("div",{style:n,onClick:v,className:f},o(u))}),G);J.displayName="Option";var Q=l.default.div.withConfig({displayName:"NoOptionsMsg",componentId:"sc-1on2920-0"})(["text-align:center;color:",";margin:",";padding:",";font-size:",";",""],(e=>{var{theme:t}=e;return t.noOptions.color}),(e=>{var{theme:t}=e;return t.noOptions.margin}),(e=>{var{theme:t}=e;return t.noOptions.padding}),(e=>{var{theme:t}=e;return t.noOptions.fontSize}),(e=>{var{theme:t}=e;return t.noOptions.css})),Z=e=>{var{width:n,height:a,itemSize:o,direction:l,isLoading:u,loadingMsg:d,menuOptions:s,memoOptions:c,selectOption:p,noOptionsMsg:m,overscanCount:f,itemKeySelector:v,fixedSizeListRef:h,renderOptionLabel:g,focusedOptionIndex:b}=e,w=t.useMemo((()=>({menuOptions:s,memoOptions:c,selectOption:p,renderOptionLabel:g,focusedOptionIndex:b})),[s,c,b,p,g]);if(u)return i.default.createElement(Q,null,d);var O=v?(e,t)=>t.menuOptions[e][v]:void 0;return i.default.createElement(t.Fragment,null,i.default.createElement(r.FixedSizeList,{width:n,height:a,itemKey:O,itemSize:o,itemData:w,direction:l,ref:h,overscanCount:f,itemCount:s.length},J),!j(s)&&m&&i.default.createElement(Q,null,m))},$=["menuRef","menuTop","menuOpen","onMenuMouseDown","menuPortalTarget"],ee=l.default.div.withConfig({displayName:"MenuWrapper",componentId:"sc-105ivps-0"})(["z-index:999;cursor:default;position:absolute;"," "," .","{display:block;overflow:hidden;user-select:none;white-space:nowrap;text-overflow:ellipsis;-webkit-tap-highlight-color:transparent;will-change:top;padding:",";text-align:",";&.",",&:hover:not(.","):not(.","){background-color:",";}&.","{color:",";background-color:",";}&.","{opacity:0.35;}}"],(e=>{var{menuTop:t,menuOpen:r,hideNoOptionsMsg:a,theme:{menu:o}}=e;return n.css(["width:",";margin:",";padding:",";animation:",";border-radius:",";background-color:",";box-shadow:",";"," ",""],o.width,o.margin,o.padding,o.animation,o.borderRadius,o.backgroundColor,a?"none":o.boxShadow,!r&&"display: none;",t&&"top: "+t+";")}),(e=>{var{theme:t}=e;return t.menu.css}),d,(e=>{var{theme:t}=e;return t.menu.option.padding}),(e=>{var{theme:t}=e;return t.menu.option.textAlign}),s,p,c,(e=>{var{theme:t}=e;return t.menu.option.focusedBgColor}),c,(e=>{var{theme:t}=e;return t.menu.option.selectedColor}),(e=>{var{theme:t}=e;return t.menu.option.selectedBgColor}),p),te=e=>{var{menuRef:t,menuTop:n,menuOpen:r,onMenuMouseDown:o,menuPortalTarget:l}=e,d=function(e,t){if(null==e)return{};var n,r,a={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,$),{menuOptions:s,noOptionsMsg:c}=d,p=r&&!Boolean(c)&&!j(s),m=i.default.createElement(ee,{ref:t,menuTop:n,menuOpen:r,onMouseDown:o,className:"rfs-menu-container",hideNoOptionsMsg:p},i.default.createElement(Z,u({},d)));return l?a.createPortal(m,l):m},ne=n.css(["color:",";"],(e=>{var{theme:t}=e;return t.multiValue.clear.focusColor})),re=l.default.div.withConfig({displayName:"MultiValueWrapper",componentId:"sc-1vzivtq-0"})(["min-width:0;display:flex;"," ",""],(e=>{var{theme:{multiValue:t}}=e;return n.css(["margin:",";animation:",";border-radius:",";background-color:",";"],t.margin,t.animation,t.borderRadius,t.backgroundColor)}),(e=>{var{theme:t}=e;return t.multiValue.css})),ae=l.default.div.withConfig({displayName:"Label",componentId:"sc-1vzivtq-1"})(["overflow:hidden;white-space:nowrap;text-overflow:ellipsis;padding:",";font-size:",";border-radius:",";"],(e=>{var{theme:t}=e;return t.multiValue.label.padding}),(e=>{var{theme:t}=e;return t.multiValue.label.fontSize}),(e=>{var{theme:t}=e;return t.multiValue.label.borderRadius})),oe=l.default.i.withConfig({displayName:"Clear",componentId:"sc-1vzivtq-2"})(["display:flex;font-style:inherit;"," ",""],(e=>{var{theme:{multiValue:{clear:t}}}=e;return n.css(["color:",";padding:",";font-size:",";align-self:",";transition:",";font-weight:",";&:hover{","}"],t.color,t.padding,t.fontSize,t.alignSelf,t.transition,t.fontWeight,ne)}),(e=>{var{isFocused:t}=e;return t&&ne})),ie=t.memo((e=>{var{data:t,value:n,isFocused:r,renderOptionLabel:a,removeSelectedOption:o}=e,l=a(t),u=()=>o(n);return i.default.createElement(re,null,i.default.createElement(ae,null,l),i.default.createElement(oe,{isFocused:r,onClick:u,onTouchEnd:u,onMouseDown:_},"✖"))}));ie.displayName="MultiValue";var le=()=>{var e=t.useRef(!0);return e.current?(e.current=!1,!0):e.current},ue=(e,n)=>{var r=le();t.useEffect((()=>{if(!r)return e()}),n)},de=e=>{var n=t.useRef(e);return t.useEffect((()=>{n.current=e})),t.useCallback((function(){for(var e,t=arguments.length,r=new Array(t),a=0;a<t;a++)r[a]=arguments[a];return null===(e=n.current)||void 0===e?void 0:e.call(n,...r)}),[])},se=function(e,n,r,a,o,i,l,u,d,s,c,p,m){void 0===d&&(d=!1),void 0===s&&(s=!1),void 0===c&&(c=!1),void 0===p&&(p=!1);var[f,v]=t.useState(L),g=de(u||z.OPTION_FILTER),b=de(l||z.OPTION_IS_DISABLED),w=p?"":n,O=r===h.ANY,y=P(m)?m:c;return t.useEffect((()=>{var t=a.length?new Set(a.map((e=>e.value))):null,n=U(w,d,s),r=e=>{var r,a=o(e),l=i(e),u=b(e),c=null!==(r=null==t?void 0:t.has(a))&&void 0!==r&&r,p={data:e,value:a,label:l,isDisabled:u,isSelected:c};if(!(!(e=>{if(!n)return!0;var t=g(e),r=U(t,d,s);return O?r.includes(n):r.substr(0,n.length)===n})(p)||y&&c))return p},l=e.reduce(((e,t)=>{var n=r(t);return n&&e.push(n),e}),[]);v(l)}),[e,w,o,i,a,O,d,s,b,g,y]),f},ce=(e,n,r,a,o,i,l,u,d,s,c,p)=>{var m=t.useRef(!1),f=t.useRef(!u),h=de(d),g=de(s),[b,w]=t.useState(i),[O,y]=t.useState(!1);t.useEffect((()=>{f.current=!O&&!u})),t.useEffect((()=>{var{TOP:t,AUTO:n}=v,r=a===t||a===n&&!(e=>{if(!e)return!0;var t=B(e),{top:n,height:r}=e.getBoundingClientRect(),{height:a}=t.getBoundingClientRect();return a-R(t)-n>=r})(e.current);y(r)}),[e,a]),ue((()=>{if(r){var t=e=>{h(),e&&(m.current=!0,w(e))};f.current?((e,t,n,r)=>{if(e){var{top:a,height:o,bottom:i}=e.getBoundingClientRect(),l=window.innerHeight;if(l-a>=o)r();else{var u=B(e),d=R(u),s=u.getBoundingClientRect().height-d-a,c=s<o;if(!c&&n){var p=getComputedStyle(e).marginBottom;V(u,i-l+d+parseInt(p,10),t,r)}else r(c?s:void 0)}}else r()})(e.current,c,p,t):t()}else g(),m.current&&(m.current=!1,w(i))}),[e,r,i,p,c,g,h]);var x=Math.min(b,l*o),C=O?((e,t,n)=>{var r,a,o=t&&getComputedStyle(t),i=o?parseInt(o.marginBottom,10):0,l=o?parseInt(o.marginTop,10):0,u=null!==(r=null==n?void 0:n.getBoundingClientRect().height)&&void 0!==r?r:0,d=e>0?e:null!==(a=null==t?void 0:t.getBoundingClientRect().height)&&void 0!==a?a:0;return"calc("+-Math.abs(d+u)+"px + "+(i+l)+"px)"})(x,e.current,n.current):void 0;return[C,x]},pe=n.css(["top:50%;overflow:hidden;position:absolute;white-space:nowrap;box-sizing:border-box;text-overflow:ellipsis;transform:translateY(-50%);"]),me=l.default.div.withConfig({displayName:"SingleValue",componentId:"sc-us7kwl-0"})([""," max-width:calc(100% - 0.5rem);"],pe),fe=l.default.div.withConfig({displayName:"Placeholder",componentId:"sc-us7kwl-1"})([""," color:",";",""],pe,(e=>{var{theme:t}=e;return t.color.placeholder}),(e=>{var{theme:t,initRender:r}=e;return!r&&n.css(["animation:",";"],t.placeholder.animation)})),ve=e=>{var{isMulti:n,inputValue:r,placeholder:a,selectedOption:o,focusedMultiValue:l,renderOptionLabel:u,renderMultiOptions:d,removeSelectedOption:s}=e,c=le(),p=!j(o);return r&&(!n||n&&(p||d))?null:p?i.default.createElement(fe,{initRender:c},a):n?i.default.createElement(t.Fragment,null,d?d({renderOptionLabel:u,selected:o}):o.map((e=>{var{data:t,value:n}=e;return i.default.createElement(ie,{key:n,data:t,value:n,renderOptionLabel:u,isFocused:n===l,removeSelectedOption:s})}))):i.default.createElement(me,null,u(o[0].data))},he=n.css(["font-size:inherit;font-weight:inherit;font-family:inherit;"]),ge=l.default.div.withConfig({displayName:"SizerDiv",componentId:"sc-4er7q8-0"})(["top:0;left:0;height:0;overflow:scroll;white-space:pre;position:absolute;visibility:hidden;"," ",""],he,(e=>{var{theme:t}=e;return t.input.css})),be=l.default.input.attrs(f).withConfig({displayName:"Input",componentId:"sc-4er7q8-1"})(["border:0;outline:0;padding:0;cursor:text;background:0;color:inherit;box-sizing:content-box;"," :read-only{opacity:0;cursor:default;}:required{","}",""],he,(e=>{var{theme:t,isInvalid:n}=e;return n&&t.input.cssRequired}),(e=>{var{theme:t}=e;return t.input.css})),we=t.memo(t.forwardRef(((e,n)=>{var{id:r,onBlur:a,onFocus:o,readOnly:l,required:u,onChange:d,ariaLabel:s,inputValue:c,ariaLabelledBy:p,hasSelectedOptions:m}=e,f=!!u&&!m,v=t.useRef(null),[h,g]=t.useState(15);return ue((()=>{var{current:e}=v;e&&g(e.scrollWidth+15)}),[c]),i.default.createElement(t.Fragment,null,i.default.createElement(be,{id:r,ref:n,isInvalid:!0,onBlur:a,onFocus:o,value:c,readOnly:l,required:f,"aria-label":s,style:{width:h},"aria-labelledby":p,onChange:l?void 0:d}),i.default.createElement(ge,{ref:v},c))})));we.displayName="AutosizeInput";var Oe=l.default.span.withConfig({displayName:"A11yText",componentId:"sc-1yv4bud-0"})(["border:0;padding:0;width:1px;height:1px;margin:-1px;z-index:9999;overflow:hidden;position:absolute;white-space:nowrap;clip:rect(0,0,0,0);"]),ye=e=>{var{menuOpen:t,isFocused:n,inputValue:r,optionCount:a,isSearchable:o,focusedOption:l,selectedOption:u,ariaLive:d="polite",ariaLabel:s="Select"}=e;if(!n)return null;var c=t?"Use Up and Down arrow keys to choose options, press Enter or Tab to select the currently focused option, press Escape to close the menu.":s+" is focused"+(o?", type to filter options":"")+", press Down arrow key to open the menu.",{index:p,value:m,label:f,isDisabled:v}=l,h=((m&&!v?"Option "+f+" is focused, "+(p+1)+" of "+a+".":"")+" "+(a+" option(s) available"+(r?" for search "+r:"")+".")+" "+c).trimStart(),g="Selected option: "+(u.length?u.map((e=>e.label)).join(" "):"N/A");return i.default.createElement(Oe,{"aria-atomic":"false","aria-live":d,"aria-relevant":"additions text"},i.default.createElement("span",{id:"aria-selection"},g),i.default.createElement("span",{id:"aria-context"},h))},xe=l.default.div.withConfig({displayName:"StyledLoadingDots",componentId:"sc-1tlaoz1-0"})(["display:flex;align-self:center;text-align:center;margin-right:0.25rem;padding:",";> div{border-radius:100%;display:inline-block;"," :nth-of-type(1){animation-delay:-0.272s;}:nth-of-type(2){animation-delay:-0.136s;}}"],(e=>{var{theme:t}=e;return t.loader.padding}),(e=>{var{theme:t}=e;return n.css(["width:",";height:",";animation:",";background-color:",";"],t.loader.size,t.loader.size,t.loader.animation,t.loader.color)})),Ce=()=>i.default.createElement(xe,{"aria-hidden":!0,className:"rfs-loading-dots"},i.default.createElement("div",null),i.default.createElement("div",null),i.default.createElement("div",null)),Ie=l.default.svg.withConfig({displayName:"ClearSvg",componentId:"sc-kkzaaw-0"})(["fill:currentColor;",""],(e=>{var{theme:t}=e;return n.css(["width:",";height:",";animation:",";transition:",";"],t.icon.clear.width,t.icon.clear.height,t.icon.clear.animation,t.icon.clear.transition)})),Se=()=>i.default.createElement(Ie,{"aria-hidden":!0,focusable:"false",viewBox:"0 0 14 16",className:"rfs-clear-icon"},i.default.createElement("path",{fillRule:"evenodd",d:"M7.71 8.23l3.75 3.75-1.48 1.48-3.75-3.75-3.75 3.75L1 11.98l3.75-3.75L1 4.48 2.48 3l3.75 3.75L9.98 3l1.48 1.48-3.75 3.75z"})),Ee=l.default.div.withConfig({displayName:"IndicatorIconsWrapper",componentId:"sc-1jozl2i-0"})(["display:flex;flex-shrink:0;align-items:center;align-self:stretch;box-sizing:border-box;"]),Me=l.default.div.withConfig({displayName:"IndicatorIcon",componentId:"sc-1jozl2i-1"})(["height:100%;display:flex;align-items:center;box-sizing:border-box;color:",";padding:",";:hover{color:",";}",""],(e=>{var{theme:t}=e;return t.icon.color}),(e=>{var{theme:t}=e;return t.icon.padding}),(e=>{var{theme:t}=e;return t.icon.hoverColor}),(e=>{var{theme:t}=e;return t.icon.css})),ke=l.default.div.withConfig({displayName:"Separator",componentId:"sc-1jozl2i-2"})(["width:1px;margin:0.5rem 0;align-self:stretch;box-sizing:border-box;background-color:",";"],(e=>{var{theme:t}=e;return t.color.iconSeparator||t.color.border})),Ne=l.default.div.withConfig({displayName:"Caret",componentId:"sc-1jozl2i-3"})(["transition:",";border-top:"," dashed;border-left:"," solid transparent;border-right:"," solid transparent;",""],(e=>{var{theme:t}=e;return t.icon.caret.transition}),(e=>{var{theme:t}=e;return t.icon.caret.size}),(e=>{var{theme:t}=e;return t.icon.caret.size}),(e=>{var{theme:t}=e;return t.icon.caret.size}),(e=>{var{theme:t,menuOpen:r,isInvalid:a}=e;return r&&n.css(["transform:rotate(180deg);color:",";"],a?t.color.danger:t.color.caretActive||t.color.primary)})),Le=t.memo((e=>{var{menuOpen:t,clearIcon:n,caretIcon:r,isInvalid:a,showClear:o,isLoading:l,isDisabled:u,loadingNode:d,onCaretMouseDown:s,onClearMouseDown:c}=e,p=e=>q(e)?e({menuOpen:t,isLoading:l,isInvalid:a,isDisabled:u}):e;return i.default.createElement(Ee,null,o&&!l&&i.default.createElement(Me,{onTouchEnd:c,onMouseDown:c},p(n)||i.default.createElement(Se,null)),l&&(d||i.default.createElement(Ce,null)),i.default.createElement(ke,{role:"none"}),i.default.createElement(Me,{onTouchEnd:s,onMouseDown:s},p(r)||i.default.createElement(Ne,{"aria-hidden":!0,menuOpen:t,isInvalid:a,className:"rfs-caret-icon"})))}));Le.displayName="IndicatorIcons";var ze=l.default.div.attrs(m).withConfig({displayName:"SelectWrapper",componentId:"sc-kcrmu9-0"})(["position:relative;box-sizing:border-box;",""],(e=>{var{theme:t}=e;return t.select.css})),Te=l.default.div.withConfig({displayName:"ValueWrapper",componentId:"sc-kcrmu9-1"})(["flex:1 1 0%;display:flex;flex-wrap:wrap;overflow:hidden;position:relative;align-items:center;box-sizing:border-box;padding:",";"],(e=>{var{theme:t}=e;return t.control.padding})),Re=l.default.div.withConfig({displayName:"ControlWrapper",componentId:"sc-kcrmu9-2"})(["outline:0;display:flex;flex-wrap:wrap;cursor:default;position:relative;align-items:center;box-sizing:border-box;justify-content:space-between;"," "," ",""],(e=>{var{isDisabled:t,isFocused:r,isInvalid:a,theme:{control:o,color:i}}=e;return n.css(["transition:",";border-style:",";border-width:",";border-radius:",";min-height:",";border-color:",";"," "," "," ",""],o.transition,o.borderStyle,o.borderWidth,o.borderRadius,o.height||o.minHeight,a?i.danger:r?o.focusedBorderColor:i.border,o.height&&"height: "+o.height+";",t&&"pointer-events:none;user-select:none;",(o.backgroundColor||t)&&"background-color: "+(t?i.disabled:o.backgroundColor)+";",r&&"box-shadow: "+o.boxShadow+" "+(a?i.dangerLight:o.boxShadowColor)+";")}),(e=>{var{theme:t}=e;return t.control.css}),(e=>{var{isFocused:t,theme:n}=e;return t&&n.control.focusedCss})),De=t.forwardRef(((e,r)=>{var a,{async:o,isMulti:l,inputId:d,selectId:s,required:c,ariaLive:p,autoFocus:m,isLoading:f,onKeyDown:y,clearIcon:x,caretIcon:C,isInvalid:T,ariaLabel:R,menuWidth:D,isDisabled:A,inputDelay:B,onMenuOpen:V,onMenuClose:F,onInputBlur:U,isClearable:G,themeConfig:J,loadingNode:Q,initialValue:Z,onInputFocus:$,onInputChange:ee,ariaLabelledBy:ne,onOptionChange:re,onSearchChange:ae,getOptionLabel:oe,getOptionValue:ie,itemKeySelector:le,openMenuOnFocus:pe,menuPortalTarget:me,isAriaLiveEnabled:fe,menuOverscanCount:he,blurInputOnSelect:ge,menuItemDirection:be,renderOptionLabel:Oe,renderMultiOptions:xe,menuScrollDuration:Ce,filterIgnoreAccents:Ie,hideSelectedOptions:Se,getIsOptionDisabled:Ee,getFilterOptionString:Me,isSearchable:ke=!0,memoOptions:Ne=!1,lazyLoadMenu:De=!1,openMenuOnClick:Ae=!0,filterIgnoreCase:Be=!0,tabSelectsOption:Ve=!0,closeMenuOnSelect:Fe=!0,scrollMenuIntoView:Pe=!0,backspaceClearsValue:qe=!0,filterMatchFrom:je=h.ANY,menuPosition:We=v.BOTTOM,options:_e=L,loadingMsg:Ue=E,placeholder:Ke=k,noOptionsMsg:Ye=M,menuItemSize:He=I,menuMaxHeight:Xe=S}=e,Ge=t.useRef(!1),Je=t.useRef(),Qe=t.useRef(!1),Ze=t.useRef(q(ae)),$e=t.useRef(q(re)),et=t.useRef(null),tt=t.useRef(null),nt=t.useRef(null),rt=t.useRef(null),[at,ot]=t.useState(""),[it,lt]=t.useState(!1),[ut,dt]=t.useState(!1),[st,ct]=t.useState(null),[pt,mt]=t.useState(N),ft=t.useMemo((()=>(e=>W(e)?Y(H,e):H)(J)),[J]),vt=t.useMemo((()=>oe||z.OPTION_LABEL),[oe]),ht=t.useMemo((()=>ie||z.OPTION_VALUE),[ie]),gt=t.useMemo((()=>Oe||vt),[Oe,vt]),bt=function(e,n){void 0===n&&(n=0);var[r,a]=t.useState(e);return ue((()=>{if(!(n<=0)){var t=setTimeout((()=>{a(e)}),n);return()=>{clearTimeout(t)}}}),[e,n]),n<=0?e:r}(at,B),[wt,Ot]=t.useState((()=>K(Z,ht,vt))),yt=se(_e,bt,je,wt,ht,vt,Ee,Me,Be,Ie,l,o,Se),[xt,Ct]=ce(tt,rt,it,We,He,Xe,yt.length,!!me,V,F,Ce,Pe),It=de(ae),St=de(re),Et=()=>{var e;return null===(e=nt.current)||void 0===e?void 0:e.blur()},Mt=()=>{var e;return null===(e=nt.current)||void 0===e?void 0:e.focus()},kt=e=>{var t;return null===(t=et.current)||void 0===t?void 0:t.scrollToItem(e)},Nt=j(wt),Lt=P(ge)?ge:X,zt=t.useCallback((e=>{if(j(yt)){var t=l?-1:yt.findIndex((e=>e.isSelected)),n=t>-1?t:e===O?0:yt.length-1;kt(n),lt(!0),ct(null),mt(u({index:n},yt[n]))}else lt(!0)}),[l,yt]),Tt=t.useCallback((e=>{Ot((t=>t.filter((t=>t.value!==e))))}),[]),Rt=t.useCallback(((e,t)=>{t?l&&Tt(e.value):Ot((t=>l?[...t,e]:[e])),Lt?Et():Fe&&(ot(""),lt(!1))}),[l,Fe,Tt,Lt]);t.useImperativeHandle(r,(()=>({empty:!Nt,menuOpen:Ge.current,blur:Et,focus:Mt,clearValue:()=>{Ot(L),mt(N)},setValue:e=>{var t=K(e,ht,vt);Ot(t)},toggleMenu:e=>{!0===e||void 0===e&&!Ge.current?(Mt(),zt(O)):Et()}})),[Nt,ht,vt,zt]),a=()=>{m&&Mt()},t.useEffect(a,[]),t.useEffect((()=>{Ge.current=it}),[it]),t.useEffect((()=>{Ze.current=q(ae),$e.current=q(re)})),t.useEffect((()=>{ut&&pe&&zt(O)}),[ut,pe,zt]),t.useEffect((()=>{var{current:e}=Ze;e&&Qe.current&&(Qe.current=!1,It(bt))}),[It,bt]),ue((()=>{var{current:e}=$e;if(e){var t=l?wt.map((e=>e.data)):j(wt)?wt[0].data:null;St(t)}}),[St,l,wt]),ue((()=>{var{length:e}=yt,t=e>0&&(o||e!==_e.length||0===Je.current);0===e?mt(N):(1===e||t)&&(kt(0),mt(u({index:0},yt[0]))),Je.current=e}),[o,_e,yt]);var Dt=()=>{var{data:e,value:t,label:n,isSelected:r,isDisabled:a}=pt;e&&!a&&Rt({data:e,value:t,label:n},r)},At=e=>{if(j(yt)){var t=e===b?(pt.index+1)%yt.length:pt.index>0?pt.index-1:yt.length-1;kt(t),ct(null),mt(u({index:t},yt[t]))}},Bt=e=>{_(e),Mt()},Vt=e=>{if(!A){ut||Mt();var t="INPUT"!==e.target.nodeName;it?t&&(lt(!1),ot("")):Ae&&zt(O),t&&e.preventDefault()}},Ft=t.useCallback((e=>{null==U||U(e),dt(!1),lt(!1),ot("")}),[U]),Pt=t.useCallback((e=>{null==$||$(e),dt(!0)}),[$]),qt=t.useCallback((e=>{Qe.current=!0,null==ee||ee(e.currentTarget.value),ot(e.currentTarget.value),lt(!0)}),[ee]),jt=t.useCallback((e=>{Bt(e),Ge.current?lt(!1):zt(O)}),[zt]),Wt=t.useCallback((e=>{Bt(e),Ot(L)}),[]),_t=!De||De&&it,Ut=!(!G||A||!Nt),Kt=A||!ke||!!st,Yt=A||Ae?void 0:jt;return i.default.createElement(n.ThemeProvider,{theme:ft},i.default.createElement(ze,{id:s,"aria-controls":d,"aria-expanded":it,onKeyDown:e=>{if(!A){var{key:t,shiftKey:n,defaultPrevented:r}=e;if(!y||(y(e,at,pt),!r)){switch(t){case"ArrowDown":it?At(b):zt(O);break;case"ArrowUp":it?At(g):zt(w);break;case"ArrowLeft":case"ArrowRight":if(!l||at||xe)return;(e=>{if(Nt){var t=-1,n=wt.length-1,r=st?wt.findIndex((e=>e.value===st)):-1,a=(t="ArrowRight"===e?r>-1&&r<n?r+1:-1:0!==r?-1===r?n:r-1:0)>=0?wt[t].value:null;pt.data&&mt(N),a!==st&&ct(a)}})(t);break;case" ":if(at)return;if(it){if(!pt.data)return;Dt()}else zt(O);break;case"Enter":it&&Dt();break;case"Escape":it&&(lt(!1),ot(""));break;case"Tab":if(!it||!Ve||!pt.data||n)return;Dt();break;case"Delete":case"Backspace":if(at)return;if(st){var a=wt.findIndex((e=>e.value===st)),o=a>-1&&a<wt.length-1?wt[a+1].value:null;Tt(st),ct(o)}else{if(!qe)return;if(!Nt)break;if(l&&!xe){var{value:i}=wt[wt.length-1];Tt(i)}else G&&Ot(L)}break;default:return}e.preventDefault()}}}},i.default.createElement(Re,{ref:rt,isInvalid:T,isFocused:ut,isDisabled:A,className:"rfs-control-container",onTouchEnd:Vt,onMouseDown:Vt},i.default.createElement(Te,null,i.default.createElement(ve,{isMulti:l,inputValue:at,placeholder:Ke,selectedOption:wt,focusedMultiValue:st,renderMultiOptions:xe,renderOptionLabel:gt,removeSelectedOption:Tt}),i.default.createElement(we,{id:d,ref:nt,required:c,ariaLabel:R,inputValue:at,readOnly:Kt,onBlur:Ft,onFocus:Pt,onChange:qt,ariaLabelledBy:ne,hasSelectedOptions:Nt})),i.default.createElement(Le,{menuOpen:it,clearIcon:x,caretIcon:C,isInvalid:T,isLoading:f,showClear:Ut,isDisabled:A,loadingNode:Q,onClearMouseDown:Wt,onCaretMouseDown:Yt})),_t&&i.default.createElement(te,{menuRef:tt,menuOpen:it,isLoading:f,menuTop:xt,height:Ct,itemSize:He,loadingMsg:Ue,menuOptions:yt,memoOptions:Ne,fixedSizeListRef:et,noOptionsMsg:Ye,selectOption:Rt,direction:be,itemKeySelector:le,overscanCount:he,menuPortalTarget:me,width:D||ft.menu.width,renderOptionLabel:gt,focusedOptionIndex:pt.index,onMenuMouseDown:Bt}),fe&&i.default.createElement(ye,{ariaLive:p,menuOpen:it,isFocused:ut,ariaLabel:R,inputValue:at,isSearchable:ke,focusedOption:pt,selectedOption:wt,optionCount:yt.length})))}));De.displayName="Select",e.Select=De,Object.defineProperty(e,"__esModule",{value:!0})})); | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react"),require("styled-components"),require("react-window"),require("react-dom")):"function"==typeof define&&define.amd?define(["exports","react","styled-components","react-window","react-dom"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).ReactFunctionalSelect={},e.React,e.styled,e.ReactWindow,e.ReactDOM)}(this,(function(e,t,n,r,o){"use strict";function a(){return a=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},a.apply(this,arguments)}var i="rfs-option",l="rfs-option-focused",s="rfs-option-selected",d="rfs-option-disabled",u={role:"combobox","aria-haspopup":"listbox",className:"rfs-select-container"},c={tabIndex:0,type:"text",spellCheck:!1,autoCorrect:"off",autoComplete:"off",autoCapitalize:"none","aria-autocomplete":"list",className:"rfs-autosize-input"},p={TOP:"top",AUTO:"auto",BOTTOM:"bottom"},m={ANY:"any",START:"start"},f=0,v=1,h=2,g=3,b=n.keyframes(["0%,80%,100%{transform:scale(0);}40%{transform:scale(1.0);}"]),w=n.keyframes(["from{opacity:0;}to{opacity:1;}"]),O=n.css([""," 0.2s ease-in"],w),y=35,x=300,C="Loading..",I="No options",S="Select option..",E={index:-1},k=[],M={OPTION_LABEL:e=>{var{label:t}=e;return t},OPTION_VALUE:e=>{var{value:t}=e;return t},OPTION_IS_DISABLED:e=>{var{isDisabled:t}=e;return!!t},OPTION_FILTER:e=>{var{label:t}=e;return"string"==typeof t?t:""+t}};var N=/(auto|scroll)/;function L(e){return z(e)?window.pageYOffset:e.scrollTop}function z(e){return e===document.body||e===document.documentElement||e===window}function T(e){var{overflow:t,overflowX:n,overflowY:r}=e;return N.test(""+t+n+r)}function R(e){var t=getComputedStyle(e),n=document.documentElement,r="absolute"===t.position;if("fixed"===t.position)return n;for(var o=e;o=null==o?void 0:o.parentElement;)if(t=getComputedStyle(o),(!r||"static"!==t.position)&&T(t))return o;return n}function D(e,t,n,r){void 0===n&&(n=300);var o=0,a=L(e),i=t-a;requestAnimationFrame((function t(){var l,s=i*((l=(l=o+=5)/n-1)*l*l+1)+a;!function(e,t){z(e)?window.scrollTo(0,t):e.scrollTop=t}(e,s),o<n?requestAnimationFrame(t):null==r||r()}))}var A=/[\u0300-\u036f]/g,B=e=>"boolean"==typeof e,V=e=>"function"==typeof e,F=e=>Array.isArray(e)&&!!e.length,P=e=>null!==e&&"object"==typeof e&&!Array.isArray(e),q=e=>{e.preventDefault(),e.stopPropagation()},j=(e,t,n)=>{var r=e.trim();return t&&(r=r.toLowerCase()),n?r.normalize("NFD").replace(A,""):r},W=(e,t,n)=>{var r=Array.isArray(e)?e:P(e)?[e]:k;return F(r)?r.map((e=>({data:e,value:t(e),label:n(e)}))):r},_=(e,t)=>{var n=a({},e);return Object.keys(t).forEach((r=>{var o=t[r];n[r]="animation"!==r&&P(o)?e[r]?_(e[r],o):o:null!=o?o:""})),n},U={color:{border:"#ced4da",danger:"#dc3545",primary:"#007bff",disabled:"#e9ecef",placeholder:"#6E7276",dangerLight:"rgba(220, 53, 69, 0.25)"},input:{},select:{},loader:{size:"0.625rem",padding:"0.375rem 0.75rem",animation:n.css([""," 1.19s ease-in-out infinite"],b),color:"rgba(0, 123, 255, 0.42)"},icon:{color:"#ccc",hoverColor:"#A6A6A6",padding:"0 0.9375rem",clear:{width:"14px",height:"16px",animation:O,transition:"color 0.2s ease-out"},caret:{size:"7px",transition:"transform 0.3s ease-in-out, color 0.2s ease-out"}},control:{minHeight:"38px",borderWidth:"1px",borderStyle:"solid",borderRadius:"3px",boxShadow:"0 0 0 0.2rem",padding:"0.375rem 0.75rem",boxShadowColor:"rgba(0, 123, 255, 0.25)",focusedBorderColor:"rgba(0, 123, 255, 0.75)",transition:"box-shadow 0.2s ease-out, border-color 0.2s ease-out"},menu:{padding:"0",width:"100%",margin:"0.35rem 0",borderRadius:"3px",backgroundColor:"#fff",animation:O,boxShadow:"0 0.5em 1em -0.125em rgb(10 10 10 / 12%), 0 0 0 1px rgb(10 10 10 / 4%)",option:{textAlign:"left",selectedColor:"#fff",selectedBgColor:"#007bff",padding:"0.375rem 0.75rem",focusedBgColor:"rgba(0, 123, 255, 0.15)"}},noOptions:{fontSize:"1.25rem",margin:"0.25rem 0",color:"hsl(0, 0%, 60%)",padding:"0.375rem 0.75rem"},placeholder:{animation:O},multiValue:{margin:"1px 2px",borderRadius:"3px",backgroundColor:"#e7edf3",animation:O,label:{borderRadius:"3px",fontSize:"0.825em",padding:"1px 0 1px 6px"},clear:{fontWeight:600,padding:"0 6px",color:"#a6a6a6",fontSize:"0.65em",alignSelf:"center",focusColor:"#808080",transition:"color 0.2s ease-out"}}},K=!!(null===window||void 0===window?void 0:window.ontouchstart)||!!(null===navigator||void 0===navigator?void 0:navigator.maxTouchPoints),Y=(e,t)=>{var{memoOptions:n}=t.data;return n&&r.areEqual(e,t)},H=t.memo((e=>{var{index:n,style:r,data:{menuOptions:o,selectOption:a,renderOptionLabel:l,focusedOptionIndex:s}}=e,{data:d,value:u,label:c,isDisabled:p,isSelected:m}=o[n],f=((e,t,n)=>{var r=i;return e&&(r+=" rfs-option-disabled"),t&&(r+=" rfs-option-selected"),n&&(r+=" rfs-option-focused"),r})(p,m,n===s),v=p?void 0:()=>a({data:d,value:u,label:c},m);return t.createElement("div",{style:r,onClick:v,className:f},l(d))}),Y);H.displayName="Option";var X=n.div.withConfig({displayName:"NoOptionsMsg",componentId:"sc-1on2920-0"})(["text-align:center;color:",";margin:",";padding:",";font-size:",";",""],(e=>{var{theme:t}=e;return t.noOptions.color}),(e=>{var{theme:t}=e;return t.noOptions.margin}),(e=>{var{theme:t}=e;return t.noOptions.padding}),(e=>{var{theme:t}=e;return t.noOptions.fontSize}),(e=>{var{theme:t}=e;return t.noOptions.css})),G=e=>{var{width:n,height:o,itemSize:a,direction:i,isLoading:l,loadingMsg:s,menuOptions:d,memoOptions:u,selectOption:c,noOptionsMsg:p,overscanCount:m,itemKeySelector:f,fixedSizeListRef:v,renderOptionLabel:h,focusedOptionIndex:g}=e,b=t.useMemo((()=>({menuOptions:d,memoOptions:u,selectOption:c,renderOptionLabel:h,focusedOptionIndex:g})),[d,u,g,c,h]);if(l)return t.createElement(X,null,s);var w=f?(e,t)=>t.menuOptions[e][f]:void 0;return t.createElement(t.Fragment,null,t.createElement(r.FixedSizeList,{width:n,height:o,itemKey:w,itemSize:a,itemData:b,direction:i,ref:v,overscanCount:m,itemCount:d.length},H),!F(d)&&p&&t.createElement(X,null,p))},J=["menuRef","menuTop","menuOpen","onMenuMouseDown","menuPortalTarget"],Q=n.div.withConfig({displayName:"MenuWrapper",componentId:"sc-105ivps-0"})(["z-index:999;cursor:default;position:absolute;"," "," .","{display:block;overflow:hidden;user-select:none;white-space:nowrap;text-overflow:ellipsis;-webkit-tap-highlight-color:transparent;will-change:top;padding:",";text-align:",";&.",",&:hover:not(.","):not(.","){background-color:",";}&.","{color:",";background-color:",";}&.","{opacity:0.35;}}"],(e=>{var{menuTop:t,menuOpen:r,hideNoOptionsMsg:o,theme:{menu:a}}=e;return n.css(["width:",";margin:",";padding:",";animation:",";border-radius:",";background-color:",";box-shadow:",";"," ",""],a.width,a.margin,a.padding,a.animation,a.borderRadius,a.backgroundColor,o?"none":a.boxShadow,!r&&"display: none;",t&&"top: "+t+";")}),(e=>{var{theme:t}=e;return t.menu.css}),i,(e=>{var{theme:t}=e;return t.menu.option.padding}),(e=>{var{theme:t}=e;return t.menu.option.textAlign}),l,d,s,(e=>{var{theme:t}=e;return t.menu.option.focusedBgColor}),s,(e=>{var{theme:t}=e;return t.menu.option.selectedColor}),(e=>{var{theme:t}=e;return t.menu.option.selectedBgColor}),d),Z=e=>{var{menuRef:n,menuTop:r,menuOpen:i,onMenuMouseDown:l,menuPortalTarget:s}=e,d=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,J),{menuOptions:u,noOptionsMsg:c}=d,p=i&&!c&&!F(u),m=t.createElement(Q,{ref:n,menuTop:r,menuOpen:i,onMouseDown:l,className:"rfs-menu-container",hideNoOptionsMsg:p},t.createElement(G,a({},d)));return s?o.createPortal(m,s):m},$=n.css(["color:",";"],(e=>{var{theme:t}=e;return t.multiValue.clear.focusColor})),ee=n.div.withConfig({displayName:"MultiValueWrapper",componentId:"sc-1vzivtq-0"})(["min-width:0;display:flex;"," ",""],(e=>{var{theme:{multiValue:t}}=e;return n.css(["margin:",";animation:",";border-radius:",";background-color:",";"],t.margin,t.animation,t.borderRadius,t.backgroundColor)}),(e=>{var{theme:t}=e;return t.multiValue.css})),te=n.div.withConfig({displayName:"Label",componentId:"sc-1vzivtq-1"})(["overflow:hidden;white-space:nowrap;text-overflow:ellipsis;padding:",";font-size:",";border-radius:",";"],(e=>{var{theme:t}=e;return t.multiValue.label.padding}),(e=>{var{theme:t}=e;return t.multiValue.label.fontSize}),(e=>{var{theme:t}=e;return t.multiValue.label.borderRadius})),ne=n.i.withConfig({displayName:"Clear",componentId:"sc-1vzivtq-2"})(["display:flex;font-style:inherit;"," ",""],(e=>{var{theme:{multiValue:{clear:t}}}=e;return n.css(["color:",";padding:",";font-size:",";align-self:",";transition:",";font-weight:",";&:hover{","}"],t.color,t.padding,t.fontSize,t.alignSelf,t.transition,t.fontWeight,$)}),(e=>{var{isFocused:t}=e;return t&&$})),re=t.memo((e=>{var{data:n,value:r,isFocused:o,renderOptionLabel:a,removeSelectedOption:i}=e,l=a(n),s=()=>i(r);return t.createElement(ee,null,t.createElement(te,null,l),t.createElement(ne,{isFocused:o,onClick:s,onTouchEnd:s,onMouseDown:q},"✖"))}));re.displayName="MultiValue";var oe=()=>{var e=t.useRef(!0);return e.current?(e.current=!1,!0):e.current},ae=(e,n)=>{var r=oe();t.useEffect((()=>{if(!r)return e()}),n)},ie=e=>{var n=t.useRef(e);return t.useEffect((()=>{n.current=e})),t.useCallback((function(){for(var e,t=arguments.length,r=new Array(t),o=0;o<t;o++)r[o]=arguments[o];return null===(e=n.current)||void 0===e?void 0:e.call(n,...r)}),[])},le=function(e,n,r,o,a,i,l,s,d,u,c,p,f){void 0===d&&(d=!1),void 0===u&&(u=!1),void 0===c&&(c=!1),void 0===p&&(p=!1);var[v,h]=t.useState(k),g=ie(s||M.OPTION_FILTER),b=ie(l||M.OPTION_IS_DISABLED),w=p?"":n,O=r===m.ANY,y=B(f)?f:c;return t.useEffect((()=>{var t=o.length?new Set(o.map((e=>e.value))):null,n=j(w,d,u),r=e=>{var r,o=a(e),l=i(e),s=b(e),c=null!==(r=null==t?void 0:t.has(o))&&void 0!==r&&r,p={data:e,value:o,label:l,isDisabled:s,isSelected:c};if(!(!(e=>{if(!n)return!0;var t=g(e),r=j(t,d,u);return O?r.includes(n):r.substr(0,n.length)===n})(p)||y&&c))return p},l=e.reduce(((e,t)=>{var n=r(t);return n&&e.push(n),e}),[]);h(l)}),[e,w,a,i,o,O,d,u,b,g,y]),v},se=(e,n,r,o,a,i,l,s,d,u,c,m)=>{var f=t.useRef(!1),v=t.useRef(!s),h=ie(d),g=ie(u),[b,w]=t.useState(i),[O,y]=t.useState(!1);t.useEffect((()=>{v.current=!O&&!s})),t.useEffect((()=>{var{TOP:t,AUTO:n}=p,r=o===t||o===n&&!(e=>{if(!e)return!0;var t=R(e),{top:n,height:r}=e.getBoundingClientRect(),{height:o}=t.getBoundingClientRect();return o-L(t)-n>=r})(e.current);y(r)}),[e,o]),ae((()=>{if(r){var t=e=>{h(),e&&(f.current=!0,w(e))};v.current?((e,t,n,r)=>{if(e){var{top:o,height:a,bottom:i}=e.getBoundingClientRect(),l=window.innerHeight;if(l-o>=a)r();else{var s=R(e),d=L(s),u=s.getBoundingClientRect().height-d-o,c=u<a;if(!c&&n){var p=getComputedStyle(e).marginBottom;D(s,i-l+d+parseInt(p,10),t,r)}else r(c?u:void 0)}}else r()})(e.current,c,m,t):t()}else g(),f.current&&(f.current=!1,w(i))}),[e,r,i,m,c,g,h]);var x=Math.min(b,l*a),C=O?((e,t,n)=>{var r,o,a=t&&getComputedStyle(t),i=a?parseInt(a.marginBottom,10):0,l=a?parseInt(a.marginTop,10):0,s=null!==(r=null==n?void 0:n.getBoundingClientRect().height)&&void 0!==r?r:0,d=e>0?e:null!==(o=null==t?void 0:t.getBoundingClientRect().height)&&void 0!==o?o:0;return"calc("+-Math.abs(d+s)+"px + "+(i+l)+"px)"})(x,e.current,n.current):void 0;return[C,x]},de=n.css(["top:50%;overflow:hidden;position:absolute;white-space:nowrap;box-sizing:border-box;text-overflow:ellipsis;transform:translateY(-50%);"]),ue=n.div.withConfig({displayName:"SingleValue",componentId:"sc-us7kwl-0"})([""," max-width:calc(100% - 0.5rem);"],de),ce=n.div.withConfig({displayName:"Placeholder",componentId:"sc-us7kwl-1"})([""," color:",";",""],de,(e=>{var{theme:t}=e;return t.color.placeholder}),(e=>{var{theme:t,initRender:r}=e;return!r&&n.css(["animation:",";"],t.placeholder.animation)})),pe=e=>{var{isMulti:n,inputValue:r,placeholder:o,selectedOption:a,focusedMultiValue:i,renderOptionLabel:l,renderMultiOptions:s,removeSelectedOption:d}=e,u=oe(),c=!F(a);return r&&(!n||n&&(c||s))?null:c?t.createElement(ce,{initRender:u},o):n?t.createElement(t.Fragment,null,s?s({renderOptionLabel:l,selected:a}):a.map((e=>{var{data:n,value:r}=e;return t.createElement(re,{key:r,data:n,value:r,renderOptionLabel:l,isFocused:r===i,removeSelectedOption:d})}))):t.createElement(ue,null,l(a[0].data))},me=n.css(["font-size:inherit;font-weight:inherit;font-family:inherit;"]),fe=n.div.withConfig({displayName:"SizerDiv",componentId:"sc-4er7q8-0"})(["top:0;left:0;height:0;overflow:scroll;white-space:pre;position:absolute;visibility:hidden;"," ",""],me,(e=>{var{theme:t}=e;return t.input.css})),ve=n.input.attrs(c).withConfig({displayName:"Input",componentId:"sc-4er7q8-1"})(["border:0;outline:0;padding:0;cursor:text;background:0;color:inherit;box-sizing:content-box;"," :read-only{opacity:0;cursor:default;}:required{","}",""],me,(e=>{var{theme:t,isInvalid:n}=e;return n&&t.input.cssRequired}),(e=>{var{theme:t}=e;return t.input.css})),he=t.memo(t.forwardRef(((e,n)=>{var{id:r,onBlur:o,onFocus:a,readOnly:i,required:l,onChange:s,ariaLabel:d,inputValue:u,ariaLabelledBy:c,hasSelectedOptions:p}=e,m=!!l&&!p,f=t.useRef(null),[v,h]=t.useState(15);return ae((()=>{var{current:e}=f;e&&h(e.scrollWidth+15)}),[u]),t.createElement(t.Fragment,null,t.createElement(ve,{id:r,ref:n,isInvalid:!0,onBlur:o,onFocus:a,value:u,readOnly:i,required:m,"aria-label":d,style:{width:v},"aria-labelledby":c,onChange:i?void 0:s}),t.createElement(fe,{ref:f},u))})));he.displayName="AutosizeInput";var ge=n.span.withConfig({displayName:"A11yText",componentId:"sc-1yv4bud-0"})(["border:0;padding:0;width:1px;height:1px;margin:-1px;z-index:9999;overflow:hidden;position:absolute;white-space:nowrap;clip:rect(0,0,0,0);"]),be=e=>{var{menuOpen:n,isFocused:r,inputValue:o,optionCount:a,isSearchable:i,focusedOption:l,selectedOption:s,ariaLive:d="polite",ariaLabel:u="Select"}=e;if(!r)return null;var c=n?"Use Up and Down arrow keys to choose options, press Enter or Tab to select the currently focused option, press Escape to close the menu.":u+" is focused"+(i?", type to filter options":"")+", press Down arrow key to open the menu.",{index:p,value:m,label:f,isDisabled:v}=l,h=((m&&!v?"Option "+f+" is focused, "+(p+1)+" of "+a+".":"")+" "+(a+" option(s) available"+(o?" for search "+o:"")+".")+" "+c).trimStart(),g="Selected option: "+(s.length?s.map((e=>e.label)).join(" "):"N/A");return t.createElement(ge,{"aria-atomic":"false","aria-live":d,"aria-relevant":"additions text"},t.createElement("span",{id:"aria-selection"},g),t.createElement("span",{id:"aria-context"},h))},we=n.div.withConfig({displayName:"StyledLoadingDots",componentId:"sc-1tlaoz1-0"})(["display:flex;align-self:center;text-align:center;margin-right:0.25rem;padding:",";> div{border-radius:100%;display:inline-block;"," :nth-of-type(1){animation-delay:-0.272s;}:nth-of-type(2){animation-delay:-0.136s;}}"],(e=>{var{theme:t}=e;return t.loader.padding}),(e=>{var{theme:t}=e;return n.css(["width:",";height:",";animation:",";background-color:",";"],t.loader.size,t.loader.size,t.loader.animation,t.loader.color)})),Oe=()=>t.createElement(we,{"aria-hidden":!0,className:"rfs-loading-dots"},t.createElement("div",null),t.createElement("div",null),t.createElement("div",null)),ye=n.svg.withConfig({displayName:"ClearSvg",componentId:"sc-kkzaaw-0"})(["fill:currentColor;",""],(e=>{var{theme:t}=e;return n.css(["width:",";height:",";animation:",";transition:",";"],t.icon.clear.width,t.icon.clear.height,t.icon.clear.animation,t.icon.clear.transition)})),xe=()=>t.createElement(ye,{"aria-hidden":!0,focusable:"false",viewBox:"0 0 14 16",className:"rfs-clear-icon"},t.createElement("path",{fillRule:"evenodd",d:"M7.71 8.23l3.75 3.75-1.48 1.48-3.75-3.75-3.75 3.75L1 11.98l3.75-3.75L1 4.48 2.48 3l3.75 3.75L9.98 3l1.48 1.48-3.75 3.75z"})),Ce=n.div.withConfig({displayName:"IndicatorIconsWrapper",componentId:"sc-1jozl2i-0"})(["display:flex;flex-shrink:0;align-items:center;align-self:stretch;box-sizing:border-box;"]),Ie=n.div.withConfig({displayName:"IndicatorIcon",componentId:"sc-1jozl2i-1"})(["height:100%;display:flex;align-items:center;box-sizing:border-box;color:",";padding:",";:hover{color:",";}",""],(e=>{var{theme:t}=e;return t.icon.color}),(e=>{var{theme:t}=e;return t.icon.padding}),(e=>{var{theme:t}=e;return t.icon.hoverColor}),(e=>{var{theme:t}=e;return t.icon.css})),Se=n.div.withConfig({displayName:"Separator",componentId:"sc-1jozl2i-2"})(["width:1px;margin:0.5rem 0;align-self:stretch;box-sizing:border-box;background-color:",";"],(e=>{var{theme:t}=e;return t.color.iconSeparator||t.color.border})),Ee=n.div.withConfig({displayName:"Caret",componentId:"sc-1jozl2i-3"})(["transition:",";border-top:"," dashed;border-left:"," solid transparent;border-right:"," solid transparent;",""],(e=>{var{theme:t}=e;return t.icon.caret.transition}),(e=>{var{theme:t}=e;return t.icon.caret.size}),(e=>{var{theme:t}=e;return t.icon.caret.size}),(e=>{var{theme:t}=e;return t.icon.caret.size}),(e=>{var{theme:t,menuOpen:r,isInvalid:o}=e;return r&&n.css(["transform:rotate(180deg);color:",";"],o?t.color.danger:t.color.caretActive||t.color.primary)})),ke=t.memo((e=>{var{menuOpen:n,clearIcon:r,caretIcon:o,isInvalid:a,showClear:i,isLoading:l,isDisabled:s,loadingNode:d,onCaretMouseDown:u,onClearMouseDown:c}=e,p=e=>V(e)?e({menuOpen:n,isLoading:l,isInvalid:a,isDisabled:s}):e;return t.createElement(Ce,null,i&&!l&&t.createElement(Ie,{onTouchEnd:c,onMouseDown:c},p(r)||t.createElement(xe,null)),l&&(d||t.createElement(Oe,null)),t.createElement(Se,{role:"none"}),t.createElement(Ie,{onTouchEnd:u,onMouseDown:u},p(o)||t.createElement(Ee,{"aria-hidden":!0,menuOpen:n,isInvalid:a,className:"rfs-caret-icon"})))}));ke.displayName="IndicatorIcons";var Me=n.div.attrs(u).withConfig({displayName:"SelectWrapper",componentId:"sc-kcrmu9-0"})(["position:relative;box-sizing:border-box;",""],(e=>{var{theme:t}=e;return t.select.css})),Ne=n.div.withConfig({displayName:"ValueWrapper",componentId:"sc-kcrmu9-1"})(["flex:1 1 0%;display:flex;flex-wrap:wrap;overflow:hidden;position:relative;align-items:center;box-sizing:border-box;padding:",";"],(e=>{var{theme:t}=e;return t.control.padding})),Le=n.div.withConfig({displayName:"ControlWrapper",componentId:"sc-kcrmu9-2"})(["outline:0;display:flex;flex-wrap:wrap;cursor:default;position:relative;align-items:center;box-sizing:border-box;justify-content:space-between;"," "," ",""],(e=>{var{isDisabled:t,isFocused:r,isInvalid:o,theme:{control:a,color:i}}=e;return n.css(["transition:",";border-style:",";border-width:",";border-radius:",";min-height:",";border-color:",";"," "," "," ",""],a.transition,a.borderStyle,a.borderWidth,a.borderRadius,a.height||a.minHeight,o?i.danger:r?a.focusedBorderColor:i.border,a.height&&"height: "+a.height+";",t&&"pointer-events:none;user-select:none;",(a.backgroundColor||t)&&"background-color: "+(t?i.disabled:a.backgroundColor)+";",r&&"box-shadow: "+a.boxShadow+" "+(o?i.dangerLight:a.boxShadowColor)+";")}),(e=>{var{theme:t}=e;return t.control.css}),(e=>{var{isFocused:t,theme:n}=e;return t&&n.control.focusedCss})),ze=t.forwardRef(((e,r)=>{var o,{async:i,isMulti:l,inputId:s,selectId:d,required:u,ariaLive:c,autoFocus:b,isLoading:w,onKeyDown:O,clearIcon:N,caretIcon:L,isInvalid:z,ariaLabel:T,menuWidth:R,isDisabled:D,inputDelay:A,onMenuOpen:j,onMenuClose:Y,onInputBlur:H,isClearable:X,themeConfig:G,loadingNode:J,initialValue:Q,onInputFocus:$,onInputChange:ee,ariaLabelledBy:te,onOptionChange:ne,onSearchChange:re,getOptionLabel:oe,getOptionValue:de,itemKeySelector:ue,openMenuOnFocus:ce,menuPortalTarget:me,isAriaLiveEnabled:fe,menuOverscanCount:ve,blurInputOnSelect:ge,menuItemDirection:we,renderOptionLabel:Oe,renderMultiOptions:ye,menuScrollDuration:xe,filterIgnoreAccents:Ce,hideSelectedOptions:Ie,getIsOptionDisabled:Se,getFilterOptionString:Ee,isSearchable:ze=!0,memoOptions:Te=!1,lazyLoadMenu:Re=!1,openMenuOnClick:De=!0,filterIgnoreCase:Ae=!0,tabSelectsOption:Be=!0,closeMenuOnSelect:Ve=!0,scrollMenuIntoView:Fe=!0,backspaceClearsValue:Pe=!0,filterMatchFrom:qe=m.ANY,menuPosition:je=p.BOTTOM,options:We=k,loadingMsg:_e=C,placeholder:Ue=S,noOptionsMsg:Ke=I,menuItemSize:Ye=y,menuMaxHeight:He=x}=e,Xe=t.useRef(!1),Ge=t.useRef(),Je=t.useRef(!1),Qe=t.useRef(V(re)),Ze=t.useRef(V(ne)),$e=t.useRef(null),et=t.useRef(null),tt=t.useRef(null),nt=t.useRef(null),[rt,ot]=t.useState(""),[at,it]=t.useState(!1),[lt,st]=t.useState(!1),[dt,ut]=t.useState(null),[ct,pt]=t.useState(E),mt=t.useMemo((()=>(e=>P(e)?_(U,e):U)(G)),[G]),ft=t.useMemo((()=>oe||M.OPTION_LABEL),[oe]),vt=t.useMemo((()=>de||M.OPTION_VALUE),[de]),ht=t.useMemo((()=>Oe||ft),[Oe,ft]),gt=function(e,n){void 0===n&&(n=0);var[r,o]=t.useState(e);return ae((()=>{if(!(n<=0)){var t=setTimeout((()=>{o(e)}),n);return()=>{clearTimeout(t)}}}),[e,n]),n<=0?e:r}(rt,A),[bt,wt]=t.useState((()=>W(Q,vt,ft))),Ot=le(We,gt,qe,bt,vt,ft,Se,Ee,Ae,Ce,l,i,Ie),[yt,xt]=se(et,nt,at,je,Ye,He,Ot.length,!!me,j,Y,xe,Fe),Ct=ie(re),It=ie(ne),St=()=>{var e;return null===(e=tt.current)||void 0===e?void 0:e.blur()},Et=()=>{var e;return null===(e=tt.current)||void 0===e?void 0:e.focus()},kt=e=>{var t;return null===(t=$e.current)||void 0===t?void 0:t.scrollToItem(e)},Mt=F(bt),Nt=B(ge)?ge:K,Lt=t.useCallback((e=>{if(F(Ot)){var t=l?-1:Ot.findIndex((e=>e.isSelected)),n=t>-1?t:e===g?0:Ot.length-1;kt(n),it(!0),ut(null),pt(a({index:n},Ot[n]))}else it(!0)}),[l,Ot]),zt=t.useCallback((e=>{wt((t=>t.filter((t=>t.value!==e))))}),[]),Tt=t.useCallback(((e,t)=>{t?l&&zt(e.value):wt((t=>l?[...t,e]:[e])),Nt?St():Ve&&(ot(""),it(!1))}),[l,Ve,zt,Nt]);t.useImperativeHandle(r,(()=>({empty:!Mt,menuOpen:Xe.current,blur:St,focus:Et,clearValue:()=>{wt(k),pt(E)},setValue:e=>{var t=W(e,vt,ft);wt(t)},toggleMenu:e=>{!0===e||void 0===e&&!Xe.current?(Et(),Lt(g)):St()}})),[Mt,vt,ft,Lt]),o=()=>{b&&Et()},t.useEffect(o,[]),t.useEffect((()=>{Xe.current=at}),[at]),t.useEffect((()=>{Qe.current=V(re),Ze.current=V(ne)})),t.useEffect((()=>{lt&&ce&&Lt(g)}),[lt,ce,Lt]),t.useEffect((()=>{var{current:e}=Qe;e&&Je.current&&(Je.current=!1,Ct(gt))}),[Ct,gt]),ae((()=>{var{current:e}=Ze;if(e){var t=l?bt.map((e=>e.data)):F(bt)?bt[0].data:null;It(t)}}),[It,l,bt]),ae((()=>{var{length:e}=Ot,t=e>0&&(i||e!==We.length||0===Ge.current);0===e?pt(E):(1===e||t)&&(kt(0),pt(a({index:0},Ot[0]))),Ge.current=e}),[i,We,Ot]);var Rt=()=>{var{data:e,value:t,label:n,isSelected:r,isDisabled:o}=ct;e&&!o&&Tt({data:e,value:t,label:n},r)},Dt=e=>{if(F(Ot)){var t=e===v?(ct.index+1)%Ot.length:ct.index>0?ct.index-1:Ot.length-1;kt(t),ut(null),pt(a({index:t},Ot[t]))}},At=e=>{q(e),Et()},Bt=e=>{if(!D){lt||Et();var t="INPUT"!==e.target.nodeName;at?t&&(it(!1),ot("")):De&&Lt(g),t&&e.preventDefault()}},Vt=t.useCallback((e=>{null==H||H(e),st(!1),it(!1),ot("")}),[H]),Ft=t.useCallback((e=>{null==$||$(e),st(!0)}),[$]),Pt=t.useCallback((e=>{Je.current=!0,null==ee||ee(e.currentTarget.value),ot(e.currentTarget.value),it(!0)}),[ee]),qt=t.useCallback((e=>{At(e),Xe.current?it(!1):Lt(g)}),[Lt]),jt=t.useCallback((e=>{At(e),wt(k)}),[]),Wt=!Re||Re&&at,_t=!(!X||D||!Mt),Ut=D||!ze||!!dt,Kt=D||De?void 0:qt;return t.createElement(n.ThemeProvider,{theme:mt},t.createElement(Me,{id:d,"aria-controls":s,"aria-expanded":at,onKeyDown:e=>{if(!D){var{key:t,shiftKey:n,defaultPrevented:r}=e;if(!O||(O(e,rt,ct),!r)){switch(t){case"ArrowDown":at?Dt(v):Lt(g);break;case"ArrowUp":at?Dt(f):Lt(h);break;case"ArrowLeft":case"ArrowRight":if(!l||rt||ye)return;(e=>{if(Mt){var t=-1,n=bt.length-1,r=dt?bt.findIndex((e=>e.value===dt)):-1,o=(t="ArrowRight"===e?r>-1&&r<n?r+1:-1:0!==r?-1===r?n:r-1:0)>=0?bt[t].value:null;ct.data&&pt(E),o!==dt&&ut(o)}})(t);break;case" ":if(rt)return;if(at){if(!ct.data)return;Rt()}else Lt(g);break;case"Enter":at&&Rt();break;case"Escape":at&&(it(!1),ot(""));break;case"Tab":if(!at||!Be||!ct.data||n)return;Rt();break;case"Delete":case"Backspace":if(rt)return;if(dt){var o=bt.findIndex((e=>e.value===dt)),a=o>-1&&o<bt.length-1?bt[o+1].value:null;zt(dt),ut(a)}else{if(!Pe)return;if(!Mt)break;if(l&&!ye){var{value:i}=bt[bt.length-1];zt(i)}else X&&wt(k)}break;default:return}e.preventDefault()}}}},t.createElement(Le,{ref:nt,isInvalid:z,isFocused:lt,isDisabled:D,className:"rfs-control-container",onTouchEnd:Bt,onMouseDown:Bt},t.createElement(Ne,null,t.createElement(pe,{isMulti:l,inputValue:rt,placeholder:Ue,selectedOption:bt,focusedMultiValue:dt,renderMultiOptions:ye,renderOptionLabel:ht,removeSelectedOption:zt}),t.createElement(he,{id:s,ref:tt,required:u,ariaLabel:T,inputValue:rt,readOnly:Ut,onBlur:Vt,onFocus:Ft,onChange:Pt,ariaLabelledBy:te,hasSelectedOptions:Mt})),t.createElement(ke,{menuOpen:at,clearIcon:N,caretIcon:L,isInvalid:z,isLoading:w,showClear:_t,isDisabled:D,loadingNode:J,onClearMouseDown:jt,onCaretMouseDown:Kt})),Wt&&t.createElement(Z,{menuRef:et,menuOpen:at,isLoading:w,menuTop:yt,height:xt,itemSize:Ye,loadingMsg:_e,menuOptions:Ot,memoOptions:Te,fixedSizeListRef:$e,noOptionsMsg:Ke,selectOption:Tt,direction:we,itemKeySelector:ue,overscanCount:ve,menuPortalTarget:me,width:R||mt.menu.width,renderOptionLabel:ht,focusedOptionIndex:ct.index,onMenuMouseDown:At}),fe&&t.createElement(be,{ariaLive:c,menuOpen:at,isFocused:lt,ariaLabel:T,inputValue:rt,isSearchable:ze,focusedOption:ct,selectedOption:bt,optionCount:Ot.length})))}));ze.displayName="Select",e.Select=ze})); |
import React, { type ReactNode, type KeyboardEvent, type FocusEventHandler } from 'react'; | ||
import { FilterMatchEnum, MenuPositionEnum } from './constants'; | ||
import { type DefaultTheme } from 'styled-components'; | ||
import type { OptionData, PartialDeep, IconRenderer, FocusedOption, SelectedOption, CallbackFunction, AriaLiveAttribute, OptionLabelCallback, OptionValueCallback } from './types'; | ||
import type { OptionData, PartialDeep, IconRenderer, FocusedOption, SelectedOption, CallbackFn, AriaLiveAttribute, OptionLabelCallback, OptionValueCallback } from './types'; | ||
export declare type Theme = PartialDeep<DefaultTheme>; | ||
@@ -68,4 +68,4 @@ export declare type MultiParams = Readonly<{ | ||
filterIgnoreAccents?: boolean; | ||
onMenuOpen?: CallbackFunction; | ||
onMenuClose?: CallbackFunction; | ||
onMenuOpen?: CallbackFn; | ||
onMenuClose?: CallbackFn; | ||
backspaceClearsValue?: boolean; | ||
@@ -78,6 +78,6 @@ menuPosition?: MenuPositionEnum; | ||
getOptionValue?: OptionValueCallback; | ||
onInputChange?: (value?: string) => any; | ||
initialValue?: OptionData | OptionData[]; | ||
onSearchChange?: (value?: string) => any; | ||
onOptionChange?: (data: OptionData) => any; | ||
onInputChange?: (value?: string) => unknown; | ||
onSearchChange?: (value?: string) => unknown; | ||
onOptionChange?: (data: OptionData) => unknown; | ||
onInputBlur?: FocusEventHandler<HTMLInputElement>; | ||
@@ -89,3 +89,3 @@ onInputFocus?: FocusEventHandler<HTMLInputElement>; | ||
renderMultiOptions?: (params: MultiParams) => ReactNode; | ||
onKeyDown?: (e: KeyboardEvent<Element>, input?: string, focusedOption?: FocusedOption) => any; | ||
onKeyDown?: (e: KeyboardEvent<Element>, input?: string, focusedOption?: FocusedOption) => unknown; | ||
}>; | ||
@@ -134,4 +134,4 @@ declare const Select: React.ForwardRefExoticComponent<Readonly<{ | ||
filterIgnoreAccents?: boolean | undefined; | ||
onMenuOpen?: CallbackFunction | undefined; | ||
onMenuClose?: CallbackFunction | undefined; | ||
onMenuOpen?: CallbackFn | undefined; | ||
onMenuClose?: CallbackFn | undefined; | ||
backspaceClearsValue?: boolean | undefined; | ||
@@ -144,6 +144,6 @@ menuPosition?: MenuPositionEnum | undefined; | ||
getOptionValue?: OptionValueCallback | undefined; | ||
onInputChange?: ((value?: string) => any) | undefined; | ||
initialValue?: OptionData | OptionData[]; | ||
onSearchChange?: ((value?: string) => any) | undefined; | ||
onOptionChange?: ((data: OptionData) => any) | undefined; | ||
onInputChange?: ((value?: string) => unknown) | undefined; | ||
onSearchChange?: ((value?: string) => unknown) | undefined; | ||
onOptionChange?: ((data: OptionData) => unknown) | undefined; | ||
onInputBlur?: React.FocusEventHandler<HTMLInputElement> | undefined; | ||
@@ -155,3 +155,3 @@ onInputFocus?: React.FocusEventHandler<HTMLInputElement> | undefined; | ||
renderMultiOptions?: ((params: MultiParams) => ReactNode) | undefined; | ||
onKeyDown?: ((e: KeyboardEvent<Element>, input?: string, focusedOption?: FocusedOption) => any) | undefined; | ||
onKeyDown?: ((e: KeyboardEvent<Element>, input?: string, focusedOption?: FocusedOption) => unknown) | undefined; | ||
}> & React.RefAttributes<Readonly<{ | ||
@@ -158,0 +158,0 @@ empty: boolean; |
import type { SyntheticEvent } from 'react'; | ||
import type { SelectedOption, OptionValueCallback, OptionLabelCallback } from '../types'; | ||
export declare const isBoolean: (val: unknown) => val is Boolean; | ||
export declare const isFunction: (val: unknown) => val is Function; | ||
import type { SelectedOption, OptionValueCallback, OptionLabelCallback, CallbackFn } from '../types'; | ||
export declare const isBoolean: (val: unknown) => val is boolean; | ||
export declare const isFunction: (val: unknown) => val is CallbackFn; | ||
export declare const isArrayWithLength: (val: unknown) => boolean; | ||
@@ -23,3 +23,3 @@ export declare const isPlainObject: (val: unknown) => boolean; | ||
*/ | ||
export declare const normalizeValue: (value: any, getOptionValue: OptionValueCallback, getOptionLabel: OptionLabelCallback) => SelectedOption[]; | ||
export declare const normalizeValue: (value: unknown, getOptionValue: OptionValueCallback, getOptionLabel: OptionLabelCallback) => SelectedOption[]; | ||
/** | ||
@@ -26,0 +26,0 @@ * Immutable implementation of mergeDeep for two objects. Will return the merged result. |
{ | ||
"name": "react-functional-select", | ||
"version": "3.3.4", | ||
"version": "3.3.5", | ||
"description": "Micro-sized and micro-optimized select component for React.js", | ||
@@ -10,3 +10,5 @@ "main": "dist/index.cjs.js", | ||
"files": [ | ||
"dist" | ||
"dist", | ||
"LICENSE", | ||
"README.md" | ||
], | ||
@@ -17,3 +19,3 @@ "sideEffects": false, | ||
"name": "Matt Areddia", | ||
"email": "mareddia@protonmail.com" | ||
"email": "mareddia@proton.me" | ||
}, | ||
@@ -24,6 +26,6 @@ "bugs": { | ||
"repository": { | ||
"url": "https://github.com/based-ghost/react-functional-select.git", | ||
"type": "git" | ||
"type": "git", | ||
"url": "https://github.com/based-ghost/react-functional-select.git" | ||
}, | ||
"homepage": "https://based-ghost.github.io/react-functional-select/", | ||
"homepage": "https://based-ghost.github.io/react-functional-select", | ||
"keywords": [ | ||
@@ -48,46 +50,46 @@ "react", | ||
"last 2 versions", | ||
"not dead", | ||
"not IE 11" | ||
"not dead" | ||
], | ||
"devDependencies": { | ||
"@babel/cli": "^7.18.10", | ||
"@babel/core": "^7.18.13", | ||
"@babel/cli": "^7.19.3", | ||
"@babel/core": "^7.19.3", | ||
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.18.6", | ||
"@babel/plugin-proposal-optional-chaining": "^7.18.9", | ||
"@babel/plugin-transform-runtime": "^7.18.10", | ||
"@babel/preset-env": "^7.18.10", | ||
"@babel/plugin-transform-runtime": "^7.19.1", | ||
"@babel/preset-env": "^7.19.4", | ||
"@babel/preset-react": "^7.18.6", | ||
"@babel/preset-typescript": "^7.18.6", | ||
"@rollup/plugin-babel": "^5.3.1", | ||
"@rollup/plugin-replace": "^4.0.0", | ||
"@rollup/plugin-typescript": "^8.4.0", | ||
"@storybook/addon-storysource": "^6.5.10", | ||
"@storybook/addons": "^6.5.10", | ||
"@storybook/builder-webpack5": "^6.5.10", | ||
"@storybook/manager-webpack5": "^6.5.10", | ||
"@storybook/react": "^6.5.10", | ||
"@storybook/theming": "^6.5.10", | ||
"@rollup/plugin-babel": "^6.0.0", | ||
"@rollup/plugin-replace": "^5.0.0", | ||
"@rollup/plugin-typescript": "^9.0.1", | ||
"@storybook/addon-storysource": "^6.5.12", | ||
"@storybook/addons": "^6.5.12", | ||
"@storybook/builder-webpack5": "^6.5.12", | ||
"@storybook/manager-webpack5": "^6.5.12", | ||
"@storybook/react": "^6.5.12", | ||
"@storybook/theming": "^6.5.12", | ||
"@testing-library/jest-dom": "^5.16.5", | ||
"@testing-library/react": "^13.3.0", | ||
"@testing-library/react": "^13.4.0", | ||
"@testing-library/user-event": "^14.4.3", | ||
"@types/jest": "^28.1.8", | ||
"@types/node": "^18.7.13", | ||
"@types/react": "^18.0.17", | ||
"@types/jest": "^29.1.2", | ||
"@types/node": "^18.8.5", | ||
"@types/react": "^18.0.21", | ||
"@types/react-dom": "^18.0.6", | ||
"@types/react-window": "^1.8.5", | ||
"@types/styled-components": "^5.1.26", | ||
"@typescript-eslint/eslint-plugin": "^5.35.1", | ||
"@typescript-eslint/parser": "^5.35.1", | ||
"babel-jest": "^29.0.0", | ||
"@typescript-eslint/eslint-plugin": "^5.40.0", | ||
"@typescript-eslint/parser": "^5.40.0", | ||
"babel-jest": "^29.1.2", | ||
"babel-loader": "^8.2.5", | ||
"babel-plugin-styled-components": "^2.0.7", | ||
"chromatic": "^6.7.4", | ||
"chromatic": "^6.10.2", | ||
"cross-env": "^7.0.3", | ||
"enzyme": "^3.11.0", | ||
"eslint": "^8.22.0", | ||
"eslint-config-poetez": "^1.0.0", | ||
"eslint": "^8.25.0", | ||
"eslint-config-prettier": "^8.5.0", | ||
"eslint-plugin-prettier": "^4.2.1", | ||
"jest": "^29.0.0", | ||
"jest-environment-jsdom": "^29.0.0", | ||
"eslint-plugin-react": "^7.31.10", | ||
"eslint-plugin-react-hooks": "^4.6.0", | ||
"jest": "^29.1.2", | ||
"jest-environment-jsdom": "^29.1.2", | ||
"jest-enzyme": "^7.1.2", | ||
@@ -102,6 +104,6 @@ "npm-run-all": "^4.1.5", | ||
"rimraf": "^3.0.2", | ||
"rollup": "^2.78.1", | ||
"rollup": "^3.1.0", | ||
"rollup-plugin-terser": "^7.0.2", | ||
"styled-components": "^5.3.5", | ||
"typescript": "^4.8.2", | ||
"styled-components": "^5.3.6", | ||
"typescript": "^4.8.4", | ||
"webpack": "^5.74.0" | ||
@@ -117,3 +119,3 @@ }, | ||
"clean-build": "npm-run-all clean build", | ||
"build": "tsc --outDir dist --declarationDir dist --declaration true && rollup -c", | ||
"build": "tsc --outDir dist --declarationDir dist --declaration true --emitDeclarationOnly true && rollup -c", | ||
"build-watch": "rollup -c -w", | ||
@@ -129,7 +131,7 @@ "clean": "rimraf dist", | ||
"lint": "eslint \"+(.storybook|__stories__|__tests__|config|src)/**/*.{ts,js}\"", | ||
"chromatic": "chromatic --force-rebuild" | ||
"chromatic": "chromatic --force-rebuild --auto-accept-changes" | ||
}, | ||
"dependencies": { | ||
"@babel/runtime": "^7.18.9" | ||
"@babel/runtime": "^7.19.4" | ||
} | ||
} |
@@ -136,3 +136,3 @@ [![NPM](https://img.shields.io/npm/v/react-functional-select.svg?style=flat-square)](https://www.npmjs.com/package/react-functional-select) | ||
|`noOptionsMsg`| string | `No options` | The text displayed in the menu when there are no options available (to hide menu when search returns no items, set to `null` or `''`) | ||
|`loadingMsg`| string | `Loading...` | The text displayed in the menu when `isLoading` === `true` | ||
|`loadingMsg`| string | `Loading..` | The text displayed in the menu when `isLoading` === `true` | ||
|`clearIcon`| ReactNode OR ((state: any) => ReactNode) | `undefined` | Custom clear icon node - `state` forwarded to a function is `{ menuOpen, isLoading, isInvalid, isDisabled }` | ||
@@ -139,0 +139,0 @@ |`caretIcon`| ReactNode OR ((state: any) => ReactNode) | `undefined` | Custom caret icon node - `state` forwarded to a function is `{ menuOpen, isLoading, isInvalid, isDisabled }` |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
120548
55
38
843
1
Updated@babel/runtime@^7.19.4