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.2 to 1.2.3

42

dist/index-dev.umd.js

@@ -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;
`,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,o=300,n){let r=0;const i=g(e),a=t-i;window.requestAnimationFrame((function t(){var l,s,c;s=a*((c=(c=r+=5)/o-1)*c*c+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),c=g(s),d=s.getBoundingClientRect().height-c-r;d<a?n(d):v(s,i-l+c+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]:d;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,d,u,m,p)=>{const[f,h]=t.useState(c);return t.useEffect(()=>{const t=r===e.FilterMatchEnum.ANY,p=x(n,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 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},[])})()||c)},[o,a,i,r,m,p,n,u,d,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:c,isDisabled:d,isSelected:u}=o[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:()=>n({data:l,value:s,label:c},u)},i(l))},n.areEqual);I.displayName="Option";const z=i.div`
`,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`
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: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(n.FixedSizeList,{ref:m,width:e,itemSize:o,itemData:p,overscanCount:c,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: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`
min-width: 0;

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

}
`,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`
`,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`
overflow: hidden;

@@ -60,3 +60,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})=>o&&(!e||e&&!w(i))?null:w(i)?e?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}))):r.createElement(T,null,l(i[0].data)):r.createElement(A,null,n));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(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`
top: 0;

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

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

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

`}
`,W=r.memo(r.forwardRef(({id:e,onBlur:o,onFocus:n,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:o,onFocus:n,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=o.keyframes`
`,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`
0%, 80%, 100% {

@@ -153,5 +153,5 @@ transform: scale(0);

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

@@ -164,3 +164,3 @@ `,G=i.div`

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: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"},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,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`
border: 0;

@@ -176,7 +176,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:c,index:d,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: ${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.":`${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: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`
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&&n.css`color: ${e.color.textColor};`}
${({theme:e})=>e.select.fontSize&&n.css`font-size: ${e.select.fontSize};`}
`,te=i.div`

@@ -191,3 +191,3 @@ flex: 1 1 0%;

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

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

${({isDisabled:e,isFocused:t,isInvalid:n,theme:{control:r,color:i}})=>o.css`
${({isDisabled:e,isFocused:t,isInvalid:o,theme:{control:r,color:i}})=>n.css`
min-height: ${r.minHeight};

@@ -210,3 +210,3 @@ transition: ${r.transition};

border-color: ${n?i.danger:t?r.focusedBorderColor:i.border};
border-color: ${o?i.danger:t?r.focusedBorderColor:i.border};

@@ -216,5 +216,5 @@ ${e&&"pointer-events: none;"}

${(r.backgroundColor||e)&&`background-color: ${e?i.disabled:r.backgroundColor};`}
${t&&`box-shadow: ${r.boxShadow} ${n?i.dangerLight:r.boxShadowColor};`}
${t&&`box-shadow: ${r.boxShadow} ${o?i.dangerLight:r.boxShadowColor};`}
`}
`,ne=i.div`
`,oe=i.div`
z-index: 999;

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

${({hideMenu:e,theme:{menu:t}})=>o.css`
${({hideMenu:e,theme:{menu:t}})=>n.css`
width: ${t.width};

@@ -257,2 +257,2 @@ margin: ${t.margin};

}
`,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: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,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),c=t.useRef(!1),[d,u]=t.useState(n);return t.useEffect(()=>{if(s.current)s.current=!1;else if(o){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(n))},[e,o,l,a,n,i,r]),d})(xe,Ee,ge,K,de,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(d),Me(u)},setValue:e=>{const t=function(e,t,o){if(null==e)return d;const n=[],r=O(e).filter(e=>$(e)).map(e=>o(e)).filter((e,t,o)=>o.indexOf(e)===t);if(!w(r))return d;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():ce&&(Ce(!1),Se(""))},[n,ce,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(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(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(d)}break;default:return}e.preventDefault()}},"data-testid":"rfs-select-container",className:A?"rfs-select-container":void 0},r.createElement(oe,{isInvalid:b,isFocused:ke,isDisabled:x,onTouchEnd:nt,onMouseDown:nt,"data-testid":"rfs-control-container",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":"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: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})}));

@@ -57,3 +57,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,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`

color: ${({theme:e})=>e.color.placeholder};
`,L=r.memo(({isMulti:e,inputValue:o,placeholder:n,selectedOption:i,focusedMultiValue:a,renderOptionLabel:l,removeSelectedOption:s})=>o&&(!e||e&&!w(i))?null:w(i)?e?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}))):r.createElement(T,null,l(i[0].data)):r.createElement(A,null,n));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: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`
top: 0;

@@ -60,0 +60,0 @@ left: 0;

@@ -614,3 +614,6 @@ 'use strict';

if (!isMulti) {
return React__default.createElement(SingleValue, null, renderOptionLabel(selectedOption[0].data));
const {
data
} = selectedOption[0];
return React__default.createElement(SingleValue, null, renderOptionLabel(data));
}

@@ -645,3 +648,3 @@

});
const StyledSizer = styled__default.div`
const SizerDiv = styled__default.div`
top: 0;

@@ -658,3 +661,3 @@ left: 0;

`;
const StyledAutosizeInput = styled__default.input`
const Input = styled__default.input`
border: 0;

@@ -709,3 +712,3 @@ outline: 0;

style: WRAPPER_DIV_STYLE
}, React__default.createElement(StyledAutosizeInput, Object.assign({
}, React__default.createElement(Input, Object.assign({
id: id,

@@ -720,3 +723,3 @@ ref: ref,

className: addClassNames ? AUTOSIZE_INPUT_CLS : undefined
})), React__default.createElement(StyledSizer, {
})), React__default.createElement(SizerDiv, {
ref: sizerRef

@@ -723,0 +726,0 @@ }, inputValue));

import * as SelectModule from './Select';
export declare type Theme = SelectModule.Theme;
export declare type SelectRef = SelectModule.SelectRef;
export declare type MenuOption = SelectModule.MenuOption;
export declare type SelectProps = SelectModule.SelectProps;
export { default as Select } from './Select';
export { FilterMatchEnum } from './constants/enums';

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

if (!isMulti) {
return React.createElement(SingleValue, null, renderOptionLabel(selectedOption[0].data));
const {
data
} = selectedOption[0];
return React.createElement(SingleValue, null, renderOptionLabel(data));
}

@@ -639,3 +642,3 @@

});
const StyledSizer = styled.div`
const SizerDiv = styled.div`
top: 0;

@@ -652,3 +655,3 @@ left: 0;

`;
const StyledAutosizeInput = styled.input`
const Input = styled.input`
border: 0;

@@ -703,3 +706,3 @@ outline: 0;

style: WRAPPER_DIV_STYLE
}, React.createElement(StyledAutosizeInput, Object.assign({
}, React.createElement(Input, Object.assign({
id: id,

@@ -714,3 +717,3 @@ ref: ref,

className: addClassNames ? AUTOSIZE_INPUT_CLS : undefined
})), React.createElement(StyledSizer, {
})), React.createElement(SizerDiv, {
ref: sizerRef

@@ -717,0 +720,0 @@ }, inputValue));

import React, { KeyboardEventHandler, FocusEventHandler, ReactNode, ReactText } from 'react';
import { DefaultTheme } from 'styled-components';
declare type OptionData = any;
declare type MenuOption = {
export declare type Theme = Partial<DefaultTheme>;
export declare type MenuOption = {
readonly label: ReactText;

@@ -11,3 +12,2 @@ readonly value: ReactText;

};
export declare type Theme = Partial<DefaultTheme>;
export declare type SelectRef = {

@@ -14,0 +14,0 @@ readonly blur: () => void;

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

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

"tslint-config-prettier": "^1.18.0",
"tslint-plugin-prettier": "^2.0.1",
"tslint-plugin-prettier": "^2.1.0",
"typescript": "^3.7.4",

@@ -100,0 +100,0 @@ "webpack": "^4.41.4"

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