@postnord/web-components
Version:
PostNord Web Components
34 lines (30 loc) • 1.98 kB
JavaScript
/*!
* Built with Stencil
* By PostNord.
*/
import { r as registerInstance, c as createEvent, g as getElement, h, a as Host } from './index-5606614b.js';
const pnPageNavItemCss = "pn-page-nav-item{position:relative;color:#ffffff;margin-right:0.5em;z-index:2;white-space:nowrap;scroll-snap-align:center;outline:none;-webkit-tap-highlight-color:transparent;transform:translateZ(0)}pn-page-nav-item a{text-decoration:none;color:#ffffff;height:100%;width:100%;padding:0.5em;font-weight:500;border-radius:3em;border:0.0625em solid transparent;display:inline-flex;align-items:center;cursor:pointer;outline:none;transition:box-shadow 0.15s}pn-page-nav-item a:focus{box-shadow:0 0 0 0.1em #d3cecb}pn-page-nav-item a>pn-icon{margin-right:0.5em}pn-page-nav-item:last-of-type{margin-right:0}";
const PnPageNavItemStyle0 = pnPageNavItemCss;
const PnPageNavItem = class {
constructor(hostRef) {
registerInstance(this, hostRef);
this.itemselection = createEvent(this, "itemselection", 7);
this.value = undefined;
this.href = undefined;
this.icon = undefined;
}
get hostElement() { return getElement(this); }
/** Event is emitted when you select an item. */
itemselection;
select(e) {
if (this.value && !this.href)
e.preventDefault();
this.itemselection.emit(this.value);
}
render() {
return (h(Host, { key: '09fd2817fa1e7fa2d8afd430385ddce493da610d' }, h("li", { key: '1392d69840c4f2c122a8282b9d06c585f15c163c' }, h("a", { key: 'ec5d7f017ad7b385ab7f8baf61b6b277a1ae04aa', href: this.href || '#', class: "pn-page-nav-item", onClick: e => this.select(e) }, this.icon && h("pn-icon", { key: 'af7275cc72c11374f354b3801adbdd16befed340', icon: this.icon, color: "white" }), h("slot", { key: '3a2df1ae8be8e80be22d52428c5fe725d07794ac' })))));
}
};
PnPageNavItem.style = PnPageNavItemStyle0;
export { PnPageNavItem as pn_page_nav_item };
//# sourceMappingURL=pn-page-nav-item.entry.js.map