diff --git a/api/@internal/component/ets/common.d.ts b/api/@internal/component/ets/common.d.ts index 4cf968e15be5c84d6a246e3781a0a5bb9f37c6af..1589096770c8dfbe88ecd214fc0689cc9fabf43c 100644 --- a/api/@internal/component/ets/common.d.ts +++ b/api/@internal/component/ets/common.d.ts @@ -15285,6 +15285,18 @@ declare interface PopupCommonOptions { * @since 18 */ followTransformOfTarget?: boolean; + + /** + * Determine if popup can avoid the target when the display space is insufficient. + * + * @type { ?AvoidanceMode } + * @default AvoidanceMode.COVER_TARGET + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 20 + */ + avoidTarget?: AvoidanceMode; } /** @@ -16067,6 +16079,62 @@ declare interface PopupOptions { * @since 15 */ keyboardAvoidMode?: KeyboardAvoidMode; + + /** + * Determine if popup can avoid the target when the display space is insufficient. + * + * @type { ?AvoidanceMode } + * @default AvoidanceMode.COVER_TARGET + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 20 + */ + avoidTarget?: AvoidanceMode; + + /** + * Callback function when the popup appears. + * + * @type { ?Callback } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 20 + */ + onDidAppear?: Callback; + + /** + * Callback function when the popup disappears. + * + * @type { ?Callback } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 20 + */ + onDidDisappear?: Callback; + + /** + * Callback function before the popup openAnimation starts. + * + * @type { ?Callback } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 20 + */ + onWillAppear?: Callback; + + /** + * Callback function before the popup closeAnimation starts. + * + * @type { ?Callback } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 20 + */ + onWillDisappear?: Callback; } /** @@ -16614,6 +16682,62 @@ declare interface CustomPopupOptions { * @since 15 */ keyboardAvoidMode?: KeyboardAvoidMode; + + /** + * Determine if popup can avoid the target when the display space is insufficient. + * + * @type { ?AvoidanceMode } + * @default AvoidanceMode.COVER_TARGET + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 20 + */ + avoidTarget?: AvoidanceMode; + + /** + * Callback function when the popup appears. + * + * @type { ?Callback } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 20 + */ + onDidAppear?: Callback; + + /** + * Callback function when the popup disappears. + * + * @type { ?Callback } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 20 + */ + onDidDisappear?: Callback; + + /** + * Callback function before the popup openAnimation starts. + * + * @type { ?Callback } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 20 + */ + onWillAppear?: Callback; + + /** + * Callback function before the popup closeAnimation starts. + * + * @type { ?Callback } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 20 + */ + onWillDisappear?: Callback; } /** @@ -16798,6 +16922,41 @@ declare enum HapticFeedbackMode { AUTO = 2 } +/** + * Menu mask type + * + * @interface MenuMaskType + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 20 + */ +declare interface MenuMaskType { + /** + * Mask color of menu. + * + * @type { ?ResourceColor } + * @default Color.Transparent + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 20 + */ + color?: ResourceColor; + + /** + * Set menu mask background blur Style. + * + * @type { ?BlurStyle } + * @default BlurStyle.COMPONENT_ULTRA_THICK + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 20 + */ + backgroundBlurStyle?: BlurStyle; +} + /** * Defines the context menu options. * @@ -17145,6 +17304,62 @@ declare interface ContextMenuOptions { * @since 18 */ hapticFeedbackMode?: HapticFeedbackMode; + + /** + * Whether it is a menu without mask. + * + * @type { ?(boolean | MenuMaskType) } + * @default true + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 20 + */ + mask?: boolean | MenuMaskType; + + /** + * Callback function when the menu appears. + * + * @type { ?Callback } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 20 + */ + onDidAppear?: Callback; + + /** + * Callback function when the menu disappears. + * + * @type { ?Callback } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 20 + */ + onDidDisappear?: Callback; + + /** + * Callback function before the menu openAnimation starts. + * + * @type { ?Callback } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 20 + */ + onWillAppear?: Callback; + + /** + * Callback function before the menu closeAnimation starts. + * + * @type { ?Callback } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 20 + */ + onWillDisappear?: Callback; } /** diff --git a/api/@internal/component/ets/custom_dialog_controller.d.ts b/api/@internal/component/ets/custom_dialog_controller.d.ts index d0a5591578d84d418678b5ffb3589bbfa79b3f5a..0423ca2979c2e88424fd6731be8911198111357e 100644 --- a/api/@internal/component/ets/custom_dialog_controller.d.ts +++ b/api/@internal/component/ets/custom_dialog_controller.d.ts @@ -638,6 +638,17 @@ declare interface CustomDialogControllerOptions { * @since 18 */ focusable?: boolean; + + /** + * Defines the customDialog's display mode when show in subwindow + * + * @type { ?DialogDisplayMode } + * @default DialogDisplayMode.CENTER_IN_SCREEN + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 20 + */ + displayModeInSubWindow?: DialogDisplayMode; } /** diff --git a/api/@internal/component/ets/enums.d.ts b/api/@internal/component/ets/enums.d.ts index 57039794ad1e7c65abeeee436284b5cb430ecef5..8083f177d27c0ef0c6779f277b6c5fd1243360d3 100644 --- a/api/@internal/component/ets/enums.d.ts +++ b/api/@internal/component/ets/enums.d.ts @@ -10210,4 +10210,32 @@ declare enum DividerMode { * @since 18 */ EMBEDDED_IN_MENU = 1, +} + +/** + * Dialog display mode. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 20 + */ +declare enum DialogDisplayMode { + /** + * dialog display in screen. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 20 + */ + CENTER_IN_SCREEN = 0, + + /** + * dialog display in app window. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 20 + */ + CENTER_IN_WINDOW = 1, } \ No newline at end of file diff --git a/api/@internal/component/ets/menu_item.d.ts b/api/@internal/component/ets/menu_item.d.ts index b95257ffab9157a0df25e245ee63df837a8f91ea..9f203bc10fac3e8bfc23e932194c169a1a998496 100644 --- a/api/@internal/component/ets/menu_item.d.ts +++ b/api/@internal/component/ets/menu_item.d.ts @@ -194,6 +194,72 @@ declare interface MenuItemOptions { builder?: CustomBuilder; } +/** + * Defines the option of MenuItem. + * + * @interface MenuItemOptionsV2 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 20 + */ +declare interface MenuItemOptionsV2 { + /** + * Defines the start display image info. + * + * @type { ?(ResourceStr | SymbolGlyphModifier | DrawableDescriptor) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 20 + */ + startIcon?: ResourceStr | SymbolGlyphModifier | DrawableDescriptor; + + /** + * Defines the content string display info. + * + * @type { ?ResourceStr } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 20 + */ + content?: ResourceStr; + + /** + * Defines the end display image info. + * + * @type { ?(ResourceStr | SymbolGlyphModifier | DrawableDescriptor) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 20 + */ + endIcon?: ResourceStr | SymbolGlyphModifier | DrawableDescriptor; + + /** + * Defines the end label info like shortcut. + * + * @type { ?ResourceStr } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 20 + */ + labelInfo?: ResourceStr; + + /** + * Create the submenu. + * + * @type { ?CustomBuilder } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 20 + */ + builder?: CustomBuilder; +} + /** * Defines the MenuItem Component. * @@ -247,6 +313,18 @@ interface MenuItemInterface { * @since 11 */ (value?: MenuItemOptions | CustomBuilder): MenuItemAttribute; + + /** + * Creates the MenuItem component. + * + * @param { MenuItemOptions | MenuItemOptionsV2 | CustomBuilder } item + * @returns { MenuItemAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 20 + */ + (item?: MenuItemOptions | MenuItemOptionsV2 | CustomBuilder): MenuItemAttribute; } /** @@ -354,6 +432,22 @@ declare class MenuItemAttribute extends CommonMethod { */ selectIcon(value: boolean | ResourceStr | SymbolGlyphModifier): MenuItemAttribute; + /** + * Whether the relevant check icon is displayed when a menu item is selected. + * Use type ResourceStr or SymbolGlyphModifier to specify icon instead of the default check mark. + * + * @param { boolean | ResourceStr | SymbolGlyphModifier | DrawableDescriptor } value - Icon when selected. + *
true: displays the default check mark when selected. + *
false: does not displays icon when selected. + *
ResourceStr or SymbolGlyphModifier or DrawableDescriptor: displays the specified icon when selected. + * @returns { MenuItemAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 20 + */ + selectIcon(value: boolean | ResourceStr | SymbolGlyphModifier | DrawableDescriptor): MenuItemAttribute; + /** * Triggers a callback when a menu item is selected or unchecked. * diff --git a/api/@internal/component/ets/select.d.ts b/api/@internal/component/ets/select.d.ts index ab1ea4bebe5cecbf303341060563cecc832d72d8..2feeab4cd54e20fc367f727b58c341b866e48797 100644 --- a/api/@internal/component/ets/select.d.ts +++ b/api/@internal/component/ets/select.d.ts @@ -1159,6 +1159,18 @@ declare class SelectAttribute extends CommonMethod { * @since 18 */ avoidance(mode: AvoidanceMode): SelectAttribute; + + /** + * Whether to display in the sub window. + * + * @param { Optional } showInSubWindow + * @returns { SelectAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 20 + */ + showInSubWindow(showInSubWindow: Optional): SelectAttribute; } /** diff --git a/api/@ohos.arkui.advanced.PopupV2.d.ets b/api/@ohos.arkui.advanced.PopupV2.d.ets new file mode 100644 index 0000000000000000000000000000000000000000..cccf4dd4e3d856fca1c16556b009316f4281a2bc --- /dev/null +++ b/api/@ohos.arkui.advanced.PopupV2.d.ets @@ -0,0 +1,203 @@ +/* +* Copyright (C) 2025 Huawei Device Co., Ltd. +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +/** + * @file + * @kit ArkUI + */ + +import { ButtonModifier, ImageModifier, TextModifier } from '@ohos.arkui.modifier'; + +/** + * Defines the popup button options + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 20 + */ +export interface PopupV2Button { + /** + * Set the button display content. + * @type { ResourceStr }. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 20 + */ + text: ResourceStr; + + /** + * Set the button callback. + * @type { ?Callback } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 20 + */ + action?: Callback; + + /** + * The button attributes of Popup. + * + * @type { ?ButtonModifier } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 20 + */ + buttonModifier?: ButtonModifier; +} + +/** + * Defines the popup options. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 20 + */ +export interface PopupV2InitInfo { + /** + * The icon of Popup. + * + * @type { ?ResourceStr } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 20 + */ + icon?: ResourceStr; + + /** + * The icon attributes of Popup. + * + * @type { ?ImageModifier } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 20 + */ + iconModifier?: ImageModifier; + + /** + * The title of Popup. + * + * @type { ?ResourceStr } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 20 + */ + title?: ResourceStr; + + /** + * The title attributes of Popup. + * + * @type { ?TextModifier } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 20 + */ + titleModifier?: TextModifier; + + /** + * The message of Popup. + * + * @type { ResourceStr } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 20 + */ + message: ResourceStr; + + /** + * The message attributes of Popup. + * + * @type { TextModifier } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 20 + */ + messageModifier?: TextModifier; + + /** + * The show close of Popup. + * + * @type { ?(boolean | Resource) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 20 + */ + showClose?: boolean | Resource; + + /** + * The close button callback of Popup. + * + * @type { ?Callback } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 20 + */ + onClose?: Callback; + + /** + * The buttons of Popup. + * + * @type { ?[PopupV2Button?, PopupV2Button?] } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 20 + */ + buttons?: [PopupV2Button?, PopupV2Button?]; + + /** + * Indicates the attribute of the current popup direction. + * + * @type { ?Direction } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 20 + */ + direction?: Direction; + + /** + * Set the max width of the popup. + * + * @type { ?Dimension } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 20 + */ + maxWidth?: Dimension; +} + +/** + * Build function of PopupV2. + * + * @param { PopupV2InitInfo } options - popup option. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 20 + */ + @Builder + export declare function PopupV2(options: PopupV2InitInfo): void; \ No newline at end of file diff --git a/api/@ohos.promptAction.d.ts b/api/@ohos.promptAction.d.ts index a07be30d8f91644099104719bba320177dc30eca..7867bac276702995e0342c72ad0b5dc5920d2db6 100644 --- a/api/@ohos.promptAction.d.ts +++ b/api/@ohos.promptAction.d.ts @@ -1304,6 +1304,17 @@ declare namespace promptAction { * @since 18 */ focusable?: boolean; + + /** + * Defines the customDialog's display mode when show in subwindow + * + * @type { ?DialogDisplayMode } + * @default DialogDisplayMode.CENTER_IN_SCREEN + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 20 + */ + displayModeInSubWindow?: DialogDisplayMode; } /** @@ -1810,6 +1821,50 @@ declare namespace promptAction { * @since 15 */ immersiveMode?: ImmersiveMode; + + /** + * Callback function when the menu appears. + * + * @type { ?Callback } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 20 + */ + onDidAppear?: Callback; + + /** + * Callback function when the menu disappears. + * + * @type { ?Callback } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 20 + */ + onDidDisappear?: Callback; + + /** + * Callback function before the menu openAnimation starts. + * + * @type { ?Callback } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 20 + */ + onWillAppear?: Callback; + + /** + * Callback function before the menu closeAnimation starts. + * + * @type { ?Callback } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 20 + */ + onWillDisappear?: Callback; } /**