UNPKG

@gpa-gemstone/react-forms

Version:
28 lines (27 loc) 1.04 kB
import * as React from 'react'; import { Gemstone } from '@gpa-gemstone/application-typings'; interface IProps<T, U> extends Gemstone.TSX.Interfaces.IBaseFormProps<T> { /** * Default item to append when adding a new row or when the array is empty * @type {U} */ DefaultValue: U; /** * Flag to disable the add button * @type {boolean} * @optional */ DisableAdd?: boolean; /** * Render function for a single row. Receives the current item, its index, the full array, * and a setter that replaces just this item in the array. * @param item - Current item * @param index - Index of the item in the array * @param arr - Full array of items * @param setItem - Callback to replace this item with an updated value * @returns {React.ReactNode} */ Item: (item: U, index: number, arr: U[], setItem: (updated: U) => void) => React.ReactNode; } declare function MultiNodeForm<T, U>(props: IProps<T, U>): JSX.Element; export default MultiNodeForm;