2023-10-02 10:46:09 +00:00
|
|
|
import BaseStyle from 'primevue/base/style';
|
|
|
|
|
|
|
|
const classes = {
|
|
|
|
root: ({ instance }) => [
|
|
|
|
'p-carousel p-component',
|
|
|
|
{
|
|
|
|
'p-carousel-vertical': instance.isVertical(),
|
|
|
|
'p-carousel-horizontal': !instance.isVertical()
|
|
|
|
}
|
|
|
|
],
|
|
|
|
header: 'p-carousel-header',
|
2024-04-10 06:34:25 +00:00
|
|
|
content: 'p-carousel-content-container',
|
|
|
|
container: 'p-carousel-content',
|
2023-10-02 10:46:09 +00:00
|
|
|
previousButton: ({ instance }) => [
|
2024-04-10 06:34:25 +00:00
|
|
|
'p-carousel-prev-button',
|
2023-10-02 10:46:09 +00:00
|
|
|
{
|
|
|
|
'p-disabled': instance.backwardIsDisabled
|
|
|
|
}
|
|
|
|
],
|
2024-04-10 06:34:25 +00:00
|
|
|
itemsContent: 'p-carousel-viewport',
|
|
|
|
itemsContainer: 'p-carousel-items',
|
2023-10-02 10:46:09 +00:00
|
|
|
itemCloned: ({ index, value, totalShiftedItems, d_numVisible }) => [
|
2024-04-10 06:34:25 +00:00
|
|
|
'p-carousel-item p-carousel-item-clone',
|
2023-10-02 10:46:09 +00:00
|
|
|
{
|
|
|
|
'p-carousel-item-active': totalShiftedItems * -1 === value.length + d_numVisible,
|
|
|
|
'p-carousel-item-start': index === 0,
|
|
|
|
'p-carousel-item-end': value.slice(-1 * d_numVisible).length - 1 === index
|
|
|
|
}
|
|
|
|
],
|
|
|
|
item: ({ instance, index }) => [
|
|
|
|
'p-carousel-item',
|
|
|
|
{
|
|
|
|
'p-carousel-item-active': instance.firstIndex() <= index && instance.lastIndex() >= index,
|
|
|
|
'p-carousel-item-start': instance.firstIndex() === index,
|
|
|
|
'p-carousel-item-end': instance.lastIndex() === index
|
|
|
|
}
|
|
|
|
],
|
|
|
|
nextButton: ({ instance }) => [
|
2024-04-10 06:34:25 +00:00
|
|
|
'p-carousel-next-button',
|
2023-10-02 10:46:09 +00:00
|
|
|
{
|
|
|
|
'p-disabled': instance.forwardIsDisabled
|
|
|
|
}
|
|
|
|
],
|
2024-04-10 06:34:25 +00:00
|
|
|
indicators: 'p-carousel-indicators',
|
2023-10-02 10:46:09 +00:00
|
|
|
indicator: ({ instance, index }) => [
|
|
|
|
'p-carousel-indicator',
|
|
|
|
{
|
2024-04-10 06:34:25 +00:00
|
|
|
'p-carousel-indicator-active': instance.d_page === index
|
2023-10-02 10:46:09 +00:00
|
|
|
}
|
|
|
|
],
|
2024-04-10 06:34:25 +00:00
|
|
|
indicatorButton: 'p-carousel-indicator-button',
|
2023-10-02 10:46:09 +00:00
|
|
|
footer: 'p-carousel-footer'
|
|
|
|
};
|
|
|
|
|
|
|
|
export default BaseStyle.extend({
|
|
|
|
name: 'carousel',
|
|
|
|
classes
|
|
|
|
});
|