@bikdotai/bik-component-library 0.0.726-beta.3 → 0.0.726-beta.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../../../node_modules/react/jsx-runtime.js"),t=require("react"),s=require("./MenuItem.js"),n=require("./MenuList.styled.js");const r=t.forwardRef(((r,o)=>{let{options:i,isMultiSelect:u,showDescription:c,onSelect:l,version:a,onInfiniteScroll:d,onDropdownItemClick:p,useDefaultCursor:x,focusedIndex:j=-1}=r;const m=t.useRef(null),f=t.useRef(null),b=t.useCallback((()=>{m.current&&m.current.disconnect(),m.current=new IntersectionObserver((e=>{e[0].isIntersecting&&(null==d||d())})),f.current&&m.current.observe(f.current)}),[d]);t.useEffect((()=>(b(),()=>{m.current&&m.current.disconnect()})),[b,i]);const g=new Map;let I=-1;return i.forEach((e=>{if(e.options)e.options.forEach((e=>{e.disabled||(I++,g.set(e,I))}));else{const t=e;t.disabled||(I++,g.set(t,I))}})),e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:i.map(((t,r)=>{const d=r===i.length-1;if(t.options){const i=t;return e.jsxRuntimeExports.jsxs("div",Object.assign({style:{marginTop:"2.0"===a?2:0}},{children:[e.jsxRuntimeExports.jsxs(n.StyledGroupedLabel,Object.assign({version:a},{children:[i.leadingIcon?e.jsxRuntimeExports.jsx("span",Object.assign({style:{marginRight:8}},{children:i.leadingIcon})):null,i.label]})),i.options.map(((t,n)=>{const d=g.get(t),m=d===j&&!t.disabled;return e.jsxRuntimeExports.jsx(s.MenuItem,{version:a,last:n===i.options.length-1,onSelect:l,showDescription:c,onDropdownItemClick:p,isMultiSelect:u,option:t,useDefaultCursor:x,isFocused:m,dataIndex:d,ref:e=>{o&&"object"==typeof o&&o.current&&e&&e&&e&&e&&(o.current[r]=e)}},`${r}-${n}`)})),d?e.jsxRuntimeExports.jsx("span",{ref:f}):null]}),r)}const m=t,b=g.get(m),I=b===j&&!m.disabled;return e.jsxRuntimeExports.jsxs("div",{children:[e.jsxRuntimeExports.jsx(s.MenuItem,{version:a,last:d,onSelect:l,showDescription:c,onDropdownItemClick:p,isMultiSelect:u,option:m,useDefaultCursor:x,isFocused:I,dataIndex:b,ref:e=>{o&&"object"==typeof o&&o.current&&e&&(o.current[r]=e)}},r),d?e.jsxRuntimeExports.jsx("span",{ref:f}):null]},r)}))})}));exports.MenuList=r;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../../../node_modules/react/jsx-runtime.js"),t=require("react"),s=require("./MenuItem.js"),n=require("./MenuList.styled.js");const r=t.forwardRef(((r,o)=>{let{options:i,isMultiSelect:u,showDescription:c,onSelect:l,version:d,onInfiniteScroll:x,onDropdownItemClick:a,useDefaultCursor:p,focusedIndex:j=-1}=r;const m=t.useRef(null),f=t.useRef(null),b=t.useCallback((()=>{m.current&&m.current.disconnect(),m.current=new IntersectionObserver((e=>{e[0].isIntersecting&&(null==x||x())})),f.current&&m.current.observe(f.current)}),[x]);t.useEffect((()=>(b(),()=>{m.current&&m.current.disconnect()})),[b,i]);let I=-1;const R=e=>(e.disabled||(I+=1),I);return e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:i.map(((t,r)=>{const x=r===i.length-1;if(t.options){const i=t;return e.jsxRuntimeExports.jsxs("div",Object.assign({style:{marginTop:"2.0"===d?2:0}},{children:[e.jsxRuntimeExports.jsxs(n.StyledGroupedLabel,Object.assign({version:d},{children:[i.leadingIcon?e.jsxRuntimeExports.jsx("span",Object.assign({style:{marginRight:8}},{children:i.leadingIcon})):null,i.label]})),i.options.map(((t,n)=>{const x=R(t),m=x===j&&!t.disabled;return e.jsxRuntimeExports.jsx(s.MenuItem,{version:d,last:n===i.options.length-1,onSelect:l,showDescription:c,onDropdownItemClick:a,isMultiSelect:u,option:t,useDefaultCursor:p,isFocused:m,dataIndex:x,ref:e=>{o&&"object"==typeof o&&o.current&&e&&e&&e&&e&&(o.current[r]=e)}},`${r}-${n}`)})),x?e.jsxRuntimeExports.jsx("span",{ref:f}):null]}),r)}const m=t,b=R(m),I=b===j&&!m.disabled;return e.jsxRuntimeExports.jsxs("div",{children:[e.jsxRuntimeExports.jsx(s.MenuItem,{version:d,last:x,onSelect:l,showDescription:c,onDropdownItemClick:a,isMultiSelect:u,option:m,useDefaultCursor:p,isFocused:I,dataIndex:b,ref:e=>{o&&"object"==typeof o&&o.current&&e&&(o.current[r]=e)}},r),x?e.jsxRuntimeExports.jsx("span",{ref:f}):null]},r)}))})}));exports.MenuList=r;
@@ -1 +1 @@
1
- import{j as e}from"../../../../../node_modules/react/jsx-runtime.js";import{forwardRef as n,useRef as t,useCallback as s,useEffect as r}from"react";import{MenuItem as o}from"./MenuItem.js";import{StyledGroupedLabel as i}from"./MenuList.styled.js";const c=n(((n,c)=>{let{options:l,isMultiSelect:u,showDescription:a,onSelect:d,version:p,onInfiniteScroll:f,onDropdownItemClick:j,useDefaultCursor:m,focusedIndex:g=-1}=n;const x=t(null),h=t(null),b=s((()=>{x.current&&x.current.disconnect(),x.current=new IntersectionObserver((e=>{e[0].isIntersecting&&(null==f||f())})),h.current&&x.current.observe(h.current)}),[f]);r((()=>(b(),()=>{x.current&&x.current.disconnect()})),[b,l]);const I=new Map;let D=-1;return l.forEach((e=>{if(e.options)e.options.forEach((e=>{e.disabled||(D++,I.set(e,D))}));else{const n=e;n.disabled||(D++,I.set(n,D))}})),e.jsx(e.Fragment,{children:l.map(((n,t)=>{const s=t===l.length-1;if(n.options){const r=n;return e.jsxs("div",Object.assign({style:{marginTop:"2.0"===p?2:0}},{children:[e.jsxs(i,Object.assign({version:p},{children:[r.leadingIcon?e.jsx("span",Object.assign({style:{marginRight:8}},{children:r.leadingIcon})):null,r.label]})),r.options.map(((n,s)=>{const i=I.get(n),l=i===g&&!n.disabled;return e.jsx(o,{version:p,last:s===r.options.length-1,onSelect:d,showDescription:a,onDropdownItemClick:j,isMultiSelect:u,option:n,useDefaultCursor:m,isFocused:l,dataIndex:i,ref:e=>{c&&"object"==typeof c&&c.current&&e&&e&&e&&e&&(c.current[t]=e)}},`${t}-${s}`)})),s?e.jsx("span",{ref:h}):null]}),t)}const r=n,f=I.get(r),x=f===g&&!r.disabled;return e.jsxs("div",{children:[e.jsx(o,{version:p,last:s,onSelect:d,showDescription:a,onDropdownItemClick:j,isMultiSelect:u,option:r,useDefaultCursor:m,isFocused:x,dataIndex:f,ref:e=>{c&&"object"==typeof c&&c.current&&e&&(c.current[t]=e)}},t),s?e.jsx("span",{ref:h}):null]},t)}))})}));export{c as MenuList};
1
+ import{j as e}from"../../../../../node_modules/react/jsx-runtime.js";import{forwardRef as n,useRef as t,useCallback as r,useEffect as s}from"react";import{MenuItem as o}from"./MenuItem.js";import{StyledGroupedLabel as i}from"./MenuList.styled.js";const c=n(((n,c)=>{let{options:l,isMultiSelect:u,showDescription:d,onSelect:a,version:p,onInfiniteScroll:j,onDropdownItemClick:m,useDefaultCursor:f,focusedIndex:x=-1}=n;const g=t(null),I=t(null),b=r((()=>{g.current&&g.current.disconnect(),g.current=new IntersectionObserver((e=>{e[0].isIntersecting&&(null==j||j())})),I.current&&g.current.observe(I.current)}),[j]);s((()=>(b(),()=>{g.current&&g.current.disconnect()})),[b,l]);let h=-1;const D=e=>(e.disabled||(h+=1),h);return e.jsx(e.Fragment,{children:l.map(((n,t)=>{const r=t===l.length-1;if(n.options){const s=n;return e.jsxs("div",Object.assign({style:{marginTop:"2.0"===p?2:0}},{children:[e.jsxs(i,Object.assign({version:p},{children:[s.leadingIcon?e.jsx("span",Object.assign({style:{marginRight:8}},{children:s.leadingIcon})):null,s.label]})),s.options.map(((n,r)=>{const i=D(n),l=i===x&&!n.disabled;return e.jsx(o,{version:p,last:r===s.options.length-1,onSelect:a,showDescription:d,onDropdownItemClick:m,isMultiSelect:u,option:n,useDefaultCursor:f,isFocused:l,dataIndex:i,ref:e=>{c&&"object"==typeof c&&c.current&&e&&e&&e&&e&&(c.current[t]=e)}},`${t}-${r}`)})),r?e.jsx("span",{ref:I}):null]}),t)}const s=n,j=D(s),g=j===x&&!s.disabled;return e.jsxs("div",{children:[e.jsx(o,{version:p,last:r,onSelect:a,showDescription:d,onDropdownItemClick:m,isMultiSelect:u,option:s,useDefaultCursor:f,isFocused:g,dataIndex:j,ref:e=>{c&&"object"==typeof c&&c.current&&e&&(c.current[t]=e)}},t),r?e.jsx("span",{ref:I}):null]},t)}))})}));export{c as MenuList};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bikdotai/bik-component-library",
3
- "version": "0.0.726-beta.3",
3
+ "version": "0.0.726-beta.4",
4
4
  "description": "Bik Component Library",
5
5
  "repository": {
6
6
  "type": "git",