From 7ec3a53d1c7bd40a31d73d762d6740dbd9447ed9 Mon Sep 17 00:00:00 2001 From: iapyang Date: Tue, 15 Dec 2020 20:40:35 +0800 Subject: [PATCH 1/2] =?UTF-8?q?refactor:=20=E5=AE=8C=E5=96=84=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/base/a/a.ts | 5 +++ typescript/base/combination/group.button.ts | 2 +- typescript/base/combination/loader.ts | 29 ++++++++++++ typescript/base/combination/switcher.ts | 36 +++++++++++++++ typescript/base/single/html/html.ts | 13 ++++++ .../case/combo/bubblecombo/combo.bubble.ts | 21 ++++++++- typescript/case/layer/pane.list.ts | 39 ++++++++++++++++ typescript/case/list/list.select.ts | 45 +++++++++++++++++++ .../case/toolbar/toolbar.multiselect.ts | 13 ++++++ typescript/index.ts | 24 +++++++++- 10 files changed, 224 insertions(+), 3 deletions(-) create mode 100644 typescript/base/a/a.ts create mode 100644 typescript/base/combination/loader.ts create mode 100644 typescript/base/combination/switcher.ts create mode 100644 typescript/base/single/html/html.ts create mode 100644 typescript/case/layer/pane.list.ts create mode 100644 typescript/case/list/list.select.ts create mode 100644 typescript/case/toolbar/toolbar.multiselect.ts diff --git a/typescript/base/a/a.ts b/typescript/base/a/a.ts new file mode 100644 index 0000000000..3d4dd9f0cc --- /dev/null +++ b/typescript/base/a/a.ts @@ -0,0 +1,5 @@ +import { Text } from "../single/text"; + +export declare class A extends Text { + static xtype: string; +} diff --git a/typescript/base/combination/group.button.ts b/typescript/base/combination/group.button.ts index 20fa9656a6..ad744504a5 100644 --- a/typescript/base/combination/group.button.ts +++ b/typescript/base/combination/group.button.ts @@ -52,7 +52,7 @@ export declare class ButtonGroup extends Widget { static CHOOSE_TYPE_MULTI: number; static CHOOSE_TYPE_ALL: number; static CHOOSE_TYPE_NONE: number; - static CHOOSE_TYPE_DEFAULT: number; + static CHOOSE_TYPE_DEFAULT: number; static EVENT_CHANGE: string; prependItems(items: T[]): void; diff --git a/typescript/base/combination/loader.ts b/typescript/base/combination/loader.ts new file mode 100644 index 0000000000..604569a71f --- /dev/null +++ b/typescript/base/combination/loader.ts @@ -0,0 +1,29 @@ +import { Widget } from "../../core/widget"; + +export declare class Loader extends Widget { + static xtype: string; + + static EVENT_CHANGE: string; + + populate(items: T[]): void; + + setNotSelectedValue(...args: any[]): void; + + getNotSelectedValue(): T; + + getAllButtons(): T[]; + + getAllLeaves(): T[]; + + getSelectedButtons(): T[]; + + getNotSelectedButtons(): T[]; + + getIndexByValue(value: any): number; + + getNodeById(id: any): any; + + getNodeByValue(value: any): any; + + getValue(): T[]; +} diff --git a/typescript/base/combination/switcher.ts b/typescript/base/combination/switcher.ts new file mode 100644 index 0000000000..fd6be96d08 --- /dev/null +++ b/typescript/base/combination/switcher.ts @@ -0,0 +1,36 @@ +import { Widget } from "../../core/widget"; + +export declare class Switcher extends Widget { + static xtype: string; + static EVENT_EXPAND: string; + static EVENT_COLLAPSE: string; + static EVENT_TRIGGER_CHANGE: string; + static EVENT_CHANGE: string; + static EVENT_AFTER_INIT: string; + static EVENT_BEFORE_POPUPVIEW: string; + static EVENT_AFTER_POPUPVIEW: string; + static EVENT_BEFORE_HIDEVIEW: string; + static EVENT_AFTER_HIDEVIEW: string; + + populate(...args: any[]): void; + + setAdapter(adapter: any): void; + + isViewVisible(): boolean; + + isExpanded(): boolean; + + showView(): void; + + hideView(): void; + + getView(): T; + + adjustView(): void; + + getAllLeaves(): T[]; + + getNodeById(id: string): T | undefined; + + getNodeByValue(value: any): T | undefined; +} diff --git a/typescript/base/single/html/html.ts b/typescript/base/single/html/html.ts new file mode 100644 index 0000000000..aaea2b0eab --- /dev/null +++ b/typescript/base/single/html/html.ts @@ -0,0 +1,13 @@ +import { Single } from "../single"; + +export declare class Html extends Single { + doHighLight(): void; + + unHighLight(): void; + + setValue(v: string): void; + + setStyle(css: {[key: string]: string | number}): void; + + setText(v: string): void; +} diff --git a/typescript/case/combo/bubblecombo/combo.bubble.ts b/typescript/case/combo/bubblecombo/combo.bubble.ts index e9afaa7608..555aeee542 100644 --- a/typescript/case/combo/bubblecombo/combo.bubble.ts +++ b/typescript/case/combo/bubblecombo/combo.bubble.ts @@ -1,4 +1,4 @@ -import { _Widget } from "../../../core/widget"; +import { Widget, _Widget } from "../../../core/widget"; export interface _BubbleCombo extends _Widget { hideView(): void; @@ -19,3 +19,22 @@ export interface _BubbleComboStatic { EVENT_BEFORE_HIDEVIEW: string; EVENT_AFTER_HIDEVIEW: string; } + +export declare class BubbleCombo extends Widget { + static xtype: string; + static EVENT_TRIGGER_CHANGE: string; + static EVENT_CHANGE: string; + static EVENT_EXPAND: string; + static EVENT_COLLAPSE: string; + static EVENT_AFTER_INIT: string; + static EVENT_BEFORE_POPUPVIEW: string; + static EVENT_AFTER_POPUPVIEW: string; + static EVENT_BEFORE_HIDEVIEW: string; + static EVENT_AFTER_HIDEVIEW: string; + + hideView(): void; + + showView(): void; + + isViewVisible(): boolean; +} diff --git a/typescript/case/layer/pane.list.ts b/typescript/case/layer/pane.list.ts new file mode 100644 index 0000000000..46c3f6bfea --- /dev/null +++ b/typescript/case/layer/pane.list.ts @@ -0,0 +1,39 @@ +import { Pane } from "../../base/pane"; + +export declare class ListPane extends Pane { + static xtype: string; + + static EVENT_CHANGE: string; + + hasPrev(): boolean; + + hasNext(): boolean; + + prependItems(items: T[]): void + + addItems(items: T[]): void; + + removeItemAt(indexes: number): void; + + populate(items?: T[]): void; + + setNotSelectedValue(v: any): void; + + getNotSelectedValue(): T[]; + + setEnabledValue(v: any): void; + + getAllButtons(): T[]; + + getAllLeaves(): T[]; + + getSelectedButtons(): T[]; + + getNotSelectedButtons(): T[]; + + getIndexByValue(value: any): number; + + getNodeById(id: any): T; + + getNodeByValue(value: any): T; +} diff --git a/typescript/case/list/list.select.ts b/typescript/case/list/list.select.ts new file mode 100644 index 0000000000..233f794420 --- /dev/null +++ b/typescript/case/list/list.select.ts @@ -0,0 +1,45 @@ +import { Widget } from "../../core/widget"; + +export declare class SelectList extends Widget { + static xtype: string; + + static EVENT_CHANGE: string; + + setAllSelected(v: boolean): void; + + setToolBarVisible(v: boolean): void; + + isAllSelected(): boolean; + + hasPrev(): boolean; + + hasNext(): boolean; + + prependItems(items: T[]): void; + + addItems(items: T[]): void; + + populate(items: T[]): void; + + resetHeight(h: number): void; + + setNotSelectedValue(v: any): void; + + getNotSelectedValue(): T[]; + + setEnabledValue(v: any): void; + + getAllButtons(): T[]; + + getAllLeaves(): T[]; + + getSelectedButtons(): T[]; + + getNotSelectedButtons(): T[]; + + getIndexByValue(value: any): number; + + getNodeById(id: any): T; + + getNodeByValue(value: any): T; +} diff --git a/typescript/case/toolbar/toolbar.multiselect.ts b/typescript/case/toolbar/toolbar.multiselect.ts new file mode 100644 index 0000000000..a0e5d1d681 --- /dev/null +++ b/typescript/case/toolbar/toolbar.multiselect.ts @@ -0,0 +1,13 @@ +import { BasicButton } from "../../base/single/button/button.basic"; + +export declare class MultiSelectBar extends BasicButton { + static xtype: string; + + static EVENT_CHANGE: string; + + setHalfSelected(v: boolean): void; + + isHalfSelected(): boolean; + + setValue(selectedValues: T[]): void; +} diff --git a/typescript/index.ts b/typescript/index.ts index fb7669d65d..91446779bf 100644 --- a/typescript/index.ts +++ b/typescript/index.ts @@ -18,7 +18,7 @@ import { _Text, Text } from "./base/single/text"; import { _Trigger } from "./base/single/trigger/trigger"; import { IconChangeButton, _IconChangeButton, _IconChangeButtonStatic } from "./case/button/icon/icon.change"; import { _MultiSelectItem, _MultiSelectItemStatic, MultiSelectItem } from "./case/button/item.multiselect"; -import { _BubbleCombo, _BubbleComboStatic } from "./case/combo/bubblecombo/combo.bubble"; +import { BubbleCombo, _BubbleCombo, _BubbleComboStatic } from "./case/combo/bubblecombo/combo.bubble"; import { _TextValueCombo, _TextValueComboStatic, TextValueCombo } from "./case/combo/combo.textvalue"; import { _SearchTextValueCombo, _SearchTextValueComboStatic } from "./case/combo/searchtextvaluecombo/combo.searchtextvalue"; import { _SignEditor, _SignEditorStatic, SignEditor } from "./case/editor/editor.sign"; @@ -76,6 +76,13 @@ import { MultiSelectCombo } from "./widget/multiselect/multiselect.combo"; import { SearchEditor } from "./widget/editor/editor.search"; import { MultiLayerSingleLevelTree } from "./widget/multilayersingletree/multilayersingletree.leveltree"; import { SimpleColorChooser } from "./case/colorchooser/colorchooser.simple"; +import { A } from "./base/a/a"; +import { Html } from "./base/single/html/html"; +import { Switcher } from "./base/combination/switcher"; +import { Loader } from "./base/combination/loader"; +import { ListPane } from "./case/layer/pane.list"; +import { MultiSelectBar } from "./case/toolbar/toolbar.multiselect"; +import { SelectList } from "./case/list/list.select"; type ClassConstructor = T & { @@ -147,6 +154,13 @@ export interface BI extends _func, _i18n, _base, _inject { VerticalAdaptLayout: typeof VerticalAdaptLayout; IconButton: typeof IconButton; TextEditor: typeof TextEditor; + A: typeof A; + Html: typeof Html; + Switcher: typeof Switcher; + Loader: typeof Loader; + ListPane: typeof ListPane; + MultiSelectBar: typeof MultiSelectBar; + SelectList: typeof SelectList; IconLabel: typeof IconLabel; Popover: typeof Popover; BarPopover: typeof BarPopover; @@ -200,6 +214,14 @@ export { IconChangeButton, Button, TextEditor, + A, + Html, + Switcher, + BubbleCombo, + Loader, + ListPane, + MultiSelectBar, + SelectList, TextValueCombo, Editor, IconLabel, From 45154aba318588df7dd96d567b5439da78796524 Mon Sep 17 00:00:00 2001 From: iapyang Date: Wed, 16 Dec 2020 10:49:25 +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/base/single/html/html.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/typescript/base/single/html/html.ts b/typescript/base/single/html/html.ts index aaea2b0eab..f44bb64322 100644 --- a/typescript/base/single/html/html.ts +++ b/typescript/base/single/html/html.ts @@ -1,6 +1,8 @@ import { Single } from "../single"; export declare class Html extends Single { + static xtype: string; + doHighLight(): void; unHighLight(): void;