@patternfly/react-core
Version:
This library provides a set of common React components for use with the PatternFly reference implementation.
43 lines • 2.18 kB
TypeScript
import { Component } from 'react';
import { PickOptional } from '../../helpers/typeUtils';
import { OUIAProps } from '../../helpers';
export interface FormSelectProps extends Omit<React.HTMLProps<HTMLSelectElement>, 'onChange' | 'onBlur' | 'onFocus' | 'disabled'>, OUIAProps {
/** content rendered inside the FormSelect */
children: React.ReactNode;
/** additional classes added to the FormSelect control */
className?: string;
/** value of selected option */
value?: any;
/** Value to indicate if the select is modified to show that validation state.
* If set to success, select will be modified to indicate valid state.
* If set to error, select will be modified to indicate error state.
*/
validated?: 'success' | 'warning' | 'error' | 'default';
/** Flag indicating the FormSelect is disabled */
isDisabled?: boolean;
/** Sets the FormSelect required. */
isRequired?: boolean;
/** Optional callback for updating when selection loses focus */
onBlur?: (event: React.FormEvent<HTMLSelectElement>) => void;
/** Optional callback for updating when selection gets focus */
onFocus?: (event: React.FormEvent<HTMLSelectElement>) => void;
/** Optional callback for updating when selection changes */
onChange?: (event: React.FormEvent<HTMLSelectElement>, value: string) => void;
/** Custom flag to show that the FormSelect requires an associated id or aria-label. */
'aria-label'?: string;
/** Value to overwrite the randomly generated data-ouia-component-id.*/
ouiaId?: number | string;
/** Set the value of data-ouia-safe. Only set to true when the component is in a static state, i.e. no animations are occurring. At all other times, this value must be false. */
ouiaSafe?: boolean;
}
declare class FormSelect extends Component<FormSelectProps, {
ouiaStateId: string;
}> {
static displayName: string;
constructor(props: FormSelectProps);
static defaultProps: PickOptional<FormSelectProps>;
handleChange: (event: any) => void;
render(): import("react/jsx-runtime").JSX.Element;
}
export { FormSelect };
//# sourceMappingURL=FormSelect.d.ts.map