@oslokommune/punkt-elements 16.0.5 → 16.2.0
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/{accordionitem-CHXGzgLv.js → accordionitem-Cj74XruR.js} +31 -31
- package/dist/accordionitem-D7sWqDM_.cjs +34 -0
- package/dist/alert-C95U_RZ0.cjs +33 -0
- package/dist/{alert-BHSd2Vpj.js → alert-ca_hFi-u.js} +19 -20
- package/dist/async-directive-B158h3ba.cjs +5 -0
- package/dist/async-directive-CKx6pubI.js +65 -0
- package/dist/{button-CHUuxLQV.js → button-BRovt5nm.js} +10 -11
- package/dist/button-BXN_JPaH.cjs +27 -0
- package/dist/{card-Db9QSEqh.cjs → card-DfHo45CG.cjs} +11 -13
- package/dist/{card-CmfUyl_s.js → card-DvgCTN4B.js} +47 -51
- package/dist/{checkbox-D6nltMuc.js → checkbox-CbIUMIYt.js} +2 -2
- package/dist/{checkbox-Cpyay9_l.cjs → checkbox-mmn3v9ry.cjs} +1 -1
- package/dist/{combobox-TKTemUxN.js → combobox-CwW0md6G.js} +31 -31
- package/dist/combobox-TKL44xnV.cjs +135 -0
- package/dist/{consent-BQLkfN3d.cjs → consent-CIhFwuFO.cjs} +1 -1
- package/dist/{consent-knPF4PS_.js → consent-CgS1L1xF.js} +1 -1
- package/dist/{datepicker-CPNcXd-o.cjs → datepicker-oN9L0Wnm.cjs} +14 -14
- package/dist/{datepicker-MuQYeXhL.js → datepicker-qRWWzmbo.js} +51 -51
- package/dist/element-with-slot-1djk8KXi.js +240 -0
- package/dist/element-with-slot-yT8k1Z37.cjs +1 -0
- package/dist/helptext-B366oeR9.cjs +24 -0
- package/dist/{helptext-TFpeGJ1P.js → helptext-DepcDYFV.js} +32 -39
- package/dist/index.d.ts +39 -90
- package/dist/input-element-Xe9FTi2a.cjs +1 -0
- package/dist/{input-element-BGNbdzy2.js → input-element-n5U38pZ1.js} +8 -7
- package/dist/{input-wrapper-CaUY90qz.js → input-wrapper-B__6jW4U.js} +25 -28
- package/dist/{input-wrapper-JU4D2TGu.cjs → input-wrapper-BdFdJU-k.cjs} +7 -9
- package/dist/link-DLjXMpvi.cjs +7 -0
- package/dist/link-oGYvBLYL.js +53 -0
- package/dist/linkcard-BhVIc18n.js +54 -0
- package/dist/linkcard-C20WC6Nw.cjs +13 -0
- package/dist/{loader-BF9K1VCZ.js → loader-BHt9i5Xp.js} +12 -13
- package/dist/{loader-C1LI8Q4z.cjs → loader-DxAGCcNF.cjs} +2 -2
- package/dist/messagebox-B8LW0PSQ.cjs +13 -0
- package/dist/messagebox-DkspcMQg.js +69 -0
- package/dist/modal-Bfk_ncLQ.cjs +36 -0
- package/dist/{modal-CGHWsjk8.js → modal-p1rvuP8e.js} +26 -27
- package/dist/pkt-accordion.cjs +1 -1
- package/dist/pkt-accordion.js +2 -2
- package/dist/pkt-alert.cjs +1 -1
- package/dist/pkt-alert.js +1 -1
- package/dist/pkt-button.cjs +1 -1
- package/dist/pkt-button.js +1 -1
- package/dist/pkt-card.cjs +1 -1
- package/dist/pkt-card.js +1 -1
- package/dist/pkt-checkbox.cjs +1 -1
- package/dist/pkt-checkbox.js +1 -1
- package/dist/pkt-combobox.cjs +1 -1
- package/dist/pkt-combobox.js +1 -1
- package/dist/pkt-consent.cjs +1 -1
- package/dist/pkt-consent.js +1 -1
- package/dist/pkt-datepicker.cjs +1 -1
- package/dist/pkt-datepicker.js +2 -2
- package/dist/pkt-header.cjs +16 -17
- package/dist/pkt-header.js +62 -69
- package/dist/pkt-helptext.cjs +1 -1
- package/dist/pkt-helptext.js +1 -1
- package/dist/pkt-index.cjs +1 -1
- package/dist/pkt-index.js +22 -22
- package/dist/pkt-input-wrapper.cjs +1 -1
- package/dist/pkt-input-wrapper.js +1 -1
- package/dist/pkt-link.cjs +1 -1
- package/dist/pkt-link.js +1 -1
- package/dist/pkt-linkcard.cjs +1 -1
- package/dist/pkt-linkcard.js +1 -1
- package/dist/pkt-loader.cjs +1 -1
- package/dist/pkt-loader.js +1 -1
- package/dist/pkt-messagebox.cjs +1 -1
- package/dist/pkt-messagebox.js +1 -1
- package/dist/pkt-modal.cjs +1 -1
- package/dist/pkt-modal.js +1 -1
- package/dist/pkt-options-controller-DIeKSpWv.cjs +1 -0
- package/dist/{pkt-options-controller-Z-bPox7n.js → pkt-options-controller-W4ITGQy9.js} +1 -1
- package/dist/pkt-progressbar.cjs +1 -1
- package/dist/pkt-progressbar.js +2 -2
- package/dist/pkt-radiobutton.cjs +1 -1
- package/dist/pkt-radiobutton.js +1 -1
- package/dist/pkt-select.cjs +1 -1
- package/dist/pkt-select.js +1 -1
- package/dist/pkt-tabs.cjs +1 -1
- package/dist/pkt-tabs.js +2 -2
- package/dist/pkt-tag.cjs +1 -1
- package/dist/pkt-tag.js +1 -1
- package/dist/pkt-textarea.cjs +1 -1
- package/dist/pkt-textarea.js +1 -1
- package/dist/pkt-textinput.cjs +1 -1
- package/dist/pkt-textinput.js +1 -1
- package/dist/{progressbar-Bxh335uT.cjs → progressbar-CC9Qr82_.cjs} +1 -1
- package/dist/{progressbar-GSA4Md1u.js → progressbar-CcX-xiPI.js} +1 -1
- package/dist/{radiobutton-CNHCpKn0.cjs → radiobutton-BUDQYAH-.cjs} +1 -1
- package/dist/{radiobutton-DgC27mb0.js → radiobutton-RW3h0tJj.js} +2 -2
- package/dist/ref-DBGHvw2G.js +42 -0
- package/dist/ref-DahIePMT.cjs +5 -0
- package/dist/select-PuEeK4jQ.cjs +49 -0
- package/dist/{select-7VuYtPZv.js → select-iXKeM3yz.js} +37 -37
- package/dist/{tabitem-DQRzgAT4.js → tabitem-DZSzwag2.js} +30 -30
- package/dist/{tabitem-BKv4eN0a.cjs → tabitem-Jenus4Qd.cjs} +13 -13
- package/dist/{tag-DZPqFiem.js → tag-CIWBLpjv.js} +17 -18
- package/dist/tag-DeE1OpmF.cjs +27 -0
- package/dist/{textarea-VpCEjVFx.js → textarea-DR9lVDN-.js} +13 -13
- package/dist/{textarea-CO7Ikug5.cjs → textarea-DtiYQWjy.cjs} +7 -7
- package/dist/{textinput-C2AZ9ss2.js → textinput-0Bttvt9V.js} +22 -22
- package/dist/{textinput-DRFZU3dA.cjs → textinput-cKrjvbJW.cjs} +9 -9
- package/package.json +3 -3
- package/src/components/accordion/accordionitem.ts +4 -6
- package/src/components/alert/alert.ts +4 -8
- package/src/components/button/button.ts +4 -12
- package/src/components/card/card.ts +4 -19
- package/src/components/combobox/combobox-base.ts +0 -5
- package/src/components/combobox/combobox-utils.ts +1 -1
- package/src/components/combobox/combobox.ts +2 -1
- package/src/components/datepicker/datepicker.ts +2 -8
- package/src/components/header/header-service.ts +5 -19
- package/src/components/header/header.ts +4 -13
- package/src/components/helptext/helptext.test.ts +2 -12
- package/src/components/helptext/helptext.ts +5 -19
- package/src/components/input-wrapper/input-wrapper.test.ts +3 -3
- package/src/components/input-wrapper/input-wrapper.ts +5 -16
- package/src/components/link/link.ts +4 -12
- package/src/components/linkcard/linkcard.test.ts +2 -2
- package/src/components/linkcard/linkcard.ts +4 -13
- package/src/components/loader/loader.ts +4 -12
- package/src/components/messagebox/messagebox.ts +4 -9
- package/src/components/modal/modal.ts +4 -7
- package/src/components/select/select.ts +2 -5
- package/src/components/tabs/tabitem.ts +4 -7
- package/src/components/tabs/tabs.ts +4 -13
- package/src/components/tag/tag.ts +6 -12
- package/src/components/textarea/textarea.ts +2 -8
- package/src/components/textinput/textinput.ts +2 -8
- package/dist/accordionitem-To95GT6b.cjs +0 -34
- package/dist/alert-BDXWFRcf.cjs +0 -33
- package/dist/button-VWxZW89G.cjs +0 -27
- package/dist/combobox-DX2BLzIm.cjs +0 -135
- package/dist/helptext-BjW1WdOn.cjs +0 -24
- package/dist/input-element-CSDVA3Y6.cjs +0 -1
- package/dist/link-Bscfb6s9.js +0 -54
- package/dist/link-CDuv1jxx.cjs +0 -7
- package/dist/linkcard-3WUL0CpY.cjs +0 -13
- package/dist/linkcard-wNgRxJ-S.js +0 -55
- package/dist/messagebox-Dmot5szX.cjs +0 -13
- package/dist/messagebox-LBEzcr6B.js +0 -70
- package/dist/modal-S9MOKOaz.cjs +0 -37
- package/dist/pkt-options-controller-BogGk-6J.cjs +0 -1
- package/dist/pkt-slot-controller-D4nKlom5.cjs +0 -1
- package/dist/pkt-slot-controller-D7CrjM52.js +0 -95
- package/dist/ref-CxLwrCxt.cjs +0 -9
- package/dist/ref-Dma3n3i8.js +0 -102
- package/dist/select-PWPy5gTB.cjs +0 -49
- package/dist/tag-DmbgBCKu.cjs +0 -27
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
|
+
## [16.1.0](https://github.com/oslokommune/punkt/compare/16.0.5...16.1.0) (2026-03-18)
|
|
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
|
## [16.1.0](https://github.com/oslokommune/punkt/compare/16.0.2...16.1.0) (2026-03-12)
|
|
9
26
|
|
|
10
27
|
### ⚠ BREAKING CHANGES
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { i as
|
|
2
|
-
import { e as
|
|
3
|
-
import { P as
|
|
4
|
-
import { e as
|
|
1
|
+
import { i as u, b as m, n as r, t as h } from "./element-CV9utnHJ.js";
|
|
2
|
+
import { e as f } from "./class-map-3ADKve8g.js";
|
|
3
|
+
import { P as y, s as _ } from "./element-with-slot-1djk8KXi.js";
|
|
4
|
+
import { e as k, n as v } from "./ref-DBGHvw2G.js";
|
|
5
5
|
import { o as $ } from "./if-defined-rXcLNTzN.js";
|
|
6
|
-
var b = Object.defineProperty,
|
|
7
|
-
for (var i = o > 1 ? void 0 : o ?
|
|
6
|
+
var b = Object.defineProperty, O = Object.getOwnPropertyDescriptor, l = (t, e, a, o) => {
|
|
7
|
+
for (var i = o > 1 ? void 0 : o ? O(e, a) : e, n = t.length - 1, c; n >= 0; n--)
|
|
8
8
|
(c = t[n]) && (i = (o ? c(e, a, i) : c(i)) || i);
|
|
9
9
|
return o && i && b(e, a, i), i;
|
|
10
10
|
};
|
|
11
|
-
let p = class extends
|
|
11
|
+
let p = class extends u {
|
|
12
12
|
constructor() {
|
|
13
13
|
super(...arguments), this.ariaLabelledBy = "", this.compact = !1, this.skin = "borderless", this.name = "";
|
|
14
14
|
}
|
|
@@ -37,10 +37,10 @@ let p = class extends k {
|
|
|
37
37
|
"pkt-accordion--compact": this.compact,
|
|
38
38
|
[`pkt-accordion--${this.skin}`]: this.skin
|
|
39
39
|
};
|
|
40
|
-
return
|
|
40
|
+
return m`
|
|
41
41
|
<div
|
|
42
42
|
part="container"
|
|
43
|
-
class=${
|
|
43
|
+
class=${f(t)}
|
|
44
44
|
data-testid="pkt-accordion"
|
|
45
45
|
aria-labelledby=${this.ariaLabelledBy}
|
|
46
46
|
>
|
|
@@ -49,30 +49,30 @@ let p = class extends k {
|
|
|
49
49
|
`;
|
|
50
50
|
}
|
|
51
51
|
};
|
|
52
|
-
|
|
52
|
+
l([
|
|
53
53
|
r({ type: String, reflect: !0, attribute: "aria-labelledby" })
|
|
54
54
|
], p.prototype, "ariaLabelledBy", 2);
|
|
55
|
-
|
|
55
|
+
l([
|
|
56
56
|
r({ type: Boolean, reflect: !0, attribute: "compact" })
|
|
57
57
|
], p.prototype, "compact", 2);
|
|
58
|
-
|
|
58
|
+
l([
|
|
59
59
|
r({ type: String, reflect: !0, attribute: "skin" })
|
|
60
60
|
], p.prototype, "skin", 2);
|
|
61
|
-
|
|
61
|
+
l([
|
|
62
62
|
r({ type: String, reflect: !0, attribute: "name" })
|
|
63
63
|
], p.prototype, "name", 2);
|
|
64
|
-
p =
|
|
65
|
-
|
|
64
|
+
p = l([
|
|
65
|
+
h("pkt-accordion")
|
|
66
66
|
], p);
|
|
67
67
|
const C = p;
|
|
68
|
-
var
|
|
68
|
+
var P = Object.defineProperty, g = Object.getOwnPropertyDescriptor, d = (t, e, a, o) => {
|
|
69
69
|
for (var i = o > 1 ? void 0 : o ? g(e, a) : e, n = t.length - 1, c; n >= 0; n--)
|
|
70
70
|
(c = t[n]) && (i = (o ? c(e, a, i) : c(i)) || i);
|
|
71
|
-
return o && i &&
|
|
71
|
+
return o && i && P(e, a, i), i;
|
|
72
72
|
};
|
|
73
|
-
let s = class extends
|
|
73
|
+
let s = class extends y {
|
|
74
74
|
constructor() {
|
|
75
|
-
super(), this.defaultOpen = !1, this.title = "", this.skin = void 0, this.compact = !1, this.isOpen = !1, this.name = void 0, this.accordionItemRef =
|
|
75
|
+
super(), this.defaultOpen = !1, this.title = "", this.skin = void 0, this.compact = !1, this.isOpen = !1, this.name = void 0, this.accordionItemRef = k();
|
|
76
76
|
}
|
|
77
77
|
firstUpdated(t) {
|
|
78
78
|
this.defaultOpen && (this.isOpen = !0);
|
|
@@ -83,12 +83,12 @@ let s = class extends _ {
|
|
|
83
83
|
"pkt-accordion-item--compact": this.compact,
|
|
84
84
|
[`pkt-accordion-item--${this.skin}`]: !!this.skin
|
|
85
85
|
};
|
|
86
|
-
return
|
|
86
|
+
return m`
|
|
87
87
|
<details
|
|
88
|
-
class=${
|
|
88
|
+
class=${f(t)}
|
|
89
89
|
id=${this.id}
|
|
90
90
|
?open=${this.isOpen}
|
|
91
|
-
${
|
|
91
|
+
${v(this.accordionItemRef)}
|
|
92
92
|
name=${$(this.name)}
|
|
93
93
|
>
|
|
94
94
|
<summary class="pkt-accordion-item__title" id=${`pkt-accordion-item-summary-${this.id}`}>
|
|
@@ -104,32 +104,32 @@ let s = class extends _ {
|
|
|
104
104
|
id="pkt-accordion-item__content-${this.id}"
|
|
105
105
|
role="region"
|
|
106
106
|
>
|
|
107
|
-
<div class="pkt-accordion-item__content-inner"
|
|
107
|
+
<div class="pkt-accordion-item__content-inner">${_(this)}</div>
|
|
108
108
|
</div>
|
|
109
109
|
</details>
|
|
110
110
|
`;
|
|
111
111
|
}
|
|
112
112
|
};
|
|
113
|
-
|
|
113
|
+
d([
|
|
114
114
|
r({ type: Boolean })
|
|
115
115
|
], s.prototype, "defaultOpen", 2);
|
|
116
|
-
|
|
116
|
+
d([
|
|
117
117
|
r({ type: String })
|
|
118
118
|
], s.prototype, "title", 2);
|
|
119
|
-
|
|
119
|
+
d([
|
|
120
120
|
r({ type: String, reflect: !0 })
|
|
121
121
|
], s.prototype, "skin", 2);
|
|
122
|
-
|
|
122
|
+
d([
|
|
123
123
|
r({ type: Boolean, reflect: !0 })
|
|
124
124
|
], s.prototype, "compact", 2);
|
|
125
|
-
|
|
125
|
+
d([
|
|
126
126
|
r({ type: Boolean, reflect: !0 })
|
|
127
127
|
], s.prototype, "isOpen", 2);
|
|
128
|
-
|
|
128
|
+
d([
|
|
129
129
|
r({ type: String, reflect: !0 })
|
|
130
130
|
], s.prototype, "name", 2);
|
|
131
|
-
s =
|
|
132
|
-
|
|
131
|
+
s = d([
|
|
132
|
+
h("pkt-accordion-item")
|
|
133
133
|
], s);
|
|
134
134
|
const E = s;
|
|
135
135
|
export {
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";const i=require("./element-CMTfByxQ.cjs"),h=require("./class-map-Bokp1SoS.cjs"),m=require("./element-with-slot-yT8k1Z37.cjs"),u=require("./ref-DahIePMT.cjs"),f=require("./if-defined-hKKmbsI8.cjs");var y=Object.defineProperty,k=Object.getOwnPropertyDescriptor,l=(s,t,o,r)=>{for(var e=r>1?void 0:r?k(t,o):t,c=s.length-1,a;c>=0;c--)(a=s[c])&&(e=(r?a(t,o,e):a(e))||e);return r&&e&&y(t,o,e),e};let p=class extends i.i{constructor(){super(...arguments),this.ariaLabelledBy="",this.compact=!1,this.skin="borderless",this.name=""}updated(t){t.has("skin")&&this.requestUpdate(),t.has("name")&&this.updateAccordionItemNames()}updateAccordionItemNames(){var t;if(this.name){const o=(t=this.renderRoot)==null?void 0:t.querySelector("slot");o&&o.assignedElements().forEach(e=>{e.tagName.toLowerCase()==="pkt-accordion-item"&&(e.hasAttribute("name")||e.setAttribute("name",this.name))})}}firstUpdated(){var o;const t=(o=this.renderRoot)==null?void 0:o.querySelector("slot");t&&t.addEventListener("slotchange",()=>{this.updateAccordionItemNames()})}render(){const t={"pkt-accordion":!0,"pkt-accordion--compact":this.compact,[`pkt-accordion--${this.skin}`]:this.skin};return i.b`
|
|
2
|
+
<div
|
|
3
|
+
part="container"
|
|
4
|
+
class=${h.e(t)}
|
|
5
|
+
data-testid="pkt-accordion"
|
|
6
|
+
aria-labelledby=${this.ariaLabelledBy}
|
|
7
|
+
>
|
|
8
|
+
<slot></slot>
|
|
9
|
+
</div>
|
|
10
|
+
`}};l([i.n({type:String,reflect:!0,attribute:"aria-labelledby"})],p.prototype,"ariaLabelledBy",2);l([i.n({type:Boolean,reflect:!0,attribute:"compact"})],p.prototype,"compact",2);l([i.n({type:String,reflect:!0,attribute:"skin"})],p.prototype,"skin",2);l([i.n({type:String,reflect:!0,attribute:"name"})],p.prototype,"name",2);p=l([i.t("pkt-accordion")],p);const _=p;var v=Object.defineProperty,b=Object.getOwnPropertyDescriptor,d=(s,t,o,r)=>{for(var e=r>1?void 0:r?b(t,o):t,c=s.length-1,a;c>=0;c--)(a=s[c])&&(e=(r?a(t,o,e):a(e))||e);return r&&e&&v(t,o,e),e};let n=class extends m.PktElementWithSlot{constructor(){super(),this.defaultOpen=!1,this.title="",this.skin=void 0,this.compact=!1,this.isOpen=!1,this.name=void 0,this.accordionItemRef=u.e()}firstUpdated(s){this.defaultOpen&&(this.isOpen=!0)}render(){const s={"pkt-accordion-item":!0,"pkt-accordion-item--compact":this.compact,[`pkt-accordion-item--${this.skin}`]:!!this.skin};return i.b`
|
|
11
|
+
<details
|
|
12
|
+
class=${h.e(s)}
|
|
13
|
+
id=${this.id}
|
|
14
|
+
?open=${this.isOpen}
|
|
15
|
+
${u.n(this.accordionItemRef)}
|
|
16
|
+
name=${f.o(this.name)}
|
|
17
|
+
>
|
|
18
|
+
<summary class="pkt-accordion-item__title" id=${`pkt-accordion-item-summary-${this.id}`}>
|
|
19
|
+
${this.title}
|
|
20
|
+
<pkt-icon
|
|
21
|
+
name="chevron-thin-down"
|
|
22
|
+
class="pkt-accordion-item__icon"
|
|
23
|
+
aria-hidden="true"
|
|
24
|
+
></pkt-icon>
|
|
25
|
+
</summary>
|
|
26
|
+
<div
|
|
27
|
+
class="pkt-accordion-item__content"
|
|
28
|
+
id="pkt-accordion-item__content-${this.id}"
|
|
29
|
+
role="region"
|
|
30
|
+
>
|
|
31
|
+
<div class="pkt-accordion-item__content-inner">${m.slotContent(this)}</div>
|
|
32
|
+
</div>
|
|
33
|
+
</details>
|
|
34
|
+
`}};d([i.n({type:Boolean})],n.prototype,"defaultOpen",2);d([i.n({type:String})],n.prototype,"title",2);d([i.n({type:String,reflect:!0})],n.prototype,"skin",2);d([i.n({type:Boolean,reflect:!0})],n.prototype,"compact",2);d([i.n({type:Boolean,reflect:!0})],n.prototype,"isOpen",2);d([i.n({type:String,reflect:!0})],n.prototype,"name",2);n=d([i.t("pkt-accordion-item")],n);const $=n;exports.PktAccordion=_;exports.PktAccordionItem_default=$;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";const c=require("./class-map-Bokp1SoS.cjs"),e=require("./element-CMTfByxQ.cjs"),d=require("./state-BNgpvY-A.cjs"),u=require("./element-with-slot-yT8k1Z37.cjs"),h=require("./classutils-BwNK82ZQ.cjs");require("./icon-Dj0oZZSa.cjs");require("./button-BXN_JPaH.cjs");const k={skin:{default:"info"},ariaLive:{default:"polite"},compact:{default:!1},closeAlert:{default:!1}},a={props:k};var v=Object.defineProperty,f=Object.getOwnPropertyDescriptor,i=(o,t,s,r)=>{for(var l=r>1?void 0:r?f(t,s):t,p=o.length-1,n;p>=0;p--)(n=o[p])&&(l=(r?n(t,s,l):n(l))||l);return r&&l&&v(t,s,l),l};exports.PktAlert=class extends u.PktElementWithSlot{constructor(){super(),this.compact=a.props.compact.default,this.title="",this.skin=a.props.skin.default,this.ariaLive=a.props.ariaLive.default,this["aria-live"]=null,this.closeAlert=a.props.closeAlert.default,this.date=null,this.role="status",this._isClosed=!1,this.close=t=>{this._isClosed=!0,this.dispatchEvent(new CustomEvent("close",{detail:{origin:t},bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("on-close",{detail:{origin:t},bubbles:!0,composed:!0}))},this._isClosed=!1}connectedCallback(){super.connectedCallback(),this["aria-live"]=this.getAttribute("aria-live")||this.ariaLive}attributeChangedCallback(t,s,r){t==="ariaLive"&&(this["aria-live"]=r),super.attributeChangedCallback(t,s,r)}updated(t){super.updated(t),t.has("ariaLive")&&(this["aria-live"]=this.ariaLive),t.has("_isClosed")&&h.updateClassAttribute(this,"pkt-hide",this._isClosed)}render(){const t={"pkt-alert":!0,"pkt-alert--compact":this.compact,[`pkt-alert--${this.skin}`]:this.skin,"pkt-hide":this._isClosed},s={"pkt-alert__grid":!0,"pkt-alert__noTitle":!this.title,"pkt-alert__noDate":!this.date};return e.b`
|
|
2
|
+
<div class=${c.e(t)} aria-live=${this["aria-live"]}>
|
|
3
|
+
<div class=${c.e(s)}>
|
|
4
|
+
<pkt-icon
|
|
5
|
+
class="pkt-alert__icon"
|
|
6
|
+
aria-hidden="true"
|
|
7
|
+
name=${this.skin==="info"?"alert-information":`alert-${this.skin}`}
|
|
8
|
+
></pkt-icon>
|
|
9
|
+
|
|
10
|
+
${this.closeAlert?e.b`
|
|
11
|
+
<div class="pkt-alert__close">
|
|
12
|
+
<pkt-button
|
|
13
|
+
tabindex="0"
|
|
14
|
+
aria-label="close"
|
|
15
|
+
size=${this.compact?"small":"medium"}
|
|
16
|
+
type="button"
|
|
17
|
+
skin="tertiary"
|
|
18
|
+
iconName="close"
|
|
19
|
+
variant="icon-only"
|
|
20
|
+
@click=${this.close}
|
|
21
|
+
>
|
|
22
|
+
<span class="sr-only">Lukk</span>
|
|
23
|
+
</pkt-button>
|
|
24
|
+
</div>
|
|
25
|
+
`:e.A}
|
|
26
|
+
${this.title?e.b`<div class="pkt-alert__title">${this.title}</div>`:e.A}
|
|
27
|
+
|
|
28
|
+
<div class="pkt-alert__text">${u.slotContent(this)}</div>
|
|
29
|
+
|
|
30
|
+
${this.date?e.b`<div class="pkt-alert__date">Sist oppdatert: ${this.date}</div>`:e.A}
|
|
31
|
+
</div>
|
|
32
|
+
</div>
|
|
33
|
+
`}};i([e.n({type:Boolean,reflect:!1})],exports.PktAlert.prototype,"compact",2);i([e.n({type:String,reflect:!0})],exports.PktAlert.prototype,"title",2);i([e.n({type:String,reflect:!0})],exports.PktAlert.prototype,"skin",2);i([e.n({type:String})],exports.PktAlert.prototype,"ariaLive",2);i([e.n({type:String,reflect:!0})],exports.PktAlert.prototype,"aria-live",2);i([e.n({type:Boolean,reflect:!0})],exports.PktAlert.prototype,"closeAlert",2);i([e.n({type:String,reflect:!0})],exports.PktAlert.prototype,"date",2);i([e.n({type:String,reflect:!0})],exports.PktAlert.prototype,"role",2);i([d.r()],exports.PktAlert.prototype,"_isClosed",2);exports.PktAlert=i([e.t("pkt-alert")],exports.PktAlert);
|
|
@@ -1,38 +1,37 @@
|
|
|
1
1
|
import { e as h } from "./class-map-3ADKve8g.js";
|
|
2
|
-
import {
|
|
3
|
-
import { r as
|
|
4
|
-
import { P as m } from "./
|
|
5
|
-
import {
|
|
6
|
-
import { u as y } from "./classutils-RQs1k6D9.js";
|
|
2
|
+
import { A as u, b as p, n as a, t as v } from "./element-CV9utnHJ.js";
|
|
3
|
+
import { r as f } from "./state-l4hGZdFJ.js";
|
|
4
|
+
import { P as k, s as m } from "./element-with-slot-1djk8KXi.js";
|
|
5
|
+
import { u as _ } from "./classutils-RQs1k6D9.js";
|
|
7
6
|
import "./icon-D0IQAVwS.js";
|
|
8
|
-
import "./button-
|
|
9
|
-
const
|
|
10
|
-
props:
|
|
7
|
+
import "./button-BRovt5nm.js";
|
|
8
|
+
const b = { skin: { default: "info" }, ariaLive: { default: "polite" }, compact: { default: !1 }, closeAlert: { default: !1 } }, c = {
|
|
9
|
+
props: b
|
|
11
10
|
};
|
|
12
|
-
var
|
|
13
|
-
for (var
|
|
14
|
-
(d = t[n]) && (
|
|
15
|
-
return o &&
|
|
11
|
+
var y = Object.defineProperty, C = Object.getOwnPropertyDescriptor, i = (t, s, l, o) => {
|
|
12
|
+
for (var r = o > 1 ? void 0 : o ? C(s, l) : s, n = t.length - 1, d; n >= 0; n--)
|
|
13
|
+
(d = t[n]) && (r = (o ? d(s, l, r) : d(r)) || r);
|
|
14
|
+
return o && r && y(s, l, r), r;
|
|
16
15
|
};
|
|
17
|
-
let e = class extends
|
|
16
|
+
let e = class extends k {
|
|
18
17
|
constructor() {
|
|
19
|
-
super(), this.
|
|
18
|
+
super(), this.compact = c.props.compact.default, this.title = "", this.skin = c.props.skin.default, this.ariaLive = c.props.ariaLive.default, this["aria-live"] = null, this.closeAlert = c.props.closeAlert.default, this.date = null, this.role = "status", this._isClosed = !1, this.close = (t) => {
|
|
20
19
|
this._isClosed = !0, this.dispatchEvent(
|
|
21
20
|
new CustomEvent("close", { detail: { origin: t }, bubbles: !0, composed: !0 })
|
|
22
21
|
), this.dispatchEvent(
|
|
23
22
|
new CustomEvent("on-close", { detail: { origin: t }, bubbles: !0, composed: !0 })
|
|
24
23
|
);
|
|
25
|
-
}, this.
|
|
24
|
+
}, this._isClosed = !1;
|
|
26
25
|
}
|
|
27
26
|
// Lifecycle
|
|
28
27
|
connectedCallback() {
|
|
29
28
|
super.connectedCallback(), this["aria-live"] = this.getAttribute("aria-live") || this.ariaLive;
|
|
30
29
|
}
|
|
31
|
-
attributeChangedCallback(t, s,
|
|
32
|
-
t === "ariaLive" && (this["aria-live"] =
|
|
30
|
+
attributeChangedCallback(t, s, l) {
|
|
31
|
+
t === "ariaLive" && (this["aria-live"] = l), super.attributeChangedCallback(t, s, l);
|
|
33
32
|
}
|
|
34
33
|
updated(t) {
|
|
35
|
-
super.updated(t), t.has("ariaLive") && (this["aria-live"] = this.ariaLive), t.has("_isClosed") &&
|
|
34
|
+
super.updated(t), t.has("ariaLive") && (this["aria-live"] = this.ariaLive), t.has("_isClosed") && _(this, "pkt-hide", this._isClosed);
|
|
36
35
|
}
|
|
37
36
|
// Render
|
|
38
37
|
render() {
|
|
@@ -73,7 +72,7 @@ let e = class extends f {
|
|
|
73
72
|
` : u}
|
|
74
73
|
${this.title ? p`<div class="pkt-alert__title">${this.title}</div>` : u}
|
|
75
74
|
|
|
76
|
-
<div class="pkt-alert__text"
|
|
75
|
+
<div class="pkt-alert__text">${m(this)}</div>
|
|
77
76
|
|
|
78
77
|
${this.date ? p`<div class="pkt-alert__date">Sist oppdatert: ${this.date}</div>` : u}
|
|
79
78
|
</div>
|
|
@@ -106,7 +105,7 @@ i([
|
|
|
106
105
|
a({ type: String, reflect: !0 })
|
|
107
106
|
], e.prototype, "role", 2);
|
|
108
107
|
i([
|
|
109
|
-
|
|
108
|
+
f()
|
|
110
109
|
], e.prototype, "_isClosed", 2);
|
|
111
110
|
e = i([
|
|
112
111
|
v("pkt-alert")
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
"use strict";const $=require("./directive-helpers-B3Vpl3xV.cjs"),c=require("./directive-C7oCP5Bh.cjs");/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2017 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
5
|
+
*/const r=(t,e)=>{var i;const s=t._$AN;if(s===void 0)return!1;for(const n of s)(i=n._$AO)==null||i.call(n,e,!1),r(n,e);return!0},h=t=>{let e,s;do{if((e=t._$AM)===void 0)break;s=e._$AN,s.delete(t),t=e}while((s==null?void 0:s.size)===0)},_=t=>{for(let e;e=t._$AM;t=e){let s=e._$AN;if(s===void 0)e._$AN=s=new Set;else if(s.has(t))break;s.add(t),f(e)}};function A(t){this._$AN!==void 0?(h(this),this._$AM=t,_(this)):this._$AM=t}function d(t,e=!1,s=0){const i=this._$AH,n=this._$AN;if(n!==void 0&&n.size!==0)if(e)if(Array.isArray(i))for(let o=s;o<i.length;o++)r(i[o],!1),h(i[o]);else i!=null&&(r(i,!1),h(i));else r(this,t)}const f=t=>{t.type==c.t.CHILD&&(t._$AP??(t._$AP=d),t._$AQ??(t._$AQ=A))};class l extends c.i{constructor(){super(...arguments),this._$AN=void 0}_$AT(e,s,i){super._$AT(e,s,i),_(this),this.isConnected=e._$AU}_$AO(e,s=!0){var i,n;e!==this.isConnected&&(this.isConnected=e,e?(i=this.reconnected)==null||i.call(this):(n=this.disconnected)==null||n.call(this)),s&&(r(this,e),h(this))}setValue(e){if($.r(this._$Ct))this._$Ct._$AI(e,this);else{const s=[...this._$Ct._$AH];s[this._$Ci]=e,this._$Ct._$AI(s,this,0)}}disconnected(){}reconnected(){}}exports.f=l;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { r as _ } from "./directive-helpers-CyPtA1_i.js";
|
|
2
|
+
import { i as A, t as c } from "./directive-oAbCiebi.js";
|
|
3
|
+
/**
|
|
4
|
+
* @license
|
|
5
|
+
* Copyright 2017 Google LLC
|
|
6
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
7
|
+
*/
|
|
8
|
+
const n = (e, t) => {
|
|
9
|
+
var i;
|
|
10
|
+
const s = e._$AN;
|
|
11
|
+
if (s === void 0) return !1;
|
|
12
|
+
for (const o of s) (i = o._$AO) == null || i.call(o, t, !1), n(o, t);
|
|
13
|
+
return !0;
|
|
14
|
+
}, h = (e) => {
|
|
15
|
+
let t, s;
|
|
16
|
+
do {
|
|
17
|
+
if ((t = e._$AM) === void 0) break;
|
|
18
|
+
s = t._$AN, s.delete(e), e = t;
|
|
19
|
+
} while ((s == null ? void 0 : s.size) === 0);
|
|
20
|
+
}, $ = (e) => {
|
|
21
|
+
for (let t; t = e._$AM; e = t) {
|
|
22
|
+
let s = t._$AN;
|
|
23
|
+
if (s === void 0) t._$AN = s = /* @__PURE__ */ new Set();
|
|
24
|
+
else if (s.has(e)) break;
|
|
25
|
+
s.add(e), l(t);
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
function f(e) {
|
|
29
|
+
this._$AN !== void 0 ? (h(this), this._$AM = e, $(this)) : this._$AM = e;
|
|
30
|
+
}
|
|
31
|
+
function d(e, t = !1, s = 0) {
|
|
32
|
+
const i = this._$AH, o = this._$AN;
|
|
33
|
+
if (o !== void 0 && o.size !== 0) if (t) if (Array.isArray(i)) for (let r = s; r < i.length; r++) n(i[r], !1), h(i[r]);
|
|
34
|
+
else i != null && (n(i, !1), h(i));
|
|
35
|
+
else n(this, e);
|
|
36
|
+
}
|
|
37
|
+
const l = (e) => {
|
|
38
|
+
e.type == c.CHILD && (e._$AP ?? (e._$AP = d), e._$AQ ?? (e._$AQ = f));
|
|
39
|
+
};
|
|
40
|
+
class C extends A {
|
|
41
|
+
constructor() {
|
|
42
|
+
super(...arguments), this._$AN = void 0;
|
|
43
|
+
}
|
|
44
|
+
_$AT(t, s, i) {
|
|
45
|
+
super._$AT(t, s, i), $(this), this.isConnected = t._$AU;
|
|
46
|
+
}
|
|
47
|
+
_$AO(t, s = !0) {
|
|
48
|
+
var i, o;
|
|
49
|
+
t !== this.isConnected && (this.isConnected = t, t ? (i = this.reconnected) == null || i.call(this) : (o = this.disconnected) == null || o.call(this)), s && (n(this, t), h(this));
|
|
50
|
+
}
|
|
51
|
+
setValue(t) {
|
|
52
|
+
if (_(this._$Ct)) this._$Ct._$AI(t, this);
|
|
53
|
+
else {
|
|
54
|
+
const s = [...this._$Ct._$AH];
|
|
55
|
+
s[this._$Ci] = t, this._$Ct._$AI(s, this, 0);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
disconnected() {
|
|
59
|
+
}
|
|
60
|
+
reconnected() {
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
export {
|
|
64
|
+
C as f
|
|
65
|
+
};
|
|
@@ -1,18 +1,17 @@
|
|
|
1
|
-
import { P as c,
|
|
2
|
-
import {
|
|
3
|
-
import { e as
|
|
1
|
+
import { P as c, s as f } from "./element-with-slot-1djk8KXi.js";
|
|
2
|
+
import { A as b, b as l, n as s, t as u } from "./element-CV9utnHJ.js";
|
|
3
|
+
import { e as y } from "./class-map-3ADKve8g.js";
|
|
4
4
|
import { o as r } from "./if-defined-rXcLNTzN.js";
|
|
5
|
-
import { e as y, n as k } from "./ref-Dma3n3i8.js";
|
|
6
5
|
import "./icon-D0IQAVwS.js";
|
|
7
|
-
var
|
|
8
|
-
for (var a = p > 1 ? void 0 : p ?
|
|
6
|
+
var m = Object.defineProperty, g = Object.getOwnPropertyDescriptor, e = (t, o, n, p) => {
|
|
7
|
+
for (var a = p > 1 ? void 0 : p ? g(o, n) : o, d = t.length - 1, h; d >= 0; d--)
|
|
9
8
|
(h = t[d]) && (a = (p ? h(o, n, a) : h(a)) || a);
|
|
10
|
-
return p && a &&
|
|
9
|
+
return p && a && m(o, n, a), a;
|
|
11
10
|
};
|
|
12
11
|
window.pktAnimationPath = window.pktAnimationPath || "https://punkt-cdn.oslo.kommune.no/latest/animations/";
|
|
13
12
|
let i = class extends c {
|
|
14
13
|
constructor() {
|
|
15
|
-
super(), this.
|
|
14
|
+
super(...arguments), this.iconName = "user", this.secondIconName = "user", this.mode = "light", this.size = "medium", this.fullWidth = !1, this.fullWidthOnMobile = !1, this.skin = "primary", this.variant = "label-only", this.state = "normal", this.type = "button", this.form = void 0, this.isLoading = !1, this.disabled = !1, this.loadingAnimationPath = window.pktAnimationPath;
|
|
16
15
|
}
|
|
17
16
|
// Lifecycle
|
|
18
17
|
connectedCallback() {
|
|
@@ -52,7 +51,7 @@ let i = class extends c {
|
|
|
52
51
|
};
|
|
53
52
|
return l`
|
|
54
53
|
<button
|
|
55
|
-
class=${
|
|
54
|
+
class=${y(o)}
|
|
56
55
|
type=${this.type}
|
|
57
56
|
?disabled=${!!this.disabled}
|
|
58
57
|
aria-busy=${r(this.isLoading ? "true" : void 0)}
|
|
@@ -69,7 +68,7 @@ let i = class extends c {
|
|
|
69
68
|
name=${this.iconName}
|
|
70
69
|
path=${r(this.iconPath)}
|
|
71
70
|
></pkt-icon>` : b}
|
|
72
|
-
<span class="pkt-btn__text"
|
|
71
|
+
<span class="pkt-btn__text">${f(this)}</span>
|
|
73
72
|
${this.variant === "icons-right-and-left" ? l`<pkt-icon
|
|
74
73
|
class="pkt-btn__icon"
|
|
75
74
|
name=${this.secondIconName}
|
|
@@ -131,7 +130,7 @@ e([
|
|
|
131
130
|
s({ type: String })
|
|
132
131
|
], i.prototype, "loadingAnimationPath", 2);
|
|
133
132
|
i = e([
|
|
134
|
-
|
|
133
|
+
u("pkt-button")
|
|
135
134
|
], i);
|
|
136
135
|
export {
|
|
137
136
|
i as P
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";const d=require("./element-with-slot-yT8k1Z37.cjs"),t=require("./element-CMTfByxQ.cjs"),h=require("./class-map-Bokp1SoS.cjs"),a=require("./if-defined-hKKmbsI8.cjs");require("./icon-Dj0oZZSa.cjs");var u=Object.defineProperty,c=Object.getOwnPropertyDescriptor,n=(r,i,o,e)=>{for(var s=e>1?void 0:e?c(i,o):i,p=r.length-1,l;p>=0;p--)(l=r[p])&&(s=(e?l(i,o,s):l(s))||s);return e&&s&&u(i,o,s),s};window.pktAnimationPath=window.pktAnimationPath||"https://punkt-cdn.oslo.kommune.no/latest/animations/";exports.PktButton=class extends d.PktElementWithSlot{constructor(){super(...arguments),this.iconName="user",this.secondIconName="user",this.mode="light",this.size="medium",this.fullWidth=!1,this.fullWidthOnMobile=!1,this.skin="primary",this.variant="label-only",this.state="normal",this.type="button",this.form=void 0,this.isLoading=!1,this.disabled=!1,this.loadingAnimationPath=window.pktAnimationPath}connectedCallback(){super.connectedCallback(),this.addEventListener("click",i=>{(this.disabled||this.hasAttribute("disabled")||this.isLoading)&&(i.preventDefault(),i.stopImmediatePropagation())},!0),this.addEventListener("keydown",i=>{(this.disabled||this.hasAttribute("disabled")||this.isLoading)&&(i.key==="Enter"||i.key===" ")&&(i.preventDefault(),i.stopImmediatePropagation())},!0)}attributeChangedCallback(i,o,e){super.attributeChangedCallback(i,o,e),i==="disabled"&&e==="false"&&(this.disabled=!1),(i==="isloading"||i==="isLoading")&&e==="false"&&(this.isLoading=!1)}firstUpdated(i){super.firstUpdated(i),this.disabled==="false"&&(this.disabled=!1),this.isLoading==="false"&&(this.isLoading=!1)}render(){const i=this.form??this.getAttribute("form")??void 0,o={"pkt-btn":!0,[`pkt-btn--${this.size}`]:!!this.size,[`pkt-btn--${this.skin}`]:!!this.skin,[`pkt-btn--${this.variant}`]:!!this.variant,[`pkt-btn--${this.color}`]:!!this.color,[`pkt-btn--${this.state}`]:!!this.state,"pkt-btn--full":!!this.fullWidth,"pkt-btn--full-small":!!this.fullWidthOnMobile,"pkt-btn--disabled":!!this.disabled,"pkt-btn--isLoading":!!this.isLoading};return t.b`
|
|
2
|
+
<button
|
|
3
|
+
class=${h.e(o)}
|
|
4
|
+
type=${this.type}
|
|
5
|
+
?disabled=${!!this.disabled}
|
|
6
|
+
aria-busy=${a.o(this.isLoading?"true":void 0)}
|
|
7
|
+
aria-disabled=${a.o(this.disabled||this.isLoading?"true":void 0)}
|
|
8
|
+
form=${a.o(i)}
|
|
9
|
+
>
|
|
10
|
+
${this.isLoading?t.b`<pkt-icon
|
|
11
|
+
class="pkt-btn__icon pkt-btn__spinner"
|
|
12
|
+
name="spinner-blue"
|
|
13
|
+
path=${a.o(this.loadingAnimationPath)}
|
|
14
|
+
></pkt-icon>`:t.A}
|
|
15
|
+
${this.variant!=="label-only"?t.b`<pkt-icon
|
|
16
|
+
class="pkt-btn__icon pkt-icon"
|
|
17
|
+
name=${this.iconName}
|
|
18
|
+
path=${a.o(this.iconPath)}
|
|
19
|
+
></pkt-icon>`:t.A}
|
|
20
|
+
<span class="pkt-btn__text">${d.slotContent(this)}</span>
|
|
21
|
+
${this.variant==="icons-right-and-left"?t.b`<pkt-icon
|
|
22
|
+
class="pkt-btn__icon"
|
|
23
|
+
name=${this.secondIconName}
|
|
24
|
+
path=${a.o(this.secondIconPath)}
|
|
25
|
+
></pkt-icon>`:t.A}
|
|
26
|
+
</button>
|
|
27
|
+
`}};n([t.n({type:String})],exports.PktButton.prototype,"iconName",2);n([t.n({type:String})],exports.PktButton.prototype,"secondIconName",2);n([t.n({type:String})],exports.PktButton.prototype,"iconPath",2);n([t.n({type:String})],exports.PktButton.prototype,"secondIconPath",2);n([t.n({type:String})],exports.PktButton.prototype,"mode",2);n([t.n({type:String})],exports.PktButton.prototype,"size",2);n([t.n({type:Boolean,attribute:"full-width"})],exports.PktButton.prototype,"fullWidth",2);n([t.n({type:Boolean,attribute:"full-width-on-mobile"})],exports.PktButton.prototype,"fullWidthOnMobile",2);n([t.n({type:String})],exports.PktButton.prototype,"color",2);n([t.n({type:String})],exports.PktButton.prototype,"skin",2);n([t.n({type:String})],exports.PktButton.prototype,"variant",2);n([t.n({type:String,reflect:!0})],exports.PktButton.prototype,"state",2);n([t.n({type:String,reflect:!0})],exports.PktButton.prototype,"type",2);n([t.n({type:String})],exports.PktButton.prototype,"form",2);n([t.n({type:Boolean,reflect:!0})],exports.PktButton.prototype,"isLoading",2);n([t.n({type:Boolean,reflect:!0})],exports.PktButton.prototype,"disabled",2);n([t.n({type:String})],exports.PktButton.prototype,"loadingAnimationPath",2);exports.PktButton=n([t.t("pkt-button")],exports.PktButton);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
"use strict";const
|
|
1
|
+
"use strict";const l=require("./class-map-Bokp1SoS.cjs"),h=require("./if-defined-hKKmbsI8.cjs"),t=require("./element-CMTfByxQ.cjs"),g=require("./element-with-slot-yT8k1Z37.cjs");require("./icon-Dj0oZZSa.cjs");require("./tag-DeE1OpmF.cjs");require("./heading-B0XRE0lq.cjs");const c={layout:{default:"vertical"},skin:{type:["outlined","outlined-beige","gray","blue","beige","green"],default:"outlined"},padding:{default:"default"}},p={props:c};var k=Object.defineProperty,u=Object.getOwnPropertyDescriptor,e=(i,a,n,s)=>{for(var r=s>1?void 0:s?u(a,n):a,d=i.length-1,o;d>=0;d--)(o=i[d])&&(r=(s?o(a,n,r):o(r))||r);return s&&r&&k(a,n,r),r};exports.PktCard=class extends g.PktElementWithSlot{constructor(){super(...arguments),this.ariaLabel="",this.metaLead=null,this.borderOnHover=!0,this.clickCardLink=null,this.metaTrail=null,this.layout=p.props.layout.default,this.heading="",this.headinglevel=3,this.image={src:"",alt:""},this.imageShape="square",this.openLinkInNewTab=!1,this.padding=p.props.padding.default,this.skin=p.props.skin.default,this.subheading="",this.tagPosition="top",this.tags=[]}connectedCallback(){super.connectedCallback()}render(){var r,d;const a={"pkt-card":!0,[`pkt-card--${this.skin}`]:this.skin,[`pkt-card--${this.layout}`]:this.layout,[`pkt-card--padding-${this.padding}`]:this.padding,"pkt-card--border-on-hover":this.borderOnHover},n=((r=this.ariaLabel)==null?void 0:r.trim())||(this.heading?`${this.heading} lenkekort`:"lenkekort"),s=((d=this.ariaLabel)==null?void 0:d.trim())||(this.heading?this.heading:"kort");return t.b`
|
|
2
2
|
<article
|
|
3
|
-
class=${
|
|
4
|
-
aria-label=${h.o(this.clickCardLink?s
|
|
3
|
+
class=${l.e(a)}
|
|
4
|
+
aria-label=${h.o(this.clickCardLink?n:s)}
|
|
5
5
|
>
|
|
6
6
|
${this.renderImage()}
|
|
7
7
|
<div class="pkt-card__wrapper">
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
</article>
|
|
15
15
|
`}renderImage(){const a={"pkt-card__image":!0,[`pkt-card__image-${this.imageShape}`]:this.imageShape};return t.b`
|
|
16
16
|
${this.image.src&&t.b`
|
|
17
|
-
<div class=${
|
|
17
|
+
<div class=${l.e(a)}>
|
|
18
18
|
<img src=${this.image.src} alt=${this.image.alt||""} />
|
|
19
19
|
</div>
|
|
20
20
|
`}
|
|
@@ -60,30 +60,28 @@
|
|
|
60
60
|
`}renderTags(){const a={"pkt-card__tags":!0,[`pkt-card__tags-${this.tagPosition}`]:this.tagPosition};return t.b`
|
|
61
61
|
${this.tags.length>0?t.b`
|
|
62
62
|
<div
|
|
63
|
-
class=${
|
|
63
|
+
class=${l.e(a)}
|
|
64
64
|
role="list"
|
|
65
65
|
aria-label=${this.tags.length>1?"merkelapper":"merkelapp"}
|
|
66
66
|
>
|
|
67
|
-
${this.tags.map(
|
|
67
|
+
${this.tags.map(n=>t.b`
|
|
68
68
|
<pkt-tag
|
|
69
69
|
role="listitem"
|
|
70
70
|
textStyle="normal-text"
|
|
71
71
|
size="medium"
|
|
72
|
-
skin=${h.o(
|
|
73
|
-
iconName=${h.o(
|
|
72
|
+
skin=${h.o(n.skin)}
|
|
73
|
+
iconName=${h.o(n.iconName)}
|
|
74
74
|
>
|
|
75
|
-
<span>${
|
|
75
|
+
<span>${n.text}</span>
|
|
76
76
|
</pkt-tag>
|
|
77
77
|
`)}
|
|
78
78
|
</div>
|
|
79
79
|
`:t.A}
|
|
80
|
-
`}renderSlot(){return t.b`
|
|
81
|
-
${this.defaultSlot&&t.b`<section class="pkt-card__content" ${g.n(this.defaultSlot)}></section>`}
|
|
82
|
-
`}renderMetadata(){return t.b`
|
|
80
|
+
`}renderSlot(){return t.b`<section class="pkt-card__content">${g.slotContent(this)}</section>`}renderMetadata(){return t.b`
|
|
83
81
|
${this.metaLead||this.metaTrail?t.b`
|
|
84
82
|
<footer class="pkt-card__metadata">
|
|
85
83
|
${this.metaLead?t.b`<span class="pkt-card__metadata-lead">${this.metaLead}</span>`:t.A}
|
|
86
84
|
${this.metaTrail?t.b`<span class="pkt-card__metadata-trail">${this.metaTrail}</span>`:t.A}
|
|
87
85
|
</footer>
|
|
88
86
|
`:t.A}
|
|
89
|
-
`}};e([t.n({type:String})],exports.PktCard.prototype,"ariaLabel",2);e([t.n({type:String})],exports.PktCard.prototype,"metaLead",2);e([t.n({type:Boolean})],exports.PktCard.prototype,"borderOnHover",2);e([t.n({type:String,reflect:!0})],exports.PktCard.prototype,"clickCardLink",2);e([t.n({type:String})],exports.PktCard.prototype,"metaTrail",2);e([t.n({type:String})],exports.PktCard.prototype,"layout",2);e([t.n({type:String})],exports.PktCard.prototype,"heading",2);e([t.n({type:Number})],exports.PktCard.prototype,"headinglevel",2);e([t.n({type:Object})],exports.PktCard.prototype,"image",2);e([t.n({type:String})],exports.PktCard.prototype,"imageShape",2);e([t.n({type:Boolean})],exports.PktCard.prototype,"openLinkInNewTab",2);e([t.n({type:String})],exports.PktCard.prototype,"padding",2);e([t.n({type:String,converter:{fromAttribute:i=>{const a=
|
|
87
|
+
`}};e([t.n({type:String})],exports.PktCard.prototype,"ariaLabel",2);e([t.n({type:String})],exports.PktCard.prototype,"metaLead",2);e([t.n({type:Boolean})],exports.PktCard.prototype,"borderOnHover",2);e([t.n({type:String,reflect:!0})],exports.PktCard.prototype,"clickCardLink",2);e([t.n({type:String})],exports.PktCard.prototype,"metaTrail",2);e([t.n({type:String})],exports.PktCard.prototype,"layout",2);e([t.n({type:String})],exports.PktCard.prototype,"heading",2);e([t.n({type:Number})],exports.PktCard.prototype,"headinglevel",2);e([t.n({type:Object})],exports.PktCard.prototype,"image",2);e([t.n({type:String})],exports.PktCard.prototype,"imageShape",2);e([t.n({type:Boolean})],exports.PktCard.prototype,"openLinkInNewTab",2);e([t.n({type:String})],exports.PktCard.prototype,"padding",2);e([t.n({type:String,converter:{fromAttribute:i=>{const a=p.props.skin.type;return i&&a.includes(i)?i:(i&&!a.includes(i)&&console.warn(`Invalid skin value "${i}". Using default skin "${p.props.skin.default}".`),p.props.skin.default)},toAttribute:i=>i}})],exports.PktCard.prototype,"skin",2);e([t.n({type:String})],exports.PktCard.prototype,"subheading",2);e([t.n({type:String})],exports.PktCard.prototype,"tagPosition",2);e([t.n({type:Array})],exports.PktCard.prototype,"tags",2);exports.PktCard=e([t.t("pkt-card")],exports.PktCard);
|