From c0961021a4458cbd325ef52e7a9952e0ebef50f1 Mon Sep 17 00:00:00 2001 From: bixuefeng Date: Fri, 29 Apr 2022 11:02:15 +0800 Subject: [PATCH] Feature: border width/color/style/radius support setted separately Signed-off-by: bixuefeng Change-Id: I668778fea5514071233e379088605cce8f5e16bd --- api/@internal/component/ets/common.d.ts | 12 ++- api/@internal/component/ets/units.d.ts | 132 +++++++++++++++++++++++- 2 files changed, 136 insertions(+), 8 deletions(-) diff --git a/api/@internal/component/ets/common.d.ts b/api/@internal/component/ets/common.d.ts index 4ebfb501cb..5b0b7874d6 100644 --- a/api/@internal/component/ets/common.d.ts +++ b/api/@internal/component/ets/common.d.ts @@ -1115,27 +1115,31 @@ declare class CommonMethod { /** * Border style + * EdgeStyles be supportted at version 9 * @since 7 */ - borderStyle(value: BorderStyle): T; + borderStyle(value: EdgeStyles | BorderStyle): T; /** * Border width + * EdgeWidths be supportted at version 9 * @since 7 */ - borderWidth(value: Length): T; + borderWidth(value: EdgeWidths | Length): T; /** * Border color + * EdgeColors be supportted at version 9 * @since 7 */ - borderColor(value: ResourceColor): T; + borderColor(value: EdgeColors | ResourceColor): T; /** * Border radius + * BorderRadiuses be supportted at version 9 * @since 7 */ - borderRadius(value: Length): T; + borderRadius(value: BorderRadiuses | Length): T; /** * Trigger a click event when a click is clicked. diff --git a/api/@internal/component/ets/units.d.ts b/api/@internal/component/ets/units.d.ts index 1eeb8aeadf..9091554403 100644 --- a/api/@internal/component/ets/units.d.ts +++ b/api/@internal/component/ets/units.d.ts @@ -81,6 +81,126 @@ declare type Padding = { */ declare type Margin = Padding; +/** + * Defines the border width property. + * @since 9 + */ +declare type EdgeWidths = { + /** + * top property. + * @since 9 + */ + top?: Length; + + /** + * right property. + * @since 9 + */ + right?: Length; + + /** + * bottom property. + * @since 9 + */ + bottom?: Length; + + /** + * left property. + * @since 9 + */ + left?: Length; +}; + +/** + * Defines the border radius property. + * @since 9 + */ +declare type BorderRadiuses = { + /** + * top-left property. + * @since 9 + */ + topLeft?: Length; + + /** + * top-right property. + * @since 9 + */ + topRight?: Length; + + /** + * bottom-left property. + * @since 9 + */ + bottomLeft?: Length; + + /** + * bottom-right property. + * @since 9 + */ + bottomRight?: Length; +}; + +/** + * Defines the border color property. + * @since 9 + */ +declare type EdgeColors = { + /** + * top property. + * @since 9 + */ + top?: ResourceColor; + + /** + * right property. + * @since 9 + */ + right?: ResourceColor; + + /** + * bottom property. + * @since 9 + */ + bottom?: ResourceColor; + + /** + * left property. + * @since 9 + */ + left?: ResourceColor; +}; + +/** + * Defines the border style property. + * @since 9 + */ +declare type EdgeStyles = { + /** + * top property. + * @since 9 + */ + top?: BorderStyle; + + /** + * right property. + * @since 9 + */ + right?: BorderStyle; + + /** + * bottom property. + * @since 9 + */ + bottom?: BorderStyle; + + /** + * left property. + * @since 9 + */ + left?: BorderStyle; +}; + /** * Defines the offset property. * @since 7 @@ -227,22 +347,26 @@ declare interface SizeOptions { declare interface BorderOptions { /** * Defines the border width. + * EdgeWidths be supportted at version 9 * @since 7 */ - width?: Length; + width?: EdgeWidths | Length; /** * Defines the border color. + * EdgeColors be supportted at version 9 * @since 7 */ - color?: ResourceColor; + color?: EdgeColors | ResourceColor; /** * Defines the border radius. + * BorderRadiuses be supportted at version 9 * @since 7 */ - radius?: Length; + radius?: BorderRadiuses | Length; /** * Defines the border style. + * EdgeStyles be supportted at version 9 * @since 7 */ - style?: BorderStyle; + style?: EdgeStyles | BorderStyle; } -- Gitee