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