@oslokommune/punkt-elements 12.38.0 → 12.38.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +17 -0
- package/dist/{button-D39TTsjJ.js → button-D1zx8gKd.js} +4 -4
- package/dist/{button-ZkEpUrbJ.cjs → button-DEadihVm.cjs} +1 -1
- package/dist/{consent-CSspmVST.cjs → consent-B4r94Z8d.cjs} +1 -1
- package/dist/{consent-BPZ8QV7q.js → consent-DDcfVjC6.js} +1 -1
- package/dist/index.d.ts +0 -1
- package/dist/link-DCYJhFKJ.js +64 -0
- package/dist/link-nesPZCIx.cjs +7 -0
- package/dist/pkt-button.cjs +1 -1
- package/dist/pkt-button.js +1 -1
- package/dist/pkt-consent.cjs +1 -1
- package/dist/pkt-consent.js +1 -1
- package/dist/pkt-index.cjs +1 -1
- package/dist/pkt-index.js +3 -3
- package/dist/pkt-link.cjs +1 -1
- package/dist/pkt-link.js +1 -1
- package/package.json +2 -2
- package/src/components/button/button.ts +1 -1
- package/src/components/link/link.ts +0 -10
- package/dist/link-B748tCGi.js +0 -73
- package/dist/link-BrDbM3GT.cjs +0 -8
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,23 @@ og skriver commits ca etter [Conventional Commits](https://conventionalcommits.o
|
|
|
5
5
|
|
|
6
6
|
---
|
|
7
7
|
|
|
8
|
+
## [12.38.1](https://github.com/oslokommune/punkt/compare/12.38.0...12.38.1) (2025-05-14)
|
|
9
|
+
|
|
10
|
+
### ⚠ BREAKING CHANGES
|
|
11
|
+
Ingen
|
|
12
|
+
|
|
13
|
+
### Features
|
|
14
|
+
Ingen
|
|
15
|
+
|
|
16
|
+
### Bug Fixes
|
|
17
|
+
Ingen
|
|
18
|
+
|
|
19
|
+
### Chores
|
|
20
|
+
Ingen
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
|
|
8
25
|
## [12.38.0](https://github.com/oslokommune/punkt/compare/12.37.8...12.38.0) (2025-05-13)
|
|
9
26
|
|
|
10
27
|
### ⚠ BREAKING CHANGES
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as a, P as
|
|
1
|
+
import { n as a, P as c, E as p, x as l, a as b } from "./element-DjjF_tEh.js";
|
|
2
2
|
import { P as f } from "./pkt-slot-controller-DtDaD9q_.js";
|
|
3
3
|
import { e as u, n as k } from "./ref-iIffqQAI.js";
|
|
4
4
|
var y = Object.defineProperty, m = Object.getOwnPropertyDescriptor, s = (t, e, n, o) => {
|
|
@@ -6,7 +6,7 @@ var y = Object.defineProperty, m = Object.getOwnPropertyDescriptor, s = (t, e, n
|
|
|
6
6
|
(h = t[d]) && (r = (o ? h(e, n, r) : h(r)) || r);
|
|
7
7
|
return o && r && y(e, n, r), r;
|
|
8
8
|
};
|
|
9
|
-
let i = class extends
|
|
9
|
+
let i = class extends c {
|
|
10
10
|
constructor() {
|
|
11
11
|
super(), this.internals = this.attachInternals(), this.defaultSlot = u(), this.iconName = "user", this.secondIconName = "user", this.mode = "light", this.size = "medium", this.skin = "primary", this.variant = "label-only", this.state = "normal", this.type = "button", this.isLoading = !1, this.disabled = !1, this.slotController = new f(this, this.defaultSlot), this.addEventListener("click", this.handleClick), this.addEventListener("keydown", this.handleKeydown);
|
|
12
12
|
}
|
|
@@ -104,10 +104,10 @@ s([
|
|
|
104
104
|
a({ type: Boolean })
|
|
105
105
|
], i.prototype, "isLoading", 2);
|
|
106
106
|
s([
|
|
107
|
-
a({ type: Boolean })
|
|
107
|
+
a({ type: Boolean, reflect: !0 })
|
|
108
108
|
], i.prototype, "disabled", 2);
|
|
109
109
|
i = s([
|
|
110
|
-
|
|
110
|
+
b("pkt-button")
|
|
111
111
|
], i);
|
|
112
112
|
export {
|
|
113
113
|
i as P
|
|
@@ -9,4 +9,4 @@
|
|
|
9
9
|
<span class="pkt-btn__text" ${d.n(this.defaultSlot)}></span>
|
|
10
10
|
${this.variant==="icons-right-and-left"?i.x`<pkt-icon class="pkt-btn__icon" name=${this.secondIconName}></pkt-icon>`:i.E}
|
|
11
11
|
</div>
|
|
12
|
-
`}updateElementClasses(){const t=new Set,s=this.getAttribute("class");t.add("pkt-btn"),s&&s.split(" ").forEach(n=>t.add(n)),this.size&&t.add(`pkt-btn--${this.size}`),this.skin&&t.add(`pkt-btn--${this.skin}`),this.variant&&t.add(`pkt-btn--${this.variant}`),this.color&&t.add(`pkt-btn--${this.color}`),this.isLoading&&t.add("pkt-btn--active"),this.state&&t.add(`pkt-btn--${this.state}`),this.disabled&&t.add("pkt-btn--disabled"),this.className=[...t].join(" ")}handleClick(t){if(this.disabled||this.isLoading){t.preventDefault(),t.stopImmediatePropagation();return}if(this.type==="submit"&&this.internals.form){this.internals.form.requestSubmit();return}if(this.type==="reset"&&this.internals.form){this.internals.form.reset();return}this.onClick&&typeof this.onClick=="function"&&this.onClick!==this.handleClick&&this.onClick(t),this.dispatchEvent(new CustomEvent("button-click",{bubbles:!0,composed:!0,detail:{originalEvent:t}}))}handleKeydown(t){if(!(this.disabled||this.isLoading)&&(t.key==="Enter"||t.key===" ")){t.preventDefault();const s=t.target;s&&s.click()}}};exports.PktButton.formAssociated=!0;e([i.n({type:String})],exports.PktButton.prototype,"iconName",2);e([i.n({type:String})],exports.PktButton.prototype,"secondIconName",2);e([i.n({type:String})],exports.PktButton.prototype,"mode",2);e([i.n({type:String})],exports.PktButton.prototype,"size",2);e([i.n({type:String})],exports.PktButton.prototype,"color",2);e([i.n({type:String})],exports.PktButton.prototype,"skin",2);e([i.n({type:String})],exports.PktButton.prototype,"variant",2);e([i.n({type:String})],exports.PktButton.prototype,"state",2);e([i.n({type:String,reflect:!0})],exports.PktButton.prototype,"type",2);e([i.n({type:Boolean})],exports.PktButton.prototype,"isLoading",2);e([i.n({type:Boolean})],exports.PktButton.prototype,"disabled",2);exports.PktButton=e([i.t("pkt-button")],exports.PktButton);
|
|
12
|
+
`}updateElementClasses(){const t=new Set,s=this.getAttribute("class");t.add("pkt-btn"),s&&s.split(" ").forEach(n=>t.add(n)),this.size&&t.add(`pkt-btn--${this.size}`),this.skin&&t.add(`pkt-btn--${this.skin}`),this.variant&&t.add(`pkt-btn--${this.variant}`),this.color&&t.add(`pkt-btn--${this.color}`),this.isLoading&&t.add("pkt-btn--active"),this.state&&t.add(`pkt-btn--${this.state}`),this.disabled&&t.add("pkt-btn--disabled"),this.className=[...t].join(" ")}handleClick(t){if(this.disabled||this.isLoading){t.preventDefault(),t.stopImmediatePropagation();return}if(this.type==="submit"&&this.internals.form){this.internals.form.requestSubmit();return}if(this.type==="reset"&&this.internals.form){this.internals.form.reset();return}this.onClick&&typeof this.onClick=="function"&&this.onClick!==this.handleClick&&this.onClick(t),this.dispatchEvent(new CustomEvent("button-click",{bubbles:!0,composed:!0,detail:{originalEvent:t}}))}handleKeydown(t){if(!(this.disabled||this.isLoading)&&(t.key==="Enter"||t.key===" ")){t.preventDefault();const s=t.target;s&&s.click()}}};exports.PktButton.formAssociated=!0;e([i.n({type:String})],exports.PktButton.prototype,"iconName",2);e([i.n({type:String})],exports.PktButton.prototype,"secondIconName",2);e([i.n({type:String})],exports.PktButton.prototype,"mode",2);e([i.n({type:String})],exports.PktButton.prototype,"size",2);e([i.n({type:String})],exports.PktButton.prototype,"color",2);e([i.n({type:String})],exports.PktButton.prototype,"skin",2);e([i.n({type:String})],exports.PktButton.prototype,"variant",2);e([i.n({type:String})],exports.PktButton.prototype,"state",2);e([i.n({type:String,reflect:!0})],exports.PktButton.prototype,"type",2);e([i.n({type:Boolean})],exports.PktButton.prototype,"isLoading",2);e([i.n({type:Boolean,reflect:!0})],exports.PktButton.prototype,"disabled",2);exports.PktButton=e([i.t("pkt-button")],exports.PktButton);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const s=require("./element-BSypUpzA.cjs");require("./button-
|
|
1
|
+
"use strict";const s=require("./element-BSypUpzA.cjs");require("./button-DEadihVm.cjs");require("./icon-BnKGwYjj.cjs");const g={i18n:{nb:{contentPresentation:{title:"Oslo kommune bruker informasjonskapsler",description:["For at nettstedet skal fungere og være trygt, bruker Oslo kommune informasjonskapsler. Noen er teknisk nødvendige, mens andre sikrer ulik funksjonalitet.","Godtar du alle informasjonskapsler, tillater du også at vi samler inn data om statistikk og brukeradferd. Da hjelper du oss med å lage et bedre nettsted uten at du trenger å dele noe personlig informasjon med oss."],buttons:{accept:"Godta alle",reject:"Kun nødvendige",settings:"Innstillinger for informasjonskapsler"}},contentSettings:{title:"Innstillinger for informasjonskapsler",description:["Her kan du velge hvilke typer informasjonskapsler du vil tillate. Tillatelsen gjelder i 90 dager. Husk at nødvendige informasjonskapsler ikke kan velges bort.","Du kan når som helst endre innstillingene og finne mer informasjon nederst på nettstedet under «Innstillinger for informasjonskapsler» og «Personvern og informasjonskapsler»."],buttons:{back:"Tilbake",save:"Lagre innstillinger"}}},en:{contentPresentation:{title:"Before you visit Oslo kommune ...",description:["This website uses cookies to make improvements. In this context, we need your consent to measure the traffic on the website in relation to statistics and feedback.","To read more about what we use cookies for, go to our privacy declaration which you will find at the bottom of our websites."],buttons:{accept:"Yes, I accept",reject:"Only necessary",settings:"Go to settings"}},contentSettings:{title:"Her kan du aktivt velge mellom ulike informasjonskapsler",description:["For å lese mer om hva vi bruker informasjonskapsler til gå til vår personvernserklering som du finner på våre nettsider"],buttons:{back:"Back",save:"Save settings"}}}}},c=globalThis,d=c.__cookieEvents||{events:{},on(n,e){this.events[n]||(this.events[n]=[]),this.events[n].push(e)},off(n,e){this.events[n]&&(this.events[n]=this.events[n].filter(t=>t!==e))},once(n,e){const t=o=>{this.off(n,t),e(o)};this.on(n,t)},emit(n,e){this.events[n]&&this.events[n].forEach(t=>t(e))}};c.__cookieEvents=d;const k=d;var u=Object.defineProperty,p=Object.getOwnPropertyDescriptor,a=(n,e,t,o)=>{for(var i=o>1?void 0:o?p(e,t):e,r=n.length-1,l;r>=0;r--)(l=n[r])&&(i=(o?l(e,t,i):l(i))||i);return o&&i&&u(e,t,i),i};exports.PktConsent=class extends s.PktElement{constructor(){super(),this.hotjarId=null,this.googleAnalyticsId=null,this.triggerType="button",this.triggerText=null,this.i18nLanguage="nb"}connectedCallback(){super.connectedCallback(),this.triggerText=this.triggerText||g.i18n[this.i18nLanguage].contentPresentation.buttons.settings,this.googleAnalyticsId&&(window.googleAnalyticsId=this.googleAnalyticsId),this.hotjarId&&(window.hotjarId=this.hotjarId),k.on("CookieManager.setCookie",e=>{this.emitCookieConsents(e)})}returnJsonOrObject(e){let t;try{t=JSON.parse(e)}catch{t=e}return t}emitCookieConsents(e){const o=this.returnJsonOrObject(e.value).items.reduce((i,r)=>(i[r.name]=r.consent,i),{});this.dispatchEvent(new CustomEvent("toggle-consent",{detail:o,bubbles:!0,composed:!0}))}firstUpdated(e){if(!document.querySelector("#oslo-consent-script")&&window.location.hostname.toLowerCase().includes("oslo.kommune.no")){window.googleAnalyticsId=this.googleAnalyticsId,window.hotjarId=this.hotjarId;const t=document.createElement("script");t.src="https://cdn.web.oslo.kommune.no/cb/cb-v1.0.0.js",t.id="oslo-consent-script",t.onload=()=>{this.triggerInit()},document.head.appendChild(t);const o=document.createElement("link");o.href="https://cdn.web.oslo.kommune.no/cb/cb-v1.0.0.css",o.type="text/css",o.rel="stylesheet",o.id="oslo-consent-styles",document.head.appendChild(o)}}triggerInit(){window.document.dispatchEvent(new Event("DOMContentLoaded",{bubbles:!0,cancelable:!0})),window.cookieBanner.cookieConsent.validateConsentCookie().then(e=>{if(e){const o={value:window.cookieBanner.cookieConsent.getConsentCookie()};this.emitCookieConsents(o)}})}openModal(e){e.preventDefault(),window.cookieBanner.cookieConsent||this.triggerInit(),setTimeout(()=>window.cookieBanner.openCookieModal())}render(){return this.triggerType==="link"?s.x`<a href="#" class="pkt-link" @click=${this.openModal}>${this.triggerText}</a>`:this.triggerType==="footerlink"?s.x`<a href="#" class="pkt-footer__link" @click=${this.openModal}>
|
|
2
2
|
<pkt-icon name="chevron-right" class="pkt-footer__link-icon"></pkt-icon>
|
|
3
3
|
${this.triggerText}
|
|
4
4
|
</a>`:this.triggerType==="icon"?s.x`<pkt-button
|
package/dist/index.d.ts
CHANGED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { P as h, E as u, x as f, n as o, a as m } from "./element-DjjF_tEh.js";
|
|
2
|
+
import { P } from "./pkt-slot-controller-DtDaD9q_.js";
|
|
3
|
+
import { e as k, n as g } from "./ref-iIffqQAI.js";
|
|
4
|
+
import { e as d } from "./class-map-KyMqi0fa.js";
|
|
5
|
+
import "./icon-Beoxup8E.js";
|
|
6
|
+
const x = {
|
|
7
|
+
href: {
|
|
8
|
+
default: "#"
|
|
9
|
+
},
|
|
10
|
+
target: {
|
|
11
|
+
default: "_self"
|
|
12
|
+
},
|
|
13
|
+
external: {
|
|
14
|
+
default: !1
|
|
15
|
+
}
|
|
16
|
+
}, c = {
|
|
17
|
+
props: x
|
|
18
|
+
};
|
|
19
|
+
var y = Object.defineProperty, _ = Object.getOwnPropertyDescriptor, r = (i, n, l, s) => {
|
|
20
|
+
for (var t = s > 1 ? void 0 : s ? _(n, l) : n, p = i.length - 1, a; p >= 0; p--)
|
|
21
|
+
(a = i[p]) && (t = (s ? a(n, l, t) : a(t)) || t);
|
|
22
|
+
return s && t && y(n, l, t), t;
|
|
23
|
+
};
|
|
24
|
+
let e = class extends h {
|
|
25
|
+
constructor() {
|
|
26
|
+
super(), this.defaultSlot = k(), this.href = c.props.href.default, this.iconName = void 0, this.iconPosition = void 0, this.external = c.props.external.default, this.target = c.props.target.default, this.slotController = new P(this, this.defaultSlot);
|
|
27
|
+
}
|
|
28
|
+
render() {
|
|
29
|
+
const i = {
|
|
30
|
+
"pkt-link": !0,
|
|
31
|
+
"pkt-link--icon-left": !!this.iconName && this.iconPosition === "left" || !!(this.iconName && !this.iconPosition),
|
|
32
|
+
"pkt-link--icon-right": !!this.iconName && this.iconPosition === "right",
|
|
33
|
+
"pkt-link--external": this.external
|
|
34
|
+
};
|
|
35
|
+
return f`<a
|
|
36
|
+
class=${d(i)}
|
|
37
|
+
href=${this.href}
|
|
38
|
+
.target=${this.target}
|
|
39
|
+
.rel=${this.external ? "noopener noreferrer" : u}
|
|
40
|
+
>${this.iconName ? f`<pkt-icon name=${this.iconName} class="pkt-link__icon"></pkt-icon>` : ""} <span ${g(this.defaultSlot)}>Link</span></a
|
|
41
|
+
>`;
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
r([
|
|
45
|
+
o({ type: String, reflect: !0 })
|
|
46
|
+
], e.prototype, "href", 2);
|
|
47
|
+
r([
|
|
48
|
+
o({ type: String, reflect: !0 })
|
|
49
|
+
], e.prototype, "iconName", 2);
|
|
50
|
+
r([
|
|
51
|
+
o({ type: String, reflect: !0 })
|
|
52
|
+
], e.prototype, "iconPosition", 2);
|
|
53
|
+
r([
|
|
54
|
+
o({ type: Boolean, reflect: !0 })
|
|
55
|
+
], e.prototype, "external", 2);
|
|
56
|
+
r([
|
|
57
|
+
o({ type: String, reflect: !0 })
|
|
58
|
+
], e.prototype, "target", 2);
|
|
59
|
+
e = r([
|
|
60
|
+
m("pkt-link")
|
|
61
|
+
], e);
|
|
62
|
+
export {
|
|
63
|
+
e as P
|
|
64
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";const t=require("./element-BSypUpzA.cjs"),f=require("./pkt-slot-controller-Da-RgXfS.cjs"),c=require("./ref-BvbyvXRH.cjs"),h=require("./class-map-DCyaICmy.cjs");require("./icon-BnKGwYjj.cjs");const k={href:{default:"#"},target:{default:"_self"},external:{default:!1}},a={props:k};var u=Object.defineProperty,P=Object.getOwnPropertyDescriptor,n=(o,r,s,i)=>{for(var e=i>1?void 0:i?P(r,s):r,l=o.length-1,p;l>=0;l--)(p=o[l])&&(e=(i?p(r,s,e):p(e))||e);return i&&e&&u(r,s,e),e};exports.PktLink=class extends t.PktElement{constructor(){super(),this.defaultSlot=c.e(),this.href=a.props.href.default,this.iconName=void 0,this.iconPosition=void 0,this.external=a.props.external.default,this.target=a.props.target.default,this.slotController=new f.PktSlotController(this,this.defaultSlot)}render(){const r={"pkt-link":!0,"pkt-link--icon-left":!!this.iconName&&this.iconPosition==="left"||!!(this.iconName&&!this.iconPosition),"pkt-link--icon-right":!!this.iconName&&this.iconPosition==="right","pkt-link--external":this.external};return t.x`<a
|
|
2
|
+
class=${h.e(r)}
|
|
3
|
+
href=${this.href}
|
|
4
|
+
.target=${this.target}
|
|
5
|
+
.rel=${this.external?"noopener noreferrer":t.E}
|
|
6
|
+
>${this.iconName?t.x`<pkt-icon name=${this.iconName} class="pkt-link__icon"></pkt-icon>`:""} <span ${c.n(this.defaultSlot)}>Link</span></a
|
|
7
|
+
>`}};n([t.n({type:String,reflect:!0})],exports.PktLink.prototype,"href",2);n([t.n({type:String,reflect:!0})],exports.PktLink.prototype,"iconName",2);n([t.n({type:String,reflect:!0})],exports.PktLink.prototype,"iconPosition",2);n([t.n({type:Boolean,reflect:!0})],exports.PktLink.prototype,"external",2);n([t.n({type:String,reflect:!0})],exports.PktLink.prototype,"target",2);exports.PktLink=n([t.t("pkt-link")],exports.PktLink);
|
package/dist/pkt-button.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("./button-
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("./button-DEadihVm.cjs"),e=t.PktButton;Object.defineProperty(exports,"PktButton",{enumerable:!0,get:()=>t.PktButton});exports.default=e;
|
package/dist/pkt-button.js
CHANGED
package/dist/pkt-consent.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./consent-
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./consent-B4r94Z8d.cjs"),t=e.PktConsent;Object.defineProperty(exports,"PktConsent",{enumerable:!0,get:()=>e.PktConsent});exports.default=t;
|
package/dist/pkt-consent.js
CHANGED
package/dist/pkt-index.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const P=require("./alert-C2EPmB0W.cjs"),l=require("./accordionitem-RFwXQC_0.cjs"),d=require("./backlink-HHM21crL.cjs"),b=require("./button-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const P=require("./alert-C2EPmB0W.cjs"),l=require("./accordionitem-RFwXQC_0.cjs"),d=require("./backlink-HHM21crL.cjs"),b=require("./button-DEadihVm.cjs"),k=require("./calendar-CYY42kN4.cjs"),m=require("./card-Di1MQneh.cjs"),g=require("./combobox-yUrUarU_.cjs"),h=require("./consent-B4r94Z8d.cjs"),f=require("./checkbox-zqd3KVfz.cjs"),t=require("./element-BSypUpzA.cjs"),y=require("./pkt-slot-controller-Da-RgXfS.cjs"),s=require("./ref-BvbyvXRH.cjs"),O=require("./class-map-DCyaICmy.cjs"),j=require("./datepicker-CH5ZmFhf.cjs"),q=require("./helptext-bMgnhZ1R.cjs"),x=require("./heading-BnJhJDMD.cjs"),C=require("./icon-BnKGwYjj.cjs"),v=require("./input-wrapper-B-f_SotM.cjs"),S=require("./link-nesPZCIx.cjs"),$=require("./linkcard-s9yoOq90.cjs"),L=require("./loader-Bk4XPiOY.cjs"),_=require("./messagebox-B0kgftoP.cjs"),A=require("./modal-DZY4gZCQ.cjs"),B=require("./progressbar-DiRfScnB.cjs"),p=require("./radiobutton-CI2xaqAB.cjs"),T=require("./tag-B9kFYxHg.cjs"),I=require("./textarea-DxbylapQ.cjs"),M=require("./textinput-B__c4c1z.cjs"),R=require("./select-BCL790jM.cjs");var H=Object.defineProperty,w=Object.getOwnPropertyDescriptor,o=(a,e,r,i)=>{for(var n=i>1?void 0:i?w(e,r):e,u=a.length-1,c;u>=0;u--)(c=a[u])&&(n=(i?c(e,r,n):c(n))||n);return i&&n&&H(e,r,n),n};exports.PktComponent=class extends t.PktElement{constructor(){super(),this.string="",this.strings=[],this.darkmode=!1,this._list=[],this.defaultSlot=s.e(),this.namedSlot=s.e(),this.slotController=new y.PktSlotController(this,this.defaultSlot,this.namedSlot)}connectedCallback(){this.strings.length&&this.strings.forEach(e=>{this._list.push(e.toUpperCase())}),super.connectedCallback()}render(){const e={"pkt-component":!0,"pkt-component--has-list":this.strings.length>0,"pkt-darkmode":this.darkmode};return t.x`
|
|
2
2
|
<div class="${O.e(e)}">
|
|
3
3
|
<h1 class="pkt-txt-28">${this.string}</h1>
|
|
4
4
|
|
package/dist/pkt-index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { P as A } from "./alert-C33z1kBf.js";
|
|
2
2
|
import { P as B, a as E } from "./accordionitem-vmwqD9rr.js";
|
|
3
3
|
import { P as O } from "./backlink-hvyJmwrO.js";
|
|
4
|
-
import { P as T } from "./button-
|
|
4
|
+
import { P as T } from "./button-D1zx8gKd.js";
|
|
5
5
|
import { c as f } from "./calendar-KDcOWD6V.js";
|
|
6
6
|
import { P as D } from "./calendar-KDcOWD6V.js";
|
|
7
7
|
import { P as G } from "./card-CZG7XGlj.js";
|
|
8
8
|
import { P as K } from "./combobox-B6x7Qukm.js";
|
|
9
|
-
import { P as U } from "./consent-
|
|
9
|
+
import { P as U } from "./consent-DDcfVjC6.js";
|
|
10
10
|
import { P as q } from "./checkbox-Ds1FrhqK.js";
|
|
11
11
|
import { P as k, t as h, x as P, n, a as c } from "./element-DjjF_tEh.js";
|
|
12
12
|
import { P as x } from "./pkt-slot-controller-DtDaD9q_.js";
|
|
@@ -17,7 +17,7 @@ import { P as Q } from "./helptext-DcSUjjEq.js";
|
|
|
17
17
|
import { P as X } from "./heading-DNLQdsXY.js";
|
|
18
18
|
import { P as Z } from "./icon-Beoxup8E.js";
|
|
19
19
|
import { P as et } from "./input-wrapper-BdeoMGnk.js";
|
|
20
|
-
import { P as ot } from "./link-
|
|
20
|
+
import { P as ot } from "./link-DCYJhFKJ.js";
|
|
21
21
|
import { P as at } from "./linkcard-Bt-Qa_SP.js";
|
|
22
22
|
import { P as it } from "./loader-C9EtX_mK.js";
|
|
23
23
|
import { P as lt } from "./messagebox-DZDP8XZt.js";
|
package/dist/pkt-link.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./link-
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./link-nesPZCIx.cjs"),t=e.PktLink;Object.defineProperty(exports,"PktLink",{enumerable:!0,get:()=>e.PktLink});exports.default=t;
|
package/dist/pkt-link.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oslokommune/punkt-elements",
|
|
3
|
-
"version": "12.38.
|
|
3
|
+
"version": "12.38.1",
|
|
4
4
|
"description": "Komponentbiblioteket til Punkt, et designsystem laget av Oslo Origo",
|
|
5
5
|
"homepage": "https://punkt.oslo.kommune.no",
|
|
6
6
|
"author": "Team Designsystem, Oslo Origo",
|
|
@@ -59,5 +59,5 @@
|
|
|
59
59
|
"url": "https://github.com/oslokommune/punkt/issues"
|
|
60
60
|
},
|
|
61
61
|
"license": "MIT",
|
|
62
|
-
"gitHead": "
|
|
62
|
+
"gitHead": "bbffeef32589486551e5e1eaf611c6740adc85d7"
|
|
63
63
|
}
|
|
@@ -69,7 +69,7 @@ export class PktButton extends PktElement<IPktButton> implements IPktButton {
|
|
|
69
69
|
@property({ type: String }) state?: TPktButtonState = 'normal'
|
|
70
70
|
@property({ type: String, reflect: true }) type: TPktButtonType = 'button'
|
|
71
71
|
@property({ type: Boolean }) isLoading: Booleanish = false
|
|
72
|
-
@property({ type: Boolean }) disabled: Booleanish = false
|
|
72
|
+
@property({ type: Boolean, reflect: true }) disabled: Booleanish = false
|
|
73
73
|
|
|
74
74
|
// Lifecycle
|
|
75
75
|
|
|
@@ -37,7 +37,6 @@ export class PktLink extends PktElement {
|
|
|
37
37
|
return html`<a
|
|
38
38
|
class=${classMap(classes)}
|
|
39
39
|
href=${this.href}
|
|
40
|
-
@click=${this.handleClick}
|
|
41
40
|
.target=${this.target}
|
|
42
41
|
.rel=${this.external ? 'noopener noreferrer' : nothing}
|
|
43
42
|
>${this.iconName
|
|
@@ -45,13 +44,4 @@ export class PktLink extends PktElement {
|
|
|
45
44
|
: ''} <span ${ref(this.defaultSlot)}>Link</span></a
|
|
46
45
|
>`
|
|
47
46
|
}
|
|
48
|
-
|
|
49
|
-
private handleClick() {
|
|
50
|
-
this.dispatchEvent(
|
|
51
|
-
new CustomEvent('click', {
|
|
52
|
-
detail: 'pkt-link-clicked',
|
|
53
|
-
bubbles: true,
|
|
54
|
-
}),
|
|
55
|
-
)
|
|
56
|
-
}
|
|
57
47
|
}
|
package/dist/link-B748tCGi.js
DELETED
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
import { P as f, E as u, x as h, n as i, a as k } from "./element-DjjF_tEh.js";
|
|
2
|
-
import { P as m } from "./pkt-slot-controller-DtDaD9q_.js";
|
|
3
|
-
import { e as d, n as P } from "./ref-iIffqQAI.js";
|
|
4
|
-
import { e as g } from "./class-map-KyMqi0fa.js";
|
|
5
|
-
import "./icon-Beoxup8E.js";
|
|
6
|
-
const v = {
|
|
7
|
-
href: {
|
|
8
|
-
default: "#"
|
|
9
|
-
},
|
|
10
|
-
target: {
|
|
11
|
-
default: "_self"
|
|
12
|
-
},
|
|
13
|
-
external: {
|
|
14
|
-
default: !1
|
|
15
|
-
}
|
|
16
|
-
}, c = {
|
|
17
|
-
props: v
|
|
18
|
-
};
|
|
19
|
-
var x = Object.defineProperty, y = Object.getOwnPropertyDescriptor, r = (o, n, l, s) => {
|
|
20
|
-
for (var t = s > 1 ? void 0 : s ? y(n, l) : n, a = o.length - 1, p; a >= 0; a--)
|
|
21
|
-
(p = o[a]) && (t = (s ? p(n, l, t) : p(t)) || t);
|
|
22
|
-
return s && t && x(n, l, t), t;
|
|
23
|
-
};
|
|
24
|
-
let e = class extends f {
|
|
25
|
-
constructor() {
|
|
26
|
-
super(), this.defaultSlot = d(), this.href = c.props.href.default, this.iconName = void 0, this.iconPosition = void 0, this.external = c.props.external.default, this.target = c.props.target.default, this.slotController = new m(this, this.defaultSlot);
|
|
27
|
-
}
|
|
28
|
-
render() {
|
|
29
|
-
const o = {
|
|
30
|
-
"pkt-link": !0,
|
|
31
|
-
"pkt-link--icon-left": !!this.iconName && this.iconPosition === "left" || !!(this.iconName && !this.iconPosition),
|
|
32
|
-
"pkt-link--icon-right": !!this.iconName && this.iconPosition === "right",
|
|
33
|
-
"pkt-link--external": this.external
|
|
34
|
-
};
|
|
35
|
-
return h`<a
|
|
36
|
-
class=${g(o)}
|
|
37
|
-
href=${this.href}
|
|
38
|
-
@click=${this.handleClick}
|
|
39
|
-
.target=${this.target}
|
|
40
|
-
.rel=${this.external ? "noopener noreferrer" : u}
|
|
41
|
-
>${this.iconName ? h`<pkt-icon name=${this.iconName} class="pkt-link__icon"></pkt-icon>` : ""} <span ${P(this.defaultSlot)}>Link</span></a
|
|
42
|
-
>`;
|
|
43
|
-
}
|
|
44
|
-
handleClick() {
|
|
45
|
-
this.dispatchEvent(
|
|
46
|
-
new CustomEvent("click", {
|
|
47
|
-
detail: "pkt-link-clicked",
|
|
48
|
-
bubbles: !0
|
|
49
|
-
})
|
|
50
|
-
);
|
|
51
|
-
}
|
|
52
|
-
};
|
|
53
|
-
r([
|
|
54
|
-
i({ type: String, reflect: !0 })
|
|
55
|
-
], e.prototype, "href", 2);
|
|
56
|
-
r([
|
|
57
|
-
i({ type: String, reflect: !0 })
|
|
58
|
-
], e.prototype, "iconName", 2);
|
|
59
|
-
r([
|
|
60
|
-
i({ type: String, reflect: !0 })
|
|
61
|
-
], e.prototype, "iconPosition", 2);
|
|
62
|
-
r([
|
|
63
|
-
i({ type: Boolean, reflect: !0 })
|
|
64
|
-
], e.prototype, "external", 2);
|
|
65
|
-
r([
|
|
66
|
-
i({ type: String, reflect: !0 })
|
|
67
|
-
], e.prototype, "target", 2);
|
|
68
|
-
e = r([
|
|
69
|
-
k("pkt-link")
|
|
70
|
-
], e);
|
|
71
|
-
export {
|
|
72
|
-
e as P
|
|
73
|
-
};
|
package/dist/link-BrDbM3GT.cjs
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
"use strict";const t=require("./element-BSypUpzA.cjs"),k=require("./pkt-slot-controller-Da-RgXfS.cjs"),p=require("./ref-BvbyvXRH.cjs"),h=require("./class-map-DCyaICmy.cjs");require("./icon-BnKGwYjj.cjs");const f={href:{default:"#"},target:{default:"_self"},external:{default:!1}},a={props:f};var u=Object.defineProperty,P=Object.getOwnPropertyDescriptor,n=(o,i,s,r)=>{for(var e=r>1?void 0:r?P(i,s):i,l=o.length-1,c;l>=0;l--)(c=o[l])&&(e=(r?c(i,s,e):c(e))||e);return r&&e&&u(i,s,e),e};exports.PktLink=class extends t.PktElement{constructor(){super(),this.defaultSlot=p.e(),this.href=a.props.href.default,this.iconName=void 0,this.iconPosition=void 0,this.external=a.props.external.default,this.target=a.props.target.default,this.slotController=new k.PktSlotController(this,this.defaultSlot)}render(){const i={"pkt-link":!0,"pkt-link--icon-left":!!this.iconName&&this.iconPosition==="left"||!!(this.iconName&&!this.iconPosition),"pkt-link--icon-right":!!this.iconName&&this.iconPosition==="right","pkt-link--external":this.external};return t.x`<a
|
|
2
|
-
class=${h.e(i)}
|
|
3
|
-
href=${this.href}
|
|
4
|
-
@click=${this.handleClick}
|
|
5
|
-
.target=${this.target}
|
|
6
|
-
.rel=${this.external?"noopener noreferrer":t.E}
|
|
7
|
-
>${this.iconName?t.x`<pkt-icon name=${this.iconName} class="pkt-link__icon"></pkt-icon>`:""} <span ${p.n(this.defaultSlot)}>Link</span></a
|
|
8
|
-
>`}handleClick(){this.dispatchEvent(new CustomEvent("click",{detail:"pkt-link-clicked",bubbles:!0}))}};n([t.n({type:String,reflect:!0})],exports.PktLink.prototype,"href",2);n([t.n({type:String,reflect:!0})],exports.PktLink.prototype,"iconName",2);n([t.n({type:String,reflect:!0})],exports.PktLink.prototype,"iconPosition",2);n([t.n({type:Boolean,reflect:!0})],exports.PktLink.prototype,"external",2);n([t.n({type:String,reflect:!0})],exports.PktLink.prototype,"target",2);exports.PktLink=n([t.t("pkt-link")],exports.PktLink);
|