From 4353b8d9718f25392e9df79e7ee6cb83c5cb02fd Mon Sep 17 00:00:00 2001 From: youki Date: Mon, 14 Dec 2020 19:53:07 +0800 Subject: [PATCH] =?UTF-8?q?KERNEL-6465=20refactor:=20=E8=A1=A5=E5=85=85?= =?UTF-8?q?=E7=B1=BB=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- typescript/base/pane.ts | 13 +++++- typescript/base/single/text.ts | 16 +++++++- .../case/colorchooser/colorchooser.simple.ts | 12 ++++++ typescript/index.ts | 15 ++++++- typescript/widget/editor/editor.search.ts | 41 +++++++++++++++++++ typescript/widget/editor/editor.text.ts | 2 +- .../multilayersingletree.leveltree.ts | 15 +++++++ 7 files changed, 109 insertions(+), 5 deletions(-) create mode 100644 typescript/case/colorchooser/colorchooser.simple.ts create mode 100644 typescript/widget/editor/editor.search.ts create mode 100644 typescript/widget/multilayersingletree/multilayersingletree.leveltree.ts diff --git a/typescript/base/pane.ts b/typescript/base/pane.ts index bb042a767e..e0bf5343dd 100644 --- a/typescript/base/pane.ts +++ b/typescript/base/pane.ts @@ -1,4 +1,4 @@ -import { _Widget } from "../core/widget"; +import { _Widget, Widget } from "../core/widget"; export interface _Pane extends _Widget { _assertTip(..._args: any[]): void; @@ -11,3 +11,14 @@ export interface _Pane extends _Widget { export interface _PaneStatic { EVENT_LOADED: string; } + +export declare class Pane extends Widget { + static EVENT_LOADED: string; + + _assertTip(..._args: any[]): void; + loading(): void; + loaded(): void; + check(): void; + setTipVisible(b: boolean): void; + populate(items?: any[]): void; +} diff --git a/typescript/base/single/text.ts b/typescript/base/single/text.ts index 5763ac7e67..43de92670c 100644 --- a/typescript/base/single/text.ts +++ b/typescript/base/single/text.ts @@ -1,4 +1,4 @@ -import { _Single } from "./single"; +import { _Single, Single } from "./single"; export interface _Text extends _Single { doRedMark(keyword: string): void; @@ -13,3 +13,17 @@ export interface _Text extends _Single { setText(v: string): void; } + +export declare class Text extends Single { + static xtype: string; + + doRedMark(keyword: string): void; + + unRedMark(): void; + + doHighLight(): void; + + unHighLight(): void; + + setStyle(css: any): void; +} diff --git a/typescript/case/colorchooser/colorchooser.simple.ts b/typescript/case/colorchooser/colorchooser.simple.ts new file mode 100644 index 0000000000..4ecb0d7c34 --- /dev/null +++ b/typescript/case/colorchooser/colorchooser.simple.ts @@ -0,0 +1,12 @@ +import { Widget } from '../../core/widget'; + +export declare class SimpleColorChooser extends Widget { + static xtype: string; + static EVENT_CHANGE: string; + + isViewVisible(): boolean; + + hideView(): void; + + showView(): void; +} diff --git a/typescript/index.ts b/typescript/index.ts index 7f7ac6a4f5..dc47821006 100644 --- a/typescript/index.ts +++ b/typescript/index.ts @@ -1,7 +1,7 @@ import { _Combo, _ComboStatic } from "./base/combination/combo"; import { _ButtonGroup, _ButtonGroupChooseType, _ButtonGroupStatic, ButtonGroup } from "./base/combination/group.button"; import { _Tab, _TabStatic, Tab } from "./base/combination/tab"; -import { _Pane, _PaneStatic } from "./base/pane"; +import { _Pane, _PaneStatic, Pane } from "./base/pane"; import { _BasicButton, _BasicButtonStatic, BasicButton } from "./base/single/button/button.basic"; import { _NodeButton, NodeButton } from "./base/single/button/button.node"; import { _Button, _ButtonStatic, Button } from "./base/single/button/buttons/button"; @@ -14,7 +14,7 @@ import { _Input, _InputStatic } from "./base/single/input/input"; import { _AbstractLabel, AbstractLabel } from "./base/single/label/abstract.label"; import { _Label, Label } from "./base/single/label/label"; import { _Single, Single } from "./base/single/single"; -import { _Text } from "./base/single/text"; +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"; @@ -69,6 +69,9 @@ import { HorizontalAdaptLayout } from "./core/wrapper/layout/adapt/adapt.horizon 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"; +import { SearchEditor } from "./widget/editor/editor.search"; +import { MultiLayerSingleLevelTree } from "./widget/multilayersingletree/multilayersingletree.leveltree"; +import { SimpleColorChooser } from "./case/colorchooser/colorchooser.simple" type ClassConstructor = T & { @@ -151,6 +154,9 @@ export interface BI extends _func, _i18n, _base, _inject { MidTreeLeafItem: typeof MidTreeLeafItem; FirstTreeLeafItem: typeof FirstTreeLeafItem; LastTreeLeafItem: typeof LastTreeLeafItem; + SearchEditor: typeof SearchEditor; + MultiLayerSingleLevelTree: typeof MultiLayerSingleLevelTree; + SimpleColorChooser: typeof SimpleColorChooser; } export default { @@ -203,4 +209,9 @@ export { MidTreeLeafItem, FirstTreeLeafItem, LastTreeLeafItem, + SearchEditor, + Text, + Pane, + MultiLayerSingleLevelTree, + SimpleColorChooser, }; diff --git a/typescript/widget/editor/editor.search.ts b/typescript/widget/editor/editor.search.ts new file mode 100644 index 0000000000..7e50064372 --- /dev/null +++ b/typescript/widget/editor/editor.search.ts @@ -0,0 +1,41 @@ +import { Widget } from '../../core/widget'; + +export declare class SearchEditor extends Widget { + static xtype: string; + + static EVENT_CHANGE: string; + static EVENT_FOCUS: string; + static EVENT_BLUR: string; + static EVENT_CLICK: string; + static EVENT_KEY_DOWN: string; + static EVENT_SPACE: string; + static EVENT_BACKSPACE: string; + static EVENT_CLEAR: string; + static EVENT_START: string; + static EVENT_PAUSE: string; + static EVENT_STOP: string; + static EVENT_CONFIRM: string; + static EVENT_CHANGE_CONFIRM: string; + static EVENT_VALID: string; + static EVENT_ERROR: string; + static EVENT_ENTER: string; + static EVENT_RESTRICT: string; + static EVENT_REMOVE: string; + static EVENT_EMPTY: string; + + setWaterMark(v: string): void; + + focus(): void; + + blur(): void; + + getKeywords(): string[]; + + getLastValidValue(): string; + + getLastChangedValue(): string; + + isEditing(): boolean; + + isValid(): boolean; +} diff --git a/typescript/widget/editor/editor.text.ts b/typescript/widget/editor/editor.text.ts index 84ea3c97f7..54b9b15c25 100644 --- a/typescript/widget/editor/editor.text.ts +++ b/typescript/widget/editor/editor.text.ts @@ -32,5 +32,5 @@ export declare class TextEditor extends Widget { getErrorText(): string; - isValid(): boolean + isValid(): boolean; } diff --git a/typescript/widget/multilayersingletree/multilayersingletree.leveltree.ts b/typescript/widget/multilayersingletree/multilayersingletree.leveltree.ts new file mode 100644 index 0000000000..6a73c932ea --- /dev/null +++ b/typescript/widget/multilayersingletree/multilayersingletree.leveltree.ts @@ -0,0 +1,15 @@ +import { Pane } from '../../base/pane' + +export declare class MultiLayerSingleLevelTree extends Pane { + static xtype: string; + + initTree(nodes: any, ...args: any[]): void; + + populate(nodes: any, ...args: any[]): void; + + getAllLeaves(): T[]; + + getNodeById(id: any): any; + + getNodeByValue(value: any): any; +} \ No newline at end of file