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