@dracoui/ember
Version:
Draco Design System for Ember
3 lines (2 loc) • 1.77 kB
JavaScript
import{_ as e,b as t}from"../../../../_rollupPluginBabelHelpers-CLoDr8uC.js";import{action as s}from"@ember/object";import i from"@glimmer/component";import{guidFor as o}from"@ember/object/internals";import{precompileTemplate as n}from"@ember/template-compilation";import{setComponentTemplate as r}from"@ember/component";var d,l=n('<section\n class={{this.classNames}}\n ...attributes\n role="tabpanel"\n id={{this._panelId}}\n hidden={{not this.isVisible}}\n aria-labelledby={{this.coupledTabId}}\n {{did-insert this.didInsertNode}}\n {{will-destroy this.willDestroyNode}}\n>\n {{yield (hash isVisible=this.isVisible)}}\n\n {{#if (and this.text this.isVisible)}}\n <span class="draco-tabs__panel__text">\n {{this.text}}\n </span>\n {{/if}}\n</section>');let a=(e((d=class extends i{constructor(...e){super(...e),t(this,"componentName","Draco::Tabs::Panel"),t(this,"_elementId",void 0),t(this,"_panelId","panel-"+o(this))}get nodeIndex(){return this.args.panelIds?this.args.panelIds.indexOf(this._panelId):void 0}get isVisible(){return this.nodeIndex===this.args.selectedTabIndex}get text(){return this.args.text??void 0}get coupledTabId(){return void 0!==this.nodeIndex?this.args.tabIds?.[this.nodeIndex]:void 0}get classNames(){return["draco-tabs__panel"].join(" ")}didInsertNode(e){const{didInsertNode:t}=this.args;"function"==typeof t&&(this._elementId=e.id,t(e,this._elementId))}willDestroyNode(e){const{willDestroyNode:t}=this.args;"function"==typeof t&&t(e)}}).prototype,"didInsertNode",[s],Object.getOwnPropertyDescriptor(d.prototype,"didInsertNode"),d.prototype),e(d.prototype,"willDestroyNode",[s],Object.getOwnPropertyDescriptor(d.prototype,"willDestroyNode"),d.prototype),d);r(l,a);export{a as default};
//# sourceMappingURL=index.js.map