@s_mart/form 9.2.0-beta.1 → 9.2.0-beta.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.d.mts +7 -7
- package/dist/index.mjs +9 -9
- package/package.json +8 -8
package/dist/index.d.mts
CHANGED
|
@@ -609,7 +609,7 @@ type AutocompleteProps<ValueType = any> = Omit<UseControllerProps, 'control'> &
|
|
|
609
609
|
|
|
610
610
|
declare const _default$3: react.MemoExoticComponent<({ name, defaultValue, rules, shouldUnregister, label, required, noOptionsText, placeholder, onInputChange, onChange, disableIconError, ...rest }: AutocompleteProps) => react_jsx_runtime.JSX.Element>;
|
|
611
611
|
|
|
612
|
-
type SearchableV2Props<TFieldValues extends FieldValues = FieldValues, TFieldName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>, FieldValue
|
|
612
|
+
type SearchableV2Props<TFieldValues extends FieldValues = FieldValues, TFieldName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>, FieldValue = FieldPathValue<TFieldValues, TFieldName>, Multiple extends boolean | undefined = undefined, DisableClearable extends boolean | undefined = undefined, FreeSolo extends boolean | undefined = undefined, AutocompleteFieldValue extends AutocompleteValue<FieldValue, Multiple, DisableClearable, FreeSolo> = AutocompleteValue<FieldValue, Multiple, DisableClearable, FreeSolo>> = Omit<AutocompleteProps$1<FieldValue, Multiple, DisableClearable, FreeSolo>, 'renderInput' | 'size' | 'options' | 'onInputChange' | 'onChange' | 'getOptionLabel' | 'getOptionKey' | 'defaultValue' | 'value'> & UseControllerProps<TFieldValues, TFieldName> & {
|
|
613
613
|
options: FieldValue[];
|
|
614
614
|
textFieldProps?: TextFieldProps$1;
|
|
615
615
|
label?: React.ReactNode;
|
|
@@ -636,7 +636,7 @@ type SearchableV2Props<TFieldValues extends FieldValues = FieldValues, TFieldNam
|
|
|
636
636
|
value?: AutocompleteFieldValue;
|
|
637
637
|
placeholder?: string;
|
|
638
638
|
onInputChange?: (value: string) => void;
|
|
639
|
-
onChange?: (value: AutocompleteValue<FieldValue, Multiple, DisableClearable, FreeSolo>) => void;
|
|
639
|
+
onChange?: (value: AutocompleteValue<FieldValue, Multiple, DisableClearable, FreeSolo> | (DisableClearable extends true ? never : null)) => void;
|
|
640
640
|
/**
|
|
641
641
|
* Define a key unica da option
|
|
642
642
|
*/
|
|
@@ -651,7 +651,7 @@ type SearchableV2Props<TFieldValues extends FieldValues = FieldValues, TFieldNam
|
|
|
651
651
|
getOptionAfterLabel?: (option: FieldValue | AutocompleteFreeSoloValueMapping<FreeSolo>) => string | React.ReactNode;
|
|
652
652
|
};
|
|
653
653
|
|
|
654
|
-
declare const _default$2: <TFieldValues extends FieldValues = FieldValues, TFieldName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>, FieldValue
|
|
654
|
+
declare const _default$2: <TFieldValues extends FieldValues = FieldValues, TFieldName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>, FieldValue = FieldPathValue<TFieldValues, TFieldName>, Multiple extends boolean | undefined = undefined, DisableClearable extends boolean | undefined = undefined, FreeSolo extends boolean | undefined = undefined, AutocompleteFieldValue extends AutocompleteValue<FieldValue, Multiple, DisableClearable, FreeSolo> = AutocompleteValue<FieldValue, Multiple, DisableClearable, FreeSolo>>(props: SearchableV2Props<TFieldValues, TFieldName, FieldValue, Multiple, DisableClearable, FreeSolo, AutocompleteFieldValue>) => react_jsx_runtime.JSX.Element;
|
|
655
655
|
|
|
656
656
|
type FooterPropsV2 = {
|
|
657
657
|
closeSelect: () => void;
|
|
@@ -709,7 +709,7 @@ type SelectV2Props<TFieldValues extends FieldValues = FieldValues, TFieldName ex
|
|
|
709
709
|
|
|
710
710
|
declare const _default$1: <TFieldValues extends FieldValues = FieldValues, TFieldName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>(props: SelectV2Props<TFieldValues, TFieldName>) => react_jsx_runtime.JSX.Element;
|
|
711
711
|
|
|
712
|
-
type CreatableV2Props<TFieldValues extends FieldValues = FieldValues, TFieldName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>, FieldValue
|
|
712
|
+
type CreatableV2Props<TFieldValues extends FieldValues = FieldValues, TFieldName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>, FieldValue = FieldPathValue<TFieldValues, TFieldName>, Multiple extends boolean | undefined = undefined, DisableClearable extends boolean | undefined = undefined, FreeSolo extends boolean | undefined = undefined> = Omit<AutocompleteProps$1<FieldValue, Multiple, DisableClearable, FreeSolo>, 'renderInput' | 'options' | 'size' | 'onInputChange' | 'onChange' | 'getOptionLabel' | 'getOptionKey' | 'defaultValue' | 'value'> & UseControllerProps<TFieldValues, TFieldName> & {
|
|
713
713
|
options: FieldValue[];
|
|
714
714
|
textFieldProps?: TextFieldProps$1;
|
|
715
715
|
label?: React.ReactNode;
|
|
@@ -741,7 +741,7 @@ type CreatableV2Props<TFieldValues extends FieldValues = FieldValues, TFieldName
|
|
|
741
741
|
* @type {(value) => void}
|
|
742
742
|
* @memberof CreatableV2Props
|
|
743
743
|
*/
|
|
744
|
-
onEditOption?: (value:
|
|
744
|
+
onEditOption?: (value: AutocompleteValue<FieldValue, Multiple, DisableClearable, FreeSolo>) => void;
|
|
745
745
|
/**
|
|
746
746
|
* Componente que renderiza no footer do searchable (opcional)
|
|
747
747
|
* @example
|
|
@@ -756,7 +756,7 @@ type CreatableV2Props<TFieldValues extends FieldValues = FieldValues, TFieldName
|
|
|
756
756
|
*/
|
|
757
757
|
info?: React.ReactNode;
|
|
758
758
|
onInputChange?: (value: string) => void;
|
|
759
|
-
onChange?: (value: AutocompleteValue<FieldValue, Multiple, DisableClearable, FreeSolo>) => void;
|
|
759
|
+
onChange?: (value: AutocompleteValue<FieldValue, Multiple, DisableClearable, FreeSolo> | (DisableClearable extends true ? never : null)) => void;
|
|
760
760
|
placeholder?: string;
|
|
761
761
|
/**
|
|
762
762
|
* Define a key unica da option
|
|
@@ -772,7 +772,7 @@ type CreatableV2Props<TFieldValues extends FieldValues = FieldValues, TFieldName
|
|
|
772
772
|
getOptionAfterLabel?: (option: FieldValue) => string | React.ReactNode;
|
|
773
773
|
};
|
|
774
774
|
|
|
775
|
-
declare function CreatableV2<TFieldValues extends FieldValues = FieldValues, TFieldName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>, FieldValue
|
|
775
|
+
declare function CreatableV2<TFieldValues extends FieldValues = FieldValues, TFieldName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>, FieldValue = FieldPathValue<TFieldValues, TFieldName>, Multiple extends boolean | undefined = undefined, DisableClearable extends boolean | undefined = undefined, FreeSolo extends boolean | undefined = undefined>(props: CreatableV2Props<TFieldValues, TFieldName, FieldValue, Multiple, DisableClearable, FreeSolo>): react_jsx_runtime.JSX.Element;
|
|
776
776
|
declare const _default: typeof CreatableV2;
|
|
777
777
|
|
|
778
778
|
export { _default$3 as Autocomplete, type AutocompleteProps, Checkbox, type CheckboxProps, Creatable, type CreatableProps, _default as CreatableV2, type CreatableV2Props, _default$5 as DatePicker, type DatePickerProps, Form, FormProvider, type IFormProps, type IFormProviderProps, type IUseFormProps, RadioButton, RadioGroup, type RadioGroupProps, type RadioProps, Searchable, type SearchableProps, _default$2 as SearchableV2, type SearchableV2Props, Select, type SelectProps, _default$1 as SelectV2, type SelectV2Props, Slider, type SliderProps, Switch, type SwitchProps, TextField, type TextFieldProps, _default$4 as TimePicker, type TimePickerProps, useForm };
|
package/dist/index.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import{FormProvider as ao}from"react-hook-form";import{jsx as Ie}from"react/jsx-runtime";function so({children:e,style:o,onSubmit:l,...i}){return Ie(ao,{...i,children:Ie("form",{onSubmit:
|
|
1
|
+
import{FormProvider as ao}from"react-hook-form";import{jsx as Ie}from"react/jsx-runtime";function so({children:e,style:o,onSubmit:l,...i}){return Ie(ao,{...i,children:Ie("form",{onSubmit:s=>{s.preventDefault(),s.stopPropagation(),l(s)},style:o,children:e})})}var be=so;import{useEffect as po}from"react";import{useForm as mo}from"react-hook-form";import{zodResolver as uo}from"@hookform/resolvers/zod";var co=({disableDefaultValuesUpdate:e,onSubmit:o,...l})=>{let i=mo({...l,resolver:l.schema&&uo(l.schema)});return po(()=>{e||i.reset(l.defaultValues)},[l.defaultValues,i.reset]),{...i,onSubmit:i.handleSubmit(s=>o(s,i))}},he=co;import{jsx as yo}from"react/jsx-runtime";function fo({children:e,style:o,...l}){let i=he(l);return yo(be,{...i,style:o,children:typeof e=="function"?e(i):e})}var Fo=fo;import{InputAdornment as vo,Stack as To,TextField as So,Tooltip as ko}from"@mui/material";import{LIcon as Ae}from"@s_mart/core";import*as De from"@s_mart/masks";import{lineEye as Io,lineEyeSlash as wo,lineInfoCircle as Lo}from"@s_mart/solid-icons";import{useRef as Ao,useState as Do}from"react";import{useController as Ro,useFormContext as Bo,useFormState as Eo}from"react-hook-form";import{Indicator as xo}from"@s_mart/core";import{useFormState as bo}from"react-hook-form";var R=(e,o)=>o.replace(/[[\]]/g,"").split(".").reduce((i,s)=>i?.[s],e);import{jsx as Po}from"react/jsx-runtime";var ho=({name:e,disableIcon:o,control:l})=>{let i=bo({control:l,name:e}),s=R(i?.errors,e);return s?Po(xo,{severity:"error",icon:o?!1:void 0,children:s?.message}):null},I=ho;import{Typography as we}from"@mui/material";import{toRem as go}from"@s_mart/utils";import{jsx as Le,jsxs as Co}from"react/jsx-runtime";var Vo=({label:e,required:o,regular:l})=>Co("span",{style:{display:"flex",alignItems:"center",gap:go(2)},children:[Le(we,{variant:"caption",style:{display:"flex",alignItems:"center"},sx:{fontWeight:l?400:700},children:e}),o&&Le(we,{variant:"caption",color:"error",sx:{fontWeight:900},children:"*"})]}),S=Vo;var v=class extends Error{constructor(o){super(`O componente ${o} precisa de um control para funcionar. Passe o control como prop ou coloque o componente dentro de um <Form />`),this.name="FormComponentPrecisaDeControl"}};import{jsx as H,jsxs as Re}from"react/jsx-runtime";var Mo=({name:e,rules:o,defaultValue:l,shouldUnregister:i,control:s,label:P,required:g,mask:f,variant:T="outlined",info:x,parse:C,format:m,onInputChange:u,disableIconError:a,...p})=>{let V=Bo()?.control,n=s??V,F=Ao(l||void 0);if(!n)throw new v("TextField");let[A,r]=Do(!1),y=c=>{let t=c;return t=m?.(c)??c,f?De?.[f]?.format(t):t},G=c=>{let t=c;return t=C?.(c)??t,f?De?.[f]?.parse(t,F.current):t},b=c=>{if(!c||f!=="porcentagem"&&f!=="porcentagem0")return;c?.stopPropagation();let t=(c?.target).value;if(t){let k=String(t);if(k.length>0){let z=k.indexOf("%");z>-1&&(c.currentTarget.selectionEnd=z)}}},{field:d}=Ro({control:n,name:e,rules:o,defaultValue:l,shouldUnregister:i}),w=Eo({control:n,name:e}),L=R(w.errors,e);return Re(To,{children:[Re("div",{style:{display:"flex"},children:[P&&H("div",{children:H(S,{label:P,required:g})}),x&&H("div",{children:H(ko,{title:x,placement:"top",children:H("div",{style:{width:"fit-content"},children:H(Ae,{icon:Lo,color:"#757575"})})})})]}),H(So,{variant:T,defaultValue:l,value:y(d.value||(d.value!=0?"":d.value)),onChange:c=>{let t=G(c?.target?.value);d.onChange(t),u?.(t),F.current=c.target.value},error:!!L,...p,type:p.type==="password"?A?"text":"password":p.type,autoComplete:p.autoComplete||"off",slotProps:{input:{onKeyDown:b,inputRef:d.ref,endAdornment:p.type==="password"&&H(vo,{position:"start",onClick:()=>r(!A),style:{cursor:"pointer"},children:H(Ae,{icon:A?Io:wo,size:"24px",removeMargin:!0})}),...p.InputProps}}},e),H(I,{name:e,disableIcon:a,control:n})]})},$o=Mo;import{Divider as Oo,Grid as Q,MenuItem as No,Select as Go,Tooltip as zo,useTheme as qo}from"@mui/material";import{IconButton as _o,LIcon as Be}from"@s_mart/core";import{lineTimes as Uo}from"@s_mart/regular-icons";import{lineInfoCircle as Ho}from"@s_mart/solid-icons";import{colorPalette as Ko}from"@s_mart/tokens";import{memo as Wo,useState as Yo}from"react";import{Controller as jo,useFormContext as Jo}from"react-hook-form";import{Fragment as Qo,jsx as N,jsxs as ae}from"react/jsx-runtime";var Ee=Wo(({name:e,rules:o,defaultValue:l,shouldUnregister:i,label:s,required:P,options:g,placeholder:f,clearable:T,disableOnChangeForm:x=!1,multiple:C,info:m,footer:u,onChange:a,disableIconError:p,variant:V="outlined",...n})=>{let F=Jo(),{palette:A}=qo(),[r,y]=Yo(!1);if(!F)throw new v("Select");let G=R(F.formState.errors,e);return N(jo,{control:F.control,name:e,rules:o,defaultValue:l,shouldUnregister:i,render:({field:{value:b,onChange:d,ref:w}})=>ae(Q,{sx:{display:"flex",flexDirection:"column"},children:[ae("div",{style:{display:"flex"},children:[s&&N(Q,{item:!0,children:N(S,{label:s,required:P})}),m&&N(Q,{item:!0,children:N(zo,{title:m,placement:"top",children:N("div",{style:{width:"fit-content"},children:N(Be,{icon:Ho,color:"#757575"})})})})]}),ae(Go,{open:r,onOpen:()=>y(!0),onClose:()=>y(!1),displayEmpty:!!f,variant:V,autoComplete:"off",value:b?b||"":C?[]:"",renderValue:L=>{if(L.label)return L.label;if(f)return N("p",{style:{color:A.grey[400]},children:f})},multiple:C,onChange:L=>{!x&&d(L.target.value),a&&a(L.target.value,F.getValues())},error:!!G,size:n.size||"medium",inputRef:w,...n,endAdornment:ae(Qo,{children:[n.endAdornment,!!(T&&b)&&N(_o,{variant:"text",color:"neutral",size:"small",sx:{borderRadius:"50%",position:"absolute",right:"2rem"},style:{padding:0},"aria-label":"Clear",title:"Clear",onClick:()=>{!x&&d(null),a&&a(null,F.getValues())},children:N(Be,{icon:Uo,color:Ko.neutral[100],size:"25px",removeMargin:!0})})]}),children:[g?.map((L,c)=>N(No,{value:L,children:ae(Q,{container:!0,direction:"column",children:[N(Q,{item:!0,children:L.label}),L.afterLabel&&N(Q,{item:!0,children:L.afterLabel})]})},c)),u&&[N(Q,{sx:{px:2,py:1},children:N(Oo,{})},"footer-divider"),N("div",{children:u({closeSelect:()=>y(!1)})},"footer-content")]]},e),N(I,{name:e,disableIcon:p,control:F.control})]})})});Ee.displayName="Select";var Xo=Ee;import{Autocomplete as Zo,Divider as Me,Grid as j,TextField as et,Tooltip as ot}from"@mui/material";import{LIcon as tt}from"@s_mart/core";import{lineInfoCircle as rt}from"@s_mart/solid-icons";import{colorPalette as lt}from"@s_mart/tokens";import{forwardRef as it,memo as nt}from"react";import{Controller as at,useFormContext as dt}from"react-hook-form";import{Fragment as se,jsx as O,jsxs as Z}from"react/jsx-runtime";import{createElement as $e}from"react";var Oe=nt(({name:e,rules:o,defaultValue:l,shouldUnregister:i,label:s,required:P,options:g,textFieldProps:f,noOptionsText:T,footer:x,multiple:C,info:m,placeholder:u,onChange:a,onInputChange:p,disableIconError:V,...n})=>{let F=dt();if(!F)throw new v("Searchable");let A=R(F.formState.errors,e);return O(at,{control:F.control,name:e,rules:o,defaultValue:l,shouldUnregister:i,render:({field:{onChange:r,value:y,ref:G}})=>Z(j,{sx:{display:"flex",flexDirection:"column"},children:[Z("div",{style:{display:"flex"},children:[s&&O(j,{item:!0,children:O(S,{label:s,required:P})}),m&&O(j,{item:!0,children:O(ot,{title:m,placement:"top",children:O("div",{style:{width:"fit-content"},children:O(tt,{icon:rt,color:"#757575"})})})})]}),O(Zo,{onChange:(b,d)=>{r(d),a?.(d,F.getValues())},onInputChange:(b,d,w)=>{w==="input"&&setTimeout(()=>{p?.(d,F.getValues())},0)},slotProps:{...n.slotProps||{},paper:{...(n.slotProps||{}).paper||{},sx:{border:`1px solid ${lt.neutral[30]}`,boxShadow:"0px 2px 4px rgba(0, 0, 0, 0.15)"}},listbox:{component:it(function(d,w){return Z(se,{children:[O("ul",{...d,ref:w}),!!x&&O("div",{...d,children:Z(se,{children:[O(j,{sx:{px:2,py:1},children:O(Me,{})}),x]})},"searchable-footer")]})})}},value:y||(C?[]:null),options:g,multiple:C,readOnly:n.disabled,noOptionsText:Z(se,{children:[T||"Nenhum resultado encontrado",x?Z(se,{children:[O(j,{sx:{py:1},children:O(Me,{})}),x]}):null]}),isOptionEqualToValue:(b,d)=>typeof b=="string"&&typeof d=="string"?b===d:typeof b=="object"&&typeof d=="object"?typeof b.value=="object"&&typeof d.value=="object"&&b.key!==void 0&&d.key!==void 0?b.key===d.key:b.value===d.value:!1,renderOption:(b,d)=>typeof d=="object"?$e("li",{...b,key:d.key||d.value},Z(j,{container:!0,direction:"column",children:[O(j,{item:!0,children:d.label}),d.afterLabel&&O(j,{item:!0,children:d.afterLabel})]})):$e("li",{...b,key:d},d),...n,renderInput:b=>O(et,{error:!!A,placeholder:u,...b,...f,inputRef:G})},e),O(I,{name:e,disableIcon:V,control:F.control})]})})});Oe.displayName="Searchable";var st=Oe;import{forwardRef as ut,memo as ct}from"react";import{Controller as ft,useFormContext as Ft}from"react-hook-form";import{isObject as yt,isEmpty as xt}from"lodash-es";import{Grid as ee,Autocomplete as bt,TextField as ht,Tooltip as Pt,Divider as gt}from"@mui/material";import{LIcon as me,Button as Vt}from"@s_mart/core";import{colorPalette as Ct}from"@s_mart/tokens";import{linePlus as qe,linePen as vt,lineInfoCircle as Tt}from"@s_mart/solid-icons";import{toRem as _e}from"@s_mart/utils";import{css as Ne}from"@emotion/react";import{styled as pt}from"@mui/material";import{toRem as pe}from"@s_mart/utils";var Ge=Ne`
|
|
2
2
|
display: flex;
|
|
3
3
|
align-items: center;
|
|
4
4
|
justify-content: center;
|
|
5
|
-
`,mt=e=>
|
|
5
|
+
`,mt=e=>Ne`
|
|
6
6
|
.creatable,
|
|
7
7
|
.editable {
|
|
8
8
|
${Ge}
|
|
@@ -51,16 +51,16 @@ import{FormProvider as ao}from"react-hook-form";import{jsx as Ie}from"react/jsx-
|
|
|
51
51
|
}
|
|
52
52
|
|
|
53
53
|
${({hideAddButton:e,theme:o})=>!e&&mt(o)}
|
|
54
|
-
`;import{Fragment as Pe,jsx as
|
|
54
|
+
`;import{Fragment as Pe,jsx as D,jsxs as K}from"react/jsx-runtime";import{createElement as Ue}from"react";var He=ct(({name:e,rules:o,defaultValue:l,shouldUnregister:i,label:s,required:P,options:g,editable:f,footer:T,onEditOption:x,onCreateOption:C,textFieldProps:m,hideAddButton:u,multiple:a,info:p,onChange:V,onInputChange:n,placeholder:F,disableIconError:A,...r})=>{let y=Ft();if(!y)throw new v("Creatable");let G=R(y.formState.errors,e),b=u||r.disabled,d=t=>{let k=0;return m?.InputProps||(k+=2.5),b||(k+=2.56,w(t)&&(k+=2.56)),!r.disableClearable&&!r.disabled&&(k+=1.3),k+"rem"},w=t=>r.disabled?!1:f&&yt(t)&&!xt(t);console.warn=()=>{};let L=t=>{C?C(t):console.error("onCreateOption n\xE3o foi definido")},c=t=>{x?x(t):console.error("onEditOption n\xE3o foi definido")};return D(ft,{control:y.control,name:e,rules:o,defaultValue:l,shouldUnregister:i,render:({field:{value:t,onChange:k,ref:z}})=>{let J=t?.label||t?.value||t;return K(ee,{sx:{display:"flex",flexDirection:"column"},children:[K("div",{style:{display:"flex"},children:[s&&D(ee,{item:!0,children:D(S,{label:s,required:P})}),p&&D(ee,{item:!0,children:D(Pt,{title:p,placement:"top",children:D("div",{style:{width:"fit-content"},children:D(me,{icon:Tt,color:"#757575"})})})})]}),D(ze,{hideAddButton:b,children:D(bt,{fullWidth:!0,onChange:(B,h)=>{k(h),V?.(h,y.getValues())},onInputChange:(B,h,ne)=>{ne==="input"&&setTimeout(()=>{n?.(h,y.getValues())},0)},slotProps:{...r.slotProps||{},paper:{...(r.slotProps||{}).paper||{},sx:{border:`1px solid ${Ct.neutral[30]}`,boxShadow:"0px 2px 4px rgba(0, 0, 0, 0.15)"}},listbox:{component:ut(function(h,ne){return K(Pe,{children:[D("ul",{...h,ref:ne}),!!T&&D("div",{...h,children:K(Pe,{children:[D(ee,{sx:{px:2,py:1},children:D(gt,{})}),T]})},"creatable-footer")]})})}},options:g,value:t||(a?[]:null),multiple:a,readOnly:r.disabled,noOptionsText:b?void 0:K(Vt,{sx:{justifyContent:"flex-start",padding:`${_e(6)} ${_e(-16)}`,margin:0},fullWidth:!0,onClick:()=>L(t),variant:"text",startIcon:D(me,{icon:qe}),children:["Adicionar ",J&&`"${J}"`]}),isOptionEqualToValue:(B,h)=>h?typeof B=="string"&&typeof h=="string"?B===h:typeof B=="object"&&typeof h=="object"?typeof B.value=="object"&&typeof h.value=="object"&&B.key!==void 0&&h.key!==void 0?B.key===h.key:B.value===h.value:typeof B=="object"&&typeof h=="string":!1,renderOption:(B,h)=>typeof h=="object"?Ue("li",{...B,key:h.key||h.value},K(ee,{container:!0,direction:"column",children:[D(ee,{item:!0,children:h.label}),h.afterLabel&&D(ee,{item:!0,children:h.afterLabel})]})):Ue("li",{...B,key:h},h),...r,sx:{"& div.MuiInputBase-root":{paddingRight:`${d(t)} !important`},...r.sx},renderInput:B=>D(ht,{placeholder:F,...B,error:!!G,...m,slotProps:{input:{...B.InputProps,inputRef:z,endAdornment:K("div",{className:"endAdornments",children:[B.InputProps.endAdornment,!b&&K(Pe,{children:[w(t)?K("div",{className:"editable",children:[D("div",{className:"divider"}),D("div",{className:"button",onClick:()=>c(t),children:D(me,{icon:vt,size:"24px",removeMargin:!0})})]}):null,K("div",{className:"creatable",children:[D("div",{className:"divider"}),D("div",{className:"button",onClick:()=>L(t),children:D(me,{icon:qe,size:"24px",removeMargin:!0})})]})]})]})}}})},e)}),D(I,{name:e,disableIcon:A,control:y.control})]})}})});He.displayName="Creatable";var St=He;import{useController as kt,useFormContext as It}from"react-hook-form";import{Checkbox as wt,FormControlLabel as Lt}from"@mui/material";import{jsx as ue,jsxs as Rt}from"react/jsx-runtime";var At=({name:e,rules:o,defaultValue:l,shouldUnregister:i,control:s,label:P,labelPlacement:g,required:f,disableIconError:T,onChange:x,...C})=>{let m=It()?.control,u=s??m;if(!u)throw new v("Checkbox");let{field:a}=kt({control:u,name:e,rules:o,defaultValue:l,shouldUnregister:i});return Rt("span",{children:[ue(Lt,{control:ue(wt,{checked:!!a.value,value:a.value??"",defaultValue:a.value,onChange:(p,V)=>{a.onChange(p,V),x?.(p,V)},...C},e),label:ue(S,{label:P,required:f,regular:!0}),labelPlacement:g||"end"}),ue(I,{name:e,disableIcon:T,control:u})]})},Dt=At;import{FormControlLabel as Bt,Stack as Et,Switch as Mt}from"@mui/material";import{useController as $t,useFormContext as Ot}from"react-hook-form";import{jsx as ce,jsxs as zt}from"react/jsx-runtime";var Nt=({name:e,rules:o,defaultValue:l,shouldUnregister:i,control:s,label:P,labelPlacement:g,disableIconError:f,onChange:T,...x})=>{let C=Ot()?.control,m=s??C;if(!m)throw new v("Switch");let{field:u}=$t({control:m,name:e,rules:o,defaultValue:l,shouldUnregister:i});return zt(Et,{children:[ce(Bt,{control:ce(Mt,{value:u.value??"",checked:u.value??!1,defaultValue:u.value,onChange:(a,p)=>{u.onChange(a,p),T?.(a,p)},...x},e),label:ce(S,{label:P}),labelPlacement:g||"end"}),ce(I,{name:e,disableIcon:f,control:m})]})},Gt=Nt;import{RadioGroup as qt,Stack as _t}from"@mui/material";import{useController as Ut,useFormContext as Ht}from"react-hook-form";import{jsx as ge,jsxs as Yt}from"react/jsx-runtime";var Kt=({name:e,rules:o,defaultValue:l,shouldUnregister:i,control:s,label:P,required:g,children:f,orientation:T="row",disableIconError:x,...C})=>{let m=Ht()?.control,u=s??m;if(!u)throw new v("RadioGroup");let{field:a}=Ut({control:u,name:e,rules:o,defaultValue:l,shouldUnregister:i});return Yt(_t,{children:[P&&ge(S,{label:P,required:g}),ge(qt,{value:a.value||"",name:e,...C,onChange:p=>{C?.onChange?.(p,p.target?.value),a.onChange(p)},style:{display:"flex",flexDirection:T},children:f},e),ge(I,{name:e,disableIcon:x,control:u})]})},Wt=Kt;import{FormControlLabel as jt,Grid2 as Jt,Radio as Xt}from"@mui/material";import{jsx as fe}from"react/jsx-runtime";var Qt=({label:e,labelPlacement:o,...l})=>fe(Jt,{sx:{display:"flex",flexDirection:"column"},children:fe(jt,{control:fe(Xt,{...l}),label:fe(S,{label:e}),labelPlacement:o||"end"})}),Zt=Qt;import{useController as er,useFormContext as or}from"react-hook-form";import{Slider as tr}from"@mui/material";import{jsx as ir}from"react/jsx-runtime";var rr=({name:e,rules:o,defaultValue:l,shouldUnregister:i,control:s,...P})=>{let g=or()?.control,f=s??g;if(!f)throw new v("Slider");let{field:T}=er({control:f,name:e,rules:o,defaultValue:l,shouldUnregister:i});return ir(tr,{value:T.value||P?.min||0,onChange:T.onChange,valueLabelDisplay:"auto",...P},e)},lr=rr;import{Stack as pr,TextField as mr}from"@mui/material";import{AdapterDayjs as ur}from"@mui/x-date-pickers/AdapterDayjs";import{DatePicker as cr}from"@mui/x-date-pickers/DatePicker";import{LocalizationProvider as fr}from"@mui/x-date-pickers/LocalizationProvider";import{ptBR as Fr}from"@mui/x-date-pickers/locales/ptBR";import{composeValidators as yr,date as We}from"@s_mart/rules";import xr from"dayjs/locale/pt-br";import{memo as br}from"react";import{useController as hr,useFormContext as Pr,useFormState as gr}from"react-hook-form";import{IconButton as nr,styled as ar}from"@mui/material";import{toRem as W}from"@s_mart/utils";var dr=e=>{switch(e){case"small":return W(16);default:case"medium":return W(20);case"large":return W(24)}},sr=e=>{switch(e){case"small":return`${W(2)} ${W(8)}`;default:case"medium":return`${W(6)} ${W(8)}`;case"large":return`${W(10)}`}},Ke=ar(nr)`
|
|
55
55
|
margin: 0px;
|
|
56
56
|
|
|
57
|
-
padding: ${({size:e})=>
|
|
57
|
+
padding: ${({size:e})=>sr(e)};
|
|
58
58
|
border-radius: 0 ${W(4)} ${W(4)} 0;
|
|
59
59
|
|
|
60
60
|
svg {
|
|
61
|
-
width: ${({size:e})=>
|
|
61
|
+
width: ${({size:e})=>dr(e)} !important;
|
|
62
62
|
}
|
|
63
|
-
`;import{jsx as Fe,jsxs as Tr}from"react/jsx-runtime";import{createElement as vr}from"react";var Vr=({rules:e,name:o,defaultValue:l,shouldUnregister:i,control:
|
|
63
|
+
`;import{jsx as Fe,jsxs as Tr}from"react/jsx-runtime";import{createElement as vr}from"react";var Vr=({rules:e,name:o,defaultValue:l,shouldUnregister:i,control:s,datePickerProps:P,label:g,required:f,placeholder:T,disabled:x,disableIconError:C,...m})=>{let u=Pr()?.control,a=s??u;if(!a)throw new v("DatePicker");let p=gr({control:a,name:o}),V=R(p.errors,o),n=P?.format||"DD/MM/YYYY",F=e?yr([We(n),e]):We(n),{field:A}=hr({control:a,name:o,rules:F,defaultValue:l,shouldUnregister:i});return Fe(fr,{dateAdapter:ur,adapterLocale:xr,localeText:Fr.components.MuiLocalizationProvider.defaultProps.localeText,children:Tr(pr,{children:[g&&Fe(S,{label:g,required:f}),vr(cr,{...P,key:o,value:A.value??null,format:n,onChange:(r,y)=>{A.onChange(r,y),P?.onChange?.(r,y)},disabled:x,slots:{textField:mr,openPickerButton:r=>Fe(Ke,{...r,size:m.size})},slotProps:{textField:r=>({variant:"outlined",...r,error:!!V,...m,inputProps:{...r.inputProps,placeholder:T||r.inputProps?.placeholder},InputProps:{...r.InputProps,inputRef:y=>{A.ref(y),typeof r.inputRef=="function"&&r.inputRef(y)}}})}}),Fe(I,{name:o,disableIcon:C,control:a})]})})},Cr=br(Vr);import{Stack as Lr,TextField as Ar}from"@mui/material";import{AdapterDayjs as Dr}from"@mui/x-date-pickers/AdapterDayjs";import{LocalizationProvider as Rr}from"@mui/x-date-pickers/LocalizationProvider";import{TimePicker as Br}from"@mui/x-date-pickers/TimePicker";import{ptBR as Er}from"@mui/x-date-pickers/locales/ptBR";import{composeValidators as Mr,time as je}from"@s_mart/rules";import $r from"dayjs/locale/pt-br";import{memo as Or}from"react";import{useController as Nr,useFormContext as Gr,useFormState as zr}from"react-hook-form";import{styled as Sr}from"@mui/material";import{IconButton as kr}from"@mui/material";import{toRem as Y}from"@s_mart/utils";var Ir=e=>{switch(e){case"small":return Y(16);case"large":return Y(24);default:return Y(20)}},wr=e=>{switch(e){case"small":return`${Y(2)} ${Y(8)}`;case"large":return Y(10);default:return`${Y(6)} ${Y(8)}`}},Ye=Sr(kr)`
|
|
64
64
|
margin: 0px;
|
|
65
65
|
|
|
66
66
|
padding: ${({size:e})=>wr(e)};
|
|
@@ -69,11 +69,11 @@ import{FormProvider as ao}from"react-hook-form";import{jsx as Ie}from"react/jsx-
|
|
|
69
69
|
svg {
|
|
70
70
|
width: ${({size:e})=>Ir(e)} !important;
|
|
71
71
|
}
|
|
72
|
-
`;import{jsx as
|
|
72
|
+
`;import{jsx as de,jsxs as Ur}from"react/jsx-runtime";var qr=({rules:e,defaultValue:o,shouldUnregister:l,name:i,control:s,required:P,label:g,timePickerProps:f,placeholder:T,disabled:x,disableIconError:C,...m})=>{let u=Gr()?.control,a=s??u;if(!a)throw new v("TimePicker");let p=zr({control:a,name:i}),V=R(p.errors,i),n=f?.format||"HH:mm",F=e?Mr([je(n),e]):je(n),{field:A}=Nr({control:a,name:i,rules:F,defaultValue:o,shouldUnregister:l});return de(Rr,{dateAdapter:Dr,adapterLocale:$r,localeText:Er.components.MuiLocalizationProvider.defaultProps.localeText,children:Ur(Lr,{children:[g&&de(S,{label:g,required:P}),de(Br,{ampm:!1,format:n,value:A.value??null,disabled:x,...f,onChange:(r,y)=>{A.onChange(r,y),f?.onChange?.(r,y)},slots:{textField:Ar,openPickerButton:r=>de(Ye,{...r,size:m.size})},slotProps:{textField:r=>({variant:"outlined",...r,error:!!V,...m,inputProps:{...r.inputProps,placeholder:T||r.inputProps?.placeholder},InputProps:{...r.InputProps,inputRef:y=>{A.ref(y),typeof r.inputRef=="function"&&r.inputRef(y)}}})}},i),de(I,{name:i,disableIcon:C,control:a})]})})},_r=Or(qr);import{Autocomplete as Hr,Grid as ye,TextField as Kr}from"@mui/material";import{colorPalette as Wr}from"@s_mart/tokens";import{memo as Yr}from"react";import{Controller as jr,useFormContext as Jr}from"react-hook-form";import{jsx as oe,jsxs as Je}from"react/jsx-runtime";import{createElement as Zr}from"react";var Xr=({name:e,defaultValue:o,rules:l,shouldUnregister:i,label:s,required:P,noOptionsText:g,placeholder:f,onInputChange:T,onChange:x,disableIconError:C,...m})=>{let u=Jr();if(!u)throw new v("Autocomplete");let a=R(u.formState.errors,e);return console.warn=()=>{},oe(jr,{name:e,control:u.control,defaultValue:o,rules:l,shouldUnregister:i,render:({field:p})=>Je(ye,{sx:{display:"flex",flexDirection:"column"},children:[s&&oe(S,{label:s,required:P}),oe(Hr,{onChange:(V,n)=>{p.onChange(n),x?.(n,u.getValues())},onInputChange:(V,n,F)=>{F==="input"&&(p.onChange(n),setTimeout(()=>{T?.(n,u.getValues())},0))},slotProps:{...m.slotProps||{},paper:{...m.slotProps?.paper||{},sx:{border:`1px solid ${Wr.neutral[30]}`,boxShadow:"0px 2px 4px rgba(0, 0, 0, 0.15)"}}},isOptionEqualToValue:(V,n)=>V.value===n.value,renderOption:(V,n)=>Zr("li",{...V,key:n.key||n.value,onClick:F=>{V.onClick?.(F),p.onChange(n)}},Je(ye,{container:!0,direction:"column",children:[oe(ye,{item:!0,children:n.label}),n.afterLabel&&oe(ye,{item:!0,children:n.afterLabel})]})),value:p.value||null,readOnly:m.disabled,noOptionsText:g||"Nenhuma op\xE7\xE3o encontrada",...m,renderInput:V=>oe(Kr,{placeholder:f,...V,error:!!a,slotProps:{input:{inputProps:V.inputProps,inputRef:p.ref}}})},e),oe(I,{name:e,disableIcon:C,control:u.control})]})})},Qr=Yr(Xr);import{Autocomplete as il,Divider as Xe,TextField as nl}from"@mui/material";import{colorPalette as al}from"@s_mart/tokens";import{isEqual as dl}from"lodash-es";import{forwardRef as sl}from"react";import{useController as pl,useFormContext as ml,useFormState as ul}from"react-hook-form";import{Tooltip as el}from"@mui/material";import{LIcon as ol}from"@s_mart/core";import{lineInfoCircle as tl}from"@s_mart/solid-icons";import{jsx as Ve}from"react/jsx-runtime";var rl=({title:e})=>Ve(el,{title:e,placement:"top",children:Ve("div",{style:{width:"fit-content"},children:Ve(ol,{icon:tl,color:"#757575"})})}),te=rl;import{memo as ll}from"react";var ie=ll;import{Fragment as Ce,jsx as q,jsxs as re}from"react/jsx-runtime";import{createElement as Fl}from"react";var cl=e=>{let{name:o,rules:l,defaultValue:i,shouldUnregister:s,control:P,label:g,required:f,options:T,textFieldProps:x,noOptionsText:C,footer:m,multiple:u,info:a,placeholder:p,onChange:V,onInputChange:n,getOptionAfterLabel:F,getOptionLabel:A,getOptionKey:r,...y}=e,G=ml()?.control,b=P??G;if(!b)throw new v("SearchableV2");let d=ul({control:b,name:o}),w=R(d.errors,o),{field:L}=pl({name:o,control:b,rules:l,defaultValue:i,shouldUnregister:s});return re("div",{style:{display:"flex",flexDirection:"column"},children:[re("div",{style:{display:"flex"},children:[g&&q(S,{label:g,required:f}),a&&q(te,{title:a})]}),q(il,{onChange:(c,t)=>{L.onChange(t),V?.(t)},onInputChange:(c,t,k)=>{k==="input"&&n?.(t)},value:L.value,options:T,multiple:u,readOnly:y.disabled,slotProps:{...y.slotProps,paper:{...y.slotProps?.paper,sx:{border:`1px solid ${al.neutral[30]}`,boxShadow:"0px 2px 4px rgba(0, 0, 0, 0.15)"}},listbox:{component:sl(function(t,k){return re(Ce,{children:[q("ul",{...t,ref:k}),typeof m<"u"?re("div",{...t,children:[q("div",{style:{paddingTop:"0.5rem",paddingBottom:"0.5rem"},children:q(Xe,{})}),m()]},"searchable-footer"):null]})})}},noOptionsText:re(Ce,{children:[C||"Nenhuma op\xE7\xE3o encontrada",typeof m<"u"?re(Ce,{children:[q("div",{style:{paddingTop:"0.5rem",paddingBottom:"0.5rem"},children:q(Xe,{})}),m()]}):null]}),isOptionEqualToValue:(c,t)=>dl(c,t),getOptionLabel:A,getOptionKey:r,renderOption:typeof F=="function"?(c,t)=>{let k=F(t),z=r(t);return Fl("li",{...c,key:z},re("div",{style:{display:"flex",flexDirection:"column",flex:1},children:[q("span",{children:A(t)}),typeof k=="string"?q("span",{children:k}):k]}))}:void 0,...y,renderInput:c=>q(nl,{error:!!w,placeholder:p,...c,...x,inputRef:L.ref})},o),q(I,{name:o,control:b})]})},fl=ie(cl);import{useState as bl}from"react";import{useController as hl,useFormContext as Pl,useFormState as gl}from"react-hook-form";import{IconButton as Vl,LIcon as Cl}from"@s_mart/core";import{lineTimes as vl}from"@s_mart/regular-icons";import{colorPalette as Tl}from"@s_mart/tokens";import{Select as Sl,MenuItem as kl,Divider as Il}from"@mui/material";import{colorPalette as yl}from"@s_mart/tokens";import{jsx as xl}from"react/jsx-runtime";var Qe=({value:e,placeholder:o,getOptionLabel:l})=>e===null||e?.length===0?xl("p",{style:{color:yl.neutral[100]},children:o}):l(e);import{Fragment as Al,jsx as _,jsxs as le}from"react/jsx-runtime";var wl=e=>{let{name:o,rules:l,defaultValue:i,shouldUnregister:s,control:P,label:g,required:f,options:T,placeholder:x,clearable:C,info:m,footer:u,onChange:a,variant:p="outlined",getOptionKey:V,getOptionLabel:n,getOptionAfterLabel:F,getOptionIcon:A,...r}=e,y=Pl()?.control,G=P??y,[b,d]=bl(!1);if(!G)throw new v("SelectV2");let w=gl({control:G,name:o}),L=R(w.errors,o),{field:c}=hl({control:G,name:o,rules:l,defaultValue:i,shouldUnregister:s});return le("div",{style:{display:"flex",flexDirection:"column"},children:[le("div",{style:{display:"flex"},children:[g&&_(S,{label:g,required:f}),m&&_(te,{title:m})]}),le(Sl,{open:b,onOpen:()=>d(!0),onClose:()=>d(!1),displayEmpty:!!x,variant:p,autoComplete:"off",value:c.value||null,renderValue:t=>_(Qe,{getOptionLabel:n,placeholder:x,value:t}),onChange:t=>{c.onChange(t.target.value),a?.(t.target.value)},error:!!L,size:r.size||"medium",inputRef:c.ref,...r,endAdornment:le(Al,{children:[r.endAdornment,!!(C&&c.value)&&_(Vl,{variant:"text",color:"neutral",size:"small",sx:{borderRadius:"50%",position:"absolute",right:"2rem"},style:{padding:0},"aria-label":"Limpar",title:"Limpar",onClick:()=>{c.onChange(null),a?.(null)},children:_(Cl,{icon:vl,color:Tl.neutral[100],size:"25px",removeMargin:!0})})]}),children:[T.map(t=>{let k=V(t),z=n(t),J=A?.(t);return _(kl,{value:k??z,children:le("div",{style:{display:"flex",flexDirection:"column",flex:1},children:[J!==void 0?le("div",{style:{display:"flex",alignItems:"center"},children:[J,z]}):z,_("span",{children:F?.(t)??null})]})},k)}),u!==void 0&&le("div",{children:[_("div",{style:{padding:"8px 16px"},children:_(Il,{})},"footer-divider"),_("div",{children:u({closeSelect:()=>d(!1)})},"footer-content")]},"footer")]},o),_(I,{name:o,control:G})]})},Ll=ie(wl);import{forwardRef as Bl,useCallback as El,useState as Ml}from"react";import{useController as $l,useFormContext as Ol,useFormState as Nl}from"react-hook-form";import{isObject as Gl,isEmpty as zl,isEqual as ql}from"lodash-es";import{Autocomplete as _l,TextField as Ul,Divider as oo,Button as Hl}from"@mui/material";import{LIcon as ve}from"@s_mart/core";import{colorPalette as Kl}from"@s_mart/tokens";import{linePlus as to,linePen as Wl}from"@s_mart/solid-icons";import{toRem as ro}from"@s_mart/utils";import{css as Dl,styled as Rl}from"@mui/material";import{toRem as xe}from"@s_mart/utils";import"@mui/system";var Ze=Dl`
|
|
73
73
|
display: flex;
|
|
74
74
|
align-items: center;
|
|
75
75
|
justify-content: center;
|
|
76
|
-
`,eo=
|
|
76
|
+
`,eo=Rl("div")`
|
|
77
77
|
display: flex;
|
|
78
78
|
|
|
79
79
|
div.endAdornments {
|
|
@@ -120,4 +120,4 @@ import{FormProvider as ao}from"react-hook-form";import{jsx as Ie}from"react/jsx-
|
|
|
120
120
|
}
|
|
121
121
|
}
|
|
122
122
|
}
|
|
123
|
-
`;import{Fragment as Te,jsx as M,jsxs as U}from"react/jsx-runtime";import{createElement as Jl}from"react";function Yl(e){let{name:o,rules:l,defaultValue:i,shouldUnregister:
|
|
123
|
+
`;import{Fragment as Te,jsx as M,jsxs as U}from"react/jsx-runtime";import{createElement as Jl}from"react";function Yl(e){let{name:o,rules:l,defaultValue:i,shouldUnregister:s,control:P,label:g,required:f,options:T,footer:x,showCreatableButton:C=!0,showEditableButton:m,onEditOption:u,onCreateOption:a,getOptionKey:p,getOptionLabel:V,getOptionAfterLabel:n,textFieldProps:F,multiple:A,info:r,noOptionsText:y,onChange:G,onInputChange:b,placeholder:d,...w}=e,[L,c]=Ml(""),t=Ol()?.control,k=P??t;if(!k)throw new v("CreatableV2");let z=Nl({control:k,name:o}),J=R(z.errors,o),B=!C||w.disabled,{field:h}=$l({name:o,control:k,rules:l,defaultValue:i,shouldUnregister:s}),ne=$=>{let E=0;return F?.InputProps||(E+=2.5),B||(E+=2.56,Se($)&&(E+=2.56)),!w.disableClearable&&!w.disabled&&(E+=1.3),`${E}rem`},Se=$=>w.disabled?!1:m&&Gl($)&&!zl($),lo=()=>w.disabled?!1:C,ke=El(()=>{typeof a<"u"&&(a(L),c(""))},[L,a]),io=$=>{u?.($)};return U("div",{style:{display:"flex",flexDirection:"column"},children:[U("div",{style:{display:"flex"},children:[g&&M(S,{label:g,required:f}),r&&M(te,{title:r})]}),M(eo,{children:M(_l,{fullWidth:!0,onChange:($,E)=>{c(""),h.onChange(E),G?.(E)},onInputChange:($,E,X)=>{X==="input"&&(c(E),b?.(E))},slotProps:{...w.slotProps,paper:{...w.slotProps?.paper,sx:{border:`1px solid ${Kl.neutral[30]}`,boxShadow:"0px 2px 4px rgba(0, 0, 0, 0.15)"}},listbox:{component:Bl(function(E,X){return U(Te,{children:[M("ul",{...E,ref:X}),typeof x<"u"?U("div",{...E,children:[M("div",{style:{paddingTop:"0.5rem",paddingBottom:"0.5rem"},children:M(oo,{})}),x()]},"creatable-footer"):null]})})}},value:h.value,options:T,multiple:A,readOnly:w.disabled,noOptionsText:U(Te,{children:[y||"Nenhuma op\xE7\xE3o encontrada",!B&&U(Hl,{sx:{justifyContent:"flex-start",padding:`${ro(6)} ${ro(-16)}`,margin:0},fullWidth:!0,onClick:ke,variant:"text",startIcon:M(ve,{icon:to}),children:["Adicionar ",`"${L}"`]}),typeof x<"u"&&U(Te,{children:[M("div",{style:{paddingTop:"0.5rem",paddingBottom:"0.5rem"},children:M(oo,{})}),x()]})]}),isOptionEqualToValue:($,E)=>ql($,E),getOptionLabel:V,getOptionKey:p,renderOption:typeof n=="function"?($,E)=>{let X=n(E),no=p(E);return Jl("li",{...$,key:no},U("div",{style:{display:"flex",flexDirection:"column",flex:1},children:[M("span",{children:V(E)}),typeof X=="string"?M("span",{children:X}):X]}))}:void 0,...w,sx:{"& div.MuiInputBase-root":{paddingRight:`${ne(h.value)} !important`},...w.sx},onBlur:$=>{w?.onBlur?.($),c("")},renderInput:$=>M(Ul,{placeholder:d,...$,error:!!J,...F,slotProps:{input:{...$.InputProps,...F?.InputProps,inputRef:h.ref,endAdornment:U("div",{className:"endAdornments",children:[$.InputProps.endAdornment,F?.InputProps?.endAdornment??null,Se(h.value)?U("div",{className:"editable",children:[M("div",{className:"divider"}),M("div",{className:"button",onKeyUp:()=>io(h.value),children:M(ve,{icon:Wl,size:"24px",removeMargin:!0})})]}):null,lo()&&U("div",{className:"creatable",children:[M("div",{className:"divider"}),M("div",{className:"button",onKeyUp:ke,children:M(ve,{icon:to,size:"24px",removeMargin:!0})})]})]})}}})},o)}),M(I,{name:o,control:k})]})}var jl=ie(Yl);export{Qr as Autocomplete,Dt as Checkbox,St as Creatable,jl as CreatableV2,Cr as DatePicker,Fo as Form,be as FormProvider,Zt as RadioButton,Wt as RadioGroup,st as Searchable,fl as SearchableV2,Xo as Select,Ll as SelectV2,lr as Slider,Gt as Switch,$o as TextField,_r as TimePicker,he as useForm};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@s_mart/form",
|
|
3
|
-
"version": "9.2.0-beta.
|
|
3
|
+
"version": "9.2.0-beta.2",
|
|
4
4
|
"main": "./dist/index.mjs",
|
|
5
5
|
"module": "./dist/index.mjs",
|
|
6
6
|
"types": "./dist/index.d.mts",
|
|
@@ -32,12 +32,12 @@
|
|
|
32
32
|
"react-hook-form": "^7.51.0",
|
|
33
33
|
"typescript": ">=5.4.2",
|
|
34
34
|
"zod": "^3.22.4",
|
|
35
|
-
"@s_mart/core": "9.1.5-beta.
|
|
35
|
+
"@s_mart/core": "9.1.5-beta.2",
|
|
36
|
+
"@s_mart/masks": "5.2.0",
|
|
36
37
|
"@s_mart/rules": "5.1.1",
|
|
37
|
-
"@s_mart/typed": "7.2.2",
|
|
38
|
-
"@s_mart/utils": "5.3.4",
|
|
39
38
|
"@s_mart/tokens": "5.1.1",
|
|
40
|
-
"@s_mart/
|
|
39
|
+
"@s_mart/typed": "7.2.2",
|
|
40
|
+
"@s_mart/utils": "5.3.4"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"@emotion/styled": "^11.13.0",
|
|
@@ -50,12 +50,12 @@
|
|
|
50
50
|
"@types/react-dom": ">=18.3.1",
|
|
51
51
|
"dayjs": "^1.11.10",
|
|
52
52
|
"typescript": ">=5.4.2",
|
|
53
|
-
"@s_mart/core": "9.1.5-beta.
|
|
53
|
+
"@s_mart/core": "9.1.5-beta.2",
|
|
54
54
|
"@s_mart/rules": "5.1.1",
|
|
55
55
|
"@s_mart/tokens": "5.1.1",
|
|
56
|
-
"@s_mart/masks": "5.2.0",
|
|
57
56
|
"@s_mart/typed": "7.2.2",
|
|
58
|
-
"@s_mart/utils": "5.3.4"
|
|
57
|
+
"@s_mart/utils": "5.3.4",
|
|
58
|
+
"@s_mart/masks": "5.2.0"
|
|
59
59
|
},
|
|
60
60
|
"scripts": {
|
|
61
61
|
"build": "tsup src/index.tsx --minify --format esm --dts --external react",
|