Fixed #1836 - For Timeline

pull/1846/head
mertsincan 2021-12-02 00:01:13 +03:00
parent e6617526e4
commit 3156c764f5
1 changed files with 94 additions and 15 deletions

View File

@ -1,25 +1,104 @@
import { VNode } from 'vue';
import { ClassComponent, GlobalComponentConstructor } from '../ts-helpers';
interface TimelineProps {
value?: any[];
align?: string;
layout?: string;
dataKey?: string;
type TimelineVerticalAlignType = 'left' | 'right';
type TimelineHorizontalAlignType = 'top' | 'bottom';
type TimelineAlignType = TimelineVerticalAlignType | TimelineHorizontalAlignType;
type TimelineLayoutType = 'vertical' | 'horizontal';
export interface TimelineProps {
/**
* An array of events to display.
*/
value?: any[] | undefined;
/**
* Position of the timeline bar relative to the content.
* @see TimelineAlignType
* Default value is 'left'.
*/
align?: TimelineAlignType;
/**
* Orientation of the timeline.
* @see TimelineLayoutType
* Default value is 'horizontal'.
*/
layout?: TimelineLayoutType;
/**
* Name of the field that uniquely identifies the a record in the data.
*/
dataKey?: string | undefined;
}
interface TimelineSlotInterface {
export interface TimelineSlots {
/**
* Custom content template
* @param {Object} scope - content slot's params.
*/
content: (scope: {
/**
* Item data
*/
item: any;
/**
* Index of item
*/
index: number;
}) => VNode[];
/**
* Custom opposite template.
* @param {Object} scope - opposite slot's params.
*/
opposite: (scope: {
/**
* Item data
*/
item: any;
/**
* Index of item
*/
index: number;
}) => VNode[];
/**
* Custom marker template.
* @param {Object} scope - marker slot's params.
*/
marker: (scope: {
/**
* Item data
*/
item: any;
/**
* Index of item
*/
index: number;
}) => VNode[];
/**
* Custom connector template.
*/
connector: () => VNode[];
}
declare class Timeline {
$props: TimelineProps;
$slots: {
content: TimelineSlotInterface;
opposite: TimelineSlotInterface;
marker: TimelineSlotInterface;
connector: VNode[];
export declare type TimelineEmits = {
}
declare class Timeline extends ClassComponent<TimelineProps, TimelineSlots, TimelineEmits> { }
declare module '@vue/runtime-core' {
interface GlobalComponents {
Timeline: GlobalComponentConstructor<Timeline>
}
}
/**
*
* Timeline visualizes a series of chained events.
*
* Demos:
*
* - [Timeline](https://www.primefaces.org/primevue/showcase/#/timeline)
*
*/
export default Timeline;