Refactor #3924 - For DataView & DataViewLayoutOptions

This commit is contained in:
Tuğçe Küçükoğlu 2023-05-10 01:39:10 +03:00
parent f101f1379d
commit b82bf5295a
7 changed files with 173 additions and 13 deletions

View file

@ -10,6 +10,66 @@
import { VNode } from 'vue';
import { ClassComponent, GlobalComponentConstructor } from '../ts-helpers';
export declare type DataViewLayoutOptionsPassThroughOptionType = DataViewLayoutOptionsPassThroughAttributes | ((options: DataViewLayoutOptionsPassThroughMethodOptions) => DataViewLayoutOptionsPassThroughAttributes) | null | undefined;
/**
* Custom passthrough(pt) option method.
*/
export interface DataViewLayoutOptionsPassThroughMethodOptions {
props: DataViewLayoutOptionsProps;
state: DataViewLayoutOptionsState;
}
/**
* Custom passthrough(pt) options.
* @see {@link DataViewLayoutOptionsProps.pt}
*/
export interface DataViewLayoutOptionsPassThroughOptions {
/**
* Uses to pass attributes to the root's DOM element.
*/
root?: DataViewLayoutOptionsPassThroughOptionType;
/**
* Uses to pass attributes to the list button's DOM element.
*/
listButton?: DataViewLayoutOptionsPassThroughOptionType;
/**
* Uses to pass attributes to the list icon's DOM element.
*/
listIcon?: DataViewLayoutOptionsPassThroughOptionType;
/**
* Uses to pass attributes to the grid button's DOM element.
*/
gridButton?: DataViewLayoutOptionsPassThroughOptionType;
/**
* Uses to pass attributes to the grid icon's DOM element.
*/
gridIcon?: DataViewLayoutOptionsPassThroughOptionType;
}
/**
* Custom passthrough attributes for each DOM elements
*/
export interface DataViewLayoutOptionsPassThroughAttributes {
[key: string]: any;
}
/**
* Defines current inline state in DataViewLayoutOptions component.
*/
export interface DataViewLayoutOptionsState {
/**
* Current list button pressed state as a boolean.
* @defaultValue false
*/
isListButtonPressed: boolean;
/**
* Current grid button pressed state as a boolean.
* @defaultValue false
*/
isGridButtonPressed: boolean;
}
/**
* Defines valid properties in DataViewLayoutOptions component.
*/
@ -18,6 +78,11 @@ export interface DataViewLayoutOptionsProps {
* Value of the component.
*/
modelValue?: string | undefined;
/**
* Uses to pass attributes to DOM elements inside the component.
* @type {DataViewLayoutOptionsPassThroughOptions}
*/
pt?: DataViewLayoutOptionsPassThroughOptions;
}
/**