@oslokommune/punkt-elements 16.18.0 → 16.19.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/{accordion-CU2tJ5vn.js → accordion-BjYsEbSM.js} +19 -19
- package/dist/{accordion-DDZkjXFb.cjs → accordion-DaeWPWod.cjs} +5 -5
- package/dist/{alert-D_eXGOez.js → alert-BkzC5mVu.js} +22 -22
- package/dist/{alert-NyLr62jZ.cjs → alert-D_45dWPn.cjs} +6 -6
- package/dist/{async-directive-CaQiqjyV.js → async-directive-Cz6tcqge.js} +2 -2
- package/dist/async-directive-DO1QtVmf.cjs +1 -0
- package/dist/{backlink-CTu44BHn.js → backlink-BXAdgAte.js} +6 -6
- package/dist/{backlink-BsQ0Rmxj.cjs → backlink-C42-3OG3.cjs} +2 -2
- package/dist/{breadcrumbs-BNZ1L-0q.cjs → breadcrumbs-CkjeLh3U.cjs} +6 -6
- package/dist/{breadcrumbs-DPnoURvl.js → breadcrumbs-Dkb9TxMp.js} +15 -15
- package/dist/{button-ZYlrRRfu.js → button-CR-KWhTT.js} +21 -21
- package/dist/{button-DsGvcLIn.cjs → button-Dwv11n6R.cjs} +7 -7
- package/dist/{calendar-CDDVoUby.cjs → calendar-Buvxe4l_.cjs} +11 -11
- package/dist/{calendar-VOqO5um6.js → calendar-DAq6iJdx.js} +50 -50
- package/dist/{card-B4oDGIRP.js → card-5PydU247.js} +43 -43
- package/dist/{card-DZuZy0ay.cjs → card-C__IlsUa.cjs} +26 -26
- package/dist/{checkbox-CF5mSBR5.js → checkbox-CC1X7fw4.js} +23 -23
- package/dist/{checkbox-BerAYcfK.cjs → checkbox-DzMc0AJX.cjs} +10 -10
- package/dist/class-map-B8Ja0q7n.cjs +1 -0
- package/dist/{class-map-C8HuhNzZ.js → class-map-DH9hlJny.js} +7 -8
- package/dist/{combobox-BDYoPZmg.js → combobox-D-DY7YcW.js} +42 -42
- package/dist/{combobox-Ct9gCFa1.cjs → combobox-x4tBGP3F.cjs} +17 -17
- package/dist/components/heading/heading.d.ts +5 -8
- package/dist/{consent-BME_rQ2w.cjs → consent-BB3g_ByO.cjs} +3 -3
- package/dist/{consent-1IUuWZAh.js → consent-Y14WZ0JS.js} +8 -8
- package/dist/{datepicker-ByqXCpCd.cjs → datepicker-BFI-3stE.cjs} +20 -20
- package/dist/{datepicker-BGpoabCM.js → datepicker-CRk7aiwH.js} +57 -57
- package/dist/{directive-helpers-Dkv2gKgs.js → directive-helpers-Cep_4cpj.js} +1 -1
- package/dist/{directive-helpers-D1QSxY17.cjs → directive-helpers-f36YZFOG.cjs} +1 -1
- package/dist/element-CXAtr6Gu.cjs +2 -0
- package/dist/{element-cZ85T_aa.js → element-CduG0XyF.js} +47 -23
- package/dist/{element-with-slot-4J2o3SeU.js → element-with-slot-BVj9MXzi.js} +5 -6
- package/dist/element-with-slot-Cmxb9h4H.cjs +1 -0
- package/dist/{fileupload-B6W7qOQT.js → fileupload-C8muj8qd.js} +149 -149
- package/dist/{fileupload-a2OL3dzG.cjs → fileupload-YtsrgQTY.cjs} +40 -40
- package/dist/{header-BZFSan0_.cjs → header-CjBip0zj.cjs} +57 -57
- package/dist/{header-BgVpJMHQ.js → header-DONTGbD9.js} +130 -130
- package/dist/{header-menu-BXzVVOHq.js → header-menu-BU-ylGrJ.js} +45 -45
- package/dist/{header-menu-BLngov1D.cjs → header-menu-CnW7nzmF.cjs} +24 -24
- package/dist/heading-3o4Dk0Wn.js +80 -0
- package/dist/heading-C40-NX0r.cjs +1 -0
- package/dist/{helptext-BeU-enix.js → helptext-C2aQBBo_.js} +12 -12
- package/dist/{helptext-DWMFqMnV.cjs → helptext-DNLg43eI.cjs} +4 -4
- package/dist/icon-Dw6I0HDV.cjs +1 -0
- package/dist/{icon-CZQkrK6B.js → icon-LaKyBKON.js} +18 -19
- package/dist/if-defined-LTjAScFG.cjs +1 -0
- package/dist/{if-defined-Cjj8qN-Z.js → if-defined-VShASPdu.js} +1 -1
- package/dist/{input-element-D0egtEnr.cjs → input-element-BHQVt4Q9.cjs} +1 -1
- package/dist/{input-element-B1ciW1N2.js → input-element-BrmkXIXi.js} +30 -30
- package/dist/{input-wrapper-oYcbCFow.js → input-wrapper-B6WowlWG.js} +33 -33
- package/dist/{input-wrapper-Y98KV-sy.cjs → input-wrapper-Dhkt20WW.cjs} +17 -17
- package/dist/{link-BMMIjg50.cjs → link-B5ur0Rym.cjs} +4 -4
- package/dist/{link-CT0LB3S7.js → link-ClUNY__5.js} +13 -13
- package/dist/linkcard-BIcCW-qw.cjs +13 -0
- package/dist/{linkcard-Bz5zb69P.js → linkcard-DNJm5FvA.js} +15 -15
- package/dist/{listbox-0NHJvNjz.js → listbox-DXMIBv3y.js} +35 -35
- package/dist/{listbox-CcThiNBY.cjs → listbox-DbEobJNx.cjs} +14 -14
- package/dist/{loader-8T6M0FCQ.cjs → loader-Uap9qDsV.cjs} +5 -5
- package/dist/{loader-Cbrc4FFx.js → loader-gKdQpOOQ.js} +12 -12
- package/dist/{messagebox-C6LHT78_.cjs → messagebox-BqBxXK8c.cjs} +5 -5
- package/dist/{messagebox-TKKUVTo4.js → messagebox-XRFecqyS.js} +15 -15
- package/dist/{modal-BVHH8koz.js → modal-CWgeT-RP.js} +19 -19
- package/dist/{modal-CRzbtqL3.cjs → modal-CrYHKOmr.cjs} +8 -8
- package/dist/pkt-accordion.cjs +1 -1
- package/dist/pkt-accordion.js +1 -1
- 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-breadcrumbs.cjs +1 -1
- package/dist/pkt-breadcrumbs.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 +1 -1
- package/dist/pkt-fileupload.cjs +1 -1
- package/dist/pkt-fileupload.js +1 -1
- package/dist/pkt-header-menu.cjs +1 -1
- package/dist/pkt-header-menu.js +1 -1
- package/dist/pkt-header.cjs +1 -1
- package/dist/pkt-header.js +1 -1
- 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 +32 -32
- 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-options-controller-CCB15L_G.js → pkt-options-controller-BTNtjEIS.js} +1 -1
- package/dist/{pkt-options-controller-CeAQ-D-i.cjs → pkt-options-controller-CBM8xHwR.cjs} +1 -1
- package/dist/pkt-progressbar.cjs +1 -1
- package/dist/pkt-progressbar.js +1 -1
- package/dist/pkt-radiobutton.cjs +1 -1
- package/dist/pkt-radiobutton.js +1 -1
- package/dist/pkt-searchinput.cjs +1 -1
- package/dist/pkt-searchinput.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 +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/pkt-timepicker.cjs +1 -1
- package/dist/pkt-timepicker.js +1 -1
- package/dist/{progressbar-C-5oESiB.js → progressbar-B0P_vmGD.js} +23 -24
- package/dist/progressbar-DADdvDl5.cjs +17 -0
- package/dist/{radiobutton-B1Xg6XzP.cjs → radiobutton-BfURufrZ.cjs} +8 -8
- package/dist/{radiobutton-BAn1V_mQ.js → radiobutton-C6zERHoy.js} +20 -20
- package/dist/{ref-RS8Uv6uC.js → ref-BgoHEsEt.js} +7 -8
- package/dist/ref-CBdWMlde.cjs +1 -0
- package/dist/{repeat-DV1O43YU.js → repeat-CKIii8Mi.js} +15 -16
- package/dist/repeat-CRRgmzVn.cjs +1 -0
- package/dist/{searchinput-DUgZb_zm.cjs → searchinput-BrxfRzez.cjs} +13 -13
- package/dist/{searchinput-C9FP89qD.js → searchinput-fPvXHu2O.js} +31 -31
- package/dist/{select-DkKIW7zD.js → select-BIgFPp42.js} +13 -13
- package/dist/{select-DAs8kzN4.cjs → select-DzZHv6Bz.cjs} +3 -3
- package/dist/{tabs-ClI1XQDt.js → tabs-BJx6wwXD.js} +29 -29
- package/dist/{tabs-CN_RIMWg.cjs → tabs-DxQy8U-0.cjs} +7 -7
- package/dist/{tag-vgKH9B4k.cjs → tag-CBFz0R9N.cjs} +5 -5
- package/dist/{tag-DSZ-czu-.js → tag-CzlnHhho.js} +19 -19
- package/dist/textarea-M_S9WK7s.cjs +46 -0
- package/dist/{textarea-BfjI6d7Q.js → textarea-qHtkhelz.js} +24 -25
- package/dist/{textinput-DhoupEyI.js → textinput-CZrBM-Fj.js} +26 -26
- package/dist/{textinput-BM66vo5e.cjs → textinput-C_6kvf87.cjs} +12 -12
- package/dist/{timepicker-CtRGbypF.js → timepicker-O0iCeJyW.js} +51 -51
- package/dist/{timepicker-C4oRmmRd.cjs → timepicker-WiYLAncb.cjs} +20 -20
- package/package.json +2 -2
- package/src/components/card/card.ts +1 -1
- package/src/components/heading/heading.test.ts +79 -70
- package/src/components/heading/heading.ts +40 -78
- package/dist/async-directive-B9P1Qa0k.cjs +0 -1
- package/dist/class-map-CJ-msbHs.cjs +0 -1
- package/dist/directive-3THFsVew.js +0 -28
- package/dist/directive-CJ2giQBZ.cjs +0 -1
- package/dist/element-DjtxO-1r.cjs +0 -2
- package/dist/element-with-slot-CWoTGA1B.cjs +0 -1
- package/dist/heading-BxvE80bb.js +0 -73
- package/dist/heading-DRJTS27k.cjs +0 -1
- package/dist/icon-PbaC9uUg.cjs +0 -1
- package/dist/if-defined-XKOD_t_V.cjs +0 -1
- package/dist/linkcard-CupEMkvj.cjs +0 -13
- package/dist/progressbar-C0g830Tk.cjs +0 -17
- package/dist/ref-BaJ0mBT_.cjs +0 -1
- package/dist/repeat-DaDFvx86.cjs +0 -1
- package/dist/textarea-C7YiheLo.cjs +0 -46
- /package/dist/{booleanish-CRaKZ75t.js → booleanish-BmcOU-43.js} +0 -0
- /package/dist/{booleanish-B5EFqFpJ.cjs → booleanish-jJLlnr6-.cjs} +0 -0
- /package/dist/{classutils-z8YsPlOf.cjs → classutils-CVTzKF0J.cjs} +0 -0
- /package/dist/{classutils-DEL164Ur.js → classutils-lVbGcvjN.js} +0 -0
- /package/dist/{converters-Bffq_YDm.cjs → converters-C_66kHUN.cjs} +0 -0
- /package/dist/{converters-jauYkvNh.js → converters-DSQXaDQ_.js} +0 -0
- /package/dist/{dialog-polyfill.esm-B7W3teD0.js → dialog-polyfill.esm-0dVT8G1o.js} +0 -0
- /package/dist/{dialog-polyfill.esm-BnAQvMQO.cjs → dialog-polyfill.esm-CYs2AHP1.cjs} +0 -0
- /package/dist/{focus-modality-controller-pzSZkDkH.js → focus-modality-controller-CaUqYdk0.js} +0 -0
- /package/dist/{focus-modality-controller-BSZAQk8y.cjs → focus-modality-controller-wI5SR8wH.cjs} +0 -0
- /package/dist/{input-wrapper-CQGoyLdZ.cjs → input-wrapper-CYCCx8MP.cjs} +0 -0
- /package/dist/{input-wrapper-DwSsP39J.js → input-wrapper-kw2y6Jp_.js} +0 -0
- /package/dist/{utils-BOOZ0ppt.js → utils-CUqCKGvp.js} +0 -0
- /package/dist/{utils-CM67Oudc.cjs → utils-CjAbIttF.cjs} +0 -0
package/dist/pkt-textinput.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as e, t } from "./textinput-
|
|
1
|
+
import { n as e, t } from "./textinput-CZrBM-Fj.js";
|
|
2
2
|
export { e as PktTextinput, t as default };
|
package/dist/pkt-timepicker.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./timepicker-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./timepicker-WiYLAncb.cjs`);exports.PktTimepicker=e.t;
|
package/dist/pkt-timepicker.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as e } from "./timepicker-
|
|
1
|
+
import { t as e } from "./timepicker-O0iCeJyW.js";
|
|
2
2
|
export { e as PktTimepicker };
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import "./
|
|
5
|
-
import { n as
|
|
6
|
-
import { n as m } from "./utils-BOOZ0ppt.js";
|
|
1
|
+
import { a as e, c as t, d as n, f as r, l as i, n as a, o, p as s, s as c, t as l, u } from "./element-CduG0XyF.js";
|
|
2
|
+
import { t as d } from "./class-map-DH9hlJny.js";
|
|
3
|
+
import "./icon-LaKyBKON.js";
|
|
4
|
+
import { n as f, t as p } from "./ref-BgoHEsEt.js";
|
|
5
|
+
import { n as m } from "./utils-CUqCKGvp.js";
|
|
7
6
|
//#region ../../node_modules/lit-html/directives/style-map.js
|
|
8
|
-
var h = "important", g = " !" + h, _ =
|
|
7
|
+
var h = "important", g = " !" + h, _ = t(class extends i {
|
|
9
8
|
constructor(e) {
|
|
10
|
-
if (super(e), e.type !==
|
|
9
|
+
if (super(e), e.type !== u.ATTRIBUTE || e.name !== "style" || e.strings?.length > 2) throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.");
|
|
11
10
|
}
|
|
12
11
|
render(e) {
|
|
13
12
|
return Object.keys(e).reduce((t, n) => {
|
|
@@ -27,9 +26,9 @@ var h = "important", g = " !" + h, _ = u(class extends c {
|
|
|
27
26
|
e.includes("-") || t ? n.setProperty(e, t ? r.slice(0, -11) : r, t ? h : "") : n[e] = r;
|
|
28
27
|
}
|
|
29
28
|
}
|
|
30
|
-
return
|
|
29
|
+
return r;
|
|
31
30
|
}
|
|
32
|
-
}), v = class extends
|
|
31
|
+
}), v = class extends l {
|
|
33
32
|
constructor() {
|
|
34
33
|
super(), this.ariaLabel = null, this.ariaLabelledby = null, this.ariaValueText = null, this.ariaLive = "polite", this.id = m(), 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 = p(), this.progressBarRef = p();
|
|
35
34
|
}
|
|
@@ -40,7 +39,7 @@ var h = "important", g = " !" + h, _ = u(class extends c {
|
|
|
40
39
|
super.updated(e), e.has("valueCurrent") && this.labelRef.value && (this.labelWidth = this.labelRef.value.getBoundingClientRect().width || 0), e.has("id") && this.id && (this.progressBarId = this.id), (e.has("statusType") || e.has("id") || e.has("ariaLabelledby")) && (this.progressbarId = this.id || m(), this.computedAriaLabelledby = this.ariaLabelledby || `${this.progressbarId}-title`), (e.has("ariaValueText") || e.has("valueCurrent") || e.has("valueMax")) && (this.computedAriaValueText = this.statusType === "fraction" && !this.ariaValueText ? `${this.valueCurrent} av ${this.valueMax - this.valueMin}` : this.ariaValueText || ""), this.syncAttributes();
|
|
41
40
|
}
|
|
42
41
|
render() {
|
|
43
|
-
let e = this.statusType !== "none",
|
|
42
|
+
let e = this.statusType !== "none", t = this.valueMax - this.valueMin, r = this.valueCurrent / t * 100, i = this.statusType === "fraction" ? Math.round(r) : Math.round((this.valueCurrent - this.valueMin) / (this.valueMax - this.valueMin) * 100), a = `${this.valueCurrent} av ${t}`, o = d({
|
|
44
43
|
"pkt-progressbar__bar": !0,
|
|
45
44
|
[`pkt-progressbar__bar--${this.skin}`]: !!this.skin
|
|
46
45
|
}), c = d({
|
|
@@ -54,23 +53,23 @@ var h = "important", g = " !" + h, _ = u(class extends c {
|
|
|
54
53
|
"pkt-progressbar__status-placement--center": this.statusPlacement === "center",
|
|
55
54
|
"pkt-progressbar__status-placement--left": this.statusPlacement === "left"
|
|
56
55
|
});
|
|
57
|
-
return
|
|
56
|
+
return s` <div
|
|
58
57
|
class="pkt-progressbar__container"
|
|
59
58
|
.ref=${this.progressBarRef}
|
|
60
59
|
style=${_({
|
|
61
60
|
"--pkt-progress-label-width": `${this.labelWidth}px`,
|
|
62
|
-
"--pkt-progress-width": `${
|
|
61
|
+
"--pkt-progress-width": `${i}%`
|
|
63
62
|
})}
|
|
64
63
|
>
|
|
65
|
-
${this.title ?
|
|
64
|
+
${this.title ? s`<p id=${`${this.progressBarId}-title`} class=${c}>${this.title}</p>` : n}
|
|
66
65
|
|
|
67
66
|
<div class="pkt-progressbar__bar-wrapper">
|
|
68
|
-
<div class=${
|
|
67
|
+
<div class=${o}></div>
|
|
69
68
|
</div>
|
|
70
69
|
|
|
71
|
-
${e ?
|
|
70
|
+
${e ? s`<div class=${l}>
|
|
72
71
|
<span class=${u} ${f(this.labelRef)}>
|
|
73
|
-
${this.statusType === "percentage" ? `${
|
|
72
|
+
${this.statusType === "percentage" ? `${i}%` : a}
|
|
74
73
|
</span>
|
|
75
74
|
</div>` : n}
|
|
76
75
|
</div>`;
|
|
@@ -85,24 +84,24 @@ var h = "important", g = " !" + h, _ = u(class extends c {
|
|
|
85
84
|
t == null || t === "" ? this.removeAttribute(e) : this.setAttribute(e, String(t));
|
|
86
85
|
}
|
|
87
86
|
};
|
|
88
|
-
|
|
87
|
+
a([o({ type: String })], v.prototype, "ariaLabel", void 0), a([o({
|
|
89
88
|
type: String,
|
|
90
89
|
reflect: !0
|
|
91
|
-
})], v.prototype, "ariaLabelledby", void 0),
|
|
90
|
+
})], v.prototype, "ariaLabelledby", void 0), a([o({
|
|
92
91
|
type: String,
|
|
93
92
|
reflect: !0
|
|
94
|
-
})], v.prototype, "ariaValueText", void 0),
|
|
93
|
+
})], v.prototype, "ariaValueText", void 0), a([o({ type: String })], v.prototype, "ariaLive", void 0), a([o({
|
|
95
94
|
type: String,
|
|
96
95
|
reflect: !0
|
|
97
|
-
})], v.prototype, "id", void 0),
|
|
96
|
+
})], v.prototype, "id", void 0), a([o({ type: String })], v.prototype, "role", void 0), a([o({ type: String })], v.prototype, "skin", void 0), a([o({ type: String })], v.prototype, "statusPlacement", void 0), a([o({ type: String })], v.prototype, "statusType", void 0), a([o({
|
|
98
97
|
type: String,
|
|
99
98
|
reflect: !0
|
|
100
|
-
})], v.prototype, "title", void 0),
|
|
99
|
+
})], v.prototype, "title", void 0), a([o({ type: String })], v.prototype, "titlePosition", void 0), a([o({
|
|
101
100
|
type: Number,
|
|
102
101
|
reflect: !0
|
|
103
|
-
})], v.prototype, "valueCurrent", void 0),
|
|
102
|
+
})], v.prototype, "valueCurrent", void 0), a([o({ type: Number })], v.prototype, "valueMax", void 0), a([o({ type: Number })], v.prototype, "valueMin", void 0), a([e()], v.prototype, "labelWidth", void 0), a([e()], v.prototype, "progressbarId", void 0), a([e()], v.prototype, "computedAriaLabelledby", void 0), a([e()], v.prototype, "computedAriaValueText", void 0);
|
|
104
103
|
try {
|
|
105
|
-
|
|
104
|
+
c("pkt-progressbar")(v);
|
|
106
105
|
} catch {
|
|
107
106
|
console.warn("Forsøker å definere <pkt-progressbar>, men den er allerede definert");
|
|
108
107
|
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
const e=require(`./element-CXAtr6Gu.cjs`),t=require(`./class-map-B8Ja0q7n.cjs`);require(`./icon-Dw6I0HDV.cjs`);const n=require(`./ref-CBdWMlde.cjs`),r=require(`./utils-CjAbIttF.cjs`);var i=`important`,a=` !`+i,o=e.c(class extends e.l{constructor(t){if(super(t),t.type!==e.u.ATTRIBUTE||t.name!==`style`||t.strings?.length>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(e){return Object.keys(e).reduce((t,n)=>{let r=e[n];return r==null?t:t+`${n=n.includes(`-`)?n:n.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,`-$&`).toLowerCase()}:${r};`},``)}update(t,[n]){let{style:r}=t.element;if(this.ft===void 0)return this.ft=new Set(Object.keys(n)),this.render(n);for(let e of this.ft)n[e]??(this.ft.delete(e),e.includes(`-`)?r.removeProperty(e):r[e]=null);for(let e in n){let t=n[e];if(t!=null){this.ft.add(e);let n=typeof t==`string`&&t.endsWith(a);e.includes(`-`)||n?r.setProperty(e,n?t.slice(0,-11):t,n?i:``):r[e]=t}}return e.f}}),s=class extends e.t{constructor(){super(),this.ariaLabel=null,this.ariaLabelledby=null,this.ariaValueText=null,this.ariaLive=`polite`,this.id=r.n(),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=n.t(),this.progressBarRef=n.t()}firstUpdated(e){super.firstUpdated(e),this.setComputedValues(),this.syncAttributes()}updated(e){super.updated(e),e.has(`valueCurrent`)&&this.labelRef.value&&(this.labelWidth=this.labelRef.value.getBoundingClientRect().width||0),e.has(`id`)&&this.id&&(this.progressBarId=this.id),(e.has(`statusType`)||e.has(`id`)||e.has(`ariaLabelledby`))&&(this.progressbarId=this.id||r.n(),this.computedAriaLabelledby=this.ariaLabelledby||`${this.progressbarId}-title`),(e.has(`ariaValueText`)||e.has(`valueCurrent`)||e.has(`valueMax`))&&(this.computedAriaValueText=this.statusType===`fraction`&&!this.ariaValueText?`${this.valueCurrent} av ${this.valueMax-this.valueMin}`:this.ariaValueText||``),this.syncAttributes()}render(){let r=this.statusType!==`none`,i=this.valueMax-this.valueMin,a=this.valueCurrent/i*100,s=this.statusType===`fraction`?Math.round(a):Math.round((this.valueCurrent-this.valueMin)/(this.valueMax-this.valueMin)*100),c=`${this.valueCurrent} av ${i}`,l=t.t({"pkt-progressbar__bar":!0,[`pkt-progressbar__bar--${this.skin}`]:!!this.skin}),u=t.t({"pkt-progressbar__title":!0,"pkt-progressbar__title-center":this.titlePosition===`center`}),d=t.t({"pkt-progressbar__status":!0,"pkt-progressbar__status--center":this.statusPlacement===`center`}),f=t.t({"pkt-progressbar__status-placement--following":this.statusPlacement===`following`,"pkt-progressbar__status-placement--center":this.statusPlacement===`center`,"pkt-progressbar__status-placement--left":this.statusPlacement===`left`});return e.p` <div
|
|
2
|
+
class="pkt-progressbar__container"
|
|
3
|
+
.ref=${this.progressBarRef}
|
|
4
|
+
style=${o({"--pkt-progress-label-width":`${this.labelWidth}px`,"--pkt-progress-width":`${s}%`})}
|
|
5
|
+
>
|
|
6
|
+
${this.title?e.p`<p id=${`${this.progressBarId}-title`} class=${u}>${this.title}</p>`:e.d}
|
|
7
|
+
|
|
8
|
+
<div class="pkt-progressbar__bar-wrapper">
|
|
9
|
+
<div class=${l}></div>
|
|
10
|
+
</div>
|
|
11
|
+
|
|
12
|
+
${r?e.p`<div class=${d}>
|
|
13
|
+
<span class=${f} ${n.n(this.labelRef)}>
|
|
14
|
+
${this.statusType===`percentage`?`${s}%`:c}
|
|
15
|
+
</span>
|
|
16
|
+
</div>`:e.d}
|
|
17
|
+
</div>`}setComputedValues(){this.progressbarId=this.id||r.n(),this.computedAriaLabelledby=this.ariaLabelledby||`${this.progressbarId}-title`,this.computedAriaValueText=this.statusType===`fraction`&&!this.ariaValueText?`${this.valueCurrent} av ${this.valueMax-this.valueMin}`:this.ariaValueText||``}syncAttributes(){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)}_handleAttribute(e,t){t==null||t===``?this.removeAttribute(e):this.setAttribute(e,String(t))}};e.n([e.o({type:String})],s.prototype,`ariaLabel`,void 0),e.n([e.o({type:String,reflect:!0})],s.prototype,`ariaLabelledby`,void 0),e.n([e.o({type:String,reflect:!0})],s.prototype,`ariaValueText`,void 0),e.n([e.o({type:String})],s.prototype,`ariaLive`,void 0),e.n([e.o({type:String,reflect:!0})],s.prototype,`id`,void 0),e.n([e.o({type:String})],s.prototype,`role`,void 0),e.n([e.o({type:String})],s.prototype,`skin`,void 0),e.n([e.o({type:String})],s.prototype,`statusPlacement`,void 0),e.n([e.o({type:String})],s.prototype,`statusType`,void 0),e.n([e.o({type:String,reflect:!0})],s.prototype,`title`,void 0),e.n([e.o({type:String})],s.prototype,`titlePosition`,void 0),e.n([e.o({type:Number,reflect:!0})],s.prototype,`valueCurrent`,void 0),e.n([e.o({type:Number})],s.prototype,`valueMax`,void 0),e.n([e.o({type:Number})],s.prototype,`valueMin`,void 0),e.n([e.a()],s.prototype,`labelWidth`,void 0),e.n([e.a()],s.prototype,`progressbarId`,void 0),e.n([e.a()],s.prototype,`computedAriaLabelledby`,void 0),e.n([e.a()],s.prototype,`computedAriaValueText`,void 0);try{e.s(`pkt-progressbar`)(s)}catch{console.warn(`Forsøker å definere <pkt-progressbar>, men den er allerede definert`)}var c=s;Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return s}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return c}});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const e=require(`./element-
|
|
1
|
+
const e=require(`./element-CXAtr6Gu.cjs`),t=require(`./class-map-B8Ja0q7n.cjs`),n=require(`./ref-CBdWMlde.cjs`),r=require(`./input-element-BHQVt4Q9.cjs`);var i=class extends r.t{constructor(...e){super(...e),this.inputRef=n.t(),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(e,t,n){e===`defaultChecked`&&(this._checked=this.defaultChecked),e===`checked`&&(this._checked=this.checked===``||this.checked===`true`||this.checked===!0),super.attributeChangedCallback(e,t,n)}render(){let r=t.t({"pkt-input-check__input":!0,"pkt-input-check__input--tile":this.hasTile,"pkt-input-check__input--tile-disabled":this.disabled&&this.hasTile}),i=t.t({"pkt-input-check__input-checkbox":!0,"pkt-input-check__input-checkbox--error":this.hasError}),a=t.t({"pkt-input-check__input-label":!0,"pkt-input-check__input-label--disabled":this.disabled,"pkt-sr-only":this.hideLabel}),o=`pkt-tag pkt-tag--small pkt-tag--thin-text`;return e.p`
|
|
2
2
|
<div class="pkt-input-check">
|
|
3
3
|
<div class=${r}>
|
|
4
4
|
<input
|
|
@@ -16,16 +16,16 @@ const e=require(`./element-DjtxO-1r.cjs`),t=require(`./class-map-CJ-msbHs.cjs`),
|
|
|
16
16
|
@focus=${this.onFocus}
|
|
17
17
|
?checked=${this.checked}
|
|
18
18
|
/>
|
|
19
|
-
${e.
|
|
19
|
+
${e.p`
|
|
20
20
|
<label class=${a} for=${this.id+`-internal`}>
|
|
21
|
-
${this.label} ${e.
|
|
22
|
-
${this.tagText?e.
|
|
23
|
-
${this.optionalTag?e.
|
|
24
|
-
${this.requiredTag?e.
|
|
21
|
+
${this.label} ${e.p`
|
|
22
|
+
${this.tagText?e.p`<span class=${o+` pkt-tag--gray`}>${this.tagText}</span>`:e.d}
|
|
23
|
+
${this.optionalTag?e.p`<span class=${o+` pkt-tag--blue-light`}>${this.optionalText}</span>`:e.d}
|
|
24
|
+
${this.requiredTag?e.p`<span class=${o+` pkt-tag--beige`}>${this.requiredText}</span>`:e.d}
|
|
25
25
|
`}
|
|
26
|
-
${this.checkHelptext?e.
|
|
26
|
+
${this.checkHelptext?e.p`<div class="pkt-input-check__input-helptext">${this.checkHelptext}</div>`:e.d}
|
|
27
27
|
</label>
|
|
28
28
|
`}
|
|
29
29
|
</div>
|
|
30
30
|
</div>
|
|
31
|
-
`}toggleChecked(e=null){e&&e.preventDefault(),e&&e.stopImmediatePropagation(),this.touched=!0,this.inputRef.value&&(this._checked=this.inputRef.value.matches(`:checked`),this.valueChecked(this._checked))}};e.
|
|
31
|
+
`}toggleChecked(e=null){e&&e.preventDefault(),e&&e.stopImmediatePropagation(),this.touched=!0,this.inputRef.value&&(this._checked=this.inputRef.value.matches(`:checked`),this.valueChecked(this._checked))}};e.n([e.o({type:String,reflect:!0})],i.prototype,`value`,void 0),e.n([e.o({type:String})],i.prototype,`checkHelptext`,void 0),e.n([e.o({type:Boolean})],i.prototype,`defaultChecked`,void 0),e.n([e.o({type:Boolean})],i.prototype,`hasTile`,void 0),e.n([e.o({type:Boolean,reflect:!0})],i.prototype,`checked`,void 0),e.n([e.o({type:String,reflect:!0})],i.prototype,`type`,void 0),e.n([e.o({type:String})],i.prototype,`tagText`,void 0),e.n([e.o({type:Boolean})],i.prototype,`optionalTag`,void 0),e.n([e.o({type:String})],i.prototype,`optionalText`,void 0),e.n([e.o({type:Boolean})],i.prototype,`requiredTag`,void 0),e.n([e.o({type:String})],i.prototype,`requiredText`,void 0),e.n([e.a()],i.prototype,`_checked`,void 0);try{e.s(`pkt-radiobutton`)(i)}catch{console.warn(`Forsøker å definere <pkt-radiobutton>, men den er allerede definert`)}var a=i;Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return i}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return a}});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as o } from "./class-map-
|
|
3
|
-
import { n as s, t as c } from "./ref-
|
|
4
|
-
import { t as l } from "./input-element-
|
|
1
|
+
import { a as e, d as t, n, o as r, p as i, s as a } from "./element-CduG0XyF.js";
|
|
2
|
+
import { t as o } from "./class-map-DH9hlJny.js";
|
|
3
|
+
import { n as s, t as c } from "./ref-BgoHEsEt.js";
|
|
4
|
+
import { t as l } from "./input-element-BrmkXIXi.js";
|
|
5
5
|
//#region src/components/radiobutton/radiobutton.ts
|
|
6
6
|
var u = class extends l {
|
|
7
7
|
constructor(...e) {
|
|
@@ -18,20 +18,20 @@ var u = class extends l {
|
|
|
18
18
|
"pkt-input-check__input": !0,
|
|
19
19
|
"pkt-input-check__input--tile": this.hasTile,
|
|
20
20
|
"pkt-input-check__input--tile-disabled": this.disabled && this.hasTile
|
|
21
|
-
}),
|
|
21
|
+
}), n = o({
|
|
22
22
|
"pkt-input-check__input-checkbox": !0,
|
|
23
23
|
"pkt-input-check__input-checkbox--error": this.hasError
|
|
24
|
-
}),
|
|
24
|
+
}), r = o({
|
|
25
25
|
"pkt-input-check__input-label": !0,
|
|
26
26
|
"pkt-input-check__input-label--disabled": this.disabled,
|
|
27
27
|
"pkt-sr-only": this.hideLabel
|
|
28
28
|
}), a = "pkt-tag pkt-tag--small pkt-tag--thin-text";
|
|
29
|
-
return
|
|
29
|
+
return i`
|
|
30
30
|
<div class="pkt-input-check">
|
|
31
31
|
<div class=${e}>
|
|
32
32
|
<input
|
|
33
33
|
id=${this.id + "-internal"}
|
|
34
|
-
class=${
|
|
34
|
+
class=${n}
|
|
35
35
|
type="radio"
|
|
36
36
|
role="radio"
|
|
37
37
|
?disabled=${this.disabled}
|
|
@@ -44,14 +44,14 @@ var u = class extends l {
|
|
|
44
44
|
@focus=${this.onFocus}
|
|
45
45
|
?checked=${this.checked}
|
|
46
46
|
/>
|
|
47
|
-
${
|
|
48
|
-
<label class=${
|
|
49
|
-
${this.label} ${
|
|
50
|
-
${this.tagText ?
|
|
51
|
-
${this.optionalTag ?
|
|
52
|
-
${this.requiredTag ?
|
|
47
|
+
${i`
|
|
48
|
+
<label class=${r} for=${this.id + "-internal"}>
|
|
49
|
+
${this.label} ${i`
|
|
50
|
+
${this.tagText ? i`<span class=${a + " pkt-tag--gray"}>${this.tagText}</span>` : t}
|
|
51
|
+
${this.optionalTag ? i`<span class=${a + " pkt-tag--blue-light"}>${this.optionalText}</span>` : t}
|
|
52
|
+
${this.requiredTag ? i`<span class=${a + " pkt-tag--beige"}>${this.requiredText}</span>` : t}
|
|
53
53
|
`}
|
|
54
|
-
${this.checkHelptext ?
|
|
54
|
+
${this.checkHelptext ? i`<div class="pkt-input-check__input-helptext">${this.checkHelptext}</div>` : t}
|
|
55
55
|
</label>
|
|
56
56
|
`}
|
|
57
57
|
</div>
|
|
@@ -62,18 +62,18 @@ var u = class extends l {
|
|
|
62
62
|
e && e.preventDefault(), e && e.stopImmediatePropagation(), this.touched = !0, this.inputRef.value && (this._checked = this.inputRef.value.matches(":checked"), this.valueChecked(this._checked));
|
|
63
63
|
}
|
|
64
64
|
};
|
|
65
|
-
|
|
65
|
+
n([r({
|
|
66
66
|
type: String,
|
|
67
67
|
reflect: !0
|
|
68
|
-
})], u.prototype, "value", void 0),
|
|
68
|
+
})], u.prototype, "value", void 0), n([r({ type: String })], u.prototype, "checkHelptext", void 0), n([r({ type: Boolean })], u.prototype, "defaultChecked", void 0), n([r({ type: Boolean })], u.prototype, "hasTile", void 0), n([r({
|
|
69
69
|
type: Boolean,
|
|
70
70
|
reflect: !0
|
|
71
|
-
})], u.prototype, "checked", void 0),
|
|
71
|
+
})], u.prototype, "checked", void 0), n([r({
|
|
72
72
|
type: String,
|
|
73
73
|
reflect: !0
|
|
74
|
-
})], u.prototype, "type", void 0),
|
|
74
|
+
})], u.prototype, "type", void 0), n([r({ type: String })], u.prototype, "tagText", void 0), n([r({ type: Boolean })], u.prototype, "optionalTag", void 0), n([r({ type: String })], u.prototype, "optionalText", void 0), n([r({ type: Boolean })], u.prototype, "requiredTag", void 0), n([r({ type: String })], u.prototype, "requiredText", void 0), n([e()], u.prototype, "_checked", void 0);
|
|
75
75
|
try {
|
|
76
|
-
|
|
76
|
+
a("pkt-radiobutton")(u);
|
|
77
77
|
} catch {
|
|
78
78
|
console.warn("Forsøker å definere <pkt-radiobutton>, men den er allerede definert");
|
|
79
79
|
}
|
|
@@ -1,14 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t } from "./directive-
|
|
3
|
-
import { t as n } from "./async-directive-CaQiqjyV.js";
|
|
1
|
+
import { c as e, d as t } from "./element-CduG0XyF.js";
|
|
2
|
+
import { t as n } from "./async-directive-Cz6tcqge.js";
|
|
4
3
|
//#region ../../node_modules/lit-html/directives/ref.js
|
|
5
|
-
var r = () => new i(), i = class {}, a = /* @__PURE__ */ new WeakMap(), o =
|
|
6
|
-
render(
|
|
7
|
-
return
|
|
4
|
+
var r = () => new i(), i = class {}, a = /* @__PURE__ */ new WeakMap(), o = e(class extends n {
|
|
5
|
+
render(e) {
|
|
6
|
+
return t;
|
|
8
7
|
}
|
|
9
|
-
update(
|
|
8
|
+
update(e, [n]) {
|
|
10
9
|
let r = n !== this.G;
|
|
11
|
-
return r && this.G !== void 0 && this.rt(void 0), (r || this.lt !== this.ct) && (this.G = n, this.ht =
|
|
10
|
+
return r && this.G !== void 0 && this.rt(void 0), (r || this.lt !== this.ct) && (this.G = n, this.ht = e.options?.host, this.rt(this.ct = e.element)), t;
|
|
12
11
|
}
|
|
13
12
|
rt(e) {
|
|
14
13
|
if (this.isConnected || (e = void 0), typeof this.G == "function") {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require(`./element-CXAtr6Gu.cjs`),t=require(`./async-directive-DO1QtVmf.cjs`);var n=()=>new r,r=class{},i=new WeakMap,a=e.c(class extends t.t{render(t){return e.d}update(t,[n]){let r=n!==this.G;return r&&this.G!==void 0&&this.rt(void 0),(r||this.lt!==this.ct)&&(this.G=n,this.ht=t.options?.host,this.rt(this.ct=t.element)),e.d}rt(e){if(this.isConnected||(e=void 0),typeof this.G==`function`){let t=this.ht??globalThis,n=i.get(t);n===void 0&&(n=new WeakMap,i.set(t,n)),n.get(this.G)!==void 0&&this.G.call(this.ht,void 0),n.set(this.G,e),e!==void 0&&this.G.call(this.ht,e)}else this.G.value=e}get lt(){return typeof this.G==`function`?i.get(this.ht??globalThis)?.get(this.G):this.G?.value}disconnected(){this.lt===this.ct&&this.rt(void 0)}reconnected(){this.rt(this.ct)}});Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return a}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return n}});
|
|
@@ -1,14 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { n as
|
|
3
|
-
import { a as i, n as a, o, r as s, t as c } from "./directive-helpers-Dkv2gKgs.js";
|
|
1
|
+
import { c as e, f as t, l as n, u as r } from "./element-CduG0XyF.js";
|
|
2
|
+
import { a as i, n as a, o, r as s, t as c } from "./directive-helpers-Cep_4cpj.js";
|
|
4
3
|
//#region ../../node_modules/lit-html/directives/repeat.js
|
|
5
4
|
var l = (e, t, n) => {
|
|
6
5
|
let r = /* @__PURE__ */ new Map();
|
|
7
6
|
for (let i = t; i <= n; i++) r.set(e[i], i);
|
|
8
7
|
return r;
|
|
9
|
-
}, u =
|
|
8
|
+
}, u = e(class extends n {
|
|
10
9
|
constructor(e) {
|
|
11
|
-
if (super(e), e.type !==
|
|
10
|
+
if (super(e), e.type !== r.CHILD) throw Error("repeat() can only be used in text expressions");
|
|
12
11
|
}
|
|
13
12
|
dt(e, t, n) {
|
|
14
13
|
let r;
|
|
@@ -23,34 +22,34 @@ var l = (e, t, n) => {
|
|
|
23
22
|
render(e, t, n) {
|
|
24
23
|
return this.dt(e, t, n).values;
|
|
25
24
|
}
|
|
26
|
-
update(
|
|
27
|
-
let d = c(
|
|
25
|
+
update(e, [n, r, u]) {
|
|
26
|
+
let d = c(e), { values: f, keys: p } = this.dt(n, r, u);
|
|
28
27
|
if (!Array.isArray(d)) return this.ut = p, f;
|
|
29
28
|
let m = this.ut ??= [], h = [], g, _, v = 0, y = d.length - 1, b = 0, x = f.length - 1;
|
|
30
29
|
for (; v <= y && b <= x;) if (d[v] === null) v++;
|
|
31
30
|
else if (d[y] === null) y--;
|
|
32
31
|
else if (m[v] === p[b]) h[b] = i(d[v], f[b]), v++, b++;
|
|
33
32
|
else if (m[y] === p[x]) h[x] = i(d[y], f[x]), y--, x--;
|
|
34
|
-
else if (m[v] === p[x]) h[x] = i(d[v], f[x]), o(
|
|
35
|
-
else if (m[y] === p[b]) h[b] = i(d[y], f[b]), o(
|
|
33
|
+
else if (m[v] === p[x]) h[x] = i(d[v], f[x]), o(e, h[x + 1], d[v]), v++, x--;
|
|
34
|
+
else if (m[y] === p[b]) h[b] = i(d[y], f[b]), o(e, d[v], d[y]), y--, b++;
|
|
36
35
|
else if (g === void 0 && (g = l(p, b, x), _ = l(m, v, y)), g.has(m[v])) if (g.has(m[y])) {
|
|
37
|
-
let
|
|
36
|
+
let t = _.get(p[b]), n = t === void 0 ? null : d[t];
|
|
38
37
|
if (n === null) {
|
|
39
|
-
let
|
|
40
|
-
i(
|
|
41
|
-
} else h[b] = i(n, f[b]), o(
|
|
38
|
+
let t = o(e, d[v]);
|
|
39
|
+
i(t, f[b]), h[b] = t;
|
|
40
|
+
} else h[b] = i(n, f[b]), o(e, d[v], n), d[t] = null;
|
|
42
41
|
b++;
|
|
43
42
|
} else a(d[y]), y--;
|
|
44
43
|
else a(d[v]), v++;
|
|
45
44
|
for (; b <= x;) {
|
|
46
|
-
let
|
|
47
|
-
i(
|
|
45
|
+
let t = o(e, h[x + 1]);
|
|
46
|
+
i(t, f[b]), h[b++] = t;
|
|
48
47
|
}
|
|
49
48
|
for (; v <= y;) {
|
|
50
49
|
let e = d[v++];
|
|
51
50
|
e !== null && a(e);
|
|
52
51
|
}
|
|
53
|
-
return this.ut = p, s(
|
|
52
|
+
return this.ut = p, s(e, h), t;
|
|
54
53
|
}
|
|
55
54
|
});
|
|
56
55
|
//#endregion
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require(`./element-CXAtr6Gu.cjs`),t=require(`./directive-helpers-f36YZFOG.cjs`);var n=(e,t,n)=>{let r=new Map;for(let i=t;i<=n;i++)r.set(e[i],i);return r},r=e.c(class extends e.l{constructor(t){if(super(t),t.type!==e.u.CHILD)throw Error(`repeat() can only be used in text expressions`)}dt(e,t,n){let r;n===void 0?n=t:t!==void 0&&(r=t);let i=[],a=[],o=0;for(let t of e)i[o]=r?r(t,o):o,a[o]=n(t,o),o++;return{values:a,keys:i}}render(e,t,n){return this.dt(e,t,n).values}update(r,[i,a,o]){let s=t.t(r),{values:c,keys:l}=this.dt(i,a,o);if(!Array.isArray(s))return this.ut=l,c;let u=this.ut??=[],d=[],f,p,m=0,h=s.length-1,g=0,_=c.length-1;for(;m<=h&&g<=_;)if(s[m]===null)m++;else if(s[h]===null)h--;else if(u[m]===l[g])d[g]=t.a(s[m],c[g]),m++,g++;else if(u[h]===l[_])d[_]=t.a(s[h],c[_]),h--,_--;else if(u[m]===l[_])d[_]=t.a(s[m],c[_]),t.o(r,d[_+1],s[m]),m++,_--;else if(u[h]===l[g])d[g]=t.a(s[h],c[g]),t.o(r,s[m],s[h]),h--,g++;else if(f===void 0&&(f=n(l,g,_),p=n(u,m,h)),f.has(u[m]))if(f.has(u[h])){let e=p.get(l[g]),n=e===void 0?null:s[e];if(n===null){let e=t.o(r,s[m]);t.a(e,c[g]),d[g]=e}else d[g]=t.a(n,c[g]),t.o(r,s[m],n),s[e]=null;g++}else t.n(s[h]),h--;else t.n(s[m]),m++;for(;g<=_;){let e=t.o(r,d[_+1]);t.a(e,c[g]),d[g++]=e}for(;m<=h;){let e=s[m++];e!==null&&t.n(e)}return this.ut=l,t.r(r,d),e.f}});Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return r}});
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
const e=require(`./element-
|
|
2
|
-
${t.title?e.
|
|
3
|
-
${t.text?e.
|
|
4
|
-
`;return t.href?e.
|
|
1
|
+
const e=require(`./element-CXAtr6Gu.cjs`),t=require(`./class-map-B8Ja0q7n.cjs`);require(`./icon-Dw6I0HDV.cjs`);const n=require(`./if-defined-LTjAScFG.cjs`),r=require(`./focus-modality-controller-wI5SR8wH.cjs`);var i=class extends e.t{constructor(...e){super(...e),this.appearance=`local`,this.disabled=!1,this.fullwidth=!1,this.id=``,this.placeholder=`Søk…`,this.value=``,this.focusModality=new r.t(this,`.pkt-searchinput`)}get suggestionsId(){return`${this.id}-suggestions`}dispatchSearch(){this.dispatchEvent(new CustomEvent(`pkt-search`,{detail:{value:this.value},bubbles:!0,composed:!0}))}onInput(e){this.value=e.target.value}onInputKeydown(e){e.key===`Enter`&&(e.preventDefault(),this.dispatchSearch())}onSearchClick(e){e.preventDefault(),this.dispatchSearch()}onSuggestionClick(e,t,n){let r=new CustomEvent(`pkt-suggestion-click`,{detail:{index:n,suggestion:t},bubbles:!0,composed:!0,cancelable:!0});this.dispatchEvent(r)||e.preventDefault()}renderSuggestion(t,n){let r=e.p`
|
|
2
|
+
${t.title?e.p`<h3 class="pkt-searchinput__suggestion-title">${t.title}</h3>`:e.d}
|
|
3
|
+
${t.text?e.p`<p class="pkt-searchinput__suggestion-text">${t.text}</p>`:e.d}
|
|
4
|
+
`;return t.href?e.p`<a
|
|
5
5
|
href=${t.href}
|
|
6
6
|
class="pkt-searchinput__suggestion"
|
|
7
7
|
@click=${e=>this.onSuggestionClick(e,t,n)}
|
|
8
8
|
>
|
|
9
9
|
${r}
|
|
10
|
-
</a>`:t.nonInteractive?e.
|
|
10
|
+
</a>`:t.nonInteractive?e.p`<div class="pkt-searchinput__suggestion">${r}</div>`:e.p`<button
|
|
11
11
|
type="button"
|
|
12
12
|
class="pkt-searchinput__suggestion"
|
|
13
13
|
@click=${e=>this.onSuggestionClick(e,t,n)}
|
|
14
14
|
>
|
|
15
15
|
${r}
|
|
16
|
-
</button>`}render(){let r=t.t({"pkt-searchinput":!0,[`pkt-searchinput--${this.appearance}`]:!0,"pkt-searchinput--fullwidth":this.fullwidth}),i=t.t({"pkt-searchinput__button":!0,"pkt-input-icon":this.appearance===`local`,"pkt-btn":!0,"pkt-btn--medium":!0,"pkt-btn--icon-only":!0,"pkt-btn--tertiary":this.appearance===`local`,"pkt-btn--primary":this.appearance===`global`||this.appearance===`local-with-button`,"pkt-btn--yellow":this.appearance===`global`}),a=t.t({"pkt-input":!0,"pkt-input--fullwidth":this.fullwidth}),o=this.appearance===`local`?`pkt-input__container`:`pkt-searchinput__field`,s=e.
|
|
17
|
-
${this.label?e.
|
|
16
|
+
</button>`}render(){let r=t.t({"pkt-searchinput":!0,[`pkt-searchinput--${this.appearance}`]:!0,"pkt-searchinput--fullwidth":this.fullwidth}),i=t.t({"pkt-searchinput__button":!0,"pkt-input-icon":this.appearance===`local`,"pkt-btn":!0,"pkt-btn--medium":!0,"pkt-btn--icon-only":!0,"pkt-btn--tertiary":this.appearance===`local`,"pkt-btn--primary":this.appearance===`global`||this.appearance===`local-with-button`,"pkt-btn--yellow":this.appearance===`global`}),a=t.t({"pkt-input":!0,"pkt-input--fullwidth":this.fullwidth}),o=this.appearance===`local`?`pkt-input__container`:`pkt-searchinput__field`,s=e.p`
|
|
17
|
+
${this.label?e.p`<label for=${n.t(this.id||void 0)} class="pkt-inputwrapper__label"
|
|
18
18
|
>${this.label}</label
|
|
19
|
-
>`:e.
|
|
19
|
+
>`:e.d}
|
|
20
20
|
<div class=${o}>
|
|
21
21
|
<input
|
|
22
22
|
class=${a}
|
|
@@ -42,14 +42,14 @@ const e=require(`./element-DjtxO-1r.cjs`),t=require(`./class-map-CJ-msbHs.cjs`);
|
|
|
42
42
|
<span class="pkt-btn__text">${this.label||this.placeholder||`Søk…`}</span>
|
|
43
43
|
</button>
|
|
44
44
|
</div>
|
|
45
|
-
${this.suggestions?e.
|
|
45
|
+
${this.suggestions?e.p`<ul
|
|
46
46
|
id=${this.suggestionsId}
|
|
47
47
|
class="pkt-searchinput__suggestions"
|
|
48
48
|
aria-live="assertive"
|
|
49
49
|
>
|
|
50
|
-
${this.suggestions.map((t,n)=>e.
|
|
51
|
-
</ul>`:e.
|
|
52
|
-
`;return this.action?e.
|
|
50
|
+
${this.suggestions.map((t,n)=>e.p` <li>${this.renderSuggestion(t,n)}</li> `)}
|
|
51
|
+
</ul>`:e.d}
|
|
52
|
+
`;return this.action?e.p`<form
|
|
53
53
|
role="search"
|
|
54
54
|
class=${r}
|
|
55
55
|
action=${this.action}
|
|
@@ -57,4 +57,4 @@ const e=require(`./element-DjtxO-1r.cjs`),t=require(`./class-map-CJ-msbHs.cjs`);
|
|
|
57
57
|
@submit=${e=>{e.preventDefault()}}
|
|
58
58
|
>
|
|
59
59
|
${s}
|
|
60
|
-
</form>`:e.
|
|
60
|
+
</form>`:e.p`<div role="search" class=${r}>${s}</div>`}};e.n([e.o({type:String})],i.prototype,`appearance`,void 0),e.n([e.o({type:Boolean,reflect:!0})],i.prototype,`disabled`,void 0),e.n([e.o({type:Boolean,reflect:!0})],i.prototype,`fullwidth`,void 0),e.n([e.o({type:String,reflect:!0})],i.prototype,`id`,void 0),e.n([e.o({type:String})],i.prototype,`label`,void 0),e.n([e.o({type:String})],i.prototype,`name`,void 0),e.n([e.o({type:String})],i.prototype,`placeholder`,void 0),e.n([e.o({type:String})],i.prototype,`value`,void 0),e.n([e.o({type:Array})],i.prototype,`suggestions`,void 0),e.n([e.o({type:String})],i.prototype,`action`,void 0),e.n([e.o({type:String})],i.prototype,`method`,void 0);try{e.s(`pkt-searchinput`)(i)}catch{console.warn(`Forsøker å definere <pkt-searchinput>, men den er allerede definert`)}var a=i;Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return i}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return a}});
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as o } from "./class-map-
|
|
3
|
-
import "./icon-
|
|
4
|
-
import { t as s } from "./if-defined-
|
|
5
|
-
import { t as c } from "./focus-modality-controller-
|
|
1
|
+
import { d as e, n as t, o as n, p as r, s as i, t as a } from "./element-CduG0XyF.js";
|
|
2
|
+
import { t as o } from "./class-map-DH9hlJny.js";
|
|
3
|
+
import "./icon-LaKyBKON.js";
|
|
4
|
+
import { t as s } from "./if-defined-VShASPdu.js";
|
|
5
|
+
import { t as c } from "./focus-modality-controller-CaUqYdk0.js";
|
|
6
6
|
//#region src/components/searchinput/searchinput.ts
|
|
7
7
|
var l = class extends a {
|
|
8
8
|
constructor(...e) {
|
|
@@ -39,31 +39,31 @@ var l = class extends a {
|
|
|
39
39
|
});
|
|
40
40
|
this.dispatchEvent(r) || e.preventDefault();
|
|
41
41
|
}
|
|
42
|
-
renderSuggestion(
|
|
43
|
-
let i =
|
|
44
|
-
${
|
|
45
|
-
${
|
|
42
|
+
renderSuggestion(t, n) {
|
|
43
|
+
let i = r`
|
|
44
|
+
${t.title ? r`<h3 class="pkt-searchinput__suggestion-title">${t.title}</h3>` : e}
|
|
45
|
+
${t.text ? r`<p class="pkt-searchinput__suggestion-text">${t.text}</p>` : e}
|
|
46
46
|
`;
|
|
47
|
-
return
|
|
48
|
-
href=${
|
|
47
|
+
return t.href ? r`<a
|
|
48
|
+
href=${t.href}
|
|
49
49
|
class="pkt-searchinput__suggestion"
|
|
50
|
-
@click=${(
|
|
50
|
+
@click=${(e) => this.onSuggestionClick(e, t, n)}
|
|
51
51
|
>
|
|
52
52
|
${i}
|
|
53
|
-
</a>` :
|
|
53
|
+
</a>` : t.nonInteractive ? r`<div class="pkt-searchinput__suggestion">${i}</div>` : r`<button
|
|
54
54
|
type="button"
|
|
55
55
|
class="pkt-searchinput__suggestion"
|
|
56
|
-
@click=${(
|
|
56
|
+
@click=${(e) => this.onSuggestionClick(e, t, n)}
|
|
57
57
|
>
|
|
58
58
|
${i}
|
|
59
59
|
</button>`;
|
|
60
60
|
}
|
|
61
61
|
render() {
|
|
62
|
-
let
|
|
62
|
+
let t = o({
|
|
63
63
|
"pkt-searchinput": !0,
|
|
64
64
|
[`pkt-searchinput--${this.appearance}`]: !0,
|
|
65
65
|
"pkt-searchinput--fullwidth": this.fullwidth
|
|
66
|
-
}),
|
|
66
|
+
}), n = o({
|
|
67
67
|
"pkt-searchinput__button": !0,
|
|
68
68
|
"pkt-input-icon": this.appearance === "local",
|
|
69
69
|
"pkt-btn": !0,
|
|
@@ -75,10 +75,10 @@ var l = class extends a {
|
|
|
75
75
|
}), i = o({
|
|
76
76
|
"pkt-input": !0,
|
|
77
77
|
"pkt-input--fullwidth": this.fullwidth
|
|
78
|
-
}), a = this.appearance === "local" ? "pkt-input__container" : "pkt-searchinput__field", c =
|
|
79
|
-
${this.label ?
|
|
78
|
+
}), a = this.appearance === "local" ? "pkt-input__container" : "pkt-searchinput__field", c = r`
|
|
79
|
+
${this.label ? r`<label for=${s(this.id || void 0)} class="pkt-inputwrapper__label"
|
|
80
80
|
>${this.label}</label
|
|
81
|
-
>` :
|
|
81
|
+
>` : e}
|
|
82
82
|
<div class=${a}>
|
|
83
83
|
<input
|
|
84
84
|
class=${i}
|
|
@@ -96,7 +96,7 @@ var l = class extends a {
|
|
|
96
96
|
/>
|
|
97
97
|
<button
|
|
98
98
|
type="submit"
|
|
99
|
-
class=${
|
|
99
|
+
class=${n}
|
|
100
100
|
?disabled=${this.disabled}
|
|
101
101
|
@click=${this.onSearchClick}
|
|
102
102
|
>
|
|
@@ -104,17 +104,17 @@ var l = class extends a {
|
|
|
104
104
|
<span class="pkt-btn__text">${this.label || this.placeholder || "Søk…"}</span>
|
|
105
105
|
</button>
|
|
106
106
|
</div>
|
|
107
|
-
${this.suggestions ?
|
|
107
|
+
${this.suggestions ? r`<ul
|
|
108
108
|
id=${this.suggestionsId}
|
|
109
109
|
class="pkt-searchinput__suggestions"
|
|
110
110
|
aria-live="assertive"
|
|
111
111
|
>
|
|
112
|
-
${this.suggestions.map((e,
|
|
113
|
-
</ul>` :
|
|
112
|
+
${this.suggestions.map((e, t) => r` <li>${this.renderSuggestion(e, t)}</li> `)}
|
|
113
|
+
</ul>` : e}
|
|
114
114
|
`;
|
|
115
|
-
return this.action ?
|
|
115
|
+
return this.action ? r`<form
|
|
116
116
|
role="search"
|
|
117
|
-
class=${
|
|
117
|
+
class=${t}
|
|
118
118
|
action=${this.action}
|
|
119
119
|
method=${s(this.method)}
|
|
120
120
|
@submit=${(e) => {
|
|
@@ -122,21 +122,21 @@ var l = class extends a {
|
|
|
122
122
|
}}
|
|
123
123
|
>
|
|
124
124
|
${c}
|
|
125
|
-
</form>` :
|
|
125
|
+
</form>` : r`<div role="search" class=${t}>${c}</div>`;
|
|
126
126
|
}
|
|
127
127
|
};
|
|
128
|
-
|
|
128
|
+
t([n({ type: String })], l.prototype, "appearance", void 0), t([n({
|
|
129
129
|
type: Boolean,
|
|
130
130
|
reflect: !0
|
|
131
|
-
})], l.prototype, "disabled", void 0),
|
|
131
|
+
})], l.prototype, "disabled", void 0), t([n({
|
|
132
132
|
type: Boolean,
|
|
133
133
|
reflect: !0
|
|
134
|
-
})], l.prototype, "fullwidth", void 0),
|
|
134
|
+
})], l.prototype, "fullwidth", void 0), t([n({
|
|
135
135
|
type: String,
|
|
136
136
|
reflect: !0
|
|
137
|
-
})], l.prototype, "id", void 0),
|
|
137
|
+
})], l.prototype, "id", void 0), t([n({ type: String })], l.prototype, "label", void 0), t([n({ type: String })], l.prototype, "name", void 0), t([n({ type: String })], l.prototype, "placeholder", void 0), t([n({ type: String })], l.prototype, "value", void 0), t([n({ type: Array })], l.prototype, "suggestions", void 0), t([n({ type: String })], l.prototype, "action", void 0), t([n({ type: String })], l.prototype, "method", void 0);
|
|
138
138
|
try {
|
|
139
|
-
|
|
139
|
+
i("pkt-searchinput")(l);
|
|
140
140
|
} catch {
|
|
141
141
|
console.warn("Forsøker å definere <pkt-searchinput>, men den er allerede definert");
|
|
142
142
|
}
|