@gpa-gemstone/react-forms
Version:
React Form modules for gpa webapps
36 lines (35 loc) • 1.1 kB
TypeScript
import * as React from 'react';
import { Gemstone } from '@gpa-gemstone/application-typings';
interface IOption {
Value: string | number;
Label: string;
}
interface IProps<T> extends Gemstone.TSX.Interfaces.IBaseFormProps<T> {
/**
* Flag to allow custom input values
* @type {boolean}
* @optional
*/
AllowCustom?: boolean;
/**
* Function to perform a search and return a promise with a list of IOption and an optional callback
* @param search - Search string
* @returns {[promise: Promise<IOption[]>, callback?: () => void]}
*/
Search: (search: string) => [Promise<IOption[]>, () => void];
/**
* CSS styles to apply to the form group
* @type {React.CSSProperties}
* @optional
*/
Style?: React.CSSProperties;
/**
* CSS style to apply to the button holding the selected value
* @type {React.CSSProperties}
* @optional
*/
BtnStyle?: React.CSSProperties;
GetLabel?: () => [Promise<string>, () => void];
}
export default function SearchableSelect<T>(props: IProps<T>): JSX.Element;
export {};