UNPKG

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

70 lines (64 loc) • 2.21 kB
import BaseComponent from '@primevue/core/basecomponent'; import GalleryZoomToggleStyle from 'primevue/galleryzoomtoggle/style'; import { openBlock, createBlock, resolveDynamicComponent, mergeProps, withCtx, renderSlot, normalizeClass } from 'vue'; var script$1 = { name: 'BaseGalleryZoomToggle', "extends": BaseComponent, props: { as: { type: [String, Object], "default": 'BUTTON' }, asChild: { type: Boolean, "default": false } }, style: GalleryZoomToggleStyle, provide: function provide() { return { $pcGalleryZoomToggle: this, $parentInstance: this }; } }; var script = { name: 'GalleryZoomToggle', "extends": script$1, inheritAttrs: false, inject: ['$pcGallery'], methods: { onClick: function onClick() { var _this$$pcGallery; (_this$$pcGallery = this.$pcGallery) === null || _this$$pcGallery === void 0 || _this$$pcGallery.onClickAction(this.zoomed ? 'zoomOut' : 'zoomIn'); } }, computed: { zoomed: function zoomed() { var _this$$pcGallery$acti, _this$$pcGallery2; return (_this$$pcGallery$acti = (_this$$pcGallery2 = this.$pcGallery) === null || _this$$pcGallery2 === void 0 || (_this$$pcGallery2 = _this$$pcGallery2.activeItemTransform) === null || _this$$pcGallery2 === void 0 ? void 0 : _this$$pcGallery2.zoomed) !== null && _this$$pcGallery$acti !== void 0 ? _this$$pcGallery$acti : false; } } }; function render(_ctx, _cache, $props, $setup, $data, $options) { return !_ctx.asChild ? (openBlock(), createBlock(resolveDynamicComponent(_ctx.as), mergeProps({ key: 0, "class": _ctx.cx('root'), type: _ctx.as === 'BUTTON' ? 'button' : undefined, "data-action": "zoom-toggle", onClick: $options.onClick }, _ctx.ptmi('root')), { "default": withCtx(function () { return [renderSlot(_ctx.$slots, "default", { zoomed: $options.zoomed })]; }), _: 3 }, 16, ["class", "type", "onClick"])) : renderSlot(_ctx.$slots, "default", { "class": normalizeClass(_ctx.cx('root')), onClick: $options.onClick, zoomed: $options.zoomed }, undefined, undefined, 1); } script.render = render; export { script as default };