From a8d8d6c66644e33130ef16f99f8d4d48855aa5fb Mon Sep 17 00:00:00 2001 From: Kira Date: Tue, 18 May 2021 10:21:42 +0800 Subject: [PATCH 1/4] =?UTF-8?q?KERNEL-7826=20refactor:=20props=E5=A3=B0?= =?UTF-8?q?=E6=98=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- typescript/base/single/button/button.basic.ts | 36 +++++++++++++++++++ typescript/base/single/single.ts | 12 +++---- 2 files changed, 42 insertions(+), 6 deletions(-) diff --git a/typescript/base/single/button/button.basic.ts b/typescript/base/single/button/button.basic.ts index 00f0e70cf..2914425d3 100644 --- a/typescript/base/single/button/button.basic.ts +++ b/typescript/base/single/button/button.basic.ts @@ -5,6 +5,42 @@ export declare class BasicButton extends Single { static xtype: string; + props: { + value?: string; + stopEvent?: boolean; + stopPropagation?: boolean; + selected?: boolean; + + /** + * 点击一次选中有效,再点无效 + */ + once?: boolean; + + /** + * 点击即选中, 选中了就不会被取消,与once的区别是forceSelected不影响事件的触发 + */ + forceSelected?: boolean; + + /** + * 无论怎么点击都不会被选中 + */ + forceNotSelected?: boolean; + + /** + * 使能选中 + */ + disableSelected?: boolean; + shadow?: boolean; + + /** + * 选中状态下是否显示阴影 + */ + isShadowShowingOnSelected?: boolean; + trigger?: string | null; + handler?: Function; + bubble?: Function | null; + } & Single['props']; + _createShadow(): void; bindEvent(): void; diff --git a/typescript/base/single/single.ts b/typescript/base/single/single.ts index 4d7ced56e..6684993f6 100644 --- a/typescript/base/single/single.ts +++ b/typescript/base/single/single.ts @@ -6,17 +6,17 @@ interface SingleOpt { export declare class Single extends Widget { props: { - readonly: boolean, - title: string | (() => string) | null, - warningTitle: string | (() => string) | null, - tipType: "success" | "warning", - value: string | null, + readonly?: boolean, + title?: string | (() => string) | null, + warningTitle?: string | (() => string) | null, + tipType?: "success" | "warning", + value?: string | null, /** * title是否跟随鼠标 * @default false */ - belowMouse: boolean, + belowMouse?: boolean, } _showToolTip(e: Event, opt?: SingleOpt): void; From 4850d55b8a578c9bd52f863072421525af5c6e74 Mon Sep 17 00:00:00 2001 From: Kira Date: Tue, 18 May 2021 10:47:37 +0800 Subject: [PATCH 2/4] =?UTF-8?q?KERNEL-7826=20refactor:=20props=E5=A3=B0?= =?UTF-8?q?=E6=98=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- typescript/base/single/button/button.basic.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/typescript/base/single/button/button.basic.ts b/typescript/base/single/button/button.basic.ts index 2914425d3..9e43dbe53 100644 --- a/typescript/base/single/button/button.basic.ts +++ b/typescript/base/single/button/button.basic.ts @@ -6,7 +6,6 @@ export declare class BasicButton extends Single { static xtype: string; props: { - value?: string; stopEvent?: boolean; stopPropagation?: boolean; selected?: boolean; From 5982b953736390b28a1205c3e8fe62820115bc16 Mon Sep 17 00:00:00 2001 From: Kira Date: Tue, 18 May 2021 10:49:37 +0800 Subject: [PATCH 3/4] =?UTF-8?q?KERNEL-7826=20refactor:=20props=E5=A3=B0?= =?UTF-8?q?=E6=98=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- typescript/base/single/single.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/typescript/base/single/single.ts b/typescript/base/single/single.ts index 6684993f6..bdcdcf5ae 100644 --- a/typescript/base/single/single.ts +++ b/typescript/base/single/single.ts @@ -10,7 +10,7 @@ export declare class Single extends Widget { title?: string | (() => string) | null, warningTitle?: string | (() => string) | null, tipType?: "success" | "warning", - value?: string | null, + value?: any, /** * title是否跟随鼠标 From 2b38b3cc7c592c08dec56a1b3eb46973c3e65bb4 Mon Sep 17 00:00:00 2001 From: Kira Date: Tue, 18 May 2021 11:03:40 +0800 Subject: [PATCH 4/4] =?UTF-8?q?KERNEL-7826=20refactor:=20props=E5=A3=B0?= =?UTF-8?q?=E6=98=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- typescript/base/single/button/button.node.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/typescript/base/single/button/button.node.ts b/typescript/base/single/button/button.node.ts index 7414ddf4e..6dfe7929c 100644 --- a/typescript/base/single/button/button.node.ts +++ b/typescript/base/single/button/button.node.ts @@ -1,6 +1,10 @@ import { BasicButton } from "./button.basic"; export declare class NodeButton extends BasicButton { + props: { + open?: boolean; + } & BasicButton['props']; + isOpened(): boolean; setOpened(b: boolean): void;