tdesign-react
Version:
TDesign Component for React
18 lines (17 loc) • 1.17 kB
TypeScript
import { ReactElement } from 'react';
import { SelectValue, TdOptionProps, SelectKeysType, TdSelectProps, SelectOption } from '../type';
export type ValueToOption = {
[value: string | number]: TdOptionProps;
};
export declare const getValueToOption: (children: ReactElement, options: SelectOption[], keys: SelectKeysType) => ValueToOption;
export declare const getLabel: (children: ReactElement, value: SelectValue<TdOptionProps>, options: TdOptionProps[], keys: SelectKeysType) => string;
export declare const getMultipleTags: (values: SelectValue[], keys: SelectKeysType) => {
label: any;
value: any;
}[];
export declare const getSelectValueArr: (values: SelectValue | SelectValue[], activeValue: SelectValue, selected?: boolean, valueType?: TdSelectProps["valueType"], keys?: SelectKeysType, objVal?: SelectValue) => any[];
export declare const getSelectedOptions: (value: SelectValue, multiple: TdSelectProps["multiple"], valueType: TdSelectProps["valueType"], keys: SelectKeysType, valueToOption: ValueToOption, selectedValue?: SelectValue) => {
currentSelectedOptions: any[];
currentOption: SelectOption;
allSelectedValue: SelectValue[];
};