From 3a79f9eef6fff2e2e097393622665f992377376e Mon Sep 17 00:00:00 2001 From: Zhang Jinyu Date: Thu, 26 Sep 2024 18:06:44 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9EChip/ChipGroup=E6=94=AF?= =?UTF-8?q?=E6=8C=81=E6=97=A0=E9=9A=9C=E7=A2=8D=E5=B1=8F=E5=B9=95=E6=9C=97?= =?UTF-8?q?=E8=AF=BB=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Zhang Jinyu --- api/@ohos.arkui.advanced.Chip.d.ets | 231 +++++++++++++++++++++++ api/@ohos.arkui.advanced.ChipGroup.d.ets | 228 +++++++++++++++++++++- kits/@kit.ArkUI.d.ts | 10 +- 3 files changed, 464 insertions(+), 5 deletions(-) mode change 100755 => 100644 api/@ohos.arkui.advanced.Chip.d.ets diff --git a/api/@ohos.arkui.advanced.Chip.d.ets b/api/@ohos.arkui.advanced.Chip.d.ets old mode 100755 new mode 100644 index 86c184a72..c5706b118 --- a/api/@ohos.arkui.advanced.Chip.d.ets +++ b/api/@ohos.arkui.advanced.Chip.d.ets @@ -78,6 +78,47 @@ export declare enum ChipSize { SMALL = "SMALL" } +/** + * Enum for AccessibilitySelectedType + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ +export declare enum AccessibilitySelectedType { + /** + * Default type. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + CLICKED = 0, + + /** + * Checked type. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + CHECKED = 1, + + /** + * Selected type. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + SELECTED = 2 +} + /** * Defines the icon common option. * @@ -205,6 +246,40 @@ export interface SuffixIconOptions extends IconCommonOptions { * @since 12 */ action?: () => void; + + /** + * Set accessibility text for icon. + * + * @type { ?ResourceStr } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + accessibilityText?: ResourceStr; + + /** + * Set accessibility description for icon. + * + * @type { ?ResourceStr } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + accessibilityDescription?: ResourceStr; + + /** + * Set accessibility level for icon. + * + * @type { ?string } + * @default "auto" + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + accessibilityLevel?: string; } /** @@ -228,6 +303,62 @@ export interface SuffixIconOptions extends IconCommonOptions { */ export interface PrefixIconOptions extends IconCommonOptions {} +/** + * Defines accessibility icon options. + * + * @interface AccessibilityOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ +export interface AccessibilityOptions { + /** + * Set accessibility level for accessibility icon. + * + * @type { ?string } + * @default "auto" + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + accessibilityLevel?: string; + + /** + * Set accessibility text for accessibility icon. + * + * @type { ?ResourceStr } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + accessibilityText?: ResourceStr; + + /** + * Set accessibility description for accessibility icon. + * + * @type { ?ResourceStr } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + accessibilityDescription?: ResourceStr; +} + +/** + * Defines accessibility options of default close icon. + * + * @interface CloseOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ +export interface CloseOptions extends AccessibilityOptions {} + /** * Defines chip symbolglyph options. * @@ -262,6 +393,50 @@ export interface ChipSymbolGlyphOptions { activated?: SymbolGlyphModifier; } +/** + * Defines accessibility options of suffix symbol. + * + * @interface ChipSuffixSymbolGlyphOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ +export interface ChipSuffixSymbolGlyphOptions { + /** + * Set normal accessibility options for suffix symbol. + * + * @type { ?AccessibilityOptions } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + normalAccessibility?: AccessibilityOptions; + + /** + * Set activated accessibility options for suffix symbol. + * + * @type { ?AccessibilityOptions } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + activatedAccessibility?: AccessibilityOptions; + + /** + * Called when the suffix symbol is clicked. + * + * @type { ?VoidCallback } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + action?: VoidCallback; +} + /** * Defines label margin. * @@ -588,6 +763,17 @@ export interface ChipOptions { */ suffixSymbol?: ChipSymbolGlyphOptions; + /** + * Set options for suffix symbol. + * + * @type { ?ChipSuffixSymbolGlyphOptions } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + suffixSymbolOptions?: ChipSuffixSymbolGlyphOptions; + /** * Show close icon. * @@ -607,6 +793,17 @@ export interface ChipOptions { */ allowClose?: boolean; + /** + * Set options for default close icon when 'allowaClose' is true. + * + * @type { ?CloseOptions } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + closeOptions?: CloseOptions; + /** * Enable chip. * @@ -745,6 +942,40 @@ export interface ChipOptions { * @since 12 */ direction?: Direction; + + /** + * Set accessibility description for Chip. + * + * @type { ?ResourceStr } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + accessibilityDescription?: ResourceStr; + + /** + * Set accessibility level for Chip. + * + * @type { ?string } + * @default "auto" + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + accessibilityLevel?: string; + + /** + * Set accessibility selected type for Chip. + * + * @type { ?AccessibilitySelectedType } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + accessibilitySelectedType?: AccessibilitySelectedType; } /** diff --git a/api/@ohos.arkui.advanced.ChipGroup.d.ets b/api/@ohos.arkui.advanced.ChipGroup.d.ets index cbaf9ab0f..28f103816 100644 --- a/api/@ohos.arkui.advanced.ChipGroup.d.ets +++ b/api/@ohos.arkui.advanced.ChipGroup.d.ets @@ -19,7 +19,7 @@ */ -import { ChipSize, ChipSymbolGlyphOptions } from '@ohos.arkui.advanced.Chip'; +import { ChipSize, ChipSymbolGlyphOptions, CloseOptions, ChipSuffixSymbolGlyphOptions } from '@ohos.arkui.advanced.Chip'; import { SymbolGlyphModifier } from './@ohos.arkui.modifier'; /** @@ -56,6 +56,62 @@ export interface IconOptions { size?: SizeOptions; } +/** + * Defines suffix icon options. + * + * @interface SuffixImageIconOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ +export interface SuffixImageIconOptions extends IconOptions { + /** + * Called when the suffix image icon is clicked. + * + * @type { ?VoidCallback } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + action?: VoidCallback; + + /** + * Set accessibility text for icon. + * + * @type { ?ResourceStr } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + accessibilityText?: ResourceStr; + + /** + * Set accessibility description for icon. + * + * @type { ?ResourceStr } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + accessibilityDescription?: ResourceStr; + + /** + * Set accessibility level for icon. + * + * @type { ?string } + * @default "auto" + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + accessibilityLevel?: string; +} + /** * Defines label options. * @@ -132,9 +188,22 @@ export interface ChipGroupItemOptions { * @crossplatform * @atomicservice * @since 12 + * @deprecated since 14 + * @useinstead ChipGroupItemOptions#suffixImageIcon */ suffixIcon?: IconOptions; + /** + * Suffix icon. + * + * @type { ?SuffixImageIconOptions } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + suffixImageIcon?: SuffixImageIconOptions; + /** * suffix symbol. * @@ -146,6 +215,17 @@ export interface ChipGroupItemOptions { */ suffixSymbol?: ChipSymbolGlyphOptions; + /** + * Set options for suffix symbol. + * + * @type { ?ChipSuffixSymbolGlyphOptions } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + suffixSymbolOptions?: ChipSuffixSymbolGlyphOptions; + /** * Allow close. * @@ -156,6 +236,40 @@ export interface ChipGroupItemOptions { * @since 12 */ allowClose?: boolean; + + /** + * Set options for default close icon when 'allowaClose' is true. + * + * @type { ?CloseOptions } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + closeOptions?: CloseOptions; + + /** + * Set accessibility description for ChipGroup item. + * + * @type { ?ResourceStr } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + accessibilityDescription?: ResourceStr; + + /** + * Set accessibility level for ChipGroup item. + * + * @type { ?string } + * @default "auto" + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + accessibilityLevel?: string; } @@ -303,6 +417,107 @@ export interface IconItemOptions { * @since 12 */ action: Callback; + + /** + * Set accessibility text for icon. + * + * @type { ?ResourceStr } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + accessibilityText?: ResourceStr; + + /** + * Set accessibility description for icon. + * + * @type { ?ResourceStr } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + accessibilityDescription?: ResourceStr; + + /** + * Set accessibility level for icon. + * + * @type { ?string } + * @default "auto" + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + accessibilityLevel?: string; +} + +/** + * Defines symbol item options. + * + * @interface SymbolItemOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ +export interface SymbolItemOptions { + /** + * Set symbol. + * + * @type { ?SymbolGlyphModifier } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + symbol: SymbolGlyphModifier; + + /** + * Called when the symbol item is clicked. + * + * @type { ?VoidCallback } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + action: VoidCallback; + + /** + * Set accessibility text for symbol. + * + * @type { ?ResourceStr } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + accessibilityText?: ResourceStr; + + /** + * Set accessibility description for symbol. + * + * @type { ?ResourceStr } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + accessibilityDescription?: ResourceStr; + + /** + * Set accessibility level for symbol. + * + * @type { ?string } + * @default "auto" + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + accessibilityLevel?: string; } /** @@ -358,8 +573,17 @@ export declare struct IconGroupSuffix { * @atomicservice * @since 12 */ + /** + * Suffix item. + * + * @type { Array } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ @Require @Prop - items: Array; + items: Array; } diff --git a/kits/@kit.ArkUI.d.ts b/kits/@kit.ArkUI.d.ts index 1abdfef07..675a4258e 100644 --- a/kits/@kit.ArkUI.d.ts +++ b/kits/@kit.ArkUI.d.ts @@ -24,11 +24,14 @@ import WindowExtensionAbility, { WindowExtensionContext } from '@ohos.applicatio import { AtomicServiceNavigation, NavDestinationBuilder } from '@ohos.atomicservice.AtomicServiceNavigation'; import { Chip, ChipOptions, ChipSize, IconCommonOptions, LabelMarginOptions, LabelOptions, PrefixIconOptions, - SuffixIconOptions, ChipSymbolGlyphOptions + SuffixIconOptions, ChipSymbolGlyphOptions, AccessibilitySelectedType, AccessibilityOptions, CloseOptions, + ChipSuffixSymbolGlyphOptions } from '@ohos.arkui.advanced.Chip'; import { NavPushPathHelper } from '@ohos.atomicservice.NavPushPathHelper'; import { - IconOptions, LabelOptions as ChipItemLabelOptions, ChipGroupItemOptions, ChipItemStyle, ChipGroupSpaceOptions, IconItemOptions, IconGroupSuffix, ChipGroup + IconOptions, LabelOptions as ChipItemLabelOptions, ChipGroupItemOptions, ChipItemStyle, + ChipGroupSpaceOptions, IconItemOptions, IconGroupSuffix, ChipGroup, SuffixImageIconOptions, + SymbolItemOptions } from '@ohos.arkui.advanced.ChipGroup'; import { ComposeListItem, ContentItem, IconType, OperateButton, OperateCheck, OperateIcon, OperateItem @@ -214,5 +217,6 @@ export { PixelMapDrawableDescriptor, AnimationOptions, AnimatedDrawableDescriptor, NodeAdapter, DownloadFileButton, DownloadLayoutDirection, DownloadIconStyle, DownloadDescription, DownloadContentOptions, DownloadStyleOptions, Rect, RoundRect, edgeColors, edgeWidths, borderStyles, borderRadiuses, ParticleModifier, - InnerFullScreenLaunchComponent, LaunchController, + InnerFullScreenLaunchComponent, LaunchController, AccessibilitySelectedType, AccessibilityOptions, CloseOptions, ChipSuffixSymbolGlyphOptions, + SuffixImageIconOptions, SymbolItemOptions, };