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