@s_mart/form 2.7.15 → 2.7.17
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 +12 -1
- package/dist/index.js +22 -22
- package/dist/index.mjs +22 -22
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -120,9 +120,20 @@ type SearchableProps = Omit<AutocompleteProps$1<SearchableOption, true, true, tr
|
|
|
120
120
|
* @default 'Nenhuma opção encontrada'
|
|
121
121
|
*/
|
|
122
122
|
noOptionsText?: string;
|
|
123
|
+
/**
|
|
124
|
+
* Componente que renderiza no footer do searchable (opcional)
|
|
125
|
+
*
|
|
126
|
+
* @example
|
|
127
|
+
* footer: (
|
|
128
|
+
* <Button onClick={handleClick}>Mostrar mais...</Button>
|
|
129
|
+
* )
|
|
130
|
+
*
|
|
131
|
+
*
|
|
132
|
+
*/
|
|
133
|
+
footer?: React.ReactNode;
|
|
123
134
|
};
|
|
124
135
|
|
|
125
|
-
declare const _default$4: react.MemoExoticComponent<({ name, rules, defaultValue, shouldUnregister, label, required, options, textFieldProps, noOptionsText, ...rest }: SearchableProps) => JSX.Element>;
|
|
136
|
+
declare const _default$4: react.MemoExoticComponent<({ name, rules, defaultValue, shouldUnregister, label, required, options, textFieldProps, noOptionsText, footer, ...rest }: SearchableProps) => JSX.Element>;
|
|
126
137
|
|
|
127
138
|
type ControllerCreatable = Omit<ControllerProps, 'render' | 'control'>;
|
|
128
139
|
type CreatableOption = {
|
package/dist/index.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
"use strict";var P3=Object.create;var J=Object.defineProperty,b3=Object.defineProperties,w3=Object.getOwnPropertyDescriptor,k3=Object.getOwnPropertyDescriptors,v3=Object.getOwnPropertyNames,i2=Object.getOwnPropertySymbols,S3=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},L=(C,i)=>b3(C,k3(i));var f=(C,i)=>{var e={};for(var l in C)u2.call(C,l)&&i.indexOf(l)<0&&(e[l]=C[l]);if(C!=null&&i2)for(var l of i2(C))i.indexOf(l)<0&&k2.call(C,l)&&(e[l]=C[l]);return e};var B3=(C,i)=>{for(var e in i)J(C,e,{get:i[e],enumerable:!0})},v2=(C,i,e,l)=>{if(i&&typeof i=="object"||typeof i=="function")for(let r of v3(i))!u2.call(C,r)&&r!==e&&J(C,r,{get:()=>i[r],enumerable:!(l=w3(i,r))||l.enumerable});return C};var e2=(C,i,e)=>(e=C!=null?P3(S3(C)):{},v2(i||!C||!C.__esModule?J(e,"default",{value:C,enumerable:!0}):e,C)),A3=C=>v2(J({},"__esModule",{value:!0}),C);var J3={};B3(J3,{Autocomplete:()=>h3,Checkbox:()=>J2,Creatable:()=>Q2,DatePicker:()=>L3,Form:()=>B2,RadioButton:()=>C3,RadioGroup:()=>i3,Searchable:()=>_2,Select:()=>z2,Slider:()=>o3,Switch:()=>X2,TextField:()=>U2,TimePicker:()=>g3});module.exports=A3(J3);var S2=require("react"),o2=require("react-hook-form");var f2=require("react/jsx-runtime");function T3(u){var t=u,{children:C,onSubmit:i,style:e,disableDefaultValuesUpdate:l}=t,r=f(t,["children","onSubmit","style","disableDefaultValuesUpdate"]);let H=(0,o2.useForm)(r);(0,S2.useEffect)(()=>{l||H.reset(r.defaultValues)},[r.defaultValues,H.reset]);let a=()=>typeof C=="function"?C(L(o({},H),{onSubmit:H.handleSubmit(p=>i(p,H))})):C;return(0,f2.jsx)(o2.FormProvider,L(o({},H),{children:(0,f2.jsx)("form",{onSubmit:p=>{p.preventDefault(),p.stopPropagation(),H.handleSubmit(M=>i(M,H))()},style:e,children:a()})}))}var B2=T3;var r2=require("react"),l2=require("react-hook-form"),N=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 _=e2(require("@s_mart/masks"));var g2=require("@mui/material"),D2=require("@s_mart/utils"),X=require("react/jsx-runtime"),x=({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 G2=require("react-hook-form"),I2=require("@s_mart/core");var P=(C,i)=>{var e,l,r,u;if(C[i])return C[i];if(i.includes("[")){let[t,H]=i.split("["),[a,p]=H.split("].");return(l=(e=C[t])==null?void 0:e[a])==null?void 0:l[p]}if(i.includes(".")){let[t,H,a]=i.split(".");return(u=(r=C[t])==null?void 0:r[H])==null?void 0:u[a]}};var $2=require("react/jsx-runtime"),y=({name:C})=>{var l;let i=(0,G2.useFormContext)(),e=P((l=i==null?void 0:i.formState)==null?void 0:l.errors,C);return e?(0,$2.jsx)(I2.Indicator,{severity:"error",children:e==null?void 0:e.message}):null};var q2=require("@s_mart/core");var E=require("react/jsx-runtime"),E3=h=>{var m=h,{name:C,rules:i,defaultValue:e,shouldUnregister:l,label:r,required:u,mask:t,variant:H="outlined",parse:a,format:p,onInputChange:M}=m,V=f(m,["name","rules","defaultValue","shouldUnregister","label","required","mask","variant","parse","format","onInputChange"]);let Z=(0,l2.useFormContext)();if(!Z)throw new Error("Para usar o <TextField /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let[d,c]=(0,r2.useState)(!1),n=s=>{var F;let k=s;return p&&(k=p(s)),t?(F=_==null?void 0:_[t])==null?void 0:F.format(k):k},z=s=>{var F;let k=s;return a&&(k=a(s)),t?(F=_==null?void 0:_[t])==null?void 0:F.parse(k):k},O=s=>{if(!s||t!=="porcentagem")return;s==null||s.stopPropagation();let k=(s==null?void 0:s.target).value;if(k){let F=String(k);if(F.length>0){let Q=F.indexOf("%");Q>-1&&(s.currentTarget.selectionEnd=Q)}}},g=P(Z.formState.errors,C);return(0,E.jsx)(l2.Controller,{control:Z.control,name:C,rules:i,defaultValue:e,shouldUnregister:l,render:({field:{value:s,onChange:k}})=>(0,E.jsxs)(N.Grid,{display:"flex",flexDirection:"column",children:[r&&(0,E.jsx)(x,{label:r,required:u}),(0,E.jsx)(N.TextField,L(o({variant:H,autoComplete:"off",defaultValue:e,value:n(s||""),onChange:F=>{var Q,b2;k(z((Q=F==null?void 0:F.target)==null?void 0:Q.value)),M==null||M(F,(b2=F==null?void 0:F.target)==null?void 0:b2.value,Z.watch())},error:Boolean(g)},V),{type:V.type==="password"?d?"text":"password":V.type,InputProps:o({onKeyDown:O,endAdornment:V.type==="password"&&(0,E.jsx)(N.InputAdornment,{position:"end",onClick:()=>c(!d),style:{cursor:"pointer"},children:(0,E.jsx)(q2.LIcon,{icon:d?A2:T2,size:"24px",removeMargin:!0})})},V.InputProps)})),(0,E.jsx)(y,{name:C})]})})},U2=(0,r2.memo)(E3);var n2=require("react"),H2=require("react-hook-form"),R2=require("@s_mart/core"),B=require("@mui/material");var w=require("react/jsx-runtime"),D3=V=>{var h=V,{name:C,rules:i,defaultValue:e,shouldUnregister:l,label:r,required:u,options:t,placeholder:H,onInputChange:a,footer:p}=h,M=f(h,["name","rules","defaultValue","shouldUnregister","label","required","options","placeholder","onInputChange","footer"]);let m=(0,H2.useFormContext)(),{palette:Z}=(0,B.useTheme)(),[d,c]=(0,n2.useState)(!1);if(!m)throw new Error("Para usar o <Select /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let n=P(m.formState.errors,C);return console.warn=()=>{},(0,w.jsx)(H2.Controller,{control:m.control,name:C,rules:i,defaultValue:e||"",shouldUnregister:l,render:({field:{value:z,onChange:O}})=>(0,w.jsxs)(B.Grid,{display:"flex",flexDirection:"column",children:[r&&(0,w.jsx)(x,{label:r,required:u}),(0,w.jsxs)(B.Select,L(o({open:d,onOpen:()=>c(!0),onClose:()=>c(!1),displayEmpty:Boolean(H),variant:"outlined",autoComplete:"off",value:z||"",onChange:g=>{O(g.target.value),a==null||a(g,g.target.value,m.watch())},error:Boolean(n),size:M.size||"medium"},M),{children:[H&&(0,w.jsx)(B.MenuItem,{disabled:!0,value:"",children:(0,w.jsx)("p",{style:{color:Z.grey[400]},children:H})}),t==null?void 0:t.map((g,s)=>(0,w.jsx)(B.MenuItem,{value:g.value,children:g.label},s)),p&&(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(B.Grid,{px:2,py:1,children:(0,w.jsx)(R2.Divider,{})}),p({closeSelect:()=>c(!1)})]})]})),(0,w.jsx)(y,{name:C})]})})},z2=(0,n2.memo)(D3);var O2=require("react"),t2=require("react-hook-form"),j=require("@mui/material");var G=require("react/jsx-runtime"),x2=require("react"),G3=M=>{var V=M,{name:C,rules:i,defaultValue:e,shouldUnregister:l,label:r,required:u,options:t,textFieldProps:H,noOptionsText:a}=V,p=f(V,["name","rules","defaultValue","shouldUnregister","label","required","options","textFieldProps","noOptionsText"]);let h=(0,t2.useFormContext)();if(!h)throw new Error("Para usar o <Searchable /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let m=P(h.formState.errors,C);return console.warn=()=>{},(0,G.jsx)(t2.Controller,{control:h.control,name:C,rules:i,defaultValue:e,shouldUnregister:l,render:({field:{onChange:Z,value:d}})=>(0,G.jsxs)(j.Grid,{display:"flex",flexDirection:"column",children:[r&&(0,G.jsx)(x,{label:r,required:u}),(0,G.jsx)(j.Autocomplete,L(o({onChange:(c,n)=>Z(n),value:d||null,options:t,noOptionsText:a||"Nenhuma op\xE7\xE3o encontrada",isOptionEqualToValue:(c,n)=>typeof c=="string"&&typeof n=="string"?c===n:typeof c=="object"&&typeof n=="object"?c.value===n.value:!1,renderOption:(c,n)=>typeof n=="object"?(0,x2.createElement)("li",L(o({},c),{key:n.key||n.value}),n.label):(0,x2.createElement)("li",L(o({},c),{key:n}),n)},p),{renderInput:c=>(0,G.jsx)(j.TextField,o(o({error:Boolean(m)},c),H))})),(0,G.jsx)(y,{name:C})]})})},_2=(0,O2.memo)(G3);var Y2=require("react"),s2=require("react-hook-form"),I=require("@mui/material");var D=require("@s_mart/utils"),y2=e2(require("@emotion/styled")),h2=require("@emotion/react"),N2=h2.css`
|
|
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},V=(C,i)=>w3(C,v3(i));var u=(C,i)=>{var e={};for(var l in C)u2.call(C,l)&&i.indexOf(l)<0&&(e[l]=C[l]);if(C!=null&&i2)for(var l of i2(C))i.indexOf(l)<0&&k2.call(C,l)&&(e[l]=C[l]);return e};var A3=(C,i)=>{for(var e in i)J(C,e,{get:i[e],enumerable:!0})},v2=(C,i,e,l)=>{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:!(l=k3(i,r))||l.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 t=m,{children:C,onSubmit:i,style:e,disableDefaultValuesUpdate:l}=t,r=u(t,["children","onSubmit","style","disableDefaultValuesUpdate"]);let H=(0,o2.useForm)(r);(0,S2.useEffect)(()=>{l||H.reset(r.defaultValues)},[r.defaultValues,H.reset]);let L=()=>typeof C=="function"?C(V(o({},H),{onSubmit:H.handleSubmit(c=>i(c,H))})):C;return(0,f2.jsx)(o2.FormProvider,V(o({},H),{children:(0,f2.jsx)("form",{onSubmit:c=>{c.preventDefault(),c.stopPropagation(),H.handleSubmit(a=>i(a,H))()},style:e,children:L()})}))}var B2=E3;var r2=require("react"),l2=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"),x=({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 G2=require("react-hook-form"),I2=require("@s_mart/core");var b=(C,i)=>{var e,l,r,m;if(C[i])return C[i];if(i.includes("[")){let[t,H]=i.split("["),[L,c]=H.split("].");return(l=(e=C[t])==null?void 0:e[L])==null?void 0:l[c]}if(i.includes(".")){let[t,H,L]=i.split(".");return(m=(r=C[t])==null?void 0:r[H])==null?void 0:m[L]}};var $2=require("react/jsx-runtime"),h=({name:C})=>{var l;let i=(0,G2.useFormContext)(),e=b((l=i==null?void 0:i.formState)==null?void 0:l.errors,C);return e?(0,$2.jsx)(I2.Indicator,{severity:"error",children:e==null?void 0:e.message}):null};var q2=require("@s_mart/core");var G=require("react/jsx-runtime"),D3=F=>{var p=F,{name:C,rules:i,defaultValue:e,shouldUnregister:l,label:r,required:m,mask:t,variant:H="outlined",parse:L,format:c,onInputChange:a}=p,M=u(p,["name","rules","defaultValue","shouldUnregister","label","required","mask","variant","parse","format","onInputChange"]);let Z=(0,l2.useFormContext)();if(!Z)throw new Error("Para usar o <TextField /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let[d,f]=(0,r2.useState)(!1),n=s=>{var P;let S=s;return c&&(S=c(s)),t?(P=N==null?void 0:N[t])==null?void 0:P.format(S):S},y=s=>{var P;let S=s;return L&&(S=L(s)),t?(P=N==null?void 0:N[t])==null?void 0:P.parse(S):S},_=s=>{if(!s||t!=="porcentagem")return;s==null||s.stopPropagation();let S=(s==null?void 0:s.target).value;if(S){let P=String(S);if(P.length>0){let Q=P.indexOf("%");Q>-1&&(s.currentTarget.selectionEnd=Q)}}},g=b(Z.formState.errors,C);return(0,G.jsx)(l2.Controller,{control:Z.control,name:C,rules:i,defaultValue:e,shouldUnregister:l,render:({field:{value:s,onChange:S}})=>(0,G.jsxs)(j.Grid,{display:"flex",flexDirection:"column",children:[r&&(0,G.jsx)(x,{label:r,required:m}),(0,G.jsx)(j.TextField,V(o({variant:H,autoComplete:"off",defaultValue:e,value:n(s||""),onChange:P=>{var Q,b2;S(y((Q=P==null?void 0:P.target)==null?void 0:Q.value)),a==null||a(P,(b2=P==null?void 0:P.target)==null?void 0:b2.value,Z.watch())},error:Boolean(g)},M),{type:M.type==="password"?d?"text":"password":M.type,InputProps:o({onKeyDown:_,endAdornment:M.type==="password"&&(0,G.jsx)(j.InputAdornment,{position:"end",onClick:()=>f(!d),style:{cursor:"pointer"},children:(0,G.jsx)(q2.LIcon,{icon:d?A2:T2,size:"24px",removeMargin:!0})})},M.InputProps)})),(0,G.jsx)(h,{name:C})]})})},U2=(0,r2.memo)(D3);var n2=require("react"),H2=require("react-hook-form"),R2=require("@s_mart/core"),T=require("@mui/material");var k=require("react/jsx-runtime"),G3=M=>{var F=M,{name:C,rules:i,defaultValue:e,shouldUnregister:l,label:r,required:m,options:t,placeholder:H,onInputChange:L,footer:c}=F,a=u(F,["name","rules","defaultValue","shouldUnregister","label","required","options","placeholder","onInputChange","footer"]);let p=(0,H2.useFormContext)(),{palette:Z}=(0,T.useTheme)(),[d,f]=(0,n2.useState)(!1);if(!p)throw new Error("Para usar o <Select /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let n=b(p.formState.errors,C);return console.warn=()=>{},(0,k.jsx)(H2.Controller,{control:p.control,name:C,rules:i,defaultValue:e||"",shouldUnregister:l,render:({field:{value:y,onChange:_}})=>(0,k.jsxs)(T.Grid,{display:"flex",flexDirection:"column",children:[r&&(0,k.jsx)(x,{label:r,required:m}),(0,k.jsxs)(T.Select,V(o({open:d,onOpen:()=>f(!0),onClose:()=>f(!1),displayEmpty:Boolean(H),variant:"outlined",autoComplete:"off",value:y||"",onChange:g=>{_(g.target.value),L==null||L(g,g.target.value,p.watch())},error:Boolean(n),size:a.size||"medium"},a),{children:[H&&(0,k.jsx)(T.MenuItem,{disabled:!0,value:"",children:(0,k.jsx)("p",{style:{color:Z.grey[400]},children:H})}),t==null?void 0:t.map((g,s)=>(0,k.jsx)(T.MenuItem,{value:g.value,children:g.label},s)),c&&(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(T.Grid,{px:2,py:1,children:(0,k.jsx)(R2.Divider,{})}),c({closeSelect:()=>f(!1)})]})]})),(0,k.jsx)(h,{name:C})]})})},z2=(0,n2.memo)(G3);var O2=require("react"),t2=require("react-hook-form"),z=require("@mui/material");var _2=require("@s_mart/core");var v=require("react/jsx-runtime"),x2=require("react"),I3=M=>{var F=M,{name:C,rules:i,defaultValue:e,shouldUnregister:l,label:r,required:m,options:t,textFieldProps:H,noOptionsText:L,footer:c}=F,a=u(F,["name","rules","defaultValue","shouldUnregister","label","required","options","textFieldProps","noOptionsText","footer"]);let p=(0,t2.useFormContext)();if(!p)throw new Error("Para usar o <Searchable /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let Z=b(p.formState.errors,C);return console.warn=()=>{},(0,v.jsx)(t2.Controller,{control:p.control,name:C,rules:i,defaultValue:e,shouldUnregister:l,render:({field:{onChange:d,value:f}})=>(0,v.jsxs)(z.Grid,{display:"flex",flexDirection:"column",children:[r&&(0,v.jsx)(x,{label:r,required:m}),(0,v.jsx)(z.Autocomplete,V(o({onChange:(n,y)=>d(y),value:f||null,options:t,noOptionsText:L||"Nenhuma op\xE7\xE3o encontrada",isOptionEqualToValue:(n,y)=>typeof n=="string"&&typeof y=="string"?n===y:typeof n=="object"&&typeof y=="object"?n.value===y.value:!1,renderOption:(n,y)=>typeof y=="object"?(0,x2.createElement)("li",V(o({},n),{key:y.key||y.value}),y.label):(0,x2.createElement)("li",V(o({},n),{key:y}),y),ListboxComponent:n=>(0,v.jsxs)("ul",V(o({},n),{children:[n.children,c&&(0,v.jsx)("li",{children:(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)(z.Grid,{px:2,py:1,children:(0,v.jsx)(_2.Divider,{})}),c]})},"searchable-footer")]}))},a),{renderInput:n=>(0,v.jsx)(z.TextField,o(o({error:Boolean(Z)},n),H))})),(0,v.jsx)(h,{name:C})]})})},N2=(0,O2.memo)(I3);var K2=require("react"),s2=require("react-hook-form"),$=require("@mui/material");var I=require("@s_mart/utils"),y2=e2(require("@emotion/styled")),h2=require("@emotion/react"),j2=h2.css`
|
|
2
2
|
display: flex;
|
|
3
3
|
align-items: center;
|
|
4
4
|
justify-content: center;
|
|
5
|
-
|
|
5
|
+
`,$3=C=>h2.css`
|
|
6
6
|
.MuiAutocomplete-endAdornment {
|
|
7
7
|
position: relative;
|
|
8
8
|
right: 0;
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
.creatable {
|
|
12
|
-
${
|
|
12
|
+
${j2}
|
|
13
13
|
|
|
14
14
|
.divider {
|
|
15
15
|
width: 1px;
|
|
16
|
-
height: ${(0,
|
|
16
|
+
height: ${(0,I.toRem)(20)};
|
|
17
17
|
background-color: ${C.palette.grey[400]};
|
|
18
18
|
}
|
|
19
19
|
|
|
@@ -24,9 +24,9 @@
|
|
|
24
24
|
color: ${C.palette.grey[600]};
|
|
25
25
|
border-radius: 50%;
|
|
26
26
|
|
|
27
|
-
margin: 0 ${(0,
|
|
28
|
-
width: ${(0,
|
|
29
|
-
height: ${(0,
|
|
27
|
+
margin: 0 ${(0,I.toRem)(6)};
|
|
28
|
+
width: ${(0,I.toRem)(28)};
|
|
29
|
+
height: ${(0,I.toRem)(28)};
|
|
30
30
|
|
|
31
31
|
&:hover {
|
|
32
32
|
cursor: pointer;
|
|
@@ -35,48 +35,48 @@
|
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
|
-
`,
|
|
38
|
+
`,W2=y2.default.div`
|
|
39
39
|
display: flex;
|
|
40
40
|
|
|
41
41
|
div.endAdornments {
|
|
42
42
|
position: absolute;
|
|
43
43
|
right: 0;
|
|
44
44
|
|
|
45
|
-
${
|
|
45
|
+
${j2}
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
-
${({hideAddButton:C,theme:i})=>!C
|
|
49
|
-
`,
|
|
48
|
+
${({hideAddButton:C,theme:i})=>!C&&$3(i)}
|
|
49
|
+
`,Y2=y2.default.div`
|
|
50
50
|
color: ${({theme:C})=>C.palette.text.primary};
|
|
51
51
|
|
|
52
|
-
padding: ${(0,
|
|
53
|
-
margin: ${(0,
|
|
52
|
+
padding: ${(0,I.toRem)(6)} ${(0,I.toRem)(16)};
|
|
53
|
+
margin: ${(0,I.toRem)(-6)} ${(0,I.toRem)(-16)};
|
|
54
54
|
|
|
55
55
|
&:hover {
|
|
56
56
|
cursor: pointer;
|
|
57
57
|
transition: background-color 0.2s ease-in-out;
|
|
58
58
|
background-color: ${({theme:C})=>C.palette.grey[100]};
|
|
59
59
|
}
|
|
60
|
-
`;var
|
|
60
|
+
`;var Q2=require("@s_mart/core");var w=require("react/jsx-runtime"),F2=require("react"),q3=F=>{var p=F,{name:C,rules:i,defaultValue:e,shouldUnregister:l,label:r,required:m,options:t,onCreateOption:H,textFieldProps:L,hideAddButton:c,onInputChange:a}=p,M=u(p,["name","rules","defaultValue","shouldUnregister","label","required","options","onCreateOption","textFieldProps","hideAddButton","onInputChange"]);let Z=(0,s2.useFormContext)();if(!Z)throw new Error("Para usar o <Creatable /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let d=b(Z.formState.errors,C);console.warn=()=>{};let f=n=>{H?H(n):console.error("onCreateOption n\xE3o foi definido")};return(0,w.jsx)(s2.Controller,{control:Z.control,name:C,rules:i,defaultValue:e,shouldUnregister:l,render:({field:{value:n,onChange:y}})=>{let _=(n==null?void 0:n.label)||(n==null?void 0:n.value)||n;return(0,w.jsxs)($.Grid,{display:"flex",flexDirection:"column",children:[r&&(0,w.jsx)(x,{label:r,required:m}),(0,w.jsx)(W2,{hideAddButton:c,children:(0,w.jsx)($.Autocomplete,V(o({fullWidth:!0,onChange:(g,s)=>(a==null||a(s,Z.watch()),y(s)),onInputChange:a,options:t,value:n||null,noOptionsText:(0,w.jsx)(Y2,{onClick:()=>f(n),children:(0,w.jsxs)($.Typography,{children:["Adicionar ",_&&`"${_}"`]})}),isOptionEqualToValue:(g,s)=>s?typeof g=="string"&&typeof s=="string"?g===s:typeof g=="object"&&typeof s=="object"?g.value===s.value:typeof g=="object"&&typeof s=="string":!1,renderOption:(g,s)=>typeof s=="object"?(0,F2.createElement)("li",V(o({},g),{key:s.key||s.value}),s.label):(0,F2.createElement)("li",V(o({},g),{key:s}),s)},M),{renderInput:g=>{let s=c?g.InputProps:V(o({},g.InputProps),{endAdornment:(0,w.jsxs)("div",{className:"endAdornments",children:[g.InputProps.endAdornment,(0,w.jsxs)("div",{className:"creatable",children:[(0,w.jsx)("div",{className:"divider"}),(0,w.jsx)("div",{className:"button",onClick:()=>f(n),children:(0,w.jsx)(Q2.LIcon,{icon:E2,size:"24px",removeMargin:!0})})]})]})});return(0,w.jsx)($.TextField,o(V(o({},g),{error:Boolean(d),onChange:y,InputProps:s}),L))}}))}),(0,w.jsx)(h,{name:C})]})}})},J2=(0,K2.memo)(q3);var V2=require("react-hook-form"),W=require("@mui/material");var q=require("react/jsx-runtime"),U3=L=>{var c=L,{name:C,rules:i,defaultValue:e,shouldUnregister:l,label:r,labelPlacement:m,required:t}=c,H=u(c,["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,q.jsx)(V2.Controller,{control:a.control,name:C,rules:i,defaultValue:e,shouldUnregister:l,render:({field:{value:M,onChange:F}})=>(0,q.jsxs)(W.Grid,{display:"flex",flexDirection:"column",children:[(0,q.jsx)(W.FormControlLabel,{control:(0,q.jsx)(W.Checkbox,o({value:M!=null?M:"",defaultValue:M,onChange:F},H)),label:(0,q.jsx)(x,{label:r,required:t,regular:!0}),labelPlacement:m||"end"}),(0,q.jsx)(h,{name:C})]})})},X2=U3;var d2=require("react-hook-form"),Y=require("@mui/material");var U=require("react/jsx-runtime"),R3=H=>{var L=H,{name:C,rules:i,defaultValue:e,shouldUnregister:l,label:r,labelPlacement:m}=L,t=u(L,["name","rules","defaultValue","shouldUnregister","label","labelPlacement"]);let c=(0,d2.useFormContext)();if(!c)throw new Error("Para usar o <Switch /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");return(0,U.jsx)(d2.Controller,{control:c.control,name:C,rules:i,defaultValue:e,shouldUnregister:l,render:({field:{value:a,onChange:M}})=>(0,U.jsxs)(Y.Grid,{display:"flex",flexDirection:"column",children:[(0,U.jsx)(Y.FormControlLabel,{control:(0,U.jsx)(Y.Switch,o({value:a!=null?a:"",defaultValue:a,onChange:M},t)),label:(0,U.jsx)(x,{label:r}),labelPlacement:m||"end"}),(0,U.jsx)(h,{name:C})]})})},C3=R3;var K=require("@mui/material");var C2=require("react/jsx-runtime"),z3=l=>{var r=l,{label:C,labelPlacement:i}=r,e=u(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)(x,{label:C}),labelPlacement:i||"end"})})},i3=z3;var L2=require("react-hook-form"),a2=require("@mui/material");var O=require("react/jsx-runtime"),O3=c=>{var a=c,{name:C,rules:i,defaultValue:e,shouldUnregister:l,label:r,required:m,children:t,orientation:H="row"}=a,L=u(a,["name","rules","defaultValue","shouldUnregister","label","required","children","orientation"]);let M=(0,L2.useFormContext)();if(!M)throw new Error("Para usar o <RadioGroup /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");return(0,O.jsx)(L2.Controller,{control:M.control,name:C,rules:i,defaultValue:e,shouldUnregister:l,render:({field:{value:F,onChange:p}})=>(0,O.jsxs)(a2.Grid,{display:"flex",flexDirection:"column",children:[r&&(0,O.jsx)(x,{label:r,required:m}),(0,O.jsx)(a2.RadioGroup,V(o({value:F||"",onChange:p,name:C},L),{style:{display:"flex",flexDirection:H},children:t})),(0,O.jsx)(h,{name:C})]})})},e3=O3;var M2=require("react-hook-form"),o3=require("@mui/material");var P2=require("react/jsx-runtime"),_3=m=>{var t=m,{name:C,rules:i,defaultValue:e,shouldUnregister:l}=t,r=u(t,["name","rules","defaultValue","shouldUnregister"]);let H=(0,M2.useFormContext)();if(!H)throw new Error("Para usar o <Slider /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");return(0,P2.jsx)(M2.Controller,{control:H.control,name:C,rules:i,defaultValue:e,shouldUnregister:l,render:({field:{value:L,onChange:c}})=>(0,P2.jsx)(o3.Slider,o({value:L||(r==null?void 0:r.min)||0,onChange:c,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 B=require("@s_mart/utils"),l3=e2(require("@emotion/styled")),N3=C=>{switch(C){case"small":return(0,B.toRem)(16);default:case"medium":return(0,B.toRem)(20);case"large":return(0,B.toRem)(24)}},j3=C=>{switch(C){case"small":return`${(0,B.toRem)(2)} ${(0,B.toRem)(8)}`;default:case"medium":return`${(0,B.toRem)(6)} ${(0,B.toRem)(8)}`;case"large":return`${(0,B.toRem)(10)}`}},n3=l3.default.div`
|
|
61
61
|
> div > button {
|
|
62
|
-
padding: ${({size:C})=>
|
|
63
|
-
border-radius: 0 ${(0,
|
|
62
|
+
padding: ${({size:C})=>j3(C)};
|
|
63
|
+
border-radius: 0 ${(0,B.toRem)(4)} ${(0,B.toRem)(4)} 0;
|
|
64
64
|
|
|
65
65
|
margin: 0px -13px 0px 0px;
|
|
66
66
|
|
|
67
67
|
svg {
|
|
68
|
-
width: ${({size:C})=>
|
|
68
|
+
width: ${({size:C})=>N3(C)};
|
|
69
69
|
}
|
|
70
70
|
}
|
|
71
|
-
`;var
|
|
71
|
+
`;var E=require("react/jsx-runtime"),W3=c=>{var a=c,{rules:C,name:i,defaultValue:e,shouldUnregister:l,datePickerProps:r,label:m,required:t,placeholder:H}=a,L=u(a,["rules","name","defaultValue","shouldUnregister","datePickerProps","label","required","placeholder"]);let M=(0,Z2.useFormContext)();if(!M)throw new Error("Para usar o <DataPicker /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let F=b(M.formState.errors,i);return(0,E.jsx)(L3.LocalizationProvider,{dateAdapter:d3.AdapterDayjs,children:(0,E.jsx)(Z2.Controller,{control:M.control,name:i,rules:C,defaultValue:e,shouldUnregister:l,render:({field:{value:p,onChange:Z}})=>(0,E.jsxs)(t3.Grid,{display:"flex",flexDirection:"column",children:[m&&(0,E.jsx)(x,{label:m,required:t}),(0,E.jsx)(V3.DatePicker,V(o({},r),{value:p!=null?p:null,inputFormat:(r==null?void 0:r.inputFormat)||"DD/MM/YYYY",onChange:Z,renderInput:d=>{var f,n;return(0,E.jsx)(s3.TextField,V(o(V(o({variant:"outlined"},d),{error:Boolean(F)}),L),{inputProps:V(o({},d.inputProps),{placeholder:H||((f=d.inputProps)==null?void 0:f.placeholder)}),InputProps:V(o({},d.InputProps),{endAdornment:(0,E.jsx)(n3,{size:L.size,children:(n=d.InputProps)==null?void 0:n.endAdornment})})}))}})),(0,E.jsx)(h,{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 A=require("@s_mart/utils"),M3=e2(require("@emotion/styled")),Y3=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)}},K3=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)}`}},Z3=M3.default.div`
|
|
72
72
|
> div > button {
|
|
73
|
-
padding: ${({size:C})=>
|
|
74
|
-
border-radius: 0 ${(0,
|
|
73
|
+
padding: ${({size:C})=>K3(C)};
|
|
74
|
+
border-radius: 0 ${(0,A.toRem)(4)} ${(0,A.toRem)(4)} 0;
|
|
75
75
|
|
|
76
76
|
margin: 0px -13px 0px 0px;
|
|
77
77
|
|
|
78
78
|
svg {
|
|
79
|
-
width: ${({size:C})=>
|
|
79
|
+
width: ${({size:C})=>Y3(C)};
|
|
80
80
|
}
|
|
81
81
|
}
|
|
82
|
-
`;var
|
|
82
|
+
`;var g3=require("react");var D=require("react/jsx-runtime"),Q3=c=>{var a=c,{rules:C,defaultValue:i,shouldUnregister:e,name:l,required:r,label:m,timePickerProps:t,placeholder:H}=a,L=u(a,["rules","defaultValue","shouldUnregister","name","required","label","timePickerProps","placeholder"]);let M=(0,c2.useFormContext)();if(!M)throw new Error("Para usar o <TimePicker /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let F=b(M.formState.errors,l);return(0,D.jsx)(f3.LocalizationProvider,{dateAdapter:u3.AdapterDayjs,children:(0,D.jsx)(c2.Controller,{control:M.control,name:l,rules:C,defaultValue:i,shouldUnregister:e,render:({field:{value:p,onChange:Z}})=>(0,D.jsxs)(c3.Grid,{display:"flex",flexDirection:"column",children:[m&&(0,D.jsx)(x,{label:m,required:r}),(0,D.jsx)(p3.TimePicker,V(o({value:p!=null?p:null,onChange:Z},t),{renderInput:d=>{var f,n;return(0,D.jsx)(m3.TextField,V(o(V(o({variant:"outlined"},d),{error:Boolean(F)}),L),{inputProps:V(o({},d.inputProps),{placeholder:H||((f=d.inputProps)==null?void 0:f.placeholder)}),InputProps:V(o({},d.InputProps),{endAdornment:(0,D.jsx)(Z3,{size:L.size,children:(n=d.InputProps)==null?void 0:n.endAdornment})})}))}})),(0,D.jsx)(h,{name:l})]})})})},x3=(0,g3.memo)(Q3);var y3=require("react"),p2=require("react-hook-form"),m2=require("@mui/material"),h3=require("@s_mart/core");var R=require("react/jsx-runtime"),P3=require("react"),J3=c=>{var a=c,{name:C,defaultValue:i,rules:e,shouldUnregister:l,label:r,required:m,onInputChange:t,onChange:H}=a,L=u(a,["name","defaultValue","rules","shouldUnregister","label","required","onInputChange","onChange"]);let M=(0,p2.useFormContext)();if(!M)throw new Error("Para usar o <Autocomplete /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let F=b(M.formState.errors,C);return console.warn=()=>{},(0,R.jsx)(p2.Controller,{name:C,control:M.control,defaultValue:i,rules:e,shouldUnregister:l,render:({field:p})=>(0,R.jsxs)(h3.Grid,{display:"flex",flexDirection:"column",children:[r&&(0,R.jsx)(x,{label:r,required:m}),(0,R.jsx)(m2.Autocomplete,V(o({onChange:(Z,d)=>{p.onChange(d),H==null||H(Z,d,M.watch())},onInputChange:(Z,d,f)=>{p.onChange(d),setTimeout(()=>{t==null||t(Z,M.watch(C),f,M.watch())},0)},isOptionEqualToValue:(Z,d)=>Z.value===d.value,renderOption:(Z,d)=>(0,P3.createElement)("li",V(o({},Z),{key:d.key||d.value,onClick:f=>{var n;(n=Z.onClick)==null||n.call(Z,f),p.onChange(d)}}),d.label),value:p.value||null},L),{renderInput:Z=>{var d,f,n;return(0,R.jsx)(m2.TextField,V(o(o({},Z),L.textFieldProps),{error:Boolean(F),InputProps:V(o(o({},Z.InputProps),(d=L.textFieldProps)==null?void 0:d.InputProps),{inputProps:o(o({},Z.inputProps),(n=(f=L.textFieldProps)==null?void 0:f.InputProps)==null?void 0:n.inputProps)})}))}})),(0,R.jsx)(h,{name:C})]})})},F3=(0,y3.memo)(J3);0&&(module.exports={Autocomplete,Checkbox,Creatable,DatePicker,Form,RadioButton,RadioGroup,Searchable,Select,Slider,Switch,TextField,TimePicker});
|
package/dist/index.mjs
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
var p2=Object.defineProperty,m2=Object.defineProperties;var u2=Object.getOwnPropertyDescriptors;var O=Object.getOwnPropertySymbols;var Q=Object.prototype.hasOwnProperty,J=Object.prototype.propertyIsEnumerable;var K=(C,i,o)=>i in C?p2(C,i,{enumerable:!0,configurable:!0,writable:!0,value:o}):C[i]=o,e=(C,i)=>{for(var o in i||(i={}))Q.call(i,o)&&K(C,o,i[o]);if(O)for(var o of O(i))J.call(i,o)&&K(C,o,i[o]);return C},L=(C,i)=>m2(C,u2(i));var f=(C,i)=>{var o={};for(var l in C)Q.call(C,l)&&i.indexOf(l)<0&&(o[l]=C[l]);if(C!=null&&O)for(var l of O(C))i.indexOf(l)<0&&J.call(C,l)&&(o[l]=C[l]);return o};import{useEffect as f2}from"react";import{FormProvider as g2,useForm as x2}from"react-hook-form";import{jsx as X}from"react/jsx-runtime";function y2(u){var t=u,{children:C,onSubmit:i,style:o,disableDefaultValuesUpdate:l}=t,r=f(t,["children","onSubmit","style","disableDefaultValuesUpdate"]);let H=x2(r);f2(()=>{l||H.reset(r.defaultValues)},[r.defaultValues,H.reset]);let a=()=>typeof C=="function"?C(L(e({},H),{onSubmit:H.handleSubmit(p=>i(p,H))})):C;return X(g2,L(e({},H),{children:X("form",{onSubmit:p=>{p.preventDefault(),p.stopPropagation(),H.handleSubmit(M=>i(M,H))()},style:o,children:a()})}))}var h2=y2;import{memo as v2,useState as S2}from"react";import{Controller as B2,useFormContext as A2}from"react-hook-form";import{Grid as T2,InputAdornment as E2,TextField as D2}from"@mui/material";var C2={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"},i2={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"};import*as G from"@s_mart/masks";import{Typography as o2}from"@mui/material";import{toRem as F2}from"@s_mart/utils";import{jsx as r2,jsxs as P2}from"react/jsx-runtime";var x=({label:C,required:i,regular:o})=>P2("span",{style:{display:"flex",alignItems:"center",gap:F2(2)},children:[r2(o2,{variant:"caption",fontWeight:o?400:700,style:{display:"flex",alignItems:"center"},children:C}),i&&r2(o2,{variant:"caption",fontWeight:900,color:"error",children:"*"})]});import{useFormContext as b2}from"react-hook-form";import{Indicator as w2}from"@s_mart/core";var P=(C,i)=>{var o,l,r,u;if(C[i])return C[i];if(i.includes("[")){let[t,H]=i.split("["),[a,p]=H.split("].");return(l=(o=C[t])==null?void 0:o[a])==null?void 0:l[p]}if(i.includes(".")){let[t,H,a]=i.split(".");return(u=(r=C[t])==null?void 0:r[H])==null?void 0:u[a]}};import{jsx as k2}from"react/jsx-runtime";var y=({name:C})=>{var l;let i=b2(),o=P((l=i==null?void 0:i.formState)==null?void 0:l.errors,C);return o?k2(w2,{severity:"error",children:o==null?void 0:o.message}):null};import{LIcon as G2}from"@s_mart/core";import{jsx as I,jsxs as q2}from"react/jsx-runtime";var I2=h=>{var m=h,{name:C,rules:i,defaultValue:o,shouldUnregister:l,label:r,required:u,mask:t,variant:H="outlined",parse:a,format:p,onInputChange:M}=m,V=f(m,["name","rules","defaultValue","shouldUnregister","label","required","mask","variant","parse","format","onInputChange"]);let Z=A2();if(!Z)throw new Error("Para usar o <TextField /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let[d,c]=S2(!1),n=s=>{var F;let b=s;return p&&(b=p(s)),t?(F=G==null?void 0:G[t])==null?void 0:F.format(b):b},E=s=>{var F;let b=s;return a&&(b=a(s)),t?(F=G==null?void 0:G[t])==null?void 0:F.parse(b):b},D=s=>{if(!s||t!=="porcentagem")return;s==null||s.stopPropagation();let b=(s==null?void 0:s.target).value;if(b){let F=String(b);if(F.length>0){let $=F.indexOf("%");$>-1&&(s.currentTarget.selectionEnd=$)}}},g=P(Z.formState.errors,C);return I(B2,{control:Z.control,name:C,rules:i,defaultValue:o,shouldUnregister:l,render:({field:{value:s,onChange:b}})=>q2(T2,{display:"flex",flexDirection:"column",children:[r&&I(x,{label:r,required:u}),I(D2,L(e({variant:H,autoComplete:"off",defaultValue:o,value:n(s||""),onChange:F=>{var $,Y;b(E(($=F==null?void 0:F.target)==null?void 0:$.value)),M==null||M(F,(Y=F==null?void 0:F.target)==null?void 0:Y.value,Z.watch())},error:Boolean(g)},V),{type:V.type==="password"?d?"text":"password":V.type,InputProps:e({onKeyDown:D,endAdornment:V.type==="password"&&I(E2,{position:"end",onClick:()=>c(!d),style:{cursor:"pointer"},children:I(G2,{icon:d?C2:i2,size:"24px",removeMargin:!0})})},V.InputProps)})),I(y,{name:C})]})})},$2=v2(I2);import{memo as U2,useState as R2}from"react";import{Controller as z2,useFormContext as O2}from"react-hook-form";import{Divider as _2}from"@s_mart/core";import{Grid as l2,Select as N2,MenuItem as n2,useTheme as j2}from"@mui/material";import{Fragment as K2,jsx as S,jsxs as W}from"react/jsx-runtime";var W2=V=>{var h=V,{name:C,rules:i,defaultValue:o,shouldUnregister:l,label:r,required:u,options:t,placeholder:H,onInputChange:a,footer:p}=h,M=f(h,["name","rules","defaultValue","shouldUnregister","label","required","options","placeholder","onInputChange","footer"]);let m=O2(),{palette:Z}=j2(),[d,c]=R2(!1);if(!m)throw new Error("Para usar o <Select /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let n=P(m.formState.errors,C);return console.warn=()=>{},S(z2,{control:m.control,name:C,rules:i,defaultValue:o||"",shouldUnregister:l,render:({field:{value:E,onChange:D}})=>W(l2,{display:"flex",flexDirection:"column",children:[r&&S(x,{label:r,required:u}),W(N2,L(e({open:d,onOpen:()=>c(!0),onClose:()=>c(!1),displayEmpty:Boolean(H),variant:"outlined",autoComplete:"off",value:E||"",onChange:g=>{D(g.target.value),a==null||a(g,g.target.value,m.watch())},error:Boolean(n),size:M.size||"medium"},M),{children:[H&&S(n2,{disabled:!0,value:"",children:S("p",{style:{color:Z.grey[400]},children:H})}),t==null?void 0:t.map((g,s)=>S(n2,{value:g.value,children:g.label},s)),p&&W(K2,{children:[S(l2,{px:2,py:1,children:S(_2,{})}),p({closeSelect:()=>c(!1)})]})]})),S(y,{name:C})]})})},Y2=U2(W2);import{memo as Q2}from"react";import{Controller as J2,useFormContext as X2}from"react-hook-form";import{Grid as C3,Autocomplete as i3,TextField as e3}from"@mui/material";import{jsx as q,jsxs as l3}from"react/jsx-runtime";import{createElement as H2}from"react";var o3=M=>{var V=M,{name:C,rules:i,defaultValue:o,shouldUnregister:l,label:r,required:u,options:t,textFieldProps:H,noOptionsText:a}=V,p=f(V,["name","rules","defaultValue","shouldUnregister","label","required","options","textFieldProps","noOptionsText"]);let h=X2();if(!h)throw new Error("Para usar o <Searchable /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let m=P(h.formState.errors,C);return console.warn=()=>{},q(J2,{control:h.control,name:C,rules:i,defaultValue:o,shouldUnregister:l,render:({field:{onChange:Z,value:d}})=>l3(C3,{display:"flex",flexDirection:"column",children:[r&&q(x,{label:r,required:u}),q(i3,L(e({onChange:(c,n)=>Z(n),value:d||null,options:t,noOptionsText:a||"Nenhuma op\xE7\xE3o encontrada",isOptionEqualToValue:(c,n)=>typeof c=="string"&&typeof n=="string"?c===n:typeof c=="object"&&typeof n=="object"?c.value===n.value:!1,renderOption:(c,n)=>typeof n=="object"?H2("li",L(e({},c),{key:n.key||n.value}),n.label):H2("li",L(e({},c),{key:n}),n)},p),{renderInput:c=>q(e3,e(e({error:Boolean(m)},c),H))})),q(y,{name:C})]})})},r3=Q2(o3);import{memo as H3}from"react";import{Controller as t3,useFormContext as s3}from"react-hook-form";import{Grid as V3,Autocomplete as d3,TextField as L3,Typography as a3}from"@mui/material";import{toRem as B}from"@s_mart/utils";import t2 from"@emotion/styled";import{css as s2}from"@emotion/react";var V2=s2`
|
|
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},V=(C,i)=>f2(C,g2(i));var u=(C,i)=>{var o={};for(var l in C)J.call(C,l)&&i.indexOf(l)<0&&(o[l]=C[l]);if(C!=null&&O)for(var l of O(C))i.indexOf(l)<0&&X.call(C,l)&&(o[l]=C[l]);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 t=m,{children:C,onSubmit:i,style:o,disableDefaultValuesUpdate:l}=t,r=u(t,["children","onSubmit","style","disableDefaultValuesUpdate"]);let H=h2(r);x2(()=>{l||H.reset(r.defaultValues)},[r.defaultValues,H.reset]);let L=()=>typeof C=="function"?C(V(e({},H),{onSubmit:H.handleSubmit(c=>i(c,H))})):C;return C2(y2,V(e({},H),{children:C2("form",{onSubmit:c=>{c.preventDefault(),c.stopPropagation(),H.handleSubmit(a=>i(a,H))()},style:o,children:L()})}))}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 G2,TextField as I2}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 I from"@s_mart/masks";import{Typography as r2}from"@mui/material";import{toRem as b2}from"@s_mart/utils";import{jsx as l2,jsxs as w2}from"react/jsx-runtime";var x=({label:C,required:i,regular:o})=>w2("span",{style:{display:"flex",alignItems:"center",gap:b2(2)},children:[l2(r2,{variant:"caption",fontWeight:o?400:700,style:{display:"flex",alignItems:"center"},children:C}),i&&l2(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 b=(C,i)=>{var o,l,r,m;if(C[i])return C[i];if(i.includes("[")){let[t,H]=i.split("["),[L,c]=H.split("].");return(l=(o=C[t])==null?void 0:o[L])==null?void 0:l[c]}if(i.includes(".")){let[t,H,L]=i.split(".");return(m=(r=C[t])==null?void 0:r[H])==null?void 0:m[L]}};import{jsx as S2}from"react/jsx-runtime";var h=({name:C})=>{var l;let i=k2(),o=b((l=i==null?void 0:i.formState)==null?void 0:l.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=F=>{var p=F,{name:C,rules:i,defaultValue:o,shouldUnregister:l,label:r,required:m,mask:t,variant:H="outlined",parse:L,format:c,onInputChange:a}=p,M=u(p,["name","rules","defaultValue","shouldUnregister","label","required","mask","variant","parse","format","onInputChange"]);let Z=E2();if(!Z)throw new Error("Para usar o <TextField /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let[d,f]=A2(!1),n=s=>{var P;let w=s;return c&&(w=c(s)),t?(P=I==null?void 0:I[t])==null?void 0:P.format(w):w},y=s=>{var P;let w=s;return L&&(w=L(s)),t?(P=I==null?void 0:I[t])==null?void 0:P.parse(w):w},G=s=>{if(!s||t!=="porcentagem")return;s==null||s.stopPropagation();let w=(s==null?void 0:s.target).value;if(w){let P=String(w);if(P.length>0){let q=P.indexOf("%");q>-1&&(s.currentTarget.selectionEnd=q)}}},g=b(Z.formState.errors,C);return $(T2,{control:Z.control,name:C,rules:i,defaultValue:o,shouldUnregister:l,render:({field:{value:s,onChange:w}})=>R2(D2,{display:"flex",flexDirection:"column",children:[r&&$(x,{label:r,required:m}),$(I2,V(e({variant:H,autoComplete:"off",defaultValue:o,value:n(s||""),onChange:P=>{var q,K;w(y((q=P==null?void 0:P.target)==null?void 0:q.value)),a==null||a(P,(K=P==null?void 0:P.target)==null?void 0:K.value,Z.watch())},error:Boolean(g)},M),{type:M.type==="password"?d?"text":"password":M.type,InputProps:e({onKeyDown:G,endAdornment:M.type==="password"&&$(G2,{position:"end",onClick:()=>f(!d),style:{cursor:"pointer"},children:$($2,{icon:d?i2:e2,size:"24px",removeMargin:!0})})},M.InputProps)})),$(h,{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 n2,Select as W2,MenuItem as H2,useTheme as Y2}from"@mui/material";import{Fragment as J2,jsx as B,jsxs as W}from"react/jsx-runtime";var K2=M=>{var F=M,{name:C,rules:i,defaultValue:o,shouldUnregister:l,label:r,required:m,options:t,placeholder:H,onInputChange:L,footer:c}=F,a=u(F,["name","rules","defaultValue","shouldUnregister","label","required","options","placeholder","onInputChange","footer"]);let p=N2(),{palette:Z}=Y2(),[d,f]=O2(!1);if(!p)throw new Error("Para usar o <Select /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let n=b(p.formState.errors,C);return console.warn=()=>{},B(_2,{control:p.control,name:C,rules:i,defaultValue:o||"",shouldUnregister:l,render:({field:{value:y,onChange:G}})=>W(n2,{display:"flex",flexDirection:"column",children:[r&&B(x,{label:r,required:m}),W(W2,V(e({open:d,onOpen:()=>f(!0),onClose:()=>f(!1),displayEmpty:Boolean(H),variant:"outlined",autoComplete:"off",value:y||"",onChange:g=>{G(g.target.value),L==null||L(g,g.target.value,p.watch())},error:Boolean(n),size:a.size||"medium"},a),{children:[H&&B(H2,{disabled:!0,value:"",children:B("p",{style:{color:Z.grey[400]},children:H})}),t==null?void 0:t.map((g,s)=>B(H2,{value:g.value,children:g.label},s)),c&&W(J2,{children:[B(n2,{px:2,py:1,children:B(j2,{})}),c({closeSelect:()=>f(!1)})]})]})),B(h,{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 A,jsxs as Y}from"react/jsx-runtime";import{createElement as s2}from"react";var l3=M=>{var F=M,{name:C,rules:i,defaultValue:o,shouldUnregister:l,label:r,required:m,options:t,textFieldProps:H,noOptionsText:L,footer:c}=F,a=u(F,["name","rules","defaultValue","shouldUnregister","label","required","options","textFieldProps","noOptionsText","footer"]);let p=i3();if(!p)throw new Error("Para usar o <Searchable /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let Z=b(p.formState.errors,C);return console.warn=()=>{},A(C3,{control:p.control,name:C,rules:i,defaultValue:o,shouldUnregister:l,render:({field:{onChange:d,value:f}})=>Y(t2,{display:"flex",flexDirection:"column",children:[r&&A(x,{label:r,required:m}),A(e3,V(e({onChange:(n,y)=>d(y),value:f||null,options:t,noOptionsText:L||"Nenhuma op\xE7\xE3o encontrada",isOptionEqualToValue:(n,y)=>typeof n=="string"&&typeof y=="string"?n===y:typeof n=="object"&&typeof y=="object"?n.value===y.value:!1,renderOption:(n,y)=>typeof y=="object"?s2("li",V(e({},n),{key:y.key||y.value}),y.label):s2("li",V(e({},n),{key:y}),y),ListboxComponent:n=>Y("ul",V(e({},n),{children:[n.children,c&&A("li",{children:Y(H3,{children:[A(t2,{px:2,py:1,children:A(r3,{})}),c]})},"searchable-footer")]}))},a),{renderInput:n=>A(o3,e(e({error:Boolean(Z)},n),H))})),A(h,{name:C})]})})},n3=X2(l3);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 T}from"@s_mart/utils";import V2 from"@emotion/styled";import{css as d2}from"@emotion/react";var L2=d2`
|
|
2
2
|
display: flex;
|
|
3
3
|
align-items: center;
|
|
4
4
|
justify-content: center;
|
|
5
|
-
`,
|
|
5
|
+
`,t3=C=>d2`
|
|
6
6
|
.MuiAutocomplete-endAdornment {
|
|
7
7
|
position: relative;
|
|
8
8
|
right: 0;
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
.creatable {
|
|
12
|
-
${
|
|
12
|
+
${L2}
|
|
13
13
|
|
|
14
14
|
.divider {
|
|
15
15
|
width: 1px;
|
|
16
|
-
height: ${
|
|
16
|
+
height: ${T(20)};
|
|
17
17
|
background-color: ${C.palette.grey[400]};
|
|
18
18
|
}
|
|
19
19
|
|
|
@@ -24,9 +24,9 @@ var p2=Object.defineProperty,m2=Object.defineProperties;var u2=Object.getOwnProp
|
|
|
24
24
|
color: ${C.palette.grey[600]};
|
|
25
25
|
border-radius: 50%;
|
|
26
26
|
|
|
27
|
-
margin: 0 ${
|
|
28
|
-
width: ${
|
|
29
|
-
height: ${
|
|
27
|
+
margin: 0 ${T(6)};
|
|
28
|
+
width: ${T(28)};
|
|
29
|
+
height: ${T(28)};
|
|
30
30
|
|
|
31
31
|
&:hover {
|
|
32
32
|
cursor: pointer;
|
|
@@ -35,48 +35,48 @@ var p2=Object.defineProperty,m2=Object.defineProperties;var u2=Object.getOwnProp
|
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
|
-
`,
|
|
38
|
+
`,a2=V2.div`
|
|
39
39
|
display: flex;
|
|
40
40
|
|
|
41
41
|
div.endAdornments {
|
|
42
42
|
position: absolute;
|
|
43
43
|
right: 0;
|
|
44
44
|
|
|
45
|
-
${
|
|
45
|
+
${L2}
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
-
${({hideAddButton:C,theme:i})=>!C&&
|
|
49
|
-
`,
|
|
48
|
+
${({hideAddButton:C,theme:i})=>!C&&t3(i)}
|
|
49
|
+
`,M2=V2.div`
|
|
50
50
|
color: ${({theme:C})=>C.palette.text.primary};
|
|
51
51
|
|
|
52
|
-
padding: ${
|
|
53
|
-
margin: ${
|
|
52
|
+
padding: ${T(6)} ${T(16)};
|
|
53
|
+
margin: ${T(-6)} ${T(-16)};
|
|
54
54
|
|
|
55
55
|
&:hover {
|
|
56
56
|
cursor: pointer;
|
|
57
57
|
transition: background-color 0.2s ease-in-out;
|
|
58
58
|
background-color: ${({theme:C})=>C.palette.grey[100]};
|
|
59
59
|
}
|
|
60
|
-
`;import{LIcon as
|
|
60
|
+
`;import{LIcon as c3}from"@s_mart/core";import{jsx as k,jsxs as _}from"react/jsx-runtime";import{createElement as Z2}from"react";var p3=F=>{var p=F,{name:C,rules:i,defaultValue:o,shouldUnregister:l,label:r,required:m,options:t,onCreateOption:H,textFieldProps:L,hideAddButton:c,onInputChange:a}=p,M=u(p,["name","rules","defaultValue","shouldUnregister","label","required","options","onCreateOption","textFieldProps","hideAddButton","onInputChange"]);let Z=d3();if(!Z)throw new Error("Para usar o <Creatable /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let d=b(Z.formState.errors,C);console.warn=()=>{};let f=n=>{H?H(n):console.error("onCreateOption n\xE3o foi definido")};return k(V3,{control:Z.control,name:C,rules:i,defaultValue:o,shouldUnregister:l,render:({field:{value:n,onChange:y}})=>{let G=(n==null?void 0:n.label)||(n==null?void 0:n.value)||n;return _(L3,{display:"flex",flexDirection:"column",children:[r&&k(x,{label:r,required:m}),k(a2,{hideAddButton:c,children:k(a3,V(e({fullWidth:!0,onChange:(g,s)=>(a==null||a(s,Z.watch()),y(s)),onInputChange:a,options:t,value:n||null,noOptionsText:k(M2,{onClick:()=>f(n),children:_(Z3,{children:["Adicionar ",G&&`"${G}"`]})}),isOptionEqualToValue:(g,s)=>s?typeof g=="string"&&typeof s=="string"?g===s:typeof g=="object"&&typeof s=="object"?g.value===s.value:typeof g=="object"&&typeof s=="string":!1,renderOption:(g,s)=>typeof s=="object"?Z2("li",V(e({},g),{key:s.key||s.value}),s.label):Z2("li",V(e({},g),{key:s}),s)},M),{renderInput:g=>{let s=c?g.InputProps:V(e({},g.InputProps),{endAdornment:_("div",{className:"endAdornments",children:[g.InputProps.endAdornment,_("div",{className:"creatable",children:[k("div",{className:"divider"}),k("div",{className:"button",onClick:()=>f(n),children:k(c3,{icon:o2,size:"24px",removeMargin:!0})})]})]})});return k(M3,e(V(e({},g),{error:Boolean(d),onChange:y,InputProps:s}),L))}}))}),k(h,{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=L=>{var c=L,{name:C,rules:i,defaultValue:o,shouldUnregister:l,label:r,labelPlacement:m,required:t}=c,H=u(c,["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:l,render:({field:{value:M,onChange:F}})=>P3(g3,{display:"flex",flexDirection:"column",children:[U(y3,{control:U(x3,e({value:M!=null?M:"",defaultValue:M,onChange:F},H)),label:U(x,{label:r,required:t,regular:!0}),labelPlacement:m||"end"}),U(h,{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=H=>{var L=H,{name:C,rules:i,defaultValue:o,shouldUnregister:l,label:r,labelPlacement:m}=L,t=u(L,["name","rules","defaultValue","shouldUnregister","label","labelPlacement"]);let c=w3();if(!c)throw new Error("Para usar o <Switch /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");return R(b3,{control:c.control,name:C,rules:i,defaultValue:o,shouldUnregister:l,render:({field:{value:a,onChange:M}})=>T3(k3,{display:"flex",flexDirection:"column",children:[R(S3,{control:R(v3,e({value:a!=null?a:"",defaultValue:a,onChange:M},t)),label:R(x,{label:r}),labelPlacement:m||"end"}),R(h,{name:C})]})})},A3=B3;import{Grid as E3,Radio as D3,FormControlLabel as G3}from"@mui/material";import{jsx as N}from"react/jsx-runtime";var I3=l=>{var r=l,{label:C,labelPlacement:i}=r,o=u(r,["label","labelPlacement"]);return N(E3,{display:"flex",flexDirection:"column",children:N(G3,{control:N(D3,e({},o)),label:N(x,{label:C}),labelPlacement:i||"end"})})},$3=I3;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=c=>{var a=c,{name:C,rules:i,defaultValue:o,shouldUnregister:l,label:r,required:m,children:t,orientation:H="row"}=a,L=u(a,["name","rules","defaultValue","shouldUnregister","label","required","children","orientation"]);let M=U3();if(!M)throw new Error("Para usar o <RadioGroup /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");return j(q3,{control:M.control,name:C,rules:i,defaultValue:o,shouldUnregister:l,render:({field:{value:F,onChange:p}})=>N3(R3,{display:"flex",flexDirection:"column",children:[r&&j(x,{label:r,required:m}),j(z3,V(e({value:F||"",onChange:p,name:C},L),{style:{display:"flex",flexDirection:H},children:t})),j(h,{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 t=m,{name:C,rules:i,defaultValue:o,shouldUnregister:l}=t,r=u(t,["name","rules","defaultValue","shouldUnregister"]);let H=W3();if(!H)throw new Error("Para usar o <Slider /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");return c2(j3,{control:H.control,name:C,rules:i,defaultValue:o,shouldUnregister:l,render:({field:{value:L,onChange:c}})=>c2(Y3,e({value:L||(r==null?void 0:r.min)||0,onChange:c,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 l1}from"@mui/material";import{DatePicker as n1}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 v}from"@s_mart/utils";import J3 from"@emotion/styled";var X3=C=>{switch(C){case"small":return v(16);default:case"medium":return v(20);case"large":return v(24)}},C1=C=>{switch(C){case"small":return`${v(2)} ${v(8)}`;default:case"medium":return`${v(6)} ${v(8)}`;case"large":return`${v(10)}`}},p2=J3.div`
|
|
61
61
|
> div > button {
|
|
62
|
-
padding: ${({size:C})=>
|
|
63
|
-
border-radius: 0 ${
|
|
62
|
+
padding: ${({size:C})=>C1(C)};
|
|
63
|
+
border-radius: 0 ${v(4)} ${v(4)} 0;
|
|
64
64
|
|
|
65
65
|
margin: 0px -13px 0px 0px;
|
|
66
66
|
|
|
67
67
|
svg {
|
|
68
|
-
width: ${({size:C})=>
|
|
68
|
+
width: ${({size:C})=>X3(C)};
|
|
69
69
|
}
|
|
70
70
|
}
|
|
71
|
-
`;import{jsx as
|
|
71
|
+
`;import{jsx as E,jsxs as d1}from"react/jsx-runtime";var s1=c=>{var a=c,{rules:C,name:i,defaultValue:o,shouldUnregister:l,datePickerProps:r,label:m,required:t,placeholder:H}=a,L=u(a,["rules","name","defaultValue","shouldUnregister","datePickerProps","label","required","placeholder"]);let M=o1();if(!M)throw new Error("Para usar o <DataPicker /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let F=b(M.formState.errors,i);return E(t1,{dateAdapter:H1,children:E(e1,{control:M.control,name:i,rules:C,defaultValue:o,shouldUnregister:l,render:({field:{value:p,onChange:Z}})=>d1(r1,{display:"flex",flexDirection:"column",children:[m&&E(x,{label:m,required:t}),E(n1,V(e({},r),{value:p!=null?p:null,inputFormat:(r==null?void 0:r.inputFormat)||"DD/MM/YYYY",onChange:Z,renderInput:d=>{var f,n;return E(l1,V(e(V(e({variant:"outlined"},d),{error:Boolean(F)}),L),{inputProps:V(e({},d.inputProps),{placeholder:H||((f=d.inputProps)==null?void 0:f.placeholder)}),InputProps:V(e({},d.InputProps),{endAdornment:E(p2,{size:L.size,children:(n=d.InputProps)==null?void 0:n.endAdornment})})}))}})),E(h,{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 S}from"@s_mart/utils";import L1 from"@emotion/styled";var a1=C=>{switch(C){case"small":return S(16);default:case"medium":return S(20);case"large":return S(24)}},M1=C=>{switch(C){case"small":return`${S(2)} ${S(8)}`;default:case"medium":return`${S(6)} ${S(8)}`;case"large":return`${S(10)}`}},m2=L1.div`
|
|
72
72
|
> div > button {
|
|
73
|
-
padding: ${({size:C})=>
|
|
74
|
-
border-radius: 0 ${
|
|
73
|
+
padding: ${({size:C})=>M1(C)};
|
|
74
|
+
border-radius: 0 ${S(4)} ${S(4)} 0;
|
|
75
75
|
|
|
76
76
|
margin: 0px -13px 0px 0px;
|
|
77
77
|
|
|
78
78
|
svg {
|
|
79
|
-
width: ${({size:C})=>
|
|
79
|
+
width: ${({size:C})=>a1(C)};
|
|
80
80
|
}
|
|
81
81
|
}
|
|
82
|
-
`;import{memo as
|
|
82
|
+
`;import{memo as x1}from"react";import{jsx as D,jsxs as F1}from"react/jsx-runtime";var y1=c=>{var a=c,{rules:C,defaultValue:i,shouldUnregister:o,name:l,required:r,label:m,timePickerProps:t,placeholder:H}=a,L=u(a,["rules","defaultValue","shouldUnregister","name","required","label","timePickerProps","placeholder"]);let M=u1();if(!M)throw new Error("Para usar o <TimePicker /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let F=b(M.formState.errors,l);return D(g1,{dateAdapter:f1,children:D(m1,{control:M.control,name:l,rules:C,defaultValue:i,shouldUnregister:o,render:({field:{value:p,onChange:Z}})=>F1(Z1,{display:"flex",flexDirection:"column",children:[m&&D(x,{label:m,required:r}),D(c1,V(e({value:p!=null?p:null,onChange:Z},t),{renderInput:d=>{var f,n;return D(p1,V(e(V(e({variant:"outlined"},d),{error:Boolean(F)}),L),{inputProps:V(e({},d.inputProps),{placeholder:H||((f=d.inputProps)==null?void 0:f.placeholder)}),InputProps:V(e({},d.InputProps),{endAdornment:D(m2,{size:L.size,children:(n=d.InputProps)==null?void 0:n.endAdornment})})}))}})),D(h,{name:l})]})})})},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=c=>{var a=c,{name:C,defaultValue:i,rules:o,shouldUnregister:l,label:r,required:m,onInputChange:t,onChange:H}=a,L=u(a,["name","defaultValue","rules","shouldUnregister","label","required","onInputChange","onChange"]);let M=w1();if(!M)throw new Error("Para usar o <Autocomplete /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let F=b(M.formState.errors,C);return console.warn=()=>{},z(b1,{name:C,control:M.control,defaultValue:i,rules:o,shouldUnregister:l,render:({field:p})=>E1(S1,{display:"flex",flexDirection:"column",children:[r&&z(x,{label:r,required:m}),z(k1,V(e({onChange:(Z,d)=>{p.onChange(d),H==null||H(Z,d,M.watch())},onInputChange:(Z,d,f)=>{p.onChange(d),setTimeout(()=>{t==null||t(Z,M.watch(C),f,M.watch())},0)},isOptionEqualToValue:(Z,d)=>Z.value===d.value,renderOption:(Z,d)=>T1("li",V(e({},Z),{key:d.key||d.value,onClick:f=>{var n;(n=Z.onClick)==null||n.call(Z,f),p.onChange(d)}}),d.label),value:p.value||null},L),{renderInput:Z=>{var d,f,n;return z(v1,V(e(e({},Z),L.textFieldProps),{error:Boolean(F),InputProps:V(e(e({},Z.InputProps),(d=L.textFieldProps)==null?void 0:d.InputProps),{inputProps:e(e({},Z.inputProps),(n=(f=L.textFieldProps)==null?void 0:f.InputProps)==null?void 0:n.inputProps)})}))}})),z(h,{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,n3 as Searchable,Q2 as Select,Q3 as Slider,A3 as Switch,U2 as TextField,h1 as TimePicker};
|