@s_mart/form 3.4.0 → 3.4.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 +1 -1
- package/dist/index.mjs +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var y0=Object.create;var C1=Object.defineProperty,C0=Object.defineProperties,g0=Object.getOwnPropertyDescriptor,x0=Object.getOwnPropertyDescriptors,L0=Object.getOwnPropertyNames,w1=Object.getOwnPropertySymbols,b0=Object.getPrototypeOf,X1=Object.prototype.hasOwnProperty,p2=Object.prototype.propertyIsEnumerable;var v2=(e,c,l)=>c in e?C1(e,c,{enumerable:!0,configurable:!0,writable:!0,value:l}):e[c]=l,o=(e,c)=>{for(var l in c||(c={}))X1.call(c,l)&&v2(e,l,c[l]);if(w1)for(var l of w1(c))p2.call(c,l)&&v2(e,l,c[l]);return e},v=(e,c)=>C0(e,x0(c));var $=(e,c)=>{var l={};for(var m in e)X1.call(e,m)&&c.indexOf(m)<0&&(l[m]=e[m]);if(e!=null&&w1)for(var m of w1(e))c.indexOf(m)<0&&p2.call(e,m)&&(l[m]=e[m]);return l};var Z2=(e,c)=>()=>(c||e((c={exports:{}}).exports,c),c.exports),F0=(e,c)=>{for(var l in c)C1(e,l,{get:c[l],enumerable:!0})},u2=(e,c,l,m)=>{if(c&&typeof c=="object"||typeof c=="function")for(let h of L0(c))!X1.call(e,h)&&h!==l&&C1(e,h,{get:()=>c[h],enumerable:!(m=g0(c,h))||m.enumerable});return e};var p1=(e,c,l)=>(l=e!=null?y0(b0(e)):{},u2(c||!e||!e.__esModule?C1(l,"default",{value:e,enumerable:!0}):l,e)),P0=e=>u2(C1({},"__esModule",{value:!0}),e);var Y2=Z2((n2,s2)=>{(function(e,c){typeof n2=="object"&&typeof s2!="undefined"?s2.exports=c():typeof define=="function"&&define.amd?define(c):(e=typeof globalThis!="undefined"?globalThis:e||self).dayjs=c()})(n2,function(){"use strict";var e=1e3,c=6e4,l=36e5,m="millisecond",h="second",M="minute",Z="hour",g="day",b="week",p="month",x="quarter",V="year",F="date",P="Invalid Date",B=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,D=/\[([^\]]+)]|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,T={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(t){var i=["th","st","nd","rd"],a=t%100;return"["+t+(i[(a-20)%10]||i[a]||i[0])+"]"}},k=function(t,i,a){var f=String(t);return!f||f.length>=i?t:""+Array(i+1-f.length).join(a)+t},y={s:k,z:function(t){var i=-t.utcOffset(),a=Math.abs(i),f=Math.floor(a/60),n=a%60;return(i<=0?"+":"-")+k(f,2,"0")+":"+k(n,2,"0")},m:function t(i,a){if(i.date()<a.date())return-t(a,i);var f=12*(a.year()-i.year())+(a.month()-i.month()),n=i.clone().add(f,p),d=a-n<0,s=i.clone().add(f+(d?-1:1),p);return+(-(f+(a-n)/(d?n-s:s-n))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(t){return{M:p,y:V,w:b,d:g,D:F,h:Z,m:M,s:h,ms:m,Q:x}[t]||String(t||"").toLowerCase().replace(/s$/,"")},u:function(t){return t===void 0}},L="en",A={};A[L]=T;var _=function(t){return t instanceof u},J=function t(i,a,f){var n;if(!i)return L;if(typeof i=="string"){var d=i.toLowerCase();A[d]&&(n=d),a&&(A[d]=a,n=d);var s=i.split("-");if(!n&&s.length>1)return t(s[0])}else{var S=i.name;A[S]=i,n=S}return!f&&n&&(L=n),n||!f&&L},H=function(t,i){if(_(t))return t.clone();var a=typeof i=="object"?i:{};return a.date=t,a.args=arguments,new u(a)},r=y;r.l=J,r.i=_,r.w=function(t,i){return H(t,{locale:i.$L,utc:i.$u,x:i.$x,$offset:i.$offset})};var u=function(){function t(a){this.$L=J(a.locale,null,!0),this.parse(a)}var i=t.prototype;return i.parse=function(a){this.$d=function(f){var n=f.date,d=f.utc;if(n===null)return new Date(NaN);if(r.u(n))return new Date;if(n instanceof Date)return new Date(n);if(typeof n=="string"&&!/Z$/i.test(n)){var s=n.match(B);if(s){var S=s[2]-1||0,R=(s[7]||"0").substring(0,3);return d?new Date(Date.UTC(s[1],S,s[3]||1,s[4]||0,s[5]||0,s[6]||0,R)):new Date(s[1],S,s[3]||1,s[4]||0,s[5]||0,s[6]||0,R)}}return new Date(n)}(a),this.$x=a.x||{},this.init()},i.init=function(){var a=this.$d;this.$y=a.getFullYear(),this.$M=a.getMonth(),this.$D=a.getDate(),this.$W=a.getDay(),this.$H=a.getHours(),this.$m=a.getMinutes(),this.$s=a.getSeconds(),this.$ms=a.getMilliseconds()},i.$utils=function(){return r},i.isValid=function(){return this.$d.toString()!==P},i.isSame=function(a,f){var n=H(a);return this.startOf(f)<=n&&n<=this.endOf(f)},i.isAfter=function(a,f){return H(a)<this.startOf(f)},i.isBefore=function(a,f){return this.endOf(f)<H(a)},i.$g=function(a,f,n){return r.u(a)?this[f]:this.set(n,a)},i.unix=function(){return Math.floor(this.valueOf()/1e3)},i.valueOf=function(){return this.$d.getTime()},i.startOf=function(a,f){var n=this,d=!!r.u(f)||f,s=r.p(a),S=function(v1,N){var o1=r.w(n.$u?Date.UTC(n.$y,N,v1):new Date(n.$y,N,v1),n);return d?o1:o1.endOf(g)},R=function(v1,N){return r.w(n.toDate()[v1].apply(n.toDate("s"),(d?[0,0,0,0]:[23,59,59,999]).slice(N)),n)},G=this.$W,U=this.$M,a1=this.$D,i1="set"+(this.$u?"UTC":"");switch(s){case V:return d?S(1,0):S(31,11);case p:return d?S(1,U):S(0,U+1);case b:var V1=this.$locale().weekStart||0,y1=(G<V1?G+7:G)-V1;return S(d?a1-y1:a1+(6-y1),U);case g:case F:return R(i1+"Hours",0);case Z:return R(i1+"Minutes",1);case M:return R(i1+"Seconds",2);case h:return R(i1+"Milliseconds",3);default:return this.clone()}},i.endOf=function(a){return this.startOf(a,!1)},i.$set=function(a,f){var n,d=r.p(a),s="set"+(this.$u?"UTC":""),S=(n={},n[g]=s+"Date",n[F]=s+"Date",n[p]=s+"Month",n[V]=s+"FullYear",n[Z]=s+"Hours",n[M]=s+"Minutes",n[h]=s+"Seconds",n[m]=s+"Milliseconds",n)[d],R=d===g?this.$D+(f-this.$W):f;if(d===p||d===V){var G=this.clone().set(F,1);G.$d[S](R),G.init(),this.$d=G.set(F,Math.min(this.$D,G.daysInMonth())).$d}else S&&this.$d[S](R);return this.init(),this},i.set=function(a,f){return this.clone().$set(a,f)},i.get=function(a){return this[r.p(a)]()},i.add=function(a,f){var n,d=this;a=Number(a);var s=r.p(f),S=function(U){var a1=H(d);return r.w(a1.date(a1.date()+Math.round(U*a)),d)};if(s===p)return this.set(p,this.$M+a);if(s===V)return this.set(V,this.$y+a);if(s===g)return S(1);if(s===b)return S(7);var R=(n={},n[M]=c,n[Z]=l,n[h]=e,n)[s]||1,G=this.$d.getTime()+a*R;return r.w(G,this)},i.subtract=function(a,f){return this.add(-1*a,f)},i.format=function(a){var f=this,n=this.$locale();if(!this.isValid())return n.invalidDate||P;var d=a||"YYYY-MM-DDTHH:mm:ssZ",s=r.z(this),S=this.$H,R=this.$m,G=this.$M,U=n.weekdays,a1=n.months,i1=function(N,o1,Q1,S1){return N&&(N[o1]||N(f,d))||Q1[o1].slice(0,S1)},V1=function(N){return r.s(S%12||12,N,"0")},y1=n.meridiem||function(N,o1,Q1){var S1=N<12?"AM":"PM";return Q1?S1.toLowerCase():S1},v1={YY:String(this.$y).slice(-2),YYYY:this.$y,M:G+1,MM:r.s(G+1,2,"0"),MMM:i1(n.monthsShort,G,a1,3),MMMM:i1(a1,G),D:this.$D,DD:r.s(this.$D,2,"0"),d:String(this.$W),dd:i1(n.weekdaysMin,this.$W,U,2),ddd:i1(n.weekdaysShort,this.$W,U,3),dddd:U[this.$W],H:String(S),HH:r.s(S,2,"0"),h:V1(1),hh:V1(2),a:y1(S,R,!0),A:y1(S,R,!1),m:String(R),mm:r.s(R,2,"0"),s:String(this.$s),ss:r.s(this.$s,2,"0"),SSS:r.s(this.$ms,3,"0"),Z:s};return d.replace(D,function(N,o1){return o1||v1[N]||s.replace(":","")})},i.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},i.diff=function(a,f,n){var d,s=r.p(f),S=H(a),R=(S.utcOffset()-this.utcOffset())*c,G=this-S,U=r.m(this,S);return U=(d={},d[V]=U/12,d[p]=U,d[x]=U/3,d[b]=(G-R)/6048e5,d[g]=(G-R)/864e5,d[Z]=G/l,d[M]=G/c,d[h]=G/e,d)[s]||G,n?U:r.a(U)},i.daysInMonth=function(){return this.endOf(p).$D},i.$locale=function(){return A[this.$L]},i.locale=function(a,f){if(!a)return this.$L;var n=this.clone(),d=J(a,f,!0);return d&&(n.$L=d),n},i.clone=function(){return r.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()},t}(),Y=u.prototype;return H.prototype=Y,[["$ms",m],["$s",h],["$m",M],["$H",Z],["$W",g],["$M",p],["$y",V],["$D",F]].forEach(function(t){Y[t[1]]=function(i){return this.$g(i,t[0],t[1])}}),H.extend=function(t,i){return t.$i||(t(i,u,H),t.$i=!0),H},H.locale=J,H.isDayjs=_,H.unix=function(t){return H(1e3*t)},H.en=A[L],H.Ls=A,H.p={},H})});var m2=Z2((h2,d2)=>{(function(e,c){typeof h2=="object"&&typeof d2!="undefined"?d2.exports=c(Y2()):typeof define=="function"&&define.amd?define(["dayjs"],c):(e=typeof globalThis!="undefined"?globalThis:e||self).dayjs_locale_pt_br=c(e.dayjs)})(h2,function(e){"use strict";function c(h){return h&&typeof h=="object"&&"default"in h?h:{default:h}}var l=c(e),m={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(h){return h+"\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 l.default.locale(m,null,!0),m})});var W0={};F0(W0,{Autocomplete:()=>H0,Checkbox:()=>I2,Creatable:()=>G2,DatePicker:()=>l0,Form:()=>y2,FormProvider:()=>$1,RadioButton:()=>R2,RadioGroup:()=>O2,Searchable:()=>A2,Select:()=>w2,Slider:()=>q2,Switch:()=>B2,TextField:()=>S2,TimePicker:()=>u0,useForm:()=>A1});module.exports=P0(W0);var f2=require("react-hook-form");var e2=require("react/jsx-runtime"),k0=h=>{var M=h,{children:e,style:c,onSubmit:l}=M,m=$(M,["children","style","onSubmit"]);return(0,e2.jsx)(f2.FormProvider,v(o({},m),{children:(0,e2.jsx)("form",{onSubmit:Z=>{Z.preventDefault(),Z.stopPropagation(),l(Z)},style:c,children:e})}))},$1=k0;var M2=require("react"),H2=require("react-hook-form"),V2=require("@hookform/resolvers/zod");var S0=m=>{var h=m,{disableDefaultValuesUpdate:e,onSubmit:c}=h,l=$(h,["disableDefaultValuesUpdate","onSubmit"]);let M=(0,H2.useForm)(v(o({},l),{resolver:l.schema&&(0,V2.zodResolver)(l.schema)}));return(0,M2.useEffect)(()=>{e||M.reset(l.defaultValues)},[l.defaultValues,M.reset]),v(o({},M),{onSubmit:M.handleSubmit(Z=>c(Z,M))})},A1=S0;var C2=require("react/jsx-runtime");function w0(m){var h=m,{children:e,style:c}=h,l=$(h,["children","style"]);let M=A1(l);return(0,C2.jsx)($1,v(o({},M),{style:c,children:typeof e=="function"?e(M):e}))}var y2=w0;var T1=require("react"),D1=require("react-hook-form"),t1=require("@mui/material");var g2={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"},x2={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 L2={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 c2={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 i2=require("@mui/material"),b2=require("@s_mart/utils"),g1=require("react/jsx-runtime"),I=({label:e,required:c,regular:l})=>(0,g1.jsxs)("span",{style:{display:"flex",alignItems:"center",gap:(0,b2.toRem)(2)},children:[(0,g1.jsx)(i2.Typography,{variant:"caption",fontWeight:l?400:700,style:{display:"flex",alignItems:"center"},children:e}),c&&(0,g1.jsx)(i2.Typography,{variant:"caption",fontWeight:900,color:"error",children:"*"})]});var F2=require("react-hook-form"),P2=require("@s_mart/core");var q=(e,c)=>{var l,m,h,M,Z;if(e[c])return e[c];if(c.includes("[")){let[g,b]=c.split("["),[p,x]=b.split("].");return(m=(l=e[g])==null?void 0:l[p])==null?void 0:m[x]}if(c.includes(".")){let[g,b,p]=c.split(".");return p?(Z=(M=e[g])==null?void 0:M[b])==null?void 0:Z[p]:(h=e[g])==null?void 0:h[b]}};var k2=require("react/jsx-runtime"),O=({name:e})=>{var m;let c=(0,F2.useFormContext)(),l=q((m=c==null?void 0:c.formState)==null?void 0:m.errors,e);return l?(0,k2.jsx)(P2.Indicator,{severity:"error",children:l==null?void 0:l.message}):null};var x1=require("@s_mart/core");var z=require("react/jsx-runtime"),$0=B=>{var D=B,{name:e,rules:c,defaultValue:l,shouldUnregister:m,label:h,required:M,mask:Z,variant:g="outlined",info:b,parse:p,inputMode:x,format:V,onInputChange:F}=D,P=$(D,["name","rules","defaultValue","shouldUnregister","label","required","mask","variant","info","parse","inputMode","format","onInputChange"]);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[k,y]=(0,T1.useState)(!1),L=H=>{var u;let r=H;return V&&(r=V(H)),Z?(u=Z1==null?void 0:Z1[Z])==null?void 0:u.format(r):r},A=H=>{var u;let r=H;return p&&(r=p(H)),Z?(u=Z1==null?void 0:Z1[Z])==null?void 0:u.parse(r):r},_=H=>{if(!H||Z!=="porcentagem")return;H==null||H.stopPropagation();let r=(H==null?void 0:H.target).value;if(r){let u=String(r);if(u.length>0){let Y=u.indexOf("%");Y>-1&&(H.currentTarget.selectionEnd=Y)}}},J=q(T.formState.errors,e);return(0,z.jsx)(D1.Controller,{control:T.control,name:e,rules:c,defaultValue:l,shouldUnregister:m,render:({field:{value:H,onChange:r,ref:u}})=>(0,z.jsxs)(t1.Grid,{display:"flex",flexDirection:"column",children:[(0,z.jsxs)("div",{style:{display:"flex"},children:[h&&(0,z.jsx)(t1.Grid,{item:!0,children:(0,z.jsx)(I,{label:h,required:M})}),b&&(0,z.jsx)(t1.Grid,{item:!0,children:(0,z.jsx)(x1.Tooltip,{title:b,placement:"top",children:(0,z.jsx)("div",{style:{width:"fit-content"},children:(0,z.jsx)(x1.LIcon,{icon:r1,color:"#757575"})})})})]}),(0,z.jsx)(t1.TextField,v(o({variant:g,defaultValue:l,value:L(H||""),onChange:Y=>{var i;let t=A((i=Y==null?void 0:Y.target)==null?void 0:i.value);r(t),F==null||F(t,T.getValues())},error:!!J},P),{type:P.type==="password"?k?"text":"password":P.type,autoComplete:P.autoComplete||"off",inputProps:o({inputMode:x},P.inputProps),InputProps:o({onKeyDown:_,inputRef:u,endAdornment:P.type==="password"&&(0,z.jsx)(t1.InputAdornment,{position:"start",onClick:()=>y(!k),style:{cursor:"pointer"},children:(0,z.jsx)(x1.LIcon,{icon:k?g2:x2,size:"24px",removeMargin:!0})})},P.InputProps)}),e),(0,z.jsx)(O,{name:e})]})})},S2=(0,T1.memo)($0);var _1=require("react"),E1=require("react-hook-form"),u1=require("@s_mart/core"),j=require("@mui/material");var E=require("react/jsx-runtime"),A0=B=>{var D=B,{name:e,rules:c,defaultValue:l,shouldUnregister:m,label:h,required:M,options:Z,placeholder:g,disableOnChangeForm:b=!1,multiple:p,info:x,footer:V,onChange:F}=D,P=$(D,["name","rules","defaultValue","shouldUnregister","label","required","options","placeholder","disableOnChangeForm","multiple","info","footer","onChange"]);let T=(0,E1.useFormContext)(),{palette:k}=(0,j.useTheme)(),[y,L]=(0,_1.useState)(!1);if(!T)throw new Error("Para usar o <Select /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let A=q(T.formState.errors,e);return console.warn=()=>{},(0,E.jsx)(E1.Controller,{control:T.control,name:e,rules:c,defaultValue:l,shouldUnregister:m,render:({field:{value:_,onChange:J,ref:H}})=>(0,E.jsxs)(j.Grid,{display:"flex",flexDirection:"column",children:[(0,E.jsxs)("div",{style:{display:"flex"},children:[h&&(0,E.jsx)(j.Grid,{item:!0,children:(0,E.jsx)(I,{label:h,required:M})}),x&&(0,E.jsx)(j.Grid,{item:!0,children:(0,E.jsx)(u1.Tooltip,{title:x,placement:"top",children:(0,E.jsx)("div",{style:{width:"fit-content"},children:(0,E.jsx)(u1.LIcon,{icon:r1,color:"#757575"})})})})]}),(0,E.jsxs)(j.Select,v(o({open:y,onOpen:()=>L(!0),onClose:()=>L(!1),displayEmpty:!!g,variant:"outlined",autoComplete:"off",value:_?_||"":p?[]:"",renderValue:r=>{if(r.label)return r.label;if(g)return(0,E.jsx)("p",{style:{color:k.grey[400]},children:g})},multiple:p,onChange:r=>{!b&&J(r.target.value),F&&F(r.target.value,T.getValues())},error:!!A,size:P.size||"medium",inputRef:H},P),{children:[g&&(0,E.jsx)(j.MenuItem,{disabled:!0,value:"",children:(0,E.jsx)("p",{style:{color:k.grey[400]},children:g})}),Z==null?void 0:Z.map((r,u)=>(0,E.jsx)(j.MenuItem,{value:r,children:(0,E.jsxs)(j.Grid,{container:!0,direction:"column",children:[(0,E.jsx)(j.Grid,{item:!0,children:r.label}),r.afterLabel&&(0,E.jsx)(j.Grid,{item:!0,children:r.afterLabel})]})},u)),V&&[(0,E.jsx)(j.Grid,{px:2,py:1,children:(0,E.jsx)(u1.Divider,{})},"footer-divider"),(0,E.jsx)("div",{children:V({closeSelect:()=>L(!1)})},"footer-content")]]}),e),(0,E.jsx)(O,{name:e})]})})},w2=(0,_1.memo)(A0);var G1=require("react"),I1=require("react-hook-form"),W=require("@mui/material"),d1=require("@s_mart/core");var $2=require("@s_mart/tokens");var w=require("react/jsx-runtime"),l2=require("react"),T0=T=>{var k=T,{name:e,rules:c,defaultValue:l,shouldUnregister:m,label:h,required:M,options:Z,textFieldProps:g,noOptionsText:b,footer:p,multiple:x,info:V,placeholder:F,onChange:P,onInputChange:B}=k,D=$(k,["name","rules","defaultValue","shouldUnregister","label","required","options","textFieldProps","noOptionsText","footer","multiple","info","placeholder","onChange","onInputChange"]);let y=(0,I1.useFormContext)();if(!y)throw new Error("Para usar o <Searchable /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let L=q(y.formState.errors,e);return console.warn=()=>{},(0,w.jsx)(I1.Controller,{control:y.control,name:e,rules:c,defaultValue:l,shouldUnregister:m,render:({field:{onChange:A,value:_,ref:J}})=>{var H;return(0,w.jsxs)(W.Grid,{display:"flex",flexDirection:"column",children:[(0,w.jsxs)("div",{style:{display:"flex"},children:[h&&(0,w.jsx)(W.Grid,{item:!0,children:(0,w.jsx)(I,{label:h,required:M})}),V&&(0,w.jsx)(W.Grid,{item:!0,children:(0,w.jsx)(d1.Tooltip,{title:V,placement:"top",children:(0,w.jsx)("div",{style:{width:"fit-content"},children:(0,w.jsx)(d1.LIcon,{icon:r1,color:"#757575"})})})})]}),(0,w.jsx)(W.Autocomplete,v(o({onChange:(r,u)=>{A(u),P==null||P(u,y.getValues())},onInputChange:(r,u,Y)=>{Y==="input"&&setTimeout(()=>{B==null||B(u,y.getValues())},0)},slotProps:v(o({},D.slotProps||{}),{paper:v(o({},(D.slotProps||{}).paper||{}),{sx:o({border:`1px solid ${$2.colorPalette.neutral[30]}`,boxShadow:"0px 2px 4px rgba(0, 0, 0, 0.15)"},((H=(D.slotProps||{}).paper)==null?void 0:H.sx)||{})})}),value:_||(x?[]:null),options:Z,multiple:x,noOptionsText:(0,w.jsxs)(w.Fragment,{children:[b||"Nenhum resultado encontrado",p?(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(W.Grid,{py:1,children:(0,w.jsx)(d1.Divider,{})}),p]}):null]}),isOptionEqualToValue:(r,u)=>typeof r=="string"&&typeof u=="string"?r===u:typeof r=="object"&&typeof u=="object"?typeof r.value=="object"&&typeof u.value=="object"&&r.key!==void 0&&u.key!==void 0?r.key===u.key:r.value===u.value:!1,renderOption:(r,u)=>typeof u=="object"?(0,l2.createElement)("li",v(o({},r),{key:u.key||u.value}),(0,w.jsxs)(W.Grid,{container:!0,direction:"column",children:[(0,w.jsx)(W.Grid,{item:!0,children:u.label}),u.afterLabel&&(0,w.jsx)(W.Grid,{item:!0,children:u.afterLabel})]})):(0,l2.createElement)("li",v(o({},r),{key:u}),u),ListboxComponent:(0,G1.forwardRef)(function(u,Y){return(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)("ul",v(o({},u),{ref:Y})),!!p&&(0,w.jsx)("div",v(o({},u),{children:(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(W.Grid,{px:2,py:1,children:(0,w.jsx)(d1.Divider,{})}),p]})}),"searchable-footer")]})})},D),{renderInput:r=>(0,w.jsx)(W.TextField,v(o(o({error:!!L,placeholder:F},r),g),{inputRef:J}))}),e),(0,w.jsx)(O,{name:e})]})}})},A2=(0,G1.memo)(T0);var B1=require("react"),R1=require("react-hook-form"),O1=require("lodash"),K=require("@mui/material"),Q=require("@s_mart/core"),E2=require("@s_mart/tokens");var o2=require("@s_mart/utils");var L1=require("@s_mart/utils"),T2=p1(require("@emotion/styled")),a2=require("@emotion/react"),D2=a2.css`
|
|
1
|
+
"use strict";var y0=Object.create;var C1=Object.defineProperty,C0=Object.defineProperties,g0=Object.getOwnPropertyDescriptor,x0=Object.getOwnPropertyDescriptors,L0=Object.getOwnPropertyNames,w1=Object.getOwnPropertySymbols,b0=Object.getPrototypeOf,X1=Object.prototype.hasOwnProperty,p2=Object.prototype.propertyIsEnumerable;var v2=(e,c,l)=>c in e?C1(e,c,{enumerable:!0,configurable:!0,writable:!0,value:l}):e[c]=l,o=(e,c)=>{for(var l in c||(c={}))X1.call(c,l)&&v2(e,l,c[l]);if(w1)for(var l of w1(c))p2.call(c,l)&&v2(e,l,c[l]);return e},v=(e,c)=>C0(e,x0(c));var $=(e,c)=>{var l={};for(var m in e)X1.call(e,m)&&c.indexOf(m)<0&&(l[m]=e[m]);if(e!=null&&w1)for(var m of w1(e))c.indexOf(m)<0&&p2.call(e,m)&&(l[m]=e[m]);return l};var Z2=(e,c)=>()=>(c||e((c={exports:{}}).exports,c),c.exports),F0=(e,c)=>{for(var l in c)C1(e,l,{get:c[l],enumerable:!0})},u2=(e,c,l,m)=>{if(c&&typeof c=="object"||typeof c=="function")for(let h of L0(c))!X1.call(e,h)&&h!==l&&C1(e,h,{get:()=>c[h],enumerable:!(m=g0(c,h))||m.enumerable});return e};var p1=(e,c,l)=>(l=e!=null?y0(b0(e)):{},u2(c||!e||!e.__esModule?C1(l,"default",{value:e,enumerable:!0}):l,e)),P0=e=>u2(C1({},"__esModule",{value:!0}),e);var Y2=Z2((n2,s2)=>{(function(e,c){typeof n2=="object"&&typeof s2!="undefined"?s2.exports=c():typeof define=="function"&&define.amd?define(c):(e=typeof globalThis!="undefined"?globalThis:e||self).dayjs=c()})(n2,function(){"use strict";var e=1e3,c=6e4,l=36e5,m="millisecond",h="second",M="minute",Z="hour",g="day",b="week",p="month",x="quarter",V="year",F="date",P="Invalid Date",B=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,D=/\[([^\]]+)]|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,T={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(t){var i=["th","st","nd","rd"],a=t%100;return"["+t+(i[(a-20)%10]||i[a]||i[0])+"]"}},k=function(t,i,a){var f=String(t);return!f||f.length>=i?t:""+Array(i+1-f.length).join(a)+t},y={s:k,z:function(t){var i=-t.utcOffset(),a=Math.abs(i),f=Math.floor(a/60),n=a%60;return(i<=0?"+":"-")+k(f,2,"0")+":"+k(n,2,"0")},m:function t(i,a){if(i.date()<a.date())return-t(a,i);var f=12*(a.year()-i.year())+(a.month()-i.month()),n=i.clone().add(f,p),d=a-n<0,s=i.clone().add(f+(d?-1:1),p);return+(-(f+(a-n)/(d?n-s:s-n))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(t){return{M:p,y:V,w:b,d:g,D:F,h:Z,m:M,s:h,ms:m,Q:x}[t]||String(t||"").toLowerCase().replace(/s$/,"")},u:function(t){return t===void 0}},L="en",A={};A[L]=T;var _=function(t){return t instanceof u},J=function t(i,a,f){var n;if(!i)return L;if(typeof i=="string"){var d=i.toLowerCase();A[d]&&(n=d),a&&(A[d]=a,n=d);var s=i.split("-");if(!n&&s.length>1)return t(s[0])}else{var S=i.name;A[S]=i,n=S}return!f&&n&&(L=n),n||!f&&L},H=function(t,i){if(_(t))return t.clone();var a=typeof i=="object"?i:{};return a.date=t,a.args=arguments,new u(a)},r=y;r.l=J,r.i=_,r.w=function(t,i){return H(t,{locale:i.$L,utc:i.$u,x:i.$x,$offset:i.$offset})};var u=function(){function t(a){this.$L=J(a.locale,null,!0),this.parse(a)}var i=t.prototype;return i.parse=function(a){this.$d=function(f){var n=f.date,d=f.utc;if(n===null)return new Date(NaN);if(r.u(n))return new Date;if(n instanceof Date)return new Date(n);if(typeof n=="string"&&!/Z$/i.test(n)){var s=n.match(B);if(s){var S=s[2]-1||0,R=(s[7]||"0").substring(0,3);return d?new Date(Date.UTC(s[1],S,s[3]||1,s[4]||0,s[5]||0,s[6]||0,R)):new Date(s[1],S,s[3]||1,s[4]||0,s[5]||0,s[6]||0,R)}}return new Date(n)}(a),this.$x=a.x||{},this.init()},i.init=function(){var a=this.$d;this.$y=a.getFullYear(),this.$M=a.getMonth(),this.$D=a.getDate(),this.$W=a.getDay(),this.$H=a.getHours(),this.$m=a.getMinutes(),this.$s=a.getSeconds(),this.$ms=a.getMilliseconds()},i.$utils=function(){return r},i.isValid=function(){return this.$d.toString()!==P},i.isSame=function(a,f){var n=H(a);return this.startOf(f)<=n&&n<=this.endOf(f)},i.isAfter=function(a,f){return H(a)<this.startOf(f)},i.isBefore=function(a,f){return this.endOf(f)<H(a)},i.$g=function(a,f,n){return r.u(a)?this[f]:this.set(n,a)},i.unix=function(){return Math.floor(this.valueOf()/1e3)},i.valueOf=function(){return this.$d.getTime()},i.startOf=function(a,f){var n=this,d=!!r.u(f)||f,s=r.p(a),S=function(v1,N){var o1=r.w(n.$u?Date.UTC(n.$y,N,v1):new Date(n.$y,N,v1),n);return d?o1:o1.endOf(g)},R=function(v1,N){return r.w(n.toDate()[v1].apply(n.toDate("s"),(d?[0,0,0,0]:[23,59,59,999]).slice(N)),n)},G=this.$W,U=this.$M,a1=this.$D,i1="set"+(this.$u?"UTC":"");switch(s){case V:return d?S(1,0):S(31,11);case p:return d?S(1,U):S(0,U+1);case b:var V1=this.$locale().weekStart||0,y1=(G<V1?G+7:G)-V1;return S(d?a1-y1:a1+(6-y1),U);case g:case F:return R(i1+"Hours",0);case Z:return R(i1+"Minutes",1);case M:return R(i1+"Seconds",2);case h:return R(i1+"Milliseconds",3);default:return this.clone()}},i.endOf=function(a){return this.startOf(a,!1)},i.$set=function(a,f){var n,d=r.p(a),s="set"+(this.$u?"UTC":""),S=(n={},n[g]=s+"Date",n[F]=s+"Date",n[p]=s+"Month",n[V]=s+"FullYear",n[Z]=s+"Hours",n[M]=s+"Minutes",n[h]=s+"Seconds",n[m]=s+"Milliseconds",n)[d],R=d===g?this.$D+(f-this.$W):f;if(d===p||d===V){var G=this.clone().set(F,1);G.$d[S](R),G.init(),this.$d=G.set(F,Math.min(this.$D,G.daysInMonth())).$d}else S&&this.$d[S](R);return this.init(),this},i.set=function(a,f){return this.clone().$set(a,f)},i.get=function(a){return this[r.p(a)]()},i.add=function(a,f){var n,d=this;a=Number(a);var s=r.p(f),S=function(U){var a1=H(d);return r.w(a1.date(a1.date()+Math.round(U*a)),d)};if(s===p)return this.set(p,this.$M+a);if(s===V)return this.set(V,this.$y+a);if(s===g)return S(1);if(s===b)return S(7);var R=(n={},n[M]=c,n[Z]=l,n[h]=e,n)[s]||1,G=this.$d.getTime()+a*R;return r.w(G,this)},i.subtract=function(a,f){return this.add(-1*a,f)},i.format=function(a){var f=this,n=this.$locale();if(!this.isValid())return n.invalidDate||P;var d=a||"YYYY-MM-DDTHH:mm:ssZ",s=r.z(this),S=this.$H,R=this.$m,G=this.$M,U=n.weekdays,a1=n.months,i1=function(N,o1,Q1,S1){return N&&(N[o1]||N(f,d))||Q1[o1].slice(0,S1)},V1=function(N){return r.s(S%12||12,N,"0")},y1=n.meridiem||function(N,o1,Q1){var S1=N<12?"AM":"PM";return Q1?S1.toLowerCase():S1},v1={YY:String(this.$y).slice(-2),YYYY:this.$y,M:G+1,MM:r.s(G+1,2,"0"),MMM:i1(n.monthsShort,G,a1,3),MMMM:i1(a1,G),D:this.$D,DD:r.s(this.$D,2,"0"),d:String(this.$W),dd:i1(n.weekdaysMin,this.$W,U,2),ddd:i1(n.weekdaysShort,this.$W,U,3),dddd:U[this.$W],H:String(S),HH:r.s(S,2,"0"),h:V1(1),hh:V1(2),a:y1(S,R,!0),A:y1(S,R,!1),m:String(R),mm:r.s(R,2,"0"),s:String(this.$s),ss:r.s(this.$s,2,"0"),SSS:r.s(this.$ms,3,"0"),Z:s};return d.replace(D,function(N,o1){return o1||v1[N]||s.replace(":","")})},i.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},i.diff=function(a,f,n){var d,s=r.p(f),S=H(a),R=(S.utcOffset()-this.utcOffset())*c,G=this-S,U=r.m(this,S);return U=(d={},d[V]=U/12,d[p]=U,d[x]=U/3,d[b]=(G-R)/6048e5,d[g]=(G-R)/864e5,d[Z]=G/l,d[M]=G/c,d[h]=G/e,d)[s]||G,n?U:r.a(U)},i.daysInMonth=function(){return this.endOf(p).$D},i.$locale=function(){return A[this.$L]},i.locale=function(a,f){if(!a)return this.$L;var n=this.clone(),d=J(a,f,!0);return d&&(n.$L=d),n},i.clone=function(){return r.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()},t}(),Y=u.prototype;return H.prototype=Y,[["$ms",m],["$s",h],["$m",M],["$H",Z],["$W",g],["$M",p],["$y",V],["$D",F]].forEach(function(t){Y[t[1]]=function(i){return this.$g(i,t[0],t[1])}}),H.extend=function(t,i){return t.$i||(t(i,u,H),t.$i=!0),H},H.locale=J,H.isDayjs=_,H.unix=function(t){return H(1e3*t)},H.en=A[L],H.Ls=A,H.p={},H})});var m2=Z2((h2,d2)=>{(function(e,c){typeof h2=="object"&&typeof d2!="undefined"?d2.exports=c(Y2()):typeof define=="function"&&define.amd?define(["dayjs"],c):(e=typeof globalThis!="undefined"?globalThis:e||self).dayjs_locale_pt_br=c(e.dayjs)})(h2,function(e){"use strict";function c(h){return h&&typeof h=="object"&&"default"in h?h:{default:h}}var l=c(e),m={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(h){return h+"\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 l.default.locale(m,null,!0),m})});var W0={};F0(W0,{Autocomplete:()=>H0,Checkbox:()=>I2,Creatable:()=>G2,DatePicker:()=>l0,Form:()=>y2,FormProvider:()=>$1,RadioButton:()=>R2,RadioGroup:()=>O2,Searchable:()=>A2,Select:()=>w2,Slider:()=>q2,Switch:()=>B2,TextField:()=>S2,TimePicker:()=>u0,useForm:()=>A1});module.exports=P0(W0);var f2=require("react-hook-form");var e2=require("react/jsx-runtime"),k0=h=>{var M=h,{children:e,style:c,onSubmit:l}=M,m=$(M,["children","style","onSubmit"]);return(0,e2.jsx)(f2.FormProvider,v(o({},m),{children:(0,e2.jsx)("form",{onSubmit:Z=>{Z.preventDefault(),Z.stopPropagation(),l(Z)},style:c,children:e})}))},$1=k0;var M2=require("react"),H2=require("react-hook-form"),V2=require("@hookform/resolvers/zod");var S0=m=>{var h=m,{disableDefaultValuesUpdate:e,onSubmit:c}=h,l=$(h,["disableDefaultValuesUpdate","onSubmit"]);let M=(0,H2.useForm)(v(o({},l),{resolver:l.schema&&(0,V2.zodResolver)(l.schema)}));return(0,M2.useEffect)(()=>{e||M.reset(l.defaultValues)},[l.defaultValues,M.reset]),v(o({},M),{onSubmit:M.handleSubmit(Z=>c(Z,M))})},A1=S0;var C2=require("react/jsx-runtime");function w0(m){var h=m,{children:e,style:c}=h,l=$(h,["children","style"]);let M=A1(l);return(0,C2.jsx)($1,v(o({},M),{style:c,children:typeof e=="function"?e(M):e}))}var y2=w0;var T1=require("react"),D1=require("react-hook-form"),t1=require("@mui/material");var g2={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"},x2={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 L2={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 c2={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 i2=require("@mui/material"),b2=require("@s_mart/utils"),g1=require("react/jsx-runtime"),I=({label:e,required:c,regular:l})=>(0,g1.jsxs)("span",{style:{display:"flex",alignItems:"center",gap:(0,b2.toRem)(2)},children:[(0,g1.jsx)(i2.Typography,{variant:"caption",fontWeight:l?400:700,style:{display:"flex",alignItems:"center"},children:e}),c&&(0,g1.jsx)(i2.Typography,{variant:"caption",fontWeight:900,color:"error",children:"*"})]});var F2=require("react-hook-form"),P2=require("@s_mart/core");var q=(e,c)=>{var l,m,h,M,Z;if(e[c])return e[c];if(c.includes("[")){let[g,b]=c.split("["),[p,x]=b.split("].");return(m=(l=e[g])==null?void 0:l[p])==null?void 0:m[x]}if(c.includes(".")){let[g,b,p]=c.split(".");return p?(Z=(M=e[g])==null?void 0:M[b])==null?void 0:Z[p]:(h=e[g])==null?void 0:h[b]}};var k2=require("react/jsx-runtime"),O=({name:e})=>{var m;let c=(0,F2.useFormContext)(),l=q((m=c==null?void 0:c.formState)==null?void 0:m.errors,e);return l?(0,k2.jsx)(P2.Indicator,{severity:"error",children:l==null?void 0:l.message}):null};var x1=require("@s_mart/core");var z=require("react/jsx-runtime"),$0=B=>{var D=B,{name:e,rules:c,defaultValue:l,shouldUnregister:m,label:h,required:M,mask:Z,variant:g="outlined",info:b,parse:p,inputMode:x,format:V,onInputChange:F}=D,P=$(D,["name","rules","defaultValue","shouldUnregister","label","required","mask","variant","info","parse","inputMode","format","onInputChange"]);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[k,y]=(0,T1.useState)(!1),L=H=>{var u;let r=H;return V&&(r=V(H)),Z?(u=Z1==null?void 0:Z1[Z])==null?void 0:u.format(r):r},A=H=>{var u;let r=H;return p&&(r=p(H)),Z?(u=Z1==null?void 0:Z1[Z])==null?void 0:u.parse(r):r},_=H=>{if(!H||Z!=="porcentagem"&&Z!=="porcentagem0")return;H==null||H.stopPropagation();let r=(H==null?void 0:H.target).value;if(r){let u=String(r);if(u.length>0){let Y=u.indexOf("%");Y>-1&&(H.currentTarget.selectionEnd=Y)}}},J=q(T.formState.errors,e);return(0,z.jsx)(D1.Controller,{control:T.control,name:e,rules:c,defaultValue:l,shouldUnregister:m,render:({field:{value:H,onChange:r,ref:u}})=>(0,z.jsxs)(t1.Grid,{display:"flex",flexDirection:"column",children:[(0,z.jsxs)("div",{style:{display:"flex"},children:[h&&(0,z.jsx)(t1.Grid,{item:!0,children:(0,z.jsx)(I,{label:h,required:M})}),b&&(0,z.jsx)(t1.Grid,{item:!0,children:(0,z.jsx)(x1.Tooltip,{title:b,placement:"top",children:(0,z.jsx)("div",{style:{width:"fit-content"},children:(0,z.jsx)(x1.LIcon,{icon:r1,color:"#757575"})})})})]}),(0,z.jsx)(t1.TextField,v(o({variant:g,defaultValue:l,value:L(H||""),onChange:Y=>{var i;let t=A((i=Y==null?void 0:Y.target)==null?void 0:i.value);r(t),F==null||F(t,T.getValues())},error:!!J},P),{type:P.type==="password"?k?"text":"password":P.type,autoComplete:P.autoComplete||"off",inputProps:o({inputMode:x},P.inputProps),InputProps:o({onKeyDown:_,inputRef:u,endAdornment:P.type==="password"&&(0,z.jsx)(t1.InputAdornment,{position:"start",onClick:()=>y(!k),style:{cursor:"pointer"},children:(0,z.jsx)(x1.LIcon,{icon:k?g2:x2,size:"24px",removeMargin:!0})})},P.InputProps)}),e),(0,z.jsx)(O,{name:e})]})})},S2=(0,T1.memo)($0);var _1=require("react"),E1=require("react-hook-form"),u1=require("@s_mart/core"),j=require("@mui/material");var E=require("react/jsx-runtime"),A0=B=>{var D=B,{name:e,rules:c,defaultValue:l,shouldUnregister:m,label:h,required:M,options:Z,placeholder:g,disableOnChangeForm:b=!1,multiple:p,info:x,footer:V,onChange:F}=D,P=$(D,["name","rules","defaultValue","shouldUnregister","label","required","options","placeholder","disableOnChangeForm","multiple","info","footer","onChange"]);let T=(0,E1.useFormContext)(),{palette:k}=(0,j.useTheme)(),[y,L]=(0,_1.useState)(!1);if(!T)throw new Error("Para usar o <Select /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let A=q(T.formState.errors,e);return console.warn=()=>{},(0,E.jsx)(E1.Controller,{control:T.control,name:e,rules:c,defaultValue:l,shouldUnregister:m,render:({field:{value:_,onChange:J,ref:H}})=>(0,E.jsxs)(j.Grid,{display:"flex",flexDirection:"column",children:[(0,E.jsxs)("div",{style:{display:"flex"},children:[h&&(0,E.jsx)(j.Grid,{item:!0,children:(0,E.jsx)(I,{label:h,required:M})}),x&&(0,E.jsx)(j.Grid,{item:!0,children:(0,E.jsx)(u1.Tooltip,{title:x,placement:"top",children:(0,E.jsx)("div",{style:{width:"fit-content"},children:(0,E.jsx)(u1.LIcon,{icon:r1,color:"#757575"})})})})]}),(0,E.jsxs)(j.Select,v(o({open:y,onOpen:()=>L(!0),onClose:()=>L(!1),displayEmpty:!!g,variant:"outlined",autoComplete:"off",value:_?_||"":p?[]:"",renderValue:r=>{if(r.label)return r.label;if(g)return(0,E.jsx)("p",{style:{color:k.grey[400]},children:g})},multiple:p,onChange:r=>{!b&&J(r.target.value),F&&F(r.target.value,T.getValues())},error:!!A,size:P.size||"medium",inputRef:H},P),{children:[g&&(0,E.jsx)(j.MenuItem,{disabled:!0,value:"",children:(0,E.jsx)("p",{style:{color:k.grey[400]},children:g})}),Z==null?void 0:Z.map((r,u)=>(0,E.jsx)(j.MenuItem,{value:r,children:(0,E.jsxs)(j.Grid,{container:!0,direction:"column",children:[(0,E.jsx)(j.Grid,{item:!0,children:r.label}),r.afterLabel&&(0,E.jsx)(j.Grid,{item:!0,children:r.afterLabel})]})},u)),V&&[(0,E.jsx)(j.Grid,{px:2,py:1,children:(0,E.jsx)(u1.Divider,{})},"footer-divider"),(0,E.jsx)("div",{children:V({closeSelect:()=>L(!1)})},"footer-content")]]}),e),(0,E.jsx)(O,{name:e})]})})},w2=(0,_1.memo)(A0);var G1=require("react"),I1=require("react-hook-form"),W=require("@mui/material"),d1=require("@s_mart/core");var $2=require("@s_mart/tokens");var w=require("react/jsx-runtime"),l2=require("react"),T0=T=>{var k=T,{name:e,rules:c,defaultValue:l,shouldUnregister:m,label:h,required:M,options:Z,textFieldProps:g,noOptionsText:b,footer:p,multiple:x,info:V,placeholder:F,onChange:P,onInputChange:B}=k,D=$(k,["name","rules","defaultValue","shouldUnregister","label","required","options","textFieldProps","noOptionsText","footer","multiple","info","placeholder","onChange","onInputChange"]);let y=(0,I1.useFormContext)();if(!y)throw new Error("Para usar o <Searchable /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let L=q(y.formState.errors,e);return console.warn=()=>{},(0,w.jsx)(I1.Controller,{control:y.control,name:e,rules:c,defaultValue:l,shouldUnregister:m,render:({field:{onChange:A,value:_,ref:J}})=>{var H;return(0,w.jsxs)(W.Grid,{display:"flex",flexDirection:"column",children:[(0,w.jsxs)("div",{style:{display:"flex"},children:[h&&(0,w.jsx)(W.Grid,{item:!0,children:(0,w.jsx)(I,{label:h,required:M})}),V&&(0,w.jsx)(W.Grid,{item:!0,children:(0,w.jsx)(d1.Tooltip,{title:V,placement:"top",children:(0,w.jsx)("div",{style:{width:"fit-content"},children:(0,w.jsx)(d1.LIcon,{icon:r1,color:"#757575"})})})})]}),(0,w.jsx)(W.Autocomplete,v(o({onChange:(r,u)=>{A(u),P==null||P(u,y.getValues())},onInputChange:(r,u,Y)=>{Y==="input"&&setTimeout(()=>{B==null||B(u,y.getValues())},0)},slotProps:v(o({},D.slotProps||{}),{paper:v(o({},(D.slotProps||{}).paper||{}),{sx:o({border:`1px solid ${$2.colorPalette.neutral[30]}`,boxShadow:"0px 2px 4px rgba(0, 0, 0, 0.15)"},((H=(D.slotProps||{}).paper)==null?void 0:H.sx)||{})})}),value:_||(x?[]:null),options:Z,multiple:x,noOptionsText:(0,w.jsxs)(w.Fragment,{children:[b||"Nenhum resultado encontrado",p?(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(W.Grid,{py:1,children:(0,w.jsx)(d1.Divider,{})}),p]}):null]}),isOptionEqualToValue:(r,u)=>typeof r=="string"&&typeof u=="string"?r===u:typeof r=="object"&&typeof u=="object"?typeof r.value=="object"&&typeof u.value=="object"&&r.key!==void 0&&u.key!==void 0?r.key===u.key:r.value===u.value:!1,renderOption:(r,u)=>typeof u=="object"?(0,l2.createElement)("li",v(o({},r),{key:u.key||u.value}),(0,w.jsxs)(W.Grid,{container:!0,direction:"column",children:[(0,w.jsx)(W.Grid,{item:!0,children:u.label}),u.afterLabel&&(0,w.jsx)(W.Grid,{item:!0,children:u.afterLabel})]})):(0,l2.createElement)("li",v(o({},r),{key:u}),u),ListboxComponent:(0,G1.forwardRef)(function(u,Y){return(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)("ul",v(o({},u),{ref:Y})),!!p&&(0,w.jsx)("div",v(o({},u),{children:(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(W.Grid,{px:2,py:1,children:(0,w.jsx)(d1.Divider,{})}),p]})}),"searchable-footer")]})})},D),{renderInput:r=>(0,w.jsx)(W.TextField,v(o(o({error:!!L,placeholder:F},r),g),{inputRef:J}))}),e),(0,w.jsx)(O,{name:e})]})}})},A2=(0,G1.memo)(T0);var B1=require("react"),R1=require("react-hook-form"),O1=require("lodash"),K=require("@mui/material"),Q=require("@s_mart/core"),E2=require("@s_mart/tokens");var o2=require("@s_mart/utils");var L1=require("@s_mart/utils"),T2=p1(require("@emotion/styled")),a2=require("@emotion/react"),D2=a2.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 m2=Object.create;var L1=Object.defineProperty,v2=Object.defineProperties,p2=Object.getOwnPropertyDescriptor,Z2=Object.getOwnPropertyDescriptors,u2=Object.getOwnPropertyNames,u1=Object.getOwnPropertySymbols,f2=Object.getPrototypeOf,b1=Object.prototype.hasOwnProperty,G1=Object.prototype.propertyIsEnumerable;var E1=(e,c,o)=>c in e?L1(e,c,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[c]=o,a=(e,c)=>{for(var o in c||(c={}))b1.call(c,o)&&E1(e,o,c[o]);if(u1)for(var o of u1(c))G1.call(c,o)&&E1(e,o,c[o]);return e},v=(e,c)=>v2(e,Z2(c));var S=(e,c)=>{var o={};for(var m in e)b1.call(e,m)&&c.indexOf(m)<0&&(o[m]=e[m]);if(e!=null&&u1)for(var m of u1(e))c.indexOf(m)<0&&G1.call(e,m)&&(o[m]=e[m]);return o};var I1=(e,c)=>()=>(c||e((c={exports:{}}).exports,c),c.exports);var M2=(e,c,o,m)=>{if(c&&typeof c=="object"||typeof c=="function")for(let h of u2(c))!b1.call(e,h)&&h!==o&&L1(e,h,{get:()=>c[h],enumerable:!(m=p2(c,h))||m.enumerable});return e};var B1=(e,c,o)=>(o=e!=null?m2(f2(e)):{},M2(c||!e||!e.__esModule?L1(o,"default",{value:e,enumerable:!0}):o,e));var a2=I1(($1,A1)=>{(function(e,c){typeof $1=="object"&&typeof A1!="undefined"?A1.exports=c():typeof define=="function"&&define.amd?define(c):(e=typeof globalThis!="undefined"?globalThis:e||self).dayjs=c()})($1,function(){"use strict";var e=1e3,c=6e4,o=36e5,m="millisecond",h="second",M="minute",Z="hour",C="day",L="week",p="month",g="quarter",V="year",b="date",F="Invalid Date",G=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,A=/\[([^\]]+)]|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,$={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(t){var i=["th","st","nd","rd"],l=t%100;return"["+t+(i[(l-20)%10]||i[l]||i[0])+"]"}},P=function(t,i,l){var f=String(t);return!f||f.length>=i?t:""+Array(i+1-f.length).join(l)+t},y={s:P,z:function(t){var i=-t.utcOffset(),l=Math.abs(i),f=Math.floor(l/60),n=l%60;return(i<=0?"+":"-")+P(f,2,"0")+":"+P(n,2,"0")},m:function t(i,l){if(i.date()<l.date())return-t(l,i);var f=12*(l.year()-i.year())+(l.month()-i.month()),n=i.clone().add(f,p),d=l-n<0,s=i.clone().add(f+(d?-1:1),p);return+(-(f+(l-n)/(d?n-s:s-n))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(t){return{M:p,y:V,w:L,d:C,D:b,h:Z,m:M,s:h,ms:m,Q:g}[t]||String(t||"").toLowerCase().replace(/s$/,"")},u:function(t){return t===void 0}},x="en",w={};w[x]=$;var D=function(t){return t instanceof u},j=function t(i,l,f){var n;if(!i)return x;if(typeof i=="string"){var d=i.toLowerCase();w[d]&&(n=d),l&&(w[d]=l,n=d);var s=i.split("-");if(!n&&s.length>1)return t(s[0])}else{var k=i.name;w[k]=i,n=k}return!f&&n&&(x=n),n||!f&&x},H=function(t,i){if(D(t))return t.clone();var l=typeof i=="object"?i:{};return l.date=t,l.args=arguments,new u(l)},r=y;r.l=j,r.i=D,r.w=function(t,i){return H(t,{locale:i.$L,utc:i.$u,x:i.$x,$offset:i.$offset})};var u=function(){function t(l){this.$L=j(l.locale,null,!0),this.parse(l)}var i=t.prototype;return i.parse=function(l){this.$d=function(f){var n=f.date,d=f.utc;if(n===null)return new Date(NaN);if(r.u(n))return new Date;if(n instanceof Date)return new Date(n);if(typeof n=="string"&&!/Z$/i.test(n)){var s=n.match(G);if(s){var k=s[2]-1||0,I=(s[7]||"0").substring(0,3);return d?new Date(Date.UTC(s[1],k,s[3]||1,s[4]||0,s[5]||0,s[6]||0,I)):new Date(s[1],k,s[3]||1,s[4]||0,s[5]||0,s[6]||0,I)}}return new Date(n)}(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 r},i.isValid=function(){return this.$d.toString()!==F},i.isSame=function(l,f){var n=H(l);return this.startOf(f)<=n&&n<=this.endOf(f)},i.isAfter=function(l,f){return H(l)<this.startOf(f)},i.isBefore=function(l,f){return this.endOf(f)<H(l)},i.$g=function(l,f,n){return r.u(l)?this[f]:this.set(n,l)},i.unix=function(){return Math.floor(this.valueOf()/1e3)},i.valueOf=function(){return this.$d.getTime()},i.startOf=function(l,f){var n=this,d=!!r.u(f)||f,s=r.p(l),k=function(t1,z){var e1=r.w(n.$u?Date.UTC(n.$y,z,t1):new Date(n.$y,z,t1),n);return d?e1:e1.endOf(C)},I=function(t1,z){return r.w(n.toDate()[t1].apply(n.toDate("s"),(d?[0,0,0,0]:[23,59,59,999]).slice(z)),n)},_=this.$W,U=this.$M,X=this.$D,Q="set"+(this.$u?"UTC":"");switch(s){case V:return d?k(1,0):k(31,11);case p:return d?k(1,U):k(0,U+1);case L:var h1=this.$locale().weekStart||0,d1=(_<h1?_+7:_)-h1;return k(d?X-d1:X+(6-d1),U);case C:case b:return I(Q+"Hours",0);case Z:return I(Q+"Minutes",1);case M:return I(Q+"Seconds",2);case h:return I(Q+"Milliseconds",3);default:return this.clone()}},i.endOf=function(l){return this.startOf(l,!1)},i.$set=function(l,f){var n,d=r.p(l),s="set"+(this.$u?"UTC":""),k=(n={},n[C]=s+"Date",n[b]=s+"Date",n[p]=s+"Month",n[V]=s+"FullYear",n[Z]=s+"Hours",n[M]=s+"Minutes",n[h]=s+"Seconds",n[m]=s+"Milliseconds",n)[d],I=d===C?this.$D+(f-this.$W):f;if(d===p||d===V){var _=this.clone().set(b,1);_.$d[k](I),_.init(),this.$d=_.set(b,Math.min(this.$D,_.daysInMonth())).$d}else k&&this.$d[k](I);return this.init(),this},i.set=function(l,f){return this.clone().$set(l,f)},i.get=function(l){return this[r.p(l)]()},i.add=function(l,f){var n,d=this;l=Number(l);var s=r.p(f),k=function(U){var X=H(d);return r.w(X.date(X.date()+Math.round(U*l)),d)};if(s===p)return this.set(p,this.$M+l);if(s===V)return this.set(V,this.$y+l);if(s===C)return k(1);if(s===L)return k(7);var I=(n={},n[M]=c,n[Z]=o,n[h]=e,n)[s]||1,_=this.$d.getTime()+l*I;return r.w(_,this)},i.subtract=function(l,f){return this.add(-1*l,f)},i.format=function(l){var f=this,n=this.$locale();if(!this.isValid())return n.invalidDate||F;var d=l||"YYYY-MM-DDTHH:mm:ssZ",s=r.z(this),k=this.$H,I=this.$m,_=this.$M,U=n.weekdays,X=n.months,Q=function(z,e1,x1,Z1){return z&&(z[e1]||z(f,d))||x1[e1].slice(0,Z1)},h1=function(z){return r.s(k%12||12,z,"0")},d1=n.meridiem||function(z,e1,x1){var Z1=z<12?"AM":"PM";return x1?Z1.toLowerCase():Z1},t1={YY:String(this.$y).slice(-2),YYYY:this.$y,M:_+1,MM:r.s(_+1,2,"0"),MMM:Q(n.monthsShort,_,X,3),MMMM:Q(X,_),D:this.$D,DD:r.s(this.$D,2,"0"),d:String(this.$W),dd:Q(n.weekdaysMin,this.$W,U,2),ddd:Q(n.weekdaysShort,this.$W,U,3),dddd:U[this.$W],H:String(k),HH:r.s(k,2,"0"),h:h1(1),hh:h1(2),a:d1(k,I,!0),A:d1(k,I,!1),m:String(I),mm:r.s(I,2,"0"),s:String(this.$s),ss:r.s(this.$s,2,"0"),SSS:r.s(this.$ms,3,"0"),Z:s};return d.replace(A,function(z,e1){return e1||t1[z]||s.replace(":","")})},i.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},i.diff=function(l,f,n){var d,s=r.p(f),k=H(l),I=(k.utcOffset()-this.utcOffset())*c,_=this-k,U=r.m(this,k);return U=(d={},d[V]=U/12,d[p]=U,d[g]=U/3,d[L]=(_-I)/6048e5,d[C]=(_-I)/864e5,d[Z]=_/o,d[M]=_/c,d[h]=_/e,d)[s]||_,n?U:r.a(U)},i.daysInMonth=function(){return this.endOf(p).$D},i.$locale=function(){return w[this.$L]},i.locale=function(l,f){if(!l)return this.$L;var n=this.clone(),d=j(l,f,!0);return d&&(n.$L=d),n},i.clone=function(){return r.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()},t}(),Y=u.prototype;return H.prototype=Y,[["$ms",m],["$s",h],["$m",M],["$H",Z],["$W",C],["$M",p],["$y",V],["$D",b]].forEach(function(t){Y[t[1]]=function(i){return this.$g(i,t[0],t[1])}}),H.extend=function(t,i){return t.$i||(t(i,u,H),t.$i=!0),H},H.locale=j,H.isDayjs=D,H.unix=function(t){return H(1e3*t)},H.en=w[x],H.Ls=w,H.p={},H})});var _1=I1((T1,D1)=>{(function(e,c){typeof T1=="object"&&typeof D1!="undefined"?D1.exports=c(a2()):typeof define=="function"&&define.amd?define(["dayjs"],c):(e=typeof globalThis!="undefined"?globalThis:e||self).dayjs_locale_pt_br=c(e.dayjs)})(T1,function(e){"use strict";function c(h){return h&&typeof h=="object"&&"default"in h?h:{default:h}}var o=c(e),m={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(h){return h+"\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(m,null,!0),m})});import{FormProvider as H2}from"react-hook-form";import{jsx as R1}from"react/jsx-runtime";var V2=h=>{var M=h,{children:e,style:c,onSubmit:o}=M,m=S(M,["children","style","onSubmit"]);return R1(H2,v(a({},m),{children:R1("form",{onSubmit:Z=>{Z.preventDefault(),Z.stopPropagation(),o(Z)},style:c,children:e})}))},F1=V2;import{useEffect as y2}from"react";import{useForm as C2}from"react-hook-form";import{zodResolver as g2}from"@hookform/resolvers/zod";var x2=m=>{var h=m,{disableDefaultValuesUpdate:e,onSubmit:c}=h,o=S(h,["disableDefaultValuesUpdate","onSubmit"]);let M=C2(v(a({},o),{resolver:o.schema&&g2(o.schema)}));return y2(()=>{e||M.reset(o.defaultValues)},[o.defaultValues,M.reset]),v(a({},M),{onSubmit:M.handleSubmit(Z=>c(Z,M))})},P1=x2;import{jsx as F2}from"react/jsx-runtime";function L2(m){var h=m,{children:e,style:c}=h,o=S(h,["children","style"]);let M=P1(o);return F2(F1,v(a({},M),{style:c,children:typeof e=="function"?e(M):e}))}var b2=L2;import{memo as A2,useState as T2}from"react";import{Controller as D2,useFormContext as _2}from"react-hook-form";import{Grid as S1,InputAdornment as E2,TextField as G2}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 P2}from"@s_mart/utils";import{jsx as z1,jsxs as k2}from"react/jsx-runtime";var E=({label:e,required:c,regular:o})=>k2("span",{style:{display:"flex",alignItems:"center",gap:P2(2)},children:[z1(Y1,{variant:"caption",fontWeight:o?400:700,style:{display:"flex",alignItems:"center"},children:e}),c&&z1(Y1,{variant:"caption",fontWeight:900,color:"error",children:"*"})]});import{useFormContext as S2}from"react-hook-form";import{Indicator as w2}from"@s_mart/core";var q=(e,c)=>{var o,m,h,M,Z;if(e[c])return e[c];if(c.includes("[")){let[C,L]=c.split("["),[p,g]=L.split("].");return(m=(o=e[C])==null?void 0:o[p])==null?void 0:m[g]}if(c.includes(".")){let[C,L,p]=c.split(".");return p?(Z=(M=e[C])==null?void 0:M[L])==null?void 0:Z[p]:(h=e[C])==null?void 0:h[L]}};import{jsx as $2}from"react/jsx-runtime";var B=({name:e})=>{var m;let c=S2(),o=q((m=c==null?void 0:c.formState)==null?void 0:m.errors,e);return o?$2(w2,{severity:"error",children:o==null?void 0:o.message}):null};import{LIcon as j1,Tooltip as I2}from"@s_mart/core";import{jsx as N,jsxs as N1}from"react/jsx-runtime";var B2=G=>{var A=G,{name:e,rules:c,defaultValue:o,shouldUnregister:m,label:h,required:M,mask:Z,variant:C="outlined",info:L,parse:p,inputMode:g,format:V,onInputChange:b}=A,F=S(A,["name","rules","defaultValue","shouldUnregister","label","required","mask","variant","info","parse","inputMode","format","onInputChange"]);let $=_2();if(!$)throw new Error("Para usar o <TextField /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let[P,y]=T2(!1),x=H=>{var u;let r=H;return V&&(r=V(H)),Z?(u=n1==null?void 0:n1[Z])==null?void 0:u.format(r):r},w=H=>{var u;let r=H;return p&&(r=p(H)),Z?(u=n1==null?void 0:n1[Z])==null?void 0:u.parse(r):r},D=H=>{if(!H||Z!=="porcentagem")return;H==null||H.stopPropagation();let r=(H==null?void 0:H.target).value;if(r){let u=String(r);if(u.length>0){let Y=u.indexOf("%");Y>-1&&(H.currentTarget.selectionEnd=Y)}}},j=q($.formState.errors,e);return N(D2,{control:$.control,name:e,rules:c,defaultValue:o,shouldUnregister:m,render:({field:{value:H,onChange:r,ref:u}})=>N1(S1,{display:"flex",flexDirection:"column",children:[N1("div",{style:{display:"flex"},children:[h&&N(S1,{item:!0,children:N(E,{label:h,required:M})}),L&&N(S1,{item:!0,children:N(I2,{title:L,placement:"top",children:N("div",{style:{width:"fit-content"},children:N(j1,{icon:c1,color:"#757575"})})})})]}),N(G2,v(a({variant:C,defaultValue:o,value:x(H||""),onChange:Y=>{var i;let t=w((i=Y==null?void 0:Y.target)==null?void 0:i.value);r(t),b==null||b(t,$.getValues())},error:!!j},F),{type:F.type==="password"?P?"text":"password":F.type,autoComplete:F.autoComplete||"off",inputProps:a({inputMode:g},F.inputProps),InputProps:a({onKeyDown:D,inputRef:u,endAdornment:F.type==="password"&&N(E2,{position:"start",onClick:()=>y(!P),style:{cursor:"pointer"},children:N(j1,{icon:P?O1:U1,size:"24px",removeMargin:!0})})},F.InputProps)}),e),N(B,{name:e})]})})},R2=A2(B2);import{memo as O2,useState as U2}from"react";import{Controller as q2,useFormContext as Y2}from"react-hook-form";import{Divider as z2,LIcon as j2,Tooltip as N2}from"@s_mart/core";import{Grid as l1,Select as W2,MenuItem as W1,useTheme as J2}from"@mui/material";import{jsx as O,jsxs as f1}from"react/jsx-runtime";var K2=G=>{var A=G,{name:e,rules:c,defaultValue:o,shouldUnregister:m,label:h,required:M,options:Z,placeholder:C,disableOnChangeForm:L=!1,multiple:p,info:g,footer:V,onChange:b}=A,F=S(A,["name","rules","defaultValue","shouldUnregister","label","required","options","placeholder","disableOnChangeForm","multiple","info","footer","onChange"]);let $=Y2(),{palette:P}=J2(),[y,x]=U2(!1);if(!$)throw new Error("Para usar o <Select /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let w=q($.formState.errors,e);return console.warn=()=>{},O(q2,{control:$.control,name:e,rules:c,defaultValue:o,shouldUnregister:m,render:({field:{value:D,onChange:j,ref:H}})=>f1(l1,{display:"flex",flexDirection:"column",children:[f1("div",{style:{display:"flex"},children:[h&&O(l1,{item:!0,children:O(E,{label:h,required:M})}),g&&O(l1,{item:!0,children:O(N2,{title:g,placement:"top",children:O("div",{style:{width:"fit-content"},children:O(j2,{icon:c1,color:"#757575"})})})})]}),f1(W2,v(a({open:y,onOpen:()=>x(!0),onClose:()=>x(!1),displayEmpty:!!C,variant:"outlined",autoComplete:"off",value:D?D||"":p?[]:"",renderValue:r=>{if(r.label)return r.label;if(C)return O("p",{style:{color:P.grey[400]},children:C})},multiple:p,onChange:r=>{!L&&j(r.target.value),b&&b(r.target.value,$.getValues())},error:!!w,size:F.size||"medium",inputRef:H},F),{children:[C&&O(W1,{disabled:!0,value:"",children:O("p",{style:{color:P.grey[400]},children:C})}),Z==null?void 0:Z.map((r,u)=>O(W1,{value:r,children:f1(l1,{container:!0,direction:"column",children:[O(l1,{item:!0,children:r.label}),r.afterLabel&&O(l1,{item:!0,children:r.afterLabel})]})},u)),V&&[O(l1,{px:2,py:1,children:O(z2,{})},"footer-divider"),O("div",{children:V({closeSelect:()=>x(!1)})},"footer-content")]]}),e),O(B,{name:e})]})})},Q2=O2(K2);import{forwardRef as X2,memo as e0}from"react";import{Controller as c0,useFormContext as i0}from"react-hook-form";import{Grid as i1,Autocomplete as l0,TextField as a0}from"@mui/material";import{Divider as J1,LIcon as o0,Tooltip as r0}from"@s_mart/core";import{colorPalette as t0}from"@s_mart/tokens";import{Fragment as M1,jsx as R,jsxs as a1}from"react/jsx-runtime";import{createElement as K1}from"react";var n0=$=>{var P=$,{name:e,rules:c,defaultValue:o,shouldUnregister:m,label:h,required:M,options:Z,textFieldProps:C,noOptionsText:L,footer:p,multiple:g,info:V,placeholder:b,onChange:F,onInputChange:G}=P,A=S(P,["name","rules","defaultValue","shouldUnregister","label","required","options","textFieldProps","noOptionsText","footer","multiple","info","placeholder","onChange","onInputChange"]);let y=i0();if(!y)throw new Error("Para usar o <Searchable /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let x=q(y.formState.errors,e);return console.warn=()=>{},R(c0,{control:y.control,name:e,rules:c,defaultValue:o,shouldUnregister:m,render:({field:{onChange:w,value:D,ref:j}})=>{var H;return a1(i1,{display:"flex",flexDirection:"column",children:[a1("div",{style:{display:"flex"},children:[h&&R(i1,{item:!0,children:R(E,{label:h,required:M})}),V&&R(i1,{item:!0,children:R(r0,{title:V,placement:"top",children:R("div",{style:{width:"fit-content"},children:R(o0,{icon:c1,color:"#757575"})})})})]}),R(l0,v(a({onChange:(r,u)=>{w(u),F==null||F(u,y.getValues())},onInputChange:(r,u,Y)=>{Y==="input"&&setTimeout(()=>{G==null||G(u,y.getValues())},0)},slotProps:v(a({},A.slotProps||{}),{paper:v(a({},(A.slotProps||{}).paper||{}),{sx:a({border:`1px solid ${t0.neutral[30]}`,boxShadow:"0px 2px 4px rgba(0, 0, 0, 0.15)"},((H=(A.slotProps||{}).paper)==null?void 0:H.sx)||{})})}),value:D||(g?[]:null),options:Z,multiple:g,noOptionsText:a1(M1,{children:[L||"Nenhum resultado encontrado",p?a1(M1,{children:[R(i1,{py:1,children:R(J1,{})}),p]}):null]}),isOptionEqualToValue:(r,u)=>typeof r=="string"&&typeof u=="string"?r===u:typeof r=="object"&&typeof u=="object"?typeof r.value=="object"&&typeof u.value=="object"&&r.key!==void 0&&u.key!==void 0?r.key===u.key:r.value===u.value:!1,renderOption:(r,u)=>typeof u=="object"?K1("li",v(a({},r),{key:u.key||u.value}),a1(i1,{container:!0,direction:"column",children:[R(i1,{item:!0,children:u.label}),u.afterLabel&&R(i1,{item:!0,children:u.afterLabel})]})):K1("li",v(a({},r),{key:u}),u),ListboxComponent:X2(function(u,Y){return a1(M1,{children:[R("ul",v(a({},u),{ref:Y})),!!p&&R("div",v(a({},u),{children:a1(M1,{children:[R(i1,{px:2,py:1,children:R(J1,{})}),p]})}),"searchable-footer")]})})},A),{renderInput:r=>R(a0,v(a(a({error:!!x,placeholder:b},r),C),{inputRef:j}))}),e),R(B,{name:e})]})}})},s0=e0(n0);import{forwardRef as m0,memo as v0}from"react";import{Controller as p0,useFormContext as Z0}from"react-hook-form";import{isObject as u0,isEmpty as f0}from"lodash";import{Grid as o1,Autocomplete as M0,TextField as H0}from"@mui/material";import{LIcon as V1,Tooltip as V0,Button as y0,Divider as C0}from"@s_mart/core";import{colorPalette as g0}from"@s_mart/tokens";import{toRem as c2}from"@s_mart/utils";import{toRem as H1}from"@s_mart/utils";import h0 from"@emotion/styled";import{css as Q1}from"@emotion/react";var X1=Q1`
|
|
1
|
+
var m2=Object.create;var L1=Object.defineProperty,v2=Object.defineProperties,p2=Object.getOwnPropertyDescriptor,Z2=Object.getOwnPropertyDescriptors,u2=Object.getOwnPropertyNames,u1=Object.getOwnPropertySymbols,f2=Object.getPrototypeOf,b1=Object.prototype.hasOwnProperty,G1=Object.prototype.propertyIsEnumerable;var E1=(e,c,o)=>c in e?L1(e,c,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[c]=o,a=(e,c)=>{for(var o in c||(c={}))b1.call(c,o)&&E1(e,o,c[o]);if(u1)for(var o of u1(c))G1.call(c,o)&&E1(e,o,c[o]);return e},v=(e,c)=>v2(e,Z2(c));var S=(e,c)=>{var o={};for(var m in e)b1.call(e,m)&&c.indexOf(m)<0&&(o[m]=e[m]);if(e!=null&&u1)for(var m of u1(e))c.indexOf(m)<0&&G1.call(e,m)&&(o[m]=e[m]);return o};var I1=(e,c)=>()=>(c||e((c={exports:{}}).exports,c),c.exports);var M2=(e,c,o,m)=>{if(c&&typeof c=="object"||typeof c=="function")for(let h of u2(c))!b1.call(e,h)&&h!==o&&L1(e,h,{get:()=>c[h],enumerable:!(m=p2(c,h))||m.enumerable});return e};var B1=(e,c,o)=>(o=e!=null?m2(f2(e)):{},M2(c||!e||!e.__esModule?L1(o,"default",{value:e,enumerable:!0}):o,e));var a2=I1(($1,A1)=>{(function(e,c){typeof $1=="object"&&typeof A1!="undefined"?A1.exports=c():typeof define=="function"&&define.amd?define(c):(e=typeof globalThis!="undefined"?globalThis:e||self).dayjs=c()})($1,function(){"use strict";var e=1e3,c=6e4,o=36e5,m="millisecond",h="second",M="minute",Z="hour",C="day",L="week",p="month",g="quarter",V="year",b="date",F="Invalid Date",G=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,A=/\[([^\]]+)]|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,$={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(t){var i=["th","st","nd","rd"],l=t%100;return"["+t+(i[(l-20)%10]||i[l]||i[0])+"]"}},P=function(t,i,l){var f=String(t);return!f||f.length>=i?t:""+Array(i+1-f.length).join(l)+t},y={s:P,z:function(t){var i=-t.utcOffset(),l=Math.abs(i),f=Math.floor(l/60),n=l%60;return(i<=0?"+":"-")+P(f,2,"0")+":"+P(n,2,"0")},m:function t(i,l){if(i.date()<l.date())return-t(l,i);var f=12*(l.year()-i.year())+(l.month()-i.month()),n=i.clone().add(f,p),d=l-n<0,s=i.clone().add(f+(d?-1:1),p);return+(-(f+(l-n)/(d?n-s:s-n))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(t){return{M:p,y:V,w:L,d:C,D:b,h:Z,m:M,s:h,ms:m,Q:g}[t]||String(t||"").toLowerCase().replace(/s$/,"")},u:function(t){return t===void 0}},x="en",w={};w[x]=$;var D=function(t){return t instanceof u},j=function t(i,l,f){var n;if(!i)return x;if(typeof i=="string"){var d=i.toLowerCase();w[d]&&(n=d),l&&(w[d]=l,n=d);var s=i.split("-");if(!n&&s.length>1)return t(s[0])}else{var k=i.name;w[k]=i,n=k}return!f&&n&&(x=n),n||!f&&x},H=function(t,i){if(D(t))return t.clone();var l=typeof i=="object"?i:{};return l.date=t,l.args=arguments,new u(l)},r=y;r.l=j,r.i=D,r.w=function(t,i){return H(t,{locale:i.$L,utc:i.$u,x:i.$x,$offset:i.$offset})};var u=function(){function t(l){this.$L=j(l.locale,null,!0),this.parse(l)}var i=t.prototype;return i.parse=function(l){this.$d=function(f){var n=f.date,d=f.utc;if(n===null)return new Date(NaN);if(r.u(n))return new Date;if(n instanceof Date)return new Date(n);if(typeof n=="string"&&!/Z$/i.test(n)){var s=n.match(G);if(s){var k=s[2]-1||0,I=(s[7]||"0").substring(0,3);return d?new Date(Date.UTC(s[1],k,s[3]||1,s[4]||0,s[5]||0,s[6]||0,I)):new Date(s[1],k,s[3]||1,s[4]||0,s[5]||0,s[6]||0,I)}}return new Date(n)}(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 r},i.isValid=function(){return this.$d.toString()!==F},i.isSame=function(l,f){var n=H(l);return this.startOf(f)<=n&&n<=this.endOf(f)},i.isAfter=function(l,f){return H(l)<this.startOf(f)},i.isBefore=function(l,f){return this.endOf(f)<H(l)},i.$g=function(l,f,n){return r.u(l)?this[f]:this.set(n,l)},i.unix=function(){return Math.floor(this.valueOf()/1e3)},i.valueOf=function(){return this.$d.getTime()},i.startOf=function(l,f){var n=this,d=!!r.u(f)||f,s=r.p(l),k=function(t1,z){var e1=r.w(n.$u?Date.UTC(n.$y,z,t1):new Date(n.$y,z,t1),n);return d?e1:e1.endOf(C)},I=function(t1,z){return r.w(n.toDate()[t1].apply(n.toDate("s"),(d?[0,0,0,0]:[23,59,59,999]).slice(z)),n)},_=this.$W,U=this.$M,X=this.$D,Q="set"+(this.$u?"UTC":"");switch(s){case V:return d?k(1,0):k(31,11);case p:return d?k(1,U):k(0,U+1);case L:var h1=this.$locale().weekStart||0,d1=(_<h1?_+7:_)-h1;return k(d?X-d1:X+(6-d1),U);case C:case b:return I(Q+"Hours",0);case Z:return I(Q+"Minutes",1);case M:return I(Q+"Seconds",2);case h:return I(Q+"Milliseconds",3);default:return this.clone()}},i.endOf=function(l){return this.startOf(l,!1)},i.$set=function(l,f){var n,d=r.p(l),s="set"+(this.$u?"UTC":""),k=(n={},n[C]=s+"Date",n[b]=s+"Date",n[p]=s+"Month",n[V]=s+"FullYear",n[Z]=s+"Hours",n[M]=s+"Minutes",n[h]=s+"Seconds",n[m]=s+"Milliseconds",n)[d],I=d===C?this.$D+(f-this.$W):f;if(d===p||d===V){var _=this.clone().set(b,1);_.$d[k](I),_.init(),this.$d=_.set(b,Math.min(this.$D,_.daysInMonth())).$d}else k&&this.$d[k](I);return this.init(),this},i.set=function(l,f){return this.clone().$set(l,f)},i.get=function(l){return this[r.p(l)]()},i.add=function(l,f){var n,d=this;l=Number(l);var s=r.p(f),k=function(U){var X=H(d);return r.w(X.date(X.date()+Math.round(U*l)),d)};if(s===p)return this.set(p,this.$M+l);if(s===V)return this.set(V,this.$y+l);if(s===C)return k(1);if(s===L)return k(7);var I=(n={},n[M]=c,n[Z]=o,n[h]=e,n)[s]||1,_=this.$d.getTime()+l*I;return r.w(_,this)},i.subtract=function(l,f){return this.add(-1*l,f)},i.format=function(l){var f=this,n=this.$locale();if(!this.isValid())return n.invalidDate||F;var d=l||"YYYY-MM-DDTHH:mm:ssZ",s=r.z(this),k=this.$H,I=this.$m,_=this.$M,U=n.weekdays,X=n.months,Q=function(z,e1,x1,Z1){return z&&(z[e1]||z(f,d))||x1[e1].slice(0,Z1)},h1=function(z){return r.s(k%12||12,z,"0")},d1=n.meridiem||function(z,e1,x1){var Z1=z<12?"AM":"PM";return x1?Z1.toLowerCase():Z1},t1={YY:String(this.$y).slice(-2),YYYY:this.$y,M:_+1,MM:r.s(_+1,2,"0"),MMM:Q(n.monthsShort,_,X,3),MMMM:Q(X,_),D:this.$D,DD:r.s(this.$D,2,"0"),d:String(this.$W),dd:Q(n.weekdaysMin,this.$W,U,2),ddd:Q(n.weekdaysShort,this.$W,U,3),dddd:U[this.$W],H:String(k),HH:r.s(k,2,"0"),h:h1(1),hh:h1(2),a:d1(k,I,!0),A:d1(k,I,!1),m:String(I),mm:r.s(I,2,"0"),s:String(this.$s),ss:r.s(this.$s,2,"0"),SSS:r.s(this.$ms,3,"0"),Z:s};return d.replace(A,function(z,e1){return e1||t1[z]||s.replace(":","")})},i.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},i.diff=function(l,f,n){var d,s=r.p(f),k=H(l),I=(k.utcOffset()-this.utcOffset())*c,_=this-k,U=r.m(this,k);return U=(d={},d[V]=U/12,d[p]=U,d[g]=U/3,d[L]=(_-I)/6048e5,d[C]=(_-I)/864e5,d[Z]=_/o,d[M]=_/c,d[h]=_/e,d)[s]||_,n?U:r.a(U)},i.daysInMonth=function(){return this.endOf(p).$D},i.$locale=function(){return w[this.$L]},i.locale=function(l,f){if(!l)return this.$L;var n=this.clone(),d=j(l,f,!0);return d&&(n.$L=d),n},i.clone=function(){return r.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()},t}(),Y=u.prototype;return H.prototype=Y,[["$ms",m],["$s",h],["$m",M],["$H",Z],["$W",C],["$M",p],["$y",V],["$D",b]].forEach(function(t){Y[t[1]]=function(i){return this.$g(i,t[0],t[1])}}),H.extend=function(t,i){return t.$i||(t(i,u,H),t.$i=!0),H},H.locale=j,H.isDayjs=D,H.unix=function(t){return H(1e3*t)},H.en=w[x],H.Ls=w,H.p={},H})});var _1=I1((T1,D1)=>{(function(e,c){typeof T1=="object"&&typeof D1!="undefined"?D1.exports=c(a2()):typeof define=="function"&&define.amd?define(["dayjs"],c):(e=typeof globalThis!="undefined"?globalThis:e||self).dayjs_locale_pt_br=c(e.dayjs)})(T1,function(e){"use strict";function c(h){return h&&typeof h=="object"&&"default"in h?h:{default:h}}var o=c(e),m={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(h){return h+"\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(m,null,!0),m})});import{FormProvider as H2}from"react-hook-form";import{jsx as R1}from"react/jsx-runtime";var V2=h=>{var M=h,{children:e,style:c,onSubmit:o}=M,m=S(M,["children","style","onSubmit"]);return R1(H2,v(a({},m),{children:R1("form",{onSubmit:Z=>{Z.preventDefault(),Z.stopPropagation(),o(Z)},style:c,children:e})}))},F1=V2;import{useEffect as y2}from"react";import{useForm as C2}from"react-hook-form";import{zodResolver as g2}from"@hookform/resolvers/zod";var x2=m=>{var h=m,{disableDefaultValuesUpdate:e,onSubmit:c}=h,o=S(h,["disableDefaultValuesUpdate","onSubmit"]);let M=C2(v(a({},o),{resolver:o.schema&&g2(o.schema)}));return y2(()=>{e||M.reset(o.defaultValues)},[o.defaultValues,M.reset]),v(a({},M),{onSubmit:M.handleSubmit(Z=>c(Z,M))})},P1=x2;import{jsx as F2}from"react/jsx-runtime";function L2(m){var h=m,{children:e,style:c}=h,o=S(h,["children","style"]);let M=P1(o);return F2(F1,v(a({},M),{style:c,children:typeof e=="function"?e(M):e}))}var b2=L2;import{memo as A2,useState as T2}from"react";import{Controller as D2,useFormContext as _2}from"react-hook-form";import{Grid as S1,InputAdornment as E2,TextField as G2}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 P2}from"@s_mart/utils";import{jsx as z1,jsxs as k2}from"react/jsx-runtime";var E=({label:e,required:c,regular:o})=>k2("span",{style:{display:"flex",alignItems:"center",gap:P2(2)},children:[z1(Y1,{variant:"caption",fontWeight:o?400:700,style:{display:"flex",alignItems:"center"},children:e}),c&&z1(Y1,{variant:"caption",fontWeight:900,color:"error",children:"*"})]});import{useFormContext as S2}from"react-hook-form";import{Indicator as w2}from"@s_mart/core";var q=(e,c)=>{var o,m,h,M,Z;if(e[c])return e[c];if(c.includes("[")){let[C,L]=c.split("["),[p,g]=L.split("].");return(m=(o=e[C])==null?void 0:o[p])==null?void 0:m[g]}if(c.includes(".")){let[C,L,p]=c.split(".");return p?(Z=(M=e[C])==null?void 0:M[L])==null?void 0:Z[p]:(h=e[C])==null?void 0:h[L]}};import{jsx as $2}from"react/jsx-runtime";var B=({name:e})=>{var m;let c=S2(),o=q((m=c==null?void 0:c.formState)==null?void 0:m.errors,e);return o?$2(w2,{severity:"error",children:o==null?void 0:o.message}):null};import{LIcon as j1,Tooltip as I2}from"@s_mart/core";import{jsx as N,jsxs as N1}from"react/jsx-runtime";var B2=G=>{var A=G,{name:e,rules:c,defaultValue:o,shouldUnregister:m,label:h,required:M,mask:Z,variant:C="outlined",info:L,parse:p,inputMode:g,format:V,onInputChange:b}=A,F=S(A,["name","rules","defaultValue","shouldUnregister","label","required","mask","variant","info","parse","inputMode","format","onInputChange"]);let $=_2();if(!$)throw new Error("Para usar o <TextField /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let[P,y]=T2(!1),x=H=>{var u;let r=H;return V&&(r=V(H)),Z?(u=n1==null?void 0:n1[Z])==null?void 0:u.format(r):r},w=H=>{var u;let r=H;return p&&(r=p(H)),Z?(u=n1==null?void 0:n1[Z])==null?void 0:u.parse(r):r},D=H=>{if(!H||Z!=="porcentagem"&&Z!=="porcentagem0")return;H==null||H.stopPropagation();let r=(H==null?void 0:H.target).value;if(r){let u=String(r);if(u.length>0){let Y=u.indexOf("%");Y>-1&&(H.currentTarget.selectionEnd=Y)}}},j=q($.formState.errors,e);return N(D2,{control:$.control,name:e,rules:c,defaultValue:o,shouldUnregister:m,render:({field:{value:H,onChange:r,ref:u}})=>N1(S1,{display:"flex",flexDirection:"column",children:[N1("div",{style:{display:"flex"},children:[h&&N(S1,{item:!0,children:N(E,{label:h,required:M})}),L&&N(S1,{item:!0,children:N(I2,{title:L,placement:"top",children:N("div",{style:{width:"fit-content"},children:N(j1,{icon:c1,color:"#757575"})})})})]}),N(G2,v(a({variant:C,defaultValue:o,value:x(H||""),onChange:Y=>{var i;let t=w((i=Y==null?void 0:Y.target)==null?void 0:i.value);r(t),b==null||b(t,$.getValues())},error:!!j},F),{type:F.type==="password"?P?"text":"password":F.type,autoComplete:F.autoComplete||"off",inputProps:a({inputMode:g},F.inputProps),InputProps:a({onKeyDown:D,inputRef:u,endAdornment:F.type==="password"&&N(E2,{position:"start",onClick:()=>y(!P),style:{cursor:"pointer"},children:N(j1,{icon:P?O1:U1,size:"24px",removeMargin:!0})})},F.InputProps)}),e),N(B,{name:e})]})})},R2=A2(B2);import{memo as O2,useState as U2}from"react";import{Controller as q2,useFormContext as Y2}from"react-hook-form";import{Divider as z2,LIcon as j2,Tooltip as N2}from"@s_mart/core";import{Grid as l1,Select as W2,MenuItem as W1,useTheme as J2}from"@mui/material";import{jsx as O,jsxs as f1}from"react/jsx-runtime";var K2=G=>{var A=G,{name:e,rules:c,defaultValue:o,shouldUnregister:m,label:h,required:M,options:Z,placeholder:C,disableOnChangeForm:L=!1,multiple:p,info:g,footer:V,onChange:b}=A,F=S(A,["name","rules","defaultValue","shouldUnregister","label","required","options","placeholder","disableOnChangeForm","multiple","info","footer","onChange"]);let $=Y2(),{palette:P}=J2(),[y,x]=U2(!1);if(!$)throw new Error("Para usar o <Select /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let w=q($.formState.errors,e);return console.warn=()=>{},O(q2,{control:$.control,name:e,rules:c,defaultValue:o,shouldUnregister:m,render:({field:{value:D,onChange:j,ref:H}})=>f1(l1,{display:"flex",flexDirection:"column",children:[f1("div",{style:{display:"flex"},children:[h&&O(l1,{item:!0,children:O(E,{label:h,required:M})}),g&&O(l1,{item:!0,children:O(N2,{title:g,placement:"top",children:O("div",{style:{width:"fit-content"},children:O(j2,{icon:c1,color:"#757575"})})})})]}),f1(W2,v(a({open:y,onOpen:()=>x(!0),onClose:()=>x(!1),displayEmpty:!!C,variant:"outlined",autoComplete:"off",value:D?D||"":p?[]:"",renderValue:r=>{if(r.label)return r.label;if(C)return O("p",{style:{color:P.grey[400]},children:C})},multiple:p,onChange:r=>{!L&&j(r.target.value),b&&b(r.target.value,$.getValues())},error:!!w,size:F.size||"medium",inputRef:H},F),{children:[C&&O(W1,{disabled:!0,value:"",children:O("p",{style:{color:P.grey[400]},children:C})}),Z==null?void 0:Z.map((r,u)=>O(W1,{value:r,children:f1(l1,{container:!0,direction:"column",children:[O(l1,{item:!0,children:r.label}),r.afterLabel&&O(l1,{item:!0,children:r.afterLabel})]})},u)),V&&[O(l1,{px:2,py:1,children:O(z2,{})},"footer-divider"),O("div",{children:V({closeSelect:()=>x(!1)})},"footer-content")]]}),e),O(B,{name:e})]})})},Q2=O2(K2);import{forwardRef as X2,memo as e0}from"react";import{Controller as c0,useFormContext as i0}from"react-hook-form";import{Grid as i1,Autocomplete as l0,TextField as a0}from"@mui/material";import{Divider as J1,LIcon as o0,Tooltip as r0}from"@s_mart/core";import{colorPalette as t0}from"@s_mart/tokens";import{Fragment as M1,jsx as R,jsxs as a1}from"react/jsx-runtime";import{createElement as K1}from"react";var n0=$=>{var P=$,{name:e,rules:c,defaultValue:o,shouldUnregister:m,label:h,required:M,options:Z,textFieldProps:C,noOptionsText:L,footer:p,multiple:g,info:V,placeholder:b,onChange:F,onInputChange:G}=P,A=S(P,["name","rules","defaultValue","shouldUnregister","label","required","options","textFieldProps","noOptionsText","footer","multiple","info","placeholder","onChange","onInputChange"]);let y=i0();if(!y)throw new Error("Para usar o <Searchable /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let x=q(y.formState.errors,e);return console.warn=()=>{},R(c0,{control:y.control,name:e,rules:c,defaultValue:o,shouldUnregister:m,render:({field:{onChange:w,value:D,ref:j}})=>{var H;return a1(i1,{display:"flex",flexDirection:"column",children:[a1("div",{style:{display:"flex"},children:[h&&R(i1,{item:!0,children:R(E,{label:h,required:M})}),V&&R(i1,{item:!0,children:R(r0,{title:V,placement:"top",children:R("div",{style:{width:"fit-content"},children:R(o0,{icon:c1,color:"#757575"})})})})]}),R(l0,v(a({onChange:(r,u)=>{w(u),F==null||F(u,y.getValues())},onInputChange:(r,u,Y)=>{Y==="input"&&setTimeout(()=>{G==null||G(u,y.getValues())},0)},slotProps:v(a({},A.slotProps||{}),{paper:v(a({},(A.slotProps||{}).paper||{}),{sx:a({border:`1px solid ${t0.neutral[30]}`,boxShadow:"0px 2px 4px rgba(0, 0, 0, 0.15)"},((H=(A.slotProps||{}).paper)==null?void 0:H.sx)||{})})}),value:D||(g?[]:null),options:Z,multiple:g,noOptionsText:a1(M1,{children:[L||"Nenhum resultado encontrado",p?a1(M1,{children:[R(i1,{py:1,children:R(J1,{})}),p]}):null]}),isOptionEqualToValue:(r,u)=>typeof r=="string"&&typeof u=="string"?r===u:typeof r=="object"&&typeof u=="object"?typeof r.value=="object"&&typeof u.value=="object"&&r.key!==void 0&&u.key!==void 0?r.key===u.key:r.value===u.value:!1,renderOption:(r,u)=>typeof u=="object"?K1("li",v(a({},r),{key:u.key||u.value}),a1(i1,{container:!0,direction:"column",children:[R(i1,{item:!0,children:u.label}),u.afterLabel&&R(i1,{item:!0,children:u.afterLabel})]})):K1("li",v(a({},r),{key:u}),u),ListboxComponent:X2(function(u,Y){return a1(M1,{children:[R("ul",v(a({},u),{ref:Y})),!!p&&R("div",v(a({},u),{children:a1(M1,{children:[R(i1,{px:2,py:1,children:R(J1,{})}),p]})}),"searchable-footer")]})})},A),{renderInput:r=>R(a0,v(a(a({error:!!x,placeholder:b},r),C),{inputRef:j}))}),e),R(B,{name:e})]})}})},s0=e0(n0);import{forwardRef as m0,memo as v0}from"react";import{Controller as p0,useFormContext as Z0}from"react-hook-form";import{isObject as u0,isEmpty as f0}from"lodash";import{Grid as o1,Autocomplete as M0,TextField as H0}from"@mui/material";import{LIcon as V1,Tooltip as V0,Button as y0,Divider as C0}from"@s_mart/core";import{colorPalette as g0}from"@s_mart/tokens";import{toRem as c2}from"@s_mart/utils";import{toRem as H1}from"@s_mart/utils";import h0 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;
|