@s_mart/form 3.1.1 → 3.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -1,9 +1,11 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
1
2
  import { UseFormProps, UseFormReturn, FieldValues, ControllerProps, UseControllerProps } from 'react-hook-form';
3
+ import { z } from 'zod';
2
4
  import * as react from 'react';
3
5
  import { TextFieldProps as TextFieldProps$1, SelectProps as SelectProps$1, AutocompleteProps as AutocompleteProps$1, CheckboxProps as CheckboxProps$1, SwitchProps as SwitchProps$1, RadioProps as RadioProps$1, RadioGroupProps as RadioGroupProps$1, SliderProps as SliderProps$1 } from '@mui/material';
4
6
  import { DatePickerProps as DatePickerProps$1, TimePickerProps as TimePickerProps$1 } from '@mui/x-date-pickers';
5
7
 
6
- interface IFormProps<T> extends UseFormProps {
8
+ interface IFormProps<T> extends Omit<UseFormProps, 'resolver'> {
7
9
  onSubmit: (data: T, methods: UseFormReturn) => void;
8
10
  children: ((methods: UseFormReturn & {
9
11
  onSubmit: (e?: React.FormEvent | undefined) => Promise<void>;
@@ -13,9 +15,10 @@ interface IFormProps<T> extends UseFormProps {
13
15
  * Prop que faz com que o formulário não atualize ao mudar o defaultValue
14
16
  */
15
17
  disableDefaultValuesUpdate?: boolean;
18
+ schema?: z.ZodObject<any> | z.ZodEffects<z.ZodObject<any>>;
16
19
  }
17
20
 
18
- declare function Form({ children, onSubmit, style, disableDefaultValuesUpdate, ...rest }: IFormProps<any>): JSX.Element;
21
+ declare function Form({ children, onSubmit, style, disableDefaultValuesUpdate, ...rest }: IFormProps<any>): react_jsx_runtime.JSX.Element;
19
22
 
20
23
  type ControllerTextField = Omit<ControllerProps, 'render' | 'control'>;
21
24
  type Masks = 'cpf' | 'cnpj' | 'cpfCnpj' | 'cep' | 'telefone' | 'decimal' | 'decimal3' | 'decimal4' | 'decimal5' | 'porcentagem' | 'porcentagem0' | 'nome' | 'numero' | 'numeroPontuacao' | 'placa' | 'valor';
@@ -52,9 +55,9 @@ type TextFieldProps = TextFieldProps$1 & ControllerTextField & {
52
55
  info?: React.ReactNode;
53
56
  };
54
57
 
55
- declare const _default$6: react.MemoExoticComponent<({ name, rules, defaultValue, shouldUnregister, label, required, mask, variant, info, parse, format, onInputChange, ...rest }: TextFieldProps) => JSX.Element>;
58
+ declare const _default$6: react.MemoExoticComponent<({ name, rules, defaultValue, shouldUnregister, label, required, mask, variant, info, parse, format, onInputChange, ...rest }: TextFieldProps) => react_jsx_runtime.JSX.Element>;
56
59
 
57
- declare const _default$5: react.MemoExoticComponent<({ name, rules, defaultValue, shouldUnregister, label, required, options, placeholder, disableOnChangeForm, multiple, info, footer, onChange: onChangeProp, ...rest }: SelectProps) => JSX.Element>;
60
+ 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>;
58
61
 
59
62
  type ControllerSelect = Omit<ControllerProps, 'render' | 'control'>;
60
63
  type SelectOption = {
@@ -162,7 +165,7 @@ type SearchableProps = Omit<AutocompleteProps$1<SearchableOption, true, true, tr
162
165
  onChange?: (value: any, values: FieldValues) => void;
163
166
  };
164
167
 
165
- declare const _default$4: react.MemoExoticComponent<({ name, rules, defaultValue, shouldUnregister, label, required, options, textFieldProps, noOptionsText, footer, multiple, info, placeholder, onChange: onChangeProp, onInputChange, ...rest }: SearchableProps) => JSX.Element>;
168
+ 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>;
166
169
 
167
170
  type ControllerCreatable = Omit<ControllerProps, 'render' | 'control'>;
168
171
  type CreatableOption = {
@@ -243,7 +246,7 @@ type CreatableProps = Omit<AutocompleteProps$1<CreatableOption, true, true, true
243
246
  onChange?: (value: any, values: FieldValues) => void;
244
247
  };
245
248
 
246
- declare const _default$3: react.MemoExoticComponent<({ name, rules, defaultValue, shouldUnregister, label, required, options, editable, onEditOption, onCreateOption, textFieldProps, hideAddButton, multiple, info, onChange: onChangeProp, onInputChange, placeholder, ...rest }: CreatableProps) => JSX.Element>;
249
+ declare const _default$3: react.MemoExoticComponent<({ name, rules, defaultValue, shouldUnregister, label, required, options, editable, onEditOption, onCreateOption, textFieldProps, hideAddButton, multiple, info, onChange: onChangeProp, onInputChange, placeholder, ...rest }: CreatableProps) => react_jsx_runtime.JSX.Element>;
247
250
 
248
251
  type ControllerCheckbox = Omit<ControllerProps, 'render' | 'control'>;
249
252
  type CheckboxProps = CheckboxProps$1 & ControllerCheckbox & {
@@ -265,7 +268,7 @@ type CheckboxProps = CheckboxProps$1 & ControllerCheckbox & {
265
268
  labelPlacement?: 'start' | 'end' | 'top' | 'bottom';
266
269
  };
267
270
 
268
- declare const Checkbox: ({ name, rules, defaultValue, shouldUnregister, label, labelPlacement, required, ...rest }: CheckboxProps) => JSX.Element;
271
+ declare const Checkbox: ({ name, rules, defaultValue, shouldUnregister, label, labelPlacement, required, ...rest }: CheckboxProps) => react_jsx_runtime.JSX.Element;
269
272
 
270
273
  type ControllerSwitch = Omit<ControllerProps, 'render' | 'control'>;
271
274
  type SwitchProps = SwitchProps$1 & ControllerSwitch & {
@@ -287,7 +290,7 @@ type SwitchProps = SwitchProps$1 & ControllerSwitch & {
287
290
  labelPlacement?: 'start' | 'end' | 'top' | 'bottom';
288
291
  };
289
292
 
290
- declare const Switch: ({ name, rules, defaultValue, shouldUnregister, label, labelPlacement, ...rest }: SwitchProps) => JSX.Element;
293
+ declare const Switch: ({ name, rules, defaultValue, shouldUnregister, label, labelPlacement, ...rest }: SwitchProps) => react_jsx_runtime.JSX.Element;
291
294
 
292
295
  type RadioProps = RadioProps$1 & {
293
296
  /**
@@ -308,7 +311,7 @@ type RadioProps = RadioProps$1 & {
308
311
  labelPlacement?: 'start' | 'end' | 'top' | 'bottom';
309
312
  };
310
313
 
311
- declare const RadioButton: ({ label, labelPlacement, ...rest }: RadioProps) => JSX.Element;
314
+ declare const RadioButton: ({ label, labelPlacement, ...rest }: RadioProps) => react_jsx_runtime.JSX.Element;
312
315
 
313
316
  type ControllerRadioGroup = Omit<ControllerProps, 'render' | 'control'>;
314
317
  type RadioGroupProps = RadioGroupProps$1 & ControllerRadioGroup & {
@@ -346,7 +349,7 @@ type RadioGroupProps = RadioGroupProps$1 & ControllerRadioGroup & {
346
349
  orientation?: 'row' | 'column';
347
350
  };
348
351
 
349
- declare const RadioGroup: ({ name, rules, defaultValue, shouldUnregister, label, required, children, orientation, ...rest }: RadioGroupProps) => JSX.Element;
352
+ declare const RadioGroup: ({ name, rules, defaultValue, shouldUnregister, label, required, children, orientation, ...rest }: RadioGroupProps) => react_jsx_runtime.JSX.Element;
350
353
 
351
354
  type ControllerSlider = Omit<ControllerProps, 'render' | 'control'>;
352
355
  type SliderProps = SliderProps$1 & ControllerSlider & {
@@ -368,7 +371,7 @@ type SliderProps = SliderProps$1 & ControllerSlider & {
368
371
  labelPlacement?: 'start' | 'end' | 'top' | 'bottom';
369
372
  };
370
373
 
371
- declare const Slider: ({ name, rules, defaultValue, shouldUnregister, ...rest }: SliderProps) => JSX.Element;
374
+ declare const Slider: ({ name, rules, defaultValue, shouldUnregister, ...rest }: SliderProps) => react_jsx_runtime.JSX.Element;
372
375
 
373
376
  type DatePickerProps = Omit<UseControllerProps, 'control'> & Pick<TextFieldProps$1, 'label' | 'error' | 'helperText' | 'size' | 'fullWidth' | 'variant' | 'autoFocus' | 'placeholder'> & {
374
377
  datePickerProps?: Partial<DatePickerProps$1<any>>;
@@ -386,7 +389,7 @@ type DatePickerProps = Omit<UseControllerProps, 'control'> & Pick<TextFieldProps
386
389
  disabled?: boolean;
387
390
  };
388
391
 
389
- declare const _default$2: react.MemoExoticComponent<({ rules, name, defaultValue, shouldUnregister, datePickerProps, label, required, placeholder, disabled, ...rest }: DatePickerProps) => JSX.Element>;
392
+ declare const _default$2: react.MemoExoticComponent<({ rules, name, defaultValue, shouldUnregister, datePickerProps, label, required, placeholder, disabled, ...rest }: DatePickerProps) => react_jsx_runtime.JSX.Element>;
390
393
 
391
394
  type TimePickerProps = Omit<UseControllerProps, 'control'> & Pick<TextFieldProps$1, 'label' | 'error' | 'helperText' | 'size' | 'fullWidth' | 'variant' | 'autoFocus' | 'placeholder'> & {
392
395
  timePickerProps?: Partial<TimePickerProps$1<any>>;
@@ -404,7 +407,7 @@ type TimePickerProps = Omit<UseControllerProps, 'control'> & Pick<TextFieldProps
404
407
  disabled?: boolean;
405
408
  };
406
409
 
407
- declare const _default$1: react.MemoExoticComponent<({ rules, defaultValue, shouldUnregister, name, required, label, timePickerProps, placeholder, disabled, ...rest }: TimePickerProps) => JSX.Element>;
410
+ declare const _default$1: react.MemoExoticComponent<({ rules, defaultValue, shouldUnregister, name, required, label, timePickerProps, placeholder, disabled, ...rest }: TimePickerProps) => react_jsx_runtime.JSX.Element>;
408
411
 
409
412
  type AutoCompleteOption = {
410
413
  key?: string | number;
@@ -439,6 +442,6 @@ type AutocompleteProps<T = any> = Omit<UseControllerProps, 'control'> & Omit<Aut
439
442
  onChange?: (value: any, values: FieldValues) => void;
440
443
  };
441
444
 
442
- declare const _default: react.MemoExoticComponent<({ name, defaultValue, rules, shouldUnregister, label, required, noOptionsText, placeholder, onInputChange, onChange, ...rest }: AutocompleteProps) => JSX.Element>;
445
+ declare const _default: react.MemoExoticComponent<({ name, defaultValue, rules, shouldUnregister, label, required, noOptionsText, placeholder, onInputChange, onChange, ...rest }: AutocompleteProps) => react_jsx_runtime.JSX.Element>;
443
446
 
444
447
  export { _default as Autocomplete, AutocompleteProps, Checkbox, CheckboxProps, _default$3 as Creatable, CreatableOption, CreatableProps, _default$2 as DatePicker, DatePickerProps, FooterProps, Form, IFormProps, 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 };
package/dist/index.js CHANGED
@@ -1,8 +1,8 @@
1
- "use strict";var R0=Object.create;var o1=Object.defineProperty,I0=Object.defineProperties,q0=Object.getOwnPropertyDescriptor,$0=Object.getOwnPropertyDescriptors,U0=Object.getOwnPropertyNames,Z1=Object.getOwnPropertySymbols,z0=Object.getPrototypeOf,E1=Object.prototype.hasOwnProperty,O1=Object.prototype.propertyIsEnumerable;var z1=(c,l,i)=>l in c?o1(c,l,{enumerable:!0,configurable:!0,writable:!0,value:i}):c[l]=i,a=(c,l)=>{for(var i in l||(l={}))E1.call(l,i)&&z1(c,i,l[i]);if(Z1)for(var i of Z1(l))O1.call(l,i)&&z1(c,i,l[i]);return c},s=(c,l)=>I0(c,$0(l));var g=(c,l)=>{var i={};for(var r in c)E1.call(c,r)&&l.indexOf(r)<0&&(i[r]=c[r]);if(c!=null&&Z1)for(var r of Z1(c))l.indexOf(r)<0&&O1.call(c,r)&&(i[r]=c[r]);return i};var O0=(c,l)=>{for(var i in l)o1(c,i,{get:l[i],enumerable:!0})},_1=(c,l,i,r)=>{if(l&&typeof l=="object"||typeof l=="function")for(let o of U0(l))!E1.call(c,o)&&o!==i&&o1(c,o,{get:()=>l[o],enumerable:!(r=q0(l,o))||r.enumerable});return c};var p1=(c,l,i)=>(i=c!=null?R0(z0(c)):{},_1(l||!c||!c.__esModule?o1(i,"default",{value:c,enumerable:!0}):i,c)),_0=c=>_1(o1({},"__esModule",{value:!0}),c);var h2={};O0(h2,{Autocomplete:()=>G0,Checkbox:()=>s0,Creatable:()=>t0,DatePicker:()=>g0,Form:()=>j1,RadioButton:()=>d0,RadioGroup:()=>m0,Searchable:()=>i0,Select:()=>e0,Slider:()=>Z0,Switch:()=>h0,TextField:()=>l0,TimePicker:()=>T0});module.exports=_0(h2);var N1=require("react"),u1=require("react-hook-form");var G1=require("react/jsx-runtime");function N0(x){var h=x,{children:c,onSubmit:l,style:i,disableDefaultValuesUpdate:r}=h,o=g(h,["children","onSubmit","style","disableDefaultValuesUpdate"]);let t=(0,u1.useForm)(o);(0,N1.useEffect)(()=>{r||t.reset(o.defaultValues)},[o.defaultValues,t.reset]);let m=()=>typeof c=="function"?c(s(a({},t),{onSubmit:t.handleSubmit(n=>l(n,t))})):c;return(0,G1.jsx)(u1.FormProvider,s(a({},t),{children:(0,G1.jsx)("form",{onSubmit:n=>{n.preventDefault(),n.stopPropagation(),t.handleSubmit(d=>l(d,t))()},style:i,children:m()})}))}var j1=N0;var f1=require("react"),M1=require("react-hook-form"),j=require("@mui/material");var W1={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"},Y1={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 N={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 K1={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 D1={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 X=p1(require("@s_mart/masks"));var B1=require("@mui/material"),Q1=require("@s_mart/utils"),r1=require("react/jsx-runtime"),b=({label:c,required:l,regular:i})=>(0,r1.jsxs)("span",{style:{display:"flex",alignItems:"center",gap:(0,Q1.toRem)(2)},children:[(0,r1.jsx)(B1.Typography,{variant:"caption",fontWeight:i?400:700,style:{display:"flex",alignItems:"center"},children:c}),l&&(0,r1.jsx)(B1.Typography,{variant:"caption",fontWeight:900,color:"error",children:"*"})]});var J1=require("react-hook-form"),X1=require("@s_mart/core");var E=(c,l)=>{var i,r,o,x,h;if(c[l])return c[l];if(l.includes("[")){let[t,m]=l.split("["),[n,d]=m.split("].");return(r=(i=c[t])==null?void 0:i[n])==null?void 0:r[d]}if(l.includes(".")){let[t,m,n]=l.split(".");return n?(h=(x=c[t])==null?void 0:x[m])==null?void 0:h[n]:(o=c[t])==null?void 0:o[m]}};var c0=require("react/jsx-runtime"),w=({name:c})=>{var r;let l=(0,J1.useFormContext)(),i=E((r=l==null?void 0:l.formState)==null?void 0:r.errors,c);return i?(0,c0.jsx)(X1.Indicator,{severity:"error",children:i==null?void 0:i.message}):null};var n1=require("@s_mart/core");var D=require("react/jsx-runtime"),j0=C=>{var k=C,{name:c,rules:l,defaultValue:i,shouldUnregister:r,label:o,required:x,mask:h,variant:t="outlined",info:m,parse:n,format:d,onInputChange:f}=k,M=g(k,["name","rules","defaultValue","shouldUnregister","label","required","mask","variant","info","parse","format","onInputChange"]);let F=(0,M1.useFormContext)();if(!F)throw new Error("Para usar o <TextField /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let[v,u]=(0,f1.useState)(!1),P=H=>{var e;let V=H;return d&&(V=d(H)),h?(e=X==null?void 0:X[h])==null?void 0:e.format(V):V},Z=H=>{var e;let V=H;return n&&(V=n(H)),h?(e=X==null?void 0:X[h])==null?void 0:e.parse(V):V},S=H=>{if(!H||h!=="porcentagem")return;H==null||H.stopPropagation();let V=(H==null?void 0:H.target).value;if(V){let e=String(V);if(e.length>0){let T=e.indexOf("%");T>-1&&(H.currentTarget.selectionEnd=T)}}},G=E(F.formState.errors,c);return(0,D.jsx)(M1.Controller,{control:F.control,name:c,rules:l,defaultValue:i,shouldUnregister:r,render:({field:{value:H,onChange:V,ref:e}})=>(0,D.jsxs)(j.Grid,{display:"flex",flexDirection:"column",children:[(0,D.jsxs)("div",{style:{display:"flex"},children:[o&&(0,D.jsx)(j.Grid,{item:!0,children:(0,D.jsx)(b,{label:o,required:x})}),m&&(0,D.jsx)(j.Grid,{item:!0,children:(0,D.jsx)(n1.Tooltip,{title:m,placement:"top",children:(0,D.jsx)("div",{style:{width:"fit-content"},children:(0,D.jsx)(n1.LIcon,{icon:N,color:"#757575"})})})})]}),(0,D.jsx)(j.TextField,s(a({variant:t,defaultValue:i,value:P(H||""),onChange:T=>{var a1;let v1=Z((a1=T==null?void 0:T.target)==null?void 0:a1.value);V(v1),f==null||f(v1,F.watch())},error:!!G},M),{type:M.type==="password"?v?"text":"password":M.type,autoComplete:M.autoComplete||"off",InputProps:a({onKeyDown:S,inputRef:e,endAdornment:M.type==="password"&&(0,D.jsx)(j.InputAdornment,{position:"end",onClick:()=>u(!v),style:{cursor:"pointer"},children:(0,D.jsx)(n1.LIcon,{icon:v?W1:Y1,size:"24px",removeMargin:!0})})},M.InputProps)}),c),(0,D.jsx)(w,{name:c})]})})},l0=(0,f1.memo)(j0);var H1=require("react"),V1=require("react-hook-form"),c1=require("@s_mart/core"),B=require("@mui/material");var L=require("react/jsx-runtime"),W0=k=>{var F=k,{name:c,rules:l,defaultValue:i,shouldUnregister:r,label:o,required:x,options:h,placeholder:t,disableOnChangeForm:m=!1,multiple:n,info:d,footer:f,onChange:M}=F,C=g(F,["name","rules","defaultValue","shouldUnregister","label","required","options","placeholder","disableOnChangeForm","multiple","info","footer","onChange"]);let v=(0,V1.useFormContext)(),{palette:u}=(0,B.useTheme)(),[P,Z]=(0,H1.useState)(!1);if(!v)throw new Error("Para usar o <Select /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let S=E(v.formState.errors,c);return console.warn=()=>{},(0,L.jsx)(V1.Controller,{control:v.control,name:c,rules:l,defaultValue:i||"",shouldUnregister:r,render:({field:{value:G,onChange:H,ref:V}})=>(0,L.jsxs)(B.Grid,{display:"flex",flexDirection:"column",children:[(0,L.jsxs)("div",{style:{display:"flex"},children:[o&&(0,L.jsx)(B.Grid,{item:!0,children:(0,L.jsx)(b,{label:o,required:x})}),d&&(0,L.jsx)(B.Grid,{item:!0,children:(0,L.jsx)(c1.Tooltip,{title:d,placement:"top",children:(0,L.jsx)("div",{style:{width:"fit-content"},children:(0,L.jsx)(c1.LIcon,{icon:N,color:"#757575"})})})})]}),(0,L.jsxs)(B.Select,s(a({open:P,onOpen:()=>Z(!0),onClose:()=>Z(!1),displayEmpty:!!t,variant:"outlined",autoComplete:"off",value:G?G||"":n?[]:"",renderValue:e=>{if(e.label)return e.label;if(t)return(0,L.jsx)("p",{style:{color:u.grey[400]},children:t})},multiple:n,onChange:e=>{!m&&H(e.target.value),M&&M(e.target.value,v.watch())},error:!!S,size:C.size||"medium",inputRef:V},C),{children:[t&&(0,L.jsx)(B.MenuItem,{disabled:!0,value:"",children:(0,L.jsx)("p",{style:{color:u.grey[400]},children:t})}),h==null?void 0:h.map((e,T)=>(0,L.jsx)(B.MenuItem,{value:e,children:(0,L.jsxs)(B.Grid,{container:!0,direction:"column",children:[(0,L.jsx)(B.Grid,{item:!0,children:e.label}),e.afterLabel&&(0,L.jsx)(B.Grid,{item:!0,children:e.afterLabel})]})},T)),f&&[(0,L.jsx)(B.Grid,{px:2,py:1,children:(0,L.jsx)(c1.Divider,{})},"footer-divider"),(0,L.jsx)("div",{children:f({closeSelect:()=>Z(!1)})},"footer-content")]]}),c),(0,L.jsx)(w,{name:c})]})})},e0=(0,H1.memo)(W0);var y1=require("react"),x1=require("react-hook-form"),Q=require("@s_mart/core");var I=require("@mui/material");var p=require("react/jsx-runtime"),R1=require("react"),Y0=v=>{var u=v,{name:c,rules:l,defaultValue:i,shouldUnregister:r,label:o,required:x,options:h,textFieldProps:t,noOptionsText:m,footer:n,multiple:d,info:f,placeholder:M,onChange:C,onInputChange:k}=u,F=g(u,["name","rules","defaultValue","shouldUnregister","label","required","options","textFieldProps","noOptionsText","footer","multiple","info","placeholder","onChange","onInputChange"]);let P=(0,x1.useFormContext)();if(!P)throw new Error("Para usar o <Searchable /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let Z=E(P.formState.errors,c);return console.warn=()=>{},(0,p.jsx)(x1.Controller,{control:P.control,name:c,rules:l,defaultValue:i,shouldUnregister:r,render:({field:{onChange:S,value:G,ref:H}})=>(0,p.jsxs)(I.Grid,{display:"flex",flexDirection:"column",children:[(0,p.jsxs)("div",{style:{display:"flex"},children:[o&&(0,p.jsx)(I.Grid,{item:!0,children:(0,p.jsx)(b,{label:o,required:x})}),f&&(0,p.jsx)(I.Grid,{item:!0,children:(0,p.jsx)(Q.Tooltip,{title:f,placement:"top",children:(0,p.jsx)("div",{style:{width:"fit-content"},children:(0,p.jsx)(Q.LIcon,{icon:N,color:"#757575"})})})})]}),(0,p.jsx)(I.Autocomplete,s(a({onChange:(V,e)=>{S(e),C==null||C(e,P.watch())},onInputChange:(V,e,T)=>{T==="input"&&setTimeout(()=>{k==null||k(e,P.watch())},0)},value:G||(d?[]:null),options:h,multiple:d,noOptionsText:(0,p.jsxs)(p.Fragment,{children:[m||"Nenhum resultado encontrado",n?(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(I.Grid,{py:1,children:(0,p.jsx)(Q.Divider,{})}),n]}):null]}),isOptionEqualToValue:(V,e)=>typeof V=="string"&&typeof e=="string"?V===e:typeof V=="object"&&typeof e=="object"?V.value===e.value:!1,renderOption:(V,e)=>typeof e=="object"?(0,R1.createElement)("li",s(a({},V),{key:e.key||e.value}),(0,p.jsxs)(I.Grid,{container:!0,direction:"column",children:[(0,p.jsx)(I.Grid,{item:!0,children:e.label}),e.afterLabel&&(0,p.jsx)(I.Grid,{item:!0,children:e.afterLabel})]})):(0,R1.createElement)("li",s(a({},V),{key:e}),e),ListboxComponent:(0,y1.forwardRef)(function(e,T){return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)("ul",s(a({},e),{ref:T})),!!n&&(0,p.jsx)("div",s(a({},e),{children:(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(I.Grid,{px:2,py:1,children:(0,p.jsx)(Q.Divider,{})}),n]})}),"searchable-footer")]})})},F),{renderInput:V=>(0,p.jsx)(I.TextField,s(a(a({error:!!Z,placeholder:M},V),t),{inputRef:H}))}),c),(0,p.jsx)(w,{name:c})]})})},i0=(0,y1.memo)(Y0);var n0=require("react"),g1=require("react-hook-form"),q=require("@mui/material");var t1=require("@s_mart/utils"),a0=p1(require("@emotion/styled")),I1=require("@emotion/react"),o0=I1.css`
1
+ "use strict";var I0=Object.create;var o1=Object.defineProperty,q0=Object.defineProperties,$0=Object.getOwnPropertyDescriptor,z0=Object.getOwnPropertyDescriptors,U0=Object.getOwnPropertyNames,Z1=Object.getOwnPropertySymbols,O0=Object.getPrototypeOf,E1=Object.prototype.hasOwnProperty,O1=Object.prototype.propertyIsEnumerable;var U1=(c,l,i)=>l in c?o1(c,l,{enumerable:!0,configurable:!0,writable:!0,value:i}):c[l]=i,a=(c,l)=>{for(var i in l||(l={}))E1.call(l,i)&&U1(c,i,l[i]);if(Z1)for(var i of Z1(l))O1.call(l,i)&&U1(c,i,l[i]);return c},t=(c,l)=>q0(c,z0(l));var g=(c,l)=>{var i={};for(var r in c)E1.call(c,r)&&l.indexOf(r)<0&&(i[r]=c[r]);if(c!=null&&Z1)for(var r of Z1(c))l.indexOf(r)<0&&O1.call(c,r)&&(i[r]=c[r]);return i};var _0=(c,l)=>{for(var i in l)o1(c,i,{get:l[i],enumerable:!0})},_1=(c,l,i,r)=>{if(l&&typeof l=="object"||typeof l=="function")for(let o of U0(l))!E1.call(c,o)&&o!==i&&o1(c,o,{get:()=>l[o],enumerable:!(r=$0(l,o))||r.enumerable});return c};var p1=(c,l,i)=>(i=c!=null?I0(O0(c)):{},_1(l||!c||!c.__esModule?o1(i,"default",{value:c,enumerable:!0}):i,c)),N0=c=>_1(o1({},"__esModule",{value:!0}),c);var d2={};_0(d2,{Autocomplete:()=>D0,Checkbox:()=>h0,Creatable:()=>s0,DatePicker:()=>F0,Form:()=>W1,RadioButton:()=>m0,RadioGroup:()=>v0,Searchable:()=>a0,Select:()=>i0,Slider:()=>p0,Switch:()=>d0,TextField:()=>e0,TimePicker:()=>E0});module.exports=N0(d2);var N1=require("react"),u1=require("react-hook-form"),j1=require("@hookform/resolvers/zod");var G1=require("react/jsx-runtime");function j0(x){var h=x,{children:c,onSubmit:l,style:i,disableDefaultValuesUpdate:r}=h,o=g(h,["children","onSubmit","style","disableDefaultValuesUpdate"]);let s=(0,u1.useForm)(t(a({},o),{resolver:o.schema&&(0,j1.zodResolver)(o.schema)}));(0,N1.useEffect)(()=>{r||s.reset(o.defaultValues)},[o.defaultValues,s.reset]);let m=()=>typeof c=="function"?c(t(a({},s),{onSubmit:s.handleSubmit(n=>l(n,s))})):c;return(0,G1.jsx)(u1.FormProvider,t(a({},s),{children:(0,G1.jsx)("form",{onSubmit:n=>{n.preventDefault(),n.stopPropagation(),s.handleSubmit(d=>l(d,s))()},style:i,children:m()})}))}var W1=j0;var f1=require("react"),M1=require("react-hook-form"),j=require("@mui/material");var Y1={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"},K1={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 N={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 D1={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 X=p1(require("@s_mart/masks"));var B1=require("@mui/material"),J1=require("@s_mart/utils"),r1=require("react/jsx-runtime"),b=({label:c,required:l,regular:i})=>(0,r1.jsxs)("span",{style:{display:"flex",alignItems:"center",gap:(0,J1.toRem)(2)},children:[(0,r1.jsx)(B1.Typography,{variant:"caption",fontWeight:i?400:700,style:{display:"flex",alignItems:"center"},children:c}),l&&(0,r1.jsx)(B1.Typography,{variant:"caption",fontWeight:900,color:"error",children:"*"})]});var X1=require("react-hook-form"),c0=require("@s_mart/core");var E=(c,l)=>{var i,r,o,x,h;if(c[l])return c[l];if(l.includes("[")){let[s,m]=l.split("["),[n,d]=m.split("].");return(r=(i=c[s])==null?void 0:i[n])==null?void 0:r[d]}if(l.includes(".")){let[s,m,n]=l.split(".");return n?(h=(x=c[s])==null?void 0:x[m])==null?void 0:h[n]:(o=c[s])==null?void 0:o[m]}};var l0=require("react/jsx-runtime"),w=({name:c})=>{var r;let l=(0,X1.useFormContext)(),i=E((r=l==null?void 0:l.formState)==null?void 0:r.errors,c);return i?(0,l0.jsx)(c0.Indicator,{severity:"error",children:i==null?void 0:i.message}):null};var n1=require("@s_mart/core");var D=require("react/jsx-runtime"),W0=C=>{var k=C,{name:c,rules:l,defaultValue:i,shouldUnregister:r,label:o,required:x,mask:h,variant:s="outlined",info:m,parse:n,format:d,onInputChange:f}=k,M=g(k,["name","rules","defaultValue","shouldUnregister","label","required","mask","variant","info","parse","format","onInputChange"]);let F=(0,M1.useFormContext)();if(!F)throw new Error("Para usar o <TextField /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let[v,u]=(0,f1.useState)(!1),P=H=>{var e;let V=H;return d&&(V=d(H)),h?(e=X==null?void 0:X[h])==null?void 0:e.format(V):V},Z=H=>{var e;let V=H;return n&&(V=n(H)),h?(e=X==null?void 0:X[h])==null?void 0:e.parse(V):V},S=H=>{if(!H||h!=="porcentagem")return;H==null||H.stopPropagation();let V=(H==null?void 0:H.target).value;if(V){let e=String(V);if(e.length>0){let T=e.indexOf("%");T>-1&&(H.currentTarget.selectionEnd=T)}}},G=E(F.formState.errors,c);return(0,D.jsx)(M1.Controller,{control:F.control,name:c,rules:l,defaultValue:i,shouldUnregister:r,render:({field:{value:H,onChange:V,ref:e}})=>(0,D.jsxs)(j.Grid,{display:"flex",flexDirection:"column",children:[(0,D.jsxs)("div",{style:{display:"flex"},children:[o&&(0,D.jsx)(j.Grid,{item:!0,children:(0,D.jsx)(b,{label:o,required:x})}),m&&(0,D.jsx)(j.Grid,{item:!0,children:(0,D.jsx)(n1.Tooltip,{title:m,placement:"top",children:(0,D.jsx)("div",{style:{width:"fit-content"},children:(0,D.jsx)(n1.LIcon,{icon:N,color:"#757575"})})})})]}),(0,D.jsx)(j.TextField,t(a({variant:s,defaultValue:i,value:P(H||""),onChange:T=>{var a1;let v1=Z((a1=T==null?void 0:T.target)==null?void 0:a1.value);V(v1),f==null||f(v1,F.watch())},error:!!G},M),{type:M.type==="password"?v?"text":"password":M.type,autoComplete:M.autoComplete||"off",InputProps:a({onKeyDown:S,inputRef:e,endAdornment:M.type==="password"&&(0,D.jsx)(j.InputAdornment,{position:"end",onClick:()=>u(!v),style:{cursor:"pointer"},children:(0,D.jsx)(n1.LIcon,{icon:v?Y1:K1,size:"24px",removeMargin:!0})})},M.InputProps)}),c),(0,D.jsx)(w,{name:c})]})})},e0=(0,f1.memo)(W0);var H1=require("react"),V1=require("react-hook-form"),c1=require("@s_mart/core"),B=require("@mui/material");var L=require("react/jsx-runtime"),Y0=k=>{var F=k,{name:c,rules:l,defaultValue:i,shouldUnregister:r,label:o,required:x,options:h,placeholder:s,disableOnChangeForm:m=!1,multiple:n,info:d,footer:f,onChange:M}=F,C=g(F,["name","rules","defaultValue","shouldUnregister","label","required","options","placeholder","disableOnChangeForm","multiple","info","footer","onChange"]);let v=(0,V1.useFormContext)(),{palette:u}=(0,B.useTheme)(),[P,Z]=(0,H1.useState)(!1);if(!v)throw new Error("Para usar o <Select /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let S=E(v.formState.errors,c);return console.warn=()=>{},(0,L.jsx)(V1.Controller,{control:v.control,name:c,rules:l,defaultValue:i,shouldUnregister:r,render:({field:{value:G,onChange:H,ref:V}})=>(0,L.jsxs)(B.Grid,{display:"flex",flexDirection:"column",children:[(0,L.jsxs)("div",{style:{display:"flex"},children:[o&&(0,L.jsx)(B.Grid,{item:!0,children:(0,L.jsx)(b,{label:o,required:x})}),d&&(0,L.jsx)(B.Grid,{item:!0,children:(0,L.jsx)(c1.Tooltip,{title:d,placement:"top",children:(0,L.jsx)("div",{style:{width:"fit-content"},children:(0,L.jsx)(c1.LIcon,{icon:N,color:"#757575"})})})})]}),(0,L.jsxs)(B.Select,t(a({open:P,onOpen:()=>Z(!0),onClose:()=>Z(!1),displayEmpty:!!s,variant:"outlined",autoComplete:"off",value:G?G||"":n?[]:"",renderValue:e=>{if(e.label)return e.label;if(s)return(0,L.jsx)("p",{style:{color:u.grey[400]},children:s})},multiple:n,onChange:e=>{!m&&H(e.target.value),M&&M(e.target.value,v.watch())},error:!!S,size:C.size||"medium",inputRef:V},C),{children:[s&&(0,L.jsx)(B.MenuItem,{disabled:!0,value:"",children:(0,L.jsx)("p",{style:{color:u.grey[400]},children:s})}),h==null?void 0:h.map((e,T)=>(0,L.jsx)(B.MenuItem,{value:e,children:(0,L.jsxs)(B.Grid,{container:!0,direction:"column",children:[(0,L.jsx)(B.Grid,{item:!0,children:e.label}),e.afterLabel&&(0,L.jsx)(B.Grid,{item:!0,children:e.afterLabel})]})},T)),f&&[(0,L.jsx)(B.Grid,{px:2,py:1,children:(0,L.jsx)(c1.Divider,{})},"footer-divider"),(0,L.jsx)("div",{children:f({closeSelect:()=>Z(!1)})},"footer-content")]]}),c),(0,L.jsx)(w,{name:c})]})})},i0=(0,H1.memo)(Y0);var y1=require("react"),x1=require("react-hook-form"),Q=require("@s_mart/core");var I=require("@mui/material");var p=require("react/jsx-runtime"),R1=require("react"),K0=v=>{var u=v,{name:c,rules:l,defaultValue:i,shouldUnregister:r,label:o,required:x,options:h,textFieldProps:s,noOptionsText:m,footer:n,multiple:d,info:f,placeholder:M,onChange:C,onInputChange:k}=u,F=g(u,["name","rules","defaultValue","shouldUnregister","label","required","options","textFieldProps","noOptionsText","footer","multiple","info","placeholder","onChange","onInputChange"]);let P=(0,x1.useFormContext)();if(!P)throw new Error("Para usar o <Searchable /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let Z=E(P.formState.errors,c);return console.warn=()=>{},(0,p.jsx)(x1.Controller,{control:P.control,name:c,rules:l,defaultValue:i,shouldUnregister:r,render:({field:{onChange:S,value:G,ref:H}})=>(0,p.jsxs)(I.Grid,{display:"flex",flexDirection:"column",children:[(0,p.jsxs)("div",{style:{display:"flex"},children:[o&&(0,p.jsx)(I.Grid,{item:!0,children:(0,p.jsx)(b,{label:o,required:x})}),f&&(0,p.jsx)(I.Grid,{item:!0,children:(0,p.jsx)(Q.Tooltip,{title:f,placement:"top",children:(0,p.jsx)("div",{style:{width:"fit-content"},children:(0,p.jsx)(Q.LIcon,{icon:N,color:"#757575"})})})})]}),(0,p.jsx)(I.Autocomplete,t(a({onChange:(V,e)=>{S(e),C==null||C(e,P.watch())},onInputChange:(V,e,T)=>{T==="input"&&setTimeout(()=>{k==null||k(e,P.watch())},0)},value:G||(d?[]:null),options:h,multiple:d,noOptionsText:(0,p.jsxs)(p.Fragment,{children:[m||"Nenhum resultado encontrado",n?(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(I.Grid,{py:1,children:(0,p.jsx)(Q.Divider,{})}),n]}):null]}),isOptionEqualToValue:(V,e)=>typeof V=="string"&&typeof e=="string"?V===e:typeof V=="object"&&typeof e=="object"?V.value===e.value:!1,renderOption:(V,e)=>typeof e=="object"?(0,R1.createElement)("li",t(a({},V),{key:e.key||e.value}),(0,p.jsxs)(I.Grid,{container:!0,direction:"column",children:[(0,p.jsx)(I.Grid,{item:!0,children:e.label}),e.afterLabel&&(0,p.jsx)(I.Grid,{item:!0,children:e.afterLabel})]})):(0,R1.createElement)("li",t(a({},V),{key:e}),e),ListboxComponent:(0,y1.forwardRef)(function(e,T){return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)("ul",t(a({},e),{ref:T})),!!n&&(0,p.jsx)("div",t(a({},e),{children:(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(I.Grid,{px:2,py:1,children:(0,p.jsx)(Q.Divider,{})}),n]})}),"searchable-footer")]})})},F),{renderInput:V=>(0,p.jsx)(I.TextField,t(a(a({error:!!Z,placeholder:M},V),s),{inputRef:H}))}),c),(0,p.jsx)(w,{name:c})]})})},a0=(0,y1.memo)(K0);var t0=require("react"),g1=require("react-hook-form"),q=require("@mui/material");var t1=require("@s_mart/utils"),o0=p1(require("@emotion/styled")),I1=require("@emotion/react"),r0=I1.css`
2
2
  display: flex;
3
3
  align-items: center;
4
4
  justify-content: center;
5
- `,K0=c=>I1.css`
5
+ `,Q0=c=>I1.css`
6
6
  .MuiAutocomplete-endAdornment {
7
7
  position: relative;
8
8
  right: 0;
@@ -10,7 +10,7 @@
10
10
 
11
11
  .creatable,
12
12
  .editable {
13
- ${o0}
13
+ ${r0}
14
14
 
15
15
  .divider {
16
16
  width: 1px;
@@ -36,37 +36,37 @@
36
36
  }
37
37
  }
38
38
  }
39
- `,r0=a0.default.div`
39
+ `,n0=o0.default.div`
40
40
  display: flex;
41
41
 
42
42
  div.endAdornments {
43
43
  position: absolute;
44
44
  right: 0;
45
45
 
46
- ${o0}
46
+ ${r0}
47
47
  }
48
48
 
49
- ${({hideAddButton:c,theme:l})=>!c&&K0(l)}
50
- `;var O=require("@s_mart/core");var F1=require("lodash"),q1=require("@s_mart/utils");var y=require("react/jsx-runtime"),$1=require("react"),Q0=P=>{var Z=P,{name:c,rules:l,defaultValue:i,shouldUnregister:r,label:o,required:x,options:h,editable:t,onEditOption:m,onCreateOption:n,textFieldProps:d,hideAddButton:f,multiple:M,info:C,onChange:k,onInputChange:F,placeholder:v}=Z,u=g(Z,["name","rules","defaultValue","shouldUnregister","label","required","options","editable","onEditOption","onCreateOption","textFieldProps","hideAddButton","multiple","info","onChange","onInputChange","placeholder"]);let S=(0,g1.useFormContext)();if(!S)throw new Error("Para usar o <Creatable /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let G=E(S.formState.errors,c);console.warn=()=>{};let H=e=>{n?n(e):console.error("onCreateOption n\xE3o foi definido")},V=e=>{m?m(e):console.error("onEditOption n\xE3o foi definido")};return(0,y.jsx)(g1.Controller,{control:S.control,name:c,rules:l,defaultValue:i,shouldUnregister:r,render:({field:{value:e,onChange:T,ref:v1}})=>{let a1=(e==null?void 0:e.label)||(e==null?void 0:e.value)||e;return(0,y.jsxs)(q.Grid,{display:"flex",flexDirection:"column",children:[(0,y.jsxs)("div",{style:{display:"flex"},children:[o&&(0,y.jsx)(q.Grid,{item:!0,children:(0,y.jsx)(b,{label:o,required:x})}),C&&(0,y.jsx)(q.Grid,{item:!0,children:(0,y.jsx)(O.Tooltip,{title:C,placement:"top",children:(0,y.jsx)("div",{style:{width:"fit-content"},children:(0,y.jsx)(O.LIcon,{icon:N,color:"#757575"})})})})]}),(0,y.jsx)(r0,{hideAddButton:f,children:(0,y.jsx)(q.Autocomplete,s(a({fullWidth:!0,onChange:(R,A)=>{T(A),k==null||k(A,S.watch())},onInputChange:(R,A,B0)=>{B0==="input"&&(T(A),setTimeout(()=>{F==null||F(A,S.watch())},0))},options:h,value:e||(M?[]:null),multiple:M,noOptionsText:(0,y.jsxs)(O.Button,{sx:{justifyContent:"flex-start",padding:`${(0,q1.toRem)(6)} ${(0,q1.toRem)(-16)}`,margin:0},fullWidth:!0,onClick:()=>H(e),variant:"text",startIcon:(0,y.jsx)(O.LIcon,{icon:D1}),children:["Adicionar ",a1&&`"${a1}"`]}),isOptionEqualToValue:(R,A)=>A?typeof R=="string"&&typeof A=="string"?R===A:typeof R=="object"&&typeof A=="object"?R.value===A.value:typeof R=="object"&&typeof A=="string":!1,renderOption:(R,A)=>typeof A=="object"?(0,$1.createElement)("li",s(a({},R),{key:A.key||A.value}),(0,y.jsxs)(q.Grid,{container:!0,direction:"column",children:[(0,y.jsx)(q.Grid,{item:!0,children:A.label}),A.afterLabel&&(0,y.jsx)(q.Grid,{item:!0,children:A.afterLabel})]})):(0,$1.createElement)("li",s(a({},R),{key:A}),A)},u),{renderInput:R=>(0,y.jsx)(q.TextField,a(s(a({placeholder:v},R),{error:!!G,onChange:T,InputProps:s(a({},R.InputProps),{inputRef:v1,endAdornment:f?void 0:(0,y.jsxs)("div",{className:"endAdornments",children:[R.InputProps.endAdornment,t&&(0,F1.isObject)(e)&&!(0,F1.isEmpty)(e)?(0,y.jsxs)("div",{className:"editable",children:[(0,y.jsx)("div",{className:"divider"}),(0,y.jsx)("div",{className:"button",onClick:()=>V(e),children:(0,y.jsx)(O.LIcon,{icon:K1,size:"24px",removeMargin:!0})})]}):null,(0,y.jsxs)("div",{className:"creatable",children:[(0,y.jsx)("div",{className:"divider"}),(0,y.jsx)("div",{className:"button",onClick:()=>H(e),children:(0,y.jsx)(O.LIcon,{icon:D1,size:"24px",removeMargin:!0})})]})]})})}),d))}),c)}),(0,y.jsx)(w,{name:c})]})}})},t0=(0,n0.memo)(Q0);var L1=require("react-hook-form"),l1=require("@mui/material");var W=require("react/jsx-runtime"),J0=m=>{var n=m,{name:c,rules:l,defaultValue:i,shouldUnregister:r,label:o,labelPlacement:x,required:h}=n,t=g(n,["name","rules","defaultValue","shouldUnregister","label","labelPlacement","required"]);let d=(0,L1.useFormContext)();if(!d)throw new Error("Para usar o <Checkbox /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");return(0,W.jsx)(L1.Controller,{control:d.control,name:c,rules:l,defaultValue:i,shouldUnregister:r,render:({field:{value:f,onChange:M}})=>(0,W.jsxs)(l1.Grid,{display:"flex",flexDirection:"column",children:[(0,W.jsx)(l1.FormControlLabel,{control:(0,W.jsx)(l1.Checkbox,a({checked:!!f,value:f!=null?f:"",defaultValue:f,onChange:M},t),c),label:(0,W.jsx)(b,{label:o,required:h,regular:!0}),labelPlacement:x||"end"}),(0,W.jsx)(w,{name:c})]})})},s0=J0;var C1=require("react-hook-form"),e1=require("@mui/material");var Y=require("react/jsx-runtime"),X0=t=>{var m=t,{name:c,rules:l,defaultValue:i,shouldUnregister:r,label:o,labelPlacement:x}=m,h=g(m,["name","rules","defaultValue","shouldUnregister","label","labelPlacement"]);let n=(0,C1.useFormContext)();if(!n)throw new Error("Para usar o <Switch /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");return(0,Y.jsx)(C1.Controller,{control:n.control,name:c,rules:l,defaultValue:i,shouldUnregister:r,render:({field:{value:d,onChange:f}})=>(0,Y.jsxs)(e1.Grid,{display:"flex",flexDirection:"column",children:[(0,Y.jsx)(e1.FormControlLabel,{control:(0,Y.jsx)(e1.Switch,a({value:d!=null?d:"",checked:d!=null?d:!1,defaultValue:d,onChange:f},h),c),label:(0,Y.jsx)(b,{label:o}),labelPlacement:x||"end"}),(0,Y.jsx)(w,{name:c})]})})},h0=X0;var i1=require("@mui/material");var s1=require("react/jsx-runtime"),c2=r=>{var o=r,{label:c,labelPlacement:l}=o,i=g(o,["label","labelPlacement"]);return(0,s1.jsx)(i1.Grid,{display:"flex",flexDirection:"column",children:(0,s1.jsx)(i1.FormControlLabel,{control:(0,s1.jsx)(i1.Radio,a({},i)),label:(0,s1.jsx)(b,{label:c}),labelPlacement:l||"end"})})},d0=c2;var b1=require("react-hook-form"),k1=require("@mui/material");var J=require("react/jsx-runtime"),l2=n=>{var d=n,{name:c,rules:l,defaultValue:i,shouldUnregister:r,label:o,required:x,children:h,orientation:t="row"}=d,m=g(d,["name","rules","defaultValue","shouldUnregister","label","required","children","orientation"]);let f=(0,b1.useFormContext)();if(!f)throw new Error("Para usar o <RadioGroup /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");return(0,J.jsx)(b1.Controller,{control:f.control,name:c,rules:l,defaultValue:i,shouldUnregister:r,render:({field:{value:M,onChange:C}})=>(0,J.jsxs)(k1.Grid,{display:"flex",flexDirection:"column",children:[o&&(0,J.jsx)(b,{label:o,required:x}),(0,J.jsx)(k1.RadioGroup,s(a({value:M||"",onChange:C,name:c},m),{style:{display:"flex",flexDirection:t},children:h}),c),(0,J.jsx)(w,{name:c})]})})},m0=l2;var P1=require("react-hook-form"),v0=require("@mui/material");var U1=require("react/jsx-runtime"),e2=x=>{var h=x,{name:c,rules:l,defaultValue:i,shouldUnregister:r}=h,o=g(h,["name","rules","defaultValue","shouldUnregister"]);let t=(0,P1.useFormContext)();if(!t)throw new Error("Para usar o <Slider /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");return(0,U1.jsx)(P1.Controller,{control:t.control,name:c,rules:l,defaultValue:i,shouldUnregister:r,render:({field:{value:m,onChange:n}})=>(0,U1.jsx)(v0.Slider,a({value:m||(o==null?void 0:o.min)||0,onChange:n,valueLabelDisplay:"auto"},o),c)})},Z0=e2;var f0=require("react"),A1=require("react-hook-form"),M0=require("@s_mart/core"),h1=require("@s_mart/rules"),H0=require("@mui/material"),V0=require("@mui/x-date-pickers/DatePicker"),y0=require("@mui/x-date-pickers/AdapterDayjs"),x0=require("@mui/x-date-pickers/LocalizationProvider");var $=require("@s_mart/utils"),p0=p1(require("@emotion/styled")),i2=c=>{switch(c){case"small":return(0,$.toRem)(16);default:case"medium":return(0,$.toRem)(20);case"large":return(0,$.toRem)(24)}},a2=c=>{switch(c){case"small":return`${(0,$.toRem)(2)} ${(0,$.toRem)(8)}`;default:case"medium":return`${(0,$.toRem)(6)} ${(0,$.toRem)(8)}`;case"large":return`${(0,$.toRem)(10)}`}},u0=p0.default.div`
49
+ ${({hideAddButton:c,theme:l})=>!c&&Q0(l)}
50
+ `;var O=require("@s_mart/core");var F1=require("lodash"),q1=require("@s_mart/utils");var y=require("react/jsx-runtime"),$1=require("react"),J0=P=>{var Z=P,{name:c,rules:l,defaultValue:i,shouldUnregister:r,label:o,required:x,options:h,editable:s,onEditOption:m,onCreateOption:n,textFieldProps:d,hideAddButton:f,multiple:M,info:C,onChange:k,onInputChange:F,placeholder:v}=Z,u=g(Z,["name","rules","defaultValue","shouldUnregister","label","required","options","editable","onEditOption","onCreateOption","textFieldProps","hideAddButton","multiple","info","onChange","onInputChange","placeholder"]);let S=(0,g1.useFormContext)();if(!S)throw new Error("Para usar o <Creatable /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let G=E(S.formState.errors,c);console.warn=()=>{};let H=e=>{n?n(e):console.error("onCreateOption n\xE3o foi definido")},V=e=>{m?m(e):console.error("onEditOption n\xE3o foi definido")};return(0,y.jsx)(g1.Controller,{control:S.control,name:c,rules:l,defaultValue:i,shouldUnregister:r,render:({field:{value:e,onChange:T,ref:v1}})=>{let a1=(e==null?void 0:e.label)||(e==null?void 0:e.value)||e;return(0,y.jsxs)(q.Grid,{display:"flex",flexDirection:"column",children:[(0,y.jsxs)("div",{style:{display:"flex"},children:[o&&(0,y.jsx)(q.Grid,{item:!0,children:(0,y.jsx)(b,{label:o,required:x})}),C&&(0,y.jsx)(q.Grid,{item:!0,children:(0,y.jsx)(O.Tooltip,{title:C,placement:"top",children:(0,y.jsx)("div",{style:{width:"fit-content"},children:(0,y.jsx)(O.LIcon,{icon:N,color:"#757575"})})})})]}),(0,y.jsx)(n0,{hideAddButton:f,children:(0,y.jsx)(q.Autocomplete,t(a({fullWidth:!0,onChange:(R,A)=>{T(A),k==null||k(A,S.watch())},onInputChange:(R,A,R0)=>{R0==="input"&&(T(A),setTimeout(()=>{F==null||F(A,S.watch())},0))},options:h,value:e||(M?[]:null),multiple:M,noOptionsText:(0,y.jsxs)(O.Button,{sx:{justifyContent:"flex-start",padding:`${(0,q1.toRem)(6)} ${(0,q1.toRem)(-16)}`,margin:0},fullWidth:!0,onClick:()=>H(e),variant:"text",startIcon:(0,y.jsx)(O.LIcon,{icon:D1}),children:["Adicionar ",a1&&`"${a1}"`]}),isOptionEqualToValue:(R,A)=>A?typeof R=="string"&&typeof A=="string"?R===A:typeof R=="object"&&typeof A=="object"?R.value===A.value:typeof R=="object"&&typeof A=="string":!1,renderOption:(R,A)=>typeof A=="object"?(0,$1.createElement)("li",t(a({},R),{key:A.key||A.value}),(0,y.jsxs)(q.Grid,{container:!0,direction:"column",children:[(0,y.jsx)(q.Grid,{item:!0,children:A.label}),A.afterLabel&&(0,y.jsx)(q.Grid,{item:!0,children:A.afterLabel})]})):(0,$1.createElement)("li",t(a({},R),{key:A}),A)},u),{renderInput:R=>(0,y.jsx)(q.TextField,a(t(a({placeholder:v},R),{error:!!G,onChange:T,InputProps:t(a({},R.InputProps),{inputRef:v1,endAdornment:f?void 0:(0,y.jsxs)("div",{className:"endAdornments",children:[R.InputProps.endAdornment,s&&(0,F1.isObject)(e)&&!(0,F1.isEmpty)(e)?(0,y.jsxs)("div",{className:"editable",children:[(0,y.jsx)("div",{className:"divider"}),(0,y.jsx)("div",{className:"button",onClick:()=>V(e),children:(0,y.jsx)(O.LIcon,{icon:Q1,size:"24px",removeMargin:!0})})]}):null,(0,y.jsxs)("div",{className:"creatable",children:[(0,y.jsx)("div",{className:"divider"}),(0,y.jsx)("div",{className:"button",onClick:()=>H(e),children:(0,y.jsx)(O.LIcon,{icon:D1,size:"24px",removeMargin:!0})})]})]})})}),d))}),c)}),(0,y.jsx)(w,{name:c})]})}})},s0=(0,t0.memo)(J0);var L1=require("react-hook-form"),l1=require("@mui/material");var W=require("react/jsx-runtime"),X0=m=>{var n=m,{name:c,rules:l,defaultValue:i,shouldUnregister:r,label:o,labelPlacement:x,required:h}=n,s=g(n,["name","rules","defaultValue","shouldUnregister","label","labelPlacement","required"]);let d=(0,L1.useFormContext)();if(!d)throw new Error("Para usar o <Checkbox /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");return(0,W.jsx)(L1.Controller,{control:d.control,name:c,rules:l,defaultValue:i,shouldUnregister:r,render:({field:{value:f,onChange:M}})=>(0,W.jsxs)(l1.Grid,{display:"flex",flexDirection:"column",children:[(0,W.jsx)(l1.FormControlLabel,{control:(0,W.jsx)(l1.Checkbox,a({checked:!!f,value:f!=null?f:"",defaultValue:f,onChange:M},s),c),label:(0,W.jsx)(b,{label:o,required:h,regular:!0}),labelPlacement:x||"end"}),(0,W.jsx)(w,{name:c})]})})},h0=X0;var C1=require("react-hook-form"),e1=require("@mui/material");var Y=require("react/jsx-runtime"),c2=s=>{var m=s,{name:c,rules:l,defaultValue:i,shouldUnregister:r,label:o,labelPlacement:x}=m,h=g(m,["name","rules","defaultValue","shouldUnregister","label","labelPlacement"]);let n=(0,C1.useFormContext)();if(!n)throw new Error("Para usar o <Switch /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");return(0,Y.jsx)(C1.Controller,{control:n.control,name:c,rules:l,defaultValue:i,shouldUnregister:r,render:({field:{value:d,onChange:f}})=>(0,Y.jsxs)(e1.Grid,{display:"flex",flexDirection:"column",children:[(0,Y.jsx)(e1.FormControlLabel,{control:(0,Y.jsx)(e1.Switch,a({value:d!=null?d:"",checked:d!=null?d:!1,defaultValue:d,onChange:f},h),c),label:(0,Y.jsx)(b,{label:o}),labelPlacement:x||"end"}),(0,Y.jsx)(w,{name:c})]})})},d0=c2;var i1=require("@mui/material");var s1=require("react/jsx-runtime"),l2=r=>{var o=r,{label:c,labelPlacement:l}=o,i=g(o,["label","labelPlacement"]);return(0,s1.jsx)(i1.Grid,{display:"flex",flexDirection:"column",children:(0,s1.jsx)(i1.FormControlLabel,{control:(0,s1.jsx)(i1.Radio,a({},i)),label:(0,s1.jsx)(b,{label:c}),labelPlacement:l||"end"})})},m0=l2;var b1=require("react-hook-form"),k1=require("@mui/material");var J=require("react/jsx-runtime"),e2=n=>{var d=n,{name:c,rules:l,defaultValue:i,shouldUnregister:r,label:o,required:x,children:h,orientation:s="row"}=d,m=g(d,["name","rules","defaultValue","shouldUnregister","label","required","children","orientation"]);let f=(0,b1.useFormContext)();if(!f)throw new Error("Para usar o <RadioGroup /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");return(0,J.jsx)(b1.Controller,{control:f.control,name:c,rules:l,defaultValue:i,shouldUnregister:r,render:({field:{value:M,onChange:C}})=>(0,J.jsxs)(k1.Grid,{display:"flex",flexDirection:"column",children:[o&&(0,J.jsx)(b,{label:o,required:x}),(0,J.jsx)(k1.RadioGroup,t(a({value:M||"",onChange:C,name:c},m),{style:{display:"flex",flexDirection:s},children:h}),c),(0,J.jsx)(w,{name:c})]})})},v0=e2;var P1=require("react-hook-form"),Z0=require("@mui/material");var z1=require("react/jsx-runtime"),i2=x=>{var h=x,{name:c,rules:l,defaultValue:i,shouldUnregister:r}=h,o=g(h,["name","rules","defaultValue","shouldUnregister"]);let s=(0,P1.useFormContext)();if(!s)throw new Error("Para usar o <Slider /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");return(0,z1.jsx)(P1.Controller,{control:s.control,name:c,rules:l,defaultValue:i,shouldUnregister:r,render:({field:{value:m,onChange:n}})=>(0,z1.jsx)(Z0.Slider,a({value:m||(o==null?void 0:o.min)||0,onChange:n,valueLabelDisplay:"auto"},o),c)})},p0=i2;var M0=require("react"),A1=require("react-hook-form"),H0=require("@s_mart/core"),h1=require("@s_mart/rules"),V0=require("@mui/material"),y0=require("@mui/x-date-pickers/DatePicker"),x0=require("@mui/x-date-pickers/AdapterDayjs"),g0=require("@mui/x-date-pickers/LocalizationProvider");var $=require("@s_mart/utils"),u0=p1(require("@emotion/styled")),a2=c=>{switch(c){case"small":return(0,$.toRem)(16);default:case"medium":return(0,$.toRem)(20);case"large":return(0,$.toRem)(24)}},o2=c=>{switch(c){case"small":return`${(0,$.toRem)(2)} ${(0,$.toRem)(8)}`;default:case"medium":return`${(0,$.toRem)(6)} ${(0,$.toRem)(8)}`;case"large":return`${(0,$.toRem)(10)}`}},f0=u0.default.div`
51
51
  > div > button {
52
- padding: ${({size:c})=>a2(c)};
52
+ padding: ${({size:c})=>o2(c)};
53
53
  border-radius: 0 ${(0,$.toRem)(4)} ${(0,$.toRem)(4)} 0;
54
54
 
55
55
  margin: 0px -13px 0px 0px;
56
56
 
57
57
  svg {
58
- width: ${({size:c})=>i2(c)};
58
+ width: ${({size:c})=>a2(c)};
59
59
  }
60
60
  }
61
- `;var K=require("react/jsx-runtime"),F0=require("react"),o2=d=>{var f=d,{rules:c,name:l,defaultValue:i,shouldUnregister:r,datePickerProps:o,label:x,required:h,placeholder:t,disabled:m}=f,n=g(f,["rules","name","defaultValue","shouldUnregister","datePickerProps","label","required","placeholder","disabled"]);let M=(0,A1.useFormContext)();if(!M)throw new Error("Para usar o <DataPicker /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let C=E(M.formState.errors,l),k=(o==null?void 0:o.format)||"DD/MM/YYYY",F=c?(0,h1.composeValidators)([(0,h1.date)(k),c]):(0,h1.date)(k);return(0,K.jsx)(x0.LocalizationProvider,{dateAdapter:y0.AdapterDayjs,children:(0,K.jsx)(A1.Controller,{control:M.control,name:l,rules:F,defaultValue:i,shouldUnregister:r,render:({field:{value:v,onChange:u,ref:P}})=>(0,K.jsxs)(M0.Grid,{display:"flex",flexDirection:"column",children:[x&&(0,K.jsx)(b,{label:x,required:h}),(0,F0.createElement)(V0.DatePicker,s(a({},o),{key:l,value:v!=null?v:null,format:k,onChange:u,disabled:m,slots:{textField:H0.TextField},slotProps:{textField:Z=>{var S,G;return s(a(s(a({variant:"outlined"},Z),{error:!!C}),n),{inputProps:s(a({},Z.inputProps),{placeholder:t||((S=Z.inputProps)==null?void 0:S.placeholder)}),InputProps:s(a({},Z.InputProps),{inputRef(H){P(H),typeof Z.inputRef=="function"&&Z.inputRef(H)},endAdornment:(0,K.jsx)(u0,{size:n.size,children:(G=Z.InputProps)==null?void 0:G.endAdornment})})})}}})),(0,K.jsx)(w,{name:l})]})})})},g0=(0,f0.memo)(o2);var b0=require("react"),w1=require("react-hook-form"),k0=require("@s_mart/core"),d1=require("@s_mart/rules"),P0=require("@mui/material"),A0=require("@mui/x-date-pickers/TimePicker"),w0=require("@mui/x-date-pickers/AdapterDayjs"),S0=require("@mui/x-date-pickers/LocalizationProvider");var U=require("@s_mart/utils"),L0=p1(require("@emotion/styled")),r2=c=>{switch(c){case"small":return(0,U.toRem)(16);default:case"medium":return(0,U.toRem)(20);case"large":return(0,U.toRem)(24)}},n2=c=>{switch(c){case"small":return`${(0,U.toRem)(2)} ${(0,U.toRem)(8)}`;default:case"medium":return`${(0,U.toRem)(6)} ${(0,U.toRem)(8)}`;case"large":return`${(0,U.toRem)(10)}`}},C0=L0.default.div`
61
+ `;var K=require("react/jsx-runtime"),L0=require("react"),r2=d=>{var f=d,{rules:c,name:l,defaultValue:i,shouldUnregister:r,datePickerProps:o,label:x,required:h,placeholder:s,disabled:m}=f,n=g(f,["rules","name","defaultValue","shouldUnregister","datePickerProps","label","required","placeholder","disabled"]);let M=(0,A1.useFormContext)();if(!M)throw new Error("Para usar o <DataPicker /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let C=E(M.formState.errors,l),k=(o==null?void 0:o.format)||"DD/MM/YYYY",F=c?(0,h1.composeValidators)([(0,h1.date)(k),c]):(0,h1.date)(k);return(0,K.jsx)(g0.LocalizationProvider,{dateAdapter:x0.AdapterDayjs,children:(0,K.jsx)(A1.Controller,{control:M.control,name:l,rules:F,defaultValue:i,shouldUnregister:r,render:({field:{value:v,onChange:u,ref:P}})=>(0,K.jsxs)(H0.Grid,{display:"flex",flexDirection:"column",children:[x&&(0,K.jsx)(b,{label:x,required:h}),(0,L0.createElement)(y0.DatePicker,t(a({},o),{key:l,value:v!=null?v:null,format:k,onChange:u,disabled:m,slots:{textField:V0.TextField},slotProps:{textField:Z=>{var S,G;return t(a(t(a({variant:"outlined"},Z),{error:!!C}),n),{inputProps:t(a({},Z.inputProps),{placeholder:s||((S=Z.inputProps)==null?void 0:S.placeholder)}),InputProps:t(a({},Z.InputProps),{inputRef(H){P(H),typeof Z.inputRef=="function"&&Z.inputRef(H)},endAdornment:(0,K.jsx)(f0,{size:n.size,children:(G=Z.InputProps)==null?void 0:G.endAdornment})})})}}})),(0,K.jsx)(w,{name:l})]})})})},F0=(0,M0.memo)(r2);var k0=require("react"),w1=require("react-hook-form"),P0=require("@s_mart/core"),d1=require("@s_mart/rules"),A0=require("@mui/material"),w0=require("@mui/x-date-pickers/TimePicker"),S0=require("@mui/x-date-pickers/AdapterDayjs"),T0=require("@mui/x-date-pickers/LocalizationProvider");var z=require("@s_mart/utils"),C0=p1(require("@emotion/styled")),n2=c=>{switch(c){case"small":return(0,z.toRem)(16);default:case"medium":return(0,z.toRem)(20);case"large":return(0,z.toRem)(24)}},t2=c=>{switch(c){case"small":return`${(0,z.toRem)(2)} ${(0,z.toRem)(8)}`;default:case"medium":return`${(0,z.toRem)(6)} ${(0,z.toRem)(8)}`;case"large":return`${(0,z.toRem)(10)}`}},b0=C0.default.div`
62
62
  > div > button {
63
- padding: ${({size:c})=>n2(c)};
64
- border-radius: 0 ${(0,U.toRem)(4)} ${(0,U.toRem)(4)} 0;
63
+ padding: ${({size:c})=>t2(c)};
64
+ border-radius: 0 ${(0,z.toRem)(4)} ${(0,z.toRem)(4)} 0;
65
65
 
66
66
  margin: 0px -13px 0px 0px;
67
67
 
68
68
  svg {
69
- width: ${({size:c})=>r2(c)};
69
+ width: ${({size:c})=>n2(c)};
70
70
  }
71
71
  }
72
- `;var _=require("react/jsx-runtime"),t2=d=>{var f=d,{rules:c,defaultValue:l,shouldUnregister:i,name:r,required:o,label:x,timePickerProps:h,placeholder:t,disabled:m}=f,n=g(f,["rules","defaultValue","shouldUnregister","name","required","label","timePickerProps","placeholder","disabled"]);let M=(0,w1.useFormContext)();if(!M)throw new Error("Para usar o <TimePicker /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let C=E(M.formState.errors,r),k=(h==null?void 0:h.format)||"HH:mm",F=c?(0,d1.composeValidators)([(0,d1.time)(k),c]):(0,d1.time)(k);return(0,_.jsx)(S0.LocalizationProvider,{dateAdapter:w0.AdapterDayjs,children:(0,_.jsx)(w1.Controller,{control:M.control,name:r,rules:F,defaultValue:l,shouldUnregister:i,render:({field:{value:v,onChange:u,ref:P}})=>(0,_.jsxs)(k0.Grid,{display:"flex",flexDirection:"column",children:[x&&(0,_.jsx)(b,{label:x,required:o}),(0,_.jsx)(A0.TimePicker,s(a({ampm:!1,format:k,value:v!=null?v:null,onChange:u,disabled:m},h),{slots:{textField:P0.TextField},slotProps:{textField:Z=>{var S,G;return s(a(s(a({variant:"outlined"},Z),{error:!!C}),n),{inputProps:s(a({},Z.inputProps),{placeholder:t||((S=Z.inputProps)==null?void 0:S.placeholder)}),InputProps:s(a({},Z.InputProps),{inputRef(H){P(H),typeof Z.inputRef=="function"&&Z.inputRef(H)},endAdornment:(0,_.jsx)(C0,{size:n.size,children:(G=Z.InputProps)==null?void 0:G.endAdornment})})})}}}),r),(0,_.jsx)(w,{name:r})]})})})},T0=(0,b0.memo)(t2);var E0=require("react"),S1=require("react-hook-form"),T1=require("@mui/material"),m1=require("@s_mart/core");var z=require("react/jsx-runtime"),D0=require("react"),s2=f=>{var M=f,{name:c,defaultValue:l,rules:i,shouldUnregister:r,label:o,required:x,noOptionsText:h,placeholder:t,onInputChange:m,onChange:n}=M,d=g(M,["name","defaultValue","rules","shouldUnregister","label","required","noOptionsText","placeholder","onInputChange","onChange"]);let C=(0,S1.useFormContext)();if(!C)throw new Error("Para usar o <Autocomplete /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let k=E(C.formState.errors,c);return console.warn=()=>{},(0,z.jsx)(S1.Controller,{name:c,control:C.control,defaultValue:l,rules:i,shouldUnregister:r,render:({field:F})=>(0,z.jsxs)(m1.Grid,{display:"flex",flexDirection:"column",children:[o&&(0,z.jsx)(b,{label:o,required:x}),(0,z.jsx)(T1.Autocomplete,s(a({onChange:(v,u)=>{F.onChange(u),n==null||n(u,C.watch())},onInputChange:(v,u,P)=>{P==="input"&&(F.onChange(u),setTimeout(()=>{m==null||m(u,C.watch())},0))},isOptionEqualToValue:(v,u)=>v.value===u.value,renderOption:(v,u)=>(0,D0.createElement)("li",s(a({},v),{key:u.key||u.value,onClick:P=>{var Z;(Z=v.onClick)==null||Z.call(v,P),F.onChange(u)}}),(0,z.jsxs)(m1.Grid,{container:!0,direction:"column",children:[(0,z.jsx)(m1.Grid,{item:!0,children:u.label}),u.afterLabel&&(0,z.jsx)(m1.Grid,{item:!0,children:u.afterLabel})]})),value:F.value||null,noOptionsText:h||"Nenhuma op\xE7\xE3o encontrada"},d),{renderInput:v=>{var u,P,Z;return(0,z.jsx)(T1.TextField,s(a(a({placeholder:t},v),d.textFieldProps),{error:!!k,InputProps:s(a(a({},v.InputProps),(u=d.textFieldProps)==null?void 0:u.InputProps),{inputRef:F.ref,inputProps:a(a({},v.inputProps),(Z=(P=d.textFieldProps)==null?void 0:P.InputProps)==null?void 0:Z.inputProps)})}))}}),c),(0,z.jsx)(w,{name:c})]})})},G0=(0,E0.memo)(s2);0&&(module.exports={Autocomplete,Checkbox,Creatable,DatePicker,Form,RadioButton,RadioGroup,Searchable,Select,Slider,Switch,TextField,TimePicker});
72
+ `;var _=require("react/jsx-runtime"),s2=d=>{var f=d,{rules:c,defaultValue:l,shouldUnregister:i,name:r,required:o,label:x,timePickerProps:h,placeholder:s,disabled:m}=f,n=g(f,["rules","defaultValue","shouldUnregister","name","required","label","timePickerProps","placeholder","disabled"]);let M=(0,w1.useFormContext)();if(!M)throw new Error("Para usar o <TimePicker /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let C=E(M.formState.errors,r),k=(h==null?void 0:h.format)||"HH:mm",F=c?(0,d1.composeValidators)([(0,d1.time)(k),c]):(0,d1.time)(k);return(0,_.jsx)(T0.LocalizationProvider,{dateAdapter:S0.AdapterDayjs,children:(0,_.jsx)(w1.Controller,{control:M.control,name:r,rules:F,defaultValue:l,shouldUnregister:i,render:({field:{value:v,onChange:u,ref:P}})=>(0,_.jsxs)(P0.Grid,{display:"flex",flexDirection:"column",children:[x&&(0,_.jsx)(b,{label:x,required:o}),(0,_.jsx)(w0.TimePicker,t(a({ampm:!1,format:k,value:v!=null?v:null,onChange:u,disabled:m},h),{slots:{textField:A0.TextField},slotProps:{textField:Z=>{var S,G;return t(a(t(a({variant:"outlined"},Z),{error:!!C}),n),{inputProps:t(a({},Z.inputProps),{placeholder:s||((S=Z.inputProps)==null?void 0:S.placeholder)}),InputProps:t(a({},Z.InputProps),{inputRef(H){P(H),typeof Z.inputRef=="function"&&Z.inputRef(H)},endAdornment:(0,_.jsx)(b0,{size:n.size,children:(G=Z.InputProps)==null?void 0:G.endAdornment})})})}}}),r),(0,_.jsx)(w,{name:r})]})})})},E0=(0,k0.memo)(s2);var G0=require("react"),S1=require("react-hook-form"),T1=require("@mui/material"),m1=require("@s_mart/core");var U=require("react/jsx-runtime"),B0=require("react"),h2=f=>{var M=f,{name:c,defaultValue:l,rules:i,shouldUnregister:r,label:o,required:x,noOptionsText:h,placeholder:s,onInputChange:m,onChange:n}=M,d=g(M,["name","defaultValue","rules","shouldUnregister","label","required","noOptionsText","placeholder","onInputChange","onChange"]);let C=(0,S1.useFormContext)();if(!C)throw new Error("Para usar o <Autocomplete /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let k=E(C.formState.errors,c);return console.warn=()=>{},(0,U.jsx)(S1.Controller,{name:c,control:C.control,defaultValue:l,rules:i,shouldUnregister:r,render:({field:F})=>(0,U.jsxs)(m1.Grid,{display:"flex",flexDirection:"column",children:[o&&(0,U.jsx)(b,{label:o,required:x}),(0,U.jsx)(T1.Autocomplete,t(a({onChange:(v,u)=>{F.onChange(u),n==null||n(u,C.watch())},onInputChange:(v,u,P)=>{P==="input"&&(F.onChange(u),setTimeout(()=>{m==null||m(u,C.watch())},0))},isOptionEqualToValue:(v,u)=>v.value===u.value,renderOption:(v,u)=>(0,B0.createElement)("li",t(a({},v),{key:u.key||u.value,onClick:P=>{var Z;(Z=v.onClick)==null||Z.call(v,P),F.onChange(u)}}),(0,U.jsxs)(m1.Grid,{container:!0,direction:"column",children:[(0,U.jsx)(m1.Grid,{item:!0,children:u.label}),u.afterLabel&&(0,U.jsx)(m1.Grid,{item:!0,children:u.afterLabel})]})),value:F.value||null,noOptionsText:h||"Nenhuma op\xE7\xE3o encontrada"},d),{renderInput:v=>{var u,P,Z;return(0,U.jsx)(T1.TextField,t(a(a({placeholder:s},v),d.textFieldProps),{error:!!k,InputProps:t(a(a({},v.InputProps),(u=d.textFieldProps)==null?void 0:u.InputProps),{inputRef:F.ref,inputProps:a(a({},v.inputProps),(Z=(P=d.textFieldProps)==null?void 0:P.InputProps)==null?void 0:Z.inputProps)})}))}}),c),(0,U.jsx)(w,{name:c})]})})},D0=(0,G0.memo)(h2);0&&(module.exports={Autocomplete,Checkbox,Creatable,DatePicker,Form,RadioButton,RadioGroup,Searchable,Select,Slider,Switch,TextField,TimePicker});
package/dist/index.mjs CHANGED
@@ -1,8 +1,8 @@
1
- var D1=Object.defineProperty,B1=Object.defineProperties;var R1=Object.getOwnPropertyDescriptors;var c1=Object.getOwnPropertySymbols;var d1=Object.prototype.hasOwnProperty,m1=Object.prototype.propertyIsEnumerable;var h1=(c,e,a)=>e in c?D1(c,e,{enumerable:!0,configurable:!0,writable:!0,value:a}):c[e]=a,i=(c,e)=>{for(var a in e||(e={}))d1.call(e,a)&&h1(c,a,e[a]);if(c1)for(var a of c1(e))m1.call(e,a)&&h1(c,a,e[a]);return c},s=(c,e)=>B1(c,R1(e));var y=(c,e)=>{var a={};for(var o in c)d1.call(c,o)&&e.indexOf(o)<0&&(a[o]=c[o]);if(c!=null&&c1)for(var o of c1(c))e.indexOf(o)<0&&m1.call(c,o)&&(a[o]=c[o]);return a};import{useEffect as I1}from"react";import{FormProvider as q1,useForm as $1}from"react-hook-form";import{jsx as v1}from"react/jsx-runtime";function U1(V){var h=V,{children:c,onSubmit:e,style:a,disableDefaultValuesUpdate:o}=h,r=y(h,["children","onSubmit","style","disableDefaultValuesUpdate"]);let t=$1(r);I1(()=>{o||t.reset(r.defaultValues)},[r.defaultValues,t.reset]);let m=()=>typeof c=="function"?c(s(i({},t),{onSubmit:t.handleSubmit(n=>e(n,t))})):c;return v1(q1,s(i({},t),{children:v1("form",{onSubmit:n=>{n.preventDefault(),n.stopPropagation(),t.handleSubmit(d=>e(d,t))()},style:a,children:m()})}))}var z1=U1;import{memo as Y1,useState as K1}from"react";import{Controller as Q1,useFormContext as J1}from"react-hook-form";import{Grid as s1,InputAdornment as X1,TextField as c0}from"@mui/material";var Z1={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"},p1={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 q={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 u1={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 t1={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 N from"@s_mart/masks";import{Typography as f1}from"@mui/material";import{toRem as O1}from"@s_mart/utils";import{jsx as M1,jsxs as _1}from"react/jsx-runtime";var F=({label:c,required:e,regular:a})=>_1("span",{style:{display:"flex",alignItems:"center",gap:O1(2)},children:[M1(f1,{variant:"caption",fontWeight:a?400:700,style:{display:"flex",alignItems:"center"},children:c}),e&&M1(f1,{variant:"caption",fontWeight:900,color:"error",children:"*"})]});import{useFormContext as N1}from"react-hook-form";import{Indicator as j1}from"@s_mart/core";var E=(c,e)=>{var a,o,r,V,h;if(c[e])return c[e];if(e.includes("[")){let[t,m]=e.split("["),[n,d]=m.split("].");return(o=(a=c[t])==null?void 0:a[n])==null?void 0:o[d]}if(e.includes(".")){let[t,m,n]=e.split(".");return n?(h=(V=c[t])==null?void 0:V[m])==null?void 0:h[n]:(r=c[t])==null?void 0:r[m]}};import{jsx as W1}from"react/jsx-runtime";var k=({name:c})=>{var o;let e=N1(),a=E((o=e==null?void 0:e.formState)==null?void 0:o.errors,c);return a?W1(j1,{severity:"error",children:a==null?void 0:a.message}):null};import{LIcon as H1,Tooltip as l0}from"@s_mart/core";import{jsx as B,jsxs as V1}from"react/jsx-runtime";var e0=g=>{var L=g,{name:c,rules:e,defaultValue:a,shouldUnregister:o,label:r,required:V,mask:h,variant:t="outlined",info:m,parse:n,format:d,onInputChange:u}=L,f=y(L,["name","rules","defaultValue","shouldUnregister","label","required","mask","variant","info","parse","format","onInputChange"]);let x=J1();if(!x)throw new Error("Para usar o <TextField /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let[v,p]=K1(!1),C=M=>{var l;let H=M;return d&&(H=d(M)),h?(l=N==null?void 0:N[h])==null?void 0:l.format(H):H},Z=M=>{var l;let H=M;return n&&(H=n(M)),h?(l=N==null?void 0:N[h])==null?void 0:l.parse(H):H},w=M=>{if(!M||h!=="porcentagem")return;M==null||M.stopPropagation();let H=(M==null?void 0:M.target).value;if(H){let l=String(H);if(l.length>0){let T=l.indexOf("%");T>-1&&(M.currentTarget.selectionEnd=T)}}},G=E(x.formState.errors,c);return B(Q1,{control:x.control,name:c,rules:e,defaultValue:a,shouldUnregister:o,render:({field:{value:M,onChange:H,ref:l}})=>V1(s1,{display:"flex",flexDirection:"column",children:[V1("div",{style:{display:"flex"},children:[r&&B(s1,{item:!0,children:B(F,{label:r,required:V})}),m&&B(s1,{item:!0,children:B(l0,{title:m,placement:"top",children:B("div",{style:{width:"fit-content"},children:B(H1,{icon:q,color:"#757575"})})})})]}),B(c0,s(i({variant:t,defaultValue:a,value:C(M||""),onChange:T=>{var Y;let X=Z((Y=T==null?void 0:T.target)==null?void 0:Y.value);H(X),u==null||u(X,x.watch())},error:!!G},f),{type:f.type==="password"?v?"text":"password":f.type,autoComplete:f.autoComplete||"off",InputProps:i({onKeyDown:w,inputRef:l,endAdornment:f.type==="password"&&B(X1,{position:"end",onClick:()=>p(!v),style:{cursor:"pointer"},children:B(H1,{icon:v?Z1:p1,size:"24px",removeMargin:!0})})},f.InputProps)}),c),B(k,{name:c})]})})},i0=Y1(e0);import{memo as a0,useState as o0}from"react";import{Controller as r0,useFormContext as n0}from"react-hook-form";import{Divider as t0,LIcon as s0,Tooltip as h0}from"@s_mart/core";import{Grid as U,Select as d0,MenuItem as y1,useTheme as m0}from"@mui/material";import{jsx as S,jsxs as l1}from"react/jsx-runtime";var v0=L=>{var x=L,{name:c,rules:e,defaultValue:a,shouldUnregister:o,label:r,required:V,options:h,placeholder:t,disableOnChangeForm:m=!1,multiple:n,info:d,footer:u,onChange:f}=x,g=y(x,["name","rules","defaultValue","shouldUnregister","label","required","options","placeholder","disableOnChangeForm","multiple","info","footer","onChange"]);let v=n0(),{palette:p}=m0(),[C,Z]=o0(!1);if(!v)throw new Error("Para usar o <Select /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let w=E(v.formState.errors,c);return console.warn=()=>{},S(r0,{control:v.control,name:c,rules:e,defaultValue:a||"",shouldUnregister:o,render:({field:{value:G,onChange:M,ref:H}})=>l1(U,{display:"flex",flexDirection:"column",children:[l1("div",{style:{display:"flex"},children:[r&&S(U,{item:!0,children:S(F,{label:r,required:V})}),d&&S(U,{item:!0,children:S(h0,{title:d,placement:"top",children:S("div",{style:{width:"fit-content"},children:S(s0,{icon:q,color:"#757575"})})})})]}),l1(d0,s(i({open:C,onOpen:()=>Z(!0),onClose:()=>Z(!1),displayEmpty:!!t,variant:"outlined",autoComplete:"off",value:G?G||"":n?[]:"",renderValue:l=>{if(l.label)return l.label;if(t)return S("p",{style:{color:p.grey[400]},children:t})},multiple:n,onChange:l=>{!m&&M(l.target.value),f&&f(l.target.value,v.watch())},error:!!w,size:g.size||"medium",inputRef:H},g),{children:[t&&S(y1,{disabled:!0,value:"",children:S("p",{style:{color:p.grey[400]},children:t})}),h==null?void 0:h.map((l,T)=>S(y1,{value:l,children:l1(U,{container:!0,direction:"column",children:[S(U,{item:!0,children:l.label}),l.afterLabel&&S(U,{item:!0,children:l.afterLabel})]})},T)),u&&[S(U,{px:2,py:1,children:S(t0,{})},"footer-divider"),S("div",{children:u({closeSelect:()=>Z(!1)})},"footer-content")]]}),c),S(k,{name:c})]})})},Z0=a0(v0);import{forwardRef as p0,memo as u0}from"react";import{Controller as f0,useFormContext as M0}from"react-hook-form";import{Divider as x1,LIcon as H0,Tooltip as V0}from"@s_mart/core";import{Grid as $,Autocomplete as y0,TextField as x0}from"@mui/material";import{Fragment as e1,jsx as A,jsxs as z}from"react/jsx-runtime";import{createElement as g1}from"react";var g0=v=>{var p=v,{name:c,rules:e,defaultValue:a,shouldUnregister:o,label:r,required:V,options:h,textFieldProps:t,noOptionsText:m,footer:n,multiple:d,info:u,placeholder:f,onChange:g,onInputChange:L}=p,x=y(p,["name","rules","defaultValue","shouldUnregister","label","required","options","textFieldProps","noOptionsText","footer","multiple","info","placeholder","onChange","onInputChange"]);let C=M0();if(!C)throw new Error("Para usar o <Searchable /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let Z=E(C.formState.errors,c);return console.warn=()=>{},A(f0,{control:C.control,name:c,rules:e,defaultValue:a,shouldUnregister:o,render:({field:{onChange:w,value:G,ref:M}})=>z($,{display:"flex",flexDirection:"column",children:[z("div",{style:{display:"flex"},children:[r&&A($,{item:!0,children:A(F,{label:r,required:V})}),u&&A($,{item:!0,children:A(V0,{title:u,placement:"top",children:A("div",{style:{width:"fit-content"},children:A(H0,{icon:q,color:"#757575"})})})})]}),A(y0,s(i({onChange:(H,l)=>{w(l),g==null||g(l,C.watch())},onInputChange:(H,l,T)=>{T==="input"&&setTimeout(()=>{L==null||L(l,C.watch())},0)},value:G||(d?[]:null),options:h,multiple:d,noOptionsText:z(e1,{children:[m||"Nenhum resultado encontrado",n?z(e1,{children:[A($,{py:1,children:A(x1,{})}),n]}):null]}),isOptionEqualToValue:(H,l)=>typeof H=="string"&&typeof l=="string"?H===l:typeof H=="object"&&typeof l=="object"?H.value===l.value:!1,renderOption:(H,l)=>typeof l=="object"?g1("li",s(i({},H),{key:l.key||l.value}),z($,{container:!0,direction:"column",children:[A($,{item:!0,children:l.label}),l.afterLabel&&A($,{item:!0,children:l.afterLabel})]})):g1("li",s(i({},H),{key:l}),l),ListboxComponent:p0(function(l,T){return z(e1,{children:[A("ul",s(i({},l),{ref:T})),!!n&&A("div",s(i({},l),{children:z(e1,{children:[A($,{px:2,py:1,children:A(x1,{})}),n]})}),"searchable-footer")]})})},x),{renderInput:H=>A(x0,s(i(i({error:!!Z,placeholder:f},H),t),{inputRef:M}))}),c),A(k,{name:c})]})})},F0=u0(g0);import{memo as b0}from"react";import{Controller as k0,useFormContext as P0}from"react-hook-form";import{Grid as j,Autocomplete as A0,TextField as w0}from"@mui/material";import{toRem as i1}from"@s_mart/utils";import L0 from"@emotion/styled";import{css as F1}from"@emotion/react";var L1=F1`
1
+ var D1=Object.defineProperty,B1=Object.defineProperties;var R1=Object.getOwnPropertyDescriptors;var c1=Object.getOwnPropertySymbols;var d1=Object.prototype.hasOwnProperty,m1=Object.prototype.propertyIsEnumerable;var h1=(c,e,a)=>e in c?D1(c,e,{enumerable:!0,configurable:!0,writable:!0,value:a}):c[e]=a,i=(c,e)=>{for(var a in e||(e={}))d1.call(e,a)&&h1(c,a,e[a]);if(c1)for(var a of c1(e))m1.call(e,a)&&h1(c,a,e[a]);return c},t=(c,e)=>B1(c,R1(e));var y=(c,e)=>{var a={};for(var r in c)d1.call(c,r)&&e.indexOf(r)<0&&(a[r]=c[r]);if(c!=null&&c1)for(var r of c1(c))e.indexOf(r)<0&&m1.call(c,r)&&(a[r]=c[r]);return a};import{useEffect as I1}from"react";import{FormProvider as q1,useForm as $1}from"react-hook-form";import{zodResolver as z1}from"@hookform/resolvers/zod";import{jsx as v1}from"react/jsx-runtime";function U1(V){var h=V,{children:c,onSubmit:e,style:a,disableDefaultValuesUpdate:r}=h,o=y(h,["children","onSubmit","style","disableDefaultValuesUpdate"]);let s=$1(t(i({},o),{resolver:o.schema&&z1(o.schema)}));I1(()=>{r||s.reset(o.defaultValues)},[o.defaultValues,s.reset]);let m=()=>typeof c=="function"?c(t(i({},s),{onSubmit:s.handleSubmit(n=>e(n,s))})):c;return v1(q1,t(i({},s),{children:v1("form",{onSubmit:n=>{n.preventDefault(),n.stopPropagation(),s.handleSubmit(d=>e(d,s))()},style:a,children:m()})}))}var O1=U1;import{memo as K1,useState as Q1}from"react";import{Controller as J1,useFormContext as X1}from"react-hook-form";import{Grid as s1,InputAdornment as c0,TextField as l0}from"@mui/material";var Z1={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"},p1={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 q={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 u1={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 t1={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 N from"@s_mart/masks";import{Typography as f1}from"@mui/material";import{toRem as _1}from"@s_mart/utils";import{jsx as M1,jsxs as N1}from"react/jsx-runtime";var F=({label:c,required:e,regular:a})=>N1("span",{style:{display:"flex",alignItems:"center",gap:_1(2)},children:[M1(f1,{variant:"caption",fontWeight:a?400:700,style:{display:"flex",alignItems:"center"},children:c}),e&&M1(f1,{variant:"caption",fontWeight:900,color:"error",children:"*"})]});import{useFormContext as j1}from"react-hook-form";import{Indicator as W1}from"@s_mart/core";var E=(c,e)=>{var a,r,o,V,h;if(c[e])return c[e];if(e.includes("[")){let[s,m]=e.split("["),[n,d]=m.split("].");return(r=(a=c[s])==null?void 0:a[n])==null?void 0:r[d]}if(e.includes(".")){let[s,m,n]=e.split(".");return n?(h=(V=c[s])==null?void 0:V[m])==null?void 0:h[n]:(o=c[s])==null?void 0:o[m]}};import{jsx as Y1}from"react/jsx-runtime";var k=({name:c})=>{var r;let e=j1(),a=E((r=e==null?void 0:e.formState)==null?void 0:r.errors,c);return a?Y1(W1,{severity:"error",children:a==null?void 0:a.message}):null};import{LIcon as H1,Tooltip as e0}from"@s_mart/core";import{jsx as B,jsxs as V1}from"react/jsx-runtime";var i0=g=>{var L=g,{name:c,rules:e,defaultValue:a,shouldUnregister:r,label:o,required:V,mask:h,variant:s="outlined",info:m,parse:n,format:d,onInputChange:u}=L,f=y(L,["name","rules","defaultValue","shouldUnregister","label","required","mask","variant","info","parse","format","onInputChange"]);let x=X1();if(!x)throw new Error("Para usar o <TextField /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let[v,p]=Q1(!1),C=M=>{var l;let H=M;return d&&(H=d(M)),h?(l=N==null?void 0:N[h])==null?void 0:l.format(H):H},Z=M=>{var l;let H=M;return n&&(H=n(M)),h?(l=N==null?void 0:N[h])==null?void 0:l.parse(H):H},w=M=>{if(!M||h!=="porcentagem")return;M==null||M.stopPropagation();let H=(M==null?void 0:M.target).value;if(H){let l=String(H);if(l.length>0){let T=l.indexOf("%");T>-1&&(M.currentTarget.selectionEnd=T)}}},G=E(x.formState.errors,c);return B(J1,{control:x.control,name:c,rules:e,defaultValue:a,shouldUnregister:r,render:({field:{value:M,onChange:H,ref:l}})=>V1(s1,{display:"flex",flexDirection:"column",children:[V1("div",{style:{display:"flex"},children:[o&&B(s1,{item:!0,children:B(F,{label:o,required:V})}),m&&B(s1,{item:!0,children:B(e0,{title:m,placement:"top",children:B("div",{style:{width:"fit-content"},children:B(H1,{icon:q,color:"#757575"})})})})]}),B(l0,t(i({variant:s,defaultValue:a,value:C(M||""),onChange:T=>{var Y;let X=Z((Y=T==null?void 0:T.target)==null?void 0:Y.value);H(X),u==null||u(X,x.watch())},error:!!G},f),{type:f.type==="password"?v?"text":"password":f.type,autoComplete:f.autoComplete||"off",InputProps:i({onKeyDown:w,inputRef:l,endAdornment:f.type==="password"&&B(c0,{position:"end",onClick:()=>p(!v),style:{cursor:"pointer"},children:B(H1,{icon:v?Z1:p1,size:"24px",removeMargin:!0})})},f.InputProps)}),c),B(k,{name:c})]})})},a0=K1(i0);import{memo as o0,useState as r0}from"react";import{Controller as n0,useFormContext as t0}from"react-hook-form";import{Divider as s0,LIcon as h0,Tooltip as d0}from"@s_mart/core";import{Grid as z,Select as m0,MenuItem as y1,useTheme as v0}from"@mui/material";import{jsx as S,jsxs as l1}from"react/jsx-runtime";var Z0=L=>{var x=L,{name:c,rules:e,defaultValue:a,shouldUnregister:r,label:o,required:V,options:h,placeholder:s,disableOnChangeForm:m=!1,multiple:n,info:d,footer:u,onChange:f}=x,g=y(x,["name","rules","defaultValue","shouldUnregister","label","required","options","placeholder","disableOnChangeForm","multiple","info","footer","onChange"]);let v=t0(),{palette:p}=v0(),[C,Z]=r0(!1);if(!v)throw new Error("Para usar o <Select /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let w=E(v.formState.errors,c);return console.warn=()=>{},S(n0,{control:v.control,name:c,rules:e,defaultValue:a,shouldUnregister:r,render:({field:{value:G,onChange:M,ref:H}})=>l1(z,{display:"flex",flexDirection:"column",children:[l1("div",{style:{display:"flex"},children:[o&&S(z,{item:!0,children:S(F,{label:o,required:V})}),d&&S(z,{item:!0,children:S(d0,{title:d,placement:"top",children:S("div",{style:{width:"fit-content"},children:S(h0,{icon:q,color:"#757575"})})})})]}),l1(m0,t(i({open:C,onOpen:()=>Z(!0),onClose:()=>Z(!1),displayEmpty:!!s,variant:"outlined",autoComplete:"off",value:G?G||"":n?[]:"",renderValue:l=>{if(l.label)return l.label;if(s)return S("p",{style:{color:p.grey[400]},children:s})},multiple:n,onChange:l=>{!m&&M(l.target.value),f&&f(l.target.value,v.watch())},error:!!w,size:g.size||"medium",inputRef:H},g),{children:[s&&S(y1,{disabled:!0,value:"",children:S("p",{style:{color:p.grey[400]},children:s})}),h==null?void 0:h.map((l,T)=>S(y1,{value:l,children:l1(z,{container:!0,direction:"column",children:[S(z,{item:!0,children:l.label}),l.afterLabel&&S(z,{item:!0,children:l.afterLabel})]})},T)),u&&[S(z,{px:2,py:1,children:S(s0,{})},"footer-divider"),S("div",{children:u({closeSelect:()=>Z(!1)})},"footer-content")]]}),c),S(k,{name:c})]})})},p0=o0(Z0);import{forwardRef as u0,memo as f0}from"react";import{Controller as M0,useFormContext as H0}from"react-hook-form";import{Divider as x1,LIcon as V0,Tooltip as y0}from"@s_mart/core";import{Grid as $,Autocomplete as x0,TextField as g0}from"@mui/material";import{Fragment as e1,jsx as A,jsxs as U}from"react/jsx-runtime";import{createElement as g1}from"react";var F0=v=>{var p=v,{name:c,rules:e,defaultValue:a,shouldUnregister:r,label:o,required:V,options:h,textFieldProps:s,noOptionsText:m,footer:n,multiple:d,info:u,placeholder:f,onChange:g,onInputChange:L}=p,x=y(p,["name","rules","defaultValue","shouldUnregister","label","required","options","textFieldProps","noOptionsText","footer","multiple","info","placeholder","onChange","onInputChange"]);let C=H0();if(!C)throw new Error("Para usar o <Searchable /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let Z=E(C.formState.errors,c);return console.warn=()=>{},A(M0,{control:C.control,name:c,rules:e,defaultValue:a,shouldUnregister:r,render:({field:{onChange:w,value:G,ref:M}})=>U($,{display:"flex",flexDirection:"column",children:[U("div",{style:{display:"flex"},children:[o&&A($,{item:!0,children:A(F,{label:o,required:V})}),u&&A($,{item:!0,children:A(y0,{title:u,placement:"top",children:A("div",{style:{width:"fit-content"},children:A(V0,{icon:q,color:"#757575"})})})})]}),A(x0,t(i({onChange:(H,l)=>{w(l),g==null||g(l,C.watch())},onInputChange:(H,l,T)=>{T==="input"&&setTimeout(()=>{L==null||L(l,C.watch())},0)},value:G||(d?[]:null),options:h,multiple:d,noOptionsText:U(e1,{children:[m||"Nenhum resultado encontrado",n?U(e1,{children:[A($,{py:1,children:A(x1,{})}),n]}):null]}),isOptionEqualToValue:(H,l)=>typeof H=="string"&&typeof l=="string"?H===l:typeof H=="object"&&typeof l=="object"?H.value===l.value:!1,renderOption:(H,l)=>typeof l=="object"?g1("li",t(i({},H),{key:l.key||l.value}),U($,{container:!0,direction:"column",children:[A($,{item:!0,children:l.label}),l.afterLabel&&A($,{item:!0,children:l.afterLabel})]})):g1("li",t(i({},H),{key:l}),l),ListboxComponent:u0(function(l,T){return U(e1,{children:[A("ul",t(i({},l),{ref:T})),!!n&&A("div",t(i({},l),{children:U(e1,{children:[A($,{px:2,py:1,children:A(x1,{})}),n]})}),"searchable-footer")]})})},x),{renderInput:H=>A(g0,t(i(i({error:!!Z,placeholder:f},H),s),{inputRef:M}))}),c),A(k,{name:c})]})})},L0=f0(F0);import{memo as k0}from"react";import{Controller as P0,useFormContext as A0}from"react-hook-form";import{Grid as j,Autocomplete as w0,TextField as S0}from"@mui/material";import{toRem as i1}from"@s_mart/utils";import C0 from"@emotion/styled";import{css as F1}from"@emotion/react";var L1=F1`
2
2
  display: flex;
3
3
  align-items: center;
4
4
  justify-content: center;
5
- `,C0=c=>F1`
5
+ `,b0=c=>F1`
6
6
  .MuiAutocomplete-endAdornment {
7
7
  position: relative;
8
8
  right: 0;
@@ -36,7 +36,7 @@ var D1=Object.defineProperty,B1=Object.defineProperties;var R1=Object.getOwnProp
36
36
  }
37
37
  }
38
38
  }
39
- `,C1=L0.div`
39
+ `,C1=C0.div`
40
40
  display: flex;
41
41
 
42
42
  div.endAdornments {
@@ -46,27 +46,27 @@ var D1=Object.defineProperty,B1=Object.defineProperties;var R1=Object.getOwnProp
46
46
  ${L1}
47
47
  }
48
48
 
49
- ${({hideAddButton:c,theme:e})=>!c&&C0(e)}
50
- `;import{LIcon as a1,Tooltip as S0,Button as T0}from"@s_mart/core";import{isObject as E0,isEmpty as G0}from"lodash";import{toRem as b1}from"@s_mart/utils";import{jsx as P,jsxs as O}from"react/jsx-runtime";import{createElement as k1}from"react";var D0=C=>{var Z=C,{name:c,rules:e,defaultValue:a,shouldUnregister:o,label:r,required:V,options:h,editable:t,onEditOption:m,onCreateOption:n,textFieldProps:d,hideAddButton:u,multiple:f,info:g,onChange:L,onInputChange:x,placeholder:v}=Z,p=y(Z,["name","rules","defaultValue","shouldUnregister","label","required","options","editable","onEditOption","onCreateOption","textFieldProps","hideAddButton","multiple","info","onChange","onInputChange","placeholder"]);let w=P0();if(!w)throw new Error("Para usar o <Creatable /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let G=E(w.formState.errors,c);console.warn=()=>{};let M=l=>{n?n(l):console.error("onCreateOption n\xE3o foi definido")},H=l=>{m?m(l):console.error("onEditOption n\xE3o foi definido")};return P(k0,{control:w.control,name:c,rules:e,defaultValue:a,shouldUnregister:o,render:({field:{value:l,onChange:T,ref:X}})=>{let Y=(l==null?void 0:l.label)||(l==null?void 0:l.value)||l;return O(j,{display:"flex",flexDirection:"column",children:[O("div",{style:{display:"flex"},children:[r&&P(j,{item:!0,children:P(F,{label:r,required:V})}),g&&P(j,{item:!0,children:P(S0,{title:g,placement:"top",children:P("div",{style:{width:"fit-content"},children:P(a1,{icon:q,color:"#757575"})})})})]}),P(C1,{hideAddButton:u,children:P(A0,s(i({fullWidth:!0,onChange:(D,b)=>{T(b),L==null||L(b,w.watch())},onInputChange:(D,b,G1)=>{G1==="input"&&(T(b),setTimeout(()=>{x==null||x(b,w.watch())},0))},options:h,value:l||(f?[]:null),multiple:f,noOptionsText:O(T0,{sx:{justifyContent:"flex-start",padding:`${b1(6)} ${b1(-16)}`,margin:0},fullWidth:!0,onClick:()=>M(l),variant:"text",startIcon:P(a1,{icon:t1}),children:["Adicionar ",Y&&`"${Y}"`]}),isOptionEqualToValue:(D,b)=>b?typeof D=="string"&&typeof b=="string"?D===b:typeof D=="object"&&typeof b=="object"?D.value===b.value:typeof D=="object"&&typeof b=="string":!1,renderOption:(D,b)=>typeof b=="object"?k1("li",s(i({},D),{key:b.key||b.value}),O(j,{container:!0,direction:"column",children:[P(j,{item:!0,children:b.label}),b.afterLabel&&P(j,{item:!0,children:b.afterLabel})]})):k1("li",s(i({},D),{key:b}),b)},p),{renderInput:D=>P(w0,i(s(i({placeholder:v},D),{error:!!G,onChange:T,InputProps:s(i({},D.InputProps),{inputRef:X,endAdornment:u?void 0:O("div",{className:"endAdornments",children:[D.InputProps.endAdornment,t&&E0(l)&&!G0(l)?O("div",{className:"editable",children:[P("div",{className:"divider"}),P("div",{className:"button",onClick:()=>H(l),children:P(a1,{icon:u1,size:"24px",removeMargin:!0})})]}):null,O("div",{className:"creatable",children:[P("div",{className:"divider"}),P("div",{className:"button",onClick:()=>M(l),children:P(a1,{icon:t1,size:"24px",removeMargin:!0})})]})]})})}),d))}),c)}),P(k,{name:c})]})}})},B0=b0(D0);import{Controller as R0,useFormContext as I0}from"react-hook-form";import{Grid as q0,Checkbox as $0,FormControlLabel as U0}from"@mui/material";import{jsx as K,jsxs as _0}from"react/jsx-runtime";var z0=m=>{var n=m,{name:c,rules:e,defaultValue:a,shouldUnregister:o,label:r,labelPlacement:V,required:h}=n,t=y(n,["name","rules","defaultValue","shouldUnregister","label","labelPlacement","required"]);let d=I0();if(!d)throw new Error("Para usar o <Checkbox /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");return K(R0,{control:d.control,name:c,rules:e,defaultValue:a,shouldUnregister:o,render:({field:{value:u,onChange:f}})=>_0(q0,{display:"flex",flexDirection:"column",children:[K(U0,{control:K($0,i({checked:!!u,value:u!=null?u:"",defaultValue:u,onChange:f},t),c),label:K(F,{label:r,required:h,regular:!0}),labelPlacement:V||"end"}),K(k,{name:c})]})})},O0=z0;import{Controller as N0,useFormContext as j0}from"react-hook-form";import{Grid as W0,Switch as Y0,FormControlLabel as K0}from"@mui/material";import{jsx as Q,jsxs as X0}from"react/jsx-runtime";var Q0=t=>{var m=t,{name:c,rules:e,defaultValue:a,shouldUnregister:o,label:r,labelPlacement:V}=m,h=y(m,["name","rules","defaultValue","shouldUnregister","label","labelPlacement"]);let n=j0();if(!n)throw new Error("Para usar o <Switch /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");return Q(N0,{control:n.control,name:c,rules:e,defaultValue:a,shouldUnregister:o,render:({field:{value:d,onChange:u}})=>X0(W0,{display:"flex",flexDirection:"column",children:[Q(K0,{control:Q(Y0,i({value:d!=null?d:"",checked:d!=null?d:!1,defaultValue:d,onChange:u},h),c),label:Q(F,{label:r}),labelPlacement:V||"end"}),Q(k,{name:c})]})})},J0=Q0;import{Grid as c2,Radio as l2,FormControlLabel as e2}from"@mui/material";import{jsx as o1}from"react/jsx-runtime";var i2=o=>{var r=o,{label:c,labelPlacement:e}=r,a=y(r,["label","labelPlacement"]);return o1(c2,{display:"flex",flexDirection:"column",children:o1(e2,{control:o1(l2,i({},a)),label:o1(F,{label:c}),labelPlacement:e||"end"})})},a2=i2;import{Controller as o2,useFormContext as r2}from"react-hook-form";import{Grid as n2,RadioGroup as t2}from"@mui/material";import{jsx as r1,jsxs as d2}from"react/jsx-runtime";var s2=n=>{var d=n,{name:c,rules:e,defaultValue:a,shouldUnregister:o,label:r,required:V,children:h,orientation:t="row"}=d,m=y(d,["name","rules","defaultValue","shouldUnregister","label","required","children","orientation"]);let u=r2();if(!u)throw new Error("Para usar o <RadioGroup /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");return r1(o2,{control:u.control,name:c,rules:e,defaultValue:a,shouldUnregister:o,render:({field:{value:f,onChange:g}})=>d2(n2,{display:"flex",flexDirection:"column",children:[r&&r1(F,{label:r,required:V}),r1(t2,s(i({value:f||"",onChange:g,name:c},m),{style:{display:"flex",flexDirection:t},children:h}),c),r1(k,{name:c})]})})},h2=s2;import{Controller as m2,useFormContext as v2}from"react-hook-form";import{Slider as Z2}from"@mui/material";import{jsx as P1}from"react/jsx-runtime";var p2=V=>{var h=V,{name:c,rules:e,defaultValue:a,shouldUnregister:o}=h,r=y(h,["name","rules","defaultValue","shouldUnregister"]);let t=v2();if(!t)throw new Error("Para usar o <Slider /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");return P1(m2,{control:t.control,name:c,rules:e,defaultValue:a,shouldUnregister:o,render:({field:{value:m,onChange:n}})=>P1(Z2,i({value:m||(r==null?void 0:r.min)||0,onChange:n,valueLabelDisplay:"auto"},r),c)})},u2=p2;import{memo as V2}from"react";import{Controller as y2,useFormContext as x2}from"react-hook-form";import{Grid as g2}from"@s_mart/core";import{composeValidators as F2,date as w1}from"@s_mart/rules";import{TextField as L2}from"@mui/material";import{DatePicker as C2}from"@mui/x-date-pickers/DatePicker";import{AdapterDayjs as b2}from"@mui/x-date-pickers/AdapterDayjs";import{LocalizationProvider as k2}from"@mui/x-date-pickers/LocalizationProvider";import{toRem as R}from"@s_mart/utils";import f2 from"@emotion/styled";var M2=c=>{switch(c){case"small":return R(16);default:case"medium":return R(20);case"large":return R(24)}},H2=c=>{switch(c){case"small":return`${R(2)} ${R(8)}`;default:case"medium":return`${R(6)} ${R(8)}`;case"large":return`${R(10)}`}},A1=f2.div`
49
+ ${({hideAddButton:c,theme:e})=>!c&&b0(e)}
50
+ `;import{LIcon as a1,Tooltip as T0,Button as E0}from"@s_mart/core";import{isObject as G0,isEmpty as D0}from"lodash";import{toRem as b1}from"@s_mart/utils";import{jsx as P,jsxs as O}from"react/jsx-runtime";import{createElement as k1}from"react";var B0=C=>{var Z=C,{name:c,rules:e,defaultValue:a,shouldUnregister:r,label:o,required:V,options:h,editable:s,onEditOption:m,onCreateOption:n,textFieldProps:d,hideAddButton:u,multiple:f,info:g,onChange:L,onInputChange:x,placeholder:v}=Z,p=y(Z,["name","rules","defaultValue","shouldUnregister","label","required","options","editable","onEditOption","onCreateOption","textFieldProps","hideAddButton","multiple","info","onChange","onInputChange","placeholder"]);let w=A0();if(!w)throw new Error("Para usar o <Creatable /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let G=E(w.formState.errors,c);console.warn=()=>{};let M=l=>{n?n(l):console.error("onCreateOption n\xE3o foi definido")},H=l=>{m?m(l):console.error("onEditOption n\xE3o foi definido")};return P(P0,{control:w.control,name:c,rules:e,defaultValue:a,shouldUnregister:r,render:({field:{value:l,onChange:T,ref:X}})=>{let Y=(l==null?void 0:l.label)||(l==null?void 0:l.value)||l;return O(j,{display:"flex",flexDirection:"column",children:[O("div",{style:{display:"flex"},children:[o&&P(j,{item:!0,children:P(F,{label:o,required:V})}),g&&P(j,{item:!0,children:P(T0,{title:g,placement:"top",children:P("div",{style:{width:"fit-content"},children:P(a1,{icon:q,color:"#757575"})})})})]}),P(C1,{hideAddButton:u,children:P(w0,t(i({fullWidth:!0,onChange:(D,b)=>{T(b),L==null||L(b,w.watch())},onInputChange:(D,b,G1)=>{G1==="input"&&(T(b),setTimeout(()=>{x==null||x(b,w.watch())},0))},options:h,value:l||(f?[]:null),multiple:f,noOptionsText:O(E0,{sx:{justifyContent:"flex-start",padding:`${b1(6)} ${b1(-16)}`,margin:0},fullWidth:!0,onClick:()=>M(l),variant:"text",startIcon:P(a1,{icon:t1}),children:["Adicionar ",Y&&`"${Y}"`]}),isOptionEqualToValue:(D,b)=>b?typeof D=="string"&&typeof b=="string"?D===b:typeof D=="object"&&typeof b=="object"?D.value===b.value:typeof D=="object"&&typeof b=="string":!1,renderOption:(D,b)=>typeof b=="object"?k1("li",t(i({},D),{key:b.key||b.value}),O(j,{container:!0,direction:"column",children:[P(j,{item:!0,children:b.label}),b.afterLabel&&P(j,{item:!0,children:b.afterLabel})]})):k1("li",t(i({},D),{key:b}),b)},p),{renderInput:D=>P(S0,i(t(i({placeholder:v},D),{error:!!G,onChange:T,InputProps:t(i({},D.InputProps),{inputRef:X,endAdornment:u?void 0:O("div",{className:"endAdornments",children:[D.InputProps.endAdornment,s&&G0(l)&&!D0(l)?O("div",{className:"editable",children:[P("div",{className:"divider"}),P("div",{className:"button",onClick:()=>H(l),children:P(a1,{icon:u1,size:"24px",removeMargin:!0})})]}):null,O("div",{className:"creatable",children:[P("div",{className:"divider"}),P("div",{className:"button",onClick:()=>M(l),children:P(a1,{icon:t1,size:"24px",removeMargin:!0})})]})]})})}),d))}),c)}),P(k,{name:c})]})}})},R0=k0(B0);import{Controller as I0,useFormContext as q0}from"react-hook-form";import{Grid as $0,Checkbox as z0,FormControlLabel as U0}from"@mui/material";import{jsx as K,jsxs as N0}from"react/jsx-runtime";var O0=m=>{var n=m,{name:c,rules:e,defaultValue:a,shouldUnregister:r,label:o,labelPlacement:V,required:h}=n,s=y(n,["name","rules","defaultValue","shouldUnregister","label","labelPlacement","required"]);let d=q0();if(!d)throw new Error("Para usar o <Checkbox /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");return K(I0,{control:d.control,name:c,rules:e,defaultValue:a,shouldUnregister:r,render:({field:{value:u,onChange:f}})=>N0($0,{display:"flex",flexDirection:"column",children:[K(U0,{control:K(z0,i({checked:!!u,value:u!=null?u:"",defaultValue:u,onChange:f},s),c),label:K(F,{label:o,required:h,regular:!0}),labelPlacement:V||"end"}),K(k,{name:c})]})})},_0=O0;import{Controller as j0,useFormContext as W0}from"react-hook-form";import{Grid as Y0,Switch as K0,FormControlLabel as Q0}from"@mui/material";import{jsx as Q,jsxs as c2}from"react/jsx-runtime";var J0=s=>{var m=s,{name:c,rules:e,defaultValue:a,shouldUnregister:r,label:o,labelPlacement:V}=m,h=y(m,["name","rules","defaultValue","shouldUnregister","label","labelPlacement"]);let n=W0();if(!n)throw new Error("Para usar o <Switch /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");return Q(j0,{control:n.control,name:c,rules:e,defaultValue:a,shouldUnregister:r,render:({field:{value:d,onChange:u}})=>c2(Y0,{display:"flex",flexDirection:"column",children:[Q(Q0,{control:Q(K0,i({value:d!=null?d:"",checked:d!=null?d:!1,defaultValue:d,onChange:u},h),c),label:Q(F,{label:o}),labelPlacement:V||"end"}),Q(k,{name:c})]})})},X0=J0;import{Grid as l2,Radio as e2,FormControlLabel as i2}from"@mui/material";import{jsx as o1}from"react/jsx-runtime";var a2=r=>{var o=r,{label:c,labelPlacement:e}=o,a=y(o,["label","labelPlacement"]);return o1(l2,{display:"flex",flexDirection:"column",children:o1(i2,{control:o1(e2,i({},a)),label:o1(F,{label:c}),labelPlacement:e||"end"})})},o2=a2;import{Controller as r2,useFormContext as n2}from"react-hook-form";import{Grid as t2,RadioGroup as s2}from"@mui/material";import{jsx as r1,jsxs as m2}from"react/jsx-runtime";var h2=n=>{var d=n,{name:c,rules:e,defaultValue:a,shouldUnregister:r,label:o,required:V,children:h,orientation:s="row"}=d,m=y(d,["name","rules","defaultValue","shouldUnregister","label","required","children","orientation"]);let u=n2();if(!u)throw new Error("Para usar o <RadioGroup /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");return r1(r2,{control:u.control,name:c,rules:e,defaultValue:a,shouldUnregister:r,render:({field:{value:f,onChange:g}})=>m2(t2,{display:"flex",flexDirection:"column",children:[o&&r1(F,{label:o,required:V}),r1(s2,t(i({value:f||"",onChange:g,name:c},m),{style:{display:"flex",flexDirection:s},children:h}),c),r1(k,{name:c})]})})},d2=h2;import{Controller as v2,useFormContext as Z2}from"react-hook-form";import{Slider as p2}from"@mui/material";import{jsx as P1}from"react/jsx-runtime";var u2=V=>{var h=V,{name:c,rules:e,defaultValue:a,shouldUnregister:r}=h,o=y(h,["name","rules","defaultValue","shouldUnregister"]);let s=Z2();if(!s)throw new Error("Para usar o <Slider /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");return P1(v2,{control:s.control,name:c,rules:e,defaultValue:a,shouldUnregister:r,render:({field:{value:m,onChange:n}})=>P1(p2,i({value:m||(o==null?void 0:o.min)||0,onChange:n,valueLabelDisplay:"auto"},o),c)})},f2=u2;import{memo as y2}from"react";import{Controller as x2,useFormContext as g2}from"react-hook-form";import{Grid as F2}from"@s_mart/core";import{composeValidators as L2,date as w1}from"@s_mart/rules";import{TextField as C2}from"@mui/material";import{DatePicker as b2}from"@mui/x-date-pickers/DatePicker";import{AdapterDayjs as k2}from"@mui/x-date-pickers/AdapterDayjs";import{LocalizationProvider as P2}from"@mui/x-date-pickers/LocalizationProvider";import{toRem as R}from"@s_mart/utils";import M2 from"@emotion/styled";var H2=c=>{switch(c){case"small":return R(16);default:case"medium":return R(20);case"large":return R(24)}},V2=c=>{switch(c){case"small":return`${R(2)} ${R(8)}`;default:case"medium":return`${R(6)} ${R(8)}`;case"large":return`${R(10)}`}},A1=M2.div`
51
51
  > div > button {
52
- padding: ${({size:c})=>H2(c)};
52
+ padding: ${({size:c})=>V2(c)};
53
53
  border-radius: 0 ${R(4)} ${R(4)} 0;
54
54
 
55
55
  margin: 0px -13px 0px 0px;
56
56
 
57
57
  svg {
58
- width: ${({size:c})=>M2(c)};
58
+ width: ${({size:c})=>H2(c)};
59
59
  }
60
60
  }
61
- `;import{jsx as J,jsxs as S2}from"react/jsx-runtime";import{createElement as w2}from"react";var P2=d=>{var u=d,{rules:c,name:e,defaultValue:a,shouldUnregister:o,datePickerProps:r,label:V,required:h,placeholder:t,disabled:m}=u,n=y(u,["rules","name","defaultValue","shouldUnregister","datePickerProps","label","required","placeholder","disabled"]);let f=x2();if(!f)throw new Error("Para usar o <DataPicker /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let g=E(f.formState.errors,e),L=(r==null?void 0:r.format)||"DD/MM/YYYY",x=c?F2([w1(L),c]):w1(L);return J(k2,{dateAdapter:b2,children:J(y2,{control:f.control,name:e,rules:x,defaultValue:a,shouldUnregister:o,render:({field:{value:v,onChange:p,ref:C}})=>S2(g2,{display:"flex",flexDirection:"column",children:[V&&J(F,{label:V,required:h}),w2(C2,s(i({},r),{key:e,value:v!=null?v:null,format:L,onChange:p,disabled:m,slots:{textField:L2},slotProps:{textField:Z=>{var w,G;return s(i(s(i({variant:"outlined"},Z),{error:!!g}),n),{inputProps:s(i({},Z.inputProps),{placeholder:t||((w=Z.inputProps)==null?void 0:w.placeholder)}),InputProps:s(i({},Z.InputProps),{inputRef(M){C(M),typeof Z.inputRef=="function"&&Z.inputRef(M)},endAdornment:J(A1,{size:n.size,children:(G=Z.InputProps)==null?void 0:G.endAdornment})})})}}})),J(k,{name:e})]})})})},A2=V2(P2);import{memo as D2}from"react";import{Controller as B2,useFormContext as R2}from"react-hook-form";import{Grid as I2}from"@s_mart/core";import{composeValidators as q2,time as T1}from"@s_mart/rules";import{TextField as $2}from"@mui/material";import{TimePicker as U2}from"@mui/x-date-pickers/TimePicker";import{AdapterDayjs as z2}from"@mui/x-date-pickers/AdapterDayjs";import{LocalizationProvider as O2}from"@mui/x-date-pickers/LocalizationProvider";import{toRem as I}from"@s_mart/utils";import T2 from"@emotion/styled";var E2=c=>{switch(c){case"small":return I(16);default:case"medium":return I(20);case"large":return I(24)}},G2=c=>{switch(c){case"small":return`${I(2)} ${I(8)}`;default:case"medium":return`${I(6)} ${I(8)}`;case"large":return`${I(10)}`}},S1=T2.div`
61
+ `;import{jsx as J,jsxs as T2}from"react/jsx-runtime";import{createElement as S2}from"react";var A2=d=>{var u=d,{rules:c,name:e,defaultValue:a,shouldUnregister:r,datePickerProps:o,label:V,required:h,placeholder:s,disabled:m}=u,n=y(u,["rules","name","defaultValue","shouldUnregister","datePickerProps","label","required","placeholder","disabled"]);let f=g2();if(!f)throw new Error("Para usar o <DataPicker /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let g=E(f.formState.errors,e),L=(o==null?void 0:o.format)||"DD/MM/YYYY",x=c?L2([w1(L),c]):w1(L);return J(P2,{dateAdapter:k2,children:J(x2,{control:f.control,name:e,rules:x,defaultValue:a,shouldUnregister:r,render:({field:{value:v,onChange:p,ref:C}})=>T2(F2,{display:"flex",flexDirection:"column",children:[V&&J(F,{label:V,required:h}),S2(b2,t(i({},o),{key:e,value:v!=null?v:null,format:L,onChange:p,disabled:m,slots:{textField:C2},slotProps:{textField:Z=>{var w,G;return t(i(t(i({variant:"outlined"},Z),{error:!!g}),n),{inputProps:t(i({},Z.inputProps),{placeholder:s||((w=Z.inputProps)==null?void 0:w.placeholder)}),InputProps:t(i({},Z.InputProps),{inputRef(M){C(M),typeof Z.inputRef=="function"&&Z.inputRef(M)},endAdornment:J(A1,{size:n.size,children:(G=Z.InputProps)==null?void 0:G.endAdornment})})})}}})),J(k,{name:e})]})})})},w2=y2(A2);import{memo as B2}from"react";import{Controller as R2,useFormContext as I2}from"react-hook-form";import{Grid as q2}from"@s_mart/core";import{composeValidators as $2,time as T1}from"@s_mart/rules";import{TextField as z2}from"@mui/material";import{TimePicker as U2}from"@mui/x-date-pickers/TimePicker";import{AdapterDayjs as O2}from"@mui/x-date-pickers/AdapterDayjs";import{LocalizationProvider as _2}from"@mui/x-date-pickers/LocalizationProvider";import{toRem as I}from"@s_mart/utils";import E2 from"@emotion/styled";var G2=c=>{switch(c){case"small":return I(16);default:case"medium":return I(20);case"large":return I(24)}},D2=c=>{switch(c){case"small":return`${I(2)} ${I(8)}`;default:case"medium":return`${I(6)} ${I(8)}`;case"large":return`${I(10)}`}},S1=E2.div`
62
62
  > div > button {
63
- padding: ${({size:c})=>G2(c)};
63
+ padding: ${({size:c})=>D2(c)};
64
64
  border-radius: 0 ${I(4)} ${I(4)} 0;
65
65
 
66
66
  margin: 0px -13px 0px 0px;
67
67
 
68
68
  svg {
69
- width: ${({size:c})=>E2(c)};
69
+ width: ${({size:c})=>G2(c)};
70
70
  }
71
71
  }
72
- `;import{jsx as W,jsxs as j2}from"react/jsx-runtime";var _2=d=>{var u=d,{rules:c,defaultValue:e,shouldUnregister:a,name:o,required:r,label:V,timePickerProps:h,placeholder:t,disabled:m}=u,n=y(u,["rules","defaultValue","shouldUnregister","name","required","label","timePickerProps","placeholder","disabled"]);let f=R2();if(!f)throw new Error("Para usar o <TimePicker /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let g=E(f.formState.errors,o),L=(h==null?void 0:h.format)||"HH:mm",x=c?q2([T1(L),c]):T1(L);return W(O2,{dateAdapter:z2,children:W(B2,{control:f.control,name:o,rules:x,defaultValue:e,shouldUnregister:a,render:({field:{value:v,onChange:p,ref:C}})=>j2(I2,{display:"flex",flexDirection:"column",children:[V&&W(F,{label:V,required:r}),W(U2,s(i({ampm:!1,format:L,value:v!=null?v:null,onChange:p,disabled:m},h),{slots:{textField:$2},slotProps:{textField:Z=>{var w,G;return s(i(s(i({variant:"outlined"},Z),{error:!!g}),n),{inputProps:s(i({},Z.inputProps),{placeholder:t||((w=Z.inputProps)==null?void 0:w.placeholder)}),InputProps:s(i({},Z.InputProps),{inputRef(M){C(M),typeof Z.inputRef=="function"&&Z.inputRef(M)},endAdornment:W(S1,{size:n.size,children:(G=Z.InputProps)==null?void 0:G.endAdornment})})})}}}),o),W(k,{name:o})]})})})},N2=D2(_2);import{memo as W2}from"react";import{Controller as Y2,useFormContext as K2}from"react-hook-form";import{Autocomplete as Q2,TextField as J2}from"@mui/material";import{Grid as n1}from"@s_mart/core";import{jsx as _,jsxs as E1}from"react/jsx-runtime";import{createElement as l3}from"react";var X2=u=>{var f=u,{name:c,defaultValue:e,rules:a,shouldUnregister:o,label:r,required:V,noOptionsText:h,placeholder:t,onInputChange:m,onChange:n}=f,d=y(f,["name","defaultValue","rules","shouldUnregister","label","required","noOptionsText","placeholder","onInputChange","onChange"]);let g=K2();if(!g)throw new Error("Para usar o <Autocomplete /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let L=E(g.formState.errors,c);return console.warn=()=>{},_(Y2,{name:c,control:g.control,defaultValue:e,rules:a,shouldUnregister:o,render:({field:x})=>E1(n1,{display:"flex",flexDirection:"column",children:[r&&_(F,{label:r,required:V}),_(Q2,s(i({onChange:(v,p)=>{x.onChange(p),n==null||n(p,g.watch())},onInputChange:(v,p,C)=>{C==="input"&&(x.onChange(p),setTimeout(()=>{m==null||m(p,g.watch())},0))},isOptionEqualToValue:(v,p)=>v.value===p.value,renderOption:(v,p)=>l3("li",s(i({},v),{key:p.key||p.value,onClick:C=>{var Z;(Z=v.onClick)==null||Z.call(v,C),x.onChange(p)}}),E1(n1,{container:!0,direction:"column",children:[_(n1,{item:!0,children:p.label}),p.afterLabel&&_(n1,{item:!0,children:p.afterLabel})]})),value:x.value||null,noOptionsText:h||"Nenhuma op\xE7\xE3o encontrada"},d),{renderInput:v=>{var p,C,Z;return _(J2,s(i(i({placeholder:t},v),d.textFieldProps),{error:!!L,InputProps:s(i(i({},v.InputProps),(p=d.textFieldProps)==null?void 0:p.InputProps),{inputRef:x.ref,inputProps:i(i({},v.inputProps),(Z=(C=d.textFieldProps)==null?void 0:C.InputProps)==null?void 0:Z.inputProps)})}))}}),c),_(k,{name:c})]})})},c3=W2(X2);export{c3 as Autocomplete,O0 as Checkbox,B0 as Creatable,A2 as DatePicker,z1 as Form,a2 as RadioButton,h2 as RadioGroup,F0 as Searchable,Z0 as Select,u2 as Slider,J0 as Switch,i0 as TextField,N2 as TimePicker};
72
+ `;import{jsx as W,jsxs as W2}from"react/jsx-runtime";var N2=d=>{var u=d,{rules:c,defaultValue:e,shouldUnregister:a,name:r,required:o,label:V,timePickerProps:h,placeholder:s,disabled:m}=u,n=y(u,["rules","defaultValue","shouldUnregister","name","required","label","timePickerProps","placeholder","disabled"]);let f=I2();if(!f)throw new Error("Para usar o <TimePicker /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let g=E(f.formState.errors,r),L=(h==null?void 0:h.format)||"HH:mm",x=c?$2([T1(L),c]):T1(L);return W(_2,{dateAdapter:O2,children:W(R2,{control:f.control,name:r,rules:x,defaultValue:e,shouldUnregister:a,render:({field:{value:v,onChange:p,ref:C}})=>W2(q2,{display:"flex",flexDirection:"column",children:[V&&W(F,{label:V,required:o}),W(U2,t(i({ampm:!1,format:L,value:v!=null?v:null,onChange:p,disabled:m},h),{slots:{textField:z2},slotProps:{textField:Z=>{var w,G;return t(i(t(i({variant:"outlined"},Z),{error:!!g}),n),{inputProps:t(i({},Z.inputProps),{placeholder:s||((w=Z.inputProps)==null?void 0:w.placeholder)}),InputProps:t(i({},Z.InputProps),{inputRef(M){C(M),typeof Z.inputRef=="function"&&Z.inputRef(M)},endAdornment:W(S1,{size:n.size,children:(G=Z.InputProps)==null?void 0:G.endAdornment})})})}}}),r),W(k,{name:r})]})})})},j2=B2(N2);import{memo as Y2}from"react";import{Controller as K2,useFormContext as Q2}from"react-hook-form";import{Autocomplete as J2,TextField as X2}from"@mui/material";import{Grid as n1}from"@s_mart/core";import{jsx as _,jsxs as E1}from"react/jsx-runtime";import{createElement as e3}from"react";var c3=u=>{var f=u,{name:c,defaultValue:e,rules:a,shouldUnregister:r,label:o,required:V,noOptionsText:h,placeholder:s,onInputChange:m,onChange:n}=f,d=y(f,["name","defaultValue","rules","shouldUnregister","label","required","noOptionsText","placeholder","onInputChange","onChange"]);let g=Q2();if(!g)throw new Error("Para usar o <Autocomplete /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let L=E(g.formState.errors,c);return console.warn=()=>{},_(K2,{name:c,control:g.control,defaultValue:e,rules:a,shouldUnregister:r,render:({field:x})=>E1(n1,{display:"flex",flexDirection:"column",children:[o&&_(F,{label:o,required:V}),_(J2,t(i({onChange:(v,p)=>{x.onChange(p),n==null||n(p,g.watch())},onInputChange:(v,p,C)=>{C==="input"&&(x.onChange(p),setTimeout(()=>{m==null||m(p,g.watch())},0))},isOptionEqualToValue:(v,p)=>v.value===p.value,renderOption:(v,p)=>e3("li",t(i({},v),{key:p.key||p.value,onClick:C=>{var Z;(Z=v.onClick)==null||Z.call(v,C),x.onChange(p)}}),E1(n1,{container:!0,direction:"column",children:[_(n1,{item:!0,children:p.label}),p.afterLabel&&_(n1,{item:!0,children:p.afterLabel})]})),value:x.value||null,noOptionsText:h||"Nenhuma op\xE7\xE3o encontrada"},d),{renderInput:v=>{var p,C,Z;return _(X2,t(i(i({placeholder:s},v),d.textFieldProps),{error:!!L,InputProps:t(i(i({},v.InputProps),(p=d.textFieldProps)==null?void 0:p.InputProps),{inputRef:x.ref,inputProps:i(i({},v.inputProps),(Z=(C=d.textFieldProps)==null?void 0:C.InputProps)==null?void 0:Z.inputProps)})}))}}),c),_(k,{name:c})]})})},l3=Y2(c3);export{l3 as Autocomplete,_0 as Checkbox,R0 as Creatable,w2 as DatePicker,O1 as Form,o2 as RadioButton,d2 as RadioGroup,L0 as Searchable,p0 as Select,f2 as Slider,X0 as Switch,a0 as TextField,j2 as TimePicker};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@s_mart/form",
3
- "version": "3.1.1",
3
+ "version": "3.2.1",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./dist/index.mjs",
6
6
  "types": "./dist/index.d.ts",
@@ -15,14 +15,15 @@
15
15
  "lint": "eslint src/**/*.ts* --fix"
16
16
  },
17
17
  "dependencies": {
18
+ "@hookform/resolvers": "^3.1.0",
18
19
  "@s_mart/core": "*",
19
20
  "@s_mart/masks": "*",
21
+ "@s_mart/rules": "*",
20
22
  "@s_mart/tokens": "*",
21
23
  "@s_mart/typed": "*",
22
24
  "@s_mart/utils": "*",
23
- "@s_mart/rules": "*",
24
- "@types/react": "18.2.5",
25
- "@types/react-dom": "18.2.4",
25
+ "@types/react": "^18.2.6",
26
+ "@types/react-dom": "^18.2.4",
26
27
  "lodash": "^4.17.21",
27
28
  "tsup": "^6.7.0",
28
29
  "typescript": "^5.0.4"
@@ -34,16 +35,17 @@
34
35
  "@mui/x-date-pickers": ">=6.3.0",
35
36
  "@s_mart/core": "*",
36
37
  "@s_mart/masks": "*",
38
+ "@s_mart/rules": "*",
37
39
  "@s_mart/tokens": "*",
38
40
  "@s_mart/typed": "*",
39
41
  "@s_mart/utils": "*",
40
- "@s_mart/rules": "*",
41
42
  "@types/react": ">=18.2.5",
42
43
  "@types/react-dom": ">=18.2.4",
43
44
  "react": ">=18.2.0",
44
45
  "react-dom": ">=18.2.0",
45
46
  "react-hook-form": ">=7.36.1",
46
- "typescript": ">=5.0.4"
47
+ "typescript": ">=5.0.4",
48
+ "zod": ">=3.21.4"
47
49
  },
48
50
  "devDependencies": {
49
51
  "@s_mart/eslint": "*",