primevue
Version:
PrimeVue is a premium UI library for Vue featuring a rich set of 90+ components, a theme designer, various theme alternatives such as Material, Bootstrap, Tailwind, premium templates and professional support. In addition, it integrates with PrimeBlock, wh
89 lines (83 loc) • 3.53 kB
JavaScript
import CarouselIndicator from 'primevue/carouselindicator';
import { mergeProps, resolveComponent, openBlock, createBlock, resolveDynamicComponent, withCtx, renderSlot, createElementBlock, Fragment, renderList, normalizeClass } from 'vue';
import BaseComponent from '@primevue/core/basecomponent';
import CarouselIndicatorsStyle from 'primevue/carouselindicators/style';
var script$1 = {
name: 'BaseCarouselIndicators',
"extends": BaseComponent,
props: {
as: {
type: [String, Object],
"default": 'DIV'
},
asChild: {
type: Boolean,
"default": false
}
},
style: CarouselIndicatorsStyle,
provide: function provide() {
return {
$pcCarouselIndicators: this,
$parentInstance: this
};
}
};
var script = {
name: 'CarouselIndicators',
"extends": script$1,
inheritAttrs: false,
inject: ['$pcCarousel'],
components: {
CarouselIndicator: CarouselIndicator
},
computed: {
pageCount: function pageCount() {
var _this$$pcCarousel, _this$$pcCarousel2;
return ((_this$$pcCarousel = this.$pcCarousel) === null || _this$$pcCarousel === void 0 || (_this$$pcCarousel = _this$$pcCarousel.snapPoints) === null || _this$$pcCarousel === void 0 ? void 0 : _this$$pcCarousel.size) || ((_this$$pcCarousel2 = this.$pcCarousel) === null || _this$$pcCarousel2 === void 0 ? void 0 : _this$$pcCarousel2.totalIndicators) || 0;
},
attrs: function attrs() {
return mergeProps(this.a11yAttrs, this.ptmi('root'));
},
a11yAttrs: function a11yAttrs() {
var _this$$pcCarousel3, _this$$pcCarousel4, _this$$pcCarousel5, _this$$pcCarousel6, _this$$pcCarousel7;
return {
'data-pc-name': 'carouselindicators',
'data-pc-section': 'root',
'data-orientation': (_this$$pcCarousel3 = this.$pcCarousel) === null || _this$$pcCarousel3 === void 0 ? void 0 : _this$$pcCarousel3.orientation,
'data-align': (_this$$pcCarousel4 = this.$pcCarousel) === null || _this$$pcCarousel4 === void 0 ? void 0 : _this$$pcCarousel4.align,
'data-page': (_this$$pcCarousel5 = this.$pcCarousel) === null || _this$$pcCarousel5 === void 0 ? void 0 : _this$$pcCarousel5.d_page,
'data-swiping': (_this$$pcCarousel6 = this.$pcCarousel) !== null && _this$$pcCarousel6 !== void 0 && _this$$pcCarousel6.swiping ? '' : undefined,
onKeydown: (_this$$pcCarousel7 = this.$pcCarousel) === null || _this$$pcCarousel7 === void 0 ? void 0 : _this$$pcCarousel7.onIndicatorKeydown
};
}
}
};
function render(_ctx, _cache, $props, $setup, $data, $options) {
var _component_CarouselIndicator = resolveComponent("CarouselIndicator");
return !_ctx.asChild ? (openBlock(), createBlock(resolveDynamicComponent(_ctx.as), mergeProps({
key: 0,
"class": _ctx.cx('root')
}, $options.attrs), {
"default": withCtx(function () {
return [renderSlot(_ctx.$slots, "default", {
pageCount: $options.pageCount
}, function () {
return [(openBlock(true), createElementBlock(Fragment, null, renderList($options.pageCount, function (i) {
return openBlock(), createBlock(_component_CarouselIndicator, {
key: i,
page: i - 1
}, null, 8, ["page"]);
}), 128))];
})];
}),
_: 3
}, 16, ["class"])) : renderSlot(_ctx.$slots, "default", {
key: 1,
a11yAttrs: $options.a11yAttrs,
"class": normalizeClass(_ctx.cx('root')),
pageCount: $options.pageCount
});
}
script.render = render;
export { script as default };