primevue-mirror/components/lib/timeline/Timeline.d.ts

233 lines
5.4 KiB
TypeScript
Raw Normal View History

2023-03-01 12:46:37 +00:00
/**
*
* Timeline visualizes a series of chained events.
*
2023-03-03 14:17:03 +00:00
* [Live Demo](https://primevue.org/timeline)
2023-03-01 12:46:37 +00:00
*
* @module timeline
*
2023-03-01 12:46:37 +00:00
*/
2022-09-06 12:03:37 +00:00
import { VNode } from 'vue';
2023-07-06 11:17:08 +00:00
import { ComponentHooks } from '../basecomponent';
2023-09-05 08:50:46 +00:00
import { PassThroughOptions } from '../passthrough';
import { ClassComponent, DesignToken, GlobalComponentConstructor, PassThrough } from '../ts-helpers';
2022-09-06 12:03:37 +00:00
2023-07-13 07:52:17 +00:00
export declare type TimelinePassThroughOptionType = TimelinePassThroughAttributes | ((options: TimelinePassThroughMethodOptions) => TimelinePassThroughAttributes | string) | string | null | undefined;
/**
* Custom passthrough(pt) option method.
*/
export interface TimelinePassThroughMethodOptions {
/**
* Defines instance.
*/
2023-07-13 07:52:17 +00:00
instance: any;
/**
* Defines valid properties.
*/
2023-07-13 07:52:17 +00:00
props: TimelineProps;
/**
* Defines current options.
*/
2023-07-13 07:52:17 +00:00
context: TimelineContext;
/**
* Defines valid attributes.
*/
attrs: any;
/**
* Defines parent options.
*/
parent: any;
2023-09-05 08:50:46 +00:00
/**
* Defines passthrough(pt) options in global config.
*/
global: object | undefined;
2023-07-13 07:52:17 +00:00
}
2023-05-10 07:28:34 +00:00
/**
* Custom passthrough(pt) options.
* @see {@link TimelineProps.pt}
*/
export interface TimelinePassThroughOptions {
/**
2024-05-15 09:22:27 +00:00
* Used to pass attributes to the roots DOM element.
2023-05-10 07:28:34 +00:00
*/
root?: TimelinePassThroughOptionType;
/**
2024-05-15 09:22:27 +00:00
* Used to pass attributes to the events DOM element.
2023-05-10 07:28:34 +00:00
*/
event?: TimelinePassThroughOptionType;
/**
2024-05-15 09:22:27 +00:00
* Used to pass attributes to the event opposites DOM element.
2023-05-10 07:28:34 +00:00
*/
eventOpposite?: TimelinePassThroughOptionType;
2023-05-10 07:28:34 +00:00
/**
2024-05-15 09:22:27 +00:00
* Used to pass attributes to the event separators DOM element.
2023-05-10 07:28:34 +00:00
*/
eventSeparator?: TimelinePassThroughOptionType;
2023-05-10 07:28:34 +00:00
/**
2024-05-15 09:22:27 +00:00
* Used to pass attributes to the event markers DOM element.
2023-05-10 07:28:34 +00:00
*/
eventMarker?: TimelinePassThroughOptionType;
2023-05-10 07:28:34 +00:00
/**
2024-05-15 09:22:27 +00:00
* Used to pass attributes to the event connectors DOM element.
2023-05-10 07:28:34 +00:00
*/
eventConnector?: TimelinePassThroughOptionType;
2023-05-10 07:28:34 +00:00
/**
2024-05-15 09:22:27 +00:00
* Used to pass attributes to the event contents DOM element.
2023-05-10 07:28:34 +00:00
*/
eventContent?: TimelinePassThroughOptionType;
2023-07-06 11:09:01 +00:00
/**
2023-11-07 06:16:39 +00:00
* Used to manage all lifecycle hooks.
2023-07-06 11:09:01 +00:00
* @see {@link BaseComponent.ComponentHooks}
*/
hooks?: ComponentHooks;
2023-05-10 07:28:34 +00:00
}
/**
* Custom passthrough attributes for each DOM elements
*/
export interface TimelinePassThroughAttributes {
[key: string]: any;
}
2023-07-13 07:52:17 +00:00
/**
* Defines current options in Timeline component.
*/
export interface TimelineContext {
/**
* Current index of the item as a number.
*/
index: number;
}
2023-03-01 12:46:37 +00:00
/**
* Defines valid properties in Timeline component.
*/
2022-09-06 12:03:37 +00:00
export interface TimelineProps {
/**
* An array of events to display.
*/
value?: any[] | undefined;
/**
* Position of the timeline bar relative to the content.
2023-03-08 10:51:52 +00:00
* @defaultValue left
2022-09-06 12:03:37 +00:00
*/
2023-03-01 12:46:37 +00:00
align?: 'left' | 'right' | 'alternate' | 'top' | 'bottom' | undefined;
2022-09-06 12:03:37 +00:00
/**
* Orientation of the timeline.
2023-03-08 10:51:52 +00:00
* @defaultValue horizontal
2022-09-06 12:03:37 +00:00
*/
2023-03-01 12:46:37 +00:00
layout?: 'vertical' | 'horizontal' | undefined;
2022-09-06 12:03:37 +00:00
/**
* Name of the field that uniquely identifies the a record in the data.
*/
dataKey?: string | undefined;
/**
* It generates scoped CSS variables using design tokens for the component.
*/
dt?: DesignToken<any>;
2023-05-10 07:28:34 +00:00
/**
2023-08-01 14:01:12 +00:00
* Used to pass attributes to DOM elements inside the component.
2023-05-10 07:28:34 +00:00
* @type {TimelinePassThroughOptions}
*/
pt?: PassThrough<TimelinePassThroughOptions>;
2023-09-05 08:50:46 +00:00
/**
* Used to configure passthrough(pt) options of the component.
* @type {PassThroughOptions}
*/
ptOptions?: PassThroughOptions;
2023-06-01 12:14:49 +00:00
/**
* When enabled, it removes component related styles in the core.
* @defaultValue false
*/
unstyled?: boolean;
2022-09-06 12:03:37 +00:00
}
2023-03-01 12:46:37 +00:00
/**
* Defines valid slots in Timeline component.
*/
2022-09-06 12:03:37 +00:00
export interface TimelineSlots {
/**
* Custom content template
* @param {Object} scope - content slot's params.
*/
2023-03-01 12:46:37 +00:00
content(scope: {
2022-09-06 12:03:37 +00:00
/**
* Item data
*/
item: any;
/**
* Index of item
*/
index: number;
2023-03-01 12:46:37 +00:00
}): VNode[];
2022-09-06 12:03:37 +00:00
/**
* Custom opposite template.
* @param {Object} scope - opposite slot's params.
*/
2023-03-01 12:46:37 +00:00
opposite(scope: {
2022-09-06 12:03:37 +00:00
/**
* Item data
*/
item: any;
/**
* Index of item
*/
index: number;
2023-03-01 12:46:37 +00:00
}): VNode[];
2022-09-06 12:03:37 +00:00
/**
* Custom marker template.
* @param {Object} scope - marker slot's params.
*/
2023-03-01 12:46:37 +00:00
marker(scope: {
2022-09-06 12:03:37 +00:00
/**
* Item data
*/
item: any;
/**
* Index of item
*/
index: number;
2023-03-01 12:46:37 +00:00
}): VNode[];
2022-09-06 12:03:37 +00:00
/**
* Custom connector template.
*/
2023-03-01 12:46:37 +00:00
connector(scope: {
2022-09-06 12:03:37 +00:00
/**
* Item data
*/
item: any;
/**
* Index of item
*/
index: number;
2023-03-01 12:46:37 +00:00
}): VNode[];
2022-09-06 12:03:37 +00:00
}
2023-03-01 12:46:37 +00:00
/**
* Defines valid emits in Timeline component.
*/
export interface TimelineEmits {}
2022-09-06 12:03:37 +00:00
2023-03-01 12:46:37 +00:00
/**
* **PrimeVue - Timeline**
*
* _Timeline visualizes a series of chained events._
*
* [Live Demo](https://www.primevue.org/timeline/)
* --- ---
* ![PrimeVue](https://primefaces.org/cdn/primevue/images/logo-100.png)
*
* @group Component
*/
2022-09-14 11:26:01 +00:00
declare class Timeline extends ClassComponent<TimelineProps, TimelineSlots, TimelineEmits> {}
2022-09-06 12:03:37 +00:00
declare module 'vue' {
export interface GlobalComponents {
2022-09-14 11:26:01 +00:00
Timeline: GlobalComponentConstructor<Timeline>;
2022-09-06 12:03:37 +00:00
}
}
export default Timeline;