@s_mart/form 3.4.0 → 3.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +90 -10
- package/dist/index.js +13 -13
- package/dist/index.mjs +8 -8
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -81,11 +81,19 @@ type TextFieldProps = TextFieldProps$1 & ControllerTextField & {
|
|
|
81
81
|
* montada à tela como um ícone de informação.
|
|
82
82
|
*/
|
|
83
83
|
info?: React.ReactNode;
|
|
84
|
+
/**
|
|
85
|
+
* Desabilita o ícone de erro da validação do campo.
|
|
86
|
+
* @default false
|
|
87
|
+
*
|
|
88
|
+
* @example
|
|
89
|
+
* <TextField disableIconError />
|
|
90
|
+
*/
|
|
91
|
+
disableIconError?: boolean;
|
|
84
92
|
};
|
|
85
93
|
|
|
86
|
-
declare const _default$6: react.MemoExoticComponent<({ name, rules, defaultValue, shouldUnregister, label, required, mask, variant, info, parse, inputMode, format, onInputChange, ...rest }: TextFieldProps) => react_jsx_runtime.JSX.Element>;
|
|
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>;
|
|
87
95
|
|
|
88
|
-
declare const _default$5: react.MemoExoticComponent<({ name, rules, defaultValue, shouldUnregister, label, required, options, placeholder, disableOnChangeForm, multiple, info, footer, onChange: onChangeProp, ...rest }: SelectProps) => react_jsx_runtime.JSX.Element>;
|
|
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>;
|
|
89
97
|
|
|
90
98
|
type ControllerSelect = Omit<ControllerProps, 'render' | 'control'>;
|
|
91
99
|
type SelectOption = {
|
|
@@ -136,6 +144,14 @@ type SelectProps = Omit<SelectProps$1, 'onChange'> & ControllerSelect & {
|
|
|
136
144
|
* montada à tela como um ícone de informação.
|
|
137
145
|
*/
|
|
138
146
|
info?: React.ReactNode;
|
|
147
|
+
/**
|
|
148
|
+
* Desabilita o ícone de erro da validação do campo.
|
|
149
|
+
* @default false
|
|
150
|
+
*
|
|
151
|
+
* @example
|
|
152
|
+
* <TextField disableIconError />
|
|
153
|
+
*/
|
|
154
|
+
disableIconError?: boolean;
|
|
139
155
|
};
|
|
140
156
|
|
|
141
157
|
type ControllerSearchable = Omit<ControllerProps, 'render' | 'control'>;
|
|
@@ -191,9 +207,17 @@ type SearchableProps = Omit<AutocompleteProps$1<SearchableOption, true, true, tr
|
|
|
191
207
|
info?: React.ReactNode;
|
|
192
208
|
onInputChange?: (value: string, values: FieldValues) => void;
|
|
193
209
|
onChange?: (value: any, values: FieldValues) => void;
|
|
210
|
+
/**
|
|
211
|
+
* Desabilita o ícone de erro da validação do campo.
|
|
212
|
+
* @default false
|
|
213
|
+
*
|
|
214
|
+
* @example
|
|
215
|
+
* <TextField disableIconError />
|
|
216
|
+
*/
|
|
217
|
+
disableIconError?: boolean;
|
|
194
218
|
};
|
|
195
219
|
|
|
196
|
-
declare const _default$4: react.MemoExoticComponent<({ name, rules, defaultValue, shouldUnregister, label, required, options, textFieldProps, noOptionsText, footer, multiple, info, placeholder, onChange: onChangeProp, onInputChange, ...rest }: SearchableProps) => react_jsx_runtime.JSX.Element>;
|
|
220
|
+
declare const _default$4: react.MemoExoticComponent<({ name, rules, defaultValue, shouldUnregister, label, required, options, textFieldProps, noOptionsText, footer, multiple, info, placeholder, onChange: onChangeProp, onInputChange, disableIconError, ...rest }: SearchableProps) => react_jsx_runtime.JSX.Element>;
|
|
197
221
|
|
|
198
222
|
type ControllerCreatable = Omit<ControllerProps, 'render' | 'control'>;
|
|
199
223
|
type CreatableOption = {
|
|
@@ -283,9 +307,17 @@ type CreatableProps = Omit<AutocompleteProps$1<CreatableOption, true, true, true
|
|
|
283
307
|
info?: React.ReactNode;
|
|
284
308
|
onInputChange?: (value: string, values: FieldValues) => void;
|
|
285
309
|
onChange?: (value: any, values: FieldValues) => void;
|
|
310
|
+
/**
|
|
311
|
+
* Desabilita o ícone de erro da validação do campo.
|
|
312
|
+
* @default false
|
|
313
|
+
*
|
|
314
|
+
* @example
|
|
315
|
+
* <TextField disableIconError />
|
|
316
|
+
*/
|
|
317
|
+
disableIconError?: boolean;
|
|
286
318
|
};
|
|
287
319
|
|
|
288
|
-
declare const _default$3: react.MemoExoticComponent<({ name, rules, defaultValue, shouldUnregister, label, required, options, editable, footer, onEditOption, onCreateOption, textFieldProps, hideAddButton, multiple, info, onChange: onChangeProp, onInputChange, placeholder, ...rest }: CreatableProps) => react_jsx_runtime.JSX.Element>;
|
|
320
|
+
declare const _default$3: react.MemoExoticComponent<({ name, rules, defaultValue, shouldUnregister, label, required, options, editable, footer, onEditOption, onCreateOption, textFieldProps, hideAddButton, multiple, info, onChange: onChangeProp, onInputChange, placeholder, disableIconError, ...rest }: CreatableProps) => react_jsx_runtime.JSX.Element>;
|
|
289
321
|
|
|
290
322
|
type ControllerCheckbox = Omit<ControllerProps, 'render' | 'control'>;
|
|
291
323
|
type CheckboxProps = CheckboxProps$1 & ControllerCheckbox & {
|
|
@@ -305,9 +337,17 @@ type CheckboxProps = CheckboxProps$1 & ControllerCheckbox & {
|
|
|
305
337
|
* <Checkbox label="Checkbox" labelPlacement="start" />
|
|
306
338
|
*/
|
|
307
339
|
labelPlacement?: 'start' | 'end' | 'top' | 'bottom';
|
|
340
|
+
/**
|
|
341
|
+
* Desabilita o ícone de erro da validação do campo.
|
|
342
|
+
* @default false
|
|
343
|
+
*
|
|
344
|
+
* @example
|
|
345
|
+
* <TextField disableIconError />
|
|
346
|
+
*/
|
|
347
|
+
disableIconError?: boolean;
|
|
308
348
|
};
|
|
309
349
|
|
|
310
|
-
declare const Checkbox: ({ name, rules, defaultValue, shouldUnregister, label, labelPlacement, required, ...rest }: CheckboxProps) => react_jsx_runtime.JSX.Element;
|
|
350
|
+
declare const Checkbox: ({ name, rules, defaultValue, shouldUnregister, label, labelPlacement, required, disableIconError, ...rest }: CheckboxProps) => react_jsx_runtime.JSX.Element;
|
|
311
351
|
|
|
312
352
|
type ControllerSwitch = Omit<ControllerProps, 'render' | 'control'>;
|
|
313
353
|
type SwitchProps = SwitchProps$1 & ControllerSwitch & {
|
|
@@ -327,9 +367,17 @@ type SwitchProps = SwitchProps$1 & ControllerSwitch & {
|
|
|
327
367
|
* <Switch label="Switch" labelPlacement="start" />
|
|
328
368
|
*/
|
|
329
369
|
labelPlacement?: 'start' | 'end' | 'top' | 'bottom';
|
|
370
|
+
/**
|
|
371
|
+
* Desabilita o ícone de erro da validação do campo.
|
|
372
|
+
* @default false
|
|
373
|
+
*
|
|
374
|
+
* @example
|
|
375
|
+
* <TextField disableIconError />
|
|
376
|
+
*/
|
|
377
|
+
disableIconError?: boolean;
|
|
330
378
|
};
|
|
331
379
|
|
|
332
|
-
declare const Switch: ({ name, rules, defaultValue, shouldUnregister, label, labelPlacement, ...rest }: SwitchProps) => react_jsx_runtime.JSX.Element;
|
|
380
|
+
declare const Switch: ({ name, rules, defaultValue, shouldUnregister, label, labelPlacement, disableIconError, ...rest }: SwitchProps) => react_jsx_runtime.JSX.Element;
|
|
333
381
|
|
|
334
382
|
type RadioProps = RadioProps$1 & {
|
|
335
383
|
/**
|
|
@@ -386,9 +434,17 @@ type RadioGroupProps = RadioGroupProps$1 & ControllerRadioGroup & {
|
|
|
386
434
|
* @memberof RadioGroupProps
|
|
387
435
|
*/
|
|
388
436
|
orientation?: 'row' | 'column';
|
|
437
|
+
/**
|
|
438
|
+
* Desabilita o ícone de erro da validação do campo.
|
|
439
|
+
* @default false
|
|
440
|
+
*
|
|
441
|
+
* @example
|
|
442
|
+
* <TextField disableIconError />
|
|
443
|
+
*/
|
|
444
|
+
disableIconError?: boolean;
|
|
389
445
|
};
|
|
390
446
|
|
|
391
|
-
declare const RadioGroup: ({ name, rules, defaultValue, shouldUnregister, label, required, children, orientation, ...rest }: RadioGroupProps) => react_jsx_runtime.JSX.Element;
|
|
447
|
+
declare const RadioGroup: ({ name, rules, defaultValue, shouldUnregister, label, required, children, orientation, disableIconError, ...rest }: RadioGroupProps) => react_jsx_runtime.JSX.Element;
|
|
392
448
|
|
|
393
449
|
type ControllerSlider = Omit<ControllerProps, 'render' | 'control'>;
|
|
394
450
|
type SliderProps = SliderProps$1 & ControllerSlider & {
|
|
@@ -426,9 +482,17 @@ type DatePickerProps = Omit<UseControllerProps, 'control'> & Pick<TextFieldProps
|
|
|
426
482
|
* @default false
|
|
427
483
|
*/
|
|
428
484
|
disabled?: boolean;
|
|
485
|
+
/**
|
|
486
|
+
* Desabilita o ícone de erro da validação do campo.
|
|
487
|
+
* @default false
|
|
488
|
+
*
|
|
489
|
+
* @example
|
|
490
|
+
* <TextField disableIconError />
|
|
491
|
+
*/
|
|
492
|
+
disableIconError?: boolean;
|
|
429
493
|
};
|
|
430
494
|
|
|
431
|
-
declare const _default$2: react.MemoExoticComponent<({ rules, name, defaultValue, shouldUnregister, datePickerProps, label, required, placeholder, disabled, ...rest }: DatePickerProps) => react_jsx_runtime.JSX.Element>;
|
|
495
|
+
declare const _default$2: react.MemoExoticComponent<({ rules, name, defaultValue, shouldUnregister, datePickerProps, label, required, placeholder, disabled, disableIconError, ...rest }: DatePickerProps) => react_jsx_runtime.JSX.Element>;
|
|
432
496
|
|
|
433
497
|
type TimePickerProps = Omit<UseControllerProps, 'control'> & Pick<TextFieldProps$1, 'label' | 'error' | 'helperText' | 'size' | 'fullWidth' | 'variant' | 'autoFocus' | 'placeholder'> & {
|
|
434
498
|
timePickerProps?: Partial<TimePickerProps$1<any>>;
|
|
@@ -444,9 +508,17 @@ type TimePickerProps = Omit<UseControllerProps, 'control'> & Pick<TextFieldProps
|
|
|
444
508
|
* @default false
|
|
445
509
|
*/
|
|
446
510
|
disabled?: boolean;
|
|
511
|
+
/**
|
|
512
|
+
* Desabilita o ícone de erro da validação do campo.
|
|
513
|
+
* @default false
|
|
514
|
+
*
|
|
515
|
+
* @example
|
|
516
|
+
* <TextField disableIconError />
|
|
517
|
+
*/
|
|
518
|
+
disableIconError?: boolean;
|
|
447
519
|
};
|
|
448
520
|
|
|
449
|
-
declare const _default$1: react.MemoExoticComponent<({ rules, defaultValue, shouldUnregister, name, required, label, timePickerProps, placeholder, disabled, ...rest }: TimePickerProps) => react_jsx_runtime.JSX.Element>;
|
|
521
|
+
declare const _default$1: react.MemoExoticComponent<({ rules, defaultValue, shouldUnregister, name, required, label, timePickerProps, placeholder, disabled, disableIconError, ...rest }: TimePickerProps) => react_jsx_runtime.JSX.Element>;
|
|
450
522
|
|
|
451
523
|
type AutoCompleteOption = {
|
|
452
524
|
key?: string | number;
|
|
@@ -479,8 +551,16 @@ type AutocompleteProps<T = any> = Omit<UseControllerProps, 'control'> & Omit<Aut
|
|
|
479
551
|
required?: boolean;
|
|
480
552
|
onInputChange?: (value: string, values: FieldValues) => void;
|
|
481
553
|
onChange?: (value: any, values: FieldValues) => void;
|
|
554
|
+
/**
|
|
555
|
+
* Desabilita o ícone de erro da validação do campo.
|
|
556
|
+
* @default false
|
|
557
|
+
*
|
|
558
|
+
* @example
|
|
559
|
+
* <TextField disableIconError />
|
|
560
|
+
*/
|
|
561
|
+
disableIconError?: boolean;
|
|
482
562
|
};
|
|
483
563
|
|
|
484
|
-
declare const _default: react.MemoExoticComponent<({ name, defaultValue, rules, shouldUnregister, label, required, noOptionsText, placeholder, onInputChange, onChange, ...rest }: AutocompleteProps) => react_jsx_runtime.JSX.Element>;
|
|
564
|
+
declare const _default: react.MemoExoticComponent<({ name, defaultValue, rules, shouldUnregister, label, required, noOptionsText, placeholder, onInputChange, onChange, disableIconError, ...rest }: AutocompleteProps) => react_jsx_runtime.JSX.Element>;
|
|
485
565
|
|
|
486
566
|
export { _default as Autocomplete, AutocompleteProps, Checkbox, CheckboxProps, _default$3 as Creatable, CreatableOption, CreatableProps, _default$2 as DatePicker, DatePickerProps, FooterProps, Form, FormProvider, IFormProps, IFormProviderProps, IUseFormProps, RadioButton, RadioGroup, RadioGroupProps, RadioProps, _default$4 as Searchable, SearchableOption, SearchableProps, _default$5 as Select, SelectOption, SelectProps, Slider, SliderProps, Switch, SwitchProps, _default$6 as TextField, TextFieldProps, _default$1 as TimePicker, TimePickerProps, useForm };
|
package/dist/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
"use strict";var y0=Object.create;var C1=Object.defineProperty,C0=Object.defineProperties,g0=Object.getOwnPropertyDescriptor,x0=Object.getOwnPropertyDescriptors,L0=Object.getOwnPropertyNames,w1=Object.getOwnPropertySymbols,b0=Object.getPrototypeOf,X1=Object.prototype.hasOwnProperty,p2=Object.prototype.propertyIsEnumerable;var v2=(e,c,l)=>c in e?C1(e,c,{enumerable:!0,configurable:!0,writable:!0,value:l}):e[c]=l,o=(e,c)=>{for(var l in c||(c={}))X1.call(c,l)&&v2(e,l,c[l]);if(w1)for(var l of w1(c))p2.call(c,l)&&v2(e,l,c[l]);return e},v=(e,c)=>C0(e,x0(c));var $=(e,c)=>{var l={};for(var m in e)X1.call(e,m)&&c.indexOf(m)<0&&(l[m]=e[m]);if(e!=null&&w1)for(var m of w1(e))c.indexOf(m)<0&&p2.call(e,m)&&(l[m]=e[m]);return l};var Z2=(e,c)=>()=>(c||e((c={exports:{}}).exports,c),c.exports),F0=(e,c)=>{for(var l in c)C1(e,l,{get:c[l],enumerable:!0})},u2=(e,c,l,m)=>{if(c&&typeof c=="object"||typeof c=="function")for(let h of L0(c))!X1.call(e,h)&&h!==l&&C1(e,h,{get:()=>c[h],enumerable:!(m=g0(c,h))||m.enumerable});return e};var p1=(e,c,l)=>(l=e!=null?y0(b0(e)):{},u2(c||!e||!e.__esModule?C1(l,"default",{value:e,enumerable:!0}):l,e)),P0=e=>u2(C1({},"__esModule",{value:!0}),e);var Y2=Z2((n2,s2)=>{(function(e,c){typeof n2=="object"&&typeof s2!="undefined"?s2.exports=c():typeof define=="function"&&define.amd?define(c):(e=typeof globalThis!="undefined"?globalThis:e||self).dayjs=c()})(n2,function(){"use strict";var e=1e3,c=6e4,l=36e5,m="millisecond",h="second",M="minute",Z="hour",g="day",b="week",p="month",x="quarter",V="year",F="date",P="Invalid Date",B=/^(\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,T={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(t){var i=["th","st","nd","rd"],a=t%100;return"["+t+(i[(a-20)%10]||i[a]||i[0])+"]"}},k=function(t,i,a){var f=String(t);return!f||f.length>=i?t:""+Array(i+1-f.length).join(a)+t},y={s:k,z:function(t){var i=-t.utcOffset(),a=Math.abs(i),f=Math.floor(a/60),n=a%60;return(i<=0?"+":"-")+k(f,2,"0")+":"+k(n,2,"0")},m:function t(i,a){if(i.date()<a.date())return-t(a,i);var f=12*(a.year()-i.year())+(a.month()-i.month()),n=i.clone().add(f,p),d=a-n<0,s=i.clone().add(f+(d?-1:1),p);return+(-(f+(a-n)/(d?n-s:s-n))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(t){return{M:p,y:V,w:b,d:g,D:F,h:Z,m:M,s:h,ms:m,Q:x}[t]||String(t||"").toLowerCase().replace(/s$/,"")},u:function(t){return t===void 0}},L="en",A={};A[L]=T;var _=function(t){return t instanceof u},J=function t(i,a,f){var n;if(!i)return L;if(typeof i=="string"){var d=i.toLowerCase();A[d]&&(n=d),a&&(A[d]=a,n=d);var s=i.split("-");if(!n&&s.length>1)return t(s[0])}else{var S=i.name;A[S]=i,n=S}return!f&&n&&(L=n),n||!f&&L},H=function(t,i){if(_(t))return t.clone();var a=typeof i=="object"?i:{};return a.date=t,a.args=arguments,new u(a)},r=y;r.l=J,r.i=_,r.w=function(t,i){return H(t,{locale:i.$L,utc:i.$u,x:i.$x,$offset:i.$offset})};var u=function(){function t(a){this.$L=J(a.locale,null,!0),this.parse(a)}var i=t.prototype;return i.parse=function(a){this.$d=function(f){var n=f.date,d=f.utc;if(n===null)return new Date(NaN);if(r.u(n))return new Date;if(n instanceof Date)return new Date(n);if(typeof n=="string"&&!/Z$/i.test(n)){var s=n.match(B);if(s){var S=s[2]-1||0,R=(s[7]||"0").substring(0,3);return d?new Date(Date.UTC(s[1],S,s[3]||1,s[4]||0,s[5]||0,s[6]||0,R)):new Date(s[1],S,s[3]||1,s[4]||0,s[5]||0,s[6]||0,R)}}return new Date(n)}(a),this.$x=a.x||{},this.init()},i.init=function(){var a=this.$d;this.$y=a.getFullYear(),this.$M=a.getMonth(),this.$D=a.getDate(),this.$W=a.getDay(),this.$H=a.getHours(),this.$m=a.getMinutes(),this.$s=a.getSeconds(),this.$ms=a.getMilliseconds()},i.$utils=function(){return r},i.isValid=function(){return this.$d.toString()!==P},i.isSame=function(a,f){var n=H(a);return this.startOf(f)<=n&&n<=this.endOf(f)},i.isAfter=function(a,f){return H(a)<this.startOf(f)},i.isBefore=function(a,f){return this.endOf(f)<H(a)},i.$g=function(a,f,n){return r.u(a)?this[f]:this.set(n,a)},i.unix=function(){return Math.floor(this.valueOf()/1e3)},i.valueOf=function(){return this.$d.getTime()},i.startOf=function(a,f){var n=this,d=!!r.u(f)||f,s=r.p(a),S=function(v1,N){var o1=r.w(n.$u?Date.UTC(n.$y,N,v1):new Date(n.$y,N,v1),n);return d?o1:o1.endOf(g)},R=function(v1,N){return r.w(n.toDate()[v1].apply(n.toDate("s"),(d?[0,0,0,0]:[23,59,59,999]).slice(N)),n)},G=this.$W,U=this.$M,a1=this.$D,i1="set"+(this.$u?"UTC":"");switch(s){case V:return d?S(1,0):S(31,11);case p:return d?S(1,U):S(0,U+1);case b:var V1=this.$locale().weekStart||0,y1=(G<V1?G+7:G)-V1;return S(d?a1-y1:a1+(6-y1),U);case g:case F:return R(i1+"Hours",0);case Z:return R(i1+"Minutes",1);case M:return R(i1+"Seconds",2);case h:return R(i1+"Milliseconds",3);default:return this.clone()}},i.endOf=function(a){return this.startOf(a,!1)},i.$set=function(a,f){var n,d=r.p(a),s="set"+(this.$u?"UTC":""),S=(n={},n[g]=s+"Date",n[F]=s+"Date",n[p]=s+"Month",n[V]=s+"FullYear",n[Z]=s+"Hours",n[M]=s+"Minutes",n[h]=s+"Seconds",n[m]=s+"Milliseconds",n)[d],R=d===g?this.$D+(f-this.$W):f;if(d===p||d===V){var G=this.clone().set(F,1);G.$d[S](R),G.init(),this.$d=G.set(F,Math.min(this.$D,G.daysInMonth())).$d}else S&&this.$d[S](R);return this.init(),this},i.set=function(a,f){return this.clone().$set(a,f)},i.get=function(a){return this[r.p(a)]()},i.add=function(a,f){var n,d=this;a=Number(a);var s=r.p(f),S=function(U){var a1=H(d);return r.w(a1.date(a1.date()+Math.round(U*a)),d)};if(s===p)return this.set(p,this.$M+a);if(s===V)return this.set(V,this.$y+a);if(s===g)return S(1);if(s===b)return S(7);var R=(n={},n[M]=c,n[Z]=l,n[h]=e,n)[s]||1,G=this.$d.getTime()+a*R;return r.w(G,this)},i.subtract=function(a,f){return this.add(-1*a,f)},i.format=function(a){var f=this,n=this.$locale();if(!this.isValid())return n.invalidDate||P;var d=a||"YYYY-MM-DDTHH:mm:ssZ",s=r.z(this),S=this.$H,R=this.$m,G=this.$M,U=n.weekdays,a1=n.months,i1=function(N,o1,Q1,S1){return N&&(N[o1]||N(f,d))||Q1[o1].slice(0,S1)},V1=function(N){return r.s(S%12||12,N,"0")},y1=n.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:G+1,MM:r.s(G+1,2,"0"),MMM:i1(n.monthsShort,G,a1,3),MMMM:i1(a1,G),D:this.$D,DD:r.s(this.$D,2,"0"),d:String(this.$W),dd:i1(n.weekdaysMin,this.$W,U,2),ddd:i1(n.weekdaysShort,this.$W,U,3),dddd:U[this.$W],H:String(S),HH:r.s(S,2,"0"),h:V1(1),hh:V1(2),a:y1(S,R,!0),A:y1(S,R,!1),m:String(R),mm:r.s(R,2,"0"),s:String(this.$s),ss:r.s(this.$s,2,"0"),SSS:r.s(this.$ms,3,"0"),Z:s};return d.replace(D,function(N,o1){return o1||v1[N]||s.replace(":","")})},i.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},i.diff=function(a,f,n){var d,s=r.p(f),S=H(a),R=(S.utcOffset()-this.utcOffset())*c,G=this-S,U=r.m(this,S);return U=(d={},d[V]=U/12,d[p]=U,d[x]=U/3,d[b]=(G-R)/6048e5,d[g]=(G-R)/864e5,d[Z]=G/l,d[M]=G/c,d[h]=G/e,d)[s]||G,n?U:r.a(U)},i.daysInMonth=function(){return this.endOf(p).$D},i.$locale=function(){return A[this.$L]},i.locale=function(a,f){if(!a)return this.$L;var n=this.clone(),d=J(a,f,!0);return d&&(n.$L=d),n},i.clone=function(){return r.w(this.$d,this)},i.toDate=function(){return new Date(this.valueOf())},i.toJSON=function(){return this.isValid()?this.toISOString():null},i.toISOString=function(){return this.$d.toISOString()},i.toString=function(){return this.$d.toUTCString()},t}(),Y=u.prototype;return H.prototype=Y,[["$ms",m],["$s",h],["$m",M],["$H",Z],["$W",g],["$M",p],["$y",V],["$D",F]].forEach(function(t){Y[t[1]]=function(i){return this.$g(i,t[0],t[1])}}),H.extend=function(t,i){return t.$i||(t(i,u,H),t.$i=!0),H},H.locale=J,H.isDayjs=_,H.unix=function(t){return H(1e3*t)},H.en=A[L],H.Ls=A,H.p={},H})});var m2=Z2((h2,d2)=>{(function(e,c){typeof h2=="object"&&typeof d2!="undefined"?d2.exports=c(Y2()):typeof define=="function"&&define.amd?define(["dayjs"],c):(e=typeof globalThis!="undefined"?globalThis:e||self).dayjs_locale_pt_br=c(e.dayjs)})(h2,function(e){"use strict";function c(h){return h&&typeof h=="object"&&"default"in h?h:{default:h}}var l=c(e),m={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(h){return h+"\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 l.default.locale(m,null,!0),m})});var W0={};F0(W0,{Autocomplete:()=>H0,Checkbox:()=>I2,Creatable:()=>G2,DatePicker:()=>l0,Form:()=>y2,FormProvider:()=>$1,RadioButton:()=>R2,RadioGroup:()=>O2,Searchable:()=>A2,Select:()=>w2,Slider:()=>q2,Switch:()=>B2,TextField:()=>S2,TimePicker:()=>u0,useForm:()=>A1});module.exports=P0(W0);var f2=require("react-hook-form");var e2=require("react/jsx-runtime"),k0=h=>{var M=h,{children:e,style:c,onSubmit:l}=M,m=$(M,["children","style","onSubmit"]);return(0,e2.jsx)(f2.FormProvider,v(o({},m),{children:(0,e2.jsx)("form",{onSubmit:Z=>{Z.preventDefault(),Z.stopPropagation(),l(Z)},style:c,children:e})}))},$1=k0;var M2=require("react"),H2=require("react-hook-form"),V2=require("@hookform/resolvers/zod");var S0=m=>{var h=m,{disableDefaultValuesUpdate:e,onSubmit:c}=h,l=$(h,["disableDefaultValuesUpdate","onSubmit"]);let M=(0,H2.useForm)(v(o({},l),{resolver:l.schema&&(0,V2.zodResolver)(l.schema)}));return(0,M2.useEffect)(()=>{e||M.reset(l.defaultValues)},[l.defaultValues,M.reset]),v(o({},M),{onSubmit:M.handleSubmit(Z=>c(Z,M))})},A1=S0;var C2=require("react/jsx-runtime");function w0(m){var h=m,{children:e,style:c}=h,l=$(h,["children","style"]);let M=A1(l);return(0,C2.jsx)($1,v(o({},M),{style:c,children:typeof e=="function"?e(M):e}))}var y2=w0;var T1=require("react"),D1=require("react-hook-form"),t1=require("@mui/material");var g2={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"},x2={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 L2={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 c2={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 i2=require("@mui/material"),b2=require("@s_mart/utils"),g1=require("react/jsx-runtime"),I=({label:e,required:c,regular:l})=>(0,g1.jsxs)("span",{style:{display:"flex",alignItems:"center",gap:(0,b2.toRem)(2)},children:[(0,g1.jsx)(i2.Typography,{variant:"caption",fontWeight:l?400:700,style:{display:"flex",alignItems:"center"},children:e}),c&&(0,g1.jsx)(i2.Typography,{variant:"caption",fontWeight:900,color:"error",children:"*"})]});var F2=require("react-hook-form"),P2=require("@s_mart/core");var q=(e,c)=>{var l,m,h,M,Z;if(e[c])return e[c];if(c.includes("[")){let[g,b]=c.split("["),[p,x]=b.split("].");return(m=(l=e[g])==null?void 0:l[p])==null?void 0:m[x]}if(c.includes(".")){let[g,b,p]=c.split(".");return p?(Z=(M=e[g])==null?void 0:M[b])==null?void 0:Z[p]:(h=e[g])==null?void 0:h[b]}};var k2=require("react/jsx-runtime"),O=({name:e})=>{var m;let c=(0,F2.useFormContext)(),l=q((m=c==null?void 0:c.formState)==null?void 0:m.errors,e);return l?(0,k2.jsx)(P2.Indicator,{severity:"error",children:l==null?void 0:l.message}):null};var x1=require("@s_mart/core");var z=require("react/jsx-runtime"),$0=B=>{var D=B,{name:e,rules:c,defaultValue:l,shouldUnregister:m,label:h,required:M,mask:Z,variant:g="outlined",info:b,parse:p,inputMode:x,format:V,onInputChange:F}=D,P=$(D,["name","rules","defaultValue","shouldUnregister","label","required","mask","variant","info","parse","inputMode","format","onInputChange"]);let T=(0,D1.useFormContext)();if(!T)throw new Error("Para usar o <TextField /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let[k,y]=(0,T1.useState)(!1),L=H=>{var u;let r=H;return V&&(r=V(H)),Z?(u=Z1==null?void 0:Z1[Z])==null?void 0:u.format(r):r},A=H=>{var u;let r=H;return p&&(r=p(H)),Z?(u=Z1==null?void 0:Z1[Z])==null?void 0:u.parse(r):r},_=H=>{if(!H||Z!=="porcentagem")return;H==null||H.stopPropagation();let r=(H==null?void 0:H.target).value;if(r){let u=String(r);if(u.length>0){let Y=u.indexOf("%");Y>-1&&(H.currentTarget.selectionEnd=Y)}}},J=q(T.formState.errors,e);return(0,z.jsx)(D1.Controller,{control:T.control,name:e,rules:c,defaultValue:l,shouldUnregister:m,render:({field:{value:H,onChange:r,ref:u}})=>(0,z.jsxs)(t1.Grid,{display:"flex",flexDirection:"column",children:[(0,z.jsxs)("div",{style:{display:"flex"},children:[h&&(0,z.jsx)(t1.Grid,{item:!0,children:(0,z.jsx)(I,{label:h,required:M})}),b&&(0,z.jsx)(t1.Grid,{item:!0,children:(0,z.jsx)(x1.Tooltip,{title:b,placement:"top",children:(0,z.jsx)("div",{style:{width:"fit-content"},children:(0,z.jsx)(x1.LIcon,{icon:r1,color:"#757575"})})})})]}),(0,z.jsx)(t1.TextField,v(o({variant:g,defaultValue:l,value:L(H||""),onChange:Y=>{var i;let t=A((i=Y==null?void 0:Y.target)==null?void 0:i.value);r(t),F==null||F(t,T.getValues())},error:!!J},P),{type:P.type==="password"?k?"text":"password":P.type,autoComplete:P.autoComplete||"off",inputProps:o({inputMode:x},P.inputProps),InputProps:o({onKeyDown:_,inputRef:u,endAdornment:P.type==="password"&&(0,z.jsx)(t1.InputAdornment,{position:"start",onClick:()=>y(!k),style:{cursor:"pointer"},children:(0,z.jsx)(x1.LIcon,{icon:k?g2:x2,size:"24px",removeMargin:!0})})},P.InputProps)}),e),(0,z.jsx)(O,{name:e})]})})},S2=(0,T1.memo)($0);var _1=require("react"),E1=require("react-hook-form"),u1=require("@s_mart/core"),j=require("@mui/material");var E=require("react/jsx-runtime"),A0=B=>{var D=B,{name:e,rules:c,defaultValue:l,shouldUnregister:m,label:h,required:M,options:Z,placeholder:g,disableOnChangeForm:b=!1,multiple:p,info:x,footer:V,onChange:F}=D,P=$(D,["name","rules","defaultValue","shouldUnregister","label","required","options","placeholder","disableOnChangeForm","multiple","info","footer","onChange"]);let T=(0,E1.useFormContext)(),{palette:k}=(0,j.useTheme)(),[y,L]=(0,_1.useState)(!1);if(!T)throw new Error("Para usar o <Select /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let A=q(T.formState.errors,e);return console.warn=()=>{},(0,E.jsx)(E1.Controller,{control:T.control,name:e,rules:c,defaultValue:l,shouldUnregister:m,render:({field:{value:_,onChange:J,ref:H}})=>(0,E.jsxs)(j.Grid,{display:"flex",flexDirection:"column",children:[(0,E.jsxs)("div",{style:{display:"flex"},children:[h&&(0,E.jsx)(j.Grid,{item:!0,children:(0,E.jsx)(I,{label:h,required:M})}),x&&(0,E.jsx)(j.Grid,{item:!0,children:(0,E.jsx)(u1.Tooltip,{title:x,placement:"top",children:(0,E.jsx)("div",{style:{width:"fit-content"},children:(0,E.jsx)(u1.LIcon,{icon:r1,color:"#757575"})})})})]}),(0,E.jsxs)(j.Select,v(o({open:y,onOpen:()=>L(!0),onClose:()=>L(!1),displayEmpty:!!g,variant:"outlined",autoComplete:"off",value:_?_||"":p?[]:"",renderValue:r=>{if(r.label)return r.label;if(g)return(0,E.jsx)("p",{style:{color:k.grey[400]},children:g})},multiple:p,onChange:r=>{!b&&J(r.target.value),F&&F(r.target.value,T.getValues())},error:!!A,size:P.size||"medium",inputRef:H},P),{children:[g&&(0,E.jsx)(j.MenuItem,{disabled:!0,value:"",children:(0,E.jsx)("p",{style:{color:k.grey[400]},children:g})}),Z==null?void 0:Z.map((r,u)=>(0,E.jsx)(j.MenuItem,{value:r,children:(0,E.jsxs)(j.Grid,{container:!0,direction:"column",children:[(0,E.jsx)(j.Grid,{item:!0,children:r.label}),r.afterLabel&&(0,E.jsx)(j.Grid,{item:!0,children:r.afterLabel})]})},u)),V&&[(0,E.jsx)(j.Grid,{px:2,py:1,children:(0,E.jsx)(u1.Divider,{})},"footer-divider"),(0,E.jsx)("div",{children:V({closeSelect:()=>L(!1)})},"footer-content")]]}),e),(0,E.jsx)(O,{name:e})]})})},w2=(0,_1.memo)(A0);var G1=require("react"),I1=require("react-hook-form"),W=require("@mui/material"),d1=require("@s_mart/core");var $2=require("@s_mart/tokens");var w=require("react/jsx-runtime"),l2=require("react"),T0=T=>{var k=T,{name:e,rules:c,defaultValue:l,shouldUnregister:m,label:h,required:M,options:Z,textFieldProps:g,noOptionsText:b,footer:p,multiple:x,info:V,placeholder:F,onChange:P,onInputChange:B}=k,D=$(k,["name","rules","defaultValue","shouldUnregister","label","required","options","textFieldProps","noOptionsText","footer","multiple","info","placeholder","onChange","onInputChange"]);let y=(0,I1.useFormContext)();if(!y)throw new Error("Para usar o <Searchable /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let L=q(y.formState.errors,e);return console.warn=()=>{},(0,w.jsx)(I1.Controller,{control:y.control,name:e,rules:c,defaultValue:l,shouldUnregister:m,render:({field:{onChange:A,value:_,ref:J}})=>{var H;return(0,w.jsxs)(W.Grid,{display:"flex",flexDirection:"column",children:[(0,w.jsxs)("div",{style:{display:"flex"},children:[h&&(0,w.jsx)(W.Grid,{item:!0,children:(0,w.jsx)(I,{label:h,required:M})}),V&&(0,w.jsx)(W.Grid,{item:!0,children:(0,w.jsx)(d1.Tooltip,{title:V,placement:"top",children:(0,w.jsx)("div",{style:{width:"fit-content"},children:(0,w.jsx)(d1.LIcon,{icon:r1,color:"#757575"})})})})]}),(0,w.jsx)(W.Autocomplete,v(o({onChange:(r,u)=>{A(u),P==null||P(u,y.getValues())},onInputChange:(r,u,Y)=>{Y==="input"&&setTimeout(()=>{B==null||B(u,y.getValues())},0)},slotProps:v(o({},D.slotProps||{}),{paper:v(o({},(D.slotProps||{}).paper||{}),{sx:o({border:`1px solid ${$2.colorPalette.neutral[30]}`,boxShadow:"0px 2px 4px rgba(0, 0, 0, 0.15)"},((H=(D.slotProps||{}).paper)==null?void 0:H.sx)||{})})}),value:_||(x?[]:null),options:Z,multiple:x,noOptionsText:(0,w.jsxs)(w.Fragment,{children:[b||"Nenhum resultado encontrado",p?(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(W.Grid,{py:1,children:(0,w.jsx)(d1.Divider,{})}),p]}):null]}),isOptionEqualToValue:(r,u)=>typeof r=="string"&&typeof u=="string"?r===u:typeof r=="object"&&typeof u=="object"?typeof r.value=="object"&&typeof u.value=="object"&&r.key!==void 0&&u.key!==void 0?r.key===u.key:r.value===u.value:!1,renderOption:(r,u)=>typeof u=="object"?(0,l2.createElement)("li",v(o({},r),{key:u.key||u.value}),(0,w.jsxs)(W.Grid,{container:!0,direction:"column",children:[(0,w.jsx)(W.Grid,{item:!0,children:u.label}),u.afterLabel&&(0,w.jsx)(W.Grid,{item:!0,children:u.afterLabel})]})):(0,l2.createElement)("li",v(o({},r),{key:u}),u),ListboxComponent:(0,G1.forwardRef)(function(u,Y){return(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)("ul",v(o({},u),{ref:Y})),!!p&&(0,w.jsx)("div",v(o({},u),{children:(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(W.Grid,{px:2,py:1,children:(0,w.jsx)(d1.Divider,{})}),p]})}),"searchable-footer")]})})},D),{renderInput:r=>(0,w.jsx)(W.TextField,v(o(o({error:!!L,placeholder:F},r),g),{inputRef:J}))}),e),(0,w.jsx)(O,{name:e})]})}})},A2=(0,G1.memo)(T0);var B1=require("react"),R1=require("react-hook-form"),O1=require("lodash"),K=require("@mui/material"),Q=require("@s_mart/core"),E2=require("@s_mart/tokens");var o2=require("@s_mart/utils");var L1=require("@s_mart/utils"),T2=p1(require("@emotion/styled")),a2=require("@emotion/react"),D2=a2.css`
|
|
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,c,o)=>c in e?g1(e,c,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[c]=o,a=(e,c)=>{for(var o in c||(c={}))X1.call(c,o)&&v0(e,o,c[o]);if(w1)for(var o of w1(c))p0.call(c,o)&&v0(e,o,c[o]);return e},m=(e,c)=>g2(e,b2(c));var $=(e,c)=>{var o={};for(var s in e)X1.call(e,s)&&c.indexOf(s)<0&&(o[s]=e[s]);if(e!=null&&w1)for(var s of w1(e))c.indexOf(s)<0&&p0.call(e,s)&&(o[s]=e[s]);return o};var Z0=(e,c)=>()=>(c||e((c={exports:{}}).exports,c),c.exports),P2=(e,c)=>{for(var o in c)g1(e,o,{get:c[o],enumerable:!0})},u0=(e,c,o,s)=>{if(c&&typeof c=="object"||typeof c=="function")for(let r of L2(c))!X1.call(e,r)&&r!==o&&g1(e,r,{get:()=>c[r],enumerable:!(s=x2(c,r))||s.enumerable});return e};var p1=(e,c,o)=>(o=e!=null?y2(F2(e)):{},u0(c||!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,c){typeof n0=="object"&&typeof s0!="undefined"?s0.exports=c():typeof define=="function"&&define.amd?define(c):(e=typeof globalThis!="undefined"?globalThis:e||self).dayjs=c()})(n0,function(){"use strict";var e=1e3,c=6e4,o=36e5,s="millisecond",r="second",M="minute",p="hour",b="day",P="week",u="month",S="quarter",f="year",F="date",A="Invalid Date",k=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,q=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,D={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(h){var i=["th","st","nd","rd"],l=h%100;return"["+h+(i[(l-20)%10]||i[l]||i[0])+"]"}},T=function(h,i,l){var V=String(h);return!V||V.length>=i?h:""+Array(i+1-V.length).join(l)+h},w={s:T,z:function(h){var i=-h.utcOffset(),l=Math.abs(i),V=Math.floor(l/60),t=l%60;return(i<=0?"+":"-")+T(V,2,"0")+":"+T(t,2,"0")},m:function h(i,l){if(i.date()<l.date())return-h(l,i);var V=12*(l.year()-i.year())+(l.month()-i.month()),t=i.clone().add(V,u),g=l-t<0,n=i.clone().add(V+(g?-1:1),u);return+(-(V+(l-t)/(g?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:f,w:P,d:b,D:F,h:p,m:M,s:r,ms:s,Q:S}[h]||String(h||"").toLowerCase().replace(/s$/,"")},u:function(h){return h===void 0}},H="en",x={};x[H]=D;var I=function(h){return h instanceof Z},E=function h(i,l,V){var t;if(!i)return H;if(typeof i=="string"){var g=i.toLowerCase();x[g]&&(t=g),l&&(x[g]=l,t=g);var n=i.split("-");if(!t&&n.length>1)return h(n[0])}else{var d=i.name;x[d]=i,t=d}return!V&&t&&(H=t),t||!V&&H},_=function(h,i){if(I(h))return h.clone();var l=typeof i=="object"?i:{};return l.date=h,l.args=arguments,new Z(l)},v=w;v.l=E,v.i=I,v.w=function(h,i){return _(h,{locale:i.$L,utc:i.$u,x:i.$x,$offset:i.$offset})};var Z=function(){function h(l){this.$L=E(l.locale,null,!0),this.parse(l)}var i=h.prototype;return i.parse=function(l){this.$d=function(V){var t=V.date,g=V.utc;if(t===null)return new Date(NaN);if(v.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,G=(n[7]||"0").substring(0,3);return g?new Date(Date.UTC(n[1],d,n[3]||1,n[4]||0,n[5]||0,n[6]||0,G)):new Date(n[1],d,n[3]||1,n[4]||0,n[5]||0,n[6]||0,G)}}return new Date(t)}(l),this.$x=l.x||{},this.init()},i.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()},i.$utils=function(){return v},i.isValid=function(){return this.$d.toString()!==A},i.isSame=function(l,V){var t=_(l);return this.startOf(V)<=t&&t<=this.endOf(V)},i.isAfter=function(l,V){return _(l)<this.startOf(V)},i.isBefore=function(l,V){return this.endOf(V)<_(l)},i.$g=function(l,V,t){return v.u(l)?this[V]:this.set(t,l)},i.unix=function(){return Math.floor(this.valueOf()/1e3)},i.valueOf=function(){return this.$d.getTime()},i.startOf=function(l,V){var t=this,g=!!v.u(V)||V,n=v.p(l),d=function(v1,W){var o1=v.w(t.$u?Date.UTC(t.$y,W,v1):new Date(t.$y,W,v1),t);return g?o1:o1.endOf(b)},G=function(v1,W){return v.w(t.toDate()[v1].apply(t.toDate("s"),(g?[0,0,0,0]:[23,59,59,999]).slice(W)),t)},R=this.$W,Y=this.$M,a1=this.$D,i1="set"+(this.$u?"UTC":"");switch(n){case f:return g?d(1,0):d(31,11);case u:return g?d(1,Y):d(0,Y+1);case P:var V1=this.$locale().weekStart||0,y1=(R<V1?R+7:R)-V1;return d(g?a1-y1:a1+(6-y1),Y);case b:case F:return G(i1+"Hours",0);case p:return G(i1+"Minutes",1);case M:return G(i1+"Seconds",2);case r:return G(i1+"Milliseconds",3);default:return this.clone()}},i.endOf=function(l){return this.startOf(l,!1)},i.$set=function(l,V){var t,g=v.p(l),n="set"+(this.$u?"UTC":""),d=(t={},t[b]=n+"Date",t[F]=n+"Date",t[u]=n+"Month",t[f]=n+"FullYear",t[p]=n+"Hours",t[M]=n+"Minutes",t[r]=n+"Seconds",t[s]=n+"Milliseconds",t)[g],G=g===b?this.$D+(V-this.$W):V;if(g===u||g===f){var R=this.clone().set(F,1);R.$d[d](G),R.init(),this.$d=R.set(F,Math.min(this.$D,R.daysInMonth())).$d}else d&&this.$d[d](G);return this.init(),this},i.set=function(l,V){return this.clone().$set(l,V)},i.get=function(l){return this[v.p(l)]()},i.add=function(l,V){var t,g=this;l=Number(l);var n=v.p(V),d=function(Y){var a1=_(g);return v.w(a1.date(a1.date()+Math.round(Y*l)),g)};if(n===u)return this.set(u,this.$M+l);if(n===f)return this.set(f,this.$y+l);if(n===b)return d(1);if(n===P)return d(7);var G=(t={},t[M]=c,t[p]=o,t[r]=e,t)[n]||1,R=this.$d.getTime()+l*G;return v.w(R,this)},i.subtract=function(l,V){return this.add(-1*l,V)},i.format=function(l){var V=this,t=this.$locale();if(!this.isValid())return t.invalidDate||A;var g=l||"YYYY-MM-DDTHH:mm:ssZ",n=v.z(this),d=this.$H,G=this.$m,R=this.$M,Y=t.weekdays,a1=t.months,i1=function(W,o1,Q1,S1){return W&&(W[o1]||W(V,g))||Q1[o1].slice(0,S1)},V1=function(W){return v.s(d%12||12,W,"0")},y1=t.meridiem||function(W,o1,Q1){var S1=W<12?"AM":"PM";return Q1?S1.toLowerCase():S1},v1={YY:String(this.$y).slice(-2),YYYY:this.$y,M:R+1,MM:v.s(R+1,2,"0"),MMM:i1(t.monthsShort,R,a1,3),MMMM:i1(a1,R),D:this.$D,DD:v.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:v.s(d,2,"0"),h:V1(1),hh:V1(2),a:y1(d,G,!0),A:y1(d,G,!1),m:String(G),mm:v.s(G,2,"0"),s:String(this.$s),ss:v.s(this.$s,2,"0"),SSS:v.s(this.$ms,3,"0"),Z:n};return g.replace(q,function(W,o1){return o1||v1[W]||n.replace(":","")})},i.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},i.diff=function(l,V,t){var g,n=v.p(V),d=_(l),G=(d.utcOffset()-this.utcOffset())*c,R=this-d,Y=v.m(this,d);return Y=(g={},g[f]=Y/12,g[u]=Y,g[S]=Y/3,g[P]=(R-G)/6048e5,g[b]=(R-G)/864e5,g[p]=R/o,g[M]=R/c,g[r]=R/e,g)[n]||R,t?Y:v.a(Y)},i.daysInMonth=function(){return this.endOf(u).$D},i.$locale=function(){return x[this.$L]},i.locale=function(l,V){if(!l)return this.$L;var t=this.clone(),g=E(l,V,!0);return g&&(t.$L=g),t},i.clone=function(){return v.w(this.$d,this)},i.toDate=function(){return new Date(this.valueOf())},i.toJSON=function(){return this.isValid()?this.toISOString():null},i.toISOString=function(){return this.$d.toISOString()},i.toString=function(){return this.$d.toUTCString()},h}(),y=Z.prototype;return _.prototype=y,[["$ms",s],["$s",r],["$m",M],["$H",p],["$W",b],["$M",u],["$y",f],["$D",F]].forEach(function(h){y[h[1]]=function(i){return this.$g(i,h[0],h[1])}}),_.extend=function(h,i){return h.$i||(h(i,Z,_),h.$i=!0),_},_.locale=E,_.isDayjs=I,_.unix=function(h){return _(1e3*h)},_.en=x[H],_.Ls=x,_.p={},_})});var m0=Z0((h0,d0)=>{(function(e,c){typeof h0=="object"&&typeof d0!="undefined"?d0.exports=c(Y0()):typeof define=="function"&&define.amd?define(["dayjs"],c):(e=typeof globalThis!="undefined"?globalThis:e||self).dayjs_locale_pt_br=c(e.dayjs)})(h0,function(e){"use strict";function c(r){return r&&typeof r=="object"&&"default"in r?r:{default:r}}var o=c(e),s={name:"pt-br",weekdays:"domingo_segunda-feira_ter\xE7a-feira_quarta-feira_quinta-feira_sexta-feira_s\xE1bado".split("_"),weekdaysShort:"dom_seg_ter_qua_qui_sex_s\xE1b".split("_"),weekdaysMin:"Do_2\xAA_3\xAA_4\xAA_5\xAA_6\xAA_S\xE1".split("_"),months:"janeiro_fevereiro_mar\xE7o_abril_maio_junho_julho_agosto_setembro_outubro_novembro_dezembro".split("_"),monthsShort:"jan_fev_mar_abr_mai_jun_jul_ago_set_out_nov_dez".split("_"),ordinal:function(r){return r+"\xBA"},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY [\xE0s] HH:mm",LLLL:"dddd, D [de] MMMM [de] YYYY [\xE0s] HH:mm"},relativeTime:{future:"em %s",past:"h\xE1 %s",s:"poucos segundos",m:"um minuto",mm:"%d minutos",h:"uma hora",hh:"%d horas",d:"um dia",dd:"%d dias",M:"um m\xEAs",MM:"%d meses",y:"um ano",yy:"%d anos"}};return o.default.locale(s,null,!0),s})});var W2={};P2(W2,{Autocomplete:()=>H2,Checkbox:()=>G0,Creatable:()=>E0,DatePicker:()=>l2,Form:()=>y0,FormProvider:()=>$1,RadioButton:()=>R0,RadioGroup:()=>O0,Searchable:()=>A0,Select:()=>w0,Slider:()=>q0,Switch:()=>B0,TextField:()=>S0,TimePicker:()=>u2,useForm:()=>A1});module.exports=C2(W2);var f0=require("react-hook-form");var e0=require("react/jsx-runtime"),k2=r=>{var M=r,{children:e,style:c,onSubmit:o}=M,s=$(M,["children","style","onSubmit"]);return(0,e0.jsx)(f0.FormProvider,m(a({},s),{children:(0,e0.jsx)("form",{onSubmit:p=>{p.preventDefault(),p.stopPropagation(),o(p)},style:c,children:e})}))},$1=k2;var M0=require("react"),H0=require("react-hook-form"),V0=require("@hookform/resolvers/zod");var S2=s=>{var r=s,{disableDefaultValuesUpdate:e,onSubmit:c}=r,o=$(r,["disableDefaultValuesUpdate","onSubmit"]);let M=(0,H0.useForm)(m(a({},o),{resolver:o.schema&&(0,V0.zodResolver)(o.schema)}));return(0,M0.useEffect)(()=>{e||M.reset(o.defaultValues)},[o.defaultValues,M.reset]),m(a({},M),{onSubmit:M.handleSubmit(p=>c(p,M))})},A1=S2;var g0=require("react/jsx-runtime");function w2(s){var r=s,{children:e,style:c}=r,o=$(r,["children","style"]);let M=A1(o);return(0,g0.jsx)($1,m(a({},M),{style:c,children:typeof e=="function"?e(M):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"),O=({label:e,required:c,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}),c&&(0,x1.jsx)(i0.Typography,{variant:"caption",fontWeight:900,color:"error",children:"*"})]});var P0=require("react-hook-form"),C0=require("@s_mart/core");var z=(e,c)=>{var o,s,r,M,p;if(e[c])return e[c];if(c.includes("[")){let[b,P]=c.split("["),[u,S]=P.split("].");return(s=(o=e[b])==null?void 0:o[u])==null?void 0:s[S]}if(c.includes(".")){let[b,P,u]=c.split(".");return u?(p=(M=e[b])==null?void 0:M[P])==null?void 0:p[u]:(r=e[b])==null?void 0:r[P]}};var k0=require("react/jsx-runtime"),U=({name:e,disableIcon:c=!1})=>{var r;let o=(0,P0.useFormContext)(),s=z((r=o==null?void 0:o.formState)==null?void 0:r.errors,e);return s?(0,k0.jsx)(C0.Indicator,{severity:"error",icon:!c,children:s==null?void 0:s.message}):null};var b1=require("@s_mart/core");var j=require("react/jsx-runtime"),$2=q=>{var D=q,{name:e,rules:c,defaultValue:o,shouldUnregister:s,label:r,required:M,mask:p,variant:b="outlined",info:P,parse:u,inputMode:S,format:f,onInputChange:F,disableIconError:A}=D,k=$(D,["name","rules","defaultValue","shouldUnregister","label","required","mask","variant","info","parse","inputMode","format","onInputChange","disableIconError"]);let T=(0,D1.useFormContext)();if(!T)throw new Error("Para usar o <TextField /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let[w,H]=(0,T1.useState)(!1),x=v=>{var y;let Z=v;return f&&(Z=f(v)),p?(y=Z1==null?void 0:Z1[p])==null?void 0:y.format(Z):Z},I=v=>{var y;let Z=v;return u&&(Z=u(v)),p?(y=Z1==null?void 0:Z1[p])==null?void 0:y.parse(Z):Z},E=v=>{if(!v||p!=="porcentagem"&&p!=="porcentagem0")return;v==null||v.stopPropagation();let Z=(v==null?void 0:v.target).value;if(Z){let y=String(Z);if(y.length>0){let h=y.indexOf("%");h>-1&&(v.currentTarget.selectionEnd=h)}}},_=z(T.formState.errors,e);return(0,j.jsx)(D1.Controller,{control:T.control,name:e,rules:c,defaultValue:o,shouldUnregister:s,render:({field:{value:v,onChange:Z,ref:y}})=>(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)(O,{label:r,required:M})}),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,m(a({variant:b,defaultValue:o,value:x(v||""),onChange:h=>{var l;let i=I((l=h==null?void 0:h.target)==null?void 0:l.value);Z(i),F==null||F(i,T.getValues())},error:!!_},k),{type:k.type==="password"?w?"text":"password":k.type,autoComplete:k.autoComplete||"off",inputProps:a({inputMode:S},k.inputProps),InputProps:a({onKeyDown:E,inputRef:y,endAdornment:k.type==="password"&&(0,j.jsx)(t1.InputAdornment,{position:"start",onClick:()=>H(!w),style:{cursor:"pointer"},children:(0,j.jsx)(b1.LIcon,{icon:w?x0:b0,size:"24px",removeMargin:!0})})},k.InputProps)}),e),(0,j.jsx)(U,{name:e,disableIcon:A})]})})},S0=(0,T1.memo)($2);var _1=require("react"),I1=require("react-hook-form"),u1=require("@s_mart/core"),N=require("@mui/material");var B=require("react/jsx-runtime"),A2=q=>{var D=q,{name:e,rules:c,defaultValue:o,shouldUnregister:s,label:r,required:M,options:p,placeholder:b,disableOnChangeForm:P=!1,multiple:u,info:S,footer:f,onChange:F,disableIconError:A}=D,k=$(D,["name","rules","defaultValue","shouldUnregister","label","required","options","placeholder","disableOnChangeForm","multiple","info","footer","onChange","disableIconError"]);let T=(0,I1.useFormContext)(),{palette:w}=(0,N.useTheme)(),[H,x]=(0,_1.useState)(!1);if(!T)throw new Error("Para usar o <Select /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let I=z(T.formState.errors,e);return console.warn=()=>{},(0,B.jsx)(I1.Controller,{control:T.control,name:e,rules:c,defaultValue:o,shouldUnregister:s,render:({field:{value:E,onChange:_,ref:v}})=>(0,B.jsxs)(N.Grid,{display:"flex",flexDirection:"column",children:[(0,B.jsxs)("div",{style:{display:"flex"},children:[r&&(0,B.jsx)(N.Grid,{item:!0,children:(0,B.jsx)(O,{label:r,required:M})}),S&&(0,B.jsx)(N.Grid,{item:!0,children:(0,B.jsx)(u1.Tooltip,{title:S,placement:"top",children:(0,B.jsx)("div",{style:{width:"fit-content"},children:(0,B.jsx)(u1.LIcon,{icon:r1,color:"#757575"})})})})]}),(0,B.jsxs)(N.Select,m(a({open:H,onOpen:()=>x(!0),onClose:()=>x(!1),displayEmpty:!!b,variant:"outlined",autoComplete:"off",value:E?E||"":u?[]:"",renderValue:Z=>{if(Z.label)return Z.label;if(b)return(0,B.jsx)("p",{style:{color:w.grey[400]},children:b})},multiple:u,onChange:Z=>{!P&&_(Z.target.value),F&&F(Z.target.value,T.getValues())},error:!!I,size:k.size||"medium",inputRef:v},k),{children:[b&&(0,B.jsx)(N.MenuItem,{disabled:!0,value:"",children:(0,B.jsx)("p",{style:{color:w.grey[400]},children:b})}),p==null?void 0:p.map((Z,y)=>(0,B.jsx)(N.MenuItem,{value:Z,children:(0,B.jsxs)(N.Grid,{container:!0,direction:"column",children:[(0,B.jsx)(N.Grid,{item:!0,children:Z.label}),Z.afterLabel&&(0,B.jsx)(N.Grid,{item:!0,children:Z.afterLabel})]})},y)),f&&[(0,B.jsx)(N.Grid,{px:2,py:1,children:(0,B.jsx)(u1.Divider,{})},"footer-divider"),(0,B.jsx)("div",{children:f({closeSelect:()=>x(!1)})},"footer-content")]]}),e),(0,B.jsx)(U,{name:e,disableIcon:A})]})})},w0=(0,_1.memo)(A2);var E1=require("react"),G1=require("react-hook-form"),J=require("@mui/material"),d1=require("@s_mart/core");var $0=require("@s_mart/tokens");var C=require("react/jsx-runtime"),l0=require("react"),T2=T=>{var w=T,{name:e,rules:c,defaultValue:o,shouldUnregister:s,label:r,required:M,options:p,textFieldProps:b,noOptionsText:P,footer:u,multiple:S,info:f,placeholder:F,onChange:A,onInputChange:k,disableIconError:q}=w,D=$(w,["name","rules","defaultValue","shouldUnregister","label","required","options","textFieldProps","noOptionsText","footer","multiple","info","placeholder","onChange","onInputChange","disableIconError"]);let H=(0,G1.useFormContext)();if(!H)throw new Error("Para usar o <Searchable /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let x=z(H.formState.errors,e);return console.warn=()=>{},(0,C.jsx)(G1.Controller,{control:H.control,name:e,rules:c,defaultValue:o,shouldUnregister:s,render:({field:{onChange:I,value:E,ref:_}})=>{var v;return(0,C.jsxs)(J.Grid,{display:"flex",flexDirection:"column",children:[(0,C.jsxs)("div",{style:{display:"flex"},children:[r&&(0,C.jsx)(J.Grid,{item:!0,children:(0,C.jsx)(O,{label:r,required:M})}),f&&(0,C.jsx)(J.Grid,{item:!0,children:(0,C.jsx)(d1.Tooltip,{title:f,placement:"top",children:(0,C.jsx)("div",{style:{width:"fit-content"},children:(0,C.jsx)(d1.LIcon,{icon:r1,color:"#757575"})})})})]}),(0,C.jsx)(J.Autocomplete,m(a({onChange:(Z,y)=>{I(y),A==null||A(y,H.getValues())},onInputChange:(Z,y,h)=>{h==="input"&&setTimeout(()=>{k==null||k(y,H.getValues())},0)},slotProps:m(a({},D.slotProps||{}),{paper:m(a({},(D.slotProps||{}).paper||{}),{sx:a({border:`1px solid ${$0.colorPalette.neutral[30]}`,boxShadow:"0px 2px 4px rgba(0, 0, 0, 0.15)"},((v=(D.slotProps||{}).paper)==null?void 0:v.sx)||{})})}),value:E||(S?[]:null),options:p,multiple:S,noOptionsText:(0,C.jsxs)(C.Fragment,{children:[P||"Nenhum resultado encontrado",u?(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(J.Grid,{py:1,children:(0,C.jsx)(d1.Divider,{})}),u]}):null]}),isOptionEqualToValue:(Z,y)=>typeof Z=="string"&&typeof y=="string"?Z===y:typeof Z=="object"&&typeof y=="object"?typeof Z.value=="object"&&typeof y.value=="object"&&Z.key!==void 0&&y.key!==void 0?Z.key===y.key:Z.value===y.value:!1,renderOption:(Z,y)=>typeof y=="object"?(0,l0.createElement)("li",m(a({},Z),{key:y.key||y.value}),(0,C.jsxs)(J.Grid,{container:!0,direction:"column",children:[(0,C.jsx)(J.Grid,{item:!0,children:y.label}),y.afterLabel&&(0,C.jsx)(J.Grid,{item:!0,children:y.afterLabel})]})):(0,l0.createElement)("li",m(a({},Z),{key:y}),y),ListboxComponent:(0,E1.forwardRef)(function(y,h){return(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)("ul",m(a({},y),{ref:h})),!!u&&(0,C.jsx)("div",m(a({},y),{children:(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(J.Grid,{px:2,py:1,children:(0,C.jsx)(d1.Divider,{})}),u]})}),"searchable-footer")]})})},D),{renderInput:Z=>(0,C.jsx)(J.TextField,m(a(a({error:!!x,placeholder:F},Z),b),{inputRef:_}))}),e),(0,C.jsx)(U,{name:e,disableIcon:q})]})}})},A0=(0,E1.memo)(T2);var B1=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`
|
|
2
2
|
display: flex;
|
|
3
3
|
align-items: center;
|
|
4
4
|
justify-content: center;
|
|
5
|
-
`,
|
|
5
|
+
`,D2=e=>a0.css`
|
|
6
6
|
.creatable,
|
|
7
7
|
.editable {
|
|
8
|
-
${
|
|
8
|
+
${D0}
|
|
9
9
|
|
|
10
10
|
.divider {
|
|
11
11
|
width: 1px;
|
|
@@ -31,14 +31,14 @@
|
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
|
-
`,
|
|
34
|
+
`,_0=T0.default.div`
|
|
35
35
|
display: flex;
|
|
36
36
|
|
|
37
37
|
div.endAdornments {
|
|
38
38
|
position: absolute;
|
|
39
39
|
right: 0;
|
|
40
40
|
|
|
41
|
-
${
|
|
41
|
+
${D0}
|
|
42
42
|
}
|
|
43
43
|
|
|
44
44
|
.MuiAutocomplete-endAdornment {
|
|
@@ -46,23 +46,23 @@
|
|
|
46
46
|
right: 0;
|
|
47
47
|
}
|
|
48
48
|
|
|
49
|
-
${({hideAddButton:e,theme:c})=>!e&&
|
|
50
|
-
`;var
|
|
49
|
+
${({hideAddButton:e,theme:c})=>!e&&D2(c)}
|
|
50
|
+
`;var L=require("react/jsx-runtime"),r0=require("react"),_2=x=>{var I=x,{name:e,rules:c,defaultValue:o,shouldUnregister:s,label:r,required:M,options:p,editable:b,footer:P,onEditOption:u,onCreateOption:S,textFieldProps:f,hideAddButton:F,multiple:A,info:k,onChange:q,onInputChange:D,placeholder:T,disableIconError:w}=I,H=$(I,["name","rules","defaultValue","shouldUnregister","label","required","options","editable","footer","onEditOption","onCreateOption","textFieldProps","hideAddButton","multiple","info","onChange","onInputChange","placeholder","disableIconError"]);let E=(0,R1.useFormContext)();if(!E)throw new Error("Para usar o <Creatable /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let _=z(E.formState.errors,e),v=i=>{let l=0;return f!=null&&f.InputProps||(l+=2.5),F||(l+=2.56,Z(i)&&(l+=2.56)),H.disableClearable||(l+=1.3),l+"rem"},Z=i=>b&&(0,O1.isObject)(i)&&!(0,O1.isEmpty)(i);console.warn=()=>{};let y=i=>{S?S(i):console.error("onCreateOption n\xE3o foi definido")},h=i=>{u?u(i):console.error("onEditOption n\xE3o foi definido")};return(0,L.jsx)(R1.Controller,{control:E.control,name:e,rules:c,defaultValue:o,shouldUnregister:s,render:({field:{value:i,onChange:l,ref:V}})=>{var g;let t=(i==null?void 0:i.label)||(i==null?void 0:i.value)||i;return(0,L.jsxs)(K.Grid,{display:"flex",flexDirection:"column",children:[(0,L.jsxs)("div",{style:{display:"flex"},children:[r&&(0,L.jsx)(K.Grid,{item:!0,children:(0,L.jsx)(O,{label:r,required:M})}),k&&(0,L.jsx)(K.Grid,{item:!0,children:(0,L.jsx)(Q.Tooltip,{title:k,placement:"top",children:(0,L.jsx)("div",{style:{width:"fit-content"},children:(0,L.jsx)(Q.LIcon,{icon:r1,color:"#757575"})})})})]}),(0,L.jsx)(_0,{hideAddButton:F,children:(0,L.jsx)(K.Autocomplete,m(a({fullWidth:!0,onChange:(n,d)=>{l(d),q==null||q(d,E.getValues())},onInputChange:(n,d,G)=>{G==="input"&&setTimeout(()=>{D==null||D(d,E.getValues())},0)},slotProps:m(a({},H.slotProps||{}),{paper:m(a({},(H.slotProps||{}).paper||{}),{sx:a({border:`1px solid ${I0.colorPalette.neutral[30]}`,boxShadow:"0px 2px 4px rgba(0, 0, 0, 0.15)"},((g=(H.slotProps||{}).paper)==null?void 0:g.sx)||{})})}),options:p,value:i||(A?[]:null),multiple:A,noOptionsText:F?void 0:(0,L.jsxs)(Q.Button,{sx:{justifyContent:"flex-start",padding:`${(0,o0.toRem)(6)} ${(0,o0.toRem)(-16)}`,margin:0},fullWidth:!0,onClick:()=>y(i),variant:"text",startIcon:(0,L.jsx)(Q.LIcon,{icon:c0}),children:["Adicionar ",t&&`"${t}"`]}),isOptionEqualToValue:(n,d)=>d?typeof n=="string"&&typeof d=="string"?n===d:typeof n=="object"&&typeof d=="object"?typeof n.value=="object"&&typeof d.value=="object"&&n.key!==void 0&&d.key!==void 0?n.key===d.key:n.value===d.value:typeof n=="object"&&typeof d=="string":!1,renderOption:(n,d)=>typeof d=="object"?(0,r0.createElement)("li",m(a({},n),{key:d.key||d.value}),(0,L.jsxs)(K.Grid,{container:!0,direction:"column",children:[(0,L.jsx)(K.Grid,{item:!0,children:d.label}),d.afterLabel&&(0,L.jsx)(K.Grid,{item:!0,children:d.afterLabel})]})):(0,r0.createElement)("li",m(a({},n),{key:d}),d),ListboxComponent:(0,B1.forwardRef)(function(d,G){return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)("ul",m(a({},d),{ref:G})),!!P&&(0,L.jsx)("div",m(a({},d),{children:(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(K.Grid,{px:2,py:1,children:(0,L.jsx)(Q.Divider,{})}),P]})}),"creatable-footer")]})})},H),{sx:a({"& div.MuiInputBase-root":{paddingRight:`${v(i)} !important`}},H.sx),renderInput:n=>(0,L.jsx)(K.TextField,a(m(a({placeholder:T},n),{error:!!_,InputProps:m(a({},n.InputProps),{inputRef:V,endAdornment:(0,L.jsxs)("div",{className:"endAdornments",children:[n.InputProps.endAdornment,!F&&(0,L.jsxs)(L.Fragment,{children:[Z(i)?(0,L.jsxs)("div",{className:"editable",children:[(0,L.jsx)("div",{className:"divider"}),(0,L.jsx)("div",{className:"button",onClick:()=>h(i),children:(0,L.jsx)(Q.LIcon,{icon:L0,size:"24px",removeMargin:!0})})]}):null,(0,L.jsxs)("div",{className:"creatable",children:[(0,L.jsx)("div",{className:"divider"}),(0,L.jsx)("div",{className:"button",onClick:()=>y(i),children:(0,L.jsx)(Q.LIcon,{icon:c0,size:"24px",removeMargin:!0})})]})]})]})})}),f))}),e)}),(0,L.jsx)(U,{name:e,disableIcon:w})]})}})},E0=(0,B1.memo)(_2);var U1=require("react-hook-form"),f1=require("@mui/material");var n1=require("react/jsx-runtime"),I2=u=>{var S=u,{name:e,rules:c,defaultValue:o,shouldUnregister:s,label:r,labelPlacement:M,required:p,disableIconError:b}=S,P=$(S,["name","rules","defaultValue","shouldUnregister","label","labelPlacement","required","disableIconError"]);let f=(0,U1.useFormContext)();if(!f)throw new Error("Para usar o <Checkbox /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");return(0,n1.jsx)(U1.Controller,{control:f.control,name:e,rules:c,defaultValue:o,shouldUnregister:s,render:({field:{value:F,onChange:A}})=>(0,n1.jsxs)(f1.Grid,{display:"flex",flexDirection:"column",children:[(0,n1.jsx)(f1.FormControlLabel,{control:(0,n1.jsx)(f1.Checkbox,a({checked:!!F,value:F!=null?F:"",defaultValue:F,onChange:A},P),e),label:(0,n1.jsx)(O,{label:r,required:p,regular:!0}),labelPlacement:M||"end"}),(0,n1.jsx)(U,{name:e,disableIcon:b})]})})},G0=I2;var q1=require("react-hook-form"),M1=require("@mui/material");var s1=require("react/jsx-runtime"),E2=P=>{var u=P,{name:e,rules:c,defaultValue:o,shouldUnregister:s,label:r,labelPlacement:M,disableIconError:p}=u,b=$(u,["name","rules","defaultValue","shouldUnregister","label","labelPlacement","disableIconError"]);let S=(0,q1.useFormContext)();if(!S)throw new Error("Para usar o <Switch /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");return(0,s1.jsx)(q1.Controller,{control:S.control,name:e,rules:c,defaultValue:o,shouldUnregister:s,render:({field:{value:f,onChange:F}})=>(0,s1.jsxs)(M1.Grid,{display:"flex",flexDirection:"column",children:[(0,s1.jsx)(M1.FormControlLabel,{control:(0,s1.jsx)(M1.Switch,a({value:f!=null?f:"",checked:f!=null?f:!1,defaultValue:f,onChange:F},b),e),label:(0,s1.jsx)(O,{label:r}),labelPlacement:M||"end"}),(0,s1.jsx)(U,{name:e,disableIcon:p})]})})},B0=E2;var H1=require("@mui/material");var F1=require("react/jsx-runtime"),G2=s=>{var r=s,{label:e,labelPlacement:c}=r,o=$(r,["label","labelPlacement"]);return(0,F1.jsx)(H1.Grid,{display:"flex",flexDirection:"column",children:(0,F1.jsx)(H1.FormControlLabel,{control:(0,F1.jsx)(H1.Radio,a({},o)),label:(0,F1.jsx)(O,{label:e}),labelPlacement:c||"end"})})},R0=G2;var Y1=require("react-hook-form"),z1=require("@mui/material");var m1=require("react/jsx-runtime"),B2=S=>{var f=S,{name:e,rules:c,defaultValue:o,shouldUnregister:s,label:r,required:M,children:p,orientation:b="row",disableIconError:P}=f,u=$(f,["name","rules","defaultValue","shouldUnregister","label","required","children","orientation","disableIconError"]);let F=(0,Y1.useFormContext)();if(!F)throw new Error("Para usar o <RadioGroup /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");return(0,m1.jsx)(Y1.Controller,{control:F.control,name:e,rules:c,defaultValue:o,shouldUnregister:s,render:({field:{value:A,onChange:k}})=>(0,m1.jsxs)(z1.Grid,{display:"flex",flexDirection:"column",children:[r&&(0,m1.jsx)(O,{label:r,required:M}),(0,m1.jsx)(z1.RadioGroup,m(a({value:A||"",onChange:k,name:e},u),{style:{display:"flex",flexDirection:b},children:p}),e),(0,m1.jsx)(U,{name:e,disableIcon:P})]})})},O0=B2;var j1=require("react-hook-form"),U0=require("@mui/material");var t0=require("react/jsx-runtime"),R2=M=>{var p=M,{name:e,rules:c,defaultValue:o,shouldUnregister:s}=p,r=$(p,["name","rules","defaultValue","shouldUnregister"]);let b=(0,j1.useFormContext)();if(!b)throw new Error("Para usar o <Slider /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");return(0,t0.jsx)(j1.Controller,{control:b.control,name:e,rules:c,defaultValue:o,shouldUnregister:s,render:({field:{value:P,onChange:u}})=>(0,t0.jsx)(U0.Slider,a({value:P||(r==null?void 0:r.min)||0,onChange:u,valueLabelDisplay:"auto"},r),e)})},q0=R2;var W0=require("react"),N1=require("react-hook-form"),J0=require("@s_mart/core"),P1=require("@s_mart/rules"),K0=require("@mui/material"),Q0=require("@mui/x-date-pickers/DatePicker"),X0=require("@mui/x-date-pickers/AdapterDayjs"),e2=require("@mui/x-date-pickers/LocalizationProvider"),c2=require("@mui/x-date-pickers/locales/ptBR"),i2=p1(m0());var z0=p1(require("@emotion/styled")),j0=require("@mui/material"),X=require("@s_mart/utils"),O2=e=>{switch(e){case"small":return(0,X.toRem)(16);default:case"medium":return(0,X.toRem)(20);case"large":return(0,X.toRem)(24)}},U2=e=>{switch(e){case"small":return`${(0,X.toRem)(2)} ${(0,X.toRem)(8)}`;default:case"medium":return`${(0,X.toRem)(6)} ${(0,X.toRem)(8)}`;case"large":return`${(0,X.toRem)(10)}`}},N0=(0,z0.default)(j0.IconButton)`
|
|
51
51
|
margin: 0px;
|
|
52
52
|
|
|
53
|
-
padding: ${({size:e})=>
|
|
53
|
+
padding: ${({size:e})=>U2(e)};
|
|
54
54
|
border-radius: 0 ${(0,X.toRem)(4)} ${(0,X.toRem)(4)} 0;
|
|
55
55
|
|
|
56
56
|
svg {
|
|
57
|
-
width: ${({size:e})=>
|
|
57
|
+
width: ${({size:e})=>O2(e)} !important;
|
|
58
58
|
}
|
|
59
|
-
`;var h1=require("react/jsx-runtime"),
|
|
59
|
+
`;var h1=require("react/jsx-runtime"),a2=require("react"),q2=f=>{var F=f,{rules:e,name:c,defaultValue:o,shouldUnregister:s,datePickerProps:r,label:M,required:p,placeholder:b,disabled:P,disableIconError:u}=F,S=$(F,["rules","name","defaultValue","shouldUnregister","datePickerProps","label","required","placeholder","disabled","disableIconError"]);let A=(0,N1.useFormContext)();if(!A)throw new Error("Para usar o <DataPicker /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let k=z(A.formState.errors,c),q=(r==null?void 0:r.format)||"DD/MM/YYYY",D=e?(0,P1.composeValidators)([(0,P1.date)(q),e]):(0,P1.date)(q);return(0,h1.jsx)(e2.LocalizationProvider,{dateAdapter:X0.AdapterDayjs,adapterLocale:i2.default,localeText:c2.ptBR.components.MuiLocalizationProvider.defaultProps.localeText,children:(0,h1.jsx)(N1.Controller,{control:A.control,name:c,rules:D,defaultValue:o,shouldUnregister:s,render:({field:{value:T,onChange:w,ref:H}})=>(0,h1.jsxs)(J0.Grid,{display:"flex",flexDirection:"column",children:[M&&(0,h1.jsx)(O,{label:M,required:p}),(0,a2.createElement)(Q0.DatePicker,m(a({},r),{key:c,value:T!=null?T:null,format:q,onChange:w,disabled:P,slots:{textField:K0.TextField,openPickerButton:x=>(0,h1.jsx)(N0,m(a({},x),{size:S.size}))},slotProps:{textField:x=>{var I;return m(a(m(a({variant:"outlined"},x),{error:!!k}),S),{inputProps:m(a({},x.inputProps),{placeholder:b||((I=x.inputProps)==null?void 0:I.placeholder)}),InputProps:m(a({},x.InputProps),{inputRef(E){H(E),typeof x.inputRef=="function"&&x.inputRef(E)}})})}}})),(0,h1.jsx)(U,{name:c,disableIcon:u})]})})})},l2=(0,W0.memo)(q2);var n2=require("react"),W1=require("react-hook-form"),s2=require("@s_mart/core"),C1=require("@s_mart/rules"),h2=require("@mui/material"),d2=require("@mui/x-date-pickers/TimePicker"),m2=require("@mui/x-date-pickers/AdapterDayjs"),v2=require("@mui/x-date-pickers/LocalizationProvider"),p2=require("@mui/x-date-pickers/locales/ptBR"),Z2=p1(m0());var o2=p1(require("@emotion/styled")),r2=require("@mui/material"),e1=require("@s_mart/utils"),Y2=e=>{switch(e){case"small":return(0,e1.toRem)(16);default:case"medium":return(0,e1.toRem)(20);case"large":return(0,e1.toRem)(24)}},z2=e=>{switch(e){case"small":return`${(0,e1.toRem)(2)} ${(0,e1.toRem)(8)}`;default:case"medium":return`${(0,e1.toRem)(6)} ${(0,e1.toRem)(8)}`;case"large":return`${(0,e1.toRem)(10)}`}},t2=(0,o2.default)(r2.IconButton)`
|
|
60
60
|
margin: 0px;
|
|
61
61
|
|
|
62
|
-
padding: ${({size:e})=>
|
|
62
|
+
padding: ${({size:e})=>z2(e)};
|
|
63
63
|
border-radius: 0 ${(0,e1.toRem)(4)} ${(0,e1.toRem)(4)} 0;
|
|
64
64
|
|
|
65
65
|
svg {
|
|
66
|
-
width: ${({size:e})=>
|
|
66
|
+
width: ${({size:e})=>Y2(e)} !important;
|
|
67
67
|
}
|
|
68
|
-
`;var l1=require("react/jsx-runtime"),
|
|
68
|
+
`;var l1=require("react/jsx-runtime"),j2=f=>{var F=f,{rules:e,defaultValue:c,shouldUnregister:o,name:s,required:r,label:M,timePickerProps:p,placeholder:b,disabled:P,disableIconError:u}=F,S=$(F,["rules","defaultValue","shouldUnregister","name","required","label","timePickerProps","placeholder","disabled","disableIconError"]);let A=(0,W1.useFormContext)();if(!A)throw new Error("Para usar o <TimePicker /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let k=z(A.formState.errors,s),q=(p==null?void 0:p.format)||"HH:mm",D=e?(0,C1.composeValidators)([(0,C1.time)(q),e]):(0,C1.time)(q);return(0,l1.jsx)(v2.LocalizationProvider,{dateAdapter:m2.AdapterDayjs,adapterLocale:Z2.default,localeText:p2.ptBR.components.MuiLocalizationProvider.defaultProps.localeText,children:(0,l1.jsx)(W1.Controller,{control:A.control,name:s,rules:D,defaultValue:c,shouldUnregister:o,render:({field:{value:T,onChange:w,ref:H}})=>(0,l1.jsxs)(s2.Grid,{display:"flex",flexDirection:"column",children:[M&&(0,l1.jsx)(O,{label:M,required:r}),(0,l1.jsx)(d2.TimePicker,m(a({ampm:!1,format:q,value:T!=null?T:null,onChange:w,disabled:P},p),{slots:{textField:h2.TextField,openPickerButton:x=>(0,l1.jsx)(t2,m(a({},x),{size:S.size}))},slotProps:{textField:x=>{var I;return m(a(m(a({variant:"outlined"},x),{error:!!k}),S),{inputProps:m(a({},x.inputProps),{placeholder:b||((I=x.inputProps)==null?void 0:I.placeholder)}),InputProps:m(a({},x.InputProps),{inputRef(E){H(E),typeof x.inputRef=="function"&&x.inputRef(E)}})})}}}),s),(0,l1.jsx)(U,{name:s,disableIcon:u})]})})})},u2=(0,n2.memo)(j2);var f2=require("react"),J1=require("react-hook-form"),K1=require("@mui/material"),k1=require("@s_mart/core"),M2=require("@s_mart/tokens");var c1=require("react/jsx-runtime"),V2=require("react"),N2=F=>{var A=F,{name:e,defaultValue:c,rules:o,shouldUnregister:s,label:r,required:M,noOptionsText:p,placeholder:b,onInputChange:P,onChange:u,disableIconError:S}=A,f=$(A,["name","defaultValue","rules","shouldUnregister","label","required","noOptionsText","placeholder","onInputChange","onChange","disableIconError"]);let k=(0,J1.useFormContext)();if(!k)throw new Error("Para usar o <Autocomplete /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let q=z(k.formState.errors,e);return console.warn=()=>{},(0,c1.jsx)(J1.Controller,{name:e,control:k.control,defaultValue:c,rules:o,shouldUnregister:s,render:({field:D})=>{var T;return(0,c1.jsxs)(k1.Grid,{display:"flex",flexDirection:"column",children:[r&&(0,c1.jsx)(O,{label:r,required:M}),(0,c1.jsx)(K1.Autocomplete,m(a({onChange:(w,H)=>{D.onChange(H),u==null||u(H,k.getValues())},onInputChange:(w,H,x)=>{x==="input"&&(D.onChange(H),setTimeout(()=>{P==null||P(H,k.getValues())},0))},slotProps:m(a({},f.slotProps||{}),{paper:m(a({},(f.slotProps||{}).paper||{}),{sx:a({border:`1px solid ${M2.colorPalette.neutral[30]}`,boxShadow:"0px 2px 4px rgba(0, 0, 0, 0.15)"},((T=(f.slotProps||{}).paper)==null?void 0:T.sx)||{})})}),isOptionEqualToValue:(w,H)=>w.value===H.value,renderOption:(w,H)=>(0,V2.createElement)("li",m(a({},w),{key:H.key||H.value,onClick:x=>{var I;(I=w.onClick)==null||I.call(w,x),D.onChange(H)}}),(0,c1.jsxs)(k1.Grid,{container:!0,direction:"column",children:[(0,c1.jsx)(k1.Grid,{item:!0,children:H.label}),H.afterLabel&&(0,c1.jsx)(k1.Grid,{item:!0,children:H.afterLabel})]})),value:D.value||null,noOptionsText:p||"Nenhuma op\xE7\xE3o encontrada"},f),{renderInput:w=>{var H,x,I;return(0,c1.jsx)(K1.TextField,m(a(a({placeholder:b},w),f.textFieldProps),{error:!!q,InputProps:m(a(a({},w.InputProps),(H=f.textFieldProps)==null?void 0:H.InputProps),{inputRef:D.ref,inputProps:a(a({},w.inputProps),(I=(x=f.textFieldProps)==null?void 0:x.InputProps)==null?void 0:I.inputProps)})}))}}),e),(0,c1.jsx)(U,{name:e,disableIcon:S})]})}})},H2=(0,f2.memo)(N2);0&&(module.exports={Autocomplete,Checkbox,Creatable,DatePicker,Form,FormProvider,RadioButton,RadioGroup,Searchable,Select,Slider,Switch,TextField,TimePicker,useForm});
|
package/dist/index.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
var m2=Object.create;var L1=Object.defineProperty,v2=Object.defineProperties,p2=Object.getOwnPropertyDescriptor,Z2=Object.getOwnPropertyDescriptors,u2=Object.getOwnPropertyNames,u1=Object.getOwnPropertySymbols,f2=Object.getPrototypeOf,b1=Object.prototype.hasOwnProperty,G1=Object.prototype.propertyIsEnumerable;var E1=(e,c,o)=>c in e?L1(e,c,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[c]=o,a=(e,c)=>{for(var o in c||(c={}))b1.call(c,o)&&E1(e,o,c[o]);if(u1)for(var o of u1(c))G1.call(c,o)&&E1(e,o,c[o]);return e},v=(e,c)=>v2(e,Z2(c));var S=(e,c)=>{var o={};for(var m in e)b1.call(e,m)&&c.indexOf(m)<0&&(o[m]=e[m]);if(e!=null&&u1)for(var m of u1(e))c.indexOf(m)<0&&G1.call(e,m)&&(o[m]=e[m]);return o};var I1=(e,c)=>()=>(c||e((c={exports:{}}).exports,c),c.exports);var M2=(e,c,o,m)=>{if(c&&typeof c=="object"||typeof c=="function")for(let h of u2(c))!b1.call(e,h)&&h!==o&&L1(e,h,{get:()=>c[h],enumerable:!(m=p2(c,h))||m.enumerable});return e};var B1=(e,c,o)=>(o=e!=null?m2(f2(e)):{},M2(c||!e||!e.__esModule?L1(o,"default",{value:e,enumerable:!0}):o,e));var a2=I1(($1,A1)=>{(function(e,c){typeof $1=="object"&&typeof A1!="undefined"?A1.exports=c():typeof define=="function"&&define.amd?define(c):(e=typeof globalThis!="undefined"?globalThis:e||self).dayjs=c()})($1,function(){"use strict";var e=1e3,c=6e4,o=36e5,m="millisecond",h="second",M="minute",Z="hour",C="day",L="week",p="month",g="quarter",V="year",b="date",F="Invalid Date",G=/^(\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,$={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 i=["th","st","nd","rd"],l=t%100;return"["+t+(i[(l-20)%10]||i[l]||i[0])+"]"}},P=function(t,i,l){var f=String(t);return!f||f.length>=i?t:""+Array(i+1-f.length).join(l)+t},y={s:P,z:function(t){var i=-t.utcOffset(),l=Math.abs(i),f=Math.floor(l/60),n=l%60;return(i<=0?"+":"-")+P(f,2,"0")+":"+P(n,2,"0")},m:function t(i,l){if(i.date()<l.date())return-t(l,i);var f=12*(l.year()-i.year())+(l.month()-i.month()),n=i.clone().add(f,p),d=l-n<0,s=i.clone().add(f+(d?-1:1),p);return+(-(f+(l-n)/(d?n-s:s-n))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(t){return{M:p,y:V,w:L,d:C,D:b,h:Z,m:M,s:h,ms:m,Q:g}[t]||String(t||"").toLowerCase().replace(/s$/,"")},u:function(t){return t===void 0}},x="en",w={};w[x]=$;var D=function(t){return t instanceof u},j=function t(i,l,f){var n;if(!i)return x;if(typeof i=="string"){var d=i.toLowerCase();w[d]&&(n=d),l&&(w[d]=l,n=d);var s=i.split("-");if(!n&&s.length>1)return t(s[0])}else{var k=i.name;w[k]=i,n=k}return!f&&n&&(x=n),n||!f&&x},H=function(t,i){if(D(t))return t.clone();var l=typeof i=="object"?i:{};return l.date=t,l.args=arguments,new u(l)},r=y;r.l=j,r.i=D,r.w=function(t,i){return H(t,{locale:i.$L,utc:i.$u,x:i.$x,$offset:i.$offset})};var u=function(){function t(l){this.$L=j(l.locale,null,!0),this.parse(l)}var i=t.prototype;return i.parse=function(l){this.$d=function(f){var n=f.date,d=f.utc;if(n===null)return new Date(NaN);if(r.u(n))return new Date;if(n instanceof Date)return new Date(n);if(typeof n=="string"&&!/Z$/i.test(n)){var s=n.match(G);if(s){var k=s[2]-1||0,I=(s[7]||"0").substring(0,3);return d?new Date(Date.UTC(s[1],k,s[3]||1,s[4]||0,s[5]||0,s[6]||0,I)):new Date(s[1],k,s[3]||1,s[4]||0,s[5]||0,s[6]||0,I)}}return new Date(n)}(l),this.$x=l.x||{},this.init()},i.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()},i.$utils=function(){return r},i.isValid=function(){return this.$d.toString()!==F},i.isSame=function(l,f){var n=H(l);return this.startOf(f)<=n&&n<=this.endOf(f)},i.isAfter=function(l,f){return H(l)<this.startOf(f)},i.isBefore=function(l,f){return this.endOf(f)<H(l)},i.$g=function(l,f,n){return r.u(l)?this[f]:this.set(n,l)},i.unix=function(){return Math.floor(this.valueOf()/1e3)},i.valueOf=function(){return this.$d.getTime()},i.startOf=function(l,f){var n=this,d=!!r.u(f)||f,s=r.p(l),k=function(t1,z){var e1=r.w(n.$u?Date.UTC(n.$y,z,t1):new Date(n.$y,z,t1),n);return d?e1:e1.endOf(C)},I=function(t1,z){return r.w(n.toDate()[t1].apply(n.toDate("s"),(d?[0,0,0,0]:[23,59,59,999]).slice(z)),n)},_=this.$W,U=this.$M,X=this.$D,Q="set"+(this.$u?"UTC":"");switch(s){case V:return d?k(1,0):k(31,11);case p:return d?k(1,U):k(0,U+1);case L:var h1=this.$locale().weekStart||0,d1=(_<h1?_+7:_)-h1;return k(d?X-d1:X+(6-d1),U);case C:case b:return I(Q+"Hours",0);case Z:return I(Q+"Minutes",1);case M:return I(Q+"Seconds",2);case h:return I(Q+"Milliseconds",3);default:return this.clone()}},i.endOf=function(l){return this.startOf(l,!1)},i.$set=function(l,f){var n,d=r.p(l),s="set"+(this.$u?"UTC":""),k=(n={},n[C]=s+"Date",n[b]=s+"Date",n[p]=s+"Month",n[V]=s+"FullYear",n[Z]=s+"Hours",n[M]=s+"Minutes",n[h]=s+"Seconds",n[m]=s+"Milliseconds",n)[d],I=d===C?this.$D+(f-this.$W):f;if(d===p||d===V){var _=this.clone().set(b,1);_.$d[k](I),_.init(),this.$d=_.set(b,Math.min(this.$D,_.daysInMonth())).$d}else k&&this.$d[k](I);return this.init(),this},i.set=function(l,f){return this.clone().$set(l,f)},i.get=function(l){return this[r.p(l)]()},i.add=function(l,f){var n,d=this;l=Number(l);var s=r.p(f),k=function(U){var X=H(d);return r.w(X.date(X.date()+Math.round(U*l)),d)};if(s===p)return this.set(p,this.$M+l);if(s===V)return this.set(V,this.$y+l);if(s===C)return k(1);if(s===L)return k(7);var I=(n={},n[M]=c,n[Z]=o,n[h]=e,n)[s]||1,_=this.$d.getTime()+l*I;return r.w(_,this)},i.subtract=function(l,f){return this.add(-1*l,f)},i.format=function(l){var f=this,n=this.$locale();if(!this.isValid())return n.invalidDate||F;var d=l||"YYYY-MM-DDTHH:mm:ssZ",s=r.z(this),k=this.$H,I=this.$m,_=this.$M,U=n.weekdays,X=n.months,Q=function(z,e1,x1,Z1){return z&&(z[e1]||z(f,d))||x1[e1].slice(0,Z1)},h1=function(z){return r.s(k%12||12,z,"0")},d1=n.meridiem||function(z,e1,x1){var Z1=z<12?"AM":"PM";return x1?Z1.toLowerCase():Z1},t1={YY:String(this.$y).slice(-2),YYYY:this.$y,M:_+1,MM:r.s(_+1,2,"0"),MMM:Q(n.monthsShort,_,X,3),MMMM:Q(X,_),D:this.$D,DD:r.s(this.$D,2,"0"),d:String(this.$W),dd:Q(n.weekdaysMin,this.$W,U,2),ddd:Q(n.weekdaysShort,this.$W,U,3),dddd:U[this.$W],H:String(k),HH:r.s(k,2,"0"),h:h1(1),hh:h1(2),a:d1(k,I,!0),A:d1(k,I,!1),m:String(I),mm:r.s(I,2,"0"),s:String(this.$s),ss:r.s(this.$s,2,"0"),SSS:r.s(this.$ms,3,"0"),Z:s};return d.replace(A,function(z,e1){return e1||t1[z]||s.replace(":","")})},i.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},i.diff=function(l,f,n){var d,s=r.p(f),k=H(l),I=(k.utcOffset()-this.utcOffset())*c,_=this-k,U=r.m(this,k);return U=(d={},d[V]=U/12,d[p]=U,d[g]=U/3,d[L]=(_-I)/6048e5,d[C]=(_-I)/864e5,d[Z]=_/o,d[M]=_/c,d[h]=_/e,d)[s]||_,n?U:r.a(U)},i.daysInMonth=function(){return this.endOf(p).$D},i.$locale=function(){return w[this.$L]},i.locale=function(l,f){if(!l)return this.$L;var n=this.clone(),d=j(l,f,!0);return d&&(n.$L=d),n},i.clone=function(){return r.w(this.$d,this)},i.toDate=function(){return new Date(this.valueOf())},i.toJSON=function(){return this.isValid()?this.toISOString():null},i.toISOString=function(){return this.$d.toISOString()},i.toString=function(){return this.$d.toUTCString()},t}(),Y=u.prototype;return H.prototype=Y,[["$ms",m],["$s",h],["$m",M],["$H",Z],["$W",C],["$M",p],["$y",V],["$D",b]].forEach(function(t){Y[t[1]]=function(i){return this.$g(i,t[0],t[1])}}),H.extend=function(t,i){return t.$i||(t(i,u,H),t.$i=!0),H},H.locale=j,H.isDayjs=D,H.unix=function(t){return H(1e3*t)},H.en=w[x],H.Ls=w,H.p={},H})});var _1=I1((T1,D1)=>{(function(e,c){typeof T1=="object"&&typeof D1!="undefined"?D1.exports=c(a2()):typeof define=="function"&&define.amd?define(["dayjs"],c):(e=typeof globalThis!="undefined"?globalThis:e||self).dayjs_locale_pt_br=c(e.dayjs)})(T1,function(e){"use strict";function c(h){return h&&typeof h=="object"&&"default"in h?h:{default:h}}var o=c(e),m={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(h){return h+"\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(m,null,!0),m})});import{FormProvider as H2}from"react-hook-form";import{jsx as R1}from"react/jsx-runtime";var V2=h=>{var M=h,{children:e,style:c,onSubmit:o}=M,m=S(M,["children","style","onSubmit"]);return R1(H2,v(a({},m),{children:R1("form",{onSubmit:Z=>{Z.preventDefault(),Z.stopPropagation(),o(Z)},style:c,children:e})}))},F1=V2;import{useEffect as y2}from"react";import{useForm as C2}from"react-hook-form";import{zodResolver as g2}from"@hookform/resolvers/zod";var x2=m=>{var h=m,{disableDefaultValuesUpdate:e,onSubmit:c}=h,o=S(h,["disableDefaultValuesUpdate","onSubmit"]);let M=C2(v(a({},o),{resolver:o.schema&&g2(o.schema)}));return y2(()=>{e||M.reset(o.defaultValues)},[o.defaultValues,M.reset]),v(a({},M),{onSubmit:M.handleSubmit(Z=>c(Z,M))})},P1=x2;import{jsx as F2}from"react/jsx-runtime";function L2(m){var h=m,{children:e,style:c}=h,o=S(h,["children","style"]);let M=P1(o);return F2(F1,v(a({},M),{style:c,children:typeof e=="function"?e(M):e}))}var b2=L2;import{memo as A2,useState as T2}from"react";import{Controller as D2,useFormContext as _2}from"react-hook-form";import{Grid as S1,InputAdornment as E2,TextField as G2}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 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 n1 from"@s_mart/masks";import{Typography as Y1}from"@mui/material";import{toRem as P2}from"@s_mart/utils";import{jsx as z1,jsxs as k2}from"react/jsx-runtime";var E=({label:e,required:c,regular:o})=>k2("span",{style:{display:"flex",alignItems:"center",gap:P2(2)},children:[z1(Y1,{variant:"caption",fontWeight:o?400:700,style:{display:"flex",alignItems:"center"},children:e}),c&&z1(Y1,{variant:"caption",fontWeight:900,color:"error",children:"*"})]});import{useFormContext as S2}from"react-hook-form";import{Indicator as w2}from"@s_mart/core";var q=(e,c)=>{var o,m,h,M,Z;if(e[c])return e[c];if(c.includes("[")){let[C,L]=c.split("["),[p,g]=L.split("].");return(m=(o=e[C])==null?void 0:o[p])==null?void 0:m[g]}if(c.includes(".")){let[C,L,p]=c.split(".");return p?(Z=(M=e[C])==null?void 0:M[L])==null?void 0:Z[p]:(h=e[C])==null?void 0:h[L]}};import{jsx as $2}from"react/jsx-runtime";var B=({name:e})=>{var m;let c=S2(),o=q((m=c==null?void 0:c.formState)==null?void 0:m.errors,e);return o?$2(w2,{severity:"error",children:o==null?void 0:o.message}):null};import{LIcon as j1,Tooltip as I2}from"@s_mart/core";import{jsx as N,jsxs as N1}from"react/jsx-runtime";var B2=G=>{var A=G,{name:e,rules:c,defaultValue:o,shouldUnregister:m,label:h,required:M,mask:Z,variant:C="outlined",info:L,parse:p,inputMode:g,format:V,onInputChange:b}=A,F=S(A,["name","rules","defaultValue","shouldUnregister","label","required","mask","variant","info","parse","inputMode","format","onInputChange"]);let $=_2();if(!$)throw new Error("Para usar o <TextField /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let[P,y]=T2(!1),x=H=>{var u;let r=H;return V&&(r=V(H)),Z?(u=n1==null?void 0:n1[Z])==null?void 0:u.format(r):r},w=H=>{var u;let r=H;return p&&(r=p(H)),Z?(u=n1==null?void 0:n1[Z])==null?void 0:u.parse(r):r},D=H=>{if(!H||Z!=="porcentagem")return;H==null||H.stopPropagation();let r=(H==null?void 0:H.target).value;if(r){let u=String(r);if(u.length>0){let Y=u.indexOf("%");Y>-1&&(H.currentTarget.selectionEnd=Y)}}},j=q($.formState.errors,e);return N(D2,{control:$.control,name:e,rules:c,defaultValue:o,shouldUnregister:m,render:({field:{value:H,onChange:r,ref:u}})=>N1(S1,{display:"flex",flexDirection:"column",children:[N1("div",{style:{display:"flex"},children:[h&&N(S1,{item:!0,children:N(E,{label:h,required:M})}),L&&N(S1,{item:!0,children:N(I2,{title:L,placement:"top",children:N("div",{style:{width:"fit-content"},children:N(j1,{icon:c1,color:"#757575"})})})})]}),N(G2,v(a({variant:C,defaultValue:o,value:x(H||""),onChange:Y=>{var i;let t=w((i=Y==null?void 0:Y.target)==null?void 0:i.value);r(t),b==null||b(t,$.getValues())},error:!!j},F),{type:F.type==="password"?P?"text":"password":F.type,autoComplete:F.autoComplete||"off",inputProps:a({inputMode:g},F.inputProps),InputProps:a({onKeyDown:D,inputRef:u,endAdornment:F.type==="password"&&N(E2,{position:"start",onClick:()=>y(!P),style:{cursor:"pointer"},children:N(j1,{icon:P?O1:U1,size:"24px",removeMargin:!0})})},F.InputProps)}),e),N(B,{name:e})]})})},R2=A2(B2);import{memo as O2,useState as U2}from"react";import{Controller as q2,useFormContext as Y2}from"react-hook-form";import{Divider as z2,LIcon as j2,Tooltip as N2}from"@s_mart/core";import{Grid as l1,Select as W2,MenuItem as W1,useTheme as J2}from"@mui/material";import{jsx as O,jsxs as f1}from"react/jsx-runtime";var K2=G=>{var A=G,{name:e,rules:c,defaultValue:o,shouldUnregister:m,label:h,required:M,options:Z,placeholder:C,disableOnChangeForm:L=!1,multiple:p,info:g,footer:V,onChange:b}=A,F=S(A,["name","rules","defaultValue","shouldUnregister","label","required","options","placeholder","disableOnChangeForm","multiple","info","footer","onChange"]);let $=Y2(),{palette:P}=J2(),[y,x]=U2(!1);if(!$)throw new Error("Para usar o <Select /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let w=q($.formState.errors,e);return console.warn=()=>{},O(q2,{control:$.control,name:e,rules:c,defaultValue:o,shouldUnregister:m,render:({field:{value:D,onChange:j,ref:H}})=>f1(l1,{display:"flex",flexDirection:"column",children:[f1("div",{style:{display:"flex"},children:[h&&O(l1,{item:!0,children:O(E,{label:h,required:M})}),g&&O(l1,{item:!0,children:O(N2,{title:g,placement:"top",children:O("div",{style:{width:"fit-content"},children:O(j2,{icon:c1,color:"#757575"})})})})]}),f1(W2,v(a({open:y,onOpen:()=>x(!0),onClose:()=>x(!1),displayEmpty:!!C,variant:"outlined",autoComplete:"off",value:D?D||"":p?[]:"",renderValue:r=>{if(r.label)return r.label;if(C)return O("p",{style:{color:P.grey[400]},children:C})},multiple:p,onChange:r=>{!L&&j(r.target.value),b&&b(r.target.value,$.getValues())},error:!!w,size:F.size||"medium",inputRef:H},F),{children:[C&&O(W1,{disabled:!0,value:"",children:O("p",{style:{color:P.grey[400]},children:C})}),Z==null?void 0:Z.map((r,u)=>O(W1,{value:r,children:f1(l1,{container:!0,direction:"column",children:[O(l1,{item:!0,children:r.label}),r.afterLabel&&O(l1,{item:!0,children:r.afterLabel})]})},u)),V&&[O(l1,{px:2,py:1,children:O(z2,{})},"footer-divider"),O("div",{children:V({closeSelect:()=>x(!1)})},"footer-content")]]}),e),O(B,{name:e})]})})},Q2=O2(K2);import{forwardRef as X2,memo as e0}from"react";import{Controller as c0,useFormContext as i0}from"react-hook-form";import{Grid as i1,Autocomplete as l0,TextField as a0}from"@mui/material";import{Divider as J1,LIcon as o0,Tooltip as r0}from"@s_mart/core";import{colorPalette as t0}from"@s_mart/tokens";import{Fragment as M1,jsx as R,jsxs as a1}from"react/jsx-runtime";import{createElement as K1}from"react";var n0=$=>{var P=$,{name:e,rules:c,defaultValue:o,shouldUnregister:m,label:h,required:M,options:Z,textFieldProps:C,noOptionsText:L,footer:p,multiple:g,info:V,placeholder:b,onChange:F,onInputChange:G}=P,A=S(P,["name","rules","defaultValue","shouldUnregister","label","required","options","textFieldProps","noOptionsText","footer","multiple","info","placeholder","onChange","onInputChange"]);let y=i0();if(!y)throw new Error("Para usar o <Searchable /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let x=q(y.formState.errors,e);return console.warn=()=>{},R(c0,{control:y.control,name:e,rules:c,defaultValue:o,shouldUnregister:m,render:({field:{onChange:w,value:D,ref:j}})=>{var H;return a1(i1,{display:"flex",flexDirection:"column",children:[a1("div",{style:{display:"flex"},children:[h&&R(i1,{item:!0,children:R(E,{label:h,required:M})}),V&&R(i1,{item:!0,children:R(r0,{title:V,placement:"top",children:R("div",{style:{width:"fit-content"},children:R(o0,{icon:c1,color:"#757575"})})})})]}),R(l0,v(a({onChange:(r,u)=>{w(u),F==null||F(u,y.getValues())},onInputChange:(r,u,Y)=>{Y==="input"&&setTimeout(()=>{G==null||G(u,y.getValues())},0)},slotProps:v(a({},A.slotProps||{}),{paper:v(a({},(A.slotProps||{}).paper||{}),{sx:a({border:`1px solid ${t0.neutral[30]}`,boxShadow:"0px 2px 4px rgba(0, 0, 0, 0.15)"},((H=(A.slotProps||{}).paper)==null?void 0:H.sx)||{})})}),value:D||(g?[]:null),options:Z,multiple:g,noOptionsText:a1(M1,{children:[L||"Nenhum resultado encontrado",p?a1(M1,{children:[R(i1,{py:1,children:R(J1,{})}),p]}):null]}),isOptionEqualToValue:(r,u)=>typeof r=="string"&&typeof u=="string"?r===u:typeof r=="object"&&typeof u=="object"?typeof r.value=="object"&&typeof u.value=="object"&&r.key!==void 0&&u.key!==void 0?r.key===u.key:r.value===u.value:!1,renderOption:(r,u)=>typeof u=="object"?K1("li",v(a({},r),{key:u.key||u.value}),a1(i1,{container:!0,direction:"column",children:[R(i1,{item:!0,children:u.label}),u.afterLabel&&R(i1,{item:!0,children:u.afterLabel})]})):K1("li",v(a({},r),{key:u}),u),ListboxComponent:X2(function(u,Y){return a1(M1,{children:[R("ul",v(a({},u),{ref:Y})),!!p&&R("div",v(a({},u),{children:a1(M1,{children:[R(i1,{px:2,py:1,children:R(J1,{})}),p]})}),"searchable-footer")]})})},A),{renderInput:r=>R(a0,v(a(a({error:!!x,placeholder:b},r),C),{inputRef:j}))}),e),R(B,{name:e})]})}})},s0=e0(n0);import{forwardRef as m0,memo as v0}from"react";import{Controller as p0,useFormContext as Z0}from"react-hook-form";import{isObject as u0,isEmpty as f0}from"lodash";import{Grid as o1,Autocomplete as M0,TextField as H0}from"@mui/material";import{LIcon as V1,Tooltip as V0,Button as y0,Divider as C0}from"@s_mart/core";import{colorPalette as g0}from"@s_mart/tokens";import{toRem as c2}from"@s_mart/utils";import{toRem as H1}from"@s_mart/utils";import h0 from"@emotion/styled";import{css as Q1}from"@emotion/react";var X1=Q1`
|
|
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,E1=Object.prototype.propertyIsEnumerable;var I1=(e,i,r)=>i in e?L1(e,i,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[i]=r,a=(e,i)=>{for(var r in i||(i={}))F1.call(i,r)&&I1(e,r,i[r]);if(u1)for(var r of u1(i))E1.call(i,r)&&I1(e,r,i[r]);return e},m=(e,i)=>v0(e,Z0(i));var S=(e,i)=>{var r={};for(var s in e)F1.call(e,s)&&i.indexOf(s)<0&&(r[s]=e[s]);if(e!=null&&u1)for(var s of u1(e))i.indexOf(s)<0&&E1.call(e,s)&&(r[s]=e[s]);return r};var G1=(e,i)=>()=>(i||e((i={exports:{}}).exports,i),i.exports);var M0=(e,i,r,s)=>{if(i&&typeof i=="object"||typeof i=="function")for(let o of u0(i))!F1.call(e,o)&&o!==r&&L1(e,o,{get:()=>i[o],enumerable:!(s=p0(i,o))||s.enumerable});return e};var B1=(e,i,r)=>(r=e!=null?m0(f0(e)):{},M0(i||!e||!e.__esModule?L1(r,"default",{value:e,enumerable:!0}):r,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,r=36e5,s="millisecond",o="second",M="minute",p="hour",b="day",F="week",u="month",C="quarter",f="year",L="date",w="Invalid Date",P=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,O=/\[([^\]]+)]|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,A={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 V=String(h);return!V||V.length>=c?h:""+Array(c+1-V.length).join(l)+h},k={s:$,z:function(h){var c=-h.utcOffset(),l=Math.abs(c),V=Math.floor(l/60),t=l%60;return(c<=0?"+":"-")+$(V,2,"0")+":"+$(t,2,"0")},m:function h(c,l){if(c.date()<l.date())return-h(l,c);var V=12*(l.year()-c.year())+(l.month()-c.month()),t=c.clone().add(V,u),g=l-t<0,n=c.clone().add(V+(g?-1:1),u);return+(-(V+(l-t)/(g?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:f,w:F,d:b,D:L,h:p,m:M,s:o,ms:s,Q:C}[h]||String(h||"").toLowerCase().replace(/s$/,"")},u:function(h){return h===void 0}},H="en",x={};x[H]=A;var D=function(h){return h instanceof Z},_=function h(c,l,V){var t;if(!c)return H;if(typeof c=="string"){var g=c.toLowerCase();x[g]&&(t=g),l&&(x[g]=l,t=g);var n=c.split("-");if(!t&&n.length>1)return h(n[0])}else{var d=c.name;x[d]=c,t=d}return!V&&t&&(H=t),t||!V&&H},T=function(h,c){if(D(h))return h.clone();var l=typeof c=="object"?c:{};return l.date=h,l.args=arguments,new Z(l)},v=k;v.l=_,v.i=D,v.w=function(h,c){return T(h,{locale:c.$L,utc:c.$u,x:c.$x,$offset:c.$offset})};var Z=function(){function h(l){this.$L=_(l.locale,null,!0),this.parse(l)}var c=h.prototype;return c.parse=function(l){this.$d=function(V){var t=V.date,g=V.utc;if(t===null)return new Date(NaN);if(v.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(P);if(n){var d=n[2]-1||0,I=(n[7]||"0").substring(0,3);return g?new Date(Date.UTC(n[1],d,n[3]||1,n[4]||0,n[5]||0,n[6]||0,I)):new Date(n[1],d,n[3]||1,n[4]||0,n[5]||0,n[6]||0,I)}}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 v},c.isValid=function(){return this.$d.toString()!==w},c.isSame=function(l,V){var t=T(l);return this.startOf(V)<=t&&t<=this.endOf(V)},c.isAfter=function(l,V){return T(l)<this.startOf(V)},c.isBefore=function(l,V){return this.endOf(V)<T(l)},c.$g=function(l,V,t){return v.u(l)?this[V]:this.set(t,l)},c.unix=function(){return Math.floor(this.valueOf()/1e3)},c.valueOf=function(){return this.$d.getTime()},c.startOf=function(l,V){var t=this,g=!!v.u(V)||V,n=v.p(l),d=function(t1,j){var e1=v.w(t.$u?Date.UTC(t.$y,j,t1):new Date(t.$y,j,t1),t);return g?e1:e1.endOf(b)},I=function(t1,j){return v.w(t.toDate()[t1].apply(t.toDate("s"),(g?[0,0,0,0]:[23,59,59,999]).slice(j)),t)},G=this.$W,Y=this.$M,X=this.$D,Q="set"+(this.$u?"UTC":"");switch(n){case f:return g?d(1,0):d(31,11);case u:return g?d(1,Y):d(0,Y+1);case F:var h1=this.$locale().weekStart||0,d1=(G<h1?G+7:G)-h1;return d(g?X-d1:X+(6-d1),Y);case b:case L:return I(Q+"Hours",0);case p:return I(Q+"Minutes",1);case M:return I(Q+"Seconds",2);case o:return I(Q+"Milliseconds",3);default:return this.clone()}},c.endOf=function(l){return this.startOf(l,!1)},c.$set=function(l,V){var t,g=v.p(l),n="set"+(this.$u?"UTC":""),d=(t={},t[b]=n+"Date",t[L]=n+"Date",t[u]=n+"Month",t[f]=n+"FullYear",t[p]=n+"Hours",t[M]=n+"Minutes",t[o]=n+"Seconds",t[s]=n+"Milliseconds",t)[g],I=g===b?this.$D+(V-this.$W):V;if(g===u||g===f){var G=this.clone().set(L,1);G.$d[d](I),G.init(),this.$d=G.set(L,Math.min(this.$D,G.daysInMonth())).$d}else d&&this.$d[d](I);return this.init(),this},c.set=function(l,V){return this.clone().$set(l,V)},c.get=function(l){return this[v.p(l)]()},c.add=function(l,V){var t,g=this;l=Number(l);var n=v.p(V),d=function(Y){var X=T(g);return v.w(X.date(X.date()+Math.round(Y*l)),g)};if(n===u)return this.set(u,this.$M+l);if(n===f)return this.set(f,this.$y+l);if(n===b)return d(1);if(n===F)return d(7);var I=(t={},t[M]=i,t[p]=r,t[o]=e,t)[n]||1,G=this.$d.getTime()+l*I;return v.w(G,this)},c.subtract=function(l,V){return this.add(-1*l,V)},c.format=function(l){var V=this,t=this.$locale();if(!this.isValid())return t.invalidDate||w;var g=l||"YYYY-MM-DDTHH:mm:ssZ",n=v.z(this),d=this.$H,I=this.$m,G=this.$M,Y=t.weekdays,X=t.months,Q=function(j,e1,b1,Z1){return j&&(j[e1]||j(V,g))||b1[e1].slice(0,Z1)},h1=function(j){return v.s(d%12||12,j,"0")},d1=t.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:G+1,MM:v.s(G+1,2,"0"),MMM:Q(t.monthsShort,G,X,3),MMMM:Q(X,G),D:this.$D,DD:v.s(this.$D,2,"0"),d:String(this.$W),dd:Q(t.weekdaysMin,this.$W,Y,2),ddd:Q(t.weekdaysShort,this.$W,Y,3),dddd:Y[this.$W],H:String(d),HH:v.s(d,2,"0"),h:h1(1),hh:h1(2),a:d1(d,I,!0),A:d1(d,I,!1),m:String(I),mm:v.s(I,2,"0"),s:String(this.$s),ss:v.s(this.$s,2,"0"),SSS:v.s(this.$ms,3,"0"),Z:n};return g.replace(O,function(j,e1){return e1||t1[j]||n.replace(":","")})},c.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},c.diff=function(l,V,t){var g,n=v.p(V),d=T(l),I=(d.utcOffset()-this.utcOffset())*i,G=this-d,Y=v.m(this,d);return Y=(g={},g[f]=Y/12,g[u]=Y,g[C]=Y/3,g[F]=(G-I)/6048e5,g[b]=(G-I)/864e5,g[p]=G/r,g[M]=G/i,g[o]=G/e,g)[n]||G,t?Y:v.a(Y)},c.daysInMonth=function(){return this.endOf(u).$D},c.$locale=function(){return x[this.$L]},c.locale=function(l,V){if(!l)return this.$L;var t=this.clone(),g=_(l,V,!0);return g&&(t.$L=g),t},c.clone=function(){return v.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}(),y=Z.prototype;return T.prototype=y,[["$ms",s],["$s",o],["$m",M],["$H",p],["$W",b],["$M",u],["$y",f],["$D",L]].forEach(function(h){y[h[1]]=function(c){return this.$g(c,h[0],h[1])}}),T.extend=function(h,c){return h.$i||(h(c,Z,T),h.$i=!0),T},T.locale=_,T.isDayjs=D,T.unix=function(h){return T(1e3*h)},T.en=x[H],T.Ls=x,T.p={},T})});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 r=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 r.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 M=o,{children:e,style:i,onSubmit:r}=M,s=S(M,["children","style","onSubmit"]);return R1(H0,m(a({},s),{children:R1("form",{onSubmit:p=>{p.preventDefault(),p.stopPropagation(),r(p)},style:i,children:e})}))},P1=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,r=S(o,["disableDefaultValuesUpdate","onSubmit"]);let M=g0(m(a({},r),{resolver:r.schema&&x0(r.schema)}));return y0(()=>{e||M.reset(r.defaultValues)},[r.defaultValues,M.reset]),m(a({},M),{onSubmit:M.handleSubmit(p=>i(p,M))})},C1=b0;import{jsx as P0}from"react/jsx-runtime";function L0(s){var o=s,{children:e,style:i}=o,r=S(o,["children","style"]);let M=C1(r);return P0(P1,m(a({},M),{style:i,children:typeof e=="function"?e(M):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 E0}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 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 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 k0}from"react/jsx-runtime";var B=({label:e,required:i,regular:r})=>k0("span",{style:{display:"flex",alignItems:"center",gap:C0(2)},children:[z1(Y1,{variant:"caption",fontWeight:r?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)=>{var r,s,o,M,p;if(e[i])return e[i];if(i.includes("[")){let[b,F]=i.split("["),[u,C]=F.split("].");return(s=(r=e[b])==null?void 0:r[u])==null?void 0:s[C]}if(i.includes(".")){let[b,F,u]=i.split(".");return u?(p=(M=e[b])==null?void 0:M[F])==null?void 0:p[u]:(o=e[b])==null?void 0:o[F]}};import{jsx as $0}from"react/jsx-runtime";var R=({name:e,disableIcon:i=!1})=>{var o;let r=S0(),s=z((o=r==null?void 0:r.formState)==null?void 0:o.errors,e);return s?$0(w0,{severity:"error",icon:!i,children:s==null?void 0:s.message}):null};import{LIcon as j1,Tooltip as G0}from"@s_mart/core";import{jsx as N,jsxs as N1}from"react/jsx-runtime";var B0=O=>{var A=O,{name:e,rules:i,defaultValue:r,shouldUnregister:s,label:o,required:M,mask:p,variant:b="outlined",info:F,parse:u,inputMode:C,format:f,onInputChange:L,disableIconError:w}=A,P=S(A,["name","rules","defaultValue","shouldUnregister","label","required","mask","variant","info","parse","inputMode","format","onInputChange","disableIconError"]);let $=_0();if(!$)throw new Error("Para usar o <TextField /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let[k,H]=T0(!1),x=v=>{var y;let Z=v;return f&&(Z=f(v)),p?(y=n1==null?void 0:n1[p])==null?void 0:y.format(Z):Z},D=v=>{var y;let Z=v;return u&&(Z=u(v)),p?(y=n1==null?void 0:n1[p])==null?void 0:y.parse(Z):Z},_=v=>{if(!v||p!=="porcentagem"&&p!=="porcentagem0")return;v==null||v.stopPropagation();let Z=(v==null?void 0:v.target).value;if(Z){let y=String(Z);if(y.length>0){let h=y.indexOf("%");h>-1&&(v.currentTarget.selectionEnd=h)}}},T=z($.formState.errors,e);return N(D0,{control:$.control,name:e,rules:i,defaultValue:r,shouldUnregister:s,render:({field:{value:v,onChange:Z,ref:y}})=>N1(S1,{display:"flex",flexDirection:"column",children:[N1("div",{style:{display:"flex"},children:[o&&N(S1,{item:!0,children:N(B,{label:o,required:M})}),F&&N(S1,{item:!0,children:N(G0,{title:F,placement:"top",children:N("div",{style:{width:"fit-content"},children:N(j1,{icon:c1,color:"#757575"})})})})]}),N(E0,m(a({variant:b,defaultValue:r,value:x(v||""),onChange:h=>{var l;let c=D((l=h==null?void 0:h.target)==null?void 0:l.value);Z(c),L==null||L(c,$.getValues())},error:!!T},P),{type:P.type==="password"?k?"text":"password":P.type,autoComplete:P.autoComplete||"off",inputProps:a({inputMode:C},P.inputProps),InputProps:a({onKeyDown:_,inputRef:y,endAdornment:P.type==="password"&&N(I0,{position:"start",onClick:()=>H(!k),style:{cursor:"pointer"},children:N(j1,{icon:k?O1:U1,size:"24px",removeMargin:!0})})},P.InputProps)}),e),N(R,{name:e,disableIcon:w})]})})},R0=A0(B0);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 N0}from"@s_mart/core";import{Grid as l1,Select as W0,MenuItem as W1,useTheme as J0}from"@mui/material";import{jsx as q,jsxs as f1}from"react/jsx-runtime";var K0=O=>{var A=O,{name:e,rules:i,defaultValue:r,shouldUnregister:s,label:o,required:M,options:p,placeholder:b,disableOnChangeForm:F=!1,multiple:u,info:C,footer:f,onChange:L,disableIconError:w}=A,P=S(A,["name","rules","defaultValue","shouldUnregister","label","required","options","placeholder","disableOnChangeForm","multiple","info","footer","onChange","disableIconError"]);let $=Y0(),{palette:k}=J0(),[H,x]=U0(!1);if(!$)throw new Error("Para usar o <Select /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let D=z($.formState.errors,e);return console.warn=()=>{},q(q0,{control:$.control,name:e,rules:i,defaultValue:r,shouldUnregister:s,render:({field:{value:_,onChange:T,ref:v}})=>f1(l1,{display:"flex",flexDirection:"column",children:[f1("div",{style:{display:"flex"},children:[o&&q(l1,{item:!0,children:q(B,{label:o,required:M})}),C&&q(l1,{item:!0,children:q(N0,{title:C,placement:"top",children:q("div",{style:{width:"fit-content"},children:q(j0,{icon:c1,color:"#757575"})})})})]}),f1(W0,m(a({open:H,onOpen:()=>x(!0),onClose:()=>x(!1),displayEmpty:!!b,variant:"outlined",autoComplete:"off",value:_?_||"":u?[]:"",renderValue:Z=>{if(Z.label)return Z.label;if(b)return q("p",{style:{color:k.grey[400]},children:b})},multiple:u,onChange:Z=>{!F&&T(Z.target.value),L&&L(Z.target.value,$.getValues())},error:!!D,size:P.size||"medium",inputRef:v},P),{children:[b&&q(W1,{disabled:!0,value:"",children:q("p",{style:{color:k.grey[400]},children:b})}),p==null?void 0:p.map((Z,y)=>q(W1,{value:Z,children:f1(l1,{container:!0,direction:"column",children:[q(l1,{item:!0,children:Z.label}),Z.afterLabel&&q(l1,{item:!0,children:Z.afterLabel})]})},y)),f&&[q(l1,{px:2,py:1,children:q(z0,{})},"footer-divider"),q("div",{children:f({closeSelect:()=>x(!1)})},"footer-content")]]}),e),q(R,{name:e,disableIcon:w})]})})},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=$=>{var k=$,{name:e,rules:i,defaultValue:r,shouldUnregister:s,label:o,required:M,options:p,textFieldProps:b,noOptionsText:F,footer:u,multiple:C,info:f,placeholder:L,onChange:w,onInputChange:P,disableIconError:O}=k,A=S(k,["name","rules","defaultValue","shouldUnregister","label","required","options","textFieldProps","noOptionsText","footer","multiple","info","placeholder","onChange","onInputChange","disableIconError"]);let H=i2();if(!H)throw new Error("Para usar o <Searchable /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let x=z(H.formState.errors,e);return console.warn=()=>{},U(c2,{control:H.control,name:e,rules:i,defaultValue:r,shouldUnregister:s,render:({field:{onChange:D,value:_,ref:T}})=>{var v;return a1(i1,{display:"flex",flexDirection:"column",children:[a1("div",{style:{display:"flex"},children:[o&&U(i1,{item:!0,children:U(B,{label:o,required:M})}),f&&U(i1,{item:!0,children:U(r2,{title:f,placement:"top",children:U("div",{style:{width:"fit-content"},children:U(o2,{icon:c1,color:"#757575"})})})})]}),U(l2,m(a({onChange:(Z,y)=>{D(y),w==null||w(y,H.getValues())},onInputChange:(Z,y,h)=>{h==="input"&&setTimeout(()=>{P==null||P(y,H.getValues())},0)},slotProps:m(a({},A.slotProps||{}),{paper:m(a({},(A.slotProps||{}).paper||{}),{sx:a({border:`1px solid ${t2.neutral[30]}`,boxShadow:"0px 2px 4px rgba(0, 0, 0, 0.15)"},((v=(A.slotProps||{}).paper)==null?void 0:v.sx)||{})})}),value:_||(C?[]:null),options:p,multiple:C,noOptionsText:a1(M1,{children:[F||"Nenhum resultado encontrado",u?a1(M1,{children:[U(i1,{py:1,children:U(J1,{})}),u]}):null]}),isOptionEqualToValue:(Z,y)=>typeof Z=="string"&&typeof y=="string"?Z===y:typeof Z=="object"&&typeof y=="object"?typeof Z.value=="object"&&typeof y.value=="object"&&Z.key!==void 0&&y.key!==void 0?Z.key===y.key:Z.value===y.value:!1,renderOption:(Z,y)=>typeof y=="object"?K1("li",m(a({},Z),{key:y.key||y.value}),a1(i1,{container:!0,direction:"column",children:[U(i1,{item:!0,children:y.label}),y.afterLabel&&U(i1,{item:!0,children:y.afterLabel})]})):K1("li",m(a({},Z),{key:y}),y),ListboxComponent:X0(function(y,h){return a1(M1,{children:[U("ul",m(a({},y),{ref:h})),!!u&&U("div",m(a({},y),{children:a1(M1,{children:[U(i1,{px:2,py:1,children:U(J1,{})}),u]})}),"searchable-footer")]})})},A),{renderInput:Z=>U(a2,m(a(a({error:!!x,placeholder:L},Z),b),{inputRef:T}))}),e),U(R,{name:e,disableIcon:O})]})}})},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`
|
|
2
2
|
display: flex;
|
|
3
3
|
align-items: center;
|
|
4
4
|
justify-content: center;
|
|
5
|
-
`,
|
|
5
|
+
`,d2=e=>Q1`
|
|
6
6
|
.creatable,
|
|
7
7
|
.editable {
|
|
8
8
|
${X1}
|
|
@@ -31,7 +31,7 @@ var m2=Object.create;var L1=Object.defineProperty,v2=Object.defineProperties,p2=
|
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
|
-
`,
|
|
34
|
+
`,e0=h2.div`
|
|
35
35
|
display: flex;
|
|
36
36
|
|
|
37
37
|
div.endAdornments {
|
|
@@ -46,8 +46,8 @@ var m2=Object.create;var L1=Object.defineProperty,v2=Object.defineProperties,p2=
|
|
|
46
46
|
right: 0;
|
|
47
47
|
}
|
|
48
48
|
|
|
49
|
-
${({hideAddButton:e,theme:
|
|
50
|
-
`;import{Fragment as w1,jsx as
|
|
49
|
+
${({hideAddButton:e,theme:i})=>!e&&d2(i)}
|
|
50
|
+
`;import{Fragment as w1,jsx as E,jsxs as W}from"react/jsx-runtime";import{createElement as i0}from"react";var b2=x=>{var D=x,{name:e,rules:i,defaultValue:r,shouldUnregister:s,label:o,required:M,options:p,editable:b,footer:F,onEditOption:u,onCreateOption:C,textFieldProps:f,hideAddButton:L,multiple:w,info:P,onChange:O,onInputChange:A,placeholder:$,disableIconError:k}=D,H=S(D,["name","rules","defaultValue","shouldUnregister","label","required","options","editable","footer","onEditOption","onCreateOption","textFieldProps","hideAddButton","multiple","info","onChange","onInputChange","placeholder","disableIconError"]);let _=Z2();if(!_)throw new Error("Para usar o <Creatable /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let T=z(_.formState.errors,e),v=c=>{let l=0;return f!=null&&f.InputProps||(l+=2.5),L||(l+=2.56,Z(c)&&(l+=2.56)),H.disableClearable||(l+=1.3),l+"rem"},Z=c=>b&&u2(c)&&!f2(c);console.warn=()=>{};let y=c=>{C?C(c):console.error("onCreateOption n\xE3o foi definido")},h=c=>{u?u(c):console.error("onEditOption n\xE3o foi definido")};return E(p2,{control:_.control,name:e,rules:i,defaultValue:r,shouldUnregister:s,render:({field:{value:c,onChange:l,ref:V}})=>{var g;let t=(c==null?void 0:c.label)||(c==null?void 0:c.value)||c;return W(o1,{display:"flex",flexDirection:"column",children:[W("div",{style:{display:"flex"},children:[o&&E(o1,{item:!0,children:E(B,{label:o,required:M})}),P&&E(o1,{item:!0,children:E(V2,{title:P,placement:"top",children:E("div",{style:{width:"fit-content"},children:E(V1,{icon:c1,color:"#757575"})})})})]}),E(e0,{hideAddButton:L,children:E(M2,m(a({fullWidth:!0,onChange:(n,d)=>{l(d),O==null||O(d,_.getValues())},onInputChange:(n,d,I)=>{I==="input"&&setTimeout(()=>{A==null||A(d,_.getValues())},0)},slotProps:m(a({},H.slotProps||{}),{paper:m(a({},(H.slotProps||{}).paper||{}),{sx:a({border:`1px solid ${x2.neutral[30]}`,boxShadow:"0px 2px 4px rgba(0, 0, 0, 0.15)"},((g=(H.slotProps||{}).paper)==null?void 0:g.sx)||{})})}),options:p,value:c||(w?[]:null),multiple:w,noOptionsText:L?void 0:W(y2,{sx:{justifyContent:"flex-start",padding:`${c0(6)} ${c0(-16)}`,margin:0},fullWidth:!0,onClick:()=>y(c),variant:"text",startIcon:E(V1,{icon:k1}),children:["Adicionar ",t&&`"${t}"`]}),isOptionEqualToValue:(n,d)=>d?typeof n=="string"&&typeof d=="string"?n===d:typeof n=="object"&&typeof d=="object"?typeof n.value=="object"&&typeof d.value=="object"&&n.key!==void 0&&d.key!==void 0?n.key===d.key:n.value===d.value:typeof n=="object"&&typeof d=="string":!1,renderOption:(n,d)=>typeof d=="object"?i0("li",m(a({},n),{key:d.key||d.value}),W(o1,{container:!0,direction:"column",children:[E(o1,{item:!0,children:d.label}),d.afterLabel&&E(o1,{item:!0,children:d.afterLabel})]})):i0("li",m(a({},n),{key:d}),d),ListboxComponent:m2(function(d,I){return W(w1,{children:[E("ul",m(a({},d),{ref:I})),!!F&&E("div",m(a({},d),{children:W(w1,{children:[E(o1,{px:2,py:1,children:E(g2,{})}),F]})}),"creatable-footer")]})})},H),{sx:a({"& div.MuiInputBase-root":{paddingRight:`${v(c)} !important`}},H.sx),renderInput:n=>E(H2,a(m(a({placeholder:$},n),{error:!!T,InputProps:m(a({},n.InputProps),{inputRef:V,endAdornment:W("div",{className:"endAdornments",children:[n.InputProps.endAdornment,!L&&W(w1,{children:[Z(c)?W("div",{className:"editable",children:[E("div",{className:"divider"}),E("div",{className:"button",onClick:()=>h(c),children:E(V1,{icon:q1,size:"24px",removeMargin:!0})})]}):null,W("div",{className:"creatable",children:[E("div",{className:"divider"}),E("div",{className:"button",onClick:()=>y(c),children:E(V1,{icon:k1,size:"24px",removeMargin:!0})})]})]})]})})}),f))}),e)}),E(R,{name:e,disableIcon:k})]})}})},L2=v2(b2);import{Controller as F2,useFormContext as P2}from"react-hook-form";import{Grid as C2,Checkbox as k2,FormControlLabel as S2}from"@mui/material";import{jsx as m1,jsxs as A2}from"react/jsx-runtime";var w2=u=>{var C=u,{name:e,rules:i,defaultValue:r,shouldUnregister:s,label:o,labelPlacement:M,required:p,disableIconError:b}=C,F=S(C,["name","rules","defaultValue","shouldUnregister","label","labelPlacement","required","disableIconError"]);let f=P2();if(!f)throw new Error("Para usar o <Checkbox /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");return m1(F2,{control:f.control,name:e,rules:i,defaultValue:r,shouldUnregister:s,render:({field:{value:L,onChange:w}})=>A2(C2,{display:"flex",flexDirection:"column",children:[m1(S2,{control:m1(k2,a({checked:!!L,value:L!=null?L:"",defaultValue:L,onChange:w},F),e),label:m1(B,{label:o,required:p,regular:!0}),labelPlacement:M||"end"}),m1(R,{name:e,disableIcon:b})]})})},$2=w2;import{Controller as T2,useFormContext as D2}from"react-hook-form";import{Grid as _2,Switch as I2,FormControlLabel as E2}from"@mui/material";import{jsx as v1,jsxs as R2}from"react/jsx-runtime";var G2=F=>{var u=F,{name:e,rules:i,defaultValue:r,shouldUnregister:s,label:o,labelPlacement:M,disableIconError:p}=u,b=S(u,["name","rules","defaultValue","shouldUnregister","label","labelPlacement","disableIconError"]);let C=D2();if(!C)throw new Error("Para usar o <Switch /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");return v1(T2,{control:C.control,name:e,rules:i,defaultValue:r,shouldUnregister:s,render:({field:{value:f,onChange:L}})=>R2(_2,{display:"flex",flexDirection:"column",children:[v1(E2,{control:v1(I2,a({value:f!=null?f:"",checked:f!=null?f:!1,defaultValue:f,onChange:L},b),e),label:v1(B,{label:o}),labelPlacement:M||"end"}),v1(R,{name:e,disableIcon:p})]})})},B2=G2;import{Grid as O2,Radio as U2,FormControlLabel as q2}from"@mui/material";import{jsx as y1}from"react/jsx-runtime";var Y2=s=>{var o=s,{label:e,labelPlacement:i}=o,r=S(o,["label","labelPlacement"]);return y1(O2,{display:"flex",flexDirection:"column",children:y1(q2,{control:y1(U2,a({},r)),label:y1(B,{label:e}),labelPlacement:i||"end"})})},z2=Y2;import{Controller as j2,useFormContext as N2}from"react-hook-form";import{Grid as W2,RadioGroup as J2}from"@mui/material";import{jsx as g1,jsxs as X2}from"react/jsx-runtime";var K2=C=>{var f=C,{name:e,rules:i,defaultValue:r,shouldUnregister:s,label:o,required:M,children:p,orientation:b="row",disableIconError:F}=f,u=S(f,["name","rules","defaultValue","shouldUnregister","label","required","children","orientation","disableIconError"]);let L=N2();if(!L)throw new Error("Para usar o <RadioGroup /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");return g1(j2,{control:L.control,name:e,rules:i,defaultValue:r,shouldUnregister:s,render:({field:{value:w,onChange:P}})=>X2(W2,{display:"flex",flexDirection:"column",children:[o&&g1(B,{label:o,required:M}),g1(J2,m(a({value:w||"",onChange:P,name:e},u),{style:{display:"flex",flexDirection:b},children:p}),e),g1(R,{name:e,disableIcon:F})]})})},Q2=K2;import{Controller as e3,useFormContext as c3}from"react-hook-form";import{Slider as i3}from"@mui/material";import{jsx as l0}from"react/jsx-runtime";var l3=M=>{var p=M,{name:e,rules:i,defaultValue:r,shouldUnregister:s}=p,o=S(p,["name","rules","defaultValue","shouldUnregister"]);let b=c3();if(!b)throw new Error("Para usar o <Slider /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");return l0(e3,{control:b.control,name:e,rules:i,defaultValue:r,shouldUnregister:s,render:({field:{value:F,onChange:u}})=>l0(i3,a({value:F||(o==null?void 0:o.min)||0,onChange:u,valueLabelDisplay:"auto"},o),e)})},a3=l3;var t0=B1(_1());import{memo as s3}from"react";import{Controller as h3,useFormContext as d3}from"react-hook-form";import{Grid as m3}from"@s_mart/core";import{composeValidators as v3,date as r0}from"@s_mart/rules";import{TextField as p3}from"@mui/material";import{DatePicker as Z3}from"@mui/x-date-pickers/DatePicker";import{AdapterDayjs as u3}from"@mui/x-date-pickers/AdapterDayjs";import{LocalizationProvider as f3}from"@mui/x-date-pickers/LocalizationProvider";import{ptBR as M3}from"@mui/x-date-pickers/locales/ptBR";import o3 from"@emotion/styled";import{IconButton as r3}from"@mui/material";import{toRem as J}from"@s_mart/utils";var t3=e=>{switch(e){case"small":return J(16);default:case"medium":return J(20);case"large":return J(24)}},n3=e=>{switch(e){case"small":return`${J(2)} ${J(8)}`;default:case"medium":return`${J(6)} ${J(8)}`;case"large":return`${J(10)}`}},o0=o3(r3)`
|
|
51
51
|
margin: 0px;
|
|
52
52
|
|
|
53
53
|
padding: ${({size:e})=>n3(e)};
|
|
@@ -56,13 +56,13 @@ var m2=Object.create;var L1=Object.defineProperty,v2=Object.defineProperties,p2=
|
|
|
56
56
|
svg {
|
|
57
57
|
width: ${({size:e})=>t3(e)} !important;
|
|
58
58
|
}
|
|
59
|
-
`;import{jsx as p1,jsxs as
|
|
59
|
+
`;import{jsx as p1,jsxs as g3}from"react/jsx-runtime";import{createElement as y3}from"react";var H3=f=>{var L=f,{rules:e,name:i,defaultValue:r,shouldUnregister:s,datePickerProps:o,label:M,required:p,placeholder:b,disabled:F,disableIconError:u}=L,C=S(L,["rules","name","defaultValue","shouldUnregister","datePickerProps","label","required","placeholder","disabled","disableIconError"]);let w=d3();if(!w)throw new Error("Para usar o <DataPicker /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let P=z(w.formState.errors,i),O=(o==null?void 0:o.format)||"DD/MM/YYYY",A=e?v3([r0(O),e]):r0(O);return p1(f3,{dateAdapter:u3,adapterLocale:t0.default,localeText:M3.components.MuiLocalizationProvider.defaultProps.localeText,children:p1(h3,{control:w.control,name:i,rules:A,defaultValue:r,shouldUnregister:s,render:({field:{value:$,onChange:k,ref:H}})=>g3(m3,{display:"flex",flexDirection:"column",children:[M&&p1(B,{label:M,required:p}),y3(Z3,m(a({},o),{key:i,value:$!=null?$:null,format:O,onChange:k,disabled:F,slots:{textField:p3,openPickerButton:x=>p1(o0,m(a({},x),{size:C.size}))},slotProps:{textField:x=>{var D;return m(a(m(a({variant:"outlined"},x),{error:!!P}),C),{inputProps:m(a({},x.inputProps),{placeholder:b||((D=x.inputProps)==null?void 0:D.placeholder)}),InputProps:m(a({},x.InputProps),{inputRef(_){H(_),typeof x.inputRef=="function"&&x.inputRef(_)}})})}}})),p1(R,{name:i,disableIcon:u})]})})})},V3=s3(H3);var h0=B1(_1());import{memo as P3}from"react";import{Controller as C3,useFormContext as k3}from"react-hook-form";import{Grid as S3}from"@s_mart/core";import{composeValidators as w3,time as s0}from"@s_mart/rules";import{TextField as $3}from"@mui/material";import{TimePicker as A3}from"@mui/x-date-pickers/TimePicker";import{AdapterDayjs as T3}from"@mui/x-date-pickers/AdapterDayjs";import{LocalizationProvider as D3}from"@mui/x-date-pickers/LocalizationProvider";import{ptBR as _3}from"@mui/x-date-pickers/locales/ptBR";import x3 from"@emotion/styled";import{IconButton as b3}from"@mui/material";import{toRem as K}from"@s_mart/utils";var L3=e=>{switch(e){case"small":return K(16);default:case"medium":return K(20);case"large":return K(24)}},F3=e=>{switch(e){case"small":return`${K(2)} ${K(8)}`;default:case"medium":return`${K(6)} ${K(8)}`;case"large":return`${K(10)}`}},n0=x3(b3)`
|
|
60
60
|
margin: 0px;
|
|
61
61
|
|
|
62
|
-
padding: ${({size:e})=>
|
|
62
|
+
padding: ${({size:e})=>F3(e)};
|
|
63
63
|
border-radius: 0 ${K(4)} ${K(4)} 0;
|
|
64
64
|
|
|
65
65
|
svg {
|
|
66
66
|
width: ${({size:e})=>L3(e)} !important;
|
|
67
67
|
}
|
|
68
|
-
`;import{jsx as s1,jsxs as
|
|
68
|
+
`;import{jsx as s1,jsxs as G3}from"react/jsx-runtime";var I3=f=>{var L=f,{rules:e,defaultValue:i,shouldUnregister:r,name:s,required:o,label:M,timePickerProps:p,placeholder:b,disabled:F,disableIconError:u}=L,C=S(L,["rules","defaultValue","shouldUnregister","name","required","label","timePickerProps","placeholder","disabled","disableIconError"]);let w=k3();if(!w)throw new Error("Para usar o <TimePicker /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let P=z(w.formState.errors,s),O=(p==null?void 0:p.format)||"HH:mm",A=e?w3([s0(O),e]):s0(O);return s1(D3,{dateAdapter:T3,adapterLocale:h0.default,localeText:_3.components.MuiLocalizationProvider.defaultProps.localeText,children:s1(C3,{control:w.control,name:s,rules:A,defaultValue:i,shouldUnregister:r,render:({field:{value:$,onChange:k,ref:H}})=>G3(S3,{display:"flex",flexDirection:"column",children:[M&&s1(B,{label:M,required:o}),s1(A3,m(a({ampm:!1,format:O,value:$!=null?$:null,onChange:k,disabled:F},p),{slots:{textField:$3,openPickerButton:x=>s1(n0,m(a({},x),{size:C.size}))},slotProps:{textField:x=>{var D;return m(a(m(a({variant:"outlined"},x),{error:!!P}),C),{inputProps:m(a({},x.inputProps),{placeholder:b||((D=x.inputProps)==null?void 0:D.placeholder)}),InputProps:m(a({},x.InputProps),{inputRef(_){H(_),typeof x.inputRef=="function"&&x.inputRef(_)}})})}}}),s),s1(R,{name:s,disableIcon:u})]})})})},E3=P3(I3);import{memo as B3}from"react";import{Controller as R3,useFormContext as O3}from"react-hook-form";import{Autocomplete as U3,TextField as q3}from"@mui/material";import{Grid as x1}from"@s_mart/core";import{colorPalette as Y3}from"@s_mart/tokens";import{jsx as r1,jsxs as d0}from"react/jsx-runtime";import{createElement as N3}from"react";var z3=L=>{var w=L,{name:e,defaultValue:i,rules:r,shouldUnregister:s,label:o,required:M,noOptionsText:p,placeholder:b,onInputChange:F,onChange:u,disableIconError:C}=w,f=S(w,["name","defaultValue","rules","shouldUnregister","label","required","noOptionsText","placeholder","onInputChange","onChange","disableIconError"]);let P=O3();if(!P)throw new Error("Para usar o <Autocomplete /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let O=z(P.formState.errors,e);return console.warn=()=>{},r1(R3,{name:e,control:P.control,defaultValue:i,rules:r,shouldUnregister:s,render:({field:A})=>{var $;return d0(x1,{display:"flex",flexDirection:"column",children:[o&&r1(B,{label:o,required:M}),r1(U3,m(a({onChange:(k,H)=>{A.onChange(H),u==null||u(H,P.getValues())},onInputChange:(k,H,x)=>{x==="input"&&(A.onChange(H),setTimeout(()=>{F==null||F(H,P.getValues())},0))},slotProps:m(a({},f.slotProps||{}),{paper:m(a({},(f.slotProps||{}).paper||{}),{sx:a({border:`1px solid ${Y3.neutral[30]}`,boxShadow:"0px 2px 4px rgba(0, 0, 0, 0.15)"},(($=(f.slotProps||{}).paper)==null?void 0:$.sx)||{})})}),isOptionEqualToValue:(k,H)=>k.value===H.value,renderOption:(k,H)=>N3("li",m(a({},k),{key:H.key||H.value,onClick:x=>{var D;(D=k.onClick)==null||D.call(k,x),A.onChange(H)}}),d0(x1,{container:!0,direction:"column",children:[r1(x1,{item:!0,children:H.label}),H.afterLabel&&r1(x1,{item:!0,children:H.afterLabel})]})),value:A.value||null,noOptionsText:p||"Nenhuma op\xE7\xE3o encontrada"},f),{renderInput:k=>{var H,x,D;return r1(q3,m(a(a({placeholder:b},k),f.textFieldProps),{error:!!O,InputProps:m(a(a({},k.InputProps),(H=f.textFieldProps)==null?void 0:H.InputProps),{inputRef:A.ref,inputProps:a(a({},k.inputProps),(D=(x=f.textFieldProps)==null?void 0:x.InputProps)==null?void 0:D.inputProps)})}))}}),e),r1(R,{name:e,disableIcon:C})]})}})},j3=B3(z3);export{j3 as Autocomplete,$2 as Checkbox,L2 as Creatable,V3 as DatePicker,F0 as Form,P1 as FormProvider,z2 as RadioButton,Q2 as RadioGroup,s2 as Searchable,Q0 as Select,a3 as Slider,B2 as Switch,R0 as TextField,E3 as TimePicker,C1 as useForm};
|