From bf18af6b18dd9b0ca342d34d1d08edd941532e27 Mon Sep 17 00:00:00 2001 From: yeyinglong Date: Tue, 9 Aug 2022 09:56:28 +0800 Subject: [PATCH] add list item group support Signed-off-by: yeyinglong Change-Id: Id417fc8d253264337c6eb008292b620cf01f538e --- api/@internal/component/ets/index-full.d.ts | 1 + api/@internal/component/ets/list.d.ts | 30 ++++++++ .../component/ets/list_item_group.d.ts | 76 +++++++++++++++++++ 3 files changed, 107 insertions(+) create mode 100644 api/@internal/component/ets/list_item_group.d.ts diff --git a/api/@internal/component/ets/index-full.d.ts b/api/@internal/component/ets/index-full.d.ts index aaadf3ba2d..85abad3e47 100644 --- a/api/@internal/component/ets/index-full.d.ts +++ b/api/@internal/component/ets/index-full.d.ts @@ -51,6 +51,7 @@ /// /// /// +/// /// /// /// diff --git a/api/@internal/component/ets/list.d.ts b/api/@internal/component/ets/list.d.ts index 9d12aef340..61c3328277 100644 --- a/api/@internal/component/ets/list.d.ts +++ b/api/@internal/component/ets/list.d.ts @@ -61,6 +61,30 @@ declare enum ListItemAlign { End, } +/** + * Declare item group sticky style. + * @since 9 + */ + declare enum StickyStyle { + /** + * The header and footer of each item group will not be pinned. + * @since 9 + */ + None = 0, + + /** + * The header of each item group will be pinned. + * @since 9 + */ + Header = 1, + + /** + * The footer of each item group will be pinned. + * @since 9 + */ + Footer = 2, +} + /** * The list interface is extended. * @since 7 @@ -144,6 +168,12 @@ declare class ListAttribute extends CommonMethod { */ chainAnimation(value: boolean): ListAttribute; + /** + * Called when header or footer of item group will be pinned. + * @since 9 + */ + sticky(value: StickyStyle): ListAttribute; + /** * Called when the offset and status callback of the slide are set. * @since 7 diff --git a/api/@internal/component/ets/list_item_group.d.ts b/api/@internal/component/ets/list_item_group.d.ts new file mode 100644 index 0000000000..6914c606ce --- /dev/null +++ b/api/@internal/component/ets/list_item_group.d.ts @@ -0,0 +1,76 @@ +/* + * Copyright (c) 2022 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. + */ + +/** + * Defines the list item group options. + * @since 9 + */ +declare interface ListItemGroupOptions { + /** + * Describes the ListItemGroup header. + * @since 9 + */ + header?: CustomBuilder; + + /** + * Describes the ListItemGroup footer. + * @since 9 + */ + footer?: CustomBuilder; + + /** + * Describes the ListItemGroup space. + * @since 9 + */ + space?: number | string; +} + +/** + * Defines the ListItemGroup component + * @since 9 + */ +interface ListItemGroupInterface { + /** + * Called when interface is called. + * @since 9 + */ + (options?: ListItemGroupOptions): ListItemGroupAttribute; +} + +/** + * Defines the item group attibute functions. + * @since 9 + */ +declare class ListItemGroupAttribute extends CommonMethod { + /** + * Called when the ListItemGroup split line style is set. + * @since 9 + */ + divider( + value: { + strokeWidth: Length; + color?: ResourceColor; + startMargin?: Length; + endMargin?: Length; + } | null, + ): ListItemGroupAttribute; +} + +/** + * @since 9 + */ +declare const ListItemGroupInstance: ListItemGroupAttribute; +declare const ListItemGroup: ListItemGroupInterface; + \ No newline at end of file -- Gitee