@s_mart/form 11.0.2 → 16.0.0
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/checkbox/checkbox.d.ts +3 -0
- package/dist/checkbox/checkbox.types.d.ts +28 -0
- package/dist/components/fieldError/fieldError.d.ts +4 -0
- package/dist/components/fieldError/fieldError.types.d.ts +6 -0
- package/dist/components/fieldError/index.d.ts +2 -0
- package/dist/components/fieldInfo/fieldInfo.d.ts +3 -0
- package/dist/components/fieldInfo/fieldInfo.types.d.ts +3 -0
- package/dist/components/fieldInfo/index.d.ts +2 -0
- package/dist/components/fieldLabel/fieldLabel.d.ts +3 -0
- package/dist/components/fieldLabel/fieldLabel.types.d.ts +5 -0
- package/dist/components/fieldLabel/index.d.ts +2 -0
- package/dist/creatableV2/creatableV2.d.ts +4 -0
- package/dist/creatableV2/creatableV2.styles.d.ts +1 -0
- package/dist/creatableV2/creatableV2.types.d.ts +71 -0
- package/dist/datePicker/datePicker.d.ts +3 -0
- package/dist/datePicker/datePicker.styles.d.ts +1 -0
- package/dist/datePicker/datePicker.types.d.ts +33 -0
- package/dist/form/form.d.ts +22 -0
- package/dist/form/form.types.d.ts +20 -0
- package/dist/form/formProvider.d.ts +4 -0
- package/dist/form/useForm.d.ts +6 -0
- package/dist/formComponentPrecisaDeControl.d.ts +3 -0
- package/dist/index.d.ts +32 -0
- package/dist/index.mjs +828 -15
- package/dist/index.mjs.map +1 -0
- package/dist/radio/radioButton/radioButton.d.ts +3 -0
- package/dist/radio/radioButton/radioButton.types.d.ts +19 -0
- package/dist/radio/radioGroup/radioGroup.d.ts +3 -0
- package/dist/radio/radioGroup/radioGroup.types.d.ts +44 -0
- package/dist/searchableV2/searchableV2.d.ts +3 -0
- package/dist/searchableV2/searchableV2.types.d.ts +51 -0
- package/dist/selectV2/selectV2.d.ts +4 -0
- package/dist/selectV2/selectV2.types.d.ts +68 -0
- package/dist/selectV2/selectV2RenderValue.d.ts +3 -0
- package/dist/slider/slider.d.ts +3 -0
- package/dist/slider/slider.types.d.ts +20 -0
- package/dist/switch/switch.d.ts +3 -0
- package/dist/switch/switch.types.d.ts +28 -0
- package/dist/textField/textField.d.ts +3 -0
- package/dist/textField/textField.types.d.ts +43 -0
- package/dist/timePicker/timePicker.d.ts +3 -0
- package/dist/timePicker/timePicker.styles.d.ts +1 -0
- package/dist/timePicker/timePicker.types.d.ts +33 -0
- package/dist/utils/erroFieldFormatado.d.ts +2 -0
- package/dist/utils/typedMemo.d.ts +1 -0
- package/package.json +48 -48
- package/dist/index.d.mts +0 -523
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../src/utils/erroFieldFormatado.ts","../src/components/fieldError/fieldError.tsx","../src/components/fieldLabel/fieldLabel.tsx","../src/formComponentPrecisaDeControl.ts","../src/utils/typedMemo.ts","../src/checkbox/checkbox.tsx","../src/creatableV2/creatableV2.styles.ts","../src/components/fieldInfo/fieldInfo.tsx","../src/creatableV2/creatableV2.tsx","../src/datePicker/datePicker.styles.ts","../src/datePicker/datePicker.tsx","../src/form/formProvider.tsx","../src/form/useForm.ts","../src/form/form.tsx","../src/radio/radioGroup/radioGroup.tsx","../src/radio/radioButton/radioButton.tsx","../src/searchableV2/searchableV2.tsx","../src/selectV2/selectV2RenderValue.tsx","../src/selectV2/selectV2.tsx","../src/slider/slider.tsx","../src/switch/switch.tsx","../src/textField/textField.tsx","../src/timePicker/timePicker.styles.ts","../src/timePicker/timePicker.tsx"],"sourcesContent":["import type { FieldErrors, FieldValues } from 'react-hook-form';\n\nexport const erroFieldFormatado = (errors: FieldErrors<FieldValues>, name: string) => {\n const path = name.replace(/[[\\]]/g, '').split('.');\n\n return path.reduce((obj: Record<string, any>, key) => obj?.[key], errors);\n};\n","import { Indicator } from '@s_mart/core';\nimport type { FieldPath, FieldValues } from 'react-hook-form';\nimport { useFormState } from 'react-hook-form';\nimport { erroFieldFormatado } from '../../utils/erroFieldFormatado';\nimport type { FieldErrorProps } from './fieldError.types';\n\nconst FieldError = <\n TFieldValues extends FieldValues = FieldValues,\n TFieldNames extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n>({\n name,\n disableIcon,\n control,\n}: FieldErrorProps<TFieldValues, TFieldNames>) => {\n const formState = useFormState<TFieldValues>({ control, name });\n\n const erro = erroFieldFormatado(formState?.errors, name);\n\n if (!erro) {\n return null;\n }\n\n return (\n <Indicator severity='error' icon={disableIcon ? false : undefined}>\n {erro?.message}\n </Indicator>\n );\n};\n\nexport default FieldError;\n","import { Typography } from '@mui/material';\nimport { toRem } from '@s_mart/utils';\nimport type { FieldLabelProps } from './fieldLabel.types';\n\nconst FieldLabel = ({ label, required, regular }: FieldLabelProps) => {\n return (\n <span style={{ display: 'flex', alignItems: 'center', gap: toRem(2) }}>\n <Typography\n variant='caption'\n style={{ display: 'flex', alignItems: 'center' }}\n sx={{\n fontWeight: regular ? 400 : 700,\n }}\n >\n {label}\n </Typography>\n {required && (\n <Typography\n variant='caption'\n color='error'\n sx={{\n fontWeight: 900,\n }}\n >\n *\n </Typography>\n )}\n </span>\n );\n};\n\nexport default FieldLabel;\n","export class FormComponentPrecisaDeControl extends Error {\n constructor(componentName: string) {\n super(\n `O componente ${componentName} precisa de um control para funcionar. Passe o control como prop ou coloque o componente dentro de um <Form />`,\n );\n this.name = 'FormComponentPrecisaDeControl';\n }\n}\n","import { memo } from 'react';\n\nexport const typedMemo: <T>(c: T) => T = memo;\n","import { type FieldPath, type FieldValues, useController, useFormContext } from 'react-hook-form';\nimport type { CheckboxProps } from './checkbox.types';\nimport { Checkbox as CheckboxMui, FormControlLabel } from '@mui/material';\nimport { FieldError } from '../components/fieldError';\nimport { FieldLabel } from '../components/fieldLabel';\nimport { FormComponentPrecisaDeControl } from '../formComponentPrecisaDeControl';\nimport { typedMemo } from '../utils/typedMemo';\n\nconst Checkbox = ({\n // RHF\n name,\n rules,\n defaultValue,\n shouldUnregister,\n control: controlFromProps,\n // Component Props\n label,\n labelPlacement,\n required,\n disableIconError,\n onChange: onChangeProp,\n ...rest\n}: CheckboxProps) => {\n const controlFromContext = useFormContext()?.control;\n\n const control = controlFromProps ?? controlFromContext;\n\n if (!control) {\n throw new FormComponentPrecisaDeControl('Checkbox');\n }\n\n const { field } = useController({\n control,\n name,\n rules,\n defaultValue,\n shouldUnregister,\n });\n\n return (\n <span>\n <FormControlLabel\n control={\n <CheckboxMui\n key={name}\n checked={Boolean(field.value)}\n value={field.value ?? ''}\n defaultValue={field.value}\n onChange={(event, checked) => {\n field.onChange(event, checked);\n onChangeProp?.(event, checked);\n }}\n {...rest}\n />\n }\n label={<FieldLabel label={label} required={required} regular />}\n labelPlacement={labelPlacement || 'end'}\n />\n <FieldError name={name} disableIcon={disableIconError} control={control} />\n </span>\n );\n};\n\nexport default typedMemo(Checkbox);\n","import { css, styled } from '@mui/material';\nimport { toRem } from '@s_mart/utils';\n\nconst flexCenter = css`\n display: flex;\n align-items: center;\n justify-content: center;\n`;\n\nexport const SDivAutoComplete = styled('div')`\n display: flex;\n\n div.endAdornments {\n position: absolute;\n right: 0;\n\n ${flexCenter}\n }\n\n .MuiAutocomplete-endAdornment {\n position: relative;\n right: 0;\n }\n\n .endAdornments > .MuiAutocomplete-endAdornment {\n transform: translate(0, 0);\n }\n\n .creatable,\n .editable {\n ${flexCenter}\n\n .divider {\n width: 1px;\n height: ${toRem(20)};\n background-color: ${({ theme }) => theme.palette.grey[400]};\n }\n }\n`;\n","import { Tooltip } from '@mui/material';\nimport { LIcon } from '@s_mart/core';\nimport { lineInfoCircle } from '@s_mart/solid-icons';\nimport type { FieldInfoProps } from './fieldInfo.types';\n\nconst FieldInfo = ({ title }: FieldInfoProps) => {\n return (\n <Tooltip title={title} placement='top'>\n <div style={{ width: 'fit-content' }}>\n <LIcon icon={lineInfoCircle} color='#757575' />\n </div>\n </Tooltip>\n );\n};\n\nexport default FieldInfo;\n","import {\n forwardRef,\n type KeyboardEventHandler,\n type LegacyRef,\n type MouseEventHandler,\n useCallback,\n useState,\n} from 'react';\nimport {\n type FieldPath,\n type FieldPathValue,\n type FieldValues,\n useController,\n useFormContext,\n useFormState,\n} from 'react-hook-form';\nimport isObject from 'lodash-es/isObject';\nimport isEmpty from 'lodash-es/isEmpty';\nimport isEqual from 'lodash-es/isEqual';\nimport {\n Autocomplete,\n TextField,\n Divider,\n Button,\n type AutocompleteValue,\n IconButton,\n type AutocompleteInputChangeReason,\n type AutocompleteChangeReason,\n type AutocompleteChangeDetails,\n} from '@mui/material';\nimport { LIcon } from '@s_mart/core';\nimport { colorPalette } from '@s_mart/tokens';\nimport { linePlus, linePen } from '@s_mart/solid-icons';\nimport { toRem } from '@s_mart/utils';\nimport type { CreatableV2Props } from './creatableV2.types';\nimport { SDivAutoComplete } from './creatableV2.styles';\nimport { FieldLabel } from '../components/fieldLabel';\nimport { FieldError } from '../components/fieldError';\nimport { erroFieldFormatado } from '../utils/erroFieldFormatado';\nimport { FieldInfo } from '../components/fieldInfo';\nimport { typedMemo } from '../utils/typedMemo';\nimport { FormComponentPrecisaDeControl } from '../formComponentPrecisaDeControl';\n\nfunction CreatableV2<\n FieldValue,\n Multiple extends boolean | undefined = undefined,\n DisableClearable extends boolean | undefined = undefined,\n FreeSolo extends boolean | undefined = undefined,\n>(props: CreatableV2Props<FieldValue, Multiple, DisableClearable, FreeSolo>) {\n const {\n // RHF\n name,\n rules,\n defaultValue,\n shouldUnregister,\n control: controlFromProps,\n // Component Props\n label,\n required,\n options,\n footer,\n showCreatableButton = true,\n showEditableButton,\n onEditOption,\n onCreateOption,\n getOptionKey,\n getOptionLabel,\n getOptionAfterLabel,\n getInputValueLabel,\n multiple,\n info,\n noOptionsText = 'Nenhuma opção encontrada',\n onChange: onChangeProp,\n onInputChange,\n placeholder,\n ...rest\n } = props;\n\n const [curText, setCurText] = useState('');\n const controlFromContext = useFormContext()?.control;\n\n const control = controlFromProps ?? controlFromContext;\n\n if (!control) {\n throw new FormComponentPrecisaDeControl('CreatableV2');\n }\n\n const formState = useFormState({ control, name });\n\n const formattedError = erroFieldFormatado(formState.errors, name);\n const hideAddButton = !showCreatableButton || rest.disabled;\n\n const { field } = useController({\n name,\n control,\n rules,\n defaultValue,\n shouldUnregister,\n });\n\n const getRootRightPadding = (value: AutocompleteValue<FieldValue, Multiple, DisableClearable, FreeSolo>) => {\n let padding = 0;\n\n if (!props.slotProps?.textField?.slotProps?.input) padding += 2.5;\n\n if (!hideAddButton) {\n padding += 2.56;\n\n if (showEditButton(value)) padding += 2.56;\n }\n\n if (!rest.disableClearable && !rest.disabled) padding += 1.3;\n\n return `${padding}rem`;\n };\n\n const showEditButton = (value: AutocompleteValue<FieldValue, Multiple, DisableClearable, FreeSolo>) => {\n if (rest.disabled) return false;\n\n return showEditableButton && isObject(value) && !isEmpty(value);\n };\n\n const showCreateButton = () => {\n if (rest.disabled) return false;\n\n return showCreatableButton;\n };\n\n const handleCreateOption: MouseEventHandler<HTMLButtonElement> = useCallback(() => {\n if (typeof onCreateOption !== 'undefined') {\n onCreateOption(curText);\n setCurText('');\n }\n }, [curText, onCreateOption]);\n\n const handleEditOption: MouseEventHandler<HTMLButtonElement> = useCallback(() => {\n onEditOption?.(field.value);\n }, [field.value, onEditOption]);\n\n const handleInputChange = useCallback(\n (event: React.SyntheticEvent, value: string, reason: AutocompleteInputChangeReason) => {\n if (reason === 'input') {\n setCurText(value);\n onInputChange?.(value);\n }\n },\n [onInputChange],\n );\n\n const handleChange = useCallback(\n (_: React.SyntheticEvent, value: AutocompleteValue<FieldValue, Multiple, DisableClearable, FreeSolo>) => {\n setCurText('');\n field.onChange(value);\n onChangeProp?.(value);\n },\n [field.onChange, onChangeProp],\n );\n\n const handleBlur = useCallback(\n (event: React.FocusEvent<HTMLDivElement, Element>) => {\n rest?.onBlur?.(event);\n setCurText('');\n },\n [rest?.onBlur],\n );\n\n const fieldValue = !field.value ? (multiple ? [] : null) : field.value;\n\n return (\n <div style={{ display: 'flex', flexDirection: 'column' }}>\n <div style={{ display: 'flex' }}>\n {label && <FieldLabel label={label} required={required} />}\n {info && <FieldInfo title={info} />}\n </div>\n <SDivAutoComplete>\n <Autocomplete<FieldValue, Multiple, DisableClearable, FreeSolo>\n key={name}\n fullWidth\n onChange={handleChange}\n onInputChange={handleInputChange}\n onBlur={handleBlur}\n slotProps={{\n ...rest.slotProps,\n\n listbox: {\n component: forwardRef(function Ul(props, ref: LegacyRef<HTMLUListElement>) {\n return (\n <>\n <ul {...props} ref={ref} />\n\n {typeof footer !== 'undefined' ? (\n <div key='creatable-footer' {...props}>\n <div style={{ paddingTop: '0.5rem', paddingBottom: '0.5rem' }}>\n <Divider />\n </div>\n {footer()}\n </div>\n ) : null}\n </>\n );\n }),\n },\n }}\n value={fieldValue}\n options={options}\n multiple={multiple}\n readOnly={rest.disabled}\n noOptionsText={\n <>\n {noOptionsText}\n {!hideAddButton && (\n <Button\n sx={{\n justifyContent: 'flex-start',\n padding: `${toRem(6)} ${toRem(-16)}`,\n margin: 0,\n }}\n fullWidth\n onClick={handleCreateOption}\n variant='text'\n startIcon={<LIcon icon={linePlus} />}\n >\n Adicionar {`\"${curText}\"`}\n </Button>\n )}\n\n {typeof footer !== 'undefined' && (\n <>\n <div style={{ paddingTop: '0.5rem', paddingBottom: '0.5rem' }}>\n <Divider />\n </div>\n {footer()}\n </>\n )}\n </>\n }\n isOptionEqualToValue={(option, value) => isEqual(option, value)}\n getOptionLabel={getOptionAfterLabel ? getInputValueLabel || getOptionLabel : getOptionLabel}\n getOptionKey={getOptionKey}\n renderOption={\n typeof getOptionAfterLabel === 'function'\n ? (props, option) => {\n const afterlabel = getOptionAfterLabel(option);\n const key = getOptionKey(option);\n return (\n <li {...props} key={key}>\n <div style={{ display: 'flex', flexDirection: 'column', flex: 1 }}>\n <span>{getOptionLabel(option)}</span>\n {typeof afterlabel === 'string' ? <span>{afterlabel}</span> : afterlabel}\n </div>\n </li>\n );\n }\n : undefined\n }\n {...rest}\n sx={{\n '& div.MuiInputBase-root': {\n paddingRight: `${getRootRightPadding(field.value)} !important`,\n },\n ...rest.sx,\n }}\n renderInput={(params) => (\n <TextField\n placeholder={placeholder}\n {...params}\n error={Boolean(formattedError)}\n {...props.slotProps?.textField}\n slotProps={{\n ...params.slotProps,\n\n input: {\n ...params.slotProps.input,\n ...props.slotProps?.textField?.slotProps?.input,\n inputRef: field.ref,\n\n endAdornment: (\n <div className='endAdornments'>\n {params.slotProps.input.endAdornment}\n\n {/* biome-ignore lint/suspicious/noExplicitAny: A tipagem do MUI não funciona com props, porém ao usar o componente, a tipagem é inferida corretamente */}\n {(props.slotProps?.textField?.slotProps?.input as Record<string, any>)?.endAdornment ?? null}\n {showEditButton(field.value) ? (\n <div className='editable'>\n <div className='divider' />\n <IconButton size='small' onClick={handleEditOption} sx={{ mx: '3px' }} tabIndex={-1}>\n <LIcon icon={linePen} size='24px' removeMargin />\n </IconButton>\n </div>\n ) : null}\n {showCreateButton() && (\n <div className='creatable'>\n <div className='divider' />\n <IconButton size='small' onClick={handleCreateOption} sx={{ mx: '3px' }} tabIndex={-1}>\n <LIcon icon={linePlus} size='24px' removeMargin />\n </IconButton>\n </div>\n )}\n </div>\n ),\n }\n }}\n />\n )}\n />\n </SDivAutoComplete>\n <FieldError name={name} control={control} />\n </div>\n );\n}\n\nexport default typedMemo(CreatableV2);\n","import { type IconButtonProps, IconButton, styled } from '@mui/material';\nimport { toRem } from '@s_mart/utils';\n\nconst _svgSize = (size: IconButtonProps['size']) => {\n switch (size) {\n case 'small':\n return toRem(16);\n case 'large':\n return toRem(24);\n default:\n return toRem(20);\n }\n};\n\nconst _padding = (size: IconButtonProps['size']) => {\n switch (size) {\n case 'small':\n return `${toRem(2)} ${toRem(8)}`;\n case 'large':\n return `${toRem(10)}`;\n default:\n return `${toRem(6)} ${toRem(8)}`;\n }\n};\n\nexport const SIconButton = styled(IconButton)`\n margin: 0px;\n\n padding: ${({ size }) => _padding(size)};\n border-radius: 0 ${toRem(4)} ${toRem(4)} 0;\n\n svg {\n width: ${({ size }) => _svgSize(size)} !important;\n }\n`;\n","import { composeValidators, date } from '@s_mart/rules';\n\nimport { Stack } from '@mui/material';\nimport { DatePicker as DatePickerMui } from '@mui/x-date-pickers';\nimport { AdapterDayjs } from '@mui/x-date-pickers/AdapterDayjs';\nimport { LocalizationProvider } from '@mui/x-date-pickers/LocalizationProvider';\nimport { ptBR } from '@mui/x-date-pickers/locales';\nimport { useController, useFormContext, useFormState } from 'react-hook-form';\n\nimport { FieldError } from '../components/fieldError';\nimport { FieldLabel } from '../components/fieldLabel';\nimport { FormComponentPrecisaDeControl } from '../formComponentPrecisaDeControl';\nimport { erroFieldFormatado } from '../utils/erroFieldFormatado';\nimport { typedMemo } from '../utils/typedMemo';\nimport { SIconButton } from './datePicker.styles';\nimport type { DatePickerProps } from './datePicker.types';\n\nimport 'dayjs/locale/pt-br';\n\nconst DatePicker = ({\n // RHF\n rules,\n name,\n defaultValue,\n shouldUnregister,\n control: controlFromProps,\n // Component Props\n label,\n required,\n disabled,\n disableIconError,\n size,\n ...rest\n}: DatePickerProps) => {\n const controlFromContext = useFormContext()?.control;\n\n const control = controlFromProps ?? controlFromContext;\n\n if (!control) {\n throw new FormComponentPrecisaDeControl('DatePicker');\n }\n\n const formState = useFormState({ control, name });\n const formattedError = erroFieldFormatado(formState.errors, name);\n const dateFormat = rest?.format || 'DD/MM/YYYY';\n const newRules = rules ? composeValidators([date(dateFormat), rules as any]) : date(dateFormat);\n\n const { field } = useController({\n control,\n name,\n rules: newRules,\n defaultValue,\n shouldUnregister,\n });\n\n return (\n <LocalizationProvider\n dateAdapter={AdapterDayjs}\n localeText={ptBR.components.MuiLocalizationProvider.defaultProps.localeText}\n >\n <Stack>\n {label && <FieldLabel label={label} required={required} />}\n <DatePickerMui\n {...rest}\n key={name}\n value={field.value ?? null}\n format={dateFormat}\n onChange={(value, context) => {\n field.onChange(value, context);\n rest?.onChange?.(value, context);\n }}\n disabled={disabled}\n slots={{\n openPickerButton: SIconButton,\n }}\n slotProps={{\n ...rest?.slotProps,\n textField: {\n error: Boolean(formattedError),\n size,\n ...rest.slotProps?.textField,\n slotProps: {\n ...(rest.slotProps?.textField as any)?.slotProps,\n input: {\n ...(rest.slotProps?.textField as any)?.slotProps?.input,\n inputRef: field.ref,\n },\n },\n },\n }}\n />\n <FieldError name={name} disableIcon={disableIconError} control={control} />\n </Stack>\n </LocalizationProvider>\n );\n};\n\nexport default typedMemo(DatePicker);\n","import { type FieldValues, FormProvider as HookFormProvider } from 'react-hook-form';\n\nimport type { IFormProviderProps } from './form.types';\n\nfunction FormProvider<TFieldValues extends FieldValues>({\n children,\n style,\n onSubmit,\n ...methods\n}: IFormProviderProps<TFieldValues>) {\n return (\n <HookFormProvider<TFieldValues> {...methods}>\n <form\n onSubmit={(e) => {\n e.preventDefault();\n e.stopPropagation();\n onSubmit(e);\n }}\n style={style}\n >\n {children}\n </form>\n </HookFormProvider>\n );\n}\n\nexport default FormProvider;\n","import { useEffect } from 'react';\n\nimport { type FieldValues, type Resolver, type UseFormReturn, useForm as useHookForm } from 'react-hook-form';\nimport { zodResolver } from '@hookform/resolvers/zod';\n\nimport type { IUseFormProps } from './form.types';\n\nconst useForm = <TValues extends FieldValues>({\n disableDefaultValuesUpdate,\n onSubmit,\n ...rest\n}: IUseFormProps<TValues>): UseFormReturn<TValues> & { onSubmit: (e?: React.BaseSyntheticEvent) => Promise<void> } => {\n const methods = useHookForm<TValues>({\n ...rest,\n resolver: rest.schema && (zodResolver(rest.schema) as unknown as Resolver<TValues>),\n });\n\n useEffect(() => {\n if (!disableDefaultValuesUpdate) methods.reset(rest.defaultValues as TValues);\n }, [rest.defaultValues, methods.reset]);\n\n return { ...methods, onSubmit: methods.handleSubmit((data) => onSubmit(data, methods)) };\n};\n\nexport default useForm;\n","import type { JSX } from 'react';\n\nimport type { FieldValues } from 'react-hook-form';\n\nimport type { IFormProps } from './form.types';\nimport FormProvider from './formProvider';\nimport useForm from './useForm';\n\n/**\n * Utilizado overloading para poder passar uma tipagem para o Componente\n * @example\n * // Não passar uma tipagem, todas as props terão o funcionamento normal, sem tipagem\n * <Form onSubmit={({email}) => {}}>\n * ...\n * </Form>\n * @example\n * // Passar uma tipagem, todas as props derivadas do react-hook-form terão a tipagem passada no generic\n * type Cadastro = {\n * email: string;\n * }\n * <Form<Cadastro> onSubmit={({email}) => {}}>\n * ...\n * </Form>\n */\nfunction Form(props: IFormProps<any>): JSX.Element;\nfunction Form<T extends FieldValues>(props: IFormProps<T>): JSX.Element;\n\nfunction Form<T extends FieldValues>({ children, style, ...useFormProps }: IFormProps<T>) {\n const methods = useForm<T>(useFormProps);\n\n return (\n <FormProvider {...methods} style={style}>\n {typeof children === 'function' ? children(methods) : children}\n </FormProvider>\n );\n}\n\nexport default Form;\n","import { RadioGroup as RadioGroupMui, Stack } from '@mui/material';\nimport { type FieldPath, type FieldValues, useController, useFormContext } from 'react-hook-form';\nimport { FieldError } from '../../components/fieldError';\nimport { FieldLabel } from '../../components/fieldLabel';\nimport type { RadioGroupProps } from './radioGroup.types';\nimport { FormComponentPrecisaDeControl } from '../../formComponentPrecisaDeControl';\n\nconst RadioGroup = ({\n // RHF\n name,\n rules,\n defaultValue,\n shouldUnregister,\n control: controlFromProps,\n // Component Props\n label,\n required,\n children,\n orientation = 'row',\n disableIconError,\n ...rest\n}: RadioGroupProps) => {\n const controlFromContext = useFormContext()?.control;\n\n const control = controlFromProps ?? controlFromContext;\n\n if (!control) {\n throw new FormComponentPrecisaDeControl('RadioGroup');\n }\n\n const { field } = useController({\n control,\n name,\n rules,\n defaultValue,\n shouldUnregister,\n });\n\n return (\n <Stack>\n {label && <FieldLabel label={label} required={required} />}\n <RadioGroupMui\n key={name}\n value={field.value || ''}\n name={name}\n {...rest}\n onChange={(e) => {\n rest?.onChange?.(e, e.target?.value);\n field.onChange(e);\n }}\n style={{\n display: 'flex',\n flexDirection: orientation,\n }}\n >\n {children}\n </RadioGroupMui>\n <FieldError name={name} disableIcon={disableIconError} control={control} />\n </Stack>\n );\n};\n\nexport default RadioGroup;\n","import { FormControlLabel, Grid, Radio as RadioMui } from '@mui/material';\nimport type { RadioProps } from './radioButton.types';\nimport { FieldLabel } from '../../components/fieldLabel';\n\nconst RadioButton = ({ label, labelPlacement, ...rest }: RadioProps) => {\n return (\n <Grid\n sx={{\n display: 'flex',\n flexDirection: 'column',\n }}\n >\n <FormControlLabel\n control={<RadioMui {...rest} />}\n label={<FieldLabel label={label} />}\n labelPlacement={labelPlacement || 'end'}\n />\n </Grid>\n );\n};\n\nexport default RadioButton;\n","import { Autocomplete, Divider, TextField } from '@mui/material';\nimport { colorPalette } from '@s_mart/tokens';\nimport isEqual from 'lodash-es/isEqual';\nimport { forwardRef, type LegacyRef } from 'react';\nimport {\n type FieldPath,\n type FieldPathValue,\n type FieldValues,\n useController,\n useFormContext,\n useFormState,\n} from 'react-hook-form';\nimport { FieldError } from '../components/fieldError';\nimport { FieldInfo } from '../components/fieldInfo';\nimport { FieldLabel } from '../components/fieldLabel';\nimport { erroFieldFormatado } from '../utils/erroFieldFormatado';\nimport { typedMemo } from '../utils/typedMemo';\nimport type { SearchableV2Props } from './searchableV2.types';\nimport { FormComponentPrecisaDeControl } from '../formComponentPrecisaDeControl';\nimport type { AutocompleteValue } from '@mui/material';\n\nconst SearchableV2 = <\n FieldValue,\n Multiple extends boolean | undefined = undefined,\n DisableClearable extends boolean | undefined = undefined,\n FreeSolo extends boolean | undefined = undefined,\n>(\n props: SearchableV2Props<FieldValue, Multiple, DisableClearable, FreeSolo>,\n) => {\n const {\n // RHF\n name,\n rules,\n defaultValue,\n shouldUnregister,\n control: controlFromProps,\n // Component Props\n label,\n required,\n options,\n textFieldProps,\n noOptionsText,\n footer,\n multiple,\n info,\n placeholder,\n onChange: onChangeProp,\n onInputChange,\n getOptionAfterLabel,\n getOptionLabel,\n getInputValueLabel,\n getOptionKey,\n ...rest\n } = props;\n\n const controlFromContext = useFormContext()?.control;\n\n const control = controlFromProps ?? controlFromContext;\n\n if (!control) {\n throw new FormComponentPrecisaDeControl('SearchableV2');\n }\n\n const formState = useFormState({ control, name });\n\n const formattedError = erroFieldFormatado(formState.errors, name);\n\n const { field } = useController({\n name,\n control,\n rules,\n defaultValue,\n shouldUnregister,\n });\n\n const fieldValue = !field.value ? (multiple ? [] : null) : field.value;\n\n return (\n <div style={{ display: 'flex', flexDirection: 'column' }}>\n <div style={{ display: 'flex' }}>\n {label && <FieldLabel label={label} required={required} />}\n {info && <FieldInfo title={info} />}\n </div>\n <Autocomplete<FieldValue, Multiple, DisableClearable, FreeSolo>\n key={name}\n onChange={(_, value) => {\n field.onChange(value);\n onChangeProp?.(value);\n }}\n onInputChange={(_, value, reason) => {\n if (reason === 'input') {\n onInputChange?.(value);\n }\n }}\n value={fieldValue}\n options={options}\n multiple={multiple}\n readOnly={rest.disabled}\n slotProps={{\n ...rest.slotProps,\n\n listbox: {\n component: forwardRef(function Ul(props, ref: LegacyRef<HTMLUListElement>) {\n return (\n <>\n <ul {...props} ref={ref} />\n\n {typeof footer !== 'undefined' ? (\n <div key='searchable-footer' {...props}>\n <div style={{ paddingTop: '0.5rem', paddingBottom: '0.5rem' }}>\n <Divider />\n </div>\n {footer()}\n </div>\n ) : null}\n </>\n );\n }),\n },\n }}\n noOptionsText={\n <>\n {noOptionsText || 'Nenhuma opção encontrada'}\n {typeof footer !== 'undefined' ? (\n <>\n <div style={{ paddingTop: '0.5rem', paddingBottom: '0.5rem' }}>\n <Divider />\n </div>\n {footer()}\n </>\n ) : null}\n </>\n }\n isOptionEqualToValue={(option, value) => isEqual(option, value)}\n getOptionLabel={getOptionAfterLabel ? getInputValueLabel || getOptionLabel : getOptionLabel}\n getOptionKey={getOptionKey}\n renderOption={\n typeof getOptionAfterLabel === 'function'\n ? (props, option) => {\n const afterlabel = getOptionAfterLabel(option);\n const key = getOptionKey(option);\n return (\n <li {...props} key={key}>\n <div style={{ display: 'flex', flexDirection: 'column', flex: 1 }}>\n <span>{getOptionLabel(option)}</span>\n {typeof afterlabel === 'string' ? <span>{afterlabel}</span> : afterlabel}\n </div>\n </li>\n );\n }\n : undefined\n }\n {...rest}\n renderInput={(params) => {\n return (\n <TextField\n error={Boolean(formattedError)}\n placeholder={placeholder}\n {...params}\n {...textFieldProps}\n inputRef={field.ref}\n />\n );\n }}\n />\n <FieldError name={name} control={control} />\n </div>\n );\n};\n\nexport default typedMemo(SearchableV2);\n","import { colorPalette } from '@s_mart/tokens';\nimport type { FieldPath, FieldValues } from 'react-hook-form';\nimport type { SelectV2ReturnValueProps } from './selectV2.types';\n\n\n\nexport const SelectV2RenderValue = <\n TFieldValues extends FieldValues = FieldValues,\n TFieldName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n>({\n value,\n placeholder,\n getOptionLabel,\n}: SelectV2ReturnValueProps<TFieldValues, TFieldName>) => {\n if (value === null || value?.length === 0) {\n return <p style={{ color: colorPalette.neutral[100] }}>{placeholder}</p>;\n }\n\n return getOptionLabel(value);\n};\n","import { useState } from 'react';\nimport {\n type FieldPath,\n type FieldPathValue,\n type FieldValues,\n useController,\n useFormContext,\n useFormState,\n} from 'react-hook-form';\nimport { IconButton, LIcon } from '@s_mart/core';\nimport { lineTimes } from '@s_mart/regular-icons';\nimport { colorPalette } from '@s_mart/tokens';\nimport { Select as SelectMui, MenuItem, Divider } from '@mui/material';\nimport { FieldLabel } from '../components/fieldLabel';\nimport { FieldError } from '../components/fieldError';\nimport { FieldInfo } from '../components/fieldInfo';\nimport { erroFieldFormatado } from '../utils/erroFieldFormatado';\nimport type { SelectV2Props } from './selectV2.types';\nimport { typedMemo } from '../utils/typedMemo';\nimport { SelectV2RenderValue } from './selectV2RenderValue';\nimport { FormComponentPrecisaDeControl } from '../formComponentPrecisaDeControl';\n\nconst SelectV2 = <FieldValue extends FieldValues | string | number>(props: SelectV2Props<FieldValue>) => {\n const {\n // RHF\n name,\n rules,\n defaultValue,\n shouldUnregister,\n control: controlFromProps,\n // Component Props\n label,\n required,\n options,\n placeholder,\n clearable,\n info,\n footer,\n onChange: onChangeProp,\n variant = 'outlined',\n getOptionKey,\n getOptionLabel,\n getOptionAfterLabel,\n getInputValueLabel,\n getOptionIcon,\n ...rest\n } = props;\n\n const controlFromContext = useFormContext()?.control;\n\n const control = controlFromProps ?? controlFromContext;\n\n const [showSelect, setShowSelect] = useState(false);\n\n if (!control) {\n throw new FormComponentPrecisaDeControl('SelectV2');\n }\n\n const formState = useFormState({ control, name });\n\n const formattedError = erroFieldFormatado(formState.errors, name);\n\n const { field } = useController({\n control,\n name,\n rules,\n defaultValue,\n shouldUnregister,\n });\n\n return (\n <div style={{ display: 'flex', flexDirection: 'column' }}>\n <div style={{ display: 'flex' }}>\n {label && <FieldLabel label={label} required={required} />}\n {info && <FieldInfo title={info} />}\n </div>\n <SelectMui<FieldValue>\n key={name}\n open={showSelect}\n onOpen={() => setShowSelect(true)}\n onClose={() => setShowSelect(false)}\n displayEmpty={Boolean(placeholder)}\n variant={variant}\n autoComplete='off'\n value={field.value || null}\n renderValue={(value) => {\n return (\n <SelectV2RenderValue\n getOptionLabel={\n getOptionAfterLabel ? getInputValueLabel || getOptionLabel : getOptionLabel\n }\n placeholder={placeholder}\n value={value}\n />\n );\n }}\n onChange={(e) => {\n field.onChange(e.target.value);\n onChangeProp?.(e.target.value as FieldValue);\n }}\n error={Boolean(formattedError)}\n size={rest.size || 'medium'}\n inputRef={field.ref}\n {...rest}\n endAdornment={\n <>\n {rest.endAdornment}\n\n {Boolean(clearable && field.value) && (\n <IconButton\n variant='text'\n color='neutral'\n size='small'\n sx={{ borderRadius: '50%', position: 'absolute', right: '2rem' }}\n style={{ padding: 0 }}\n aria-label='Limpar'\n title='Limpar'\n onClick={() => {\n field.onChange(null);\n onChangeProp?.(null);\n }}\n >\n <LIcon icon={lineTimes} color={colorPalette.neutral[100]} size='25px' removeMargin />\n </IconButton>\n )}\n </>\n }\n >\n {options.map((option) => {\n const key = getOptionKey(option);\n const label = getOptionLabel(option);\n const icon = getOptionIcon?.(option);\n return (\n <MenuItem key={key} value={option as any}>\n <div style={{ display: 'flex', flexDirection: 'column', flex: 1 }}>\n {icon !== undefined ? (\n <div style={{ display: 'flex', alignItems: 'center' }}>\n {icon}\n {label}\n </div>\n ) : (\n label\n )}\n <span>{getOptionAfterLabel?.(option) ?? null}</span>\n </div>\n </MenuItem>\n );\n })}\n {footer !== undefined && (\n <div key='footer'>\n <div key='footer-divider' style={{ padding: '8px 16px' }}>\n <Divider />\n </div>\n <div key='footer-content'>{footer({ closeSelect: () => setShowSelect(false) })}</div>\n </div>\n )}\n </SelectMui>\n <FieldError name={name} control={control} />\n </div>\n );\n};\n\nexport default typedMemo(SelectV2);\n","import { type FieldPath, type FieldValues, useController, useFormContext } from 'react-hook-form';\nimport type { SliderProps } from './slider.types';\nimport { Slider as SliderMui } from '@mui/material';\nimport { FormComponentPrecisaDeControl } from '../formComponentPrecisaDeControl';\n\nconst Slider = ({ name, rules, defaultValue, shouldUnregister, control: controlFromProps, ...rest }: SliderProps) => {\n const controlFromContext = useFormContext()?.control;\n\n const control = controlFromProps ?? controlFromContext;\n\n if (!control) {\n throw new FormComponentPrecisaDeControl('Slider');\n }\n\n const { field } = useController({\n control,\n name,\n rules,\n defaultValue,\n shouldUnregister,\n });\n\n return (\n <SliderMui\n key={name}\n value={field.value || rest?.min || 0}\n onChange={field.onChange}\n valueLabelDisplay='auto'\n {...rest}\n />\n );\n};\n\nexport default Slider;\n","import { FormControlLabel, Stack, Switch as SwitchMui } from '@mui/material';\nimport { useController, useFormContext } from 'react-hook-form';\nimport { FieldError } from '../components/fieldError';\nimport { FieldLabel } from '../components/fieldLabel';\nimport type { SwitchProps } from './switch.types';\nimport { FormComponentPrecisaDeControl } from '../formComponentPrecisaDeControl';\nimport { typedMemo } from '../utils/typedMemo';\nimport { useCallback } from 'react';\n\nconst Switch = ({\n // RHF\n name,\n rules,\n defaultValue,\n defaultChecked,\n shouldUnregister,\n control: controlFromProps,\n // Component Props\n label,\n labelPlacement = 'end',\n disableIconError,\n onChange: onChangeProp,\n ...rest\n}: SwitchProps) => {\n const controlFromContext = useFormContext()?.control;\n\n const control = controlFromProps ?? controlFromContext;\n\n if (!control) {\n throw new FormComponentPrecisaDeControl('Switch');\n }\n\n const { field } = useController<Record<string, boolean>>({\n control,\n name,\n rules,\n defaultValue: defaultChecked ?? defaultValue ?? false,\n shouldUnregister,\n });\n\n const handleChange = useCallback(\n (event: React.ChangeEvent<HTMLInputElement>, checked: boolean) => {\n field.onChange(checked);\n onChangeProp?.(event, checked);\n },\n [field, onChangeProp],\n );\n\n return (\n <Stack>\n <FormControlLabel\n control={<SwitchMui {...rest} {...field} checked={Boolean(field.value)} onChange={handleChange} />}\n label={<FieldLabel label={label} />}\n labelPlacement={labelPlacement}\n />\n <FieldError name={name} disableIcon={disableIconError} control={control} />\n </Stack>\n );\n};\n\nexport default Switch;\n","import { Grid, InputAdornment, Stack, TextField as TextFieldMui, Tooltip } from '@mui/material';\nimport { LIcon } from '@s_mart/core';\nimport * as masks from '@s_mart/masks';\nimport { lineEye, lineEyeSlash, lineInfoCircle } from '@s_mart/solid-icons';\nimport { useRef, useState } from 'react';\nimport { type FieldPath, type FieldValues, useController, useFormContext, useFormState } from 'react-hook-form';\nimport { FieldError } from '../components/fieldError';\nimport { FieldLabel } from '../components/fieldLabel';\nimport { erroFieldFormatado } from '../utils/erroFieldFormatado';\nimport type { TextFieldProps } from './textField.types';\nimport { FormComponentPrecisaDeControl } from '../formComponentPrecisaDeControl';\nimport { typedMemo } from '../utils/typedMemo';\n\nconst TextField = ({\n // RHF\n name,\n rules,\n defaultValue,\n shouldUnregister,\n control: controlFromProps,\n // Component Props\n label,\n required,\n mask,\n variant = 'outlined',\n info,\n parse,\n format,\n onInputChange,\n disableIconError,\n ...rest\n}: TextFieldProps) => {\n const controlFromContext = useFormContext()?.control;\n\n const control = controlFromProps ?? controlFromContext;\n\n const previousValue = useRef<string | undefined>(defaultValue || undefined);\n\n if (!control) {\n throw new FormComponentPrecisaDeControl('TextField');\n }\n\n const [showPassword, setShowPassword] = useState(false);\n\n const _handleFormat = (value: string) => {\n let _value = value;\n\n _value = format?.(value) ?? value;\n\n if (mask) {\n return masks?.[mask]?.format(_value);\n }\n\n return _value;\n };\n\n const handleParse = (value: string) => {\n let _value = value;\n\n _value = parse?.(value) ?? _value;\n\n if (mask) {\n return masks?.[mask]?.parse(_value, previousValue.current);\n }\n return _value;\n };\n\n const onKeyDown = (event?: React.KeyboardEvent<HTMLInputElement | HTMLTextAreaElement>): void => {\n if (!event) return;\n\n if (mask !== 'porcentagem' && mask !== 'porcentagem0') {\n return;\n }\n\n event?.stopPropagation();\n\n const value = (event?.target as HTMLInputElement).value;\n\n if (value) {\n const str = String(value);\n\n if (str.length > 0) {\n const percentIndex = str.indexOf('%');\n\n if (percentIndex > -1) {\n event.currentTarget.selectionEnd = percentIndex;\n }\n }\n }\n };\n\n const { field } = useController({\n control,\n name,\n rules,\n defaultValue,\n shouldUnregister,\n });\n\n const formState = useFormState({ control, name });\n\n const formattedError = erroFieldFormatado(formState.errors, name);\n\n return (\n <Stack>\n <div style={{ display: 'flex' }}>\n {label && (\n <div>\n <FieldLabel label={label} required={required} />\n </div>\n )}\n {info && (\n <div>\n <Tooltip title={info} placement='top'>\n <div style={{ width: 'fit-content' }}>\n <LIcon icon={lineInfoCircle} color='#757575' />\n </div>\n </Tooltip>\n </div>\n )}\n </div>\n <TextFieldMui\n key={name}\n variant={variant}\n defaultValue={defaultValue}\n // biome-ignore lint/suspicious/noDoubleEquals: Comparamos com != pois pode ser que o valor seja '0' ou 0\n value={_handleFormat(field.value || (field.value != 0 ? '' : field.value))}\n onChange={(e) => {\n const parsedValue = handleParse(e?.target?.value);\n field.onChange(parsedValue);\n onInputChange?.(parsedValue);\n\n previousValue.current = e.target.value;\n }}\n error={Boolean(formattedError)}\n {...rest}\n type={rest.type === 'password' ? (showPassword ? 'text' : 'password') : rest.type}\n autoComplete={rest.autoComplete || 'off'}\n slotProps={{\n ...rest.slotProps,\n input: {\n onKeyDown,\n inputRef: field.ref,\n endAdornment: rest.type === 'password' && (\n <InputAdornment\n position='start'\n onClick={() => setShowPassword(!showPassword)}\n style={{ cursor: 'pointer' }}\n >\n <LIcon icon={showPassword ? lineEye : lineEyeSlash} size='24px' removeMargin />\n </InputAdornment>\n ),\n ...rest.slotProps?.input,\n },\n }}\n />\n <FieldError name={name} disableIcon={disableIconError} control={control} />\n </Stack>\n );\n};\n\nexport default typedMemo(TextField);\n","import { type BaseTextFieldProps, type IconButtonProps, styled } from '@mui/material';\nimport { IconButton } from '@mui/material';\n\nimport { toRem } from '@s_mart/utils';\n\nconst _svgSize = (size: IconButtonProps['size']) => {\n switch (size) {\n case 'small':\n return toRem(16);\n case 'large':\n return toRem(24);\n default:\n return toRem(20);\n }\n};\n\nconst _padding = (size: IconButtonProps['size']) => {\n switch (size) {\n case 'small':\n return `${toRem(2)} ${toRem(8)}`;\n case 'large':\n return toRem(10);\n default:\n return `${toRem(6)} ${toRem(8)}`;\n }\n};\n\nexport const SIconButton = styled(IconButton)`\n margin: 0px;\n\n padding: ${({ size }) => _padding(size)};\n border-radius: 0 ${toRem(4)} ${toRem(4)} 0;\n\n svg {\n width: ${({ size }) => _svgSize(size)} !important;\n }\n`;\n","import { composeValidators, time } from '@s_mart/rules';\n\nimport { Stack } from '@mui/material';\nimport { AdapterDayjs } from '@mui/x-date-pickers/AdapterDayjs';\nimport { LocalizationProvider } from '@mui/x-date-pickers/LocalizationProvider';\nimport { TimePicker as TimePickerMui } from '@mui/x-date-pickers/TimePicker';\nimport { useController, useFormContext, useFormState } from 'react-hook-form';\n\nimport { FieldError } from '../components/fieldError';\nimport { FieldLabel } from '../components/fieldLabel';\nimport { FormComponentPrecisaDeControl } from '../formComponentPrecisaDeControl';\nimport { erroFieldFormatado } from '../utils/erroFieldFormatado';\nimport { typedMemo } from '../utils/typedMemo';\nimport { SIconButton } from './timePicker.styles';\nimport type { TimePickerProps } from './timePicker.types';\n\nimport 'dayjs/locale/pt-br';\n\nconst TimePicker = ({\n // RHF\n rules,\n defaultValue,\n shouldUnregister,\n name,\n control: controlFromProps,\n // Component Props\n required,\n label,\n disabled,\n disableIconError,\n size,\n ...rest\n}: TimePickerProps) => {\n const controlFromContext = useFormContext()?.control;\n\n const control = controlFromProps ?? controlFromContext;\n\n if (!control) {\n throw new FormComponentPrecisaDeControl('TimePicker');\n }\n\n const formState = useFormState({ control, name });\n\n const formattedError = erroFieldFormatado(formState.errors, name);\n\n const timeFormat = rest.format || 'HH:mm';\n const newRules = rules ? composeValidators([time(timeFormat), rules as any]) : time(timeFormat);\n\n const { field } = useController({\n control,\n name,\n rules: newRules,\n defaultValue,\n shouldUnregister,\n });\n\n return (\n <LocalizationProvider dateAdapter={AdapterDayjs}>\n <Stack>\n {label && <FieldLabel label={label} required={required} />}\n <TimePickerMui\n key={name}\n ampm={false}\n format={timeFormat}\n value={field.value ?? null}\n disabled={disabled}\n {...rest}\n onChange={(value, context) => {\n field.onChange(value, context);\n rest?.onChange?.(value, context);\n }}\n slots={{\n openPickerButton: SIconButton,\n }}\n slotProps={{\n ...rest.slotProps,\n textField: {\n error: Boolean(formattedError),\n size,\n ...rest.slotProps?.textField,\n slotProps: {\n ...(rest.slotProps?.textField as any)?.slotProps,\n input: {\n ...(rest.slotProps?.textField as any)?.slotProps?.input,\n inputRef: field.ref,\n },\n },\n },\n actionBar: {\n actions: [],\n ...rest.slotProps?.actionBar,\n },\n }}\n />\n <FieldError name={name} disableIcon={disableIconError} control={control} />\n </Stack>\n </LocalizationProvider>\n );\n};\n\nexport default typedMemo(TimePicker);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAEA,IAAa,KAAsB,GAAkC,MACtD,EAAK,QAAQ,UAAU,EAAE,CAAC,CAAC,MAAM,GAEvC,CAAA,CAAK,QAAQ,GAA0B,MAAQ,IAAM,IAAM,CAAM,GCCpE,KAGJ,EACA,SACA,gBACA,iBACgD;CAGhD,IAAM,IAAO,EAFK,EAA2B;EAAE;EAAS;CAAK,CAE7B,CAAA,EAAW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,CAAI,GAE1D,IAAa,EAAK,UAAU,SAC5B,IAAW,IAAQ,EAAkB,CAAC,EAAK,CAAU,GAAG,CAAY,CAAC,IAAI,EAAK,CAAU,GAExF,EAAE,aAAU,EAAc;EAC9B;EACA;EACA,OAAO;EACP;EACA;CACF,CAAC;CAED,OACE,kBAAC,GAAD;EAAsB,aAAa;EACjC,UAAA,kBAAC,GAAD,EAAA,UAAA;GACG,KAAS,kBAAC,GAAD;IAAmB;IAAiB;GAAW,CAAA;GACzD,kBAAC,IAAD;IAEE,MAAM;IACN,QAAQ;IACR,OAAO,EAAM,SAAS;IACZ;IACV,GAAI;IACJ,WAAW,GAAO,MAAY;KAE5B,AADA,EAAM,SAAS,GAAO,CAAO,GAC7B,GAAM,WAAW,GAAO,CAAO;IACjC;IACA,OAAO,EACL,kBAAkB,GACpB;IACA,WAAW;KACT,GAAG,EAAK;KACR,WAAW;MACT,OAAO,EAAQ;MACf;MACA,GAAG,EAAK,WAAW;MACnB,WAAW;OACT,GAAI,EAAK,WAAW,WAAmB;OACvC,OAAO;QACL,IAAI,EAAK,WAAW,UAAA,EAAmB,WAAW;QAClD,UAAU,EAAM;OAClB;MACF;KACF;KACA,WAAW;MACT,SAAS,CAAC;MACV,GAAG,EAAK,WAAW;KACrB;IACF;GACD,GAhCM,CAgCN;GACD,kBAAC,GAAD;IAAkB;IAAM,aAAa;IAA2B;GAAU,CAAA;EACrE,EAAA,CAAA;CACa,CAAA;AAE1B,CAEmC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { RadioProps as RadioPropsMui } from '@mui/material';
|
|
2
|
+
export type RadioProps = RadioPropsMui & {
|
|
3
|
+
/**
|
|
4
|
+
* O nome do checkbox que será renderizado na tela
|
|
5
|
+
* @default ''
|
|
6
|
+
* @example 'Nome do checkbox'
|
|
7
|
+
* @type React.ReactNode
|
|
8
|
+
* @memberof RadioProps
|
|
9
|
+
*/
|
|
10
|
+
label?: React.ReactNode;
|
|
11
|
+
/**
|
|
12
|
+
* Posição do label em relação ao checkbox
|
|
13
|
+
* @default 'end'
|
|
14
|
+
* @type 'start' | 'end' | 'top' | 'bottom'
|
|
15
|
+
* @example
|
|
16
|
+
* <Radio label="Radio" labelPlacement="start" />
|
|
17
|
+
*/
|
|
18
|
+
labelPlacement?: 'start' | 'end' | 'top' | 'bottom';
|
|
19
|
+
};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { RadioGroupProps } from './radioGroup.types';
|
|
2
|
+
declare const RadioGroup: ({ name, rules, defaultValue, shouldUnregister, control: controlFromProps, label, required, children, orientation, disableIconError, ...rest }: RadioGroupProps) => import("react").JSX.Element;
|
|
3
|
+
export default RadioGroup;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { RadioGroupProps as RadioGroupPropsMui } from '@mui/material';
|
|
2
|
+
import { UseControllerProps } from 'react-hook-form';
|
|
3
|
+
export type RadioGroupProps = RadioGroupPropsMui & UseControllerProps & {
|
|
4
|
+
/**
|
|
5
|
+
* O nome do checkbox que será renderizado na tela
|
|
6
|
+
* @default ''
|
|
7
|
+
* @example 'Nome do checkbox'
|
|
8
|
+
* @type React.ReactNode
|
|
9
|
+
* @memberof RadioGroupProps
|
|
10
|
+
*/
|
|
11
|
+
label?: React.ReactNode;
|
|
12
|
+
/**
|
|
13
|
+
* Adiciona um asterisco ao label do radioGroup
|
|
14
|
+
* @default false
|
|
15
|
+
* @type boolean
|
|
16
|
+
* @memberof RadioGroupProps
|
|
17
|
+
*/
|
|
18
|
+
required?: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* Parte interna do componente para renderizar os RadiosButtons
|
|
21
|
+
* @default []
|
|
22
|
+
* @type ReactNode
|
|
23
|
+
* @memberof RadioGroupProps
|
|
24
|
+
* @example
|
|
25
|
+
* <Radio value="1" label="Radio 1" />
|
|
26
|
+
* <Radio value="2" label="Radio 2" />
|
|
27
|
+
*/
|
|
28
|
+
children: React.ReactNode;
|
|
29
|
+
/**
|
|
30
|
+
* Define a orientação dos radios buttons dentro do radioGroup
|
|
31
|
+
* @default 'row'
|
|
32
|
+
* @type 'row' | 'column'
|
|
33
|
+
* @memberof RadioGroupProps
|
|
34
|
+
*/
|
|
35
|
+
orientation?: 'row' | 'column';
|
|
36
|
+
/**
|
|
37
|
+
* Desabilita o ícone de erro da validação do campo.
|
|
38
|
+
* @default false
|
|
39
|
+
*
|
|
40
|
+
* @example
|
|
41
|
+
* <TextField disableIconError />
|
|
42
|
+
*/
|
|
43
|
+
disableIconError?: boolean;
|
|
44
|
+
};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { SearchableV2Props } from './searchableV2.types';
|
|
2
|
+
declare const _default: <FieldValue, Multiple extends boolean | undefined = undefined, DisableClearable extends boolean | undefined = undefined, FreeSolo extends boolean | undefined = undefined>(props: SearchableV2Props<FieldValue, Multiple, DisableClearable, FreeSolo>) => import("react").JSX.Element;
|
|
3
|
+
export default _default;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { AutocompleteFreeSoloValueMapping, AutocompleteProps, AutocompleteValue, AutocompleteValueOrFreeSoloValueMapping, TextFieldProps } from '@mui/material';
|
|
2
|
+
import { UseControllerProps } from 'react-hook-form';
|
|
3
|
+
export type SearchableV2Props<FieldValue, 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<FieldValue, Multiple, DisableClearable, FreeSolo>, 'renderInput' | 'size' | 'options' | 'onInputChange' | 'onChange' | 'getOptionLabel' | 'getOptionKey' | 'defaultValue' | 'value'> & UseControllerProps & {
|
|
4
|
+
options: FieldValue[];
|
|
5
|
+
textFieldProps?: TextFieldProps;
|
|
6
|
+
label?: React.ReactNode;
|
|
7
|
+
required?: boolean;
|
|
8
|
+
/**
|
|
9
|
+
* Texto que será exibido quando não houver opções para serem exibidas
|
|
10
|
+
* @default 'Nenhuma opção encontrada'
|
|
11
|
+
*/
|
|
12
|
+
noOptionsText?: string;
|
|
13
|
+
/**
|
|
14
|
+
* Componente que renderiza no footer do searchable (opcional)
|
|
15
|
+
* @example
|
|
16
|
+
* footer: (
|
|
17
|
+
* <Button onClick={handleClick}>Mostrar mais...</Button>
|
|
18
|
+
* )
|
|
19
|
+
*/
|
|
20
|
+
footer?: () => React.ReactNode;
|
|
21
|
+
/**
|
|
22
|
+
* É o conteúdo passado para a tooltip que renderizará ao lado da label do campo,
|
|
23
|
+
* montada à tela como um ícone de informação.
|
|
24
|
+
*/
|
|
25
|
+
info?: React.ReactNode;
|
|
26
|
+
defaultValue?: AutocompleteFieldValue;
|
|
27
|
+
value?: AutocompleteFieldValue;
|
|
28
|
+
placeholder?: string;
|
|
29
|
+
onInputChange?: (value: string) => void;
|
|
30
|
+
onChange?: (value: AutocompleteValue<FieldValue, Multiple, DisableClearable, FreeSolo> | (DisableClearable extends true ? never : null)) => void;
|
|
31
|
+
/**
|
|
32
|
+
* Define a key unica da option
|
|
33
|
+
*/
|
|
34
|
+
getOptionKey: (option: FieldValue | AutocompleteFreeSoloValueMapping<FreeSolo>) => string | number;
|
|
35
|
+
/**
|
|
36
|
+
* Define a label da option
|
|
37
|
+
*/
|
|
38
|
+
getOptionLabel: (option: AutocompleteValueOrFreeSoloValueMapping<FieldValue, FreeSolo>) => string;
|
|
39
|
+
/**
|
|
40
|
+
* Componente renderizado embaixo da option da listagem
|
|
41
|
+
*/
|
|
42
|
+
getOptionAfterLabel?: (option: FieldValue | AutocompleteFreeSoloValueMapping<FreeSolo>) => string | React.ReactNode;
|
|
43
|
+
/**
|
|
44
|
+
* Usado para montar a label do valor selecionado no campo
|
|
45
|
+
*
|
|
46
|
+
* Funciona apenas junto com `getOptionAfterLabel`
|
|
47
|
+
*
|
|
48
|
+
* Quando não informado é usado o `getOptionLabel`
|
|
49
|
+
*/
|
|
50
|
+
getInputValueLabel?: (option: AutocompleteValueOrFreeSoloValueMapping<FieldValue, FreeSolo>) => string;
|
|
51
|
+
};
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { SelectProps as SelectPropsMui } from '@mui/material';
|
|
2
|
+
import { FieldPath, FieldPathValue, FieldValues, UseControllerProps } from 'react-hook-form';
|
|
3
|
+
export type FooterPropsV2 = {
|
|
4
|
+
closeSelect: () => void;
|
|
5
|
+
};
|
|
6
|
+
export type SelectV2Props<FieldValue extends FieldValues | string | number> = Omit<SelectPropsMui<FieldValue>, 'onChange' | 'multiple' | 'defaultValue' | 'variant'> & UseControllerProps & {
|
|
7
|
+
variant?: 'filled' | 'outlined' | 'standard';
|
|
8
|
+
/**
|
|
9
|
+
* As opções que serão renderizadas no select
|
|
10
|
+
*/
|
|
11
|
+
options: FieldValue[];
|
|
12
|
+
onChange?: (value: FieldValue | null) => void;
|
|
13
|
+
/**
|
|
14
|
+
* Função que renderiza o footer do select (opcional) - recebe como parâmetro a função closeSelect que fecha o select
|
|
15
|
+
* @param {FooterProps} props
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* footer: ({ closeSelect }) => (
|
|
19
|
+
* <Button onClick={closeSelect}>Fechar</Button>
|
|
20
|
+
* )
|
|
21
|
+
*
|
|
22
|
+
*/
|
|
23
|
+
footer?: (props: FooterPropsV2) => React.ReactNode;
|
|
24
|
+
/**
|
|
25
|
+
* É o conteúdo passado para a tooltip que renderizará ao lado da label do campo,
|
|
26
|
+
* montada à tela como um ícone de informação.
|
|
27
|
+
*/
|
|
28
|
+
info?: React.ReactNode;
|
|
29
|
+
/**
|
|
30
|
+
* Habilita ícone no endAdornment para limpar o valor do campo.
|
|
31
|
+
* @default false
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* <Select clearable />
|
|
35
|
+
*/
|
|
36
|
+
clearable?: boolean;
|
|
37
|
+
placeholder?: string;
|
|
38
|
+
defaultValue?: FieldValue;
|
|
39
|
+
/**
|
|
40
|
+
* Define a key unica da option
|
|
41
|
+
*/
|
|
42
|
+
getOptionKey: (option: FieldValue) => string | number;
|
|
43
|
+
/**
|
|
44
|
+
* Define a label da option
|
|
45
|
+
*/
|
|
46
|
+
getOptionLabel: (option: FieldValue) => string;
|
|
47
|
+
/**
|
|
48
|
+
* Componente renderizado embaixo da option da listagem
|
|
49
|
+
*/
|
|
50
|
+
getOptionAfterLabel?: (option: FieldValue) => string | React.ReactNode;
|
|
51
|
+
/**
|
|
52
|
+
* Usado para montar a label do valor selecionado no campo
|
|
53
|
+
*
|
|
54
|
+
* Funciona apenas junto com `getOptionAfterLabel`
|
|
55
|
+
*
|
|
56
|
+
* Quando não informado é usado o `getOptionLabel`
|
|
57
|
+
*/
|
|
58
|
+
getInputValueLabel?: (option: FieldValue) => string;
|
|
59
|
+
/**
|
|
60
|
+
* Ícone renderizado ao lado da label
|
|
61
|
+
*/
|
|
62
|
+
getOptionIcon?: (option: FieldValue) => React.ReactNode;
|
|
63
|
+
};
|
|
64
|
+
export type SelectV2ReturnValueProps<TFieldValues extends FieldValues = FieldValues, TFieldName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>> = {
|
|
65
|
+
value: FieldPathValue<TFieldValues, TFieldName> | null;
|
|
66
|
+
placeholder: string | undefined;
|
|
67
|
+
getOptionLabel: (option: FieldPathValue<TFieldValues, TFieldName>) => string;
|
|
68
|
+
};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { FieldPath, FieldValues } from 'react-hook-form';
|
|
2
|
+
import { SelectV2ReturnValueProps } from './selectV2.types';
|
|
3
|
+
export declare const SelectV2RenderValue: <TFieldValues extends FieldValues = FieldValues, TFieldName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>({ value, placeholder, getOptionLabel, }: SelectV2ReturnValueProps<TFieldValues, TFieldName>) => string | import("react").JSX.Element;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { SliderProps as SliderPropsMui } from '@mui/material';
|
|
2
|
+
import { UseControllerProps } from 'react-hook-form';
|
|
3
|
+
export type SliderProps = SliderPropsMui & UseControllerProps & {
|
|
4
|
+
/**
|
|
5
|
+
* O nome do switch que será renderizado na tela
|
|
6
|
+
* @default ''
|
|
7
|
+
* @example 'Nome do switch'
|
|
8
|
+
* @type string
|
|
9
|
+
* @memberof SliderProps
|
|
10
|
+
*/
|
|
11
|
+
label?: string;
|
|
12
|
+
/**
|
|
13
|
+
* Posição do label em relação ao switch
|
|
14
|
+
* @default 'end'
|
|
15
|
+
* @type 'start' | 'end' | 'top' | 'bottom'
|
|
16
|
+
* @example
|
|
17
|
+
* <Slider label="Slider" labelPlacement="start" />
|
|
18
|
+
*/
|
|
19
|
+
labelPlacement?: 'start' | 'end' | 'top' | 'bottom';
|
|
20
|
+
};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { SwitchProps } from './switch.types';
|
|
2
|
+
declare const Switch: ({ name, rules, defaultValue, defaultChecked, shouldUnregister, control: controlFromProps, label, labelPlacement, disableIconError, onChange: onChangeProp, ...rest }: SwitchProps) => import("react").JSX.Element;
|
|
3
|
+
export default Switch;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { SwitchProps as SwitchPropsMui } from '@mui/material';
|
|
2
|
+
import { UseControllerProps } from 'react-hook-form';
|
|
3
|
+
export type SwitchProps = SwitchPropsMui & UseControllerProps & {
|
|
4
|
+
/**
|
|
5
|
+
* O nome do switch que será renderizado na tela
|
|
6
|
+
* @default ''
|
|
7
|
+
* @example 'Nome do switch'
|
|
8
|
+
* @type React.ReactNode
|
|
9
|
+
* @memberof SwitchProps
|
|
10
|
+
*/
|
|
11
|
+
label?: React.ReactNode;
|
|
12
|
+
/**
|
|
13
|
+
* Posição do label em relação ao switch
|
|
14
|
+
* @default 'end'
|
|
15
|
+
* @type 'start' | 'end' | 'top' | 'bottom'
|
|
16
|
+
* @example
|
|
17
|
+
* <Switch label="Switch" labelPlacement="start" />
|
|
18
|
+
*/
|
|
19
|
+
labelPlacement?: 'start' | 'end' | 'top' | 'bottom';
|
|
20
|
+
/**
|
|
21
|
+
* Desabilita o ícone de erro da validação do campo.
|
|
22
|
+
* @default false
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* <TextField disableIconError />
|
|
26
|
+
*/
|
|
27
|
+
disableIconError?: boolean;
|
|
28
|
+
};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { TextFieldProps } from './textField.types';
|
|
2
|
+
declare const _default: ({ name, rules, defaultValue, shouldUnregister, control: controlFromProps, label, required, mask, variant, info, parse, format, onInputChange, disableIconError, ...rest }: TextFieldProps) => import("react").JSX.Element;
|
|
3
|
+
export default _default;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { TextFieldProps as TextFieldPropsMui } from '@mui/material';
|
|
2
|
+
import { UseControllerProps } from 'react-hook-form';
|
|
3
|
+
export type Masks = 'cpf' | 'cnpj' | 'cpfCnpj' | 'cep' | 'telefone' | 'decimal' | 'decimal3' | 'decimal4' | 'decimal5' | 'porcentagem' | 'porcentagem0' | 'nome' | 'numero' | 'numeroPontuacao' | 'placa' | 'placaSefaz' | 'valor' | 'valor3' | 'valor4';
|
|
4
|
+
export type TextFieldProps = TextFieldPropsMui & UseControllerProps & {
|
|
5
|
+
mask?: Masks;
|
|
6
|
+
/**
|
|
7
|
+
* @description Função que será executada quando o valor do input for alterado
|
|
8
|
+
* @param value valor atual do Field
|
|
9
|
+
* @param values valores atuais do Form
|
|
10
|
+
*
|
|
11
|
+
* @example onInputChange={(values,values) => console.log({value, values})}
|
|
12
|
+
*/
|
|
13
|
+
onInputChange?: (value: string) => void;
|
|
14
|
+
/**
|
|
15
|
+
* @param value Valor do input
|
|
16
|
+
* @returns Valor formatado para o input
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* <TextField mask="cpf" parse={(value) => value.replace(/\D/g, '')} />
|
|
20
|
+
*/
|
|
21
|
+
parse?: (value: string) => string;
|
|
22
|
+
/**
|
|
23
|
+
* @param value Valor do input formatado
|
|
24
|
+
* @returns Valor sem formatação para o input
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* <TextField mask="cpf" format={(value) => value.replace(/\D/g, '')} />
|
|
28
|
+
*/
|
|
29
|
+
format?: (value: string) => string;
|
|
30
|
+
/**
|
|
31
|
+
* É o conteúdo passado para a tooltip que renderizará ao lado da label do campo,
|
|
32
|
+
* montada à tela como um ícone de informação.
|
|
33
|
+
*/
|
|
34
|
+
info?: React.ReactNode;
|
|
35
|
+
/**
|
|
36
|
+
* Desabilita o ícone de erro da validação do campo.
|
|
37
|
+
* @default false
|
|
38
|
+
*
|
|
39
|
+
* @example
|
|
40
|
+
* <TextField disableIconError />
|
|
41
|
+
*/
|
|
42
|
+
disableIconError?: boolean;
|
|
43
|
+
};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { TimePickerProps } from './timePicker.types';
|
|
2
|
+
declare const _default: ({ rules, defaultValue, shouldUnregister, name, control: controlFromProps, required, label, disabled, disableIconError, size, ...rest }: TimePickerProps) => import("react").JSX.Element;
|
|
3
|
+
export default _default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const SIconButton: import('@emotion/styled').StyledComponent<import('@mui/material').IconButtonOwnProps & Omit<import('@mui/material').ButtonBaseOwnProps, keyof import('@mui/material').IconButtonOwnProps> & Omit<import('@mui/material').ButtonBaseOwnProps, "type" | "tabIndex" | "action" | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "nativeButton" | "onFocusVisible" | "TouchRippleProps" | "touchRippleRef" | keyof import('@mui/material').IconButtonOwnProps> & import('@mui/material/OverridableComponent').CommonProps & Omit<import('react').DetailedHTMLProps<import('react').ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "type" | "disabled" | "size" | "classes" | "className" | "style" | "children" | "sx" | "tabIndex" | "color" | "action" | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "nativeButton" | "onFocusVisible" | "TouchRippleProps" | "touchRippleRef" | "disableFocusRipple" | "edge" | "loading" | "loadingIndicator"> & import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme>, {}, {}>;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { TextFieldProps } from '@mui/material';
|
|
2
|
+
import { TimePickerProps as TimePickerPropsMui } from '@mui/x-date-pickers';
|
|
3
|
+
import { UseControllerProps } from 'react-hook-form';
|
|
4
|
+
export type TimePickerProps = TimePickerPropsMui & UseControllerProps & {
|
|
5
|
+
/**
|
|
6
|
+
* Se `true` irá adicionar um asterisco ao label do campo
|
|
7
|
+
*
|
|
8
|
+
* @default false
|
|
9
|
+
*/
|
|
10
|
+
required?: boolean;
|
|
11
|
+
/**
|
|
12
|
+
* Se `true` irá desabilitar o campo e não será possível interagir com ele
|
|
13
|
+
*
|
|
14
|
+
* @default false
|
|
15
|
+
*/
|
|
16
|
+
disabled?: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Desabilita o ícone de erro da validação do campo.
|
|
19
|
+
* @default false
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* <TextField disableIconError />
|
|
23
|
+
*/
|
|
24
|
+
disableIconError?: boolean;
|
|
25
|
+
/**
|
|
26
|
+
* Define o tamanho do campo.
|
|
27
|
+
* @default 'medium'
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* <TimePicker size='small' />
|
|
31
|
+
*/
|
|
32
|
+
size?: TextFieldProps['size'];
|
|
33
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const typedMemo: <T>(c: T) => T;
|