test-isc
Version:
An Ionic component similar to Ionic Select, that allows to search items, including async search, group, add, edit, delete items, and much more.
59 lines (53 loc) • 1.72 kB
JavaScript
;
Object.defineProperty(exports, '__esModule', { value: true });
const index = require('./index-366d4dde.js');
const frameworkDelegate = require('./framework-delegate-84d33ff0.js');
const tabCss = ":host(.tab-hidden){display:none !important}";
const Tab = class {
constructor(hostRef) {
index.registerInstance(this, hostRef);
this.loaded = false;
/** @internal */
this.active = false;
}
async componentWillLoad() {
if (this.active) {
await this.setActive();
}
}
/** Set the active component for the tab */
async setActive() {
await this.prepareLazyLoaded();
this.active = true;
}
changeActive(isActive) {
if (isActive) {
this.prepareLazyLoaded();
}
}
prepareLazyLoaded() {
if (!this.loaded && this.component != null) {
this.loaded = true;
try {
return frameworkDelegate.attachComponent(this.delegate, this.el, this.component, ['ion-page']);
}
catch (e) {
console.error(e);
}
}
return Promise.resolve(undefined);
}
render() {
const { tab, active, component } = this;
return (index.h(index.Host, { role: "tabpanel", "aria-hidden": !active ? 'true' : null, "aria-labelledby": `tab-button-${tab}`, class: {
'ion-page': component === undefined,
'tab-hidden': !active
} }, index.h("slot", null)));
}
get el() { return index.getElement(this); }
static get watchers() { return {
"active": ["changeActive"]
}; }
};
Tab.style = tabCss;
exports.ion_tab = Tab;