@oslokommune/punkt-elements 13.6.15 → 13.8.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 +40 -0
- package/dist/{accordionitem-B_h5XGCo.js → accordionitem-C_URrDjP.js} +4 -4
- package/dist/{accordionitem-BOmnm80g.cjs → accordionitem-DCZrHVNR.cjs} +1 -1
- package/dist/{alert-ZP5-fqlt.cjs → alert-Ci7WvRXi.cjs} +1 -1
- package/dist/{alert-CTTm6ugp.js → alert-Dh1YhaBq.js} +13 -26
- package/dist/{backlink-BT7DO6rV.cjs → backlink-BzEvli8m.cjs} +1 -1
- package/dist/{backlink-Bq8O2bt8.js → backlink-CI_jMGzZ.js} +3 -3
- package/dist/{button-x6Xw-5w0.js → button-CCFAUJa0.js} +5 -5
- package/dist/{button-BfqxLnMT.cjs → button-CXJQ_Wgl.cjs} +1 -1
- package/dist/calendar-BaMrdMDZ.cjs +115 -0
- package/dist/{calendar-CodWwTHM.js → calendar-DtJh7UYD.js} +532 -480
- package/dist/{card-B9RPShvV.cjs → card-Cf-UcGAP.cjs} +1 -1
- package/dist/{card-en2KhOPO.js → card-M1X36b6i.js} +8 -26
- package/dist/{checkbox-CH8xeK-0.cjs → checkbox-CTxc8wQe.cjs} +1 -1
- package/dist/{checkbox-DSAcMC-D.js → checkbox-_5LbXU7N.js} +4 -4
- package/dist/class-map-C_erArZz.cjs +5 -0
- package/dist/{class-map-Dw6Wrxwi.js → class-map-wy7PUk0P.js} +3 -3
- package/dist/{combobox-BFOjlFIj.cjs → combobox-BJ1gA0f0.cjs} +1 -1
- package/dist/{combobox-DaiEdUKx.js → combobox-Ct0NNY1p.js} +12 -16
- package/dist/{consent-CXp0bLvg.js → consent-B2hIQh4b.js} +3 -3
- package/dist/{consent-DFrsiYGQ.cjs → consent-BeOjxQdR.cjs} +1 -1
- package/dist/{datepicker-CbVSKaOY.js → datepicker-B8mifBAm.js} +12 -28
- package/dist/{datepicker-BR1imflE.cjs → datepicker-DVqmQAOe.cjs} +1 -1
- package/dist/directive-helpers-4oOjKnGY.cjs +5 -0
- package/dist/directive-helpers-BzAtj9by.js +38 -0
- package/dist/{element-D62wHiNU.cjs → element-CJ_QKaki.cjs} +6 -6
- package/dist/{element-DJZPsA_J.js → element-CRDRygXu.js} +47 -132
- package/dist/{heading-H_FWjo2k.cjs → heading--JKFppLS.cjs} +1 -1
- package/dist/{heading-DQ0R34j4.js → heading-Cs5yGnJg.js} +1 -1
- package/dist/{helptext-D1fkGmfT.cjs → helptext-CVQP3pis.cjs} +1 -1
- package/dist/{helptext-8ykxyegi.js → helptext-DuvVSH7d.js} +6 -6
- package/dist/icon-1dy7UZcu.js +89 -0
- package/dist/icon-BGuizDwk.cjs +9 -0
- package/dist/{if-defined-D3lgJqT7.js → if-defined-BWZGb3bh.js} +1 -1
- package/dist/{if-defined-CkVc_RJD.cjs → if-defined-Bc9-_I01.cjs} +1 -1
- package/dist/index.d.ts +8 -7
- package/dist/input-element-BcFmygSF.js +707 -0
- package/dist/input-element-j9znzLWz.cjs +1 -0
- package/dist/{input-wrapper-DVjNwf8-.cjs → input-wrapper-BsQ7oFMd.cjs} +1 -1
- package/dist/input-wrapper-CDgenrYA.js +6 -0
- package/dist/{input-wrapper-CQzXG44g.js → input-wrapper-CKJU0QWG.js} +8 -8
- package/dist/{link-CyiVlb-7.cjs → link-Da3pZ_CW.cjs} +1 -1
- package/dist/{link-DSSJYrtn.js → link-DzZCw8j2.js} +9 -16
- package/dist/{linkcard-fH9uydjS.cjs → linkcard-BM23gzhS.cjs} +1 -1
- package/dist/{linkcard-g8JtooPU.js → linkcard-RIK5xqbd.js} +4 -4
- package/dist/{listbox-L-iOSF7M.cjs → listbox-CsGiqzD0.cjs} +1 -1
- package/dist/{listbox-n4wjlLqD.js → listbox-DlJevu8O.js} +5 -5
- package/dist/{loader-Bzf1sPSg.js → loader-BVvBzaPI.js} +5 -5
- package/dist/{loader-C-3l7kb9.cjs → loader-Bo8RCbCJ.cjs} +1 -1
- package/dist/{messagebox---xPIAwR.cjs → messagebox-C76IcXTl.cjs} +1 -1
- package/dist/{messagebox-okJLeSpj.js → messagebox-DwdMXoAe.js} +6 -16
- package/dist/{modal-pohCsr_x.js → modal-BGXk3f9u.js} +6 -16
- package/dist/{modal-IjDRQfX1.cjs → modal-Cdz9JcCX.cjs} +1 -1
- 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-backlink.cjs +1 -1
- package/dist/pkt-backlink.js +1 -1
- package/dist/pkt-button.cjs +1 -1
- package/dist/pkt-button.js +1 -1
- package/dist/pkt-calendar.cjs +1 -1
- package/dist/pkt-calendar.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-heading.cjs +1 -1
- package/dist/pkt-heading.js +1 -1
- package/dist/pkt-helptext.cjs +1 -1
- package/dist/pkt-helptext.js +1 -1
- package/dist/pkt-icon.cjs +1 -1
- package/dist/pkt-icon.js +1 -1
- package/dist/pkt-index.cjs +1 -1
- package/dist/pkt-index.js +29 -29
- 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-listbox.cjs +1 -1
- package/dist/pkt-listbox.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-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-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-DjsupQ7Y.js → progressbar-BbVei20_.js} +7 -7
- package/dist/{progressbar-DJzEC7cx.cjs → progressbar-CazcIzVT.cjs} +2 -2
- package/dist/{radiobutton-DEboKECm.cjs → radiobutton-D1fihs8R.cjs} +1 -1
- package/dist/{radiobutton-Bz_qApF3.js → radiobutton-DODROIBF.js} +5 -5
- package/dist/{ref-BfgcOXko.cjs → ref-BFa5Utho.cjs} +1 -1
- package/dist/{ref-BCGCor-j.js → ref-Xa5dbh--.js} +2 -2
- package/dist/repeat-BZb41H64.cjs +5 -0
- package/dist/{repeat-B6qPUgAq.js → repeat-CJ79egkN.js} +8 -8
- package/dist/{select-DKkoxmgj.js → select-BG2MBQbh.js} +6 -6
- package/dist/{select-DynzsPo0.cjs → select-D-m1PhpA.cjs} +1 -1
- package/dist/{state-CPQXJ4Ct.js → state-DS_kr2Fy.js} +1 -1
- package/dist/{state-BkE_Rxl7.cjs → state-DSjcvzDN.cjs} +1 -1
- package/dist/{tag-NZ5oeGfw.js → tag-CqMgt01I.js} +7 -20
- package/dist/{tag-BKq07hGI.cjs → tag-EFUKrc8q.cjs} +2 -2
- package/dist/{textarea-COG1CH_s.js → textarea-DCKKhs1B.js} +9 -9
- package/dist/{textarea-BS1tgktz.cjs → textarea-aUG3S7C2.cjs} +1 -1
- package/dist/{textinput-CTOtfcTR.js → textinput-B5Ai5R8L.js} +8 -8
- package/dist/{textinput-CCK8ti2y.cjs → textinput-mUERucRy.cjs} +1 -1
- package/package.json +14 -6
- package/src/components/combobox/combobox.ts +1 -1
- package/src/components/icon/icon.ts +17 -8
- package/src/components/select/select.ts +1 -1
- package/dist/calendar-DH-fCGyW.cjs +0 -115
- package/dist/class-map-CG3vIaNm.cjs +0 -5
- package/dist/directive-helpers-_qHew-gi.cjs +0 -5
- package/dist/directive-helpers-cAOIHg9K.js +0 -45
- package/dist/icon-B1-mkmwB.js +0 -88
- package/dist/icon-__Hjt2XZ.cjs +0 -9
- package/dist/input-element-DQOVrqUZ.js +0 -703
- package/dist/input-element-Y8sdrq9C.cjs +0 -1
- package/dist/input-wrapper-8iKEzDRZ.js +0 -40
- package/dist/repeat-DzibMwhi.cjs +0 -5
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
* Copyright 2017 Google LLC
|
|
4
4
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
5
5
|
*/
|
|
6
|
-
const P = globalThis, H = P.trustedTypes, V = H ? H.createPolicy("lit-html", { createHTML: (r) => r }) : void 0, st = "$lit$",
|
|
7
|
-
\f\r]`, w = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, J = /-->/g, W = />/g,
|
|
8
|
-
\f\r"'\`<>=]|("|')|))|$)`, "g"), Z = /'/g, K = /"/g, rt = /^(?:script|style|textarea|title)$/i, dt = (r) => (t, ...e) => ({ _$litType$: r, strings: t, values: e }), Lt = dt(1), E = Symbol.for("lit-noChange"), d = Symbol.for("lit-nothing"), G = /* @__PURE__ */ new WeakMap(),
|
|
6
|
+
const P = globalThis, H = P.trustedTypes, V = H ? H.createPolicy("lit-html", { createHTML: (r) => r }) : void 0, st = "$lit$", _ = `lit$${Math.random().toFixed(9).slice(2)}$`, it = "?" + _, lt = `<${it}>`, y = document, U = () => y.createComment(""), O = (r) => r === null || typeof r != "object" && typeof r != "function", I = Array.isArray, ct = (r) => I(r) || typeof (r == null ? void 0 : r[Symbol.iterator]) == "function", D = `[
|
|
7
|
+
\f\r]`, w = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, J = /-->/g, W = />/g, g = RegExp(`>|${D}(?:([^\\s"'>=/]+)(${D}*=${D}*(?:[^
|
|
8
|
+
\f\r"'\`<>=]|("|')|))|$)`, "g"), Z = /'/g, K = /"/g, rt = /^(?:script|style|textarea|title)$/i, dt = (r) => (t, ...e) => ({ _$litType$: r, strings: t, values: e }), Lt = dt(1), E = Symbol.for("lit-noChange"), d = Symbol.for("lit-nothing"), G = /* @__PURE__ */ new WeakMap(), m = y.createTreeWalker(y, 129);
|
|
9
9
|
function nt(r, t) {
|
|
10
10
|
if (!I(r) || !r.hasOwnProperty("raw")) throw Error("invalid template strings array");
|
|
11
11
|
return V !== void 0 ? V.createHTML(t) : t;
|
|
@@ -16,9 +16,9 @@ const pt = (r, t) => {
|
|
|
16
16
|
for (let a = 0; a < e; a++) {
|
|
17
17
|
const h = r[a];
|
|
18
18
|
let c, p, l = -1, u = 0;
|
|
19
|
-
for (; u < h.length && (o.lastIndex = u, p = o.exec(h), p !== null); ) u = o.lastIndex, o === w ? p[1] === "!--" ? o = J : p[1] !== void 0 ? o = W : p[2] !== void 0 ? (rt.test(p[2]) && (i = RegExp("</" + p[2], "g")), o =
|
|
20
|
-
const $ = o ===
|
|
21
|
-
n += o === w ? h + lt : l >= 0 ? (s.push(c), h.slice(0, l) + st + h.slice(l) +
|
|
19
|
+
for (; u < h.length && (o.lastIndex = u, p = o.exec(h), p !== null); ) u = o.lastIndex, o === w ? p[1] === "!--" ? o = J : p[1] !== void 0 ? o = W : p[2] !== void 0 ? (rt.test(p[2]) && (i = RegExp("</" + p[2], "g")), o = g) : p[3] !== void 0 && (o = g) : o === g ? p[0] === ">" ? (o = i ?? w, l = -1) : p[1] === void 0 ? l = -2 : (l = o.lastIndex - p[2].length, c = p[1], o = p[3] === void 0 ? g : p[3] === '"' ? K : Z) : o === K || o === Z ? o = g : o === J || o === W ? o = w : (o = g, i = void 0);
|
|
20
|
+
const $ = o === g && r[a + 1].startsWith("/>") ? " " : "";
|
|
21
|
+
n += o === w ? h + lt : l >= 0 ? (s.push(c), h.slice(0, l) + st + h.slice(l) + _ + $) : h + _ + (l === -2 ? a : $);
|
|
22
22
|
}
|
|
23
23
|
return [nt(r, n + (r[e] || "<?>") + (t === 2 ? "</svg>" : t === 3 ? "</math>" : "")), s];
|
|
24
24
|
};
|
|
@@ -28,28 +28,28 @@ class M {
|
|
|
28
28
|
this.parts = [];
|
|
29
29
|
let n = 0, o = 0;
|
|
30
30
|
const a = t.length - 1, h = this.parts, [c, p] = pt(t, e);
|
|
31
|
-
if (this.el = M.createElement(c, s),
|
|
31
|
+
if (this.el = M.createElement(c, s), m.currentNode = this.el.content, e === 2 || e === 3) {
|
|
32
32
|
const l = this.el.content.firstChild;
|
|
33
33
|
l.replaceWith(...l.childNodes);
|
|
34
34
|
}
|
|
35
|
-
for (; (i =
|
|
35
|
+
for (; (i = m.nextNode()) !== null && h.length < a; ) {
|
|
36
36
|
if (i.nodeType === 1) {
|
|
37
37
|
if (i.hasAttributes()) for (const l of i.getAttributeNames()) if (l.endsWith(st)) {
|
|
38
|
-
const u = p[o++], $ = i.getAttribute(l).split(
|
|
39
|
-
h.push({ type: 1, index: n, name: T[2], strings: $, ctor: T[1] === "." ? $t : T[1] === "?" ?
|
|
40
|
-
} else l.startsWith(
|
|
38
|
+
const u = p[o++], $ = i.getAttribute(l).split(_), T = /([.?@])?(.*)/.exec(u);
|
|
39
|
+
h.push({ type: 1, index: n, name: T[2], strings: $, ctor: T[1] === "." ? $t : T[1] === "?" ? _t : T[1] === "@" ? ft : R }), i.removeAttribute(l);
|
|
40
|
+
} else l.startsWith(_) && (h.push({ type: 6, index: n }), i.removeAttribute(l));
|
|
41
41
|
if (rt.test(i.tagName)) {
|
|
42
|
-
const l = i.textContent.split(
|
|
42
|
+
const l = i.textContent.split(_), u = l.length - 1;
|
|
43
43
|
if (u > 0) {
|
|
44
44
|
i.textContent = H ? H.emptyScript : "";
|
|
45
|
-
for (let $ = 0; $ < u; $++) i.append(l[$], U()),
|
|
45
|
+
for (let $ = 0; $ < u; $++) i.append(l[$], U()), m.nextNode(), h.push({ type: 2, index: ++n });
|
|
46
46
|
i.append(l[u], U());
|
|
47
47
|
}
|
|
48
48
|
}
|
|
49
49
|
} else if (i.nodeType === 8) if (i.data === it) h.push({ type: 2, index: n });
|
|
50
50
|
else {
|
|
51
51
|
let l = -1;
|
|
52
|
-
for (; (l = i.data.indexOf(
|
|
52
|
+
for (; (l = i.data.indexOf(_, l + 1)) !== -1; ) h.push({ type: 7, index: n }), l += _.length - 1;
|
|
53
53
|
}
|
|
54
54
|
n++;
|
|
55
55
|
}
|
|
@@ -78,16 +78,16 @@ class ut {
|
|
|
78
78
|
}
|
|
79
79
|
u(t) {
|
|
80
80
|
const { el: { content: e }, parts: s } = this._$AD, i = ((t == null ? void 0 : t.creationScope) ?? y).importNode(e, !0);
|
|
81
|
-
|
|
82
|
-
let n =
|
|
81
|
+
m.currentNode = i;
|
|
82
|
+
let n = m.nextNode(), o = 0, a = 0, h = s[0];
|
|
83
83
|
for (; h !== void 0; ) {
|
|
84
84
|
if (o === h.index) {
|
|
85
85
|
let c;
|
|
86
|
-
h.type === 2 ? c = new b(n, n.nextSibling, this, t) : h.type === 1 ? c = new h.ctor(n, h.name, h.strings, this, t) : h.type === 6 && (c = new
|
|
86
|
+
h.type === 2 ? c = new b(n, n.nextSibling, this, t) : h.type === 1 ? c = new h.ctor(n, h.name, h.strings, this, t) : h.type === 6 && (c = new gt(n, this, t)), this._$AV.push(c), h = s[++a];
|
|
87
87
|
}
|
|
88
|
-
o !== (h == null ? void 0 : h.index) && (n =
|
|
88
|
+
o !== (h == null ? void 0 : h.index) && (n = m.nextNode(), o++);
|
|
89
89
|
}
|
|
90
|
-
return
|
|
90
|
+
return m.currentNode = y, i;
|
|
91
91
|
}
|
|
92
92
|
p(t) {
|
|
93
93
|
let e = 0;
|
|
@@ -147,7 +147,7 @@ class b {
|
|
|
147
147
|
}
|
|
148
148
|
_$AR(t = this._$AA.nextSibling, e) {
|
|
149
149
|
var s;
|
|
150
|
-
for ((s = this._$AP) == null ? void 0 : s.call(this, !1, !0, e); t
|
|
150
|
+
for ((s = this._$AP) == null ? void 0 : s.call(this, !1, !0, e); t !== this._$AB; ) {
|
|
151
151
|
const i = t.nextSibling;
|
|
152
152
|
t.remove(), t = i;
|
|
153
153
|
}
|
|
@@ -190,7 +190,7 @@ class $t extends R {
|
|
|
190
190
|
this.element[this.name] = t === d ? void 0 : t;
|
|
191
191
|
}
|
|
192
192
|
}
|
|
193
|
-
class
|
|
193
|
+
class _t extends R {
|
|
194
194
|
constructor() {
|
|
195
195
|
super(...arguments), this.type = 4;
|
|
196
196
|
}
|
|
@@ -198,7 +198,7 @@ class ft extends R {
|
|
|
198
198
|
this.element.toggleAttribute(this.name, !!t && t !== d);
|
|
199
199
|
}
|
|
200
200
|
}
|
|
201
|
-
class
|
|
201
|
+
class ft extends R {
|
|
202
202
|
constructor(t, e, s, i, n) {
|
|
203
203
|
super(t, e, s, i, n), this.type = 5;
|
|
204
204
|
}
|
|
@@ -212,7 +212,7 @@ class _t extends R {
|
|
|
212
212
|
typeof this._$AH == "function" ? this._$AH.call(((e = this.options) == null ? void 0 : e.host) ?? this.element, t) : this._$AH.handleEvent(t);
|
|
213
213
|
}
|
|
214
214
|
}
|
|
215
|
-
class
|
|
215
|
+
class gt {
|
|
216
216
|
constructor(t, e, s) {
|
|
217
217
|
this.element = t, this.type = 6, this._$AN = void 0, this._$AM = e, this.options = s;
|
|
218
218
|
}
|
|
@@ -224,8 +224,8 @@ class mt {
|
|
|
224
224
|
}
|
|
225
225
|
}
|
|
226
226
|
const jt = { I: b }, L = P.litHtmlPolyfillSupport;
|
|
227
|
-
L == null || L(M, b), (P.litHtmlVersions ?? (P.litHtmlVersions = [])).push("3.3.
|
|
228
|
-
const
|
|
227
|
+
L == null || L(M, b), (P.litHtmlVersions ?? (P.litHtmlVersions = [])).push("3.3.1");
|
|
228
|
+
const mt = (r, t, e) => {
|
|
229
229
|
const s = (e == null ? void 0 : e.renderBefore) ?? t;
|
|
230
230
|
let i = s._$litPart$;
|
|
231
231
|
if (i === void 0) {
|
|
@@ -240,9 +240,9 @@ const gt = (r, t, e) => {
|
|
|
240
240
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
241
241
|
*/
|
|
242
242
|
const zt = (r) => (t, e) => {
|
|
243
|
-
e !== void 0 ? e.addInitializer(() => {
|
|
243
|
+
e !== void 0 ? e.addInitializer((() => {
|
|
244
244
|
customElements.define(r, t);
|
|
245
|
-
}) : customElements.define(r, t);
|
|
245
|
+
})) : customElements.define(r, t);
|
|
246
246
|
};
|
|
247
247
|
/**
|
|
248
248
|
* @license
|
|
@@ -269,7 +269,7 @@ let At = class {
|
|
|
269
269
|
}
|
|
270
270
|
};
|
|
271
271
|
const yt = (r) => new At(typeof r == "string" ? r : r + "", void 0, ot), vt = (r, t) => {
|
|
272
|
-
if (B) r.adoptedStyleSheets = t.map((e) => e instanceof CSSStyleSheet ? e : e.styleSheet);
|
|
272
|
+
if (B) r.adoptedStyleSheets = t.map(((e) => e instanceof CSSStyleSheet ? e : e.styleSheet));
|
|
273
273
|
else for (const e of t) {
|
|
274
274
|
const s = document.createElement("style"), i = k.litNonce;
|
|
275
275
|
i !== void 0 && s.setAttribute("nonce", i), s.textContent = e.cssText, r.appendChild(s);
|
|
@@ -284,7 +284,7 @@ const yt = (r) => new At(typeof r == "string" ? r : r + "", void 0, ot), vt = (r
|
|
|
284
284
|
* Copyright 2017 Google LLC
|
|
285
285
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
286
286
|
*/
|
|
287
|
-
const { is: Et, defineProperty: St, getOwnPropertyDescriptor: bt, getOwnPropertyNames: wt, getOwnPropertySymbols: Pt, getPrototypeOf: Ct } = Object,
|
|
287
|
+
const { is: Et, defineProperty: St, getOwnPropertyDescriptor: bt, getOwnPropertyNames: wt, getOwnPropertySymbols: Pt, getPrototypeOf: Ct } = Object, f = globalThis, Y = f.trustedTypes, xt = Y ? Y.emptyScript : "", j = f.reactiveElementPolyfillSupport, C = (r, t) => r, N = { toAttribute(r, t) {
|
|
288
288
|
switch (t) {
|
|
289
289
|
case Boolean:
|
|
290
290
|
r = r ? xt : null;
|
|
@@ -313,7 +313,7 @@ const { is: Et, defineProperty: St, getOwnPropertyDescriptor: bt, getOwnProperty
|
|
|
313
313
|
}
|
|
314
314
|
return e;
|
|
315
315
|
} }, F = (r, t) => !Et(r, t), tt = { attribute: !0, type: String, converter: N, reflect: !1, useDefault: !1, hasChanged: F };
|
|
316
|
-
Symbol.metadata ?? (Symbol.metadata = Symbol("metadata")),
|
|
316
|
+
Symbol.metadata ?? (Symbol.metadata = Symbol("metadata")), f.litPropertyMetadata ?? (f.litPropertyMetadata = /* @__PURE__ */ new WeakMap());
|
|
317
317
|
class v extends HTMLElement {
|
|
318
318
|
static addInitializer(t) {
|
|
319
319
|
this._$Ei(), (this.l ?? (this.l = [])).push(t);
|
|
@@ -381,7 +381,7 @@ class v extends HTMLElement {
|
|
|
381
381
|
}
|
|
382
382
|
_$Ev() {
|
|
383
383
|
var t;
|
|
384
|
-
this._$ES = new Promise((e) => this.enableUpdating = e), this._$AL = /* @__PURE__ */ new Map(), this._$E_(), this.requestUpdate(), (t = this.constructor.l) == null || t.forEach((e) => e(this));
|
|
384
|
+
this._$ES = new Promise(((e) => this.enableUpdating = e)), this._$AL = /* @__PURE__ */ new Map(), this._$E_(), this.requestUpdate(), (t = this.constructor.l) == null || t.forEach(((e) => e(this)));
|
|
385
385
|
}
|
|
386
386
|
addController(t) {
|
|
387
387
|
var e;
|
|
@@ -402,19 +402,19 @@ class v extends HTMLElement {
|
|
|
402
402
|
}
|
|
403
403
|
connectedCallback() {
|
|
404
404
|
var t;
|
|
405
|
-
this.renderRoot ?? (this.renderRoot = this.createRenderRoot()), this.enableUpdating(!0), (t = this._$EO) == null || t.forEach((e) => {
|
|
405
|
+
this.renderRoot ?? (this.renderRoot = this.createRenderRoot()), this.enableUpdating(!0), (t = this._$EO) == null || t.forEach(((e) => {
|
|
406
406
|
var s;
|
|
407
407
|
return (s = e.hostConnected) == null ? void 0 : s.call(e);
|
|
408
|
-
});
|
|
408
|
+
}));
|
|
409
409
|
}
|
|
410
410
|
enableUpdating(t) {
|
|
411
411
|
}
|
|
412
412
|
disconnectedCallback() {
|
|
413
413
|
var t;
|
|
414
|
-
(t = this._$EO) == null || t.forEach((e) => {
|
|
414
|
+
(t = this._$EO) == null || t.forEach(((e) => {
|
|
415
415
|
var s;
|
|
416
416
|
return (s = e.hostDisconnected) == null ? void 0 : s.call(e);
|
|
417
|
-
});
|
|
417
|
+
}));
|
|
418
418
|
}
|
|
419
419
|
attributeChangedCallback(t, e, s) {
|
|
420
420
|
this._$AK(t, s);
|
|
@@ -432,7 +432,9 @@ class v extends HTMLElement {
|
|
|
432
432
|
const s = this.constructor, i = s._$Eh.get(t);
|
|
433
433
|
if (i !== void 0 && this._$Em !== i) {
|
|
434
434
|
const a = s.getPropertyOptions(i), h = typeof a.converter == "function" ? { fromAttribute: a.converter } : ((n = a.converter) == null ? void 0 : n.fromAttribute) !== void 0 ? a.converter : N;
|
|
435
|
-
this._$Em = i
|
|
435
|
+
this._$Em = i;
|
|
436
|
+
const c = h.fromAttribute(e, a.type);
|
|
437
|
+
this[i] = c ?? ((o = this._$Ej) == null ? void 0 : o.get(i)) ?? c, this._$Em = null;
|
|
436
438
|
}
|
|
437
439
|
}
|
|
438
440
|
requestUpdate(t, e, s) {
|
|
@@ -477,10 +479,10 @@ class v extends HTMLElement {
|
|
|
477
479
|
let t = !1;
|
|
478
480
|
const e = this._$AL;
|
|
479
481
|
try {
|
|
480
|
-
t = this.shouldUpdate(e), t ? (this.willUpdate(e), (s = this._$EO) == null || s.forEach((i) => {
|
|
482
|
+
t = this.shouldUpdate(e), t ? (this.willUpdate(e), (s = this._$EO) == null || s.forEach(((i) => {
|
|
481
483
|
var n;
|
|
482
484
|
return (n = i.hostUpdate) == null ? void 0 : n.call(i);
|
|
483
|
-
}), this.update(e)) : this._$EM();
|
|
485
|
+
})), this.update(e)) : this._$EM();
|
|
484
486
|
} catch (i) {
|
|
485
487
|
throw t = !1, this._$EM(), i;
|
|
486
488
|
}
|
|
@@ -490,10 +492,10 @@ class v extends HTMLElement {
|
|
|
490
492
|
}
|
|
491
493
|
_$AE(t) {
|
|
492
494
|
var e;
|
|
493
|
-
(e = this._$EO) == null || e.forEach((s) => {
|
|
495
|
+
(e = this._$EO) == null || e.forEach(((s) => {
|
|
494
496
|
var i;
|
|
495
497
|
return (i = s.hostUpdated) == null ? void 0 : i.call(s);
|
|
496
|
-
}), this.hasUpdated || (this.hasUpdated = !0, this.firstUpdated(t)), this.updated(t);
|
|
498
|
+
})), this.hasUpdated || (this.hasUpdated = !0, this.firstUpdated(t)), this.updated(t);
|
|
497
499
|
}
|
|
498
500
|
_$EM() {
|
|
499
501
|
this._$AL = /* @__PURE__ */ new Map(), this.isUpdatePending = !1;
|
|
@@ -508,14 +510,14 @@ class v extends HTMLElement {
|
|
|
508
510
|
return !0;
|
|
509
511
|
}
|
|
510
512
|
update(t) {
|
|
511
|
-
this._$Eq && (this._$Eq = this._$Eq.forEach((e) => this._$ET(e, this[e]))), this._$EM();
|
|
513
|
+
this._$Eq && (this._$Eq = this._$Eq.forEach(((e) => this._$ET(e, this[e])))), this._$EM();
|
|
512
514
|
}
|
|
513
515
|
updated(t) {
|
|
514
516
|
}
|
|
515
517
|
firstUpdated(t) {
|
|
516
518
|
}
|
|
517
519
|
}
|
|
518
|
-
v.elementStyles = [], v.shadowRootOptions = { mode: "open" }, v[C("elementProperties")] = /* @__PURE__ */ new Map(), v[C("finalized")] = /* @__PURE__ */ new Map(), j == null || j({ ReactiveElement: v }), (
|
|
520
|
+
v.elementStyles = [], v.shadowRootOptions = { mode: "open" }, v[C("elementProperties")] = /* @__PURE__ */ new Map(), v[C("finalized")] = /* @__PURE__ */ new Map(), j == null || j({ ReactiveElement: v }), (f.reactiveElementVersions ?? (f.reactiveElementVersions = [])).push("2.1.1");
|
|
519
521
|
/**
|
|
520
522
|
* @license
|
|
521
523
|
* Copyright 2017 Google LLC
|
|
@@ -565,7 +567,7 @@ class x extends v {
|
|
|
565
567
|
}
|
|
566
568
|
update(t) {
|
|
567
569
|
const e = this.render();
|
|
568
|
-
this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(t), this._$Do =
|
|
570
|
+
this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(t), this._$Do = mt(e, this.renderRoot, this.renderOptions);
|
|
569
571
|
}
|
|
570
572
|
connectedCallback() {
|
|
571
573
|
var t;
|
|
@@ -583,95 +585,8 @@ var et;
|
|
|
583
585
|
x._$litElement$ = !0, x.finalized = !0, (et = A.litElementHydrateSupport) == null || et.call(A, { LitElement: x });
|
|
584
586
|
const z = A.litElementPolyfillSupport;
|
|
585
587
|
z == null || z({ LitElement: x });
|
|
586
|
-
(A.litElementVersions ?? (A.litElementVersions = [])).push("4.2.
|
|
587
|
-
const Mt = {
|
|
588
|
-
hi: "Hei!"
|
|
589
|
-
}, Tt = {
|
|
590
|
-
from: "Fra",
|
|
591
|
-
to: "Til"
|
|
592
|
-
}, kt = {
|
|
593
|
-
buttonAltText: "Åpne kalender",
|
|
594
|
-
deleteDate: "Fjern dato"
|
|
595
|
-
}, Ht = {
|
|
596
|
-
month: "Måned",
|
|
597
|
-
year: "År",
|
|
598
|
-
days: [
|
|
599
|
-
"Mandag",
|
|
600
|
-
"Tirsdag",
|
|
601
|
-
"Onsdag",
|
|
602
|
-
"Torsdag",
|
|
603
|
-
"Fredag",
|
|
604
|
-
"Lørdag",
|
|
605
|
-
"Søndag"
|
|
606
|
-
],
|
|
607
|
-
daysShort: [
|
|
608
|
-
"Man",
|
|
609
|
-
"Tir",
|
|
610
|
-
"Ons",
|
|
611
|
-
"Tor",
|
|
612
|
-
"Fre",
|
|
613
|
-
"Lør",
|
|
614
|
-
"Søn"
|
|
615
|
-
],
|
|
616
|
-
months: [
|
|
617
|
-
"Januar",
|
|
618
|
-
"Februar",
|
|
619
|
-
"Mars",
|
|
620
|
-
"April",
|
|
621
|
-
"Mai",
|
|
622
|
-
"Juni",
|
|
623
|
-
"Juli",
|
|
624
|
-
"August",
|
|
625
|
-
"September",
|
|
626
|
-
"Oktober",
|
|
627
|
-
"November",
|
|
628
|
-
"Desember"
|
|
629
|
-
],
|
|
630
|
-
monthsShort: [
|
|
631
|
-
"Jan",
|
|
632
|
-
"Feb",
|
|
633
|
-
"Mar",
|
|
634
|
-
"Apr",
|
|
635
|
-
"Mai",
|
|
636
|
-
"Jun",
|
|
637
|
-
"Jul",
|
|
638
|
-
"Aug",
|
|
639
|
-
"Sep",
|
|
640
|
-
"Okt",
|
|
641
|
-
"Nov",
|
|
642
|
-
"Des"
|
|
643
|
-
],
|
|
644
|
-
week: "Uke",
|
|
645
|
-
prevMonth: "Forrige måned",
|
|
646
|
-
nextMonth: "Neste måned"
|
|
647
|
-
}, Nt = {
|
|
648
|
-
search: {
|
|
649
|
-
placeholder: "Søk…"
|
|
650
|
-
},
|
|
651
|
-
labels: {
|
|
652
|
-
optional: "Valgfritt",
|
|
653
|
-
required: "Må fylles ut"
|
|
654
|
-
},
|
|
655
|
-
messages: {
|
|
656
|
-
required: "Dette feltet er påkrevd",
|
|
657
|
-
invalid: "Ugyldig verdi",
|
|
658
|
-
invalidPattern: "Ugyldig format",
|
|
659
|
-
tooShort: "For kort",
|
|
660
|
-
tooLong: "For lang",
|
|
661
|
-
rangeUnderflow: "For lav verdi",
|
|
662
|
-
rangeOverflow: "For høy verdi",
|
|
663
|
-
rangeUnderflowMin: "Verdien må være større enn eller lik {min}.",
|
|
664
|
-
rangeOverflowMax: "Verdien må være mindre enn eller lik {max}.",
|
|
665
|
-
dateUnderflow: "For tidlig dato",
|
|
666
|
-
dateOverflow: "For sen dato"
|
|
667
|
-
},
|
|
668
|
-
helptext: {
|
|
669
|
-
helptextDropdownButton: "Les mer"
|
|
670
|
-
},
|
|
671
|
-
date: {
|
|
672
|
-
multiple: "Her kan du velge flere datoer. Trykk komma eller enter når du har skrevet inn en dato."
|
|
673
|
-
}
|
|
674
|
-
}, Rt = {
|
|
588
|
+
(A.litElementVersions ?? (A.litElementVersions = [])).push("4.2.1");
|
|
589
|
+
const Mt = { hi: "Hei!" }, Tt = { from: "Fra", to: "Til" }, kt = { buttonAltText: "Åpne kalender", deleteDate: "Fjern dato" }, Ht = { month: "Måned", year: "År", days: ["Mandag", "Tirsdag", "Onsdag", "Torsdag", "Fredag", "Lørdag", "Søndag"], daysShort: ["Man", "Tir", "Ons", "Tor", "Fre", "Lør", "Søn"], months: ["Januar", "Februar", "Mars", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Desember"], monthsShort: ["Jan", "Feb", "Mar", "Apr", "Mai", "Jun", "Jul", "Aug", "Sep", "Okt", "Nov", "Des"], week: "Uke", prevMonth: "Forrige måned", nextMonth: "Neste måned" }, Nt = { search: { placeholder: "Søk…" }, labels: { optional: "Valgfritt", required: "Må fylles ut" }, messages: { required: "Dette feltet er påkrevd", invalid: "Ugyldig verdi", invalidPattern: "Ugyldig format", tooShort: "For kort", tooLong: "For lang", rangeUnderflow: "For lav verdi", rangeOverflow: "For høy verdi", rangeUnderflowMin: "Verdien må være større enn eller lik {min}.", rangeOverflowMax: "Verdien må være mindre enn eller lik {max}.", dateUnderflow: "For tidlig dato", dateOverflow: "For sen dato" }, helptext: { helptextDropdownButton: "Les mer" }, date: { multiple: "Her kan du velge flere datoer. Trykk komma eller enter når du har skrevet inn en dato." } }, Rt = {
|
|
675
590
|
example: Mt,
|
|
676
591
|
generic: Tt,
|
|
677
592
|
calendar: kt,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const i=require("./element-
|
|
1
|
+
"use strict";const i=require("./element-CJ_QKaki.cjs");var h=Object.defineProperty,u=Object.getOwnPropertyDescriptor,a=(n,e,l,t)=>{for(var s=t>1?void 0:t?u(e,l):e,r=n.length-1,d;r>=0;r--)(d=n[r])&&(s=(t?d(e,l,s):d(s))||s);return t&&s&&h(e,l,s),s};exports.PktHeading=class extends i.PktShadowElement{constructor(){super(...arguments),this.size=void 0,this.level=2,this.visuallyHidden=!1,this.align=void 0}connectedCallback(){super.connectedCallback(),this.setAttribute("role","heading"),this.setAttribute("aria-level",String(this.level)),this.updateHostClasses()}attributeChangedCallback(e,l,t){super.attributeChangedCallback(e,l,t),e==="level"&&t&&this.setLevel(Number(t)),e==="visuallyHidden"&&(this.visuallyHidden=t!==null&&t!=="false"),(e==="size"||e==="visuallyHidden"||e==="align")&&this.updateHostClasses()}updated(e){super.updated(e),e.has("level")&&(this.setLevel(this.level),this.hasAttribute("size")||(this.size=this.defaultSizeForLevel)),!this.hasAttribute("size")&&(e.has("level")||this.size===void 0)&&(this.size=this.defaultSizeForLevel),(e.has("size")||e.has("visuallyHidden")||e.has("align"))&&this.updateHostClasses()}setLevel(e){e>=1&&e<=6?(this.level=e,this.setAttribute("aria-level",String(e))):console.warn(`Invalid heading level: ${e}. Must be between 1 and 6.`)}get defaultSizeForLevel(){switch(this.level){case 1:return"xlarge";case 2:return"large";case 3:return"medium";case 4:return"small";case 5:return"xsmall";case 6:return"xsmall";default:return"medium"}}updateHostClasses(){this.classList.remove("pkt-heading","pkt-heading--xsmall","pkt-heading--small","pkt-heading--medium","pkt-heading--large","pkt-heading--xlarge","pkt-sr-only","pkt-heading--start","pkt-heading--center","pkt-heading--end"),this.classList.add("pkt-heading"),this.size&&this.classList.add(`pkt-heading--${this.size}`),this.visuallyHidden&&this.classList.add("pkt-sr-only"),this.align&&this.classList.add(`pkt-heading--${this.align}`)}render(){return i.x`<slot></slot>`}};a([i.n({type:String,reflect:!0})],exports.PktHeading.prototype,"size",2);a([i.n({type:Number,reflect:!0})],exports.PktHeading.prototype,"level",2);a([i.n({type:Boolean,reflect:!0})],exports.PktHeading.prototype,"visuallyHidden",2);a([i.n({type:String,reflect:!0})],exports.PktHeading.prototype,"align",2);exports.PktHeading=a([i.t("pkt-heading")],exports.PktHeading);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { b as u, x as p, n as d, a as o } from "./element-
|
|
1
|
+
import { b as u, x as p, n as d, a as o } from "./element-CRDRygXu.js";
|
|
2
2
|
var g = Object.defineProperty, v = Object.getOwnPropertyDescriptor, a = (e, i, t, r) => {
|
|
3
3
|
for (var s = r > 1 ? void 0 : r ? v(i, t) : i, h = e.length - 1, n; h >= 0; h--)
|
|
4
4
|
(n = e[h]) && (s = (r ? n(i, t, s) : n(s)) || s);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const t=require("./element-
|
|
1
|
+
"use strict";const t=require("./element-CJ_QKaki.cjs"),x=require("./ref-BFa5Utho.cjs"),h=require("./icon-BGuizDwk.cjs"),u=require("./class-map-C_erArZz.cjs"),a=require("./state-DSjcvzDN.cjs"),c=require("./stringutils-CkVRq4jP.cjs"),d=require("./input-wrapper-EoSAbU-U.cjs"),k=require("./pkt-slot-controller-BzddBp7z.cjs");var w=Object.defineProperty,_=Object.getOwnPropertyDescriptor,n=(o,p,r,l)=>{for(var e=l>1?void 0:l?_(p,r):p,s=o.length-1,i;s>=0;s--)(i=o[s])&&(e=(l?i(p,r,e):i(e))||e);return l&&e&&w(p,r,e),e};exports.PktHelptext=class extends t.PktElement{constructor(){super(),this.defaultSlot=x.e(),this.forId=c.uuidish(),this.helptext="",this.helptextDropdown="",this.helptextDropdownButton=d.specs.props.helptextDropdownButton.default,this.isHelpTextOpen=!1,this.filledSlots=new Set,this.slotController=new k.PktSlotController(this,this.defaultSlot)}updateSlots(p){this.filledSlots=new Set(p)}render(){const p=()=>{const s=!this.isHelpTextOpen;this.isHelpTextOpen=s,this.dispatchEvent(new CustomEvent("toggleHelpText",{bubbles:!0,detail:{isOpen:s}}))},r=u.e({"pkt-inputwrapper__helptext-container":!0,"pkt-inputwrapper__has-helptext":this.helptext||this.helptextDropdown||this.filledSlots.size>0}),l=()=>this.helptextDropdown?t.x`<div class="pkt-inputwrapper__helptext-expandable">
|
|
2
2
|
<button
|
|
3
3
|
class="pkt-link pkt-link--icon-right pkt-btn pkt-btn--small pkt-btn--tertiary pkt-btn--icon-right"
|
|
4
4
|
type="button"
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { P as c, x as a, E as f, n as r, a as w } from "./element-
|
|
2
|
-
import { e as _, n as m } from "./ref-
|
|
3
|
-
import { o as x } from "./icon-
|
|
4
|
-
import { e as d } from "./class-map-
|
|
5
|
-
import { r as u } from "./state-
|
|
1
|
+
import { P as c, x as a, E as f, n as r, a as w } from "./element-CRDRygXu.js";
|
|
2
|
+
import { e as _, n as m } from "./ref-Xa5dbh--.js";
|
|
3
|
+
import { o as x } from "./icon-1dy7UZcu.js";
|
|
4
|
+
import { e as d } from "./class-map-wy7PUk0P.js";
|
|
5
|
+
import { r as u } from "./state-DS_kr2Fy.js";
|
|
6
6
|
import { u as k } from "./stringutils-DJjRa8dG.js";
|
|
7
|
-
import { s as v } from "./input-wrapper-
|
|
7
|
+
import { s as v } from "./input-wrapper-CDgenrYA.js";
|
|
8
8
|
import { P as b } from "./pkt-slot-controller-BPGj-LC5.js";
|
|
9
9
|
var S = Object.defineProperty, D = Object.getOwnPropertyDescriptor, p = (o, s, l, n) => {
|
|
10
10
|
for (var t = n > 1 ? void 0 : n ? D(s, l) : s, i = o.length - 1, h; i >= 0; i--)
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { E as w, T as y, P as m, x as P, n as d, a as k } from "./element-CRDRygXu.js";
|
|
2
|
+
import { e as v, i as _, t as I } from "./directive-oAbCiebi.js";
|
|
3
|
+
/**
|
|
4
|
+
* @license
|
|
5
|
+
* Copyright 2017 Google LLC
|
|
6
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
7
|
+
*/
|
|
8
|
+
class a extends _ {
|
|
9
|
+
constructor(t) {
|
|
10
|
+
if (super(t), this.it = w, t.type !== I.CHILD) throw Error(this.constructor.directiveName + "() can only be used in child bindings");
|
|
11
|
+
}
|
|
12
|
+
render(t) {
|
|
13
|
+
if (t === w || t == null) return this._t = void 0, this.it = t;
|
|
14
|
+
if (t === y) return t;
|
|
15
|
+
if (typeof t != "string") throw Error(this.constructor.directiveName + "() called with a non-string value");
|
|
16
|
+
if (t === this.it) return this._t;
|
|
17
|
+
this.it = t;
|
|
18
|
+
const o = [t];
|
|
19
|
+
return o.raw = o, this._t = { _$litType$: this.constructor.resultType, strings: o, values: [] };
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
a.directiveName = "unsafeHTML", a.resultType = 1;
|
|
23
|
+
const F = v(a);
|
|
24
|
+
/**
|
|
25
|
+
* @license
|
|
26
|
+
* Copyright 2017 Google LLC
|
|
27
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
28
|
+
*/
|
|
29
|
+
class u extends a {
|
|
30
|
+
}
|
|
31
|
+
u.directiveName = "unsafeSVG", u.resultType = 2;
|
|
32
|
+
const g = v(u);
|
|
33
|
+
var b = Object.defineProperty, S = Object.getOwnPropertyDescriptor, r = (e, t, o, i) => {
|
|
34
|
+
for (var s = i > 1 ? void 0 : i ? S(t, o) : t, p = e.length - 1, l; p >= 0; p--)
|
|
35
|
+
(l = e[p]) && (s = (i ? l(t, o, s) : l(s)) || s);
|
|
36
|
+
return i && s && b(t, o, s), s;
|
|
37
|
+
};
|
|
38
|
+
const f = "https://punkt-cdn.oslo.kommune.no/latest/icons/";
|
|
39
|
+
typeof window < "u" && (window.pktFetch = window.pktFetch === void 0 ? fetch : window.pktFetch, window.pktIconPath = window.pktIconPath || f);
|
|
40
|
+
const C = (e) => new Promise((t) => setTimeout(t, e)), c = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"></svg>', h = {}, T = async (e, t) => {
|
|
41
|
+
let o = 0;
|
|
42
|
+
for (; h[t + e + ".svg"] === "fetching" && (o++, !(o > 50)); )
|
|
43
|
+
await C(50);
|
|
44
|
+
const i = typeof Storage < "u" && typeof localStorage < "u";
|
|
45
|
+
return i && localStorage.getItem(t + e + ".svg") ? Promise.resolve(localStorage.getItem(t + e + ".svg")) : typeof window < "u" && typeof window.pktFetch == "function" ? (h[t + e + ".svg"] = "fetching", Promise.resolve(
|
|
46
|
+
window.pktFetch(t + e + ".svg").then((s) => s.ok ? s.text() : (console.error("Missing icon: " + t + e + ".svg"), c)).then((s) => (s !== c && i && localStorage.setItem(t + e + ".svg", s), h[t + e + ".svg"] = "fetched", s))
|
|
47
|
+
)) : Promise.resolve(c);
|
|
48
|
+
};
|
|
49
|
+
let n = class extends m {
|
|
50
|
+
constructor() {
|
|
51
|
+
super(...arguments), this.path = typeof window < "u" ? window.pktIconPath : f, this.name = "", this.icon = g(c), this._updatedProps = [];
|
|
52
|
+
}
|
|
53
|
+
connectedCallback() {
|
|
54
|
+
super.connectedCallback(), this.classList.add("pkt-icon");
|
|
55
|
+
}
|
|
56
|
+
async attributeChangedCallback(e, t, o) {
|
|
57
|
+
super.attributeChangedCallback(e, t, o), (e === "name" || e === "path") && this.getIcon(this.name);
|
|
58
|
+
}
|
|
59
|
+
async updated(e) {
|
|
60
|
+
super.updated(e), (e.has("name") || e.has("path")) && this.getIcon(this.name);
|
|
61
|
+
}
|
|
62
|
+
async getIcon(e = "") {
|
|
63
|
+
this._updatedProps.length > 0 ? (this.path || (this.path = typeof window < "u" ? window.pktIconPath : f), this.icon = g(
|
|
64
|
+
await T(this.name || "", this.path).then((t) => t)
|
|
65
|
+
), this._updatedProps = []) : this._updatedProps.includes(e) || this._updatedProps.push(e);
|
|
66
|
+
}
|
|
67
|
+
render() {
|
|
68
|
+
return P`${this.name && this.icon}`;
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
r([
|
|
72
|
+
d({ type: String, reflect: !1 })
|
|
73
|
+
], n.prototype, "path", 2);
|
|
74
|
+
r([
|
|
75
|
+
d({ type: String, reflect: !0 })
|
|
76
|
+
], n.prototype, "name", 2);
|
|
77
|
+
r([
|
|
78
|
+
d({ type: SVGElement })
|
|
79
|
+
], n.prototype, "icon", 2);
|
|
80
|
+
r([
|
|
81
|
+
d({ type: Array, noAccessor: !0 })
|
|
82
|
+
], n.prototype, "_updatedProps", 2);
|
|
83
|
+
n = r([
|
|
84
|
+
k("pkt-icon")
|
|
85
|
+
], n);
|
|
86
|
+
export {
|
|
87
|
+
n as P,
|
|
88
|
+
F as o
|
|
89
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";const o=require("./element-CJ_QKaki.cjs"),a=require("./directive-C7oCP5Bh.cjs");/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2017 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
5
|
+
*/class d extends a.i{constructor(t){if(super(t),this.it=o.E,t.type!==a.t.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(t){if(t===o.E||t==null)return this._t=void 0,this.it=t;if(t===o.T)return t;if(typeof t!="string")throw Error(this.constructor.directiveName+"() called with a non-string value");if(t===this.it)return this._t;this.it=t;const n=[t];return n.raw=n,this._t={_$litType$:this.constructor.resultType,strings:n,values:[]}}}d.directiveName="unsafeHTML",d.resultType=1;const g=a.e(d);/**
|
|
6
|
+
* @license
|
|
7
|
+
* Copyright 2017 Google LLC
|
|
8
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
9
|
+
*/class h extends d{}h.directiveName="unsafeSVG",h.resultType=2;const w=a.e(h);var v=Object.defineProperty,y=Object.getOwnPropertyDescriptor,r=(e,t,n,i)=>{for(var s=i>1?void 0:i?y(t,n):t,l=e.length-1,p;l>=0;l--)(p=e[l])&&(s=(i?p(t,n,s):p(s))||s);return i&&s&&v(t,n,s),s};const f="https://punkt-cdn.oslo.kommune.no/latest/icons/";typeof window<"u"&&(window.pktFetch=window.pktFetch===void 0?fetch:window.pktFetch,window.pktIconPath=window.pktIconPath||f);const P=e=>new Promise(t=>setTimeout(t,e)),c='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"></svg>',u={},k=async(e,t)=>{let n=0;for(;u[t+e+".svg"]==="fetching"&&(n++,!(n>50));)await P(50);const i=typeof Storage<"u"&&typeof localStorage<"u";return i&&localStorage.getItem(t+e+".svg")?Promise.resolve(localStorage.getItem(t+e+".svg")):typeof window<"u"&&typeof window.pktFetch=="function"?(u[t+e+".svg"]="fetching",Promise.resolve(window.pktFetch(t+e+".svg").then(s=>s.ok?s.text():(console.error("Missing icon: "+t+e+".svg"),c)).then(s=>(s!==c&&i&&localStorage.setItem(t+e+".svg",s),u[t+e+".svg"]="fetched",s)))):Promise.resolve(c)};exports.PktIcon=class extends o.PktElement{constructor(){super(...arguments),this.path=typeof window<"u"?window.pktIconPath:f,this.name="",this.icon=w(c),this._updatedProps=[]}connectedCallback(){super.connectedCallback(),this.classList.add("pkt-icon")}async attributeChangedCallback(t,n,i){super.attributeChangedCallback(t,n,i),(t==="name"||t==="path")&&this.getIcon(this.name)}async updated(t){super.updated(t),(t.has("name")||t.has("path"))&&this.getIcon(this.name)}async getIcon(t=""){this._updatedProps.length>0?(this.path||(this.path=typeof window<"u"?window.pktIconPath:f),this.icon=w(await k(this.name||"",this.path).then(n=>n)),this._updatedProps=[]):this._updatedProps.includes(t)||this._updatedProps.push(t)}render(){return o.x`${this.name&&this.icon}`}};r([o.n({type:String,reflect:!1})],exports.PktIcon.prototype,"path",2);r([o.n({type:String,reflect:!0})],exports.PktIcon.prototype,"name",2);r([o.n({type:SVGElement})],exports.PktIcon.prototype,"icon",2);r([o.n({type:Array,noAccessor:!0})],exports.PktIcon.prototype,"_updatedProps",2);exports.PktIcon=r([o.t("pkt-icon")],exports.PktIcon);exports.o=g;
|
package/dist/index.d.ts
CHANGED
|
@@ -545,7 +545,7 @@ export declare class PktCombobox extends PktInputElement implements IPktCombobox
|
|
|
545
545
|
maxlength: number | null;
|
|
546
546
|
displayValueAs: string;
|
|
547
547
|
tagPlacement: TPktComboboxTagPlacement | null;
|
|
548
|
-
|
|
548
|
+
_options: IPktComboboxOption[];
|
|
549
549
|
private _isOptionsOpen;
|
|
550
550
|
private _value;
|
|
551
551
|
private _userInfoMessage;
|
|
@@ -952,6 +952,7 @@ declare class PktInputElement<T = {}> extends PktElement<Props_2 & T> {
|
|
|
952
952
|
tagText: string | null;
|
|
953
953
|
dataTestid: string;
|
|
954
954
|
touched: boolean;
|
|
955
|
+
_options?: any[];
|
|
955
956
|
constructor();
|
|
956
957
|
protected manageValidity(input: HTMLInputElement): void;
|
|
957
958
|
protected setFormValue(value: string | string[]): void;
|
|
@@ -1050,12 +1051,12 @@ declare class PktListbox extends PktElement implements IPktListbox {
|
|
|
1050
1051
|
updated(changedProperties: PropertyValues): void;
|
|
1051
1052
|
attributeChangedCallback(name: string, _old: string | null, value: string | null): void;
|
|
1052
1053
|
render(): TemplateResult<1>;
|
|
1053
|
-
renderCheckboxOrCheckIcon(option: IPktComboboxOption, index: number): TemplateResult<1
|
|
1054
|
+
renderCheckboxOrCheckIcon(option: IPktComboboxOption, index: number): typeof nothing | TemplateResult<1>;
|
|
1054
1055
|
renderList(): TemplateResult<1>;
|
|
1055
|
-
renderNewOptionBanner(): TemplateResult<1
|
|
1056
|
-
renderMaximumReachedBanner(): TemplateResult<1
|
|
1057
|
-
renderUserMessage(): TemplateResult<1
|
|
1058
|
-
renderSearch(): TemplateResult<1
|
|
1056
|
+
renderNewOptionBanner(): typeof nothing | TemplateResult<1>;
|
|
1057
|
+
renderMaximumReachedBanner(): typeof nothing | TemplateResult<1>;
|
|
1058
|
+
renderUserMessage(): typeof nothing | TemplateResult<1>;
|
|
1059
|
+
renderSearch(): typeof nothing | TemplateResult<1>;
|
|
1059
1060
|
handleSearchInput(e: InputEvent): void;
|
|
1060
1061
|
handleSearchKeydown(e: KeyboardEvent): void;
|
|
1061
1062
|
handleOptionKeydown(e: KeyboardEvent): void;
|
|
@@ -1187,7 +1188,7 @@ export declare class PktSelect extends PktInputElement implements IPktSelect {
|
|
|
1187
1188
|
private helptextSlot;
|
|
1188
1189
|
private _optionsProp;
|
|
1189
1190
|
value: string;
|
|
1190
|
-
|
|
1191
|
+
_options: TSelectOption[];
|
|
1191
1192
|
selectedIndex: number | null;
|
|
1192
1193
|
selectedOptions: HTMLCollectionOf<HTMLOptionElement> | undefined;
|
|
1193
1194
|
get options(): TSelectOption[];
|