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

77 lines (71 loc) 2.18 kB
import { isElement } from '@primeuix/utils/dom'; import { mergeProps, openBlock, createBlock, resolveDynamicComponent, withCtx, renderSlot, normalizeClass } from 'vue'; import BaseComponent from '@primevue/core/basecomponent'; import GalleryContentStyle from 'primevue/gallerycontent/style'; var script$1 = { name: 'BaseGalleryContent', "extends": BaseComponent, props: { as: { type: [String, Object], "default": 'DIV' }, asChild: { type: Boolean, "default": false } }, style: GalleryContentStyle, provide: function provide() { return { $pcGalleryContent: this, $parentInstance: this }; } }; var script = { name: 'GalleryContent', "extends": script$1, inheritAttrs: false, inject: ['$pcGallery'], beforeUnmount: function beforeUnmount() { var _this$$pcGallery; (_this$$pcGallery = this.$pcGallery) === null || _this$$pcGallery === void 0 || _this$$pcGallery.setContentEl(null); }, methods: { setRef: function setRef(el) { var _el$$el, _this$$pcGallery2; var dom = isElement(el) ? el : (_el$$el = el === null || el === void 0 ? void 0 : el.$el) !== null && _el$$el !== void 0 ? _el$$el : null; (_this$$pcGallery2 = this.$pcGallery) === null || _this$$pcGallery2 === void 0 || _this$$pcGallery2.setContentEl(dom); } }, computed: { attrs: function attrs() { return mergeProps(this.a11yAttrs, this.ptmi('root')); }, a11yAttrs: function a11yAttrs() { return { ref: this.setRef, 'data-pc-name': 'gallerycontent', 'data-pc-section': 'root' }; } } }; function render(_ctx, _cache, $props, $setup, $data, $options) { 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")]; }), _: 3 }, 16, ["class"])) : renderSlot(_ctx.$slots, "default", { key: 1, "class": normalizeClass(_ctx.cx('root')), a11yAttrs: $options.a11yAttrs }); } script.render = render; export { script as default };