diff --git a/typescript/base/tree/ztree/asynctree.ts b/typescript/base/tree/ztree/asynctree.ts new file mode 100644 index 0000000000..b0671368ee --- /dev/null +++ b/typescript/base/tree/ztree/asynctree.ts @@ -0,0 +1,11 @@ +import { TreeView, TreeValue } from "./treeview"; + +export declare class AsyncTree extends TreeView { + static xtype: string; + + _beforeExpandNode(treeId: string, treeNode: T): void; + + _join(valueA: TreeValue, valueB: TreeValue): TreeValue; + + _getJoinValue(): TreeValue; +} diff --git a/typescript/base/tree/ztree/list/listasynctree.ts b/typescript/base/tree/ztree/list/listasynctree.ts new file mode 100644 index 0000000000..047764c050 --- /dev/null +++ b/typescript/base/tree/ztree/list/listasynctree.ts @@ -0,0 +1,5 @@ +import { ListTreeView } from "./listtreeview"; + +export declare class ListAsyncTree extends ListTreeView { + static xtype: string; +} diff --git a/typescript/base/tree/ztree/list/listtreeview.ts b/typescript/base/tree/ztree/list/listtreeview.ts new file mode 100644 index 0000000000..3f16685929 --- /dev/null +++ b/typescript/base/tree/ztree/list/listtreeview.ts @@ -0,0 +1,5 @@ +import { TreeView } from "../treeview"; + +export declare class ListTreeView extends TreeView { + static xtype: string; +} diff --git a/typescript/base/tree/ztree/treeview.ts b/typescript/base/tree/ztree/treeview.ts new file mode 100644 index 0000000000..0bdf2ac30b --- /dev/null +++ b/typescript/base/tree/ztree/treeview.ts @@ -0,0 +1,70 @@ +import { Pane } from "../../pane"; + +export declare class TreeView extends Pane { + static xtype: string; + static REQ_TYPE_INIT_DATA: 1; + static REQ_TYPE_ADJUST_DATA: 2; + static REQ_TYPE_SELECT_DATA: 3; + static REQ_TYPE_GET_SELECTED_DATA: 4; + + static EVENT_CHANGE: string; + static EVENT_INIT: string; + static EVENT_AFTERINIT: string; + + _createTree(): void; + + _selectTreeNode(treeId: string, treeNode: T): void; + + _configSetting(): {[key: string]: any}; + + _getParentValues(treeNode: T): U; + + _getNodeValue(treeNode: T): U; + + _getHalfSelectedValues(map: TreeValue, node: T): void; + + _getTree(map: TreeValue, values: string[]): TreeValue; + + _addTreeNode(map: TreeValue, values: string[], key: string, value: string): void; + + _buildTree(map: TreeValue, values: string[]): void; + + _getSelectedValues(): TreeValue; + + _dealWidthNodes(nodes: T[]): T[]; + + _loadMore(): void; + + _initTree(setting: {[key: string]: any}): void; + + initTree(node: T, setting: {[key: string]: any}): void; + + start(): void; + + stop(): void; + + stroke(config: {[key: string]: any}): void; + + hasChecked(): boolean; + + checkAll(checked: T[]): void; + + expandAll(flag: boolean): void; + + setValue(value: TreeValue, param: {[key: string]: any}): void; + + setSelectedValue(value: TreeValue): void; + + updateValue(value: TreeValue, param: {[key: string]: any}): void; + + refresh(): void; + + getValue(): TreeValue; + + // @ts-ignore + populate(config: {[key: string]: any}): void; +} + +export interface TreeValue { + [key: string]: TreeValue; +} diff --git a/typescript/index.ts b/typescript/index.ts index a0b97af80d..b768d88e1c 100644 --- a/typescript/index.ts +++ b/typescript/index.ts @@ -98,10 +98,16 @@ import { ListTreeValueChooserInsertCombo } from "./component/treevaluechooser/co import { TreeValueChooserCombo } from "./component/treevaluechooser/combo.treevaluechooser"; import { TreeValueChooserInsertCombo } from "./component/treevaluechooser/combo.treevaluechooser.insert"; import { Radio } from "./base/single/input/radio/radio"; +import { MultiLayerSelectTreePopup } from "./widget/multilayerselecttree/multilayerselecttree.popup"; +import { MultiLayerSingleTreePopup } from "./widget/multilayersingletree/multilayersingletree.popup"; +import { TreeView } from "./base/tree/ztree/treeview"; import { MultiTreePopup } from "./widget/multitree/multi.tree.popup"; import { SingleSelectRadioItem } from "./case/button/item.singleselect.radio"; import { SingleSelectInsertCombo } from "./widget/singleselect/singleselect.insert.combo"; import { SingleSelectCombo } from "./widget/singleselect/singleselect.combo"; +import { ListTreeView } from "./base/tree/ztree/list/listtreeview"; +import { ListAsyncTree } from "./base/tree/ztree/list/listasynctree"; +import { AsyncTree } from "./base/tree/ztree/asynctree"; type ClassConstructor = T & { @@ -153,6 +159,12 @@ export interface BI extends _func, _i18n, _base, _inject { ListTreeValueChooserInsertCombo: typeof ListTreeValueChooserInsertCombo; TreeValueChooserCombo: typeof TreeValueChooserCombo; TreeValueChooserInsertCombo: typeof TreeValueChooserInsertCombo; + MultiLayerSelectTreePopup: typeof MultiLayerSelectTreePopup; + MultiLayerSingleTreePopup: typeof MultiLayerSingleTreePopup; + TreeView: typeof TreeView; + ListTreeView: typeof ListTreeView; + ListAsyncTree: typeof ListAsyncTree; + AsyncTree: typeof AsyncTree; Decorators: typeof decorator; DownListCombo: ClassConstructor<_DownListCombo> & _DownListComboStatic; Iframe: ClassConstructor<_Iframe>; @@ -273,6 +285,12 @@ export { ListTreeValueChooserInsertCombo, TreeValueChooserCombo, TreeValueChooserInsertCombo, + MultiLayerSelectTreePopup, + MultiLayerSingleTreePopup, + TreeView, + ListTreeView, + ListAsyncTree, + AsyncTree, Combo, IconCombo, DynamicDateCombo, diff --git a/typescript/widget/multilayerselecttree/multilayerselecttree.popup.ts b/typescript/widget/multilayerselecttree/multilayerselecttree.popup.ts new file mode 100644 index 0000000000..fe90f90ab7 --- /dev/null +++ b/typescript/widget/multilayerselecttree/multilayerselecttree.popup.ts @@ -0,0 +1,13 @@ +import { Widget } from "../../core/widget"; + +export declare class MultiLayerSelectTreePopup extends Widget { + static xtype: string; + + static EVENT_CHANGE: string; + + getValue(): T; + + setValue(v: any): void; + + populate(items: T[]): void; +} diff --git a/typescript/widget/multilayersingletree/multilayersingletree.popup.ts b/typescript/widget/multilayersingletree/multilayersingletree.popup.ts new file mode 100644 index 0000000000..6402b31f3a --- /dev/null +++ b/typescript/widget/multilayersingletree/multilayersingletree.popup.ts @@ -0,0 +1,13 @@ +import { Widget } from "../../core/widget"; + +export declare class MultiLayerSingleTreePopup extends Widget { + static xtype: string; + + static EVENT_CHANGE: string; + + getValue(): T; + + setValue(v: any): void; + + populate(items: T[]): void; +}