UNPKG

@progress/kendo-vue-layout

Version:
98 lines (97 loc) 2.8 kB
/** * @license *------------------------------------------------------------------------------------------- * Copyright © 2025 Progress Software Corporation. All rights reserved. * Licensed under commercial license. See LICENSE.md in the package root for more information *------------------------------------------------------------------------------------------- */ import { defineComponent as g, createVNode as o, h as C, isVNode as S } from "vue"; import { Fade as T } from "@progress/kendo-vue-animation"; import { getDefaultSlots as k, classNames as v, guid as $, getTemplate as N } from "@progress/kendo-vue-common"; import { getTabs as A } from "./utils.mjs"; function j(t) { return typeof t == "function" || Object.prototype.toString.call(t) === "[object Object]" && !S(t); } const P = /* @__PURE__ */ g({ name: "KendoTabStripContent", props: { showAll: Boolean, animation: Boolean, tabs: Array, selected: Number, hasTabs: Boolean }, created() { this.contentId = $(); }, data() { return { midAnimation: !1 }; }, computed: { animationClass() { return this.tabs.map((t, n) => { const i = n === this.$props.selected; return { "k-fade-appear": this.animation && !i, "k-fade-enter-active": this.animation && i }; }); } }, render() { const { tabs: t, selected: n, showAll: i, hasTabs: r } = this.$props, c = t && typeof n == "number" && t[n], h = k(this), p = r ? t : A.call(this, [], h || []), d = n < p.length && n > -1, m = v({ "k-tabstrip-content": d }, { "k-active": d }, c && c.contentClassName), u = function(s, e) { const l = e === this.$props.selected, b = { position: "initial", height: l ? void 0 : "0px", width: l ? void 0 : "0px" }, y = r ? N.call(this, { h: C, template: s.content, defaultRendering: null, additionalProps: { dataItem: s } }) : s, a = o("div", { role: "tabpanel", "aria-expanded": !0, id: String(this.contentId + e), key: e }, [y]); return !r || this.animation ? o(T, { appear: !0, key: e, class: this.animationClass[e], enter: this.$props.animation, exit: this.$props.keepTabsMounted, style: b }, j(a) ? a : { default: () => [a] }) : o("div", { class: l ? void 0 : "k-hidden" }, [a]); }, f = function() { return p.map(function(s, e) { return u.call(this, s, e); }, this); }; return o("div", { class: m, style: this.$props.style, role: "tabpanel" }, [f.call(this)]); } }); export { P as TabStripContent };