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.
45 lines (39 loc) • 1.34 kB
JavaScript
;
Object.defineProperty(exports, '__esModule', { value: true });
const index = require('./index-366d4dde.js');
const navLink = (el, routerDirection, component, componentProps) => {
const nav = el.closest('ion-nav');
if (nav) {
if (routerDirection === 'forward') {
if (component !== undefined) {
return nav.push(component, componentProps, { skipIfBusy: true });
}
}
else if (routerDirection === 'root') {
if (component !== undefined) {
return nav.setRoot(component, componentProps, { skipIfBusy: true });
}
}
else if (routerDirection === 'back') {
return nav.pop({ skipIfBusy: true });
}
}
return Promise.resolve(false);
};
const NavLink = class {
constructor(hostRef) {
index.registerInstance(this, hostRef);
/**
* The transition direction when navigating to another page.
*/
this.routerDirection = 'forward';
this.onClick = () => {
return navLink(this.el, this.routerDirection, this.component, this.componentProps);
};
}
render() {
return (index.h(index.Host, { onClick: this.onClick }));
}
get el() { return index.getElement(this); }
};
exports.ion_nav_link = NavLink;