@ufal-lccv/gpsub-ds 0.0.12 → 0.0.14

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,4 +1,4 @@
1
- "use strict";const o=require("./Checkbox.view-DFbiE7Mi.cjs"),u=require("react"),t=require("sbwb-ds"),H=require("./index-BcwQwoIM.cjs"),Q=require("react-hook-form"),ee=350,ae=({title:e,children:n,endAdornment:i=null,marginBottom:s="16px",customStyles:a={},wrapperCustomStyles:c={},hideAdornmentOnCollapse:l=!1})=>{const[f,d]=u.useState(!1),[x,m]=u.useState(!0);u.useEffect(()=>{if(l)if(f){const S=setTimeout(()=>m(!1),ee);return()=>clearTimeout(S)}else m(!0)},[f,l]);const h=l&&!x?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:f,setCollapsed:d},endAdornment:h,customStyles:a}),o.jsxRuntimeExports.jsx(o.Container,{gap:"8px",width:"100%",customStyles:{maxHeight:f?"0":"2000px",transition:`max-height ${ee}ms ease-in-out`},children:n})]})};function Y(e,n,i){var s,a,c,l,f;n==null&&(n=100);function d(){var m=Date.now()-l;m<n&&m>=0?s=setTimeout(d,n-m):(s=null,i||(f=e.apply(c,a),c=a=null))}var x=function(){c=this,a=arguments,l=Date.now();var m=i&&!s;return s||(s=setTimeout(d,n)),m&&(f=e.apply(c,a),c=a=null),f};return x.clear=function(){s&&(clearTimeout(s),s=null)},x.flush=function(){s&&(f=e.apply(c,a),c=a=null,clearTimeout(s),s=null)},x}Y.debounce=Y;var ce=Y;const de=o.getDefaultExportFromCjs(ce);function Z({form:e,fieldName:n,triggerType:i=null,debounceTime:s=500}){const a=u.useCallback(()=>{e.trigger(n)},[e,n]),c=u.useMemo(()=>de(()=>a(),s),[a,s]),l=u.useMemo(()=>["all","onChange"].includes(i)?c:null,[c,i]),f=u.useMemo(()=>["all","onBlur"].includes(i)?a:null,[i]);return u.useMemo(()=>({onChangeTrigger:l,onBlurTrigger:f}),[l,f])}const ge=({form:e,name:n,label:i,options:s,readonly:a=!1,disabled:c=!1,optionsMap:l,width:f="100%",flex:d,placeholder:x,onSelect:m,parser:h,filter:S,tooltipProps:p={},infoProps:j={},maxHeigthMenu:R,isRequired:E=!1,onRemoveSelected:F,triggerFormField:b=null,displayText:W,...v})=>{const{onChangeTrigger:C}=Z({form:e,fieldName:n,triggerType:b,debounceTime:0}),O={position:"top",...p},L={...j,tooltipProps:{position:"top",maxWidth:"300px",...j==null?void 0:j.tooltipProps}},T=(w,I)=>{let M=w;h&&(M=h==null?void 0:h(w)),I(M),m==null||m(M),C==null||C()},$=u.useMemo(()=>H.valuable(l)?l:Object.fromEntries(s.map(w=>[w.value,w])),[s,l]);return o.jsxRuntimeExports.jsx(o.Container,{width:f,flex:d,children:o.jsxRuntimeExports.jsx(Q.Controller,{name:n,control:e.control,render:({field:{onChange:w,value:I},fieldState:{error:M=null}})=>{let k=$[I];return o.jsxRuntimeExports.jsx(K,{label:i,width:"100%",size:"Small",disabled:c,readonly:a,filter:S,errorMessage:M==null?void 0:M.message,placeholder:x,value:k,handleOption:g=>{T(g.value,w)},tooltipProps:O,options:s,maxHeigthMenu:R,infoProps:L,maxHeightMenu:R,isRequired:E,onRemoveSelected:F,displayText:W,...v})}})})},oe=({form:e,name:n,label:i,readonly:s=!1,disabled:a=!1,width:c="100%",height:l="100%",flex:f,placeholder:d,charactersCounter:x=!0,maxlength:m=1e3,resize:h=!0,triggerFormField:S=null,minHeight:p,maxHeight:j,...R})=>{const{onChangeTrigger:E}=Z({form:e,fieldName:n,triggerType:S}),F=(b,W)=>{W(b),E==null||E()};return o.jsxRuntimeExports.jsx(o.Container,{width:c,flex:f,height:l,children:o.jsxRuntimeExports.jsx(Q.Controller,{name:n,control:e.control,render:({field:{onChange:b,value:W},fieldState:{error:v=null}})=>o.jsxRuntimeExports.jsx(o.Textarea,{label:i,value:W||"",width:"100%",disabled:a,readonly:s,height:l,minHeight:p,maxHeight:j,errorMessage:v==null?void 0:v.message,placeholder:d,onChange:C=>F(C.target.value,b),charactersCounter:x,maxlength:m,size:"Small",resize:h,...R})})})};oe.displayName="TextareaField";const ue=({form:e,name:n,id:i=n,label:s,readonly:a=!1,disabled:c=!1,afterCheck:l,width:f="100%",formatter:d,parser:x,flex:m,size:h="Medium",triggerFormField:S=null,...p})=>{const{onChangeTrigger:j}=Z({form:e,fieldName:n,triggerType:S,debounceTime:0}),R=(E,F)=>{F(E),l==null||l(E),j==null||j()};return o.jsxRuntimeExports.jsx(o.Container,{width:f,flex:m,children:o.jsxRuntimeExports.jsx(Q.Controller,{name:n,control:e.control,render:({field:{onChange:E,value:F},fieldState:{error:b=null}})=>{const W=b==null?void 0:b.message;return W&&console.log("Error on checkbox!",W),o.jsxRuntimeExports.jsx(o.Checkbox,{id:`form-checkbox-${i}`,checked:(d==null?void 0:d(F))??F,name:n,label:s,disabled:c||a,onChange:v=>{R((x==null?void 0:x(v.target.checked,F))??v.target.checked,E)},size:h,...p})}})})},fe=o.qe.ul`
1
+ "use strict";const o=require("./Checkbox.view-DFbiE7Mi.cjs"),u=require("react"),t=require("sbwb-ds"),H=require("./index-BcwQwoIM.cjs"),Q=require("react-hook-form"),ee=350,ae=({title:e,children:n,endAdornment:i=null,marginBottom:s="16px",customStyles:a={},wrapperCustomStyles:c={},hideAdornmentOnCollapse:l=!1,maxHeight:x="none"})=>{const[d,m]=u.useState(!1),[p,f]=u.useState(!0);u.useEffect(()=>{if(l)if(d){const h=setTimeout(()=>f(!1),ee);return()=>clearTimeout(h)}else f(!0)},[d,l]);const b=l&&!p?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:d,setCollapsed:m},endAdornment:b,customStyles:a}),o.jsxRuntimeExports.jsx(o.Container,{gap:"8px",width:"100%",customStyles:{maxHeight:d?"0":x,transition:`max-height ${ee}ms ease-in-out`},children:n})]})};function Y(e,n,i){var s,a,c,l,x;n==null&&(n=100);function d(){var p=Date.now()-l;p<n&&p>=0?s=setTimeout(d,n-p):(s=null,i||(x=e.apply(c,a),c=a=null))}var m=function(){c=this,a=arguments,l=Date.now();var p=i&&!s;return s||(s=setTimeout(d,n)),p&&(x=e.apply(c,a),c=a=null),x};return m.clear=function(){s&&(clearTimeout(s),s=null)},m.flush=function(){s&&(x=e.apply(c,a),c=a=null,clearTimeout(s),s=null)},m}Y.debounce=Y;var ce=Y;const de=o.getDefaultExportFromCjs(ce);function Z({form:e,fieldName:n,triggerType:i=null,debounceTime:s=500}){const a=u.useCallback(()=>{e.trigger(n)},[e,n]),c=u.useMemo(()=>de(()=>a(),s),[a,s]),l=u.useMemo(()=>["all","onChange"].includes(i)?c:null,[c,i]),x=u.useMemo(()=>["all","onBlur"].includes(i)?a:null,[i]);return u.useMemo(()=>({onChangeTrigger:l,onBlurTrigger:x}),[l,x])}const ge=({form:e,name:n,label:i,options:s,readonly:a=!1,disabled:c=!1,optionsMap:l,width:x="100%",flex:d,placeholder:m,onSelect:p,parser:f,filter:b,tooltipProps:h={},infoProps:C={},maxHeigthMenu:k,isRequired:E=!1,onRemoveSelected:F,triggerFormField:j=null,displayText:I,...v})=>{const{onChangeTrigger:R}=Z({form:e,fieldName:n,triggerType:j,debounceTime:0}),O={position:"top",...h},L={...C,tooltipProps:{position:"top",maxWidth:"300px",...C==null?void 0:C.tooltipProps}},T=(w,W)=>{let M=w;f&&(M=f==null?void 0:f(w)),W(M),p==null||p(M),R==null||R()},$=u.useMemo(()=>H.valuable(l)?l:Object.fromEntries(s.map(w=>[w.value,w])),[s,l]);return o.jsxRuntimeExports.jsx(o.Container,{width:x,flex:d,children:o.jsxRuntimeExports.jsx(Q.Controller,{name:n,control:e.control,render:({field:{onChange:w,value:W},fieldState:{error:M=null}})=>{let y=$[W];return o.jsxRuntimeExports.jsx(K,{label:i,width:"100%",size:"Small",disabled:c,readonly:a,filter:b,errorMessage:M==null?void 0:M.message,placeholder:m,value:y,handleOption:g=>{T(g.value,w)},tooltipProps:O,options:s,maxHeigthMenu:k,infoProps:L,maxHeightMenu:k,isRequired:E,onRemoveSelected:F,displayText:I,...v})}})})},oe=({form:e,name:n,label:i,readonly:s=!1,disabled:a=!1,width:c="100%",height:l="100%",flex:x,placeholder:d,charactersCounter:m=!0,maxlength:p=1e3,resize:f=!0,triggerFormField:b=null,minHeight:h,maxHeight:C,...k})=>{const{onChangeTrigger:E}=Z({form:e,fieldName:n,triggerType:b}),F=(j,I)=>{I(j),E==null||E()};return o.jsxRuntimeExports.jsx(o.Container,{width:c,flex:x,height:l,children:o.jsxRuntimeExports.jsx(Q.Controller,{name:n,control:e.control,render:({field:{onChange:j,value:I},fieldState:{error:v=null}})=>o.jsxRuntimeExports.jsx(o.Textarea,{label:i,value:I||"",width:"100%",disabled:a,readonly:s,height:l,minHeight:h,maxHeight:C,errorMessage:v==null?void 0:v.message,placeholder:d,onChange:R=>F(R.target.value,j),charactersCounter:m,maxlength:p,size:"Small",resize:f,...k})})})};oe.displayName="TextareaField";const ue=({form:e,name:n,id:i=n,label:s,readonly:a=!1,disabled:c=!1,afterCheck:l,width:x="100%",formatter:d,parser:m,flex:p,size:f="Medium",triggerFormField:b=null,...h})=>{const{onChangeTrigger:C}=Z({form:e,fieldName:n,triggerType:b,debounceTime:0}),k=(E,F)=>{F(E),l==null||l(E),C==null||C()};return o.jsxRuntimeExports.jsx(o.Container,{width:x,flex:p,children:o.jsxRuntimeExports.jsx(Q.Controller,{name:n,control:e.control,render:({field:{onChange:E,value:F},fieldState:{error:j=null}})=>{const I=j==null?void 0:j.message;return I&&console.log("Error on checkbox!",I),o.jsxRuntimeExports.jsx(o.Checkbox,{id:`form-checkbox-${i}`,checked:(d==null?void 0:d(F))??F,name:n,label:s,disabled:c||a,onChange:v=>{k((m==null?void 0:m(v.target.checked,F))??v.target.checked,E)},size:f,...h})}})})},fe=o.qe.ul`
2
2
  ${H.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,a="left")=>{const[c,l]=u.useState(0),[f,d]=u.useState(),x=u.useRef(null),m=u.useCallback(()=>{if(!e.current||!x.current)return;const h=e.current.getBoundingClientRect(),S=x.current.getBoundingClientRect(),p=window.innerHeight,j=window.innerWidth,R=h.top,E=p-h.bottom,F=E<S.height+s&&R>E;let b;F?(b=h.top-S.height-i,x.current.style.maxHeight=`${R-i}px`):(b=h.bottom+s,x.current.style.maxHeight=`${E-s}px`);let W=h.left;const v=W+S.width-j;v>0&&(W-=v),W<0&&(W=0);const C=j-h.right;Object.assign(x.current.style,{position:"fixed",top:`${b}px`,...a==="left"?{left:`${W}px`}:{right:`${C}px`},width:`${Math.max(h.width,S.width)}px`,overflowY:"auto"})},[i,s,a]);return u.useEffect(()=>{var S;l(0),d((S=e.current)==null?void 0:S.clientWidth),m();const h=()=>m();return window.addEventListener("scroll",h,!0),window.addEventListener("resize",h),()=>{window.removeEventListener("scroll",h,!0),window.removeEventListener("resize",h)}},[e,m]),{highlightedIndex:c,setHighlightedIndex:l,isOptionSelected:h=>h.label===(n==null?void 0:n.label),optionsRef:x,parentWidth:f}},J=u.forwardRef(({selectContainerRef:e,optionsSelect:n,size:i,selectOption:s,value:a,inputValue:c,widthMenu:l,maxHeightMenu:f="180px",menuIsOpen:d,onEnter:x,marginTop:m="4px",iconName:h,iconColor:S,iconPosition:p,topOffset:j=0,bottomOffset:R=0,truncateText:E=!0,menuJustifyContent:F="flex-start",tableActionButton:b,menuLateralPadding:W="8px",menuOptionFlexDirection:v="column",confirmSelection:C,menuAlign:O="left"},L)=>{H.valuable(h)&&(h+="Ant");const{highlightedIndex:T,setHighlightedIndex:$,isOptionSelected:w,optionsRef:I,parentWidth:M}=we(e,a,j,R,O);u.useEffect(()=>{const r=y=>{if(d){if(y.key==="ArrowDown")y.preventDefault(),$(z=>z<n.length-1?z+1:z);else if(y.key==="ArrowUp")y.preventDefault(),$(z=>z>0?z-1:0);else if(y.key==="Enter"&&n[T]){y.preventDefault();const z=n[T];s(z),x&&x(z)}}};return window.addEventListener("keydown",r),()=>window.removeEventListener("keydown",r)},[d,n,T,x,s,C]);const k=r=>typeof r=="string"?r:u.isValidElement(r)&&typeof r.props.children=="string"?r.props.children:String(r),g=(r,y)=>{var A,N;if(p!==y)return null;const z=H.valuable((A=r.tooltipProps)==null?void 0:A.label),B=r.iconName||h||"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:w(r)?t.sg.colors.brandColors.colorBrandSoft:S??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:m,width:l??`${M}px`,maxHeight:f,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,y)=>{var P,A;const z=typeof r.render=="function"?r.render():null,B=k(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:w(r),highlightedIndex:y===T,onClick:D=>{D.stopPropagation(),r.disabled||(C?o.showConfirm({id:"select-option",title:C.title,description:C.description,icon:C.icon,iconColor:C.iconColor,leftButtonProps:{name:"Cancelar",variant:"tertiary",onClick:()=>{}},rightButtonProps:{name:"Confirmar",variant:"secondary",onClick:()=>s(r)}}):s(r))},onMouseEnter:()=>$(y),disabled:r.disabled,size:i,menuLateralPadding:W,children:[g(r,"left"),o.jsxRuntimeExports.jsxs(xe,{menuOptionFlexDirection:v,menuJustifyContent:F,iconName:h,isOptionSelected:w(r),highlightedIndex:y===T,"data-testid":r.value,size:i,hasDescription:!!r.description,optionValue:r.value,disabled:r.disabled,truncateText:E,tableActionButton:b,children:[o.jsxRuntimeExports.jsxs(Se,{truncateText:!u.isValidElement(r.label)&&E,children:[z,u.isValidElement(r.label)?o.jsxRuntimeExports.jsx("p",{title:((P=r==null?void 0:r.tooltipProps)==null?void 0:P.label)??k(r.label),children:r.label}):o.jsxRuntimeExports.jsx("p",{title:((A=r==null?void 0:r.tooltipProps)==null?void 0:A.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})]}),g(r,"right")]},String(r.value))}})})});J.displayName="MenuSelect";const ne=({title:e,iconName:n,onClickIcon:i,width:s,height:a,flex:c,children:l,wrapperCustomStyles:f={},contentCustomStyles:d={},titleCustomStyles:x={}})=>o.jsxRuntimeExports.jsxs(o.Container,{width:s,height:a,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",...f},children:[o.jsxRuntimeExports.jsxs(o.Container,{width:"100%",direction:"horizontal",customStyles:d,children:[e?o.jsxRuntimeExports.jsx(o.Container,{width:"fit-content",customStyles:x,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:H.valuable(i)?t.sg.colors.neutralColors.colorNeutralDark:t.sg.colors.neutralColors.colorNeutralCloudy,cursorPointer:H.valuable(i)})]}):null]}),o.jsxRuntimeExports.jsx(o.Container,{width:"100%",flex:"1",children:l})]});ne.displayName="Section";const ye=o.qe.div`
121
+ `,we=(e,n,i=0,s=0,a="left")=>{const[c,l]=u.useState(0),[x,d]=u.useState(),m=u.useRef(null),p=u.useCallback(()=>{if(!e.current||!m.current)return;const f=e.current.getBoundingClientRect(),b=m.current.getBoundingClientRect(),h=window.innerHeight,C=window.innerWidth,k=f.top,E=h-f.bottom,F=E<b.height+s&&k>E;let j;F?(j=f.top-b.height-i,m.current.style.maxHeight=`${k-i}px`):(j=f.bottom+s,m.current.style.maxHeight=`${E-s}px`);let I=f.left;const v=I+b.width-C;v>0&&(I-=v),I<0&&(I=0);const R=C-f.right;Object.assign(m.current.style,{position:"fixed",top:`${j}px`,...a==="left"?{left:`${I}px`}:{right:`${R}px`},width:`${Math.max(f.width,b.width)}px`,overflowY:"auto"})},[i,s,a]);return u.useEffect(()=>{var b;l(0),d((b=e.current)==null?void 0:b.clientWidth),p();const f=()=>p();return window.addEventListener("scroll",f,!0),window.addEventListener("resize",f),()=>{window.removeEventListener("scroll",f,!0),window.removeEventListener("resize",f)}},[e,p]),{highlightedIndex:c,setHighlightedIndex:l,isOptionSelected:f=>f.label===(n==null?void 0:n.label),optionsRef:m,parentWidth:x}},J=u.forwardRef(({selectContainerRef:e,optionsSelect:n,size:i,selectOption:s,value:a,inputValue:c,widthMenu:l,maxHeightMenu:x="180px",menuIsOpen:d,onEnter:m,marginTop:p="4px",iconName:f,iconColor:b,iconPosition:h,topOffset:C=0,bottomOffset:k=0,truncateText:E=!0,menuJustifyContent:F="flex-start",tableActionButton:j,menuLateralPadding:I="8px",menuOptionFlexDirection:v="column",confirmSelection:R,menuAlign:O="left"},L)=>{H.valuable(f)&&(f+="Ant");const{highlightedIndex:T,setHighlightedIndex:$,isOptionSelected:w,optionsRef:W,parentWidth:M}=we(e,a,C,k,O);u.useEffect(()=>{const r=S=>{if(d){if(S.key==="ArrowDown")S.preventDefault(),$(z=>z<n.length-1?z+1:z);else if(S.key==="ArrowUp")S.preventDefault(),$(z=>z>0?z-1:0);else if(S.key==="Enter"&&n[T]){S.preventDefault();const z=n[T];s(z),m&&m(z)}}};return window.addEventListener("keydown",r),()=>window.removeEventListener("keydown",r)},[d,n,T,m,s,R]);const y=r=>typeof r=="string"?r:u.isValidElement(r)&&typeof r.props.children=="string"?r.props.children:String(r),g=(r,S)=>{var A,N;if(h!==S)return null;const z=H.valuable((A=r.tooltipProps)==null?void 0:A.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:w(r)?t.sg.colors.brandColors.colorBrandSoft:b??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:p,width:l??`${M}px`,maxHeight:x,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,S)=>{var P,A;const z=typeof r.render=="function"?r.render():null,B=y(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:w(r),highlightedIndex:S===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:()=>$(S),disabled:r.disabled,size:i,menuLateralPadding:I,children:[g(r,"left"),o.jsxRuntimeExports.jsxs(xe,{menuOptionFlexDirection:v,menuJustifyContent:F,iconName:f,isOptionSelected:w(r),highlightedIndex:S===T,"data-testid":r.value,size:i,hasDescription:!!r.description,optionValue:r.value,disabled:r.disabled,truncateText:E,tableActionButton:j,children:[o.jsxRuntimeExports.jsxs(Se,{truncateText:!u.isValidElement(r.label)&&E,children:[z,u.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:((A=r==null?void 0:r.tooltipProps)==null?void 0:A.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})]}),g(r,"right")]},String(r.value))}})})});J.displayName="MenuSelect";const ne=({title:e,iconName:n,onClickIcon:i,width:s,height:a,flex:c,children:l,wrapperCustomStyles:x={},contentCustomStyles:d={},titleCustomStyles:m={}})=>o.jsxRuntimeExports.jsxs(o.Container,{width:s,height:a,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:d,children:[e?o.jsxRuntimeExports.jsx(o.Container,{width:"fit-content",customStyles:m,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:H.valuable(i)?t.sg.colors.neutralColors.colorNeutralDark:t.sg.colors.neutralColors.colorNeutralCloudy,cursorPointer:H.valuable(i)})]}):null]}),o.jsxRuntimeExports.jsx(o.Container,{width:"100%",flex:"1",children:l})]});ne.displayName="Section";const ye=o.qe.div`
122
122
  ${H.resetStyles}
123
123
  display: flex;
124
124
  flex-direction: column;
@@ -258,7 +258,7 @@
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,a]=u.useState(!1),[c,l]=u.useState(!1),[f,d]=u.useState(""),[x,m]=u.useState(i),h=u.useRef(null),S=u.useRef(null),p=u.useRef(null),j=u.useRef(null);u.useEffect(()=>{const b=()=>{l(!1)};return window.addEventListener("scroll",b,{passive:!0}),window.addEventListener("resize",b,{passive:!0}),()=>{window.removeEventListener("scroll",b),window.removeEventListener("resize",b)}},[]);function R(b){d(""),l(!1),a(!0),p!=null&&p.current&&p.current.focus(),b!==n&&e(b)}const E=b=>{if(b){const W=new RegExp(b,"i"),v=i.filter(C=>W.exec(C.label));m(v)}else m(i)};function F(b){return!b}return{isOpen:s,setIsOpen:a,expanded:c,setExpanded:l,inputValue:f,setInputValue:d,optionsSelect:x,setOptionSelect:m,selectContainerRef:h,containerRef:S,inputContainerRef:p,optionsRef:j,selectOption:R,handlerFilterOptions:E,isValue:F}},K=u.forwardRef(({value:e,handleOption:n,options:i,filter:s=!0,placeholder:a,label:c,size:l="Medium",width:f="100%",disabled:d,helpText:x,readonly:m,errorMessage:h,tooltipProps:S={},onBlur:p,onEnter:j,variant:R="default",infoProps:E={},maxHeightMenu:F,isRequired:b=!1,onRemoveSelected:W,displayText:v,displayTextProps:C={}},O)=>{const{isOpen:L,setIsOpen:T,expanded:$,setExpanded:w,inputValue:I,setInputValue:M,optionsSelect:k,selectContainerRef:g,containerRef:r,inputContainerRef:y,selectOption:z,setOptionSelect:B,handlerFilterOptions:P,isValue:A}=We(n,{value:e,options:i}),N=!!h,D={label:h,...S,wrapperWidth:"auto",isActive:N,isErrorTooltip:!0},q={...E,size:l},_=o.jsxRuntimeExports.jsx(t.Icon,{iconName:`Close${l==="Small"?"Sm":"Ant"}`,onClick:X=>{X.stopPropagation(),W(e)}}),V=o.jsxRuntimeExports.jsx(t.Icon,{iconName:`ExpandLess${l==="Small"?"Sm":"Ant"}`}),le=o.jsxRuntimeExports.jsx(t.Icon,{iconName:`ExpandMore${l==="Small"?"Sm":"Ant"}`});return o.jsxRuntimeExports.jsxs(ye,{ref:g,width:f,size:l,disabled:d,readonly:m,children:[c&&o.jsxRuntimeExports.jsxs(Ee,{children:[o.jsxRuntimeExports.jsxs(ze,{"data-testid":"label",ref:O,children:[c,b&&!d?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:m,ref:r,onBlur:()=>{setTimeout(()=>{(L||$)&&y.current!==document.activeElement&&(p&&p(e),T(!1),w(!1))},250)},onClick:()=>{!d&&!m&&(L&&!$?(w(!0),y!=null&&y.current&&y.current.focus()):!L&&!$?(T(!0),w(!0),y!=null&&y.current&&y.current.focus()):(T(!1),w(!1),y!=null&&y.current&&y.current.blur()),!I&&B(i))},tabIndex:0,width:f,size:l,isOpen:L||$,"data-testid":"select",disabled:d,helpText:x,variant:R,children:[o.jsxRuntimeExports.jsxs(Ce,{children:[H.valuable(v)?o.jsxRuntimeExports.jsx(te,{size:l,variant:R,isDisplayText:!0,children:o.jsxRuntimeExports.jsx("p",{title:e==null?void 0:e.label,...C,children:v})}):o.jsxRuntimeExports.jsxs(te,{size:l,variant:R,children:[a&&A(e)&&!I&&!L?o.jsxRuntimeExports.jsx(Re,{size:l,variant:R,children:a}):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&&!H.valuable(v)&&o.jsxRuntimeExports.jsx(ke,{ref:y,value:I,onChange:X=>{M(X.target.value),X.target.value.length>0&&(T(!0),w(!0)),P(X.target.value)},readOnly:m,width:I.length,size:l,disabled:d,variant:R})]}),W&&e?_:null,$?V:le,$&&o.jsxRuntimeExports.jsx(J,{onEnter:X=>{n&&n(X),T(!1),w(!1),j&&j(X)},menuIsOpen:L,selectContainerRef:g,value:e,optionsSelect:k,selectOption:z,size:l,inputValue:I,maxHeightMenu:F})]})}),x&&o.jsxRuntimeExports.jsx(Ne,{size:l,children:x})]})});K.displayName="Select";const re=o.We`
261
+ `,We=(e,{value:n,options:i})=>{const[s,a]=u.useState(!1),[c,l]=u.useState(!1),[x,d]=u.useState(""),[m,p]=u.useState(i),f=u.useRef(null),b=u.useRef(null),h=u.useRef(null),C=u.useRef(null);u.useEffect(()=>{const j=()=>{l(!1)};return window.addEventListener("scroll",j,{passive:!0}),window.addEventListener("resize",j,{passive:!0}),()=>{window.removeEventListener("scroll",j),window.removeEventListener("resize",j)}},[]);function k(j){d(""),l(!1),a(!0),h!=null&&h.current&&h.current.focus(),j!==n&&e(j)}const E=j=>{if(j){const I=new RegExp(j,"i"),v=i.filter(R=>I.exec(R.label));p(v)}else p(i)};function F(j){return!j}return{isOpen:s,setIsOpen:a,expanded:c,setExpanded:l,inputValue:x,setInputValue:d,optionsSelect:m,setOptionSelect:p,selectContainerRef:f,containerRef:b,inputContainerRef:h,optionsRef:C,selectOption:k,handlerFilterOptions:E,isValue:F}},K=u.forwardRef(({value:e,handleOption:n,options:i,filter:s=!0,placeholder:a,label:c,size:l="Medium",width:x="100%",disabled:d,helpText:m,readonly:p,errorMessage:f,tooltipProps:b={},onBlur:h,onEnter:C,variant:k="default",infoProps:E={},maxHeightMenu:F,isRequired:j=!1,onRemoveSelected:I,displayText:v,displayTextProps:R={}},O)=>{const{isOpen:L,setIsOpen:T,expanded:$,setExpanded:w,inputValue:W,setInputValue:M,optionsSelect:y,selectContainerRef:g,containerRef:r,inputContainerRef:S,selectOption:z,setOptionSelect:B,handlerFilterOptions:P,isValue:A}=We(n,{value:e,options:i}),N=!!f,D={label:f,...b,wrapperWidth:"auto",isActive:N,isErrorTooltip:!0},q={...E,size:l},_=o.jsxRuntimeExports.jsx(t.Icon,{iconName:`Close${l==="Small"?"Sm":"Ant"}`,onClick:X=>{X.stopPropagation(),I(e)}}),V=o.jsxRuntimeExports.jsx(t.Icon,{iconName:`ExpandLess${l==="Small"?"Sm":"Ant"}`}),le=o.jsxRuntimeExports.jsx(t.Icon,{iconName:`ExpandMore${l==="Small"?"Sm":"Ant"}`});return o.jsxRuntimeExports.jsxs(ye,{ref:g,width:x,size:l,disabled:d,readonly:p,children:[c&&o.jsxRuntimeExports.jsxs(Ee,{children:[o.jsxRuntimeExports.jsxs(ze,{"data-testid":"label",ref:O,children:[c,j&&!d?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:p,ref:r,onBlur:()=>{setTimeout(()=>{(L||$)&&S.current!==document.activeElement&&(h&&h(e),T(!1),w(!1))},250)},onClick:()=>{!d&&!p&&(L&&!$?(w(!0),S!=null&&S.current&&S.current.focus()):!L&&!$?(T(!0),w(!0),S!=null&&S.current&&S.current.focus()):(T(!1),w(!1),S!=null&&S.current&&S.current.blur()),!W&&B(i))},tabIndex:0,width:x,size:l,isOpen:L||$,"data-testid":"select",disabled:d,helpText:m,variant:k,children:[o.jsxRuntimeExports.jsxs(Ce,{children:[H.valuable(v)?o.jsxRuntimeExports.jsx(te,{size:l,variant:k,isDisplayText:!0,children:o.jsxRuntimeExports.jsx("p",{title:e==null?void 0:e.label,...R,children:v})}):o.jsxRuntimeExports.jsxs(te,{size:l,variant:k,children:[a&&A(e)&&!W&&!L?o.jsxRuntimeExports.jsx(Re,{size:l,variant:k,children:a}):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&&!H.valuable(v)&&o.jsxRuntimeExports.jsx(ke,{ref:S,value:W,onChange:X=>{M(X.target.value),X.target.value.length>0&&(T(!0),w(!0)),P(X.target.value)},readOnly:p,width:W.length,size:l,disabled:d,variant:k})]}),I&&e?_:null,$?V:le,$&&o.jsxRuntimeExports.jsx(J,{onEnter:X=>{n&&n(X),T(!1),w(!1),C&&C(X)},menuIsOpen:L,selectContainerRef:g,value:e,optionsSelect:y,selectOption:z,size:l,inputValue:W,maxHeightMenu:F})]})}),m&&o.jsxRuntimeExports.jsx(Ne,{size:l,children:m})]})});K.displayName="Select";const re=o.We`
262
262
  from {
263
263
  transform: rotate(0deg);
264
264
  }
@@ -380,7 +380,7 @@
380
380
  &:hover {
381
381
  cursor: not-allowed;
382
382
  }
383
- `,Fe=e=>{const[n,i]=u.useState(!1),[s,a]=u.useState(e),c=u.useRef(null);return u.useEffect(()=>{a(e)},[e]),{setIsOpen:i,isOpen:n,setOptionsSelect:a,optionsSelect:s,selectContainerRef:c}},He=200,Le=({name:e,variant:n="primary",width:i="100%",size:s="Medium",disabled:a=!1,isLoading:c=!1,onClick:l,options:f,label:d,menuSelectProps:x={},iconName:m,optionsIconPosition:h})=>{const{isOpen:S,setIsOpen:p,selectContainerRef:j,optionsSelect:R}=Fe(f);let E=t.sg.colors.backgroundColors.colorBackgroundSnow;a?E=t.sg.colors.neutralColors.colorNeutralCloudy:n!=="primary"&&(E=t.sg.colors.neutralColors.colorNeutralDark);const F={...x};return o.jsxRuntimeExports.jsxs(ve,{ref:j,width:i,size:s,disabled:a,onBlur:()=>setTimeout(()=>p(!1),He),children:[d&&o.jsxRuntimeExports.jsx(Me,{children:d}),o.jsxRuntimeExports.jsxs(Ie,{type:"button",size:s,disabled:a,variant:n,isLoading:c,onClick:()=>!c&&p(!S),id:`button-component-${e}`,children:[c&&o.jsxRuntimeExports.jsx(Ae,{size:s,disabled:a,variant:n,children:o.jsxRuntimeExports.jsx(t.Icon,{iconName:`ProgressActivity${s==="Small"?"Ant":"Sm"}`,color:E,"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:E,"data-testid":"icon-button-less"}):o.jsxRuntimeExports.jsx(t.Icon,{iconName:`ExpandMore${s==="Small"?"Ant":"Sm"}`,color:E,"data-testid":"icon-button-more"}))]}),S&&o.jsxRuntimeExports.jsx(J,{selectContainerRef:j,value:null,optionsSelect:R,selectOption:l,size:s,inputValue:null,iconPosition:h,iconName:m,...F})]})},Te=o.qe.div`
383
+ `,Fe=e=>{const[n,i]=u.useState(!1),[s,a]=u.useState(e),c=u.useRef(null);return u.useEffect(()=>{a(e)},[e]),{setIsOpen:i,isOpen:n,setOptionsSelect:a,optionsSelect:s,selectContainerRef:c}},He=200,Le=({name:e,variant:n="primary",width:i="100%",size:s="Medium",disabled:a=!1,isLoading:c=!1,onClick:l,options:x,label:d,menuSelectProps:m={},iconName:p,optionsIconPosition:f})=>{const{isOpen:b,setIsOpen:h,selectContainerRef:C,optionsSelect:k}=Fe(x);let E=t.sg.colors.backgroundColors.colorBackgroundSnow;a?E=t.sg.colors.neutralColors.colorNeutralCloudy:n!=="primary"&&(E=t.sg.colors.neutralColors.colorNeutralDark);const F={...m};return o.jsxRuntimeExports.jsxs(ve,{ref:C,width:i,size:s,disabled:a,onBlur:()=>setTimeout(()=>h(!1),He),children:[d&&o.jsxRuntimeExports.jsx(Me,{children:d}),o.jsxRuntimeExports.jsxs(Ie,{type:"button",size:s,disabled:a,variant:n,isLoading:c,onClick:()=>!c&&h(!b),id:`button-component-${e}`,children:[c&&o.jsxRuntimeExports.jsx(Ae,{size:s,disabled:a,variant:n,children:o.jsxRuntimeExports.jsx(t.Icon,{iconName:`ProgressActivity${s==="Small"?"Ant":"Sm"}`,color:E,"data-testid":"icon-loading"})}),!c&&o.jsxRuntimeExports.jsx("p",{title:e,children:e}),!c&&(b?o.jsxRuntimeExports.jsx(t.Icon,{iconName:`ExpandLess${s==="Small"?"Ant":"Sm"}`,color:E,"data-testid":"icon-button-less"}):o.jsxRuntimeExports.jsx(t.Icon,{iconName:`ExpandMore${s==="Small"?"Ant":"Sm"}`,color:E,"data-testid":"icon-button-more"}))]}),b&&o.jsxRuntimeExports.jsx(J,{selectContainerRef:C,value:null,optionsSelect:k,selectOption:l,size:s,inputValue:null,iconPosition:f,iconName:p,...F})]})},Te=o.qe.div`
384
384
  min-width: ${({widthItems:e})=>e};
385
385
  max-width: ${({widthItems:e})=>e};
386
386
  height: 100%;
@@ -425,7 +425,7 @@
425
425
  height: 100%;
426
426
  background-color: 'transparent';
427
427
  overflow: hidden;
428
- `,Xe=({width:e="100%",height:n="fit-content",flex:i,backgroundColor:s="white",options:a=[],heightItems:c="60px",widthItems:l="155px",emptyProps:f={title:"Nenhum dado a ser mostrado",body:null}})=>{var S;const[d,x]=u.useState(a[0]||null),m=u.useRef(null),h=u.useRef(null);return u.useEffect(()=>{const p=m.current,j=h.current,R=()=>{p&&j&&(j.scrollTop=p.scrollTop)};return p==null||p.addEventListener("scroll",R),()=>{p==null||p.removeEventListener("scroll",R)}},[]),(a==null?void 0:a.length)===0?o.jsxRuntimeExports.jsx(o.Empty,{title:f.title,body:f.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},children:[o.jsxRuntimeExports.jsx(Te,{ref:m,widthItems:l,children:a==null?void 0:a.map((p,j)=>o.jsxRuntimeExports.jsx(qe,{selected:(d==null?void 0:d.key)===p.key,onClick:()=>x(p),withBorderRight:!1,heightItems:c,children:p.item},j))}),o.jsxRuntimeExports.jsx(Oe,{ref:h,children:(S=a==null?void 0:a.concat({key:"last",item:o.jsxRuntimeExports.jsx(o.jsxRuntimeExports.Fragment,{}),contentItem:o.jsxRuntimeExports.jsx(o.jsxRuntimeExports.Fragment,{})}))==null?void 0:S.map((p,j)=>o.jsxRuntimeExports.jsx(Pe,{selected:(d==null?void 0:d.key)===p.key,onClick:()=>x(p),withBorderRight:!0,heightItems:c},j))}),o.jsxRuntimeExports.jsx(De,{children:d&&(d==null?void 0:d.contentItem)})]})},se=o.Ae`
428
+ `,Xe=({width:e="100%",height:n="fit-content",flex:i,backgroundColor:s="white",options:a=[],heightItems:c="60px",widthItems:l="155px",emptyProps:x={title:"Nenhum dado a ser mostrado",body:null}})=>{var b;const[d,m]=u.useState(a[0]||null),p=u.useRef(null),f=u.useRef(null);return u.useEffect(()=>{const h=p.current,C=f.current,k=()=>{h&&C&&(C.scrollTop=h.scrollTop)};return h==null||h.addEventListener("scroll",k),()=>{h==null||h.removeEventListener("scroll",k)}},[]),(a==null?void 0:a.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},children:[o.jsxRuntimeExports.jsx(Te,{ref:p,widthItems:l,children:a==null?void 0:a.map((h,C)=>o.jsxRuntimeExports.jsx(qe,{selected:(d==null?void 0:d.key)===h.key,onClick:()=>m(h),withBorderRight:!1,heightItems:c,children:h.item},C))}),o.jsxRuntimeExports.jsx(Oe,{ref:f,children:(b=a==null?void 0:a.concat({key:"last",item:o.jsxRuntimeExports.jsx(o.jsxRuntimeExports.Fragment,{}),contentItem:o.jsxRuntimeExports.jsx(o.jsxRuntimeExports.Fragment,{})}))==null?void 0:b.map((h,C)=>o.jsxRuntimeExports.jsx(Pe,{selected:(d==null?void 0:d.key)===h.key,onClick:()=>m(h),withBorderRight:!0,heightItems:c},C))}),o.jsxRuntimeExports.jsx(De,{children:d&&(d==null?void 0:d.contentItem)})]})},se=o.Ae`
429
429
  svg:not([color]):not([data-testid='icon']) {
430
430
  path {
431
431
  fill: ${t.sg.colors.neutralColors.colorNeutralDarkest};
@@ -574,6 +574,8 @@
574
574
  border-bottom: ${({withBorder:e,isLast:n})=>e&&!n?`${t.sg.borders.borderWidth.borderWidthThinner} solid ${t.sg.colors.neutralColors.colorNeutralSoft}`:"none"};
575
575
  border-right: ${({withBorder:e})=>e?`${t.sg.borders.borderWidth.borderWidthThinner} solid ${t.sg.colors.neutralColors.colorNeutralSoft}`:"none"};
576
576
 
577
+ background-color: ${({backgroundColor:e})=>e||"transparent"};
578
+
577
579
  &:last-child {
578
580
  border-right: none;
579
581
  }
@@ -583,4 +585,4 @@
583
585
  &:hover {
584
586
  cursor: ${e=>e.isClickable?"pointer":"default"};
585
587
  }
586
- `;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:a=!1,maxHeight:c="40rem",columns:l,dataSource:f,columnsTextSize:d=i,emptyProps:x={width:"100%",height:"100%",title:"Nenhum dado a ser mostrado.",mode:"table",borders:!0,backgroundColor:t.sg.colors.backgroundColors.colorBackgroundSnow},selectedRow:m=!1,hideHeader:h=!1,withBorder:S=!0,withBorderRadius:p=!0,striped:j=!1,borderRadius:R=t.sg.borders.borderRadius.borderRadiusSm}){const E=u.useMemo(()=>Ye(n),[n]),[F,b]=u.useState(null),W=u.useRef(null),v=u.useRef(null),[C,O]=u.useState(l);u.useLayoutEffect(()=>{if(!v.current||l.length===0){O(l);return}const $=()=>{var P;const I=((P=v.current)==null?void 0:P.clientWidth)||0;if(I===0)return;let M=0,k=0;const g=[],r=[];l.forEach(A=>{const N=Number(A.flex);A.width?M+=parseInt(A.width,10)||0:A.flex&&N>0?(k+=N,g.push(A)):r.push(A)});const y=I-M,z="80";let B=[...l];if(y>0){if(g.length>0){const A=y/k;B=l.map(N=>{const D=Number(N.flex);if(D&&D>0){const q=parseInt(N.minWidth||z,10),_=D*A,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 A=y/r.length;B=l.map(N=>{const D=Number(N.flex);if(!N.width&&!D){const q=parseInt(N.minWidth||z,10),_=Math.max(A,q);return{...N,width:`${Math.floor(_)}px`}}return N})}}else B=l.map(A=>A.width?A:{...A,width:A.minWidth||`${z}px`});O(B)};$();const w=new ResizeObserver($);return w.observe(v.current),()=>w.disconnect()},[l]),u.useEffect(()=>{const $=w=>{W.current&&!W.current.contains(w.target)&&b(null)};return document.addEventListener("mousedown",$),()=>{document.removeEventListener("mousedown",$)}},[]);const L=u.useMemo(()=>C?C.some($=>$.mergeHeaderId&&$.mergeHeaderLabel):!1,[C]),T=u.useMemo(()=>{var M,k;if(h||!C||C.length===0)return null;if(!L)return o.jsxRuntimeExports.jsx(U,{isHeader:!0,size:i,numRows:1,borderRadius:R,children:C.map(g=>{var r;return o.jsxRuntimeExports.jsx(G,{width:g.width,minWidth:g.minWidth,maxWidth:g.maxWidth,horizontalAlign:g.horizontalAlign,size:i,columnsTextSize:d,withBorder:S,headerAlign:g.headerAlign,children:((r=g.columnRender)==null?void 0:r.call(g,f))||o.jsxRuntimeExports.jsx("span",{title:g.label,children:g.label})},g.dataIndex)})});const $=[],w=[];let I=0;for(;I<C.length;){const g=C[I];if(g.mergeHeaderId&&g.mergeHeaderLabel){let r=0;const y=g.mergeHeaderId;for(let z=I;z<C.length&&C[z].mergeHeaderId===y;z++)r++;$.push(o.jsxRuntimeExports.jsx(G,{colSpan:r,horizontalAlign:"center",size:i,columnsTextSize:d,withBorder:S,width:g.width,minWidth:g.minWidth,maxWidth:g.maxWidth,headerAlign:g.headerAlign,isTopRow:!0,children:o.jsxRuntimeExports.jsx("span",{title:g.mergeHeaderLabel,children:g.mergeHeaderLabel})},`${g.mergeHeaderId}-merged`));for(let z=0;z<r;z++){const B=C[I+z];w.push(o.jsxRuntimeExports.jsx(G,{width:B.width,minWidth:B.minWidth,maxWidth:B.maxWidth,horizontalAlign:B.horizontalAlign,size:i,columnsTextSize:d,withBorder:S,headerAlign:g.headerAlign,children:((M=B.columnRender)==null?void 0:M.call(B,f))||o.jsxRuntimeExports.jsx("span",{title:B.label,children:B.label})},B.dataIndex+"-individual"))}I+=r}else $.push(o.jsxRuntimeExports.jsx(G,{rowSpan:2,width:g.width,minWidth:g.minWidth,maxWidth:g.maxWidth,horizontalAlign:g.horizontalAlign,size:i,columnsTextSize:d,withBorder:S,headerAlign:g.headerAlign,isTopRow:!0,children:((k=g.columnRender)==null?void 0:k.call(g,f))||o.jsxRuntimeExports.jsx("span",{title:g.label,children:g.label})},g.dataIndex)),I++}return o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx(U,{isHeader:!0,size:i,numRows:2,borderRadius:R,children:$}),w.length>0&&o.jsxRuntimeExports.jsx(U,{isHeader:!0,size:i,numRows:2,borderRadius:R,children:w})]})},[C,h,i,d,L]);return!f||f.length===0?o.jsxRuntimeExports.jsx(o.Empty,{backgroundColor:t.sg.colors.backgroundColors.colorBackgroundSnow,borders:!0,mode:"table",...x}):o.jsxRuntimeExports.jsx(_e,{maxHeight:c,withBorderRadius:p,ref:v,borderRadius:R,children:o.jsxRuntimeExports.jsxs(Ue,{id:e,ref:W,children:[o.jsxRuntimeExports.jsx("thead",{children:T}),o.jsxRuntimeExports.jsx("tbody",{style:{width:"100%"},children:f==null?void 0:f.map(($,w,I)=>{const M=E($);return o.jsxRuntimeExports.jsx(U,{isLast:w===I.length-1,fit:a,size:i,withBorder:S,isSelected:M===F&&m,striped:j&&w%2!==0,borderRadius:R,children:C.map(k=>{var g,r;return o.jsxRuntimeExports.jsx(Ve,{width:k.width,minWidth:k.minWidth,maxWidth:k.maxWidth,size:i,isClickable:H.valuable(s),onClick:()=>{s&&s($,k,w),m&&b(F===M?null:M)},horizontalAlign:k.horizontalAlign,verticalAlign:k.verticalAlign,rowPadding:k.rowPadding,withBorder:S,isLast:w===I.length-1,children:((g=k.render)==null?void 0:g.call(k,$[k.dataIndex],$,w,I))||o.jsxRuntimeExports.jsx("span",{title:$[k.dataIndex],style:{textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden",...(r=k.rowCss)==null?void 0:r.call(k,$)},children:$[k.dataIndex]})||""},`${M}::${k.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;
588
+ `;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:a=!1,maxHeight:c="40rem",columns:l,dataSource:x,columnsTextSize:d=i,emptyProps:m={width:"100%",height:"100%",title:"Nenhum dado a ser mostrado.",mode:"table",borders:!0,backgroundColor:t.sg.colors.backgroundColors.colorBackgroundSnow},selectedRow:p=!1,hideHeader:f=!1,withBorder:b=!0,withBorderRadius:h=!0,striped:C=!1,borderRadius:k=t.sg.borders.borderRadius.borderRadiusSm}){const E=u.useMemo(()=>Ye(n),[n]),[F,j]=u.useState(null),I=u.useRef(null),v=u.useRef(null),[R,O]=u.useState(l);u.useLayoutEffect(()=>{if(!v.current||l.length===0){O(l);return}const $=()=>{var P;const W=((P=v.current)==null?void 0:P.clientWidth)||0;if(W===0)return;let M=0,y=0;const g=[],r=[];l.forEach(A=>{const N=Number(A.flex);A.width?M+=parseInt(A.width,10)||0:A.flex&&N>0?(y+=N,g.push(A)):r.push(A)});const S=W-M,z="80";let B=[...l];if(S>0){if(g.length>0){const A=S/y;B=l.map(N=>{const D=Number(N.flex);if(D&&D>0){const q=parseInt(N.minWidth||z,10),_=D*A,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 A=S/r.length;B=l.map(N=>{const D=Number(N.flex);if(!N.width&&!D){const q=parseInt(N.minWidth||z,10),_=Math.max(A,q);return{...N,width:`${Math.floor(_)}px`}}return N})}}else B=l.map(A=>A.width?A:{...A,width:A.minWidth||`${z}px`});O(B)};$();const w=new ResizeObserver($);return w.observe(v.current),()=>w.disconnect()},[l]),u.useEffect(()=>{const $=w=>{I.current&&!I.current.contains(w.target)&&j(null)};return document.addEventListener("mousedown",$),()=>{document.removeEventListener("mousedown",$)}},[]);const L=u.useMemo(()=>R?R.some($=>$.mergeHeaderId&&$.mergeHeaderLabel):!1,[R]),T=u.useMemo(()=>{var M,y;if(f||!R||R.length===0)return null;if(!L)return o.jsxRuntimeExports.jsx(U,{isHeader:!0,size:i,numRows:1,borderRadius:k,children:R.map(g=>{var r;return o.jsxRuntimeExports.jsx(G,{width:g.width,minWidth:g.minWidth,maxWidth:g.maxWidth,horizontalAlign:g.horizontalAlign,size:i,columnsTextSize:d,withBorder:b,headerAlign:g.headerAlign,children:((r=g.columnRender)==null?void 0:r.call(g,x))||o.jsxRuntimeExports.jsx("span",{title:g.label,children:g.label})},g.dataIndex)})});const $=[],w=[];let W=0;for(;W<R.length;){const g=R[W];if(g.mergeHeaderId&&g.mergeHeaderLabel){let r=0;const S=g.mergeHeaderId;for(let z=W;z<R.length&&R[z].mergeHeaderId===S;z++)r++;$.push(o.jsxRuntimeExports.jsx(G,{colSpan:r,horizontalAlign:"center",size:i,columnsTextSize:d,withBorder:b,width:g.width,minWidth:g.minWidth,maxWidth:g.maxWidth,headerAlign:g.headerAlign,isTopRow:!0,children:o.jsxRuntimeExports.jsx("span",{title:g.mergeHeaderLabel,children:g.mergeHeaderLabel})},`${g.mergeHeaderId}-merged`));for(let z=0;z<r;z++){const B=R[W+z];w.push(o.jsxRuntimeExports.jsx(G,{width:B.width,minWidth:B.minWidth,maxWidth:B.maxWidth,horizontalAlign:B.horizontalAlign,size:i,columnsTextSize:d,withBorder:b,headerAlign:g.headerAlign,children:((M=B.columnRender)==null?void 0:M.call(B,x))||o.jsxRuntimeExports.jsx("span",{title:B.label,children:B.label})},B.dataIndex+"-individual"))}W+=r}else $.push(o.jsxRuntimeExports.jsx(G,{rowSpan:2,width:g.width,minWidth:g.minWidth,maxWidth:g.maxWidth,horizontalAlign:g.horizontalAlign,size:i,columnsTextSize:d,withBorder:b,headerAlign:g.headerAlign,isTopRow:!0,children:((y=g.columnRender)==null?void 0:y.call(g,x))||o.jsxRuntimeExports.jsx("span",{title:g.label,children:g.label})},g.dataIndex)),W++}return o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx(U,{isHeader:!0,size:i,numRows:2,borderRadius:k,children:$}),w.length>0&&o.jsxRuntimeExports.jsx(U,{isHeader:!0,size:i,numRows:2,borderRadius:k,children:w})]})},[R,f,i,d,L]);return!x||x.length===0?o.jsxRuntimeExports.jsx(o.Empty,{backgroundColor:t.sg.colors.backgroundColors.colorBackgroundSnow,borders:!0,mode:"table",...m}):o.jsxRuntimeExports.jsx(_e,{maxHeight:c,withBorderRadius:h,ref:v,borderRadius:k,children:o.jsxRuntimeExports.jsxs(Ue,{id:e,ref:I,children:[o.jsxRuntimeExports.jsx("thead",{children:T}),o.jsxRuntimeExports.jsx("tbody",{style:{width:"100%"},children:x==null?void 0:x.map(($,w,W)=>{const M=E($);return o.jsxRuntimeExports.jsx(U,{isLast:w===W.length-1,fit:a,size:i,withBorder:b,isSelected:M===F&&p,striped:C&&w%2!==0,borderRadius:k,children:R.map(y=>{var g,r,S;return o.jsxRuntimeExports.jsx(Ve,{width:y.width,minWidth:y.minWidth,maxWidth:y.maxWidth,size:i,isClickable:H.valuable(s),onClick:()=>{s&&s($,y,w),p&&j(F===M?null:M)},horizontalAlign:y.horizontalAlign,verticalAlign:y.verticalAlign,rowPadding:y.rowPadding,withBorder:b,isLast:w===W.length-1,backgroundColor:(g=y.paint)==null?void 0:g.call(y,$[y.dataIndex],$,w,W),children:((r=y.render)==null?void 0:r.call(y,$[y.dataIndex],$,w,W))||o.jsxRuntimeExports.jsx("span",{title:$[y.dataIndex],style:{textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden",...(S=y.rowCss)==null?void 0:S.call(y,$)},children:$[y.dataIndex]})||""},`${M}::${y.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;