From 5743e4ef4736a37f9ee7496112e6ffe223871a96 Mon Sep 17 00:00:00 2001 From: Kira Date: Fri, 18 Dec 2020 11:10:59 +0800 Subject: [PATCH 1/3] =?UTF-8?q?KERNEL-6533=20refactor:=20=E5=A3=B0?= =?UTF-8?q?=E6=98=8E=E8=A1=A5=E5=85=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../single/button/listitem/icontextitem.ts | 15 ++++- typescript/base/single/input/checkbox.ts | 9 ++- typescript/base/single/input/input.ts | 47 +++++++++++++++- typescript/case/button/switch.ts | 6 ++ .../combo.searchtextvalue.ts | 13 ++++- typescript/case/editor/editor.shelter.ts | 56 +++++++++++++++++++ .../core/wrapper/layout/layout.horizontal.ts | 5 ++ typescript/index.ts | 24 ++++++-- .../combo.textvaluedownlist.ts | 8 +++ 9 files changed, 174 insertions(+), 9 deletions(-) create mode 100644 typescript/case/button/switch.ts create mode 100644 typescript/case/editor/editor.shelter.ts create mode 100644 typescript/core/wrapper/layout/layout.horizontal.ts create mode 100644 typescript/widget/textvaluedownlistcombo/combo.textvaluedownlist.ts diff --git a/typescript/base/single/button/listitem/icontextitem.ts b/typescript/base/single/button/listitem/icontextitem.ts index 80d7d40bd..e43b24b93 100644 --- a/typescript/base/single/button/listitem/icontextitem.ts +++ b/typescript/base/single/button/listitem/icontextitem.ts @@ -1,4 +1,4 @@ -import { _BasicButton } from "../button.basic"; +import { BasicButton, _BasicButton } from "../button.basic"; export interface _IconTextItem extends _BasicButton { doRedMark(...args: any[]): void; @@ -13,3 +13,16 @@ export interface _IconTextItem extends _BasicButton { export interface _IconTextItemStatic { EVENT_CHANGE: string; } + +export declare class IconTextItem extends BasicButton { + static xtype: string; + static EVENT_CHANGE: string; + + doRedMark(...args: any[]): void; + + unRedMark(...args: any[]): void; + + doHighLight(...args: any[]): void; + + unHighLight(...args: any[]): void; +} diff --git a/typescript/base/single/input/checkbox.ts b/typescript/base/single/input/checkbox.ts index b1a367b8b..6f8e0c081 100644 --- a/typescript/base/single/input/checkbox.ts +++ b/typescript/base/single/input/checkbox.ts @@ -1,4 +1,4 @@ -import { _BasicButton } from "../button/button.basic"; +import { BasicButton, _BasicButton } from "../button/button.basic"; export interface _Checkbox extends _BasicButton { _setEnable(enable: boolean): void; @@ -7,3 +7,10 @@ export interface _Checkbox extends _BasicButton { export interface _CheckboxStatic { EVENT_CHANGE: string; } + +export declare class Checkbox extends BasicButton { + static xtype: string; + static EVENT_CHANGE: string; + + _setEnable(enable: boolean): void; +} diff --git a/typescript/base/single/input/input.ts b/typescript/base/single/input/input.ts index 006f30064..9b1f2ff6d 100644 --- a/typescript/base/single/input/input.ts +++ b/typescript/base/single/input/input.ts @@ -1,4 +1,4 @@ -import { _Single } from "../single"; +import { _Single, Single } from "../single"; export interface _Input extends _Single { onClick(): void; @@ -8,7 +8,7 @@ export interface _Input extends _Single { focus(): void; blur(): void; - + selectAll(): void; setValue(v: string): void; @@ -43,3 +43,46 @@ export interface _InputStatic { EVENT_ENTER: string; EVENT_RESTRICT: string; } + +export declare class Input extends Single { + static xtype: string; + static EVENT_CHANGE: string; + static EVENT_FOCUS: string; + static EVENT_CLICK: string; + static EVENT_BLUR: string; + static EVENT_KEY_DOWN: string; + static EVENT_QUICK_DOWN: string; + static EVENT_SPACE: string; + static EVENT_BACKSPACE: string; + static EVENT_START: string; + static EVENT_PAUSE: string; + static EVENT_STOP: string; + static EVENT_CHANGE_CONFIRM: string; + static EVENT_CONFIRM: string; + static EVENT_REMOVE: string; + static EVENT_EMPTY: string; + static EVENT_VALID: string; + static EVENT_ERROR: string; + static EVENT_ENTER: string; + static EVENT_RESTRICT: string; + + onClick(): void; + + onKeyDown(keyCode: number): void; + + focus(): void; + + blur(): void; + + selectAll(): void; + + setValue(v: string): void; + + getValue(): string; + + isEditing(): boolean; + + getLastValidValue(): string; + + getLastChangedValue(): string; +} diff --git a/typescript/case/button/switch.ts b/typescript/case/button/switch.ts new file mode 100644 index 000000000..dc4489892 --- /dev/null +++ b/typescript/case/button/switch.ts @@ -0,0 +1,6 @@ +import { BasicButton } from "../../base/single/button/button.basic"; + +export declare class Switch extends BasicButton { + static xtype: string; + static EVENT_CHANGE: string; +} diff --git a/typescript/case/combo/searchtextvaluecombo/combo.searchtextvalue.ts b/typescript/case/combo/searchtextvaluecombo/combo.searchtextvalue.ts index c87eccbcd..6292abee4 100644 --- a/typescript/case/combo/searchtextvaluecombo/combo.searchtextvalue.ts +++ b/typescript/case/combo/searchtextvaluecombo/combo.searchtextvalue.ts @@ -1,4 +1,4 @@ -import { _Widget } from "../../../core/widget"; +import { _Widget, Widget } from "../../../core/widget"; export interface _SearchTextValueCombo extends _Widget { populate(items: any[]): void; @@ -12,3 +12,14 @@ export interface _SearchTextValueComboStatic { EVENT_CHANGE: string; EVENT_BEFORE_POPUPVIEW: string; } + + +export declare class SearchTextValueCombo extends Widget { + static xtype: string; + static EVENT_CHANGE: string; + static EVENT_BEFORE_POPUPVIEW: string; + + populate(items: any[]): void; + + getValue(): T[]; +} diff --git a/typescript/case/editor/editor.shelter.ts b/typescript/case/editor/editor.shelter.ts new file mode 100644 index 000000000..97fc08e05 --- /dev/null +++ b/typescript/case/editor/editor.shelter.ts @@ -0,0 +1,56 @@ +import { Widget } from "../../core/widget"; + +export declare class ShelterEditor 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_CLICK_LABEL: 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_SPACE: string; + static EVENT_EMPTY: string; + + setTitle(v: string | Function): void; + + setWarningTitle(v: string | Function): void; + + setWaterMark(v: string): void; + + focus(): void; + + blur(): void; + + doRedMark(...args: any[]): void; + + unRedMark(...args: any[]): void; + + doHighLight(...args: any[]): void; + + unHighLight(...args: any[]): void; + + setErrorText(v: string): void; + + getErrorText(): string; + + isEditing(): boolean; + + isValid(): boolean; + + getLastValidValue(): string; + + getLastChangedValue(): string; + + getState(): any; + + setState(...args: any[]): void; +} diff --git a/typescript/core/wrapper/layout/layout.horizontal.ts b/typescript/core/wrapper/layout/layout.horizontal.ts new file mode 100644 index 000000000..d3a4d3a2a --- /dev/null +++ b/typescript/core/wrapper/layout/layout.horizontal.ts @@ -0,0 +1,5 @@ +import { Layout } from "../layout"; + +export declare class HorizontalLayout extends Layout { + static xtype: string; +} diff --git a/typescript/index.ts b/typescript/index.ts index 40b278f0c..5e8d910cb 100644 --- a/typescript/index.ts +++ b/typescript/index.ts @@ -6,11 +6,11 @@ import { _BasicButton, _BasicButtonStatic, BasicButton } from "./base/single/but import { _NodeButton, NodeButton } from "./base/single/button/button.node"; import { _Button, _ButtonStatic, Button } from "./base/single/button/buttons/button"; import { TextButton, _TextButton, _TextButtonStatic } from "./base/single/button/buttons/button.text"; -import { _IconTextItem, _IconTextItemStatic } from "./base/single/button/listitem/icontextitem"; +import { IconTextItem, _IconTextItem, _IconTextItemStatic } from "./base/single/button/listitem/icontextitem"; import { _Editor, _EditorStatic, Editor } from "./base/single/editor/editor"; import { Iframe, _Iframe } from "./base/single/iframe/iframe"; -import { _Checkbox, _CheckboxStatic } from "./base/single/input/checkbox"; -import { _Input, _InputStatic } from "./base/single/input/input"; +import { Checkbox, _Checkbox, _CheckboxStatic } from "./base/single/input/checkbox"; +import { Input, _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"; @@ -20,7 +20,7 @@ import { IconChangeButton, _IconChangeButton, _IconChangeButtonStatic } from "./ import { _MultiSelectItem, _MultiSelectItemStatic, MultiSelectItem } from "./case/button/item.multiselect"; 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 { SearchTextValueCombo, _SearchTextValueCombo, _SearchTextValueComboStatic } from "./case/combo/searchtextvaluecombo/combo.searchtextvalue"; import { _SignEditor, _SignEditorStatic, SignEditor } from "./case/editor/editor.sign"; import { _LoadingPane } from "./case/loading/loading_pane"; import { _AllValueMultiTextValueCombo, _AllValueMultiTextValueComboStatic } from "./component/allvaluemultitextvaluecombo/allvalue.multitextvalue.combo"; @@ -115,6 +115,10 @@ import { MultiLayerSingleTreeCombo } from "./widget/multilayersingletree/multila import { MultiLayerSelectTreeCombo } from "./widget/multilayerselecttree/multilayerselecttree.combo"; import { MultiTreeListCombo } from "./widget/multitree/multi.tree.list.combo"; import { MultiTreeInsertCombo } from "./widget/multitree/multi.tree.insert.combo"; +import { TextValueDownListCombo } from "./widget/textvaluedownlistcombo/combo.textvaluedownlist"; +import { Switch } from "./case/button/switch"; +import { HorizontalLayout } from "./core/wrapper/layout/layout.horizontal"; +import { ShelterEditor } from "./case/editor/editor.shelter"; type ClassConstructor = T & { @@ -243,6 +247,10 @@ export interface BI extends _func, _i18n, _base, _inject { CardLayout: typeof CardLayout; DynamicYearMonthCombo: typeof DynamicYearMonthCombo; TimeCombo: typeof TimeCombo; + TextValueDownListCombo: typeof TextValueDownListCombo; + Switch: typeof Switch; + HorizontalLayout: typeof HorizontalLayout; + ShelterEditor: typeof ShelterEditor; } export default { @@ -349,4 +357,12 @@ export { DynamicYearMonthCombo, TimeCombo, Iframe, + TextValueDownListCombo, + SearchTextValueCombo, + IconTextItem, + Checkbox, + Input, + Switch, + HorizontalLayout, + ShelterEditor, }; diff --git a/typescript/widget/textvaluedownlistcombo/combo.textvaluedownlist.ts b/typescript/widget/textvaluedownlistcombo/combo.textvaluedownlist.ts new file mode 100644 index 000000000..32ba52b4e --- /dev/null +++ b/typescript/widget/textvaluedownlistcombo/combo.textvaluedownlist.ts @@ -0,0 +1,8 @@ +import { Widget } from "../../core/widget"; + +export declare class TextValueDownListCombo extends Widget { + static xtype: string; + static EVENT_CHANGE: string; + + getValue(): [any]; +} From ba291b94f1b08a68cab562286ee69e6cb98e7e5f Mon Sep 17 00:00:00 2001 From: Kira Date: Fri, 18 Dec 2020 14:40:45 +0800 Subject: [PATCH 2/3] =?UTF-8?q?KERNEL-6533=20refactor:=20=E5=A3=B0?= =?UTF-8?q?=E6=98=8E=E8=A1=A5=E5=85=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- typescript/base/layer/layer.popup.ts | 15 +++++++++++ typescript/case/checkbox/check.arrownode.ts | 5 ++++ .../case/combo/bubblecombo/popup.bubble.ts | 23 +++++++++++++++++ typescript/case/pager/pager.all.count.ts | 24 ++++++++++++++++++ typescript/index.ts | 25 +++++++++++++++++++ typescript/widget/datepane/datepane.ts | 8 ++++++ .../widget/dynamicdate/dynamicdate.combo.ts | 11 ++++++++ .../widget/timeinterval/dateinterval.ts | 14 +++++++++++ 8 files changed, 125 insertions(+) create mode 100644 typescript/base/layer/layer.popup.ts create mode 100644 typescript/case/checkbox/check.arrownode.ts create mode 100644 typescript/case/combo/bubblecombo/popup.bubble.ts create mode 100644 typescript/case/pager/pager.all.count.ts create mode 100644 typescript/widget/datepane/datepane.ts create mode 100644 typescript/widget/timeinterval/dateinterval.ts diff --git a/typescript/base/layer/layer.popup.ts b/typescript/base/layer/layer.popup.ts new file mode 100644 index 000000000..99117f710 --- /dev/null +++ b/typescript/base/layer/layer.popup.ts @@ -0,0 +1,15 @@ +import { Widget } from '../../core/widget'; + +export declare class PopupView extends Widget { + static xtype: string; + + static EVENT_CHANGE: string; + + getView(): Widget; + + populate(...args: any[]): void; + + resetWidth(v: number): void; + + resetHeight(v: number): void; +} diff --git a/typescript/case/checkbox/check.arrownode.ts b/typescript/case/checkbox/check.arrownode.ts new file mode 100644 index 000000000..793220cb5 --- /dev/null +++ b/typescript/case/checkbox/check.arrownode.ts @@ -0,0 +1,5 @@ +import { IconButton } from "../../base/single/button/buttons/button.icon"; + +export declare class ArrowTreeGroupNodeCheckbox extends IconButton { + static xtype: string; +} diff --git a/typescript/case/combo/bubblecombo/popup.bubble.ts b/typescript/case/combo/bubblecombo/popup.bubble.ts new file mode 100644 index 000000000..71ca1e302 --- /dev/null +++ b/typescript/case/combo/bubblecombo/popup.bubble.ts @@ -0,0 +1,23 @@ +import { PopupView } from "../../../base/layer/layer.popup"; +import { Widget } from "../../../core/widget"; + +export declare class BubblePopupView extends PopupView { + static xtype: string; + static EVENT_CLICK_TOOLBAR_BUTTON: string; + + populate(v: string): void; +} + +export declare class BubblePopupBarView extends BubblePopupView { + static xtype: string; + static EVENT_CLICK_TOOLBAR_BUTTON: string; + + populate(v: string): void; +} + +export declare class TextBubblePopupBarView extends Widget { + static xtype: string; + static EVENT_CHANGE: string; + + populate(v: string): void; +} diff --git a/typescript/case/pager/pager.all.count.ts b/typescript/case/pager/pager.all.count.ts new file mode 100644 index 000000000..12b2d87f4 --- /dev/null +++ b/typescript/case/pager/pager.all.count.ts @@ -0,0 +1,24 @@ +import { Widget } from "../../core/widget"; + +export declare class AllCountPager extends Widget { + static xtype: string; + static EVENT_CHANGE: string; + + setAllPages(v: number): void; + + setValue(v: number): void; + + setVPage(v: number):void; + + setCount(v: number | string): void; + + getCurrentPage(): number; + + hasPrev(): boolean; + + hasNext(): boolean; + + setPagerVisible(v: boolean): void; + + populate(): void; +} diff --git a/typescript/index.ts b/typescript/index.ts index c6c682954..07cb902fa 100644 --- a/typescript/index.ts +++ b/typescript/index.ts @@ -119,6 +119,13 @@ import { TextValueDownListCombo } from "./widget/textvaluedownlistcombo/combo.te import { Switch } from "./case/button/switch"; import { HorizontalLayout } from "./core/wrapper/layout/layout.horizontal"; import { ShelterEditor } from "./case/editor/editor.shelter"; +import { SelectTextTrigger } from "./case/trigger/trigger.text.select"; +import { DateInterval } from "./widget/timeinterval/dateinterval"; +import { DynamicDatePane } from "./widget/datepane/datepane"; +import { AllCountPager } from "./case/pager/pager.all.count"; +import { PopupView } from "./base/layer/layer.popup"; +import { BubblePopupView, BubblePopupBarView, TextBubblePopupBarView } from "./case/combo/bubblecombo/popup.bubble"; +import { ArrowTreeGroupNodeCheckbox } from "./case/checkbox/check.arrownode"; type ClassConstructor = T & { @@ -251,6 +258,15 @@ export interface BI extends _func, _i18n, _base, _inject { Switch: typeof Switch; HorizontalLayout: typeof HorizontalLayout; ShelterEditor: typeof ShelterEditor; + SelectTextTrigger: typeof SelectTextTrigger; + DateInterval: typeof DateInterval; + DynamicDatePane: typeof DynamicDatePane; + AllCountPager: typeof AllCountPager; + PopupView: typeof PopupView; + BubblePopupView: typeof BubblePopupView; + BubblePopupBarView: typeof BubblePopupBarView; + TextBubblePopupBarView: typeof TextBubblePopupBarView; + ArrowTreeGroupNodeCheckbox: typeof ArrowTreeGroupNodeCheckbox; } export default { @@ -377,4 +393,13 @@ export { Switch, HorizontalLayout, ShelterEditor, + SelectTextTrigger, + DateInterval, + DynamicDatePane, + AllCountPager, + PopupView, + BubblePopupView, + BubblePopupBarView, + TextBubblePopupBarView, + ArrowTreeGroupNodeCheckbox, }; diff --git a/typescript/widget/datepane/datepane.ts b/typescript/widget/datepane/datepane.ts new file mode 100644 index 000000000..2bdcc9255 --- /dev/null +++ b/typescript/widget/datepane/datepane.ts @@ -0,0 +1,8 @@ +import { Widget } from "../../core/widget"; + +export declare class DynamicDatePane extends Widget { + static xtype: string; + static EVENT_CHANGE: string; + static Static: 1; + static Dynamic: 2; +} diff --git a/typescript/widget/dynamicdate/dynamicdate.combo.ts b/typescript/widget/dynamicdate/dynamicdate.combo.ts index b4b11a15e..ca852b3b4 100644 --- a/typescript/widget/dynamicdate/dynamicdate.combo.ts +++ b/typescript/widget/dynamicdate/dynamicdate.combo.ts @@ -21,4 +21,15 @@ export declare class DynamicDateCombo extends Single { getKey(): string; hidePopupView(): void; + + getValue(): DynamicDataComboValue; +} + +export interface DynamicDataComboValue { + type: number; + value: { + year: number; + month: number; + day: number; + } } diff --git a/typescript/widget/timeinterval/dateinterval.ts b/typescript/widget/timeinterval/dateinterval.ts new file mode 100644 index 000000000..76c1c8233 --- /dev/null +++ b/typescript/widget/timeinterval/dateinterval.ts @@ -0,0 +1,14 @@ +import { Single } from "../../base/single/single"; +import { DynamicDataComboValue } from "../dynamicdate/dynamicdate.combo"; + +export declare class DateInterval extends Single { + static xtype: string; + static EVENT_CHANGE: string; + static EVENT_VALID: string; + static EVENT_ERROR: string; + + getValue(): { + start: DynamicDataComboValue; + end: DynamicDataComboValue; + }; +} From f3bfbe78382d4f2b0afb91a6bb7b64e83646c4a4 Mon Sep 17 00:00:00 2001 From: Kira Date: Fri, 18 Dec 2020 15:02:24 +0800 Subject: [PATCH 3/3] =?UTF-8?q?KERNEL-6533=20refactor:=20=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E6=8F=8F=E8=BF=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- typescript/case/combo/bubblecombo/popup.bubble.ts | 4 ---- .../widget/textvaluedownlistcombo/combo.textvaluedownlist.ts | 2 +- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/typescript/case/combo/bubblecombo/popup.bubble.ts b/typescript/case/combo/bubblecombo/popup.bubble.ts index 71ca1e302..e23113b63 100644 --- a/typescript/case/combo/bubblecombo/popup.bubble.ts +++ b/typescript/case/combo/bubblecombo/popup.bubble.ts @@ -4,15 +4,11 @@ import { Widget } from "../../../core/widget"; export declare class BubblePopupView extends PopupView { static xtype: string; static EVENT_CLICK_TOOLBAR_BUTTON: string; - - populate(v: string): void; } export declare class BubblePopupBarView extends BubblePopupView { static xtype: string; static EVENT_CLICK_TOOLBAR_BUTTON: string; - - populate(v: string): void; } export declare class TextBubblePopupBarView extends Widget { diff --git a/typescript/widget/textvaluedownlistcombo/combo.textvaluedownlist.ts b/typescript/widget/textvaluedownlistcombo/combo.textvaluedownlist.ts index 32ba52b4e..e3387f30d 100644 --- a/typescript/widget/textvaluedownlistcombo/combo.textvaluedownlist.ts +++ b/typescript/widget/textvaluedownlistcombo/combo.textvaluedownlist.ts @@ -4,5 +4,5 @@ export declare class TextValueDownListCombo extends Widget { static xtype: string; static EVENT_CHANGE: string; - getValue(): [any]; + getValue(): [T]; }