@bikdotai/bik-component-library 0.0.547-drop.1 → 0.0.547

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.
Files changed (31) hide show
  1. package/dist/cjs/components/QueryBuilder/Triggers/EVENTS/components/EventsTrigger.d.ts +1 -1
  2. package/dist/cjs/components/QueryBuilder/Triggers/EVENTS/selectors/useIGTriggerNameCacheSelector.d.ts +1 -1
  3. package/dist/cjs/components/QueryBuilder/Triggers/IG/components/IGTrigger.d.ts +1 -1
  4. package/dist/cjs/components/QueryBuilder/Triggers/IG/selectors/useIGTriggerNameCacheSelector.d.ts +1 -1
  5. package/dist/cjs/components/QueryBuilder/Triggers/components/BaseTriggerQueryBuilderNode.d.ts +2 -2
  6. package/dist/cjs/components/dropdown/Dropdown.js +1 -1
  7. package/dist/cjs/components/dropdown/OpenedDropdown/components/OpennedDropdown.js +1 -1
  8. package/dist/cjs/components/dropdown/OpenedDropdown/components/menu/MenuItem.d.ts +2 -5
  9. package/dist/cjs/components/dropdown/OpenedDropdown/components/menu/MenuItem.js +1 -1
  10. package/dist/cjs/components/dropdown/OpenedDropdown/components/menu/MenuList.d.ts +2 -6
  11. package/dist/cjs/components/dropdown/OpenedDropdown/components/menu/MenuList.js +1 -1
  12. package/dist/cjs/components/dropdown/OpenedDropdown/utils/iterationOnOptions.d.ts +0 -3
  13. package/dist/cjs/components/dropdown/OpenedDropdown/utils/iterationOnOptions.js +1 -1
  14. package/dist/cjs/components/dropdown/hooks/useDropdown.d.ts +0 -2
  15. package/dist/cjs/components/dropdown/type.d.ts +0 -4
  16. package/dist/esm/components/QueryBuilder/Triggers/EVENTS/components/EventsTrigger.d.ts +1 -1
  17. package/dist/esm/components/QueryBuilder/Triggers/EVENTS/selectors/useIGTriggerNameCacheSelector.d.ts +1 -1
  18. package/dist/esm/components/QueryBuilder/Triggers/IG/components/IGTrigger.d.ts +1 -1
  19. package/dist/esm/components/QueryBuilder/Triggers/IG/selectors/useIGTriggerNameCacheSelector.d.ts +1 -1
  20. package/dist/esm/components/QueryBuilder/Triggers/components/BaseTriggerQueryBuilderNode.d.ts +2 -2
  21. package/dist/esm/components/dropdown/Dropdown.js +1 -1
  22. package/dist/esm/components/dropdown/OpenedDropdown/components/OpennedDropdown.js +1 -1
  23. package/dist/esm/components/dropdown/OpenedDropdown/components/menu/MenuItem.d.ts +2 -5
  24. package/dist/esm/components/dropdown/OpenedDropdown/components/menu/MenuItem.js +1 -1
  25. package/dist/esm/components/dropdown/OpenedDropdown/components/menu/MenuList.d.ts +2 -6
  26. package/dist/esm/components/dropdown/OpenedDropdown/components/menu/MenuList.js +1 -1
  27. package/dist/esm/components/dropdown/OpenedDropdown/utils/iterationOnOptions.d.ts +0 -3
  28. package/dist/esm/components/dropdown/OpenedDropdown/utils/iterationOnOptions.js +1 -1
  29. package/dist/esm/components/dropdown/hooks/useDropdown.d.ts +0 -2
  30. package/dist/esm/components/dropdown/type.d.ts +0 -4
  31. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
1
  import React from 'react';
2
- import { QueryBuilderNodeProps } from "../../../Types/QueryBuilderNodeProps.type";
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 "../../../Types/QueryBuilderAPI.type";
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 "../../../Types/QueryBuilderNodeProps.type";
2
+ import { QueryBuilderNodeProps } from "../../../types/QueryBuilderNodeProps.type";
3
3
  declare const IGTrigger: React.FC<QueryBuilderNodeProps>;
4
4
  export default IGTrigger;
@@ -1,2 +1,2 @@
1
- import { QueryBuilderAPIData } from "../../../Types/QueryBuilderAPI.type";
1
+ import { QueryBuilderAPIData } from "../../../types/QueryBuilderAPI.type";
2
2
  export declare const useIGTriggerNameCacheSelector: () => QueryBuilderAPIData[];
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import { DropdownOption } from "../../../dropdown/type";
3
- import { QueryBuilderProperty } from "../../Types/QueryBuilder.type";
4
- import { QueryBuilderNodeProps } from "../../Types/QueryBuilderNodeProps.type";
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("../../_virtual/_tslib.js"),t=require("react/jsx-runtime"),n=require("react"),r=require("../../constants/Theme.js"),o=require("../../assets/icons/chevronDown.svg.js"),i=require("../input/Input.js"),s=require("../input/context/InputStyleProvider.js"),l=require("./DropdownPopover/index.js"),a=require("./OpenedDropdown/utils/iterationOnOptions.js");function d(){}const u=u=>{var c,p,h,{placeHolder:v,size:g,onSelect:j,defaultOptions:f,disabled:x,noErrorHint:b,placeHolderHeight:w,showPlaceholderWhenSelected:O=!1,inputStyle:S={}}=u,y=e.__rest(u,["placeHolder","size","onSelect","defaultOptions","disabled","noErrorHint","placeHolderHeight","showPlaceholderWhenSelected","inputStyle"]);const[H,m]=n.useState(!1),q=null!=g?g:"default",D=n.useRef(),[E,I]=n.useState(null!=f?f:[]);n.useEffect((()=>{var e;const t=[];null===(e=null==y?void 0:y.options)||void 0===e||e.forEach((e=>{e.options?e.options.forEach((e=>{e.selected&&t.push(Object.assign(Object.assign({},e),{label:e.label}))})):e.selected&&t.push(e)})),I([...t])}),[y.options]),n.useEffect((()=>{f&&I([...f])}),[f]);const P=a.getSelectedOptionsAsText(E);return t.jsx(s.InputStyleContext.Provider,Object.assign({value:{InputWrapper:Object.assign({height:w||("small"===q?32:48),width:null!==(p=null!==(c=y.buttonWidth)&&void 0!==c?c:y.width)&&void 0!==p?p:"100%",zIndex:1,cursor:"pointer",padding:"6px 8px"},S),input:{minHeight:"100%"}}},{children:t.jsx(l.DropdownPopover,Object.assign({ref:D,onSelect:function(e){Array.isArray(e)?I([...e]):I([e]),null==j||j(e)},disabled:x,onDropdownVisbilityChange:e=>m(e)},y,{children:t.jsx(i.Input,{version:y.version,noErrorHint:b,state:x?"disabled":"none",value:O?v:null!=P?P:"",errorMessage:y.error,variant:q,placeholder:null!=v?v:"Select an option",width:null!==(h=y.width)&&void 0!==h?h:"100%",onChangeText:d,rightIcon:{icon:()=>t.jsx(o.default,{style:{transform:H?"rotate(180deg)":"rotate(0deg)"},onClick:d,width:"small"===q?20:24,height:"small"===q?20:24,color:r.COLORS.content.primary})},truncateText:!0})}))}))};u.displayName="Dropdown",exports.Dropdown=u;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../_virtual/_tslib.js"),t=require("react/jsx-runtime"),n=require("react"),r=require("../../constants/Theme.js"),o=require("../../assets/icons/chevronDown.svg.js"),i=require("../input/Input.js"),l=require("../input/context/InputStyleProvider.js"),s=require("./DropdownPopover/index.js");function a(){}const d=d=>{var u,c,p,{placeHolder:h,size:v,onSelect:g,defaultOptions:j,disabled:b,noErrorHint:f,placeHolderHeight:x,showPlaceholderWhenSelected:w=!1,inputStyle:S={}}=d,y=e.__rest(d,["placeHolder","size","onSelect","defaultOptions","disabled","noErrorHint","placeHolderHeight","showPlaceholderWhenSelected","inputStyle"]);const[m,H]=n.useState(!1),O=null!=v?v:"default",q=n.useRef(),[E,I]=n.useState(null!=j?j:[]);n.useEffect((()=>{var e;const t=[];null===(e=null==y?void 0:y.options)||void 0===e||e.forEach((e=>{e.options?e.options.forEach((e=>{e.selected&&t.push(Object.assign(Object.assign({},e),{label:e.label}))})):e.selected&&t.push(e)})),I([...t])}),[y.options]),n.useEffect((()=>{j&&I([...j])}),[j]);const P=E.length?E.map((e=>e.label)).join(", "):void 0;return t.jsx(l.InputStyleContext.Provider,Object.assign({value:{InputWrapper:Object.assign({height:x||("small"===O?32:48),width:null!==(c=null!==(u=y.buttonWidth)&&void 0!==u?u:y.width)&&void 0!==c?c:"100%",zIndex:1,cursor:"pointer",padding:"6px 8px"},S),input:{minHeight:"100%"}}},{children:t.jsx(s.DropdownPopover,Object.assign({ref:q,onSelect:function(e){Array.isArray(e)?I([...e]):I([e]),null==g||g(e)},disabled:b,onDropdownVisbilityChange:e=>H(e)},y,{children:t.jsx(i.Input,{version:y.version,noErrorHint:f,state:b?"disabled":"none",value:w?h:null!=P?P:"",errorMessage:y.error,variant:O,placeholder:null!=h?h:"Select an option",width:null!==(p=y.width)&&void 0!==p?p:"100%",onChangeText:a,rightIcon:{icon:()=>t.jsx(o.default,{style:{transform:m?"rotate(180deg)":"rotate(0deg)"},onClick:a,width:"small"===O?20:24,height:"small"===O?20:24,color:r.COLORS.content.primary})},truncateText:!0})}))}))};d.displayName="Dropdown",exports.Dropdown=d;
@@ -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:w,allowFreeForm:v,height:b,onClose:m,onSelect:y,onSearch:M,version:O,skipSorting:q,headerRef:C,hideSelectAll:D,primaryButtonText:L,onInfiniteScroll:F,onMultiSelectClear:k,onDropdownItemClick:A}=j;const{dropdownOptions:B,search:I,searchedString:H,searchedOptions:Z,onApplyHandler:R,selectAllHandler:T,onMultiSelectClear:P,onFreeFormSelect:_,onMultiSelectApply:z,latestDropdownOptionsRef:E,getSelectedOptions:K}=o.useDropdown(O,f,y,q,g,M),[N,W]=t.useState(null!=w?w:S),[G,J]=t.useState(null),Q=t.useRef(null);r.useOutside(Q,(()=>{if(J(null),g&&"2.0"===O){const e=K(E.current);null==m||m(e)}else null==m||m(B)}),[C]);const U=null!=b?b:h,V="number"==typeof U?x&&g?U-96:x&&!g||!x&&g?U-48:U:U;t.useEffect((()=>{const e=null!=w?w:S;if(null===G)W(e);else if("number"==typeof e)W(2*e);else if("string"==typeof e&&e.endsWith("px")){const t=2*parseInt(e.replace("px",""));W(t)}}),[G]);const X=[],Y=(H&&M?Z:B).map((e=>{var t,n;if(H&&!M){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(H.toLowerCase()))&&(X.push(!H||e.label===H),!0)})),t.options.length>0?t:null}return(null===(t=e.label)||void 0===t?void 0:t.toLowerCase().includes(H.toLowerCase()))||(null===(n=e.searchKey)||void 0===n?void 0:n.toLowerCase().includes(H.toLowerCase()))?(X.push(!H||e.label===H),e):null}return e})).filter((e=>null!==e)),$=!!x&&H&&0===Y.length;return e.jsxs(a.OpennedDropdownContainer,Object.assign({version:O,ref:Q,style:{width:N}},{children:[e.jsxs("div",Object.assign({style:{width:G?"50%":"100%",display:"flex",flexDirection:"column",background:"white"}},{children:[!!x&&e.jsx(d.SearchBox,{onSearch:I,version:O}),Y.length||H?e.jsxs(a.MenuListContainer,Object.assign({minHeight:U,maxHeight:V},{children:[!!g&&!$&&!D&&e.jsx(u.SelectAllMenu,{version:O,options:H&&M?Z:B,onSelect:T}),!v&&$&&e.jsx(p.SearchZeroState,{height:V,searchedString:H}),v&&($||!!X.length&&X.every((e=>!1===e)))&&e.jsx(i.FreeFormMenu,{version:O,isMultiSelect:g,onSelect:_,searchedString:H}),e.jsx(l.MenuList,{onInfiniteScroll:F,onDropdownItemClick:A,version:O,onSelect:R,showDescription:function(e,t){J(e&&t?{title:e,description:t}:null)},isMultiSelect:g,options:Y})]})):e.jsx("div",Object.assign({style:{height:U,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&&!(!Y.length&&!H)&&"2.0"!==O&&e.jsx(c.default,{onClear:()=>{P(),null==k||k()},onApply:z,list:H&&M?Z:B,buttonText:L})]})),!!G&&e.jsx(s.Description,{title:G.title,description:G.description,version:O})]}))};
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"),d=require("./searchbox/SearchBox.js"),p=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,headerRef:C,hideSelectAll:D,primaryButtonText:L}=j;const{dropdownOptions:F,search:A,searchedString:k,searchedOptions:B,onApplyHandler:H,selectAllHandler:Z,onMultiSelectClear:R,onFreeFormSelect:T,onMultiSelectApply:P,latestDropdownOptionsRef:_,getSelectedOptions:z}=n.useDropdown(q,x,m,M,g,O),[E,I]=t.useState(null!=v?v:S),[K,N]=t.useState(null),W=t.useRef(null);s.useOutside(W,(()=>{if(N(null),g&&"2.0"===q){const e=z(_.current);null==y||y(e)}else null==y||y(F)}),[C]);const G=null!=b?b:h,J="number"==typeof G?f&&g?G-96:f&&!g||!f&&g?G-48:G:G;t.useEffect((()=>{const e=null!=v?v:S;if(null===K)I(e);else if("number"==typeof e)I(2*e);else if("string"==typeof e&&e.endsWith("px")){const t=2*parseInt(e.replace("px",""));I(t)}}),[K]);const Q=[],U=(k&&O?B:F).map((e=>{var t,r;if(k&&!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(k.toLowerCase()))&&(Q.push(!k||e.label===k),!0)})),t.options.length>0?t:null}return(null===(t=e.label)||void 0===t?void 0:t.toLowerCase().includes(k.toLowerCase()))||(null===(r=e.searchKey)||void 0===r?void 0:r.toLowerCase().includes(k.toLowerCase()))?(Q.push(!k||e.label===k),e):null}return e})).filter((e=>null!==e)),V=!!f&&k&&0===U.length;return e.jsxs(a.OpennedDropdownContainer,Object.assign({version:q,ref:W,style:{width:E}},{children:[e.jsxs("div",Object.assign({style:{width:K?"50%":"100%",display:"flex",flexDirection:"column",background:"white"}},{children:[!!f&&e.jsx(d.SearchBox,{onSearch:A,version:q}),U.length||k?e.jsxs(a.MenuListContainer,Object.assign({minHeight:G,maxHeight:J},{children:[!!g&&!V&&!D&&e.jsx(u.SelectAllMenu,{version:q,options:k&&O?B:F,onSelect:Z}),!w&&V&&e.jsx(p.SearchZeroState,{height:J,searchedString:k}),w&&(V||!!Q.length&&Q.every((e=>!1===e)))&&e.jsx(i.FreeFormMenu,{version:q,isMultiSelect:g,onSelect:T,searchedString:k}),e.jsx(l.MenuList,{version:q,onSelect:H,showDescription:function(e,t){N(e&&t?{title:e,description:t}:null)},isMultiSelect:g,options:U})]})):e.jsx("div",Object.assign({style:{height:G,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&&!(!U.length&&!k)&&"2.0"!==q&&e.jsx(c.default,{onClear:R,onApply:P,list:k&&O?B:F,buttonText:L})]})),!!K&&e.jsx(o.Description,{title:K.title,description:K.description,version:q})]}))};
@@ -1,13 +1,10 @@
1
1
  import React from 'react';
2
2
  import { MultiSelectOption, SingleOption } from '../../../type';
3
- interface MenuItemProps {
3
+ export declare const MenuItem: React.FC<{
4
4
  option: SingleOption | MultiSelectOption;
5
5
  isMultiSelect?: boolean;
6
6
  showDescription: (title?: string, description?: string) => void;
7
7
  onSelect: (option: SingleOption) => void;
8
- onDropdownItemClick?: (option: SingleOption) => void;
9
8
  last?: boolean;
10
9
  version?: '1.0' | '2.0';
11
- }
12
- export declare const MenuItem: React.FC<MenuItemProps>;
13
- export {};
10
+ }>;
@@ -2,4 +2,4 @@
2
2
  padding: ${e=>"2.0"===e.version?"8px 12px":"14px 16px"} !important;
3
3
  cursor: pointer;
4
4
  margin-top: ${e=>"2.0"===e.version?"2px":"0"};
5
- `;exports.MenuItem=t=>{let{option:i,isMultiSelect:l,showDescription:a,onSelect:d,last:u,version:p,onDropdownItemClick:m}=t;var x;function g(e){i.disabled||d(Object.assign(Object.assign({},i),{selected:e}))}return e.jsx(c,{version:p,style:u?{borderBottom:0}:{},onClick:e=>{e.preventDefault(),g(!i.selected),null==m||m(i)},onMouseOver:function(){i.description?a(i.label,i.description):a()},listItem:{value:i.value,label:i.label},subText:i.subText,leadingIcon:l?e.jsxs("div",Object.assign({style:{display:"flex",alignContent:"center",justifyContent:"center",gap:8}},{children:[e.jsx(n.CheckBox,{size:"2.0"===p?"SMALL":"DEFAULT",isDisabled:null!==(x=i.disabled)&&void 0!==x&&x,isChecked:!!i.selected,onValueChange:g}),e.jsx("div",Object.assign({style:{marginRight:"-4px"}},{children:i.leadingIcon}))]})):i.leadingIcon?e.jsx(e.Fragment,{children:i.leadingIcon}):e.jsx(e.Fragment,{}),customComponent:i.customComponent,trailingIcon:i.isFreeForm?e.jsx(o.FreeFormContainer,{children:e.jsx(s.BodyCaption,Object.assign({style:{color:r.COLORS.content.secondary}},{children:"Freeform"}))}):i.trailingIcon?e.jsx(e.Fragment,{children:i.trailingIcon}):e.jsx(e.Fragment,{}),variant:i.disabled?"inactive":i.selected?"selected":"default"})};
5
+ `;exports.MenuItem=t=>{let{option:i,isMultiSelect:l,showDescription:a,onSelect:d,last:u,version:p}=t;var x;function g(e){i.disabled||d(Object.assign(Object.assign({},i),{selected:e}))}return e.jsx(c,{version:p,style:u?{borderBottom:0}:{},onClick:e=>{e.preventDefault(),g(!i.selected)},onMouseOver:function(){i.description?a(i.label,i.description):a()},listItem:{value:i.value,label:i.label},subText:i.subText,leadingIcon:l?e.jsxs("div",Object.assign({style:{display:"flex",alignContent:"center",justifyContent:"center",gap:8}},{children:[e.jsx(n.CheckBox,{size:"2.0"===p?"SMALL":"DEFAULT",isDisabled:null!==(x=i.disabled)&&void 0!==x&&x,isChecked:!!i.selected,onValueChange:g}),e.jsx("div",Object.assign({style:{marginRight:"-4px"}},{children:i.leadingIcon}))]})):i.leadingIcon?e.jsx(e.Fragment,{children:i.leadingIcon}):e.jsx(e.Fragment,{}),customComponent:i.customComponent,trailingIcon:i.isFreeForm?e.jsx(o.FreeFormContainer,{children:e.jsx(s.BodyCaption,Object.assign({style:{color:r.COLORS.content.secondary}},{children:"Freeform"}))}):i.trailingIcon?e.jsx(e.Fragment,{children:i.trailingIcon}):e.jsx(e.Fragment,{}),variant:i.disabled?"inactive":i.selected?"selected":"default"})};
@@ -1,13 +1,9 @@
1
1
  import React from 'react';
2
2
  import { DropdownOption, SingleOption } from '../../../type';
3
- interface MenuListProps {
3
+ export declare const MenuList: React.FC<{
4
4
  options: DropdownOption[];
5
5
  isMultiSelect?: boolean;
6
6
  showDescription: (title?: string, description?: string) => void;
7
7
  onSelect: (optionSelect: SingleOption) => void;
8
8
  version?: '1.0' | '2.0';
9
- onInfiniteScroll?: () => void;
10
- onDropdownItemClick?: (option: DropdownOption) => void;
11
- }
12
- export declare const MenuList: React.FC<MenuListProps>;
13
- export {};
9
+ }>;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),n=require("react"),t=require("./MenuItem.js"),r=require("./MenuList.styled.js");exports.MenuList=s=>{let{options:i,isMultiSelect:o,showDescription:c,onSelect:l,version:u,onInfiniteScroll:a,onDropdownItemClick:p}=s;const d=n.useRef(null),j=n.useRef(null),g=n.useCallback((()=>{d.current&&d.current.disconnect(),d.current=new IntersectionObserver((e=>{e[0].isIntersecting&&(null==a||a())})),j.current&&d.current.observe(j.current)}),[a]);return n.useEffect((()=>(g(),()=>{d.current&&d.current.disconnect()})),[g,i]),e.jsx(e.Fragment,{children:i.map(((n,s)=>{const a=s===i.length-1;if(n.options){const i=n;return e.jsxs("div",Object.assign({style:{marginTop:"2.0"===u?2:0}},{children:[e.jsxs(r.StyledGroupedLabel,Object.assign({version:u},{children:[i.leadingIcon?e.jsx("span",Object.assign({style:{marginRight:8}},{children:i.leadingIcon})):e.jsx(e.Fragment,{}),i.label]})),i.options.map(((n,r)=>e.jsx(t.MenuItem,{version:u,last:r===i.options.length-1,onSelect:l,showDescription:c,onDropdownItemClick:p,isMultiSelect:o,option:n},`${s}-${r}`)))]}),s)}return e.jsxs("div",{children:[e.jsx(t.MenuItem,{version:u,last:a,onSelect:l,showDescription:c,onDropdownItemClick:p,isMultiSelect:o,option:n},s),a?e.jsx("span",{ref:j}):null]},s)}))})};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("./MenuItem.js"),s=require("./MenuList.styled.js");exports.MenuList=n=>{let{options:i,isMultiSelect:r,showDescription:o,onSelect:l,version:c}=n;return e.jsx(e.Fragment,{children:i.map(((n,a)=>{const u=a===i.length-1;if(n.options){const i=n;return e.jsxs("div",Object.assign({style:{marginTop:"2.0"===c?2:0}},{children:[e.jsxs(s.StyledGroupedLabel,Object.assign({version:c},{children:[i.leadingIcon?e.jsx("span",Object.assign({style:{marginRight:8}},{children:i.leadingIcon})):e.jsx(e.Fragment,{}),i.label]})),i.options.map(((s,n)=>e.jsx(t.MenuItem,{version:c,last:n===i.options.length-1,onSelect:l,showDescription:o,isMultiSelect:r,option:s},`${a}-${n}`)))]}),a)}return e.jsx(t.MenuItem,{version:c,last:u,onSelect:l,showDescription:o,isMultiSelect:r,option:n},a)}))})};
@@ -12,7 +12,6 @@ export declare function iterateOnOptions(options: DropdownOption[], newVal: Part
12
12
  leadingIcon?: JSX.Element | undefined;
13
13
  customComponent?: JSX.Element | undefined;
14
14
  searchKey?: string | undefined;
15
- selectedLabel?: string | undefined;
16
15
  } | {
17
16
  label?: string | undefined;
18
17
  value?: string | undefined;
@@ -25,8 +24,6 @@ export declare function iterateOnOptions(options: DropdownOption[], newVal: Part
25
24
  leadingIcon?: JSX.Element | undefined;
26
25
  customComponent?: JSX.Element | undefined;
27
26
  searchKey?: string | undefined;
28
- selectedLabel?: string | undefined;
29
27
  options: SingleOption[];
30
28
  })[];
31
29
  export declare function iterateOnOptionsRaw(options: DropdownOption[], cb: (option: SingleOption) => void): void;
32
- export declare function getSelectedOptionsAsText(selectedOption: DropdownOption[]): string | undefined;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.getSelectedOptionsAsText=function(t){if(console.log(t),t&&t.length)return t.map((t=>{var e;const n=t;return null!==(e=n.selectedLabel)&&void 0!==e?e:n.label})).join(", ")},exports.iterateOnOptions=function(t,e,n){return t.map((t=>{if(t.options){const s=t.options.map((t=>!n||n(t)?Object.assign(Object.assign({},t),e):Object.assign({},t)));return Object.assign(Object.assign({},t),{options:[...s]})}return!n||n(t)?Object.assign(Object.assign({},t),e):Object.assign({},t)}))},exports.iterateOnOptionsRaw=function(t,e){t.forEach((t=>{t.options?t.options.forEach(e):e(t)}))};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.iterateOnOptions=function(t,s,e){return t.map((t=>{if(t.options){const n=t.options.map((t=>!e||e(t)?Object.assign(Object.assign({},t),s):Object.assign({},t)));return Object.assign(Object.assign({},t),{options:[...n]})}return!e||e(t)?Object.assign(Object.assign({},t),s):Object.assign({},t)}))},exports.iterateOnOptionsRaw=function(t,s){t.forEach((t=>{t.options?t.options.forEach(s):s(t)}))};
@@ -19,7 +19,6 @@ export declare const useDropdown: (version: string | undefined, options: Dropdow
19
19
  leadingIcon?: JSX.Element | undefined;
20
20
  customComponent?: JSX.Element | undefined;
21
21
  searchKey?: string | undefined;
22
- selectedLabel?: string | undefined;
23
22
  } | {
24
23
  label?: string | undefined;
25
24
  value?: string | undefined;
@@ -32,7 +31,6 @@ export declare const useDropdown: (version: string | undefined, options: Dropdow
32
31
  leadingIcon?: JSX.Element | undefined;
33
32
  customComponent?: JSX.Element | undefined;
34
33
  searchKey?: string | undefined;
35
- selectedLabel?: string | undefined;
36
34
  options: SingleOption[];
37
35
  })[] | undefined;
38
36
  selectAllHandler: (newState: SelectAllCheckboxState) => void;
@@ -19,9 +19,6 @@ export interface OpenDropdownProps {
19
19
  headerRef?: any;
20
20
  hideSelectAll?: boolean;
21
21
  primaryButtonText?: string;
22
- onInfiniteScroll?: () => void;
23
- onMultiSelectClear?: () => void;
24
- onDropdownItemClick?: (option: DropdownOption) => void;
25
22
  }
26
23
  export type GroupedOption = {
27
24
  label?: string;
@@ -40,7 +37,6 @@ export type SingleOption = {
40
37
  leadingIcon?: JSX.Element;
41
38
  customComponent?: JSX.Element;
42
39
  searchKey?: string;
43
- selectedLabel?: string;
44
40
  };
45
41
  export type MultiSelectOption = SingleOption;
46
42
  export type DropdownOption = MultiSelectOption | SingleOption | GroupedOption;
@@ -1,4 +1,4 @@
1
1
  import React from 'react';
2
- import { QueryBuilderNodeProps } from "../../../Types/QueryBuilderNodeProps.type";
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 "../../../Types/QueryBuilderAPI.type";
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 "../../../Types/QueryBuilderNodeProps.type";
2
+ import { QueryBuilderNodeProps } from "../../../types/QueryBuilderNodeProps.type";
3
3
  declare const IGTrigger: React.FC<QueryBuilderNodeProps>;
4
4
  export default IGTrigger;
@@ -1,2 +1,2 @@
1
- import { QueryBuilderAPIData } from "../../../Types/QueryBuilderAPI.type";
1
+ import { QueryBuilderAPIData } from "../../../types/QueryBuilderAPI.type";
2
2
  export declare const useIGTriggerNameCacheSelector: () => QueryBuilderAPIData[];
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import { DropdownOption } from "../../../dropdown/type";
3
- import { QueryBuilderProperty } from "../../Types/QueryBuilder.type";
4
- import { QueryBuilderNodeProps } from "../../Types/QueryBuilderNodeProps.type";
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{__rest as e}from"../../_virtual/_tslib.js";import{jsx as o}from"react/jsx-runtime";import{useState as t,useRef as n,useEffect as r}from"react";import{COLORS as i}from"../../constants/Theme.js";import l from"../../assets/icons/chevronDown.svg.js";import{Input as s}from"../input/Input.js";import{InputStyleContext as a}from"../input/context/InputStyleProvider.js";import{DropdownPopover as d}from"./DropdownPopover/index.js";import{getSelectedOptionsAsText as p}from"./OpenedDropdown/utils/iterationOnOptions.js";function c(){}const u=u=>{var h,m,f,{placeHolder:g,size:v,onSelect:b,defaultOptions:j,disabled:w,noErrorHint:H,placeHolderHeight:O,showPlaceholderWhenSelected:x=!1,inputStyle:y={}}=u,S=e(u,["placeHolder","size","onSelect","defaultOptions","disabled","noErrorHint","placeHolderHeight","showPlaceholderWhenSelected","inputStyle"]);const[D,E]=t(!1),I=null!=v?v:"default",P=n(),[W,z]=t(null!=j?j:[]);r((()=>{var e;const o=[];null===(e=null==S?void 0:S.options)||void 0===e||e.forEach((e=>{e.options?e.options.forEach((e=>{e.selected&&o.push(Object.assign(Object.assign({},e),{label:e.label}))})):e.selected&&o.push(e)})),z([...o])}),[S.options]),r((()=>{j&&z([...j])}),[j]);const C=p(W);return o(a.Provider,Object.assign({value:{InputWrapper:Object.assign({height:O||("small"===I?32:48),width:null!==(m=null!==(h=S.buttonWidth)&&void 0!==h?h:S.width)&&void 0!==m?m:"100%",zIndex:1,cursor:"pointer",padding:"6px 8px"},y),input:{minHeight:"100%"}}},{children:o(d,Object.assign({ref:P,onSelect:function(e){Array.isArray(e)?z([...e]):z([e]),null==b||b(e)},disabled:w,onDropdownVisbilityChange:e=>E(e)},S,{children:o(s,{version:S.version,noErrorHint:H,state:w?"disabled":"none",value:x?g:null!=C?C:"",errorMessage:S.error,variant:I,placeholder:null!=g?g:"Select an option",width:null!==(f=S.width)&&void 0!==f?f:"100%",onChangeText:c,rightIcon:{icon:()=>o(l,{style:{transform:D?"rotate(180deg)":"rotate(0deg)"},onClick:c,width:"small"===I?20:24,height:"small"===I?20:24,color:i.content.primary})},truncateText:!0})}))}))};u.displayName="Dropdown";export{u as Dropdown};
1
+ import{__rest as e}from"../../_virtual/_tslib.js";import{jsx as o}from"react/jsx-runtime";import{useState as t,useRef as n,useEffect as r}from"react";import{COLORS as i}from"../../constants/Theme.js";import l from"../../assets/icons/chevronDown.svg.js";import{Input as s}from"../input/Input.js";import{InputStyleContext as a}from"../input/context/InputStyleProvider.js";import{DropdownPopover as d}from"./DropdownPopover/index.js";function p(){}const c=c=>{var u,h,m,{placeHolder:g,size:v,onSelect:f,defaultOptions:b,disabled:j,noErrorHint:w,placeHolderHeight:H,showPlaceholderWhenSelected:x=!1,inputStyle:y={}}=c,S=e(c,["placeHolder","size","onSelect","defaultOptions","disabled","noErrorHint","placeHolderHeight","showPlaceholderWhenSelected","inputStyle"]);const[O,E]=t(!1),I=null!=v?v:"default",P=n(),[D,W]=t(null!=b?b:[]);r((()=>{var e;const o=[];null===(e=null==S?void 0:S.options)||void 0===e||e.forEach((e=>{e.options?e.options.forEach((e=>{e.selected&&o.push(Object.assign(Object.assign({},e),{label:e.label}))})):e.selected&&o.push(e)})),W([...o])}),[S.options]),r((()=>{b&&W([...b])}),[b]);const z=D.length?D.map((e=>e.label)).join(", "):void 0;return o(a.Provider,Object.assign({value:{InputWrapper:Object.assign({height:H||("small"===I?32:48),width:null!==(h=null!==(u=S.buttonWidth)&&void 0!==u?u:S.width)&&void 0!==h?h:"100%",zIndex:1,cursor:"pointer",padding:"6px 8px"},y),input:{minHeight:"100%"}}},{children:o(d,Object.assign({ref:P,onSelect:function(e){Array.isArray(e)?W([...e]):W([e]),null==f||f(e)},disabled:j,onDropdownVisbilityChange:e=>E(e)},S,{children:o(s,{version:S.version,noErrorHint:w,state:j?"disabled":"none",value:x?g:null!=z?z:"",errorMessage:S.error,variant:I,placeholder:null!=g?g:"Select an option",width:null!==(m=S.width)&&void 0!==m?m:"100%",onChangeText:p,rightIcon:{icon:()=>o(l,{style:{transform:O?"rotate(180deg)":"rotate(0deg)"},onClick:p,width:"small"===I?20:24,height:"small"===I?20:24,color:i.content.primary})},truncateText:!0})}))}))};c.displayName="Dropdown";export{c as Dropdown};
@@ -1 +1 @@
1
- import{jsxs as e,jsx as t}from"react/jsx-runtime";import{useState as o,useRef as n,useEffect as r}from"react";import{ZeroState as l}from"../../../zeroState/ZeroState.js";import{useOutside as i}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 m,MenuListContainer as h}from"./OpennedDropdown.styled.js";import{SearchBox as f}from"./searchbox/SearchBox.js";import{SearchZeroState as S}from"./searchbox/SearchZeroState.js";const g=304,w=290,b=b=>{let{options:v,isSearchable:j,isMultiSelect:y,width:x,allowFreeForm:C,height:O,onClose:M,onSelect:D,onSearch:k,version:L,skipSorting:A,headerRef:F,hideSelectAll:I,primaryButtonText:B,onInfiniteScroll:H,onMultiSelectClear:T,onDropdownItemClick:R}=b;const{dropdownOptions:Z,search:q,searchedString:z,searchedOptions:K,onApplyHandler:N,selectAllHandler:P,onMultiSelectClear:W,onFreeFormSelect:E,onMultiSelectApply:G,latestDropdownOptionsRef:J,getSelectedOptions:Q}=s(L,v,D,A,y,k),[U,V]=o(null!=x?x:w),[X,Y]=o(null),$=n(null);i($,(()=>{if(Y(null),y&&"2.0"===L){const e=Q(J.current);null==M||M(e)}else null==M||M(Z)}),[F]);const _=null!=O?O:g,ee="number"==typeof _?j&&y?_-96:j&&!y||!j&&y?_-48:_:_;r((()=>{const e=null!=x?x:w;if(null===X)V(e);else if("number"==typeof e)V(2*e);else if("string"==typeof e&&e.endsWith("px")){const t=2*parseInt(e.replace("px",""));V(t)}}),[X]);const te=[],oe=(z&&k?K:Z).map((e=>{var t,o;if(z&&!k){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()))&&(te.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()))?(te.push(!z||e.label===z),e):null}return e})).filter((e=>null!==e)),ne=!!j&&z&&0===oe.length;return e(m,Object.assign({version:L,ref:$,style:{width:U}},{children:[e("div",Object.assign({style:{width:X?"50%":"100%",display:"flex",flexDirection:"column",background:"white"}},{children:[!!j&&t(f,{onSearch:q,version:L}),oe.length||z?e(h,Object.assign({minHeight:_,maxHeight:ee},{children:[!!y&&!ne&&!I&&t(u,{version:L,options:z&&k?K:Z,onSelect:P}),!C&&ne&&t(S,{height:ee,searchedString:z}),C&&(ne||!!te.length&&te.every((e=>!1===e)))&&t(a,{version:L,isMultiSelect:y,onSelect:E,searchedString:z}),t(p,{onInfiniteScroll:H,onDropdownItemClick:R,version:L,onSelect:N,showDescription:function(e,t){Y(e&&t?{title:e,description:t}:null)},isMultiSelect:y,options:oe})]})):t("div",Object.assign({style:{height:_,display:"flex"}},{children:t(l,{title:"No results found",subTitle:"Please try again later or contact us at support@bik.ai if you require further assistance."})})),!!y&&!(!oe.length&&!z)&&"2.0"!==L&&t(d,{onClear:()=>{W(),null==T||T()},onApply:G,list:z&&k?K:Z,buttonText:B})]})),!!X&&t(c,{title:X.title,description:X.description,version:L})]}))};export{b as OpenedDropdown};
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,headerRef:k,hideSelectAll:B,primaryButtonText:H}=v;const{dropdownOptions:T,search:R,searchedString:Z,searchedOptions:q,onApplyHandler:z,selectAllHandler:I,onMultiSelectClear:K,onFreeFormSelect:N,onMultiSelectApply:P,latestDropdownOptionsRef:W,getSelectedOptions:E}=s(A,j,D,F,y,L),[G,J]=o(null!=x?x:b),[Q,U]=o(null),V=r(null);l(V,(()=>{if(U(null),y&&"2.0"===A){const e=E(W.current);null==M||M(e)}else null==M||M(T)}),[k]);const X=null!=C?C:g,Y="number"==typeof X?w&&y?X-96:w&&!y||!w&&y?X-48:X:X;i((()=>{const e=null!=x?x:b;if(null===Q)J(e);else if("number"==typeof e)J(2*e);else if("string"==typeof e&&e.endsWith("px")){const t=2*parseInt(e.replace("px",""));J(t)}}),[Q]);const $=[],_=(Z&&L?q:T).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()))&&($.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()))?($.push(!Z||e.label===Z),e):null}return e})).filter((e=>null!==e)),ee=!!w&&Z&&0===_.length;return e(h,Object.assign({version:A,ref:V,style:{width:G}},{children:[e("div",Object.assign({style:{width:Q?"50%":"100%",display:"flex",flexDirection:"column",background:"white"}},{children:[!!w&&t(f,{onSearch:R,version:A}),_.length||Z?e(m,Object.assign({minHeight:X,maxHeight:Y},{children:[!!y&&!ee&&!B&&t(u,{version:A,options:Z&&L?q:T,onSelect:I}),!O&&ee&&t(S,{height:Y,searchedString:Z}),O&&(ee||!!$.length&&$.every((e=>!1===e)))&&t(a,{version:A,isMultiSelect:y,onSelect:N,searchedString:Z}),t(p,{version:A,onSelect:z,showDescription:function(e,t){U(e&&t?{title:e,description:t}:null)},isMultiSelect:y,options:_})]})):t("div",Object.assign({style:{height:X,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:T,buttonText:H})]})),!!Q&&t(c,{title:Q.title,description:Q.description,version:A})]}))};export{v as OpenedDropdown};
@@ -1,13 +1,10 @@
1
1
  import React from 'react';
2
2
  import { MultiSelectOption, SingleOption } from '../../../type';
3
- interface MenuItemProps {
3
+ export declare const MenuItem: React.FC<{
4
4
  option: SingleOption | MultiSelectOption;
5
5
  isMultiSelect?: boolean;
6
6
  showDescription: (title?: string, description?: string) => void;
7
7
  onSelect: (option: SingleOption) => void;
8
- onDropdownItemClick?: (option: SingleOption) => void;
9
8
  last?: boolean;
10
9
  version?: '1.0' | '2.0';
11
- }
12
- export declare const MenuItem: React.FC<MenuItemProps>;
13
- export {};
10
+ }>;
@@ -2,4 +2,4 @@ import{jsx as e,jsxs as t,Fragment as n}from"react/jsx-runtime";import i from"st
2
2
  padding: ${e=>"2.0"===e.version?"8px 12px":"14px 16px"} !important;
3
3
  cursor: pointer;
4
4
  margin-top: ${e=>"2.0"===e.version?"2px":"0"};
5
- `,d=i=>{let{option:s,isMultiSelect:d,showDescription:m,onSelect:p,last:g,version:u,onDropdownItemClick:b}=i;var f;function h(e){s.disabled||p(Object.assign(Object.assign({},s),{selected:e}))}return e(a,{version:u,style:g?{borderBottom:0}:{},onClick:e=>{e.preventDefault(),h(!s.selected),null==b||b(s)},onMouseOver:function(){s.description?m(s.label,s.description):m()},listItem:{value:s.value,label:s.label},subText:s.subText,leadingIcon:d?t("div",Object.assign({style:{display:"flex",alignContent:"center",justifyContent:"center",gap:8}},{children:[e(o,{size:"2.0"===u?"SMALL":"DEFAULT",isDisabled:null!==(f=s.disabled)&&void 0!==f&&f,isChecked:!!s.selected,onValueChange:h}),e("div",Object.assign({style:{marginRight:"-4px"}},{children:s.leadingIcon}))]})):s.leadingIcon?e(n,{children:s.leadingIcon}):e(n,{}),customComponent:s.customComponent,trailingIcon:s.isFreeForm?e(c,{children:e(r,Object.assign({style:{color:l.content.secondary}},{children:"Freeform"}))}):s.trailingIcon?e(n,{children:s.trailingIcon}):e(n,{}),variant:s.disabled?"inactive":s.selected?"selected":"default"})};export{d as MenuItem};
5
+ `,d=i=>{let{option:s,isMultiSelect:d,showDescription:m,onSelect:p,last:g,version:u}=i;var b;function f(e){s.disabled||p(Object.assign(Object.assign({},s),{selected:e}))}return e(a,{version:u,style:g?{borderBottom:0}:{},onClick:e=>{e.preventDefault(),f(!s.selected)},onMouseOver:function(){s.description?m(s.label,s.description):m()},listItem:{value:s.value,label:s.label},subText:s.subText,leadingIcon:d?t("div",Object.assign({style:{display:"flex",alignContent:"center",justifyContent:"center",gap:8}},{children:[e(o,{size:"2.0"===u?"SMALL":"DEFAULT",isDisabled:null!==(b=s.disabled)&&void 0!==b&&b,isChecked:!!s.selected,onValueChange:f}),e("div",Object.assign({style:{marginRight:"-4px"}},{children:s.leadingIcon}))]})):s.leadingIcon?e(n,{children:s.leadingIcon}):e(n,{}),customComponent:s.customComponent,trailingIcon:s.isFreeForm?e(c,{children:e(r,Object.assign({style:{color:l.content.secondary}},{children:"Freeform"}))}):s.trailingIcon?e(n,{children:s.trailingIcon}):e(n,{}),variant:s.disabled?"inactive":s.selected?"selected":"default"})};export{d as MenuItem};
@@ -1,13 +1,9 @@
1
1
  import React from 'react';
2
2
  import { DropdownOption, SingleOption } from '../../../type';
3
- interface MenuListProps {
3
+ export declare const MenuList: React.FC<{
4
4
  options: DropdownOption[];
5
5
  isMultiSelect?: boolean;
6
6
  showDescription: (title?: string, description?: string) => void;
7
7
  onSelect: (optionSelect: SingleOption) => void;
8
8
  version?: '1.0' | '2.0';
9
- onInfiniteScroll?: () => void;
10
- onDropdownItemClick?: (option: DropdownOption) => void;
11
- }
12
- export declare const MenuList: React.FC<MenuListProps>;
13
- export {};
9
+ }>;
@@ -1 +1 @@
1
- import{jsx as n,Fragment as e,jsxs as t}from"react/jsx-runtime";import{useRef as r,useCallback as o,useEffect as i}from"react";import{MenuItem as s}from"./MenuItem.js";import{StyledGroupedLabel as c}from"./MenuList.styled.js";const l=l=>{let{options:p,isMultiSelect:u,showDescription:m,onSelect:a,version:d,onInfiniteScroll:g,onDropdownItemClick:h}=l;const I=r(null),v=r(null),f=o((()=>{I.current&&I.current.disconnect(),I.current=new IntersectionObserver((n=>{n[0].isIntersecting&&(null==g||g())})),v.current&&I.current.observe(v.current)}),[g]);return i((()=>(f(),()=>{I.current&&I.current.disconnect()})),[f,p]),n(e,{children:p.map(((r,o)=>{const i=o===p.length-1;if(r.options){const i=r;return t("div",Object.assign({style:{marginTop:"2.0"===d?2:0}},{children:[t(c,Object.assign({version:d},{children:[i.leadingIcon?n("span",Object.assign({style:{marginRight:8}},{children:i.leadingIcon})):n(e,{}),i.label]})),i.options.map(((e,t)=>n(s,{version:d,last:t===i.options.length-1,onSelect:a,showDescription:m,onDropdownItemClick:h,isMultiSelect:u,option:e},`${o}-${t}`)))]}),o)}return t("div",{children:[n(s,{version:d,last:i,onSelect:a,showDescription:m,onDropdownItemClick:h,isMultiSelect:u,option:r},o),i?n("span",{ref:v}):null]},o)}))})};export{l as MenuList};
1
+ import{jsx as e,Fragment as t,jsxs as i}from"react/jsx-runtime";import{MenuItem as n}from"./MenuItem.js";import{StyledGroupedLabel as o}from"./MenuList.styled.js";const s=s=>{let{options:r,isMultiSelect:l,showDescription:c,onSelect:p,version:a}=s;return e(t,{children:r.map(((s,m)=>{const g=m===r.length-1;if(s.options){const r=s;return i("div",Object.assign({style:{marginTop:"2.0"===a?2:0}},{children:[i(o,Object.assign({version:a},{children:[r.leadingIcon?e("span",Object.assign({style:{marginRight:8}},{children:r.leadingIcon})):e(t,{}),r.label]})),r.options.map(((t,i)=>e(n,{version:a,last:i===r.options.length-1,onSelect:p,showDescription:c,isMultiSelect:l,option:t},`${m}-${i}`)))]}),m)}return e(n,{version:a,last:g,onSelect:p,showDescription:c,isMultiSelect:l,option:s},m)}))})};export{s as MenuList};
@@ -12,7 +12,6 @@ export declare function iterateOnOptions(options: DropdownOption[], newVal: Part
12
12
  leadingIcon?: JSX.Element | undefined;
13
13
  customComponent?: JSX.Element | undefined;
14
14
  searchKey?: string | undefined;
15
- selectedLabel?: string | undefined;
16
15
  } | {
17
16
  label?: string | undefined;
18
17
  value?: string | undefined;
@@ -25,8 +24,6 @@ export declare function iterateOnOptions(options: DropdownOption[], newVal: Part
25
24
  leadingIcon?: JSX.Element | undefined;
26
25
  customComponent?: JSX.Element | undefined;
27
26
  searchKey?: string | undefined;
28
- selectedLabel?: string | undefined;
29
27
  options: SingleOption[];
30
28
  })[];
31
29
  export declare function iterateOnOptionsRaw(options: DropdownOption[], cb: (option: SingleOption) => void): void;
32
- export declare function getSelectedOptionsAsText(selectedOption: DropdownOption[]): string | undefined;
@@ -1 +1 @@
1
- function n(n,t,s){return n.map((n=>{if(n.options){const o=n.options.map((n=>!s||s(n)?Object.assign(Object.assign({},n),t):Object.assign({},n)));return Object.assign(Object.assign({},n),{options:[...o]})}return!s||s(n)?Object.assign(Object.assign({},n),t):Object.assign({},n)}))}function t(n,t){n.forEach((n=>{n.options?n.options.forEach(t):t(n)}))}function s(n){if(console.log(n),n&&n.length)return n.map((n=>{var t;const s=n;return null!==(t=s.selectedLabel)&&void 0!==t?t:s.label})).join(", ")}export{s as getSelectedOptionsAsText,n as iterateOnOptions,t as iterateOnOptionsRaw};
1
+ function s(s,n,t){return s.map((s=>{if(s.options){const i=s.options.map((s=>!t||t(s)?Object.assign(Object.assign({},s),n):Object.assign({},s)));return Object.assign(Object.assign({},s),{options:[...i]})}return!t||t(s)?Object.assign(Object.assign({},s),n):Object.assign({},s)}))}function n(s,n){s.forEach((s=>{s.options?s.options.forEach(n):n(s)}))}export{s as iterateOnOptions,n as iterateOnOptionsRaw};
@@ -19,7 +19,6 @@ export declare const useDropdown: (version: string | undefined, options: Dropdow
19
19
  leadingIcon?: JSX.Element | undefined;
20
20
  customComponent?: JSX.Element | undefined;
21
21
  searchKey?: string | undefined;
22
- selectedLabel?: string | undefined;
23
22
  } | {
24
23
  label?: string | undefined;
25
24
  value?: string | undefined;
@@ -32,7 +31,6 @@ export declare const useDropdown: (version: string | undefined, options: Dropdow
32
31
  leadingIcon?: JSX.Element | undefined;
33
32
  customComponent?: JSX.Element | undefined;
34
33
  searchKey?: string | undefined;
35
- selectedLabel?: string | undefined;
36
34
  options: SingleOption[];
37
35
  })[] | undefined;
38
36
  selectAllHandler: (newState: SelectAllCheckboxState) => void;
@@ -19,9 +19,6 @@ export interface OpenDropdownProps {
19
19
  headerRef?: any;
20
20
  hideSelectAll?: boolean;
21
21
  primaryButtonText?: string;
22
- onInfiniteScroll?: () => void;
23
- onMultiSelectClear?: () => void;
24
- onDropdownItemClick?: (option: DropdownOption) => void;
25
22
  }
26
23
  export type GroupedOption = {
27
24
  label?: string;
@@ -40,7 +37,6 @@ export type SingleOption = {
40
37
  leadingIcon?: JSX.Element;
41
38
  customComponent?: JSX.Element;
42
39
  searchKey?: string;
43
- selectedLabel?: string;
44
40
  };
45
41
  export type MultiSelectOption = SingleOption;
46
42
  export type DropdownOption = MultiSelectOption | SingleOption | GroupedOption;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bikdotai/bik-component-library",
3
- "version": "0.0.547-drop.1",
3
+ "version": "0.0.547",
4
4
  "description": "Bik Component Library",
5
5
  "repository": {
6
6
  "type": "git",