diff --git a/components/lib/accordion/Accordion.d.ts b/components/lib/accordion/Accordion.d.ts index 8e5f117ce..8b8f2fafd 100755 --- a/components/lib/accordion/Accordion.d.ts +++ b/components/lib/accordion/Accordion.d.ts @@ -10,6 +10,15 @@ import { VNode } from 'vue'; import { ClassComponent, GlobalComponentConstructor } from '../ts-helpers'; +export declare type AccordionPassThroughOptionType = AccordionPassThroughAttributes | ((options: AccordionPassThroughMethodOptions) => AccordionPassThroughAttributes) | null | undefined; + +/** + * Custom passthrough(pt) option method. + */ +export interface AccordionPassThroughMethodOptions { + props: AccordionProps; + state: AccordionState; +} /** * Custom tab open event. * @see {@link AccordionEmits.tab-open} @@ -40,6 +49,38 @@ export interface AccordionTabCloseEvent extends AccordionTabOpenEvent {} */ export interface AccordionClickEvent extends AccordionTabOpenEvent {} +/** + * Custom passthrough(pt) options. + * @see {@link AccordionProps.pt} + */ +export interface AccordionPassThroughOptions { + /** + * Uses to pass attributes to the root's DOM element. + */ + root?: AccordionPassThroughOptionType; +} + +/** + * Custom passthrough attributes for each DOM elements + */ +export interface AccordionPassThroughAttributes { + [key: string]: any; +} + +/** + * Defines current inline state in Accordion component. + */ +export interface AccordionState { + /** + * Current id state as a string + */ + id: string; + /** + * Current active index state as a boolean + */ + d_activeIndex: boolean; +} + /** * Defines valid properties in Accordion component. */ @@ -79,6 +120,11 @@ export interface AccordionProps { * @defaultValue false */ selectOnFocus?: boolean | undefined; + /** + * Uses to pass attributes to DOM elements inside the component. + * @type {AccordionPassThroughOptions} + */ + pt?: AccordionPassThroughOptions; } /** diff --git a/components/lib/accordion/Accordion.vue b/components/lib/accordion/Accordion.vue index 7c4beb618..37345e781 100755 --- a/components/lib/accordion/Accordion.vue +++ b/components/lib/accordion/Accordion.vue @@ -1,7 +1,7 @@