@ufal-lccv/gpsub-ds 0.0.18 → 0.0.19

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/README.md CHANGED
@@ -1,31 +1,31 @@
1
- # gpsub-ds
2
-
3
- Design system temporário do GP-SUB para auxiliar na futura migração para o DS Subweb 2.0
4
-
5
- ## Atomic Design
6
-
7
- Para dúvidas sobre o Atomic Design, consulte o [link](https://github.com/diegohaz/arc/wiki/Atomic-Design).
8
-
9
- ### Atoms
10
-
11
- Um átomo é uma tag html nativa, um Componente React que renderiza uma tag html ou qualquer componente de terceiros
12
-
13
- ### Molecules
14
-
15
- Uma molécula é um grupo de átomos.
16
-
17
- ### Organisms
18
-
19
- Um organismo é um grupo de átomos, moléculas e/ou outros organismos.
20
-
21
- ### Pages
22
-
23
- Uma página é uma página, onde você colocará principalmente (mas não exclusivamente) organismos.
24
-
25
- ### Templates
26
-
27
- Um template é um layout para ser usado em páginas.
28
-
29
- ## Do not worry!
30
-
31
- Atomic Design deve ser uma solução, não outro problema. Se você quiser criar um componente e não sabe onde colocá-lo (átomos, moléculas, organismos etc.), não se preocupe, não pense muito, apenas coloque-o em qualquer lugar. Depois de você perceber o que é, apenas mova a pasta do componente para o lugar certo. Tudo irá funcionar por que os componentes são exportados de forma dinâmica em `src/components/index.ts`.
1
+ # gpsub-ds
2
+
3
+ Design system temporário do GP-SUB para auxiliar na futura migração para o DS Subweb 2.0
4
+
5
+ ## Atomic Design
6
+
7
+ Para dúvidas sobre o Atomic Design, consulte o [link](https://github.com/diegohaz/arc/wiki/Atomic-Design).
8
+
9
+ ### Atoms
10
+
11
+ Um átomo é uma tag html nativa, um Componente React que renderiza uma tag html ou qualquer componente de terceiros
12
+
13
+ ### Molecules
14
+
15
+ Uma molécula é um grupo de átomos.
16
+
17
+ ### Organisms
18
+
19
+ Um organismo é um grupo de átomos, moléculas e/ou outros organismos.
20
+
21
+ ### Pages
22
+
23
+ Uma página é uma página, onde você colocará principalmente (mas não exclusivamente) organismos.
24
+
25
+ ### Templates
26
+
27
+ Um template é um layout para ser usado em páginas.
28
+
29
+ ## Do not worry!
30
+
31
+ Atomic Design deve ser uma solução, não outro problema. Se você quiser criar um componente e não sabe onde colocá-lo (átomos, moléculas, organismos etc.), não se preocupe, não pense muito, apenas coloque-o em qualquer lugar. Depois de você perceber o que é, apenas mova a pasta do componente para o lugar certo. Tudo irá funcionar por que os componentes são exportados de forma dinâmica em `src/components/index.ts`.
@@ -1,4 +1,4 @@
1
- "use strict";const o=require("./Checkbox.view-DFbiE7Mi.cjs"),g=require("react"),t=require("sbwb-ds"),F=require("./index-BcwQwoIM.cjs"),Q=require("react-hook-form"),ee=350,ae=({title:e,children:n,endAdornment:i=null,marginBottom:s="16px",customStyles:l={},wrapperCustomStyles:c={},hideAdornmentOnCollapse:a=!1,maxHeight:m="none"})=>{const[x,p]=g.useState(!1),[u,f]=g.useState(!0);g.useEffect(()=>{if(a)if(x){const k=setTimeout(()=>f(!1),ee);return()=>clearTimeout(k)}else f(!0)},[x,a]);const $=a&&!u?null:i;return o.jsxRuntimeExports.jsxs(o.Container,{width:"100%",flex:"1",gap:"8px",customStyles:c,children:[o.jsxRuntimeExports.jsx(o.SectionTitle,{title:e,divider:!0,marginBottom:s,collapse:{collapsed:x,setCollapsed:p},endAdornment:$,customStyles:l}),o.jsxRuntimeExports.jsx(o.Container,{gap:"8px",width:"100%",customStyles:{maxHeight:x?"0":m,transition:`max-height ${ee}ms ease-in-out`},children:n})]})};function Y(e,n,i){var s,l,c,a,m;n==null&&(n=100);function x(){var u=Date.now()-a;u<n&&u>=0?s=setTimeout(x,n-u):(s=null,i||(m=e.apply(c,l),c=l=null))}var p=function(){c=this,l=arguments,a=Date.now();var u=i&&!s;return s||(s=setTimeout(x,n)),u&&(m=e.apply(c,l),c=l=null),m};return p.clear=function(){s&&(clearTimeout(s),s=null)},p.flush=function(){s&&(m=e.apply(c,l),c=l=null,clearTimeout(s),s=null)},p}Y.debounce=Y;var ce=Y;const de=o.getDefaultExportFromCjs(ce);function Z({form:e,fieldName:n,triggerType:i=null,debounceTime:s=500}){const l=g.useCallback(()=>{e.trigger(n)},[e,n]),c=g.useMemo(()=>de(()=>l(),s),[l,s]),a=g.useMemo(()=>["all","onChange"].includes(i)?c:null,[c,i]),m=g.useMemo(()=>["all","onBlur"].includes(i)?l:null,[i]);return g.useMemo(()=>({onChangeTrigger:a,onBlurTrigger:m}),[a,m])}const ge=({form:e,name:n,label:i,options:s,readonly:l=!1,disabled:c=!1,optionsMap:a,width:m="100%",flex:x,placeholder:p,onSelect:u,parser:f,filter:$,tooltipProps:k={},infoProps:E={},maxHeigthMenu:h,isRequired:S=!1,onRemoveSelected:I,triggerFormField:C=null,displayText:v,...A})=>{const{onChangeTrigger:R}=Z({form:e,fieldName:n,triggerType:C,debounceTime:0}),O={position:"top",...k},L={...E,tooltipProps:{position:"top",maxWidth:"300px",...E==null?void 0:E.tooltipProps}},T=(y,W)=>{let M=y;f&&(M=f==null?void 0:f(y)),W(M),u==null||u(M),R==null||R()},w=g.useMemo(()=>F.valuable(a)?a:Object.fromEntries(s.map(y=>[y.value,y])),[s,a]);return o.jsxRuntimeExports.jsx(o.Container,{width:m,flex:x,children:o.jsxRuntimeExports.jsx(Q.Controller,{name:n,control:e.control,render:({field:{onChange:y,value:W},fieldState:{error:M=null}})=>{let j=w[W];return o.jsxRuntimeExports.jsx(K,{label:i,width:"100%",size:"Small",disabled:c,readonly:l,filter:$,errorMessage:M==null?void 0:M.message,placeholder:p,value:j,handleOption:d=>{T(d.value,y)},tooltipProps:O,options:s,maxHeigthMenu:h,infoProps:L,maxHeightMenu:h,isRequired:S,onRemoveSelected:I,displayText:v,...A})}})})},oe=({form:e,name:n,label:i,readonly:s=!1,disabled:l=!1,width:c="100%",height:a="100%",flex:m,placeholder:x,charactersCounter:p=!0,maxlength:u=1e3,resize:f=!0,triggerFormField:$=null,minHeight:k,maxHeight:E,...h})=>{const{onChangeTrigger:S}=Z({form:e,fieldName:n,triggerType:$}),I=(C,v)=>{v(C),S==null||S()};return o.jsxRuntimeExports.jsx(o.Container,{width:c,flex:m,height:a,children:o.jsxRuntimeExports.jsx(Q.Controller,{name:n,control:e.control,render:({field:{onChange:C,value:v},fieldState:{error:A=null}})=>o.jsxRuntimeExports.jsx(o.Textarea,{label:i,value:v||"",width:"100%",disabled:l,readonly:s,height:a,minHeight:k,maxHeight:E,errorMessage:A==null?void 0:A.message,placeholder:x,onChange:R=>I(R.target.value,C),charactersCounter:p,maxlength:u,size:"Small",resize:f,...h})})})};oe.displayName="TextareaField";const ue=({form:e,name:n,id:i=n,label:s,readonly:l=!1,disabled:c=!1,afterCheck:a,width:m="100%",formatter:x,parser:p,flex:u,size:f="Medium",triggerFormField:$=null,...k})=>{const{onChangeTrigger:E}=Z({form:e,fieldName:n,triggerType:$,debounceTime:0}),h=(S,I)=>{I(S),a==null||a(S),E==null||E()};return o.jsxRuntimeExports.jsx(o.Container,{width:m,flex:u,children:o.jsxRuntimeExports.jsx(Q.Controller,{name:n,control:e.control,render:({field:{onChange:S,value:I},fieldState:{error:C=null}})=>{const v=C==null?void 0:C.message;return v&&console.log("Error on checkbox!",v),o.jsxRuntimeExports.jsx(o.Checkbox,{id:`form-checkbox-${i}`,checked:(x==null?void 0:x(I))??I,name:n,label:s,disabled:c||l,onChange:A=>{h((p==null?void 0:p(A.target.checked,I))??A.target.checked,S)},size:f,...k})}})})},fe=o.qe.ul`
1
+ "use strict";const o=require("./Checkbox.view-DFbiE7Mi.cjs"),g=require("react"),t=require("sbwb-ds"),F=require("./index-BcwQwoIM.cjs"),Q=require("react-hook-form"),ee=350,ae=({title:e,children:n,endAdornment:i=null,marginBottom:s="16px",customStyles:l={},wrapperCustomStyles:c={},hideAdornmentOnCollapse:a=!1,maxHeight:x="none",height:p="fit-content"})=>{const[h,u]=g.useState(!1),[f,S]=g.useState(!0);g.useEffect(()=>{if(a)if(h){const m=setTimeout(()=>S(!1),ee);return()=>clearTimeout(m)}else S(!0)},[h,a]);const N=a&&!f?null:i;return o.jsxRuntimeExports.jsxs(o.Container,{width:"100%",flex:"1",gap:"8px",customStyles:c,children:[o.jsxRuntimeExports.jsx(o.SectionTitle,{title:e,divider:!0,marginBottom:s,collapse:{collapsed:h,setCollapsed:u},endAdornment:N,customStyles:l}),o.jsxRuntimeExports.jsx(o.Container,{gap:"8px",width:"100%",height:p,customStyles:{maxHeight:h?"0":x,transition:`max-height ${ee}ms ease-in-out`},children:n})]})};function Y(e,n,i){var s,l,c,a,x;n==null&&(n=100);function p(){var u=Date.now()-a;u<n&&u>=0?s=setTimeout(p,n-u):(s=null,i||(x=e.apply(c,l),c=l=null))}var h=function(){c=this,l=arguments,a=Date.now();var u=i&&!s;return s||(s=setTimeout(p,n)),u&&(x=e.apply(c,l),c=l=null),x};return h.clear=function(){s&&(clearTimeout(s),s=null)},h.flush=function(){s&&(x=e.apply(c,l),c=l=null,clearTimeout(s),s=null)},h}Y.debounce=Y;var ce=Y;const de=o.getDefaultExportFromCjs(ce);function Z({form:e,fieldName:n,triggerType:i=null,debounceTime:s=500}){const l=g.useCallback(()=>{e.trigger(n)},[e,n]),c=g.useMemo(()=>de(()=>l(),s),[l,s]),a=g.useMemo(()=>["all","onChange"].includes(i)?c:null,[c,i]),x=g.useMemo(()=>["all","onBlur"].includes(i)?l:null,[i]);return g.useMemo(()=>({onChangeTrigger:a,onBlurTrigger:x}),[a,x])}const ge=({form:e,name:n,label:i,options:s,readonly:l=!1,disabled:c=!1,optionsMap:a,width:x="100%",flex:p,placeholder:h,onSelect:u,parser:f,filter:S,tooltipProps:N={},infoProps:m={},maxHeigthMenu:C,isRequired:R=!1,onRemoveSelected:H,triggerFormField:j=null,displayText:W,...v})=>{const{onChangeTrigger:k}=Z({form:e,fieldName:n,triggerType:j,debounceTime:0}),O={position:"top",...N},L={...m,tooltipProps:{position:"top",maxWidth:"300px",...m==null?void 0:m.tooltipProps}},T=(w,I)=>{let A=w;f&&(A=f==null?void 0:f(w)),I(A),u==null||u(A),k==null||k()},$=g.useMemo(()=>F.valuable(a)?a:Object.fromEntries(s.map(w=>[w.value,w])),[s,a]);return o.jsxRuntimeExports.jsx(o.Container,{width:x,flex:p,children:o.jsxRuntimeExports.jsx(Q.Controller,{name:n,control:e.control,render:({field:{onChange:w,value:I},fieldState:{error:A=null}})=>{let y=$[I];return o.jsxRuntimeExports.jsx(K,{label:i,width:"100%",size:"Small",disabled:c,readonly:l,filter:S,errorMessage:A==null?void 0:A.message,placeholder:h,value:y,handleOption:d=>{T(d.value,w)},tooltipProps:O,options:s,maxHeigthMenu:C,infoProps:L,maxHeightMenu:C,isRequired:R,onRemoveSelected:H,displayText:W,...v})}})})},oe=({form:e,name:n,label:i,readonly:s=!1,disabled:l=!1,width:c="100%",height:a="100%",flex:x,placeholder:p,charactersCounter:h=!0,maxlength:u=1e3,resize:f=!0,triggerFormField:S=null,minHeight:N,maxHeight:m,...C})=>{const{onChangeTrigger:R}=Z({form:e,fieldName:n,triggerType:S}),H=(j,W)=>{W(j),R==null||R()};return o.jsxRuntimeExports.jsx(o.Container,{width:c,flex:x,height:a,children:o.jsxRuntimeExports.jsx(Q.Controller,{name:n,control:e.control,render:({field:{onChange:j,value:W},fieldState:{error:v=null}})=>o.jsxRuntimeExports.jsx(o.Textarea,{label:i,value:W||"",width:"100%",disabled:l,readonly:s,height:a,minHeight:N,maxHeight:m,errorMessage:v==null?void 0:v.message,placeholder:p,onChange:k=>H(k.target.value,j),charactersCounter:h,maxlength:u,size:"Small",resize:f,...C})})})};oe.displayName="TextareaField";const ue=({form:e,name:n,id:i=n,label:s,readonly:l=!1,disabled:c=!1,afterCheck:a,width:x="100%",formatter:p,parser:h,flex:u,size:f="Medium",triggerFormField:S=null,...N})=>{const{onChangeTrigger:m}=Z({form:e,fieldName:n,triggerType:S,debounceTime:0}),C=(R,H)=>{H(R),a==null||a(R),m==null||m()};return o.jsxRuntimeExports.jsx(o.Container,{width:x,flex:u,children:o.jsxRuntimeExports.jsx(Q.Controller,{name:n,control:e.control,render:({field:{onChange:R,value:H},fieldState:{error:j=null}})=>{const W=j==null?void 0:j.message;return W&&console.log("Error on checkbox!",W),o.jsxRuntimeExports.jsx(o.Checkbox,{id:`form-checkbox-${i}`,checked:(p==null?void 0:p(H))??H,name:n,label:s,disabled:c||l,onChange:v=>{C((h==null?void 0:h(v.target.checked,H))??v.target.checked,R)},size:f,...N})}})})},fe=o.qe.ul`
2
2
  ${F.resetStyles}
3
3
  position: fixed;
4
4
  margin-top: ${({marginTop:e})=>e};
@@ -118,7 +118,7 @@
118
118
  margin: 0;
119
119
  display: flex;
120
120
  align-self: center;
121
- `,we=(e,n,i=0,s=0,l="left")=>{const[c,a]=g.useState(0),[m,x]=g.useState(),p=g.useRef(null),u=g.useCallback(()=>{if(!e.current||!p.current)return;const f=e.current.getBoundingClientRect(),$=p.current.getBoundingClientRect(),k=window.innerHeight,E=window.innerWidth,h=f.top,S=k-f.bottom,I=S<$.height+s&&h>S;let C;I?(C=f.top-$.height-i,p.current.style.maxHeight=`${h-i}px`):(C=f.bottom+s,p.current.style.maxHeight=`${S-s}px`);let v=f.left;const A=v+$.width-E;A>0&&(v-=A),v<0&&(v=0);const R=E-f.right;Object.assign(p.current.style,{position:"fixed",top:`${C}px`,...l==="left"?{left:`${v}px`}:{right:`${R}px`},width:`${Math.max(f.width,$.width)}px`,overflowY:"auto"})},[i,s,l]);return g.useEffect(()=>{var $;a(0),x(($=e.current)==null?void 0:$.clientWidth),u();const f=()=>u();return window.addEventListener("scroll",f,!0),window.addEventListener("resize",f),()=>{window.removeEventListener("scroll",f,!0),window.removeEventListener("resize",f)}},[e,u]),{highlightedIndex:c,setHighlightedIndex:a,isOptionSelected:f=>f.label===(n==null?void 0:n.label),optionsRef:p,parentWidth:m}},J=g.forwardRef(({selectContainerRef:e,optionsSelect:n,size:i,selectOption:s,value:l,inputValue:c,widthMenu:a,maxHeightMenu:m="180px",menuIsOpen:x,onEnter:p,marginTop:u="4px",iconName:f,iconColor:$,iconPosition:k,topOffset:E=0,bottomOffset:h=0,truncateText:S=!0,menuJustifyContent:I="flex-start",tableActionButton:C,menuLateralPadding:v="8px",menuOptionFlexDirection:A="column",confirmSelection:R,menuAlign:O="left"},L)=>{F.valuable(f)&&(f+="Ant");const{highlightedIndex:T,setHighlightedIndex:w,isOptionSelected:y,optionsRef:W,parentWidth:M}=we(e,l,E,h,O);g.useEffect(()=>{const r=b=>{if(x){if(b.key==="ArrowDown")b.preventDefault(),w(z=>z<n.length-1?z+1:z);else if(b.key==="ArrowUp")b.preventDefault(),w(z=>z>0?z-1:0);else if(b.key==="Enter"&&n[T]){b.preventDefault();const z=n[T];s(z),p&&p(z)}}};return window.addEventListener("keydown",r),()=>window.removeEventListener("keydown",r)},[x,n,T,p,s,R]);const j=r=>typeof r=="string"?r:g.isValidElement(r)&&typeof r.props.children=="string"?r.props.children:String(r),d=(r,b)=>{var H,N;if(k!==b)return null;const z=F.valuable((H=r.tooltipProps)==null?void 0:H.label),B=r.iconName||f||"InfoFill0Sm",P=o.jsxRuntimeExports.jsx($e,{iconPosition:(N=r.tooltipProps)==null?void 0:N.position,id:`iconContainer-${r.value}`,children:o.jsxRuntimeExports.jsx(t.Icon,{iconName:B,color:r.disabled?t.sg.colors.neutralColors.colorNeutralCleanest:y(r)?t.sg.colors.brandColors.colorBrandSoft:$??t.sg.colors.neutralColors.colorNeutralDark})});return z?o.jsxRuntimeExports.jsx(o.Tooltip,{...r==null?void 0:r.tooltipProps,isActive:!0,children:P}):P};return o.jsxRuntimeExports.jsx(fe,{marginTop:u,width:a??`${M}px`,maxHeight:m,height:"fit-content",ref:r=>{W.current=r,typeof L=="function"?L(r):L&&(L.current=r)},"data-testid":"MenuSelect",id:"MenuSelect",children:n.length===0?o.jsxRuntimeExports.jsx(he,{size:i,children:"Sem opções"}):n.map((r,b)=>{var P,H;const z=typeof r.render=="function"?r.render():null,B=j(r.label);if(r.isSection)return o.jsxRuntimeExports.jsx(me,{size:i,children:B},B);{const N=B.toLowerCase().indexOf((c==null?void 0:c.toLowerCase())||"");return o.jsxRuntimeExports.jsxs(be,{isOptionSelected:y(r),highlightedIndex:b===T,onClick:D=>{D.stopPropagation(),r.disabled||(R?o.showConfirm({id:"select-option",title:R.title,description:R.description,icon:R.icon,iconColor:R.iconColor,leftButtonProps:{name:"Cancelar",variant:"tertiary",onClick:()=>{}},rightButtonProps:{name:"Confirmar",variant:"secondary",onClick:()=>s(r)}}):s(r))},onMouseEnter:()=>w(b),disabled:r.disabled,size:i,menuLateralPadding:v,children:[d(r,"left"),o.jsxRuntimeExports.jsxs(xe,{menuOptionFlexDirection:A,menuJustifyContent:I,iconName:f,isOptionSelected:y(r),highlightedIndex:b===T,"data-testid":r.value,size:i,hasDescription:!!r.description,optionValue:r.value,disabled:r.disabled,truncateText:S,tableActionButton:C,children:[o.jsxRuntimeExports.jsxs(Se,{truncateText:!g.isValidElement(r.label)&&S,children:[z,g.isValidElement(r.label)?o.jsxRuntimeExports.jsx("p",{title:((P=r==null?void 0:r.tooltipProps)==null?void 0:P.label)??j(r.label),children:r.label}):o.jsxRuntimeExports.jsx("p",{title:((H=r==null?void 0:r.tooltipProps)==null?void 0:H.label)??B,children:c&&N>=0?o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[B.substring(0,N),o.jsxRuntimeExports.jsx(pe,{size:i,children:B.substring(N,N+((c==null?void 0:c.length)||0))}),B.substring(N+((c==null?void 0:c.length)||0))]}):B})]}),r.description&&o.jsxRuntimeExports.jsx("p",{title:r.description,children:r.description})]}),d(r,"right")]},String(r.value))}})})});J.displayName="MenuSelect";const ne=({title:e,iconName:n,onClickIcon:i,width:s,height:l,flex:c,children:a,wrapperCustomStyles:m={},contentCustomStyles:x={},titleCustomStyles:p={}})=>o.jsxRuntimeExports.jsxs(o.Container,{width:s,height:l,flex:c,direction:"vertical",padding:t.sg.spacings.spacingStack.spacingStackSm,customStyles:{backgroundColor:t.sg.colors.backgroundColors.colorBackgroundSnow,border:`1px solid ${t.sg.colors.neutralColors.colorNeutralSoft}`,borderRadius:"8px",...m},children:[o.jsxRuntimeExports.jsxs(o.Container,{width:"100%",direction:"horizontal",customStyles:x,children:[e?o.jsxRuntimeExports.jsx(o.Container,{width:"fit-content",customStyles:p,children:o.jsxRuntimeExports.jsx(o.SectionTitle,{title:e,divider:!1})}):null,n?o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx(o.Spacer,{size:"auto",direction:"horizontal"}),o.jsxRuntimeExports.jsx(t.Icon,{iconName:n,onClick:()=>i==null?void 0:i(),color:F.valuable(i)?t.sg.colors.neutralColors.colorNeutralDark:t.sg.colors.neutralColors.colorNeutralCloudy,cursorPointer:F.valuable(i)})]}):null]}),o.jsxRuntimeExports.jsx(o.Container,{width:"100%",flex:"1",children:a})]});ne.displayName="Section";const ye=o.qe.div`
121
+ `,we=(e,n,i=0,s=0,l="left")=>{const[c,a]=g.useState(0),[x,p]=g.useState(),h=g.useRef(null),u=g.useCallback(()=>{if(!e.current||!h.current)return;const f=e.current.getBoundingClientRect(),S=h.current.getBoundingClientRect(),N=window.innerHeight,m=window.innerWidth,C=f.top,R=N-f.bottom,H=R<S.height+s&&C>R;let j;H?(j=f.top-S.height-i,h.current.style.maxHeight=`${C-i}px`):(j=f.bottom+s,h.current.style.maxHeight=`${R-s}px`);let W=f.left;const v=W+S.width-m;v>0&&(W-=v),W<0&&(W=0);const k=m-f.right;Object.assign(h.current.style,{position:"fixed",top:`${j}px`,...l==="left"?{left:`${W}px`}:{right:`${k}px`},width:`${Math.max(f.width,S.width)}px`,overflowY:"auto"})},[i,s,l]);return g.useEffect(()=>{var S;a(0),p((S=e.current)==null?void 0:S.clientWidth),u();const f=()=>u();return window.addEventListener("scroll",f,!0),window.addEventListener("resize",f),()=>{window.removeEventListener("scroll",f,!0),window.removeEventListener("resize",f)}},[e,u]),{highlightedIndex:c,setHighlightedIndex:a,isOptionSelected:f=>f.label===(n==null?void 0:n.label),optionsRef:h,parentWidth:x}},J=g.forwardRef(({selectContainerRef:e,optionsSelect:n,size:i,selectOption:s,value:l,inputValue:c,widthMenu:a,maxHeightMenu:x="180px",menuIsOpen:p,onEnter:h,marginTop:u="4px",iconName:f,iconColor:S,iconPosition:N,topOffset:m=0,bottomOffset:C=0,truncateText:R=!0,menuJustifyContent:H="flex-start",tableActionButton:j,menuLateralPadding:W="8px",menuOptionFlexDirection:v="column",confirmSelection:k,menuAlign:O="left"},L)=>{F.valuable(f)&&(f+="Ant");const{highlightedIndex:T,setHighlightedIndex:$,isOptionSelected:w,optionsRef:I,parentWidth:A}=we(e,l,m,C,O);g.useEffect(()=>{const r=b=>{if(p){if(b.key==="ArrowDown")b.preventDefault(),$(E=>E<n.length-1?E+1:E);else if(b.key==="ArrowUp")b.preventDefault(),$(E=>E>0?E-1:0);else if(b.key==="Enter"&&n[T]){b.preventDefault();const E=n[T];s(E),h&&h(E)}}};return window.addEventListener("keydown",r),()=>window.removeEventListener("keydown",r)},[p,n,T,h,s,k]);const y=r=>typeof r=="string"?r:g.isValidElement(r)&&typeof r.props.children=="string"?r.props.children:String(r),d=(r,b)=>{var M,B;if(N!==b)return null;const E=F.valuable((M=r.tooltipProps)==null?void 0:M.label),z=r.iconName||f||"InfoFill0Sm",P=o.jsxRuntimeExports.jsx($e,{iconPosition:(B=r.tooltipProps)==null?void 0:B.position,id:`iconContainer-${r.value}`,children:o.jsxRuntimeExports.jsx(t.Icon,{iconName:z,color:r.disabled?t.sg.colors.neutralColors.colorNeutralCleanest:w(r)?t.sg.colors.brandColors.colorBrandSoft:S??t.sg.colors.neutralColors.colorNeutralDark})});return E?o.jsxRuntimeExports.jsx(o.Tooltip,{...r==null?void 0:r.tooltipProps,isActive:!0,children:P}):P};return o.jsxRuntimeExports.jsx(fe,{marginTop:u,width:a??`${A}px`,maxHeight:x,height:"fit-content",ref:r=>{I.current=r,typeof L=="function"?L(r):L&&(L.current=r)},"data-testid":"MenuSelect",id:"MenuSelect",children:n.length===0?o.jsxRuntimeExports.jsx(he,{size:i,children:"Sem opções"}):n.map((r,b)=>{var P,M;const E=typeof r.render=="function"?r.render():null,z=y(r.label);if(r.isSection)return o.jsxRuntimeExports.jsx(me,{size:i,children:z},z);{const B=z.toLowerCase().indexOf((c==null?void 0:c.toLowerCase())||"");return o.jsxRuntimeExports.jsxs(be,{isOptionSelected:w(r),highlightedIndex:b===T,onClick:D=>{D.stopPropagation(),r.disabled||(k?o.showConfirm({id:"select-option",title:k.title,description:k.description,icon:k.icon,iconColor:k.iconColor,leftButtonProps:{name:"Cancelar",variant:"tertiary",onClick:()=>{}},rightButtonProps:{name:"Confirmar",variant:"secondary",onClick:()=>s(r)}}):s(r))},onMouseEnter:()=>$(b),disabled:r.disabled,size:i,menuLateralPadding:W,children:[d(r,"left"),o.jsxRuntimeExports.jsxs(xe,{menuOptionFlexDirection:v,menuJustifyContent:H,iconName:f,isOptionSelected:w(r),highlightedIndex:b===T,"data-testid":r.value,size:i,hasDescription:!!r.description,optionValue:r.value,disabled:r.disabled,truncateText:R,tableActionButton:j,children:[o.jsxRuntimeExports.jsxs(Se,{truncateText:!g.isValidElement(r.label)&&R,children:[E,g.isValidElement(r.label)?o.jsxRuntimeExports.jsx("p",{title:((P=r==null?void 0:r.tooltipProps)==null?void 0:P.label)??y(r.label),children:r.label}):o.jsxRuntimeExports.jsx("p",{title:((M=r==null?void 0:r.tooltipProps)==null?void 0:M.label)??z,children:c&&B>=0?o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[z.substring(0,B),o.jsxRuntimeExports.jsx(pe,{size:i,children:z.substring(B,B+((c==null?void 0:c.length)||0))}),z.substring(B+((c==null?void 0:c.length)||0))]}):z})]}),r.description&&o.jsxRuntimeExports.jsx("p",{title:r.description,children:r.description})]}),d(r,"right")]},String(r.value))}})})});J.displayName="MenuSelect";const ne=({title:e,iconName:n,onClickIcon:i,width:s,height:l,flex:c,children:a,wrapperCustomStyles:x={},contentCustomStyles:p={},titleCustomStyles:h={}})=>o.jsxRuntimeExports.jsxs(o.Container,{width:s,height:l,flex:c,direction:"vertical",padding:t.sg.spacings.spacingStack.spacingStackSm,customStyles:{backgroundColor:t.sg.colors.backgroundColors.colorBackgroundSnow,border:`1px solid ${t.sg.colors.neutralColors.colorNeutralSoft}`,borderRadius:"8px",...x},children:[o.jsxRuntimeExports.jsxs(o.Container,{width:"100%",direction:"horizontal",customStyles:p,children:[e?o.jsxRuntimeExports.jsx(o.Container,{width:"fit-content",customStyles:h,children:o.jsxRuntimeExports.jsx(o.SectionTitle,{title:e,divider:!1})}):null,n?o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx(o.Spacer,{size:"auto",direction:"horizontal"}),o.jsxRuntimeExports.jsx(t.Icon,{iconName:n,onClick:()=>i==null?void 0:i(),color:F.valuable(i)?t.sg.colors.neutralColors.colorNeutralDark:t.sg.colors.neutralColors.colorNeutralCloudy,cursorPointer:F.valuable(i)})]}):null]}),o.jsxRuntimeExports.jsx(o.Container,{width:"100%",flex:"1",children:a})]});ne.displayName="Section";const ye=o.qe.div`
122
122
  ${F.resetStyles}
123
123
  display: flex;
124
124
  flex-direction: column;
@@ -258,14 +258,14 @@
258
258
  color: ${t.sg.colors.neutralColors.colorNeutralDark};
259
259
  margin-top: ${t.sg.spacings.spacingInline.spacingInlineNano};
260
260
  width: 100%;
261
- `,We=(e,{value:n,options:i})=>{const[s,l]=g.useState(!1),[c,a]=g.useState(!1),[m,x]=g.useState(""),[p,u]=g.useState(i),f=g.useRef(null),$=g.useRef(null),k=g.useRef(null),E=g.useRef(null);g.useEffect(()=>{const C=()=>{a(!1)};return window.addEventListener("scroll",C,{passive:!0}),window.addEventListener("resize",C,{passive:!0}),()=>{window.removeEventListener("scroll",C),window.removeEventListener("resize",C)}},[]);function h(C){x(""),a(!1),l(!0),k!=null&&k.current&&k.current.focus(),C!==n&&e(C)}const S=C=>{if(C){const v=new RegExp(C,"i"),A=i.filter(R=>v.exec(R.label));u(A)}else u(i)};function I(C){return!C}return{isOpen:s,setIsOpen:l,expanded:c,setExpanded:a,inputValue:m,setInputValue:x,optionsSelect:p,setOptionSelect:u,selectContainerRef:f,containerRef:$,inputContainerRef:k,optionsRef:E,selectOption:h,handlerFilterOptions:S,isValue:I}},K=g.forwardRef(({value:e,handleOption:n,options:i,filter:s=!0,placeholder:l,label:c,size:a="Medium",width:m="100%",disabled:x,helpText:p,readonly:u,errorMessage:f,tooltipProps:$={},onBlur:k,onEnter:E,variant:h="default",infoProps:S={},maxHeightMenu:I,isRequired:C=!1,onRemoveSelected:v,displayText:A,displayTextProps:R={}},O)=>{const{isOpen:L,setIsOpen:T,expanded:w,setExpanded:y,inputValue:W,setInputValue:M,optionsSelect:j,selectContainerRef:d,containerRef:r,inputContainerRef:b,selectOption:z,setOptionSelect:B,handlerFilterOptions:P,isValue:H}=We(n,{value:e,options:i}),N=!!f,D={label:f,...$,wrapperWidth:"auto",isActive:N,isErrorTooltip:!0},q={...S,size:a},_=o.jsxRuntimeExports.jsx(t.Icon,{iconName:`Close${a==="Small"?"Sm":"Ant"}`,onClick:X=>{X.stopPropagation(),v(e)}}),V=o.jsxRuntimeExports.jsx(t.Icon,{iconName:`ExpandLess${a==="Small"?"Sm":"Ant"}`}),le=o.jsxRuntimeExports.jsx(t.Icon,{iconName:`ExpandMore${a==="Small"?"Sm":"Ant"}`});return o.jsxRuntimeExports.jsxs(ye,{ref:d,width:m,size:a,disabled:x,readonly:u,children:[c&&o.jsxRuntimeExports.jsxs(Ee,{children:[o.jsxRuntimeExports.jsxs(ze,{"data-testid":"label",ref:O,children:[c,C&&!x?o.jsxRuntimeExports.jsx(Be,{children:" *"}):null]}),((q==null?void 0:q.message)||(q==null?void 0:q.render))&&o.jsxRuntimeExports.jsx(o.Info,{...q})]}),o.jsxRuntimeExports.jsx(o.Tooltip,{...D,children:o.jsxRuntimeExports.jsxs(je,{hasError:N,readonly:u,ref:r,onBlur:()=>{setTimeout(()=>{(L||w)&&b.current!==document.activeElement&&(k&&k(e),T(!1),y(!1))},250)},onClick:()=>{!x&&!u&&(L&&!w?(y(!0),b!=null&&b.current&&b.current.focus()):!L&&!w?(T(!0),y(!0),b!=null&&b.current&&b.current.focus()):(T(!1),y(!1),b!=null&&b.current&&b.current.blur()),!W&&B(i))},tabIndex:0,width:m,size:a,isOpen:L||w,"data-testid":"select",disabled:x,helpText:p,variant:h,children:[o.jsxRuntimeExports.jsxs(Ce,{children:[F.valuable(A)?o.jsxRuntimeExports.jsx(te,{size:a,variant:h,isDisplayText:!0,children:o.jsxRuntimeExports.jsx("p",{title:e==null?void 0:e.label,...R,children:A})}):o.jsxRuntimeExports.jsxs(te,{size:a,variant:h,children:[l&&H(e)&&!W&&!L?o.jsxRuntimeExports.jsx(Re,{size:a,variant:h,children:l}):null,(e==null?void 0:e.label)&&o.jsxRuntimeExports.jsx("p",{title:(e==null?void 0:e.hint)??(e==null?void 0:e.label),children:e==null?void 0:e.label})]}),s&&!F.valuable(A)&&o.jsxRuntimeExports.jsx(ke,{ref:b,value:W,onChange:X=>{M(X.target.value),X.target.value.length>0&&(T(!0),y(!0)),P(X.target.value)},readOnly:u,width:W.length,size:a,disabled:x,variant:h})]}),v&&e?_:null,w?V:le,w&&o.jsxRuntimeExports.jsx(J,{onEnter:X=>{n&&n(X),T(!1),y(!1),E&&E(X)},menuIsOpen:L,selectContainerRef:d,value:e,optionsSelect:j,selectOption:z,size:a,inputValue:W,maxHeightMenu:I})]})}),p&&o.jsxRuntimeExports.jsx(Ne,{size:a,children:p})]})});K.displayName="Select";const re=o.We`
261
+ `,Ie=(e,{value:n,options:i})=>{const[s,l]=g.useState(!1),[c,a]=g.useState(!1),[x,p]=g.useState(""),[h,u]=g.useState(i),f=g.useRef(null),S=g.useRef(null),N=g.useRef(null),m=g.useRef(null);g.useEffect(()=>{const j=()=>{a(!1)};return window.addEventListener("scroll",j,{passive:!0}),window.addEventListener("resize",j,{passive:!0}),()=>{window.removeEventListener("scroll",j),window.removeEventListener("resize",j)}},[]);function C(j){p(""),a(!1),l(!0),N!=null&&N.current&&N.current.focus(),j!==n&&e(j)}const R=j=>{if(j){const W=new RegExp(j,"i"),v=i.filter(k=>W.exec(k.label));u(v)}else u(i)};function H(j){return!j}return{isOpen:s,setIsOpen:l,expanded:c,setExpanded:a,inputValue:x,setInputValue:p,optionsSelect:h,setOptionSelect:u,selectContainerRef:f,containerRef:S,inputContainerRef:N,optionsRef:m,selectOption:C,handlerFilterOptions:R,isValue:H}},K=g.forwardRef(({value:e,handleOption:n,options:i,filter:s=!0,placeholder:l,label:c,size:a="Medium",width:x="100%",disabled:p,helpText:h,readonly:u,errorMessage:f,tooltipProps:S={},onBlur:N,onEnter:m,variant:C="default",infoProps:R={},maxHeightMenu:H,isRequired:j=!1,onRemoveSelected:W,displayText:v,displayTextProps:k={}},O)=>{const{isOpen:L,setIsOpen:T,expanded:$,setExpanded:w,inputValue:I,setInputValue:A,optionsSelect:y,selectContainerRef:d,containerRef:r,inputContainerRef:b,selectOption:E,setOptionSelect:z,handlerFilterOptions:P,isValue:M}=Ie(n,{value:e,options:i}),B=!!f,D={label:f,...S,wrapperWidth:"auto",isActive:B,isErrorTooltip:!0},q={...R,size:a},_=o.jsxRuntimeExports.jsx(t.Icon,{iconName:`Close${a==="Small"?"Sm":"Ant"}`,onClick:X=>{X.stopPropagation(),W(e)}}),V=o.jsxRuntimeExports.jsx(t.Icon,{iconName:`ExpandLess${a==="Small"?"Sm":"Ant"}`}),le=o.jsxRuntimeExports.jsx(t.Icon,{iconName:`ExpandMore${a==="Small"?"Sm":"Ant"}`});return o.jsxRuntimeExports.jsxs(ye,{ref:d,width:x,size:a,disabled:p,readonly:u,children:[c&&o.jsxRuntimeExports.jsxs(Ee,{children:[o.jsxRuntimeExports.jsxs(ze,{"data-testid":"label",ref:O,children:[c,j&&!p?o.jsxRuntimeExports.jsx(Be,{children:" *"}):null]}),((q==null?void 0:q.message)||(q==null?void 0:q.render))&&o.jsxRuntimeExports.jsx(o.Info,{...q})]}),o.jsxRuntimeExports.jsx(o.Tooltip,{...D,children:o.jsxRuntimeExports.jsxs(je,{hasError:B,readonly:u,ref:r,onBlur:()=>{setTimeout(()=>{(L||$)&&b.current!==document.activeElement&&(N&&N(e),T(!1),w(!1))},250)},onClick:()=>{!p&&!u&&(L&&!$?(w(!0),b!=null&&b.current&&b.current.focus()):!L&&!$?(T(!0),w(!0),b!=null&&b.current&&b.current.focus()):(T(!1),w(!1),b!=null&&b.current&&b.current.blur()),!I&&z(i))},tabIndex:0,width:x,size:a,isOpen:L||$,"data-testid":"select",disabled:p,helpText:h,variant:C,children:[o.jsxRuntimeExports.jsxs(Ce,{children:[F.valuable(v)?o.jsxRuntimeExports.jsx(te,{size:a,variant:C,isDisplayText:!0,children:o.jsxRuntimeExports.jsx("p",{title:e==null?void 0:e.label,...k,children:v})}):o.jsxRuntimeExports.jsxs(te,{size:a,variant:C,children:[l&&M(e)&&!I&&!L?o.jsxRuntimeExports.jsx(Re,{size:a,variant:C,children:l}):null,(e==null?void 0:e.label)&&o.jsxRuntimeExports.jsx("p",{title:(e==null?void 0:e.hint)??(e==null?void 0:e.label),children:e==null?void 0:e.label})]}),s&&!F.valuable(v)&&o.jsxRuntimeExports.jsx(ke,{ref:b,value:I,onChange:X=>{A(X.target.value),X.target.value.length>0&&(T(!0),w(!0)),P(X.target.value)},readOnly:u,width:I.length,size:a,disabled:p,variant:C})]}),W&&e?_:null,$?V:le,$&&o.jsxRuntimeExports.jsx(J,{onEnter:X=>{n&&n(X),T(!1),w(!1),m&&m(X)},menuIsOpen:L,selectContainerRef:d,value:e,optionsSelect:y,selectOption:E,size:a,inputValue:I,maxHeightMenu:H})]})}),h&&o.jsxRuntimeExports.jsx(Ne,{size:a,children:h})]})});K.displayName="Select";const re=o.We`
262
262
  from {
263
263
  transform: rotate(0deg);
264
264
  }
265
265
  to {
266
266
  transform: rotate(360deg);
267
267
  }
268
- `,Ie=o.qe.button`
268
+ `,We=o.qe.button`
269
269
  display: flex;
270
270
  justify-content: space-between;
271
271
  align-items: center;
@@ -380,11 +380,13 @@
380
380
  &:hover {
381
381
  cursor: not-allowed;
382
382
  }
383
- `,He=e=>{const[n,i]=g.useState(!1),[s,l]=g.useState(e),c=g.useRef(null);return g.useEffect(()=>{l(e)},[e]),{setIsOpen:i,isOpen:n,setOptionsSelect:l,optionsSelect:s,selectContainerRef:c}},Fe=200,Le=({name:e,variant:n="primary",width:i="100%",size:s="Medium",disabled:l=!1,isLoading:c=!1,onClick:a,options:m,label:x,menuSelectProps:p={},iconName:u,optionsIconPosition:f})=>{const{isOpen:$,setIsOpen:k,selectContainerRef:E,optionsSelect:h}=He(m);let S=t.sg.colors.backgroundColors.colorBackgroundSnow;l?S=t.sg.colors.neutralColors.colorNeutralCloudy:n!=="primary"&&(S=t.sg.colors.neutralColors.colorNeutralDark);const I={...p};return o.jsxRuntimeExports.jsxs(ve,{ref:E,width:i,size:s,disabled:l,onBlur:()=>setTimeout(()=>k(!1),Fe),children:[x&&o.jsxRuntimeExports.jsx(Ae,{children:x}),o.jsxRuntimeExports.jsxs(Ie,{type:"button",size:s,disabled:l,variant:n,isLoading:c,onClick:()=>!c&&k(!$),id:`button-component-${e}`,children:[c&&o.jsxRuntimeExports.jsx(Me,{size:s,disabled:l,variant:n,children:o.jsxRuntimeExports.jsx(t.Icon,{iconName:`ProgressActivity${s==="Small"?"Ant":"Sm"}`,color:S,"data-testid":"icon-loading"})}),!c&&o.jsxRuntimeExports.jsx("p",{title:e,children:e}),!c&&($?o.jsxRuntimeExports.jsx(t.Icon,{iconName:`ExpandLess${s==="Small"?"Ant":"Sm"}`,color:S,"data-testid":"icon-button-less"}):o.jsxRuntimeExports.jsx(t.Icon,{iconName:`ExpandMore${s==="Small"?"Ant":"Sm"}`,color:S,"data-testid":"icon-button-more"}))]}),$&&o.jsxRuntimeExports.jsx(J,{selectContainerRef:E,value:null,optionsSelect:h,selectOption:a,size:s,inputValue:null,iconPosition:f,iconName:u,...I})]})},Te=o.qe.div`
383
+ `,He=e=>{const[n,i]=g.useState(!1),[s,l]=g.useState(e),c=g.useRef(null);return g.useEffect(()=>{l(e)},[e]),{setIsOpen:i,isOpen:n,setOptionsSelect:l,optionsSelect:s,selectContainerRef:c}},Fe=200,Le=({name:e,variant:n="primary",width:i="100%",size:s="Medium",disabled:l=!1,isLoading:c=!1,onClick:a,options:x,label:p,menuSelectProps:h={},iconName:u,optionsIconPosition:f})=>{const{isOpen:S,setIsOpen:N,selectContainerRef:m,optionsSelect:C}=He(x);let R=t.sg.colors.backgroundColors.colorBackgroundSnow;l?R=t.sg.colors.neutralColors.colorNeutralCloudy:n!=="primary"&&(R=t.sg.colors.neutralColors.colorNeutralDark);const H={...h};return o.jsxRuntimeExports.jsxs(ve,{ref:m,width:i,size:s,disabled:l,onBlur:()=>setTimeout(()=>N(!1),Fe),children:[p&&o.jsxRuntimeExports.jsx(Ae,{children:p}),o.jsxRuntimeExports.jsxs(We,{type:"button",size:s,disabled:l,variant:n,isLoading:c,onClick:()=>!c&&N(!S),id:`button-component-${e}`,children:[c&&o.jsxRuntimeExports.jsx(Me,{size:s,disabled:l,variant:n,children:o.jsxRuntimeExports.jsx(t.Icon,{iconName:`ProgressActivity${s==="Small"?"Ant":"Sm"}`,color:R,"data-testid":"icon-loading"})}),!c&&o.jsxRuntimeExports.jsx("p",{title:e,children:e}),!c&&(S?o.jsxRuntimeExports.jsx(t.Icon,{iconName:`ExpandLess${s==="Small"?"Ant":"Sm"}`,color:R,"data-testid":"icon-button-less"}):o.jsxRuntimeExports.jsx(t.Icon,{iconName:`ExpandMore${s==="Small"?"Ant":"Sm"}`,color:R,"data-testid":"icon-button-more"}))]}),S&&o.jsxRuntimeExports.jsx(J,{selectContainerRef:m,value:null,optionsSelect:C,selectOption:a,size:s,inputValue:null,iconPosition:f,iconName:u,...H})]})},Te=o.qe.div`
384
384
  min-width: ${({widthItems:e})=>e};
385
385
  max-width: ${({widthItems:e})=>e};
386
386
  height: 100%;
387
387
  overflow: hidden;
388
+ display: flex;
389
+ flex-direction: column;
388
390
 
389
391
  &:hover {
390
392
  overflow: auto;
@@ -402,7 +404,7 @@
402
404
  `}
403
405
  cursor: pointer;
404
406
  ${({customStyles:e})=>e&&o.Ae(e)}
405
- `,Pe=o.qe.div`
407
+ `;o.qe.div`
406
408
  max-width: 4px;
407
409
  min-width: 4px;
408
410
  min-height: ${({heightItems:e})=>e};
@@ -414,19 +416,25 @@
414
416
  border-right: ${({selected:n})=>n?"none":`1px solid ${t.sg.colors.neutralColors.colorNeutralSoft}`};
415
417
  `}
416
418
  cursor: pointer;
417
- `,De=o.qe.div`
419
+ `;const Pe=o.qe.div`
418
420
  display: flex;
419
421
  min-width: 0;
420
422
  height: 100%;
421
423
  flex: 1;
422
424
  background-color: ${t.sg.colors.backgroundColors.colorBackgroundSnow};
423
- `,Oe=o.qe.div`
425
+ `;o.qe.div`
424
426
  max-width: 4px;
425
427
  min-width: 4px;
426
428
  height: 100%;
427
429
  background-color: 'transparent';
428
430
  overflow: hidden;
429
- `,Xe=({width:e="100%",height:n="fit-content",flex:i,backgroundColor:s="white",options:l=[],heightItems:c="60px",widthItems:a="155px",emptyProps:m={title:"Nenhum dado a ser mostrado",body:null},customWrapperStyles:x={},customItemStyles:p={}})=>{var E;const[u,f]=g.useState(l[0]||null),$=g.useRef(null),k=g.useRef(null);return g.useEffect(()=>{const h=$.current,S=k.current,I=()=>{h&&S&&(S.scrollTop=h.scrollTop)};return h==null||h.addEventListener("scroll",I),()=>{h==null||h.removeEventListener("scroll",I)}},[]),g.useEffect(()=>{f(l[(l==null?void 0:l.length)-1]||null)},[l==null?void 0:l.length]),(l==null?void 0:l.length)===0?o.jsxRuntimeExports.jsx(o.Empty,{title:m.title,body:m.body,flex:"1",mode:"table"}):o.jsxRuntimeExports.jsxs(o.Container,{width:e,height:n,flex:i,backgroundColor:s,direction:"horizontal",customStyles:{border:`1px solid ${t.sg.colors.neutralColors.colorNeutralSoft}`,borderRadius:t.sg.borders.borderRadius.borderRadiusSm,...x},children:[o.jsxRuntimeExports.jsx(Te,{ref:$,widthItems:a,children:l==null?void 0:l.map((h,S)=>o.jsxRuntimeExports.jsx(qe,{selected:(u==null?void 0:u.key)===h.key,onClick:()=>f(h),withBorderRight:!0,heightItems:c,customStyles:p,children:h.item},S))}),o.jsxRuntimeExports.jsx(Oe,{ref:k,children:(E=l==null?void 0:l.concat({key:"last",item:o.jsxRuntimeExports.jsx(o.jsxRuntimeExports.Fragment,{}),contentItem:o.jsxRuntimeExports.jsx(o.jsxRuntimeExports.Fragment,{})}))==null?void 0:E.map((h,S)=>o.jsxRuntimeExports.jsx(Pe,{selected:(u==null?void 0:u.key)===h.key,onClick:()=>f(h),withBorderRight:!0,heightItems:c},S))}),o.jsxRuntimeExports.jsx(De,{children:u&&(u==null?void 0:u.contentItem)})]})},se=o.Ae`
431
+ `;const De=o.qe.div`
432
+ flex: 1;
433
+ width: 100%;
434
+ background-color: 'transparent';
435
+ border-right: 1px solid ${t.sg.colors.neutralColors.colorNeutralSoft};
436
+ overflow: hidden;
437
+ `,Oe=({width:e="100%",height:n="fit-content",flex:i,backgroundColor:s="white",options:l=[],heightItems:c="60px",widthItems:a="155px",emptyProps:x={title:"Nenhum dado a ser mostrado",body:null},customWrapperStyles:p={},customItemStyles:h={}})=>{const[u,f]=g.useState(l[0]||null),S=g.useRef(null),N=g.useRef(null);return g.useEffect(()=>{const m=S.current,C=N.current,R=()=>{m&&C&&(C.scrollTop=m.scrollTop)};return m==null||m.addEventListener("scroll",R),()=>{m==null||m.removeEventListener("scroll",R)}},[]),g.useEffect(()=>{f(l[(l==null?void 0:l.length)-1]||null)},[l==null?void 0:l.length]),(l==null?void 0:l.length)===0?o.jsxRuntimeExports.jsx(o.Empty,{title:x.title,body:x.body,flex:"1",mode:"table"}):o.jsxRuntimeExports.jsxs(o.Container,{width:e,height:n,flex:i,backgroundColor:s,direction:"horizontal",customStyles:{border:`1px solid ${t.sg.colors.neutralColors.colorNeutralSoft}`,borderRadius:t.sg.borders.borderRadius.borderRadiusSm,...p},children:[o.jsxRuntimeExports.jsxs(Te,{ref:S,widthItems:a,children:[l==null?void 0:l.map((m,C)=>o.jsxRuntimeExports.jsx(qe,{selected:(u==null?void 0:u.key)===m.key,onClick:()=>f(m),withBorderRight:!0,heightItems:c,customStyles:h,children:m.item},C)),o.jsxRuntimeExports.jsx(De,{})]}),o.jsxRuntimeExports.jsx(Pe,{children:u&&(u==null?void 0:u.contentItem)})]})},se=o.Ae`
430
438
  svg:not([color]):not([data-testid='icon']) {
431
439
  path {
432
440
  fill: ${t.sg.colors.neutralColors.colorNeutralDarkest};
@@ -438,7 +446,7 @@
438
446
  fill: ${t.sg.colors.neutralColors.colorNeutralDarkest};
439
447
  }
440
448
  }
441
- `,_e=o.qe.div`
449
+ `,Xe=o.qe.div`
442
450
  width: 100%;
443
451
  max-height: ${({maxHeight:e})=>e};
444
452
  overflow: auto;
@@ -460,11 +468,11 @@
460
468
  background: ${t.sg.colors.neutralColors.colorNeutralClean};
461
469
  border-radius: ${t.sg.borders.borderRadius.borderRadiusPill};
462
470
  }
463
- `,Ue=o.qe.table`
471
+ `,_e=o.qe.table`
464
472
  border-collapse: separate;
465
473
  border-spacing: 0;
466
474
  width: 100%;
467
- `,Ge=`${t.sg.borders.borderRadius.borderExtraSmall} ${t.sg.borders.borderRadius.borderExtraSmall} 0 0`,Je=`0 0 ${t.sg.borders.borderRadius.borderExtraSmall} ${t.sg.borders.borderRadius.borderExtraSmall}`,U=o.qe.tr`
475
+ `,Ue=`${t.sg.borders.borderRadius.borderExtraSmall} ${t.sg.borders.borderRadius.borderExtraSmall} 0 0`,Ge=`0 0 ${t.sg.borders.borderRadius.borderExtraSmall} ${t.sg.borders.borderRadius.borderExtraSmall}`,U=o.qe.tr`
468
476
  ${({isHeader:e,size:n})=>e&&o.Ae`
469
477
  position: sticky;
470
478
  background-color: ${t.sg.colors.backgroundColors.colorBackgroundSnow};
@@ -487,7 +495,7 @@
487
495
  background-color: ${n?t.sg.colors.neutralColors.colorNeutralClean:i?"#F5F9FE":t.sg.colors.backgroundColors.colorBackgroundSnow};
488
496
  `}
489
497
 
490
- border-radius: ${({isFirst:e,isLast:n,isHeader:i,borderRadius:s})=>{if(e&&!i)return s?`${s} ${s} 0 0`:Ge;if(n)return s?`0 0 ${s} ${s}`:Je}};
498
+ border-radius: ${({isFirst:e,isLast:n,isHeader:i,borderRadius:s})=>{if(e&&!i)return s?`${s} ${s} 0 0`:Ue;if(n)return s?`0 0 ${s} ${s}`:Ge}};
491
499
  transition: background-color 0.2s 0s;
492
500
 
493
501
  &:hover {
@@ -554,7 +562,7 @@
554
562
  &:hover {
555
563
  cursor: default;
556
564
  }
557
- `,Ve=o.qe.td`
565
+ `,Je=o.qe.td`
558
566
  text-align: ${({horizontalAlign:e})=>e||"left"};
559
567
  vertical-align: ${({verticalAlign:e})=>e||"middle"};
560
568
 
@@ -586,4 +594,4 @@
586
594
  &:hover {
587
595
  cursor: ${e=>e.isClickable?"pointer":"default"};
588
596
  }
589
- `;function Ye(e){return n=>typeof e=="string"?n[e]:typeof e=="function"?e(n):(console.warn("Please, setup a rowKey for table."),JSON.stringify(n))}function Qe({id:e,rowKey:n="id",size:i="Small",onRowClick:s,fit:l=!1,maxHeight:c="40rem",columns:a,dataSource:m,columnsTextSize:x=i,emptyProps:p={width:"100%",height:"100%",title:"Nenhum dado a ser mostrado.",mode:"table",borders:!0,backgroundColor:t.sg.colors.backgroundColors.colorBackgroundSnow},selectedRow:u=!1,hideHeader:f=!1,withBorder:$=!0,withBorderRadius:k=!0,striped:E=!1,borderRadius:h=t.sg.borders.borderRadius.borderRadiusSm}){const S=g.useMemo(()=>Ye(n),[n]),[I,C]=g.useState(null),v=g.useRef(null),A=g.useRef(null),[R,O]=g.useState(a);g.useLayoutEffect(()=>{if(!A.current||a.length===0){O(a);return}const w=()=>{var P;const W=((P=A.current)==null?void 0:P.clientWidth)||0;if(W===0)return;let M=0,j=0;const d=[],r=[];a.forEach(H=>{const N=Number(H.flex);H.width?M+=parseInt(H.width,10)||0:H.flex&&N>0?(j+=N,d.push(H)):r.push(H)});const b=W-M,z="80";let B=[...a];if(b>0){if(d.length>0){const H=b/j;B=a.map(N=>{const D=Number(N.flex);if(D&&D>0){const q=parseInt(N.minWidth||z,10),_=D*H,V=Math.max(_,q);return{...N,width:`${Math.floor(V)}px`}}return!N.width&&!D?{...N,width:N.minWidth||`${z}px`}:N})}else if(r.length>0){const H=b/r.length;B=a.map(N=>{const D=Number(N.flex);if(!N.width&&!D){const q=parseInt(N.minWidth||z,10),_=Math.max(H,q);return{...N,width:`${Math.floor(_)}px`}}return N})}}else B=a.map(H=>H.width?H:{...H,width:H.minWidth||`${z}px`});O(B)};w();const y=new ResizeObserver(w);return y.observe(A.current),()=>y.disconnect()},[a]),g.useEffect(()=>{const w=y=>{v.current&&!v.current.contains(y.target)&&C(null)};return document.addEventListener("mousedown",w),()=>{document.removeEventListener("mousedown",w)}},[]);const L=g.useMemo(()=>R?R.some(w=>w.mergeHeaderId&&w.mergeHeaderLabel):!1,[R]),T=g.useMemo(()=>{var M,j;if(f||!R||R.length===0)return null;if(!L)return o.jsxRuntimeExports.jsx(U,{isHeader:!0,size:i,numRows:1,borderRadius:h,children:R.map(d=>{var r;return o.jsxRuntimeExports.jsx(G,{width:d.width,minWidth:d.minWidth,maxWidth:d.maxWidth,horizontalAlign:d.horizontalAlign,size:i,columnsTextSize:x,withBorder:$,headerAlign:d.headerAlign,children:((r=d.columnRender)==null?void 0:r.call(d,m))||o.jsxRuntimeExports.jsx("span",{title:d.label,children:d.label})},d.dataIndex)})});const w=[],y=[];let W=0;for(;W<R.length;){const d=R[W];if(d.mergeHeaderId&&d.mergeHeaderLabel){let r=0;const b=d.mergeHeaderId;for(let z=W;z<R.length&&R[z].mergeHeaderId===b;z++)r++;w.push(o.jsxRuntimeExports.jsx(G,{colSpan:r,horizontalAlign:"center",size:i,columnsTextSize:x,withBorder:$,width:d.width,minWidth:d.minWidth,maxWidth:d.maxWidth,headerAlign:d.headerAlign,isTopRow:!0,children:o.jsxRuntimeExports.jsx("span",{title:d.mergeHeaderLabel,children:d.mergeHeaderLabel})},`${d.mergeHeaderId}-merged`));for(let z=0;z<r;z++){const B=R[W+z];y.push(o.jsxRuntimeExports.jsx(G,{width:B.width,minWidth:B.minWidth,maxWidth:B.maxWidth,horizontalAlign:B.horizontalAlign,size:i,columnsTextSize:x,withBorder:$,headerAlign:d.headerAlign,children:((M=B.columnRender)==null?void 0:M.call(B,m))||o.jsxRuntimeExports.jsx("span",{title:B.label,children:B.label})},B.dataIndex+"-individual"))}W+=r}else w.push(o.jsxRuntimeExports.jsx(G,{rowSpan:2,width:d.width,minWidth:d.minWidth,maxWidth:d.maxWidth,horizontalAlign:d.horizontalAlign,size:i,columnsTextSize:x,withBorder:$,headerAlign:d.headerAlign,isTopRow:!0,children:((j=d.columnRender)==null?void 0:j.call(d,m))||o.jsxRuntimeExports.jsx("span",{title:d.label,children:d.label})},d.dataIndex)),W++}return o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx(U,{isHeader:!0,size:i,numRows:2,borderRadius:h,children:w}),y.length>0&&o.jsxRuntimeExports.jsx(U,{isHeader:!0,size:i,numRows:2,borderRadius:h,children:y})]})},[R,f,i,x,L]);return!m||m.length===0?o.jsxRuntimeExports.jsx(o.Empty,{backgroundColor:t.sg.colors.backgroundColors.colorBackgroundSnow,borders:!0,mode:"table",...p}):o.jsxRuntimeExports.jsx(_e,{maxHeight:c,withBorderRadius:k,ref:A,borderRadius:h,children:o.jsxRuntimeExports.jsxs(Ue,{id:e,ref:v,children:[o.jsxRuntimeExports.jsx("thead",{children:T}),o.jsxRuntimeExports.jsx("tbody",{style:{width:"100%"},children:m==null?void 0:m.map((w,y,W)=>{const M=S(w);return o.jsxRuntimeExports.jsx(U,{isLast:y===W.length-1,fit:l,size:i,withBorder:$,isSelected:M===I&&u,striped:E&&y%2!==0,borderRadius:h,children:R.map(j=>{var d,r,b;return o.jsxRuntimeExports.jsx(Ve,{width:j.width,minWidth:j.minWidth,maxWidth:j.maxWidth,size:i,isClickable:F.valuable(s),onClick:()=>{s&&s(w,j,y),u&&C(I===M?null:M)},horizontalAlign:j.horizontalAlign,verticalAlign:j.verticalAlign,rowPadding:j.rowPadding,withBorder:$,isLast:y===W.length-1,backgroundColor:(d=j.paint)==null?void 0:d.call(j,w[j.dataIndex],w,y,W),children:((r=j.render)==null?void 0:r.call(j,w[j.dataIndex],w,y,W))||o.jsxRuntimeExports.jsx("span",{title:w[j.dataIndex],style:{textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden",...(b=j.rowCss)==null?void 0:b.call(j,w)},children:w[j.dataIndex]})||""},`${M}::${j.dataIndex}`)})},M)})})]})})}exports.CheckboxField=ue;exports.CollapseSection=ae;exports.MenuSelect=J;exports.Section=ne;exports.Select=K;exports.SelectButton=Le;exports.SelectField=ge;exports.TabInfo=Xe;exports.Table=Qe;exports.TextareaField=oe;
597
+ `;function Ve(e){return n=>typeof e=="string"?n[e]:typeof e=="function"?e(n):(console.warn("Please, setup a rowKey for table."),JSON.stringify(n))}function Ye({id:e,rowKey:n="id",size:i="Small",onRowClick:s,fit:l=!1,maxHeight:c="40rem",columns:a,dataSource:x,columnsTextSize:p=i,emptyProps:h={width:"100%",height:"100%",title:"Nenhum dado a ser mostrado.",mode:"table",borders:!0,backgroundColor:t.sg.colors.backgroundColors.colorBackgroundSnow},selectedRow:u=!1,hideHeader:f=!1,withBorder:S=!0,withBorderRadius:N=!0,striped:m=!1,borderRadius:C=t.sg.borders.borderRadius.borderRadiusSm}){const R=g.useMemo(()=>Ve(n),[n]),[H,j]=g.useState(null),W=g.useRef(null),v=g.useRef(null),[k,O]=g.useState(a);g.useLayoutEffect(()=>{if(!v.current||a.length===0){O(a);return}const $=()=>{var P;const I=((P=v.current)==null?void 0:P.clientWidth)||0;if(I===0)return;let A=0,y=0;const d=[],r=[];a.forEach(M=>{const B=Number(M.flex);M.width?A+=parseInt(M.width,10)||0:M.flex&&B>0?(y+=B,d.push(M)):r.push(M)});const b=I-A,E="80";let z=[...a];if(b>0){if(d.length>0){const M=b/y;z=a.map(B=>{const D=Number(B.flex);if(D&&D>0){const q=parseInt(B.minWidth||E,10),_=D*M,V=Math.max(_,q);return{...B,width:`${Math.floor(V)}px`}}return!B.width&&!D?{...B,width:B.minWidth||`${E}px`}:B})}else if(r.length>0){const M=b/r.length;z=a.map(B=>{const D=Number(B.flex);if(!B.width&&!D){const q=parseInt(B.minWidth||E,10),_=Math.max(M,q);return{...B,width:`${Math.floor(_)}px`}}return B})}}else z=a.map(M=>M.width?M:{...M,width:M.minWidth||`${E}px`});O(z)};$();const w=new ResizeObserver($);return w.observe(v.current),()=>w.disconnect()},[a]),g.useEffect(()=>{const $=w=>{W.current&&!W.current.contains(w.target)&&j(null)};return document.addEventListener("mousedown",$),()=>{document.removeEventListener("mousedown",$)}},[]);const L=g.useMemo(()=>k?k.some($=>$.mergeHeaderId&&$.mergeHeaderLabel):!1,[k]),T=g.useMemo(()=>{var A,y;if(f||!k||k.length===0)return null;if(!L)return o.jsxRuntimeExports.jsx(U,{isHeader:!0,size:i,numRows:1,borderRadius:C,children:k.map(d=>{var r;return o.jsxRuntimeExports.jsx(G,{width:d.width,minWidth:d.minWidth,maxWidth:d.maxWidth,horizontalAlign:d.horizontalAlign,size:i,columnsTextSize:p,withBorder:S,headerAlign:d.headerAlign,children:((r=d.columnRender)==null?void 0:r.call(d,x))||o.jsxRuntimeExports.jsx("span",{title:d.label,children:d.label})},d.dataIndex)})});const $=[],w=[];let I=0;for(;I<k.length;){const d=k[I];if(d.mergeHeaderId&&d.mergeHeaderLabel){let r=0;const b=d.mergeHeaderId;for(let E=I;E<k.length&&k[E].mergeHeaderId===b;E++)r++;$.push(o.jsxRuntimeExports.jsx(G,{colSpan:r,horizontalAlign:"center",size:i,columnsTextSize:p,withBorder:S,width:d.width,minWidth:d.minWidth,maxWidth:d.maxWidth,headerAlign:d.headerAlign,isTopRow:!0,children:o.jsxRuntimeExports.jsx("span",{title:d.mergeHeaderLabel,children:d.mergeHeaderLabel})},`${d.mergeHeaderId}-merged`));for(let E=0;E<r;E++){const z=k[I+E];w.push(o.jsxRuntimeExports.jsx(G,{width:z.width,minWidth:z.minWidth,maxWidth:z.maxWidth,horizontalAlign:z.horizontalAlign,size:i,columnsTextSize:p,withBorder:S,headerAlign:d.headerAlign,children:((A=z.columnRender)==null?void 0:A.call(z,x))||o.jsxRuntimeExports.jsx("span",{title:z.label,children:z.label})},z.dataIndex+"-individual"))}I+=r}else $.push(o.jsxRuntimeExports.jsx(G,{rowSpan:2,width:d.width,minWidth:d.minWidth,maxWidth:d.maxWidth,horizontalAlign:d.horizontalAlign,size:i,columnsTextSize:p,withBorder:S,headerAlign:d.headerAlign,isTopRow:!0,children:((y=d.columnRender)==null?void 0:y.call(d,x))||o.jsxRuntimeExports.jsx("span",{title:d.label,children:d.label})},d.dataIndex)),I++}return o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx(U,{isHeader:!0,size:i,numRows:2,borderRadius:C,children:$}),w.length>0&&o.jsxRuntimeExports.jsx(U,{isHeader:!0,size:i,numRows:2,borderRadius:C,children:w})]})},[k,f,i,p,L]);return!x||x.length===0?o.jsxRuntimeExports.jsx(o.Empty,{backgroundColor:t.sg.colors.backgroundColors.colorBackgroundSnow,borders:!0,mode:"table",...h}):o.jsxRuntimeExports.jsx(Xe,{maxHeight:c,withBorderRadius:N,ref:v,borderRadius:C,children:o.jsxRuntimeExports.jsxs(_e,{id:e,ref:W,children:[o.jsxRuntimeExports.jsx("thead",{children:T}),o.jsxRuntimeExports.jsx("tbody",{style:{width:"100%"},children:x==null?void 0:x.map(($,w,I)=>{const A=R($);return o.jsxRuntimeExports.jsx(U,{isLast:w===I.length-1,fit:l,size:i,withBorder:S,isSelected:A===H&&u,striped:m&&w%2!==0,borderRadius:C,children:k.map(y=>{var d,r,b;return o.jsxRuntimeExports.jsx(Je,{width:y.width,minWidth:y.minWidth,maxWidth:y.maxWidth,size:i,isClickable:F.valuable(s),onClick:()=>{s&&s($,y,w),u&&j(H===A?null:A)},horizontalAlign:y.horizontalAlign,verticalAlign:y.verticalAlign,rowPadding:y.rowPadding,withBorder:S,isLast:w===I.length-1,backgroundColor:(d=y.paint)==null?void 0:d.call(y,$[y.dataIndex],$,w,I),children:((r=y.render)==null?void 0:r.call(y,$[y.dataIndex],$,w,I))||o.jsxRuntimeExports.jsx("span",{title:$[y.dataIndex],style:{textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden",...(b=y.rowCss)==null?void 0:b.call(y,$)},children:$[y.dataIndex]})||""},`${A}::${y.dataIndex}`)})},A)})})]})})}exports.CheckboxField=ue;exports.CollapseSection=ae;exports.MenuSelect=J;exports.Section=ne;exports.Select=K;exports.SelectButton=Le;exports.SelectField=ge;exports.TabInfo=Oe;exports.Table=Ye;exports.TextareaField=oe;