@ionic/core
Version:
Base components for Ionic
4 lines • 1.51 kB
JavaScript
/*!
* (C) Ionic http://ionicframework.com - MIT License
*/
import{d as t,H as e,c as a,h as i,f as s,t as n}from"./p-Ct2aBEue.js";import{a as o}from"./p-Ba9_OzSY.js";const c=t(class extends e{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.active=!1}async componentWillLoad(){this.active&&await this.setActive()}async setActive(){await this.prepareLazyLoaded(),this.active=!0}changeActive(t){t&&this.prepareLazyLoaded().catch((t=>{a("[ion-tab] - Exception in prepareLazyLoaded:",t)}))}prepareLazyLoaded(){return null==this.component?Promise.resolve(void 0):(void 0===this.loadPromise&&(this.loadPromise=o(this.delegate,this.el,this.component,["ion-page"]).catch((t=>{throw this.loadPromise=void 0,t}))),this.loadPromise)}render(){const{tab:t,active:e,component:a}=this;return i(s,{key:"8ecbd7a85d3370ed8ed40561cd8134e71584d6aa",role:"tabpanel","aria-hidden":e?null:"true","aria-labelledby":"tab-button-"+t,class:{"ion-page":void 0===a,"tab-hidden":!e}},i("slot",{key:"8d6326d75812888e33fd09665b7e588e1e270df1"}))}get el(){return this}static get watchers(){return{active:[{changeActive:0}]}}static get style(){return":host(.tab-hidden){display:none !important}"}},[257,"ion-tab",{active:[1028],delegate:[16],tab:[1],component:[1],setActive:[64]},void 0,{active:[{changeActive:0}]}]),d=c,r=function(){"undefined"!=typeof customElements&&["ion-tab"].forEach((t=>{"ion-tab"===t&&(customElements.get(n(t))||customElements.define(n(t),c))}))};export{d as IonTab,r as defineCustomElement}