@s_mart/form 3.5.0 → 3.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";var y2=Object.create;var g1=Object.defineProperty,g2=Object.defineProperties,x2=Object.getOwnPropertyDescriptor,b2=Object.getOwnPropertyDescriptors,L2=Object.getOwnPropertyNames,w1=Object.getOwnPropertySymbols,F2=Object.getPrototypeOf,X1=Object.prototype.hasOwnProperty,p0=Object.prototype.propertyIsEnumerable;var v0=(e,c,o)=>c in e?g1(e,c,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[c]=o,a=(e,c)=>{for(var o in c||(c={}))X1.call(c,o)&&v0(e,o,c[o]);if(w1)for(var o of w1(c))p0.call(c,o)&&v0(e,o,c[o]);return e},m=(e,c)=>g2(e,b2(c));var $=(e,c)=>{var o={};for(var s in e)X1.call(e,s)&&c.indexOf(s)<0&&(o[s]=e[s]);if(e!=null&&w1)for(var s of w1(e))c.indexOf(s)<0&&p0.call(e,s)&&(o[s]=e[s]);return o};var Z0=(e,c)=>()=>(c||e((c={exports:{}}).exports,c),c.exports),P2=(e,c)=>{for(var o in c)g1(e,o,{get:c[o],enumerable:!0})},u0=(e,c,o,s)=>{if(c&&typeof c=="object"||typeof c=="function")for(let r of L2(c))!X1.call(e,r)&&r!==o&&g1(e,r,{get:()=>c[r],enumerable:!(s=x2(c,r))||s.enumerable});return e};var p1=(e,c,o)=>(o=e!=null?y2(F2(e)):{},u0(c||!e||!e.__esModule?g1(o,"default",{value:e,enumerable:!0}):o,e)),C2=e=>u0(g1({},"__esModule",{value:!0}),e);var Y0=Z0((n0,s0)=>{(function(e,c){typeof n0=="object"&&typeof s0!="undefined"?s0.exports=c():typeof define=="function"&&define.amd?define(c):(e=typeof globalThis!="undefined"?globalThis:e||self).dayjs=c()})(n0,function(){"use strict";var e=1e3,c=6e4,o=36e5,s="millisecond",r="second",M="minute",p="hour",b="day",P="week",u="month",S="quarter",f="year",F="date",A="Invalid Date",k=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,q=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,D={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(h){var i=["th","st","nd","rd"],l=h%100;return"["+h+(i[(l-20)%10]||i[l]||i[0])+"]"}},T=function(h,i,l){var V=String(h);return!V||V.length>=i?h:""+Array(i+1-V.length).join(l)+h},w={s:T,z:function(h){var i=-h.utcOffset(),l=Math.abs(i),V=Math.floor(l/60),t=l%60;return(i<=0?"+":"-")+T(V,2,"0")+":"+T(t,2,"0")},m:function h(i,l){if(i.date()<l.date())return-h(l,i);var V=12*(l.year()-i.year())+(l.month()-i.month()),t=i.clone().add(V,u),g=l-t<0,n=i.clone().add(V+(g?-1:1),u);return+(-(V+(l-t)/(g?t-n:n-t))||0)},a:function(h){return h<0?Math.ceil(h)||0:Math.floor(h)},p:function(h){return{M:u,y:f,w:P,d:b,D:F,h:p,m:M,s:r,ms:s,Q:S}[h]||String(h||"").toLowerCase().replace(/s$/,"")},u:function(h){return h===void 0}},H="en",x={};x[H]=D;var I=function(h){return h instanceof Z},E=function h(i,l,V){var t;if(!i)return H;if(typeof i=="string"){var g=i.toLowerCase();x[g]&&(t=g),l&&(x[g]=l,t=g);var n=i.split("-");if(!t&&n.length>1)return h(n[0])}else{var d=i.name;x[d]=i,t=d}return!V&&t&&(H=t),t||!V&&H},_=function(h,i){if(I(h))return h.clone();var l=typeof i=="object"?i:{};return l.date=h,l.args=arguments,new Z(l)},v=w;v.l=E,v.i=I,v.w=function(h,i){return _(h,{locale:i.$L,utc:i.$u,x:i.$x,$offset:i.$offset})};var Z=function(){function h(l){this.$L=E(l.locale,null,!0),this.parse(l)}var i=h.prototype;return i.parse=function(l){this.$d=function(V){var t=V.date,g=V.utc;if(t===null)return new Date(NaN);if(v.u(t))return new Date;if(t instanceof Date)return new Date(t);if(typeof t=="string"&&!/Z$/i.test(t)){var n=t.match(k);if(n){var d=n[2]-1||0,G=(n[7]||"0").substring(0,3);return g?new Date(Date.UTC(n[1],d,n[3]||1,n[4]||0,n[5]||0,n[6]||0,G)):new Date(n[1],d,n[3]||1,n[4]||0,n[5]||0,n[6]||0,G)}}return new Date(t)}(l),this.$x=l.x||{},this.init()},i.init=function(){var l=this.$d;this.$y=l.getFullYear(),this.$M=l.getMonth(),this.$D=l.getDate(),this.$W=l.getDay(),this.$H=l.getHours(),this.$m=l.getMinutes(),this.$s=l.getSeconds(),this.$ms=l.getMilliseconds()},i.$utils=function(){return v},i.isValid=function(){return this.$d.toString()!==A},i.isSame=function(l,V){var t=_(l);return this.startOf(V)<=t&&t<=this.endOf(V)},i.isAfter=function(l,V){return _(l)<this.startOf(V)},i.isBefore=function(l,V){return this.endOf(V)<_(l)},i.$g=function(l,V,t){return v.u(l)?this[V]:this.set(t,l)},i.unix=function(){return Math.floor(this.valueOf()/1e3)},i.valueOf=function(){return this.$d.getTime()},i.startOf=function(l,V){var t=this,g=!!v.u(V)||V,n=v.p(l),d=function(v1,W){var o1=v.w(t.$u?Date.UTC(t.$y,W,v1):new Date(t.$y,W,v1),t);return g?o1:o1.endOf(b)},G=function(v1,W){return v.w(t.toDate()[v1].apply(t.toDate("s"),(g?[0,0,0,0]:[23,59,59,999]).slice(W)),t)},R=this.$W,Y=this.$M,a1=this.$D,i1="set"+(this.$u?"UTC":"");switch(n){case f:return g?d(1,0):d(31,11);case u:return g?d(1,Y):d(0,Y+1);case P:var V1=this.$locale().weekStart||0,y1=(R<V1?R+7:R)-V1;return d(g?a1-y1:a1+(6-y1),Y);case b:case F:return G(i1+"Hours",0);case p:return G(i1+"Minutes",1);case M:return G(i1+"Seconds",2);case r:return G(i1+"Milliseconds",3);default:return this.clone()}},i.endOf=function(l){return this.startOf(l,!1)},i.$set=function(l,V){var t,g=v.p(l),n="set"+(this.$u?"UTC":""),d=(t={},t[b]=n+"Date",t[F]=n+"Date",t[u]=n+"Month",t[f]=n+"FullYear",t[p]=n+"Hours",t[M]=n+"Minutes",t[r]=n+"Seconds",t[s]=n+"Milliseconds",t)[g],G=g===b?this.$D+(V-this.$W):V;if(g===u||g===f){var R=this.clone().set(F,1);R.$d[d](G),R.init(),this.$d=R.set(F,Math.min(this.$D,R.daysInMonth())).$d}else d&&this.$d[d](G);return this.init(),this},i.set=function(l,V){return this.clone().$set(l,V)},i.get=function(l){return this[v.p(l)]()},i.add=function(l,V){var t,g=this;l=Number(l);var n=v.p(V),d=function(Y){var a1=_(g);return v.w(a1.date(a1.date()+Math.round(Y*l)),g)};if(n===u)return this.set(u,this.$M+l);if(n===f)return this.set(f,this.$y+l);if(n===b)return d(1);if(n===P)return d(7);var G=(t={},t[M]=c,t[p]=o,t[r]=e,t)[n]||1,R=this.$d.getTime()+l*G;return v.w(R,this)},i.subtract=function(l,V){return this.add(-1*l,V)},i.format=function(l){var V=this,t=this.$locale();if(!this.isValid())return t.invalidDate||A;var g=l||"YYYY-MM-DDTHH:mm:ssZ",n=v.z(this),d=this.$H,G=this.$m,R=this.$M,Y=t.weekdays,a1=t.months,i1=function(W,o1,Q1,S1){return W&&(W[o1]||W(V,g))||Q1[o1].slice(0,S1)},V1=function(W){return v.s(d%12||12,W,"0")},y1=t.meridiem||function(W,o1,Q1){var S1=W<12?"AM":"PM";return Q1?S1.toLowerCase():S1},v1={YY:String(this.$y).slice(-2),YYYY:this.$y,M:R+1,MM:v.s(R+1,2,"0"),MMM:i1(t.monthsShort,R,a1,3),MMMM:i1(a1,R),D:this.$D,DD:v.s(this.$D,2,"0"),d:String(this.$W),dd:i1(t.weekdaysMin,this.$W,Y,2),ddd:i1(t.weekdaysShort,this.$W,Y,3),dddd:Y[this.$W],H:String(d),HH:v.s(d,2,"0"),h:V1(1),hh:V1(2),a:y1(d,G,!0),A:y1(d,G,!1),m:String(G),mm:v.s(G,2,"0"),s:String(this.$s),ss:v.s(this.$s,2,"0"),SSS:v.s(this.$ms,3,"0"),Z:n};return g.replace(q,function(W,o1){return o1||v1[W]||n.replace(":","")})},i.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},i.diff=function(l,V,t){var g,n=v.p(V),d=_(l),G=(d.utcOffset()-this.utcOffset())*c,R=this-d,Y=v.m(this,d);return Y=(g={},g[f]=Y/12,g[u]=Y,g[S]=Y/3,g[P]=(R-G)/6048e5,g[b]=(R-G)/864e5,g[p]=R/o,g[M]=R/c,g[r]=R/e,g)[n]||R,t?Y:v.a(Y)},i.daysInMonth=function(){return this.endOf(u).$D},i.$locale=function(){return x[this.$L]},i.locale=function(l,V){if(!l)return this.$L;var t=this.clone(),g=E(l,V,!0);return g&&(t.$L=g),t},i.clone=function(){return v.w(this.$d,this)},i.toDate=function(){return new Date(this.valueOf())},i.toJSON=function(){return this.isValid()?this.toISOString():null},i.toISOString=function(){return this.$d.toISOString()},i.toString=function(){return this.$d.toUTCString()},h}(),y=Z.prototype;return _.prototype=y,[["$ms",s],["$s",r],["$m",M],["$H",p],["$W",b],["$M",u],["$y",f],["$D",F]].forEach(function(h){y[h[1]]=function(i){return this.$g(i,h[0],h[1])}}),_.extend=function(h,i){return h.$i||(h(i,Z,_),h.$i=!0),_},_.locale=E,_.isDayjs=I,_.unix=function(h){return _(1e3*h)},_.en=x[H],_.Ls=x,_.p={},_})});var m0=Z0((h0,d0)=>{(function(e,c){typeof h0=="object"&&typeof d0!="undefined"?d0.exports=c(Y0()):typeof define=="function"&&define.amd?define(["dayjs"],c):(e=typeof globalThis!="undefined"?globalThis:e||self).dayjs_locale_pt_br=c(e.dayjs)})(h0,function(e){"use strict";function c(r){return r&&typeof r=="object"&&"default"in r?r:{default:r}}var o=c(e),s={name:"pt-br",weekdays:"domingo_segunda-feira_ter\xE7a-feira_quarta-feira_quinta-feira_sexta-feira_s\xE1bado".split("_"),weekdaysShort:"dom_seg_ter_qua_qui_sex_s\xE1b".split("_"),weekdaysMin:"Do_2\xAA_3\xAA_4\xAA_5\xAA_6\xAA_S\xE1".split("_"),months:"janeiro_fevereiro_mar\xE7o_abril_maio_junho_julho_agosto_setembro_outubro_novembro_dezembro".split("_"),monthsShort:"jan_fev_mar_abr_mai_jun_jul_ago_set_out_nov_dez".split("_"),ordinal:function(r){return r+"\xBA"},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY [\xE0s] HH:mm",LLLL:"dddd, D [de] MMMM [de] YYYY [\xE0s] HH:mm"},relativeTime:{future:"em %s",past:"h\xE1 %s",s:"poucos segundos",m:"um minuto",mm:"%d minutos",h:"uma hora",hh:"%d horas",d:"um dia",dd:"%d dias",M:"um m\xEAs",MM:"%d meses",y:"um ano",yy:"%d anos"}};return o.default.locale(s,null,!0),s})});var W2={};P2(W2,{Autocomplete:()=>H2,Checkbox:()=>G0,Creatable:()=>E0,DatePicker:()=>l2,Form:()=>y0,FormProvider:()=>$1,RadioButton:()=>R0,RadioGroup:()=>O0,Searchable:()=>A0,Select:()=>w0,Slider:()=>q0,Switch:()=>B0,TextField:()=>S0,TimePicker:()=>u2,useForm:()=>A1});module.exports=C2(W2);var f0=require("react-hook-form");var e0=require("react/jsx-runtime"),k2=r=>{var M=r,{children:e,style:c,onSubmit:o}=M,s=$(M,["children","style","onSubmit"]);return(0,e0.jsx)(f0.FormProvider,m(a({},s),{children:(0,e0.jsx)("form",{onSubmit:p=>{p.preventDefault(),p.stopPropagation(),o(p)},style:c,children:e})}))},$1=k2;var M0=require("react"),H0=require("react-hook-form"),V0=require("@hookform/resolvers/zod");var S2=s=>{var r=s,{disableDefaultValuesUpdate:e,onSubmit:c}=r,o=$(r,["disableDefaultValuesUpdate","onSubmit"]);let M=(0,H0.useForm)(m(a({},o),{resolver:o.schema&&(0,V0.zodResolver)(o.schema)}));return(0,M0.useEffect)(()=>{e||M.reset(o.defaultValues)},[o.defaultValues,M.reset]),m(a({},M),{onSubmit:M.handleSubmit(p=>c(p,M))})},A1=S2;var g0=require("react/jsx-runtime");function w2(s){var r=s,{children:e,style:c}=r,o=$(r,["children","style"]);let M=A1(o);return(0,g0.jsx)($1,m(a({},M),{style:c,children:typeof e=="function"?e(M):e}))}var y0=w2;var T1=require("react"),D1=require("react-hook-form"),t1=require("@mui/material");var x0={description:"M39 23.1a17 17 0 0 0-15-10c-6.5.1-12.4 4-15.2 10V25a17 17 0 0 0 15 10A17 17 0 0 0 39 25c.5-.7.5-1.3.2-1.8Zm-15 9a8 8 0 0 1-7.6-8.5c.2-4.2 3.5-7.8 7.6-7.8a8 8 0 0 1 7.6 8.4c-.1 4.3-3.5 7.9-7.6 7.9Zm0-13.5-1.3.1c.7 1.1.6 2.6-.3 3.7-1 .9-2.3.9-3.4.1-.4 2.2.3 4.7 2.1 6a4.9 4.9 0 0 0 6-.2c1.6-1.4 2.4-4 1.6-6.1a4.9 4.9 0 0 0-4.7-3.6Z",id:"line-eye-solid"},b0={description:"M24 31.7c-4 0-7.4-3.1-7.7-7.1l-5.6-4.4c-.8 1-1.4 2-2 3a1.7 1.7 0 0 0 0 1.6 17.2 17.2 0 0 0 19.5 9l-2.8-2.2-1.4.1ZM40.9 35l-6-4.6c1.8-1.5 3.3-3.4 4.4-5.5a1.7 1.7 0 0 0 0-1.6c-3-5.7-8.7-9.5-15.3-9.5-2.8 0-5.5.7-8 2l-6.8-5.3a.9.9 0 0 0-1.2.2L7 12a.9.9 0 0 0 .1 1.2l31.7 24.5a.9.9 0 0 0 1.2-.2l1-1.3a.9.9 0 0 0-.1-1.2Zm-10-7.7-2-1.6a5 5 0 0 0-6.3-6.6 2.5 2.5 0 0 1 .4 2l-3.9-3a7.7 7.7 0 0 1 10.4.5 7.7 7.7 0 0 1 1.5 8.7Z",id:"line-eye-slash-solid"};var r1={description:"M24 8a16 16 0 0 0 0 32 16 16 0 0 0 0-32Zm0 7.1c1.5 0 2.7 1.2 2.7 2.7 0 1.6-1.2 2.7-2.7 2.7a2.6 2.6 0 0 1-2.7-2.7c0-1.5 1.2-2.7 2.7-2.7Zm3.6 16.4c0 .4-.4.8-.8.8h-5.6a.7.7 0 0 1-.8-.8v-1.6c0-.4.3-.7.8-.7h.7V25h-.7a.7.7 0 0 1-.8-.7v-1.6c0-.4.3-.8.8-.8h4c.5 0 .9.4.9.8v6.5h.7c.4 0 .8.3.8.7v1.6Z",id:"line-info-circle-solid"};var L0={description:"m25.5 17 5.5 5.5-12 12-4.9.5a1 1 0 0 1-1-1.1l.5-5L25.5 17Zm8.9-.8-2.6-2.6a2 2 0 0 0-2.9 0L26.5 16l5.5 5.5 2.4-2.4a2 2 0 0 0 0-3Z",id:"line-pen-solid"};var c0={description:"M35.8 21.8h-9.6v-9.6c0-.6-.6-1.1-1.1-1.1h-2.2a1 1 0 0 0-1 1v9.7h-9.7c-.6 0-1.1.6-1.1 1.1v2.2c0 .6.5 1 1 1h9.7v9.7c0 .6.5 1.1 1.1 1.1h2.2c.5 0 1-.5 1-1v-9.7h9.7c.6 0 1.1-.5 1.1-1.1v-2.2c0-.5-.5-1-1-1Z",id:"line-plus-solid"};var Z1=p1(require("@s_mart/masks"));var i0=require("@mui/material"),F0=require("@s_mart/utils"),x1=require("react/jsx-runtime"),O=({label:e,required:c,regular:o})=>(0,x1.jsxs)("span",{style:{display:"flex",alignItems:"center",gap:(0,F0.toRem)(2)},children:[(0,x1.jsx)(i0.Typography,{variant:"caption",fontWeight:o?400:700,style:{display:"flex",alignItems:"center"},children:e}),c&&(0,x1.jsx)(i0.Typography,{variant:"caption",fontWeight:900,color:"error",children:"*"})]});var P0=require("react-hook-form"),C0=require("@s_mart/core");var z=(e,c)=>{var o,s,r,M,p;if(e[c])return e[c];if(c.includes("[")){let[b,P]=c.split("["),[u,S]=P.split("].");return(s=(o=e[b])==null?void 0:o[u])==null?void 0:s[S]}if(c.includes(".")){let[b,P,u]=c.split(".");return u?(p=(M=e[b])==null?void 0:M[P])==null?void 0:p[u]:(r=e[b])==null?void 0:r[P]}};var k0=require("react/jsx-runtime"),U=({name:e,disableIcon:c=!1})=>{var r;let o=(0,P0.useFormContext)(),s=z((r=o==null?void 0:o.formState)==null?void 0:r.errors,e);return s?(0,k0.jsx)(C0.Indicator,{severity:"error",icon:!c,children:s==null?void 0:s.message}):null};var b1=require("@s_mart/core");var j=require("react/jsx-runtime"),$2=q=>{var D=q,{name:e,rules:c,defaultValue:o,shouldUnregister:s,label:r,required:M,mask:p,variant:b="outlined",info:P,parse:u,inputMode:S,format:f,onInputChange:F,disableIconError:A}=D,k=$(D,["name","rules","defaultValue","shouldUnregister","label","required","mask","variant","info","parse","inputMode","format","onInputChange","disableIconError"]);let T=(0,D1.useFormContext)();if(!T)throw new Error("Para usar o <TextField /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let[w,H]=(0,T1.useState)(!1),x=v=>{var y;let Z=v;return f&&(Z=f(v)),p?(y=Z1==null?void 0:Z1[p])==null?void 0:y.format(Z):Z},I=v=>{var y;let Z=v;return u&&(Z=u(v)),p?(y=Z1==null?void 0:Z1[p])==null?void 0:y.parse(Z):Z},E=v=>{if(!v||p!=="porcentagem"&&p!=="porcentagem0")return;v==null||v.stopPropagation();let Z=(v==null?void 0:v.target).value;if(Z){let y=String(Z);if(y.length>0){let h=y.indexOf("%");h>-1&&(v.currentTarget.selectionEnd=h)}}},_=z(T.formState.errors,e);return(0,j.jsx)(D1.Controller,{control:T.control,name:e,rules:c,defaultValue:o,shouldUnregister:s,render:({field:{value:v,onChange:Z,ref:y}})=>(0,j.jsxs)(t1.Grid,{display:"flex",flexDirection:"column",children:[(0,j.jsxs)("div",{style:{display:"flex"},children:[r&&(0,j.jsx)(t1.Grid,{item:!0,children:(0,j.jsx)(O,{label:r,required:M})}),P&&(0,j.jsx)(t1.Grid,{item:!0,children:(0,j.jsx)(b1.Tooltip,{title:P,placement:"top",children:(0,j.jsx)("div",{style:{width:"fit-content"},children:(0,j.jsx)(b1.LIcon,{icon:r1,color:"#757575"})})})})]}),(0,j.jsx)(t1.TextField,m(a({variant:b,defaultValue:o,value:x(v||""),onChange:h=>{var l;let i=I((l=h==null?void 0:h.target)==null?void 0:l.value);Z(i),F==null||F(i,T.getValues())},error:!!_},k),{type:k.type==="password"?w?"text":"password":k.type,autoComplete:k.autoComplete||"off",inputProps:a({inputMode:S},k.inputProps),InputProps:a({onKeyDown:E,inputRef:y,endAdornment:k.type==="password"&&(0,j.jsx)(t1.InputAdornment,{position:"start",onClick:()=>H(!w),style:{cursor:"pointer"},children:(0,j.jsx)(b1.LIcon,{icon:w?x0:b0,size:"24px",removeMargin:!0})})},k.InputProps)}),e),(0,j.jsx)(U,{name:e,disableIcon:A})]})})},S0=(0,T1.memo)($2);var _1=require("react"),I1=require("react-hook-form"),u1=require("@s_mart/core"),N=require("@mui/material");var B=require("react/jsx-runtime"),A2=q=>{var D=q,{name:e,rules:c,defaultValue:o,shouldUnregister:s,label:r,required:M,options:p,placeholder:b,disableOnChangeForm:P=!1,multiple:u,info:S,footer:f,onChange:F,disableIconError:A}=D,k=$(D,["name","rules","defaultValue","shouldUnregister","label","required","options","placeholder","disableOnChangeForm","multiple","info","footer","onChange","disableIconError"]);let T=(0,I1.useFormContext)(),{palette:w}=(0,N.useTheme)(),[H,x]=(0,_1.useState)(!1);if(!T)throw new Error("Para usar o <Select /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let I=z(T.formState.errors,e);return console.warn=()=>{},(0,B.jsx)(I1.Controller,{control:T.control,name:e,rules:c,defaultValue:o,shouldUnregister:s,render:({field:{value:E,onChange:_,ref:v}})=>(0,B.jsxs)(N.Grid,{display:"flex",flexDirection:"column",children:[(0,B.jsxs)("div",{style:{display:"flex"},children:[r&&(0,B.jsx)(N.Grid,{item:!0,children:(0,B.jsx)(O,{label:r,required:M})}),S&&(0,B.jsx)(N.Grid,{item:!0,children:(0,B.jsx)(u1.Tooltip,{title:S,placement:"top",children:(0,B.jsx)("div",{style:{width:"fit-content"},children:(0,B.jsx)(u1.LIcon,{icon:r1,color:"#757575"})})})})]}),(0,B.jsxs)(N.Select,m(a({open:H,onOpen:()=>x(!0),onClose:()=>x(!1),displayEmpty:!!b,variant:"outlined",autoComplete:"off",value:E?E||"":u?[]:"",renderValue:Z=>{if(Z.label)return Z.label;if(b)return(0,B.jsx)("p",{style:{color:w.grey[400]},children:b})},multiple:u,onChange:Z=>{!P&&_(Z.target.value),F&&F(Z.target.value,T.getValues())},error:!!I,size:k.size||"medium",inputRef:v},k),{children:[b&&(0,B.jsx)(N.MenuItem,{disabled:!0,value:"",children:(0,B.jsx)("p",{style:{color:w.grey[400]},children:b})}),p==null?void 0:p.map((Z,y)=>(0,B.jsx)(N.MenuItem,{value:Z,children:(0,B.jsxs)(N.Grid,{container:!0,direction:"column",children:[(0,B.jsx)(N.Grid,{item:!0,children:Z.label}),Z.afterLabel&&(0,B.jsx)(N.Grid,{item:!0,children:Z.afterLabel})]})},y)),f&&[(0,B.jsx)(N.Grid,{px:2,py:1,children:(0,B.jsx)(u1.Divider,{})},"footer-divider"),(0,B.jsx)("div",{children:f({closeSelect:()=>x(!1)})},"footer-content")]]}),e),(0,B.jsx)(U,{name:e,disableIcon:A})]})})},w0=(0,_1.memo)(A2);var E1=require("react"),G1=require("react-hook-form"),J=require("@mui/material"),d1=require("@s_mart/core");var $0=require("@s_mart/tokens");var C=require("react/jsx-runtime"),l0=require("react"),T2=T=>{var w=T,{name:e,rules:c,defaultValue:o,shouldUnregister:s,label:r,required:M,options:p,textFieldProps:b,noOptionsText:P,footer:u,multiple:S,info:f,placeholder:F,onChange:A,onInputChange:k,disableIconError:q}=w,D=$(w,["name","rules","defaultValue","shouldUnregister","label","required","options","textFieldProps","noOptionsText","footer","multiple","info","placeholder","onChange","onInputChange","disableIconError"]);let H=(0,G1.useFormContext)();if(!H)throw new Error("Para usar o <Searchable /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let x=z(H.formState.errors,e);return console.warn=()=>{},(0,C.jsx)(G1.Controller,{control:H.control,name:e,rules:c,defaultValue:o,shouldUnregister:s,render:({field:{onChange:I,value:E,ref:_}})=>{var v;return(0,C.jsxs)(J.Grid,{display:"flex",flexDirection:"column",children:[(0,C.jsxs)("div",{style:{display:"flex"},children:[r&&(0,C.jsx)(J.Grid,{item:!0,children:(0,C.jsx)(O,{label:r,required:M})}),f&&(0,C.jsx)(J.Grid,{item:!0,children:(0,C.jsx)(d1.Tooltip,{title:f,placement:"top",children:(0,C.jsx)("div",{style:{width:"fit-content"},children:(0,C.jsx)(d1.LIcon,{icon:r1,color:"#757575"})})})})]}),(0,C.jsx)(J.Autocomplete,m(a({onChange:(Z,y)=>{I(y),A==null||A(y,H.getValues())},onInputChange:(Z,y,h)=>{h==="input"&&setTimeout(()=>{k==null||k(y,H.getValues())},0)},slotProps:m(a({},D.slotProps||{}),{paper:m(a({},(D.slotProps||{}).paper||{}),{sx:a({border:`1px solid ${$0.colorPalette.neutral[30]}`,boxShadow:"0px 2px 4px rgba(0, 0, 0, 0.15)"},((v=(D.slotProps||{}).paper)==null?void 0:v.sx)||{})})}),value:E||(S?[]:null),options:p,multiple:S,noOptionsText:(0,C.jsxs)(C.Fragment,{children:[P||"Nenhum resultado encontrado",u?(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(J.Grid,{py:1,children:(0,C.jsx)(d1.Divider,{})}),u]}):null]}),isOptionEqualToValue:(Z,y)=>typeof Z=="string"&&typeof y=="string"?Z===y:typeof Z=="object"&&typeof y=="object"?typeof Z.value=="object"&&typeof y.value=="object"&&Z.key!==void 0&&y.key!==void 0?Z.key===y.key:Z.value===y.value:!1,renderOption:(Z,y)=>typeof y=="object"?(0,l0.createElement)("li",m(a({},Z),{key:y.key||y.value}),(0,C.jsxs)(J.Grid,{container:!0,direction:"column",children:[(0,C.jsx)(J.Grid,{item:!0,children:y.label}),y.afterLabel&&(0,C.jsx)(J.Grid,{item:!0,children:y.afterLabel})]})):(0,l0.createElement)("li",m(a({},Z),{key:y}),y),ListboxComponent:(0,E1.forwardRef)(function(y,h){return(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)("ul",m(a({},y),{ref:h})),!!u&&(0,C.jsx)("div",m(a({},y),{children:(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(J.Grid,{px:2,py:1,children:(0,C.jsx)(d1.Divider,{})}),u]})}),"searchable-footer")]})})},D),{renderInput:Z=>(0,C.jsx)(J.TextField,m(a(a({error:!!x,placeholder:F},Z),b),{inputRef:_}))}),e),(0,C.jsx)(U,{name:e,disableIcon:q})]})}})},A0=(0,E1.memo)(T2);var B1=require("react"),R1=require("react-hook-form"),O1=require("lodash"),K=require("@mui/material"),Q=require("@s_mart/core"),I0=require("@s_mart/tokens");var o0=require("@s_mart/utils");var L1=require("@s_mart/utils"),T0=p1(require("@emotion/styled")),a0=require("@emotion/react"),D0=a0.css`
1
+ "use strict";var y2=Object.create;var g1=Object.defineProperty,g2=Object.defineProperties,x2=Object.getOwnPropertyDescriptor,b2=Object.getOwnPropertyDescriptors,L2=Object.getOwnPropertyNames,w1=Object.getOwnPropertySymbols,F2=Object.getPrototypeOf,X1=Object.prototype.hasOwnProperty,p0=Object.prototype.propertyIsEnumerable;var v0=(e,c,o)=>c in e?g1(e,c,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[c]=o,a=(e,c)=>{for(var o in c||(c={}))X1.call(c,o)&&v0(e,o,c[o]);if(w1)for(var o of w1(c))p0.call(c,o)&&v0(e,o,c[o]);return e},m=(e,c)=>g2(e,b2(c));var $=(e,c)=>{var o={};for(var s in e)X1.call(e,s)&&c.indexOf(s)<0&&(o[s]=e[s]);if(e!=null&&w1)for(var s of w1(e))c.indexOf(s)<0&&p0.call(e,s)&&(o[s]=e[s]);return o};var Z0=(e,c)=>()=>(c||e((c={exports:{}}).exports,c),c.exports),P2=(e,c)=>{for(var o in c)g1(e,o,{get:c[o],enumerable:!0})},u0=(e,c,o,s)=>{if(c&&typeof c=="object"||typeof c=="function")for(let r of L2(c))!X1.call(e,r)&&r!==o&&g1(e,r,{get:()=>c[r],enumerable:!(s=x2(c,r))||s.enumerable});return e};var p1=(e,c,o)=>(o=e!=null?y2(F2(e)):{},u0(c||!e||!e.__esModule?g1(o,"default",{value:e,enumerable:!0}):o,e)),C2=e=>u0(g1({},"__esModule",{value:!0}),e);var Y0=Z0((n0,s0)=>{(function(e,c){typeof n0=="object"&&typeof s0!="undefined"?s0.exports=c():typeof define=="function"&&define.amd?define(c):(e=typeof globalThis!="undefined"?globalThis:e||self).dayjs=c()})(n0,function(){"use strict";var e=1e3,c=6e4,o=36e5,s="millisecond",r="second",M="minute",p="hour",b="day",P="week",u="month",S="quarter",f="year",F="date",A="Invalid Date",k=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,q=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,D={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(h){var i=["th","st","nd","rd"],l=h%100;return"["+h+(i[(l-20)%10]||i[l]||i[0])+"]"}},T=function(h,i,l){var V=String(h);return!V||V.length>=i?h:""+Array(i+1-V.length).join(l)+h},w={s:T,z:function(h){var i=-h.utcOffset(),l=Math.abs(i),V=Math.floor(l/60),t=l%60;return(i<=0?"+":"-")+T(V,2,"0")+":"+T(t,2,"0")},m:function h(i,l){if(i.date()<l.date())return-h(l,i);var V=12*(l.year()-i.year())+(l.month()-i.month()),t=i.clone().add(V,u),g=l-t<0,n=i.clone().add(V+(g?-1:1),u);return+(-(V+(l-t)/(g?t-n:n-t))||0)},a:function(h){return h<0?Math.ceil(h)||0:Math.floor(h)},p:function(h){return{M:u,y:f,w:P,d:b,D:F,h:p,m:M,s:r,ms:s,Q:S}[h]||String(h||"").toLowerCase().replace(/s$/,"")},u:function(h){return h===void 0}},H="en",x={};x[H]=D;var I=function(h){return h instanceof Z},E=function h(i,l,V){var t;if(!i)return H;if(typeof i=="string"){var g=i.toLowerCase();x[g]&&(t=g),l&&(x[g]=l,t=g);var n=i.split("-");if(!t&&n.length>1)return h(n[0])}else{var d=i.name;x[d]=i,t=d}return!V&&t&&(H=t),t||!V&&H},_=function(h,i){if(I(h))return h.clone();var l=typeof i=="object"?i:{};return l.date=h,l.args=arguments,new Z(l)},v=w;v.l=E,v.i=I,v.w=function(h,i){return _(h,{locale:i.$L,utc:i.$u,x:i.$x,$offset:i.$offset})};var Z=function(){function h(l){this.$L=E(l.locale,null,!0),this.parse(l)}var i=h.prototype;return i.parse=function(l){this.$d=function(V){var t=V.date,g=V.utc;if(t===null)return new Date(NaN);if(v.u(t))return new Date;if(t instanceof Date)return new Date(t);if(typeof t=="string"&&!/Z$/i.test(t)){var n=t.match(k);if(n){var d=n[2]-1||0,G=(n[7]||"0").substring(0,3);return g?new Date(Date.UTC(n[1],d,n[3]||1,n[4]||0,n[5]||0,n[6]||0,G)):new Date(n[1],d,n[3]||1,n[4]||0,n[5]||0,n[6]||0,G)}}return new Date(t)}(l),this.$x=l.x||{},this.init()},i.init=function(){var l=this.$d;this.$y=l.getFullYear(),this.$M=l.getMonth(),this.$D=l.getDate(),this.$W=l.getDay(),this.$H=l.getHours(),this.$m=l.getMinutes(),this.$s=l.getSeconds(),this.$ms=l.getMilliseconds()},i.$utils=function(){return v},i.isValid=function(){return this.$d.toString()!==A},i.isSame=function(l,V){var t=_(l);return this.startOf(V)<=t&&t<=this.endOf(V)},i.isAfter=function(l,V){return _(l)<this.startOf(V)},i.isBefore=function(l,V){return this.endOf(V)<_(l)},i.$g=function(l,V,t){return v.u(l)?this[V]:this.set(t,l)},i.unix=function(){return Math.floor(this.valueOf()/1e3)},i.valueOf=function(){return this.$d.getTime()},i.startOf=function(l,V){var t=this,g=!!v.u(V)||V,n=v.p(l),d=function(v1,W){var o1=v.w(t.$u?Date.UTC(t.$y,W,v1):new Date(t.$y,W,v1),t);return g?o1:o1.endOf(b)},G=function(v1,W){return v.w(t.toDate()[v1].apply(t.toDate("s"),(g?[0,0,0,0]:[23,59,59,999]).slice(W)),t)},R=this.$W,Y=this.$M,a1=this.$D,i1="set"+(this.$u?"UTC":"");switch(n){case f:return g?d(1,0):d(31,11);case u:return g?d(1,Y):d(0,Y+1);case P:var V1=this.$locale().weekStart||0,y1=(R<V1?R+7:R)-V1;return d(g?a1-y1:a1+(6-y1),Y);case b:case F:return G(i1+"Hours",0);case p:return G(i1+"Minutes",1);case M:return G(i1+"Seconds",2);case r:return G(i1+"Milliseconds",3);default:return this.clone()}},i.endOf=function(l){return this.startOf(l,!1)},i.$set=function(l,V){var t,g=v.p(l),n="set"+(this.$u?"UTC":""),d=(t={},t[b]=n+"Date",t[F]=n+"Date",t[u]=n+"Month",t[f]=n+"FullYear",t[p]=n+"Hours",t[M]=n+"Minutes",t[r]=n+"Seconds",t[s]=n+"Milliseconds",t)[g],G=g===b?this.$D+(V-this.$W):V;if(g===u||g===f){var R=this.clone().set(F,1);R.$d[d](G),R.init(),this.$d=R.set(F,Math.min(this.$D,R.daysInMonth())).$d}else d&&this.$d[d](G);return this.init(),this},i.set=function(l,V){return this.clone().$set(l,V)},i.get=function(l){return this[v.p(l)]()},i.add=function(l,V){var t,g=this;l=Number(l);var n=v.p(V),d=function(Y){var a1=_(g);return v.w(a1.date(a1.date()+Math.round(Y*l)),g)};if(n===u)return this.set(u,this.$M+l);if(n===f)return this.set(f,this.$y+l);if(n===b)return d(1);if(n===P)return d(7);var G=(t={},t[M]=c,t[p]=o,t[r]=e,t)[n]||1,R=this.$d.getTime()+l*G;return v.w(R,this)},i.subtract=function(l,V){return this.add(-1*l,V)},i.format=function(l){var V=this,t=this.$locale();if(!this.isValid())return t.invalidDate||A;var g=l||"YYYY-MM-DDTHH:mm:ssZ",n=v.z(this),d=this.$H,G=this.$m,R=this.$M,Y=t.weekdays,a1=t.months,i1=function(W,o1,Q1,S1){return W&&(W[o1]||W(V,g))||Q1[o1].slice(0,S1)},V1=function(W){return v.s(d%12||12,W,"0")},y1=t.meridiem||function(W,o1,Q1){var S1=W<12?"AM":"PM";return Q1?S1.toLowerCase():S1},v1={YY:String(this.$y).slice(-2),YYYY:this.$y,M:R+1,MM:v.s(R+1,2,"0"),MMM:i1(t.monthsShort,R,a1,3),MMMM:i1(a1,R),D:this.$D,DD:v.s(this.$D,2,"0"),d:String(this.$W),dd:i1(t.weekdaysMin,this.$W,Y,2),ddd:i1(t.weekdaysShort,this.$W,Y,3),dddd:Y[this.$W],H:String(d),HH:v.s(d,2,"0"),h:V1(1),hh:V1(2),a:y1(d,G,!0),A:y1(d,G,!1),m:String(G),mm:v.s(G,2,"0"),s:String(this.$s),ss:v.s(this.$s,2,"0"),SSS:v.s(this.$ms,3,"0"),Z:n};return g.replace(q,function(W,o1){return o1||v1[W]||n.replace(":","")})},i.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},i.diff=function(l,V,t){var g,n=v.p(V),d=_(l),G=(d.utcOffset()-this.utcOffset())*c,R=this-d,Y=v.m(this,d);return Y=(g={},g[f]=Y/12,g[u]=Y,g[S]=Y/3,g[P]=(R-G)/6048e5,g[b]=(R-G)/864e5,g[p]=R/o,g[M]=R/c,g[r]=R/e,g)[n]||R,t?Y:v.a(Y)},i.daysInMonth=function(){return this.endOf(u).$D},i.$locale=function(){return x[this.$L]},i.locale=function(l,V){if(!l)return this.$L;var t=this.clone(),g=E(l,V,!0);return g&&(t.$L=g),t},i.clone=function(){return v.w(this.$d,this)},i.toDate=function(){return new Date(this.valueOf())},i.toJSON=function(){return this.isValid()?this.toISOString():null},i.toISOString=function(){return this.$d.toISOString()},i.toString=function(){return this.$d.toUTCString()},h}(),y=Z.prototype;return _.prototype=y,[["$ms",s],["$s",r],["$m",M],["$H",p],["$W",b],["$M",u],["$y",f],["$D",F]].forEach(function(h){y[h[1]]=function(i){return this.$g(i,h[0],h[1])}}),_.extend=function(h,i){return h.$i||(h(i,Z,_),h.$i=!0),_},_.locale=E,_.isDayjs=I,_.unix=function(h){return _(1e3*h)},_.en=x[H],_.Ls=x,_.p={},_})});var m0=Z0((h0,d0)=>{(function(e,c){typeof h0=="object"&&typeof d0!="undefined"?d0.exports=c(Y0()):typeof define=="function"&&define.amd?define(["dayjs"],c):(e=typeof globalThis!="undefined"?globalThis:e||self).dayjs_locale_pt_br=c(e.dayjs)})(h0,function(e){"use strict";function c(r){return r&&typeof r=="object"&&"default"in r?r:{default:r}}var o=c(e),s={name:"pt-br",weekdays:"domingo_segunda-feira_ter\xE7a-feira_quarta-feira_quinta-feira_sexta-feira_s\xE1bado".split("_"),weekdaysShort:"dom_seg_ter_qua_qui_sex_s\xE1b".split("_"),weekdaysMin:"Do_2\xAA_3\xAA_4\xAA_5\xAA_6\xAA_S\xE1".split("_"),months:"janeiro_fevereiro_mar\xE7o_abril_maio_junho_julho_agosto_setembro_outubro_novembro_dezembro".split("_"),monthsShort:"jan_fev_mar_abr_mai_jun_jul_ago_set_out_nov_dez".split("_"),ordinal:function(r){return r+"\xBA"},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY [\xE0s] HH:mm",LLLL:"dddd, D [de] MMMM [de] YYYY [\xE0s] HH:mm"},relativeTime:{future:"em %s",past:"h\xE1 %s",s:"poucos segundos",m:"um minuto",mm:"%d minutos",h:"uma hora",hh:"%d horas",d:"um dia",dd:"%d dias",M:"um m\xEAs",MM:"%d meses",y:"um ano",yy:"%d anos"}};return o.default.locale(s,null,!0),s})});var W2={};P2(W2,{Autocomplete:()=>H2,Checkbox:()=>G0,Creatable:()=>E0,DatePicker:()=>l2,Form:()=>y0,FormProvider:()=>$1,RadioButton:()=>R0,RadioGroup:()=>O0,Searchable:()=>A0,Select:()=>w0,Slider:()=>q0,Switch:()=>B0,TextField:()=>S0,TimePicker:()=>u2,useForm:()=>A1});module.exports=C2(W2);var f0=require("react-hook-form");var e0=require("react/jsx-runtime"),k2=r=>{var M=r,{children:e,style:c,onSubmit:o}=M,s=$(M,["children","style","onSubmit"]);return(0,e0.jsx)(f0.FormProvider,m(a({},s),{children:(0,e0.jsx)("form",{onSubmit:p=>{p.preventDefault(),p.stopPropagation(),o(p)},style:c,children:e})}))},$1=k2;var M0=require("react"),H0=require("react-hook-form"),V0=require("@hookform/resolvers/zod");var S2=s=>{var r=s,{disableDefaultValuesUpdate:e,onSubmit:c}=r,o=$(r,["disableDefaultValuesUpdate","onSubmit"]);let M=(0,H0.useForm)(m(a({},o),{resolver:o.schema&&(0,V0.zodResolver)(o.schema)}));return(0,M0.useEffect)(()=>{e||M.reset(o.defaultValues)},[o.defaultValues,M.reset]),m(a({},M),{onSubmit:M.handleSubmit(p=>c(p,M))})},A1=S2;var g0=require("react/jsx-runtime");function w2(s){var r=s,{children:e,style:c}=r,o=$(r,["children","style"]);let M=A1(o);return(0,g0.jsx)($1,m(a({},M),{style:c,children:typeof e=="function"?e(M):e}))}var y0=w2;var T1=require("react"),D1=require("react-hook-form"),t1=require("@mui/material");var x0={description:"M39 23.1a17 17 0 0 0-15-10c-6.5.1-12.4 4-15.2 10V25a17 17 0 0 0 15 10A17 17 0 0 0 39 25c.5-.7.5-1.3.2-1.8Zm-15 9a8 8 0 0 1-7.6-8.5c.2-4.2 3.5-7.8 7.6-7.8a8 8 0 0 1 7.6 8.4c-.1 4.3-3.5 7.9-7.6 7.9Zm0-13.5-1.3.1c.7 1.1.6 2.6-.3 3.7-1 .9-2.3.9-3.4.1-.4 2.2.3 4.7 2.1 6a4.9 4.9 0 0 0 6-.2c1.6-1.4 2.4-4 1.6-6.1a4.9 4.9 0 0 0-4.7-3.6Z",id:"line-eye-solid"},b0={description:"M24 31.7c-4 0-7.4-3.1-7.7-7.1l-5.6-4.4c-.8 1-1.4 2-2 3a1.7 1.7 0 0 0 0 1.6 17.2 17.2 0 0 0 19.5 9l-2.8-2.2-1.4.1ZM40.9 35l-6-4.6c1.8-1.5 3.3-3.4 4.4-5.5a1.7 1.7 0 0 0 0-1.6c-3-5.7-8.7-9.5-15.3-9.5-2.8 0-5.5.7-8 2l-6.8-5.3a.9.9 0 0 0-1.2.2L7 12a.9.9 0 0 0 .1 1.2l31.7 24.5a.9.9 0 0 0 1.2-.2l1-1.3a.9.9 0 0 0-.1-1.2Zm-10-7.7-2-1.6a5 5 0 0 0-6.3-6.6 2.5 2.5 0 0 1 .4 2l-3.9-3a7.7 7.7 0 0 1 10.4.5 7.7 7.7 0 0 1 1.5 8.7Z",id:"line-eye-slash-solid"};var r1={description:"M24 8a16 16 0 0 0 0 32 16 16 0 0 0 0-32Zm0 7.1c1.5 0 2.7 1.2 2.7 2.7 0 1.6-1.2 2.7-2.7 2.7a2.6 2.6 0 0 1-2.7-2.7c0-1.5 1.2-2.7 2.7-2.7Zm3.6 16.4c0 .4-.4.8-.8.8h-5.6a.7.7 0 0 1-.8-.8v-1.6c0-.4.3-.7.8-.7h.7V25h-.7a.7.7 0 0 1-.8-.7v-1.6c0-.4.3-.8.8-.8h4c.5 0 .9.4.9.8v6.5h.7c.4 0 .8.3.8.7v1.6Z",id:"line-info-circle-solid"};var L0={description:"m25.5 17 5.5 5.5-12 12-4.9.5a1 1 0 0 1-1-1.1l.5-5L25.5 17Zm8.9-.8-2.6-2.6a2 2 0 0 0-2.9 0L26.5 16l5.5 5.5 2.4-2.4a2 2 0 0 0 0-3Z",id:"line-pen-solid"};var c0={description:"M35.8 21.8h-9.6v-9.6c0-.6-.6-1.1-1.1-1.1h-2.2a1 1 0 0 0-1 1v9.7h-9.7c-.6 0-1.1.6-1.1 1.1v2.2c0 .6.5 1 1 1h9.7v9.7c0 .6.5 1.1 1.1 1.1h2.2c.5 0 1-.5 1-1v-9.7h9.7c.6 0 1.1-.5 1.1-1.1v-2.2c0-.5-.5-1-1-1Z",id:"line-plus-solid"};var Z1=p1(require("@s_mart/masks"));var i0=require("@mui/material"),F0=require("@s_mart/utils"),x1=require("react/jsx-runtime"),O=({label:e,required:c,regular:o})=>(0,x1.jsxs)("span",{style:{display:"flex",alignItems:"center",gap:(0,F0.toRem)(2)},children:[(0,x1.jsx)(i0.Typography,{variant:"caption",fontWeight:o?400:700,style:{display:"flex",alignItems:"center"},children:e}),c&&(0,x1.jsx)(i0.Typography,{variant:"caption",fontWeight:900,color:"error",children:"*"})]});var P0=require("react-hook-form"),C0=require("@s_mart/core");var z=(e,c)=>{var o,s,r,M,p;if(e[c])return e[c];if(c.includes("[")){let[b,P]=c.split("["),[u,S]=P.split("].");return(s=(o=e[b])==null?void 0:o[u])==null?void 0:s[S]}if(c.includes(".")){let[b,P,u]=c.split(".");return u?(p=(M=e[b])==null?void 0:M[P])==null?void 0:p[u]:(r=e[b])==null?void 0:r[P]}};var k0=require("react/jsx-runtime"),U=({name:e,disableIcon:c})=>{var r;let o=(0,P0.useFormContext)(),s=z((r=o==null?void 0:o.formState)==null?void 0:r.errors,e);return s?(0,k0.jsx)(C0.Indicator,{severity:"error",icon:c?!1:void 0,children:s==null?void 0:s.message}):null};var b1=require("@s_mart/core");var j=require("react/jsx-runtime"),$2=q=>{var D=q,{name:e,rules:c,defaultValue:o,shouldUnregister:s,label:r,required:M,mask:p,variant:b="outlined",info:P,parse:u,inputMode:S,format:f,onInputChange:F,disableIconError:A}=D,k=$(D,["name","rules","defaultValue","shouldUnregister","label","required","mask","variant","info","parse","inputMode","format","onInputChange","disableIconError"]);let T=(0,D1.useFormContext)();if(!T)throw new Error("Para usar o <TextField /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let[w,H]=(0,T1.useState)(!1),x=v=>{var y;let Z=v;return f&&(Z=f(v)),p?(y=Z1==null?void 0:Z1[p])==null?void 0:y.format(Z):Z},I=v=>{var y;let Z=v;return u&&(Z=u(v)),p?(y=Z1==null?void 0:Z1[p])==null?void 0:y.parse(Z):Z},E=v=>{if(!v||p!=="porcentagem"&&p!=="porcentagem0")return;v==null||v.stopPropagation();let Z=(v==null?void 0:v.target).value;if(Z){let y=String(Z);if(y.length>0){let h=y.indexOf("%");h>-1&&(v.currentTarget.selectionEnd=h)}}},_=z(T.formState.errors,e);return(0,j.jsx)(D1.Controller,{control:T.control,name:e,rules:c,defaultValue:o,shouldUnregister:s,render:({field:{value:v,onChange:Z,ref:y}})=>(0,j.jsxs)(t1.Grid,{display:"flex",flexDirection:"column",children:[(0,j.jsxs)("div",{style:{display:"flex"},children:[r&&(0,j.jsx)(t1.Grid,{item:!0,children:(0,j.jsx)(O,{label:r,required:M})}),P&&(0,j.jsx)(t1.Grid,{item:!0,children:(0,j.jsx)(b1.Tooltip,{title:P,placement:"top",children:(0,j.jsx)("div",{style:{width:"fit-content"},children:(0,j.jsx)(b1.LIcon,{icon:r1,color:"#757575"})})})})]}),(0,j.jsx)(t1.TextField,m(a({variant:b,defaultValue:o,value:x(v||""),onChange:h=>{var l;let i=I((l=h==null?void 0:h.target)==null?void 0:l.value);Z(i),F==null||F(i,T.getValues())},error:!!_},k),{type:k.type==="password"?w?"text":"password":k.type,autoComplete:k.autoComplete||"off",inputProps:a({inputMode:S},k.inputProps),InputProps:a({onKeyDown:E,inputRef:y,endAdornment:k.type==="password"&&(0,j.jsx)(t1.InputAdornment,{position:"start",onClick:()=>H(!w),style:{cursor:"pointer"},children:(0,j.jsx)(b1.LIcon,{icon:w?x0:b0,size:"24px",removeMargin:!0})})},k.InputProps)}),e),(0,j.jsx)(U,{name:e,disableIcon:A})]})})},S0=(0,T1.memo)($2);var _1=require("react"),I1=require("react-hook-form"),u1=require("@s_mart/core"),N=require("@mui/material");var B=require("react/jsx-runtime"),A2=q=>{var D=q,{name:e,rules:c,defaultValue:o,shouldUnregister:s,label:r,required:M,options:p,placeholder:b,disableOnChangeForm:P=!1,multiple:u,info:S,footer:f,onChange:F,disableIconError:A}=D,k=$(D,["name","rules","defaultValue","shouldUnregister","label","required","options","placeholder","disableOnChangeForm","multiple","info","footer","onChange","disableIconError"]);let T=(0,I1.useFormContext)(),{palette:w}=(0,N.useTheme)(),[H,x]=(0,_1.useState)(!1);if(!T)throw new Error("Para usar o <Select /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let I=z(T.formState.errors,e);return console.warn=()=>{},(0,B.jsx)(I1.Controller,{control:T.control,name:e,rules:c,defaultValue:o,shouldUnregister:s,render:({field:{value:E,onChange:_,ref:v}})=>(0,B.jsxs)(N.Grid,{display:"flex",flexDirection:"column",children:[(0,B.jsxs)("div",{style:{display:"flex"},children:[r&&(0,B.jsx)(N.Grid,{item:!0,children:(0,B.jsx)(O,{label:r,required:M})}),S&&(0,B.jsx)(N.Grid,{item:!0,children:(0,B.jsx)(u1.Tooltip,{title:S,placement:"top",children:(0,B.jsx)("div",{style:{width:"fit-content"},children:(0,B.jsx)(u1.LIcon,{icon:r1,color:"#757575"})})})})]}),(0,B.jsxs)(N.Select,m(a({open:H,onOpen:()=>x(!0),onClose:()=>x(!1),displayEmpty:!!b,variant:"outlined",autoComplete:"off",value:E?E||"":u?[]:"",renderValue:Z=>{if(Z.label)return Z.label;if(b)return(0,B.jsx)("p",{style:{color:w.grey[400]},children:b})},multiple:u,onChange:Z=>{!P&&_(Z.target.value),F&&F(Z.target.value,T.getValues())},error:!!I,size:k.size||"medium",inputRef:v},k),{children:[b&&(0,B.jsx)(N.MenuItem,{disabled:!0,value:"",children:(0,B.jsx)("p",{style:{color:w.grey[400]},children:b})}),p==null?void 0:p.map((Z,y)=>(0,B.jsx)(N.MenuItem,{value:Z,children:(0,B.jsxs)(N.Grid,{container:!0,direction:"column",children:[(0,B.jsx)(N.Grid,{item:!0,children:Z.label}),Z.afterLabel&&(0,B.jsx)(N.Grid,{item:!0,children:Z.afterLabel})]})},y)),f&&[(0,B.jsx)(N.Grid,{px:2,py:1,children:(0,B.jsx)(u1.Divider,{})},"footer-divider"),(0,B.jsx)("div",{children:f({closeSelect:()=>x(!1)})},"footer-content")]]}),e),(0,B.jsx)(U,{name:e,disableIcon:A})]})})},w0=(0,_1.memo)(A2);var E1=require("react"),G1=require("react-hook-form"),J=require("@mui/material"),d1=require("@s_mart/core");var $0=require("@s_mart/tokens");var C=require("react/jsx-runtime"),l0=require("react"),T2=T=>{var w=T,{name:e,rules:c,defaultValue:o,shouldUnregister:s,label:r,required:M,options:p,textFieldProps:b,noOptionsText:P,footer:u,multiple:S,info:f,placeholder:F,onChange:A,onInputChange:k,disableIconError:q}=w,D=$(w,["name","rules","defaultValue","shouldUnregister","label","required","options","textFieldProps","noOptionsText","footer","multiple","info","placeholder","onChange","onInputChange","disableIconError"]);let H=(0,G1.useFormContext)();if(!H)throw new Error("Para usar o <Searchable /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let x=z(H.formState.errors,e);return console.warn=()=>{},(0,C.jsx)(G1.Controller,{control:H.control,name:e,rules:c,defaultValue:o,shouldUnregister:s,render:({field:{onChange:I,value:E,ref:_}})=>{var v;return(0,C.jsxs)(J.Grid,{display:"flex",flexDirection:"column",children:[(0,C.jsxs)("div",{style:{display:"flex"},children:[r&&(0,C.jsx)(J.Grid,{item:!0,children:(0,C.jsx)(O,{label:r,required:M})}),f&&(0,C.jsx)(J.Grid,{item:!0,children:(0,C.jsx)(d1.Tooltip,{title:f,placement:"top",children:(0,C.jsx)("div",{style:{width:"fit-content"},children:(0,C.jsx)(d1.LIcon,{icon:r1,color:"#757575"})})})})]}),(0,C.jsx)(J.Autocomplete,m(a({onChange:(Z,y)=>{I(y),A==null||A(y,H.getValues())},onInputChange:(Z,y,h)=>{h==="input"&&setTimeout(()=>{k==null||k(y,H.getValues())},0)},slotProps:m(a({},D.slotProps||{}),{paper:m(a({},(D.slotProps||{}).paper||{}),{sx:a({border:`1px solid ${$0.colorPalette.neutral[30]}`,boxShadow:"0px 2px 4px rgba(0, 0, 0, 0.15)"},((v=(D.slotProps||{}).paper)==null?void 0:v.sx)||{})})}),value:E||(S?[]:null),options:p,multiple:S,noOptionsText:(0,C.jsxs)(C.Fragment,{children:[P||"Nenhum resultado encontrado",u?(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(J.Grid,{py:1,children:(0,C.jsx)(d1.Divider,{})}),u]}):null]}),isOptionEqualToValue:(Z,y)=>typeof Z=="string"&&typeof y=="string"?Z===y:typeof Z=="object"&&typeof y=="object"?typeof Z.value=="object"&&typeof y.value=="object"&&Z.key!==void 0&&y.key!==void 0?Z.key===y.key:Z.value===y.value:!1,renderOption:(Z,y)=>typeof y=="object"?(0,l0.createElement)("li",m(a({},Z),{key:y.key||y.value}),(0,C.jsxs)(J.Grid,{container:!0,direction:"column",children:[(0,C.jsx)(J.Grid,{item:!0,children:y.label}),y.afterLabel&&(0,C.jsx)(J.Grid,{item:!0,children:y.afterLabel})]})):(0,l0.createElement)("li",m(a({},Z),{key:y}),y),ListboxComponent:(0,E1.forwardRef)(function(y,h){return(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)("ul",m(a({},y),{ref:h})),!!u&&(0,C.jsx)("div",m(a({},y),{children:(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(J.Grid,{px:2,py:1,children:(0,C.jsx)(d1.Divider,{})}),u]})}),"searchable-footer")]})})},D),{renderInput:Z=>(0,C.jsx)(J.TextField,m(a(a({error:!!x,placeholder:F},Z),b),{inputRef:_}))}),e),(0,C.jsx)(U,{name:e,disableIcon:q})]})}})},A0=(0,E1.memo)(T2);var B1=require("react"),R1=require("react-hook-form"),O1=require("lodash"),K=require("@mui/material"),Q=require("@s_mart/core"),I0=require("@s_mart/tokens");var o0=require("@s_mart/utils");var L1=require("@s_mart/utils"),T0=p1(require("@emotion/styled")),a0=require("@emotion/react"),D0=a0.css`
2
2
  display: flex;
3
3
  align-items: center;
4
4
  justify-content: center;
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- var m0=Object.create;var L1=Object.defineProperty,v0=Object.defineProperties,p0=Object.getOwnPropertyDescriptor,Z0=Object.getOwnPropertyDescriptors,u0=Object.getOwnPropertyNames,u1=Object.getOwnPropertySymbols,f0=Object.getPrototypeOf,F1=Object.prototype.hasOwnProperty,E1=Object.prototype.propertyIsEnumerable;var I1=(e,i,r)=>i in e?L1(e,i,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[i]=r,a=(e,i)=>{for(var r in i||(i={}))F1.call(i,r)&&I1(e,r,i[r]);if(u1)for(var r of u1(i))E1.call(i,r)&&I1(e,r,i[r]);return e},m=(e,i)=>v0(e,Z0(i));var S=(e,i)=>{var r={};for(var s in e)F1.call(e,s)&&i.indexOf(s)<0&&(r[s]=e[s]);if(e!=null&&u1)for(var s of u1(e))i.indexOf(s)<0&&E1.call(e,s)&&(r[s]=e[s]);return r};var G1=(e,i)=>()=>(i||e((i={exports:{}}).exports,i),i.exports);var M0=(e,i,r,s)=>{if(i&&typeof i=="object"||typeof i=="function")for(let o of u0(i))!F1.call(e,o)&&o!==r&&L1(e,o,{get:()=>i[o],enumerable:!(s=p0(i,o))||s.enumerable});return e};var B1=(e,i,r)=>(r=e!=null?m0(f0(e)):{},M0(i||!e||!e.__esModule?L1(r,"default",{value:e,enumerable:!0}):r,e));var a0=G1(($1,A1)=>{(function(e,i){typeof $1=="object"&&typeof A1!="undefined"?A1.exports=i():typeof define=="function"&&define.amd?define(i):(e=typeof globalThis!="undefined"?globalThis:e||self).dayjs=i()})($1,function(){"use strict";var e=1e3,i=6e4,r=36e5,s="millisecond",o="second",M="minute",p="hour",b="day",F="week",u="month",C="quarter",f="year",L="date",w="Invalid Date",P=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,O=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,A={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(h){var c=["th","st","nd","rd"],l=h%100;return"["+h+(c[(l-20)%10]||c[l]||c[0])+"]"}},$=function(h,c,l){var V=String(h);return!V||V.length>=c?h:""+Array(c+1-V.length).join(l)+h},k={s:$,z:function(h){var c=-h.utcOffset(),l=Math.abs(c),V=Math.floor(l/60),t=l%60;return(c<=0?"+":"-")+$(V,2,"0")+":"+$(t,2,"0")},m:function h(c,l){if(c.date()<l.date())return-h(l,c);var V=12*(l.year()-c.year())+(l.month()-c.month()),t=c.clone().add(V,u),g=l-t<0,n=c.clone().add(V+(g?-1:1),u);return+(-(V+(l-t)/(g?t-n:n-t))||0)},a:function(h){return h<0?Math.ceil(h)||0:Math.floor(h)},p:function(h){return{M:u,y:f,w:F,d:b,D:L,h:p,m:M,s:o,ms:s,Q:C}[h]||String(h||"").toLowerCase().replace(/s$/,"")},u:function(h){return h===void 0}},H="en",x={};x[H]=A;var D=function(h){return h instanceof Z},_=function h(c,l,V){var t;if(!c)return H;if(typeof c=="string"){var g=c.toLowerCase();x[g]&&(t=g),l&&(x[g]=l,t=g);var n=c.split("-");if(!t&&n.length>1)return h(n[0])}else{var d=c.name;x[d]=c,t=d}return!V&&t&&(H=t),t||!V&&H},T=function(h,c){if(D(h))return h.clone();var l=typeof c=="object"?c:{};return l.date=h,l.args=arguments,new Z(l)},v=k;v.l=_,v.i=D,v.w=function(h,c){return T(h,{locale:c.$L,utc:c.$u,x:c.$x,$offset:c.$offset})};var Z=function(){function h(l){this.$L=_(l.locale,null,!0),this.parse(l)}var c=h.prototype;return c.parse=function(l){this.$d=function(V){var t=V.date,g=V.utc;if(t===null)return new Date(NaN);if(v.u(t))return new Date;if(t instanceof Date)return new Date(t);if(typeof t=="string"&&!/Z$/i.test(t)){var n=t.match(P);if(n){var d=n[2]-1||0,I=(n[7]||"0").substring(0,3);return g?new Date(Date.UTC(n[1],d,n[3]||1,n[4]||0,n[5]||0,n[6]||0,I)):new Date(n[1],d,n[3]||1,n[4]||0,n[5]||0,n[6]||0,I)}}return new Date(t)}(l),this.$x=l.x||{},this.init()},c.init=function(){var l=this.$d;this.$y=l.getFullYear(),this.$M=l.getMonth(),this.$D=l.getDate(),this.$W=l.getDay(),this.$H=l.getHours(),this.$m=l.getMinutes(),this.$s=l.getSeconds(),this.$ms=l.getMilliseconds()},c.$utils=function(){return v},c.isValid=function(){return this.$d.toString()!==w},c.isSame=function(l,V){var t=T(l);return this.startOf(V)<=t&&t<=this.endOf(V)},c.isAfter=function(l,V){return T(l)<this.startOf(V)},c.isBefore=function(l,V){return this.endOf(V)<T(l)},c.$g=function(l,V,t){return v.u(l)?this[V]:this.set(t,l)},c.unix=function(){return Math.floor(this.valueOf()/1e3)},c.valueOf=function(){return this.$d.getTime()},c.startOf=function(l,V){var t=this,g=!!v.u(V)||V,n=v.p(l),d=function(t1,j){var e1=v.w(t.$u?Date.UTC(t.$y,j,t1):new Date(t.$y,j,t1),t);return g?e1:e1.endOf(b)},I=function(t1,j){return v.w(t.toDate()[t1].apply(t.toDate("s"),(g?[0,0,0,0]:[23,59,59,999]).slice(j)),t)},G=this.$W,Y=this.$M,X=this.$D,Q="set"+(this.$u?"UTC":"");switch(n){case f:return g?d(1,0):d(31,11);case u:return g?d(1,Y):d(0,Y+1);case F:var h1=this.$locale().weekStart||0,d1=(G<h1?G+7:G)-h1;return d(g?X-d1:X+(6-d1),Y);case b:case L:return I(Q+"Hours",0);case p:return I(Q+"Minutes",1);case M:return I(Q+"Seconds",2);case o:return I(Q+"Milliseconds",3);default:return this.clone()}},c.endOf=function(l){return this.startOf(l,!1)},c.$set=function(l,V){var t,g=v.p(l),n="set"+(this.$u?"UTC":""),d=(t={},t[b]=n+"Date",t[L]=n+"Date",t[u]=n+"Month",t[f]=n+"FullYear",t[p]=n+"Hours",t[M]=n+"Minutes",t[o]=n+"Seconds",t[s]=n+"Milliseconds",t)[g],I=g===b?this.$D+(V-this.$W):V;if(g===u||g===f){var G=this.clone().set(L,1);G.$d[d](I),G.init(),this.$d=G.set(L,Math.min(this.$D,G.daysInMonth())).$d}else d&&this.$d[d](I);return this.init(),this},c.set=function(l,V){return this.clone().$set(l,V)},c.get=function(l){return this[v.p(l)]()},c.add=function(l,V){var t,g=this;l=Number(l);var n=v.p(V),d=function(Y){var X=T(g);return v.w(X.date(X.date()+Math.round(Y*l)),g)};if(n===u)return this.set(u,this.$M+l);if(n===f)return this.set(f,this.$y+l);if(n===b)return d(1);if(n===F)return d(7);var I=(t={},t[M]=i,t[p]=r,t[o]=e,t)[n]||1,G=this.$d.getTime()+l*I;return v.w(G,this)},c.subtract=function(l,V){return this.add(-1*l,V)},c.format=function(l){var V=this,t=this.$locale();if(!this.isValid())return t.invalidDate||w;var g=l||"YYYY-MM-DDTHH:mm:ssZ",n=v.z(this),d=this.$H,I=this.$m,G=this.$M,Y=t.weekdays,X=t.months,Q=function(j,e1,b1,Z1){return j&&(j[e1]||j(V,g))||b1[e1].slice(0,Z1)},h1=function(j){return v.s(d%12||12,j,"0")},d1=t.meridiem||function(j,e1,b1){var Z1=j<12?"AM":"PM";return b1?Z1.toLowerCase():Z1},t1={YY:String(this.$y).slice(-2),YYYY:this.$y,M:G+1,MM:v.s(G+1,2,"0"),MMM:Q(t.monthsShort,G,X,3),MMMM:Q(X,G),D:this.$D,DD:v.s(this.$D,2,"0"),d:String(this.$W),dd:Q(t.weekdaysMin,this.$W,Y,2),ddd:Q(t.weekdaysShort,this.$W,Y,3),dddd:Y[this.$W],H:String(d),HH:v.s(d,2,"0"),h:h1(1),hh:h1(2),a:d1(d,I,!0),A:d1(d,I,!1),m:String(I),mm:v.s(I,2,"0"),s:String(this.$s),ss:v.s(this.$s,2,"0"),SSS:v.s(this.$ms,3,"0"),Z:n};return g.replace(O,function(j,e1){return e1||t1[j]||n.replace(":","")})},c.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},c.diff=function(l,V,t){var g,n=v.p(V),d=T(l),I=(d.utcOffset()-this.utcOffset())*i,G=this-d,Y=v.m(this,d);return Y=(g={},g[f]=Y/12,g[u]=Y,g[C]=Y/3,g[F]=(G-I)/6048e5,g[b]=(G-I)/864e5,g[p]=G/r,g[M]=G/i,g[o]=G/e,g)[n]||G,t?Y:v.a(Y)},c.daysInMonth=function(){return this.endOf(u).$D},c.$locale=function(){return x[this.$L]},c.locale=function(l,V){if(!l)return this.$L;var t=this.clone(),g=_(l,V,!0);return g&&(t.$L=g),t},c.clone=function(){return v.w(this.$d,this)},c.toDate=function(){return new Date(this.valueOf())},c.toJSON=function(){return this.isValid()?this.toISOString():null},c.toISOString=function(){return this.$d.toISOString()},c.toString=function(){return this.$d.toUTCString()},h}(),y=Z.prototype;return T.prototype=y,[["$ms",s],["$s",o],["$m",M],["$H",p],["$W",b],["$M",u],["$y",f],["$D",L]].forEach(function(h){y[h[1]]=function(c){return this.$g(c,h[0],h[1])}}),T.extend=function(h,c){return h.$i||(h(c,Z,T),h.$i=!0),T},T.locale=_,T.isDayjs=D,T.unix=function(h){return T(1e3*h)},T.en=x[H],T.Ls=x,T.p={},T})});var _1=G1((T1,D1)=>{(function(e,i){typeof T1=="object"&&typeof D1!="undefined"?D1.exports=i(a0()):typeof define=="function"&&define.amd?define(["dayjs"],i):(e=typeof globalThis!="undefined"?globalThis:e||self).dayjs_locale_pt_br=i(e.dayjs)})(T1,function(e){"use strict";function i(o){return o&&typeof o=="object"&&"default"in o?o:{default:o}}var r=i(e),s={name:"pt-br",weekdays:"domingo_segunda-feira_ter\xE7a-feira_quarta-feira_quinta-feira_sexta-feira_s\xE1bado".split("_"),weekdaysShort:"dom_seg_ter_qua_qui_sex_s\xE1b".split("_"),weekdaysMin:"Do_2\xAA_3\xAA_4\xAA_5\xAA_6\xAA_S\xE1".split("_"),months:"janeiro_fevereiro_mar\xE7o_abril_maio_junho_julho_agosto_setembro_outubro_novembro_dezembro".split("_"),monthsShort:"jan_fev_mar_abr_mai_jun_jul_ago_set_out_nov_dez".split("_"),ordinal:function(o){return o+"\xBA"},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY [\xE0s] HH:mm",LLLL:"dddd, D [de] MMMM [de] YYYY [\xE0s] HH:mm"},relativeTime:{future:"em %s",past:"h\xE1 %s",s:"poucos segundos",m:"um minuto",mm:"%d minutos",h:"uma hora",hh:"%d horas",d:"um dia",dd:"%d dias",M:"um m\xEAs",MM:"%d meses",y:"um ano",yy:"%d anos"}};return r.default.locale(s,null,!0),s})});import{FormProvider as H0}from"react-hook-form";import{jsx as R1}from"react/jsx-runtime";var V0=o=>{var M=o,{children:e,style:i,onSubmit:r}=M,s=S(M,["children","style","onSubmit"]);return R1(H0,m(a({},s),{children:R1("form",{onSubmit:p=>{p.preventDefault(),p.stopPropagation(),r(p)},style:i,children:e})}))},P1=V0;import{useEffect as y0}from"react";import{useForm as g0}from"react-hook-form";import{zodResolver as x0}from"@hookform/resolvers/zod";var b0=s=>{var o=s,{disableDefaultValuesUpdate:e,onSubmit:i}=o,r=S(o,["disableDefaultValuesUpdate","onSubmit"]);let M=g0(m(a({},r),{resolver:r.schema&&x0(r.schema)}));return y0(()=>{e||M.reset(r.defaultValues)},[r.defaultValues,M.reset]),m(a({},M),{onSubmit:M.handleSubmit(p=>i(p,M))})},C1=b0;import{jsx as P0}from"react/jsx-runtime";function L0(s){var o=s,{children:e,style:i}=o,r=S(o,["children","style"]);let M=C1(r);return P0(P1,m(a({},M),{style:i,children:typeof e=="function"?e(M):e}))}var F0=L0;import{memo as A0,useState as T0}from"react";import{Controller as D0,useFormContext as _0}from"react-hook-form";import{Grid as S1,InputAdornment as I0,TextField as E0}from"@mui/material";var O1={description:"M39 23.1a17 17 0 0 0-15-10c-6.5.1-12.4 4-15.2 10V25a17 17 0 0 0 15 10A17 17 0 0 0 39 25c.5-.7.5-1.3.2-1.8Zm-15 9a8 8 0 0 1-7.6-8.5c.2-4.2 3.5-7.8 7.6-7.8a8 8 0 0 1 7.6 8.4c-.1 4.3-3.5 7.9-7.6 7.9Zm0-13.5-1.3.1c.7 1.1.6 2.6-.3 3.7-1 .9-2.3.9-3.4.1-.4 2.2.3 4.7 2.1 6a4.9 4.9 0 0 0 6-.2c1.6-1.4 2.4-4 1.6-6.1a4.9 4.9 0 0 0-4.7-3.6Z",id:"line-eye-solid"},U1={description:"M24 31.7c-4 0-7.4-3.1-7.7-7.1l-5.6-4.4c-.8 1-1.4 2-2 3a1.7 1.7 0 0 0 0 1.6 17.2 17.2 0 0 0 19.5 9l-2.8-2.2-1.4.1ZM40.9 35l-6-4.6c1.8-1.5 3.3-3.4 4.4-5.5a1.7 1.7 0 0 0 0-1.6c-3-5.7-8.7-9.5-15.3-9.5-2.8 0-5.5.7-8 2l-6.8-5.3a.9.9 0 0 0-1.2.2L7 12a.9.9 0 0 0 .1 1.2l31.7 24.5a.9.9 0 0 0 1.2-.2l1-1.3a.9.9 0 0 0-.1-1.2Zm-10-7.7-2-1.6a5 5 0 0 0-6.3-6.6 2.5 2.5 0 0 1 .4 2l-3.9-3a7.7 7.7 0 0 1 10.4.5 7.7 7.7 0 0 1 1.5 8.7Z",id:"line-eye-slash-solid"};var c1={description:"M24 8a16 16 0 0 0 0 32 16 16 0 0 0 0-32Zm0 7.1c1.5 0 2.7 1.2 2.7 2.7 0 1.6-1.2 2.7-2.7 2.7a2.6 2.6 0 0 1-2.7-2.7c0-1.5 1.2-2.7 2.7-2.7Zm3.6 16.4c0 .4-.4.8-.8.8h-5.6a.7.7 0 0 1-.8-.8v-1.6c0-.4.3-.7.8-.7h.7V25h-.7a.7.7 0 0 1-.8-.7v-1.6c0-.4.3-.8.8-.8h4c.5 0 .9.4.9.8v6.5h.7c.4 0 .8.3.8.7v1.6Z",id:"line-info-circle-solid"};var q1={description:"m25.5 17 5.5 5.5-12 12-4.9.5a1 1 0 0 1-1-1.1l.5-5L25.5 17Zm8.9-.8-2.6-2.6a2 2 0 0 0-2.9 0L26.5 16l5.5 5.5 2.4-2.4a2 2 0 0 0 0-3Z",id:"line-pen-solid"};var k1={description:"M35.8 21.8h-9.6v-9.6c0-.6-.6-1.1-1.1-1.1h-2.2a1 1 0 0 0-1 1v9.7h-9.7c-.6 0-1.1.6-1.1 1.1v2.2c0 .6.5 1 1 1h9.7v9.7c0 .6.5 1.1 1.1 1.1h2.2c.5 0 1-.5 1-1v-9.7h9.7c.6 0 1.1-.5 1.1-1.1v-2.2c0-.5-.5-1-1-1Z",id:"line-plus-solid"};import*as n1 from"@s_mart/masks";import{Typography as Y1}from"@mui/material";import{toRem as C0}from"@s_mart/utils";import{jsx as z1,jsxs as k0}from"react/jsx-runtime";var B=({label:e,required:i,regular:r})=>k0("span",{style:{display:"flex",alignItems:"center",gap:C0(2)},children:[z1(Y1,{variant:"caption",fontWeight:r?400:700,style:{display:"flex",alignItems:"center"},children:e}),i&&z1(Y1,{variant:"caption",fontWeight:900,color:"error",children:"*"})]});import{useFormContext as S0}from"react-hook-form";import{Indicator as w0}from"@s_mart/core";var z=(e,i)=>{var r,s,o,M,p;if(e[i])return e[i];if(i.includes("[")){let[b,F]=i.split("["),[u,C]=F.split("].");return(s=(r=e[b])==null?void 0:r[u])==null?void 0:s[C]}if(i.includes(".")){let[b,F,u]=i.split(".");return u?(p=(M=e[b])==null?void 0:M[F])==null?void 0:p[u]:(o=e[b])==null?void 0:o[F]}};import{jsx as $0}from"react/jsx-runtime";var R=({name:e,disableIcon:i=!1})=>{var o;let r=S0(),s=z((o=r==null?void 0:r.formState)==null?void 0:o.errors,e);return s?$0(w0,{severity:"error",icon:!i,children:s==null?void 0:s.message}):null};import{LIcon as j1,Tooltip as G0}from"@s_mart/core";import{jsx as N,jsxs as N1}from"react/jsx-runtime";var B0=O=>{var A=O,{name:e,rules:i,defaultValue:r,shouldUnregister:s,label:o,required:M,mask:p,variant:b="outlined",info:F,parse:u,inputMode:C,format:f,onInputChange:L,disableIconError:w}=A,P=S(A,["name","rules","defaultValue","shouldUnregister","label","required","mask","variant","info","parse","inputMode","format","onInputChange","disableIconError"]);let $=_0();if(!$)throw new Error("Para usar o <TextField /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let[k,H]=T0(!1),x=v=>{var y;let Z=v;return f&&(Z=f(v)),p?(y=n1==null?void 0:n1[p])==null?void 0:y.format(Z):Z},D=v=>{var y;let Z=v;return u&&(Z=u(v)),p?(y=n1==null?void 0:n1[p])==null?void 0:y.parse(Z):Z},_=v=>{if(!v||p!=="porcentagem"&&p!=="porcentagem0")return;v==null||v.stopPropagation();let Z=(v==null?void 0:v.target).value;if(Z){let y=String(Z);if(y.length>0){let h=y.indexOf("%");h>-1&&(v.currentTarget.selectionEnd=h)}}},T=z($.formState.errors,e);return N(D0,{control:$.control,name:e,rules:i,defaultValue:r,shouldUnregister:s,render:({field:{value:v,onChange:Z,ref:y}})=>N1(S1,{display:"flex",flexDirection:"column",children:[N1("div",{style:{display:"flex"},children:[o&&N(S1,{item:!0,children:N(B,{label:o,required:M})}),F&&N(S1,{item:!0,children:N(G0,{title:F,placement:"top",children:N("div",{style:{width:"fit-content"},children:N(j1,{icon:c1,color:"#757575"})})})})]}),N(E0,m(a({variant:b,defaultValue:r,value:x(v||""),onChange:h=>{var l;let c=D((l=h==null?void 0:h.target)==null?void 0:l.value);Z(c),L==null||L(c,$.getValues())},error:!!T},P),{type:P.type==="password"?k?"text":"password":P.type,autoComplete:P.autoComplete||"off",inputProps:a({inputMode:C},P.inputProps),InputProps:a({onKeyDown:_,inputRef:y,endAdornment:P.type==="password"&&N(I0,{position:"start",onClick:()=>H(!k),style:{cursor:"pointer"},children:N(j1,{icon:k?O1:U1,size:"24px",removeMargin:!0})})},P.InputProps)}),e),N(R,{name:e,disableIcon:w})]})})},R0=A0(B0);import{memo as O0,useState as U0}from"react";import{Controller as q0,useFormContext as Y0}from"react-hook-form";import{Divider as z0,LIcon as j0,Tooltip as N0}from"@s_mart/core";import{Grid as l1,Select as W0,MenuItem as W1,useTheme as J0}from"@mui/material";import{jsx as q,jsxs as f1}from"react/jsx-runtime";var K0=O=>{var A=O,{name:e,rules:i,defaultValue:r,shouldUnregister:s,label:o,required:M,options:p,placeholder:b,disableOnChangeForm:F=!1,multiple:u,info:C,footer:f,onChange:L,disableIconError:w}=A,P=S(A,["name","rules","defaultValue","shouldUnregister","label","required","options","placeholder","disableOnChangeForm","multiple","info","footer","onChange","disableIconError"]);let $=Y0(),{palette:k}=J0(),[H,x]=U0(!1);if(!$)throw new Error("Para usar o <Select /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let D=z($.formState.errors,e);return console.warn=()=>{},q(q0,{control:$.control,name:e,rules:i,defaultValue:r,shouldUnregister:s,render:({field:{value:_,onChange:T,ref:v}})=>f1(l1,{display:"flex",flexDirection:"column",children:[f1("div",{style:{display:"flex"},children:[o&&q(l1,{item:!0,children:q(B,{label:o,required:M})}),C&&q(l1,{item:!0,children:q(N0,{title:C,placement:"top",children:q("div",{style:{width:"fit-content"},children:q(j0,{icon:c1,color:"#757575"})})})})]}),f1(W0,m(a({open:H,onOpen:()=>x(!0),onClose:()=>x(!1),displayEmpty:!!b,variant:"outlined",autoComplete:"off",value:_?_||"":u?[]:"",renderValue:Z=>{if(Z.label)return Z.label;if(b)return q("p",{style:{color:k.grey[400]},children:b})},multiple:u,onChange:Z=>{!F&&T(Z.target.value),L&&L(Z.target.value,$.getValues())},error:!!D,size:P.size||"medium",inputRef:v},P),{children:[b&&q(W1,{disabled:!0,value:"",children:q("p",{style:{color:k.grey[400]},children:b})}),p==null?void 0:p.map((Z,y)=>q(W1,{value:Z,children:f1(l1,{container:!0,direction:"column",children:[q(l1,{item:!0,children:Z.label}),Z.afterLabel&&q(l1,{item:!0,children:Z.afterLabel})]})},y)),f&&[q(l1,{px:2,py:1,children:q(z0,{})},"footer-divider"),q("div",{children:f({closeSelect:()=>x(!1)})},"footer-content")]]}),e),q(R,{name:e,disableIcon:w})]})})},Q0=O0(K0);import{forwardRef as X0,memo as e2}from"react";import{Controller as c2,useFormContext as i2}from"react-hook-form";import{Grid as i1,Autocomplete as l2,TextField as a2}from"@mui/material";import{Divider as J1,LIcon as o2,Tooltip as r2}from"@s_mart/core";import{colorPalette as t2}from"@s_mart/tokens";import{Fragment as M1,jsx as U,jsxs as a1}from"react/jsx-runtime";import{createElement as K1}from"react";var n2=$=>{var k=$,{name:e,rules:i,defaultValue:r,shouldUnregister:s,label:o,required:M,options:p,textFieldProps:b,noOptionsText:F,footer:u,multiple:C,info:f,placeholder:L,onChange:w,onInputChange:P,disableIconError:O}=k,A=S(k,["name","rules","defaultValue","shouldUnregister","label","required","options","textFieldProps","noOptionsText","footer","multiple","info","placeholder","onChange","onInputChange","disableIconError"]);let H=i2();if(!H)throw new Error("Para usar o <Searchable /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let x=z(H.formState.errors,e);return console.warn=()=>{},U(c2,{control:H.control,name:e,rules:i,defaultValue:r,shouldUnregister:s,render:({field:{onChange:D,value:_,ref:T}})=>{var v;return a1(i1,{display:"flex",flexDirection:"column",children:[a1("div",{style:{display:"flex"},children:[o&&U(i1,{item:!0,children:U(B,{label:o,required:M})}),f&&U(i1,{item:!0,children:U(r2,{title:f,placement:"top",children:U("div",{style:{width:"fit-content"},children:U(o2,{icon:c1,color:"#757575"})})})})]}),U(l2,m(a({onChange:(Z,y)=>{D(y),w==null||w(y,H.getValues())},onInputChange:(Z,y,h)=>{h==="input"&&setTimeout(()=>{P==null||P(y,H.getValues())},0)},slotProps:m(a({},A.slotProps||{}),{paper:m(a({},(A.slotProps||{}).paper||{}),{sx:a({border:`1px solid ${t2.neutral[30]}`,boxShadow:"0px 2px 4px rgba(0, 0, 0, 0.15)"},((v=(A.slotProps||{}).paper)==null?void 0:v.sx)||{})})}),value:_||(C?[]:null),options:p,multiple:C,noOptionsText:a1(M1,{children:[F||"Nenhum resultado encontrado",u?a1(M1,{children:[U(i1,{py:1,children:U(J1,{})}),u]}):null]}),isOptionEqualToValue:(Z,y)=>typeof Z=="string"&&typeof y=="string"?Z===y:typeof Z=="object"&&typeof y=="object"?typeof Z.value=="object"&&typeof y.value=="object"&&Z.key!==void 0&&y.key!==void 0?Z.key===y.key:Z.value===y.value:!1,renderOption:(Z,y)=>typeof y=="object"?K1("li",m(a({},Z),{key:y.key||y.value}),a1(i1,{container:!0,direction:"column",children:[U(i1,{item:!0,children:y.label}),y.afterLabel&&U(i1,{item:!0,children:y.afterLabel})]})):K1("li",m(a({},Z),{key:y}),y),ListboxComponent:X0(function(y,h){return a1(M1,{children:[U("ul",m(a({},y),{ref:h})),!!u&&U("div",m(a({},y),{children:a1(M1,{children:[U(i1,{px:2,py:1,children:U(J1,{})}),u]})}),"searchable-footer")]})})},A),{renderInput:Z=>U(a2,m(a(a({error:!!x,placeholder:L},Z),b),{inputRef:T}))}),e),U(R,{name:e,disableIcon:O})]})}})},s2=e2(n2);import{forwardRef as m2,memo as v2}from"react";import{Controller as p2,useFormContext as Z2}from"react-hook-form";import{isObject as u2,isEmpty as f2}from"lodash";import{Grid as o1,Autocomplete as M2,TextField as H2}from"@mui/material";import{LIcon as V1,Tooltip as V2,Button as y2,Divider as g2}from"@s_mart/core";import{colorPalette as x2}from"@s_mart/tokens";import{toRem as c0}from"@s_mart/utils";import{toRem as H1}from"@s_mart/utils";import h2 from"@emotion/styled";import{css as Q1}from"@emotion/react";var X1=Q1`
1
+ var m0=Object.create;var L1=Object.defineProperty,v0=Object.defineProperties,p0=Object.getOwnPropertyDescriptor,Z0=Object.getOwnPropertyDescriptors,u0=Object.getOwnPropertyNames,u1=Object.getOwnPropertySymbols,f0=Object.getPrototypeOf,F1=Object.prototype.hasOwnProperty,E1=Object.prototype.propertyIsEnumerable;var I1=(e,i,r)=>i in e?L1(e,i,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[i]=r,a=(e,i)=>{for(var r in i||(i={}))F1.call(i,r)&&I1(e,r,i[r]);if(u1)for(var r of u1(i))E1.call(i,r)&&I1(e,r,i[r]);return e},m=(e,i)=>v0(e,Z0(i));var S=(e,i)=>{var r={};for(var s in e)F1.call(e,s)&&i.indexOf(s)<0&&(r[s]=e[s]);if(e!=null&&u1)for(var s of u1(e))i.indexOf(s)<0&&E1.call(e,s)&&(r[s]=e[s]);return r};var G1=(e,i)=>()=>(i||e((i={exports:{}}).exports,i),i.exports);var M0=(e,i,r,s)=>{if(i&&typeof i=="object"||typeof i=="function")for(let o of u0(i))!F1.call(e,o)&&o!==r&&L1(e,o,{get:()=>i[o],enumerable:!(s=p0(i,o))||s.enumerable});return e};var B1=(e,i,r)=>(r=e!=null?m0(f0(e)):{},M0(i||!e||!e.__esModule?L1(r,"default",{value:e,enumerable:!0}):r,e));var a0=G1(($1,A1)=>{(function(e,i){typeof $1=="object"&&typeof A1!="undefined"?A1.exports=i():typeof define=="function"&&define.amd?define(i):(e=typeof globalThis!="undefined"?globalThis:e||self).dayjs=i()})($1,function(){"use strict";var e=1e3,i=6e4,r=36e5,s="millisecond",o="second",M="minute",p="hour",b="day",F="week",u="month",C="quarter",f="year",L="date",w="Invalid Date",P=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,O=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,A={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(h){var c=["th","st","nd","rd"],l=h%100;return"["+h+(c[(l-20)%10]||c[l]||c[0])+"]"}},$=function(h,c,l){var V=String(h);return!V||V.length>=c?h:""+Array(c+1-V.length).join(l)+h},k={s:$,z:function(h){var c=-h.utcOffset(),l=Math.abs(c),V=Math.floor(l/60),t=l%60;return(c<=0?"+":"-")+$(V,2,"0")+":"+$(t,2,"0")},m:function h(c,l){if(c.date()<l.date())return-h(l,c);var V=12*(l.year()-c.year())+(l.month()-c.month()),t=c.clone().add(V,u),g=l-t<0,n=c.clone().add(V+(g?-1:1),u);return+(-(V+(l-t)/(g?t-n:n-t))||0)},a:function(h){return h<0?Math.ceil(h)||0:Math.floor(h)},p:function(h){return{M:u,y:f,w:F,d:b,D:L,h:p,m:M,s:o,ms:s,Q:C}[h]||String(h||"").toLowerCase().replace(/s$/,"")},u:function(h){return h===void 0}},H="en",x={};x[H]=A;var D=function(h){return h instanceof Z},_=function h(c,l,V){var t;if(!c)return H;if(typeof c=="string"){var g=c.toLowerCase();x[g]&&(t=g),l&&(x[g]=l,t=g);var n=c.split("-");if(!t&&n.length>1)return h(n[0])}else{var d=c.name;x[d]=c,t=d}return!V&&t&&(H=t),t||!V&&H},T=function(h,c){if(D(h))return h.clone();var l=typeof c=="object"?c:{};return l.date=h,l.args=arguments,new Z(l)},v=k;v.l=_,v.i=D,v.w=function(h,c){return T(h,{locale:c.$L,utc:c.$u,x:c.$x,$offset:c.$offset})};var Z=function(){function h(l){this.$L=_(l.locale,null,!0),this.parse(l)}var c=h.prototype;return c.parse=function(l){this.$d=function(V){var t=V.date,g=V.utc;if(t===null)return new Date(NaN);if(v.u(t))return new Date;if(t instanceof Date)return new Date(t);if(typeof t=="string"&&!/Z$/i.test(t)){var n=t.match(P);if(n){var d=n[2]-1||0,I=(n[7]||"0").substring(0,3);return g?new Date(Date.UTC(n[1],d,n[3]||1,n[4]||0,n[5]||0,n[6]||0,I)):new Date(n[1],d,n[3]||1,n[4]||0,n[5]||0,n[6]||0,I)}}return new Date(t)}(l),this.$x=l.x||{},this.init()},c.init=function(){var l=this.$d;this.$y=l.getFullYear(),this.$M=l.getMonth(),this.$D=l.getDate(),this.$W=l.getDay(),this.$H=l.getHours(),this.$m=l.getMinutes(),this.$s=l.getSeconds(),this.$ms=l.getMilliseconds()},c.$utils=function(){return v},c.isValid=function(){return this.$d.toString()!==w},c.isSame=function(l,V){var t=T(l);return this.startOf(V)<=t&&t<=this.endOf(V)},c.isAfter=function(l,V){return T(l)<this.startOf(V)},c.isBefore=function(l,V){return this.endOf(V)<T(l)},c.$g=function(l,V,t){return v.u(l)?this[V]:this.set(t,l)},c.unix=function(){return Math.floor(this.valueOf()/1e3)},c.valueOf=function(){return this.$d.getTime()},c.startOf=function(l,V){var t=this,g=!!v.u(V)||V,n=v.p(l),d=function(t1,j){var e1=v.w(t.$u?Date.UTC(t.$y,j,t1):new Date(t.$y,j,t1),t);return g?e1:e1.endOf(b)},I=function(t1,j){return v.w(t.toDate()[t1].apply(t.toDate("s"),(g?[0,0,0,0]:[23,59,59,999]).slice(j)),t)},G=this.$W,Y=this.$M,X=this.$D,Q="set"+(this.$u?"UTC":"");switch(n){case f:return g?d(1,0):d(31,11);case u:return g?d(1,Y):d(0,Y+1);case F:var h1=this.$locale().weekStart||0,d1=(G<h1?G+7:G)-h1;return d(g?X-d1:X+(6-d1),Y);case b:case L:return I(Q+"Hours",0);case p:return I(Q+"Minutes",1);case M:return I(Q+"Seconds",2);case o:return I(Q+"Milliseconds",3);default:return this.clone()}},c.endOf=function(l){return this.startOf(l,!1)},c.$set=function(l,V){var t,g=v.p(l),n="set"+(this.$u?"UTC":""),d=(t={},t[b]=n+"Date",t[L]=n+"Date",t[u]=n+"Month",t[f]=n+"FullYear",t[p]=n+"Hours",t[M]=n+"Minutes",t[o]=n+"Seconds",t[s]=n+"Milliseconds",t)[g],I=g===b?this.$D+(V-this.$W):V;if(g===u||g===f){var G=this.clone().set(L,1);G.$d[d](I),G.init(),this.$d=G.set(L,Math.min(this.$D,G.daysInMonth())).$d}else d&&this.$d[d](I);return this.init(),this},c.set=function(l,V){return this.clone().$set(l,V)},c.get=function(l){return this[v.p(l)]()},c.add=function(l,V){var t,g=this;l=Number(l);var n=v.p(V),d=function(Y){var X=T(g);return v.w(X.date(X.date()+Math.round(Y*l)),g)};if(n===u)return this.set(u,this.$M+l);if(n===f)return this.set(f,this.$y+l);if(n===b)return d(1);if(n===F)return d(7);var I=(t={},t[M]=i,t[p]=r,t[o]=e,t)[n]||1,G=this.$d.getTime()+l*I;return v.w(G,this)},c.subtract=function(l,V){return this.add(-1*l,V)},c.format=function(l){var V=this,t=this.$locale();if(!this.isValid())return t.invalidDate||w;var g=l||"YYYY-MM-DDTHH:mm:ssZ",n=v.z(this),d=this.$H,I=this.$m,G=this.$M,Y=t.weekdays,X=t.months,Q=function(j,e1,b1,Z1){return j&&(j[e1]||j(V,g))||b1[e1].slice(0,Z1)},h1=function(j){return v.s(d%12||12,j,"0")},d1=t.meridiem||function(j,e1,b1){var Z1=j<12?"AM":"PM";return b1?Z1.toLowerCase():Z1},t1={YY:String(this.$y).slice(-2),YYYY:this.$y,M:G+1,MM:v.s(G+1,2,"0"),MMM:Q(t.monthsShort,G,X,3),MMMM:Q(X,G),D:this.$D,DD:v.s(this.$D,2,"0"),d:String(this.$W),dd:Q(t.weekdaysMin,this.$W,Y,2),ddd:Q(t.weekdaysShort,this.$W,Y,3),dddd:Y[this.$W],H:String(d),HH:v.s(d,2,"0"),h:h1(1),hh:h1(2),a:d1(d,I,!0),A:d1(d,I,!1),m:String(I),mm:v.s(I,2,"0"),s:String(this.$s),ss:v.s(this.$s,2,"0"),SSS:v.s(this.$ms,3,"0"),Z:n};return g.replace(O,function(j,e1){return e1||t1[j]||n.replace(":","")})},c.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},c.diff=function(l,V,t){var g,n=v.p(V),d=T(l),I=(d.utcOffset()-this.utcOffset())*i,G=this-d,Y=v.m(this,d);return Y=(g={},g[f]=Y/12,g[u]=Y,g[C]=Y/3,g[F]=(G-I)/6048e5,g[b]=(G-I)/864e5,g[p]=G/r,g[M]=G/i,g[o]=G/e,g)[n]||G,t?Y:v.a(Y)},c.daysInMonth=function(){return this.endOf(u).$D},c.$locale=function(){return x[this.$L]},c.locale=function(l,V){if(!l)return this.$L;var t=this.clone(),g=_(l,V,!0);return g&&(t.$L=g),t},c.clone=function(){return v.w(this.$d,this)},c.toDate=function(){return new Date(this.valueOf())},c.toJSON=function(){return this.isValid()?this.toISOString():null},c.toISOString=function(){return this.$d.toISOString()},c.toString=function(){return this.$d.toUTCString()},h}(),y=Z.prototype;return T.prototype=y,[["$ms",s],["$s",o],["$m",M],["$H",p],["$W",b],["$M",u],["$y",f],["$D",L]].forEach(function(h){y[h[1]]=function(c){return this.$g(c,h[0],h[1])}}),T.extend=function(h,c){return h.$i||(h(c,Z,T),h.$i=!0),T},T.locale=_,T.isDayjs=D,T.unix=function(h){return T(1e3*h)},T.en=x[H],T.Ls=x,T.p={},T})});var _1=G1((T1,D1)=>{(function(e,i){typeof T1=="object"&&typeof D1!="undefined"?D1.exports=i(a0()):typeof define=="function"&&define.amd?define(["dayjs"],i):(e=typeof globalThis!="undefined"?globalThis:e||self).dayjs_locale_pt_br=i(e.dayjs)})(T1,function(e){"use strict";function i(o){return o&&typeof o=="object"&&"default"in o?o:{default:o}}var r=i(e),s={name:"pt-br",weekdays:"domingo_segunda-feira_ter\xE7a-feira_quarta-feira_quinta-feira_sexta-feira_s\xE1bado".split("_"),weekdaysShort:"dom_seg_ter_qua_qui_sex_s\xE1b".split("_"),weekdaysMin:"Do_2\xAA_3\xAA_4\xAA_5\xAA_6\xAA_S\xE1".split("_"),months:"janeiro_fevereiro_mar\xE7o_abril_maio_junho_julho_agosto_setembro_outubro_novembro_dezembro".split("_"),monthsShort:"jan_fev_mar_abr_mai_jun_jul_ago_set_out_nov_dez".split("_"),ordinal:function(o){return o+"\xBA"},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY [\xE0s] HH:mm",LLLL:"dddd, D [de] MMMM [de] YYYY [\xE0s] HH:mm"},relativeTime:{future:"em %s",past:"h\xE1 %s",s:"poucos segundos",m:"um minuto",mm:"%d minutos",h:"uma hora",hh:"%d horas",d:"um dia",dd:"%d dias",M:"um m\xEAs",MM:"%d meses",y:"um ano",yy:"%d anos"}};return r.default.locale(s,null,!0),s})});import{FormProvider as H0}from"react-hook-form";import{jsx as R1}from"react/jsx-runtime";var V0=o=>{var M=o,{children:e,style:i,onSubmit:r}=M,s=S(M,["children","style","onSubmit"]);return R1(H0,m(a({},s),{children:R1("form",{onSubmit:p=>{p.preventDefault(),p.stopPropagation(),r(p)},style:i,children:e})}))},P1=V0;import{useEffect as y0}from"react";import{useForm as g0}from"react-hook-form";import{zodResolver as x0}from"@hookform/resolvers/zod";var b0=s=>{var o=s,{disableDefaultValuesUpdate:e,onSubmit:i}=o,r=S(o,["disableDefaultValuesUpdate","onSubmit"]);let M=g0(m(a({},r),{resolver:r.schema&&x0(r.schema)}));return y0(()=>{e||M.reset(r.defaultValues)},[r.defaultValues,M.reset]),m(a({},M),{onSubmit:M.handleSubmit(p=>i(p,M))})},C1=b0;import{jsx as P0}from"react/jsx-runtime";function L0(s){var o=s,{children:e,style:i}=o,r=S(o,["children","style"]);let M=C1(r);return P0(P1,m(a({},M),{style:i,children:typeof e=="function"?e(M):e}))}var F0=L0;import{memo as A0,useState as T0}from"react";import{Controller as D0,useFormContext as _0}from"react-hook-form";import{Grid as S1,InputAdornment as I0,TextField as E0}from"@mui/material";var O1={description:"M39 23.1a17 17 0 0 0-15-10c-6.5.1-12.4 4-15.2 10V25a17 17 0 0 0 15 10A17 17 0 0 0 39 25c.5-.7.5-1.3.2-1.8Zm-15 9a8 8 0 0 1-7.6-8.5c.2-4.2 3.5-7.8 7.6-7.8a8 8 0 0 1 7.6 8.4c-.1 4.3-3.5 7.9-7.6 7.9Zm0-13.5-1.3.1c.7 1.1.6 2.6-.3 3.7-1 .9-2.3.9-3.4.1-.4 2.2.3 4.7 2.1 6a4.9 4.9 0 0 0 6-.2c1.6-1.4 2.4-4 1.6-6.1a4.9 4.9 0 0 0-4.7-3.6Z",id:"line-eye-solid"},U1={description:"M24 31.7c-4 0-7.4-3.1-7.7-7.1l-5.6-4.4c-.8 1-1.4 2-2 3a1.7 1.7 0 0 0 0 1.6 17.2 17.2 0 0 0 19.5 9l-2.8-2.2-1.4.1ZM40.9 35l-6-4.6c1.8-1.5 3.3-3.4 4.4-5.5a1.7 1.7 0 0 0 0-1.6c-3-5.7-8.7-9.5-15.3-9.5-2.8 0-5.5.7-8 2l-6.8-5.3a.9.9 0 0 0-1.2.2L7 12a.9.9 0 0 0 .1 1.2l31.7 24.5a.9.9 0 0 0 1.2-.2l1-1.3a.9.9 0 0 0-.1-1.2Zm-10-7.7-2-1.6a5 5 0 0 0-6.3-6.6 2.5 2.5 0 0 1 .4 2l-3.9-3a7.7 7.7 0 0 1 10.4.5 7.7 7.7 0 0 1 1.5 8.7Z",id:"line-eye-slash-solid"};var c1={description:"M24 8a16 16 0 0 0 0 32 16 16 0 0 0 0-32Zm0 7.1c1.5 0 2.7 1.2 2.7 2.7 0 1.6-1.2 2.7-2.7 2.7a2.6 2.6 0 0 1-2.7-2.7c0-1.5 1.2-2.7 2.7-2.7Zm3.6 16.4c0 .4-.4.8-.8.8h-5.6a.7.7 0 0 1-.8-.8v-1.6c0-.4.3-.7.8-.7h.7V25h-.7a.7.7 0 0 1-.8-.7v-1.6c0-.4.3-.8.8-.8h4c.5 0 .9.4.9.8v6.5h.7c.4 0 .8.3.8.7v1.6Z",id:"line-info-circle-solid"};var q1={description:"m25.5 17 5.5 5.5-12 12-4.9.5a1 1 0 0 1-1-1.1l.5-5L25.5 17Zm8.9-.8-2.6-2.6a2 2 0 0 0-2.9 0L26.5 16l5.5 5.5 2.4-2.4a2 2 0 0 0 0-3Z",id:"line-pen-solid"};var k1={description:"M35.8 21.8h-9.6v-9.6c0-.6-.6-1.1-1.1-1.1h-2.2a1 1 0 0 0-1 1v9.7h-9.7c-.6 0-1.1.6-1.1 1.1v2.2c0 .6.5 1 1 1h9.7v9.7c0 .6.5 1.1 1.1 1.1h2.2c.5 0 1-.5 1-1v-9.7h9.7c.6 0 1.1-.5 1.1-1.1v-2.2c0-.5-.5-1-1-1Z",id:"line-plus-solid"};import*as n1 from"@s_mart/masks";import{Typography as Y1}from"@mui/material";import{toRem as C0}from"@s_mart/utils";import{jsx as z1,jsxs as k0}from"react/jsx-runtime";var B=({label:e,required:i,regular:r})=>k0("span",{style:{display:"flex",alignItems:"center",gap:C0(2)},children:[z1(Y1,{variant:"caption",fontWeight:r?400:700,style:{display:"flex",alignItems:"center"},children:e}),i&&z1(Y1,{variant:"caption",fontWeight:900,color:"error",children:"*"})]});import{useFormContext as S0}from"react-hook-form";import{Indicator as w0}from"@s_mart/core";var z=(e,i)=>{var r,s,o,M,p;if(e[i])return e[i];if(i.includes("[")){let[b,F]=i.split("["),[u,C]=F.split("].");return(s=(r=e[b])==null?void 0:r[u])==null?void 0:s[C]}if(i.includes(".")){let[b,F,u]=i.split(".");return u?(p=(M=e[b])==null?void 0:M[F])==null?void 0:p[u]:(o=e[b])==null?void 0:o[F]}};import{jsx as $0}from"react/jsx-runtime";var R=({name:e,disableIcon:i})=>{var o;let r=S0(),s=z((o=r==null?void 0:r.formState)==null?void 0:o.errors,e);return s?$0(w0,{severity:"error",icon:i?!1:void 0,children:s==null?void 0:s.message}):null};import{LIcon as j1,Tooltip as G0}from"@s_mart/core";import{jsx as N,jsxs as N1}from"react/jsx-runtime";var B0=O=>{var A=O,{name:e,rules:i,defaultValue:r,shouldUnregister:s,label:o,required:M,mask:p,variant:b="outlined",info:F,parse:u,inputMode:C,format:f,onInputChange:L,disableIconError:w}=A,P=S(A,["name","rules","defaultValue","shouldUnregister","label","required","mask","variant","info","parse","inputMode","format","onInputChange","disableIconError"]);let $=_0();if(!$)throw new Error("Para usar o <TextField /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let[k,H]=T0(!1),x=v=>{var y;let Z=v;return f&&(Z=f(v)),p?(y=n1==null?void 0:n1[p])==null?void 0:y.format(Z):Z},D=v=>{var y;let Z=v;return u&&(Z=u(v)),p?(y=n1==null?void 0:n1[p])==null?void 0:y.parse(Z):Z},_=v=>{if(!v||p!=="porcentagem"&&p!=="porcentagem0")return;v==null||v.stopPropagation();let Z=(v==null?void 0:v.target).value;if(Z){let y=String(Z);if(y.length>0){let h=y.indexOf("%");h>-1&&(v.currentTarget.selectionEnd=h)}}},T=z($.formState.errors,e);return N(D0,{control:$.control,name:e,rules:i,defaultValue:r,shouldUnregister:s,render:({field:{value:v,onChange:Z,ref:y}})=>N1(S1,{display:"flex",flexDirection:"column",children:[N1("div",{style:{display:"flex"},children:[o&&N(S1,{item:!0,children:N(B,{label:o,required:M})}),F&&N(S1,{item:!0,children:N(G0,{title:F,placement:"top",children:N("div",{style:{width:"fit-content"},children:N(j1,{icon:c1,color:"#757575"})})})})]}),N(E0,m(a({variant:b,defaultValue:r,value:x(v||""),onChange:h=>{var l;let c=D((l=h==null?void 0:h.target)==null?void 0:l.value);Z(c),L==null||L(c,$.getValues())},error:!!T},P),{type:P.type==="password"?k?"text":"password":P.type,autoComplete:P.autoComplete||"off",inputProps:a({inputMode:C},P.inputProps),InputProps:a({onKeyDown:_,inputRef:y,endAdornment:P.type==="password"&&N(I0,{position:"start",onClick:()=>H(!k),style:{cursor:"pointer"},children:N(j1,{icon:k?O1:U1,size:"24px",removeMargin:!0})})},P.InputProps)}),e),N(R,{name:e,disableIcon:w})]})})},R0=A0(B0);import{memo as O0,useState as U0}from"react";import{Controller as q0,useFormContext as Y0}from"react-hook-form";import{Divider as z0,LIcon as j0,Tooltip as N0}from"@s_mart/core";import{Grid as l1,Select as W0,MenuItem as W1,useTheme as J0}from"@mui/material";import{jsx as q,jsxs as f1}from"react/jsx-runtime";var K0=O=>{var A=O,{name:e,rules:i,defaultValue:r,shouldUnregister:s,label:o,required:M,options:p,placeholder:b,disableOnChangeForm:F=!1,multiple:u,info:C,footer:f,onChange:L,disableIconError:w}=A,P=S(A,["name","rules","defaultValue","shouldUnregister","label","required","options","placeholder","disableOnChangeForm","multiple","info","footer","onChange","disableIconError"]);let $=Y0(),{palette:k}=J0(),[H,x]=U0(!1);if(!$)throw new Error("Para usar o <Select /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let D=z($.formState.errors,e);return console.warn=()=>{},q(q0,{control:$.control,name:e,rules:i,defaultValue:r,shouldUnregister:s,render:({field:{value:_,onChange:T,ref:v}})=>f1(l1,{display:"flex",flexDirection:"column",children:[f1("div",{style:{display:"flex"},children:[o&&q(l1,{item:!0,children:q(B,{label:o,required:M})}),C&&q(l1,{item:!0,children:q(N0,{title:C,placement:"top",children:q("div",{style:{width:"fit-content"},children:q(j0,{icon:c1,color:"#757575"})})})})]}),f1(W0,m(a({open:H,onOpen:()=>x(!0),onClose:()=>x(!1),displayEmpty:!!b,variant:"outlined",autoComplete:"off",value:_?_||"":u?[]:"",renderValue:Z=>{if(Z.label)return Z.label;if(b)return q("p",{style:{color:k.grey[400]},children:b})},multiple:u,onChange:Z=>{!F&&T(Z.target.value),L&&L(Z.target.value,$.getValues())},error:!!D,size:P.size||"medium",inputRef:v},P),{children:[b&&q(W1,{disabled:!0,value:"",children:q("p",{style:{color:k.grey[400]},children:b})}),p==null?void 0:p.map((Z,y)=>q(W1,{value:Z,children:f1(l1,{container:!0,direction:"column",children:[q(l1,{item:!0,children:Z.label}),Z.afterLabel&&q(l1,{item:!0,children:Z.afterLabel})]})},y)),f&&[q(l1,{px:2,py:1,children:q(z0,{})},"footer-divider"),q("div",{children:f({closeSelect:()=>x(!1)})},"footer-content")]]}),e),q(R,{name:e,disableIcon:w})]})})},Q0=O0(K0);import{forwardRef as X0,memo as e2}from"react";import{Controller as c2,useFormContext as i2}from"react-hook-form";import{Grid as i1,Autocomplete as l2,TextField as a2}from"@mui/material";import{Divider as J1,LIcon as o2,Tooltip as r2}from"@s_mart/core";import{colorPalette as t2}from"@s_mart/tokens";import{Fragment as M1,jsx as U,jsxs as a1}from"react/jsx-runtime";import{createElement as K1}from"react";var n2=$=>{var k=$,{name:e,rules:i,defaultValue:r,shouldUnregister:s,label:o,required:M,options:p,textFieldProps:b,noOptionsText:F,footer:u,multiple:C,info:f,placeholder:L,onChange:w,onInputChange:P,disableIconError:O}=k,A=S(k,["name","rules","defaultValue","shouldUnregister","label","required","options","textFieldProps","noOptionsText","footer","multiple","info","placeholder","onChange","onInputChange","disableIconError"]);let H=i2();if(!H)throw new Error("Para usar o <Searchable /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let x=z(H.formState.errors,e);return console.warn=()=>{},U(c2,{control:H.control,name:e,rules:i,defaultValue:r,shouldUnregister:s,render:({field:{onChange:D,value:_,ref:T}})=>{var v;return a1(i1,{display:"flex",flexDirection:"column",children:[a1("div",{style:{display:"flex"},children:[o&&U(i1,{item:!0,children:U(B,{label:o,required:M})}),f&&U(i1,{item:!0,children:U(r2,{title:f,placement:"top",children:U("div",{style:{width:"fit-content"},children:U(o2,{icon:c1,color:"#757575"})})})})]}),U(l2,m(a({onChange:(Z,y)=>{D(y),w==null||w(y,H.getValues())},onInputChange:(Z,y,h)=>{h==="input"&&setTimeout(()=>{P==null||P(y,H.getValues())},0)},slotProps:m(a({},A.slotProps||{}),{paper:m(a({},(A.slotProps||{}).paper||{}),{sx:a({border:`1px solid ${t2.neutral[30]}`,boxShadow:"0px 2px 4px rgba(0, 0, 0, 0.15)"},((v=(A.slotProps||{}).paper)==null?void 0:v.sx)||{})})}),value:_||(C?[]:null),options:p,multiple:C,noOptionsText:a1(M1,{children:[F||"Nenhum resultado encontrado",u?a1(M1,{children:[U(i1,{py:1,children:U(J1,{})}),u]}):null]}),isOptionEqualToValue:(Z,y)=>typeof Z=="string"&&typeof y=="string"?Z===y:typeof Z=="object"&&typeof y=="object"?typeof Z.value=="object"&&typeof y.value=="object"&&Z.key!==void 0&&y.key!==void 0?Z.key===y.key:Z.value===y.value:!1,renderOption:(Z,y)=>typeof y=="object"?K1("li",m(a({},Z),{key:y.key||y.value}),a1(i1,{container:!0,direction:"column",children:[U(i1,{item:!0,children:y.label}),y.afterLabel&&U(i1,{item:!0,children:y.afterLabel})]})):K1("li",m(a({},Z),{key:y}),y),ListboxComponent:X0(function(y,h){return a1(M1,{children:[U("ul",m(a({},y),{ref:h})),!!u&&U("div",m(a({},y),{children:a1(M1,{children:[U(i1,{px:2,py:1,children:U(J1,{})}),u]})}),"searchable-footer")]})})},A),{renderInput:Z=>U(a2,m(a(a({error:!!x,placeholder:L},Z),b),{inputRef:T}))}),e),U(R,{name:e,disableIcon:O})]})}})},s2=e2(n2);import{forwardRef as m2,memo as v2}from"react";import{Controller as p2,useFormContext as Z2}from"react-hook-form";import{isObject as u2,isEmpty as f2}from"lodash";import{Grid as o1,Autocomplete as M2,TextField as H2}from"@mui/material";import{LIcon as V1,Tooltip as V2,Button as y2,Divider as g2}from"@s_mart/core";import{colorPalette as x2}from"@s_mart/tokens";import{toRem as c0}from"@s_mart/utils";import{toRem as H1}from"@s_mart/utils";import h2 from"@emotion/styled";import{css as Q1}from"@emotion/react";var X1=Q1`
2
2
  display: flex;
3
3
  align-items: center;
4
4
  justify-content: center;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@s_mart/form",
3
- "version": "3.5.0",
3
+ "version": "3.5.1",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./dist/index.mjs",
6
6
  "types": "./dist/index.d.ts",