@s_mart/form 2.7.18 → 2.7.19

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
@@ -45,9 +45,14 @@ type TextFieldProps = TextFieldProps$1 & ControllerTextField & {
45
45
  * <TextField mask="cpf" format={(value) => value.replace(/\D/g, '')} />
46
46
  */
47
47
  format?: (value: string) => string;
48
+ /**
49
+ * É o conteúdo passado para a tooltip que renderizará ao lado da label do campo,
50
+ * montada à tela como um ícone de informação.
51
+ */
52
+ info?: React.ReactNode;
48
53
  };
49
54
 
50
- declare const _default$6: react.MemoExoticComponent<({ name, rules, defaultValue, shouldUnregister, label, required, mask, variant, parse, format, onInputChange, ...rest }: TextFieldProps) => JSX.Element>;
55
+ declare const _default$6: react.MemoExoticComponent<({ name, rules, defaultValue, shouldUnregister, label, required, mask, variant, info, parse, format, onInputChange, ...rest }: TextFieldProps) => JSX.Element>;
51
56
 
52
57
  type ControllerSelect = Omit<ControllerProps, 'render' | 'control'>;
53
58
  type SelectOption = {
@@ -82,9 +87,14 @@ type SelectProps = SelectProps$1 & ControllerSelect & {
82
87
  *
83
88
  */
84
89
  footer?: (props: FooterProps) => React.ReactNode;
90
+ /**
91
+ * É o conteúdo passado para a tooltip que renderizará ao lado da label do campo,
92
+ * montada à tela como um ícone de informação.
93
+ */
94
+ info?: React.ReactNode;
85
95
  };
86
96
 
87
- declare const _default$5: react.MemoExoticComponent<({ name, rules, defaultValue, shouldUnregister, label, required, options, placeholder, onInputChange, footer, ...rest }: SelectProps) => JSX.Element>;
97
+ declare const _default$5: react.MemoExoticComponent<({ name, rules, defaultValue, shouldUnregister, label, required, options, placeholder, onInputChange, footer, multiple, info, ...rest }: SelectProps) => JSX.Element>;
88
98
 
89
99
  type ControllerSearchable = Omit<ControllerProps, 'render' | 'control'>;
90
100
  type SearchableOption = {
@@ -131,9 +141,14 @@ type SearchableProps = Omit<AutocompleteProps$1<SearchableOption, true, true, tr
131
141
  *
132
142
  */
133
143
  footer?: React.ReactNode;
144
+ /**
145
+ * É o conteúdo passado para a tooltip que renderizará ao lado da label do campo,
146
+ * montada à tela como um ícone de informação.
147
+ */
148
+ info?: React.ReactNode;
134
149
  };
135
150
 
136
- declare const _default$4: react.MemoExoticComponent<({ name, rules, defaultValue, shouldUnregister, label, required, options, textFieldProps, noOptionsText, footer, ...rest }: SearchableProps) => JSX.Element>;
151
+ declare const _default$4: react.MemoExoticComponent<({ name, rules, defaultValue, shouldUnregister, label, required, options, textFieldProps, noOptionsText, footer, multiple, info, ...rest }: SearchableProps) => JSX.Element>;
137
152
 
138
153
  type ControllerCreatable = Omit<ControllerProps, 'render' | 'control'>;
139
154
  type CreatableOption = {
@@ -190,9 +205,28 @@ type CreatableProps = Omit<AutocompleteProps$1<CreatableOption, true, true, true
190
205
  * @memberof CreatableProps
191
206
  */
192
207
  hideAddButton?: boolean;
208
+ /**
209
+ *
210
+ * @default false
211
+ * @type {boolean}
212
+ * @memberof CreatableProps
213
+ */
214
+ editable?: boolean;
215
+ /**
216
+ * Função que será executada quando o usuário clicar no botão de editar uma opção
217
+ * @default () => {}
218
+ * @type {(value) => void}
219
+ * @memberof CreatableProps
220
+ */
221
+ onEditOption?: (value: unknown) => void;
222
+ /**
223
+ * É o conteúdo passado para a tooltip que renderizará ao lado da label do campo,
224
+ * montada à tela como um ícone de informação.
225
+ */
226
+ info?: React.ReactNode;
193
227
  };
194
228
 
195
- declare const _default$3: react.MemoExoticComponent<({ name, rules, defaultValue, shouldUnregister, label, required, options, onCreateOption, textFieldProps, hideAddButton, ...rest }: CreatableProps) => JSX.Element>;
229
+ declare const _default$3: react.MemoExoticComponent<({ name, rules, defaultValue, shouldUnregister, label, required, options, editable, onEditOption, onCreateOption, textFieldProps, hideAddButton, multiple, info, ...rest }: CreatableProps) => JSX.Element>;
196
230
 
197
231
  type ControllerCheckbox = Omit<ControllerProps, 'render' | 'control'>;
198
232
  type CheckboxProps = CheckboxProps$1 & ControllerCheckbox & {
package/dist/index.js CHANGED
@@ -1,19 +1,20 @@
1
- "use strict";var b3=Object.create;var J=Object.defineProperty,w3=Object.defineProperties,k3=Object.getOwnPropertyDescriptor,v3=Object.getOwnPropertyDescriptors,S3=Object.getOwnPropertyNames,i2=Object.getOwnPropertySymbols,B3=Object.getPrototypeOf,u2=Object.prototype.hasOwnProperty,k2=Object.prototype.propertyIsEnumerable;var w2=(C,i,e)=>i in C?J(C,i,{enumerable:!0,configurable:!0,writable:!0,value:e}):C[i]=e,o=(C,i)=>{for(var e in i||(i={}))u2.call(i,e)&&w2(C,e,i[e]);if(i2)for(var e of i2(i))k2.call(i,e)&&w2(C,e,i[e]);return C},s=(C,i)=>w3(C,v3(i));var f=(C,i)=>{var e={};for(var n in C)u2.call(C,n)&&i.indexOf(n)<0&&(e[n]=C[n]);if(C!=null&&i2)for(var n of i2(C))i.indexOf(n)<0&&k2.call(C,n)&&(e[n]=C[n]);return e};var A3=(C,i)=>{for(var e in i)J(C,e,{get:i[e],enumerable:!0})},v2=(C,i,e,n)=>{if(i&&typeof i=="object"||typeof i=="function")for(let r of S3(i))!u2.call(C,r)&&r!==e&&J(C,r,{get:()=>i[r],enumerable:!(n=k3(i,r))||n.enumerable});return C};var e2=(C,i,e)=>(e=C!=null?b3(B3(C)):{},v2(i||!C||!C.__esModule?J(e,"default",{value:C,enumerable:!0}):e,C)),T3=C=>v2(J({},"__esModule",{value:!0}),C);var X3={};A3(X3,{Autocomplete:()=>F3,Checkbox:()=>X2,Creatable:()=>J2,DatePicker:()=>a3,Form:()=>B2,RadioButton:()=>i3,RadioGroup:()=>e3,Searchable:()=>N2,Select:()=>z2,Slider:()=>r3,Switch:()=>C3,TextField:()=>U2,TimePicker:()=>x3});module.exports=T3(X3);var S2=require("react"),o2=require("react-hook-form");var f2=require("react/jsx-runtime");function E3(m){var H=m,{children:C,onSubmit:i,style:e,disableDefaultValuesUpdate:n}=H,r=f(H,["children","onSubmit","style","disableDefaultValuesUpdate"]);let l=(0,o2.useForm)(r);(0,S2.useEffect)(()=>{n||l.reset(r.defaultValues)},[r.defaultValues,l.reset]);let V=()=>typeof C=="function"?C(s(o({},l),{onSubmit:l.handleSubmit(Z=>i(Z,l))})):C;return(0,f2.jsx)(o2.FormProvider,s(o({},l),{children:(0,f2.jsx)("form",{onSubmit:Z=>{Z.preventDefault(),Z.stopPropagation(),l.handleSubmit(a=>i(a,l))()},style:e,children:V()})}))}var B2=E3;var r2=require("react"),n2=require("react-hook-form"),j=require("@mui/material");var A2={description:"M39.0611 23.1367C36.3276 17.015 30.4051 13.2479 24.027 13.0909C17.4971 13.2479 11.5746 17.172 8.84117 23.1367C8.68931 23.6076 8.68931 24.2355 8.84117 24.8633C11.5746 30.985 17.4971 34.7521 23.8752 34.9091C30.4051 34.7521 36.1757 30.828 38.9092 24.8633C39.3648 24.2355 39.3648 23.6076 39.0611 23.1367ZM24.027 32.0837C19.6231 31.9268 16.2822 28.1596 16.4341 23.6076C16.586 19.3695 19.9269 15.7593 24.027 15.7593C28.4309 15.9163 31.7718 19.6835 31.62 24.2355C31.4681 28.4735 28.1272 32.0837 24.027 32.0837ZM24.027 18.5847C23.5715 18.5847 23.1159 18.7417 22.6603 18.7417C23.4196 19.8404 23.2677 21.2531 22.3566 22.3519C21.4454 23.2937 20.0787 23.2937 19.0157 22.5088C18.5601 24.7063 19.3194 27.2178 21.1417 28.4735C22.964 29.7292 25.3938 29.7292 27.0642 28.3165C28.7347 26.9039 29.494 24.3924 28.7347 22.1949C28.1272 19.9974 26.1531 18.5847 24.027 18.5847Z",viewBox:"0 0 48 48",id:"line-eye-solid"},T2={description:"M23.9998 31.7412C19.9223 31.7412 16.6215 28.5851 16.3177 24.5854L10.6785 20.2272C9.93715 21.1573 9.25496 22.1405 8.70447 23.2157C8.58149 23.4589 8.51742 23.7277 8.51742 24.0003C8.51742 24.2729 8.58149 24.5416 8.70447 24.7849C11.6198 30.4731 17.3913 34.3216 23.9998 34.3216C25.4465 34.3216 26.842 34.1066 28.1871 33.7593L25.3976 31.6009C24.9369 31.6899 24.469 31.7369 23.9998 31.7412ZM40.8703 34.8646L34.9273 30.2715C36.7326 28.7501 38.2174 26.8848 39.2952 24.7843C39.4182 24.5411 39.4823 24.2723 39.4823 23.9997C39.4823 23.7272 39.4182 23.4584 39.2952 23.2151C36.3799 17.5269 30.6084 13.6784 23.9998 13.6784C21.2321 13.6817 18.5093 14.3785 16.0801 15.7051L9.24098 10.419C9.15179 10.3496 9.04981 10.2985 8.94085 10.2685C8.83189 10.2385 8.7181 10.2303 8.60597 10.2443C8.49384 10.2584 8.38557 10.2944 8.28736 10.3502C8.18914 10.4061 8.1029 10.4808 8.03356 10.5701L6.97828 11.9285C6.8383 12.1086 6.77557 12.3369 6.8039 12.5633C6.83223 12.7896 6.94929 12.9954 7.12934 13.1354L38.7587 37.581C38.8479 37.6504 38.9499 37.7016 39.0588 37.7315C39.1678 37.7615 39.2816 37.7697 39.3937 37.7557C39.5058 37.7416 39.6141 37.7057 39.7123 37.6498C39.8105 37.5939 39.8968 37.5192 39.9661 37.43L41.0219 36.0715C41.1619 35.8913 41.2245 35.663 41.1961 35.4366C41.1676 35.2103 41.0505 35.0045 40.8703 34.8646ZM30.9938 27.2309L28.8811 25.5977C29.059 25.0835 29.1534 24.5441 29.1606 24C29.1711 23.2034 28.9947 22.4155 28.6454 21.6995C28.2962 20.9836 27.7838 20.3595 27.1496 19.8774C26.5154 19.3953 25.777 19.0687 24.9937 18.9238C24.2103 18.7788 23.4039 18.8197 22.6392 19.0429C22.9634 19.4822 23.1387 20.0135 23.1397 20.5595C23.1317 20.7411 23.1039 20.9214 23.0569 21.097L19.0997 18.0387C20.4743 16.89 22.2085 16.2601 23.9998 16.2588C25.0166 16.2582 26.0235 16.4581 26.9629 16.8469C27.9024 17.2357 28.756 17.8059 29.475 18.5249C30.1939 19.2438 30.7641 20.0974 31.1529 21.0369C31.5418 21.9764 31.7416 22.9833 31.7411 24C31.7411 25.1628 31.4567 26.246 30.9938 27.2309Z",viewBox:"0 0 48 48",id:"line-eye-slash-solid"};var E2={description:"M35.8286 21.8493H26.1506V12.1714C26.1506 11.6338 25.613 11.0961 25.0753 11.0961H22.9247C22.3198 11.0961 21.8493 11.6338 21.8493 12.1714V21.8493H12.1714C11.5666 21.8493 11.0961 22.387 11.0961 22.9247V25.0753C11.0961 25.6802 11.5666 26.1506 12.1714 26.1506H21.8493V35.8286C21.8493 36.4334 22.3198 36.9039 22.9247 36.9039H25.0753C25.613 36.9039 26.1506 36.4334 26.1506 35.8286V26.1506H35.8286C36.3662 26.1506 36.9039 25.6802 36.9039 25.0753V22.9247C36.9039 22.387 36.3662 21.8493 35.8286 21.8493Z",viewBox:"0 0 48 48",id:"line-plus-solid"};var N=e2(require("@s_mart/masks"));var g2=require("@mui/material"),D2=require("@s_mart/utils"),X=require("react/jsx-runtime"),g=({label:C,required:i,regular:e})=>(0,X.jsxs)("span",{style:{display:"flex",alignItems:"center",gap:(0,D2.toRem)(2)},children:[(0,X.jsx)(g2.Typography,{variant:"caption",fontWeight:e?400:700,style:{display:"flex",alignItems:"center"},children:C}),i&&(0,X.jsx)(g2.Typography,{variant:"caption",fontWeight:900,color:"error",children:"*"})]});var I2=require("react-hook-form"),G2=require("@s_mart/core");var w=(C,i)=>{var e,n,r,m;if(C[i])return C[i];if(i.includes("[")){let[H,l]=i.split("["),[V,Z]=l.split("].");return(n=(e=C[H])==null?void 0:e[V])==null?void 0:n[Z]}if(i.includes(".")){let[H,l,V]=i.split(".");return(m=(r=C[H])==null?void 0:r[l])==null?void 0:m[V]}};var $2=require("react/jsx-runtime"),y=({name:C})=>{var n;let i=(0,I2.useFormContext)(),e=w((n=i==null?void 0:i.formState)==null?void 0:n.errors,C);return e?(0,$2.jsx)(G2.Indicator,{severity:"error",children:e==null?void 0:e.message}):null};var q2=require("@s_mart/core");var G=require("react/jsx-runtime"),D3=h=>{var c=h,{name:C,rules:i,defaultValue:e,shouldUnregister:n,label:r,required:m,mask:H,variant:l="outlined",parse:V,format:Z,onInputChange:a}=c,d=f(c,["name","rules","defaultValue","shouldUnregister","label","required","mask","variant","parse","format","onInputChange"]);let p=(0,n2.useFormContext)();if(!p)throw new Error("Para usar o <TextField /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let[t,L]=(0,r2.useState)(!1),M=P=>{var b;let B=P;return Z&&(B=Z(P)),H?(b=N==null?void 0:N[H])==null?void 0:b.format(B):B},x=P=>{var b;let B=P;return V&&(B=V(P)),H?(b=N==null?void 0:N[H])==null?void 0:b.parse(B):B},F=P=>{if(!P||H!=="porcentagem")return;P==null||P.stopPropagation();let B=(P==null?void 0:P.target).value;if(B){let b=String(B);if(b.length>0){let Q=b.indexOf("%");Q>-1&&(P.currentTarget.selectionEnd=Q)}}},u=w(p.formState.errors,C);return(0,G.jsx)(n2.Controller,{control:p.control,name:C,rules:i,defaultValue:e,shouldUnregister:n,render:({field:{value:P,onChange:B}})=>(0,G.jsxs)(j.Grid,{display:"flex",flexDirection:"column",children:[r&&(0,G.jsx)(g,{label:r,required:m}),(0,G.jsx)(j.TextField,s(o({variant:l,autoComplete:"off",defaultValue:e,value:M(P||""),onChange:b=>{var Q,b2;B(x((Q=b==null?void 0:b.target)==null?void 0:Q.value)),a==null||a(b,(b2=b==null?void 0:b.target)==null?void 0:b2.value,p.watch())},error:Boolean(u)},d),{type:d.type==="password"?t?"text":"password":d.type,InputProps:o({onKeyDown:F,endAdornment:d.type==="password"&&(0,G.jsx)(j.InputAdornment,{position:"end",onClick:()=>L(!t),style:{cursor:"pointer"},children:(0,G.jsx)(q2.LIcon,{icon:t?A2:T2,size:"24px",removeMargin:!0})})},d.InputProps)})),(0,G.jsx)(y,{name:C})]})})},U2=(0,r2.memo)(D3);var l2=require("react"),H2=require("react-hook-form"),R2=require("@s_mart/core"),E=require("@mui/material");var v=require("react/jsx-runtime"),I3=d=>{var h=d,{name:C,rules:i,defaultValue:e,shouldUnregister:n,label:r,required:m,options:H,placeholder:l,onInputChange:V,footer:Z}=h,a=f(h,["name","rules","defaultValue","shouldUnregister","label","required","options","placeholder","onInputChange","footer"]);let c=(0,H2.useFormContext)(),{palette:p}=(0,E.useTheme)(),[t,L]=(0,l2.useState)(!1);if(!c)throw new Error("Para usar o <Select /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let M=w(c.formState.errors,C);return console.warn=()=>{},(0,v.jsx)(H2.Controller,{control:c.control,name:C,rules:i,defaultValue:e||"",shouldUnregister:n,render:({field:{value:x,onChange:F}})=>(0,v.jsxs)(E.Grid,{display:"flex",flexDirection:"column",children:[r&&(0,v.jsx)(g,{label:r,required:m}),(0,v.jsxs)(E.Select,s(o({open:t,onOpen:()=>L(!0),onClose:()=>L(!1),displayEmpty:Boolean(l),variant:"outlined",autoComplete:"off",value:x||"",onChange:u=>{F(u.target.value),V==null||V(u,u.target.value,c.watch())},error:Boolean(M),size:a.size||"medium"},a),{children:[l&&(0,v.jsx)(E.MenuItem,{disabled:!0,value:"",children:(0,v.jsx)("p",{style:{color:p.grey[400]},children:l})}),H==null?void 0:H.map((u,P)=>(0,v.jsx)(E.MenuItem,{value:u.value,children:u.label},P)),Z&&(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)(E.Grid,{px:2,py:1,children:(0,v.jsx)(R2.Divider,{})}),Z({closeSelect:()=>L(!1)})]})]})),(0,v.jsx)(y,{name:C})]})})},z2=(0,l2.memo)(I3);var O2=require("react"),t2=require("react-hook-form"),O=require("@mui/material");var _2=require("@s_mart/core");var S=require("react/jsx-runtime"),x2=require("react"),G3=d=>{var h=d,{name:C,rules:i,defaultValue:e,shouldUnregister:n,label:r,required:m,options:H,textFieldProps:l,noOptionsText:V,footer:Z}=h,a=f(h,["name","rules","defaultValue","shouldUnregister","label","required","options","textFieldProps","noOptionsText","footer"]);let c=(0,t2.useFormContext)();if(!c)throw new Error("Para usar o <Searchable /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let p=w(c.formState.errors,C);return console.warn=()=>{},(0,S.jsx)(t2.Controller,{control:c.control,name:C,rules:i,defaultValue:e,shouldUnregister:n,render:({field:{onChange:t,value:L}})=>(0,S.jsxs)(O.Grid,{display:"flex",flexDirection:"column",children:[r&&(0,S.jsx)(g,{label:r,required:m}),(0,S.jsx)(O.Autocomplete,s(o({onChange:(M,x)=>t(x),value:L||null,options:H,noOptionsText:V||"Nenhuma op\xE7\xE3o encontrada",isOptionEqualToValue:(M,x)=>typeof M=="string"&&typeof x=="string"?M===x:typeof M=="object"&&typeof x=="object"?M.value===x.value:!1,renderOption:(M,x)=>typeof x=="object"?(0,x2.createElement)("li",s(o({},M),{key:x.key||x.value}),x.label):(0,x2.createElement)("li",s(o({},M),{key:x}),x),ListboxComponent:M=>(0,S.jsxs)("ul",s(o({},M),{children:[M.children,Z&&(0,S.jsx)("li",{children:(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(O.Grid,{px:2,py:1,children:(0,S.jsx)(_2.Divider,{})}),Z]})},"searchable-footer")]}))},a),{renderInput:M=>(0,S.jsx)(O.TextField,o(o({error:Boolean(p)},M),l))})),(0,S.jsx)(y,{name:C})]})})},N2=(0,O2.memo)(G3);var K2=require("react"),s2=require("react-hook-form"),q=require("@mui/material");var $=require("@s_mart/utils"),y2=e2(require("@emotion/styled")),h2=require("@emotion/react"),j2=h2.css`
1
+ "use strict";var S3=Object.create;var o2=Object.defineProperty,T3=Object.defineProperties,B3=Object.getOwnPropertyDescriptor,A3=Object.getOwnPropertyDescriptors,E3=Object.getOwnPropertyNames,t2=Object.getOwnPropertySymbols,G3=Object.getPrototypeOf,P2=Object.prototype.hasOwnProperty,G2=Object.prototype.propertyIsEnumerable;var E2=(C,i,e)=>i in C?o2(C,i,{enumerable:!0,configurable:!0,writable:!0,value:e}):C[i]=e,o=(C,i)=>{for(var e in i||(i={}))P2.call(i,e)&&E2(C,e,i[e]);if(t2)for(var e of t2(i))G2.call(i,e)&&E2(C,e,i[e]);return C},d=(C,i)=>T3(C,A3(i));var u=(C,i)=>{var e={};for(var n in C)P2.call(C,n)&&i.indexOf(n)<0&&(e[n]=C[n]);if(C!=null&&t2)for(var n of t2(C))i.indexOf(n)<0&&G2.call(C,n)&&(e[n]=C[n]);return e};var D3=(C,i)=>{for(var e in i)o2(C,e,{get:i[e],enumerable:!0})},D2=(C,i,e,n)=>{if(i&&typeof i=="object"||typeof i=="function")for(let r of E3(i))!P2.call(C,r)&&r!==e&&o2(C,r,{get:()=>i[r],enumerable:!(n=B3(i,r))||n.enumerable});return C};var H2=(C,i,e)=>(e=C!=null?S3(G3(C)):{},D2(i||!C||!C.__esModule?o2(e,"default",{value:C,enumerable:!0}):e,C)),I3=C=>D2(o2({},"__esModule",{value:!0}),C);var o1={};D3(o1,{Autocomplete:()=>k3,Checkbox:()=>o3,Creatable:()=>e3,DatePicker:()=>p3,Form:()=>$2,RadioButton:()=>n3,RadioGroup:()=>l3,Searchable:()=>Q2,Select:()=>Y2,Slider:()=>H3,Switch:()=>r3,TextField:()=>W2,TimePicker:()=>P3});module.exports=I3(o1);var I2=require("react"),s2=require("react-hook-form");var b2=require("react/jsx-runtime");function $3(p){var H=p,{children:C,onSubmit:i,style:e,disableDefaultValuesUpdate:n}=H,r=u(H,["children","onSubmit","style","disableDefaultValuesUpdate"]);let t=(0,s2.useForm)(r);(0,I2.useEffect)(()=>{n||t.reset(r.defaultValues)},[r.defaultValues,t.reset]);let V=()=>typeof C=="function"?C(d(o({},t),{onSubmit:t.handleSubmit(M=>i(M,t))})):C;return(0,b2.jsx)(s2.FormProvider,d(o({},t),{children:(0,b2.jsx)("form",{onSubmit:M=>{M.preventDefault(),M.stopPropagation(),t.handleSubmit(L=>i(L,t))()},style:e,children:V()})}))}var $2=$3;var d2=require("react"),V2=require("react-hook-form"),U=require("@mui/material");var q2={description:"M39.0611 23.1367C36.3276 17.015 30.4051 13.2479 24.027 13.0909C17.4971 13.2479 11.5746 17.172 8.84117 23.1367C8.68931 23.6076 8.68931 24.2355 8.84117 24.8633C11.5746 30.985 17.4971 34.7521 23.8752 34.9091C30.4051 34.7521 36.1757 30.828 38.9092 24.8633C39.3648 24.2355 39.3648 23.6076 39.0611 23.1367ZM24.027 32.0837C19.6231 31.9268 16.2822 28.1596 16.4341 23.6076C16.586 19.3695 19.9269 15.7593 24.027 15.7593C28.4309 15.9163 31.7718 19.6835 31.62 24.2355C31.4681 28.4735 28.1272 32.0837 24.027 32.0837ZM24.027 18.5847C23.5715 18.5847 23.1159 18.7417 22.6603 18.7417C23.4196 19.8404 23.2677 21.2531 22.3566 22.3519C21.4454 23.2937 20.0787 23.2937 19.0157 22.5088C18.5601 24.7063 19.3194 27.2178 21.1417 28.4735C22.964 29.7292 25.3938 29.7292 27.0642 28.3165C28.7347 26.9039 29.494 24.3924 28.7347 22.1949C28.1272 19.9974 26.1531 18.5847 24.027 18.5847Z",viewBox:"0 0 48 48",id:"line-eye-solid"},U2={description:"M23.9998 31.7412C19.9223 31.7412 16.6215 28.5851 16.3177 24.5854L10.6785 20.2272C9.93715 21.1573 9.25496 22.1405 8.70447 23.2157C8.58149 23.4589 8.51742 23.7277 8.51742 24.0003C8.51742 24.2729 8.58149 24.5416 8.70447 24.7849C11.6198 30.4731 17.3913 34.3216 23.9998 34.3216C25.4465 34.3216 26.842 34.1066 28.1871 33.7593L25.3976 31.6009C24.9369 31.6899 24.469 31.7369 23.9998 31.7412ZM40.8703 34.8646L34.9273 30.2715C36.7326 28.7501 38.2174 26.8848 39.2952 24.7843C39.4182 24.5411 39.4823 24.2723 39.4823 23.9997C39.4823 23.7272 39.4182 23.4584 39.2952 23.2151C36.3799 17.5269 30.6084 13.6784 23.9998 13.6784C21.2321 13.6817 18.5093 14.3785 16.0801 15.7051L9.24098 10.419C9.15179 10.3496 9.04981 10.2985 8.94085 10.2685C8.83189 10.2385 8.7181 10.2303 8.60597 10.2443C8.49384 10.2584 8.38557 10.2944 8.28736 10.3502C8.18914 10.4061 8.1029 10.4808 8.03356 10.5701L6.97828 11.9285C6.8383 12.1086 6.77557 12.3369 6.8039 12.5633C6.83223 12.7896 6.94929 12.9954 7.12934 13.1354L38.7587 37.581C38.8479 37.6504 38.9499 37.7016 39.0588 37.7315C39.1678 37.7615 39.2816 37.7697 39.3937 37.7557C39.5058 37.7416 39.6141 37.7057 39.7123 37.6498C39.8105 37.5939 39.8968 37.5192 39.9661 37.43L41.0219 36.0715C41.1619 35.8913 41.2245 35.663 41.1961 35.4366C41.1676 35.2103 41.0505 35.0045 40.8703 34.8646ZM30.9938 27.2309L28.8811 25.5977C29.059 25.0835 29.1534 24.5441 29.1606 24C29.1711 23.2034 28.9947 22.4155 28.6454 21.6995C28.2962 20.9836 27.7838 20.3595 27.1496 19.8774C26.5154 19.3953 25.777 19.0687 24.9937 18.9238C24.2103 18.7788 23.4039 18.8197 22.6392 19.0429C22.9634 19.4822 23.1387 20.0135 23.1397 20.5595C23.1317 20.7411 23.1039 20.9214 23.0569 21.097L19.0997 18.0387C20.4743 16.89 22.2085 16.2601 23.9998 16.2588C25.0166 16.2582 26.0235 16.4581 26.9629 16.8469C27.9024 17.2357 28.756 17.8059 29.475 18.5249C30.1939 19.2438 30.7641 20.0974 31.1529 21.0369C31.5418 21.9764 31.7416 22.9833 31.7411 24C31.7411 25.1628 31.4567 26.246 30.9938 27.2309Z",viewBox:"0 0 48 48",id:"line-eye-slash-solid"};var _={description:"M24 8C15.1613 8 8 15.2258 8 24C8 32.8387 15.1613 40 24 40C32.7742 40 40 32.8387 40 24C40 15.2258 32.7742 8 24 8ZM24 15.0968C25.4839 15.0968 26.7097 16.3226 26.7097 17.8065C26.7097 19.3548 25.4839 20.5161 24 20.5161C22.4516 20.5161 21.2903 19.3548 21.2903 17.8065C21.2903 16.3226 22.4516 15.0968 24 15.0968ZM27.6129 31.4839C27.6129 31.9355 27.2258 32.2581 26.8387 32.2581H21.1613C20.7097 32.2581 20.3871 31.9355 20.3871 31.4839V29.9355C20.3871 29.5484 20.7097 29.1613 21.1613 29.1613H21.9355V25.0323H21.1613C20.7097 25.0323 20.3871 24.7097 20.3871 24.2581V22.7097C20.3871 22.3226 20.7097 21.9355 21.1613 21.9355H25.2903C25.6774 21.9355 26.0645 22.3226 26.0645 22.7097V29.1613H26.8387C27.2258 29.1613 27.6129 29.5484 27.6129 29.9355V31.4839Z",viewBox:"0 0 48 48",id:"line-info-circle-solid"},R2={description:"M35.8286 21.8493H26.1506V12.1714C26.1506 11.6338 25.613 11.0961 25.0753 11.0961H22.9247C22.3198 11.0961 21.8493 11.6338 21.8493 12.1714V21.8493H12.1714C11.5666 21.8493 11.0961 22.387 11.0961 22.9247V25.0753C11.0961 25.6802 11.5666 26.1506 12.1714 26.1506H21.8493V35.8286C21.8493 36.4334 22.3198 36.9039 22.9247 36.9039H25.0753C25.613 36.9039 26.1506 36.4334 26.1506 35.8286V26.1506H35.8286C36.3662 26.1506 36.9039 25.6802 36.9039 25.0753V22.9247C36.9039 22.387 36.3662 21.8493 35.8286 21.8493Z",viewBox:"0 0 48 48",id:"line-plus-solid"};var z2={description:"M25.4929 17.0061L30.9936 22.5071L19.049 34.4522L14.1447 34.9936C13.4881 35.0662 12.9334 34.511 13.0065 33.8545L13.5522 28.9465L25.4929 17.0061ZM34.3958 16.1872L31.813 13.6043C31.0073 12.7986 29.7007 12.7986 28.8951 13.6043L26.4652 16.0342L31.966 21.5351L34.3958 19.1052C35.2014 18.2991 35.2014 16.9928 34.3958 16.1872Z",id:"line-pen-solid"};var K=H2(require("@s_mart/masks"));var w2=require("@mui/material"),O2=require("@s_mart/utils"),r2=require("react/jsx-runtime"),F=({label:C,required:i,regular:e})=>(0,r2.jsxs)("span",{style:{display:"flex",alignItems:"center",gap:(0,O2.toRem)(2)},children:[(0,r2.jsx)(w2.Typography,{variant:"caption",fontWeight:e?400:700,style:{display:"flex",alignItems:"center"},children:C}),i&&(0,r2.jsx)(w2.Typography,{variant:"caption",fontWeight:900,color:"error",children:"*"})]});var _2=require("react-hook-form"),N2=require("@s_mart/core");var B=(C,i)=>{var e,n,r,p;if(C[i])return C[i];if(i.includes("[")){let[H,t]=i.split("["),[V,M]=t.split("].");return(n=(e=C[H])==null?void 0:e[V])==null?void 0:n[M]}if(i.includes(".")){let[H,t,V]=i.split(".");return(p=(r=C[H])==null?void 0:r[t])==null?void 0:p[V]}};var j2=require("react/jsx-runtime"),S=({name:C})=>{var n;let i=(0,_2.useFormContext)(),e=B((n=i==null?void 0:i.formState)==null?void 0:n.errors,C);return e?(0,j2.jsx)(N2.Indicator,{severity:"error",children:e==null?void 0:e.message}):null};var n2=require("@s_mart/core");var A=require("react/jsx-runtime"),q3=w=>{var Z=w,{name:C,rules:i,defaultValue:e,shouldUnregister:n,label:r,required:p,mask:H,variant:t="outlined",info:V,parse:M,format:L,onInputChange:s}=Z,f=u(Z,["name","rules","defaultValue","shouldUnregister","label","required","mask","variant","info","parse","format","onInputChange"]);let l=(0,V2.useFormContext)();if(!l)throw new Error("Para usar o <TextField /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let[g,b]=(0,d2.useState)(!1),q=m=>{var a;let T=m;return L&&(T=L(m)),H?(a=K==null?void 0:K[H])==null?void 0:a.format(T):T},k=m=>{var a;let T=m;return M&&(T=M(m)),H?(a=K==null?void 0:K[H])==null?void 0:a.parse(T):T},v=m=>{if(!m||H!=="porcentagem")return;m==null||m.stopPropagation();let T=(m==null?void 0:m.target).value;if(T){let a=String(T);if(a.length>0){let x=a.indexOf("%");x>-1&&(m.currentTarget.selectionEnd=x)}}},h=B(l.formState.errors,C);return(0,A.jsx)(V2.Controller,{control:l.control,name:C,rules:i,defaultValue:e,shouldUnregister:n,render:({field:{value:m,onChange:T}})=>(0,A.jsxs)(U.Grid,{display:"flex",flexDirection:"column",children:[(0,A.jsx)(U.Grid,{item:!0,xs:12,children:(0,A.jsxs)(U.Grid,{container:!0,direction:"row",children:[r&&(0,A.jsx)(U.Grid,{item:!0,children:(0,A.jsx)(F,{label:r,required:p})}),V&&(0,A.jsx)(U.Grid,{item:!0,children:(0,A.jsx)(n2.Tooltip,{title:V,placement:"top",children:(0,A.jsx)("div",{style:{width:"fit-content"},children:(0,A.jsx)(n2.LIcon,{icon:_,color:"#757575"})})})})]})}),(0,A.jsx)(U.TextField,d(o({variant:t,autoComplete:"off",defaultValue:e,value:q(m||""),onChange:a=>{var x,A2;T(k((x=a==null?void 0:a.target)==null?void 0:x.value)),s==null||s(a,(A2=a==null?void 0:a.target)==null?void 0:A2.value,l.watch())},error:Boolean(h)},f),{type:f.type==="password"?g?"text":"password":f.type,InputProps:o({onKeyDown:v,endAdornment:f.type==="password"&&(0,A.jsx)(U.InputAdornment,{position:"end",onClick:()=>b(!g),style:{cursor:"pointer"},children:(0,A.jsx)(n2.LIcon,{icon:g?q2:U2,size:"24px",removeMargin:!0})})},f.InputProps)})),(0,A.jsx)(S,{name:C})]})})},W2=(0,d2.memo)(q3);var L2=require("react"),a2=require("react-hook-form"),Q=require("@s_mart/core"),E=require("@mui/material");var P=require("react/jsx-runtime"),U3=w=>{var Z=w,{name:C,rules:i,defaultValue:e,shouldUnregister:n,label:r,required:p,options:H,placeholder:t,onInputChange:V,footer:M,multiple:L,info:s}=Z,f=u(Z,["name","rules","defaultValue","shouldUnregister","label","required","options","placeholder","onInputChange","footer","multiple","info"]);let l=(0,a2.useFormContext)(),{palette:g}=(0,E.useTheme)(),[b,q]=(0,L2.useState)(!1);if(!l)throw new Error("Para usar o <Select /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let k=B(l.formState.errors,C);return console.warn=()=>{},(0,P.jsx)(a2.Controller,{control:l.control,name:C,rules:i,defaultValue:e||"",shouldUnregister:n,render:({field:{value:v,onChange:h}})=>(0,P.jsxs)(E.Grid,{display:"flex",flexDirection:"column",children:[(0,P.jsx)(E.Grid,{item:!0,xs:12,children:(0,P.jsxs)(E.Grid,{container:!0,direction:"row",children:[r&&(0,P.jsx)(E.Grid,{item:!0,children:(0,P.jsx)(F,{label:r,required:p})}),s&&(0,P.jsx)(E.Grid,{item:!0,children:(0,P.jsx)(Q.Tooltip,{title:s,placement:"top",children:(0,P.jsx)("div",{style:{width:"fit-content"},children:(0,P.jsx)(Q.LIcon,{icon:_,color:"#757575"})})})})]})}),(0,P.jsxs)(E.Select,d(o({open:b,onOpen:()=>q(!0),onClose:()=>q(!1),displayEmpty:Boolean(t),variant:"outlined",autoComplete:"off",value:v||(L?[]:null),multiple:L,onChange:m=>{h(m.target.value),V==null||V(m,m.target.value,l.watch())},error:Boolean(k),size:f.size||"medium"},f),{children:[t&&(0,P.jsx)(E.MenuItem,{disabled:!0,value:"",children:(0,P.jsx)("p",{style:{color:g.grey[400]},children:t})}),H==null?void 0:H.map((m,T)=>(0,P.jsx)(E.MenuItem,{value:m.value,children:m.label},T)),M&&(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(E.Grid,{px:2,py:1,children:(0,P.jsx)(Q.Divider,{})}),M({closeSelect:()=>q(!1)})]})]})),(0,P.jsx)(S,{name:C})]})})},Y2=(0,L2.memo)(U3);var K2=require("react"),M2=require("react-hook-form"),G=require("@mui/material");var J=require("@s_mart/core");var y=require("react/jsx-runtime"),k2=require("react"),R3=w=>{var Z=w,{name:C,rules:i,defaultValue:e,shouldUnregister:n,label:r,required:p,options:H,textFieldProps:t,noOptionsText:V,footer:M,multiple:L,info:s}=Z,f=u(Z,["name","rules","defaultValue","shouldUnregister","label","required","options","textFieldProps","noOptionsText","footer","multiple","info"]);let l=(0,M2.useFormContext)();if(!l)throw new Error("Para usar o <Searchable /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let g=B(l.formState.errors,C);return console.warn=()=>{},(0,y.jsx)(M2.Controller,{control:l.control,name:C,rules:i,defaultValue:e,shouldUnregister:n,render:({field:{onChange:b,value:q}})=>(0,y.jsxs)(G.Grid,{display:"flex",flexDirection:"column",children:[(0,y.jsx)(G.Grid,{display:"flex",flexDirection:"column",children:(0,y.jsx)(G.Grid,{item:!0,xs:12,children:(0,y.jsxs)(G.Grid,{container:!0,direction:"row",children:[r&&(0,y.jsx)(G.Grid,{item:!0,children:(0,y.jsx)(F,{label:r,required:p})}),s&&(0,y.jsx)(G.Grid,{item:!0,children:(0,y.jsx)(J.Tooltip,{title:s,placement:"top",children:(0,y.jsx)("div",{style:{width:"fit-content"},children:(0,y.jsx)(J.LIcon,{icon:_,color:"#757575"})})})})]})})}),(0,y.jsx)(G.Autocomplete,d(o({onChange:(k,v)=>b(v),value:q||(L?[]:null),options:H,multiple:L,noOptionsText:V||"Nenhuma op\xE7\xE3o encontrada",isOptionEqualToValue:(k,v)=>typeof k=="string"&&typeof v=="string"?k===v:typeof k=="object"&&typeof v=="object"?k.value===v.value:!1,renderOption:(k,v)=>typeof v=="object"?(0,k2.createElement)("li",d(o({},k),{key:v.key||v.value}),v.label):(0,k2.createElement)("li",d(o({},k),{key:v}),v),ListboxComponent:k=>(0,y.jsxs)("ul",d(o({},k),{children:[k.children,M&&(0,y.jsx)("li",{children:(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(G.Grid,{px:2,py:1,children:(0,y.jsx)(J.Divider,{})}),M]})},"searchable-footer")]}))},f),{renderInput:k=>(0,y.jsx)(G.TextField,o(o({error:Boolean(g)},k),t))})),(0,y.jsx)(S,{name:C})]})})},Q2=(0,K2.memo)(R3);var i3=require("react"),Z2=require("react-hook-form"),D=require("@mui/material");var O=require("@s_mart/utils"),v2=H2(require("@emotion/styled")),S2=require("@emotion/react"),J2=S2.css`
2
2
  display: flex;
3
3
  align-items: center;
4
4
  justify-content: center;
5
- `,$3=C=>h2.css`
5
+ `,z3=C=>S2.css`
6
6
  .MuiAutocomplete-endAdornment {
7
7
  position: relative;
8
8
  right: 0;
9
9
  }
10
10
 
11
- .creatable {
12
- ${j2}
11
+ .creatable,
12
+ .editable {
13
+ ${J2}
13
14
 
14
15
  .divider {
15
16
  width: 1px;
16
- height: ${(0,$.toRem)(20)};
17
+ height: ${(0,O.toRem)(20)};
17
18
  background-color: ${C.palette.grey[400]};
18
19
  }
19
20
 
@@ -24,9 +25,9 @@
24
25
  color: ${C.palette.grey[600]};
25
26
  border-radius: 50%;
26
27
 
27
- margin: 0 ${(0,$.toRem)(6)};
28
- width: ${(0,$.toRem)(28)};
29
- height: ${(0,$.toRem)(28)};
28
+ margin: 0 ${(0,O.toRem)(6)};
29
+ width: ${(0,O.toRem)(28)};
30
+ height: ${(0,O.toRem)(28)};
30
31
 
31
32
  &:hover {
32
33
  cursor: pointer;
@@ -35,48 +36,48 @@
35
36
  }
36
37
  }
37
38
  }
38
- `,W2=y2.default.div`
39
+ `,X2=v2.default.div`
39
40
  display: flex;
40
41
 
41
42
  div.endAdornments {
42
43
  position: absolute;
43
44
  right: 0;
44
45
 
45
- ${j2}
46
+ ${J2}
46
47
  }
47
48
 
48
- ${({hideAddButton:C,theme:i})=>!C&&$3(i)}
49
- `,Y2=y2.default.div`
49
+ ${({hideAddButton:C,theme:i})=>!C&&z3(i)}
50
+ `,C3=v2.default.div`
50
51
  color: ${({theme:C})=>C.palette.text.primary};
51
52
 
52
- padding: ${(0,$.toRem)(6)} ${(0,$.toRem)(16)};
53
- margin: ${(0,$.toRem)(-6)} ${(0,$.toRem)(-16)};
53
+ padding: ${(0,O.toRem)(6)} ${(0,O.toRem)(16)};
54
+ margin: ${(0,O.toRem)(-6)} ${(0,O.toRem)(-16)};
54
55
 
55
56
  &:hover {
56
57
  cursor: pointer;
57
58
  transition: background-color 0.2s ease-in-out;
58
59
  background-color: ${({theme:C})=>C.palette.grey[100]};
59
60
  }
60
- `;var Q2=require("@s_mart/core");var k=require("react/jsx-runtime"),F2=require("react"),q3=d=>{var h=d,{name:C,rules:i,defaultValue:e,shouldUnregister:n,label:r,required:m,options:H,onCreateOption:l,textFieldProps:V,hideAddButton:Z}=h,a=f(h,["name","rules","defaultValue","shouldUnregister","label","required","options","onCreateOption","textFieldProps","hideAddButton"]);let c=(0,s2.useFormContext)();if(!c)throw new Error("Para usar o <Creatable /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let p=w(c.formState.errors,C);console.warn=()=>{};let t=L=>{l?l(L):console.error("onCreateOption n\xE3o foi definido")};return(0,k.jsx)(s2.Controller,{control:c.control,name:C,rules:i,defaultValue:e,shouldUnregister:n,render:({field:{value:L,onChange:M}})=>{let x=(L==null?void 0:L.label)||(L==null?void 0:L.value)||L;return(0,k.jsxs)(q.Grid,{display:"flex",flexDirection:"column",children:[r&&(0,k.jsx)(g,{label:r,required:m}),(0,k.jsx)(W2,{hideAddButton:Z,children:(0,k.jsx)(q.Autocomplete,s(o({fullWidth:!0,onChange:(F,u)=>M(u),options:H,value:L||null,noOptionsText:(0,k.jsx)(Y2,{onClick:()=>t(L),children:(0,k.jsxs)(q.Typography,{children:["Adicionar ",x&&`"${x}"`]})}),isOptionEqualToValue:(F,u)=>u?typeof F=="string"&&typeof u=="string"?F===u:typeof F=="object"&&typeof u=="object"?F.value===u.value:typeof F=="object"&&typeof u=="string":!1,renderOption:(F,u)=>typeof u=="object"?(0,F2.createElement)("li",s(o({},F),{key:u.key||u.value}),u.label):(0,F2.createElement)("li",s(o({},F),{key:u}),u)},a),{renderInput:F=>{let u=Z?F.InputProps:s(o({},F.InputProps),{endAdornment:(0,k.jsxs)("div",{className:"endAdornments",children:[F.InputProps.endAdornment,(0,k.jsxs)("div",{className:"creatable",children:[(0,k.jsx)("div",{className:"divider"}),(0,k.jsx)("div",{className:"button",onClick:()=>t(L),children:(0,k.jsx)(Q2.LIcon,{icon:E2,size:"24px",removeMargin:!0})})]})]})});return(0,k.jsx)(q.TextField,o(s(o({},F),{error:Boolean(p),onChange:M,InputProps:u}),V))}}))}),(0,k.jsx)(y,{name:C})]})}})},J2=(0,K2.memo)(q3);var V2=require("react-hook-form"),W=require("@mui/material");var U=require("react/jsx-runtime"),U3=V=>{var Z=V,{name:C,rules:i,defaultValue:e,shouldUnregister:n,label:r,labelPlacement:m,required:H}=Z,l=f(Z,["name","rules","defaultValue","shouldUnregister","label","labelPlacement","required"]);let a=(0,V2.useFormContext)();if(!a)throw new Error("Para usar o <Checkbox /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");return(0,U.jsx)(V2.Controller,{control:a.control,name:C,rules:i,defaultValue:e,shouldUnregister:n,render:({field:{value:d,onChange:h}})=>(0,U.jsxs)(W.Grid,{display:"flex",flexDirection:"column",children:[(0,U.jsx)(W.FormControlLabel,{control:(0,U.jsx)(W.Checkbox,o({value:d!=null?d:"",defaultValue:d,onChange:h},l)),label:(0,U.jsx)(g,{label:r,required:H,regular:!0}),labelPlacement:m||"end"}),(0,U.jsx)(y,{name:C})]})})},X2=U3;var d2=require("react-hook-form"),Y=require("@mui/material");var R=require("react/jsx-runtime"),R3=l=>{var V=l,{name:C,rules:i,defaultValue:e,shouldUnregister:n,label:r,labelPlacement:m}=V,H=f(V,["name","rules","defaultValue","shouldUnregister","label","labelPlacement"]);let Z=(0,d2.useFormContext)();if(!Z)throw new Error("Para usar o <Switch /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");return(0,R.jsx)(d2.Controller,{control:Z.control,name:C,rules:i,defaultValue:e,shouldUnregister:n,render:({field:{value:a,onChange:d}})=>(0,R.jsxs)(Y.Grid,{display:"flex",flexDirection:"column",children:[(0,R.jsx)(Y.FormControlLabel,{control:(0,R.jsx)(Y.Switch,o({value:a!=null?a:"",defaultValue:a,onChange:d},H)),label:(0,R.jsx)(g,{label:r}),labelPlacement:m||"end"}),(0,R.jsx)(y,{name:C})]})})},C3=R3;var K=require("@mui/material");var C2=require("react/jsx-runtime"),z3=n=>{var r=n,{label:C,labelPlacement:i}=r,e=f(r,["label","labelPlacement"]);return(0,C2.jsx)(K.Grid,{display:"flex",flexDirection:"column",children:(0,C2.jsx)(K.FormControlLabel,{control:(0,C2.jsx)(K.Radio,o({},e)),label:(0,C2.jsx)(g,{label:C}),labelPlacement:i||"end"})})},i3=z3;var L2=require("react-hook-form"),a2=require("@mui/material");var _=require("react/jsx-runtime"),O3=Z=>{var a=Z,{name:C,rules:i,defaultValue:e,shouldUnregister:n,label:r,required:m,children:H,orientation:l="row"}=a,V=f(a,["name","rules","defaultValue","shouldUnregister","label","required","children","orientation"]);let d=(0,L2.useFormContext)();if(!d)throw new Error("Para usar o <RadioGroup /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");return(0,_.jsx)(L2.Controller,{control:d.control,name:C,rules:i,defaultValue:e,shouldUnregister:n,render:({field:{value:h,onChange:c}})=>(0,_.jsxs)(a2.Grid,{display:"flex",flexDirection:"column",children:[r&&(0,_.jsx)(g,{label:r,required:m}),(0,_.jsx)(a2.RadioGroup,s(o({value:h||"",onChange:c,name:C},V),{style:{display:"flex",flexDirection:l},children:H})),(0,_.jsx)(y,{name:C})]})})},e3=O3;var M2=require("react-hook-form"),o3=require("@mui/material");var P2=require("react/jsx-runtime"),_3=m=>{var H=m,{name:C,rules:i,defaultValue:e,shouldUnregister:n}=H,r=f(H,["name","rules","defaultValue","shouldUnregister"]);let l=(0,M2.useFormContext)();if(!l)throw new Error("Para usar o <Slider /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");return(0,P2.jsx)(M2.Controller,{control:l.control,name:C,rules:i,defaultValue:e,shouldUnregister:n,render:({field:{value:V,onChange:Z}})=>(0,P2.jsx)(o3.Slider,o({value:V||(r==null?void 0:r.min)||0,onChange:Z,valueLabelDisplay:"auto"},r))})},r3=_3;var H3=require("react"),Z2=require("react-hook-form"),t3=require("@s_mart/core"),s3=require("@mui/material"),V3=require("@mui/x-date-pickers/DatePicker"),d3=require("@mui/x-date-pickers/AdapterDayjs"),L3=require("@mui/x-date-pickers/LocalizationProvider");var A=require("@s_mart/utils"),n3=e2(require("@emotion/styled")),N3=C=>{switch(C){case"small":return(0,A.toRem)(16);default:case"medium":return(0,A.toRem)(20);case"large":return(0,A.toRem)(24)}},j3=C=>{switch(C){case"small":return`${(0,A.toRem)(2)} ${(0,A.toRem)(8)}`;default:case"medium":return`${(0,A.toRem)(6)} ${(0,A.toRem)(8)}`;case"large":return`${(0,A.toRem)(10)}`}},l3=n3.default.div`
61
+ `;var X=require("@s_mart/core");var c2=require("lodash");var c=require("react/jsx-runtime"),T2=require("react"),O3=l=>{var g=l,{name:C,rules:i,defaultValue:e,shouldUnregister:n,label:r,required:p,options:H,editable:t,onEditOption:V,onCreateOption:M,textFieldProps:L,hideAddButton:s,multiple:f,info:w}=g,Z=u(g,["name","rules","defaultValue","shouldUnregister","label","required","options","editable","onEditOption","onCreateOption","textFieldProps","hideAddButton","multiple","info"]);let b=(0,Z2.useFormContext)();if(!b)throw new Error("Para usar o <Creatable /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let q=B(b.formState.errors,C);console.warn=()=>{};let k=h=>{M?M(h):console.error("onCreateOption n\xE3o foi definido")},v=h=>{V?V(h):console.error("onEditOption n\xE3o foi definido")};return(0,c.jsx)(Z2.Controller,{control:b.control,name:C,rules:i,defaultValue:e,shouldUnregister:n,render:({field:{value:h,onChange:m}})=>{let T=(h==null?void 0:h.label)||(h==null?void 0:h.value)||h;return(0,c.jsxs)(D.Grid,{display:"flex",flexDirection:"column",children:[(0,c.jsx)(D.Grid,{item:!0,xs:12,children:(0,c.jsxs)(D.Grid,{container:!0,direction:"row",children:[r&&(0,c.jsx)(D.Grid,{item:!0,children:(0,c.jsx)(F,{label:r,required:p})}),w&&(0,c.jsx)(D.Grid,{item:!0,children:(0,c.jsx)(X.Tooltip,{title:w,placement:"top",children:(0,c.jsx)("div",{style:{width:"fit-content"},children:(0,c.jsx)(X.LIcon,{icon:_,color:"#757575"})})})})]})}),(0,c.jsx)(X2,{hideAddButton:s,children:(0,c.jsx)(D.Autocomplete,d(o({fullWidth:!0,onChange:(a,x)=>m(x),options:H,value:h||(f?[]:null),multiple:f,noOptionsText:(0,c.jsx)(C3,{onClick:()=>k(h),children:(0,c.jsxs)(D.Typography,{children:["Adicionar ",T&&`"${T}"`]})}),isOptionEqualToValue:(a,x)=>x?typeof a=="string"&&typeof x=="string"?a===x:typeof a=="object"&&typeof x=="object"?a.value===x.value:typeof a=="object"&&typeof x=="string":!1,renderOption:(a,x)=>typeof x=="object"?(0,T2.createElement)("li",d(o({},a),{key:x.key||x.value}),x.label):(0,T2.createElement)("li",d(o({},a),{key:x}),x)},Z),{renderInput:a=>{let x=s?a.InputProps:d(o({},a.InputProps),{endAdornment:(0,c.jsxs)("div",{className:"endAdornments",children:[a.InputProps.endAdornment,t&&(0,c2.isObject)(h)&&!(0,c2.isEmpty)(h)?(0,c.jsxs)("div",{className:"editable",children:[(0,c.jsx)("div",{className:"divider"}),(0,c.jsx)("div",{className:"button",onClick:()=>v(h),children:(0,c.jsx)(X.LIcon,{icon:z2,size:"24px",removeMargin:!0})})]}):null,(0,c.jsxs)("div",{className:"creatable",children:[(0,c.jsx)("div",{className:"divider"}),(0,c.jsx)("div",{className:"button",onClick:()=>k(h),children:(0,c.jsx)(X.LIcon,{icon:R2,size:"24px",removeMargin:!0})})]})]})});return(0,c.jsx)(D.TextField,o(d(o({},a),{error:Boolean(q),onChange:m,InputProps:x}),L))}}))}),(0,c.jsx)(S,{name:C})]})}})},e3=(0,i3.memo)(O3);var p2=require("react-hook-form"),C2=require("@mui/material");var N=require("react/jsx-runtime"),_3=V=>{var M=V,{name:C,rules:i,defaultValue:e,shouldUnregister:n,label:r,labelPlacement:p,required:H}=M,t=u(M,["name","rules","defaultValue","shouldUnregister","label","labelPlacement","required"]);let L=(0,p2.useFormContext)();if(!L)throw new Error("Para usar o <Checkbox /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");return(0,N.jsx)(p2.Controller,{control:L.control,name:C,rules:i,defaultValue:e,shouldUnregister:n,render:({field:{value:s,onChange:f}})=>(0,N.jsxs)(C2.Grid,{display:"flex",flexDirection:"column",children:[(0,N.jsx)(C2.FormControlLabel,{control:(0,N.jsx)(C2.Checkbox,o({value:s!=null?s:"",defaultValue:s,onChange:f},t)),label:(0,N.jsx)(F,{label:r,required:H,regular:!0}),labelPlacement:p||"end"}),(0,N.jsx)(S,{name:C})]})})},o3=_3;var m2=require("react-hook-form"),i2=require("@mui/material");var j=require("react/jsx-runtime"),N3=t=>{var V=t,{name:C,rules:i,defaultValue:e,shouldUnregister:n,label:r,labelPlacement:p}=V,H=u(V,["name","rules","defaultValue","shouldUnregister","label","labelPlacement"]);let M=(0,m2.useFormContext)();if(!M)throw new Error("Para usar o <Switch /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");return(0,j.jsx)(m2.Controller,{control:M.control,name:C,rules:i,defaultValue:e,shouldUnregister:n,render:({field:{value:L,onChange:s}})=>(0,j.jsxs)(i2.Grid,{display:"flex",flexDirection:"column",children:[(0,j.jsx)(i2.FormControlLabel,{control:(0,j.jsx)(i2.Switch,o({value:L!=null?L:"",defaultValue:L,onChange:s},H)),label:(0,j.jsx)(F,{label:r}),labelPlacement:p||"end"}),(0,j.jsx)(S,{name:C})]})})},r3=N3;var e2=require("@mui/material");var l2=require("react/jsx-runtime"),j3=n=>{var r=n,{label:C,labelPlacement:i}=r,e=u(r,["label","labelPlacement"]);return(0,l2.jsx)(e2.Grid,{display:"flex",flexDirection:"column",children:(0,l2.jsx)(e2.FormControlLabel,{control:(0,l2.jsx)(e2.Radio,o({},e)),label:(0,l2.jsx)(F,{label:C}),labelPlacement:i||"end"})})},n3=j3;var u2=require("react-hook-form"),f2=require("@mui/material");var Y=require("react/jsx-runtime"),W3=M=>{var L=M,{name:C,rules:i,defaultValue:e,shouldUnregister:n,label:r,required:p,children:H,orientation:t="row"}=L,V=u(L,["name","rules","defaultValue","shouldUnregister","label","required","children","orientation"]);let s=(0,u2.useFormContext)();if(!s)throw new Error("Para usar o <RadioGroup /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");return(0,Y.jsx)(u2.Controller,{control:s.control,name:C,rules:i,defaultValue:e,shouldUnregister:n,render:({field:{value:f,onChange:w}})=>(0,Y.jsxs)(f2.Grid,{display:"flex",flexDirection:"column",children:[r&&(0,Y.jsx)(F,{label:r,required:p}),(0,Y.jsx)(f2.RadioGroup,d(o({value:f||"",onChange:w,name:C},V),{style:{display:"flex",flexDirection:t},children:H})),(0,Y.jsx)(S,{name:C})]})})},l3=W3;var g2=require("react-hook-form"),t3=require("@mui/material");var B2=require("react/jsx-runtime"),Y3=p=>{var H=p,{name:C,rules:i,defaultValue:e,shouldUnregister:n}=H,r=u(H,["name","rules","defaultValue","shouldUnregister"]);let t=(0,g2.useFormContext)();if(!t)throw new Error("Para usar o <Slider /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");return(0,B2.jsx)(g2.Controller,{control:t.control,name:C,rules:i,defaultValue:e,shouldUnregister:n,render:({field:{value:V,onChange:M}})=>(0,B2.jsx)(t3.Slider,o({value:V||(r==null?void 0:r.min)||0,onChange:M,valueLabelDisplay:"auto"},r))})},H3=Y3;var V3=require("react"),x2=require("react-hook-form"),L3=require("@s_mart/core"),a3=require("@mui/material"),M3=require("@mui/x-date-pickers/DatePicker"),Z3=require("@mui/x-date-pickers/AdapterDayjs"),c3=require("@mui/x-date-pickers/LocalizationProvider");var I=require("@s_mart/utils"),s3=H2(require("@emotion/styled")),K3=C=>{switch(C){case"small":return(0,I.toRem)(16);default:case"medium":return(0,I.toRem)(20);case"large":return(0,I.toRem)(24)}},Q3=C=>{switch(C){case"small":return`${(0,I.toRem)(2)} ${(0,I.toRem)(8)}`;default:case"medium":return`${(0,I.toRem)(6)} ${(0,I.toRem)(8)}`;case"large":return`${(0,I.toRem)(10)}`}},d3=s3.default.div`
61
62
  > div > button {
62
- padding: ${({size:C})=>j3(C)};
63
- border-radius: 0 ${(0,A.toRem)(4)} ${(0,A.toRem)(4)} 0;
63
+ padding: ${({size:C})=>Q3(C)};
64
+ border-radius: 0 ${(0,I.toRem)(4)} ${(0,I.toRem)(4)} 0;
64
65
 
65
66
  margin: 0px -13px 0px 0px;
66
67
 
67
68
  svg {
68
- width: ${({size:C})=>N3(C)};
69
+ width: ${({size:C})=>K3(C)};
69
70
  }
70
71
  }
71
- `;var D=require("react/jsx-runtime"),W3=Z=>{var a=Z,{rules:C,name:i,defaultValue:e,shouldUnregister:n,datePickerProps:r,label:m,required:H,placeholder:l}=a,V=f(a,["rules","name","defaultValue","shouldUnregister","datePickerProps","label","required","placeholder"]);let d=(0,Z2.useFormContext)();if(!d)throw new Error("Para usar o <DataPicker /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let h=w(d.formState.errors,i);return(0,D.jsx)(L3.LocalizationProvider,{dateAdapter:d3.AdapterDayjs,children:(0,D.jsx)(Z2.Controller,{control:d.control,name:i,rules:C,defaultValue:e,shouldUnregister:n,render:({field:{value:c,onChange:p}})=>(0,D.jsxs)(t3.Grid,{display:"flex",flexDirection:"column",children:[m&&(0,D.jsx)(g,{label:m,required:H}),(0,D.jsx)(V3.DatePicker,s(o({},r),{value:c!=null?c:null,inputFormat:(r==null?void 0:r.inputFormat)||"DD/MM/YYYY",onChange:p,renderInput:t=>{var L,M;return(0,D.jsx)(s3.TextField,s(o(s(o({variant:"outlined"},t),{error:Boolean(h)}),V),{inputProps:s(o({},t.inputProps),{placeholder:l||((L=t.inputProps)==null?void 0:L.placeholder)}),InputProps:s(o({},t.InputProps),{endAdornment:(0,D.jsx)(l3,{size:V.size,children:(M=t.InputProps)==null?void 0:M.endAdornment})})}))}})),(0,D.jsx)(y,{name:i})]})})})},a3=(0,H3.memo)(W3);var c3=require("@s_mart/core"),p3=require("@mui/x-date-pickers/TimePicker"),m3=require("@mui/material"),c2=require("react-hook-form"),u3=require("@mui/x-date-pickers/AdapterDayjs"),f3=require("@mui/x-date-pickers/LocalizationProvider");var T=require("@s_mart/utils"),M3=e2(require("@emotion/styled")),Y3=C=>{switch(C){case"small":return(0,T.toRem)(16);default:case"medium":return(0,T.toRem)(20);case"large":return(0,T.toRem)(24)}},K3=C=>{switch(C){case"small":return`${(0,T.toRem)(2)} ${(0,T.toRem)(8)}`;default:case"medium":return`${(0,T.toRem)(6)} ${(0,T.toRem)(8)}`;case"large":return`${(0,T.toRem)(10)}`}},Z3=M3.default.div`
72
+ `;var R=require("react/jsx-runtime"),J3=M=>{var L=M,{rules:C,name:i,defaultValue:e,shouldUnregister:n,datePickerProps:r,label:p,required:H,placeholder:t}=L,V=u(L,["rules","name","defaultValue","shouldUnregister","datePickerProps","label","required","placeholder"]);let s=(0,x2.useFormContext)();if(!s)throw new Error("Para usar o <DataPicker /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let f=B(s.formState.errors,i);return(0,R.jsx)(c3.LocalizationProvider,{dateAdapter:Z3.AdapterDayjs,children:(0,R.jsx)(x2.Controller,{control:s.control,name:i,rules:C,defaultValue:e,shouldUnregister:n,render:({field:{value:w,onChange:Z}})=>(0,R.jsxs)(L3.Grid,{display:"flex",flexDirection:"column",children:[p&&(0,R.jsx)(F,{label:p,required:H}),(0,R.jsx)(M3.DatePicker,d(o({},r),{value:w!=null?w:null,inputFormat:(r==null?void 0:r.inputFormat)||"DD/MM/YYYY",onChange:Z,renderInput:l=>{var g,b;return(0,R.jsx)(a3.TextField,d(o(d(o({variant:"outlined"},l),{error:Boolean(f)}),V),{inputProps:d(o({},l.inputProps),{placeholder:t||((g=l.inputProps)==null?void 0:g.placeholder)}),InputProps:d(o({},l.InputProps),{endAdornment:(0,R.jsx)(d3,{size:V.size,children:(b=l.InputProps)==null?void 0:b.endAdornment})})}))}})),(0,R.jsx)(S,{name:i})]})})})},p3=(0,V3.memo)(J3);var f3=require("@s_mart/core"),g3=require("@mui/x-date-pickers/TimePicker"),x3=require("@mui/material"),y2=require("react-hook-form"),y3=require("@mui/x-date-pickers/AdapterDayjs"),h3=require("@mui/x-date-pickers/LocalizationProvider");var $=require("@s_mart/utils"),m3=H2(require("@emotion/styled")),X3=C=>{switch(C){case"small":return(0,$.toRem)(16);default:case"medium":return(0,$.toRem)(20);case"large":return(0,$.toRem)(24)}},C1=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)}`}},u3=m3.default.div`
72
73
  > div > button {
73
- padding: ${({size:C})=>K3(C)};
74
- border-radius: 0 ${(0,T.toRem)(4)} ${(0,T.toRem)(4)} 0;
74
+ padding: ${({size:C})=>C1(C)};
75
+ border-radius: 0 ${(0,$.toRem)(4)} ${(0,$.toRem)(4)} 0;
75
76
 
76
77
  margin: 0px -13px 0px 0px;
77
78
 
78
79
  svg {
79
- width: ${({size:C})=>Y3(C)};
80
+ width: ${({size:C})=>X3(C)};
80
81
  }
81
82
  }
82
- `;var g3=require("react");var I=require("react/jsx-runtime"),Q3=Z=>{var a=Z,{rules:C,defaultValue:i,shouldUnregister:e,name:n,required:r,label:m,timePickerProps:H,placeholder:l}=a,V=f(a,["rules","defaultValue","shouldUnregister","name","required","label","timePickerProps","placeholder"]);let d=(0,c2.useFormContext)();if(!d)throw new Error("Para usar o <TimePicker /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let h=w(d.formState.errors,n);return(0,I.jsx)(f3.LocalizationProvider,{dateAdapter:u3.AdapterDayjs,children:(0,I.jsx)(c2.Controller,{control:d.control,name:n,rules:C,defaultValue:i,shouldUnregister:e,render:({field:{value:c,onChange:p}})=>(0,I.jsxs)(c3.Grid,{display:"flex",flexDirection:"column",children:[m&&(0,I.jsx)(g,{label:m,required:r}),(0,I.jsx)(p3.TimePicker,s(o({value:c!=null?c:null,onChange:p},H),{renderInput:t=>{var L,M;return(0,I.jsx)(m3.TextField,s(o(s(o({variant:"outlined"},t),{error:Boolean(h)}),V),{inputProps:s(o({},t.inputProps),{placeholder:l||((L=t.inputProps)==null?void 0:L.placeholder)}),InputProps:s(o({},t.InputProps),{endAdornment:(0,I.jsx)(Z3,{size:V.size,children:(M=t.InputProps)==null?void 0:M.endAdornment})})}))}})),(0,I.jsx)(y,{name:n})]})})})},x3=(0,g3.memo)(Q3);var y3=require("react"),p2=require("react-hook-form"),m2=require("@mui/material"),h3=require("@s_mart/core");var z=require("react/jsx-runtime"),P3=require("react"),J3=Z=>{var a=Z,{name:C,defaultValue:i,rules:e,shouldUnregister:n,label:r,required:m,onInputChange:H,onChange:l}=a,V=f(a,["name","defaultValue","rules","shouldUnregister","label","required","onInputChange","onChange"]);let d=(0,p2.useFormContext)();if(!d)throw new Error("Para usar o <Autocomplete /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let h=w(d.formState.errors,C);return console.warn=()=>{},(0,z.jsx)(p2.Controller,{name:C,control:d.control,defaultValue:i,rules:e,shouldUnregister:n,render:({field:c})=>(0,z.jsxs)(h3.Grid,{display:"flex",flexDirection:"column",children:[r&&(0,z.jsx)(g,{label:r,required:m}),(0,z.jsx)(m2.Autocomplete,s(o({onChange:(p,t)=>{c.onChange(t),l==null||l(p,t,d.watch())},onInputChange:(p,t,L)=>{c.onChange(t),setTimeout(()=>{H==null||H(p,d.watch(C),L,d.watch())},0)},isOptionEqualToValue:(p,t)=>p.value===t.value,renderOption:(p,t)=>(0,P3.createElement)("li",s(o({},p),{key:t.key||t.value,onClick:L=>{var M;(M=p.onClick)==null||M.call(p,L),c.onChange(t)}}),t.label),value:c.value||null},V),{renderInput:p=>{var t,L,M;return(0,z.jsx)(m2.TextField,s(o(o({},p),V.textFieldProps),{error:Boolean(h),InputProps:s(o(o({},p.InputProps),(t=V.textFieldProps)==null?void 0:t.InputProps),{inputProps:o(o({},p.inputProps),(M=(L=V.textFieldProps)==null?void 0:L.InputProps)==null?void 0:M.inputProps)})}))}})),(0,z.jsx)(y,{name:C})]})})},F3=(0,y3.memo)(J3);0&&(module.exports={Autocomplete,Checkbox,Creatable,DatePicker,Form,RadioButton,RadioGroup,Searchable,Select,Slider,Switch,TextField,TimePicker});
83
+ `;var F3=require("react");var z=require("react/jsx-runtime"),i1=M=>{var L=M,{rules:C,defaultValue:i,shouldUnregister:e,name:n,required:r,label:p,timePickerProps:H,placeholder:t}=L,V=u(L,["rules","defaultValue","shouldUnregister","name","required","label","timePickerProps","placeholder"]);let s=(0,y2.useFormContext)();if(!s)throw new Error("Para usar o <TimePicker /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let f=B(s.formState.errors,n);return(0,z.jsx)(h3.LocalizationProvider,{dateAdapter:y3.AdapterDayjs,children:(0,z.jsx)(y2.Controller,{control:s.control,name:n,rules:C,defaultValue:i,shouldUnregister:e,render:({field:{value:w,onChange:Z}})=>(0,z.jsxs)(f3.Grid,{display:"flex",flexDirection:"column",children:[p&&(0,z.jsx)(F,{label:p,required:r}),(0,z.jsx)(g3.TimePicker,d(o({value:w!=null?w:null,onChange:Z},H),{renderInput:l=>{var g,b;return(0,z.jsx)(x3.TextField,d(o(d(o({variant:"outlined"},l),{error:Boolean(f)}),V),{inputProps:d(o({},l.inputProps),{placeholder:t||((g=l.inputProps)==null?void 0:g.placeholder)}),InputProps:d(o({},l.InputProps),{endAdornment:(0,z.jsx)(u3,{size:V.size,children:(b=l.InputProps)==null?void 0:b.endAdornment})})}))}})),(0,z.jsx)(S,{name:n})]})})})},P3=(0,F3.memo)(i1);var b3=require("react"),h2=require("react-hook-form"),F2=require("@mui/material"),w3=require("@s_mart/core");var W=require("react/jsx-runtime"),v3=require("react"),e1=M=>{var L=M,{name:C,defaultValue:i,rules:e,shouldUnregister:n,label:r,required:p,onInputChange:H,onChange:t}=L,V=u(L,["name","defaultValue","rules","shouldUnregister","label","required","onInputChange","onChange"]);let s=(0,h2.useFormContext)();if(!s)throw new Error("Para usar o <Autocomplete /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let f=B(s.formState.errors,C);return console.warn=()=>{},(0,W.jsx)(h2.Controller,{name:C,control:s.control,defaultValue:i,rules:e,shouldUnregister:n,render:({field:w})=>(0,W.jsxs)(w3.Grid,{display:"flex",flexDirection:"column",children:[r&&(0,W.jsx)(F,{label:r,required:p}),(0,W.jsx)(F2.Autocomplete,d(o({onChange:(Z,l)=>{w.onChange(l),t==null||t(Z,l,s.watch())},onInputChange:(Z,l,g)=>{w.onChange(l),setTimeout(()=>{H==null||H(Z,s.watch(C),g,s.watch())},0)},isOptionEqualToValue:(Z,l)=>Z.value===l.value,renderOption:(Z,l)=>(0,v3.createElement)("li",d(o({},Z),{key:l.key||l.value,onClick:g=>{var b;(b=Z.onClick)==null||b.call(Z,g),w.onChange(l)}}),l.label),value:w.value||null},V),{renderInput:Z=>{var l,g,b;return(0,W.jsx)(F2.TextField,d(o(o({},Z),V.textFieldProps),{error:Boolean(f),InputProps:d(o(o({},Z.InputProps),(l=V.textFieldProps)==null?void 0:l.InputProps),{inputProps:o(o({},Z.inputProps),(b=(g=V.textFieldProps)==null?void 0:g.InputProps)==null?void 0:b.inputProps)})}))}})),(0,W.jsx)(S,{name:C})]})})},k3=(0,b3.memo)(e1);0&&(module.exports={Autocomplete,Checkbox,Creatable,DatePicker,Form,RadioButton,RadioGroup,Searchable,Select,Slider,Switch,TextField,TimePicker});
package/dist/index.mjs CHANGED
@@ -1,19 +1,20 @@
1
- var u2=Object.defineProperty,f2=Object.defineProperties;var g2=Object.getOwnPropertyDescriptors;var O=Object.getOwnPropertySymbols;var J=Object.prototype.hasOwnProperty,X=Object.prototype.propertyIsEnumerable;var Q=(C,i,o)=>i in C?u2(C,i,{enumerable:!0,configurable:!0,writable:!0,value:o}):C[i]=o,e=(C,i)=>{for(var o in i||(i={}))J.call(i,o)&&Q(C,o,i[o]);if(O)for(var o of O(i))X.call(i,o)&&Q(C,o,i[o]);return C},s=(C,i)=>f2(C,g2(i));var f=(C,i)=>{var o={};for(var n in C)J.call(C,n)&&i.indexOf(n)<0&&(o[n]=C[n]);if(C!=null&&O)for(var n of O(C))i.indexOf(n)<0&&X.call(C,n)&&(o[n]=C[n]);return o};import{useEffect as x2}from"react";import{FormProvider as y2,useForm as h2}from"react-hook-form";import{jsx as C2}from"react/jsx-runtime";function F2(m){var H=m,{children:C,onSubmit:i,style:o,disableDefaultValuesUpdate:n}=H,r=f(H,["children","onSubmit","style","disableDefaultValuesUpdate"]);let l=h2(r);x2(()=>{n||l.reset(r.defaultValues)},[r.defaultValues,l.reset]);let V=()=>typeof C=="function"?C(s(e({},l),{onSubmit:l.handleSubmit(Z=>i(Z,l))})):C;return C2(y2,s(e({},l),{children:C2("form",{onSubmit:Z=>{Z.preventDefault(),Z.stopPropagation(),l.handleSubmit(a=>i(a,l))()},style:o,children:V()})}))}var P2=F2;import{memo as B2,useState as A2}from"react";import{Controller as T2,useFormContext as E2}from"react-hook-form";import{Grid as D2,InputAdornment as I2,TextField as G2}from"@mui/material";var i2={description:"M39.0611 23.1367C36.3276 17.015 30.4051 13.2479 24.027 13.0909C17.4971 13.2479 11.5746 17.172 8.84117 23.1367C8.68931 23.6076 8.68931 24.2355 8.84117 24.8633C11.5746 30.985 17.4971 34.7521 23.8752 34.9091C30.4051 34.7521 36.1757 30.828 38.9092 24.8633C39.3648 24.2355 39.3648 23.6076 39.0611 23.1367ZM24.027 32.0837C19.6231 31.9268 16.2822 28.1596 16.4341 23.6076C16.586 19.3695 19.9269 15.7593 24.027 15.7593C28.4309 15.9163 31.7718 19.6835 31.62 24.2355C31.4681 28.4735 28.1272 32.0837 24.027 32.0837ZM24.027 18.5847C23.5715 18.5847 23.1159 18.7417 22.6603 18.7417C23.4196 19.8404 23.2677 21.2531 22.3566 22.3519C21.4454 23.2937 20.0787 23.2937 19.0157 22.5088C18.5601 24.7063 19.3194 27.2178 21.1417 28.4735C22.964 29.7292 25.3938 29.7292 27.0642 28.3165C28.7347 26.9039 29.494 24.3924 28.7347 22.1949C28.1272 19.9974 26.1531 18.5847 24.027 18.5847Z",viewBox:"0 0 48 48",id:"line-eye-solid"},e2={description:"M23.9998 31.7412C19.9223 31.7412 16.6215 28.5851 16.3177 24.5854L10.6785 20.2272C9.93715 21.1573 9.25496 22.1405 8.70447 23.2157C8.58149 23.4589 8.51742 23.7277 8.51742 24.0003C8.51742 24.2729 8.58149 24.5416 8.70447 24.7849C11.6198 30.4731 17.3913 34.3216 23.9998 34.3216C25.4465 34.3216 26.842 34.1066 28.1871 33.7593L25.3976 31.6009C24.9369 31.6899 24.469 31.7369 23.9998 31.7412ZM40.8703 34.8646L34.9273 30.2715C36.7326 28.7501 38.2174 26.8848 39.2952 24.7843C39.4182 24.5411 39.4823 24.2723 39.4823 23.9997C39.4823 23.7272 39.4182 23.4584 39.2952 23.2151C36.3799 17.5269 30.6084 13.6784 23.9998 13.6784C21.2321 13.6817 18.5093 14.3785 16.0801 15.7051L9.24098 10.419C9.15179 10.3496 9.04981 10.2985 8.94085 10.2685C8.83189 10.2385 8.7181 10.2303 8.60597 10.2443C8.49384 10.2584 8.38557 10.2944 8.28736 10.3502C8.18914 10.4061 8.1029 10.4808 8.03356 10.5701L6.97828 11.9285C6.8383 12.1086 6.77557 12.3369 6.8039 12.5633C6.83223 12.7896 6.94929 12.9954 7.12934 13.1354L38.7587 37.581C38.8479 37.6504 38.9499 37.7016 39.0588 37.7315C39.1678 37.7615 39.2816 37.7697 39.3937 37.7557C39.5058 37.7416 39.6141 37.7057 39.7123 37.6498C39.8105 37.5939 39.8968 37.5192 39.9661 37.43L41.0219 36.0715C41.1619 35.8913 41.2245 35.663 41.1961 35.4366C41.1676 35.2103 41.0505 35.0045 40.8703 34.8646ZM30.9938 27.2309L28.8811 25.5977C29.059 25.0835 29.1534 24.5441 29.1606 24C29.1711 23.2034 28.9947 22.4155 28.6454 21.6995C28.2962 20.9836 27.7838 20.3595 27.1496 19.8774C26.5154 19.3953 25.777 19.0687 24.9937 18.9238C24.2103 18.7788 23.4039 18.8197 22.6392 19.0429C22.9634 19.4822 23.1387 20.0135 23.1397 20.5595C23.1317 20.7411 23.1039 20.9214 23.0569 21.097L19.0997 18.0387C20.4743 16.89 22.2085 16.2601 23.9998 16.2588C25.0166 16.2582 26.0235 16.4581 26.9629 16.8469C27.9024 17.2357 28.756 17.8059 29.475 18.5249C30.1939 19.2438 30.7641 20.0974 31.1529 21.0369C31.5418 21.9764 31.7416 22.9833 31.7411 24C31.7411 25.1628 31.4567 26.246 30.9938 27.2309Z",viewBox:"0 0 48 48",id:"line-eye-slash-solid"};var o2={description:"M35.8286 21.8493H26.1506V12.1714C26.1506 11.6338 25.613 11.0961 25.0753 11.0961H22.9247C22.3198 11.0961 21.8493 11.6338 21.8493 12.1714V21.8493H12.1714C11.5666 21.8493 11.0961 22.387 11.0961 22.9247V25.0753C11.0961 25.6802 11.5666 26.1506 12.1714 26.1506H21.8493V35.8286C21.8493 36.4334 22.3198 36.9039 22.9247 36.9039H25.0753C25.613 36.9039 26.1506 36.4334 26.1506 35.8286V26.1506H35.8286C36.3662 26.1506 36.9039 25.6802 36.9039 25.0753V22.9247C36.9039 22.387 36.3662 21.8493 35.8286 21.8493Z",viewBox:"0 0 48 48",id:"line-plus-solid"};import*as G from"@s_mart/masks";import{Typography as r2}from"@mui/material";import{toRem as b2}from"@s_mart/utils";import{jsx as n2,jsxs as w2}from"react/jsx-runtime";var g=({label:C,required:i,regular:o})=>w2("span",{style:{display:"flex",alignItems:"center",gap:b2(2)},children:[n2(r2,{variant:"caption",fontWeight:o?400:700,style:{display:"flex",alignItems:"center"},children:C}),i&&n2(r2,{variant:"caption",fontWeight:900,color:"error",children:"*"})]});import{useFormContext as k2}from"react-hook-form";import{Indicator as v2}from"@s_mart/core";var w=(C,i)=>{var o,n,r,m;if(C[i])return C[i];if(i.includes("[")){let[H,l]=i.split("["),[V,Z]=l.split("].");return(n=(o=C[H])==null?void 0:o[V])==null?void 0:n[Z]}if(i.includes(".")){let[H,l,V]=i.split(".");return(m=(r=C[H])==null?void 0:r[l])==null?void 0:m[V]}};import{jsx as S2}from"react/jsx-runtime";var y=({name:C})=>{var n;let i=k2(),o=w((n=i==null?void 0:i.formState)==null?void 0:n.errors,C);return o?S2(v2,{severity:"error",children:o==null?void 0:o.message}):null};import{LIcon as $2}from"@s_mart/core";import{jsx as $,jsxs as R2}from"react/jsx-runtime";var q2=h=>{var c=h,{name:C,rules:i,defaultValue:o,shouldUnregister:n,label:r,required:m,mask:H,variant:l="outlined",parse:V,format:Z,onInputChange:a}=c,d=f(c,["name","rules","defaultValue","shouldUnregister","label","required","mask","variant","parse","format","onInputChange"]);let p=E2();if(!p)throw new Error("Para usar o <TextField /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let[t,L]=A2(!1),M=P=>{var b;let k=P;return Z&&(k=Z(P)),H?(b=G==null?void 0:G[H])==null?void 0:b.format(k):k},x=P=>{var b;let k=P;return V&&(k=V(P)),H?(b=G==null?void 0:G[H])==null?void 0:b.parse(k):k},F=P=>{if(!P||H!=="porcentagem")return;P==null||P.stopPropagation();let k=(P==null?void 0:P.target).value;if(k){let b=String(k);if(b.length>0){let q=b.indexOf("%");q>-1&&(P.currentTarget.selectionEnd=q)}}},u=w(p.formState.errors,C);return $(T2,{control:p.control,name:C,rules:i,defaultValue:o,shouldUnregister:n,render:({field:{value:P,onChange:k}})=>R2(D2,{display:"flex",flexDirection:"column",children:[r&&$(g,{label:r,required:m}),$(G2,s(e({variant:l,autoComplete:"off",defaultValue:o,value:M(P||""),onChange:b=>{var q,K;k(x((q=b==null?void 0:b.target)==null?void 0:q.value)),a==null||a(b,(K=b==null?void 0:b.target)==null?void 0:K.value,p.watch())},error:Boolean(u)},d),{type:d.type==="password"?t?"text":"password":d.type,InputProps:e({onKeyDown:F,endAdornment:d.type==="password"&&$(I2,{position:"end",onClick:()=>L(!t),style:{cursor:"pointer"},children:$($2,{icon:t?i2:e2,size:"24px",removeMargin:!0})})},d.InputProps)})),$(y,{name:C})]})})},U2=B2(q2);import{memo as z2,useState as O2}from"react";import{Controller as _2,useFormContext as N2}from"react-hook-form";import{Divider as j2}from"@s_mart/core";import{Grid as l2,Select as W2,MenuItem as H2,useTheme as Y2}from"@mui/material";import{Fragment as J2,jsx as A,jsxs as W}from"react/jsx-runtime";var K2=d=>{var h=d,{name:C,rules:i,defaultValue:o,shouldUnregister:n,label:r,required:m,options:H,placeholder:l,onInputChange:V,footer:Z}=h,a=f(h,["name","rules","defaultValue","shouldUnregister","label","required","options","placeholder","onInputChange","footer"]);let c=N2(),{palette:p}=Y2(),[t,L]=O2(!1);if(!c)throw new Error("Para usar o <Select /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let M=w(c.formState.errors,C);return console.warn=()=>{},A(_2,{control:c.control,name:C,rules:i,defaultValue:o||"",shouldUnregister:n,render:({field:{value:x,onChange:F}})=>W(l2,{display:"flex",flexDirection:"column",children:[r&&A(g,{label:r,required:m}),W(W2,s(e({open:t,onOpen:()=>L(!0),onClose:()=>L(!1),displayEmpty:Boolean(l),variant:"outlined",autoComplete:"off",value:x||"",onChange:u=>{F(u.target.value),V==null||V(u,u.target.value,c.watch())},error:Boolean(M),size:a.size||"medium"},a),{children:[l&&A(H2,{disabled:!0,value:"",children:A("p",{style:{color:p.grey[400]},children:l})}),H==null?void 0:H.map((u,P)=>A(H2,{value:u.value,children:u.label},P)),Z&&W(J2,{children:[A(l2,{px:2,py:1,children:A(j2,{})}),Z({closeSelect:()=>L(!1)})]})]})),A(y,{name:C})]})})},Q2=z2(K2);import{memo as X2}from"react";import{Controller as C3,useFormContext as i3}from"react-hook-form";import{Grid as t2,Autocomplete as e3,TextField as o3}from"@mui/material";import{Divider as r3}from"@s_mart/core";import{Fragment as H3,jsx as T,jsxs as Y}from"react/jsx-runtime";import{createElement as s2}from"react";var n3=d=>{var h=d,{name:C,rules:i,defaultValue:o,shouldUnregister:n,label:r,required:m,options:H,textFieldProps:l,noOptionsText:V,footer:Z}=h,a=f(h,["name","rules","defaultValue","shouldUnregister","label","required","options","textFieldProps","noOptionsText","footer"]);let c=i3();if(!c)throw new Error("Para usar o <Searchable /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let p=w(c.formState.errors,C);return console.warn=()=>{},T(C3,{control:c.control,name:C,rules:i,defaultValue:o,shouldUnregister:n,render:({field:{onChange:t,value:L}})=>Y(t2,{display:"flex",flexDirection:"column",children:[r&&T(g,{label:r,required:m}),T(e3,s(e({onChange:(M,x)=>t(x),value:L||null,options:H,noOptionsText:V||"Nenhuma op\xE7\xE3o encontrada",isOptionEqualToValue:(M,x)=>typeof M=="string"&&typeof x=="string"?M===x:typeof M=="object"&&typeof x=="object"?M.value===x.value:!1,renderOption:(M,x)=>typeof x=="object"?s2("li",s(e({},M),{key:x.key||x.value}),x.label):s2("li",s(e({},M),{key:x}),x),ListboxComponent:M=>Y("ul",s(e({},M),{children:[M.children,Z&&T("li",{children:Y(H3,{children:[T(t2,{px:2,py:1,children:T(r3,{})}),Z]})},"searchable-footer")]}))},a),{renderInput:M=>T(o3,e(e({error:Boolean(p)},M),l))})),T(y,{name:C})]})})},l3=X2(n3);import{memo as s3}from"react";import{Controller as V3,useFormContext as d3}from"react-hook-form";import{Grid as L3,Autocomplete as a3,TextField as M3,Typography as Z3}from"@mui/material";import{toRem as E}from"@s_mart/utils";import V2 from"@emotion/styled";import{css as d2}from"@emotion/react";var L2=d2`
1
+ var b2=Object.defineProperty,w2=Object.defineProperties;var k2=Object.getOwnPropertyDescriptors;var Q=Object.getOwnPropertySymbols;var n2=Object.prototype.hasOwnProperty,l2=Object.prototype.propertyIsEnumerable;var r2=(C,i,o)=>i in C?b2(C,i,{enumerable:!0,configurable:!0,writable:!0,value:o}):C[i]=o,e=(C,i)=>{for(var o in i||(i={}))n2.call(i,o)&&r2(C,o,i[o]);if(Q)for(var o of Q(i))l2.call(i,o)&&r2(C,o,i[o]);return C},d=(C,i)=>w2(C,k2(i));var m=(C,i)=>{var o={};for(var n in C)n2.call(C,n)&&i.indexOf(n)<0&&(o[n]=C[n]);if(C!=null&&Q)for(var n of Q(C))i.indexOf(n)<0&&l2.call(C,n)&&(o[n]=C[n]);return o};import{useEffect as v2}from"react";import{FormProvider as S2,useForm as T2}from"react-hook-form";import{jsx as t2}from"react/jsx-runtime";function B2(c){var H=c,{children:C,onSubmit:i,style:o,disableDefaultValuesUpdate:n}=H,r=m(H,["children","onSubmit","style","disableDefaultValuesUpdate"]);let t=T2(r);v2(()=>{n||t.reset(r.defaultValues)},[r.defaultValues,t.reset]);let V=()=>typeof C=="function"?C(d(e({},t),{onSubmit:t.handleSubmit(M=>i(M,t))})):C;return t2(S2,d(e({},t),{children:t2("form",{onSubmit:M=>{M.preventDefault(),M.stopPropagation(),t.handleSubmit(L=>i(L,t))()},style:o,children:V()})}))}var A2=B2;import{memo as q2,useState as U2}from"react";import{Controller as R2,useFormContext as z2}from"react-hook-form";import{Grid as N,InputAdornment as O2,TextField as _2}from"@mui/material";var H2={description:"M39.0611 23.1367C36.3276 17.015 30.4051 13.2479 24.027 13.0909C17.4971 13.2479 11.5746 17.172 8.84117 23.1367C8.68931 23.6076 8.68931 24.2355 8.84117 24.8633C11.5746 30.985 17.4971 34.7521 23.8752 34.9091C30.4051 34.7521 36.1757 30.828 38.9092 24.8633C39.3648 24.2355 39.3648 23.6076 39.0611 23.1367ZM24.027 32.0837C19.6231 31.9268 16.2822 28.1596 16.4341 23.6076C16.586 19.3695 19.9269 15.7593 24.027 15.7593C28.4309 15.9163 31.7718 19.6835 31.62 24.2355C31.4681 28.4735 28.1272 32.0837 24.027 32.0837ZM24.027 18.5847C23.5715 18.5847 23.1159 18.7417 22.6603 18.7417C23.4196 19.8404 23.2677 21.2531 22.3566 22.3519C21.4454 23.2937 20.0787 23.2937 19.0157 22.5088C18.5601 24.7063 19.3194 27.2178 21.1417 28.4735C22.964 29.7292 25.3938 29.7292 27.0642 28.3165C28.7347 26.9039 29.494 24.3924 28.7347 22.1949C28.1272 19.9974 26.1531 18.5847 24.027 18.5847Z",viewBox:"0 0 48 48",id:"line-eye-solid"},s2={description:"M23.9998 31.7412C19.9223 31.7412 16.6215 28.5851 16.3177 24.5854L10.6785 20.2272C9.93715 21.1573 9.25496 22.1405 8.70447 23.2157C8.58149 23.4589 8.51742 23.7277 8.51742 24.0003C8.51742 24.2729 8.58149 24.5416 8.70447 24.7849C11.6198 30.4731 17.3913 34.3216 23.9998 34.3216C25.4465 34.3216 26.842 34.1066 28.1871 33.7593L25.3976 31.6009C24.9369 31.6899 24.469 31.7369 23.9998 31.7412ZM40.8703 34.8646L34.9273 30.2715C36.7326 28.7501 38.2174 26.8848 39.2952 24.7843C39.4182 24.5411 39.4823 24.2723 39.4823 23.9997C39.4823 23.7272 39.4182 23.4584 39.2952 23.2151C36.3799 17.5269 30.6084 13.6784 23.9998 13.6784C21.2321 13.6817 18.5093 14.3785 16.0801 15.7051L9.24098 10.419C9.15179 10.3496 9.04981 10.2985 8.94085 10.2685C8.83189 10.2385 8.7181 10.2303 8.60597 10.2443C8.49384 10.2584 8.38557 10.2944 8.28736 10.3502C8.18914 10.4061 8.1029 10.4808 8.03356 10.5701L6.97828 11.9285C6.8383 12.1086 6.77557 12.3369 6.8039 12.5633C6.83223 12.7896 6.94929 12.9954 7.12934 13.1354L38.7587 37.581C38.8479 37.6504 38.9499 37.7016 39.0588 37.7315C39.1678 37.7615 39.2816 37.7697 39.3937 37.7557C39.5058 37.7416 39.6141 37.7057 39.7123 37.6498C39.8105 37.5939 39.8968 37.5192 39.9661 37.43L41.0219 36.0715C41.1619 35.8913 41.2245 35.663 41.1961 35.4366C41.1676 35.2103 41.0505 35.0045 40.8703 34.8646ZM30.9938 27.2309L28.8811 25.5977C29.059 25.0835 29.1534 24.5441 29.1606 24C29.1711 23.2034 28.9947 22.4155 28.6454 21.6995C28.2962 20.9836 27.7838 20.3595 27.1496 19.8774C26.5154 19.3953 25.777 19.0687 24.9937 18.9238C24.2103 18.7788 23.4039 18.8197 22.6392 19.0429C22.9634 19.4822 23.1387 20.0135 23.1397 20.5595C23.1317 20.7411 23.1039 20.9214 23.0569 21.097L19.0997 18.0387C20.4743 16.89 22.2085 16.2601 23.9998 16.2588C25.0166 16.2582 26.0235 16.4581 26.9629 16.8469C27.9024 17.2357 28.756 17.8059 29.475 18.5249C30.1939 19.2438 30.7641 20.0974 31.1529 21.0369C31.5418 21.9764 31.7416 22.9833 31.7411 24C31.7411 25.1628 31.4567 26.246 30.9938 27.2309Z",viewBox:"0 0 48 48",id:"line-eye-slash-solid"};var I={description:"M24 8C15.1613 8 8 15.2258 8 24C8 32.8387 15.1613 40 24 40C32.7742 40 40 32.8387 40 24C40 15.2258 32.7742 8 24 8ZM24 15.0968C25.4839 15.0968 26.7097 16.3226 26.7097 17.8065C26.7097 19.3548 25.4839 20.5161 24 20.5161C22.4516 20.5161 21.2903 19.3548 21.2903 17.8065C21.2903 16.3226 22.4516 15.0968 24 15.0968ZM27.6129 31.4839C27.6129 31.9355 27.2258 32.2581 26.8387 32.2581H21.1613C20.7097 32.2581 20.3871 31.9355 20.3871 31.4839V29.9355C20.3871 29.5484 20.7097 29.1613 21.1613 29.1613H21.9355V25.0323H21.1613C20.7097 25.0323 20.3871 24.7097 20.3871 24.2581V22.7097C20.3871 22.3226 20.7097 21.9355 21.1613 21.9355H25.2903C25.6774 21.9355 26.0645 22.3226 26.0645 22.7097V29.1613H26.8387C27.2258 29.1613 27.6129 29.5484 27.6129 29.9355V31.4839Z",viewBox:"0 0 48 48",id:"line-info-circle-solid"},d2={description:"M35.8286 21.8493H26.1506V12.1714C26.1506 11.6338 25.613 11.0961 25.0753 11.0961H22.9247C22.3198 11.0961 21.8493 11.6338 21.8493 12.1714V21.8493H12.1714C11.5666 21.8493 11.0961 22.387 11.0961 22.9247V25.0753C11.0961 25.6802 11.5666 26.1506 12.1714 26.1506H21.8493V35.8286C21.8493 36.4334 22.3198 36.9039 22.9247 36.9039H25.0753C25.613 36.9039 26.1506 36.4334 26.1506 35.8286V26.1506H35.8286C36.3662 26.1506 36.9039 25.6802 36.9039 25.0753V22.9247C36.9039 22.387 36.3662 21.8493 35.8286 21.8493Z",viewBox:"0 0 48 48",id:"line-plus-solid"};var V2={description:"M25.4929 17.0061L30.9936 22.5071L19.049 34.4522L14.1447 34.9936C13.4881 35.0662 12.9334 34.511 13.0065 33.8545L13.5522 28.9465L25.4929 17.0061ZM34.3958 16.1872L31.813 13.6043C31.0073 12.7986 29.7007 12.7986 28.8951 13.6043L26.4652 16.0342L31.966 21.5351L34.3958 19.1052C35.2014 18.2991 35.2014 16.9928 34.3958 16.1872Z",id:"line-pen-solid"};import*as z from"@s_mart/masks";import{Typography as L2}from"@mui/material";import{toRem as E2}from"@s_mart/utils";import{jsx as a2,jsxs as G2}from"react/jsx-runtime";var y=({label:C,required:i,regular:o})=>G2("span",{style:{display:"flex",alignItems:"center",gap:E2(2)},children:[a2(L2,{variant:"caption",fontWeight:o?400:700,style:{display:"flex",alignItems:"center"},children:C}),i&&a2(L2,{variant:"caption",fontWeight:900,color:"error",children:"*"})]});import{useFormContext as D2}from"react-hook-form";import{Indicator as I2}from"@s_mart/core";var S=(C,i)=>{var o,n,r,c;if(C[i])return C[i];if(i.includes("[")){let[H,t]=i.split("["),[V,M]=t.split("].");return(n=(o=C[H])==null?void 0:o[V])==null?void 0:n[M]}if(i.includes(".")){let[H,t,V]=i.split(".");return(c=(r=C[H])==null?void 0:r[t])==null?void 0:c[V]}};import{jsx as $2}from"react/jsx-runtime";var w=({name:C})=>{var n;let i=D2(),o=S((n=i==null?void 0:i.formState)==null?void 0:n.errors,C);return o?$2(I2,{severity:"error",children:o==null?void 0:o.message}):null};import{LIcon as M2,Tooltip as N2}from"@s_mart/core";import{jsx as A,jsxs as Z2}from"react/jsx-runtime";var j2=F=>{var Z=F,{name:C,rules:i,defaultValue:o,shouldUnregister:n,label:r,required:c,mask:H,variant:t="outlined",info:V,parse:M,format:L,onInputChange:s}=Z,u=m(Z,["name","rules","defaultValue","shouldUnregister","label","required","mask","variant","info","parse","format","onInputChange"]);let l=z2();if(!l)throw new Error("Para usar o <TextField /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let[f,h]=U2(!1),E=p=>{var a;let v=p;return L&&(v=L(p)),H?(a=z==null?void 0:z[H])==null?void 0:a.format(v):v},P=p=>{var a;let v=p;return M&&(v=M(p)),H?(a=z==null?void 0:z[H])==null?void 0:a.parse(v):v},b=p=>{if(!p||H!=="porcentagem")return;p==null||p.stopPropagation();let v=(p==null?void 0:p.target).value;if(v){let a=String(v);if(a.length>0){let g=a.indexOf("%");g>-1&&(p.currentTarget.selectionEnd=g)}}},x=S(l.formState.errors,C);return A(R2,{control:l.control,name:C,rules:i,defaultValue:o,shouldUnregister:n,render:({field:{value:p,onChange:v}})=>Z2(N,{display:"flex",flexDirection:"column",children:[A(N,{item:!0,xs:12,children:Z2(N,{container:!0,direction:"row",children:[r&&A(N,{item:!0,children:A(y,{label:r,required:c})}),V&&A(N,{item:!0,children:A(N2,{title:V,placement:"top",children:A("div",{style:{width:"fit-content"},children:A(M2,{icon:I,color:"#757575"})})})})]})}),A(_2,d(e({variant:t,autoComplete:"off",defaultValue:o,value:E(p||""),onChange:a=>{var g,o2;v(P((g=a==null?void 0:a.target)==null?void 0:g.value)),s==null||s(a,(o2=a==null?void 0:a.target)==null?void 0:o2.value,l.watch())},error:Boolean(x)},u),{type:u.type==="password"?f?"text":"password":u.type,InputProps:e({onKeyDown:b,endAdornment:u.type==="password"&&A(O2,{position:"end",onClick:()=>h(!f),style:{cursor:"pointer"},children:A(M2,{icon:f?H2:s2,size:"24px",removeMargin:!0})})},u.InputProps)})),A(w,{name:C})]})})},W2=q2(j2);import{memo as Y2,useState as K2}from"react";import{Controller as Q2,useFormContext as J2}from"react-hook-form";import{Divider as X2,LIcon as C3,Tooltip as i3}from"@s_mart/core";import{Grid as O,Select as e3,MenuItem as c2,useTheme as o3}from"@mui/material";import{Fragment as l3,jsx as B,jsxs as J}from"react/jsx-runtime";var r3=F=>{var Z=F,{name:C,rules:i,defaultValue:o,shouldUnregister:n,label:r,required:c,options:H,placeholder:t,onInputChange:V,footer:M,multiple:L,info:s}=Z,u=m(Z,["name","rules","defaultValue","shouldUnregister","label","required","options","placeholder","onInputChange","footer","multiple","info"]);let l=J2(),{palette:f}=o3(),[h,E]=K2(!1);if(!l)throw new Error("Para usar o <Select /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let P=S(l.formState.errors,C);return console.warn=()=>{},B(Q2,{control:l.control,name:C,rules:i,defaultValue:o||"",shouldUnregister:n,render:({field:{value:b,onChange:x}})=>J(O,{display:"flex",flexDirection:"column",children:[B(O,{item:!0,xs:12,children:J(O,{container:!0,direction:"row",children:[r&&B(O,{item:!0,children:B(y,{label:r,required:c})}),s&&B(O,{item:!0,children:B(i3,{title:s,placement:"top",children:B("div",{style:{width:"fit-content"},children:B(C3,{icon:I,color:"#757575"})})})})]})}),J(e3,d(e({open:h,onOpen:()=>E(!0),onClose:()=>E(!1),displayEmpty:Boolean(t),variant:"outlined",autoComplete:"off",value:b||(L?[]:null),multiple:L,onChange:p=>{x(p.target.value),V==null||V(p,p.target.value,l.watch())},error:Boolean(P),size:u.size||"medium"},u),{children:[t&&B(c2,{disabled:!0,value:"",children:B("p",{style:{color:f.grey[400]},children:t})}),H==null?void 0:H.map((p,v)=>B(c2,{value:p.value,children:p.label},v)),M&&J(l3,{children:[B(O,{px:2,py:1,children:B(X2,{})}),M({closeSelect:()=>E(!1)})]})]})),B(w,{name:C})]})})},n3=Y2(r3);import{memo as t3}from"react";import{Controller as H3,useFormContext as s3}from"react-hook-form";import{Grid as q,Autocomplete as d3,TextField as V3}from"@mui/material";import{Divider as L3,LIcon as a3,Tooltip as M3}from"@s_mart/core";import{Fragment as p3,jsx as T,jsxs as X}from"react/jsx-runtime";import{createElement as p2}from"react";var Z3=F=>{var Z=F,{name:C,rules:i,defaultValue:o,shouldUnregister:n,label:r,required:c,options:H,textFieldProps:t,noOptionsText:V,footer:M,multiple:L,info:s}=Z,u=m(Z,["name","rules","defaultValue","shouldUnregister","label","required","options","textFieldProps","noOptionsText","footer","multiple","info"]);let l=s3();if(!l)throw new Error("Para usar o <Searchable /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let f=S(l.formState.errors,C);return console.warn=()=>{},T(H3,{control:l.control,name:C,rules:i,defaultValue:o,shouldUnregister:n,render:({field:{onChange:h,value:E}})=>X(q,{display:"flex",flexDirection:"column",children:[T(q,{display:"flex",flexDirection:"column",children:T(q,{item:!0,xs:12,children:X(q,{container:!0,direction:"row",children:[r&&T(q,{item:!0,children:T(y,{label:r,required:c})}),s&&T(q,{item:!0,children:T(M3,{title:s,placement:"top",children:T("div",{style:{width:"fit-content"},children:T(a3,{icon:I,color:"#757575"})})})})]})})}),T(d3,d(e({onChange:(P,b)=>h(b),value:E||(L?[]:null),options:H,multiple:L,noOptionsText:V||"Nenhuma op\xE7\xE3o encontrada",isOptionEqualToValue:(P,b)=>typeof P=="string"&&typeof b=="string"?P===b:typeof P=="object"&&typeof b=="object"?P.value===b.value:!1,renderOption:(P,b)=>typeof b=="object"?p2("li",d(e({},P),{key:b.key||b.value}),b.label):p2("li",d(e({},P),{key:b}),b),ListboxComponent:P=>X("ul",d(e({},P),{children:[P.children,M&&T("li",{children:X(p3,{children:[T(q,{px:2,py:1,children:T(L3,{})}),M]})},"searchable-footer")]}))},u),{renderInput:P=>T(V3,e(e({error:Boolean(f)},P),t))})),T(w,{name:C})]})})},c3=t3(Z3);import{memo as u3}from"react";import{Controller as f3,useFormContext as g3}from"react-hook-form";import{Grid as j,Autocomplete as x3,TextField as y3,Typography as h3}from"@mui/material";import{toRem as $}from"@s_mart/utils";import m2 from"@emotion/styled";import{css as u2}from"@emotion/react";var f2=u2`
2
2
  display: flex;
3
3
  align-items: center;
4
4
  justify-content: center;
5
- `,t3=C=>d2`
5
+ `,m3=C=>u2`
6
6
  .MuiAutocomplete-endAdornment {
7
7
  position: relative;
8
8
  right: 0;
9
9
  }
10
10
 
11
- .creatable {
12
- ${L2}
11
+ .creatable,
12
+ .editable {
13
+ ${f2}
13
14
 
14
15
  .divider {
15
16
  width: 1px;
16
- height: ${E(20)};
17
+ height: ${$(20)};
17
18
  background-color: ${C.palette.grey[400]};
18
19
  }
19
20
 
@@ -24,9 +25,9 @@ var u2=Object.defineProperty,f2=Object.defineProperties;var g2=Object.getOwnProp
24
25
  color: ${C.palette.grey[600]};
25
26
  border-radius: 50%;
26
27
 
27
- margin: 0 ${E(6)};
28
- width: ${E(28)};
29
- height: ${E(28)};
28
+ margin: 0 ${$(6)};
29
+ width: ${$(28)};
30
+ height: ${$(28)};
30
31
 
31
32
  &:hover {
32
33
  cursor: pointer;
@@ -35,48 +36,48 @@ var u2=Object.defineProperty,f2=Object.defineProperties;var g2=Object.getOwnProp
35
36
  }
36
37
  }
37
38
  }
38
- `,a2=V2.div`
39
+ `,g2=m2.div`
39
40
  display: flex;
40
41
 
41
42
  div.endAdornments {
42
43
  position: absolute;
43
44
  right: 0;
44
45
 
45
- ${L2}
46
+ ${f2}
46
47
  }
47
48
 
48
- ${({hideAddButton:C,theme:i})=>!C&&t3(i)}
49
- `,M2=V2.div`
49
+ ${({hideAddButton:C,theme:i})=>!C&&m3(i)}
50
+ `,x2=m2.div`
50
51
  color: ${({theme:C})=>C.palette.text.primary};
51
52
 
52
- padding: ${E(6)} ${E(16)};
53
- margin: ${E(-6)} ${E(-16)};
53
+ padding: ${$(6)} ${$(16)};
54
+ margin: ${$(-6)} ${$(-16)};
54
55
 
55
56
  &:hover {
56
57
  cursor: pointer;
57
58
  transition: background-color 0.2s ease-in-out;
58
59
  background-color: ${({theme:C})=>C.palette.grey[100]};
59
60
  }
60
- `;import{LIcon as c3}from"@s_mart/core";import{jsx as v,jsxs as _}from"react/jsx-runtime";import{createElement as Z2}from"react";var p3=d=>{var h=d,{name:C,rules:i,defaultValue:o,shouldUnregister:n,label:r,required:m,options:H,onCreateOption:l,textFieldProps:V,hideAddButton:Z}=h,a=f(h,["name","rules","defaultValue","shouldUnregister","label","required","options","onCreateOption","textFieldProps","hideAddButton"]);let c=d3();if(!c)throw new Error("Para usar o <Creatable /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let p=w(c.formState.errors,C);console.warn=()=>{};let t=L=>{l?l(L):console.error("onCreateOption n\xE3o foi definido")};return v(V3,{control:c.control,name:C,rules:i,defaultValue:o,shouldUnregister:n,render:({field:{value:L,onChange:M}})=>{let x=(L==null?void 0:L.label)||(L==null?void 0:L.value)||L;return _(L3,{display:"flex",flexDirection:"column",children:[r&&v(g,{label:r,required:m}),v(a2,{hideAddButton:Z,children:v(a3,s(e({fullWidth:!0,onChange:(F,u)=>M(u),options:H,value:L||null,noOptionsText:v(M2,{onClick:()=>t(L),children:_(Z3,{children:["Adicionar ",x&&`"${x}"`]})}),isOptionEqualToValue:(F,u)=>u?typeof F=="string"&&typeof u=="string"?F===u:typeof F=="object"&&typeof u=="object"?F.value===u.value:typeof F=="object"&&typeof u=="string":!1,renderOption:(F,u)=>typeof u=="object"?Z2("li",s(e({},F),{key:u.key||u.value}),u.label):Z2("li",s(e({},F),{key:u}),u)},a),{renderInput:F=>{let u=Z?F.InputProps:s(e({},F.InputProps),{endAdornment:_("div",{className:"endAdornments",children:[F.InputProps.endAdornment,_("div",{className:"creatable",children:[v("div",{className:"divider"}),v("div",{className:"button",onClick:()=>t(L),children:v(c3,{icon:o2,size:"24px",removeMargin:!0})})]})]})});return v(M3,e(s(e({},F),{error:Boolean(p),onChange:M,InputProps:u}),V))}}))}),v(y,{name:C})]})}})},m3=s3(p3);import{Controller as u3,useFormContext as f3}from"react-hook-form";import{Grid as g3,Checkbox as x3,FormControlLabel as y3}from"@mui/material";import{jsx as U,jsxs as P3}from"react/jsx-runtime";var h3=V=>{var Z=V,{name:C,rules:i,defaultValue:o,shouldUnregister:n,label:r,labelPlacement:m,required:H}=Z,l=f(Z,["name","rules","defaultValue","shouldUnregister","label","labelPlacement","required"]);let a=f3();if(!a)throw new Error("Para usar o <Checkbox /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");return U(u3,{control:a.control,name:C,rules:i,defaultValue:o,shouldUnregister:n,render:({field:{value:d,onChange:h}})=>P3(g3,{display:"flex",flexDirection:"column",children:[U(y3,{control:U(x3,e({value:d!=null?d:"",defaultValue:d,onChange:h},l)),label:U(g,{label:r,required:H,regular:!0}),labelPlacement:m||"end"}),U(y,{name:C})]})})},F3=h3;import{Controller as b3,useFormContext as w3}from"react-hook-form";import{Grid as k3,Switch as v3,FormControlLabel as S3}from"@mui/material";import{jsx as R,jsxs as T3}from"react/jsx-runtime";var B3=l=>{var V=l,{name:C,rules:i,defaultValue:o,shouldUnregister:n,label:r,labelPlacement:m}=V,H=f(V,["name","rules","defaultValue","shouldUnregister","label","labelPlacement"]);let Z=w3();if(!Z)throw new Error("Para usar o <Switch /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");return R(b3,{control:Z.control,name:C,rules:i,defaultValue:o,shouldUnregister:n,render:({field:{value:a,onChange:d}})=>T3(k3,{display:"flex",flexDirection:"column",children:[R(S3,{control:R(v3,e({value:a!=null?a:"",defaultValue:a,onChange:d},H)),label:R(g,{label:r}),labelPlacement:m||"end"}),R(y,{name:C})]})})},A3=B3;import{Grid as E3,Radio as D3,FormControlLabel as I3}from"@mui/material";import{jsx as N}from"react/jsx-runtime";var G3=n=>{var r=n,{label:C,labelPlacement:i}=r,o=f(r,["label","labelPlacement"]);return N(E3,{display:"flex",flexDirection:"column",children:N(I3,{control:N(D3,e({},o)),label:N(g,{label:C}),labelPlacement:i||"end"})})},$3=G3;import{Controller as q3,useFormContext as U3}from"react-hook-form";import{Grid as R3,RadioGroup as z3}from"@mui/material";import{jsx as j,jsxs as N3}from"react/jsx-runtime";var O3=Z=>{var a=Z,{name:C,rules:i,defaultValue:o,shouldUnregister:n,label:r,required:m,children:H,orientation:l="row"}=a,V=f(a,["name","rules","defaultValue","shouldUnregister","label","required","children","orientation"]);let d=U3();if(!d)throw new Error("Para usar o <RadioGroup /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");return j(q3,{control:d.control,name:C,rules:i,defaultValue:o,shouldUnregister:n,render:({field:{value:h,onChange:c}})=>N3(R3,{display:"flex",flexDirection:"column",children:[r&&j(g,{label:r,required:m}),j(z3,s(e({value:h||"",onChange:c,name:C},V),{style:{display:"flex",flexDirection:l},children:H})),j(y,{name:C})]})})},_3=O3;import{Controller as j3,useFormContext as W3}from"react-hook-form";import{Slider as Y3}from"@mui/material";import{jsx as c2}from"react/jsx-runtime";var K3=m=>{var H=m,{name:C,rules:i,defaultValue:o,shouldUnregister:n}=H,r=f(H,["name","rules","defaultValue","shouldUnregister"]);let l=W3();if(!l)throw new Error("Para usar o <Slider /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");return c2(j3,{control:l.control,name:C,rules:i,defaultValue:o,shouldUnregister:n,render:({field:{value:V,onChange:Z}})=>c2(Y3,e({value:V||(r==null?void 0:r.min)||0,onChange:Z,valueLabelDisplay:"auto"},r))})},Q3=K3;import{memo as i1}from"react";import{Controller as e1,useFormContext as o1}from"react-hook-form";import{Grid as r1}from"@s_mart/core";import{TextField as n1}from"@mui/material";import{DatePicker as l1}from"@mui/x-date-pickers/DatePicker";import{AdapterDayjs as H1}from"@mui/x-date-pickers/AdapterDayjs";import{LocalizationProvider as t1}from"@mui/x-date-pickers/LocalizationProvider";import{toRem as S}from"@s_mart/utils";import J3 from"@emotion/styled";var X3=C=>{switch(C){case"small":return S(16);default:case"medium":return S(20);case"large":return S(24)}},C1=C=>{switch(C){case"small":return`${S(2)} ${S(8)}`;default:case"medium":return`${S(6)} ${S(8)}`;case"large":return`${S(10)}`}},p2=J3.div`
61
+ `;import{LIcon as e2,Tooltip as F3}from"@s_mart/core";import{isObject as P3,isEmpty as b3}from"lodash";import{jsx as k,jsxs as _}from"react/jsx-runtime";import{createElement as y2}from"react";var w3=l=>{var f=l,{name:C,rules:i,defaultValue:o,shouldUnregister:n,label:r,required:c,options:H,editable:t,onEditOption:V,onCreateOption:M,textFieldProps:L,hideAddButton:s,multiple:u,info:F}=f,Z=m(f,["name","rules","defaultValue","shouldUnregister","label","required","options","editable","onEditOption","onCreateOption","textFieldProps","hideAddButton","multiple","info"]);let h=g3();if(!h)throw new Error("Para usar o <Creatable /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let E=S(h.formState.errors,C);console.warn=()=>{};let P=x=>{M?M(x):console.error("onCreateOption n\xE3o foi definido")},b=x=>{V?V(x):console.error("onEditOption n\xE3o foi definido")};return k(f3,{control:h.control,name:C,rules:i,defaultValue:o,shouldUnregister:n,render:({field:{value:x,onChange:p}})=>{let v=(x==null?void 0:x.label)||(x==null?void 0:x.value)||x;return _(j,{display:"flex",flexDirection:"column",children:[k(j,{item:!0,xs:12,children:_(j,{container:!0,direction:"row",children:[r&&k(j,{item:!0,children:k(y,{label:r,required:c})}),F&&k(j,{item:!0,children:k(F3,{title:F,placement:"top",children:k("div",{style:{width:"fit-content"},children:k(e2,{icon:I,color:"#757575"})})})})]})}),k(g2,{hideAddButton:s,children:k(x3,d(e({fullWidth:!0,onChange:(a,g)=>p(g),options:H,value:x||(u?[]:null),multiple:u,noOptionsText:k(x2,{onClick:()=>P(x),children:_(h3,{children:["Adicionar ",v&&`"${v}"`]})}),isOptionEqualToValue:(a,g)=>g?typeof a=="string"&&typeof g=="string"?a===g:typeof a=="object"&&typeof g=="object"?a.value===g.value:typeof a=="object"&&typeof g=="string":!1,renderOption:(a,g)=>typeof g=="object"?y2("li",d(e({},a),{key:g.key||g.value}),g.label):y2("li",d(e({},a),{key:g}),g)},Z),{renderInput:a=>{let g=s?a.InputProps:d(e({},a.InputProps),{endAdornment:_("div",{className:"endAdornments",children:[a.InputProps.endAdornment,t&&P3(x)&&!b3(x)?_("div",{className:"editable",children:[k("div",{className:"divider"}),k("div",{className:"button",onClick:()=>b(x),children:k(e2,{icon:V2,size:"24px",removeMargin:!0})})]}):null,_("div",{className:"creatable",children:[k("div",{className:"divider"}),k("div",{className:"button",onClick:()=>P(x),children:k(e2,{icon:d2,size:"24px",removeMargin:!0})})]})]})});return k(y3,e(d(e({},a),{error:Boolean(E),onChange:p,InputProps:g}),L))}}))}),k(w,{name:C})]})}})},k3=u3(w3);import{Controller as v3,useFormContext as S3}from"react-hook-form";import{Grid as T3,Checkbox as B3,FormControlLabel as A3}from"@mui/material";import{jsx as W,jsxs as D3}from"react/jsx-runtime";var E3=V=>{var M=V,{name:C,rules:i,defaultValue:o,shouldUnregister:n,label:r,labelPlacement:c,required:H}=M,t=m(M,["name","rules","defaultValue","shouldUnregister","label","labelPlacement","required"]);let L=S3();if(!L)throw new Error("Para usar o <Checkbox /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");return W(v3,{control:L.control,name:C,rules:i,defaultValue:o,shouldUnregister:n,render:({field:{value:s,onChange:u}})=>D3(T3,{display:"flex",flexDirection:"column",children:[W(A3,{control:W(B3,e({value:s!=null?s:"",defaultValue:s,onChange:u},t)),label:W(y,{label:r,required:H,regular:!0}),labelPlacement:c||"end"}),W(w,{name:C})]})})},G3=E3;import{Controller as I3,useFormContext as $3}from"react-hook-form";import{Grid as q3,Switch as U3,FormControlLabel as R3}from"@mui/material";import{jsx as Y,jsxs as _3}from"react/jsx-runtime";var z3=t=>{var V=t,{name:C,rules:i,defaultValue:o,shouldUnregister:n,label:r,labelPlacement:c}=V,H=m(V,["name","rules","defaultValue","shouldUnregister","label","labelPlacement"]);let M=$3();if(!M)throw new Error("Para usar o <Switch /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");return Y(I3,{control:M.control,name:C,rules:i,defaultValue:o,shouldUnregister:n,render:({field:{value:L,onChange:s}})=>_3(q3,{display:"flex",flexDirection:"column",children:[Y(R3,{control:Y(U3,e({value:L!=null?L:"",defaultValue:L,onChange:s},H)),label:Y(y,{label:r}),labelPlacement:c||"end"}),Y(w,{name:C})]})})},O3=z3;import{Grid as N3,Radio as j3,FormControlLabel as W3}from"@mui/material";import{jsx as C2}from"react/jsx-runtime";var Y3=n=>{var r=n,{label:C,labelPlacement:i}=r,o=m(r,["label","labelPlacement"]);return C2(N3,{display:"flex",flexDirection:"column",children:C2(W3,{control:C2(j3,e({},o)),label:C2(y,{label:C}),labelPlacement:i||"end"})})},K3=Y3;import{Controller as Q3,useFormContext as J3}from"react-hook-form";import{Grid as X3,RadioGroup as C1}from"@mui/material";import{jsx as i2,jsxs as o1}from"react/jsx-runtime";var i1=M=>{var L=M,{name:C,rules:i,defaultValue:o,shouldUnregister:n,label:r,required:c,children:H,orientation:t="row"}=L,V=m(L,["name","rules","defaultValue","shouldUnregister","label","required","children","orientation"]);let s=J3();if(!s)throw new Error("Para usar o <RadioGroup /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");return i2(Q3,{control:s.control,name:C,rules:i,defaultValue:o,shouldUnregister:n,render:({field:{value:u,onChange:F}})=>o1(X3,{display:"flex",flexDirection:"column",children:[r&&i2(y,{label:r,required:c}),i2(C1,d(e({value:u||"",onChange:F,name:C},V),{style:{display:"flex",flexDirection:t},children:H})),i2(w,{name:C})]})})},e1=i1;import{Controller as r1,useFormContext as n1}from"react-hook-form";import{Slider as l1}from"@mui/material";import{jsx as h2}from"react/jsx-runtime";var t1=c=>{var H=c,{name:C,rules:i,defaultValue:o,shouldUnregister:n}=H,r=m(H,["name","rules","defaultValue","shouldUnregister"]);let t=n1();if(!t)throw new Error("Para usar o <Slider /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");return h2(r1,{control:t.control,name:C,rules:i,defaultValue:o,shouldUnregister:n,render:({field:{value:V,onChange:M}})=>h2(l1,e({value:V||(r==null?void 0:r.min)||0,onChange:M,valueLabelDisplay:"auto"},r))})},H1=t1;import{memo as L1}from"react";import{Controller as a1,useFormContext as M1}from"react-hook-form";import{Grid as Z1}from"@s_mart/core";import{TextField as c1}from"@mui/material";import{DatePicker as p1}from"@mui/x-date-pickers/DatePicker";import{AdapterDayjs as m1}from"@mui/x-date-pickers/AdapterDayjs";import{LocalizationProvider as u1}from"@mui/x-date-pickers/LocalizationProvider";import{toRem as G}from"@s_mart/utils";import s1 from"@emotion/styled";var d1=C=>{switch(C){case"small":return G(16);default:case"medium":return G(20);case"large":return G(24)}},V1=C=>{switch(C){case"small":return`${G(2)} ${G(8)}`;default:case"medium":return`${G(6)} ${G(8)}`;case"large":return`${G(10)}`}},F2=s1.div`
61
62
  > div > button {
62
- padding: ${({size:C})=>C1(C)};
63
- border-radius: 0 ${S(4)} ${S(4)} 0;
63
+ padding: ${({size:C})=>V1(C)};
64
+ border-radius: 0 ${G(4)} ${G(4)} 0;
64
65
 
65
66
  margin: 0px -13px 0px 0px;
66
67
 
67
68
  svg {
68
- width: ${({size:C})=>X3(C)};
69
+ width: ${({size:C})=>d1(C)};
69
70
  }
70
71
  }
71
- `;import{jsx as D,jsxs as d1}from"react/jsx-runtime";var s1=Z=>{var a=Z,{rules:C,name:i,defaultValue:o,shouldUnregister:n,datePickerProps:r,label:m,required:H,placeholder:l}=a,V=f(a,["rules","name","defaultValue","shouldUnregister","datePickerProps","label","required","placeholder"]);let d=o1();if(!d)throw new Error("Para usar o <DataPicker /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let h=w(d.formState.errors,i);return D(t1,{dateAdapter:H1,children:D(e1,{control:d.control,name:i,rules:C,defaultValue:o,shouldUnregister:n,render:({field:{value:c,onChange:p}})=>d1(r1,{display:"flex",flexDirection:"column",children:[m&&D(g,{label:m,required:H}),D(l1,s(e({},r),{value:c!=null?c:null,inputFormat:(r==null?void 0:r.inputFormat)||"DD/MM/YYYY",onChange:p,renderInput:t=>{var L,M;return D(n1,s(e(s(e({variant:"outlined"},t),{error:Boolean(h)}),V),{inputProps:s(e({},t.inputProps),{placeholder:l||((L=t.inputProps)==null?void 0:L.placeholder)}),InputProps:s(e({},t.InputProps),{endAdornment:D(p2,{size:V.size,children:(M=t.InputProps)==null?void 0:M.endAdornment})})}))}})),D(y,{name:i})]})})})},V1=i1(s1);import{Grid as Z1}from"@s_mart/core";import{TimePicker as c1}from"@mui/x-date-pickers/TimePicker";import{TextField as p1}from"@mui/material";import{Controller as m1,useFormContext as u1}from"react-hook-form";import{AdapterDayjs as f1}from"@mui/x-date-pickers/AdapterDayjs";import{LocalizationProvider as g1}from"@mui/x-date-pickers/LocalizationProvider";import{toRem as B}from"@s_mart/utils";import L1 from"@emotion/styled";var a1=C=>{switch(C){case"small":return B(16);default:case"medium":return B(20);case"large":return B(24)}},M1=C=>{switch(C){case"small":return`${B(2)} ${B(8)}`;default:case"medium":return`${B(6)} ${B(8)}`;case"large":return`${B(10)}`}},m2=L1.div`
72
+ `;import{jsx as U,jsxs as x1}from"react/jsx-runtime";var f1=M=>{var L=M,{rules:C,name:i,defaultValue:o,shouldUnregister:n,datePickerProps:r,label:c,required:H,placeholder:t}=L,V=m(L,["rules","name","defaultValue","shouldUnregister","datePickerProps","label","required","placeholder"]);let s=M1();if(!s)throw new Error("Para usar o <DataPicker /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let u=S(s.formState.errors,i);return U(u1,{dateAdapter:m1,children:U(a1,{control:s.control,name:i,rules:C,defaultValue:o,shouldUnregister:n,render:({field:{value:F,onChange:Z}})=>x1(Z1,{display:"flex",flexDirection:"column",children:[c&&U(y,{label:c,required:H}),U(p1,d(e({},r),{value:F!=null?F:null,inputFormat:(r==null?void 0:r.inputFormat)||"DD/MM/YYYY",onChange:Z,renderInput:l=>{var f,h;return U(c1,d(e(d(e({variant:"outlined"},l),{error:Boolean(u)}),V),{inputProps:d(e({},l.inputProps),{placeholder:t||((f=l.inputProps)==null?void 0:f.placeholder)}),InputProps:d(e({},l.InputProps),{endAdornment:U(F2,{size:V.size,children:(h=l.InputProps)==null?void 0:h.endAdornment})})}))}})),U(w,{name:i})]})})})},g1=L1(f1);import{Grid as P1}from"@s_mart/core";import{TimePicker as b1}from"@mui/x-date-pickers/TimePicker";import{TextField as w1}from"@mui/material";import{Controller as k1,useFormContext as v1}from"react-hook-form";import{AdapterDayjs as S1}from"@mui/x-date-pickers/AdapterDayjs";import{LocalizationProvider as T1}from"@mui/x-date-pickers/LocalizationProvider";import{toRem as D}from"@s_mart/utils";import y1 from"@emotion/styled";var h1=C=>{switch(C){case"small":return D(16);default:case"medium":return D(20);case"large":return D(24)}},F1=C=>{switch(C){case"small":return`${D(2)} ${D(8)}`;default:case"medium":return`${D(6)} ${D(8)}`;case"large":return`${D(10)}`}},P2=y1.div`
72
73
  > div > button {
73
- padding: ${({size:C})=>M1(C)};
74
- border-radius: 0 ${B(4)} ${B(4)} 0;
74
+ padding: ${({size:C})=>F1(C)};
75
+ border-radius: 0 ${D(4)} ${D(4)} 0;
75
76
 
76
77
  margin: 0px -13px 0px 0px;
77
78
 
78
79
  svg {
79
- width: ${({size:C})=>a1(C)};
80
+ width: ${({size:C})=>h1(C)};
80
81
  }
81
82
  }
82
- `;import{memo as x1}from"react";import{jsx as I,jsxs as F1}from"react/jsx-runtime";var y1=Z=>{var a=Z,{rules:C,defaultValue:i,shouldUnregister:o,name:n,required:r,label:m,timePickerProps:H,placeholder:l}=a,V=f(a,["rules","defaultValue","shouldUnregister","name","required","label","timePickerProps","placeholder"]);let d=u1();if(!d)throw new Error("Para usar o <TimePicker /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let h=w(d.formState.errors,n);return I(g1,{dateAdapter:f1,children:I(m1,{control:d.control,name:n,rules:C,defaultValue:i,shouldUnregister:o,render:({field:{value:c,onChange:p}})=>F1(Z1,{display:"flex",flexDirection:"column",children:[m&&I(g,{label:m,required:r}),I(c1,s(e({value:c!=null?c:null,onChange:p},H),{renderInput:t=>{var L,M;return I(p1,s(e(s(e({variant:"outlined"},t),{error:Boolean(h)}),V),{inputProps:s(e({},t.inputProps),{placeholder:l||((L=t.inputProps)==null?void 0:L.placeholder)}),InputProps:s(e({},t.InputProps),{endAdornment:I(m2,{size:V.size,children:(M=t.InputProps)==null?void 0:M.endAdornment})})}))}})),I(y,{name:n})]})})})},h1=x1(y1);import{memo as P1}from"react";import{Controller as b1,useFormContext as w1}from"react-hook-form";import{Autocomplete as k1,TextField as v1}from"@mui/material";import{Grid as S1}from"@s_mart/core";import{jsx as z,jsxs as E1}from"react/jsx-runtime";import{createElement as T1}from"react";var B1=Z=>{var a=Z,{name:C,defaultValue:i,rules:o,shouldUnregister:n,label:r,required:m,onInputChange:H,onChange:l}=a,V=f(a,["name","defaultValue","rules","shouldUnregister","label","required","onInputChange","onChange"]);let d=w1();if(!d)throw new Error("Para usar o <Autocomplete /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let h=w(d.formState.errors,C);return console.warn=()=>{},z(b1,{name:C,control:d.control,defaultValue:i,rules:o,shouldUnregister:n,render:({field:c})=>E1(S1,{display:"flex",flexDirection:"column",children:[r&&z(g,{label:r,required:m}),z(k1,s(e({onChange:(p,t)=>{c.onChange(t),l==null||l(p,t,d.watch())},onInputChange:(p,t,L)=>{c.onChange(t),setTimeout(()=>{H==null||H(p,d.watch(C),L,d.watch())},0)},isOptionEqualToValue:(p,t)=>p.value===t.value,renderOption:(p,t)=>T1("li",s(e({},p),{key:t.key||t.value,onClick:L=>{var M;(M=p.onClick)==null||M.call(p,L),c.onChange(t)}}),t.label),value:c.value||null},V),{renderInput:p=>{var t,L,M;return z(v1,s(e(e({},p),V.textFieldProps),{error:Boolean(h),InputProps:s(e(e({},p.InputProps),(t=V.textFieldProps)==null?void 0:t.InputProps),{inputProps:e(e({},p.inputProps),(M=(L=V.textFieldProps)==null?void 0:L.InputProps)==null?void 0:M.inputProps)})}))}})),z(y,{name:C})]})})},A1=P1(B1);export{A1 as Autocomplete,F3 as Checkbox,m3 as Creatable,V1 as DatePicker,P2 as Form,$3 as RadioButton,_3 as RadioGroup,l3 as Searchable,Q2 as Select,Q3 as Slider,A3 as Switch,U2 as TextField,h1 as TimePicker};
83
+ `;import{memo as B1}from"react";import{jsx as R,jsxs as G1}from"react/jsx-runtime";var A1=M=>{var L=M,{rules:C,defaultValue:i,shouldUnregister:o,name:n,required:r,label:c,timePickerProps:H,placeholder:t}=L,V=m(L,["rules","defaultValue","shouldUnregister","name","required","label","timePickerProps","placeholder"]);let s=v1();if(!s)throw new Error("Para usar o <TimePicker /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let u=S(s.formState.errors,n);return R(T1,{dateAdapter:S1,children:R(k1,{control:s.control,name:n,rules:C,defaultValue:i,shouldUnregister:o,render:({field:{value:F,onChange:Z}})=>G1(P1,{display:"flex",flexDirection:"column",children:[c&&R(y,{label:c,required:r}),R(b1,d(e({value:F!=null?F:null,onChange:Z},H),{renderInput:l=>{var f,h;return R(w1,d(e(d(e({variant:"outlined"},l),{error:Boolean(u)}),V),{inputProps:d(e({},l.inputProps),{placeholder:t||((f=l.inputProps)==null?void 0:f.placeholder)}),InputProps:d(e({},l.InputProps),{endAdornment:R(P2,{size:V.size,children:(h=l.InputProps)==null?void 0:h.endAdornment})})}))}})),R(w,{name:n})]})})})},E1=B1(A1);import{memo as D1}from"react";import{Controller as I1,useFormContext as $1}from"react-hook-form";import{Autocomplete as q1,TextField as U1}from"@mui/material";import{Grid as R1}from"@s_mart/core";import{jsx as K,jsxs as N1}from"react/jsx-runtime";import{createElement as _1}from"react";var z1=M=>{var L=M,{name:C,defaultValue:i,rules:o,shouldUnregister:n,label:r,required:c,onInputChange:H,onChange:t}=L,V=m(L,["name","defaultValue","rules","shouldUnregister","label","required","onInputChange","onChange"]);let s=$1();if(!s)throw new Error("Para usar o <Autocomplete /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let u=S(s.formState.errors,C);return console.warn=()=>{},K(I1,{name:C,control:s.control,defaultValue:i,rules:o,shouldUnregister:n,render:({field:F})=>N1(R1,{display:"flex",flexDirection:"column",children:[r&&K(y,{label:r,required:c}),K(q1,d(e({onChange:(Z,l)=>{F.onChange(l),t==null||t(Z,l,s.watch())},onInputChange:(Z,l,f)=>{F.onChange(l),setTimeout(()=>{H==null||H(Z,s.watch(C),f,s.watch())},0)},isOptionEqualToValue:(Z,l)=>Z.value===l.value,renderOption:(Z,l)=>_1("li",d(e({},Z),{key:l.key||l.value,onClick:f=>{var h;(h=Z.onClick)==null||h.call(Z,f),F.onChange(l)}}),l.label),value:F.value||null},V),{renderInput:Z=>{var l,f,h;return K(U1,d(e(e({},Z),V.textFieldProps),{error:Boolean(u),InputProps:d(e(e({},Z.InputProps),(l=V.textFieldProps)==null?void 0:l.InputProps),{inputProps:e(e({},Z.inputProps),(h=(f=V.textFieldProps)==null?void 0:f.InputProps)==null?void 0:h.inputProps)})}))}})),K(w,{name:C})]})})},O1=D1(z1);export{O1 as Autocomplete,G3 as Checkbox,k3 as Creatable,g1 as DatePicker,A2 as Form,K3 as RadioButton,e1 as RadioGroup,c3 as Searchable,n3 as Select,H1 as Slider,O3 as Switch,W2 as TextField,E1 as TimePicker};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@s_mart/form",
3
- "version": "2.7.18",
3
+ "version": "2.7.19",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./dist/index.mjs",
6
6
  "types": "./dist/index.d.ts",
@@ -16,28 +16,29 @@
16
16
  "clean": "rm -rf .turbo && rm -rf node_modules && rm -rf dist"
17
17
  },
18
18
  "dependencies": {
19
- "tsup": "^6.2.3",
20
- "typescript": "^4.9.3",
21
- "@types/react": "18.0.18",
22
- "@types/react-dom": "18.0.6",
19
+ "@s_mart/core": "*",
20
+ "@s_mart/masks": "*",
21
+ "@s_mart/tokens": "*",
23
22
  "@s_mart/typed": "*",
24
23
  "@s_mart/utils": "*",
25
- "@s_mart/masks": "*",
26
- "@s_mart/core": "*",
27
- "@s_mart/tokens": "*"
24
+ "@types/react": "18.0.18",
25
+ "@types/react-dom": "18.0.6",
26
+ "lodash": "^4.17.21",
27
+ "tsup": "^6.2.3",
28
+ "typescript": "^4.9.3"
28
29
  },
29
30
  "peerDependencies": {
30
- "react": ">=18.0.0",
31
- "react-dom": ">=18.0.0",
32
- "typescript": ">=4.9.3",
33
- "react-hook-form": ">=7.36.1",
34
- "@mui/material": ">=5.11.2",
35
- "@types/react": ">=18.0.18",
36
- "@types/react-dom": ">=18.0.6",
37
31
  "@emotion/react": ">=11.10.4",
38
32
  "@emotion/styled": ">=11.10.4",
33
+ "@mui/material": ">=5.11.2",
39
34
  "@mui/x-date-pickers": ">=5.0.13",
40
- "@s_mart/core": ">=2.1.0"
35
+ "@s_mart/core": ">=2.1.0",
36
+ "@types/react": ">=18.0.18",
37
+ "@types/react-dom": ">=18.0.6",
38
+ "react": ">=18.0.0",
39
+ "react-dom": ">=18.0.0",
40
+ "react-hook-form": ">=7.36.1",
41
+ "typescript": ">=4.9.3"
41
42
  },
42
43
  "devDependencies": {
43
44
  "@s_mart/eslint": "*",