Fix Select Mode Type

This commit is contained in:
wleven 2019-10-18 16:03:02 +08:00 committed by 偏右
parent 53c55ceaad
commit 9cfc151813

View File

@ -51,10 +51,17 @@ export interface LabeledValue {
export type SelectValue = string | string[] | number | number[] | LabeledValue | LabeledValue[];
export type ModeOptions =
| 'SECRET_COMBOBOX_MODE_DO_NOT_USE'
| 'default'
| 'multiple'
| 'tags'
| 'combobox'
| undefined;
export interface SelectProps<T = SelectValue> extends AbstractSelectProps {
value?: T;
defaultValue?: T;
mode?: 'default' | 'multiple' | 'tags' | 'combobox' | undefined;
mode?: ModeOptions;
optionLabelProp?: string;
firstActiveValue?: string | string[];
onChange?: (value: T, option: React.ReactElement<any> | React.ReactElement<any>[]) => void;
@ -114,7 +121,7 @@ export default class Select<T = SelectValue> extends React.Component<SelectProps
static OptGroup = OptGroup as React.ClassicComponentClass<OptGroupProps>;
static SECRET_COMBOBOX_MODE_DO_NOT_USE = 'SECRET_COMBOBOX_MODE_DO_NOT_USE';
static SECRET_COMBOBOX_MODE_DO_NOT_USE: ModeOptions = 'SECRET_COMBOBOX_MODE_DO_NOT_USE';
static defaultProps = {
showSearch: false,