@s_mart/form 3.3.1 → 3.3.3

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.d.ts CHANGED
@@ -83,7 +83,7 @@ type TextFieldProps = TextFieldProps$1 & ControllerTextField & {
83
83
  info?: React.ReactNode;
84
84
  };
85
85
 
86
- declare const _default$6: react.MemoExoticComponent<({ name, rules, defaultValue, shouldUnregister, label, required, mask, variant, info, parse, format, onInputChange, ...rest }: TextFieldProps) => react_jsx_runtime.JSX.Element>;
86
+ declare const _default$6: react.MemoExoticComponent<({ name, rules, defaultValue, shouldUnregister, label, required, mask, variant, info, parse, inputMode, format, onInputChange, ...rest }: TextFieldProps) => react_jsx_runtime.JSX.Element>;
87
87
 
88
88
  declare const _default$5: react.MemoExoticComponent<({ name, rules, defaultValue, shouldUnregister, label, required, options, placeholder, disableOnChangeForm, multiple, info, footer, onChange: onChangeProp, ...rest }: SelectProps) => react_jsx_runtime.JSX.Element>;
89
89
 
package/dist/index.js CHANGED
@@ -1,8 +1,8 @@
1
- "use strict";var u2=Object.create;var g1=Object.defineProperty,f2=Object.defineProperties,M2=Object.getOwnPropertyDescriptor,H2=Object.getOwnPropertyDescriptors,V2=Object.getOwnPropertyNames,S1=Object.getOwnPropertySymbols,y2=Object.getPrototypeOf,Q1=Object.prototype.hasOwnProperty,v0=Object.prototype.propertyIsEnumerable;var m0=(e,c,o)=>c in e?g1(e,c,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[c]=o,n=(e,c)=>{for(var o in c||(c={}))Q1.call(c,o)&&m0(e,o,c[o]);if(S1)for(var o of S1(c))v0.call(c,o)&&m0(e,o,c[o]);return e},u=(e,c)=>f2(e,H2(c));var k=(e,c)=>{var o={};for(var s in e)Q1.call(e,s)&&c.indexOf(s)<0&&(o[s]=e[s]);if(e!=null&&S1)for(var s of S1(e))c.indexOf(s)<0&&v0.call(e,s)&&(o[s]=e[s]);return o};var p0=(e,c)=>()=>(c||e((c={exports:{}}).exports,c),c.exports),g2=(e,c)=>{for(var o in c)g1(e,o,{get:c[o],enumerable:!0})},Z0=(e,c,o,s)=>{if(c&&typeof c=="object"||typeof c=="function")for(let r of V2(c))!Q1.call(e,r)&&r!==o&&g1(e,r,{get:()=>c[r],enumerable:!(s=M2(c,r))||s.enumerable});return e};var p1=(e,c,o)=>(o=e!=null?u2(y2(e)):{},Z0(c||!e||!e.__esModule?g1(o,"default",{value:e,enumerable:!0}):o,e)),x2=e=>Z0(g1({},"__esModule",{value:!0}),e);var q0=p0((t0,n0)=>{(function(e,c){typeof t0=="object"&&typeof n0!="undefined"?n0.exports=c():typeof define=="function"&&define.amd?define(c):(e=typeof globalThis!="undefined"?globalThis:e||self).dayjs=c()})(t0,function(){"use strict";var e=1e3,c=6e4,o=36e5,s="millisecond",r="second",p="minute",v="hour",H="day",L="week",h="month",g="quarter",V="year",x="date",A="Invalid Date",D=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\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,b={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(m){var a=["th","st","nd","rd"],i=m%100;return"["+m+(a[(i-20)%10]||a[i]||a[0])+"]"}},F=function(m,a,i){var Z=String(m);return!Z||Z.length>=a?m:""+Array(a+1-Z.length).join(i)+m},_={s:F,z:function(m){var a=-m.utcOffset(),i=Math.abs(a),Z=Math.floor(i/60),t=i%60;return(a<=0?"+":"-")+F(Z,2,"0")+":"+F(t,2,"0")},m:function m(a,i){if(a.date()<i.date())return-m(i,a);var Z=12*(i.year()-a.year())+(i.month()-a.month()),t=a.clone().add(Z,h),M=i-t<0,f=a.clone().add(Z+(M?-1:1),h);return+(-(Z+(i-t)/(M?t-f:f-t))||0)},a:function(m){return m<0?Math.ceil(m)||0:Math.floor(m)},p:function(m){return{M:h,y:V,w:L,d:H,D:x,h:v,m:p,s:r,ms:s,Q:g}[m]||String(m||"").toLowerCase().replace(/s$/,"")},u:function(m){return m===void 0}},y="en",T={};T[y]=b;var q=function(m){return m instanceof B},C=function m(a,i,Z){var t;if(!a)return y;if(typeof a=="string"){var M=a.toLowerCase();T[M]&&(t=M),i&&(T[M]=i,t=M);var f=a.split("-");if(!t&&f.length>1)return m(f[0])}else{var S=a.name;T[S]=a,t=S}return!Z&&t&&(y=t),t||!Z&&y},d=function(m,a){if(q(m))return m.clone();var i=typeof a=="object"?a:{};return i.date=m,i.args=arguments,new B(i)},l=_;l.l=C,l.i=q,l.w=function(m,a){return d(m,{locale:a.$L,utc:a.$u,x:a.$x,$offset:a.$offset})};var B=function(){function m(i){this.$L=C(i.locale,null,!0),this.parse(i)}var a=m.prototype;return a.parse=function(i){this.$d=function(Z){var t=Z.date,M=Z.utc;if(t===null)return new Date(NaN);if(l.u(t))return new Date;if(t instanceof Date)return new Date(t);if(typeof t=="string"&&!/Z$/i.test(t)){var f=t.match(D);if(f){var S=f[2]-1||0,R=(f[7]||"0").substring(0,3);return M?new Date(Date.UTC(f[1],S,f[3]||1,f[4]||0,f[5]||0,f[6]||0,R)):new Date(f[1],S,f[3]||1,f[4]||0,f[5]||0,f[6]||0,R)}}return new Date(t)}(i),this.$x=i.x||{},this.init()},a.init=function(){var i=this.$d;this.$y=i.getFullYear(),this.$M=i.getMonth(),this.$D=i.getDate(),this.$W=i.getDay(),this.$H=i.getHours(),this.$m=i.getMinutes(),this.$s=i.getSeconds(),this.$ms=i.getMilliseconds()},a.$utils=function(){return l},a.isValid=function(){return this.$d.toString()!==A},a.isSame=function(i,Z){var t=d(i);return this.startOf(Z)<=t&&t<=this.endOf(Z)},a.isAfter=function(i,Z){return d(i)<this.startOf(Z)},a.isBefore=function(i,Z){return this.endOf(Z)<d(i)},a.$g=function(i,Z,t){return l.u(i)?this[Z]:this.set(t,i)},a.unix=function(){return Math.floor(this.valueOf()/1e3)},a.valueOf=function(){return this.$d.getTime()},a.startOf=function(i,Z){var t=this,M=!!l.u(Z)||Z,f=l.p(i),S=function(v1,N){var a1=l.w(t.$u?Date.UTC(t.$y,N,v1):new Date(t.$y,N,v1),t);return M?a1:a1.endOf(H)},R=function(v1,N){return l.w(t.toDate()[v1].apply(t.toDate("s"),(M?[0,0,0,0]:[23,59,59,999]).slice(N)),t)},G=this.$W,U=this.$M,l1=this.$D,e1="set"+(this.$u?"UTC":"");switch(f){case V:return M?S(1,0):S(31,11);case h:return M?S(1,U):S(0,U+1);case L:var V1=this.$locale().weekStart||0,y1=(G<V1?G+7:G)-V1;return S(M?l1-y1:l1+(6-y1),U);case H:case x:return R(e1+"Hours",0);case v:return R(e1+"Minutes",1);case p:return R(e1+"Seconds",2);case r:return R(e1+"Milliseconds",3);default:return this.clone()}},a.endOf=function(i){return this.startOf(i,!1)},a.$set=function(i,Z){var t,M=l.p(i),f="set"+(this.$u?"UTC":""),S=(t={},t[H]=f+"Date",t[x]=f+"Date",t[h]=f+"Month",t[V]=f+"FullYear",t[v]=f+"Hours",t[p]=f+"Minutes",t[r]=f+"Seconds",t[s]=f+"Milliseconds",t)[M],R=M===H?this.$D+(Z-this.$W):Z;if(M===h||M===V){var G=this.clone().set(x,1);G.$d[S](R),G.init(),this.$d=G.set(x,Math.min(this.$D,G.daysInMonth())).$d}else S&&this.$d[S](R);return this.init(),this},a.set=function(i,Z){return this.clone().$set(i,Z)},a.get=function(i){return this[l.p(i)]()},a.add=function(i,Z){var t,M=this;i=Number(i);var f=l.p(Z),S=function(U){var l1=d(M);return l.w(l1.date(l1.date()+Math.round(U*i)),M)};if(f===h)return this.set(h,this.$M+i);if(f===V)return this.set(V,this.$y+i);if(f===H)return S(1);if(f===L)return S(7);var R=(t={},t[p]=c,t[v]=o,t[r]=e,t)[f]||1,G=this.$d.getTime()+i*R;return l.w(G,this)},a.subtract=function(i,Z){return this.add(-1*i,Z)},a.format=function(i){var Z=this,t=this.$locale();if(!this.isValid())return t.invalidDate||A;var M=i||"YYYY-MM-DDTHH:mm:ssZ",f=l.z(this),S=this.$H,R=this.$m,G=this.$M,U=t.weekdays,l1=t.months,e1=function(N,a1,K1,w1){return N&&(N[a1]||N(Z,M))||K1[a1].slice(0,w1)},V1=function(N){return l.s(S%12||12,N,"0")},y1=t.meridiem||function(N,a1,K1){var w1=N<12?"AM":"PM";return K1?w1.toLowerCase():w1},v1={YY:String(this.$y).slice(-2),YYYY:this.$y,M:G+1,MM:l.s(G+1,2,"0"),MMM:e1(t.monthsShort,G,l1,3),MMMM:e1(l1,G),D:this.$D,DD:l.s(this.$D,2,"0"),d:String(this.$W),dd:e1(t.weekdaysMin,this.$W,U,2),ddd:e1(t.weekdaysShort,this.$W,U,3),dddd:U[this.$W],H:String(S),HH:l.s(S,2,"0"),h:V1(1),hh:V1(2),a:y1(S,R,!0),A:y1(S,R,!1),m:String(R),mm:l.s(R,2,"0"),s:String(this.$s),ss:l.s(this.$s,2,"0"),SSS:l.s(this.$ms,3,"0"),Z:f};return M.replace($,function(N,a1){return a1||v1[N]||f.replace(":","")})},a.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},a.diff=function(i,Z,t){var M,f=l.p(Z),S=d(i),R=(S.utcOffset()-this.utcOffset())*c,G=this-S,U=l.m(this,S);return U=(M={},M[V]=U/12,M[h]=U,M[g]=U/3,M[L]=(G-R)/6048e5,M[H]=(G-R)/864e5,M[v]=G/o,M[p]=G/c,M[r]=G/e,M)[f]||G,t?U:l.a(U)},a.daysInMonth=function(){return this.endOf(h).$D},a.$locale=function(){return T[this.$L]},a.locale=function(i,Z){if(!i)return this.$L;var t=this.clone(),M=C(i,Z,!0);return M&&(t.$L=M),t},a.clone=function(){return l.w(this.$d,this)},a.toDate=function(){return new Date(this.valueOf())},a.toJSON=function(){return this.isValid()?this.toISOString():null},a.toISOString=function(){return this.$d.toISOString()},a.toString=function(){return this.$d.toUTCString()},m}(),h1=B.prototype;return d.prototype=h1,[["$ms",s],["$s",r],["$m",p],["$H",v],["$W",H],["$M",h],["$y",V],["$D",x]].forEach(function(m){h1[m[1]]=function(a){return this.$g(a,m[0],m[1])}}),d.extend=function(m,a){return m.$i||(m(a,B,d),m.$i=!0),d},d.locale=C,d.isDayjs=q,d.unix=function(m){return d(1e3*m)},d.en=T[y],d.Ls=T,d.p={},d})});var d0=p0((s0,h0)=>{(function(e,c){typeof s0=="object"&&typeof h0!="undefined"?h0.exports=c(q0()):typeof define=="function"&&define.amd?define(["dayjs"],c):(e=typeof globalThis!="undefined"?globalThis:e||self).dayjs_locale_pt_br=c(e.dayjs)})(s0,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 U2={};g2(U2,{Autocomplete:()=>p2,Checkbox:()=>E0,Creatable:()=>_0,DatePicker:()=>e2,Form:()=>V0,FormProvider:()=>A1,RadioButton:()=>I0,RadioGroup:()=>B0,Searchable:()=>S0,Select:()=>w0,Slider:()=>O0,Switch:()=>G0,TextField:()=>k0,TimePicker:()=>m2,useForm:()=>$1});module.exports=x2(U2);var u0=require("react-hook-form");var X1=require("react/jsx-runtime"),L2=r=>{var p=r,{children:e,style:c,onSubmit:o}=p,s=k(p,["children","style","onSubmit"]);return(0,X1.jsx)(u0.FormProvider,u(n({},s),{children:(0,X1.jsx)("form",{onSubmit:v=>{v.preventDefault(),v.stopPropagation(),o(v)},style:c,children:e})}))},A1=L2;var f0=require("react"),M0=require("react-hook-form"),H0=require("@hookform/resolvers/zod");var F2=s=>{var r=s,{disableDefaultValuesUpdate:e,onSubmit:c}=r,o=k(r,["disableDefaultValuesUpdate","onSubmit"]);let p=(0,M0.useForm)(u(n({},o),{resolver:o.schema&&(0,H0.zodResolver)(o.schema)}));return(0,f0.useEffect)(()=>{e||p.reset(o.defaultValues)},[o.defaultValues,p.reset]),u(n({},p),{onSubmit:p.handleSubmit(v=>c(v,p))})},$1=F2;var y0=require("react/jsx-runtime");function b2(s){var r=s,{children:e,style:c}=r,o=k(r,["children","style"]);let p=$1(o);return(0,y0.jsx)(A1,u(n({},p),{style:c,children:typeof e=="function"?e(p):e}))}var V0=b2;var T1=require("react"),D1=require("react-hook-form"),r1=require("@mui/material");var g0={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"},x0={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 o1={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 e0={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 c0=require("@mui/material"),F0=require("@s_mart/utils"),x1=require("react/jsx-runtime"),I=({label:e,required:c,regular:o})=>(0,x1.jsxs)("span",{style:{display:"flex",alignItems:"center",gap:(0,F0.toRem)(2)},children:[(0,x1.jsx)(c0.Typography,{variant:"caption",fontWeight:o?400:700,style:{display:"flex",alignItems:"center"},children:e}),c&&(0,x1.jsx)(c0.Typography,{variant:"caption",fontWeight:900,color:"error",children:"*"})]});var b0=require("react-hook-form"),C0=require("@s_mart/core");var z=(e,c)=>{var o,s,r,p,v;if(e[c])return e[c];if(c.includes("[")){let[H,L]=c.split("["),[h,g]=L.split("].");return(s=(o=e[H])==null?void 0:o[h])==null?void 0:s[g]}if(c.includes(".")){let[H,L,h]=c.split(".");return h?(v=(p=e[H])==null?void 0:p[L])==null?void 0:v[h]:(r=e[H])==null?void 0:r[L]}};var P0=require("react/jsx-runtime"),O=({name:e})=>{var s;let c=(0,b0.useFormContext)(),o=z((s=c==null?void 0:c.formState)==null?void 0:s.errors,e);return o?(0,P0.jsx)(C0.Indicator,{severity:"error",children:o==null?void 0:o.message}):null};var L1=require("@s_mart/core");var Y=require("react/jsx-runtime"),C2=A=>{var D=A,{name:e,rules:c,defaultValue:o,shouldUnregister:s,label:r,required:p,mask:v,variant:H="outlined",info:L,parse:h,format:g,onInputChange:V}=D,x=k(D,["name","rules","defaultValue","shouldUnregister","label","required","mask","variant","info","parse","format","onInputChange"]);let $=(0,D1.useFormContext)();if(!$)throw new Error("Para usar o <TextField /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let[b,F]=(0,T1.useState)(!1),_=C=>{var l;let d=C;return g&&(d=g(C)),v?(l=Z1==null?void 0:Z1[v])==null?void 0:l.format(d):d},y=C=>{var l;let d=C;return h&&(d=h(C)),v?(l=Z1==null?void 0:Z1[v])==null?void 0:l.parse(d):d},T=C=>{if(!C||v!=="porcentagem")return;C==null||C.stopPropagation();let d=(C==null?void 0:C.target).value;if(d){let l=String(d);if(l.length>0){let B=l.indexOf("%");B>-1&&(C.currentTarget.selectionEnd=B)}}},q=z($.formState.errors,e);return(0,Y.jsx)(D1.Controller,{control:$.control,name:e,rules:c,defaultValue:o,shouldUnregister:s,render:({field:{value:C,onChange:d,ref:l}})=>(0,Y.jsxs)(r1.Grid,{display:"flex",flexDirection:"column",children:[(0,Y.jsxs)("div",{style:{display:"flex"},children:[r&&(0,Y.jsx)(r1.Grid,{item:!0,children:(0,Y.jsx)(I,{label:r,required:p})}),L&&(0,Y.jsx)(r1.Grid,{item:!0,children:(0,Y.jsx)(L1.Tooltip,{title:L,placement:"top",children:(0,Y.jsx)("div",{style:{width:"fit-content"},children:(0,Y.jsx)(L1.LIcon,{icon:o1,color:"#757575"})})})})]}),(0,Y.jsx)(r1.TextField,u(n({variant:H,defaultValue:o,value:_(C||""),onChange:B=>{var m;let h1=y((m=B==null?void 0:B.target)==null?void 0:m.value);d(h1),V==null||V(h1,$.watch())},error:!!q},x),{type:x.type==="password"?b?"text":"password":x.type,autoComplete:x.autoComplete||"off",InputProps:n({onKeyDown:T,inputRef:l,endAdornment:x.type==="password"&&(0,Y.jsx)(r1.InputAdornment,{position:"end",onClick:()=>F(!b),style:{cursor:"pointer"},children:(0,Y.jsx)(L1.LIcon,{icon:b?g0:x0,size:"24px",removeMargin:!0})})},x.InputProps)}),e),(0,Y.jsx)(O,{name:e})]})})},k0=(0,T1.memo)(C2);var _1=require("react"),E1=require("react-hook-form"),u1=require("@s_mart/core"),j=require("@mui/material");var E=require("react/jsx-runtime"),P2=D=>{var $=D,{name:e,rules:c,defaultValue:o,shouldUnregister:s,label:r,required:p,options:v,placeholder:H,disableOnChangeForm:L=!1,multiple:h,info:g,footer:V,onChange:x}=$,A=k($,["name","rules","defaultValue","shouldUnregister","label","required","options","placeholder","disableOnChangeForm","multiple","info","footer","onChange"]);let b=(0,E1.useFormContext)(),{palette:F}=(0,j.useTheme)(),[_,y]=(0,_1.useState)(!1);if(!b)throw new Error("Para usar o <Select /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let T=z(b.formState.errors,e);return console.warn=()=>{},(0,E.jsx)(E1.Controller,{control:b.control,name:e,rules:c,defaultValue:o,shouldUnregister:s,render:({field:{value:q,onChange:C,ref:d}})=>(0,E.jsxs)(j.Grid,{display:"flex",flexDirection:"column",children:[(0,E.jsxs)("div",{style:{display:"flex"},children:[r&&(0,E.jsx)(j.Grid,{item:!0,children:(0,E.jsx)(I,{label:r,required:p})}),g&&(0,E.jsx)(j.Grid,{item:!0,children:(0,E.jsx)(u1.Tooltip,{title:g,placement:"top",children:(0,E.jsx)("div",{style:{width:"fit-content"},children:(0,E.jsx)(u1.LIcon,{icon:o1,color:"#757575"})})})})]}),(0,E.jsxs)(j.Select,u(n({open:_,onOpen:()=>y(!0),onClose:()=>y(!1),displayEmpty:!!H,variant:"outlined",autoComplete:"off",value:q?q||"":h?[]:"",renderValue:l=>{if(l.label)return l.label;if(H)return(0,E.jsx)("p",{style:{color:F.grey[400]},children:H})},multiple:h,onChange:l=>{!L&&C(l.target.value),x&&x(l.target.value,b.watch())},error:!!T,size:A.size||"medium",inputRef:d},A),{children:[H&&(0,E.jsx)(j.MenuItem,{disabled:!0,value:"",children:(0,E.jsx)("p",{style:{color:F.grey[400]},children:H})}),v==null?void 0:v.map((l,B)=>(0,E.jsx)(j.MenuItem,{value:l,children:(0,E.jsxs)(j.Grid,{container:!0,direction:"column",children:[(0,E.jsx)(j.Grid,{item:!0,children:l.label}),l.afterLabel&&(0,E.jsx)(j.Grid,{item:!0,children:l.afterLabel})]})},B)),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:()=>y(!1)})},"footer-content")]]}),e),(0,E.jsx)(O,{name:e})]})})},w0=(0,_1.memo)(P2);var G1=require("react"),I1=require("react-hook-form"),d1=require("@s_mart/core");var W=require("@mui/material");var P=require("react/jsx-runtime"),i0=require("react"),k2=b=>{var F=b,{name:e,rules:c,defaultValue:o,shouldUnregister:s,label:r,required:p,options:v,textFieldProps:H,noOptionsText:L,footer:h,multiple:g,info:V,placeholder:x,onChange:A,onInputChange:D}=F,$=k(F,["name","rules","defaultValue","shouldUnregister","label","required","options","textFieldProps","noOptionsText","footer","multiple","info","placeholder","onChange","onInputChange"]);let _=(0,I1.useFormContext)();if(!_)throw new Error("Para usar o <Searchable /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let y=z(_.formState.errors,e);return console.warn=()=>{},(0,P.jsx)(I1.Controller,{control:_.control,name:e,rules:c,defaultValue:o,shouldUnregister:s,render:({field:{onChange:T,value:q,ref:C}})=>(0,P.jsxs)(W.Grid,{display:"flex",flexDirection:"column",children:[(0,P.jsxs)("div",{style:{display:"flex"},children:[r&&(0,P.jsx)(W.Grid,{item:!0,children:(0,P.jsx)(I,{label:r,required:p})}),V&&(0,P.jsx)(W.Grid,{item:!0,children:(0,P.jsx)(d1.Tooltip,{title:V,placement:"top",children:(0,P.jsx)("div",{style:{width:"fit-content"},children:(0,P.jsx)(d1.LIcon,{icon:o1,color:"#757575"})})})})]}),(0,P.jsx)(W.Autocomplete,u(n({onChange:(d,l)=>{T(l),A==null||A(l,_.watch())},onInputChange:(d,l,B)=>{B==="input"&&setTimeout(()=>{D==null||D(l,_.watch())},0)},value:q||(g?[]:null),options:v,multiple:g,noOptionsText:(0,P.jsxs)(P.Fragment,{children:[L||"Nenhum resultado encontrado",h?(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(W.Grid,{py:1,children:(0,P.jsx)(d1.Divider,{})}),h]}):null]}),isOptionEqualToValue:(d,l)=>typeof d=="string"&&typeof l=="string"?d===l:typeof d=="object"&&typeof l=="object"?d.value===l.value:!1,renderOption:(d,l)=>typeof l=="object"?(0,i0.createElement)("li",u(n({},d),{key:l.key||l.value}),(0,P.jsxs)(W.Grid,{container:!0,direction:"column",children:[(0,P.jsx)(W.Grid,{item:!0,children:l.label}),l.afterLabel&&(0,P.jsx)(W.Grid,{item:!0,children:l.afterLabel})]})):(0,i0.createElement)("li",u(n({},d),{key:l}),l),ListboxComponent:(0,G1.forwardRef)(function(l,B){return(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)("ul",u(n({},l),{ref:B})),!!h&&(0,P.jsx)("div",u(n({},l),{children:(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(W.Grid,{px:2,py:1,children:(0,P.jsx)(d1.Divider,{})}),h]})}),"searchable-footer")]})})},$),{renderInput:d=>(0,P.jsx)(W.TextField,u(n(n({error:!!y,placeholder:x},d),H),{inputRef:C}))}),e),(0,P.jsx)(O,{name:e})]})})},S0=(0,G1.memo)(k2);var D0=require("react"),B1=require("react-hook-form"),J=require("@mui/material");var F1=require("@s_mart/utils"),A0=p1(require("@emotion/styled")),l0=require("@emotion/react"),$0=l0.css`
1
+ "use strict";var M2=Object.create;var g1=Object.defineProperty,H2=Object.defineProperties,V2=Object.getOwnPropertyDescriptor,y2=Object.getOwnPropertyDescriptors,g2=Object.getOwnPropertyNames,w1=Object.getOwnPropertySymbols,x2=Object.getPrototypeOf,Q1=Object.prototype.hasOwnProperty,v0=Object.prototype.propertyIsEnumerable;var m0=(e,c,o)=>c in e?g1(e,c,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[c]=o,n=(e,c)=>{for(var o in c||(c={}))Q1.call(c,o)&&m0(e,o,c[o]);if(w1)for(var o of w1(c))v0.call(c,o)&&m0(e,o,c[o]);return e},p=(e,c)=>H2(e,y2(c));var k=(e,c)=>{var o={};for(var s in e)Q1.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&&v0.call(e,s)&&(o[s]=e[s]);return o};var p0=(e,c)=>()=>(c||e((c={exports:{}}).exports,c),c.exports),L2=(e,c)=>{for(var o in c)g1(e,o,{get:c[o],enumerable:!0})},Z0=(e,c,o,s)=>{if(c&&typeof c=="object"||typeof c=="function")for(let r of g2(c))!Q1.call(e,r)&&r!==o&&g1(e,r,{get:()=>c[r],enumerable:!(s=V2(c,r))||s.enumerable});return e};var p1=(e,c,o)=>(o=e!=null?M2(x2(e)):{},Z0(c||!e||!e.__esModule?g1(o,"default",{value:e,enumerable:!0}):o,e)),F2=e=>Z0(g1({},"__esModule",{value:!0}),e);var q0=p0((t0,n0)=>{(function(e,c){typeof t0=="object"&&typeof n0!="undefined"?n0.exports=c():typeof define=="function"&&define.amd?define(c):(e=typeof globalThis!="undefined"?globalThis:e||self).dayjs=c()})(t0,function(){"use strict";var e=1e3,c=6e4,o=36e5,s="millisecond",r="second",Z="minute",v="hour",V="day",x="week",d="month",L="quarter",y="year",b="date",C="Invalid Date",B=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,T=/\[([^\]]+)]|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,F={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(m){var a=["th","st","nd","rd"],i=m%100;return"["+m+(a[(i-20)%10]||a[i]||a[0])+"]"}},g=function(m,a,i){var u=String(m);return!u||u.length>=a?m:""+Array(a+1-u.length).join(i)+m},D={s:g,z:function(m){var a=-m.utcOffset(),i=Math.abs(a),u=Math.floor(i/60),t=i%60;return(a<=0?"+":"-")+g(u,2,"0")+":"+g(t,2,"0")},m:function m(a,i){if(a.date()<i.date())return-m(i,a);var u=12*(i.year()-a.year())+(i.month()-a.month()),t=a.clone().add(u,d),H=i-t<0,f=a.clone().add(u+(H?-1:1),d);return+(-(u+(i-t)/(H?t-f:f-t))||0)},a:function(m){return m<0?Math.ceil(m)||0:Math.floor(m)},p:function(m){return{M:d,y,w:x,d:V,D:b,h:v,m:Z,s:r,ms:s,Q:L}[m]||String(m||"").toLowerCase().replace(/s$/,"")},u:function(m){return m===void 0}},M="en",$={};$[M]=F;var O=function(m){return m instanceof A},N=function m(a,i,u){var t;if(!a)return M;if(typeof a=="string"){var H=a.toLowerCase();$[H]&&(t=H),i&&($[H]=i,t=H);var f=a.split("-");if(!t&&f.length>1)return m(f[0])}else{var w=a.name;$[w]=a,t=w}return!u&&t&&(M=t),t||!u&&M},h=function(m,a){if(O(m))return m.clone();var i=typeof a=="object"?a:{};return i.date=m,i.args=arguments,new A(i)},l=D;l.l=N,l.i=O,l.w=function(m,a){return h(m,{locale:a.$L,utc:a.$u,x:a.$x,$offset:a.$offset})};var A=function(){function m(i){this.$L=N(i.locale,null,!0),this.parse(i)}var a=m.prototype;return a.parse=function(i){this.$d=function(u){var t=u.date,H=u.utc;if(t===null)return new Date(NaN);if(l.u(t))return new Date;if(t instanceof Date)return new Date(t);if(typeof t=="string"&&!/Z$/i.test(t)){var f=t.match(B);if(f){var w=f[2]-1||0,I=(f[7]||"0").substring(0,3);return H?new Date(Date.UTC(f[1],w,f[3]||1,f[4]||0,f[5]||0,f[6]||0,I)):new Date(f[1],w,f[3]||1,f[4]||0,f[5]||0,f[6]||0,I)}}return new Date(t)}(i),this.$x=i.x||{},this.init()},a.init=function(){var i=this.$d;this.$y=i.getFullYear(),this.$M=i.getMonth(),this.$D=i.getDate(),this.$W=i.getDay(),this.$H=i.getHours(),this.$m=i.getMinutes(),this.$s=i.getSeconds(),this.$ms=i.getMilliseconds()},a.$utils=function(){return l},a.isValid=function(){return this.$d.toString()!==C},a.isSame=function(i,u){var t=h(i);return this.startOf(u)<=t&&t<=this.endOf(u)},a.isAfter=function(i,u){return h(i)<this.startOf(u)},a.isBefore=function(i,u){return this.endOf(u)<h(i)},a.$g=function(i,u,t){return l.u(i)?this[u]:this.set(t,i)},a.unix=function(){return Math.floor(this.valueOf()/1e3)},a.valueOf=function(){return this.$d.getTime()},a.startOf=function(i,u){var t=this,H=!!l.u(u)||u,f=l.p(i),w=function(v1,j){var o1=l.w(t.$u?Date.UTC(t.$y,j,v1):new Date(t.$y,j,v1),t);return H?o1:o1.endOf(V)},I=function(v1,j){return l.w(t.toDate()[v1].apply(t.toDate("s"),(H?[0,0,0,0]:[23,59,59,999]).slice(j)),t)},E=this.$W,q=this.$M,a1=this.$D,c1="set"+(this.$u?"UTC":"");switch(f){case y:return H?w(1,0):w(31,11);case d:return H?w(1,q):w(0,q+1);case x:var V1=this.$locale().weekStart||0,y1=(E<V1?E+7:E)-V1;return w(H?a1-y1:a1+(6-y1),q);case V:case b:return I(c1+"Hours",0);case v:return I(c1+"Minutes",1);case Z:return I(c1+"Seconds",2);case r:return I(c1+"Milliseconds",3);default:return this.clone()}},a.endOf=function(i){return this.startOf(i,!1)},a.$set=function(i,u){var t,H=l.p(i),f="set"+(this.$u?"UTC":""),w=(t={},t[V]=f+"Date",t[b]=f+"Date",t[d]=f+"Month",t[y]=f+"FullYear",t[v]=f+"Hours",t[Z]=f+"Minutes",t[r]=f+"Seconds",t[s]=f+"Milliseconds",t)[H],I=H===V?this.$D+(u-this.$W):u;if(H===d||H===y){var E=this.clone().set(b,1);E.$d[w](I),E.init(),this.$d=E.set(b,Math.min(this.$D,E.daysInMonth())).$d}else w&&this.$d[w](I);return this.init(),this},a.set=function(i,u){return this.clone().$set(i,u)},a.get=function(i){return this[l.p(i)]()},a.add=function(i,u){var t,H=this;i=Number(i);var f=l.p(u),w=function(q){var a1=h(H);return l.w(a1.date(a1.date()+Math.round(q*i)),H)};if(f===d)return this.set(d,this.$M+i);if(f===y)return this.set(y,this.$y+i);if(f===V)return w(1);if(f===x)return w(7);var I=(t={},t[Z]=c,t[v]=o,t[r]=e,t)[f]||1,E=this.$d.getTime()+i*I;return l.w(E,this)},a.subtract=function(i,u){return this.add(-1*i,u)},a.format=function(i){var u=this,t=this.$locale();if(!this.isValid())return t.invalidDate||C;var H=i||"YYYY-MM-DDTHH:mm:ssZ",f=l.z(this),w=this.$H,I=this.$m,E=this.$M,q=t.weekdays,a1=t.months,c1=function(j,o1,K1,S1){return j&&(j[o1]||j(u,H))||K1[o1].slice(0,S1)},V1=function(j){return l.s(w%12||12,j,"0")},y1=t.meridiem||function(j,o1,K1){var S1=j<12?"AM":"PM";return K1?S1.toLowerCase():S1},v1={YY:String(this.$y).slice(-2),YYYY:this.$y,M:E+1,MM:l.s(E+1,2,"0"),MMM:c1(t.monthsShort,E,a1,3),MMMM:c1(a1,E),D:this.$D,DD:l.s(this.$D,2,"0"),d:String(this.$W),dd:c1(t.weekdaysMin,this.$W,q,2),ddd:c1(t.weekdaysShort,this.$W,q,3),dddd:q[this.$W],H:String(w),HH:l.s(w,2,"0"),h:V1(1),hh:V1(2),a:y1(w,I,!0),A:y1(w,I,!1),m:String(I),mm:l.s(I,2,"0"),s:String(this.$s),ss:l.s(this.$s,2,"0"),SSS:l.s(this.$ms,3,"0"),Z:f};return H.replace(T,function(j,o1){return o1||v1[j]||f.replace(":","")})},a.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},a.diff=function(i,u,t){var H,f=l.p(u),w=h(i),I=(w.utcOffset()-this.utcOffset())*c,E=this-w,q=l.m(this,w);return q=(H={},H[y]=q/12,H[d]=q,H[L]=q/3,H[x]=(E-I)/6048e5,H[V]=(E-I)/864e5,H[v]=E/o,H[Z]=E/c,H[r]=E/e,H)[f]||E,t?q:l.a(q)},a.daysInMonth=function(){return this.endOf(d).$D},a.$locale=function(){return $[this.$L]},a.locale=function(i,u){if(!i)return this.$L;var t=this.clone(),H=N(i,u,!0);return H&&(t.$L=H),t},a.clone=function(){return l.w(this.$d,this)},a.toDate=function(){return new Date(this.valueOf())},a.toJSON=function(){return this.isValid()?this.toISOString():null},a.toISOString=function(){return this.$d.toISOString()},a.toString=function(){return this.$d.toUTCString()},m}(),J=A.prototype;return h.prototype=J,[["$ms",s],["$s",r],["$m",Z],["$H",v],["$W",V],["$M",d],["$y",y],["$D",b]].forEach(function(m){J[m[1]]=function(a){return this.$g(a,m[0],m[1])}}),h.extend=function(m,a){return m.$i||(m(a,A,h),m.$i=!0),h},h.locale=N,h.isDayjs=O,h.unix=function(m){return h(1e3*m)},h.en=$[M],h.Ls=$,h.p={},h})});var d0=p0((s0,h0)=>{(function(e,c){typeof s0=="object"&&typeof h0!="undefined"?h0.exports=c(q0()):typeof define=="function"&&define.amd?define(["dayjs"],c):(e=typeof globalThis!="undefined"?globalThis:e||self).dayjs_locale_pt_br=c(e.dayjs)})(s0,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 z2={};L2(z2,{Autocomplete:()=>u2,Checkbox:()=>E0,Creatable:()=>_0,DatePicker:()=>c2,Form:()=>V0,FormProvider:()=>$1,RadioButton:()=>B0,RadioGroup:()=>I0,Searchable:()=>w0,Select:()=>S0,Slider:()=>O0,Switch:()=>G0,TextField:()=>k0,TimePicker:()=>p2,useForm:()=>A1});module.exports=F2(z2);var u0=require("react-hook-form");var X1=require("react/jsx-runtime"),b2=r=>{var Z=r,{children:e,style:c,onSubmit:o}=Z,s=k(Z,["children","style","onSubmit"]);return(0,X1.jsx)(u0.FormProvider,p(n({},s),{children:(0,X1.jsx)("form",{onSubmit:v=>{v.preventDefault(),v.stopPropagation(),o(v)},style:c,children:e})}))},$1=b2;var f0=require("react"),M0=require("react-hook-form"),H0=require("@hookform/resolvers/zod");var C2=s=>{var r=s,{disableDefaultValuesUpdate:e,onSubmit:c}=r,o=k(r,["disableDefaultValuesUpdate","onSubmit"]);let Z=(0,M0.useForm)(p(n({},o),{resolver:o.schema&&(0,H0.zodResolver)(o.schema)}));return(0,f0.useEffect)(()=>{e||Z.reset(o.defaultValues)},[o.defaultValues,Z.reset]),p(n({},Z),{onSubmit:Z.handleSubmit(v=>c(v,Z))})},A1=C2;var y0=require("react/jsx-runtime");function P2(s){var r=s,{children:e,style:c}=r,o=k(r,["children","style"]);let Z=A1(o);return(0,y0.jsx)($1,p(n({},Z),{style:c,children:typeof e=="function"?e(Z):e}))}var V0=P2;var T1=require("react"),D1=require("react-hook-form"),t1=require("@mui/material");var g0={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"},x0={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 e0={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 c0=require("@mui/material"),F0=require("@s_mart/utils"),x1=require("react/jsx-runtime"),G=({label:e,required:c,regular:o})=>(0,x1.jsxs)("span",{style:{display:"flex",alignItems:"center",gap:(0,F0.toRem)(2)},children:[(0,x1.jsx)(c0.Typography,{variant:"caption",fontWeight:o?400:700,style:{display:"flex",alignItems:"center"},children:e}),c&&(0,x1.jsx)(c0.Typography,{variant:"caption",fontWeight:900,color:"error",children:"*"})]});var b0=require("react-hook-form"),C0=require("@s_mart/core");var U=(e,c)=>{var o,s,r,Z,v;if(e[c])return e[c];if(c.includes("[")){let[V,x]=c.split("["),[d,L]=x.split("].");return(s=(o=e[V])==null?void 0:o[d])==null?void 0:s[L]}if(c.includes(".")){let[V,x,d]=c.split(".");return d?(v=(Z=e[V])==null?void 0:Z[x])==null?void 0:v[d]:(r=e[V])==null?void 0:r[x]}};var P0=require("react/jsx-runtime"),R=({name:e})=>{var s;let c=(0,b0.useFormContext)(),o=U((s=c==null?void 0:c.formState)==null?void 0:s.errors,e);return o?(0,P0.jsx)(C0.Indicator,{severity:"error",children:o==null?void 0:o.message}):null};var L1=require("@s_mart/core");var Y=require("react/jsx-runtime"),k2=B=>{var T=B,{name:e,rules:c,defaultValue:o,shouldUnregister:s,label:r,required:Z,mask:v,variant:V="outlined",info:x,parse:d,inputMode:L,format:y,onInputChange:b}=T,C=k(T,["name","rules","defaultValue","shouldUnregister","label","required","mask","variant","info","parse","inputMode","format","onInputChange"]);let F=(0,D1.useFormContext)();if(!F)throw new Error("Para usar o <TextField /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let[g,D]=(0,T1.useState)(!1),M=h=>{var A;let l=h;return y&&(l=y(h)),v?(A=Z1==null?void 0:Z1[v])==null?void 0:A.format(l):l},$=h=>{var A;let l=h;return d&&(l=d(h)),v?(A=Z1==null?void 0:Z1[v])==null?void 0:A.parse(l):l},O=h=>{if(!h||v!=="porcentagem")return;h==null||h.stopPropagation();let l=(h==null?void 0:h.target).value;if(l){let A=String(l);if(A.length>0){let J=A.indexOf("%");J>-1&&(h.currentTarget.selectionEnd=J)}}},N=U(F.formState.errors,e);return(0,Y.jsx)(D1.Controller,{control:F.control,name:e,rules:c,defaultValue:o,shouldUnregister:s,render:({field:{value:h,onChange:l,ref:A}})=>(0,Y.jsxs)(t1.Grid,{display:"flex",flexDirection:"column",children:[(0,Y.jsxs)("div",{style:{display:"flex"},children:[r&&(0,Y.jsx)(t1.Grid,{item:!0,children:(0,Y.jsx)(G,{label:r,required:Z})}),x&&(0,Y.jsx)(t1.Grid,{item:!0,children:(0,Y.jsx)(L1.Tooltip,{title:x,placement:"top",children:(0,Y.jsx)("div",{style:{width:"fit-content"},children:(0,Y.jsx)(L1.LIcon,{icon:r1,color:"#757575"})})})})]}),(0,Y.jsx)(t1.TextField,p(n({variant:V,defaultValue:o,value:M(h||""),onChange:J=>{var a;let m=$((a=J==null?void 0:J.target)==null?void 0:a.value);l(m),b==null||b(m,F.watch())},error:!!N},C),{type:C.type==="password"?g?"text":"password":C.type,autoComplete:C.autoComplete||"off",inputProps:n({inputMode:L},C.inputProps),InputProps:n({onKeyDown:O,inputRef:A,endAdornment:C.type==="password"&&(0,Y.jsx)(t1.InputAdornment,{position:"end",onClick:()=>D(!g),style:{cursor:"pointer"},children:(0,Y.jsx)(L1.LIcon,{icon:g?g0:x0,size:"24px",removeMargin:!0})})},C.InputProps)}),e),(0,Y.jsx)(R,{name:e})]})})},k0=(0,T1.memo)(k2);var _1=require("react"),E1=require("react-hook-form"),u1=require("@s_mart/core"),z=require("@mui/material");var _=require("react/jsx-runtime"),S2=B=>{var T=B,{name:e,rules:c,defaultValue:o,shouldUnregister:s,label:r,required:Z,options:v,placeholder:V,disableOnChangeForm:x=!1,multiple:d,info:L,footer:y,onChange:b}=T,C=k(T,["name","rules","defaultValue","shouldUnregister","label","required","options","placeholder","disableOnChangeForm","multiple","info","footer","onChange"]);let F=(0,E1.useFormContext)(),{palette:g}=(0,z.useTheme)(),[D,M]=(0,_1.useState)(!1);if(!F)throw new Error("Para usar o <Select /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let $=U(F.formState.errors,e);return console.warn=()=>{},(0,_.jsx)(E1.Controller,{control:F.control,name:e,rules:c,defaultValue:o,shouldUnregister:s,render:({field:{value:O,onChange:N,ref:h}})=>(0,_.jsxs)(z.Grid,{display:"flex",flexDirection:"column",children:[(0,_.jsxs)("div",{style:{display:"flex"},children:[r&&(0,_.jsx)(z.Grid,{item:!0,children:(0,_.jsx)(G,{label:r,required:Z})}),L&&(0,_.jsx)(z.Grid,{item:!0,children:(0,_.jsx)(u1.Tooltip,{title:L,placement:"top",children:(0,_.jsx)("div",{style:{width:"fit-content"},children:(0,_.jsx)(u1.LIcon,{icon:r1,color:"#757575"})})})})]}),(0,_.jsxs)(z.Select,p(n({open:D,onOpen:()=>M(!0),onClose:()=>M(!1),displayEmpty:!!V,variant:"outlined",autoComplete:"off",value:O?O||"":d?[]:"",renderValue:l=>{if(l.label)return l.label;if(V)return(0,_.jsx)("p",{style:{color:g.grey[400]},children:V})},multiple:d,onChange:l=>{!x&&N(l.target.value),b&&b(l.target.value,F.watch())},error:!!$,size:C.size||"medium",inputRef:h},C),{children:[V&&(0,_.jsx)(z.MenuItem,{disabled:!0,value:"",children:(0,_.jsx)("p",{style:{color:g.grey[400]},children:V})}),v==null?void 0:v.map((l,A)=>(0,_.jsx)(z.MenuItem,{value:l,children:(0,_.jsxs)(z.Grid,{container:!0,direction:"column",children:[(0,_.jsx)(z.Grid,{item:!0,children:l.label}),l.afterLabel&&(0,_.jsx)(z.Grid,{item:!0,children:l.afterLabel})]})},A)),y&&[(0,_.jsx)(z.Grid,{px:2,py:1,children:(0,_.jsx)(u1.Divider,{})},"footer-divider"),(0,_.jsx)("div",{children:y({closeSelect:()=>M(!1)})},"footer-content")]]}),e),(0,_.jsx)(R,{name:e})]})})},S0=(0,_1.memo)(S2);var G1=require("react"),B1=require("react-hook-form"),d1=require("@s_mart/core");var W=require("@mui/material");var P=require("react/jsx-runtime"),i0=require("react"),w2=F=>{var g=F,{name:e,rules:c,defaultValue:o,shouldUnregister:s,label:r,required:Z,options:v,textFieldProps:V,noOptionsText:x,footer:d,multiple:L,info:y,placeholder:b,onChange:C,onInputChange:B}=g,T=k(g,["name","rules","defaultValue","shouldUnregister","label","required","options","textFieldProps","noOptionsText","footer","multiple","info","placeholder","onChange","onInputChange"]);let D=(0,B1.useFormContext)();if(!D)throw new Error("Para usar o <Searchable /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let M=U(D.formState.errors,e);return console.warn=()=>{},(0,P.jsx)(B1.Controller,{control:D.control,name:e,rules:c,defaultValue:o,shouldUnregister:s,render:({field:{onChange:$,value:O,ref:N}})=>(0,P.jsxs)(W.Grid,{display:"flex",flexDirection:"column",children:[(0,P.jsxs)("div",{style:{display:"flex"},children:[r&&(0,P.jsx)(W.Grid,{item:!0,children:(0,P.jsx)(G,{label:r,required:Z})}),y&&(0,P.jsx)(W.Grid,{item:!0,children:(0,P.jsx)(d1.Tooltip,{title:y,placement:"top",children:(0,P.jsx)("div",{style:{width:"fit-content"},children:(0,P.jsx)(d1.LIcon,{icon:r1,color:"#757575"})})})})]}),(0,P.jsx)(W.Autocomplete,p(n({onChange:(h,l)=>{$(l),C==null||C(l,D.watch())},onInputChange:(h,l,A)=>{A==="input"&&setTimeout(()=>{B==null||B(l,D.watch())},0)},value:O||(L?[]:null),options:v,multiple:L,noOptionsText:(0,P.jsxs)(P.Fragment,{children:[x||"Nenhum resultado encontrado",d?(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(W.Grid,{py:1,children:(0,P.jsx)(d1.Divider,{})}),d]}):null]}),isOptionEqualToValue:(h,l)=>typeof h=="string"&&typeof l=="string"?h===l:typeof h=="object"&&typeof l=="object"?h.value===l.value:!1,renderOption:(h,l)=>typeof l=="object"?(0,i0.createElement)("li",p(n({},h),{key:l.key||l.value}),(0,P.jsxs)(W.Grid,{container:!0,direction:"column",children:[(0,P.jsx)(W.Grid,{item:!0,children:l.label}),l.afterLabel&&(0,P.jsx)(W.Grid,{item:!0,children:l.afterLabel})]})):(0,i0.createElement)("li",p(n({},h),{key:l}),l),ListboxComponent:(0,G1.forwardRef)(function(l,A){return(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)("ul",p(n({},l),{ref:A})),!!d&&(0,P.jsx)("div",p(n({},l),{children:(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(W.Grid,{px:2,py:1,children:(0,P.jsx)(d1.Divider,{})}),d]})}),"searchable-footer")]})})},T),{renderInput:h=>(0,P.jsx)(W.TextField,p(n(n({error:!!M,placeholder:b},h),V),{inputRef:N}))}),e),(0,P.jsx)(R,{name:e})]})})},w0=(0,G1.memo)(w2);var D0=require("react"),I1=require("react-hook-form"),K=require("@mui/material");var F1=require("@s_mart/utils"),$0=p1(require("@emotion/styled")),l0=require("@emotion/react"),A0=l0.css`
2
2
  display: flex;
3
3
  align-items: center;
4
4
  justify-content: center;
5
- `,w2=e=>l0.css`
5
+ `,$2=e=>l0.css`
6
6
  .MuiAutocomplete-endAdornment {
7
7
  position: relative;
8
8
  right: 0;
@@ -10,7 +10,7 @@
10
10
 
11
11
  .creatable,
12
12
  .editable {
13
- ${$0}
13
+ ${A0}
14
14
 
15
15
  .divider {
16
16
  width: 1px;
@@ -36,37 +36,33 @@
36
36
  }
37
37
  }
38
38
  }
39
- `,T0=A0.default.div`
39
+ `,T0=$0.default.div`
40
40
  display: flex;
41
41
 
42
42
  div.endAdornments {
43
43
  position: absolute;
44
44
  right: 0;
45
45
 
46
- ${$0}
46
+ ${A0}
47
47
  }
48
48
 
49
- ${({hideAddButton:e,theme:c})=>!e&&w2(c)}
50
- `;var c1=require("@s_mart/core");var R1=require("lodash"),a0=require("@s_mart/utils");var w=require("react/jsx-runtime"),o0=require("react"),S2=_=>{var y=_,{name:e,rules:c,defaultValue:o,shouldUnregister:s,label:r,required:p,options:v,editable:H,onEditOption:L,onCreateOption:h,textFieldProps:g,hideAddButton:V,multiple:x,info:A,onChange:D,onInputChange:$,placeholder:b}=y,F=k(y,["name","rules","defaultValue","shouldUnregister","label","required","options","editable","onEditOption","onCreateOption","textFieldProps","hideAddButton","multiple","info","onChange","onInputChange","placeholder"]);let T=(0,B1.useFormContext)();if(!T)throw new Error("Para usar o <Creatable /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let q=z(T.formState.errors,e);console.warn=()=>{};let C=l=>{h?h(l):console.error("onCreateOption n\xE3o foi definido")},d=l=>{L?L(l):console.error("onEditOption n\xE3o foi definido")};return(0,w.jsx)(B1.Controller,{control:T.control,name:e,rules:c,defaultValue:o,shouldUnregister:s,render:({field:{value:l,onChange:B,ref:h1}})=>{let m=(l==null?void 0:l.label)||(l==null?void 0:l.value)||l;return(0,w.jsxs)(J.Grid,{display:"flex",flexDirection:"column",children:[(0,w.jsxs)("div",{style:{display:"flex"},children:[r&&(0,w.jsx)(J.Grid,{item:!0,children:(0,w.jsx)(I,{label:r,required:p})}),A&&(0,w.jsx)(J.Grid,{item:!0,children:(0,w.jsx)(c1.Tooltip,{title:A,placement:"top",children:(0,w.jsx)("div",{style:{width:"fit-content"},children:(0,w.jsx)(c1.LIcon,{icon:o1,color:"#757575"})})})})]}),(0,w.jsx)(T0,{hideAddButton:V,children:(0,w.jsx)(J.Autocomplete,u(n({fullWidth:!0,onChange:(a,i)=>{B(i),D==null||D(i,T.watch())},onInputChange:(a,i,Z)=>{Z==="input"&&(B(i),setTimeout(()=>{$==null||$(i,T.watch())},0))},options:v,value:l||(x?[]:null),multiple:x,noOptionsText:(0,w.jsxs)(c1.Button,{sx:{justifyContent:"flex-start",padding:`${(0,a0.toRem)(6)} ${(0,a0.toRem)(-16)}`,margin:0},fullWidth:!0,onClick:()=>C(l),variant:"text",startIcon:(0,w.jsx)(c1.LIcon,{icon:e0}),children:["Adicionar ",m&&`"${m}"`]}),isOptionEqualToValue:(a,i)=>i?typeof a=="string"&&typeof i=="string"?a===i:typeof a=="object"&&typeof i=="object"?a.value===i.value:typeof a=="object"&&typeof i=="string":!1,renderOption:(a,i)=>typeof i=="object"?(0,o0.createElement)("li",u(n({},a),{key:i.key||i.value}),(0,w.jsxs)(J.Grid,{container:!0,direction:"column",children:[(0,w.jsx)(J.Grid,{item:!0,children:i.label}),i.afterLabel&&(0,w.jsx)(J.Grid,{item:!0,children:i.afterLabel})]})):(0,o0.createElement)("li",u(n({},a),{key:i}),i)},F),{renderInput:a=>(0,w.jsx)(J.TextField,n(u(n({placeholder:b},a),{error:!!q,onChange:B,InputProps:u(n({},a.InputProps),{inputRef:h1,endAdornment:V?void 0:(0,w.jsxs)("div",{className:"endAdornments",children:[a.InputProps.endAdornment,H&&(0,R1.isObject)(l)&&!(0,R1.isEmpty)(l)?(0,w.jsxs)("div",{className:"editable",children:[(0,w.jsx)("div",{className:"divider"}),(0,w.jsx)("div",{className:"button",onClick:()=>d(l),children:(0,w.jsx)(c1.LIcon,{icon:L0,size:"24px",removeMargin:!0})})]}):null,(0,w.jsxs)("div",{className:"creatable",children:[(0,w.jsx)("div",{className:"divider"}),(0,w.jsx)("div",{className:"button",onClick:()=>C(l),children:(0,w.jsx)(c1.LIcon,{icon:e0,size:"24px",removeMargin:!0})})]})]})})}),g))}),e)}),(0,w.jsx)(O,{name:e})]})}})},_0=(0,D0.memo)(S2);var O1=require("react-hook-form"),f1=require("@mui/material");var t1=require("react/jsx-runtime"),A2=L=>{var h=L,{name:e,rules:c,defaultValue:o,shouldUnregister:s,label:r,labelPlacement:p,required:v}=h,H=k(h,["name","rules","defaultValue","shouldUnregister","label","labelPlacement","required"]);let g=(0,O1.useFormContext)();if(!g)throw new Error("Para usar o <Checkbox /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");return(0,t1.jsx)(O1.Controller,{control:g.control,name:e,rules:c,defaultValue:o,shouldUnregister:s,render:({field:{value:V,onChange:x}})=>(0,t1.jsxs)(f1.Grid,{display:"flex",flexDirection:"column",children:[(0,t1.jsx)(f1.FormControlLabel,{control:(0,t1.jsx)(f1.Checkbox,n({checked:!!V,value:V!=null?V:"",defaultValue:V,onChange:x},H),e),label:(0,t1.jsx)(I,{label:r,required:v,regular:!0}),labelPlacement:p||"end"}),(0,t1.jsx)(O,{name:e})]})})},E0=A2;var q1=require("react-hook-form"),M1=require("@mui/material");var n1=require("react/jsx-runtime"),$2=H=>{var L=H,{name:e,rules:c,defaultValue:o,shouldUnregister:s,label:r,labelPlacement:p}=L,v=k(L,["name","rules","defaultValue","shouldUnregister","label","labelPlacement"]);let h=(0,q1.useFormContext)();if(!h)throw new Error("Para usar o <Switch /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");return(0,n1.jsx)(q1.Controller,{control:h.control,name:e,rules:c,defaultValue:o,shouldUnregister:s,render:({field:{value:g,onChange:V}})=>(0,n1.jsxs)(M1.Grid,{display:"flex",flexDirection:"column",children:[(0,n1.jsx)(M1.FormControlLabel,{control:(0,n1.jsx)(M1.Switch,n({value:g!=null?g:"",checked:g!=null?g:!1,defaultValue:g,onChange:V},v),e),label:(0,n1.jsx)(I,{label:r}),labelPlacement:p||"end"}),(0,n1.jsx)(O,{name:e})]})})},G0=$2;var H1=require("@mui/material");var b1=require("react/jsx-runtime"),T2=s=>{var r=s,{label:e,labelPlacement:c}=r,o=k(r,["label","labelPlacement"]);return(0,b1.jsx)(H1.Grid,{display:"flex",flexDirection:"column",children:(0,b1.jsx)(H1.FormControlLabel,{control:(0,b1.jsx)(H1.Radio,n({},o)),label:(0,b1.jsx)(I,{label:e}),labelPlacement:c||"end"})})},I0=T2;var U1=require("react-hook-form"),z1=require("@mui/material");var m1=require("react/jsx-runtime"),D2=h=>{var g=h,{name:e,rules:c,defaultValue:o,shouldUnregister:s,label:r,required:p,children:v,orientation:H="row"}=g,L=k(g,["name","rules","defaultValue","shouldUnregister","label","required","children","orientation"]);let V=(0,U1.useFormContext)();if(!V)throw new Error("Para usar o <RadioGroup /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");return(0,m1.jsx)(U1.Controller,{control:V.control,name:e,rules:c,defaultValue:o,shouldUnregister:s,render:({field:{value:x,onChange:A}})=>(0,m1.jsxs)(z1.Grid,{display:"flex",flexDirection:"column",children:[r&&(0,m1.jsx)(I,{label:r,required:p}),(0,m1.jsx)(z1.RadioGroup,u(n({value:x||"",onChange:A,name:e},L),{style:{display:"flex",flexDirection:H},children:v}),e),(0,m1.jsx)(O,{name:e})]})})},B0=D2;var Y1=require("react-hook-form"),R0=require("@mui/material");var r0=require("react/jsx-runtime"),_2=p=>{var v=p,{name:e,rules:c,defaultValue:o,shouldUnregister:s}=v,r=k(v,["name","rules","defaultValue","shouldUnregister"]);let H=(0,Y1.useFormContext)();if(!H)throw new Error("Para usar o <Slider /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");return(0,r0.jsx)(Y1.Controller,{control:H.control,name:e,rules:c,defaultValue:o,shouldUnregister:s,render:({field:{value:L,onChange:h}})=>(0,r0.jsx)(R0.Slider,n({value:L||(r==null?void 0:r.min)||0,onChange:h,valueLabelDisplay:"auto"},r),e)})},O0=_2;var Y0=require("react"),j1=require("react-hook-form"),j0=require("@s_mart/core"),C1=require("@s_mart/rules"),N0=require("@mui/material"),W0=require("@mui/x-date-pickers/DatePicker"),J0=require("@mui/x-date-pickers/AdapterDayjs"),K0=require("@mui/x-date-pickers/LocalizationProvider"),Q0=require("@mui/x-date-pickers/locales/ptBR"),X0=p1(d0());var K=require("@s_mart/utils"),U0=p1(require("@emotion/styled")),E2=e=>{switch(e){case"small":return(0,K.toRem)(16);default:case"medium":return(0,K.toRem)(20);case"large":return(0,K.toRem)(24)}},G2=e=>{switch(e){case"small":return`${(0,K.toRem)(2)} ${(0,K.toRem)(8)}`;default:case"medium":return`${(0,K.toRem)(6)} ${(0,K.toRem)(8)}`;case"large":return`${(0,K.toRem)(10)}`}},z0=U0.default.div`
51
- > div > button {
52
- padding: ${({size:e})=>G2(e)};
53
- border-radius: 0 ${(0,K.toRem)(4)} ${(0,K.toRem)(4)} 0;
49
+ ${({hideAddButton:e,theme:c})=>!e&&$2(c)}
50
+ `;var i1=require("@s_mart/core");var R1=require("lodash"),a0=require("@s_mart/utils");var S=require("react/jsx-runtime"),o0=require("react"),A2=D=>{var M=D,{name:e,rules:c,defaultValue:o,shouldUnregister:s,label:r,required:Z,options:v,editable:V,onEditOption:x,onCreateOption:d,textFieldProps:L,hideAddButton:y,multiple:b,info:C,onChange:B,onInputChange:T,placeholder:F}=M,g=k(M,["name","rules","defaultValue","shouldUnregister","label","required","options","editable","onEditOption","onCreateOption","textFieldProps","hideAddButton","multiple","info","onChange","onInputChange","placeholder"]);let $=(0,I1.useFormContext)();if(!$)throw new Error("Para usar o <Creatable /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let O=U($.formState.errors,e);console.warn=()=>{};let N=l=>{d?d(l):console.error("onCreateOption n\xE3o foi definido")},h=l=>{x?x(l):console.error("onEditOption n\xE3o foi definido")};return(0,S.jsx)(I1.Controller,{control:$.control,name:e,rules:c,defaultValue:o,shouldUnregister:s,render:({field:{value:l,onChange:A,ref:J}})=>{let m=(l==null?void 0:l.label)||(l==null?void 0:l.value)||l;return(0,S.jsxs)(K.Grid,{display:"flex",flexDirection:"column",children:[(0,S.jsxs)("div",{style:{display:"flex"},children:[r&&(0,S.jsx)(K.Grid,{item:!0,children:(0,S.jsx)(G,{label:r,required:Z})}),C&&(0,S.jsx)(K.Grid,{item:!0,children:(0,S.jsx)(i1.Tooltip,{title:C,placement:"top",children:(0,S.jsx)("div",{style:{width:"fit-content"},children:(0,S.jsx)(i1.LIcon,{icon:r1,color:"#757575"})})})})]}),(0,S.jsx)(T0,{hideAddButton:y,children:(0,S.jsx)(K.Autocomplete,p(n({fullWidth:!0,onChange:(a,i)=>{A(i),B==null||B(i,$.watch())},onInputChange:(a,i,u)=>{u==="input"&&(A(i),setTimeout(()=>{T==null||T(i,$.watch())},0))},options:v,value:l||(b?[]:null),multiple:b,noOptionsText:(0,S.jsxs)(i1.Button,{sx:{justifyContent:"flex-start",padding:`${(0,a0.toRem)(6)} ${(0,a0.toRem)(-16)}`,margin:0},fullWidth:!0,onClick:()=>N(l),variant:"text",startIcon:(0,S.jsx)(i1.LIcon,{icon:e0}),children:["Adicionar ",m&&`"${m}"`]}),isOptionEqualToValue:(a,i)=>i?typeof a=="string"&&typeof i=="string"?a===i:typeof a=="object"&&typeof i=="object"?a.value===i.value:typeof a=="object"&&typeof i=="string":!1,renderOption:(a,i)=>typeof i=="object"?(0,o0.createElement)("li",p(n({},a),{key:i.key||i.value}),(0,S.jsxs)(K.Grid,{container:!0,direction:"column",children:[(0,S.jsx)(K.Grid,{item:!0,children:i.label}),i.afterLabel&&(0,S.jsx)(K.Grid,{item:!0,children:i.afterLabel})]})):(0,o0.createElement)("li",p(n({},a),{key:i}),i)},g),{renderInput:a=>(0,S.jsx)(K.TextField,n(p(n({placeholder:F},a),{error:!!O,onChange:A,InputProps:p(n({},a.InputProps),{inputRef:J,endAdornment:y?void 0:(0,S.jsxs)("div",{className:"endAdornments",children:[a.InputProps.endAdornment,V&&(0,R1.isObject)(l)&&!(0,R1.isEmpty)(l)?(0,S.jsxs)("div",{className:"editable",children:[(0,S.jsx)("div",{className:"divider"}),(0,S.jsx)("div",{className:"button",onClick:()=>h(l),children:(0,S.jsx)(i1.LIcon,{icon:L0,size:"24px",removeMargin:!0})})]}):null,(0,S.jsxs)("div",{className:"creatable",children:[(0,S.jsx)("div",{className:"divider"}),(0,S.jsx)("div",{className:"button",onClick:()=>N(l),children:(0,S.jsx)(i1.LIcon,{icon:e0,size:"24px",removeMargin:!0})})]})]})})}),L))}),e)}),(0,S.jsx)(R,{name:e})]})}})},_0=(0,D0.memo)(A2);var O1=require("react-hook-form"),f1=require("@mui/material");var n1=require("react/jsx-runtime"),T2=x=>{var d=x,{name:e,rules:c,defaultValue:o,shouldUnregister:s,label:r,labelPlacement:Z,required:v}=d,V=k(d,["name","rules","defaultValue","shouldUnregister","label","labelPlacement","required"]);let L=(0,O1.useFormContext)();if(!L)throw new Error("Para usar o <Checkbox /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");return(0,n1.jsx)(O1.Controller,{control:L.control,name:e,rules:c,defaultValue:o,shouldUnregister:s,render:({field:{value:y,onChange:b}})=>(0,n1.jsxs)(f1.Grid,{display:"flex",flexDirection:"column",children:[(0,n1.jsx)(f1.FormControlLabel,{control:(0,n1.jsx)(f1.Checkbox,n({checked:!!y,value:y!=null?y:"",defaultValue:y,onChange:b},V),e),label:(0,n1.jsx)(G,{label:r,required:v,regular:!0}),labelPlacement:Z||"end"}),(0,n1.jsx)(R,{name:e})]})})},E0=T2;var q1=require("react-hook-form"),M1=require("@mui/material");var s1=require("react/jsx-runtime"),D2=V=>{var x=V,{name:e,rules:c,defaultValue:o,shouldUnregister:s,label:r,labelPlacement:Z}=x,v=k(x,["name","rules","defaultValue","shouldUnregister","label","labelPlacement"]);let d=(0,q1.useFormContext)();if(!d)throw new Error("Para usar o <Switch /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");return(0,s1.jsx)(q1.Controller,{control:d.control,name:e,rules:c,defaultValue:o,shouldUnregister:s,render:({field:{value:L,onChange:y}})=>(0,s1.jsxs)(M1.Grid,{display:"flex",flexDirection:"column",children:[(0,s1.jsx)(M1.FormControlLabel,{control:(0,s1.jsx)(M1.Switch,n({value:L!=null?L:"",checked:L!=null?L:!1,defaultValue:L,onChange:y},v),e),label:(0,s1.jsx)(G,{label:r}),labelPlacement:Z||"end"}),(0,s1.jsx)(R,{name:e})]})})},G0=D2;var H1=require("@mui/material");var b1=require("react/jsx-runtime"),_2=s=>{var r=s,{label:e,labelPlacement:c}=r,o=k(r,["label","labelPlacement"]);return(0,b1.jsx)(H1.Grid,{display:"flex",flexDirection:"column",children:(0,b1.jsx)(H1.FormControlLabel,{control:(0,b1.jsx)(H1.Radio,n({},o)),label:(0,b1.jsx)(G,{label:e}),labelPlacement:c||"end"})})},B0=_2;var U1=require("react-hook-form"),Y1=require("@mui/material");var m1=require("react/jsx-runtime"),E2=d=>{var L=d,{name:e,rules:c,defaultValue:o,shouldUnregister:s,label:r,required:Z,children:v,orientation:V="row"}=L,x=k(L,["name","rules","defaultValue","shouldUnregister","label","required","children","orientation"]);let y=(0,U1.useFormContext)();if(!y)throw new Error("Para usar o <RadioGroup /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");return(0,m1.jsx)(U1.Controller,{control:y.control,name:e,rules:c,defaultValue:o,shouldUnregister:s,render:({field:{value:b,onChange:C}})=>(0,m1.jsxs)(Y1.Grid,{display:"flex",flexDirection:"column",children:[r&&(0,m1.jsx)(G,{label:r,required:Z}),(0,m1.jsx)(Y1.RadioGroup,p(n({value:b||"",onChange:C,name:e},x),{style:{display:"flex",flexDirection:V},children:v}),e),(0,m1.jsx)(R,{name:e})]})})},I0=E2;var z1=require("react-hook-form"),R0=require("@mui/material");var r0=require("react/jsx-runtime"),G2=Z=>{var v=Z,{name:e,rules:c,defaultValue:o,shouldUnregister:s}=v,r=k(v,["name","rules","defaultValue","shouldUnregister"]);let V=(0,z1.useFormContext)();if(!V)throw new Error("Para usar o <Slider /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");return(0,r0.jsx)(z1.Controller,{control:V.control,name:e,rules:c,defaultValue:o,shouldUnregister:s,render:({field:{value:x,onChange:d}})=>(0,r0.jsx)(R0.Slider,n({value:x||(r==null?void 0:r.min)||0,onChange:d,valueLabelDisplay:"auto"},r),e)})},O0=G2;var j0=require("react"),j1=require("react-hook-form"),N0=require("@s_mart/core"),C1=require("@s_mart/rules"),W0=require("@mui/material"),J0=require("@mui/x-date-pickers/DatePicker"),K0=require("@mui/x-date-pickers/AdapterDayjs"),Q0=require("@mui/x-date-pickers/LocalizationProvider"),X0=require("@mui/x-date-pickers/locales/ptBR"),e2=p1(d0());var U0=p1(require("@emotion/styled")),Y0=require("@mui/material"),Q=require("@s_mart/utils"),B2=e=>{switch(e){case"small":return(0,Q.toRem)(16);default:case"medium":return(0,Q.toRem)(20);case"large":return(0,Q.toRem)(24)}},I2=e=>{switch(e){case"small":return`${(0,Q.toRem)(2)} ${(0,Q.toRem)(8)}`;default:case"medium":return`${(0,Q.toRem)(6)} ${(0,Q.toRem)(8)}`;case"large":return`${(0,Q.toRem)(10)}`}},z0=(0,U0.default)(Y0.IconButton)`
51
+ margin: 0px;
54
52
 
55
- margin: 0px -13px 0px 0px;
53
+ padding: ${({size:e})=>I2(e)};
54
+ border-radius: 0 ${(0,Q.toRem)(4)} ${(0,Q.toRem)(4)} 0;
56
55
 
57
- svg {
58
- width: ${({size:e})=>E2(e)};
59
- }
56
+ svg {
57
+ width: ${({size:e})=>B2(e)} !important;
60
58
  }
61
- `;var s1=require("react/jsx-runtime"),c2=require("react"),I2=g=>{var V=g,{rules:e,name:c,defaultValue:o,shouldUnregister:s,datePickerProps:r,label:p,required:v,placeholder:H,disabled:L}=V,h=k(V,["rules","name","defaultValue","shouldUnregister","datePickerProps","label","required","placeholder","disabled"]);let x=(0,j1.useFormContext)();if(!x)throw new Error("Para usar o <DataPicker /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let A=z(x.formState.errors,c),D=(r==null?void 0:r.format)||"DD/MM/YYYY",$=e?(0,C1.composeValidators)([(0,C1.date)(D),e]):(0,C1.date)(D);return(0,s1.jsx)(K0.LocalizationProvider,{dateAdapter:J0.AdapterDayjs,adapterLocale:X0.default,localeText:Q0.ptBR.components.MuiLocalizationProvider.defaultProps.localeText,children:(0,s1.jsx)(j1.Controller,{control:x.control,name:c,rules:$,defaultValue:o,shouldUnregister:s,render:({field:{value:b,onChange:F,ref:_}})=>(0,s1.jsxs)(j0.Grid,{display:"flex",flexDirection:"column",children:[p&&(0,s1.jsx)(I,{label:p,required:v}),(0,c2.createElement)(W0.DatePicker,u(n({},r),{key:c,value:b!=null?b:null,format:D,onChange:F,disabled:L,slots:{textField:N0.TextField},slotProps:{textField:y=>{var T,q;return u(n(u(n({variant:"outlined"},y),{error:!!A}),h),{inputProps:u(n({},y.inputProps),{placeholder:H||((T=y.inputProps)==null?void 0:T.placeholder)}),InputProps:u(n({},y.InputProps),{inputRef(C){_(C),typeof y.inputRef=="function"&&y.inputRef(C)},endAdornment:(0,s1.jsx)(z0,{size:h.size,children:(q=y.InputProps)==null?void 0:q.endAdornment})})})}}})),(0,s1.jsx)(O,{name:c})]})})})},e2=(0,Y0.memo)(I2);var a2=require("react"),N1=require("react-hook-form"),o2=require("@s_mart/core"),P1=require("@s_mart/rules"),r2=require("@mui/material"),t2=require("@mui/x-date-pickers/TimePicker"),n2=require("@mui/x-date-pickers/AdapterDayjs"),s2=require("@mui/x-date-pickers/LocalizationProvider"),h2=require("@mui/x-date-pickers/locales/ptBR"),d2=p1(d0());var Q=require("@s_mart/utils"),i2=p1(require("@emotion/styled")),B2=e=>{switch(e){case"small":return(0,Q.toRem)(16);default:case"medium":return(0,Q.toRem)(20);case"large":return(0,Q.toRem)(24)}},R2=e=>{switch(e){case"small":return`${(0,Q.toRem)(2)} ${(0,Q.toRem)(8)}`;default:case"medium":return`${(0,Q.toRem)(6)} ${(0,Q.toRem)(8)}`;case"large":return`${(0,Q.toRem)(10)}`}},l2=i2.default.div`
62
- > div > button {
63
- padding: ${({size:e})=>R2(e)};
64
- border-radius: 0 ${(0,Q.toRem)(4)} ${(0,Q.toRem)(4)} 0;
59
+ `;var h1=require("react/jsx-runtime"),i2=require("react"),R2=L=>{var y=L,{rules:e,name:c,defaultValue:o,shouldUnregister:s,datePickerProps:r,label:Z,required:v,placeholder:V,disabled:x}=y,d=k(y,["rules","name","defaultValue","shouldUnregister","datePickerProps","label","required","placeholder","disabled"]);let b=(0,j1.useFormContext)();if(!b)throw new Error("Para usar o <DataPicker /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let C=U(b.formState.errors,c),B=(r==null?void 0:r.format)||"DD/MM/YYYY",T=e?(0,C1.composeValidators)([(0,C1.date)(B),e]):(0,C1.date)(B);return(0,h1.jsx)(Q0.LocalizationProvider,{dateAdapter:K0.AdapterDayjs,adapterLocale:e2.default,localeText:X0.ptBR.components.MuiLocalizationProvider.defaultProps.localeText,children:(0,h1.jsx)(j1.Controller,{control:b.control,name:c,rules:T,defaultValue:o,shouldUnregister:s,render:({field:{value:F,onChange:g,ref:D}})=>(0,h1.jsxs)(N0.Grid,{display:"flex",flexDirection:"column",children:[Z&&(0,h1.jsx)(G,{label:Z,required:v}),(0,i2.createElement)(J0.DatePicker,p(n({},r),{key:c,value:F!=null?F:null,format:B,onChange:g,disabled:x,slots:{textField:W0.TextField,openPickerButton:M=>(0,h1.jsx)(z0,p(n({},M),{size:d.size}))},slotProps:{textField:M=>{var $;return p(n(p(n({variant:"outlined"},M),{error:!!C}),d),{inputProps:p(n({},M.inputProps),{placeholder:V||(($=M.inputProps)==null?void 0:$.placeholder)}),InputProps:p(n({},M.InputProps),{inputRef(O){D(O),typeof M.inputRef=="function"&&M.inputRef(O)}})})}}})),(0,h1.jsx)(R,{name:c})]})})})},c2=(0,j0.memo)(R2);var r2=require("react"),N1=require("react-hook-form"),t2=require("@s_mart/core"),P1=require("@s_mart/rules"),n2=require("@mui/material"),s2=require("@mui/x-date-pickers/TimePicker"),h2=require("@mui/x-date-pickers/AdapterDayjs"),d2=require("@mui/x-date-pickers/LocalizationProvider"),m2=require("@mui/x-date-pickers/locales/ptBR"),v2=p1(d0());var l2=p1(require("@emotion/styled")),a2=require("@mui/material"),X=require("@s_mart/utils"),O2=e=>{switch(e){case"small":return(0,X.toRem)(16);default:case"medium":return(0,X.toRem)(20);case"large":return(0,X.toRem)(24)}},q2=e=>{switch(e){case"small":return`${(0,X.toRem)(2)} ${(0,X.toRem)(8)}`;default:case"medium":return`${(0,X.toRem)(6)} ${(0,X.toRem)(8)}`;case"large":return`${(0,X.toRem)(10)}`}},o2=(0,l2.default)(a2.IconButton)`
60
+ margin: 0px;
65
61
 
66
- margin: 0px -13px 0px 0px;
62
+ padding: ${({size:e})=>q2(e)};
63
+ border-radius: 0 ${(0,X.toRem)(4)} ${(0,X.toRem)(4)} 0;
67
64
 
68
- svg {
69
- width: ${({size:e})=>B2(e)};
70
- }
65
+ svg {
66
+ width: ${({size:e})=>O2(e)} !important;
71
67
  }
72
- `;var i1=require("react/jsx-runtime"),O2=g=>{var V=g,{rules:e,defaultValue:c,shouldUnregister:o,name:s,required:r,label:p,timePickerProps:v,placeholder:H,disabled:L}=V,h=k(V,["rules","defaultValue","shouldUnregister","name","required","label","timePickerProps","placeholder","disabled"]);let x=(0,N1.useFormContext)();if(!x)throw new Error("Para usar o <TimePicker /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let A=z(x.formState.errors,s),D=(v==null?void 0:v.format)||"HH:mm",$=e?(0,P1.composeValidators)([(0,P1.time)(D),e]):(0,P1.time)(D);return(0,i1.jsx)(s2.LocalizationProvider,{dateAdapter:n2.AdapterDayjs,adapterLocale:d2.default,localeText:h2.ptBR.components.MuiLocalizationProvider.defaultProps.localeText,children:(0,i1.jsx)(N1.Controller,{control:x.control,name:s,rules:$,defaultValue:c,shouldUnregister:o,render:({field:{value:b,onChange:F,ref:_}})=>(0,i1.jsxs)(o2.Grid,{display:"flex",flexDirection:"column",children:[p&&(0,i1.jsx)(I,{label:p,required:r}),(0,i1.jsx)(t2.TimePicker,u(n({ampm:!1,format:D,value:b!=null?b:null,onChange:F,disabled:L},v),{slots:{textField:r2.TextField},slotProps:{textField:y=>{var T,q;return u(n(u(n({variant:"outlined"},y),{error:!!A}),h),{inputProps:u(n({},y.inputProps),{placeholder:H||((T=y.inputProps)==null?void 0:T.placeholder)}),InputProps:u(n({},y.InputProps),{inputRef(C){_(C),typeof y.inputRef=="function"&&y.inputRef(C)},endAdornment:(0,i1.jsx)(l2,{size:h.size,children:(q=y.InputProps)==null?void 0:q.endAdornment})})})}}}),s),(0,i1.jsx)(O,{name:s})]})})})},m2=(0,a2.memo)(O2);var v2=require("react"),W1=require("react-hook-form"),J1=require("@mui/material"),k1=require("@s_mart/core");var X=require("react/jsx-runtime"),Z2=require("react"),q2=V=>{var x=V,{name:e,defaultValue:c,rules:o,shouldUnregister:s,label:r,required:p,noOptionsText:v,placeholder:H,onInputChange:L,onChange:h}=x,g=k(x,["name","defaultValue","rules","shouldUnregister","label","required","noOptionsText","placeholder","onInputChange","onChange"]);let A=(0,W1.useFormContext)();if(!A)throw new Error("Para usar o <Autocomplete /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let D=z(A.formState.errors,e);return console.warn=()=>{},(0,X.jsx)(W1.Controller,{name:e,control:A.control,defaultValue:c,rules:o,shouldUnregister:s,render:({field:$})=>(0,X.jsxs)(k1.Grid,{display:"flex",flexDirection:"column",children:[r&&(0,X.jsx)(I,{label:r,required:p}),(0,X.jsx)(J1.Autocomplete,u(n({onChange:(b,F)=>{$.onChange(F),h==null||h(F,A.watch())},onInputChange:(b,F,_)=>{_==="input"&&($.onChange(F),setTimeout(()=>{L==null||L(F,A.watch())},0))},isOptionEqualToValue:(b,F)=>b.value===F.value,renderOption:(b,F)=>(0,Z2.createElement)("li",u(n({},b),{key:F.key||F.value,onClick:_=>{var y;(y=b.onClick)==null||y.call(b,_),$.onChange(F)}}),(0,X.jsxs)(k1.Grid,{container:!0,direction:"column",children:[(0,X.jsx)(k1.Grid,{item:!0,children:F.label}),F.afterLabel&&(0,X.jsx)(k1.Grid,{item:!0,children:F.afterLabel})]})),value:$.value||null,noOptionsText:v||"Nenhuma op\xE7\xE3o encontrada"},g),{renderInput:b=>{var F,_,y;return(0,X.jsx)(J1.TextField,u(n(n({placeholder:H},b),g.textFieldProps),{error:!!D,InputProps:u(n(n({},b.InputProps),(F=g.textFieldProps)==null?void 0:F.InputProps),{inputRef:$.ref,inputProps:n(n({},b.inputProps),(y=(_=g.textFieldProps)==null?void 0:_.InputProps)==null?void 0:y.inputProps)})}))}}),e),(0,X.jsx)(O,{name:e})]})})},p2=(0,v2.memo)(q2);0&&(module.exports={Autocomplete,Checkbox,Creatable,DatePicker,Form,FormProvider,RadioButton,RadioGroup,Searchable,Select,Slider,Switch,TextField,TimePicker,useForm});
68
+ `;var l1=require("react/jsx-runtime"),U2=L=>{var y=L,{rules:e,defaultValue:c,shouldUnregister:o,name:s,required:r,label:Z,timePickerProps:v,placeholder:V,disabled:x}=y,d=k(y,["rules","defaultValue","shouldUnregister","name","required","label","timePickerProps","placeholder","disabled"]);let b=(0,N1.useFormContext)();if(!b)throw new Error("Para usar o <TimePicker /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let C=U(b.formState.errors,s),B=(v==null?void 0:v.format)||"HH:mm",T=e?(0,P1.composeValidators)([(0,P1.time)(B),e]):(0,P1.time)(B);return(0,l1.jsx)(d2.LocalizationProvider,{dateAdapter:h2.AdapterDayjs,adapterLocale:v2.default,localeText:m2.ptBR.components.MuiLocalizationProvider.defaultProps.localeText,children:(0,l1.jsx)(N1.Controller,{control:b.control,name:s,rules:T,defaultValue:c,shouldUnregister:o,render:({field:{value:F,onChange:g,ref:D}})=>(0,l1.jsxs)(t2.Grid,{display:"flex",flexDirection:"column",children:[Z&&(0,l1.jsx)(G,{label:Z,required:r}),(0,l1.jsx)(s2.TimePicker,p(n({ampm:!1,format:B,value:F!=null?F:null,onChange:g,disabled:x},v),{slots:{textField:n2.TextField,openPickerButton:M=>(0,l1.jsx)(o2,p(n({},M),{size:d.size}))},slotProps:{textField:M=>{var $;return p(n(p(n({variant:"outlined"},M),{error:!!C}),d),{inputProps:p(n({},M.inputProps),{placeholder:V||(($=M.inputProps)==null?void 0:$.placeholder)}),InputProps:p(n({},M.InputProps),{inputRef(O){D(O),typeof M.inputRef=="function"&&M.inputRef(O)}})})}}}),s),(0,l1.jsx)(R,{name:s})]})})})},p2=(0,r2.memo)(U2);var Z2=require("react"),W1=require("react-hook-form"),J1=require("@mui/material"),k1=require("@s_mart/core");var e1=require("react/jsx-runtime"),f2=require("react"),Y2=y=>{var b=y,{name:e,defaultValue:c,rules:o,shouldUnregister:s,label:r,required:Z,noOptionsText:v,placeholder:V,onInputChange:x,onChange:d}=b,L=k(b,["name","defaultValue","rules","shouldUnregister","label","required","noOptionsText","placeholder","onInputChange","onChange"]);let C=(0,W1.useFormContext)();if(!C)throw new Error("Para usar o <Autocomplete /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let B=U(C.formState.errors,e);return console.warn=()=>{},(0,e1.jsx)(W1.Controller,{name:e,control:C.control,defaultValue:c,rules:o,shouldUnregister:s,render:({field:T})=>(0,e1.jsxs)(k1.Grid,{display:"flex",flexDirection:"column",children:[r&&(0,e1.jsx)(G,{label:r,required:Z}),(0,e1.jsx)(J1.Autocomplete,p(n({onChange:(F,g)=>{T.onChange(g),d==null||d(g,C.watch())},onInputChange:(F,g,D)=>{D==="input"&&(T.onChange(g),setTimeout(()=>{x==null||x(g,C.watch())},0))},isOptionEqualToValue:(F,g)=>F.value===g.value,renderOption:(F,g)=>(0,f2.createElement)("li",p(n({},F),{key:g.key||g.value,onClick:D=>{var M;(M=F.onClick)==null||M.call(F,D),T.onChange(g)}}),(0,e1.jsxs)(k1.Grid,{container:!0,direction:"column",children:[(0,e1.jsx)(k1.Grid,{item:!0,children:g.label}),g.afterLabel&&(0,e1.jsx)(k1.Grid,{item:!0,children:g.afterLabel})]})),value:T.value||null,noOptionsText:v||"Nenhuma op\xE7\xE3o encontrada"},L),{renderInput:F=>{var g,D,M;return(0,e1.jsx)(J1.TextField,p(n(n({placeholder:V},F),L.textFieldProps),{error:!!B,InputProps:p(n(n({},F.InputProps),(g=L.textFieldProps)==null?void 0:g.InputProps),{inputRef:T.ref,inputProps:n(n({},F.inputProps),(M=(D=L.textFieldProps)==null?void 0:D.InputProps)==null?void 0:M.inputProps)})}))}}),e),(0,e1.jsx)(R,{name:e})]})})},u2=(0,Z2.memo)(Y2);0&&(module.exports={Autocomplete,Checkbox,Creatable,DatePicker,Form,FormProvider,RadioButton,RadioGroup,Searchable,Select,Slider,Switch,TextField,TimePicker,useForm});
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- var d0=Object.create;var F1=Object.defineProperty,m0=Object.defineProperties,v0=Object.getOwnPropertyDescriptor,p0=Object.getOwnPropertyDescriptors,Z0=Object.getOwnPropertyNames,u1=Object.getOwnPropertySymbols,u0=Object.getPrototypeOf,b1=Object.prototype.hasOwnProperty,E1=Object.prototype.propertyIsEnumerable;var _1=(e,i,o)=>i in e?F1(e,i,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[i]=o,n=(e,i)=>{for(var o in i||(i={}))b1.call(i,o)&&_1(e,o,i[o]);if(u1)for(var o of u1(i))E1.call(i,o)&&_1(e,o,i[o]);return e},u=(e,i)=>m0(e,p0(i));var P=(e,i)=>{var o={};for(var s in e)b1.call(e,s)&&i.indexOf(s)<0&&(o[s]=e[s]);if(e!=null&&u1)for(var s of u1(e))i.indexOf(s)<0&&E1.call(e,s)&&(o[s]=e[s]);return o};var G1=(e,i)=>()=>(i||e((i={exports:{}}).exports,i),i.exports);var f0=(e,i,o,s)=>{if(i&&typeof i=="object"||typeof i=="function")for(let r of Z0(i))!b1.call(e,r)&&r!==o&&F1(e,r,{get:()=>i[r],enumerable:!(s=v0(i,r))||s.enumerable});return e};var I1=(e,i,o)=>(o=e!=null?d0(u0(e)):{},f0(i||!e||!e.__esModule?F1(o,"default",{value:e,enumerable:!0}):o,e));var l0=G1((S1,A1)=>{(function(e,i){typeof S1=="object"&&typeof A1!="undefined"?A1.exports=i():typeof define=="function"&&define.amd?define(i):(e=typeof globalThis!="undefined"?globalThis:e||self).dayjs=i()})(S1,function(){"use strict";var e=1e3,i=6e4,o=36e5,s="millisecond",r="second",p="minute",v="hour",H="day",L="week",h="month",g="quarter",V="year",x="date",w="Invalid Date",$=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,S=/\[([^\]]+)]|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,b={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(m){var a=["th","st","nd","rd"],c=m%100;return"["+m+(a[(c-20)%10]||a[c]||a[0])+"]"}},F=function(m,a,c){var Z=String(m);return!Z||Z.length>=a?m:""+Array(a+1-Z.length).join(c)+m},T={s:F,z:function(m){var a=-m.utcOffset(),c=Math.abs(a),Z=Math.floor(c/60),t=c%60;return(a<=0?"+":"-")+F(Z,2,"0")+":"+F(t,2,"0")},m:function m(a,c){if(a.date()<c.date())return-m(c,a);var Z=12*(c.year()-a.year())+(c.month()-a.month()),t=a.clone().add(Z,h),M=c-t<0,f=a.clone().add(Z+(M?-1:1),h);return+(-(Z+(c-t)/(M?t-f:f-t))||0)},a:function(m){return m<0?Math.ceil(m)||0:Math.floor(m)},p:function(m){return{M:h,y:V,w:L,d:H,D:x,h:v,m:p,s:r,ms:s,Q:g}[m]||String(m||"").toLowerCase().replace(/s$/,"")},u:function(m){return m===void 0}},y="en",A={};A[y]=b;var R=function(m){return m instanceof E},C=function m(a,c,Z){var t;if(!a)return y;if(typeof a=="string"){var M=a.toLowerCase();A[M]&&(t=M),c&&(A[M]=c,t=M);var f=a.split("-");if(!t&&f.length>1)return m(f[0])}else{var k=a.name;A[k]=a,t=k}return!Z&&t&&(y=t),t||!Z&&y},d=function(m,a){if(R(m))return m.clone();var c=typeof a=="object"?a:{};return c.date=m,c.args=arguments,new E(c)},l=T;l.l=C,l.i=R,l.w=function(m,a){return d(m,{locale:a.$L,utc:a.$u,x:a.$x,$offset:a.$offset})};var E=function(){function m(c){this.$L=C(c.locale,null,!0),this.parse(c)}var a=m.prototype;return a.parse=function(c){this.$d=function(Z){var t=Z.date,M=Z.utc;if(t===null)return new Date(NaN);if(l.u(t))return new Date;if(t instanceof Date)return new Date(t);if(typeof t=="string"&&!/Z$/i.test(t)){var f=t.match($);if(f){var k=f[2]-1||0,G=(f[7]||"0").substring(0,3);return M?new Date(Date.UTC(f[1],k,f[3]||1,f[4]||0,f[5]||0,f[6]||0,G)):new Date(f[1],k,f[3]||1,f[4]||0,f[5]||0,f[6]||0,G)}}return new Date(t)}(c),this.$x=c.x||{},this.init()},a.init=function(){var c=this.$d;this.$y=c.getFullYear(),this.$M=c.getMonth(),this.$D=c.getDate(),this.$W=c.getDay(),this.$H=c.getHours(),this.$m=c.getMinutes(),this.$s=c.getSeconds(),this.$ms=c.getMilliseconds()},a.$utils=function(){return l},a.isValid=function(){return this.$d.toString()!==w},a.isSame=function(c,Z){var t=d(c);return this.startOf(Z)<=t&&t<=this.endOf(Z)},a.isAfter=function(c,Z){return d(c)<this.startOf(Z)},a.isBefore=function(c,Z){return this.endOf(Z)<d(c)},a.$g=function(c,Z,t){return l.u(c)?this[Z]:this.set(t,c)},a.unix=function(){return Math.floor(this.valueOf()/1e3)},a.valueOf=function(){return this.$d.getTime()},a.startOf=function(c,Z){var t=this,M=!!l.u(Z)||Z,f=l.p(c),k=function(r1,Y){var Q=l.w(t.$u?Date.UTC(t.$y,Y,r1):new Date(t.$y,Y,r1),t);return M?Q:Q.endOf(H)},G=function(r1,Y){return l.w(t.toDate()[r1].apply(t.toDate("s"),(M?[0,0,0,0]:[23,59,59,999]).slice(Y)),t)},D=this.$W,U=this.$M,K=this.$D,J="set"+(this.$u?"UTC":"");switch(f){case V:return M?k(1,0):k(31,11);case h:return M?k(1,U):k(0,U+1);case L:var h1=this.$locale().weekStart||0,d1=(D<h1?D+7:D)-h1;return k(M?K-d1:K+(6-d1),U);case H:case x:return G(J+"Hours",0);case v:return G(J+"Minutes",1);case p:return G(J+"Seconds",2);case r:return G(J+"Milliseconds",3);default:return this.clone()}},a.endOf=function(c){return this.startOf(c,!1)},a.$set=function(c,Z){var t,M=l.p(c),f="set"+(this.$u?"UTC":""),k=(t={},t[H]=f+"Date",t[x]=f+"Date",t[h]=f+"Month",t[V]=f+"FullYear",t[v]=f+"Hours",t[p]=f+"Minutes",t[r]=f+"Seconds",t[s]=f+"Milliseconds",t)[M],G=M===H?this.$D+(Z-this.$W):Z;if(M===h||M===V){var D=this.clone().set(x,1);D.$d[k](G),D.init(),this.$d=D.set(x,Math.min(this.$D,D.daysInMonth())).$d}else k&&this.$d[k](G);return this.init(),this},a.set=function(c,Z){return this.clone().$set(c,Z)},a.get=function(c){return this[l.p(c)]()},a.add=function(c,Z){var t,M=this;c=Number(c);var f=l.p(Z),k=function(U){var K=d(M);return l.w(K.date(K.date()+Math.round(U*c)),M)};if(f===h)return this.set(h,this.$M+c);if(f===V)return this.set(V,this.$y+c);if(f===H)return k(1);if(f===L)return k(7);var G=(t={},t[p]=i,t[v]=o,t[r]=e,t)[f]||1,D=this.$d.getTime()+c*G;return l.w(D,this)},a.subtract=function(c,Z){return this.add(-1*c,Z)},a.format=function(c){var Z=this,t=this.$locale();if(!this.isValid())return t.invalidDate||w;var M=c||"YYYY-MM-DDTHH:mm:ssZ",f=l.z(this),k=this.$H,G=this.$m,D=this.$M,U=t.weekdays,K=t.months,J=function(Y,Q,L1,Z1){return Y&&(Y[Q]||Y(Z,M))||L1[Q].slice(0,Z1)},h1=function(Y){return l.s(k%12||12,Y,"0")},d1=t.meridiem||function(Y,Q,L1){var Z1=Y<12?"AM":"PM";return L1?Z1.toLowerCase():Z1},r1={YY:String(this.$y).slice(-2),YYYY:this.$y,M:D+1,MM:l.s(D+1,2,"0"),MMM:J(t.monthsShort,D,K,3),MMMM:J(K,D),D:this.$D,DD:l.s(this.$D,2,"0"),d:String(this.$W),dd:J(t.weekdaysMin,this.$W,U,2),ddd:J(t.weekdaysShort,this.$W,U,3),dddd:U[this.$W],H:String(k),HH:l.s(k,2,"0"),h:h1(1),hh:h1(2),a:d1(k,G,!0),A:d1(k,G,!1),m:String(G),mm:l.s(G,2,"0"),s:String(this.$s),ss:l.s(this.$s,2,"0"),SSS:l.s(this.$ms,3,"0"),Z:f};return M.replace(S,function(Y,Q){return Q||r1[Y]||f.replace(":","")})},a.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},a.diff=function(c,Z,t){var M,f=l.p(Z),k=d(c),G=(k.utcOffset()-this.utcOffset())*i,D=this-k,U=l.m(this,k);return U=(M={},M[V]=U/12,M[h]=U,M[g]=U/3,M[L]=(D-G)/6048e5,M[H]=(D-G)/864e5,M[v]=D/o,M[p]=D/i,M[r]=D/e,M)[f]||D,t?U:l.a(U)},a.daysInMonth=function(){return this.endOf(h).$D},a.$locale=function(){return A[this.$L]},a.locale=function(c,Z){if(!c)return this.$L;var t=this.clone(),M=C(c,Z,!0);return M&&(t.$L=M),t},a.clone=function(){return l.w(this.$d,this)},a.toDate=function(){return new Date(this.valueOf())},a.toJSON=function(){return this.isValid()?this.toISOString():null},a.toISOString=function(){return this.$d.toISOString()},a.toString=function(){return this.$d.toUTCString()},m}(),c1=E.prototype;return d.prototype=c1,[["$ms",s],["$s",r],["$m",p],["$H",v],["$W",H],["$M",h],["$y",V],["$D",x]].forEach(function(m){c1[m[1]]=function(a){return this.$g(a,m[0],m[1])}}),d.extend=function(m,a){return m.$i||(m(a,E,d),m.$i=!0),d},d.locale=C,d.isDayjs=R,d.unix=function(m){return d(1e3*m)},d.en=A[y],d.Ls=A,d.p={},d})});var D1=G1(($1,T1)=>{(function(e,i){typeof $1=="object"&&typeof T1!="undefined"?T1.exports=i(l0()):typeof define=="function"&&define.amd?define(["dayjs"],i):(e=typeof globalThis!="undefined"?globalThis:e||self).dayjs_locale_pt_br=i(e.dayjs)})($1,function(e){"use strict";function i(r){return r&&typeof r=="object"&&"default"in r?r:{default:r}}var o=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(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})});import{FormProvider as M0}from"react-hook-form";import{jsx as B1}from"react/jsx-runtime";var H0=r=>{var p=r,{children:e,style:i,onSubmit:o}=p,s=P(p,["children","style","onSubmit"]);return B1(M0,u(n({},s),{children:B1("form",{onSubmit:v=>{v.preventDefault(),v.stopPropagation(),o(v)},style:i,children:e})}))},C1=H0;import{useEffect as V0}from"react";import{useForm as y0}from"react-hook-form";import{zodResolver as g0}from"@hookform/resolvers/zod";var x0=s=>{var r=s,{disableDefaultValuesUpdate:e,onSubmit:i}=r,o=P(r,["disableDefaultValuesUpdate","onSubmit"]);let p=y0(u(n({},o),{resolver:o.schema&&g0(o.schema)}));return V0(()=>{e||p.reset(o.defaultValues)},[o.defaultValues,p.reset]),u(n({},p),{onSubmit:p.handleSubmit(v=>i(v,p))})},P1=x0;import{jsx as b0}from"react/jsx-runtime";function L0(s){var r=s,{children:e,style:i}=r,o=P(r,["children","style"]);let p=P1(o);return b0(C1,u(n({},p),{style:i,children:typeof e=="function"?e(p):e}))}var F0=L0;import{memo as A0,useState as $0}from"react";import{Controller as T0,useFormContext as D0}from"react-hook-form";import{Grid as w1,InputAdornment as _0,TextField as E0}from"@mui/material";var R1={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"},O1={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 X={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 t1 from"@s_mart/masks";import{Typography as U1}from"@mui/material";import{toRem as C0}from"@s_mart/utils";import{jsx as z1,jsxs as P0}from"react/jsx-runtime";var _=({label:e,required:i,regular:o})=>P0("span",{style:{display:"flex",alignItems:"center",gap:C0(2)},children:[z1(U1,{variant:"caption",fontWeight:o?400:700,style:{display:"flex",alignItems:"center"},children:e}),i&&z1(U1,{variant:"caption",fontWeight:900,color:"error",children:"*"})]});import{useFormContext as k0}from"react-hook-form";import{Indicator as w0}from"@s_mart/core";var z=(e,i)=>{var o,s,r,p,v;if(e[i])return e[i];if(i.includes("[")){let[H,L]=i.split("["),[h,g]=L.split("].");return(s=(o=e[H])==null?void 0:o[h])==null?void 0:s[g]}if(i.includes(".")){let[H,L,h]=i.split(".");return h?(v=(p=e[H])==null?void 0:p[L])==null?void 0:v[h]:(r=e[H])==null?void 0:r[L]}};import{jsx as S0}from"react/jsx-runtime";var I=({name:e})=>{var s;let i=k0(),o=z((s=i==null?void 0:i.formState)==null?void 0:s.errors,e);return o?S0(w0,{severity:"error",children:o==null?void 0:o.message}):null};import{LIcon as Y1,Tooltip as G0}from"@s_mart/core";import{jsx as j,jsxs as j1}from"react/jsx-runtime";var I0=w=>{var $=w,{name:e,rules:i,defaultValue:o,shouldUnregister:s,label:r,required:p,mask:v,variant:H="outlined",info:L,parse:h,format:g,onInputChange:V}=$,x=P($,["name","rules","defaultValue","shouldUnregister","label","required","mask","variant","info","parse","format","onInputChange"]);let S=D0();if(!S)throw new Error("Para usar o <TextField /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let[b,F]=$0(!1),T=C=>{var l;let d=C;return g&&(d=g(C)),v?(l=t1==null?void 0:t1[v])==null?void 0:l.format(d):d},y=C=>{var l;let d=C;return h&&(d=h(C)),v?(l=t1==null?void 0:t1[v])==null?void 0:l.parse(d):d},A=C=>{if(!C||v!=="porcentagem")return;C==null||C.stopPropagation();let d=(C==null?void 0:C.target).value;if(d){let l=String(d);if(l.length>0){let E=l.indexOf("%");E>-1&&(C.currentTarget.selectionEnd=E)}}},R=z(S.formState.errors,e);return j(T0,{control:S.control,name:e,rules:i,defaultValue:o,shouldUnregister:s,render:({field:{value:C,onChange:d,ref:l}})=>j1(w1,{display:"flex",flexDirection:"column",children:[j1("div",{style:{display:"flex"},children:[r&&j(w1,{item:!0,children:j(_,{label:r,required:p})}),L&&j(w1,{item:!0,children:j(G0,{title:L,placement:"top",children:j("div",{style:{width:"fit-content"},children:j(Y1,{icon:X,color:"#757575"})})})})]}),j(E0,u(n({variant:H,defaultValue:o,value:T(C||""),onChange:E=>{var m;let c1=y((m=E==null?void 0:E.target)==null?void 0:m.value);d(c1),V==null||V(c1,S.watch())},error:!!R},x),{type:x.type==="password"?b?"text":"password":x.type,autoComplete:x.autoComplete||"off",InputProps:n({onKeyDown:A,inputRef:l,endAdornment:x.type==="password"&&j(_0,{position:"end",onClick:()=>F(!b),style:{cursor:"pointer"},children:j(Y1,{icon:b?R1:O1,size:"24px",removeMargin:!0})})},x.InputProps)}),e),j(I,{name:e})]})})},B0=A0(I0);import{memo as R0,useState as O0}from"react";import{Controller as q0,useFormContext as U0}from"react-hook-form";import{Divider as z0,LIcon as Y0,Tooltip as j0}from"@s_mart/core";import{Grid as i1,Select as N0,MenuItem as N1,useTheme as W0}from"@mui/material";import{jsx as q,jsxs as f1}from"react/jsx-runtime";var J0=$=>{var S=$,{name:e,rules:i,defaultValue:o,shouldUnregister:s,label:r,required:p,options:v,placeholder:H,disableOnChangeForm:L=!1,multiple:h,info:g,footer:V,onChange:x}=S,w=P(S,["name","rules","defaultValue","shouldUnregister","label","required","options","placeholder","disableOnChangeForm","multiple","info","footer","onChange"]);let b=U0(),{palette:F}=W0(),[T,y]=O0(!1);if(!b)throw new Error("Para usar o <Select /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let A=z(b.formState.errors,e);return console.warn=()=>{},q(q0,{control:b.control,name:e,rules:i,defaultValue:o,shouldUnregister:s,render:({field:{value:R,onChange:C,ref:d}})=>f1(i1,{display:"flex",flexDirection:"column",children:[f1("div",{style:{display:"flex"},children:[r&&q(i1,{item:!0,children:q(_,{label:r,required:p})}),g&&q(i1,{item:!0,children:q(j0,{title:g,placement:"top",children:q("div",{style:{width:"fit-content"},children:q(Y0,{icon:X,color:"#757575"})})})})]}),f1(N0,u(n({open:T,onOpen:()=>y(!0),onClose:()=>y(!1),displayEmpty:!!H,variant:"outlined",autoComplete:"off",value:R?R||"":h?[]:"",renderValue:l=>{if(l.label)return l.label;if(H)return q("p",{style:{color:F.grey[400]},children:H})},multiple:h,onChange:l=>{!L&&C(l.target.value),x&&x(l.target.value,b.watch())},error:!!A,size:w.size||"medium",inputRef:d},w),{children:[H&&q(N1,{disabled:!0,value:"",children:q("p",{style:{color:F.grey[400]},children:H})}),v==null?void 0:v.map((l,E)=>q(N1,{value:l,children:f1(i1,{container:!0,direction:"column",children:[q(i1,{item:!0,children:l.label}),l.afterLabel&&q(i1,{item:!0,children:l.afterLabel})]})},E)),V&&[q(i1,{px:2,py:1,children:q(z0,{})},"footer-divider"),q("div",{children:V({closeSelect:()=>y(!1)})},"footer-content")]]}),e),q(I,{name:e})]})})},K0=R0(J0);import{forwardRef as Q0,memo as X0}from"react";import{Controller as e2,useFormContext as c2}from"react-hook-form";import{Divider as W1,LIcon as i2,Tooltip as l2}from"@s_mart/core";import{Grid as e1,Autocomplete as a2,TextField as o2}from"@mui/material";import{Fragment as M1,jsx as O,jsxs as l1}from"react/jsx-runtime";import{createElement as J1}from"react";var r2=b=>{var F=b,{name:e,rules:i,defaultValue:o,shouldUnregister:s,label:r,required:p,options:v,textFieldProps:H,noOptionsText:L,footer:h,multiple:g,info:V,placeholder:x,onChange:w,onInputChange:$}=F,S=P(F,["name","rules","defaultValue","shouldUnregister","label","required","options","textFieldProps","noOptionsText","footer","multiple","info","placeholder","onChange","onInputChange"]);let T=c2();if(!T)throw new Error("Para usar o <Searchable /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let y=z(T.formState.errors,e);return console.warn=()=>{},O(e2,{control:T.control,name:e,rules:i,defaultValue:o,shouldUnregister:s,render:({field:{onChange:A,value:R,ref:C}})=>l1(e1,{display:"flex",flexDirection:"column",children:[l1("div",{style:{display:"flex"},children:[r&&O(e1,{item:!0,children:O(_,{label:r,required:p})}),V&&O(e1,{item:!0,children:O(l2,{title:V,placement:"top",children:O("div",{style:{width:"fit-content"},children:O(i2,{icon:X,color:"#757575"})})})})]}),O(a2,u(n({onChange:(d,l)=>{A(l),w==null||w(l,T.watch())},onInputChange:(d,l,E)=>{E==="input"&&setTimeout(()=>{$==null||$(l,T.watch())},0)},value:R||(g?[]:null),options:v,multiple:g,noOptionsText:l1(M1,{children:[L||"Nenhum resultado encontrado",h?l1(M1,{children:[O(e1,{py:1,children:O(W1,{})}),h]}):null]}),isOptionEqualToValue:(d,l)=>typeof d=="string"&&typeof l=="string"?d===l:typeof d=="object"&&typeof l=="object"?d.value===l.value:!1,renderOption:(d,l)=>typeof l=="object"?J1("li",u(n({},d),{key:l.key||l.value}),l1(e1,{container:!0,direction:"column",children:[O(e1,{item:!0,children:l.label}),l.afterLabel&&O(e1,{item:!0,children:l.afterLabel})]})):J1("li",u(n({},d),{key:l}),l),ListboxComponent:Q0(function(l,E){return l1(M1,{children:[O("ul",u(n({},l),{ref:E})),!!h&&O("div",u(n({},l),{children:l1(M1,{children:[O(e1,{px:2,py:1,children:O(W1,{})}),h]})}),"searchable-footer")]})})},S),{renderInput:d=>O(o2,u(n(n({error:!!y,placeholder:x},d),H),{inputRef:C}))}),e),O(I,{name:e})]})})},t2=X0(r2);import{memo as h2}from"react";import{Controller as d2,useFormContext as m2}from"react-hook-form";import{Grid as n1,Autocomplete as v2,TextField as p2}from"@mui/material";import{toRem as H1}from"@s_mart/utils";import n2 from"@emotion/styled";import{css as K1}from"@emotion/react";var Q1=K1`
1
+ var d0=Object.create;var F1=Object.defineProperty,m0=Object.defineProperties,v0=Object.getOwnPropertyDescriptor,p0=Object.getOwnPropertyDescriptors,Z0=Object.getOwnPropertyNames,u1=Object.getOwnPropertySymbols,u0=Object.getPrototypeOf,b1=Object.prototype.hasOwnProperty,E1=Object.prototype.propertyIsEnumerable;var _1=(e,l,o)=>l in e?F1(e,l,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[l]=o,n=(e,l)=>{for(var o in l||(l={}))b1.call(l,o)&&_1(e,o,l[o]);if(u1)for(var o of u1(l))E1.call(l,o)&&_1(e,o,l[o]);return e},p=(e,l)=>m0(e,p0(l));var P=(e,l)=>{var o={};for(var s in e)b1.call(e,s)&&l.indexOf(s)<0&&(o[s]=e[s]);if(e!=null&&u1)for(var s of u1(e))l.indexOf(s)<0&&E1.call(e,s)&&(o[s]=e[s]);return o};var G1=(e,l)=>()=>(l||e((l={exports:{}}).exports,l),l.exports);var f0=(e,l,o,s)=>{if(l&&typeof l=="object"||typeof l=="function")for(let r of Z0(l))!b1.call(e,r)&&r!==o&&F1(e,r,{get:()=>l[r],enumerable:!(s=v0(l,r))||s.enumerable});return e};var B1=(e,l,o)=>(o=e!=null?d0(u0(e)):{},f0(l||!e||!e.__esModule?F1(o,"default",{value:e,enumerable:!0}):o,e));var l0=G1((w1,$1)=>{(function(e,l){typeof w1=="object"&&typeof $1!="undefined"?$1.exports=l():typeof define=="function"&&define.amd?define(l):(e=typeof globalThis!="undefined"?globalThis:e||self).dayjs=l()})(w1,function(){"use strict";var e=1e3,l=6e4,o=36e5,s="millisecond",r="second",Z="minute",v="hour",V="day",x="week",d="month",L="quarter",y="year",b="date",C="Invalid Date",_=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\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,F={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(m){var a=["th","st","nd","rd"],c=m%100;return"["+m+(a[(c-20)%10]||a[c]||a[0])+"]"}},g=function(m,a,c){var u=String(m);return!u||u.length>=a?m:""+Array(a+1-u.length).join(c)+m},A={s:g,z:function(m){var a=-m.utcOffset(),c=Math.abs(a),u=Math.floor(c/60),t=c%60;return(a<=0?"+":"-")+g(u,2,"0")+":"+g(t,2,"0")},m:function m(a,c){if(a.date()<c.date())return-m(c,a);var u=12*(c.year()-a.year())+(c.month()-a.month()),t=a.clone().add(u,d),H=c-t<0,f=a.clone().add(u+(H?-1:1),d);return+(-(u+(c-t)/(H?t-f:f-t))||0)},a:function(m){return m<0?Math.ceil(m)||0:Math.floor(m)},p:function(m){return{M:d,y,w:x,d:V,D:b,h:v,m:Z,s:r,ms:s,Q:L}[m]||String(m||"").toLowerCase().replace(/s$/,"")},u:function(m){return m===void 0}},M="en",S={};S[M]=F;var I=function(m){return m instanceof w},z=function m(a,c,u){var t;if(!a)return M;if(typeof a=="string"){var H=a.toLowerCase();S[H]&&(t=H),c&&(S[H]=c,t=H);var f=a.split("-");if(!t&&f.length>1)return m(f[0])}else{var k=a.name;S[k]=a,t=k}return!u&&t&&(M=t),t||!u&&M},h=function(m,a){if(I(m))return m.clone();var c=typeof a=="object"?a:{};return c.date=m,c.args=arguments,new w(c)},i=A;i.l=z,i.i=I,i.w=function(m,a){return h(m,{locale:a.$L,utc:a.$u,x:a.$x,$offset:a.$offset})};var w=function(){function m(c){this.$L=z(c.locale,null,!0),this.parse(c)}var a=m.prototype;return a.parse=function(c){this.$d=function(u){var t=u.date,H=u.utc;if(t===null)return new Date(NaN);if(i.u(t))return new Date;if(t instanceof Date)return new Date(t);if(typeof t=="string"&&!/Z$/i.test(t)){var f=t.match(_);if(f){var k=f[2]-1||0,E=(f[7]||"0").substring(0,3);return H?new Date(Date.UTC(f[1],k,f[3]||1,f[4]||0,f[5]||0,f[6]||0,E)):new Date(f[1],k,f[3]||1,f[4]||0,f[5]||0,f[6]||0,E)}}return new Date(t)}(c),this.$x=c.x||{},this.init()},a.init=function(){var c=this.$d;this.$y=c.getFullYear(),this.$M=c.getMonth(),this.$D=c.getDate(),this.$W=c.getDay(),this.$H=c.getHours(),this.$m=c.getMinutes(),this.$s=c.getSeconds(),this.$ms=c.getMilliseconds()},a.$utils=function(){return i},a.isValid=function(){return this.$d.toString()!==C},a.isSame=function(c,u){var t=h(c);return this.startOf(u)<=t&&t<=this.endOf(u)},a.isAfter=function(c,u){return h(c)<this.startOf(u)},a.isBefore=function(c,u){return this.endOf(u)<h(c)},a.$g=function(c,u,t){return i.u(c)?this[u]:this.set(t,c)},a.unix=function(){return Math.floor(this.valueOf()/1e3)},a.valueOf=function(){return this.$d.getTime()},a.startOf=function(c,u){var t=this,H=!!i.u(u)||u,f=i.p(c),k=function(r1,Y){var X=i.w(t.$u?Date.UTC(t.$y,Y,r1):new Date(t.$y,Y,r1),t);return H?X:X.endOf(V)},E=function(r1,Y){return i.w(t.toDate()[r1].apply(t.toDate("s"),(H?[0,0,0,0]:[23,59,59,999]).slice(Y)),t)},T=this.$W,q=this.$M,Q=this.$D,K="set"+(this.$u?"UTC":"");switch(f){case y:return H?k(1,0):k(31,11);case d:return H?k(1,q):k(0,q+1);case x:var h1=this.$locale().weekStart||0,d1=(T<h1?T+7:T)-h1;return k(H?Q-d1:Q+(6-d1),q);case V:case b:return E(K+"Hours",0);case v:return E(K+"Minutes",1);case Z:return E(K+"Seconds",2);case r:return E(K+"Milliseconds",3);default:return this.clone()}},a.endOf=function(c){return this.startOf(c,!1)},a.$set=function(c,u){var t,H=i.p(c),f="set"+(this.$u?"UTC":""),k=(t={},t[V]=f+"Date",t[b]=f+"Date",t[d]=f+"Month",t[y]=f+"FullYear",t[v]=f+"Hours",t[Z]=f+"Minutes",t[r]=f+"Seconds",t[s]=f+"Milliseconds",t)[H],E=H===V?this.$D+(u-this.$W):u;if(H===d||H===y){var T=this.clone().set(b,1);T.$d[k](E),T.init(),this.$d=T.set(b,Math.min(this.$D,T.daysInMonth())).$d}else k&&this.$d[k](E);return this.init(),this},a.set=function(c,u){return this.clone().$set(c,u)},a.get=function(c){return this[i.p(c)]()},a.add=function(c,u){var t,H=this;c=Number(c);var f=i.p(u),k=function(q){var Q=h(H);return i.w(Q.date(Q.date()+Math.round(q*c)),H)};if(f===d)return this.set(d,this.$M+c);if(f===y)return this.set(y,this.$y+c);if(f===V)return k(1);if(f===x)return k(7);var E=(t={},t[Z]=l,t[v]=o,t[r]=e,t)[f]||1,T=this.$d.getTime()+c*E;return i.w(T,this)},a.subtract=function(c,u){return this.add(-1*c,u)},a.format=function(c){var u=this,t=this.$locale();if(!this.isValid())return t.invalidDate||C;var H=c||"YYYY-MM-DDTHH:mm:ssZ",f=i.z(this),k=this.$H,E=this.$m,T=this.$M,q=t.weekdays,Q=t.months,K=function(Y,X,L1,Z1){return Y&&(Y[X]||Y(u,H))||L1[X].slice(0,Z1)},h1=function(Y){return i.s(k%12||12,Y,"0")},d1=t.meridiem||function(Y,X,L1){var Z1=Y<12?"AM":"PM";return L1?Z1.toLowerCase():Z1},r1={YY:String(this.$y).slice(-2),YYYY:this.$y,M:T+1,MM:i.s(T+1,2,"0"),MMM:K(t.monthsShort,T,Q,3),MMMM:K(Q,T),D:this.$D,DD:i.s(this.$D,2,"0"),d:String(this.$W),dd:K(t.weekdaysMin,this.$W,q,2),ddd:K(t.weekdaysShort,this.$W,q,3),dddd:q[this.$W],H:String(k),HH:i.s(k,2,"0"),h:h1(1),hh:h1(2),a:d1(k,E,!0),A:d1(k,E,!1),m:String(E),mm:i.s(E,2,"0"),s:String(this.$s),ss:i.s(this.$s,2,"0"),SSS:i.s(this.$ms,3,"0"),Z:f};return H.replace($,function(Y,X){return X||r1[Y]||f.replace(":","")})},a.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},a.diff=function(c,u,t){var H,f=i.p(u),k=h(c),E=(k.utcOffset()-this.utcOffset())*l,T=this-k,q=i.m(this,k);return q=(H={},H[y]=q/12,H[d]=q,H[L]=q/3,H[x]=(T-E)/6048e5,H[V]=(T-E)/864e5,H[v]=T/o,H[Z]=T/l,H[r]=T/e,H)[f]||T,t?q:i.a(q)},a.daysInMonth=function(){return this.endOf(d).$D},a.$locale=function(){return S[this.$L]},a.locale=function(c,u){if(!c)return this.$L;var t=this.clone(),H=z(c,u,!0);return H&&(t.$L=H),t},a.clone=function(){return i.w(this.$d,this)},a.toDate=function(){return new Date(this.valueOf())},a.toJSON=function(){return this.isValid()?this.toISOString():null},a.toISOString=function(){return this.$d.toISOString()},a.toString=function(){return this.$d.toUTCString()},m}(),j=w.prototype;return h.prototype=j,[["$ms",s],["$s",r],["$m",Z],["$H",v],["$W",V],["$M",d],["$y",y],["$D",b]].forEach(function(m){j[m[1]]=function(a){return this.$g(a,m[0],m[1])}}),h.extend=function(m,a){return m.$i||(m(a,w,h),m.$i=!0),h},h.locale=z,h.isDayjs=I,h.unix=function(m){return h(1e3*m)},h.en=S[M],h.Ls=S,h.p={},h})});var D1=G1((A1,T1)=>{(function(e,l){typeof A1=="object"&&typeof T1!="undefined"?T1.exports=l(l0()):typeof define=="function"&&define.amd?define(["dayjs"],l):(e=typeof globalThis!="undefined"?globalThis:e||self).dayjs_locale_pt_br=l(e.dayjs)})(A1,function(e){"use strict";function l(r){return r&&typeof r=="object"&&"default"in r?r:{default:r}}var o=l(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})});import{FormProvider as M0}from"react-hook-form";import{jsx as I1}from"react/jsx-runtime";var H0=r=>{var Z=r,{children:e,style:l,onSubmit:o}=Z,s=P(Z,["children","style","onSubmit"]);return I1(M0,p(n({},s),{children:I1("form",{onSubmit:v=>{v.preventDefault(),v.stopPropagation(),o(v)},style:l,children:e})}))},C1=H0;import{useEffect as V0}from"react";import{useForm as y0}from"react-hook-form";import{zodResolver as g0}from"@hookform/resolvers/zod";var x0=s=>{var r=s,{disableDefaultValuesUpdate:e,onSubmit:l}=r,o=P(r,["disableDefaultValuesUpdate","onSubmit"]);let Z=y0(p(n({},o),{resolver:o.schema&&g0(o.schema)}));return V0(()=>{e||Z.reset(o.defaultValues)},[o.defaultValues,Z.reset]),p(n({},Z),{onSubmit:Z.handleSubmit(v=>l(v,Z))})},P1=x0;import{jsx as b0}from"react/jsx-runtime";function L0(s){var r=s,{children:e,style:l}=r,o=P(r,["children","style"]);let Z=P1(o);return b0(C1,p(n({},Z),{style:l,children:typeof e=="function"?e(Z):e}))}var F0=L0;import{memo as $0,useState as A0}from"react";import{Controller as T0,useFormContext as D0}from"react-hook-form";import{Grid as S1,InputAdornment as _0,TextField as E0}from"@mui/material";var R1={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"},O1={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 e1={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 t1 from"@s_mart/masks";import{Typography as U1}from"@mui/material";import{toRem as C0}from"@s_mart/utils";import{jsx as Y1,jsxs as P0}from"react/jsx-runtime";var D=({label:e,required:l,regular:o})=>P0("span",{style:{display:"flex",alignItems:"center",gap:C0(2)},children:[Y1(U1,{variant:"caption",fontWeight:o?400:700,style:{display:"flex",alignItems:"center"},children:e}),l&&Y1(U1,{variant:"caption",fontWeight:900,color:"error",children:"*"})]});import{useFormContext as k0}from"react-hook-form";import{Indicator as S0}from"@s_mart/core";var U=(e,l)=>{var o,s,r,Z,v;if(e[l])return e[l];if(l.includes("[")){let[V,x]=l.split("["),[d,L]=x.split("].");return(s=(o=e[V])==null?void 0:o[d])==null?void 0:s[L]}if(l.includes(".")){let[V,x,d]=l.split(".");return d?(v=(Z=e[V])==null?void 0:Z[x])==null?void 0:v[d]:(r=e[V])==null?void 0:r[x]}};import{jsx as w0}from"react/jsx-runtime";var G=({name:e})=>{var s;let l=k0(),o=U((s=l==null?void 0:l.formState)==null?void 0:s.errors,e);return o?w0(S0,{severity:"error",children:o==null?void 0:o.message}):null};import{LIcon as z1,Tooltip as G0}from"@s_mart/core";import{jsx as N,jsxs as j1}from"react/jsx-runtime";var B0=_=>{var $=_,{name:e,rules:l,defaultValue:o,shouldUnregister:s,label:r,required:Z,mask:v,variant:V="outlined",info:x,parse:d,inputMode:L,format:y,onInputChange:b}=$,C=P($,["name","rules","defaultValue","shouldUnregister","label","required","mask","variant","info","parse","inputMode","format","onInputChange"]);let F=D0();if(!F)throw new Error("Para usar o <TextField /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let[g,A]=A0(!1),M=h=>{var w;let i=h;return y&&(i=y(h)),v?(w=t1==null?void 0:t1[v])==null?void 0:w.format(i):i},S=h=>{var w;let i=h;return d&&(i=d(h)),v?(w=t1==null?void 0:t1[v])==null?void 0:w.parse(i):i},I=h=>{if(!h||v!=="porcentagem")return;h==null||h.stopPropagation();let i=(h==null?void 0:h.target).value;if(i){let w=String(i);if(w.length>0){let j=w.indexOf("%");j>-1&&(h.currentTarget.selectionEnd=j)}}},z=U(F.formState.errors,e);return N(T0,{control:F.control,name:e,rules:l,defaultValue:o,shouldUnregister:s,render:({field:{value:h,onChange:i,ref:w}})=>j1(S1,{display:"flex",flexDirection:"column",children:[j1("div",{style:{display:"flex"},children:[r&&N(S1,{item:!0,children:N(D,{label:r,required:Z})}),x&&N(S1,{item:!0,children:N(G0,{title:x,placement:"top",children:N("div",{style:{width:"fit-content"},children:N(z1,{icon:e1,color:"#757575"})})})})]}),N(E0,p(n({variant:V,defaultValue:o,value:M(h||""),onChange:j=>{var a;let m=S((a=j==null?void 0:j.target)==null?void 0:a.value);i(m),b==null||b(m,F.watch())},error:!!z},C),{type:C.type==="password"?g?"text":"password":C.type,autoComplete:C.autoComplete||"off",inputProps:n({inputMode:L},C.inputProps),InputProps:n({onKeyDown:I,inputRef:w,endAdornment:C.type==="password"&&N(_0,{position:"end",onClick:()=>A(!g),style:{cursor:"pointer"},children:N(z1,{icon:g?R1:O1,size:"24px",removeMargin:!0})})},C.InputProps)}),e),N(G,{name:e})]})})},I0=$0(B0);import{memo as R0,useState as O0}from"react";import{Controller as q0,useFormContext as U0}from"react-hook-form";import{Divider as Y0,LIcon as z0,Tooltip as j0}from"@s_mart/core";import{Grid as i1,Select as N0,MenuItem as N1,useTheme as W0}from"@mui/material";import{jsx as O,jsxs as f1}from"react/jsx-runtime";var J0=_=>{var $=_,{name:e,rules:l,defaultValue:o,shouldUnregister:s,label:r,required:Z,options:v,placeholder:V,disableOnChangeForm:x=!1,multiple:d,info:L,footer:y,onChange:b}=$,C=P($,["name","rules","defaultValue","shouldUnregister","label","required","options","placeholder","disableOnChangeForm","multiple","info","footer","onChange"]);let F=U0(),{palette:g}=W0(),[A,M]=O0(!1);if(!F)throw new Error("Para usar o <Select /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let S=U(F.formState.errors,e);return console.warn=()=>{},O(q0,{control:F.control,name:e,rules:l,defaultValue:o,shouldUnregister:s,render:({field:{value:I,onChange:z,ref:h}})=>f1(i1,{display:"flex",flexDirection:"column",children:[f1("div",{style:{display:"flex"},children:[r&&O(i1,{item:!0,children:O(D,{label:r,required:Z})}),L&&O(i1,{item:!0,children:O(j0,{title:L,placement:"top",children:O("div",{style:{width:"fit-content"},children:O(z0,{icon:e1,color:"#757575"})})})})]}),f1(N0,p(n({open:A,onOpen:()=>M(!0),onClose:()=>M(!1),displayEmpty:!!V,variant:"outlined",autoComplete:"off",value:I?I||"":d?[]:"",renderValue:i=>{if(i.label)return i.label;if(V)return O("p",{style:{color:g.grey[400]},children:V})},multiple:d,onChange:i=>{!x&&z(i.target.value),b&&b(i.target.value,F.watch())},error:!!S,size:C.size||"medium",inputRef:h},C),{children:[V&&O(N1,{disabled:!0,value:"",children:O("p",{style:{color:g.grey[400]},children:V})}),v==null?void 0:v.map((i,w)=>O(N1,{value:i,children:f1(i1,{container:!0,direction:"column",children:[O(i1,{item:!0,children:i.label}),i.afterLabel&&O(i1,{item:!0,children:i.afterLabel})]})},w)),y&&[O(i1,{px:2,py:1,children:O(Y0,{})},"footer-divider"),O("div",{children:y({closeSelect:()=>M(!1)})},"footer-content")]]}),e),O(G,{name:e})]})})},K0=R0(J0);import{forwardRef as Q0,memo as X0}from"react";import{Controller as e2,useFormContext as c2}from"react-hook-form";import{Divider as W1,LIcon as i2,Tooltip as l2}from"@s_mart/core";import{Grid as c1,Autocomplete as a2,TextField as o2}from"@mui/material";import{Fragment as M1,jsx as R,jsxs as l1}from"react/jsx-runtime";import{createElement as J1}from"react";var r2=F=>{var g=F,{name:e,rules:l,defaultValue:o,shouldUnregister:s,label:r,required:Z,options:v,textFieldProps:V,noOptionsText:x,footer:d,multiple:L,info:y,placeholder:b,onChange:C,onInputChange:_}=g,$=P(g,["name","rules","defaultValue","shouldUnregister","label","required","options","textFieldProps","noOptionsText","footer","multiple","info","placeholder","onChange","onInputChange"]);let A=c2();if(!A)throw new Error("Para usar o <Searchable /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let M=U(A.formState.errors,e);return console.warn=()=>{},R(e2,{control:A.control,name:e,rules:l,defaultValue:o,shouldUnregister:s,render:({field:{onChange:S,value:I,ref:z}})=>l1(c1,{display:"flex",flexDirection:"column",children:[l1("div",{style:{display:"flex"},children:[r&&R(c1,{item:!0,children:R(D,{label:r,required:Z})}),y&&R(c1,{item:!0,children:R(l2,{title:y,placement:"top",children:R("div",{style:{width:"fit-content"},children:R(i2,{icon:e1,color:"#757575"})})})})]}),R(a2,p(n({onChange:(h,i)=>{S(i),C==null||C(i,A.watch())},onInputChange:(h,i,w)=>{w==="input"&&setTimeout(()=>{_==null||_(i,A.watch())},0)},value:I||(L?[]:null),options:v,multiple:L,noOptionsText:l1(M1,{children:[x||"Nenhum resultado encontrado",d?l1(M1,{children:[R(c1,{py:1,children:R(W1,{})}),d]}):null]}),isOptionEqualToValue:(h,i)=>typeof h=="string"&&typeof i=="string"?h===i:typeof h=="object"&&typeof i=="object"?h.value===i.value:!1,renderOption:(h,i)=>typeof i=="object"?J1("li",p(n({},h),{key:i.key||i.value}),l1(c1,{container:!0,direction:"column",children:[R(c1,{item:!0,children:i.label}),i.afterLabel&&R(c1,{item:!0,children:i.afterLabel})]})):J1("li",p(n({},h),{key:i}),i),ListboxComponent:Q0(function(i,w){return l1(M1,{children:[R("ul",p(n({},i),{ref:w})),!!d&&R("div",p(n({},i),{children:l1(M1,{children:[R(c1,{px:2,py:1,children:R(W1,{})}),d]})}),"searchable-footer")]})})},$),{renderInput:h=>R(o2,p(n(n({error:!!M,placeholder:b},h),V),{inputRef:z}))}),e),R(G,{name:e})]})})},t2=X0(r2);import{memo as h2}from"react";import{Controller as d2,useFormContext as m2}from"react-hook-form";import{Grid as n1,Autocomplete as v2,TextField as p2}from"@mui/material";import{toRem as H1}from"@s_mart/utils";import n2 from"@emotion/styled";import{css as K1}from"@emotion/react";var Q1=K1`
2
2
  display: flex;
3
3
  align-items: center;
4
4
  justify-content: center;
@@ -46,27 +46,23 @@ var d0=Object.create;var F1=Object.defineProperty,m0=Object.defineProperties,v0=
46
46
  ${Q1}
47
47
  }
48
48
 
49
- ${({hideAddButton:e,theme:i})=>!e&&s2(i)}
50
- `;import{LIcon as V1,Tooltip as Z2,Button as u2}from"@s_mart/core";import{isObject as f2,isEmpty as M2}from"lodash";import{toRem as e0}from"@s_mart/utils";import{jsx as B,jsxs as a1}from"react/jsx-runtime";import{createElement as c0}from"react";var H2=T=>{var y=T,{name:e,rules:i,defaultValue:o,shouldUnregister:s,label:r,required:p,options:v,editable:H,onEditOption:L,onCreateOption:h,textFieldProps:g,hideAddButton:V,multiple:x,info:w,onChange:$,onInputChange:S,placeholder:b}=y,F=P(y,["name","rules","defaultValue","shouldUnregister","label","required","options","editable","onEditOption","onCreateOption","textFieldProps","hideAddButton","multiple","info","onChange","onInputChange","placeholder"]);let A=m2();if(!A)throw new Error("Para usar o <Creatable /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let R=z(A.formState.errors,e);console.warn=()=>{};let C=l=>{h?h(l):console.error("onCreateOption n\xE3o foi definido")},d=l=>{L?L(l):console.error("onEditOption n\xE3o foi definido")};return B(d2,{control:A.control,name:e,rules:i,defaultValue:o,shouldUnregister:s,render:({field:{value:l,onChange:E,ref:c1}})=>{let m=(l==null?void 0:l.label)||(l==null?void 0:l.value)||l;return a1(n1,{display:"flex",flexDirection:"column",children:[a1("div",{style:{display:"flex"},children:[r&&B(n1,{item:!0,children:B(_,{label:r,required:p})}),w&&B(n1,{item:!0,children:B(Z2,{title:w,placement:"top",children:B("div",{style:{width:"fit-content"},children:B(V1,{icon:X,color:"#757575"})})})})]}),B(X1,{hideAddButton:V,children:B(v2,u(n({fullWidth:!0,onChange:(a,c)=>{E(c),$==null||$(c,A.watch())},onInputChange:(a,c,Z)=>{Z==="input"&&(E(c),setTimeout(()=>{S==null||S(c,A.watch())},0))},options:v,value:l||(x?[]:null),multiple:x,noOptionsText:a1(u2,{sx:{justifyContent:"flex-start",padding:`${e0(6)} ${e0(-16)}`,margin:0},fullWidth:!0,onClick:()=>C(l),variant:"text",startIcon:B(V1,{icon:k1}),children:["Adicionar ",m&&`"${m}"`]}),isOptionEqualToValue:(a,c)=>c?typeof a=="string"&&typeof c=="string"?a===c:typeof a=="object"&&typeof c=="object"?a.value===c.value:typeof a=="object"&&typeof c=="string":!1,renderOption:(a,c)=>typeof c=="object"?c0("li",u(n({},a),{key:c.key||c.value}),a1(n1,{container:!0,direction:"column",children:[B(n1,{item:!0,children:c.label}),c.afterLabel&&B(n1,{item:!0,children:c.afterLabel})]})):c0("li",u(n({},a),{key:c}),c)},F),{renderInput:a=>B(p2,n(u(n({placeholder:b},a),{error:!!R,onChange:E,InputProps:u(n({},a.InputProps),{inputRef:c1,endAdornment:V?void 0:a1("div",{className:"endAdornments",children:[a.InputProps.endAdornment,H&&f2(l)&&!M2(l)?a1("div",{className:"editable",children:[B("div",{className:"divider"}),B("div",{className:"button",onClick:()=>d(l),children:B(V1,{icon:q1,size:"24px",removeMargin:!0})})]}):null,a1("div",{className:"creatable",children:[B("div",{className:"divider"}),B("div",{className:"button",onClick:()=>C(l),children:B(V1,{icon:k1,size:"24px",removeMargin:!0})})]})]})})}),g))}),e)}),B(I,{name:e})]})}})},V2=h2(H2);import{Controller as y2,useFormContext as g2}from"react-hook-form";import{Grid as x2,Checkbox as L2,FormControlLabel as F2}from"@mui/material";import{jsx as m1,jsxs as P2}from"react/jsx-runtime";var b2=L=>{var h=L,{name:e,rules:i,defaultValue:o,shouldUnregister:s,label:r,labelPlacement:p,required:v}=h,H=P(h,["name","rules","defaultValue","shouldUnregister","label","labelPlacement","required"]);let g=g2();if(!g)throw new Error("Para usar o <Checkbox /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");return m1(y2,{control:g.control,name:e,rules:i,defaultValue:o,shouldUnregister:s,render:({field:{value:V,onChange:x}})=>P2(x2,{display:"flex",flexDirection:"column",children:[m1(F2,{control:m1(L2,n({checked:!!V,value:V!=null?V:"",defaultValue:V,onChange:x},H),e),label:m1(_,{label:r,required:v,regular:!0}),labelPlacement:p||"end"}),m1(I,{name:e})]})})},C2=b2;import{Controller as k2,useFormContext as w2}from"react-hook-form";import{Grid as S2,Switch as A2,FormControlLabel as $2}from"@mui/material";import{jsx as v1,jsxs as _2}from"react/jsx-runtime";var T2=H=>{var L=H,{name:e,rules:i,defaultValue:o,shouldUnregister:s,label:r,labelPlacement:p}=L,v=P(L,["name","rules","defaultValue","shouldUnregister","label","labelPlacement"]);let h=w2();if(!h)throw new Error("Para usar o <Switch /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");return v1(k2,{control:h.control,name:e,rules:i,defaultValue:o,shouldUnregister:s,render:({field:{value:g,onChange:V}})=>_2(S2,{display:"flex",flexDirection:"column",children:[v1($2,{control:v1(A2,n({value:g!=null?g:"",checked:g!=null?g:!1,defaultValue:g,onChange:V},v),e),label:v1(_,{label:r}),labelPlacement:p||"end"}),v1(I,{name:e})]})})},D2=T2;import{Grid as E2,Radio as G2,FormControlLabel as I2}from"@mui/material";import{jsx as y1}from"react/jsx-runtime";var B2=s=>{var r=s,{label:e,labelPlacement:i}=r,o=P(r,["label","labelPlacement"]);return y1(E2,{display:"flex",flexDirection:"column",children:y1(I2,{control:y1(G2,n({},o)),label:y1(_,{label:e}),labelPlacement:i||"end"})})},R2=B2;import{Controller as O2,useFormContext as q2}from"react-hook-form";import{Grid as U2,RadioGroup as z2}from"@mui/material";import{jsx as g1,jsxs as N2}from"react/jsx-runtime";var Y2=h=>{var g=h,{name:e,rules:i,defaultValue:o,shouldUnregister:s,label:r,required:p,children:v,orientation:H="row"}=g,L=P(g,["name","rules","defaultValue","shouldUnregister","label","required","children","orientation"]);let V=q2();if(!V)throw new Error("Para usar o <RadioGroup /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");return g1(O2,{control:V.control,name:e,rules:i,defaultValue:o,shouldUnregister:s,render:({field:{value:x,onChange:w}})=>N2(U2,{display:"flex",flexDirection:"column",children:[r&&g1(_,{label:r,required:p}),g1(z2,u(n({value:x||"",onChange:w,name:e},L),{style:{display:"flex",flexDirection:H},children:v}),e),g1(I,{name:e})]})})},j2=Y2;import{Controller as W2,useFormContext as J2}from"react-hook-form";import{Slider as K2}from"@mui/material";import{jsx as i0}from"react/jsx-runtime";var Q2=p=>{var v=p,{name:e,rules:i,defaultValue:o,shouldUnregister:s}=v,r=P(v,["name","rules","defaultValue","shouldUnregister"]);let H=J2();if(!H)throw new Error("Para usar o <Slider /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");return i0(W2,{control:H.control,name:e,rules:i,defaultValue:o,shouldUnregister:s,render:({field:{value:L,onChange:h}})=>i0(K2,n({value:L||(r==null?void 0:r.min)||0,onChange:h,valueLabelDisplay:"auto"},r),e)})},X2=Q2;var r0=I1(D1());import{memo as l3}from"react";import{Controller as a3,useFormContext as o3}from"react-hook-form";import{Grid as r3}from"@s_mart/core";import{composeValidators as t3,date as o0}from"@s_mart/rules";import{TextField as n3}from"@mui/material";import{DatePicker as s3}from"@mui/x-date-pickers/DatePicker";import{AdapterDayjs as h3}from"@mui/x-date-pickers/AdapterDayjs";import{LocalizationProvider as d3}from"@mui/x-date-pickers/LocalizationProvider";import{ptBR as m3}from"@mui/x-date-pickers/locales/ptBR";import{toRem as N}from"@s_mart/utils";import e3 from"@emotion/styled";var c3=e=>{switch(e){case"small":return N(16);default:case"medium":return N(20);case"large":return N(24)}},i3=e=>{switch(e){case"small":return`${N(2)} ${N(8)}`;default:case"medium":return`${N(6)} ${N(8)}`;case"large":return`${N(10)}`}},a0=e3.div`
51
- > div > button {
52
- padding: ${({size:e})=>i3(e)};
53
- border-radius: 0 ${N(4)} ${N(4)} 0;
49
+ ${({hideAddButton:e,theme:l})=>!e&&s2(l)}
50
+ `;import{LIcon as V1,Tooltip as Z2,Button as u2}from"@s_mart/core";import{isObject as f2,isEmpty as M2}from"lodash";import{toRem as e0}from"@s_mart/utils";import{jsx as B,jsxs as a1}from"react/jsx-runtime";import{createElement as c0}from"react";var H2=A=>{var M=A,{name:e,rules:l,defaultValue:o,shouldUnregister:s,label:r,required:Z,options:v,editable:V,onEditOption:x,onCreateOption:d,textFieldProps:L,hideAddButton:y,multiple:b,info:C,onChange:_,onInputChange:$,placeholder:F}=M,g=P(M,["name","rules","defaultValue","shouldUnregister","label","required","options","editable","onEditOption","onCreateOption","textFieldProps","hideAddButton","multiple","info","onChange","onInputChange","placeholder"]);let S=m2();if(!S)throw new Error("Para usar o <Creatable /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let I=U(S.formState.errors,e);console.warn=()=>{};let z=i=>{d?d(i):console.error("onCreateOption n\xE3o foi definido")},h=i=>{x?x(i):console.error("onEditOption n\xE3o foi definido")};return B(d2,{control:S.control,name:e,rules:l,defaultValue:o,shouldUnregister:s,render:({field:{value:i,onChange:w,ref:j}})=>{let m=(i==null?void 0:i.label)||(i==null?void 0:i.value)||i;return a1(n1,{display:"flex",flexDirection:"column",children:[a1("div",{style:{display:"flex"},children:[r&&B(n1,{item:!0,children:B(D,{label:r,required:Z})}),C&&B(n1,{item:!0,children:B(Z2,{title:C,placement:"top",children:B("div",{style:{width:"fit-content"},children:B(V1,{icon:e1,color:"#757575"})})})})]}),B(X1,{hideAddButton:y,children:B(v2,p(n({fullWidth:!0,onChange:(a,c)=>{w(c),_==null||_(c,S.watch())},onInputChange:(a,c,u)=>{u==="input"&&(w(c),setTimeout(()=>{$==null||$(c,S.watch())},0))},options:v,value:i||(b?[]:null),multiple:b,noOptionsText:a1(u2,{sx:{justifyContent:"flex-start",padding:`${e0(6)} ${e0(-16)}`,margin:0},fullWidth:!0,onClick:()=>z(i),variant:"text",startIcon:B(V1,{icon:k1}),children:["Adicionar ",m&&`"${m}"`]}),isOptionEqualToValue:(a,c)=>c?typeof a=="string"&&typeof c=="string"?a===c:typeof a=="object"&&typeof c=="object"?a.value===c.value:typeof a=="object"&&typeof c=="string":!1,renderOption:(a,c)=>typeof c=="object"?c0("li",p(n({},a),{key:c.key||c.value}),a1(n1,{container:!0,direction:"column",children:[B(n1,{item:!0,children:c.label}),c.afterLabel&&B(n1,{item:!0,children:c.afterLabel})]})):c0("li",p(n({},a),{key:c}),c)},g),{renderInput:a=>B(p2,n(p(n({placeholder:F},a),{error:!!I,onChange:w,InputProps:p(n({},a.InputProps),{inputRef:j,endAdornment:y?void 0:a1("div",{className:"endAdornments",children:[a.InputProps.endAdornment,V&&f2(i)&&!M2(i)?a1("div",{className:"editable",children:[B("div",{className:"divider"}),B("div",{className:"button",onClick:()=>h(i),children:B(V1,{icon:q1,size:"24px",removeMargin:!0})})]}):null,a1("div",{className:"creatable",children:[B("div",{className:"divider"}),B("div",{className:"button",onClick:()=>z(i),children:B(V1,{icon:k1,size:"24px",removeMargin:!0})})]})]})})}),L))}),e)}),B(G,{name:e})]})}})},V2=h2(H2);import{Controller as y2,useFormContext as g2}from"react-hook-form";import{Grid as x2,Checkbox as L2,FormControlLabel as F2}from"@mui/material";import{jsx as m1,jsxs as P2}from"react/jsx-runtime";var b2=x=>{var d=x,{name:e,rules:l,defaultValue:o,shouldUnregister:s,label:r,labelPlacement:Z,required:v}=d,V=P(d,["name","rules","defaultValue","shouldUnregister","label","labelPlacement","required"]);let L=g2();if(!L)throw new Error("Para usar o <Checkbox /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");return m1(y2,{control:L.control,name:e,rules:l,defaultValue:o,shouldUnregister:s,render:({field:{value:y,onChange:b}})=>P2(x2,{display:"flex",flexDirection:"column",children:[m1(F2,{control:m1(L2,n({checked:!!y,value:y!=null?y:"",defaultValue:y,onChange:b},V),e),label:m1(D,{label:r,required:v,regular:!0}),labelPlacement:Z||"end"}),m1(G,{name:e})]})})},C2=b2;import{Controller as k2,useFormContext as S2}from"react-hook-form";import{Grid as w2,Switch as $2,FormControlLabel as A2}from"@mui/material";import{jsx as v1,jsxs as _2}from"react/jsx-runtime";var T2=V=>{var x=V,{name:e,rules:l,defaultValue:o,shouldUnregister:s,label:r,labelPlacement:Z}=x,v=P(x,["name","rules","defaultValue","shouldUnregister","label","labelPlacement"]);let d=S2();if(!d)throw new Error("Para usar o <Switch /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");return v1(k2,{control:d.control,name:e,rules:l,defaultValue:o,shouldUnregister:s,render:({field:{value:L,onChange:y}})=>_2(w2,{display:"flex",flexDirection:"column",children:[v1(A2,{control:v1($2,n({value:L!=null?L:"",checked:L!=null?L:!1,defaultValue:L,onChange:y},v),e),label:v1(D,{label:r}),labelPlacement:Z||"end"}),v1(G,{name:e})]})})},D2=T2;import{Grid as E2,Radio as G2,FormControlLabel as B2}from"@mui/material";import{jsx as y1}from"react/jsx-runtime";var I2=s=>{var r=s,{label:e,labelPlacement:l}=r,o=P(r,["label","labelPlacement"]);return y1(E2,{display:"flex",flexDirection:"column",children:y1(B2,{control:y1(G2,n({},o)),label:y1(D,{label:e}),labelPlacement:l||"end"})})},R2=I2;import{Controller as O2,useFormContext as q2}from"react-hook-form";import{Grid as U2,RadioGroup as Y2}from"@mui/material";import{jsx as g1,jsxs as N2}from"react/jsx-runtime";var z2=d=>{var L=d,{name:e,rules:l,defaultValue:o,shouldUnregister:s,label:r,required:Z,children:v,orientation:V="row"}=L,x=P(L,["name","rules","defaultValue","shouldUnregister","label","required","children","orientation"]);let y=q2();if(!y)throw new Error("Para usar o <RadioGroup /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");return g1(O2,{control:y.control,name:e,rules:l,defaultValue:o,shouldUnregister:s,render:({field:{value:b,onChange:C}})=>N2(U2,{display:"flex",flexDirection:"column",children:[r&&g1(D,{label:r,required:Z}),g1(Y2,p(n({value:b||"",onChange:C,name:e},x),{style:{display:"flex",flexDirection:V},children:v}),e),g1(G,{name:e})]})})},j2=z2;import{Controller as W2,useFormContext as J2}from"react-hook-form";import{Slider as K2}from"@mui/material";import{jsx as i0}from"react/jsx-runtime";var Q2=Z=>{var v=Z,{name:e,rules:l,defaultValue:o,shouldUnregister:s}=v,r=P(v,["name","rules","defaultValue","shouldUnregister"]);let V=J2();if(!V)throw new Error("Para usar o <Slider /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");return i0(W2,{control:V.control,name:e,rules:l,defaultValue:o,shouldUnregister:s,render:({field:{value:x,onChange:d}})=>i0(K2,n({value:x||(r==null?void 0:r.min)||0,onChange:d,valueLabelDisplay:"auto"},r),e)})},X2=Q2;var r0=B1(D1());import{memo as a3}from"react";import{Controller as o3,useFormContext as r3}from"react-hook-form";import{Grid as t3}from"@s_mart/core";import{composeValidators as n3,date as o0}from"@s_mart/rules";import{TextField as s3}from"@mui/material";import{DatePicker as h3}from"@mui/x-date-pickers/DatePicker";import{AdapterDayjs as d3}from"@mui/x-date-pickers/AdapterDayjs";import{LocalizationProvider as m3}from"@mui/x-date-pickers/LocalizationProvider";import{ptBR as v3}from"@mui/x-date-pickers/locales/ptBR";import e3 from"@emotion/styled";import{IconButton as c3}from"@mui/material";import{toRem as W}from"@s_mart/utils";var i3=e=>{switch(e){case"small":return W(16);default:case"medium":return W(20);case"large":return W(24)}},l3=e=>{switch(e){case"small":return`${W(2)} ${W(8)}`;default:case"medium":return`${W(6)} ${W(8)}`;case"large":return`${W(10)}`}},a0=e3(c3)`
51
+ margin: 0px;
54
52
 
55
- margin: 0px -13px 0px 0px;
53
+ padding: ${({size:e})=>l3(e)};
54
+ border-radius: 0 ${W(4)} ${W(4)} 0;
56
55
 
57
- svg {
58
- width: ${({size:e})=>c3(e)};
59
- }
56
+ svg {
57
+ width: ${({size:e})=>i3(e)} !important;
60
58
  }
61
- `;import{jsx as p1,jsxs as u3}from"react/jsx-runtime";import{createElement as Z3}from"react";var v3=g=>{var V=g,{rules:e,name:i,defaultValue:o,shouldUnregister:s,datePickerProps:r,label:p,required:v,placeholder:H,disabled:L}=V,h=P(V,["rules","name","defaultValue","shouldUnregister","datePickerProps","label","required","placeholder","disabled"]);let x=o3();if(!x)throw new Error("Para usar o <DataPicker /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let w=z(x.formState.errors,i),$=(r==null?void 0:r.format)||"DD/MM/YYYY",S=e?t3([o0($),e]):o0($);return p1(d3,{dateAdapter:h3,adapterLocale:r0.default,localeText:m3.components.MuiLocalizationProvider.defaultProps.localeText,children:p1(a3,{control:x.control,name:i,rules:S,defaultValue:o,shouldUnregister:s,render:({field:{value:b,onChange:F,ref:T}})=>u3(r3,{display:"flex",flexDirection:"column",children:[p&&p1(_,{label:p,required:v}),Z3(s3,u(n({},r),{key:i,value:b!=null?b:null,format:$,onChange:F,disabled:L,slots:{textField:n3},slotProps:{textField:y=>{var A,R;return u(n(u(n({variant:"outlined"},y),{error:!!w}),h),{inputProps:u(n({},y.inputProps),{placeholder:H||((A=y.inputProps)==null?void 0:A.placeholder)}),InputProps:u(n({},y.InputProps),{inputRef(C){T(C),typeof y.inputRef=="function"&&y.inputRef(C)},endAdornment:p1(a0,{size:h.size,children:(R=y.InputProps)==null?void 0:R.endAdornment})})})}}})),p1(I,{name:i})]})})})},p3=l3(v3);var s0=I1(D1());import{memo as V3}from"react";import{Controller as y3,useFormContext as g3}from"react-hook-form";import{Grid as x3}from"@s_mart/core";import{composeValidators as L3,time as n0}from"@s_mart/rules";import{TextField as F3}from"@mui/material";import{TimePicker as b3}from"@mui/x-date-pickers/TimePicker";import{AdapterDayjs as C3}from"@mui/x-date-pickers/AdapterDayjs";import{LocalizationProvider as P3}from"@mui/x-date-pickers/LocalizationProvider";import{ptBR as k3}from"@mui/x-date-pickers/locales/ptBR";import{toRem as W}from"@s_mart/utils";import f3 from"@emotion/styled";var M3=e=>{switch(e){case"small":return W(16);default:case"medium":return W(20);case"large":return W(24)}},H3=e=>{switch(e){case"small":return`${W(2)} ${W(8)}`;default:case"medium":return`${W(6)} ${W(8)}`;case"large":return`${W(10)}`}},t0=f3.div`
62
- > div > button {
63
- padding: ${({size:e})=>H3(e)};
64
- border-radius: 0 ${W(4)} ${W(4)} 0;
59
+ `;import{jsx as p1,jsxs as f3}from"react/jsx-runtime";import{createElement as u3}from"react";var p3=L=>{var y=L,{rules:e,name:l,defaultValue:o,shouldUnregister:s,datePickerProps:r,label:Z,required:v,placeholder:V,disabled:x}=y,d=P(y,["rules","name","defaultValue","shouldUnregister","datePickerProps","label","required","placeholder","disabled"]);let b=r3();if(!b)throw new Error("Para usar o <DataPicker /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let C=U(b.formState.errors,l),_=(r==null?void 0:r.format)||"DD/MM/YYYY",$=e?n3([o0(_),e]):o0(_);return p1(m3,{dateAdapter:d3,adapterLocale:r0.default,localeText:v3.components.MuiLocalizationProvider.defaultProps.localeText,children:p1(o3,{control:b.control,name:l,rules:$,defaultValue:o,shouldUnregister:s,render:({field:{value:F,onChange:g,ref:A}})=>f3(t3,{display:"flex",flexDirection:"column",children:[Z&&p1(D,{label:Z,required:v}),u3(h3,p(n({},r),{key:l,value:F!=null?F:null,format:_,onChange:g,disabled:x,slots:{textField:s3,openPickerButton:M=>p1(a0,p(n({},M),{size:d.size}))},slotProps:{textField:M=>{var S;return p(n(p(n({variant:"outlined"},M),{error:!!C}),d),{inputProps:p(n({},M.inputProps),{placeholder:V||((S=M.inputProps)==null?void 0:S.placeholder)}),InputProps:p(n({},M.InputProps),{inputRef(I){A(I),typeof M.inputRef=="function"&&M.inputRef(I)}})})}}})),p1(G,{name:l})]})})})},Z3=a3(p3);var s0=B1(D1());import{memo as g3}from"react";import{Controller as x3,useFormContext as L3}from"react-hook-form";import{Grid as F3}from"@s_mart/core";import{composeValidators as b3,time as n0}from"@s_mart/rules";import{TextField as C3}from"@mui/material";import{TimePicker as P3}from"@mui/x-date-pickers/TimePicker";import{AdapterDayjs as k3}from"@mui/x-date-pickers/AdapterDayjs";import{LocalizationProvider as S3}from"@mui/x-date-pickers/LocalizationProvider";import{ptBR as w3}from"@mui/x-date-pickers/locales/ptBR";import M3 from"@emotion/styled";import{IconButton as H3}from"@mui/material";import{toRem as J}from"@s_mart/utils";var V3=e=>{switch(e){case"small":return J(16);default:case"medium":return J(20);case"large":return J(24)}},y3=e=>{switch(e){case"small":return`${J(2)} ${J(8)}`;default:case"medium":return`${J(6)} ${J(8)}`;case"large":return`${J(10)}`}},t0=M3(H3)`
60
+ margin: 0px;
65
61
 
66
- margin: 0px -13px 0px 0px;
62
+ padding: ${({size:e})=>y3(e)};
63
+ border-radius: 0 ${J(4)} ${J(4)} 0;
67
64
 
68
- svg {
69
- width: ${({size:e})=>M3(e)};
70
- }
65
+ svg {
66
+ width: ${({size:e})=>V3(e)} !important;
71
67
  }
72
- `;import{jsx as s1,jsxs as A3}from"react/jsx-runtime";var w3=g=>{var V=g,{rules:e,defaultValue:i,shouldUnregister:o,name:s,required:r,label:p,timePickerProps:v,placeholder:H,disabled:L}=V,h=P(V,["rules","defaultValue","shouldUnregister","name","required","label","timePickerProps","placeholder","disabled"]);let x=g3();if(!x)throw new Error("Para usar o <TimePicker /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let w=z(x.formState.errors,s),$=(v==null?void 0:v.format)||"HH:mm",S=e?L3([n0($),e]):n0($);return s1(P3,{dateAdapter:C3,adapterLocale:s0.default,localeText:k3.components.MuiLocalizationProvider.defaultProps.localeText,children:s1(y3,{control:x.control,name:s,rules:S,defaultValue:i,shouldUnregister:o,render:({field:{value:b,onChange:F,ref:T}})=>A3(x3,{display:"flex",flexDirection:"column",children:[p&&s1(_,{label:p,required:r}),s1(b3,u(n({ampm:!1,format:$,value:b!=null?b:null,onChange:F,disabled:L},v),{slots:{textField:F3},slotProps:{textField:y=>{var A,R;return u(n(u(n({variant:"outlined"},y),{error:!!w}),h),{inputProps:u(n({},y.inputProps),{placeholder:H||((A=y.inputProps)==null?void 0:A.placeholder)}),InputProps:u(n({},y.InputProps),{inputRef(C){T(C),typeof y.inputRef=="function"&&y.inputRef(C)},endAdornment:s1(t0,{size:h.size,children:(R=y.InputProps)==null?void 0:R.endAdornment})})})}}}),s),s1(I,{name:s})]})})})},S3=V3(w3);import{memo as $3}from"react";import{Controller as T3,useFormContext as D3}from"react-hook-form";import{Autocomplete as _3,TextField as E3}from"@mui/material";import{Grid as x1}from"@s_mart/core";import{jsx as o1,jsxs as h0}from"react/jsx-runtime";import{createElement as B3}from"react";var G3=V=>{var x=V,{name:e,defaultValue:i,rules:o,shouldUnregister:s,label:r,required:p,noOptionsText:v,placeholder:H,onInputChange:L,onChange:h}=x,g=P(x,["name","defaultValue","rules","shouldUnregister","label","required","noOptionsText","placeholder","onInputChange","onChange"]);let w=D3();if(!w)throw new Error("Para usar o <Autocomplete /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let $=z(w.formState.errors,e);return console.warn=()=>{},o1(T3,{name:e,control:w.control,defaultValue:i,rules:o,shouldUnregister:s,render:({field:S})=>h0(x1,{display:"flex",flexDirection:"column",children:[r&&o1(_,{label:r,required:p}),o1(_3,u(n({onChange:(b,F)=>{S.onChange(F),h==null||h(F,w.watch())},onInputChange:(b,F,T)=>{T==="input"&&(S.onChange(F),setTimeout(()=>{L==null||L(F,w.watch())},0))},isOptionEqualToValue:(b,F)=>b.value===F.value,renderOption:(b,F)=>B3("li",u(n({},b),{key:F.key||F.value,onClick:T=>{var y;(y=b.onClick)==null||y.call(b,T),S.onChange(F)}}),h0(x1,{container:!0,direction:"column",children:[o1(x1,{item:!0,children:F.label}),F.afterLabel&&o1(x1,{item:!0,children:F.afterLabel})]})),value:S.value||null,noOptionsText:v||"Nenhuma op\xE7\xE3o encontrada"},g),{renderInput:b=>{var F,T,y;return o1(E3,u(n(n({placeholder:H},b),g.textFieldProps),{error:!!$,InputProps:u(n(n({},b.InputProps),(F=g.textFieldProps)==null?void 0:F.InputProps),{inputRef:S.ref,inputProps:n(n({},b.inputProps),(y=(T=g.textFieldProps)==null?void 0:T.InputProps)==null?void 0:y.inputProps)})}))}}),e),o1(I,{name:e})]})})},I3=$3(G3);export{I3 as Autocomplete,C2 as Checkbox,V2 as Creatable,p3 as DatePicker,F0 as Form,C1 as FormProvider,R2 as RadioButton,j2 as RadioGroup,t2 as Searchable,K0 as Select,X2 as Slider,D2 as Switch,B0 as TextField,S3 as TimePicker,P1 as useForm};
68
+ `;import{jsx as s1,jsxs as T3}from"react/jsx-runtime";var $3=L=>{var y=L,{rules:e,defaultValue:l,shouldUnregister:o,name:s,required:r,label:Z,timePickerProps:v,placeholder:V,disabled:x}=y,d=P(y,["rules","defaultValue","shouldUnregister","name","required","label","timePickerProps","placeholder","disabled"]);let b=L3();if(!b)throw new Error("Para usar o <TimePicker /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let C=U(b.formState.errors,s),_=(v==null?void 0:v.format)||"HH:mm",$=e?b3([n0(_),e]):n0(_);return s1(S3,{dateAdapter:k3,adapterLocale:s0.default,localeText:w3.components.MuiLocalizationProvider.defaultProps.localeText,children:s1(x3,{control:b.control,name:s,rules:$,defaultValue:l,shouldUnregister:o,render:({field:{value:F,onChange:g,ref:A}})=>T3(F3,{display:"flex",flexDirection:"column",children:[Z&&s1(D,{label:Z,required:r}),s1(P3,p(n({ampm:!1,format:_,value:F!=null?F:null,onChange:g,disabled:x},v),{slots:{textField:C3,openPickerButton:M=>s1(t0,p(n({},M),{size:d.size}))},slotProps:{textField:M=>{var S;return p(n(p(n({variant:"outlined"},M),{error:!!C}),d),{inputProps:p(n({},M.inputProps),{placeholder:V||((S=M.inputProps)==null?void 0:S.placeholder)}),InputProps:p(n({},M.InputProps),{inputRef(I){A(I),typeof M.inputRef=="function"&&M.inputRef(I)}})})}}}),s),s1(G,{name:s})]})})})},A3=g3($3);import{memo as D3}from"react";import{Controller as _3,useFormContext as E3}from"react-hook-form";import{Autocomplete as G3,TextField as B3}from"@mui/material";import{Grid as x1}from"@s_mart/core";import{jsx as o1,jsxs as h0}from"react/jsx-runtime";import{createElement as O3}from"react";var I3=y=>{var b=y,{name:e,defaultValue:l,rules:o,shouldUnregister:s,label:r,required:Z,noOptionsText:v,placeholder:V,onInputChange:x,onChange:d}=b,L=P(b,["name","defaultValue","rules","shouldUnregister","label","required","noOptionsText","placeholder","onInputChange","onChange"]);let C=E3();if(!C)throw new Error("Para usar o <Autocomplete /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let _=U(C.formState.errors,e);return console.warn=()=>{},o1(_3,{name:e,control:C.control,defaultValue:l,rules:o,shouldUnregister:s,render:({field:$})=>h0(x1,{display:"flex",flexDirection:"column",children:[r&&o1(D,{label:r,required:Z}),o1(G3,p(n({onChange:(F,g)=>{$.onChange(g),d==null||d(g,C.watch())},onInputChange:(F,g,A)=>{A==="input"&&($.onChange(g),setTimeout(()=>{x==null||x(g,C.watch())},0))},isOptionEqualToValue:(F,g)=>F.value===g.value,renderOption:(F,g)=>O3("li",p(n({},F),{key:g.key||g.value,onClick:A=>{var M;(M=F.onClick)==null||M.call(F,A),$.onChange(g)}}),h0(x1,{container:!0,direction:"column",children:[o1(x1,{item:!0,children:g.label}),g.afterLabel&&o1(x1,{item:!0,children:g.afterLabel})]})),value:$.value||null,noOptionsText:v||"Nenhuma op\xE7\xE3o encontrada"},L),{renderInput:F=>{var g,A,M;return o1(B3,p(n(n({placeholder:V},F),L.textFieldProps),{error:!!_,InputProps:p(n(n({},F.InputProps),(g=L.textFieldProps)==null?void 0:g.InputProps),{inputRef:$.ref,inputProps:n(n({},F.inputProps),(M=(A=L.textFieldProps)==null?void 0:A.InputProps)==null?void 0:M.inputProps)})}))}}),e),o1(G,{name:e})]})})},R3=D3(I3);export{R3 as Autocomplete,C2 as Checkbox,V2 as Creatable,Z3 as DatePicker,F0 as Form,C1 as FormProvider,R2 as RadioButton,j2 as RadioGroup,t2 as Searchable,K0 as Select,X2 as Slider,D2 as Switch,I0 as TextField,A3 as TimePicker,P1 as useForm};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@s_mart/form",
3
- "version": "3.3.1",
3
+ "version": "3.3.3",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./dist/index.mjs",
6
6
  "types": "./dist/index.d.ts",