Refactor #3907 - For TabMenu

This commit is contained in:
Tuğçe Küçükoğlu 2023-04-26 12:59:02 +03:00
parent 5d40f1c45d
commit 09553cbcd3
3 changed files with 87 additions and 10 deletions

View file

@ -11,6 +11,69 @@ import { VNode } from 'vue';
import { MenuItem } from '../menuitem';
import { ClassComponent, GlobalComponentConstructor } from '../ts-helpers';
export declare type TabMenuPassThroughOptionType = TabMenuPassThroughAttributes | ((options: TabMenuPassThroughMethodOptions) => TabMenuPassThroughAttributes) | null | undefined;
/**
* Custom passthrough(pt) option method.
*/
export interface TabMenuPassThroughMethodOptions {
props: TabMenuProps;
state: TabMenuState;
}
/**
* Custom passthrough(pt) options.
* @see {@link TabMenuProps.pt}
*/
export interface TabMenuPassThroughOptions {
/**
* Uses to pass attributes to the root's DOM element.
*/
root?: TabMenuPassThroughOptionType;
/**
* Uses to pass attributes to the list's DOM element.
*/
menu?: TabMenuPassThroughOptionType;
/**
* Uses to pass attributes to the list item's DOM element.
*/
menuitem?: TabMenuPassThroughOptionType;
/**
* Uses to pass attributes to the action's DOM element.
*/
action?: TabMenuPassThroughOptionType;
/**
* Uses to pass attributes to the icon's DOM element.
*/
icon?: TabMenuPassThroughOptionType;
/**
* Uses to pass attributes to the label's DOM element.
*/
label?: TabMenuPassThroughOptionType;
/**
* Uses to pass attributes to the inkbar's DOM element.
*/
inkbar?: TabMenuPassThroughOptionType;
}
/**
* Custom passthrough attributes for each DOM elements
*/
export interface TabMenuPassThroughAttributes {
[key: string]: any;
}
/**
* Defines current inline state in TabMenu component.
*/
export interface TabMenuState {
/**
* Current active index state as a number.
* @defaulValue 0
*/
d_activeIndex: number;
}
/**
* Custom change event.
* @see {@link TabMenuEmits['tab-change']}
@ -52,6 +115,11 @@ export interface TabMenuProps {
* Identifier of the underlying input element.
*/
'aria-labelledby'?: string | undefined;
/**
* Uses to pass attributes to DOM elements inside the component.
* @type {TabMenuPassThroughOptions}
*/
pt?: TabMenuPassThroughOptions;
}
/**