2023-10-28 06:46:06 +00:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2023 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.
|
|
|
|
*/
|
|
|
|
|
2023-12-11 09:08:03 +00:00
|
|
|
/**
|
|
|
|
* @file
|
|
|
|
* @kit ArkUI
|
|
|
|
*/
|
|
|
|
|
2023-10-28 06:46:06 +00:00
|
|
|
/**
|
|
|
|
* Defines the popup text options
|
|
|
|
* @syscap SystemCapability.ArkUI.ArkUI.Full
|
|
|
|
* @crossplatform
|
|
|
|
* @since 11
|
|
|
|
*/
|
2024-03-19 08:18:11 +00:00
|
|
|
/**
|
|
|
|
* Defines the popup text options
|
|
|
|
* @syscap SystemCapability.ArkUI.ArkUI.Full
|
|
|
|
* @crossplatform
|
|
|
|
* @atomicservice
|
|
|
|
* @since 12
|
|
|
|
*/
|
2023-12-11 09:08:03 +00:00
|
|
|
|
|
|
|
|
2023-10-28 06:46:06 +00:00
|
|
|
export interface PopupTextOptions {
|
|
|
|
/**
|
|
|
|
* Set the text display content.
|
|
|
|
* @type { ResourceStr }.
|
|
|
|
* @syscap SystemCapability.ArkUI.ArkUI.Full
|
|
|
|
* @crossplatform
|
|
|
|
* @since 11
|
|
|
|
*/
|
2024-03-19 08:18:11 +00:00
|
|
|
/**
|
|
|
|
* Set the text display content.
|
|
|
|
* @type { ResourceStr }.
|
|
|
|
* @syscap SystemCapability.ArkUI.ArkUI.Full
|
|
|
|
* @crossplatform
|
|
|
|
* @atomicservice
|
|
|
|
* @since 12
|
|
|
|
*/
|
2023-10-28 06:46:06 +00:00
|
|
|
text: ResourceStr;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Set the text font size.
|
|
|
|
* @type { ?(number | string | Resource) }.
|
|
|
|
* @syscap SystemCapability.ArkUI.ArkUI.Full
|
|
|
|
* @crossplatform
|
|
|
|
* @since 11
|
|
|
|
*/
|
2024-03-19 08:18:11 +00:00
|
|
|
/**
|
|
|
|
* Set the text font size.
|
|
|
|
* @type { ?(number | string | Resource) }.
|
|
|
|
* @syscap SystemCapability.ArkUI.ArkUI.Full
|
|
|
|
* @crossplatform
|
|
|
|
* @atomicservice
|
|
|
|
* @since 12
|
|
|
|
*/
|
2023-10-28 06:46:06 +00:00
|
|
|
fontSize?: number | string | Resource;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Set the text font color.
|
|
|
|
* @type { ?ResourceColor }.
|
|
|
|
* @syscap SystemCapability.ArkUI.ArkUI.Full
|
|
|
|
* @crossplatform
|
|
|
|
* @since 11
|
|
|
|
*/
|
2024-03-19 08:18:11 +00:00
|
|
|
/**
|
|
|
|
* Set the text font color.
|
|
|
|
* @type { ?ResourceColor }.
|
|
|
|
* @syscap SystemCapability.ArkUI.ArkUI.Full
|
|
|
|
* @crossplatform
|
|
|
|
* @atomicservice
|
|
|
|
* @since 12
|
|
|
|
*/
|
2023-10-28 06:46:06 +00:00
|
|
|
fontColor?: ResourceColor;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Set the text font weight.
|
|
|
|
* @type { ?(number | FontWeight | string) }.
|
|
|
|
* @syscap SystemCapability.ArkUI.ArkUI.Full
|
|
|
|
* @crossplatform
|
|
|
|
* @since 11
|
|
|
|
*/
|
2024-03-19 08:18:11 +00:00
|
|
|
/**
|
|
|
|
* Set the text font weight.
|
|
|
|
* @type { ?(number | FontWeight | string) }.
|
|
|
|
* @syscap SystemCapability.ArkUI.ArkUI.Full
|
|
|
|
* @crossplatform
|
|
|
|
* @atomicservice
|
|
|
|
* @since 12
|
|
|
|
*/
|
2023-10-28 06:46:06 +00:00
|
|
|
fontWeight?: number | FontWeight | string;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Defines the popup button options
|
|
|
|
* @syscap SystemCapability.ArkUI.ArkUI.Full
|
|
|
|
* @crossplatform
|
|
|
|
* @since 11
|
|
|
|
*/
|
2024-03-19 08:18:11 +00:00
|
|
|
/**
|
|
|
|
* Defines the popup button options
|
|
|
|
* @syscap SystemCapability.ArkUI.ArkUI.Full
|
|
|
|
* @crossplatform
|
|
|
|
* @atomicservice
|
|
|
|
* @since 12
|
|
|
|
*/
|
2023-10-28 06:46:06 +00:00
|
|
|
export interface PopupButtonOptions {
|
|
|
|
/**
|
|
|
|
* Set the button display content.
|
|
|
|
* @type { ResourceStr }.
|
|
|
|
* @syscap SystemCapability.ArkUI.ArkUI.Full
|
|
|
|
* @crossplatform
|
|
|
|
* @since 11
|
|
|
|
*/
|
2024-03-19 08:18:11 +00:00
|
|
|
/**
|
|
|
|
* Set the button display content.
|
|
|
|
* @type { ResourceStr }.
|
|
|
|
* @syscap SystemCapability.ArkUI.ArkUI.Full
|
|
|
|
* @crossplatform
|
|
|
|
* @atomicservice
|
|
|
|
* @since 12
|
|
|
|
*/
|
2023-10-28 06:46:06 +00:00
|
|
|
text: ResourceStr;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Set the button callback.
|
2024-01-26 12:17:13 +00:00
|
|
|
* @type { ?function }
|
2023-10-28 06:46:06 +00:00
|
|
|
* @syscap SystemCapability.ArkUI.ArkUI.Full
|
|
|
|
* @crossplatform
|
|
|
|
* @since 11
|
|
|
|
*/
|
2024-03-19 08:18:11 +00:00
|
|
|
/**
|
|
|
|
* Set the button callback.
|
|
|
|
* @type { ?function }
|
|
|
|
* @syscap SystemCapability.ArkUI.ArkUI.Full
|
|
|
|
* @crossplatform
|
|
|
|
* @atomicservice
|
|
|
|
* @since 12
|
|
|
|
*/
|
2023-10-28 06:46:06 +00:00
|
|
|
action?: () => void;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Set the button font size.
|
|
|
|
* @type { ?(number | string | Resource) }.
|
|
|
|
* @syscap SystemCapability.ArkUI.ArkUI.Full
|
|
|
|
* @crossplatform
|
|
|
|
* @since 11
|
|
|
|
*/
|
2024-03-19 08:18:11 +00:00
|
|
|
/**
|
|
|
|
* Set the button font size.
|
|
|
|
* @type { ?(number | string | Resource) }.
|
|
|
|
* @syscap SystemCapability.ArkUI.ArkUI.Full
|
|
|
|
* @crossplatform
|
|
|
|
* @atomicservice
|
|
|
|
* @since 12
|
|
|
|
*/
|
2023-10-28 06:46:06 +00:00
|
|
|
fontSize?: number | string | Resource;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Set the button font color.
|
|
|
|
* @type { ?ResourceColor }.
|
|
|
|
* @syscap SystemCapability.ArkUI.ArkUI.Full
|
|
|
|
* @crossplatform
|
|
|
|
* @since 11
|
|
|
|
*/
|
2024-03-19 08:18:11 +00:00
|
|
|
/**
|
|
|
|
* Set the button font color.
|
|
|
|
* @type { ?ResourceColor }.
|
|
|
|
* @syscap SystemCapability.ArkUI.ArkUI.Full
|
|
|
|
* @crossplatform
|
|
|
|
* @atomicservice
|
|
|
|
* @since 12
|
|
|
|
*/
|
2023-10-28 06:46:06 +00:00
|
|
|
fontColor?: ResourceColor;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Defines the popup icon options
|
|
|
|
* @syscap SystemCapability.ArkUI.ArkUI.Full
|
|
|
|
* @crossplatform
|
|
|
|
* @since 11
|
|
|
|
*/
|
2024-03-19 08:18:11 +00:00
|
|
|
/**
|
|
|
|
* Defines the popup icon options
|
|
|
|
* @syscap SystemCapability.ArkUI.ArkUI.Full
|
|
|
|
* @crossplatform
|
|
|
|
* @atomicservice
|
|
|
|
* @since 12
|
|
|
|
*/
|
2023-10-28 06:46:06 +00:00
|
|
|
export interface PopupIconOptions {
|
|
|
|
/**
|
|
|
|
* Set the icon image.
|
2024-01-25 09:10:52 +00:00
|
|
|
* @type { ResourceStr }.
|
2023-10-28 06:46:06 +00:00
|
|
|
* @syscap SystemCapability.ArkUI.ArkUI.Full
|
|
|
|
* @crossplatform
|
|
|
|
* @since 11
|
|
|
|
*/
|
2024-03-19 08:18:11 +00:00
|
|
|
/**
|
|
|
|
* Set the icon image.
|
|
|
|
* @type { ResourceStr }.
|
|
|
|
* @syscap SystemCapability.ArkUI.ArkUI.Full
|
|
|
|
* @crossplatform
|
|
|
|
* @atomicservice
|
|
|
|
* @since 12
|
|
|
|
*/
|
2024-01-25 09:10:52 +00:00
|
|
|
image: ResourceStr;
|
2023-10-28 06:46:06 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Set the icon width.
|
|
|
|
* @type { ?Dimension }.
|
|
|
|
* @syscap SystemCapability.ArkUI.ArkUI.Full
|
|
|
|
* @crossplatform
|
|
|
|
* @since 11
|
|
|
|
*/
|
2024-03-19 08:18:11 +00:00
|
|
|
/**
|
|
|
|
* Set the icon width.
|
|
|
|
* @type { ?Dimension }.
|
|
|
|
* @syscap SystemCapability.ArkUI.ArkUI.Full
|
|
|
|
* @crossplatform
|
|
|
|
* @atomicservice
|
|
|
|
* @since 12
|
|
|
|
*/
|
2023-10-28 06:46:06 +00:00
|
|
|
width?: Dimension;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Set the icon height.
|
|
|
|
* @type { ?Dimension }.
|
|
|
|
* @syscap SystemCapability.ArkUI.ArkUI.Full
|
|
|
|
* @crossplatform
|
|
|
|
* @since 11
|
|
|
|
*/
|
2024-03-19 08:18:11 +00:00
|
|
|
/**
|
|
|
|
* Set the icon height.
|
|
|
|
* @type { ?Dimension }.
|
|
|
|
* @syscap SystemCapability.ArkUI.ArkUI.Full
|
|
|
|
* @crossplatform
|
|
|
|
* @atomicservice
|
|
|
|
* @since 12
|
|
|
|
*/
|
2023-10-28 06:46:06 +00:00
|
|
|
height?: Dimension;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Set the icon fill color.
|
|
|
|
* @type { ?ResourceColor }.
|
|
|
|
* @syscap SystemCapability.ArkUI.ArkUI.Full
|
|
|
|
* @crossplatform
|
|
|
|
* @since 11
|
|
|
|
*/
|
2024-03-19 08:18:11 +00:00
|
|
|
/**
|
|
|
|
* Set the icon fill color.
|
|
|
|
* @type { ?ResourceColor }.
|
|
|
|
* @syscap SystemCapability.ArkUI.ArkUI.Full
|
|
|
|
* @crossplatform
|
|
|
|
* @atomicservice
|
|
|
|
* @since 12
|
|
|
|
*/
|
2023-10-28 06:46:06 +00:00
|
|
|
fillColor?: ResourceColor;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Set the icon border radius.
|
|
|
|
* @type { ?(Length | BorderRadiuses) }.
|
|
|
|
* @syscap SystemCapability.ArkUI.ArkUI.Full
|
|
|
|
* @crossplatform
|
|
|
|
* @since 11
|
|
|
|
*/
|
2024-03-19 08:18:11 +00:00
|
|
|
/**
|
|
|
|
* Set the icon border radius.
|
|
|
|
* @type { ?(Length | BorderRadiuses) }.
|
|
|
|
* @syscap SystemCapability.ArkUI.ArkUI.Full
|
|
|
|
* @crossplatform
|
|
|
|
* @atomicservice
|
|
|
|
* @since 12
|
|
|
|
*/
|
2023-10-28 06:46:06 +00:00
|
|
|
borderRadius?: Length | BorderRadiuses;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Defines the popup options.
|
|
|
|
* @syscap SystemCapability.ArkUI.ArkUI.Full
|
|
|
|
* @crossplatform
|
|
|
|
* @since 11
|
|
|
|
*/
|
2024-03-19 08:18:11 +00:00
|
|
|
/**
|
|
|
|
* Defines the popup options.
|
|
|
|
* @syscap SystemCapability.ArkUI.ArkUI.Full
|
|
|
|
* @crossplatform
|
|
|
|
* @atomicservice
|
|
|
|
* @since 12
|
|
|
|
*/
|
2023-10-28 06:46:06 +00:00
|
|
|
export interface PopupOptions {
|
|
|
|
/**
|
|
|
|
* The icon of Popup.
|
|
|
|
*
|
|
|
|
* @type { ?PopupIconOptions }
|
|
|
|
* @syscap SystemCapability.ArkUI.ArkUI.Full
|
|
|
|
* @crossplatform
|
|
|
|
* @since 11
|
|
|
|
*/
|
2024-03-19 08:18:11 +00:00
|
|
|
/**
|
|
|
|
* The icon of Popup.
|
|
|
|
*
|
|
|
|
* @type { ?PopupIconOptions }
|
|
|
|
* @syscap SystemCapability.ArkUI.ArkUI.Full
|
|
|
|
* @crossplatform
|
|
|
|
* @atomicservice
|
|
|
|
* @since 12
|
|
|
|
*/
|
2023-10-28 06:46:06 +00:00
|
|
|
icon?: PopupIconOptions;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The title of Popup.
|
|
|
|
*
|
|
|
|
* @type { ?PopupTextOptions }
|
|
|
|
* @syscap SystemCapability.ArkUI.ArkUI.Full
|
|
|
|
* @crossplatform
|
|
|
|
* @since 11
|
|
|
|
*/
|
2024-03-19 08:18:11 +00:00
|
|
|
/**
|
|
|
|
* The title of Popup.
|
|
|
|
*
|
|
|
|
* @type { ?PopupTextOptions }
|
|
|
|
* @syscap SystemCapability.ArkUI.ArkUI.Full
|
|
|
|
* @crossplatform
|
|
|
|
* @atomicservice
|
|
|
|
* @since 12
|
|
|
|
*/
|
2023-10-28 06:46:06 +00:00
|
|
|
title?: PopupTextOptions;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The message of Popup.
|
|
|
|
*
|
|
|
|
* @type { PopupTextOptions }
|
|
|
|
* @syscap SystemCapability.ArkUI.ArkUI.Full
|
|
|
|
* @crossplatform
|
|
|
|
* @since 11
|
|
|
|
*/
|
2024-03-19 08:18:11 +00:00
|
|
|
/**
|
|
|
|
* The message of Popup.
|
|
|
|
*
|
|
|
|
* @type { PopupTextOptions }
|
|
|
|
* @syscap SystemCapability.ArkUI.ArkUI.Full
|
|
|
|
* @crossplatform
|
|
|
|
* @atomicservice
|
|
|
|
* @since 12
|
|
|
|
*/
|
2023-10-28 06:46:06 +00:00
|
|
|
message: PopupTextOptions;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The show close of Popup.
|
|
|
|
*
|
|
|
|
* @type { ?(boolean | Resource) }
|
|
|
|
* @syscap SystemCapability.ArkUI.ArkUI.Full
|
|
|
|
* @crossplatform
|
|
|
|
* @since 11
|
|
|
|
*/
|
2024-03-19 08:18:11 +00:00
|
|
|
/**
|
|
|
|
* The show close of Popup.
|
|
|
|
*
|
|
|
|
* @type { ?(boolean | Resource) }
|
|
|
|
* @syscap SystemCapability.ArkUI.ArkUI.Full
|
|
|
|
* @crossplatform
|
|
|
|
* @atomicservice
|
|
|
|
* @since 12
|
|
|
|
*/
|
2023-10-28 06:46:06 +00:00
|
|
|
showClose?: boolean | Resource;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The close button callback of Popup.
|
|
|
|
*
|
|
|
|
* @type { ?() => void }
|
|
|
|
* @syscap SystemCapability.ArkUI.ArkUI.Full
|
|
|
|
* @crossplatform
|
|
|
|
* @since 11
|
|
|
|
*/
|
2024-03-19 08:18:11 +00:00
|
|
|
/**
|
|
|
|
* The close button callback of Popup.
|
|
|
|
*
|
|
|
|
* @type { ?() => void }
|
|
|
|
* @syscap SystemCapability.ArkUI.ArkUI.Full
|
|
|
|
* @crossplatform
|
|
|
|
* @atomicservice
|
|
|
|
* @since 12
|
|
|
|
*/
|
2023-10-28 06:46:06 +00:00
|
|
|
onClose?: () => void;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The buttons of Popup.
|
|
|
|
*
|
|
|
|
* @type { ?[PopupButtonOptions?, PopupButtonOptions?] }
|
|
|
|
* @syscap SystemCapability.ArkUI.ArkUI.Full
|
|
|
|
* @crossplatform
|
|
|
|
* @since 11
|
|
|
|
*/
|
2024-03-19 08:18:11 +00:00
|
|
|
/**
|
|
|
|
* The buttons of Popup.
|
|
|
|
*
|
|
|
|
* @type { ?[PopupButtonOptions?, PopupButtonOptions?] }
|
|
|
|
* @syscap SystemCapability.ArkUI.ArkUI.Full
|
|
|
|
* @crossplatform
|
|
|
|
* @atomicservice
|
|
|
|
* @since 12
|
|
|
|
*/
|
2023-10-28 06:46:06 +00:00
|
|
|
buttons?: [PopupButtonOptions?, PopupButtonOptions?];
|
2024-04-14 13:07:38 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Indicates the attribute of the current popup direction.
|
|
|
|
*
|
|
|
|
* @type { ?Direction }
|
|
|
|
* @syscap SystemCapability.ArkUI.ArkUI.Full
|
|
|
|
* @crossplatform
|
2024-07-16 04:01:05 +00:00
|
|
|
* @atomicservice
|
2024-04-14 13:07:38 +00:00
|
|
|
* @since 12
|
|
|
|
*/
|
|
|
|
direction?: Direction;
|
2023-10-28 06:46:06 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Build function of popup.
|
|
|
|
*
|
|
|
|
* @param { PopupOptions } options - popup option.
|
|
|
|
* @syscap SystemCapability.ArkUI.ArkUI.Full
|
|
|
|
* @crossplatform
|
|
|
|
* @since 11
|
|
|
|
*/
|
2024-03-19 08:18:11 +00:00
|
|
|
/**
|
|
|
|
* Build function of popup.
|
|
|
|
*
|
|
|
|
* @param { PopupOptions } options - popup option.
|
|
|
|
* @syscap SystemCapability.ArkUI.ArkUI.Full
|
|
|
|
* @crossplatform
|
|
|
|
* @atomicservice
|
|
|
|
* @since 12
|
|
|
|
*/
|
2023-10-28 06:46:06 +00:00
|
|
|
@Builder
|
|
|
|
export declare function Popup(options: PopupOptions): void;
|