UNPKG

@postnord/web-components

Version:

PostNord Web Components

52 lines (46 loc) 3.31 kB
/*! * Built with Stencil * By PostNord. */ 'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); const index = require('./index-ec4ed1cc.js'); const arrow_right = require('./arrow_right-8a1192e2.js'); const pnPageNavDropdownItemCss = "pn-page-nav-dropdown-item:first-of-type li>a,pn-page-nav-dropdown-item:first-of-type li>button{border-radius:0.5em 0.5em 0 0}pn-page-nav-dropdown-item:last-of-type li>a,pn-page-nav-dropdown-item:last-of-type li>button{border-radius:0 0 0.5em 0.5em}pn-page-nav-dropdown-item:last-of-type li>hr{display:none}pn-page-nav-dropdown-item li{font-size:inherit}pn-page-nav-dropdown-item li>*{color:#ffffff;font-size:inherit;border:none;padding:1em;margin:0;display:flex;justify-content:space-between;align-items:center;cursor:pointer;transition:background 0.15s;outline:none;width:100%;font-weight:500}pn-page-nav-dropdown-item li>*>pn-icon{margin-left:1em}pn-page-nav-dropdown-item li>*.pn-page-nav-dropdown-item-active{background:#005d92}pn-page-nav-dropdown-item li>*.pn-page-nav-dropdown-item-active:hover,pn-page-nav-dropdown-item li>*.pn-page-nav-dropdown-item-active:focus{background:#005d92}pn-page-nav-dropdown-item li>*:hover,pn-page-nav-dropdown-item li>*:focus{background:#0d234b}pn-page-nav-dropdown-item li>*:focus{box-shadow:inset 0 0 0 0.1em #005d92, inset 0 0 0 0.2em #d3cecb}pn-page-nav-dropdown-item li>a{text-decoration:none}pn-page-nav-dropdown-item li>button{background:none}pn-page-nav-dropdown-item li>hr{bottom:0;padding:0;margin:0 auto;border-top:0.0625em solid #d3cecb;opacity:0.6;width:85%}"; const PnPageNavDropdownItemStyle0 = pnPageNavDropdownItemCss; const PnPageNavDropdownItem = class { constructor(hostRef) { index.registerInstance(this, hostRef); this.itemselection = index.createEvent(this, "itemselection", 7); this.value = undefined; this.href = undefined; this.active = false; } get hostElement() { return index.getElement(this); } /** Ignore this, it's internal communication with parent */ itemselection; select(e) { if (this.value && !this.href) e.preventDefault(); this.itemselection.emit(this.value); } setClassnames() { let classes = 'pn-page-nav-dropdown-item '; if (this.active) classes += 'pn-page-nav-dropdown-item-active '; return classes; } getType() { return this.value ? null : 'button'; } getTagName() { return this.value ? 'a' : 'button'; } render() { const TagName = this.getTagName(); return (index.h("li", { key: '3ba7accf462b8b2cb9263b3e491b8492cd413936' }, index.h(TagName, { key: '1c17c9192378a7d30cf1b08fe3681d4353cd6358', href: this.href || '#', class: this.setClassnames(), type: this.getType(), onClick: e => this.select(e), tabindex: "-1" }, index.h("slot", { key: '24bb5a34497dfa712d6eaf4e26bc8d4cef553887' }), index.h("pn-icon", { key: '368e6ac5154711a49c5366c7994fdc989d9cb624', icon: arrow_right.arrow_right, color: "white" })), index.h("hr", { key: 'a1b1d2aadd8bc6e6d79f3e8db9ed85263feb3f30' }))); } }; PnPageNavDropdownItem.style = PnPageNavDropdownItemStyle0; exports.pn_page_nav_dropdown_item = PnPageNavDropdownItem; //# sourceMappingURL=pn-page-nav-dropdown-item.cjs.entry.js.map