"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const s=require("../../common/mixins/modal.cjs"),n=require("../../common/utils/index.cjs"),l=require("vue"),d=require("../../_plugin-vue_export-helper-BRilXfQE.cjs"),o={compatConfig:{MODE:3},name:"DtTabPanel",mixins:[s.default],inject:["groupContext"],props:{id:{type:String,required:!0},tabId:{type:String,required:!0},hidden:{type:Boolean,default:!1},tabPanelClass:{type:[String,Array,Object],default:""}},data(){return{isFirstElementFocusable:!1}},computed:{hidePanel(){return this.groupContext.selected!==this.id||this.hidden}},async mounted(){const e=await this.getFirstFocusableElement(n.returnFirstEl(this.$el));e?this.isFirstElementFocusable=this.isFirstElementOfPanel(e):this.isFirstElementFocusable=!1},methods:{isFirstElementOfPanel(e){let t=e,i=!0;for(;t;){if(t.previousElementSibling!==null){i=!1;break}t=t.parentNode!==n.returnFirstEl(this.$el)?t.parentNode:null}return i}}},u=["id","tabindex","aria-labelledby","aria-hidden"];function c(e,t,i,m,r,a){return l.withDirectives((l.openBlock(),l.createElementBlock("div",{id:`dt-panel-${i.id}`,role:"tabpanel",tabindex:r.isFirstElementFocusable?-1:0,"aria-labelledby":`dt-tab-${i.tabId}`,"aria-hidden":`${a.hidePanel}`,class:l.normalizeClass(i.tabPanelClass),"data-qa":"dt-tab-panel"},[l.renderSlot(e.$slots,"default")],10,u)),[[l.vShow,!a.hidePanel]])}const b=d._(o,[["render",c]]);exports.default=b;
//# sourceMappingURL=tab-panel.cjs.map
