diff --git a/types/menu.d.ts b/types/menu.d.ts index f0e66cd3b..0f04d2428 100644 --- a/types/menu.d.ts +++ b/types/menu.d.ts @@ -37,4 +37,10 @@ export declare class ElMenu extends ElementUIComponent { /** Whether the menu collapse transition is active */ collapseTransition: boolean + + /** Open the specified sub-menu */ + open (index: string): void + + /** Close the specified sub-menu */ + close (index: string): void } diff --git a/types/table.d.ts b/types/table.d.ts index e668dbd10..31ea4d8fc 100644 --- a/types/table.d.ts +++ b/types/table.d.ts @@ -99,4 +99,21 @@ export declare class ElTable extends ElementUIComponent { * @param row The row that is going to set as selected */ setCurrentRow (row?: object): void + + /** + * Toggle or set if a certain row is expanded + * + * @param row The row that is going to set its expanded state + * @param expanded Whether the row is expanded. The expanded state will be toggled if not set + */ + toggleRowExpansion (row: object, expanded?: boolean): void + + /** Clear sort status, reset the table to unsorted */ + clearSort (): void + + /** Clear filter, reset the table to unfiltered */ + clearFilter (): void + + /** Relayout the table, maybe needed when change the table or it's ancestors visibility */ + doLayout (): void } diff --git a/types/transfer.d.ts b/types/transfer.d.ts index ac9a8cfcf..9f35a7b04 100644 --- a/types/transfer.d.ts +++ b/types/transfer.d.ts @@ -1,6 +1,8 @@ import { CreateElement, VNode } from 'vue' import { ElementUIComponent } from './component' +export type TransferPanelPosition = 'left' | 'right' + export interface TransferData { key: any, label: string, @@ -65,4 +67,7 @@ export declare class ElTransfer extends ElementUIComponent { /** Key array of initially checked data items of the right list */ rightDefaultChecked: any[] + + /** Clear the query text in specified panel */ + clearQuery (which: TransferPanelPosition): void } diff --git a/types/tree.d.ts b/types/tree.d.ts index 34441a59c..9cd5407e1 100644 --- a/types/tree.d.ts +++ b/types/tree.d.ts @@ -84,12 +84,20 @@ export declare class ElTree extends ElementUIComponent { indent: number /** - * Filter all tree nodes.Ffiltered nodes will be hidden + * Filter all tree nodes. Filtered nodes will be hidden * * @param value The value to be used as first parameter for `filter-node-method` */ filter (value: any): void + /** + * Update the children of the node which specified by the key + * + * @param key the key of the node which children will be updated + * @param data the children data + */ + updateKeyChildren (key: any, data: TreeNode[]): void + /** * If the node can be selected (`show-checkbox` is `true`), it returns the currently selected array of nodes * @@ -129,6 +137,16 @@ export declare class ElTree extends ElementUIComponent { */ setChecked (data: TreeNode | any, checked: boolean, deep: boolean): void + /** + * If the node can be selected (`show-checkbox` is `true`), it returns the currently half selected array of nodes + */ + getHalfCheckedNodes (): void + + /** + * If the node can be selected (`show-checkbox` is `true`), it returns the currently half selected array of nodes' keys + */ + getHalfCheckedKeys (): void; + /** * Return the highlight node's key (null if no node is highlighted) */ @@ -152,4 +170,42 @@ export declare class ElTree extends ElementUIComponent { * @param node The node to be highlighted */ setCurrentNode (node: TreeNode): void + + /** + * Get node by node key or node data + * + * @param by node key or node data + */ + getNode (by: TreeNode | any): TreeNode + + /** + * Remove node by key or node data or node instance + * + * @param by key or node data or node instance + */ + remove (by: TreeNode | any): void + + /** + * Append a child node to specified node + * + * @param childData the data of appended node + * @param parent key or node data or node instance of the parent node + */ + append (childData: TreeNode, parent: TreeNode | any): void + + /** + * insert a node before specified node + * + * @param data the data of inserted node + * @param ref key or node data or node instance of the reference node + */ + insertBefore (data: TreeNode, ref: TreeNode | any): void + + /** + * insert a node after specified node + * + * @param data the data of inserted node + * @param ref key or node data or node instance of the reference node + */ + insertAfter (data: TreeNode, ref: TreeNode | any): void } diff --git a/types/upload.d.ts b/types/upload.d.ts index 0c896fac7..f48023303 100644 --- a/types/upload.d.ts +++ b/types/upload.d.ts @@ -108,4 +108,10 @@ export declare class ElUpload extends ElementUIComponent { /** Hook function when limit is exceeded */ onExceed: (file: ElUploadInternalFileDetail, fileList: ElUploadInternalFileDetail[]) => void + + /** Clear the upload file list */ + clearFiles (): void; + + /** Abort specified file */ + abort (file: ElUploadInternalFileDetail): void }