@bikdotai/bik-component-library 0.0.731-beta.10 → 0.0.731-beta.12

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 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../../node_modules/react/jsx-runtime.js"),t=require("react"),s=require("../../../zeroState/ZeroState.js"),n=require("../../../../hooks/useOutside.js"),o=require("../../hooks/useDropdown.js"),r=require("./description/Description.js"),i=require("./menu/FreeFormMenu.js"),l=require("./menu/MenuList.js"),u=require("./menu/SelectAllMenu.js"),c=require("./multiSelect/MultiSelectDropdownBottomBar.js"),a=require("./OpennedDropdown.styled.js"),d=require("./searchbox/SearchBox.js"),p=require("./searchbox/SearchZeroState.js");const h=304,x=290;exports.OpenedDropdown=f=>{let{options:j,isSearchable:S,isMultiSelect:b,maxSelections:m,width:g,allowFreeForm:v,height:w,onClose:O,onSelect:y,onSearch:E,version:D,skipSorting:C,headerRef:R,hideSelectAll:q,primaryButtonText:M,onInfiniteScroll:k,onMultiSelectClear:L,onDropdownItemClick:A,buttonOptions:F,isSearchLoading:I,disableSearchOptions:T,disableSearchedOptionExcept:B,useDefaultCursor:H,containerStyle:Z={},zeroState:_}=f;const{dropdownOptions:z,search:P,searchedString:V,searchedOptions:W,onApplyHandler:$,selectAllHandler:K,onMultiSelectClear:N,onFreeFormSelect:U,onMultiSelectApply:G,latestDropdownOptionsRef:J,getSelectedOptions:Q,getCurrentSelectionCount:X}=o.useDropdown(D,j,y,C,b,E,T,B,m),[Y,ee]=t.useState(null!=g?g:x),[te,se]=t.useState(null),[ne,oe]=t.useState(-1),re=t.useRef(null),ie=t.useRef([]),le=t.useRef(null);n.useOutside(re,(()=>{if(se(null),b&&"2.0"===D){const e=Q(J.current);null==O||O(e)}else null==O||O(z)}),[R,ie]),t.useEffect((()=>{re.current&&re.current.focus()}),[]);t.useEffect((()=>{const e=e=>{const t=(e=>{const t=[];return e.forEach((e=>{if(e.options)e.options.forEach((e=>{e.disabled||t.push(e)}));else{const s=e;s.disabled||t.push(s)}})),t})(V&&E?W:z);if(0!==t.length)if("ArrowDown"===e.key)e.preventDefault(),oe((e=>{const s=e<t.length-1?e+1:0;return setTimeout((()=>{var e;const t=null===(e=le.current)||void 0===e?void 0:e.querySelector(`[data-option-index="${s}"]`);t&&t.scrollIntoView({block:"nearest",behavior:"smooth"})}),0),s}));else if("ArrowUp"===e.key)e.preventDefault(),oe((e=>{const s=e>0?e-1:t.length-1;return setTimeout((()=>{var e;const t=null===(e=le.current)||void 0===e?void 0:e.querySelector(`[data-option-index="${s}"]`);t&&t.scrollIntoView({block:"nearest",behavior:"smooth"})}),0),s}));else if("Enter"===e.key&&ne>=0){e.preventDefault();const s=t[ne];s&&(A?A(s):y&&y(s),$(Object.assign(Object.assign({},s),{selected:!s.selected})))}},t=re.current;if(t)return t.addEventListener("keydown",e),()=>{t.removeEventListener("keydown",e)}}),[ne,V,W,z,E,$]);const ue=null!=w?w:h,ce="number"==typeof ue?S&&b?ue-96:S&&!b||!S&&b?ue-48:ue:ue;t.useEffect((()=>{const e=null!=g?g:x;if(null===te)ee(e);else if("number"==typeof e)ee(2*e);else if("string"==typeof e&&e.endsWith("px")){const t=2*parseInt(e.replace("px",""));ee(t)}}),[te]);const ae=[],de=(e=>{if(!b||!m&&0!==m)return e;const t=X(e)>=m;return t?e.map((e=>{if(e.options)return Object.assign(Object.assign({},e),{options:e.options.map((e=>Object.assign(Object.assign({},e),{disabled:e.disabled||!e.selected&&t})))});{const s=e;return Object.assign(Object.assign({},s),{disabled:s.disabled||!s.selected&&t})}})):e})((V&&E?W:z).map((e=>{var t,s;if(V&&!E){if(e.options){const t=Object.assign({},e);return t.options=t.options.filter((e=>{var t;return!!(null===(t=e.label)||void 0===t?void 0:t.toLowerCase().includes(V.toLowerCase()))&&(ae.push(!V||e.label===V),!0)})),t.options.length>0?t:null}return(null===(t=e.label)||void 0===t?void 0:t.toLowerCase().includes(V.toLowerCase()))||(null===(s=e.searchKey)||void 0===s?void 0:s.toLowerCase().includes(V.toLowerCase()))?(ae.push(!V||e.label===V),e):null}return e})).filter((e=>null!==e))),pe=!!S&&V&&0===de.length;return e.jsxRuntimeExports.jsxs(a.OpennedDropdownContainer,Object.assign({version:D,ref:re,style:Object.assign({width:Y},Z)},{children:[e.jsxRuntimeExports.jsxs("div",Object.assign({style:{width:te?"50%":"100%",display:"flex",flexDirection:"column",background:"white"}},{children:[!!S&&e.jsxRuntimeExports.jsx(d.SearchBox,{onSearch:P,version:D}),de.length||V?e.jsxRuntimeExports.jsxs(a.MenuListContainer,Object.assign({minHeight:ue,maxHeight:ce,ref:le},{children:[!!b&&!pe&&!q&&e.jsxRuntimeExports.jsx(u.SelectAllMenu,{version:D,options:V&&E?W:z,onSelect:K}),!v&&pe&&e.jsxRuntimeExports.jsx(p.SearchZeroState,{isLoading:I,height:ce,searchedString:V,containerWidth:g}),v&&(pe||!!ae.length&&ae.every((e=>!1===e)))&&e.jsxRuntimeExports.jsx(i.FreeFormMenu,{version:D,isMultiSelect:b,onSelect:U,searchedString:V}),e.jsxRuntimeExports.jsx(l.MenuList,{onInfiniteScroll:k,onDropdownItemClick:A,version:D,onSelect:$,showDescription:function(e,t){se(e&&t?{title:e,description:t}:null)},isMultiSelect:b,options:de,useDefaultCursor:H,ref:ie,focusedIndex:ne})]})):e.jsxRuntimeExports.jsx("div",Object.assign({style:{height:ue,display:"flex"}},{children:e.jsxRuntimeExports.jsx(s.ZeroState,Object.assign({},_,{title:(null==_?void 0:_.title)||"No results found",subTitle:(null==_?void 0:_.subTitle)||"Please try again later or contact us at support@bik.ai if you require further assistance."}))})),!!b&&!(!de.length&&!V)&&"2.0"!==D&&e.jsxRuntimeExports.jsx(c.default,{onClear:()=>{N(),null==L||L()},onApply:G,list:V&&E?W:z,buttonText:M,buttonOptions:F})]})),!!te&&e.jsxRuntimeExports.jsx(r.Description,{title:te.title,description:te.description,version:D})]}))};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../../node_modules/react/jsx-runtime.js"),t=require("react"),n=require("../../../zeroState/ZeroState.js"),s=require("../../../../hooks/useOutside.js"),o=require("../../hooks/useDropdown.js"),r=require("./description/Description.js"),i=require("./menu/FreeFormMenu.js"),l=require("./menu/MenuList.js"),u=require("./menu/SelectAllMenu.js"),c=require("./multiSelect/MultiSelectDropdownBottomBar.js"),a=require("./OpennedDropdown.styled.js"),d=require("./searchbox/SearchBox.js"),p=require("./searchbox/SearchZeroState.js");const h=304,x=290;exports.OpenedDropdown=j=>{let{options:f,isSearchable:S,isMultiSelect:b,maxSelections:g,width:m,allowFreeForm:v,height:O,onClose:w,onSelect:y,onSearch:E,version:D,skipSorting:C,headerRef:R,hideSelectAll:q,primaryButtonText:M,onInfiniteScroll:k,onMultiSelectClear:L,onDropdownItemClick:A,buttonOptions:I,isSearchLoading:F,disableSearchOptions:T,disableSearchedOptionExcept:B,useDefaultCursor:H,containerStyle:Z={},zeroState:_}=j;const{dropdownOptions:z,search:P,searchedString:V,searchedOptions:W,onApplyHandler:$,selectAllHandler:K,onMultiSelectClear:N,onFreeFormSelect:U,onMultiSelectApply:G,latestDropdownOptionsRef:J,getSelectedOptions:Q,getCurrentSelectionCount:X}=o.useDropdown(D,f,y,C,b,E,T,B,g),[Y,ee]=t.useState(null!=m?m:x),[te,ne]=t.useState(null),[se,oe]=t.useState(-1),re=t.useRef(null),ie=t.useRef([]),le=t.useRef(null);s.useOutside(re,(()=>{if(ne(null),b&&"2.0"===D){const e=Q(J.current);null==w||w(e)}else null==w||w(z)}),[R,ie]),t.useEffect((()=>{re.current&&re.current.focus()}),[]);t.useEffect((()=>{const e=e=>{const t=(e=>{const t=[];return e.forEach((e=>{if(e.options)e.options.forEach((e=>{e.disabled||t.push(e)}));else{const n=e;n.disabled||t.push(n)}})),t})(V&&E?W:z);if(0!==t.length)if("ArrowDown"===e.key)e.preventDefault(),oe((e=>{const n=e<t.length-1?e+1:0;return setTimeout((()=>{var e;const t=null===(e=le.current)||void 0===e?void 0:e.querySelector(`[data-option-index="${n}"]`);t&&t.scrollIntoView({block:"nearest",behavior:"smooth"})}),0),n}));else if("ArrowUp"===e.key)e.preventDefault(),oe((e=>{const n=e>0?e-1:t.length-1;return setTimeout((()=>{var e;const t=null===(e=le.current)||void 0===e?void 0:e.querySelector(`[data-option-index="${n}"]`);t&&t.scrollIntoView({block:"nearest",behavior:"smooth"})}),0),n}));else if("Enter"===e.key&&se>=0){e.preventDefault();const n=t[se];n&&(A?A(n):y&&y(n),$(Object.assign(Object.assign({},n),{selected:!n.selected})))}},t=re.current;if(t)return t.addEventListener("keydown",e),()=>{t.removeEventListener("keydown",e)}}),[se,V,W,z,E,$]);const ue=null!=O?O:h,ce="number"==typeof ue?S&&b?ue-96:S&&!b||!S&&b?ue-48:ue:ue;t.useEffect((()=>{const e=null!=m?m:x;if(null===te)ee(e);else if("number"==typeof e)ee(2*e);else if("string"==typeof e&&e.endsWith("px")){const t=2*parseInt(e.replace("px",""));ee(t)}}),[te]);const ae=[],de=(e=>{if(!b||!g&&0!==g)return e;const t=X(e)>=g;return t?e.map((e=>{if(e.options)return Object.assign(Object.assign({},e),{options:e.options.map((e=>Object.assign(Object.assign({},e),{disabled:e.disabled||!e.selected&&t})))});{const n=e;return Object.assign(Object.assign({},n),{disabled:n.disabled||!n.selected&&t})}})):e})((V&&E?W:z).map((e=>{var t,n;if(V&&!E){if(e.options){const t=Object.assign({},e);return t.options=t.options.filter((e=>{var t;return!!(null===(t=e.label)||void 0===t?void 0:t.toLowerCase().includes(V.toLowerCase()))&&(ae.push(!V||e.label===V),!0)})),t.options.length>0?t:null}return(null===(t=e.label)||void 0===t?void 0:t.toLowerCase().includes(V.toLowerCase()))||(null===(n=e.searchKey)||void 0===n?void 0:n.toLowerCase().includes(V.toLowerCase()))?(ae.push(!V||e.label===V),e):null}return e})).filter((e=>null!==e))),pe=!!S&&V&&0===de.length;return e.jsxRuntimeExports.jsxs(a.OpennedDropdownContainer,Object.assign({version:D,ref:re,tabIndex:-1,style:Object.assign(Object.assign({width:Y},Z),{outline:"none"})},{children:[e.jsxRuntimeExports.jsxs("div",Object.assign({style:{width:te?"50%":"100%",display:"flex",flexDirection:"column",background:"white"}},{children:[!!S&&e.jsxRuntimeExports.jsx(d.SearchBox,{onSearch:P,version:D}),de.length||V?e.jsxRuntimeExports.jsxs(a.MenuListContainer,Object.assign({minHeight:ue,maxHeight:ce,ref:le},{children:[!!b&&!pe&&!q&&e.jsxRuntimeExports.jsx(u.SelectAllMenu,{version:D,options:V&&E?W:z,onSelect:K}),!v&&pe&&e.jsxRuntimeExports.jsx(p.SearchZeroState,{isLoading:F,height:ce,searchedString:V,containerWidth:m}),v&&(pe||!!ae.length&&ae.every((e=>!1===e)))&&e.jsxRuntimeExports.jsx(i.FreeFormMenu,{version:D,isMultiSelect:b,onSelect:U,searchedString:V}),e.jsxRuntimeExports.jsx(l.MenuList,{onInfiniteScroll:k,onDropdownItemClick:A,version:D,onSelect:$,showDescription:function(e,t){ne(e&&t?{title:e,description:t}:null)},isMultiSelect:b,options:de,useDefaultCursor:H,ref:ie,focusedIndex:se})]})):e.jsxRuntimeExports.jsx("div",Object.assign({style:{height:ue,display:"flex"}},{children:e.jsxRuntimeExports.jsx(n.ZeroState,Object.assign({},_,{title:(null==_?void 0:_.title)||"No results found",subTitle:(null==_?void 0:_.subTitle)||"Please try again later or contact us at support@bik.ai if you require further assistance."}))})),!!b&&!(!de.length&&!V)&&"2.0"!==D&&e.jsxRuntimeExports.jsx(c.default,{onClear:()=>{N(),null==L||L()},onApply:G,list:V&&E?W:z,buttonText:M,buttonOptions:I})]})),!!te&&e.jsxRuntimeExports.jsx(r.Description,{title:te.title,description:te.description,version:D})]}))};
@@ -1 +1 @@
1
- import{j as e}from"../../../../node_modules/react/jsx-runtime.js";import{useState as t,useRef as o,useEffect as n}from"react";import{ZeroState as s}from"../../../zeroState/ZeroState.js";import{useOutside as r}from"../../../../hooks/useOutside.js";import{useDropdown as i}from"../../hooks/useDropdown.js";import{Description as l}from"./description/Description.js";import{FreeFormMenu as c}from"./menu/FreeFormMenu.js";import{MenuList as a}from"./menu/MenuList.js";import{SelectAllMenu as u}from"./menu/SelectAllMenu.js";import d from"./multiSelect/MultiSelectDropdownBottomBar.js";import{OpennedDropdownContainer as p,MenuListContainer as h}from"./OpennedDropdown.styled.js";import{SearchBox as f}from"./searchbox/SearchBox.js";import{SearchZeroState as m}from"./searchbox/SearchZeroState.js";const b=304,j=290,g=g=>{let{options:S,isSearchable:v,isMultiSelect:x,maxSelections:w,width:y,allowFreeForm:O,height:C,onClose:D,onSelect:k,onSearch:L,version:M,skipSorting:A,headerRef:I,hideSelectAll:E,primaryButtonText:F,onInfiniteScroll:T,onMultiSelectClear:B,onDropdownItemClick:H,buttonOptions:q,isSearchLoading:z,disableSearchOptions:R,disableSearchedOptionExcept:V,useDefaultCursor:W,containerStyle:Z={},zeroState:$}=g;const{dropdownOptions:K,search:N,searchedString:P,searchedOptions:U,onApplyHandler:_,selectAllHandler:G,onMultiSelectClear:J,onFreeFormSelect:Q,onMultiSelectApply:X,latestDropdownOptionsRef:Y,getSelectedOptions:ee,getCurrentSelectionCount:te}=i(M,S,k,A,x,L,R,V,w),[oe,ne]=t(null!=y?y:j),[se,re]=t(null),[ie,le]=t(-1),ce=o(null),ae=o([]),ue=o(null);r(ce,(()=>{if(re(null),x&&"2.0"===M){const e=ee(Y.current);null==D||D(e)}else null==D||D(K)}),[I,ae]),n((()=>{ce.current&&ce.current.focus()}),[]);n((()=>{const e=e=>{const t=(e=>{const t=[];return e.forEach((e=>{if(e.options)e.options.forEach((e=>{e.disabled||t.push(e)}));else{const o=e;o.disabled||t.push(o)}})),t})(P&&L?U:K);if(0!==t.length)if("ArrowDown"===e.key)e.preventDefault(),le((e=>{const o=e<t.length-1?e+1:0;return setTimeout((()=>{var e;const t=null===(e=ue.current)||void 0===e?void 0:e.querySelector(`[data-option-index="${o}"]`);t&&t.scrollIntoView({block:"nearest",behavior:"smooth"})}),0),o}));else if("ArrowUp"===e.key)e.preventDefault(),le((e=>{const o=e>0?e-1:t.length-1;return setTimeout((()=>{var e;const t=null===(e=ue.current)||void 0===e?void 0:e.querySelector(`[data-option-index="${o}"]`);t&&t.scrollIntoView({block:"nearest",behavior:"smooth"})}),0),o}));else if("Enter"===e.key&&ie>=0){e.preventDefault();const o=t[ie];o&&(H?H(o):k&&k(o),_(Object.assign(Object.assign({},o),{selected:!o.selected})))}},t=ce.current;if(t)return t.addEventListener("keydown",e),()=>{t.removeEventListener("keydown",e)}}),[ie,P,U,K,L,_]);const de=null!=C?C:b,pe="number"==typeof de?v&&x?de-96:v&&!x||!v&&x?de-48:de:de;n((()=>{const e=null!=y?y:j;if(null===se)ne(e);else if("number"==typeof e)ne(2*e);else if("string"==typeof e&&e.endsWith("px")){const t=2*parseInt(e.replace("px",""));ne(t)}}),[se]);const he=[],fe=(e=>{if(!x||!w&&0!==w)return e;const t=te(e)>=w;return t?e.map((e=>{if(e.options)return Object.assign(Object.assign({},e),{options:e.options.map((e=>Object.assign(Object.assign({},e),{disabled:e.disabled||!e.selected&&t})))});{const o=e;return Object.assign(Object.assign({},o),{disabled:o.disabled||!o.selected&&t})}})):e})((P&&L?U:K).map((e=>{var t,o;if(P&&!L){if(e.options){const t=Object.assign({},e);return t.options=t.options.filter((e=>{var t;return!!(null===(t=e.label)||void 0===t?void 0:t.toLowerCase().includes(P.toLowerCase()))&&(he.push(!P||e.label===P),!0)})),t.options.length>0?t:null}return(null===(t=e.label)||void 0===t?void 0:t.toLowerCase().includes(P.toLowerCase()))||(null===(o=e.searchKey)||void 0===o?void 0:o.toLowerCase().includes(P.toLowerCase()))?(he.push(!P||e.label===P),e):null}return e})).filter((e=>null!==e))),me=!!v&&P&&0===fe.length;return e.jsxs(p,Object.assign({version:M,ref:ce,style:Object.assign({width:oe},Z)},{children:[e.jsxs("div",Object.assign({style:{width:se?"50%":"100%",display:"flex",flexDirection:"column",background:"white"}},{children:[!!v&&e.jsx(f,{onSearch:N,version:M}),fe.length||P?e.jsxs(h,Object.assign({minHeight:de,maxHeight:pe,ref:ue},{children:[!!x&&!me&&!E&&e.jsx(u,{version:M,options:P&&L?U:K,onSelect:G}),!O&&me&&e.jsx(m,{isLoading:z,height:pe,searchedString:P,containerWidth:y}),O&&(me||!!he.length&&he.every((e=>!1===e)))&&e.jsx(c,{version:M,isMultiSelect:x,onSelect:Q,searchedString:P}),e.jsx(a,{onInfiniteScroll:T,onDropdownItemClick:H,version:M,onSelect:_,showDescription:function(e,t){re(e&&t?{title:e,description:t}:null)},isMultiSelect:x,options:fe,useDefaultCursor:W,ref:ae,focusedIndex:ie})]})):e.jsx("div",Object.assign({style:{height:de,display:"flex"}},{children:e.jsx(s,Object.assign({},$,{title:(null==$?void 0:$.title)||"No results found",subTitle:(null==$?void 0:$.subTitle)||"Please try again later or contact us at support@bik.ai if you require further assistance."}))})),!!x&&!(!fe.length&&!P)&&"2.0"!==M&&e.jsx(d,{onClear:()=>{J(),null==B||B()},onApply:X,list:P&&L?U:K,buttonText:F,buttonOptions:q})]})),!!se&&e.jsx(l,{title:se.title,description:se.description,version:M})]}))};export{g as OpenedDropdown};
1
+ import{j as e}from"../../../../node_modules/react/jsx-runtime.js";import{useState as t,useRef as o,useEffect as n}from"react";import{ZeroState as s}from"../../../zeroState/ZeroState.js";import{useOutside as r}from"../../../../hooks/useOutside.js";import{useDropdown as i}from"../../hooks/useDropdown.js";import{Description as l}from"./description/Description.js";import{FreeFormMenu as c}from"./menu/FreeFormMenu.js";import{MenuList as a}from"./menu/MenuList.js";import{SelectAllMenu as u}from"./menu/SelectAllMenu.js";import d from"./multiSelect/MultiSelectDropdownBottomBar.js";import{OpennedDropdownContainer as p,MenuListContainer as h}from"./OpennedDropdown.styled.js";import{SearchBox as f}from"./searchbox/SearchBox.js";import{SearchZeroState as m}from"./searchbox/SearchZeroState.js";const b=304,j=290,g=g=>{let{options:S,isSearchable:v,isMultiSelect:x,maxSelections:w,width:O,allowFreeForm:y,height:C,onClose:D,onSelect:k,onSearch:L,version:M,skipSorting:I,headerRef:A,hideSelectAll:E,primaryButtonText:F,onInfiniteScroll:T,onMultiSelectClear:B,onDropdownItemClick:H,buttonOptions:q,isSearchLoading:z,disableSearchOptions:R,disableSearchedOptionExcept:V,useDefaultCursor:W,containerStyle:Z={},zeroState:$}=g;const{dropdownOptions:K,search:N,searchedString:P,searchedOptions:U,onApplyHandler:_,selectAllHandler:G,onMultiSelectClear:J,onFreeFormSelect:Q,onMultiSelectApply:X,latestDropdownOptionsRef:Y,getSelectedOptions:ee,getCurrentSelectionCount:te}=i(M,S,k,I,x,L,R,V,w),[oe,ne]=t(null!=O?O:j),[se,re]=t(null),[ie,le]=t(-1),ce=o(null),ae=o([]),ue=o(null);r(ce,(()=>{if(re(null),x&&"2.0"===M){const e=ee(Y.current);null==D||D(e)}else null==D||D(K)}),[A,ae]),n((()=>{ce.current&&ce.current.focus()}),[]);n((()=>{const e=e=>{const t=(e=>{const t=[];return e.forEach((e=>{if(e.options)e.options.forEach((e=>{e.disabled||t.push(e)}));else{const o=e;o.disabled||t.push(o)}})),t})(P&&L?U:K);if(0!==t.length)if("ArrowDown"===e.key)e.preventDefault(),le((e=>{const o=e<t.length-1?e+1:0;return setTimeout((()=>{var e;const t=null===(e=ue.current)||void 0===e?void 0:e.querySelector(`[data-option-index="${o}"]`);t&&t.scrollIntoView({block:"nearest",behavior:"smooth"})}),0),o}));else if("ArrowUp"===e.key)e.preventDefault(),le((e=>{const o=e>0?e-1:t.length-1;return setTimeout((()=>{var e;const t=null===(e=ue.current)||void 0===e?void 0:e.querySelector(`[data-option-index="${o}"]`);t&&t.scrollIntoView({block:"nearest",behavior:"smooth"})}),0),o}));else if("Enter"===e.key&&ie>=0){e.preventDefault();const o=t[ie];o&&(H?H(o):k&&k(o),_(Object.assign(Object.assign({},o),{selected:!o.selected})))}},t=ce.current;if(t)return t.addEventListener("keydown",e),()=>{t.removeEventListener("keydown",e)}}),[ie,P,U,K,L,_]);const de=null!=C?C:b,pe="number"==typeof de?v&&x?de-96:v&&!x||!v&&x?de-48:de:de;n((()=>{const e=null!=O?O:j;if(null===se)ne(e);else if("number"==typeof e)ne(2*e);else if("string"==typeof e&&e.endsWith("px")){const t=2*parseInt(e.replace("px",""));ne(t)}}),[se]);const he=[],fe=(e=>{if(!x||!w&&0!==w)return e;const t=te(e)>=w;return t?e.map((e=>{if(e.options)return Object.assign(Object.assign({},e),{options:e.options.map((e=>Object.assign(Object.assign({},e),{disabled:e.disabled||!e.selected&&t})))});{const o=e;return Object.assign(Object.assign({},o),{disabled:o.disabled||!o.selected&&t})}})):e})((P&&L?U:K).map((e=>{var t,o;if(P&&!L){if(e.options){const t=Object.assign({},e);return t.options=t.options.filter((e=>{var t;return!!(null===(t=e.label)||void 0===t?void 0:t.toLowerCase().includes(P.toLowerCase()))&&(he.push(!P||e.label===P),!0)})),t.options.length>0?t:null}return(null===(t=e.label)||void 0===t?void 0:t.toLowerCase().includes(P.toLowerCase()))||(null===(o=e.searchKey)||void 0===o?void 0:o.toLowerCase().includes(P.toLowerCase()))?(he.push(!P||e.label===P),e):null}return e})).filter((e=>null!==e))),me=!!v&&P&&0===fe.length;return e.jsxs(p,Object.assign({version:M,ref:ce,tabIndex:-1,style:Object.assign(Object.assign({width:oe},Z),{outline:"none"})},{children:[e.jsxs("div",Object.assign({style:{width:se?"50%":"100%",display:"flex",flexDirection:"column",background:"white"}},{children:[!!v&&e.jsx(f,{onSearch:N,version:M}),fe.length||P?e.jsxs(h,Object.assign({minHeight:de,maxHeight:pe,ref:ue},{children:[!!x&&!me&&!E&&e.jsx(u,{version:M,options:P&&L?U:K,onSelect:G}),!y&&me&&e.jsx(m,{isLoading:z,height:pe,searchedString:P,containerWidth:O}),y&&(me||!!he.length&&he.every((e=>!1===e)))&&e.jsx(c,{version:M,isMultiSelect:x,onSelect:Q,searchedString:P}),e.jsx(a,{onInfiniteScroll:T,onDropdownItemClick:H,version:M,onSelect:_,showDescription:function(e,t){re(e&&t?{title:e,description:t}:null)},isMultiSelect:x,options:fe,useDefaultCursor:W,ref:ae,focusedIndex:ie})]})):e.jsx("div",Object.assign({style:{height:de,display:"flex"}},{children:e.jsx(s,Object.assign({},$,{title:(null==$?void 0:$.title)||"No results found",subTitle:(null==$?void 0:$.subTitle)||"Please try again later or contact us at support@bik.ai if you require further assistance."}))})),!!x&&!(!fe.length&&!P)&&"2.0"!==M&&e.jsx(d,{onClear:()=>{J(),null==B||B()},onApply:X,list:P&&L?U:K,buttonText:F,buttonOptions:q})]})),!!se&&e.jsx(l,{title:se.title,description:se.description,version:M})]}))};export{g as OpenedDropdown};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bikdotai/bik-component-library",
3
- "version": "0.0.731-beta.10",
3
+ "version": "0.0.731-beta.12",
4
4
  "description": "Bik Component Library",
5
5
  "repository": {
6
6
  "type": "git",