@s_mart/form 4.0.2 → 4.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +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,A2=Object.getOwnPropertyNames,w1=Object.getOwnPropertySymbols,F2=Object.getPrototypeOf,X1=Object.prototype.hasOwnProperty,Z0=Object.prototype.propertyIsEnumerable;var m0=(c,a,o)=>a in c?L1(c,a,{enumerable:!0,configurable:!0,writable:!0,value:o}):c[a]=o,r=(c,a)=>{for(var o in a||(a={}))X1.call(a,o)&&m0(c,o,a[o]);if(w1)for(var o of w1(a))Z0.call(a,o)&&m0(c,o,a[o]);return c},m=(c,a)=>b2(c,C2(a));var T=(c,a)=>{var o={};for(var s in c)X1.call(c,s)&&a.indexOf(s)<0&&(o[s]=c[s]);if(c!=null&&w1)for(var s of w1(c))a.indexOf(s)<0&&Z0.call(c,s)&&(o[s]=c[s]);return o};var p0=(c,a)=>()=>(a||c((a={exports:{}}).exports,a),a.exports),k2=(c,a)=>{for(var o in a)L1(c,o,{get:a[o],enumerable:!0})},u0=(c,a,o,s)=>{if(a&&typeof a=="object"||typeof a=="function")for(let e of A2(a))!X1.call(c,e)&&e!==o&&L1(c,e,{get:()=>a[e],enumerable:!(s=x2(a,e))||s.enumerable});return c};var p1=(c,a,o)=>(o=c!=null?y2(F2(c)):{},u0(a||!c||!c.__esModule?L1(o,"default",{value:c,enumerable:!0}):o,c)),S2=c=>u0(L1({},"__esModule",{value:!0}),c);var j0=p0((h0,s0)=>{(function(c,a){typeof h0=="object"&&typeof s0!="undefined"?s0.exports=a():typeof define=="function"&&define.amd?define(a):(c=typeof globalThis!="undefined"?globalThis:c||self).dayjs=a()})(h0,function(){"use strict";var c=1e3,a=6e4,o=36e5,s="millisecond",e="second",g="minute",p="hour",C="day",S="week",u="month",G="quarter",L="year",y="date",A="Invalid Date",F=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,w=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,$={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(t){var l=["th","st","nd","rd"],i=t%100;return"["+t+(l[(i-20)%10]||l[i]||l[0])+"]"}},B=function(t,l,i){var f=String(t);return!f||f.length>=l?t:""+Array(l+1-f.length).join(i)+t},k={s:B,z:function(t){var l=-t.utcOffset(),i=Math.abs(l),f=Math.floor(i/60),n=i%60;return(l<=0?"+":"-")+B(f,2,"0")+":"+B(n,2,"0")},m:function t(l,i){if(l.date()<i.date())return-t(i,l);var f=12*(i.year()-l.year())+(i.month()-l.month()),n=l.clone().add(f,u),V=i-n<0,h=l.clone().add(f+(V?-1:1),u);return+(-(f+(i-n)/(V?n-h:h-n))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(t){return{M:u,y:L,w:S,d:C,D:y,h:p,m:g,s:e,ms:s,Q:G}[t]||String(t||"").toLowerCase().replace(/s$/,"")},u:function(t){return t===void 0}},M="en",H={};H[M]=$;var P=function(t){return t instanceof x},_=function t(l,i,f){var n;if(!l)return M;if(typeof l=="string"){var V=l.toLowerCase();H[V]&&(n=V),i&&(H[V]=i,n=V);var h=l.split("-");if(!n&&h.length>1)return t(h[0])}else{var v=l.name;H[v]=l,n=v}return!f&&n&&(M=n),n||!f&&M},I=function(t,l){if(P(t))return t.clone();var i=typeof l=="object"?l:{};return i.date=t,i.args=arguments,new x(i)},d=k;d.l=_,d.i=P,d.w=function(t,l){return I(t,{locale:l.$L,utc:l.$u,x:l.$x,$offset:l.$offset})};var x=function(){function t(i){this.$L=_(i.locale,null,!0),this.parse(i)}var l=t.prototype;return l.parse=function(i){this.$d=function(f){var n=f.date,V=f.utc;if(n===null)return new Date(NaN);if(d.u(n))return new Date;if(n instanceof Date)return new Date(n);if(typeof n=="string"&&!/Z$/i.test(n)){var h=n.match(F);if(h){var v=h[2]-1||0,R=(h[7]||"0").substring(0,3);return V?new Date(Date.UTC(h[1],v,h[3]||1,h[4]||0,h[5]||0,h[6]||0,R)):new Date(h[1],v,h[3]||1,h[4]||0,h[5]||0,h[6]||0,R)}}return new Date(n)}(i),this.$x=i.x||{},this.init()},l.init=function(){var i=this.$d;this.$y=i.getFullYear(),this.$M=i.getMonth(),this.$D=i.getDate(),this.$W=i.getDay(),this.$H=i.getHours(),this.$m=i.getMinutes(),this.$s=i.getSeconds(),this.$ms=i.getMilliseconds()},l.$utils=function(){return d},l.isValid=function(){return this.$d.toString()!==A},l.isSame=function(i,f){var n=I(i);return this.startOf(f)<=n&&n<=this.endOf(f)},l.isAfter=function(i,f){return I(i)<this.startOf(f)},l.isBefore=function(i,f){return this.endOf(f)<I(i)},l.$g=function(i,f,n){return d.u(i)?this[f]:this.set(n,i)},l.unix=function(){return Math.floor(this.valueOf()/1e3)},l.valueOf=function(){return this.$d.getTime()},l.startOf=function(i,f){var n=this,V=!!d.u(f)||f,h=d.p(i),v=function(Z1,N){var o1=d.w(n.$u?Date.UTC(n.$y,N,Z1):new Date(n.$y,N,Z1),n);return V?o1:o1.endOf(C)},R=function(Z1,N){return d.w(n.toDate()[Z1].apply(n.toDate("s"),(V?[0,0,0,0]:[23,59,59,999]).slice(N)),n)},U=this.$W,z=this.$M,r1=this.$D,a1="set"+(this.$u?"UTC":"");switch(h){case L:return V?v(1,0):v(31,11);case u:return V?v(1,z):v(0,z+1);case S:var V1=this.$locale().weekStart||0,g1=(U<V1?U+7:U)-V1;return v(V?r1-g1:r1+(6-g1),z);case C:case y:return R(a1+"Hours",0);case p:return R(a1+"Minutes",1);case g:return R(a1+"Seconds",2);case e:return R(a1+"Milliseconds",3);default:return this.clone()}},l.endOf=function(i){return this.startOf(i,!1)},l.$set=function(i,f){var n,V=d.p(i),h="set"+(this.$u?"UTC":""),v=(n={},n[C]=h+"Date",n[y]=h+"Date",n[u]=h+"Month",n[L]=h+"FullYear",n[p]=h+"Hours",n[g]=h+"Minutes",n[e]=h+"Seconds",n[s]=h+"Milliseconds",n)[V],R=V===C?this.$D+(f-this.$W):f;if(V===u||V===L){var U=this.clone().set(y,1);U.$d[v](R),U.init(),this.$d=U.set(y,Math.min(this.$D,U.daysInMonth())).$d}else v&&this.$d[v](R);return this.init(),this},l.set=function(i,f){return this.clone().$set(i,f)},l.get=function(i){return this[d.p(i)]()},l.add=function(i,f){var n,V=this;i=Number(i);var h=d.p(f),v=function(z){var r1=I(V);return d.w(r1.date(r1.date()+Math.round(z*i)),V)};if(h===u)return this.set(u,this.$M+i);if(h===L)return this.set(L,this.$y+i);if(h===C)return v(1);if(h===S)return v(7);var R=(n={},n[g]=a,n[p]=o,n[e]=c,n)[h]||1,U=this.$d.getTime()+i*R;return d.w(U,this)},l.subtract=function(i,f){return this.add(-1*i,f)},l.format=function(i){var f=this,n=this.$locale();if(!this.isValid())return n.invalidDate||A;var V=i||"YYYY-MM-DDTHH:mm:ssZ",h=d.z(this),v=this.$H,R=this.$m,U=this.$M,z=n.weekdays,r1=n.months,a1=function(N,o1,Q1,S1){return N&&(N[o1]||N(f,V))||Q1[o1].slice(0,S1)},V1=function(N){return d.s(v%12||12,N,"0")},g1=n.meridiem||function(N,o1,Q1){var S1=N<12?"AM":"PM";return Q1?S1.toLowerCase():S1},Z1={YY:String(this.$y).slice(-2),YYYY:this.$y,M:U+1,MM:d.s(U+1,2,"0"),MMM:a1(n.monthsShort,U,r1,3),MMMM:a1(r1,U),D:this.$D,DD:d.s(this.$D,2,"0"),d:String(this.$W),dd:a1(n.weekdaysMin,this.$W,z,2),ddd:a1(n.weekdaysShort,this.$W,z,3),dddd:z[this.$W],H:String(v),HH:d.s(v,2,"0"),h:V1(1),hh:V1(2),a:g1(v,R,!0),A:g1(v,R,!1),m:String(R),mm:d.s(R,2,"0"),s:String(this.$s),ss:d.s(this.$s,2,"0"),SSS:d.s(this.$ms,3,"0"),Z:h};return V.replace(w,function(N,o1){return o1||Z1[N]||h.replace(":","")})},l.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},l.diff=function(i,f,n){var V,h=d.p(f),v=I(i),R=(v.utcOffset()-this.utcOffset())*a,U=this-v,z=d.m(this,v);return z=(V={},V[L]=z/12,V[u]=z,V[G]=z/3,V[S]=(U-R)/6048e5,V[C]=(U-R)/864e5,V[p]=U/o,V[g]=U/a,V[e]=U/c,V)[h]||U,n?z:d.a(z)},l.daysInMonth=function(){return this.endOf(u).$D},l.$locale=function(){return H[this.$L]},l.locale=function(i,f){if(!i)return this.$L;var n=this.clone(),V=_(i,f,!0);return V&&(n.$L=V),n},l.clone=function(){return d.w(this.$d,this)},l.toDate=function(){return new Date(this.valueOf())},l.toJSON=function(){return this.isValid()?this.toISOString():null},l.toISOString=function(){return this.$d.toISOString()},l.toString=function(){return this.$d.toUTCString()},t}(),Z=x.prototype;return I.prototype=Z,[["$ms",s],["$s",e],["$m",g],["$H",p],["$W",C],["$M",u],["$y",L],["$D",y]].forEach(function(t){Z[t[1]]=function(l){return this.$g(l,t[0],t[1])}}),I.extend=function(t,l){return t.$i||(t(l,x,I),t.$i=!0),I},I.locale=_,I.isDayjs=P,I.unix=function(t){return I(1e3*t)},I.en=H[M],I.Ls=H,I.p={},I})});var d0=p0((t0,v0)=>{(function(c,a){typeof t0=="object"&&typeof v0!="undefined"?v0.exports=a(j0()):typeof define=="function"&&define.amd?define(["dayjs"],a):(c=typeof globalThis!="undefined"?globalThis:c||self).dayjs_locale_pt_br=a(c.dayjs)})(t0,function(c){"use strict";function a(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var o=a(c),s={name:"pt-br",weekdays:"domingo_segunda-feira_ter\xE7a-feira_quarta-feira_quinta-feira_sexta-feira_s\xE1bado".split("_"),weekdaysShort:"dom_seg_ter_qua_qui_sex_s\xE1b".split("_"),weekdaysMin:"Do_2\xAA_3\xAA_4\xAA_5\xAA_6\xAA_S\xE1".split("_"),months:"janeiro_fevereiro_mar\xE7o_abril_maio_junho_julho_agosto_setembro_outubro_novembro_dezembro".split("_"),monthsShort:"jan_fev_mar_abr_mai_jun_jul_ago_set_out_nov_dez".split("_"),ordinal:function(e){return e+"\xBA"},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY [\xE0s] HH:mm",LLLL:"dddd, D [de] MMMM [de] YYYY [\xE0s] HH:mm"},relativeTime:{future:"em %s",past:"h\xE1 %s",s:"poucos segundos",m:"um minuto",mm:"%d minutos",h:"uma hora",hh:"%d horas",d:"um dia",dd:"%d dias",M:"um m\xEAs",MM:"%d meses",y:"um ano",yy:"%d anos"}};return o.default.locale(s,null,!0),s})});var K2={};k2(K2,{Autocomplete:()=>g2,Checkbox:()=>R0,Creatable:()=>G0,DatePicker:()=>r2,Form:()=>g0,FormProvider:()=>P1,RadioButton:()=>O0,RadioGroup:()=>q0,Searchable:()=>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"),w2=e=>{var g=e,{children:c,style:a,onSubmit:o}=g,s=T(g,["children","style","onSubmit"]);return(0,c0.jsx)(M0.FormProvider,m(r({},s),{children:(0,c0.jsx)("form",{onSubmit:p=>{p.preventDefault(),p.stopPropagation(),o(p)},style:a,children:c})}))},P1=w2;var H0=require("react"),f0=require("react-hook-form"),V0=require("@hookform/resolvers/zod");var P2=s=>{var e=s,{disableDefaultValuesUpdate:c,onSubmit:a}=e,o=T(e,["disableDefaultValuesUpdate","onSubmit"]);let g=(0,f0.useForm)(m(r({},o),{resolver:o.schema&&(0,V0.zodResolver)(o.schema)}));return(0,H0.useEffect)(()=>{c||g.reset(o.defaultValues)},[o.defaultValues,g.reset]),m(r({},g),{onSubmit:g.handleSubmit(p=>a(p,g))})},D1=P2;var L0=require("react/jsx-runtime");function D2(s){var e=s,{children:c,style:a}=e,o=T(e,["children","style"]);let g=D1(o);return(0,L0.jsx)(P1,m(r({},g),{style:a,children:typeof c=="function"?c(g):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:o})=>(0,y1.jsxs)("span",{style:{display:"flex",alignItems:"center",gap:(0,C0.toRem)(2)},children:[(0,y1.jsx)(a0.Typography,{variant:"caption",fontWeight:o?400:700,style:{display:"flex",alignItems:"center"},children:c}),a&&(0,y1.jsx)(a0.Typography,{variant:"caption",fontWeight:900,color:"error",children:"*"})]});var A0=require("react-hook-form"),F0=require("@s_mart/core");var Y=(c,a)=>a.replace(/[[\]]/g,"").split(".").reduce((s,e)=>s==null?void 0:s[e],c);var k0=require("react/jsx-runtime"),q=({name:c,disableIcon:a})=>{var e;let o=(0,A0.useFormContext)(),s=Y((e=o==null?void 0:o.formState)==null?void 0:e.errors,c);return s?(0,k0.jsx)(F0.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=w=>{var $=w,{name:c,rules:a,defaultValue:o,shouldUnregister:s,label:e,required:g,mask:p,variant:C="outlined",info:S,parse:u,inputMode:G,format:L,onInputChange:y,disableIconError:A}=$,F=T($,["name","rules","defaultValue","shouldUnregister","label","required","mask","variant","info","parse","inputMode","format","onInputChange","disableIconError"]);let B=(0,T1.useFormContext)();if(!B)throw new Error("Para usar o <TextField /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let[k,M]=(0,$1.useState)(!1),H=d=>{var Z;let x=d;return L&&(x=L(d)),p?(Z=u1==null?void 0:u1[p])==null?void 0:Z.format(x):x},P=d=>{var Z;let x=d;return u&&(x=u(d)),p?(Z=u1==null?void 0:u1[p])==null?void 0:Z.parse(x):x},_=d=>{if(!d||p!=="porcentagem"&&p!=="porcentagem0")return;d==null||d.stopPropagation();let x=(d==null?void 0:d.target).value;if(x){let Z=String(x);if(Z.length>0){let t=Z.indexOf("%");t>-1&&(d.currentTarget.selectionEnd=t)}}},I=Y(B.formState.errors,c);return(0,j.jsx)(T1.Controller,{control:B.control,name:c,rules:a,defaultValue:o,shouldUnregister:s,render:({field:{value:d,onChange:x,ref:Z}})=>(0,j.jsxs)(h1.Grid,{display:"flex",flexDirection:"column",children:[(0,j.jsxs)("div",{style:{display:"flex"},children:[e&&(0,j.jsx)(h1.Grid,{item:!0,children:(0,j.jsx)(O,{label:e,required:g})}),S&&(0,j.jsx)(h1.Grid,{item:!0,children:(0,j.jsx)(b1.Tooltip,{title:S,placement:"top",children:(0,j.jsx)("div",{style:{width:"fit-content"},children:(0,j.jsx)(b1.LIcon,{icon:n1,color:"#757575"})})})})]}),(0,j.jsx)(h1.TextField,m(r({variant:C,defaultValue:o,value:H(d||(d!=0?"":d)),onChange:t=>{var i;let l=P((i=t==null?void 0:t.target)==null?void 0:i.value);x(l),y==null||y(l,B.getValues())},error:!!I},F),{type:F.type==="password"?k?"text":"password":F.type,autoComplete:F.autoComplete||"off",inputProps:r({inputMode:G},F.inputProps),InputProps:r({onKeyDown:_,inputRef:Z,endAdornment:F.type==="password"&&(0,j.jsx)(h1.InputAdornment,{position:"start",onClick:()=>M(!k),style:{cursor:"pointer"},children:(0,j.jsx)(b1.LIcon,{icon:k?y0:b0,size:"24px",removeMargin:!0})})},F.InputProps)}),c),(0,j.jsx)(q,{name:c,disableIcon:A})]})})},S0=(0,$1.memo)($2);var _1=require("react"),B1=require("react-hook-form"),i1=require("@s_mart/core");var w0={description:"m27.4 24.4 7-7c.4-.4.4-1 0-1.5l-1.6-1.6a1 1 0 0 0-1.5 0l-7 7-7-7a1 1 0 0 0-1.4 0l-1.6 1.6a1 1 0 0 0 0 1.5l7 7-7 7a1 1 0 0 0 0 1.4l1.6 1.6c.4.4 1 .4 1.5 0l7-7 7 7c.3.4 1 .4 1.4 0l1.6-1.6c.4-.4.4-1 0-1.5l-7-7Z",id:"line-times-regular"};var P0=require("@s_mart/tokens"),W=require("@mui/material");var E=require("react/jsx-runtime"),T2=$=>{var B=$,{name:c,rules:a,defaultValue:o,shouldUnregister:s,label:e,required:g,options:p,placeholder:C,clearable:S,disableOnChangeForm:u=!1,multiple:G,info:L,footer:y,onChange:A,disableIconError:F}=B,w=T(B,["name","rules","defaultValue","shouldUnregister","label","required","options","placeholder","clearable","disableOnChangeForm","multiple","info","footer","onChange","disableIconError"]);let k=(0,B1.useFormContext)(),{palette:M}=(0,W.useTheme)(),[H,P]=(0,_1.useState)(!1);if(!k)throw new Error("Para usar o <Select /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let _=Y(k.formState.errors,c);return console.warn=()=>{},(0,E.jsx)(B1.Controller,{control:k.control,name:c,rules:a,defaultValue:o,shouldUnregister:s,render:({field:{value:I,onChange:d,ref:x}})=>(0,E.jsxs)(W.Grid,{display:"flex",flexDirection:"column",children:[(0,E.jsxs)("div",{style:{display:"flex"},children:[e&&(0,E.jsx)(W.Grid,{item:!0,children:(0,E.jsx)(O,{label:e,required:g})}),L&&(0,E.jsx)(W.Grid,{item:!0,children:(0,E.jsx)(i1.Tooltip,{title:L,placement:"top",children:(0,E.jsx)("div",{style:{width:"fit-content"},children:(0,E.jsx)(i1.LIcon,{icon:n1,color:"#757575"})})})})]}),(0,E.jsxs)(W.Select,m(r({open:H,onOpen:()=>P(!0),onClose:()=>P(!1),displayEmpty:!!C,variant:"outlined",autoComplete:"off",value:I?I||"":G?[]:"",renderValue:Z=>{if(Z.label)return Z.label;if(C)return(0,E.jsx)("p",{style:{color:M.grey[400]},children:C})},multiple:G,onChange:Z=>{!u&&d(Z.target.value),A&&A(Z.target.value,k.getValues())},error:!!_,size:w.size||"medium",inputRef:x},w),{endAdornment:(0,E.jsxs)(E.Fragment,{children:[w.endAdornment,!!(S&&I)&&(0,E.jsx)(i1.IconButton,{variant:"text",color:"neutral",size:"small",sx:{borderRadius:"50%",position:"absolute",right:"2rem"},style:{padding:0},"aria-label":"Clear",title:"Clear",onClick:()=>{!u&&d(null),A&&A(null,k.getValues())},children:(0,E.jsx)(i1.LIcon,{icon:w0,color:P0.colorPalette.neutral[100],size:"25px",removeMargin:!0})})]}),children:[C&&(0,E.jsx)(W.MenuItem,{disabled:!0,value:"",children:(0,E.jsx)("p",{style:{color:M.grey[400]},children:C})}),p==null?void 0:p.map((Z,t)=>(0,E.jsx)(W.MenuItem,{value:Z,children:(0,E.jsxs)(W.Grid,{container:!0,direction:"column",children:[(0,E.jsx)(W.Grid,{item:!0,children:Z.label}),Z.afterLabel&&(0,E.jsx)(W.Grid,{item:!0,children:Z.afterLabel})]})},t)),y&&[(0,E.jsx)(W.Grid,{px:2,py:1,children:(0,E.jsx)(i1.Divider,{})},"footer-divider"),(0,E.jsx)("div",{children:y({closeSelect:()=>P(!1)})},"footer-content")]]}),c),(0,E.jsx)(q,{name:c,disableIcon:F})]})})},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 D=require("react/jsx-runtime"),i0=require("react"),_2=B=>{var k=B,{name:c,rules:a,defaultValue:o,shouldUnregister:s,label:e,required:g,options:p,textFieldProps:C,noOptionsText:S,footer:u,multiple:G,info:L,placeholder:y,onChange:A,onInputChange:F,disableIconError:w}=k,$=T(k,["name","rules","defaultValue","shouldUnregister","label","required","options","textFieldProps","noOptionsText","footer","multiple","info","placeholder","onChange","onInputChange","disableIconError"]);let M=(0,E1.useFormContext)();if(!M)throw new Error("Para usar o <Searchable /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let H=Y(M.formState.errors,c);return console.warn=()=>{},(0,D.jsx)(E1.Controller,{control:M.control,name:c,rules:a,defaultValue:o,shouldUnregister:s,render:({field:{onChange:P,value:_,ref:I}})=>{var d;return(0,D.jsxs)(J.Grid,{display:"flex",flexDirection:"column",children:[(0,D.jsxs)("div",{style:{display:"flex"},children:[e&&(0,D.jsx)(J.Grid,{item:!0,children:(0,D.jsx)(O,{label:e,required:g})}),L&&(0,D.jsx)(J.Grid,{item:!0,children:(0,D.jsx)(d1.Tooltip,{title:L,placement:"top",children:(0,D.jsx)("div",{style:{width:"fit-content"},children:(0,D.jsx)(d1.LIcon,{icon:n1,color:"#757575"})})})})]}),(0,D.jsx)(J.Autocomplete,m(r({onChange:(x,Z)=>{P(Z),A==null||A(Z,M.getValues())},onInputChange:(x,Z,t)=>{t==="input"&&setTimeout(()=>{F==null||F(Z,M.getValues())},0)},slotProps:m(r({},$.slotProps||{}),{paper:m(r({},($.slotProps||{}).paper||{}),{sx:r({border:`1px solid ${$0.colorPalette.neutral[30]}`,boxShadow:"0px 2px 4px rgba(0, 0, 0, 0.15)"},((d=($.slotProps||{}).paper)==null?void 0:d.sx)||{})})}),value:_||(G?[]:null),options:p,multiple:G,noOptionsText:(0,D.jsxs)(D.Fragment,{children:[S||"Nenhum resultado encontrado",u?(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(J.Grid,{py:1,children:(0,D.jsx)(d1.Divider,{})}),u]}):null]}),isOptionEqualToValue:(x,Z)=>typeof x=="string"&&typeof Z=="string"?x===Z:typeof x=="object"&&typeof Z=="object"?typeof x.value=="object"&&typeof Z.value=="object"&&x.key!==void 0&&Z.key!==void 0?x.key===Z.key:x.value===Z.value:!1,renderOption:(x,Z)=>typeof Z=="object"?(0,i0.createElement)("li",m(r({},x),{key:Z.key||Z.value}),(0,D.jsxs)(J.Grid,{container:!0,direction:"column",children:[(0,D.jsx)(J.Grid,{item:!0,children:Z.label}),Z.afterLabel&&(0,D.jsx)(J.Grid,{item:!0,children:Z.afterLabel})]})):(0,i0.createElement)("li",m(r({},x),{key:Z}),Z),ListboxComponent:(0,I1.forwardRef)(function(Z,t){return(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)("ul",m(r({},Z),{ref:t})),!!u&&(0,D.jsx)("div",m(r({},Z),{children:(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(J.Grid,{px:2,py:1,children:(0,D.jsx)(d1.Divider,{})}),u]})}),"searchable-footer")]})})},$),{renderInput:x=>(0,D.jsx)(J.TextField,m(r(r({error:!!H,placeholder:y},x),C),{inputRef:I}))}),c),(0,D.jsx)(q,{name:c,disableIcon:w})]})}})},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 b=require("react/jsx-runtime"),o0=require("react"),I2=H=>{var P=H,{name:c,rules:a,defaultValue:o,shouldUnregister:s,label:e,required:g,options:p,editable:C,footer:S,onEditOption:u,onCreateOption:G,textFieldProps:L,hideAddButton:y,multiple:A,info:F,onChange:w,onInputChange:$,placeholder:B,disableIconError:k}=P,M=T(P,["name","rules","defaultValue","shouldUnregister","label","required","options","editable","footer","onEditOption","onCreateOption","textFieldProps","hideAddButton","multiple","info","onChange","onInputChange","placeholder","disableIconError"]);let _=(0,R1.useFormContext)();if(!_)throw new Error("Para usar o <Creatable /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let I=Y(_.formState.errors,c),d=l=>{let i=0;return L!=null&&L.InputProps||(i+=2.5),y||(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=>{G?G(l):console.error("onCreateOption n\xE3o foi definido")},t=l=>{u?u(l):console.error("onEditOption n\xE3o foi definido")};return(0,b.jsx)(R1.Controller,{control:_.control,name:c,rules:a,defaultValue:o,shouldUnregister:s,render:({field:{value:l,onChange:i,ref:f}})=>{var V;let n=(l==null?void 0:l.label)||(l==null?void 0:l.value)||l;return(0,b.jsxs)(K.Grid,{display:"flex",flexDirection:"column",children:[(0,b.jsxs)("div",{style:{display:"flex"},children:[e&&(0,b.jsx)(K.Grid,{item:!0,children:(0,b.jsx)(O,{label:e,required:g})}),F&&(0,b.jsx)(K.Grid,{item:!0,children:(0,b.jsx)(Q.Tooltip,{title:F,placement:"top",children:(0,b.jsx)("div",{style:{width:"fit-content"},children:(0,b.jsx)(Q.LIcon,{icon:n1,color:"#757575"})})})})]}),(0,b.jsx)(I0,{hideAddButton:y,children:(0,b.jsx)(K.Autocomplete,m(r({fullWidth:!0,onChange:(h,v)=>{i(v),w==null||w(v,_.getValues())},onInputChange:(h,v,R)=>{R==="input"&&setTimeout(()=>{$==null||$(v,_.getValues())},0)},slotProps:m(r({},M.slotProps||{}),{paper:m(r({},(M.slotProps||{}).paper||{}),{sx:r({border:`1px solid ${E0.colorPalette.neutral[30]}`,boxShadow:"0px 2px 4px rgba(0, 0, 0, 0.15)"},((V=(M.slotProps||{}).paper)==null?void 0:V.sx)||{})})}),options:p,value:l||(A?[]:null),multiple:A,noOptionsText:y?void 0:(0,b.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,b.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(r({},h),{key:v.key||v.value}),(0,b.jsxs)(K.Grid,{container:!0,direction:"column",children:[(0,b.jsx)(K.Grid,{item:!0,children:v.label}),v.afterLabel&&(0,b.jsx)(K.Grid,{item:!0,children:v.afterLabel})]})):(0,o0.createElement)("li",m(r({},h),{key:v}),v),ListboxComponent:(0,G1.forwardRef)(function(v,R){return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("ul",m(r({},v),{ref:R})),!!S&&(0,b.jsx)("div",m(r({},v),{children:(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(K.Grid,{px:2,py:1,children:(0,b.jsx)(Q.Divider,{})}),S]})}),"creatable-footer")]})})},M),{sx:r({"& div.MuiInputBase-root":{paddingRight:`${d(l)} !important`}},M.sx),renderInput:h=>(0,b.jsx)(K.TextField,r(m(r({placeholder:B},h),{error:!!I,InputProps:m(r({},h.InputProps),{inputRef:f,endAdornment:(0,b.jsxs)("div",{className:"endAdornments",children:[h.InputProps.endAdornment,!y&&(0,b.jsxs)(b.Fragment,{children:[x(l)?(0,b.jsxs)("div",{className:"editable",children:[(0,b.jsx)("div",{className:"divider"}),(0,b.jsx)("div",{className:"button",onClick:()=>t(l),children:(0,b.jsx)(Q.LIcon,{icon:x0,size:"24px",removeMargin:!0})})]}):null,(0,b.jsxs)("div",{className:"creatable",children:[(0,b.jsx)("div",{className:"divider"}),(0,b.jsx)("div",{className:"button",onClick:()=>Z(l),children:(0,b.jsx)(Q.LIcon,{icon:l0,size:"24px",removeMargin:!0})})]})]})]})})}),L))}),c)}),(0,b.jsx)(q,{name:c,disableIcon:k})]})}})},G0=(0,G1.memo)(I2);var O1=require("react-hook-form"),M1=require("@mui/material");var s1=require("react/jsx-runtime"),E2=G=>{var L=G,{name:c,rules:a,defaultValue:o,shouldUnregister:s,label:e,labelPlacement:g,required:p,disableIconError:C,onChange:S}=L,u=T(L,["name","rules","defaultValue","shouldUnregister","label","labelPlacement","required","disableIconError","onChange"]);let y=(0,O1.useFormContext)();if(!y)throw new Error("Para usar o <Checkbox /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");return(0,s1.jsx)(O1.Controller,{control:y.control,name:c,rules:a,defaultValue:o,shouldUnregister:s,render:({field:{value:A,onChange:F}})=>(0,s1.jsxs)(M1.Grid,{display:"flex",flexDirection:"column",children:[(0,s1.jsx)(M1.FormControlLabel,{control:(0,s1.jsx)(M1.Checkbox,r({checked:!!A,value:A!=null?A:"",defaultValue:A,onChange:(w,$)=>{F(w,$),S==null||S(w,$)}},u),c),label:(0,s1.jsx)(O,{label:e,required:p,regular:!0}),labelPlacement:g||"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 G=u,{name:c,rules:a,defaultValue:o,shouldUnregister:s,label:e,labelPlacement:g,disableIconError:p,onChange:C}=G,S=T(G,["name","rules","defaultValue","shouldUnregister","label","labelPlacement","disableIconError","onChange"]);let L=(0,q1.useFormContext)();if(!L)throw new Error("Para usar o <Switch /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");return(0,t1.jsx)(q1.Controller,{control:L.control,name:c,rules:a,defaultValue:o,shouldUnregister:s,render:({field:{value:y,onChange:A}})=>(0,t1.jsxs)(H1.Grid,{display:"flex",flexDirection:"column",children:[(0,t1.jsx)(H1.FormControlLabel,{control:(0,t1.jsx)(H1.Switch,r({value:y!=null?y:"",checked:y!=null?y:!1,defaultValue:y,onChange:(F,w)=>{A(F,w),C==null||C(F,w)}},S),c),label:(0,t1.jsx)(O,{label:e}),labelPlacement:g||"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 e=s,{label:c,labelPlacement:a}=e,o=T(e,["label","labelPlacement"]);return(0,C1.jsx)(f1.Grid,{display:"flex",flexDirection:"column",children:(0,C1.jsx)(f1.FormControlLabel,{control:(0,C1.jsx)(f1.Radio,r({},o)),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=G=>{var L=G,{name:c,rules:a,defaultValue:o,shouldUnregister:s,label:e,required:g,children:p,orientation:C="row",disableIconError:S}=L,u=T(L,["name","rules","defaultValue","shouldUnregister","label","required","children","orientation","disableIconError"]);let y=(0,z1.useFormContext)();if(!y)throw new Error("Para usar o <RadioGroup /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");return(0,m1.jsx)(z1.Controller,{control:y.control,name:c,rules:a,defaultValue:o,shouldUnregister:s,render:({field:{value:A,onChange:F}})=>(0,m1.jsxs)(Y1.Grid,{display:"flex",flexDirection:"column",children:[e&&(0,m1.jsx)(O,{label:e,required:g}),(0,m1.jsx)(Y1.RadioGroup,m(r({value:A||"",name:c},u),{onChange:w=>{var $,B;(B=u==null?void 0:u.onChange)==null||B.call(u,w,($=w.target)==null?void 0:$.value),F(w)},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=g=>{var p=g,{name:c,rules:a,defaultValue:o,shouldUnregister:s}=p,e=T(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:o,shouldUnregister:s,render:({field:{value:S,onChange:u}})=>(0,n0.jsx)(z0.Slider,r({value:S||(e==null?void 0:e.min)||0,onChange:u,valueLabelDisplay:"auto"},e),c)})},Y0=O2;var K0=require("react"),W1=require("react-hook-form"),Q0=require("@s_mart/core"),A1=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=L=>{var y=L,{rules:c,name:a,defaultValue:o,shouldUnregister:s,datePickerProps:e,label:g,required:p,placeholder:C,disabled:S,disableIconError:u}=y,G=T(y,["rules","name","defaultValue","shouldUnregister","datePickerProps","label","required","placeholder","disabled","disableIconError"]);let A=(0,W1.useFormContext)();if(!A)throw new Error("Para usar o <DataPicker /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let F=Y(A.formState.errors,a),w=(e==null?void 0:e.format)||"DD/MM/YYYY",$=c?(0,A1.composeValidators)([(0,A1.date)(w),c]):(0,A1.date)(w);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:A.control,name:a,rules:$,defaultValue:o,shouldUnregister:s,render:({field:{value:B,onChange:k,ref:M}})=>(0,v1.jsxs)(Q0.Grid,{display:"flex",flexDirection:"column",children:[g&&(0,v1.jsx)(O,{label:g,required:p}),(0,o2.createElement)(c2.DatePicker,m(r({},e),{key:a,value:B!=null?B:null,format:w,onChange:(H,P)=>{var _;k(H,P),(_=e==null?void 0:e.onChange)==null||_.call(e,H,P)},disabled:S,slots:{textField:X0.TextField,openPickerButton:H=>(0,v1.jsx)(J0,m(r({},H),{size:G.size}))},slotProps:{textField:H=>{var P;return m(r(m(r({variant:"outlined"},H),{error:!!F}),G),{inputProps:m(r({},H.inputProps),{placeholder:C||((P=H.inputProps)==null?void 0:P.placeholder)}),InputProps:m(r({},H.InputProps),{inputRef(_){M(_),typeof H.inputRef=="function"&&H.inputRef(_)}})})}}})),(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"),F1=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=L=>{var y=L,{rules:c,defaultValue:a,shouldUnregister:o,name:s,required:e,label:g,timePickerProps:p,placeholder:C,disabled:S,disableIconError:u}=y,G=T(y,["rules","defaultValue","shouldUnregister","name","required","label","timePickerProps","placeholder","disabled","disableIconError"]);let A=(0,N1.useFormContext)();if(!A)throw new Error("Para usar o <TimePicker /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let F=Y(A.formState.errors,s),w=(p==null?void 0:p.format)||"HH:mm",$=c?(0,F1.composeValidators)([(0,F1.time)(w),c]):(0,F1.time)(w);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:A.control,name:s,rules:$,defaultValue:a,shouldUnregister:o,render:({field:{value:B,onChange:k,ref:M}})=>(0,e1.jsxs)(v2.Grid,{display:"flex",flexDirection:"column",children:[g&&(0,e1.jsx)(O,{label:g,required:e}),(0,e1.jsx)(m2.TimePicker,m(r({ampm:!1,format:w,value:B!=null?B:null,disabled:S},p),{onChange:(H,P)=>{var _;k(H,P),(_=p==null?void 0:p.onChange)==null||_.call(p,H,P)},slots:{textField:d2.TextField,openPickerButton:H=>(0,e1.jsx)(s2,m(r({},H),{size:G.size}))},slotProps:{textField:H=>{var P;return m(r(m(r({variant:"outlined"},H),{error:!!F}),G),{inputProps:m(r({},H.inputProps),{placeholder:C||((P=H.inputProps)==null?void 0:P.placeholder)}),InputProps:m(r({},H.InputProps),{inputRef(_){M(_),typeof H.inputRef=="function"&&H.inputRef(_)}})})}}}),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"),k1=require("@s_mart/core"),V2=require("@s_mart/tokens");var l1=require("react/jsx-runtime"),L2=require("react"),J2=y=>{var A=y,{name:c,defaultValue:a,rules:o,shouldUnregister:s,label:e,required:g,noOptionsText:p,placeholder:C,onInputChange:S,onChange:u,disableIconError:G}=A,L=T(A,["name","defaultValue","rules","shouldUnregister","label","required","noOptionsText","placeholder","onInputChange","onChange","disableIconError"]);let F=(0,J1.useFormContext)();if(!F)throw new Error("Para usar o <Autocomplete /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let w=Y(F.formState.errors,c);return console.warn=()=>{},(0,l1.jsx)(J1.Controller,{name:c,control:F.control,defaultValue:a,rules:o,shouldUnregister:s,render:({field:$})=>{var B;return(0,l1.jsxs)(k1.Grid,{display:"flex",flexDirection:"column",children:[e&&(0,l1.jsx)(O,{label:e,required:g}),(0,l1.jsx)(K1.Autocomplete,m(r({onChange:(k,M)=>{$.onChange(M),u==null||u(M,F.getValues())},onInputChange:(k,M,H)=>{H==="input"&&($.onChange(M),setTimeout(()=>{S==null||S(M,F.getValues())},0))},slotProps:m(r({},L.slotProps||{}),{paper:m(r({},(L.slotProps||{}).paper||{}),{sx:r({border:`1px solid ${V2.colorPalette.neutral[30]}`,boxShadow:"0px 2px 4px rgba(0, 0, 0, 0.15)"},((B=(L.slotProps||{}).paper)==null?void 0:B.sx)||{})})}),isOptionEqualToValue:(k,M)=>k.value===M.value,renderOption:(k,M)=>(0,L2.createElement)("li",m(r({},k),{key:M.key||M.value,onClick:H=>{var P;(P=k.onClick)==null||P.call(k,H),$.onChange(M)}}),(0,l1.jsxs)(k1.Grid,{container:!0,direction:"column",children:[(0,l1.jsx)(k1.Grid,{item:!0,children:M.label}),M.afterLabel&&(0,l1.jsx)(k1.Grid,{item:!0,children:M.afterLabel})]})),value:$.value||null,noOptionsText:p||"Nenhuma op\xE7\xE3o encontrada"},L),{renderInput:k=>{var M,H,P;return(0,l1.jsx)(K1.TextField,m(r(r({placeholder:C},k),L.textFieldProps),{error:!!w,InputProps:m(r(r({},k.InputProps),(M=L.textFieldProps)==null?void 0:M.InputProps),{inputRef:$.ref,inputProps:r(r({},k.inputProps),(P=(H=L.textFieldProps)==null?void 0:H.InputProps)==null?void 0:P.inputProps)})}))}}),c),(0,l1.jsx)(q,{name:c,disableIcon:G})]})}})},g2=(0,f2.memo)(J2);0&&(module.exports={Autocomplete,Checkbox,Creatable,DatePicker,Form,FormProvider,RadioButton,RadioGroup,Searchable,Select,Slider,Switch,TextField,TimePicker,useForm});
|
package/dist/index.mjs
CHANGED
|
@@ -1,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,r=(c,a)=>{for(var n in a||(a={}))C1.call(a,n)&&B1(c,n,a[n]);if(M1)for(var n of M1(a))I1.call(a,n)&&B1(c,n,a[n]);return c},m=(c,a)=>p0(c,M0(a));var D=(c,a)=>{var n={};for(var s in c)C1.call(c,s)&&a.indexOf(s)<0&&(n[s]=c[s]);if(c!=null&&M1)for(var s of M1(c))a.indexOf(s)<0&&I1.call(c,s)&&(n[s]=c[s]);return n};var E1=(c,a)=>()=>(a||c((a={exports:{}}).exports,a),a.exports);var V0=(c,a,n,s)=>{if(a&&typeof a=="object"||typeof a=="function")for(let e of H0(a))!C1.call(c,e)&&e!==n&&x1(c,e,{get:()=>a[e],enumerable:!(s=u0(a,e))||s.enumerable});return c};var G1=(c,a,n)=>(n=c!=null?Z0(f0(c)):{},V0(a||!c||!c.__esModule?x1(n,"default",{value:c,enumerable:!0}):n,c));var o0=E1((P1,D1)=>{(function(c,a){typeof P1=="object"&&typeof D1!="undefined"?D1.exports=a():typeof define=="function"&&define.amd?define(a):(c=typeof globalThis!="undefined"?globalThis:c||self).dayjs=a()})(P1,function(){"use strict";var c=1e3,a=6e4,n=36e5,s="millisecond",e="second",g="minute",p="hour",x="day",k="week",u="month",B="quarter",L="year",y="date",C="Invalid Date",A=/^(\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])+"]"}},T=function(t,l,i){var f=String(t);return!f||f.length>=l?t:""+Array(l+1-f.length).join(i)+t},F={s:T,z:function(t){var l=-t.utcOffset(),i=Math.abs(l),f=Math.floor(i/60),o=i%60;return(l<=0?"+":"-")+T(f,2,"0")+":"+T(o,2,"0")},m:function t(l,i){if(l.date()<i.date())return-t(i,l);var f=12*(i.year()-l.year())+(i.month()-l.month()),o=l.clone().add(f,u),V=i-o<0,h=l.clone().add(f+(V?-1:1),u);return+(-(f+(i-o)/(V?o-h:h-o))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(t){return{M:u,y:L,w:k,d:x,D:y,h:p,m:g,s:e,ms:s,Q:B}[t]||String(t||"").toLowerCase().replace(/s$/,"")},u:function(t){return t===void 0}},M="en",H={};H[M]=P;var w=function(t){return t instanceof b},$=function t(l,i,f){var o;if(!l)return M;if(typeof l=="string"){var V=l.toLowerCase();H[V]&&(o=V),i&&(H[V]=i,o=V);var h=l.split("-");if(!o&&h.length>1)return t(h[0])}else{var v=l.name;H[v]=l,o=v}return!f&&o&&(M=o),o||!f&&M},_=function(t,l){if(w(t))return t.clone();var i=typeof l=="object"?l:{};return i.date=t,i.args=arguments,new b(i)},d=F;d.l=$,d.i=w,d.w=function(t,l){return _(t,{locale:l.$L,utc:l.$u,x:l.$x,$offset:l.$offset})};var b=function(){function t(i){this.$L=$(i.locale,null,!0),this.parse(i)}var l=t.prototype;return l.parse=function(i){this.$d=function(f){var o=f.date,V=f.utc;if(o===null)return new Date(NaN);if(d.u(o))return new Date;if(o instanceof Date)return new Date(o);if(typeof o=="string"&&!/Z$/i.test(o)){var h=o.match(A);if(h){var v=h[2]-1||0,I=(h[7]||"0").substring(0,3);return V?new Date(Date.UTC(h[1],v,h[3]||1,h[4]||0,h[5]||0,h[6]||0,I)):new Date(h[1],v,h[3]||1,h[4]||0,h[5]||0,h[6]||0,I)}}return new Date(o)}(i),this.$x=i.x||{},this.init()},l.init=function(){var i=this.$d;this.$y=i.getFullYear(),this.$M=i.getMonth(),this.$D=i.getDate(),this.$W=i.getDay(),this.$H=i.getHours(),this.$m=i.getMinutes(),this.$s=i.getSeconds(),this.$ms=i.getMilliseconds()},l.$utils=function(){return d},l.isValid=function(){return this.$d.toString()!==C},l.isSame=function(i,f){var o=_(i);return this.startOf(f)<=o&&o<=this.endOf(f)},l.isAfter=function(i,f){return _(i)<this.startOf(f)},l.isBefore=function(i,f){return this.endOf(f)<_(i)},l.$g=function(i,f,o){return d.u(i)?this[f]:this.set(o,i)},l.unix=function(){return Math.floor(this.valueOf()/1e3)},l.valueOf=function(){return this.$d.getTime()},l.startOf=function(i,f){var o=this,V=!!d.u(f)||f,h=d.p(i),v=function(n1,j){var c1=d.w(o.$u?Date.UTC(o.$y,j,n1):new Date(o.$y,j,n1),o);return V?c1:c1.endOf(x)},I=function(n1,j){return d.w(o.toDate()[n1].apply(o.toDate("s"),(V?[0,0,0,0]:[23,59,59,999]).slice(j)),o)},G=this.$W,z=this.$M,X=this.$D,Q="set"+(this.$u?"UTC":"");switch(h){case L:return V?v(1,0):v(31,11);case u:return V?v(1,z):v(0,z+1);case k:var t1=this.$locale().weekStart||0,v1=(G<t1?G+7:G)-t1;return v(V?X-v1:X+(6-v1),z);case x:case y:return I(Q+"Hours",0);case p:return I(Q+"Minutes",1);case g:return I(Q+"Seconds",2);case e:return I(Q+"Milliseconds",3);default:return this.clone()}},l.endOf=function(i){return this.startOf(i,!1)},l.$set=function(i,f){var o,V=d.p(i),h="set"+(this.$u?"UTC":""),v=(o={},o[x]=h+"Date",o[y]=h+"Date",o[u]=h+"Month",o[L]=h+"FullYear",o[p]=h+"Hours",o[g]=h+"Minutes",o[e]=h+"Seconds",o[s]=h+"Milliseconds",o)[V],I=V===x?this.$D+(f-this.$W):f;if(V===u||V===L){var G=this.clone().set(y,1);G.$d[v](I),G.init(),this.$d=G.set(y,Math.min(this.$D,G.daysInMonth())).$d}else v&&this.$d[v](I);return this.init(),this},l.set=function(i,f){return this.clone().$set(i,f)},l.get=function(i){return this[d.p(i)]()},l.add=function(i,f){var o,V=this;i=Number(i);var h=d.p(f),v=function(z){var X=_(V);return d.w(X.date(X.date()+Math.round(z*i)),V)};if(h===u)return this.set(u,this.$M+i);if(h===L)return this.set(L,this.$y+i);if(h===x)return v(1);if(h===k)return v(7);var I=(o={},o[g]=a,o[p]=n,o[e]=c,o)[h]||1,G=this.$d.getTime()+i*I;return d.w(G,this)},l.subtract=function(i,f){return this.add(-1*i,f)},l.format=function(i){var f=this,o=this.$locale();if(!this.isValid())return o.invalidDate||C;var V=i||"YYYY-MM-DDTHH:mm:ssZ",h=d.z(this),v=this.$H,I=this.$m,G=this.$M,z=o.weekdays,X=o.months,Q=function(j,c1,b1,u1){return j&&(j[c1]||j(f,V))||b1[c1].slice(0,u1)},t1=function(j){return d.s(v%12||12,j,"0")},v1=o.meridiem||function(j,c1,b1){var u1=j<12?"AM":"PM";return b1?u1.toLowerCase():u1},n1={YY:String(this.$y).slice(-2),YYYY:this.$y,M:G+1,MM:d.s(G+1,2,"0"),MMM:Q(o.monthsShort,G,X,3),MMMM:Q(X,G),D:this.$D,DD:d.s(this.$D,2,"0"),d:String(this.$W),dd:Q(o.weekdaysMin,this.$W,z,2),ddd:Q(o.weekdaysShort,this.$W,z,3),dddd:z[this.$W],H:String(v),HH:d.s(v,2,"0"),h:t1(1),hh:t1(2),a:v1(v,I,!0),A:v1(v,I,!1),m:String(I),mm:d.s(I,2,"0"),s:String(this.$s),ss:d.s(this.$s,2,"0"),SSS:d.s(this.$ms,3,"0"),Z:h};return V.replace(S,function(j,c1){return c1||n1[j]||h.replace(":","")})},l.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},l.diff=function(i,f,o){var V,h=d.p(f),v=_(i),I=(v.utcOffset()-this.utcOffset())*a,G=this-v,z=d.m(this,v);return z=(V={},V[L]=z/12,V[u]=z,V[B]=z/3,V[k]=(G-I)/6048e5,V[x]=(G-I)/864e5,V[p]=G/n,V[g]=G/a,V[e]=G/c,V)[h]||G,o?z:d.a(z)},l.daysInMonth=function(){return this.endOf(u).$D},l.$locale=function(){return H[this.$L]},l.locale=function(i,f){if(!i)return this.$L;var o=this.clone(),V=$(i,f,!0);return V&&(o.$L=V),o},l.clone=function(){return d.w(this.$d,this)},l.toDate=function(){return new Date(this.valueOf())},l.toJSON=function(){return this.isValid()?this.toISOString():null},l.toISOString=function(){return this.$d.toISOString()},l.toString=function(){return this.$d.toUTCString()},t}(),Z=b.prototype;return _.prototype=Z,[["$ms",s],["$s",e],["$m",g],["$H",p],["$W",x],["$M",u],["$y",L],["$D",y]].forEach(function(t){Z[t[1]]=function(l){return this.$g(l,t[0],t[1])}}),_.extend=function(t,l){return t.$i||(t(l,b,_),t.$i=!0),_},_.locale=$,_.isDayjs=w,_.unix=function(t){return _(1e3*t)},_.en=H[M],_.Ls=H,_.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(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var n=a(c),s={name:"pt-br",weekdays:"domingo_segunda-feira_ter\xE7a-feira_quarta-feira_quinta-feira_sexta-feira_s\xE1bado".split("_"),weekdaysShort:"dom_seg_ter_qua_qui_sex_s\xE1b".split("_"),weekdaysMin:"Do_2\xAA_3\xAA_4\xAA_5\xAA_6\xAA_S\xE1".split("_"),months:"janeiro_fevereiro_mar\xE7o_abril_maio_junho_julho_agosto_setembro_outubro_novembro_dezembro".split("_"),monthsShort:"jan_fev_mar_abr_mai_jun_jul_ago_set_out_nov_dez".split("_"),ordinal:function(e){return e+"\xBA"},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY [\xE0s] HH:mm",LLLL:"dddd, D [de] MMMM [de] YYYY [\xE0s] HH:mm"},relativeTime:{future:"em %s",past:"h\xE1 %s",s:"poucos segundos",m:"um minuto",mm:"%d minutos",h:"uma hora",hh:"%d horas",d:"um dia",dd:"%d dias",M:"um m\xEAs",MM:"%d meses",y:"um ano",yy:"%d anos"}};return n.default.locale(s,null,!0),s})});import{FormProvider as g0}from"react-hook-form";import{jsx as R1}from"react/jsx-runtime";var L0=e=>{var g=e,{children:c,style:a,onSubmit:n}=g,s=D(g,["children","style","onSubmit"]);return R1(g0,m(r({},s),{children:R1("form",{onSubmit:p=>{p.preventDefault(),p.stopPropagation(),n(p)},style:a,children:c})}))},A1=L0;import{useEffect as y0}from"react";import{useForm as b0}from"react-hook-form";import{zodResolver as x0}from"@hookform/resolvers/zod";var C0=s=>{var e=s,{disableDefaultValuesUpdate:c,onSubmit:a}=e,n=D(e,["disableDefaultValuesUpdate","onSubmit"]);let g=b0(m(r({},n),{resolver:n.schema&&x0(n.schema)}));return y0(()=>{c||g.reset(n.defaultValues)},[n.defaultValues,g.reset]),m(r({},g),{onSubmit:g.handleSubmit(p=>a(p,g))})},F1=C0;import{jsx as k0}from"react/jsx-runtime";function A0(s){var e=s,{children:c,style:a}=e,n=D(e,["children","style"]);let g=F1(n);return k0(A1,m(r({},g),{style:a,children:typeof c=="function"?c(g):c}))}var F0=A0;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 k1={description:"M35.8 21.8h-9.6v-9.6c0-.6-.6-1.1-1.1-1.1h-2.2a1 1 0 0 0-1 1v9.7h-9.7c-.6 0-1.1.6-1.1 1.1v2.2c0 .6.5 1 1 1h9.7v9.7c0 .6.5 1.1 1.1 1.1h2.2c.5 0 1-.5 1-1v-9.7h9.7c.6 0 1.1-.5 1.1-1.1v-2.2c0-.5-.5-1-1-1Z",id:"line-plus-solid"};import*as h1 from"@s_mart/masks";import{Typography as z1}from"@mui/material";import{toRem as S0}from"@s_mart/utils";import{jsx as Y1,jsxs as w0}from"react/jsx-runtime";var R=({label:c,required:a,regular:n})=>w0("span",{style:{display:"flex",alignItems:"center",gap:S0(2)},children:[Y1(z1,{variant:"caption",fontWeight:n?400:700,style:{display:"flex",alignItems:"center"},children:c}),a&&Y1(z1,{variant:"caption",fontWeight:900,color:"error",children:"*"})]});import{useFormContext as P0}from"react-hook-form";import{Indicator as D0}from"@s_mart/core";var Y=(c,a)=>a.replace(/[[\]]/g,"").split(".").reduce((s,e)=>s==null?void 0:s[e],c);import{jsx as $0}from"react/jsx-runtime";var U=({name:c,disableIcon:a})=>{var e;let n=P0(),s=Y((e=n==null?void 0:n.formState)==null?void 0:e.errors,c);return s?$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:e,required:g,mask:p,variant:x="outlined",info:k,parse:u,inputMode:B,format:L,onInputChange:y,disableIconError:C}=P,A=D(P,["name","rules","defaultValue","shouldUnregister","label","required","mask","variant","info","parse","inputMode","format","onInputChange","disableIconError"]);let T=I0();if(!T)throw new Error("Para usar o <TextField /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let[F,M]=_0(!1),H=d=>{var Z;let b=d;return L&&(b=L(d)),p?(Z=h1==null?void 0:h1[p])==null?void 0:Z.format(b):b},w=d=>{var Z;let b=d;return u&&(b=u(d)),p?(Z=h1==null?void 0:h1[p])==null?void 0:Z.parse(b):b},$=d=>{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(T.formState.errors,c);return W(B0,{control:T.control,name:c,rules:a,defaultValue:n,shouldUnregister:s,render:({field:{value:d,onChange:b,ref:Z}})=>W1(S1,{display:"flex",flexDirection:"column",children:[W1("div",{style:{display:"flex"},children:[e&&W(S1,{item:!0,children:W(R,{label:e,required:g})}),k&&W(S1,{item:!0,children:W(R0,{title:k,placement:"top",children:W("div",{style:{width:"fit-content"},children:W(j1,{icon:l1,color:"#757575"})})})})]}),W(G0,m(r({variant:x,defaultValue:n,value:H(d||(d!=0?"":d)),onChange:t=>{var i;let l=w((i=t==null?void 0:t.target)==null?void 0:i.value);b(l),y==null||y(l,T.getValues())},error:!!_},A),{type:A.type==="password"?F?"text":"password":A.type,autoComplete:A.autoComplete||"off",inputProps:r({inputMode:B},A.inputProps),InputProps:r({onKeyDown:$,inputRef:Z,endAdornment:A.type==="password"&&W(E0,{position:"start",onClick:()=>M(!F),style:{cursor:"pointer"},children:W(j1,{icon:F?U1:O1,size:"24px",removeMargin:!0})})},A.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 T=P,{name:c,rules:a,defaultValue:n,shouldUnregister:s,label:e,required:g,options:p,placeholder:x,clearable:k,disableOnChangeForm:u=!1,multiple:B,info:L,footer:y,onChange:C,disableIconError:A}=T,S=D(T,["name","rules","defaultValue","shouldUnregister","label","required","options","placeholder","clearable","disableOnChangeForm","multiple","info","footer","onChange","disableIconError"]);let F=j0(),{palette:M}=X0(),[H,w]=z0(!1);if(!F)throw new Error("Para usar o <Select /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let $=Y(F.formState.errors,c);return console.warn=()=>{},O(Y0,{control:F.control,name:c,rules:a,defaultValue:n,shouldUnregister:s,render:({field:{value:_,onChange:d,ref:b}})=>d1(i1,{display:"flex",flexDirection:"column",children:[d1("div",{style:{display:"flex"},children:[e&&O(i1,{item:!0,children:O(R,{label:e,required:g})}),L&&O(i1,{item:!0,children:O(J0,{title:L,placement:"top",children:O("div",{style:{width:"fit-content"},children:O(J1,{icon:l1,color:"#757575"})})})})]}),d1(Q0,m(r({open:H,onOpen:()=>w(!0),onClose:()=>w(!1),displayEmpty:!!x,variant:"outlined",autoComplete:"off",value:_?_||"":B?[]:"",renderValue:Z=>{if(Z.label)return Z.label;if(x)return O("p",{style:{color:M.grey[400]},children:x})},multiple:B,onChange:Z=>{!u&&d(Z.target.value),C&&C(Z.target.value,F.getValues())},error:!!$,size:S.size||"medium",inputRef:b},S),{endAdornment:d1(a2,{children:[S.endAdornment,!!(k&&_)&&O(N0,{variant:"text",color:"neutral",size:"small",sx:{borderRadius:"50%",position:"absolute",right:"2rem"},style:{padding:0},"aria-label":"Clear",title:"Clear",onClick:()=>{!u&&d(null),C&&C(null,F.getValues())},children:O(J1,{icon:N1,color:K0.neutral[100],size:"25px",removeMargin:!0})})]}),children:[x&&O(K1,{disabled:!0,value:"",children:O("p",{style:{color:M.grey[400]},children:x})}),p==null?void 0:p.map((Z,t)=>O(K1,{value:Z,children:d1(i1,{container:!0,direction:"column",children:[O(i1,{item:!0,children:Z.label}),Z.afterLabel&&O(i1,{item:!0,children:Z.afterLabel})]})},t)),y&&[O(i1,{px:2,py:1,children:O(W0,{})},"footer-divider"),O("div",{children:y({closeSelect:()=>w(!1)})},"footer-content")]]}),c),O(U,{name:c,disableIcon:A})]})})},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=T=>{var F=T,{name:c,rules:a,defaultValue:n,shouldUnregister:s,label:e,required:g,options:p,textFieldProps:x,noOptionsText:k,footer:u,multiple:B,info:L,placeholder:y,onChange:C,onInputChange:A,disableIconError:S}=F,P=D(F,["name","rules","defaultValue","shouldUnregister","label","required","options","textFieldProps","noOptionsText","footer","multiple","info","placeholder","onChange","onInputChange","disableIconError"]);let M=o2();if(!M)throw new Error("Para usar o <Searchable /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let H=Y(M.formState.errors,c);return console.warn=()=>{},q(r2,{control:M.control,name:c,rules:a,defaultValue:n,shouldUnregister:s,render:({field:{onChange:w,value:$,ref:_}})=>{var d;return e1(a1,{display:"flex",flexDirection:"column",children:[e1("div",{style:{display:"flex"},children:[e&&q(a1,{item:!0,children:q(R,{label:e,required:g})}),L&&q(a1,{item:!0,children:q(t2,{title:L,placement:"top",children:q("div",{style:{width:"fit-content"},children:q(s2,{icon:l1,color:"#757575"})})})})]}),q(n2,m(r({onChange:(b,Z)=>{w(Z),C==null||C(Z,M.getValues())},onInputChange:(b,Z,t)=>{t==="input"&&setTimeout(()=>{A==null||A(Z,M.getValues())},0)},slotProps:m(r({},P.slotProps||{}),{paper:m(r({},(P.slotProps||{}).paper||{}),{sx:r({border:`1px solid ${v2.neutral[30]}`,boxShadow:"0px 2px 4px rgba(0, 0, 0, 0.15)"},((d=(P.slotProps||{}).paper)==null?void 0:d.sx)||{})})}),value:$||(B?[]:null),options:p,multiple:B,noOptionsText:e1(H1,{children:[k||"Nenhum resultado encontrado",u?e1(H1,{children:[q(a1,{py:1,children:q(Q1,{})}),u]}):null]}),isOptionEqualToValue:(b,Z)=>typeof b=="string"&&typeof Z=="string"?b===Z:typeof b=="object"&&typeof Z=="object"?typeof b.value=="object"&&typeof Z.value=="object"&&b.key!==void 0&&Z.key!==void 0?b.key===Z.key:b.value===Z.value:!1,renderOption:(b,Z)=>typeof Z=="object"?X1("li",m(r({},b),{key:Z.key||Z.value}),e1(a1,{container:!0,direction:"column",children:[q(a1,{item:!0,children:Z.label}),Z.afterLabel&&q(a1,{item:!0,children:Z.afterLabel})]})):X1("li",m(r({},b),{key:Z}),Z),ListboxComponent:i2(function(Z,t){return e1(H1,{children:[q("ul",m(r({},Z),{ref:t})),!!u&&q("div",m(r({},Z),{children:e1(H1,{children:[q(a1,{px:2,py:1,children:q(Q1,{})}),u]})}),"searchable-footer")]})})},P),{renderInput:b=>q(h2,m(r(r({error:!!H,placeholder:y},b),x),{inputRef:_}))}),c),q(U,{name:c,disableIcon:S})]})}})},m2=e2(d2);import{forwardRef as u2,memo as M2}from"react";import{Controller as H2,useFormContext as f2}from"react-hook-form";import{isObject as V2,isEmpty as g2}from"lodash";import{Grid as r1,Autocomplete as L2,TextField as y2}from"@mui/material";import{LIcon as V1,Tooltip as b2,Button as x2,Divider as C2}from"@s_mart/core";import{colorPalette as A2}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 w1,jsx as
|
|
49
|
+
${({hideAddButton:c,theme:a})=>!c&&p2(a)}
|
|
50
|
+
`;import{Fragment as w1,jsx as E,jsxs as N}from"react/jsx-runtime";import{createElement as e0}from"react";var F2=H=>{var w=H,{name:c,rules:a,defaultValue:n,shouldUnregister:s,label:e,required:g,options:p,editable:x,footer:k,onEditOption:u,onCreateOption:B,textFieldProps:L,hideAddButton:y,multiple:C,info:A,onChange:S,onInputChange:P,placeholder:T,disableIconError:F}=w,M=D(w,["name","rules","defaultValue","shouldUnregister","label","required","options","editable","footer","onEditOption","onCreateOption","textFieldProps","hideAddButton","multiple","info","onChange","onInputChange","placeholder","disableIconError"]);let $=f2();if(!$)throw new Error("Para usar o <Creatable /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let _=Y($.formState.errors,c),d=l=>{let i=0;return L!=null&&L.InputProps||(i+=2.5),y||(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=>{B?B(l):console.error("onCreateOption n\xE3o foi definido")},t=l=>{u?u(l):console.error("onEditOption n\xE3o foi definido")};return E(H2,{control:$.control,name:c,rules:a,defaultValue:n,shouldUnregister:s,render:({field:{value:l,onChange:i,ref:f}})=>{var V;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:[e&&E(r1,{item:!0,children:E(R,{label:e,required:g})}),A&&E(r1,{item:!0,children:E(b2,{title:A,placement:"top",children:E("div",{style:{width:"fit-content"},children:E(V1,{icon:l1,color:"#757575"})})})})]}),E(a0,{hideAddButton:y,children:E(L2,m(r({fullWidth:!0,onChange:(h,v)=>{i(v),S==null||S(v,$.getValues())},onInputChange:(h,v,I)=>{I==="input"&&setTimeout(()=>{P==null||P(v,$.getValues())},0)},slotProps:m(r({},M.slotProps||{}),{paper:m(r({},(M.slotProps||{}).paper||{}),{sx:r({border:`1px solid ${A2.neutral[30]}`,boxShadow:"0px 2px 4px rgba(0, 0, 0, 0.15)"},((V=(M.slotProps||{}).paper)==null?void 0:V.sx)||{})})}),options:p,value:l||(C?[]:null),multiple:C,noOptionsText:y?void 0:N(x2,{sx:{justifyContent:"flex-start",padding:`${i0(6)} ${i0(-16)}`,margin:0},fullWidth:!0,onClick:()=>Z(l),variant:"text",startIcon:E(V1,{icon:k1}),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(r({},h),{key:v.key||v.value}),N(r1,{container:!0,direction:"column",children:[E(r1,{item:!0,children:v.label}),v.afterLabel&&E(r1,{item:!0,children:v.afterLabel})]})):e0("li",m(r({},h),{key:v}),v),ListboxComponent:u2(function(v,I){return N(w1,{children:[E("ul",m(r({},v),{ref:I})),!!k&&E("div",m(r({},v),{children:N(w1,{children:[E(r1,{px:2,py:1,children:E(C2,{})}),k]})}),"creatable-footer")]})})},M),{sx:r({"& div.MuiInputBase-root":{paddingRight:`${d(l)} !important`}},M.sx),renderInput:h=>E(y2,r(m(r({placeholder:T},h),{error:!!_,InputProps:m(r({},h.InputProps),{inputRef:f,endAdornment:N("div",{className:"endAdornments",children:[h.InputProps.endAdornment,!y&&N(w1,{children:[b(l)?N("div",{className:"editable",children:[E("div",{className:"divider"}),E("div",{className:"button",onClick:()=>t(l),children:E(V1,{icon:q1,size:"24px",removeMargin:!0})})]}):null,N("div",{className:"creatable",children:[E("div",{className:"divider"}),E("div",{className:"button",onClick:()=>Z(l),children:E(V1,{icon:k1,size:"24px",removeMargin:!0})})]})]})]})})}),L))}),c)}),E(U,{name:c,disableIcon:F})]})}})},k2=M2(F2);import{Controller as S2,useFormContext as w2}from"react-hook-form";import{Grid as P2,Checkbox as D2,FormControlLabel as $2}from"@mui/material";import{jsx as m1,jsxs as B2}from"react/jsx-runtime";var T2=B=>{var L=B,{name:c,rules:a,defaultValue:n,shouldUnregister:s,label:e,labelPlacement:g,required:p,disableIconError:x,onChange:k}=L,u=D(L,["name","rules","defaultValue","shouldUnregister","label","labelPlacement","required","disableIconError","onChange"]);let y=w2();if(!y)throw new Error("Para usar o <Checkbox /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");return m1(S2,{control:y.control,name:c,rules:a,defaultValue:n,shouldUnregister:s,render:({field:{value:C,onChange:A}})=>B2(P2,{display:"flex",flexDirection:"column",children:[m1($2,{control:m1(D2,r({checked:!!C,value:C!=null?C:"",defaultValue:C,onChange:(S,P)=>{A(S,P),k==null||k(S,P)}},u),c),label:m1(R,{label:e,required:p,regular:!0}),labelPlacement:g||"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 B=u,{name:c,rules:a,defaultValue:n,shouldUnregister:s,label:e,labelPlacement:g,disableIconError:p,onChange:x}=B,k=D(B,["name","rules","defaultValue","shouldUnregister","label","labelPlacement","disableIconError","onChange"]);let L=E2();if(!L)throw new Error("Para usar o <Switch /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");return Z1(I2,{control:L.control,name:c,rules:a,defaultValue:n,shouldUnregister:s,render:({field:{value:y,onChange:C}})=>z2(G2,{display:"flex",flexDirection:"column",children:[Z1(U2,{control:Z1(R2,r({value:y!=null?y:"",checked:y!=null?y:!1,defaultValue:y,onChange:(A,S)=>{C(A,S),x==null||x(A,S)}},k),c),label:Z1(R,{label:e}),labelPlacement:g||"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 e=s,{label:c,labelPlacement:a}=e,n=D(e,["label","labelPlacement"]);return g1(Y2,{display:"flex",flexDirection:"column",children:g1(W2,{control:g1(j2,r({},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=B=>{var L=B,{name:c,rules:a,defaultValue:n,shouldUnregister:s,label:e,required:g,children:p,orientation:x="row",disableIconError:k}=L,u=D(L,["name","rules","defaultValue","shouldUnregister","label","required","children","orientation","disableIconError"]);let y=Q2();if(!y)throw new Error("Para usar o <RadioGroup /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");return L1(K2,{control:y.control,name:c,rules:a,defaultValue:n,shouldUnregister:s,render:({field:{value:C,onChange:A}})=>i3(X2,{display:"flex",flexDirection:"column",children:[e&&L1(R,{label:e,required:g}),L1(c3,m(r({value:C||"",name:c},u),{onChange:S=>{var P,T;(T=u==null?void 0:u.onChange)==null||T.call(u,S,(P=S.target)==null?void 0:P.value),A(S)},style:{display:"flex",flexDirection:x},children:p}),c),L1(U,{name:c,disableIcon:k})]})})},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=g=>{var p=g,{name:c,rules:a,defaultValue:n,shouldUnregister:s}=p,e=D(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:k,onChange:u}})=>r0(o3,r({value:k||(e==null?void 0:e.min)||0,onChange:u,valueLabelDisplay:"auto"},e),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=L=>{var y=L,{rules:c,name:a,defaultValue:n,shouldUnregister:s,datePickerProps:e,label:g,required:p,placeholder:x,disabled:k,disableIconError:u}=y,B=D(y,["rules","name","defaultValue","shouldUnregister","datePickerProps","label","required","placeholder","disabled","disableIconError"]);let C=p3();if(!C)throw new Error("Para usar o <DataPicker /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let A=Y(C.formState.errors,a),S=(e==null?void 0:e.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:T,onChange:F,ref:M}})=>C3(u3,{display:"flex",flexDirection:"column",children:[g&&p1(R,{label:g,required:p}),x3(f3,m(r({},e),{key:a,value:T!=null?T:null,format:S,onChange:(H,w)=>{var $;F(H,w),($=e==null?void 0:e.onChange)==null||$.call(e,H,w)},disabled:k,slots:{textField:H3,openPickerButton:H=>p1(n0,m(r({},H),{size:B.size}))},slotProps:{textField:H=>{var w;return m(r(m(r({variant:"outlined"},H),{error:!!A}),B),{inputProps:m(r({},H.inputProps),{placeholder:x||((w=H.inputProps)==null?void 0:w.placeholder)}),InputProps:m(r({},H.InputProps),{inputRef($){M($),typeof H.inputRef=="function"&&H.inputRef($)}})})}}})),p1(U,{name:a,disableIcon:u})]})})})},b3=m3(y3);var d0=G1(_1());import{memo as w3}from"react";import{Controller as P3,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 A3 from"@emotion/styled";import{IconButton as F3}from"@mui/material";import{toRem as K}from"@s_mart/utils";var k3=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=A3(F3)`
|
|
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})=>k3(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=L=>{var y=L,{rules:c,defaultValue:a,shouldUnregister:n,name:s,required:e,label:g,timePickerProps:p,placeholder:x,disabled:k,disableIconError:u}=y,B=D(y,["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 A=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(P3,{control:C.control,name:s,rules:P,defaultValue:a,shouldUnregister:n,render:({field:{value:T,onChange:F,ref:M}})=>O3($3,{display:"flex",flexDirection:"column",children:[g&&s1(R,{label:g,required:e}),s1(B3,m(r({ampm:!1,format:S,value:T!=null?T:null,disabled:k},p),{onChange:(H,w)=>{var $;F(H,w),($=p==null?void 0:p.onChange)==null||$.call(p,H,w)},slots:{textField:_3,openPickerButton:H=>s1(t0,m(r({},H),{size:B.size}))},slotProps:{textField:H=>{var w;return m(r(m(r({variant:"outlined"},H),{error:!!A}),B),{inputProps:m(r({},H.inputProps),{placeholder:x||((w=H.inputProps)==null?void 0:w.placeholder)}),InputProps:m(r({},H.InputProps),{inputRef($){M($),typeof H.inputRef=="function"&&H.inputRef($)}})})}}}),s),s1(U,{name:s,disableIcon:u})]})})})},U3=w3(R3);import{memo as q3}from"react";import{Controller as z3,useFormContext as Y3}from"react-hook-form";import{Autocomplete as j3,TextField as W3}from"@mui/material";import{Grid as 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=y=>{var C=y,{name:c,defaultValue:a,rules:n,shouldUnregister:s,label:e,required:g,noOptionsText:p,placeholder:x,onInputChange:k,onChange:u,disableIconError:B}=C,L=D(C,["name","defaultValue","rules","shouldUnregister","label","required","noOptionsText","placeholder","onInputChange","onChange","disableIconError"]);let A=Y3();if(!A)throw new Error("Para usar o <Autocomplete /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let S=Y(A.formState.errors,c);return console.warn=()=>{},o1(z3,{name:c,control:A.control,defaultValue:a,rules:n,shouldUnregister:s,render:({field:P})=>{var T;return m0(y1,{display:"flex",flexDirection:"column",children:[e&&o1(R,{label:e,required:g}),o1(j3,m(r({onChange:(F,M)=>{P.onChange(M),u==null||u(M,A.getValues())},onInputChange:(F,M,H)=>{H==="input"&&(P.onChange(M),setTimeout(()=>{k==null||k(M,A.getValues())},0))},slotProps:m(r({},L.slotProps||{}),{paper:m(r({},(L.slotProps||{}).paper||{}),{sx:r({border:`1px solid ${N3.neutral[30]}`,boxShadow:"0px 2px 4px rgba(0, 0, 0, 0.15)"},((T=(L.slotProps||{}).paper)==null?void 0:T.sx)||{})})}),isOptionEqualToValue:(F,M)=>F.value===M.value,renderOption:(F,M)=>Q3("li",m(r({},F),{key:M.key||M.value,onClick:H=>{var w;(w=F.onClick)==null||w.call(F,H),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"},L),{renderInput:F=>{var M,H,w;return o1(W3,m(r(r({placeholder:x},F),L.textFieldProps),{error:!!S,InputProps:m(r(r({},F.InputProps),(M=L.textFieldProps)==null?void 0:M.InputProps),{inputRef:P.ref,inputProps:r(r({},F.inputProps),(w=(H=L.textFieldProps)==null?void 0:H.InputProps)==null?void 0:w.inputProps)})}))}}),c),o1(U,{name:c,disableIcon:B})]})}})},K3=q3(J3);export{K3 as Autocomplete,_2 as Checkbox,k2 as Creatable,b3 as DatePicker,F0 as Form,A1 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,F1 as useForm};
|