UNPKG

@postnord/web-components

Version:

PostNord Web Components

114 lines (113 loc) 3.95 kB
/*! * Built with Stencil * By PostNord. */ import { h, Host } from "@stencil/core"; /** * @deprecated This component will be removed in v8. Please use the `pn-tablist` instead. * @see {@link https://portal.postnord.com/web-components/?path=/docs/components-navigation-tablist--docs} Use `pn-tablist` instead. */ export class PnPageNavItem { constructor() { this.value = undefined; this.href = undefined; this.icon = undefined; } hostElement; /** 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: 'a2dcede0a4f6789eda151fa2fcd5496588897361' }, h("li", { key: '029058cffbfbf1c04d57c7605b9e887cce0abbd1' }, h("a", { key: '38f2a5a9e15bc96a9efb91d85c9d67b21d27b40b', href: this.href || '#', class: "pn-page-nav-item", onClick: e => this.select(e) }, this.icon && h("pn-icon", { key: '110592957f990a4c9594820d748aa1c6458742a5', icon: this.icon, color: "white" }), h("slot", { key: '9b72c3dc62e9dfc9fe7cc0415d0ea0f67ea0d47f' }))))); } static get is() { return "pn-page-nav-item"; } static get originalStyleUrls() { return { "$": ["pn-page-nav-item.scss"] }; } static get styleUrls() { return { "$": ["pn-page-nav-item.css"] }; } static get properties() { return { "value": { "type": "string", "mutable": false, "complexType": { "original": "string", "resolved": "string", "references": {} }, "required": true, "optional": false, "docs": { "tags": [], "text": "The item value. Used by `pn-page-nav` to determine pre-selected item." }, "attribute": "value", "reflect": false }, "href": { "type": "string", "mutable": false, "complexType": { "original": "string", "resolved": "string", "references": {} }, "required": false, "optional": false, "docs": { "tags": [], "text": "Pass an href to the items if you want to have links that lead outside of your app." }, "attribute": "href", "reflect": false }, "icon": { "type": "string", "mutable": false, "complexType": { "original": "string", "resolved": "string", "references": {} }, "required": false, "optional": false, "docs": { "tags": [], "text": "The SVG content of the icon you want." }, "attribute": "icon", "reflect": false } }; } static get events() { return [{ "method": "itemselection", "name": "itemselection", "bubbles": true, "cancelable": true, "composed": true, "docs": { "tags": [], "text": "Event is emitted when you select an item." }, "complexType": { "original": "string", "resolved": "string", "references": {} } }]; } static get elementRef() { return "hostElement"; } } //# sourceMappingURL=pn-page-nav-item.js.map