UNPKG

@uiw-admin/components

Version:
34 lines (33 loc) 1.08 kB
import { OptionsProps, RulesProps } from '../type'; import React from 'react'; /** * 只读模式表单项 value转换 * @param type 表单项类型 * @param initialValue 默认值 * @param option 表单项option * @returns */ export declare function getReadValue(type: string | any, initialValue: any | any[], option: OptionsProps[], widgetProps: any): React.ReactNode; interface FromValidateProps { key: string; rules?: RulesProps[]; value?: any[] | any; required?: boolean; } export declare function isArray(obj: any | any[]): boolean; export declare function isObject(obj: any | any[]): boolean; export declare function isNumberOrString(obj: any): boolean; export declare function isObjectEmpty(obj: any): boolean; /** * form表单提交验证 * @param rules FromValidateProps[] * @returns { [key: string]: string } */ export declare const fromValidate: (rules?: FromValidateProps[]) => { [key: string]: string; }; /** * 判断rules 里面是 required 是否存在 */ export declare const isRequired: (rules?: any[]) => boolean; export {};