@ufal-lccv/gpsub-ds 0.0.23 → 0.0.24
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 +31 -31
- package/dist/{RequiredLabel.view-CozPA47g.js → RequiredLabel.view-CAjgSahK.js} +10 -11
- package/dist/RequiredLabel.view-CnxQGeJN.cjs +1 -0
- package/dist/{Table.view-oMq7rOZT.cjs → Table.view-CICSAgK_.cjs} +44 -44
- package/dist/{Table.view-CraTHYN6.js → Table.view-DKq0CpYi.js} +471 -467
- package/dist/{Title.view-DY1vs-iO.js → Title.view-C71vN-QL.js} +10 -10
- package/dist/Title.view-CufhNH5T.cjs +1 -0
- package/dist/Tooltip.view-BX9lk5cc.cjs +9334 -0
- package/dist/Tooltip.view-Bd5RRJHF.js +90980 -0
- package/dist/components/atoms/LibraryCard/LibraryCard.view.d.ts +1 -1
- package/dist/components/atoms/index.cjs.js +1 -1
- package/dist/components/atoms/index.es.js +2 -2
- package/dist/components/index.cjs.js +1 -1
- package/dist/components/index.es.js +45 -46
- package/dist/components/molecules/index.cjs.js +1 -1
- package/dist/components/molecules/index.es.js +17 -18
- package/dist/components/organisms/Form/CheckboxField.view.d.ts +3 -5
- package/dist/components/organisms/Form/SelectField.view.d.ts +3 -5
- package/dist/components/organisms/index.cjs.js +1 -1
- package/dist/components/organisms/index.es.js +7 -7
- package/dist/helpers/functions/index.d.ts +1 -0
- package/dist/helpers/functions/multiplyRemValues.d.ts +1 -0
- package/dist/helpers/index.cjs.js +1 -1
- package/dist/helpers/index.es.js +9 -8
- package/dist/index.cjs.js +1 -1
- package/dist/index.es.js +54 -54
- package/dist/multiplyRemValues-B_PFYi3M.js +47 -0
- package/dist/multiplyRemValues-BsUvyKS7.cjs +7 -0
- package/dist/types/styleGuide/index.d.ts +1 -174
- package/package.json +117 -121
- package/dist/RequiredLabel.view-Cst1Xi0O.cjs +0 -1
- package/dist/Title.view-BqxGXSW7.cjs +0 -1
- package/dist/Tooltip.view-7yR4bqF1.cjs +0 -1455
- package/dist/Tooltip.view-Cao5yOMP.js +0 -5822
- package/dist/index-BcwQwoIM.cjs +0 -6
- package/dist/index-_v6RoRxb.js +0 -32
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,8 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { useState as
|
|
1
|
+
import { o, z as k, D as j, q as F, b as n, G as f, W as m, H as I, J as E, K as w, N as S, O as R, I as D, P as L } from "./Tooltip.view-Bd5RRJHF.js";
|
|
2
|
+
import { useState as O } from "react";
|
|
3
3
|
import { sg as r } from "sbwb-ds";
|
|
4
|
-
|
|
5
|
-
const $ = ({
|
|
4
|
+
const W = ({
|
|
6
5
|
width: c = "100%",
|
|
7
6
|
height: a = "fit-content",
|
|
8
7
|
type: e,
|
|
@@ -14,7 +13,7 @@ const $ = ({
|
|
|
14
13
|
canClose: h = !0
|
|
15
14
|
}) => {
|
|
16
15
|
var b, u;
|
|
17
|
-
const [p, g] =
|
|
16
|
+
const [p, g] = O(x), s = {
|
|
18
17
|
info: {
|
|
19
18
|
backgroundColor: "#D5EBFD",
|
|
20
19
|
borderColor: r.colors.feedbackColors.colorFeedbackInfo,
|
|
@@ -76,13 +75,13 @@ const $ = ({
|
|
|
76
75
|
position: "relative"
|
|
77
76
|
},
|
|
78
77
|
children: [
|
|
79
|
-
e === "warning" ? /* @__PURE__ */ o.jsx(
|
|
78
|
+
e === "warning" ? /* @__PURE__ */ o.jsx(f, { children: /* @__PURE__ */ o.jsx(m, { width: "20px", height: "20px" }) }) : /* @__PURE__ */ o.jsx(o.Fragment, { children: s == null ? void 0 : s[e].icon }),
|
|
80
79
|
/* @__PURE__ */ o.jsxs(n, { width: "100%", flex: "1", height: "100%", children: [
|
|
81
80
|
/* @__PURE__ */ o.jsx(I, { children: l }),
|
|
82
|
-
/* @__PURE__ */ o.jsx(
|
|
81
|
+
/* @__PURE__ */ o.jsx(E, { children: t })
|
|
83
82
|
] }),
|
|
84
83
|
h && /* @__PURE__ */ o.jsx(n, { children: /* @__PURE__ */ o.jsx(
|
|
85
|
-
|
|
84
|
+
w,
|
|
86
85
|
{
|
|
87
86
|
color: r.colors.neutralColors.colorNeutralCloudy,
|
|
88
87
|
cursor: "pointer",
|
|
@@ -118,14 +117,14 @@ const $ = ({
|
|
|
118
117
|
] }),
|
|
119
118
|
l && /* @__PURE__ */ o.jsx(D, { ...i })
|
|
120
119
|
] });
|
|
121
|
-
},
|
|
120
|
+
}, $ = ({
|
|
122
121
|
width: c = "100%",
|
|
123
122
|
flex: a,
|
|
124
123
|
label: e = "Obrigatório",
|
|
125
124
|
margin: l = "0 0 16px 0"
|
|
126
125
|
}) => /* @__PURE__ */ o.jsx(n, { width: c, flex: a, customStyles: { margin: l }, children: /* @__PURE__ */ o.jsx(L, { children: `* ${e}` }) });
|
|
127
126
|
export {
|
|
128
|
-
|
|
127
|
+
W as A,
|
|
129
128
|
q as L,
|
|
130
|
-
|
|
129
|
+
$ as R
|
|
131
130
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const r=require("./Tooltip.view-BX9lk5cc.cjs"),h=require("react"),o=require("sbwb-ds"),m=({width:n="100%",height:i="fit-content",type:e,title:t,message:c,margin:x,open:a=!0,onClose:l,canClose:p=!0})=>{var d,u;const[j,b]=h.useState(a),s={info:{backgroundColor:"#D5EBFD",borderColor:o.sg.colors.feedbackColors.colorFeedbackInfo,icon:r.jsxRuntimeExports.jsx(r.InfoFill_default,{color:o.sg.colors.feedbackColors.colorFeedbackInfo,height:"20px",width:"20px"})},success:{backgroundColor:"#DAF9DB",borderColor:o.sg.colors.feedbackColors.colorFeedbackSuccess,icon:r.jsxRuntimeExports.jsx(r.CheckCircleFill_default,{color:o.sg.colors.feedbackColors.colorFeedbackSuccess,height:"20px",width:"20px"})},warning:{backgroundColor:"#FEEECF",borderColor:o.sg.colors.feedbackColors.colorFeedbackWarning},error:{backgroundColor:"#FFE1E1",borderColor:o.sg.colors.feedbackColors.colorFeedbackError,icon:r.jsxRuntimeExports.jsx(r.ErrorFill_default,{color:o.sg.colors.feedbackColors.colorFeedbackError,height:"20px",width:"20px"})}};function g(){b(!1),l==null||l()}return r.jsxRuntimeExports.jsx(r.jsxRuntimeExports.Fragment,{children:j?r.jsxRuntimeExports.jsxs(r.Container,{width:n,height:i,direction:"horizontal",verticalAlign:t?"top":"center",gap:o.sg.spacings.spacingInset.spacingInsetXs,padding:o.sg.spacings.spacingInline.spacingInlineSm,backgroundColor:(d=s==null?void 0:s[e])==null?void 0:d.backgroundColor,customStyles:{border:`1px solid ${(u=s==null?void 0:s[e])==null?void 0:u.borderColor}`,borderRadius:o.sg.borders.borderRadius.borderRadiusSm,margin:x,position:"relative"},children:[e==="warning"?r.jsxRuntimeExports.jsx(r.ContainerWarning,{children:r.jsxRuntimeExports.jsx(r.WarningFill_default,{width:"20px",height:"20px"})}):r.jsxRuntimeExports.jsx(r.jsxRuntimeExports.Fragment,{children:s==null?void 0:s[e].icon}),r.jsxRuntimeExports.jsxs(r.Container,{width:"100%",flex:"1",height:"100%",children:[r.jsxRuntimeExports.jsx(r.Title$1,{children:t}),r.jsxRuntimeExports.jsx(r.Message,{children:c})]}),p&&r.jsxRuntimeExports.jsx(r.Container,{children:r.jsxRuntimeExports.jsx(r.Close_default,{color:o.sg.colors.neutralColors.colorNeutralCloudy,cursor:"pointer",onClick:g,height:"20px",width:"20px"})})]}):r.jsxRuntimeExports.jsx(r.jsxRuntimeExports.Fragment,{})})},E=({label:n,labelRender:i,infoProps:e={},withInfo:t=!0,flex:c,width:x="100%",isRequired:a=!1})=>{const l={tooltipProps:{position:"top",...e==null?void 0:e.tooltipProps,size:"Small"}};return r.jsxRuntimeExports.jsxs(r.Container,{width:x,direction:"horizontal",gap:"4px",flex:c,children:[i??r.jsxRuntimeExports.jsxs(r.Label$1,{children:[n," ",a?r.jsxRuntimeExports.jsx(r.Required,{children:"*"}):null]}),t&&r.jsxRuntimeExports.jsx(r.Info,{...l})]})},R=({width:n="100%",flex:i,label:e="Obrigatório",margin:t="0 0 16px 0"})=>r.jsxRuntimeExports.jsx(r.Container,{width:n,flex:i,customStyles:{margin:t},children:r.jsxRuntimeExports.jsx(r.Label$2,{children:`* ${e}`})});exports.AlertInline=m;exports.LabelField=E;exports.RequiredLabelView=R;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const o=require("./Tooltip.view-
|
|
1
|
+
"use strict";const o=require("./Tooltip.view-BX9lk5cc.cjs"),u=require("react"),t=require("sbwb-ds"),F=require("./multiplyRemValues-BsUvyKS7.cjs"),Q=require("react-hook-form"),ee=350,ce=({title:e,children:n,endAdornment:s=null,marginBottom:a="16px",customStyles:i={},wrapperCustomStyles:c={},animationContainerCustomStyles:l={},hideAdornmentOnCollapse:x=!1,maxHeight:h="none",height:p="fit-content"})=>{const[f,d]=u.useState(!1),[b,E]=u.useState(!0);u.useEffect(()=>{if(x)if(f){const w=setTimeout(()=>E(!1),ee);return()=>clearTimeout(w)}else E(!0)},[f,x]);const m=x&&!b?null:s;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:a,collapse:{collapsed:f,setCollapsed:d},endAdornment:m,customStyles:i}),o.jsxRuntimeExports.jsx(o.Container,{gap:"8px",width:"100%",height:p,customStyles:{...l,maxHeight:f?"0":h,transition:`max-height ${ee}ms ease-in-out`},children:n})]})};var Y,te;function de(){if(te)return Y;te=1;function e(n,s,a){var i,c,l,x,h;s==null&&(s=100);function p(){var d=Date.now()-x;d<s&&d>=0?i=setTimeout(p,s-d):(i=null,a||(h=n.apply(l,c),l=c=null))}var f=function(){l=this,c=arguments,x=Date.now();var d=a&&!i;return i||(i=setTimeout(p,s)),d&&(h=n.apply(l,c),l=c=null),h};return f.clear=function(){i&&(clearTimeout(i),i=null)},f.flush=function(){i&&(h=n.apply(l,c),l=c=null,clearTimeout(i),i=null)},f}return e.debounce=e,Y=e,Y}var ge=de();const ue=o.getDefaultExportFromCjs(ge);function Z({form:e,fieldName:n,triggerType:s=null,debounceTime:a=500}){const i=u.useCallback(()=>{e.trigger(n)},[e,n]),c=u.useMemo(()=>ue(()=>i(),a),[i,a]),l=u.useMemo(()=>["all","onChange"].includes(s)?c:null,[c,s]),x=u.useMemo(()=>["all","onBlur"].includes(s)?i:null,[s]);return u.useMemo(()=>({onChangeTrigger:l,onBlurTrigger:x}),[l,x])}const fe=({form:e,name:n,label:s,options:a,readonly:i=!1,disabled:c=!1,optionsMap:l,width:x="100%",flex:h,placeholder:p,onSelect:f,parser:d,filter:b,tooltipProps:E={},infoProps:m={},maxHeigthMenu:w,isRequired:R=!1,onRemoveSelected:H,triggerFormField:C=null,displayText:W,...v})=>{const{onChangeTrigger:k}=Z({form:e,fieldName:n,triggerType:C,debounceTime:0}),O={position:"top",...E},L={...m,tooltipProps:{position:"top",maxWidth:"300px",...m==null?void 0:m.tooltipProps}},T=(y,I)=>{let A=y;d&&(A=d==null?void 0:d(y)),I(A),f==null||f(A),k==null||k()},$=u.useMemo(()=>F.valuable(l)?l:Object.fromEntries(a.map(y=>[y.value,y])),[a,l]);return o.jsxRuntimeExports.jsx(o.Container,{width:x,flex:h,children:o.jsxRuntimeExports.jsx(Q.Controller,{name:n,control:e.control,render:({field:{onChange:y,value:I},fieldState:{error:A=null}})=>{let j=$[I];return o.jsxRuntimeExports.jsx(K,{label:s,width:"100%",size:"Small",disabled:c,readonly:i,filter:b,errorMessage:A==null?void 0:A.message,placeholder:p,value:j,handleOption:g=>{T(g.value,y)},tooltipProps:O,options:a,maxHeigthMenu:w,infoProps:L,maxHeightMenu:w,isRequired:R,onRemoveSelected:H,displayText:W,...v})}})})},ne=({form:e,name:n,label:s,readonly:a=!1,disabled:i=!1,width:c="100%",height:l="100%",flex:x,placeholder:h,charactersCounter:p=!0,maxlength:f=1e3,resize:d=!0,triggerFormField:b=null,minHeight:E,maxHeight:m,...w})=>{const{onChangeTrigger:R}=Z({form:e,fieldName:n,triggerType:b}),H=(C,W)=>{W(C),R==null||R()};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:C,value:W},fieldState:{error:v=null}})=>o.jsxRuntimeExports.jsx(o.Textarea,{label:s,value:W||"",width:"100%",disabled:i,readonly:a,height:l,minHeight:E,maxHeight:m,errorMessage:v==null?void 0:v.message,placeholder:h,onChange:k=>H(k.target.value,C),charactersCounter:p,maxlength:f,size:"Small",resize:d,...w})})})};ne.displayName="TextareaField";const he=({form:e,name:n,id:s=n,label:a,readonly:i=!1,disabled:c=!1,afterCheck:l,width:x="100%",formatter:h,parser:p,flex:f,size:d="Medium",triggerFormField:b=null,...E})=>{const{onChangeTrigger:m}=Z({form:e,fieldName:n,triggerType:b,debounceTime:0}),w=(R,H)=>{H(R),l==null||l(R),m==null||m()};return o.jsxRuntimeExports.jsx(o.Container,{width:x,flex:f,children:o.jsxRuntimeExports.jsx(Q.Controller,{name:n,control:e.control,render:({field:{onChange:R,value:H},fieldState:{error:C=null}})=>{const W=C==null?void 0:C.message;return W&&console.log("Error on checkbox!",W),o.jsxRuntimeExports.jsx(o.Checkbox,{id:`form-checkbox-${s}`,checked:(h==null?void 0:h(H))??H,name:n,label:a,disabled:c||i,onChange:v=>{w((p==null?void 0:p(v.target.checked,H))??v.target.checked,R)},size:d,...E})}})})},xe=o.qe.ul`
|
|
2
2
|
${F.resetStyles}
|
|
3
3
|
position: fixed;
|
|
4
4
|
margin-top: ${({marginTop:e})=>e};
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
background: ${t.sg.colors.neutralColors.colorNeutralClean};
|
|
29
29
|
border-radius: ${t.sg.borders.borderRadius.borderRadiusPill};
|
|
30
30
|
}
|
|
31
|
-
`,
|
|
31
|
+
`,me=o.qe.li`
|
|
32
32
|
${F.resetStyles}
|
|
33
33
|
font-family: ${t.sg.fonts.fontFamily.fontFamilyPrimary};
|
|
34
34
|
font-size: ${({size:e})=>e==="Small"?t.sg.fonts.fontSize.fontSizeBodyMd:t.sg.fonts.fontSize.fontSizeBodyLg};
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
margin: 0 ${t.sg.spacings.spacingInline.spacingInlineXs};
|
|
37
37
|
cursor: default;
|
|
38
38
|
color: ${t.sg.colors.neutralColors.colorNeutralDark};
|
|
39
|
-
`,
|
|
39
|
+
`,pe=o.qe.li`
|
|
40
40
|
${F.resetStyles}
|
|
41
41
|
display: flex;
|
|
42
42
|
flex: 2;
|
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
color: ${({disabled:n})=>n?t.sg.colors.neutralColors.colorNeutralCleanest:t.sg.colors.neutralColors.colorNeutralCloudy};
|
|
69
69
|
}
|
|
70
70
|
`}
|
|
71
|
-
`,
|
|
71
|
+
`,Se=o.qe.li`
|
|
72
72
|
${F.resetStyles}
|
|
73
73
|
font-size: ${({size:e})=>e==="Small"?t.sg.fonts.fontSize.fontSizeBodySm:t.sg.fonts.fontSize.fontSizeBodyMd};
|
|
74
74
|
font-family: ${t.sg.fonts.fontFamily.fontFamilyPrimary};
|
|
@@ -79,13 +79,13 @@
|
|
|
79
79
|
margin: ${({size:e})=>e==="Small"?`${t.sg.spacings.spacingStack.spacingStackSm} ${t.sg.spacings.spacingInline.spacingInlineXs}
|
|
80
80
|
${t.sg.spacings.spacingStack.spacingStackNano}`:`${t.sg.spacings.spacingStack.spacingStackSm} ${t.sg.spacings.spacingInline.spacingInlineXs}
|
|
81
81
|
${t.sg.spacings.spacingStack.spacingStackXs}`};
|
|
82
|
-
`,
|
|
82
|
+
`,be=o.qe.span`
|
|
83
83
|
${F.resetStyles}
|
|
84
84
|
font-family: ${t.sg.fonts.fontFamily.fontFamilyPrimary};
|
|
85
85
|
font-size: ${({size:e})=>e==="Small"?t.sg.fonts.fontSize.fontSizeBodyMd:t.sg.fonts.fontSize.fontSizeBodyLg};
|
|
86
86
|
font-weight: ${t.sg.fonts.fontWeight.fontWeightSemiBold};
|
|
87
87
|
line-height: ${({size:e})=>e==="Small"?t.sg.fonts.lineHeight.lineHeightSm(t.sg.fonts.fontSize.fontSizeBodyMd):t.sg.fonts.lineHeight.lineHeightMd(t.sg.fonts.fontSize.fontSizeBodyLg)};
|
|
88
|
-
|
|
88
|
+
`,$e=o.qe.div`
|
|
89
89
|
${F.resetStyles}
|
|
90
90
|
display: flex;
|
|
91
91
|
font-family: ${t.sg.fonts.fontFamily.fontFamilyPrimary};
|
|
@@ -101,7 +101,7 @@
|
|
|
101
101
|
text-overflow: ellipsis;
|
|
102
102
|
text-align: start;
|
|
103
103
|
}
|
|
104
|
-
`,
|
|
104
|
+
`,we=o.qe.div`
|
|
105
105
|
${F.resetStyles}
|
|
106
106
|
display: flex;
|
|
107
107
|
flex-direction: row;
|
|
@@ -112,13 +112,13 @@
|
|
|
112
112
|
background-color: ${({highlightedIndex:e,disabled:n})=>e?n?t.sg.colors.backgroundColors.colorBackgroundSnow:t.sg.colors.neutralColors.colorNeutralLight:t.sg.colors.backgroundColors.colorBackgroundSnow};
|
|
113
113
|
border-radius: ${t.sg.borders.borderRadius.borderRadiusSm};
|
|
114
114
|
min-height: ${({size:e})=>e==="Small"?"28px":"40px"};
|
|
115
|
-
|
|
115
|
+
`,ye=o.qe.div`
|
|
116
116
|
${F.resetStyles}
|
|
117
117
|
padding: ${({iconPosition:e})=>e==="left"?`0 ${t.sg.spacings.spacingInline.spacingInlineNano} 0 0`:`0 0 0 ${t.sg.spacings.spacingInline.spacingInlineNano}`};
|
|
118
118
|
margin: 0;
|
|
119
119
|
display: flex;
|
|
120
120
|
align-self: center;
|
|
121
|
-
`,
|
|
121
|
+
`,je=(e,n,s=0,a=0,i="left")=>{const[c,l]=u.useState(0),[x,h]=u.useState(),p=u.useRef(null),f=u.useCallback(()=>{if(!e.current||!p.current)return;const d=e.current.getBoundingClientRect(),b=p.current.getBoundingClientRect(),E=window.innerHeight,m=window.innerWidth,w=d.top,R=E-d.bottom,H=R<b.height+a&&w>R;let C;H?(C=d.top-b.height-s,p.current.style.maxHeight=`${w-s}px`):(C=d.bottom+a,p.current.style.maxHeight=`${R-a}px`);let W=d.left;const v=W+b.width-m;v>0&&(W-=v),W<0&&(W=0);const k=m-d.right;Object.assign(p.current.style,{position:"fixed",top:`${C}px`,...i==="left"?{left:`${W}px`}:{right:`${k}px`},width:`${Math.max(d.width,b.width)}px`,overflowY:"auto"})},[s,a,i]);return u.useEffect(()=>{var b;l(0),h((b=e.current)==null?void 0:b.clientWidth),f();const d=()=>f();return window.addEventListener("scroll",d,!0),window.addEventListener("resize",d),()=>{window.removeEventListener("scroll",d,!0),window.removeEventListener("resize",d)}},[e,f]),{highlightedIndex:c,setHighlightedIndex:l,isOptionSelected:d=>d.label===(n==null?void 0:n.label),optionsRef:p,parentWidth:x}},V=u.forwardRef(({selectContainerRef:e,optionsSelect:n,size:s,selectOption:a,value:i,inputValue:c,widthMenu:l,maxHeightMenu:x="180px",menuIsOpen:h,onEnter:p,marginTop:f="4px",iconName:d,iconColor:b,iconPosition:E,topOffset:m=0,bottomOffset:w=0,truncateText:R=!0,menuJustifyContent:H="flex-start",tableActionButton:C,menuLateralPadding:W="8px",menuOptionFlexDirection:v="column",confirmSelection:k,menuAlign:O="left"},L)=>{F.valuable(d)&&(d+="Ant");const{highlightedIndex:T,setHighlightedIndex:$,isOptionSelected:y,optionsRef:I,parentWidth:A}=je(e,i,m,w,O);u.useEffect(()=>{const r=S=>{if(h){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];a(z),p&&p(z)}}};return window.addEventListener("keydown",r),()=>window.removeEventListener("keydown",r)},[h,n,T,p,a,k]);const j=r=>typeof r=="string"?r:u.isValidElement(r)&&typeof r.props.children=="string"?r.props.children:String(r),g=(r,S)=>{var M,N;if(E!==S)return null;const z=F.valuable((M=r.tooltipProps)==null?void 0:M.label),B=r.iconName||d||"InfoFill0Sm",D=o.jsxRuntimeExports.jsx(ye,{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:b??t.sg.colors.neutralColors.colorNeutralDark})});return z?o.jsxRuntimeExports.jsx(o.Tooltip,{...r==null?void 0:r.tooltipProps,isActive:!0,children:D}):D};return o.jsxRuntimeExports.jsx(xe,{marginTop:f,width:l??`${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(me,{size:s,children:"Sem opções"}):n.map((r,S)=>{var D,M;const z=typeof r.render=="function"?r.render():null,B=j(r.label);if(r.isSection)return o.jsxRuntimeExports.jsx(Se,{size:s,children:B},B);{const N=B.toLowerCase().indexOf((c==null?void 0:c.toLowerCase())||"");return o.jsxRuntimeExports.jsxs(we,{isOptionSelected:y(r),highlightedIndex:S===T,onClick:P=>{P.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:()=>a(r)}}):a(r))},onMouseEnter:()=>$(S),disabled:r.disabled,size:s,menuLateralPadding:W,children:[g(r,"left"),o.jsxRuntimeExports.jsxs(pe,{menuOptionFlexDirection:v,menuJustifyContent:H,iconName:d,isOptionSelected:y(r),highlightedIndex:S===T,"data-testid":r.value,size:s,hasDescription:!!r.description,optionValue:r.value,disabled:r.disabled,truncateText:R,tableActionButton:C,children:[o.jsxRuntimeExports.jsxs($e,{truncateText:!u.isValidElement(r.label)&&R,children:[z,u.isValidElement(r.label)?o.jsxRuntimeExports.jsx("p",{title:((D=r==null?void 0:r.tooltipProps)==null?void 0:D.label)??j(r.label),children:r.label}):o.jsxRuntimeExports.jsx("p",{title:((M=r==null?void 0:r.tooltipProps)==null?void 0:M.label)??B,children:c&&N>=0?o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[B.substring(0,N),o.jsxRuntimeExports.jsx(be,{size:s,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))}})})});V.displayName="MenuSelect";const re=({title:e,iconName:n,onClickIcon:s,width:a,height:i,flex:c,children:l,wrapperCustomStyles:x={},contentCustomStyles:h={},titleCustomStyles:p={}})=>o.jsxRuntimeExports.jsxs(o.Container,{width:a,height:i,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:h,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:()=>s==null?void 0:s(),color:F.valuable(s)?t.sg.colors.neutralColors.colorNeutralDark:t.sg.colors.neutralColors.colorNeutralCloudy,cursorPointer:F.valuable(s)})]}):null]}),o.jsxRuntimeExports.jsx(o.Container,{width:"100%",flex:"1",children:l})]});re.displayName="Section";const Ce=o.qe.div`
|
|
122
122
|
${F.resetStyles}
|
|
123
123
|
display: flex;
|
|
124
124
|
flex-direction: column;
|
|
@@ -127,7 +127,7 @@
|
|
|
127
127
|
&:hover {
|
|
128
128
|
cursor: ${({disabled:e,readonly:n})=>e||n?"default":"pointer"};
|
|
129
129
|
}
|
|
130
|
-
`,
|
|
130
|
+
`,Re=o.qe.div`
|
|
131
131
|
width: 100%;
|
|
132
132
|
${({variant:e})=>e==="default"?o.Ae`
|
|
133
133
|
min-height: ${({size:n})=>n==="Small"?"3.2rem":"4rem"};
|
|
@@ -142,7 +142,7 @@
|
|
|
142
142
|
${({variant:e})=>e==="default"&&o.Ae`
|
|
143
143
|
border: ${t.sg.borders.borderWidth.borderWidthThinner} solid;
|
|
144
144
|
border-radius: ${t.sg.borders.borderRadius.borderRadiusSm};
|
|
145
|
-
border-color: ${({isOpen:n,hasError:
|
|
145
|
+
border-color: ${({isOpen:n,hasError:s,readonly:a,disabled:i})=>s?t.sg.colors.feedbackColors.colorFeedbackError:a||i?t.sg.colors.neutralColors.colorNeutralClean:n?t.sg.colors.neutralColors.colorNeutralCloudy:t.sg.colors.neutralColors.colorNeutralClean};
|
|
146
146
|
`}
|
|
147
147
|
|
|
148
148
|
background-color: ${({variant:e})=>e==="default"?t.sg.colors.backgroundColors.colorBackgroundSnow:"transparent"};
|
|
@@ -176,7 +176,7 @@
|
|
|
176
176
|
fill: ${({disabled:e,readonly:n})=>t.sg.colors.neutralColors.colorNeutralCloudy};
|
|
177
177
|
}
|
|
178
178
|
}
|
|
179
|
-
`,
|
|
179
|
+
`,ke=o.qe.div`
|
|
180
180
|
align-items: center;
|
|
181
181
|
display: flex;
|
|
182
182
|
flex: 1 1 0%;
|
|
@@ -185,7 +185,7 @@
|
|
|
185
185
|
overflow: hidden;
|
|
186
186
|
min-height: 1em;
|
|
187
187
|
box-sizing: border-box;
|
|
188
|
-
`,
|
|
188
|
+
`,oe=o.qe.span`
|
|
189
189
|
display: flex;
|
|
190
190
|
flex-wrap: wrap;
|
|
191
191
|
width: ${({isDisplayText:e})=>e?"100%":"fit-content"};
|
|
@@ -201,7 +201,7 @@
|
|
|
201
201
|
width: ${({isDisplayText:e})=>e?"100%":"fit-content"};
|
|
202
202
|
font-style: ${({isDisplayText:e})=>e?"italic":"normal"};
|
|
203
203
|
}
|
|
204
|
-
`,
|
|
204
|
+
`,Ee=o.qe.span`
|
|
205
205
|
color: ${t.sg.colors.neutralColors.colorNeutralCloudy};
|
|
206
206
|
font-size: ${({size:e,variant:n})=>n==="default"?e==="Small"?t.sg.fonts.fontSize.fontSizeBodyMd:t.sg.fonts.fontSize.fontSizeBodyLg:e==="Small"?t.sg.fonts.fontSize.fontSizeBodySm:t.sg.fonts.fontSize.fontSizeBodyMd};
|
|
207
207
|
font-family: ${t.sg.fonts.fontFamily.fontFamilyPrimary};
|
|
@@ -210,7 +210,7 @@
|
|
|
210
210
|
white-space: nowrap;
|
|
211
211
|
overflow: hidden;
|
|
212
212
|
width: fit-content;
|
|
213
|
-
`,
|
|
213
|
+
`,ze=o.qe.input`
|
|
214
214
|
flex: 1;
|
|
215
215
|
min-width: 0.1rem;
|
|
216
216
|
border: none;
|
|
@@ -224,20 +224,20 @@
|
|
|
224
224
|
outline: none;
|
|
225
225
|
cursor: ${({disabled:e,readOnly:n})=>e||n?"default":"pointer"};
|
|
226
226
|
}
|
|
227
|
-
`,
|
|
227
|
+
`,Be=o.qe.div`
|
|
228
228
|
width: 100%;
|
|
229
229
|
display: flex;
|
|
230
230
|
flex-direction: row;
|
|
231
231
|
gap: 4px;
|
|
232
232
|
justify-content: flex-start;
|
|
233
233
|
margin-bottom: ${t.sg.spacings.spacingStack.spacingStackNano};
|
|
234
|
-
`,
|
|
234
|
+
`,Ne=o.qe.label`
|
|
235
235
|
font-size: ${t.sg.fonts.fontSize.fontSizeBodyMd};
|
|
236
236
|
font-weight: ${t.sg.fonts.fontWeight.fontWeightRegular};
|
|
237
237
|
font-family: ${t.sg.fonts.fontFamily.fontFamilyPrimary};
|
|
238
238
|
line-height: ${t.sg.fonts.lineHeight.lineHeightSm(t.sg.fonts.fontSize.fontSizeBodyMd)};
|
|
239
239
|
color: ${t.sg.colors.neutralColors.colorNeutralDark};
|
|
240
|
-
`,
|
|
240
|
+
`,Ie=o.qe.label`
|
|
241
241
|
font-family: ${t.sg.fonts.fontFamily.fontFamilyPrimary};
|
|
242
242
|
font-size: ${t.sg.fonts.fontSize.fontSizeBodyMd};
|
|
243
243
|
font-weight: ${t.sg.fonts.fontWeight.fontWeightRegular};
|
|
@@ -250,21 +250,21 @@
|
|
|
250
250
|
color: ${t.sg.colors.feedbackColors.colorFeedbackError};
|
|
251
251
|
margin-top: ${t.sg.spacings.spacingInline.spacingInlineNano};
|
|
252
252
|
width: 100%;
|
|
253
|
-
`;const
|
|
253
|
+
`;const We=o.qe.p`
|
|
254
254
|
display: inline-block;
|
|
255
255
|
font-size: ${({size:e})=>e==="Small"?t.sg.fonts.fontSize.fontSizeBodySm:t.sg.fonts.fontSize.fontSizeBodyMd};
|
|
256
256
|
font-weight: ${t.sg.fonts.fontWeight.fontWeightRegular};
|
|
257
257
|
color: ${t.sg.colors.neutralColors.colorNeutralDark};
|
|
258
258
|
margin-top: ${t.sg.spacings.spacingInline.spacingInlineNano};
|
|
259
259
|
width: 100%;
|
|
260
|
-
`,
|
|
260
|
+
`,ve=(e,{value:n,options:s})=>{const[a,i]=u.useState(!1),[c,l]=u.useState(!1),[x,h]=u.useState(""),[p,f]=u.useState(s),d=u.useRef(null),b=u.useRef(null),E=u.useRef(null),m=u.useRef(null);u.useEffect(()=>{const C=()=>{l(!1)};return window.addEventListener("scroll",C,{passive:!0}),window.addEventListener("resize",C,{passive:!0}),()=>{window.removeEventListener("scroll",C),window.removeEventListener("resize",C)}},[]);function w(C){h(""),l(!1),i(!0),E!=null&&E.current&&E.current.focus(),C!==n&&e(C)}const R=C=>{if(C){const W=new RegExp(C,"i"),v=s.filter(k=>W.exec(k.label));f(v)}else f(s)};function H(C){return!C}return{isOpen:a,setIsOpen:i,expanded:c,setExpanded:l,inputValue:x,setInputValue:h,optionsSelect:p,setOptionSelect:f,selectContainerRef:d,containerRef:b,inputContainerRef:E,optionsRef:m,selectOption:w,handlerFilterOptions:R,isValue:H}},K=u.forwardRef(({value:e,handleOption:n,options:s,filter:a=!0,placeholder:i,label:c,size:l="Medium",width:x="100%",disabled:h,helpText:p,readonly:f,errorMessage:d,tooltipProps:b={},onBlur:E,onEnter:m,variant:w="default",infoProps:R={},maxHeightMenu:H,isRequired:C=!1,onRemoveSelected:W,displayText:v,displayTextProps:k={}},O)=>{const{isOpen:L,setIsOpen:T,expanded:$,setExpanded:y,inputValue:I,setInputValue:A,optionsSelect:j,selectContainerRef:g,containerRef:r,inputContainerRef:S,selectOption:z,setOptionSelect:B,handlerFilterOptions:D,isValue:M}=ve(n,{value:e,options:s}),N=!!d,P={label:d,...b,wrapperWidth:"auto",isActive:N,isErrorTooltip:!0},q={...R,size:l},_=o.jsxRuntimeExports.jsx(t.Icon,{iconName:`Close${l==="Small"?"Sm":"Ant"}`,onClick:X=>{X.stopPropagation(),W(e)}}),J=o.jsxRuntimeExports.jsx(t.Icon,{iconName:`ExpandLess${l==="Small"?"Sm":"Ant"}`}),ae=o.jsxRuntimeExports.jsx(t.Icon,{iconName:`ExpandMore${l==="Small"?"Sm":"Ant"}`});return o.jsxRuntimeExports.jsxs(Ce,{ref:g,width:x,size:l,disabled:h,readonly:f,children:[c&&o.jsxRuntimeExports.jsxs(Be,{children:[o.jsxRuntimeExports.jsxs(Ne,{"data-testid":"label",ref:O,children:[c,C&&!h?o.jsxRuntimeExports.jsx(Ie,{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,{...P,children:o.jsxRuntimeExports.jsxs(Re,{hasError:N,readonly:f,ref:r,onBlur:()=>{setTimeout(()=>{(L||$)&&S.current!==document.activeElement&&(E&&E(e),T(!1),y(!1))},250)},onClick:()=>{!h&&!f&&(L&&!$?(y(!0),S!=null&&S.current&&S.current.focus()):!L&&!$?(T(!0),y(!0),S!=null&&S.current&&S.current.focus()):(T(!1),y(!1),S!=null&&S.current&&S.current.blur()),!I&&B(s))},tabIndex:0,width:x,size:l,isOpen:L||$,"data-testid":"select",disabled:h,helpText:p,variant:w,children:[o.jsxRuntimeExports.jsxs(ke,{children:[F.valuable(v)?o.jsxRuntimeExports.jsx(oe,{size:l,variant:w,isDisplayText:!0,children:o.jsxRuntimeExports.jsx("p",{title:e==null?void 0:e.label,...k,children:v})}):o.jsxRuntimeExports.jsxs(oe,{size:l,variant:w,children:[i&&M(e)&&!I&&!L?o.jsxRuntimeExports.jsx(Ee,{size:l,variant:w,children:i}):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})]}),a&&!F.valuable(v)&&o.jsxRuntimeExports.jsx(ze,{ref:S,value:I,onChange:X=>{A(X.target.value),X.target.value.length>0&&(T(!0),y(!0)),D(X.target.value)},readOnly:f,width:I.length,size:l,disabled:h,variant:w})]}),W&&e?_:null,$?J:ae,$&&o.jsxRuntimeExports.jsx(V,{onEnter:X=>{n&&n(X),T(!1),y(!1),m&&m(X)},menuIsOpen:L,selectContainerRef:g,value:e,optionsSelect:j,selectOption:z,size:l,inputValue:I,maxHeightMenu:H})]})}),p&&o.jsxRuntimeExports.jsx(We,{size:l,children:p})]})});K.displayName="Select";const se=o.We`
|
|
261
261
|
from {
|
|
262
262
|
transform: rotate(0deg);
|
|
263
263
|
}
|
|
264
264
|
to {
|
|
265
265
|
transform: rotate(360deg);
|
|
266
266
|
}
|
|
267
|
-
`,
|
|
267
|
+
`,Ae=o.qe.button`
|
|
268
268
|
display: flex;
|
|
269
269
|
justify-content: space-between;
|
|
270
270
|
align-items: center;
|
|
@@ -333,14 +333,14 @@
|
|
|
333
333
|
height: ${({size:e})=>e==="Small"?t.sg.icons.iconSizeSm:t.sg.icons.iconSizeAnt};
|
|
334
334
|
|
|
335
335
|
${({isLoading:e})=>e&&o.Ae`
|
|
336
|
-
animation: ${
|
|
336
|
+
animation: ${se} 2s linear infinite;
|
|
337
337
|
`}
|
|
338
338
|
|
|
339
339
|
path {
|
|
340
340
|
fill: ${({variant:e,disabled:n})=>n?t.sg.colors.neutralColors.colorNeutralCloudy:e==="primary"?t.sg.colors.backgroundColors.colorBackgroundSnow:t.sg.colors.neutralColors.colorNeutralDark};
|
|
341
341
|
}
|
|
342
342
|
}
|
|
343
|
-
`,
|
|
343
|
+
`,Me=o.qe.div`
|
|
344
344
|
display: flex;
|
|
345
345
|
flex-direction: column;
|
|
346
346
|
width: ${({width:e})=>e};
|
|
@@ -348,7 +348,7 @@
|
|
|
348
348
|
&:hover {
|
|
349
349
|
cursor: ${({disabled:e})=>e&&"not-allowed"};
|
|
350
350
|
}
|
|
351
|
-
`,
|
|
351
|
+
`,He=o.qe.label`
|
|
352
352
|
font-size: ${t.sg.fonts.fontSize.fontSizeBodyMd};
|
|
353
353
|
font-weight: ${t.sg.fonts.fontWeight.fontWeightRegular};
|
|
354
354
|
font-family: ${t.sg.fonts.fontFamily.fontFamilyPrimary};
|
|
@@ -362,14 +362,14 @@
|
|
|
362
362
|
color: ${t.sg.colors.feedbackColors.colorFeedbackError};
|
|
363
363
|
margin-top: ${t.sg.spacings.spacingInline.spacingInlineNano};
|
|
364
364
|
width: 100%;
|
|
365
|
-
`;const
|
|
365
|
+
`;const Fe=o.qe.div`
|
|
366
366
|
width: 100%;
|
|
367
367
|
|
|
368
368
|
& > svg {
|
|
369
369
|
min-width: ${({size:e})=>e==="Small"?t.sg.icons.iconSizeSm:t.sg.icons.iconSizeAnt};
|
|
370
370
|
height: ${({size:e})=>e==="Small"?t.sg.icons.iconSizeSm:t.sg.icons.iconSizeAnt};
|
|
371
371
|
|
|
372
|
-
animation: ${
|
|
372
|
+
animation: ${se} 2s linear infinite;
|
|
373
373
|
|
|
374
374
|
path {
|
|
375
375
|
fill: ${({variant:e,disabled:n})=>n?t.sg.colors.neutralColors.colorNeutralCloudy:e==="primary"?t.sg.colors.backgroundColors.colorBackgroundSnow:t.sg.colors.neutralColors.colorNeutralDark};
|
|
@@ -379,7 +379,7 @@
|
|
|
379
379
|
&:hover {
|
|
380
380
|
cursor: not-allowed;
|
|
381
381
|
}
|
|
382
|
-
`,
|
|
382
|
+
`,Le=e=>{const[n,s]=u.useState(!1),[a,i]=u.useState(e),c=u.useRef(null);return u.useEffect(()=>{i(e)},[e]),{setIsOpen:s,isOpen:n,setOptionsSelect:i,optionsSelect:a,selectContainerRef:c}},Te=200,qe=({name:e,variant:n="primary",width:s="100%",size:a="Medium",disabled:i=!1,isLoading:c=!1,onClick:l,options:x,label:h,menuSelectProps:p={},iconName:f,optionsIconPosition:d})=>{const{isOpen:b,setIsOpen:E,selectContainerRef:m,optionsSelect:w}=Le(x);let R=t.sg.colors.backgroundColors.colorBackgroundSnow;i?R=t.sg.colors.neutralColors.colorNeutralCloudy:n!=="primary"&&(R=t.sg.colors.neutralColors.colorNeutralDark);const H={...p};return o.jsxRuntimeExports.jsxs(Me,{ref:m,width:s,size:a,disabled:i,onBlur:()=>setTimeout(()=>E(!1),Te),children:[h&&o.jsxRuntimeExports.jsx(He,{children:h}),o.jsxRuntimeExports.jsxs(Ae,{type:"button",size:a,disabled:i,variant:n,isLoading:c,onClick:()=>!c&&E(!b),id:`button-component-${e}`,children:[c&&o.jsxRuntimeExports.jsx(Fe,{size:a,disabled:i,variant:n,children:o.jsxRuntimeExports.jsx(t.Icon,{iconName:`ProgressActivity${a==="Small"?"Ant":"Sm"}`,color:R,"data-testid":"icon-loading"})}),!c&&o.jsxRuntimeExports.jsx("p",{title:e,children:e}),!c&&(b?o.jsxRuntimeExports.jsx(t.Icon,{iconName:`ExpandLess${a==="Small"?"Ant":"Sm"}`,color:R,"data-testid":"icon-button-less"}):o.jsxRuntimeExports.jsx(t.Icon,{iconName:`ExpandMore${a==="Small"?"Ant":"Sm"}`,color:R,"data-testid":"icon-button-more"}))]}),b&&o.jsxRuntimeExports.jsx(V,{selectContainerRef:m,value:null,optionsSelect:w,selectOption:l,size:a,inputValue:null,iconPosition:d,iconName:f,...H})]})},De=o.qe.div`
|
|
383
383
|
min-width: ${({widthItems:e})=>e};
|
|
384
384
|
max-width: ${({widthItems:e})=>e};
|
|
385
385
|
height: 100%;
|
|
@@ -391,7 +391,7 @@
|
|
|
391
391
|
overflow: auto;
|
|
392
392
|
scroll-padding-top: 10px;
|
|
393
393
|
}
|
|
394
|
-
`,
|
|
394
|
+
`,Pe=o.qe.div`
|
|
395
395
|
width: 100%;
|
|
396
396
|
min-height: ${({heightItems:e})=>e};
|
|
397
397
|
max-height: ${({heightItems:e})=>e};
|
|
@@ -415,7 +415,7 @@
|
|
|
415
415
|
border-right: ${({selected:n})=>n?"none":`1px solid ${t.sg.colors.neutralColors.colorNeutralSoft}`};
|
|
416
416
|
`}
|
|
417
417
|
cursor: pointer;
|
|
418
|
-
`;const
|
|
418
|
+
`;const Oe=o.qe.div`
|
|
419
419
|
display: flex;
|
|
420
420
|
min-width: 0;
|
|
421
421
|
height: 100%;
|
|
@@ -427,13 +427,13 @@
|
|
|
427
427
|
height: 100%;
|
|
428
428
|
background-color: 'transparent';
|
|
429
429
|
overflow: hidden;
|
|
430
|
-
`;const
|
|
430
|
+
`;const Xe=o.qe.div`
|
|
431
431
|
flex: 1;
|
|
432
432
|
width: 100%;
|
|
433
433
|
background-color: 'transparent';
|
|
434
434
|
border-right: 1px solid ${t.sg.colors.neutralColors.colorNeutralSoft};
|
|
435
435
|
overflow: hidden;
|
|
436
|
-
`,
|
|
436
|
+
`,_e=({width:e="100%",height:n="fit-content",flex:s,backgroundColor:a="white",options:i=[],heightItems:c="60px",widthItems:l="155px",emptyProps:x={title:"Nenhum dado a ser mostrado",body:null},customWrapperStyles:h={},customItemStyles:p={}})=>{const[f,d]=u.useState(i[0]||null),b=u.useRef(null),E=u.useRef(null);return u.useEffect(()=>{const m=b.current,w=E.current,R=()=>{m&&w&&(w.scrollTop=m.scrollTop)};return m==null||m.addEventListener("scroll",R),()=>{m==null||m.removeEventListener("scroll",R)}},[]),u.useEffect(()=>{d(i[(i==null?void 0:i.length)-1]||null)},[i==null?void 0:i.length]),(i==null?void 0:i.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:s,backgroundColor:a,direction:"horizontal",customStyles:{border:`1px solid ${t.sg.colors.neutralColors.colorNeutralSoft}`,borderRadius:t.sg.borders.borderRadius.borderRadiusSm,...h},children:[o.jsxRuntimeExports.jsxs(De,{ref:b,widthItems:l,children:[i==null?void 0:i.map((m,w)=>o.jsxRuntimeExports.jsx(Pe,{selected:(f==null?void 0:f.key)===m.key,onClick:()=>d(m),withBorderRight:!0,heightItems:c,customStyles:p,children:m.item},w)),o.jsxRuntimeExports.jsx(Xe,{})]}),o.jsxRuntimeExports.jsx(Oe,{children:f&&(f==null?void 0:f.contentItem)})]})},ie=o.Ae`
|
|
437
437
|
svg:not([color]):not([data-testid='icon']) {
|
|
438
438
|
path {
|
|
439
439
|
fill: ${t.sg.colors.neutralColors.colorNeutralDarkest};
|
|
@@ -445,7 +445,7 @@
|
|
|
445
445
|
fill: ${t.sg.colors.neutralColors.colorNeutralDarkest};
|
|
446
446
|
}
|
|
447
447
|
}
|
|
448
|
-
`,
|
|
448
|
+
`,Ue=o.qe.div`
|
|
449
449
|
width: 100%;
|
|
450
450
|
max-height: ${({maxHeight:e})=>e};
|
|
451
451
|
overflow: auto;
|
|
@@ -467,11 +467,11 @@
|
|
|
467
467
|
background: ${t.sg.colors.neutralColors.colorNeutralClean};
|
|
468
468
|
border-radius: ${t.sg.borders.borderRadius.borderRadiusPill};
|
|
469
469
|
}
|
|
470
|
-
`,
|
|
470
|
+
`,Ge=o.qe.table`
|
|
471
471
|
border-collapse: separate;
|
|
472
472
|
border-spacing: 0;
|
|
473
473
|
width: 100%;
|
|
474
|
-
`,
|
|
474
|
+
`,Ve=`${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
475
|
${({isHeader:e,size:n})=>e&&o.Ae`
|
|
476
476
|
position: sticky;
|
|
477
477
|
background-color: ${t.sg.colors.backgroundColors.colorBackgroundSnow};
|
|
@@ -490,11 +490,11 @@
|
|
|
490
490
|
height: ${({fit:e,size:n})=>e?"fit-content":n==="Large"?"4rem":"3.2rem"};
|
|
491
491
|
min-height: ${({size:e})=>e==="Large"?"4rem":"3.2rem"};
|
|
492
492
|
|
|
493
|
-
${({isHeader:e,isSelected:n,striped:
|
|
494
|
-
background-color: ${n?t.sg.colors.neutralColors.colorNeutralClean:
|
|
493
|
+
${({isHeader:e,isSelected:n,striped:s})=>!e&&o.Ae`
|
|
494
|
+
background-color: ${n?t.sg.colors.neutralColors.colorNeutralClean:s?"#F5F9FE":t.sg.colors.backgroundColors.colorBackgroundSnow};
|
|
495
495
|
`}
|
|
496
496
|
|
|
497
|
-
border-radius: ${({isFirst:e,isLast:n,isHeader:
|
|
497
|
+
border-radius: ${({isFirst:e,isLast:n,isHeader:s,borderRadius:a})=>{if(e&&!s)return a?`${a} ${a} 0 0`:Ve;if(n)return a?`0 0 ${a} ${a}`:Je}};
|
|
498
498
|
transition: background-color 0.2s 0s;
|
|
499
499
|
|
|
500
500
|
&:hover {
|
|
@@ -512,10 +512,10 @@
|
|
|
512
512
|
/* Target direct SVGs without color (sbwb-icons), but exclude sbwb-ds Icons ([data-testid='icon'])
|
|
513
513
|
* This is because sbwb-ds Icons have a color prop on the wrapper, not the SVG
|
|
514
514
|
*/
|
|
515
|
-
${
|
|
515
|
+
${ie}
|
|
516
516
|
}
|
|
517
517
|
`}
|
|
518
|
-
`,
|
|
518
|
+
`,le=({width:e})=>{if(F.valuable(e))return o.Ae`
|
|
519
519
|
width: ${e};
|
|
520
520
|
`},G=o.qe.th`
|
|
521
521
|
text-align: ${({horizontalAlign:e,headerAlign:n})=>e??n??"left"};
|
|
@@ -523,7 +523,7 @@
|
|
|
523
523
|
min-width: ${({minWidth:e})=>e||"auto"};
|
|
524
524
|
max-width: ${({maxWidth:e})=>e};
|
|
525
525
|
|
|
526
|
-
${
|
|
526
|
+
${le}
|
|
527
527
|
|
|
528
528
|
height: ${({size:e})=>e==="Large"?"4rem":"3.2rem"};
|
|
529
529
|
background-color: ${t.sg.colors.backgroundColors.colorBackgroundSky};
|
|
@@ -561,13 +561,13 @@
|
|
|
561
561
|
&:hover {
|
|
562
562
|
cursor: default;
|
|
563
563
|
}
|
|
564
|
-
`,
|
|
564
|
+
`,Ye=o.qe.td`
|
|
565
565
|
text-align: ${({horizontalAlign:e})=>e||"left"};
|
|
566
566
|
vertical-align: ${({verticalAlign:e})=>e||"middle"};
|
|
567
567
|
|
|
568
568
|
min-width: ${({minWidth:e})=>e||"auto"};
|
|
569
569
|
max-width: ${({maxWidth:e})=>e};
|
|
570
|
-
${
|
|
570
|
+
${le}
|
|
571
571
|
|
|
572
572
|
padding: ${({rowPadding:e})=>e??`${t.sg.spacings.spacingInline.spacingInlineXs}`};
|
|
573
573
|
|
|
@@ -588,9 +588,9 @@
|
|
|
588
588
|
border-right: none;
|
|
589
589
|
}
|
|
590
590
|
|
|
591
|
-
${
|
|
591
|
+
${ie}
|
|
592
592
|
|
|
593
593
|
&:hover {
|
|
594
594
|
cursor: ${e=>e.isClickable?"pointer":"default"};
|
|
595
595
|
}
|
|
596
|
-
`;function
|
|
596
|
+
`;function Qe(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 Ze({id:e,rowKey:n="id",size:s="Small",onRowClick:a,fit:i=!1,maxHeight:c="40rem",columns:l,dataSource:x,columnsTextSize:h=s,emptyProps:p={width:"100%",height:"100%",title:"Nenhum dado a ser mostrado.",mode:"table",borders:!0,backgroundColor:t.sg.colors.backgroundColors.colorBackgroundSnow},selectedRow:f=!1,hideHeader:d=!1,withBorder:b=!0,withBorderRadius:E=!0,striped:m=!1,borderRadius:w=t.sg.borders.borderRadius.borderRadiusSm}){const R=u.useMemo(()=>Qe(n),[n]),[H,C]=u.useState(null),W=u.useRef(null),v=u.useRef(null),[k,O]=u.useState(l);u.useLayoutEffect(()=>{if(!v.current||l.length===0){O(l);return}const $=()=>{var D;const I=((D=v.current)==null?void 0:D.clientWidth)||0;if(I===0)return;let A=0,j=0;const g=[],r=[];l.forEach(M=>{const N=Number(M.flex);M.width?A+=parseInt(M.width,10)||0:M.flex&&N>0?(j+=N,g.push(M)):r.push(M)});const S=I-A,z="80";let B=[...l];if(S>0){if(g.length>0){const M=S/j;B=l.map(N=>{const P=Number(N.flex);if(P&&P>0){const q=parseInt(N.minWidth||z,10),_=P*M,J=Math.max(_,q);return{...N,width:`${Math.floor(J)}px`}}return!N.width&&!P?{...N,width:N.minWidth||`${z}px`}:N})}else if(r.length>0){const M=S/r.length;B=l.map(N=>{const P=Number(N.flex);if(!N.width&&!P){const q=parseInt(N.minWidth||z,10),_=Math.max(M,q);return{...N,width:`${Math.floor(_)}px`}}return N})}}else B=l.map(M=>M.width?M:{...M,width:M.minWidth||`${z}px`});O(B)};$();const y=new ResizeObserver($);return y.observe(v.current),()=>y.disconnect()},[l]),u.useEffect(()=>{const $=y=>{W.current&&!W.current.contains(y.target)&&C(null)};return document.addEventListener("mousedown",$),()=>{document.removeEventListener("mousedown",$)}},[]);const L=u.useMemo(()=>k?k.some($=>$.mergeHeaderId&&$.mergeHeaderLabel):!1,[k]),T=u.useMemo(()=>{var A,j;if(d||!k||k.length===0)return null;if(!L)return o.jsxRuntimeExports.jsx(U,{isHeader:!0,size:s,numRows:1,borderRadius:w,children:k.map(g=>{var r;return o.jsxRuntimeExports.jsx(G,{width:g.width,minWidth:g.minWidth,maxWidth:g.maxWidth,horizontalAlign:g.horizontalAlign,size:s,columnsTextSize:h,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 $=[],y=[];let I=0;for(;I<k.length;){const g=k[I];if(g.mergeHeaderId&&g.mergeHeaderLabel){let r=0;const S=g.mergeHeaderId;for(let z=I;z<k.length&&k[z].mergeHeaderId===S;z++)r++;$.push(o.jsxRuntimeExports.jsx(G,{colSpan:r,horizontalAlign:"center",size:s,columnsTextSize:h,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=k[I+z];y.push(o.jsxRuntimeExports.jsx(G,{width:B.width,minWidth:B.minWidth,maxWidth:B.maxWidth,horizontalAlign:B.horizontalAlign,size:s,columnsTextSize:h,withBorder:b,headerAlign:g.headerAlign,children:((A=B.columnRender)==null?void 0:A.call(B,x))||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:s,columnsTextSize:h,withBorder:b,headerAlign:g.headerAlign,isTopRow:!0,children:((j=g.columnRender)==null?void 0:j.call(g,x))||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:s,numRows:2,borderRadius:w,children:$}),y.length>0&&o.jsxRuntimeExports.jsx(U,{isHeader:!0,size:s,numRows:2,borderRadius:w,children:y})]})},[k,d,s,h,L]);return!x||x.length===0?o.jsxRuntimeExports.jsx(o.Empty,{backgroundColor:t.sg.colors.backgroundColors.colorBackgroundSnow,borders:!0,mode:"table",...p}):o.jsxRuntimeExports.jsx(Ue,{maxHeight:c,withBorderRadius:E,ref:v,borderRadius:w,children:o.jsxRuntimeExports.jsxs(Ge,{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(($,y,I)=>{const A=R($);return o.jsxRuntimeExports.jsx(U,{isLast:y===I.length-1,fit:i,size:s,withBorder:b,isSelected:A===H&&f,striped:m&&y%2!==0,borderRadius:w,children:k.map(j=>{var g,r,S;return o.jsxRuntimeExports.jsx(Ye,{width:j.width,minWidth:j.minWidth,maxWidth:j.maxWidth,size:s,isClickable:F.valuable(a),onClick:()=>{a&&a($,j,y),f&&C(H===A?null:A)},horizontalAlign:j.horizontalAlign,verticalAlign:j.verticalAlign,rowPadding:j.rowPadding,withBorder:b,isLast:y===I.length-1,backgroundColor:(g=j.paint)==null?void 0:g.call(j,$[j.dataIndex],$,y,I),children:((r=j.render)==null?void 0:r.call(j,$[j.dataIndex],$,y,I))||o.jsxRuntimeExports.jsx("span",{title:$[j.dataIndex],style:{textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden",...(S=j.rowCss)==null?void 0:S.call(j,$)},children:$[j.dataIndex]})||""},`${A}::${j.dataIndex}`)})},A)})})]})})}exports.CheckboxField=he;exports.CollapseSection=ce;exports.MenuSelect=V;exports.Section=re;exports.Select=K;exports.SelectButton=qe;exports.SelectField=fe;exports.TabInfo=_e;exports.Table=Ze;exports.TextareaField=ne;
|