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
72 lines (66 loc) • 2.19 kB
JavaScript
import BaseComponent from '@primevue/core/basecomponent';
import GalleryFullScreenStyle from 'primevue/galleryfullscreen/style';
import { openBlock, createBlock, resolveDynamicComponent, mergeProps, withCtx, renderSlot, normalizeClass } from 'vue';
var script$1 = {
name: 'BaseGalleryFullScreen',
"extends": BaseComponent,
props: {
as: {
type: [String, Object],
"default": 'BUTTON'
},
asChild: {
type: Boolean,
"default": false
}
},
style: GalleryFullScreenStyle,
provide: function provide() {
return {
$pcGalleryFullScreen: this,
$parentInstance: this
};
}
};
var script = {
name: 'GalleryFullScreen',
"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.toggleFullScreen();
}
},
computed: {
isFullscreen: function isFullscreen() {
var _this$$pcGallery$isFu, _this$$pcGallery2;
return (_this$$pcGallery$isFu = (_this$$pcGallery2 = this.$pcGallery) === null || _this$$pcGallery2 === void 0 ? void 0 : _this$$pcGallery2.isFullscreen) !== null && _this$$pcGallery$isFu !== void 0 ? _this$$pcGallery$isFu : 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": "fullscreen",
"data-fullscreen": $options.isFullscreen ? '' : undefined,
onClick: $options.onClick
}, _ctx.ptmi('root')), {
"default": withCtx(function () {
return [renderSlot(_ctx.$slots, "default", {
isFullscreen: $options.isFullscreen
})];
}),
_: 3
}, 16, ["class", "type", "data-fullscreen", "onClick"])) : renderSlot(_ctx.$slots, "default", {
key: 1,
"class": normalizeClass(_ctx.cx('root')),
onClick: $options.onClick,
isFullscreen: $options.isFullscreen
});
}
script.render = render;
export { script as default };