UNPKG

@gulibs/vgrove-ui

Version:

VGrove UI component library built with HeroUI and React

39 lines 1.48 kB
import React from 'react'; import type { FieldValues, FieldPath, RegisterOptions } from 'react-hook-form'; import type { TooltipProps } from '@heroui/react'; export interface FormItemProps { /** 字段名称 */ name: string; /** 标签文本 */ label?: React.ReactNode; /** 是否必填 */ required?: boolean; /** 帮助文本 */ help?: React.ReactNode; /** 错误消息 */ errorMessage?: string; /** 布局方式 */ layout?: 'vertical' | 'horizontal'; /** 标签对齐方式 */ labelAlign?: 'left' | 'right'; /** 显示冒号 */ colon?: boolean; /** 验证规则 */ rules?: Omit<RegisterOptions<FieldValues, FieldPath<FieldValues>>, 'valueAsNumber' | 'valueAsDate' | 'setValueAs' | 'disabled'>; /** 默认值 */ defaultValue?: unknown; /** 子组件 */ children: React.ReactNode; /** 工具提示配置 */ tooltip?: Omit<TooltipProps, "children">; /** 样式类名 */ className?: string; /** 验证状态 */ validateStatus?: 'success' | 'warning' | 'error' | 'validating'; /** 是否可清空 */ canClear?: boolean; /** 占位符 */ placeholder?: string; } export declare function FormItem({ name, label, required, help, tooltip, rules, defaultValue, errorMessage, layout, labelAlign, colon, children, className, validateStatus, canClear, placeholder, }: FormItemProps): import("react/jsx-runtime").JSX.Element; //# sourceMappingURL=FormItem.d.ts.map