@bikdotai/bik-component-library 0.0.780-beta.4 → 0.0.780
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/assets/icons/refresh-purple.svg.js +1 -0
- package/dist/cjs/components/QueryBuilder/Triggers/EVENTS/components/EventsTrigger.d.ts +1 -1
- package/dist/cjs/components/QueryBuilder/Triggers/EVENTS/selectors/useIGTriggerNameCacheSelector.d.ts +1 -1
- package/dist/cjs/components/QueryBuilder/Triggers/IG/components/IGTrigger.d.ts +1 -1
- package/dist/cjs/components/QueryBuilder/Triggers/IG/selectors/useIGTriggerNameCacheSelector.d.ts +1 -1
- package/dist/cjs/components/QueryBuilder/Triggers/components/BaseTriggerQueryBuilderNode.d.ts +2 -2
- package/dist/cjs/components/dropdown/OpenedDropdown/components/OpennedDropdown.js +1 -1
- package/dist/esm/assets/icons/refresh-purple.svg.js +1 -0
- package/dist/esm/components/QueryBuilder/Triggers/EVENTS/components/EventsTrigger.d.ts +1 -1
- package/dist/esm/components/QueryBuilder/Triggers/EVENTS/selectors/useIGTriggerNameCacheSelector.d.ts +1 -1
- package/dist/esm/components/QueryBuilder/Triggers/IG/components/IGTrigger.d.ts +1 -1
- package/dist/esm/components/QueryBuilder/Triggers/IG/selectors/useIGTriggerNameCacheSelector.d.ts +1 -1
- package/dist/esm/components/QueryBuilder/Triggers/components/BaseTriggerQueryBuilderNode.d.ts +2 -2
- package/dist/esm/components/dropdown/OpenedDropdown/components/OpennedDropdown.js +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";function e(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(r){if("default"!==r){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return e[r]}})}})),t.default=e,Object.freeze(t)}Object.defineProperty(exports,"__esModule",{value:!0});var t,r=e(require("react"));function n(){return n=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},n.apply(this,arguments)}var a=e=>r.createElement("svg",n({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 20"},e),t||(t=r.createElement("path",{fill:"#4B1583",d:"M14.506 1.254a.833.833 0 0 0-1.486-.083l-.936 1.622a7.5 7.5 0 1 0 5.418 7.206.833.833 0 1 0-1.667.001 5.833 5.833 0 1 1-4.617-5.707l-.555.96a.833.833 0 0 0 .816 1.245l3.941-.446a.833.833 0 0 0 .67-1.161l-1.584-3.637Z"})));exports.default=a;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { QueryBuilderNodeProps } from "../../../
|
|
2
|
+
import { QueryBuilderNodeProps } from "../../../types/QueryBuilderNodeProps.type";
|
|
3
3
|
declare const EventsTrigger: React.FC<QueryBuilderNodeProps>;
|
|
4
4
|
export default EventsTrigger;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { QueryBuilderAPIData } from "../../../
|
|
1
|
+
import { QueryBuilderAPIData } from "../../../types/QueryBuilderAPI.type";
|
|
2
2
|
export declare const useIGTriggerNameCacheSelector: () => QueryBuilderAPIData[];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { QueryBuilderNodeProps } from "../../../
|
|
2
|
+
import { QueryBuilderNodeProps } from "../../../types/QueryBuilderNodeProps.type";
|
|
3
3
|
declare const IGTrigger: React.FC<QueryBuilderNodeProps>;
|
|
4
4
|
export default IGTrigger;
|
package/dist/cjs/components/QueryBuilder/Triggers/IG/selectors/useIGTriggerNameCacheSelector.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { QueryBuilderAPIData } from "../../../
|
|
1
|
+
import { QueryBuilderAPIData } from "../../../types/QueryBuilderAPI.type";
|
|
2
2
|
export declare const useIGTriggerNameCacheSelector: () => QueryBuilderAPIData[];
|
package/dist/cjs/components/QueryBuilder/Triggers/components/BaseTriggerQueryBuilderNode.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { DropdownOption } from "../../../dropdown/type";
|
|
3
|
-
import { QueryBuilderProperty } from "../../
|
|
4
|
-
import { QueryBuilderNodeProps } from "../../
|
|
3
|
+
import { QueryBuilderProperty } from "../../types/QueryBuilder.type";
|
|
4
|
+
import { QueryBuilderNodeProps } from "../../types/QueryBuilderNodeProps.type";
|
|
5
5
|
declare const BaseTriggerQueryBuilderNode: React.FC<QueryBuilderNodeProps & {
|
|
6
6
|
cacheKey: string;
|
|
7
7
|
propertyAddBtnText: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("../../../../assets/icons/errorInfo.svg.js"),n=require("react"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("../../../../assets/icons/errorInfo.svg.js"),n=require("../../../../assets/icons/refresh-purple.svg.js"),s=require("react"),r=require("../../../zeroState/ZeroState.js"),o=require("../../../../hooks/useOutside.js"),i=require("../../../../constants/Theme.js"),l=require("../../hooks/useDropdown.js"),u=require("./description/Description.js"),c=require("./menu/FreeFormMenu.js"),a=require("./menu/MenuList.js"),d=require("./menu/SelectAllMenu.js"),p=require("./multiSelect/MultiSelectDropdownBottomBar.js"),h=require("./OpennedDropdown.styled.js"),f=require("./searchbox/SearchBox.js"),g=require("./searchbox/SearchZeroState.js");const b=304,S=290;exports.OpenedDropdown=v=>{let{options:j,isSearchable:O,isMultiSelect:x,maxSelections:m,width:w,allowFreeForm:y,height:C,onClose:L,onSelect:k,onSearch:D,version:q,skipSorting:E,headerRef:M,hideSelectAll:R,primaryButtonText:I,onInfiniteScroll:T,onMultiSelectClear:A,onDropdownItemClick:B,buttonOptions:F,isSearchLoading:H,isOptionsLoading:Z,optionsErrorState:z,disableSearchOptions:P,disableSearchedOptionExcept:V,useDefaultCursor:W,containerStyle:$={},zeroState:_,isDraggable:K=!1,onOptionsReorder:N,hideClearButton:U=!1}=v;var G;const J=s.useCallback((e=>{if(!K||!x)return e;const t=[],n=[];return e.forEach((e=>{if(e.options)n.push(e);else{e.selected?t.push(e):n.push(e)}})),[...t,...n]}),[K,x]),[Q,X]=s.useState((()=>J(j))),Y=s.useRef(Q),ee=s.useRef(!1),te=s.useRef(N);s.useEffect((()=>{X(J(j))}),[j,J]),s.useEffect((()=>{Y.current=Q}),[Q]),s.useEffect((()=>{te.current=N}),[N]),s.useEffect((()=>()=>{ee.current&&te.current&&te.current(Y.current)}),[]);const ne=s.useCallback((e=>{X(e),"2.0"===q?null==N||N(e):ee.current=!0}),[N,q]),se=K?Q:j,{dropdownOptions:re,search:oe,searchedString:ie,searchedOptions:le,searchError:ue,retrySearch:ce,onApplyHandler:ae,selectAllHandler:de,onMultiSelectClear:pe,onFreeFormSelect:he,onMultiSelectApply:fe,latestDropdownOptionsRef:ge,getSelectedOptions:be,getCurrentSelectionCount:Se}=l.useDropdown(q,se,k,E||K,x,D,P,V,m),[ve,je]=s.useState(null!=w?w:S),[Oe,xe]=s.useState(null),[me,we]=s.useState(-1),ye=s.useRef(null),Ce=s.useRef([]),Le=s.useRef(null);o.useOutside(ye,(()=>{if(xe(null),x&&"2.0"===q){const e=be(ge.current);null==L||L(e)}else null==L||L(re)}),[M,Ce]),s.useEffect((()=>{const e=setTimeout((()=>{ye.current&&ye.current.focus({preventScroll:!0})}),0);return()=>clearTimeout(e)}),[]);s.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})(ie&&D?le:re);if(0!==t.length)if("ArrowDown"===e.key)e.preventDefault(),we((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(),we((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&&me>=0){e.preventDefault();const n=t[me];n&&(ae(Object.assign(Object.assign({},n),{selected:!n.selected})),B&&B(n))}},t=ye.current;if(t)return t.addEventListener("keydown",e),()=>{t.removeEventListener("keydown",e)}}),[me,ie,le,re,D,ae,B]);const ke=null!=C?C:b,De="number"==typeof ke?O&&x?ke-96:O&&!x||!O&&x?ke-48:ke:ke;s.useEffect((()=>{const e=null!=w?w:S;if(null===Oe)je(e);else if("number"==typeof e)je(2*e);else if("string"==typeof e&&e.endsWith("px")){const t=2*parseInt(e.replace("px",""));je(t)}}),[Oe]);const qe=[],Ee=(e=>{if(!x||!m&&0!==m)return e;const t=Se(re)>=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 n=e;return Object.assign(Object.assign({},n),{disabled:n.disabled||!n.selected&&t})}})):e})((ie&&D?le:re).map((e=>{var t,n;if(ie&&!D){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(ie.toLowerCase()))&&(qe.push(!ie||e.label===ie),!0)})),t.options.length>0?t:null}return(null===(t=e.label)||void 0===t?void 0:t.toLowerCase().includes(ie.toLowerCase()))||(null===(n=e.searchKey)||void 0===n?void 0:n.toLowerCase().includes(ie.toLowerCase()))?(qe.push(!ie||e.label===ie),e):null}return e})).filter((e=>null!==e))),Me=!!O&&ie&&0===Ee.length,Re=!ie&&!!Z,Ie=!ie&&!!z&&!Re,Te=!(ie||Ee.length||Re||Ie),Ae=Re||Ie||Te,Be=(null==_?void 0:_.title)||"No results found",Fe=(null==_?void 0:_.subTitle)||"Please try again later or contact us at support@bik.ai if you require further assistance.",He=(null==z?void 0:z.title)||"Failed to load options",Ze=(null==z?void 0:z.subTitle)||"Something went wrong while fetching the list. Please try again",ze={buttonText:"Try again",buttonType:"text",size:"small",buttonTextColor:i.COLORS.background.inverseLight,customIconColor:i.COLORS.background.inverseLight,LeadingIcon:n.default},Pe=Object.assign({IconHolderStyle:{background:i.COLORS.background.negative.light},Icon:e.jsx(t.default,{color:i.COLORS.content.negative,width:24,height:24})},z);Pe.actionButton=Object.assign(Object.assign({},ze),null!==(G=null==z?void 0:z.actionButton)&&void 0!==G?G:{});const Ve=Re?void 0:Ie?Pe:_;return e.jsxs(h.OpennedDropdownContainer,Object.assign({version:q,ref:ye,tabIndex:-1,style:Object.assign(Object.assign({width:ve},$),{outline:"none"})},{children:[e.jsxs("div",Object.assign({style:{width:Oe?"50%":"100%",display:"flex",flexDirection:"column",background:"white"}},{children:[!!O&&e.jsx(f.SearchBox,{onSearch:oe,version:q}),Ae?e.jsx("div",Object.assign({style:{height:ke,display:"flex",background:i.COLORS.background.base}},{children:e.jsx(r.ZeroState,Object.assign({},null!=Ve?Ve:{},{isLoading:Re,title:Ie?He:Be,subTitle:Ie?Ze:Fe}))})):e.jsxs(h.MenuListContainer,Object.assign({minHeight:ke,maxHeight:De,ref:Le},{children:[!!x&&!Me&&!R&&e.jsx(d.SelectAllMenu,{version:q,options:ie&&D?le:re,onSelect:de}),!y&&Me&&e.jsx(g.SearchZeroState,{isLoading:H,errorMessage:ue,onRetry:ce,height:De,searchedString:ie,containerWidth:w}),y&&(Me||!!qe.length&&qe.every((e=>!1===e)))&&e.jsx(c.FreeFormMenu,{version:q,isMultiSelect:x,onSelect:he,searchedString:ie}),e.jsx(a.MenuList,{onInfiniteScroll:T,onDropdownItemClick:B,version:q,onSelect:ae,showDescription:function(e,t){xe(e&&t?{title:e,description:t}:null)},isMultiSelect:x,options:Ee,useDefaultCursor:W,ref:Ce,focusedIndex:me,isDraggable:K,onOptionsReorder:ne})]})),!!x&&!Ae&&"2.0"!==q&&e.jsx(p.default,{onClear:()=>{pe(),null==A||A()},onApply:fe,list:ie&&D?le:re,buttonText:I,buttonOptions:F,hideClearButton:U})]})),!!Oe&&e.jsx(u.Description,{title:Oe.title,description:Oe.description,version:q})]}))};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import*as t from"react";var a;function e(){return e=Object.assign?Object.assign.bind():function(t){for(var a=1;a<arguments.length;a++){var e=arguments[a];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])}return t},e.apply(this,arguments)}var r=r=>t.createElement("svg",e({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 20"},r),a||(a=t.createElement("path",{fill:"#4B1583",d:"M14.506 1.254a.833.833 0 0 0-1.486-.083l-.936 1.622a7.5 7.5 0 1 0 5.418 7.206.833.833 0 1 0-1.667.001 5.833 5.833 0 1 1-4.617-5.707l-.555.96a.833.833 0 0 0 .816 1.245l3.941-.446a.833.833 0 0 0 .67-1.161l-1.584-3.637Z"})));export{r as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { QueryBuilderNodeProps } from "../../../
|
|
2
|
+
import { QueryBuilderNodeProps } from "../../../types/QueryBuilderNodeProps.type";
|
|
3
3
|
declare const EventsTrigger: React.FC<QueryBuilderNodeProps>;
|
|
4
4
|
export default EventsTrigger;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { QueryBuilderAPIData } from "../../../
|
|
1
|
+
import { QueryBuilderAPIData } from "../../../types/QueryBuilderAPI.type";
|
|
2
2
|
export declare const useIGTriggerNameCacheSelector: () => QueryBuilderAPIData[];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { QueryBuilderNodeProps } from "../../../
|
|
2
|
+
import { QueryBuilderNodeProps } from "../../../types/QueryBuilderNodeProps.type";
|
|
3
3
|
declare const IGTrigger: React.FC<QueryBuilderNodeProps>;
|
|
4
4
|
export default IGTrigger;
|
package/dist/esm/components/QueryBuilder/Triggers/IG/selectors/useIGTriggerNameCacheSelector.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { QueryBuilderAPIData } from "../../../
|
|
1
|
+
import { QueryBuilderAPIData } from "../../../types/QueryBuilderAPI.type";
|
|
2
2
|
export declare const useIGTriggerNameCacheSelector: () => QueryBuilderAPIData[];
|
package/dist/esm/components/QueryBuilder/Triggers/components/BaseTriggerQueryBuilderNode.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { DropdownOption } from "../../../dropdown/type";
|
|
3
|
-
import { QueryBuilderProperty } from "../../
|
|
4
|
-
import { QueryBuilderNodeProps } from "../../
|
|
3
|
+
import { QueryBuilderProperty } from "../../types/QueryBuilder.type";
|
|
4
|
+
import { QueryBuilderNodeProps } from "../../types/QueryBuilderNodeProps.type";
|
|
5
5
|
declare const BaseTriggerQueryBuilderNode: React.FC<QueryBuilderNodeProps & {
|
|
6
6
|
cacheKey: string;
|
|
7
7
|
propertyAddBtnText: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e,jsxs as t}from"react/jsx-runtime";import o from"../../../../assets/icons/errorInfo.svg.js";import{useCallback as
|
|
1
|
+
import{jsx as e,jsxs as t}from"react/jsx-runtime";import o from"../../../../assets/icons/errorInfo.svg.js";import n from"../../../../assets/icons/refresh-purple.svg.js";import{useCallback as r,useState as i,useRef as s,useEffect as l}from"react";import{ZeroState as c}from"../../../zeroState/ZeroState.js";import{useOutside as a}from"../../../../hooks/useOutside.js";import{COLORS as u}from"../../../../constants/Theme.js";import{useDropdown as d}from"../../hooks/useDropdown.js";import{Description as p}from"./description/Description.js";import{FreeFormMenu as h}from"./menu/FreeFormMenu.js";import{MenuList as g}from"./menu/MenuList.js";import{SelectAllMenu as f}from"./menu/SelectAllMenu.js";import m from"./multiSelect/MultiSelectDropdownBottomBar.js";import{OpennedDropdownContainer as b,MenuListContainer as v}from"./OpennedDropdown.styled.js";import{SearchBox as S}from"./searchbox/SearchBox.js";import{SearchZeroState as j}from"./searchbox/SearchZeroState.js";const O=304,y=290,w=w=>{let{options:x,isSearchable:k,isMultiSelect:C,maxSelections:D,width:L,allowFreeForm:I,height:T,onClose:M,onSelect:E,onSearch:A,version:B,skipSorting:F,headerRef:H,hideSelectAll:R,primaryButtonText:q,onInfiniteScroll:z,onMultiSelectClear:P,onDropdownItemClick:V,buttonOptions:W,isSearchLoading:Z,isOptionsLoading:$,optionsErrorState:K,disableSearchOptions:N,disableSearchedOptionExcept:U,useDefaultCursor:G,containerStyle:J={},zeroState:Q,isDraggable:X=!1,onOptionsReorder:Y,hideClearButton:_=!1}=w;var ee;const te=r((e=>{if(!X||!C)return e;const t=[],o=[];return e.forEach((e=>{if(e.options)o.push(e);else{e.selected?t.push(e):o.push(e)}})),[...t,...o]}),[X,C]),[oe,ne]=i((()=>te(x))),re=s(oe),ie=s(!1),se=s(Y);l((()=>{ne(te(x))}),[x,te]),l((()=>{re.current=oe}),[oe]),l((()=>{se.current=Y}),[Y]),l((()=>()=>{ie.current&&se.current&&se.current(re.current)}),[]);const le=r((e=>{ne(e),"2.0"===B?null==Y||Y(e):ie.current=!0}),[Y,B]),ce=X?oe:x,{dropdownOptions:ae,search:ue,searchedString:de,searchedOptions:pe,searchError:he,retrySearch:ge,onApplyHandler:fe,selectAllHandler:me,onMultiSelectClear:be,onFreeFormSelect:ve,onMultiSelectApply:Se,latestDropdownOptionsRef:je,getSelectedOptions:Oe,getCurrentSelectionCount:ye}=d(B,ce,E,F||X,C,A,N,U,D),[we,xe]=i(null!=L?L:y),[ke,Ce]=i(null),[De,Le]=i(-1),Ie=s(null),Te=s([]),Me=s(null);a(Ie,(()=>{if(Ce(null),C&&"2.0"===B){const e=Oe(je.current);null==M||M(e)}else null==M||M(ae)}),[H,Te]),l((()=>{const e=setTimeout((()=>{Ie.current&&Ie.current.focus({preventScroll:!0})}),0);return()=>clearTimeout(e)}),[]);l((()=>{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})(de&&A?pe:ae);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=Me.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=Me.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&&De>=0){e.preventDefault();const o=t[De];o&&(fe(Object.assign(Object.assign({},o),{selected:!o.selected})),V&&V(o))}},t=Ie.current;if(t)return t.addEventListener("keydown",e),()=>{t.removeEventListener("keydown",e)}}),[De,de,pe,ae,A,fe,V]);const Ee=null!=T?T:O,Ae="number"==typeof Ee?k&&C?Ee-96:k&&!C||!k&&C?Ee-48:Ee:Ee;l((()=>{const e=null!=L?L:y;if(null===ke)xe(e);else if("number"==typeof e)xe(2*e);else if("string"==typeof e&&e.endsWith("px")){const t=2*parseInt(e.replace("px",""));xe(t)}}),[ke]);const Be=[],Fe=(e=>{if(!C||!D&&0!==D)return e;const t=ye(ae)>=D;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})((de&&A?pe:ae).map((e=>{var t,o;if(de&&!A){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(de.toLowerCase()))&&(Be.push(!de||e.label===de),!0)})),t.options.length>0?t:null}return(null===(t=e.label)||void 0===t?void 0:t.toLowerCase().includes(de.toLowerCase()))||(null===(o=e.searchKey)||void 0===o?void 0:o.toLowerCase().includes(de.toLowerCase()))?(Be.push(!de||e.label===de),e):null}return e})).filter((e=>null!==e))),He=!!k&&de&&0===Fe.length,Re=!de&&!!$,qe=!de&&!!K&&!Re,ze=!(de||Fe.length||Re||qe),Pe=Re||qe||ze,Ve=(null==Q?void 0:Q.title)||"No results found",We=(null==Q?void 0:Q.subTitle)||"Please try again later or contact us at support@bik.ai if you require further assistance.",Ze=(null==K?void 0:K.title)||"Failed to load options",$e=(null==K?void 0:K.subTitle)||"Something went wrong while fetching the list. Please try again",Ke={buttonText:"Try again",buttonType:"text",size:"small",buttonTextColor:u.background.inverseLight,customIconColor:u.background.inverseLight,LeadingIcon:n},Ne=Object.assign({IconHolderStyle:{background:u.background.negative.light},Icon:e(o,{color:u.content.negative,width:24,height:24})},K);Ne.actionButton=Object.assign(Object.assign({},Ke),null!==(ee=null==K?void 0:K.actionButton)&&void 0!==ee?ee:{});const Ue=Re?void 0:qe?Ne:Q;return t(b,Object.assign({version:B,ref:Ie,tabIndex:-1,style:Object.assign(Object.assign({width:we},J),{outline:"none"})},{children:[t("div",Object.assign({style:{width:ke?"50%":"100%",display:"flex",flexDirection:"column",background:"white"}},{children:[!!k&&e(S,{onSearch:ue,version:B}),Pe?e("div",Object.assign({style:{height:Ee,display:"flex",background:u.background.base}},{children:e(c,Object.assign({},null!=Ue?Ue:{},{isLoading:Re,title:qe?Ze:Ve,subTitle:qe?$e:We}))})):t(v,Object.assign({minHeight:Ee,maxHeight:Ae,ref:Me},{children:[!!C&&!He&&!R&&e(f,{version:B,options:de&&A?pe:ae,onSelect:me}),!I&&He&&e(j,{isLoading:Z,errorMessage:he,onRetry:ge,height:Ae,searchedString:de,containerWidth:L}),I&&(He||!!Be.length&&Be.every((e=>!1===e)))&&e(h,{version:B,isMultiSelect:C,onSelect:ve,searchedString:de}),e(g,{onInfiniteScroll:z,onDropdownItemClick:V,version:B,onSelect:fe,showDescription:function(e,t){Ce(e&&t?{title:e,description:t}:null)},isMultiSelect:C,options:Fe,useDefaultCursor:G,ref:Te,focusedIndex:De,isDraggable:X,onOptionsReorder:le})]})),!!C&&!Pe&&"2.0"!==B&&e(m,{onClear:()=>{be(),null==P||P()},onApply:Se,list:de&&A?pe:ae,buttonText:q,buttonOptions:W,hideClearButton:_})]})),!!ke&&e(p,{title:ke.title,description:ke.description,version:B})]}))};export{w as OpenedDropdown};
|