UNPKG

infinity-forge

Version:
32 lines (31 loc) 972 B
import { IconsNames } from '../../../../../ui/icons/index.js'; import { IFormHandler } from '../interfaces.js'; import * as Inputs from '../../index.js'; export type InputPropsDynamic<T = any> = { name: keyof T; InputComponent: keyof typeof Inputs; } & Partial<Omit<Inputs.InputProps, 'name'>>; export type DynamicFormHandlerProps<T = any> = Partial<IFormHandler> & { button?: { text?: string; icon?: IconsNames; }; initialDataIsTableItem?: boolean; tableItem?: any; title?: string; subtitle?: string; inputs?: InputPropsDynamic<T>[][]; getDetails?: { key: (params: { [key in keyof T]: T[key]; }) => string; fetcher: (params: { [key in keyof T]: T[key]; }) => Promise<any>; }; modifier?: { [key in InputPropsDynamic["name"]]: { [key in keyof Partial<InputPropsDynamic>]: (value: any, initialValue: any) => any; }; }; };