@s_mart/form 2.8.1 → 2.8.2

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.js CHANGED
@@ -1,4 +1,4 @@
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},V=(C,i)=>T3(C,A3(i));var f=(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(u){var L=u,{children:C,onSubmit:i,style:e,disableDefaultValuesUpdate:n}=L,r=f(L,["children","onSubmit","style","disableDefaultValuesUpdate"]);let l=(0,s2.useForm)(r);(0,I2.useEffect)(()=>{n||l.reset(r.defaultValues)},[r.defaultValues,l.reset]);let s=()=>typeof C=="function"?C(V(o({},l),{onSubmit:l.handleSubmit(M=>i(M,l))})):C;return(0,b2.jsx)(s2.FormProvider,V(o({},l),{children:(0,b2.jsx)("form",{onSubmit:M=>{M.preventDefault(),M.stopPropagation(),l.handleSubmit(a=>i(a,l))()},style:e,children:s()})}))}var $2=$3;var d2=require("react"),V2=require("react-hook-form"),q=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"),b=({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,u,L;if(C[i])return C[i];if(i.includes("[")){let[l,s]=i.split("["),[M,a]=s.split("].");return(n=(e=C[l])==null?void 0:e[M])==null?void 0:n[a]}if(i.includes(".")){let[l,s,M]=i.split(".");return M?(L=(u=C[l])==null?void 0:u[s])==null?void 0:L[M]:(r=C[l])==null?void 0:r[s]}};var j2=require("react/jsx-runtime"),v=({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=F=>{var Z=F,{name:C,rules:i,defaultValue:e,shouldUnregister:n,label:r,required:u,mask:L,variant:l="outlined",info:s,parse:M,format:a,onInputChange:d}=Z,g=f(Z,["name","rules","defaultValue","shouldUnregister","label","required","mask","variant","info","parse","format","onInputChange"]);let t=(0,V2.useFormContext)();if(!t)throw new Error("Para usar o <TextField /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let[c,w]=(0,d2.useState)(!1),O=k=>{var H;let p=k;return a&&(p=a(k)),L?(H=K==null?void 0:K[L])==null?void 0:H.format(p):p},P=k=>{var H;let p=k;return M&&(p=M(k)),L?(H=K==null?void 0:K[L])==null?void 0:H.parse(p):p},T=k=>{if(!k||L!=="porcentagem")return;k==null||k.stopPropagation();let p=(k==null?void 0:k.target).value;if(p){let H=String(p);if(H.length>0){let y=H.indexOf("%");y>-1&&(k.currentTarget.selectionEnd=y)}}},x=B(t.formState.errors,C);return(0,A.jsx)(V2.Controller,{control:t.control,name:C,rules:i,defaultValue:e,shouldUnregister:n,render:({field:{value:k,onChange:p}})=>(0,A.jsxs)(q.Grid,{display:"flex",flexDirection:"column",children:[(0,A.jsx)(q.Grid,{item:!0,xs:12,children:(0,A.jsxs)(q.Grid,{container:!0,direction:"row",children:[r&&(0,A.jsx)(q.Grid,{item:!0,children:(0,A.jsx)(b,{label:r,required:u})}),s&&(0,A.jsx)(q.Grid,{item:!0,children:(0,A.jsx)(n2.Tooltip,{title:s,placement:"top",children:(0,A.jsx)("div",{style:{width:"fit-content"},children:(0,A.jsx)(n2.LIcon,{icon:_,color:"#757575"})})})})]})}),(0,A.jsx)(q.TextField,V(o({variant:l,autoComplete:"off",defaultValue:e,value:O(k||""),onChange:H=>{var y,A2;p(P((y=H==null?void 0:H.target)==null?void 0:y.value)),d==null||d(H,(A2=H==null?void 0:H.target)==null?void 0:A2.value,t.watch())},error:Boolean(x)},g),{type:g.type==="password"?c?"text":"password":g.type,InputProps:o({onKeyDown:T,endAdornment:g.type==="password"&&(0,A.jsx)(q.InputAdornment,{position:"end",onClick:()=>w(!c),style:{cursor:"pointer"},children:(0,A.jsx)(n2.LIcon,{icon:c?q2:U2,size:"24px",removeMargin:!0})})},g.InputProps)})),(0,A.jsx)(v,{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 S=require("react/jsx-runtime"),U3=Z=>{var t=Z,{name:C,rules:i,defaultValue:e,shouldUnregister:n,label:r,required:u,options:L,placeholder:l,onInputChange:s,footer:M,multiple:a,info:d,onChange:g}=t,F=f(t,["name","rules","defaultValue","shouldUnregister","label","required","options","placeholder","onInputChange","footer","multiple","info","onChange"]);let c=(0,a2.useFormContext)(),{palette:w}=(0,E.useTheme)(),[O,P]=(0,L2.useState)(!1);if(!c)throw new Error("Para usar o <Select /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let T=B(c.formState.errors,C);return console.warn=()=>{},(0,S.jsx)(a2.Controller,{control:c.control,name:C,rules:i,defaultValue:e||"",shouldUnregister:n,render:({field:{value:x,onChange:k}})=>(0,S.jsxs)(E.Grid,{display:"flex",flexDirection:"column",children:[(0,S.jsx)(E.Grid,{item:!0,xs:12,children:(0,S.jsxs)(E.Grid,{container:!0,direction:"row",children:[r&&(0,S.jsx)(E.Grid,{item:!0,children:(0,S.jsx)(b,{label:r,required:u})}),d&&(0,S.jsx)(E.Grid,{item:!0,children:(0,S.jsx)(Q.Tooltip,{title:d,placement:"top",children:(0,S.jsx)("div",{style:{width:"fit-content"},children:(0,S.jsx)(Q.LIcon,{icon:_,color:"#757575"})})})})]})}),(0,S.jsxs)(E.Select,V(o({open:O,onOpen:()=>P(!0),onClose:()=>P(!1),displayEmpty:Boolean(l),variant:"outlined",autoComplete:"off",value:x?x||"":a?[]:"",renderValue:p=>{var H;return(H=p==null?void 0:p.label)!=null?H:""},multiple:a,onChange:(p,H)=>{k(p.target.value),s==null||s(p,p.target.value,c.watch()),g&&g(p,H)},error:Boolean(T),size:F.size||"medium"},F),{children:[l&&(0,S.jsx)(E.MenuItem,{disabled:!0,value:"",children:(0,S.jsx)("p",{style:{color:w.grey[400]},children:l})}),L==null?void 0:L.map((p,H)=>(0,S.jsx)(E.MenuItem,{value:p,children:p.label},H)),M&&[(0,S.jsx)(E.Grid,{px:2,py:1,children:(0,S.jsx)(Q.Divider,{})},"footer-divider"),(0,S.jsx)("div",{children:M({closeSelect:()=>P(!1)})},"footer-content")]]})),(0,S.jsx)(v,{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 h=require("react/jsx-runtime"),k2=require("react"),R3=F=>{var Z=F,{name:C,rules:i,defaultValue:e,shouldUnregister:n,label:r,required:u,options:L,textFieldProps:l,noOptionsText:s,footer:M,multiple:a,info:d}=Z,g=f(Z,["name","rules","defaultValue","shouldUnregister","label","required","options","textFieldProps","noOptionsText","footer","multiple","info"]);let t=(0,M2.useFormContext)();if(!t)throw new Error("Para usar o <Searchable /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let c=B(t.formState.errors,C);return console.warn=()=>{},(0,h.jsx)(M2.Controller,{control:t.control,name:C,rules:i,defaultValue:e,shouldUnregister:n,render:({field:{onChange:w,value:O}})=>(0,h.jsxs)(G.Grid,{display:"flex",flexDirection:"column",children:[(0,h.jsx)(G.Grid,{display:"flex",flexDirection:"column",children:(0,h.jsx)(G.Grid,{item:!0,xs:12,children:(0,h.jsxs)(G.Grid,{container:!0,direction:"row",children:[r&&(0,h.jsx)(G.Grid,{item:!0,children:(0,h.jsx)(b,{label:r,required:u})}),d&&(0,h.jsx)(G.Grid,{item:!0,children:(0,h.jsx)(J.Tooltip,{title:d,placement:"top",children:(0,h.jsx)("div",{style:{width:"fit-content"},children:(0,h.jsx)(J.LIcon,{icon:_,color:"#757575"})})})})]})})}),(0,h.jsx)(G.Autocomplete,V(o({onChange:(P,T)=>w(T),value:O||(a?[]:null),options:L,multiple:a,noOptionsText:s||"Nenhuma op\xE7\xE3o encontrada",isOptionEqualToValue:(P,T)=>typeof P=="string"&&typeof T=="string"?P===T:typeof P=="object"&&typeof T=="object"?P.value===T.value:!1,renderOption:(P,T)=>typeof T=="object"?(0,k2.createElement)("li",V(o({},P),{key:T.key||T.value}),T.label):(0,k2.createElement)("li",V(o({},P),{key:T}),T),ListboxComponent:P=>(0,h.jsxs)("ul",V(o({},P),{children:[P.children,M&&(0,h.jsx)("li",{children:(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(G.Grid,{px:2,py:1,children:(0,h.jsx)(J.Divider,{})}),M]})},"searchable-footer")]}))},g),{renderInput:P=>(0,h.jsx)(G.TextField,o(o({error:Boolean(c)},P),l))})),(0,h.jsx)(v,{name:C})]})})},Q2=(0,K2.memo)(R3);var i3=require("react"),Z2=require("react-hook-form"),D=require("@mui/material");var z=require("@s_mart/utils"),v2=H2(require("@emotion/styled")),S2=require("@emotion/react"),J2=S2.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},V=(C,i)=>T3(C,A3(i));var f=(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(u){var L=u,{children:C,onSubmit:i,style:e,disableDefaultValuesUpdate:n}=L,r=f(L,["children","onSubmit","style","disableDefaultValuesUpdate"]);let l=(0,s2.useForm)(r);(0,I2.useEffect)(()=>{n||l.reset(r.defaultValues)},[r.defaultValues,l.reset]);let s=()=>typeof C=="function"?C(V(o({},l),{onSubmit:l.handleSubmit(M=>i(M,l))})):C;return(0,b2.jsx)(s2.FormProvider,V(o({},l),{children:(0,b2.jsx)("form",{onSubmit:M=>{M.preventDefault(),M.stopPropagation(),l.handleSubmit(a=>i(a,l))()},style:e,children:s()})}))}var $2=$3;var d2=require("react"),V2=require("react-hook-form"),q=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"),b=({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,u,L;if(C[i])return C[i];if(i.includes("[")){let[l,s]=i.split("["),[M,a]=s.split("].");return(n=(e=C[l])==null?void 0:e[M])==null?void 0:n[a]}if(i.includes(".")){let[l,s,M]=i.split(".");return M?(L=(u=C[l])==null?void 0:u[s])==null?void 0:L[M]:(r=C[l])==null?void 0:r[s]}};var j2=require("react/jsx-runtime"),v=({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=F=>{var Z=F,{name:C,rules:i,defaultValue:e,shouldUnregister:n,label:r,required:u,mask:L,variant:l="outlined",info:s,parse:M,format:a,onInputChange:d}=Z,g=f(Z,["name","rules","defaultValue","shouldUnregister","label","required","mask","variant","info","parse","format","onInputChange"]);let t=(0,V2.useFormContext)();if(!t)throw new Error("Para usar o <TextField /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let[c,w]=(0,d2.useState)(!1),O=k=>{var H;let p=k;return a&&(p=a(k)),L?(H=K==null?void 0:K[L])==null?void 0:H.format(p):p},P=k=>{var H;let p=k;return M&&(p=M(k)),L?(H=K==null?void 0:K[L])==null?void 0:H.parse(p):p},T=k=>{if(!k||L!=="porcentagem")return;k==null||k.stopPropagation();let p=(k==null?void 0:k.target).value;if(p){let H=String(p);if(H.length>0){let y=H.indexOf("%");y>-1&&(k.currentTarget.selectionEnd=y)}}},x=B(t.formState.errors,C);return(0,A.jsx)(V2.Controller,{control:t.control,name:C,rules:i,defaultValue:e,shouldUnregister:n,render:({field:{value:k,onChange:p}})=>(0,A.jsxs)(q.Grid,{display:"flex",flexDirection:"column",children:[(0,A.jsx)(q.Grid,{item:!0,xs:12,children:(0,A.jsxs)(q.Grid,{container:!0,direction:"row",children:[r&&(0,A.jsx)(q.Grid,{item:!0,children:(0,A.jsx)(b,{label:r,required:u})}),s&&(0,A.jsx)(q.Grid,{item:!0,children:(0,A.jsx)(n2.Tooltip,{title:s,placement:"top",children:(0,A.jsx)("div",{style:{width:"fit-content"},children:(0,A.jsx)(n2.LIcon,{icon:_,color:"#757575"})})})})]})}),(0,A.jsx)(q.TextField,V(o({variant:l,defaultValue:e,value:O(k||""),onChange:H=>{var y,A2;p(P((y=H==null?void 0:H.target)==null?void 0:y.value)),d==null||d(H,(A2=H==null?void 0:H.target)==null?void 0:A2.value,t.watch())},error:Boolean(x)},g),{type:g.type==="password"?c?"text":"password":g.type,autoComplete:g.autoComplete||"off",InputProps:o({onKeyDown:T,endAdornment:g.type==="password"&&(0,A.jsx)(q.InputAdornment,{position:"end",onClick:()=>w(!c),style:{cursor:"pointer"},children:(0,A.jsx)(n2.LIcon,{icon:c?q2:U2,size:"24px",removeMargin:!0})})},g.InputProps)})),(0,A.jsx)(v,{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 S=require("react/jsx-runtime"),U3=Z=>{var t=Z,{name:C,rules:i,defaultValue:e,shouldUnregister:n,label:r,required:u,options:L,placeholder:l,onInputChange:s,footer:M,multiple:a,info:d,onChange:g}=t,F=f(t,["name","rules","defaultValue","shouldUnregister","label","required","options","placeholder","onInputChange","footer","multiple","info","onChange"]);let c=(0,a2.useFormContext)(),{palette:w}=(0,E.useTheme)(),[O,P]=(0,L2.useState)(!1);if(!c)throw new Error("Para usar o <Select /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let T=B(c.formState.errors,C);return console.warn=()=>{},(0,S.jsx)(a2.Controller,{control:c.control,name:C,rules:i,defaultValue:e||"",shouldUnregister:n,render:({field:{value:x,onChange:k}})=>(0,S.jsxs)(E.Grid,{display:"flex",flexDirection:"column",children:[(0,S.jsx)(E.Grid,{item:!0,xs:12,children:(0,S.jsxs)(E.Grid,{container:!0,direction:"row",children:[r&&(0,S.jsx)(E.Grid,{item:!0,children:(0,S.jsx)(b,{label:r,required:u})}),d&&(0,S.jsx)(E.Grid,{item:!0,children:(0,S.jsx)(Q.Tooltip,{title:d,placement:"top",children:(0,S.jsx)("div",{style:{width:"fit-content"},children:(0,S.jsx)(Q.LIcon,{icon:_,color:"#757575"})})})})]})}),(0,S.jsxs)(E.Select,V(o({open:O,onOpen:()=>P(!0),onClose:()=>P(!1),displayEmpty:Boolean(l),variant:"outlined",autoComplete:"off",value:x?x||"":a?[]:"",renderValue:p=>{var H;return(H=p==null?void 0:p.label)!=null?H:""},multiple:a,onChange:(p,H)=>{k(p.target.value),s==null||s(p,p.target.value,c.watch()),g&&g(p,H)},error:Boolean(T),size:F.size||"medium"},F),{children:[l&&(0,S.jsx)(E.MenuItem,{disabled:!0,value:"",children:(0,S.jsx)("p",{style:{color:w.grey[400]},children:l})}),L==null?void 0:L.map((p,H)=>(0,S.jsx)(E.MenuItem,{value:p,children:p.label},H)),M&&[(0,S.jsx)(E.Grid,{px:2,py:1,children:(0,S.jsx)(Q.Divider,{})},"footer-divider"),(0,S.jsx)("div",{children:M({closeSelect:()=>P(!1)})},"footer-content")]]})),(0,S.jsx)(v,{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 h=require("react/jsx-runtime"),k2=require("react"),R3=F=>{var Z=F,{name:C,rules:i,defaultValue:e,shouldUnregister:n,label:r,required:u,options:L,textFieldProps:l,noOptionsText:s,footer:M,multiple:a,info:d}=Z,g=f(Z,["name","rules","defaultValue","shouldUnregister","label","required","options","textFieldProps","noOptionsText","footer","multiple","info"]);let t=(0,M2.useFormContext)();if(!t)throw new Error("Para usar o <Searchable /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let c=B(t.formState.errors,C);return console.warn=()=>{},(0,h.jsx)(M2.Controller,{control:t.control,name:C,rules:i,defaultValue:e,shouldUnregister:n,render:({field:{onChange:w,value:O}})=>(0,h.jsxs)(G.Grid,{display:"flex",flexDirection:"column",children:[(0,h.jsx)(G.Grid,{display:"flex",flexDirection:"column",children:(0,h.jsx)(G.Grid,{item:!0,xs:12,children:(0,h.jsxs)(G.Grid,{container:!0,direction:"row",children:[r&&(0,h.jsx)(G.Grid,{item:!0,children:(0,h.jsx)(b,{label:r,required:u})}),d&&(0,h.jsx)(G.Grid,{item:!0,children:(0,h.jsx)(J.Tooltip,{title:d,placement:"top",children:(0,h.jsx)("div",{style:{width:"fit-content"},children:(0,h.jsx)(J.LIcon,{icon:_,color:"#757575"})})})})]})})}),(0,h.jsx)(G.Autocomplete,V(o({onChange:(P,T)=>w(T),value:O||(a?[]:null),options:L,multiple:a,noOptionsText:s||"Nenhuma op\xE7\xE3o encontrada",isOptionEqualToValue:(P,T)=>typeof P=="string"&&typeof T=="string"?P===T:typeof P=="object"&&typeof T=="object"?P.value===T.value:!1,renderOption:(P,T)=>typeof T=="object"?(0,k2.createElement)("li",V(o({},P),{key:T.key||T.value}),T.label):(0,k2.createElement)("li",V(o({},P),{key:T}),T),ListboxComponent:P=>(0,h.jsxs)("ul",V(o({},P),{children:[P.children,M&&(0,h.jsx)("li",{children:(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(G.Grid,{px:2,py:1,children:(0,h.jsx)(J.Divider,{})}),M]})},"searchable-footer")]}))},g),{renderInput:P=>(0,h.jsx)(G.TextField,o(o({error:Boolean(c)},P),l))})),(0,h.jsx)(v,{name:C})]})})},Q2=(0,K2.memo)(R3);var i3=require("react"),Z2=require("react-hook-form"),D=require("@mui/material");var z=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;
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
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},V=(C,i)=>w2(C,k2(i));var u=(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(m){var L=m,{children:C,onSubmit:i,style:o,disableDefaultValuesUpdate:n}=L,r=u(L,["children","onSubmit","style","disableDefaultValuesUpdate"]);let l=T2(r);v2(()=>{n||l.reset(r.defaultValues)},[r.defaultValues,l.reset]);let s=()=>typeof C=="function"?C(V(e({},l),{onSubmit:l.handleSubmit(M=>i(M,l))})):C;return t2(S2,V(e({},l),{children:t2("form",{onSubmit:M=>{M.preventDefault(),M.stopPropagation(),l.handleSubmit(a=>i(a,l))()},style:o,children:s()})}))}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 F=({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,m,L;if(C[i])return C[i];if(i.includes("[")){let[l,s]=i.split("["),[M,a]=s.split("].");return(n=(o=C[l])==null?void 0:o[M])==null?void 0:n[a]}if(i.includes(".")){let[l,s,M]=i.split(".");return M?(L=(m=C[l])==null?void 0:m[s])==null?void 0:L[M]:(r=C[l])==null?void 0:r[s]}};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=y=>{var Z=y,{name:C,rules:i,defaultValue:o,shouldUnregister:n,label:r,required:m,mask:L,variant:l="outlined",info:s,parse:M,format:a,onInputChange:d}=Z,f=u(Z,["name","rules","defaultValue","shouldUnregister","label","required","mask","variant","info","parse","format","onInputChange"]);let t=z2();if(!t)throw new Error("Para usar o <TextField /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let[c,P]=U2(!1),D=b=>{var H;let p=b;return a&&(p=a(b)),L?(H=z==null?void 0:z[L])==null?void 0:H.format(p):p},h=b=>{var H;let p=b;return M&&(p=M(b)),L?(H=z==null?void 0:z[L])==null?void 0:H.parse(p):p},k=b=>{if(!b||L!=="porcentagem")return;b==null||b.stopPropagation();let p=(b==null?void 0:b.target).value;if(p){let H=String(p);if(H.length>0){let x=H.indexOf("%");x>-1&&(b.currentTarget.selectionEnd=x)}}},g=S(t.formState.errors,C);return A(R2,{control:t.control,name:C,rules:i,defaultValue:o,shouldUnregister:n,render:({field:{value:b,onChange:p}})=>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(F,{label:r,required:m})}),s&&A(N,{item:!0,children:A(N2,{title:s,placement:"top",children:A("div",{style:{width:"fit-content"},children:A(M2,{icon:I,color:"#757575"})})})})]})}),A(_2,V(e({variant:l,autoComplete:"off",defaultValue:o,value:D(b||""),onChange:H=>{var x,o2;p(h((x=H==null?void 0:H.target)==null?void 0:x.value)),d==null||d(H,(o2=H==null?void 0:H.target)==null?void 0:o2.value,t.watch())},error:Boolean(g)},f),{type:f.type==="password"?c?"text":"password":f.type,InputProps:e({onKeyDown:k,endAdornment:f.type==="password"&&A(O2,{position:"end",onClick:()=>P(!c),style:{cursor:"pointer"},children:A(M2,{icon:c?H2:s2,size:"24px",removeMargin:!0})})},f.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{jsx as T,jsxs as i2}from"react/jsx-runtime";var r3=Z=>{var t=Z,{name:C,rules:i,defaultValue:o,shouldUnregister:n,label:r,required:m,options:L,placeholder:l,onInputChange:s,footer:M,multiple:a,info:d,onChange:f}=t,y=u(t,["name","rules","defaultValue","shouldUnregister","label","required","options","placeholder","onInputChange","footer","multiple","info","onChange"]);let c=J2(),{palette:P}=o3(),[D,h]=K2(!1);if(!c)throw new Error("Para usar o <Select /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let k=S(c.formState.errors,C);return console.warn=()=>{},T(Q2,{control:c.control,name:C,rules:i,defaultValue:o||"",shouldUnregister:n,render:({field:{value:g,onChange:b}})=>i2(O,{display:"flex",flexDirection:"column",children:[T(O,{item:!0,xs:12,children:i2(O,{container:!0,direction:"row",children:[r&&T(O,{item:!0,children:T(F,{label:r,required:m})}),d&&T(O,{item:!0,children:T(i3,{title:d,placement:"top",children:T("div",{style:{width:"fit-content"},children:T(C3,{icon:I,color:"#757575"})})})})]})}),i2(e3,V(e({open:D,onOpen:()=>h(!0),onClose:()=>h(!1),displayEmpty:Boolean(l),variant:"outlined",autoComplete:"off",value:g?g||"":a?[]:"",renderValue:p=>{var H;return(H=p==null?void 0:p.label)!=null?H:""},multiple:a,onChange:(p,H)=>{b(p.target.value),s==null||s(p,p.target.value,c.watch()),f&&f(p,H)},error:Boolean(k),size:y.size||"medium"},y),{children:[l&&T(c2,{disabled:!0,value:"",children:T("p",{style:{color:P.grey[400]},children:l})}),L==null?void 0:L.map((p,H)=>T(c2,{value:p,children:p.label},H)),M&&[T(O,{px:2,py:1,children:T(X2,{})},"footer-divider"),T("div",{children:M({closeSelect:()=>h(!1)})},"footer-content")]]})),T(w,{name:C})]})})},n3=Y2(r3);import{memo as l3}from"react";import{Controller as t3,useFormContext as H3}from"react-hook-form";import{Grid as q,Autocomplete as s3,TextField as d3}from"@mui/material";import{Divider as V3,LIcon as L3,Tooltip as a3}from"@s_mart/core";import{Fragment as c3,jsx as B,jsxs as J}from"react/jsx-runtime";import{createElement as p2}from"react";var M3=y=>{var Z=y,{name:C,rules:i,defaultValue:o,shouldUnregister:n,label:r,required:m,options:L,textFieldProps:l,noOptionsText:s,footer:M,multiple:a,info:d}=Z,f=u(Z,["name","rules","defaultValue","shouldUnregister","label","required","options","textFieldProps","noOptionsText","footer","multiple","info"]);let t=H3();if(!t)throw new Error("Para usar o <Searchable /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let c=S(t.formState.errors,C);return console.warn=()=>{},B(t3,{control:t.control,name:C,rules:i,defaultValue:o,shouldUnregister:n,render:({field:{onChange:P,value:D}})=>J(q,{display:"flex",flexDirection:"column",children:[B(q,{display:"flex",flexDirection:"column",children:B(q,{item:!0,xs:12,children:J(q,{container:!0,direction:"row",children:[r&&B(q,{item:!0,children:B(F,{label:r,required:m})}),d&&B(q,{item:!0,children:B(a3,{title:d,placement:"top",children:B("div",{style:{width:"fit-content"},children:B(L3,{icon:I,color:"#757575"})})})})]})})}),B(s3,V(e({onChange:(h,k)=>P(k),value:D||(a?[]:null),options:L,multiple:a,noOptionsText:s||"Nenhuma op\xE7\xE3o encontrada",isOptionEqualToValue:(h,k)=>typeof h=="string"&&typeof k=="string"?h===k:typeof h=="object"&&typeof k=="object"?h.value===k.value:!1,renderOption:(h,k)=>typeof k=="object"?p2("li",V(e({},h),{key:k.key||k.value}),k.label):p2("li",V(e({},h),{key:k}),k),ListboxComponent:h=>J("ul",V(e({},h),{children:[h.children,M&&B("li",{children:J(c3,{children:[B(q,{px:2,py:1,children:B(V3,{})}),M]})},"searchable-footer")]}))},f),{renderInput:h=>B(d3,e(e({error:Boolean(c)},h),l))})),B(w,{name:C})]})})},Z3=l3(M3);import{memo as m3}from"react";import{Controller as u3,useFormContext as f3}from"react-hook-form";import{Grid as j,Autocomplete as g3,TextField as x3,Typography as y3}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`
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},V=(C,i)=>w2(C,k2(i));var u=(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(m){var L=m,{children:C,onSubmit:i,style:o,disableDefaultValuesUpdate:n}=L,r=u(L,["children","onSubmit","style","disableDefaultValuesUpdate"]);let l=T2(r);v2(()=>{n||l.reset(r.defaultValues)},[r.defaultValues,l.reset]);let s=()=>typeof C=="function"?C(V(e({},l),{onSubmit:l.handleSubmit(M=>i(M,l))})):C;return t2(S2,V(e({},l),{children:t2("form",{onSubmit:M=>{M.preventDefault(),M.stopPropagation(),l.handleSubmit(a=>i(a,l))()},style:o,children:s()})}))}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 F=({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,m,L;if(C[i])return C[i];if(i.includes("[")){let[l,s]=i.split("["),[M,a]=s.split("].");return(n=(o=C[l])==null?void 0:o[M])==null?void 0:n[a]}if(i.includes(".")){let[l,s,M]=i.split(".");return M?(L=(m=C[l])==null?void 0:m[s])==null?void 0:L[M]:(r=C[l])==null?void 0:r[s]}};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=y=>{var Z=y,{name:C,rules:i,defaultValue:o,shouldUnregister:n,label:r,required:m,mask:L,variant:l="outlined",info:s,parse:M,format:a,onInputChange:d}=Z,f=u(Z,["name","rules","defaultValue","shouldUnregister","label","required","mask","variant","info","parse","format","onInputChange"]);let t=z2();if(!t)throw new Error("Para usar o <TextField /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let[c,P]=U2(!1),D=b=>{var H;let p=b;return a&&(p=a(b)),L?(H=z==null?void 0:z[L])==null?void 0:H.format(p):p},h=b=>{var H;let p=b;return M&&(p=M(b)),L?(H=z==null?void 0:z[L])==null?void 0:H.parse(p):p},k=b=>{if(!b||L!=="porcentagem")return;b==null||b.stopPropagation();let p=(b==null?void 0:b.target).value;if(p){let H=String(p);if(H.length>0){let x=H.indexOf("%");x>-1&&(b.currentTarget.selectionEnd=x)}}},g=S(t.formState.errors,C);return A(R2,{control:t.control,name:C,rules:i,defaultValue:o,shouldUnregister:n,render:({field:{value:b,onChange:p}})=>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(F,{label:r,required:m})}),s&&A(N,{item:!0,children:A(N2,{title:s,placement:"top",children:A("div",{style:{width:"fit-content"},children:A(M2,{icon:I,color:"#757575"})})})})]})}),A(_2,V(e({variant:l,defaultValue:o,value:D(b||""),onChange:H=>{var x,o2;p(h((x=H==null?void 0:H.target)==null?void 0:x.value)),d==null||d(H,(o2=H==null?void 0:H.target)==null?void 0:o2.value,t.watch())},error:Boolean(g)},f),{type:f.type==="password"?c?"text":"password":f.type,autoComplete:f.autoComplete||"off",InputProps:e({onKeyDown:k,endAdornment:f.type==="password"&&A(O2,{position:"end",onClick:()=>P(!c),style:{cursor:"pointer"},children:A(M2,{icon:c?H2:s2,size:"24px",removeMargin:!0})})},f.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{jsx as T,jsxs as i2}from"react/jsx-runtime";var r3=Z=>{var t=Z,{name:C,rules:i,defaultValue:o,shouldUnregister:n,label:r,required:m,options:L,placeholder:l,onInputChange:s,footer:M,multiple:a,info:d,onChange:f}=t,y=u(t,["name","rules","defaultValue","shouldUnregister","label","required","options","placeholder","onInputChange","footer","multiple","info","onChange"]);let c=J2(),{palette:P}=o3(),[D,h]=K2(!1);if(!c)throw new Error("Para usar o <Select /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let k=S(c.formState.errors,C);return console.warn=()=>{},T(Q2,{control:c.control,name:C,rules:i,defaultValue:o||"",shouldUnregister:n,render:({field:{value:g,onChange:b}})=>i2(O,{display:"flex",flexDirection:"column",children:[T(O,{item:!0,xs:12,children:i2(O,{container:!0,direction:"row",children:[r&&T(O,{item:!0,children:T(F,{label:r,required:m})}),d&&T(O,{item:!0,children:T(i3,{title:d,placement:"top",children:T("div",{style:{width:"fit-content"},children:T(C3,{icon:I,color:"#757575"})})})})]})}),i2(e3,V(e({open:D,onOpen:()=>h(!0),onClose:()=>h(!1),displayEmpty:Boolean(l),variant:"outlined",autoComplete:"off",value:g?g||"":a?[]:"",renderValue:p=>{var H;return(H=p==null?void 0:p.label)!=null?H:""},multiple:a,onChange:(p,H)=>{b(p.target.value),s==null||s(p,p.target.value,c.watch()),f&&f(p,H)},error:Boolean(k),size:y.size||"medium"},y),{children:[l&&T(c2,{disabled:!0,value:"",children:T("p",{style:{color:P.grey[400]},children:l})}),L==null?void 0:L.map((p,H)=>T(c2,{value:p,children:p.label},H)),M&&[T(O,{px:2,py:1,children:T(X2,{})},"footer-divider"),T("div",{children:M({closeSelect:()=>h(!1)})},"footer-content")]]})),T(w,{name:C})]})})},n3=Y2(r3);import{memo as l3}from"react";import{Controller as t3,useFormContext as H3}from"react-hook-form";import{Grid as q,Autocomplete as s3,TextField as d3}from"@mui/material";import{Divider as V3,LIcon as L3,Tooltip as a3}from"@s_mart/core";import{Fragment as c3,jsx as B,jsxs as J}from"react/jsx-runtime";import{createElement as p2}from"react";var M3=y=>{var Z=y,{name:C,rules:i,defaultValue:o,shouldUnregister:n,label:r,required:m,options:L,textFieldProps:l,noOptionsText:s,footer:M,multiple:a,info:d}=Z,f=u(Z,["name","rules","defaultValue","shouldUnregister","label","required","options","textFieldProps","noOptionsText","footer","multiple","info"]);let t=H3();if(!t)throw new Error("Para usar o <Searchable /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let c=S(t.formState.errors,C);return console.warn=()=>{},B(t3,{control:t.control,name:C,rules:i,defaultValue:o,shouldUnregister:n,render:({field:{onChange:P,value:D}})=>J(q,{display:"flex",flexDirection:"column",children:[B(q,{display:"flex",flexDirection:"column",children:B(q,{item:!0,xs:12,children:J(q,{container:!0,direction:"row",children:[r&&B(q,{item:!0,children:B(F,{label:r,required:m})}),d&&B(q,{item:!0,children:B(a3,{title:d,placement:"top",children:B("div",{style:{width:"fit-content"},children:B(L3,{icon:I,color:"#757575"})})})})]})})}),B(s3,V(e({onChange:(h,k)=>P(k),value:D||(a?[]:null),options:L,multiple:a,noOptionsText:s||"Nenhuma op\xE7\xE3o encontrada",isOptionEqualToValue:(h,k)=>typeof h=="string"&&typeof k=="string"?h===k:typeof h=="object"&&typeof k=="object"?h.value===k.value:!1,renderOption:(h,k)=>typeof k=="object"?p2("li",V(e({},h),{key:k.key||k.value}),k.label):p2("li",V(e({},h),{key:k}),k),ListboxComponent:h=>J("ul",V(e({},h),{children:[h.children,M&&B("li",{children:J(c3,{children:[B(q,{px:2,py:1,children:B(V3,{})}),M]})},"searchable-footer")]}))},f),{renderInput:h=>B(d3,e(e({error:Boolean(c)},h),l))})),B(w,{name:C})]})})},Z3=l3(M3);import{memo as m3}from"react";import{Controller as u3,useFormContext as f3}from"react-hook-form";import{Grid as j,Autocomplete as g3,TextField as x3,Typography as y3}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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@s_mart/form",
3
- "version": "2.8.1",
3
+ "version": "2.8.2",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./dist/index.mjs",
6
6
  "types": "./dist/index.d.ts",