From b255d085ff5bc2ff3cf23a1462a7d86b0940a064 Mon Sep 17 00:00:00 2001 From: kangchongtao Date: Mon, 4 Jul 2022 17:49:25 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E7=BB=84=E4=BB=B6GridRow?= =?UTF-8?q?=E3=80=81GridCol=20dts?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: kangchongtao Change-Id: Idddfd9bb3e54ee66fd4dd76b7af5f019550e1876 Signed-off-by: kangchongtao --- BUILD.gn | 2 + api/@internal/component/ets/grid_col.d.ts | 98 ++++++++ api/@internal/component/ets/grid_row.d.ts | 237 ++++++++++++++++++++ api/@internal/component/ets/index-full.d.ts | 2 + 4 files changed, 339 insertions(+) create mode 100644 api/@internal/component/ets/grid_col.d.ts create mode 100644 api/@internal/component/ets/grid_row.d.ts diff --git a/BUILD.gn b/BUILD.gn index 37b77bef16..aee10d9f6c 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -61,7 +61,9 @@ ohos_copy("ets_component") { "api/@internal/component/ets/gesture.d.ts", "api/@internal/component/ets/grid.d.ts", "api/@internal/component/ets/gridItem.d.ts", + "api/@internal/component/ets/grid_col.d.ts", "api/@internal/component/ets/grid_container.d.ts", + "api/@internal/component/ets/grid_row.d.ts", "api/@internal/component/ets/hyperlink.d.ts", "api/@internal/component/ets/image.d.ts", "api/@internal/component/ets/image_animator.d.ts", diff --git a/api/@internal/component/ets/grid_col.d.ts b/api/@internal/component/ets/grid_col.d.ts new file mode 100644 index 0000000000..82f2162292 --- /dev/null +++ b/api/@internal/component/ets/grid_col.d.ts @@ -0,0 +1,98 @@ +/* + * 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 option in number unit of grid-container child component. +* @since 9 +*/ +declare interface GridColColumnOption { + /** + * Grid Col Column Option xs + * @since 9 + */ + xs?: number, + + /** + * Grid Col Column Option sm + * @since 9 + */ + sm?: number, + + /** + * Grid Col Column Option md + * @since 9 + */ + md?: number, + + /** + * Grid Col Column Option lg + * @since 9 + */ + lg?: number, + + /** + * Grid Col Column Option xl + * @since 9 + */ + xl?: number, + + /** + * Grid Col Column Option xxl + * @since 9 + */ + xxl?: number, +} + +/** + * Defines the options of grid-container child component. + * @since 9 + */ +declare interface GridColOptions { + /** + * Sets the span of current gird-container item. + * @since 9 + */ + span?: GridColColumnOption; + + /** + * Sets the offset of current gird-container item. + * @since 9 + */ + offset?: GridColColumnOption; + + /** + * Sets the order of current gird-container item. + * @since 9 + */ + order?: GridColColumnOption; +} + + +/** + * Defines the the new version of grid-container child component. + * @since 9 + */ +interface GridColInterface { + /** + * Defines the constructor of GridContainer. + * @since 9 + */ + (optiion?: GridColOptions): GridColAttribute; +} + +declare class GridColAttribute extends CommonMethod {} + +declare const GridCol: GridColInterface +declare const GridColInstance: GridColAttribute; \ No newline at end of file diff --git a/api/@internal/component/ets/grid_row.d.ts b/api/@internal/component/ets/grid_row.d.ts new file mode 100644 index 0000000000..8ce36fd362 --- /dev/null +++ b/api/@internal/component/ets/grid_row.d.ts @@ -0,0 +1,237 @@ +/* + * 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 option in length unit of grid-container component. +* @since 9 +*/ +declare interface GridRowSizeOption { + /** + * Grid Row Size Option xs + * @since 9 + */ + xs?: Length, + + /** + * Grid Row Size Option sm + * @since 9 + */ + sm?: Length, + + /** + * Grid Row Size Option md + * @since 9 + */ + md?: Length, + + /** + * Grid Row Size Option lg + * @since 9 + */ + lg?: Length, + + /** + * Grid Row Size Option xl + * @since 9 + */ + xl?: Length, + + /** + * Grid Row Size Option xxl + * @since 9 + */ + xxl?: Length, +} + +/** +* Defines the option in number unit of grid-container component. +* @since 9 +*/ +declare interface GridRowColumnOption { + /** + * Grid Row Column Option xs + * @since 9 + */ + xs?: number, + + /** + * Grid Row Column Option sm + * @since 9 + */ + sm?: number, + + /** + * Grid Row Column Option md + * @since 9 + */ + md?: number, + + /** + * Grid Row Column Option lg + * @since 9 + */ + lg?: number, + + /** + * Grid Row Column Option xl + * @since 9 + */ + xl?: number, + + /** + * Grid Row Column Option xxl + * @since 9 + */ + xxl?: number, +} + +/** +* Defines the getter of grid-container component. +* @since 9 +*/ +declare interface GetterOption { + /** + * Define x in getteroption + * @since 9 + */ + x?: Length | GridRowSizeOption, + + /** + * Define y in getteroption + * @since 9 + */ + y?: Length | GridRowSizeOption +} + +/** +* Defines the breakpoint reference of grid-container component. +* @since 9 +*/ +declare enum BreakpointsReference { + /** + * Respond to breakpoint changes according to window width + * @since 9 + */ + WindowSize, + + /** + * Respond to breakpoint changes according to component width + * @since 9 + */ + ComponentSize, +} + +/** +* Defines the direction of grid-container component. +* @since 9 +*/ +declare enum GridRowDirection { + /** + * The elements in the grid component are arranged in rows + * @since 9 + */ + Row, + + /** + * The elements in the grid component are arranged in reverse order of rows + * @since 9 + */ + RowReverse, +} + +/** +* Defines the breakpoints of grid-container component. +* @since 9 +*/ +declare interface BreakPoints { + /** + * Breakpoint array + * @since 9 + */ + value?: Array, + + /** + * Set breakpoint reference + * @since 9 + */ + reference?: BreakpointsReference, +} + +/** + * Defines the options of grid-container component. + * @since 9 + */ +declare interface GridRowOptions { + /** + * grid-container layout column spacing. + * @since 9 + */ + gutter?: GetterOption; + + /** + * Sets the total number of columns in the current layout. + * @since 9 + */ + columns?: number | GridRowColumnOption; + + /** + * grid-container layout breakpoints. + * @since 9 + */ + breakpoints?: BreakPoints; + + /** + * grid-container layout direction. + * @since 9 + */ + direction?: GridRowDirection; +} + + +/** + * Defines the the new version of grid-container component. + * @since 9 + */ +interface GridRowInterface { + /** + * Defines the constructor of GridContainer. + * @since 9 + */ + (optiion?: GridRowOptions): GridRowAttribute; +} + +declare class GridRowAttribute extends CommonMethod { + /** + * Set the alignment of sub components in the vertical direction + * @since 9 + */ + verticalAlign(value: VerticalAlign): GridRowAttribute; + + /** + * Set the alignment of sub components in the horizontal direction + * @since 9 + */ + horizontalAlign(value: HorizontalAlign): GridRowAttribute; + + /** + * Callback triggered when the breakpoint changes + * @since 9 + */ + onBreakpointChange(callback: (breakpoints: string) => void): GridRowAttribute; +} + +declare const GridRow: GridRowInterface; +declare const GridRowInstance: GridRowAttribute; \ No newline at end of file diff --git a/api/@internal/component/ets/index-full.d.ts b/api/@internal/component/ets/index-full.d.ts index 2be795deba..aaadf3ba2d 100644 --- a/api/@internal/component/ets/index-full.d.ts +++ b/api/@internal/component/ets/index-full.d.ts @@ -103,3 +103,5 @@ /// /// /// +/// +/// -- Gitee