@bikdotai/bik-component-library 0.0.569-am.4 → 0.0.569-am.5

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