2022-12-08 11:04:25 +00:00
|
|
|
import { ButtonHTMLAttributes, VNode } from 'vue';
|
2022-09-06 12:03:37 +00:00
|
|
|
import { ClassComponent, GlobalComponentConstructor } from '../ts-helpers';
|
|
|
|
|
|
|
|
type CarouselOrientationType = 'horizontal' | 'vertical' | undefined;
|
|
|
|
|
|
|
|
export interface CarouselResponsiveOptions {
|
|
|
|
/**
|
|
|
|
* Breakpoint for responsive mode. Exp; @media screen and (max-width: ${breakpoint}) {...}
|
|
|
|
*/
|
|
|
|
breakpoint: string;
|
|
|
|
/**
|
|
|
|
* The number of visible items on breakpoint.
|
|
|
|
*/
|
|
|
|
numVisible: number;
|
|
|
|
/**
|
|
|
|
* The number of scrolled items on breakpoint.
|
|
|
|
*/
|
|
|
|
numScroll: number;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface CarouselProps {
|
|
|
|
/**
|
|
|
|
* An array of objects to display.
|
|
|
|
*/
|
|
|
|
value?: any | undefined;
|
|
|
|
/**
|
|
|
|
* Index of the first item.
|
|
|
|
* Default value is 0.
|
|
|
|
*/
|
2022-09-14 11:26:01 +00:00
|
|
|
page?: number | undefined;
|
2022-09-06 12:03:37 +00:00
|
|
|
/**
|
|
|
|
* Number of items per page.
|
|
|
|
* Default value is 1.
|
|
|
|
*/
|
2022-09-14 11:26:01 +00:00
|
|
|
numVisible?: number | undefined;
|
2022-09-06 12:03:37 +00:00
|
|
|
/**
|
|
|
|
* Number of items to scroll.
|
|
|
|
* Default value is 1.
|
|
|
|
*/
|
2022-09-14 11:26:01 +00:00
|
|
|
numScroll?: number | undefined;
|
2022-09-06 12:03:37 +00:00
|
|
|
/**
|
|
|
|
* An array of options for responsive design.
|
|
|
|
* @see CarouselResponsiveOptions
|
|
|
|
*/
|
2022-09-14 11:26:01 +00:00
|
|
|
responsiveOptions?: CarouselResponsiveOptions[] | undefined;
|
2022-09-06 12:03:37 +00:00
|
|
|
/**
|
|
|
|
* Specifies the layout of the component, valid values are 'horizontal' and 'vertical'.
|
|
|
|
* @see CarouselOrientationType
|
|
|
|
* Default value is 'horizontal'.
|
|
|
|
*/
|
2022-09-14 11:26:01 +00:00
|
|
|
orientation?: CarouselOrientationType;
|
2022-09-06 12:03:37 +00:00
|
|
|
/**
|
|
|
|
* Height of the viewport in vertical layout.
|
|
|
|
* Default value is '300px'.
|
|
|
|
*/
|
2022-09-14 11:26:01 +00:00
|
|
|
verticalViewPortHeight?: string | undefined;
|
2022-09-06 12:03:37 +00:00
|
|
|
/**
|
|
|
|
* Style class of the viewport container.
|
|
|
|
*/
|
2022-09-14 11:26:01 +00:00
|
|
|
containerClass?: any;
|
2022-09-06 12:03:37 +00:00
|
|
|
/**
|
|
|
|
* Style class of main content.
|
|
|
|
*/
|
2022-09-14 11:26:01 +00:00
|
|
|
contentClass?: any;
|
2022-09-06 12:03:37 +00:00
|
|
|
/**
|
|
|
|
* Style class of the indicator items.
|
|
|
|
*/
|
2022-09-14 11:26:01 +00:00
|
|
|
indicatorsContentClass?: any;
|
2022-09-06 12:03:37 +00:00
|
|
|
/**
|
|
|
|
* Defines if scrolling would be infinite.
|
|
|
|
*/
|
2022-09-14 11:26:01 +00:00
|
|
|
circular?: boolean | undefined;
|
2022-09-06 12:03:37 +00:00
|
|
|
/**
|
|
|
|
* Time in milliseconds to scroll items automatically.
|
|
|
|
* Default value is 0.
|
|
|
|
*/
|
2022-09-14 11:26:01 +00:00
|
|
|
autoplayInterval?: number | undefined;
|
|
|
|
/**
|
|
|
|
* Whether to display navigation buttons in container.
|
|
|
|
* Default value is true.
|
|
|
|
*/
|
|
|
|
showNavigators?: boolean | undefined;
|
|
|
|
/**
|
|
|
|
* Whether to display indicator container.
|
|
|
|
* Default value is true.
|
|
|
|
*/
|
|
|
|
showIndicators?: boolean | undefined;
|
2022-12-08 11:04:25 +00:00
|
|
|
/**
|
|
|
|
* Uses to pass all properties of the HTMLButtonElement to the previous navigation button.
|
|
|
|
*/
|
|
|
|
prevButtonProps?: ButtonHTMLAttributes | undefined;
|
|
|
|
/**
|
|
|
|
* Uses to pass all properties of the HTMLButtonElement to the next navigation button.
|
|
|
|
*/
|
|
|
|
nextButtonProps?: ButtonHTMLAttributes | undefined;
|
2022-09-06 12:03:37 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export interface CarouselSlots {
|
|
|
|
/**
|
|
|
|
* Custom content for each item.
|
|
|
|
* @param {Object} scope - item slot's params.
|
|
|
|
*/
|
|
|
|
item: (scope: {
|
|
|
|
/**
|
|
|
|
* Data of the component
|
|
|
|
*/
|
|
|
|
data: any;
|
|
|
|
/**
|
|
|
|
* Index of the item
|
|
|
|
*/
|
|
|
|
index: number;
|
|
|
|
}) => VNode[];
|
2022-09-14 11:26:01 +00:00
|
|
|
/**
|
2022-09-06 12:03:37 +00:00
|
|
|
* Custom header template.
|
|
|
|
*/
|
|
|
|
header: () => VNode[];
|
2022-09-14 11:26:01 +00:00
|
|
|
/**
|
|
|
|
* Custom footer template.
|
|
|
|
*/
|
2022-09-06 12:03:37 +00:00
|
|
|
footer: () => VNode[];
|
|
|
|
}
|
|
|
|
|
|
|
|
export declare type CarouselEmits = {
|
|
|
|
/**
|
|
|
|
* Emitted when the page changes.
|
|
|
|
* @param {number} value - New page value.
|
|
|
|
*/
|
|
|
|
'update:page': (value: number) => void;
|
2022-09-14 11:26:01 +00:00
|
|
|
};
|
2022-09-06 12:03:37 +00:00
|
|
|
|
2022-09-14 11:26:01 +00:00
|
|
|
declare class Carousel extends ClassComponent<CarouselProps, CarouselSlots, CarouselEmits> {}
|
2022-09-06 12:03:37 +00:00
|
|
|
|
|
|
|
declare module '@vue/runtime-core' {
|
|
|
|
interface GlobalComponents {
|
2022-09-14 11:26:01 +00:00
|
|
|
Carousel: GlobalComponentConstructor<Carousel>;
|
2022-09-06 12:03:37 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
*
|
|
|
|
* Carousel is a content slider featuring various customization options.
|
|
|
|
*
|
|
|
|
* Demos:
|
|
|
|
*
|
2022-09-14 11:26:01 +00:00
|
|
|
* - [Carousel](https://www.primefaces.org/primevue/carousel)
|
2022-09-06 12:03:37 +00:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
export default Carousel;
|