Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-functional-select

Package Overview
Dependencies
Maintainers
1
Versions
100
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-functional-select - npm Package Compare versions

Comparing version 1.2.3 to 1.2.4

56

dist/index-dev.umd.js

@@ -9,3 +9,3 @@ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react"),require("styled-components"),require("react-window")):"function"==typeof define&&define.amd?define(["exports","react","styled-components","react-window"],t):t((e=e||self).ReactFunctionalSelect={},e.React,e.StyledComponents,e.ReactWindow)}(this,(function(e,t,n,o){"use strict";var r="default"in t?t.default:t,i="default"in n?n.default:n,a=Object.freeze({color:{border:"#ced4da",danger:"#dc3545",primary:"#007bff",disabled:"#e9ecef",placeholder:"#6E7276",dangerLight:"rgba(220, 53, 69, 0.25)"},select:{},loader:{size:"0.625rem",padding:"0.375rem 0.75rem",color:"rgba(0, 123, 255, 0.42)"},icon:{color:"#cccccc",padding:"0.5rem 0.9375rem",hoverColor:"#A6A6A6",clear:{fontWeight:900,fontSize:"0.85em",transition:"color 0.15s ease-in-out",fontFamily:'"Helvetica", "Arial", sans-serif'},caret:{size:"7px",transition:"transform 0.225s ease-in-out, color 0.15s ease-in-out"}},control:{minHeight:"38px",borderWidth:"1px",borderStyle:"solid",borderRadius:"0.25rem",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.15s ease-in-out, border-color 0.15s ease-in-out"},menu:{width:"100%",margin:"0.5rem 0",padding:"0.15rem 0",borderRadius:"0.25rem",backgroundColor:"#fff",boxShadow:"0 0 0 1px rgba(0, 0, 0, 0.1), 0 4px 11px rgba(0, 0, 0, 0.1)",option:{textAlign:"left",selectedColor:"#fff",selectedBgColor:"#007bff",padding:"0.375rem 0.75rem",focusedBgColor:"rgba(0, 123, 255, 0.20)"}},noOptions:{fontSize:"1.25rem",margin:"0.25rem 0",color:"hsl(0, 0%, 60%)",padding:"0.375rem 0.75rem"},multiValue:{margin:"1px 2px",borderRadius:"0.25rem",backgroundColor:"#e7edf3",label:{fontSize:"0.825em",borderRadius:"0.25rem",padding:"1px 2px 1px 6px"},clear:{fontWeight:700,padding:"0 7px",fontSize:"0.675em",alignItems:"center",borderRadius:"0.25rem",transition:"color 0.15s ease-in-out, background-color 0.15s ease-in-out"}}});const l=n.keyframes`

animation: ${l} 0.225s ease-in-out forwards;
`,c=[],d=[],u=Object.freeze({index:-1}),m=/^\s+|\s+$/g,p=/(auto|scroll)/,f=/[\u0300-\u036f]/g,h=/MSIE |Trident\/|Edge\//;function b(e){return e===document.documentElement||e===document.body||e===window}function g(e){return b(e)?window.pageYOffset:e.scrollTop}function v(e,t,n=300,o){let r=0;const i=g(e),a=t-i;window.requestAnimationFrame((function t(){var l,s,c;s=a*((c=(c=r+=5)/n-1)*c*c+1)+i,b(l=e)?window.scrollTo(0,s):l.scrollTop=s,r<n?window.requestAnimationFrame(t):o&&o()}))}function w(e){return Array.isArray(e)&&!!e.length}function $(e){return e&&"object"==typeof e&&!Array.isArray(e)}function x(e,t,n){let o=e.replace(m,"");return t&&(o=o.toLowerCase()),n?function(e){return e.normalize("NFD").replace(f,"")}(o):o}function y(e,t,n,o){if(!n||!e||!e.getBoundingClientRect)return void o();const{top:r,bottom:i,height:a}=e.getBoundingClientRect(),l=window.innerHeight;if(l-r>=a)return void o();const s=function(e){let t=getComputedStyle(e);const n="absolute"===t.position;if("fixed"===t.position)return document.documentElement;for(let o=e;o=o?o.parentElement:null;)if(t=getComputedStyle(o),(!n||"static"!==t.position)&&p.test(`${t.overflow}${t.overflowY}${t.overflowX}`))return o;return document.documentElement}(e),c=g(s),d=s.getBoundingClientRect().height-c-r;d<a?o(d):v(s,i-l+c+parseInt(getComputedStyle(e).marginBottom||"0",10),t,o)}function O(e,t,n){const o=Array.isArray(e)?e.filter(Boolean):"object"==typeof e&&null!==e?[e]:d;return t&&n&&w(o)?o.map(e=>({data:e,value:t(e),label:n(e)})):o}var S,E,C;(S=e.FilterMatchEnum||(e.FilterMatchEnum={})).ANY="any",S.START="start",function(e){e[e.NEXT=0]="NEXT",e[e.PREVIOUS=1]="PREVIOUS"}(E||(E={})),function(e){e[e.UP=0]="UP",e[e.DOWN=1]="DOWN",e[e.FIRST=2]="FIRST",e[e.LAST=3]="LAST"}(C||(C={}));const k=(n,o,r,i,a,l,s,d,u,m,p)=>{const[f,h]=t.useState(c);return t.useEffect(()=>{const t=r===e.FilterMatchEnum.ANY,p=x(o,m,m),f=d||(e=>!!e.isDisabled),b=u||(e=>String(e.label)),g=a.length?a.map(e=>e.value):void 0;h((()=>{const e=e=>{const n=l(e),o=Object.assign({data:e,value:n,label:s(e)},g&&g.includes(n)&&{isSelected:!0});if(!(p&&!(e=>{const n=x(b(e),m,m);return t?n.indexOf(p)>-1:n.substr(0,p.length)===p})(o)||i&&o.isSelected))return Object.assign({},o,{},f(e)&&{isDisabled:!0})};return n.reduce((t,n)=>{const o=e(n);return o&&t.push(o),t},[])})()||c)},[n,a,i,r,m,p,o,u,d,l,s]),f},I=r.memo(({index:e,style:t,data:{menuOptions:n,selectOption:o,renderOptionLabel:i,focusedOptionIndex:a}})=>{const{data:l,value:s,label:c,isDisabled:d,isSelected:u}=n[e],m="rfs-option"+(d?" rfs-option-disabled":"")+(u?" rfs-option-selected":"")+(e===a?" rfs-option-focused":"");return r.createElement("div",{style:t,className:m,onClick:d?void 0:()=>o({data:l,value:s,label:c},u)},i(l))},o.areEqual);I.displayName="Option";const z=i.div`
`,d=[],c=[],u=Object.freeze({index:-1}),m=/^\s+|\s+$/g,p=/(auto|scroll)/,f=/[\u0300-\u036f]/g,h=/MSIE |Trident\/|Edge\//;function b(e){return e===document.documentElement||e===document.body||e===window}function g(e){return b(e)?window.pageYOffset:e.scrollTop}function v(e,t,n=300,o){let r=0;const i=g(e),a=t-i;window.requestAnimationFrame((function t(){var l,s,d;s=a*((d=(d=r+=5)/n-1)*d*d+1)+i,b(l=e)?window.scrollTo(0,s):l.scrollTop=s,r<n?window.requestAnimationFrame(t):o&&o()}))}function w(e){return Array.isArray(e)&&!!e.length}function $(e){return e&&"object"==typeof e&&!Array.isArray(e)}function x(e,t,n){let o=e.replace(m,"");return t&&(o=o.toLowerCase()),n?function(e){return e.normalize("NFD").replace(f,"")}(o):o}function y(e,t,n,o){if(!n||!e||!e.getBoundingClientRect)return void o();const{top:r,bottom:i,height:a}=e.getBoundingClientRect(),l=window.innerHeight;if(l-r>=a)return void o();const s=function(e){let t=getComputedStyle(e);const n="absolute"===t.position;if("fixed"===t.position)return document.documentElement;for(let o=e;o=o?o.parentElement:null;)if(t=getComputedStyle(o),(!n||"static"!==t.position)&&p.test(`${t.overflow}${t.overflowY}${t.overflowX}`))return o;return document.documentElement}(e),d=g(s),c=s.getBoundingClientRect().height-d-r;c<a?o(c):v(s,i-l+d+parseInt(getComputedStyle(e).marginBottom||"0",10),t,o)}function O(e,t,n){const o=Array.isArray(e)?e.filter(Boolean):"object"==typeof e&&null!==e?[e]:c;return t&&n&&w(o)?o.map(e=>({data:e,value:t(e),label:n(e)})):o}var S,E,C;(S=e.FilterMatchEnum||(e.FilterMatchEnum={})).ANY="any",S.START="start",function(e){e[e.NEXT=0]="NEXT",e[e.PREVIOUS=1]="PREVIOUS"}(E||(E={})),function(e){e[e.UP=0]="UP",e[e.DOWN=1]="DOWN",e[e.FIRST=2]="FIRST",e[e.LAST=3]="LAST"}(C||(C={}));const k=(n,o,r,i,a,l,s,c,u,m,p)=>{const[f,h]=t.useState(d);return t.useEffect(()=>{const t=r===e.FilterMatchEnum.ANY,p=x(o,m,m),f=c||(e=>!!e.isDisabled),b=u||(e=>String(e.label)),g=a.length?a.map(e=>e.value):void 0;h((()=>{const e=e=>{const n=l(e),o=Object.assign({data:e,value:n,label:s(e)},g&&g.includes(n)&&{isSelected:!0});if(!(p&&!(e=>{const n=x(b(e),m,m);return t?n.indexOf(p)>-1:n.substr(0,p.length)===p})(o)||i&&o.isSelected))return Object.assign({},o,{},f(e)&&{isDisabled:!0})};return n.reduce((t,n)=>{const o=e(n);return o&&t.push(o),t},[])})()||d)},[n,a,i,r,m,p,o,u,c,l,s]),f},I=r.memo(({index:e,style:t,data:{menuOptions:n,selectOption:o,renderOptionLabel:i,focusedOptionIndex:a}})=>{const{data:l,value:s,label:d,isDisabled:c,isSelected:u}=n[e],m="rfs-option"+(c?" rfs-option-disabled":"")+(u?" rfs-option-selected":"")+(e===a?" rfs-option-focused":"");return r.createElement("div",{style:t,className:m,onClick:c?void 0:()=>o({data:l,value:s,label:d},u)},i(l))},o.areEqual);I.displayName="Option";const z=i.div`
text-align: center;

@@ -16,3 +16,3 @@ color: ${({theme:e})=>e.noOptions.color};

font-size: ${({theme:e})=>e.noOptions.fontSize};
`,M=r.forwardRef(({width:e,itemSize:n,maxHeight:i,menuOptions:a,selectOption:l,noOptionsMsg:s,overscanCount:c,renderOptionLabel:d,focusedOptionIndex:u},m)=>{const p=t.useMemo(()=>({menuOptions:a,selectOption:l,renderOptionLabel:d,focusedOptionIndex:u}),[a,u,l,d]);return r.createElement(t.Fragment,null,r.createElement(o.FixedSizeList,{ref:m,width:e,itemSize:n,itemData:p,overscanCount:c,itemCount:a.length,height:Math.min(i,a.length*n)},I),!w(a)&&r.createElement(z,null,s))});M.displayName="Menu";const R=i.div`
`,M=r.forwardRef(({width:e,itemSize:n,maxHeight:i,menuOptions:a,selectOption:l,noOptionsMsg:s,overscanCount:d,renderOptionLabel:c,focusedOptionIndex:u},m)=>{const p=t.useMemo(()=>({menuOptions:a,selectOption:l,renderOptionLabel:c,focusedOptionIndex:u}),[a,u,l,c]);return r.createElement(t.Fragment,null,r.createElement(o.FixedSizeList,{ref:m,width:e,itemSize:n,itemData:p,overscanCount:d,itemCount:a.length,height:Math.min(i,a.length*n)},I),!w(a)&&r.createElement(z,null,s))});M.displayName="Menu";const N=i.div`
min-width: 0;

@@ -24,3 +24,3 @@ display: flex;

background-color: ${({theme:e})=>e.multiValue.backgroundColor};
`,D=i.div`
`,R=i.div`
overflow: hidden;

@@ -32,3 +32,3 @@ white-space: nowrap;

border-radius: ${({theme:e})=>e.multiValue.label.borderRadius};
`,F=i.div`
`,D=i.div`
display: flex;

@@ -47,3 +47,3 @@ padding: ${({theme:e})=>e.multiValue.clear.padding};

}
`,N=({data:e,value:t,isFocused:n,renderOptionLabel:o,removeSelectedOption:i})=>r.createElement(R,null,r.createElement(D,null,o(e)),r.createElement(F,{"aria-hidden":"true",isFocused:n,onTouchEnd:e=>i(t,e),onMouseDown:e=>i(t,e)},"X")),T=i.div`
`,F=({data:e,value:t,isFocused:n,renderOptionLabel:o,removeSelectedOption:i})=>r.createElement(N,null,r.createElement(R,null,o(e)),r.createElement(D,{"aria-hidden":"true",isFocused:n,onTouchEnd:e=>i(t,e),onMouseDown:e=>i(t,e)},"X")),T=i.div`
overflow: hidden;

@@ -62,3 +62,3 @@ position: absolute;

color: ${({theme:e})=>e.color.placeholder};
`,L=r.memo(({isMulti:e,inputValue:n,placeholder:o,selectedOption:i,focusedMultiValue:a,renderOptionLabel:l,removeSelectedOption:s})=>{if(n&&(!e||e&&!w(i)))return null;if(!w(i))return r.createElement(A,null,o);if(!e){const{data:e}=i[0];return r.createElement(T,null,l(e))}return r.createElement(t.Fragment,null,i.map(({data:e,value:t})=>r.createElement(N,{key:t,data:e,value:t,renderOptionLabel:l,isFocused:t===a,removeSelectedOption:s})))});L.displayName="Value";const V={display:"inline-block"},j=Object.freeze({type:"text",spellCheck:!1,autoCorrect:"off",autoComplete:"off",autoCapitalize:"none","aria-autocomplete":"list","data-testid":"rfs-autosize-input"}),B=i.div`
`,L=r.memo(({isMulti:e,inputValue:n,placeholder:o,selectedOption:i,focusedMultiValue:a,renderOptionLabel:l,removeSelectedOption:s})=>{if(n&&(!e||e&&!w(i)))return null;if(!w(i))return r.createElement(A,null,o);if(!e){const{data:e}=i[0];return r.createElement(T,null,l(e))}return r.createElement(t.Fragment,null,i.map(({data:e,value:t})=>r.createElement(F,{key:t,data:e,value:t,renderOptionLabel:l,isFocused:t===a,removeSelectedOption:s})))});L.displayName="Value";const V={display:"inline-block"},j=Object.freeze({type:"text",spellCheck:!1,autoCorrect:"off",autoComplete:"off",autoCapitalize:"none","aria-autocomplete":"list","data-testid":"rfs-autosize-input"}),B=i.div`
top: 0;

@@ -96,3 +96,3 @@ left: 0;

`}
`,W=r.memo(r.forwardRef(({id:e,onBlur:n,onFocus:o,readOnly:i,onChange:a,ariaLabel:l,inputValue:s,addClassNames:c,ariaLabelledBy:d},u)=>{const m=t.useRef(null),[p,f]=t.useState(2);t.useEffect(()=>{m.current&&f(m.current.scrollWidth+2)},[s]);const h=Object.assign({},j,{"aria-label":l,"aria-labelledby":d,style:{width:p}});return r.createElement("div",{style:V},r.createElement(P,Object.assign({id:e,ref:u,onBlur:n,onFocus:o,value:s,readOnly:i},h,{onChange:i?void 0:a,className:c?"rfs-autosize-input":void 0})),r.createElement(B,{ref:m},s))}));W.displayName="AutosizeInput";const U=n.keyframes`
`,W=r.memo(r.forwardRef(({id:e,onBlur:n,onFocus:o,readOnly:i,onChange:a,ariaLabel:l,inputValue:s,addClassNames:d,ariaLabelledBy:c},u)=>{const m=t.useRef(null),[p,f]=t.useState(2);t.useEffect(()=>{m.current&&f(m.current.scrollWidth+2)},[s]);const h=Object.assign({},j,{"aria-label":l,"aria-labelledby":c,style:{width:p}});return r.createElement("div",{style:V},r.createElement(P,Object.assign({id:e,ref:u,onBlur:n,onFocus:o,value:s,readOnly:i},h,{onChange:i?void 0:a,className:d?"rfs-autosize-input":void 0})),r.createElement(B,{ref:m},s))}));W.displayName="AutosizeInput";const U=n.keyframes`
0%, 80%, 100% {

@@ -154,6 +154,3 @@ transform: scale(0);

${({menuOpen:e,isInvalid:t,theme:{color:o}})=>e&&n.css`
transform: rotate(180deg);
color: ${t?o.danger:o.caretActive||o.primary};
`}
${({menuOpen:e,isInvalid:t,theme:{color:n}})=>e&&`\n transform: rotate(180deg);\n color: ${t?n.danger:n.caretActive||n.primary};\n `}
`,G=i.div`

@@ -165,3 +162,3 @@ width: 1px;

background-color: ${({theme:e})=>e.color.iconSeparator||e.color.border};
`,J=r.memo(({menuOpen:e,clearIcon:t,caretIcon:n,isInvalid:o,showClear:i,isLoading:a,addClassNames:l,onCaretMouseDown:s,onClearMouseDown:c})=>r.createElement(q,null,i&&!a&&r.createElement(Y,{"aria-hidden":"true",onTouchEnd:c,onMouseDown:c,"data-testid":"rfs-clear-icon"},t||r.createElement(K,{className:l?"rfs-clear-icon":void 0},"X")),a&&r.createElement(X,null),r.createElement(G,null),r.createElement(Y,{"aria-hidden":"true",onTouchEnd:s,onMouseDown:s,"data-testid":"rfs-caret-icon"},n||r.createElement(_,{menuOpen:e,isInvalid:o,className:l?"rfs-caret-icon":void 0}))));J.displayName="IndicatorIcons";const Q=i.span`
`,J=r.memo(({menuOpen:e,clearIcon:t,caretIcon:n,isInvalid:o,showClear:i,isLoading:a,loadingNode:l,addClassNames:s,onCaretMouseDown:d,onClearMouseDown:c})=>r.createElement(q,null,i&&!a&&r.createElement(Y,{"aria-hidden":"true",onTouchEnd:c,onMouseDown:c,"data-testid":"rfs-clear-icon"},t||r.createElement(K,{className:s?"rfs-clear-icon":void 0},"X")),a&&(l||r.createElement(X,null)),r.createElement(G,null),r.createElement(Y,{"aria-hidden":"true",onTouchEnd:d,onMouseDown:d,"data-testid":"rfs-caret-icon"},n||r.createElement(_,{menuOpen:e,isInvalid:o,className:s?"rfs-caret-icon":void 0}))));J.displayName="IndicatorIcons";const Q=i.span`
border: 0;

@@ -177,7 +174,7 @@ padding: 0;

clip-path: inset(50%);
`,Z=({menuOpen:e,isFocused:t,ariaLabel:n,inputValue:o,optionCount:i,isSearchable:a,focusedOption:l,selectedOption:s})=>{if(!t)return null;const{label:c,index:d,isDisabled:u}=l,m=`Selected option: ${w(s)?s.map(e=>e.label).join(" "):"N/A"}`,p=`${i} result(s) available${o?` for search input ${o}`:""}.`,f=`Focused option: ${c||"N/A"}${u?" - disabled":""}, ${d+1} of ${i}.`,h=e?"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.":`${n||"Select"} is focused${a?", type to filter options":""}, press Down arrow key to open the menu.`;return r.createElement(Q,{"aria-live":"polite"},r.createElement("p",{id:"aria-selection-event"},m),r.createElement("p",{id:"aria-context"},`${f} ${p} ${h}`))},ee=i.div`
`,Z=({menuOpen:e,isFocused:t,ariaLabel:n,inputValue:o,optionCount:i,isSearchable:a,focusedOption:l,selectedOption:s})=>{if(!t)return null;const{label:d,index:c,isDisabled:u}=l,m=`Selected option: ${w(s)?s.map(e=>e.label).join(" "):"N/A"}`,p=`${i} result(s) available${o?` for search input ${o}`:""}.`,f=`Focused option: ${d||"N/A"}${u?" - disabled":""}, ${c+1} of ${i}.`,h=e?"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.":`${n||"Select"} is focused${a?", type to filter options":""}, press Down arrow key to open the menu.`;return r.createElement(Q,{"aria-live":"polite"},r.createElement("p",{id:"aria-selection-event"},m),r.createElement("p",{id:"aria-context"},`${f} ${p} ${h}`))},ee=i.div`
position: relative;
box-sizing: border-box;
${({theme:e})=>e.color.textColor&&n.css`color: ${e.color.textColor};`}
${({theme:e})=>e.select.fontSize&&n.css`font-size: ${e.select.fontSize};`}
${({theme:e})=>e.color.textColor?`color: ${e.color.textColor};`:""}
${({theme:e})=>e.select.fontSize?`font-size: ${e.select.fontSize};`:""}
`,te=i.div`

@@ -202,16 +199,3 @@ flex: 1 1 0%;

${({isDisabled:e,isFocused:t,isInvalid:o,theme:{control:r,color:i}})=>n.css`
min-height: ${r.minHeight};
transition: ${r.transition};
border-style: ${r.borderStyle};
border-width: ${r.borderWidth};
border-radius: ${r.borderRadius};
border-color: ${o?i.danger:t?r.focusedBorderColor:i.border};
${e&&"pointer-events: none;"}
${r.height&&`height: ${r.height};`}
${(r.backgroundColor||e)&&`background-color: ${e?i.disabled:r.backgroundColor};`}
${t&&`box-shadow: ${r.boxShadow} ${o?i.dangerLight:r.boxShadowColor};`}
`}
${({isDisabled:e,isFocused:t,isInvalid:n,theme:{control:o,color:r}})=>`\n min-height: ${o.minHeight};\n transition: ${o.transition};\n border-style: ${o.borderStyle};\n border-width: ${o.borderWidth};\n border-radius: ${o.borderRadius};\n border-color: ${n?r.danger:t?o.focusedBorderColor:r.border};\n ${e?"pointer-events: none;":""}\n ${o.height?`height: ${o.height};`:""}\n ${o.backgroundColor||e?`background-color: ${e?r.disabled:o.backgroundColor};`:""}\n ${t?`box-shadow: ${o.boxShadow} ${n?r.dangerLight:o.boxShadowColor};`:""}\n `}
`,oe=i.div`

@@ -222,11 +206,3 @@ z-index: 999;

${({hideMenu:e,theme:{menu:t}})=>n.css`
width: ${t.width};
margin: ${t.margin};
padding: ${t.padding};
box-shadow: ${t.boxShadow};
border-radius: ${t.borderRadius};
background-color: ${t.backgroundColor};
${e&&"display: none;"}
`}
${({hideMenu:e,theme:{menu:t}})=>`\n width: ${t.width};\n margin: ${t.margin};\n padding: ${t.padding};\n box-shadow: ${t.boxShadow};\n border-radius: ${t.borderRadius};\n background-color: ${t.backgroundColor};\n ${e?"display: none;":""}\n `}

@@ -247,2 +223,3 @@ .${"rfs-option"} {

}
&.${"rfs-option-selected"} {

@@ -252,2 +229,3 @@ color: ${({theme:e})=>e.menu.option.selectedColor};

}
&.${"rfs-option-disabled"} {

@@ -257,2 +235,2 @@ opacity: 0.35;

}
`,re=r.forwardRef(({isMulti:o,inputId:i,selectId:l,autoFocus:s,isLoading:m,onKeyDown:p,clearIcon:f,caretIcon:h,isInvalid:b,ariaLabel:g,menuWidth:v,isDisabled:x,inputDelay:S,onMenuOpen:I,onMenuClose:z,onInputBlur:R,isClearable:D,themeConfig:F,onInputFocus:N,initialValue:T,addClassNames:A,ariaLabelledBy:V,onOptionChange:j,getOptionLabel:B,getOptionValue:P,openMenuOnFocus:U,isAriaLiveEnabled:H,menuOverscanCount:X,blurInputOnSelect:q,renderOptionLabel:Y,menuScrollDuration:K,filterIgnoreAccents:_,hideSelectedOptions:G,getIsOptionDisabled:Q,getFilterOptionString:re,isSearchable:ie=!0,openMenuOnClick:ae=!0,filterIgnoreCase:le=!0,tabSelectsOption:se=!0,closeMenuOnSelect:ce=!0,scrollMenuIntoView:de=!0,backspaceClearsValue:ue=!0,options:me=c,placeholder:pe="Select option..",filterMatchFrom:fe=e.FilterMatchEnum.ANY,noOptionsMsg:he="No options",menuItemSize:be=35,menuMaxHeight:ge=300},ve)=>{const we=t.useRef(),$e=t.useRef(null),xe=t.useRef(null),ye=t.useRef(null),[Oe,Se]=t.useState(""),[Ee,Ce]=t.useState(!1),[ke,Ie]=t.useState(!1),[ze,Me]=t.useState(u),[Re,De]=t.useState(null),{data:Fe,value:Ne,label:Te,index:Ae,isDisabled:Le,isSelected:Ve}=ze,je=t.useMemo(()=>$(F)?function e(t,n){const o=Object.assign({},t);return Object.keys(n).forEach(r=>{$(n[r])?o[r]=r in t?e(t[r],n[r]):n[r]||"":o[r]=n[r]}),o}(a,F):Object.assign({},a),[F]),Be=t.useMemo(()=>B||(e=>e.label),[B]),Pe=t.useMemo(()=>P||(e=>e.value),[P]),We=t.useMemo(()=>Y||Be,[Y,Be]),Ue=((e,n)=>{const[o,r]=t.useState(e);return t.useEffect(()=>{if(void 0===n)return;const t=setTimeout(()=>{r(e)},n);return()=>{clearTimeout(t)}},[e,n]),void 0===n?e:o})(Oe,S),[He,Xe]=t.useState(()=>O(T,Pe,Be)),qe=((e,n,o,r,i,a,l)=>{const s=t.useRef(!0),c=t.useRef(!1),[d,u]=t.useState(o);return t.useEffect(()=>{if(s.current)s.current=!1;else if(n){const t=e=>{a&&a(),e&&(c.current=!0,u(e))};y(e.current,r,i,t)}else l&&l(),c.current&&(c.current=!1,u(o))},[e,n,l,a,o,i,r]),d})(xe,Ee,ge,K,de,I,z),Ye=k(me,Ue,fe,"boolean"!=typeof G?!!o:G,He,Pe,Be,Q,re,le,_),Ke=()=>{ye.current&&ye.current.blur()},_e=()=>{ye.current&&ye.current.focus()},Ge=e=>{$e.current&&$e.current.scrollToItem(e)};t.useImperativeHandle(ve,()=>({blur:Ke,focus:_e,clearValue:()=>{Xe(d),Me(u)},setValue:e=>{const t=function(e,t,n){if(null==e)return d;const o=[],r=O(e).filter(e=>$(e)).map(e=>n(e)).filter((e,t,n)=>n.indexOf(e)===t);if(!w(r))return d;for(const e of t)if(r.includes(n(e))&&(o.push(e),r.length===o.length))break;return o}(e,Ye,Pe);Xe(t)}}));const Je=t.useCallback((e,t)=>{t&&(t.stopPropagation(),"mousedown"===t.type&&t.preventDefault()),Xe(t=>t.filter(t=>t.value!==e))},[]),Qe=t.useCallback(e=>{if(!w(Ye))return void Ce(!0);const t=o?-1:Ye.findIndex(e=>e.isSelected),n=t>-1?t:e===C.FIRST?0:Ye.length-1;Ce(!0),Me(Object.assign({index:n},Ye[n])),Ge(n)},[o,Ye]),Ze=t.useCallback((e,t)=>{t?o&&Je(e.value):Xe(t=>o?[...t,e]:[e]),("boolean"==typeof q?q:(()=>window.matchMedia("(pointer: coarse)").matches)())?Ke():ce&&(Ce(!1),Se(""))},[o,ce,q,Je]);t.useEffect(()=>{s&&_e()},[s]),t.useEffect(()=>{ke&&U&&Qe(C.FIRST)},[ke,U,Qe]),t.useEffect(()=>{if(j){const e=o?He.map(e=>e.data):w(He)?He[0].data:null;j(e)}},[o,He,j]),t.useEffect(()=>{"number"!=typeof we.current||w(Ye)?(1===Ye.length||Ye.length&&(Ye.length!==me.length||0===we.current))&&(Me(Object.assign({index:0},Ye[0])),Ge(0)):Me(u),we.current=Ye.length},[me,Ye]);const et=()=>{if(!Fe||Le)return;Ze({data:Fe,value:Ne,label:Te},Ve)},tt=e=>{if(!w(He))return;let t=-1;const n=He.length-1,o=Re?He.findIndex(e=>e.value===Re):-1,r=-1===(t=e===E.NEXT?o>-1&&o<n?o+1:-1:0!==o?-1===o?n:o-1:0)?null:He[t].value;Fe&&Me(u),r!==Re&&De(r)},nt=e=>{if(!w(Ye))return;const t=e===C.DOWN?(Ae+1)%Ye.length:Ae>0?Ae-1:Ye.length-1;Re&&De(null),Me(Object.assign({index:t},Ye[t])),Ge(t)},ot=e=>{x||(ke||_e(),Ee?"INPUT"!==e.currentTarget.tagName&&(Ce(!1),Oe&&Se("")):ae&&Qe(C.FIRST),"INPUT"!==e.currentTarget.tagName&&e.preventDefault())},rt=t.useCallback(e=>{R&&R(e),Ie(!1),Ce(!1),Se("")},[R]),it=t.useCallback(e=>{N&&N(e),Ie(!0)},[N]),at=t.useCallback(e=>{Ce(!0),Se(e.currentTarget.value||"")},[]),lt=t.useCallback(e=>{e.stopPropagation(),"mousedown"===e.type&&e.preventDefault(),Xe(d),_e()},[]),st=t.useCallback(e=>{e.stopPropagation(),"mousedown"===e.type&&e.preventDefault(),_e(),Ee?Ce(!1):Qe(C.FIRST)},[Ee,Qe]);return r.createElement(n.ThemeProvider,{theme:je},r.createElement(ee,{id:l,onKeyDown:e=>{if(!(x||p&&(p(e),e.defaultPrevented))){switch(e.key){case"ArrowDown":Ee?nt(C.DOWN):Qe(C.FIRST);break;case"ArrowUp":Ee?nt(C.UP):Qe(C.LAST);break;case"ArrowLeft":if(!o||Oe)return;tt(E.PREVIOUS);break;case"ArrowRight":if(!o||Oe)return;tt(E.NEXT);break;case" ":if(Oe)return;if(!Ee){Qe(C.FIRST);break}if(!Fe)return;et();break;case"Enter":Ee&&229!==e.keyCode&&et();break;case"Escape":Ee&&(Ce(!1),Se(""));break;case"Tab":if(!Ee||!se||!Fe||e.shiftKey)return;et();break;case"Delete":case"Backspace":if(Oe)return;if(Re){const e=He.findIndex(e=>e.value===Re),t=e>-1&&e<He.length-1?He[e+1].value:null;Je(Re),De(t)}else{if(!ue)return;if(w(He))if(o){const{value:e}=He[He.length-1];Je(e)}else D&&Xe(d)}break;default:return}e.preventDefault()}},"data-testid":"rfs-select-container",className:A?"rfs-select-container":void 0},r.createElement(ne,{isInvalid:b,isFocused:ke,isDisabled:x,onTouchEnd:ot,onMouseDown:ot,"data-testid":"rfs-control-container",className:A?"rfs-control-container":void 0},r.createElement(te,null,r.createElement(L,{isMulti:o,inputValue:Oe,placeholder:pe,selectedOption:He,focusedMultiValue:Re,renderOptionLabel:We,removeSelectedOption:Je}),r.createElement(W,{id:i,ref:ye,ariaLabel:g,inputValue:Oe,onBlur:rt,onFocus:it,addClassNames:A,onChange:at,ariaLabelledBy:V,readOnly:x||!ie||!!Re})),r.createElement(J,{menuOpen:Ee,clearIcon:f,caretIcon:h,isInvalid:b,isLoading:m,addClassNames:A,onClearMouseDown:lt,showClear:!(!D||x||!w(He)),onCaretMouseDown:x||ae?void 0:st})),r.createElement(oe,{ref:xe,hideMenu:!Ee,onMouseDown:e=>{e.stopPropagation(),e.preventDefault(),_e()},"data-testid":"rfs-menu-container",className:A?"rfs-menu-container":void 0},r.createElement(M,{ref:$e,maxHeight:qe,itemSize:be,menuOptions:Ye,noOptionsMsg:he,selectOption:Ze,overscanCount:X,width:v||je.menu.width,focusedOptionIndex:Ae,renderOptionLabel:We})),H&&r.createElement(Z,{menuOpen:Ee,isFocused:ke,ariaLabel:g,inputValue:Oe,isSearchable:ie,focusedOption:ze,selectedOption:He,optionCount:Ye.length})))});re.displayName="Select",e.Select=re,Object.defineProperty(e,"__esModule",{value:!0})}));
`,re=r.forwardRef(({isMulti:o,inputId:i,selectId:l,autoFocus:s,isLoading:m,onKeyDown:p,clearIcon:f,caretIcon:h,isInvalid:b,ariaLabel:g,menuWidth:v,isDisabled:x,inputDelay:S,onMenuOpen:I,onMenuClose:z,onInputBlur:N,isClearable:R,themeConfig:D,loadingNode:F,onInputFocus:T,initialValue:A,addClassNames:V,ariaLabelledBy:j,onOptionChange:B,getOptionLabel:P,getOptionValue:U,openMenuOnFocus:H,isAriaLiveEnabled:X,menuOverscanCount:q,blurInputOnSelect:Y,renderOptionLabel:K,menuScrollDuration:_,filterIgnoreAccents:G,hideSelectedOptions:Q,getIsOptionDisabled:re,getFilterOptionString:ie,isSearchable:ae=!0,openMenuOnClick:le=!0,filterIgnoreCase:se=!0,tabSelectsOption:de=!0,closeMenuOnSelect:ce=!0,scrollMenuIntoView:ue=!0,backspaceClearsValue:me=!0,options:pe=d,placeholder:fe="Select option..",filterMatchFrom:he=e.FilterMatchEnum.ANY,noOptionsMsg:be="No options",menuItemSize:ge=35,menuMaxHeight:ve=300},we)=>{const $e=t.useRef(),xe=t.useRef(null),ye=t.useRef(null),Oe=t.useRef(null),[Se,Ee]=t.useState(""),[Ce,ke]=t.useState(!1),[Ie,ze]=t.useState(!1),[Me,Ne]=t.useState(u),[Re,De]=t.useState(null),{data:Fe,value:Te,label:Ae,index:Le,isDisabled:Ve,isSelected:je}=Me,Be=t.useMemo(()=>$(D)?function e(t,n){const o=Object.assign({},t);return Object.keys(n).forEach(r=>{$(n[r])?o[r]=r in t?e(t[r],n[r]):n[r]||"":o[r]=n[r]}),o}(a,D):Object.assign({},a),[D]),Pe=t.useMemo(()=>P||(e=>e.label),[P]),We=t.useMemo(()=>U||(e=>e.value),[U]),Ue=t.useMemo(()=>K||Pe,[K,Pe]),He=((e,n)=>{const[o,r]=t.useState(e);return t.useEffect(()=>{if(void 0===n)return;const t=setTimeout(()=>{r(e)},n);return()=>{clearTimeout(t)}},[e,n]),void 0===n?e:o})(Se,S),[Xe,qe]=t.useState(()=>O(A,We,Pe)),Ye=((e,n,o,r,i,a,l)=>{const s=t.useRef(!0),d=t.useRef(!1),[c,u]=t.useState(o);return t.useEffect(()=>{if(s.current)s.current=!1;else if(n){const t=e=>{a&&a(),e&&(d.current=!0,u(e))};y(e.current,r,i,t)}else l&&l(),d.current&&(d.current=!1,u(o))},[e,n,l,a,o,i,r]),c})(ye,Ce,ve,_,ue,I,z),Ke=k(pe,He,he,"boolean"!=typeof Q?!!o:Q,Xe,We,Pe,re,ie,se,G),_e=()=>{Oe.current&&Oe.current.blur()},Ge=()=>{Oe.current&&Oe.current.focus()},Je=e=>{xe.current&&xe.current.scrollToItem(e)};t.useImperativeHandle(we,()=>({blur:_e,focus:Ge,clearValue:()=>{qe(c),Ne(u)},setValue:e=>{const t=function(e,t,n){if(null==e)return c;const o=[],r=O(e).filter(e=>$(e)).map(e=>n(e)).filter((e,t,n)=>n.indexOf(e)===t);if(!w(r))return c;for(const e of t)if(r.includes(n(e))&&(o.push(e),r.length===o.length))break;return o}(e,Ke,We);qe(t)}}));const Qe=t.useCallback((e,t)=>{t&&(t.stopPropagation(),"mousedown"===t.type&&t.preventDefault()),qe(t=>t.filter(t=>t.value!==e))},[]),Ze=t.useCallback(e=>{if(!w(Ke))return void ke(!0);const t=o?-1:Ke.findIndex(e=>e.isSelected),n=t>-1?t:e===C.FIRST?0:Ke.length-1;ke(!0),Ne(Object.assign({index:n},Ke[n])),Je(n)},[o,Ke]),et=t.useCallback((e,t)=>{t?o&&Qe(e.value):qe(t=>o?[...t,e]:[e]),("boolean"==typeof Y?Y:(()=>window.matchMedia("(pointer: coarse)").matches)())?_e():ce&&(ke(!1),Ee(""))},[o,ce,Y,Qe]);t.useEffect(()=>{s&&Ge()},[s]),t.useEffect(()=>{Ie&&H&&Ze(C.FIRST)},[Ie,H,Ze]),t.useEffect(()=>{if(B){const e=o?Xe.map(e=>e.data):w(Xe)?Xe[0].data:null;B(e)}},[o,Xe,B]),t.useEffect(()=>{"number"!=typeof $e.current||w(Ke)?(1===Ke.length||Ke.length&&(Ke.length!==pe.length||0===$e.current))&&(Ne(Object.assign({index:0},Ke[0])),Je(0)):Ne(u),$e.current=Ke.length},[pe,Ke]);const tt=()=>{if(!Fe||Ve)return;et({data:Fe,value:Te,label:Ae},je)},nt=e=>{if(!w(Xe))return;let t=-1;const n=Xe.length-1,o=Re?Xe.findIndex(e=>e.value===Re):-1,r=-1===(t=e===E.NEXT?o>-1&&o<n?o+1:-1:0!==o?-1===o?n:o-1:0)?null:Xe[t].value;Fe&&Ne(u),r!==Re&&De(r)},ot=e=>{if(!w(Ke))return;const t=e===C.DOWN?(Le+1)%Ke.length:Le>0?Le-1:Ke.length-1;Re&&De(null),Ne(Object.assign({index:t},Ke[t])),Je(t)},rt=e=>{x||(Ie||Ge(),Ce?"INPUT"!==e.currentTarget.tagName&&(ke(!1),Se&&Ee("")):le&&Ze(C.FIRST),"INPUT"!==e.currentTarget.tagName&&e.preventDefault())},it=t.useCallback(e=>{N&&N(e),ze(!1),ke(!1),Ee("")},[N]),at=t.useCallback(e=>{T&&T(e),ze(!0)},[T]),lt=t.useCallback(e=>{ke(!0),Ee(e.currentTarget.value||"")},[]),st=t.useCallback(e=>{e.stopPropagation(),"mousedown"===e.type&&e.preventDefault(),qe(c),Ge()},[]),dt=t.useCallback(e=>{e.stopPropagation(),"mousedown"===e.type&&e.preventDefault(),Ge(),Ce?ke(!1):Ze(C.FIRST)},[Ce,Ze]);return r.createElement(n.ThemeProvider,{theme:Be},r.createElement(ee,{id:l,onKeyDown:e=>{if(!(x||p&&(p(e),e.defaultPrevented))){switch(e.key){case"ArrowDown":Ce?ot(C.DOWN):Ze(C.FIRST);break;case"ArrowUp":Ce?ot(C.UP):Ze(C.LAST);break;case"ArrowLeft":if(!o||Se)return;nt(E.PREVIOUS);break;case"ArrowRight":if(!o||Se)return;nt(E.NEXT);break;case" ":if(Se)return;if(!Ce){Ze(C.FIRST);break}if(!Fe)return;tt();break;case"Enter":Ce&&229!==e.keyCode&&tt();break;case"Escape":Ce&&(ke(!1),Ee(""));break;case"Tab":if(!Ce||!de||!Fe||e.shiftKey)return;tt();break;case"Delete":case"Backspace":if(Se)return;if(Re){const e=Xe.findIndex(e=>e.value===Re),t=e>-1&&e<Xe.length-1?Xe[e+1].value:null;Qe(Re),De(t)}else{if(!me)return;if(w(Xe))if(o){const{value:e}=Xe[Xe.length-1];Qe(e)}else R&&qe(c)}break;default:return}e.preventDefault()}},"data-testid":"rfs-select-container",className:V?"rfs-select-container":void 0},r.createElement(ne,{isInvalid:b,isFocused:Ie,isDisabled:x,onTouchEnd:rt,onMouseDown:rt,"data-testid":"rfs-control-container",className:V?"rfs-control-container":void 0},r.createElement(te,null,r.createElement(L,{isMulti:o,inputValue:Se,placeholder:fe,selectedOption:Xe,focusedMultiValue:Re,renderOptionLabel:Ue,removeSelectedOption:Qe}),r.createElement(W,{id:i,ref:Oe,ariaLabel:g,inputValue:Se,onBlur:it,onFocus:at,addClassNames:V,onChange:lt,ariaLabelledBy:j,readOnly:x||!ae||!!Re})),r.createElement(J,{menuOpen:Ce,clearIcon:f,caretIcon:h,isInvalid:b,isLoading:m,loadingNode:F,addClassNames:V,onClearMouseDown:st,showClear:!(!R||x||!w(Xe)),onCaretMouseDown:x||le?void 0:dt})),r.createElement(oe,{ref:ye,hideMenu:!Ce,onMouseDown:e=>{e.stopPropagation(),e.preventDefault(),Ge()},"data-testid":"rfs-menu-container",className:V?"rfs-menu-container":void 0},r.createElement(M,{ref:xe,maxHeight:Ye,itemSize:ge,menuOptions:Ke,noOptionsMsg:be,selectOption:et,overscanCount:q,width:v||Be.menu.width,focusedOptionIndex:Le,renderOptionLabel:Ue})),X&&r.createElement(Z,{menuOpen:Ce,isFocused:Ie,ariaLabel:g,inputValue:Se,isSearchable:ae,focusedOption:Me,selectedOption:Xe,optionCount:Ke.length})))});re.displayName="Select",e.Select=re,Object.defineProperty(e,"__esModule",{value:!0})}));

@@ -1,2 +0,2 @@

!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react"),require("styled-components"),require("react-window")):"function"==typeof define&&define.amd?define(["exports","react","styled-components","react-window"],t):t((e=e||self).ReactFunctionalSelect={},e.React,e.StyledComponents,e.ReactWindow)}(this,(function(e,t,o,n){"use strict";var r="default"in t?t.default:t,i="default"in o?o.default:o,a=Object.freeze({color:{border:"#ced4da",danger:"#dc3545",primary:"#007bff",disabled:"#e9ecef",placeholder:"#6E7276",dangerLight:"rgba(220, 53, 69, 0.25)"},select:{},loader:{size:"0.625rem",padding:"0.375rem 0.75rem",color:"rgba(0, 123, 255, 0.42)"},icon:{color:"#cccccc",padding:"0.5rem 0.9375rem",hoverColor:"#A6A6A6",clear:{fontWeight:900,fontSize:"0.85em",transition:"color 0.15s ease-in-out",fontFamily:'"Helvetica", "Arial", sans-serif'},caret:{size:"7px",transition:"transform 0.225s ease-in-out, color 0.15s ease-in-out"}},control:{minHeight:"38px",borderWidth:"1px",borderStyle:"solid",borderRadius:"0.25rem",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.15s ease-in-out, border-color 0.15s ease-in-out"},menu:{width:"100%",margin:"0.5rem 0",padding:"0.15rem 0",borderRadius:"0.25rem",backgroundColor:"#fff",boxShadow:"0 0 0 1px rgba(0, 0, 0, 0.1), 0 4px 11px rgba(0, 0, 0, 0.1)",option:{textAlign:"left",selectedColor:"#fff",selectedBgColor:"#007bff",padding:"0.375rem 0.75rem",focusedBgColor:"rgba(0, 123, 255, 0.20)"}},noOptions:{fontSize:"1.25rem",margin:"0.25rem 0",color:"hsl(0, 0%, 60%)",padding:"0.375rem 0.75rem"},multiValue:{margin:"1px 2px",borderRadius:"0.25rem",backgroundColor:"#e7edf3",label:{fontSize:"0.825em",borderRadius:"0.25rem",padding:"1px 2px 1px 6px"},clear:{fontWeight:700,padding:"0 7px",fontSize:"0.675em",alignItems:"center",borderRadius:"0.25rem",transition:"color 0.15s ease-in-out, background-color 0.15s ease-in-out"}}});const l=o.keyframes`
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react"),require("styled-components"),require("react-window")):"function"==typeof define&&define.amd?define(["exports","react","styled-components","react-window"],t):t((e=e||self).ReactFunctionalSelect={},e.React,e.StyledComponents,e.ReactWindow)}(this,(function(e,t,n,o){"use strict";var r="default"in t?t.default:t,i="default"in n?n.default:n,a=Object.freeze({color:{border:"#ced4da",danger:"#dc3545",primary:"#007bff",disabled:"#e9ecef",placeholder:"#6E7276",dangerLight:"rgba(220, 53, 69, 0.25)"},select:{},loader:{size:"0.625rem",padding:"0.375rem 0.75rem",color:"rgba(0, 123, 255, 0.42)"},icon:{color:"#cccccc",padding:"0.5rem 0.9375rem",hoverColor:"#A6A6A6",clear:{fontWeight:900,fontSize:"0.85em",transition:"color 0.15s ease-in-out",fontFamily:'"Helvetica", "Arial", sans-serif'},caret:{size:"7px",transition:"transform 0.225s ease-in-out, color 0.15s ease-in-out"}},control:{minHeight:"38px",borderWidth:"1px",borderStyle:"solid",borderRadius:"0.25rem",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.15s ease-in-out, border-color 0.15s ease-in-out"},menu:{width:"100%",margin:"0.5rem 0",padding:"0.15rem 0",borderRadius:"0.25rem",backgroundColor:"#fff",boxShadow:"0 0 0 1px rgba(0, 0, 0, 0.1), 0 4px 11px rgba(0, 0, 0, 0.1)",option:{textAlign:"left",selectedColor:"#fff",selectedBgColor:"#007bff",padding:"0.375rem 0.75rem",focusedBgColor:"rgba(0, 123, 255, 0.20)"}},noOptions:{fontSize:"1.25rem",margin:"0.25rem 0",color:"hsl(0, 0%, 60%)",padding:"0.375rem 0.75rem"},multiValue:{margin:"1px 2px",borderRadius:"0.25rem",backgroundColor:"#e7edf3",label:{fontSize:"0.825em",borderRadius:"0.25rem",padding:"1px 2px 1px 6px"},clear:{fontWeight:700,padding:"0 7px",fontSize:"0.675em",alignItems:"center",borderRadius:"0.25rem",transition:"color 0.15s ease-in-out, background-color 0.15s ease-in-out"}}});const l=n.keyframes`
from {

@@ -7,5 +7,5 @@ opacity: 0;

}
`,s=o.css`
`,s=n.css`
animation: ${l} 0.225s ease-in-out forwards;
`,d=[],c=[],u=Object.freeze({index:-1}),m=/^\s+|\s+$/g,p=/(auto|scroll)/,f=/[\u0300-\u036f]/g,h=/MSIE |Trident\/|Edge\//;function b(e){return e===document.documentElement||e===document.body||e===window}function g(e){return b(e)?window.pageYOffset:e.scrollTop}function v(e,t,o=300,n){let r=0;const i=g(e),a=t-i;window.requestAnimationFrame((function t(){var l,s,d;s=a*((d=(d=r+=5)/o-1)*d*d+1)+i,b(l=e)?window.scrollTo(0,s):l.scrollTop=s,r<o?window.requestAnimationFrame(t):n&&n()}))}function w(e){return Array.isArray(e)&&!!e.length}function $(e){return e&&"object"==typeof e&&!Array.isArray(e)}function x(e,t,o){let n=e.replace(m,"");return t&&(n=n.toLowerCase()),o?function(e){return e.normalize("NFD").replace(f,"")}(n):n}function y(e,t,o,n){if(!o||!e||!e.getBoundingClientRect)return void n();const{top:r,bottom:i,height:a}=e.getBoundingClientRect(),l=window.innerHeight;if(l-r>=a)return void n();const s=function(e){let t=getComputedStyle(e);const o="absolute"===t.position;if("fixed"===t.position)return document.documentElement;for(let n=e;n=n?n.parentElement:null;)if(t=getComputedStyle(n),(!o||"static"!==t.position)&&p.test(`${t.overflow}${t.overflowY}${t.overflowX}`))return n;return document.documentElement}(e),d=g(s),c=s.getBoundingClientRect().height-d-r;c<a?n(c):v(s,i-l+d+parseInt(getComputedStyle(e).marginBottom||"0",10),t,n)}function O(e,t,o){const n=Array.isArray(e)?e.filter(Boolean):"object"==typeof e&&null!==e?[e]:c;return t&&o&&w(n)?n.map(e=>({data:e,value:t(e),label:o(e)})):n}var S,E,C;(S=e.FilterMatchEnum||(e.FilterMatchEnum={})).ANY="any",S.START="start",function(e){e[e.NEXT=0]="NEXT",e[e.PREVIOUS=1]="PREVIOUS"}(E||(E={})),function(e){e[e.UP=0]="UP",e[e.DOWN=1]="DOWN",e[e.FIRST=2]="FIRST",e[e.LAST=3]="LAST"}(C||(C={}));const k=(o,n,r,i,a,l,s,c,u,m,p)=>{const[f,h]=t.useState(d);return t.useEffect(()=>{const t=r===e.FilterMatchEnum.ANY,p=x(n,m,m),f=c||(e=>!!e.isDisabled),b=u||(e=>String(e.label)),g=a.length?a.map(e=>e.value):void 0;h((()=>{const e=e=>{const o=l(e),n=Object.assign({data:e,value:o,label:s(e)},g&&g.includes(o)&&{isSelected:!0});if(!(p&&!(e=>{const o=x(b(e),m,m);return t?o.indexOf(p)>-1:o.substr(0,p.length)===p})(n)||i&&n.isSelected))return Object.assign({},n,{},f(e)&&{isDisabled:!0})};return o.reduce((t,o)=>{const n=e(o);return n&&t.push(n),t},[])})()||d)},[o,a,i,r,m,p,n,u,c,l,s]),f},I=r.memo(({index:e,style:t,data:{menuOptions:o,selectOption:n,renderOptionLabel:i,focusedOptionIndex:a}})=>{const{data:l,value:s,label:d,isDisabled:c,isSelected:u}=o[e],m="rfs-option"+(c?" rfs-option-disabled":"")+(u?" rfs-option-selected":"")+(e===a?" rfs-option-focused":"");return r.createElement("div",{style:t,className:m,onClick:c?void 0:()=>n({data:l,value:s,label:d},u)},i(l))},n.areEqual);I.displayName="Option";const z=i.div`
`,d=[],c=[],u=Object.freeze({index:-1}),m=/^\s+|\s+$/g,p=/(auto|scroll)/,f=/[\u0300-\u036f]/g,h=/MSIE |Trident\/|Edge\//;function b(e){return e===document.documentElement||e===document.body||e===window}function g(e){return b(e)?window.pageYOffset:e.scrollTop}function v(e,t,n=300,o){let r=0;const i=g(e),a=t-i;window.requestAnimationFrame((function t(){var l,s,d;s=a*((d=(d=r+=5)/n-1)*d*d+1)+i,b(l=e)?window.scrollTo(0,s):l.scrollTop=s,r<n?window.requestAnimationFrame(t):o&&o()}))}function w(e){return Array.isArray(e)&&!!e.length}function $(e){return e&&"object"==typeof e&&!Array.isArray(e)}function x(e,t,n){let o=e.replace(m,"");return t&&(o=o.toLowerCase()),n?function(e){return e.normalize("NFD").replace(f,"")}(o):o}function y(e,t,n,o){if(!n||!e||!e.getBoundingClientRect)return void o();const{top:r,bottom:i,height:a}=e.getBoundingClientRect(),l=window.innerHeight;if(l-r>=a)return void o();const s=function(e){let t=getComputedStyle(e);const n="absolute"===t.position;if("fixed"===t.position)return document.documentElement;for(let o=e;o=o?o.parentElement:null;)if(t=getComputedStyle(o),(!n||"static"!==t.position)&&p.test(`${t.overflow}${t.overflowY}${t.overflowX}`))return o;return document.documentElement}(e),d=g(s),c=s.getBoundingClientRect().height-d-r;c<a?o(c):v(s,i-l+d+parseInt(getComputedStyle(e).marginBottom||"0",10),t,o)}function O(e,t,n){const o=Array.isArray(e)?e.filter(Boolean):"object"==typeof e&&null!==e?[e]:c;return t&&n&&w(o)?o.map(e=>({data:e,value:t(e),label:n(e)})):o}var S,E,C;(S=e.FilterMatchEnum||(e.FilterMatchEnum={})).ANY="any",S.START="start",function(e){e[e.NEXT=0]="NEXT",e[e.PREVIOUS=1]="PREVIOUS"}(E||(E={})),function(e){e[e.UP=0]="UP",e[e.DOWN=1]="DOWN",e[e.FIRST=2]="FIRST",e[e.LAST=3]="LAST"}(C||(C={}));const k=(n,o,r,i,a,l,s,c,u,m,p)=>{const[f,h]=t.useState(d);return t.useEffect(()=>{const t=r===e.FilterMatchEnum.ANY,p=x(o,m,m),f=c||(e=>!!e.isDisabled),b=u||(e=>String(e.label)),g=a.length?a.map(e=>e.value):void 0;h((()=>{const e=e=>{const n=l(e),o=Object.assign({data:e,value:n,label:s(e)},g&&g.includes(n)&&{isSelected:!0});if(!(p&&!(e=>{const n=x(b(e),m,m);return t?n.indexOf(p)>-1:n.substr(0,p.length)===p})(o)||i&&o.isSelected))return Object.assign({},o,{},f(e)&&{isDisabled:!0})};return n.reduce((t,n)=>{const o=e(n);return o&&t.push(o),t},[])})()||d)},[n,a,i,r,m,p,o,u,c,l,s]),f},I=r.memo(({index:e,style:t,data:{menuOptions:n,selectOption:o,renderOptionLabel:i,focusedOptionIndex:a}})=>{const{data:l,value:s,label:d,isDisabled:c,isSelected:u}=n[e],m="rfs-option"+(c?" rfs-option-disabled":"")+(u?" rfs-option-selected":"")+(e===a?" rfs-option-focused":"");return r.createElement("div",{style:t,className:m,onClick:c?void 0:()=>o({data:l,value:s,label:d},u)},i(l))},o.areEqual);I.displayName="Option";const z=i.div`
text-align: center;

@@ -16,3 +16,3 @@ color: ${({theme:e})=>e.noOptions.color};

font-size: ${({theme:e})=>e.noOptions.fontSize};
`,M=r.forwardRef(({width:e,itemSize:o,maxHeight:i,menuOptions:a,selectOption:l,noOptionsMsg:s,overscanCount:d,renderOptionLabel:c,focusedOptionIndex:u},m)=>{const p=t.useMemo(()=>({menuOptions:a,selectOption:l,renderOptionLabel:c,focusedOptionIndex:u}),[a,u,l,c]);return r.createElement(t.Fragment,null,r.createElement(n.FixedSizeList,{ref:m,width:e,itemSize:o,itemData:p,overscanCount:d,itemCount:a.length,height:Math.min(i,a.length*o)},I),!w(a)&&r.createElement(z,null,s))});M.displayName="Menu";const R=i.div`
`,M=r.forwardRef(({width:e,itemSize:n,maxHeight:i,menuOptions:a,selectOption:l,noOptionsMsg:s,overscanCount:d,renderOptionLabel:c,focusedOptionIndex:u},m)=>{const p=t.useMemo(()=>({menuOptions:a,selectOption:l,renderOptionLabel:c,focusedOptionIndex:u}),[a,u,l,c]);return r.createElement(t.Fragment,null,r.createElement(o.FixedSizeList,{ref:m,width:e,itemSize:n,itemData:p,overscanCount:d,itemCount:a.length,height:Math.min(i,a.length*n)},I),!w(a)&&r.createElement(z,null,s))});M.displayName="Menu";const N=i.div`
min-width: 0;

@@ -24,3 +24,3 @@ display: flex;

background-color: ${({theme:e})=>e.multiValue.backgroundColor};
`,D=i.div`
`,R=i.div`
overflow: hidden;

@@ -32,3 +32,3 @@ white-space: nowrap;

border-radius: ${({theme:e})=>e.multiValue.label.borderRadius};
`,F=i.div`
`,D=i.div`
display: flex;

@@ -47,3 +47,3 @@ padding: ${({theme:e})=>e.multiValue.clear.padding};

}
`,N=({data:e,value:t,isFocused:o,renderOptionLabel:n,removeSelectedOption:i})=>r.createElement(R,null,r.createElement(D,null,n(e)),r.createElement(F,{"aria-hidden":"true",isFocused:o,onTouchEnd:e=>i(t,e),onMouseDown:e=>i(t,e)},"X")),T=i.div`
`,F=({data:e,value:t,isFocused:n,renderOptionLabel:o,removeSelectedOption:i})=>r.createElement(N,null,r.createElement(R,null,o(e)),r.createElement(D,{"aria-hidden":"true",isFocused:n,onTouchEnd:e=>i(t,e),onMouseDown:e=>i(t,e)},"X")),T=i.div`
overflow: hidden;

@@ -62,3 +62,3 @@ position: absolute;

color: ${({theme:e})=>e.color.placeholder};
`,L=r.memo(({isMulti:e,inputValue:o,placeholder:n,selectedOption:i,focusedMultiValue:a,renderOptionLabel:l,removeSelectedOption:s})=>{if(o&&(!e||e&&!w(i)))return null;if(!w(i))return r.createElement(A,null,n);if(!e){const{data:e}=i[0];return r.createElement(T,null,l(e))}return r.createElement(t.Fragment,null,i.map(({data:e,value:t})=>r.createElement(N,{key:t,data:e,value:t,renderOptionLabel:l,isFocused:t===a,removeSelectedOption:s})))});L.displayName="Value";const V={display:"inline-block"},j=Object.freeze({type:"text",spellCheck:!1,autoCorrect:"off",autoComplete:"off",autoCapitalize:"none","aria-autocomplete":"list","data-testid":void 0}),B=i.div`
`,L=r.memo(({isMulti:e,inputValue:n,placeholder:o,selectedOption:i,focusedMultiValue:a,renderOptionLabel:l,removeSelectedOption:s})=>{if(n&&(!e||e&&!w(i)))return null;if(!w(i))return r.createElement(A,null,o);if(!e){const{data:e}=i[0];return r.createElement(T,null,l(e))}return r.createElement(t.Fragment,null,i.map(({data:e,value:t})=>r.createElement(F,{key:t,data:e,value:t,renderOptionLabel:l,isFocused:t===a,removeSelectedOption:s})))});L.displayName="Value";const V={display:"inline-block"},j=Object.freeze({type:"text",spellCheck:!1,autoCorrect:"off",autoComplete:"off",autoCapitalize:"none","aria-autocomplete":"list","data-testid":void 0}),B=i.div`
top: 0;

@@ -91,3 +91,3 @@ left: 0;

${()=>(()=>h.test(window.navigator.userAgent))()&&o.css`
${()=>(()=>h.test(window.navigator.userAgent))()&&n.css`
::-ms-clear {

@@ -97,3 +97,3 @@ display: none;

`}
`,W=r.memo(r.forwardRef(({id:e,onBlur:o,onFocus:n,readOnly:i,onChange:a,ariaLabel:l,inputValue:s,addClassNames:d,ariaLabelledBy:c},u)=>{const m=t.useRef(null),[p,f]=t.useState(2);t.useEffect(()=>{m.current&&f(m.current.scrollWidth+2)},[s]);const h=Object.assign({},j,{"aria-label":l,"aria-labelledby":c,style:{width:p}});return r.createElement("div",{style:V},r.createElement(P,Object.assign({id:e,ref:u,onBlur:o,onFocus:n,value:s,readOnly:i},h,{onChange:i?void 0:a,className:d?"rfs-autosize-input":void 0})),r.createElement(B,{ref:m},s))}));W.displayName="AutosizeInput";const U=o.keyframes`
`,W=r.memo(r.forwardRef(({id:e,onBlur:n,onFocus:o,readOnly:i,onChange:a,ariaLabel:l,inputValue:s,addClassNames:d,ariaLabelledBy:c},u)=>{const m=t.useRef(null),[p,f]=t.useState(2);t.useEffect(()=>{m.current&&f(m.current.scrollWidth+2)},[s]);const h=Object.assign({},j,{"aria-label":l,"aria-labelledby":c,style:{width:p}});return r.createElement("div",{style:V},r.createElement(P,Object.assign({id:e,ref:u,onBlur:n,onFocus:o,value:s,readOnly:i},h,{onChange:i?void 0:a,className:d?"rfs-autosize-input":void 0})),r.createElement(B,{ref:m},s))}));W.displayName="AutosizeInput";const U=n.keyframes`
0%, 80%, 100% {

@@ -155,6 +155,3 @@ transform: scale(0);

${({menuOpen:e,isInvalid:t,theme:{color:n}})=>e&&o.css`
transform: rotate(180deg);
color: ${t?n.danger:n.caretActive||n.primary};
`}
${({menuOpen:e,isInvalid:t,theme:{color:n}})=>e&&`\n transform: rotate(180deg);\n color: ${t?n.danger:n.caretActive||n.primary};\n `}
`,G=i.div`

@@ -166,3 +163,3 @@ width: 1px;

background-color: ${({theme:e})=>e.color.iconSeparator||e.color.border};
`,J=r.memo(({menuOpen:e,clearIcon:t,caretIcon:o,isInvalid:n,showClear:i,isLoading:a,addClassNames:l,onCaretMouseDown:s,onClearMouseDown:d})=>r.createElement(q,null,i&&!a&&r.createElement(Y,{"aria-hidden":"true",onTouchEnd:d,onMouseDown:d,"data-testid":void 0},t||r.createElement(K,{className:l?"rfs-clear-icon":void 0},"X")),a&&r.createElement(X,null),r.createElement(G,null),r.createElement(Y,{"aria-hidden":"true",onTouchEnd:s,onMouseDown:s,"data-testid":void 0},o||r.createElement(_,{menuOpen:e,isInvalid:n,className:l?"rfs-caret-icon":void 0}))));J.displayName="IndicatorIcons";const Q=i.span`
`,J=r.memo(({menuOpen:e,clearIcon:t,caretIcon:n,isInvalid:o,showClear:i,isLoading:a,loadingNode:l,addClassNames:s,onCaretMouseDown:d,onClearMouseDown:c})=>r.createElement(q,null,i&&!a&&r.createElement(Y,{"aria-hidden":"true",onTouchEnd:c,onMouseDown:c,"data-testid":void 0},t||r.createElement(K,{className:s?"rfs-clear-icon":void 0},"X")),a&&(l||r.createElement(X,null)),r.createElement(G,null),r.createElement(Y,{"aria-hidden":"true",onTouchEnd:d,onMouseDown:d,"data-testid":void 0},n||r.createElement(_,{menuOpen:e,isInvalid:o,className:s?"rfs-caret-icon":void 0}))));J.displayName="IndicatorIcons";const Q=i.span`
border: 0;

@@ -178,7 +175,7 @@ padding: 0;

clip-path: inset(50%);
`,Z=({menuOpen:e,isFocused:t,ariaLabel:o,inputValue:n,optionCount:i,isSearchable:a,focusedOption:l,selectedOption:s})=>{if(!t)return null;const{label:d,index:c,isDisabled:u}=l,m=`Selected option: ${w(s)?s.map(e=>e.label).join(" "):"N/A"}`,p=`${i} result(s) available${n?` for search input ${n}`:""}.`,f=`Focused option: ${d||"N/A"}${u?" - disabled":""}, ${c+1} of ${i}.`,h=e?"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.":`${o||"Select"} is focused${a?", type to filter options":""}, press Down arrow key to open the menu.`;return r.createElement(Q,{"aria-live":"polite"},r.createElement("p",{id:"aria-selection-event"},m),r.createElement("p",{id:"aria-context"},`${f} ${p} ${h}`))},ee=i.div`
`,Z=({menuOpen:e,isFocused:t,ariaLabel:n,inputValue:o,optionCount:i,isSearchable:a,focusedOption:l,selectedOption:s})=>{if(!t)return null;const{label:d,index:c,isDisabled:u}=l,m=`Selected option: ${w(s)?s.map(e=>e.label).join(" "):"N/A"}`,p=`${i} result(s) available${o?` for search input ${o}`:""}.`,f=`Focused option: ${d||"N/A"}${u?" - disabled":""}, ${c+1} of ${i}.`,h=e?"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.":`${n||"Select"} is focused${a?", type to filter options":""}, press Down arrow key to open the menu.`;return r.createElement(Q,{"aria-live":"polite"},r.createElement("p",{id:"aria-selection-event"},m),r.createElement("p",{id:"aria-context"},`${f} ${p} ${h}`))},ee=i.div`
position: relative;
box-sizing: border-box;
${({theme:e})=>e.color.textColor&&o.css`color: ${e.color.textColor};`}
${({theme:e})=>e.select.fontSize&&o.css`font-size: ${e.select.fontSize};`}
${({theme:e})=>e.color.textColor?`color: ${e.color.textColor};`:""}
${({theme:e})=>e.select.fontSize?`font-size: ${e.select.fontSize};`:""}
`,te=i.div`

@@ -193,3 +190,3 @@ flex: 1 1 0%;

padding: ${({theme:e})=>e.control.padding};
`,oe=i.div`
`,ne=i.div`
outline: 0;

@@ -204,17 +201,4 @@ display: flex;

${({isDisabled:e,isFocused:t,isInvalid:n,theme:{control:r,color:i}})=>o.css`
min-height: ${r.minHeight};
transition: ${r.transition};
border-style: ${r.borderStyle};
border-width: ${r.borderWidth};
border-radius: ${r.borderRadius};
border-color: ${n?i.danger:t?r.focusedBorderColor:i.border};
${e&&"pointer-events: none;"}
${r.height&&`height: ${r.height};`}
${(r.backgroundColor||e)&&`background-color: ${e?i.disabled:r.backgroundColor};`}
${t&&`box-shadow: ${r.boxShadow} ${n?i.dangerLight:r.boxShadowColor};`}
`}
`,ne=i.div`
${({isDisabled:e,isFocused:t,isInvalid:n,theme:{control:o,color:r}})=>`\n min-height: ${o.minHeight};\n transition: ${o.transition};\n border-style: ${o.borderStyle};\n border-width: ${o.borderWidth};\n border-radius: ${o.borderRadius};\n border-color: ${n?r.danger:t?o.focusedBorderColor:r.border};\n ${e?"pointer-events: none;":""}\n ${o.height?`height: ${o.height};`:""}\n ${o.backgroundColor||e?`background-color: ${e?r.disabled:o.backgroundColor};`:""}\n ${t?`box-shadow: ${o.boxShadow} ${n?r.dangerLight:o.boxShadowColor};`:""}\n `}
`,oe=i.div`
z-index: 999;

@@ -224,11 +208,3 @@ position: absolute;

${({hideMenu:e,theme:{menu:t}})=>o.css`
width: ${t.width};
margin: ${t.margin};
padding: ${t.padding};
box-shadow: ${t.boxShadow};
border-radius: ${t.borderRadius};
background-color: ${t.backgroundColor};
${e&&"display: none;"}
`}
${({hideMenu:e,theme:{menu:t}})=>`\n width: ${t.width};\n margin: ${t.margin};\n padding: ${t.padding};\n box-shadow: ${t.boxShadow};\n border-radius: ${t.borderRadius};\n background-color: ${t.backgroundColor};\n ${e?"display: none;":""}\n `}

@@ -249,2 +225,3 @@ .${"rfs-option"} {

}
&.${"rfs-option-selected"} {

@@ -254,2 +231,3 @@ color: ${({theme:e})=>e.menu.option.selectedColor};

}
&.${"rfs-option-disabled"} {

@@ -259,2 +237,2 @@ opacity: 0.35;

}
`,re=r.forwardRef(({isMulti:n,inputId:i,selectId:l,autoFocus:s,isLoading:m,onKeyDown:p,clearIcon:f,caretIcon:h,isInvalid:b,ariaLabel:g,menuWidth:v,isDisabled:x,inputDelay:S,onMenuOpen:I,onMenuClose:z,onInputBlur:R,isClearable:D,themeConfig:F,onInputFocus:N,initialValue:T,addClassNames:A,ariaLabelledBy:V,onOptionChange:j,getOptionLabel:B,getOptionValue:P,openMenuOnFocus:U,isAriaLiveEnabled:H,menuOverscanCount:X,blurInputOnSelect:q,renderOptionLabel:Y,menuScrollDuration:K,filterIgnoreAccents:_,hideSelectedOptions:G,getIsOptionDisabled:Q,getFilterOptionString:re,isSearchable:ie=!0,openMenuOnClick:ae=!0,filterIgnoreCase:le=!0,tabSelectsOption:se=!0,closeMenuOnSelect:de=!0,scrollMenuIntoView:ce=!0,backspaceClearsValue:ue=!0,options:me=d,placeholder:pe="Select option..",filterMatchFrom:fe=e.FilterMatchEnum.ANY,noOptionsMsg:he="No options",menuItemSize:be=35,menuMaxHeight:ge=300},ve)=>{const we=t.useRef(),$e=t.useRef(null),xe=t.useRef(null),ye=t.useRef(null),[Oe,Se]=t.useState(""),[Ee,Ce]=t.useState(!1),[ke,Ie]=t.useState(!1),[ze,Me]=t.useState(u),[Re,De]=t.useState(null),{data:Fe,value:Ne,label:Te,index:Ae,isDisabled:Le,isSelected:Ve}=ze,je=t.useMemo(()=>$(F)?function e(t,o){const n=Object.assign({},t);return Object.keys(o).forEach(r=>{$(o[r])?n[r]=r in t?e(t[r],o[r]):o[r]||"":n[r]=o[r]}),n}(a,F):Object.assign({},a),[F]),Be=t.useMemo(()=>B||(e=>e.label),[B]),Pe=t.useMemo(()=>P||(e=>e.value),[P]),We=t.useMemo(()=>Y||Be,[Y,Be]),Ue=((e,o)=>{const[n,r]=t.useState(e);return t.useEffect(()=>{if(void 0===o)return;const t=setTimeout(()=>{r(e)},o);return()=>{clearTimeout(t)}},[e,o]),void 0===o?e:n})(Oe,S),[He,Xe]=t.useState(()=>O(T,Pe,Be)),qe=((e,o,n,r,i,a,l)=>{const s=t.useRef(!0),d=t.useRef(!1),[c,u]=t.useState(n);return t.useEffect(()=>{if(s.current)s.current=!1;else if(o){const t=e=>{a&&a(),e&&(d.current=!0,u(e))};y(e.current,r,i,t)}else l&&l(),d.current&&(d.current=!1,u(n))},[e,o,l,a,n,i,r]),c})(xe,Ee,ge,K,ce,I,z),Ye=k(me,Ue,fe,"boolean"!=typeof G?!!n:G,He,Pe,Be,Q,re,le,_),Ke=()=>{ye.current&&ye.current.blur()},_e=()=>{ye.current&&ye.current.focus()},Ge=e=>{$e.current&&$e.current.scrollToItem(e)};t.useImperativeHandle(ve,()=>({blur:Ke,focus:_e,clearValue:()=>{Xe(c),Me(u)},setValue:e=>{const t=function(e,t,o){if(null==e)return c;const n=[],r=O(e).filter(e=>$(e)).map(e=>o(e)).filter((e,t,o)=>o.indexOf(e)===t);if(!w(r))return c;for(const e of t)if(r.includes(o(e))&&(n.push(e),r.length===n.length))break;return n}(e,Ye,Pe);Xe(t)}}));const Je=t.useCallback((e,t)=>{t&&(t.stopPropagation(),"mousedown"===t.type&&t.preventDefault()),Xe(t=>t.filter(t=>t.value!==e))},[]),Qe=t.useCallback(e=>{if(!w(Ye))return void Ce(!0);const t=n?-1:Ye.findIndex(e=>e.isSelected),o=t>-1?t:e===C.FIRST?0:Ye.length-1;Ce(!0),Me(Object.assign({index:o},Ye[o])),Ge(o)},[n,Ye]),Ze=t.useCallback((e,t)=>{t?n&&Je(e.value):Xe(t=>n?[...t,e]:[e]),("boolean"==typeof q?q:(()=>window.matchMedia("(pointer: coarse)").matches)())?Ke():de&&(Ce(!1),Se(""))},[n,de,q,Je]);t.useEffect(()=>{s&&_e()},[s]),t.useEffect(()=>{ke&&U&&Qe(C.FIRST)},[ke,U,Qe]),t.useEffect(()=>{if(j){const e=n?He.map(e=>e.data):w(He)?He[0].data:null;j(e)}},[n,He,j]),t.useEffect(()=>{"number"!=typeof we.current||w(Ye)?(1===Ye.length||Ye.length&&(Ye.length!==me.length||0===we.current))&&(Me(Object.assign({index:0},Ye[0])),Ge(0)):Me(u),we.current=Ye.length},[me,Ye]);const et=()=>{if(!Fe||Le)return;Ze({data:Fe,value:Ne,label:Te},Ve)},tt=e=>{if(!w(He))return;let t=-1;const o=He.length-1,n=Re?He.findIndex(e=>e.value===Re):-1,r=-1===(t=e===E.NEXT?n>-1&&n<o?n+1:-1:0!==n?-1===n?o:n-1:0)?null:He[t].value;Fe&&Me(u),r!==Re&&De(r)},ot=e=>{if(!w(Ye))return;const t=e===C.DOWN?(Ae+1)%Ye.length:Ae>0?Ae-1:Ye.length-1;Re&&De(null),Me(Object.assign({index:t},Ye[t])),Ge(t)},nt=e=>{x||(ke||_e(),Ee?"INPUT"!==e.currentTarget.tagName&&(Ce(!1),Oe&&Se("")):ae&&Qe(C.FIRST),"INPUT"!==e.currentTarget.tagName&&e.preventDefault())},rt=t.useCallback(e=>{R&&R(e),Ie(!1),Ce(!1),Se("")},[R]),it=t.useCallback(e=>{N&&N(e),Ie(!0)},[N]),at=t.useCallback(e=>{Ce(!0),Se(e.currentTarget.value||"")},[]),lt=t.useCallback(e=>{e.stopPropagation(),"mousedown"===e.type&&e.preventDefault(),Xe(c),_e()},[]),st=t.useCallback(e=>{e.stopPropagation(),"mousedown"===e.type&&e.preventDefault(),_e(),Ee?Ce(!1):Qe(C.FIRST)},[Ee,Qe]);return r.createElement(o.ThemeProvider,{theme:je},r.createElement(ee,{id:l,onKeyDown:e=>{if(!(x||p&&(p(e),e.defaultPrevented))){switch(e.key){case"ArrowDown":Ee?ot(C.DOWN):Qe(C.FIRST);break;case"ArrowUp":Ee?ot(C.UP):Qe(C.LAST);break;case"ArrowLeft":if(!n||Oe)return;tt(E.PREVIOUS);break;case"ArrowRight":if(!n||Oe)return;tt(E.NEXT);break;case" ":if(Oe)return;if(!Ee){Qe(C.FIRST);break}if(!Fe)return;et();break;case"Enter":Ee&&229!==e.keyCode&&et();break;case"Escape":Ee&&(Ce(!1),Se(""));break;case"Tab":if(!Ee||!se||!Fe||e.shiftKey)return;et();break;case"Delete":case"Backspace":if(Oe)return;if(Re){const e=He.findIndex(e=>e.value===Re),t=e>-1&&e<He.length-1?He[e+1].value:null;Je(Re),De(t)}else{if(!ue)return;if(w(He))if(n){const{value:e}=He[He.length-1];Je(e)}else D&&Xe(c)}break;default:return}e.preventDefault()}},"data-testid":void 0,className:A?"rfs-select-container":void 0},r.createElement(oe,{isInvalid:b,isFocused:ke,isDisabled:x,onTouchEnd:nt,onMouseDown:nt,"data-testid":void 0,className:A?"rfs-control-container":void 0},r.createElement(te,null,r.createElement(L,{isMulti:n,inputValue:Oe,placeholder:pe,selectedOption:He,focusedMultiValue:Re,renderOptionLabel:We,removeSelectedOption:Je}),r.createElement(W,{id:i,ref:ye,ariaLabel:g,inputValue:Oe,onBlur:rt,onFocus:it,addClassNames:A,onChange:at,ariaLabelledBy:V,readOnly:x||!ie||!!Re})),r.createElement(J,{menuOpen:Ee,clearIcon:f,caretIcon:h,isInvalid:b,isLoading:m,addClassNames:A,onClearMouseDown:lt,showClear:!(!D||x||!w(He)),onCaretMouseDown:x||ae?void 0:st})),r.createElement(ne,{ref:xe,hideMenu:!Ee,onMouseDown:e=>{e.stopPropagation(),e.preventDefault(),_e()},"data-testid":void 0,className:A?"rfs-menu-container":void 0},r.createElement(M,{ref:$e,maxHeight:qe,itemSize:be,menuOptions:Ye,noOptionsMsg:he,selectOption:Ze,overscanCount:X,width:v||je.menu.width,focusedOptionIndex:Ae,renderOptionLabel:We})),H&&r.createElement(Z,{menuOpen:Ee,isFocused:ke,ariaLabel:g,inputValue:Oe,isSearchable:ie,focusedOption:ze,selectedOption:He,optionCount:Ye.length})))});re.displayName="Select",e.Select=re,Object.defineProperty(e,"__esModule",{value:!0})}));
`,re=r.forwardRef(({isMulti:o,inputId:i,selectId:l,autoFocus:s,isLoading:m,onKeyDown:p,clearIcon:f,caretIcon:h,isInvalid:b,ariaLabel:g,menuWidth:v,isDisabled:x,inputDelay:S,onMenuOpen:I,onMenuClose:z,onInputBlur:N,isClearable:R,themeConfig:D,loadingNode:F,onInputFocus:T,initialValue:A,addClassNames:V,ariaLabelledBy:j,onOptionChange:B,getOptionLabel:P,getOptionValue:U,openMenuOnFocus:H,isAriaLiveEnabled:X,menuOverscanCount:q,blurInputOnSelect:Y,renderOptionLabel:K,menuScrollDuration:_,filterIgnoreAccents:G,hideSelectedOptions:Q,getIsOptionDisabled:re,getFilterOptionString:ie,isSearchable:ae=!0,openMenuOnClick:le=!0,filterIgnoreCase:se=!0,tabSelectsOption:de=!0,closeMenuOnSelect:ce=!0,scrollMenuIntoView:ue=!0,backspaceClearsValue:me=!0,options:pe=d,placeholder:fe="Select option..",filterMatchFrom:he=e.FilterMatchEnum.ANY,noOptionsMsg:be="No options",menuItemSize:ge=35,menuMaxHeight:ve=300},we)=>{const $e=t.useRef(),xe=t.useRef(null),ye=t.useRef(null),Oe=t.useRef(null),[Se,Ee]=t.useState(""),[Ce,ke]=t.useState(!1),[Ie,ze]=t.useState(!1),[Me,Ne]=t.useState(u),[Re,De]=t.useState(null),{data:Fe,value:Te,label:Ae,index:Le,isDisabled:Ve,isSelected:je}=Me,Be=t.useMemo(()=>$(D)?function e(t,n){const o=Object.assign({},t);return Object.keys(n).forEach(r=>{$(n[r])?o[r]=r in t?e(t[r],n[r]):n[r]||"":o[r]=n[r]}),o}(a,D):Object.assign({},a),[D]),Pe=t.useMemo(()=>P||(e=>e.label),[P]),We=t.useMemo(()=>U||(e=>e.value),[U]),Ue=t.useMemo(()=>K||Pe,[K,Pe]),He=((e,n)=>{const[o,r]=t.useState(e);return t.useEffect(()=>{if(void 0===n)return;const t=setTimeout(()=>{r(e)},n);return()=>{clearTimeout(t)}},[e,n]),void 0===n?e:o})(Se,S),[Xe,qe]=t.useState(()=>O(A,We,Pe)),Ye=((e,n,o,r,i,a,l)=>{const s=t.useRef(!0),d=t.useRef(!1),[c,u]=t.useState(o);return t.useEffect(()=>{if(s.current)s.current=!1;else if(n){const t=e=>{a&&a(),e&&(d.current=!0,u(e))};y(e.current,r,i,t)}else l&&l(),d.current&&(d.current=!1,u(o))},[e,n,l,a,o,i,r]),c})(ye,Ce,ve,_,ue,I,z),Ke=k(pe,He,he,"boolean"!=typeof Q?!!o:Q,Xe,We,Pe,re,ie,se,G),_e=()=>{Oe.current&&Oe.current.blur()},Ge=()=>{Oe.current&&Oe.current.focus()},Je=e=>{xe.current&&xe.current.scrollToItem(e)};t.useImperativeHandle(we,()=>({blur:_e,focus:Ge,clearValue:()=>{qe(c),Ne(u)},setValue:e=>{const t=function(e,t,n){if(null==e)return c;const o=[],r=O(e).filter(e=>$(e)).map(e=>n(e)).filter((e,t,n)=>n.indexOf(e)===t);if(!w(r))return c;for(const e of t)if(r.includes(n(e))&&(o.push(e),r.length===o.length))break;return o}(e,Ke,We);qe(t)}}));const Qe=t.useCallback((e,t)=>{t&&(t.stopPropagation(),"mousedown"===t.type&&t.preventDefault()),qe(t=>t.filter(t=>t.value!==e))},[]),Ze=t.useCallback(e=>{if(!w(Ke))return void ke(!0);const t=o?-1:Ke.findIndex(e=>e.isSelected),n=t>-1?t:e===C.FIRST?0:Ke.length-1;ke(!0),Ne(Object.assign({index:n},Ke[n])),Je(n)},[o,Ke]),et=t.useCallback((e,t)=>{t?o&&Qe(e.value):qe(t=>o?[...t,e]:[e]),("boolean"==typeof Y?Y:(()=>window.matchMedia("(pointer: coarse)").matches)())?_e():ce&&(ke(!1),Ee(""))},[o,ce,Y,Qe]);t.useEffect(()=>{s&&Ge()},[s]),t.useEffect(()=>{Ie&&H&&Ze(C.FIRST)},[Ie,H,Ze]),t.useEffect(()=>{if(B){const e=o?Xe.map(e=>e.data):w(Xe)?Xe[0].data:null;B(e)}},[o,Xe,B]),t.useEffect(()=>{"number"!=typeof $e.current||w(Ke)?(1===Ke.length||Ke.length&&(Ke.length!==pe.length||0===$e.current))&&(Ne(Object.assign({index:0},Ke[0])),Je(0)):Ne(u),$e.current=Ke.length},[pe,Ke]);const tt=()=>{if(!Fe||Ve)return;et({data:Fe,value:Te,label:Ae},je)},nt=e=>{if(!w(Xe))return;let t=-1;const n=Xe.length-1,o=Re?Xe.findIndex(e=>e.value===Re):-1,r=-1===(t=e===E.NEXT?o>-1&&o<n?o+1:-1:0!==o?-1===o?n:o-1:0)?null:Xe[t].value;Fe&&Ne(u),r!==Re&&De(r)},ot=e=>{if(!w(Ke))return;const t=e===C.DOWN?(Le+1)%Ke.length:Le>0?Le-1:Ke.length-1;Re&&De(null),Ne(Object.assign({index:t},Ke[t])),Je(t)},rt=e=>{x||(Ie||Ge(),Ce?"INPUT"!==e.currentTarget.tagName&&(ke(!1),Se&&Ee("")):le&&Ze(C.FIRST),"INPUT"!==e.currentTarget.tagName&&e.preventDefault())},it=t.useCallback(e=>{N&&N(e),ze(!1),ke(!1),Ee("")},[N]),at=t.useCallback(e=>{T&&T(e),ze(!0)},[T]),lt=t.useCallback(e=>{ke(!0),Ee(e.currentTarget.value||"")},[]),st=t.useCallback(e=>{e.stopPropagation(),"mousedown"===e.type&&e.preventDefault(),qe(c),Ge()},[]),dt=t.useCallback(e=>{e.stopPropagation(),"mousedown"===e.type&&e.preventDefault(),Ge(),Ce?ke(!1):Ze(C.FIRST)},[Ce,Ze]);return r.createElement(n.ThemeProvider,{theme:Be},r.createElement(ee,{id:l,onKeyDown:e=>{if(!(x||p&&(p(e),e.defaultPrevented))){switch(e.key){case"ArrowDown":Ce?ot(C.DOWN):Ze(C.FIRST);break;case"ArrowUp":Ce?ot(C.UP):Ze(C.LAST);break;case"ArrowLeft":if(!o||Se)return;nt(E.PREVIOUS);break;case"ArrowRight":if(!o||Se)return;nt(E.NEXT);break;case" ":if(Se)return;if(!Ce){Ze(C.FIRST);break}if(!Fe)return;tt();break;case"Enter":Ce&&229!==e.keyCode&&tt();break;case"Escape":Ce&&(ke(!1),Ee(""));break;case"Tab":if(!Ce||!de||!Fe||e.shiftKey)return;tt();break;case"Delete":case"Backspace":if(Se)return;if(Re){const e=Xe.findIndex(e=>e.value===Re),t=e>-1&&e<Xe.length-1?Xe[e+1].value:null;Qe(Re),De(t)}else{if(!me)return;if(w(Xe))if(o){const{value:e}=Xe[Xe.length-1];Qe(e)}else R&&qe(c)}break;default:return}e.preventDefault()}},"data-testid":void 0,className:V?"rfs-select-container":void 0},r.createElement(ne,{isInvalid:b,isFocused:Ie,isDisabled:x,onTouchEnd:rt,onMouseDown:rt,"data-testid":void 0,className:V?"rfs-control-container":void 0},r.createElement(te,null,r.createElement(L,{isMulti:o,inputValue:Se,placeholder:fe,selectedOption:Xe,focusedMultiValue:Re,renderOptionLabel:Ue,removeSelectedOption:Qe}),r.createElement(W,{id:i,ref:Oe,ariaLabel:g,inputValue:Se,onBlur:it,onFocus:at,addClassNames:V,onChange:lt,ariaLabelledBy:j,readOnly:x||!ae||!!Re})),r.createElement(J,{menuOpen:Ce,clearIcon:f,caretIcon:h,isInvalid:b,isLoading:m,loadingNode:F,addClassNames:V,onClearMouseDown:st,showClear:!(!R||x||!w(Xe)),onCaretMouseDown:x||le?void 0:dt})),r.createElement(oe,{ref:ye,hideMenu:!Ce,onMouseDown:e=>{e.stopPropagation(),e.preventDefault(),Ge()},"data-testid":void 0,className:V?"rfs-menu-container":void 0},r.createElement(M,{ref:xe,maxHeight:Ye,itemSize:ge,menuOptions:Ke,noOptionsMsg:be,selectOption:et,overscanCount:q,width:v||Be.menu.width,focusedOptionIndex:Le,renderOptionLabel:Ue})),X&&r.createElement(Z,{menuOpen:Ce,isFocused:Ie,ariaLabel:g,inputValue:Se,isSearchable:ae,focusedOption:Me,selectedOption:Xe,optionCount:Ke.length})))});re.displayName="Select",e.Select=re,Object.defineProperty(e,"__esModule",{value:!0})}));

@@ -828,3 +828,3 @@ 'use strict';

}
}) => menuOpen && styled.css`
}) => menuOpen && `
transform: rotate(180deg);

@@ -850,2 +850,3 @@ color: ${isInvalid ? color.danger : color.caretActive || color.primary};

isLoading,
loadingNode,
addClassNames,

@@ -861,3 +862,3 @@ onCaretMouseDown,

className: addClassNames ? CLEAR_ICON_CLS : undefined
}, "X")), isLoading && React__default.createElement(LoadingDots, null), React__default.createElement(Separator, null), React__default.createElement(IndicatorIcon, {
}, "X")), isLoading && (loadingNode || React__default.createElement(LoadingDots, null)), React__default.createElement(Separator, null), React__default.createElement(IndicatorIcon, {
"aria-hidden": 'true',

@@ -925,6 +926,6 @@ onTouchEnd: onCaretMouseDown,

theme
}) => theme.color.textColor && styled.css`color: ${theme.color.textColor};`}
}) => theme.color.textColor ? `color: ${theme.color.textColor};` : ''}
${({
theme
}) => theme.select.fontSize && styled.css`font-size: ${theme.select.fontSize};`}
}) => theme.select.fontSize ? `font-size: ${theme.select.fontSize};` : ''}
`;

@@ -961,3 +962,3 @@ const ValueWrapper = styled__default.div`

}
}) => styled.css`
}) => `
min-height: ${control.minHeight};

@@ -968,9 +969,7 @@ transition: ${control.transition};

border-radius: ${control.borderRadius};
border-color: ${isInvalid ? color.danger : isFocused ? control.focusedBorderColor : color.border};
${isDisabled && 'pointer-events: none;'}
${control.height && `height: ${control.height};`}
${(control.backgroundColor || isDisabled) && `background-color: ${isDisabled ? color.disabled : control.backgroundColor};`}
${isFocused && `box-shadow: ${control.boxShadow} ${isInvalid ? color.dangerLight : control.boxShadowColor};`}
${isDisabled ? 'pointer-events: none;' : ''}
${control.height ? `height: ${control.height};` : ''}
${control.backgroundColor || isDisabled ? `background-color: ${isDisabled ? color.disabled : control.backgroundColor};` : ''}
${isFocused ? `box-shadow: ${control.boxShadow} ${isInvalid ? color.dangerLight : control.boxShadowColor};` : ''}
`}

@@ -988,3 +987,3 @@ `;

}
}) => styled.css`
}) => `
width: ${menu.width};

@@ -996,3 +995,3 @@ margin: ${menu.margin};

background-color: ${menu.backgroundColor};
${hideMenu && 'display: none;'}
${hideMenu ? 'display: none;' : ''}
`}

@@ -1020,2 +1019,3 @@

}
&.${OPTION_SELECTED_CLS} {

@@ -1029,2 +1029,3 @@ color: ${({

}
&.${OPTION_DISABLED_CLS} {

@@ -1054,2 +1055,3 @@ opacity: 0.35;

themeConfig,
loadingNode,
onInputFocus,

@@ -1475,2 +1477,3 @@ initialValue,

isLoading: isLoading,
loadingNode: loadingNode,
addClassNames: addClassNames,

@@ -1477,0 +1480,0 @@ onClearMouseDown: handleOnClearMouseDown,

@@ -822,3 +822,3 @@ import React, { useState, useEffect, useRef, useMemo, Fragment, useImperativeHandle, useCallback } from 'react';

}
}) => menuOpen && css`
}) => menuOpen && `
transform: rotate(180deg);

@@ -844,2 +844,3 @@ color: ${isInvalid ? color.danger : color.caretActive || color.primary};

isLoading,
loadingNode,
addClassNames,

@@ -855,3 +856,3 @@ onCaretMouseDown,

className: addClassNames ? CLEAR_ICON_CLS : undefined
}, "X")), isLoading && React.createElement(LoadingDots, null), React.createElement(Separator, null), React.createElement(IndicatorIcon, {
}, "X")), isLoading && (loadingNode || React.createElement(LoadingDots, null)), React.createElement(Separator, null), React.createElement(IndicatorIcon, {
"aria-hidden": 'true',

@@ -919,6 +920,6 @@ onTouchEnd: onCaretMouseDown,

theme
}) => theme.color.textColor && css`color: ${theme.color.textColor};`}
}) => theme.color.textColor ? `color: ${theme.color.textColor};` : ''}
${({
theme
}) => theme.select.fontSize && css`font-size: ${theme.select.fontSize};`}
}) => theme.select.fontSize ? `font-size: ${theme.select.fontSize};` : ''}
`;

@@ -955,3 +956,3 @@ const ValueWrapper = styled.div`

}
}) => css`
}) => `
min-height: ${control.minHeight};

@@ -962,9 +963,7 @@ transition: ${control.transition};

border-radius: ${control.borderRadius};
border-color: ${isInvalid ? color.danger : isFocused ? control.focusedBorderColor : color.border};
${isDisabled && 'pointer-events: none;'}
${control.height && `height: ${control.height};`}
${(control.backgroundColor || isDisabled) && `background-color: ${isDisabled ? color.disabled : control.backgroundColor};`}
${isFocused && `box-shadow: ${control.boxShadow} ${isInvalid ? color.dangerLight : control.boxShadowColor};`}
${isDisabled ? 'pointer-events: none;' : ''}
${control.height ? `height: ${control.height};` : ''}
${control.backgroundColor || isDisabled ? `background-color: ${isDisabled ? color.disabled : control.backgroundColor};` : ''}
${isFocused ? `box-shadow: ${control.boxShadow} ${isInvalid ? color.dangerLight : control.boxShadowColor};` : ''}
`}

@@ -982,3 +981,3 @@ `;

}
}) => css`
}) => `
width: ${menu.width};

@@ -990,3 +989,3 @@ margin: ${menu.margin};

background-color: ${menu.backgroundColor};
${hideMenu && 'display: none;'}
${hideMenu ? 'display: none;' : ''}
`}

@@ -1014,2 +1013,3 @@

}
&.${OPTION_SELECTED_CLS} {

@@ -1023,2 +1023,3 @@ color: ${({

}
&.${OPTION_DISABLED_CLS} {

@@ -1048,2 +1049,3 @@ opacity: 0.35;

themeConfig,
loadingNode,
onInputFocus,

@@ -1469,2 +1471,3 @@ initialValue,

isLoading: isLoading,
loadingNode: loadingNode,
addClassNames: addClassNames,

@@ -1471,0 +1474,0 @@ onClearMouseDown: handleOnClearMouseDown,

@@ -39,2 +39,3 @@ import React, { KeyboardEventHandler, FocusEventHandler, ReactNode, ReactText } from 'react';

readonly menuMaxHeight?: number;
readonly loadingNode?: ReactNode;
readonly addClassNames?: boolean;

@@ -41,0 +42,0 @@ readonly ariaLabelledBy?: string;

{
"name": "react-functional-select",
"version": "1.2.3",
"version": "1.2.4",
"author": "Matt Areddia <mareddia@protonmail.com> (https://github.com/based-ghost/)",

@@ -99,3 +99,4 @@ "description": "Miro-sized and micro-optimized select component for React.js",

"typescript": "^3.7.4",
"webpack": "^4.41.4"
"webpack": "^4.41.4",
"webpack-merge": "^4.2.2"
},

@@ -102,0 +103,0 @@ "peerDependencies": {

@@ -119,4 +119,5 @@ # react-functional-select

|`noOptionsMsg`| string | `No options` | The text displayed in the menu when there are no options available
|`clearIcon`| React.ReactNode | `undefined` | Custom clear icon
|`caretIcon`| React.ReactNode | `undefined` | Custom caret icon
|`clearIcon`| React.ReactNode | `undefined` | Custom clear icon node
|`caretIcon`| React.ReactNode | `undefined` | Custom caret icon node
|`loadingNode`| React.ReactNode | `undefined` | Custom loading node
|`options`| array | `[]` | The menu options

@@ -123,0 +124,0 @@ |`isSearchable`| bool | `true` | Whether to enable search functionality or not

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc