From a8d8d6c66644e33130ef16f99f8d4d48855aa5fb Mon Sep 17 00:00:00 2001 From: Kira Date: Tue, 18 May 2021 10:21:42 +0800 Subject: [PATCH] =?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 00f0e70cfe..2914425d3c 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 4d7ced56eb..6684993f61 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;