UNPKG

@postnord/web-components

Version:

PostNord Web Components

38 lines (32 loc) 2.05 kB
/*! * Built with Stencil * By PostNord. */ 'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); const index = require('./index-ec4ed1cc.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) { index.registerInstance(this, hostRef); this.itemselection = index.createEvent(this, "itemselection", 7); this.value = undefined; this.href = undefined; this.icon = undefined; } get hostElement() { return index.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 (index.h(index.Host, { key: 'a2dcede0a4f6789eda151fa2fcd5496588897361' }, index.h("li", { key: '029058cffbfbf1c04d57c7605b9e887cce0abbd1' }, index.h("a", { key: '38f2a5a9e15bc96a9efb91d85c9d67b21d27b40b', href: this.href || '#', class: "pn-page-nav-item", onClick: e => this.select(e) }, this.icon && index.h("pn-icon", { key: '110592957f990a4c9594820d748aa1c6458742a5', icon: this.icon, color: "white" }), index.h("slot", { key: '9b72c3dc62e9dfc9fe7cc0415d0ea0f67ea0d47f' }))))); } }; PnPageNavItem.style = PnPageNavItemStyle0; exports.pn_page_nav_item = PnPageNavItem; //# sourceMappingURL=pn-page-nav-item.cjs.entry.js.map