sbwb-ds 3.0.34 → 3.0.35

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/sbwb-ds.js CHANGED
@@ -29679,7 +29679,10 @@ const wge = xn(
29679
29679
  onClose: (de) => {
29680
29680
  de.stopPropagation(), pe(r.filter((Le) => Le !== K));
29681
29681
  },
29682
- tableTag: f === "table"
29682
+ tableTag: f === "table",
29683
+ tooltipProps: {
29684
+ isActive: !1
29685
+ }
29683
29686
  },
29684
29687
  me.value
29685
29688
  )
@@ -5963,7 +5963,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
5963
5963
  font-weight: ${y.fonts.fontWeight.fontWeightSemiBold};
5964
5964
  line-height: ${({size:e})=>e==="Small"?y.fonts.lineHeight.lineHeightSm(y.fonts.fontSize.fontSizeBodySm):y.fonts.lineHeight.lineHeightMd(y.fonts.fontSize.fontSizeBodyMd)};
5965
5965
  color: ${y.colors.brandColors.colorBrandPrimary};
5966
- `,AV=te.forwardRef(({selectContainerRef:e,options:t,size:r,onSelectOption:n,values:a,searchText:i,setIsOpen:o,withCheckbox:l=!0,height:s},c)=>{const u=te.useRef(null),[d,f]=te.useState(),h=i.toLowerCase(),p=te.useRef(!1),g=()=>{if(!e.current||!u.current)return;const S=e.current.getBoundingClientRect(),b=u.current.getBoundingClientRect(),x=window.innerHeight,_=S.top,L=x-S.bottom,V=L<b.height&&_>L;let H;V?(H=S.top-b.height,u.current.style.maxHeight=`${_}px`):(H=S.bottom,u.current.style.maxHeight=`${L}px`);let A=S.left;const T=A+b.width-window.innerWidth;T>0&&(A-=T),A<0&&(A=0),Object.assign(u.current.style,{position:"fixed",top:`${H}px`,left:`${A}px`,width:`${Math.max(S.width,b.width)}px`,overflowY:"auto"})},C=S=>{if(!p.current)return;const b=S.target,x=u.current,_=e.current;(!x||!x.contains(b))&&(!_||!_.contains(b))&&o(!1)},m=()=>{p.current&&o(!1)},w=S=>{if(!p.current||!u.current)return;const b=S.target;u.current.contains(b)||o(!1)};return te.useEffect(()=>{var b;p.current=!0,e.current&&f(e.current.clientWidth),g(),document.addEventListener("scroll",w,!0),window.addEventListener("resize",m),document.addEventListener("click",C,!0),window.addEventListener("resize",g);const S=(b=e.current)==null?void 0:b.querySelector("#MenuMultiSelect");if(S){const x=()=>{g()};return S.addEventListener("openMenu",x),()=>{S.removeEventListener("openMenu",x)}}return()=>{p.current=!1,document.removeEventListener("click",C,!0),document.removeEventListener("scroll",w,!0),window.removeEventListener("resize",m),window.removeEventListener("resize",g)}},[a,i]),F(J2e,{width:`${d}px`,height:s,ref:S=>{u.current=S,typeof c=="function"?c(S):c&&(c.current=S)},"data-testid":"MenuMultiSelect",id:"MenuMultiSelect",onClick:S=>{S.stopPropagation()},children:t.length===0?F(e3e,{size:r,children:"Sem opções"}):t.map(S=>{const b=S.label.toLowerCase().indexOf(h),x=a.includes(S.value);return ke(r3e,{onClick:_=>{_.stopPropagation(),_.preventDefault()},children:[ke(n3e,{onClick:_=>{_.preventDefault(),_.stopPropagation(),n(S.value)},isSelected:x,"data-testid":S.value,size:r,children:[l&&F(p0,{width:"24.333px",id:S.value,onChange:_=>{_.stopPropagation(),n(S.value)},checked:x,size:r}),F(t3e,{size:r,hasDescription:!1,children:ke("p",{title:S.label,children:[S.label.substring(0,b),F(a3e,{children:S.label.substring(b,b+(i==null?void 0:i.length))}),S.label.substring(b+(i==null?void 0:i.length))]})})]},S.value),F("div",{style:{height:"4px"}})]},S.label)})})});AV.displayName="MenuMultiSelect";const $V=te.forwardRef(({id:e,options:t=[],values:r=[],onChange:n,disabled:a=!1,enableSearch:i=!0,width:o="100%",size:l="Medium",placeholder:s,label:c,helpText:u,errorText:d,variant:f="default",tableDensity:h="normal",tooltipPosition:p,tooltipMaxWidth:g,tooltipIsVisible:C,tooltipProps:m,menuSelectHeight:w},S)=>{const b=te.useCallback(K=>K!=null,[]),[x,_]=te.useState(!1),[L,V]=te.useState(""),[H,A]=te.useState(!1),T=te.useRef(null),R=te.useRef(null),N=te.useRef(null),z=te.useRef(null),Y=te.useMemo(()=>!!d,[d]),q=te.useMemo(()=>Object.fromEntries(t.map(K=>[K.value,K])),[t]),re=te.useMemo(()=>{const K=L.toLowerCase().trim();return t.filter(me=>{var Ve;if(!K)return!0;const fe=me.label.toLowerCase(),Le=((Ve=me.searchText)==null?void 0:Ve.toLowerCase())||"";return fe.includes(K)||Le.includes(K)})},[L,t]),ie=te.useMemo(()=>b(s)&&r.length===0&&!x,[s,r.length,x]),ve=te.useCallback(K=>{n(K),V("")},[n]),oe=te.useCallback(K=>{const me=r.includes(K)?r.filter(fe=>fe!==K):r.concat([K]);ve(me)},[r,ve]),ce=te.useCallback(()=>{A(!0),!x&&_(!0)},[x]),ae=te.useCallback(()=>{A(!1)},[]),ue=te.useCallback(K=>{K==null||K.stopPropagation(),!a&&_(me=>me?!me:(requestAnimationFrame(()=>{var Le;const fe=(Le=T.current)==null?void 0:Le.querySelector("#MenuMultiSelect");if(fe){const Ve=new Event("openMenu");fe.dispatchEvent(Ve)}}),setTimeout(()=>{N!=null&&N.current&&N.current.focus()},0),!0))},[a,N]),pe=te.useCallback(K=>{var me;L===""&&K.key==="Backspace"&&n(r.slice(0,-1)),K.key==="Escape"&&(_(!1),(me=N.current)==null||me.blur())},[L,r,n]),be=te.useCallback(K=>{var me;K.key==="Enter"&&(L!==""&&re.length>0?oe(re[0].value):L===""&&((me=N.current)==null||me.blur(),_(!1)))},[L,re,oe]);return te.useEffect(()=>{if(S){const K={focus:()=>{var me;return(me=N.current)==null?void 0:me.focus()},blur:()=>{var me;return(me=N.current)==null?void 0:me.blur()},open:()=>_(!0),close:()=>_(!1)};typeof S=="function"?S(K):S.current=K}},[S]),te.useEffect(()=>{const K=me=>{var Le;const fe=me.target;(Le=T.current)!=null&&Le.contains(fe)||fe.closest("#MenuMultiSelect")||(_(!1),V(""))};if(x){document.addEventListener("click",K,!0);const me=fe=>{fe.key==="Escape"&&(_(!1),V(""))};return document.addEventListener("keydown",me),()=>{document.removeEventListener("click",K,!0),document.removeEventListener("keydown",me)}}},[x]),ke(W2e,{ref:T,width:o,disabled:a,id:e,tabIndex:0,onFocus:()=>!a&&A(!0),onBlur:()=>A(!1),children:[c&&f==="default"&&F(q2e,{ref:S,onClick:ue,children:c}),F(t1,{isActive:Y&&f==="default",errorTooltip:!0,label:d,position:p,maxWidth:g,isAlwaysVisible:C,wrapperWidth:"auto",...m,children:ke(G2e,{hasError:Y,tableDensity:h,tableSelect:f==="table",ref:R,onClick:ue,size:l,isOpen:x,"data-testid":"select",disabled:a,error:d,children:[F(U2e,{ref:z,children:ke(Y2e,{tableSelect:f==="table",size:l,onClick:ue,children:[ie&&F(j2e,{name:"placeholder-name",size:l,onClick:K=>{var me;K.stopPropagation(),a||(_(!0),(me=N.current)==null||me.focus())},role:"button",tabIndex:a?-1:0,onKeyDown:K=>{var me;(K.key==="Enter"||K.key===" ")&&(K.preventDefault(),a||(_(!0),(me=N.current)==null||me.focus()))},children:s}),d&&f==="table"&&F(Zc,{id:`${e}-select-table`,errorMessage:d,size:l,tooltipIsVisible:!1}),r.flatMap(K=>{const me=q[K];return b(me)?[F(xp,{label:me.tagText??me.label,size:f==="table"?"Small":l,closeButton:!0,onClose:fe=>{fe.stopPropagation(),ve(r.filter(Le=>Le!==K))},tableTag:f==="table"},me.value)]:[]}),i&&F(X2e,{ref:N,error:d,tableSelect:f==="table",value:L,name:"inputMultiSelect",id:"inputMultiSelect",onChange:K=>{V(K.target.value),!x&&_(!0)},onFocus:ce,onBlur:ae,onKeyDown:pe,onKeyUp:be,size:f==="table"?"Small":l,disabled:a,"aria-expanded":x,"aria-haspopup":"listbox",role:"combobox"})]})}),F(Q2e,{onClick:K=>{a||(K.stopPropagation(),_(!x))},children:F(Sr,{iconName:x?"ExpandLessSm":"ExpandMoreSm",color:f==="table"&&d?y.colors.feedbackColors.colorFeedbackError:y.colors.neutralColors.colorNeutralCloudy})}),x&&F(AV,{selectContainerRef:T,values:r,options:re,onSelectOption:oe,size:f==="table"?"Small":l,searchText:L,setIsOpen:_,height:w})]})}),!d&&u&&f==="default"&&F(K2e,{children:u})]})});$V.displayName="MultiSelect";var dl={};/**
5966
+ `,AV=te.forwardRef(({selectContainerRef:e,options:t,size:r,onSelectOption:n,values:a,searchText:i,setIsOpen:o,withCheckbox:l=!0,height:s},c)=>{const u=te.useRef(null),[d,f]=te.useState(),h=i.toLowerCase(),p=te.useRef(!1),g=()=>{if(!e.current||!u.current)return;const S=e.current.getBoundingClientRect(),b=u.current.getBoundingClientRect(),x=window.innerHeight,_=S.top,L=x-S.bottom,V=L<b.height&&_>L;let H;V?(H=S.top-b.height,u.current.style.maxHeight=`${_}px`):(H=S.bottom,u.current.style.maxHeight=`${L}px`);let A=S.left;const T=A+b.width-window.innerWidth;T>0&&(A-=T),A<0&&(A=0),Object.assign(u.current.style,{position:"fixed",top:`${H}px`,left:`${A}px`,width:`${Math.max(S.width,b.width)}px`,overflowY:"auto"})},C=S=>{if(!p.current)return;const b=S.target,x=u.current,_=e.current;(!x||!x.contains(b))&&(!_||!_.contains(b))&&o(!1)},m=()=>{p.current&&o(!1)},w=S=>{if(!p.current||!u.current)return;const b=S.target;u.current.contains(b)||o(!1)};return te.useEffect(()=>{var b;p.current=!0,e.current&&f(e.current.clientWidth),g(),document.addEventListener("scroll",w,!0),window.addEventListener("resize",m),document.addEventListener("click",C,!0),window.addEventListener("resize",g);const S=(b=e.current)==null?void 0:b.querySelector("#MenuMultiSelect");if(S){const x=()=>{g()};return S.addEventListener("openMenu",x),()=>{S.removeEventListener("openMenu",x)}}return()=>{p.current=!1,document.removeEventListener("click",C,!0),document.removeEventListener("scroll",w,!0),window.removeEventListener("resize",m),window.removeEventListener("resize",g)}},[a,i]),F(J2e,{width:`${d}px`,height:s,ref:S=>{u.current=S,typeof c=="function"?c(S):c&&(c.current=S)},"data-testid":"MenuMultiSelect",id:"MenuMultiSelect",onClick:S=>{S.stopPropagation()},children:t.length===0?F(e3e,{size:r,children:"Sem opções"}):t.map(S=>{const b=S.label.toLowerCase().indexOf(h),x=a.includes(S.value);return ke(r3e,{onClick:_=>{_.stopPropagation(),_.preventDefault()},children:[ke(n3e,{onClick:_=>{_.preventDefault(),_.stopPropagation(),n(S.value)},isSelected:x,"data-testid":S.value,size:r,children:[l&&F(p0,{width:"24.333px",id:S.value,onChange:_=>{_.stopPropagation(),n(S.value)},checked:x,size:r}),F(t3e,{size:r,hasDescription:!1,children:ke("p",{title:S.label,children:[S.label.substring(0,b),F(a3e,{children:S.label.substring(b,b+(i==null?void 0:i.length))}),S.label.substring(b+(i==null?void 0:i.length))]})})]},S.value),F("div",{style:{height:"4px"}})]},S.label)})})});AV.displayName="MenuMultiSelect";const $V=te.forwardRef(({id:e,options:t=[],values:r=[],onChange:n,disabled:a=!1,enableSearch:i=!0,width:o="100%",size:l="Medium",placeholder:s,label:c,helpText:u,errorText:d,variant:f="default",tableDensity:h="normal",tooltipPosition:p,tooltipMaxWidth:g,tooltipIsVisible:C,tooltipProps:m,menuSelectHeight:w},S)=>{const b=te.useCallback(K=>K!=null,[]),[x,_]=te.useState(!1),[L,V]=te.useState(""),[H,A]=te.useState(!1),T=te.useRef(null),R=te.useRef(null),N=te.useRef(null),z=te.useRef(null),Y=te.useMemo(()=>!!d,[d]),q=te.useMemo(()=>Object.fromEntries(t.map(K=>[K.value,K])),[t]),re=te.useMemo(()=>{const K=L.toLowerCase().trim();return t.filter(me=>{var Ve;if(!K)return!0;const fe=me.label.toLowerCase(),Le=((Ve=me.searchText)==null?void 0:Ve.toLowerCase())||"";return fe.includes(K)||Le.includes(K)})},[L,t]),ie=te.useMemo(()=>b(s)&&r.length===0&&!x,[s,r.length,x]),ve=te.useCallback(K=>{n(K),V("")},[n]),oe=te.useCallback(K=>{const me=r.includes(K)?r.filter(fe=>fe!==K):r.concat([K]);ve(me)},[r,ve]),ce=te.useCallback(()=>{A(!0),!x&&_(!0)},[x]),ae=te.useCallback(()=>{A(!1)},[]),ue=te.useCallback(K=>{K==null||K.stopPropagation(),!a&&_(me=>me?!me:(requestAnimationFrame(()=>{var Le;const fe=(Le=T.current)==null?void 0:Le.querySelector("#MenuMultiSelect");if(fe){const Ve=new Event("openMenu");fe.dispatchEvent(Ve)}}),setTimeout(()=>{N!=null&&N.current&&N.current.focus()},0),!0))},[a,N]),pe=te.useCallback(K=>{var me;L===""&&K.key==="Backspace"&&n(r.slice(0,-1)),K.key==="Escape"&&(_(!1),(me=N.current)==null||me.blur())},[L,r,n]),be=te.useCallback(K=>{var me;K.key==="Enter"&&(L!==""&&re.length>0?oe(re[0].value):L===""&&((me=N.current)==null||me.blur(),_(!1)))},[L,re,oe]);return te.useEffect(()=>{if(S){const K={focus:()=>{var me;return(me=N.current)==null?void 0:me.focus()},blur:()=>{var me;return(me=N.current)==null?void 0:me.blur()},open:()=>_(!0),close:()=>_(!1)};typeof S=="function"?S(K):S.current=K}},[S]),te.useEffect(()=>{const K=me=>{var Le;const fe=me.target;(Le=T.current)!=null&&Le.contains(fe)||fe.closest("#MenuMultiSelect")||(_(!1),V(""))};if(x){document.addEventListener("click",K,!0);const me=fe=>{fe.key==="Escape"&&(_(!1),V(""))};return document.addEventListener("keydown",me),()=>{document.removeEventListener("click",K,!0),document.removeEventListener("keydown",me)}}},[x]),ke(W2e,{ref:T,width:o,disabled:a,id:e,tabIndex:0,onFocus:()=>!a&&A(!0),onBlur:()=>A(!1),children:[c&&f==="default"&&F(q2e,{ref:S,onClick:ue,children:c}),F(t1,{isActive:Y&&f==="default",errorTooltip:!0,label:d,position:p,maxWidth:g,isAlwaysVisible:C,wrapperWidth:"auto",...m,children:ke(G2e,{hasError:Y,tableDensity:h,tableSelect:f==="table",ref:R,onClick:ue,size:l,isOpen:x,"data-testid":"select",disabled:a,error:d,children:[F(U2e,{ref:z,children:ke(Y2e,{tableSelect:f==="table",size:l,onClick:ue,children:[ie&&F(j2e,{name:"placeholder-name",size:l,onClick:K=>{var me;K.stopPropagation(),a||(_(!0),(me=N.current)==null||me.focus())},role:"button",tabIndex:a?-1:0,onKeyDown:K=>{var me;(K.key==="Enter"||K.key===" ")&&(K.preventDefault(),a||(_(!0),(me=N.current)==null||me.focus()))},children:s}),d&&f==="table"&&F(Zc,{id:`${e}-select-table`,errorMessage:d,size:l,tooltipIsVisible:!1}),r.flatMap(K=>{const me=q[K];return b(me)?[F(xp,{label:me.tagText??me.label,size:f==="table"?"Small":l,closeButton:!0,onClose:fe=>{fe.stopPropagation(),ve(r.filter(Le=>Le!==K))},tableTag:f==="table",tooltipProps:{isActive:!1}},me.value)]:[]}),i&&F(X2e,{ref:N,error:d,tableSelect:f==="table",value:L,name:"inputMultiSelect",id:"inputMultiSelect",onChange:K=>{V(K.target.value),!x&&_(!0)},onFocus:ce,onBlur:ae,onKeyDown:pe,onKeyUp:be,size:f==="table"?"Small":l,disabled:a,"aria-expanded":x,"aria-haspopup":"listbox",role:"combobox"})]})}),F(Q2e,{onClick:K=>{a||(K.stopPropagation(),_(!x))},children:F(Sr,{iconName:x?"ExpandLessSm":"ExpandMoreSm",color:f==="table"&&d?y.colors.feedbackColors.colorFeedbackError:y.colors.neutralColors.colorNeutralCloudy})}),x&&F(AV,{selectContainerRef:T,values:r,options:re,onSelectOption:oe,size:f==="table"?"Small":l,searchText:L,setIsOpen:_,height:w})]})}),!d&&u&&f==="default"&&F(K2e,{children:u})]})});$V.displayName="MultiSelect";var dl={};/**
5967
5967
  * @license React
5968
5968
  * react-dom-server-legacy.browser.production.min.js
5969
5969
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sbwb-ds",
3
- "version": "3.0.34",
3
+ "version": "3.0.35",
4
4
  "type": "module",
5
5
  "description": "Sistema de design para padronização dos processos visuais do portal SUBWEB",
6
6
  "main": "dist/sbwb-ds.js",
@@ -315,6 +315,9 @@ const MultiSelect: React.FC<MultiSelectProps> = forwardRef<
315
315
  handleChange(values.filter((v) => v !== value));
316
316
  }}
317
317
  tableTag={variant === 'table'}
318
+ tooltipProps={{
319
+ isActive: false,
320
+ }}
318
321
  />,
319
322
  ];
320
323
  })}