From c6299e3291a51f64faae8f9b4f67a161b3d41ff3 Mon Sep 17 00:00:00 2001 From: iapyang Date: Mon, 14 Dec 2020 15:47:11 +0800 Subject: [PATCH 1/2] =?UTF-8?q?refactor:=20=E8=A1=A5=E5=85=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- typescript/core/wrapper/layout/adapt/absolute.center.ts | 5 +++++ typescript/index.ts | 3 +++ 2 files changed, 8 insertions(+) create mode 100644 typescript/core/wrapper/layout/adapt/absolute.center.ts diff --git a/typescript/core/wrapper/layout/adapt/absolute.center.ts b/typescript/core/wrapper/layout/adapt/absolute.center.ts new file mode 100644 index 000000000..44a346ec3 --- /dev/null +++ b/typescript/core/wrapper/layout/adapt/absolute.center.ts @@ -0,0 +1,5 @@ +import { Layout } from "../../layout"; + +export declare class AbsoluteCenterLayout extends Layout { + static xtype: string; +} diff --git a/typescript/index.ts b/typescript/index.ts index 7f3f6bf2a..8d356f7a2 100644 --- a/typescript/index.ts +++ b/typescript/index.ts @@ -64,6 +64,7 @@ import { IconArrowNode } from "./case/button/node/node.icon.arrow"; import { MidTreeLeafItem } from "./case/button/treeitem/item.mid.treeleaf"; import { FirstTreeLeafItem } from "./case/button/treeitem/item.first.treeleaf"; import { LastTreeLeafItem } from "./case/button/treeitem/item.last.treeleaf"; +import { AbsoluteCenterLayout } from "./core/wrapper/layout/adapt/absolute.center"; type ClassConstructor = T & { @@ -128,6 +129,7 @@ export interface BI extends _func, _i18n, _base, _inject { InlineVerticalAdaptLayout: typeof InlineVerticalAdaptLayout; RightVerticalAdaptLayout: typeof RightVerticalAdaptLayout; TableAdaptLayout: typeof TableAdaptLayout; + AbsoluteCenterLayout: typeof AbsoluteCenterLayout; IconButton: typeof IconButton; TextEditor: typeof TextEditor; IconLabel: typeof IconLabel; @@ -157,6 +159,7 @@ export { InlineVerticalAdaptLayout, RightVerticalAdaptLayout, TableAdaptLayout, + AbsoluteCenterLayout, IconButton, AbstractLabel, Label, From 0c931ae5b4d5c5f36da62af315d8507a34883a62 Mon Sep 17 00:00:00 2001 From: iapyang Date: Mon, 14 Dec 2020 16:31:35 +0800 Subject: [PATCH 2/2] =?UTF-8?q?refactor:=20=E6=9B=B4=E6=96=B0=E6=8F=8F?= =?UTF-8?q?=E8=BF=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- typescript/core/wrapper/layout.ts | 2 ++ .../core/wrapper/layout/adapt/adapt.center.ts | 5 ++++ .../wrapper/layout/adapt/adapt.horizontal.ts | 5 ++++ .../wrapper/layout/adapt/adapt.vertical.ts | 5 ++++ .../core/wrapper/layout/layout.absolute.ts | 6 +++- .../core/wrapper/layout/layout.default.ts | 6 +++- typescript/core/wrapper/layout/layout.flow.ts | 5 ++++ typescript/core/wrapper/layout/layout.tape.ts | 9 ++++++ .../core/wrapper/layout/layout.vertical.ts | 6 +++- typescript/index.ts | 28 +++++++++++++++---- 10 files changed, 69 insertions(+), 8 deletions(-) create mode 100644 typescript/core/wrapper/layout/adapt/adapt.center.ts create mode 100644 typescript/core/wrapper/layout/adapt/adapt.horizontal.ts create mode 100644 typescript/core/wrapper/layout/adapt/adapt.vertical.ts create mode 100644 typescript/core/wrapper/layout/layout.flow.ts diff --git a/typescript/core/wrapper/layout.ts b/typescript/core/wrapper/layout.ts index 672f444d3..33b9c5472 100644 --- a/typescript/core/wrapper/layout.ts +++ b/typescript/core/wrapper/layout.ts @@ -33,6 +33,8 @@ export interface _Layout extends _Widget { } export declare class Layout extends Widget { + static xtype: string; + addItem(item: any): any; prependItem(item: any): any; diff --git a/typescript/core/wrapper/layout/adapt/adapt.center.ts b/typescript/core/wrapper/layout/adapt/adapt.center.ts new file mode 100644 index 000000000..f45a9b391 --- /dev/null +++ b/typescript/core/wrapper/layout/adapt/adapt.center.ts @@ -0,0 +1,5 @@ +import { Layout } from "typescript"; + +export declare class CenterAdaptLayout extends Layout { + static xtype: string; +} diff --git a/typescript/core/wrapper/layout/adapt/adapt.horizontal.ts b/typescript/core/wrapper/layout/adapt/adapt.horizontal.ts new file mode 100644 index 000000000..5f842a0fe --- /dev/null +++ b/typescript/core/wrapper/layout/adapt/adapt.horizontal.ts @@ -0,0 +1,5 @@ +import { Layout } from "../../layout"; + +export declare class HorizontalAdaptLayout extends Layout { + static xtype: string; +} diff --git a/typescript/core/wrapper/layout/adapt/adapt.vertical.ts b/typescript/core/wrapper/layout/adapt/adapt.vertical.ts new file mode 100644 index 000000000..6687c2ebb --- /dev/null +++ b/typescript/core/wrapper/layout/adapt/adapt.vertical.ts @@ -0,0 +1,5 @@ +import { Layout } from "typescript"; + +export declare class VerticalAdaptLayout extends Layout { + static xtype: string; +} diff --git a/typescript/core/wrapper/layout/layout.absolute.ts b/typescript/core/wrapper/layout/layout.absolute.ts index d848647cb..118d5ea16 100644 --- a/typescript/core/wrapper/layout/layout.absolute.ts +++ b/typescript/core/wrapper/layout/layout.absolute.ts @@ -1,4 +1,4 @@ -import { _Layout } from "../layout"; +import { Layout, _Layout } from "../layout"; export interface _AbsoluteLayout extends _Layout { resize(): void; @@ -7,3 +7,7 @@ export interface _AbsoluteLayout extends _Layout { populate(items?: T[]): void; } + +export declare class AbsoluteLayout extends Layout { + static xtype: string; +} diff --git a/typescript/core/wrapper/layout/layout.default.ts b/typescript/core/wrapper/layout/layout.default.ts index b8d2f7632..0a63abbe5 100644 --- a/typescript/core/wrapper/layout/layout.default.ts +++ b/typescript/core/wrapper/layout/layout.default.ts @@ -1,7 +1,11 @@ -import { _Layout } from "../layout"; +import { Layout, _Layout } from "../layout"; export interface _DefaultLayout extends _Layout { resize(): void; populate(items?: T[]): void; } + +export declare class DefaultLayout extends Layout { + static xtype: string; +} diff --git a/typescript/core/wrapper/layout/layout.flow.ts b/typescript/core/wrapper/layout/layout.flow.ts new file mode 100644 index 000000000..ce77aebfa --- /dev/null +++ b/typescript/core/wrapper/layout/layout.flow.ts @@ -0,0 +1,5 @@ +import { Layout } from "../layout"; + +export declare class FloatLeftLayout extends Layout { + static xtype: string; +} diff --git a/typescript/core/wrapper/layout/layout.tape.ts b/typescript/core/wrapper/layout/layout.tape.ts index fbd7c0ed4..bd599ffbf 100644 --- a/typescript/core/wrapper/layout/layout.tape.ts +++ b/typescript/core/wrapper/layout/layout.tape.ts @@ -1,3 +1,4 @@ +import { Layout } from "typescript"; import { _Layout } from "../layout"; export interface _HTapeLayout extends _Layout { @@ -19,3 +20,11 @@ export interface _VTapeLayout extends _Layout { populate(items?: T[]): void; } + +export declare class HTapeLayout extends Layout { + static xtype: string; +} + +export declare class VTapeLayout extends Layout { + static xtype: string; +} diff --git a/typescript/core/wrapper/layout/layout.vertical.ts b/typescript/core/wrapper/layout/layout.vertical.ts index 6fe104181..3d0e5f4f2 100644 --- a/typescript/core/wrapper/layout/layout.vertical.ts +++ b/typescript/core/wrapper/layout/layout.vertical.ts @@ -1,7 +1,11 @@ -import { _Layout } from "../layout"; +import { Layout, _Layout } from "../layout"; export interface _VerticalLayout extends _Layout { resize(): void; populate(items?: T[]): void; } + +export declare class VerticalLayout extends Layout { + static xtype: string; +} diff --git a/typescript/index.ts b/typescript/index.ts index 8d356f7a2..7f7ac6a4f 100644 --- a/typescript/index.ts +++ b/typescript/index.ts @@ -39,11 +39,11 @@ import { _Plugin } from "./core/plugin"; import { _OB } from "./core/ob"; import { _Widget, _WidgetStatic, Widget } from "./core/widget"; import { _inject } from "./core/inject"; -import { _Layout } from "./core/wrapper/layout"; -import { _AbsoluteLayout } from "./core/wrapper/layout/layout.absolute"; -import { _HTapeLayout, _VTapeLayout } from "./core/wrapper/layout/layout.tape"; -import { _VerticalLayout } from "./core/wrapper/layout/layout.vertical"; -import { _DefaultLayout } from "./core/wrapper/layout/layout.default"; +import { Layout, _Layout } from "./core/wrapper/layout"; +import { AbsoluteLayout, _AbsoluteLayout } from "./core/wrapper/layout/layout.absolute"; +import { HTapeLayout, VTapeLayout, _HTapeLayout, _VTapeLayout } from "./core/wrapper/layout/layout.tape"; +import { VerticalLayout, _VerticalLayout } from "./core/wrapper/layout/layout.vertical"; +import { DefaultLayout, _DefaultLayout } from "./core/wrapper/layout/layout.default"; import { DownListCombo, _DownListCombo, _DownListComboStatic } from "./widget/downlist/combo.downlist"; import { Icon } from "./base/single/icon/icon"; import { _LeftVerticalAdapt } from "./core/wrapper/layout/adapt/adapt.leftvertical"; @@ -65,6 +65,10 @@ import { MidTreeLeafItem } from "./case/button/treeitem/item.mid.treeleaf"; import { FirstTreeLeafItem } from "./case/button/treeitem/item.first.treeleaf"; import { LastTreeLeafItem } from "./case/button/treeitem/item.last.treeleaf"; import { AbsoluteCenterLayout } from "./core/wrapper/layout/adapt/absolute.center"; +import { HorizontalAdaptLayout } from "./core/wrapper/layout/adapt/adapt.horizontal"; +import { FloatLeftLayout } from "./core/wrapper/layout/layout.flow"; +import { CenterAdaptLayout } from "./core/wrapper/layout/adapt/adapt.center"; +import { VerticalAdaptLayout } from "./core/wrapper/layout/adapt/adapt.vertical"; type ClassConstructor = T & { @@ -130,6 +134,10 @@ export interface BI extends _func, _i18n, _base, _inject { RightVerticalAdaptLayout: typeof RightVerticalAdaptLayout; TableAdaptLayout: typeof TableAdaptLayout; AbsoluteCenterLayout: typeof AbsoluteCenterLayout; + HorizontalAdaptLayout: typeof HorizontalAdaptLayout; + FloatLeftLayout: typeof FloatLeftLayout; + CenterAdaptLayout: typeof CenterAdaptLayout; + VerticalAdaptLayout: typeof VerticalAdaptLayout; IconButton: typeof IconButton; TextEditor: typeof TextEditor; IconLabel: typeof IconLabel; @@ -155,11 +163,21 @@ export { Icon, LeftRightVerticalAdaptLayout, IconTextIconItem, + Layout, HorizontalAutoLayout, InlineVerticalAdaptLayout, RightVerticalAdaptLayout, TableAdaptLayout, AbsoluteCenterLayout, + HorizontalAdaptLayout, + FloatLeftLayout, + VerticalLayout, + AbsoluteLayout, + DefaultLayout, + HTapeLayout, + CenterAdaptLayout, + VTapeLayout, + VerticalAdaptLayout, IconButton, AbstractLabel, Label,