From 2bf50178bbc9695e7eca84352fded15e6fd43980 Mon Sep 17 00:00:00 2001 From: "ester.zhou" Date: Wed, 24 Aug 2022 19:14:12 +0800 Subject: [PATCH] update ts-container-alphabet-indexer.md (8543) Signed-off-by: ester.zhou --- .../arkui-ts/ts-container-alphabet-indexer.md | 60 +++++++++---------- 1 file changed, 29 insertions(+), 31 deletions(-) diff --git a/en/application-dev/reference/arkui-ts/ts-container-alphabet-indexer.md b/en/application-dev/reference/arkui-ts/ts-container-alphabet-indexer.md index ba2b3259ee..e5ba0719fb 100644 --- a/en/application-dev/reference/arkui-ts/ts-container-alphabet-indexer.md +++ b/en/application-dev/reference/arkui-ts/ts-container-alphabet-indexer.md @@ -1,12 +1,10 @@ # AlphabetIndexer +The **\** component can create a logically indexed array of items in a container for instant location. -> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE** -> This component is supported since API version 7. Updates will be marked with a superscript to indicate their earliest API version. - - -The **<AlphabetIndexer>** component provides an alphabetic index bar. - +> **NOTE** +> +> This component is supported since API version 7. Updates will be marked with a superscript to indicate their earliest API version. ## Required Permissions @@ -15,7 +13,7 @@ None ## Child Components -None +Not supported ## APIs @@ -23,48 +21,48 @@ None AlphabetIndexer(value: {arrayValue : Array<string>, selected : number}) - Parameters - | Name | Type | Mandatory | Default Value | Description | + | Name| Type| Mandatory| Default Value| Description| | -------- | -------- | -------- | -------- | -------- | - | arrayValue | Array<string> | Yes | - | Array of strings to be displayed in the alphabetic index bar. | - | selected | number | Yes | - | ID of a selected item. | + | arrayValue | Array<string> | Yes| - | Array of strings to be displayed in the alphabetic index bar.| + | selected | number | Yes| - | ID of a selected item.| ## Attributes -| Name | Type | Description | +| Name| Type| Description| | -------- | -------- | -------- | -| selectedColor | Color | Font color of the selected text. | -| popupColor | Color | Font color of the pop-up text. | -| selectedBackgroundColor | Color | Background color of the selected text. | -| popupBackground | Color | Background color of the pop-up text. | -| usingPopup | boolean | Whether to use pop-up text. | -| selectedFont | {
size?: number,
weight?: FontWeight,
family?: string,
style?: FontStyle
} | Font style of the selected text. | -| popupFont | {
size?: number,
weight?: FontWeight,
family?: string,
style?: FontStyle
} | Font style of the pop-up text. | -| font | {
size?: number,
weight?: FontWeight,
family?: string,
style?: FontStyle
} | Default font style of the alphabetic index bar. | -| itemSize | Length | Size of an item in the alphabetic index bar. The item is a square, and the side length needs to be set. | -| alignStyle | IndexerAlign | Alignment style of the alphabetic index bar. Left alignment and right alignment are supported. The alignment style affects the position of the pop-up window. | +| selectedColor | [ResourceColor](../../ui/ts-types.md) | Font color of the selected text.| +| popupColor | [ResourceColor](../../ui/ts-types.md) | Font color of the pop-up text.| +| selectedBackgroundColor | [ResourceColor](../../ui/ts-types.md) | Background color of the selected text.| +| popupBackground | [ResourceColor](../../ui/ts-types.md) | Background color of the pop-up text.| +| usingPopup | boolean | Whether to use pop-up text.| +| selectedFont | {
size?: number,
weight?: FontWeight,
family?: string,
style?: FontStyle
} | Font style of the selected text.| +| popupFont | {
size?: number,
weight?: FontWeight,
family?: string,
style?: FontStyle
} | Font style of the pop-up text.| +| font | {
size?: number,
weight?: FontWeight,
family?: string,
style?: FontStyle
} | Default font style of the alphabetic index bar.| +| itemSize | Length | Size of an item in the alphabetic index bar. The item is a square, and the side length needs to be set.| +| alignStyle | IndexerAlign | Alignment style of the alphabetic index bar. Left alignment and right alignment are supported. The alignment style affects the position of the pop-up window.| - IndexerAlign enums - | Name | Description | + | Name| Description| | -------- | -------- | - | Left | The pop-up window is displayed on the right of the alphabetic indexer bar. | - | Right | The pop-up window is displayed on the left of the alphabetic indexer bar. | + | Left | The pop-up window is displayed on the right of the alphabetic indexer bar.| + | Right | The pop-up window is displayed on the left of the alphabetic indexer bar.| ## Events -| Name | Description | +| Name| Description| | -------- | -------- | -| onSelected(index: number) => void(deprecated) | Invoked when an item in the alphabetic indexer bar is selected. | -| onSelect(index: number) => void8+ | Invoked when an item in the alphabetic indexer bar is selected. | -| onRequestPopupData(callback: (index: number) => Array<string>)8+ | Invoked when a request for displaying content in the index prompt window is sent when an item in the alphabetic indexer bar is selected.
The return value is a string array corresponding to the indexes. The string array is displayed vertically in the pop-up window. It can display up to five strings at a time and allows scrolling. | -| onPopupSelect(callback: (index: number) => void)8+ | Invoked when an item in the index pop-up window is selected. | +| onSelected(index: number) => void(deprecated) | Invoked when an item in the alphabetic indexer bar is selected.| +| onSelect(index: number) => void8+ | Invoked when an item in the alphabetic indexer bar is selected.| +| onRequestPopupData(callback: (index: number) => Array<string>)8+ | Invoked when a request for displaying content in the index prompt window is sent when an item in the alphabetic indexer bar is selected.
The return value is a string array corresponding to the indexes. The string array is displayed vertically in the pop-up window. It can display up to five strings at a time and allows scrolling.| +| onPopupSelect(callback: (index: number) => void)8+ | Invoked when an item in the index pop-up window is selected.| ## Example - -``` +```ts +// xxx.ets @Entry @Component struct AlphabetIndexerSample { -- GitLab