diff --git a/api-generator/components/timeline.js b/api-generator/components/timeline.js index 1e95f0ba3..45973dc90 100644 --- a/api-generator/components/timeline.js +++ b/api-generator/components/timeline.js @@ -22,6 +22,12 @@ const TimelineProps = [ type: 'string', default: 'null', description: 'Name of the field that uniquely identifies the a record in the data.' + }, + { + name: 'pt', + type: 'any', + default: 'null', + description: 'Uses to pass attributes to DOM elements inside the component.' } ]; diff --git a/components/lib/config/PrimeVue.d.ts b/components/lib/config/PrimeVue.d.ts index 76b85fa01..dfe69b8b5 100644 --- a/components/lib/config/PrimeVue.d.ts +++ b/components/lib/config/PrimeVue.d.ts @@ -70,6 +70,7 @@ import { TagPassThroughOptions } from '../tag'; import { TerminalPassThroughOptions } from '../terminal'; import { TextareaPassThroughOptions } from '../textarea'; import { TieredMenuPassThroughOptions } from '../tieredmenu'; +import { TimelinePassThroughOptions } from '../timeline'; import { ToastPassThroughOptions } from '../toast'; import { ToolbarPassThroughOptions } from '../toolbar'; import { TreePassThroughOptions } from '../tree'; @@ -166,6 +167,7 @@ interface PrimeVuePTOptions { terminal?: TerminalPassThroughOptions; textarea?: TextareaPassThroughOptions; tieredmenu?: TieredMenuPassThroughOptions; + timeline?: TimelinePassThroughOptions; toast?: ToastPassThroughOptions; toolbar?: ToolbarPassThroughOptions; tree?: TreePassThroughOptions; diff --git a/components/lib/timeline/Timeline.d.ts b/components/lib/timeline/Timeline.d.ts index 2639531b2..fc6996397 100644 --- a/components/lib/timeline/Timeline.d.ts +++ b/components/lib/timeline/Timeline.d.ts @@ -9,6 +9,50 @@ import { VNode } from 'vue'; import { ClassComponent, GlobalComponentConstructor } from '../ts-helpers'; +export declare type TimelinePassThroughOptionType = TimelinePassThroughAttributes | null | undefined; + +/** + * Custom passthrough(pt) options. + * @see {@link TimelineProps.pt} + */ +export interface TimelinePassThroughOptions { + /** + * Uses to pass attributes to the root's DOM element. + */ + root?: TimelinePassThroughOptionType; + /** + * Uses to pass attributes to the event's DOM element. + */ + event?: TimelinePassThroughOptionType; + /** + * Uses to pass attributes to the opposite's DOM element. + */ + opposite?: TimelinePassThroughOptionType; + /** + * Uses to pass attributes to the separator's DOM element. + */ + separator?: TimelinePassThroughOptionType; + /** + * Uses to pass attributes to the marker's DOM element. + */ + marker?: TimelinePassThroughOptionType; + /** + * Uses to pass attributes to the connector's DOM element. + */ + connector?: TimelinePassThroughOptionType; + /** + * Uses to pass attributes to the content's DOM element. + */ + content?: TimelinePassThroughOptionType; +} + +/** + * Custom passthrough attributes for each DOM elements + */ +export interface TimelinePassThroughAttributes { + [key: string]: any; +} + /** * Defines valid properties in Timeline component. */ @@ -31,6 +75,11 @@ export interface TimelineProps { * Name of the field that uniquely identifies the a record in the data. */ dataKey?: string | undefined; + /** + * Uses to pass attributes to DOM elements inside the component. + * @type {TimelinePassThroughOptions} + */ + pt?: TimelinePassThroughOptions; } /** diff --git a/components/lib/timeline/Timeline.vue b/components/lib/timeline/Timeline.vue index 1ddf00d10..d43359fdc 100644 --- a/components/lib/timeline/Timeline.vue +++ b/components/lib/timeline/Timeline.vue @@ -1,18 +1,18 @@