@onewelcome/react-lib-components 6.4.1 → 6.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:true});var e=require("react");var r=require("../Input/Input.cjs.js");function o(e){return e&&typeof e==="object"&&"default"in e?e:{default:e}}var s=o(e);const l=({search:o,optionsCount:l,searchPlaceholder:n,searchInputProps:t,searchInputClassName:u,expanded:a,setFocusedSelectItem:d})=>{var i,c;const[v,p]=e.useState("");const[h,f]=e.useState(false);const I=10;const P=e.useRef(null);const m=(i=o===null||o===void 0?void 0:o.renderThreshold)!==null&&i!==void 0?i:I;const S=l
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:true});var e=require("react");var r=require("../Input/Input.cjs.js");function o(e){return e&&typeof e==="object"&&"default"in e?e:{default:e}}var s=o(e);const l=({search:o,optionsCount:l,searchPlaceholder:n,searchInputProps:t,searchInputClassName:u,expanded:a,setFocusedSelectItem:d})=>{var i,c;const[v,p]=e.useState("");const[h,f]=e.useState(false);const I=10;const P=e.useRef(null);const m=(i=o===null||o===void 0?void 0:o.renderThreshold)!==null&&i!==void 0?i:I;const S=l>=m;const b=e=>{p(e.currentTarget.value)};const y=()=>{if(o===null||o===void 0?void 0:o.enabled)return S;if(o)return o.enabled;return l>I};const N=()=>{var e,l,d,i,c,v,p;return s["default"].createElement(r.Input,{...(l=(e=o===null||o===void 0?void 0:o.searchInputProps)!==null&&e!==void 0?e:t)!==null&&l!==void 0?l:{},ref:P,onFocus:()=>f(true),onBlur:()=>f(false),onChange:b,className:u,wrapperProps:{className:(c=(i=(d=o===null||o===void 0?void 0:o.searchInputProps)===null||d===void 0?void 0:d.wrapperProps)===null||i===void 0?void 0:i.className)!==null&&c!==void 0?c:(v=t===null||t===void 0?void 0:t.wrapperProps)===null||v===void 0?void 0:v.className},style:{display:a?"block":"none"},type:"text",name:"search-option",placeholder:(p=o===null||o===void 0?void 0:o.searchPlaceholder)!==null&&p!==void 0?p:n})};const g=()=>{p("");f(false);d(-1)};const j=y();e.useEffect((()=>{var e;(((e=o===null||o===void 0?void 0:o.searchInputProps)===null||e===void 0?void 0:e.reset)||(t===null||t===void 0?void 0:t.reset))&&g()}),[t===null||t===void 0?void 0:t.reset,(c=o===null||o===void 0?void 0:o.searchInputProps)===null||c===void 0?void 0:c.reset]);e.useEffect((()=>{const e=!j&&!h;if(e)g()}),[h,j]);return{renderSearch:N,setIsSearching:f,searchVisible:j,searchThreshold:m,searchInputRef:P,filter:v,isSearching:h}};exports.useSearch=l;
|
|
2
2
|
//# sourceMappingURL=useSearch.cjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSearch.cjs.js","sources":["../../../../../../src/components/Form/Select/useSearch.tsx"],"sourcesContent":["/*\n * Copyright 2022 OneWelcome B.V.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React, { useEffect, useRef, useState } from \"react\";\nimport { PartialInputProps, SearchProps } from \"./Select.interfaces\";\nimport { Input } from \"../Input/Input\";\n\ninterface Props {\n search?: SearchProps;\n optionsCount: number;\n /**\n * @deprecated\n */\n searchPlaceholder?: string;\n /**\n * @deprecated\n */\n searchInputProps?: PartialInputProps & { reset?: boolean };\n searchInputClassName: string;\n expanded: boolean;\n setFocusedSelectItem: (idx: number) => void;\n}\n\nexport const useSearch = ({\n search,\n optionsCount,\n searchPlaceholder,\n searchInputProps,\n searchInputClassName,\n expanded,\n setFocusedSelectItem\n}: Props) => {\n const [filter, setFilter] = useState(\"\");\n const [isSearching, setIsSearching] = useState(false);\n\n const DEFAULT_RENDER_THRESHOLD = 10;\n\n const searchInputRef = useRef<HTMLInputElement>(null);\n\n const threshold = search?.renderThreshold ?? DEFAULT_RENDER_THRESHOLD;\n const hasEnoughChildren = optionsCount
|
|
1
|
+
{"version":3,"file":"useSearch.cjs.js","sources":["../../../../../../src/components/Form/Select/useSearch.tsx"],"sourcesContent":["/*\n * Copyright 2022 OneWelcome B.V.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React, { useEffect, useRef, useState } from \"react\";\nimport { PartialInputProps, SearchProps } from \"./Select.interfaces\";\nimport { Input } from \"../Input/Input\";\n\ninterface Props {\n search?: SearchProps;\n optionsCount: number;\n /**\n * @deprecated\n */\n searchPlaceholder?: string;\n /**\n * @deprecated\n */\n searchInputProps?: PartialInputProps & { reset?: boolean };\n searchInputClassName: string;\n expanded: boolean;\n setFocusedSelectItem: (idx: number) => void;\n}\n\nexport const useSearch = ({\n search,\n optionsCount,\n searchPlaceholder,\n searchInputProps,\n searchInputClassName,\n expanded,\n setFocusedSelectItem\n}: Props) => {\n const [filter, setFilter] = useState(\"\");\n const [isSearching, setIsSearching] = useState(false);\n\n const DEFAULT_RENDER_THRESHOLD = 10;\n\n const searchInputRef = useRef<HTMLInputElement>(null);\n\n const threshold = search?.renderThreshold ?? DEFAULT_RENDER_THRESHOLD;\n const hasEnoughChildren = optionsCount >= threshold;\n\n const filterResults = (event: React.ChangeEvent<HTMLInputElement>) => {\n setFilter(event.currentTarget.value);\n };\n\n const shouldRenderSearch = () => {\n if (search?.enabled) {\n return hasEnoughChildren;\n }\n\n if (search) {\n return search.enabled as boolean;\n }\n\n return optionsCount > DEFAULT_RENDER_THRESHOLD;\n };\n\n const renderSearch = () => (\n <Input\n {...(search?.searchInputProps ?? searchInputProps ?? {})}\n ref={searchInputRef}\n onFocus={() => setIsSearching(true)}\n onBlur={() => setIsSearching(false)}\n onChange={filterResults}\n className={searchInputClassName}\n wrapperProps={{\n className:\n search?.searchInputProps?.wrapperProps?.className ??\n searchInputProps?.wrapperProps?.className\n }}\n style={{\n display: expanded ? \"block\" : \"none\"\n }}\n type=\"text\"\n name=\"search-option\"\n placeholder={search?.searchPlaceholder ?? searchPlaceholder}\n />\n );\n\n const resetSearchState = () => {\n setFilter(\"\");\n setIsSearching(false);\n setFocusedSelectItem(-1);\n };\n\n const visible = shouldRenderSearch();\n\n useEffect(() => {\n (search?.searchInputProps?.reset || searchInputProps?.reset) && resetSearchState();\n }, [searchInputProps?.reset, search?.searchInputProps?.reset]);\n\n useEffect(() => {\n const searchDeactivated =\n !visible &&\n !isSearching; /*solves issue in MultiSelect when we filtered result and selected result causes list to be shorter than threshold so still we have a filter applied but can't change it due to `visible` variable has false */\n if (searchDeactivated) {\n resetSearchState();\n }\n }, [isSearching, visible]);\n\n return {\n renderSearch,\n setIsSearching,\n searchVisible: visible,\n searchThreshold: threshold,\n searchInputRef,\n filter,\n isSearching\n };\n};\n"],"names":["useSearch","search","optionsCount","searchPlaceholder","searchInputProps","searchInputClassName","expanded","setFocusedSelectItem","filter","setFilter","useState","isSearching","setIsSearching","DEFAULT_RENDER_THRESHOLD","searchInputRef","useRef","threshold","_a","renderThreshold","hasEnoughChildren","filterResults","event","currentTarget","value","shouldRenderSearch","enabled","renderSearch","React","createElement","Input","_b","ref","onFocus","onBlur","onChange","className","wrapperProps","_e","_d","_c","_f","style","display","type","name","placeholder","_g","resetSearchState","visible","useEffect","reset","searchDeactivated","searchVisible","searchThreshold"],"mappings":"8NAoCaA,EAAY,EACvBC,SACAC,eACAC,oBACAC,mBACAC,uBACAC,WACAC,mCAEA,MAAOC,EAAQC,GAAaC,EAAQA,SAAC,IACrC,MAAOC,EAAaC,GAAkBF,EAAQA,SAAC,OAE/C,MAAMG,EAA2B,GAEjC,MAAMC,EAAiBC,SAAyB,MAEhD,MAAMC,GAAYC,EAAAhB,IAAA,MAAAA,SAAA,OAAA,EAAAA,EAAQiB,mBAAmB,MAAAD,SAAA,EAAAA,EAAAJ,EAC7C,MAAMM,EAAoBjB,GAAgBc,EAE1C,MAAMI,EAAiBC,IACrBZ,EAAUY,EAAMC,cAAcC,MAAM,EAGtC,MAAMC,EAAqB,KACzB,GAAIvB,UAAAA,SAAM,OAAA,EAANA,EAAQwB,QACV,OAAON,EAGT,GAAIlB,EACF,OAAOA,EAAOwB,QAGhB,OAAOvB,EAAeW,CAAwB,EAGhD,MAAMa,EAAe,uBAAM,OACzBC,EAAC,WAAAC,cAAAC,QACK,QAACZ,EAAAhB,IAAA,MAAAA,SAAA,OAAA,EAAAA,EAAQG,oBAAgB,MAAAa,SAAA,EAAAA,EAAIb,KAAgB,MAAA0B,SAAA,EAAAA,EAAI,CAAA,EACrDC,IAAKjB,EACLkB,QAAS,IAAMpB,EAAe,MAC9BqB,OAAQ,IAAMrB,EAAe,OAC7BsB,SAAUd,EACVe,UAAW9B,EACX+B,aAAc,CACZD,WACEE,GAAAC,GAAAC,EAAAtC,UAAAA,SAAM,OAAA,EAANA,EAAQG,oBAAgB,MAAAmC,SAAA,OAAA,EAAAA,EAAEH,gBAAc,MAAAE,SAAA,OAAA,EAAAA,EAAAH,aACxC,MAAAE,SAAA,EAAAA,GAAAG,EAAApC,IAAgB,MAAhBA,SAAgB,OAAA,EAAhBA,EAAkBgC,gBAAY,MAAAI,SAAA,OAAA,EAAAA,EAAEL,WAEpCM,MAAO,CACLC,QAASpC,EAAW,QAAU,QAEhCqC,KAAK,OACLC,KAAK,gBACLC,aAAaC,EAAA7C,IAAA,MAAAA,kBAAAA,EAAQE,qBAAqB,MAAA2C,SAAA,EAAAA,EAAA3C,GAE7C,EAED,MAAM4C,EAAmB,KACvBtC,EAAU,IACVG,EAAe,OACfL,GAAsB,EAAE,EAG1B,MAAMyC,EAAUxB,IAEhByB,EAAAA,WAAU,cACPhC,EAAAhB,IAAA,MAAAA,kBAAAA,EAAQG,oBAAgB,MAAAa,SAAA,OAAA,EAAAA,EAAEiC,SAAS9C,IAAA,MAAAA,SAAA,OAAA,EAAAA,EAAkB8C,SAAUH,GAAkB,GACjF,CAAC3C,IAAgB,MAAhBA,SAAA,OAAA,EAAAA,EAAkB8C,OAAOpB,EAAA7B,IAAA,MAAAA,kBAAAA,EAAQG,oBAAkB,MAAA0B,SAAA,OAAA,EAAAA,EAAAoB,QAEvDD,EAAAA,WAAU,KACR,MAAME,GACHH,IACArC,EACH,GAAIwC,EACFJ,GACD,GACA,CAACpC,EAAaqC,IAEjB,MAAO,CACLtB,eACAd,iBACAwC,cAAeJ,EACfK,gBAAiBrC,EACjBF,iBACAN,SACAG,cACD"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import e,{useState as o,useRef as r,useEffect as l}from"react";import{Input as n}from"../Input/Input.esm.js";const s=({search:s,optionsCount:t,searchPlaceholder:i,searchInputProps:a,searchInputClassName:d,expanded:c,setFocusedSelectItem:u})=>{var v,p;const[h,m]=o("");const[f,I]=o(false);const P=10;const N=r(null);const b=(v=s===null||s===void 0?void 0:s.renderThreshold)!==null&&v!==void 0?v:P;const g=t
|
|
1
|
+
import e,{useState as o,useRef as r,useEffect as l}from"react";import{Input as n}from"../Input/Input.esm.js";const s=({search:s,optionsCount:t,searchPlaceholder:i,searchInputProps:a,searchInputClassName:d,expanded:c,setFocusedSelectItem:u})=>{var v,p;const[h,m]=o("");const[f,I]=o(false);const P=10;const N=r(null);const b=(v=s===null||s===void 0?void 0:s.renderThreshold)!==null&&v!==void 0?v:P;const g=t>=b;const S=e=>{m(e.currentTarget.value)};const w=()=>{if(s===null||s===void 0?void 0:s.enabled)return g;if(s)return s.enabled;return t>P};const x=()=>{var o,r,l,t,u,v,p;return e.createElement(n,{...(r=(o=s===null||s===void 0?void 0:s.searchInputProps)!==null&&o!==void 0?o:a)!==null&&r!==void 0?r:{},ref:N,onFocus:()=>I(true),onBlur:()=>I(false),onChange:S,className:d,wrapperProps:{className:(u=(t=(l=s===null||s===void 0?void 0:s.searchInputProps)===null||l===void 0?void 0:l.wrapperProps)===null||t===void 0?void 0:t.className)!==null&&u!==void 0?u:(v=a===null||a===void 0?void 0:a.wrapperProps)===null||v===void 0?void 0:v.className},style:{display:c?"block":"none"},type:"text",name:"search-option",placeholder:(p=s===null||s===void 0?void 0:s.searchPlaceholder)!==null&&p!==void 0?p:i})};const y=()=>{m("");I(false);u(-1)};const C=w();l((()=>{var e;(((e=s===null||s===void 0?void 0:s.searchInputProps)===null||e===void 0?void 0:e.reset)||(a===null||a===void 0?void 0:a.reset))&&y()}),[a===null||a===void 0?void 0:a.reset,(p=s===null||s===void 0?void 0:s.searchInputProps)===null||p===void 0?void 0:p.reset]);l((()=>{const e=!C&&!f;if(e)y()}),[f,C]);return{renderSearch:x,setIsSearching:I,searchVisible:C,searchThreshold:b,searchInputRef:N,filter:h,isSearching:f}};export{s as useSearch};
|
|
2
2
|
//# sourceMappingURL=useSearch.esm.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSearch.esm.js","sources":["../../../../../../src/components/Form/Select/useSearch.tsx"],"sourcesContent":["/*\n * Copyright 2022 OneWelcome B.V.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React, { useEffect, useRef, useState } from \"react\";\nimport { PartialInputProps, SearchProps } from \"./Select.interfaces\";\nimport { Input } from \"../Input/Input\";\n\ninterface Props {\n search?: SearchProps;\n optionsCount: number;\n /**\n * @deprecated\n */\n searchPlaceholder?: string;\n /**\n * @deprecated\n */\n searchInputProps?: PartialInputProps & { reset?: boolean };\n searchInputClassName: string;\n expanded: boolean;\n setFocusedSelectItem: (idx: number) => void;\n}\n\nexport const useSearch = ({\n search,\n optionsCount,\n searchPlaceholder,\n searchInputProps,\n searchInputClassName,\n expanded,\n setFocusedSelectItem\n}: Props) => {\n const [filter, setFilter] = useState(\"\");\n const [isSearching, setIsSearching] = useState(false);\n\n const DEFAULT_RENDER_THRESHOLD = 10;\n\n const searchInputRef = useRef<HTMLInputElement>(null);\n\n const threshold = search?.renderThreshold ?? DEFAULT_RENDER_THRESHOLD;\n const hasEnoughChildren = optionsCount
|
|
1
|
+
{"version":3,"file":"useSearch.esm.js","sources":["../../../../../../src/components/Form/Select/useSearch.tsx"],"sourcesContent":["/*\n * Copyright 2022 OneWelcome B.V.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React, { useEffect, useRef, useState } from \"react\";\nimport { PartialInputProps, SearchProps } from \"./Select.interfaces\";\nimport { Input } from \"../Input/Input\";\n\ninterface Props {\n search?: SearchProps;\n optionsCount: number;\n /**\n * @deprecated\n */\n searchPlaceholder?: string;\n /**\n * @deprecated\n */\n searchInputProps?: PartialInputProps & { reset?: boolean };\n searchInputClassName: string;\n expanded: boolean;\n setFocusedSelectItem: (idx: number) => void;\n}\n\nexport const useSearch = ({\n search,\n optionsCount,\n searchPlaceholder,\n searchInputProps,\n searchInputClassName,\n expanded,\n setFocusedSelectItem\n}: Props) => {\n const [filter, setFilter] = useState(\"\");\n const [isSearching, setIsSearching] = useState(false);\n\n const DEFAULT_RENDER_THRESHOLD = 10;\n\n const searchInputRef = useRef<HTMLInputElement>(null);\n\n const threshold = search?.renderThreshold ?? DEFAULT_RENDER_THRESHOLD;\n const hasEnoughChildren = optionsCount >= threshold;\n\n const filterResults = (event: React.ChangeEvent<HTMLInputElement>) => {\n setFilter(event.currentTarget.value);\n };\n\n const shouldRenderSearch = () => {\n if (search?.enabled) {\n return hasEnoughChildren;\n }\n\n if (search) {\n return search.enabled as boolean;\n }\n\n return optionsCount > DEFAULT_RENDER_THRESHOLD;\n };\n\n const renderSearch = () => (\n <Input\n {...(search?.searchInputProps ?? searchInputProps ?? {})}\n ref={searchInputRef}\n onFocus={() => setIsSearching(true)}\n onBlur={() => setIsSearching(false)}\n onChange={filterResults}\n className={searchInputClassName}\n wrapperProps={{\n className:\n search?.searchInputProps?.wrapperProps?.className ??\n searchInputProps?.wrapperProps?.className\n }}\n style={{\n display: expanded ? \"block\" : \"none\"\n }}\n type=\"text\"\n name=\"search-option\"\n placeholder={search?.searchPlaceholder ?? searchPlaceholder}\n />\n );\n\n const resetSearchState = () => {\n setFilter(\"\");\n setIsSearching(false);\n setFocusedSelectItem(-1);\n };\n\n const visible = shouldRenderSearch();\n\n useEffect(() => {\n (search?.searchInputProps?.reset || searchInputProps?.reset) && resetSearchState();\n }, [searchInputProps?.reset, search?.searchInputProps?.reset]);\n\n useEffect(() => {\n const searchDeactivated =\n !visible &&\n !isSearching; /*solves issue in MultiSelect when we filtered result and selected result causes list to be shorter than threshold so still we have a filter applied but can't change it due to `visible` variable has false */\n if (searchDeactivated) {\n resetSearchState();\n }\n }, [isSearching, visible]);\n\n return {\n renderSearch,\n setIsSearching,\n searchVisible: visible,\n searchThreshold: threshold,\n searchInputRef,\n filter,\n isSearching\n };\n};\n"],"names":["useSearch","search","optionsCount","searchPlaceholder","searchInputProps","searchInputClassName","expanded","setFocusedSelectItem","filter","setFilter","useState","isSearching","setIsSearching","DEFAULT_RENDER_THRESHOLD","searchInputRef","useRef","threshold","_a","renderThreshold","hasEnoughChildren","filterResults","event","currentTarget","value","shouldRenderSearch","enabled","renderSearch","React","createElement","Input","_b","ref","onFocus","onBlur","onChange","className","wrapperProps","_e","_d","_c","_f","style","display","type","name","placeholder","_g","resetSearchState","visible","useEffect","reset","searchDeactivated","searchVisible","searchThreshold"],"mappings":"mHAoCaA,EAAY,EACvBC,SACAC,eACAC,oBACAC,mBACAC,uBACAC,WACAC,mCAEA,MAAOC,EAAQC,GAAaC,EAAS,IACrC,MAAOC,EAAaC,GAAkBF,EAAS,OAE/C,MAAMG,EAA2B,GAEjC,MAAMC,EAAiBC,EAAyB,MAEhD,MAAMC,GAAYC,EAAAhB,IAAA,MAAAA,SAAA,OAAA,EAAAA,EAAQiB,mBAAmB,MAAAD,SAAA,EAAAA,EAAAJ,EAC7C,MAAMM,EAAoBjB,GAAgBc,EAE1C,MAAMI,EAAiBC,IACrBZ,EAAUY,EAAMC,cAAcC,MAAM,EAGtC,MAAMC,EAAqB,KACzB,GAAIvB,UAAAA,SAAM,OAAA,EAANA,EAAQwB,QACV,OAAON,EAGT,GAAIlB,EACF,OAAOA,EAAOwB,QAGhB,OAAOvB,EAAeW,CAAwB,EAGhD,MAAMa,EAAe,uBAAM,OACzBC,EAACC,cAAAC,EACK,QAACZ,EAAAhB,IAAA,MAAAA,SAAA,OAAA,EAAAA,EAAQG,oBAAgB,MAAAa,SAAA,EAAAA,EAAIb,KAAgB,MAAA0B,SAAA,EAAAA,EAAI,CAAA,EACrDC,IAAKjB,EACLkB,QAAS,IAAMpB,EAAe,MAC9BqB,OAAQ,IAAMrB,EAAe,OAC7BsB,SAAUd,EACVe,UAAW9B,EACX+B,aAAc,CACZD,WACEE,GAAAC,GAAAC,EAAAtC,UAAAA,SAAM,OAAA,EAANA,EAAQG,oBAAgB,MAAAmC,SAAA,OAAA,EAAAA,EAAEH,gBAAc,MAAAE,SAAA,OAAA,EAAAA,EAAAH,aACxC,MAAAE,SAAA,EAAAA,GAAAG,EAAApC,IAAgB,MAAhBA,SAAgB,OAAA,EAAhBA,EAAkBgC,gBAAY,MAAAI,SAAA,OAAA,EAAAA,EAAEL,WAEpCM,MAAO,CACLC,QAASpC,EAAW,QAAU,QAEhCqC,KAAK,OACLC,KAAK,gBACLC,aAAaC,EAAA7C,IAAA,MAAAA,kBAAAA,EAAQE,qBAAqB,MAAA2C,SAAA,EAAAA,EAAA3C,GAE7C,EAED,MAAM4C,EAAmB,KACvBtC,EAAU,IACVG,EAAe,OACfL,GAAsB,EAAE,EAG1B,MAAMyC,EAAUxB,IAEhByB,GAAU,cACPhC,EAAAhB,IAAA,MAAAA,kBAAAA,EAAQG,oBAAgB,MAAAa,SAAA,OAAA,EAAAA,EAAEiC,SAAS9C,IAAA,MAAAA,SAAA,OAAA,EAAAA,EAAkB8C,SAAUH,GAAkB,GACjF,CAAC3C,IAAgB,MAAhBA,SAAA,OAAA,EAAAA,EAAkB8C,OAAOpB,EAAA7B,IAAA,MAAAA,kBAAAA,EAAQG,oBAAkB,MAAA0B,SAAA,OAAA,EAAAA,EAAAoB,QAEvDD,GAAU,KACR,MAAME,GACHH,IACArC,EACH,GAAIwC,EACFJ,GACD,GACA,CAACpC,EAAaqC,IAEjB,MAAO,CACLtB,eACAd,iBACAwC,cAAeJ,EACfK,gBAAiBrC,EACjBF,iBACAN,SACAG,cACD"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"homepage": "http://onewelcome.github.io/react-lib-components",
|
|
3
3
|
"name": "@onewelcome/react-lib-components",
|
|
4
|
-
"version": "6.4.
|
|
4
|
+
"version": "6.4.2",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "OneWelcome B.V.",
|
|
7
7
|
"main": "dist/cjs/src/index.cjs.js",
|
|
@@ -52,13 +52,13 @@
|
|
|
52
52
|
"node": ">=16"
|
|
53
53
|
},
|
|
54
54
|
"devDependencies": {
|
|
55
|
-
"@babel/core": "^7.
|
|
56
|
-
"@babel/preset-env": "^7.
|
|
55
|
+
"@babel/core": "^7.24.0",
|
|
56
|
+
"@babel/preset-env": "^7.24.0",
|
|
57
57
|
"@babel/preset-react": "^7.23.3",
|
|
58
58
|
"@babel/preset-typescript": "^7.23.3",
|
|
59
|
-
"@mdx-js/react": "^3.0.
|
|
59
|
+
"@mdx-js/react": "^3.0.1",
|
|
60
60
|
"@onewelcome/eslint-config-shared-codestyle": "^9.1.0",
|
|
61
|
-
"@onewelcome/storybook-addon-basestyling": "^1.0.
|
|
61
|
+
"@onewelcome/storybook-addon-basestyling": "^1.0.2",
|
|
62
62
|
"@rollup/plugin-commonjs": "^25.0.7",
|
|
63
63
|
"@rollup/plugin-node-resolve": "^15.2.3",
|
|
64
64
|
"@rollup/plugin-typescript": "^11.1.6",
|
|
@@ -82,8 +82,8 @@
|
|
|
82
82
|
"@testing-library/user-event": "^14.5.2",
|
|
83
83
|
"@types/jest": "^29.5.12",
|
|
84
84
|
"@types/mdx": "^2.0.11",
|
|
85
|
-
"@types/react": "^18.2.
|
|
86
|
-
"@types/react-dom": "^18.2.
|
|
85
|
+
"@types/react": "^18.2.65",
|
|
86
|
+
"@types/react-dom": "^18.2.21",
|
|
87
87
|
"@types/react-router": "^5.1.20",
|
|
88
88
|
"@types/react-router-dom": "^5.3.3",
|
|
89
89
|
"@typescript-eslint/eslint-plugin": "^6.21.0",
|
|
@@ -91,24 +91,24 @@
|
|
|
91
91
|
"babel-loader": "^9.1.3",
|
|
92
92
|
"chromatic": "^10.9.3",
|
|
93
93
|
"css-loader": "^6.10.0",
|
|
94
|
-
"eslint": "^8.
|
|
94
|
+
"eslint": "^8.57.0",
|
|
95
95
|
"eslint-config-prettier": "^9.1.0",
|
|
96
96
|
"eslint-plugin-cypress": "^2.15.1",
|
|
97
97
|
"eslint-plugin-export-scope": "^2.0.5",
|
|
98
|
-
"eslint-plugin-jest": "^27.
|
|
98
|
+
"eslint-plugin-jest": "^27.9.0",
|
|
99
99
|
"eslint-plugin-license-header": "^0.6.0",
|
|
100
100
|
"eslint-plugin-prettier": "^5.1.3",
|
|
101
|
-
"eslint-plugin-react": "^7.
|
|
101
|
+
"eslint-plugin-react": "^7.34.0",
|
|
102
102
|
"eslint-plugin-react-hooks": "^4.6.0",
|
|
103
103
|
"eslint-plugin-storybook": "^0.6.15",
|
|
104
|
-
"husky": "^9.0.
|
|
104
|
+
"husky": "^9.0.11",
|
|
105
105
|
"identity-obj-proxy": "^3.0.0",
|
|
106
106
|
"jest": "^29.7.0",
|
|
107
107
|
"jest-environment-jsdom": "^29.7.0",
|
|
108
108
|
"jest-junit": "^16.0.0",
|
|
109
109
|
"jest-sonar-reporter": "^2.0.0",
|
|
110
110
|
"lint-staged": "^15.2.2",
|
|
111
|
-
"mini-css-extract-plugin": "^2.8.
|
|
111
|
+
"mini-css-extract-plugin": "^2.8.1",
|
|
112
112
|
"npm-run-all": "^4.1.5",
|
|
113
113
|
"postcss": "^8.4.35",
|
|
114
114
|
"postcss-modules": "^6.0.0",
|
|
@@ -117,16 +117,16 @@
|
|
|
117
117
|
"react": "^18.2.0",
|
|
118
118
|
"react-dom": "^18.2.0",
|
|
119
119
|
"react-is": "^18.2.0",
|
|
120
|
-
"react-router-dom": "^6.22.
|
|
120
|
+
"react-router-dom": "^6.22.3",
|
|
121
121
|
"remark-gfm": "^4.0.0",
|
|
122
122
|
"rollup": "^2.79.1",
|
|
123
123
|
"rollup-plugin-postcss": "^4.0.2",
|
|
124
124
|
"rollup-plugin-terser": "^7.0.2",
|
|
125
|
-
"sass": "^1.
|
|
126
|
-
"sass-loader": "^14.1.
|
|
127
|
-
"size-limit": "^11.0.
|
|
125
|
+
"sass": "^1.71.1",
|
|
126
|
+
"sass-loader": "^14.1.1",
|
|
127
|
+
"size-limit": "^11.0.3",
|
|
128
128
|
"storybook": "^7.6.14",
|
|
129
|
-
"storybook-addon-pseudo-states": "^2.1
|
|
129
|
+
"storybook-addon-pseudo-states": "^2.2.1",
|
|
130
130
|
"style-loader": "^3.3.4",
|
|
131
131
|
"ts-jest": "^29.1.2",
|
|
132
132
|
"tslib": "^2.6.2",
|
|
@@ -51,7 +51,7 @@ export const useSearch = ({
|
|
|
51
51
|
const searchInputRef = useRef<HTMLInputElement>(null);
|
|
52
52
|
|
|
53
53
|
const threshold = search?.renderThreshold ?? DEFAULT_RENDER_THRESHOLD;
|
|
54
|
-
const hasEnoughChildren = optionsCount
|
|
54
|
+
const hasEnoughChildren = optionsCount >= threshold;
|
|
55
55
|
|
|
56
56
|
const filterResults = (event: React.ChangeEvent<HTMLInputElement>) => {
|
|
57
57
|
setFilter(event.currentTarget.value);
|