From dfc74134d8c72897a779fbe2acb415a18e045fa9 Mon Sep 17 00:00:00 2001 From: Kira Date: Tue, 1 Jun 2021 11:31:24 +0800 Subject: [PATCH 1/2] =?UTF-8?q?KERNEL-7826=20refactor:=20=E8=A1=A5?= =?UTF-8?q?=E5=85=85props=E5=A3=B0=E6=98=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- typescript/base/single/label/abstract.label.ts | 13 +++++++------ typescript/base/single/label/html.label.ts | 9 +++++++++ typescript/base/single/label/label.ts | 1 - typescript/core/wrapper/layout/layout.grid.ts | 5 +++++ typescript/index.ts | 3 +++ typescript/shims-tsx.ts | 8 +++++++- 6 files changed, 31 insertions(+), 8 deletions(-) create mode 100644 typescript/base/single/label/html.label.ts diff --git a/typescript/base/single/label/abstract.label.ts b/typescript/base/single/label/abstract.label.ts index 683d6baef..794844b24 100644 --- a/typescript/base/single/label/abstract.label.ts +++ b/typescript/base/single/label/abstract.label.ts @@ -4,12 +4,13 @@ export declare class AbstractLabel extends Single { static xtype: string; props: { - textAlign: "left" | "center" | "right", - whiteSpace: "nowrap" | "normal", - textWidth: number | null, - textHeight: number | null, - highLight: boolean, - handler: Function | null, + textAlign: "left" | "center" | "right"; + whiteSpace: "nowrap" | "normal"; + textWidth: number | null; + textHeight: number | null; + highLight: boolean; + handler: Function | null; + text: string; } & Single['props'] doRedMark(...args: any[]): void; diff --git a/typescript/base/single/label/html.label.ts b/typescript/base/single/label/html.label.ts new file mode 100644 index 000000000..07d8c7c8d --- /dev/null +++ b/typescript/base/single/label/html.label.ts @@ -0,0 +1,9 @@ +import { AbstractLabel } from "./abstract.label"; + +export declare class HtmlLabel extends AbstractLabel { + props: { + lineHeight: number; + } & AbstractLabel['props']; + + static xtype: string; +} diff --git a/typescript/base/single/label/label.ts b/typescript/base/single/label/label.ts index d4c393a97..02704fff2 100644 --- a/typescript/base/single/label/label.ts +++ b/typescript/base/single/label/label.ts @@ -4,7 +4,6 @@ export declare class Label extends AbstractLabel { props: { py: string; keyword: string; - text: string; } & AbstractLabel['props']; static xtype: string; diff --git a/typescript/core/wrapper/layout/layout.grid.ts b/typescript/core/wrapper/layout/layout.grid.ts index f79671759..027ff5c2e 100644 --- a/typescript/core/wrapper/layout/layout.grid.ts +++ b/typescript/core/wrapper/layout/layout.grid.ts @@ -2,4 +2,9 @@ import { Layout } from '../layout'; export declare class GridLayout extends Layout { static xtype: string; + + props: { + columns: number; + rows: number; + } } diff --git a/typescript/index.ts b/typescript/index.ts index 5a35dde5a..bce1f1f19 100644 --- a/typescript/index.ts +++ b/typescript/index.ts @@ -168,6 +168,7 @@ import { TimeInterval } from './widget/timeinterval/timeinterval'; import { DynamicDateTimePane } from './widget/datetimepane/datetimepane'; import { SingleSelectInsertList } from './widget/singleselect/singleselectlist.insert'; import { MultiSelectTree } from './widget/multiselecttree/multiselecttree'; +import { HtmlLabel } from "./base/single/label/html.label"; export interface BI extends _func, _i18n, _base, _inject, _var, _web, _utils { @@ -343,6 +344,7 @@ export interface BI extends _func, _i18n, _base, _inject, _var, _web, _utils { DynamicDateTimePane: typeof DynamicDateTimePane; SingleSelectInsertList: typeof SingleSelectInsertList; MultiSelectTree: typeof MultiSelectTree; + HtmlLabel: typeof HtmlLabel; } export default { @@ -518,4 +520,5 @@ export { DynamicDateTimePane, SingleSelectInsertList, MultiSelectTree, + HtmlLabel, }; diff --git a/typescript/shims-tsx.ts b/typescript/shims-tsx.ts index cc39b52fd..47854e9e1 100644 --- a/typescript/shims-tsx.ts +++ b/typescript/shims-tsx.ts @@ -15,6 +15,12 @@ interface UIProps { hgap: number; } +// 一些布局的附加属性 +interface AdditionalProps { + column: number; + row: number; +} + interface ElementClassProps extends UIProps { cls: string; extraCls: string; @@ -48,7 +54,7 @@ interface ElementClassProps extends UIProps { declare namespace JSX { // for undefined interface IntrinsicElements { - [elemName: string]: Partial; + [elemName: string]: Partial; } interface ElementAttributesProperty { From 20184e51e22863d257ef8f14bb18e96d01535a55 Mon Sep 17 00:00:00 2001 From: Kira Date: Tue, 1 Jun 2021 15:59:42 +0800 Subject: [PATCH 2/2] =?UTF-8?q?KERNEL-7826=20refactor:=20=E8=A1=A5?= =?UTF-8?q?=E5=85=85props=E5=A3=B0=E6=98=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- typescript/base/single/button/buttons/button.icon.ts | 5 +++++ typescript/case/button/icon/icon.change.ts | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/typescript/base/single/button/buttons/button.icon.ts b/typescript/base/single/button/buttons/button.icon.ts index 035657bdb..d3d6817e1 100644 --- a/typescript/base/single/button/buttons/button.icon.ts +++ b/typescript/base/single/button/buttons/button.icon.ts @@ -3,4 +3,9 @@ import { BasicButton } from "../button.basic"; export declare class IconButton extends BasicButton { static xtype: string; static EVENT_CHANGE: string; + + props: { + iconWidth: number; + iconHeight: number; + } & BasicButton['props'] } diff --git a/typescript/case/button/icon/icon.change.ts b/typescript/case/button/icon/icon.change.ts index 3e134140a..717273487 100644 --- a/typescript/case/button/icon/icon.change.ts +++ b/typescript/case/button/icon/icon.change.ts @@ -1,9 +1,14 @@ +import { IconButton } from "../../../base/single/button/buttons/button.icon"; import { Single } from "../../../base/single/single"; export declare class IconChangeButton extends Single { static xtype: string; static EVENT_CHANGE: string; + props: { + iconCls: string; + } & IconButton['props'] + isSelected(): boolean; setSelected(v: boolean): void;