@awsui/components-react
Version:
AWS UI is a collection of [React](https://reactjs.org/) components that help create intuitive, responsive, and accessible user experiences for web applications. It is developed by Amazon Web Services (AWS). This work is available under the terms of the [A
63 lines (62 loc) • 2.22 kB
TypeScript
import { BaseComponentProps } from '../internal/base-component';
import { AutosuggestProps } from '../autosuggest';
import { NonCancelableEventHandler } from '../internal/events';
export interface TagEditorProps extends BaseComponentProps {
tags?: ReadonlyArray<TagEditorProps.Tag>;
i18nStrings: TagEditorProps.I18nStrings;
loading?: boolean;
tagLimit?: number;
allowedCharacterPattern?: string;
keysRequest?: (key: string) => Promise<ReadonlyArray<string>>;
valuesRequest?: (key: string, value: string) => Promise<ReadonlyArray<string>>;
onChange?: NonCancelableEventHandler<TagEditorProps.ChangeDetail>;
}
export declare namespace TagEditorProps {
interface Tag {
key: string;
value: string;
existing: boolean;
markedForRemoval?: boolean;
valueSuggestionOptions?: ReadonlyArray<AutosuggestProps.Option>;
}
interface I18nStrings {
keyPlaceholder: string;
valuePlaceholder: string;
addButton: string;
removeButton: string;
undoButton: string;
undoPrompt: string;
loading: string;
keyHeader: string;
valueHeader: string;
optional: string;
keySuggestion: string;
valueSuggestion: string;
tooManyKeysSuggestion: string;
tooManyValuesSuggestion: string;
emptyTags: string;
keysSuggestionLoading: string;
keysSuggestionError: string;
valuesSuggestionError: string;
valuesSuggestionLoading: string;
emptyKeyError: string;
maxKeyCharLengthError: string;
maxValueCharLengthError: string;
duplicateKeyError: string;
invalidKeyError: string;
invalidValueError: string;
awsPrefixError: string;
tagLimit: (availableTags: number) => string;
tagLimitReached: (tagLimit: number) => string;
tagLimitExceeded: (tagLimit: number) => string;
enteredKeyLabel: (enteredText: string) => string;
enteredValueLabel: (enteredText: string) => string;
}
interface ChangeDetail {
tags: ReadonlyArray<TagEditorProps.Tag>;
valid: boolean;
}
interface Ref {
focus(): void;
}
}