Refactor #3924 - For Tree

This commit is contained in:
Tuğçe Küçükoğlu 2023-05-07 22:21:37 +03:00
parent 6a4226a4e0
commit e10c1cf988
5 changed files with 158 additions and 19 deletions

View file

@ -10,6 +10,16 @@
import { VNode } from 'vue';
import { ClassComponent, GlobalComponentConstructor } from '../ts-helpers';
export declare type TreePassThroughOptionType = TreePassThroughAttributes | ((options: TreePassThroughMethodOptions) => TreePassThroughAttributes) | null | undefined;
/**
* Custom passthrough(pt) option method.
*/
export interface TreePassThroughMethodOptions {
props: TreeProps;
state: TreeState;
}
/**
* Custom TreeNode metadata.
*/
@ -90,6 +100,106 @@ export interface TreeSelectionKeys {
[key: string]: any;
}
/**
* Custom passthrough(pt) options.
* @see {@link TreeProps.pt}
*/
export interface TreePassThroughOptions {
/**
* Uses to pass attributes to the root's DOM element.
*/
root?: TreePassThroughOptionType;
/**
* Uses to pass attributes to the loading overlay's DOM element.
*/
loadingOverlay?: TreePassThroughOptionType;
/**
* Uses to pass attributes to the loading icon's DOM element.
*/
loadingIcon?: TreePassThroughOptionType;
/**
* Uses to pass attributes to the filter container's DOM element.
*/
filterContainer?: TreePassThroughOptionType;
/**
* Uses to pass attributes to the input's DOM element.
*/
input?: TreePassThroughOptionType;
/**
* Uses to pass attributes to the search icon's DOM element.
*/
searchIcon?: TreePassThroughOptionType;
/**
* Uses to pass attributes to the wrapper's DOM element.
*/
wrapper?: TreePassThroughOptionType;
/**
* Uses to pass attributes to the container's DOM element.
*/
container?: TreePassThroughOptionType;
/**
* Uses to pass attributes to the node's DOM element.
*/
node?: TreePassThroughOptionType;
/**
* Uses to pass attributes to the content's DOM element.
*/
content?: TreePassThroughOptionType;
/**
* Uses to pass attributes to the toggler's DOM element.
*/
toggler?: TreePassThroughOptionType;
/**
* Uses to pass attributes to the toggler icon's DOM element.
*/
togglerIcon?: TreePassThroughOptionType;
/**
* Uses to pass attributes to the checkbox container's DOM element.
*/
checkboxContainer?: TreePassThroughOptionType;
/**
* Uses to pass attributes to the checkbox's DOM element.
*/
checkbox?: TreePassThroughOptionType;
/**
* Uses to pass attributes to the checkbox icon's DOM element.
*/
checkboxIcon?: TreePassThroughOptionType;
/**
* Uses to pass attributes to the node icon's DOM element.
*/
nodeIcon?: TreePassThroughOptionType;
/**
* Uses to pass attributes to the label's DOM element.
*/
label?: TreePassThroughOptionType;
/**
* Uses to pass attributes to the subgroup's DOM element.
*/
subgroup?: TreePassThroughOptionType;
}
/**
* Custom passthrough attributes for each DOM elements
*/
export interface TreePassThroughAttributes {
[key: string]: any;
}
/**
* Defines current inline state in Tree component.
*/
export interface TreeState {
/**
* Current expanded keys state.
*/
d_expandedKeys: TreeExpandedKeys;
/**
* Current filter value state as a string.
*/
filterValue: string;
}
/**
* Defines valid properties in Tree component.
*/
@ -161,6 +271,11 @@ export interface TreeProps {
* Identifier of the underlying menu element.
*/
'aria-labelledby'?: string | undefined;
/**
* Uses to pass attributes to DOM elements inside the component.
* @type {TreePassThroughOptions}
*/
pt?: TreePassThroughOptions;
}
/**