@oslokommune/punkt-elements 16.7.1 → 16.7.3
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-_9AiCIvd.cjs +34 -0
- package/dist/{accordionitem-ZlaXvjt5.js → accordionitem-dCfSrxh5.js} +57 -55
- package/dist/alert-BtOk8yRH.cjs +33 -0
- package/dist/{alert-BuAXrnKl.js → alert-DlY2_grU.js} +48 -46
- package/dist/backlink-Ce5Vldop.js +49 -0
- package/dist/backlink-y3dwjKPC.cjs +13 -0
- package/dist/button-B_TXwNzt.cjs +27 -0
- package/dist/{button-DEyvt1LI.js → button-BiY-wlKF.js} +79 -77
- package/dist/calendar-B2pji2zn.cjs +90 -0
- package/dist/{calendar-S63oreVW.js → calendar-DhjQDC4C.js} +689 -687
- package/dist/card-BwMNB5Bb.cjs +87 -0
- package/dist/{card-DDiLfuO4.js → card-CGlmcMSR.js} +99 -97
- package/dist/checkbox-BsJZYA26.js +147 -0
- package/dist/checkbox-CTY8f_qn.cjs +31 -0
- package/dist/{combobox-BmxSecfE.js → combobox-DSB5WOxg.js} +223 -226
- package/dist/{combobox-Hb2V-fPX.cjs → combobox-DbICIgKG.cjs} +4 -4
- package/dist/consent-DkOQpbsg.cjs +11 -0
- package/dist/{consent-iXyx5v6J.js → consent-SNWV_mMU.js} +48 -46
- package/dist/datepicker-BEWl9iz3.cjs +273 -0
- package/dist/{datepicker-CZl7b8Na.js → datepicker-euHyzXnb.js} +341 -329
- package/dist/{heading-CKt7cVn7.js → heading-D2tVS6lS.js} +30 -28
- package/dist/heading-DrzbgDb6.cjs +1 -0
- package/dist/helptext-BKtU4mas.js +82 -0
- package/dist/helptext-DcRC7wW2.cjs +24 -0
- package/dist/icon-CxQcIa5F.js +105 -0
- package/dist/icon-q81vqPK_.cjs +9 -0
- package/dist/input-wrapper-Bs4CRNst.js +181 -0
- package/dist/input-wrapper-Bv9aqqVq.cjs +54 -0
- package/dist/link-C0rl-86s.cjs +7 -0
- package/dist/link-Cdqgl60z.js +55 -0
- package/dist/linkcard-Dimu7Rlx.cjs +13 -0
- package/dist/linkcard-Lbq_UhjZ.js +56 -0
- package/dist/{listbox-BQKDZvZn.js → listbox-Bia4_tvN.js} +131 -129
- package/dist/listbox-La2GZQei.cjs +106 -0
- package/dist/loader-D1ugDXGV.cjs +16 -0
- package/dist/{loader-Ci3CHU8k.js → loader-DyN6RGC5.js} +51 -49
- package/dist/messagebox-BGMVm2t9.js +71 -0
- package/dist/messagebox-M0yIgCz9.cjs +13 -0
- package/dist/modal-CMO1RtIi.cjs +36 -0
- package/dist/{modal-DzGe1g8Z.js → modal-DjPQDE-Z.js} +53 -51
- 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 +3 -4
- package/dist/pkt-backlink.cjs +1 -1
- package/dist/pkt-backlink.js +2 -3
- package/dist/pkt-breadcrumbs.cjs +11 -11
- package/dist/pkt-breadcrumbs.js +30 -28
- package/dist/pkt-button.cjs +1 -1
- package/dist/pkt-button.js +3 -4
- package/dist/pkt-calendar.cjs +1 -1
- package/dist/pkt-calendar.js +2 -3
- package/dist/pkt-card.cjs +1 -1
- package/dist/pkt-card.js +2 -3
- package/dist/pkt-checkbox.cjs +1 -1
- package/dist/pkt-checkbox.js +3 -4
- package/dist/pkt-combobox.cjs +1 -1
- package/dist/pkt-combobox.js +3 -4
- package/dist/pkt-consent.cjs +1 -1
- package/dist/pkt-consent.js +2 -3
- package/dist/pkt-datepicker.cjs +1 -1
- package/dist/pkt-datepicker.js +7 -8
- package/dist/pkt-header.cjs +35 -35
- package/dist/pkt-header.js +224 -218
- package/dist/pkt-heading.cjs +1 -1
- package/dist/pkt-heading.js +3 -4
- package/dist/pkt-helptext.cjs +1 -1
- package/dist/pkt-helptext.js +3 -4
- package/dist/pkt-icon.cjs +1 -1
- package/dist/pkt-icon.js +3 -4
- package/dist/pkt-index.cjs +1 -1
- package/dist/pkt-index.js +26 -26
- package/dist/pkt-input-wrapper.cjs +1 -1
- package/dist/pkt-input-wrapper.js +2 -3
- package/dist/pkt-link.cjs +1 -1
- package/dist/pkt-link.js +2 -3
- package/dist/pkt-linkcard.cjs +1 -1
- package/dist/pkt-linkcard.js +3 -4
- package/dist/pkt-listbox.cjs +1 -1
- package/dist/pkt-listbox.js +3 -4
- package/dist/pkt-loader.cjs +1 -1
- package/dist/pkt-loader.js +3 -4
- package/dist/pkt-messagebox.cjs +1 -1
- package/dist/pkt-messagebox.js +3 -4
- package/dist/pkt-modal.cjs +1 -1
- package/dist/pkt-modal.js +3 -4
- package/dist/pkt-progressbar.cjs +1 -1
- package/dist/pkt-progressbar.js +2 -3
- package/dist/pkt-radiobutton.cjs +1 -1
- package/dist/pkt-radiobutton.js +3 -4
- package/dist/pkt-select.cjs +1 -1
- package/dist/pkt-select.js +3 -4
- 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 +3 -4
- package/dist/pkt-textarea.cjs +1 -1
- package/dist/pkt-textarea.js +3 -4
- package/dist/pkt-textinput.cjs +1 -1
- package/dist/pkt-textinput.js +3 -4
- package/dist/pkt-timepicker.cjs +16 -16
- package/dist/pkt-timepicker.js +91 -89
- package/dist/progressbar-BqlMzkM_.cjs +21 -0
- package/dist/{progressbar-By7e0lEI.js → progressbar-sbHDFC12.js} +88 -88
- package/dist/radiobutton-5ZqVVtTT.cjs +31 -0
- package/dist/{radiobutton-6frNG9J_.js → radiobutton-D8Ai8ETa.js} +44 -42
- package/dist/select-De-n8on9.js +230 -0
- package/dist/select-dTWibR6_.cjs +49 -0
- package/dist/tabitem-B9-jeV97.js +334 -0
- package/dist/tabitem-BnhzqfW3.cjs +65 -0
- package/dist/tag-CbwO8yvD.cjs +27 -0
- package/dist/{tag-BuCpqaks.js → tag-D4FI5t3y.js} +42 -40
- package/dist/textarea-BmLaKzsc.cjs +50 -0
- package/dist/{textarea-Bzuymclz.js → textarea-CMiSJaYL.js} +62 -60
- package/dist/textinput-em9y4yrL.cjs +70 -0
- package/dist/{textinput-9lHjs4ce.js → textinput-r8udK0IX.js} +57 -55
- package/package.json +2 -2
- package/src/components/accordion/accordion.ts +6 -1
- package/src/components/accordion/accordionitem.ts +6 -1
- package/src/components/alert/alert.ts +6 -1
- package/src/components/backlink/backlink.ts +6 -1
- package/src/components/breadcrumbs/breadcrumbs.ts +6 -1
- package/src/components/button/button.ts +6 -1
- package/src/components/calendar/calendar.ts +6 -1
- package/src/components/card/card.ts +6 -1
- package/src/components/checkbox/checkbox.ts +6 -1
- package/src/components/combobox/combobox.ts +6 -1
- package/src/components/consent/consent.ts +6 -1
- package/src/components/datepicker/date-tags.ts +6 -1
- package/src/components/datepicker/datepicker-multiple.ts +6 -1
- package/src/components/datepicker/datepicker-popup.ts +6 -1
- package/src/components/datepicker/datepicker-range.ts +6 -1
- package/src/components/datepicker/datepicker-single.ts +6 -1
- package/src/components/datepicker/datepicker.ts +6 -1
- package/src/components/header/header-service.ts +6 -1
- package/src/components/header/header-user-menu.ts +6 -1
- package/src/components/header/header.ts +6 -1
- package/src/components/heading/heading.ts +6 -1
- package/src/components/helptext/helptext.ts +6 -1
- package/src/components/icon/icon.ts +6 -1
- package/src/components/input-wrapper/input-wrapper.ts +6 -1
- package/src/components/link/link.ts +6 -1
- package/src/components/linkcard/linkcard.ts +6 -1
- package/src/components/listbox/listbox.ts +6 -1
- package/src/components/loader/loader.ts +6 -1
- package/src/components/messagebox/messagebox.ts +6 -1
- package/src/components/modal/modal.ts +6 -1
- package/src/components/progressbar/progressbar.ts +6 -1
- package/src/components/radiobutton/radiobutton.ts +6 -1
- package/src/components/select/select.ts +6 -1
- package/src/components/tabs/tabitem.ts +6 -1
- package/src/components/tabs/tabs.ts +6 -1
- package/src/components/tag/tag.ts +6 -1
- package/src/components/textarea/textarea.ts +6 -1
- package/src/components/textinput/textinput.ts +6 -1
- package/src/components/timepicker/timepicker.ts +6 -1
- package/dist/accordionitem-D1Agl1bB.cjs +0 -34
- package/dist/alert-DFkFNTxh.cjs +0 -33
- package/dist/backlink-EiAXUUZP.cjs +0 -13
- package/dist/backlink-V4DAt17e.js +0 -47
- package/dist/button-DYv5Dg4M.cjs +0 -27
- package/dist/calendar-HIE9nxcc.cjs +0 -90
- package/dist/card-CyeH6l1c.cjs +0 -87
- package/dist/checkbox-BLlwTABj.cjs +0 -31
- package/dist/checkbox-ejBUa5qQ.js +0 -145
- package/dist/consent-ruWAEVXW.cjs +0 -11
- package/dist/datepicker-D2H7U6MS.cjs +0 -273
- package/dist/heading-Cvz8m1xL.cjs +0 -1
- package/dist/helptext-5Mzp65-F.cjs +0 -24
- package/dist/helptext-jIoWRcCF.js +0 -80
- package/dist/icon-BlKA8YuW.js +0 -103
- package/dist/icon-Bqj9oBbl.cjs +0 -9
- package/dist/input-wrapper-B0MkQ0IZ.cjs +0 -54
- package/dist/input-wrapper-B2JpK016.js +0 -179
- package/dist/link-R_lNhViF.cjs +0 -7
- package/dist/link-Z_GizclR.js +0 -53
- package/dist/linkcard-BlQvdB1a.js +0 -54
- package/dist/linkcard-C7HbSLlX.cjs +0 -13
- package/dist/listbox-CGgV9MAe.cjs +0 -106
- package/dist/loader-e2gs_1xz.cjs +0 -16
- package/dist/messagebox-Bf-XMlvW.js +0 -69
- package/dist/messagebox-D67w71VX.cjs +0 -13
- package/dist/modal-CyvEkbfQ.cjs +0 -36
- package/dist/progressbar-DsJ2B9Vm.cjs +0 -21
- package/dist/radiobutton-Bv-BZ1Hw.cjs +0 -31
- package/dist/select-CXZt1nHS.js +0 -228
- package/dist/select-WFhS4Vfp.cjs +0 -49
- package/dist/tabitem-CB8wkKmv.js +0 -332
- package/dist/tabitem-DZpspU4Q.cjs +0 -65
- package/dist/tag-X6xdjR0N.cjs +0 -27
- package/dist/textarea-DoeHJ7HR.cjs +0 -50
- package/dist/textinput-BNsLd26i.cjs +0 -70
|
@@ -1,95 +1,95 @@
|
|
|
1
|
-
import { e as
|
|
2
|
-
import { E as
|
|
1
|
+
import { e as p } from "./class-map-CEnykyO_.js";
|
|
2
|
+
import { E as _, t as $, P as A, A as c, b as d, n as u } from "./element-CPpT3rFQ.js";
|
|
3
3
|
import { r as h } from "./state-C_1EOo3D.js";
|
|
4
|
-
import { e as y, n as
|
|
5
|
-
import { e as x, i as T, t as
|
|
6
|
-
import { u as
|
|
7
|
-
import "./icon-
|
|
4
|
+
import { e as y, n as k } from "./ref-Bg_Swj5w.js";
|
|
5
|
+
import { e as x, i as T, t as C } from "./directive-oAbCiebi.js";
|
|
6
|
+
import { u as b } from "./utils-DznhwRXm.js";
|
|
7
|
+
import "./icon-CxQcIa5F.js";
|
|
8
8
|
/**
|
|
9
9
|
* @license
|
|
10
10
|
* Copyright 2018 Google LLC
|
|
11
11
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
12
12
|
*/
|
|
13
|
-
const
|
|
14
|
-
constructor(
|
|
15
|
-
var
|
|
16
|
-
if (super(
|
|
13
|
+
const f = "important", M = " !" + f, L = x(class extends T {
|
|
14
|
+
constructor(l) {
|
|
15
|
+
var t;
|
|
16
|
+
if (super(l), l.type !== C.ATTRIBUTE || l.name !== "style" || ((t = l.strings) == null ? void 0 : t.length) > 2) throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.");
|
|
17
17
|
}
|
|
18
|
-
render(
|
|
19
|
-
return Object.keys(
|
|
20
|
-
const
|
|
21
|
-
return
|
|
18
|
+
render(l) {
|
|
19
|
+
return Object.keys(l).reduce((t, e) => {
|
|
20
|
+
const i = l[e];
|
|
21
|
+
return i == null ? t : t + `${e = e.includes("-") ? e : e.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g, "-$&").toLowerCase()}:${i};`;
|
|
22
22
|
}, "");
|
|
23
23
|
}
|
|
24
|
-
update(
|
|
25
|
-
const { style:
|
|
26
|
-
if (this.ft === void 0) return this.ft = new Set(Object.keys(
|
|
27
|
-
for (const
|
|
28
|
-
for (const
|
|
29
|
-
const
|
|
30
|
-
if (
|
|
31
|
-
this.ft.add(
|
|
32
|
-
const o = typeof
|
|
33
|
-
|
|
24
|
+
update(l, [t]) {
|
|
25
|
+
const { style: e } = l.element;
|
|
26
|
+
if (this.ft === void 0) return this.ft = new Set(Object.keys(t)), this.render(t);
|
|
27
|
+
for (const i of this.ft) t[i] == null && (this.ft.delete(i), i.includes("-") ? e.removeProperty(i) : e[i] = null);
|
|
28
|
+
for (const i in t) {
|
|
29
|
+
const a = t[i];
|
|
30
|
+
if (a != null) {
|
|
31
|
+
this.ft.add(i);
|
|
32
|
+
const o = typeof a == "string" && a.endsWith(M);
|
|
33
|
+
i.includes("-") || o ? e.setProperty(i, o ? a.slice(0, -11) : a, o ? f : "") : e[i] = a;
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
|
-
return
|
|
36
|
+
return _;
|
|
37
37
|
}
|
|
38
38
|
});
|
|
39
|
-
var
|
|
40
|
-
for (var
|
|
41
|
-
(
|
|
42
|
-
return
|
|
39
|
+
var S = Object.defineProperty, r = (l, t, e, i) => {
|
|
40
|
+
for (var a = void 0, o = l.length - 1, n; o >= 0; o--)
|
|
41
|
+
(n = l[o]) && (a = n(t, e, a) || a);
|
|
42
|
+
return a && S(t, e, a), a;
|
|
43
43
|
};
|
|
44
|
-
|
|
44
|
+
class s extends A {
|
|
45
45
|
constructor() {
|
|
46
|
-
super(), this.ariaLabel = null, this.ariaLabelledby = null, this.ariaValueText = null, this.ariaLive = "polite", this.id =
|
|
46
|
+
super(), this.ariaLabel = null, this.ariaLabelledby = null, this.ariaValueText = null, this.ariaLive = "polite", this.id = b(), this.role = "progressbar", this.skin = "dark-blue", this.statusPlacement = "following", this.statusType = "none", this.title = "", this.titlePosition = "left", this.valueCurrent = 0, this.valueMax = 100, this.valueMin = 0, this.labelWidth = 0, this.progressbarId = this.id, this.computedAriaLabelledby = null, this.computedAriaValueText = "", this.labelRef = y(), this.progressBarRef = y();
|
|
47
47
|
}
|
|
48
48
|
firstUpdated(t) {
|
|
49
49
|
super.firstUpdated(t), this.setComputedValues(), this.syncAttributes();
|
|
50
50
|
}
|
|
51
51
|
updated(t) {
|
|
52
|
-
super.updated(t), t.has("valueCurrent") && this.labelRef.value && (this.labelWidth = this.labelRef.value.getBoundingClientRect().width || 0), t.has("id") && this.id && (this.progressBarId = this.id), (t.has("statusType") || t.has("id") || t.has("ariaLabelledby")) && (this.progressbarId = this.id ||
|
|
52
|
+
super.updated(t), t.has("valueCurrent") && this.labelRef.value && (this.labelWidth = this.labelRef.value.getBoundingClientRect().width || 0), t.has("id") && this.id && (this.progressBarId = this.id), (t.has("statusType") || t.has("id") || t.has("ariaLabelledby")) && (this.progressbarId = this.id || b(), this.computedAriaLabelledby = this.ariaLabelledby || `${this.progressbarId}-title`), (t.has("ariaValueText") || t.has("valueCurrent") || t.has("valueMax")) && (this.computedAriaValueText = this.statusType === "fraction" && !this.ariaValueText ? `${this.valueCurrent} av ${this.valueMax - this.valueMin}` : this.ariaValueText || ""), this.syncAttributes();
|
|
53
53
|
}
|
|
54
54
|
render() {
|
|
55
|
-
const t = this.statusType !== "none", e = this.valueMax - this.valueMin,
|
|
55
|
+
const t = this.statusType !== "none", e = this.valueMax - this.valueMin, i = this.valueCurrent / e * 100, a = this.statusType === "fraction" ? Math.round(i) : Math.round((this.valueCurrent - this.valueMin) / (this.valueMax - this.valueMin) * 100), o = `${this.valueCurrent} av ${e}`, n = p({
|
|
56
56
|
"pkt-progressbar__bar": !0,
|
|
57
57
|
[`pkt-progressbar__bar--${this.skin}`]: !!this.skin
|
|
58
|
-
}),
|
|
58
|
+
}), v = p({
|
|
59
59
|
"pkt-progressbar__title": !0,
|
|
60
60
|
"pkt-progressbar__title-center": this.titlePosition === "center"
|
|
61
|
-
}),
|
|
61
|
+
}), m = p({
|
|
62
62
|
"pkt-progressbar__status": !0,
|
|
63
63
|
"pkt-progressbar__status--center": this.statusPlacement === "center"
|
|
64
|
-
}),
|
|
64
|
+
}), g = p({
|
|
65
65
|
"pkt-progressbar__status-placement--following": this.statusPlacement === "following",
|
|
66
66
|
"pkt-progressbar__status-placement--center": this.statusPlacement === "center",
|
|
67
67
|
"pkt-progressbar__status-placement--left": this.statusPlacement === "left"
|
|
68
68
|
});
|
|
69
|
-
return
|
|
69
|
+
return d` <div
|
|
70
70
|
class="pkt-progressbar__container"
|
|
71
71
|
.ref=${this.progressBarRef}
|
|
72
|
-
style=${
|
|
72
|
+
style=${L({
|
|
73
73
|
"--pkt-progress-label-width": `${this.labelWidth}px`,
|
|
74
|
-
"--pkt-progress-width": `${
|
|
74
|
+
"--pkt-progress-width": `${a}%`
|
|
75
75
|
})}
|
|
76
76
|
>
|
|
77
|
-
${this.title ?
|
|
77
|
+
${this.title ? d`<p id=${`${this.progressBarId}-title`} class=${v}>${this.title}</p>` : c}
|
|
78
78
|
|
|
79
79
|
<div class="pkt-progressbar__bar-wrapper">
|
|
80
|
-
<div class=${
|
|
80
|
+
<div class=${n}></div>
|
|
81
81
|
</div>
|
|
82
82
|
|
|
83
|
-
${t ?
|
|
84
|
-
<span class=${
|
|
85
|
-
${this.statusType === "percentage" ? `${
|
|
83
|
+
${t ? d`<div class=${m}>
|
|
84
|
+
<span class=${g} ${k(this.labelRef)}>
|
|
85
|
+
${this.statusType === "percentage" ? `${a}%` : o}
|
|
86
86
|
</span>
|
|
87
87
|
</div>` : c}
|
|
88
88
|
</div>`;
|
|
89
89
|
}
|
|
90
90
|
// methods
|
|
91
91
|
setComputedValues() {
|
|
92
|
-
this.progressbarId = this.id ||
|
|
92
|
+
this.progressbarId = this.id || b(), this.computedAriaLabelledby = this.ariaLabelledby || `${this.progressbarId}-title`, this.computedAriaValueText = this.statusType === "fraction" && !this.ariaValueText ? `${this.valueCurrent} av ${this.valueMax - this.valueMin}` : this.ariaValueText || "";
|
|
93
93
|
}
|
|
94
94
|
syncAttributes() {
|
|
95
95
|
this._handleAttribute("aria-live", this.ariaLive), this._handleAttribute("aria-valuenow", this.valueCurrent), this._handleAttribute("aria-valuemin", this.valueMin), this._handleAttribute("aria-valuemax", this.valueMax), this._handleAttribute("aria-valuetext", this.computedAriaValueText), this._handleAttribute("aria-label", this.ariaLabel), this._handleAttribute("role", this.role), this._handleAttribute("aria-atomic", "true"), this._handleAttribute("id", this.progressbarId), this.ariaLabel || this._handleAttribute("aria-labelledby", this.computedAriaLabelledby);
|
|
@@ -97,66 +97,66 @@ let r = class extends _ {
|
|
|
97
97
|
_handleAttribute(t, e) {
|
|
98
98
|
e == null || e === "" ? this.removeAttribute(t) : this.setAttribute(t, String(e));
|
|
99
99
|
}
|
|
100
|
-
}
|
|
101
|
-
|
|
100
|
+
}
|
|
101
|
+
r([
|
|
102
102
|
u({ type: String })
|
|
103
|
-
],
|
|
104
|
-
|
|
103
|
+
], s.prototype, "ariaLabel");
|
|
104
|
+
r([
|
|
105
105
|
u({ type: String, reflect: !0 })
|
|
106
|
-
],
|
|
107
|
-
|
|
106
|
+
], s.prototype, "ariaLabelledby");
|
|
107
|
+
r([
|
|
108
108
|
u({ type: String, reflect: !0 })
|
|
109
|
-
],
|
|
110
|
-
|
|
109
|
+
], s.prototype, "ariaValueText");
|
|
110
|
+
r([
|
|
111
111
|
u({ type: String })
|
|
112
|
-
],
|
|
113
|
-
|
|
112
|
+
], s.prototype, "ariaLive");
|
|
113
|
+
r([
|
|
114
114
|
u({ type: String, reflect: !0 })
|
|
115
|
-
],
|
|
116
|
-
|
|
115
|
+
], s.prototype, "id");
|
|
116
|
+
r([
|
|
117
117
|
u({ type: String })
|
|
118
|
-
],
|
|
119
|
-
|
|
118
|
+
], s.prototype, "role");
|
|
119
|
+
r([
|
|
120
120
|
u({ type: String })
|
|
121
|
-
],
|
|
122
|
-
|
|
121
|
+
], s.prototype, "skin");
|
|
122
|
+
r([
|
|
123
123
|
u({ type: String })
|
|
124
|
-
],
|
|
125
|
-
|
|
124
|
+
], s.prototype, "statusPlacement");
|
|
125
|
+
r([
|
|
126
126
|
u({ type: String })
|
|
127
|
-
],
|
|
128
|
-
|
|
127
|
+
], s.prototype, "statusType");
|
|
128
|
+
r([
|
|
129
129
|
u({ type: String, reflect: !0 })
|
|
130
|
-
],
|
|
131
|
-
|
|
130
|
+
], s.prototype, "title");
|
|
131
|
+
r([
|
|
132
132
|
u({ type: String })
|
|
133
|
-
],
|
|
134
|
-
|
|
133
|
+
], s.prototype, "titlePosition");
|
|
134
|
+
r([
|
|
135
135
|
u({ type: Number, reflect: !0 })
|
|
136
|
-
],
|
|
137
|
-
|
|
136
|
+
], s.prototype, "valueCurrent");
|
|
137
|
+
r([
|
|
138
138
|
u({ type: Number })
|
|
139
|
-
],
|
|
140
|
-
|
|
139
|
+
], s.prototype, "valueMax");
|
|
140
|
+
r([
|
|
141
141
|
u({ type: Number })
|
|
142
|
-
],
|
|
143
|
-
|
|
142
|
+
], s.prototype, "valueMin");
|
|
143
|
+
r([
|
|
144
144
|
h()
|
|
145
|
-
],
|
|
146
|
-
|
|
145
|
+
], s.prototype, "labelWidth");
|
|
146
|
+
r([
|
|
147
147
|
h()
|
|
148
|
-
],
|
|
149
|
-
|
|
148
|
+
], s.prototype, "progressbarId");
|
|
149
|
+
r([
|
|
150
150
|
h()
|
|
151
|
-
],
|
|
152
|
-
|
|
151
|
+
], s.prototype, "computedAriaLabelledby");
|
|
152
|
+
r([
|
|
153
153
|
h()
|
|
154
|
-
],
|
|
155
|
-
|
|
156
|
-
$("pkt-progressbar")
|
|
157
|
-
|
|
158
|
-
|
|
154
|
+
], s.prototype, "computedAriaValueText");
|
|
155
|
+
try {
|
|
156
|
+
$("pkt-progressbar")(s);
|
|
157
|
+
} catch {
|
|
158
|
+
console.warn("Forsøker å definere <pkt-progressbar>, men den er allerede definert");
|
|
159
|
+
}
|
|
159
160
|
export {
|
|
160
|
-
|
|
161
|
-
W as a
|
|
161
|
+
s as P
|
|
162
162
|
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";const t=require("./element-gR_VtSiD.cjs"),u=require("./state-Dg-53wQ8.cjs"),d=require("./input-element-DdVhUvva.cjs"),o=require("./ref-CL-Xk9Xm.cjs"),h=require("./class-map-CsENJXf1.cjs");var k=Object.defineProperty,s=(c,i,a,p)=>{for(var n=void 0,l=c.length-1,r;l>=0;l--)(r=c[l])&&(n=r(i,a,n)||n);return n&&k(i,a,n),n};class e extends d.PktInputElement{constructor(){super(...arguments),this.inputRef=o.e(),this.value="",this.checkHelptext=null,this.defaultChecked=!1,this.hasTile=!1,this.checked=null,this.type="radio",this.tagText=null,this.optionalTag=!1,this.optionalText="Valgfritt",this.requiredTag=!1,this.requiredText="Må fylles ut",this._checked=!1}connectedCallback(){super.connectedCallback()}attributeChangedCallback(i,a,p){i==="defaultChecked"&&(this._checked=this.defaultChecked),i==="checked"&&(this._checked=this.checked===""||this.checked==="true"||this.checked===!0),super.attributeChangedCallback(i,a,p)}render(){const i=h.e({"pkt-input-check__input":!0,"pkt-input-check__input--tile":this.hasTile,"pkt-input-check__input--tile-disabled":this.disabled&&this.hasTile}),a=h.e({"pkt-input-check__input-checkbox":!0,"pkt-input-check__input-checkbox--error":this.hasError}),p=h.e({"pkt-input-check__input-label":!0,"pkt-input-check__input-label--disabled":this.disabled,"pkt-sr-only":this.hideLabel}),n="pkt-tag pkt-tag--small pkt-tag--thin-text",l=()=>t.b`
|
|
2
|
+
${this.tagText?t.b`<span class=${n+" pkt-tag--gray"}>${this.tagText}</span>`:t.A}
|
|
3
|
+
${this.optionalTag?t.b`<span class=${n+" pkt-tag--blue-light"}>${this.optionalText}</span>`:t.A}
|
|
4
|
+
${this.requiredTag?t.b`<span class=${n+" pkt-tag--beige"}>${this.requiredText}</span>`:t.A}
|
|
5
|
+
`,r=()=>t.b`
|
|
6
|
+
<label class=${p} for=${this.id+"-internal"}>
|
|
7
|
+
${this.label} ${l()}
|
|
8
|
+
${this.checkHelptext?t.b`<div class="pkt-input-check__input-helptext">${this.checkHelptext}</div>`:t.A}
|
|
9
|
+
</label>
|
|
10
|
+
`;return t.b`
|
|
11
|
+
<div class="pkt-input-check">
|
|
12
|
+
<div class=${i}>
|
|
13
|
+
<input
|
|
14
|
+
id=${this.id+"-internal"}
|
|
15
|
+
class=${a}
|
|
16
|
+
type="radio"
|
|
17
|
+
role="radio"
|
|
18
|
+
?disabled=${this.disabled}
|
|
19
|
+
form=""
|
|
20
|
+
name=${this.name+"-internal"}
|
|
21
|
+
${o.n(this.inputRef)}
|
|
22
|
+
@change=${this.toggleChecked}
|
|
23
|
+
@input=${this.onInput}
|
|
24
|
+
@blur=${this.onBlur}
|
|
25
|
+
@focus=${this.onFocus}
|
|
26
|
+
?checked=${this.checked}
|
|
27
|
+
/>
|
|
28
|
+
${r()}
|
|
29
|
+
</div>
|
|
30
|
+
</div>
|
|
31
|
+
`}toggleChecked(i=null){i&&i.preventDefault(),i&&i.stopImmediatePropagation(),this.touched=!0,this.inputRef.value&&(this._checked=this.inputRef.value.matches(":checked"),this.valueChecked(this._checked))}}s([t.n({type:String,reflect:!0})],e.prototype,"value");s([t.n({type:String})],e.prototype,"checkHelptext");s([t.n({type:Boolean})],e.prototype,"defaultChecked");s([t.n({type:Boolean})],e.prototype,"hasTile");s([t.n({type:Boolean,reflect:!0})],e.prototype,"checked");s([t.n({type:String,reflect:!0})],e.prototype,"type");s([t.n({type:String})],e.prototype,"tagText");s([t.n({type:Boolean})],e.prototype,"optionalTag");s([t.n({type:String})],e.prototype,"optionalText");s([t.n({type:Boolean})],e.prototype,"requiredTag");s([t.n({type:String})],e.prototype,"requiredText");s([u.r()],e.prototype,"_checked");try{t.t("pkt-radiobutton")(e)}catch{console.warn("Forsøker å definere <pkt-radiobutton>, men den er allerede definert")}exports.PktRadioButton=e;
|
|
@@ -1,111 +1,113 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { t as d, b as l, A as o, n as s } from "./element-CPpT3rFQ.js";
|
|
2
2
|
import { r as k } from "./state-C_1EOo3D.js";
|
|
3
3
|
import { P as f } from "./input-element-8nLwuQS4.js";
|
|
4
|
-
import { e as g, n as
|
|
4
|
+
import { e as g, n as y } from "./ref-Bg_Swj5w.js";
|
|
5
5
|
import { e as u } from "./class-map-CEnykyO_.js";
|
|
6
|
-
var
|
|
7
|
-
for (var
|
|
8
|
-
(
|
|
9
|
-
return
|
|
6
|
+
var b = Object.defineProperty, i = (n, t, p, c) => {
|
|
7
|
+
for (var a = void 0, r = n.length - 1, h; r >= 0; r--)
|
|
8
|
+
(h = n[r]) && (a = h(t, p, a) || a);
|
|
9
|
+
return a && b(t, p, a), a;
|
|
10
10
|
};
|
|
11
|
-
|
|
11
|
+
class e extends f {
|
|
12
12
|
constructor() {
|
|
13
13
|
super(...arguments), this.inputRef = g(), this.value = "", this.checkHelptext = null, this.defaultChecked = !1, this.hasTile = !1, this.checked = null, this.type = "radio", this.tagText = null, this.optionalTag = !1, this.optionalText = "Valgfritt", this.requiredTag = !1, this.requiredText = "Må fylles ut", this._checked = !1;
|
|
14
14
|
}
|
|
15
15
|
connectedCallback() {
|
|
16
16
|
super.connectedCallback();
|
|
17
17
|
}
|
|
18
|
-
attributeChangedCallback(
|
|
19
|
-
|
|
18
|
+
attributeChangedCallback(t, p, c) {
|
|
19
|
+
t === "defaultChecked" && (this._checked = this.defaultChecked), t === "checked" && (this._checked = this.checked === "" || this.checked === "true" || this.checked === !0), super.attributeChangedCallback(t, p, c);
|
|
20
20
|
}
|
|
21
21
|
render() {
|
|
22
|
-
const
|
|
22
|
+
const t = u({
|
|
23
23
|
"pkt-input-check__input": !0,
|
|
24
24
|
"pkt-input-check__input--tile": this.hasTile,
|
|
25
25
|
"pkt-input-check__input--tile-disabled": this.disabled && this.hasTile
|
|
26
|
-
}),
|
|
26
|
+
}), p = u({
|
|
27
27
|
"pkt-input-check__input-checkbox": !0,
|
|
28
28
|
"pkt-input-check__input-checkbox--error": this.hasError
|
|
29
29
|
}), c = u({
|
|
30
30
|
"pkt-input-check__input-label": !0,
|
|
31
31
|
"pkt-input-check__input-label--disabled": this.disabled,
|
|
32
32
|
"pkt-sr-only": this.hideLabel
|
|
33
|
-
}),
|
|
34
|
-
${this.tagText ?
|
|
35
|
-
${this.optionalTag ?
|
|
36
|
-
${this.requiredTag ?
|
|
37
|
-
`,
|
|
33
|
+
}), a = "pkt-tag pkt-tag--small pkt-tag--thin-text", r = () => l`
|
|
34
|
+
${this.tagText ? l`<span class=${a + " pkt-tag--gray"}>${this.tagText}</span>` : o}
|
|
35
|
+
${this.optionalTag ? l`<span class=${a + " pkt-tag--blue-light"}>${this.optionalText}</span>` : o}
|
|
36
|
+
${this.requiredTag ? l`<span class=${a + " pkt-tag--beige"}>${this.requiredText}</span>` : o}
|
|
37
|
+
`, h = () => l`
|
|
38
38
|
<label class=${c} for=${this.id + "-internal"}>
|
|
39
|
-
${this.label} ${
|
|
40
|
-
${this.checkHelptext ?
|
|
39
|
+
${this.label} ${r()}
|
|
40
|
+
${this.checkHelptext ? l`<div class="pkt-input-check__input-helptext">${this.checkHelptext}</div>` : o}
|
|
41
41
|
</label>
|
|
42
42
|
`;
|
|
43
|
-
return
|
|
43
|
+
return l`
|
|
44
44
|
<div class="pkt-input-check">
|
|
45
|
-
<div class=${
|
|
45
|
+
<div class=${t}>
|
|
46
46
|
<input
|
|
47
47
|
id=${this.id + "-internal"}
|
|
48
|
-
class=${
|
|
48
|
+
class=${p}
|
|
49
49
|
type="radio"
|
|
50
50
|
role="radio"
|
|
51
51
|
?disabled=${this.disabled}
|
|
52
52
|
form=""
|
|
53
53
|
name=${this.name + "-internal"}
|
|
54
|
-
${
|
|
54
|
+
${y(this.inputRef)}
|
|
55
55
|
@change=${this.toggleChecked}
|
|
56
56
|
@input=${this.onInput}
|
|
57
57
|
@blur=${this.onBlur}
|
|
58
58
|
@focus=${this.onFocus}
|
|
59
59
|
?checked=${this.checked}
|
|
60
60
|
/>
|
|
61
|
-
${
|
|
61
|
+
${h()}
|
|
62
62
|
</div>
|
|
63
63
|
</div>
|
|
64
64
|
`;
|
|
65
65
|
}
|
|
66
|
-
toggleChecked(
|
|
67
|
-
|
|
66
|
+
toggleChecked(t = null) {
|
|
67
|
+
t && t.preventDefault(), t && t.stopImmediatePropagation(), this.touched = !0, this.inputRef.value && (this._checked = this.inputRef.value.matches(":checked"), this.valueChecked(this._checked));
|
|
68
68
|
}
|
|
69
|
-
}
|
|
69
|
+
}
|
|
70
70
|
i([
|
|
71
71
|
s({ type: String, reflect: !0 })
|
|
72
|
-
],
|
|
72
|
+
], e.prototype, "value");
|
|
73
73
|
i([
|
|
74
74
|
s({ type: String })
|
|
75
|
-
],
|
|
75
|
+
], e.prototype, "checkHelptext");
|
|
76
76
|
i([
|
|
77
77
|
s({ type: Boolean })
|
|
78
|
-
],
|
|
78
|
+
], e.prototype, "defaultChecked");
|
|
79
79
|
i([
|
|
80
80
|
s({ type: Boolean })
|
|
81
|
-
],
|
|
81
|
+
], e.prototype, "hasTile");
|
|
82
82
|
i([
|
|
83
83
|
s({ type: Boolean, reflect: !0 })
|
|
84
|
-
],
|
|
84
|
+
], e.prototype, "checked");
|
|
85
85
|
i([
|
|
86
86
|
s({ type: String, reflect: !0 })
|
|
87
|
-
],
|
|
87
|
+
], e.prototype, "type");
|
|
88
88
|
i([
|
|
89
89
|
s({ type: String })
|
|
90
|
-
],
|
|
90
|
+
], e.prototype, "tagText");
|
|
91
91
|
i([
|
|
92
92
|
s({ type: Boolean })
|
|
93
|
-
],
|
|
93
|
+
], e.prototype, "optionalTag");
|
|
94
94
|
i([
|
|
95
95
|
s({ type: String })
|
|
96
|
-
],
|
|
96
|
+
], e.prototype, "optionalText");
|
|
97
97
|
i([
|
|
98
98
|
s({ type: Boolean })
|
|
99
|
-
],
|
|
99
|
+
], e.prototype, "requiredTag");
|
|
100
100
|
i([
|
|
101
101
|
s({ type: String })
|
|
102
|
-
],
|
|
102
|
+
], e.prototype, "requiredText");
|
|
103
103
|
i([
|
|
104
104
|
k()
|
|
105
|
-
],
|
|
106
|
-
|
|
107
|
-
d("pkt-radiobutton")
|
|
108
|
-
|
|
105
|
+
], e.prototype, "_checked");
|
|
106
|
+
try {
|
|
107
|
+
d("pkt-radiobutton")(e);
|
|
108
|
+
} catch {
|
|
109
|
+
console.warn("Forsøker å definere <pkt-radiobutton>, men den er allerede definert");
|
|
110
|
+
}
|
|
109
111
|
export {
|
|
110
|
-
|
|
112
|
+
e as P
|
|
111
113
|
};
|