@nish1896/rhf-mui-components
Version:
A suite of 20+ production-ready react-hook-form components built with material-ui. Fully typed, tree-shakable, and optimized for enterprise-grade forms.
49 lines (48 loc) • 1.58 kB
TypeScript
import { FormHelperTextProps, FormLabelProps, MuiChipProps } from "../../types/mui.js";
import { ReactNode } from "react";
import * as react_jsx_runtime0 from "react/jsx-runtime";
import { Control, FieldValues, Path, RegisterOptions } from "react-hook-form";
import { TextFieldProps } from "@mui/material/TextField";
//#region src/mui/tags-input/index.d.ts
type TextFieldInputProps = Omit<TextFieldProps, 'name' | 'value' | 'defaultValue' | 'onChange' | 'error' | 'multiline' | 'rows' | 'minRows' | 'maxRows' | 'FormHelperTextProps'>;
type RHFTagsInputProps<T extends FieldValues> = {
fieldName: Path<T>;
control: Control<T>;
registerOptions?: RegisterOptions<T, Path<T>>;
onValueChange?: (tags: string[]) => void;
showLabelAboveFormField?: boolean;
formLabelProps?: FormLabelProps;
errorMessage?: ReactNode;
hideErrorMessage?: boolean;
formHelperTextProps?: FormHelperTextProps;
ChipProps?: MuiChipProps;
limitTags?: number;
getLimitTagsText?: (hiddenTags: number) => ReactNode;
} & TextFieldInputProps;
declare const RHFTagsInput: <T extends FieldValues>({
fieldName,
control,
registerOptions,
onValueChange,
disabled: muiDisabled,
label,
showLabelAboveFormField,
formLabelProps,
required,
helperText,
errorMessage,
hideErrorMessage,
formHelperTextProps,
ChipProps,
sx: muiTextFieldSx,
variant,
limitTags,
getLimitTagsText,
slotProps,
onBlur,
autoComplete,
InputProps,
...rest
}: RHFTagsInputProps<T>) => react_jsx_runtime0.JSX.Element;
//#endregion
export { RHFTagsInputProps, RHFTagsInput as default };