@s_mart/form 4.2.2 → 4.3.0
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 +13 -13
- package/dist/index.js +11 -11
- package/dist/index.mjs +11 -11
- package/package.json +9 -9
package/dist/index.d.ts
CHANGED
|
@@ -56,7 +56,7 @@ declare const useForm: <TValues extends FieldValues>({ disableDefaultValuesUpdat
|
|
|
56
56
|
formState: react_hook_form.FormState<TValues>;
|
|
57
57
|
resetField: react_hook_form.UseFormResetField<TValues>;
|
|
58
58
|
reset: react_hook_form.UseFormReset<TValues>;
|
|
59
|
-
handleSubmit: react_hook_form.UseFormHandleSubmit<TValues>;
|
|
59
|
+
handleSubmit: react_hook_form.UseFormHandleSubmit<TValues, undefined>;
|
|
60
60
|
unregister: react_hook_form.UseFormUnregister<TValues>;
|
|
61
61
|
control: react_hook_form.Control<TValues, any>;
|
|
62
62
|
register: react_hook_form.UseFormRegister<TValues>;
|
|
@@ -460,12 +460,12 @@ type RadioGroupProps = RadioGroupProps$1 & ControllerRadioGroup & {
|
|
|
460
460
|
*/
|
|
461
461
|
orientation?: 'row' | 'column';
|
|
462
462
|
/**
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
463
|
+
* Desabilita o ícone de erro da validação do campo.
|
|
464
|
+
* @default false
|
|
465
|
+
*
|
|
466
|
+
* @example
|
|
467
|
+
* <TextField disableIconError />
|
|
468
|
+
*/
|
|
469
469
|
disableIconError?: boolean;
|
|
470
470
|
};
|
|
471
471
|
|
|
@@ -534,12 +534,12 @@ type TimePickerProps = Omit<UseControllerProps, 'control'> & Pick<TextFieldProps
|
|
|
534
534
|
*/
|
|
535
535
|
disabled?: boolean;
|
|
536
536
|
/**
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
537
|
+
* Desabilita o ícone de erro da validação do campo.
|
|
538
|
+
* @default false
|
|
539
|
+
*
|
|
540
|
+
* @example
|
|
541
|
+
* <TextField disableIconError />
|
|
542
|
+
*/
|
|
543
543
|
disableIconError?: boolean;
|
|
544
544
|
};
|
|
545
545
|
|
package/dist/index.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
"use strict";var y2=Object.create;var L1=Object.defineProperty,b2=Object.defineProperties,x2=Object.getOwnPropertyDescriptor,C2=Object.getOwnPropertyDescriptors,F2=Object.getOwnPropertyNames,w1=Object.getOwnPropertySymbols,A2=Object.getPrototypeOf,X1=Object.prototype.hasOwnProperty,Z0=Object.prototype.propertyIsEnumerable;var m0=(c,a,o)=>a in c?L1(c,a,{enumerable:!0,configurable:!0,writable:!0,value:o}):c[a]=o,r=(c,a)=>{for(var o in a||(a={}))X1.call(a,o)&&m0(c,o,a[o]);if(w1)for(var o of w1(a))Z0.call(a,o)&&m0(c,o,a[o]);return c},m=(c,a)=>b2(c,C2(a));var $=(c,a)=>{var o={};for(var s in c)X1.call(c,s)&&a.indexOf(s)<0&&(o[s]=c[s]);if(c!=null&&w1)for(var s of w1(c))a.indexOf(s)<0&&Z0.call(c,s)&&(o[s]=c[s]);return o};var p0=(c,a)=>()=>(a||c((a={exports:{}}).exports,a),a.exports),k2=(c,a)=>{for(var o in a)L1(c,o,{get:a[o],enumerable:!0})},u0=(c,a,o,s)=>{if(a&&typeof a=="object"||typeof a=="function")for(let e of F2(a))!X1.call(c,e)&&e!==o&&L1(c,e,{get:()=>a[e],enumerable:!(s=x2(a,e))||s.enumerable});return c};var p1=(c,a,o)=>(o=c!=null?y2(A2(c)):{},u0(a||!c||!c.__esModule?L1(o,"default",{value:c,enumerable:!0}):o,c)),S2=c=>u0(L1({},"__esModule",{value:!0}),c);var j0=p0((h0,s0)=>{(function(c,a){typeof h0=="object"&&typeof s0!="undefined"?s0.exports=a():typeof define=="function"&&define.amd?define(a):(c=typeof globalThis!="undefined"?globalThis:c||self).dayjs=a()})(h0,function(){"use strict";var c=1e3,a=6e4,o=36e5,s="millisecond",e="second",g="minute",p="hour",C="day",S="week",u="month",G="quarter",L="year",y="date",F="Invalid Date",A=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,w=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,D={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(t){var l=["th","st","nd","rd"],i=t%100;return"["+t+(l[(i-20)%10]||l[i]||l[0])+"]"}},B=function(t,l,i){var f=String(t);return!f||f.length>=l?t:""+Array(l+1-f.length).join(i)+t},k={s:B,z:function(t){var l=-t.utcOffset(),i=Math.abs(l),f=Math.floor(i/60),n=i%60;return(l<=0?"+":"-")+B(f,2,"0")+":"+B(n,2,"0")},m:function t(l,i){if(l.date()<i.date())return-t(i,l);var f=12*(i.year()-l.year())+(i.month()-l.month()),n=l.clone().add(f,u),V=i-n<0,h=l.clone().add(f+(V?-1:1),u);return+(-(f+(i-n)/(V?n-h:h-n))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(t){return{M:u,y:L,w:S,d:C,D:y,h:p,m:g,s:e,ms:s,Q:G}[t]||String(t||"").toLowerCase().replace(/s$/,"")},u:function(t){return t===void 0}},M="en",H={};H[M]=D;var P=function(t){return t instanceof x},_=function t(l,i,f){var n;if(!l)return M;if(typeof l=="string"){var V=l.toLowerCase();H[V]&&(n=V),i&&(H[V]=i,n=V);var h=l.split("-");if(!n&&h.length>1)return t(h[0])}else{var v=l.name;H[v]=l,n=v}return!f&&n&&(M=n),n||!f&&M},I=function(t,l){if(P(t))return t.clone();var i=typeof l=="object"?l:{};return i.date=t,i.args=arguments,new x(i)},d=k;d.l=_,d.i=P,d.w=function(t,l){return I(t,{locale:l.$L,utc:l.$u,x:l.$x,$offset:l.$offset})};var x=function(){function t(i){this.$L=_(i.locale,null,!0),this.parse(i)}var l=t.prototype;return l.parse=function(i){this.$d=function(f){var n=f.date,V=f.utc;if(n===null)return new Date(NaN);if(d.u(n))return new Date;if(n instanceof Date)return new Date(n);if(typeof n=="string"&&!/Z$/i.test(n)){var h=n.match(A);if(h){var v=h[2]-1||0,R=(h[7]||"0").substring(0,3);return V?new Date(Date.UTC(h[1],v,h[3]||1,h[4]||0,h[5]||0,h[6]||0,R)):new Date(h[1],v,h[3]||1,h[4]||0,h[5]||0,h[6]||0,R)}}return new Date(n)}(i),this.$x=i.x||{},this.init()},l.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()},l.$utils=function(){return d},l.isValid=function(){return this.$d.toString()!==F},l.isSame=function(i,f){var n=I(i);return this.startOf(f)<=n&&n<=this.endOf(f)},l.isAfter=function(i,f){return I(i)<this.startOf(f)},l.isBefore=function(i,f){return this.endOf(f)<I(i)},l.$g=function(i,f,n){return d.u(i)?this[f]:this.set(n,i)},l.unix=function(){return Math.floor(this.valueOf()/1e3)},l.valueOf=function(){return this.$d.getTime()},l.startOf=function(i,f){var n=this,V=!!d.u(f)||f,h=d.p(i),v=function(Z1,N){var o1=d.w(n.$u?Date.UTC(n.$y,N,Z1):new Date(n.$y,N,Z1),n);return V?o1:o1.endOf(C)},R=function(Z1,N){return d.w(n.toDate()[Z1].apply(n.toDate("s"),(V?[0,0,0,0]:[23,59,59,999]).slice(N)),n)},U=this.$W,z=this.$M,r1=this.$D,a1="set"+(this.$u?"UTC":"");switch(h){case L:return V?v(1,0):v(31,11);case u:return V?v(1,z):v(0,z+1);case S:var V1=this.$locale().weekStart||0,g1=(U<V1?U+7:U)-V1;return v(V?r1-g1:r1+(6-g1),z);case C:case y:return R(a1+"Hours",0);case p:return R(a1+"Minutes",1);case g:return R(a1+"Seconds",2);case e:return R(a1+"Milliseconds",3);default:return this.clone()}},l.endOf=function(i){return this.startOf(i,!1)},l.$set=function(i,f){var n,V=d.p(i),h="set"+(this.$u?"UTC":""),v=(n={},n[C]=h+"Date",n[y]=h+"Date",n[u]=h+"Month",n[L]=h+"FullYear",n[p]=h+"Hours",n[g]=h+"Minutes",n[e]=h+"Seconds",n[s]=h+"Milliseconds",n)[V],R=V===C?this.$D+(f-this.$W):f;if(V===u||V===L){var U=this.clone().set(y,1);U.$d[v](R),U.init(),this.$d=U.set(y,Math.min(this.$D,U.daysInMonth())).$d}else v&&this.$d[v](R);return this.init(),this},l.set=function(i,f){return this.clone().$set(i,f)},l.get=function(i){return this[d.p(i)]()},l.add=function(i,f){var n,V=this;i=Number(i);var h=d.p(f),v=function(z){var r1=I(V);return d.w(r1.date(r1.date()+Math.round(z*i)),V)};if(h===u)return this.set(u,this.$M+i);if(h===L)return this.set(L,this.$y+i);if(h===C)return v(1);if(h===S)return v(7);var R=(n={},n[g]=a,n[p]=o,n[e]=c,n)[h]||1,U=this.$d.getTime()+i*R;return d.w(U,this)},l.subtract=function(i,f){return this.add(-1*i,f)},l.format=function(i){var f=this,n=this.$locale();if(!this.isValid())return n.invalidDate||F;var V=i||"YYYY-MM-DDTHH:mm:ssZ",h=d.z(this),v=this.$H,R=this.$m,U=this.$M,z=n.weekdays,r1=n.months,a1=function(N,o1,Q1,S1){return N&&(N[o1]||N(f,V))||Q1[o1].slice(0,S1)},V1=function(N){return d.s(v%12||12,N,"0")},g1=n.meridiem||function(N,o1,Q1){var S1=N<12?"AM":"PM";return Q1?S1.toLowerCase():S1},Z1={YY:String(this.$y).slice(-2),YYYY:this.$y,M:U+1,MM:d.s(U+1,2,"0"),MMM:a1(n.monthsShort,U,r1,3),MMMM:a1(r1,U),D:this.$D,DD:d.s(this.$D,2,"0"),d:String(this.$W),dd:a1(n.weekdaysMin,this.$W,z,2),ddd:a1(n.weekdaysShort,this.$W,z,3),dddd:z[this.$W],H:String(v),HH:d.s(v,2,"0"),h:V1(1),hh:V1(2),a:g1(v,R,!0),A:g1(v,R,!1),m:String(R),mm:d.s(R,2,"0"),s:String(this.$s),ss:d.s(this.$s,2,"0"),SSS:d.s(this.$ms,3,"0"),Z:h};return V.replace(w,function(N,o1){return o1||Z1[N]||h.replace(":","")})},l.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},l.diff=function(i,f,n){var V,h=d.p(f),v=I(i),R=(v.utcOffset()-this.utcOffset())*a,U=this-v,z=d.m(this,v);return z=(V={},V[L]=z/12,V[u]=z,V[G]=z/3,V[S]=(U-R)/6048e5,V[C]=(U-R)/864e5,V[p]=U/o,V[g]=U/a,V[e]=U/c,V)[h]||U,n?z:d.a(z)},l.daysInMonth=function(){return this.endOf(u).$D},l.$locale=function(){return H[this.$L]},l.locale=function(i,f){if(!i)return this.$L;var n=this.clone(),V=_(i,f,!0);return V&&(n.$L=V),n},l.clone=function(){return d.w(this.$d,this)},l.toDate=function(){return new Date(this.valueOf())},l.toJSON=function(){return this.isValid()?this.toISOString():null},l.toISOString=function(){return this.$d.toISOString()},l.toString=function(){return this.$d.toUTCString()},t}(),Z=x.prototype;return I.prototype=Z,[["$ms",s],["$s",e],["$m",g],["$H",p],["$W",C],["$M",u],["$y",L],["$D",y]].forEach(function(t){Z[t[1]]=function(l){return this.$g(l,t[0],t[1])}}),I.extend=function(t,l){return t.$i||(t(l,x,I),t.$i=!0),I},I.locale=_,I.isDayjs=P,I.unix=function(t){return I(1e3*t)},I.en=H[M],I.Ls=H,I.p={},I})});var d0=p0((t0,v0)=>{(function(c,a){typeof t0=="object"&&typeof v0!="undefined"?v0.exports=a(j0()):typeof define=="function"&&define.amd?define(["dayjs"],a):(c=typeof globalThis!="undefined"?globalThis:c||self).dayjs_locale_pt_br=a(c.dayjs)})(t0,function(c){"use strict";function a(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var o=a(c),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(e){return e+"\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 K2={};k2(K2,{Autocomplete:()=>g2,Checkbox:()=>R0,Creatable:()=>G0,DatePicker:()=>r2,Form:()=>g0,FormProvider:()=>P1,RadioButton:()=>O0,RadioGroup:()=>q0,Searchable:()=>$0,Select:()=>T0,Slider:()=>Y0,Switch:()=>U0,TextField:()=>S0,TimePicker:()=>H2,useForm:()=>T1});module.exports=S2(K2);var M0=require("react-hook-form");var c0=require("react/jsx-runtime");function w2(e){var g=e,{children:c,style:a,onSubmit:o}=g,s=$(g,["children","style","onSubmit"]);return(0,c0.jsx)(M0.FormProvider,m(r({},s),{children:(0,c0.jsx)("form",{onSubmit:p=>{p.preventDefault(),p.stopPropagation(),o(p)},style:a,children:c})}))}var P1=w2;var H0=require("react"),f0=require("react-hook-form"),V0=require("@hookform/resolvers/zod");var P2=s=>{var e=s,{disableDefaultValuesUpdate:c,onSubmit:a}=e,o=$(e,["disableDefaultValuesUpdate","onSubmit"]);let g=(0,f0.useForm)(m(r({},o),{resolver:o.schema&&(0,V0.zodResolver)(o.schema)}));return(0,H0.useEffect)(()=>{c||g.reset(o.defaultValues)},[o.defaultValues,g.reset]),m(r({},g),{onSubmit:g.handleSubmit(p=>a(p,g))})},T1=P2;var L0=require("react/jsx-runtime");function T2(s){var e=s,{children:c,style:a}=e,o=$(e,["children","style"]);let g=T1(o);return(0,L0.jsx)(P1,m(r({},g),{style:a,children:typeof c=="function"?c(g):c}))}var g0=T2;var D1=require("react"),$1=require("react-hook-form"),h1=require("@mui/material");var y0={description:"M39 23.1a17 17 0 0 0-15-10c-6.5.1-12.4 4-15.2 10V25a17 17 0 0 0 15 10A17 17 0 0 0 39 25c.5-.7.5-1.3.2-1.8Zm-15 9a8 8 0 0 1-7.6-8.5c.2-4.2 3.5-7.8 7.6-7.8a8 8 0 0 1 7.6 8.4c-.1 4.3-3.5 7.9-7.6 7.9Zm0-13.5-1.3.1c.7 1.1.6 2.6-.3 3.7-1 .9-2.3.9-3.4.1-.4 2.2.3 4.7 2.1 6a4.9 4.9 0 0 0 6-.2c1.6-1.4 2.4-4 1.6-6.1a4.9 4.9 0 0 0-4.7-3.6Z",id:"line-eye-solid"},b0={description:"M24 31.7c-4 0-7.4-3.1-7.7-7.1l-5.6-4.4c-.8 1-1.4 2-2 3a1.7 1.7 0 0 0 0 1.6 17.2 17.2 0 0 0 19.5 9l-2.8-2.2-1.4.1ZM40.9 35l-6-4.6c1.8-1.5 3.3-3.4 4.4-5.5a1.7 1.7 0 0 0 0-1.6c-3-5.7-8.7-9.5-15.3-9.5-2.8 0-5.5.7-8 2l-6.8-5.3a.9.9 0 0 0-1.2.2L7 12a.9.9 0 0 0 .1 1.2l31.7 24.5a.9.9 0 0 0 1.2-.2l1-1.3a.9.9 0 0 0-.1-1.2Zm-10-7.7-2-1.6a5 5 0 0 0-6.3-6.6 2.5 2.5 0 0 1 .4 2l-3.9-3a7.7 7.7 0 0 1 10.4.5 7.7 7.7 0 0 1 1.5 8.7Z",id:"line-eye-slash-solid"};var n1={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 x0={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 l0={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 u1=p1(require("@s_mart/masks"));var a0=require("@mui/material"),C0=require("@s_mart/utils"),y1=require("react/jsx-runtime"),O=({label:c,required:a,regular:o})=>(0,y1.jsxs)("span",{style:{display:"flex",alignItems:"center",gap:(0,C0.toRem)(2)},children:[(0,y1.jsx)(a0.Typography,{variant:"caption",fontWeight:o?400:700,style:{display:"flex",alignItems:"center"},children:c}),a&&(0,y1.jsx)(a0.Typography,{variant:"caption",fontWeight:900,color:"error",children:"*"})]});var F0=require("react-hook-form"),A0=require("@s_mart/core");var Y=(c,a)=>a.replace(/[[\]]/g,"").split(".").reduce((s,e)=>s==null?void 0:s[e],c);var k0=require("react/jsx-runtime"),q=({name:c,disableIcon:a})=>{var e;let o=(0,F0.useFormContext)(),s=Y((e=o==null?void 0:o.formState)==null?void 0:e.errors,c);return s?(0,k0.jsx)(A0.Indicator,{severity:"error",icon:a?!1:void 0,children:s==null?void 0:s.message}):null};var b1=require("@s_mart/core");var j=require("react/jsx-runtime"),D2=w=>{var D=w,{name:c,rules:a,defaultValue:o,shouldUnregister:s,label:e,required:g,mask:p,variant:C="outlined",info:S,parse:u,inputMode:G,format:L,onInputChange:y,disableIconError:F}=D,A=$(D,["name","rules","defaultValue","shouldUnregister","label","required","mask","variant","info","parse","inputMode","format","onInputChange","disableIconError"]);let B=(0,$1.useFormContext)();if(!B)throw new Error("Para usar o <TextField /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let[k,M]=(0,D1.useState)(!1),H=d=>{var Z;let x=d;return L&&(x=L(d)),p?(Z=u1==null?void 0:u1[p])==null?void 0:Z.format(x):x},P=d=>{var Z;let x=d;return u&&(x=u(d)),p?(Z=u1==null?void 0:u1[p])==null?void 0:Z.parse(x):x},_=d=>{if(!d||p!=="porcentagem"&&p!=="porcentagem0")return;d==null||d.stopPropagation();let x=(d==null?void 0:d.target).value;if(x){let Z=String(x);if(Z.length>0){let t=Z.indexOf("%");t>-1&&(d.currentTarget.selectionEnd=t)}}},I=Y(B.formState.errors,c);return(0,j.jsx)($1.Controller,{control:B.control,name:c,rules:a,defaultValue:o,shouldUnregister:s,render:({field:{value:d,onChange:x,ref:Z}})=>(0,j.jsxs)(h1.Grid,{display:"flex",flexDirection:"column",children:[(0,j.jsxs)("div",{style:{display:"flex"},children:[e&&(0,j.jsx)(h1.Grid,{item:!0,children:(0,j.jsx)(O,{label:e,required:g})}),S&&(0,j.jsx)(h1.Grid,{item:!0,children:(0,j.jsx)(b1.Tooltip,{title:S,placement:"top",children:(0,j.jsx)("div",{style:{width:"fit-content"},children:(0,j.jsx)(b1.LIcon,{icon:n1,color:"#757575"})})})})]}),(0,j.jsx)(h1.TextField,m(r({variant:C,defaultValue:o,value:H(d||(d!=0?"":d)),onChange:t=>{var i;let l=P((i=t==null?void 0:t.target)==null?void 0:i.value);x(l),y==null||y(l,B.getValues())},error:!!I},A),{type:A.type==="password"?k?"text":"password":A.type,autoComplete:A.autoComplete||"off",inputProps:r({inputMode:G},A.inputProps),InputProps:r({onKeyDown:_,inputRef:Z,endAdornment:A.type==="password"&&(0,j.jsx)(h1.InputAdornment,{position:"start",onClick:()=>M(!k),style:{cursor:"pointer"},children:(0,j.jsx)(b1.LIcon,{icon:k?y0:b0,size:"24px",removeMargin:!0})})},A.InputProps)}),c),(0,j.jsx)(q,{name:c,disableIcon:F})]})})},S0=(0,D1.memo)(D2);var _1=require("react"),B1=require("react-hook-form"),i1=require("@s_mart/core");var w0={description:"m27.4 24.4 7-7c.4-.4.4-1 0-1.5l-1.6-1.6a1 1 0 0 0-1.5 0l-7 7-7-7a1 1 0 0 0-1.4 0l-1.6 1.6a1 1 0 0 0 0 1.5l7 7-7 7a1 1 0 0 0 0 1.4l1.6 1.6c.4.4 1 .4 1.5 0l7-7 7 7c.3.4 1 .4 1.4 0l1.6-1.6c.4-.4.4-1 0-1.5l-7-7Z",id:"line-times-regular"};var P0=require("@s_mart/tokens"),W=require("@mui/material");var E=require("react/jsx-runtime"),$2=D=>{var B=D,{name:c,rules:a,defaultValue:o,shouldUnregister:s,label:e,required:g,options:p,placeholder:C,clearable:S,disableOnChangeForm:u=!1,multiple:G,info:L,footer:y,onChange:F,disableIconError:A}=B,w=$(B,["name","rules","defaultValue","shouldUnregister","label","required","options","placeholder","clearable","disableOnChangeForm","multiple","info","footer","onChange","disableIconError"]);let k=(0,B1.useFormContext)(),{palette:M}=(0,W.useTheme)(),[H,P]=(0,_1.useState)(!1);if(!k)throw new Error("Para usar o <Select /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let _=Y(k.formState.errors,c);return console.warn=()=>{},(0,E.jsx)(B1.Controller,{control:k.control,name:c,rules:a,defaultValue:o,shouldUnregister:s,render:({field:{value:I,onChange:d,ref:x}})=>(0,E.jsxs)(W.Grid,{display:"flex",flexDirection:"column",children:[(0,E.jsxs)("div",{style:{display:"flex"},children:[e&&(0,E.jsx)(W.Grid,{item:!0,children:(0,E.jsx)(O,{label:e,required:g})}),L&&(0,E.jsx)(W.Grid,{item:!0,children:(0,E.jsx)(i1.Tooltip,{title:L,placement:"top",children:(0,E.jsx)("div",{style:{width:"fit-content"},children:(0,E.jsx)(i1.LIcon,{icon:n1,color:"#757575"})})})})]}),(0,E.jsxs)(W.Select,m(r({open:H,onOpen:()=>P(!0),onClose:()=>P(!1),displayEmpty:!!C,variant:"outlined",autoComplete:"off",value:I?I||"":G?[]:"",renderValue:Z=>{if(Z.label)return Z.label;if(C)return(0,E.jsx)("p",{style:{color:M.grey[400]},children:C})},multiple:G,onChange:Z=>{!u&&d(Z.target.value),F&&F(Z.target.value,k.getValues())},error:!!_,size:w.size||"medium",inputRef:x},w),{endAdornment:(0,E.jsxs)(E.Fragment,{children:[w.endAdornment,!!(S&&I)&&(0,E.jsx)(i1.IconButton,{variant:"text",color:"neutral",size:"small",sx:{borderRadius:"50%",position:"absolute",right:"2rem"},style:{padding:0},"aria-label":"Clear",title:"Clear",onClick:()=>{!u&&d(null),F&&F(null,k.getValues())},children:(0,E.jsx)(i1.LIcon,{icon:w0,color:P0.colorPalette.neutral[100],size:"25px",removeMargin:!0})})]}),children:[C&&(0,E.jsx)(W.MenuItem,{disabled:!0,value:"",children:(0,E.jsx)("p",{style:{color:M.grey[400]},children:C})}),p==null?void 0:p.map((Z,t)=>(0,E.jsx)(W.MenuItem,{value:Z,children:(0,E.jsxs)(W.Grid,{container:!0,direction:"column",children:[(0,E.jsx)(W.Grid,{item:!0,children:Z.label}),Z.afterLabel&&(0,E.jsx)(W.Grid,{item:!0,children:Z.afterLabel})]})},t)),y&&[(0,E.jsx)(W.Grid,{px:2,py:1,children:(0,E.jsx)(i1.Divider,{})},"footer-divider"),(0,E.jsx)("div",{children:y({closeSelect:()=>P(!1)})},"footer-content")]]}),c),(0,E.jsx)(q,{name:c,disableIcon:A})]})})},T0=(0,_1.memo)($2);var I1=require("react"),E1=require("react-hook-form"),J=require("@mui/material"),d1=require("@s_mart/core");var D0=require("@s_mart/tokens");var T=require("react/jsx-runtime"),i0=require("react"),_2=B=>{var k=B,{name:c,rules:a,defaultValue:o,shouldUnregister:s,label:e,required:g,options:p,textFieldProps:C,noOptionsText:S,footer:u,multiple:G,info:L,placeholder:y,onChange:F,onInputChange:A,disableIconError:w}=k,D=$(k,["name","rules","defaultValue","shouldUnregister","label","required","options","textFieldProps","noOptionsText","footer","multiple","info","placeholder","onChange","onInputChange","disableIconError"]);let M=(0,E1.useFormContext)();if(!M)throw new Error("Para usar o <Searchable /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let H=Y(M.formState.errors,c);return console.warn=()=>{},(0,T.jsx)(E1.Controller,{control:M.control,name:c,rules:a,defaultValue:o,shouldUnregister:s,render:({field:{onChange:P,value:_,ref:I}})=>{var d;return(0,T.jsxs)(J.Grid,{display:"flex",flexDirection:"column",children:[(0,T.jsxs)("div",{style:{display:"flex"},children:[e&&(0,T.jsx)(J.Grid,{item:!0,children:(0,T.jsx)(O,{label:e,required:g})}),L&&(0,T.jsx)(J.Grid,{item:!0,children:(0,T.jsx)(d1.Tooltip,{title:L,placement:"top",children:(0,T.jsx)("div",{style:{width:"fit-content"},children:(0,T.jsx)(d1.LIcon,{icon:n1,color:"#757575"})})})})]}),(0,T.jsx)(J.Autocomplete,m(r({onChange:(x,Z)=>{P(Z),F==null||F(Z,M.getValues())},onInputChange:(x,Z,t)=>{t==="input"&&setTimeout(()=>{A==null||A(Z,M.getValues())},0)},slotProps:m(r({},D.slotProps||{}),{paper:m(r({},(D.slotProps||{}).paper||{}),{sx:r({border:`1px solid ${D0.colorPalette.neutral[30]}`,boxShadow:"0px 2px 4px rgba(0, 0, 0, 0.15)"},((d=(D.slotProps||{}).paper)==null?void 0:d.sx)||{})})}),value:_||(G?[]:null),options:p,multiple:G,noOptionsText:(0,T.jsxs)(T.Fragment,{children:[S||"Nenhum resultado encontrado",u?(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(J.Grid,{py:1,children:(0,T.jsx)(d1.Divider,{})}),u]}):null]}),isOptionEqualToValue:(x,Z)=>typeof x=="string"&&typeof Z=="string"?x===Z:typeof x=="object"&&typeof Z=="object"?typeof x.value=="object"&&typeof Z.value=="object"&&x.key!==void 0&&Z.key!==void 0?x.key===Z.key:x.value===Z.value:!1,renderOption:(x,Z)=>typeof Z=="object"?(0,i0.createElement)("li",m(r({},x),{key:Z.key||Z.value}),(0,T.jsxs)(J.Grid,{container:!0,direction:"column",children:[(0,T.jsx)(J.Grid,{item:!0,children:Z.label}),Z.afterLabel&&(0,T.jsx)(J.Grid,{item:!0,children:Z.afterLabel})]})):(0,i0.createElement)("li",m(r({},x),{key:Z}),Z),ListboxComponent:(0,I1.forwardRef)(function(Z,t){return(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)("ul",m(r({},Z),{ref:t})),!!u&&(0,T.jsx)("div",m(r({},Z),{children:(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(J.Grid,{px:2,py:1,children:(0,T.jsx)(d1.Divider,{})}),u]})}),"searchable-footer")]})})},D),{renderInput:x=>(0,T.jsx)(J.TextField,m(r(r({error:!!H,placeholder:y},x),C),{inputRef:I}))}),c),(0,T.jsx)(q,{name:c,disableIcon:w})]})}})},$0=(0,I1.memo)(_2);var G1=require("react"),R1=require("react-hook-form"),U1=require("lodash"),K=require("@mui/material"),Q=require("@s_mart/core"),E0=require("@s_mart/tokens");var r0=require("@s_mart/utils");var x1=require("@s_mart/utils"),_0=p1(require("@emotion/styled")),e0=require("@emotion/react"),B0=e0.css`
|
|
1
|
+
"use strict";var y2=Object.create;var y1=Object.defineProperty,b2=Object.defineProperties,x2=Object.getOwnPropertyDescriptor,C2=Object.getOwnPropertyDescriptors,F2=Object.getOwnPropertyNames,P1=Object.getOwnPropertySymbols,k2=Object.getPrototypeOf,X1=Object.prototype.hasOwnProperty,Z0=Object.prototype.propertyIsEnumerable;var m0=(c,a,o)=>a in c?y1(c,a,{enumerable:!0,configurable:!0,writable:!0,value:o}):c[a]=o,r=(c,a)=>{for(var o in a||(a={}))X1.call(a,o)&&m0(c,o,a[o]);if(P1)for(var o of P1(a))Z0.call(a,o)&&m0(c,o,a[o]);return c},Z=(c,a)=>b2(c,C2(a));var $=(c,a)=>{var o={};for(var s in c)X1.call(c,s)&&a.indexOf(s)<0&&(o[s]=c[s]);if(c!=null&&P1)for(var s of P1(c))a.indexOf(s)<0&&Z0.call(c,s)&&(o[s]=c[s]);return o};var p0=(c,a)=>()=>(a||c((a={exports:{}}).exports,a),a.exports),A2=(c,a)=>{for(var o in a)y1(c,o,{get:a[o],enumerable:!0})},u0=(c,a,o,s)=>{if(a&&typeof a=="object"||typeof a=="function")for(let i of F2(a))!X1.call(c,i)&&i!==o&&y1(c,i,{get:()=>a[i],enumerable:!(s=x2(a,i))||s.enumerable});return c};var u1=(c,a,o)=>(o=c!=null?y2(k2(c)):{},u0(a||!c||!c.__esModule?y1(o,"default",{value:c,enumerable:!0}):o,c)),S2=c=>u0(y1({},"__esModule",{value:!0}),c);var j0=p0((h0,s0)=>{(function(c,a){typeof h0=="object"&&typeof s0!="undefined"?s0.exports=a():typeof define=="function"&&define.amd?define(a):(c=typeof globalThis!="undefined"?globalThis:c||self).dayjs=a()})(h0,function(){"use strict";var c=1e3,a=6e4,o=36e5,s="millisecond",i="second",g="minute",u="hour",C="day",S="week",M="month",G="quarter",L="year",y="date",F="Invalid Date",k=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,w=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,D={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(t){var l=["th","st","nd","rd"],e=t%100;return"["+t+(l[(e-20)%10]||l[e]||l[0])+"]"}},B=function(t,l,e){var d=String(t);return!d||d.length>=l?t:""+Array(l+1-d.length).join(e)+t},A={s:B,z:function(t){var l=-t.utcOffset(),e=Math.abs(l),d=Math.floor(e/60),n=e%60;return(l<=0?"+":"-")+B(d,2,"0")+":"+B(n,2,"0")},m:function t(l,e){if(l.date()<e.date())return-t(e,l);var d=12*(e.year()-l.year())+(e.month()-l.month()),n=l.clone().add(d,M),V=e-n<0,h=l.clone().add(d+(V?-1:1),M);return+(-(d+(e-n)/(V?n-h:h-n))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(t){return{M,y:L,w:S,d:C,D:y,h:u,m:g,s:i,ms:s,Q:G}[t]||String(t||"").toLowerCase().replace(/s$/,"")},u:function(t){return t===void 0}},H="en",f={};f[H]=D;var P=function(t){return t instanceof x},_=function t(l,e,d){var n;if(!l)return H;if(typeof l=="string"){var V=l.toLowerCase();f[V]&&(n=V),e&&(f[V]=e,n=V);var h=l.split("-");if(!n&&h.length>1)return t(h[0])}else{var m=l.name;f[m]=l,n=m}return!d&&n&&(H=n),n||!d&&H},I=function(t,l){if(P(t))return t.clone();var e=typeof l=="object"?l:{};return e.date=t,e.args=arguments,new x(e)},v=A;v.l=_,v.i=P,v.w=function(t,l){return I(t,{locale:l.$L,utc:l.$u,x:l.$x,$offset:l.$offset})};var x=function(){function t(e){this.$L=_(e.locale,null,!0),this.parse(e)}var l=t.prototype;return l.parse=function(e){this.$d=function(d){var n=d.date,V=d.utc;if(n===null)return new Date(NaN);if(v.u(n))return new Date;if(n instanceof Date)return new Date(n);if(typeof n=="string"&&!/Z$/i.test(n)){var h=n.match(k);if(h){var m=h[2]-1||0,R=(h[7]||"0").substring(0,3);return V?new Date(Date.UTC(h[1],m,h[3]||1,h[4]||0,h[5]||0,h[6]||0,R)):new Date(h[1],m,h[3]||1,h[4]||0,h[5]||0,h[6]||0,R)}}return new Date(n)}(e),this.$x=e.x||{},this.init()},l.init=function(){var e=this.$d;this.$y=e.getFullYear(),this.$M=e.getMonth(),this.$D=e.getDate(),this.$W=e.getDay(),this.$H=e.getHours(),this.$m=e.getMinutes(),this.$s=e.getSeconds(),this.$ms=e.getMilliseconds()},l.$utils=function(){return v},l.isValid=function(){return this.$d.toString()!==F},l.isSame=function(e,d){var n=I(e);return this.startOf(d)<=n&&n<=this.endOf(d)},l.isAfter=function(e,d){return I(e)<this.startOf(d)},l.isBefore=function(e,d){return this.endOf(d)<I(e)},l.$g=function(e,d,n){return v.u(e)?this[d]:this.set(n,e)},l.unix=function(){return Math.floor(this.valueOf()/1e3)},l.valueOf=function(){return this.$d.getTime()},l.startOf=function(e,d){var n=this,V=!!v.u(d)||d,h=v.p(e),m=function(d1,N){var r1=v.w(n.$u?Date.UTC(n.$y,N,d1):new Date(n.$y,N,d1),n);return V?r1:r1.endOf(C)},R=function(d1,N){return v.w(n.toDate()[d1].apply(n.toDate("s"),(V?[0,0,0,0]:[23,59,59,999]).slice(N)),n)},q=this.$W,z=this.$M,K=this.$D,p1="set"+(this.$u?"UTC":"");switch(h){case L:return V?m(1,0):m(31,11);case M:return V?m(1,z):m(0,z+1);case S:var v1=this.$locale().weekStart||0,g1=(q<v1?q+7:q)-v1;return m(V?K-g1:K+(6-g1),z);case C:case y:return R(p1+"Hours",0);case u:return R(p1+"Minutes",1);case g:return R(p1+"Seconds",2);case i:return R(p1+"Milliseconds",3);default:return this.clone()}},l.endOf=function(e){return this.startOf(e,!1)},l.$set=function(e,d){var n,V=v.p(e),h="set"+(this.$u?"UTC":""),m=(n={},n[C]=h+"Date",n[y]=h+"Date",n[M]=h+"Month",n[L]=h+"FullYear",n[u]=h+"Hours",n[g]=h+"Minutes",n[i]=h+"Seconds",n[s]=h+"Milliseconds",n)[V],R=V===C?this.$D+(d-this.$W):d;if(V===M||V===L){var q=this.clone().set(y,1);q.$d[m](R),q.init(),this.$d=q.set(y,Math.min(this.$D,q.daysInMonth())).$d}else m&&this.$d[m](R);return this.init(),this},l.set=function(e,d){return this.clone().$set(e,d)},l.get=function(e){return this[v.p(e)]()},l.add=function(e,d){var n,V=this;e=Number(e);var h=v.p(d),m=function(z){var K=I(V);return v.w(K.date(K.date()+Math.round(z*e)),V)};if(h===M)return this.set(M,this.$M+e);if(h===L)return this.set(L,this.$y+e);if(h===C)return m(1);if(h===S)return m(7);var R=(n={},n[g]=a,n[u]=o,n[i]=c,n)[h]||1,q=this.$d.getTime()+e*R;return v.w(q,this)},l.subtract=function(e,d){return this.add(-1*e,d)},l.format=function(e){var d=this,n=this.$locale();if(!this.isValid())return n.invalidDate||F;var V=e||"YYYY-MM-DDTHH:mm:ssZ",h=v.z(this),m=this.$H,R=this.$m,q=this.$M,z=n.weekdays,K=n.months,p1=n.meridiem,v1=function(N,r1,L1,w1){return N&&(N[r1]||N(d,V))||L1[r1].slice(0,w1)},g1=function(N){return v.s(m%12||12,N,"0")},d1=p1||function(N,r1,L1){var w1=N<12?"AM":"PM";return L1?w1.toLowerCase():w1};return V.replace(w,function(N,r1){return r1||function(L1){switch(L1){case"YY":return String(d.$y).slice(-2);case"YYYY":return v.s(d.$y,4,"0");case"M":return q+1;case"MM":return v.s(q+1,2,"0");case"MMM":return v1(n.monthsShort,q,K,3);case"MMMM":return v1(K,q);case"D":return d.$D;case"DD":return v.s(d.$D,2,"0");case"d":return String(d.$W);case"dd":return v1(n.weekdaysMin,d.$W,z,2);case"ddd":return v1(n.weekdaysShort,d.$W,z,3);case"dddd":return z[d.$W];case"H":return String(m);case"HH":return v.s(m,2,"0");case"h":return g1(1);case"hh":return g1(2);case"a":return d1(m,R,!0);case"A":return d1(m,R,!1);case"m":return String(R);case"mm":return v.s(R,2,"0");case"s":return String(d.$s);case"ss":return v.s(d.$s,2,"0");case"SSS":return v.s(d.$ms,3,"0");case"Z":return h}return null}(N)||h.replace(":","")})},l.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},l.diff=function(e,d,n){var V,h=this,m=v.p(d),R=I(e),q=(R.utcOffset()-this.utcOffset())*a,z=this-R,K=function(){return v.m(h,R)};switch(m){case L:V=K()/12;break;case M:V=K();break;case G:V=K()/3;break;case S:V=(z-q)/6048e5;break;case C:V=(z-q)/864e5;break;case u:V=z/o;break;case g:V=z/a;break;case i:V=z/c;break;default:V=z}return n?V:v.a(V)},l.daysInMonth=function(){return this.endOf(M).$D},l.$locale=function(){return f[this.$L]},l.locale=function(e,d){if(!e)return this.$L;var n=this.clone(),V=_(e,d,!0);return V&&(n.$L=V),n},l.clone=function(){return v.w(this.$d,this)},l.toDate=function(){return new Date(this.valueOf())},l.toJSON=function(){return this.isValid()?this.toISOString():null},l.toISOString=function(){return this.$d.toISOString()},l.toString=function(){return this.$d.toUTCString()},t}(),p=x.prototype;return I.prototype=p,[["$ms",s],["$s",i],["$m",g],["$H",u],["$W",C],["$M",M],["$y",L],["$D",y]].forEach(function(t){p[t[1]]=function(l){return this.$g(l,t[0],t[1])}}),I.extend=function(t,l){return t.$i||(t(l,x,I),t.$i=!0),I},I.locale=_,I.isDayjs=P,I.unix=function(t){return I(1e3*t)},I.en=f[H],I.Ls=f,I.p={},I})});var d0=p0((t0,v0)=>{(function(c,a){typeof t0=="object"&&typeof v0!="undefined"?v0.exports=a(j0()):typeof define=="function"&&define.amd?define(["dayjs"],a):(c=typeof globalThis!="undefined"?globalThis:c||self).dayjs_locale_pt_br=a(c.dayjs)})(t0,function(c){"use strict";function a(i){return i&&typeof i=="object"&&"default"in i?i:{default:i}}var o=a(c),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(i){return i+"\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 K2={};A2(K2,{Autocomplete:()=>g2,Checkbox:()=>R0,Creatable:()=>G0,DatePicker:()=>r2,Form:()=>g0,FormProvider:()=>T1,RadioButton:()=>O0,RadioGroup:()=>q0,Searchable:()=>$0,Select:()=>T0,Slider:()=>Y0,Switch:()=>U0,TextField:()=>S0,TimePicker:()=>H2,useForm:()=>D1});module.exports=S2(K2);var M0=require("react-hook-form");var c0=require("react/jsx-runtime");function w2(i){var g=i,{children:c,style:a,onSubmit:o}=g,s=$(g,["children","style","onSubmit"]);return(0,c0.jsx)(M0.FormProvider,Z(r({},s),{children:(0,c0.jsx)("form",{onSubmit:u=>{u.preventDefault(),u.stopPropagation(),o(u)},style:a,children:c})}))}var T1=w2;var H0=require("react"),f0=require("react-hook-form"),V0=require("@hookform/resolvers/zod");var P2=s=>{var i=s,{disableDefaultValuesUpdate:c,onSubmit:a}=i,o=$(i,["disableDefaultValuesUpdate","onSubmit"]);let g=(0,f0.useForm)(Z(r({},o),{resolver:o.schema&&(0,V0.zodResolver)(o.schema)}));return(0,H0.useEffect)(()=>{c||g.reset(o.defaultValues)},[o.defaultValues,g.reset]),Z(r({},g),{onSubmit:g.handleSubmit(u=>a(u,g))})},D1=P2;var L0=require("react/jsx-runtime");function T2(s){var i=s,{children:c,style:a}=i,o=$(i,["children","style"]);let g=D1(o);return(0,L0.jsx)(T1,Z(r({},g),{style:a,children:typeof c=="function"?c(g):c}))}var g0=T2;var $1=require("react"),_1=require("react-hook-form"),n1=require("@mui/material");var y0={description:"M39 23.1a17 17 0 0 0-15-10c-6.5.1-12.4 4-15.2 10V25a17 17 0 0 0 15 10A17 17 0 0 0 39 25c.5-.7.5-1.3.2-1.8Zm-15 9a8 8 0 0 1-7.6-8.5c.2-4.2 3.5-7.8 7.6-7.8a8 8 0 0 1 7.6 8.4c-.1 4.3-3.5 7.9-7.6 7.9Zm0-13.5-1.3.1c.7 1.1.6 2.6-.3 3.7-1 .9-2.3.9-3.4.1-.4 2.2.3 4.7 2.1 6a4.9 4.9 0 0 0 6-.2c1.6-1.4 2.4-4 1.6-6.1a4.9 4.9 0 0 0-4.7-3.6Z",id:"line-eye-solid"},b0={description:"M24 31.7c-4 0-7.4-3.1-7.7-7.1l-5.6-4.4c-.8 1-1.4 2-2 3a1.7 1.7 0 0 0 0 1.6 17.2 17.2 0 0 0 19.5 9l-2.8-2.2-1.4.1ZM40.9 35l-6-4.6c1.8-1.5 3.3-3.4 4.4-5.5a1.7 1.7 0 0 0 0-1.6c-3-5.7-8.7-9.5-15.3-9.5-2.8 0-5.5.7-8 2l-6.8-5.3a.9.9 0 0 0-1.2.2L7 12a.9.9 0 0 0 .1 1.2l31.7 24.5a.9.9 0 0 0 1.2-.2l1-1.3a.9.9 0 0 0-.1-1.2Zm-10-7.7-2-1.6a5 5 0 0 0-6.3-6.6 2.5 2.5 0 0 1 .4 2l-3.9-3a7.7 7.7 0 0 1 10.4.5 7.7 7.7 0 0 1 1.5 8.7Z",id:"line-eye-slash-solid"};var 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 x0={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 l0={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 M1=u1(require("@s_mart/masks"));var a0=require("@mui/material"),C0=require("@s_mart/utils"),b1=require("react/jsx-runtime"),U=({label:c,required:a,regular:o})=>(0,b1.jsxs)("span",{style:{display:"flex",alignItems:"center",gap:(0,C0.toRem)(2)},children:[(0,b1.jsx)(a0.Typography,{variant:"caption",fontWeight:o?400:700,style:{display:"flex",alignItems:"center"},children:c}),a&&(0,b1.jsx)(a0.Typography,{variant:"caption",fontWeight:900,color:"error",children:"*"})]});var F0=require("react-hook-form"),k0=require("@s_mart/core");var Y=(c,a)=>a.replace(/[[\]]/g,"").split(".").reduce((s,i)=>s==null?void 0:s[i],c);var A0=require("react/jsx-runtime"),O=({name:c,disableIcon:a})=>{var i;let o=(0,F0.useFormContext)(),s=Y((i=o==null?void 0:o.formState)==null?void 0:i.errors,c);return s?(0,A0.jsx)(k0.Indicator,{severity:"error",icon:a?!1:void 0,children:s==null?void 0:s.message}):null};var x1=require("@s_mart/core");var j=require("react/jsx-runtime"),D2=w=>{var D=w,{name:c,rules:a,defaultValue:o,shouldUnregister:s,label:i,required:g,mask:u,variant:C="outlined",info:S,parse:M,inputMode:G,format:L,onInputChange:y,disableIconError:F}=D,k=$(D,["name","rules","defaultValue","shouldUnregister","label","required","mask","variant","info","parse","inputMode","format","onInputChange","disableIconError"]);let B=(0,_1.useFormContext)();if(!B)throw new Error("Para usar o <TextField /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let[A,H]=(0,$1.useState)(!1),f=v=>{var p;let x=v;return L&&(x=L(v)),u?(p=M1==null?void 0:M1[u])==null?void 0:p.format(x):x},P=v=>{var p;let x=v;return M&&(x=M(v)),u?(p=M1==null?void 0:M1[u])==null?void 0:p.parse(x):x},_=v=>{if(!v||u!=="porcentagem"&&u!=="porcentagem0")return;v==null||v.stopPropagation();let x=(v==null?void 0:v.target).value;if(x){let p=String(x);if(p.length>0){let t=p.indexOf("%");t>-1&&(v.currentTarget.selectionEnd=t)}}},I=Y(B.formState.errors,c);return(0,j.jsx)(_1.Controller,{control:B.control,name:c,rules:a,defaultValue:o,shouldUnregister:s,render:({field:{value:v,onChange:x,ref:p}})=>(0,j.jsxs)(n1.Grid,{display:"flex",flexDirection:"column",children:[(0,j.jsxs)("div",{style:{display:"flex"},children:[i&&(0,j.jsx)(n1.Grid,{item:!0,children:(0,j.jsx)(U,{label:i,required:g})}),S&&(0,j.jsx)(n1.Grid,{item:!0,children:(0,j.jsx)(x1.Tooltip,{title:S,placement:"top",children:(0,j.jsx)("div",{style:{width:"fit-content"},children:(0,j.jsx)(x1.LIcon,{icon:o1,color:"#757575"})})})})]}),(0,j.jsx)(n1.TextField,Z(r({variant:C,defaultValue:o,value:f(v||(v!=0?"":v)),onChange:t=>{var e;let l=P((e=t==null?void 0:t.target)==null?void 0:e.value);x(l),y==null||y(l,B.getValues())},error:!!I},k),{type:k.type==="password"?A?"text":"password":k.type,autoComplete:k.autoComplete||"off",inputProps:r({inputMode:G},k.inputProps),InputProps:r({onKeyDown:_,inputRef:p,endAdornment:k.type==="password"&&(0,j.jsx)(n1.InputAdornment,{position:"start",onClick:()=>H(!A),style:{cursor:"pointer"},children:(0,j.jsx)(x1.LIcon,{icon:A?y0:b0,size:"24px",removeMargin:!0})})},k.InputProps)}),c),(0,j.jsx)(O,{name:c,disableIcon:F})]})})},S0=(0,$1.memo)(D2);var B1=require("react"),I1=require("react-hook-form"),e1=require("@s_mart/core");var w0={description:"m27.4 24.4 7-7c.4-.4.4-1 0-1.5l-1.6-1.6a1 1 0 0 0-1.5 0l-7 7-7-7a1 1 0 0 0-1.4 0l-1.6 1.6a1 1 0 0 0 0 1.5l7 7-7 7a1 1 0 0 0 0 1.4l1.6 1.6c.4.4 1 .4 1.5 0l7-7 7 7c.3.4 1 .4 1.4 0l1.6-1.6c.4-.4.4-1 0-1.5l-7-7Z",id:"line-times-regular"};var P0=require("@s_mart/tokens"),W=require("@mui/material");var E=require("react/jsx-runtime"),$2=D=>{var B=D,{name:c,rules:a,defaultValue:o,shouldUnregister:s,label:i,required:g,options:u,placeholder:C,clearable:S,disableOnChangeForm:M=!1,multiple:G,info:L,footer:y,onChange:F,disableIconError:k}=B,w=$(B,["name","rules","defaultValue","shouldUnregister","label","required","options","placeholder","clearable","disableOnChangeForm","multiple","info","footer","onChange","disableIconError"]);let A=(0,I1.useFormContext)(),{palette:H}=(0,W.useTheme)(),[f,P]=(0,B1.useState)(!1);if(!A)throw new Error("Para usar o <Select /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let _=Y(A.formState.errors,c);return console.warn=()=>{},(0,E.jsx)(I1.Controller,{control:A.control,name:c,rules:a,defaultValue:o,shouldUnregister:s,render:({field:{value:I,onChange:v,ref:x}})=>(0,E.jsxs)(W.Grid,{display:"flex",flexDirection:"column",children:[(0,E.jsxs)("div",{style:{display:"flex"},children:[i&&(0,E.jsx)(W.Grid,{item:!0,children:(0,E.jsx)(U,{label:i,required:g})}),L&&(0,E.jsx)(W.Grid,{item:!0,children:(0,E.jsx)(e1.Tooltip,{title:L,placement:"top",children:(0,E.jsx)("div",{style:{width:"fit-content"},children:(0,E.jsx)(e1.LIcon,{icon:o1,color:"#757575"})})})})]}),(0,E.jsxs)(W.Select,Z(r({open:f,onOpen:()=>P(!0),onClose:()=>P(!1),displayEmpty:!!C,variant:"outlined",autoComplete:"off",value:I?I||"":G?[]:"",renderValue:p=>{if(p.label)return p.label;if(C)return(0,E.jsx)("p",{style:{color:H.grey[400]},children:C})},multiple:G,onChange:p=>{!M&&v(p.target.value),F&&F(p.target.value,A.getValues())},error:!!_,size:w.size||"medium",inputRef:x},w),{endAdornment:(0,E.jsxs)(E.Fragment,{children:[w.endAdornment,!!(S&&I)&&(0,E.jsx)(e1.IconButton,{variant:"text",color:"neutral",size:"small",sx:{borderRadius:"50%",position:"absolute",right:"2rem"},style:{padding:0},"aria-label":"Clear",title:"Clear",onClick:()=>{!M&&v(null),F&&F(null,A.getValues())},children:(0,E.jsx)(e1.LIcon,{icon:w0,color:P0.colorPalette.neutral[100],size:"25px",removeMargin:!0})})]}),children:[C&&(0,E.jsx)(W.MenuItem,{disabled:!0,value:"",children:(0,E.jsx)("p",{style:{color:H.grey[400]},children:C})}),u==null?void 0:u.map((p,t)=>(0,E.jsx)(W.MenuItem,{value:p,children:(0,E.jsxs)(W.Grid,{container:!0,direction:"column",children:[(0,E.jsx)(W.Grid,{item:!0,children:p.label}),p.afterLabel&&(0,E.jsx)(W.Grid,{item:!0,children:p.afterLabel})]})},t)),y&&[(0,E.jsx)(W.Grid,{px:2,py:1,children:(0,E.jsx)(e1.Divider,{})},"footer-divider"),(0,E.jsx)("div",{children:y({closeSelect:()=>P(!1)})},"footer-content")]]}),c),(0,E.jsx)(O,{name:c,disableIcon:k})]})})},T0=(0,B1.memo)($2);var E1=require("react"),G1=require("react-hook-form"),J=require("@mui/material"),m1=require("@s_mart/core");var D0=require("@s_mart/tokens");var T=require("react/jsx-runtime"),e0=require("react"),_2=B=>{var A=B,{name:c,rules:a,defaultValue:o,shouldUnregister:s,label:i,required:g,options:u,textFieldProps:C,noOptionsText:S,footer:M,multiple:G,info:L,placeholder:y,onChange:F,onInputChange:k,disableIconError:w}=A,D=$(A,["name","rules","defaultValue","shouldUnregister","label","required","options","textFieldProps","noOptionsText","footer","multiple","info","placeholder","onChange","onInputChange","disableIconError"]);let H=(0,G1.useFormContext)();if(!H)throw new Error("Para usar o <Searchable /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let f=Y(H.formState.errors,c);return console.warn=()=>{},(0,T.jsx)(G1.Controller,{control:H.control,name:c,rules:a,defaultValue:o,shouldUnregister:s,render:({field:{onChange:P,value:_,ref:I}})=>{var v;return(0,T.jsxs)(J.Grid,{display:"flex",flexDirection:"column",children:[(0,T.jsxs)("div",{style:{display:"flex"},children:[i&&(0,T.jsx)(J.Grid,{item:!0,children:(0,T.jsx)(U,{label:i,required:g})}),L&&(0,T.jsx)(J.Grid,{item:!0,children:(0,T.jsx)(m1.Tooltip,{title:L,placement:"top",children:(0,T.jsx)("div",{style:{width:"fit-content"},children:(0,T.jsx)(m1.LIcon,{icon:o1,color:"#757575"})})})})]}),(0,T.jsx)(J.Autocomplete,Z(r({onChange:(x,p)=>{P(p),F==null||F(p,H.getValues())},onInputChange:(x,p,t)=>{t==="input"&&setTimeout(()=>{k==null||k(p,H.getValues())},0)},slotProps:Z(r({},D.slotProps||{}),{paper:Z(r({},(D.slotProps||{}).paper||{}),{sx:r({border:`1px solid ${D0.colorPalette.neutral[30]}`,boxShadow:"0px 2px 4px rgba(0, 0, 0, 0.15)"},((v=(D.slotProps||{}).paper)==null?void 0:v.sx)||{})})}),value:_||(G?[]:null),options:u,multiple:G,noOptionsText:(0,T.jsxs)(T.Fragment,{children:[S||"Nenhum resultado encontrado",M?(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(J.Grid,{py:1,children:(0,T.jsx)(m1.Divider,{})}),M]}):null]}),isOptionEqualToValue:(x,p)=>typeof x=="string"&&typeof p=="string"?x===p:typeof x=="object"&&typeof p=="object"?typeof x.value=="object"&&typeof p.value=="object"&&x.key!==void 0&&p.key!==void 0?x.key===p.key:x.value===p.value:!1,renderOption:(x,p)=>typeof p=="object"?(0,e0.createElement)("li",Z(r({},x),{key:p.key||p.value}),(0,T.jsxs)(J.Grid,{container:!0,direction:"column",children:[(0,T.jsx)(J.Grid,{item:!0,children:p.label}),p.afterLabel&&(0,T.jsx)(J.Grid,{item:!0,children:p.afterLabel})]})):(0,e0.createElement)("li",Z(r({},x),{key:p}),p),ListboxComponent:(0,E1.forwardRef)(function(p,t){return(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)("ul",Z(r({},p),{ref:t})),!!M&&(0,T.jsx)("div",Z(r({},p),{children:(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(J.Grid,{px:2,py:1,children:(0,T.jsx)(m1.Divider,{})}),M]})}),"searchable-footer")]})})},D),{renderInput:x=>(0,T.jsx)(J.TextField,Z(r(r({error:!!f,placeholder:y},x),C),{inputRef:I}))}),c),(0,T.jsx)(O,{name:c,disableIcon:w})]})}})},$0=(0,E1.memo)(_2);var R1=require("react"),U1=require("react-hook-form"),O1=require("lodash"),Q=require("@mui/material"),X=require("@s_mart/core"),E0=require("@s_mart/tokens");var r0=require("@s_mart/utils");var C1=require("@s_mart/utils"),_0=u1(require("@emotion/styled")),i0=require("@emotion/react"),B0=i0.css`
|
|
2
2
|
display: flex;
|
|
3
3
|
align-items: center;
|
|
4
4
|
justify-content: center;
|
|
5
|
-
`,B2=c=>
|
|
5
|
+
`,B2=c=>i0.css`
|
|
6
6
|
.creatable,
|
|
7
7
|
.editable {
|
|
8
8
|
${B0}
|
|
9
9
|
|
|
10
10
|
.divider {
|
|
11
11
|
width: 1px;
|
|
12
|
-
height: ${(0,
|
|
12
|
+
height: ${(0,C1.toRem)(20)};
|
|
13
13
|
background-color: ${c.palette.grey[400]};
|
|
14
14
|
}
|
|
15
15
|
|
|
@@ -20,9 +20,9 @@
|
|
|
20
20
|
color: ${c.palette.grey[600]};
|
|
21
21
|
border-radius: 50%;
|
|
22
22
|
|
|
23
|
-
margin: 0 ${(0,
|
|
24
|
-
width: ${(0,
|
|
25
|
-
height: ${(0,
|
|
23
|
+
margin: 0 ${(0,C1.toRem)(6)};
|
|
24
|
+
width: ${(0,C1.toRem)(28)};
|
|
25
|
+
height: ${(0,C1.toRem)(28)};
|
|
26
26
|
|
|
27
27
|
&:hover {
|
|
28
28
|
cursor: pointer;
|
|
@@ -47,22 +47,22 @@
|
|
|
47
47
|
}
|
|
48
48
|
|
|
49
49
|
${({hideAddButton:c,theme:a})=>!c&&B2(a)}
|
|
50
|
-
`;var b=require("react/jsx-runtime"),o0=require("react"),I2=
|
|
50
|
+
`;var b=require("react/jsx-runtime"),o0=require("react"),I2=f=>{var P=f,{name:c,rules:a,defaultValue:o,shouldUnregister:s,label:i,required:g,options:u,editable:C,footer:S,onEditOption:M,onCreateOption:G,textFieldProps:L,hideAddButton:y,multiple:F,info:k,onChange:w,onInputChange:D,placeholder:B,disableIconError:A}=P,H=$(P,["name","rules","defaultValue","shouldUnregister","label","required","options","editable","footer","onEditOption","onCreateOption","textFieldProps","hideAddButton","multiple","info","onChange","onInputChange","placeholder","disableIconError"]);let _=(0,U1.useFormContext)();if(!_)throw new Error("Para usar o <Creatable /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let I=Y(_.formState.errors,c),v=l=>{let e=0;return L!=null&&L.InputProps||(e+=2.5),y||(e+=2.56,x(l)&&(e+=2.56)),H.disableClearable||(e+=1.3),e+"rem"},x=l=>C&&(0,O1.isObject)(l)&&!(0,O1.isEmpty)(l);console.warn=()=>{};let p=l=>{G?G(l):console.error("onCreateOption n\xE3o foi definido")},t=l=>{M?M(l):console.error("onEditOption n\xE3o foi definido")};return(0,b.jsx)(U1.Controller,{control:_.control,name:c,rules:a,defaultValue:o,shouldUnregister:s,render:({field:{value:l,onChange:e,ref:d}})=>{var V;let n=(l==null?void 0:l.label)||(l==null?void 0:l.value)||l;return(0,b.jsxs)(Q.Grid,{display:"flex",flexDirection:"column",children:[(0,b.jsxs)("div",{style:{display:"flex"},children:[i&&(0,b.jsx)(Q.Grid,{item:!0,children:(0,b.jsx)(U,{label:i,required:g})}),k&&(0,b.jsx)(Q.Grid,{item:!0,children:(0,b.jsx)(X.Tooltip,{title:k,placement:"top",children:(0,b.jsx)("div",{style:{width:"fit-content"},children:(0,b.jsx)(X.LIcon,{icon:o1,color:"#757575"})})})})]}),(0,b.jsx)(I0,{hideAddButton:y,children:(0,b.jsx)(Q.Autocomplete,Z(r({fullWidth:!0,onChange:(h,m)=>{e(m),w==null||w(m,_.getValues())},onInputChange:(h,m,R)=>{R==="input"&&setTimeout(()=>{D==null||D(m,_.getValues())},0)},slotProps:Z(r({},H.slotProps||{}),{paper:Z(r({},(H.slotProps||{}).paper||{}),{sx:r({border:`1px solid ${E0.colorPalette.neutral[30]}`,boxShadow:"0px 2px 4px rgba(0, 0, 0, 0.15)"},((V=(H.slotProps||{}).paper)==null?void 0:V.sx)||{})})}),options:u,value:l||(F?[]:null),multiple:F,noOptionsText:y?void 0:(0,b.jsxs)(X.Button,{sx:{justifyContent:"flex-start",padding:`${(0,r0.toRem)(6)} ${(0,r0.toRem)(-16)}`,margin:0},fullWidth:!0,onClick:()=>p(l),variant:"text",startIcon:(0,b.jsx)(X.LIcon,{icon:l0}),children:["Adicionar ",n&&`"${n}"`]}),isOptionEqualToValue:(h,m)=>m?typeof h=="string"&&typeof m=="string"?h===m:typeof h=="object"&&typeof m=="object"?typeof h.value=="object"&&typeof m.value=="object"&&h.key!==void 0&&m.key!==void 0?h.key===m.key:h.value===m.value:typeof h=="object"&&typeof m=="string":!1,renderOption:(h,m)=>typeof m=="object"?(0,o0.createElement)("li",Z(r({},h),{key:m.key||m.value}),(0,b.jsxs)(Q.Grid,{container:!0,direction:"column",children:[(0,b.jsx)(Q.Grid,{item:!0,children:m.label}),m.afterLabel&&(0,b.jsx)(Q.Grid,{item:!0,children:m.afterLabel})]})):(0,o0.createElement)("li",Z(r({},h),{key:m}),m),ListboxComponent:(0,R1.forwardRef)(function(m,R){return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("ul",Z(r({},m),{ref:R})),!!S&&(0,b.jsx)("div",Z(r({},m),{children:(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(Q.Grid,{px:2,py:1,children:(0,b.jsx)(X.Divider,{})}),S]})}),"creatable-footer")]})})},H),{sx:r({"& div.MuiInputBase-root":{paddingRight:`${v(l)} !important`}},H.sx),renderInput:h=>(0,b.jsx)(Q.TextField,r(Z(r({placeholder:B},h),{error:!!I,InputProps:Z(r({},h.InputProps),{inputRef:d,endAdornment:(0,b.jsxs)("div",{className:"endAdornments",children:[h.InputProps.endAdornment,!y&&(0,b.jsxs)(b.Fragment,{children:[x(l)?(0,b.jsxs)("div",{className:"editable",children:[(0,b.jsx)("div",{className:"divider"}),(0,b.jsx)("div",{className:"button",onClick:()=>t(l),children:(0,b.jsx)(X.LIcon,{icon:x0,size:"24px",removeMargin:!0})})]}):null,(0,b.jsxs)("div",{className:"creatable",children:[(0,b.jsx)("div",{className:"divider"}),(0,b.jsx)("div",{className:"button",onClick:()=>p(l),children:(0,b.jsx)(X.LIcon,{icon:l0,size:"24px",removeMargin:!0})})]})]})]})})}),L))}),c)}),(0,b.jsx)(O,{name:c,disableIcon:A})]})}})},G0=(0,R1.memo)(I2);var q1=require("react-hook-form"),H1=require("@mui/material");var h1=require("react/jsx-runtime"),E2=G=>{var L=G,{name:c,rules:a,defaultValue:o,shouldUnregister:s,label:i,labelPlacement:g,required:u,disableIconError:C,onChange:S}=L,M=$(L,["name","rules","defaultValue","shouldUnregister","label","labelPlacement","required","disableIconError","onChange"]);let y=(0,q1.useFormContext)();if(!y)throw new Error("Para usar o <Checkbox /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");return(0,h1.jsx)(q1.Controller,{control:y.control,name:c,rules:a,defaultValue:o,shouldUnregister:s,render:({field:{value:F,onChange:k}})=>(0,h1.jsxs)(H1.Grid,{display:"flex",flexDirection:"column",children:[(0,h1.jsx)(H1.FormControlLabel,{control:(0,h1.jsx)(H1.Checkbox,r({checked:!!F,value:F!=null?F:"",defaultValue:F,onChange:(w,D)=>{k(w,D),S==null||S(w,D)}},M),c),label:(0,h1.jsx)(U,{label:i,required:u,regular:!0}),labelPlacement:g||"end"}),(0,h1.jsx)(O,{name:c,disableIcon:C})]})})},R0=E2;var z1=require("react-hook-form"),f1=require("@mui/material");var s1=require("react/jsx-runtime"),G2=M=>{var G=M,{name:c,rules:a,defaultValue:o,shouldUnregister:s,label:i,labelPlacement:g,disableIconError:u,onChange:C}=G,S=$(G,["name","rules","defaultValue","shouldUnregister","label","labelPlacement","disableIconError","onChange"]);let L=(0,z1.useFormContext)();if(!L)throw new Error("Para usar o <Switch /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");return(0,s1.jsx)(z1.Controller,{control:L.control,name:c,rules:a,defaultValue:o,shouldUnregister:s,render:({field:{value:y,onChange:F}})=>(0,s1.jsxs)(f1.Grid,{display:"flex",flexDirection:"column",children:[(0,s1.jsx)(f1.FormControlLabel,{control:(0,s1.jsx)(f1.Switch,r({value:y!=null?y:"",checked:y!=null?y:!1,defaultValue:y,onChange:(k,w)=>{F(k,w),C==null||C(k,w)}},S),c),label:(0,s1.jsx)(U,{label:i}),labelPlacement:g||"end"}),(0,s1.jsx)(O,{name:c,disableIcon:u})]})})},U0=G2;var V1=require("@mui/material");var F1=require("react/jsx-runtime"),R2=s=>{var i=s,{label:c,labelPlacement:a}=i,o=$(i,["label","labelPlacement"]);return(0,F1.jsx)(V1.Grid,{display:"flex",flexDirection:"column",children:(0,F1.jsx)(V1.FormControlLabel,{control:(0,F1.jsx)(V1.Radio,r({},o)),label:(0,F1.jsx)(U,{label:c}),labelPlacement:a||"end"})})},O0=R2;var Y1=require("react-hook-form"),j1=require("@mui/material");var Z1=require("react/jsx-runtime"),U2=G=>{var L=G,{name:c,rules:a,defaultValue:o,shouldUnregister:s,label:i,required:g,children:u,orientation:C="row",disableIconError:S}=L,M=$(L,["name","rules","defaultValue","shouldUnregister","label","required","children","orientation","disableIconError"]);let y=(0,Y1.useFormContext)();if(!y)throw new Error("Para usar o <RadioGroup /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");return(0,Z1.jsx)(Y1.Controller,{control:y.control,name:c,rules:a,defaultValue:o,shouldUnregister:s,render:({field:{value:F,onChange:k}})=>(0,Z1.jsxs)(j1.Grid,{display:"flex",flexDirection:"column",children:[i&&(0,Z1.jsx)(U,{label:i,required:g}),(0,Z1.jsx)(j1.RadioGroup,Z(r({value:F||"",name:c},M),{onChange:w=>{var D,B;(B=M==null?void 0:M.onChange)==null||B.call(M,w,(D=w.target)==null?void 0:D.value),k(w)},style:{display:"flex",flexDirection:C},children:u}),c),(0,Z1.jsx)(O,{name:c,disableIcon:S})]})})},q0=U2;var W1=require("react-hook-form"),z0=require("@mui/material");var n0=require("react/jsx-runtime"),O2=g=>{var u=g,{name:c,rules:a,defaultValue:o,shouldUnregister:s}=u,i=$(u,["name","rules","defaultValue","shouldUnregister"]);let C=(0,W1.useFormContext)();if(!C)throw new Error("Para usar o <Slider /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");return(0,n0.jsx)(W1.Controller,{control:C.control,name:c,rules:a,defaultValue:o,shouldUnregister:s,render:({field:{value:S,onChange:M}})=>(0,n0.jsx)(z0.Slider,r({value:S||(i==null?void 0:i.min)||0,onChange:M,valueLabelDisplay:"auto"},i),c)})},Y0=O2;var K0=require("react"),N1=require("react-hook-form"),Q0=require("@s_mart/core"),k1=require("@s_mart/rules"),X0=require("@mui/material"),c2=require("@mui/x-date-pickers/DatePicker"),l2=require("@mui/x-date-pickers/AdapterDayjs"),a2=require("@mui/x-date-pickers/LocalizationProvider"),e2=require("@mui/x-date-pickers/locales/ptBR"),i2=u1(d0());var W0=u1(require("@emotion/styled")),N0=require("@mui/material"),c1=require("@s_mart/utils"),q2=c=>{switch(c){case"small":return(0,c1.toRem)(16);default:case"medium":return(0,c1.toRem)(20);case"large":return(0,c1.toRem)(24)}},z2=c=>{switch(c){case"small":return`${(0,c1.toRem)(2)} ${(0,c1.toRem)(8)}`;default:case"medium":return`${(0,c1.toRem)(6)} ${(0,c1.toRem)(8)}`;case"large":return`${(0,c1.toRem)(10)}`}},J0=(0,W0.default)(N0.IconButton)`
|
|
51
51
|
margin: 0px;
|
|
52
52
|
|
|
53
53
|
padding: ${({size:c})=>z2(c)};
|
|
54
|
-
border-radius: 0 ${(0,
|
|
54
|
+
border-radius: 0 ${(0,c1.toRem)(4)} ${(0,c1.toRem)(4)} 0;
|
|
55
55
|
|
|
56
56
|
svg {
|
|
57
57
|
width: ${({size:c})=>q2(c)} !important;
|
|
58
58
|
}
|
|
59
|
-
`;var
|
|
59
|
+
`;var t1=require("react/jsx-runtime"),o2=require("react"),Y2=L=>{var y=L,{rules:c,name:a,defaultValue:o,shouldUnregister:s,datePickerProps:i,label:g,required:u,placeholder:C,disabled:S,disableIconError:M}=y,G=$(y,["rules","name","defaultValue","shouldUnregister","datePickerProps","label","required","placeholder","disabled","disableIconError"]);let F=(0,N1.useFormContext)();if(!F)throw new Error("Para usar o <DataPicker /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let k=Y(F.formState.errors,a),w=(i==null?void 0:i.format)||"DD/MM/YYYY",D=c?(0,k1.composeValidators)([(0,k1.date)(w),c]):(0,k1.date)(w);return(0,t1.jsx)(a2.LocalizationProvider,{dateAdapter:l2.AdapterDayjs,adapterLocale:i2.default,localeText:e2.ptBR.components.MuiLocalizationProvider.defaultProps.localeText,children:(0,t1.jsx)(N1.Controller,{control:F.control,name:a,rules:D,defaultValue:o,shouldUnregister:s,render:({field:{value:B,onChange:A,ref:H}})=>(0,t1.jsxs)(Q0.Grid,{display:"flex",flexDirection:"column",children:[g&&(0,t1.jsx)(U,{label:g,required:u}),(0,o2.createElement)(c2.DatePicker,Z(r({},i),{key:a,value:B!=null?B:null,format:w,onChange:(f,P)=>{var _;A(f,P),(_=i==null?void 0:i.onChange)==null||_.call(i,f,P)},disabled:S,slots:{textField:X0.TextField,openPickerButton:f=>(0,t1.jsx)(J0,Z(r({},f),{size:G.size}))},slotProps:{textField:f=>{var P;return Z(r(Z(r({variant:"outlined"},f),{error:!!k}),G),{inputProps:Z(r({},f.inputProps),{placeholder:C||((P=f.inputProps)==null?void 0:P.placeholder)}),InputProps:Z(r({},f.InputProps),{inputRef(_){H(_),typeof f.inputRef=="function"&&f.inputRef(_)}})})}}})),(0,t1.jsx)(O,{name:a,disableIcon:M})]})})})},r2=(0,K0.memo)(Y2);var t2=require("react"),J1=require("react-hook-form"),v2=require("@s_mart/core"),A1=require("@s_mart/rules"),d2=require("@mui/material"),m2=require("@mui/x-date-pickers/TimePicker"),Z2=require("@mui/x-date-pickers/AdapterDayjs"),p2=require("@mui/x-date-pickers/LocalizationProvider"),u2=require("@mui/x-date-pickers/locales/ptBR"),M2=u1(d0());var n2=u1(require("@emotion/styled")),h2=require("@mui/material"),l1=require("@s_mart/utils"),j2=c=>{switch(c){case"small":return(0,l1.toRem)(16);default:case"medium":return(0,l1.toRem)(20);case"large":return(0,l1.toRem)(24)}},W2=c=>{switch(c){case"small":return`${(0,l1.toRem)(2)} ${(0,l1.toRem)(8)}`;default:case"medium":return`${(0,l1.toRem)(6)} ${(0,l1.toRem)(8)}`;case"large":return`${(0,l1.toRem)(10)}`}},s2=(0,n2.default)(h2.IconButton)`
|
|
60
60
|
margin: 0px;
|
|
61
61
|
|
|
62
62
|
padding: ${({size:c})=>W2(c)};
|
|
63
|
-
border-radius: 0 ${(0,
|
|
63
|
+
border-radius: 0 ${(0,l1.toRem)(4)} ${(0,l1.toRem)(4)} 0;
|
|
64
64
|
|
|
65
65
|
svg {
|
|
66
66
|
width: ${({size:c})=>j2(c)} !important;
|
|
67
67
|
}
|
|
68
|
-
`;var
|
|
68
|
+
`;var i1=require("react/jsx-runtime"),N2=L=>{var y=L,{rules:c,defaultValue:a,shouldUnregister:o,name:s,required:i,label:g,timePickerProps:u,placeholder:C,disabled:S,disableIconError:M}=y,G=$(y,["rules","defaultValue","shouldUnregister","name","required","label","timePickerProps","placeholder","disabled","disableIconError"]);let F=(0,J1.useFormContext)();if(!F)throw new Error("Para usar o <TimePicker /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let k=Y(F.formState.errors,s),w=(u==null?void 0:u.format)||"HH:mm",D=c?(0,A1.composeValidators)([(0,A1.time)(w),c]):(0,A1.time)(w);return(0,i1.jsx)(p2.LocalizationProvider,{dateAdapter:Z2.AdapterDayjs,adapterLocale:M2.default,localeText:u2.ptBR.components.MuiLocalizationProvider.defaultProps.localeText,children:(0,i1.jsx)(J1.Controller,{control:F.control,name:s,rules:D,defaultValue:a,shouldUnregister:o,render:({field:{value:B,onChange:A,ref:H}})=>(0,i1.jsxs)(v2.Grid,{display:"flex",flexDirection:"column",children:[g&&(0,i1.jsx)(U,{label:g,required:i}),(0,i1.jsx)(m2.TimePicker,Z(r({ampm:!1,format:w,value:B!=null?B:null,disabled:S},u),{onChange:(f,P)=>{var _;A(f,P),(_=u==null?void 0:u.onChange)==null||_.call(u,f,P)},slots:{textField:d2.TextField,openPickerButton:f=>(0,i1.jsx)(s2,Z(r({},f),{size:G.size}))},slotProps:{textField:f=>{var P;return Z(r(Z(r({variant:"outlined"},f),{error:!!k}),G),{inputProps:Z(r({},f.inputProps),{placeholder:C||((P=f.inputProps)==null?void 0:P.placeholder)}),InputProps:Z(r({},f.InputProps),{inputRef(_){H(_),typeof f.inputRef=="function"&&f.inputRef(_)}})})}}}),s),(0,i1.jsx)(O,{name:s,disableIcon:M})]})})})},H2=(0,t2.memo)(N2);var f2=require("react"),K1=require("react-hook-form"),Q1=require("@mui/material"),S1=require("@s_mart/core"),V2=require("@s_mart/tokens");var a1=require("react/jsx-runtime"),L2=require("react"),J2=y=>{var F=y,{name:c,defaultValue:a,rules:o,shouldUnregister:s,label:i,required:g,noOptionsText:u,placeholder:C,onInputChange:S,onChange:M,disableIconError:G}=F,L=$(F,["name","defaultValue","rules","shouldUnregister","label","required","noOptionsText","placeholder","onInputChange","onChange","disableIconError"]);let k=(0,K1.useFormContext)();if(!k)throw new Error("Para usar o <Autocomplete /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let w=Y(k.formState.errors,c);return console.warn=()=>{},(0,a1.jsx)(K1.Controller,{name:c,control:k.control,defaultValue:a,rules:o,shouldUnregister:s,render:({field:D})=>{var B;return(0,a1.jsxs)(S1.Grid,{display:"flex",flexDirection:"column",children:[i&&(0,a1.jsx)(U,{label:i,required:g}),(0,a1.jsx)(Q1.Autocomplete,Z(r({onChange:(A,H)=>{D.onChange(H),M==null||M(H,k.getValues())},onInputChange:(A,H,f)=>{f==="input"&&(D.onChange(H),setTimeout(()=>{S==null||S(H,k.getValues())},0))},slotProps:Z(r({},L.slotProps||{}),{paper:Z(r({},(L.slotProps||{}).paper||{}),{sx:r({border:`1px solid ${V2.colorPalette.neutral[30]}`,boxShadow:"0px 2px 4px rgba(0, 0, 0, 0.15)"},((B=(L.slotProps||{}).paper)==null?void 0:B.sx)||{})})}),isOptionEqualToValue:(A,H)=>A.value===H.value,renderOption:(A,H)=>(0,L2.createElement)("li",Z(r({},A),{key:H.key||H.value,onClick:f=>{var P;(P=A.onClick)==null||P.call(A,f),D.onChange(H)}}),(0,a1.jsxs)(S1.Grid,{container:!0,direction:"column",children:[(0,a1.jsx)(S1.Grid,{item:!0,children:H.label}),H.afterLabel&&(0,a1.jsx)(S1.Grid,{item:!0,children:H.afterLabel})]})),value:D.value||null,noOptionsText:u||"Nenhuma op\xE7\xE3o encontrada"},L),{renderInput:A=>{var H,f,P;return(0,a1.jsx)(Q1.TextField,Z(r(r({placeholder:C},A),L.textFieldProps),{error:!!w,InputProps:Z(r(r({},A.InputProps),(H=L.textFieldProps)==null?void 0:H.InputProps),{inputRef:D.ref,inputProps:r(r({},A.inputProps),(P=(f=L.textFieldProps)==null?void 0:f.InputProps)==null?void 0:P.inputProps)})}))}}),c),(0,a1.jsx)(O,{name:c,disableIcon:G})]})}})},g2=(0,f2.memo)(J2);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 Z0=Object.create;var x1=Object.defineProperty,p0=Object.defineProperties,u0=Object.getOwnPropertyDescriptor,M0=Object.getOwnPropertyDescriptors,H0=Object.getOwnPropertyNames,M1=Object.getOwnPropertySymbols,f0=Object.getPrototypeOf,C1=Object.prototype.hasOwnProperty,I1=Object.prototype.propertyIsEnumerable;var B1=(c,a,n)=>a in c?x1(c,a,{enumerable:!0,configurable:!0,writable:!0,value:n}):c[a]=n,r=(c,a)=>{for(var n in a||(a={}))C1.call(a,n)&&B1(c,n,a[n]);if(M1)for(var n of M1(a))I1.call(a,n)&&B1(c,n,a[n]);return c},m=(c,a)=>p0(c,M0(a));var T=(c,a)=>{var n={};for(var s in c)C1.call(c,s)&&a.indexOf(s)<0&&(n[s]=c[s]);if(c!=null&&M1)for(var s of M1(c))a.indexOf(s)<0&&I1.call(c,s)&&(n[s]=c[s]);return n};var E1=(c,a)=>()=>(a||c((a={exports:{}}).exports,a),a.exports);var V0=(c,a,n,s)=>{if(a&&typeof a=="object"||typeof a=="function")for(let e of H0(a))!C1.call(c,e)&&e!==n&&x1(c,e,{get:()=>a[e],enumerable:!(s=u0(a,e))||s.enumerable});return c};var G1=(c,a,n)=>(n=c!=null?Z0(f0(c)):{},V0(a||!c||!c.__esModule?x1(n,"default",{value:c,enumerable:!0}):n,c));var o0=E1((P1,T1)=>{(function(c,a){typeof P1=="object"&&typeof T1!="undefined"?T1.exports=a():typeof define=="function"&&define.amd?define(a):(c=typeof globalThis!="undefined"?globalThis:c||self).dayjs=a()})(P1,function(){"use strict";var c=1e3,a=6e4,n=36e5,s="millisecond",e="second",g="minute",p="hour",x="day",k="week",u="month",B="quarter",L="year",y="date",C="Invalid Date",F=/^(\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,P={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(t){var l=["th","st","nd","rd"],i=t%100;return"["+t+(l[(i-20)%10]||l[i]||l[0])+"]"}},$=function(t,l,i){var f=String(t);return!f||f.length>=l?t:""+Array(l+1-f.length).join(i)+t},A={s:$,z:function(t){var l=-t.utcOffset(),i=Math.abs(l),f=Math.floor(i/60),o=i%60;return(l<=0?"+":"-")+$(f,2,"0")+":"+$(o,2,"0")},m:function t(l,i){if(l.date()<i.date())return-t(i,l);var f=12*(i.year()-l.year())+(i.month()-l.month()),o=l.clone().add(f,u),V=i-o<0,h=l.clone().add(f+(V?-1:1),u);return+(-(f+(i-o)/(V?o-h:h-o))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(t){return{M:u,y:L,w:k,d:x,D:y,h:p,m:g,s:e,ms:s,Q:B}[t]||String(t||"").toLowerCase().replace(/s$/,"")},u:function(t){return t===void 0}},M="en",H={};H[M]=P;var w=function(t){return t instanceof b},D=function t(l,i,f){var o;if(!l)return M;if(typeof l=="string"){var V=l.toLowerCase();H[V]&&(o=V),i&&(H[V]=i,o=V);var h=l.split("-");if(!o&&h.length>1)return t(h[0])}else{var v=l.name;H[v]=l,o=v}return!f&&o&&(M=o),o||!f&&M},_=function(t,l){if(w(t))return t.clone();var i=typeof l=="object"?l:{};return i.date=t,i.args=arguments,new b(i)},d=A;d.l=D,d.i=w,d.w=function(t,l){return _(t,{locale:l.$L,utc:l.$u,x:l.$x,$offset:l.$offset})};var b=function(){function t(i){this.$L=D(i.locale,null,!0),this.parse(i)}var l=t.prototype;return l.parse=function(i){this.$d=function(f){var o=f.date,V=f.utc;if(o===null)return new Date(NaN);if(d.u(o))return new Date;if(o instanceof Date)return new Date(o);if(typeof o=="string"&&!/Z$/i.test(o)){var h=o.match(F);if(h){var v=h[2]-1||0,I=(h[7]||"0").substring(0,3);return V?new Date(Date.UTC(h[1],v,h[3]||1,h[4]||0,h[5]||0,h[6]||0,I)):new Date(h[1],v,h[3]||1,h[4]||0,h[5]||0,h[6]||0,I)}}return new Date(o)}(i),this.$x=i.x||{},this.init()},l.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()},l.$utils=function(){return d},l.isValid=function(){return this.$d.toString()!==C},l.isSame=function(i,f){var o=_(i);return this.startOf(f)<=o&&o<=this.endOf(f)},l.isAfter=function(i,f){return _(i)<this.startOf(f)},l.isBefore=function(i,f){return this.endOf(f)<_(i)},l.$g=function(i,f,o){return d.u(i)?this[f]:this.set(o,i)},l.unix=function(){return Math.floor(this.valueOf()/1e3)},l.valueOf=function(){return this.$d.getTime()},l.startOf=function(i,f){var o=this,V=!!d.u(f)||f,h=d.p(i),v=function(n1,j){var c1=d.w(o.$u?Date.UTC(o.$y,j,n1):new Date(o.$y,j,n1),o);return V?c1:c1.endOf(x)},I=function(n1,j){return d.w(o.toDate()[n1].apply(o.toDate("s"),(V?[0,0,0,0]:[23,59,59,999]).slice(j)),o)},G=this.$W,z=this.$M,X=this.$D,Q="set"+(this.$u?"UTC":"");switch(h){case L:return V?v(1,0):v(31,11);case u:return V?v(1,z):v(0,z+1);case k:var t1=this.$locale().weekStart||0,v1=(G<t1?G+7:G)-t1;return v(V?X-v1:X+(6-v1),z);case x:case y:return I(Q+"Hours",0);case p:return I(Q+"Minutes",1);case g:return I(Q+"Seconds",2);case e:return I(Q+"Milliseconds",3);default:return this.clone()}},l.endOf=function(i){return this.startOf(i,!1)},l.$set=function(i,f){var o,V=d.p(i),h="set"+(this.$u?"UTC":""),v=(o={},o[x]=h+"Date",o[y]=h+"Date",o[u]=h+"Month",o[L]=h+"FullYear",o[p]=h+"Hours",o[g]=h+"Minutes",o[e]=h+"Seconds",o[s]=h+"Milliseconds",o)[V],I=V===x?this.$D+(f-this.$W):f;if(V===u||V===L){var G=this.clone().set(y,1);G.$d[v](I),G.init(),this.$d=G.set(y,Math.min(this.$D,G.daysInMonth())).$d}else v&&this.$d[v](I);return this.init(),this},l.set=function(i,f){return this.clone().$set(i,f)},l.get=function(i){return this[d.p(i)]()},l.add=function(i,f){var o,V=this;i=Number(i);var h=d.p(f),v=function(z){var X=_(V);return d.w(X.date(X.date()+Math.round(z*i)),V)};if(h===u)return this.set(u,this.$M+i);if(h===L)return this.set(L,this.$y+i);if(h===x)return v(1);if(h===k)return v(7);var I=(o={},o[g]=a,o[p]=n,o[e]=c,o)[h]||1,G=this.$d.getTime()+i*I;return d.w(G,this)},l.subtract=function(i,f){return this.add(-1*i,f)},l.format=function(i){var f=this,o=this.$locale();if(!this.isValid())return o.invalidDate||C;var V=i||"YYYY-MM-DDTHH:mm:ssZ",h=d.z(this),v=this.$H,I=this.$m,G=this.$M,z=o.weekdays,X=o.months,Q=function(j,c1,b1,u1){return j&&(j[c1]||j(f,V))||b1[c1].slice(0,u1)},t1=function(j){return d.s(v%12||12,j,"0")},v1=o.meridiem||function(j,c1,b1){var u1=j<12?"AM":"PM";return b1?u1.toLowerCase():u1},n1={YY:String(this.$y).slice(-2),YYYY:this.$y,M:G+1,MM:d.s(G+1,2,"0"),MMM:Q(o.monthsShort,G,X,3),MMMM:Q(X,G),D:this.$D,DD:d.s(this.$D,2,"0"),d:String(this.$W),dd:Q(o.weekdaysMin,this.$W,z,2),ddd:Q(o.weekdaysShort,this.$W,z,3),dddd:z[this.$W],H:String(v),HH:d.s(v,2,"0"),h:t1(1),hh:t1(2),a:v1(v,I,!0),A:v1(v,I,!1),m:String(I),mm:d.s(I,2,"0"),s:String(this.$s),ss:d.s(this.$s,2,"0"),SSS:d.s(this.$ms,3,"0"),Z:h};return V.replace(S,function(j,c1){return c1||n1[j]||h.replace(":","")})},l.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},l.diff=function(i,f,o){var V,h=d.p(f),v=_(i),I=(v.utcOffset()-this.utcOffset())*a,G=this-v,z=d.m(this,v);return z=(V={},V[L]=z/12,V[u]=z,V[B]=z/3,V[k]=(G-I)/6048e5,V[x]=(G-I)/864e5,V[p]=G/n,V[g]=G/a,V[e]=G/c,V)[h]||G,o?z:d.a(z)},l.daysInMonth=function(){return this.endOf(u).$D},l.$locale=function(){return H[this.$L]},l.locale=function(i,f){if(!i)return this.$L;var o=this.clone(),V=D(i,f,!0);return V&&(o.$L=V),o},l.clone=function(){return d.w(this.$d,this)},l.toDate=function(){return new Date(this.valueOf())},l.toJSON=function(){return this.isValid()?this.toISOString():null},l.toISOString=function(){return this.$d.toISOString()},l.toString=function(){return this.$d.toUTCString()},t}(),Z=b.prototype;return _.prototype=Z,[["$ms",s],["$s",e],["$m",g],["$H",p],["$W",x],["$M",u],["$y",L],["$D",y]].forEach(function(t){Z[t[1]]=function(l){return this.$g(l,t[0],t[1])}}),_.extend=function(t,l){return t.$i||(t(l,b,_),t.$i=!0),_},_.locale=D,_.isDayjs=w,_.unix=function(t){return _(1e3*t)},_.en=H[M],_.Ls=H,_.p={},_})});var _1=E1((D1,$1)=>{(function(c,a){typeof D1=="object"&&typeof $1!="undefined"?$1.exports=a(o0()):typeof define=="function"&&define.amd?define(["dayjs"],a):(c=typeof globalThis!="undefined"?globalThis:c||self).dayjs_locale_pt_br=a(c.dayjs)})(D1,function(c){"use strict";function a(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var n=a(c),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(e){return e+"\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 n.default.locale(s,null,!0),s})});import{FormProvider as g0}from"react-hook-form";import{jsx as R1}from"react/jsx-runtime";function L0(e){var g=e,{children:c,style:a,onSubmit:n}=g,s=T(g,["children","style","onSubmit"]);return R1(g0,m(r({},s),{children:R1("form",{onSubmit:p=>{p.preventDefault(),p.stopPropagation(),n(p)},style:a,children:c})}))}var F1=L0;import{useEffect as y0}from"react";import{useForm as b0}from"react-hook-form";import{zodResolver as x0}from"@hookform/resolvers/zod";var C0=s=>{var e=s,{disableDefaultValuesUpdate:c,onSubmit:a}=e,n=T(e,["disableDefaultValuesUpdate","onSubmit"]);let g=b0(m(r({},n),{resolver:n.schema&&x0(n.schema)}));return y0(()=>{c||g.reset(n.defaultValues)},[n.defaultValues,g.reset]),m(r({},g),{onSubmit:g.handleSubmit(p=>a(p,g))})},A1=C0;import{jsx as k0}from"react/jsx-runtime";function F0(s){var e=s,{children:c,style:a}=e,n=T(e,["children","style"]);let g=A1(n);return k0(F1,m(r({},g),{style:a,children:typeof c=="function"?c(g):c}))}var A0=F0;import{memo as $0,useState as _0}from"react";import{Controller as B0,useFormContext as I0}from"react-hook-form";import{Grid as S1,InputAdornment as E0,TextField as G0}from"@mui/material";var U1={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 l1={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 h1 from"@s_mart/masks";import{Typography as z1}from"@mui/material";import{toRem as S0}from"@s_mart/utils";import{jsx as Y1,jsxs as w0}from"react/jsx-runtime";var R=({label:c,required:a,regular:n})=>w0("span",{style:{display:"flex",alignItems:"center",gap:S0(2)},children:[Y1(z1,{variant:"caption",fontWeight:n?400:700,style:{display:"flex",alignItems:"center"},children:c}),a&&Y1(z1,{variant:"caption",fontWeight:900,color:"error",children:"*"})]});import{useFormContext as P0}from"react-hook-form";import{Indicator as T0}from"@s_mart/core";var Y=(c,a)=>a.replace(/[[\]]/g,"").split(".").reduce((s,e)=>s==null?void 0:s[e],c);import{jsx as D0}from"react/jsx-runtime";var U=({name:c,disableIcon:a})=>{var e;let n=P0(),s=Y((e=n==null?void 0:n.formState)==null?void 0:e.errors,c);return s?D0(T0,{severity:"error",icon:a?!1:void 0,children:s==null?void 0:s.message}):null};import{LIcon as j1,Tooltip as R0}from"@s_mart/core";import{jsx as W,jsxs as W1}from"react/jsx-runtime";var U0=S=>{var P=S,{name:c,rules:a,defaultValue:n,shouldUnregister:s,label:e,required:g,mask:p,variant:x="outlined",info:k,parse:u,inputMode:B,format:L,onInputChange:y,disableIconError:C}=P,F=T(P,["name","rules","defaultValue","shouldUnregister","label","required","mask","variant","info","parse","inputMode","format","onInputChange","disableIconError"]);let $=I0();if(!$)throw new Error("Para usar o <TextField /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let[A,M]=_0(!1),H=d=>{var Z;let b=d;return L&&(b=L(d)),p?(Z=h1==null?void 0:h1[p])==null?void 0:Z.format(b):b},w=d=>{var Z;let b=d;return u&&(b=u(d)),p?(Z=h1==null?void 0:h1[p])==null?void 0:Z.parse(b):b},D=d=>{if(!d||p!=="porcentagem"&&p!=="porcentagem0")return;d==null||d.stopPropagation();let b=(d==null?void 0:d.target).value;if(b){let Z=String(b);if(Z.length>0){let t=Z.indexOf("%");t>-1&&(d.currentTarget.selectionEnd=t)}}},_=Y($.formState.errors,c);return W(B0,{control:$.control,name:c,rules:a,defaultValue:n,shouldUnregister:s,render:({field:{value:d,onChange:b,ref:Z}})=>W1(S1,{display:"flex",flexDirection:"column",children:[W1("div",{style:{display:"flex"},children:[e&&W(S1,{item:!0,children:W(R,{label:e,required:g})}),k&&W(S1,{item:!0,children:W(R0,{title:k,placement:"top",children:W("div",{style:{width:"fit-content"},children:W(j1,{icon:l1,color:"#757575"})})})})]}),W(G0,m(r({variant:x,defaultValue:n,value:H(d||(d!=0?"":d)),onChange:t=>{var i;let l=w((i=t==null?void 0:t.target)==null?void 0:i.value);b(l),y==null||y(l,$.getValues())},error:!!_},F),{type:F.type==="password"?A?"text":"password":F.type,autoComplete:F.autoComplete||"off",inputProps:r({inputMode:B},F.inputProps),InputProps:r({onKeyDown:D,inputRef:Z,endAdornment:F.type==="password"&&W(E0,{position:"start",onClick:()=>M(!A),style:{cursor:"pointer"},children:W(j1,{icon:A?U1:O1,size:"24px",removeMargin:!0})})},F.InputProps)}),c),W(U,{name:c,disableIcon:C})]})})},O0=$0(U0);import{memo as q0,useState as z0}from"react";import{Controller as Y0,useFormContext as j0}from"react-hook-form";import{Divider as W0,IconButton as N0,LIcon as J1,Tooltip as J0}from"@s_mart/core";var N1={description:"m27.4 24.4 7-7c.4-.4.4-1 0-1.5l-1.6-1.6a1 1 0 0 0-1.5 0l-7 7-7-7a1 1 0 0 0-1.4 0l-1.6 1.6a1 1 0 0 0 0 1.5l7 7-7 7a1 1 0 0 0 0 1.4l1.6 1.6c.4.4 1 .4 1.5 0l7-7 7 7c.3.4 1 .4 1.4 0l1.6-1.6c.4-.4.4-1 0-1.5l-7-7Z",id:"line-times-regular"};import{colorPalette as K0}from"@s_mart/tokens";import{Grid as i1,Select as Q0,MenuItem as K1,useTheme as X0}from"@mui/material";import{Fragment as a2,jsx as O,jsxs as d1}from"react/jsx-runtime";var c2=P=>{var $=P,{name:c,rules:a,defaultValue:n,shouldUnregister:s,label:e,required:g,options:p,placeholder:x,clearable:k,disableOnChangeForm:u=!1,multiple:B,info:L,footer:y,onChange:C,disableIconError:F}=$,S=T($,["name","rules","defaultValue","shouldUnregister","label","required","options","placeholder","clearable","disableOnChangeForm","multiple","info","footer","onChange","disableIconError"]);let A=j0(),{palette:M}=X0(),[H,w]=z0(!1);if(!A)throw new Error("Para usar o <Select /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let D=Y(A.formState.errors,c);return console.warn=()=>{},O(Y0,{control:A.control,name:c,rules:a,defaultValue:n,shouldUnregister:s,render:({field:{value:_,onChange:d,ref:b}})=>d1(i1,{display:"flex",flexDirection:"column",children:[d1("div",{style:{display:"flex"},children:[e&&O(i1,{item:!0,children:O(R,{label:e,required:g})}),L&&O(i1,{item:!0,children:O(J0,{title:L,placement:"top",children:O("div",{style:{width:"fit-content"},children:O(J1,{icon:l1,color:"#757575"})})})})]}),d1(Q0,m(r({open:H,onOpen:()=>w(!0),onClose:()=>w(!1),displayEmpty:!!x,variant:"outlined",autoComplete:"off",value:_?_||"":B?[]:"",renderValue:Z=>{if(Z.label)return Z.label;if(x)return O("p",{style:{color:M.grey[400]},children:x})},multiple:B,onChange:Z=>{!u&&d(Z.target.value),C&&C(Z.target.value,A.getValues())},error:!!D,size:S.size||"medium",inputRef:b},S),{endAdornment:d1(a2,{children:[S.endAdornment,!!(k&&_)&&O(N0,{variant:"text",color:"neutral",size:"small",sx:{borderRadius:"50%",position:"absolute",right:"2rem"},style:{padding:0},"aria-label":"Clear",title:"Clear",onClick:()=>{!u&&d(null),C&&C(null,A.getValues())},children:O(J1,{icon:N1,color:K0.neutral[100],size:"25px",removeMargin:!0})})]}),children:[x&&O(K1,{disabled:!0,value:"",children:O("p",{style:{color:M.grey[400]},children:x})}),p==null?void 0:p.map((Z,t)=>O(K1,{value:Z,children:d1(i1,{container:!0,direction:"column",children:[O(i1,{item:!0,children:Z.label}),Z.afterLabel&&O(i1,{item:!0,children:Z.afterLabel})]})},t)),y&&[O(i1,{px:2,py:1,children:O(W0,{})},"footer-divider"),O("div",{children:y({closeSelect:()=>w(!1)})},"footer-content")]]}),c),O(U,{name:c,disableIcon:F})]})})},l2=q0(c2);import{forwardRef as i2,memo as e2}from"react";import{Controller as r2,useFormContext as o2}from"react-hook-form";import{Grid as a1,Autocomplete as n2,TextField as h2}from"@mui/material";import{Divider as Q1,LIcon as s2,Tooltip as t2}from"@s_mart/core";import{colorPalette as v2}from"@s_mart/tokens";import{Fragment as H1,jsx as q,jsxs as e1}from"react/jsx-runtime";import{createElement as X1}from"react";var d2=$=>{var A=$,{name:c,rules:a,defaultValue:n,shouldUnregister:s,label:e,required:g,options:p,textFieldProps:x,noOptionsText:k,footer:u,multiple:B,info:L,placeholder:y,onChange:C,onInputChange:F,disableIconError:S}=A,P=T(A,["name","rules","defaultValue","shouldUnregister","label","required","options","textFieldProps","noOptionsText","footer","multiple","info","placeholder","onChange","onInputChange","disableIconError"]);let M=o2();if(!M)throw new Error("Para usar o <Searchable /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let H=Y(M.formState.errors,c);return console.warn=()=>{},q(r2,{control:M.control,name:c,rules:a,defaultValue:n,shouldUnregister:s,render:({field:{onChange:w,value:D,ref:_}})=>{var d;return e1(a1,{display:"flex",flexDirection:"column",children:[e1("div",{style:{display:"flex"},children:[e&&q(a1,{item:!0,children:q(R,{label:e,required:g})}),L&&q(a1,{item:!0,children:q(t2,{title:L,placement:"top",children:q("div",{style:{width:"fit-content"},children:q(s2,{icon:l1,color:"#757575"})})})})]}),q(n2,m(r({onChange:(b,Z)=>{w(Z),C==null||C(Z,M.getValues())},onInputChange:(b,Z,t)=>{t==="input"&&setTimeout(()=>{F==null||F(Z,M.getValues())},0)},slotProps:m(r({},P.slotProps||{}),{paper:m(r({},(P.slotProps||{}).paper||{}),{sx:r({border:`1px solid ${v2.neutral[30]}`,boxShadow:"0px 2px 4px rgba(0, 0, 0, 0.15)"},((d=(P.slotProps||{}).paper)==null?void 0:d.sx)||{})})}),value:D||(B?[]:null),options:p,multiple:B,noOptionsText:e1(H1,{children:[k||"Nenhum resultado encontrado",u?e1(H1,{children:[q(a1,{py:1,children:q(Q1,{})}),u]}):null]}),isOptionEqualToValue:(b,Z)=>typeof b=="string"&&typeof Z=="string"?b===Z:typeof b=="object"&&typeof Z=="object"?typeof b.value=="object"&&typeof Z.value=="object"&&b.key!==void 0&&Z.key!==void 0?b.key===Z.key:b.value===Z.value:!1,renderOption:(b,Z)=>typeof Z=="object"?X1("li",m(r({},b),{key:Z.key||Z.value}),e1(a1,{container:!0,direction:"column",children:[q(a1,{item:!0,children:Z.label}),Z.afterLabel&&q(a1,{item:!0,children:Z.afterLabel})]})):X1("li",m(r({},b),{key:Z}),Z),ListboxComponent:i2(function(Z,t){return e1(H1,{children:[q("ul",m(r({},Z),{ref:t})),!!u&&q("div",m(r({},Z),{children:e1(H1,{children:[q(a1,{px:2,py:1,children:q(Q1,{})}),u]})}),"searchable-footer")]})})},P),{renderInput:b=>q(h2,m(r(r({error:!!H,placeholder:y},b),x),{inputRef:_}))}),c),q(U,{name:c,disableIcon:S})]})}})},m2=e2(d2);import{forwardRef as u2,memo as M2}from"react";import{Controller as H2,useFormContext as f2}from"react-hook-form";import{isObject as V2,isEmpty as g2}from"lodash";import{Grid as r1,Autocomplete as L2,TextField as y2}from"@mui/material";import{LIcon as V1,Tooltip as b2,Button as x2,Divider as C2}from"@s_mart/core";import{colorPalette as F2}from"@s_mart/tokens";import{toRem as i0}from"@s_mart/utils";import{toRem as f1}from"@s_mart/utils";import Z2 from"@emotion/styled";import{css as c0}from"@emotion/react";var l0=c0`
|
|
1
|
+
var Z0=Object.create;var x1=Object.defineProperty,p0=Object.defineProperties,u0=Object.getOwnPropertyDescriptor,M0=Object.getOwnPropertyDescriptors,H0=Object.getOwnPropertyNames,H1=Object.getOwnPropertySymbols,f0=Object.getPrototypeOf,C1=Object.prototype.hasOwnProperty,I1=Object.prototype.propertyIsEnumerable;var B1=(c,a,n)=>a in c?x1(c,a,{enumerable:!0,configurable:!0,writable:!0,value:n}):c[a]=n,r=(c,a)=>{for(var n in a||(a={}))C1.call(a,n)&&B1(c,n,a[n]);if(H1)for(var n of H1(a))I1.call(a,n)&&B1(c,n,a[n]);return c},Z=(c,a)=>p0(c,M0(a));var T=(c,a)=>{var n={};for(var s in c)C1.call(c,s)&&a.indexOf(s)<0&&(n[s]=c[s]);if(c!=null&&H1)for(var s of H1(c))a.indexOf(s)<0&&I1.call(c,s)&&(n[s]=c[s]);return n};var E1=(c,a)=>()=>(a||c((a={exports:{}}).exports,a),a.exports);var V0=(c,a,n,s)=>{if(a&&typeof a=="object"||typeof a=="function")for(let i of H0(a))!C1.call(c,i)&&i!==n&&x1(c,i,{get:()=>a[i],enumerable:!(s=u0(a,i))||s.enumerable});return c};var G1=(c,a,n)=>(n=c!=null?Z0(f0(c)):{},V0(a||!c||!c.__esModule?x1(n,"default",{value:c,enumerable:!0}):n,c));var o0=E1((P1,T1)=>{(function(c,a){typeof P1=="object"&&typeof T1!="undefined"?T1.exports=a():typeof define=="function"&&define.amd?define(a):(c=typeof globalThis!="undefined"?globalThis:c||self).dayjs=a()})(P1,function(){"use strict";var c=1e3,a=6e4,n=36e5,s="millisecond",i="second",g="minute",u="hour",x="day",A="week",M="month",B="quarter",L="year",y="date",C="Invalid Date",F=/^(\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,P={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(t){var l=["th","st","nd","rd"],e=t%100;return"["+t+(l[(e-20)%10]||l[e]||l[0])+"]"}},$=function(t,l,e){var d=String(t);return!d||d.length>=l?t:""+Array(l+1-d.length).join(e)+t},k={s:$,z:function(t){var l=-t.utcOffset(),e=Math.abs(l),d=Math.floor(e/60),o=e%60;return(l<=0?"+":"-")+$(d,2,"0")+":"+$(o,2,"0")},m:function t(l,e){if(l.date()<e.date())return-t(e,l);var d=12*(e.year()-l.year())+(e.month()-l.month()),o=l.clone().add(d,M),V=e-o<0,h=l.clone().add(d+(V?-1:1),M);return+(-(d+(e-o)/(V?o-h:h-o))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(t){return{M,y:L,w:A,d:x,D:y,h:u,m:g,s:i,ms:s,Q:B}[t]||String(t||"").toLowerCase().replace(/s$/,"")},u:function(t){return t===void 0}},H="en",f={};f[H]=P;var w=function(t){return t instanceof b},D=function t(l,e,d){var o;if(!l)return H;if(typeof l=="string"){var V=l.toLowerCase();f[V]&&(o=V),e&&(f[V]=e,o=V);var h=l.split("-");if(!o&&h.length>1)return t(h[0])}else{var m=l.name;f[m]=l,o=m}return!d&&o&&(H=o),o||!d&&H},_=function(t,l){if(w(t))return t.clone();var e=typeof l=="object"?l:{};return e.date=t,e.args=arguments,new b(e)},v=k;v.l=D,v.i=w,v.w=function(t,l){return _(t,{locale:l.$L,utc:l.$u,x:l.$x,$offset:l.$offset})};var b=function(){function t(e){this.$L=D(e.locale,null,!0),this.parse(e)}var l=t.prototype;return l.parse=function(e){this.$d=function(d){var o=d.date,V=d.utc;if(o===null)return new Date(NaN);if(v.u(o))return new Date;if(o instanceof Date)return new Date(o);if(typeof o=="string"&&!/Z$/i.test(o)){var h=o.match(F);if(h){var m=h[2]-1||0,I=(h[7]||"0").substring(0,3);return V?new Date(Date.UTC(h[1],m,h[3]||1,h[4]||0,h[5]||0,h[6]||0,I)):new Date(h[1],m,h[3]||1,h[4]||0,h[5]||0,h[6]||0,I)}}return new Date(o)}(e),this.$x=e.x||{},this.init()},l.init=function(){var e=this.$d;this.$y=e.getFullYear(),this.$M=e.getMonth(),this.$D=e.getDate(),this.$W=e.getDay(),this.$H=e.getHours(),this.$m=e.getMinutes(),this.$s=e.getSeconds(),this.$ms=e.getMilliseconds()},l.$utils=function(){return v},l.isValid=function(){return this.$d.toString()!==C},l.isSame=function(e,d){var o=_(e);return this.startOf(d)<=o&&o<=this.endOf(d)},l.isAfter=function(e,d){return _(e)<this.startOf(d)},l.isBefore=function(e,d){return this.endOf(d)<_(e)},l.$g=function(e,d,o){return v.u(e)?this[d]:this.set(o,e)},l.unix=function(){return Math.floor(this.valueOf()/1e3)},l.valueOf=function(){return this.$d.getTime()},l.startOf=function(e,d){var o=this,V=!!v.u(d)||d,h=v.p(e),m=function(e1,j){var X=v.w(o.$u?Date.UTC(o.$y,j,e1):new Date(o.$y,j,e1),o);return V?X:X.endOf(x)},I=function(e1,j){return v.w(o.toDate()[e1].apply(o.toDate("s"),(V?[0,0,0,0]:[23,59,59,999]).slice(j)),o)},O=this.$W,z=this.$M,W=this.$D,h1="set"+(this.$u?"UTC":"");switch(h){case L:return V?m(1,0):m(31,11);case M:return V?m(1,z):m(0,z+1);case A:var a1=this.$locale().weekStart||0,v1=(O<a1?O+7:O)-a1;return m(V?W-v1:W+(6-v1),z);case x:case y:return I(h1+"Hours",0);case u:return I(h1+"Minutes",1);case g:return I(h1+"Seconds",2);case i:return I(h1+"Milliseconds",3);default:return this.clone()}},l.endOf=function(e){return this.startOf(e,!1)},l.$set=function(e,d){var o,V=v.p(e),h="set"+(this.$u?"UTC":""),m=(o={},o[x]=h+"Date",o[y]=h+"Date",o[M]=h+"Month",o[L]=h+"FullYear",o[u]=h+"Hours",o[g]=h+"Minutes",o[i]=h+"Seconds",o[s]=h+"Milliseconds",o)[V],I=V===x?this.$D+(d-this.$W):d;if(V===M||V===L){var O=this.clone().set(y,1);O.$d[m](I),O.init(),this.$d=O.set(y,Math.min(this.$D,O.daysInMonth())).$d}else m&&this.$d[m](I);return this.init(),this},l.set=function(e,d){return this.clone().$set(e,d)},l.get=function(e){return this[v.p(e)]()},l.add=function(e,d){var o,V=this;e=Number(e);var h=v.p(d),m=function(z){var W=_(V);return v.w(W.date(W.date()+Math.round(z*e)),V)};if(h===M)return this.set(M,this.$M+e);if(h===L)return this.set(L,this.$y+e);if(h===x)return m(1);if(h===A)return m(7);var I=(o={},o[g]=a,o[u]=n,o[i]=c,o)[h]||1,O=this.$d.getTime()+e*I;return v.w(O,this)},l.subtract=function(e,d){return this.add(-1*e,d)},l.format=function(e){var d=this,o=this.$locale();if(!this.isValid())return o.invalidDate||C;var V=e||"YYYY-MM-DDTHH:mm:ssZ",h=v.z(this),m=this.$H,I=this.$m,O=this.$M,z=o.weekdays,W=o.months,h1=o.meridiem,a1=function(j,X,d1,M1){return j&&(j[X]||j(d,V))||d1[X].slice(0,M1)},v1=function(j){return v.s(m%12||12,j,"0")},e1=h1||function(j,X,d1){var M1=j<12?"AM":"PM";return d1?M1.toLowerCase():M1};return V.replace(S,function(j,X){return X||function(d1){switch(d1){case"YY":return String(d.$y).slice(-2);case"YYYY":return v.s(d.$y,4,"0");case"M":return O+1;case"MM":return v.s(O+1,2,"0");case"MMM":return a1(o.monthsShort,O,W,3);case"MMMM":return a1(W,O);case"D":return d.$D;case"DD":return v.s(d.$D,2,"0");case"d":return String(d.$W);case"dd":return a1(o.weekdaysMin,d.$W,z,2);case"ddd":return a1(o.weekdaysShort,d.$W,z,3);case"dddd":return z[d.$W];case"H":return String(m);case"HH":return v.s(m,2,"0");case"h":return v1(1);case"hh":return v1(2);case"a":return e1(m,I,!0);case"A":return e1(m,I,!1);case"m":return String(I);case"mm":return v.s(I,2,"0");case"s":return String(d.$s);case"ss":return v.s(d.$s,2,"0");case"SSS":return v.s(d.$ms,3,"0");case"Z":return h}return null}(j)||h.replace(":","")})},l.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},l.diff=function(e,d,o){var V,h=this,m=v.p(d),I=_(e),O=(I.utcOffset()-this.utcOffset())*a,z=this-I,W=function(){return v.m(h,I)};switch(m){case L:V=W()/12;break;case M:V=W();break;case B:V=W()/3;break;case A:V=(z-O)/6048e5;break;case x:V=(z-O)/864e5;break;case u:V=z/n;break;case g:V=z/a;break;case i:V=z/c;break;default:V=z}return o?V:v.a(V)},l.daysInMonth=function(){return this.endOf(M).$D},l.$locale=function(){return f[this.$L]},l.locale=function(e,d){if(!e)return this.$L;var o=this.clone(),V=D(e,d,!0);return V&&(o.$L=V),o},l.clone=function(){return v.w(this.$d,this)},l.toDate=function(){return new Date(this.valueOf())},l.toJSON=function(){return this.isValid()?this.toISOString():null},l.toISOString=function(){return this.$d.toISOString()},l.toString=function(){return this.$d.toUTCString()},t}(),p=b.prototype;return _.prototype=p,[["$ms",s],["$s",i],["$m",g],["$H",u],["$W",x],["$M",M],["$y",L],["$D",y]].forEach(function(t){p[t[1]]=function(l){return this.$g(l,t[0],t[1])}}),_.extend=function(t,l){return t.$i||(t(l,b,_),t.$i=!0),_},_.locale=D,_.isDayjs=w,_.unix=function(t){return _(1e3*t)},_.en=f[H],_.Ls=f,_.p={},_})});var _1=E1((D1,$1)=>{(function(c,a){typeof D1=="object"&&typeof $1!="undefined"?$1.exports=a(o0()):typeof define=="function"&&define.amd?define(["dayjs"],a):(c=typeof globalThis!="undefined"?globalThis:c||self).dayjs_locale_pt_br=a(c.dayjs)})(D1,function(c){"use strict";function a(i){return i&&typeof i=="object"&&"default"in i?i:{default:i}}var n=a(c),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(i){return i+"\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 n.default.locale(s,null,!0),s})});import{FormProvider as g0}from"react-hook-form";import{jsx as R1}from"react/jsx-runtime";function L0(i){var g=i,{children:c,style:a,onSubmit:n}=g,s=T(g,["children","style","onSubmit"]);return R1(g0,Z(r({},s),{children:R1("form",{onSubmit:u=>{u.preventDefault(),u.stopPropagation(),n(u)},style:a,children:c})}))}var F1=L0;import{useEffect as y0}from"react";import{useForm as b0}from"react-hook-form";import{zodResolver as x0}from"@hookform/resolvers/zod";var C0=s=>{var i=s,{disableDefaultValuesUpdate:c,onSubmit:a}=i,n=T(i,["disableDefaultValuesUpdate","onSubmit"]);let g=b0(Z(r({},n),{resolver:n.schema&&x0(n.schema)}));return y0(()=>{c||g.reset(n.defaultValues)},[n.defaultValues,g.reset]),Z(r({},g),{onSubmit:g.handleSubmit(u=>a(u,g))})},k1=C0;import{jsx as A0}from"react/jsx-runtime";function F0(s){var i=s,{children:c,style:a}=i,n=T(i,["children","style"]);let g=k1(n);return A0(F1,Z(r({},g),{style:a,children:typeof c=="function"?c(g):c}))}var k0=F0;import{memo as $0,useState as _0}from"react";import{Controller as B0,useFormContext as I0}from"react-hook-form";import{Grid as S1,InputAdornment as E0,TextField as G0}from"@mui/material";var U1={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 c1={description:"M24 8a16 16 0 0 0 0 32 16 16 0 0 0 0-32Zm0 7.1c1.5 0 2.7 1.2 2.7 2.7 0 1.6-1.2 2.7-2.7 2.7a2.6 2.6 0 0 1-2.7-2.7c0-1.5 1.2-2.7 2.7-2.7Zm3.6 16.4c0 .4-.4.8-.8.8h-5.6a.7.7 0 0 1-.8-.8v-1.6c0-.4.3-.7.8-.7h.7V25h-.7a.7.7 0 0 1-.8-.7v-1.6c0-.4.3-.8.8-.8h4c.5 0 .9.4.9.8v6.5h.7c.4 0 .8.3.8.7v1.6Z",id:"line-info-circle-solid"};var q1={description:"m25.5 17 5.5 5.5-12 12-4.9.5a1 1 0 0 1-1-1.1l.5-5L25.5 17Zm8.9-.8-2.6-2.6a2 2 0 0 0-2.9 0L26.5 16l5.5 5.5 2.4-2.4a2 2 0 0 0 0-3Z",id:"line-pen-solid"};var A1={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 s1 from"@s_mart/masks";import{Typography as z1}from"@mui/material";import{toRem as S0}from"@s_mart/utils";import{jsx as Y1,jsxs as w0}from"react/jsx-runtime";var G=({label:c,required:a,regular:n})=>w0("span",{style:{display:"flex",alignItems:"center",gap:S0(2)},children:[Y1(z1,{variant:"caption",fontWeight:n?400:700,style:{display:"flex",alignItems:"center"},children:c}),a&&Y1(z1,{variant:"caption",fontWeight:900,color:"error",children:"*"})]});import{useFormContext as P0}from"react-hook-form";import{Indicator as T0}from"@s_mart/core";var Y=(c,a)=>a.replace(/[[\]]/g,"").split(".").reduce((s,i)=>s==null?void 0:s[i],c);import{jsx as D0}from"react/jsx-runtime";var R=({name:c,disableIcon:a})=>{var i;let n=P0(),s=Y((i=n==null?void 0:n.formState)==null?void 0:i.errors,c);return s?D0(T0,{severity:"error",icon:a?!1:void 0,children:s==null?void 0:s.message}):null};import{LIcon as j1,Tooltip as R0}from"@s_mart/core";import{jsx as N,jsxs as W1}from"react/jsx-runtime";var U0=S=>{var P=S,{name:c,rules:a,defaultValue:n,shouldUnregister:s,label:i,required:g,mask:u,variant:x="outlined",info:A,parse:M,inputMode:B,format:L,onInputChange:y,disableIconError:C}=P,F=T(P,["name","rules","defaultValue","shouldUnregister","label","required","mask","variant","info","parse","inputMode","format","onInputChange","disableIconError"]);let $=I0();if(!$)throw new Error("Para usar o <TextField /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let[k,H]=_0(!1),f=v=>{var p;let b=v;return L&&(b=L(v)),u?(p=s1==null?void 0:s1[u])==null?void 0:p.format(b):b},w=v=>{var p;let b=v;return M&&(b=M(v)),u?(p=s1==null?void 0:s1[u])==null?void 0:p.parse(b):b},D=v=>{if(!v||u!=="porcentagem"&&u!=="porcentagem0")return;v==null||v.stopPropagation();let b=(v==null?void 0:v.target).value;if(b){let p=String(b);if(p.length>0){let t=p.indexOf("%");t>-1&&(v.currentTarget.selectionEnd=t)}}},_=Y($.formState.errors,c);return N(B0,{control:$.control,name:c,rules:a,defaultValue:n,shouldUnregister:s,render:({field:{value:v,onChange:b,ref:p}})=>W1(S1,{display:"flex",flexDirection:"column",children:[W1("div",{style:{display:"flex"},children:[i&&N(S1,{item:!0,children:N(G,{label:i,required:g})}),A&&N(S1,{item:!0,children:N(R0,{title:A,placement:"top",children:N("div",{style:{width:"fit-content"},children:N(j1,{icon:c1,color:"#757575"})})})})]}),N(G0,Z(r({variant:x,defaultValue:n,value:f(v||(v!=0?"":v)),onChange:t=>{var e;let l=w((e=t==null?void 0:t.target)==null?void 0:e.value);b(l),y==null||y(l,$.getValues())},error:!!_},F),{type:F.type==="password"?k?"text":"password":F.type,autoComplete:F.autoComplete||"off",inputProps:r({inputMode:B},F.inputProps),InputProps:r({onKeyDown:D,inputRef:p,endAdornment:F.type==="password"&&N(E0,{position:"start",onClick:()=>H(!k),style:{cursor:"pointer"},children:N(j1,{icon:k?U1:O1,size:"24px",removeMargin:!0})})},F.InputProps)}),c),N(R,{name:c,disableIcon:C})]})})},O0=$0(U0);import{memo as q0,useState as z0}from"react";import{Controller as Y0,useFormContext as j0}from"react-hook-form";import{Divider as W0,IconButton as N0,LIcon as J1,Tooltip as J0}from"@s_mart/core";var N1={description:"m27.4 24.4 7-7c.4-.4.4-1 0-1.5l-1.6-1.6a1 1 0 0 0-1.5 0l-7 7-7-7a1 1 0 0 0-1.4 0l-1.6 1.6a1 1 0 0 0 0 1.5l7 7-7 7a1 1 0 0 0 0 1.4l1.6 1.6c.4.4 1 .4 1.5 0l7-7 7 7c.3.4 1 .4 1.4 0l1.6-1.6c.4-.4.4-1 0-1.5l-7-7Z",id:"line-times-regular"};import{colorPalette as K0}from"@s_mart/tokens";import{Grid as i1,Select as Q0,MenuItem as K1,useTheme as X0}from"@mui/material";import{Fragment as a2,jsx as U,jsxs as m1}from"react/jsx-runtime";var c2=P=>{var $=P,{name:c,rules:a,defaultValue:n,shouldUnregister:s,label:i,required:g,options:u,placeholder:x,clearable:A,disableOnChangeForm:M=!1,multiple:B,info:L,footer:y,onChange:C,disableIconError:F}=$,S=T($,["name","rules","defaultValue","shouldUnregister","label","required","options","placeholder","clearable","disableOnChangeForm","multiple","info","footer","onChange","disableIconError"]);let k=j0(),{palette:H}=X0(),[f,w]=z0(!1);if(!k)throw new Error("Para usar o <Select /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let D=Y(k.formState.errors,c);return console.warn=()=>{},U(Y0,{control:k.control,name:c,rules:a,defaultValue:n,shouldUnregister:s,render:({field:{value:_,onChange:v,ref:b}})=>m1(i1,{display:"flex",flexDirection:"column",children:[m1("div",{style:{display:"flex"},children:[i&&U(i1,{item:!0,children:U(G,{label:i,required:g})}),L&&U(i1,{item:!0,children:U(J0,{title:L,placement:"top",children:U("div",{style:{width:"fit-content"},children:U(J1,{icon:c1,color:"#757575"})})})})]}),m1(Q0,Z(r({open:f,onOpen:()=>w(!0),onClose:()=>w(!1),displayEmpty:!!x,variant:"outlined",autoComplete:"off",value:_?_||"":B?[]:"",renderValue:p=>{if(p.label)return p.label;if(x)return U("p",{style:{color:H.grey[400]},children:x})},multiple:B,onChange:p=>{!M&&v(p.target.value),C&&C(p.target.value,k.getValues())},error:!!D,size:S.size||"medium",inputRef:b},S),{endAdornment:m1(a2,{children:[S.endAdornment,!!(A&&_)&&U(N0,{variant:"text",color:"neutral",size:"small",sx:{borderRadius:"50%",position:"absolute",right:"2rem"},style:{padding:0},"aria-label":"Clear",title:"Clear",onClick:()=>{!M&&v(null),C&&C(null,k.getValues())},children:U(J1,{icon:N1,color:K0.neutral[100],size:"25px",removeMargin:!0})})]}),children:[x&&U(K1,{disabled:!0,value:"",children:U("p",{style:{color:H.grey[400]},children:x})}),u==null?void 0:u.map((p,t)=>U(K1,{value:p,children:m1(i1,{container:!0,direction:"column",children:[U(i1,{item:!0,children:p.label}),p.afterLabel&&U(i1,{item:!0,children:p.afterLabel})]})},t)),y&&[U(i1,{px:2,py:1,children:U(W0,{})},"footer-divider"),U("div",{children:y({closeSelect:()=>w(!1)})},"footer-content")]]}),c),U(R,{name:c,disableIcon:F})]})})},l2=q0(c2);import{forwardRef as e2,memo as i2}from"react";import{Controller as r2,useFormContext as o2}from"react-hook-form";import{Grid as l1,Autocomplete as n2,TextField as h2}from"@mui/material";import{Divider as Q1,LIcon as s2,Tooltip as t2}from"@s_mart/core";import{colorPalette as v2}from"@s_mart/tokens";import{Fragment as f1,jsx as q,jsxs as r1}from"react/jsx-runtime";import{createElement as X1}from"react";var d2=$=>{var k=$,{name:c,rules:a,defaultValue:n,shouldUnregister:s,label:i,required:g,options:u,textFieldProps:x,noOptionsText:A,footer:M,multiple:B,info:L,placeholder:y,onChange:C,onInputChange:F,disableIconError:S}=k,P=T(k,["name","rules","defaultValue","shouldUnregister","label","required","options","textFieldProps","noOptionsText","footer","multiple","info","placeholder","onChange","onInputChange","disableIconError"]);let H=o2();if(!H)throw new Error("Para usar o <Searchable /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let f=Y(H.formState.errors,c);return console.warn=()=>{},q(r2,{control:H.control,name:c,rules:a,defaultValue:n,shouldUnregister:s,render:({field:{onChange:w,value:D,ref:_}})=>{var v;return r1(l1,{display:"flex",flexDirection:"column",children:[r1("div",{style:{display:"flex"},children:[i&&q(l1,{item:!0,children:q(G,{label:i,required:g})}),L&&q(l1,{item:!0,children:q(t2,{title:L,placement:"top",children:q("div",{style:{width:"fit-content"},children:q(s2,{icon:c1,color:"#757575"})})})})]}),q(n2,Z(r({onChange:(b,p)=>{w(p),C==null||C(p,H.getValues())},onInputChange:(b,p,t)=>{t==="input"&&setTimeout(()=>{F==null||F(p,H.getValues())},0)},slotProps:Z(r({},P.slotProps||{}),{paper:Z(r({},(P.slotProps||{}).paper||{}),{sx:r({border:`1px solid ${v2.neutral[30]}`,boxShadow:"0px 2px 4px rgba(0, 0, 0, 0.15)"},((v=(P.slotProps||{}).paper)==null?void 0:v.sx)||{})})}),value:D||(B?[]:null),options:u,multiple:B,noOptionsText:r1(f1,{children:[A||"Nenhum resultado encontrado",M?r1(f1,{children:[q(l1,{py:1,children:q(Q1,{})}),M]}):null]}),isOptionEqualToValue:(b,p)=>typeof b=="string"&&typeof p=="string"?b===p:typeof b=="object"&&typeof p=="object"?typeof b.value=="object"&&typeof p.value=="object"&&b.key!==void 0&&p.key!==void 0?b.key===p.key:b.value===p.value:!1,renderOption:(b,p)=>typeof p=="object"?X1("li",Z(r({},b),{key:p.key||p.value}),r1(l1,{container:!0,direction:"column",children:[q(l1,{item:!0,children:p.label}),p.afterLabel&&q(l1,{item:!0,children:p.afterLabel})]})):X1("li",Z(r({},b),{key:p}),p),ListboxComponent:e2(function(p,t){return r1(f1,{children:[q("ul",Z(r({},p),{ref:t})),!!M&&q("div",Z(r({},p),{children:r1(f1,{children:[q(l1,{px:2,py:1,children:q(Q1,{})}),M]})}),"searchable-footer")]})})},P),{renderInput:b=>q(h2,Z(r(r({error:!!f,placeholder:y},b),x),{inputRef:_}))}),c),q(R,{name:c,disableIcon:S})]})}})},m2=i2(d2);import{forwardRef as u2,memo as M2}from"react";import{Controller as H2,useFormContext as f2}from"react-hook-form";import{isObject as V2,isEmpty as g2}from"lodash";import{Grid as o1,Autocomplete as L2,TextField as y2}from"@mui/material";import{LIcon as g1,Tooltip as b2,Button as x2,Divider as C2}from"@s_mart/core";import{colorPalette as F2}from"@s_mart/tokens";import{toRem as e0}from"@s_mart/utils";import{toRem as V1}from"@s_mart/utils";import Z2 from"@emotion/styled";import{css as c0}from"@emotion/react";var l0=c0`
|
|
2
2
|
display: flex;
|
|
3
3
|
align-items: center;
|
|
4
4
|
justify-content: center;
|
|
@@ -9,7 +9,7 @@ var Z0=Object.create;var x1=Object.defineProperty,p0=Object.defineProperties,u0=
|
|
|
9
9
|
|
|
10
10
|
.divider {
|
|
11
11
|
width: 1px;
|
|
12
|
-
height: ${
|
|
12
|
+
height: ${V1(20)};
|
|
13
13
|
background-color: ${c.palette.grey[400]};
|
|
14
14
|
}
|
|
15
15
|
|
|
@@ -20,9 +20,9 @@ var Z0=Object.create;var x1=Object.defineProperty,p0=Object.defineProperties,u0=
|
|
|
20
20
|
color: ${c.palette.grey[600]};
|
|
21
21
|
border-radius: 50%;
|
|
22
22
|
|
|
23
|
-
margin: 0 ${
|
|
24
|
-
width: ${
|
|
25
|
-
height: ${
|
|
23
|
+
margin: 0 ${V1(6)};
|
|
24
|
+
width: ${V1(28)};
|
|
25
|
+
height: ${V1(28)};
|
|
26
26
|
|
|
27
27
|
&:hover {
|
|
28
28
|
cursor: pointer;
|
|
@@ -47,22 +47,22 @@ var Z0=Object.create;var x1=Object.defineProperty,p0=Object.defineProperties,u0=
|
|
|
47
47
|
}
|
|
48
48
|
|
|
49
49
|
${({hideAddButton:c,theme:a})=>!c&&p2(a)}
|
|
50
|
-
`;import{Fragment as w1,jsx as E,jsxs as
|
|
50
|
+
`;import{Fragment as w1,jsx as E,jsxs as J}from"react/jsx-runtime";import{createElement as i0}from"react";var k2=f=>{var w=f,{name:c,rules:a,defaultValue:n,shouldUnregister:s,label:i,required:g,options:u,editable:x,footer:A,onEditOption:M,onCreateOption:B,textFieldProps:L,hideAddButton:y,multiple:C,info:F,onChange:S,onInputChange:P,placeholder:$,disableIconError:k}=w,H=T(w,["name","rules","defaultValue","shouldUnregister","label","required","options","editable","footer","onEditOption","onCreateOption","textFieldProps","hideAddButton","multiple","info","onChange","onInputChange","placeholder","disableIconError"]);let D=f2();if(!D)throw new Error("Para usar o <Creatable /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let _=Y(D.formState.errors,c),v=l=>{let e=0;return L!=null&&L.InputProps||(e+=2.5),y||(e+=2.56,b(l)&&(e+=2.56)),H.disableClearable||(e+=1.3),e+"rem"},b=l=>x&&V2(l)&&!g2(l);console.warn=()=>{};let p=l=>{B?B(l):console.error("onCreateOption n\xE3o foi definido")},t=l=>{M?M(l):console.error("onEditOption n\xE3o foi definido")};return E(H2,{control:D.control,name:c,rules:a,defaultValue:n,shouldUnregister:s,render:({field:{value:l,onChange:e,ref:d}})=>{var V;let o=(l==null?void 0:l.label)||(l==null?void 0:l.value)||l;return J(o1,{display:"flex",flexDirection:"column",children:[J("div",{style:{display:"flex"},children:[i&&E(o1,{item:!0,children:E(G,{label:i,required:g})}),F&&E(o1,{item:!0,children:E(b2,{title:F,placement:"top",children:E("div",{style:{width:"fit-content"},children:E(g1,{icon:c1,color:"#757575"})})})})]}),E(a0,{hideAddButton:y,children:E(L2,Z(r({fullWidth:!0,onChange:(h,m)=>{e(m),S==null||S(m,D.getValues())},onInputChange:(h,m,I)=>{I==="input"&&setTimeout(()=>{P==null||P(m,D.getValues())},0)},slotProps:Z(r({},H.slotProps||{}),{paper:Z(r({},(H.slotProps||{}).paper||{}),{sx:r({border:`1px solid ${F2.neutral[30]}`,boxShadow:"0px 2px 4px rgba(0, 0, 0, 0.15)"},((V=(H.slotProps||{}).paper)==null?void 0:V.sx)||{})})}),options:u,value:l||(C?[]:null),multiple:C,noOptionsText:y?void 0:J(x2,{sx:{justifyContent:"flex-start",padding:`${e0(6)} ${e0(-16)}`,margin:0},fullWidth:!0,onClick:()=>p(l),variant:"text",startIcon:E(g1,{icon:A1}),children:["Adicionar ",o&&`"${o}"`]}),isOptionEqualToValue:(h,m)=>m?typeof h=="string"&&typeof m=="string"?h===m:typeof h=="object"&&typeof m=="object"?typeof h.value=="object"&&typeof m.value=="object"&&h.key!==void 0&&m.key!==void 0?h.key===m.key:h.value===m.value:typeof h=="object"&&typeof m=="string":!1,renderOption:(h,m)=>typeof m=="object"?i0("li",Z(r({},h),{key:m.key||m.value}),J(o1,{container:!0,direction:"column",children:[E(o1,{item:!0,children:m.label}),m.afterLabel&&E(o1,{item:!0,children:m.afterLabel})]})):i0("li",Z(r({},h),{key:m}),m),ListboxComponent:u2(function(m,I){return J(w1,{children:[E("ul",Z(r({},m),{ref:I})),!!A&&E("div",Z(r({},m),{children:J(w1,{children:[E(o1,{px:2,py:1,children:E(C2,{})}),A]})}),"creatable-footer")]})})},H),{sx:r({"& div.MuiInputBase-root":{paddingRight:`${v(l)} !important`}},H.sx),renderInput:h=>E(y2,r(Z(r({placeholder:$},h),{error:!!_,InputProps:Z(r({},h.InputProps),{inputRef:d,endAdornment:J("div",{className:"endAdornments",children:[h.InputProps.endAdornment,!y&&J(w1,{children:[b(l)?J("div",{className:"editable",children:[E("div",{className:"divider"}),E("div",{className:"button",onClick:()=>t(l),children:E(g1,{icon:q1,size:"24px",removeMargin:!0})})]}):null,J("div",{className:"creatable",children:[E("div",{className:"divider"}),E("div",{className:"button",onClick:()=>p(l),children:E(g1,{icon:A1,size:"24px",removeMargin:!0})})]})]})]})})}),L))}),c)}),E(R,{name:c,disableIcon:k})]})}})},A2=M2(k2);import{Controller as S2,useFormContext as w2}from"react-hook-form";import{Grid as P2,Checkbox as T2,FormControlLabel as D2}from"@mui/material";import{jsx as Z1,jsxs as B2}from"react/jsx-runtime";var $2=B=>{var L=B,{name:c,rules:a,defaultValue:n,shouldUnregister:s,label:i,labelPlacement:g,required:u,disableIconError:x,onChange:A}=L,M=T(L,["name","rules","defaultValue","shouldUnregister","label","labelPlacement","required","disableIconError","onChange"]);let y=w2();if(!y)throw new Error("Para usar o <Checkbox /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");return Z1(S2,{control:y.control,name:c,rules:a,defaultValue:n,shouldUnregister:s,render:({field:{value:C,onChange:F}})=>B2(P2,{display:"flex",flexDirection:"column",children:[Z1(D2,{control:Z1(T2,r({checked:!!C,value:C!=null?C:"",defaultValue:C,onChange:(S,P)=>{F(S,P),A==null||A(S,P)}},M),c),label:Z1(G,{label:i,required:u,regular:!0}),labelPlacement:g||"end"}),Z1(R,{name:c,disableIcon:x})]})})},_2=$2;import{Controller as I2,useFormContext as E2}from"react-hook-form";import{Grid as G2,Switch as R2,FormControlLabel as U2}from"@mui/material";import{jsx as p1,jsxs as z2}from"react/jsx-runtime";var O2=M=>{var B=M,{name:c,rules:a,defaultValue:n,shouldUnregister:s,label:i,labelPlacement:g,disableIconError:u,onChange:x}=B,A=T(B,["name","rules","defaultValue","shouldUnregister","label","labelPlacement","disableIconError","onChange"]);let L=E2();if(!L)throw new Error("Para usar o <Switch /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");return p1(I2,{control:L.control,name:c,rules:a,defaultValue:n,shouldUnregister:s,render:({field:{value:y,onChange:C}})=>z2(G2,{display:"flex",flexDirection:"column",children:[p1(U2,{control:p1(R2,r({value:y!=null?y:"",checked:y!=null?y:!1,defaultValue:y,onChange:(F,S)=>{C(F,S),x==null||x(F,S)}},A),c),label:p1(G,{label:i}),labelPlacement:g||"end"}),p1(R,{name:c,disableIcon:u})]})})},q2=O2;import{Grid as Y2,Radio as j2,FormControlLabel as W2}from"@mui/material";import{jsx as L1}from"react/jsx-runtime";var N2=s=>{var i=s,{label:c,labelPlacement:a}=i,n=T(i,["label","labelPlacement"]);return L1(Y2,{display:"flex",flexDirection:"column",children:L1(W2,{control:L1(j2,r({},n)),label:L1(G,{label:c}),labelPlacement:a||"end"})})},J2=N2;import{Controller as K2,useFormContext as Q2}from"react-hook-form";import{Grid as X2,RadioGroup as c3}from"@mui/material";import{jsx as y1,jsxs as e3}from"react/jsx-runtime";var l3=B=>{var L=B,{name:c,rules:a,defaultValue:n,shouldUnregister:s,label:i,required:g,children:u,orientation:x="row",disableIconError:A}=L,M=T(L,["name","rules","defaultValue","shouldUnregister","label","required","children","orientation","disableIconError"]);let y=Q2();if(!y)throw new Error("Para usar o <RadioGroup /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");return y1(K2,{control:y.control,name:c,rules:a,defaultValue:n,shouldUnregister:s,render:({field:{value:C,onChange:F}})=>e3(X2,{display:"flex",flexDirection:"column",children:[i&&y1(G,{label:i,required:g}),y1(c3,Z(r({value:C||"",name:c},M),{onChange:S=>{var P,$;($=M==null?void 0:M.onChange)==null||$.call(M,S,(P=S.target)==null?void 0:P.value),F(S)},style:{display:"flex",flexDirection:x},children:u}),c),y1(R,{name:c,disableIcon:A})]})})},a3=l3;import{Controller as i3,useFormContext as r3}from"react-hook-form";import{Slider as o3}from"@mui/material";import{jsx as r0}from"react/jsx-runtime";var n3=g=>{var u=g,{name:c,rules:a,defaultValue:n,shouldUnregister:s}=u,i=T(u,["name","rules","defaultValue","shouldUnregister"]);let x=r3();if(!x)throw new Error("Para usar o <Slider /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");return r0(i3,{control:x.control,name:c,rules:a,defaultValue:n,shouldUnregister:s,render:({field:{value:A,onChange:M}})=>r0(o3,r({value:A||(i==null?void 0:i.min)||0,onChange:M,valueLabelDisplay:"auto"},i),c)})},h3=n3;var s0=G1(_1());import{memo as m3}from"react";import{Controller as Z3,useFormContext as p3}from"react-hook-form";import{Grid as u3}from"@s_mart/core";import{composeValidators as M3,date as h0}from"@s_mart/rules";import{TextField as H3}from"@mui/material";import{DatePicker as f3}from"@mui/x-date-pickers/DatePicker";import{AdapterDayjs as V3}from"@mui/x-date-pickers/AdapterDayjs";import{LocalizationProvider as g3}from"@mui/x-date-pickers/LocalizationProvider";import{ptBR as L3}from"@mui/x-date-pickers/locales/ptBR";import s3 from"@emotion/styled";import{IconButton as t3}from"@mui/material";import{toRem as K}from"@s_mart/utils";var v3=c=>{switch(c){case"small":return K(16);default:case"medium":return K(20);case"large":return K(24)}},d3=c=>{switch(c){case"small":return`${K(2)} ${K(8)}`;default:case"medium":return`${K(6)} ${K(8)}`;case"large":return`${K(10)}`}},n0=s3(t3)`
|
|
51
51
|
margin: 0px;
|
|
52
52
|
|
|
53
53
|
padding: ${({size:c})=>d3(c)};
|
|
54
|
-
border-radius: 0 ${
|
|
54
|
+
border-radius: 0 ${K(4)} ${K(4)} 0;
|
|
55
55
|
|
|
56
56
|
svg {
|
|
57
57
|
width: ${({size:c})=>v3(c)} !important;
|
|
58
58
|
}
|
|
59
|
-
`;import{jsx as
|
|
59
|
+
`;import{jsx as u1,jsxs as C3}from"react/jsx-runtime";import{createElement as x3}from"react";var y3=L=>{var y=L,{rules:c,name:a,defaultValue:n,shouldUnregister:s,datePickerProps:i,label:g,required:u,placeholder:x,disabled:A,disableIconError:M}=y,B=T(y,["rules","name","defaultValue","shouldUnregister","datePickerProps","label","required","placeholder","disabled","disableIconError"]);let C=p3();if(!C)throw new Error("Para usar o <DataPicker /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let F=Y(C.formState.errors,a),S=(i==null?void 0:i.format)||"DD/MM/YYYY",P=c?M3([h0(S),c]):h0(S);return u1(g3,{dateAdapter:V3,adapterLocale:s0.default,localeText:L3.components.MuiLocalizationProvider.defaultProps.localeText,children:u1(Z3,{control:C.control,name:a,rules:P,defaultValue:n,shouldUnregister:s,render:({field:{value:$,onChange:k,ref:H}})=>C3(u3,{display:"flex",flexDirection:"column",children:[g&&u1(G,{label:g,required:u}),x3(f3,Z(r({},i),{key:a,value:$!=null?$:null,format:S,onChange:(f,w)=>{var D;k(f,w),(D=i==null?void 0:i.onChange)==null||D.call(i,f,w)},disabled:A,slots:{textField:H3,openPickerButton:f=>u1(n0,Z(r({},f),{size:B.size}))},slotProps:{textField:f=>{var w;return Z(r(Z(r({variant:"outlined"},f),{error:!!F}),B),{inputProps:Z(r({},f.inputProps),{placeholder:x||((w=f.inputProps)==null?void 0:w.placeholder)}),InputProps:Z(r({},f.InputProps),{inputRef(D){H(D),typeof f.inputRef=="function"&&f.inputRef(D)}})})}}})),u1(R,{name:a,disableIcon:M})]})})})},b3=m3(y3);var d0=G1(_1());import{memo as w3}from"react";import{Controller as P3,useFormContext as T3}from"react-hook-form";import{Grid as D3}from"@s_mart/core";import{composeValidators as $3,time as v0}from"@s_mart/rules";import{TextField as _3}from"@mui/material";import{TimePicker as B3}from"@mui/x-date-pickers/TimePicker";import{AdapterDayjs as I3}from"@mui/x-date-pickers/AdapterDayjs";import{LocalizationProvider as E3}from"@mui/x-date-pickers/LocalizationProvider";import{ptBR as G3}from"@mui/x-date-pickers/locales/ptBR";import F3 from"@emotion/styled";import{IconButton as k3}from"@mui/material";import{toRem as Q}from"@s_mart/utils";var A3=c=>{switch(c){case"small":return Q(16);default:case"medium":return Q(20);case"large":return Q(24)}},S3=c=>{switch(c){case"small":return`${Q(2)} ${Q(8)}`;default:case"medium":return`${Q(6)} ${Q(8)}`;case"large":return`${Q(10)}`}},t0=F3(k3)`
|
|
60
60
|
margin: 0px;
|
|
61
61
|
|
|
62
62
|
padding: ${({size:c})=>S3(c)};
|
|
63
|
-
border-radius: 0 ${
|
|
63
|
+
border-radius: 0 ${Q(4)} ${Q(4)} 0;
|
|
64
64
|
|
|
65
65
|
svg {
|
|
66
|
-
width: ${({size:c})=>
|
|
66
|
+
width: ${({size:c})=>A3(c)} !important;
|
|
67
67
|
}
|
|
68
|
-
`;import{jsx as
|
|
68
|
+
`;import{jsx as t1,jsxs as O3}from"react/jsx-runtime";var R3=L=>{var y=L,{rules:c,defaultValue:a,shouldUnregister:n,name:s,required:i,label:g,timePickerProps:u,placeholder:x,disabled:A,disableIconError:M}=y,B=T(y,["rules","defaultValue","shouldUnregister","name","required","label","timePickerProps","placeholder","disabled","disableIconError"]);let C=T3();if(!C)throw new Error("Para usar o <TimePicker /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let F=Y(C.formState.errors,s),S=(u==null?void 0:u.format)||"HH:mm",P=c?$3([v0(S),c]):v0(S);return t1(E3,{dateAdapter:I3,adapterLocale:d0.default,localeText:G3.components.MuiLocalizationProvider.defaultProps.localeText,children:t1(P3,{control:C.control,name:s,rules:P,defaultValue:a,shouldUnregister:n,render:({field:{value:$,onChange:k,ref:H}})=>O3(D3,{display:"flex",flexDirection:"column",children:[g&&t1(G,{label:g,required:i}),t1(B3,Z(r({ampm:!1,format:S,value:$!=null?$:null,disabled:A},u),{onChange:(f,w)=>{var D;k(f,w),(D=u==null?void 0:u.onChange)==null||D.call(u,f,w)},slots:{textField:_3,openPickerButton:f=>t1(t0,Z(r({},f),{size:B.size}))},slotProps:{textField:f=>{var w;return Z(r(Z(r({variant:"outlined"},f),{error:!!F}),B),{inputProps:Z(r({},f.inputProps),{placeholder:x||((w=f.inputProps)==null?void 0:w.placeholder)}),InputProps:Z(r({},f.InputProps),{inputRef(D){H(D),typeof f.inputRef=="function"&&f.inputRef(D)}})})}}}),s),t1(R,{name:s,disableIcon:M})]})})})},U3=w3(R3);import{memo as q3}from"react";import{Controller as z3,useFormContext as Y3}from"react-hook-form";import{Autocomplete as j3,TextField as W3}from"@mui/material";import{Grid as b1}from"@s_mart/core";import{colorPalette as N3}from"@s_mart/tokens";import{jsx as n1,jsxs as m0}from"react/jsx-runtime";import{createElement as Q3}from"react";var J3=y=>{var C=y,{name:c,defaultValue:a,rules:n,shouldUnregister:s,label:i,required:g,noOptionsText:u,placeholder:x,onInputChange:A,onChange:M,disableIconError:B}=C,L=T(C,["name","defaultValue","rules","shouldUnregister","label","required","noOptionsText","placeholder","onInputChange","onChange","disableIconError"]);let F=Y3();if(!F)throw new Error("Para usar o <Autocomplete /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let S=Y(F.formState.errors,c);return console.warn=()=>{},n1(z3,{name:c,control:F.control,defaultValue:a,rules:n,shouldUnregister:s,render:({field:P})=>{var $;return m0(b1,{display:"flex",flexDirection:"column",children:[i&&n1(G,{label:i,required:g}),n1(j3,Z(r({onChange:(k,H)=>{P.onChange(H),M==null||M(H,F.getValues())},onInputChange:(k,H,f)=>{f==="input"&&(P.onChange(H),setTimeout(()=>{A==null||A(H,F.getValues())},0))},slotProps:Z(r({},L.slotProps||{}),{paper:Z(r({},(L.slotProps||{}).paper||{}),{sx:r({border:`1px solid ${N3.neutral[30]}`,boxShadow:"0px 2px 4px rgba(0, 0, 0, 0.15)"},(($=(L.slotProps||{}).paper)==null?void 0:$.sx)||{})})}),isOptionEqualToValue:(k,H)=>k.value===H.value,renderOption:(k,H)=>Q3("li",Z(r({},k),{key:H.key||H.value,onClick:f=>{var w;(w=k.onClick)==null||w.call(k,f),P.onChange(H)}}),m0(b1,{container:!0,direction:"column",children:[n1(b1,{item:!0,children:H.label}),H.afterLabel&&n1(b1,{item:!0,children:H.afterLabel})]})),value:P.value||null,noOptionsText:u||"Nenhuma op\xE7\xE3o encontrada"},L),{renderInput:k=>{var H,f,w;return n1(W3,Z(r(r({placeholder:x},k),L.textFieldProps),{error:!!S,InputProps:Z(r(r({},k.InputProps),(H=L.textFieldProps)==null?void 0:H.InputProps),{inputRef:P.ref,inputProps:r(r({},k.inputProps),(w=(f=L.textFieldProps)==null?void 0:f.InputProps)==null?void 0:w.inputProps)})}))}}),c),n1(R,{name:c,disableIcon:B})]})}})},K3=q3(J3);export{K3 as Autocomplete,_2 as Checkbox,A2 as Creatable,b3 as DatePicker,k0 as Form,F1 as FormProvider,J2 as RadioButton,a3 as RadioGroup,m2 as Searchable,l2 as Select,h3 as Slider,q2 as Switch,O0 as TextField,U3 as TimePicker,k1 as useForm};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@s_mart/form",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.3.0",
|
|
4
4
|
"main": "./dist/index.js",
|
|
5
5
|
"module": "./dist/index.mjs",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -22,16 +22,16 @@
|
|
|
22
22
|
"@s_mart/tokens": "*",
|
|
23
23
|
"@s_mart/typed": "*",
|
|
24
24
|
"@s_mart/utils": "*",
|
|
25
|
-
"@types/react": "^18.2.
|
|
26
|
-
"@types/react-dom": "^18.2.
|
|
25
|
+
"@types/react": "^18.2.21",
|
|
26
|
+
"@types/react-dom": "^18.2.7",
|
|
27
27
|
"lodash": "^4.17.21",
|
|
28
28
|
"tsup": "^6.7.0",
|
|
29
|
-
"typescript": "^5.
|
|
29
|
+
"typescript": "^5.2.2"
|
|
30
30
|
},
|
|
31
31
|
"peerDependencies": {
|
|
32
32
|
"@emotion/react": ">=11.10.8",
|
|
33
33
|
"@emotion/styled": ">=11.10.8",
|
|
34
|
-
"@mui/material": ">=5.
|
|
34
|
+
"@mui/material": ">=5.14.6",
|
|
35
35
|
"@mui/x-date-pickers": ">=6.3.0",
|
|
36
36
|
"@s_mart/core": "*",
|
|
37
37
|
"@s_mart/masks": "*",
|
|
@@ -40,16 +40,16 @@
|
|
|
40
40
|
"@s_mart/typed": "*",
|
|
41
41
|
"@s_mart/utils": "*",
|
|
42
42
|
"@types/react": ">=18.2.5",
|
|
43
|
-
"@types/react-dom": ">=18.2.
|
|
43
|
+
"@types/react-dom": ">=18.2.7",
|
|
44
44
|
"react": ">=18.2.0",
|
|
45
45
|
"react-dom": ">=18.2.0",
|
|
46
46
|
"react-hook-form": ">=7.36.1",
|
|
47
|
-
"typescript": ">=5.
|
|
47
|
+
"typescript": ">=5.2.2",
|
|
48
48
|
"zod": ">=3.21.4"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
|
-
"@s_mart/eslint": "*",
|
|
52
51
|
"@s_mart/tsconfig": "*",
|
|
53
|
-
"eslint": "^8.
|
|
52
|
+
"eslint": "^8.47.0",
|
|
53
|
+
"eslint-config-s_mart": "*"
|
|
54
54
|
}
|
|
55
55
|
}
|