UNPKG

@ui5/webcomponents-react

Version:

React Wrapper for UI5 Web Components and additional components

37 lines (36 loc) 1.65 kB
'use client'; import '@ui5/webcomponents/dist/Tokenizer.js'; import { withWebComponent } from '../../internal/withWebComponent.js'; /** * A `Tokenizer` is an invisible container for `Token`s that supports keyboard navigation and token selection. * * The `Tokenizer` consists of two parts: * - Tokens - displays the available tokens. * - N-more indicator - contains the number of the remaining tokens that cannot be displayed due to the limited space. * * ### Keyboard Handling * * #### Basic Navigation * The `Tokenizer` provides advanced keyboard handling. * When a token is focused the user can use the following keyboard * shortcuts in order to perform a navigation: * * - [Left] or [Right] / [Up] or [Down] - Navigates left and right through the tokens. * - [Home] - Navigates to the first token. * - [End] - Navigates to the last token. * * The user can use the following keyboard shortcuts to perform actions (such as select, delete): * * - [Space] - Selects a token. * - [Backspace] / [Delete] - Deletes a token. * **Note:** The deletion of a token is handled by the application with the use of the `token-delete` event. * * * * __Note__: This is a UI5 Web Component! [Repository](https://github.com/SAP/ui5-webcomponents) | [Documentation](https://sap.github.io/ui5-webcomponents/) * * @since [2.0.0](https://github.com/SAP/ui5-webcomponents/releases/tag/v2.0.0) of __@ui5/webcomponents__. */ const Tokenizer = withWebComponent('ui5-tokenizer', ['accessibleName', 'accessibleNameRef'], ['disabled', 'readonly'], [], ['selection-change', 'token-delete']); Tokenizer.displayName = 'Tokenizer'; export { Tokenizer };