2023-03-01 14:46:28 +00:00
|
|
|
/**
|
|
|
|
*
|
|
|
|
* Carousel is a content slider featuring various customization options.
|
|
|
|
*
|
|
|
|
* [Live Demo](https://www.primevue.org/carousel/)
|
|
|
|
*
|
|
|
|
* @module carousel
|
|
|
|
*
|
|
|
|
*/
|
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';
|
|
|
|
|
|
|
|
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;
|
|
|
|
}
|
2023-03-01 14:46:28 +00:00
|
|
|
/**
|
|
|
|
* Defines valid properties in Carousel component.
|
|
|
|
*/
|
2022-09-06 12:03:37 +00:00
|
|
|
export interface CarouselProps {
|
|
|
|
/**
|
|
|
|
* An array of objects to display.
|
|
|
|
*/
|
|
|
|
value?: any | undefined;
|
|
|
|
/**
|
|
|
|
* Index of the first item.
|
2023-03-01 14:46:28 +00:00
|
|
|
* @defaultValue 0
|
2022-09-06 12:03:37 +00:00
|
|
|
*/
|
2022-09-14 11:26:01 +00:00
|
|
|
page?: number | undefined;
|
2022-09-06 12:03:37 +00:00
|
|
|
/**
|
|
|
|
* Number of items per page.
|
2023-03-01 14:46:28 +00:00
|
|
|
* @defaultValue 1
|
2022-09-06 12:03:37 +00:00
|
|
|
*/
|
2022-09-14 11:26:01 +00:00
|
|
|
numVisible?: number | undefined;
|
2022-09-06 12:03:37 +00:00
|
|
|
/**
|
|
|
|
* Number of items to scroll.
|
2023-03-01 14:46:28 +00:00
|
|
|
* @defaultValue 1
|
2022-09-06 12:03:37 +00:00
|
|
|
*/
|
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'.
|
2023-03-01 14:46:28 +00:00
|
|
|
* @defaultValue horizontal
|
2022-09-06 12:03:37 +00:00
|
|
|
*/
|
2023-03-01 14:46:28 +00:00
|
|
|
orientation?: 'horizontal' | 'vertical' | undefined;
|
2022-09-06 12:03:37 +00:00
|
|
|
/**
|
|
|
|
* Height of the viewport in vertical layout.
|
2023-03-03 08:18:55 +00:00
|
|
|
* @defaultValue '300px'
|
2022-09-06 12:03:37 +00:00
|
|
|
*/
|
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.
|
2023-03-01 14:46:28 +00:00
|
|
|
* @defaultValue false
|
2022-09-06 12:03:37 +00:00
|
|
|
*/
|
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.
|
2023-03-01 14:46:28 +00:00
|
|
|
* @defaultValue 0
|
2022-09-06 12:03:37 +00:00
|
|
|
*/
|
2022-09-14 11:26:01 +00:00
|
|
|
autoplayInterval?: number | undefined;
|
|
|
|
/**
|
|
|
|
* Whether to display navigation buttons in container.
|
2023-03-01 14:46:28 +00:00
|
|
|
* @defaultValue true
|
2022-09-14 11:26:01 +00:00
|
|
|
*/
|
|
|
|
showNavigators?: boolean | undefined;
|
|
|
|
/**
|
|
|
|
* Whether to display indicator container.
|
2023-03-01 14:46:28 +00:00
|
|
|
* @defaultValue true
|
2022-09-14 11:26:01 +00:00
|
|
|
*/
|
|
|
|
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
|
|
|
}
|
|
|
|
|
2023-03-01 14:46:28 +00:00
|
|
|
/**
|
|
|
|
* Defines valid slots in Carousel slots.
|
|
|
|
*/
|
2022-09-06 12:03:37 +00:00
|
|
|
export interface CarouselSlots {
|
|
|
|
/**
|
|
|
|
* Custom content for each item.
|
|
|
|
* @param {Object} scope - item slot's params.
|
|
|
|
*/
|
2023-03-01 14:46:28 +00:00
|
|
|
item(scope: {
|
2022-09-06 12:03:37 +00:00
|
|
|
/**
|
|
|
|
* Data of the component
|
|
|
|
*/
|
|
|
|
data: any;
|
|
|
|
/**
|
|
|
|
* Index of the item
|
|
|
|
*/
|
|
|
|
index: number;
|
2023-03-01 14:46:28 +00:00
|
|
|
}): VNode[];
|
2022-09-14 11:26:01 +00:00
|
|
|
/**
|
2022-09-06 12:03:37 +00:00
|
|
|
* Custom header template.
|
|
|
|
*/
|
2023-03-01 14:46:28 +00:00
|
|
|
header(): VNode[];
|
2022-09-14 11:26:01 +00:00
|
|
|
/**
|
|
|
|
* Custom footer template.
|
|
|
|
*/
|
2023-03-01 14:46:28 +00:00
|
|
|
footer(): VNode[];
|
2022-09-06 12:03:37 +00:00
|
|
|
}
|
|
|
|
|
2023-03-01 14:46:28 +00:00
|
|
|
/**
|
|
|
|
* Defines valid emits in Carousel component.
|
|
|
|
*/
|
|
|
|
export interface CarouselEmits {
|
2022-09-06 12:03:37 +00:00
|
|
|
/**
|
|
|
|
* Emitted when the page changes.
|
|
|
|
* @param {number} value - New page value.
|
|
|
|
*/
|
2023-03-01 14:46:28 +00:00
|
|
|
'update:page'(value: number): void;
|
|
|
|
}
|
2022-09-06 12:03:37 +00:00
|
|
|
|
2023-03-01 14:46:28 +00:00
|
|
|
/**
|
|
|
|
* **PrimeVue - Carousel**
|
|
|
|
*
|
|
|
|
* _Carousel is a content slider featuring various customization options._
|
|
|
|
*
|
|
|
|
* [Live Demo](https://www.primevue.org/carousel/)
|
|
|
|
* --- ---
|
2023-03-03 10:55:20 +00:00
|
|
|
* ![PrimeVue](https://primefaces.org/cdn/primevue/images/logo-100.png)
|
2023-03-01 14:46:28 +00:00
|
|
|
*
|
|
|
|
* @group Component
|
|
|
|
*
|
|
|
|
*/
|
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
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export default Carousel;
|