@s_mart/form 4.2.2 → 4.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +13 -13
- package/dist/index.js +15 -15
- 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,r)=>a in c?y1(c,a,{enumerable:!0,configurable:!0,writable:!0,value:r}):c[a]=r,i=(c,a)=>{for(var r in a||(a={}))X1.call(a,r)&&m0(c,r,a[r]);if(P1)for(var r of P1(a))Z0.call(a,r)&&m0(c,r,a[r]);return c},d=(c,a)=>b2(c,C2(a));var B=(c,a)=>{var r={};for(var s in c)X1.call(c,s)&&a.indexOf(s)<0&&(r[s]=c[s]);if(c!=null&&P1)for(var s of P1(c))a.indexOf(s)<0&&Z0.call(c,s)&&(r[s]=c[s]);return r};var p0=(c,a)=>()=>(a||c((a={exports:{}}).exports,a),a.exports),A2=(c,a)=>{for(var r in a)y1(c,r,{get:a[r],enumerable:!0})},u0=(c,a,r,s)=>{if(a&&typeof a=="object"||typeof a=="function")for(let e of F2(a))!X1.call(c,e)&&e!==r&&y1(c,e,{get:()=>a[e],enumerable:!(s=x2(a,e))||s.enumerable});return c};var u1=(c,a,r)=>(r=c!=null?y2(k2(c)):{},u0(a||!c||!c.__esModule?y1(r,"default",{value:c,enumerable:!0}):r,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,r=36e5,s="millisecond",e="second",y="minute",Z="hour",C="day",w="week",M="month",R="quarter",L="year",x="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+)?$/,P=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,$={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(v){var o=["th","st","nd","rd"],l=v%100;return"["+v+(o[(l-20)%10]||o[l]||o[0])+"]"}},I=function(v,o,l){var h=String(v);return!h||h.length>=o?v:""+Array(o+1-h.length).join(l)+v},S={s:I,z:function(v){var o=-v.utcOffset(),l=Math.abs(o),h=Math.floor(l/60),n=l%60;return(o<=0?"+":"-")+I(h,2,"0")+":"+I(n,2,"0")},m:function v(o,l){if(o.date()<l.date())return-v(l,o);var h=12*(l.year()-o.year())+(l.month()-o.month()),n=o.clone().add(h,M),V=l-n<0,g=o.clone().add(h+(V?-1:1),M);return+(-(h+(l-n)/(V?n-g:g-n))||0)},a:function(v){return v<0?Math.ceil(v)||0:Math.floor(v)},p:function(v){return{M,y:L,w,d:C,D:x,h:Z,m:y,s:e,ms:s,Q:R}[v]||String(v||"").toLowerCase().replace(/s$/,"")},u:function(v){return v===void 0}},p="en",H={};H[p]=$;var T=function(v){return v instanceof k},_=function v(o,l,h){var n;if(!o)return p;if(typeof o=="string"){var V=o.toLowerCase();H[V]&&(n=V),l&&(H[V]=l,n=V);var g=o.split("-");if(!n&&g.length>1)return v(g[0])}else{var f=o.name;H[f]=o,n=f}return!h&&n&&(p=n),n||!h&&p},E=function(v,o){if(T(v))return v.clone();var l=typeof o=="object"?o:{};return l.date=v,l.args=arguments,new k(l)},t=S;t.l=_,t.i=T,t.w=function(v,o){return E(v,{locale:o.$L,utc:o.$u,x:o.$x,$offset:o.$offset})};var k=function(){function v(l){this.$L=_(l.locale,null,!0),this.parse(l)}var o=v.prototype;return o.parse=function(l){this.$d=function(h){var n=h.date,V=h.utc;if(n===null)return new Date(NaN);if(t.u(n))return new Date;if(n instanceof Date)return new Date(n);if(typeof n=="string"&&!/Z$/i.test(n)){var g=n.match(A);if(g){var f=g[2]-1||0,u=(g[7]||"0").substring(0,3);return V?new Date(Date.UTC(g[1],f,g[3]||1,g[4]||0,g[5]||0,g[6]||0,u)):new Date(g[1],f,g[3]||1,g[4]||0,g[5]||0,g[6]||0,u)}}return new Date(n)}(l),this.$x=l.x||{},this.init()},o.init=function(){var l=this.$d;this.$y=l.getFullYear(),this.$M=l.getMonth(),this.$D=l.getDate(),this.$W=l.getDay(),this.$H=l.getHours(),this.$m=l.getMinutes(),this.$s=l.getSeconds(),this.$ms=l.getMilliseconds()},o.$utils=function(){return t},o.isValid=function(){return this.$d.toString()!==F},o.isSame=function(l,h){var n=E(l);return this.startOf(h)<=n&&n<=this.endOf(h)},o.isAfter=function(l,h){return E(l)<this.startOf(h)},o.isBefore=function(l,h){return this.endOf(h)<E(l)},o.$g=function(l,h,n){return t.u(l)?this[h]:this.set(n,l)},o.unix=function(){return Math.floor(this.valueOf()/1e3)},o.valueOf=function(){return this.$d.getTime()},o.startOf=function(l,h){var n=this,V=!!t.u(h)||h,g=t.p(l),f=function(d1,N){var r1=t.w(n.$u?Date.UTC(n.$y,N,d1):new Date(n.$y,N,d1),n);return V?r1:r1.endOf(C)},u=function(d1,N){return t.w(n.toDate()[d1].apply(n.toDate("s"),(V?[0,0,0,0]:[23,59,59,999]).slice(N)),n)},U=this.$W,z=this.$M,K=this.$D,p1="set"+(this.$u?"UTC":"");switch(g){case L:return V?f(1,0):f(31,11);case M:return V?f(1,z):f(0,z+1);case w:var v1=this.$locale().weekStart||0,g1=(U<v1?U+7:U)-v1;return f(V?K-g1:K+(6-g1),z);case C:case x:return u(p1+"Hours",0);case Z:return u(p1+"Minutes",1);case y:return u(p1+"Seconds",2);case e:return u(p1+"Milliseconds",3);default:return this.clone()}},o.endOf=function(l){return this.startOf(l,!1)},o.$set=function(l,h){var n,V=t.p(l),g="set"+(this.$u?"UTC":""),f=(n={},n[C]=g+"Date",n[x]=g+"Date",n[M]=g+"Month",n[L]=g+"FullYear",n[Z]=g+"Hours",n[y]=g+"Minutes",n[e]=g+"Seconds",n[s]=g+"Milliseconds",n)[V],u=V===C?this.$D+(h-this.$W):h;if(V===M||V===L){var U=this.clone().set(x,1);U.$d[f](u),U.init(),this.$d=U.set(x,Math.min(this.$D,U.daysInMonth())).$d}else f&&this.$d[f](u);return this.init(),this},o.set=function(l,h){return this.clone().$set(l,h)},o.get=function(l){return this[t.p(l)]()},o.add=function(l,h){var n,V=this;l=Number(l);var g=t.p(h),f=function(z){var K=E(V);return t.w(K.date(K.date()+Math.round(z*l)),V)};if(g===M)return this.set(M,this.$M+l);if(g===L)return this.set(L,this.$y+l);if(g===C)return f(1);if(g===w)return f(7);var u=(n={},n[y]=a,n[Z]=r,n[e]=c,n)[g]||1,U=this.$d.getTime()+l*u;return t.w(U,this)},o.subtract=function(l,h){return this.add(-1*l,h)},o.format=function(l){var h=this,n=this.$locale();if(!this.isValid())return n.invalidDate||F;var V=l||"YYYY-MM-DDTHH:mm:ssZ",g=t.z(this),f=this.$H,u=this.$m,U=this.$M,z=n.weekdays,K=n.months,p1=n.meridiem,v1=function(N,r1,L1,w1){return N&&(N[r1]||N(h,V))||L1[r1].slice(0,w1)},g1=function(N){return t.s(f%12||12,N,"0")},d1=p1||function(N,r1,L1){var w1=N<12?"AM":"PM";return L1?w1.toLowerCase():w1};return V.replace(P,function(N,r1){return r1||function(L1){switch(L1){case"YY":return String(h.$y).slice(-2);case"YYYY":return t.s(h.$y,4,"0");case"M":return U+1;case"MM":return t.s(U+1,2,"0");case"MMM":return v1(n.monthsShort,U,K,3);case"MMMM":return v1(K,U);case"D":return h.$D;case"DD":return t.s(h.$D,2,"0");case"d":return String(h.$W);case"dd":return v1(n.weekdaysMin,h.$W,z,2);case"ddd":return v1(n.weekdaysShort,h.$W,z,3);case"dddd":return z[h.$W];case"H":return String(f);case"HH":return t.s(f,2,"0");case"h":return g1(1);case"hh":return g1(2);case"a":return d1(f,u,!0);case"A":return d1(f,u,!1);case"m":return String(u);case"mm":return t.s(u,2,"0");case"s":return String(h.$s);case"ss":return t.s(h.$s,2,"0");case"SSS":return t.s(h.$ms,3,"0");case"Z":return g}return null}(N)||g.replace(":","")})},o.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},o.diff=function(l,h,n){var V,g=this,f=t.p(h),u=E(l),U=(u.utcOffset()-this.utcOffset())*a,z=this-u,K=function(){return t.m(g,u)};switch(f){case L:V=K()/12;break;case M:V=K();break;case R:V=K()/3;break;case w:V=(z-U)/6048e5;break;case C:V=(z-U)/864e5;break;case Z:V=z/r;break;case y:V=z/a;break;case e:V=z/c;break;default:V=z}return n?V:t.a(V)},o.daysInMonth=function(){return this.endOf(M).$D},o.$locale=function(){return H[this.$L]},o.locale=function(l,h){if(!l)return this.$L;var n=this.clone(),V=_(l,h,!0);return V&&(n.$L=V),n},o.clone=function(){return t.w(this.$d,this)},o.toDate=function(){return new Date(this.valueOf())},o.toJSON=function(){return this.isValid()?this.toISOString():null},o.toISOString=function(){return this.$d.toISOString()},o.toString=function(){return this.$d.toUTCString()},v}(),m=k.prototype;return E.prototype=m,[["$ms",s],["$s",e],["$m",y],["$H",Z],["$W",C],["$M",M],["$y",L],["$D",x]].forEach(function(v){m[v[1]]=function(o){return this.$g(o,v[0],v[1])}}),E.extend=function(v,o){return v.$i||(v(o,k,E),v.$i=!0),E},E.locale=_,E.isDayjs=T,E.unix=function(v){return E(1e3*v)},E.en=H[p],E.Ls=H,E.p={},E})});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 r=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 r.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(e){var y=e,{children:c,style:a,onSubmit:r}=y,s=B(y,["children","style","onSubmit"]);return(0,c0.jsx)(M0.FormProvider,d(i({},s),{children:(0,c0.jsx)("form",{onSubmit:Z=>{Z.preventDefault(),Z.stopPropagation(),r(Z)},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 e=s,{disableDefaultValuesUpdate:c,onSubmit:a}=e,r=B(e,["disableDefaultValuesUpdate","onSubmit"]);let y=(0,f0.useForm)(d(i({},r),{resolver:r.schema&&(0,V0.zodResolver)(r.schema)}));return(0,H0.useEffect)(()=>{c||y.reset(r.defaultValues)},[r.defaultValues,y.reset]),d(i({},y),{onSubmit:y.handleSubmit(Z=>a(Z,y))})},D1=P2;var L0=require("react/jsx-runtime");function T2(s){var e=s,{children:c,style:a}=e,r=B(e,["children","style"]);let y=D1(r);return(0,L0.jsx)(T1,d(i({},y),{style:a,children:typeof c=="function"?c(y):c}))}var g0=T2;var $1=require("react"),B1=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"),O=({label:c,required:a,regular:r})=>(0,b1.jsxs)("span",{style:{display:"flex",alignItems:"center",gap:(0,C0.toRem)(2)},children:[(0,b1.jsx)(a0.Typography,{variant:"caption",fontWeight:r?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,e)=>s==null?void 0:s[e],c);var A0=require("react/jsx-runtime"),q=({name:c,disableIcon:a})=>{var e;let r=(0,F0.useFormContext)(),s=Y((e=r==null?void 0:r.formState)==null?void 0:e.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=P=>{var $=P,{name:c,rules:a,defaultValue:r,shouldUnregister:s,label:e,required:y,mask:Z,variant:C="outlined",info:w,parse:M,inputMode:R,format:L,onInputChange:x,disableIconError:F}=$,A=B($,["name","rules","defaultValue","shouldUnregister","label","required","mask","variant","info","parse","inputMode","format","onInputChange","disableIconError"]);let I=(0,B1.useFormContext)();if(!I)throw new Error("Para usar o <TextField /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let[S,p]=(0,$1.useState)(!1),H=t=>{var m;let k=t;return L&&(k=L(t)),Z?(m=M1==null?void 0:M1[Z])==null?void 0:m.format(k):k},T=t=>{var m;let k=t;return M&&(k=M(t)),Z?(m=M1==null?void 0:M1[Z])==null?void 0:m.parse(k):k},_=t=>{if(!t||Z!=="porcentagem"&&Z!=="porcentagem0")return;t==null||t.stopPropagation();let k=(t==null?void 0:t.target).value;if(k){let m=String(k);if(m.length>0){let v=m.indexOf("%");v>-1&&(t.currentTarget.selectionEnd=v)}}},E=Y(I.formState.errors,c);return(0,j.jsx)(B1.Controller,{control:I.control,name:c,rules:a,defaultValue:r,shouldUnregister:s,render:({field:{value:t,onChange:k,ref:m}})=>(0,j.jsxs)(n1.Grid,{display:"flex",flexDirection:"column",children:[(0,j.jsxs)("div",{style:{display:"flex"},children:[e&&(0,j.jsx)(n1.Grid,{item:!0,children:(0,j.jsx)(O,{label:e,required:y})}),w&&(0,j.jsx)(n1.Grid,{item:!0,children:(0,j.jsx)(x1.Tooltip,{title:w,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,d(i({variant:C,defaultValue:r,value:H(t||(t!=0?"":t)),onChange:v=>{var l;let o=T((l=v==null?void 0:v.target)==null?void 0:l.value);k(o),x==null||x(o,I.getValues())},error:!!E},A),{type:A.type==="password"?S?"text":"password":A.type,autoComplete:A.autoComplete||"off",inputProps:i({inputMode:R},A.inputProps),InputProps:i({onKeyDown:_,inputRef:m,endAdornment:A.type==="password"&&(0,j.jsx)(n1.InputAdornment,{position:"start",onClick:()=>p(!S),style:{cursor:"pointer"},children:(0,j.jsx)(x1.LIcon,{icon:S?y0:b0,size:"24px",removeMargin:!0})})},A.InputProps)}),c),(0,j.jsx)(q,{name:c,disableIcon:F})]})})},S0=(0,$1.memo)(D2);var _1=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 G=require("react/jsx-runtime"),$2=$=>{var I=$,{name:c,rules:a,defaultValue:r,shouldUnregister:s,label:e,required:y,options:Z,placeholder:C,clearable:w,disableOnChangeForm:M=!1,multiple:R,info:L,footer:x,onChange:F,disableIconError:A}=I,P=B(I,["name","rules","defaultValue","shouldUnregister","label","required","options","placeholder","clearable","disableOnChangeForm","multiple","info","footer","onChange","disableIconError"]);let S=(0,I1.useFormContext)(),{palette:p}=(0,W.useTheme)(),[H,T]=(0,_1.useState)(!1);if(!S)throw new Error("Para usar o <Select /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let _=Y(S.formState.errors,c);return console.warn=()=>{},(0,G.jsx)(I1.Controller,{control:S.control,name:c,rules:a,defaultValue:r,shouldUnregister:s,render:({field:{value:E,onChange:t,ref:k}})=>(0,G.jsxs)(W.Grid,{display:"flex",flexDirection:"column",children:[(0,G.jsxs)("div",{style:{display:"flex"},children:[e&&(0,G.jsx)(W.Grid,{item:!0,children:(0,G.jsx)(O,{label:e,required:y})}),L&&(0,G.jsx)(W.Grid,{item:!0,children:(0,G.jsx)(e1.Tooltip,{title:L,placement:"top",children:(0,G.jsx)("div",{style:{width:"fit-content"},children:(0,G.jsx)(e1.LIcon,{icon:o1,color:"#757575"})})})})]}),(0,G.jsxs)(W.Select,d(i({open:H,onOpen:()=>T(!0),onClose:()=>T(!1),displayEmpty:!!C,variant:"outlined",autoComplete:"off",value:E?E||"":R?[]:"",renderValue:m=>{if(m.label)return m.label;if(C)return(0,G.jsx)("p",{style:{color:p.grey[400]},children:C})},multiple:R,onChange:m=>{!M&&t(m.target.value),F&&F(m.target.value,S.getValues())},error:!!_,size:P.size||"medium",inputRef:k},P),{endAdornment:(0,G.jsxs)(G.Fragment,{children:[P.endAdornment,!!(w&&E)&&(0,G.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&&t(null),F&&F(null,S.getValues())},children:(0,G.jsx)(e1.LIcon,{icon:w0,color:P0.colorPalette.neutral[100],size:"25px",removeMargin:!0})})]}),children:[C&&(0,G.jsx)(W.MenuItem,{disabled:!0,value:"",children:(0,G.jsx)("p",{style:{color:p.grey[400]},children:C})}),Z==null?void 0:Z.map((m,v)=>(0,G.jsx)(W.MenuItem,{value:m,children:(0,G.jsxs)(W.Grid,{container:!0,direction:"column",children:[(0,G.jsx)(W.Grid,{item:!0,children:m.label}),m.afterLabel&&(0,G.jsx)(W.Grid,{item:!0,children:m.afterLabel})]})},v)),x&&[(0,G.jsx)(W.Grid,{px:2,py:1,children:(0,G.jsx)(e1.Divider,{})},"footer-divider"),(0,G.jsx)("div",{children:x({closeSelect:()=>T(!1)})},"footer-content")]]}),c),(0,G.jsx)(q,{name:c,disableIcon:A})]})})},T0=(0,_1.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 D=require("react/jsx-runtime"),e0=require("react"),B2=I=>{var S=I,{name:c,rules:a,defaultValue:r,shouldUnregister:s,label:e,required:y,options:Z,textFieldProps:C,noOptionsText:w,footer:M,multiple:R,info:L,placeholder:x,onChange:F,onInputChange:A,disableIconError:P}=S,$=B(S,["name","rules","defaultValue","shouldUnregister","label","required","options","textFieldProps","noOptionsText","footer","multiple","info","placeholder","onChange","onInputChange","disableIconError"]);let p=(0,G1.useFormContext)();if(!p)throw new Error("Para usar o <Searchable /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let H=Y(p.formState.errors,c);return console.warn=()=>{},(0,D.jsx)(G1.Controller,{control:p.control,name:c,rules:a,defaultValue:r,shouldUnregister:s,render:({field:{onChange:T,value:_,ref:E}})=>{var t;return(0,D.jsxs)(J.Grid,{display:"flex",flexDirection:"column",children:[(0,D.jsxs)("div",{style:{display:"flex"},children:[e&&(0,D.jsx)(J.Grid,{item:!0,children:(0,D.jsx)(O,{label:e,required:y})}),L&&(0,D.jsx)(J.Grid,{item:!0,children:(0,D.jsx)(m1.Tooltip,{title:L,placement:"top",children:(0,D.jsx)("div",{style:{width:"fit-content"},children:(0,D.jsx)(m1.LIcon,{icon:o1,color:"#757575"})})})})]}),(0,D.jsx)(J.Autocomplete,d(i({onChange:(k,m)=>{T(m),F==null||F(m,p.getValues())},onInputChange:(k,m,v)=>{v==="input"&&setTimeout(()=>{A==null||A(m,p.getValues())},0)},slotProps:d(i({},$.slotProps||{}),{paper:d(i({},($.slotProps||{}).paper||{}),{sx:i({border:`1px solid ${D0.colorPalette.neutral[30]}`,boxShadow:"0px 2px 4px rgba(0, 0, 0, 0.15)"},((t=($.slotProps||{}).paper)==null?void 0:t.sx)||{})})}),value:_||(R?[]:null),options:Z,multiple:R,open:$.disabled?!1:void 0,noOptionsText:(0,D.jsxs)(D.Fragment,{children:[w||"Nenhum resultado encontrado",M?(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(J.Grid,{py:1,children:(0,D.jsx)(m1.Divider,{})}),M]}):null]}),isOptionEqualToValue:(k,m)=>typeof k=="string"&&typeof m=="string"?k===m:typeof k=="object"&&typeof m=="object"?typeof k.value=="object"&&typeof m.value=="object"&&k.key!==void 0&&m.key!==void 0?k.key===m.key:k.value===m.value:!1,renderOption:(k,m)=>typeof m=="object"?(0,e0.createElement)("li",d(i({},k),{key:m.key||m.value}),(0,D.jsxs)(J.Grid,{container:!0,direction:"column",children:[(0,D.jsx)(J.Grid,{item:!0,children:m.label}),m.afterLabel&&(0,D.jsx)(J.Grid,{item:!0,children:m.afterLabel})]})):(0,e0.createElement)("li",d(i({},k),{key:m}),m),ListboxComponent:(0,E1.forwardRef)(function(m,v){return(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)("ul",d(i({},m),{ref:v})),!!M&&(0,D.jsx)("div",d(i({},m),{children:(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(J.Grid,{px:2,py:1,children:(0,D.jsx)(m1.Divider,{})}),M]})}),"searchable-footer")]})})},$),{renderInput:k=>(0,D.jsx)(J.TextField,d(i(i({error:!!H,placeholder:x},k),C),{inputRef:E}))}),c),(0,D.jsx)(q,{name:c,disableIcon:P})]})}})},$0=(0,E1.memo)(B2);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"),B0=u1(require("@emotion/styled")),i0=require("@emotion/react"),_0=i0.css`
|
|
2
2
|
display: flex;
|
|
3
3
|
align-items: center;
|
|
4
4
|
justify-content: center;
|
|
5
|
-
`,
|
|
5
|
+
`,_2=c=>i0.css`
|
|
6
6
|
.creatable,
|
|
7
7
|
.editable {
|
|
8
|
-
${
|
|
8
|
+
${_0}
|
|
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;
|
|
@@ -31,14 +31,14 @@
|
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
|
-
`,I0=
|
|
34
|
+
`,I0=B0.default.div`
|
|
35
35
|
display: flex;
|
|
36
36
|
|
|
37
37
|
div.endAdornments {
|
|
38
38
|
position: absolute;
|
|
39
39
|
right: 0;
|
|
40
40
|
|
|
41
|
-
${
|
|
41
|
+
${_0}
|
|
42
42
|
}
|
|
43
43
|
|
|
44
44
|
.MuiAutocomplete-endAdornment {
|
|
@@ -46,23 +46,23 @@
|
|
|
46
46
|
right: 0;
|
|
47
47
|
}
|
|
48
48
|
|
|
49
|
-
${({hideAddButton:c,theme:a})=>!c&&
|
|
50
|
-
`;var b=require("react/jsx-runtime"),o0=require("react"),I2=H=>{var
|
|
49
|
+
${({hideAddButton:c,theme:a})=>!c&&_2(a)}
|
|
50
|
+
`;var b=require("react/jsx-runtime"),o0=require("react"),I2=H=>{var T=H,{name:c,rules:a,defaultValue:r,shouldUnregister:s,label:e,required:y,options:Z,editable:C,footer:w,onEditOption:M,onCreateOption:R,textFieldProps:L,hideAddButton:x,multiple:F,info:A,onChange:P,onInputChange:$,placeholder:I,disableIconError:S}=T,p=B(T,["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 E=Y(_.formState.errors,c),t=x||p.disabled,k=l=>{let h=0;return L!=null&&L.InputProps||(h+=2.5),t||(h+=2.56,m(l)&&(h+=2.56)),!p.disableClearable&&!p.disabled&&(h+=1.3),h+"rem"},m=l=>p.disabled?!1:C&&(0,O1.isObject)(l)&&!(0,O1.isEmpty)(l);console.warn=()=>{};let v=l=>{R?R(l):console.error("onCreateOption n\xE3o foi definido")},o=l=>{M?M(l):console.error("onEditOption n\xE3o foi definido")};return(0,b.jsx)(U1.Controller,{control:_.control,name:c,rules:a,defaultValue:r,shouldUnregister:s,render:({field:{value:l,onChange:h,ref:n}})=>{var g;let V=(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:[e&&(0,b.jsx)(Q.Grid,{item:!0,children:(0,b.jsx)(O,{label:e,required:y})}),A&&(0,b.jsx)(Q.Grid,{item:!0,children:(0,b.jsx)(X.Tooltip,{title:A,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:t,children:(0,b.jsx)(Q.Autocomplete,d(i({fullWidth:!0,onChange:(f,u)=>{h(u),P==null||P(u,_.getValues())},onInputChange:(f,u,U)=>{U==="input"&&setTimeout(()=>{$==null||$(u,_.getValues())},0)},slotProps:d(i({},p.slotProps||{}),{paper:d(i({},(p.slotProps||{}).paper||{}),{sx:i({border:`1px solid ${E0.colorPalette.neutral[30]}`,boxShadow:"0px 2px 4px rgba(0, 0, 0, 0.15)"},((g=(p.slotProps||{}).paper)==null?void 0:g.sx)||{})})}),options:Z,value:l||(F?[]:null),multiple:F,open:p.disabled?!1:void 0,noOptionsText:t?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:()=>v(l),variant:"text",startIcon:(0,b.jsx)(X.LIcon,{icon:l0}),children:["Adicionar ",V&&`"${V}"`]}),isOptionEqualToValue:(f,u)=>u?typeof f=="string"&&typeof u=="string"?f===u:typeof f=="object"&&typeof u=="object"?typeof f.value=="object"&&typeof u.value=="object"&&f.key!==void 0&&u.key!==void 0?f.key===u.key:f.value===u.value:typeof f=="object"&&typeof u=="string":!1,renderOption:(f,u)=>typeof u=="object"?(0,o0.createElement)("li",d(i({},f),{key:u.key||u.value}),(0,b.jsxs)(Q.Grid,{container:!0,direction:"column",children:[(0,b.jsx)(Q.Grid,{item:!0,children:u.label}),u.afterLabel&&(0,b.jsx)(Q.Grid,{item:!0,children:u.afterLabel})]})):(0,o0.createElement)("li",d(i({},f),{key:u}),u),ListboxComponent:(0,R1.forwardRef)(function(u,U){return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("ul",d(i({},u),{ref:U})),!!w&&(0,b.jsx)("div",d(i({},u),{children:(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(Q.Grid,{px:2,py:1,children:(0,b.jsx)(X.Divider,{})}),w]})}),"creatable-footer")]})})},p),{sx:i({"& div.MuiInputBase-root":{paddingRight:`${k(l)} !important`}},p.sx),renderInput:f=>(0,b.jsx)(Q.TextField,i(d(i({placeholder:I},f),{error:!!E,InputProps:d(i({},f.InputProps),{inputRef:n,endAdornment:(0,b.jsxs)("div",{className:"endAdornments",children:[f.InputProps.endAdornment,!t&&(0,b.jsxs)(b.Fragment,{children:[m(l)?(0,b.jsxs)("div",{className:"editable",children:[(0,b.jsx)("div",{className:"divider"}),(0,b.jsx)("div",{className:"button",onClick:()=>o(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:()=>v(l),children:(0,b.jsx)(X.LIcon,{icon:l0,size:"24px",removeMargin:!0})})]})]})]})})}),L))}),c)}),(0,b.jsx)(q,{name:c,disableIcon:S})]})}})},G0=(0,R1.memo)(I2);var q1=require("react-hook-form"),H1=require("@mui/material");var h1=require("react/jsx-runtime"),E2=R=>{var L=R,{name:c,rules:a,defaultValue:r,shouldUnregister:s,label:e,labelPlacement:y,required:Z,disableIconError:C,onChange:w}=L,M=B(L,["name","rules","defaultValue","shouldUnregister","label","labelPlacement","required","disableIconError","onChange"]);let x=(0,q1.useFormContext)();if(!x)throw new Error("Para usar o <Checkbox /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");return(0,h1.jsx)(q1.Controller,{control:x.control,name:c,rules:a,defaultValue:r,shouldUnregister:s,render:({field:{value:F,onChange:A}})=>(0,h1.jsxs)(H1.Grid,{display:"flex",flexDirection:"column",children:[(0,h1.jsx)(H1.FormControlLabel,{control:(0,h1.jsx)(H1.Checkbox,i({checked:!!F,value:F!=null?F:"",defaultValue:F,onChange:(P,$)=>{A(P,$),w==null||w(P,$)}},M),c),label:(0,h1.jsx)(O,{label:e,required:Z,regular:!0}),labelPlacement:y||"end"}),(0,h1.jsx)(q,{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 R=M,{name:c,rules:a,defaultValue:r,shouldUnregister:s,label:e,labelPlacement:y,disableIconError:Z,onChange:C}=R,w=B(R,["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:r,shouldUnregister:s,render:({field:{value:x,onChange:F}})=>(0,s1.jsxs)(f1.Grid,{display:"flex",flexDirection:"column",children:[(0,s1.jsx)(f1.FormControlLabel,{control:(0,s1.jsx)(f1.Switch,i({value:x!=null?x:"",checked:x!=null?x:!1,defaultValue:x,onChange:(A,P)=>{F(A,P),C==null||C(A,P)}},w),c),label:(0,s1.jsx)(O,{label:e}),labelPlacement:y||"end"}),(0,s1.jsx)(q,{name:c,disableIcon:Z})]})})},U0=G2;var V1=require("@mui/material");var F1=require("react/jsx-runtime"),R2=s=>{var e=s,{label:c,labelPlacement:a}=e,r=B(e,["label","labelPlacement"]);return(0,F1.jsx)(V1.Grid,{display:"flex",flexDirection:"column",children:(0,F1.jsx)(V1.FormControlLabel,{control:(0,F1.jsx)(V1.Radio,i({},r)),label:(0,F1.jsx)(O,{label:c}),labelPlacement:a||"end"})})},O0=R2;var Y1=require("react-hook-form"),j1=require("@mui/material");var Z1=require("react/jsx-runtime"),U2=R=>{var L=R,{name:c,rules:a,defaultValue:r,shouldUnregister:s,label:e,required:y,children:Z,orientation:C="row",disableIconError:w}=L,M=B(L,["name","rules","defaultValue","shouldUnregister","label","required","children","orientation","disableIconError"]);let x=(0,Y1.useFormContext)();if(!x)throw new Error("Para usar o <RadioGroup /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");return(0,Z1.jsx)(Y1.Controller,{control:x.control,name:c,rules:a,defaultValue:r,shouldUnregister:s,render:({field:{value:F,onChange:A}})=>(0,Z1.jsxs)(j1.Grid,{display:"flex",flexDirection:"column",children:[e&&(0,Z1.jsx)(O,{label:e,required:y}),(0,Z1.jsx)(j1.RadioGroup,d(i({value:F||"",name:c},M),{onChange:P=>{var $,I;(I=M==null?void 0:M.onChange)==null||I.call(M,P,($=P.target)==null?void 0:$.value),A(P)},style:{display:"flex",flexDirection:C},children:Z}),c),(0,Z1.jsx)(q,{name:c,disableIcon:w})]})})},q0=U2;var W1=require("react-hook-form"),z0=require("@mui/material");var n0=require("react/jsx-runtime"),O2=y=>{var Z=y,{name:c,rules:a,defaultValue:r,shouldUnregister:s}=Z,e=B(Z,["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:r,shouldUnregister:s,render:({field:{value:w,onChange:M}})=>(0,n0.jsx)(z0.Slider,i({value:w||(e==null?void 0:e.min)||0,onChange:M,valueLabelDisplay:"auto"},e),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 x=L,{rules:c,name:a,defaultValue:r,shouldUnregister:s,datePickerProps:e,label:y,required:Z,placeholder:C,disabled:w,disableIconError:M}=x,R=B(x,["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 A=Y(F.formState.errors,a),P=(e==null?void 0:e.format)||"DD/MM/YYYY",$=c?(0,k1.composeValidators)([(0,k1.date)(P),c]):(0,k1.date)(P);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:$,defaultValue:r,shouldUnregister:s,render:({field:{value:I,onChange:S,ref:p}})=>(0,t1.jsxs)(Q0.Grid,{display:"flex",flexDirection:"column",children:[y&&(0,t1.jsx)(O,{label:y,required:Z}),(0,o2.createElement)(c2.DatePicker,d(i({},e),{key:a,value:I!=null?I:null,format:P,onChange:(H,T)=>{var _;S(H,T),(_=e==null?void 0:e.onChange)==null||_.call(e,H,T)},disabled:w,slots:{textField:X0.TextField,openPickerButton:H=>(0,t1.jsx)(J0,d(i({},H),{size:R.size}))},slotProps:{textField:H=>{var T;return d(i(d(i({variant:"outlined"},H),{error:!!A}),R),{inputProps:d(i({},H.inputProps),{placeholder:C||((T=H.inputProps)==null?void 0:T.placeholder)}),InputProps:d(i({},H.InputProps),{inputRef(_){p(_),typeof H.inputRef=="function"&&H.inputRef(_)}})})}}})),(0,t1.jsx)(q,{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 x=L,{rules:c,defaultValue:a,shouldUnregister:r,name:s,required:e,label:y,timePickerProps:Z,placeholder:C,disabled:w,disableIconError:M}=x,R=B(x,["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 A=Y(F.formState.errors,s),P=(Z==null?void 0:Z.format)||"HH:mm",$=c?(0,A1.composeValidators)([(0,A1.time)(P),c]):(0,A1.time)(P);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:$,defaultValue:a,shouldUnregister:r,render:({field:{value:I,onChange:S,ref:p}})=>(0,i1.jsxs)(v2.Grid,{display:"flex",flexDirection:"column",children:[y&&(0,i1.jsx)(O,{label:y,required:e}),(0,i1.jsx)(m2.TimePicker,d(i({ampm:!1,format:P,value:I!=null?I:null,disabled:w},Z),{onChange:(H,T)=>{var _;S(H,T),(_=Z==null?void 0:Z.onChange)==null||_.call(Z,H,T)},slots:{textField:d2.TextField,openPickerButton:H=>(0,i1.jsx)(s2,d(i({},H),{size:R.size}))},slotProps:{textField:H=>{var T;return d(i(d(i({variant:"outlined"},H),{error:!!A}),R),{inputProps:d(i({},H.inputProps),{placeholder:C||((T=H.inputProps)==null?void 0:T.placeholder)}),InputProps:d(i({},H.InputProps),{inputRef(_){p(_),typeof H.inputRef=="function"&&H.inputRef(_)}})})}}}),s),(0,i1.jsx)(q,{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=x=>{var F=x,{name:c,defaultValue:a,rules:r,shouldUnregister:s,label:e,required:y,noOptionsText:Z,placeholder:C,onInputChange:w,onChange:M,disableIconError:R}=F,L=B(F,["name","defaultValue","rules","shouldUnregister","label","required","noOptionsText","placeholder","onInputChange","onChange","disableIconError"]);let A=(0,K1.useFormContext)();if(!A)throw new Error("Para usar o <Autocomplete /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let P=Y(A.formState.errors,c);return console.warn=()=>{},(0,a1.jsx)(K1.Controller,{name:c,control:A.control,defaultValue:a,rules:r,shouldUnregister:s,render:({field:$})=>{var I;return(0,a1.jsxs)(S1.Grid,{display:"flex",flexDirection:"column",children:[e&&(0,a1.jsx)(O,{label:e,required:y}),(0,a1.jsx)(Q1.Autocomplete,d(i({onChange:(S,p)=>{$.onChange(p),M==null||M(p,A.getValues())},onInputChange:(S,p,H)=>{H==="input"&&($.onChange(p),setTimeout(()=>{w==null||w(p,A.getValues())},0))},slotProps:d(i({},L.slotProps||{}),{paper:d(i({},(L.slotProps||{}).paper||{}),{sx:i({border:`1px solid ${V2.colorPalette.neutral[30]}`,boxShadow:"0px 2px 4px rgba(0, 0, 0, 0.15)"},((I=(L.slotProps||{}).paper)==null?void 0:I.sx)||{})})}),isOptionEqualToValue:(S,p)=>S.value===p.value,renderOption:(S,p)=>(0,L2.createElement)("li",d(i({},S),{key:p.key||p.value,onClick:H=>{var T;(T=S.onClick)==null||T.call(S,H),$.onChange(p)}}),(0,a1.jsxs)(S1.Grid,{container:!0,direction:"column",children:[(0,a1.jsx)(S1.Grid,{item:!0,children:p.label}),p.afterLabel&&(0,a1.jsx)(S1.Grid,{item:!0,children:p.afterLabel})]})),value:$.value||null,open:L.disabled?!1:void 0,noOptionsText:Z||"Nenhuma op\xE7\xE3o encontrada"},L),{renderInput:S=>{var p,H,T;return(0,a1.jsx)(Q1.TextField,d(i(i({placeholder:C},S),L.textFieldProps),{error:!!P,InputProps:d(i(i({},S.InputProps),(p=L.textFieldProps)==null?void 0:p.InputProps),{inputRef:$.ref,inputProps:i(i({},S.inputProps),(T=(H=L.textFieldProps)==null?void 0:H.InputProps)==null?void 0:T.inputProps)})}))}}),c),(0,a1.jsx)(q,{name:c,disableIcon:R})]})}})},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 _1=(c,a,n)=>a in c?x1(c,a,{enumerable:!0,configurable:!0,writable:!0,value:n}):c[a]=n,i=(c,a)=>{for(var n in a||(a={}))C1.call(a,n)&&_1(c,n,a[n]);if(H1)for(var n of H1(a))I1.call(a,n)&&_1(c,n,a[n]);return c},d=(c,a)=>p0(c,M0(a));var D=(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 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",y="minute",Z="hour",x="day",S="week",M="month",I="quarter",L="year",b="date",C="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,T={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(v){var r=["th","st","nd","rd"],l=v%100;return"["+v+(r[(l-20)%10]||r[l]||r[0])+"]"}},B=function(v,r,l){var h=String(v);return!h||h.length>=r?v:""+Array(r+1-h.length).join(l)+v},A={s:B,z:function(v){var r=-v.utcOffset(),l=Math.abs(r),h=Math.floor(l/60),o=l%60;return(r<=0?"+":"-")+B(h,2,"0")+":"+B(o,2,"0")},m:function v(r,l){if(r.date()<l.date())return-v(l,r);var h=12*(l.year()-r.year())+(l.month()-r.month()),o=r.clone().add(h,M),V=l-o<0,g=r.clone().add(h+(V?-1:1),M);return+(-(h+(l-o)/(V?o-g:g-o))||0)},a:function(v){return v<0?Math.ceil(v)||0:Math.floor(v)},p:function(v){return{M,y:L,w:S,d:x,D:b,h:Z,m:y,s:e,ms:s,Q:I}[v]||String(v||"").toLowerCase().replace(/s$/,"")},u:function(v){return v===void 0}},p="en",H={};H[p]=T;var P=function(v){return v instanceof F},$=function v(r,l,h){var o;if(!r)return p;if(typeof r=="string"){var V=r.toLowerCase();H[V]&&(o=V),l&&(H[V]=l,o=V);var g=r.split("-");if(!o&&g.length>1)return v(g[0])}else{var f=r.name;H[f]=r,o=f}return!h&&o&&(p=o),o||!h&&p},_=function(v,r){if(P(v))return v.clone();var l=typeof r=="object"?r:{};return l.date=v,l.args=arguments,new F(l)},t=A;t.l=$,t.i=P,t.w=function(v,r){return _(v,{locale:r.$L,utc:r.$u,x:r.$x,$offset:r.$offset})};var F=function(){function v(l){this.$L=$(l.locale,null,!0),this.parse(l)}var r=v.prototype;return r.parse=function(l){this.$d=function(h){var o=h.date,V=h.utc;if(o===null)return new Date(NaN);if(t.u(o))return new Date;if(o instanceof Date)return new Date(o);if(typeof o=="string"&&!/Z$/i.test(o)){var g=o.match(k);if(g){var f=g[2]-1||0,u=(g[7]||"0").substring(0,3);return V?new Date(Date.UTC(g[1],f,g[3]||1,g[4]||0,g[5]||0,g[6]||0,u)):new Date(g[1],f,g[3]||1,g[4]||0,g[5]||0,g[6]||0,u)}}return new Date(o)}(l),this.$x=l.x||{},this.init()},r.init=function(){var l=this.$d;this.$y=l.getFullYear(),this.$M=l.getMonth(),this.$D=l.getDate(),this.$W=l.getDay(),this.$H=l.getHours(),this.$m=l.getMinutes(),this.$s=l.getSeconds(),this.$ms=l.getMilliseconds()},r.$utils=function(){return t},r.isValid=function(){return this.$d.toString()!==C},r.isSame=function(l,h){var o=_(l);return this.startOf(h)<=o&&o<=this.endOf(h)},r.isAfter=function(l,h){return _(l)<this.startOf(h)},r.isBefore=function(l,h){return this.endOf(h)<_(l)},r.$g=function(l,h,o){return t.u(l)?this[h]:this.set(o,l)},r.unix=function(){return Math.floor(this.valueOf()/1e3)},r.valueOf=function(){return this.$d.getTime()},r.startOf=function(l,h){var o=this,V=!!t.u(h)||h,g=t.p(l),f=function(e1,j){var X=t.w(o.$u?Date.UTC(o.$y,j,e1):new Date(o.$y,j,e1),o);return V?X:X.endOf(x)},u=function(e1,j){return t.w(o.toDate()[e1].apply(o.toDate("s"),(V?[0,0,0,0]:[23,59,59,999]).slice(j)),o)},G=this.$W,z=this.$M,W=this.$D,h1="set"+(this.$u?"UTC":"");switch(g){case L:return V?f(1,0):f(31,11);case M:return V?f(1,z):f(0,z+1);case S:var a1=this.$locale().weekStart||0,v1=(G<a1?G+7:G)-a1;return f(V?W-v1:W+(6-v1),z);case x:case b:return u(h1+"Hours",0);case Z:return u(h1+"Minutes",1);case y:return u(h1+"Seconds",2);case e:return u(h1+"Milliseconds",3);default:return this.clone()}},r.endOf=function(l){return this.startOf(l,!1)},r.$set=function(l,h){var o,V=t.p(l),g="set"+(this.$u?"UTC":""),f=(o={},o[x]=g+"Date",o[b]=g+"Date",o[M]=g+"Month",o[L]=g+"FullYear",o[Z]=g+"Hours",o[y]=g+"Minutes",o[e]=g+"Seconds",o[s]=g+"Milliseconds",o)[V],u=V===x?this.$D+(h-this.$W):h;if(V===M||V===L){var G=this.clone().set(b,1);G.$d[f](u),G.init(),this.$d=G.set(b,Math.min(this.$D,G.daysInMonth())).$d}else f&&this.$d[f](u);return this.init(),this},r.set=function(l,h){return this.clone().$set(l,h)},r.get=function(l){return this[t.p(l)]()},r.add=function(l,h){var o,V=this;l=Number(l);var g=t.p(h),f=function(z){var W=_(V);return t.w(W.date(W.date()+Math.round(z*l)),V)};if(g===M)return this.set(M,this.$M+l);if(g===L)return this.set(L,this.$y+l);if(g===x)return f(1);if(g===S)return f(7);var u=(o={},o[y]=a,o[Z]=n,o[e]=c,o)[g]||1,G=this.$d.getTime()+l*u;return t.w(G,this)},r.subtract=function(l,h){return this.add(-1*l,h)},r.format=function(l){var h=this,o=this.$locale();if(!this.isValid())return o.invalidDate||C;var V=l||"YYYY-MM-DDTHH:mm:ssZ",g=t.z(this),f=this.$H,u=this.$m,G=this.$M,z=o.weekdays,W=o.months,h1=o.meridiem,a1=function(j,X,d1,M1){return j&&(j[X]||j(h,V))||d1[X].slice(0,M1)},v1=function(j){return t.s(f%12||12,j,"0")},e1=h1||function(j,X,d1){var M1=j<12?"AM":"PM";return d1?M1.toLowerCase():M1};return V.replace(w,function(j,X){return X||function(d1){switch(d1){case"YY":return String(h.$y).slice(-2);case"YYYY":return t.s(h.$y,4,"0");case"M":return G+1;case"MM":return t.s(G+1,2,"0");case"MMM":return a1(o.monthsShort,G,W,3);case"MMMM":return a1(W,G);case"D":return h.$D;case"DD":return t.s(h.$D,2,"0");case"d":return String(h.$W);case"dd":return a1(o.weekdaysMin,h.$W,z,2);case"ddd":return a1(o.weekdaysShort,h.$W,z,3);case"dddd":return z[h.$W];case"H":return String(f);case"HH":return t.s(f,2,"0");case"h":return v1(1);case"hh":return v1(2);case"a":return e1(f,u,!0);case"A":return e1(f,u,!1);case"m":return String(u);case"mm":return t.s(u,2,"0");case"s":return String(h.$s);case"ss":return t.s(h.$s,2,"0");case"SSS":return t.s(h.$ms,3,"0");case"Z":return g}return null}(j)||g.replace(":","")})},r.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},r.diff=function(l,h,o){var V,g=this,f=t.p(h),u=_(l),G=(u.utcOffset()-this.utcOffset())*a,z=this-u,W=function(){return t.m(g,u)};switch(f){case L:V=W()/12;break;case M:V=W();break;case I:V=W()/3;break;case S:V=(z-G)/6048e5;break;case x:V=(z-G)/864e5;break;case Z:V=z/n;break;case y:V=z/a;break;case e:V=z/c;break;default:V=z}return o?V:t.a(V)},r.daysInMonth=function(){return this.endOf(M).$D},r.$locale=function(){return H[this.$L]},r.locale=function(l,h){if(!l)return this.$L;var o=this.clone(),V=$(l,h,!0);return V&&(o.$L=V),o},r.clone=function(){return t.w(this.$d,this)},r.toDate=function(){return new Date(this.valueOf())},r.toJSON=function(){return this.isValid()?this.toISOString():null},r.toISOString=function(){return this.$d.toISOString()},r.toString=function(){return this.$d.toUTCString()},v}(),m=F.prototype;return _.prototype=m,[["$ms",s],["$s",e],["$m",y],["$H",Z],["$W",x],["$M",M],["$y",L],["$D",b]].forEach(function(v){m[v[1]]=function(r){return this.$g(r,v[0],v[1])}}),_.extend=function(v,r){return v.$i||(v(r,F,_),v.$i=!0),_},_.locale=$,_.isDayjs=P,_.unix=function(v){return _(1e3*v)},_.en=H[p],_.Ls=H,_.p={},_})});var B1=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 y=e,{children:c,style:a,onSubmit:n}=y,s=D(y,["children","style","onSubmit"]);return R1(g0,d(i({},s),{children:R1("form",{onSubmit:Z=>{Z.preventDefault(),Z.stopPropagation(),n(Z)},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=D(e,["disableDefaultValuesUpdate","onSubmit"]);let y=b0(d(i({},n),{resolver:n.schema&&x0(n.schema)}));return y0(()=>{c||y.reset(n.defaultValues)},[n.defaultValues,y.reset]),d(i({},y),{onSubmit:y.handleSubmit(Z=>a(Z,y))})},k1=C0;import{jsx as A0}from"react/jsx-runtime";function F0(s){var e=s,{children:c,style:a}=e,n=D(e,["children","style"]);let y=k1(n);return A0(F1,d(i({},y),{style:a,children:typeof c=="function"?c(y):c}))}var k0=F0;import{memo as $0,useState as B0}from"react";import{Controller as _0,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 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 N,jsxs as W1}from"react/jsx-runtime";var U0=w=>{var T=w,{name:c,rules:a,defaultValue:n,shouldUnregister:s,label:e,required:y,mask:Z,variant:x="outlined",info:S,parse:M,inputMode:I,format:L,onInputChange:b,disableIconError:C}=T,k=D(T,["name","rules","defaultValue","shouldUnregister","label","required","mask","variant","info","parse","inputMode","format","onInputChange","disableIconError"]);let B=I0();if(!B)throw new Error("Para usar o <TextField /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let[A,p]=B0(!1),H=t=>{var m;let F=t;return L&&(F=L(t)),Z?(m=s1==null?void 0:s1[Z])==null?void 0:m.format(F):F},P=t=>{var m;let F=t;return M&&(F=M(t)),Z?(m=s1==null?void 0:s1[Z])==null?void 0:m.parse(F):F},$=t=>{if(!t||Z!=="porcentagem"&&Z!=="porcentagem0")return;t==null||t.stopPropagation();let F=(t==null?void 0:t.target).value;if(F){let m=String(F);if(m.length>0){let v=m.indexOf("%");v>-1&&(t.currentTarget.selectionEnd=v)}}},_=Y(B.formState.errors,c);return N(_0,{control:B.control,name:c,rules:a,defaultValue:n,shouldUnregister:s,render:({field:{value:t,onChange:F,ref:m}})=>W1(S1,{display:"flex",flexDirection:"column",children:[W1("div",{style:{display:"flex"},children:[e&&N(S1,{item:!0,children:N(R,{label:e,required:y})}),S&&N(S1,{item:!0,children:N(R0,{title:S,placement:"top",children:N("div",{style:{width:"fit-content"},children:N(j1,{icon:c1,color:"#757575"})})})})]}),N(G0,d(i({variant:x,defaultValue:n,value:H(t||(t!=0?"":t)),onChange:v=>{var l;let r=P((l=v==null?void 0:v.target)==null?void 0:l.value);F(r),b==null||b(r,B.getValues())},error:!!_},k),{type:k.type==="password"?A?"text":"password":k.type,autoComplete:k.autoComplete||"off",inputProps:i({inputMode:I},k.inputProps),InputProps:i({onKeyDown:$,inputRef:m,endAdornment:k.type==="password"&&N(E0,{position:"start",onClick:()=>p(!A),style:{cursor:"pointer"},children:N(j1,{icon:A?U1:O1,size:"24px",removeMargin:!0})})},k.InputProps)}),c),N(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 m1}from"react/jsx-runtime";var c2=T=>{var B=T,{name:c,rules:a,defaultValue:n,shouldUnregister:s,label:e,required:y,options:Z,placeholder:x,clearable:S,disableOnChangeForm:M=!1,multiple:I,info:L,footer:b,onChange:C,disableIconError:k}=B,w=D(B,["name","rules","defaultValue","shouldUnregister","label","required","options","placeholder","clearable","disableOnChangeForm","multiple","info","footer","onChange","disableIconError"]);let A=j0(),{palette:p}=X0(),[H,P]=z0(!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=()=>{},O(Y0,{control:A.control,name:c,rules:a,defaultValue:n,shouldUnregister:s,render:({field:{value:_,onChange:t,ref:F}})=>m1(i1,{display:"flex",flexDirection:"column",children:[m1("div",{style:{display:"flex"},children:[e&&O(i1,{item:!0,children:O(R,{label:e,required:y})}),L&&O(i1,{item:!0,children:O(J0,{title:L,placement:"top",children:O("div",{style:{width:"fit-content"},children:O(J1,{icon:c1,color:"#757575"})})})})]}),m1(Q0,d(i({open:H,onOpen:()=>P(!0),onClose:()=>P(!1),displayEmpty:!!x,variant:"outlined",autoComplete:"off",value:_?_||"":I?[]:"",renderValue:m=>{if(m.label)return m.label;if(x)return O("p",{style:{color:p.grey[400]},children:x})},multiple:I,onChange:m=>{!M&&t(m.target.value),C&&C(m.target.value,A.getValues())},error:!!$,size:w.size||"medium",inputRef:F},w),{endAdornment:m1(a2,{children:[w.endAdornment,!!(S&&_)&&O(N0,{variant:"text",color:"neutral",size:"small",sx:{borderRadius:"50%",position:"absolute",right:"2rem"},style:{padding:0},"aria-label":"Clear",title:"Clear",onClick:()=>{!M&&t(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:p.grey[400]},children:x})}),Z==null?void 0:Z.map((m,v)=>O(K1,{value:m,children:m1(i1,{container:!0,direction:"column",children:[O(i1,{item:!0,children:m.label}),m.afterLabel&&O(i1,{item:!0,children:m.afterLabel})]})},v)),b&&[O(i1,{px:2,py:1,children:O(W0,{})},"footer-divider"),O("div",{children:b({closeSelect:()=>P(!1)})},"footer-content")]]}),c),O(U,{name:c,disableIcon:k})]})})},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=B=>{var A=B,{name:c,rules:a,defaultValue:n,shouldUnregister:s,label:e,required:y,options:Z,textFieldProps:x,noOptionsText:S,footer:M,multiple:I,info:L,placeholder:b,onChange:C,onInputChange:k,disableIconError:w}=A,T=D(A,["name","rules","defaultValue","shouldUnregister","label","required","options","textFieldProps","noOptionsText","footer","multiple","info","placeholder","onChange","onInputChange","disableIconError"]);let p=o2();if(!p)throw new Error("Para usar o <Searchable /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let H=Y(p.formState.errors,c);return console.warn=()=>{},q(r2,{control:p.control,name:c,rules:a,defaultValue:n,shouldUnregister:s,render:({field:{onChange:P,value:$,ref:_}})=>{var t;return r1(l1,{display:"flex",flexDirection:"column",children:[r1("div",{style:{display:"flex"},children:[e&&q(l1,{item:!0,children:q(R,{label:e,required:y})}),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,d(i({onChange:(F,m)=>{P(m),C==null||C(m,p.getValues())},onInputChange:(F,m,v)=>{v==="input"&&setTimeout(()=>{k==null||k(m,p.getValues())},0)},slotProps:d(i({},T.slotProps||{}),{paper:d(i({},(T.slotProps||{}).paper||{}),{sx:i({border:`1px solid ${v2.neutral[30]}`,boxShadow:"0px 2px 4px rgba(0, 0, 0, 0.15)"},((t=(T.slotProps||{}).paper)==null?void 0:t.sx)||{})})}),value:$||(I?[]:null),options:Z,multiple:I,open:T.disabled?!1:void 0,noOptionsText:r1(f1,{children:[S||"Nenhum resultado encontrado",M?r1(f1,{children:[q(l1,{py:1,children:q(Q1,{})}),M]}):null]}),isOptionEqualToValue:(F,m)=>typeof F=="string"&&typeof m=="string"?F===m:typeof F=="object"&&typeof m=="object"?typeof F.value=="object"&&typeof m.value=="object"&&F.key!==void 0&&m.key!==void 0?F.key===m.key:F.value===m.value:!1,renderOption:(F,m)=>typeof m=="object"?X1("li",d(i({},F),{key:m.key||m.value}),r1(l1,{container:!0,direction:"column",children:[q(l1,{item:!0,children:m.label}),m.afterLabel&&q(l1,{item:!0,children:m.afterLabel})]})):X1("li",d(i({},F),{key:m}),m),ListboxComponent:e2(function(m,v){return r1(f1,{children:[q("ul",d(i({},m),{ref:v})),!!M&&q("div",d(i({},m),{children:r1(f1,{children:[q(l1,{px:2,py:1,children:q(Q1,{})}),M]})}),"searchable-footer")]})})},T),{renderInput:F=>q(h2,d(i(i({error:!!H,placeholder:b},F),x),{inputRef:_}))}),c),q(U,{name:c,disableIcon:w})]})}})},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=H=>{var P=H,{name:c,rules:a,defaultValue:n,shouldUnregister:s,label:e,required:y,options:Z,editable:x,footer:S,onEditOption:M,onCreateOption:I,textFieldProps:L,hideAddButton:b,multiple:C,info:k,onChange:w,onInputChange:T,placeholder:B,disableIconError:A}=P,p=D(P,["name","rules","defaultValue","shouldUnregister","label","required","options","editable","footer","onEditOption","onCreateOption","textFieldProps","hideAddButton","multiple","info","onChange","onInputChange","placeholder","disableIconError"]);let $=f2();if(!$)throw new Error("Para usar o <Creatable /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let _=Y($.formState.errors,c),t=b||p.disabled,F=l=>{let h=0;return L!=null&&L.InputProps||(h+=2.5),t||(h+=2.56,m(l)&&(h+=2.56)),!p.disableClearable&&!p.disabled&&(h+=1.3),h+"rem"},m=l=>p.disabled?!1:x&&V2(l)&&!g2(l);console.warn=()=>{};let v=l=>{I?I(l):console.error("onCreateOption n\xE3o foi definido")},r=l=>{M?M(l):console.error("onEditOption n\xE3o foi definido")};return E(H2,{control:$.control,name:c,rules:a,defaultValue:n,shouldUnregister:s,render:({field:{value:l,onChange:h,ref:o}})=>{var g;let V=(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:[e&&E(o1,{item:!0,children:E(R,{label:e,required:y})}),k&&E(o1,{item:!0,children:E(b2,{title:k,placement:"top",children:E("div",{style:{width:"fit-content"},children:E(g1,{icon:c1,color:"#757575"})})})})]}),E(a0,{hideAddButton:t,children:E(L2,d(i({fullWidth:!0,onChange:(f,u)=>{h(u),w==null||w(u,$.getValues())},onInputChange:(f,u,G)=>{G==="input"&&setTimeout(()=>{T==null||T(u,$.getValues())},0)},slotProps:d(i({},p.slotProps||{}),{paper:d(i({},(p.slotProps||{}).paper||{}),{sx:i({border:`1px solid ${F2.neutral[30]}`,boxShadow:"0px 2px 4px rgba(0, 0, 0, 0.15)"},((g=(p.slotProps||{}).paper)==null?void 0:g.sx)||{})})}),options:Z,value:l||(C?[]:null),multiple:C,open:p.disabled?!1:void 0,noOptionsText:t?void 0:J(x2,{sx:{justifyContent:"flex-start",padding:`${e0(6)} ${e0(-16)}`,margin:0},fullWidth:!0,onClick:()=>v(l),variant:"text",startIcon:E(g1,{icon:A1}),children:["Adicionar ",V&&`"${V}"`]}),isOptionEqualToValue:(f,u)=>u?typeof f=="string"&&typeof u=="string"?f===u:typeof f=="object"&&typeof u=="object"?typeof f.value=="object"&&typeof u.value=="object"&&f.key!==void 0&&u.key!==void 0?f.key===u.key:f.value===u.value:typeof f=="object"&&typeof u=="string":!1,renderOption:(f,u)=>typeof u=="object"?i0("li",d(i({},f),{key:u.key||u.value}),J(o1,{container:!0,direction:"column",children:[E(o1,{item:!0,children:u.label}),u.afterLabel&&E(o1,{item:!0,children:u.afterLabel})]})):i0("li",d(i({},f),{key:u}),u),ListboxComponent:u2(function(u,G){return J(w1,{children:[E("ul",d(i({},u),{ref:G})),!!S&&E("div",d(i({},u),{children:J(w1,{children:[E(o1,{px:2,py:1,children:E(C2,{})}),S]})}),"creatable-footer")]})})},p),{sx:i({"& div.MuiInputBase-root":{paddingRight:`${F(l)} !important`}},p.sx),renderInput:f=>E(y2,i(d(i({placeholder:B},f),{error:!!_,InputProps:d(i({},f.InputProps),{inputRef:o,endAdornment:J("div",{className:"endAdornments",children:[f.InputProps.endAdornment,!t&&J(w1,{children:[m(l)?J("div",{className:"editable",children:[E("div",{className:"divider"}),E("div",{className:"button",onClick:()=>r(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:()=>v(l),children:E(g1,{icon:A1,size:"24px",removeMargin:!0})})]})]})]})})}),L))}),c)}),E(U,{name:c,disableIcon:A})]})}})},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 _2}from"react/jsx-runtime";var $2=I=>{var L=I,{name:c,rules:a,defaultValue:n,shouldUnregister:s,label:e,labelPlacement:y,required:Z,disableIconError:x,onChange:S}=L,M=D(L,["name","rules","defaultValue","shouldUnregister","label","labelPlacement","required","disableIconError","onChange"]);let b=w2();if(!b)throw new Error("Para usar o <Checkbox /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");return Z1(S2,{control:b.control,name:c,rules:a,defaultValue:n,shouldUnregister:s,render:({field:{value:C,onChange:k}})=>_2(P2,{display:"flex",flexDirection:"column",children:[Z1(D2,{control:Z1(T2,i({checked:!!C,value:C!=null?C:"",defaultValue:C,onChange:(w,T)=>{k(w,T),S==null||S(w,T)}},M),c),label:Z1(R,{label:e,required:Z,regular:!0}),labelPlacement:y||"end"}),Z1(U,{name:c,disableIcon:x})]})})},B2=$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 I=M,{name:c,rules:a,defaultValue:n,shouldUnregister:s,label:e,labelPlacement:y,disableIconError:Z,onChange:x}=I,S=D(I,["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:b,onChange:C}})=>z2(G2,{display:"flex",flexDirection:"column",children:[p1(U2,{control:p1(R2,i({value:b!=null?b:"",checked:b!=null?b:!1,defaultValue:b,onChange:(k,w)=>{C(k,w),x==null||x(k,w)}},S),c),label:p1(R,{label:e}),labelPlacement:y||"end"}),p1(U,{name:c,disableIcon:Z})]})})},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 e=s,{label:c,labelPlacement:a}=e,n=D(e,["label","labelPlacement"]);return L1(Y2,{display:"flex",flexDirection:"column",children:L1(W2,{control:L1(j2,i({},n)),label:L1(R,{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=I=>{var L=I,{name:c,rules:a,defaultValue:n,shouldUnregister:s,label:e,required:y,children:Z,orientation:x="row",disableIconError:S}=L,M=D(L,["name","rules","defaultValue","shouldUnregister","label","required","children","orientation","disableIconError"]);let b=Q2();if(!b)throw new Error("Para usar o <RadioGroup /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");return y1(K2,{control:b.control,name:c,rules:a,defaultValue:n,shouldUnregister:s,render:({field:{value:C,onChange:k}})=>e3(X2,{display:"flex",flexDirection:"column",children:[e&&y1(R,{label:e,required:y}),y1(c3,d(i({value:C||"",name:c},M),{onChange:w=>{var T,B;(B=M==null?void 0:M.onChange)==null||B.call(M,w,(T=w.target)==null?void 0:T.value),k(w)},style:{display:"flex",flexDirection:x},children:Z}),c),y1(U,{name:c,disableIcon:S})]})})},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=y=>{var Z=y,{name:c,rules:a,defaultValue:n,shouldUnregister:s}=Z,e=D(Z,["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:S,onChange:M}})=>r0(o3,i({value:S||(e==null?void 0:e.min)||0,onChange:M,valueLabelDisplay:"auto"},e),c)})},h3=n3;var s0=G1(B1());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 b=L,{rules:c,name:a,defaultValue:n,shouldUnregister:s,datePickerProps:e,label:y,required:Z,placeholder:x,disabled:S,disableIconError:M}=b,I=D(b,["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 k=Y(C.formState.errors,a),w=(e==null?void 0:e.format)||"DD/MM/YYYY",T=c?M3([h0(w),c]):h0(w);return u1(g3,{dateAdapter:V3,adapterLocale:s0.default,localeText:L3.components.MuiLocalizationProvider.defaultProps.localeText,children:u1(Z3,{control:C.control,name:a,rules:T,defaultValue:n,shouldUnregister:s,render:({field:{value:B,onChange:A,ref:p}})=>C3(u3,{display:"flex",flexDirection:"column",children:[y&&u1(R,{label:y,required:Z}),x3(f3,d(i({},e),{key:a,value:B!=null?B:null,format:w,onChange:(H,P)=>{var $;A(H,P),($=e==null?void 0:e.onChange)==null||$.call(e,H,P)},disabled:S,slots:{textField:H3,openPickerButton:H=>u1(n0,d(i({},H),{size:I.size}))},slotProps:{textField:H=>{var P;return d(i(d(i({variant:"outlined"},H),{error:!!k}),I),{inputProps:d(i({},H.inputProps),{placeholder:x||((P=H.inputProps)==null?void 0:P.placeholder)}),InputProps:d(i({},H.InputProps),{inputRef($){p($),typeof H.inputRef=="function"&&H.inputRef($)}})})}}})),u1(U,{name:a,disableIcon:M})]})})})},b3=m3(y3);var d0=G1(B1());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 B3}from"@mui/material";import{TimePicker as _3}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 b=L,{rules:c,defaultValue:a,shouldUnregister:n,name:s,required:e,label:y,timePickerProps:Z,placeholder:x,disabled:S,disableIconError:M}=b,I=D(b,["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 k=Y(C.formState.errors,s),w=(Z==null?void 0:Z.format)||"HH:mm",T=c?$3([v0(w),c]):v0(w);return t1(E3,{dateAdapter:I3,adapterLocale:d0.default,localeText:G3.components.MuiLocalizationProvider.defaultProps.localeText,children:t1(P3,{control:C.control,name:s,rules:T,defaultValue:a,shouldUnregister:n,render:({field:{value:B,onChange:A,ref:p}})=>O3(D3,{display:"flex",flexDirection:"column",children:[y&&t1(R,{label:y,required:e}),t1(_3,d(i({ampm:!1,format:w,value:B!=null?B:null,disabled:S},Z),{onChange:(H,P)=>{var $;A(H,P),($=Z==null?void 0:Z.onChange)==null||$.call(Z,H,P)},slots:{textField:B3,openPickerButton:H=>t1(t0,d(i({},H),{size:I.size}))},slotProps:{textField:H=>{var P;return d(i(d(i({variant:"outlined"},H),{error:!!k}),I),{inputProps:d(i({},H.inputProps),{placeholder:x||((P=H.inputProps)==null?void 0:P.placeholder)}),InputProps:d(i({},H.InputProps),{inputRef($){p($),typeof H.inputRef=="function"&&H.inputRef($)}})})}}}),s),t1(U,{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=b=>{var C=b,{name:c,defaultValue:a,rules:n,shouldUnregister:s,label:e,required:y,noOptionsText:Z,placeholder:x,onInputChange:S,onChange:M,disableIconError:I}=C,L=D(C,["name","defaultValue","rules","shouldUnregister","label","required","noOptionsText","placeholder","onInputChange","onChange","disableIconError"]);let k=Y3();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=()=>{},n1(z3,{name:c,control:k.control,defaultValue:a,rules:n,shouldUnregister:s,render:({field:T})=>{var B;return m0(b1,{display:"flex",flexDirection:"column",children:[e&&n1(R,{label:e,required:y}),n1(j3,d(i({onChange:(A,p)=>{T.onChange(p),M==null||M(p,k.getValues())},onInputChange:(A,p,H)=>{H==="input"&&(T.onChange(p),setTimeout(()=>{S==null||S(p,k.getValues())},0))},slotProps:d(i({},L.slotProps||{}),{paper:d(i({},(L.slotProps||{}).paper||{}),{sx:i({border:`1px solid ${N3.neutral[30]}`,boxShadow:"0px 2px 4px rgba(0, 0, 0, 0.15)"},((B=(L.slotProps||{}).paper)==null?void 0:B.sx)||{})})}),isOptionEqualToValue:(A,p)=>A.value===p.value,renderOption:(A,p)=>Q3("li",d(i({},A),{key:p.key||p.value,onClick:H=>{var P;(P=A.onClick)==null||P.call(A,H),T.onChange(p)}}),m0(b1,{container:!0,direction:"column",children:[n1(b1,{item:!0,children:p.label}),p.afterLabel&&n1(b1,{item:!0,children:p.afterLabel})]})),value:T.value||null,open:L.disabled?!1:void 0,noOptionsText:Z||"Nenhuma op\xE7\xE3o encontrada"},L),{renderInput:A=>{var p,H,P;return n1(W3,d(i(i({placeholder:x},A),L.textFieldProps),{error:!!w,InputProps:d(i(i({},A.InputProps),(p=L.textFieldProps)==null?void 0:p.InputProps),{inputRef:T.ref,inputProps:i(i({},A.inputProps),(P=(H=L.textFieldProps)==null?void 0:H.InputProps)==null?void 0:P.inputProps)})}))}}),c),n1(U,{name:c,disableIcon:I})]})}})},K3=q3(J3);export{K3 as Autocomplete,B2 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.1",
|
|
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-smarten": "*"
|
|
54
54
|
}
|
|
55
55
|
}
|