UNPKG

@oslokommune/punkt-elements

Version:

Komponentbiblioteket til Punkt, et designsystem laget av Oslo Origo

14 lines (13 loc) 1.37 kB
"use strict";const i=require("./element-6DBpyGQm.cjs"),c=require("./if-defined-Cni-RHLS.cjs");var p=Object.defineProperty,o=Object.getOwnPropertyDescriptor,n=(k,t,a,r)=>{for(var e=r>1?void 0:r?o(t,a):t,l=k.length-1,s;l>=0;l--)(s=k[l])&&(e=(r?s(t,a,e):s(e))||e);return r&&e&&p(t,a,e),e};exports.PktBackLink=class extends i.PktElement{constructor(){super(...arguments),this.href="",this.text="Forsiden",this.ariaLabel=""}attributeChangedCallback(t,a,r){t==="arialabel"&&this.removeAttribute("arialabel"),t==="href"&&this.removeAttribute("href"),t==="text"&&this.removeAttribute("text"),super.attributeChangedCallback(t,a,r)}render(){return i.x`<nav class="pkt-back-link" aria-label=${this.ariaLabel||"Gå tilbake til forrige side"} > <a href=${c.o(this.href||"/")} class="pkt-link pkt-link--icon-left" ><pkt-icon class="pkt-back-link__icon pkt-icon pkt-link__icon" name="chevron-thin-left" aria-hidden="true" ></pkt-icon ><span class="pkt-back-link__text">${this.text}</span></a > </nav>`}};n([i.n({type:String,reflect:!0})],exports.PktBackLink.prototype,"href",2);n([i.n({type:String,reflect:!0})],exports.PktBackLink.prototype,"text",2);n([i.n({type:String,reflect:!0})],exports.PktBackLink.prototype,"ariaLabel",2);exports.PktBackLink=n([i.t("pkt-backlink")],exports.PktBackLink);