import { PktElement } from '@/base-elements/element' import { html } from 'lit' import { property, customElement } from 'lit/decorators.js' import { ifDefined } from 'lit/directives/if-defined.js' import '@/components/icon' export interface IPktBackLink { href?: string text?: string ariaLabel?: string } export class PktBackLink extends PktElement implements IPktBackLink { // Properties @property({ type: String }) href: string = '' @property({ type: String }) text: string = 'Forsiden' @property({ type: String }) ariaLabel: string = '' // Lifecycle attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null) { if (name === 'arialabel') { this.removeAttribute('arialabel') } if (name === 'href') { this.removeAttribute('href') } if (name === 'text') { this.removeAttribute('text') } super.attributeChangedCallback(name, oldValue, newValue) } render() { return html`` } } export default PktBackLink try { customElement('pkt-backlink')(PktBackLink) } catch (e) { console.warn('Forsøker å definere , men den er allerede definert') }