diff --git a/api-generator/components/tabmenu.js b/api-generator/components/tabmenu.js index c586f2fdd..3c94c8961 100644 --- a/api-generator/components/tabmenu.js +++ b/api-generator/components/tabmenu.js @@ -16,6 +16,12 @@ const TabMenuProps = [ type: 'number', default: '0', description: 'Active index of menuitem.' + }, + { + name: 'pt', + type: 'any', + default: 'null', + description: 'Uses to pass attributes to DOM elements inside the component.' } ]; diff --git a/components/lib/tabmenu/TabMenu.d.ts b/components/lib/tabmenu/TabMenu.d.ts index 351197ec2..956c8c46a 100755 --- a/components/lib/tabmenu/TabMenu.d.ts +++ b/components/lib/tabmenu/TabMenu.d.ts @@ -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; } /** diff --git a/components/lib/tabmenu/TabMenu.vue b/components/lib/tabmenu/TabMenu.vue index 3d43ab68a..4e4d6cee7 100755 --- a/components/lib/tabmenu/TabMenu.vue +++ b/components/lib/tabmenu/TabMenu.vue @@ -1,9 +1,9 @@