@gpa-gemstone/react-forms
Version:
React Form modules for gpa webapps
41 lines (40 loc) • 1.46 kB
TypeScript
import { IProps as ISearchableSelectProps } from './SearchableSelect';
import { Gemstone } from '@gpa-gemstone/application-typings';
interface IProps<T> extends Omit<ISearchableSelectProps<T>, 'Valid' | 'Feedback' | 'GetLabel' | 'Setter'> {
/**
* Default value to use when adding an item and when value is null
* @type {number}
*/
DefaultValue: number | string;
/**
* Function to determine the validity of a field
* @param field - Field of the record to check
* @returns {boolean}
*/
ItemValid?: (value: string | number, index: number, arr: Array<string | number>) => boolean;
/**
* Feedback message to show when input is invalid
* @type {string}
* @optional
*/
ItemFeedback?: (value: string | number, index: number, arr: Array<string | number>) => string | undefined;
/**
*
*/
GetLabel?: (value: string | number | null, index: number) => Gemstone.TSX.Interfaces.AbortablePromise<string>;
/**
* Flag to disable add button
*/
DisableAdd?: boolean;
/**
* Flag to disable all input fields
*/
Disabled?: boolean;
/**
* Setter function to update the Record
* @param record - Updated Record
*/
Setter: (record: T, selectedOption?: Gemstone.TSX.Interfaces.ILabelValue<string | number>) => void;
}
declare function MultiSearchableSelect<T>(props: IProps<T>): JSX.Element;
export default MultiSearchableSelect;