@sap-ux/ui-components
Version:
SAP UI Components Library
36 lines • 1.53 kB
TypeScript
import React from 'react';
import type { FC } from 'react';
import type { ActionMeta, MultiValue, Options, OptionsOrGroups, GetOptionLabel, GetOptionValue, SelectInstance } from 'react-select';
import type { CreatableProps } from 'react-select/creatable';
import './UICreateSelect.scss';
export { MultiValue as UICreateSelectMultiValue };
export { ActionMeta as UICreateSelectActionMeta };
export { Options as UICreateSelectOptions };
export { OptionsOrGroups as UICreateSelectOptionsOrGroups };
export type { SelectInstance as UICreateSelectInstance } from 'react-select';
export interface UICreateSelectOptionEntry {
readonly label: string;
readonly value: string;
__isNew__?: boolean;
}
export interface UICreateSelectGroupEntry {
readonly options: readonly UICreateSelectOptionEntry[];
readonly label?: string;
}
export interface UICreateSelectAccessors<Option> {
getOptionValue: GetOptionValue<Option>;
getOptionLabel: GetOptionLabel<Option>;
}
type CreateSelectProps = {
createText?: string;
creatableRef?: React.MutableRefObject<SelectInstance<UICreateSelectOptionEntry, true, UICreateSelectGroupEntry> | null>;
};
export type UICreateSelectProps = CreateSelectProps & CreatableProps<UICreateSelectOptionEntry, true, UICreateSelectGroupEntry>;
/**
* Return a UICreateSelect component.
*
* @param {CreatableProps} props to be passed to the component.
* @returns {JSX.Element}
*/
export declare const UICreateSelect: FC<UICreateSelectProps>;
//# sourceMappingURL=UICreateSelect.d.ts.map